aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>1999-01-21 00:55:32 +0000
committercvs2svn <cvs2svn@FreeBSD.org>1999-01-21 00:55:32 +0000
commit76b5366091f76c9bc73570149ef5055648fc2c39 (patch)
tree590d020e0f2a5bea6e09d66d951a674443b21d67
parent4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff)
This commit was manufactured by cvs2svn to create tagrelease/3.0.0
'RELENG_3_0_0_RELEASE'.
Notes
Notes: svn path=/stable/3/; revision=42951 svn path=/release/3.0.0/; revision=42952; tag=release/3.0.0
-rw-r--r--Makefile13
-rw-r--r--Makefile.inc021
-rw-r--r--Makefile.inc1100
-rw-r--r--Makefile.upgrade27
-rw-r--r--README4
-rw-r--r--UPDATING88
-rw-r--r--bin/Makefile.inc3
-rw-r--r--bin/chio/chio.14
-rw-r--r--bin/chio/chio.c14
-rw-r--r--bin/chmod/chmod.c3
-rw-r--r--bin/cp/Makefile3
-rw-r--r--bin/cp/utils.c4
-rw-r--r--bin/csh/dir.c4
-rw-r--r--bin/date/Makefile3
-rw-r--r--bin/date/date.14
-rw-r--r--bin/dd/dd.114
-rw-r--r--bin/dd/misc.c8
-rw-r--r--bin/df/df.c19
-rw-r--r--bin/expr/expr.15
-rw-r--r--bin/ls/ls.14
-rw-r--r--bin/mkdir/mkdir.c26
-rw-r--r--bin/pax/pat_rep.c4
-rw-r--r--bin/pax/tar.c13
-rw-r--r--bin/ps/fmt.c6
-rw-r--r--bin/ps/keyword.c9
-rw-r--r--bin/ps/print.c6
-rw-r--r--bin/pwd/pwd.c4
-rw-r--r--bin/rcp/Makefile3
-rw-r--r--bin/sh/bltin/bltin.h14
-rw-r--r--bin/sh/miscbltin.c5
-rw-r--r--bin/sh/sh.17
-rw-r--r--bin/test/test.15
-rw-r--r--contrib/amd/AUTHORS27
-rw-r--r--contrib/amd/BUGS19
-rw-r--r--contrib/amd/ChangeLog312
-rw-r--r--contrib/amd/FREEBSD-upgrade17
-rw-r--r--contrib/amd/INSTALL69
-rw-r--r--contrib/amd/LSM.am-utils20
-rw-r--r--contrib/amd/MIRRORS9
-rw-r--r--contrib/amd/NEWS48
-rw-r--r--contrib/amd/README6
-rw-r--r--contrib/amd/README.y2k18
-rw-r--r--contrib/amd/TODO2
-rw-r--r--contrib/amd/amd/am_ops.c8
-rw-r--r--contrib/amd/amd/amd.c43
-rw-r--r--contrib/amd/amd/amd.h27
-rw-r--r--contrib/amd/amd/amfs_auto.c17
-rw-r--r--contrib/amd/amd/amfs_direct.c4
-rw-r--r--contrib/amd/amd/amfs_error.c4
-rw-r--r--contrib/amd/amd/amfs_host.c12
-rw-r--r--contrib/amd/amd/amfs_inherit.c6
-rw-r--r--contrib/amd/amd/amfs_link.c4
-rw-r--r--contrib/amd/amd/amfs_linkx.c5
-rw-r--r--contrib/amd/amd/amfs_nfsl.c10
-rw-r--r--contrib/amd/amd/amfs_nfsx.c6
-rw-r--r--contrib/amd/amd/amfs_program.c4
-rw-r--r--contrib/amd/amd/amfs_root.c4
-rw-r--r--contrib/amd/amd/amfs_toplvl.c8
-rw-r--r--contrib/amd/amd/amfs_union.c4
-rw-r--r--contrib/amd/amd/amq_subr.c8
-rw-r--r--contrib/amd/amd/amq_svc.c4
-rw-r--r--contrib/amd/amd/autil.c6
-rw-r--r--contrib/amd/amd/clock.c6
-rw-r--r--contrib/amd/amd/conf.c16
-rw-r--r--contrib/amd/amd/conf_parse.y4
-rw-r--r--contrib/amd/amd/conf_tok.l6
-rw-r--r--contrib/amd/amd/get_args.c16
-rw-r--r--contrib/amd/amd/info_file.c4
-rw-r--r--contrib/amd/amd/info_hesiod.c4
-rw-r--r--contrib/amd/amd/info_ldap.c6
-rw-r--r--contrib/amd/amd/info_ndbm.c4
-rw-r--r--contrib/amd/amd/info_nis.c38
-rw-r--r--contrib/amd/amd/info_nisplus.c4
-rw-r--r--contrib/amd/amd/info_passwd.c4
-rw-r--r--contrib/amd/amd/info_union.c4
-rw-r--r--contrib/amd/amd/map.c16
-rw-r--r--contrib/amd/amd/mapc.c32
-rw-r--r--contrib/amd/amd/mntfs.c4
-rw-r--r--contrib/amd/amd/nfs_prot_svc.c4
-rw-r--r--contrib/amd/amd/nfs_start.c4
-rw-r--r--contrib/amd/amd/nfs_subr.c13
-rw-r--r--contrib/amd/amd/ops_TEMPLATE.c4
-rw-r--r--contrib/amd/amd/ops_autofs.c32
-rw-r--r--contrib/amd/amd/ops_cachefs.c4
-rw-r--r--contrib/amd/amd/ops_cdfs.c4
-rw-r--r--contrib/amd/amd/ops_efs.c4
-rw-r--r--contrib/amd/amd/ops_lofs.c4
-rw-r--r--contrib/amd/amd/ops_mfs.c6
-rw-r--r--contrib/amd/amd/ops_nfs.c4
-rw-r--r--contrib/amd/amd/ops_nfs3.c6
-rw-r--r--contrib/amd/amd/ops_nullfs.c6
-rw-r--r--contrib/amd/amd/ops_pcfs.c4
-rw-r--r--contrib/amd/amd/ops_tfs.c6
-rw-r--r--contrib/amd/amd/ops_tmpfs.c6
-rw-r--r--contrib/amd/amd/ops_ufs.c4
-rw-r--r--contrib/amd/amd/ops_umapfs.c6
-rw-r--r--contrib/amd/amd/ops_unionfs.c6
-rw-r--r--contrib/amd/amd/ops_xfs.c4
-rw-r--r--contrib/amd/amd/opts.c17
-rw-r--r--contrib/amd/amd/restart.c4
-rw-r--r--contrib/amd/amd/rpc_fwd.c4
-rw-r--r--contrib/amd/amd/sched.c8
-rw-r--r--contrib/amd/amd/srvr_amfs_auto.c4
-rw-r--r--contrib/amd/amd/srvr_nfs.c28
-rw-r--r--contrib/amd/amq/amq.88
-rw-r--r--contrib/amd/amq/amq.c71
-rw-r--r--contrib/amd/amq/amq.h4
-rw-r--r--contrib/amd/amq/amq_clnt.c4
-rw-r--r--contrib/amd/amq/amq_xdr.c4
-rw-r--r--contrib/amd/amq/pawd.c10
-rw-r--r--contrib/amd/conf/checkmount/checkmount_bsd44.c4
-rw-r--r--contrib/amd/conf/mtab/mtab_bsd.c4
-rw-r--r--contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h4
-rw-r--r--contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h80
-rw-r--r--contrib/amd/conf/transp/transp_sockets.c6
-rw-r--r--contrib/amd/conf/umount/umount_bsd44.c4
-rw-r--r--contrib/amd/doc/am-utils.texi180
-rw-r--r--contrib/amd/doc/stamp-vti6
-rw-r--r--contrib/amd/doc/texinfo.tex2116
-rw-r--r--contrib/amd/doc/version.texi6
-rw-r--r--contrib/amd/fixmount/fixmount.84
-rw-r--r--contrib/amd/fixmount/fixmount.c11
-rw-r--r--contrib/amd/fsinfo/fsi_analyze.c4
-rw-r--r--contrib/amd/fsinfo/fsi_data.h13
-rw-r--r--contrib/amd/fsinfo/fsi_dict.c4
-rw-r--r--contrib/amd/fsinfo/fsi_gram.y4
-rw-r--r--contrib/amd/fsinfo/fsi_lex.l6
-rw-r--r--contrib/amd/fsinfo/fsi_util.c4
-rw-r--r--contrib/amd/fsinfo/fsinfo.c11
-rw-r--r--contrib/amd/fsinfo/fsinfo.h5
-rw-r--r--contrib/amd/fsinfo/wr_atab.c6
-rw-r--r--contrib/amd/fsinfo/wr_bparam.c4
-rw-r--r--contrib/amd/fsinfo/wr_dumpset.c4
-rw-r--r--contrib/amd/fsinfo/wr_exportfs.c4
-rw-r--r--contrib/amd/fsinfo/wr_fstab.c4
-rw-r--r--contrib/amd/hlfsd/hlfsd.c82
-rw-r--r--contrib/amd/hlfsd/hlfsd.h6
-rw-r--r--contrib/amd/hlfsd/homedir.c6
-rw-r--r--contrib/amd/hlfsd/nfs_prot_svc.c4
-rw-r--r--contrib/amd/hlfsd/stubs.c14
-rw-r--r--contrib/amd/include/am_defs.h45
-rw-r--r--contrib/amd/include/am_utils.h34
-rw-r--r--contrib/amd/include/am_xdr_func.h4
-rw-r--r--contrib/amd/include/amq_defs.h4
-rw-r--r--contrib/amd/libamu/amu.h4
-rw-r--r--contrib/amd/libamu/clnt_sperrno.c147
-rw-r--r--contrib/amd/libamu/hasmntopt.c6
-rw-r--r--contrib/amd/libamu/misc_rpc.c6
-rw-r--r--contrib/amd/libamu/mount_fs.c6
-rw-r--r--contrib/amd/libamu/mtab.c4
-rw-r--r--contrib/amd/libamu/nfs_prot_xdr.c4
-rw-r--r--contrib/amd/libamu/util.c6
-rw-r--r--contrib/amd/libamu/wire.c6
-rw-r--r--contrib/amd/libamu/xdr_func.c4
-rw-r--r--contrib/amd/libamu/xutil.c69
-rw-r--r--contrib/amd/mk-amd-map/mk-amd-map.c198
-rw-r--r--contrib/amd/scripts/Makefile.am2
-rw-r--r--contrib/amd/scripts/Makefile.in10
-rw-r--r--contrib/amd/scripts/amd.conf.516
-rwxr-xr-xcontrib/amd/scripts/ctl-amd.in8
-rwxr-xr-xcontrib/amd/scripts/ctl-hlfsd.in6
-rw-r--r--contrib/amd/scripts/expn.12
-rwxr-xr-xcontrib/amd/scripts/expn.in2
-rwxr-xr-xcontrib/amd/scripts/fixrmtab (renamed from contrib/amd/scripts/fixrmtab.in)0
-rw-r--r--contrib/amd/tasks13
-rw-r--r--contrib/amd/wire-test/wire-test.c20
-rw-r--r--contrib/bind/bin/named/Makefile2
-rw-r--r--contrib/binutils/binutils/objcopy.12
-rw-r--r--contrib/binutils/binutils/objdump.14
-rw-r--r--contrib/binutils/binutils/strings.c4
-rw-r--r--contrib/binutils/binutils/strip.12
-rw-r--r--contrib/binutils/gas/doc/as.12
-rw-r--r--contrib/binutils/ld/emultempl/elf32.em77
-rw-r--r--contrib/cvs/contrib/log.pl5
-rw-r--r--contrib/cvs/contrib/sccs2rcs.csh2
-rw-r--r--contrib/cvs/man/cvs.119
-rw-r--r--contrib/cvs/src/main.c10
-rw-r--r--contrib/gcc/config/i386/freebsd.h2
-rw-r--r--contrib/gcc/config/i386/freebsd.h.fixed2
-rw-r--r--contrib/gcc/gcc.14
-rw-r--r--contrib/gcc/gcc.c4
-rw-r--r--contrib/global/COPYING25
-rw-r--r--contrib/global/FAQ67
-rw-r--r--contrib/global/HISTORY224
-rw-r--r--contrib/global/INSTALL143
-rw-r--r--contrib/global/MANIFEST11
-rw-r--r--contrib/global/Makefile.inc15
-rw-r--r--contrib/global/PROBLEMS38
-rw-r--r--contrib/global/README845
-rw-r--r--contrib/global/VERSION2
-rw-r--r--contrib/global/btreeop/Makefile3
-rw-r--r--contrib/global/btreeop/btreeop.118
-rw-r--r--contrib/global/btreeop/btreeop.c139
-rw-r--r--contrib/global/dbpatches/README37
-rw-r--r--contrib/global/dbpatches/patch.1.219
-rw-r--r--contrib/global/dbpatches/patch.1.337
-rw-r--r--contrib/global/dbpatches/patch.1.422
-rw-r--r--contrib/global/gctags/C.c1151
-rw-r--r--contrib/global/gctags/C.h92
-rw-r--r--contrib/global/gctags/Makefile5
-rw-r--r--contrib/global/gctags/assembler.c165
-rw-r--r--contrib/global/gctags/ctags.c379
-rw-r--r--contrib/global/gctags/ctags.h123
-rw-r--r--contrib/global/gctags/fortran.c168
-rw-r--r--contrib/global/gctags/gctags.1200
-rw-r--r--contrib/global/gctags/gctags.c181
-rw-r--r--contrib/global/gctags/gctags.h91
-rw-r--r--contrib/global/gctags/java.c240
-rw-r--r--contrib/global/gctags/java.h91
-rw-r--r--contrib/global/gctags/lisp.c105
-rw-r--r--contrib/global/gctags/print.c178
-rw-r--r--contrib/global/gctags/tree.c140
-rw-r--r--contrib/global/gctags/yacc.c151
-rw-r--r--contrib/global/global.conf157
-rw-r--r--contrib/global/global/Makefile3
-rw-r--r--contrib/global/global/global.168
-rw-r--r--contrib/global/global/global.c716
-rw-r--r--contrib/global/gozilla/Imakefile22
-rw-r--r--contrib/global/gozilla/gozilla.c68
-rw-r--r--contrib/global/gozilla/gozilla.man4
-rw-r--r--contrib/global/gozilla/remote.c2
-rw-r--r--contrib/global/gtags.el58
-rw-r--r--contrib/global/gtags/Makefile3
-rw-r--r--contrib/global/gtags/gtags.123
-rw-r--r--contrib/global/gtags/gtags.c405
-rw-r--r--contrib/global/htags/htags.166
-rw-r--r--contrib/global/htags/htags.pl915
-rw-r--r--contrib/global/lib/Makefile13
-rw-r--r--contrib/global/lib/conf.c308
-rw-r--r--contrib/global/lib/conf.h54
-rw-r--r--contrib/global/lib/dbio.c328
-rw-r--r--contrib/global/lib/dbio.h89
-rw-r--r--contrib/global/lib/dbname.c48
-rw-r--r--contrib/global/lib/dbname.h53
-rw-r--r--contrib/global/lib/dbop.c332
-rw-r--r--contrib/global/lib/dbop.h88
-rw-r--r--contrib/global/lib/defined.c66
-rw-r--r--contrib/global/lib/defined.h48
-rw-r--r--contrib/global/lib/die.h8
-rw-r--r--contrib/global/lib/find.c409
-rw-r--r--contrib/global/lib/find.h2
-rw-r--r--contrib/global/lib/getdbpath.c47
-rw-r--r--contrib/global/lib/getdbpath.h2
-rw-r--r--contrib/global/lib/global.h27
-rw-r--r--contrib/global/lib/gparam.h14
-rw-r--r--contrib/global/lib/gtagsop.c644
-rw-r--r--contrib/global/lib/gtagsop.h109
-rw-r--r--contrib/global/lib/gtagsopen.c100
-rw-r--r--contrib/global/lib/gtagsopen.h41
-rw-r--r--contrib/global/lib/locatestring.c33
-rw-r--r--contrib/global/lib/locatestring.h11
-rw-r--r--contrib/global/lib/lookup.c64
-rw-r--r--contrib/global/lib/lookup.h50
-rw-r--r--contrib/global/lib/makepath.c33
-rw-r--r--contrib/global/lib/makepath.h4
-rw-r--r--contrib/global/lib/mgets.c55
-rw-r--r--contrib/global/lib/mgets.h5
-rw-r--r--contrib/global/lib/pathop.c155
-rw-r--r--contrib/global/lib/pathop.h59
-rw-r--r--contrib/global/lib/strbuf.c137
-rw-r--r--contrib/global/lib/strbuf.h82
-rw-r--r--contrib/global/lib/strmake.c59
-rw-r--r--contrib/global/lib/strmake.h48
-rw-r--r--contrib/global/lib/strop.c121
-rw-r--r--contrib/global/lib/strop.h52
-rw-r--r--contrib/global/lib/tab.c27
-rw-r--r--contrib/global/lib/tab.h5
-rw-r--r--contrib/global/lib/tag.c85
-rw-r--r--contrib/global/lib/tag.h51
-rw-r--r--contrib/global/lib/test.c18
-rw-r--r--contrib/global/lib/test.h4
-rw-r--r--contrib/global/lib/token.c293
-rw-r--r--contrib/global/lib/token.h75
-rw-r--r--contrib/global/lib/usable.c70
-rw-r--r--contrib/global/lib/usable.h48
-rw-r--r--contrib/global/nvi-1.34.diff900
-rw-r--r--contrib/global/nvi-1.66.diff673
-rw-r--r--contrib/global/nvi-1.79.diff84
-rwxr-xr-xcontrib/global/systags/systags.sh200
-rw-r--r--contrib/groff/tmac/doc-common3
-rw-r--r--contrib/groff/tmac/doc-syms16
-rw-r--r--contrib/groff/tmac/hyphen.us-ru4833
-rw-r--r--contrib/groff/tmac/locale/hyphen.us-ru4833
-rw-r--r--contrib/groff/tmac/tmac.e3
-rw-r--r--contrib/ipfilter/ipmon.c5
-rw-r--r--contrib/ipfilter/ipsend/ipsend.52
-rw-r--r--contrib/ipfilter/man/ipf.12
-rw-r--r--contrib/ipfilter/man/ipf.54
-rw-r--r--contrib/ipfilter/man/ipf.82
-rw-r--r--contrib/ipfilter/man/ipfilter.52
-rw-r--r--contrib/ipfilter/man/ipfstat.84
-rw-r--r--contrib/ipfilter/man/ipmon.813
-rw-r--r--contrib/libpam/CHANGELOG1091
-rw-r--r--contrib/libpam/Copyright41
-rw-r--r--contrib/libpam/FREEBSD-Xlist18
-rw-r--r--contrib/libpam/FREEBSD-upgrade9
-rw-r--r--contrib/libpam/Makefile282
-rw-r--r--contrib/libpam/README167
-rw-r--r--contrib/libpam/TODO59
-rw-r--r--contrib/libpam/doc/CREDITS37
-rw-r--r--contrib/libpam/doc/Makefile77
-rw-r--r--contrib/libpam/doc/NOTES16
-rw-r--r--contrib/libpam/doc/figs/pam_orient.txt23
-rw-r--r--contrib/libpam/doc/html/index.html21
-rw-r--r--contrib/libpam/doc/man/pam.8273
-rw-r--r--contrib/libpam/doc/man/pam.conf.81
-rw-r--r--contrib/libpam/doc/man/pam.d.81
-rw-r--r--contrib/libpam/doc/man/pam_authenticate.391
-rw-r--r--contrib/libpam/doc/man/pam_chauthtok.3101
-rw-r--r--contrib/libpam/doc/man/pam_close_session.31
-rw-r--r--contrib/libpam/doc/man/pam_end.31
-rw-r--r--contrib/libpam/doc/man/pam_fail_delay.3130
-rw-r--r--contrib/libpam/doc/man/pam_open_session.399
-rw-r--r--contrib/libpam/doc/man/pam_setcred.379
-rw-r--r--contrib/libpam/doc/man/pam_start.398
-rw-r--r--contrib/libpam/doc/man/pam_strerror.349
-rw-r--r--contrib/libpam/doc/man/template-man52
-rw-r--r--contrib/libpam/doc/pam_appl.sgml1567
-rw-r--r--contrib/libpam/doc/pam_modules.sgml1425
-rw-r--r--contrib/libpam/doc/pam_source.sgml985
-rw-r--r--contrib/libpam/doc/specs/rfc86.0.txt1851
-rw-r--r--contrib/libpam/libpam/Makefile177
-rw-r--r--contrib/libpam/libpam/include/security/_pam_compat.h109
-rw-r--r--contrib/libpam/libpam/include/security/_pam_macros.h165
-rw-r--r--contrib/libpam/libpam/include/security/_pam_types.h356
-rw-r--r--contrib/libpam/libpam/include/security/pam_appl.h99
-rw-r--r--contrib/libpam/libpam/include/security/pam_malloc.h73
-rw-r--r--contrib/libpam/libpam/include/security/pam_modules.h245
-rw-r--r--contrib/libpam/libpam/pam_account.c13
-rw-r--r--contrib/libpam/libpam/pam_auth.c61
-rw-r--r--contrib/libpam/libpam/pam_data.c123
-rw-r--r--contrib/libpam/libpam/pam_delay.c152
-rw-r--r--contrib/libpam/libpam/pam_dispatch.c286
-rw-r--r--contrib/libpam/libpam/pam_end.c77
-rw-r--r--contrib/libpam/libpam/pam_env.c403
-rw-r--r--contrib/libpam/libpam/pam_handlers.c901
-rw-r--r--contrib/libpam/libpam/pam_item.c313
-rw-r--r--contrib/libpam/libpam/pam_log.c433
-rw-r--r--contrib/libpam/libpam/pam_malloc.c394
-rw-r--r--contrib/libpam/libpam/pam_map.c79
-rw-r--r--contrib/libpam/libpam/pam_misc.c334
-rw-r--r--contrib/libpam/libpam/pam_password.c51
-rw-r--r--contrib/libpam/libpam/pam_private.h322
-rw-r--r--contrib/libpam/libpam/pam_second.c40
-rw-r--r--contrib/libpam/libpam/pam_session.c35
-rw-r--r--contrib/libpam/libpam/pam_start.c117
-rw-r--r--contrib/libpam/libpam/pam_static.c129
-rw-r--r--contrib/libpam/libpam/pam_strerror.c106
-rw-r--r--contrib/libpam/libpam/pam_tokens.h105
-rw-r--r--contrib/libpam/libpam_misc/Makefile109
-rw-r--r--contrib/libpam/libpam_misc/help_env.c112
-rw-r--r--contrib/libpam/libpam_misc/misc_conv.c371
-rw-r--r--contrib/libpam/libpam_misc/pam_misc.h70
-rw-r--r--contrib/libpam/libpam_misc/xstrdup.c37
-rwxr-xr-xcontrib/libpam/modules/register_static49
-rw-r--r--contrib/nvi/perl_api/perl.xs8
-rw-r--r--contrib/nvi/perl_api/perlsfio.c2
-rw-r--r--contrib/perl5/lib/ExtUtils/MM_Unix.pm7
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/BSD.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/CC-M.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/NCR.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/Solaris.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/X11.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/depend/generic.m42
-rw-r--r--contrib/sendmail/BuildTools/M4/header.m42
-rw-r--r--contrib/sendmail/BuildTools/OS/386BSD2
-rw-r--r--contrib/sendmail/BuildTools/OS/A-UX2
-rw-r--r--contrib/sendmail/BuildTools/OS/AIX2
-rw-r--r--contrib/sendmail/BuildTools/OS/AIX.22
-rw-r--r--contrib/sendmail/BuildTools/OS/AIX.4.24
-rw-r--r--contrib/sendmail/BuildTools/OS/AIX.4.34
-rw-r--r--contrib/sendmail/BuildTools/OS/AIX.4.x4
-rw-r--r--contrib/sendmail/BuildTools/OS/Altos2
-rw-r--r--contrib/sendmail/BuildTools/OS/BSD-OS2
-rw-r--r--contrib/sendmail/BuildTools/OS/BSD432
-rw-r--r--contrib/sendmail/BuildTools/OS/CLIX2
-rw-r--r--contrib/sendmail/BuildTools/OS/CRAYT3E.2.0.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/CSOS2
-rw-r--r--contrib/sendmail/BuildTools/OS/ConvexOS2
-rw-r--r--contrib/sendmail/BuildTools/OS/Dell2
-rw-r--r--contrib/sendmail/BuildTools/OS/DomainOS2
-rw-r--r--contrib/sendmail/BuildTools/OS/DomainOS.10.42
-rw-r--r--contrib/sendmail/BuildTools/OS/Dynix2
-rw-r--r--contrib/sendmail/BuildTools/OS/EWS-UX_V2
-rw-r--r--contrib/sendmail/BuildTools/OS/FreeBSD2
-rw-r--r--contrib/sendmail/BuildTools/OS/HP-UX2
-rw-r--r--contrib/sendmail/BuildTools/OS/HP-UX.10.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/HP-UX.11.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX2
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX.5.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX.6.52
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX.6.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX64.6.02
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX64.6.12
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX64.6.535
-rw-r--r--contrib/sendmail/BuildTools/OS/IRIX64.6.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/ISC2
-rw-r--r--contrib/sendmail/BuildTools/OS/KSR2
-rw-r--r--contrib/sendmail/BuildTools/OS/LUNA2
-rw-r--r--contrib/sendmail/BuildTools/OS/Linux2
-rw-r--r--contrib/sendmail/BuildTools/OS/Linux.ppc2
-rw-r--r--contrib/sendmail/BuildTools/OS/Mach3862
-rw-r--r--contrib/sendmail/BuildTools/OS/NCR.MP-RAS.2.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NCR.MP-RAS.3.x4
-rw-r--r--contrib/sendmail/BuildTools/OS/NEWS-OS.4.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NEWS-OS.6.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NEXTSTEP.4.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NeXT.2.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NeXT.3.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/NeXT.4.x4
-rw-r--r--contrib/sendmail/BuildTools/OS/NetBSD2
-rw-r--r--contrib/sendmail/BuildTools/OS/NetBSD.8.32
-rw-r--r--contrib/sendmail/BuildTools/OS/NonStop-UX2
-rw-r--r--contrib/sendmail/BuildTools/OS/OSF12
-rw-r--r--contrib/sendmail/BuildTools/OS/OpenBSD2
-rw-r--r--contrib/sendmail/BuildTools/OS/PTX2
-rw-r--r--contrib/sendmail/BuildTools/OS/Paragon2
-rw-r--r--contrib/sendmail/BuildTools/OS/PowerUX2
-rw-r--r--contrib/sendmail/BuildTools/OS/QNX2
-rw-r--r--contrib/sendmail/BuildTools/OS/RISCos2
-rw-r--r--contrib/sendmail/BuildTools/OS/RISCos.4_02
-rw-r--r--contrib/sendmail/BuildTools/OS/Rhapsody16
-rw-r--r--contrib/sendmail/BuildTools/OS/SCO2
-rw-r--r--contrib/sendmail/BuildTools/OS/SCO.4.22
-rw-r--r--contrib/sendmail/BuildTools/OS/SCO.5.x2
-rw-r--r--contrib/sendmail/BuildTools/OS/SINIX2
-rw-r--r--contrib/sendmail/BuildTools/OS/SVR42
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS2
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.4.02
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.12
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.22
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.32
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.42
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.52
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.62
-rw-r--r--contrib/sendmail/BuildTools/OS/SunOS.5.72
-rw-r--r--contrib/sendmail/BuildTools/OS/Titan2
-rw-r--r--contrib/sendmail/BuildTools/OS/ULTRIX4
-rw-r--r--contrib/sendmail/BuildTools/OS/UMAX2
-rw-r--r--contrib/sendmail/BuildTools/OS/UNICOS2
-rw-r--r--contrib/sendmail/BuildTools/OS/UNIX_SV.4.x.i3862
-rw-r--r--contrib/sendmail/BuildTools/OS/UX48002
-rw-r--r--contrib/sendmail/BuildTools/OS/UXPDS.V102
-rw-r--r--contrib/sendmail/BuildTools/OS/UXPDS.V202
-rw-r--r--contrib/sendmail/BuildTools/OS/UnixWare.5.i38618
-rw-r--r--contrib/sendmail/BuildTools/OS/dcosx.1.x.NILE2
-rw-r--r--contrib/sendmail/BuildTools/OS/dgux2
-rw-r--r--contrib/sendmail/BuildTools/OS/maxion2
-rw-r--r--contrib/sendmail/BuildTools/OS/uts.systemV2
-rw-r--r--contrib/sendmail/BuildTools/README2
-rw-r--r--contrib/sendmail/BuildTools/Site/README2
-rwxr-xr-xcontrib/sendmail/BuildTools/bin/Build2
-rw-r--r--contrib/sendmail/BuildTools/bin/configure.sh2
-rwxr-xr-xcontrib/sendmail/BuildTools/bin/find_m4.sh2
-rwxr-xr-xcontrib/sendmail/BuildTools/bin/install.sh2
-rw-r--r--contrib/sendmail/KNOWNBUGS14
-rw-r--r--contrib/sendmail/LICENSE2
-rw-r--r--contrib/sendmail/Makefile2
-rw-r--r--contrib/sendmail/README14
-rw-r--r--contrib/sendmail/RELEASE_NOTES180
-rw-r--r--contrib/sendmail/cf/README89
-rwxr-xr-xcontrib/sendmail/cf/cf/Build2
-rw-r--r--contrib/sendmail/cf/cf/Makefile2
-rw-r--r--contrib/sendmail/cf/cf/chez.cs.mc2
-rw-r--r--contrib/sendmail/cf/cf/clientproto.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-hpux10.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-hpux9.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-osf1.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-solaris2.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-sunos4.1.mc2
-rw-r--r--contrib/sendmail/cf/cf/cs-ultrix4.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-bsd4.4.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-hpux10.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-hpux9.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-nextstep3.3.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-osf1.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-solaris2.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-sunos4.1.mc2
-rw-r--r--contrib/sendmail/cf/cf/generic-ultrix4.mc2
-rw-r--r--contrib/sendmail/cf/cf/huginn.cs.mc2
-rw-r--r--contrib/sendmail/cf/cf/knecht.mc2
-rw-r--r--contrib/sendmail/cf/cf/mail.cs.mc2
-rw-r--r--contrib/sendmail/cf/cf/mail.eecs.mc2
-rw-r--r--contrib/sendmail/cf/cf/mailspool.cs.mc2
-rw-r--r--contrib/sendmail/cf/cf/python.cs.mc2
-rw-r--r--contrib/sendmail/cf/cf/s2k-osf1.mc2
-rw-r--r--contrib/sendmail/cf/cf/s2k-ultrix4.mc2
-rw-r--r--contrib/sendmail/cf/cf/tcpproto.mc2
-rw-r--r--contrib/sendmail/cf/cf/ucbarpa.mc2
-rw-r--r--contrib/sendmail/cf/cf/ucbvax.mc2
-rw-r--r--contrib/sendmail/cf/cf/uucpproto.mc2
-rw-r--r--contrib/sendmail/cf/cf/vangogh.cs.mc2
-rw-r--r--contrib/sendmail/cf/domain/Berkeley.EDU.m42
-rw-r--r--contrib/sendmail/cf/domain/CS.Berkeley.EDU.m42
-rw-r--r--contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m42
-rw-r--r--contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m42
-rw-r--r--contrib/sendmail/cf/domain/berkeley-only.m42
-rw-r--r--contrib/sendmail/cf/domain/generic.m42
-rw-r--r--contrib/sendmail/cf/feature/accept_unqualified_senders.m42
-rw-r--r--contrib/sendmail/cf/feature/accept_unresolvable_domains.m42
-rw-r--r--contrib/sendmail/cf/feature/access_db.m42
-rw-r--r--contrib/sendmail/cf/feature/allmasquerade.m42
-rw-r--r--contrib/sendmail/cf/feature/always_add_domain.m42
-rw-r--r--contrib/sendmail/cf/feature/bestmx_is_local.m44
-rw-r--r--contrib/sendmail/cf/feature/bitdomain.m48
-rw-r--r--contrib/sendmail/cf/feature/blacklist_recipients.m42
-rw-r--r--contrib/sendmail/cf/feature/domaintable.m49
-rw-r--r--contrib/sendmail/cf/feature/genericstable.m48
-rw-r--r--contrib/sendmail/cf/feature/limited_masquerade.m42
-rw-r--r--contrib/sendmail/cf/feature/local_lmtp.m42
-rw-r--r--contrib/sendmail/cf/feature/local_procmail.m42
-rw-r--r--contrib/sendmail/cf/feature/loose_relay_check.m42
-rw-r--r--contrib/sendmail/cf/feature/mailertable.m48
-rw-r--r--contrib/sendmail/cf/feature/masquerade_entire_domain.m42
-rw-r--r--contrib/sendmail/cf/feature/masquerade_envelope.m42
-rw-r--r--contrib/sendmail/cf/feature/nocanonify.m42
-rw-r--r--contrib/sendmail/cf/feature/nodns.m44
-rw-r--r--contrib/sendmail/cf/feature/notsticky.m42
-rw-r--r--contrib/sendmail/cf/feature/nouucp.m42
-rw-r--r--contrib/sendmail/cf/feature/nullclient.m42
-rw-r--r--contrib/sendmail/cf/feature/promiscuous_relay.m42
-rw-r--r--contrib/sendmail/cf/feature/rbl.m42
-rw-r--r--contrib/sendmail/cf/feature/redirect.m42
-rw-r--r--contrib/sendmail/cf/feature/relay_based_on_MX.m42
-rw-r--r--contrib/sendmail/cf/feature/relay_entire_domain.m42
-rw-r--r--contrib/sendmail/cf/feature/relay_hosts_only.m42
-rw-r--r--contrib/sendmail/cf/feature/relay_local_from.m42
-rw-r--r--contrib/sendmail/cf/feature/smrsh.m42
-rw-r--r--contrib/sendmail/cf/feature/stickyhost.m42
-rw-r--r--contrib/sendmail/cf/feature/use_ct_file.m42
-rw-r--r--contrib/sendmail/cf/feature/use_cw_file.m42
-rw-r--r--contrib/sendmail/cf/feature/uucpdomain.m48
-rw-r--r--contrib/sendmail/cf/feature/virtusertable.m48
-rw-r--r--contrib/sendmail/cf/hack/cssubdomain.m42
-rw-r--r--contrib/sendmail/cf/m4/cf.m42
-rw-r--r--contrib/sendmail/cf/m4/cfhead.m46
-rw-r--r--contrib/sendmail/cf/m4/nullrelay.m42
-rw-r--r--contrib/sendmail/cf/m4/proto.m4121
-rw-r--r--contrib/sendmail/cf/m4/version.m44
-rw-r--r--contrib/sendmail/cf/mailer/cyrus.m42
-rw-r--r--contrib/sendmail/cf/mailer/fax.m42
-rw-r--r--contrib/sendmail/cf/mailer/local.m42
-rw-r--r--contrib/sendmail/cf/mailer/mail11.m42
-rw-r--r--contrib/sendmail/cf/mailer/phquery.m42
-rw-r--r--contrib/sendmail/cf/mailer/pop.m42
-rw-r--r--contrib/sendmail/cf/mailer/procmail.m42
-rw-r--r--contrib/sendmail/cf/mailer/smtp.m42
-rw-r--r--contrib/sendmail/cf/mailer/usenet.m42
-rw-r--r--contrib/sendmail/cf/mailer/uucp.m42
-rw-r--r--contrib/sendmail/cf/ostype/aix2.m42
-rw-r--r--contrib/sendmail/cf/ostype/aix3.m42
-rw-r--r--contrib/sendmail/cf/ostype/aix4.m42
-rw-r--r--contrib/sendmail/cf/ostype/altos.m46
-rw-r--r--contrib/sendmail/cf/ostype/amdahl-uts.m48
-rw-r--r--contrib/sendmail/cf/ostype/aux.m46
-rw-r--r--contrib/sendmail/cf/ostype/bsd4.3.m42
-rw-r--r--contrib/sendmail/cf/ostype/bsd4.4.m46
-rw-r--r--contrib/sendmail/cf/ostype/bsdi1.0.m42
-rw-r--r--contrib/sendmail/cf/ostype/bsdi2.0.m42
-rw-r--r--contrib/sendmail/cf/ostype/dgux.m42
-rw-r--r--contrib/sendmail/cf/ostype/domainos.m46
-rw-r--r--contrib/sendmail/cf/ostype/dynix3.2.m44
-rw-r--r--contrib/sendmail/cf/ostype/gnuhurd.m46
-rw-r--r--contrib/sendmail/cf/ostype/hpux10.m46
-rw-r--r--contrib/sendmail/cf/ostype/hpux9.m46
-rw-r--r--contrib/sendmail/cf/ostype/irix4.m46
-rw-r--r--contrib/sendmail/cf/ostype/irix5.m48
-rw-r--r--contrib/sendmail/cf/ostype/irix6.m48
-rw-r--r--contrib/sendmail/cf/ostype/isc4.1.m48
-rw-r--r--contrib/sendmail/cf/ostype/linux.m42
-rw-r--r--contrib/sendmail/cf/ostype/maxion.m48
-rw-r--r--contrib/sendmail/cf/ostype/mklinux.m44
-rw-r--r--contrib/sendmail/cf/ostype/nextstep.m48
-rw-r--r--contrib/sendmail/cf/ostype/osf1.m48
-rw-r--r--contrib/sendmail/cf/ostype/powerux.m46
-rw-r--r--contrib/sendmail/cf/ostype/ptx2.m48
-rw-r--r--contrib/sendmail/cf/ostype/qnx.m44
-rw-r--r--contrib/sendmail/cf/ostype/riscos4.5.m46
-rw-r--r--contrib/sendmail/cf/ostype/sco-uw-2.1.m48
-rw-r--r--contrib/sendmail/cf/ostype/sco3.2.m46
-rw-r--r--contrib/sendmail/cf/ostype/sinix.m48
-rw-r--r--contrib/sendmail/cf/ostype/solaris2.m48
-rw-r--r--contrib/sendmail/cf/ostype/solaris2.ml.m48
-rw-r--r--contrib/sendmail/cf/ostype/sunos3.5.m42
-rw-r--r--contrib/sendmail/cf/ostype/sunos4.1.m42
-rw-r--r--contrib/sendmail/cf/ostype/svr4.m48
-rw-r--r--contrib/sendmail/cf/ostype/ultrix4.m42
-rw-r--r--contrib/sendmail/cf/ostype/unixware7.m416
-rw-r--r--contrib/sendmail/cf/ostype/unknown.m42
-rw-r--r--contrib/sendmail/cf/ostype/uxpds.m48
-rw-r--r--contrib/sendmail/cf/sh/makeinfo.sh2
-rwxr-xr-xcontrib/sendmail/contrib/smcontrol.pl361
-rw-r--r--contrib/sendmail/doc/changes/Makefile2
-rw-r--r--contrib/sendmail/doc/changes/changes.me2
-rw-r--r--contrib/sendmail/doc/intro/Makefile2
-rw-r--r--contrib/sendmail/doc/intro/intro.me2
-rw-r--r--contrib/sendmail/doc/op/Makefile2
-rw-r--r--contrib/sendmail/doc/op/op.me44
-rw-r--r--contrib/sendmail/doc/usenix/Makefile2
-rw-r--r--contrib/sendmail/doc/usenix/usenix.me2
-rwxr-xr-xcontrib/sendmail/mail.local/Build513
-rw-r--r--contrib/sendmail/mail.local/Makefile.m46
-rw-r--r--contrib/sendmail/mail.local/README2
-rw-r--r--contrib/sendmail/mail.local/mail.local.82
-rw-r--r--contrib/sendmail/mail.local/mail.local.c128
-rw-r--r--contrib/sendmail/mail.local/pathnames.h2
-rwxr-xr-xcontrib/sendmail/mailstats/Build513
-rw-r--r--contrib/sendmail/mailstats/Makefile.m46
-rw-r--r--contrib/sendmail/mailstats/mailstats.818
-rw-r--r--contrib/sendmail/mailstats/mailstats.c60
-rwxr-xr-xcontrib/sendmail/makemap/Build513
-rw-r--r--contrib/sendmail/makemap/Makefile.m46
-rw-r--r--contrib/sendmail/makemap/makemap.814
-rw-r--r--contrib/sendmail/makemap/makemap.c85
-rwxr-xr-xcontrib/sendmail/praliases/Build513
-rw-r--r--contrib/sendmail/praliases/Makefile.m46
-rw-r--r--contrib/sendmail/praliases/praliases.82
-rw-r--r--contrib/sendmail/praliases/praliases.c237
-rwxr-xr-xcontrib/sendmail/rmail/Build513
-rw-r--r--contrib/sendmail/rmail/Makefile.m46
-rw-r--r--contrib/sendmail/rmail/rmail.82
-rw-r--r--contrib/sendmail/rmail/rmail.c6
-rwxr-xr-xcontrib/sendmail/smrsh/Build513
-rw-r--r--contrib/sendmail/smrsh/Makefile.m46
-rw-r--r--contrib/sendmail/smrsh/README2
-rw-r--r--contrib/sendmail/smrsh/smrsh.82
-rw-r--r--contrib/sendmail/smrsh/smrsh.c2
-rwxr-xr-xcontrib/sendmail/src/Build513
-rw-r--r--contrib/sendmail/src/Makefile.m411
-rw-r--r--contrib/sendmail/src/README17
-rw-r--r--contrib/sendmail/src/TRACEFLAGS2
-rw-r--r--contrib/sendmail/src/alias.c5
-rw-r--r--contrib/sendmail/src/aliases.52
-rw-r--r--contrib/sendmail/src/arpadate.c2
-rw-r--r--contrib/sendmail/src/clock.c2
-rw-r--r--contrib/sendmail/src/collect.c14
-rw-r--r--contrib/sendmail/src/conf.c267
-rw-r--r--contrib/sendmail/src/conf.h90
-rw-r--r--contrib/sendmail/src/control.c356
-rw-r--r--contrib/sendmail/src/convtime.c2
-rw-r--r--contrib/sendmail/src/daemon.c177
-rw-r--r--contrib/sendmail/src/deliver.c64
-rw-r--r--contrib/sendmail/src/domain.c14
-rw-r--r--contrib/sendmail/src/envelope.c4
-rw-r--r--contrib/sendmail/src/err.c4
-rw-r--r--contrib/sendmail/src/headers.c127
-rw-r--r--contrib/sendmail/src/ldap_map.h4
-rw-r--r--contrib/sendmail/src/macro.c6
-rw-r--r--contrib/sendmail/src/mailq.12
-rw-r--r--contrib/sendmail/src/mailstats.h2
-rw-r--r--contrib/sendmail/src/main.c151
-rwxr-xr-xcontrib/sendmail/src/makesendmail513
-rw-r--r--contrib/sendmail/src/map.c189
-rw-r--r--contrib/sendmail/src/mci.c16
-rw-r--r--contrib/sendmail/src/mime.c28
-rw-r--r--contrib/sendmail/src/newaliases.12
-rw-r--r--contrib/sendmail/src/parseaddr.c18
-rw-r--r--contrib/sendmail/src/pathnames.h2
-rw-r--r--contrib/sendmail/src/queue.c47
-rw-r--r--contrib/sendmail/src/readcf.c80
-rw-r--r--contrib/sendmail/src/recipient.c18
-rw-r--r--contrib/sendmail/src/safefile.c16
-rw-r--r--contrib/sendmail/src/savemail.c11
-rw-r--r--contrib/sendmail/src/sendmail.87
-rw-r--r--contrib/sendmail/src/sendmail.h27
-rw-r--r--contrib/sendmail/src/sendmail.hf7
-rw-r--r--contrib/sendmail/src/snprintf.c10
-rw-r--r--contrib/sendmail/src/srvrsmtp.c52
-rw-r--r--contrib/sendmail/src/stab.c2
-rw-r--r--contrib/sendmail/src/stats.c2
-rw-r--r--contrib/sendmail/src/sysexits.c2
-rw-r--r--contrib/sendmail/src/trace.c2
-rw-r--r--contrib/sendmail/src/udb.c99
-rw-r--r--contrib/sendmail/src/useful.h2
-rw-r--r--contrib/sendmail/src/usersmtp.c25
-rw-r--r--contrib/sendmail/src/util.c309
-rw-r--r--contrib/sendmail/src/version.c4
-rw-r--r--contrib/sendmail/test/Results2
-rw-r--r--contrib/sys/softupdates/ffs_softdep.c71
-rw-r--r--contrib/tcpdump/tcpdump.14
-rw-r--r--contrib/texinfo/ABOUT-NLS225
-rw-r--r--contrib/texinfo/AUTHORS3
-rw-r--r--contrib/texinfo/COPYING7
-rw-r--r--contrib/texinfo/ChangeLog1117
-rw-r--r--contrib/texinfo/INTRODUCTION20
-rw-r--r--contrib/texinfo/Makefile.am16
-rw-r--r--contrib/texinfo/Makefile.in508
-rw-r--r--contrib/texinfo/NEWS242
-rw-r--r--contrib/texinfo/README138
-rw-r--r--contrib/texinfo/TODO100
-rw-r--r--contrib/texinfo/acconfig.h51
-rw-r--r--contrib/texinfo/aclocal.m4513
-rwxr-xr-xcontrib/texinfo/config.guess890
-rw-r--r--contrib/texinfo/config.h258
-rw-r--r--contrib/texinfo/config.h.in257
-rwxr-xr-xcontrib/texinfo/config.sub952
-rwxr-xr-xcontrib/texinfo/configure2660
-rw-r--r--contrib/texinfo/configure.in58
-rw-r--r--contrib/texinfo/dir16
-rw-r--r--contrib/texinfo/dir-example572
-rw-r--r--contrib/texinfo/doc/Makefile.am57
-rw-r--r--contrib/texinfo/doc/Makefile.in332
-rw-r--r--contrib/texinfo/doc/README27
-rw-r--r--contrib/texinfo/doc/epsf.tex546
-rw-r--r--contrib/texinfo/doc/info-stnd.texi1373
-rw-r--r--contrib/texinfo/doc/info.texi911
-rw-r--r--contrib/texinfo/doc/texinfo.tex4977
-rw-r--r--contrib/texinfo/doc/texinfo.txi17280
-rw-r--r--contrib/texinfo/doc/userdoc.texi1270
-rw-r--r--contrib/texinfo/emacs/Makefile.in88
-rw-r--r--contrib/texinfo/emacs/detexinfo.el250
-rwxr-xr-xcontrib/texinfo/emacs/elisp-comp7
-rw-r--r--contrib/texinfo/emacs/info.el1846
-rw-r--r--contrib/texinfo/emacs/informat.el429
-rw-r--r--contrib/texinfo/emacs/makeinfo.el247
-rw-r--r--contrib/texinfo/emacs/new-useful-setqs180
-rw-r--r--contrib/texinfo/emacs/texinfmt.el3979
-rw-r--r--contrib/texinfo/emacs/texinfo.el932
-rw-r--r--contrib/texinfo/emacs/texnfo-tex.el346
-rw-r--r--contrib/texinfo/emacs/texnfo-upd.el2058
-rw-r--r--contrib/texinfo/info/Makefile.am45
-rw-r--r--contrib/texinfo/info/Makefile.in592
-rw-r--r--contrib/texinfo/info/NEWS200
-rw-r--r--contrib/texinfo/info/README15
-rw-r--r--contrib/texinfo/info/clib.c112
-rw-r--r--contrib/texinfo/info/clib.h42
-rw-r--r--contrib/texinfo/info/dir.c190
-rw-r--r--contrib/texinfo/info/display.c502
-rw-r--r--contrib/texinfo/info/display.h13
-rw-r--r--contrib/texinfo/info/doc.c6
-rw-r--r--contrib/texinfo/info/doc.h16
-rw-r--r--contrib/texinfo/info/dribble5
-rw-r--r--contrib/texinfo/info/dribble.c2
-rw-r--r--contrib/texinfo/info/echo-area.c1503
-rw-r--r--contrib/texinfo/info/echo-area.h64
-rw-r--r--contrib/texinfo/info/echo_area.c1508
-rw-r--r--contrib/texinfo/info/echo_area.h63
-rw-r--r--contrib/texinfo/info/filesys.c309
-rw-r--r--contrib/texinfo/info/filesys.h15
-rw-r--r--contrib/texinfo/info/footnotes.c114
-rw-r--r--contrib/texinfo/info/footnotes.h16
-rw-r--r--contrib/texinfo/info/funs.h4
-rw-r--r--contrib/texinfo/info/gc.c2
-rw-r--r--contrib/texinfo/info/gc.h13
-rw-r--r--contrib/texinfo/info/general.h94
-rw-r--r--contrib/texinfo/info/indices.c522
-rw-r--r--contrib/texinfo/info/indices.h15
-rw-r--r--contrib/texinfo/info/info-stnd.texi1365
-rw-r--r--contrib/texinfo/info/info-utils.c197
-rw-r--r--contrib/texinfo/info/info-utils.h16
-rw-r--r--contrib/texinfo/info/info.1232
-rw-r--r--contrib/texinfo/info/info.c558
-rw-r--r--contrib/texinfo/info/info.h145
-rw-r--r--contrib/texinfo/info/info.texi916
-rw-r--r--contrib/texinfo/info/infodoc.c527
-rw-r--r--contrib/texinfo/info/infomap.c192
-rw-r--r--contrib/texinfo/info/infomap.h10
-rw-r--r--contrib/texinfo/info/m-x.c57
-rw-r--r--contrib/texinfo/info/makedoc.c263
-rw-r--r--contrib/texinfo/info/man.c267
-rw-r--r--contrib/texinfo/info/man.h13
-rw-r--r--contrib/texinfo/info/nodemenu.c124
-rw-r--r--contrib/texinfo/info/nodes.c796
-rw-r--r--contrib/texinfo/info/nodes.h111
-rw-r--r--contrib/texinfo/info/search.c180
-rw-r--r--contrib/texinfo/info/search.h26
-rw-r--r--contrib/texinfo/info/session.c2900
-rw-r--r--contrib/texinfo/info/session.h16
-rw-r--r--contrib/texinfo/info/signals.c135
-rw-r--r--contrib/texinfo/info/signals.h19
-rw-r--r--contrib/texinfo/info/termdep.h41
-rw-r--r--contrib/texinfo/info/terminal.c270
-rw-r--r--contrib/texinfo/info/terminal.h16
-rw-r--r--contrib/texinfo/info/tilde.c252
-rw-r--r--contrib/texinfo/info/tilde.h12
-rw-r--r--contrib/texinfo/info/userdoc.texi1270
-rw-r--r--contrib/texinfo/info/variables.c195
-rw-r--r--contrib/texinfo/info/variables.h21
-rw-r--r--contrib/texinfo/info/window.c656
-rw-r--r--contrib/texinfo/info/window.h70
-rw-r--r--contrib/texinfo/info/xmalloc.c (renamed from contrib/texinfo/lib/xmalloc.c)0
-rw-r--r--contrib/texinfo/intl/ChangeLog1022
-rw-r--r--contrib/texinfo/intl/Makefile.in214
-rw-r--r--contrib/texinfo/intl/VERSION1
-rw-r--r--contrib/texinfo/intl/bindtextdom.c199
-rw-r--r--contrib/texinfo/intl/cat-compat.c262
-rw-r--r--contrib/texinfo/intl/dcgettext.c593
-rw-r--r--contrib/texinfo/intl/dgettext.c59
-rw-r--r--contrib/texinfo/intl/explodename.c181
-rw-r--r--contrib/texinfo/intl/finddomain.c189
-rw-r--r--contrib/texinfo/intl/gettext.c70
-rw-r--r--contrib/texinfo/intl/gettext.h105
-rw-r--r--contrib/texinfo/intl/gettextP.h73
-rw-r--r--contrib/texinfo/intl/hash-string.h63
-rw-r--r--contrib/texinfo/intl/intl-compat.c76
-rw-r--r--contrib/texinfo/intl/l10nflist.c409
-rw-r--r--contrib/texinfo/intl/libgettext.h182
-rw-r--r--contrib/texinfo/intl/linux-msg.sed100
-rw-r--r--contrib/texinfo/intl/loadinfo.h58
-rw-r--r--contrib/texinfo/intl/loadmsgcat.c199
-rw-r--r--contrib/texinfo/intl/localealias.c378
-rw-r--r--contrib/texinfo/intl/po2tbl.sed.in102
-rw-r--r--contrib/texinfo/intl/textdomain.c106
-rw-r--r--contrib/texinfo/intl/xopen-msg.sed104
-rw-r--r--contrib/texinfo/lib/Makefile.am15
-rw-r--r--contrib/texinfo/lib/Makefile.in273
-rw-r--r--contrib/texinfo/lib/README4
-rw-r--r--contrib/texinfo/lib/getopt.c1044
-rw-r--r--contrib/texinfo/lib/getopt.h133
-rw-r--r--contrib/texinfo/lib/getopt1.c189
-rw-r--r--contrib/texinfo/lib/strerror.c43
-rw-r--r--contrib/texinfo/lib/system.h102
-rw-r--r--contrib/texinfo/lib/xstrdup.c42
-rw-r--r--contrib/texinfo/libtxi/Makefile.in82
-rw-r--r--contrib/texinfo/libtxi/alloca.c (renamed from contrib/texinfo/lib/alloca.c)0
-rw-r--r--contrib/texinfo/libtxi/bzero.c44
-rw-r--r--contrib/texinfo/libtxi/getopt.c762
-rw-r--r--contrib/texinfo/libtxi/getopt.h129
-rw-r--r--contrib/texinfo/libtxi/getopt1.c180
-rw-r--r--contrib/texinfo/libtxi/memcpy.c (renamed from contrib/texinfo/lib/memcpy.c)0
-rw-r--r--contrib/texinfo/libtxi/memmove.c (renamed from contrib/texinfo/lib/memmove.c)0
-rw-r--r--contrib/texinfo/libtxi/strdup.c (renamed from contrib/texinfo/lib/strdup.c)0
-rw-r--r--contrib/texinfo/makeinfo/Makefile.am13
-rw-r--r--contrib/texinfo/makeinfo/Makefile.in323
-rw-r--r--contrib/texinfo/makeinfo/README8
-rw-r--r--contrib/texinfo/makeinfo/macro.texi (renamed from contrib/texinfo/doc/macro.texi)0
-rw-r--r--contrib/texinfo/makeinfo/makeinfo.c6273
-rw-r--r--contrib/texinfo/makeinfo/makeinfo.h62
-rw-r--r--contrib/texinfo/makeinfo/makeinfo.texi303
-rw-r--r--contrib/texinfo/makeinfo/multi.c192
-rwxr-xr-xcontrib/texinfo/missing142
-rw-r--r--contrib/texinfo/po/ChangeLog0
-rw-r--r--contrib/texinfo/po/Makefile.in.in247
-rw-r--r--contrib/texinfo/po/POTFILES.in22
-rw-r--r--contrib/texinfo/po/cat-id-tbl.c505
-rw-r--r--contrib/texinfo/po/de.gmobin42427 -> 0 bytes
-rw-r--r--contrib/texinfo/po/de.po2089
-rw-r--r--contrib/texinfo/po/fr.gmobin32126 -> 0 bytes
-rw-r--r--contrib/texinfo/po/fr.po2091
-rw-r--r--contrib/texinfo/po/stamp-cat-id1
-rw-r--r--contrib/texinfo/po/texinfo.pot1847
-rw-r--r--contrib/texinfo/stamp-h.in1
-rw-r--r--contrib/texinfo/texinfo.tex4692
-rw-r--r--contrib/texinfo/texinfo.texi16886
-rw-r--r--contrib/texinfo/util/Makefile.am13
-rw-r--r--contrib/texinfo/util/Makefile.in348
-rw-r--r--contrib/texinfo/util/README4
-rwxr-xr-xcontrib/texinfo/util/gen-dir-node11
-rw-r--r--contrib/texinfo/util/install-info.c325
-rwxr-xr-xcontrib/texinfo/util/mkinstalldirs (renamed from contrib/texinfo/mkinstalldirs)0
-rwxr-xr-xcontrib/texinfo/util/texi2dvi192
-rw-r--r--contrib/texinfo/util/texindex.c710
-rwxr-xr-xcontrib/texinfo/util/update-info875
-rw-r--r--contrib/top/display.c36
-rw-r--r--contrib/top/loadavg.h2
-rw-r--r--contrib/top/machine.h1
-rw-r--r--contrib/top/top.c1
-rw-r--r--crypto/telnet/libtelnet/getent.c2
-rw-r--r--crypto/telnet/telnetd/telnetd.c10
-rw-r--r--crypto/telnet/telnetd/utility.c33
-rw-r--r--etc/Makefile9
-rw-r--r--etc/aliases8
-rw-r--r--etc/amd.map2
-rw-r--r--etc/etc.i386/MAKEDEV108
-rw-r--r--etc/etc.i386/disktab7
-rw-r--r--etc/etc.i386/rc.i3865
-rw-r--r--etc/group3
-rw-r--r--etc/host.conf8
-rw-r--r--etc/inetd.conf14
-rw-r--r--etc/isdn/Makefile21
-rwxr-xr-xetc/isdn/answer103
-rw-r--r--etc/isdn/isdnd.rates.D63
-rw-r--r--etc/isdn/isdnd.rates.F152
-rw-r--r--etc/isdn/isdnd.rc.sample257
-rw-r--r--etc/isdn/isdntel.alias.sample21
-rwxr-xr-xetc/isdn/isdntel.sh105
-rwxr-xr-xetc/isdn/record106
-rwxr-xr-xetc/isdn/tell92
-rwxr-xr-xetc/isdn/tell-record94
-rw-r--r--etc/login.conf11
-rw-r--r--etc/make.conf23
-rw-r--r--etc/master.passwd5
-rw-r--r--etc/mtree/BSD.include.dist4
-rw-r--r--etc/mtree/BSD.local.dist8
-rw-r--r--etc/mtree/BSD.root.dist12
-rw-r--r--etc/mtree/BSD.usr.dist76
-rw-r--r--etc/mtree/BSD.var.dist28
-rw-r--r--etc/namedb/named.conf20
-rw-r--r--etc/pam.conf23
-rw-r--r--etc/pccard.conf.sample8
-rwxr-xr-xetc/periodic/daily/340.uucp4
-rw-r--r--etc/ppp/ppp.linkdown.sample10
-rw-r--r--etc/rc82
-rw-r--r--etc/rc.conf40
-rw-r--r--etc/rc.isdn44
-rw-r--r--etc/rc.local24
-rw-r--r--etc/rc.network29
-rw-r--r--etc/security6
-rw-r--r--etc/sendmail/freebsd.mc30
-rw-r--r--games/Makefile.inc7
-rw-r--r--games/adventure/Makefile2
-rw-r--r--games/factor/factor.615
-rw-r--r--games/factor/factor.c23
-rw-r--r--games/fortune/Makefile.inc3
-rw-r--r--games/fortune/datfiles/Makefile27
-rw-r--r--games/fortune/datfiles/fortunes2
-rw-r--r--games/fortune/datfiles/fortunes22
-rw-r--r--games/hack/Makefile2
-rw-r--r--games/primes/primes.c21
-rw-r--r--gnu/lib/libgmp/Makefile22
-rw-r--r--gnu/lib/libmp/Makefile9
-rw-r--r--gnu/lib/libstdc++/Makefile26
-rw-r--r--gnu/usr.bin/binutils/doc/inc-hist.diff24
-rw-r--r--gnu/usr.bin/binutils/gdb/gdb.1385
-rw-r--r--gnu/usr.bin/binutils/gdb/i386/xm.h23
-rw-r--r--gnu/usr.bin/binutils/strip/Makefile4
-rw-r--r--gnu/usr.bin/cc/Makefile.inc18
-rw-r--r--gnu/usr.bin/cc/cc_int/Makefile4
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile24
-rw-r--r--gnu/usr.bin/cc/libgcc/Makefile6
-rw-r--r--gnu/usr.bin/grep/Makefile4
-rw-r--r--gnu/usr.bin/man/man/man.man5
-rw-r--r--gnu/usr.bin/perl/libperl/Makefile4
-rw-r--r--gnu/usr.bin/perl/libperl/config.SH-aout.i38628
-rw-r--r--gnu/usr.bin/perl/libperl/config.SH-elf.alpha28
-rw-r--r--gnu/usr.bin/perl/libperl/config.SH-elf.i38628
-rw-r--r--gnu/usr.bin/perl/suidperl/Makefile4
-rw-r--r--gnu/usr.bin/tar/getdate.y17
-rw-r--r--gnu/usr.bin/texinfo/Makefile2
-rw-r--r--gnu/usr.bin/texinfo/Makefile.inc16
-rw-r--r--gnu/usr.bin/texinfo/doc/Makefile11
-rw-r--r--gnu/usr.bin/texinfo/info/Makefile26
-rw-r--r--gnu/usr.bin/texinfo/install-info/Makefile13
-rw-r--r--gnu/usr.bin/texinfo/libintl/Makefile24
-rw-r--r--gnu/usr.bin/texinfo/libtxi/Makefile4
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile14
-rw-r--r--include/Makefile25
-rw-r--r--include/err.h31
-rw-r--r--include/ieeefp.h25
-rw-r--r--include/kvm.h21
-rw-r--r--include/paths.h2
-rw-r--r--include/protocols/dumprestore.h18
-rw-r--r--include/protocols/rwhod.h2
-rw-r--r--include/protocols/talkd.h6
-rw-r--r--include/pthread.h10
-rw-r--r--include/pwd.h4
-rw-r--r--include/rpcsvc/bootparam_prot.x2
-rw-r--r--include/rpcsvc/klm_prot.x2
-rw-r--r--include/rpcsvc/mount.x2
-rw-r--r--include/rpcsvc/nfs_prot.x2
-rw-r--r--include/rpcsvc/rex.x2
-rw-r--r--include/rpcsvc/rnusers.x2
-rw-r--r--include/rpcsvc/rquota.x2
-rw-r--r--include/rpcsvc/rstat.x2
-rw-r--r--include/rpcsvc/spray.x2
-rw-r--r--include/rpcsvc/yppasswd.x2
-rw-r--r--include/stdio.h4
-rw-r--r--include/stdlib.h8
-rw-r--r--include/string.h1
-rw-r--r--include/time.h11
-rw-r--r--include/unistd.h1
-rw-r--r--kerberosIV/include/config.h4
-rw-r--r--kerberosIV/lib/libkrb/Makefile6
-rw-r--r--kerberosIV/lib/libroken/Makefile4
-rw-r--r--lib/Makefile18
-rw-r--r--lib/csu/alpha/Makefile6
-rw-r--r--lib/csu/alpha/crt1.c9
-rw-r--r--lib/csu/i386-elf/Makefile6
-rw-r--r--lib/csu/i386-elf/crt1.c12
-rw-r--r--lib/csu/i386/Makefile23
-rw-r--r--lib/csu/i386/crt0.c10
-rw-r--r--lib/libF77/MAIN.c1
-rw-r--r--lib/libalias/alias.c17
-rw-r--r--lib/libalias/alias_db.c6
-rw-r--r--lib/libalias/alias_local.h4
-rw-r--r--lib/libalias/alias_nbt.c215
-rw-r--r--lib/libalias/libalias.36
-rw-r--r--lib/libc/alpha/SYS.h4
-rw-r--r--lib/libc/alpha/gen/Makefile.inc8
-rw-r--r--lib/libc/alpha/gen/fpgetmask.c11
-rw-r--r--lib/libc/alpha/gen/fpgetround.c7
-rw-r--r--lib/libc/alpha/gen/fpgetsticky.c10
-rw-r--r--lib/libc/alpha/gen/fpsetmask.c12
-rw-r--r--lib/libc/alpha/gen/fpsetround.c17
-rw-r--r--lib/libc/alpha/gen/fpsetsticky.c16
-rw-r--r--lib/libc/alpha/gen/setjmp.S2
-rw-r--r--lib/libc/alpha/sys/cerror.S6
-rw-r--r--lib/libc/gen/fstab.c29
-rw-r--r--lib/libc/gen/getloadavg.31
-rw-r--r--lib/libc/gen/getobjformat.316
-rw-r--r--lib/libc/gen/getpwent.34
-rw-r--r--lib/libc/gen/getpwent.c4
-rw-r--r--lib/libc/gen/getvfsbyname.c4
-rw-r--r--lib/libc/gen/getvfsent.c11
-rw-r--r--lib/libc/gen/nlist.c136
-rw-r--r--lib/libc/gen/popen.39
-rw-r--r--lib/libc/gen/psignal.34
-rw-r--r--lib/libc/gen/psignal.c6
-rw-r--r--lib/libc/gen/setmode.311
-rw-r--r--lib/libc/gen/sysctl.35
-rw-r--r--lib/libc/gen/sysctl.c12
-rw-r--r--lib/libc/gen/tzset.34
-rw-r--r--lib/libc/i386/sys/sigsuspend.S8
-rw-r--r--lib/libc/locale/ansi.c12
-rw-r--r--lib/libc/quad/moddi3.c2
-rw-r--r--lib/libc/stdio/fclose.312
-rw-r--r--lib/libc/stdio/mktemp.c2
-rw-r--r--lib/libc/stdio/perror.c2
-rw-r--r--lib/libc/stdlib/merge.c7
-rw-r--r--lib/libc/stdlib/qsort.34
-rw-r--r--lib/libc/stdtime/asctime.c7
-rw-r--r--lib/libc/stdtime/ctime.3119
-rw-r--r--lib/libc/stdtime/localtime.c10
-rw-r--r--lib/libc/string/Makefile.inc3
-rw-r--r--lib/libc/string/strerror.313
-rw-r--r--lib/libc/string/strtok.3113
-rw-r--r--lib/libc/string/strtok.c191
-rw-r--r--lib/libc/sys/Makefile.inc6
-rw-r--r--lib/libc/sys/accept.28
-rw-r--r--lib/libc/sys/aio_read.2189
-rw-r--r--lib/libc/sys/fcntl.27
-rw-r--r--lib/libc/sys/getdirentries.22
-rw-r--r--lib/libc/sys/rename.254
-rw-r--r--lib/libc/sys/revoke.211
-rw-r--r--lib/libc/sys/sendfile.2151
-rw-r--r--lib/libc/sys/sigaltstack.25
-rw-r--r--lib/libc/sys/stat.238
-rw-r--r--lib/libc/sys/vfork.24
-rw-r--r--lib/libc_r/Makefile4
-rw-r--r--lib/libc_r/uthread/pthread_private.h4
-rw-r--r--lib/libc_r/uthread/uthread_cond.c55
-rw-r--r--lib/libc_r/uthread/uthread_info.c29
-rw-r--r--lib/libc_r/uthread/uthread_kern.c18
-rw-r--r--lib/libc_r/uthread/uthread_kill.c20
-rw-r--r--lib/libc_r/uthread/uthread_mattr_kind_np.c14
-rw-r--r--lib/libc_r/uthread/uthread_mutex.c85
-rw-r--r--lib/libcam/camlib.c9
-rw-r--r--lib/libcompat/Makefile17
-rw-r--r--lib/libdevstat/Makefile10
-rw-r--r--lib/libdevstat/devstat.38
-rw-r--r--lib/libdisk/Makefile22
-rw-r--r--lib/libdisk/create_chunk.c22
-rw-r--r--lib/libdisk/disk.c4
-rw-r--r--lib/libdisk/libdisk.39
-rw-r--r--lib/libdisk/libdisk.h3
-rw-r--r--lib/libdisk/write_disk.c17
-rw-r--r--lib/libedit/Makefile2
-rw-r--r--lib/libedit/term.c2
-rw-r--r--lib/libf2c/Makefile2
-rw-r--r--lib/libfetch/Makefile55
-rw-r--r--lib/libfetch/README17
-rw-r--r--lib/libfetch/common.c284
-rw-r--r--lib/libfetch/common.h59
-rw-r--r--lib/libfetch/fetch.3220
-rw-r--r--lib/libfetch/fetch.c231
-rw-r--r--lib/libfetch/fetch.h71
-rw-r--r--lib/libfetch/fetch_err.et50
-rw-r--r--lib/libfetch/file.c87
-rw-r--r--lib/libfetch/ftp.c280
-rw-r--r--lib/libfetch/ftp.errors80
-rw-r--r--lib/libfetch/http.c87
-rw-r--r--lib/libfetch/http.errors76
-rw-r--r--lib/libio/Makefile11
-rw-r--r--lib/libio/alpha_sethae.c50
-rw-r--r--lib/libio/bwx.c237
-rw-r--r--lib/libio/io.c151
-rw-r--r--lib/libio/io.h48
-rw-r--r--lib/libio/swiz.c246
-rw-r--r--lib/libkvm/kvm_proc.c29
-rw-r--r--lib/libkvm/kvm_read.31
-rw-r--r--lib/libmd/Makefile5
-rw-r--r--lib/libmytinfo/Makefile6
-rw-r--r--lib/libncurses/curs_addstr.34
-rw-r--r--lib/libpam/Makefile31
-rw-r--r--lib/libpam/Makefile.inc28
-rw-r--r--lib/libpam/libpam/Makefile112
-rw-r--r--lib/libpam/libpam/pam_get_pass.c93
-rw-r--r--lib/libpam/libpam/pam_mod_misc.h48
-rw-r--r--lib/libpam/libpam/pam_prompt.c62
-rw-r--r--lib/libpam/libpam/pam_std_option.c62
-rw-r--r--lib/libpam/modules/Makefile36
-rw-r--r--lib/libpam/modules/pam_cleartext_pass_ok/Makefile39
-rw-r--r--lib/libpam/modules/pam_cleartext_pass_ok/pam_cleartext_pass_ok.c67
-rw-r--r--lib/libpam/modules/pam_kerberosIV/Makefile41
-rw-r--r--lib/libpam/modules/pam_kerberosIV/klogin.c204
-rw-r--r--lib/libpam/modules/pam_kerberosIV/pam_kerberosIV.c108
-rw-r--r--lib/libpam/modules/pam_radius/Makefile40
-rw-r--r--lib/libpam/modules/pam_radius/pam_radius.c300
-rw-r--r--lib/libpam/modules/pam_skey/Makefile40
-rw-r--r--lib/libpam/modules/pam_skey/pam_skey.c108
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile40
-rw-r--r--lib/libpam/modules/pam_tacplus/pam_tacplus.c258
-rw-r--r--lib/libpam/modules/pam_unix/Makefile40
-rw-r--r--lib/libpam/modules/pam_unix/pam_unix.c90
-rw-r--r--lib/libpcap/Makefile4
-rw-r--r--lib/libradius/Makefile41
-rw-r--r--lib/libradius/libradius.3317
-rw-r--r--lib/libradius/radius.conf.5123
-rw-r--r--lib/libradius/radlib.c737
-rw-r--r--lib/libradius/radlib.h125
-rw-r--r--lib/libradius/radlib_private.h82
-rw-r--r--lib/libskey/Makefile2
-rw-r--r--lib/libskey/put.c2
-rw-r--r--lib/libskey/skey.h2
-rw-r--r--lib/libskey/skey_crypt.c4
-rw-r--r--lib/libskey/skeyaccess.c32
-rw-r--r--lib/libskey/skeylogin.c4
-rw-r--r--lib/libskey/skeysubr.c4
-rw-r--r--lib/libstand/Makefile18
-rw-r--r--lib/libstand/assert.c37
-rw-r--r--lib/libstand/dev_net.c13
-rw-r--r--lib/libstand/gets.c5
-rw-r--r--lib/libstand/libstand.320
-rw-r--r--lib/libstand/printf.c14
-rw-r--r--lib/libstand/qdivrem.c303
-rw-r--r--lib/libstand/quad.h116
-rw-r--r--lib/libstand/stand.h15
-rw-r--r--lib/libstand/zalloc_defs.h4
-rw-r--r--lib/libstand/zalloc_malloc.c11
-rw-r--r--lib/libtacplus/Makefile41
-rw-r--r--lib/libtacplus/libtacplus.3347
-rw-r--r--lib/libtacplus/taclib.c1053
-rw-r--r--lib/libtacplus/taclib.h105
-rw-r--r--lib/libtacplus/taclib_private.h152
-rw-r--r--lib/libtacplus/tacplus.conf.5114
-rw-r--r--lib/libtelnet/getent.c2
-rw-r--r--lib/libutil/libutil.h4
-rw-r--r--lib/libutil/property.321
-rw-r--r--lib/libutil/property.c15
-rw-r--r--lib/libutil/setproctitle.c15
-rw-r--r--lib/libz/ChangeLog69
-rw-r--r--lib/libz/FAQ72
-rw-r--r--lib/libz/README77
-rw-r--r--lib/libz/adler32.c2
-rw-r--r--lib/libz/compress.c2
-rw-r--r--lib/libz/crc32.c2
-rw-r--r--lib/libz/deflate.c10
-rw-r--r--lib/libz/deflate.h8
-rw-r--r--lib/libz/example.c30
-rw-r--r--lib/libz/gzio.c39
-rw-r--r--lib/libz/infblock.c15
-rw-r--r--lib/libz/infcodes.c13
-rw-r--r--lib/libz/inffast.c12
-rw-r--r--lib/libz/inffixed.h151
-rw-r--r--lib/libz/inftrees.c31
-rw-r--r--lib/libz/inftrees.h14
-rw-r--r--lib/libz/maketree.c85
-rw-r--r--lib/libz/minigzip.c5
-rw-r--r--lib/libz/trees.c54
-rw-r--r--lib/libz/uncompr.c2
-rw-r--r--lib/libz/zconf.h73
-rw-r--r--lib/libz/zlib.36
-rw-r--r--lib/libz/zlib.h153
-rw-r--r--lib/libz/zutil.c10
-rw-r--r--lib/libz/zutil.h23
-rw-r--r--lib/msun/Makefile4
-rw-r--r--libexec/Makefile19
-rw-r--r--libexec/bootpd/bootpd.c6
-rw-r--r--libexec/ftpd/Makefile4
-rw-r--r--libexec/ftpd/ftpd.88
-rw-r--r--libexec/rlogind/rlogind.84
-rw-r--r--libexec/rlogind/rlogind.c68
-rw-r--r--libexec/rshd/rshd.826
-rw-r--r--libexec/rshd/rshd.c91
-rw-r--r--libexec/rtld-aout/rtld.c47
-rw-r--r--libexec/rtld-elf/rtld.c4
-rw-r--r--libexec/talkd/talkd.c7
-rw-r--r--libexec/telnetd/telnetd.c12
-rw-r--r--libexec/tftpd/tftpd.c10
-rw-r--r--lkm/Makefile13
-rw-r--r--lkm/atapi/Makefile30
-rw-r--r--lkm/ccd/Makefile15
-rw-r--r--lkm/cd9660/Makefile11
-rw-r--r--lkm/coda/Makefile10
-rw-r--r--lkm/coff/Makefile11
-rw-r--r--lkm/coff/coff.c62
-rw-r--r--lkm/fdesc/Makefile10
-rw-r--r--lkm/fpu/Makefile10
-rw-r--r--lkm/gnufpu/Makefile18
-rw-r--r--lkm/ibcs2/Makefile24
-rwxr-xr-xlkm/ibcs2/ibcs252
-rw-r--r--lkm/ibcs2/ibcs2.863
-rw-r--r--lkm/ibcs2/ibcs2.c60
-rw-r--r--lkm/if_disc/Makefile20
-rw-r--r--lkm/if_ppp/Makefile58
-rw-r--r--lkm/if_sl/Makefile25
-rw-r--r--lkm/if_tun/Makefile27
-rw-r--r--lkm/ip_mroute_mod/Makefile9
-rw-r--r--lkm/ipfw/Makefile17
-rw-r--r--lkm/joy/Makefile22
-rw-r--r--lkm/joy/joy4
-rw-r--r--lkm/joy/joy.846
-rw-r--r--lkm/kernfs/Makefile10
-rw-r--r--lkm/linux/Makefile42
-rw-r--r--lkm/linux/linux10
-rw-r--r--lkm/linux/linux.845
-rw-r--r--lkm/linux/linux.c87
-rw-r--r--lkm/mfs/Makefile10
-rw-r--r--lkm/msdos/Makefile11
-rw-r--r--lkm/nfs/Makefile23
-rw-r--r--lkm/nullfs/Makefile14
-rw-r--r--lkm/pcic/Makefile10
-rw-r--r--lkm/portal/Makefile10
-rw-r--r--lkm/procfs/Makefile15
-rw-r--r--lkm/syscons/Makefile5
-rw-r--r--lkm/syscons/blank/Makefile9
-rw-r--r--lkm/syscons/blank/blank_saver.c121
-rw-r--r--lkm/syscons/daemon/Makefile9
-rw-r--r--lkm/syscons/daemon/daemon_saver.c369
-rw-r--r--lkm/syscons/fade/Makefile9
-rw-r--r--lkm/syscons/fade/fade_saver.c137
-rw-r--r--lkm/syscons/green/Makefile9
-rw-r--r--lkm/syscons/green/green_saver.c129
-rw-r--r--lkm/syscons/saver.h44
-rw-r--r--lkm/syscons/snake/Makefile9
-rw-r--r--lkm/syscons/snake/snake_saver.c150
-rw-r--r--lkm/syscons/star/Makefile9
-rw-r--r--lkm/syscons/star/star_saver.c113
-rw-r--r--lkm/umapfs/Makefile10
-rw-r--r--lkm/union/Makefile10
-rw-r--r--lkm/vesa/Makefile19
-rw-r--r--lkm/vinum/COPYRIGHT37
-rw-r--r--lkm/vinum/Makefile26
-rw-r--r--lkm/vinum/config.c1712
-rw-r--r--lkm/vinum/interrupt.c190
-rw-r--r--lkm/vinum/io.c886
-rw-r--r--lkm/vinum/lock.c137
-rwxr-xr-xlkm/vinum/makestatetext40
-rw-r--r--lkm/vinum/memory.c186
-rw-r--r--lkm/vinum/parser.c206
-rw-r--r--lkm/vinum/request.c882
-rw-r--r--lkm/vinum/request.h159
-rw-r--r--lkm/vinum/revive.c128
-rw-r--r--lkm/vinum/state.c755
-rw-r--r--lkm/vinum/statetexts.h88
-rw-r--r--lkm/vinum/util.c211
-rw-r--r--lkm/vinum/vinum.c512
-rw-r--r--lkm/vinum/vinumext.h214
-rw-r--r--lkm/vinum/vinumhdr.h104
-rw-r--r--lkm/vinum/vinumio.h132
-rw-r--r--lkm/vinum/vinumioctl.c787
-rw-r--r--lkm/vinum/vinumkw.h120
-rw-r--r--lkm/vinum/vinumstate.h213
-rw-r--r--lkm/vinum/vinumvar.h510
-rw-r--r--lkm/wcd/Makefile29
-rw-r--r--release/ABOUT.TXT (renamed from release/texts/ABOUT.TXT)0
-rw-r--r--release/ERRATA.TXT (renamed from release/texts/ERRATA.TXT)0
-rw-r--r--release/LAYOUT.TXT (renamed from release/texts/LAYOUT.TXT)0
-rw-r--r--release/Makefile340
-rw-r--r--release/README.TXT60
-rw-r--r--release/doFS.sh74
-rw-r--r--release/floppies/Makefile7
-rw-r--r--release/floppies/bin/Makefile7
-rw-r--r--release/floppies/bin/doFS.sh71
-rw-r--r--release/floppies/bin/dumpnlist/Makefile9
-rw-r--r--release/floppies/bin/write_mfs_in_kernel/Makefile9
-rw-r--r--release/floppies/boot/Makefile4
-rw-r--r--release/floppies/boot/crunch/Makefile15
-rw-r--r--release/floppies/boot/crunch/crunch.conf21
-rw-r--r--release/floppies/boot/floppy/Makefile112
-rw-r--r--release/floppies/boot/mfs/Makefile25
-rw-r--r--release/floppies/boot/verbatim/etc/services4
-rw-r--r--release/floppies/fixit/Makefile6
-rw-r--r--release/floppies/fixit/crunch/Makefile3
-rw-r--r--release/floppies/fixit/crunch/crunch.conf43
-rw-r--r--release/floppies/fixit/image/Makefile20
-rw-r--r--release/floppies/fixit/verbatim/.profile15
-rw-r--r--release/floppies/mk/crunch_fs.mk108
-rw-r--r--release/floppies/mk/makecrunch.mk25
-rw-r--r--release/info.sh (renamed from release/scripts/info.sh)0
-rw-r--r--release/picobsd/Version2
-rwxr-xr-xrelease/picobsd/build/build12
-rwxr-xr-xrelease/picobsd/build/populate14
-rwxr-xr-xrelease/picobsd/build/stage127
-rwxr-xr-xrelease/picobsd/build/stage27
-rwxr-xr-xrelease/picobsd/build/stage320
-rw-r--r--release/picobsd/dial/conf/Makefile4
-rw-r--r--release/picobsd/dial/conf/PICOBSD44
-rw-r--r--release/picobsd/dial/crunch1/Makefile4
-rw-r--r--release/picobsd/dial/crunch1/crunch.conf9
-rw-r--r--release/picobsd/dial/floppy.tree/etc/login.conf4
-rw-r--r--release/picobsd/dial/floppy.tree/etc/rc.network70
-rw-r--r--release/picobsd/dial/floppy.tree/etc/resolv.conf3
-rw-r--r--release/picobsd/dial/floppy.tree/etc/services1
-rw-r--r--release/picobsd/dial/lang/LICENCE.ssh4
-rw-r--r--release/picobsd/dial/lang/README.en4
-rw-r--r--release/picobsd/dial/lang/README.pl4
-rw-r--r--release/picobsd/dial/lang/boot.help.en2
-rw-r--r--release/picobsd/dial/lang/boot.help.pl2
-rwxr-xr-xrelease/picobsd/dial/lang/dialup.en54
-rwxr-xr-xrelease/picobsd/dial/lang/dialup.pl51
-rw-r--r--release/picobsd/dial/lang/rc.en4
-rw-r--r--release/picobsd/dial/lang/rc.pl4
-rwxr-xr-xrelease/picobsd/dial/lang/update.en4
-rwxr-xr-xrelease/picobsd/dial/lang/update.pl4
-rw-r--r--release/picobsd/dial/mfs.tree/Makefile3
-rw-r--r--release/picobsd/doc/src/Makefile11
-rw-r--r--release/picobsd/doc/src/TODO.html154
-rw-r--r--release/picobsd/doc/src/UCI.html960
-rw-r--r--release/picobsd/doc/src/bugs.html22
-rw-r--r--release/picobsd/doc/src/faq.html8
-rw-r--r--release/picobsd/doc/src/hardware.html7
-rw-r--r--release/picobsd/doc/src/how2build.html8
-rw-r--r--release/picobsd/doc/src/intrinsics.html4
-rw-r--r--release/picobsd/doc/src/intro.html30
-rw-r--r--release/picobsd/help/dmesg.hlp.en5
-rw-r--r--release/picobsd/help/dmesg.hlp.pl5
-rw-r--r--release/picobsd/help/help.hlp.en2
-rw-r--r--release/picobsd/help/help.hlp.pl2
-rw-r--r--release/picobsd/help/vm.hlp.en4
-rw-r--r--release/picobsd/help/vm.hlp.pl6
-rw-r--r--release/picobsd/isp/conf/Makefile4
-rw-r--r--release/picobsd/isp/conf/PICOBSD59
-rw-r--r--release/picobsd/isp/crunch1/Makefile12
-rw-r--r--release/picobsd/isp/crunch1/crunch.conf9
-rw-r--r--release/picobsd/isp/floppy.tree/etc/hosts5
-rw-r--r--release/picobsd/isp/floppy.tree/etc/login.conf4
-rw-r--r--release/picobsd/isp/floppy.tree/etc/motd12
-rw-r--r--release/picobsd/isp/floppy.tree/etc/rc62
-rw-r--r--release/picobsd/isp/floppy.tree/etc/rc.conf25
-rw-r--r--release/picobsd/isp/floppy.tree/etc/resolv.conf3
-rw-r--r--release/picobsd/isp/floppy.tree/etc/services1
-rw-r--r--release/picobsd/isp/lang/README.en2
-rw-r--r--release/picobsd/isp/lang/README.pl2
-rw-r--r--release/picobsd/isp/lang/m.en11
-rw-r--r--release/picobsd/isp/lang/m.pl11
-rw-r--r--release/picobsd/isp/lang/motd.en2
-rw-r--r--release/picobsd/isp/lang/motd.pl2
-rw-r--r--release/picobsd/isp/lang/rc.en8
-rw-r--r--release/picobsd/isp/lang/rc.pl7
-rwxr-xr-xrelease/picobsd/isp/lang/update.en4
-rwxr-xr-xrelease/picobsd/isp/lang/update.pl4
-rw-r--r--release/picobsd/net/conf/Makefile4
-rw-r--r--release/picobsd/net/conf/PICOBSD55
-rw-r--r--release/picobsd/net/crunch1/Makefile10
-rw-r--r--release/picobsd/net/crunch1/crunch.conf9
-rw-r--r--release/picobsd/net/floppy.tree/etc/hosts5
-rw-r--r--release/picobsd/net/floppy.tree/etc/login.conf4
-rw-r--r--release/picobsd/net/floppy.tree/etc/motd12
-rw-r--r--release/picobsd/net/floppy.tree/etc/rc62
-rw-r--r--release/picobsd/net/floppy.tree/etc/rc.conf25
-rw-r--r--release/picobsd/net/floppy.tree/etc/rc.network80
-rw-r--r--release/picobsd/net/floppy.tree/etc/resolv.conf3
-rw-r--r--release/picobsd/net/floppy.tree/etc/services1
-rw-r--r--release/picobsd/net/lang/README.en2
-rw-r--r--release/picobsd/net/lang/README.pl2
-rw-r--r--release/picobsd/net/lang/m.en11
-rw-r--r--release/picobsd/net/lang/m.pl11
-rw-r--r--release/picobsd/net/lang/motd.en2
-rw-r--r--release/picobsd/net/lang/motd.pl2
-rw-r--r--release/picobsd/net/lang/rc.en8
-rw-r--r--release/picobsd/net/lang/rc.pl7
-rwxr-xr-xrelease/picobsd/net/lang/update.en4
-rwxr-xr-xrelease/picobsd/net/lang/update.pl4
-rw-r--r--release/picobsd/router/conf/Makefile4
-rw-r--r--release/picobsd/router/conf/PICOBSD48
-rw-r--r--release/picobsd/router/floppy.tree/etc/hosts5
-rw-r--r--release/picobsd/router/floppy.tree/etc/login.conf4
-rw-r--r--release/picobsd/router/floppy.tree/etc/motd11
-rw-r--r--release/picobsd/router/floppy.tree/etc/rc18
-rw-r--r--release/picobsd/router/floppy.tree/etc/rc.conf25
-rw-r--r--release/picobsd/router/floppy.tree/etc/resolv.conf3
-rw-r--r--release/picobsd/router/floppy.tree/etc/services1
-rw-r--r--release/picobsd/router/lang/README.en2
-rw-r--r--release/picobsd/router/lang/README.pl2
-rw-r--r--release/picobsd/router/lang/motd.pl2
-rw-r--r--release/picobsd/router/lang/rc.en4
-rw-r--r--release/picobsd/router/lang/rc.pl4
-rwxr-xr-xrelease/picobsd/router/lang/update.en4
-rwxr-xr-xrelease/picobsd/router/lang/update.pl4
-rw-r--r--release/picobsd/tinyware/aps/README4
-rw-r--r--release/picobsd/tinyware/help/README4
-rw-r--r--release/picobsd/tinyware/help/help.c4
-rw-r--r--release/picobsd/tinyware/kget/Makefile8
-rw-r--r--release/picobsd/tinyware/kget/README44
-rw-r--r--release/picobsd/tinyware/kget/kget.c113
-rw-r--r--release/picobsd/tinyware/kget/kget.h2
-rw-r--r--release/picobsd/tinyware/kget/uc_eisa.c166
-rw-r--r--release/picobsd/tinyware/kget/uc_isa.c211
-rw-r--r--release/picobsd/tinyware/kget/uc_kmem.c87
-rw-r--r--release/picobsd/tinyware/kget/uc_list.c76
-rw-r--r--release/picobsd/tinyware/kget/uc_main.c475
-rw-r--r--release/picobsd/tinyware/kget/uc_main.h168
-rw-r--r--release/picobsd/tinyware/kget/uc_pci.c122
-rw-r--r--release/picobsd/tinyware/msg/README4
-rw-r--r--release/picobsd/tinyware/ns/README4
-rw-r--r--release/picobsd/tinyware/oinit/README4
-rw-r--r--release/picobsd/tinyware/oinit/oinit.c22
-rw-r--r--release/picobsd/tinyware/simple_httpd/Makefile6
-rw-r--r--release/picobsd/tinyware/simple_httpd/simple_httpd.c12
-rw-r--r--release/picobsd/tinyware/sps/README4
-rw-r--r--release/picobsd/tinyware/view/README4
-rw-r--r--release/picobsd/tinyware/view/view.c35
-rw-r--r--release/picobsd/tinyware/vm/README4
-rw-r--r--release/picobsd/tinyware/vm/vm.c21
-rw-r--r--release/picobsd/tools/daemon/README4
-rw-r--r--release/picobsd/tools/dumpnlist/Makefile9
-rw-r--r--release/scripts/doFS.sh69
-rwxr-xr-xrelease/scripts/dokern.sh49
-rwxr-xr-xrelease/scripts/src-install.sh6
-rw-r--r--release/scripts/tar.sh120
-rw-r--r--release/sysinstall/Makefile5
-rw-r--r--release/sysinstall/cdrom.c35
-rw-r--r--release/sysinstall/config.c55
-rw-r--r--release/sysinstall/devices.c10
-rw-r--r--release/sysinstall/disks.c43
-rw-r--r--release/sysinstall/dispatch.c5
-rw-r--r--release/sysinstall/dist.c24
-rw-r--r--release/sysinstall/dist.h2
-rw-r--r--release/sysinstall/dos.c44
-rw-r--r--release/sysinstall/floppy.c26
-rw-r--r--release/sysinstall/ftp.c12
-rw-r--r--release/sysinstall/help/XF86.hlp (renamed from release/texts/XFREE86.TXT)0
-rw-r--r--release/sysinstall/help/hardware.hlp513
-rw-r--r--release/sysinstall/help/install.hlp513
-rw-r--r--release/sysinstall/help/partition.hlp26
-rw-r--r--release/sysinstall/help/readme.hlp115
-rw-r--r--release/sysinstall/help/relnotes.hlp834
-rw-r--r--release/sysinstall/help/shortcuts.hlp6
-rw-r--r--release/sysinstall/help/trouble.hlp374
-rw-r--r--release/sysinstall/help/upgrade.hlp (renamed from release/texts/UPGRADE.TXT)0
-rw-r--r--release/sysinstall/index.c48
-rw-r--r--release/sysinstall/install.c219
-rw-r--r--release/sysinstall/install.cfg8
-rw-r--r--release/sysinstall/installUpgrade.c26
-rw-r--r--release/sysinstall/kget.c104
-rw-r--r--release/sysinstall/label.c13
-rw-r--r--release/sysinstall/main.c12
-rw-r--r--release/sysinstall/media.c56
-rw-r--r--release/sysinstall/menus.c69
-rw-r--r--release/sysinstall/network.c14
-rw-r--r--release/sysinstall/nfs.c29
-rw-r--r--release/sysinstall/register.c4
-rw-r--r--release/sysinstall/sysinstall.8196
-rw-r--r--release/sysinstall/sysinstall.h19
-rw-r--r--release/sysinstall/system.c34
-rw-r--r--release/sysinstall/tape.c9
-rw-r--r--release/sysinstall/tcpip.c4
-rw-r--r--release/sysinstall/uc_eisa.c166
-rw-r--r--release/sysinstall/uc_isa.c211
-rw-r--r--release/sysinstall/uc_kmem.c87
-rw-r--r--release/sysinstall/uc_list.c76
-rw-r--r--release/sysinstall/uc_main.c334
-rw-r--r--release/sysinstall/uc_main.h168
-rw-r--r--release/sysinstall/uc_pci.c122
-rw-r--r--release/sysinstall/uc_scsi.c477
-rw-r--r--release/sysinstall/ufs.c18
-rw-r--r--release/sysinstall/version.h1
-rw-r--r--release/tar.sh120
-rw-r--r--release/texts/FLOPPIES.TXT57
-rw-r--r--release/texts/HARDWARE.TXT569
-rw-r--r--release/texts/INSTALL.TXT513
-rw-r--r--release/texts/README.TXT110
-rw-r--r--release/texts/RELNOTES.TXT574
-rw-r--r--release/texts/TROUBLE.TXT374
-rw-r--r--sbin/Makefile12
-rw-r--r--sbin/atm/atm/atm.813
-rw-r--r--sbin/atm/atm/atm.h4
-rw-r--r--sbin/atm/fore_dnld/fore_dnld.c8
-rw-r--r--sbin/atm/ilmid/ilmid.c2830
-rw-r--r--sbin/camcontrol/camcontrol.815
-rw-r--r--sbin/camcontrol/camcontrol.c72
-rw-r--r--sbin/ccdconfig/ccdconfig.88
-rw-r--r--sbin/disklabel/disklabel.54
-rw-r--r--sbin/disklabel/disklabel.864
-rw-r--r--sbin/disklabel/disklabel.c36
-rw-r--r--sbin/disklabel/pathnames.h2
-rw-r--r--sbin/dset/Makefile7
-rw-r--r--sbin/dset/dset.878
-rw-r--r--sbin/dset/dset.c433
-rw-r--r--sbin/dump/traverse.c8
-rw-r--r--sbin/fsck/dir.c87
-rw-r--r--sbin/fsck/fsck.878
-rw-r--r--sbin/fsck/fsck.h47
-rw-r--r--sbin/fsck/inode.c91
-rw-r--r--sbin/fsck/main.c42
-rw-r--r--sbin/fsck/pass1.c107
-rw-r--r--sbin/fsck/pass1b.c4
-rw-r--r--sbin/fsck/pass2.c60
-rw-r--r--sbin/fsck/pass3.c68
-rw-r--r--sbin/fsck/pass4.c69
-rw-r--r--sbin/fsck/pass5.c35
-rw-r--r--sbin/fsck/preen.c60
-rw-r--r--sbin/fsck/setup.c46
-rw-r--r--sbin/fsck/utilities.c50
-rw-r--r--sbin/fsdb/fsdb.c6
-rw-r--r--sbin/i386/fdisk/fdisk.84
-rw-r--r--sbin/i386/fdisk/fdisk.c6
-rw-r--r--sbin/i386/mount_msdos/mount_msdos.813
-rw-r--r--sbin/init/init.813
-rw-r--r--sbin/ipfw/ipfw.841
-rw-r--r--sbin/ipfw/ipfw.c296
-rw-r--r--sbin/kldload/kldload.820
-rw-r--r--sbin/kldstat/kldstat.814
-rw-r--r--sbin/kldstat/kldstat.c4
-rw-r--r--sbin/kldunload/kldunload.820
-rw-r--r--sbin/kldunload/kldunload.c12
-rw-r--r--sbin/mount/Makefile5
-rw-r--r--sbin/mount/mount_ufs.c36
-rw-r--r--sbin/mount_null/mount_null.812
-rw-r--r--sbin/mount_portal/Makefile4
-rw-r--r--sbin/mount_portal/activate.c4
-rw-r--r--sbin/mount_portal/mount_portal.816
-rw-r--r--sbin/mount_portal/mount_portal.c4
-rw-r--r--sbin/mount_portal/portald.h4
-rw-r--r--sbin/mount_portal/pt_conf.c3
-rw-r--r--sbin/mount_portal/pt_tcp.c8
-rw-r--r--sbin/mount_portal/pt_tcplisten.c206
-rw-r--r--sbin/mount_umap/mount_umap.812
-rw-r--r--sbin/mount_union/mount_union.812
-rw-r--r--sbin/mountd/mountd.c42
-rw-r--r--sbin/natd/README53
-rw-r--r--sbin/natd/samples/natd.cf.sample94
-rw-r--r--sbin/natd/samples/natd.test14
-rw-r--r--sbin/newfs/newfs.817
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c16
-rw-r--r--sbin/nologin/nologin.512
-rw-r--r--sbin/ping/ping.820
-rw-r--r--sbin/ping/ping.c55
-rw-r--r--sbin/reboot/boot_i386.889
-rw-r--r--sbin/restore/dirs.c10
-rw-r--r--sbin/restore/interactive.c8
-rw-r--r--sbin/restore/restore.84
-rw-r--r--sbin/restore/symtab.c10
-rw-r--r--sbin/restore/tape.c30
-rw-r--r--sbin/shutdown/shutdown.820
-rw-r--r--sbin/shutdown/shutdown.c34
-rw-r--r--sbin/sysctl/Makefile10
-rw-r--r--sbin/sysctl/pathconf.c240
-rw-r--r--sbin/sysctl/sysctl.8243
-rw-r--r--sbin/sysctl/sysctl.c502
-rw-r--r--sbin/tunefs/tunefs.84
-rw-r--r--sbin/tunefs/tunefs.c51
-rw-r--r--sbin/vinum/Makefile24
-rw-r--r--sbin/vinum/commands.c306
-rw-r--r--sbin/vinum/list.c202
-rw-r--r--sbin/vinum/v.c122
-rw-r--r--sbin/vinum/vext.h52
-rw-r--r--sbin/vinum/vinum.8530
-rw-r--r--share/Makefile2
-rw-r--r--share/dict/README12
-rw-r--r--share/dict/web25
-rw-r--r--share/examples/atm/atm-sockets.txt248
-rw-r--r--share/examples/bootforth/README22
-rw-r--r--share/examples/bootforth/boot.4th22
-rw-r--r--share/examples/bootforth/frames.4th90
-rw-r--r--share/examples/bootforth/menu.4th96
-rw-r--r--share/examples/bootforth/screen.4th36
-rwxr-xr-xshare/examples/drivers/make_device_driver.sh20
-rw-r--r--share/examples/drivers/make_pseudo_driver.sh6
-rw-r--r--share/examples/isdn/FAQ517
-rw-r--r--share/examples/isdn/Overview307
-rw-r--r--share/examples/isdn/README457
-rw-r--r--share/examples/isdn/ROADMAP75
-rw-r--r--share/examples/isdn/Resources90
-rw-r--r--share/examples/isdn/isdnd_acct137
-rw-r--r--share/examples/kld/Makefile70
-rw-r--r--share/examples/kld/cdev/Makefile74
-rw-r--r--share/examples/kld/cdev/README116
-rw-r--r--share/examples/kld/cdev/module/Makefile91
-rw-r--r--share/examples/kld/cdev/module/cdev.c124
-rw-r--r--share/examples/kld/cdev/module/cdev.h98
-rw-r--r--share/examples/kld/cdev/module/cdevmod.c122
-rw-r--r--share/examples/kld/cdev/test/Makefile92
-rw-r--r--share/examples/kld/cdev/test/testcdev.c95
-rw-r--r--share/examples/kld/syscall/Makefile9
-rw-r--r--share/examples/kld/syscall/module/Makefile17
-rw-r--r--share/examples/kld/syscall/module/syscall.c86
-rw-r--r--share/examples/kld/syscall/test/Makefile6
-rw-r--r--share/examples/kld/syscall/test/call.c54
-rw-r--r--share/examples/portal/README64
-rw-r--r--share/examples/portal/portal.conf3
-rw-r--r--share/examples/printing/ifhp2
-rw-r--r--share/examples/printing/psif4
-rw-r--r--share/examples/scsi_target/scsi_target.c4
-rw-r--r--share/isdn/0.g711a.uu322
-rw-r--r--share/isdn/1.g711a.uu322
-rw-r--r--share/isdn/2.g711a.uu277
-rw-r--r--share/isdn/3.g711a.uu322
-rw-r--r--share/isdn/4.g711a.uu322
-rw-r--r--share/isdn/5.g711a.uu368
-rw-r--r--share/isdn/6.g711a.uu277
-rw-r--r--share/isdn/7.g711a.uu231
-rw-r--r--share/isdn/8.g711a.uu322
-rw-r--r--share/isdn/9.g711a.uu231
-rw-r--r--share/isdn/Makefile20
-rw-r--r--share/isdn/beep.g711a.uu106
-rw-r--r--share/isdn/msg.g711a.uu1505
-rw-r--r--share/man/man1/Makefile3
-rw-r--r--share/man/man1/intro.13
-rw-r--r--share/man/man4/Makefile15
-rw-r--r--share/man/man4/bpf.46
-rw-r--r--share/man/man4/bridge.465
-rw-r--r--share/man/man4/dummynet.4182
-rw-r--r--share/man/man4/iic.463
-rw-r--r--share/man/man4/iicbb.459
-rw-r--r--share/man/man4/iicbus.4108
-rw-r--r--share/man/man4/iicsmb.457
-rw-r--r--share/man/man4/imm.459
-rw-r--r--share/man/man4/intro.46
-rw-r--r--share/man/man4/lpbb.479
-rw-r--r--share/man/man4/man4.i386/Makefile41
-rw-r--r--share/man/man4/man4.i386/adv.4170
-rw-r--r--share/man/man4/man4.i386/adw.479
-rw-r--r--share/man/man4/man4.i386/ahc.4200
-rw-r--r--share/man/man4/man4.i386/alog.4149
-rw-r--r--share/man/man4/man4.i386/apm.410
-rw-r--r--share/man/man4/man4.i386/ar.46
-rw-r--r--share/man/man4/man4.i386/asc.44
-rw-r--r--share/man/man4/man4.i386/ax.4152
-rw-r--r--share/man/man4/man4.i386/bktr.415
-rw-r--r--share/man/man4/man4.i386/bt.4116
-rw-r--r--share/man/man4/man4.i386/cs.46
-rw-r--r--share/man/man4/man4.i386/cy.46
-rw-r--r--share/man/man4/man4.i386/dpt.478
-rw-r--r--share/man/man4/man4.i386/ed.48
-rw-r--r--share/man/man4/man4.i386/eg.472
-rw-r--r--share/man/man4/man4.i386/el.44
-rw-r--r--share/man/man4/man4.i386/ep.44
-rw-r--r--share/man/man4/man4.i386/ex.44
-rw-r--r--share/man/man4/man4.i386/fdc.412
-rw-r--r--share/man/man4/man4.i386/fe.44
-rw-r--r--share/man/man4/man4.i386/ie.44
-rw-r--r--share/man/man4/man4.i386/labpc.44
-rw-r--r--share/man/man4/man4.i386/le.44
-rw-r--r--share/man/man4/man4.i386/lnc.46
-rw-r--r--share/man/man4/man4.i386/lp.44
-rw-r--r--share/man/man4/man4.i386/lpt.410
-rw-r--r--share/man/man4/man4.i386/mcd.44
-rw-r--r--share/man/man4/man4.i386/mse.48
-rw-r--r--share/man/man4/man4.i386/mx.4167
-rw-r--r--share/man/man4/man4.i386/nca.471
-rw-r--r--share/man/man4/man4.i386/npx.44
-rw-r--r--share/man/man4/man4.i386/pcf.464
-rw-r--r--share/man/man4/man4.i386/pcm.44
-rw-r--r--share/man/man4/man4.i386/pcvt.414
-rw-r--r--share/man/man4/man4.i386/pn.4161
-rw-r--r--share/man/man4/man4.i386/ppc.4112
-rw-r--r--share/man/man4/man4.i386/psm.411
-rw-r--r--share/man/man4/man4.i386/rdp.4181
-rw-r--r--share/man/man4/man4.i386/rl.4192
-rw-r--r--share/man/man4/man4.i386/sb.42
-rw-r--r--share/man/man4/man4.i386/sea.490
-rw-r--r--share/man/man4/man4.i386/sio.418
-rw-r--r--share/man/man4/man4.i386/sr.46
-rw-r--r--share/man/man4/man4.i386/tl.44
-rw-r--r--share/man/man4/man4.i386/tx.42
-rw-r--r--share/man/man4/man4.i386/uha.473
-rw-r--r--share/man/man4/man4.i386/vr.4164
-rw-r--r--share/man/man4/man4.i386/wb.4159
-rw-r--r--share/man/man4/man4.i386/wd.44
-rw-r--r--share/man/man4/man4.i386/wl.44
-rw-r--r--share/man/man4/man4.i386/wt.44
-rw-r--r--share/man/man4/man4.i386/xl.48
-rw-r--r--share/man/man4/man4.i386/ze.44
-rw-r--r--share/man/man4/man4.i386/zp.44
-rw-r--r--share/man/man4/plip.471
-rw-r--r--share/man/man4/ppbus.4315
-rw-r--r--share/man/man4/sl.42
-rw-r--r--share/man/man4/smb.470
-rw-r--r--share/man/man4/smbus.475
-rw-r--r--share/man/man4/vinum.4102
-rw-r--r--share/man/man4/vpo.456
-rw-r--r--share/man/man5/rc.conf.559
-rw-r--r--share/man/man7/Makefile6
-rw-r--r--share/man/man7/hier.74
-rw-r--r--share/man/man7/man.7343
-rw-r--r--share/man/man7/mdoc.710
-rw-r--r--share/man/man7/mdoc.samples.744
-rw-r--r--share/man/man7/ports.724
-rw-r--r--share/man/man7/security.7446
-rw-r--r--share/man/man8/rc.810
-rw-r--r--share/man/man9/Makefile14
-rw-r--r--share/man/man9/buf.9123
-rw-r--r--share/man/man9/malloc.962
-rw-r--r--share/man/man9/microseq.9118
-rw-r--r--share/man/man9/ppbconf.9205
-rw-r--r--share/man/man9/sleep.9116
-rw-r--r--share/man/man9/spl.94
-rw-r--r--share/misc/Makefile4
-rw-r--r--share/misc/bsd-family-tree66
-rw-r--r--share/misc/iso639176
-rw-r--r--share/mk/Makefile5
-rw-r--r--share/mk/bsd.dep.mk5
-rw-r--r--share/mk/bsd.docb.mk5
-rw-r--r--share/mk/bsd.info.mk25
-rw-r--r--share/mk/bsd.kern.mk14
-rw-r--r--share/mk/bsd.kmod.mk10
-rw-r--r--share/mk/bsd.lib.mk124
-rw-r--r--share/mk/bsd.libnames.mk18
-rw-r--r--share/mk/bsd.own.mk6
-rw-r--r--share/mk/bsd.port.mk462
-rw-r--r--share/mk/bsd.port.post.mk7
-rw-r--r--share/mk/bsd.port.pre.mk7
-rw-r--r--share/mk/bsd.port.subdir.mk15
-rw-r--r--share/mk/bsd.prog.mk7
-rw-r--r--share/syscons/fonts/INDEX.fonts7
-rw-r--r--share/syscons/fonts/Makefile4
-rw-r--r--share/syscons/fonts/iso15-thin-8x16.fnt95
-rw-r--r--share/syscons/keymaps/INDEX.keymaps63
-rw-r--r--share/syscons/keymaps/Makefile6
-rw-r--r--share/syscons/keymaps/hu.iso2.101keys.kbd291
-rw-r--r--share/syscons/keymaps/hu.iso2.102keys.kbd141
-rw-r--r--share/syscons/keymaps/hungarian.iso2.kbd112
-rw-r--r--share/syscons/keymaps/icelandic.iso.acc.kbd22
-rw-r--r--share/syscons/keymaps/pt.iso.acc.kbd139
-rw-r--r--share/syscons/keymaps/pt.iso.kbd114
-rw-r--r--sys/Makefile5
-rw-r--r--sys/alpha/alpha/alpha-gdbstub.c10
-rw-r--r--sys/alpha/alpha/autoconf.c18
-rw-r--r--sys/alpha/alpha/clock.c10
-rw-r--r--sys/alpha/alpha/clock_if.m4
-rw-r--r--sys/alpha/alpha/cons.c4
-rw-r--r--sys/alpha/alpha/db_disasm.c16
-rw-r--r--sys/alpha/alpha/dec_2100_a50.c4
-rw-r--r--sys/alpha/alpha/dec_eb164.c10
-rw-r--r--sys/alpha/alpha/dec_eb64plus.c187
-rw-r--r--sys/alpha/alpha/dec_kn20aa.c6
-rw-r--r--sys/alpha/alpha/dec_st550.c3
-rw-r--r--sys/alpha/alpha/diskslice_machdep.c4
-rw-r--r--sys/alpha/alpha/elf_machdep.c6
-rw-r--r--sys/alpha/alpha/fp_emulate.c411
-rw-r--r--sys/alpha/alpha/genassym.c8
-rw-r--r--sys/alpha/alpha/ieee_float.c1515
-rw-r--r--sys/alpha/alpha/ieee_float.h102
-rw-r--r--sys/alpha/alpha/interrupt.c68
-rw-r--r--sys/alpha/alpha/ipl_funcs.c6
-rw-r--r--sys/alpha/alpha/locore.s24
-rw-r--r--sys/alpha/alpha/machdep.c122
-rw-r--r--sys/alpha/alpha/mem.c18
-rw-r--r--sys/alpha/alpha/pal.s21
-rw-r--r--sys/alpha/alpha/pmap.c9
-rw-r--r--sys/alpha/alpha/support.s7
-rw-r--r--sys/alpha/alpha/swtch.s13
-rw-r--r--sys/alpha/alpha/sys_machdep.c79
-rw-r--r--sys/alpha/alpha/trap.c27
-rw-r--r--sys/alpha/alpha/vm_machdep.c20
-rw-r--r--sys/alpha/conf/GENERIC4
-rw-r--r--sys/alpha/conf/Makefile.alpha18
-rw-r--r--sys/alpha/conf/files.alpha26
-rw-r--r--sys/alpha/conf/majors.alpha7
-rw-r--r--sys/alpha/conf/options.alpha3
-rw-r--r--sys/alpha/include/alpha_cpu.h9
-rw-r--r--sys/alpha/include/ansi.h21
-rw-r--r--sys/alpha/include/chipset.h25
-rw-r--r--sys/alpha/include/console.h4
-rw-r--r--sys/alpha/include/fpu.h124
-rw-r--r--sys/alpha/include/frame.h62
-rw-r--r--sys/alpha/include/ieeefp.h16
-rw-r--r--sys/alpha/include/inst.h462
-rw-r--r--sys/alpha/include/intr.h17
-rw-r--r--sys/alpha/include/intrcnt.h79
-rw-r--r--sys/alpha/include/md_var.h3
-rw-r--r--sys/alpha/include/mouse.h4
-rw-r--r--sys/alpha/include/pcb.h3
-rw-r--r--sys/alpha/include/proc.h11
-rw-r--r--sys/alpha/include/resource.h44
-rw-r--r--sys/alpha/include/signal.h8
-rw-r--r--sys/alpha/include/sysarch.h56
-rw-r--r--sys/alpha/include/types.h24
-rw-r--r--sys/alpha/include/vmparam.h12
-rw-r--r--sys/alpha/isa/isa.c469
-rw-r--r--sys/alpha/pci/apecs.c84
-rw-r--r--sys/alpha/pci/cia.c145
-rw-r--r--sys/alpha/pci/lca.c31
-rw-r--r--sys/alpha/pci/pci_eb64plus_intr.s63
-rw-r--r--sys/alpha/pci/pcibus.c130
-rw-r--r--sys/alpha/pci/pcibus.h26
-rw-r--r--sys/alpha/tc/am7990.c5
-rw-r--r--sys/alpha/tc/espvar.h5
-rw-r--r--sys/alpha/tlsb/dwlpx.c8
-rw-r--r--sys/alpha/tlsb/gbus.c6
-rw-r--r--sys/alpha/tlsb/kftxx.c6
-rw-r--r--sys/alpha/tlsb/tlsb.c35
-rw-r--r--sys/alpha/tlsb/zs_tlsb.c14
-rw-r--r--sys/boot/Makefile7
-rw-r--r--sys/boot/alpha/Makefile.inc8
-rw-r--r--sys/boot/alpha/boot1/Makefile10
-rw-r--r--sys/boot/alpha/boot1/boot1.c4
-rw-r--r--sys/boot/alpha/boot2/Makefile22
-rw-r--r--sys/boot/alpha/boot2/help.alpha0
-rw-r--r--sys/boot/alpha/boot2/newvers.sh1
-rw-r--r--sys/boot/alpha/common/main.c76
-rw-r--r--sys/boot/alpha/libalpha/Makefile4
-rw-r--r--sys/boot/alpha/libalpha/srmdisk.c41
-rw-r--r--sys/boot/alpha/libalpha/start.S15
-rw-r--r--sys/boot/alpha/netboot/Makefile6
-rw-r--r--sys/boot/common/Makefile.inc12
-rw-r--r--sys/boot/common/bcache.c262
-rw-r--r--sys/boot/common/boot.c12
-rw-r--r--sys/boot/common/bootstrap.h134
-rw-r--r--sys/boot/common/commands.c216
-rw-r--r--sys/boot/common/console.c10
-rw-r--r--sys/boot/common/help.common262
-rw-r--r--sys/boot/common/interp.c61
-rw-r--r--sys/boot/common/interp_backslash.c5
-rw-r--r--sys/boot/common/interp_forth.c142
-rw-r--r--sys/boot/common/interp_parse.c8
-rw-r--r--sys/boot/common/isapnp.c236
-rw-r--r--sys/boot/common/isapnp.h8
-rw-r--r--sys/boot/common/load_aout.c48
-rw-r--r--sys/boot/common/load_elf.c113
-rw-r--r--sys/boot/common/ls.c3
-rw-r--r--sys/boot/common/merge_help.awk101
-rw-r--r--sys/boot/common/module.c4
-rw-r--r--sys/boot/common/pnp.c173
-rw-r--r--sys/boot/common/pnpdata183
-rw-r--r--sys/boot/ficl/Makefile30
-rw-r--r--sys/boot/ficl/dict.c779
-rw-r--r--sys/boot/ficl/ficl.c432
-rw-r--r--sys/boot/ficl/ficl.h773
-rw-r--r--sys/boot/ficl/math64.c296
-rw-r--r--sys/boot/ficl/math64.h60
-rw-r--r--sys/boot/ficl/softwords/classes.fr140
-rw-r--r--sys/boot/ficl/softwords/jhlocal.fr77
-rw-r--r--sys/boot/ficl/softwords/marker.fr25
-rw-r--r--sys/boot/ficl/softwords/oo.fr464
-rw-r--r--sys/boot/ficl/softwords/softcore.awk96
-rw-r--r--sys/boot/ficl/softwords/softcore.fr125
-rw-r--r--sys/boot/ficl/stack.c305
-rw-r--r--sys/boot/ficl/sysdep.c126
-rw-r--r--sys/boot/ficl/sysdep.h251
-rw-r--r--sys/boot/ficl/testmain.c275
-rw-r--r--sys/boot/ficl/vm.c565
-rw-r--r--sys/boot/ficl/words.c4544
-rw-r--r--sys/boot/i386/boot0/Makefile10
-rw-r--r--sys/boot/i386/boot0/boot0.m417
-rw-r--r--sys/boot/i386/boot0/boot0.s224
-rw-r--r--sys/boot/i386/boot2/Makefile11
-rw-r--r--sys/boot/i386/boot2/boot1.m44
-rw-r--r--sys/boot/i386/boot2/boot1.s176
-rw-r--r--sys/boot/i386/boot2/boot2.c74
-rw-r--r--sys/boot/i386/boot2/sio.s8
-rw-r--r--sys/boot/i386/btx/btx/btx.s32
-rw-r--r--sys/boot/i386/btx/btxldr/Makefile5
-rw-r--r--sys/boot/i386/btx/btxldr/btxldr.s68
-rw-r--r--sys/boot/i386/btx/lib/btxv86.s7
-rw-r--r--sys/boot/i386/libi386/Makefile27
-rw-r--r--sys/boot/i386/libi386/biosdisk.c130
-rw-r--r--sys/boot/i386/libi386/biospci.c294
-rw-r--r--sys/boot/i386/libi386/biospnp.c289
-rw-r--r--sys/boot/i386/libi386/bootinfo.c6
-rw-r--r--sys/boot/i386/libi386/comconsole.c89
-rw-r--r--sys/boot/i386/libi386/vidconsole.c403
-rw-r--r--sys/boot/i386/loader/Makefile72
-rw-r--r--sys/boot/i386/loader/conf.c10
-rw-r--r--sys/boot/i386/loader/help.i38634
-rw-r--r--sys/boot/i386/loader/main.c46
-rwxr-xr-xsys/boot/i386/loader/newvers.sh1
-rw-r--r--sys/boot/i386/loader/setdef0.c49
-rw-r--r--sys/boot/i386/loader/setdef1.c41
-rw-r--r--sys/cam/cam_ccb.h5
-rw-r--r--sys/cam/cam_debug.h10
-rw-r--r--sys/cam/cam_periph.c109
-rw-r--r--sys/cam/cam_periph.h10
-rw-r--r--sys/cam/cam_queue.h8
-rw-r--r--sys/cam/cam_xpt.c365
-rw-r--r--sys/cam/scsi/scsi_all.c31
-rw-r--r--sys/cam/scsi/scsi_all.h9
-rw-r--r--sys/cam/scsi/scsi_cd.c190
-rw-r--r--sys/cam/scsi/scsi_ch.c113
-rw-r--r--sys/cam/scsi/scsi_ch.h2
-rw-r--r--sys/cam/scsi/scsi_da.c215
-rw-r--r--sys/cam/scsi/scsi_pass.c152
-rw-r--r--sys/cam/scsi/scsi_pt.c125
-rw-r--r--sys/cam/scsi/scsi_sa.c1320
-rw-r--r--sys/cam/scsi/scsi_sa.h68
-rw-r--r--sys/cam/scsi/scsi_targ_bh.c715
-rw-r--r--sys/cam/scsi/scsi_target.c387
-rw-r--r--sys/coda/00READ11
-rw-r--r--sys/coda/cnode.h20
-rw-r--r--sys/coda/coda.h194
-rw-r--r--sys/coda/coda_fbsd.c137
-rw-r--r--sys/coda/coda_namecache.c7
-rw-r--r--sys/coda/coda_psdev.c112
-rw-r--r--sys/coda/coda_subr.c33
-rw-r--r--sys/coda/coda_venus.c15
-rw-r--r--sys/coda/coda_vfsops.c51
-rw-r--r--sys/coda/coda_vnops.c58
-rw-r--r--sys/conf/files168
-rw-r--r--sys/conf/newvers.sh7
-rw-r--r--sys/conf/options39
-rw-r--r--sys/conf/param.c10
-rw-r--r--sys/contrib/softupdates/README320
-rw-r--r--sys/ddb/db_command.c4
-rw-r--r--sys/ddb/db_sym.c6
-rw-r--r--sys/dev/advansys/advansys.c19
-rw-r--r--sys/dev/advansys/advlib.c8
-rw-r--r--sys/dev/advansys/adwlib.c5
-rw-r--r--sys/dev/aha/aha.c470
-rw-r--r--sys/dev/aha/ahareg.h125
-rw-r--r--sys/dev/aic7xxx/Makefile4
-rw-r--r--sys/dev/aic7xxx/aic7xxx.c2253
-rw-r--r--sys/dev/aic7xxx/aic7xxx.h75
-rw-r--r--sys/dev/aic7xxx/aic7xxx.reg97
-rw-r--r--sys/dev/aic7xxx/aic7xxx.seq404
-rw-r--r--sys/dev/aic7xxx/aicasm_gram.y6
-rw-r--r--sys/dev/buslogic/bt.c144
-rw-r--r--sys/dev/buslogic/btreg.h11
-rw-r--r--sys/dev/dec/mcclock_if.m4
-rw-r--r--sys/dev/dpt/dpt_control.c5
-rw-r--r--sys/dev/dpt/dpt_scsi.c14
-rw-r--r--sys/dev/en/midway.c8
-rw-r--r--sys/dev/fb/fb.c421
-rw-r--r--sys/dev/fb/fbreg.h154
-rw-r--r--sys/dev/fb/splash.c208
-rw-r--r--sys/dev/fb/splashreg.h102
-rw-r--r--sys/dev/fb/vgareg.h67
-rw-r--r--sys/dev/hea/eni.c22
-rw-r--r--sys/dev/hea/eni_buffer.c10
-rw-r--r--sys/dev/hea/eni_globals.c10
-rw-r--r--sys/dev/hea/eni_if.c13
-rw-r--r--sys/dev/hea/eni_init.c10
-rw-r--r--sys/dev/hea/eni_intr.c10
-rw-r--r--sys/dev/hea/eni_receive.c10
-rw-r--r--sys/dev/hea/eni_transmit.c12
-rw-r--r--sys/dev/hea/eni_vcm.c10
-rw-r--r--sys/dev/hfa/fore_buffer.c8
-rw-r--r--sys/dev/hfa/fore_command.c11
-rw-r--r--sys/dev/hfa/fore_globals.c8
-rw-r--r--sys/dev/hfa/fore_if.c11
-rw-r--r--sys/dev/hfa/fore_init.c11
-rw-r--r--sys/dev/hfa/fore_intr.c8
-rw-r--r--sys/dev/hfa/fore_load.c28
-rw-r--r--sys/dev/hfa/fore_output.c8
-rw-r--r--sys/dev/hfa/fore_receive.c8
-rw-r--r--sys/dev/hfa/fore_stats.c8
-rw-r--r--sys/dev/hfa/fore_timer.c8
-rw-r--r--sys/dev/hfa/fore_transmit.c8
-rw-r--r--sys/dev/hfa/fore_vcm.c8
-rw-r--r--sys/dev/iicbus/if_ic.c5
-rw-r--r--sys/dev/iicbus/iic.c20
-rw-r--r--sys/dev/iicbus/iicbb.c323
-rw-r--r--sys/dev/iicbus/iicbb_if.m65
-rw-r--r--sys/dev/iicbus/iicbus.c147
-rw-r--r--sys/dev/iicbus/iicbus.h5
-rw-r--r--sys/dev/iicbus/iicbus_if.m22
-rw-r--r--sys/dev/iicbus/iiconf.c170
-rw-r--r--sys/dev/iicbus/iiconf.h40
-rw-r--r--sys/dev/iicbus/iicsmb.c128
-rw-r--r--sys/dev/isp/asm_pci.h22380
-rw-r--r--sys/dev/isp/asm_sbus.h1205
-rw-r--r--sys/dev/isp/isp.c813
-rw-r--r--sys/dev/isp/isp_freebsd.c179
-rw-r--r--sys/dev/isp/isp_freebsd.h17
-rw-r--r--sys/dev/isp/isp_freebsd_cam.h48
-rw-r--r--sys/dev/isp/ispmbox.h607
-rw-r--r--sys/dev/isp/ispreg.h5
-rw-r--r--sys/dev/isp/ispvar.h80
-rw-r--r--sys/dev/kbd/atkbd.c1313
-rw-r--r--sys/dev/kbd/atkbdc.c1017
-rw-r--r--sys/dev/kbd/atkbdcreg.h246
-rw-r--r--sys/dev/kbd/atkbdreg.h61
-rw-r--r--sys/dev/kbd/kbd.c1198
-rw-r--r--sys/dev/kbd/kbdreg.h270
-rw-r--r--sys/dev/kbd/kbdtables.h1332
-rw-r--r--sys/dev/pci/ohci_pci.c200
-rw-r--r--sys/dev/pci/uhci_pci.c228
-rw-r--r--sys/dev/ppbus/if_plip.c24
-rw-r--r--sys/dev/ppbus/immio.c24
-rw-r--r--sys/dev/ppbus/lpbb.c319
-rw-r--r--sys/dev/ppbus/nlpt.c171
-rw-r--r--sys/dev/ppbus/nlpt.h6
-rw-r--r--sys/dev/ppbus/ppb_1284.c777
-rw-r--r--sys/dev/ppbus/ppb_1284.h65
-rw-r--r--sys/dev/ppbus/ppb_base.c49
-rw-r--r--sys/dev/ppbus/ppb_msq.c22
-rw-r--r--sys/dev/ppbus/ppb_msq.h4
-rw-r--r--sys/dev/ppbus/ppbconf.c216
-rw-r--r--sys/dev/ppbus/ppbconf.h37
-rw-r--r--sys/dev/ppbus/ppi.c324
-rw-r--r--sys/dev/ppbus/pps.c5
-rw-r--r--sys/dev/ppbus/vpo.c15
-rw-r--r--sys/dev/ppbus/vpoio.c23
-rw-r--r--sys/dev/smbus/smb.c50
-rw-r--r--sys/dev/smbus/smbconf.c60
-rw-r--r--sys/dev/smbus/smbconf.h10
-rw-r--r--sys/dev/smbus/smbus.c49
-rw-r--r--sys/dev/smbus/smbus_if.m19
-rw-r--r--sys/dev/syscons/scvesactl.c143
-rw-r--r--sys/dev/syscons/scvidctl.c583
-rw-r--r--sys/dev/syscons/syscons.c4529
-rw-r--r--sys/dev/syscons/syscons.h241
-rw-r--r--sys/dev/usb/hid.c471
-rw-r--r--sys/dev/usb/hid.h91
-rw-r--r--sys/dev/usb/ohci.c2228
-rw-r--r--sys/dev/usb/ohcireg.h208
-rw-r--r--sys/dev/usb/ohcivar.h115
-rw-r--r--sys/dev/usb/ucom.c139
-rw-r--r--sys/dev/usb/ugen.c985
-rw-r--r--sys/dev/usb/uhci.c2620
-rw-r--r--sys/dev/usb/uhcireg.h191
-rw-r--r--sys/dev/usb/uhcivar.h180
-rw-r--r--sys/dev/usb/uhid.c546
-rw-r--r--sys/dev/usb/uhub.c521
-rw-r--r--sys/dev/usb/ukbd.c680
-rw-r--r--sys/dev/usb/ulpt.c451
-rw-r--r--sys/dev/usb/umodem.c142
-rw-r--r--sys/dev/usb/ums.c720
-rw-r--r--sys/dev/usb/usb.c418
-rw-r--r--sys/dev/usb/usb.h493
-rw-r--r--sys/dev/usb/usb_if.m41
-rw-r--r--sys/dev/usb/usb_mem.h92
-rw-r--r--sys/dev/usb/usb_port.h217
-rw-r--r--sys/dev/usb/usb_quirks.c94
-rw-r--r--sys/dev/usb/usb_quirks.h53
-rw-r--r--sys/dev/usb/usb_subr.c1127
-rw-r--r--sys/dev/usb/usbcdc.h141
-rw-r--r--sys/dev/usb/usbdevs.h176
-rw-r--r--sys/dev/usb/usbdevs_data.h439
-rw-r--r--sys/dev/usb/usbdi.c1294
-rw-r--r--sys/dev/usb/usbdi.h343
-rw-r--r--sys/dev/usb/usbdi_util.c511
-rw-r--r--sys/dev/usb/usbdi_util.h92
-rw-r--r--sys/dev/usb/usbdivar.h227
-rw-r--r--sys/dev/usb/usbhid.h135
-rw-r--r--sys/dev/vinum/COPYRIGHT37
-rw-r--r--sys/dev/vinum/Makefile26
-rwxr-xr-xsys/dev/vinum/makestatetext78
-rw-r--r--sys/dev/vinum/request.h220
-rw-r--r--sys/dev/vinum/statetexts.h87
-rw-r--r--sys/dev/vinum/vinum.c501
-rw-r--r--sys/dev/vinum/vinumconfig.c1730
-rw-r--r--sys/dev/vinum/vinumdaemon.c202
-rw-r--r--sys/dev/vinum/vinumext.h226
-rw-r--r--sys/dev/vinum/vinumhdr.h104
-rw-r--r--sys/dev/vinum/vinuminterrupt.c210
-rw-r--r--sys/dev/vinum/vinumio.c1032
-rw-r--r--sys/dev/vinum/vinumio.h145
-rw-r--r--sys/dev/vinum/vinumioctl.c767
-rw-r--r--sys/dev/vinum/vinumkw.h129
-rw-r--r--sys/dev/vinum/vinumlock.c171
-rw-r--r--sys/dev/vinum/vinummemory.c198
-rw-r--r--sys/dev/vinum/vinumparser.c216
-rw-r--r--sys/dev/vinum/vinumrequest.c925
-rw-r--r--sys/dev/vinum/vinumrevive.c181
-rw-r--r--sys/dev/vinum/vinumstate.c843
-rw-r--r--sys/dev/vinum/vinumstate.h206
-rw-r--r--sys/dev/vinum/vinumutil.c280
-rw-r--r--sys/dev/vinum/vinumvar.h528
-rw-r--r--sys/dev/vx/if_vx.c8
-rw-r--r--sys/dev/vx/if_vxreg.h2
-rw-r--r--sys/gnu/ext2fs/ext2_alloc.c7
-rw-r--r--sys/gnu/ext2fs/ext2_extern.h2
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c27
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c7
-rw-r--r--sys/gnu/ext2fs/ext2_subr.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c32
-rw-r--r--sys/gnu/i386/fpemul/fpu_entry.c48
-rw-r--r--sys/gnu/i386/isa/dgb.c13
-rw-r--r--sys/gnu/i386/isa/dgm.c17
-rw-r--r--sys/gnu/i386/isa/sound/awe_wave.c112
-rw-r--r--sys/i386/apm/apm.c15
-rw-r--r--sys/i386/boot/Makefile4
-rw-r--r--sys/i386/boot/Makefile.inc4
-rw-r--r--sys/i386/boot/biosboot/Makefile21
-rw-r--r--sys/i386/boot/biosboot/README.serial6
-rw-r--r--sys/i386/boot/biosboot/probe_keyboard.c5
-rw-r--r--sys/i386/boot/cdboot/Makefile11
-rw-r--r--sys/i386/boot/dosboot/Makefile3
-rw-r--r--sys/i386/boot/dosboot/disklabe.h4
-rw-r--r--sys/i386/boot/kzipboot/Makefile6
-rw-r--r--sys/i386/boot/kzipboot/malloc.c6
-rw-r--r--sys/i386/boot/netboot/Makefile23
-rw-r--r--sys/i386/boot/rawboot/Makefile7
-rw-r--r--sys/i386/conf/GENERIC115
-rw-r--r--sys/i386/conf/GENERICupgrade176
-rw-r--r--sys/i386/conf/LINT507
-rw-r--r--sys/i386/conf/LKM10
-rw-r--r--sys/i386/conf/Makefile.i38662
-rw-r--r--sys/i386/conf/PCCARD114
-rw-r--r--sys/i386/conf/SMP-GENERIC201
-rw-r--r--sys/i386/conf/devices.i3864
-rw-r--r--sys/i386/conf/files.i38661
-rw-r--r--sys/i386/conf/majors.i38622
-rw-r--r--sys/i386/conf/options.i38678
-rw-r--r--sys/i386/eisa/adv_eisa.c8
-rw-r--r--sys/i386/eisa/ahc_eisa.c3
-rw-r--r--sys/i386/eisa/eisaconf.c8
-rw-r--r--sys/i386/eisa/if_fea.c6
-rw-r--r--sys/i386/eisa/if_vx_eisa.c4
-rw-r--r--sys/i386/i386/autoconf.c53
-rw-r--r--sys/i386/i386/busdma_machdep.c67
-rw-r--r--sys/i386/i386/cons.c29
-rw-r--r--sys/i386/i386/cons.h33
-rw-r--r--sys/i386/i386/db_interface.c7
-rw-r--r--sys/i386/i386/elf_machdep.c4
-rw-r--r--sys/i386/i386/gensetdefs.c313
-rw-r--r--sys/i386/i386/i386-gdbstub.c3
-rw-r--r--sys/i386/i386/identcpu.c62
-rw-r--r--sys/i386/i386/initcpu.c85
-rw-r--r--sys/i386/i386/locore.s15
-rw-r--r--sys/i386/i386/machdep.c46
-rw-r--r--sys/i386/i386/math_emulate.c56
-rw-r--r--sys/i386/i386/mem.c4
-rw-r--r--sys/i386/i386/mp_machdep.c34
-rw-r--r--sys/i386/i386/perfmon.c8
-rw-r--r--sys/i386/i386/pmap.c75
-rw-r--r--sys/i386/i386/setdef0.c49
-rw-r--r--sys/i386/i386/setdef1.c41
-rw-r--r--sys/i386/i386/support.s3
-rw-r--r--sys/i386/i386/swapgeneric.c5
-rw-r--r--sys/i386/i386/sys_machdep.c3
-rw-r--r--sys/i386/i386/trap.c139
-rw-r--r--sys/i386/i386/userconfig.c227
-rw-r--r--sys/i386/i386/vm86.c3
-rw-r--r--sys/i386/i386/vm_machdep.c28
-rw-r--r--sys/i386/ibcs2/ibcs2_errno.c6
-rw-r--r--sys/i386/ibcs2/ibcs2_socksys.c4
-rw-r--r--sys/i386/ibcs2/ibcs2_stat.c21
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c23
-rw-r--r--sys/i386/ibcs2/ibcs2_util.h2
-rw-r--r--sys/i386/ibcs2/ibcs2_xenix.c26
-rw-r--r--sys/i386/ibcs2/imgact_coff.c6
-rw-r--r--sys/i386/include/ansi.h18
-rw-r--r--sys/i386/include/apm_bios.h3
-rw-r--r--sys/i386/include/console.h77
-rw-r--r--sys/i386/include/cpufunc.h74
-rw-r--r--sys/i386/include/elf.h4
-rw-r--r--sys/i386/include/i4b_cause.h144
-rw-r--r--sys/i386/include/i4b_debug.h219
-rw-r--r--sys/i386/include/i4b_ioctl.h606
-rw-r--r--sys/i386/include/i4b_tel_ioctl.h52
-rw-r--r--sys/i386/include/i4b_trace.h91
-rw-r--r--sys/i386/include/iic.h19
-rw-r--r--sys/i386/include/md_var.h15
-rw-r--r--sys/i386/include/mouse.h4
-rw-r--r--sys/i386/include/param.h6
-rw-r--r--sys/i386/include/pc/vesa.h6
-rw-r--r--sys/i386/include/pmap.h7
-rw-r--r--sys/i386/include/resource.h43
-rw-r--r--sys/i386/include/smb.h7
-rw-r--r--sys/i386/include/types.h23
-rw-r--r--sys/i386/isa/README.le4
-rw-r--r--sys/i386/isa/README.stl2
-rw-r--r--sys/i386/isa/adv_isa.c10
-rw-r--r--sys/i386/isa/aha_isa.c133
-rw-r--r--sys/i386/isa/aic6360.c18
-rw-r--r--sys/i386/isa/alog.c663
-rw-r--r--sys/i386/isa/asc.c7
-rw-r--r--sys/i386/isa/atapi-cd.c18
-rw-r--r--sys/i386/isa/atapi.c20
-rw-r--r--sys/i386/isa/atapi.h4
-rw-r--r--sys/i386/isa/atkbd_isa.c100
-rw-r--r--sys/i386/isa/atkbdc_isa.c83
-rw-r--r--sys/i386/isa/b004.c669
-rw-r--r--sys/i386/isa/b004.h154
-rw-r--r--sys/i386/isa/bs/bs.c341
-rw-r--r--sys/i386/isa/bs/bs_isa.c3
-rw-r--r--sys/i386/isa/bs/bsfunc.c70
-rw-r--r--sys/i386/isa/bs/bsfunc.h34
-rw-r--r--sys/i386/isa/bs/bshw.c2
-rw-r--r--sys/i386/isa/bs/bshw.h2
-rw-r--r--sys/i386/isa/bs/bshw_dma.c2
-rw-r--r--sys/i386/isa/bs/bsif.c79
-rw-r--r--sys/i386/isa/bs/bsif.h23
-rw-r--r--sys/i386/isa/bs/bsvar.h97
-rw-r--r--sys/i386/isa/bt_isa.c29
-rw-r--r--sys/i386/isa/ccbque.h14
-rw-r--r--sys/i386/isa/clock.c64
-rw-r--r--sys/i386/isa/ctx.c4
-rw-r--r--sys/i386/isa/cx.c5
-rw-r--r--sys/i386/isa/cy.c587
-rw-r--r--sys/i386/isa/cyreg.h46
-rw-r--r--sys/i386/isa/diskslice_machdep.c4
-rw-r--r--sys/i386/isa/fd.c467
-rw-r--r--sys/i386/isa/fdc.h9
-rw-r--r--sys/i386/isa/ft.c2580
-rw-r--r--sys/i386/isa/ftreg.h90
-rw-r--r--sys/i386/isa/gsc.c166
-rw-r--r--sys/i386/isa/ic/cd1400.h7
-rw-r--r--sys/i386/isa/ic/esp.h5
-rw-r--r--sys/i386/isa/ic/ncr53400.h49
-rw-r--r--sys/i386/isa/ic/ncr5380.h90
-rw-r--r--sys/i386/isa/ic/ns16550.h16
-rw-r--r--sys/i386/isa/ic/rsa.h128
-rw-r--r--sys/i386/isa/if_ar.c13
-rw-r--r--sys/i386/isa/if_cs.c24
-rw-r--r--sys/i386/isa/if_cx.c11
-rw-r--r--sys/i386/isa/if_ed.c21
-rw-r--r--sys/i386/isa/if_eg.c789
-rw-r--r--sys/i386/isa/if_egreg.h103
-rw-r--r--sys/i386/isa/if_el.c144
-rw-r--r--sys/i386/isa/if_ep.c18
-rw-r--r--sys/i386/isa/if_ex.c7
-rw-r--r--sys/i386/isa/if_fe.c3640
-rw-r--r--sys/i386/isa/if_fereg.h16
-rw-r--r--sys/i386/isa/if_ie.c9
-rw-r--r--sys/i386/isa/if_le.c8
-rw-r--r--sys/i386/isa/if_lnc.c25
-rw-r--r--sys/i386/isa/if_lnc.h39
-rw-r--r--sys/i386/isa/if_rdp.c1456
-rw-r--r--sys/i386/isa/if_rdpreg.h187
-rw-r--r--sys/i386/isa/if_sr.c39
-rw-r--r--sys/i386/isa/if_wl.c59
-rw-r--r--sys/i386/isa/if_wl.h2
-rw-r--r--sys/i386/isa/if_ze.c9
-rw-r--r--sys/i386/isa/if_zp.c7
-rw-r--r--sys/i386/isa/intr_machdep.c7
-rw-r--r--sys/i386/isa/ipl_funcs.c7
-rw-r--r--sys/i386/isa/isa.c11
-rw-r--r--sys/i386/isa/isa.h7
-rw-r--r--sys/i386/isa/isa_device.h81
-rw-r--r--sys/i386/isa/istallion.c5
-rw-r--r--sys/i386/isa/kbdio.c1037
-rw-r--r--sys/i386/isa/kbdio.h209
-rw-r--r--sys/i386/isa/kbdtables.h6
-rw-r--r--sys/i386/isa/labpc.c12
-rw-r--r--sys/i386/isa/loran.c361
-rw-r--r--sys/i386/isa/lpt.c73
-rw-r--r--sys/i386/isa/matcd/audio.c2
-rw-r--r--sys/i386/isa/matcd/matcd.c6
-rw-r--r--sys/i386/isa/mcd.c6
-rw-r--r--sys/i386/isa/mse.c6
-rw-r--r--sys/i386/isa/ncr5380.c1536
-rw-r--r--sys/i386/isa/npx.c30
-rw-r--r--sys/i386/isa/pcaudio.c48
-rw-r--r--sys/i386/isa/pcf.c145
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c186
-rw-r--r--sys/i386/isa/pcvt/pcvt_hdr.h33
-rw-r--r--sys/i386/isa/pcvt/pcvt_kbd.c286
-rw-r--r--sys/i386/isa/pcvt/pcvt_sup.c2
-rw-r--r--sys/i386/isa/pnp.c12
-rw-r--r--sys/i386/isa/ppc.c801
-rw-r--r--sys/i386/isa/ppcreg.h91
-rw-r--r--sys/i386/isa/prof_machdep.c9
-rw-r--r--sys/i386/isa/psm.c160
-rw-r--r--sys/i386/isa/rc.c6
-rw-r--r--sys/i386/isa/rp.c52
-rw-r--r--sys/i386/isa/scd.c19
-rw-r--r--sys/i386/isa/scvesactl.c145
-rw-r--r--sys/i386/isa/scvidctl.c496
-rw-r--r--sys/i386/isa/seagate.c1506
-rw-r--r--sys/i386/isa/si.c6
-rw-r--r--sys/i386/isa/sio.c250
-rw-r--r--sys/i386/isa/sioreg.h15
-rw-r--r--sys/i386/isa/snd/CARDS144
-rw-r--r--sys/i386/isa/snd/README25
-rw-r--r--sys/i386/isa/snd/ad1848.c574
-rw-r--r--sys/i386/isa/snd/dmabuf.c63
-rw-r--r--sys/i386/isa/snd/mss.h55
-rw-r--r--sys/i386/isa/snd/sb_dsp.c145
-rw-r--r--sys/i386/isa/snd/sbcard.h30
-rw-r--r--sys/i386/isa/snd/sound.c242
-rw-r--r--sys/i386/isa/snd/sound.h16
-rw-r--r--sys/i386/isa/snd/ulaw.h74
-rw-r--r--sys/i386/isa/sound/README.FREEBSD6
-rw-r--r--sys/i386/isa/sound/ad1848.c11
-rw-r--r--sys/i386/isa/sound/audio.c27
-rw-r--r--sys/i386/isa/sound/dmabuf.c3
-rw-r--r--sys/i386/isa/sound/gus_wave.c6
-rw-r--r--sys/i386/isa/sound/mmap_test.c2
-rw-r--r--sys/i386/isa/sound/mpu401.c6
-rw-r--r--sys/i386/isa/sound/pas2_card.c2
-rw-r--r--sys/i386/isa/sound/patmgr.c4
-rw-r--r--sys/i386/isa/sound/pcm86.c5
-rw-r--r--sys/i386/isa/sound/pss.c2
-rw-r--r--sys/i386/isa/sound/sb16_dsp.c6
-rw-r--r--sys/i386/isa/sound/sb_dsp.c5
-rw-r--r--sys/i386/isa/sound/sequencer.c2
-rw-r--r--sys/i386/isa/sound/sound.doc14
-rw-r--r--sys/i386/isa/sound/sound_calls.h7
-rw-r--r--sys/i386/isa/sound/sound_timer.c2
-rw-r--r--sys/i386/isa/sound/soundcard.c56
-rw-r--r--sys/i386/isa/sound/sscape.c11
-rw-r--r--sys/i386/isa/spigot.c7
-rw-r--r--sys/i386/isa/stallion.c11
-rw-r--r--sys/i386/isa/syscons.c4688
-rw-r--r--sys/i386/isa/syscons.h245
-rw-r--r--sys/i386/isa/syscons_isa.c74
-rw-r--r--sys/i386/isa/tw.c6
-rw-r--r--sys/i386/isa/ultra14f.c1362
-rw-r--r--sys/i386/isa/vesa.c459
-rw-r--r--sys/i386/isa/vga_isa.c2238
-rw-r--r--sys/i386/isa/videoio.c1774
-rw-r--r--sys/i386/isa/videoio.h104
-rw-r--r--sys/i386/isa/wcd.c1399
-rw-r--r--sys/i386/isa/wd.c54
-rw-r--r--sys/i386/isa/wd7000.c725
-rw-r--r--sys/i386/isa/wdreg.h6
-rw-r--r--sys/i386/isa/wfd.c5
-rw-r--r--sys/i386/isa/wst.c16
-rw-r--r--sys/i386/isa/wt.c30
-rw-r--r--sys/i386/linux/imgact_linux.c6
-rw-r--r--sys/i386/linux/linux.h20
-rw-r--r--sys/i386/linux/linux_dummy.c9
-rw-r--r--sys/i386/linux/linux_file.c6
-rw-r--r--sys/i386/linux/linux_ioctl.c62
-rw-r--r--sys/i386/linux/linux_misc.c271
-rw-r--r--sys/i386/linux/linux_proto.h15
-rw-r--r--sys/i386/linux/linux_signal.c4
-rw-r--r--sys/i386/linux/linux_socket.c40
-rw-r--r--sys/i386/linux/linux_syscall.h7
-rw-r--r--sys/i386/linux/linux_sysent.c10
-rw-r--r--sys/i386/linux/linux_sysvec.c27
-rw-r--r--sys/i386/linux/linux_util.h4
-rw-r--r--sys/i386/linux/syscalls.master13
-rw-r--r--sys/i4b/driver/i4b_ctl.c303
-rw-r--r--sys/i4b/driver/i4b_ipr.c1115
-rw-r--r--sys/i4b/driver/i4b_isppp.c710
-rw-r--r--sys/i4b/driver/i4b_rbch.c820
-rw-r--r--sys/i4b/driver/i4b_tel.c713
-rw-r--r--sys/i4b/driver/i4b_trace.c508
-rw-r--r--sys/i4b/include/i4b_global.h95
-rw-r--r--sys/i4b/include/i4b_isdnq931.h166
-rw-r--r--sys/i4b/include/i4b_l1l2.h99
-rw-r--r--sys/i4b/include/i4b_l2l3.h116
-rw-r--r--sys/i4b/include/i4b_l3l4.h260
-rw-r--r--sys/i4b/include/i4b_mbuf.h51
-rw-r--r--sys/i4b/layer1/i4b_avm_a1.c508
-rw-r--r--sys/i4b/layer1/i4b_avm_fritz_pcmcia.c504
-rw-r--r--sys/i4b/layer1/i4b_bchan.c484
-rw-r--r--sys/i4b/layer1/i4b_ctx_s0P.c366
-rw-r--r--sys/i4b/layer1/i4b_drn_ngo.c542
-rw-r--r--sys/i4b/layer1/i4b_dynalink.c438
-rw-r--r--sys/i4b/layer1/i4b_elsa_isdnmc.c305
-rw-r--r--sys/i4b/layer1/i4b_elsa_mcall.c251
-rw-r--r--sys/i4b/layer1/i4b_elsa_qs1i.c512
-rw-r--r--sys/i4b/layer1/i4b_elsa_qs1p.c458
-rw-r--r--sys/i4b/layer1/i4b_hscx.c672
-rw-r--r--sys/i4b/layer1/i4b_hscx.h301
-rw-r--r--sys/i4b/layer1/i4b_ipac.h199
-rw-r--r--sys/i4b/layer1/i4b_isac.c679
-rw-r--r--sys/i4b/layer1/i4b_isac.h391
-rw-r--r--sys/i4b/layer1/i4b_isic.c345
-rw-r--r--sys/i4b/layer1/i4b_isic_isa.c591
-rw-r--r--sys/i4b/layer1/i4b_isic_pci.c424
-rw-r--r--sys/i4b/layer1/i4b_isic_pcmcia.c158
-rw-r--r--sys/i4b/layer1/i4b_isic_pnp.c296
-rw-r--r--sys/i4b/layer1/i4b_itk_ix1.c431
-rw-r--r--sys/i4b/layer1/i4b_l1.c315
-rw-r--r--sys/i4b/layer1/i4b_l1.h438
-rw-r--r--sys/i4b/layer1/i4b_l1fsm.c546
-rw-r--r--sys/i4b/layer1/i4b_sws.c392
-rw-r--r--sys/i4b/layer1/i4b_tel_s016.c455
-rw-r--r--sys/i4b/layer1/i4b_tel_s0163.c432
-rw-r--r--sys/i4b/layer1/i4b_tel_s08.c389
-rw-r--r--sys/i4b/layer1/i4b_tel_s0P.c378
-rw-r--r--sys/i4b/layer1/i4b_usr_sti.c440
-rw-r--r--sys/i4b/layer1/isa_isic.c828
-rw-r--r--sys/i4b/layer1/isapnp_isic.c386
-rw-r--r--sys/i4b/layer1/isic_supio.c374
-rw-r--r--sys/i4b/layer1/pci_isic.c327
-rw-r--r--sys/i4b/layer1/pcmcia_isic.c358
-rw-r--r--sys/i4b/layer1/pcmcia_isic.h60
-rw-r--r--sys/i4b/layer2/i4b_iframe.c275
-rw-r--r--sys/i4b/layer2/i4b_l2.c390
-rw-r--r--sys/i4b/layer2/i4b_l2.h339
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.c1593
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.h82
-rw-r--r--sys/i4b/layer2/i4b_l2timer.c263
-rw-r--r--sys/i4b/layer2/i4b_lme.c160
-rw-r--r--sys/i4b/layer2/i4b_mbuf.c245
-rw-r--r--sys/i4b/layer2/i4b_sframe.c215
-rw-r--r--sys/i4b/layer2/i4b_tei.c322
-rw-r--r--sys/i4b/layer2/i4b_uframe.c308
-rw-r--r--sys/i4b/layer2/i4b_util.c312
-rw-r--r--sys/i4b/layer3/i4b_l2if.c642
-rw-r--r--sys/i4b/layer3/i4b_l3.h80
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.c1034
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.h105
-rw-r--r--sys/i4b/layer3/i4b_l3timer.c347
-rw-r--r--sys/i4b/layer3/i4b_l4if.c339
-rw-r--r--sys/i4b/layer3/i4b_q931.c624
-rw-r--r--sys/i4b/layer3/i4b_q931.h116
-rw-r--r--sys/i4b/layer3/i4b_q932fac.c569
-rw-r--r--sys/i4b/layer3/i4b_q932fac.h167
-rw-r--r--sys/i4b/layer4/i4b_i4bdrv.c832
-rw-r--r--sys/i4b/layer4/i4b_l4.c897
-rw-r--r--sys/i4b/layer4/i4b_l4.h69
-rw-r--r--sys/i4b/layer4/i4b_l4mgmt.c467
-rw-r--r--sys/i4b/layer4/i4b_l4timer.c110
-rw-r--r--sys/i4b/tina-dd/README20
-rw-r--r--sys/i4b/tina-dd/i4b_tina_dd.c328
-rw-r--r--sys/i4b/tina-dd/i4b_tina_ioctl.h138
-rw-r--r--sys/isa/isareg.h7
-rw-r--r--sys/isa/isavar.h30
-rw-r--r--sys/isa/kbdio.c4
-rw-r--r--sys/isa/kbdio.h11
-rw-r--r--sys/isa/psm.c2222
-rw-r--r--sys/isa/sio.c31
-rw-r--r--sys/isa/syscons.c23
-rw-r--r--sys/isofs/cd9660/cd9660_node.c4
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c14
-rw-r--r--sys/kern/bus_if.m86
-rw-r--r--sys/kern/device_if.m18
-rw-r--r--sys/kern/imgact_aout.c8
-rw-r--r--sys/kern/imgact_elf.c283
-rw-r--r--sys/kern/inflate.c11
-rw-r--r--sys/kern/init_main.c13
-rw-r--r--sys/kern/init_sysent.c4
-rw-r--r--sys/kern/kern_clock.c189
-rw-r--r--sys/kern/kern_conf.c7
-rw-r--r--sys/kern/kern_descrip.c147
-rw-r--r--sys/kern/kern_environment.c21
-rw-r--r--sys/kern/kern_exec.c42
-rw-r--r--sys/kern/kern_exit.c56
-rw-r--r--sys/kern/kern_fork.c50
-rw-r--r--sys/kern/kern_intr.c6
-rw-r--r--sys/kern/kern_ktrace.c5
-rw-r--r--sys/kern/kern_linker.c244
-rw-r--r--sys/kern/kern_lkm.c209
-rw-r--r--sys/kern/kern_lock.c38
-rw-r--r--sys/kern/kern_lockf.c3
-rw-r--r--sys/kern/kern_malloc.c88
-rw-r--r--sys/kern/kern_module.c30
-rw-r--r--sys/kern/kern_physio.c3
-rw-r--r--sys/kern/kern_proc.c39
-rw-r--r--sys/kern/kern_prot.c17
-rw-r--r--sys/kern/kern_shutdown.c60
-rw-r--r--sys/kern/kern_sig.c131
-rw-r--r--sys/kern/kern_subr.c24
-rw-r--r--sys/kern/kern_synch.c211
-rw-r--r--sys/kern/kern_syscalls.c109
-rw-r--r--sys/kern/kern_sysctl.c43
-rw-r--r--sys/kern/kern_threads.c6
-rw-r--r--sys/kern/kern_time.c3
-rw-r--r--sys/kern/link_aout.c18
-rw-r--r--sys/kern/link_elf.c94
-rw-r--r--sys/kern/makedevops.pl394
-rw-r--r--sys/kern/subr_autoconf.c10
-rw-r--r--sys/kern/subr_bus.c715
-rw-r--r--sys/kern/subr_devstat.c17
-rw-r--r--sys/kern/subr_diskslice.c13
-rw-r--r--sys/kern/subr_log.c32
-rw-r--r--sys/kern/subr_prf.c57
-rw-r--r--sys/kern/subr_rlist.c16
-rw-r--r--sys/kern/subr_rman.c591
-rw-r--r--sys/kern/subr_scanf.c793
-rw-r--r--sys/kern/subr_xxx.c4
-rw-r--r--sys/kern/sys_generic.c37
-rw-r--r--sys/kern/sys_pipe.c32
-rw-r--r--sys/kern/sys_process.c7
-rw-r--r--sys/kern/sys_socket.c15
-rw-r--r--sys/kern/syscalls.c4
-rw-r--r--sys/kern/syscalls.master5
-rw-r--r--sys/kern/sysv_sem.c4
-rw-r--r--sys/kern/tty.c66
-rw-r--r--sys/kern/tty_snoop.c10
-rw-r--r--sys/kern/uipc_domain.c95
-rw-r--r--sys/kern/uipc_socket.c32
-rw-r--r--sys/kern/uipc_socket2.c33
-rw-r--r--sys/kern/uipc_syscalls.c430
-rw-r--r--sys/kern/uipc_usrreq.c4
-rw-r--r--sys/kern/vfs_aio.c11
-rw-r--r--sys/kern/vfs_bio.c356
-rw-r--r--sys/kern/vfs_cluster.c69
-rw-r--r--sys/kern/vfs_default.c19
-rw-r--r--sys/kern/vfs_init.c413
-rw-r--r--sys/kern/vfs_lookup.c39
-rw-r--r--sys/kern/vfs_subr.c268
-rw-r--r--sys/kern/vfs_syscalls.c168
-rw-r--r--sys/kern/vfs_vnops.c34
-rw-r--r--sys/kern/vnode_if.sh40
-rw-r--r--sys/libkern/moddi3.c4
-rw-r--r--sys/miscfs/deadfs/dead_vnops.c4
-rw-r--r--sys/miscfs/devfs/devfs_tree.c6
-rw-r--r--sys/miscfs/devfs/devfs_vfsops.c7
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c35
-rw-r--r--sys/miscfs/devfs/devfsdefs.h3
-rw-r--r--sys/miscfs/fdesc/fdesc_vfsops.c10
-rw-r--r--sys/miscfs/fdesc/fdesc_vnops.c6
-rw-r--r--sys/miscfs/kernfs/kernfs_vfsops.c3
-rw-r--r--sys/miscfs/kernfs/kernfs_vnops.c13
-rw-r--r--sys/miscfs/nullfs/null_vnops.c6
-rw-r--r--sys/miscfs/portal/portal_vnops.c14
-rw-r--r--sys/miscfs/procfs/procfs.h6
-rw-r--r--sys/miscfs/procfs/procfs_map.c5
-rw-r--r--sys/miscfs/procfs/procfs_mem.c4
-rw-r--r--sys/miscfs/procfs/procfs_status.c39
-rw-r--r--sys/miscfs/procfs/procfs_subr.c7
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c8
-rw-r--r--sys/miscfs/specfs/spec_vnops.c16
-rw-r--r--sys/miscfs/umapfs/umap_subr.c23
-rw-r--r--sys/miscfs/umapfs/umap_vnops.c4
-rw-r--r--sys/miscfs/union/union.h5
-rw-r--r--sys/miscfs/union/union_subr.c86
-rw-r--r--sys/miscfs/union/union_vnops.c4
-rw-r--r--sys/modules/Makefile19
-rw-r--r--sys/modules/coda/Makefile12
-rw-r--r--sys/modules/coff/Makefile8
-rw-r--r--sys/modules/ibcs2/Makefile6
-rwxr-xr-xsys/modules/ibcs2/ibcs252
-rw-r--r--sys/modules/ibcs2/ibcs2.c64
-rw-r--r--sys/modules/ibcs2/ibcs2.sh43
-rw-r--r--sys/modules/if_ppp/Makefile5
-rw-r--r--sys/modules/if_tun/Makefile5
-rw-r--r--sys/modules/joy/Makefile4
-rw-r--r--sys/modules/joy/joy4
-rw-r--r--sys/modules/joy/joy.sh4
-rw-r--r--sys/modules/linux/Makefile6
-rw-r--r--sys/modules/linux/linux10
-rw-r--r--sys/modules/linux/linux.sh12
-rw-r--r--sys/modules/lkm/Makefile12
-rw-r--r--sys/modules/mfs/Makefile6
-rw-r--r--sys/modules/pcic/Makefile3
-rw-r--r--sys/modules/splash/Makefile5
-rw-r--r--sys/modules/splash/Makefile.inc3
-rw-r--r--sys/modules/splash/bmp/Makefile8
-rw-r--r--sys/modules/splash/bmp/splash_bmp.c494
-rw-r--r--sys/modules/syscons/Makefile4
-rw-r--r--sys/modules/syscons/blank/blank_saver.c53
-rw-r--r--sys/modules/syscons/daemon/daemon_saver.c67
-rw-r--r--sys/modules/syscons/fade/fade_saver.c61
-rw-r--r--sys/modules/syscons/green/green_saver.c48
-rw-r--r--sys/modules/syscons/logo/Makefile9
-rw-r--r--sys/modules/syscons/logo/logo.c352
-rw-r--r--sys/modules/syscons/logo/logo_saver.c148
-rw-r--r--sys/modules/syscons/rain/Makefile10
-rw-r--r--sys/modules/syscons/rain/rain_saver.c123
-rw-r--r--sys/modules/syscons/saver.h26
-rw-r--r--sys/modules/syscons/snake/snake_saver.c80
-rw-r--r--sys/modules/syscons/star/star_saver.c57
-rw-r--r--sys/modules/syscons/warp/Makefile10
-rw-r--r--sys/modules/syscons/warp/warp_saver.c132
-rw-r--r--sys/modules/vesa/Makefile23
-rw-r--r--sys/modules/vinum/COPYRIGHT37
-rw-r--r--sys/modules/vinum/Makefile25
-rw-r--r--sys/modules/vinum/config.c1712
-rw-r--r--sys/modules/vinum/interrupt.c190
-rw-r--r--sys/modules/vinum/io.c886
-rw-r--r--sys/modules/vinum/lock.c137
-rwxr-xr-xsys/modules/vinum/makestatetext40
-rw-r--r--sys/modules/vinum/memory.c186
-rw-r--r--sys/modules/vinum/parser.c206
-rw-r--r--sys/modules/vinum/request.c882
-rw-r--r--sys/modules/vinum/request.h159
-rw-r--r--sys/modules/vinum/revive.c128
-rw-r--r--sys/modules/vinum/state.c755
-rw-r--r--sys/modules/vinum/statetexts.h88
-rw-r--r--sys/modules/vinum/util.c211
-rw-r--r--sys/modules/vinum/vinum.c543
-rw-r--r--sys/modules/vinum/vinumext.h214
-rw-r--r--sys/modules/vinum/vinumhdr.h104
-rw-r--r--sys/modules/vinum/vinumio.h132
-rw-r--r--sys/modules/vinum/vinumioctl.c787
-rw-r--r--sys/modules/vinum/vinumkw.h120
-rw-r--r--sys/modules/vinum/vinumstate.h213
-rw-r--r--sys/modules/vinum/vinumvar.h510
-rw-r--r--sys/modules/wcd/Makefile29
-rw-r--r--sys/msdosfs/denode.h52
-rw-r--r--sys/msdosfs/direntry.h6
-rw-r--r--sys/msdosfs/msdosfs_conv.c8
-rw-r--r--sys/msdosfs/msdosfs_denode.c22
-rw-r--r--sys/msdosfs/msdosfs_lookup.c16
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c15
-rw-r--r--sys/msdosfs/msdosfs_vnops.c20
-rw-r--r--sys/net/bpf.c33
-rw-r--r--sys/net/bpf_filter.c94
-rw-r--r--sys/net/bpfdesc.h4
-rw-r--r--sys/net/bridge.c23
-rw-r--r--sys/net/bridge.h2
-rw-r--r--sys/net/if.c56
-rw-r--r--sys/net/if_atmsubr.c6
-rw-r--r--sys/net/if_disc.c30
-rw-r--r--sys/net/if_ethersubr.c23
-rw-r--r--sys/net/if_mib.c5
-rw-r--r--sys/net/if_sppp.h21
-rw-r--r--sys/net/if_spppsubr.c333
-rw-r--r--sys/net/if_tun.c36
-rw-r--r--sys/net/if_tunvar.h4
-rw-r--r--sys/net/if_var.h7
-rw-r--r--sys/net/if_vlan.c6
-rw-r--r--sys/net/ppp_tty.c11
-rw-r--r--sys/netatalk/aarp.c1
-rw-r--r--sys/netatalk/at_rmx.c5
-rw-r--r--sys/netatalk/ddp_input.c1
-rw-r--r--sys/netatalk/ddp_usrreq.c10
-rw-r--r--sys/netatm/atm_aal5.c33
-rw-r--r--sys/netatm/atm_cm.c8
-rw-r--r--sys/netatm/atm_device.c10
-rw-r--r--sys/netatm/atm_if.c27
-rw-r--r--sys/netatm/atm_proto.c8
-rw-r--r--sys/netatm/atm_signal.c8
-rw-r--r--sys/netatm/atm_socket.c12
-rw-r--r--sys/netatm/atm_subr.c8
-rw-r--r--sys/netatm/atm_usrreq.c26
-rw-r--r--sys/netatm/ipatm/ipatm_event.c10
-rw-r--r--sys/netatm/ipatm/ipatm_if.c10
-rw-r--r--sys/netatm/ipatm/ipatm_input.c15
-rw-r--r--sys/netatm/ipatm/ipatm_load.c10
-rw-r--r--sys/netatm/ipatm/ipatm_output.c10
-rw-r--r--sys/netatm/ipatm/ipatm_usrreq.c13
-rw-r--r--sys/netatm/ipatm/ipatm_vcm.c10
-rw-r--r--sys/netatm/sigpvc/sigpvc_if.c16
-rw-r--r--sys/netatm/sigpvc/sigpvc_subr.c10
-rw-r--r--sys/netatm/spans/spans_arp.c20
-rw-r--r--sys/netatm/spans/spans_cls.c12
-rw-r--r--sys/netatm/spans/spans_if.c13
-rw-r--r--sys/netatm/spans/spans_kxdr.c8
-rw-r--r--sys/netatm/spans/spans_msg.c10
-rw-r--r--sys/netatm/spans/spans_print.c108
-rw-r--r--sys/netatm/spans/spans_proto.c10
-rw-r--r--sys/netatm/spans/spans_subr.c10
-rw-r--r--sys/netatm/spans/spans_util.c10
-rw-r--r--sys/netatm/uni/Makefile93
-rw-r--r--sys/netatm/uni/q2110_sigaa.c10
-rw-r--r--sys/netatm/uni/q2110_sigcpcs.c10
-rw-r--r--sys/netatm/uni/q2110_subr.c10
-rw-r--r--sys/netatm/uni/qsaal1_sigaa.c10
-rw-r--r--sys/netatm/uni/qsaal1_sigcpcs.c10
-rw-r--r--sys/netatm/uni/qsaal1_subr.c10
-rw-r--r--sys/netatm/uni/sscf_uni.c12
-rw-r--r--sys/netatm/uni/sscf_uni_lower.c10
-rw-r--r--sys/netatm/uni/sscf_uni_upper.c10
-rw-r--r--sys/netatm/uni/sscop.c11
-rw-r--r--sys/netatm/uni/sscop_lower.c10
-rw-r--r--sys/netatm/uni/sscop_pdu.c13
-rw-r--r--sys/netatm/uni/sscop_sigaa.c10
-rw-r--r--sys/netatm/uni/sscop_sigcpcs.c10
-rw-r--r--sys/netatm/uni/sscop_subr.c10
-rw-r--r--sys/netatm/uni/sscop_timer.c10
-rw-r--r--sys/netatm/uni/sscop_upper.c10
-rw-r--r--sys/netatm/uni/uni_load.c10
-rw-r--r--sys/netatm/uni/uniarp.c25
-rw-r--r--sys/netatm/uni/uniarp_cache.c14
-rw-r--r--sys/netatm/uni/uniarp_input.c14
-rw-r--r--sys/netatm/uni/uniarp_output.c10
-rw-r--r--sys/netatm/uni/uniarp_timer.c10
-rw-r--r--sys/netatm/uni/uniarp_vcm.c10
-rw-r--r--sys/netatm/uni/uniip.c10
-rw-r--r--sys/netatm/uni/unisig_decode.c10
-rw-r--r--sys/netatm/uni/unisig_encode.c10
-rw-r--r--sys/netatm/uni/unisig_if.c15
-rw-r--r--sys/netatm/uni/unisig_mbuf.c10
-rw-r--r--sys/netatm/uni/unisig_msg.c13
-rw-r--r--sys/netatm/uni/unisig_print.c10
-rw-r--r--sys/netatm/uni/unisig_proto.c10
-rw-r--r--sys/netatm/uni/unisig_sigmgr_state.c27
-rw-r--r--sys/netatm/uni/unisig_subr.c50
-rw-r--r--sys/netatm/uni/unisig_util.c18
-rw-r--r--sys/netatm/uni/unisig_var.h6
-rw-r--r--sys/netatm/uni/unisig_vc_state.c83
-rw-r--r--sys/netinet/fil.c8
-rw-r--r--sys/netinet/icmp_var.h16
-rw-r--r--sys/netinet/if_ether.c18
-rw-r--r--sys/netinet/igmp.c8
-rw-r--r--sys/netinet/in.c6
-rw-r--r--sys/netinet/in.h7
-rw-r--r--sys/netinet/in_pcb.c4
-rw-r--r--sys/netinet/ip_auth.c8
-rw-r--r--sys/netinet/ip_divert.c10
-rw-r--r--sys/netinet/ip_dummynet.c155
-rw-r--r--sys/netinet/ip_dummynet.h10
-rw-r--r--sys/netinet/ip_fil.c14
-rw-r--r--sys/netinet/ip_flow.c3
-rw-r--r--sys/netinet/ip_frag.c12
-rw-r--r--sys/netinet/ip_ftp_pxy.c2
-rw-r--r--sys/netinet/ip_fw.c230
-rw-r--r--sys/netinet/ip_fw.h11
-rw-r--r--sys/netinet/ip_icmp.c91
-rw-r--r--sys/netinet/ip_input.c128
-rw-r--r--sys/netinet/ip_log.c17
-rw-r--r--sys/netinet/ip_mroute.c193
-rw-r--r--sys/netinet/ip_mroute.h5
-rw-r--r--sys/netinet/ip_nat.c8
-rw-r--r--sys/netinet/ip_output.c109
-rw-r--r--sys/netinet/ip_state.c8
-rw-r--r--sys/netinet/mlf_ipl.c46
-rw-r--r--sys/netinet/raw_ip.c24
-rw-r--r--sys/netinet/tcp_input.c10
-rw-r--r--sys/netinet/tcp_output.c5
-rw-r--r--sys/netinet/tcp_subr.c6
-rw-r--r--sys/netinet/tcp_usrreq.c10
-rw-r--r--sys/netinet/tcp_var.h35
-rw-r--r--sys/netinet/udp_usrreq.c8
-rw-r--r--sys/netinet/udp_var.h4
-rw-r--r--sys/netipx/ipx.c10
-rw-r--r--sys/netipx/ipx_usrreq.c3
-rw-r--r--sys/netipx/spx_usrreq.c26
-rw-r--r--sys/netkey/key.c33
-rw-r--r--sys/netkey/key_debug.c1
-rw-r--r--sys/netnatm/natm.c12
-rw-r--r--sys/nfs/bootp_subr.c14
-rw-r--r--sys/nfs/nfs_bio.c30
-rw-r--r--sys/nfs/nfs_nqlease.c5
-rw-r--r--sys/nfs/nfs_serv.c7
-rw-r--r--sys/nfs/nfs_socket.c13
-rw-r--r--sys/nfs/nfs_subs.c16
-rw-r--r--sys/nfs/nfs_syscalls.c3
-rw-r--r--sys/nfs/nfs_vfsops.c8
-rw-r--r--sys/nfs/nfs_vnops.c202
-rw-r--r--sys/nfs/nfsm_subs.h73
-rw-r--r--sys/nfs/nfsnode.h5
-rw-r--r--sys/pc98/boot/Makefile.inc4
-rw-r--r--sys/pc98/boot/biosboot/Makefile28
-rw-r--r--sys/pc98/boot/biosboot/README.serial6
-rw-r--r--sys/pc98/boot/biosboot/serial.S10
-rw-r--r--sys/pc98/boot/kzipboot/Makefile6
-rw-r--r--sys/pc98/boot/kzipboot/malloc.c6
-rw-r--r--sys/pc98/boot/netboot/Makefile21
-rw-r--r--sys/pc98/boot/rawboot/Makefile7
-rw-r--r--sys/pc98/conf/GENERIC98135
-rw-r--r--sys/pc98/conf/GENERICupgrade204
-rw-r--r--sys/pc98/conf/Makefile.pc9862
-rw-r--r--sys/pc98/conf/SMP-GENERIC98230
-rw-r--r--sys/pc98/conf/devices.pc984
-rw-r--r--sys/pc98/conf/files.pc9876
-rw-r--r--sys/pc98/conf/majors.pc9822
-rw-r--r--sys/pc98/conf/options.pc9868
-rw-r--r--sys/pc98/i386/machdep.c44
-rw-r--r--sys/pc98/i386/trap.c1159
-rw-r--r--sys/pc98/i386/userconfig.c227
-rw-r--r--sys/pc98/pc98/atcompat_diskslice.c4
-rw-r--r--sys/pc98/pc98/clock.c64
-rw-r--r--sys/pc98/pc98/diskslice_machdep.c8
-rw-r--r--sys/pc98/pc98/fd.c467
-rw-r--r--sys/pc98/pc98/if_ed.c33
-rw-r--r--sys/pc98/pc98/if_ed98.h114
-rw-r--r--sys/pc98/pc98/if_fe.c3824
-rw-r--r--sys/pc98/pc98/lpt.c73
-rw-r--r--sys/pc98/pc98/mse.c6
-rw-r--r--sys/pc98/pc98/npx.c30
-rw-r--r--sys/pc98/pc98/pc98.c11
-rw-r--r--sys/pc98/pc98/pc98gdc.c887
-rw-r--r--sys/pc98/pc98/pc98kbd.c1009
-rw-r--r--sys/pc98/pc98/pcaudio.c48
-rw-r--r--sys/pc98/pc98/scvidctl.c582
-rw-r--r--sys/pc98/pc98/sio.c1638
-rw-r--r--sys/pc98/pc98/sioreg.h119
-rw-r--r--sys/pc98/pc98/syscons.c4151
-rw-r--r--sys/pc98/pc98/syscons.h136
-rw-r--r--sys/pc98/pc98/wd.c76
-rw-r--r--sys/pccard/driver.h3
-rw-r--r--sys/pccard/pccard.c45
-rw-r--r--sys/pccard/pcic.c93
-rw-r--r--sys/pccard/skel.c84
-rw-r--r--sys/pccard/slot.h18
-rw-r--r--sys/pci/adv_pci.c23
-rw-r--r--sys/pci/adw_pci.c8
-rw-r--r--sys/pci/ahc_pci.c8
-rw-r--r--sys/pci/brktree_reg.h11
-rw-r--r--sys/pci/brooktree848.c84
-rw-r--r--sys/pci/bt848_i2c.c412
-rw-r--r--sys/pci/bt848_i2c.h34
-rw-r--r--sys/pci/bt_pci.c27
-rw-r--r--sys/pci/cy_pci.c37
-rw-r--r--sys/pci/cy_pcireg.h17
-rw-r--r--sys/pci/dpt_pci.c11
-rw-r--r--sys/pci/es1370.c1127
-rw-r--r--sys/pci/es1370_reg.h134
-rw-r--r--sys/pci/ide_pci.c339
-rw-r--r--sys/pci/if_ax.c2175
-rw-r--r--sys/pci/if_axreg.h559
-rw-r--r--sys/pci/if_de.c35
-rw-r--r--sys/pci/if_devar.h14
-rw-r--r--sys/pci/if_ed_p.c6
-rw-r--r--sys/pci/if_en_pci.c170
-rw-r--r--sys/pci/if_fpa.c4
-rw-r--r--sys/pci/if_fxp.c27
-rw-r--r--sys/pci/if_lnc_p.c6
-rw-r--r--sys/pci/if_mx.c2436
-rw-r--r--sys/pci/if_mxreg.h697
-rw-r--r--sys/pci/if_pn.c1986
-rw-r--r--sys/pci/if_pnreg.h652
-rw-r--r--sys/pci/if_rl.c1992
-rw-r--r--sys/pci/if_rlreg.h554
-rw-r--r--sys/pci/if_sr_p.c6
-rw-r--r--sys/pci/if_tl.c126
-rw-r--r--sys/pci/if_tlreg.h8
-rw-r--r--sys/pci/if_tx.c1373
-rw-r--r--sys/pci/if_txvar.h406
-rw-r--r--sys/pci/if_vr.c1957
-rw-r--r--sys/pci/if_vrreg.h616
-rw-r--r--sys/pci/if_vx_pci.c8
-rw-r--r--sys/pci/if_wb.c2151
-rw-r--r--sys/pci/if_wbreg.h583
-rw-r--r--sys/pci/if_xl.c53
-rw-r--r--sys/pci/if_xlreg.h3
-rw-r--r--sys/pci/isp_pci.c93
-rw-r--r--sys/pci/meteor.c6
-rw-r--r--sys/pci/ncr.c19
-rw-r--r--sys/pci/pci.c55
-rw-r--r--sys/pci/pci_compat.c57
-rw-r--r--sys/pci/pcic_p.c6
-rw-r--r--sys/pci/pcisupport.c154
-rw-r--r--sys/pci/pcivar.h11
-rw-r--r--sys/pci/simos.c6
-rw-r--r--sys/pci/smc83c170.h389
-rw-r--r--sys/pci/tek390.c1709
-rw-r--r--sys/pci/tek390.h667
-rw-r--r--sys/pci/wdc_p.c6
-rw-r--r--sys/pci/xrpu.c216
-rw-r--r--sys/sys/aio.h37
-rw-r--r--sys/sys/alogio.h62
-rw-r--r--sys/sys/buf.h30
-rw-r--r--sys/sys/bus.h220
-rw-r--r--sys/sys/bus_private.h6
-rw-r--r--sys/sys/cdefs.h13
-rw-r--r--sys/sys/conf.h38
-rw-r--r--sys/sys/copyright.h4
-rw-r--r--sys/sys/devfsext.h4
-rw-r--r--sys/sys/devicestat.h4
-rw-r--r--sys/sys/dirent.h12
-rw-r--r--sys/sys/disklabel.h4
-rw-r--r--sys/sys/domain.h3
-rw-r--r--sys/sys/errno.h11
-rw-r--r--sys/sys/exec.h8
-rw-r--r--sys/sys/filedesc.h32
-rw-r--r--sys/sys/imgact.h3
-rw-r--r--sys/sys/imgact_elf.h18
-rw-r--r--sys/sys/inttypes.h24
-rw-r--r--sys/sys/kernel.h75
-rw-r--r--sys/sys/linker.h16
-rw-r--r--sys/sys/linker_set.h89
-rw-r--r--sys/sys/lock.h19
-rw-r--r--sys/sys/malloc.h14
-rw-r--r--sys/sys/mbuf.h5
-rw-r--r--sys/sys/mman.h5
-rw-r--r--sys/sys/module.h31
-rw-r--r--sys/sys/mount.h64
-rw-r--r--sys/sys/mtio.h55
-rw-r--r--sys/sys/param.h4
-rw-r--r--sys/sys/pipe.h4
-rw-r--r--sys/sys/proc.h55
-rw-r--r--sys/sys/protosw.h3
-rw-r--r--sys/sys/queue.h16
-rw-r--r--sys/sys/rman.h97
-rw-r--r--sys/sys/sem.h13
-rw-r--r--sys/sys/signalvar.h12
-rw-r--r--sys/sys/socket.h13
-rw-r--r--sys/sys/socketvar.h12
-rw-r--r--sys/sys/syscall-hide.h4
-rw-r--r--sys/sys/syscall.h6
-rw-r--r--sys/sys/syscall.mk6
-rw-r--r--sys/sys/sysctl.h14
-rw-r--r--sys/sys/sysent.h34
-rw-r--r--sys/sys/sysproto.h18
-rw-r--r--sys/sys/systm.h21
-rw-r--r--sys/sys/time.h21
-rw-r--r--sys/sys/tty.h3
-rw-r--r--sys/sys/ttycom.h4
-rw-r--r--sys/sys/types.h26
-rw-r--r--sys/sys/unistd.h4
-rw-r--r--sys/sys/user.h12
-rw-r--r--sys/sys/vnode.h24
-rw-r--r--sys/sys/xrpuio.h37
-rw-r--r--sys/ufs/ffs/README320
-rw-r--r--sys/ufs/ffs/README.softupdates4
-rw-r--r--sys/ufs/ffs/ffs_alloc.c25
-rw-r--r--sys/ufs/ffs/ffs_extern.h4
-rw-r--r--sys/ufs/ffs/ffs_inode.c29
-rw-r--r--sys/ufs/ffs/ffs_subr.c10
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c35
-rw-r--r--sys/ufs/ffs/ffs_vnops.c12
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c14
-rw-r--r--sys/ufs/mfs/mfsiom.h43
-rw-r--r--sys/ufs/ufs/ufs_bmap.c7
-rw-r--r--sys/ufs/ufs/ufs_disksubr.c4
-rw-r--r--sys/ufs/ufs/ufs_ihash.c5
-rw-r--r--sys/ufs/ufs/ufs_inode.c13
-rw-r--r--sys/ufs/ufs/ufs_lookup.c6
-rw-r--r--sys/ufs/ufs/ufs_quota.c3
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c119
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c3
-rw-r--r--sys/ufs/ufs/ufs_vnops.c59
-rw-r--r--sys/ufs/ufs/ufsmount.h6
-rw-r--r--sys/vm/device_pager.c36
-rw-r--r--sys/vm/swap_pager.c50
-rw-r--r--sys/vm/vm_extern.h6
-rw-r--r--sys/vm/vm_fault.c20
-rw-r--r--sys/vm/vm_glue.c20
-rw-r--r--sys/vm/vm_map.c217
-rw-r--r--sys/vm/vm_map.h9
-rw-r--r--sys/vm/vm_meter.c104
-rw-r--r--sys/vm/vm_mmap.c20
-rw-r--r--sys/vm/vm_object.c115
-rw-r--r--sys/vm/vm_page.c203
-rw-r--r--sys/vm/vm_page.h11
-rw-r--r--sys/vm/vm_pageout.c24
-rw-r--r--sys/vm/vm_pager.c7
-rw-r--r--sys/vm/vm_swap.c11
-rw-r--r--sys/vm/vm_zone.c21
-rw-r--r--sys/vm/vm_zone.h12
-rw-r--r--sys/vm/vnode_pager.c4
-rw-r--r--tools/tools/README20
-rw-r--r--tools/tools/diffburst/Makefile9
-rw-r--r--tools/tools/diffburst/diffburst.119
-rw-r--r--tools/tools/diffburst/main.c44
-rw-r--r--tools/tools/editing/freebsd.el40
-rw-r--r--tools/tools/kdrv/sample.drvinfo6
-rw-r--r--tools/tools/kernxref/kernxref.sh18
-rw-r--r--tools/tools/scsi-defects/README2
-rwxr-xr-xtools/tools/upgrade/getosreldate.sh8
-rw-r--r--usr.bin/Makefile17
-rw-r--r--usr.bin/apply/Makefile1
-rw-r--r--usr.bin/apply/apply.c2
-rw-r--r--usr.bin/ar/Makefile4
-rw-r--r--usr.bin/ar/append.c2
-rw-r--r--usr.bin/ar/ar.c8
-rw-r--r--usr.bin/ar/archive.c4
-rw-r--r--usr.bin/ar/contents.c2
-rw-r--r--usr.bin/ar/delete.c2
-rw-r--r--usr.bin/ar/extract.c2
-rw-r--r--usr.bin/ar/misc.c2
-rw-r--r--usr.bin/ar/move.c2
-rw-r--r--usr.bin/ar/print.c2
-rw-r--r--usr.bin/ar/replace.c2
-rw-r--r--usr.bin/at/Makefile3
-rw-r--r--usr.bin/at/at.c2
-rw-r--r--usr.bin/at/panic.c3
-rw-r--r--usr.bin/at/parsetime.c5
-rw-r--r--usr.bin/at/perm.c2
-rw-r--r--usr.bin/banner/Makefile1
-rw-r--r--usr.bin/banner/banner.c4
-rw-r--r--usr.bin/basename/Makefile1
-rw-r--r--usr.bin/basename/basename.c4
-rw-r--r--usr.bin/biff/Makefile1
-rw-r--r--usr.bin/biff/biff.c6
-rw-r--r--usr.bin/brandelf/Makefile1
-rw-r--r--usr.bin/calendar/calendars/calendar.birthday4
-rw-r--r--usr.bin/cap_mkdb/Makefile1
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c4
-rw-r--r--usr.bin/chat/Makefile3
-rw-r--r--usr.bin/chat/chat.c3
-rw-r--r--usr.bin/checknr/Makefile1
-rw-r--r--usr.bin/checknr/checknr.c4
-rw-r--r--usr.bin/chflags/Makefile1
-rw-r--r--usr.bin/chflags/chflags.c4
-rw-r--r--usr.bin/chpass/Makefile1
-rw-r--r--usr.bin/chpass/chpass.159
-rw-r--r--usr.bin/chpass/chpass.c12
-rw-r--r--usr.bin/chpass/edit.c4
-rw-r--r--usr.bin/chpass/field.c2
-rw-r--r--usr.bin/chpass/pw_copy.c4
-rw-r--r--usr.bin/chpass/pw_yp.c4
-rw-r--r--usr.bin/chpass/table.c2
-rw-r--r--usr.bin/chpass/util.c9
-rw-r--r--usr.bin/cksum/Makefile1
-rw-r--r--usr.bin/cksum/crc.c2
-rw-r--r--usr.bin/cksum/print.c2
-rw-r--r--usr.bin/cksum/sum1.c2
-rw-r--r--usr.bin/cksum/sum2.c2
-rw-r--r--usr.bin/cmp/Makefile1
-rw-r--r--usr.bin/cmp/cmp.c4
-rw-r--r--usr.bin/cmp/misc.c2
-rw-r--r--usr.bin/cmp/regular.c2
-rw-r--r--usr.bin/cmp/special.c2
-rw-r--r--usr.bin/col/Makefile1
-rw-r--r--usr.bin/col/col.c4
-rw-r--r--usr.bin/colcrt/Makefile1
-rw-r--r--usr.bin/colcrt/colcrt.c4
-rw-r--r--usr.bin/colldef/Makefile3
-rw-r--r--usr.bin/colldef/parse.y6
-rw-r--r--usr.bin/colrm/Makefile1
-rw-r--r--usr.bin/colrm/colrm.c6
-rw-r--r--usr.bin/column/Makefile1
-rw-r--r--usr.bin/column/column.c14
-rw-r--r--usr.bin/comm/Makefile1
-rw-r--r--usr.bin/comm/comm.c6
-rw-r--r--usr.bin/compile_et/compile_et.c30
-rw-r--r--usr.bin/compress/Makefile1
-rw-r--r--usr.bin/compress/compress.c12
-rw-r--r--usr.bin/compress/zopen.c5
-rw-r--r--usr.bin/ctags/Makefile1
-rw-r--r--usr.bin/ctags/ctags.c4
-rw-r--r--usr.bin/ctags/fortran.c2
-rw-r--r--usr.bin/ctags/lisp.c2
-rw-r--r--usr.bin/ctags/print.c2
-rw-r--r--usr.bin/ctags/tree.c2
-rw-r--r--usr.bin/ctags/yacc.c2
-rw-r--r--usr.bin/cut/Makefile1
-rw-r--r--usr.bin/cut/cut.c10
-rw-r--r--usr.bin/dirname/Makefile1
-rw-r--r--usr.bin/dirname/dirname.c4
-rw-r--r--usr.bin/doscmd/port.c23
-rw-r--r--usr.bin/du/Makefile1
-rw-r--r--usr.bin/du/du.c9
-rw-r--r--usr.bin/ee/Makefile1
-rw-r--r--usr.bin/ee/ee.c10
-rw-r--r--usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg4
-rw-r--r--usr.bin/enigma/Makefile8
-rw-r--r--usr.bin/enigma/enigma.1115
-rw-r--r--usr.bin/enigma/enigma.c183
-rw-r--r--usr.bin/env/Makefile1
-rw-r--r--usr.bin/env/env.c4
-rw-r--r--usr.bin/error/Makefile1
-rw-r--r--usr.bin/error/pi.c4
-rw-r--r--usr.bin/error/touch.c4
-rw-r--r--usr.bin/expand/Makefile1
-rw-r--r--usr.bin/expand/expand.c4
-rw-r--r--usr.bin/f2c/f2c.h12
-rw-r--r--usr.bin/f2c/proc.c4
-rw-r--r--usr.bin/fetch/fetch.152
-rw-r--r--usr.bin/fetch/fetch.h3
-rw-r--r--usr.bin/fetch/ftp.c16
-rw-r--r--usr.bin/fetch/http.c70
-rw-r--r--usr.bin/fetch/main.c13
-rw-r--r--usr.bin/file/Magdir/applix12
-rw-r--r--usr.bin/file/Magdir/cisco10
-rw-r--r--usr.bin/file/Magdir/flash10
-rw-r--r--usr.bin/file/Magdir/gimp32
-rw-r--r--usr.bin/file/Magdir/gnu9
-rw-r--r--usr.bin/file/Magdir/lecter4
-rw-r--r--usr.bin/file/Magdir/macintosh79
-rw-r--r--usr.bin/file/Magdir/mime7
-rw-r--r--usr.bin/file/Magdir/modem33
-rw-r--r--usr.bin/file/Magdir/ms-dos149
-rw-r--r--usr.bin/file/Magdir/octave4
-rw-r--r--usr.bin/file/Magdir/olf97
-rw-r--r--usr.bin/file/Magdir/os223
-rw-r--r--usr.bin/file/Magdir/os985
-rw-r--r--usr.bin/file/Magdir/riff93
-rw-r--r--usr.bin/file/Magdir/teapot4
-rw-r--r--usr.bin/file/Magdir/ti-8x36
-rw-r--r--usr.bin/file/Magdir/vicar16
-rw-r--r--usr.bin/file/Magdir/wordperfect91
-rw-r--r--usr.bin/find/extern.h2
-rw-r--r--usr.bin/find/find.133
-rw-r--r--usr.bin/find/find.c19
-rw-r--r--usr.bin/find/function.c1
-rw-r--r--usr.bin/find/main.c8
-rw-r--r--usr.bin/find/operator.c2
-rw-r--r--usr.bin/ftp/ftp.c7
-rw-r--r--usr.bin/gcore/Makefile3
-rw-r--r--usr.bin/gcore/elfcore.c514
-rw-r--r--usr.bin/gcore/extern.h4
-rw-r--r--usr.bin/gcore/gcore.c142
-rw-r--r--usr.bin/gencat/gencat.1148
-rw-r--r--usr.bin/global/Makefile.inc20
-rw-r--r--usr.bin/global/btreeop/Makefile6
-rw-r--r--usr.bin/global/gctags/Makefile10
-rw-r--r--usr.bin/global/global/Makefile6
-rw-r--r--usr.bin/global/gtags/Makefile6
-rw-r--r--usr.bin/global/lib/Makefile10
-rw-r--r--usr.bin/hexdump/display.c11
-rw-r--r--usr.bin/indent/indent.c8
-rw-r--r--usr.bin/kdump/mkioctls62
-rw-r--r--usr.bin/locate/locate/locate.rc4
-rw-r--r--usr.bin/locate/locate/mklocatedb.sh49
-rw-r--r--usr.bin/locate/locate/updatedb.sh16
-rw-r--r--usr.bin/login/Makefile26
-rw-r--r--usr.bin/login/klogin.c204
-rw-r--r--usr.bin/login/login.19
-rw-r--r--usr.bin/login/login.access.53
-rw-r--r--usr.bin/login/login.c470
-rw-r--r--usr.bin/m4/m4.14
-rw-r--r--usr.bin/mail/strings.c4
-rw-r--r--usr.bin/make/job.c4
-rw-r--r--usr.bin/make/main.c25
-rw-r--r--usr.bin/make/make.149
-rw-r--r--usr.bin/make/make.h3
-rw-r--r--usr.bin/make/parse.c6
-rw-r--r--usr.bin/mklocale/data/Makefile7
-rw-r--r--usr.bin/mklocale/data/lt_LN.DIS_8859-15.src47
-rw-r--r--usr.bin/mt/mt.c90
-rw-r--r--usr.bin/netstat/main.c26
-rw-r--r--usr.bin/netstat/mbuf.c4
-rw-r--r--usr.bin/netstat/mroute.c85
-rw-r--r--usr.bin/netstat/netstat.h4
-rw-r--r--usr.bin/nfsstat/nfsstat.c2
-rw-r--r--usr.bin/objformat/Makefile10
-rw-r--r--usr.bin/objformat/objformat.194
-rw-r--r--usr.bin/objformat/objformat.c124
-rw-r--r--usr.bin/passwd/passwd.14
-rw-r--r--usr.bin/printf/printf.c18
-rw-r--r--usr.bin/rwall/rwall.c7
-rw-r--r--usr.bin/rwho/rwho.12
-rw-r--r--usr.bin/sasc/INSTALL2
-rw-r--r--usr.bin/sed/Makefile1
-rw-r--r--usr.bin/sed/compile.c16
-rw-r--r--usr.bin/sed/extern.h2
-rw-r--r--usr.bin/sed/main.c18
-rw-r--r--usr.bin/sed/process.c4
-rw-r--r--usr.bin/systat/devs.h28
-rw-r--r--usr.bin/systat/systat.121
-rw-r--r--usr.bin/systat/vmstat.c2
-rw-r--r--usr.bin/tcopy/pathnames.h2
-rw-r--r--usr.bin/telnet/commands.c3
-rw-r--r--usr.bin/telnet/externs.h1
-rw-r--r--usr.bin/telnet/main.c5
-rw-r--r--usr.bin/telnet/telnet.15
-rw-r--r--usr.bin/telnet/telnet.c1
-rw-r--r--usr.bin/tftp/extern.h2
-rw-r--r--usr.bin/tftp/main.c6
-rw-r--r--usr.bin/tftp/tftp.c4
-rw-r--r--usr.bin/top/machine.c63
-rw-r--r--usr.bin/touch/touch.12
-rw-r--r--usr.bin/touch/touch.c5
-rw-r--r--usr.bin/truss/main.c3
-rw-r--r--usr.bin/vi/Makefile11
-rw-r--r--usr.bin/vmstat/vmstat.c2
-rw-r--r--usr.bin/w/pr_time.c9
-rw-r--r--usr.bin/w/w.c45
-rw-r--r--usr.bin/wall/wall.c14
-rw-r--r--usr.bin/xinstall/xinstall.c3
-rw-r--r--usr.bin/yacc/test/ftp.y4
-rw-r--r--usr.sbin/Makefile70
-rw-r--r--usr.sbin/adduser/adduser.perl3
-rw-r--r--usr.sbin/amd/amd/Makefile6
-rw-r--r--usr.sbin/amd/fixmount/Makefile6
-rw-r--r--usr.sbin/amd/hlfsd/Makefile6
-rw-r--r--usr.sbin/amd/include/config.h4
-rw-r--r--usr.sbin/atm/atmarpd/atmarpd.86
-rw-r--r--usr.sbin/config/configvers.h4
-rw-r--r--usr.sbin/config/lang.l6
-rw-r--r--usr.sbin/config/main.c4
-rw-r--r--usr.sbin/config/mkioconf.c78
-rw-r--r--usr.sbin/cron/cron/cron.c44
-rw-r--r--usr.sbin/cron/lib/misc.c9
-rw-r--r--usr.sbin/ctm/mkCTM/mkCTM2
-rw-r--r--usr.sbin/edquota/edquota.c10
-rw-r--r--usr.sbin/i4b/Makefile4
-rw-r--r--usr.sbin/i4b/Makefile.inc14
-rw-r--r--usr.sbin/i4b/alawulaw/Makefile7
-rw-r--r--usr.sbin/i4b/alawulaw/alaw2ulaw.170
-rw-r--r--usr.sbin/i4b/alawulaw/alaw2ulaw.c151
-rw-r--r--usr.sbin/i4b/alawulaw/ulaw2alaw.170
-rw-r--r--usr.sbin/i4b/isdnd/Makefile34
-rw-r--r--usr.sbin/i4b/isdnd/alias.c191
-rw-r--r--usr.sbin/i4b/isdnd/config.h61
-rw-r--r--usr.sbin/i4b/isdnd/controller.c329
-rw-r--r--usr.sbin/i4b/isdnd/curses.c633
-rw-r--r--usr.sbin/i4b/isdnd/dial.c153
-rw-r--r--usr.sbin/i4b/isdnd/exec.c280
-rw-r--r--usr.sbin/i4b/isdnd/fsm.c446
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.8419
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.acct.5108
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.h754
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.rates.5115
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.rc.5642
-rw-r--r--usr.sbin/i4b/isdnd/log.c242
-rw-r--r--usr.sbin/i4b/isdnd/main.c707
-rw-r--r--usr.sbin/i4b/isdnd/monitor.c811
-rw-r--r--usr.sbin/i4b/isdnd/msghdl.c983
-rw-r--r--usr.sbin/i4b/isdnd/pathnames.h54
-rw-r--r--usr.sbin/i4b/isdnd/pcause.c227
-rw-r--r--usr.sbin/i4b/isdnd/process.c219
-rw-r--r--usr.sbin/i4b/isdnd/rates.c473
-rw-r--r--usr.sbin/i4b/isdnd/rc_config.c1140
-rw-r--r--usr.sbin/i4b/isdnd/rc_parse.y388
-rw-r--r--usr.sbin/i4b/isdnd/rc_scan.l170
-rw-r--r--usr.sbin/i4b/isdnd/support.c831
-rw-r--r--usr.sbin/i4b/isdnd/timer.c411
-rw-r--r--usr.sbin/i4b/isdnd/vararray.h120
-rw-r--r--usr.sbin/i4b/isdndebug/Makefile5
-rw-r--r--usr.sbin/i4b/isdndebug/isdndebug.8102
-rw-r--r--usr.sbin/i4b/isdndebug/main.c553
-rw-r--r--usr.sbin/i4b/isdndecode/Makefile7
-rw-r--r--usr.sbin/i4b/isdndecode/decode.h74
-rw-r--r--usr.sbin/i4b/isdndecode/facility.c906
-rw-r--r--usr.sbin/i4b/isdndecode/facility.h154
-rw-r--r--usr.sbin/i4b/isdndecode/isdndecode.8190
-rw-r--r--usr.sbin/i4b/isdndecode/layer1.c80
-rw-r--r--usr.sbin/i4b/isdndecode/layer2.c298
-rw-r--r--usr.sbin/i4b/isdndecode/layer3.c508
-rw-r--r--usr.sbin/i4b/isdndecode/layer3_subr.c1045
-rw-r--r--usr.sbin/i4b/isdndecode/main.c774
-rw-r--r--usr.sbin/i4b/isdndecode/pcause.c328
-rw-r--r--usr.sbin/i4b/isdndecode/pcause.h109
-rw-r--r--usr.sbin/i4b/isdnmonitor/Makefile8
-rw-r--r--usr.sbin/i4b/isdnmonitor/isdnmonitor.840
-rw-r--r--usr.sbin/i4b/isdnmonitor/main.c675
-rw-r--r--usr.sbin/i4b/isdnmonitor/monitor.h263
-rw-r--r--usr.sbin/i4b/isdntel/Makefile9
-rw-r--r--usr.sbin/i4b/isdntel/alias.c139
-rw-r--r--usr.sbin/i4b/isdntel/alias.h49
-rw-r--r--usr.sbin/i4b/isdntel/defs.h156
-rw-r--r--usr.sbin/i4b/isdntel/display.c252
-rw-r--r--usr.sbin/i4b/isdntel/files.c306
-rw-r--r--usr.sbin/i4b/isdntel/isdntel.894
-rw-r--r--usr.sbin/i4b/isdntel/main.c395
-rw-r--r--usr.sbin/i4b/isdntelctl/Makefile5
-rw-r--r--usr.sbin/i4b/isdntelctl/isdntelctl.878
-rw-r--r--usr.sbin/i4b/isdntelctl/main.c203
-rw-r--r--usr.sbin/i4b/isdntest/Makefile8
-rw-r--r--usr.sbin/i4b/isdntest/isdntest.8103
-rw-r--r--usr.sbin/i4b/isdntest/main.c738
-rw-r--r--usr.sbin/i4b/isdntrace/1tr6.c754
-rw-r--r--usr.sbin/i4b/isdntrace/Makefile8
-rw-r--r--usr.sbin/i4b/isdntrace/cable.txt60
-rw-r--r--usr.sbin/i4b/isdntrace/isdntrace.8205
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_1tr6.c164
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_1tr6.h68
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_q850.c328
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_q850.h109
-rw-r--r--usr.sbin/i4b/isdntrace/q921.c275
-rw-r--r--usr.sbin/i4b/isdntrace/q931.c783
-rw-r--r--usr.sbin/i4b/isdntrace/q931_util.c697
-rw-r--r--usr.sbin/i4b/isdntrace/q932_fac.c926
-rw-r--r--usr.sbin/i4b/isdntrace/q932_fac.h174
-rw-r--r--usr.sbin/i4b/isdntrace/trace.c809
-rw-r--r--usr.sbin/i4b/isdntrace/trace.h90
-rw-r--r--usr.sbin/i4b/man/Makefile5
-rw-r--r--usr.sbin/i4b/man/daic.498
-rw-r--r--usr.sbin/i4b/man/i4b.4108
-rw-r--r--usr.sbin/i4b/man/i4bctl.450
-rw-r--r--usr.sbin/i4b/man/i4bipr.498
-rw-r--r--usr.sbin/i4b/man/i4bisppp.4107
-rw-r--r--usr.sbin/i4b/man/i4bq921.449
-rw-r--r--usr.sbin/i4b/man/i4bq931.449
-rw-r--r--usr.sbin/i4b/man/i4brbch.450
-rw-r--r--usr.sbin/i4b/man/i4btel.452
-rw-r--r--usr.sbin/i4b/man/i4btrc.452
-rw-r--r--usr.sbin/i4b/man/isic.4380
-rw-r--r--usr.sbin/inetd/inetd.c130
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.14
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c125
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c71
-rw-r--r--usr.sbin/lpr/lpr/lpr.c12
-rw-r--r--usr.sbin/lptcontrol/lptcontrol.c10
-rw-r--r--usr.sbin/moused/moused.814
-rw-r--r--usr.sbin/moused/moused.c174
-rw-r--r--usr.sbin/mrouted/RELEASE193
-rw-r--r--usr.sbin/mrouted/VERSION1
-rw-r--r--usr.sbin/mrouted/callout.c154
-rw-r--r--usr.sbin/mrouted/cfparse.y441
-rw-r--r--usr.sbin/mrouted/config.c66
-rw-r--r--usr.sbin/mrouted/defs.h293
-rw-r--r--usr.sbin/mrouted/dvmrp.h20
-rw-r--r--usr.sbin/mrouted/icmp.c225
-rw-r--r--usr.sbin/mrouted/igmp.c266
-rw-r--r--usr.sbin/mrouted/igmpv2.h42
-rw-r--r--usr.sbin/mrouted/inet.c5
-rw-r--r--usr.sbin/mrouted/ipip.c145
-rw-r--r--usr.sbin/mrouted/kern.c117
-rw-r--r--usr.sbin/mrouted/main.c691
-rw-r--r--usr.sbin/mrouted/mapper.c6
-rw-r--r--usr.sbin/mrouted/mrinfo.c21
-rw-r--r--usr.sbin/mrouted/mrouted.8359
-rw-r--r--usr.sbin/mrouted/mrouted.conf3
-rw-r--r--usr.sbin/mrouted/mrouted/Makefile10
-rw-r--r--usr.sbin/mrouted/mtrace.84
-rw-r--r--usr.sbin/mrouted/mtrace.c967
-rw-r--r--usr.sbin/mrouted/mtrace.h34
-rw-r--r--usr.sbin/mrouted/pathnames.h3
-rw-r--r--usr.sbin/mrouted/prune.c1274
-rw-r--r--usr.sbin/mrouted/prune.h15
-rw-r--r--usr.sbin/mrouted/route.c891
-rw-r--r--usr.sbin/mrouted/route.h12
-rw-r--r--usr.sbin/mrouted/rsrr.c90
-rw-r--r--usr.sbin/mrouted/vif.c898
-rw-r--r--usr.sbin/mrouted/vif.h200
-rw-r--r--usr.sbin/mtree/create.c15
-rw-r--r--usr.sbin/mtree/spec.c10
-rw-r--r--usr.sbin/newsyslog/newsyslog.c4
-rw-r--r--usr.sbin/pccard/Makefile4
-rw-r--r--usr.sbin/pccard/pccardd/cardd.c7
-rw-r--r--usr.sbin/pciconf/pciconf.818
-rw-r--r--usr.sbin/pciconf/pciconf.c10
-rw-r--r--usr.sbin/pcvt/Makefile.inc2
-rw-r--r--usr.sbin/pcvt/Misc/Etc/Makefile2
-rw-r--r--usr.sbin/pcvt/fonts/Makefile2
-rw-r--r--usr.sbin/pcvt/kbdio/kbdio.y7
-rw-r--r--usr.sbin/pcvt/kbdio/lex.l7
-rw-r--r--usr.sbin/pcvt/keycap/man5/keycap.52
-rw-r--r--usr.sbin/pcvt/set2061/compiler.h2
-rw-r--r--usr.sbin/pcvt/vgaio/Makefile2
-rw-r--r--usr.sbin/pcvt/vgaio/lex.l6
-rw-r--r--usr.sbin/pcvt/vgaio/vgaio.82
-rw-r--r--usr.sbin/pcvt/vgaio/vgaio.h3
-rw-r--r--usr.sbin/pcvt/vgaio/vgaio.y6
-rw-r--r--usr.sbin/periodic/periodic.84
-rw-r--r--usr.sbin/periodic/periodic.sh6
-rw-r--r--usr.sbin/pkg_install/add/extract.c4
-rw-r--r--usr.sbin/pkg_install/add/main.c52
-rw-r--r--usr.sbin/pkg_install/add/perform.c48
-rw-r--r--usr.sbin/pkg_install/add/pkg_add.183
-rw-r--r--usr.sbin/pkg_install/create/create.h4
-rw-r--r--usr.sbin/pkg_install/create/main.c23
-rw-r--r--usr.sbin/pkg_install/create/perform.c40
-rw-r--r--usr.sbin/pkg_install/create/pkg_create.153
-rw-r--r--usr.sbin/pkg_install/delete/perform.c76
-rw-r--r--usr.sbin/pkg_install/delete/pkg_delete.186
-rw-r--r--usr.sbin/pkg_install/info/perform.c6
-rw-r--r--usr.sbin/pkg_install/info/pkg_info.14
-rw-r--r--usr.sbin/pkg_install/lib/file.c6
-rw-r--r--usr.sbin/pkg_install/lib/lib.h4
-rw-r--r--usr.sbin/ppp/Makefile5
-rw-r--r--usr.sbin/ppp/README.changes3
-rw-r--r--usr.sbin/ppp/arp.c52
-rw-r--r--usr.sbin/ppp/auth.c4
-rw-r--r--usr.sbin/ppp/bundle.c200
-rw-r--r--usr.sbin/ppp/bundle.h30
-rw-r--r--usr.sbin/ppp/cbcp.c55
-rw-r--r--usr.sbin/ppp/chat.c3
-rw-r--r--usr.sbin/ppp/command.c511
-rw-r--r--usr.sbin/ppp/datalink.c30
-rw-r--r--usr.sbin/ppp/filter.c14
-rw-r--r--usr.sbin/ppp/filter.h4
-rw-r--r--usr.sbin/ppp/iface.c481
-rw-r--r--usr.sbin/ppp/iface.h60
-rw-r--r--usr.sbin/ppp/ip.c14
-rw-r--r--usr.sbin/ppp/ipcp.c311
-rw-r--r--usr.sbin/ppp/ipcp.h8
-rw-r--r--usr.sbin/ppp/lcp.c29
-rw-r--r--usr.sbin/ppp/main.c122
-rw-r--r--usr.sbin/ppp/modem.c25
-rw-r--r--usr.sbin/ppp/mp.c19
-rw-r--r--usr.sbin/ppp/physical.c9
-rw-r--r--usr.sbin/ppp/physical.h9
-rw-r--r--usr.sbin/ppp/ppp.8441
-rw-r--r--usr.sbin/ppp/route.c7
-rw-r--r--usr.sbin/ppp/systems.c44
-rw-r--r--usr.sbin/ppp/systems.h4
-rw-r--r--usr.sbin/ppp/timer.c87
-rw-r--r--usr.sbin/ppp/timer.h4
-rw-r--r--usr.sbin/ppp/tun.c5
-rw-r--r--usr.sbin/pw/README4
-rw-r--r--usr.sbin/pw/pw.c14
-rw-r--r--usr.sbin/pw/pw_user.c4
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.87
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c50
-rw-r--r--usr.sbin/quot/quot.c7
-rw-r--r--usr.sbin/rarpd/rarpd.c4
-rw-r--r--usr.sbin/rwhod/rwhod.827
-rw-r--r--usr.sbin/rwhod/rwhod.c18
-rw-r--r--usr.sbin/sendmail/Makefile7
-rw-r--r--usr.sbin/slstat/slstat.84
-rw-r--r--usr.sbin/stallion/bootcode/stl.48
-rw-r--r--usr.sbin/sysctl/sysctl.89
-rw-r--r--usr.sbin/sysctl/sysctl.c60
-rw-r--r--usr.sbin/syslogd/syslog.conf.516
-rw-r--r--usr.sbin/syslogd/syslogd.c35
-rw-r--r--usr.sbin/tcpdump/tcpslice/tcpslice.c12
-rw-r--r--usr.sbin/traceroute/Makefile8
-rw-r--r--usr.sbin/tzsetup/paths.h1
-rw-r--r--usr.sbin/tzsetup/tzsetup.c15
-rw-r--r--usr.sbin/usbd/Makefile7
-rw-r--r--usr.sbin/usbd/usbd.881
-rw-r--r--usr.sbin/usbd/usbd.c184
-rw-r--r--usr.sbin/usbdevs/Makefile8
-rw-r--r--usr.sbin/usbdevs/usbdevs.868
-rw-r--r--usr.sbin/usbdevs/usbdevs.c213
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c22
-rw-r--r--usr.sbin/vipw/pw_util.c35
-rw-r--r--usr.sbin/wlconfig/wlconfig.82
-rw-r--r--usr.sbin/xntpd/include/ntp_machine.h1
-rw-r--r--usr.sbin/xntpd/parse/util/dcfd.c10
-rw-r--r--usr.sbin/xntpd/parse/util/testdcf.c3
-rw-r--r--usr.sbin/xntpd/xntpd/ntp_unixclock.c28
-rw-r--r--usr.sbin/xntpd/xntpd/refclock_acts.c4
-rw-r--r--usr.sbin/xntpd/xntpd/refclock_heath.c2
-rw-r--r--usr.sbin/xten/README6
3335 files changed, 158059 insertions, 340866 deletions
diff --git a/Makefile b/Makefile
index a97a0775b7a3..02f74117ad4e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.221 1998/10/17 15:25:26 bde Exp $
+# $Id: Makefile,v 1.219 1998/09/28 20:39:23 jb Exp $
#
# The user-driven targets are:
#
@@ -52,8 +52,8 @@
# this overrides /etc/objformat.
#
# Unless -DNOAOUT is specified, a `make world' with OBJFORMAT=elf will
-# update the legacy support for aout. This includes all libraries, ld.so
-# and boot objects. This part of build should be regarded as
+# update the legacy support for aout. This includes all libraries, ld.so,
+# lkms and boot objects. This part of build should be regarded as
# deprecated and you should _not_ expect to be able to do this past the
# release of 3.1. You have exactly one major release to move entirely
# to elf.
@@ -92,10 +92,9 @@
# Define the user-driven targets. These are listed here in alphabetical
# order, but that's not important.
#
-TGTS = afterdistribute all buildworld checkdpadd clean cleandepend cleandir \
- depend distribute everything hierarchy includes install installmost \
- installworld lint maninstall mk most obj objlink regress rerelease \
- tags update world
+TGTS = afterdistribute all buildworld clean cleandepend cleandir cleanobj \
+ depend distribute everything hierarchy includes installmost install \
+ installworld mk most obj rerelease update world
#
# Handle the user-driven targets, using the source relative mk files.
diff --git a/Makefile.inc0 b/Makefile.inc0
index 7b82b881f063..db27ef2a9295 100644
--- a/Makefile.inc0
+++ b/Makefile.inc0
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.inc0,v 1.13 1998/12/20 14:30:08 jhay Exp $
+# $Id: Makefile.inc0,v 1.9 1998/09/28 20:41:31 jb Exp $
#
# This makefile ensures that the object directory is set according to the
# object format to avoid mixing aout and elf formatted files during the
@@ -18,9 +18,7 @@ MAKEOBJDIRPREFIX?=/usr/obj
# Variables passed to make work better if they are set as environment
# variables instead of command line options.
#
-.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
MK_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}
-.endif
#
# We should always use the current set of mk files, not the installed ones.
@@ -31,29 +29,20 @@ MAKE= make -m ${.CURDIR}/share/mk -f Makefile.inc1
#
# These are the backend targets.
#
-BKTGTS= all checkdpadd clean cleandepend cleandir \
- depend everything hierarchy includes install installmost \
- lint maninstall mk most obj objlink regress rerelease \
- tags update
+BKTGTS= afterdistribute all clean cleandepend cleandir cleanobj depend \
+ distribute everything hierarchy includes installmost install mk \
+ most obj rerelease update
#
# A generic rule for the backend targets.
#
${BKTGTS} :
- @cd ${.CURDIR}; ${MAKE} ${.TARGET}
-
-# These targets are used during a make release, which is done after a
-# make world, so they should use the same OBJDIRPREFIX that was used
-# during the make world.
-RELTGTS= afterdistribute distribute
-
-${RELTGTS} :
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
#
# Temporary path and environment for the legacy build.
#
-ELFTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
+ELFTMP= ${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp
ELFTMPPATH= ${ELFTMP}/sbin:${ELFTMP}/bin:${ELFTMP}/usr/sbin:${ELFTMP}/usr/bin:${ELFTMP}/usr/games
LEGACY_ENV= PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 TOOLROOT=${ELFTMP} \
MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout
diff --git a/Makefile.inc1 b/Makefile.inc1
index 197acfa8fe55..4132a443ec97 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.inc1,v 1.58 1999/01/07 13:09:15 eivind Exp $
+# $Id: Makefile.inc1,v 1.33 1998/10/13 08:13:32 jkh Exp $
#
# Make command line options:
# -DCLOBBER will remove /usr/include
@@ -8,6 +8,7 @@
# -DNOCLEAN do not clean at all
# -DNOTOOLS do not rebuild any tools first
# -DNOCRYPT will prevent building of crypt versions
+# -DNOLKM do not build loadable kernel modules
# -DNOPROFILE do not build profiled libraries
# -DNOSECURE do not go into secure subdir
# -DNOGAMES do not go into games subdir
@@ -81,6 +82,9 @@ SUBDIR+= usr.sbin
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
SUBDIR+= secure
.endif
+.if exists(lkm) && !defined(NOLKM) && ${OBJFORMAT} == "aout"
+SUBDIR+= lkm
+.endif
# etc must be last for "distribute" to work
.if exists(etc)
@@ -166,12 +170,12 @@ WORLDTMP= /usr/obj${.CURDIR}/tmp
# Default root of the tool tree
TOOLROOT?=
# Choose the PATH relative to the root of the tool tree
-PATH= ${TOOLROOT}/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/sbin:${TOOLROOT}/usr/bin
+PATH= ${TOOLROOT}/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/sbin:${TOOLROOT}/usr/bin:${TOOLROOT}/usr/games
.else
TOOLROOT= ${WORLDTMP}
.endif
-STRICTTMPPATH= ${TOOLROOT}/sbin:${TOOLROOT}/usr/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/bin
-TMPPATH= ${STRICTTMPPATH}:${PATH}
+STRICTTMPPATH= ${TOOLROOT}/sbin:${TOOLROOT}/usr/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/bin:${TOOLROOT}/usr/games
+TMPPATH= ${STRICTTMPPATH}:${PATH}:/usr/games
# XXX COMPILER_PATH is needed for finding cc1, ld and as
# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecessary now
@@ -189,7 +193,6 @@ COMPILER_ENV= BISON_SIMPLE=${TOOLROOT}/usr/share/misc/bison.simple \
BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t \
OBJFORMAT_PATH=${TOOLROOT}/usr/libexec:/usr/libexec
XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
- PERL5LIB=${DESTDIR}/usr/libdata/perl/5.00502 \
OBJFORMAT_PATH=${TOOLROOT}/usr/libexec \
CFLAGS="-nostdinc ${CFLAGS}" # XXX -nostdlib
@@ -358,7 +361,7 @@ reinstall:
@echo ">>> Installing everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
-.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout" && !defined(DESTDIR)
+.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
@echo
@echo "--------------------------------------------------------------"
@echo ">>> Re-scanning the shared libraries.."
@@ -469,6 +472,22 @@ hierarchy:
# for the dependency information to be gathered from.
#
bootstrap:
+.if defined(DESTDIR)
+ rm -f ${DESTDIR}/usr/src/sys
+ ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
+ cd ${.CURDIR}/include; find -dx . | cpio -dump ${DESTDIR}/usr/include
+.for d in net netatm netinet posix4 sys vm machine
+ if [ -h ${DESTDIR}/usr/include/$d ]; then \
+ rm -f ${DESTDIR}/usr/include/$d ; \
+ fi
+.endfor
+ cd ${.CURDIR}/sys; \
+ find -dx net netatm netinet posix4 sys vm -name '*.h' -o -type d | \
+ cpio -dump ${DESTDIR}/usr/include
+ mkdir -p ${DESTDIR}/usr/include/machine
+ cd ${.CURDIR}/sys/${MACHINE_ARCH}/include; find -dx . -name '*.h' -o -type d | \
+ cpio -dump ${DESTDIR}/usr/include/machine
+.endif
cd ${.CURDIR}/usr.bin/make; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
${MAKE} ${MK_FLAGS} all; \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
@@ -486,6 +505,9 @@ bootstrap:
cd ${.CURDIR}/usr.sbin/mtree; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
${MAKE} ${MK_FLAGS} all; \
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
+.if defined(DESTDIR)
+ cd ${.CURDIR}/include && ${MAKE} copies
+.endif
#
# include-tools - generally the same as 'bootstrap', except that it's for
@@ -555,13 +577,10 @@ includes:
cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
.endif
cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
- cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
- cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
- cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libtermcap; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
@@ -609,6 +628,7 @@ lib-tools:
${_aout_strip} \
gnu/usr.bin/binutils \
usr.bin/uudecode \
+ share/info \
usr.bin/objformat
cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
${MAKE} ${MK_FLAGS} all; \
@@ -622,19 +642,12 @@ lib-tools:
# To satisfy shared library linkage when only the libraries being built
# are visible:
#
-# csu must be built before all shared libaries for ELF.
# libcom_err must be built before libss.
-# libcrypt must be built before libskey and libkrb.
-# libdes must be built before libpam.
-# libkrb must be built before libpam.
-# libm must be built before libf2c, libg++ and libstdc++.
-# libmd must be built before libatm, libopie, libradius, libskey,
-# and libtacplus.
+# libcrypt and libmd must be built before libskey.
+# libm must be built before libf2c, libg++ and libstdc++
+# libmd must be built before libatm and libopie
# libmytinfo must be built before libdialog and libncurses.
# libncurses must be built before libdialog.
-# libradius must be built before libpam.
-# libskey must be built before libpam.
-# libtacplus must be built before libpam.
# libtermcap must be built before libcurses, libedit and libreadline.
#
# Some libraries are built conditionally and/or are in inconsistently
@@ -650,15 +663,10 @@ _csu=lib/csu/${MACHINE_ARCH}
.if !defined(NOSECURE) && !defined(NOCRYPT)
_libcrypt= secure/lib/libcrypt lib/libcrypt
-_secure_lib= secure/lib
.else
_libcrypt= lib/libcrypt
.endif
-.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
-_kerberosIV_lib=kerberosIV/lib
-.endif
-
.if defined(WANT_CSRG_LIBM)
_libm= lib/libm
.else
@@ -706,16 +714,21 @@ bootstrap-libraries:
# alphabetical order.
#
libraries:
-.for _lib in ${_csu} lib/libcom_err ${_libcrypt} ${_libm} lib/libmd \
- lib/libmytinfo lib/libncurses lib/libtermcap \
- lib/libradius lib/libskey lib/libtacplus \
- ${_secure_lib} ${_kerberosIV_lib} \
+.for _lib in lib/libcom_err ${_libcrypt} ${_libm} lib/libmytinfo \
+ lib/libncurses lib/libtermcap \
gnu/lib gnu/usr.bin/cc/libgcc ${_libperl} lib usr.bin/lex/lib \
usr.sbin/pcvt/keycap
.if exists(${.CURDIR}/${_lib})
cd ${.CURDIR}/${_lib}; ${MAKE} all; ${MAKE} -B install
.endif
.endfor
+.if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE)
+ cd ${.CURDIR}/secure/lib; ${MAKE} all; ${MAKE} -B install
+.endif
+.if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \
+ defined(MAKE_KERBEROS4)
+ cd ${.CURDIR}/kerberosIV/lib; ${MAKE} all; ${MAKE} -B install
+.endif
#
# Exclude unused tools from build-tools.
@@ -733,8 +746,8 @@ _perl= gnu/usr.bin/perl/miniperl
.if !defined(NOSHARE) && exists(${.CURDIR}/share)
_scrnmaps= share/syscons/scrnmaps
.endif
-.if ${MACHINE_ARCH} == i386
-_kldlinux= sys/modules/linux
+.if !defined(NOLKM) && exists(${.CURDIR}/lkm) && ${OBJFORMAT} == "aout"
+_linux= lkm/linux
.endif
.if ${OBJFORMAT} == "aout"
_netboot= sys/${MACHINE}/boot/netboot
@@ -791,7 +804,6 @@ build-tools:
usr.bin/file2c \
usr.bin/find \
usr.bin/gencat \
- usr.bin/gensetdefs \
usr.bin/id \
usr.bin/join \
usr.bin/lorder \
@@ -834,7 +846,6 @@ build-tools:
gnu/usr.bin/cc/cc_tools \
lib/libmytinfo \
${_linux} \
- ${_kldlinux} \
${_scrnmaps} \
${_netboot}
cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} build-tools
@@ -878,6 +889,14 @@ legacy-build:
cd ${.CURDIR}/libexec/rtld-aout; \
${XMAKE} -DNOMAN depend; ${XMAKE} -DNOMAN all;
@echo
+.if exists(${.CURDIR}/lkm) && !defined(NOLKM)
+ @echo "--------------------------------------------------------------"
+ @echo ">>> Building legacy lkms"
+ @echo "--------------------------------------------------------------"
+ cd ${.CURDIR}/lkm; \
+ ${XMAKE} -DNOMAN depend; ${XMAKE} -DNOMAN all;
+ @echo
+.endif
@echo "--------------------------------------------------------------"
@echo ">>> Building legacy boot"
@echo "--------------------------------------------------------------"
@@ -916,6 +935,13 @@ legacy-install:
@echo "--------------------------------------------------------------"
cd ${.CURDIR}/libexec/rtld-aout; ${MAKE} -DNOMAN install
@echo
+.if exists(${.CURDIR}/lkm) && !defined(NOLKM)
+ @echo "--------------------------------------------------------------"
+ @echo ">>> Installing legacy lkms"
+ @echo "--------------------------------------------------------------"
+ cd ${.CURDIR}/lkm; ${MAKE} -DNOMAN install
+ @echo
+.endif
.if ${MACHINE_ARCH} != "alpha"
@echo "--------------------------------------------------------------"
@echo ">>> Installing legacy boot"
@@ -946,16 +972,6 @@ check-objformat :
@/bin/sh -c "echo \"in your environment.\" "
@exit 1
.endif
-.if !defined(REALLY_WANT_DEPRECIATED_AOUT) && ${OBJFORMAT} == "aout"
- @echo "==== NOTICE: a.out buildworld is depreciated and disabled! ====="
- @echo "Read: http://www.freebsd.org/~peter/elfday.html for information."
- @echo "You need to complete a 'make aout-to-elf' to bring your system"
- @echo "up to date with ELF tools. This requires a fair amount of disk"
- @echo "space to complete. Alternatively, you can do a binary upgrade"
- @echo "using the 3.0-RELEASE binaries from CD or ftp.freebsd.org in"
- @echo "/pub/FreeBSD/3.0-RELEASE/bin/ to convert your userland to ELF."
- @exit 1
-.endif
.for __target in clean cleandepend cleandir depend obj
diff --git a/Makefile.upgrade b/Makefile.upgrade
index c32b31868602..ba8018e63c54 100644
--- a/Makefile.upgrade
+++ b/Makefile.upgrade
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.upgrade,v 1.8 1999/01/07 06:30:14 peter Exp $
+# $Id: Makefile.upgrade,v 1.5 1998/09/09 06:02:31 jb Exp $
#
# This makefile contains rules for preforming upgrades that are outside
# the scope of the normal build world process.
@@ -15,8 +15,7 @@ MAKEOBJDIRPREFIX?=/usr/obj
# The installed operating system release gives us the hint as to whether
# we need to build a kernel too.
#
-INSTALLEDVERSION!=sh ${.CURDIR}/tools/tools/upgrade/getosreldate.sh
-INSTALLEDNAME!=uname -r
+INSTALLEDVERSION!=uname -r
#
# Upgrade the installed make to the current version using the installed
@@ -67,7 +66,7 @@ ${MAKEOBJDIRPREFIX}/do_aout_buildworld :
@echo " Doing an aout buildworld to get an up-to-date set of tools"
@echo "--------------------------------------------------------------"
@cd ${.CURDIR}; MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout \
- OBJFORMAT=aout REALLY_WANT_DEPRECIATED_AOUT=yes \
+ OBJFORMAT=aout \
make -f Makefile.inc1 -m ${.CURDIR}/share/mk buildworld
@touch ${MAKEOBJDIRPREFIX}/do_aout_buildworld
@@ -166,7 +165,7 @@ ${MAKEOBJDIRPREFIX}/do_aout_installworld :
@echo "--------------------------------------------------------------"
@/bin/sh -c "read -p \"Return to continue or Ctrl-C to abort: \" _e"
.endif
-.if ${INSTALLEDVERSION} < 300003
+.if ${INSTALLEDVERSION} != "3.0-BETA"
@echo
@echo "--------------------------------------------------------------"
@echo " Saving a copy of programs required to shut the system down"
@@ -192,10 +191,10 @@ ${MAKEOBJDIRPREFIX}/do_aout_installworld :
# directory as an obscure name just in case a reboot is required?
#
${MAKEOBJDIRPREFIX}/do_aout_kernel :
-.if ${INSTALLEDVERSION} >= 300003
+.if ${INSTALLEDVERSION} == "3.0-BETA"
@echo
@echo "--------------------------------------------------------------"
- @echo " You are already running 3.0, so a kernel build"
+ @echo " You are already running 3.0-BETA, so a kernel build"
@echo " is probably not required."
@echo "--------------------------------------------------------------"
.else
@@ -206,17 +205,11 @@ ${MAKEOBJDIRPREFIX}/do_aout_kernel :
.if exists(${.CURDIR}/sys/compile/GENERICupgrade)
@rm -rf ${.CURDIR}/sys/compile/GENERICupgrade
.endif
-.if !exists(${.CURDIR}/sys/${MACHINE}/conf/GENERICupgrade)
- -cp ${.CURDIR}/sys/${MACHINE}/conf/GENERIC \
- ${.CURDIR}/sys/${MACHINE}/conf/GENERICupgrade
-.endif
@cd ${.CURDIR}/sys/${MACHINE}/conf; config GENERICupgrade
@-cd ${.CURDIR}/sys/compile/GENERICupgrade; \
- OBJFORMAT=aout make KERNFORMAT=aout depend && \
- OBJFORMAT=aout make KERNFORMAT=aout all
+ OBJFORMAT=aout make depend && make all
@cd ${.CURDIR}/sys/compile/GENERICupgrade; \
- OBJFORMAT=aout make KERNFORMAT=aout depend && \
- OBJFORMAT=aout make KERNFORMAT=aout all
+ OBJFORMAT=aout make depend && make all
.endif
@touch ${MAKEOBJDIRPREFIX}/do_aout_kernel
@@ -265,7 +258,7 @@ ${MAKEOBJDIRPREFIX}/do_set_objformat :
# and reboot.
#
${MAKEOBJDIRPREFIX}/do_install_kernel_reboot :
-.if ${INSTALLEDVERSION} >= 300003
+.if ${INSTALLEDVERSION} == "3.0-BETA"
@echo
@echo "--------------------------------------------------------------"
@echo " Your system has been updated to run elf by default!"
@@ -279,7 +272,7 @@ ${MAKEOBJDIRPREFIX}/do_install_kernel_reboot :
@echo "--------------------------------------------------------------"
@echo " Your system has been updated to run elf by default!"
@echo
- @echo " Since you are running ${INSTALLEDNAME}, the kernel must"
+ @echo " Since you are running ${INSTALLEDVERSION}, the kernel must"
@echo " be installed before the system is rebooted. You can type"
@echo " Ctrl-C to abort the kernel installation (at your own risk),"
@echo " or press return for the kernel to be installed and the"
diff --git a/README b/README
index 963bd0a53de1..cc8a40fe4929 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
This is the top level of the FreeBSD source directory. This file
-was last revised on: $Id: README,v 1.13 1998/09/13 09:38:34 markm Exp $
+was last revised on: $Id: README,v 1.12 1998/06/30 08:08:05 jkh Exp $
For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
@@ -51,6 +51,8 @@ lib System libraries.
libexec System daemons.
+lkm Loadable Kernel Modules.
+
release Release building Makefile & associated tools.
sbin System commands.
diff --git a/UPDATING b/UPDATING
deleted file mode 100644
index 170de255f57d..000000000000
--- a/UPDATING
+++ /dev/null
@@ -1,88 +0,0 @@
-Updating Information for FreeBSD current users
-
-This file is maintainted by imp@village.org. Please send new entries
-in it to him. It contains a list, in reverse chronologocal order, of
-major breakages in tracking -current. Not all things will be listed
-here, and it only starts on Novemeber 18, 1998. If you have an
-earlier version of FreeBSD, you are on your own to get to November 18,
-1998.
-
-19990119:
- More work on the syscons driver has been committed. Since
- files moved around, you will need to reconfigure your kernel,
- and make clean; make depend before rebuilding the kernel. No
- config file changes are needed.
-
-19990111:
- New keyboard and video card drivers are introduced as the first
- stage of console driver reorganization. You are required to
- update the kernel configuration file and rebuild the kernel.
- kbdcontrol, vidcontrol, and screen savers also need recompilation.
- The instruction can be found in
-
- http://www.freebsd.org/~yokota/sc_update.txt
-
- It has notes on splash screen too.
-
-19990106:
- Robert Nordier was kind enough to make this page to enable people to
- install the new bootblocks:
-
- http://www.freebsd.org/~rnordier/boot.txt
-
- When updating to ELF, make sure that you have updated your
- /etc/rc files which have different ldconfig invocations for
- elf and aout. Otherwise things like X will stop working with
- messages about being unable to find library files. The
- mergemaster utility in ports/sysutils/mergemaster helps to
- keep critical files like this in sync, and its use is
- recommended.
-
-19990104:
- Information about ELF day (see 19981230) can be found in
-
- http://www.freebsd.org/~peter/elfday.html
-
- about the upcoming change, its motivations and instructions
- for doing the upgrade.
-
-19981230:
- You should install new bootblocks now. The ELF kernel will
- become default soon. In addition, you'll need to upgrade
- your userland programs to ELF before then as well. Use
- make aout-to-elf to upgrade your userland programs (old
- a.out programs in, for example, /usr/local/bin will
- continue to work, even after the upgrade). See src/Makefile
- for more details.
-
-19981224:
- The old wcd driver has been deleted from the kernel. The
- driver that replaces it is named acd. You'll need to change
- this in your configuration files.
-
- Failure to do this will result in "ATAPI CD-ROMs not
- configured" at boot time.
-
- The floppy tape driver (ft) has been removed from the kernel,
- with no replacement driver.
-
-19981202:
- New groups from 19981201 commented out of mtree, so they
- aren't strictly needed, but still a good idea to have.
-
-19981201:
- New user/group added: bind. From src/etc/master.passwd and
- src/etc/group:
- % grep <newstuff> /usr/src/etc/group
- bind:*:53:
- % grep <newstuff> /usr/src/etc/master.passwd
- tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
- kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin
- bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
-
-19981118:
- PAM integrated into the tree. Requires new /etc/pam.conf file
- to silence warnings from authentication programs (login, etc).
- See src/etc/pam.conf for a sample.
-
-$Id: UPDATING,v 1.13 1999/01/17 17:39:32 imp Exp $
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
index 0c085ca286aa..4fdaae4b576b 100644
--- a/bin/Makefile.inc
+++ b/bin/Makefile.inc
@@ -1,8 +1,7 @@
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
-# $Id: Makefile.inc,v 1.9 1997/02/22 14:01:23 peter Exp $
+# $Id$
BINDIR?= /bin
-CFLAGS+= -Wall -Wformat
NOSHARED?= YES
.if exists (${.CURDIR}/../../secure)
diff --git a/bin/chio/chio.1 b/bin/chio/chio.1
index 27fee8d0e3db..e1cbad9cc941 100644
--- a/bin/chio/chio.1
+++ b/bin/chio/chio.1
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: chio.1,v 1.7 1998/09/15 07:48:51 gibbs Exp $
+.\" $Id: chio.1,v 1.6 1998/06/04 21:05:19 steve Exp $
.\"
.Dd May 14, 1998
.Dt CHIO 1
@@ -185,7 +185,7 @@ If the
flag is specified, the volume tag of the specified element is
cleared. If the
.Fl f
-flag is specified, the volume tag is superseded with the specified
+flag is specified, the volume tag is superceded with the specified
volume tag even if a volume tag is already defined for the element.
It is an error to not specify the
.Fl f
diff --git a/bin/chio/chio.c b/bin/chio/chio.c
index bb5f749f194f..f00b73892c0c 100644
--- a/bin/chio/chio.c
+++ b/bin/chio/chio.c
@@ -389,7 +389,7 @@ do_params(char *cname, int argc, char **argv)
++argv; --argc;
if (argc) {
- warnx("%s: no arguments expected", cname);
+ warnx("%s: no arguements expected", cname);
goto usage;
}
@@ -520,7 +520,7 @@ do_status(char *cname, int argc, char **argv)
pvoltag = avoltag = source = sense = scsi = intaddr = 1;
break;
default:
- warnx("%s: bad option", cname);
+ warnx("bad option", cname);
goto usage;
}
}
@@ -741,7 +741,7 @@ do_voltag(char *cname, int argc, char **argv)
alternate = 1;
break;
default:
- warnx("%s: bad option", cname);
+ warnx("bad option", cname);
goto usage;
}
}
@@ -750,7 +750,7 @@ do_voltag(char *cname, int argc, char **argv)
argv += optind;
if (argc < 2) {
- warnx("%s: missing element specification", cname);
+ warnx("missing element specification", cname);
goto usage;
}
@@ -759,7 +759,7 @@ do_voltag(char *cname, int argc, char **argv)
if (!clear) {
if (argc < 3 || argc > 4) {
- warnx("%s: missing argument", cname);
+ warnx("missing argument", cname);
goto usage;
}
@@ -769,7 +769,7 @@ do_voltag(char *cname, int argc, char **argv)
csvr.csvr_flags = CSVR_MODE_SET;
if (strlen(argv[2]) > sizeof(csvr.csvr_voltag.cv_volid)) {
- warnx("%s: volume label too long", cname);
+ warnx("volume label too long", cname);
goto usage;
}
@@ -781,7 +781,7 @@ do_voltag(char *cname, int argc, char **argv)
}
} else {
if (argc != 2) {
- warnx("%s: unexpected argument", cname);
+ warnx("unexpected argument", cname);
goto usage;
}
csvr.csvr_flags = CSVR_MODE_CLEAR;
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 4e1712397888..0d868243f442 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -42,7 +42,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
#endif
static const char rcsid[] =
- "$Id: chmod.c,v 1.11 1998/05/13 07:22:11 charnier Exp $";
+ "$Id: chmod.c,v 1.10 1998/05/06 06:50:08 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -195,7 +195,6 @@ done: argv += optind;
}
if (errno)
err(1, "fts_read");
- free(set);
exit(rval);
}
diff --git a/bin/cp/Makefile b/bin/cp/Makefile
index f4ca4d25c87f..57883daad0d1 100644
--- a/bin/cp/Makefile
+++ b/bin/cp/Makefile
@@ -1,8 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $Id: Makefile,v 1.4 1997/02/22 14:01:32 peter Exp $
+# $Id$
PROG= cp
SRCS= cp.c utils.c
-CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED
.include <bsd.prog.mk>
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index f6c0f0d21d55..7e001b2abbff 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
#endif
static const char rcsid[] =
- "$Id: utils.c,v 1.20 1998/06/10 06:29:23 peter Exp $";
+ "$Id: utils.c,v 1.19 1998/06/09 03:38:26 imp Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -124,7 +124,7 @@ copy_file(entp, dne)
* wins some CPU back.
*/
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
- if (S_ISREG(fs->st_mode) && fs->st_size <= 8 * 1048576) {
+ if (fs->st_size <= 8 * 1048576) {
if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) {
warn("%s", entp->fts_path);
diff --git a/bin/csh/dir.c b/bin/csh/dir.c
index b1fc00d79f91..f3b8b9d542b7 100644
--- a/bin/csh/dir.c
+++ b/bin/csh/dir.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
- "$Id: dir.c,v 1.8 1998/06/09 03:38:37 imp Exp $";
+ "$Id: dir.c,v 1.7 1997/08/07 21:42:05 steve Exp $";
#endif
#endif /* not lint */
@@ -85,7 +85,7 @@ dinit(hp)
static char *emsg = "csh: Trying to start from \"%s\"\n";
/* Don't believe the login shell home, because it may be a symlink */
- tcp = getcwd(path, MAXPATHLEN); /* see ngetwd.c for System V version */
+ tcp = getwd(path); /* see ngetwd.c for System V version */
if (tcp == NULL || *tcp == '\0') {
(void) fprintf(csherr, "csh: %s: %s\n", path, strerror(errno));
if (hp && *hp) {
diff --git a/bin/date/Makefile b/bin/date/Makefile
index cf3ceb4c0419..d6562b4b5094 100644
--- a/bin/date/Makefile
+++ b/bin/date/Makefile
@@ -1,8 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $Id: Makefile,v 1.6 1997/08/09 22:34:01 brian Exp $
+# $Id: Makefile,v 1.5 1997/08/04 03:37:05 brian Exp $
PROG= date
SRCS= date.c netdate.c vary.c
+CFLAGS+=-Wall
DPADD= ${LIBUTIL}
LDADD= -lutil
diff --git a/bin/date/date.1 b/bin/date/date.1
index cf0c792626c9..6d87af9633f8 100644
--- a/bin/date/date.1
+++ b/bin/date/date.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
-.\" $Id: date.1,v 1.25 1998/05/13 07:56:44 phk Exp $
+.\" $Id: date.1,v 1.24 1998/05/06 06:51:13 charnier Exp $
.\"
.Dd November 17, 1993
.Dt DATE 1
@@ -183,7 +183,7 @@ and years are handled automatically.
.Sh EXAMPLES
The command:
.Bd -literal -offset indent
-date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S"
+date "+DATE: 19%y-%m-%d%nTIME: %H:%M:%S"
.Ed
.Pp
will display:
diff --git a/bin/dd/dd.1 b/bin/dd/dd.1
index 67d6b3727baa..bfe05eeee285 100644
--- a/bin/dd/dd.1
+++ b/bin/dd/dd.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
-.\" $Id: dd.1,v 1.7 1998/05/06 06:51:35 charnier Exp $
+.\" $Id: dd.1,v 1.6 1997/10/11 20:09:04 joerg Exp $
.\"
.Dd January 13, 1994
.Dt DD 1
@@ -59,9 +59,7 @@ and truncated input records to the standard error output.
The following operands are available:
.Bl -tag -width of=file
.It Cm bs= Ns Ar n
-Set both input and output block size to
-.Va n
-bytes, superseding the
+Set both input and output block size, superseding the
.Cm ibs
and
.Cm obs
@@ -109,13 +107,13 @@ Any regular output file is truncated unless the
conversion value is specified.
If an initial portion of the output file is skipped (see the
.Cm seek
-operand),
+operand)
the output file is truncated at that point.
.It Cm seek= Ns Ar n
Seek
.Va n
blocks from the beginning of the output before copying.
-On non-tape devices, an
+On non-tape devices, a
.Xr lseek 2
operation is used.
Otherwise, existing blocks are read and the data discarded.
@@ -131,7 +129,7 @@ bytes.
Skip
.Va n
blocks from the beginning of the input before copying.
-On input which supports seeks, an
+On input which supports seeks, a
.Xr lseek 2
operation is used.
Otherwise, input data is read and discarded.
@@ -332,7 +330,7 @@ will exit.
.Pp
The
.Nm
-utility exits 0 on success or >0 if an error occurred.
+utility exits 0 on success and >0 if an error occurred.
.Sh SEE ALSO
.Xr cp 1 ,
.Xr mt 1 ,
diff --git a/bin/dd/misc.c b/bin/dd/misc.c
index 00ef7aed06c9..6f7fcafcd2f8 100644
--- a/bin/dd/misc.c
+++ b/bin/dd/misc.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: misc.c,v 1.14 1998/05/13 07:33:50 charnier Exp $";
+ "$Id: misc.c,v 1.13 1998/05/06 06:51:40 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -66,16 +66,16 @@ summary()
secs = 1e-6;
/* Use snprintf(3) so that we don't reenter stdio(3). */
(void)snprintf(buf, sizeof(buf),
- "%lu+%lu records in\n%lu+%lu records out\n",
+ "%u+%u records in\n%u+%u records out\n",
st.in_full, st.in_part, st.out_full, st.out_part);
(void)write(STDERR_FILENO, buf, strlen(buf));
if (st.swab) {
- (void)snprintf(buf, sizeof(buf), "%lu odd length swab %s\n",
+ (void)snprintf(buf, sizeof(buf), "%u odd length swab %s\n",
st.swab, (st.swab == 1) ? "block" : "blocks");
(void)write(STDERR_FILENO, buf, strlen(buf));
}
if (st.trunc) {
- (void)snprintf(buf, sizeof(buf), "%lu truncated %s\n",
+ (void)snprintf(buf, sizeof(buf), "%u truncated %s\n",
st.trunc, (st.trunc == 1) ? "block" : "blocks");
(void)write(STDERR_FILENO, buf, strlen(buf));
}
diff --git a/bin/df/df.c b/bin/df/df.c
index 42ce083c06be..5fbfe723e49b 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95";
#else
static const char rcsid[] =
- "$Id: df.c,v 1.19 1997/10/13 09:36:05 joerg Exp $";
+ "$Id: df.c,v 1.18 1997/10/12 13:55:43 joerg Exp $";
#endif
#endif /* not lint */
@@ -85,7 +85,7 @@ main(argc, argv)
struct statfs statfsbuf, *mntbuf;
long mntsize;
int ch, err, i, maxwidth, rv, width;
- char *mntpt, *mntpath, **vfslist;
+ char *mntpt, **vfslist;
vfslist = NULL;
while ((ch = getopt(argc, argv, "iknt:")) != -1)
@@ -148,25 +148,17 @@ main(argc, argv)
continue;
} else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) {
if ((mntpt = getmntpt(*argv)) == 0) {
+ mntpt = mktemp(strdup("/tmp/df.XXXXXX"));
mdev.fspec = *argv;
- mntpath = strdup("/tmp/df.XXXXXX");
- if (mntpath == NULL) {
- warn("strdup failed");
+ if (mkdir(mntpt, DEFFILEMODE) != 0) {
+ warn("%s", mntpt);
rv = 1;
continue;
}
- mntpt = mkdtemp(mntpath);
- if (mntpt == NULL) {
- warn("mkdtemp(\"%s\") failed", mntpath);
- rv = 1;
- free(mntpath);
- continue;
- }
if (mount("ufs", mntpt, MNT_RDONLY,
&mdev) != 0) {
rv = ufs_df(*argv, maxwidth) || rv;
(void)rmdir(mntpt);
- free(mntpath);
continue;
} else if (statfs(mntpt, &statfsbuf) == 0) {
statfsbuf.f_mntonname[0] = '\0';
@@ -177,7 +169,6 @@ main(argc, argv)
}
(void)unmount(mntpt, 0);
(void)rmdir(mntpt);
- free(mntpath);
continue;
}
} else
diff --git a/bin/expr/expr.1 b/bin/expr/expr.1
index b3f67fb52d93..74cb2a947659 100644
--- a/bin/expr/expr.1
+++ b/bin/expr/expr.1
@@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: expr.1,v 1.7 1998/05/13 07:43:56 charnier Exp $
+.\" $Id: expr.1,v 1.6 1997/02/22 14:03:37 peter Exp $
.\"
.Dd July 3, 1993
.Dt EXPR 1
@@ -125,9 +125,6 @@ the expression is an empty string or 0.
.It 2
the expression is invalid.
.El
-.Sh SEE ALSO
-.Xr sh 1 ,
-.Xr test 1
.Sh STANDARDS
The
.Nm
diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index 355d1c161874..64ae89e1376d 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
-.\" $Id: ls.1,v 1.25 1998/10/04 00:41:08 jkh Exp $
+.\" $Id: ls.1,v 1.24 1998/07/29 00:46:08 hoek Exp $
.\"
.Dd July 29, 1994
.Dt LS 1
@@ -378,7 +378,7 @@ If this variable is set, it is considered to be a
colon-delimited list of minimum column widths. Unreasonable
and insufficient widths are ignored (thus zero signifies
a dynamically sized column). Not all
-columns have changeable widths. The fields are,
+columns have changable widths. The fields are,
in order: inode, block count, number of links, user name,
group name, flags, file size, file name.
.El
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index f9a7ef5e3d6f..ed26dc80525c 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -42,7 +42,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
#endif
static const char rcsid[] =
- "$Id: mkdir.c,v 1.15 1998/10/23 06:28:40 msmith Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -63,7 +63,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- int ch, exitval, success, omode, pflag;
+ int ch, exitval, omode, pflag;
mode_t *set = (mode_t *)NULL;
char *mode;
@@ -93,28 +93,15 @@ main(argc, argv)
if ((set = setmode(mode)) == NULL)
errx(1, "invalid file mode: %s", mode);
omode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO);
- free(set);
}
for (exitval = 0; *argv != NULL; ++argv) {
- success = 1;
if (pflag) {
if (build(*argv, omode))
- success = 0;
- } else if (mkdir(*argv, omode) < 0) {
- warn("%s", *argv);
- success = 0;
+ exitval = 1;
+ continue;
}
- if (!success)
- exitval = 1;
- /*
- * The mkdir() and umask() calls both honor only the low
- * nine bits, so if you try to set a mode including the
- * sticky, setuid, setgid bits you lose them. Don't do
- * this unless the user has specifically requested a mode,
- * as chmod will (obviously) ignore the umask.
- */
- if (success && mode != NULL && chmod(*argv, omode) == -1) {
+ if (mkdir(*argv, omode) < 0) {
warn("%s", *argv);
exitval = 1;
}
@@ -183,8 +170,7 @@ build(path, omode)
retval = 1;
break;
}
- if (!last)
- *p = '/';
+ *p = '/';
}
if (!first && !last)
(void)umask(oumask);
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index a02c3a392437..f46dce1ea6fa 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#endif
static const char rcsid[] =
- "$Id: pat_rep.c,v 1.13 1998/12/05 10:29:10 obrien Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -1002,7 +1002,7 @@ rep_name(name, nlen, prnt)
# ifdef NET2_REGEX
inpt = pt->rcmp->endp[0];
# else
- inpt += pm[0].rm_eo - pm[0].rm_so;
+ inpt += pm[0].rm_eo;
# endif
if ((outpt == endpt) || (*inpt == '\0'))
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index ba8c6b00081b..bde4c459f12d 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#endif
static const char rcsid[] =
- "$Id: tar.c,v 1.10 1998/05/15 06:27:47 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -977,7 +977,7 @@ ustar_wr(arcn)
* check the length of the linkname
*/
if (((arcn->type == PAX_SLK) || (arcn->type == PAX_HLK) ||
- (arcn->type == PAX_HRG)) && (arcn->ln_nlen >= sizeof(hd->linkname))){
+ (arcn->type == PAX_HRG)) && (arcn->ln_nlen > sizeof(hd->linkname))){
pax_warn(1, "Link name too long for ustar %s", arcn->ln_name);
return(1);
}
@@ -1156,16 +1156,17 @@ name_split(name, len)
*/
if (len <= TNMSZ)
return(name);
- if (len > (TPFSZ + TNMSZ))
+ if (len > (TPFSZ + TNMSZ + 1))
return(NULL);
/*
* we start looking at the biggest sized piece that fits in the name
* field. We walk foward looking for a slash to split at. The idea is
* to find the biggest piece to fit in the name field (or the smallest
- * prefix we can find)
+ * prefix we can find) (the -1 is correct the biggest piece would
+ * include the slash between the two parts that gets thrown away)
*/
- start = name + len - TNMSZ;
+ start = name + len - TNMSZ - 1;
while ((*start != '\0') && (*start != '/'))
++start;
@@ -1183,7 +1184,7 @@ name_split(name, len)
* the file would then expand on extract to //str. The len == 0 below
* makes this special case follow the spec to the letter.
*/
- if ((len >= TPFSZ) || (len == 0))
+ if ((len > TPFSZ) || (len == 0))
return(NULL);
/*
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c
index f04ae9dc6391..76eb78c21c21 100644
--- a/bin/ps/fmt.c
+++ b/bin/ps/fmt.c
@@ -36,13 +36,13 @@
static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
#endif
static const char rcsid[] =
- "$Id: fmt.c,v 1.12 1998/06/17 11:33:10 jkoshy Exp $";
+ "$Id: fmt.c,v 1.11 1998/05/15 06:29:15 charnier Exp $";
#endif /* not lint */
-#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/syslimits.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 6cd2c3572dc9..a0c60b11b9f1 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#else
static const char rcsid[] =
- "$Id: keyword.c,v 1.21 1998/12/19 02:55:32 julian Exp $";
+ "$Id: keyword.c,v 1.19 1998/05/25 05:07:17 steve Exp $";
#endif
#endif /* not lint */
@@ -157,17 +157,10 @@ VAR var[] = {
{"ruser", "RUSER", NULL, LJUST|DSIZ, runame, s_runame, USERLEN},
{"sess", "SESS", NULL, 0, evar, NULL, 6, EOFF(e_sess), KPTR, "lx"},
{"sig", "PENDING", NULL, 0, pvar, NULL, 8, POFF(p_siglist), INT, "x"},
-#ifndef COMPAT_LINUX_THREADS
{"sigcatch", "CAUGHT",
NULL, 0, pvar, NULL, 8, POFF(p_sigcatch), UINT, "x"},
{"sigignore", "IGNORED",
NULL, 0, pvar, NULL, 8, POFF(p_sigignore), UINT, "x"},
-#else
- {"sigcatch", "CAUGHT",
- NULL, 0, evar, NULL, 8, EOFF(e_procsig.ps_sigcatch), UINT, "x"},
- {"sigignore", "IGNORED",
- NULL, 0, evar, NULL, 8, EOFF(e_procsig.ps_sigignore), UINT, "x"},
-#endif /* COMPAT_LINUX_THREADS */
{"sigmask", "BLOCKED",
NULL, 0, pvar, NULL, 8, POFF(p_sigmask), UINT, "x"},
{"sl", "SL", NULL, 0, pvar, NULL, 3, POFF(p_slptime), UINT, "d"},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 9317c7be1ffc..09fbf8e342cc 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: print.c,v 1.32 1998/09/14 08:32:20 dfr Exp $";
+ "$Id: print.c,v 1.31 1998/06/28 21:05:48 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -503,8 +503,8 @@ getpcpu(k)
if (p->p_swtime == 0 || (p->p_flag & P_INMEM) == 0)
return (0.0);
if (rawcpu)
- return (100.0 * fxtofl(p->p_pctcpu));
- return (100.0 * fxtofl(p->p_pctcpu) /
+ return (10000.0 / sysconf(_SC_CLK_TCK) * fxtofl(p->p_pctcpu));
+ return (10000.0 / sysconf(_SC_CLK_TCK) * fxtofl(p->p_pctcpu) /
(1.0 - exp(p->p_swtime * log(fxtofl(ccpu)))));
}
diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c
index 92973f9b8e35..fab0dfbd0a42 100644
--- a/bin/pwd/pwd.c
+++ b/bin/pwd/pwd.c
@@ -42,7 +42,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
#endif
static const char rcsid[] =
- "$Id: pwd.c,v 1.7 1998/05/15 06:30:58 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
@@ -82,7 +82,7 @@ main(argc, argv)
usage();
if ((p = getcwd(NULL, 0)) == NULL)
- err(1, ".");
+ err(1, NULL);
(void)printf("%s\n", p);
exit(0);
}
diff --git a/bin/rcp/Makefile b/bin/rcp/Makefile
index 44ca5331ec67..e8db7dc69a3e 100644
--- a/bin/rcp/Makefile
+++ b/bin/rcp/Makefile
@@ -1,8 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 7/19/93
-# $Id: Makefile,v 1.12 1998/10/09 06:31:45 markm Exp $
+# $Id: Makefile,v 1.11 1998/08/06 21:35:04 markm Exp $
PROG= rcp
SRCS= rcp.c util.c
+CFLAGS+=-Wall
.if exists(${DESTDIR}${LIBDIR}/libkrb.a) && defined(MAKE_KERBEROS4)
SRCS+= krcmd.c kcmd.c rcmd_util.c encrypt.c
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index ebd035a650de..a50d55cb3d9e 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)bltin.h 8.2 (Berkeley) 5/4/95
- * $Id: bltin.h,v 1.8 1997/02/22 13:58:58 peter Exp $
+ * $Id$
*/
/*
@@ -60,17 +60,7 @@
#define fputs outstr
#define fflush flushout
#define INITARGS(argv)
-#define warnx1(a, b, c) { \
- char buf[64]; \
- (void)snprintf(buf, sizeof(buf), a); \
- error("%s", buf); \
-}
-#define warnx2(a, b, c) { \
- char buf[64]; \
- (void)snprintf(buf, sizeof(buf), a, b); \
- error("%s", buf); \
-}
-#define warnx3(a, b, c) { \
+#define warnx(a, b, c) { \
char buf[64]; \
(void)snprintf(buf, sizeof(buf), a, b, c); \
error("%s", buf); \
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index 4daacacfca51..772a3fd17a47 100644
--- a/bin/sh/miscbltin.c
+++ b/bin/sh/miscbltin.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: miscbltin.c,v 1.17 1998/08/25 09:33:34 cracauer Exp $";
+ "$Id: miscbltin.c,v 1.16 1998/08/24 10:20:36 cracauer Exp $";
#endif /* not lint */
/*
@@ -285,11 +285,10 @@ umaskcmd(argc, argv)
} else {
void *set;
if ((set = setmode (ap)) == 0)
- error("Illegal number: %s", ap);
+ error("Illegal number: %s", ap);
mask = getmode (set, ~mask & 0777);
umask(~mask & 0777);
- free(set);
}
}
return 0;
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index cbc377e369a0..5d99ac64a5a1 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
-.\" $Id: sh.1,v 1.22 1998/12/02 23:20:11 billf Exp $
+.\" $Id: sh.1,v 1.20 1998/05/18 06:44:17 charnier Exp $
.\"
.Dd May 5, 1995
.Dt SH 1
@@ -1003,7 +1003,7 @@ have a shell function with the same name
as a builtin command.)
.It cd [ directory ]
Switch to the specified directory (default $HOME).
-If an entry for CDPATH appears in the environment
+If the an entry for CDPATH appears in the environment
of the cd command or the shell variable CDPATH is set
and the directory name does not begin with a slash,
then the directories listed in CDPATH will be
@@ -1306,9 +1306,6 @@ Hitting <return> while in command mode will pass the line to the shell.
.Pp
Similarly, the 'set -o emacs' command can be used to enable a subset of
emacs-style commandline editing features.
-.Sh SEE ALSO
-.Xr expr 1 ,
-.Xr test 1
.Sh HISTORY
A
.Nm
diff --git a/bin/test/test.1 b/bin/test/test.1
index 45a84e33b87c..db51abc6a8ae 100644
--- a/bin/test/test.1
+++ b/bin/test/test.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
-.\" $Id: test.1,v 1.7 1998/09/07 16:59:05 cracauer Exp $
+.\" $Id: test.1,v 1.6 1998/05/18 06:51:56 charnier Exp $
.\"
.Dd May 31, 1993
.Dt TEST 1
@@ -253,9 +253,6 @@ missing.
.It >1
An error occurred.
.El
-.Sh SEE ALSO
-.Xr expr 1 ,
-.Xr sh 1
.Sh STANDARDS
The
.Nm
diff --git a/contrib/amd/AUTHORS b/contrib/amd/AUTHORS
index 2aba7cd00375..e555a7426ed9 100644
--- a/contrib/amd/AUTHORS
+++ b/contrib/amd/AUTHORS
@@ -30,8 +30,6 @@ files.
January 27, 1998: support pid files in the amd.conf file. Provide base name
for hesiod zone files. Always use /etc/amd.conf if exists.
-August 8, 1998: add detection support for NFS V.3 for NetBSD 1.3F.
-
* Hannes Reinecke <hare@MathI.UNI-Heidelberg.DE>
Back in 1995, contributed code for linux. A new parser for file system
@@ -91,9 +89,6 @@ options. Minor type wrt "ro" option in libamu/mount_fs.c. Added more
fillers of mnttab options, for acdirmax, acdirmin, acregmax, acregmin, noac,
grpid, nosuid, and actimo.
-August 15, 1998: fix memory leak in processing of /defaults, and avoid
-accessing uninitialized memory in osf1.
-
* Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
July 23, 1997: Got lots of patches from the Debian Linux folks, who fixed
@@ -176,9 +171,6 @@ January 12, 1998: minor bug in output of amd -H.
January 13, 1998: use case insensitive comparisons for variables that need
it (such as all hostname related ones, and more).
-July 20, 1998: don't leak memory in the private version of yp_all (when
-vendor yp_all is bad).
-
* Fred Korz <korz@smarts.com>
January 30, 1998: minor typo fixed to tftp example in am-utils.texi.
@@ -194,24 +186,5 @@ allow startup script to redirect it. Set a temporary secure umask(0022)
before writing log file and restore it afterwards.
* Matthew Crosby <mcrosby@ms.com>
-
April 20, 1998: allow arbitrary number of interfaces in wire listing.
-* David O'Brien <obrien@NUXI.com>
-
-September 4, 1998: bug fix to avoid overrunning hostname buffer, and minor
-amd.conf man page typo correction.
-
-* Danny Rathjens <dkr@cs.fiu.edu>
-
-October 29, 1998: swap arguments to kill(2) in amd.c.
-
-* Mike Mitchell <mcm@unx.sas.com>
-
-November 3, 1998: amd/nfs_subr.c (nfsproc_lookup_2_svc): try to avoid a race
-condition between unmounting and re-mounting an entry, by increasing the ttl
-of a looked up entry before unmounting it.
-
-* Douglas K. Rand" <rand@aero.und.edu>
-
-December 3, 1998: case insensitive host name match for nfsl.
diff --git a/contrib/amd/BUGS b/contrib/amd/BUGS
index 88027b2b83b2..125714dbaa41 100644
--- a/contrib/amd/BUGS
+++ b/contrib/amd/BUGS
@@ -71,22 +71,3 @@ that nfsd is running. Normally these are not required.
[4B] "Stefan Vogel" <vogel@physik.unizh.ch> reports that if your amq
executable dump core unexpectedly, then it may be a bug in gcc 2.7.x.
Upgrade to gcc 2.8.x or use IBM's xlC compiler.
-
-[C] Do not link amd with libnsl. It is buggy and causes amd to core dump
-in strlen inside strdup inside svc_register().
-
-
-(5) *-linux-gnu (RedHat Linux 5.1)
-
-There's a UDP file descriptor leak in libnsl in RedHat Linux 5.1. This
-library part of glibc2. Am-utils currently declares redhat 5.1 systems as
-having a "broken yp_all" and using an internal, slower, leak-free version.
-The leak is known to the glibc maintainers and a fix from them is due soon,
-but it is not yet in the glibc-2.0.7-19 RPM.
-
-
-(6) rs6000-ibm-aix4.1.x
-
-A bug in libc results in an amq binary that doesn't work; amq -v dumps core
-in xdr_string. There is no known fix (source code or vendor patch) at this
-time. (Please let amd-dev know if you know of a fix.)
diff --git a/contrib/amd/ChangeLog b/contrib/amd/ChangeLog
index 784693a63864..3a059280ed47 100644
--- a/contrib/amd/ChangeLog
+++ b/contrib/amd/ChangeLog
@@ -1,315 +1,3 @@
-1999-01-01 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- *******************************************************************
- *** Released am-utils-6.0 ***
- *******************************************************************
-
-1998-12-28 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * conf/nfs_prot/nfs_prot_sunos5_7.h: support ldap in solaris 2.7.
-
-1998-12-27 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * conf/nfs_prot/nfs_prot_bsdi3.h: don't use reserved ports on
- bsdi4 for NFS V3/nfs mounts.
-
-1998-12-26 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * using latest libtool (1.2e + patches), now supporting shared
- libraries on many more systems. Also using latest autoconf and
- automake (unreleased GNU CVS'd versions.)
-
- * minor new ports: hppa2.0w-hp-hpux11.00,
- i386-unknown-netbsd1.3.3, mips-sgi-irix6.5.
-
- * fsinfo/fsinfo.h (yywrap): define it for systems (osf4) that
- have /usr/bin/flex but not libfl.
-
-1998-12-24 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * lots of code cleanup, to make sure libamu.so does not use
- undefined symbols. Some system's shared libraries cannot handle
- that.
-
-1998-12-23 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * include/am_defs.h: only defined seteuid extern if function also
- exists and is not superceded by setresuid (hpux).
-
- * amd/ops_autofs.c (autofs_bgmount, autofs_lookuppn): put explicit
- braces to avoid confusion with nested if-then-else clauses.
-
- * aux/config.{sub,status}, aux/{ltmain.sh,ltconfig,mkinstalldirs:
- updated from latest versions.
-
-1998-12-22 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * minor new port: i386-pc-bsdi4.0
-
- * conf/nfs_prot/nfs_prot_bsdi3.h: add missing hesiod header
- definitions for bsdi4.
-
- * {amd,fsinfo}/Makefile.am: force path to .y/.l files, because
- some make programs (bsdi4) do not support VPATH correctly.
-
-1998-12-16 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * conf/mount/mount_aix.c: minor code cleanup
-
- * aux/configure.in: check for extern definition to xdr_groups.
-
-1998-12-15 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * minor new port: powerpc-ibm-aix4.3.1.0
-
- * aux/macros/*.m4: updates for aix 4.3
-
-1998-12-14 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * minor new port: i386-unknown-openbsd2.4
-
- * aux/configure.in: don't check for xfs on openbsd because
- openbsd-2.4 introduces a new file system named xfs, but different
- than Irix's XFS. Sigh.
-
- * minor new port: i386-unknown-freebsd2.2.8
-
-1998-12-03 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * amd/amfs_nfsl.c (amfs_nfsl_ffserver): use case insensitive host
- name match. Bug fix from Douglas K. Rand" <rand@aero.und.edu>.
-
-1998-11-20 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * scripts/ctl-amd.in: wait4amd2die runs in the stop action, to
- avoid race conditions when shutting down systems running amd.
-
- * Makefile.am: add a dist-hook to change modes of the directories
- in the tar file so they are not world writable.
-
- * conf/nfs_prot/nfs_prot_freebsd3.h: turned on NFSv3 support,
- since it is now finally defined in the header files and
- (hopefully) stable.
-
- * amd/srvr_nfs.c (find_nfs_srvr): allow overriding if nfsv2 option
- is specified in mount options. freebsd patches from David
- O'Brien.
-
- * amq/amq.c (main), fixmount/fixmount.c (main), hlfsd/hlfsd.c
- (main), fsinfo/fsinfo.c (fsi_get_args), hlfsd/hlfsd.c (main),
- amd/get_args.c (get_args): posix: use -1 to check for return from
- getopt() (not EOF), as per posix.
-
- * amd/amq_subr.c (xdr_amq_mount_tree_node): patches from "David
- O'Brien" <obrien@NUXI.com>, from the FreeBSD source tree. Use
- real variable whose pointer is on the stack for decoding a long
- int.
-
-1998-11-11 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * scripts/ctl-{amd,hlfsd}.in: include comments useful for redhat's
- chkconfig utility.
-
-1998-11-10 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * released snapshot am-utils-6.0b2s3
-
- * conf/transp/transp_sockets.c (create_nfs_service): remove C++
- style comments.
-
-1998-11-04 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * released snapshot am-utils-6.0b2s2
-
- * created CVS package
-
- * amd/nfs_subr.c (nfsproc_lookup_2_svc): try to avoid a race
- condition between unmounting and re-mounting an entry, by
- increasing the ttl of a looked up entry before unmounting it.
- Patch from Mike Mitchell <mcm@unx.sas.com>.
-
- * All files: spell comments and strings.
-
-1998-11-03 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/configure.in: look for yp_all in libnsl only if yp_all not
- already found elsewhere (in libc or other default libraries).
- This is so RedHat 5.1 systems could find yp functions in libnsl,
- but also so AIX 4.2.1 will NOT include libnsl, because the latter
- has broken nis functionality that also exists and works ok in libc.
-
-1998-10-29 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * amd/amd.c (main): bug fix: swapped arguments to kill(2). Fix
- from Danny Rathjens <dkr@cs.fiu.edu>.
-
-1998-10-28 Erez Zadok <ezk@spruce.mcl.cs.columbia.edu>
-
- * released snapshot am-utils-6.0b2s1
-
-1998-10-27 Erez Zadok <ezk@spruce.mcl.cs.columbia.edu>
-
- * aux/macros/*.m4: support bsdi4 as bsdi3.
-
- * aux/macros/os_ldflags.m4: enable detection of LDAP on solaris
- 2.7 (libraries located in /usr/lib/fn). This is off until Sun
- includes LDAP header information.
-
-1998-10-20 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- *******************************************************************
- *** Released am-utils-6.0b1 ***
- *******************************************************************
-
-1998-10-18 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * mk-amd-map/mk-amd-map.c (main): use perror not strerror.
- (main): set return type to int if no ndbm maps.
-
- * include/am_defs.h: avoid conflicts with <sys/mount.h> in 2.1
- kernels.
-
-1998-10-18 Erez Zadok <ezk@london.mcl.cs.columbia.edu>
-
- * A.i386-unknown-netbsd1.3.2/amu_nfs_prot.h: trim down and cleanup
- for netbsd 1.3.2.
-
-1998-10-17 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/configure.in: check for yp_all in libnsl, b/c redhat 5.1
- systems put NIS functions there.
-
- * mk-amd-map/mk-amd-map.c: patch from "David O'Brien"
- <obrien@NUXI.com> merged in. Use POSIX -1 return code from
- getopt(), not EOF. Use .db extentions for systems that use it,
- instead of .{pag,dir}.
-
-1998-10-15 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * wire-test/wire-test.c, hlfsd/hlfsd.c, fixmount/fixmount.c,
- amd/amd.c (main): avoid overrunning hostname buffer. Bug fix from
- "David O'Brien" <obrien@NUXI.com>.
-
- * scripts/amd.conf.5: minor typo reported by "David O'Brien"
- <obrien@NUXI.com> in .TH section of man page.
-
- * amd/info_nis.c (am_yp_all): don't leak key-val entries. Patch
- from Thomas Richter <richter@chemie.fu-berlin.de>.
-
-1998-10-12 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * doc/am-utils.texi (Program Filesystem): minor typo fixed as per
- Andreas Stolcke <stolcke@speech.sri.com>.
-
- * minor new ports: sparc64-unknown-linux-gnu, i386-pc-solaris2.7,
- and sparc-sun-solaris2.7.
-
- * conf/mount/mount_freebsd3.c (mount_freebsd3): freebsd 3.0 is now
- a 4.4lite kernel, and somethings were removed, such as
- INITMOUNTNAMES.
-
- * amd/ops_autofs.c (autofs_lookuppn): don't leak memory while
- processing /defaults. Free temporary opts. Patch from
- dsr@mail.lns.cornell.edu (Daniel S. Riley)
-
- * amd/amfs_auto.c (amfs_auto_lookuppn): don't leak memory while
- processing /defaults. Free temporary opts. Patch from
- dsr@mail.lns.cornell.edu (Daniel S. Riley)
-
- * conf/mtab/mtab_osf.c (read_mtab): patch from
- dsr@mail.lns.cornell.edu (Daniel S. Riley) not to access
- uninitialized memory on Digital Unix.
-
-1998-10-09 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/macros/{check_mtype_type,check_mtype_printf_type}.m4: most
- systems now use "char *" as their mount type.
-
-1998-10-08 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * amd/conf.c (gopt_map_type, ropt_map_type): check if map type
- exists.
-
- * amd/mapc.c (mapc_type_exists): function to test if a map of
- certain type exists.
-
-1998-10-08 Erez Zadok <ezk@horatio.mcl.cs.columbia.edu>
-
- * aux/macros/{mount_headers,try_compile_anyfs,try_compile_nfs}.m4,
- include/am_defs.h: Avoid a conflict in definitions of ntohl/htonl
- in RH-5.1 sparc64 between <netinet/in.h> and
- <linux/byteorder/generic.h> (2.1 kernels).
-
-1998-09-28 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/macros/func_bad_yp_all.m4 (ac_cv_func_yp_all_clean): RedHat
- 5.1 systems with glibc glibc-2.0.7-19 or below leak a UDP socket
- from yp_all().
-
-1998-09-25 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * conf/mount/mount_linux.c (parse_opts): check for pcfs support
- only if autoconfigured.
-
-1998-09-18 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * Makefile.am (EXTRA_DIST): distribute README.yk2 file.
-
- * README.y2k: explain y2k compliance status of am-utils.
-
-1998-09-16 Erez Zadok <ezk@iguana.mcl.cs.columbia.edu>
-
- * amd/amfs_host.c (fetch_fhandle, amfs_host_fmount,
- amfs_host_umounted): clnt_sperrno() may return a const.
-
-Sat Aug 8 23:28:32 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/configure.in: check for <nfs/nfsmount.h>, as per Christos
- Zoulas. Turned on checking for mount options: async, synchronous,
- deadthresh, leasterm, nqnfs, and readahead.
-
- * amd/info_nis.c: patch from christos@zoulas.com (Christos Zoulas)
- to include prototype definition for nis_isup().
-
-Sun Jul 19 18:50:10 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * hlfsd/stubs.c (getcreds): force sscanf arg to u_long.
-
-Tue Jul 14 20:34:25 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * released snapshot am-utils-6.0a17s1
-
-Wed Jul 8 21:49:15 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/macros/host_macros.m4: all x86 hosts should have $arch be
- i386, not i[456]86.
-
-Tue Jul 7 18:55:09 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/macros/{mount_headers,try_compile_anyfs,try_compile_nfs}.m4,
- include/am_defs.h: include <linux/posix_types.h> before
- <linux/fs.h> because on redhat 5.1, there is a bug (misuse) of
- headers in <socketbits.h> (it defines _LINUX_TYPES_H instead of
- __KERNEL_STRICT_NAMES).
-
- * aux/configure.in: check for <linux/posix_types.h> because it is
- need for RedHat 5.1.
-
-Wed Jun 17 00:05:33 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * scripts/Makefile.am (EXTRA_DIST): have fixrmtab generated from
- .in as well, so it doesn't get removed by make clean.
-
-Tue Jun 16 22:00:15 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * aux/macros/{check_fs_mntent.m4, check_mnttab_type.m4,
- check_mount_type.m4}: redhat 5.1 puts some modules in
- /lib/modules/preferred/.
-
-Wed May 13 16:33:57 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-
- * amd/ops_autofs.c (mount_autofs): cast pid to long.
-
Thu Apr 23 00:22:17 1998 Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
*******************************************************************
diff --git a/contrib/amd/FREEBSD-upgrade b/contrib/amd/FREEBSD-upgrade
index 745e42b942a0..78d20999e613 100644
--- a/contrib/amd/FREEBSD-upgrade
+++ b/contrib/amd/FREEBSD-upgrade
@@ -1,6 +1,6 @@
# ex:ts=8
-AMD (am-utils) 6.0b1
+AMD (am-utils) 6.0a16
originals can be found at: ftp://shekel.mcl.cs.columbia.edu/pub/am-utils
@@ -14,7 +14,7 @@ For the import of AMD the following files were removed:
amq/
Makefile.am Makefile.in
- conf/checkmount/
+ checkmount/
checkmount_aix.c checkmount_osf.c checkmount_ultrix.c
checkmount_default.c checkmount_svr4.c
@@ -31,8 +31,8 @@ For the import of AMD the following files were removed:
conf/mount/
mount_aix.c mount_irix6.c mount_stellix.c
mount_bsdi3.c mount_isc3.c mount_svr4.c
- mount_hpux.c mount_linux.c mount_freebsd3.c
- mount_irix5.c mount_mach3.c (was for pre-3.0-R)
+ mount_hpux.c mount_linux.c
+ mount_irix5.c mount_mach3.c
conf/mtab/
mtab_aix.c mtab_isc3.c mtab_osf.c mtab_ultrix.c
@@ -61,8 +61,7 @@ For the import of AMD the following files were removed:
trap_aix3.h trap_hpux.h trap_linux.h trap_stellix.h
trap_aux.h trap_hpux11.h trap_mach3.h trap_svr4.h
trap_dgux.h trap_irix.h trap_news4.h trap_ultrix.h
- trap_hcx.h trap_isc3.h trap_rtu6.h trap_freebsd3.h
- (was for pre-3.0-R)
+ trap_hcx.h trap_isc3.h trap_rtu6.h
conf/umount/
umount_default.c umount_osf.c
@@ -95,8 +94,8 @@ For the import of AMD the following files were removed:
Imported by:
- cvs import -ko -m 'Virgin import of AMD (am-utils) v6.0b1' \
- src/contrib/amd COLUMBIA amd_6_0b1
+ cvs import -m 'Virgin import of AMD (am-utils) v6.0a16' \
+ src/contrib/amd COLUMBIA amd_6_0a16
To make local changes to amd, simply patch and commit to the main
@@ -106,4 +105,4 @@ All local changes should be submitted to "amd-dev@majordomo.cs.columbia.edu"
for inclusion in the next vendor release.
obrien@NUXI.com
-14-November-1998
+23-August-1998
diff --git a/contrib/amd/INSTALL b/contrib/amd/INSTALL
index f471305045f5..7df423b1be8b 100644
--- a/contrib/amd/INSTALL
+++ b/contrib/amd/INSTALL
@@ -3,73 +3,53 @@
For each system, list if it autoconfigures, compiles, or runs. Fill in
email id of person who confirms the fact. A missing entry means unverified.
-A 'no' or '!' means verified broken or nonexistent (static library).
+A 'no' means verified broken.
SYSTEM AUTOCONF COMPILE RUN SHLIB
========================= ======== ========= ======= =====
-alpha-dec-osf2.1 ezk ezk ezk !ezk
-alpha-dec-osf4.0 ezk ezk dsr[3] ezk
+alpha-dec-osf2.1 ezk ezk ezk
+alpha-dec-osf4.0 ezk ezk dsr[3]
alphaev5-unknown-linux-gnu ezk ezk finkel ezk
hppa1.0-hp-hpux11.00 ezk ezk ezk
-hppa1.1-hp-hpux10.10 ezk ezk ezk ezk
-hppa1.1-hp-hpux10.20 ezk ezk ezk ezk
-hppa1.1-hp-hpux9.01 ezk[4] ezk[4] nrh/ezk ezk
-hppa1.1-hp-hpux9.05 ezk[4] ezk[4] nrh/ezk ezk
-hppa1.1-hp-hpux9.07 ezk[4] ezk[4] nrh/ezk ezk
-hppa2.0w-hp-hpux11.00 ezk ezk ezk ezk
-i386-pc-bsdi2.1 ezk ezk ezk !ezk
-i386-pc-bsdi3.0 ezk ezk ezk !ezk
-i386-pc-bsdi3.1 ezk ezk ezk !ezk
-i386-pc-bsdi4.0 ezk ezk ezk ezk
+hppa1.1-hp-hpux10.10 ezk ezk ezk -ezk (!rpcsvc.so)
+hppa1.1-hp-hpux10.20 ezk ezk ezk -ezk (!rpcsvc.so)
+hppa1.1-hp-hpux9.01 ezk[4] ezk[4] nrh/ezk
+hppa1.1-hp-hpux9.05 ezk[4] ezk[4] nrh/ezk
+hppa1.1-hp-hpux9.07 ezk[4] ezk[4] nrh/ezk
+i386-pc-bsdi2.1 ezk ezk ezk
+i386-pc-bsdi3.0 ezk ezk ezk
+i386-pc-bsdi3.1 ezk ezk ezk
i386-pc-solaris2.5.1 ezk ezk ezk ezk
i386-pc-solaris2.6 ezk ezk ezk ezk
-i386-pc-solaris2.7 ezk ezk ezk ezk
i386-unknown-freebsd2.1.0 ezk ezk ezk
i386-unknown-freebsd2.2.1 ezk ezk ezk ezk
-i386-unknown-freebsd2.2.6 ezk ezk ezk ezk
-i386-unknown-freebsd2.2.7 ezk ezk ezk ezk
-i386-unknown-freebsd2.2.8 ezk ezk ezk ezk
i386-unknown-freebsd3.0 ezk ezk ezk ezk
i386-unknown-netbsd1.2.1 ezk ezk ezk ezk
i386-unknown-netbsd1.3 ezk ezk ezk ezk
i386-unknown-netbsd1.3.1 ezk ezk ezk ezk
-i386-unknown-netbsd1.3.2 ezk ezk ezk ezk
-i386-unknown-netbsd1.3.3 ezk ezk ezk ezk
i386-unknown-openbsd2.1 ezk ezk ezk ezk
-i386-unknown-openbsd2.2 ezk ezk ezk ezk
-i386-unknown-openbsd2.3 ezk ezk ezk ezk
-i386-unknown-openbsd2.4 ezk ezk ezk ezk
-i486-ncr-sysv4.3.03 ezk ezk ezk
+i486-ncr-sysv4.3.03 ezk ezk
i486-pc-linux-gnulibc1 ezk ezk ezk ezk
-i486-pc-linux-gnuoldld ezk ezk ezk ezk
-i586-pc-linux-gnu ezk ezk ezk ezk
i586-pc-linux-gnulibc1 ezk ezk ezk ezk
i686-pc-linux-gnu ezk ezk ezk ezk
-i686-pc-linux-gnulibc ezk ezk ezk ezk
-i686-pc-linux-gnulibc1 ezk ezk ezk ezk
m68k-hp-hpux9.00 ezk[4] ezk[4] nrh/ezk
-m68k-next-nextstep3 ezk ezk ezk !ezk
-m68k-sun-sunos4.1.1 ezk ezk !ezk
+m68k-next-nextstep3 ezk ezk ezk
+m68k-sun-sunos4.1.1 ezk ezk
mips-dec-ultrix4.3 ro ro ro
mips-sgi-irix5.2
-mips-sgi-irix5.3 ezk ezk ezk ezk
-mips-sgi-irix6.2 ezk[1] ezk[1] ezk[1] ezk
-mips-sgi-irix6.4 ezk ezk ezk ezk
-mips-sgi-irix6.5 ezk ezk ezk
-powerpc-ibm-aix4.1.5.0 ezk ezk wpaul !ezk
-powerpc-ibm-aix4.2.1.0 ezk ezk ezk !ezk
-powerpc-ibm-aix4.3.1.0 ezk ezk !ezk
-powerpc-unknown-linux-gnu jose jose jose
+mips-sgi-irix5.3 ezk ezk ezk
+mips-sgi-irix6.2 ezk[1] ezk[1] ezk[1]
+mips-sgi-irix6.4 ezk ezk ezk ezk (!gcc)
+powerpc-ibm-aix4.1.5.0 ezk ezk wpaul
+powerpc-ibm-aix4.2.1.0 ezk ezk ezk
rs6000-ibm-aix3.2 ezk ezk ezk
rs6000-ibm-aix3.2.5 ezk ezk ezk
-rs6000-ibm-aix4.1.4.0 ezk ezk !ezk
-rs6000-ibm-aix4.1.5.0 ezk ezk !ezk
-sparc-sun-solaris2.3 ezk ezk ezk ezk
+rs6000-ibm-aix4.1.4.0 ezk ezk
+sparc-sun-solaris2.3 ezk ezk ezk
sparc-sun-solaris2.4 ezk ezk ezk ezk
sparc-sun-solaris2.5 ezk ezk ezk ezk
sparc-sun-solaris2.5.1 ezk ezk ezk ezk
sparc-sun-solaris2.6 ezk ezk[2] ezk ezk
-sparc-sun-solaris2.7 ezk ezk[2] ezk ezk
sparc-sun-sunos4.1.1 ezk ezk ezk ezk
sparc-sun-sunos4.1.3 ezk ezk ezk ezk
sparc-sun-sunos4.1.3C ezk ezk ezk ezk
@@ -77,20 +57,17 @@ sparc-sun-sunos4.1.3_U1 ezk ezk ezk ezk
sparc-sun-sunos4.1.4 ezk ezk ezk ezk
sparc-unknown-linux-gnulibc1 ezk ezk ezk ezk
sparc-unknown-netbsd1.2E ezk ezk ezk
-sparc-unknown-netbsd1.2G ezk ezk ezk
-sparc64-unknown-linux-gnu ezk ezk ezk ezk
EMAIL ID LEGEND:
bking: Bevis R W King <B.King@ee.surrey.ac.uk>
dsr: Dan Riley <dsr@mail.lns.cornell.edu>
ezk: Erez Zadok <ezk@cs.columbia.edu>
-finkel: Raphael Finkel <raphael@cs.uky.edu>
-jose: Jose Nazario <jose@biocserver.BIOC.CWRU.Edu>
nrh: Nick Hall <nrh@dcs.ed.ac.uk>
-ro: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
stolke: Andreas Stolcke <stolcke@speech.sri.com>
wpaul: Bill Paul <wpaul@ctr.columbia.edu>
+finkel: Raphael Finkel <raphael@cs.uky.edu>
+ro: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
FOOTNOTES:
diff --git a/contrib/amd/LSM.am-utils b/contrib/amd/LSM.am-utils
deleted file mode 100644
index 76e6271c6925..000000000000
--- a/contrib/amd/LSM.am-utils
+++ /dev/null
@@ -1,20 +0,0 @@
-Begin3
-Title: am-utils
-Version: 6.0
-Entered-date: 01JAN99
-Description: BSD Automounter Utilities
- Replaces the old amd-upl102. Offers NFS V3 support, many
- new features, and numerous ports. The home page for
- am-utils is in http://www.cs.columbia.edu/~ezk/am-utils/
-Keywords: amd amq hlfsd fsinfo wire-test fixmount mk-amd-map automount
-Author: ezk@cs.columbia.edu (Erez Zadok)
-Maintained-by: ezk@cs.columbia.edu (Erez Zadok)
-Primary-site: shekel.mcl.cs.columbia.edu /pub/am-utils
- 1.6MB am-utils-6.0.tar.gz
- 1.6MB am-utils.tar.gz
- 1.6MB am-utils-snapshot.tar.gz
-Alternate-site: http://www.cs.columbia.edu/~ezk/am-utils/mirrors.html
-Original-site: ftp.cs.columbia.edu /pub/amd
-Platforms: all modern Unix systems
-Copying-policy: BSD
-End
diff --git a/contrib/amd/MIRRORS b/contrib/amd/MIRRORS
index dba537fe6b34..6ea3dbf12193 100644
--- a/contrib/amd/MIRRORS
+++ b/contrib/amd/MIRRORS
@@ -11,15 +11,12 @@ U.S.A:
New York (Primary Site):
ftp://shekel.mcl.cs.columbia.edu/pub/am-utils
Maintainer: ezk@cs.columbia.edu
- Minnesota:
+ Maryland:
ftp://ftp.cs.umn.edu/pub/AMD
Maintainer: dokas@cs.umn.edu
Virginia (Newport News):
- ftp://www.ferginc.com/pub/unix/am-utils
+* ftp://www.ferginc.com/pub/unix/am-utils
Maintainer: Branson.Matheson@FergInc.com
- Ohio (Kent State University):
- ftp://info.mcs.kent.edu/pub/am-utils
- Maintainer: root@mcs.kent.edu
Europe:
Germany:
@@ -30,7 +27,7 @@ Europe:
Maintainer: archive@ftp.sunet.se
Sweden:
ftp://ftp.matematik.su.se/pub/mirrors/shekel.mcl.cs.columbia.edu/pub/am-utils
- Maintainer: leifj@matematik.su.se
+ Maintainer: lifj@matematik.su.se
UK:
ftp://sunsite.org.uk/packages/am-utils
Maintainer: lmjm@icparc.ic.ac.uk
diff --git a/contrib/amd/NEWS b/contrib/amd/NEWS
index 57fa0c67ad20..f1df1e07a6be 100644
--- a/contrib/amd/NEWS
+++ b/contrib/amd/NEWS
@@ -1,51 +1,3 @@
-*** Notes specific to am-utils version 6.0:
-
-- updated or minor new ports:
- hppa2.0w-hp-hpux11.00,
- i386-pc-bsdi4.0
- i386-unknown-freebsd2.2.8
- i386-unknown-netbsd1.3.3
- i386-unknown-openbsd2.4
- mips-sgi-irix6.5
- powerpc-ibm-aix4.3.1.0
- i386-unknown-freebsd3.0 now supports nfs v.3
-
-- ctl-amd and ctl-hlfsd now compatible with RedHat's chkconfig utility
-
-- ctl-amd stop will now wait until amd is down
-
-- libamu.so completely self contained --- does not export any symbols which
- must be defined by the process linking with it. This is so shared
- libraries could be supported on systems that have restrictive shared
- libraries.
-
-- use latest autoconf, automake, and libtool (off of cygnus' CVS server) to
- support shared libraries on many more platforms.
-
-- posix code cleanups
-
-- bugs fixed:
- case insensitive host match in type:=nfsl
- correct swapped args to kill(2)
- try to avoid a race condition b/t mounting and unmounting
- yp_all support is found in libnsl in RH-5.1 systems
-
-*** Notes specific to am-utils version 6.0b1:
-
-- updated or minor new ports:
- - *-pc-linux-gnu (glibc2 systems such as RedHat 5.1)
- - sparc-sun-solaris2.7
- - i386-pc-solaris2.7
- - i386-unknown-freebsd3.0 (official release, post 4.4lite port)
- - sparc64-unknown-linux-gnu (RH 5.1 on Sun Sparc Ultra)
-
-- bugs fixed:
- - major memory leak in processing of /defaults
- - core dump if map_type given in amd.conf doesn't exist
- - memory leak in replacement yp_all
- - don't access uninitialized memory in DU 4.0
- - other smaller bugs, see ChangeLog
-
*** Notes specific to am-utils version 6.0a16:
- new ports:
diff --git a/contrib/amd/README b/contrib/amd/README
index b7d140626fd5..7ced70bb6571 100644
--- a/contrib/amd/README
+++ b/contrib/amd/README
@@ -1,12 +1,12 @@
# -*- text -*-
-This is the official version of am-utils.
+This is an alpha version of amd. "Buyers" beware!!!
See the file NEWS for news on this and previous releases.
-*** General Notes to alpha/beta testers:
+*** General Notes to alpha testers:
-[A] as alpha/beta testers, I expect you to be able to find certain things on
+[A] an an alpha testers, I expect you to be able to find certain things on
your own (especially look at the sources to figure out how things work).
[B] if you intend to modify any files, first find out if the file you want
diff --git a/contrib/amd/README.y2k b/contrib/amd/README.y2k
deleted file mode 100644
index 27ed5539969d..000000000000
--- a/contrib/amd/README.y2k
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- text -*-
- AM-UTILS YEAR-2000 COMPLIANCE
-
-Most likely am-utils is y2k compliant.
-
-I do not know for sure because I have not certified am-utils myself, nor do
-I have the time for it. I do not think that amd will be affected by y2k at
-all, because it does not do anything with dates other than print the date on
-the log file, in whatever format is provided by your os/libc --- especially
-the ctime(3) call.
-
-However, on Friday, September 18th 1998, Matthew Crosby <mcrosby@ms.com>
-reported that they evaluated 6.0a16 and found it to be compliant.
-
-Erez Zadok.
-Maintainer, am-utils package and AMD-DEV list.
-Email: amd-dev-owner@majordomo.cs.columbia.edu
-WWW: http://www.cs.columbia.edu/~ezk/am-utils/
diff --git a/contrib/amd/TODO b/contrib/amd/TODO
index 07fb5559678c..9d3b758cc4b7 100644
--- a/contrib/amd/TODO
+++ b/contrib/amd/TODO
@@ -67,7 +67,7 @@ correct new prototype.
use HAVE_SVC_GETREQSET instead of RPC_4.
-replace all "jsp" in *.[hc] $Id: TODO,v 1.1.1.1 1998/11/05 02:04:19 ezk Exp $ with ezk.
+replace all "jsp" in *.[hc] $Id$ with ezk.
use MNTTAB_FILE_NAME instead of MOUNTED
diff --git a/contrib/amd/amd/am_ops.c b/contrib/amd/amd/am_ops.c
index 2a042dfcbdc5..918c3f1462f8 100644
--- a/contrib/amd/amd/am_ops.c
+++ b/contrib/amd/amd/am_ops.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: am_ops.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
+ * $Id: am_ops.c,v 5.2.2.1 1992/02/09 15:08:17 jsp beta $
*
*/
@@ -315,7 +315,7 @@ reverse_option(const char *opt)
* Caller must eventually free the string being returned.
*/
static char *
-merge_opts(const char *opts1, const char *opts2)
+merge_opts(char *opts1, char *opts2)
{
mntent_t mnt2; /* place holder for opts2 */
char *newstr; /* new string to return (malloc'ed) */
@@ -327,7 +327,7 @@ merge_opts(const char *opts1, const char *opts2)
char *s1 = strdup(opts1); /* copy of opts1 to munge */
/* initialization */
- mnt2.mnt_opts = (char *) opts2;
+ mnt2.mnt_opts = opts2;
newstr = xmalloc(len);
newstr[0] = '\0';
diff --git a/contrib/amd/amd/amd.c b/contrib/amd/amd/amd.c
index 6f6a03dd19d3..3740529f0c99 100644
--- a/contrib/amd/amd/amd.c
+++ b/contrib/amd/amd/amd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amd.c,v 1.3 1998/11/14 03:13:19 obrien Exp $
+ * $Id: amd.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -55,29 +55,23 @@
struct amu_global_options gopt; /* where global options are stored */
char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */
-#if 0
char *progname; /* "amd" */
-#endif
char *hostdomain = "unknown.domain";
-#if 0
-char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
-#endif
-char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
+char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
+char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
char *endian = ARCH_ENDIAN; /* Big or Little endian */
char *cpu = HOST_CPU; /* CPU type */
char *PrimNetName; /* name of primary network */
char *PrimNetNum; /* number of primary network */
+int foreground = 1; /* This is the top-level server */
int immediate_abort; /* Should close-down unmounts be retried */
-int orig_umask = 022;
+int orig_umask;
int select_intr_valid;
jmp_buf select_intr;
-#if 0
pid_t mypid; /* Current process id */
serv_state amd_state;
-int foreground = 1; /* This is the top-level server */
-#endif
struct amd_stats amd_stats; /* Server statistics */
struct in_addr myipaddr; /* (An) IP address of this host */
time_t do_mapc_reload = 0; /* mapc_reload() call required? */
@@ -174,7 +168,7 @@ daemon_mode(void)
*/
for (;;)
pause();
- /* should never reach here */
+ /* should never reache here */
}
#ifdef HAVE_SIGACTION
sigaction(SIGQUIT, &osa, NULL);
@@ -187,7 +181,7 @@ daemon_mode(void)
*/
if (gopt.flags & CFM_PRINT_PID) {
if (STREQ(gopt.pid_file, "/dev/stdout")) {
- printf("%ld\n", (long) am_mypid);
+ printf("%ld\n", (long) mypid);
fflush(stdout);
/* do not fclose stdout */
} else {
@@ -196,7 +190,7 @@ daemon_mode(void)
f = fopen(gopt.pid_file, "w");
if (f) {
- fprintf(f, "%ld\n", (long) am_mypid);
+ fprintf(f, "%ld\n", (long) mypid);
(void) fclose(f);
} else {
fprintf(stderr, "cannot open %s (errno=%d)\n", gopt.pid_file, errno);
@@ -313,8 +307,6 @@ main(int argc, char *argv[])
char *domdot, *verstr;
int ppid = 0;
int error;
- char *progname = NULL; /* "amd" */
- char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
#ifdef HAVE_SIGACTION
struct sigaction sa;
#endif /* HAVE_SIGACTION */
@@ -342,14 +334,13 @@ main(int argc, char *argv[])
}
if (!progname)
progname = "amd";
- am_set_progname(progname);
/*
- * Initialize process id. This is kept
+ * Initialise process id. This is kept
* cached since it is used for generating
* and using file handles.
*/
- am_set_mypid();
+ mypid = getpid();
/*
* Get local machine name
@@ -368,18 +359,13 @@ main(int argc, char *argv[])
going_down(1);
}
-#ifdef DEBUG
- /* initialize debugging flags (Register AMQ, Enter daemon mode) */
- debug_flags = D_AMQ | D_DAEMON;
-#endif /* DEBUG */
-
/*
* Initialize global options structure.
*/
init_global_options();
/*
- * Partially initialize hostd[]. This
+ * Partially initialise hostd[]. This
* is completed in get_args().
*/
if ((domdot = strchr(hostname, '.'))) {
@@ -392,7 +378,6 @@ main(int argc, char *argv[])
hostdomain = domdot;
}
strcpy(hostd, hostname);
- am_set_hostname(hostname);
/*
* Trap interrupts for shutdowns.
@@ -534,7 +519,7 @@ main(int argc, char *argv[])
#endif /* DEBUG */
ppid = daemon_mode();
- sprintf(pid_fsname, "%s:(pid%ld)", am_get_hostname(), (long) am_mypid);
+ sprintf(pid_fsname, "%s:(pid%ld)", hostname, (long) mypid);
do_mapc_reload = clocktime() + ONE_HOUR;
@@ -543,7 +528,7 @@ main(int argc, char *argv[])
*/
error = mount_automounter(ppid);
if (error && ppid)
- kill(ppid, SIGALRM);
+ kill(SIGALRM, ppid);
going_down(error);
abort();
diff --git a/contrib/amd/amd/amd.h b/contrib/amd/amd/amd.h
index eb21c7e3984d..610dfe28e5e3 100644
--- a/contrib/amd/amd/amd.h
+++ b/contrib/amd/amd/amd.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amd.h,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: amd.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
*
*/
@@ -178,17 +178,18 @@ struct mnt_map {
/*
* Mounting a file system may take a significant period of time. The
- * problem is that if this is done in the main process thread then the
- * entire automounter could be blocked, possibly hanging lots of processes
- * on the system. Instead we use a continuation scheme to allow mounts to
- * be attempted in a sub-process. When the sub-process exits we pick up the
- * exit status (by convention a UN*X error number) and continue in a
- * notifier. The notifier gets handed a data structure and can then
- * determine whether the mount was successful or not. If not, it updates
- * the data structure and tries again until there are no more ways to try
- * the mount, or some other permanent error occurs. In the mean time no RPC
- * reply is sent, even after the mount is successful. We rely on the RPC
- * retry mechanism to resend the lookup request which can then be handled.
+ * problem is that if this is done in the main process thread then
+ * the entire automounter could be blocked, possibly hanging lots of
+ * processes on the system. Instead we use a continuation scheme to
+ * allow mounts to be attempted in a sub-process. When the sub-process
+ * exits we pick up the exit status (by convention a UN*X error number)
+ * and continue in a notifier. The notifier gets handed a data structure
+ * and can then determine whether the mount was successful or not. If
+ * not, it updates the data structure and tries again until there are no
+ * more ways to try the mount, or some other permanent error occurs.
+ * In the mean time no RPC reply is sent, even after the mount is succesful.
+ * We rely on the RPC retry mechanism to resend the lookup request which
+ * can then be handled.
*/
struct continuation {
char **ivec; /* Current mount info */
diff --git a/contrib/amd/amd/amfs_auto.c b/contrib/amd/amd/amfs_auto.c
index c6421bfb605e..0530142b6938 100644
--- a/contrib/amd/amd/amfs_auto.c
+++ b/contrib/amd/amd/amfs_auto.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_auto.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
+ * $Id: amfs_auto.c,v 1.1 1997-1998/06/30 19:22:30 ezk Exp ezk $
*
*/
@@ -477,7 +477,7 @@ try_mount(voidp mvp)
break
fi
if no error on this mount then
- this_error = initialize mount point
+ this_error = initialise mount point
fi
if no error on this mount and mount is delayed then
this_error = -1
@@ -496,7 +496,7 @@ try_mount(voidp mvp)
this_error = mount in foreground
fi
fi
- if an error occurred on this mount then
+ if an error occured on this mount then
update stats
save error in mount point
fi
@@ -657,7 +657,7 @@ amfs_auto_bgmount(struct continuation * cp, int mpe)
/*
* Will usually need to play around with the mount nodes
* file attribute structure. This must be done here.
- * Try and get things initialized, even if the fileserver
+ * Try and get things initialised, even if the fileserver
* is not known to be up. In the common case this will
* progress things faster.
*/
@@ -987,7 +987,7 @@ amfs_auto_lookuppn(am_node *mp, char *fname, int *error_return, int op)
}
/*
- * If an error occurred then return it.
+ * If an error occured then return it.
*/
if (error) {
#ifdef DEBUG
@@ -1128,7 +1128,6 @@ amfs_auto_lookuppn(am_node *mp, char *fname, int *error_return, int op)
memset((char *) &ap, 0, sizeof(am_opts));
pt = ops_match(&ap, *sp, "", mp->am_path, "/defaults",
mp->am_parent->am_mnt->mf_info);
- free_opts(&ap); /* don't leak */
if (pt == &amfs_error_ops) {
plog(XLOG_MAP, "failed to match defaults for \"%s\"", *sp);
} else {
@@ -1511,7 +1510,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
if (te_next) {
nfsentry *te_saved = te_next->ne_nextentry;
te_next->ne_nextentry = NULL; /* terminate "te" chain */
- te_next = te_saved; /* save rest of "te" for next iteration */
+ te_next = te_saved; /* save rest of "te" for next interation */
dp->dl_eof = FALSE; /* tell readdir there's more */
} else {
dp->dl_eof = TRUE; /* tell readdir that's it */
@@ -1565,7 +1564,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
if (te_next) {
nfsentry *te_saved = te_next->ne_nextentry;
te_next->ne_nextentry = NULL; /* terminate "te" chain */
- te_next = te_saved; /* save rest of "te" for next iteration */
+ te_next = te_saved; /* save rest of "te" for next interation */
dp->dl_eof = FALSE; /* tell readdir there's more */
}
ep = te; /* send next chunk of "te" chain */
diff --git a/contrib/amd/amd/amfs_direct.c b/contrib/amd/amd/amfs_direct.c
index 8df22b165a34..1558ae002392 100644
--- a/contrib/amd/amd/amfs_direct.c
+++ b/contrib/amd/amd/amfs_direct.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_direct.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
+ * $Id: amfs_direct.c,v 1.1 1997-1998/06/30 19:22:30 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/amd/amfs_error.c b/contrib/amd/amd/amfs_error.c
index e8fb3c10e23b..ccb037bf4594 100644
--- a/contrib/amd/amd/amfs_error.c
+++ b/contrib/amd/amd/amfs_error.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_error.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
+ * $Id: amfs_error.c,v 5.2.2.1 1992/02/09 15:08:21 jsp beta $
*
*/
diff --git a/contrib/amd/amd/amfs_host.c b/contrib/amd/amd/amfs_host.c
index e1ec4e9c0026..6be259de917d 100644
--- a/contrib/amd/amd/amfs_host.c
+++ b/contrib/amd/amd/amfs_host.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_host.c,v 1.1.1.1 1998/11/05 02:04:46 ezk Exp $
+ * $Id: amfs_host.c,v 5.2.2.2 1992/05/31 16:36:08 jsp Exp $
*
*/
@@ -256,7 +256,7 @@ fetch_fhandle(CLIENT * client, char *dir, am_nfs_handle_t *fhp, u_long nfs_versi
(SVC_IN_ARG_TYPE) &fhp->v2,
tv);
if (clnt_stat != RPC_SUCCESS) {
- const char *msg = clnt_sperrno(clnt_stat);
+ char *msg = clnt_sperrno(clnt_stat);
plog(XLOG_ERROR, "mountd rpc failed: %s", msg);
return EIO;
}
@@ -347,7 +347,7 @@ amfs_host_fmount(mntfs *mf)
* The original 10 second per try timeout is WAY too large, especially
* if we're only waiting 10 or 20 seconds max for the response.
* That would mean we'd try only once in 10 seconds, and we could
- * lose the transmit or receive packet, and never try again.
+ * lose the transmitt or receive packet, and never try again.
* A 2-second per try timeout here is much more reasonable.
* 09/28/92 Mike Mitchell, mcm@unx.sas.com
*/
@@ -392,7 +392,7 @@ amfs_host_fmount(mntfs *mf)
(SVC_IN_ARG_TYPE) & exlist,
tv2);
if (clnt_stat != RPC_SUCCESS) {
- const char *msg = clnt_sperrno(clnt_stat);
+ char *msg = clnt_sperrno(clnt_stat);
plog(XLOG_ERROR, "host_fmount rpc failed: %s", msg);
/* clnt_perror(client, "rpc"); */
error = EIO;
@@ -673,7 +673,7 @@ amfs_host_umounted(am_node *mp)
tv);
if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_SYSTEMERROR) {
/* RPC_SYSTEMERROR seems to be returned for no good reason ... */
- const char *msg = clnt_sperrno(clnt_stat);
+ char *msg = clnt_sperrno(clnt_stat);
plog(XLOG_ERROR, "unmount all from %s rpc failed: %s", host, msg, clnt_stat);
goto out;
}
diff --git a/contrib/amd/amd/amfs_inherit.c b/contrib/amd/amd/amfs_inherit.c
index 442115d65cdb..e9709bd5343c 100644
--- a/contrib/amd/amd/amfs_inherit.c
+++ b/contrib/amd/amd/amfs_inherit.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_inherit.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_inherit.c,v 5.2.2.1 1992/02/09 15:08:26 jsp beta $
*
*/
@@ -119,7 +119,7 @@ amfs_inherit_init(mntfs *mf)
/*
* Take the linked mount point and
- * propagate.
+ * propogate.
*/
static mntfs *
amfs_inherit_inherit(mntfs *mf)
diff --git a/contrib/amd/amd/amfs_link.c b/contrib/amd/amd/amfs_link.c
index 0daa334a6399..251c5ebb47f2 100644
--- a/contrib/amd/amd/amfs_link.c
+++ b/contrib/amd/amd/amfs_link.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_link.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_link.c,v 5.2.2.1 1992/02/09 15:09:04 jsp beta $
*
*/
diff --git a/contrib/amd/amd/amfs_linkx.c b/contrib/amd/amd/amfs_linkx.c
index 045f7971b6e7..e46206f57fe5 100644
--- a/contrib/amd/amd/amfs_linkx.c
+++ b/contrib/amd/amd/amfs_linkx.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_linkx.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_linkx.c,v 5.2.2.1 1992/02/09 15:09:04 jsp beta $
*
*/
@@ -101,3 +101,4 @@ amfs_linkx_mount(am_node *mp)
return 0;
}
+
diff --git a/contrib/amd/amd/amfs_nfsl.c b/contrib/amd/amd/amfs_nfsl.c
index 55e5c75337d9..8132afdeb71c 100644
--- a/contrib/amd/amd/amfs_nfsl.c
+++ b/contrib/amd/amd/amfs_nfsl.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_nfsl.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
+ * $Id: amfs_nfsl.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -99,7 +99,7 @@ amfs_nfsl_match(am_opts *fo)
struct stat stb;
if (!cp || !ho) {
- plog(XLOG_USER, "amfs_nfsl: host $fs and $rhost must be specified");
+ plog(XLOG_USER, "amfs_nfsl: nost $fs and $rhost must be specified");
return NULL;
}
@@ -109,7 +109,7 @@ amfs_nfsl_match(am_opts *fo)
* If link value exists (or same host), then perform amfs_link_match(),
* same as for linkx.
*/
- if (!STRCEQ(ho, am_get_hostname())) {
+ if (!STRCEQ(ho, hostname)) {
plog(XLOG_INFO, "amfs_nfsl: \"%s\" is not local host, using type:=nfs", ho);
return nfs_match(fo);
} else if (lstat(cp, &stb) < 0) {
@@ -228,7 +228,7 @@ amfs_nfsl_ffserver(mntfs *mf)
* If link value exists (or same host), then perform
* find_amfs_auto_srvr(), same as for linkx.
*/
- if (!STRCEQ(ho, am_get_hostname()) || lstat(cp, &stb) < 0) {
+ if (!STREQ(ho, hostname) || lstat(cp, &stb) < 0) {
return find_nfs_srvr(mf);
} else {
mf->mf_flags |= MFF_NFSLINK;
diff --git a/contrib/amd/amd/amfs_nfsx.c b/contrib/amd/amd/amfs_nfsx.c
index e67e8f5ced7b..272e10d59b07 100644
--- a/contrib/amd/amd/amfs_nfsx.c
+++ b/contrib/amd/amd/amfs_nfsx.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_nfsx.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_linxx.c,v 5.2.2.3 1992/05/31 16:13:07 jsp Exp $
*
*/
@@ -463,7 +463,7 @@ amfs_nfsx_fumount(mntfs *mf)
* If this node has not been messed with
* and there has been no error so far
* then try and unmount.
- * If an error had occurred then zero
+ * If an error had occured then zero
* the error code so that the remount
* only tries to unmount those nodes
* which had been successfully unmounted.
diff --git a/contrib/amd/amd/amfs_program.c b/contrib/amd/amd/amfs_program.c
index 04d7c54fe5d8..2bd077873cb5 100644
--- a/contrib/amd/amd/amfs_program.c
+++ b/contrib/amd/amd/amfs_program.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_program.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_program.c,v 5.2.2.1 1992/02/09 15:08:56 jsp beta $
*
*/
diff --git a/contrib/amd/amd/amfs_root.c b/contrib/amd/amd/amfs_root.c
index e2bd371cdaa5..3c1cd17cda9b 100644
--- a/contrib/amd/amd/amfs_root.c
+++ b/contrib/amd/amd/amfs_root.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_root.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_root.c,v 1.1 1997-1998/06/30 19:22:30 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/amd/amfs_toplvl.c b/contrib/amd/amd/amfs_toplvl.c
index e10c6a1ee388..f36c66fc96b0 100644
--- a/contrib/amd/amd/amfs_toplvl.c
+++ b/contrib/amd/amd/amfs_toplvl.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_toplvl.c,v 1.2 1998/12/27 06:24:45 ezk Exp $
+ * $Id: amfs_toplvl.c,v 1.1 1997-1998/06/30 19:22:30 ezk Exp ezk $
*
*/
@@ -158,8 +158,8 @@ mount_amfs_toplvl(char *dir, char *opts)
* Make a ``hostname'' string for the kernel
*/
sprintf(fs_hostname, "pid%ld@%s:%s",
- (long) (foreground ? am_mypid : getppid()),
- am_get_hostname(),
+ (long) (foreground ? mypid : getppid()),
+ hostname,
dir);
/*
* Most kernels have a name length restriction (64 bytes)...
diff --git a/contrib/amd/amd/amfs_union.c b/contrib/amd/amd/amfs_union.c
index df494acab193..95fc8fd6d5b5 100644
--- a/contrib/amd/amd/amfs_union.c
+++ b/contrib/amd/amd/amfs_union.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amfs_union.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amfs_union.c,v 1.1 1997-1998/06/30 19:22:30 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/amd/amq_subr.c b/contrib/amd/amd/amq_subr.c
index d6f9f8938f1e..87ede1be3cb5 100644
--- a/contrib/amd/amd/amq_subr.c
+++ b/contrib/amd/amd/amq_subr.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,11 +38,11 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_subr.c,v 1.2 1998/09/04 04:42:28 obrien Exp $
+ * $Id: amq_subr.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
/*
- * Auxiliary routines for amq tool
+ * Auxilliary routines for amq tool
*/
#ifdef HAVE_CONFIG_H
@@ -139,7 +139,7 @@ amqproc_setopt_1_svc(voidp argp, struct svc_req *rqstp)
case AMOPT_LOGFILE:
if (gopt.logfile && opt->as_str
&& STREQ(gopt.logfile, opt->as_str)) {
- if (switch_to_logfile(opt->as_str, orig_umask))
+ if (switch_to_logfile(opt->as_str))
rc = EINVAL;
} else {
rc = EACCES;
diff --git a/contrib/amd/amd/amq_svc.c b/contrib/amd/amd/amq_svc.c
index bdb1c16f35ae..5e4c9fd25084 100644
--- a/contrib/amd/amd/amq_svc.c
+++ b/contrib/amd/amd/amq_svc.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_svc.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: amq_svc.c,v 5.2.2.1 1992/02/09 15:09:26 jsp beta $
*
*/
diff --git a/contrib/amd/amd/autil.c b/contrib/amd/amd/autil.c
index 00ca8eaab0da..ca089bd17f5c 100644
--- a/contrib/amd/amd/autil.c
+++ b/contrib/amd/amd/autil.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: autil.c,v 1.2 1998/12/27 06:24:46 ezk Exp $
+ * $Id: autil.c,v 5.2.2.2 1992/03/07 17:52:06 jsp Exp $
*
*/
@@ -393,7 +393,7 @@ top:
goto top;
}
if (pid == 0) { /* child process (foreground==false) */
- am_set_mypid();
+ mypid = getpid();
foreground = 0;
} else { /* parent process, has one more child */
NumChild++;
diff --git a/contrib/amd/amd/clock.c b/contrib/amd/amd/clock.c
index 270401a03a7b..3c0494a5e7a0 100644
--- a/contrib/amd/amd/clock.c
+++ b/contrib/amd/amd/clock.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,14 +38,14 @@
*
* %W% (Berkeley) %G%
*
- * $Id: clock.c,v 1.1.1.1 1998/11/05 02:04:47 ezk Exp $
+ * $Id: clock.c,v 5.2.2.1 1992/02/09 15:08:20 jsp beta $
*
*/
/*
* Callouts.
*
- * Modeled on kernel object of the same name.
+ * Modelled on kernel object of the same name.
* See usual references.
*
* Use of a heap-based mechanism was rejected:
diff --git a/contrib/amd/amd/conf.c b/contrib/amd/amd/conf.c
index 109d0059b582..a97b1b18c42a 100644
--- a/contrib/amd/amd/conf.c
+++ b/contrib/amd/amd/conf.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: conf.c,v 1.2 1998/12/27 06:24:46 ezk Exp $
+ * $Id: conf.c,v 5.2.2.1 1992/02/09 15:08:23 jsp beta $
*
*/
@@ -373,7 +373,7 @@ gopt_debug_options(const char *val)
return 0;
#else /* not DEBUG */
fprintf(stderr, "%s: not compiled with DEBUG option -- sorry.\n",
- am_get_progname());
+ progname);
return 1;
#endif /* not DEBUG */
}
@@ -534,11 +534,6 @@ gopt_map_options(const char *val)
static int
gopt_map_type(const char *val)
{
- /* check if map type exist */
- if (!mapc_type_exists(val)) {
- fprintf(stderr, "conf: no such map type \"%s\"\n", val);
- return 1;
- }
gopt.map_type = strdup((char *)val);
return 0;
}
@@ -851,11 +846,6 @@ ropt_map_options(const char *val, cf_map_t *cfm)
static int
ropt_map_type(const char *val, cf_map_t *cfm)
{
- /* check if map type exist */
- if (!mapc_type_exists(val)) {
- fprintf(stderr, "conf: no such map type \"%s\"\n", val);
- return 1;
- }
cfm->cfm_type = strdup((char *)val);
return 0;
}
diff --git a/contrib/amd/amd/conf_parse.y b/contrib/amd/amd/conf_parse.y
index c34062bc8a19..2a9877a8fe4b 100644
--- a/contrib/amd/amd/conf_parse.y
+++ b/contrib/amd/amd/conf_parse.y
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: conf_parse.y,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: conf_parse.y,v 5.2.2.1 1992/02/09 15:09:35 jsp beta $
*
*/
diff --git a/contrib/amd/amd/conf_tok.l b/contrib/amd/amd/conf_tok.l
index 7128a2a4855c..0ec067bbf300 100644
--- a/contrib/amd/amd/conf_tok.l
+++ b/contrib/amd/amd/conf_tok.l
@@ -18,7 +18,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -39,7 +39,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: conf_tok.l,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: conf_tok.l,v 5.2.2.1 1992/02/09 15:09:36 jsp beta $
*
*/
@@ -70,7 +70,7 @@
#endif /* ECHO */
/*
- * There are some things that need to be defined only if using GNU flex.
+ * There are some things that need to be defined only if useing GNU flex.
* These must not be defined if using standard lex
*/
#ifdef FLEX_SCANNER
diff --git a/contrib/amd/amd/get_args.c b/contrib/amd/amd/get_args.c
index 607b3fb489f1..ef72fbfd30b5 100644
--- a/contrib/amd/amd/get_args.c
+++ b/contrib/amd/amd/get_args.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: get_args.c,v 1.2 1998/09/05 06:06:00 obrien Exp $
+ * $Id: get_args.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -60,12 +60,11 @@ char *conf_tag = NULL; /* default conf file tags to use */
int usage = 0;
int use_conf_file = 0; /* default don't use amd.conf file */
char *mnttab_file_name = NULL; /* symbol must be available always */
-#if 0
#ifdef DEBUG
int debug_flags = D_AMQ /* Register AMQ */
| D_DAEMON; /* Enter daemon mode */
#endif /* DEBUG */
-#endif
+
/*
* Return the version string (dynamic buffer)
@@ -138,7 +137,7 @@ get_args(int argc, char *argv[])
case 'a':
if (*optarg != '/') {
fprintf(stderr, "%s: -a option must begin with a '/'\n",
- am_get_progname());
+ progname);
exit(1);
}
gopt.auto_dir = optarg;
@@ -225,8 +224,7 @@ get_args(int argc, char *argv[])
#ifdef DEBUG
usage += debug_option(optarg);
#else /* not DEBUG */
- fprintf(stderr, "%s: not compiled with DEBUG option -- sorry.\n",
- am_get_progname());
+ fprintf(stderr, "%s: not compiled with DEBUG option -- sorry.\n", progname);
#endif /* not DEBUG */
break;
@@ -336,7 +334,7 @@ get_args(int argc, char *argv[])
# endif /* DEBUG */
#endif /* not MOUNT_TABLE_ON_FILE */
- if (switch_to_logfile(gopt.logfile, orig_umask) != 0)
+ if (switch_to_logfile(gopt.logfile) != 0)
plog(XLOG_USER, "Cannot switch logfile");
/*
@@ -364,7 +362,7 @@ show_usage:
\t[-k kernel_arch] [-l logfile%s\n\
\t[-t timeout.retrans] [-w wait_timeout] [-C cluster_name]\n\
\t[-o op_sys_ver] [-O op_sys_name]\n\
-\t[-F conf_file] [-T conf_tag]", am_get_progname(),
+\t[-F conf_file] [-T conf_tag]", progname,
#ifdef HAVE_SYSLOG
# ifdef LOG_DAEMON
"|\"syslog[:facility]\"]"
diff --git a/contrib/amd/amd/info_file.c b/contrib/amd/amd/info_file.c
index 1bd9c622ec27..55c24bdb5c23 100644
--- a/contrib/amd/amd/info_file.c
+++ b/contrib/amd/amd/info_file.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_file.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_file.c,v 5.2.2.1 1992/02/09 15:08:28 jsp beta $
*
*/
diff --git a/contrib/amd/amd/info_hesiod.c b/contrib/amd/amd/info_hesiod.c
index 88de89b8e4d7..a4607e151505 100644
--- a/contrib/amd/amd/info_hesiod.c
+++ b/contrib/amd/amd/info_hesiod.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_hesiod.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_hesiod.c,v 1.1 1997-1998/07/11 08:34:52 danny Exp danny $
*
*/
diff --git a/contrib/amd/amd/info_ldap.c b/contrib/amd/amd/info_ldap.c
index a5f1d7591632..e2f03674c5b0 100644
--- a/contrib/amd/amd/info_ldap.c
+++ b/contrib/amd/amd/info_ldap.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_ldap.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_ldap.c,v 5.2.2.1 1992/02/09 15:08:29 jsp beta $
*
*/
@@ -263,7 +263,7 @@ amu_ldap_rebind(ALD *a)
return (0);
}
}
- plog(XLOG_WARNING, "Exhausted list of ldap servers, looping.\n");
+ plog(XLOG_WARNING, "Exausted list of ldap servers, looping.\n");
}
plog(XLOG_USER, "Unable to (re)bind to any ldap hosts\n");
diff --git a/contrib/amd/amd/info_ndbm.c b/contrib/amd/amd/info_ndbm.c
index d8fd39ccc827..0b93fa652180 100644
--- a/contrib/amd/amd/info_ndbm.c
+++ b/contrib/amd/amd/info_ndbm.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_ndbm.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_ndbm.c,v 5.2.2.1 1992/02/09 15:08:31 jsp beta $
*
*/
diff --git a/contrib/amd/amd/info_nis.c b/contrib/amd/amd/info_nis.c
index 2e9a0b771f50..eceb73a04591 100644
--- a/contrib/amd/amd/info_nis.c
+++ b/contrib/amd/amd/info_nis.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_nis.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_nis.c,v 5.2.2.1 1992/02/09 15:08:32 jsp beta $
*
*/
@@ -52,7 +52,6 @@
#include <am_defs.h>
#include <amd.h>
-
/*
* NIS+ servers in NIS compat mode don't have yp_order()
*/
@@ -62,7 +61,6 @@ static int has_yp_order = FALSE;
int nis_reload(mnt_map *m, char *map, void (*fn) (mnt_map *, char *, char *));
int nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp);
int nis_init(mnt_map *m, char *map, time_t *tp);
-int nis_isup(mnt_map *m, char *map);
int nis_mtime(mnt_map *m, char *map, time_t *tp);
/* typedefs */
@@ -122,20 +120,27 @@ callback(int status, char *key, int kl, char *val, int vl, char *data)
if (status == YP_TRUE) {
- /* add to list of maps */
+ /*
+ * Add to list of maps
+ */
char *kp = strnsave(key, kl);
char *vp = strnsave(val, vl);
-
(*ncdp->ncd_fn) (ncdp->ncd_m, kp, vp);
- /* we want more ... */
+ /*
+ * We want more ...
+ */
return FALSE;
} else {
- /* NOMORE means end of map - otherwise log error */
+ /*
+ * NOMORE means end of map - otherwise log error
+ */
if (status != YP_NOMORE) {
- /* check what went wrong */
+ /*
+ * Check what went wrong
+ */
int e = ypprot_err(status);
#ifdef DEBUG
@@ -228,7 +233,7 @@ nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp)
YP_ORDER_OUTORDER_TYPE order;
/*
- * Make sure domain initialized
+ * Make sure domain initialised
*/
if (!gopt.nis_domain) {
int error = determine_nis_domain();
@@ -341,7 +346,7 @@ nis_mtime(mnt_map *m, char *map, time_t *tp)
* alternate code which avoids a bug in yp_all(). The bug in yp_all() is
* that it does not close a TCP connection to ypserv, and this ypserv runs
* out of open filedescriptors, getting into an infinite loop, thus all YP
- * clients eventually unbind and hang too.
+ * clients enevtually unbind and hang too.
*
* Systems known to be plagued with this bug:
* earlier SunOS 4.x
@@ -373,25 +378,16 @@ am_yp_all(char *indomain, char *inmap, struct ypall_callback *incallback)
incallback->data);
if (j != FALSE) /* terminate loop */
break;
-
- /*
- * We have to manually free all char ** arguments to yp_first/yp_next
- * outval must be freed *before* calling yp_next again, outkey can be
- * freed as outkey_old *after* the call (this saves one call to
- * strnsave).
- */
- XFREE(outval);
outkey_old = outkey;
outkeylen_old = outkeylen;
i = yp_next(indomain,
inmap,
outkey_old,
outkeylen_old,
- &outkey,
+ &outkey,
&outkeylen,
&outval,
&outvallen);
- XFREE(outkey_old);
} while (!i);
#ifdef DEBUG
if (i) {
diff --git a/contrib/amd/amd/info_nisplus.c b/contrib/amd/amd/info_nisplus.c
index bf681ac1681e..71f29e956c0b 100644
--- a/contrib/amd/amd/info_nisplus.c
+++ b/contrib/amd/amd/info_nisplus.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_nisplus.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_nisplus.c,v 5.2.2.1 1992/02/09 15:08:32 jsp beta $
*
*/
diff --git a/contrib/amd/amd/info_passwd.c b/contrib/amd/amd/info_passwd.c
index d27c9b3bea0f..32d92f4bf361 100644
--- a/contrib/amd/amd/info_passwd.c
+++ b/contrib/amd/amd/info_passwd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_passwd.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: info_passwd.c,v 5.2.2.1 1992/02/09 15:08:33 jsp beta $
*
*/
diff --git a/contrib/amd/amd/info_union.c b/contrib/amd/amd/info_union.c
index 00c254dad01a..7f757f978159 100644
--- a/contrib/amd/amd/info_union.c
+++ b/contrib/amd/amd/info_union.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: info_union.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: info_union.c,v 5.2.2.1 1992/02/09 15:08:34 jsp beta $
*
*/
diff --git a/contrib/amd/amd/map.c b/contrib/amd/amd/map.c
index 20e23c029c74..20320d923330 100644
--- a/contrib/amd/amd/map.c
+++ b/contrib/amd/amd/map.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: map.c,v 1.2 1998/12/27 06:24:47 ezk Exp $
+ * $Id: map.c,v 5.2.2.2 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -134,7 +134,7 @@ exported_ap_realloc_map(int nsize)
* Allocate a new mount slot and create
* a new node.
* Fills in the map number of the node,
- * but leaves everything else uninitialized.
+ * but leaves everything else uninitialised.
*/
am_node *
exported_ap_alloc(void)
@@ -297,7 +297,7 @@ mk_fattr(am_node *mp, nfsftype vntype)
/*
- * Initialize an allocated mount node.
+ * Initialise an allocated mount node.
* It is assumed that the mount node was b-zero'd
* before getting here so anything that would
* be set to zero isn't done here.
@@ -371,7 +371,7 @@ fh_to_mp3(am_nfs_fh *fhp, int *rp, int c_or_d)
* from an old kernel cached filehandle
* which is now out of date.
*/
- if (fp->fhh_pid != am_mypid)
+ if (fp->fhh_pid != mypid)
goto drop;
/*
@@ -511,7 +511,7 @@ mp_to_fh(am_node *mp, am_nfs_fh *fhp)
/*
* Take the process id
*/
- fp->fhh_pid = am_mypid;
+ fp->fhh_pid = mypid;
/*
* ... the map number
@@ -726,7 +726,7 @@ make_root_node(void)
root_node->am_mnt = root_mnt;
/*
- * Initialize the root
+ * Initialise the root
*/
if (root_mnt->mf_ops->fs_init)
(*root_mnt->mf_ops->fs_init) (root_mnt);
@@ -893,7 +893,7 @@ free_map_if_success(int rc, int term, voidp closure)
mf->mf_flags &= ~MFF_UNMOUNTING;
/*
- * If a timeout was deferred because the underlying filesystem
+ * If a timeout was defered because the underlying filesystem
* was busy then arrange for a timeout as soon as possible.
*/
if (mf->mf_flags & MFF_WANTTIMO) {
diff --git a/contrib/amd/amd/mapc.c b/contrib/amd/amd/mapc.c
index 70ebf3a5b9d1..de95e133404b 100644
--- a/contrib/amd/amd/mapc.c
+++ b/contrib/amd/amd/mapc.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mapc.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
+ * $Id: mapc.c,v 5.2.2.2 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -113,7 +113,7 @@ static char wildcard[] = "*";
typedef struct map_type map_type;
struct map_type {
char *name; /* Name of this map type */
- init_fn *init; /* Initialization */
+ init_fn *init; /* Initialisation */
reload_fn *reload; /* Reload or fill */
isup_fn *isup; /* Is service up or not? (1=up, 0=down) */
search_fn *search; /* Search for new entry */
@@ -350,32 +350,10 @@ mapc_showtypes(char *buf)
/*
- * Check if a map of a certain type exists.
- * Return 1 (true) if exists, 0 (false) if not.
- */
-int
-mapc_type_exists(const char *type)
-{
- map_type *mt;
-
- if (!type)
- return 0;
- for (mt = maptypes;
- mt < maptypes + sizeof(maptypes) / sizeof(maptypes[0]);
- mt++) {
- if (STREQ(type, mt->name))
- return 1;
- }
- return 0; /* not found anywhere */
-}
-
-
-/*
* Add key and val to the map m.
* key and val are assumed to be safe copies
*/
-void
-mapc_add_kv(mnt_map *m, char *key, char *val)
+void mapc_add_kv(mnt_map *m, char *key, char *val)
{
kv **h;
kv *n;
@@ -578,7 +556,7 @@ mapc_create(char *map, char *opt, const char *type)
default:
plog(XLOG_USER, "Ambiguous map cache type \"%s\"; using \"inc\"", opt);
alloc = MAPC_INC;
- /* fall-through... */
+ /* fallthrough... */
case MAPC_NONE:
case MAPC_INC:
case MAPC_ROOT:
diff --git a/contrib/amd/amd/mntfs.c b/contrib/amd/amd/mntfs.c
index 41689745c86b..31fa331d8d69 100644
--- a/contrib/amd/amd/mntfs.c
+++ b/contrib/amd/amd/mntfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mntfs.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
+ * $Id: mntfs.c,v 5.2.2.2 1992/08/02 10:42:21 jsp Exp $
*
*/
diff --git a/contrib/amd/amd/nfs_prot_svc.c b/contrib/amd/amd/nfs_prot_svc.c
index 42b24f517a77..e2b1c70cf208 100644
--- a/contrib/amd/amd/nfs_prot_svc.c
+++ b/contrib/amd/amd/nfs_prot_svc.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_prot_svc.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
+ * $Id: nfs_prot_svc.c,v 5.2.2.1 1992/02/09 15:09:30 jsp beta $
*
*/
diff --git a/contrib/amd/amd/nfs_start.c b/contrib/amd/amd/nfs_start.c
index d32e8d7f3799..e5740f69a956 100644
--- a/contrib/amd/amd/nfs_start.c
+++ b/contrib/amd/amd/nfs_start.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_start.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
+ * $Id: nfs_start.c,v 5.2.2.1 1992/02/09 15:08:51 jsp beta $
*
*/
diff --git a/contrib/amd/amd/nfs_subr.c b/contrib/amd/amd/nfs_subr.c
index 65bcc0d94ca5..3de086192209 100644
--- a/contrib/amd/amd/nfs_subr.c
+++ b/contrib/amd/amd/nfs_subr.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_subr.c,v 1.1.1.1 1998/11/05 02:04:48 ezk Exp $
+ * $Id: nfs_subr.c,v 5.2.2.1 1992/02/09 15:08:53 jsp beta $
*
*/
@@ -141,7 +141,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
#ifndef MNT2_NFS_OPT_SYMTTL
/*
* This code is needed to defeat Solaris 2.4's (and newer) symlink values
- * cache. It forces the last-modified time of the symlink to be current.
+ * cache. It forces the last-modifed time of the symlink to be current.
* It is not needed if the O/S has an nfs flag to turn off the
* symlink-cache at mount time (such as Irix 5.x and 6.x). -Erez.
*/
@@ -211,13 +211,6 @@ nfsproc_lookup_2_svc(nfsdiropargs *argp, struct svc_req *rqstp)
}
res.dr_status = nfs_error(error);
} else {
- /*
- * XXX: EXPERIMENTAL! Delay unmount of what was looked up. This
- * should reduce the chance for race condition between unmounting an
- * entry synchronously, and re-mounting it asynchronously.
- */
- if (ap->am_ttl < mp->am_ttl)
- ap->am_ttl = mp->am_ttl;
mp_to_fh(ap, &res.dr_u.dr_drok_u.drok_fhandle);
res.dr_u.dr_drok_u.drok_attributes = ap->am_fattr;
res.dr_status = NFS_OK;
diff --git a/contrib/amd/amd/ops_TEMPLATE.c b/contrib/amd/amd/ops_TEMPLATE.c
index e8e889b27ec1..7a60206b2ec1 100644
--- a/contrib/amd/amd/ops_TEMPLATE.c
+++ b/contrib/amd/amd/ops_TEMPLATE.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_TEMPLATE.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_TEMPLATE.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
diff --git a/contrib/amd/amd/ops_autofs.c b/contrib/amd/amd/ops_autofs.c
index 91015b0486ed..a566fc42ffb6 100644
--- a/contrib/amd/amd/ops_autofs.c
+++ b/contrib/amd/amd/ops_autofs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_autofs.c,v 1.2 1998/12/27 06:24:47 ezk Exp $
+ * $Id: ops_autofs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -53,7 +53,7 @@
#include <amd.h>
/*
- * KLUDGE: wrap whole file in HAVE_FS_AUTOFS, because
+ * CLUDGE: wrap whole file in HAVE_FS_AUTOFS, becasue
* not all systems with an automounter file system are supported
* by am-utils yet...
*/
@@ -76,7 +76,7 @@ static int mount_autofs(char *dir, char *opts);
static int autofs_mount_1_svc(struct mntrequest *mr, struct mntres *result, struct authunix_parms *cred);
static int autofs_unmount_1_svc(struct umntrequest *ur, struct umntres *result, struct authunix_parms *cred);
-/* external declarations */
+/* externam declarations */
extern bool_t xdr_mntrequest(XDR *, mntrequest *);
extern bool_t xdr_mntres(XDR *, mntres *);
extern bool_t xdr_umntrequest(XDR *, umntrequest *);
@@ -284,9 +284,8 @@ mount_autofs(char *dir, char *opts)
/*
* Make a ``hostname'' string for the kernel
*/
- sprintf(fs_hostname, "pid%ld@%s:%s",
- (long) (foreground ? am_mypid : getppid()),
- am_get_hostname(), dir);
+ sprintf(fs_hostname, "pid%ld@%s:%s", foreground ? mypid : getppid(),
+ hostname, dir);
/*
* Most kernels have a name length restriction.
@@ -482,7 +481,7 @@ out:
break
fi
if no error on this mount then
- this_error = initialize mount point
+ this_error = initialise mount point
fi
if no error on this mount and mount is delayed then
this_error = -1
@@ -501,7 +500,7 @@ out:
this_error = mount in foreground
fi
fi
- if an error occurred on this mount then
+ if an error occured on this mount then
update stats
save error in mount point
fi
@@ -662,7 +661,7 @@ autofs_bgmount(struct continuation * cp, int mpe)
/*
* Will usually need to play around with the mount nodes
* file attribute structure. This must be done here.
- * Try and get things initialized, even if the fileserver
+ * Try and get things initialised, even if the fileserver
* is not known to be up. In the common case this will
* progress things faster.
*/
@@ -712,7 +711,7 @@ autofs_bgmount(struct continuation * cp, int mpe)
cp->retry = TRUE;
}
- if (!this_error) {
+ if (!this_error)
if (p->fs_flags & FS_MBACKGROUND) {
mf->mf_flags |= MFF_MOUNTING; /* XXX */
#ifdef DEBUG
@@ -738,7 +737,6 @@ autofs_bgmount(struct continuation * cp, int mpe)
cp->retry = TRUE;
}
}
- }
if (this_error >= 0) {
if (this_error > 0) {
@@ -861,7 +859,7 @@ autofs_lookuppn(am_node *mp, char *fname, int *error_return, int op)
char *auto_opts; /* Automount options */
int error = 0; /* Error so far */
char path_name[MAXPATHLEN]; /* General path name buffer */
- char apath[MAXPATHLEN]; /* autofs path (added space) */
+ char apath[MAXPATHLEN]; /* authofs path (added space) */
char *pfname; /* Path for database lookup */
struct continuation *cp; /* Continuation structure if need to mount */
int in_progress = 0; /* # of (un)mount in progress */
@@ -879,11 +877,10 @@ autofs_lookuppn(am_node *mp, char *fname, int *error_return, int op)
*/
if (amd_state == Finishing) {
#ifdef DEBUG
- if ((mf = mp->am_mnt) == 0 || mf->mf_ops == &amfs_direct_ops) {
+ if ((mf = mp->am_mnt) == 0 || mf->mf_ops == &amfs_direct_ops)
dlog("%s mount ignored - going down", fname);
- } else {
+ else
dlog("%s/%s mount ignored - going down", mp->am_path, fname);
- }
#endif /* DEBUG */
ereturn(ENOENT);
}
@@ -993,7 +990,7 @@ autofs_lookuppn(am_node *mp, char *fname, int *error_return, int op)
}
/*
- * If an error occurred then return it.
+ * If an error occured then return it.
*/
if (error) {
#ifdef DEBUG
@@ -1134,7 +1131,6 @@ autofs_lookuppn(am_node *mp, char *fname, int *error_return, int op)
memset((char *) &ap, 0, sizeof(am_opts));
pt = ops_match(&ap, *sp, "", mp->am_path, "/defaults",
mp->am_parent->am_mnt->mf_info);
- free_opts(&ap); /* don't leak */
if (pt == &amfs_error_ops) {
plog(XLOG_MAP, "failed to match defaults for \"%s\"", *sp);
} else {
diff --git a/contrib/amd/amd/ops_cachefs.c b/contrib/amd/amd/ops_cachefs.c
index 40ca3565fbda..0c40085ada6b 100644
--- a/contrib/amd/amd/ops_cachefs.c
+++ b/contrib/amd/amd/ops_cachefs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_cachefs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_cachefs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
diff --git a/contrib/amd/amd/ops_cdfs.c b/contrib/amd/amd/ops_cdfs.c
index 05de46175400..3a143e21a4bd 100644
--- a/contrib/amd/amd/ops_cdfs.c
+++ b/contrib/amd/amd/ops_cdfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_cdfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_cdfs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/ops_efs.c b/contrib/amd/amd/ops_efs.c
index 095c2d4fcf66..4f915f764554 100644
--- a/contrib/amd/amd/ops_efs.c
+++ b/contrib/amd/amd/ops_efs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_efs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_efs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/ops_lofs.c b/contrib/amd/amd/ops_lofs.c
index 9331bf64e99e..6555db59c1c4 100644
--- a/contrib/amd/amd/ops_lofs.c
+++ b/contrib/amd/amd/ops_lofs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_lofs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_lofs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/ops_mfs.c b/contrib/amd/amd/ops_mfs.c
index b6a32ba25ece..f93c30b1ed78 100644
--- a/contrib/amd/amd/ops_mfs.c
+++ b/contrib/amd/amd/ops_mfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_mfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_mfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_nfs.c b/contrib/amd/amd/ops_nfs.c
index bad0bd9421a1..a7006b4869cd 100644
--- a/contrib/amd/amd/ops_nfs.c
+++ b/contrib/amd/amd/ops_nfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_nfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_nfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
diff --git a/contrib/amd/amd/ops_nfs3.c b/contrib/amd/amd/ops_nfs3.c
index 19d6533a6b6d..5db0713dbd49 100644
--- a/contrib/amd/amd/ops_nfs3.c
+++ b/contrib/amd/amd/ops_nfs3.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_nfs3.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_nfs3.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_nullfs.c b/contrib/amd/amd/ops_nullfs.c
index 6f560a845b53..bf2009f87b46 100644
--- a/contrib/amd/amd/ops_nullfs.c
+++ b/contrib/amd/amd/ops_nullfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_nullfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_nullfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_pcfs.c b/contrib/amd/amd/ops_pcfs.c
index 3ff67b1cf3b8..e46b7112aff8 100644
--- a/contrib/amd/amd/ops_pcfs.c
+++ b/contrib/amd/amd/ops_pcfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_pcfs.c,v 1.1.1.1 1998/11/05 02:04:50 ezk Exp $
+ * $Id: ops_pcfs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/ops_tfs.c b/contrib/amd/amd/ops_tfs.c
index 44a0d11136cf..97cd18c23217 100644
--- a/contrib/amd/amd/ops_tfs.c
+++ b/contrib/amd/amd/ops_tfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_tfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_tfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_tmpfs.c b/contrib/amd/amd/ops_tmpfs.c
index 1fed46a04335..ce1b4fd3948f 100644
--- a/contrib/amd/amd/ops_tmpfs.c
+++ b/contrib/amd/amd/ops_tmpfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_tmpfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_tmpfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_ufs.c b/contrib/amd/amd/ops_ufs.c
index bf18f6fc3f79..9883af156c35 100644
--- a/contrib/amd/amd/ops_ufs.c
+++ b/contrib/amd/amd/ops_ufs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_ufs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_ufs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/ops_umapfs.c b/contrib/amd/amd/ops_umapfs.c
index af139a7cbd90..b2dcd7258b63 100644
--- a/contrib/amd/amd/ops_umapfs.c
+++ b/contrib/amd/amd/ops_umapfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_umapfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_umapfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_unionfs.c b/contrib/amd/amd/ops_unionfs.c
index 07f9eef10294..24f7e1f1cdd8 100644
--- a/contrib/amd/amd/ops_unionfs.c
+++ b/contrib/amd/amd/ops_unionfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_unionfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_unionfs.c,v 5.2.2.3 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -52,4 +52,4 @@
#include <am_defs.h>
#include <amd.h>
-/* FEEL FREE TO IMPLEMENT THIS... :-) */
+/* FEEL FREE TO INPLEMENT THIS... :-) */
diff --git a/contrib/amd/amd/ops_xfs.c b/contrib/amd/amd/ops_xfs.c
index acc555ba4059..1b4aab4d89a2 100644
--- a/contrib/amd/amd/ops_xfs.c
+++ b/contrib/amd/amd/ops_xfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: ops_xfs.c,v 1.1.1.1 1998/11/05 02:04:51 ezk Exp $
+ * $Id: ops_xfs.c,v 5.2.2.1 1992/02/09 15:09:08 jsp beta $
*
*/
diff --git a/contrib/amd/amd/opts.c b/contrib/amd/amd/opts.c
index 907e55c35597..294cdb799a4a 100644
--- a/contrib/amd/amd/opts.c
+++ b/contrib/amd/amd/opts.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: opts.c,v 1.2 1998/12/27 06:24:48 ezk Exp $
+ * $Id: opts.c,v 5.2.2.4 1992/08/02 10:42:21 jsp Exp $
*
*/
@@ -91,7 +91,7 @@ struct functable {
};
/*
- * FORWARD DEFINITION:
+ * FORWARD DEFINITSION:
*/
static int f_in_network(char *);
static int f_netgrp(char *);
@@ -106,7 +106,7 @@ static struct am_opts fs_static; /* copy of the options to play with */
static char NullStr[] = "<NULL>";
static char nullstr[] = "";
static char *opt_dkey = NullStr;
-static char *opt_host = nullstr; /* XXX: was the global hostname */
+static char *opt_host = hostname;
static char *opt_hostd = hostd;
static char *opt_key = nullstr;
static char *opt_keyd = nullstr;
@@ -1050,7 +1050,7 @@ expand_op(opt_apply *p, int sel_p)
}
/*
- * Check that the search was successful
+ * Check that the search was succesful
*/
if (!op->name) {
/*
@@ -1104,7 +1104,7 @@ out:
}
/*
- * Save the expansion
+ * Save the exansion
*/
*p->opt = strdup(expbuf);
}
@@ -1219,9 +1219,6 @@ eval_fs_opts(am_opts *fo, char *opts, char *g_opts, char *path, char *key, char
memset((voidp) vars, 0, sizeof(vars));
memset((voidp) fo, 0, sizeof(*fo));
- /* set hostname */
- opt_host = (char *) am_get_hostname();
-
/*
* Set key, map & path before expansion
*/
@@ -1263,7 +1260,7 @@ eval_fs_opts(am_opts *fo, char *opts, char *g_opts, char *path, char *key, char
ok = FALSE;
/*
- * Normalize remote host name.
+ * Normalise remote host name.
* 1. Expand variables
* 2. Normalize relative to host tables
* 3. Strip local domains from the remote host
diff --git a/contrib/amd/amd/restart.c b/contrib/amd/amd/restart.c
index cd7d8424af50..572df86b06d1 100644
--- a/contrib/amd/amd/restart.c
+++ b/contrib/amd/amd/restart.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: restart.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: restart.c,v 5.2.2.2 1992/08/02 10:42:21 jsp Exp $
*
*/
diff --git a/contrib/amd/amd/rpc_fwd.c b/contrib/amd/amd/rpc_fwd.c
index 8f308b809705..7f3c59b81d78 100644
--- a/contrib/amd/amd/rpc_fwd.c
+++ b/contrib/amd/amd/rpc_fwd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: rpc_fwd.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: rpc_fwd.c,v 5.2.2.1 1992/02/09 15:09:01 jsp beta $
*
*/
diff --git a/contrib/amd/amd/sched.c b/contrib/amd/amd/sched.c
index a917c3cda502..ffbe2c810de9 100644
--- a/contrib/amd/amd/sched.c
+++ b/contrib/amd/amd/sched.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: sched.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: sched.c,v 5.2.2.1 1992/02/09 15:09:02 jsp beta $
*
*/
@@ -127,7 +127,7 @@ run_task(task_fun tf, voidp ta, cb_fun cf, voidp ca)
p->wchan = (voidp) p;
#ifdef HAVE_SIGACTION
- sigemptyset(&new); /* initialize signal set we wish to block */
+ sigemptyset(&new); /* initialise signal set we wish to block */
sigaddset(&new, SIGCHLD); /* only block on SIGCHLD */
sigprocmask(SIG_BLOCK, &new, &mask);
#else /* not HAVE_SIGACTION */
@@ -235,7 +235,7 @@ do_task_notify(void)
* Do callback if it exists
*/
if (p->cb_fun) {
- /* these two trigraphs will ensure compatibility with strict POSIX.1 */
+ /* these two trigraphs will ensure compatibity with strict POSIX.1 */
(*p->cb_fun) (WIFEXITED(p->w) ? WEXITSTATUS(p->w) : 0,
WIFSIGNALED(p->w) ? WTERMSIG(p->w) : 0,
p->cb_closure);
diff --git a/contrib/amd/amd/srvr_amfs_auto.c b/contrib/amd/amd/srvr_amfs_auto.c
index df2ffdf545db..e77c59181157 100644
--- a/contrib/amd/amd/srvr_amfs_auto.c
+++ b/contrib/amd/amd/srvr_amfs_auto.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: srvr_amfs_auto.c,v 1.1.1.1 1998/11/05 02:04:49 ezk Exp $
+ * $Id: srvr_amfs_auto.c,v 5.2.2.1 1992/02/09 15:09:05 jsp beta $
*
*/
diff --git a/contrib/amd/amd/srvr_nfs.c b/contrib/amd/amd/srvr_nfs.c
index 5a56d9d53206..88e174d33902 100644
--- a/contrib/amd/amd/srvr_nfs.c
+++ b/contrib/amd/amd/srvr_nfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: srvr_nfs.c,v 1.2 1998/09/14 08:20:37 obrien Exp $
+ * $Id: srvr_nfs.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -489,7 +489,7 @@ nfs_keepalive(voidp v)
nfs_pinged);
/*
- * See if a hard error occurred
+ * See if a hard error occured
*/
switch (error) {
case ENETDOWN:
@@ -571,7 +571,7 @@ nfs_srvr_port(fserver *fs, u_short * port, voidp wchan)
if (error < 0 && wchan && !(fs->fs_flags & FSF_WANT)) {
/*
* If a wait channel is supplied, and no
- * error has yet occurred, then arrange
+ * error has yet occured, then arrange
* that a wakeup is done on the wait channel,
* whenever a wakeup is done on this fs node.
* Wakeup's are done on the fs node whenever
@@ -663,14 +663,18 @@ find_nfs_srvr(mntfs *mf)
}
#endif /* MNTTAB_OPT_PROTO */
-#ifdef HAVE_NFS_NFSV2_H
- /* allow overriding if nfsv2 option is specified in mount options */
- if (hasmntopt(&mnt, "nfsv2")) {
- nfs_version = (u_long) 2; /* nullify any ``vers=X'' statements */
- nfs_proto = "udp"; /* nullify any ``proto=tcp'' stmts */
- plog(XLOG_WARNING, "found compatiblity option \"nfsv2\": set options vers=2, proto=udp for host %s", host);
+/* XXX: do we want to do this unconditionally of #define's? */
+/* #if defined(MNTTAB_OPT_VERS ) && defined( MNTTAB_OPT_PROTO ) */
+ {
+ char *nfsv2_opt = hasmntopt(&mnt, "nfsv2");
+ if (nfsv2_opt) {
+ nfs_version = (unsigned long)2; /* nullify any ``vers=X'' statements */
+ nfs_proto = "udp"; /* nullify any ``proto=tcp'' stmts */
+ plog(XLOG_WARNING, "found compatiblity option \"nfsv2\": set options"
+ " vers=2, proto=udp for host %s", host);
+ }
}
-#endif /* HAVE_NFS_NFSV2_H */
+/*#endif*/ /* MNTTAB_OPT_VERS && MNTTAB_OPT_PROTO */
/*
* lookup host address and canonical name
@@ -759,7 +763,7 @@ find_nfs_srvr(mntfs *mf)
nfs_version, nfs_proto, host);
/*
- * Try to find an existing fs server structure for this host.
+ * Try to find an existing fs server stucture for this host.
* Note that differing versions or protocols have their own structures.
* XXX: Need to fix the ping mechanism to actually use the NFS protocol
* chosen here (right now it always uses datagram sockets).
diff --git a/contrib/amd/amq/amq.8 b/contrib/amd/amq/amq.8
index b7d3c7b72e10..4181cea77f31 100644
--- a/contrib/amd/amq/amq.8
+++ b/contrib/amd/amq/amq.8
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amq.8,v 1.3 1998/09/12 04:04:57 obrien Exp $
+.\" $Id: amq.8,v 1.2 1998/09/05 06:38:19 obrien Exp $
.\"
.Dd March 16, 1991
.Dt AMQ 8
@@ -92,7 +92,7 @@ For security reasons, this must be the same log file which
.Nm amd
used when started. This option is therefore only useful to
refresh
-.Nm amd Ns \'s
+.Nm amd's
open file handle on the log file, so that it can be rotated and compressed via
daily cron jobs.
.It Fl m
@@ -152,7 +152,7 @@ that had registered itself on a different RPC
.Ar program_number
and apply all other operations to that instance of the automounter.
This is useful when running multiple copies of
-.Nm amd ,
+.Nmamd ,
and need to manage each one separately.
If not specified,
.Nm amq
@@ -193,7 +193,7 @@ be in the
.Pa /etc/rpc
database.
.Sh SEE ALSO
-.Xr amd.conf 5 ,
+.Xr amd.conf 8 ,
.Xr amd 8 ,
.Xr ctl-amd 8
.Sh AUTHORS
diff --git a/contrib/amd/amq/amq.c b/contrib/amd/amq/amq.c
index a8f069654b77..bd81d4f3516c 100644
--- a/contrib/amd/amq/amq.c
+++ b/contrib/amd/amq/amq.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
+ * $Id: amq.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -54,7 +54,7 @@ char copyright[] = "\
@(#)Copyright (c) 1990 The Regents of the University of California.\n\
@(#)All rights reserved.\n";
#if __GNUC__ < 2
-static char rcsid[] = "$Id: amq.c,v 1.2 1998/08/23 22:52:08 obrien Exp $";
+static char rcsid[] = "$Id: amq.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* __GNUC__ < 2 */
#endif /* not lint */
@@ -66,9 +66,7 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#include <amq.h>
/* locals */
-#if 0
char *progname;
-#endif
static int flush_flag;
static int minfo_flag;
static int getpid_flag;
@@ -88,7 +86,7 @@ static char *def_server = localhost;
extern int optind;
extern char *optarg;
-/* forward declarations */
+/* forward decalrations */
#ifdef HAVE_TRANSPORT_TYPE_TLI
static CLIENT *get_secure_amd_client(char *host, struct timeval *tv, int *sock);
static int amq_bind_resv_port(int td, u_short *pp);
@@ -97,13 +95,10 @@ static int privsock(int ty);
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
/* dummy variables */
-#if 0
char hostname[MAXHOSTNAMELEN];
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
/* structures */
enum show_opt {
@@ -314,7 +309,6 @@ main(int argc, char *argv[])
struct hostent *hp;
int nodefault = 0;
struct timeval tv;
- char *progname = NULL;
#ifndef HAVE_TRANSPORT_TYPE_TLI
enum clnt_stat cs;
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
@@ -332,7 +326,6 @@ main(int argc, char *argv[])
}
if (!progname)
progname = "amq";
- am_set_progname(progname);
/*
* Parse arguments
@@ -419,7 +412,7 @@ main(int argc, char *argv[])
fprintf(stderr, "\
Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
\t[-l logfile|\"syslog\"] [-x log_flags] [-D dbg_opts] [-M mapent]\n\
-\t[-P prognum] [-T] [-U]\n", am_get_progname());
+\t[-P prognum] [-T] [-U]\n", progname);
exit(1);
}
@@ -441,8 +434,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
* Get address of server
*/
if ((hp = gethostbyname(server)) == 0 && !STREQ(server, localhost)) {
- fprintf(stderr, "%s: Can't get address of %s\n",
- am_get_progname(), server);
+ fprintf(stderr, "%s: Can't get address of %s\n", progname, server);
exit(1);
}
memset(&server_addr, 0, sizeof server_addr);
@@ -477,7 +469,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
cs = pmap_ping(&server_addr);
if (cs == RPC_TIMEDOUT) {
fprintf(stderr, "%s: failed to contact portmapper on host \"%s\". %s\n",
- am_get_progname(), server, clnt_sperrno(cs));
+ progname, server, clnt_sperrno(cs));
exit(1);
}
@@ -495,7 +487,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
}
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
if (!clnt) {
- fprintf(stderr, "%s: ", am_get_progname());
+ fprintf(stderr, "%s: ", progname);
clnt_pcreateerror(server);
exit(1);
}
@@ -510,12 +502,10 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = debug_opts;
rc = amqproc_setopt_1(&opt, clnt);
if (rc && *rc < 0) {
- fprintf(stderr, "%s: daemon not compiled for debug\n",
- am_get_progname());
+ fprintf(stderr, "%s: daemon not compiled for debug\n", progname);
errs = 1;
} else if (!rc || *rc > 0) {
- fprintf(stderr, "%s: debug setting for \"%s\" failed\n",
- am_get_progname(), debug_opts);
+ fprintf(stderr, "%s: debug setting for \"%s\" failed\n", progname, debug_opts);
errs = 1;
}
}
@@ -530,8 +520,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = xlog_optstr;
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: setting log level to \"%s\" failed\n",
- am_get_progname(), xlog_optstr);
+ fprintf(stderr, "%s: setting log level to \"%s\" failed\n", progname, xlog_optstr);
errs = 1;
}
}
@@ -546,8 +535,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = amq_logfile;
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: setting logfile to \"%s\" failed\n",
- am_get_progname(), amq_logfile);
+ fprintf(stderr, "%s: setting logfile to \"%s\" failed\n", progname, amq_logfile);
errs = 1;
}
}
@@ -562,8 +550,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = "";
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: amd on %s cannot flush the map cache\n",
- am_get_progname(), server);
+ fprintf(stderr, "%s: amd on %s cannot flush the map cache\n", progname, server);
errs = 1;
}
}
@@ -583,8 +570,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
show_mi(ml, Full, &mwid, &dwid, &twid);
} else {
- fprintf(stderr, "%s: amd on %s cannot provide mount info\n",
- am_get_progname(), server);
+ fprintf(stderr, "%s: amd on %s cannot provide mount info\n", progname, server);
}
}
@@ -601,8 +587,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
errno = *rc;
else
errno = ETIMEDOUT;
- fprintf(stderr, "%s: could not start new ", am_get_progname());
- perror("automount point");
+ fprintf(stderr, "%s: could not start new ", progname);
+ perror("autmount point");
}
}
@@ -615,8 +601,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
fputs(*spp, stdout);
XFREE(*spp);
} else {
- fprintf(stderr, "%s: failed to get version information\n",
- am_get_progname());
+ fprintf(stderr, "%s: failed to get version information\n", progname);
errs = 1;
}
}
@@ -629,7 +614,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
if (ip && *ip) {
printf("%d\n", *ip);
} else {
- fprintf(stderr, "%s: failed to get PID of amd\n", am_get_progname());
+ fprintf(stderr, "%s: failed to get PID of amd\n", progname);
errs = 1;
}
}
@@ -661,11 +646,11 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
dwid, dwid, "What");
show_mt(mt, Stats, &mwid, &dwid, &twid);
} else {
- fprintf(stderr, "%s: %s not automounted\n", am_get_progname(), fs);
+ fprintf(stderr, "%s: %s not automounted\n", progname, fs);
}
xdr_pri_free((XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (caddr_t) mtp);
} else {
- fprintf(stderr, "%s: ", am_get_progname());
+ fprintf(stderr, "%s: ", progname);
clnt_perror(clnt, server);
errs = 1;
}
@@ -680,7 +665,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
if (ms) {
show_ms(ms);
} else {
- fprintf(stderr, "%s: ", am_get_progname());
+ fprintf(stderr, "%s: ", progname);
clnt_perror(clnt, server);
errs = 1;
}
@@ -705,13 +690,13 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
}
} else {
- fprintf(stderr, "%s: ", am_get_progname());
+ fprintf(stderr, "%s: ", progname);
clnt_perror(clnt, server);
errs = 1;
}
}
exit(errs);
- return errs; /* should never reach here */
+ return errs; /* should never reache here */
}
@@ -808,7 +793,7 @@ get_secure_amd_client(char *host, struct timeval *tv, int *sock)
NULL);
if (cs == RPC_TIMEDOUT) {
fprintf(stderr, "%s: failed to contact portmapper on host \"%s\". %s\n",
- am_get_progname(), host, clnt_sperrno(cs));
+ progname, host, clnt_sperrno(cs));
exit(1);
}
}
@@ -826,12 +811,12 @@ get_secure_amd_client(char *host, struct timeval *tv, int *sock)
if (!rpcb_getaddr(amd_program_number, AMQ_VERSION, nc, &nb, host)) {
/*
- * don't print error messages here, since amd might legitimately
+ * don't pring error messages here, since amd might legitimately
* serve udp only
*/
goto tryudp;
}
- /* Create privileged TCP socket */
+ /* Create priviledged TCP socket */
*sock = t_open(nc->nc_device, O_RDWR, 0);
if (*sock < 0) {
@@ -867,7 +852,7 @@ tryudp:
clnt_spcreateerror("couldn't get amd address on udp"));
return NULL;
}
- /* create privileged UDP socket */
+ /* create priviledged UDP socket */
*sock = t_open(nc->nc_device, O_RDWR, 0);
if (*sock < 0) {
diff --git a/contrib/amd/amq/amq.h b/contrib/amd/amq/amq.h
index 15ee2aa1527a..98f73831a49f 100644
--- a/contrib/amd/amq/amq.h
+++ b/contrib/amd/amq/amq.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq.h,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
+ * $Id: amq.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/amq/amq_clnt.c b/contrib/amd/amq/amq_clnt.c
index 606377b369cd..7220cec2fef4 100644
--- a/contrib/amd/amq/amq_clnt.c
+++ b/contrib/amd/amq/amq_clnt.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_clnt.c,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
+ * $Id: amq_clnt.c,v 5.2.2.1 1992/02/09 15:09:24 jsp beta $
*
*/
diff --git a/contrib/amd/amq/amq_xdr.c b/contrib/amd/amq/amq_xdr.c
index 33093b5f0dfe..79a729424830 100644
--- a/contrib/amd/amq/amq_xdr.c
+++ b/contrib/amd/amq/amq_xdr.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_xdr.c,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
+ * $Id: amq_xdr.c,v 5.2.2.1 1992/02/09 15:09:23 jsp beta $
*
*/
diff --git a/contrib/amd/amq/pawd.c b/contrib/amd/amq/pawd.c
index 3479929075e0..86ed55f118c4 100644
--- a/contrib/amd/amq/pawd.c
+++ b/contrib/amd/amq/pawd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: pawd.c,v 1.2 1998/12/27 06:24:50 ezk Exp $
+ * $Id: pawd.c,v 5.2.2.1 1992/02/09 15:09:16 jsp beta $
*
*/
@@ -59,14 +59,11 @@
#include <amq.h>
/* dummy variables */
-#if 0
char *progname;
char hostname[MAXHOSTNAMELEN];
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
/* statics */
static char *localhost="localhost";
@@ -296,3 +293,4 @@ main(int argc, char *argv[])
}
exit(0);
}
+
diff --git a/contrib/amd/conf/checkmount/checkmount_bsd44.c b/contrib/amd/conf/checkmount/checkmount_bsd44.c
index b3bd572246ed..80276e63a7e9 100644
--- a/contrib/amd/conf/checkmount/checkmount_bsd44.c
+++ b/contrib/amd/conf/checkmount/checkmount_bsd44.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: checkmount_bsd44.c,v 1.1.1.1 1998/11/05 02:04:33 ezk Exp $
+ * $Id: checkmount_bsd44.c,v 5.2.2.2 1992/05/31 16:35:45 jsp Exp $
*
*/
diff --git a/contrib/amd/conf/mtab/mtab_bsd.c b/contrib/amd/conf/mtab/mtab_bsd.c
index 0476df57a4ad..100d7d5d6c3d 100644
--- a/contrib/amd/conf/mtab/mtab_bsd.c
+++ b/contrib/amd/conf/mtab/mtab_bsd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mtab_bsd.c,v 1.1.1.1 1998/11/05 02:04:37 ezk Exp $
+ * $Id: mtab_bsd.c,v 5.2.2.2 1992/11/12 23:29:14 jsp Exp $
*
*/
diff --git a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h
index f767ffa94820..e39ff1b711c5 100644
--- a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h
+++ b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_prot_freebsd2.h,v 1.2 1998/08/27 07:33:23 obrien Exp $
+ * $Id: nfs_prot_freebsd2.h,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
diff --git a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h
index 070ada089ff1..0c319d39b60d 100644
--- a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h
+++ b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_prot_freebsd3.h,v 1.5 1999/01/13 20:03:57 obrien Exp $
+ * $Id: nfs_prot_freebsd3.h,v 1.2 1998/08/27 07:33:23 obrien Exp $
*
*/
@@ -153,29 +153,65 @@ typedef writeargs nfswriteargs;
/*
*
- * FreeBSD-3.0-RELEASE has NFS V3. Older versions had it only defined
- * in the rpcgen source file. If you are on an older system, and you
- * want NFSv3 support, you need to regenerate the rpcsvc header files as
- * follows:
- * cd /usr/include/rpcsvc
- * rpcgen -h -C -DWANT_NFS3 mount.x
- * rpcgen -h -C -DWANT_NFS3 nfs_prot.x
- * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
- * macro below. If the code doesn't compile, upgrade to the latest 3.0
- * version...
+ * FreeBSD 3.0 has NFS V3, but you need to regenrate the rpcsc header files
+ * as follows:
+ * cd /usr/local/rpcsvc
+ * rpcgen -DWANT_NFS3 mount.x
+ * rpcgen -DWANT_NFS3 nfs_prot.x
+ * But that's not expected of everyone, plus there are additional things
+ * needed so I define everything that's neede for NFS V3 here.
*/
#ifdef NFSMNT_NFSV3
# define MOUNT_NFS3 MOUNT_NFS
# define MNTOPT_NFS3 "nfs"
-/*
- * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
- * (or the one generated by rpcgen) lacks the proper full definition,
- * listed below. A special macro (aux/macros/struct_nfs_fh3.m4) searches
- * for this special name before other names.
- */
-struct nfs_fh3_freebsd3 {
+#ifdef COMMENT_OUT
+#define FHSIZE3 64 /* size in bytes of a file handle (v3) */
+#define NFS3_FHSIZE 64
+#define MOUNTVERS3 ((unsigned long)(3))
+#define NFS_V3 ((unsigned long)(3))
+#endif /* COMMENT_OUT */
+
+#ifdef COMMENT_OUT
+typedef struct {
+ u_int fhandle3_len;
+ char *fhandle3_val;
+} fhandle3;
+
+enum mountstat3 {
+ MNT3_OK = 0,
+ MNT3ERR_PERM = 1,
+ MNT3ERR_NOENT = 2,
+ MNT3ERR_IO = 5,
+ MNT3ERR_ACCES = 13,
+ MNT3ERR_NOTDIR = 20,
+ MNT3ERR_INVAL = 22,
+ MNT3ERR_NAMETOOLONG = 63,
+ MNT3ERR_NOTSUPP = 10004,
+ MNT3ERR_SERVERFAULT = 10006
+};
+typedef enum mountstat3 mountstat3;
+
+struct mountres3_ok {
+ fhandle3 fhandle;
+ struct {
+ u_int auth_flavors_len;
+ int *auth_flavors_val;
+ } auth_flavors;
+};
+typedef struct mountres3_ok mountres3_ok;
+
+struct mountres3 {
+ mountstat3 fhs_status;
+ union {
+ mountres3_ok mountinfo;
+ } mountres3_u;
+};
+typedef struct mountres3 mountres3;
+#endif /* COMMENT_OUT */
+
+struct nfs_fh3 {
u_int fh3_length;
union nfs_fh3_u {
struct nfs_fh3_i {
@@ -184,11 +220,7 @@ struct nfs_fh3_freebsd3 {
char data[NFS3_FHSIZE];
} fh3_u;
};
-typedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
-
-/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
- their special searching. So restore the standard name. */
-typedef struct nfs_fh3_freebsd3 nfs_fh3;
+typedef struct nfs_fh3 nfs_fh3;
#endif /* NFSMNT_NFSV3 */
diff --git a/contrib/amd/conf/transp/transp_sockets.c b/contrib/amd/conf/transp/transp_sockets.c
index e30612f17084..45aa01eb782c 100644
--- a/contrib/amd/conf/transp/transp_sockets.c
+++ b/contrib/amd/conf/transp/transp_sockets.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: transp_sockets.c,v 1.2 1998/11/10 16:23:41 ezk Exp $
+ * $Id: transp_sockets.c,v 5.2.2.2 1992/07/18 18:57:03 jsp Exp jsp $
*
* Socket specific utilities.
* -Erez Zadok <ezk@cs.columbia.edu>
@@ -206,10 +206,12 @@ create_nfs_service(int *soNFSp, u_short *nfs_portp, SVCXPRT **nfs_xprtp, void (*
plog(XLOG_FATAL, "Can't create privileged nfs port");
return 1;
}
+
if ((*nfs_xprtp = svcudp_create(*soNFSp)) == NULL) {
plog(XLOG_FATAL, "cannot create rpc/udp service");
return 2;
}
+
if (!svc_register(*nfs_xprtp, NFS_PROGRAM, NFS_VERSION, dispatch_fxn, 0)) {
plog(XLOG_FATAL, "unable to register (NFS_PROGRAM, NFS_VERSION, 0)");
return 3;
diff --git a/contrib/amd/conf/umount/umount_bsd44.c b/contrib/amd/conf/umount/umount_bsd44.c
index c58657be8c92..4e241b388d1b 100644
--- a/contrib/amd/conf/umount/umount_bsd44.c
+++ b/contrib/amd/conf/umount/umount_bsd44.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: umount_bsd44.c,v 1.1.1.1 1998/11/05 02:04:43 ezk Exp $
+ * $Id: umount_bsd44.c,v 5.2.2.2 1993/01/27 07:32:45 jsp Exp $
*
*/
diff --git a/contrib/amd/doc/am-utils.texi b/contrib/amd/doc/am-utils.texi
index b1e12afa8ac4..ca545031e180 100644
--- a/contrib/amd/doc/am-utils.texi
+++ b/contrib/amd/doc/am-utils.texi
@@ -38,7 +38,7 @@
@c
@c %W% (Berkeley) %G%
@c
-@c $Id: am-utils.texi,v 1.2 1998/12/27 06:25:16 ezk Exp $
+@c $Id: am-utils.texi,v 6.0 1997/02/09 15:11:50 ezk beta $
@c
@setfilename am-utils.info
@@ -684,7 +684,6 @@ am-utils, not all systems listed here have been verified working for all
features.
@multitable {Auto-Configured System Name} {Config} {Compile} {Amd} {NFS3} {Shlib} {Hlfsd}
-@c @multitable @columnfractions .5 .1 .1 .1 .1 .1
@item @b{Auto-Configured System Name}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@@ -692,59 +691,51 @@ features.
@item @b{alpha-dec-osf2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab ? @tab no @tab ?
+@tab yes @tab yes @tab yes @tab @tab @tab
@item @b{alpha-dec-osf4.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab @tab
@item @b{alphaev5-unknown-linux-gnu}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{hppa1.0-hp-hpux11.00}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab no @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab no @tab @tab
@item @b{hppa1.1-hp-hpux10.10}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab no @tab
@item @b{hppa1.1-hp-hpux10.20}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab no @tab
@item @b{hppa1.1-hp-hpux9.01}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{hppa1.1-hp-hpux9.05}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{hppa1.1-hp-hpux9.07}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{hppa2.0w-hp-hpux11.00}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{i386-pc-bsdi2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{i386-pc-bsdi3.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{i386-pc-bsdi3.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
-
-@item @b{i386-pc-bsdi4.0}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{i386-pc-solaris2.5.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@@ -754,173 +745,117 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab yes
-@item @b{i386-pc-solaris2.7}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab yes
-
@item @b{i386-unknown-freebsd2.1.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{i386-unknown-freebsd2.2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i386-unknown-freebsd2.2.6}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i386-unknown-freebsd2.2.7}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i386-unknown-freebsd2.2.8}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{i386-unknown-freebsd3.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{i386-unknown-netbsd1.2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{i386-unknown-netbsd1.3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{i386-unknown-netbsd1.3.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{i386-unknown-netbsd1.3.2}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{i386-unknown-netbsd1.3.3}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{i386-unknown-openbsd2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{i386-unknown-openbsd2.2}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{i386-unknown-openbsd2.3}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{i386-unknown-openbsd2.4}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{i486-ncr-sysv4.3.03}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab ? @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab @tab yes @tab @tab
@item @b{i486-pc-linux-gnulibc1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i486-pc-linux-gnuoldld}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
-@item @b{i586-pc-linux-gnu}
+@item @b{i586-pc-linux-gnulinc1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i586-pc-linux-gnulibc1}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{i686-pc-linux-gnu}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
-
-@item @b{i686-pc-linux-gnulibc1}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{m68k-hp-hpux9.00}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{m68k-sun-sunos4.1.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{m68k-next-nextstep3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{mips-dec-ultrix4.3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{mips-sgi-irix5.2}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab ? @tab ? @tab ? @tab ? @tab ? @tab ?
+@tab @tab @tab @tab @tab @tab
@item @b{mips-sgi-irix5.3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab @tab
@item @b{mips-sgi-irix6.2}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab @tab
@item @b{mips-sgi-irix6.4}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
-
-@item @b{mips-sgi-irix6.5}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab ? @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{powerpc-ibm-aix4.1.5.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no/broken @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{powerpc-ibm-aix4.2.1.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab no/broken @tab ?
-
-@item @b{powerpc-ibm-aix4.3.1.0}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab ? @tab yes @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab @tab
@item @b{rs6000-ibm-aix3.2}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{rs6000-ibm-aix3.2.5}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{rs6000-ibm-aix4.1.4.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no/broken @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{rs6000-ibm-aix4.1.5.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab no/broken @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{sparc-sun-solaris2.3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab @tab
@item @b{sparc-sun-solaris2.4}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-sun-solaris2.5}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab yes @tab yes @tab
@item @b{sparc-sun-solaris2.5.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@@ -930,45 +865,33 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab yes
-@item @b{sparc-sun-solaris2.7}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab yes @tab yes @tab yes
-
@item @b{sparc-sun-sunos4.1.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-sun-sunos4.1.3}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-sun-sunos4.1.3C}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-sun-sunos4.1.3_U1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-sun-sunos4.1.4}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-unknown-linux-gnulibc1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab n/a @tab yes @tab
@item @b{sparc-unknown-netbsd1.2E}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab ? @tab ? @tab ?
-
-@item @b{sparc-unknown-netbsd1.2G}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab ? @tab ? @tab ?
-
-@item @b{sparc64-unknown-linux-gnu}
-@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
-@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
+@tab yes @tab yes @tab yes @tab @tab @tab
@end multitable
@@ -3473,9 +3396,8 @@ if that is required in an argument. There is no way to escape or change
the quote character.
To run the program @samp{rvdmount} with a host name and filesystem as
-arguments would be specified by
-@samp{fs:=$@{autodir@}$@{path@};mount:="/etc/rvdmount rvdmount fserver
-$@{fs@}"}.
+arguments would be specified by @samp{mount:="/etc/rvdmount rvdmount
+fserver $@{path@}"}.
The first element in the array is taken as the pathname of the program
to execute. The other members of the array form the argument vector to
diff --git a/contrib/amd/doc/stamp-vti b/contrib/amd/doc/stamp-vti
index 05e718a873bc..225ecdbacb37 100644
--- a/contrib/amd/doc/stamp-vti
+++ b/contrib/amd/doc/stamp-vti
@@ -1,3 +1,3 @@
-@set UPDATED 27 December 1998
-@set EDITION 6.0
-@set VERSION 6.0
+@set UPDATED 22 April 1998
+@set EDITION 6.0a16
+@set VERSION 6.0a16
diff --git a/contrib/amd/doc/texinfo.tex b/contrib/amd/doc/texinfo.tex
index 2b8a9cccbda5..2ce38f94db16 100644
--- a/contrib/amd/doc/texinfo.tex
+++ b/contrib/amd/doc/texinfo.tex
@@ -1,65 +1,48 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-%
-% Load plain if necessary, i.e., if running under initex.
+%% TeX macros to handle Texinfo files.
+%% $Id: texinfo.tex,v 2.218 1997/07/26 19:12:35 karl Exp $
+
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
+% 94, 95, 96, 97 Free Software Foundation, Inc.
+
+%This texinfo.tex file is free software; you can redistribute it and/or
+%modify it under the terms of the GNU General Public License as
+%published by the Free Software Foundation; either version 2, or (at
+%your option) any later version.
+
+%This texinfo.tex file is distributed in the hope that it will be
+%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%General Public License for more details.
+
+%You should have received a copy of the GNU General Public License
+%along with this texinfo.tex file; see the file COPYING. If not, write
+%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+%Boston, MA 02111-1307, USA.
+
+
+%In other words, you are welcome to use, share and improve this program.
+%You are forbidden to forbid anyone else to use, share and improve
+%what you give them. Help stamp out software-hoarding!
+
+
+% Send bug reports to bug-texinfo@prep.ai.mit.edu.
+% Please include a *precise* test case in each bug report.
+
+
+% Make it possible to create a .fmt file just by loading this file:
+% if the underlying format is not loaded, start by loading it now.
+% Added by gildea November 1993.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-%
-\def\texinfoversion{1998-11-13}%
-%
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
-% Free Software Foundation, Inc.
-%
-% This texinfo.tex file is free software; you can redistribute it and/or
-% modify it under the terms of the GNU General Public License as
-% published by the Free Software Foundation; either version 2, or (at
-% your option) any later version.
-%
-% This texinfo.tex file is distributed in the hope that it will be
-% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-% General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with this texinfo.tex file; see the file COPYING. If not, write
-% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-% Boston, MA 02111-1307, USA.
-%
-% In other words, you are welcome to use, share and improve this program.
-% You are forbidden to forbid anyone else to use, share and improve
-% what you give them. Help stamp out software-hoarding!
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
-% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
-% ftp://tug.org/tex/texinfo.tex
-% ftp://ctan.org/macros/texinfo/texinfo.tex
-% (and all CTAN mirrors, finger ctan@ctan.org for a list).
-% The texinfo.tex in the texinfo distribution itself could well be out
-% of date, so if that's what you're using, please check.
-%
-% Send bug reports to bug-texinfo@gnu.org.
-% Please include a precise test case in each bug report,
-% including a complete document with which we can reproduce the problem.
-%
-% To process a Texinfo manual with TeX, it's most reliable to use the
-% texi2dvi shell script that comes with the distribution. For simple
-% manuals, however, you can get away with:
-% tex foo.texi
-% texindex foo.??
-% tex foo.texi
-% tex foo.texi
-% dvips foo.dvi -o # or whatever, to process the dvi file.
-% The extra runs of TeX get the cross-reference information correct.
-% Sometimes one run after texindex suffices, and sometimes you need more
-% than two; texi2dvi does it as many times as necessary.
-
-\message{Loading texinfo [version \texinfoversion]:}
+
+% This automatically updates the version number based on RCS.
+\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
+\deftexinfoversion$Revision: 2.218 $
+\message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}%
+\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
\catcode`+=\active \catcode`\_=\active}
% Save some parts of plain tex whose names we will redefine.
@@ -71,17 +54,24 @@
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
+\let\ptexequiv = \equiv
\let\ptexi=\i
\let\ptexlbrace=\{
\let\ptexrbrace=\}
\let\ptexstar=\*
\let\ptext=\t
-% We never want plain's outer \+ definition in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
\message{Basics,}
@@ -91,20 +81,18 @@
% starts a new line in the output.
\newlinechar = `^^J
-% Set up fixed words for English if not already set.
-\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
-\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
-\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
-\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
-\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
-\ifx\putwordon\undefined \gdef\putwordon{on}\fi
-\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
-\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
-\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
-\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
-\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
-\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi
-\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
+% Set up fixed words for English.
+\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
+\def\putwordInfo{Info}%
+\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
+\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
+\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
+\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
+\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
+\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
+\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
+\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
+\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
% Ignore a token.
%
@@ -125,21 +113,11 @@
% since that produces some useless output on the terminal.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\ifx\eTeXversion\undefined
\def\loggingall{\tracingcommands2 \tracingstats2
\tracingpages1 \tracingoutput1 \tracinglostchars1
\tracingmacros2 \tracingparagraphs1 \tracingrestores1
\showboxbreadth\maxdimen\showboxdepth\maxdimen
}%
-\else
-\def\loggingall{\tracingcommands3 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \tracingscantokens1 \tracingassigns1 \tracingifs1
- \tracinggroups1 \tracingnesting2
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
-}%
-\fi
% For @cropmarks command.
% Do @cropmarks to get crop marks.
@@ -150,10 +128,15 @@
% Dimensions to add cropmarks at corners.
% Added by P. A. MacKay, 12 Nov. 1986
%
-\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
-\newdimen\topandbottommargin \topandbottommargin=.75in
+\newdimen\cornerlong \newdimen\cornerthick
+\newdimen\topandbottommargin
+\newdimen\outerhsize \newdimen\outervsize
+\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
+\outerhsize=7in
+%\outervsize=9.5in
+% Alternative @smallbook page size is 9.25in
+\outervsize=9.25in
+\topandbottommargin=.75in
% Main output routine.
\chardef\PAGE = 255
@@ -187,16 +170,13 @@
\shipout\vbox{%
\ifcropmarks \vbox to \outervsize\bgroup
\hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
\vskip\topandbottommargin
\line\bgroup
\hfil % center the page within the outer (page) hsize.
@@ -219,15 +199,13 @@
\hfil\egroup % end of (centering) \line\bgroup
\vskip\topandbottommargin plus1fill minus1fill
\boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
}%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
\egroup % \vbox from first cropmarks clause
\fi
}% end of \shipout\vbox
@@ -343,11 +321,11 @@
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\ifENV\errmessage{Still within an environment. Type Return to continue.}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Press RETURN to continue.}
+\newhelp\EMsimple{Type <Return> to continue.}
\outer\def\begin{\parsearg\beginxxx}
@@ -406,7 +384,7 @@
% @@ prints an @
% Kludge this until the fonts are right (grr).
-\def\@{{\tt\char64}}
+\def\@{{\tt \char '100}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
@@ -416,8 +394,8 @@
%\def\'{{'}}
% Used to generate quoted braces.
-\def\mylbrace {{\tt\char123}}
-\def\myrbrace {{\tt\char125}}
+\def\mylbrace {{\tt \char '173}}
+\def\myrbrace {{\tt \char '175}}
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
@@ -454,18 +432,6 @@
\fi\fi
}
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
@@ -475,11 +441,14 @@
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
+% @enddots{} is an end-of-sentence ellipsis.
+\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
+
% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=3000 }
+\gdef\!{!\spacefactor=3000 }
% @? is an end-of-sentence query.
-\def\?{?\spacefactor=3000 }
+\gdef\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
@@ -563,7 +532,7 @@ where each line of input produces a line of output.}
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
%\prevdepth=-1000pt
%}}
@@ -604,34 +573,12 @@ where each line of input produces a line of output.}
\let\br = \par
-% @dots{} output an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in a typewriter
-% font as three actual period characters.
-%
-\def\dots{%
- \leavevmode
- \hbox to 1.5em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \leavevmode
- \hbox to 2em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
- }%
- \spacefactor=3000
-}
+% @dots{} output some dots
+\def\dots{$\ldots$}
% @page forces the start of a new page
-%
+
\def\page{\par\vfill\supereject}
% @exdent text....
@@ -698,10 +645,10 @@ where each line of input produces a line of output.}
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-\def\comment{\begingroup \catcode`\^^M=\other%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
-\commentxxx}
-{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
+\parsearg \commentxxx}
+
+\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
\let\c=\comment
@@ -798,6 +745,12 @@ where each line of input produces a line of output.}
\def\menu{\doignore{menu}}
\def\direntry{\doignore{direntry}}
+% Also ignore @macro ... @end macro. The user must run texi2dvi,
+% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
+\def\macro{\doignore{macro}}
+\let\unmacro = \comment
+
+
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\let\dircategory = \comment
@@ -809,9 +762,7 @@ where each line of input produces a line of output.}
\ignoresections
%
% Define a command to swallow text until we reach `@end #1'.
- % This @ is a catcode 12 token (that is the normal catcode of @ in
- % this texinfo.tex file). We change the catcode of @ below to match.
- \long\def\doignoretext##1@end #1{\enddoignore}%
+ \long\def\doignoretext##1\end #1{\enddoignore}%
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10
@@ -820,16 +771,6 @@ where each line of input produces a line of output.}
\catcode`\{ = 9
\catcode`\} = 9
%
- % We must not have @c interpreted as a control sequence.
- \catcode`\@ = 12
- %
- % Make the letter c a comment character so that the rest of the line
- % will be ignored. This way, the document can have (for example)
- % @c @end ifinfo
- % and the @end ifinfo will be properly ignored.
- % (We've just changed @ to catcode 12.)
- \catcode`\c = 14
- %
% And now expand that command.
\doignoretext
}
@@ -849,7 +790,7 @@ where each line of input produces a line of output.}
\immediate\write16{If you are running another version of TeX, relax.}
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
\immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
\immediate\write16{If you are stuck with version 3.0, run the}
\immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
\immediate\write16{ to use a workaround.}
@@ -922,9 +863,6 @@ where each line of input produces a line of output.}
%
% Do not execute instructions in @tex
\def\tex{\doignore{tex}}%
- % Do not execute macro definitions.
- % `c' is a comment character, so the word `macro' will get cut off.
- \def\macro{\doignore{ma}}%
}
% @set VAR sets the variable VAR to an empty value.
@@ -959,35 +897,16 @@ where each line of input produces a line of output.}
% @value{foo} gets the text saved in variable foo.
%
-{
- \catcode`\_ = \active
- %
- % We might end up with active _ or - characters in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}. So \let any
- % such active characters to their normal equivalents.
- \gdef\value{\begingroup
- \catcode`\-=12 \catcode`\_=12
- \indexbreaks \let_\normalunderscore
- \valuexxx}
-}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
-
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we \let\value to this in \indexdummies). Ones
-% whose names contain - or _ still won't work, but we can't do anything
-% about that. The command has to be fully expandable, since the result
-% winds up in the index file. This means that if the variable's value
-% contains other Texinfo commands, it's almost certain it will fail
-% (although perhaps we could fix that with sufficient work to do a
-% one-level expansion on the result, instead of complete).
-%
-\def\expandablevalue#1{%
+\def\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \valuexxx}
+\def\valuexxx#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- {[No value for ``#1'']}%
+ {\{No value for ``#1''\}}%
\else
\csname SET#1\endcsname
\fi
-}
+\endgroup}
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
@@ -1074,23 +993,33 @@ where each line of input produces a line of output.}
\def\bullet{\implicitmath\ptexbullet\implicitmath}
\def\minus{\implicitmath-\implicitmath}
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+\def\donoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\setref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
+\def\unnumbnoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
+\def\appendixnoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
% @refill is a no-op.
\let\refill=\relax
-% If working on a large document in chapters, it is convenient to
-% be able to disable indexing, cross-referencing, and contents, for test runs.
-% This is done with @novalidate (before @setfilename).
-%
-\newif\iflinks \linkstrue % by default we want the aux files.
-\let\novalidate = \linksfalse
-
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
- \iflinks
- \readauxfile
- \fi % \openindices needs to do some work in any case.
+ \readauxfile
+ \opencontents
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
@@ -1106,25 +1035,30 @@ where each line of input produces a line of output.}
\comment % Ignore the actual filename.
}
-% Called from \setfilename.
-%
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
+% \def\macroxxx#1#2 \end macro{%
+% \expandafter\gdef\macrotemp#1{#2}%
+% \endgroup}
+
+%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
+%\def\linemacroxxx#1#2 \end linemacro{%
+%\let\parsearg=\relax
+%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
+%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
+%\expandafter\gdef\macrotempx#1{#2}%
+%\endgroup}
+
+%\def\butfirst#1{}
+
\message{fonts,}
+
% Font-change commands.
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% Texinfo supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
@@ -1196,12 +1130,11 @@ where each line of input produces a line of output.}
% Do not make many font distinctions in general in the index, since they
% aren't very useful.
\setfont\ninett\ttshape{9}{1000}
-\setfont\ninettsl\ttslshape{10}{900}
\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\itshape{9}{1000}
-\setfont\indsl\slshape{9}{1000}
+\setfont\indit\slshape{9}{1000}
+\let\indsl=\indit
\let\indtt=\ninett
-\let\indttsl=\ninettsl
+\let\indttsl=\ninett
\let\indsf=\indrm
\let\indbf=\indrm
\setfont\indsc\scshape{10}{900}
@@ -1303,7 +1236,7 @@ where each line of input produces a line of output.}
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}}
-\def\titlefont#1{{\titlefonts\rm #1}}
+\def\titlefont#1{{\titlefonts #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@@ -1330,10 +1263,6 @@ where each line of input produces a line of output.}
%
\textfonts
-% Define these so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
@@ -1348,14 +1277,13 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
\let\i=\smartitalic
-\let\var=\smartslanted
-\let\dfn=\smartslanted
+\let\var=\smartitalic
+\let\dfn=\smartitalic
\let\emph=\smartitalic
-\let\cite=\smartslanted
+\let\cite=\smartitalic
\def\b#1{{\bf #1}}
\let\strong=\b
@@ -1372,22 +1300,20 @@ where each line of input produces a line of output.}
\null
}
\let\ttfont=\t
-\def\samp#1{`\tclose{#1}'\null}
+\def\samp #1{`\tclose{#1}'\null}
\setfont\smallrm\rmshape{8}{1000}
\font\smallsy=cmsy9
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
\kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+ \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
% The old definition, with no lozenge:
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-% @file, @option are the same as @samp.
\let\file=\samp
-\let\option=\samp
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
@@ -1422,18 +1348,20 @@ where each line of input produces a line of output.}
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
- \catcode`\-=\active
- \catcode`\_=\active
- %
- \global\def\code{\begingroup
- \catcode`\-=\active \let-\codedash
- \catcode`\_=\active \let_\codeunder
- \codex
- }
- %
- % If we end up with any active - characters when handling the index,
- % just treat them as a normal -.
- \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+\catcode`\-=\active
+\catcode`\_=\active
+\catcode`\|=\active
+\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
+% The following is used by \doprintindex to insure that long function names
+% wrap around. It is necessary for - and _ to be active before the index is
+% read from the file, as \entry parses the arguments long before \code is
+% ever called. -- mycroft
+% _ is always active; and it shouldn't be \let = to an _ that is a
+% subscript character anyway. Then, @cindex @samp{_} (for example)
+% fails. --karl
+\global\def\indexbreaks{%
+ \catcode`\-=\active \let-\realdash
+}
}
\def\realdash{-}
@@ -1474,10 +1402,8 @@ where each line of input produces a line of output.}
\else{\tclose{\kbdfont\look}}\fi
\else{\tclose{\kbdfont\look}}\fi}
-% For @url, @env, @command quotes seem unnecessary, so use \code.
+% @url. Quotes do not seem necessary, so use \code.
\let\url=\code
-\let\env=\code
-\let\command=\code
% @uref (abbreviation for `urlref') takes an optional second argument
% specifying the text to display. First (mandatory) arg is the url.
@@ -1495,7 +1421,7 @@ where each line of input produces a line of output.}
% rms does not like the angle brackets --karl, 17may97.
% So now @email is just like @uref.
-%\def\email#1{\angleleft{\tt #1}\angleright}
+%\def\email#1{$\langle${\tt #1}$\rangle$}
\let\email=\uref
% Check if we are currently using a typewriter font. Since all the
@@ -1506,7 +1432,8 @@ where each line of input produces a line of output.}
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+% argument is to make the input look right: @dmn{pt} instead of
+% @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
@@ -1517,14 +1444,11 @@ where each line of input produces a line of output.}
% Polish suppressed-l. --karl, 22sep96.
%\def\l#1{{\li #1}\null}
-% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
+% Use of \lowercase was suggested.
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
-% @acronym downcases the argument and prints in smallcaps.
-\def\acronym#1{{\smallcaps \lowercase{#1}}}
-
% @pounds{} is a sterling sign.
\def\pounds{{\it\$}}
@@ -1538,20 +1462,15 @@ where each line of input produces a line of output.}
\newif\ifseenauthor
\newif\iffinishedtitlepage
-% Do an implicit @contents or @shortcontents after @end titlepage if the
-% user says @contentsaftertitlepage or @shortcontentsaftertitlepage.
-%
-\newif\ifsetcontentsaftertitlepage
- \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
-\newif\ifsetshortcontentsaftertitlepage
- \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-
\def\shorttitlepage{\parsearg\shorttitlepagezzz}
\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\def\titlepage{\begingroup \parindent=0pt \textfonts
\let\subtitlerm=\tenrm
+% I deinstalled the following change because \cmr12 is undefined.
+% This change was not in the ChangeLog anyway. --rms.
+% \let\subtitlerm=\cmr12
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
%
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
@@ -1600,21 +1519,6 @@ where each line of input produces a line of output.}
% after the title page, which we certainly don't want.
\oldpage
\endgroup
- %
- % If they want short, they certainly want long too.
- \ifsetshortcontentsaftertitlepage
- \shortcontents
- \contents
- \global\let\shortcontents = \relax
- \global\let\contents = \relax
- \fi
- %
- \ifsetcontentsaftertitlepage
- \contents
- \global\let\contents = \relax
- \global\let\shortcontents = \relax
- \fi
- %
\HEADINGSon
}
@@ -1628,10 +1532,10 @@ where each line of input produces a line of output.}
\let\thispage=\folio
-\newtoks\evenheadline % headline on even pages
-\newtoks\oddheadline % headline on odd pages
-\newtoks\evenfootline % footline on even pages
-\newtoks\oddfootline % footline on odd pages
+\newtoks \evenheadline % Token sequence for heading line of even pages
+\newtoks \oddheadline % Token sequence for heading line of odd pages
+\newtoks \evenfootline % Token sequence for footing line of even pages
+\newtoks \oddfootline % Token sequence for footing line of odd pages
% Now make Tex use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
@@ -1770,6 +1674,18 @@ July\or August\or September\or October\or November\or December\fi
\message{tables,}
+
+% @tabs -- simple alignment
+
+% These don't work. For one thing, \+ is defined as outer.
+% So these macros cannot even be defined.
+
+%\def\tabs{\parsearg\tabszzz}
+%\def\tabszzz #1{\settabs\+#1\cr}
+%\def\tabline{\parsearg\tablinezzz}
+%\def\tablinezzz #1{\+#1\cr}
+%\def\&{&}
+
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
% default indentation of table text
@@ -1813,6 +1729,11 @@ July\or August\or September\or October\or November\or December\fi
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
+ % Be sure we are not still in the middle of a paragraph.
+ %{\parskip = 0in
+ %\par
+ %}%
+ %
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
@@ -1841,17 +1762,13 @@ July\or August\or September\or October\or November\or December\fi
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line.
+ % following text (if any) will end up on the same line. Since that
+ % text will be indented by \tableindent, we make the item text be in
+ % a zero-width box.
\noindent
- % Do this with kerns and \unhbox so that if there is a footnote in
- % the item text, it can migrate to the main vertical list and
- % eventually be printed.
- \nobreak\kern-\tableindent
- \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
- \unhbox0
- \nobreak\kern\dimen0
- \endgroup
- \itemxneedsnegativevskiptrue
+ \rlap{\hskip -\tableindent\box0}\ignorespaces%
+ \endgroup%
+ \itemxneedsnegativevskiptrue%
\fi
}
@@ -1862,10 +1779,9 @@ July\or August\or September\or October\or November\or December\fi
\def\xitem{\errmessage{@xitem while not in a table}}
\def\xitemx{\errmessage{@xitemx while not in a table}}
-% Contains a kludge to get @end[description] to work.
+%% Contains a kludge to get @end[description] to work
\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-% @table, @ftable, @vtable.
\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
{\obeylines\obeyspaces%
\gdef\tablex #1^^M{%
@@ -1925,7 +1841,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemize{\parsearg\itemizezzz}
\def\itemizezzz #1{%
- \begingroup % ended by the @end itemize
+ \begingroup % ended by the @end itemsize
\itemizey {#1}{\Eitemize}
}
@@ -2127,7 +2043,10 @@ July\or August\or September\or October\or November\or December\fi
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
-%
+
+%%%%
+% Dimensions
+
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
@@ -2137,15 +2056,15 @@ July\or August\or September\or October\or November\or December\fi
\multitablecolspace=12pt
\multitablelinespace=0pt
+%%%%
% Macros used to set up halign preamble:
-%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-% 2/1/96, to allow fractions to be given with more than one digit.
+%% 2/1/96, to allow fractions to be given with more than one digit.
\def\pickupwholefraction#1 {\global\advance\colcount by1 %
\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
\setuptable}
@@ -2171,84 +2090,80 @@ July\or August\or September\or October\or November\or December\fi
\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
\fi\go}
+%%%%
% multitable syntax
\def\tab{&\hskip1sp\relax} % 2/2/96
% tiny skip here makes sure this column space is
% maintained, even if it is never used.
+
+%%%%
% @multitable ... @end multitable definitions:
\def\multitable{\parsearg\dotable}
+
\def\dotable#1{\bgroup
- \vskip\parskip
- \let\item\crcr
- \tolerance=9500
- \hbadness=9500
- \setmultitablespacing
- \parskip=\multitableparskip
- \parindent=\multitableparindent
- \overfullrule=0pt
- \global\colcount=0
- \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
- %
- % To parse everything between @multitable and @item:
- \setuptable#1 \endsetuptable
- %
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
- \everycr{\noalign{%
- %
- % \filbreak%% keeps underfull box messages off when table breaks over pages.
- % Maybe so, but it also creates really weird page breaks when the table
- % breaks over pages. Wouldn't \vfil be better? Wait until the problem
- % manifests itself, so it can be fixed for real --karl.
- \global\colcount=0\relax}}%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- \halign\bgroup&\global\advance\colcount by 1\relax
- \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
- \rightskip=0pt
- \ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
+\let\item\cr
+\tolerance=9500
+\hbadness=9500
+\setmultitablespacing
+\parskip=\multitableparskip
+\parindent=\multitableparindent
+\overfullrule=0pt
+\global\colcount=0\relax%
+\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
+ % To parse everything between @multitable and @item :
+\setuptable#1 \endsetuptable
+ % Need to reset this to 0 after \setuptable.
+\global\colcount=0\relax%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+\halign\bgroup&\global\advance\colcount by 1\relax%
+\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ % If user has set preamble in terms of percent of \hsize
+ % we will use that dimension as the width of the column, and
+ % the \leftskip will keep entries from bumping into each other.
+ % Table will start at left margin and final column will justify at
+ % right margin.
+\ifnum\colcount=1
+\else
+ \ifsetpercent
\else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
+ % If user has <not> set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace
+ \advance\hsize by \multitablecolspace
\fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
+ % In either case we will make \leftskip=\multitablecolspace:
+\leftskip=\multitablecolspace
+\fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+\global\everycr{\noalign{%
+% \filbreak%% keeps underfull box messages off when table breaks over pages.
+% Maybe so, but it also creates really weird page breaks when the table
+% breaks over pages Wouldn't \vfil be better? Wait until the problem
+% manifests itself, so it can be fixed for real --karl.
+\global\colcount=0\relax}}
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
@@ -2291,14 +2206,12 @@ width0pt\relax} \fi
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
-%
-\def\newindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
- \fi
- \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
- \noexpand\doindex{#1}}
+
+\def\newindex #1{
+\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
+\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\doindex {#1}}
}
% @defindex foo == \newindex{foo}
@@ -2307,37 +2220,31 @@ width0pt\relax} \fi
% Define @defcodeindex, like @defindex except put all entries in @code.
-\def\newcodeindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1
- \fi
- \expandafter\xdef\csname#1index\endcsname{%
- \noexpand\docodeindex{#1}}
+\def\newcodeindex #1{
+\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
+\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\docodeindex {#1}}
}
\def\defcodeindex{\parsearg\newcodeindex}
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-% The \closeout helps reduce unnecessary open files; the limit on the
-% Acorn RISC OS is a mere 16 files.
-\def\synindex#1 #2 {%
- \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
- \expandafter\closeout\csname#1indfile\endcsname
- \expandafter\let\csname#1indfile\endcsname=\synindexfoo
- \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
- \noexpand\doindex{#2}}%
+\def\synindex #1 #2 {%
+\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+\expandafter\let\csname#1indfile\endcsname=\synindexfoo
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\doindex {#2}}%
}
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-\def\syncodeindex#1 #2 {%
- \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
- \expandafter\closeout\csname#1indfile\endcsname
- \expandafter\let\csname#1indfile\endcsname=\synindexfoo
- \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
- \noexpand\docodeindex{#2}}%
+\def\syncodeindex #1 #2 {%
+\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+\expandafter\let\csname#1indfile\endcsname=\synindexfoo
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\docodeindex {#2}}%
}
% Define \doindex, the driver for all \fooindex macros.
@@ -2358,7 +2265,6 @@ width0pt\relax} \fi
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
\def\indexdummies{%
-\def\ { }%
% Take care of the plain tex accent commands.
\def\"{\realbackslash "}%
\def\`{\realbackslash `}%
@@ -2400,6 +2306,7 @@ width0pt\relax} \fi
\def\gtr{\realbackslash gtr}%
\def\less{\realbackslash less}%
\def\hat{\realbackslash hat}%
+%\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
\def\result{\realbackslash result}%
@@ -2411,11 +2318,6 @@ width0pt\relax} \fi
\def\copyright{\realbackslash copyright}%
\def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}%
-\def\uref##1{\realbackslash uref {##1}}%
-\def\url##1{\realbackslash url {##1}}%
-\def\env##1{\realbackslash env {##1}}%
-\def\command##1{\realbackslash command {##1}}%
-\def\option##1{\realbackslash option {##1}}%
\def\dotless##1{\realbackslash dotless {##1}}%
\def\samp##1{\realbackslash samp {##1}}%
\def\,##1{\realbackslash ,{##1}}%
@@ -2431,13 +2333,7 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}%
-\def\acronym##1{\realbackslash acronym {##1}}%
-%
-% Handle some cases of @value -- where the variable name does not
-% contain - or _, and the value does not contain any
-% (non-fully-expandable) commands.
-\let\value = \expandablevalue
-%
+\def\value##1{\realbackslash value {##1}}%
\unsepspaces
}
@@ -2495,11 +2391,6 @@ width0pt\relax} \fi
%\let\tt=\indexdummyfont
\let\tclose=\indexdummyfont
\let\code=\indexdummyfont
-\let\url=\indexdummyfont
-\let\uref=\indexdummyfont
-\let\env=\indexdummyfont
-\let\command=\indexdummyfont
-\let\option=\indexdummyfont
\let\file=\indexdummyfont
\let\samp=\indexdummyfont
\let\kbd=\indexdummyfont
@@ -2515,24 +2406,14 @@ width0pt\relax} \fi
% so we do not become unable to do a definition.
{\catcode`\@=0 \catcode`\\=\other
- @gdef@realbackslash{\}}
+@gdef@realbackslash{\}}
\let\indexbackslash=0 %overridden during \printindex.
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
-% For \ifx comparisons.
-\def\emptymacro{\empty}
-% Most index entries go through here, but \dosubind is the general case.
-%
-\def\doind#1#2{\dosubind{#1}{#2}\empty}
-
-% Workhorse for all \fooindexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% \empty if called from \doind, as we usually are. The main exception
-% is with defuns, which call us directly.
-%
-\def\dosubind#1#2#3{%
+\let\SETmarginindex=\relax %initialize!
+% workhorse for all \fooindexes
+% #1 is name of index, #2 is stuff to put there
+\def\doind #1#2{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
@@ -2543,22 +2424,13 @@ width0pt\relax} \fi
\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\
{%
- \let\folio = 0% We will expand all macros now EXCEPT \folio.
+ \let\folio=0% We will expand all macros now EXCEPT \folio.
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- \def\thirdarg{#3}%
- %
- % If third arg is present, precede it with space in sort key.
- \ifx\thirdarg\emptymacro
- \let\subentry = \empty
- \else
- \def\subentry{ #3}%
- \fi
- %
% First process the index-string with all font commands turned off
% to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ {\indexnofonts \xdef\indexsorttmp{#2}}%
%
% Now produce the complete index entry, with both the sort key and the
% original text, including any font commands.
@@ -2567,47 +2439,33 @@ width0pt\relax} \fi
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
}%
- %
- % If third (subentry) arg is present, add it to the index string.
- \ifx\thirdarg\emptymacro \else
- \toks0 = {#3}%
- \edef\temp{\temp{\the\toks0}}%
- \fi
- %
- % If a skip is the last thing on the list now, preserve it
- % by backing up by \lastskip, doing the \write, then inserting
- % the skip again. Otherwise, the whatsit generated by the
- % \write will make \lastskip zero. The result is that sequences
- % like this:
- % @end defun
- % @tindex whatever
- % @defun ...
- % will have extra space inserted, because the \medbreak in the
- % start of the @defun won't see the skip inserted by the @end of
- % the previous defun.
- %
- % But don't do any of this if we're not in vertical mode. We
- % don't want to do a \vskip and prematurely end a paragraph.
- %
- % Avoid page breaks due to these extra skips, too.
- %
- \iflinks
- \ifvmode
- \skip0 = \lastskip
- \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
- \fi
- %
- \temp % do the write
- %
- %
- \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
- \fi
+ \temp
}%
}%
\penalty\count255
}%
}
+\def\dosubind #1#2#3{%
+{\count10=\lastpenalty %
+{\indexdummies % Must do this here, since \bf, etc expand at this stage
+\escapechar=`\\%
+{\let\folio=0%
+\def\rawbackslashxx{\indexbackslash}%
+%
+% Now process the index-string once, with all font commands turned off,
+% to get the string to sort the index by.
+{\indexnofonts
+\xdef\temp1{#2 #3}%
+}%
+% Now produce the complete index entry. We process the index-string again,
+% this time with font commands expanded, to get what to print in the index.
+\edef\temp{%
+\write \csname#1indfile\endcsname{%
+\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
+\temp }%
+}\penalty\count10}}
+
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
@@ -2652,11 +2510,6 @@ width0pt\relax} \fi
\indexbreaks
%
% See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
@@ -2678,6 +2531,7 @@ width0pt\relax} \fi
% to make right now.
\def\indexbackslash{\rawbackslashxx}%
\catcode`\\ = 0
+ \catcode`\@ = 11
\escapechar = `\\
\begindoublecolumns
\input \jobname.#1s
@@ -2690,35 +2544,21 @@ width0pt\relax} \fi
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
-\def\initial#1{{%
- % Some minor font changes for the special characters.
- \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
- %
- % Remove any glue we may have, we'll be inserting our own.
- \removelastskip
- %
- % We like breaks before the index initials, so insert a bonus.
- \penalty -300
- %
- % Typeset the initial. Making this add up to a whole number of
- % baselineskips increases the chance of the dots lining up from column
- % to column. It still won't often be perfect, because of the stretch
- % we need before each entry, but it's better.
- %
- % No shrink because it confuses \balancecolumns.
- \vskip 1.67\baselineskip plus .5\baselineskip
- \leftline{\secbf #1}%
- \vskip .33\baselineskip plus .1\baselineskip
- %
- % Do our best not to break after the initial.
- \nobreak
-}}
+% Same as \bigskipamount except no shrink.
+% \balancecolumns gets confused if there is any shrink.
+\newskip\initialskipamount \initialskipamount 12pt plus4pt
+
+\def\initial #1{%
+{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+\ifdim\lastskip<\initialskipamount
+\removelastskip \penalty-200 \vskip \initialskipamount\fi
+\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
% This typesets a paragraph consisting of #1, dot leaders, and then #2
% flush to the right margin. It is used for index and table of contents
% entries. The paragraph is indented by \leftskip.
%
-\def\entry#1#2{\begingroup
+\def\entry #1#2{\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
@@ -2741,15 +2581,12 @@ width0pt\relax} \fi
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
- \hangindent = 2em
+ \hangindent=2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
- % A bit of stretch before each entry for the benefit of balancing columns.
- \vskip 0pt plus1pt
- %
% Start a ``paragraph'' for the index entry so the line breaking
% parameters we've set above will have an effect.
\noindent
@@ -2848,21 +2685,14 @@ width0pt\relax} \fi
%
% Double the \vsize as well. (We don't need a separate register here,
% since nobody clobbers \vsize.)
- \advance\vsize by -\ht\partialpage
\vsize = 2\vsize
}
-
-% The double-column output routine for all double-column pages except
-% the last.
-%
\def\doublecolumnout{%
\splittopskip=\topskip \splitmaxdepth=\maxdepth
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
- \dimen@ = \vsize
- \divide\dimen@ by 2
- %
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
@@ -2871,60 +2701,35 @@ width0pt\relax} \fi
}
\def\pagesofar{%
% Re-output the contents of the output page -- any previous material,
- % followed by the two boxes we just split, in box0 and box2.
- \advance\vsize by \ht\partialpage
+ % followed by the two boxes we just split.
\unvbox\partialpage
- %
\hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize
- \hbox to\pagewidth{\box0\hfil\box2}%
+ \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
}
\def\enddoublecolumns{%
- \output = {%
- % Split the last of the double-column material. Leave on the
- % current page, no automatic page break.
- \balancecolumns
- %
- % If we end up splitting too much material for the current page,
- % though, there will be another page break right after this \output
- % invocation ends. Having called \balancecolumns once, we do not
- % want to call it again. Therefore, reset \output to its normal
- % definition right away. (We hope \balancecolumns will never be
- % called on to balance too much material, but if it is, this makes
- % the output somewhat more palatable.)
- \global\output = {\onepageout{\pagecontents\PAGE}}%
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize.
- \pagegoal = \vsize
- }%
- \eject
+ \output = {\balancecolumns}\eject % split what we have
\endgroup % started in \begindoublecolumns
+ %
+ % Back to normal single-column typesetting, but take account of the
+ % fact that we just accumulated some stuff on the output page.
+ \pagegoal = \vsize
}
\def\balancecolumns{%
% Called at the end of the double column material.
- \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \setbox0 = \vbox{\unvbox255}%
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2 % target to split to
- %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \divide\dimen@ by 2
\splittopskip = \topskip
% Loop until we get a decent breakpoint.
- {%
- \vbadness = 10000
- \loop
- \global\setbox3 = \copy0
- \global\setbox1 = \vsplit3 to \dimen@
- \ifdim\ht3>\dimen@
- \global\advance\dimen@ by 1pt
- \repeat
- }%
- %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ {\vbadness=10000 \loop
+ \global\setbox3=\copy0
+ \global\setbox1=\vsplit3 to\dimen@
+ \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt
+ \repeat}%
\setbox0=\vbox to\dimen@{\unvbox1}%
\setbox2=\vbox to\dimen@{\unvbox3}%
- %
\pagesofar
}
\catcode`\@ = \other
@@ -2942,10 +2747,56 @@ width0pt\relax} \fi
\newcount\appendixno \appendixno = `\@
\def\appendixletter{\char\the\appendixno}
+\newwrite\contentsfile
+% This is called from \setfilename.
+\def\opencontents{\openout\contentsfile = \jobname.toc }
+
% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise.
-\def\thischapter{}
-\def\thissection{}
+% page headings and footings can use it. @section does likewise
+
+\def\thischapter{} \def\thissection{}
+\def\seccheck#1{\ifnum \pageno<0
+ \errmessage{@#1 not allowed after generating table of contents}%
+\fi}
+
+\def\chapternofonts{%
+ \let\rawbackslash=\relax
+ \let\frenchspacing=\relax
+ \def\result{\realbackslash result}%
+ \def\equiv{\realbackslash equiv}%
+ \def\expansion{\realbackslash expansion}%
+ \def\print{\realbackslash print}%
+ \def\TeX{\realbackslash TeX}%
+ \def\dots{\realbackslash dots}%
+ \def\result{\realbackslash result}%
+ \def\equiv{\realbackslash equiv}%
+ \def\expansion{\realbackslash expansion}%
+ \def\print{\realbackslash print}%
+ \def\error{\realbackslash error}%
+ \def\point{\realbackslash point}%
+ \def\copyright{\realbackslash copyright}%
+ \def\tt{\realbackslash tt}%
+ \def\bf{\realbackslash bf}%
+ \def\w{\realbackslash w}%
+ \def\less{\realbackslash less}%
+ \def\gtr{\realbackslash gtr}%
+ \def\hat{\realbackslash hat}%
+ \def\char{\realbackslash char}%
+ \def\tclose##1{\realbackslash tclose{##1}}%
+ \def\code##1{\realbackslash code{##1}}%
+ \def\samp##1{\realbackslash samp{##1}}%
+ \def\r##1{\realbackslash r{##1}}%
+ \def\b##1{\realbackslash b{##1}}%
+ \def\key##1{\realbackslash key{##1}}%
+ \def\file##1{\realbackslash file{##1}}%
+ \def\kbd##1{\realbackslash kbd{##1}}%
+ % These are redefined because @smartitalic wouldn't work inside xdef.
+ \def\i##1{\realbackslash i{##1}}%
+ \def\cite##1{\realbackslash cite{##1}}%
+ \def\var##1{\realbackslash var{##1}}%
+ \def\emph##1{\realbackslash emph{##1}}%
+ \def\dfn##1{\realbackslash dfn{##1}}%
+}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raise/lowersections modify this count
@@ -3017,59 +2868,59 @@ width0pt\relax} \fi
\fi
}
-% @chapter, @appendix, @unnumbered.
+
\def\thischaptername{No Chapter Title}
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{%
+\def\chapterzzz #1{\seccheck{chapter}%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
\chapmacro {#1}{\the\chapno}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
% We don't substitute the actual chapter name into \thischapter
% because we don't want its macros evaluated now.
\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
- {\the\chapno}}}%
-\temp
-\donoderef
+\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
-}
+}}
\outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{%
+\def\appendixzzz #1{\seccheck{appendix}%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1
-\message{\putwordAppendix\space \appendixletter}%
+\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
- {\putwordAppendix{} \appendixletter}}}%
-\temp
-\appendixnoderef
+\edef\temp{{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
-}
+}}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\def\centerchap{\parsearg\centerchapyyy}
\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
-% @top is like @unnumbered.
\outer\def\top{\parsearg\unnumberedyyy}
-
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{%
+\def\unnumberedzzz #1{\seccheck{unnumbered}%
\secno=0 \subsecno=0 \subsubsecno=0
%
% This used to be simply \message{#1}, but TeX fully expands the
@@ -3081,139 +2932,155 @@ width0pt\relax} \fi
% Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use
% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of <toks register>. (We also do this for
-% the toc entries.)
+% simply yielding the contents of the <toks register>.
\toks0 = {#1}\message{(\the\toks0)}%
%
\unnumbchapmacro {#1}%
\gdef\thischapter{#1}\gdef\thissection{#1}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
-\temp
-\unnumbnoderef
+\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
-}
+}}
-% Sections.
\outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{%
+\def\seczzz #1{\seccheck{section}%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\the\chapno}{\the\secno}}}%
-\temp
-\donoderef
-\nobreak
-}
+\edef\temp{{\realbackslash secentry %
+{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
\outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{%
+\def\appendixsectionzzz #1{\seccheck{appendixsection}%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\appendixletter}{\the\secno}}}%
-\temp
-\appendixnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash secentry %
+{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{%
+\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
\plainsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
-\temp
-\unnumbnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
-% Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{%
+\def\numberedsubseczzz #1{\seccheck{subsection}%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}}}%
-\temp
-\donoderef
-\nobreak
-}
+\edef\temp{{\realbackslash subsecentry %
+{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{%
+\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash subsecentry %
+{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{%
+\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
\plainsubsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
- {\the\toks0}}}%
-\temp
-\unnumbnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
-% Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{%
+\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\donoderef
-\nobreak
-}
+\edef\temp{{\realbackslash subsubsecentry{\the\toks0}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
+ {\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{%
+\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}
+ {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{%
+\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
- {\the\toks0}}}%
-\temp
-\unnumbnoderef
-\nobreak
-}
+\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
% These are variants which are not "outer", so they can appear in @ifinfo.
% Actually, they should now be obsolete; ordinary section commands should work.
@@ -3242,7 +3109,8 @@ width0pt\relax} \fi
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and such:
+% NOTE on use of \vbox for chapter headings, section headings, and
+% such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
@@ -3289,12 +3157,12 @@ width0pt\relax} \fi
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-\def\CHAPPAGoff{%
+\def\CHAPPAGoff{
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
-\def\CHAPPAGon{%
+\def\CHAPPAGon{
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
@@ -3348,7 +3216,7 @@ width0pt\relax} \fi
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\nobreak
+ \rm #1\hfill}}\bigskip \par\penalty 10000 %
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
@@ -3359,7 +3227,7 @@ width0pt\relax} \fi
\def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+ \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
}
\def\CHAPFopen{
@@ -3412,44 +3280,24 @@ width0pt\relax} \fi
}
-\message{toc,}
-\newwrite\tocfile
-
-% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc. We supply {\folio} at the end of the
-% argument, which will end up as the last argument to the \...entry macro.
-%
-% We open the .toc file here instead of at @setfilename or any other
-% given time so that @contents can be put in the document anywhere.
-%
-\newif\iftocfileopened
-\def\writetocentry#1{%
- \iftocfileopened\else
- \immediate\openout\tocfile = \jobname.toc
- \global\tocfileopenedtrue
- \fi
- \iflinks \write\tocfile{#1{\folio}}\fi
-}
+\message{toc printing,}
+% Finish up the main text and prepare to read what we've written
+% to \contentsfile.
\newskip\contentsrightmargin \contentsrightmargin=1in
-\newcount\savepageno
-\newcount\lastnegativepageno \lastnegativepageno = -1
-
-% Finish up the main text and prepare to read what we've written
-% to \tocfile.
-%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
% \contentsalignmacro in parallel with \pagealignmacro.
% From: Torbjorn Granlund <tege@matematik.su.se>
\contentsalignmacro
- \immediate\closeout\tocfile
- %
+ \immediate\closeout \contentsfile
+ \ifnum \pageno>0
+ \pageno = -1 % Request roman numbered pages.
+ \fi
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\unnumbchapmacro{#1}\def\thischapter{}%
- \savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
% We can't do this, because then an actual ^ in a section
@@ -3457,28 +3305,19 @@ width0pt\relax} \fi
%\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
}
% Normal (long) toc.
-\def\contents{%
+\outer\def\contents{%
\startcontents{\putwordTableofContents}%
- \openin 1 \jobname.toc
- \ifeof 1 \else
- \closein 1
- \input \jobname.toc
- \fi
- \vfill \eject
+ \input \jobname.toc
\endgroup
- \lastnegativepageno = \pageno
- \pageno = \savepageno
+ \vfill \eject
}
% And just the chapters.
-\def\summarycontents{%
+\outer\def\summarycontents{%
\startcontents{\putwordShortContents}%
%
\let\chapentry = \shortchapentry
@@ -3495,15 +3334,9 @@ width0pt\relax} \fi
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{}
\def\unnumbsubsubsecentry ##1##2{}
- \openin 1 \jobname.toc
- \ifeof 1 \else
- \closein 1
- \input \jobname.toc
- \fi
- \vfill \eject
+ \input \jobname.toc
\endgroup
- \lastnegativepageno = \pageno
- \pageno = \savepageno
+ \vfill \eject
}
\let\shortcontents = \summarycontents
@@ -3594,12 +3427,11 @@ width0pt\relax} \fi
% the index entries, but we want to suppress hyphenation here. (We
% can't do that in the \entry macro, since index entries might consist
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+%
+% \turnoffactive is for the sake of @" used for umlauts.
\def\tocentry#1#2{\begingroup
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- % Do not use \turnoffactive in these arguments. Since the toc is
- % typeset in cmr, so characters such as _ would come out wrong; we
- % have to do the usual translation tricks.
- \entry{#1}{#2}%
+ \entry{\turnoffactive #1}{\turnoffactive #2}%
\endgroup}
% Space between chapter (or whatever) number and the title.
@@ -3665,36 +3497,30 @@ width0pt\relax} \fi
% But \@ or @@ will get a plain tex @ character.
\def\tex{\begingroup
- \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
- \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
- \catcode `\%=14
- \catcode 43=12 % plus
- \catcode`\"=12
- \catcode`\==12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \escapechar=`\\
- %
- \let\b=\ptexb
- \let\bullet=\ptexbullet
- \let\c=\ptexc
- \let\,=\ptexcomma
- \let\.=\ptexdot
- \let\dots=\ptexdots
- \let\equiv=\ptexequiv
- \let\!=\ptexexclam
- \let\i=\ptexi
- \let\{=\ptexlbrace
- \let\+=\tabalign
- \let\}=\ptexrbrace
- \let\*=\ptexstar
- \let\t=\ptext
- %
- \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
- \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
- \def\@{@}%
+\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+\catcode `\%=14
+\catcode 43=12 % plus
+\catcode`\"=12
+\catcode`\==12
+\catcode`\|=12
+\catcode`\<=12
+\catcode`\>=12
+\escapechar=`\\
+%
+\let\,=\ptexcomma
+\let\{=\ptexlbrace
+\let\}=\ptexrbrace
+\let\.=\ptexdot
+\let\*=\ptexstar
+\let\dots=\ptexdots
+\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+\def\@{@}%
+\let\bullet=\ptexbullet
+\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
+%
\let\Etex=\endgroup}
% Define @lisp ... @endlisp.
@@ -3739,8 +3565,8 @@ width0pt\relax} \fi
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax
-% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
-% environment contents.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \cartouche: draw rectangle w/rounded corners around argument
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
@@ -3767,9 +3593,9 @@ width0pt\relax} \fi
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
- \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ \advance\cartouter by 18pt % allow for 3pt kerns on either
% side, and for 6pt waste from
-% each corner char, and rule thickness
+% each corner char
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
@@ -3823,52 +3649,49 @@ width0pt\relax} \fi
\fi
}
-% Define the \E... control sequence only if we are inside the particular
-% environment, so the error checking in \end will work.
-%
-% To end an @example-like environment, we first end the paragraph (via
-% \afterenvbreak's vertical glue), and then the group. That way we keep
-% the zero \parskip that the environments set -- \parskip glue will be
-% inserted at the beginning of the next paragraph in the document, after
-% the environment.
+% To ending an @example-like environment, we first end the paragraph
+% (via \afterenvbreak's vertical glue), and then the group. That way we
+% keep the zero \parskip that the environments set -- \parskip glue
+% will be inserted at the beginning of the next paragraph in the
+% document, after the environment.
%
-\def\nonfillfinish{\afterenvbreak\endgroup}
+\def\nonfillfinish{\afterenvbreak\endgroup}%
-% @lisp: indented, narrowed, typewriter font.
\def\lisp{\begingroup
\nonfillstart
\let\Elisp = \nonfillfinish
\tt
- \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
+ % Make @kbd do something special, if requested.
+ \let\kbdfont\kbdexamplefont
+ \rawbackslash % have \ input char produce \ char from current font
+ \gobble
}
-% @example: Same as @lisp.
+% Define the \E... control sequence only if we are inside the
+% environment, so the error checking in \end will work.
+%
+% We must call \lisp last in the definition, since it reads the
+% return following the @example (or whatever) command.
+%
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-% @small... is usually equivalent to the non-small (@smallbook
-% redefines). We must call \example (or whatever) last in the
-% definition, since it reads the return following the @example (or
-% whatever) command.
-%
-% This actually allows (for example) @end display inside an
-% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+% @smallexample and @smalllisp. This is not used unless the @smallbook
+% command is given. Originally contributed by Pavel@xerox.
%
-\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
-\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
-\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
-% Originally contributed by Pavel@xerox.
\def\smalllispx{\begingroup
- \def\Esmalllisp{\nonfillfinish\endgroup}%
- \def\Esmallexample{\nonfillfinish\endgroup}%
- \indexfonts
- \lisp
+ \nonfillstart
+ \let\Esmalllisp = \nonfillfinish
+ \let\Esmallexample = \nonfillfinish
+ %
+ % Smaller fonts for small examples.
+ \indexfonts \tt
+ \rawbackslash % make \ output the \ character from the current font (tt)
+ \gobble
}
-% @display: same as @lisp except keep current font.
+% This is @display; same as @lisp except use roman font.
%
\def\display{\begingroup
\nonfillstart
@@ -3876,15 +3699,7 @@ width0pt\relax} \fi
\gobble
}
-% @smalldisplay (when @smallbook): @display plus smaller fonts.
-%
-\def\smalldisplayx{\begingroup
- \def\Esmalldisplay{\nonfillfinish\endgroup}%
- \indexfonts \rm
- \display
-}
-
-% @format: same as @display except don't narrow margins.
+% This is @format; same as @display except don't narrow margins.
%
\def\format{\begingroup
\let\nonarrowing = t
@@ -3893,27 +3708,20 @@ width0pt\relax} \fi
\gobble
}
-% @smallformat (when @smallbook): @format plus smaller fonts.
+% @flushleft (same as @format) and @flushright.
%
-\def\smallformatx{\begingroup
- \def\Esmallformat{\nonfillfinish\endgroup}%
- \indexfonts \rm
- \format
+\def\flushleft{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushleft = \nonfillfinish
+ \gobble
}
-
-% @flushleft (same as @format).
-%
-\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
-
-% @flushright.
-%
\def\flushright{\begingroup
\let\nonarrowing = t
\nonfillstart
\let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill
- \gobble
-}
+ \gobble}
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.
@@ -3936,7 +3744,6 @@ width0pt\relax} \fi
\fi
}
-
\message{defuns,}
% Define formatter for defuns
% First, allow user to change definition object font (\df) internally
@@ -4006,18 +3813,20 @@ width0pt\relax} \fi
% outside the @def...
\dimen2=\leftskip
\advance\dimen2 by -\defbodyindent
-\noindent
+\dimen3=\rightskip
+\advance\dimen3 by -\defbodyindent
+\noindent %
\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %
% Now output arg 2 ("Function" or some such)
% ending at \deftypemargin from the right margin,
% but stuck inside a box of width 0 so it does not interfere with linebreaking
{% Adjust \hsize to exclude the ambient margins,
% so that \rightline will obey them.
-\advance \hsize by -\dimen2
-\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
% Make all lines underfull and no complaints:
\tolerance=10000 \hbadness=10000
\advance\leftskip by -\defbodyindent
@@ -4038,46 +3847,23 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active % 61 is `='
\obeylines\activeparens\spacesplit#3}
-% #1 is the \E... control sequence to end the definition (which we define).
-% #2 is the \...x control sequence for consecutive fns (which we define).
-% #3 is the control sequence to call to resume processing.
-% #4, delimited by the space, is the class name.
-%
-\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-% @deftypemethod has an extra argument that nothing else does. Sigh.
-% #1 is the \E... control sequence to end the definition (which we define).
-% #2 is the \...x control sequence for consecutive fns (which we define).
-% #3 is the control sequence to call to resume processing.
-% #4, delimited by the space, is the class name.
-% #5 is the method's return type.
-%
-\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
-
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
@@ -4086,7 +3872,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
@@ -4101,7 +3887,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active %
@@ -4118,7 +3904,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
\parindent=0in
- \advance\leftskip by \defbodyindent
+ \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines
}
@@ -4163,7 +3949,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\spacesplit{#3{#5}}}
@@ -4196,7 +3982,7 @@ width0pt\relax} \fi
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\nobreak\vskip -\parskip\nobreak
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
}
\def\deftypefunargs #1{%
@@ -4207,7 +3993,7 @@ width0pt\relax} \fi
\tclose{#1}% avoid \code because of side effects on active chars
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\nobreak\vskip -\parskip\nobreak
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -4295,46 +4081,39 @@ width0pt\relax} \fi
\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
% @defmethod, and so on
-% @defop CATEGORY CLASS OPERATION ARG...
+% @defop {Funny Method} foo-class frobnicate argument
\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}
\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
\begingroup\defname {#2}{\defoptype{} on #1}%
\defunargs {#3}\endgroup %
}
-% @deftypemethod CLASS RETURN-TYPE METHOD ARG...
+% @deftypemethod foo-class return-type foo-method args
%
\def\deftypemethod{%
- \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+ \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
%
% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
\def\deftypemethodheader#1#2#3#4{%
- \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
- \begingroup
- \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
- \deftypefunargs{#4}%
- \endgroup
+ \deftypefnheaderx{Method on #1}{#2}#3 #4\relax
}
% @defmethod == @defop Method
-%
+
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-%
-% #1 is the class name, #2 the method name, #3 the args.
-\def\defmethodheader#1#2#3{%
- \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
- \begingroup
- \defname{#2}{\putwordMethodon\ \code{#1}}%
- \defunargs{#3}%
- \endgroup
+
+\def\defmethodheader #1#2#3{%
+\dosubind {fn}{\code{#2}}{on #1}% entry in function index
+\begingroup\defname {#2}{Method on #1}%
+\defunargs {#3}\endgroup %
}
% @defcv {Class Option} foo-class foo-flag
@@ -4373,7 +4152,7 @@ width0pt\relax} \fi
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak}
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
% @defvr Counter foo-count
@@ -4410,7 +4189,7 @@ width0pt\relax} \fi
\dovarind#2 \relax% Make entry in variables index
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000
\endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
@@ -4421,7 +4200,7 @@ width0pt\relax} \fi
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000
\endgroup}
% This definition is run if you use @defvarx
@@ -4451,310 +4230,40 @@ width0pt\relax} \fi
\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-\message{macros,}
-% @macro.
-
-% To do this right we need a feature of e-TeX, \scantokens,
-% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\undefined
- \newwrite\macscribble
- \def\scanmacro#1{%
- \begingroup \newlinechar`\^^M
- \immediate\openout\macscribble=\jobname.tmp
- \immediate\write\macscribble{#1}%
- \immediate\closeout\macscribble
- \let\xeatspaces\eatspaces
- \input \jobname.tmp
- \endgroup
-}
-\else
-\def\scanmacro#1{%
-\begingroup \newlinechar`\^^M
-\let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
-\fi
+\message{cross reference,}
+% Define cross-reference macros
+\newwrite \auxfile
-\newcount\paramno % Count of parameters
-\newtoks\macname % Macro name
-\newif\ifrecursive % Is it recursive?
-
-% Utility routines.
-% Thisdoes \let #1 = #2, except with \csnames.
-\def\cslet#1#2{%
-\expandafter\expandafter
-\expandafter\let
-\expandafter\expandafter
-\csname#1\endcsname
-\csname#2\endcsname}
-
-% Trim leading and trailing spaces off a string.
-% Concepts from aro-bend problem 15 (see CTAN).
-{\catcode`\@=11
-\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
-\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
-\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
-\def\unbrace#1{#1}
-\unbrace{\gdef\trim@@@ #1 } #2@{#1}
-}
-
-% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=12\catcode`\Q=3%
-\gdef\eatcr #1{\eatcra #1Q^^MQ}%
-\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
-\gdef\eatcrb#1Q#2Q{#1}%
-}
-
-% Macro bodies are absorbed as an argument in a context where
-% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \.
-
-% It's necessary to have hard CRs when the macro is executed. This is
-% done by making ^^M (\endlinechar) catcode 12 when reading the macro
-% body, and then making it the \newlinechar in \scanmacro.
-
-\def\macrobodyctxt{%
- \catcode`\~=12
- \catcode`\^=12
- \catcode`\_=12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \catcode`\+=12
- \catcode`\{=12
- \catcode`\}=12
- \catcode`\@=12
- \catcode`\^^M=12
- \usembodybackslash}
-
-\def\macroargctxt{%
- \catcode`\~=12
- \catcode`\^=12
- \catcode`\_=12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \catcode`\+=12
- \catcode`\@=12
- \catcode`\\=12}
-
-% \mbodybackslash is the definition of \ in @macro bodies.
-% It maps \foo\ => \csname macarg.foo\endcsname => #N
-% where N is the macro parameter number.
-% We define \csname macarg.\endcsname to be \realbackslash, so
-% \\ in macro replacement text gets you a backslash.
-
-{\catcode`@=0 @catcode`@\=@active
- @gdef@usembodybackslash{@let\=@mbodybackslash}
- @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
-}
-\expandafter\def\csname macarg.\endcsname{\realbackslash}
-
-\def\macro{\recursivefalse\parsearg\macroxxx}
-\def\rmacro{\recursivetrue\parsearg\macroxxx}
-
-\def\macroxxx#1{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
- \ifx\argl\empty % no arguments
- \paramno=0%
- \else
- \expandafter\parsemargdef \argl;%
- \fi
- \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
- \cslet{macsave.\the\macname}{\the\macname}%
- \else
- \message{Warning: redefining \the\macname}%
- \fi
- \begingroup \macrobodyctxt
- \ifrecursive \expandafter\parsermacbody
- \else \expandafter\parsemacbody
- \fi}
-
-\def\unmacro{\parsearg\unmacroxxx}
-\def\unmacroxxx#1{%
- \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
- \errmessage{Macro \the\macname\ not defined.}%
- \else
- \cslet{#1}{macsave.#1}%
- \expandafter\let \csname macsave.\the\macname\endcsname \undefined
- \fi
-}
-
-% This makes use of the obscure feature that if the last token of a
-% <parameter list> is #, then the preceding argument is delimited by
-% an opening brace, and that opening brace is not consumed.
-\def\getargs#1{\getargsxxx#1{}}
-\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname #1 #2\relax{\macname={#1}}
-\def\getmacargs#1{\def\argl{#1}}
-
-% Parse the optional {params} list. Set up \paramno and \paramlist
-% so \defmacro knows what to do. Define \macarg.blah for each blah
-% in the params list, to be ##N where N is the position in that list.
-% That gets used by \mbodybackslash (above).
-
-% We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX: let \hash be something
-% unexpandable, insert that wherever you need a #, and then redefine
-% it to # just before using the token list produced.
-%
-% The same technique is used to protect \eatspaces till just before
-% the macro is used.
-
-\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
- \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
-\def\parsemargdefxxx#1,{%
- \if#1;\let\next=\relax
- \else \let\next=\parsemargdefxxx
- \advance\paramno by 1%
- \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno}}%
- \edef\paramlist{\paramlist\hash\the\paramno,}%
- \fi\next}
-
-% These two commands read recursive and nonrecursive macro bodies.
-% (They're different since rec and nonrec macros end differently.)
-
-\long\def\parsemacbody#1@end macro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\long\def\parsermacbody#1@end rmacro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-
-% This defines the macro itself. There are six cases: recursive and
-% nonrecursive macros of zero, one, and many arguments.
-% Much magic with \expandafter here.
-% \xdef is used so that macro definitions will survive the file
-% they're defined in; @include reads the file inside a group.
-\def\defmacro{%
- \let\hash=##% convert placeholders to macro parameter chars
- \ifrecursive
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\scanmacro{\temp}}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup\noexpand\scanmacro{\temp}}%
- \else % many
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\csname\the\macname xx\endcsname}
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{\egroup\noexpand\scanmacro{\temp}}%
- \fi
- \else
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \else % many
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\csname\the\macname xx\endcsname}
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \fi
- \fi}
-
-\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
-
-% \braceorline decides whether the next nonwhitespace character is a
-% {. If so it reads up to the closing }, if not, it reads the whole
-% line. Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg)
-\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
-\def\braceorlinexxx{%
- \ifx\nchar\bgroup\else
- \expandafter\parsearg
- \fi \next}
-
-
-\message{cross references,}
-\newwrite\auxfile
-
-\newif\ifhavexrefs % True if xref values are known.
+\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-% @inforef is relatively simple.
+% @inforef is simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
-% @node's job is to define \lastnode.
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-% The sectioning commands (@chapter, etc.) call these.
-\def\donoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}%
- {Ysectionnumberandtype}%
- \global\let\lastnode=\relax
- \fi
-}
-\def\unnumbnoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
- \global\let\lastnode=\relax
- \fi
-}
-\def\appendixnoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}%
- {Yappendixletterandtype}%
- \global\let\lastnode=\relax
- \fi
-}
+% \setref{foo} defines a cross-reference point named foo.
+\def\setref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Ysectionnumberandtype}}
-% @anchor{NAME} -- define xref target at arbitrary point.
-%
-\def\anchor#1{\setref{#1}{Ynothing}}
-
+\def\unnumbsetref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Ynothing}}
-% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
-% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
-% to set \indexdummies so commands such as @code in a section title
-% aren't expanded. It would be nicer not to expand the titles in the
-% first place, but there's so many layers that that is hard to do.
-%
-\def\setref#1#2{{%
- \indexdummies
- \dosetq{#1-title}{Ytitle}%
- \dosetq{#1-pg}{Ypagenumber}%
- \dosetq{#1-snt}{#2}
-}}
+\def\appendixsetref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Yappendixletterandtype}}
-% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
-% the node name, #2 the name of the Info cross-reference, #3 the printed
-% node name, #4 the name of the Info file, #5 the name of the printed
-% manual. All but the node name can be omitted.
+% \xref, \pxref, and \ref generate cross-references to specified points.
+% For \xrefX, #1 is the node name, #2 the name of the Info
+% cross-reference, #3 the printed node name, #4 the name of the Info
+% file, #5 the name of the printed manual. All but the node name can be
+% omitted.
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
@@ -4772,7 +4281,7 @@ width0pt\relax} \fi
\else
% Use the actual chapter/section title appear inside
% the square brackets. Use the real section title if we have it.
- \ifdim \wd1 > 0pt
+ \ifdim \wd1>0pt%
% It is in another manual, so we don't have it.
\def\printednodename{\ignorespaces #1}%
\else
@@ -4801,32 +4310,19 @@ width0pt\relax} \fi
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\normalturnoffactive
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
- }%
- % [mynode],
- [\printednodename],\space
- % page 3
+ {\turnoffactive \refx{#1-snt}{}}%
+ \space [\printednodename],\space
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi
\endgroup}
% \dosetq is the interface for calls from other macros
-% Use \normalturnoffactive so that punctuation chars such as underscore
-% and backslash work in node names. (\turnoffactive doesn't do \.)
-\def\dosetq#1#2{%
- {\let\folio=0
- \normalturnoffactive
- \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
- \iflinks
- \next
- \fi
- }%
-}
+% Use \turnoffactive so that punctuation chars such as underscore
+% work in node names.
+\def\dosetq #1#2{{\let\folio=0 \turnoffactive
+\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
+\next}}
% \internalsetq {foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
@@ -4877,15 +4373,13 @@ width0pt\relax} \fi
\def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
- \angleleft un\-de\-fined\angleright
- \iflinks
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
+ $\langle$un\-de\-fined$\rangle$%
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
\fi
\fi
\else
@@ -4896,13 +4390,10 @@ width0pt\relax} \fi
}
% This is the macro invoked by entries in the aux file.
-%
-\def\xrdef#1{\begingroup
- % Reenable \ as an escape while reading the second argument.
- \catcode`\\ = 0
- \afterassignment\endgroup
- \expandafter\gdef\csname X#1\endcsname
-}
+\def\xrdef #1#2{{%
+ \catcode`\'=\other
+ \expandafter\gdef\csname X#1\endcsname{#2}%
+}}
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
@@ -4959,7 +4450,8 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
- \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % `\+ does not work, so use 43.
+ \catcode43=\other
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -5125,12 +4617,10 @@ width0pt\relax} \fi
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
-\openin 1 = epsf.tex
+\openin 1 = xepsf.tex
\ifeof 1 \else
\closein 1
- % Do not bother showing banner with post-v2.7 epsf.tex (available in
- % doc/epsf.tex until it shows up on ctan).
- \def\epsfannounce{\toks0 = }%
+ \def\epsfannounce{\toks0 = }% do not bother showing banner
\input epsf.tex
\fi
%
@@ -5160,32 +4650,39 @@ width0pt\relax} \fi
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- % If the image is by itself, center it.
- \ifvmode
- \nobreak\medskip
- \nobreak
- \centerline{\epsfbox{#1.eps}}%
- \bigbreak
- \else
- \epsfbox{#1.eps}%
- \fi
+ \epsfbox{#1.eps}%
}
+% End of control word definitions.
+
-\message{paper sizes,}
-% And other related parameters.
+\message{and turning on texinfo input format.}
+
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% Set some numeric style parameters, for 8.5 x 11 format.
+\hsize = 6in
+\hoffset = .25in
\newdimen\defaultparindent \defaultparindent = 15pt
+\parindent = \defaultparindent
+\parskip 3pt plus 2pt minus 1pt
+\setleading{13.2pt}
+\advance\topskip by 1.2cm
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
-\vbadness = 10000
-
-% Don't be so finicky about underfull hboxes, either.
-\hbadness = 2000
+\vbadness=10000
% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
@@ -5194,126 +4691,101 @@ width0pt\relax} \fi
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format. We
-% call this whenever the paper size is set.
+% \hsize. This makes it come to about 9pt for the 8.5x11 format.
%
-\def\setemergencystretch{%
- \ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
- \else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
- \fi
-}
+\ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+\else
+ \emergencystretch = \hsize
+ \divide\emergencystretch by 45
+\fi
-% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
-% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
-% set \parskip and call \setleading for \baselineskip.
-%
-\def\internalpagesizes#1#2#3#4#5#6{%
- \voffset = #3\relax
- \topskip = #6\relax
- \splittopskip = \topskip
- %
- \vsize = #1\relax
- \advance\vsize by \topskip
- \outervsize = \vsize
- \advance\outervsize by 2\topandbottommargin
- \pageheight = \vsize
+% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
+\def\smallbook{
+ \global\chapheadingskip = 15pt plus 4pt minus 2pt
+ \global\secheadingskip = 12pt plus 3pt minus 2pt
+ \global\subsecheadingskip = 9pt plus 2pt minus 2pt
%
- \hsize = #2\relax
- \outerhsize = \hsize
- \advance\outerhsize by 0.5in
- \pagewidth = \hsize
+ \global\lispnarrowing = 0.3in
+ \setleading{12pt}
+ \advance\topskip by -1cm
+ \global\parskip 2pt plus 1pt
+ \global\hsize = 5in
+ \global\vsize=7.5in
+ \global\tolerance=700
+ \global\hfuzz=1pt
+ \global\contentsrightmargin=0pt
+ \global\deftypemargin=0pt
+ \global\defbodyindent=.5cm
%
- \normaloffset = #4\relax
- \bindingoffset = #5\relax
+ \global\pagewidth=\hsize
+ \global\pageheight=\vsize
%
- \parindent = \defaultparindent
- \setemergencystretch
+ \global\let\smalllisp=\smalllispx
+ \global\let\smallexample=\smalllispx
+ \global\def\Esmallexample{\Esmalllisp}
}
-% @letterpaper (the default).
-\def\letterpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \setleading{13.2pt}%
- %
- % If page is nothing but text, make it come out even.
- \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
-}}
-
-% Use @smallbook to reset parameters for 7x9.5 (or so) format.
-\def\smallbook{{\globaldefs = 1
- \parskip = 2pt plus 1pt
- \setleading{12pt}%
- %
- \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
- %
- \lispnarrowing = 0.3in
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \deftypemargin = 0pt
- \defbodyindent = .5cm
- %
- \let\smalldisplay = \smalldisplayx
- \let\smallexample = \smalllispx
- \let\smallformat = \smallformatx
- \let\smalllisp = \smalllispx
-}}
-
% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{{\globaldefs = 1
- \setleading{12pt}%
- \parskip = 3pt plus 2pt minus 1pt
- %
- \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
- %
- \tolerance = 700
- \hfuzz = 1pt
-}}
+\def\afourpaper{
+\global\tolerance=700
+\global\hfuzz=1pt
+\setleading{12pt}
+\global\parskip 15pt plus 1pt
+
+\global\vsize= 53\baselineskip
+\advance\vsize by \topskip
+%\global\hsize= 5.85in % A4 wide 10pt
+\global\hsize= 6.5in
+\global\outerhsize=\hsize
+\global\advance\outerhsize by 0.5in
+\global\outervsize=\vsize
+\global\advance\outervsize by 0.6in
+
+\global\pagewidth=\hsize
+\global\pageheight=\vsize
+}
+
+\bindingoffset=0pt
+\normaloffset=\hoffset
+\pagewidth=\hsize
+\pageheight=\vsize
+
+% Allow control of the text dimensions. Parameters in order: textheight;
+% textwidth; voffset; hoffset; binding offset; topskip.
+% All require a dimension;
+% header is additional; added length extends the bottom of the page.
+
+\def\changepagesizes#1#2#3#4#5#6{
+ \global\vsize= #1
+ \global\topskip= #6
+ \advance\vsize by \topskip
+ \global\voffset= #3
+ \global\hsize= #2
+ \global\outerhsize=\hsize
+ \global\advance\outerhsize by 0.5in
+ \global\outervsize=\vsize
+ \global\advance\outervsize by 0.6in
+ \global\pagewidth=\hsize
+ \global\pageheight=\vsize
+ \global\normaloffset= #4
+ \global\bindingoffset= #5}
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex{{\globaldefs = 1
- \setleading{13.6pt}%
- %
- \afourpaper
- \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
- %
- \globaldefs = 0
-}}
+\def\afourlatex
+ {\global\tolerance=700
+ \global\hfuzz=1pt
+ \setleading{12pt}
+ \global\parskip 15pt plus 1pt
+ \advance\baselineskip by 1.6pt
+ \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
+ }
% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{%
- \afourpaper
- \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
- %
- \globaldefs = 0
-}
-
-% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
-% Perhaps we should allow setting the margins, \topskip, \parskip,
-% and/or leading, also. Or perhaps we should compute them somehow.
-%
-\def\pagesizes{\parsearg\pagesizesxxx}
-\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
-\def\pagesizesyyy#1,#2,#3\finish{{%
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
- \globaldefs = 1
- %
- \parskip = 3pt plus 2pt minus 1pt
- \setleading{13.2pt}%
- %
- \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
-}}
-
-% Set default to letter.
-%
-\letterpaper
-
-\message{and turning on texinfo input format.}
+\def\afourwide{\afourpaper
+\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
@@ -5350,10 +4822,10 @@ width0pt\relax} \fi
% use math or other variants that look better in normal text.
\catcode`\"=\active
-\def\activedoublequote{{\tt\char34}}
+\def\activedoublequote{{\tt \char '042}}
\let"=\activedoublequote
\catcode`\~=\active
-\def~{{\tt\char126}}
+\def~{{\tt \char '176}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}
@@ -5364,7 +4836,7 @@ width0pt\relax} \fi
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
\catcode`\|=\active
-\def|{{\tt\char124}}
+\def|{{\tt \char '174}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
@@ -5451,17 +4923,13 @@ width0pt\relax} \fi
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
@catcode`+=@active @catcode`@_=@active}
-% These look ok in all fonts, so just make them not special. The @rm below
-% makes sure that the current font starts out as the newly loaded cmr10
+%% These look ok in all fonts, so just make them not special. The @rm below
+%% makes sure that the current font starts out as the newly loaded cmr10
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
@textfonts
@rm
@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
-@c time-stamp-start: "def\\\\texinfoversion{"
-@c time-stamp-format: "%:y-%02m-%02d"
-@c time-stamp-end: "}"
@c End:
diff --git a/contrib/amd/doc/version.texi b/contrib/amd/doc/version.texi
index 05e718a873bc..225ecdbacb37 100644
--- a/contrib/amd/doc/version.texi
+++ b/contrib/amd/doc/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 27 December 1998
-@set EDITION 6.0
-@set VERSION 6.0
+@set UPDATED 22 April 1998
+@set EDITION 6.0a16
+@set VERSION 6.0a16
diff --git a/contrib/amd/fixmount/fixmount.8 b/contrib/amd/fixmount/fixmount.8
index 008f0b4c9afb..88c9aef89728 100644
--- a/contrib/amd/fixmount/fixmount.8
+++ b/contrib/amd/fixmount/fixmount.8
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: fixmount.8,v 1.3 1998/09/12 04:04:58 obrien Exp $
+.\" $Id: fixmount.8,v 1.2 1998/09/05 06:56:36 obrien Exp $
.\"
.Dd February 26, 1993
.Dt FIXMOUNT 8
@@ -151,7 +151,7 @@ returns for it) has been changed. To take care of these cases,
the remote
.Pa /etc/rmtab
file has to be edited and
-.Nm mountd
+.Mn mountd
restarted.
.Pp
The RPC timeouts for
diff --git a/contrib/amd/fixmount/fixmount.c b/contrib/amd/fixmount/fixmount.c
index 6c5826ab9962..53c7807038e7 100644
--- a/contrib/amd/fixmount/fixmount.c
+++ b/contrib/amd/fixmount/fixmount.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fixmount.c,v 1.3 1998/11/14 03:13:31 obrien Exp $
+ * $Id: fixmount.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -87,14 +87,11 @@ void print_dump(mountlist);
void usage(void);
/* dummy variables */
-#if 0
char *progname;
char hostname[MAXHOSTNAMELEN];
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
void
usage(void)
@@ -357,7 +354,7 @@ main(int argc, char *argv[])
perror("gethostname");
exit(1);
}
- thishost[sizeof(thishost) - 1] = '\0';
+ thishost[sizeof(thishost) - 1] = '\0';
/*
* We need the hostname as it appears to the other side's
diff --git a/contrib/amd/fsinfo/fsi_analyze.c b/contrib/amd/fsinfo/fsi_analyze.c
index 7d897b80feec..de2991368ccd 100644
--- a/contrib/amd/fsinfo/fsi_analyze.c
+++ b/contrib/amd/fsinfo/fsi_analyze.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_analyze.c,v 1.1.1.1 1998/11/05 02:04:53 ezk Exp $
+ * $Id: fsi_analyze.c,v 5.2.2.1 1992/02/09 15:09:41 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/fsi_data.h b/contrib/amd/fsinfo/fsi_data.h
index 68d12aca54ca..07b7b9e79816 100644
--- a/contrib/amd/fsinfo/fsi_data.h
+++ b/contrib/amd/fsinfo/fsi_data.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_data.h,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: fsi_data.h,v 5.2.2.1 1992/02/09 15:09:53 jsp beta $
*
*/
@@ -89,10 +89,11 @@ struct host {
ioloc *h_ioloc;
fsmount *h_netroot, *h_netswap;
#define HF_HOST 0
- char *h_hostname; /* The full name of the host */
- char *h_lochost; /* The name of the host with local domains stripped */
- char *h_hostpath; /* The filesystem path to the host (cf
- compute_hostpath) */
+ char *h_hostname; /* The full name of the host */
+ char *h_lochost; /* The name of the host with local domains *
+ * * * stripped */
+ char *h_hostpath; /* The filesystem path to the host (cf * * *
+ * compute_hostpath) */
#define HF_ETHER 1
qelem *h_ether;
#define HF_CONFIG 2
diff --git a/contrib/amd/fsinfo/fsi_dict.c b/contrib/amd/fsinfo/fsi_dict.c
index 7c4c4821ee99..f9e686a0f3f1 100644
--- a/contrib/amd/fsinfo/fsi_dict.c
+++ b/contrib/amd/fsinfo/fsi_dict.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_dict.c,v 1.1.1.1 1998/11/05 02:04:53 ezk Exp $
+ * $Id: fsi_dict.c,v 5.2.2.1 1992/02/09 15:09:43 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/fsi_gram.y b/contrib/amd/fsinfo/fsi_gram.y
index 50ca4d6542ef..b325c77d0ca6 100644
--- a/contrib/amd/fsinfo/fsi_gram.y
+++ b/contrib/amd/fsinfo/fsi_gram.y
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_gram.y,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: fsi_gram.y,v 5.2.2.1 1992/02/09 15:09:35 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/fsi_lex.l b/contrib/amd/fsinfo/fsi_lex.l
index bd8181724a7e..98b1976f745e 100644
--- a/contrib/amd/fsinfo/fsi_lex.l
+++ b/contrib/amd/fsinfo/fsi_lex.l
@@ -18,7 +18,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -39,7 +39,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_lex.l,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: fsi_lex.l,v 5.2.2.1 1992/02/09 15:09:36 jsp beta $
*
*/
@@ -97,7 +97,7 @@ static int yylineno;
#endif /* ECHO */
/*
- * There are some things that need to be defined only if using GNU flex.
+ * There are some things that need to be defined only if useing GNU flex.
* These must not be defined if using standard lex
*/
#ifdef FLEX_SCANNER
diff --git a/contrib/amd/fsinfo/fsi_util.c b/contrib/amd/fsinfo/fsi_util.c
index 2c3cbcc02f49..d69c4593b49e 100644
--- a/contrib/amd/fsinfo/fsi_util.c
+++ b/contrib/amd/fsinfo/fsi_util.c
@@ -14,7 +14,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -35,7 +35,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsi_util.c,v 1.1.1.1 1998/11/05 02:04:53 ezk Exp $
+ * $Id: fsi_util.c,v 5.2.2.1 1992/02/09 15:09:39 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/fsinfo.c b/contrib/amd/fsinfo/fsinfo.c
index 345aae216f49..abb1c50f3c76 100644
--- a/contrib/amd/fsinfo/fsinfo.c
+++ b/contrib/amd/fsinfo/fsinfo.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsinfo.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
+ * $Id: fsinfo.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -58,8 +58,8 @@
char **g_argv;
char *autodir = "/a";
char *progname;
-char hostname[MAXHOSTNAMELEN + 1];
char *username;
+char hostname[MAXHOSTNAMELEN + 1];
char idvbuf[1024];
dict *dict_of_hosts;
dict *dict_of_volnames;
@@ -80,12 +80,9 @@ char *fstab_pref;
char *mount_pref;
/* dummy variables */
-#if 0
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
/*
diff --git a/contrib/amd/fsinfo/fsinfo.h b/contrib/amd/fsinfo/fsinfo.h
index 50224bb9a11f..c02b67362f7c 100644
--- a/contrib/amd/fsinfo/fsinfo.h
+++ b/contrib/amd/fsinfo/fsinfo.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: fsinfo.h,v 1.2 1998/12/27 06:25:21 ezk Exp $
+ * $Id: fsinfo.h,v 5.2.2.1 1992/02/09 15:09:51 jsp beta $
*
*/
@@ -109,7 +109,6 @@ extern void domain_strip(char *otherdom, char *localdom);
*/
#ifndef yywrap
extern int yywrap(void);
-# define yywrap() 1
#endif /* not yywrap */
extern int yyparse(void);
extern int write_atab(qelem *q);
diff --git a/contrib/amd/fsinfo/wr_atab.c b/contrib/amd/fsinfo/wr_atab.c
index 474ba4428903..be870c043560 100644
--- a/contrib/amd/fsinfo/wr_atab.c
+++ b/contrib/amd/fsinfo/wr_atab.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wr_atab.c,v 1.1.1.1 1998/11/05 02:04:53 ezk Exp $
+ * $Id: wr_atab.c,v 5.2.2.1 1992/02/09 15:09:44 jsp beta $
*
*/
@@ -129,7 +129,7 @@ write_amount_info(FILE *af, automount *ap, int sk)
fsi_mount *mp = (fsi_mount *) dd->dd_data;
/*
* If the mount point and the exported volname are the
- * same then this filesystem will be recognized by
+ * same then this filesystem will be recognised by
* the restart code - so we don't need to put out a
* special rule for it.
*/
diff --git a/contrib/amd/fsinfo/wr_bparam.c b/contrib/amd/fsinfo/wr_bparam.c
index de2f55edcd3c..fb4479c4286c 100644
--- a/contrib/amd/fsinfo/wr_bparam.c
+++ b/contrib/amd/fsinfo/wr_bparam.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wr_bparam.c,v 1.1.1.1 1998/11/05 02:04:53 ezk Exp $
+ * $Id: wr_bparam.c,v 5.2.2.1 1992/02/09 15:09:46 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/wr_dumpset.c b/contrib/amd/fsinfo/wr_dumpset.c
index f1e027a6198a..b33858dd7b96 100644
--- a/contrib/amd/fsinfo/wr_dumpset.c
+++ b/contrib/amd/fsinfo/wr_dumpset.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wr_dumpset.c,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: wr_dumpset.c,v 5.2.2.1 1992/02/09 15:09:47 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/wr_exportfs.c b/contrib/amd/fsinfo/wr_exportfs.c
index eb46be53b097..56d9bd5ac14a 100644
--- a/contrib/amd/fsinfo/wr_exportfs.c
+++ b/contrib/amd/fsinfo/wr_exportfs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wr_exportfs.c,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: wr_exportfs.c,v 5.2.2.1 1992/02/09 15:09:48 jsp beta $
*
*/
diff --git a/contrib/amd/fsinfo/wr_fstab.c b/contrib/amd/fsinfo/wr_fstab.c
index f03e1e3d79f9..49cbfc435119 100644
--- a/contrib/amd/fsinfo/wr_fstab.c
+++ b/contrib/amd/fsinfo/wr_fstab.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wr_fstab.c,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
+ * $Id: wr_fstab.c,v 5.2.2.1 1992/02/09 15:09:49 jsp beta $
*
*/
diff --git a/contrib/amd/hlfsd/hlfsd.c b/contrib/amd/hlfsd/hlfsd.c
index c9bf37b78bcf..1934824cbfe2 100644
--- a/contrib/amd/hlfsd/hlfsd.c
+++ b/contrib/amd/hlfsd/hlfsd.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: hlfsd.c,v 1.3 1998/11/14 03:13:31 obrien Exp $
+ * $Id: hlfsd.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
* HLFSD was written at Columbia University Computer Science Department, by
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@@ -83,22 +83,18 @@ char *alt_spooldir = ALT_SPOOLDIR;
char *home_subdir = HOME_SUBDIR;
char *logfile = DEFAULT_LOGFILE;
char *passwdfile = NULL; /* alternate passwd file to use */
-#if 0
char *progname;
-int foreground = 1; /* This is the top-level server */
-#endif
char *slinkname = 0;
char hostname[MAXHOSTNAMELEN + 1] = "localhost";
int cache_interval = DEFAULT_CACHE_INTERVAL;
+int foreground = 1; /* This is the top-level server */
gid_t hlfs_gid = (gid_t) INVALIDID;
int masterpid = 0;
int noverify = 0;
-int orig_umask = 022;
+int orig_umask;
int serverpid = 0;
nfstime startup;
-#if 0
pid_t mypid; /* Current process id */
-#endif
serv_state amd_state;
u_short nfs_port;
@@ -109,11 +105,9 @@ char *mnttab_file_name = MNTTAB_FILE_NAME;
char *mnttab_file_name = NULL;
#endif /* not MOUNT_TABLE_ON_FILE */
-#if 0
#ifdef DEBUG
int debug_flags = 0;
#endif /* DEBUG */
-#endif
/* forward declarations */
void hlfsd_going_down(int rc);
@@ -124,7 +118,7 @@ usage(void)
{
fprintf(stderr,
"Usage: %s [-Cfhnpv] [-a altdir] [-c cache-interval] [-g group]\n",
- am_get_progname());
+ progname);
fprintf(stderr, "\t[-i interval] [-l logfile] [-o mntopts] [-P passwdfile]\n");
show_opts('x', xlog_opt);
#ifdef DEBUG
@@ -143,7 +137,6 @@ main(int argc, char *argv[])
char hostpid_fs[MAXHOSTNAMELEN + 1 + 16]; /* room for ":(pid###)" */
char progpid_fs[PROGNAMESZ + 1 + 11]; /* room for ":pid" */
char preopts[128];
- char *progname;
int forcecache = 0;
int forcefast = 0;
int genflags = 0;
@@ -178,15 +171,14 @@ main(int argc, char *argv[])
progname = argv[0];
if ((int) strlen(progname) > PROGNAMESZ) /* truncate to reasonable size */
progname[PROGNAMESZ] = '\0';
- am_set_progname(progname);
- while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:pP:x:v")) != -1)
+ while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:pP:x:v")) != EOF)
switch (opt) {
case 'a':
if (!optarg || optarg[0] != '/') {
printf("%s: invalid directory for -a: %s\n",
- am_get_progname(), optarg);
+ progname, optarg);
exit(3);
}
alt_spooldir = optarg;
@@ -195,7 +187,7 @@ main(int argc, char *argv[])
case 'c':
if (!atoi(optarg)) {
printf("%s: invalid interval for -c: %s\n",
- am_get_progname(), optarg);
+ progname, optarg);
exit(3);
}
cache_interval = atoi(optarg);
@@ -216,7 +208,7 @@ main(int argc, char *argv[])
case 'i':
if (!atoi(optarg)) {
printf("%s: invalid interval for -i: %s\n",
- am_get_progname(), optarg);
+ progname, optarg);
exit(3);
}
reloadinterval.it_interval.tv_sec = atoi(optarg);
@@ -255,7 +247,7 @@ main(int argc, char *argv[])
#ifdef DEBUG
opterrs += debug_option(optarg);
#else /* not DEBUG */
- fprintf(stderr, "%s: not compiled with DEBUG -- sorry.\n", am_get_progname());
+ fprintf(stderr, "%s: not compiled with DEBUG -- sorry.\n", progname);
#endif /* not DEBUG */
break;
@@ -268,7 +260,7 @@ main(int argc, char *argv[])
if (xlog_level_init == ~0)
switch_option("");
/* need my pid before any dlog/plog */
- am_set_mypid();
+ mypid = getpid();
#ifdef DEBUG
switch_option("debug");
#endif /* DEBUG */
@@ -279,7 +271,7 @@ main(int argc, char *argv[])
*/
#if !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN)
if (!forcecache) {
- fprintf(stderr, "%s: will not be able to turn off attribute caches.\n", am_get_progname());
+ fprintf(stderr, "%s: will not be able to turn off attribute caches.\n", progname);
exit(1);
}
#endif /* !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN) */
@@ -310,19 +302,19 @@ main(int argc, char *argv[])
/* find gid for hlfs_group */
if ((grp = getgrnam(hlfs_group)) == (struct group *) NULL) {
fprintf(stderr, "%s: cannot get gid for group \"%s\".\n",
- am_get_progname(), hlfs_group);
+ progname, hlfs_group);
} else {
hlfs_gid = grp->gr_gid;
}
/* get hostname for logging and open log before we reset umask */
- gethostname(hostname, sizeof(hostname));
+ gethostname(hostname, sizeof hostname);
hostname[sizeof(hostname) - 1] = '\0';
if ((dot = strchr(hostname, '.')) != NULL)
*dot = '\0';
- orig_umask = umask(0);
if (logfile)
- switch_to_logfile(logfile, orig_umask);
+ switch_to_logfile(logfile);
+ orig_umask = umask(0);
#if defined(DEBUG) && !defined(MOUNT_TABLE_ON_FILE)
if (debug_flags & D_MTAB)
@@ -347,7 +339,7 @@ main(int argc, char *argv[])
if (slinkname)
*--slinkname = '/';
printf("%s: invalid mount directory/link %s\n",
- am_get_progname(), dir_name);
+ progname, dir_name);
exit(3);
}
@@ -362,7 +354,7 @@ main(int argc, char *argv[])
if ((stmodes.st_mode & 0555) != 0555) {
fprintf(stderr, "%s: directory %s not read/executable\n",
- am_get_progname(), dir_name);
+ progname, dir_name);
plog(XLOG_WARNING, "directory %s not read/executable",
dir_name);
}
@@ -380,7 +372,7 @@ main(int argc, char *argv[])
if (direntry != NULL) {
fprintf(stderr, "%s: %s/%s will be hidden by mount\n",
- am_get_progname(), dir_name, direntry->d_name);
+ progname, dir_name, direntry->d_name);
plog(XLOG_WARNING, "%s/%s will be hidden by mount\n",
dir_name, direntry->d_name);
}
@@ -389,7 +381,7 @@ main(int argc, char *argv[])
/* make sure alternate spool dir exists */
if ((errno = mkdirs(alt_spooldir, OPEN_SPOOLMODE))) {
fprintf(stderr, "%s: cannot create alternate dir ",
- am_get_progname());
+ progname);
perror(alt_spooldir);
plog(XLOG_ERROR, "cannot create alternate dir %s: %m",
alt_spooldir);
@@ -401,7 +393,7 @@ main(int argc, char *argv[])
if (lstat(dir_name, &stmodes) == 0 &&
(stmodes.st_mode & S_IFMT) != S_IFLNK) {
fprintf(stderr, "%s: failsafe %s not a symlink\n",
- am_get_progname(), dir_name);
+ progname, dir_name);
plog(XLOG_WARNING, "failsafe %s not a symlink\n",
dir_name);
} else {
@@ -410,7 +402,7 @@ main(int argc, char *argv[])
if (symlink(alt_spooldir, dir_name) < 0) {
fprintf(stderr,
"%s: cannot create failsafe symlink %s -> ",
- am_get_progname(), dir_name);
+ progname, dir_name);
perror(alt_spooldir);
plog(XLOG_WARNING,
"cannot create failsafe symlink %s -> %s: %m",
@@ -525,7 +517,7 @@ main(int argc, char *argv[])
* Update hostname field.
* Make some name prog:pid (i.e., hlfsd:174) for hostname
*/
- sprintf(progpid_fs, "%s:%d", am_get_progname(), masterpid);
+ sprintf(progpid_fs, "%s:%d", progname, masterpid);
/* Most kernels have a name length restriction. */
if ((int) strlen(progpid_fs) >= (int) MAXHOSTNAMELEN)
@@ -601,7 +593,7 @@ main(int argc, char *argv[])
fatal("nfsmount: %m");
} else { /* asked for -D nodaemon */
if (fork() == 0) { /* child runs mount */
- am_set_mypid();
+ mypid = getpid();
foreground = 0;
plog(XLOG_INFO, "child NFS mounting hlfsd service points");
if (mount_fs(&mnt, genflags, (caddr_t) &nfs_args, retry, type, 0, NULL, mnttab_file_name) < 0) {
@@ -678,7 +670,7 @@ hlfsd_init(void)
if (child != 0) { /* parent process - save child pid */
masterpid = child;
- am_set_mypid(); /* for logging routines */
+ mypid = getpid(); /* for logging routines */
return;
}
@@ -691,7 +683,7 @@ hlfsd_init(void)
plt_init(); /* initialize database */
plog(XLOG_INFO, "home directory database initialized");
- masterpid = serverpid = am_set_mypid(); /* for logging routines */
+ masterpid = serverpid = mypid = getpid(); /* for logging routines */
/*
* SIGALRM/SIGHUP: reload password database if timer expired
@@ -724,7 +716,7 @@ hlfsd_init(void)
#endif /* not HAVE_SIGACTION */
/*
- * SIGCHLD: interlock synchronization and testing
+ * SIGCHLD: interlock sycronization and testing
*/
#ifdef HAVE_SIGACTION
sa.sa_handler = interlock;
@@ -815,7 +807,7 @@ reload(int signum)
* can be rotated)
*/
if (signum == SIGHUP && logfile)
- switch_to_logfile(logfile, orig_umask);
+ switch_to_logfile(logfile);
/*
* parent performs the reload, while the child continues to serve
@@ -823,7 +815,7 @@ reload(int signum)
*/
if ((child = fork()) > 0) {
serverpid = child; /* parent runs here */
- am_set_mypid();
+ mypid = getpid();
plt_init();
@@ -847,7 +839,7 @@ reload(int signum)
} else {
/* let child handle requests while we reload */
serverpid = getpid();
- am_set_mypid();
+ mypid = getpid();
}
}
@@ -871,10 +863,10 @@ cleanup(int signum)
#endif /* DEBUG */
if (fork() != 0) {
masterpid = 0;
- am_set_mypid();
+ mypid = getpid();
return;
}
- am_set_mypid();
+ mypid = getpid();
for (;;) {
while ((umount_result = UMOUNT_FS(dir_name, mnttab_file_name)) == EBUSY) {
@@ -886,7 +878,7 @@ cleanup(int signum)
if (stat(dir_name, &stbuf) == 0 && stbuf.st_ino == ROOTID) {
plog(XLOG_ERROR, "unable to unmount %s", dir_name);
plog(XLOG_ERROR, "suspending, unmount before terminating");
- kill(am_mypid, SIGSTOP);
+ kill(mypid, SIGSTOP);
continue; /* retry unmount */
}
break;
@@ -922,7 +914,7 @@ reaper(int signum)
void
hlfsd_going_down(int rc)
{
- int mypid = getpid(); /* XXX: should this be the global am_mypid */
+ int mypid = getpid();
if (mypid == masterpid)
cleanup(0);
@@ -943,17 +935,17 @@ fatal(char *mess)
messlen = strlen(mess);
if (!STREQ(&mess[messlen + 1 - sizeof(ERRM)], ERRM))
- fprintf(stderr, "%s: %s\n", am_get_progname(), mess);
+ fprintf(stderr, "%s: %s\n", progname, mess);
else {
strcpy(lessmess, mess);
lessmess[messlen - 4] = '\0';
if (errno < sys_nerr)
- fprintf(stderr, "%s: %s: %s\n", am_get_progname(),
+ fprintf(stderr, "%s: %s: %s\n", progname,
lessmess, sys_errlist[errno]);
else
fprintf(stderr, "%s: %s: Error %d\n",
- am_get_progname(), lessmess, errno);
+ progname, lessmess, errno);
}
}
plog(XLOG_FATAL, mess);
diff --git a/contrib/amd/hlfsd/hlfsd.h b/contrib/amd/hlfsd/hlfsd.h
index 2c17792badad..dec5d918bcc0 100644
--- a/contrib/amd/hlfsd/hlfsd.h
+++ b/contrib/amd/hlfsd/hlfsd.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: hlfsd.h,v 1.1.1.1 1998/11/05 02:04:55 ezk Exp $
+ * $Id: hlfs.h,v 1.9 1993/09/13 15:11:00 ezk Exp $
*
* HLFSD was written at Columbia University Computer Science Department, by
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@@ -110,7 +110,7 @@
(fatal (strcat (strnsave ((str), strlen ((str)) + sizeof (ERRM) - 1), ERRM)))
/*
- * TYPEDEFS:
+ * TYPDEFS:
*/
typedef struct uid2home_t uid2home_t;
typedef struct username2uid_t username2uid_t;
diff --git a/contrib/amd/hlfsd/homedir.c b/contrib/amd/hlfsd/homedir.c
index e8e2257a47ee..b8c45c2ff534 100644
--- a/contrib/amd/hlfsd/homedir.c
+++ b/contrib/amd/hlfsd/homedir.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: homedir.c,v 1.2 1998/08/23 22:52:09 obrien Exp $
+ * $Id: homedir.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
* HLFSD was written at Columbia University Computer Science Department, by
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@@ -182,7 +182,7 @@ homedir(int userid)
* to the parent upon SIGCHLD in interlock().
*
*/
- am_set_mypid(); /* for logging routines */
+ mypid = getpid(); /* for logging routines */
if (seteuid(userid) < 0) {
plog(XLOG_WARNING, "could not seteuid to %d: %m", userid);
return linkval;
diff --git a/contrib/amd/hlfsd/nfs_prot_svc.c b/contrib/amd/hlfsd/nfs_prot_svc.c
index 8efe21111713..fc2e663ee42f 100644
--- a/contrib/amd/hlfsd/nfs_prot_svc.c
+++ b/contrib/amd/hlfsd/nfs_prot_svc.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_prot_svc.c,v 1.1.1.1 1998/11/05 02:04:55 ezk Exp $
+ * $Id: nfs_prot_svc.c,v 5.2.2.1 1992/02/09 15:09:30 jsp beta $
*
*/
diff --git a/contrib/amd/hlfsd/stubs.c b/contrib/amd/hlfsd/stubs.c
index 637bf09e868c..2ead112882c0 100644
--- a/contrib/amd/hlfsd/stubs.c
+++ b/contrib/amd/hlfsd/stubs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: stubs.c,v 1.1.1.1 1998/11/05 02:04:55 ezk Exp $
+ * $Id: stubs.c,v 1.10 1993/09/13 15:11:00 ezk Exp $
*
* HLFSD was written at Columbia University Computer Science Department, by
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@@ -132,7 +132,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
#ifndef MNT2_NFS_OPT_SYMTTL
/*
* This code is needed to defeat Solaris 2.4's (and newer) symlink
- * values cache. It forces the last-modified time of the symlink to be
+ * values cache. It forces the last-modifed time of the symlink to be
* current. It is not needed if the O/S has an nfs flag to turn off the
* symlink-cache at mount time (such as Irix 5.x and 6.x). -Erez.
*/
@@ -158,7 +158,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
un_fattr.na_fileid = uid;
res.ns_u.ns_attr_u = un_fattr;
#ifdef DEBUG
- dlog("nfs_getattr: successful search for uid=%d, gid=%d", uid, gid);
+ dlog("nfs_getattr: succesful search for uid=%d, gid=%d", uid, gid);
#endif /* DEBUG */
} else { /* not found */
res.ns_status = NFSERR_STALE;
@@ -233,7 +233,7 @@ nfsproc_lookup_2_svc(nfsdiropargs *argp, struct svc_req *rqstp)
return &res;
}
- /* if gets here, gid == hlfs_gid */
+ /* if get's here, gid == hlfs_gid */
if ((idx = untab_index(argp->da_name)) < 0) {
res.dr_status = NFSERR_NOENT;
return &res;
@@ -248,7 +248,7 @@ nfsproc_lookup_2_svc(nfsdiropargs *argp, struct svc_req *rqstp)
res.dr_u.dr_drok_u.drok_fhandle = un_fhandle;
res.dr_status = NFS_OK;
#ifdef DEBUG
- dlog("nfs_lookup: successful lookup for uid=%d, gid=%d: username=%s",
+ dlog("nfs_lookup: succesful lookup for uid=%d, gid=%d: username=%s",
uid, gid, untab[idx].username);
#endif /* DEBUG */
return &res;
@@ -279,7 +279,7 @@ getcreds(struct svc_req *rp, uid_t *u, gid_t *g)
case AUTH_DES:
adp = (struct authdes_cred *) rp->rq_clntcred;
*g = INVALIDID; /* some unknown group id */
- if (sscanf(adp->adc_fullname.name, "unix.%lu@", (u_long *) u) == 1)
+ if (sscanf(adp->adc_fullname.name, "unix.%lu@", u) == 1)
break;
/* fall through */
#endif /* HAVE_RPC_AUTH_DES_H */
diff --git a/contrib/amd/include/am_defs.h b/contrib/amd/include/am_defs.h
index 91650a6903af..b7d36c2f580f 100644
--- a/contrib/amd/include/am_defs.h
+++ b/contrib/amd/include/am_defs.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: am_defs.h,v 1.3 1998/11/14 03:13:32 obrien Exp $
+ * $Id: am_defs.h,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
*
*/
@@ -401,10 +401,6 @@ extern int errno;
* Actions to take if <rpcsvc/yp_prot.h> exists.
*/
#ifdef HAVE_RPCSVC_YP_PROT_H
-# ifdef HAVE_BAD_HEADERS
-/* avoid circular dependency in aix 4.3 with <rpcsvc/ypclnt.h> */
-struct ypall_callback;
-# endif /* HAVE_BAD_HEADERS */
# include <rpcsvc/yp_prot.h>
#endif /* HAVE_RPCSVC_YP_PROT_H */
@@ -491,18 +487,6 @@ struct ypall_callback;
/* conflicts with <statfsbuf.h> */
# define _SYS_STATFS_H
# endif /* HAVE_SOCKETBITS_H */
-# ifdef HAVE_LINUX_POSIX_TYPES_H
-# include <linux/posix_types.h>
-# endif /* HAVE_LINUX_POSIX_TYPES_H */
-# ifndef _LINUX_BYTEORDER_GENERIC_H
-# define _LINUX_BYTEORDER_GENERIC_H
-# endif /* _LINUX_BYTEORDER_GENERIC_H */
-/* conflicts with <sys/mount.h> in 2.1 kernels */
-# ifdef _SYS_MOUNT_H
-# ifdef BLOCK_SIZE
-# undef BLOCK_SIZE
-# endif /* BLOCK_SIZE */
-# endif /* _SYS_MOUNT_H */
# include <linux/fs.h>
#endif /* HAVE_LINUX_FS_H */
@@ -646,10 +630,6 @@ struct ypall_callback;
* Actions to take if <arpa/inet.h> exists.
*/
#ifdef HAVE_ARPA_INET_H
-# ifdef HAVE_BAD_HEADERS
-/* aix 4.3: avoid including <net/if_dl.h> */
-struct sockaddr_dl;
-# endif /* HAVE_BAD_HEADERS */
# include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */
@@ -1005,7 +985,7 @@ extern char *nc_sperror(void);
*/
#ifdef HAVE_TIUSER_H
/*
- * Some systems like AIX have multiple definitions for T_NULL and others
+ * Some systems like AIX have multiple definitions for T_NULL and othersd
* that are defined first in <arpa/nameser.h>.
*/
# ifdef HAVE_ARPA_NAMESER_H
@@ -1066,7 +1046,7 @@ extern char *nc_sperror(void);
#ifndef STAT_MACROS_BROKEN_notused
/*
* RedHat Linux 4.2 (alpha) has a problem in the headers that causes
- * duplicate definitions, and also some other nasty bugs. Upgrade to Redhat
+ * dupicate definitions, and also some other nasty bugs. Upgrade to Redhat
* 5.0!
*/
# ifdef HAVE_SYS_STAT_H
@@ -1250,10 +1230,6 @@ extern int getdtablesize(void);
extern int gethostname(char *name, int namelen);
#endif /* defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME) */
-#ifndef HAVE_EXTERN_GETLOGIN
-extern char *getlogin(void);
-#endif /* not HAVE_EXTERN_GETLOGIN */
-
#if defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE)
extern int getpagesize(void);
#endif /* defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE) */
@@ -1274,10 +1250,6 @@ extern int mkstemp(char *);
extern caddr_t sbrk(int incr);
#endif /* not HAVE_EXTERN_SBRK */
-#if defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID)
-extern int seteuid(uid_t euid);
-#endif /* not defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID) */
-
#ifndef HAVE_EXTERN_STRCASECMP
/*
* define this extern even if function does not exist, for it will
@@ -1311,9 +1283,12 @@ extern int wait3(int *statusp, int options, struct rusage *rusage);
#endif /* defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3) */
#ifndef HAVE_EXTERN_XDR_OPAQUE_AUTH
-extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth);
+extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
#endif /* not HAVE_EXTERN_XDR_OPAQUE_AUTH */
+#ifndef HAVE_EXTERN_GETLOGIN
+extern char *getlogin(void);
+#endif /* not HAVE_EXTERN_GETLOGIN */
/****************************************************************************/
/*
@@ -1325,13 +1300,13 @@ extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth);
#include <am_utils.h>
#include <amq_defs.h>
#include <aux_conf.h>
-/* compatibility with old amd, while autoconfiscating it */
+/* compatibilty with old amd, while autoconfistating it */
#include <am_compat.h>
/****************************************************************************/
/*
- * External definitions that depend on other macros available (or not)
+ * External defintions that depend on other macros available (or not)
* and those are probably declared in any of the above headers.
*/
diff --git a/contrib/amd/include/am_utils.h b/contrib/amd/include/am_utils.h
index 24741b8394f8..f4e0ccfcddbf 100644
--- a/contrib/amd/include/am_utils.h
+++ b/contrib/amd/include/am_utils.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: am_utils.h,v 1.2 1998/12/27 06:25:23 ezk Exp $
+ * $Id: am_utils.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
*
*/
@@ -158,7 +158,7 @@ extern int umount_fs(char *fs_name, const char *mnttabname);
*/
#define FSF_VALID 0x0001 /* Valid information available */
#define FSF_DOWN 0x0002 /* This fileserver is thought to be down */
-#define FSF_ERROR 0x0004 /* Permanent error has occurred */
+#define FSF_ERROR 0x0004 /* Permanent error has occured */
#define FSF_WANT 0x0008 /* Want a wakeup call */
#define FSF_PINGING 0x0010 /* Already doing pings */
#define FSRV_ISDOWN(fs) (((fs)->fs_flags & (FSF_DOWN|FSF_VALID)) == (FSF_DOWN|FSF_VALID))
@@ -425,7 +425,7 @@ typedef struct am_stats am_stats;
struct amd_stats {
int d_drops; /* Dropped requests */
int d_stale; /* Stale NFS handles */
- int d_mok; /* Successful mounts */
+ int d_mok; /* Succesful mounts */
int d_merr; /* Failed mounts */
int d_uerr; /* Failed unmounts */
};
@@ -495,7 +495,7 @@ extern char version[]; /* Version info */
/*
* Global variables.
*/
-extern AUTH *nfs_auth; /* Dummy authorization for remote servers */
+extern AUTH *nfs_auth; /* Dummy uthorisation for remote servers */
extern FILE *logfp; /* Log file */
extern am_node **exported_ap; /* List of nodes */
extern am_node *root_node; /* Node for "root" */
@@ -503,22 +503,8 @@ extern char *PrimNetName; /* Name of primary connected network */
extern char *PrimNetNum; /* Name of primary connected network */
extern char *SubsNetName; /* Name of subsidiary connected network */
extern char *SubsNetNum; /* Name of subsidiary connected network */
-
-#if 0
-extern char *progname; /* "amd" */
-#endif
-extern void am_set_progname(char *pn); /* "amd" */
-extern const char * am_get_progname(void); /* "amd" */
-extern void am_set_hostname(char *hn);
-extern const char * am_get_hostname(void);
-extern pid_t am_set_mypid(void);
-extern pid_t am_mypid;
-
-#if 0
+extern char *progname; /* "amd"|"mmd" */
extern char hostname[]; /* "kiska" */
-extern pid_t mypid; /* Current process id */
-#endif
-
extern int first_free_map; /* First free node */
extern int foreground; /* Foreground process */
extern int immediate_abort; /* Should close-down unmounts be retried */
@@ -527,6 +513,7 @@ extern int orig_umask; /* umask() on startup */
extern int task_notify_todo; /* Task notifier needs running */
extern int xlog_level; /* Logging level */
extern int xlog_level_init;
+extern pid_t mypid; /* Current process id */
extern serv_state amd_state; /* Should we go now */
extern struct in_addr myipaddr; /* (An) IP address of this host */
extern struct opt_tab xlog_opt[];
@@ -578,7 +565,6 @@ extern int make_nfs_auth(void);
extern int make_rpc_packet(char *, int, u_long, struct rpc_msg *, voidp, XDRPROC_T_TYPE, AUTH *);
extern int mapc_keyiter(mnt_map *, void(*)(char *, voidp), voidp);
extern int mapc_search(mnt_map *, char *, char **);
-extern int mapc_type_exists(const char *type);
extern int mkdirs(char *, int);
extern int mount_auto_node(char *, voidp);
extern int mount_automounter(int);
@@ -590,7 +576,7 @@ extern int pickup_rpc_reply(voidp, int, voidp, XDRPROC_T_TYPE);
extern int root_keyiter(void(*)(char *, voidp), voidp);
extern int softclock(void);
extern int switch_option(char *);
-extern int switch_to_logfile(char *logfile, int orig_umask);
+extern int switch_to_logfile(char *);
extern int timeout(u_int, void (*fn)(voidp), voidp);
extern int valid_key(char *);
extern mnt_map *mapc_find(char *, char *, const char *);
@@ -865,7 +851,7 @@ extern int amfs_link_fmount(mntfs *mf);
#endif /* HAVE_AM_FS_LINK */
/*
- * Symbolic-link file system, which also checks that the target of
+ * Symbolic-link file syste, which also checks that the target of
* the symlink exists.
* A "filesystem" which is just a symbol link.
*/
@@ -959,7 +945,7 @@ extern void print_nfs_args(const nfs_args_t *nap, u_long nfs_version);
#endif /* not DEBUG */
extern int debug_flags; /* Debug options */
-extern int debug_option (char *opt);
+extern int debug_option (char *);
extern struct opt_tab dbg_opt[];
extern void dplog(char *fmt, ...);
diff --git a/contrib/amd/include/am_xdr_func.h b/contrib/amd/include/am_xdr_func.h
index 206217cdfd43..936400280a9f 100644
--- a/contrib/amd/include/am_xdr_func.h
+++ b/contrib/amd/include/am_xdr_func.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: am_xdr_func.h,v 1.1.1.1 1998/11/05 02:04:43 ezk Exp $
+ * $Id: am_xdr_func.c,v 5.2.2.1 1992/02/09 15:08:40 ezk beta $
*
*/
diff --git a/contrib/amd/include/amq_defs.h b/contrib/amd/include/amq_defs.h
index f3caf8a15830..e2f941bfa027 100644
--- a/contrib/amd/include/amq_defs.h
+++ b/contrib/amd/include/amq_defs.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_defs.h,v 1.1.1.1 1998/11/05 02:04:44 ezk Exp $
+ * $Id: amq_defs.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/libamu/amu.h b/contrib/amd/libamu/amu.h
index 38532d013907..f69b99ed31dc 100644
--- a/contrib/amd/libamu/amu.h
+++ b/contrib/amd/libamu/amu.h
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amu.h,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: amu.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
*
*/
diff --git a/contrib/amd/libamu/clnt_sperrno.c b/contrib/amd/libamu/clnt_sperrno.c
deleted file mode 100644
index d3b48d1cd405..000000000000
--- a/contrib/amd/libamu/clnt_sperrno.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 1997-1998 Erez Zadok
- * Copyright (c) 1990 Jan-Simon Pendry
- * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Jan-Simon Pendry at Imperial College, London.
- *
- * 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 University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * %W% (Berkeley) %G%
- *
- * $Id: clnt_sperrno.c,v 5.2.2.1 1992/02/09 15:08:40 jsp beta $
- *
- */
-
-/*
- * Early RPC seems to be missing these..
- * Extracted from the RPC 3.9 sources as indicated
- */
-
-/* @(#)clnt_perror.c 1.1 87/11/04 3.9 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
-#include <am_defs.h>
-#include <amu.h>
-
-
-struct rpc_errtab {
- enum clnt_stat status;
- char *message;
-};
-
-static struct rpc_errtab rpc_errlist[] =
-{
- {RPC_SUCCESS,
- "RPC: Success"},
- {RPC_CANTENCODEARGS,
- "RPC: Can't encode arguments"},
- {RPC_CANTDECODERES,
- "RPC: Can't decode result"},
- {RPC_CANTSEND,
- "RPC: Unable to send"},
- {RPC_CANTRECV,
- "RPC: Unable to receive"},
- {RPC_TIMEDOUT,
- "RPC: Timed out"},
- {RPC_VERSMISMATCH,
- "RPC: Incompatible versions of RPC"},
- {RPC_AUTHERROR,
- "RPC: Authentication error"},
- {RPC_PROGUNAVAIL,
- "RPC: Program unavailable"},
- {RPC_PROGVERSMISMATCH,
- "RPC: Program/version mismatch"},
- {RPC_PROCUNAVAIL,
- "RPC: Procedure unavailable"},
- {RPC_CANTDECODEARGS,
- "RPC: Server can't decode arguments"},
- {RPC_SYSTEMERROR,
- "RPC: Remote system error"},
- {RPC_UNKNOWNHOST,
- "RPC: Unknown host"},
-/* { RPC_UNKNOWNPROTO,
- * "RPC: Unknown protocol" }, */
- {RPC_PMAPFAILURE,
- "RPC: Port mapper failure"},
- {RPC_PROGNOTREGISTERED,
- "RPC: Program not registered"},
- {RPC_FAILED,
- "RPC: Failed (unspecified error)"}
-};
-
-
-/*
- * This interface for use by clntrpc
- */
-char *
-clnt_sperrno(enum clnt_stat stat)
-{
- int i;
-
- for (i = 0; i < sizeof(rpc_errlist) / sizeof(struct rpc_errtab); i++) {
- if (rpc_errlist[i].status == stat) {
- return (rpc_errlist[i].message);
- }
- }
- return ("RPC: (unknown error code)");
-}
diff --git a/contrib/amd/libamu/hasmntopt.c b/contrib/amd/libamu/hasmntopt.c
index 2ed75f574578..7cf9167b2baf 100644
--- a/contrib/amd/libamu/hasmntopt.c
+++ b/contrib/amd/libamu/hasmntopt.c
@@ -17,7 +17,7 @@ n * modification, are permitted provided that the following conditions
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@ n * modification, are permitted provided that the following conditions
*
* %W% (Berkeley) %G%
*
- * $Id: hasmntopt.c,v 1.1.1.1 1998/11/05 02:04:44 ezk Exp $
+ * $Id: hasmntopt.c,v 5.2.2.2 1992/05/31 16:35:45 jsp Exp $
*
*/
@@ -84,7 +84,7 @@ nextmntopt(char **p)
cp++;
/*
- * If separator found the overwrite with null char.
+ * If separator found the overwrite with nul char.
*/
if (*cp) {
*cp = '\0';
diff --git a/contrib/amd/libamu/misc_rpc.c b/contrib/amd/libamu/misc_rpc.c
index ec34e3505cfc..b6d23cd9e535 100644
--- a/contrib/amd/libamu/misc_rpc.c
+++ b/contrib/amd/libamu/misc_rpc.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: misc_rpc.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: misc_rpc.c,v 5.2.2.1 1992/02/09 15:08:40 jsp beta $
*
*/
@@ -65,7 +65,7 @@ void
rpc_msg_init(struct rpc_msg *mp, u_long prog, u_long vers, u_long proc)
{
/*
- * Initialize the message
+ * Initialise the message
*/
memset((voidp) mp, 0, sizeof(*mp));
mp->rm_xid = 0;
diff --git a/contrib/amd/libamu/mount_fs.c b/contrib/amd/libamu/mount_fs.c
index 49e6c2d0461f..948b18df35ac 100644
--- a/contrib/amd/libamu/mount_fs.c
+++ b/contrib/amd/libamu/mount_fs.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mount_fs.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: mount_fs.c,v 5.2.2.2 1992/05/31 16:35:45 jsp Exp $
*
*/
@@ -315,7 +315,7 @@ again:
/*
* Fill in the many possible fields and flags of struct nfs_args.
*
- * nap: pre-allocated structure to fill in.
+ * nap: pre-allocted structure to fill in.
* mntp: mount entry structure (includes options)
* genflags: generic mount flags already determined
* nfsncp: (TLI only) netconfig entry for this NFS mount
diff --git a/contrib/amd/libamu/mtab.c b/contrib/amd/libamu/mtab.c
index 7fe95de98267..20cae62c1734 100644
--- a/contrib/amd/libamu/mtab.c
+++ b/contrib/amd/libamu/mtab.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mtab.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: mtab.c,v 5.2.2.1 1992/02/09 15:08:45 jsp beta $
*
*/
diff --git a/contrib/amd/libamu/nfs_prot_xdr.c b/contrib/amd/libamu/nfs_prot_xdr.c
index cbe679334dcc..2098b5dfb3b1 100644
--- a/contrib/amd/libamu/nfs_prot_xdr.c
+++ b/contrib/amd/libamu/nfs_prot_xdr.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: nfs_prot_xdr.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: nfs_prot_xdr.c,v 5.2.2.1 1992/02/09 15:09:32 jsp beta $
*
*/
diff --git a/contrib/amd/libamu/util.c b/contrib/amd/libamu/util.c
index 0650de260391..1198347fffa2 100644
--- a/contrib/amd/libamu/util.c
+++ b/contrib/amd/libamu/util.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,12 +38,12 @@
*
* %W% (Berkeley) %G%
*
- * $Id: util.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: util.c,v 5.2.2.2 1992/03/07 17:52:06 jsp Exp $
*
*/
/*
- * General Utilities.
+ * General Utilitiles.
*/
#ifdef HAVE_CONFIG_H
diff --git a/contrib/amd/libamu/wire.c b/contrib/amd/libamu/wire.c
index bd7b5ad025e7..f610f92485c7 100644
--- a/contrib/amd/libamu/wire.c
+++ b/contrib/amd/libamu/wire.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,14 +38,14 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wire.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: wire.c,v 5.2.2.2 1992/06/07 18:06:46 jsp Exp jsp $
*
*/
/*
* This function returns the subnet (address&netmask) for the primary network
* interface. If the resulting address has an entry in the hosts file, the
- * corresponding name is returned, otherwise the address is returned in
+ * corresponding name is retuned, otherwise the address is returned in
* standard internet format.
* As a side-effect, a list of local IP/net address is recorded for use
* by the islocalnet() function.
diff --git a/contrib/amd/libamu/xdr_func.c b/contrib/amd/libamu/xdr_func.c
index 365d390ad7e3..feafbae01e08 100644
--- a/contrib/amd/libamu/xdr_func.c
+++ b/contrib/amd/libamu/xdr_func.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: xdr_func.c,v 1.1.1.1 1998/11/05 02:04:45 ezk Exp $
+ * $Id: xdr_func.c,v 5.2.2.1 1992/02/09 15:08:40 jsp beta $
*
*/
diff --git a/contrib/amd/libamu/xutil.c b/contrib/amd/libamu/xutil.c
index d069f7a55fa1..15d2ceea7224 100644
--- a/contrib/amd/libamu/xutil.c
+++ b/contrib/amd/libamu/xutil.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: xutil.c,v 1.2 1998/12/27 06:25:24 ezk Exp $
+ * $Id: xutil.c,v 1.1 1997-1998/01/11 21:06:22 ezk Exp ezk $
*
*/
@@ -50,15 +50,6 @@
FILE *logfp = stderr; /* Log errors to stderr initially */
-static char *am_progname = "unknown"; /* "amd" */
-static char am_hostname[MAXHOSTNAMELEN + 1] = "unknown"; /* Hostname */
-pid_t am_mypid = -1; /* process ID */
-serv_state amd_state; /* amd's state */
-int foreground = 1; /* 1 == this is the top-level server */
-#ifdef DEBUG
-int debug_flags = 0;
-#endif /* DEBUG */
-
#ifdef HAVE_SYSLOG
int syslogging;
#endif /* HAVE_SYSLOG */
@@ -122,43 +113,6 @@ struct opt_tab xlog_opt[] =
};
-void
-am_set_progname(char *pn)
-{
- am_progname = pn;
-}
-
-
-const char *
-am_get_progname(void)
-{
- return am_progname;
-}
-
-
-void
-am_set_hostname(char *hn)
-{
- strncpy(am_hostname, hn, MAXHOSTNAMELEN);
- am_hostname[MAXHOSTNAMELEN] = '\0';
-}
-
-
-const char *
-am_get_hostname(void)
-{
- return am_hostname;
-}
-
-
-pid_t
-am_set_mypid(void)
-{
- am_mypid = getpid();
- return am_mypid;
-}
-
-
voidp
xmalloc(int len)
{
@@ -255,7 +209,7 @@ checkup_mem(void)
if (orig_mem_bytes == 0)
mem_bytes = orig_mem_bytes = uordbytes;
else {
- fprintf(logfp, "%s[%ld]: ", am_get_progname(), (long) am_mypid);
+ fprintf(logfp, "%s[%ld]: ", progname, (long) mypid);
if (mem_bytes < uordbytes) {
fprintf(logfp, "ALLOC: %ld bytes", uordbytes - mem_bytes);
} else {
@@ -271,7 +225,7 @@ checkup_mem(void)
/*
- * Take a log format string and expand occurrences of %m
+ * Take a log format string and expand occurences of %m
* with the current error code taken from errno.
*/
static void
@@ -344,9 +298,9 @@ show_time_host_and_name(int lvl)
break;
}
fprintf(logfp, "%15.15s %s %s[%ld]/%s ",
- last_ctime + 4, am_get_hostname(),
- am_get_progname(),
- (long) am_mypid,
+ last_ctime + 4, hostname,
+ progname,
+ (long) mypid,
sev);
}
@@ -576,7 +530,7 @@ cmdoption(char *s, struct opt_tab *optb, int *flags)
* This will log to stderr when parsing the command line
* since any -l option will not yet have taken effect.
*/
- plog(XLOG_USER, "option \"%s\" not recognized", s);
+ plog(XLOG_USER, "option \"%s\" not recognised", s);
errs++;
}
@@ -718,7 +672,7 @@ get_syslog_facility(const char *logfile)
* Change current logfile
*/
int
-switch_to_logfile(char *logfile, int old_umask)
+switch_to_logfile(char *logfile)
{
FILE *new_logfp = stderr;
@@ -734,7 +688,7 @@ switch_to_logfile(char *logfile, int old_umask)
#ifdef HAVE_SYSLOG
syslogging = 1;
new_logfp = stderr;
- openlog(am_get_progname(),
+ openlog(progname,
LOG_PID
# ifdef LOG_CONS
| LOG_CONS
@@ -751,7 +705,7 @@ switch_to_logfile(char *logfile, int old_umask)
#endif /* not HAVE_SYSLOG */
} else {
- (void) umask(old_umask);
+ (void) umask(orig_umask);
new_logfp = fopen(logfile, "a");
umask(0);
}
@@ -843,7 +797,6 @@ amu_release_controlling_tty(void)
#endif /* TIOCNOTTY */
#ifdef HAVE_SETSID
- /* XXX: one day maybe use vhangup(2) */
if (setsid() < 0) {
plog(XLOG_WARNING, "Could not release controlling tty using setsid(): %m");
} else {
diff --git a/contrib/amd/mk-amd-map/mk-amd-map.c b/contrib/amd/mk-amd-map/mk-amd-map.c
index 480629762fbe..1339485c552d 100644
--- a/contrib/amd/mk-amd-map/mk-amd-map.c
+++ b/contrib/amd/mk-amd-map/mk-amd-map.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: mk-amd-map.c,v 1.5 1998/11/14 03:13:32 obrien Exp $
+ * $Id: mk-amd-map.c,v 1.3 1998/08/27 02:56:47 obrien Exp $
*/
/*
@@ -51,20 +51,11 @@
#include <am_defs.h>
/* dummy variables */
-#if 0
-char *progname;
+char hostname[MAXHOSTNAMELEN];
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
-char hostname[MAXHOSTNAMELEN];
-/* (libdb version 2) uses .db extensions but an old dbm API */
-/* check for libgdbm to distinguish it from linux systems */
-#if defined(DBM_SUFFIX) && !defined(HAVE_LIBGDBM)
-# define HAVE_DB_SUFFIX
-#endif /* not defined(DBM_SUFFIX) && !defined(HAVE_LIBGDBM) */
#ifdef HAVE_MAP_NDBM
@@ -127,7 +118,7 @@ read_file(FILE *fp, char *map, voidp db)
int line_no = 0;
int errs = 0;
- while (read_line(key_val, 2048, fp)) {
+ while (read_line(key_val, sizeof(key_val), fp)) {
char *kp;
char *cp;
char *hash;
@@ -221,18 +212,14 @@ remove_file(char *f)
int
main(int argc, char *argv[])
{
- FILE *mapf; /* the input file to read from */
- int error;
- char *mapsrc;
- DBM *db = NULL;
+ FILE *mapf;
+ int mapfd = -1;
+ char *map;
+ int rc = 0;
+ DBM *mapd = NULL;
static char maptmp[] = "dbmXXXXXX";
-#ifdef HAVE_DB_SUFFIX
char maptdb[16];
- char *map_name_db = (char *) NULL;
-#else /* not HAVE_DB_SUFFIX */
- char maptpag[16], maptdir[16];
- char *map_name_pag = (char *) NULL, *map_name_dir = (char *) NULL;
-#endif /* not HAVE_DB_SUFFIX */
+ char *mapdb = (char *) NULL;
int len;
char *sl;
int printit = 0;
@@ -255,134 +242,97 @@ main(int argc, char *argv[])
fputs("Usage: mk-amd-map [-p] file-map\n", stderr);
exit(1);
}
- mapsrc = argv[optind];
+ map = argv[optind];
/* test if can get to the map directory */
- sl = strrchr(mapsrc, '/');
+ sl = strrchr(map, '/');
if (sl) {
*sl = '\0';
- if (chdir(mapsrc) < 0) {
+ if (chdir(map) < 0) {
fputs("Can't chdir to ", stderr);
- perror(mapsrc);
+ perror(map);
exit(1);
}
- mapsrc = sl + 1;
- }
-
- /* open source file */
- mapf = fopen(mapsrc, "r");
- if (!mapf) {
- fprintf(stderr, "cannot open source file ");
- perror(mapsrc);
- exit(1);
+ map = sl + 1;
}
-#ifndef DEBUG
- signal(SIGINT, SIG_IGN);
-#endif /* DEBUG */
-
if (!printit) {
- len = strlen(mapsrc);
-#ifdef HAVE_DB_SUFFIX
- map_name_db = (char *) malloc(len + 4);
- error = (map_name_db == NULL);
-#else /* not HAVE_DB_SUFFIX */
- map_name_pag = (char *) malloc(len + 5);
- map_name_dir = (char *) malloc(len + 5);
- error = (map_name_pag == NULL || map_name_dir == NULL);
-#endif /* not HAVE_DB_SUFFIX */
- if (error) {
+ len = strlen(map);
+ mapdb = (char *) malloc(len + 4);
+ if (!mapdb) {
perror("mk-amd-map: malloc");
exit(1);
}
+#ifdef HAVE_MKSTEMP
+ mapfd = mkstemp(maptmp);
+#else /* not HAVE_MKSTEMP */
+ map = mktemp(maptmp);
+ if (!maptmp) {
+ fprintf(stderr, "cannot create temporary file\n");
+ exit(1);
+ }
+ mapfd = open(map, O_RDONLY);
+#endif /* not HAVE_MKSTEMP */
- mktemp(maptmp);
-
- /* remove existing temps (if any) */
-#ifdef HAVE_DB_SUFFIX
+ /* open DBM files */
sprintf(maptdb, "%s.db", maptmp);
if (remove_file(maptdb) < 0) {
- fprintf(stderr, "Can't remove existing temporary file; ");
+ fprintf(stderr, "Can't remove existing temporary files;");
perror(maptdb);
exit(1);
}
-#else /* not HAVE_DB_SUFFIX */
- sprintf(maptpag, "%s.pag", maptmp);
- sprintf(maptdir, "%s.dir", maptmp);
- if (remove_file(maptpag) < 0 || remove_file(maptdir) < 0) {
- fprintf(stderr, "Can't remove existing temporary files; %s and ", maptpag);
- perror(maptdir);
- exit(1);
- }
-#endif /* not HAVE_DB_SUFFIX */
-
- db = dbm_open(maptmp, O_RDWR|O_CREAT, 0444);
- if (!db) {
- fprintf(stderr, "cannot initialize temporary database: %s", maptmp);
- exit(1);
- }
}
+ /* open and check if map file was opened OK */
+ mapf = fdopen(mapfd, "r");
+ if (mapf && !printit)
+ mapd = dbm_open(maptmp, O_RDWR|O_CREAT, 0444);
+ else
+ mapd = 0;
- /* print db to stdout or to temp database */
- error = read_file(mapf, mapsrc, db);
- fclose(mapf);
- if (error) {
- if (printit)
- fprintf(stderr, "Error reading source file %s\n", mapsrc);
- else
- fprintf(stderr, "Error creating database map for %s\n", mapsrc);
- exit(1);
- }
-
- if (printit)
- exit(0); /* nothing more to do */
-
- /* if gets here, we wrote to a database */
+#ifndef DEBUG
+ /* ignore ^C if debuggung is on (but why?) */
+ signal(SIGINT, SIG_IGN);
+#endif /* not DEBUG */
+
+ if (mapd || printit) {
+ int error = read_file(mapf, map, mapd);
+ (void) close(mapfd);
+ (void) fclose(mapf);
+ dbm_close(mapd);
+ if (printit) {
+ if (error) {
+ fprintf(stderr, "Error creating ndbm map for %s\n", map);
+ rc = 1;
+ }
+ } else {
- dbm_close(db);
- /* all went well */
+ if (error) {
+ fprintf(stderr, "Error reading source file %s\n", map);
+ rc = 1;
+ } else {
+ sprintf(mapdb, "%s.db", map);
+ if (unlink(mapdb) == 0)
+ fprintf(stderr, "WARNING: existing map \"%s.db\" destroyed\n", map);
+ if (rename(maptdb, mapdb) < 0) {
+ fprintf(stderr, "Couldn't rename %s to ", maptdb);
+ perror(mapdb);
+ /* Throw away the temporary map */
+ unlink(maptdb);
+ rc = 1;
+ }
+ }
+ }
-#ifdef HAVE_DB_SUFFIX
- sprintf(map_name_db, "%s.db", mapsrc);
- if (rename(maptdb, map_name_db) < 0) {
- fprintf(stderr, "Couldn't rename %s to ", maptdb);
- perror(map_name_db);
- /* Throw away the temporary map */
- unlink(maptdb);
- exit(1);
- }
-#else /* not HAVE_DB_SUFFIX */
- sprintf(map_name_pag, "%s.pag", mapsrc);
- sprintf(map_name_dir, "%s.dir", mapsrc);
- if (rename(maptpag, map_name_pag) < 0) {
- fprintf(stderr, "Couldn't rename %s to ", maptpag);
- perror(map_name_pag);
- /* Throw away the temporary map */
- unlink(maptpag);
- unlink(maptdir);
- exit(1);
+ } else {
+ fprintf(stderr, "Can't open \"%s.db\" for ", map);
+ perror("writing");
+ rc = 1;
}
- if (rename(maptdir, map_name_dir) < 0) {
- fprintf(stderr, "Couldn't rename %s to ", maptdir);
- perror(map_name_dir);
- /* remove the (presumably bad) .pag file */
- unlink(map_name_pag);
- /* throw away remaining part of original map */
- unlink(map_name_dir);
- /* throw away the temporary map */
- unlink(maptdir);
- fprintf(stderr, "WARNING: existing map \"%s.{dir,pag}\" destroyed\n",
- mapsrc);
- exit(1);
- }
-#endif /* not HAVE_DB_SUFFIX */
-
- exit(0);
+ exit(rc);
}
#else /* not HAVE_MAP_NDBM */
-int
main()
{
fputs("mk-amd-map: This system does not support hashed database files\n", stderr);
diff --git a/contrib/amd/scripts/Makefile.am b/contrib/amd/scripts/Makefile.am
index c4380584ec0e..9ebd6914cb6c 100644
--- a/contrib/amd/scripts/Makefile.am
+++ b/contrib/amd/scripts/Makefile.am
@@ -34,7 +34,7 @@ EXTRA_DIST = \
amd2sun.in \
ctl-amd.in \
ctl-hlfsd.in \
- fixrmtab.in \
+ fixrmtab \
fix-amd-map.in \
lostaltmail.in \
wait4amd.in \
diff --git a/contrib/amd/scripts/Makefile.in b/contrib/amd/scripts/Makefile.in
index a20d84627136..1c69cec2aecf 100644
--- a/contrib/amd/scripts/Makefile.in
+++ b/contrib/amd/scripts/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.3.2 from Makefile.am
+# Makefile.in generated automatically by automake 1.3.1 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -106,7 +106,7 @@ EXTRA_DIST = \
amd2sun.in \
ctl-amd.in \
ctl-hlfsd.in \
- fixrmtab.in \
+ fixrmtab \
fix-amd-map.in \
lostaltmail.in \
wait4amd.in \
@@ -122,7 +122,7 @@ CLEANFILES = $(sbin_SCRIPTS) $(bin_SCRIPTS)
mkinstalldirs = $(SHELL) $(top_srcdir)/aux/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = am-eject amd2ldif amd2sun ctl-amd ctl-hlfsd expn \
-fixrmtab fix-amd-map lostaltmail wait4amd wait4amd2die
+fix-amd-map lostaltmail wait4amd wait4amd2die
SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS)
man1dir = $(mandir)/man1
@@ -133,7 +133,7 @@ NROFF = nroff
DATA = $(sysconf_DATA)
DIST_COMMON = Makefile.am Makefile.in am-eject.in amd2ldif.in \
-amd2sun.in ctl-amd.in ctl-hlfsd.in expn.in fix-amd-map.in fixrmtab.in \
+amd2sun.in ctl-amd.in ctl-hlfsd.in expn.in fix-amd-map.in \
lostaltmail.in wait4amd.in wait4amd2die.in
@@ -163,8 +163,6 @@ ctl-hlfsd: $(top_builddir)/config.status ctl-hlfsd.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
expn: $(top_builddir)/config.status expn.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
-fixrmtab: $(top_builddir)/config.status fixrmtab.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
fix-amd-map: $(top_builddir)/config.status fix-amd-map.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
lostaltmail: $(top_builddir)/config.status lostaltmail.in
diff --git a/contrib/amd/scripts/amd.conf.5 b/contrib/amd/scripts/amd.conf.5
index 1f3472000b98..b652e9d87252 100644
--- a/contrib/amd/scripts/amd.conf.5
+++ b/contrib/amd/scripts/amd.conf.5
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.conf.5,v 1.5 1998/11/20 08:12:05 obrien Exp $
+.\" $Id: amd.conf.5,v 1.3 1998/09/05 06:56:36 obrien Exp $
.\"
.Dd April 7, 1997
.Dt AMD.CONF 5
@@ -60,8 +60,8 @@ automounter program.
.Sh FILE FORMAT
The file consists of sections and parameters. A section begins with the
name of the section in square brackets and continues until the next section
-begins or the end of the file is reached. Sections contain parameters of
-the form
+begins or the end the file is reached. Sections contain parameters of the
+form
.Sq name = value .
.Pp
The file is line-based - that is, each newline-terminated line represents
@@ -121,7 +121,7 @@ If
then amd's top-level mount points will be browsable to
.Xr readdir 3
calls. This means you could run for example
-.Xr ls 1
+.Xr ls 3
and see what keys are available to mount in that directory. Not all entries
are made visible to
.Xr readdir 3 :
@@ -222,7 +222,7 @@ cluster to use.
Same as the
.Fl D
option to
-.Nm amd .
+.Fl amd .
Specify any debugging options for
.Nm amd .
Works only if am-utils was configured for debugging using the
@@ -577,7 +577,7 @@ follows:
wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \\
wire!=slip-net;opts:=intr,rsize=8192,wsize=8192
.Ed
-.It Nm show_statfs_entries (boolean, default=no)
+.It Nm show_statfs_entries (boolean), default=no)
If
.Dq yes ,
then all maps which are browsable will also show the number of entries
@@ -588,7 +588,7 @@ runs.
.Po This is accomplished by returning non-zero values to the
.Xr statfs 2
.Pc system call .
-.It Nm unmount_on_exist (boolean, default=no)
+.It Nm unmount_on_exist (boolean), default=no)
If
.Dq yes ,
then
@@ -601,7 +601,7 @@ leaves all
mounted filesystems intact. Note that
.Nm amd
does not know about file systems mounted before it starts up, unless the
-.Ar restart_mounts
+.AR restart_mounts
option or
.Fl r
flag are used.
diff --git a/contrib/amd/scripts/ctl-amd.in b/contrib/amd/scripts/ctl-amd.in
index 8eefde27feb1..665a7dd89643 100755
--- a/contrib/amd/scripts/ctl-amd.in
+++ b/contrib/amd/scripts/ctl-amd.in
@@ -4,10 +4,6 @@
#
# Package: am-utils-6.0
# Author: Erez Zadok <ezk@cs.columbia.edu>
-#
-# chkconfig: 345 72 8
-# description: amd is the Berkeley AutoMount Daemon, used for \
-# automatic filesystem mounting
# set path
prefix=@prefix@
@@ -94,14 +90,14 @@ case "$1" in
'stop')
# prepend space to program name to ensure only amd process dies
- echo "killing amd..."
killproc " amd"
- wait4amd2die
;;
'restart')
# kill amd, wait for it to die, then restart
+ echo "killing amd..."
ctl-amd stop
+ wait4amd2die
if [ $? != 0 ]
then
echo "NOT restarting amd!"
diff --git a/contrib/amd/scripts/ctl-hlfsd.in b/contrib/amd/scripts/ctl-hlfsd.in
index e574d0d35393..a6e97f68edd9 100755
--- a/contrib/amd/scripts/ctl-hlfsd.in
+++ b/contrib/amd/scripts/ctl-hlfsd.in
@@ -4,10 +4,6 @@
#
# Package: am-utils-6.0
# Author: Erez Zadok <ezk@cs.columbia.edu>
-#
-# chkconfig: 345 73 7
-# description: hlfsd is a daemon similar to amd, used to redirect user
-# mail to home directory of the user
# set path
prefix=@prefix@
@@ -94,7 +90,7 @@ case "$1" in
echo "killing hlfsd..."
ctl-hlfsd stop
echo "Waiting for 10 seconds..."
- sleep 10 # hope that would be enough
+ sleep 10 # hope that's enough
echo "Restarting hlfsd..."
ctl-hlfsd start
;;
diff --git a/contrib/amd/scripts/expn.1 b/contrib/amd/scripts/expn.1
index 5795241e8584..b2bd1b6f6ed3 100644
--- a/contrib/amd/scripts/expn.1
+++ b/contrib/amd/scripts/expn.1
@@ -16,7 +16,7 @@ $sockaddr = 'S n a4 x8';
# system requirements:
# must have 'nslookup' and 'hostname' programs.
-# $Header: /src/cvsroot/am-utils-6.0/scripts/expn.1,v 1.1.1.1 1998/11/05 02:04:58 ezk Exp $
+# $Header: /home/muir/bin/RCS/expn,v 3.9 1995/10/02 17:51:35 muir Exp muir $
# TODO:
# less magic should apply to command-line addresses
diff --git a/contrib/amd/scripts/expn.in b/contrib/amd/scripts/expn.in
index 5bd4200ef013..b2bd1b6f6ed3 100755
--- a/contrib/amd/scripts/expn.in
+++ b/contrib/amd/scripts/expn.in
@@ -16,7 +16,7 @@ $sockaddr = 'S n a4 x8';
# system requirements:
# must have 'nslookup' and 'hostname' programs.
-# $Header: /src/cvsroot/am-utils-6.0/scripts/expn.in,v 1.1.1.1 1998/11/05 02:04:57 ezk Exp $
+# $Header: /home/muir/bin/RCS/expn,v 3.9 1995/10/02 17:51:35 muir Exp muir $
# TODO:
# less magic should apply to command-line addresses
diff --git a/contrib/amd/scripts/fixrmtab.in b/contrib/amd/scripts/fixrmtab
index 33b7bcfdb6ce..33b7bcfdb6ce 100755
--- a/contrib/amd/scripts/fixrmtab.in
+++ b/contrib/amd/scripts/fixrmtab
diff --git a/contrib/amd/tasks b/contrib/amd/tasks
index 260095e33e84..a29b554cae86 100644
--- a/contrib/amd/tasks
+++ b/contrib/amd/tasks
@@ -28,6 +28,8 @@ against all known IP addresses of this host.
- support multiple "fail-over" NFS mounts in Solaris 2.6.
+- add LSM file
+
- use packaging info for various OSs (such as RPM, Redhat Package Format)
- $mindelay and $maxdelay in milliseconds
@@ -54,16 +56,9 @@ through.
- report netbsd/openbsd bugs in BUGS file
+- contribute patches to automake 1.3
+
- reverse notion of -F and other cmd-line options, so they override the
amd.conf file (right now amd.conf overrides cmd-line options).
- y2k compliance.
-
-- an un/install script for binaries
-
-- update README
-add am-utils URL and COPYRIGHT to all distributed scripts and
-sources and programs etc.
-
-- ion: browsable_dirs only works for nis if in [global] broken if it is file
- maps.
diff --git a/contrib/amd/wire-test/wire-test.c b/contrib/amd/wire-test/wire-test.c
index be1dffa86aed..27525d03a1db 100644
--- a/contrib/amd/wire-test/wire-test.c
+++ b/contrib/amd/wire-test/wire-test.c
@@ -17,7 +17,7 @@
* 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 acknowledgment:
+ * must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: wire-test.c,v 1.3 1998/11/14 03:13:33 obrien Exp $
+ * $Id: wire-test.c,v 1.1.1.1 1998/08/23 22:07:21 obrien Exp $
*
*/
@@ -50,16 +50,10 @@
#define STRMAX 100
/* dummy variables */
-#if 0
-char *progname;
+char *progname, hostname[MAXHOSTNAMELEN + 1];
+int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
-int foreground, orig_umask;
-int debug_flags;
-#endif
-
-char hostname[MAXHOSTNAMELEN + 1];
-
int
main(int argc, char **argv)
@@ -71,13 +65,11 @@ main(int argc, char **argv)
struct sockaddr_in *ip;
struct hostent *hp = 0;
- am_set_progname(argv[0]);
-#if 0
+ progname = argv[0];
mypid = getpid();
orig_umask = umask(0);
-#endif
- if (gethostname(hostname, sizeof(hostname)) < 0) {
+ if (gethostname(hostname, sizeof hostname) < 0) {
perror(argv[0]);
exit(1);
}
diff --git a/contrib/bind/bin/named/Makefile b/contrib/bind/bin/named/Makefile
index 28f1ca7d92e3..7e30cd071592 100644
--- a/contrib/bind/bin/named/Makefile
+++ b/contrib/bind/bin/named/Makefile
@@ -46,7 +46,7 @@ PS=ps
LDFLAGS=
CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${DEFS}
-VER= LOCAL-`date +%Y%m%d.%H%M%S`
+VER= LOCAL-`date +%y%m%d.%H%M%S`
HOSTNAMECMD= hostname || uname -n
PROG= named
diff --git a/contrib/binutils/binutils/objcopy.1 b/contrib/binutils/binutils/objcopy.1
index e72444834bd7..6c98df8d32ad 100644
--- a/contrib/binutils/binutils/objcopy.1
+++ b/contrib/binutils/binutils/objcopy.1
@@ -253,7 +253,7 @@ most common symbol leading character is underscore. This option will
remove a leading underscore from all global symbols. This can be
useful if you want to link together objects of different file formats
with different conventions for symbol names. This is different from
-\fB\-\-change\-leading\-char\fP because it always changes the symbol name
+@code{--change-leading-char} because it always changes the symbol name
when appropriate, regardless of the object file format of the output
.TP
.B \-\-weaken
diff --git a/contrib/binutils/binutils/objdump.1 b/contrib/binutils/binutils/objdump.1
index 5fd1e23efb8f..69217b9d4106 100644
--- a/contrib/binutils/binutils/objdump.1
+++ b/contrib/binutils/binutils/objdump.1
@@ -263,7 +263,7 @@ architectures with the \fB\-i\fP option.
.TP
.B \-\-reloc
Print the relocation entries of the file. If used with \fB\-d\fP or
-\fB\-D\fP, the relocations are printed interspersed with the
+\fB\-d\fP, the relocations are printed interspersed with the
disassembly.
.TP
@@ -308,7 +308,7 @@ sections from an ELF file. This is only useful on systems (such as
Solaris 2.0) in which .stab debugging symbol-table entries are carried
in an ELF section. In most other file formats, debugging symbol-table
entries are interleaved with linkage symbols, and are visible in the
-\fB\-\-syms\fP output.
+\-\-syms output.
.TP
.BI "\-\-start\-address=" "address"
diff --git a/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c
index 603841e2a60d..d6a011b4bdc4 100644
--- a/contrib/binutils/binutils/strings.c
+++ b/contrib/binutils/binutils/strings.c
@@ -59,9 +59,9 @@
#include "libiberty.h"
#ifdef isascii
-#define isgraphic(c) (isascii (c) && (isprint (c) || isblank (c)))
+#define isgraphic(c) (isascii (c) && isprint (c))
#else
-#define isgraphic(c) (isprint (c) || isblank (c))
+#define isgraphic(c) (isprint (c))
#endif
#ifndef errno
diff --git a/contrib/binutils/binutils/strip.1 b/contrib/binutils/binutils/strip.1
index 11cdb188118a..7974612194af 100644
--- a/contrib/binutils/binutils/strip.1
+++ b/contrib/binutils/binutils/strip.1
@@ -150,7 +150,7 @@ other than \fB\-K\fR.
.B \-\-verbose
Verbose output: list all object files modified. In the case of
archives,
-.B "strip \-v"
+.B "strip \-V"
lists all members of the archive.
.TP
diff --git a/contrib/binutils/gas/doc/as.1 b/contrib/binutils/gas/doc/as.1
index 32cf67ce91db..adf28868eac1 100644
--- a/contrib/binutils/gas/doc/as.1
+++ b/contrib/binutils/gas/doc/as.1
@@ -9,7 +9,7 @@ GNU as \- the portable GNU assembler.
.na
.B as
.RB "[\|" \-a "[\|" dhlns "\|]" \c
-\&[\|\=\c
+\&\[\|\=\c
.I file\c
\&\|]\|]
.RB "[\|" \-D "\|]"
diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em
index ece1d2e0fae2..c4debe2a92a0 100644
--- a/contrib/binutils/ld/emultempl/elf32.em
+++ b/contrib/binutils/ld/emultempl/elf32.em
@@ -139,69 +139,8 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
EOF
if [ "x${host}" = "x${target}" ] ; then
if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
- case ${target} in
- *-*-freebsd*)
- cat >>e${EMULATION_NAME}.c <<EOF
-/*
- * Read the system search path the FreeBSD way rather than like Linux.
- */
-#include <elf.h>
-
-static boolean gld${EMULATION_NAME}_check_ld_elf_hints
- PARAMS ((const char *, int));
-
-static boolean
-gld${EMULATION_NAME}_check_ld_elf_hints (name, force)
- const char *name;
- int force;
-{
- static boolean initialized;
- static char *ld_elf_hints;
-
- if (! initialized)
- {
- FILE *f;
-
- f = fopen (_PATH_ELF_HINTS, FOPEN_RB);
- if (f != NULL)
- {
- struct elfhints_hdr hdr;
-
- if (fread(&hdr, 1, sizeof(hdr), f) == sizeof(hdr) &&
- hdr.magic == ELFHINTS_MAGIC &&
- hdr.version == 1)
- {
- if (fseek(f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
- {
- char *b;
-
- b = (char *) xmalloc (hdr.dirlistlen + 1);
- if (fread(b, 1, hdr.dirlistlen + 1, f) !=
- hdr.dirlistlen + 1)
- {
- free(b);
- }
- else
- {
- ld_elf_hints = b;
- }
- }
- }
- fclose (f);
- }
-
- initialized = true;
- }
-
- if (ld_elf_hints == NULL)
- return false;
+cat >>e${EMULATION_NAME}.c <<EOF
- return gld${EMULATION_NAME}_search_needed (ld_elf_hints, name, force);
-}
-EOF
- ;;
- *)
- cat >>e${EMULATION_NAME}.c <<EOF
/* For a native linker, check the file /etc/ld.so.conf for directories
in which we may find shared libraries. /etc/ld.so.conf is really
only meaningful on Linux, but we check it on other systems anyhow. */
@@ -282,8 +221,8 @@ gld${EMULATION_NAME}_check_ld_so_conf (name, force)
return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
}
+
EOF
- esac
fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
@@ -396,20 +335,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
if [ "x${host}" = "x${target}" ] ; then
if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
- case ${target} in
- *-*-freebsd*)
- cat >>e${EMULATION_NAME}.c <<EOF
- if (gld${EMULATION_NAME}_check_ld_elf_hints (l->name, force))
- break;
-EOF
- ;;
- *)
- cat >>e${EMULATION_NAME}.c <<EOF
+cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
break;
EOF
- ;;
- esac
fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
diff --git a/contrib/cvs/contrib/log.pl b/contrib/cvs/contrib/log.pl
index 4bb935a5f337..e4fb9b1d3fbc 100644
--- a/contrib/cvs/contrib/log.pl
+++ b/contrib/cvs/contrib/log.pl
@@ -91,7 +91,6 @@ $mailcmd = "| Mail -s 'CVS update: $modulepath'";
@days = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
-$year+=1900;
# get a login name for the guy doing the commit....
#
@@ -112,12 +111,12 @@ if ($users) {
#
print OUT "\n";
print OUT "****************************************\n";
-print OUT "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n";
+print OUT "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
print OUT "Author:\t$login\n\n";
if (MAIL) {
print MAIL "\n";
- print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n";
+ print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . sprintf("%02d", $min) . "\n";
print MAIL "Author:\t$login\n\n";
}
diff --git a/contrib/cvs/contrib/sccs2rcs.csh b/contrib/cvs/contrib/sccs2rcs.csh
index 8243890603dd..a1dea01b19e7 100644
--- a/contrib/cvs/contrib/sccs2rcs.csh
+++ b/contrib/cvs/contrib/sccs2rcs.csh
@@ -177,7 +177,7 @@ foreach sfile (SCCS/s.*)
if ($status != 0) goto ERROR
# get file into current dir and get stats
- set date = `sccs prs -r$rev $file | grep "^D " | awk '{y=$3; if($3 < 100) {y+=1900};printf("%s %s", y, $4);exit;}'`
+ set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'`
set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'`
echo ""
echo "==> file $file, rev=$rev, date=$date, author=$author"
diff --git a/contrib/cvs/man/cvs.1 b/contrib/cvs/man/cvs.1
index bbcc56994b66..f3e453fa4501 100644
--- a/contrib/cvs/man/cvs.1
+++ b/contrib/cvs/man/cvs.1
@@ -244,25 +244,6 @@ Overrides the setting of the
.SM CVSREAD
environment variable.
.TP
-.B \-g
-Forces group-write perms on working files. This option is typically
-used when you have multiple users sharing a single checked out source
-tree, allowing them to operate their shells with a less dangerous umask.
-To use this feature, create a directory to hold the checked-out source
-tree, set it to a private group, and set up the directory such that
-files created under it inherit the group id of the directory. This occurs
-automatically with FreeBSD. With SysV you must typically set the SGID bit
-on the directory. The users who are to share the checked out tree must
-be placed in that group. Note that the sharing of a single checked-out
-source tree is very different from giving several users access to a common
-CVS repository. Access to a common CVS repository already maintains shared
-group-write perms and does not require this option.
-
-To use the option transparently, simply place the line 'cvs -g' in your
-~/.cvsrc file. Doing this is not recommended unless you firewall all your
-source checkouts within a private group or within a private mode 0700
-directory.
-.TP
.B \-x
Encrypt all communication between the client and the server. As of
this writing, this is only implemented when using a Kerberos
diff --git a/contrib/cvs/src/main.c b/contrib/cvs/src/main.c
index 9cb7bc0e55a5..8136f5f55565 100644
--- a/contrib/cvs/src/main.c
+++ b/contrib/cvs/src/main.c
@@ -211,7 +211,6 @@ static const char *const opt_usage[] =
" -q Cause CVS to be somewhat quiet.\n",
" -r Make checked-out files read-only.\n",
" -w Make checked-out files read-write (default).\n",
- " -g Force group-write perms on checked-out files.\n",
" -l Turn history logging off.\n",
" -n Do not execute anything that will change the disk.\n",
" -t Show trace of program execution -- try with -n.\n",
@@ -481,7 +480,7 @@ main (argc, argv)
opterr = 1;
while ((c = getopt_long
- (argc, argv, "+QqgrwtnRlvb:T:e:d:Hfz:s:xaU", long_options, &option_index))
+ (argc, argv, "+QqrwtnRlvb:T:e:d:Hfz:s:xaU", long_options, &option_index))
!= EOF)
{
switch (c)
@@ -514,13 +513,6 @@ main (argc, argv)
case 'w':
cvswrite = 1;
break;
- case 'g':
- /*
- * force full group write perms (used for shared checked-out
- * source trees, see manual page)
- */
- umask(umask(077) & 007);
- break;
case 't':
trace = 1;
break;
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h
index e610b5fb8769..d55c8f814d21 100644
--- a/contrib/gcc/config/i386/freebsd.h
+++ b/contrib/gcc/config/i386/freebsd.h
@@ -477,7 +477,7 @@ do { \
#endif /* FREEBSD_NATIVE */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -D__FreeBSD_cc_version=300001 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
+#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
#undef CPP_SPEC
#if TARGET_CPU_DEFAULT == 2
diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed
index e610b5fb8769..d55c8f814d21 100644
--- a/contrib/gcc/config/i386/freebsd.h.fixed
+++ b/contrib/gcc/config/i386/freebsd.h.fixed
@@ -477,7 +477,7 @@ do { \
#endif /* FREEBSD_NATIVE */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -D__FreeBSD_cc_version=300001 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
+#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
#undef CPP_SPEC
#if TARGET_CPU_DEFAULT == 2
diff --git a/contrib/gcc/gcc.1 b/contrib/gcc/gcc.1
index 36ca556376c1..f1a72e6de346 100644
--- a/contrib/gcc/gcc.1
+++ b/contrib/gcc/gcc.1
@@ -525,12 +525,12 @@ in the following sections.
.TP
.BI "\-pthread"
Link a user-threaded process against libc_r instead of libc. Objects linked
-into user-threaded processes should be compiled with -D_THREAD_SAFE.
+into user-threaded processes should be compiled with -D_THREADSAFE.
.TP
.BI "\-kthread"
Link a kernel-threaded process against libpthread in addition to libc.
Objects linked into kernel-threaded processes should be compiled with
--D_THREAD_SAFE.
+-D_THREADSAFE.
.SH OVERALL OPTIONS
.TP
.BI "\-x " "language"
diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c
index b7a55ea275e7..fa9d5c0212f3 100644
--- a/contrib/gcc/gcc.c
+++ b/contrib/gcc/gcc.c
@@ -2328,8 +2328,12 @@ struct infile
};
#if defined(FREEBSD_NATIVE) && defined(__i386__)
+#if defined(FREEBSD_AOUT)
+static int objformat_aout = 1; /* set default format in absense of */
+#else /* any other hints. */
static int objformat_aout = 0;
#endif
+#endif
/* Also a vector of input files specified. */
diff --git a/contrib/global/COPYING b/contrib/global/COPYING
index a13b649971f3..fb3baa4d627d 100644
--- a/contrib/global/COPYING
+++ b/contrib/global/COPYING
@@ -1,17 +1,15 @@
- @@@@@@@=)))
- @=))) @=))) @=)))
- @=))) @=)))
- @=))) @=))) @@@@@=)@@@@@@=))) @@=) @=)))
- @=))F o r a l l)) h a c k e r s.))) @=@=))@=)))
- @=))) @@@@@@=@=)))@=))) @=)@@@@@=)))@= @=))@=)))
- @=))) @=))@=)))@=))) @=)@=)))@=)@@@@@=))@=)))
- @=))) @=))@=)))@=))) @=)@=)))@=@=)))@=))@=)))
- @@@@@@@@=)))@@@@=)@@@@@=)@@@@@@=@@@=)@@@@=)@@@@@@=)))
+ @@@@@@@=
+ @= @=
+ @= @=
+ @= @= @@@@@= @@@@@@= @@= @=
+ @= F o r a l l h a c k e r s. @=@= @=
+ @= @@@@@@=@= @= @= @@@@@= @= @= @=
+ @= @= @= @= @= @= @= @@@@@= @=
+ @= @= @= @= @= @= @=@= @= @=
+ @@@@@@@@= @@@@= @@@@@= @@@@@@=@@@= @@@@= @@@@@@=
-
-
-This software is covered by the followings:
+This software is covered by the following:
Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
@@ -42,8 +40,7 @@ This software is covered by the followings:
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
-Portions of gozilla(1):
+Portions of gozilla(1) are covered by the following:
Copyright 1996 Netscape Communications Corporation, all rights reserved.
Created: Jamie Zawinski <jwz@netscape.com>, 24-Dec-94.
diff --git a/contrib/global/FAQ b/contrib/global/FAQ
deleted file mode 100644
index 01697ff747bb..000000000000
--- a/contrib/global/FAQ
+++ /dev/null
@@ -1,67 +0,0 @@
-
-Frequentry Asked Questions about GLOBAL.
-
-----------------------------------------------------------------------------
-Q1. Htags(1) aborts by short of memory. Why? Any workaround?
-
- % htags
- Out of memory!
- % _
-
-A1. It seems that Perl4 leaks memory. If you use that version of perl,
- then you had better to use Perl5. This works well.
-
-----------------------------------------------------------------------------
-Q2. Global(1) and btreeop(1) sometimes core dumps when using a large tag file.
- Any workaround?
-
-A2. Btree(3) core dumps with a certain data set.
- Please apply the patches in this package. See ./dbpatches/README.
-
-----------------------------------------------------------------------------
-Q3. GLOBAL skip some functions.
- For example, GLOBAL skip the function 'func' in this example.
-
- #define M(a) static char *string = a;
-
- M(a)
-
- func() { <= GLOBAL skip func().
- ...
- }
-
-A3. GLOBAL cannot recognize that pattern, because M(a) seems to be
- a function definition.
-
- It should be follows.
-
- #define M(a) static char *string = a
-
- M(a); <= end with ';'
-
- func() {
- ...
- }
-
- Otherwise, you can tell gtags(1) that by listing the macros in
- '.notfunction' file in current directory.
-
- [.notfunction]
- +---------------
- |M
- |...
-
-----------------------------------------------------------------------------
-Q4. I have set up 'global.conf' to use emacs's ctags command with GLOBAL
- but I cannot use htags.
-
- % gtags
- % htags
- htags: GTAGS and GRTAGS not found. Please make them.
- % ls G*
- GPATH GTAGS
-
-A4. Emacs's ctags cannot locate function referencies. So, gtags cannot make
- GRTAGS tag file with it. With the result that you cannot use htags and
- global's -r option.
-----------------------------------------------------------------------------
diff --git a/contrib/global/HISTORY b/contrib/global/HISTORY
index 2b8072acfe2b..d850075c7058 100644
--- a/contrib/global/HISTORY
+++ b/contrib/global/HISTORY
@@ -1,4 +1,3 @@
-
GLOBAL history
--------------
@@ -6,8 +5,6 @@ version 1.0 Initial version [21-Apr-96]
global, gtags, btreeop, extended ctags.
- Thanks to Sadaichi Hayashida. Generating relative path is his idea.
-
version 1.1 Only bugfix [2-May-96]
[fixed bug]
@@ -220,8 +217,8 @@ version 2.1 Symbol search, incremental update and gozilla [20-Sep-97]
These options become default, so you need not to specify
them. Gtags accepts these options for compatibility but
no effect.
- global - understand 'obj'(MAKEOBJDIR) directory and '/usr/obj'
- (MAKEOBJDIRPREFIX) directory of BSD build system.
+ global - understand not only 'obj'(MAKEOBJDIR) directory but also
+ '/usr/obj'(MAKEOBJDIRPREFIX) directory of BSD build system.
Thanks to Jordan K. Hubbard. This is his idea.
@@ -307,12 +304,12 @@ version 2.21 Bugfix and slightly modified [11-Dec-97]
- replace `lorder $(OBJS) | tsort -q` to already sorted list.
for S.u.S.E Linux 5.1.
- Thanks to Christoph Conrad for his information.
+ Thanks to Christoph Conrad for his information.
gtags, lib/test.c
- some change for Solaris environment.
- Thanks to Yamashita TAKAO for his information.
+ Thanks to Yamashita TAKAO for his information.
htags/Makefile, systags/Makefile
- ${DESTDIR}/usr/bin -> ${DESTDIR}${BINDIR}
@@ -326,14 +323,14 @@ version 2.22 GRTAGS support for assembler source [26-Dec-97]
call EXT(xxx)
call _xxx
- Thanks to Yamashita TAKAO for his idea.
+ Thanks to Yamashita TAKAO for his idea.
version 2.23 Bugfix and slightly modified [13-Jan-98]
[fixed bug]
gctags - GRTAGS support in version 2.22 doesn't work.
- Thanks to Yamashita TAKAO for his bug report.
+ Thanks to Yamashita TAKAO for his bug report.
[changed]
gctags/Makefile, gctags/Makefile.generic
@@ -350,216 +347,11 @@ version 2.24 Only bugfix [20-Jan-98]
global - generates wrong path name when GTAGSROOT includes symbolic
links.
- Thanks to Wolfgang Helbig for his bug report.
+ Thanks to Wolfgang Helbig for his bug report.
htags - cannot treat path name which includes digit as the second
character like 'i386'. (In fact it was expand(1)'s bug.)
- Thanks to Andrew Gallatin for his bug report.
+ Thanks to Andrew Gallatin for his bug report.
global - doesn't search 'obj' directory correctly.
-
-version 3.0 configuration file and compact format. [25-Jun-98]
-
- [fixed bug]
- gozilla - leaks memory.
- gctags - -s option pick up symbols which belongs to GTAGS or GRTAGS.
- global - cannot treat file which doesn't end with '\n'.
- gtags - incremental update cannot detect removed files.
- (GPATH file added.)
- - make corrupted tag files.
- (dbpatches/README added.)
-
- Thanks to Van Trinh for his bug report and information.
-
- htags - cannot be viewed by IE 5.0 because illegal <NOFRAME> tag.
-
- Thanks to Yoshida Masato for his bug report and fix patch.
-
- [changed]
- gctags - -c option removed. These code was moved to gtags.
- (It was needed for supporting plugged-in parser.)
- global - -f option excute tag command instead of reading tag file.
- (It became very faster than previous version.)
- gtags.el- check whether or not user want to use tag name completion.
- htags - URL of GLOBAL home page changed.
- systags - gtags's option changed from -v to -cov.
- gtags.c - replace "%+" of strftime with "%a %b %e %H:%M:%S %Z %Y".
- for Debian GNU linux 1.3.1.
-
- [added]
- gtags - -c option added. (compact format)
-
- Thanks to Takeshi Hojo. Compact format is based on his concept.
-
- htags - -c option added. (to make gzipped html file)
-
- Thanks to Oliver Paukstadt. This option is his idea.
-
- gtags, htags
- - support configuration file.
- (/etc/global.conf or $HOME/.globalrc)
- gctags - -n option added.
- --config option added. (It's undocumented.)
- global - -t option added.
- This option is to use with 'tagprg' and 'tagprgonce' command
- in Elvis editor (2.1g-beta or later).
-
- Thanks to Steve Kirkendall for his excellent editor and
- refined command set.
-
-version 3.01 Almost bugfix [5-Jul-98]
-
- [fixed bug]
- global - print file names in a line.
- gozilla - assume html file as a source file.
- btreeop - insufficient usage check.
- htags - cannot treat path including "++".
-
- [changed]
- global - -f option became to accept multiple files.
- all - fixed warning by -Wall -Wmissing-prototypes.
-
-version 3.1 Support of Java language [4-Aug-98]
-
- [fixed bug]
- htags - locate main functions from the path which belongs
- GTAGSLIBPATH when there is no main function in the local
- source tree.
-
- [added]
- gtags, global, htags, gozilla, gtags.el
- - java supprt added.
- gtags - --find option added. (internal use only - undocumented)
- - --expand option added. (internal use only - undocumented)
- htags - -h option (title header frame) added.
-
- Thanks to Shigeyuki Yamano. This is his idea.
-
- - line comment('//') detection added.
- gctags, systags
- - GTAGSSPECIAL environment variable added to treat system
- macros like 'SYSINIT' in FreeBSD.
- global.conf, lib/conf.c
- - 'CVS/' added to 'skip' parameter.
-
- [deleted]
- gtags.conf
- - 'reserved_words' for htags(1) was deleted.
- It is hard coded.
-
- [changed]
- htags.pl- print guide links in .h file too.
-
-version 3.2 new patch for nvi-1.79(1.66) and multilingual nvi [31-Aug-98]
-
- [fixed bug]
- nvi-1.79.diff
- - may have buffer overflow.
-
- Thanks to David Brownlee for his advice.
-
- - suppress error message 'GTAGS not found'.
-
- [added]
- nvi-1.79-m17n.diff
- - patch for multilingual nvi which is included FreeBSD as
- a ports.
- nvi-1.66.diff
- - patch for nvi-1.66 which is native command of NetBSD 1.3.2
-
- [deleted]
- nvi-1.34.diff
- - it is old enough to support.
-
- [changed]
- gozilla/Imakefile
- - make possible to build gozilla alone without building
- libgloutil.a.
-
-version 3.3 Rewriting gctags(1) and some bug fix. [13-Sep-98]
-
- [fixed bug]
- gctags - look over inner class in a method.(Java)
- - cannot treat 'OBJECT.class' pattern correctly.(Java)
-
- [changed]
- Makefile*
- - library name changed from libutil.a to libgloutil.a becase
- that is already used.
- - definition of MANDIR deleted.
- global.conf
- - comment fixed.
- systags.sh
- - additional support for NetBSD, OpenBSD, GNUmach and GNUhurd.
- - doesn't use CGI form by default.
- - use gtags -l and -h option by default.
- - -g(gtags only), -f(form) and -c(compact) option added.
-
- [deleted]
- gctags - fortran and lisp language support were deleted, because
- it was not supported in GLOBAL system.
- - -a, -d, -f, -t, -u, -w, -v options were deleted,
- because it was not used in GLOBAL system.
- - -D, -x options were deleted. These options became default.
- - GTAGSSPECIAL was deleted.
-
- [added]
- gctags - #if (#else #elif) #endif block parsing added.
- - pick up #define in assembler source.
- - can pick up object like 'definition\n\n() {'.
- - -b, -n, -w options were added.
- gtags.el- gtags-display-browser(ESC-h) command added.
- INSTALL - explanation about formatting online manuals added.
-
- Thanks to Bert Gijsbers for his investigation.
-
- Extended ctags has been completely replaced with new gctags.
- Thanks to Ken Arnold and the other people who developped BSD ctags(1).
- Without it, GLOBAL had never been here.
-
-version 3.4 Unlimited nested index of htags(1). [8-Nov-98]
-
- [added]
- global - --filter option added. (internal use only - undocumented)
- htags - tabs parameter added in global.conf to change tab stop.
- btreeop - '2' option added to the -L command.
-
- [changed]
- htags - unlimited nested index of files supported.
- README, htags.1,
- - statements fixed.
-
- Thanks to Silas S. Brown for his fixing the statements.
-
- Makefile.generic
- - make sub makefiles inherit the macros from the root Makefile.
-
-version 3.41 description added to README file. [10-Dec-98]
-
- [added]
- README - usage description added.
- '5. Elvis using global'
- 'A.3. Incremental updating'
- INSTALL - description about Elvis added.
-
- [change]
- global - -t option is available with -P command.
- global - assume "global -c ''" as "global -c".
-
- [deleted]
- nvi-1.79-m17n.diff
- - because it is difficult for me to maintain. Sorry.
-
-version 3.42 a couple of bugs fixed. [8-Jan-99]
-
- [fixed]
- btreeop.c,gctags.c,global.c,gozilla.c,remote.c,gtags.c
- - 'void main()' is not valid by the C spec.
-
- Thanks to David Brownlee for his patch.
-
- gtags.el- redefinition problem fixed.
- (renamed match-string to util-match-string.)
-
- Thanks to Daisuke Kawahara for his bug report.
diff --git a/contrib/global/INSTALL b/contrib/global/INSTALL
index a047c1e73d92..d958971fc6a2 100644
--- a/contrib/global/INSTALL
+++ b/contrib/global/INSTALL
@@ -1,7 +1,7 @@
Installation of GLOBAL
- 6-Dec-1998 Shigio Yamaguchi
+ 20-Jan-1998 Shigio Yamaguchi
---------------------------------------------------------------------------
Guide line (C style)
---------------------------------------------------------------------------
@@ -14,30 +14,26 @@ if (Your system == FreeBSD) {
case 2.0.5R:
case 2.1.0R:
case 2.1.5R:
+ There is no problem.
+ break;
case 2.1.6R:
case 2.1.7R:
+ I don't know. But it seems same with 2.1.5R.
+ break;
case 2.2.1R:
- There is no problem.
+ It is OK. But your native nvi is version 1.71.
+ Use 1.79 nvi available on the Internet.
break;
case 2.2.2R:
case 2.2.5R:
- case 2.2.6R:
- case 2.2.7R:
- Your system includes GLOBAL 1.9 or 2.24.
- You can overwrite it with this package.
+ Your system inlucdes GLOBAL 1.9. You can overwrite it
+ with this 2.2 package.
+ But skip procedure "3. Extended vi (OPTIONAL)", because
+ your /usr/bin/nvi is already extended nvi for GLOBAL.
break;
default:
I don't know. But it seems to be little problem.
}
-} else if (Your system == NetBSD 1.3.2) {
- You are lucky!
- You need not to do procedure "1. Preparation for generic UNIX"
- and you can use nvi-1.66.diff for native nvi.
-} else if (Your system == Debian GNU linux 1.3.1) {
- You are lucky!
-
- You can skip most of "1. Preparation for generic UNIX" except for
- "a) Generic makefile".(It's very easy.)
} else {
You may some error messages to make GLOBAL.
But it seems not so difficult to clear it. If you make a patch for it,
@@ -47,8 +43,6 @@ if (Your system == FreeBSD) {
Thank you in advance.
}
-Please see ./dbpatches/README.
-
----------------------------------------------------------------------------
Install procedure
----------------------------------------------------------------------------
@@ -62,47 +56,31 @@ Install procedure
1. Preparation for generic UNIX
- If you are a user of FreeBSD (all version) or NetBSD 1.3.2 then
- nothing to do here. Please go to "2. GLOBAL basic".
+ If you are a FreeBSD (all version) user, nothing to do here.
+ Please go to "2. GLOBAL basic".
- Otherwise, you must check following items before you install GLOBAL.
+ Otherwise, you must install following items before you install GLOBAL.
- a) Generic makefile (necessary)
+ a) Generic makefile
This package includes generic makefile. Please do the followings.
% make -f Makefile.generic gen
- % vi Makefile <- check variables like BINDIR, MANDIR, ...
-
- b) Some UNIX tools (necessary)
-
- Find(1), sed(1), sort(1), uniq(1) are needed.
- If your environment is UNIX, you have them. You can confirm it like this.
+ % vi Makefile <- check install directories (BINDIR, MANDIR)
- % which find
- /usr/bin/find
- %
-
- c) POSIX regular expression (extension) library (necessary)
-
- If you don't have it, you can use GNU's regex library (regex-0.12.tar.gz).
- See following site.
-
- http://www.gnu.org/order/ftp.html
-
- d) BSD db library version 1.85 (necessary)
+ b) BSD db library version 1.85
If you don't have it, you can fetch it from this site.
http://mongoose.bostic.com/db/packages/db.1.85.tar.gz
- e) PERL version 4 or later (needed for htags)
+ c) PERL version 4 or later
If you don't have it, you can fetch it from this site.
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/src/5.0/latest.tar.gz
- f) Rewrite some files (needed for htags)
+ d) Rewrite some files
If you install GLOBAL into other than /usr/bin, you need rewrite
hard coded path in a program. You can find the place by this command.
@@ -114,33 +92,43 @@ Install procedure
% grep '/usr/bin/perl' */*.pl
- g) Groff (needed for formatting online manuals)
-
- Online manuals in GLOBAL are written with 'mandoc' macro which is a part
- of GNU groff package. See following site:
+ e) POSIX regular expression (extension) library
- http://www.gnu.org/order/ftp.html
+ If you don't have it, you can use GNU's regex library.
- You can format these manuals by following command line manually.
+ f) Some UNIX tools
- % groff -Wall -Tascii -mandoc global.1
-
- If you replace your system's nroff(1) with GNU's one(nroff.sh) then
- you can use man(1) to see GLOBAL's online manuals.
+ Find(1), sed(1), sort(1) are needed.
+ If your environment is UNIX, you have them.
2. GLOBAL basic (NEEDED)
% make
# make install
-3. Extended nvi (OPTIONAL)
+3. Extended vi (OPTIONAL)
+
+ GLOBAL supports two version of nvi.
+ There is a little defference in behavior between them when a number of
+ functions located. (please see 'README'.)
+ Version 1.34 nvi is included by FreeBSD 2.0.5R, 2.1.0R and 2.1.5R.
+ Version 1.79 nvi is available on
- If you use FreeBSD 2.2.2R or later, your nvi is already extended nvi.
- Otherwise, please get nvi-1.79 at:
+ ftp://ftp.cs.berkeley.edu/ucb/4bsd/nvi-1.79.tar.gz.
- ftp://ftp.cs.berkeley.edu/ucb/4bsd/nvi-1.79.tar.gz
+ If you don't have nvi-1.34, use nvi-1.79.
- and do the followings.
+ If you use version 1.34 nvi which is a native command in FreeBSD 2.0.5R,
+ 2.1.0R or 2.1.5R then
+
+ % cp -r /usr/src/usr.bin/vi vi <- version 1.34 of nex/nvi
+ % cd vi
+ % patch -p < ../nvi-1.34.diff
+ % make
+ # make install
+
+ else if you use version 1.79 nvi which is the latest version then
+ fetch from ftp://ftp.cs.berkeley.edu/ucb/4bsd/nvi-1.79.tar.gz and
% tar xzvf nvi-1.79.tar.gz
% cd nvi-1.79
@@ -150,7 +138,10 @@ Install procedure
% make
# make install
- The patch for nvi-1.66 is also available for NetBSD 1.3.2 users.
+ Caution: If you use FreeBSD 2.2.2R or later, your nvi is already
+ extended vi. Don't patch with nvi-1.79.diff.
+
+ else we have no patch for it.
4. Extended emacs (OPTIONAL)
@@ -158,7 +149,7 @@ Install procedure
Mule 2.3 (= Emacs 19.28). Other emacs version seems to work well,
but I don't confirm it.
- You can get it at:
+ You can get it from
Emacs 19.34b:
ftp://prep.ai.mit.edu/pub/gnu/emacs-19.34b.tar.gz
@@ -174,16 +165,7 @@ Install procedure
+-----------------------------------------------
|(setq load-path (cons "~/lisp" load-path))
-5. Elvis (OPTIONAL)
-
- You need Elvis 2.1. You can get it at:
-
- ftp://ftp.cs.pdx.edu/pub/elvis/elvis-2.1.tar.gz
-
- You need not any patch for it.
-
-
-6. Gozilla (OPTIONAL)
+5. Gozilla (OPTIONAL)
You need X(1) to install gozilla.
@@ -193,29 +175,4 @@ Install procedure
# make install
# make install.man
-7. other parser (OPTIONAL)
-
- If you want to use other tag command like etags (tag command for emacs)
- as a parser, you need to write global.conf (or $HOME/.globalrc).
-
- Sample gtags.conf has etags's entry. Try this.
-
-
- a) Install parser.
-
- % cd <emacs's source directory>/lib-src
- % make ctags
- ...
- # cp ctags /usr/local/bin/ctags-emacs
-
- b) Select ctags-emacs for GLOBAL system.
-
- % setenv GTAGSLABEL ctags-emacs
-
- or
-
- +------------------------------------------------
- |default:\ <== gtags use 'default' entry by default.
- | :include=ctags-emacs:include=htags:
-
Good luck!
diff --git a/contrib/global/MANIFEST b/contrib/global/MANIFEST
index ca62a7baa4f3..bf01ee814845 100644
--- a/contrib/global/MANIFEST
+++ b/contrib/global/MANIFEST
@@ -1,24 +1,21 @@
COPYING Copyright notice.
-FAQ Frequentry asked question.
HISTORY Histroy of GLOBAL.
INSTALL Installation method
MANIFEST This file.
Makefile Makefile for BSD.
Makefile.inc A part of Makefile for BSD.
Makefile.generic Makefile for generic UNIX(including BSD).
+PROBLEMS Problem report.
README Readme (introduction and usage).
VERSION Version number.
btreeop/ Btreeop command directory.
-dbpatches/ Patch files for DB(3).
-gctags/ Extended ctags command directory.
global/ Global command directory.
-global.conf Configuration file.
gozilla/ Gozilla command directory.
+gctags/ Extended ctags command directory.
gtags/ Gtags command directory.
-gzshrc Gzsh start up file.
htags/ Htags command directory.
systags/ Script for kernel.
-lib/ Private library.
+lib/ library.
gtags.el Gtags mode for Emacs.
-nvi-1.66.diff Patch for nvi 1.66.
+nvi-1.34.diff Patch for nvi 1.34.
nvi-1.79.diff Patch for nvi 1.79.
diff --git a/contrib/global/Makefile.inc b/contrib/global/Makefile.inc
index b2093986800c..befa954bf7a2 100644
--- a/contrib/global/Makefile.inc
+++ b/contrib/global/Makefile.inc
@@ -1,16 +1,7 @@
-.if !defined(GLOBAL_MAKEFILE_INC_BEEN_HERE)
-
-GLOBAL_MAKEFILE_INC_BEEN_HERE=yes
BINDIR?= /usr/bin
+MANDIR?= /usr/share/man/man
.if exists(${.OBJDIR}/../lib)
-LIBDESTDIR= ${.OBJDIR}/../lib
+LIBUTIL=${.OBJDIR}/../lib/libutil.a
.else
-LIBDESTDIR= ${.CURDIR}/../lib
-.endif
-LDDESTDIR= -L${LIBDESTDIR}
-LDADD= -lgloutil
-DPADD= ${LIBDESTDIR}/libgloutil.a
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../lib -O \
- -Wall -Wwrite-strings -Wmissing-prototypes
-
+LIBUTIL=${.CURDIR}/../lib/libutil.a
.endif
diff --git a/contrib/global/PROBLEMS b/contrib/global/PROBLEMS
new file mode 100644
index 000000000000..e30e7e0d3b1e
--- /dev/null
+++ b/contrib/global/PROBLEMS
@@ -0,0 +1,38 @@
+GLOBAL cannot recognize following macros and functions.
+
+1. Macro which doesn't end with ';'.
+
+ GLOBAL cannot recognize func() after M(a), because M(a) seems to be
+ function definition.
+
+ #define M(a) static char *string = a;
+
+ M(a)
+
+ func() {
+ ...
+ }
+
+ It should be follows.
+
+ #define M(a) static char *string = a
+
+ M(a);
+
+ func() {
+ ...
+ }
+
+2. Macro which is a renamed function.
+
+ #define func _func
+
+ _func() {
+ ...
+ }
+ main() {
+ func();
+ }
+
+ In fact, main() calls _func() instead of func() but GLOBAL cannot
+ recognize it.
diff --git a/contrib/global/README b/contrib/global/README
index d6226732b1c7..584c818478a1 100644
--- a/contrib/global/README
+++ b/contrib/global/README
@@ -1,21 +1,30 @@
- @@@@@@@=)))
- @=))) @=))) @=)))
- @=))) @=)))
- @=))) @=))) @@@@@=)@@@@@@=))) @@=) @=)))
- @=))F o r a l l)) h a c k e r s.))) @=@=))@=)))
- @=))) @@@@@@=@=)))@=))) @=)@@@@@=)))@= @=))@=)))
- @=))) @=))@=)))@=))) @=)@=)))@=)@@@@@=))@=)))
- @=))) @=))@=)))@=))) @=)@=)))@=@=)))@=))@=)))
- @@@@@@@@=)))@@@@=)@@@@@=)@@@@@@=@@@=)@@@@=)@@@@@@=)))
-
- Shigio Yamaguchi 10-Dec-98
-
- Copyright 1996, 1997, 1998 Shigio Yamaguchi All right resereved.
-
-GLOBAL is a source code tag system that works the same way across diverse
-environments. It supports C, Yacc and Java source code.
-
+ @@@@@@@=
+ @= @=
+ @= @=
+ @= @= @@@@@= @@@@@@= @@= @=
+ @= F o r a l l h a c k e r s.
+ @= @@@@@@=@= @= @= @@@@@= @= @= @=
+ @= @= @= @= @= @= @= @@@@@= @=
+ @= @= @= @= @= @= @=@= @= @=
+ @@@@@@@@= @@@@= @@@@@= @@@@@@=@@@= @@@@= @@@@@@=
+
+ Shigio Yamaguchi 20-Jan-98
+
+ Copyright 1996, 1997, 1998
+ Shigio Yamaguchi All right resereved.
+
+ ----------------------------------------------------------
+ Note:
+ This version of GLOBAL makes 'GSYMS' tag file for
+ searching symbols other than functions.
+ (Try global(1) with -s option.)
+ But the tag file is very large. If you hope not to
+ make the file, please use gtags with -o (old) option.
+ Htags(1) doesn't use 'GSYMS'.
+ ----------------------------------------------------------
+
+GLOBAL is a browsing system for C and Yacc source code.
It brings benefits to all hackers. Enjoy!
@@ -30,66 +39,53 @@ It brings benefits to all hackers. Enjoy!
1.3. Basic usage
1.4. Applied usage
- 2. Extended nvi using global
+ 2. Extended vi using global
2.1. Features
2.2. Preparation
2.3. Basic usage
2.4. Applied usage
- 3. Extended emacs using global
+ 3. Hypertext generator
3.1. Features
3.2. Preparation
- 3.3. Basic usage
- 3.4. Applied usage
+ 3.3. Usage
+ 3.4. To make hypertext of kernel
+ 3.5. Gozilla
- 4. Hypertext generator
+ 4. Extended emacs using global
4.1. Features
4.2. Preparation
- 4.3. Usage
- 4.4. Making hypertext of the kernel
- 4.5. Gozilla
-
- 5. Elvis using global
-
- 5.1. Features
- 5.2. Preparation
- 5.3. Basic usage
- 5.4. Applied usage
-
- A. Other topics
-
- A.1. How to plug in a parser
- A.2. How to use compact format
- A.3. Incremental updating
- A.4. Plans for the furture
+ 4.3. Basic usage
+ 4.4. Applied usage
--------------------------------
0. Introduction
-GLOBAL is a source code tag system that works the same way across diverse
-environments. Currently, it supports the following:
+GLOBAL is a browsing system for C and Yacc source files.
+You can locate the specified function in C source files and move there easily.
+It is useful to hack a large project containing many subdirectories,
+many '#ifdef' and many main() functions like MH, X or BSD kernel.
- o Shell command line(see '1. Global')
- o nvi editor(see '2. Extended nvi using global')
- o emacs editor(see '3. Emacs using global')
- o Web browser(see '4. Hypertext generator')
- o Elvis editor(see '5. Elvis using global')
+It supports following environments.
-Supported languages are C/Yacc and Java.
-You can locate a specified function in the source files and move there easily.
-It is useful for hacking a large project containing many subdirectories,
-many '#ifdef' and many main() functions, like MH, X or BSD kernel.
+ o shell command line(see '1. Global')
+ o vi editor(see '2. Extended vi using global')
+ o web browser(see '3. Hypertext generator')
+ o emacs editor(see '4. Emacs using global')
-GLOBAL consists of global(1), gtags(1), btreeop(1), gctags(1), htags(1),
-extended nvi(1), gtags.el and gozilla(1).
+GLOBAL is consist of global(1), gtags(1), btreeop(1), gctags(1), htags(1),
+extended vi(1), gtags.el and gozilla(1).
* 'extended' means being entended for GLOBAL.
- * Btreeop and gctags are used internally, so you do not need to
- understand them.
+ * Btreeop and gctags are used internally, so you need not
+ understand about them.
+
+The extended vi is completely upper compatible with original one.
+All the functions for GLOBAL are enabled only in 'gtagsmode'.
------------------------------------------------------------------------------
@@ -97,46 +93,39 @@ extended nvi(1), gtags.el and gozilla(1).
1.1. Features
- o Global can find the locations of a specified object quickly.
- o Global can locate not only object definitions but also object references.
- o Global allows duplicate objects.
- o Global can treat a source tree containing subdirectories as a logical
- scope. You can get the relative path of objects from anywhere within
- that scope.
- o Global allows duplicate objects.
- o Global can understand POSIX 1003.2 regular expressions.
- o Global can search not only in a source tree but also in library paths.
- o Tag files are indepent of machine architecture.
- o Global can use a plugged in parser with the global.conf
- (or $HOME/.globalrc).
- o Global can use a tag file in a compact format to save disk space.
+ o Global can find the locations of a specified function quickly.
+ o Global can locate not only function definitions but also function references.
+ o Global allows duplicate entries.
+ o Global can treat a source tree containing subdirectories and you can
+ get relative path of objects from anywhere within the tree.
+ o Global can understand POSIX 1003.2 regular expression (extension).
+ o Global can search in not only a source tree but also library paths.
+ o Global can treat yacc source file.
I think these features are useful for a large project containing many
- subdirectories, many '#ifdef' and many main() functions like MH, mozilla,
- X and kernels.
+ subdirectories, many '#ifdef' and many main() functions like MH.
1.2. Preparation
First of all, you must execute gtags(1) at the root of source tree.
- For example, if you want to browse vi's source code:
+ For example, if you want to browse vi's source code, please do like this.
% cd /usr/src/usr.bin/vi
% gtags
Gtags traverse subdirectories and makes
- three databases at the root of the source tree.
+ two database at the root of source tree.
% ls G*TAGS
- GRTAGS GTAGS GSYMS
+ GRTAGS GTAGS
- GTAGS - database of function definitions
- GRTAGS - database of function references
- GSYMS - database of other symbols
+ GTAGS - database for function definition
+ GRTAGS - database for function reference
1.3. Basic usage
- Consider the following source tree:
+ Please think of following source tree.
ROOT/ <- the root of source tree (GTAGS,GRTAGS)
|
@@ -165,9 +154,8 @@ extended nvi(1), gtags.el and gozilla(1).
|} |
+---------------+
- You can get the relative path of your object from anywhere in
- the source tree. You need not specify where the tag file is.
- Global will locate the tag file by itself.
+ You can get the relative path of your object from anywhere within
+ the source tree.
% cd ROOT
% global func1
@@ -179,20 +167,19 @@ extended nvi(1), gtags.el and gozilla(1).
% global func1
../DIR1/fileB.c <- relative path from DIR2
- The -r option locates function references.
+ -r option locates function references.
% global -r func2
../DIR1/fileA.c <- func2() is referred from fileA.c
- You can use POSIX regular expressions.
+ You can use POSIX regular expression (extension).
% cd ROOT
% global 'func[1-3]'
DIR1/fileB.c <- func1, func2 and func3 are matched
DIR2/fileC.c
- The -x option shows the details. It is similar to the -x option
- in ctags(1).
+ -x option shows the detail. It's similar to ctags's -x option.
% global func2
DIR2/fileC.c
@@ -200,24 +187,17 @@ extended nvi(1), gtags.el and gozilla(1).
func2 2 DIR2/fileC.c func2(){ i++; }
func2 4 DIR2/fileC.c func2(){ i--; }
- The -a option produces the absolute path name.
+ -a option produces the absolute path name.
% global -a func1
/home/user/ROOT/DIR1/fileB.c
- The -s command locates any symbols other than functions.
+ -s option locates any symbols other than function.
% global -xs X
X 1 DIR2/fileC.c #ifdef X
- The -g command locates any patterns including symbols.
- It is similar to grep(1).
-
- % global -xg '#ifdef'
- #ifdef 1 DIR2/fileC.c #ifdef X
-
- You can edit all files that include a specified function by typing
- one command, for example:
+ You can edit files including specified function directly like this.
% vi `global func1` <- edit fileB.c
@@ -241,22 +221,22 @@ extended nvi(1), gtags.el and gozilla(1).
|func1(){ i--; }|
+---------------+
- When you are in the version1.0 directory, global will only locate functions
- that are in version1.0.
+ When you are walking in version1.0 directory, global locates functions
+ only in version1.0.
% cd ROOT/version1.0
% global -x func1
func1 1 file.c func1(){ i++; }
- When you are in the version2.0, global will only locate functions that
- are in version2.0.
+ When you are walking in version2.0, global locates functions only in
+ version2.0.
% cd ROOT/version2.0
% global -x func1
func1 1 file.c func1(){ i--; }
- If you are at ROOT/, or you set the GTAGSROOT environment variable to ROOT,
- then global will locate functions in both directories.
+ If you are at ROOT/ or you set GTAGSROOT environment variable to ROOT,
+ global locates functions in both version1.0 and version2.0 directories.
% cd ROOT
% global -x func1
@@ -266,9 +246,9 @@ extended nvi(1), gtags.el and gozilla(1).
=-=-=-=
There is another usage of GTAGSROOT.
- If your source files are on a read-only device, such as CDROM,
- then you cannot make databases at the root of the source tree.
- In such cases, please do the following:
+ If your source files are on a read only device like CDROM, you cannot
+ make database on the root of source tree.
+ In such case, please do the following.
% mkdir /var/dbpath
% cd /cdrom/src <- the root of source tree
@@ -279,12 +259,11 @@ extended nvi(1), gtags.el and gozilla(1).
=-=-=-=
- If you want all references to a function that is not defined in the source
- tree to be treated as calls to library functions or system calls, then
- you can specify library directories with the GTAGSLIBPATH environment
- variable.
+ If you want to treat the references to a function that is not defined
+ in the source tree like a library function or system call, you can specify
+ library directories with the GTAGSLIBPATH environment variable.
You should execute gtags at each directory of the path.
- If GTAGS is not found in a directory, global ignores that directory.
+ If GTAGS is not found in a directory, global ignores it.
% pwd
/develop/src/mh <- this is the source tree
@@ -302,12 +281,12 @@ extended nvi(1), gtags.el and gozilla(1).
% global access
../../../usr/src/sys/kern/vfs_syscalls.c <- access() is found in kernel
- Of course, the user program does not call kernel functions directly,
- but at least it is useful.
+ Of course, user program doesn't call kernel function directly, but
+ at least it is useful.
=-=-=-=
- If you forget a function name, you can use the -c (complete) command.
+ If you forget function name, you can use -c (complete) option.
% global -c kmem <- maybe k..k.. kmem..
kmem_alloc
@@ -321,7 +300,7 @@ extended nvi(1), gtags.el and gozilla(1).
% global kmem_suballoc
../vm/vm_kern.c
- You can use the -c command with tcsh's complete command.
+ You can use -c option with tcsh's complete command.
% set funcs=(`global -c`)
% complete global 'n/*/$funcs/'
@@ -332,11 +311,11 @@ extended nvi(1), gtags.el and gozilla(1).
% global kmem_suballoc
../vm/vm_kern.c
- * <TAB> means the tab key or Ctrl-I.
+ * <TAB> means tab key or Ctrl-I.
=-=-=-=
- If you want to browse many files in order, do the following:
+ If you want to browse many files in order, do the followings.
% global -xr fork | awk '{printf "view +%s %s\n",$2,$3}' | tee /tmp/list
view +650 ../dev/aic7xxx/aic7xxx_asm.c
@@ -348,24 +327,24 @@ extended nvi(1), gtags.el and gozilla(1).
view +351 ../kern/init_main.c
% sh !$ <- from now on, go to next tag with 'ZZ'.
-2. Extended nvi using global
+2. Extended vi using global
2.1. Features
- o The tag function of extended vi can locate not only function definitions
+ o Tag function of extended vi can locate not only function definitions
but also function references.
- o Extended nvi allows duplicate tag entries.
- o Extended nvi can understand POSIX regular expressions
- as a tag name for the search.
- o Extended nvi is completely backward-compatible with the original nvi.
- The above functions are available only in 'gtags mode'.
+ o Extended vi allows duplicate tag entries.
+ o Extended vi can understand POSIX regular expression (extension)
+ as a tag name for search.
+ o Extended vi is completely upper compatible with original one.
+ Above functions are available only in 'gtags mode'.
2.2. Preparation
First, do the preparation of global. (Please see "1.2. Preparation").
Second, to use global from vi, you need to get into 'gtagsmode'.
- There are several ways to do this:
+ There are some ways to do it.
(a) Start vi with -G option
@@ -379,7 +358,7 @@ extended nvi(1), gtags.el and gozilla(1).
~
:set gtagsmode
- (c) Write the above set command to the .exrc or .nexrc file and start vi
+ (c) Previously write the set command to .exrc or .nexrc file and start vi
$HOME/.exrc
+----------------------------
@@ -393,70 +372,105 @@ extended nvi(1), gtags.el and gozilla(1).
:tag func1
- It seemes the same as original vi, but extended vi use GTAGS instead of
- tags.
+ It seemes same with original vi, but extended vi use GTAGS
+ instead of tags.
- o To go to the referenced point of func1, add the prefix 'r'
+ o To go to referenced point of func1, add prefix 'r'
:rtag func1
- Extended nvi use GRTAGS.
+ Extended vi use GRTAGS.
- o If a number of functions are located, extended vi goes to the first tag.
- You can go to next tag by typing ':tagnext' and back by typing ':tagprev'.
+ o If a number of functions located, the action of extended vi differs
+ up to your nvi's version.
+
+ [Extended vi based 1.34 nvi]
+
+ Vi goes into 'GTAGS SELECT MODE' like this.
+
+ +-------------------------------------------------------------
+ |main 347 i386/isa/ultra14f.c main()
+ |main 128 kern/init_main.c main(framep)
+ |main 104 netiso/clnp_debug.c main()
+ |main 164 netiso/xebec/main.c main(argc, argv)
+ |~
+ |~
+ |~
+ |~
+ |~
+ |[GTAGS SELECT MODE] 4 lines
+ +-------------------------------------------------------------
+
+ You can select a tag line by any vi command and press [RETURN],
+ and you can go to the tag's point. In ex mode, type "select"
+ instead of [RETURN]. When you want to go to next or previous tag,
+ you can return to 'GTAGS SELECT MODE' with <control-T> and reselect.
+
+ Suggested .nexrc:
+ set gtagsmode
+ set leftright
+
+ [Extended vi based 1.79 nvi]
+
+ Vi goes to the first tag.
+ Then you can go to next tag by ':tagnext' or back by ':tagprev'.
Suggested .nexrc:
set gtagsmode
map ^N :tagnext^M
map ^P :tagprev^M
+ == WHY TWO STYLE EXIST ? ==
+ 1.34 nvi cannot treat duplicate tag entries, so I made 'GTAGS SELECT MODE'
+ in it. But 1.79 nvi (1.61 and later) can treat them, so I adapted GLOBAL
+ tags to nvi's tag structure.
+
o <control-]> command is available.
- In gtags mode, if you are in the first column of a line,
- it is equivalent to ":rtag <current token>", otherwise it is equivalent
- to ":tag <current token>".
+ In gtagsmode, if you are on the first column of line, it is identical to
+ ":rtag <current token>[RETURN]", otherwise ":tag <current token>[RETURN]".
- o Other tag commands are also available:
+ o Other tag commands are available too.
<control-T> - Return to the most recent tag context.
- ":tagpop" - Go to the specified tag in the tags stack.
- ":tagtop" - Go to the top tag in the tags stack.
- ":display tags" - Display the tags stack.
+ ":tagpop" - Pop to the specified tag in the tags stack.
+ ":tagtop" - Pop to the top tag in the tags stack.
+ ":display tags" - Display tags stack.
- Please read the online manual.
+ Please read online manual.
2.4. Applied usage
- o In large projects that include many main() function like MH,
- you can start vi like this:
+ o In large project which include many main() function like MH,
+ you can start vi like this.
% vi -G -t main
You can browse all commands sequentially.
- o When you want to check functions the name of which start with "set"
- or "get", use:
+ o When you want to check functions the name of which start with
+ "set" or "get",
% vi -G -t '^[sg]et'
- Of course, the following command is also available:
+ Of cause, following command is available too.
:tag ^[sg]et
- o If your source files are on a read only device like a CD-ROM, please do
- the following:
+ o If your source files are on a read only device like CDROM, please do
+ the followings.
- % mkdir /var/dbpath <- directory for the tag file
- % cd /cdrom/src <- the root of the source tree
+ % mkdir /var/dbpath <- directory for tag file
+ % cd /cdrom/src <- the root of source tree
% gtags /var/dbpath <- make tag files in /var/dbpath
% setenv GTAGSROOT `pwd`
% setenv GTAGSDBPATH /var/dbpath
% vi -G -t main
- o If you want all references to function that are not defined in the source
- tree to be treated as references to library functions or as system calls,
- do the following:
-
+ o If you want to treat the references to the function that is not defined
+ in the source tree like library functions or system calls,
+ do the followings.
+
% cd /usr/src/lib
% gtags <- probably as a root
% cd /usr/src/sys
@@ -469,27 +483,130 @@ extended nvi(1), gtags.el and gozilla(1).
% gtags
% vi -G -t main
- You can start from vi and browse the whole unix world as if you were
- using hypertext.
+ You can start from vi and trip the whole unix world as if using
+ hypertext.
+
-3. Extended emacs using global
+3. Hypertext generator
3.1. Features
+ o Htags makes hypertext from C source files.
+ o Once the hypertext generated, you need nothing other than WWW browser.
+ o You can move hypertext to anywhere. It is independent of the source code.
+ o You can use all of your browser's functions, for example, search,
+ history, bookmark, save, frame, windows and so on.
+
+3.2. Preparation
+
+ At first, you must prepare much disk space. Hypertext needs so much
+ disk space. For example, the source code of FreeBSD kernel needs the
+ following disk space.
+
+ source code(/usr/src/sys) 14.0MB
+
+ GTAGS 1.5MB
+ GRTAGS 8.0MB
+ GSYMS 12.0MB
+ HTML/ 55MB(!!!)
+ -------------------------------------------------
+ total 77MB
+
+ Please do the followings.
+
+ (at your source directory)
+ % gtags <- make tag database(GTAGS,GRTAGS,GSYMS)
+ % htags <- make hypertext(HTML/)
+
+ Then you will find 'HTML' directory in the current directory.
+
+3.3. Usage
+
+ Please start a web browser like this.
+
+ % lynx HTML/index.html
+
+ You can use any browsers, for example, Lynx, Chimera, Mosaic,
+ Netscape Navigator, Internet Explorer and so on. But some browsers
+ cannot treat framed index. Then select '[no frame version is here]'.
+
+ You will understand the usage for the looking.
+ You can move HTML directory to anywhere. It is independent of
+ the source code.
+
+3.4. To make hypertext of kernel
+
+ If you would like to make hypertext of FreeBSD kernel source,
+ it is convenient to use systags script in this package.
+
+ % cd /usr/src/sys
+ % systags
+ then
+
+ % netscape HTML/index.html
+
+ You can use following functions with systags.
+
+ o input form for dynamic index.
+ (This reqires you to setup httpd server for CGI program.)
+ o one level nested index.
+ o browse assembler source file.
+
+ Of course, you can use above functions without systags.
+ Please see gtags(1), htags(1).
+
+3.5. Gozilla
+
+ If you use Netscape Navigator, you can control the browser from command
+ line by gozilla(1).
+
+ % gtags
+ % htags
+ % global -x fork
+ fork 60 kern/kern_fork.c fork(p, uap, retval)
+ % gozilla +60 kern/kern_fork.c
+ %
+
+ Then you can see the hypertext about fork function directly on Netscape
+ Navigator. If the browser has not been loaded, gozilla loads it.
+
+ If you use another browser like lynx, try this.
+
+ % gozilla -b lynx +60 kern/kern_fork.c
+
+ or
+
+ % setenv BROWSER lynx
+ % gozilla +60 kern/kern_fork.c
+
+ You can send remote command to Netscape Navigator too. Try this.
+
+ % gozilla -C pagedown
+ % gozilla -C pageup
+
+ The remote commands are undocumented, but you can see the hint in the
+ resource file. (Netscape.ad file)
+
+ NOTES:
+ Netscape Navigator is a registered trademark of Netscape Communications
+ Corporation in the United States and other countries.
+
+4. Extended emacs using global
+
+4.1. Features
+
Addition to the extended vi,
- o More intelligent recognition of the current token and its type.
+ o More intelligent to recongnize current token and its type.
o Tag completion is available for input tag name.
- o Symbol search and pattern search are available.
- o Mouse events are supported.
+ o Mouse event is supported.
-3.2. Preparation
+4.2. Preparation
First, do the preparation of global. (Please see "1.2. Preparation").
- Second, to use global from emacs, you need to load the gtags.el file
- and execute gtags-mode function in it. There are several ways to
- do this:
+ Second, to use global from emacs, you need to load gtags.el file and
+ execute gtags-mode function in it. There are some ways to do it.
(a) Start emacs, load gtags.el and execute gtags-mode function.
@@ -510,8 +627,8 @@ extended nvi(1), gtags.el and gozilla(1).
|M-x gtags-mode[RET]
+------------------------------------------------------
- (b) Write the autoload function to the $HOME/.emacs file, start emacs
- and execute the gtags-mode function.
+ (b) Previously write autoload function to $HOME/.emacs file,
+ start emacs and execute gtags-mode function.
$HOME/.emacs
+------------------------------------------------------
@@ -524,9 +641,8 @@ extended nvi(1), gtags.el and gozilla(1).
|M-x gtags-mode[RET]
+------------------------------------------------------
- (c) Write the autoload function to the $HOME/.emacs file and start emacs
- with the -f option.
-
+ (c) Previously write autoload function to $HOME/.emacs file and
+ start emacs with -f option
$HOME/.emacs
+------------------------------------------------------
@@ -534,16 +650,19 @@ extended nvi(1), gtags.el and gozilla(1).
% emacs -f gtags-mode
+
You must start emacs under the source tree described in "1.2. Preparation".
-3.3. Basic usage
+4.3. Basic usage
+
+ It is resemble to the extended vi based nvi-1.34.
o To go to func1, press 'ESC-t' and you can see a prompt in mini-buffer.
- Then input the tag name.
+ Then input tag name.
:tag func1 # ':tag ' is a prompt.
~~~~~
- o To go to a point that references func1, press 'ESC-r'.
+ o To go to referenced point of func1, press 'ESC-r'.
:rtag func1 # 'rtag ' is a prompt
~~~~~
@@ -554,8 +673,8 @@ extended nvi(1), gtags.el and gozilla(1).
:tag func1 # 'nc1' is appended by emacs
- o If a number of functions are located, emacs goes into 'GTAGS SELECT MODE'
- like this:
+ o If a number of functions located, emacs goes into 'GTAGS SELECT MODE'
+ like this.
+-------------------------------------------------------------
|main 347 i386/isa/ultra14f.c main()
@@ -571,400 +690,68 @@ extended nvi(1), gtags.el and gozilla(1).
|[GTAGS SELECT MODE] 4 lines
+-------------------------------------------------------------
- You can select a tag line by using any emacs command and pressing [RETURN],
- and you can go to the tag's point. When you want to go to the next or
- the previous tag, you can return to 'GTAGS SELECT MODE' with <control-T>
+ You can select a tag line by any emacs command and press [RETURN],
+ and you can go to the tag's point. When you want to go to next or
+ previous tag, you can return to 'GTAGS SELECT MODE' with <control-T>
and reselect.
o <control-]> command is available.
- If current token is a definition, it is equivalent to
- ":rtag <current token>[RETURN]", otherwise it is equivalent to
- ":tag <current token>[RETURN]".
+ If current token is a definition, it is identical to
+ ":rtag <current token>[RETURN]", otherwise ":tag <current token>[RETURN]".
(GLOBAL decides this intelligentlly, but may sometimes misunderstand.)
o To go to any symbols other than function, try 'ESC-s'.
Find symbol: lbolt
~~~~~
- o To go to any strings other than symbols, try 'ESC-g'.
+ o To go to any strings other than symbol, try 'ESC-g'.
Find pattern: Copyright
~~~~~~~~~
-3.4. Applied usage
+4.4. Applied usage
- o You can use POSIX regular expressions.
+ o You can use POSIX regular expression (extension).
:tag ^put_ # locate tags start with 'put_'.
- o If your source files are on a read-only device like a CDROM, please do
- the following:
+ o If your source files are on a read only device like CDROM, please do
+ the followings.
- % mkdir /var/dbpath <- directory for the tag file
- % cd /cdrom/src <- the root of the source tree
+ % mkdir /var/dbpath <- directory for tag file
+ % cd /cdrom/src <- the root of source tree
% gtags /var/dbpath <- make tag files in /var/dbpath
% setenv GTAGSROOT `pwd`
% setenv GTAGSDBPATH /var/dbpath
- % emacs -f gtags-mode
+ % mule -f gtags-mode
- o If you want all references to functions that are not defined in the
- source tree to be treated as references to library functions or
- as system calls, do the following:
+ o If you want to treat the references to the function that is not defined
+ in the source tree like library functions or system calls,
+ do the followings.
% cd /usr/src/lib
% gtags <- probably as a root
% cd /usr/src/sys
% gtags
% setenv GTAGSLIBPATH /usr/src/lib:/usr/src/sys
- % emacs -f gtags-mode
-
- o Mouse command is avalable.
-
- If you use X version emacs, try the following
- (but it doesn't work well in xemacs; I don't know why).
-
- Move the mouse cursor to a function name and click the middle button.
- You will then go to the function's definition, or to its references,
- depending on the context. In 'GTAGS SELECT MODE', move the mouse cursor
- to a line and click the center button.
-
- To return to the previous position, click the right button.
-
-4. Hypertext generator
-
-4.1. Features
-
- o Htags makes hypertext from C, Yacc and Java source files.
- o Once the hypertext is generated, you need nothing other than a WWW browser.
- o You can move the hypertext to anywhere. It is independent of the source code.
- o You can use all of your browser's functions, such as search,
- history, bookmark, save, frames, windows.
-
-4.2. Preparation
-
- At first, you must ensure that you have a lot of disk space. Hypertext
- needs a great amount of disk space. For example, the source code
- of FreeBSD kernel needs:
-
- source code(/usr/src/sys) 14.0MB
-
- GTAGS 1.5MB
- GRTAGS 8.0MB
- GSYMS 12.0MB
- HTML/ 55MB(!!!)
- -------------------------------------------------
- total 77MB
-
- Please do the following:
-
- (at your source directory)
- % gtags <- make the tag database(GTAGS,GRTAGS,GSYMS)
- % htags <- make the hypertext(HTML/)
-
- Then you will find an 'HTML' subdirectory in the current directory.
-
-4.3. Usage
-
- Please start a web browser like this:
-
- % lynx HTML/index.html
-
- You will understand the usage by looking at the examples.
-
- You can move the HTML directory to anywhere. It is independent of the
- source code.
-
-4.4. Making hypertext of the kernel
-
- If you would like to make hypertext of the FreeBSD kernel source, it is
- convenient to use the systags script in this package.
-
- % cd /usr/src/sys
- % systags
- then
-
- % netscape HTML/index.html
-
- You can use following functions with systags:
-
- o An input form for a dynamic index.
- (this reqires you to set up an httpd server for the CGI program.)
- o Unlimited nested index.
-
- Of course, you can use the above functions without systags. Please
- see gtags(1) and htags(1).
-
-4.5. Gozilla
-
- If you use Netscape Navigator, you can control the browser from the command
- line by using gozilla(1).
-
- % gtags
- % htags
- % global -x fork
- fork 60 kern/kern_fork.c fork(p, uap, retval)
- % gozilla +60 kern/kern_fork.c
- %
-
- Then you can see the hypertext specified around the fork function directly
- on Netscape Navigator. If the browser has not been loaded, gozilla loads it.
-
- If you use another browser like lynx, try this:
-
- % gozilla -b lynx +60 kern/kern_fork.c
-
- or
-
- % setenv BROWSER lynx
- % gozilla +60 kern/kern_fork.c
-
- You can send a remote command to Netscape Navigator too. Try this:
-
- % gozilla -C pagedown
- % gozilla -C pageup
-
- The remote commands are undocumented, but you can see the hint in the
- resource file (Netscape.ad).
-
- NOTES:
- Netscape Navigator is a registered trademark of Netscape Communications
- Corporation in the United States and other countries.
-
-
-5. Elvis using global
-
-Elvis 2.1 has new "tagprg" and "tagprgonce" variables for
-running an external tag search program. You can use them with GLOBAL.
-
-5.1. Features
-
- o The tag function of elvis+GLOBAL can locate not only function definitions
- but also function references.
- o Elvis+GLOBAL allows duplicate tag entries.
- o Elvis+GLOBAL can understand POSIX regular expressions
- as a tag name for the search.
- o Symbol search and pattern search are available.
- o Mouse events are supported.
-
-5.2. Preparation
-
- First, do the preparation of global. (Please see "1.2. Preparation").
-
- Second, start elvis and execute 'set tagprg="global -t $1"' like this.
-
- % elvis
- ~
- ~
- ~
- ~
- ~
- ~
- :set tagprg="global -t $1"
-
-5.3. Basic usage
-
- o To go to func1, you can say
-
- :tag func1
-
- It seemes the same as original elvis, but elvis execute 'global -t func1'
- internally and read it instead of tags file.
-
- o To go to the referenced point of func1, add -r option.
-
- :tag -r func1
-
- Elvis executes command like 'global -t -r func1' internally.
-
- o To go to any symbols other than function, try this.
-
- :tag -s lbolt
-
- o To go to any strings other than symbols, try this.
-
- :tag -g Copyright
-
- o When using -r, -s or -g, you had better to use browse command.
-
- :browse -r fork
-
- It brings a following selection list. You can select tag and go to
- the point.
-
- Browse -r fork (2 matches)
- +----------------+----------------+-------------------------------
- | TAG NAME | SOURCE FILE | SOURCE LINE
- +----------------+----------------|-------------------------------
- |fork |ux/linux_misc.c | (line 565)
- |fork |ern/init_main.c | (line 191)
- +----------------+----------------+-------------------------------
-
- o To get list of functions in a file, use -f command.
-
- :browse -f main.c # locate functions in main.c.
-
- o Other tag commands are also available:
-
- <control-]> - go to the definition of current token.
- <control-T> - return to the most recent tag context.
- ":tag" - without argment, go to the next tag.
- ":pop" - return to the most recent tag context.
- ":stack" - display the tags stack.
- ":stag" - creates a new window and moves its cursor to the
- tag's definition point.
- ":sbrowse" - same with 'browse' but show in a new window.
-
-5.4. Applied usage
-
- o You can use POSIX regular expressions.
-
- :tag ^put_ # locate functions start with 'put_'.
-
- :browse -g 'fseek(.*L_SET)' # locate fseek() using L_SET argment.
-
- o You can browse functions list of many files.
-
- :browse -f *.c # locate functions in *.c.
-
- o You can browse project files which includs specified pattern.
-
- :browse -P ^vm/ # under vm/ directory.
- :browse -P \.h$ # all include files.
- :browse -P init # files including 'init'
-
- o You can use mouse to select tag.
-
- +----------------+----------------+-------------------------------
- | TAG NAME | SOURCE FILE | SOURCE LINE
- +----------------+----------------|-------------------------------
- |fork |ux/linux_misc.c | (line 565)
- |fork |ern/init_main.c | (line 191)
- +----------------+----------------+-------------------------------
-
- Please select tag name with mouse cursor and double click on the left
- button and you go to the tag's point.
- In source screen, also select function name and double click on the
- left button and you can go to the point that the function is defined.
- To come back, double click on the right button.
-
-A. Other topics
-
-A.1. How to plug in a parser
-
- You can use a plugged-in parser. Copy global.conf to /etc/global.conf
- or $HOME/.globalrc.
-
- For example, if you would like to use ctags based on etags (included
- by Emacs),
-
- % cd /<emacs source directory>/lib-src
- % make ctags
- # cp ctags /usr/local/bin/ctags-emacs
- % setenv GTAGSLABEL ctags-emacs <- see global.conf
- % gtags
- % ls G*
- GPATH GTAGS
-
- Or if you would like to use exuberant ctags (included by Vim editor),
-
- % cd /<vim source directory>/src/ctags
- % cp Makefile.unix Makefile
- % make
- # cp ctags /usr/local/bin/ctags-exuberant
- % setenv GTAGSLABEL ctags-exuberant <- see global.conf
- % gtags
- % ls G*
- GPATH GTAGS
-
- GRTAGS and GSYMS don't exist, simply because these parsers don't support
- the -r option and -s option like gctags(1) does.
- All plugged-in parsers must print tag information to standard output
- in the same style as 'ctags -x', ie.:
-
- [1] [2] [3] [4]
- ----------------------------------------------------------------
- main 20 ./main.c main(argc, argv) /* xxx */
-
- [1] tag name
- [2] line number the tag appeared
- [3] path name. It must be equal to argment path name.
- [4] line image
-
- Otherwise, you can make a suitable wrapper for the pug-in parser.
-
-A.2. Compact format.
-
- You can save disk space with the compact format. The compact format
- needs source files.
-
- o To specify the use of the compact format on the command line,
- add the -c option:
-
- % gtags -c
-
- o To specify the use of the compact format in the configuration file:
-
- +----------------------------
- |...
- |default:\
- | format=compact:...
-
- o If you will publish hypertext generated by htags then use the -c option
- of htags too:
-
- % htags -c
-
- With the -c option, htags makes gzipped hypertext.
- You need to set up an HTTP server so that gzipped files can be read
- (see 'HTML/.htaccess.skel').
-
-
- Example:
-
- Standard Compact Compressed rate
- -------------------------------------------------------
- GTAGS 1744896 bytes 720896 bytes -59%
- GRTAGS 10133504 bytes 1409024 bytes -86%
- GSYMS 11911168 bytes 9306112 bytes -22%
-
- Standard Compact Compressed rate
- -------------------------------------------------------
- HTML/ 56618 kbytes 15219 kbytes -73%
-
-A.3. Incremental updating
-
- Modifying some source files, you need not remake whole tag files.
- Instead, you can use incremental updating facility (-i option).
+ % mule -f gtags-mode
- % gtags
- % cd kern
- % vi tty.c # modify tty.c.
- ...
- :wq
- % global -vi # -v means verbose.
- [Sun Dec 6 16:27:47 JST 1998] Gtags started
- Tag found in '/usr/src/sys'.
- Incremental update.
- Updating tags of 'kern/tty.c' ...GTAGS..GRTAGS..GSYMS.. Done.
- Global databases have been modified.
- [Sun Dec 6 16:28:30 JST 1998] Done.
- % global -vi # try again.
- [Sun Dec 6 16:28:48 JST 1998] Gtags started
- Tag found in '/usr/src/sys'.
- Incremental update.
- Global databases are up to date. # do nothing.
- [Sun Dec 6 16:28:52 JST 1998] Done.
+ o mouse command is avalable.
-A.4. Plans for the furture
+ If you use X version emacs, try this.
+ (But xemacs doesn't work well. I don't know why.)
- Please see GLOBAL home page.
+ Move mouse cursor to a function name and click center button. And you
+ will go to function's definition or references depending on the context.
+ In 'GTAGS SELECT MODE', move mouse cursor to a line and click center
+ button.
- <http://wafu.netgate.net/tama/unix/global.html>
+ To return to the previous position, click right button.
-Thank you for your reading.
-And of course, I'm also grateful to all excellent tools (vi, ctags, emacs,
-perl, C, db, mozilla ...) and its authors.
+Thank you for your reading of my poor english.
+And of course, I'm grateful to all excellent tools (vi, emacs, perl, C, db,
+mozilla ...) and its authors.
----------------------------------------------------------------------------
E-Mail: <shigio@wafu.netgate.net>
WWW: <http://wafu.netgate.net/tama/unix/indexe.html>
diff --git a/contrib/global/VERSION b/contrib/global/VERSION
index 761e16c13179..fd6915cc46b5 100644
--- a/contrib/global/VERSION
+++ b/contrib/global/VERSION
@@ -1 +1 @@
-3.42
+2.24
diff --git a/contrib/global/btreeop/Makefile b/contrib/global/btreeop/Makefile
index 643a28737981..13ed84a42c1f 100644
--- a/contrib/global/btreeop/Makefile
+++ b/contrib/global/btreeop/Makefile
@@ -1,3 +1,6 @@
PROG= btreeop
+CFLAGS+=-I${.CURDIR}/../lib
+LDADD= $(LIBUTIL)
+DPADD= $(LIBUTIL)
.include <bsd.prog.mk>
diff --git a/contrib/global/btreeop/btreeop.1 b/contrib/global/btreeop/btreeop.1
index 45b6e9f4225f..0b2111fe1ef3 100644
--- a/contrib/global/btreeop/btreeop.1
+++ b/contrib/global/btreeop/btreeop.1
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd Nov 3, 1998
+.Dd Nov 26, 1997
.Dt BTREEOP 1
.Os BSD 4
.Sh NAME
@@ -40,7 +40,7 @@
.Op Fl C
.Op Fl D[keyno] Ar key
.Op Fl K[keyno] Ar key
-.Op Fl L[2]
+.Op Fl L
.Op Fl k Ar prefix
.Op Ar dbname
.Sh DESCRIPTION
@@ -66,11 +66,21 @@ create database and write records to it.
delete records by the key. By default, keyno is 0 (primary key).
.It Fl K[keyno] Ar key
search records by the key. By default, keyno is 0 (primary key).
-.It Fl L[2]
-list all primary keys. If '2' is specified, list all the key and data pairs.
+.It Fl L
+list all primary keys.
+Following two command lines are identical except that the latter is much faster.
+
+ btreeop | awk '{print $1}' | uniq
+
+ btreeop -L
.It Fl k Ar prefix
scan records which have the prefix as a primary key.
This option is valid only with sequential read operation (-L command or non command).
+Following two command lines are identical except that the latter is much faster.
+
+ btreeop | awk '$1 ~ /^fo/ {print }'
+
+ btreeop -k fo
.It Ar dbname
database name. default is 'btree'.
.Sh DATA FORMAT
diff --git a/contrib/global/btreeop/btreeop.c b/contrib/global/btreeop/btreeop.c
index 2b21cfcde5e7..18160fb8c714 100644
--- a/contrib/global/btreeop/btreeop.c
+++ b/contrib/global/btreeop/btreeop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,10 +28,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * btreeop.c 12-Nov-98
+ * btreeop.c 6-Nov-97
*
*/
-#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -39,20 +38,21 @@
#include <stdlib.h>
#include <string.h>
+#include "dbio.h"
#include "global.h"
-const char *dbdefault = "btree"; /* default database name */
-const char *progname = "btreeop"; /* command name */
+char *dbdefault = "btree"; /* default database name */
+char *progname = "btreeop"; /* command name */
static void usage __P((void));
void signal_setup __P((void));
void onintr __P((int));
-int main __P((int, char **));
-void dbwrite __P((DBOP *));
-void dbkey __P((DBOP *, char *, int));
-void dbscan __P((DBOP *, char *, int));
-void dbdel __P((DBOP *, char *, int));
-void dbbysecondkey __P((DBOP *, int, char *, int));
+void main __P((int, char **));
+void dbwrite __P((DBIO *));
+void dbkey __P((DBIO *, char *, int));
+void dbscan __P((DBIO *, char *, int));
+void dbdel __P((DBIO *, char *, int));
+void dbbysecondkey __P((DBIO *, int, char *, int));
#define F_KEY 0
#define F_DEL 1
@@ -61,7 +61,7 @@ static void
usage()
{
fprintf(stderr, "%s\n",
- "usage: btreeop [-A][-C][-D[n] key][-K[n] key][-L[2]][-k prefix][dbname]");
+ "usage: btreeop [-A][-C][-D[n] key][-K[n] key][-L][-k prefix][dbname]");
exit(1);
}
@@ -86,7 +86,7 @@ signal_setup()
signal(SIGTERM, onintr);
}
-int
+void
main(argc, argv)
int argc;
char *argv[];
@@ -94,12 +94,11 @@ char *argv[];
char command = 'R';
char *key = NULL;
int mode = 0;
- const char *db_name;
- DBOP *dbop;
+ char *dbname;
+ DBIO *dbio;
int i, c;
int secondkey = 0;
- int keylist = 0;
- char *prefix = NULL;
+ char *prefix = (char *)0;
for (i = 1; i < argc && argv[i][0] == '-'; ++i) {
switch (c = argv[i][1]) {
@@ -107,34 +106,22 @@ char *argv[];
case 'K':
if (argv[i][2] && isdigit(argv[i][2]))
secondkey = atoi(&argv[i][2]);
- if (++i < argc)
- key = argv[i];
- else
- usage();
- /* FALLTHROUGH */
+ key = argv[++i];
case 'A':
case 'C':
case 'L':
if (command != 'R')
usage();
command = c;
- if (command == 'L') {
- keylist = 1;
- if (argv[i][2] == '2')
- keylist = 2;
- }
break;
case 'k':
- if (++i < argc)
- prefix = argv[i];
- else
- usage();
+ prefix = argv[++i];
break;
default:
usage();
}
}
- db_name = (i < argc) ? argv[i] : dbdefault;
+ dbname = (i < argc) ? argv[i] : dbdefault;
switch (command) {
case 'A':
case 'D':
@@ -149,35 +136,27 @@ char *argv[];
mode = 0;
break;
}
- dbop = dbop_open(db_name, mode, 0644, DBOP_DUP);
- if (dbop == NULL) {
- switch (mode) {
- case 0:
- case 2:
- die1("cannot open '%s'.", db_name);
- break;
- case 1:
- die1("cannot create '%s'.", db_name);
- break;
- }
- }
+ dbio = db_open(dbname, mode, 0644, DBIO_DUP);
+ if (dbio == NULL)
+ die1("db_open failed (dbname = %s).", dbname);
+
switch (command) {
case 'A': /* Append records */
case 'C': /* Create database */
- dbwrite(dbop);
+ dbwrite(dbio);
break;
case 'D': /* Delete records */
- dbdel(dbop, key, secondkey);
+ dbdel(dbio, key, secondkey);
break;
case 'K': /* Keyed (indexed) read */
- dbkey(dbop, key, secondkey);
+ dbkey(dbio, key, secondkey);
break;
case 'R': /* sequencial Read */
case 'L': /* primary key List */
- dbscan(dbop, prefix, keylist);
+ dbscan(dbio, prefix, (command == 'L') ? 1 : 0);
break;
}
- dbop_close(dbop);
+ db_close(dbio);
if (exitflag)
exit(1);
exit(0);
@@ -185,11 +164,11 @@ char *argv[];
/*
* dbwrite: write to database
*
- * i) dbop database
+ * i) dbio database
*/
void
-dbwrite(dbop)
-DBOP *dbop;
+dbwrite(dbio)
+DBIO *dbio;
{
char *p;
char keybuf[MAXKEYLEN+1];
@@ -215,7 +194,7 @@ DBOP *dbop;
* +------------------
* | __.VERSION 2
*/
- while ((p = mgets(stdin, NULL, 0)) != NULL) {
+ while ((p = mgets(stdin, 0, NULL)) != NULL) {
if (exitflag)
break;
c = p;
@@ -236,93 +215,89 @@ DBOP *dbop;
if (*c == 0)
die("data part is null.");
entab(p);
- dbop_put(dbop, keybuf, p);
+ db_put(dbio, keybuf, p);
}
}
/*
* dbkey: Keyed search
*
- * i) dbop database
+ * i) dbio database
* i) skey key for search
* i) secondkey 0: primary key, >0: secondary key
*/
void
-dbkey(dbop, skey, secondkey)
-DBOP *dbop;
+dbkey(dbio, skey, secondkey)
+DBIO *dbio;
char *skey;
int secondkey;
{
char *p;
if (!secondkey) {
- for (p = dbop_first(dbop, skey, 0); p; p = dbop_next(dbop))
+ for (p = db_first(dbio, skey, 0); p; p = db_next(dbio))
detab(stdout, p);
return;
}
- dbbysecondkey(dbop, F_KEY, skey, secondkey);
+ dbbysecondkey(dbio, F_KEY, skey, secondkey);
}
/*
* dbscan: Scan records
*
- * i) dbop database
+ * i) dbio database
* i) prefix prefix of primary key
- * i) keylist 0: data, 1: key, 2: key and data
+ * i) keylist 0: key and data, 1: primary key only
*/
void
-dbscan(dbop, prefix, keylist)
-DBOP *dbop;
+dbscan(dbio, prefix, keylist)
+DBIO *dbio;
char *prefix;
int keylist;
{
char *p;
- int flags = 0;
+ int flags = DBIO_SKIPMETA;
if (prefix)
- flags |= DBOP_PREFIX;
+ flags |= DBIO_PREFIX;
if (keylist)
- flags |= DBOP_KEY;
+ flags |= DBIO_KEY;
- for (p = dbop_first(dbop, prefix, flags); p; p = dbop_next(dbop)) {
- if (keylist == 2)
- fprintf(stdout, "%s %s\n", p, dbop->lastdat);
- else
- detab(stdout, p);
- }
+ for (p = db_first(dbio, prefix, flags); p; p = db_next(dbio))
+ detab(stdout, p);
}
/*
* dbdel: Delete records
*
- * i) dbop database
+ * i) dbio database
* i) skey key for search
* i) secondkey 0: primary key, >0: secondary key
*/
void
-dbdel(dbop, skey, secondkey)
-DBOP *dbop;
+dbdel(dbio, skey, secondkey)
+DBIO *dbio;
char *skey;
int secondkey;
{
signal_setup();
if (!secondkey) {
- dbop_del(dbop, skey);
+ db_del(dbio, skey);
return;
}
- dbbysecondkey(dbop, F_DEL, skey, secondkey);
+ dbbysecondkey(dbio, F_DEL, skey, secondkey);
}
/*
* dbbysecondkey: proc by second key
*
- * i) dbop database
+ * i) dbio database
* i) func F_KEY, F_DEL
* i) skey
* i) secondkey
*/
void
-dbbysecondkey(dbop, func, skey, secondkey)
-DBOP *dbop;
+dbbysecondkey(dbio, func, skey, secondkey)
+DBIO *dbio;
int func;
char *skey;
int secondkey;
@@ -337,7 +312,7 @@ int secondkey;
for (c = skey+strlen(skey)-1; *c && isspace(*c); c--)
*c = 0;
- for (p = dbop_first(dbop, NULL, 0); p; p = dbop_next(dbop)) {
+ for (p = db_first(dbio, NULL, DBIO_SKIPMETA); p; p = db_next(dbio)) {
if (exitflag)
break;
c = p;
@@ -359,7 +334,7 @@ int secondkey;
detab(stdout, p);
break;
case F_DEL:
- dbop_del(dbop, NULL);
+ db_del(dbio, NULL);
break;
}
}
diff --git a/contrib/global/dbpatches/README b/contrib/global/dbpatches/README
deleted file mode 100644
index b1e9116db9a3..000000000000
--- a/contrib/global/dbpatches/README
+++ /dev/null
@@ -1,37 +0,0 @@
-Patch for btree(3)
-------------------
-
-Btree(3) core dumps on certain data sets.
-
-if (your system == FreeBSD 2.2.6R or former)
- needs this patch.
-else if (your system == Debian GNU/Linux 1.3.1)
- needs this patch.
-else
- I don't know.
-
-Please apply patch files in this directory.
-
-1. patch your btree(3) source code
-
- % ls
- patch.1.2 patch.1.3 patch.1.4
- % set dir=`pwd` <- set current directory
- % cd /usr/src/lib/libc/db <- your db source code directory
- % cd btree <- btree library
- % patch < $dir/patch.1.2 <- it must be in this order.
- .
- .
- % patch < $dir/patch.1.3
- .
- .
- % patch < $dir/patch.1.4
- .
- .
-
-2. remake and install your db(3) library.
-3. remake GLOBAL.
-4. remake tag files because tag files are already corrupted.
-
-I derived these patches from 'http://www.sleepycat.com/update/'.
-Information is found on 'http://www.sleepycat.com/update/patch.185.html'.
diff --git a/contrib/global/dbpatches/patch.1.2 b/contrib/global/dbpatches/patch.1.2
deleted file mode 100644
index a3439090f125..000000000000
--- a/contrib/global/dbpatches/patch.1.2
+++ /dev/null
@@ -1,19 +0,0 @@
-*** btree/bt_split.c Tue Jul 26 14:22:02 1994
---- btree/bt_split.c Sat Jan 4 14:38:55 1997
-***************
-*** 673,679 ****
- * where we decide to try and copy too much onto the left page.
- * Make sure that doesn't happen.
- */
-! if (skip <= off && used + nbytes >= full) {
- --off;
- break;
- }
---- 673,679 ----
- * where we decide to try and copy too much onto the left page.
- * Make sure that doesn't happen.
- */
-! if (skip <= off && used + nbytes >= full || nxt == top - 1) {
- --off;
- break;
- }
diff --git a/contrib/global/dbpatches/patch.1.3 b/contrib/global/dbpatches/patch.1.3
deleted file mode 100644
index 5ca03df2207b..000000000000
--- a/contrib/global/dbpatches/patch.1.3
+++ /dev/null
@@ -1,37 +0,0 @@
-*** btree/bt_split.c.orig Sat Feb 8 10:14:10 1997
---- btree/bt_split.c Sat Feb 8 10:14:51 1997
-***************
-*** 673,679 ****
- * where we decide to try and copy too much onto the left page.
- * Make sure that doesn't happen.
- */
-! if (skip <= off && used + nbytes >= full || nxt == top - 1) {
- --off;
- break;
- }
---- 673,680 ----
- * where we decide to try and copy too much onto the left page.
- * Make sure that doesn't happen.
- */
-! if (skip <= off &&
-! used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
- --off;
- break;
- }
-***************
-*** 686,692 ****
- memmove((char *)l + l->upper, src, nbytes);
- }
-
-! used += nbytes;
- if (used >= half) {
- if (!isbigkey || bigkeycnt == 3)
- break;
---- 687,693 ----
- memmove((char *)l + l->upper, src, nbytes);
- }
-
-! used += nbytes + sizeof(indx_t);
- if (used >= half) {
- if (!isbigkey || bigkeycnt == 3)
- break;
diff --git a/contrib/global/dbpatches/patch.1.4 b/contrib/global/dbpatches/patch.1.4
deleted file mode 100644
index cec5fbc559bd..000000000000
--- a/contrib/global/dbpatches/patch.1.4
+++ /dev/null
@@ -1,22 +0,0 @@
-*** btree/bt_page.c.orig Wed Jul 13 21:29:02 1994
---- btree/bt_page.c Wed Jun 11 20:14:43 1997
-***************
-*** 65,70 ****
---- 65,71 ----
- h->prevpg = P_INVALID;
- h->nextpg = t->bt_free;
- t->bt_free = h->pgno;
-+ F_SET(t, B_METADIRTY);
-
- /* Make sure the page gets written back. */
- return (mpool_put(t->bt_mp, h, MPOOL_DIRTY));
-***************
-*** 92,97 ****
---- 93,99 ----
- (h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
- *npg = t->bt_free;
- t->bt_free = h->nextpg;
-+ F_SET(t, B_METADIRTY);
- return (h);
- }
- return (mpool_new(t->bt_mp, npg));
diff --git a/contrib/global/gctags/C.c b/contrib/global/gctags/C.c
index 17df1accd5d7..c2d59f1f5aed 100644
--- a/contrib/global/gctags/C.c
+++ b/contrib/global/gctags/C.c
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -11,7 +12,8 @@
* 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 Shigio Yamaguchi.
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -27,52 +29,49 @@
* 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.
- *
- * C.c 12-Sep-98
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "C.h"
-#include "gctags.h"
-#include "defined.h"
-#include "die.h"
-#include "locatestring.h"
-#include "strbuf.h"
-#include "token.h"
+#include "ctags.h"
+#include "lookup.h"
-static int function_definition __P((int));
-static void condition_macro __P((int));
-static int reserved __P((char *));
+static int func_entry __P((void));
+static void hash_entry __P((void));
+static void skip_string __P((int));
+static int str_entry __P((int));
+#ifdef GLOBAL
+static int cmp __P((const void *, const void *));
+static int isstatement __P((char *));
+static void define_line __P((void));
+#endif
+#ifdef YACC
+extern int yaccfile; /* true when *.y file */
+#endif
/*
- * #ifdef stack.
- */
-static struct {
- short start; /* level when #if block started */
- short end; /* level when #if block end */
- short if0only; /* #if 0 or notdef only */
-} stack[MAXPIFSTACK], *cur;
-static int piflevel; /* condition macro level */
-static int level; /* brace level */
-
-/*
- * C: read C (includes .h, .y) file and pickup tag entries.
+ * c_entries --
+ * read .c and .h files and call appropriate routines
*/
void
-C(yacc)
- int yacc;
+c_entries()
{
- int c, cc;
- int savelevel;
- int target;
- int startmacro, startsharp;
- const char *interested = "{}=;";
- STRBUF *sb = stropen();
+ int c; /* current character */
+ int level; /* brace level */
+ int token; /* if reading a token */
+ int t_def; /* if reading a typedef */
+ int t_level; /* typedef's brace level */
+ char *sp; /* buffer pointer */
+ char tok[MAXTOKEN]; /* token buffer */
+#ifdef YACC
/*
* yacc file format is like the following.
*
@@ -83,395 +82,805 @@ C(yacc)
* programs
*
*/
- int yaccstatus = (yacc) ? DECLARATIONS : PROGRAMS;
- int inC = (yacc) ? 0 : 1; /* 1 while C source */
-
- level = piflevel = 0;
- savelevel = -1;
- target = (sflag) ? SYM : (rflag) ? REF : DEF;
- startmacro = startsharp = 0;
- cmode = 1; /* allow token like '#xxx' */
- crflag = 1; /* require '\n' as a token */
- if (yacc)
- ymode = 1; /* allow token like '%xxx' */
-
- while ((cc = nexttoken(interested, reserved)) != EOF) {
- switch (cc) {
- case SYMBOL: /* symbol */
- if (inC && peekc(0) == '('/* ) */) {
- if (isnotfunction(token)) {
- if (target == REF && defined(token))
- PUT(token, lineno, sp);
- } else if (level > 0 || startmacro) {
- if (target == REF && defined(token))
- PUT(token, lineno, sp);
- } else if (level == 0 && !startmacro && !startsharp) {
- char savetok[MAXTOKEN], *saveline;
- int savelineno = lineno;
-
- strcpy(savetok, token);
- strstart(sb);
- strnputs(sb, sp, strlen(sp) + 1);
- saveline = strvalue(sb);
- if (function_definition(target))
- if (target == DEF)
- PUT(savetok, savelineno, saveline);
- }
- } else {
- if (target == SYM)
- PUT(token, lineno, sp);
- }
- break;
- case '{': /* } */
- DBG_PRINT(level, "{"); /* } */
+#define DECLARATIONS 0
+#define RULES 1
+#define PROGRAMS 2
+ int yaccstatus = (yaccfile) ? DECLARATIONS : PROGRAMS;
+ int inyacc = (yaccfile) ? YES : NO; /* NO while C source */
+#endif
+
+ lineftell = ftell(inf);
+ sp = tok; token = t_def = NO; t_level = -1; level = 0; lineno = 1;
+ while (GETC(!=, EOF)) {
+ switch (c) {
+ /*
+ * Here's where it DOESN'T handle: {
+ * foo(a)
+ * {
+ * #ifdef notdef
+ * }
+ * #endif
+ * if (a)
+ * puts("hello, world");
+ * }
+ */
+ case '{':
+#ifdef YACC
if (yaccstatus == RULES && level == 0)
- inC = 1;
+ inyacc = NO;
+#endif
++level;
- if (bflag && atfirst) {
- if (wflag && level != 1) /* { */
- fprintf(stderr, "Warning: forced level 1 block start by '{' at column 0 [+%d %s].\n", lineno, curfile);
- level = 1;
- }
- break;
- /* { */
+ goto endtok;
case '}':
- if (--level < 0) {
- if (wflag)
- fprintf(stderr, "Warning: missing left '{' [+%d %s].\n", lineno, curfile); /* } */
+ /*
+ * if level goes below zero, try and fix
+ * it, even though we've already messed up
+ */
+ if (--level < 0)
level = 0;
- }
- if (eflag && atfirst) {
- if (wflag && level != 0) /* { */
- fprintf(stderr, "Warning: forced level 0 block end by '}' at column 0 [+%d %s].\n", lineno, curfile);
+#ifdef GLOBAL
+ /*
+ * -e flag force a function to end when a '}' appear
+ * at column 0. If -e flag not specified, all functions
+ * after funcA() would be lost.
+ *
+ * funcA() {
+ * #ifdef A
+ * if (a) {
+ * ...
+ * #else
+ * if (nota) {
+ * ...
+ * #endif
+ * }
+ * }
+ */
+ if (eflag && ftell(inf) == lineftell+1) {
level = 0;
}
+#endif
+#if YACC
if (yaccstatus == RULES && level == 0)
- inC = 0;
- /* { */
- DBG_PRINT(level, "}");
- break;
+ inyacc = YES;
+#endif
+ goto endtok;
+
case '\n':
- if (startmacro && level != savelevel) {
- if (wflag)
- fprintf(stderr, "Warning: different level before and after #define macro. reseted. [+%d %s].\n", lineno, curfile);
- level = savelevel;
- }
- startmacro = startsharp = 0;
- break;
- case YACC_SEP: /* %% */
- if (level != 0) {
- if (wflag)
- fprintf(stderr, "Warning: forced level 0 block end by '%%' [+%d %s].\n", lineno, curfile);
- level = 0;
+ SETLINE;
+ /*
+ * the above 3 cases are similar in that they
+ * are special characters that also end tokens.
+ */
+ endtok: if (sp > tok) {
+ *sp = EOS;
+ token = YES;
+ sp = tok;
}
- if (yaccstatus == DECLARATIONS) {
- if (target == DEF)
- PUT("yyparse", lineno, sp);
- yaccstatus = RULES;
- } else if (yaccstatus == RULES)
- yaccstatus = PROGRAMS;
- inC = (yaccstatus == PROGRAMS) ? 1 : 0;
+ else
+ token = NO;
+ continue;
+
+ /*
+ * We ignore quoted strings and character constants
+ * completely.
+ */
+ case '"':
+ case '\'':
+ (void)skip_string(c);
break;
- case YACC_BEGIN: /* %{ */
- if (level != 0) {
- if (wflag)
- fprintf(stderr, "Warning: forced level 0 block end by '%%{' [+%d %s].\n", lineno, curfile);
- level = 0;
+
+ /*
+ * comments can be fun; note the state is unchanged after
+ * return, in case we found:
+ * "foo() XX comment XX { int bar; }"
+ */
+ case '/':
+ if (GETC(==, '*')) {
+ skip_comment();
+ continue;
}
- if (inC == 1 && wflag)
- fprintf(stderr, "Warning: '%%{' appeared in C mode. [+%d %s].\n", lineno, curfile);
- inC = 1;
- break;
- case YACC_END: /* %} */
- if (level != 0) {
- if (wflag)
- fprintf(stderr, "Warning: forced level 0 block end by '%%}' [+%d %s].\n", lineno, curfile);
- level = 0;
+ (void)ungetc(c, inf);
+ c = '/';
+ goto storec;
+
+ /* hash marks flag #define's. */
+ case '#':
+ if (sp == tok) {
+ hash_entry();
+ break;
}
- if (inC == 0 && wflag)
- fprintf(stderr, "Warning: '%%}' appeared in Yacc mode. [+%d %s].\n", lineno, curfile);
- inC = 0;
- break;
+ goto storec;
+
/*
- * #xxx
+ * if we have a current token, parenthesis on
+ * level zero indicates a function.
+#ifdef GLOBAL
+ * in the case of rflag == 1, if we have a current token,
+ * parenthesis on level > zero indicates a function reference.
+#endif
+#ifdef YACC
+ * inyacc == NO while C source.
+#endif
*/
- case CP_DEFINE:
- startmacro = 1;
- savelevel = level;
- if ((c = nexttoken(interested, reserved)) != SYMBOL) {
- pushbacktoken();
+ case '(':
+#ifdef GLOBAL
+ if (sflag)
+ break;
+#endif
+#ifdef YACC
+ if (inyacc == NO)
+#endif
+#ifdef GLOBAL
+ if (!rflag && !level && token)
+#else
+ if (!level && token)
+#endif
+ {
+ int curline;
+
+ if (sp != tok)
+ *sp = EOS;
+ /*
+ * grab the line immediately, we may
+ * already be wrong, for example,
+ * foo\n
+ * (arg1,
+ */
+ getline();
+ curline = lineno;
+#ifdef GLOBAL
+ /* to make sure. */
+ if (!isstatement(tok))
+#endif
+ if (func_entry()) {
+ ++level;
+ pfnote(tok, curline);
+ }
break;
}
- if (peekc(1) == '('/* ) */) {
- if (target == DEF)
- PUT(token, lineno, sp);
- while ((c = nexttoken("()", reserved)) != EOF && c != '\n' && c != /* ( */ ')')
- if (c == SYMBOL && target == SYM)
- PUT(token, lineno, sp);
- if (c == '\n')
- pushbacktoken();
- }
- break;
- case CP_INCLUDE:
- case CP_ERROR:
- case CP_LINE:
- case CP_PRAGMA:
- while ((c = nexttoken(interested, reserved)) != EOF && c != '\n')
- ;
- break;
- case CP_IFDEF:
- case CP_IFNDEF:
- case CP_IF:
- case CP_ELIF:
- case CP_ELSE:
- case CP_ENDIF:
- case CP_UNDEF:
- condition_macro(cc);
- while ((c = nexttoken(interested, reserved)) != EOF && c != '\n') {
- if (!((cc == CP_IF || cc == CP_ELIF) && !strcmp(token, "defined")))
- continue;
- if (c == SYMBOL && target == SYM)
- PUT(token, lineno, sp);
+#ifdef GLOBAL
+ else if (rflag && level && token) {
+ if (sp != tok)
+ *sp = EOS;
+ if (!isstatement(tok) && lookup(tok)) {
+ getline();
+ pfnote(tok, lineno);
+ }
+ break;
}
- break;
- case CP_SHARP: /* ## */
- (void)nexttoken(interested, reserved);
- break;
- case C_STRUCT:
- c = nexttoken(interested, reserved);
- if (c == '{' /* } */) {
- pushbacktoken();
+#endif
+ goto storec;
+
+ /*
+ * semi-colons indicate the end of a typedef; if we find a
+ * typedef we search for the next semi-colon of the same
+ * level as the typedef. Ignoring "structs", they are
+ * tricky, since you can find:
+ *
+ * "typedef long time_t;"
+ * "typedef unsigned int u_int;"
+ * "typedef unsigned int u_int [10];"
+ *
+ * If looking at a typedef, we save a copy of the last token
+ * found. Then, when we find the ';' we take the current
+ * token if it starts with a valid token name, else we take
+ * the one we saved. There's probably some reasonable
+ * alternative to this...
+ */
+ case ';':
+ if (t_def && level == t_level) {
+ t_def = NO;
+ getline();
+ if (sp != tok)
+ *sp = EOS;
+ pfnote(tok, lineno);
break;
}
- if (c == SYMBOL)
- if (target == SYM)
- PUT(token, lineno, sp);
- break;
- case C_EXTERN:
- if (startmacro)
+ goto storec;
+
+#if YACC
+ case '%':
+ if (yaccstatus == DECLARATIONS || yaccstatus == RULES) {
+ if (GETC(==, '%')) {
+ level = 0;
+ if (yaccstatus == DECLARATIONS) {
+ if (!rflag) {
+ getline();
+ pfnote("yyparse", lineno);
+ }
+ yaccstatus = RULES;
+ } else if (yaccstatus == RULES) {
+ yaccstatus = PROGRAMS;
+ }
+ inyacc = (yaccstatus == PROGRAMS) ? NO : YES;
+ } else if (c == '{') {
+ level = 0;
+ inyacc = NO;
+ } else if (c == '}') {
+ level = 0;
+ inyacc = YES;
+ } else {
+ (void)ungetc(c, inf);
+ }
break;
- while ((c = nexttoken(interested, reserved)) != EOF && c != ';') {
- switch (c) {
- case CP_IFDEF:
- case CP_IFNDEF:
- case CP_IF:
- case CP_ELIF:
- case CP_ELSE:
- case CP_ENDIF:
- case CP_UNDEF:
- condition_macro(c);
- continue;
+ }
+ /* else fall throuth */
+#endif
+ /*
+ * store characters until one that can't be part of a token
+ * comes along; check the current token against certain
+ * reserved words.
+ */
+ default:
+ /* ignore whitespace */
+ if (c == ' ' || c == '\t') {
+ int save = c;
+ while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
+ ;
+ if (c == EOF)
+ return;
+ (void)ungetc(c, inf);
+ c = save;
+ }
+ storec: if (!intoken(c)) {
+ if (sp == tok)
+ break;
+ *sp = EOS;
+#ifdef GLOBAL
+ /* ignore assembler in C source */
+ if (!memcmp(tok, "_asm",4)) {
+ while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
+ ;
+ if (c == EOF)
+ return;
+ if (c == '{') {
+ while (GETC(!=, EOF) && c != '}') {
+ if (c == '\n')
+ SETLINE;
+ }
+ } else {
+ while (GETC(!=, EOF) && c != '\n')
+ ;
+ if (c == '\n')
+ SETLINE;
+ }
+ if (c == EOF)
+ return;
+ break;
}
- if (startmacro && c == '\n')
+ if (sflag) {
+ if (!isstatement(tok)) {
+ getline();
+ pfnote(tok, lineno);
+ }
break;
- if (c == '{')
- level++;
- else if (c == '}')
- level--;
- else if (c == SYMBOL)
- if (target == SYM)
- PUT(token, lineno, sp);
+ }
+ if (!memcmp(tok, "extern",7)) {
+ while (GETC(!=, EOF) && c != ';') {
+ if (c == '\n')
+ SETLINE;
+ }
+ if (c == EOF)
+ return;
+ break;
+ }
+#endif
+ if (tflag) {
+ /* no typedefs inside typedefs */
+ if (!t_def &&
+ !memcmp(tok, "typedef",8)) {
+ t_def = YES;
+ t_level = level;
+ break;
+ }
+ /* catch "typedef struct" */
+ if ((!t_def || t_level < level)
+ && (!memcmp(tok, "struct", 7)
+ || !memcmp(tok, "union", 6)
+ || !memcmp(tok, "enum", 5))) {
+ /*
+ * get line immediately;
+ * may change before '{'
+ */
+ getline();
+ if (str_entry(c))
+ ++level;
+ break;
+ /* } */
+ }
+ }
+ sp = tok;
+ }
+ else if (sp != tok || begtoken(c)) {
+ *sp++ = c;
+ token = YES;
+ }
+#ifdef GLOBAL
+ /* skip hex number */
+ else if (sp == tok && c == '0') {
+ if (GETC(==, 'x') || c == 'X') {
+ while (GETC(!=, EOF) && isxdigit(c))
+ ;
+ if (c == EOF)
+ return;
+ }
+ (void)ungetc(c, inf);
}
+#endif
+ continue;
+ /* end of default */
+ } /* end of switch */
+ /*
+ * 'break' statement in switch block come here.
+ */
+ sp = tok;
+ token = NO;
+ } /* end of while */
+}
+
+/*
+ * func_entry --
+ * handle a function reference
+ */
+static int
+func_entry()
+{
+ int c; /* current character */
+ int level = 0; /* for matching '()' */
+
+ /*
+ * Find the end of the assumed function declaration.
+ * Note that ANSI C functions can have type definitions so keep
+ * track of the parentheses nesting level.
+ */
+ while (GETC(!=, EOF)) {
+ switch (c) {
+ case '\'':
+ case '"':
+ /* skip strings and character constants */
+ skip_string(c);
break;
- /* control statement check */
- case C_BREAK:
- case C_CASE:
- case C_CONTINUE:
- case C_DEFAULT:
- case C_DO:
- case C_ELSE:
- case C_FOR:
- case C_GOTO:
- case C_IF:
- case C_RETURN:
- case C_SWITCH:
- case C_WHILE:
- if (wflag && !startmacro && level == 0)
- fprintf(stderr, "Warning: Out of function. %8s [+%d %s]\n", token, lineno, curfile);
+ case '/':
+ /* skip comments */
+ if (GETC(==, '*'))
+ skip_comment();
break;
- default:
+ case '(':
+ level++;
+ break;
+ case ')':
+ if (level == 0)
+ goto fnd;
+ level--;
+ break;
+ case '\n':
+ SETLINE;
}
}
- strclose(sb);
- if (wflag) {
- if (level != 0)
- fprintf(stderr, "Warning: {} block unmatched. (last at level %d.)[+%d %s]\n", level, lineno, curfile);
- if (piflevel != 0)
- fprintf(stderr, "Warning: #if block unmatched. (last at level %d.)[+%d %s]\n", piflevel, lineno, curfile);
+ return (NO);
+fnd:
+ /*
+ * we assume that the character after a function's right paren
+ * is a token character if it's a function and a non-token
+ * character if it's a declaration. Comments don't count...
+ */
+ for (;;) {
+ while (GETC(!=, EOF) && iswhite(c))
+ if (c == '\n')
+ SETLINE;
+ if (intoken(c) || c == '{')
+ break;
+ if (c == '/' && GETC(==, '*'))
+ skip_comment();
+ else { /* don't ever "read" '/' */
+ (void)ungetc(c, inf);
+ return (NO);
+ }
}
+ if (c != '{')
+ (void)skip_key('{');
+ return (YES);
}
+
/*
- * function_definition: return if function definition or not.
- *
- * r) target type
+ * hash_entry --
+ * handle a line starting with a '#'
*/
-static int
-function_definition(target)
-int target;
+static void
+hash_entry()
{
- int c;
- int brace_level, isdefine;
+ int c; /* character read */
+ int curline; /* line started on */
+ char *sp; /* buffer pointer */
+ char tok[MAXTOKEN]; /* storage buffer */
- brace_level = isdefine = 0;
- while ((c = nexttoken("(,)", reserved)) != EOF) {
- switch (c) {
- case CP_IFDEF:
- case CP_IFNDEF:
- case CP_IF:
- case CP_ELIF:
- case CP_ELSE:
- case CP_ENDIF:
- case CP_UNDEF:
- condition_macro(c);
- continue;
+ /* ignore leading whitespace */
+ while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
+ ;
+ (void)ungetc(c, inf);
+ curline = lineno;
+ for (sp = tok;;) { /* get next token */
+ if (GETC(==, EOF))
+ return;
+ if (iswhite(c))
+ break;
+ *sp++ = c;
+ }
+ *sp = EOS;
+#ifdef GLOBAL
+ if (sflag && memcmp(tok, "include", 7)) {
+ (void)ungetc(c, inf);
+ define_line();
+ return;
+ }
+#endif
+ if (memcmp(tok, "define", 6)) /* only interested in #define's */
+ goto skip;
+
+ for (;;) { /* this doesn't handle "#define \n" */
+ if (GETC(==, EOF))
+ return;
+ if (!iswhite(c))
+ break;
+ }
+ for (sp = tok;;) { /* get next token */
+ *sp++ = c;
+ if (GETC(==, EOF))
+ return;
+ /*
+ * this is where it DOESN'T handle
+ * "#define \n"
+ */
+ if (!intoken(c))
+ break;
+ }
+ *sp = EOS;
+#ifdef GLOBAL
+ if (rflag) {
+ /*
+ * #define XXX\n
+ */
+ if (c == '\n') {
+ SETLINE;
+ return;
}
- if (c == '('/* ) */)
- brace_level++;
- else if (c == /* ( */')') {
- if (--brace_level == 0)
+ /*
+ * v
+ * #define XXX(X) XXXXXX
+ */
+ if (c == '(')
+ (void)skip_key(')');
+ /*
+ * v
+ * #define XXX(X) XXXXXX
+ */
+ while (GETC(!=, EOF)) {
+ if (c != ' ' && c != '\t') {
+ (void)ungetc(c, inf);
break;
- } else if (c == SYMBOL) {
- if (target == SYM)
- PUT(token, lineno, sp);
+ }
}
+ /*
+ * v
+ * #define XXX(X) XXXXXX
+ */
+ define_line();
+ return;
+ }
+#endif
+ if (dflag || c == '(') { /* only want macros */
+ getline();
+ pfnote(tok, curline);
+ }
+skip: if (c == '\n') { /* get rid of rest of define */
+ SETLINE
+ if (*(sp - 1) != '\\')
+ return;
}
- if (c == EOF)
- return 0;
- while ((c = nexttoken(",;{}=", reserved)) != EOF) {
+ (void)skip_key('\n');
+}
+
+#ifdef GLOBAL
+ /* sorted by alphabet */
+static struct words {
+ char *name;
+} words[] = {
+ {"__P"},
+ {"auto"},
+ {"break"},
+ {"case"},
+ {"char"},
+ {"continue"},
+ {"default"},
+ {"do"},
+ {"double"},
+ {"else"},
+ {"extern"},
+ {"float"},
+ {"for"},
+ {"goto"},
+ {"if"},
+ {"int"},
+ {"long"},
+ {"register"},
+ {"return"},
+ {"short"},
+ {"sizeof"},
+ {"static"},
+ {"struct"},
+ {"switch"},
+ {"typedef"},
+ {"union"},
+ {"unsigned"},
+ {"void"},
+ {"while"},
+};
+
+static int
+cmp(s1, s2)
+ const void *s1, *s2;
+{
+ return strcmp(((struct words *)s1)->name, ((struct words *)s2)->name);
+}
+
+static int
+isstatement(token)
+ char *token;
+{
+ struct words tmp;
+
+ tmp.name = token;
+ if (bsearch(&tmp, words, sizeof(words)/sizeof(struct words), sizeof(struct words), cmp))
+ return YES;
+ return NO;
+}
+
+static void
+define_line()
+{
+ int c; /* character read */
+ int level; /* brace level */
+ int token; /* if reading a token */
+ char *sp; /* buffer pointer */
+ char tok[MAXTOKEN]; /* storage buffer */
+
+ sp = tok; token = NO; level = 0;
+ while (GETC(!=, EOF)) {
switch (c) {
- case CP_IFDEF:
- case CP_IFNDEF:
- case CP_IF:
- case CP_ELIF:
- case CP_ELSE:
- case CP_ENDIF:
- case CP_UNDEF:
- condition_macro(c);
+ case '{':
+ ++level;
+ goto endtok;
+ case '}':
+ if (--level < 0)
+ level = 0;
+ goto endtok;
+
+ case '\\':
+ if (GETC(==, '\n')) {
+ SETLINE;
+ }
continue;
- }
- if (c == SYMBOL || IS_RESERVED(c))
- isdefine = 1;
- else if (c == ';' || c == ',') {
- if (!isdefine)
+
+ case '\n':
+ if (sflag && token) {
+ if (sp != tok)
+ *sp = EOS;
+ if (!isstatement(tok)) {
+ getline();
+ pfnote(tok, lineno);
+ }
+ }
+ SETLINE;
+ return;
+ endtok: if (sp > tok) {
+ *sp = EOS;
+ token = YES;
+ sp = tok;
+ }
+ else
+ token = NO;
+ continue;
+
+ case '"':
+ case '\'':
+ (void)skip_string(c);
+ break;
+
+ case '/':
+ if (GETC(==, '*')) {
+ skip_comment();
+ continue;
+ }
+ (void)ungetc(c, inf);
+ c = '/';
+ goto storec;
+
+ case '(':
+ if (sflag)
break;
- } else if (c == '{' /* } */) {
- pushbacktoken();
- return 1;
- } else if (c == /* { */'}') {
+ if (token) {
+ if (sp != tok)
+ *sp = EOS;
+ getline();
+ if (!isstatement(tok) && lookup(tok))
+ pfnote(tok, lineno);
+ break;
+ }
+ goto storec;
+
+ case ';':
+ goto storec;
+
+ default:
+storec: if (!intoken(c)) {
+ if (sp == tok)
+ break;
+ *sp = EOS;
+ sp = tok;
+ if (sflag) {
+ if (!isstatement(tok)) {
+ getline();
+ pfnote(tok, lineno);
+ }
+ break;
+ }
+ }
+ else if (sp != tok || begtoken(c)) {
+ *sp++ = c;
+ token = YES;
+ }
+ continue;
+ }
+
+ sp = tok;
+ token = NO;
+ }
+}
+#endif
+/*
+ * str_entry --
+ * handle a struct, union or enum entry
+ */
+static int
+str_entry(c)
+ int c; /* current character */
+{
+ int curline; /* line started on */
+ char *sp; /* buffer pointer */
+ char tok[LINE_MAX]; /* storage buffer */
+
+ curline = lineno;
+ while (iswhite(c))
+ if (GETC(==, EOF))
+ return (NO);
+ if (c == '{') /* it was "struct {" */
+ return (YES);
+ for (sp = tok;;) { /* get next token */
+ *sp++ = c;
+ if (GETC(==, EOF))
+ return (NO);
+ if (!intoken(c))
break;
- } else if (c == '=')
+ }
+ switch (c) {
+ case '{': /* it was "struct foo{" */
+ --sp;
break;
+ case '\n': /* it was "struct foo\n" */
+ SETLINE;
+ /*FALLTHROUGH*/
+ default: /* probably "struct foo " */
+ while (GETC(!=, EOF))
+ if (!iswhite(c))
+ break;
+ if (c != '{') {
+ (void)ungetc(c, inf);
+ return (NO);
+ }
}
- return 0;
+ *sp = EOS;
+ pfnote(tok, curline);
+ return (YES);
}
/*
- * condition_macro:
- *
- * i) cc token
+ * skip_comment --
+ * skip over comment
+ */
+void
+skip_comment()
+{
+ int c; /* character read */
+ int star; /* '*' flag */
+
+ for (star = 0; GETC(!=, EOF);)
+ switch(c) {
+ /* comments don't nest, nor can they be escaped. */
+ case '*':
+ star = YES;
+ break;
+ case '/':
+ if (star)
+ return;
+ break;
+ case '\n':
+ SETLINE;
+ /*FALLTHROUGH*/
+ default:
+ star = NO;
+ break;
+ }
+}
+
+/*
+ * skip_string --
+ * skip to the end of a string or character constant.
*/
static void
-condition_macro(cc)
- int cc;
+skip_string(key)
+ int key;
{
- cur = &stack[piflevel];
- if (cc == CP_IFDEF || cc == CP_IFNDEF || cc == CP_IF) {
- DBG_PRINT(piflevel, "#if");
- if (++piflevel >= MAXPIFSTACK)
- die1("#if stack over flow. [%s]", curfile);
- ++cur;
- cur->start = level;
- cur->end = -1;
- cur->if0only = 0;
- if (peekc(0) == '0')
- cur->if0only = 1;
- else if ((cc = nexttoken(NULL, reserved)) == SYMBOL && !strcmp(token, "notdef"))
- cur->if0only = 1;
- else
- pushbacktoken();
- } else if (cc == CP_ELIF || cc == CP_ELSE) {
- DBG_PRINT(piflevel - 1, "#else");
- if (cur->end == -1)
- cur->end = level;
- else if (cur->end != level && wflag)
- fprintf(stderr, "Warning: uneven level. [+%d %s]\n", lineno, curfile);
- level = cur->start;
- cur->if0only = 0;
- } else if (cc == CP_ENDIF) {
- if (cur->if0only)
- level = cur->start;
- else if (cur->end != -1) {
- if (cur->end != level && wflag)
- fprintf(stderr, "Warning: uneven level. [+%d %s]\n", lineno, curfile);
- level = cur->end;
+ int c,
+ skip;
+
+ for (skip = NO; GETC(!=, EOF); )
+ switch (c) {
+ case '\\': /* a backslash escapes anything */
+ skip = !skip; /* we toggle in case it's "\\" */
+ break;
+ case '\n':
+ SETLINE;
+ /*FALLTHROUGH*/
+ default:
+ if (c == key && !skip)
+ return;
+ skip = NO;
}
- --piflevel;
- DBG_PRINT(piflevel, "#endif");
- }
}
- /* sorted by alphabet */
-static struct words words[] = {
- {"##", CP_SHARP},
- {"#define", CP_DEFINE},
- {"#elif", CP_ELIF},
- {"#else", CP_ELSE},
- {"#endif", CP_ENDIF},
- {"#error", CP_ERROR},
- {"#if", CP_IF},
- {"#ifdef", CP_IFDEF},
- {"#ifndef", CP_IFNDEF},
- {"#include", CP_INCLUDE},
- {"#line", CP_LINE},
- {"#pragma", CP_PRAGMA},
- {"#undef", CP_UNDEF},
- {"%%", YACC_SEP},
- {"%left", YACC_LEFT},
- {"%nonassoc", YACC_NONASSOC},
- {"%right", YACC_RIGHT},
- {"%start", YACC_START},
- {"%token", YACC_TOKEN},
- {"%type", YACC_TYPE},
- {"%{", YACC_BEGIN},
- {"%}", YACC_END},
- {"__P", C___P},
- {"auto", C_AUTO},
- {"break", C_BREAK},
- {"case", C_CASE},
- {"char", C_CHAR},
- {"continue", C_CONTINUE},
- {"default", C_DEFAULT},
- {"do", C_DO},
- {"double", C_DOUBLE},
- {"else", C_ELSE},
- {"extern", C_EXTERN},
- {"float", C_FLOAT},
- {"for", C_FOR},
- {"goto", C_GOTO},
- {"if", C_IF},
- {"int", C_INT},
- {"long", C_LONG},
- {"register", C_REGISTER},
- {"return", C_RETURN},
- {"short", C_SHORT},
- {"sizeof", C_SIZEOF},
- {"static", C_STATIC},
- {"struct", C_STRUCT},
- {"switch", C_SWITCH},
- {"typedef", C_TYPEDEF},
- {"union", C_UNION},
- {"unsigned", C_UNSIGNED},
- {"void", C_VOID},
- {"while", C_WHILE},
-};
-static int
-reserved(word)
- char *word;
+/*
+ * skip_key --
+ * skip to next char "key"
+ */
+int
+skip_key(key)
+ int key;
{
- struct words tmp;
- struct words *result;
+ int c,
+ skip,
+ retval;
- tmp.name = word;
- result = (struct words *)bsearch(&tmp, words, sizeof(words)/sizeof(struct words), sizeof(struct words), cmp);
- return (result != NULL) ? result->val : SYMBOL;
+ for (skip = retval = NO; GETC(!=, EOF);)
+ switch(c) {
+ case '\\': /* a backslash escapes anything */
+ skip = !skip; /* we toggle in case it's "\\" */
+ break;
+ case ';': /* special case for yacc; if one */
+ case '|': /* of these chars occurs, we may */
+ retval = YES; /* have moved out of the rule */
+ break; /* not used by C */
+ case '\'':
+ case '"':
+ /* skip strings and character constants */
+ skip_string(c);
+ break;
+ case '/':
+ /* skip comments */
+ if (GETC(==, '*')) {
+ skip_comment();
+ break;
+ }
+ (void)ungetc(c, inf);
+ c = '/';
+ goto norm;
+ case '\n':
+ SETLINE;
+ /*FALLTHROUGH*/
+ default:
+ norm:
+ if (c == key && !skip)
+ return (retval);
+ skip = NO;
+ }
+ return (retval);
}
diff --git a/contrib/global/gctags/C.h b/contrib/global/gctags/C.h
deleted file mode 100644
index ae60948413e5..000000000000
--- a/contrib/global/gctags/C.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * C.h 20-Aug-98
- */
-#define DECLARATIONS 0
-#define RULES 1
-#define PROGRAMS 2
-
-#define C___P 1001
-#define C_AUTO 1002
-#define C_BREAK 1003
-#define C_CASE 1004
-#define C_CHAR 1005
-#define C_CONTINUE 1006
-#define C_DEFAULT 1007
-#define C_DO 1008
-#define C_DOUBLE 1009
-#define C_ELSE 1010
-#define C_EXTERN 1011
-#define C_FLOAT 1012
-#define C_FOR 1013
-#define C_GOTO 1014
-#define C_IF 1015
-#define C_INT 1016
-#define C_LONG 1017
-#define C_REGISTER 1018
-#define C_RETURN 1019
-#define C_SHORT 1020
-#define C_SIZEOF 1021
-#define C_STATIC 1022
-#define C_STRUCT 1023
-#define C_SWITCH 1024
-#define C_TYPEDEF 1025
-#define C_UNION 1026
-#define C_UNSIGNED 1027
-#define C_VOID 1028
-#define C_WHILE 1029
-#define CP_ELIF 2001
-#define CP_ELSE 2002
-#define CP_DEFINE 2003
-#define CP_IF 2004
-#define CP_IFDEF 2005
-#define CP_IFNDEF 2006
-#define CP_INCLUDE 2007
-#define CP_PRAGMA 2008
-#define CP_SHARP 2009
-#define CP_ERROR 2010
-#define CP_UNDEF 2011
-#define CP_ENDIF 2012
-#define CP_LINE 2013
-#define YACC_SEP 3001
-#define YACC_BEGIN 3002
-#define YACC_END 3003
-#define YACC_LEFT 3004
-#define YACC_NONASSOC 3005
-#define YACC_RIGHT 3006
-#define YACC_START 3007
-#define YACC_TOKEN 3008
-#define YACC_TYPE 3009
-
-#define IS_CTOKEN(c) (c > 1000 && c < 2001)
-#define IS_CPTOKEN(c) (c > 2000 && c < 3001)
-#define IS_YACCTOKEN(c) (c > 3000 && c < 4001)
-#define MAXPIFSTACK 100
diff --git a/contrib/global/gctags/Makefile b/contrib/global/gctags/Makefile
index 18bc967ef894..bdecdfb7ffb6 100644
--- a/contrib/global/gctags/Makefile
+++ b/contrib/global/gctags/Makefile
@@ -1,4 +1,7 @@
PROG= gctags
-SRCS= C.c assembler.c gctags.c java.c
+CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../lib
+LDADD= $(LIBUTIL)
+DPADD= $(LIBUTIL)
+SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c assembler.c
.include <bsd.prog.mk>
diff --git a/contrib/global/gctags/assembler.c b/contrib/global/gctags/assembler.c
index 7f2a532ec228..44d5aec69e58 100644
--- a/contrib/global/gctags/assembler.c
+++ b/contrib/global/gctags/assembler.c
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -11,7 +12,8 @@
* 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 Shigio Yamaguchi.
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -27,111 +29,80 @@
* 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.
- *
- * assembler.c 20-Aug-98
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)assembler.c 8.3 (Berkeley) 6/6/97";
+#endif /* LIBC_SCCS and not lint */
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
-#include "gctags.h"
-#include "defined.h"
-#include "token.h"
-
-static int reserved __P((char *));
-
-#define A_CALL 1001
-#define A_DEFINE 1002
-#define A_ENTRY 1003
-#define A_EXT 1004
-#define A_ALTENTRY 1005
+#include "ctags.h"
+#include "lookup.h"
+#ifdef GLOBAL
void
-assembler()
+asm_entries()
{
- int c;
- int target;
- const char *interested = NULL; /* get all token */
- int startline = 1;
- int level; /* not used */
-
- level = 0; /* to satisfy compiler */
- /* symbol search doesn't supported. */
- if (sflag)
- return;
- target = (rflag) ? REF : DEF;
+ char *lbp;
+ char tok[MAXTOKEN];
+ char *sp;
- cmode = 1;
- crflag = 1;
-
- while ((c = nexttoken(interested, reserved)) != EOF) {
- switch (c) {
- case '\n':
- startline = 1;
- continue;
- case A_CALL:
- if (!startline || target != REF)
- break;
- if ((c = nexttoken(interested, reserved)) == A_EXT) {
- if ((c = nexttoken(interested, reserved)) == '('/* ) */)
- if ((c = nexttoken(interested, reserved)) == SYMBOL)
- if (defined(token))
- PUT(token, lineno, sp);
- } else if (c == SYMBOL && *token == '_') {
- if (defined(&token[1]))
- PUT(&token[1], lineno, sp);
- }
- break;
- case A_ALTENTRY:
- case A_ENTRY:
- if (!startline || target != DEF)
- break;
- if ((c = nexttoken(interested, reserved)) == '('/* ) */)
- if ((c = nexttoken(interested, reserved)) == SYMBOL)
- if (peekc(1) == /* ( */ ')')
- PUT(token, lineno, sp);
- break;
- case A_DEFINE:
- if (!startline || target != DEF)
- break;
- if ((c = nexttoken(interested, reserved)) == SYMBOL) {
- if (peekc(1) == '('/* ) */) {
- PUT(token, lineno, sp);
- while ((c = nexttoken(interested, reserved)) != EOF && c != '\n' && c != /* ( */ ')')
- ;
- while ((c = nexttoken(interested, reserved)) != EOF && c != '\n')
- ;
- }
- }
- default:
+ for (;;) {
+ lineftell = ftell(inf);
+ if (!fgets(lbuf, sizeof(lbuf), inf))
+ return;
+ ++lineno;
+ if (rflag) {
+ /* extract only call EXT(xxx) or call _xxx */
+ lbp = lbuf;
+ while (*lbp && isspace(*lbp))
+ lbp++;
+ if (*lbp != 'c' || strncmp(lbp, "call", 4))
+ continue;
+ lbp += 4;
+ while (*lbp && isspace(*lbp))
+ lbp++;
+ sp = tok;
+ if (!strncmp(lbp, "EXT(" /* ) */, 4)) {
+ lbp += 4;
+ while (*lbp && intoken(*lbp))
+ *sp++ = *lbp++;
+ if (*lbp != /* ( */ ')')
+ continue;
+ *sp = EOS;
+ } else if (*lbp == '_') {
+ lbp++;
+ while (*lbp && intoken(*lbp))
+ *sp++ = *lbp++;
+ *sp = EOS;
+ } else
+ continue;
+ if (!lookup(tok))
+ continue;
+ } else {
+ /* extract only ENTRY() and ALTENTRY(). */
+ if (lbuf[0] != 'E' && lbuf[0] != 'A')
+ continue;
+ lbp = lbuf;
+ if (!strncmp(lbp, "ENTRY(", 6)) {
+ lbp += 6;
+ } else if (!strncmp(lbp, "ALTENTRY(", 9)) {
+ lbp += 9;
+ } else
+ continue;
+ sp = tok;
+ while (*lbp && intoken(*lbp))
+ *sp++ = *lbp++;
+ if (*lbp != /* ( */ ')')
+ continue;
+ *sp = EOS;
}
- startline = 0;
- }
-}
-static int
-reserved(word)
- char *word;
-{
- switch (*word) {
- case '#':
- if (!strcmp(word, "#define"))
- return A_DEFINE;
- break;
- case 'A':
- if (!strcmp(word, "ALTENTRY"))
- return A_ALTENTRY;
- break;
- case 'E':
- if (!strcmp(word, "ENTRY"))
- return A_ENTRY;
- else if (!strcmp(word, "EXT"))
- return A_EXT;
- break;
- case 'c':
- if (!strcmp(word, "call"))
- return A_CALL;
- break;
+ getline();
+ pfnote(tok, lineno);
}
- return SYMBOL;
+ /*NOTREACHED*/
}
+#endif
diff --git a/contrib/global/gctags/ctags.c b/contrib/global/gctags/ctags.c
new file mode 100644
index 000000000000..d79a348ef4d4
--- /dev/null
+++ b/contrib/global/gctags/ctags.c
@@ -0,0 +1,379 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint
+static const char copyright[] =
+"@(#) Copyright (c) 1987, 1993, 1994\n\
+ The Regents of the University of California. All rights reserved.\n";
+#endif /* not lint */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] =
+ "$Id: ctags.c,v 1.1.1.2 1997/12/15 23:08:35 cwt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "ctags.h"
+#ifdef GLOBAL
+#include "lookup.h"
+#include "die.h"
+#endif
+
+/*
+ * ctags: create a tags file
+ */
+
+NODE *head; /* head of the sorted binary tree */
+
+ /* boolean "func" (see init()) */
+bool _wht[256], _etk[256], _itk[256], _btk[256], _gd[256];
+
+FILE *inf; /* ioptr for current input file */
+FILE *outf; /* ioptr for tags file */
+
+long lineftell; /* ftell after getc( inf ) == '\n' */
+
+int lineno; /* line number of current line */
+#ifdef GLOBAL
+int cflag; /* -c: compact index */
+#endif
+int dflag; /* -d: non-macro defines */
+#ifdef GLOBAL
+int eflag; /* -e: '{' at 0 column force function end */
+#endif
+int tflag; /* -t: create tags for typedefs */
+int vflag; /* -v: vgrind style index output */
+int wflag; /* -w: suppress warnings */
+int xflag; /* -x: cxref style output */
+#ifdef GLOBAL
+int Dflag; /* -D: allow duplicate entrys */
+int rflag; /* -r: function reference */
+int sflag; /* -s: collect symbols */
+#endif
+#ifdef YACC
+int yaccfile; /* yacc file */
+#endif
+
+char *curfile; /* current input file name */
+char searchar = '/'; /* use /.../ searches by default */
+char lbuf[LINE_MAX];
+char *progname = "gctags"; /* program name */
+
+void init __P((void));
+void find_entries __P((char *));
+void main __P((int, char **));
+static void usage __P((void));
+
+void
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ static char *outfile = "tags"; /* output file */
+ int aflag; /* -a: append to tags */
+ int uflag; /* -u: update tags */
+ int exit_val; /* exit value */
+ int step; /* step through args */
+ int ch; /* getopts char */
+ char cmd[100]; /* too ugly to explain */
+ extern char *optarg;
+ extern int optind;
+
+ aflag = uflag = NO;
+#ifdef GLOBAL
+ while ((ch = getopt(argc, argv, "BDFacdef:rstuwvx")) != -1)
+#else
+ while ((ch = getopt(argc, argv, "BFadf:tuwvx")) != -1)
+#endif
+ switch(ch) {
+ case 'B':
+ searchar = '?';
+ break;
+#ifdef GLOBAL
+ case 'D':
+ Dflag++;
+ break;
+#endif
+ case 'F':
+ searchar = '/';
+ break;
+#ifdef GLOBAL
+ case 's':
+ sflag++;
+ break;
+#endif
+ case 'a':
+ aflag++;
+ break;
+#ifdef GLOBAL
+ case 'c':
+ cflag++;
+ break;
+#endif
+ case 'd':
+ dflag++;
+ break;
+#ifdef GLOBAL
+ case 'e':
+ eflag++;
+ break;
+#endif
+ case 'f':
+ outfile = optarg;
+ break;
+#ifdef GLOBAL
+ case 'r':
+ rflag++;
+ break;
+#endif
+ case 't':
+ tflag++;
+ break;
+ case 'u':
+ uflag++;
+ break;
+ case 'w':
+ wflag++;
+ break;
+ case 'v':
+ vflag++;
+ case 'x':
+ xflag++;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ argv += optind;
+ argc -= optind;
+ if (!argc)
+ usage();
+#ifdef GLOBAL
+ if (sflag && rflag)
+ die("-s and -r conflict.");
+ if (rflag) {
+ char *dbpath;
+
+ if (!(dbpath = getenv("GTAGSDBPATH")))
+ dbpath = ".";
+ lookupopen(dbpath);
+ }
+#endif
+ init();
+
+ for (exit_val = step = 0; step < argc; ++step)
+ if (!(inf = fopen(argv[step], "r"))) {
+ fprintf(stderr, "%s: %s cannot open\n", progname, argv[step]);
+ exit_val = 1;
+ }
+ else {
+ curfile = argv[step];
+ find_entries(argv[step]);
+ (void)fclose(inf);
+ }
+
+ if (head)
+ if (xflag) {
+ put_entries(head);
+#ifdef GLOBAL
+ if (cflag)
+ compact_print("", 0, "");/* flush last record */
+#endif
+ } else {
+ if (uflag) {
+ for (step = 0; step < argc; step++) {
+ (void)sprintf(cmd,
+ "mv %s OTAGS; fgrep -v '\t%s\t' OTAGS >%s; rm OTAGS",
+ outfile, argv[step],
+ outfile);
+ system(cmd);
+ }
+ ++aflag;
+ }
+ if (!(outf = fopen(outfile, aflag ? "a" : "w"))) {
+ fprintf(stderr, "%s: %s cannot open\n", progname, outfile);
+ exit(exit_val);
+ }
+ put_entries(head);
+ (void)fclose(outf);
+ if (uflag) {
+ (void)sprintf(cmd, "sort -o %s %s",
+ outfile, outfile);
+ system(cmd);
+ }
+ }
+#ifdef GLOBAL
+ if (rflag)
+ lookupclose();
+#endif
+ exit(exit_val);
+}
+
+static void
+usage()
+{
+ (void)fprintf(stderr,
+#ifdef GLOBAL
+ "usage: gctags [-BDFacderstuvwx] [-f tagsfile] file ...\n");
+#else
+ "usage: ctags [-BFadtuwvx] [-f tagsfile] file ...\n");
+#endif
+ exit(1);
+}
+
+/*
+ * init --
+ * this routine sets up the boolean psuedo-functions which work by
+ * setting boolean flags dependent upon the corresponding character.
+ * Every char which is NOT in that string is false with respect to
+ * the pseudo-function. Therefore, all of the array "_wht" is NO
+ * by default and then the elements subscripted by the chars in
+ * CWHITE are set to YES. Thus, "_wht" of a char is YES if it is in
+ * the string CWHITE, else NO.
+ */
+void
+init()
+{
+ int i;
+ unsigned char *sp;
+
+ for (i = 0; i < 256; i++) {
+ _wht[i] = _etk[i] = _itk[i] = _btk[i] = NO;
+ _gd[i] = YES;
+ }
+#define CWHITE " \f\t\n"
+ for (sp = (unsigned char *)CWHITE; *sp; sp++) /* white space chars */
+ _wht[*sp] = YES;
+#define CTOKEN " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?"
+ for (sp = (unsigned char *)CTOKEN; *sp; sp++) /* token ending chars */
+ _etk[*sp] = YES;
+#define CINTOK "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789"
+ for (sp = (unsigned char *)CINTOK; *sp; sp++) /* valid in-token chars */
+ _itk[*sp] = YES;
+#define CBEGIN "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
+ for (sp = (unsigned char *)CBEGIN; *sp; sp++) /* token starting chars */
+ _btk[*sp] = YES;
+#define CNOTGD ",;"
+ for (sp = (unsigned char *)CNOTGD; *sp; sp++) /* invalid after-function chars */
+ _gd[*sp] = NO;
+}
+
+/*
+ * find_entries --
+ * this routine opens the specified file and calls the function
+ * which searches the file.
+ */
+void
+find_entries(file)
+ char *file;
+{
+ char *cp;
+
+ lineno = 0; /* should be 1 ?? KB */
+ if ((cp = strrchr(file, '.')) != NULL) {
+ if (cp[1] == 'l' && !cp[2]) {
+ int c;
+
+#ifdef GLOBAL
+ if (rflag)
+ fprintf(stderr, "-r option is ignored in lisp file (Warning only)\n");
+#endif
+ for (;;) {
+ if (GETC(==, EOF))
+ return;
+ if (!iswhite(c)) {
+ rewind(inf);
+ break;
+ }
+ }
+#define LISPCHR ";(["
+/* lisp */ if (strchr(LISPCHR, c)) {
+ l_entries();
+ return;
+ }
+/* lex */ else {
+ /*
+ * we search all 3 parts of a lex file
+ * for C references. This may be wrong.
+ */
+ toss_yysec();
+ (void)strcpy(lbuf, "%%$");
+ pfnote("yylex", lineno);
+ rewind(inf);
+ }
+ }
+/* yacc */ else if (cp[1] == 'y' && !cp[2]) {
+#ifdef YACC
+ /*
+ * we search all part of a yacc file for C references.
+ * but ignore yacc rule tags.
+ */
+ yaccfile = YES;
+ c_entries();
+ return;
+#endif
+ /*
+ * we search only the 3rd part of a yacc file
+ * for C references. This may be wrong.
+ */
+ toss_yysec();
+ (void)strcpy(lbuf, "%%$");
+ pfnote("yyparse", lineno);
+ y_entries();
+ }
+#ifdef GLOBAL
+/* assembler */ else if ((cp[1] == 's' || cp[1] == 'S') && !cp[2]) {
+ asm_entries();
+ return;
+ }
+#endif
+/* fortran */ else if ((cp[1] != 'c' && cp[1] != 'h') && !cp[2]) {
+#ifdef GLOBAL
+ if (rflag)
+ fprintf(stderr, "-r option is ignored in fortran file (Warning only)\n");
+#endif
+ if (PF_funcs())
+ return;
+ rewind(inf);
+ }
+ }
+#ifdef YACC
+ yaccfile = NO;
+#endif
+/* C */ c_entries();
+}
diff --git a/contrib/global/gctags/ctags.h b/contrib/global/gctags/ctags.h
new file mode 100644
index 000000000000..e843032e4239
--- /dev/null
+++ b/contrib/global/gctags/ctags.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ * @(#)ctags.h 8.3 (Berkeley) 4/2/94
+ */
+
+/* Definition for gctags */
+#define GLOBAL 1
+#define YACC 1
+
+#define bool char
+
+#define YES 1
+#define NO 0
+#define EOS '\0'
+
+#define ENDLINE 50 /* max length of pattern */
+#define MAXTOKEN 250 /* max size of single token */
+
+#ifndef LINE_MAX
+#define LINE_MAX 2048
+#endif
+
+#define SETLINE {++lineno;lineftell = ftell(inf);}
+#ifdef GLOBAL
+#define GETC(op,exp) ((((c = getc(inf)) == '\r') ? (c = getc(inf)) : c) op (int)exp)
+#else
+#define GETC(op,exp) ((c = getc(inf)) op (int)exp)
+#endif
+
+#define iswhite(arg) (_wht[(unsigned)arg]) /* T if char is white */
+#define begtoken(arg) (_btk[(unsigned)arg]) /* T if char can start token */
+#define intoken(arg) (_itk[(unsigned)arg]) /* T if char can be in token */
+#define endtoken(arg) (_etk[(unsigned)arg]) /* T if char ends tokens */
+#define isgood(arg) (_gd[(unsigned)arg]) /* T if char can be after ')' */
+
+typedef struct nd_st { /* sorting structure */
+ struct nd_st *left,
+ *right; /* left and right sons */
+ char *entry, /* function or type name */
+ *file, /* file name */
+ *pat; /* search pattern */
+ int lno; /* for -x option */
+ bool been_warned; /* set if noticed dup */
+} NODE;
+
+extern char *curfile; /* current input file name */
+extern NODE *head; /* head of the sorted binary tree */
+extern FILE *inf; /* ioptr for current input file */
+extern FILE *outf; /* ioptr for current output file */
+extern long lineftell; /* ftell after getc( inf ) == '\n' */
+extern int lineno; /* line number of current line */
+#ifdef GLOBAL
+extern int cflag; /* -c: compact index */
+extern int eflag; /* -e: '{' at 0 column force function end */
+extern int Dflag; /* -D: allow duplicate entrys */
+extern int rflag; /* -r: function reference */
+extern int sflag; /* -s: collect symbols */
+#endif
+extern int dflag; /* -d: non-macro defines */
+extern int tflag; /* -t: create tags for typedefs */
+extern int vflag; /* -v: vgrind style index output */
+extern int wflag; /* -w: suppress warnings */
+extern int xflag; /* -x: cxref style output */
+extern bool _wht[], _etk[], _itk[], _btk[], _gd[];
+extern char lbuf[LINE_MAX];
+extern char *lbp;
+extern char searchar; /* ex search character */
+extern char *progname; /* program name */
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+int cicmp __P((char *));
+void getline __P((void));
+void pfnote __P((char *, int));
+int skip_key __P((int));
+void put_entries __P((NODE *));
+void toss_yysec __P((void));
+void l_entries __P((void));
+void y_entries __P((void));
+int PF_funcs __P((void));
+void c_entries __P((void));
+void skip_comment __P((void));
+#ifdef GLOBAL
+void asm_entries __P((void));
+void compact_print __P((char *, int, char *));
+int portable_getc __P((FILE *));
+#endif
diff --git a/contrib/global/gctags/fortran.c b/contrib/global/gctags/fortran.c
new file mode 100644
index 000000000000..2a33aff1f2df
--- /dev/null
+++ b/contrib/global/gctags/fortran.c
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)fortran.c 8.3 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <ctype.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "ctags.h"
+
+static void takeprec __P((void));
+
+char *lbp; /* line buffer pointer */
+
+int
+PF_funcs()
+{
+ bool pfcnt; /* pascal/fortran functions found */
+ char *cp;
+ char tok[MAXTOKEN];
+
+ for (pfcnt = NO;;) {
+ lineftell = ftell(inf);
+ if (!fgets(lbuf, sizeof(lbuf), inf))
+ return (pfcnt);
+ ++lineno;
+ lbp = lbuf;
+ if (*lbp == '%') /* Ratfor escape to fortran */
+ ++lbp;
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ if (!*lbp)
+ continue;
+ switch (*lbp | ' ') { /* convert to lower-case */
+ case 'c':
+ if (cicmp("complex") || cicmp("character"))
+ takeprec();
+ break;
+ case 'd':
+ if (cicmp("double")) {
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ if (!*lbp)
+ continue;
+ if (cicmp("precision"))
+ break;
+ continue;
+ }
+ break;
+ case 'i':
+ if (cicmp("integer"))
+ takeprec();
+ break;
+ case 'l':
+ if (cicmp("logical"))
+ takeprec();
+ break;
+ case 'r':
+ if (cicmp("real"))
+ takeprec();
+ break;
+ }
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ if (!*lbp)
+ continue;
+ switch (*lbp | ' ') {
+ case 'f':
+ if (cicmp("function"))
+ break;
+ continue;
+ case 'p':
+ if (cicmp("program") || cicmp("procedure"))
+ break;
+ continue;
+ case 's':
+ if (cicmp("subroutine"))
+ break;
+ default:
+ continue;
+ }
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ if (!*lbp)
+ continue;
+ for (cp = lbp + 1; *cp && intoken(*cp); ++cp)
+ continue;
+ if (cp == lbp + 1)
+ continue;
+ *cp = EOS;
+ (void)strcpy(tok, lbp);
+ getline(); /* process line for ex(1) */
+ pfnote(tok, lineno);
+ pfcnt = YES;
+ }
+ /*NOTREACHED*/
+}
+
+/*
+ * cicmp --
+ * do case-independent strcmp
+ */
+int
+cicmp(cp)
+ char *cp;
+{
+ int len;
+ char *bp;
+
+ for (len = 0, bp = lbp; *cp && (*cp &~ ' ') == (*bp++ &~ ' ');
+ ++cp, ++len)
+ continue;
+ if (!*cp) {
+ lbp += len;
+ return (YES);
+ }
+ return (NO);
+}
+
+static void
+takeprec()
+{
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ if (*lbp == '*') {
+ for (++lbp; isspace(*lbp); ++lbp)
+ continue;
+ if (!isdigit(*lbp))
+ --lbp; /* force failure */
+ else
+ while (isdigit(*++lbp))
+ continue;
+ }
+}
diff --git a/contrib/global/gctags/gctags.1 b/contrib/global/gctags/gctags.1
index 31415c62536e..ed958751223a 100644
--- a/contrib/global/gctags/gctags.1
+++ b/contrib/global/gctags/gctags.1
@@ -1,5 +1,5 @@
-.\"
-.\" Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+.\" Copyright (c) 1987, 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -11,7 +11,8 @@
.\" 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 Shigio Yamaguchi.
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
@@ -28,67 +29,109 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
+.\" @(#)gctags.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd Aug 19, 1998
+.Dd April 21, 1997
.Dt GCTAGS 1
.Os BSD 4
.Sh NAME
.Nm gctags
-.Nd print cross reference list for gtags.
+.Nd create a tags file (special command for GLOBAL)
.Sh SYNOPSIS
.Nm gctags
-.Op Fl b
-.Op Fl e
-.Op Fl n
-.Op Fl r
-.Op Fl s
-.Op Fl w
-.Ar file ...
+.Op Fl BDFacderstuvwx
+.Op Fl f Ar tagsfile
+.Ar name ...
.Sh DESCRIPTION
.Nm Gctags
-print cross reference list for
-.Xr gtags 1
+makes a tags file for
+.Xr ex 1
from the specified C,
+Pascal, Fortran,
.Tn YACC ,
-.Tn JAVA ,
-and assembler source to standard output.
-Each line of output contains the object name, the line number which it appears,
-the file in which it is defined, and a line image separated by
+lex, lisp and assembler sources.
+A tags file gives the locations of specified objects in a group of files.
+Each line of the tags file contains the object name, the file in which it
+is defined, and a search pattern for the object definition, separated by
white-space.
-It's same with the output of
-.Xr ctags 1
-with -x option.
-.Pp
+Using the
+.Ar tags
+file,
+.Xr ex 1
+can quickly locate these object definitions.
Depending upon the options provided to
.Nm gctags ,
-objects will consist of function definitions, function references and other
-symbols.
-This command is the default parser of GLOBAL source code tag system.
+objects will consist of subroutines, typedefs, defines, structs,
+enums and unions.
.Bl -tag -width Ds
-.It Fl b
-force level 1 block to begin when reach a '{' at the first column. (C only)
+.It Fl B
+use backward searching patterns
+.Pq Li ?...? .
+.It Fl D
+allow duplicate object names.
+.It Fl F
+use forward searching patterns
+.Pq Li /.../
+(the default).
+.It Fl a
+append to
+.Ar tags
+file.
+.It Fl c
+print with compact format. It is valid only with -x option.
+.It Fl d
+create tags for
+.Li #defines
+that don't take arguments;
+.Li #defines
+that take arguments are tagged automatically.
.It Fl e
-force level 1 block to end when reach a '}' at the first column. (C only)
-.It Fl n
-suppress output of tags. It is useful to use with
-.Fl w
-option.
+force a function to end when reach a '}' at the first column. (C source only)
+.It Fl f
+place the tag descriptions in a file called
+.Ar tagsfile .
+The default behaviour is to place them in a file called
+.Ar tags .
.It Fl r
locate function references instead of function definitions. GTAGS file is
-needed at the current directory. (C and Java source only)
-By default, locate function definitions.
+needed at the current directory. (C source only)
.It Fl s
-collect symbols other than functions. By default, locate function definitions.
+collect symbols except for functions.
+.It Fl t
+create tags for typedefs, structs, unions, and enums.
+.It Fl u
+update the specified files in the
+.Ar tags
+file, that is, all
+references to them are deleted, and the new values are appended to the
+file. (Beware: this option is implemented in a way which is rather
+slow; it is usually faster to simply rebuild the
+.Ar tags
+file.)
+.It Fl v
+An index of the form expected by
+.Xr vgrind 1
+is produced on the standard output. This listing
+contains the object name, file name, and page number (assuming 64
+line pages). Since the output will be sorted into lexicographic order,
+it may be desired to run the output through
+.Xr sort 1 .
+Sample use:
+.Bd -literal -offset indent
+gctags \-v files \&| sort \-f > index
+vgrind \-x index
+.Ed
.It Fl w
-print warning message.
+suppress warning diagnostics.
+.It Fl x
+.Nm gctags
+produces a list of object
+names, the line number and file name on which each is defined, as well
+as the text of that line and prints this on the standard output. This
+is a simple index which can be printed out as an off-line readable
+function index.
.El
.Pp
-The
-.Fl r
-and
-.Fl s
-options override each other; the last one specified determines the method used.
-.Pp
Files whose names end in
.Nm \&.c
or
@@ -101,19 +144,47 @@ are assumed to be
.Tn YACC
source files.
Files whose names end in
-.Nm \&.java
-are assumed to be Java source files.
+.Nm \&.l
+are assumed to be lisp files if their
+first non-blank character is `;', `(', or `[',
+otherwise, they are
+treated as lex files.
Files whose names end in
.Nm \&.s
or
.Nm \&.S
are assumed to be Assembler
-source files. Other files are searched for C style definitions.
+source files. Other files are first examined to see if they
+contain any Pascal or Fortran routine definitions, and, if not, are
+searched for C style definitions.
.Pp
-Yacc files each have a special tag.
+The tag
+.Li main
+is treated specially in C programs. The tag formed
+is created by prepending
+.Ar M
+to the name of the file, with the
+trailing
+.Nm \&.c
+and any leading pathname components removed. This
+makes use of
+.Nm gctags
+practical in directories with more than one
+program.
+.Pp
+Yacc and lex files each have a special tag.
.Ar Yyparse
is the start
-of the second section of the yacc file.
+of the second section of the yacc file, and
+.Ar yylex
+is the start of
+the second section of the lex file.
+.Sh FILES
+.Bl -tag -width tags -compact
+.It Pa tags
+default output tags file
+.It Pa GTAGS
+tags file for GLOBAL
.El
.Sh DIAGNOSTICS
.Nm Gctags
@@ -128,15 +199,42 @@ Duplicate objects are not considered errors.
.Xr vi 1 .
.Sh BUGS
.Pp
+Recognition of
+.Nm functions ,
+.Nm subroutines
+and
+.Nm procedures
+for
+.Tn FORTRAN
+and Pascal is done is a very simpleminded way. No attempt
+is made to deal with block structure; if you have two Pascal procedures
+in different blocks with the same name you lose.
+.Nm Gctags
+doesn't
+understand about Pascal types.
+.Pp
+The method of deciding whether to look for C, Pascal or
+.Tn FORTRAN
+functions is a hack.
+.Pp
.Nm Gctags
relies on the input being well formed, and any syntactical
-errors will completely confuse it.
+errors will completely confuse it. It also finds some legal syntax
+confusing; for example, since it doesn't understand
+.Li #ifdef Ns 's
+(incidentally, that's a feature, not a bug), any code with unbalanced
+braces inside
+.Li #ifdef Ns 's
+will cause it to become somewhat disoriented.
+In a similar fashion, multiple line changes within a definition will
+cause it to enter the last line of the object, rather than the first, as
+the searching pattern. The last line of multiple line
+.Li typedef Ns 's
+will similarly be noted.
.Pp
-Assembler support is far from complete. It extracts only ENTRY()
+Assembler support is far from completeness. It extracts only ENTRY()
and ALTENTRY() from source file. Probably valid only for FreeBSD and Linux
kernel source.
-.Sh AUTHORS
-Shigio Yamaguchi (shigio@wafu.netgate.net)
.Sh HISTORY
The
.Nm
diff --git a/contrib/global/gctags/gctags.c b/contrib/global/gctags/gctags.c
deleted file mode 100644
index fad225065bad..000000000000
--- a/contrib/global/gctags/gctags.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * gctags.c 13-Sep-98
- */
-
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "global.h"
-#include "gctags.h"
-
-int bflag; /* -b: force level 1 block start */
-int dflag; /* -d: debug */
-int eflag; /* -e: force level 1 block end */
-int nflag; /* -n: doen't print tag */
-int rflag; /* -r: function reference */
-int sflag; /* -s: collect symbols */
-int wflag; /* -w: warning message */
-int yaccfile; /* yacc file */
-
-const char *progname = "gctags"; /* program name */
-char *notfunction;
-
-int main __P((int, char **));
-static void usage __P((void));
-
-struct words *words;
-static int tablesize;
-
-int
-main(argc, argv)
- int argc;
- char **argv;
-{
- char *p;
-
- while (--argc > 0 && (++argv)[0][0] == '-') {
- for (p = argv[0] + 1; *p; p++) {
- switch(*p) {
- case 'b':
- bflag++;
- break;
- case 'd':
- dflag++;
- break;
- case 'e':
- eflag++;
- break;
- case 'n':
- nflag++;
- break;
- case 'r':
- rflag++;
- sflag = 0;
- break;
- case 's':
- sflag++;
- rflag = 0;
- break;
- case 'w':
- wflag++;
- break;
- default:
- usage();
- }
- }
- }
- if (argc < 1)
- usage();
- if (getenv("GTAGSWARNING"))
- wflag++;
- if (test("r", NOTFUNCTION)) {
- FILE *ip;
- STRBUF *sb = stropen();
- int i;
-
- if ((ip = fopen(NOTFUNCTION, "r")) == 0)
- die1("'%s' cannot read.", NOTFUNCTION);
- for (tablesize = 0; (p = mgets(ip, NULL, 0)) != NULL; tablesize++)
- strnputs(sb, p, strlen(p) + 1);
- fclose(ip);
- if ((words = malloc(sizeof(struct words) * tablesize)) == NULL)
- die("short of memory.");
- p = strvalue(sb);
- for (i = 0; i < tablesize; i++) {
- words[i].name = p;
- p += strlen(p) + 1;
- }
- qsort(words, tablesize, sizeof(struct words), cmp);
- /* don't call strclose(sb); */
- }
- for (; argc > 0; argv++, argc--) {
- if (!opentoken(argv[0]))
- die1("'%s' cannot open.", argv[0]);
- if (locatestring(argv[0], ".y", MATCH_AT_LAST))
- C(1);
- else if (locatestring(argv[0], ".s", MATCH_AT_LAST) ||
- locatestring(argv[0], ".S", MATCH_AT_LAST))
- assembler();
- else if (locatestring(argv[0], ".java", MATCH_AT_LAST))
- java();
- else
- C(0);
- closetoken();
- }
- exit(0);
-}
-
-static void
-usage()
-{
- (void)fprintf(stderr, "usage: gctags [-benrsw] file ...\n");
- exit(1);
-}
-
-int
-cmp(s1, s2)
- const void *s1, *s2;
-{
- return strcmp(((struct words *)s1)->name, ((struct words *)s2)->name);
-}
-
-int
-isnotfunction(name)
- char *name;
-{
- struct words tmp;
- struct words *result;
-
- if (words == NULL)
- return 0;
- tmp.name = name;
- result = (struct words *)bsearch(&tmp, words, tablesize, sizeof(struct words), cmp);
- return (result != NULL) ? 1 : 0;
-}
-
-#ifdef DEBUG
-void
-dbg_print(level, s)
- int level;
- const char *s;
-{
- if (!dflag)
- return;
- fprintf(stderr, "[%04d]", lineno);
- for (; level > 0; level--)
- fprintf(stderr, " ");
- fprintf(stderr, "%s\n", s);
-}
-#endif
diff --git a/contrib/global/gctags/gctags.h b/contrib/global/gctags/gctags.h
deleted file mode 100644
index e27e32d684fe..000000000000
--- a/contrib/global/gctags/gctags.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * gctags.h 17-Oct-98
- */
-#include <sys/param.h>
-#include "token.h"
-/*
- * target type.
- */
-#define DEF 1
-#define REF 2
-#define SYM 3
-
-#define NOTFUNCTION ".notfunction"
-
-extern int bflag;
-extern int dflag;
-extern int eflag;
-extern int nflag;
-extern int rflag;
-extern int sflag;
-extern int wflag;
-extern int yaccfile;
-
-struct words {
- const char *name;
- int val;
-};
-
-#define PUT(tag, lno, line) { \
- DBG_PRINT(level, line); \
- if (!nflag) { \
- if (strlen(tag) >= 16 && lno >= 1000) \
- printf("%-16s %4d %-16s %s\n", \
- tag, lno, curfile, line); \
- else \
- printf("%-16s%4d %-16s %s\n", \
- tag, lno, curfile, line); \
- } \
-}
-
-#define IS_RESERVED(a) ((a) > 255)
-
-#ifndef __P
-#ifdef __STDC__
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-#ifdef DEBUG
-void dbg_print __P((int, const char *));
-#define DBG_PRINT(level, a) dbg_print(level, a)
-#else
-#define DBG_PRINT(level, a)
-#endif
-
-int isnotfunction __P((char *));
-int cmp __P((const void *, const void *));
-void C __P((int));
-void assembler __P((void));
-void java __P((void));
diff --git a/contrib/global/gctags/java.c b/contrib/global/gctags/java.c
deleted file mode 100644
index cb49f862d27e..000000000000
--- a/contrib/global/gctags/java.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * java.c 2-Sep-98
- */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "gctags.h"
-#include "defined.h"
-#include "die.h"
-#include "java.h"
-#include "token.h"
-
-static int reserved __P((char *));
-
-/*
- * java: read java file and pickup tag entries.
- */
-void
-java()
-{
- int c;
- int level; /* brace level */
- int target;
- int startclass, startthrows, startequal;
- char classname[MAXTOKEN];
- char completename[MAXCOMPLETENAME];
- int classlevel;
- struct {
- char *classname;
- char *terminate;
- int level;
- } stack[MAXCLASSSTACK];
- const char *interested = "{}=;";
-
- stack[0].terminate = completename;
- stack[0].level = 0;
- level = classlevel = 0;
- target = (sflag) ? SYM : ((rflag) ? REF : DEF);
- startclass = startthrows = startequal = 0;
-
- while ((c = nexttoken(interested, reserved)) != EOF) {
- switch (c) {
- case SYMBOL: /* symbol */
- for (; c == SYMBOL && peekc(1) == '.'; c = nexttoken(interested, reserved)) {
- if (target == SYM)
- PUT(token, lineno, sp);
- }
- if (c != SYMBOL)
- break;
- if (startclass || startthrows) {
- if (target == REF && defined(token))
- PUT(token, lineno, sp);
- } else if (peekc(0) == '('/* ) */) {
- if (target == DEF && level == stack[classlevel].level && !startequal)
- /* ignore constructor */
- if (strcmp(stack[classlevel].classname, token))
- PUT(token, lineno, sp);
- if (target == REF && (level > stack[classlevel].level || startequal) && defined(token))
- PUT(token, lineno, sp);
- } else {
- if (target == SYM)
- PUT(token, lineno, sp);
- }
- break;
- case '{': /* } */
- DBG_PRINT(level, "{"); /* } */
-
- ++level;
- if (startclass) {
- char *p = stack[classlevel].terminate;
- char *q = classname;
-
- if (++classlevel >= MAXCLASSSTACK)
- die1("class stack over flow.[%s]", curfile);
- if (classlevel > 1)
- *p++ = '.';
- stack[classlevel].classname = p;
- while (*q)
- *p++ = *q++;
- stack[classlevel].terminate = p;
- stack[classlevel].level = level;
- *p++ = 0;
- }
- startclass = startthrows = 0;
- break;
- /* { */
- case '}':
- if (--level < 0) {
- if (wflag)
- fprintf(stderr, "Warning: missing left '{' (at %d).\n", lineno); /* } */
- level = 0;
- }
- if (level < stack[classlevel].level)
- *(stack[--classlevel].terminate) = 0;
- /* { */
- DBG_PRINT(level, "}");
- break;
- case '=':
- startequal = 1;
- break;
- case ';':
- startclass = startthrows = startequal = 0;
- break;
- case J_CLASS:
- case J_INTERFACE:
- if ((c = nexttoken(interested, reserved)) == SYMBOL) {
- strcpy(classname, token);
- startclass = 1;
- if (target == DEF)
- PUT(token, lineno, sp);
- }
- break;
- case J_NEW:
- case J_INSTANCEOF:
- while ((c = nexttoken(interested, reserved)) == SYMBOL && peekc(1) == '.')
- if (target == SYM)
- PUT(token, lineno, sp);
- if (c == SYMBOL)
- if (target == REF && defined(token))
- PUT(token, lineno, sp);
- break;
- case J_THROWS:
- startthrows = 1;
- break;
- case J_BOOLEAN:
- case J_BYTE:
- case J_CHAR:
- case J_DOUBLE:
- case J_FLOAT:
- case J_INT:
- case J_LONG:
- case J_SHORT:
- case J_VOID:
- if (peekc(1) == '.' && (c = nexttoken(interested, reserved)) != J_CLASS)
- pushbacktoken();
- break;
- default:
- }
- }
-}
- /* sorted by alphabet */
-static struct words words[] = {
- {"abstract", J_ABSTRACT},
- {"boolean", J_BOOLEAN},
- {"break", J_BREAK},
- {"byte", J_BYTE},
- {"case", J_CASE},
- {"catch", J_CATCH},
- {"char", J_CHAR},
- {"class", J_CLASS},
- {"const", J_CONST},
- {"continue", J_CONTINUE},
- {"default", J_DEFAULT},
- {"do", J_DO},
- {"double", J_DOUBLE},
- {"else", J_ELSE},
- {"extends", J_EXTENDS},
- {"false", J_FALSE},
- {"final", J_FINAL},
- {"finally", J_FINALLY},
- {"float", J_FLOAT},
- {"for", J_FOR},
- {"goto", J_GOTO},
- {"if", J_IF},
- {"implements", J_IMPLEMENTS},
- {"import", J_IMPORT},
- {"instanceof", J_INSTANCEOF},
- {"int", J_INT},
- {"interface", J_INTERFACE},
- {"long", J_LONG},
- {"native", J_NATIVE},
- {"new", J_NEW},
- {"null", J_NULL},
- {"package", J_PACKAGE},
- {"private", J_PRIVATE},
- {"protected", J_PROTECTED},
- {"public", J_PUBLIC},
- {"return", J_RETURN},
- {"short", J_SHORT},
- {"static", J_STATIC},
- {"strictfp", J_STRICTFP},
- {"super", J_SUPER},
- {"switch", J_SWITCH},
- {"synchronized",J_SYNCHRONIZED},
- {"this", J_THIS},
- {"throw", J_THROW},
- {"throws", J_THROWS},
- {"union", J_UNION},
- {"transient", J_TRANSIENT},
- {"true", J_TRUE},
- {"try", J_TRY},
- {"void", J_VOID},
- {"volatile", J_VOLATILE},
- {"while", J_WHILE},
- {"widefp", J_WIDEFP},
-};
-
-static int
-reserved(word)
- char *word;
-{
- struct words tmp;
- struct words *result;
-
- tmp.name = word;
- result = (struct words *)bsearch(&tmp, words, sizeof(words)/sizeof(struct words), sizeof(struct words), cmp);
- return (result != NULL) ? result->val : SYMBOL;
-}
diff --git a/contrib/global/gctags/java.h b/contrib/global/gctags/java.h
deleted file mode 100644
index 5c0da71812cb..000000000000
--- a/contrib/global/gctags/java.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * java.h 20-Aug-98
- */
-/*
- * java's reserved words.
- */
-#define J_ABSTRACT 1001
-#define J_BOOLEAN 1002
-#define J_BREAK 1003
-#define J_BYTE 1004
-#define J_CASE 1005
-#define J_CATCH 1006
-#define J_CHAR 1007
-#define J_CLASS 1008
-#define J_CONST 1009
-#define J_CONTINUE 1010
-#define J_DEFAULT 1011
-#define J_DO 1012
-#define J_DOUBLE 1013
-#define J_ELSE 1014
-#define J_EXTENDS 1015
-#define J_FALSE 1016
-#define J_FINAL 1017
-#define J_FINALLY 1018
-#define J_FLOAT 1019
-#define J_FOR 1020
-#define J_GOTO 1021
-#define J_IF 1022
-#define J_IMPLEMENTS 1023
-#define J_IMPORT 1024
-#define J_INSTANCEOF 1025
-#define J_INT 1026
-#define J_INTERFACE 1027
-#define J_LONG 1028
-#define J_NATIVE 1029
-#define J_NEW 1030
-#define J_NULL 1031
-#define J_PACKAGE 1032
-#define J_PRIVATE 1033
-#define J_PROTECTED 1034
-#define J_PUBLIC 1035
-#define J_RETURN 1036
-#define J_SHORT 1037
-#define J_STATIC 1038
-#define J_SUPER 1039
-#define J_SWITCH 1040
-#define J_SYNCHRONIZED 1041
-#define J_THIS 1042
-#define J_THROW 1043
-#define J_THROWS 1044
-#define J_UNION 1045
-#define J_TRANSIENT 1046
-#define J_TRUE 1047
-#define J_TRY 1048
-#define J_VOID 1049
-#define J_VOLATILE 1050
-#define J_WHILE 1051
-#define J_STRICTFP 1052
-#define J_WIDEFP 1053
-
-#define MAXCOMPLETENAME 1024 /* max size of complete name of class */
-#define MAXCLASSSTACK 10 /* max size of class stack */
diff --git a/contrib/global/gctags/lisp.c b/contrib/global/gctags/lisp.c
new file mode 100644
index 000000000000..ebf51841eb3b
--- /dev/null
+++ b/contrib/global/gctags/lisp.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <ctype.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "ctags.h"
+
+/*
+ * lisp tag functions
+ * just look for (def or (DEF
+ */
+void
+l_entries()
+{
+ int special;
+ char *cp;
+ char savedc;
+ char tok[MAXTOKEN];
+
+ for (;;) {
+ lineftell = ftell(inf);
+ if (!fgets(lbuf, sizeof(lbuf), inf))
+ return;
+ ++lineno;
+ lbp = lbuf;
+ if (!cicmp("(def"))
+ continue;
+ special = NO;
+ switch(*lbp | ' ') {
+ case 'm':
+ if (cicmp("method"))
+ special = YES;
+ break;
+ case 'w':
+ if (cicmp("wrapper") || cicmp("whopper"))
+ special = YES;
+ }
+ for (; !isspace(*lbp); ++lbp)
+ continue;
+ for (; isspace(*lbp); ++lbp)
+ continue;
+ for (cp = lbp; *cp && *cp != '\n'; ++cp)
+ continue;
+ *cp = EOS;
+ if (special) {
+ if (!(cp = strchr(lbp, ')')))
+ continue;
+ for (; cp >= lbp && *cp != ':'; --cp)
+ continue;
+ if (cp < lbp)
+ continue;
+ lbp = cp;
+ for (; *cp && *cp != ')' && *cp != ' '; ++cp)
+ continue;
+ }
+ else
+ for (cp = lbp + 1;
+ *cp && *cp != '(' && *cp != ' '; ++cp)
+ continue;
+ savedc = *cp;
+ *cp = EOS;
+ (void)strcpy(tok, lbp);
+ *cp = savedc;
+ getline();
+ pfnote(tok, lineno);
+ }
+ /*NOTREACHED*/
+}
diff --git a/contrib/global/gctags/print.c b/contrib/global/gctags/print.c
new file mode 100644
index 000000000000..ff81a9b33cc1
--- /dev/null
+++ b/contrib/global/gctags/print.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "die.h"
+#include "ctags.h"
+
+/*
+ * getline --
+ * get the line the token of interest occurred on,
+ * prepare it for printing.
+ */
+void
+getline()
+{
+ long saveftell;
+ int c;
+ int cnt;
+ char *cp;
+
+ saveftell = ftell(inf);
+ (void)fseek(inf, lineftell, SEEK_SET);
+ if (xflag)
+ for (cp = lbuf; GETC(!=, EOF) && c != '\n'; *cp++ = c)
+ continue;
+ /*
+ * do all processing here, so we don't step through the
+ * line more than once; means you don't call this routine
+ * unless you're sure you've got a keeper.
+ */
+ else for (cnt = 0, cp = lbuf; GETC(!=, EOF) && cnt < ENDLINE; ++cnt) {
+ if (c == '\\') { /* backslashes */
+ if (cnt > ENDLINE - 2)
+ break;
+ *cp++ = '\\'; *cp++ = '\\';
+ ++cnt;
+ }
+ else if (c == (int)searchar) { /* search character */
+ if (cnt > ENDLINE - 2)
+ break;
+ *cp++ = '\\'; *cp++ = c;
+ ++cnt;
+ }
+ else if (c == '\n') { /* end of keep */
+ *cp++ = '$'; /* can find whole line */
+ break;
+ }
+ else
+ *cp++ = c;
+ }
+ *cp = EOS;
+ (void)fseek(inf, saveftell, SEEK_SET);
+}
+#ifdef GLOBAL
+void
+compact_print(entry, lno, file)
+char *entry;
+int lno;
+char *file;
+{
+ static int first = 1;
+ static char p_entry[128];
+ static char p_file[1024];
+ static int p_lno;
+ static char *buf;
+ static int bufsize = 512;
+ static char *p;
+
+ if (first) {
+ if (!(buf = (char *)malloc(bufsize)))
+ die("short of memory.");
+ buf[0] = 0;
+ p = buf;
+ first = 0;
+ }
+ if (strcmp(p_entry, entry) || strcmp(p_file, file)) {
+ if (buf[0])
+ printf("%s\n", buf);
+ if (!entry[0]) /* flush */
+ return;
+ strcpy(p_entry, entry);
+ strcpy(p_file, file);
+ p_lno = lno;
+ buf[0] = 0;
+ sprintf(buf, "%s %s %d", entry, file, lno);
+ p = buf;
+ p += strlen(p);
+ } else {
+ if (p_lno > lno)
+ die("impossible!");
+ if (p_lno < lno) {
+ if (buf + bufsize < p + 10) {
+ int offset = p - buf;
+ bufsize *= 2;
+ if (!(buf = (char *)realloc(buf, bufsize)))
+ die("short of memory.");
+ p = buf + offset;
+ }
+ sprintf(p, ",%d", lno);
+ p += strlen(p);
+ p_lno = lno;
+ }
+ }
+}
+#endif
+/*
+ * put_entries --
+ * write out the tags
+ */
+void
+put_entries(node)
+ NODE *node;
+{
+
+ if (node->left)
+ put_entries(node->left);
+ if (vflag)
+ printf("%s %s %d\n",
+ node->entry, node->file, (node->lno + 63) / 64);
+#ifdef GLOBAL
+ else if (xflag && cflag)
+ compact_print(node->entry, node->lno, node->file);
+#endif
+ else if (xflag)
+#ifdef GLOBAL
+ /* separate 'entry' and 'lno' */
+ if (strlen(node->entry) >= 16 && node->lno >= 1000)
+ printf("%-16s %4d %-16s %s\n",
+ node->entry, node->lno, node->file, node->pat);
+ else /* for compatibility */
+#endif
+ printf("%-16s%4d %-16s %s\n",
+ node->entry, node->lno, node->file, node->pat);
+ else
+ fprintf(outf, "%s\t%s\t%c^%s%c\n",
+ node->entry, node->file, searchar, node->pat, searchar);
+ if (node->right)
+ put_entries(node->right);
+}
diff --git a/contrib/global/gctags/tree.c b/contrib/global/gctags/tree.c
new file mode 100644
index 000000000000..94362cd7a75e
--- /dev/null
+++ b/contrib/global/gctags/tree.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)tree.c 8.3 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "die.h"
+#include "ctags.h"
+
+static void add_node __P((NODE *, NODE *));
+static void free_tree __P((NODE *));
+
+/*
+ * pfnote --
+ * enter a new node in the tree
+ */
+void
+pfnote(name, ln)
+ char *name;
+ int ln;
+{
+ NODE *np;
+ char *fp;
+ char nbuf[MAXTOKEN];
+
+ /*NOSTRICT*/
+ if (!(np = (NODE *)malloc(sizeof(NODE)))) {
+ fprintf(stderr, "too many entries to sort\n");
+ put_entries(head);
+ free_tree(head);
+ /*NOSTRICT*/
+ if (!(head = np = (NODE *)malloc(sizeof(NODE))))
+ die("out of space");
+ }
+ if (!xflag && !strcmp(name, "main")) {
+ if (!(fp = strrchr(curfile, '/')))
+ fp = curfile;
+ else
+ ++fp;
+ (void)sprintf(nbuf, "M%s", fp);
+ fp = strrchr(nbuf, '.');
+ if (fp && !fp[2])
+ *fp = EOS;
+ name = nbuf;
+ }
+ if (!(np->entry = strdup(name)))
+ die("out of space");
+ np->file = curfile;
+ np->lno = ln;
+ np->left = np->right = 0;
+ if (!(np->pat = strdup(lbuf)))
+ die("out of space");
+ if (!head)
+ head = np;
+ else
+ add_node(np, head);
+}
+
+static void
+add_node(node, cur_node)
+ NODE *node,
+ *cur_node;
+{
+ int dif;
+
+ dif = strcmp(node->entry, cur_node->entry);
+#ifdef GLOBAL
+ if (!Dflag && !dif) /* -D option allows duplicate entries. */
+#else
+ if (!dif)
+#endif
+ {
+ if (node->file == cur_node->file) {
+ if (!wflag)
+ fprintf(stderr, "Duplicate entry in file %s, line %d: %s\nSecond entry ignored\n", node->file, lineno, node->entry);
+ return;
+ }
+ if (!cur_node->been_warned)
+ if (!wflag)
+ fprintf(stderr, "Duplicate entry in files %s and %s: %s (Warning only)\n", node->file, cur_node->file, node->entry);
+ cur_node->been_warned = YES;
+ }
+ else if (dif < 0)
+ if (cur_node->left)
+ add_node(node, cur_node->left);
+ else
+ cur_node->left = node;
+ else if (cur_node->right)
+ add_node(node, cur_node->right);
+ else
+ cur_node->right = node;
+}
+
+static void
+free_tree(node)
+ NODE *node;
+{
+ while (node) {
+ if (node->right)
+ free_tree(node->right);
+ free(node);
+ node = node->left;
+ }
+}
diff --git a/contrib/global/gctags/yacc.c b/contrib/global/gctags/yacc.c
new file mode 100644
index 000000000000..9dcdd5afc24a
--- /dev/null
+++ b/contrib/global/gctags/yacc.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <ctype.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "ctags.h"
+
+/*
+ * y_entries:
+ * find the yacc tags and put them in.
+ */
+void
+y_entries()
+{
+ int c;
+ char *sp;
+ bool in_rule;
+ char tok[MAXTOKEN];
+
+ in_rule = NO;
+
+ while (GETC(!=, EOF))
+ switch (c) {
+ case '\n':
+ SETLINE;
+ /* FALLTHROUGH */
+ case ' ':
+ case '\f':
+ case '\r':
+ case '\t':
+ break;
+ case '{':
+ if (skip_key('}'))
+ in_rule = NO;
+ break;
+ case '\'':
+ case '"':
+ if (skip_key(c))
+ in_rule = NO;
+ break;
+ case '%':
+ if (GETC(==, '%'))
+ return;
+ (void)ungetc(c, inf);
+ break;
+ case '/':
+ if (GETC(==, '*'))
+ skip_comment();
+ else
+ (void)ungetc(c, inf);
+ break;
+ case '|':
+ case ';':
+ in_rule = NO;
+ break;
+ default:
+ if (in_rule || (!isalpha(c) && c != '.' && c != '_'))
+ break;
+ sp = tok;
+ *sp++ = c;
+ while (GETC(!=, EOF) && (intoken(c) || c == '.'))
+ *sp++ = c;
+ *sp = EOS;
+ getline(); /* may change before ':' */
+ while (iswhite(c)) {
+ if (c == '\n')
+ SETLINE;
+ if (GETC(==, EOF))
+ return;
+ }
+ if (c == ':') {
+ pfnote(tok, lineno);
+ in_rule = YES;
+ }
+ else
+ (void)ungetc(c, inf);
+ }
+}
+
+/*
+ * toss_yysec --
+ * throw away lines up to the next "\n%%\n"
+ */
+void
+toss_yysec()
+{
+ int c; /* read character */
+ int state;
+
+ /*
+ * state == 0 : waiting
+ * state == 1 : received a newline
+ * state == 2 : received first %
+ * state == 3 : recieved second %
+ */
+ lineftell = ftell(inf);
+ for (state = 0; GETC(!=, EOF);)
+ switch (c) {
+ case '\n':
+ ++lineno;
+ lineftell = ftell(inf);
+ if (state == 3) /* done! */
+ return;
+ state = 1; /* start over */
+ break;
+ case '%':
+ if (state) /* if 1 or 2 */
+ ++state; /* goto 3 */
+ break;
+ default:
+ state = 0; /* reset */
+ break;
+ }
+}
diff --git a/contrib/global/global.conf b/contrib/global/global.conf
deleted file mode 100644
index e00cf0eac07d..000000000000
--- a/contrib/global/global.conf
+++ /dev/null
@@ -1,157 +0,0 @@
-#
-# Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Shigio Yamaguchi.
-# 4. Neither the name of the author nor the names of any co-contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# 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.
-#
-# Configuration file for GLOBAL source code tag system.
-#
-# Copy this file as /etc/global.conf or $HOME/.globalrc and GLOBAL system
-# use it.
-#
-# 'default' is default target.
-# You can specify target with GTAGSLABEL environment variable.
-#
-# include:
-# It's similar to 'tc=' in termcap but can be used anytime and anywhere.
-# 8 level nested usage is allowed.
-#
-default:\
- :include=gctags:include=htags:
-#---------------------------------------------------------------------
-#
-# Configuration for gtags(1)
-#
-# format:
-# Select 'standard' or 'compact'. By default, it assumes 'standard'.
-# suffixes:
-# Suffixes of target source file. By default, 'c,h,y,s,S,java'.
-# skip:
-# Skip files among the target files. If the name ends with '/',
-# gtags skips all files under the directory.
-# By default, 'y.tab.c,y.tab.h,SCCS/,RCS/,CVS/'.
-# extractmethod:
-# Please see source code of gtags(1).
-# GTAGS:
-# Tag command for definitions. Non of default value.
-# GRTAGS:
-# Tag command for references. Non of default value.
-# GSYMS:
-# Tag command for other symbols. Non of default value.
-#
-# Htags(1) needs both of GTAGS and GRTAGS. Global(1)'s -s option needs GSYMS.
-#
-#---------------------------------------------------------------------
-common:\
- :skip=y.tab.c,y.tab.h,SCCS/,RCS/,CVS/:\
- :format=standard:
-#
-# [gctags]
-#
-# This command is distributed as part of GLOBAL.
-#
-gctags|tag command for GLOBAL:\
- :include=common:\
- :suffixes=c,h,y,s,S,java:\
- :GTAGS=gctags %s:\
- :GRTAGS=gctags -r %s:\
- :GSYMS=gctags -s %s:
-#
-# [Emacs's ctags]
-#
-# This ctags is distributed as a part of Emacs editor.
-#
-# supported suffixes by etags.
-#
-# lisp: l,el,lsp,lisp,cl,clisp
-# scheme: sm,scm,scheme,t,sch,ss,SM,SCM
-# assembler: s,a,sa,asm,src,def,ins,inc
-# C++: C,H,cpp,cxx,hxx,cc
-# C*: cs,hs
-# c,yacc: c,h,y
-# pl,p,pas: pascal
-# fortran: f,for
-#
-# [Installation]
-# % cd <emacs source directory>/lib-src
-# % make ctags
-# # cp ctags /usr/local/bin/ctags-emacs
-#
-ctags-emacs|ctags based on etags|GNU Emacs ctags:\
- :include=common:\
- :suffixes=el,s,a,sa,asm,C,H,cpp,cxx,hxx,cc,c,h,y:\
- :skip=ispell.el,canna.el,gnusutil.el:\
- :extractmethod:\
- :GTAGS=/usr/local/bin/ctags-emacs -x -d -T -w %s:
-#
-# [Exuberant Ctags]
-#
-# This ctags is distributed as a part of Vim editor.
-#
-# [Installation]
-# % cd <Vim source directory>/src/ctags
-# % make
-# # cp ctags /usr/local/bin/ctags-exuberant
-#
-ctags-exuberant|Exuberant Ctags|ctags by Darren Hiebert:\
- :include=common:\
- :suffixes=s,a,sa,asm,C,H,cpp,cxx,hxx,cc,c,h,y:\
- :extractmethod:\
- :GTAGS=/usr/local/bin/ctags-exuberant -x %s | perl -ne '($name, $type, $no, $path, $line) = split(/[ \t]+/, $_, 5); printf(STDOUT "%-16s %4d %-16s %s", $name, $no, $path, $line);':
-#---------------------------------------------------------------------
-#
-# Configuration for htags(1)
-# Let's paint hypertext with your favorite colors!
-#
-# bgcolor,text,link,vlink,alink:
-# attribute of <BODY>. (default is not set)
-# title_begin,title_end:
-# title tag
-# comment_begin,comment_end:
-# comment tag. (/* ... */, // ...)
-# sharp_begin,sharp_end:
-# macro tag. (#include, #define, ...)
-# brace_begin,brace_end:
-# brace tag. ('{', '}')
-# reserved_begin,reserved_end:
-# reserved word tag. (while, if, char, ...)
-# ncol:
-# columns of line number. (default = 4)
-# tabs:
-# tab stop. (default = 8)
-# gzipped_suffix:
-# suffix of compressed html file.
-#
-#---------------------------------------------------------------------
-htags:\
- :bgcolor=silver:text=black:link=blue:vlink=red:alink=cyan:\
- :title_begin=<FONT COLOR=#cc0000>:title_end=</FONT>:\
- :comment_begin=<I><FONT COLOR=green>:comment_end=</FONT></I>:\
- :sharp_begin=<FONT COLOR=darkred>:sharp_end=</FONT>:\
- :brace_begin=<FONT COLOR=blue>:brace_end=</FONT>:\
- :reserved_begin=<B>:reserved_end=</B>:\
- :ncol#4:tabs#8:gzipped_suffix=ghtml:
diff --git a/contrib/global/global/Makefile b/contrib/global/global/Makefile
index 376b20000110..ef7a1763eb56 100644
--- a/contrib/global/global/Makefile
+++ b/contrib/global/global/Makefile
@@ -1,3 +1,6 @@
PROG= global
+CFLAGS+=-I${.CURDIR}/../lib
+LDADD= $(LIBUTIL)
+DPADD= $(LIBUTIL)
.include <bsd.prog.mk>
diff --git a/contrib/global/global/global.1 b/contrib/global/global/global.1
index 1ec56abf8f40..3df007ef5ed9 100644
--- a/contrib/global/global/global.1
+++ b/contrib/global/global/global.1
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+.\" Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd Dec 8, 1998
+.Dd Nov 26, 1997
.Dt GLOBAL 1
.Os BSD 4
.Sh NAME
@@ -36,29 +36,26 @@
.Nd print the locations of specified object.
.Sh SYNOPSIS
.Nm global
-.Op Fl alnrtvx
+.Op Fl alrvx
.Ar pattern
.Nm global -c
.Op Ar prefix
.Nm global
-.Fl f[anrtx]
-.Ar files
+.Fl f[arx]
+.Ar file
.Nm global
-.Fl g[alntvx]
+.Fl g[alvx]
.Ar pattern
.Nm global
.Fl i[v]
.Nm global
.Fl p
.Nm global
-.Fl P[alnt]
-.Op Ar pattern
-.Nm global
-.Fl s[alntvx]
+.Fl s[alvx]
.Ar pattern
.Sh DESCRIPTION
.Nm Global
-find the locations of specified object in C, Yacc and Java source files.
+find the locations of specified object in C and Yacc source files.
.Nm Global
can treat a source tree, that is, a directory that has subdirectories and
source files.
@@ -74,53 +71,38 @@ at the root directory of the source tree to make tag files.
Then you can execute
.Nm
at anywhere in the source tree.
-.Sh COMMANDS
-The following commands are available:
+.Pp
+The following options are available:
.Bl -tag -width Ds
.It Ar pattern
-print object which match to the
-.Ar pattern .
-It can include POSIX 1003.2 regular expression.
+object pattern. It can include POSIX 1003.2 regular expression.
+.It Fl a
+print absolute path name. By default, print relative path name.
.It Fl c Op Ar prefix
print candidate function names which start with specified
.Ar prefix .
If
.Ar prefix
is not specified, print all function names.
-.It Fl f Ar files
+.It Fl f Ar file
print all function definitions in the
-.Ar files .
+.Ar file .
This option implies -x option.
-.It Fl g Ar pattern
-print all lines which match to the
-.Ar pattern .
-It is similar to grep(1).
+.It Fl g
+print all lines which match to the pattern.
.It Fl i
-locate tag files and reconstruct them incrementally.
+reconstruct tags files incrementally.
+.It Fl l
+print objects which exist under the current directory.
+.It Fl r
+print the locations of function references. By default, print function
+definitions.
.It Fl p
print the location of GTAGS.
-.It Fl P Op Ar pattern
-print the path which match to the
-.Ar pattern .
-If no pattern specified, print all.
-.It Fl s Ar pattern
+.It Fl s
print the locations of specified symbol other than function names.
You need GSYMS tags file. See
.Xr gtags 1 .
-.Sh OPTIONS
-The following options are available:
-.Bl -tag -width Ds
-.It Fl a
-print absolute path name. By default, print relative path name.
-.It Fl l
-print just objects which exist under the current directory.
-.It Fl n
-suppress sort filter and path conversion filter.
-.It Fl r
-print the locations of object references. By default, print object
-definitions.
-.It Fl t
-print with standard ctags format.
.It Fl x
In addition to the default output, produce the line number and
the line contents.
@@ -132,8 +114,6 @@ tags file for function definitions.
tags file for function references.
.It Pa GSYMS
tags file for symbols other then functions.
-.It Pa GPATH
-path index. This is used for incremental updating and compact format.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of global.
diff --git a/contrib/global/global/global.c b/contrib/global/global/global.c
index a8dbb172a174..4a92fa4d5dfc 100644
--- a/contrib/global/global/global.c
+++ b/contrib/global/global/global.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,11 +28,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * global.c 8-Dec-98
+ * global.c 7-Nov-97
*
*/
-#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -44,87 +43,64 @@
#include "global.h"
-const char *progname = "global"; /* command name */
+char *progname = "global"; /* command name */
static void usage __P((void));
-static void setcom __P((int));
-int main __P((int, char **));
-void makefilter __P((char *));
-FILE *openfilter __P((void));
-void closefilter __P((FILE *));
-void completelist __P((char *, char *, char *));
-void relative_filter __P((STRBUF *, char *, char *));
+void main __P((int, char **));
+char *outfilter __P((void));
+void completelist __P((char *, char *));
+void relative_filter __P((char *, char *, char *));
void grep __P((char *));
-void pathlist __P((char *, char *));
-void parsefile __P((int, char **, char *, char *, char *, int));
-void printtag __P((FILE *, char *));
-int notnamechar __P((char *));
+int printtag __P((FILE *, char *, char *, int));
+int regexp __P((char *));
int search __P((char *, char *, char *, char *, int));
+char *extractpath __P((char *));
int includepath __P((char *, char *));
-char sortfilter[MAXFILLEN+1]; /* sort filter */
-char pathfilter[MAXFILLEN+1]; /* path convert filter */
+char sortfilter[MAXCOMLINE+1]; /* sort filter */
+char pathfilter[MAXCOMLINE+1]; /* path convert filter */
+char local[MAXPATHLEN+1]; /* local prefix */
char *localprefix; /* local prefix */
int aflag; /* [option] */
int cflag; /* command */
int fflag; /* command */
+int lflag; /* [option] */
int gflag; /* command */
int iflag; /* command */
-int lflag; /* [option] */
-int nflag; /* [option] */
int pflag; /* command */
-int Pflag; /* command */
int rflag; /* [option] */
int sflag; /* command */
-int tflag; /* [option] */
int vflag; /* [option] */
int xflag; /* [option] */
-int pfilter; /* undocumented command */
static void
usage()
{
- fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
- "global [-alnrtvx] pattern",
+ fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
+ "global [-alrvx] pattern",
"global -c [prefix]",
- "global -f[alnrtx] files",
- "global -g[alntvx] pattern",
+ "global -f[arx] file",
+ "global -g[alvx] pattern",
"global -i[v]",
- "global -p[v]",
- "global -P[alnt] [pattern]",
- "global -s[alntvx] pattern");
+ "global -p",
+ "global -s[alvx] pattern");
exit(1);
}
-static int command;
-static void
-setcom(c)
-int c;
-{
- if (command == 0)
- command = c;
- else
- usage();
-}
-int
+void
main(argc, argv)
int argc;
char *argv[];
{
- char *av;
+ char *p, *av;
int count;
int db;
char cwd[MAXPATHLEN+1]; /* current directory */
char root[MAXPATHLEN+1]; /* root of source tree */
char dbpath[MAXPATHLEN+1]; /* dbpath directory */
+ char comline[MAXCOMLINE+1];
while (--argc > 0 && (++argv)[0][0] == '-') {
- char *p;
-
- if (!strcmp(argv[0], "--filter")) {
- pfilter++;
- continue;
- }
for (p = argv[0] + 1; *p; p++) {
switch (*p) {
case 'a':
@@ -132,44 +108,27 @@ char *argv[];
break;
case 'c':
cflag++;
- setcom(*p);
break;
case 'f':
fflag++;
- xflag++;
- setcom(*p);
break;
case 'l':
lflag++;
break;
- case 'n':
- nflag++;
- break;
case 'g':
gflag++;
- setcom(*p);
break;
case 'i':
iflag++;
- setcom(*p);
break;
case 'p':
pflag++;
- setcom(*p);
- break;
- case 'P':
- Pflag++;
- setcom(*p);
break;
case 'r':
rflag++;
break;
case 's':
sflag++;
- setcom(*p);
- break;
- case 't':
- tflag++;
break;
case 'v':
vflag++;
@@ -182,32 +141,44 @@ char *argv[];
}
}
}
- av = (argc > 0) ? *argv : NULL;
+ av = (argc > 0) ? *argv : (char *)0;
/*
- * only -c, -i, -P and -p allows no argment.
+ * usage check.
*/
- if (!av && !pfilter) {
- switch (command) {
- case 'c':
- case 'i':
- case 'p':
- case 'P':
- break;
- default:
+ {
+ int commands, options;
+
+ commands = cflag + fflag + gflag + iflag + pflag + sflag;
+ options = aflag + lflag + rflag + xflag;
+ /*
+ * only -c, -i and -p allows no argment.
+ */
+ if (!av && !cflag && !iflag && !pflag)
+ usage();
+ /*
+ * command cannot be duplicated.
+ */
+ if (commands > 1)
+ usage();
+ /*
+ * -c and -i command allows only -v option.
+ */
+ if (cflag + iflag && options)
+ usage();
+ /*
+ * -r is not valid for -g, -i and -s.
+ */
+ if (rflag && (gflag + iflag + sflag))
usage();
- }
}
/*
- * invalid options are just ignored.
- */
- /*
* remove leading blanks.
*/
if (av && !gflag)
for (; *av == ' ' || *av == '\t'; av++)
;
- if (cflag && av && notnamechar(av))
- die("only name char is allowed with -c option.");
+ if (cflag && av && regexp(av))
+ die("regular expression not allowed with -c option.");
/*
* get path of following directories.
* o current directory
@@ -216,12 +187,6 @@ char *argv[];
*
* if GTAGS not found, getdbpath doesn't return.
*/
- if (pflag && vflag) {
- char *gtagsdbpath = getenv("GTAGSDBPATH");
- char *gtagsroot = getenv("GTAGSROOT");
- if (gtagsdbpath && !gtagsroot)
- fprintf(stdout, "warning: GTAGSDBPATH is ignored becase GTAGSROOT is not set.\n");
- }
getdbpath(cwd, root, dbpath);
if (pflag) {
@@ -232,18 +197,11 @@ char *argv[];
* incremental update of tag files.
*/
if (iflag) {
- STRBUF *sb = stropen();
-
if (chdir(root) < 0)
die1("cannot change directory to '%s'.", root);
- strputs(sb, "gtags -i");
- if (vflag)
- strputc(sb, 'v');
- strputc(sb, ' ');
- strputs(sb, dbpath);
- if (system(strvalue(sb)))
+ sprintf(comline, "gtags -i%s %s", (vflag) ? "v" : "", dbpath);
+ if (system(comline))
exit(1);
- strclose(sb);
exit(0);
}
@@ -251,62 +209,39 @@ char *argv[];
* complete function name
*/
if (cflag) {
- completelist(dbpath, root, av);
+ completelist(dbpath, av);
exit(0);
}
/*
* make sort filter.
*/
if (sflag && xflag)
- strcpy(sortfilter, "");
- else if (tflag) /* ctags format */
- strcpy(sortfilter, "sort +0 -1 +1 -2 +2n -3");
+ *sortfilter = 0;
else if (fflag)
- strcpy(sortfilter, "sort +2 -3 +1n -2");
+ sprintf(sortfilter, "sort +1n -2");
else if (xflag) /* print details */
- strcpy(sortfilter, "sort +0 -1 +2 -3 +1n -2");
+ sprintf(sortfilter, "sort +0 -1 +2 -3 +1n -2");
else /* print just file name */
- strcpy(sortfilter, "sort | uniq");
+ sprintf(sortfilter, "sort | uniq");
/*
* make path filter.
*/
if (aflag) /* absolute path name */
sprintf(pathfilter, "sed -e 's!\\.!%s!'", root);
- else { /* relative path name */
- STRBUF *sb = stropen();
-
- relative_filter(sb, root, cwd);
- strcpy(pathfilter, strvalue(sb));
- strclose(sb);
- }
+ else /* relative path name */
+ relative_filter(root, cwd, pathfilter);
/*
* make local prefix.
*/
if (lflag) {
- char *p = cwd + strlen(root);
- STRBUF *sb = stropen();
/*
* getdbpath() assure follows.
* cwd != "/" and cwd includes root.
*/
- strputc(sb, '.');
- if (*p)
- strputs(sb, p);
- strputc(sb, '/');
- localprefix = strdup(strvalue(sb));
- if (!localprefix)
- die("short of memory.");
- strclose(sb);
- }
- /*
- * print filter.
- */
- if (pfilter) {
- char filter[MAXFILLEN+1];
-
- makefilter(filter);
- fprintf(stdout, "%s\n", filter);
- exit(0);
+ strcpy(local, cwd);
+ strcat(local, "/");
+ localprefix = local + strlen(root) - 1;
+ *localprefix = '.';
}
/*
* grep the pattern in a source tree.
@@ -319,19 +254,41 @@ char *argv[];
grep(av);
exit(0);
}
- /*
- * locate the path including the pattern in a source tree.
- */
- if (Pflag) {
- pathlist(dbpath, av);
- exit(0);
- }
db = (rflag) ? GRTAGS : ((sflag) ? GSYMS : GTAGS);
/*
* print function definitions.
*/
if (fflag) {
- parsefile(argc, argv, cwd, root, dbpath, db);
+ struct stat sb;
+ char pathbuf[MAXPATHLEN+1], *path;
+ char *p;
+ FILE *op;
+ DBIO *dbio;
+
+ /* av !~ /\.[chysS]$/) */
+ p = av + strlen(av) - 1; /* last character */
+ if (stat(av, &sb) || !S_ISREG(sb.st_mode))
+ die1("file '%s' not found.", av);
+ if (*(p - 1) != '.' || !locatestring("chysS", p, 0))
+ die("accept only file name end with '.c .h .y .s .S'.");
+ /*
+ * convert path into relative from root directory of source tree.
+ */
+ path = realpath(av, pathbuf);
+ if (*path != '/')
+ die("realpath(3) is not compatible with BSD version.");
+ if (strncmp(path, root, strlen(root)))
+ die1("file '%s' is out of source tree.", path);
+ path += strlen(root) - 1;
+ *path = '.';
+ if (!(op = popen(outfilter(), "w")))
+ die("cannot open output pipe.");
+ dbio = gtagsopen(dbpath, db, 0);
+ for (p = db_first(dbio, NULL, DBIO_SKIPMETA); p; p = db_next(dbio))
+ if (includepath(p, path))
+ fprintf(op, "%s\n", p);
+ db_close(dbio);
+ pclose(op);
exit(0);
}
/*
@@ -341,30 +298,28 @@ char *argv[];
/*
* search in library path.
*/
- if (count == 0 && !rflag && !sflag && !notnamechar(av) && getenv("GTAGSLIBPATH")) {
- char buf[MAXENVLEN+1];
+ if (count == 0 && !rflag && !sflag && !regexp(av) && getenv("GTAGSLIBPATH")) {
+ char envbuf[MAXENVLEN+1];
char libdbpath[MAXPATHLEN+1];
char *p, *lib;
- strcpy(buf, getenv("GTAGSLIBPATH"));
- p = buf;
+ strcpy(envbuf, getenv("GTAGSLIBPATH"));
+ p = envbuf;
while (p) {
lib = p;
- if ((p = locatestring(p, ":", MATCH_FIRST)) != NULL)
+ if ((p = locatestring(p, ":", 0)) != NULL)
*p++ = 0;
+ if (!strncmp(lib, cwd, strlen(cwd)) || !strncmp(cwd, lib, strlen(lib)))
+ continue;
if (!gtagsexist(lib, libdbpath))
continue;
if (!strcmp(dbpath, libdbpath))
continue;
if (aflag) /* absolute path name */
sprintf(pathfilter, "sed -e 's!\\.!%s!'", lib);
- else {
- STRBUF *sb = stropen();
- relative_filter(sb, lib, cwd);
- strcpy(pathfilter, strvalue(sb));
- strclose(sb);
- }
- count = search(av, cwd, lib, libdbpath, db);
+ else
+ relative_filter(lib, cwd, pathfilter);
+ count = search(av, cwd, lib, libdbpath, GTAGS);
if (count > 0) {
strcpy(dbpath, libdbpath);
break;
@@ -385,91 +340,58 @@ char *argv[];
exit(0);
}
/*
- * makefilter: make filter string.
- *
- * io) filter buffer
- */
-void
-makefilter(filter)
-char *filter;
-{
- if (nflag)
- filter[0] = 0;
- else if (sortfilter[0] == 0 && pathfilter[0] == 0)
- filter[0] = 0;
- else if (sortfilter[0] && pathfilter[0])
- sprintf(filter, "%s | %s", sortfilter, pathfilter);
- else if (sortfilter[0])
- strcpy(filter, sortfilter);
- else
- strcpy(filter, pathfilter);
-}
-/*
- * openfilter: open output filter.
+ * outfilter: return output filter.
*
* gi) pathfilter
* gi) sortfilter
* r) output filter
*/
-FILE *
-openfilter(void)
+char *
+outfilter(void)
{
- FILE *op;
- char filter[MAXFILLEN+1];
+ static char filter[MAXCOMLINE+1];
- makefilter(filter);
- if (filter[0] == 0)
- op = stdout;
+ /*
+ * make output filter
+ */
+ if (*sortfilter)
+ sprintf(filter, "%s | %s", sortfilter, pathfilter);
else
- op = popen(filter, "w");
- return op;
-}
-void
-closefilter(op)
-FILE *op;
-{
- if (op != stdout)
- pclose(op);
+ strcpy(filter, pathfilter);
+ return filter;
}
/*
* completelist: print complete list of function
*
* i) dbpath dbpath directory
- * i) root root directory
* i) prefix prefix of primary key
*/
void
-completelist(dbpath, root, prefix)
+completelist(dbpath, prefix)
char *dbpath;
-char *root;
char *prefix;
{
char *p;
- int flags = GTOP_KEY;
- GTOP *gtop;
+ DBIO *dbio;
- if (prefix && *prefix == 0) /* In the case global -c '' */
- prefix = NULL;
- if (prefix)
- flags |= GTOP_PREFIX;
- gtop = gtagsopen(dbpath, root, GTAGS, GTAGS_READ, 0);
- for (p = gtagsfirst(gtop, prefix, flags); p; p = gtagsnext(gtop))
+ dbio = gtagsopen(dbpath, GTAGS, 0);
+ for (p = db_first(dbio, prefix, DBIO_KEY|DBIO_PREFIX|DBIO_SKIPMETA); p; p = db_next(dbio))
(void)fprintf(stdout, "%s\n", p);
- gtagsclose(gtop);
+ db_close(dbio);
}
/*
* relative_filter: make relative path filter
*
- * i) sb string buffer
* i) root the root directory of source tree
- * i) cwd current directory
- * r) relative path filter
+ * i) argcwd current directory
+ * o) bp result
+ * relative path filter
*/
void
-relative_filter(sb, root, cwd)
-STRBUF *sb;
+relative_filter(root, cwd, bp)
char *root;
char *cwd;
+char *bp;
{
char *p, *c, *branch;
@@ -482,36 +404,38 @@ char *cwd;
branch = c;
if (*p == 0 && (*c == 0 || *c == '/'))
branch = c;
+ if (*c == 0 && *p)
+ die("illegal root.");
/*
* forward to root.
*/
- strputs(sb, "sed -e 's!\\./!");
+ strcpy(bp, "sed -e 's!\\./!");
for (c = branch; *c; c++)
if (*c == '/')
- strputs(sb, "../");
+ strcat(bp, "../");
p = root + (branch - cwd);
/*
* backward to leaf.
*/
if (*p) {
p++;
- strputs(sb, p);
- strputc(sb, '/');
+ strcat(bp, p);
+ strcat(bp, "/");
}
- strputs(sb, "!'");
+ strcat(bp, "!'");
/*
* remove redundancy.
*/
if (*branch) {
char unit[256];
+ bp += strlen(bp);
p = unit;
for (c = branch + 1; ; c++) {
if (*c == 0 || *c == '/') {
*p = 0;
- strputs(sb, " -e 's!\\.\\./");
- strputs(sb, unit);
- strputs(sb, "/!!'");
+ sprintf(bp, " -e 's!\\.\\./%s/!!'", unit);
+ bp += strlen(bp);
if (*c == 0)
break;
p = unit;
@@ -524,66 +448,107 @@ char *cwd;
* printtag: print a tag's line
*
* i) op output stream
+ * i) root root of source tree
* i) bp tag's line
+ * i) compact 0: standard format, 1: compact format
+ * r) output line count
*/
-void
-printtag(op, bp)
+int
+printtag(op, root, bp, compact)
FILE *op;
+char *root;
char *bp;
+int compact;
{
- if (tflag) {
- char buf[MAXBUFLEN+1];
- char lno[20], *l = lno;
+ int count = 0;
+ char *tag, *file, *lno;
+ int opened = 0;
+ char path[MAXPATHLEN+1];
+ char *buffer;
+ int line = 0, tagline = 0;
+ FILE *ip;
+
+ if (!xflag) {
+ fprintf(op, "%s\n", extractpath(bp));
+ return 1;
+ }
+ if (compact) { /* compact format */
char *p = bp;
- char *q = buf;
- while (*p && !isspace(*p))
- *q++ = *p++;
- *q++ = '\t';
- for (; *p && isspace(*p); p++)
+ tag = p; /* tag = $1 */
+ for (; !isspace(*p) ; p++)
;
- while (*p && isdigit(*p))
- *l++ = *p++;
- *l = 0;
- for (; *p && isspace(*p); p++)
+ *p++ = 0;
+ for (; isspace(*p) ; p++)
;
- while (*p && !isspace(*p))
- *q++ = *p++;
- *q++ = '\t';
- l = lno;
- while (*l)
- *q++ = *l++;
- *q = 0;
- fprintf(op, "%s\n", buf);
- } else if (!xflag) {
- char *p = locatestring(bp, "./", MATCH_FIRST);
-
- if (p == NULL)
- die("illegal tag format (path not found).");
- while (*p && *p != ' ' && *p != '\t')
- (void)putc(*p++, op);
- (void)putc('\n', op);
- } else
+ file = p; /* file = $2 */
+ for (; !isspace(*p) ; p++)
+ ;
+ *p++ = 0;
+ for (; isspace(*p) ; p++)
+ ;
+ lno = p; /* lno = $3 */
+ sprintf(path, "%s/%s", root, file + 2);
+ if ((ip = fopen(path, "r")) != NULL) {
+ opened = 1;
+ buffer = mgets(ip, 0, NULL);
+ line = 1;
+ } else {
+ buffer = "";
+ }
+ while (*lno) {
+ /* get line number */
+ for (tagline = 0; *lno >= '0' && *lno <= '9'; lno++)
+ tagline = tagline * 10 + *lno - '0';
+ if (*lno == ',')
+ lno++;
+ if (opened) {
+ while (line < tagline) {
+ if (!(buffer = mgets(ip, 0, NULL)))
+ die1("unexpected end of file. '%s'", path);
+ line++;
+ }
+ }
+ if (strlen(tag) >= 16 && tagline >= 1000)
+ fprintf(op, "%-16s %4d %-16s %s\n",
+ tag, tagline, file, buffer);
+ else
+ fprintf(op, "%-16s%4d %-16s %s\n",
+ tag, tagline, file, buffer);
+ count++;
+ }
+ if (opened)
+ fclose(ip);
+ } else { /* standard format */
+ /*
+ * separater in key part must be ' ' to avoid sort(1)'s bug.
+ */
detab(op, bp);
+ count++;
+ }
+ return count;
}
/*
- * notnamechar: test whether or not no name char included.
+ * regexp: test whether regular expression included.
*
* i) s string
* r) 0: not included, 1: included
+ *
+ * This function cannot be used for generic purpose.
+ * Any character except '[a-zA-Z_0-9]' is assumed RE char..
*/
int
-notnamechar(s)
+regexp(s)
char *s;
{
int c;
- while ((c = *s++) != '\0')
+ while ((c = *s++) != NULL)
if ( (c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
- (c == '-') || (c == '_'))
+ (c == '_') )
;
else
return 1;
@@ -601,46 +566,42 @@ char *pattern;
FILE *op, *fp;
char *path;
char edit[IDENTLEN+1];
- char *buffer;
+ char *buffer, *p, *e;
int linenum, count, editlen;
regex_t preg;
/*
* convert spaces into %FF format.
*/
- {
- char *p, *e = edit;
- for (p = pattern; *p; p++) {
- if (*p == '%' || *p == ' ' || *p == '\t') {
- sprintf(e, "%%%02x", *p);
- e += 3;
- } else
- *e++ = *p;
- }
- *e = 0;
+ e = edit;
+ for (p = pattern; *p; p++) {
+ if (*p == '%' || *p == ' ' || *p == '\t') {
+ sprintf(e, "%%%02x", *p);
+ e += 3;
+ } else
+ *e++ = *p;
}
+ *e = 0;
editlen = strlen(edit);
if (regcomp(&preg, pattern, REG_EXTENDED) != 0)
die("illegal regular expression.");
- if (!(op = openfilter()))
- die("cannot open output filter.");
+ if (!(op = popen(outfilter(), "w")))
+ die("cannot open output pipe.");
count = 0;
for (findopen(); (path = findread(NULL)) != NULL; ) {
if (!(fp = fopen(path, "r")))
die1("cannot open file '%s'.", path);
linenum = 0;
- while ((buffer = mgets(fp, NULL, 0)) != NULL) {
+ while ((buffer = mgets(fp, 0, NULL)) != NULL) {
linenum++;
if (regexec(&preg, buffer, 0, 0, 0) == 0) {
count++;
- if (tflag)
- fprintf(op, "%s\t%s\t%d\n",
- edit, path, linenum);
- else if (!xflag) {
+ if (xflag == 0) {
fprintf(op, "%s\n", path);
break;
- } else if (editlen >= 16 && linenum >= 1000)
+ }
+ if (editlen >= 16 && linenum >= 1000)
fprintf(op, "%-16s %4d %-16s %s\n",
edit, linenum, path, buffer);
else
@@ -651,7 +612,7 @@ char *pattern;
fclose(fp);
}
findclose();
- closefilter(op);
+ pclose(op);
if (vflag) {
if (count == 0)
fprintf(stderr, "object not found.\n");
@@ -661,132 +622,7 @@ char *pattern;
fprintf(stderr, "%d objects located.\n", count);
}
}
-/*
- * pathlist: print candidate path list.
- *
- * i) dbpath
- */
-void
-pathlist(dbpath, av)
-char *dbpath;
-char *av;
-{
- FILE *op;
- const char *tag = av;
- char key[10], *path;
- regex_t preg;
- int i, lim;
- if (av) {
- if (regcomp(&preg, av, REG_EXTENDED) != 0)
- die("illegal regular expression.");
- } else
- tag = "file";
- if (!(op = openfilter()))
- die("cannot open output filter.");
- if (pathopen(dbpath, 0) < 0)
- die("GPATH not found.");
- lim = nextkey();
- for (i = 0; i < lim; i++) {
- sprintf(key, "%d", i);
- if ((path = pathget(key)) == NULL)
- continue;
- if (lflag && !locatestring(path, localprefix, MATCH_AT_FIRST))
- continue;
- if (av && regexec(&preg, path + 2, 0, 0, 0) != 0)
- continue;
- if (tflag)
- fprintf(op, "%s\t%s\t1\n", tag, path);
- else
- fprintf(op, "%s\n", path);
- }
- pathclose();
- closefilter(op);
-}
-/*
- * parsefile: parse file to pick up tags.
- *
- * i) db
- * i) dbpath
- * i) root
- * i) cwd
- * i) argc
- * i) argv
- */
-void
-parsefile(argc, argv, cwd, root, dbpath, db)
-int argc;
-char **argv;
-char *cwd;
-char *root;
-char *dbpath;
-int db;
-{
- char buf[MAXPATHLEN+1], *path;
- char *p;
- FILE *ip, *op;
- char *parser, *av;
- STRBUF *sb = stropen();
- STRBUF *com = stropen();
-
- /*
- * get parser.
- */
- if (!getconfs(dbname(db), sb))
- die1("cannot get parser for %s.", dbname(db));
- parser = strvalue(sb);
-
- if (!(op = openfilter()))
- die("cannot open output filter.");
- if (pathopen(dbpath, 0) < 0)
- die("GPATH not found.");
- for (; argc > 0; argv++, argc--) {
- av = argv[0];
-
- if (test("d", av)) {
- fprintf(stderr, "'%s' is a directory.\n", av);
- continue;
- }
- if (!test("f", NULL)) {
- fprintf(stderr, "'%s' not found.\n", av);
- continue;
- }
- /*
- * convert path into relative from root directory of source tree.
- */
- path = realpath(av, buf);
- if (*path != '/')
- die("realpath(3) is not compatible with BSD version.");
- if (strncmp(path, root, strlen(root))) {
- fprintf(stderr, "'%s' is out of source tree.\n", path);
- continue;
- }
- path += strlen(root) - 1;
- *path = '.';
- if (!pathget(path)) {
- fprintf(stderr, "'%s' not found in GPATH.\n", path);
- continue;
- }
- if (chdir(root) < 0)
- die1("cannot move to '%s' directory.", root);
- /*
- * make command line.
- */
- strstart(com);
- makecommand(parser, path, com);
- if (!(ip = popen(strvalue(com), "r")))
- die1("cannot execute '%s'.", strvalue(com));
- while ((p = mgets(ip, NULL, 0)) != NULL)
- printtag(op, p);
- pclose(ip);
- if (chdir(cwd) < 0)
- die1("cannot move to '%s' directory.", cwd);
- }
- pathclose();
- closefilter(op);
- strclose(com);
- strclose(sb);
-}
/*
* search: search specified function
*
@@ -808,79 +644,87 @@ int db;
char *p;
int count = 0;
FILE *op;
- GTOP *gtop;
+ DBIO *dbio;
+ int compact;
regex_t preg;
/*
* open tag file.
+ * currently only GSYMS is compact format.
*/
- gtop = gtagsopen(dbpath, root, db, GTAGS_READ, 0);
- if (!(op = openfilter()))
- die("cannot open output filter.");
+ dbio = gtagsopen(dbpath, db, 0);
+ compact = (db == GSYMS) ? 1 : 0;
+ if (!(op = popen(outfilter(), "w")))
+ die1("filter '%s' failed.", outfilter());
/*
* regular expression.
*/
- if (!strcmp(pattern, ".*")) {
- for (p = gtagsfirst(gtop, NULL, 0); p; p = gtagsnext(gtop)) {
- if (lflag) {
- char *q;
- /* locate start point of a path */
- q = locatestring(p, "./", MATCH_FIRST);
- if (!locatestring(q, localprefix, MATCH_AT_FIRST))
- continue;
- }
- printtag(op, p);
- count++;
- }
+ if (regexp(pattern) && regcomp(&preg, pattern, REG_EXTENDED) == 0) {
+ char prefix_buf[IDENTLEN+1];
+ char *prefix = (char *)0;
- } else if (notnamechar(pattern) && regcomp(&preg, pattern, REG_EXTENDED) == 0) {
if (*pattern == '^' && *(p = pattern + 1) && (isalpha(*p) || *p == '_')) {
- char buf[IDENTLEN+1];
- char *prefix = buf;
-
+ prefix = prefix_buf;
*prefix++ = *p++;
while (*p && (isalpha(*p) || isdigit(*p) || *p == '_'))
*prefix++ = *p++;
*prefix = 0;
- prefix = buf;
- p = gtagsfirst(gtop, prefix, GTOP_PREFIX);
+ prefix = prefix_buf;
+ p = db_first(dbio, prefix, DBIO_SKIPMETA|DBIO_PREFIX);
} else {
- p = gtagsfirst(gtop, NULL, 0);
+ p = db_first(dbio, NULL, DBIO_SKIPMETA);
}
- for (; p; p = gtagsnext(gtop)) {
- /*
- * search $1 of tag line (not key)
- */
- if (regexec(&preg, strmake(gtop->dbop->lastdat, " \t"), 0, 0, 0) != 0)
+ for (; p; p = db_next(dbio)) {
+ if (*p == ' ')
continue;
- if (lflag) {
- char *q;
- /* locate start point of a path */
- q = locatestring(p, "./", MATCH_FIRST);
- if (!locatestring(q, localprefix, MATCH_AT_FIRST))
- continue;
- }
- printtag(op, p);
- count++;
+ if (regexec(&preg, dbio->lastkey, 0, 0, 0) == 0)
+ count += printtag(op, root, p, compact);
}
} else {
- for (p = gtagsfirst(gtop, pattern, 0); p; p = gtagsnext(gtop)) {
+ for (p = db_first(dbio, pattern, 0); p; p = db_next(dbio)) {
if (lflag) {
char *q;
/* locate start point of a path */
- q = locatestring(p, "./", MATCH_FIRST);
- if (!locatestring(q, localprefix, MATCH_AT_FIRST))
+ q = locatestring(p, "./", 0);
+ if (!locatestring(q, localprefix, 1))
continue;
}
- printtag(op, p);
- count++;
+ count += printtag(op, root, p, compact);
}
}
- closefilter(op);
- gtagsclose(gtop);
+ pclose(op);
+ db_close(dbio);
return count;
}
/*
+ * extractpath: extract path string of a tag line
+ *
+ * i) line tag line
+ * r) path
+ *
+ * standard format: main 12 ./xxx/xxx/xxx.c main(argc, argv) {
+ * compact format: main ./xxx/xxx/xxx.c 12,15,55,101
+ */
+char *
+extractpath(line)
+char *line;
+{
+ static char buf[MAXPATHLEN+1];
+ char *p, *b;
+ int c;
+
+ if (!(p = locatestring(line, "./", 0)))
+ die("illegal tag format (path not found).");
+ b = buf;
+ while ((c = *b++ = *p++) != NULL) {
+ if (c == ' ' || c == '\t') {
+ *(b - 1) = 0;
+ break;
+ }
+ }
+ return buf;
+}
+/*
* includepath: check if the path included in tag line or not.
*
* i) line tag line
@@ -895,7 +739,7 @@ char *path;
char *p;
int length;
- if (!(p = locatestring(line, "./", MATCH_FIRST)))
+ if (!(p = locatestring(line, "./", 0)))
die("illegal tag format (path not found).");
length = strlen(path);
if (strncmp(p, path, length))
diff --git a/contrib/global/gozilla/Imakefile b/contrib/global/gozilla/Imakefile
index 035c5443cbde..5bcbc01e03cc 100644
--- a/contrib/global/gozilla/Imakefile
+++ b/contrib/global/gozilla/Imakefile
@@ -2,23 +2,11 @@ XCOMM
XCOMM Imakefile for gozilla
XCOMM
- INC = ../lib
-LOCAL_LIBRARIES = XawClientLibs
- DEPLIBS = XawClientDepLibs
- DEFINES = -DSTANDALONE -DGLOBAL -I$(INC)
+LOCAL_LIBRARIES = XawClientLibs -L../lib -lutil
+ DEPLIBS = XawClientDepLibs ../lib/libutil.a
+ DEFINES = -DSTANDALONE -DGLOBAL -I../lib
- SRCS = gozilla.c remote.c test.c getdbpath.c strbuf.c conf.c \
- mgets.c locatestring.c makepath.c strmake.c
- OBJS = gozilla.o remote.o test.o getdbpath.o strbuf.o conf.o \
- mgets.o locatestring.o makepath.o strmake.o
-
-LinkSourceFile(test.c,$(INC))
-LinkSourceFile(getdbpath.c,$(INC))
-LinkSourceFile(strbuf.c,$(INC))
-LinkSourceFile(conf.c,$(INC))
-LinkSourceFile(mgets.c,$(INC))
-LinkSourceFile(locatestring.c,$(INC))
-LinkSourceFile(makepath.c,$(INC))
-LinkSourceFile(strmake.c,$(INC))
+ SRCS = gozilla.c remote.c
+ OBJS = gozilla.o remote.o
ComplexProgramTarget(gozilla)
diff --git a/contrib/global/gozilla/gozilla.c b/contrib/global/gozilla/gozilla.c
index 32d4730d21d8..fd43bbf6150d 100644
--- a/contrib/global/gozilla/gozilla.c
+++ b/contrib/global/gozilla/gozilla.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,20 +28,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * gozilla.c 17-Jul-98
+ * gozilla.c 27-Oct-97
*
*/
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include "global.h"
-const char *progname = "gozilla"; /* command name */
+char *progname = "gozilla"; /* command name */
static void usage __P((void));
-
-int main __P((int, char **));
-int issource __P((char *));
+void main __P((int, char **));
int sendcommand __P((char *));
int bflag;
@@ -57,17 +54,17 @@ usage()
exit(1);
}
-int
+void
main(argc, argv)
int argc;
char *argv[];
{
char c, *p, *q;
- char *browser = NULL;
- char *command = NULL;
- char *arg = NULL;
+ char *browser = (char *)0;
+ char *command = (char *)0;
+ char *arg = (char *)0;
char URL[MAXPATHLEN+1];
- char com[MAXFILLEN+1];
+ char com[MAXCOMLINE+1];
int linenumber = 0;
int status;
@@ -104,19 +101,16 @@ char *argv[];
}
if (argc == 0)
usage();
- if (locatestring(argv[0], "http:", MATCH_AT_FIRST) ||
- locatestring(argv[0], "ftp:", MATCH_AT_FIRST) ||
- locatestring(argv[0], "news:", MATCH_AT_FIRST) ||
- locatestring(argv[0], "mail:", MATCH_AT_FIRST) ||
- locatestring(argv[0], "file:", MATCH_AT_FIRST))
+ if (locatestring(argv[0], "http:", 1) || locatestring(argv[0], "file:", 1))
strcpy(URL, argv[0]);
else {
char *abspath;
- char buf[MAXPATHLEN+1];
+ char pathbuf[MAXPATHLEN+1];
+ char htmlpath[MAXPATHLEN+1];
- if (!test("f", argv[0]) && !test("d", NULL))
+ if (!test("f", argv[0]) && !test("d", argv[0]))
die1("path '%s' not found.", argv[0]);
- if (!(abspath = realpath(argv[0], buf)))
+ if (!(abspath = realpath(argv[0], pathbuf)))
die1("cannot make absolute path name. realpath(%s) failed.", argv[0]);
if (*abspath != '/')
die("realpath(3) is not compatible with BSD version.");
@@ -158,7 +152,7 @@ char *argv[];
/*
* execute generic browser.
*/
- if (browser && !locatestring(browser, "netscape", MATCH_AT_LAST)) {
+ if (browser && !locatestring(browser, "netscape", 3)) {
sprintf(com, "%s '%s'", browser, URL);
system(com);
exit (0);
@@ -177,7 +171,7 @@ char *argv[];
if ((pid = fork()) < 0) {
die("cannot execute netscape (fork).");
} else if (pid == 0) {
- execlp("netscape", "netscape", URL, NULL);
+ execlp("netscape", "netscape", URL, (char *)0);
die("loading mozilla failed.");
}
exit(0);
@@ -185,34 +179,6 @@ char *argv[];
exit(status);
}
int
-issource(path)
-char *path;
-{
- STRBUF *sb = stropen();
- char *p;
- char suff[MAXPATHLEN+1];
- int retval = 0;
-
- if (!getconfs("suffixes", sb)) {
- strclose(sb);
- return 0;
- }
- suff[0] = '.';
- for (p = strvalue(sb); p; ) {
- char *unit = p;
- if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
- *p++ = 0;
- strcpy(&suff[1], unit);
- if (locatestring(path, suff, MATCH_AT_LAST)) {
- retval = 1;
- break;
- }
- }
- strclose(sb);
- return retval;
-
-}
-int
sendcommand(com)
char *com;
{
@@ -222,7 +188,7 @@ char *com;
argv[0] = "netscape-remote";
argv[1] = "-remote";
argv[2] = com;
- argv[3] = NULL;
+ argv[3] = (char *)0;
return netscape_remote(argc, argv);
}
diff --git a/contrib/global/gozilla/gozilla.man b/contrib/global/gozilla/gozilla.man
index 39e257fd2b3b..1065529e1f07 100644
--- a/contrib/global/gozilla/gozilla.man
+++ b/contrib/global/gozilla/gozilla.man
@@ -139,7 +139,3 @@ can treat not only source file but also normal file, directory, HTML file
and even URL, because it is omnivorous.
.Sh AUTHORS
Shigio Yamaguchi (shigio@wafu.netgate.net)
-.Sh HISTORY
-The
-.Nm
-command appeared in FreeBSD 2.2.5.
diff --git a/contrib/global/gozilla/remote.c b/contrib/global/gozilla/remote.c
index ebc08d7ca109..d2e6a3417ce8 100644
--- a/contrib/global/gozilla/remote.c
+++ b/contrib/global/gozilla/remote.c
@@ -586,7 +586,7 @@ usage (void)
int
netscape_remote(int argc, char **argv)
#else
-int
+void
main (int argc, char **argv)
#endif
{
diff --git a/contrib/global/gtags.el b/contrib/global/gtags.el
index 22dcc9356315..2a8de7950e56 100644
--- a/contrib/global/gtags.el
+++ b/contrib/global/gtags.el
@@ -1,7 +1,7 @@
;;; gtags.el --- gtags facility for Emacs
;;
-;; Copyright (c) 1997, 1998, 1999 Shigio Yamaguchi. All rights reserved.
+;; Copyright (c) 1997 Shigio Yamaguchi. All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
@@ -30,12 +30,12 @@
;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
;; SUCH DAMAGE.
;;
-;; gtags.el 8-Jan-99
+;; gtags.el 31-Aug-97
;;
;; This file is part of GLOBAL.
;; Author: Shigio Yamaguchi <shigio@wafu.netgate.net>
-;; Version: 1.5
+;; Version: 1.1
;; Keywords: tools
;;; Code
@@ -59,7 +59,6 @@
(define-key gtags-mode-map "\es" 'gtags-find-symbol)
(define-key gtags-mode-map "\eg" 'gtags-find-pattern)
(define-key gtags-mode-map "\C-]" 'gtags-find-tag-from-here)
-(define-key gtags-mode-map "\eh" 'gtags-display-browser)
(define-key gtags-mode-map "\C-t" 'gtags-pop-stack)
(define-key gtags-mode-map "\e." 'etags-style-find-tag)
(define-key gtags-mode-map [mouse-2] 'gtags-find-tag-by-event)
@@ -84,7 +83,7 @@
;;
;; utility
;;
-(defun util-match-string (n)
+(defun match-string (n)
(buffer-substring (match-beginning n) (match-end n)))
;; Return a default tag to search for, based on the text at point.
@@ -100,7 +99,7 @@
(if (and (bolp) (looking-at definition-regexp))
(goto-char (match-end 0)))
(if (looking-at symbol-regexp)
- (util-match-string 0) nil))
+ (match-string 0) nil))
;; push current context to stack
(defun push-context ()
@@ -133,20 +132,18 @@
;; is it a definition?
(defun is-definition ()
(save-excursion
- (if (and (string-match "\.java$" buffer-file-name) (looking-at "[^(]+([^)]*)[ \t]*{"))
+ (if (bolp)
t
- (if (bolp)
- t
- (forward-word -1)
- (cond
- ((looking-at "define")
- (forward-char -1)
- (while (and (not (bolp)) (looking-at "[ \t]"))
- (forward-char -1))
- (if (and (bolp) (looking-at "#"))
- t nil))
- ((looking-at "ENTRY\\|ALTENTRY")
- (if (bolp) t nil)))))))
+ (forward-word -1)
+ (cond
+ ((looking-at "define")
+ (forward-char -1)
+ (while (and (not (bolp)) (looking-at "[ \t]"))
+ (forward-char -1))
+ (if (and (bolp) (looking-at "#"))
+ t nil))
+ ((looking-at "ENTRY\\|ALTENTRY")
+ (if (bolp) t nil))))))
;;
;; interactive command
@@ -219,18 +216,6 @@
(push-context)
(gtags-goto-tag tagname flag))))
-(defun gtags-display-browser ()
- "Display current screen on hypertext browser."
- (interactive)
- (let (lno)
- (save-excursion
- (end-of-line)
- (if (equal (point-min) (point))
- (setq lno 1)
- (setq lno (count-lines (point-min) (point)))))
- (message (number-to-string lno))
- (call-process "gozilla" nil t nil (concat "+" (number-to-string lno)) buffer-file-name)))
-
(defun gtags-find-tag-by-event (event)
"Get the expression as a tagname around here and move there."
(interactive "e")
@@ -322,8 +307,8 @@
;; (if (not (looking-at "[A-Za-z_][A-Za-z_0-9]*[ \t]+\\([0-9]+\\)[ \t]\\([^ \t]+\\)[ \t]"))
(if (not (looking-at "[^ \t]+[ \t]+\\([0-9]+\\)[ \t]\\([^ \t]+\\)[ \t]"))
(pop-context)
- (setq line (string-to-number (util-match-string 1)))
- (setq file (util-match-string 2))
+ (setq line (string-to-number (match-string 1)))
+ (setq file (match-string 2))
(if delete (kill-buffer (current-buffer)))
;; move to the context
(if gtags-read-only (find-file-read-only file) (find-file file))
@@ -332,15 +317,13 @@
;; make complete list
(defun make-gtags-complete-list ()
-;; "Make tag name list for completion."
-;; (interactive)
(save-excursion
(setq gtags-complete-list (make-vector 63 0))
(set-buffer (generate-new-buffer "*Completions*"))
(call-process "global" nil t nil "-c")
(goto-char (point-min))
(while (looking-at symbol-regexp)
- (intern (util-match-string 0) gtags-complete-list)
+ (intern (match-string 0) gtags-complete-list)
(forward-line))
(kill-buffer (current-buffer))))
@@ -348,8 +331,7 @@
(defun gtags-mode ()
"Minor mode for browsing C source using GLOBAL."
(interactive)
- (if (y-or-n-p "Do you use function name completion?")
- (make-gtags-complete-list))
+ (make-gtags-complete-list)
(use-local-map gtags-mode-map)
(run-hooks 'gtags-mode-hook))
diff --git a/contrib/global/gtags/Makefile b/contrib/global/gtags/Makefile
index ecfb0eade37d..9afed8066cf6 100644
--- a/contrib/global/gtags/Makefile
+++ b/contrib/global/gtags/Makefile
@@ -1,3 +1,6 @@
PROG= gtags
+CFLAGS+=-I${.CURDIR}/../lib
+LDADD= $(LIBUTIL)
+DPADD= $(LIBUTIL)
.include <bsd.prog.mk>
diff --git a/contrib/global/gtags/gtags.1 b/contrib/global/gtags/gtags.1
index e6b09e69bc6e..ed18616528d3 100644
--- a/contrib/global/gtags/gtags.1
+++ b/contrib/global/gtags/gtags.1
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+.\" Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -28,28 +28,26 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd Oct 10, 1998
+.Dd Sep 12, 1997
.Dt GTAGS 1
.Os BSD 4
.Sh NAME
.Nm gtags
-.Nd create tag files for global.
+.Nd create GTAGS, GRTAGS and GSYMS file
.Sh SYNOPSIS
.Nm gtags
-.Op Fl c
.Op Fl i
.Op Fl o
-.Op Fl w
.Op Fl v
.Op Ar dbpath
.Sh DESCRIPTION
.Nm Gtags
-makes GTAGS, GRTAGS, GSYMS and GPATH file for
+makes GTAGS, GRTAGS and GSYMS file for
.Xr global 1 .
.Nm Gtags
trace subdirectories, read source files,
locate symbols and save the information into tag files.
-C, yacc, java and assembler source files are supported.
+C, yacc and assembler source files are supported.
You should execute this command at the root of the source tree.
.Pp
If your source directory is on a read only device like CDROM, specify
@@ -57,16 +55,13 @@ If your source directory is on a read only device like CDROM, specify
of the directory on which make tag files.
.Pp
.Bl -tag -width Ds
-.It Fl c
-make tag files with compact format.
.It Fl i
-update tag files incrementally.
+update tag files incrementally by files which modified after the tag files were
+last updated.
.It Fl o
suppress making GSYMS file.
Use this option if you don't use -s option of
.Xr global 1 .
-.It Fl w
-print warning messages.
.It Fl v
verbose mode.
.Sh FILES
@@ -77,8 +72,6 @@ tag file for function definitions.
tag file for function references.
.It Pa GSYMS
tag file for other symbols.
-.It Pa GPATH
-path index file which is used for incremental updating and compact format.
.El
.Sh DIAGNOSTICS
.Nm Gtags
@@ -92,7 +85,7 @@ exits with a non 0 value if an error occurred, 0 otherwise.
GTAGS, GRTAGS and GSYMS are very large.
In advance of using this command, check the space of your disk.
.br
-Assembler support is far from complete. It extracts only ENTRY()
+Assembler support is far from completeness. It extracts only ENTRY()
and ALTENTRY() from source file. Probably valid only for FreeBSD and Linux
kernel source.
.br
diff --git a/contrib/global/gtags/gtags.c b/contrib/global/gtags/gtags.c
index 7a88747e29ac..bfd9aba0995c 100644
--- a/contrib/global/gtags/gtags.c
+++ b/contrib/global/gtags/gtags.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,10 +28,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * gtags.c 8-Oct-98
+ * gtags.c 12-Dec-97
*
*/
-#include <sys/types.h>
+
#include <sys/stat.h>
#include <ctype.h>
@@ -43,90 +43,46 @@
#include "global.h"
-const char *progname = "gtags"; /* command name */
+char *progname = "gtags"; /* command name */
static void usage __P((void));
-int main __P((int, char **));
-int incremental __P((char *, char *));
-void updatetags __P((char *, char *, char *, int));
-void createtags __P((char *, char *, int));
-int printconf __P((char *));
-char *now __P((void));
+void main __P((int, char **));
+int incremental __P((char *));
+void tagadd __P((int, char *));
+void createtags __P((char *, int));
+char *current __P((void));
-int cflag; /* compact format */
-int iflag; /* incremental update */
-int oflag; /* suppress making GSYMS */
-int wflag; /* warning message */
-int vflag; /* verbose mode */
+static int iflag;
+static int oflag;
+static int vflag;
-int extractmethod = 0;
static void
usage()
{
- fprintf(stderr, "usage:\t%s [-c][-i][-l][-o][-w][-v][dbpath]\n", progname);
+ fprintf(stderr, "usage:\t%s [-i][-o][-v][dbpath]\n", progname);
exit(1);
}
-int
+void
main(argc, argv)
int argc;
char *argv[];
{
char dbpath[MAXPATHLEN+1];
- char cwd[MAXPATHLEN+1];
char env[MAXENVLEN+1];
- STRBUF *sb = stropen();
+ char *p;
int db;
while (--argc > 0 && (++argv)[0][0] == '-') {
- char *p;
- /*
- * Secret option for htags(1).
- */
- if (!strcmp(argv[0], "--config")) {
- if (argc == 1)
- fprintf(stdout, "%s\n", configpath());
- else if (argc == 2) {
- if (!printconf(argv[1]))
- exit(1);
- }
- exit(0);
- } else if (!strcmp(argv[0], "--find")) {
- for (findopen(); (p = findread(NULL)) != NULL; )
- fprintf(stdout, "%s\n", p);
- findclose();
- exit(0);
- } else if (!strcmp(argv[0], "--expand")) {
- FILE *ip;
-
- ++argv; --argc;
- if (argc && argv[0][0] == '-') {
- settabs(atoi(&argv[0][1]));
- ++argv; --argc;
- }
- ip = (argc) ? fopen(argv[0], "r") : stdin;
- if (ip == NULL)
- exit(1);
- while ((p = mgets(ip, NULL, 0)) != NULL)
- detab(stdout, p);
- exit(0);
- }
-
for (p = argv[0] + 1; *p; p++) {
switch (*p) {
- case 'c':
- cflag++;
- break;
case 'i':
iflag++;
break;
case 'o':
oflag++;
break;
- case 'w':
- wflag++;
- break;
case 'v':
vflag++;
break;
@@ -139,48 +95,30 @@ char *argv[];
}
}
}
- if (!getcwd(cwd, MAXPATHLEN))
- die("cannot get current directory.");
- if (argc > 0)
- realpath(*argv,dbpath) ;
- else
- strcpy(dbpath, cwd);
+ if (argc > 0) {
+ strcpy(dbpath, *argv);
+ } else {
+ if (!getcwd(dbpath, MAXPATHLEN))
+ die("cannot get current directory.");
+ }
if (!strcmp(dbpath, "/"))
die("It's root directory! What are you doing?");
if (!test("d", dbpath))
die1("directory '%s' not found.", dbpath);
if (vflag)
- fprintf(stderr, "[%s] Gtags started\n", now());
- /*
- * load .gtagsrc or /etc/gtags.conf
- */
- openconf();
- if (getconfb("extractmethod"))
- extractmethod = 1;
- strstart(sb);
- if (getconfs("format", sb) && !strcmp(strvalue(sb), "compact"))
- cflag++;
+ fprintf(stderr, "[%s] Gtags started\n", current());
/*
* teach gctags(1) where is dbpath.
*/
sprintf(env, "GTAGSDBPATH=%s", dbpath);
putenv(env);
- if (wflag) {
- sprintf(env, "GTAGSWARNING=1");
- putenv(env);
- }
/*
* incremental update.
*/
if (iflag && test("f", makepath(dbpath, dbname(GTAGS))) &&
test("f", makepath(dbpath, dbname(GRTAGS))))
{
- /* open for version check */
- GTOP *gtop = gtagsopen(dbpath, cwd, GTAGS, GTAGS_MODIFY, 0);
- gtagsclose(gtop);
- if (!test("f", makepath(dbpath, "GPATH")))
- die("Old version tag file found. Please remake it.");
- (void)incremental(dbpath, cwd);
+ (void)incremental(dbpath);
exit(0);
}
if (iflag && vflag)
@@ -189,43 +127,32 @@ char *argv[];
* create GTAGS, GRTAGS and GSYMS
*/
for (db = GTAGS; db < GTAGLIM; db++) {
-
if (oflag && db == GSYMS)
continue;
- strstart(sb);
- if (!getconfs(dbname(db), sb))
- continue;
- if (!usable(strmake(strvalue(sb), " \t")))
- die1("Parser '%s' not found or not executable.", strmake(strvalue(sb), " \t"));
if (vflag)
- fprintf(stderr, "[%s] Creating '%s'.\n", now(), dbname(db));
- createtags(dbpath, cwd, db);
+ fprintf(stderr, "[%s] Creating '%s'.\n", current(), dbname(db));
+ createtags(dbpath, db);
}
if (vflag)
- fprintf(stderr, "[%s] Done.\n", now());
- closeconf();
+ fprintf(stderr, "[%s] Done.\n", current());
exit(0);
}
/*
* incremental: incremental update
*
* i) dbpath dbpath directory
- * i) root root directory of source tree
* r) 0: not updated, 1: updated
*/
int
-incremental(dbpath, root)
+incremental(dbpath)
char *dbpath;
-char *root;
{
- struct stat statp;
+ struct stat sb;
time_t gtags_mtime;
- STRBUF *addlist = stropen();
- STRBUF *updatelist = stropen();
- STRBUF *deletelist = stropen();
int updated = 0;
char *path;
+ int db;
if (vflag) {
fprintf(stderr, " Tag found in '%s'.\n", dbpath);
@@ -235,255 +162,145 @@ char *root;
* get modified time of GTAGS.
*/
path = makepath(dbpath, dbname(GTAGS));
- if (stat(path, &statp) < 0)
+ if (stat(path, &sb) < 0)
die1("stat failed '%s'.", path);
- gtags_mtime = statp.st_mtime;
+ gtags_mtime = sb.st_mtime;
- if (pathopen(dbpath, 0) < 0)
- die("GPATH not found.");
- /*
- * make add list and update list.
- */
for (findopen(); (path = findread(NULL)) != NULL; ) {
- if (stat(path, &statp) < 0)
+ if (stat(path, &sb) < 0)
die1("stat failed '%s'.", path);
- if (!pathget(path))
- strnputs(addlist, path, strlen(path) + 1);
- else if (gtags_mtime < statp.st_mtime)
- strnputs(updatelist, path, strlen(path) + 1);
- }
- findclose();
- /*
- * make delete list.
- */
- {
- int i, limit = nextkey();
-
- for (i = 0; i < limit; i++) {
- if ((path = pathiget(i)) == NULL)
- continue;
- if (!test("f", path))
- strnputs(deletelist, path, strlen(path) + 1);
+ /*
+ * only the path modified after GTAGS was modified.
+ */
+ if (gtags_mtime < sb.st_mtime) {
+ updated = 1;
+ if (vflag)
+ fprintf(stderr, " Updating tags of '%s' ...", path + 2);
+ for (db = GTAGS; db < GTAGLIM; db++) {
+ if (db == GSYMS && !test("f", makepath(dbpath, dbname(db))))
+ continue;
+ if (vflag)
+ fprintf(stderr, "%s", dbname(db));
+ tagopen(dbpath, db, 2);
+ /*
+ * GTAGS needed to make GRTAGS.
+ */
+ if (db == GRTAGS)
+ lookupopen(dbpath);
+ tagdelete(path);
+ if (vflag)
+ fprintf(stderr, "..");
+ tagadd(db, path);
+ if (db == GRTAGS)
+ lookupclose();
+ tagclose();
+ }
+ if (vflag)
+ fprintf(stderr, " Done.\n");
}
}
- pathclose();
- if (strbuflen(addlist) + strbuflen(deletelist) + strbuflen(updatelist))
- updated = 1;
- /*
- * execute updating.
- */
- if (strbuflen(updatelist) > 0) {
- char *start = strvalue(updatelist);
- char *end = start + strbuflen(updatelist);
- char *p;
-
- for (p = start; p < end; p += strlen(p) + 1)
- updatetags(dbpath, root, p, 0);
- updated = 1;
- }
- if (strbuflen(addlist) > 0) {
- char *start = strvalue(addlist);
- char *end = start + strbuflen(addlist);
- char *p;
-
- for (p = start; p < end; p += strlen(p) + 1)
- updatetags(dbpath, root, p, 1);
- updated = 1;
- }
- if (strbuflen(deletelist) > 0) {
- char *start = strvalue(deletelist);
- char *end = start + strbuflen(deletelist);
- char *p;
-
- for (p = start; p < end; p += strlen(p) + 1)
- updatetags(dbpath, root, p, 2);
-
- pathopen(dbpath, 2);
- for (p = start; p < end; p += strlen(p) + 1)
- pathdel(p);
- pathclose();
- updated = 1;
- }
+ findclose();
if (vflag) {
if (updated)
fprintf(stderr, " Global databases have been modified.\n");
else
fprintf(stderr, " Global databases are up to date.\n");
- fprintf(stderr, "[%s] Done.\n", now());
+ fprintf(stderr, "[%s] Done.\n", current());
+
+ fprintf(stderr, " Done.\n");
}
- strclose(addlist);
- strclose(deletelist);
- strclose(updatelist);
return updated;
}
/*
- * updatetags: update tag file.
+ * tagadd: add records which has specified path.
*
- * i) dbpath directory in which tag file exist
- * i) root root directory of source tree
- * i) path path which should be updated
- * i) type 0:update, 1:add, 2:delete
+ * i) db 0: GTAGS, 1: GRTAGS, 2: GSYMS
+ * i) path source file
*/
void
-updatetags(dbpath, root, path, type)
-char *dbpath;
-char *root;
+tagadd(db, path)
+int db;
char *path;
-int type;
{
- GTOP *gtop;
- STRBUF *sb = stropen();
- int db;
- const char *msg = NULL;
+ char *tagline, *p, *q;
+ char key[IDENTLEN+1];
+ FILE *ip;
- switch (type) {
- case 0: msg = "Updating"; break;
- case 1: msg = "Adding"; break;
- case 2: msg = "Deleting"; break;
- }
- if (vflag)
- fprintf(stderr, " %s tags of '%s' ...", msg, path + 2);
- for (db = GTAGS; db < GTAGLIM; db++) {
- int flags = 0;
-
- if (db == GSYMS && !test("f", makepath(dbpath, dbname(db))))
- continue;
- if (vflag)
- fprintf(stderr, "%s", dbname(db));
- /*
- * get tag command.
- */
- strstart(sb);
- if (!getconfs(dbname(db), sb))
- die1("cannot get tag command. (%s)", dbname(db));
- gtop = gtagsopen(dbpath, root, db, GTAGS_MODIFY, 0);
- /*
- * GTAGS needed to make GRTAGS.
- */
- if (db == GRTAGS && !test("f", makepath(dbpath, "GTAGS")))
- die("GTAGS needed to create GRTAGS.");
- if (type != 1)
- gtagsdelete(gtop, path);
- if (vflag)
- fprintf(stderr, "..");
- if (type != 2) {
- if (db == GSYMS)
- flags |= GTAGS_UNIQUE;
- if (extractmethod)
- flags |= GTAGS_EXTRACTMETHOD;
- gtagsadd(gtop, strvalue(sb), path, flags);
- }
- gtagsclose(gtop);
+ stropen();
+ /*
+ * make command line.
+ */
+ strputs("gctags -Dex");
+ if (db == GRTAGS)
+ strputs("r");
+ if (db == GSYMS)
+ strputs("sc");
+ strputc(' ');
+ strputs(path);
+ p = strclose();
+ if (!(ip = popen(p, "r")))
+ die1("cannot execute '%s'.", p);
+ while ((tagline = mgets(ip, 0, NULL)) != NULL) {
+ p = tagline;
+ q = key;
+ while (*p && !isspace(*p))
+ *q++ = *p++;
+ *q = 0;
+ tagput(key, tagline);
}
- if (vflag)
- fprintf(stderr, " Done.\n");
- strclose(sb);
+ pclose(ip);
}
/*
* createtags: create tags file
*
* i) dbpath dbpath directory
- * i) root root directory of source tree
* i) db GTAGS, GRTAGS, GSYMS
*/
void
-createtags(dbpath, root, db)
+createtags(dbpath, db)
char *dbpath;
-char *root;
int db;
{
char *path;
- GTOP *gtop;
- int flags;
- char *comline;
- STRBUF *sb = stropen();
/*
- * get tag command.
- */
- if (!getconfs(dbname(db), sb))
- die1("cannot get tag command. (%s)", dbname(db));
- comline = strdup(strvalue(sb));
- if (!comline)
- die("short of memory.");
- /*
* GTAGS needed to make GRTAGS.
*/
- if (db == GRTAGS && !test("f", makepath(dbpath, "GTAGS")))
- die("GTAGS needed to create GRTAGS.");
- flags = 0;
- strstart(sb);
- if (cflag) {
- flags |= GTAGS_COMPACT;
- flags |= GTAGS_PATHINDEX;
- }
- strstart(sb);
- if (vflag > 1 && getconfs(dbname(db), sb))
- fprintf(stderr, " using tag command '%s <path>'.\n", strvalue(sb));
- gtop = gtagsopen(dbpath, root, db, GTAGS_CREATE, flags);
+ if (db == GRTAGS)
+ lookupopen(dbpath);
+ tagopen(dbpath, db, 1);
for (findopen(); (path = findread(NULL)) != NULL; ) {
- int gflags = 0;
/*
* GSYMS doesn't treat asembler.
*/
- if (db == GSYMS)
- if (locatestring(path, ".s", MATCH_AT_LAST) != NULL ||
- locatestring(path, ".S", MATCH_AT_LAST) != NULL)
+ if (db == GSYMS) {
+ char *p = path + strlen(path) - 1;
+ if ((*p == 's' || *p == 'S') && *(p - 1) == '.')
continue;
+ }
if (vflag)
fprintf(stderr, " extracting tags of %s.\n", path);
- if (db == GSYMS)
- gflags |= GTAGS_UNIQUE;
- if (extractmethod)
- gflags |= GTAGS_EXTRACTMETHOD;
- gtagsadd(gtop, comline, path, gflags);
+ tagadd(db, path);
}
findclose();
- gtagsclose(gtop);
- free(comline);
- strclose(sb);
+ tagclose();
+ if (db == GRTAGS)
+ lookupclose();
}
/*
- * now: current date and time
+ * current: current date and time
*
* r) date and time
*/
-char *
-now(void)
+char *
+current(void)
{
static char buf[80];
time_t tval;
if (time(&tval) == -1)
die("cannot get current time.");
- (void)strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %Z %Y", localtime(&tval));
- return buf;
-}
-/*
- * printconf: print configuration data.
- *
- * i) name label of config data
- * r) exit code
- */
-int
-printconf(name)
-char *name;
-{
- STRBUF *sb;
- int num;
- int exist = 1;
+ (void)strftime(buf, sizeof(buf), "%+", localtime(&tval));
- if (getconfn(name, &num))
- fprintf(stdout, "%d\n", num);
- else if (getconfb(name))
- fprintf(stdout, "1\n");
- else {
- sb = stropen();
- if (getconfs(name, sb))
- fprintf(stdout, "%s\n", strvalue(sb));
- else
- exist = 0;
- strclose(sb);
- }
- return exist;
+ return buf;
}
diff --git a/contrib/global/htags/htags.1 b/contrib/global/htags/htags.1
index 4c22448e6f02..2a9dea12265f 100644
--- a/contrib/global/htags/htags.1
+++ b/contrib/global/htags/htags.1
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+.\" Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -28,18 +28,16 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd Oct 11, 1998
+.Dd June 28, 1997
.Dt HTAGS 1
.Os BSD 4
.Sh NAME
.Nm htags
-.Nd generate hypertext from C, Yacc and Java source code
+.Nd generate hypertext from C and Yacc source code
.Sh SYNOPSIS
.Nm htags
.Op Fl a
-.Op Fl c
.Op Fl f
-.Op Fl h
.Op Fl l
.Op Fl n
.Op Fl v
@@ -49,59 +47,47 @@
.Op Ar dir
.Sh DESCRIPTION
.Nm Htags
-makes hypertext from C, Yacc and Java source code using GLOBAL database (GTAGS, GRTAGS).
+makes hypertext from C and Yacc source code using GLOBAL database (GTAGS, GRTAGS).
.Pp
In advance of using this command, you must execute
.Xr gtags 1
-from the root directory of the source tree.
+at the root directory of the source tree.
Then you can execute
.Nm htags
-from the same place.
+at the same place.
.Nm Htags
-makes an HTML directory and generates hypertext in it.
+makes HTML directory and generate hypertext in it.
.Pp
You can start browsing from 'HTML/index.html'.
-Once the hypertext is generated, you can move it anywhere and browse it
-in any browsers.
+Once hypertext generated, you can move it anywhere and browse it
+by any browsers.
.Pp
.br
.Bl -tag -width Ds
.It Fl a
-Make an alphabetical function index, suitable for a large project.
-.It Fl c
-Compress html files by
-.Xr gzip 1 .
-You need to set up an HTTP server so that
-.Xr gzip 1
-is invoked for each compressed
-files. See skelton file 'HTML/.htaccess.skel' that is generated by htags.
+make an alphabetical function index. It's suitable for large project.
.It Fl f
-Support an input form and a dynamic index with a CGI program.
-You need to set up an HTTP server for this.
-.It Fl h
-Add title header frame. By default, doesn't add this.
+support input form and dynamic index by CGI program.
+You need to setup HTTP server for it.
.It Fl l
-Make a name tag(<A NAME=line number>) for each line, so that other hypertext
-can link to any line of this hypertext.
-By default, htags makes it only for lines that are referred to by an object.
+make name tag(<A NAME=line number>) for each line so that outer hypertext
+can point any line of this hypertext.
+By default, make it only for lines which have referred object.
.It Fl n
-Print the line numbers (they are not printed by default).
+print line number. By default, doesn't print it.
.It Fl v
-Verbose mode.
+verbose mode.
.It Fl w
-Print a warning message.
+print warning message.
.It Fl d Ar tagdir
-Specifies the directory in which GTAGS and GRTAGS exist. The default is the
-current directory.
+the directory in which GTAGS and GRTAGS exist. Default is current directory.
.It Fl t Ar title
-The title of this hypertext. Defaults to the last component of the current
-path.
+Title of this hypertext. Default is the last component of current path.
.It Ar dir
-The directory in which hypertext is generated. The default is the current
-directory.
+the directory in which hypertext generated. Default is current directory.
.Sh EXAMPLES
% cd /usr/src/sys
- # gtags -o
+ # gtags -se
# htags -fnvat 'Welcom to FreeBSD kernel source tour!'
% lynx HTML/index.html
.Sh FILES
@@ -109,17 +95,17 @@ directory.
.It Pa HTML/index.html
Index file.
.It Pa GTAGS
-Tags file for function definitions.
+tags file for function definitions.
.It Pa GRTAGS
-Tags file for function references.
+tags file for function references.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of htags.
.Pp
.Bl -tag -width indent
.It Ev TMPDIR
-If this variable is set, its value is used as the directory to make temporary files.
-The default is /tmp.
+If this variable is set, its value is used as the directory to make temporary file.
+Default is /tmp.
.Sh DIAGNOSTICS
.Nm Htags
exits with a non 0 value if an error occurred, 0 otherwise.
diff --git a/contrib/global/htags/htags.pl b/contrib/global/htags/htags.pl
index d8488deae6c9..e4e6de89d51f 100644
--- a/contrib/global/htags/htags.pl
+++ b/contrib/global/htags/htags.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+# Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -29,196 +29,77 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# htags.pl 10-Nov-98
+# htags.pl 20-Jan-98
#
$com = $0;
$com =~ s/.*\///;
-$usage = "usage: $com [-a][-c][-f][-h][-l][-n][-v][-w][-t title][-d tagdir][dir]\n";
-#-------------------------------------------------------------------------
-# COMMAND EXISTENCE CHECK
-#-------------------------------------------------------------------------
-foreach $c ('sort', 'gtags', 'global', 'btreeop') {
- if (!&'usable($c)) {
- &'error("'$c' command is required but not found.");
- }
-}
+$usage = "usage: $com [-a][-f][-l][-n][-v][-w][-t title][-d tagdir][dir]\n";
#-------------------------------------------------------------------------
# CONFIGURATION
#-------------------------------------------------------------------------
+# columns of line number
+$ncol = 4;
+# font
+$comment_begin = '<I><FONT COLOR=green>'; # /* ... */
+$comment_end = '</FONT></I>';
+$sharp_begin = '<FONT COLOR=darkred>'; # #define, #include or so on
+$sharp_end = '</FONT>';
+$brace_begin = '<FONT COLOR=blue>'; # { ... }
+$brace_end = '</FONT>';
+$reserved_begin = '<B>'; # if, while, for or so on
+$reserved_end = '</B>';
+# reserved words
+$reserved_words = "auto|break|case|char|continue|default|do|double|else|extern|float|for|goto|if|int|long|register|return|short|sizeof|static|struct|switch|typedef|union|unsigned|void|while";
# temporary directory
-$'tmp = '/tmp';
+$tmp = '/tmp';
if (defined($ENV{'TMPDIR'}) && -d $ENV{'TMPDIR'}) {
$tmp = $ENV{'TMPDIR'};
}
-$'ncol = 4; # columns of line number
-$'tabs = 8; # tab skip
-$'gzipped_suffix = 'ghtml'; # suffix of gzipped html file
-#
-# font
-#
-$'title_begin = '<FONT COLOR=#cc0000>';
-$'title_end = '</FONT>';
-$'comment_begin = '<I><FONT COLOR=green>'; # /* ... */
-$'comment_end = '</FONT></I>';
-$'sharp_begin = '<FONT COLOR=darkred>'; # #define, #include or so on
-$'sharp_end = '</FONT>';
-$'brace_begin = '<FONT COLOR=blue>'; # { ... }
-$'brace_end = '</FONT>';
-$'reserved_begin = '<B>'; # if, while, for or so on
-$'reserved_end = '</B>';
-#
-# color
-#
-$'body_bgcolor = '';
-$'body_text = '';
-$'body_link = '';
-$'body_vlink = '';
-$'body_alink = '';
-#
-# Reserved words for C and Java are hard coded.
-# (configuration parameter 'reserved_words' was deleted.)
-#
-$'c_reserved_words = "auto,break,case,char,continue,default,do,double,else," .
- "extern,float,for,goto,if,int,long,register,return," .
- "short,sizeof,static,struct,switch,typedef,union," .
- "unsigned,void,while";
-$'java_reserved_words = "abstract,boolean,break,byte,case,catch,char,class," .
- "const,continue,default,do,double,else,extends,false," .
- "final,finally,float,for,goto,if,implements,import," .
- "instanceof,int,interface,long,native,new,null," .
- "package,private,protected,public,return,short," .
- "static,super,switch,synchronized,this,throw,throws," .
- "union,transient,true,try,void,volatile,while";
-$'c_reserved_words =~ s/,/|/g;
-$'java_reserved_words =~ s/,/|/g;
-#
-# read values from global.conf
-#
-chop($config = `gtags --config`);
-if ($config) {
- if ($var1 = &'getconf('ncol')) {
- if ($var1 < 1 || $var1 > 10) {
- print STDERR "Warning: parameter 'ncol' ignored becase the value is too large or too small.\n";
- } else {
- $ncol = $var1;
- }
- }
- if ($var1 = &'getconf('tabs')) {
- if ($var1 < 1 || $var1 > 32) {
- print STDERR "Warning: parameter 'tabs' ignored becase the value is too large or too small.\n";
- } else {
- $tabs = $var1;
- }
- }
- if ($var1 = &'getconf('gzipped_suffix')) {
- $gzipped_suffix = $var1;
- }
- if (($var1 = &'getconf('title_begin')) && ($var2 = &'getconf('title_end'))) {
- $title_begin = $var1;
- $title_end = $var2;
- }
- if (($var1 = &'getconf('comment_begin')) && ($var2 = &'getconf('comment_end'))) {
- $comment_begin = $var1;
- $comment_end = $var2;
- }
- if (($var1 = &'getconf('sharp_begin')) && ($var2 = &'getconf('sharp_end'))) {
- $sharp_begin = $var1;
- $sharp_end = $var2;
- }
- if (($var1 = &'getconf('brace_begin')) && ($var2 = &'getconf('brace_end'))) {
- $brace_begin = $var1;
- $brace_end = $var2;
- }
- if (($var1 = &'getconf('reserved_begin')) && ($var2 = &'getconf('reserved_end'))) {
- $reserved_begin = $var1;
- $reserved_end = $var2;
- }
- $body_bgcolor = $var1 if ($var1 = &'getconf('bgcolor'));
- $body_text = $var1 if ($var1 = &'getconf('text'));
- $body_link = $var1 if ($var1 = &'getconf('link'));
- $body_vlink = $var1 if ($var1 = &'getconf('vlink'));
- $body_alink = $var1 if ($var1 = &'getconf('alink'));
-}
-# HTML tag
-$'begin_html = "<HTML>\n";
-$'end_html = "</HTML>\n";
-$'begin_body = '<BODY';
-$'begin_body .= " BGCOLOR=$body_bgcolor" if ($body_bgcolor);
-$'begin_body .= " TEXT=$body_text" if ($body_text);
-$'begin_body .= " LINK=$body_link" if ($body_link);
-$'begin_body .= " LINK=$body_vlink" if ($body_vlink);
-$'begin_body .= " LINK=$body_alink" if ($body_alink);
-$'begin_body .= '>';
-$'begin_body .= "\n";
-$'end_body = "</BODY>\n";
#-------------------------------------------------------------------------
# DEFINITION
#-------------------------------------------------------------------------
# unit for a path
-$'SEP = ' '; # source file path must not include $SEP charactor
-$'ESCSEP = &'escape($SEP);
-$'SRCS = 'S';
-$'DEFS = 'D';
-$'REFS = 'R';
-$'INCS = 'I';
+$SEP = ' '; # source file path must not include $SEP charactor
+$ESCSEP = &escape($SEP);
+$SRCS = 'S';
+$DEFS = 'D';
+$REFS = 'R';
+$INCS = 'I';
#-------------------------------------------------------------------------
# JAVASCRIPT PARTS
#-------------------------------------------------------------------------
# escaped angle
-$'langle = sprintf("unescape('%s')", &'escape('<'));
-$'rangle = sprintf("unescape('%s')", &'escape('>'));
-$'begin_script="<SCRIPT LANGUAGE=javascript>\n<!--\n";
-$'end_script="<!-- end of script -->\n</SCRIPT>\n";
-$'default_view=
+$langle = sprintf("unescape('%s')", &escape('<'));
+$rangle = sprintf("unescape('%s')", &escape('>'));
+# frame name
+$f_mains = 'mains'; # for main view
+$f_funcs = 'funcs'; # for function index
+$f_files = 'files'; # for file index
+$begin_script="<SCRIPT LANGUAGE=javascript>\n<!--\n";
+$end_script="<!-- end of script -->\n</SCRIPT>\n";
+$defaultview=
"// if your browser doesn't support javascript, write a BASE tag statically.\n" .
"if (parent.frames.length)\n" .
- " document.write($langle+'BASE TARGET=mains'+$rangle)\n";
-$'rewrite_href_funcs =
- "if (parent.frames.length && parent.funcs == self) {\n" .
+ " document.write($langle+'BASE TARGET=$f_mains'+$rangle)\n";
+$rewrite_href_funcs =
+ "if (parent.frames.length && parent.$f_funcs == self) {\n" .
" document.links[0].href = '../funcs.html';\n" .
" document.links[document.links.length - 1].href = '../funcs.html';\n" .
"}\n";
-$'rewrite_href_files =
- "if (parent.frames.length && parent.files == self) {\n" .
- " document.links[0].href = '../files.html';\n" .
- " document.links[document.links.length - 1].href = '../files.html';\n" .
+$rewrite_href_files =
+ "if (parent.frames.length && parent.$f_files == self) {\n" .
+ " document.links[0].href = '../files.html';\n" .
+ " document.links[document.links.length - 1].href = '../files.html';\n" .
"}\n";
-sub set_header {
- local($display, $title, $script) = @_;
- local($head) = "<HEAD><TITLE>$title</TITLE>";
- if ($script || ($'hflag && $display)) {
- $head .= "\n";
- $head .= $'begin_script;
- $head .= $script if ($script);
- if ($'hflag && $display) {
- $title = '[' . $title . ']' if ($title);
- $head .= "if (parent.frames.length && parent.mains == self) {\n";
- $head .= " parent.title.document.open();\n";
- $head .= " parent.title.document.write('<H3>$title</H3>');\n";
- $head .= " parent.title.document.close();\n";
- $head .= "}\n";
- }
- $head .= $'end_script;
- }
- $head .= "</HEAD>\n";
- $head;
-}
#-------------------------------------------------------------------------
# UTIRITIES
#-------------------------------------------------------------------------
+$findcom = "find . \\( -type f -o -type l \\) -name '*.[chysS]' -print";
sub getcwd {
local($dir) = `/bin/pwd`;
chop($dir);
$dir;
}
-sub realpath {
- local($dir) = @_;
- local($cwd) = &getcwd;
- chdir($dir) || &'error("cannot change directory '$dir'.");
- local($new) = &getcwd;
- chdir($cwd) || &'error("cannot recover current directory '$cwd'.");
- $new;
-}
sub date {
local($date) = `date`;
chop($date);
@@ -238,9 +119,9 @@ sub escape {
'%' . sprintf("%x", ord($c));
}
sub usable {
- local($command) = @_;
+ local($com) = @_;
foreach (split(/:/, $ENV{'PATH'})) {
- return 1 if (-x "$_/$command");
+ return 1 if (-x "$_/$com");
}
return 0;
}
@@ -251,46 +132,25 @@ sub copy {
$ret = ($ret == 0) ? 1 : 0;
$ret;
}
-sub getconf {
- local($name) = @_;
- local($val);
- chop($val = `gtags --config $name`);
- if ($? != 0) { $val = ''; }
- $val;
-}
-sub path2file {
- local($path) = @_;
- $path =~ s/^\.\///;
- $path =~ s!/!$'SEP!g;
- $path . '.' . $'HTML;
-}
-sub path2url {
- local($path) = @_;
- $path =~ s/^\.\///;
- $path =~ s!/!$'ESCSEP!g;
- $path . '.' . $'HTML;
-}
#-------------------------------------------------------------------------
# PROCESS START
#-------------------------------------------------------------------------
#
# options check.
#
-$'aflag = $'cflag = $'fflag = $'hflag = $'lflag = $'nflag = $'vflag = $'wflag = '';
+$aflag = $fflag = $lflag = $nflag = $vflag = $wflag = '';
while ($ARGV[0] =~ /^-/) {
$opt = shift;
- if ($opt =~ /[^-acfhlnvwtd]/) {
+ if ($opt =~ /[^-aflnvwtd]/) {
print STDERR $usage;
exit 1;
}
- if ($opt =~ /a/) { $'aflag = 'a'; }
- if ($opt =~ /c/) { $'cflag = 'c'; }
- if ($opt =~ /f/) { $'fflag = 'f'; }
- if ($opt =~ /h/) { $'hflag = 'h'; }
- if ($opt =~ /l/) { $'lflag = 'l'; }
- if ($opt =~ /n/) { $'nflag = 'n'; }
- if ($opt =~ /v/) { $'vflag = 'v'; }
- if ($opt =~ /w/) { $'wflag = 'w'; }
+ if ($opt =~ /a/) { $aflag = 'a'; }
+ if ($opt =~ /f/) { $fflag = 'f'; }
+ if ($opt =~ /l/) { $lflag = 'l'; }
+ if ($opt =~ /n/) { $nflag = 'n'; }
+ if ($opt =~ /v/) { $vflag = 'v'; }
+ if ($opt =~ /w/) { $wflag = 'w'; }
if ($opt =~ /t/) {
$opt = shift;
last if ($opt eq '');
@@ -301,61 +161,62 @@ while ($ARGV[0] =~ /^-/) {
$dbpath = $opt;
}
}
-if ($'cflag && !&'usable('gzip')) {
- print STDERR "Warning: 'gzip' command not found. -c option ignored.\n";
- $'cflag = '';
-}
if (!$title) {
- @cwd = split('/', &'getcwd);
+ @cwd = split('/', &getcwd);
$title = $cwd[$#cwd];
}
-$dbpath = '.' if (!$dbpath);
+$dbpath = &getcwd() if (!$dbpath);
unless (-r "$dbpath/GTAGS" && -r "$dbpath/GRTAGS") {
- &'error("GTAGS and GRTAGS not found. Please make them.");
+ &error("GTAGS and GRTAGS not found. please type 'gtags[RET]'");
}
-$dbpath = &'realpath($dbpath);
#
-# for global(1)
+# recognize format version
+# if version record is not found, it's assumed version 1.
#
-$ENV{'GTAGSROOT'} = &'getcwd();
-$ENV{'GTAGSDBPATH'} = $dbpath;
-delete $ENV{'GTAGSLIBPATH'};
+ $support_version = 1; # I can understand this format version
+#
+open(GTAGS, "btreeop -K ' __.VERSION' $dbpath/GTAGS |") || &error("GTAGS not found.");
+$rec = <GTAGS>;
+close(GTAGS);
+if ($rec =~ /^ __\.VERSION[ \t]+([0-9]+)$/) {
+ $format_version = $1;
+} else {
+ $format_version = 1;
+}
+if ($format_version != $support_version) {
+ &error("GTAGS format version unmatched. Please remake it.");
+}
#
# check directories
#
-$dist = &'getcwd() . '/HTML';
+$html = &getcwd() . '/HTML';
if ($ARGV[0]) {
- $cwd = &'getcwd();
+ $cwd = &getcwd();
unless (-w $ARGV[0]) {
- &'error("'$ARGV[0]' is not writable directory.");
+ &error("'$ARGV[0]' is not writable directory.");
}
- chdir($ARGV[0]) || &'error("directory '$ARGV[0]' not found.");
- $dist = &'getcwd() . '/HTML';
- chdir($cwd) || &'error("cannot return to original directory.");
+ chdir($ARGV[0]) || &error("directory '$ARGV[0]' not found.");
+ $html = &getcwd() . '/HTML';
+ chdir($cwd) || &error("cannot return to original directory.");
}
#
-# find filter
-#
-$'findcom = "gtags --find";
-#
# check if GTAGS, GRTAGS is the latest.
#
$gtags_ctime = (stat("$dbpath/GTAGS"))[10];
-open(FIND, "$'findcom |") || &'error("cannot fork.");
+open(FIND, "$findcom |") || &error("cannot exec find.");
while (<FIND>) {
chop;
+ next if /(y\.tab\.c|y\.tab\.h)$/;
+ next if /(\/SCCS\/|\/RCS\/)/;
if ($gtags_ctime < (stat($_))[10]) {
- &'error("GTAGS is not the latest one. Please remake it.");
+ &error("GTAGS is not the latest one. Please remake it.");
}
}
close(FIND);
-if ($?) { &'error("cannot traverse directory."); }
#-------------------------------------------------------------------------
# MAKE FILES
#-------------------------------------------------------------------------
# HTML/cgi-bin/global.cgi ... CGI program (1)
-# HTML/cgi-bin/ghtml.cgi ... unzip script (1)
-# HTML/.htaccess.skel ... skelton of .htaccess (1)
# HTML/help.html ... help file (2)
# HTML/$REFS/* ... referencies (3)
# HTML/$DEFS/* ... definitions (3)
@@ -365,110 +226,92 @@ if ($?) { &'error("cannot traverse directory."); }
# HTML/files/* ... file index (5)
# HTML/index.html ... index file (6)
# HTML/mains.html ... main index (7)
-# HTML/null.html ... main null html (7)
# HTML/$SRCS/ ... source files (8)
# HTML/$INCS/ ... include file index (9)
#-------------------------------------------------------------------------
-$'HTML = ($'cflag) ? $gzipped_suffix : 'html';
-print STDERR "[", &'date, "] ", "Htags started\n" if ($'vflag);
+print STDERR "[", &date, "] ", "Htags started\n" if ($vflag);
#
# (0) make directories
#
-print STDERR "[", &'date, "] ", "(0) making directories ...\n" if ($'vflag);
-mkdir($dist, 0777) || &'error("cannot make directory '$dist'.") if (! -d $dist);
+print STDERR "[", &date, "] ", "(0) making directories ...\n" if ($vflag);
+mkdir($html, 0777) || &error("cannot make directory '$html'.") if (! -d $html);
foreach $d ($SRCS, $INCS, $DEFS, $REFS, files, funcs) {
- mkdir("$dist/$d", 0775) || &'error("cannot make HTML directory") if (! -d "$dist/$d");
+ mkdir("$html/$d", 0775) || &error("cannot make HTML directory") if (! -d "$html/$d");
}
-if ($'fflag || $'cflag) {
- mkdir("$dist/cgi-bin", 0775) || &'error("cannot make cgi-bin directory") if (! -d "$dist/cgi-bin");
+if ($fflag) {
+ mkdir("$html/cgi-bin", 0775) || &error("cannot make cgi-bin directory") if (! -d "$html/cgi-bin");
}
#
# (1) make CGI program
#
-if ($'fflag) {
- print STDERR "[", &'date, "] ", "(1) making CGI program ...\n" if ($'vflag);
- &makeprogram("$dist/cgi-bin/global.cgi") || &'error("cannot make CGI program.");
- chmod(0755, "$dist/cgi-bin/global.cgi") || &'error("cannot chmod CGI program.");
- unlink("$dist/cgi-bin/GTAGS", "$dist/cgi-bin/GRTAGS", "$dist/cgi-bin/GPATH");
- link("$dbpath/GTAGS", "$dist/cgi-bin/GTAGS") || &'copy("$dbpath/GTAGS", "$dist/cgi-bin/GTAGS") || &'error("cannot copy GTAGS.");
- link("$dbpath/GRTAGS", "$dist/cgi-bin/GRTAGS") || &'copy("$dbpath/GRTAGS", "$dist/cgi-bin/GRTAGS") || &'error("cannot copy GRTAGS.");
- link("$dbpath/GPATH", "$dist/cgi-bin/GPATH") || &'copy("$dbpath/GPATH", "$dist/cgi-bin/GPATH") || &'error("cannot copy GPATH.");
-}
-if ($'cflag) {
- &makehtaccess("$dist/.htaccess.skel") || &'error("cannot make .htaccess skelton.");
- &makeghtml("$dist/cgi-bin/ghtml.cgi") || &'error("cannot make unzip script.");
- chmod(0755, "$dist/cgi-bin/ghtml.cgi") || &'error("cannot chmod unzip script.");
+if ($fflag) {
+ print STDERR "[", &date, "] ", "(1) making CGI program ...\n" if ($vflag);
+ &makeprogram("$html/cgi-bin/global.cgi") || &error("cannot make CGI program.");
+ chmod(0755, "$html/cgi-bin/global.cgi") || &error("cannot chmod CGI program.");
+ unlink("$html/cgi-bin/GTAGS", "$html/cgi-bin/GRTAGS");
+ link("$dbpath/GTAGS", "$html/cgi-bin/GTAGS") || &copy("$dbpath/GTAGS", "$html/cgi-bin/GTAGS") || &error("cannot copy GTAGS.");
+ link("$dbpath/GRTAGS", "$html/cgi-bin/GRTAGS") || &copy("$dbpath/GRTAGS", "$html/cgi-bin/GRTAGS") || &error("cannot copy GRTAGS.");
}
#
# (2) make help file
#
-print STDERR "[", &'date, "] ", "(2) making help.html ...\n" if ($'vflag);
-&makehelp("$dist/help.html");
+print STDERR "[", &date, "] ", "(2) making help.html ...\n" if ($vflag);
+&makehelp("$html/help.html");
#
# (3) make function entries ($DEFS/* and $REFS/*)
# MAKING TAG CACHE
#
-print STDERR "[", &'date, "] ", "(3) making duplicate entries ...\n" if ($'vflag);
-sub suddenly { &'clean(); exit 1}
+print STDERR "[", &date, "] ", "(3) making duplicate entries ...\n" if ($vflag);
+sub suddenly { &clean(); exit 1}
$SIG{'INT'} = 'suddenly';
$SIG{'QUIT'} = 'suddenly';
$SIG{'TERM'} = 'suddenly';
&cache'open(100000);
-$func_total = &makedupindex($dist);
-print STDERR "Total $func_total functions.\n" if ($'vflag);
+$func_total = &makedupindex();
+print STDERR "Total $func_total functions.\n" if ($vflag);
#
# (4) make function index (funcs.html and funcs/*)
# PRODUCE @funcs
#
-print STDERR "[", &'date, "] ", "(4) making function index ...\n" if ($'vflag);
-$func_total = &makefuncindex($dist, "$dist/funcs.html", $func_total);
-print STDERR "Total $func_total functions.\n" if ($'vflag);
+print STDERR "[", &date, "] ", "(4) making function index ...\n" if ($vflag);
+$func_total = &makefuncindex("$html/funcs.html", $func_total);
+print STDERR "Total $func_total functions.\n" if ($vflag);
#
# (5) make file index (files.html and files/*)
# PRODUCE @files %includes
#
-print STDERR "[", &'date, "] ", "(5) making file index ...\n" if ($'vflag);
-$file_total = &makefileindex($dist, "$dist/files.html", "$dist/$INCS");
-print STDERR "Total $file_total files.\n" if ($'vflag);
+print STDERR "[", &date, "] ", "(5) making file index ...\n" if ($vflag);
+$file_total = &makefileindex("$html/files.html", "$html/$INCS");
+print STDERR "Total $file_total files.\n" if ($vflag);
#
# [#] make a common part for mains.html and index.html
# USING @funcs @files
#
-print STDERR "[", &'date, "] ", "(#) making a common part ...\n" if ($'vflag);
+print STDERR "[", &date, "] ", "(#) making a common part ...\n" if ($vflag);
$index = &makecommonpart($title);
#
# (6)make index file (index.html)
#
-print STDERR "[", &'date, "] ", "(6) making index file ...\n" if ($'vflag);
-&makeindex("$dist/index.html", $title, $index);
+print STDERR "[", &date, "] ", "(6) making index file ...\n" if ($vflag);
+&makeindex("$html/index.html", $title, $index);
#
# (7) make main index (mains.html)
#
-print STDERR "[", &'date, "] ", "(7) making main index ...\n" if ($'vflag);
-&makemainindex("$dist/mains.html", $index);
-&makenullhtml("$dist/null.html") if ($'hflag);
+print STDERR "[", &date, "] ", "(7) making main index ...\n" if ($vflag);
+&makemainindex("$html/mains.html", $index);
#
# (#) make anchor database
#
-print STDERR "[", &'date, "] ", "(#) making temporary database ...\n" if ($'vflag);
+print STDERR "[", &date, "] ", "(#) making temporary database ...\n" if ($vflag);
&anchor'create();
#
# (8) make HTML files ($SRCS/*)
# USING TAG CACHE, %includes and anchor database.
#
-print STDERR "[", &'date, "] ", "(8) making hypertext from source code ...\n" if ($'vflag);
-&makehtml($dist, $file_total);
-&'clean();
-print STDERR "[", &'date, "] ", "Done.\n" if ($'vflag);
-if ($'cflag && $'vflag) {
- print STDERR "\n";
- print STDERR "[Information]\n";
- print STDERR "\n";
- print STDERR " You need to setup http server so that '*.ghtml' are treated\n";
- print STDERR " as gzipped files. Please see 'HTML/.htaccess.skel'.\n";
- print STDERR " Good luck!\n";
- print STDERR "\n";
-}
+print STDERR "[", &date, "] ", "(8) making hypertext from source code ...\n" if ($vflag);
+&makehtml($file_total);
+&clean();
+print STDERR "[", &date, "] ", "Done.\n" if ($vflag);
exit 0;
#-------------------------------------------------------------------------
# SUBROUTINES
@@ -479,7 +322,7 @@ exit 0;
sub makeprogram {
local($file) = @_;
- open(PROGRAM, ">$file") || &'error("cannot make CGI program.");
+ open(PROGRAM, ">$file") || &error("cannot make CGI program.");
$program = <<'END_OF_SCRIPT';
#!/usr/bin/perl
#------------------------------------------------------------------
@@ -489,7 +332,6 @@ sub makeprogram {
# SO THAT THIS SCRIPT CAN BE EXECUTED AS A CGI COMMAND. THANK YOU.
#------------------------------------------------------------------
$SRCS = 'S';
-$HTML = '@HTML@';
$SEP = ' '; # source file path must not include $SEP charactor
$ESCSEP = &escape($SEP);
sub escape {
@@ -497,7 +339,7 @@ sub escape {
'%' . sprintf("%x", ord($c));
}
print "Content-type: text/html\n\n";
-print "<HTML><BODY>\n";
+print "<HTML>\n";
@pairs = split (/&/, $ENV{'QUERY_STRING'});
foreach $p (@pairs) {
($name, $value) = split(/=/, $p);
@@ -507,7 +349,7 @@ foreach $p (@pairs) {
}
if ($form{'pattern'} eq '') {
print "<H3>Pattern not specified. <A HREF=../mains.html>[return]</A></H3>\n";
- print "</BODY></HTML>\n";
+ print "</HTML>\n";
exit 0;
}
$pattern = $form{'pattern'};
@@ -518,7 +360,7 @@ print "Following $words are matched to above pattern.<HR>\n";
$pattern =~ s/'//g; # to shut security hole
unless (open(PIPE, "/usr/bin/global -x$flag '$pattern' |")) {
print "<H3>Cannot execute global. <A HREF=../mains.html>[return]</A></H3>\n";
- print "</BODY></HTML>\n";
+ print "</HTML>\n";
exit 0;
}
$cnt = 0;
@@ -528,15 +370,14 @@ while (<PIPE>) {
local($tag, $lno, $filename) = split;
$filename =~ s/^\.\///;
$filename =~ s/\//$ESCSEP/g;
- s/($tag)/<A HREF=..\/$SRCS\/$filename.$HTML#$lno>$1<\/A>/;
+ s/($tag)/<A HREF=..\/$SRCS\/$filename.html#$lno>$1<\/A>/;
print;
}
-close(PIPE);
print "</PRE>\n";
if ($cnt == 0) {
print "<H3>Pattern not found. <A HREF=../mains.html>[return]</A></H3>\n";
}
-print "</BODY></HTML>\n";
+print "</HTML>\n";
exit 0;
#------------------------------------------------------------------
# SORRY TO HAVE SURPRISED YOU!
@@ -546,62 +387,17 @@ exit 0;
#------------------------------------------------------------------
END_OF_SCRIPT
- $program =~ s/\@HTML\@/$'HTML/g;
- print PROGRAM $program;
- close(PROGRAM);
-}
-#
-# makeghtml: make unzip script
-#
-sub makeghtml {
- local($file) = @_;
- open(PROGRAM, ">$file") || &'error("cannot make unzip script.");
- $program = <<'END_OF_SCRIPT';
-#!/bin/sh
-echo "content-type: text/html"
-echo
-gzip -S @HTML@ -d -c "$PATH_TRANSLATED"
-END_OF_SCRIPT
-
- $program =~ s/\@HTML\@/$'HTML/g;
print PROGRAM $program;
close(PROGRAM);
}
#
-# makehtaccess: make .htaccess skelton file.
-#
-sub makehtaccess {
- local($file) = @_;
- open(SKELTON, ">$file") || &'error("cannot make .htaccess skelton file.");
- $skelton = <<'END_OF_SCRIPT';
-#
-# Skelton file for .htaccess -- This file was generated by htags(1).
-#
-# Htags have made gzipped hypertext because you specified -c option.
-# You need to setup http server so that these hypertext can be treated
-# as gzipped files.
-# There are many way to do it, but one of the method is to put .htaccess
-# file in 'HTML' directory.
-#
-# Please rewrite XXX to the true value in your web site and rename this
-# file to '.htaccess' and http server read this.
-#
-AddHandler htags-gzipped-html ghtml
-Action htags-gzipped-html /XXX/cgi-bin/ghtml.cgi
-END_OF_SCRIPT
- print SKELTON $skelton;
- close(SKELTON);
-}
-#
# makehelp: make help file
#
sub makehelp {
local($file) = @_;
- open(HELP, ">$file") || &'error("cannot make help file.");
- print HELP $'begin_html;
- print HELP &'set_header(0, 'HELP');
- print HELP $'begin_body;
+ open(HELP, ">$file") || &error("cannot make help file.");
+ print HELP "<HTML>\n<HEAD><TITLE>HELP</TITLE></HEAD>\n<BODY>\n";
print HELP "<H2>Usage of Links</H2>\n";
print HELP "<PRE>/* [&lt;][&gt;][^][v] [top][bottom][index][help] */</PRE>\n";
print HELP "<DL>\n";
@@ -614,8 +410,7 @@ sub makehelp {
print HELP "<DT>[index]<DD>Return to index page (mains.html).\n";
print HELP "<DT>[help]<DD>You are seeing now.\n";
print HELP "</DL>\n";
- print HELP $'end_body;
- print HELP $'end_html;
+ print HELP "</BODY>\n</HTML>\n";
close(HELP);
}
#
@@ -630,33 +425,28 @@ sub makeline {
$_[0] =~ s/</&lt;/g;
$_[0] =~ s/>/&gt;/g;
local($tag, $lno, $filename) = split(/[ \t\n]+/, $_[0]);;
- $filename = &'path2url($filename);
- $_[0] =~ s/^$tag/<A HREF=..\/$'SRCS\/$filename#$lno>$tag<\/A>/;
+ $filename =~ s/\//$ESCSEP/g;
+ $_[0] =~ s/^$tag/<A HREF=..\/$SRCS\/$filename.html#$lno>$tag<\/A>/;
}
sub makedupindex {
- local($dist) = @_;
local($count) = 0;
foreach $db ('GRTAGS', 'GTAGS') {
local($kind) = $db eq 'GTAGS' ? "definitions" : "references";
- local($option) = $db eq 'GTAGS' ? '' : 'r';
local($prev) = '';
local($first_line);
local($writing) = 0;
$count = 0;
- local($command) = "global -nx$option '.*' | sort +0 -1 +2 -3 +1n -2";
- open(LIST, "$command |") || &'error("cannot fork.");
+ open(LIST, "btreeop $dbpath/$db | sort +0 -1 +2 -3 +1n -2|") || &error("btreeop $dbpath/$db | sort +0 -1 +2 -3 +1n -2 failed.");
while (<LIST>) {
chop;
local($tag, $lno, $filename) = split;
if ($prev ne $tag) {
$count++;
- print STDERR " [$count] adding $tag $kind.\n" if ($'vflag);
+ print STDERR " [$count] adding $tag $kind.\n" if ($vflag);
if ($writing) {
- print FILE "</PRE>\n";
- print FILE $'end_body;
- print FILE $'end_html;
+ print FILE "</PRE>\n</BODY>\n</HTML>\n";
close(FILE);
$writing = 0;
}
@@ -670,16 +460,10 @@ sub makedupindex {
# duplicate entry
if ($first_line) {
&cache'put($db, $tag, '');
- local($type) = ($db eq 'GTAGS') ? $'DEFS : $'REFS;
- if ($'cflag) {
- open(FILE, "| gzip -c >$dist/$type/$tag.$'HTML") || &'error("cannot make file '$dist/$type/$tag.$'HTML'.");
- } else {
- open(FILE, ">$dist/$type/$tag.$'HTML") || &'error("cannot make file '$dist/$type/$tag.$'HTML'.");
- }
+ local($type) = ($db eq 'GTAGS') ? $DEFS : $REFS;
+ open(FILE, ">$html/$type/$tag.html") || &error("cannot make file '$html/$type/$tag.html'.");
$writing = 1;
- print FILE $'begin_html;
- print FILE &'set_header(0, $tag);
- print FILE $'begin_body;
+ print FILE "<HTML>\n<HEAD><TITLE>$tag</TITLE></HEAD>\n<BODY>\n";
print FILE "<PRE>\n";
&makeline($first_line);
print FILE $first_line, "\n";
@@ -690,11 +474,8 @@ sub makedupindex {
}
}
close(LIST);
- if ($?) { &'error("'$command' failed."); }
if ($writing) {
- print FILE "</PRE>\n";
- print FILE $'end_body;
- print FILE $'end_html;
+ print FILE "</PRE>\n</BODY>\n</HTML>\n";
close(FILE);
}
if ($first_line) {
@@ -706,228 +487,174 @@ sub makedupindex {
#
# makefuncindex: make function index (including alphabetic index)
#
-# i) dist distribution directory
# i) file function index file
# i) total functions total
# gi) tag cache
# go) @funcs
#
sub makefuncindex {
- local($dist, $file, $total) = @_;
+ local($file, $total) = @_;
local($count) = 0;
- local($indexlink) = "../mains.$'HTML";
- open(FUNCTIONS, ">$file") || &'error("cannot make function index '$file'.");
- print FUNCTIONS $'begin_html;
- print FUNCTIONS &'set_header(0, 'FUNCTION INDEX', $'default_view);
- print FUNCTIONS $'begin_body;
+ open(FUNCTIONS, ">$file") || &error("cannot make function index '$file'.");
+ print FUNCTIONS "<HTML>\n<HEAD><TITLE>FUNCTION INDEX</TITLE>\n";
+ print FUNCTIONS "$begin_script$defaultview$end_script</HEAD>\n<BODY>\n";
print FUNCTIONS "<H2>FUNCTION INDEX</H2>\n";
- print FUNCTIONS "<OL>\n" if (!$'aflag);
+ print FUNCTIONS "<OL>\n" if (!$aflag);
local($old) = select(FUNCTIONS);
- local($command) = "global -c";
- open(TAGS, "$command |") || &'error("cannot fork.");
- local($alpha, $alpha_f);
+ open(TAGS, "btreeop -L $dbpath/GTAGS |") || &error("btreeop -L $dbpath/GTAGS failed.");
+ local($alpha) = '';
@funcs = (); # [A][B][C]...
while (<TAGS>) {
$count++;
chop;
local($tag) = $_;
- print STDERR " [$count/$total] adding $tag\n" if ($'vflag);
- if ($'aflag && ($alpha eq '' || $tag !~ /^$alpha/)) {
+ print STDERR " [$count/$total] adding $tag\n" if ($vflag);
+ if ($aflag && $alpha ne substr($tag, 0, 1)) {
if ($alpha) {
print ALPHA "</OL>\n";
- print ALPHA "<A HREF=$indexlink TARGET=_self>[index]</A>\n";
- print ALPHA "$'begin_script$'rewrite_href_funcs$'end_script";
- print ALPHA $'end_body;
- print ALPHA $'end_html;
+ print ALPHA "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
+ print ALPHA "$begin_script$rewrite_href_funcs$end_script";
+ print ALPHA "</BODY>\n</HTML>\n";
close(ALPHA);
}
- # for multi-byte code
- local($c0, $c1);
- $c0 = substr($tag, 0, 1);
- if (ord($c0) > 127) {
- $c1 = substr($tag, 1, 1);
- $alpha = $c0 . $c1;
- $alpha_f = "" . ord($c0) . ord($c1);
- } else {
- $alpha = $alpha_f = $c0;
- }
- push(@funcs, "<A HREF=funcs/$alpha_f.$'HTML TARGET=_self>[$alpha]</A>\n");
- if ($'cflag) {
- open(ALPHA, "| gzip -c >$dist/funcs/$alpha_f.$'HTML") || &'error("cannot make alphabetical function index.");
- } else {
- open(ALPHA, ">$dist/funcs/$alpha_f.$'HTML") || &'error("cannot make alphabetical function index.");
- }
- print ALPHA $'begin_html;
- print ALPHA &'set_header(0, $alpha, $'default_view);
- print ALPHA $'begin_body;
- print ALPHA "<H2>[$alpha]</H2>\n";
- print ALPHA "<A HREF=$indexlink TARGET=_self>[index]</A>\n";
+ $alpha = substr($tag, 0, 1);
+ push(@funcs, "<A HREF=funcs/$alpha.html TARGET=_self>[$alpha]</A>\n");
+ open(ALPHA, ">$html/funcs/$alpha.html") || &error("cannot make alphabetical function index.");
+ print ALPHA "<HTML>\n<HEAD><TITLE>$alpha</TITLE>\n";
+ print ALPHA "$begin_script$defaultview$end_script";
+ print ALPHA "</HEAD>\n<BODY>\n<H2>[$alpha]</H2>\n";
+ print ALPHA "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
print ALPHA "<OL>\n";
select(ALPHA);
}
local($line) = &cache'get('GTAGS', $tag);
if (!$line) {
- print "<LI><A HREF=", ($'aflag) ? "../" : "", "$'DEFS/$tag.$'HTML>$tag</A>\n";
+ print "<LI><A HREF=", ($aflag) ? "../" : "", "$DEFS/$tag.html>$tag</A>\n";
} else {
local($tag, $lno, $filename) = split(/[ \t]+/, $line);
- $filename = &'path2url($filename);
- print "<LI><A HREF=", ($'aflag) ? "../" : "", "$'SRCS/$filename#$lno>$tag</A>\n";
+ $filename =~ s/^\.\///;
+ $filename =~ s/\//$ESCSEP/g;
+ print "<LI><A HREF=", ($aflag) ? "../" : "", "$SRCS/$filename.html#$lno>$tag</A>\n";
}
}
close(TAGS);
- if ($?) { &'error("'$command' failed."); }
select($old);
- if ($'aflag) {
+ if ($aflag) {
print ALPHA "</OL>\n";
- print ALPHA "<A HREF=$indexlink TARGET=_self>[index]</A>\n";
- print ALPHA "$'begin_script$'rewrite_href_funcs$'end_script";
- print ALPHA $'end_body;
- print ALPHA $'end_html;
+ print ALPHA "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
+ print ALPHA "$begin_script$rewrite_href_funcs$end_script";
+ print ALPHA "</BODY>\n</HTML>\n";
close(ALPHA);
print FUNCTIONS @funcs;
}
- print FUNCTIONS "</OL>\n" if (!$'aflag);
- print FUNCTIONS $'end_body;
- print FUNCTIONS $'end_html;
+ print FUNCTIONS "</OL>\n" if (!$aflag);
+ print FUNCTIONS "</BODY>\n</HTML>\n";
close(FUNCTIONS);
$count;
}
#
# makefileindex: make file index
#
-# i) dist distribution directory
-# i) file file name
-# i) $incdir $INC directory
+# i) file name
+# i) $INC directory
# go) @files
# go) %includes
#
sub makefileindex {
- local($dist, $file, $incdir) = @_;
+ local($file, $incdir) = @_;
local($count) = 0;
- local($indexlink) = "../mains.$'HTML";
- local(@dirstack, @fdstack);
- local($command) = "gtags --find | sort";
- open(FIND, "$command |") || &'error("cannot fork.");
- open(FILES, ">$file") || &'error("cannot make file '$file'.");
- print FILES $'begin_html;
- print FILES &'set_header(0, 'FILE INDEX', $'default_view);
- print FILES $'begin_body;
- print FILES "<H2>FILE INDEX</H2>\n";
- print FILES "<OL>\n";
-
- local($org) = select(FILES);
- local(@push, @pop, $file);
+ open(FILES, ">$file") || &error("cannot make file '$file'.");
+ print FILES "<HTML>\n<HEAD><TITLE>FILES</TITLE>\n";
+ print FILES "$begin_script$defaultview$end_script";
+ print FILES "</HEAD>\n<BODY>\n<H2>FILE INDEX</H2>\n";
+ print FILES "<OL>\n";
+ local($old) = select(FILES);
+ open(FIND, "$findcom | sort |") || &error("cannot exec find.");
+ local($lastdir) = '';
+ @files = ();
while (<FIND>) {
+ next if /(y\.tab\.c|y\.tab\.h)$/;
+ next if /(\/SCCS\/|\/RCS\/)/;
+
$count++;
chop;
s/^\.\///;
- print STDERR " [$count] adding $_\n" if ($'vflag);
- @push = split('/');
- $file = pop(@push);
- @pop = @dirstack;
- while ($push[0] && $pop[0] && $push[0] eq $pop[0]) {
- shift @push;
- shift @pop;
+ local($filename) = $_;
+ print STDERR " [$count] adding $filename\n" if ($vflag);
+ local($dir);
+ if (index($filename, '/') >= 0) {
+ @split = split('/');
+ $dir = $split[0];
+ } else {
+ $dir = '';
}
- if (@push || @pop) {
- while (@pop) {
- pop(@dirstack);
- local($parent) = (@dirstack) ? &path2url(join('/', @dirstack)) : $indexlink;
- print "</OL>\n";
- print "<A HREF=$parent TARGET=_self>[..]</A>\n";
- print "$'begin_script$'rewrite_href_files$'end_script" if (@dirstack == 0);
- print $'end_body;
- print $'end_html;
- $path = pop(@fdstack);
- close($path);
- select($fdstack[$#fdstack]) if (@fdstack);
- pop(@pop);
+ #if ($dir && $dir ne $lastdir) {
+ if ($dir ne $lastdir) {
+ if ($lastdir) {
+ print DIR "</OL>\n";
+ print DIR "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
+ print DIR "$begin_script$rewrite_href_files$end_script";
+ print DIR "</BODY>\n</HTML>\n";
+ close(DIR);
}
- while (@push) {
- local($parent) = (@dirstack) ? &path2url(join('/', @dirstack)) : $indexlink;
- push(@dirstack, shift @push);
- $path = join('/', @dirstack);
- $cur = "$dist/files/" . &path2file($path);
- local($li) = "<LI><A HREF=" . (@dirstack == 1 ? 'files/' : '') . &path2url($path) . " TARGET=_self>$path/</A>\n";
- if (@dirstack == 1) {
- push(@files, $li);
- } else {
- print $li;
- }
- if ($'cflag) {
- open($cur, "| gzip -c >'$cur'") || &'error("cannot make directory index.");
- } else {
- open($cur, ">$cur") || &'error("cannot make directory index.");
- }
- select($cur);
- push(@fdstack, $cur);
- print $'begin_html;
- print &'set_header(0, "$path", $'default_view);
- print $'begin_body;
- print "<H2>$path/</H2>\n";
- print "<A HREF=$parent TARGET=_self>[..]</A>\n";
- print "<OL>\n";
+ if ($dir) {
+ push(@files, "<LI><A HREF=files/$dir.html TARGET=_self>$dir/</A>\n");
+ open(DIR, ">$html/files/$dir.html") || &error("cannot make directory index.");
+ print DIR "<HTML>\n<HEAD><TITLE>$dir/</TITLE>\n";
+ print DIR "$begin_script$defaultview$end_script";
+ print DIR "</HEAD>\n<BODY>\n<H2>$dir/</H2>\n";
+ print DIR "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
+ print DIR "<OL>\n";
}
+ $lastdir = $dir;
}
# collect include files.
- if (/.*\.h$/) {
- if (! defined $includes{$file}) {
- $includes{$file} = $_;
+ if ($filename =~ /.*\.h$/) {
+ local($last) = $filename;
+ $last =~ s!.*/!!;
+ if (! defined $includes{$last}) {
+ $includes{$last} = $filename;
} else {
# duplicate entries
- $includes{$file} = "$includes{$file}\n$_";
+ $includes{$last} = "$includes{$last}\n$filename";
}
}
- local($url) = &path2url($_);
- local($li) = "<LI><A HREF=" . (@dirstack == 0 ? '' : '../') . "S/$url>$_</A>\n";
- if (@dirstack == 0) {
- push(@files, $li);
+ local($path) = $filename;
+ $path =~ s/\//$ESCSEP/g;
+ if ($dir eq '') {
+ push(@files, "<LI><A HREF=$SRCS/$path.html>$filename</A>\n");
} else {
- print $li;
+ print DIR "<LI><A HREF=../$SRCS/$path.html>$filename</A>\n";
}
}
close(FIND);
- while (@dirstack) {
- pop(@dirstack);
- local($parent) = (@dirstack) ? &path2url(join('/', @dirstack)) : $indexlink;
- print "</OL>\n";
- print "<A HREF=$parent TARGET=_self>[..]</A>\n";
- print "$'begin_script$'rewrite_href_files$'end_script" if (@dirstack == 0);
- print $'end_body;
- print $'end_html;
- $path = pop(@fdstack);
- close($path);
- select($fdstack[$#fdstack]) if (@fdstack);
+ select($old);
+ if ($lastdir) {
+ print DIR "</OL>\n";
+ print DIR "<A HREF=../mains.html TARGET=_self>[index]</A>\n";
+ print DIR "$begin_script$rewrite_href_files$end_script";
+ print DIR "</BODY>\n</HTML>\n";
+ close(DIR);
}
print FILES @files;
print FILES "</OL>\n";
- print FILES $'end_body;
- print FILES $'end_html;
- close(FILES);
+ print FILES "</BODY>\n</HTML>\n";
+ close(FILES);
- select($org);
foreach $last (keys %includes) {
local(@incs) = split(/\n/, $includes{$last});
if (@incs > 1) {
- if ($'cflag) {
- open(INCLUDE, "| gzip -c >$incdir/$last.$'HTML") || &'error("cannot open file '$incdir/$last.$'HTML'.");
- } else {
- open(INCLUDE, ">$incdir/$last.$'HTML") || &'error("cannot open file '$incdir/$last.$'HTML'.");
- }
- print INCLUDE $'begin_html;
- print INCLUDE &'set_header(0, $last);
- print INCLUDE $'begin_body;
- print INCLUDE "<PRE>\n";
+ open(INCLUDE, ">$incdir/$last.html") || &error("cannot open file '$incdir/$last.html'.");
+ print INCLUDE "<HTML>\n<HEAD><TITLE>$last</TITLE></HEAD>\n<BODY>\n<PRE>\n";
foreach $filename (@incs) {
- local($path) = &'path2url($filename);
- print INCLUDE "<A HREF=../$'SRCS/$path>$filename</A>\n";
+ local($path) = $filename;
+ $path =~ s/\//$ESCSEP/g;
+ print INCLUDE "<A HREF=../$SRCS/$path.html>$filename</A>\n";
}
- print INCLUDE "</PRE>\n";
- print INCLUDE $'end_body;
- print INCLUDE $'end_html;
+ print INCLUDE "</PRE>\n</BODY>\n</HTML>\n";
close(INCLUDE);
# '' means that information already written to file.
$includes{$last} = '';
@@ -945,18 +672,18 @@ sub makecommonpart {
local($title) = @_;
local($index) = '';
- $index .= "<H1>$'title_begin$'title$'title_end</H1>\n";
+ $index .= "<H1><FONT COLOR=#cc0000>$title</FONT></H1>\n";
$index .= "<P ALIGN=right>";
- $index .= "Last updated " . &'date . "<BR>\n";
- $index .= "This hypertext was generated by <A HREF=http://wafu.netgate.net/tama/unix/global.html TARGET=_top>GLOBAL</A>.<BR>\n";
- $index .= $'begin_script;
- $index .= "if (parent.frames.length && parent.mains == self)\n";
- $index .= " document.write($'langle+'A HREF=mains.html TARGET=_top'+$'rangle+'[No frame version is here.]'+$'langle+'/A'+$'rangle)\n";
- $index .= $'end_script;
+ $index .= "Last updated " . &date . "<BR>\n";
+ $index .= "This hypertext was generated by <A HREF=http://wafu.netgate.net/tama/unix/indexe.html#global TARGET=_top>GLOBAL</A>.<BR>\n";
+ $index .= "$begin_script";
+ $index .= "if (parent.frames.length && parent.$f_mains == self)\n";
+ $index .= " document.write($langle+'A HREF=mains.html TARGET=_top'+$rangle+'[No frame version is here.]'+$langle+'/A'+$rangle)\n";
+ $index .= "$end_script";
$index .= "</P>\n<HR>\n";
- if ($'fflag) {
+ if ($fflag) {
$index .= "<H2>FUNCTION SEARCH</H2>\n";
- $index .= "Please input function name and select [Search]. POSIX's regular expression is allowed.<P>\n";
+ $index .= "Please input function name and select [Search]. Perl's regular expression is allowed.<P>\n";
$index .= "<FORM METHOD=GET ACTION=cgi-bin/global.cgi>\n";
$index .= "<INPUT NAME=pattern>\n";
$index .= "<INPUT TYPE=submit VALUE=Search>\n";
@@ -967,19 +694,18 @@ sub makecommonpart {
}
$index .= "<H2>MAINS</H2>\n";
$index .= "<PRE>\n";
- local($command) = "global -nx main | sort +0 -1 +2 -3 +1n -2";
- open(PIPE, "$command |") || &'error("cannot fork.");
+ open(PIPE, "btreeop -K main $dbpath/GTAGS | sort +0 -1 +2 -3 +1n -2|") || &error("btreeop -K main $dbpath/GTAGS failed.");
while (<PIPE>) {
local($nouse, $lno, $filename) = split;
$nouse = ''; # to make perl quiet
- $filename = &'path2url($filename);
- s/(main)/<A HREF=$'SRCS\/$filename#$lno>$1<\/A>/;
+ $filename =~ s/^\.\///;
+ $filename =~ s/\//$ESCSEP/g;
+ s/(main)/<A HREF=$SRCS\/$filename.html#$lno>$1<\/A>/;
$index .= $_;
}
close(PIPE);
- if ($?) { &'error("'$command' failed."); }
$index .= "</PRE>\n<HR>\n<H2>FUNCTIONS</H2>\n";
- if ($'aflag) {
+ if ($aflag) {
foreach $f (@funcs) {
$index .= $f;
}
@@ -1004,25 +730,17 @@ sub makecommonpart {
sub makeindex {
local($file, $title, $index) = @_;
- open(FRAME, ">$file") || &'error("cannot open file '$file'.");
- print FRAME $'begin_html;
- print FRAME "<HEAD><TITLE>$title</TITLE></HEAD>\n";
+ open(FRAME, ">$file") || &error("cannot open file '$file'.");
+ print FRAME "<HTML>\n<HEAD><TITLE>$title</TITLE></HEAD>\n";
print FRAME "<FRAMESET COLS='200,*'>\n";
+ print FRAME "<NOFRAME>\n$index</NOFRAME>\n";
print FRAME "<FRAMESET ROWS='50%,50%'>\n";
- print FRAME "<FRAME NAME=funcs SRC=funcs.html>\n";
- print FRAME "<FRAME NAME=files SRC=files.html>\n";
+ print FRAME "<FRAME NAME=$f_funcs SRC=funcs.html>\n";
+ print FRAME "<FRAME NAME=$f_files SRC=files.html>\n";
print FRAME "</FRAMESET>\n";
- if ($'hflag) {
- print FRAME "<FRAMESET ROWS='50,*'>\n";
- print FRAME "<FRAME NAME=title SRC=null.html BORDER=0 SCROLLING=no>\n";
- print FRAME "<FRAME NAME=mains SRC=mains.html BORDER=0>\n";
- print FRAME "</FRAMESET>\n";
- } else {
- print FRAME "<FRAME NAME=mains SRC=mains.html>\n";
- }
- print FRAME "<NOFRAMES>\n$index</NOFRAMES>\n";
+ print FRAME "<FRAME NAME=$f_mains SRC=mains.html>\n";
print FRAME "</FRAMESET>\n";
- print FRAME $'end_html;
+ print FRAME "</HTML>\n";
close(FRAME);
}
#
@@ -1034,48 +752,34 @@ sub makeindex {
sub makemainindex {
local($file, $index) = @_;
- open(INDEX, ">$file") || &'error("cannot create file '$file'.");
- print INDEX $'begin_html;
- print INDEX &'set_header(1, $title);
- print INDEX $'begin_body;
- print INDEX $index;
- print INDEX $'end_body;
- print INDEX $'end_html;
+ open(INDEX, ">$file") || &error("cannot create file '$file'.");
+ print INDEX "<HTML>\n<HEAD><TITLE>MAINS</TITLE></HEAD>\n";
+ print INDEX "<BODY>\n$index</BODY>\n</HTML>\n";
close(INDEX);
}
#
-# makenullhtml: make null html
-#
-# i) $file file name
-#
-sub makenullhtml {
- local($file) = @_;
-
- open(NULL, ">$file") || &'error("cannot create file '$file'.");
- print NULL "<HTML><BODY></BODY></HTML>\n";
- close(NULL);
-}
-#
# makehtml: make html files
#
# i) total number of files.
#
sub makehtml {
- local($dist, $total) = @_;
+ local($total) = @_;
local($count) = 0;
- open(FIND, "$'findcom |") || &'error("cannot fork.");
+ open(FIND, "$findcom |") || &error("cannot exec find.");
while (<FIND>) {
- chop;
+ next if /y\.tab\.c|y\.tab\.h/;
+ next if /(\/SCCS\/|\/RCS\/)/;
+
$count++;
+ chop;
local($path) = $_;
$path =~ s/^\.\///;
- print STDERR " [$count/$total] converting $_\n" if ($'vflag);
- $path = &'path2file($path);
- &convert'src2html($_, "$dist/$'SRCS/$path");
+ print STDERR " [$count/$total] converting $path\n" if ($vflag);
+ $path =~ s/\//$SEP/g;
+ &convert'src2html($_, "$html/$SRCS/$path.html");
}
close(FIND);
- if ($?) { &'error("cannot traverse directory."); }
}
#=========================================================================
# CONVERT PACKAGE
@@ -1085,38 +789,29 @@ package convert;
# src2html: convert source code into HTML
#
# i) $file source file - Read from
-# i) $hfile HTML file - Write to
+# i) $html HTML file - Write to
# gi) %includes
# pairs of include file and the path
#
sub src2html {
- local($file, $hfile) = @_;
+ local($file, $html) = @_;
local($ncol) = $'ncol;
- local($tabs) = $'tabs;
+ local($expand) = &'usable('expand') ? 'expand' : 'cat';
local(%ctab) = ('&', '&amp;', '<', '&lt;', '>', '&gt;');
- local($expand) = &'usable('expand') ? 'expand' : 'gtags --expand';
- local($isjava) = ($file =~ /\.java$/) ? 1 : 0;
- local($reserved_words) = ($isjava) ? $'java_reserved_words : $'c_reserved_words;
- if ($'cflag) {
- open(HTML, "| gzip -c >'$hfile'") || &'error("cannot create file '$hfile'.");
- } else {
- open(HTML, ">$hfile") || &'error("cannot create file '$hfile'.");
- }
+ open(HTML, ">$html") || &'error("cannot create file '$html'.");
local($old) = select(HTML);
#
# load tags belonging to this file.
#
&anchor'load($file);
- open(SRC, "$expand -$tabs '$file' |") || &'error("cannot fork.");
+ open(C, "$expand '$file' |") || &'error("cannot open file '$file'.");
#
# print the header
#
$file =~ s/^\.\///;
- print $'begin_html;
- print &'set_header(1, $file);
- print $'begin_body;
- print "<A NAME=TOP><H2>$file</H2>\n";
+ print "<HTML>\n<HEAD><TITLE>$file</TITLE></HEAD>\n";
+ print "<BODY><A NAME=TOP><H2>$file</H2>\n";
print &link_format(&anchor'getlinks(0));
print "\n<HR>\n";
print "<H2>FUNCTIONS</H2>\n";
@@ -1134,23 +829,24 @@ sub src2html {
print "<PRE>\n";
$INCOMMENT = 0; # initial status is out of comment
local($LNO, $TAG, $TYPE) = &anchor'first();
- while (<SRC>) {
+ while (<C>) {
local($converted);
s/\r$//;
# make link for include file
if (!$INCOMMENT && /^#include/) {
local($last, $sep) = m![</"]([^</"]+)([">])!;
+ local($link);
if (defined $'includes{$last}) {
- local($link, $suffix);
if ($'includes{$last}) {
- $link = &'path2url($'includes{$last});
+ $link = $'includes{$last};
+ $link =~ s/\//$'ESCSEP/g;
} else {
- $link = "../$'INCS/$last.$'HTML";
+ $link = "../$'INCS/$last";
}
if ($sep eq '"') {
- s!"(.*$last)"!"<A HREF=$link>$1</A>"!;
+ s!"(.*$last)"!"<A HREF=$link.html>$1</A>"!;
} else {
- s!<(.*$last)>!&lt;<A HREF=$link>$1</A>&gt;!;
+ s!<(.*$last)>!&lt;<A HREF=$link.html>$1</A>&gt;!;
}
$converted = 1;
}
@@ -1161,7 +857,7 @@ sub src2html {
# painting source code
s/({|})/$'brace_begin$1$'brace_end/g;
local($sharp) = s/^(#\w+)// ? $1 : '';
- s/\b($reserved_words)\b/$'reserved_begin$1$'reserved_end/go if ($sharp ne '#include');
+ s/\b($'reserved_words)\b/$'reserved_begin$1$'reserved_end/go if ($sharp ne '#include');
s/^/$'sharp_begin$sharp$'sharp_end/ if ($sharp); # recover macro
local($define_line) = 0;
@@ -1186,28 +882,19 @@ sub src2html {
if ($line) {
local($nouse, $lno, $filename) = split(/[ \t]+/, $line);
$nouse = ''; # to make perl quiet
- $filename = &'path2url($filename);
- $href = "<A HREF=../$'SRCS/$filename#$lno>$TAG</A>";
+ $filename =~ s/^\.\///;
+ $filename =~ s/\//$'ESCSEP/g;
+ $href = "<A HREF=../$'SRCS/$filename.html#$lno>$TAG</A>";
} else {
local($dir) = ($TYPE eq 'D') ? $'REFS : $'DEFS;
- $href = "<A HREF=../$dir/$TAG.$'HTML>$TAG</A>";
+ $href = "<A HREF=../$dir/$TAG.html>$TAG</A>";
}
# set tag marks and save hyperlink into @links
- if (ord($TAG) > 127) { # for multi-byte code
- if (s/([\x00-\x7f])$TAG([ \t]*\()/$1\005$count\005$2/ || s/([\x00-\x7f])$TAG([\x00-\x7f])/$1\005$count\005$2/) {
- $count++;
- push(@links, $href);
- } else {
- print STDERR "Error: $file $LNO $TAG($TYPE) tag must exist.\n" if ($'wflag);
- }
+ if (s/\b$TAG\b/\005$count\005/ || s/\b_$TAG\b/_\005$count\005/) {
+ $count++;
+ push(@links, $href);
} else {
- if (s/\b$TAG([ \t]*\()/\005$count\005$1/ || s/\b$TAG\b/\005$count\005/ || s/\b_$TAG\b/_\005$count\005/)
- {
- $count++;
- push(@links, $href);
- } else {
- print STDERR "Error: $file $LNO $TAG($TYPE) tag must exist.\n" if ($'wflag);
- }
+ print STDERR "Error: $file $LNO $TAG($TYPE) tag must exist.\n" if ($'wflag);
}
} else {
print STDERR "Warning: $file $LNO $TAG($TYPE) found but not referred.\n" if ($'wflag);
@@ -1226,7 +913,7 @@ sub src2html {
printf "%${ncol}d ", $. if ($'nflag);
print;
# print hyperlinks
- if ($define_line) {
+ if ($define_line && $file !~ /\.h$/) {
print ' ' x ($ncol + 1) if ($'nflag);
print &link_format(&anchor'getlinks($define_line));
print "\n";
@@ -1237,10 +924,8 @@ sub src2html {
print "<A NAME=BOTTOM>\n";
print &link_format(&anchor'getlinks(-1));
print "\n";
- print $'end_body;
- print $'end_html;
- close(SRC);
- if ($?) { &'error("cannot open file '$file'."); }
+ print "</BODY>\n</HTML>\n";
+ close(C);
close(HTML);
select($old);
@@ -1254,7 +939,6 @@ sub src2html {
# \002 quoted('') char
# \003 quoted string
# \004 comment
-# \005 line comment
# \032 temporary mark
#
sub protect_line {
@@ -1291,13 +975,6 @@ sub protect_line {
last if ($INCOMMENT);
}
}
- $line_comment = '';
- if (s!(//.*)$!\005!) {
- $line_comment = $1;
- # ^ // /* $
- # (1) (2) ... (1) invalidate (2).
- $INCOMMENT = 0;
- }
}
#
# unprotect_line: recover quoted strings
@@ -1307,12 +984,8 @@ sub protect_line {
sub unprotect_line {
local($s);
- if ($line_comment) {
- s/\005/$'comment_begin$line_comment$'comment_end/;
- }
while (@comments) {
$s = shift @comments;
- # nested tag can be occured but no problem.
s/\004/$'comment_begin$s$'comment_end/;
}
while (@quoted_strings) {
@@ -1365,15 +1038,12 @@ sub create {
open(ANCH, ">$ANCH") || &'error("cannot create file '$ANCH'.");
close(ANCH);
chmod ($ANCH, 0600);
- local($command) = "btreeop -C $ANCH";
- open(ANCH, "| $command") || &'error("cannot fork.");
+ open(ANCH, "| btreeop -C $ANCH") || &'error("btreeop -C $ANCH failed.");
local($fcount) = 1;
local($fnumber);
foreach $db ('GTAGS', 'GRTAGS') {
local($type) = ($db eq 'GTAGS') ? 'D' : 'R';
- local($option) = ($db eq 'GTAGS') ? '' : 'r';
- local($command) = "global -nx$option '.*'";
- open(PIPE, "$command |") || &'error("cannot fork.");
+ open(PIPE, "btreeop $'dbpath/$db |") || &'error("btreeop $'dbpath/$db failed.");
while (<PIPE>) {
local($tag, $lno, $filename) = split;
$fnumber = $PATHLIST{$filename};
@@ -1383,10 +1053,8 @@ sub create {
print ANCH "$fnumber $lno $tag $type\n";
}
close(PIPE);
- if ($?) { &'error("'$command' failed."); }
}
close(ANCH);
- if ($?) { &'error("'$command' failed."); }
}
#
# finish: remove anchors database
@@ -1395,7 +1063,7 @@ sub finish {
unlink("$ANCH") if (defined($ANCH));
}
#
-# load: load anchors belonging to specified file.
+# load: load anchors in a file from database
#
# i) $file source file
# gi) %PATHLIST
@@ -1413,15 +1081,15 @@ sub load {
if (!($fnumber = $PATHLIST{$file})) {
return;
}
- local($command) = "btreeop -K $fnumber $ANCH";
- open(ANCH, "$command |") || &'error("cannot fork.");
+ open(ANCH, "btreeop -K $fnumber $ANCH |") || &'error("btreeop -K $file $ANCH failed.");
+$n = 0;
while (<ANCH>) {
local($fnumber, $lno, $tag, $type) = split;
local($line);
# don't refer to macros which is defined in other C source.
if ($type eq 'R' && ($line = &cache'get('GTAGS', $tag))) {
local($nouse1, $nouse2, $f, $def) = split(/[ \t]+/, $line);
- if ($f !~ /\.h$/ && $f ne $file && $def =~ /^#/) {
+ if ($f !~ /\.h$/ && $f !~ $file && $def =~ /^#/) {
print STDERR "Information: $file $lno $tag($type) skipped, because this is a macro which is defined in other C source.\n" if ($'wflag);
next;
}
@@ -1429,7 +1097,6 @@ sub load {
push(@ANCHORS, "$lno,$tag,$type");
}
close(ANCH);
- if ($?) {&'error("'$command' failed."); }
local(@keys);
foreach (@ANCHORS) {
push(@keys, (split(/,/))[0]);
diff --git a/contrib/global/lib/Makefile b/contrib/global/lib/Makefile
index 83d8be057d41..99d49efabddc 100644
--- a/contrib/global/lib/Makefile
+++ b/contrib/global/lib/Makefile
@@ -1,9 +1,8 @@
-LIB= gloutil
-SRCS= gtagsop.c tab.c strbuf.c mgets.c defined.c getdbpath.c \
- find.c dbop.c test.c makepath.c locatestring.c pathop.c \
- conf.c strmake.c usable.c token.c
-NOPROFILE= noprofile
-INTERNALLIB= true
-INTERNALSTATICLIB= true
+LIB= util
+SRCS= tag.o tab.o strop.o mgets.o lookup.o gtagsopen.o getdbpath.o \
+ find.o dbname.o dbio.o test.o makepath.o locatestring.o
+NOPROFILE= yes
+install:
+ @echo -n
.include <bsd.lib.mk>
diff --git a/contrib/global/lib/conf.c b/contrib/global/lib/conf.c
deleted file mode 100644
index 887663d71e25..000000000000
--- a/contrib/global/lib/conf.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * conf.c 30-Jun-98
- *
- */
-#include <sys/param.h>
-#include <assert.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "conf.h"
-#include "die.h"
-#include "gparam.h"
-#include "locatestring.h"
-#include "makepath.h"
-#include "mgets.h"
-#include "strbuf.h"
-#include "strmake.h"
-#include "test.h"
-/*
- * Access library for gtags.conf (.gtagsrc).
- * File format is a subset of XXXcap (termcap, printcap) file.
- */
-#define GTAGSCONF "/etc/global.conf"
-#define GTAGSRC ".globalrc"
-#define DEFAULTLABEL "default"
-static FILE *fp;
-static char *line;
-static int allowed_nest_level = 8;
-static int opened;
-
-static void trim __P((char *));
-static char *readrecord __P((const char *));
-static void includelabel __P((STRBUF *, const char *, int));
-
-static void
-trim(l)
-char *l;
-{
- char *f, *b;
- int colon = 0;
-
- for (f = b = l; *f; f++) {
- if (colon && isspace(*f))
- continue;
- colon = 0;
- if ((*b++ = *f) == ':')
- colon = 1;
- }
- *b = 0;
-}
-static char *
-readrecord(label)
-const char *label;
-{
- char *p, *q;
-
- rewind(fp);
- while ((p = mgets(fp, NULL, MGETS_CONT|MGETS_SKIPCOM)) != NULL) {
- trim(p);
- for (;;) {
- if ((q = strmake(p, "|:")) == NULL)
- die1("illegal configuration file format (%s).", p);
- if (!strcmp(label, q)) {
- if (!(p = locatestring(p, ":", MATCH_FIRST)))
- die("illegal configuration file format.");
- p = strdup(p);
- if (!p)
- die("short of memory.");
- return p;
- }
- p += strlen(q);
- if (*p == ':')
- break;
- else if (*p == '|')
- p++;
- else
- assert(0);
- }
- }
- return NULL;
-}
-static void
-includelabel(sb, label, level)
-STRBUF *sb;
-const char *label;
-int level;
-{
- char *savep, *p, *q;
-
- if (++level > allowed_nest_level)
- die("nested include= (or tc=) over flow.");
- if (!(savep = p = readrecord(label)))
- die1("label '%s' not found.", label);
- while ((q = locatestring(p, ":include=", MATCH_FIRST)) || (q = locatestring(p, ":tc=", MATCH_FIRST))) {
- char inclabel[MAXPROPLEN+1], *c = inclabel;
-
- strnputs(sb, p, q - p);
- q = locatestring(q, "=", MATCH_FIRST) + 1;
- while (*q && *q != ':')
- *c++ = *q++;
- *c = 0;
- includelabel(sb, inclabel, level);
- p = q;
- }
- strputs(sb, p);
- free(savep);
-}
-/*
- * configpath: get path of configuration file.
- */
-char *
-configpath() {
- static char config[MAXPATHLEN+1];
- char *p;
-
- if ((p = getenv("GTAGSCONF")) != NULL) {
- if (!test("r", p))
- config[0] = 0;
- else
- strcpy(config, p);
- } else if ((p = getenv("HOME")) && test("r", makepath(p, GTAGSRC)))
- strcpy(config, makepath(p, GTAGSRC));
- else if (test("r", GTAGSCONF))
- strcpy(config, GTAGSCONF);
- else
- config[0] = 0;
- return config;
-}
-/*
- * openconf: load configuration file.
- *
- * go) line specified entry
- */
-void
-openconf()
-{
- const char *label, *config;
- STRBUF *sb;
-
- assert(opened == 0);
-
- config = configpath();
- /*
- * if configuration file is not found, default values are set
- * for upper compatibility.
- */
- if (*config == 0) {
- sb = stropen();
- strputs(sb, "suffixes=c,h,y,s,S,java:");
- strputs(sb, "skip=y.tab.c,y.tab.h,SCCS/,RCS/,CVS/:");
- strputs(sb, "format=standard:");
- strputs(sb, "extractmethod:");
- strputs(sb, "GTAGS=gctags %s:");
- strputs(sb, "GRTAGS=gctags -r %s:");
- strputs(sb, "GSYMS=gctags -s %s:");
- line = strdup(strvalue(sb));
- if (!line)
- die("short of memory.");
- strclose(sb);
- opened = 1;
- return;
- }
- if ((label = getenv("GTAGSLABEL")) == NULL)
- label = "default";
- if (!(fp = fopen(config, "r")))
- die1("cannot open '%s'.", config);
- sb = stropen();
- includelabel(sb, label, 0);
- line = strdup(strvalue(sb));
- strclose(sb);
- fclose(fp);
- opened = 1;
- return;
-}
-/*
- * getconfn: get property number
- *
- * i) name property name
- * o) num value (if not NULL)
- * r) 1: found, 0: not found
- */
-int
-getconfn(name, num)
-const char *name;
-int *num;
-{
- char *p;
- char buf[MAXPROPLEN+1];
-
- if (!opened)
- openconf();
- sprintf(buf, ":%s#", name);
- if ((p = locatestring(line, buf, MATCH_FIRST)) != NULL) {
- p += strlen(buf);
- if (num != NULL)
- *num = atoi(p);
- return 1;
- }
- return 0;
-}
-/*
- * getconfs: get property string
- *
- * i) name property name
- * o) sb string buffer (if not NULL)
- * r) 1: found, 0: not found
- */
-int
-getconfs(name, sb)
-const char *name;
-STRBUF *sb;
-{
- char *p;
- char buf[MAXPROPLEN+1];
- int all = 0;
- int exist = 0;
-
- if (!opened)
- openconf();
- if (!strcmp(name, "suffixes") || !strcmp(name, "skip") || !strcmp(name, "reserved_words"))
- all = 1;
- sprintf(buf, ":%s=", name);
- p = line;
- while ((p = locatestring(p, buf, MATCH_FIRST)) != NULL) {
- if (exist && sb)
- strputc(sb, ',');
- exist = 1;
- for (p += strlen(buf); *p && *p != ':'; p++)
- if (sb)
- strputc(sb, *p);
- if (!all)
- break;
- }
- /*
- * It may be that these code should be moved to applications.
- * But nothing cannot start without them.
- */
- if (!exist) {
- exist = 1;
- if (!strcmp(name, "suffixes")) {
- if (sb)
- strputs(sb, "c,h,y,s,S,java");
- } else if (!strcmp(name, "skip")) {
- if (sb)
- strputs(sb, "y.tab.c,y.tab.h,SCCS/,RCS/,CVS/");
- } else
- exist = 0;
- }
- return exist;
-}
-/*
- * getconfb: get property bool value
- *
- * i) name property name
- * r) 1: TRUE, 0: FALSE
- */
-int
-getconfb(name)
-const char *name;
-{
- char *p;
- char buf[MAXPROPLEN+1];
-
- if (!opened)
- openconf();
- sprintf(buf, ":%s:", name);
- if ((p = locatestring(line, buf, MATCH_FIRST)) != NULL)
- return 1;
- return 0;
-}
-void
-closeconf()
-{
- if (!opened)
- return;
- free(line);
- opened = 0;
-}
diff --git a/contrib/global/lib/conf.h b/contrib/global/lib/conf.h
deleted file mode 100644
index 9317d9ff8726..000000000000
--- a/contrib/global/lib/conf.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * conf.h 16-Oct-97
- *
- */
-
-#ifndef _CONF_H_
-#define _CONF_H_
-
-#include "strbuf.h"
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-char *configpath __P((void));
-void openconf __P((void));
-int getconfn __P((const char *, int *));
-int getconfs __P((const char *, STRBUF *));
-int getconfb __P((const char *));
-void closeconf __P((void));
-
-#endif /* ! _CONF_H_ */
diff --git a/contrib/global/lib/dbio.c b/contrib/global/lib/dbio.c
new file mode 100644
index 000000000000..c29a91477bdb
--- /dev/null
+++ b/contrib/global/lib/dbio.c
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
+ *
+ * Redilogibution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redilogibutions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redilogibutions 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 dilogibution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * dbio.c 14-Dec-97
+ *
+ */
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "dbio.h"
+#include "die.h"
+#include "test.h"
+
+DBT key; /* key of record */
+DBT dat; /* data of record */
+/*
+ * db_open: open db database.
+ *
+ * i) dbname database name
+ * i) mode 0: read only, 1: write only, 2: read & write
+ * i) perm file permission
+ * i) flags
+ * DBIO_DUP: allow duplicate records.
+ * DBIO_REMOVE: remove on closed.
+ * r) descripter for db_xxx()
+ *
+ * db_open leaves database permission 0600. please chmod(2) to make public.
+ */
+DBIO *
+db_open(dbname, mode, perm, flags)
+char *dbname;
+int mode;
+int perm;
+int flags;
+{
+ DB *db;
+ int rw;
+ BTREEINFO info;
+ DBIO *dbio;
+
+ /*
+ * setup argments.
+ */
+ if (mode == 0)
+ rw = O_RDONLY;
+ else if (mode == 1)
+ rw = O_RDWR|O_CREAT|O_TRUNC;
+ else if (mode == 2)
+ rw = O_RDWR;
+ else
+ die("db_open illegal mode.");
+ info.flags = (flags & DBIO_DUP) ? R_DUP : 0;
+ info.cachesize = 500000;
+ info.maxkeypage = 0;
+ info.minkeypage = 0;
+ info.psize = 0;
+ info.compare = NULL;
+ info.prefix = NULL;
+ info.lorder = LITTLE_ENDIAN;
+
+ /*
+ * if unlink do job normally, those who already open tag file can use
+ * it until closing.
+ */
+ if (mode == 1 && test("f", dbname))
+ (void)unlink(dbname);
+ db = dbopen(dbname, rw, 0600, DB_BTREE, &info);
+ if (!db)
+ die1("db_open failed (dbname = %s).", dbname);
+ if (!(dbio = (DBIO *)malloc(sizeof(DBIO))))
+ die("short of memory.");
+ strcpy(dbio->dbname, dbname);
+ dbio->db = db;
+ dbio->openflags = flags;
+ dbio->perm = (mode == 1) ? perm : 0;
+ dbio->lastkey = (char *)0;
+ dbio->lastdat = (char *)0;
+
+ return dbio;
+}
+/*
+ * db_get: get data by a key.
+ *
+ * i) dbio descripter
+ * i) k key
+ * r) pointer to data
+ */
+char *
+db_get(dbio, k)
+DBIO *dbio;
+char *k;
+{
+ DB *db = dbio->db;
+ int status;
+
+ key.data = k;
+ key.size = strlen(k)+1;
+
+ status = (*db->get)(db, &key, &dat, 0);
+ dbio->lastkey = (char *)key.data;
+ dbio->lastdat = (char *)dat.data;
+ switch (status) {
+ case RET_SUCCESS:
+ break;
+ case RET_ERROR:
+ die("db_get failed.");
+ case RET_SPECIAL:
+ return((char *)0);
+ }
+ return((char *)dat.data);
+}
+/*
+ * db_put: put data by a key.
+ *
+ * i) dbio descripter
+ * i) k key
+ * i) d data
+ */
+void
+db_put(dbio, k, d)
+DBIO *dbio;
+char *k;
+char *d;
+{
+ DB *db = dbio->db;
+ int status;
+
+ if (strlen(k) > MAXKEYLEN)
+ die("primary key too long.");
+ key.data = k;
+ key.size = strlen(k)+1;
+ dat.data = d;
+ dat.size = strlen(d)+1;
+
+ status = (*db->put)(db, &key, &dat, 0);
+ switch (status) {
+ case RET_SUCCESS:
+ break;
+ case RET_ERROR:
+ case RET_SPECIAL:
+ die("db_put failed.");
+ }
+}
+/*
+ * db_del: delete record by a key.
+ *
+ * i) dbio descripter
+ * i) k key
+ */
+void
+db_del(dbio, k)
+DBIO *dbio;
+char *k;
+{
+ DB *db = dbio->db;
+ int status;
+
+ if (k) {
+ key.data = k;
+ key.size = strlen(k)+1;
+ status = (*db->del)(db, &key, 0);
+ } else
+ status = (*db->del)(db, &key, R_CURSOR);
+ if (status == RET_ERROR)
+ die("db_del failed.");
+}
+/*
+ * db_first: get first record.
+ *
+ * i) dbio dbio descripter
+ * i) k key
+ * !=NULL: indexed read by key
+ * ==NULL: sequential read
+ * i) flags following db_next call take over this.
+ * DBIO_KEY read key part
+ * DBIO_PREFIX prefix read
+ * DBIO_SKIPMETA skip META record
+ * only valied when sequential read
+ * r) data
+ */
+char *
+db_first(dbio, k, flags)
+DBIO *dbio;
+char *k;
+int flags;
+{
+ DB *db = dbio->db;
+ int status;
+
+ if (flags & DBIO_PREFIX && !k)
+ flags &= ~DBIO_PREFIX;
+ if (flags & DBIO_SKIPMETA && k)
+ flags &= ~DBIO_SKIPMETA;
+ if (k) {
+ if (strlen(k) > MAXKEYLEN)
+ die("primary key too long.");
+ strcpy(dbio->key, k);
+ key.data = k;
+ key.size = strlen(k);
+ /*
+ * includes NULL character unless prefix read.
+ */
+ if (!(flags & DBIO_PREFIX))
+ key.size++;
+ dbio->keylen = key.size;
+ status = (*db->seq)(db, &key, &dat, R_CURSOR);
+ } else {
+ dbio->keylen = dbio->key[0] = 0;
+ for (status = (*db->seq)(db, &key, &dat, R_FIRST);
+ status == RET_SUCCESS &&
+ flags & DBIO_SKIPMETA &&
+ *((char *)dat.data) == ' ';
+ status = (*db->seq)(db, &key, &dat, R_NEXT))
+ ;
+ }
+ dbio->lastkey = (char *)key.data;
+ dbio->lastdat = (char *)dat.data;
+ switch (status) {
+ case RET_SUCCESS:
+ break;
+ case RET_ERROR:
+ die("db_first failed.");
+ case RET_SPECIAL:
+ return ((char *)0);
+ }
+ dbio->ioflags = flags;
+ if (flags & DBIO_PREFIX) {
+ if (strncmp((char *)key.data, dbio->key, dbio->keylen))
+ return (char *)0;
+ } else if (dbio->keylen) {
+ if (strcmp((char *)key.data, dbio->key))
+ return (char *)0;
+ }
+ if (flags & DBIO_KEY) {
+ strcpy(dbio->prev, (char *)key.data);
+ return (char *)key.data;
+ }
+ return ((char *)dat.data);
+}
+/*
+ * db_next: get next record.
+ *
+ * i) dbio dbio descripter
+ * r) data
+ */
+char *
+db_next(dbio)
+DBIO *dbio;
+{
+ DB *db = dbio->db;
+ int flags = dbio->ioflags;
+ int status;
+
+ while ((status = (*db->seq)(db, &key, &dat, R_NEXT)) == RET_SUCCESS) {
+ if (flags & DBIO_SKIPMETA) {
+ if (*((char *)dat.data) == ' ')
+ continue;
+ }
+ if (flags & DBIO_KEY) {
+ if (!strcmp(dbio->prev, (char *)key.data))
+ continue;
+ if (strlen((char *)key.data) > MAXKEYLEN)
+ die("primary key too long.");
+ strcpy(dbio->prev, (char *)key.data);
+ }
+ dbio->lastkey = (char *)key.data;
+ dbio->lastdat = (char *)dat.data;
+ if (flags & DBIO_PREFIX) {
+ if (strncmp((char *)key.data, dbio->key, dbio->keylen))
+ return (char *)0;
+ } else if (dbio->keylen) {
+ if (strcmp((char *)key.data, dbio->key))
+ return (char *)0;
+ }
+ return (flags & DBIO_KEY) ? (char *)key.data : (char *)dat.data;
+ }
+ if (status == RET_ERROR)
+ die("db_next failed.");
+ return (char *)0;
+}
+/*
+ * db_close: close db
+ *
+ * i) dbio dbio descripter
+ */
+void
+db_close(dbio)
+DBIO *dbio;
+{
+ DB *db = dbio->db;
+ (void)db->close(db);
+ if (dbio->openflags & DBIO_REMOVE)
+ (void)unlink(dbio->dbname);
+ else if (dbio->perm && chmod(dbio->dbname, dbio->perm) < 0)
+ die("cannot change file mode.");
+ (void)free(dbio);
+}
diff --git a/contrib/global/lib/dbio.h b/contrib/global/lib/dbio.h
new file mode 100644
index 000000000000..7c1994e86d69
--- /dev/null
+++ b/contrib/global/lib/dbio.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
+ *
+ * Redilogibution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redilogibutions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redilogibutions 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 dilogibution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * dbio.h 14-Dec-97
+ *
+ */
+#ifndef _DBIO_H_
+#define _DBIO_H_
+
+#include <db.h>
+#include <sys/param.h>
+
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN 1234
+#endif
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN 4321
+#endif
+
+#define MAXKEYLEN 300
+
+typedef struct {
+ DB *db; /* descripter of DB */
+ char dbname[MAXPATHLEN+1]; /* dbname */
+ char key[MAXKEYLEN+1]; /* key */
+ int keylen; /* key length */
+ char prev[MAXKEYLEN+1]; /* previous key value */
+ char *lastkey; /* the key of last located record */
+ char *lastdat; /* the data of last located record */
+ int openflags; /* flags of db_open() */
+ int ioflags; /* flags of db_first() */
+ int perm; /* file permission */
+} DBIO;
+
+/*
+ * openflags
+ */
+#define DBIO_DUP 1 /* allow duplicate records */
+#define DBIO_REMOVE 2 /* remove file when closed */
+/*
+ * ioflags
+ */
+#define DBIO_KEY 1 /* read key part */
+#define DBIO_PREFIX 2 /* prefixed read */
+#define DBIO_SKIPMETA 4 /* skip META record */
+
+#ifndef __P
+#if defined(__STDC__)
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+DBIO *db_open __P((char *, int, int, int));
+char *db_get __P((DBIO *, char *));
+void db_put __P((DBIO *, char *, char *));
+void db_del __P((DBIO *, char *));
+char *db_first __P((DBIO *, char *, int));
+char *db_next __P((DBIO *));
+void db_close __P((DBIO *));
+#endif /* _DBIO_H_ */
diff --git a/contrib/global/lib/dbname.c b/contrib/global/lib/dbname.c
new file mode 100644
index 000000000000..1e68b3a2bf4a
--- /dev/null
+++ b/contrib/global/lib/dbname.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * dbname.c 20-Oct-97
+ *
+ */
+#include "dbname.h"
+
+static char *tagslist[] = {"GTAGS", "GRTAGS", "GSYMS"};
+/*
+ * dbname: return db name
+ *
+ * i) db 0: GTAGS, 1: GRTAGS, 2: GSYMS
+ * r) dbname
+ */
+char *
+dbname(db)
+int db;
+{
+ return tagslist[db];
+}
diff --git a/contrib/global/lib/dbname.h b/contrib/global/lib/dbname.h
new file mode 100644
index 000000000000..17eba363eda4
--- /dev/null
+++ b/contrib/global/lib/dbname.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * dbname.h 16-Oct-97
+ *
+ */
+
+#ifndef _DBNAME_H_
+#define _DBNAME_H_
+
+#ifndef __P
+#if defined(__STDC__)
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+#define GTAGS 0
+#define GRTAGS 1
+#define GSYMS 2
+#define GTAGLIM 3
+
+char *dbname __P((int));
+
+#endif /* ! _DBNAME_H_ */
diff --git a/contrib/global/lib/dbop.c b/contrib/global/lib/dbop.c
deleted file mode 100644
index 9bd98f328624..000000000000
--- a/contrib/global/lib/dbop.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
- *
- * Redilogibution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redilogibutions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redilogibutions 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 dilogibution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * dbop.c 12-Nov-98
- *
- */
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "dbop.h"
-#include "die.h"
-#include "test.h"
-
-static DBT key; /* key of record */
-static DBT dat; /* data of record */
-/*
- * dbop_open: open db database.
- *
- * i) dbname database name
- * i) mode 0: read only, 1: create, 2: modify
- * i) perm file permission
- * i) flags
- * DBOP_DUP: allow duplicate records.
- * DBOP_REMOVE: remove on closed.
- * r) descripter for dbop_xxx()
- */
-DBOP *
-dbop_open(dbname, mode, perm, flags)
-const char *dbname;
-int mode;
-int perm;
-int flags;
-{
- DB *db;
- int rw = 0;
- DBOP *dbop;
- BTREEINFO info;
-
- /*
- * setup argments.
- */
- switch (mode) {
- case 0:
- rw = O_RDONLY;
- break;
- case 1:
- rw = O_RDWR|O_CREAT|O_TRUNC;
- break;
- case 2:
- rw = O_RDWR;
- break;
- default:
- assert(0);
- }
- memset(&info, 0, sizeof(info));
- if (flags & DBOP_DUP)
- info.flags |= R_DUP;
- info.cachesize = 500000;
-
- /*
- * if unlink do job normally, those who already open tag file can use
- * it until closing.
- */
- if (mode == 1 && test("f", dbname))
- (void)unlink(dbname);
- db = dbopen(dbname, rw, 0600, DB_BTREE, &info);
- if (!db)
- return NULL;
- if (!(dbop = (DBOP *)malloc(sizeof(DBOP))))
- die("short of memory.");
- strcpy(dbop->dbname, dbname);
- dbop->db = db;
- dbop->openflags = flags;
- dbop->perm = (mode == 1) ? perm : 0;
- dbop->lastkey = NULL;
- dbop->lastdat = NULL;
-
- return dbop;
-}
-/*
- * dbop_get: get data by a key.
- *
- * i) dbop descripter
- * i) name name
- * r) pointer to data
- */
-char *
-dbop_get(dbop, name)
-DBOP *dbop;
-const char *name;
-{
- DB *db = dbop->db;
- int status;
-
- key.data = (char *)name;
- key.size = strlen(name)+1;
-
- status = (*db->get)(db, &key, &dat, 0);
- dbop->lastkey = (char *)key.data;
- dbop->lastdat = (char *)dat.data;
- switch (status) {
- case RET_SUCCESS:
- break;
- case RET_ERROR:
- die("cannot read from database.");
- case RET_SPECIAL:
- return (NULL);
- }
- return((char *)dat.data);
-}
-/*
- * dbop_put: put data by a key.
- *
- * i) dbop descripter
- * i) name key
- * i) data data
- */
-void
-dbop_put(dbop, name, data)
-DBOP *dbop;
-const char *name;
-const char *data;
-{
- DB *db = dbop->db;
- int status;
-
- if (strlen(name) > MAXKEYLEN)
- die("primary key too long.");
- key.data = (char *)name;
- key.size = strlen(name)+1;
- dat.data = (char *)data;
- dat.size = strlen(data)+1;
-
- status = (*db->put)(db, &key, &dat, 0);
- switch (status) {
- case RET_SUCCESS:
- break;
- case RET_ERROR:
- case RET_SPECIAL:
- die("cannot write to database.");
- }
-}
-/*
- * dbop_del: delete record by a key.
- *
- * i) dbop descripter
- * i) name key
- */
-void
-dbop_del(dbop, name)
-DBOP *dbop;
-const char *name;
-{
- DB *db = dbop->db;
- int status;
-
- if (name) {
- key.data = (char *)name;
- key.size = strlen(name)+1;
- status = (*db->del)(db, &key, 0);
- } else
- status = (*db->del)(db, &key, R_CURSOR);
- if (status == RET_ERROR)
- die("cannot delete record.");
-}
-/*
- * dbop_first: get first record.
- *
- * i) dbop dbop descripter
- * i) name key
- * !=NULL: indexed read by key
- * ==NULL: sequential read
- * i) flags following dbop_next call take over this.
- * DBOP_KEY read key part
- * DBOP_PREFIX prefix read
- * only valied when sequential read
- * r) data
- */
-char *
-dbop_first(dbop, name, flags)
-DBOP *dbop;
-const char *name;
-int flags;
-{
- DB *db = dbop->db;
- int status;
-
- if (flags & DBOP_PREFIX && !name)
- flags &= ~DBOP_PREFIX;
- if (name) {
- if (strlen(name) > MAXKEYLEN)
- die("primary key too long.");
- strcpy(dbop->key, name);
- key.data = (char *)name;
- key.size = strlen(name);
- /*
- * includes NULL character unless prefix read.
- */
- if (!(flags & DBOP_PREFIX))
- key.size++;
- dbop->keylen = key.size;
- status = (*db->seq)(db, &key, &dat, R_CURSOR);
- } else {
- dbop->keylen = dbop->key[0] = 0;
- /* skip META records */
- for (status = (*db->seq)(db, &key, &dat, R_FIRST);
- status == RET_SUCCESS;
- status = (*db->seq)(db, &key, &dat, R_NEXT)) {
- int c = (flags & DBOP_KEY) ? *((char *)key.data) : *((char *)dat.data);
- if (c != ' ')
- break;
- }
- }
- dbop->lastkey = (char *)key.data;
- dbop->lastdat = (char *)dat.data;
- switch (status) {
- case RET_SUCCESS:
- break;
- case RET_ERROR:
- die("dbop_first failed.");
- case RET_SPECIAL:
- return (NULL);
- }
- dbop->ioflags = flags;
- if (flags & DBOP_PREFIX) {
- if (strncmp((char *)key.data, dbop->key, dbop->keylen))
- return NULL;
- } else if (dbop->keylen) {
- if (strcmp((char *)key.data, dbop->key))
- return NULL;
- }
- if (flags & DBOP_KEY) {
- strcpy(dbop->prev, (char *)key.data);
- return (char *)key.data;
- }
- return ((char *)dat.data);
-}
-/*
- * dbop_next: get next record.
- *
- * i) dbop dbop descripter
- * r) data
- *
- * Db_next always skip meta records.
- */
-char *
-dbop_next(dbop)
-DBOP *dbop;
-{
- DB *db = dbop->db;
- int flags = dbop->ioflags;
- int status;
-
- while ((status = (*db->seq)(db, &key, &dat, R_NEXT)) == RET_SUCCESS) {
- assert(dat.data != NULL);
- if (flags & DBOP_KEY && *((char *)key.data) == ' ')
- continue;
- else if (*((char *)dat.data) == ' ')
- continue;
- if (flags & DBOP_KEY) {
- if (!strcmp(dbop->prev, (char *)key.data))
- continue;
- if (strlen((char *)key.data) > MAXKEYLEN)
- die("primary key too long.");
- strcpy(dbop->prev, (char *)key.data);
- }
- dbop->lastkey = (char *)key.data;
- dbop->lastdat = (char *)dat.data;
- if (flags & DBOP_PREFIX) {
- if (strncmp((char *)key.data, dbop->key, dbop->keylen))
- return NULL;
- } else if (dbop->keylen) {
- if (strcmp((char *)key.data, dbop->key))
- return NULL;
- }
- return (flags & DBOP_KEY) ? (char *)key.data : (char *)dat.data;
- }
- if (status == RET_ERROR)
- die("dbop_next failed.");
- return NULL;
-}
-/*
- * dbop_close: close db
- *
- * i) dbop dbop descripter
- */
-void
-dbop_close(dbop)
-DBOP *dbop;
-{
- DB *db = dbop->db;
-
- (void)db->close(db);
- if (dbop->openflags & DBOP_REMOVE)
- (void)unlink(dbop->dbname);
- else if (dbop->perm && chmod(dbop->dbname, dbop->perm) < 0)
- die("cannot change file mode.");
- (void)free(dbop);
-}
diff --git a/contrib/global/lib/dbop.h b/contrib/global/lib/dbop.h
deleted file mode 100644
index 38342ca52d04..000000000000
--- a/contrib/global/lib/dbop.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
- *
- * Redilogibution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redilogibutions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redilogibutions 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 dilogibution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * dbop.h 12-Nov-98
- *
- */
-#ifndef _DBOP_H_
-#define _DBOP_H_
-
-#include <sys/param.h>
-#include <db.h>
-
-#ifndef LITTLE_ENDIAN
-#define LITTLE_ENDIAN 1234
-#endif
-#ifndef BIG_ENDIAN
-#define BIG_ENDIAN 4321
-#endif
-
-#define MAXKEYLEN 300
-
-typedef struct {
- DB *db; /* descripter of DB */
- char dbname[MAXPATHLEN+1]; /* dbname */
- char key[MAXKEYLEN+1]; /* key */
- int keylen; /* key length */
- char prev[MAXKEYLEN+1]; /* previous key value */
- char *lastkey; /* the key of last located record */
- char *lastdat; /* the data of last located record */
- int openflags; /* flags of dbop_open() */
- int ioflags; /* flags of dbop_first() */
- int perm; /* file permission */
-} DBOP;
-
-/*
- * openflags
- */
-#define DBOP_DUP 1 /* allow duplicate records */
-#define DBOP_REMOVE 2 /* remove file when closed */
-/*
- * ioflags
- */
-#define DBOP_KEY 1 /* read key part */
-#define DBOP_PREFIX 2 /* prefixed read */
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-DBOP *dbop_open __P((const char *, int, int, int));
-char *dbop_get __P((DBOP *, const char *));
-void dbop_put __P((DBOP *, const char *, const char *));
-void dbop_del __P((DBOP *, const char *));
-char *dbop_first __P((DBOP *, const char *, int));
-char *dbop_next __P((DBOP *));
-void dbop_close __P((DBOP *));
-#endif /* _DBOP_H_ */
diff --git a/contrib/global/lib/defined.c b/contrib/global/lib/defined.c
deleted file mode 100644
index 1e72b46c05dd..000000000000
--- a/contrib/global/lib/defined.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * defined.c 12-Nov-98
- *
- */
-#include <stdlib.h>
-
-#include "die.h"
-#include "dbop.h"
-#include "defined.h"
-#include "makepath.h"
-
-static DBOP *dbop = NULL;
-
-/*
- * Tag command that supports referenced tag must call this function
- * to decide whether or not the tag is defined.
- */
-int
-defined(name)
-const char *name;
-{
- if (dbop == NULL) {
- const char *dbpath;
-
- /*
- * gtags(1) set GTAGSDBPATH to the path GTAGS exist.
- */
- if (!(dbpath = getenv("GTAGSDBPATH")))
- dbpath = ".";
- dbop = dbop_open(makepath(dbpath, "GTAGS"), 0, 0, 0);
- if (dbop == NULL)
- die1("GTAGS not found. (%s)", makepath(dbpath, "GTAGS"));
- }
- if (dbop_get(dbop, name))
- return 1;
- return 0;
-}
diff --git a/contrib/global/lib/defined.h b/contrib/global/lib/defined.h
deleted file mode 100644
index 6d342ac5ec06..000000000000
--- a/contrib/global/lib/defined.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * defined.h 2-May-98
- *
- */
-
-#ifndef _DEFINED_H_
-#define _DEFINED_H_
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-int defined __P((const char *));
-
-#endif /* ! _DEFINED_H_ */
diff --git a/contrib/global/lib/die.h b/contrib/global/lib/die.h
index fc0e9e014493..46813d415953 100644
--- a/contrib/global/lib/die.h
+++ b/contrib/global/lib/die.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,7 +35,7 @@
#define _DIE_H_
#include <stdio.h>
-extern const char *progname;
+extern char *progname;
#define die(a) fprintf(stderr, "%s: ", progname),\
fprintf(stderr, a),\
@@ -46,8 +46,4 @@ extern const char *progname;
fprintf(stderr, a, b),\
fputs("\n", stderr),\
exit(1)
-#define die2(a,b,c) fprintf(stderr, "%s: ", progname),\
- fprintf(stderr, a, b, c),\
- fputs("\n", stderr),\
- exit(1)
#endif /* ! _DIE_H_ */
diff --git a/contrib/global/lib/find.c b/contrib/global/lib/find.c
index 4682beec1d6d..10a9bf1cde78 100644
--- a/contrib/global/lib/find.c
+++ b/contrib/global/lib/find.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,159 +28,115 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * find.c 1-May-98
+ * find.c 20-Oct-97
*
*/
-/*
- * USEFIND use find(1) to traverse directory tree.
- * Otherwise, use dirent(3) library.
- */
-#define USEFIND
-
-#include <sys/param.h>
-
-#include <assert.h>
-#include <ctype.h>
-#ifndef USEFIND
-#include <dirent.h>
-#ifndef BSD4_4
-#include <sys/stat.h>
-#endif
-#endif
#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
+#include <string.h>
+#include <sys/types.h>
#include <regex.h>
-
-#include "conf.h"
-#include "die.h"
-#include "find.h"
+#include <sys/param.h>
#include "gparam.h"
+#include "find.h"
+#include "die.h"
#include "locatestring.h"
-#include "makepath.h"
-#include "strbuf.h"
/*
* usage of findxxx()
*
- * findopen(db);
+ * findopen();
* while (path = findread(&length)) {
* ...
* }
* findclose();
*
*/
+static char *skippath[] = {
+ "y.tab.c",
+ "y.tab.h",
+ "SCCS/",
+ "RCS/",
+};
+static char *ext[] = {
+ "c",
+ "h",
+ "y",
+ "s",
+ "S",
+};
+static char findcom[MAXCOMLINE+1];
static regex_t skip_area;
-static regex_t *skip = &skip_area;
+static regex_t *skip;
+static FILE *ip;
static int opened;
-static void trim __P((char *));
-
-/*
- * trim: remove blanks and '\'.
- */
-static void
-trim(s)
-char *s;
+int
+issource(path)
+char *path;
{
char *p;
- for (p = s; *s; s++) {
- if (isspace(*s))
- continue;
- if (*s == '\\' && *(s + 1))
- s++;
- *p++ = *s;
+ if (!(p = locatestring(path, ".", 2)))
+ return 0;
+ ++p;
+ if (sizeof(ext) != 0) {
+ int i, lim = sizeof(ext)/sizeof(char *);
+ for (i = 0; i < lim; i++)
+ if (*ext[i] == *p && !strcmp(ext[i], p))
+ return 1;
}
- *p = 0;
+ return 0;
}
-#ifdef USEFIND
-/*----------------------------------------------------------------------*/
-/* find command version */
-/*----------------------------------------------------------------------*/
-static FILE *ip;
void
-findopen()
+findopen(void)
{
- char *findcom, *p, *q;
- STRBUF *sb;
- char *sufflist = NULL;
- char *skiplist = NULL;
+ char edit[512], *p, *q;
+ int i, lim;
- assert(opened == 0);
+ if (opened)
+ die("nested call to findopen.");
opened = 1;
-
- sb = stropen();
- if (!getconfs("suffixes", sb))
- die("cannot get suffixes data.");
- sufflist = strdup(strvalue(sb));
- if (!sufflist)
- die("short of memory.");
- trim(sufflist);
- strstart(sb);
- if (getconfs("skip", sb)) {
- skiplist = strdup(strvalue(sb));
- if (!skiplist)
- die("short of memory.");
- trim(skiplist);
- }
-
- strstart(sb);
- strputs(sb, "find . \\( -type f -o -type l \\) \\(");
- for (p = sufflist; p; ) {
- char *suff = p;
- if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
- *p++ = 0;
- strputs(sb, " -name '*.");
- strputs(sb, suff);
- strputs(sb, "'");
- if (p)
- strputs(sb, " -o");
+ p = findcom;
+ strcpy(p, "find . \\( -type f -o -type l \\) \\(");
+ p += strlen(p);
+ lim = sizeof(ext)/sizeof(char *);
+ for (i = 0; i < lim; i++) {
+ sprintf(p, " -name '*.%s'%s", ext[i], (i + 1 < lim) ? " -o" : "");
+ p += strlen(p);
}
- strputs(sb, " \\) -print");
- findcom = strvalue(sb);
-
- if (skiplist) {
- char *reg;
- STRBUF *sbb = stropen();
+ sprintf(p, " \\) -print");
+ if (sizeof(skippath) != 0) {
+ int i, lim = sizeof(skippath)/sizeof(char *);
/*
* construct regular expression.
*/
- strputc(sbb, '('); /* ) */
- for (p = skiplist; p; ) {
- char *skipf = p;
- if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
- *p++ = 0;
- strputc(sbb, '/');
- for (q = skipf; *q; q++) {
+ p = edit;
+ *p++ = '(';
+ for (i = 0; i < lim; i++) {
+ *p++ = '/';
+ for (q = skippath[i]; *q; q++) {
if (*q == '.')
- strputc(sbb, '\\');
- strputc(sbb, *q);
+ *p++ = '\\';
+ *p++ = *q;
}
if (*(q - 1) != '/')
- strputc(sbb, '$');
- if (p)
- strputc(sbb, '|');
+ *p++ = '$';
+ *p++ = '|';
}
- strputc(sbb, ')');
- reg = strvalue(sbb);
+ *(p - 1) = ')';
+ *p = 0;
/*
* compile regular expression.
*/
- if (regcomp(skip, reg, REG_EXTENDED|REG_NEWLINE) != 0)
+ skip = &skip_area;
+ if (regcomp(skip, edit, REG_EXTENDED|REG_NEWLINE) != 0)
die("cannot compile regular expression.");
- strclose(sbb);
} else {
skip = (regex_t *)0;
}
if (!(ip = popen(findcom, "r")))
die("cannot execute find.");
- strclose(sb);
- if (sufflist)
- free(sufflist);
- if (skiplist)
- free(skiplist);
}
char *
findread(length)
@@ -189,12 +145,8 @@ int *length;
static char path[MAXPATHLEN+1];
char *p;
- assert(opened == 1);
while (fgets(path, MAXPATHLEN, ip)) {
if (!skip || regexec(skip, path, 0, 0, 0) != 0) {
- /*
- * chop(path)
- */
p = path + strlen(path) - 1;
if (*p != '\n')
die("output of find(1) is wrong (findread).");
@@ -204,242 +156,11 @@ int *length;
return path;
}
}
- return NULL;
+ return (char *)0;
}
void
findclose(void)
{
- assert(opened == 1);
pclose(ip);
opened = 0;
}
-#else /* USEFIND */
-/*----------------------------------------------------------------------*/
-/* dirent version findxxx() */
-/*----------------------------------------------------------------------*/
-#define STACKSIZE 50
-static char dir[MAXPATHLEN+1]; /* directory path */
-static struct {
- STRBUF *sb;
- char *dirp, *start, *end, *p;
-} stack[STACKSIZE], *topp, *curp; /* stack */
-
-static regex_t suff_area;
-static regex_t *suff = &suff_area;
-
-static int
-getdirs(dir, sb)
-char *dir;
-STRBUF *sb;
-{
- DIR *dirp;
- struct dirent *dp;
-#ifndef BSD4_4
- struct stat st;
-#endif
-
- if ((dirp = opendir(dir)) == NULL)
- return -1;
- while ((dp = readdir(dirp)) != NULL) {
-#ifdef BSD4_4
- if (dp->d_namlen == 1 && dp->d_name[0] == '.')
- continue;
- if (dp->d_namlen == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.')
- continue;
- if (dp->d_type == DT_DIR)
- strputc(sb, 'd');
- else if (dp->d_type == DT_REG)
- strputc(sb, 'f');
- else if (dp->d_type == DT_LNK)
- strputc(sb, 'l');
- else
- strputc(sb, ' ');
- strnputs(sb, dp->d_name, (int)dp->d_namlen);
-#else
- if (stat(path, &st) < 0) {
- fprintf(stderr, "cannot stat '%s'. (Ignored)\n", path);
- continue;
- }
- if (S_ISDIR(st.st_mode))
- strputc(sb, 'd');
- else if (S_ISREG(st.st_mode))
- strputc(sb, 'f');
- else if (S_ISLNK(st.st_mode))
- strputc(sb, 'l');
- else
- strputc(sb, ' ');
- strputs(sb, dp->d_name);
-#endif /* BSD4_4 */
- strputc(sb, '\0');
- }
- (void)closedir(dirp);
- return 0;
-}
-void
-findopen()
-{
- STRBUF *sb = stropen();
- char *sufflist = NULL;
- char *skiplist = NULL;
-
- assert(opened == 0);
- opened = 1;
-
- /*
- * setup stack.
- */
- curp = &stack[0];
- topp = curp + STACKSIZE;
- strcpy(dir, ".");
-
- curp->dirp = dir + strlen(dir);
- curp->sb = stropen();
- if (getdirs(dir, curp->sb) < 0)
- die("cannot open '.' directory.");
- curp->start = curp->p = strvalue(curp->sb);
- curp->end = curp->start + strbuflen(curp->sb);
-
- /*
- * preparing regular expression.
- */
- strstart(sb);
- if (!getconfs("suffixes", sb))
- die("cannot get suffixes data.");
- sufflist = strdup(strvalue(sb));
- if (!sufflist)
- die("short of memory.");
- trim(sufflist);
- strstart(sb);
- if (getconfs("skip", sb)) {
- skiplist = strdup(strvalue(sb));
- if (!skiplist)
- die("short of memory.");
- trim(skiplist);
- }
- {
- char *p;
-
- strstart(sb);
- strputc(sb, '('); /* ) */
- for (p = sufflist; p; ) {
- char *suffp = p;
- if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
- *p++ = 0;
- strputs(sb, "\\.");
- strputs(sb, suffp);
- strputc(sb, '$');
- if (p)
- strputc(sb, '|');
- }
- strputc(sb, ')');
- /*
- * compile regular expression.
- */
- if (regcomp(suff, strvalue(sb), REG_EXTENDED) != 0)
- die("cannot compile regular expression.");
- }
- if (skiplist) {
- char *p, *q;
- /*
- * construct regular expression.
- */
- strstart(sb);
- strputc(sb, '('); /* ) */
- for (p = skiplist; p; ) {
- char *skipf = p;
- if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
- *p++ = 0;
- strputc(sb, '/');
- for (q = skipf; *q; q++) {
- if (*q == '.')
- strputc(sb, '\\');
- strputc(sb, *q);
- }
- if (*(q - 1) != '/')
- strputc(sb, '$');
- if (p)
- strputc(sb, '|');
- }
- strputc(sb, ')');
- /*
- * compile regular expression.
- */
- if (regcomp(skip, strvalue(sb), REG_EXTENDED) != 0)
- die("cannot compile regular expression.");
- } else {
- skip = (regex_t *)0;
- }
- strclose(sb);
- if (sufflist)
- free(sufflist);
- if (skiplist)
- free(skiplist);
-}
-char *
-findread(length)
-int *length;
-{
- static char val[MAXPATHLEN+1];
-
- for (;;) {
- while (curp->p < curp->end) {
- char type = *(curp->p);
- char *unit = curp->p + 1;
-
- curp->p += strlen(curp->p) + 1;
- if (type == 'f' || type == 'l') {
- char *path = makepath(dir, unit);
- if (regexec(suff, path, 0, 0, 0) != 0)
- continue;
- if (skip && regexec(skip, path, 0, 0, 0) == 0)
- continue;
- strcpy(val, path);
- return val;
- }
- if (type == 'd') {
- STRBUF *sb = stropen();
- char *dirp = curp->dirp;
-
- strcat(dirp, "/");
- strcat(dirp, unit);
- if (getdirs(dir, sb) < 0) {
- fprintf(stderr, "cannot open directory '%s'. (Ignored)\n", dir);
- strclose(sb);
- *(curp->dirp) = 0;
- continue;
- }
- /*
- * Push stack.
- */
- if (++curp >= topp)
- die("directory stack over flow.");
- curp->dirp = dirp + strlen(dirp);
- curp->sb = sb;
- curp->start = curp->p = strvalue(sb);
- curp->end = curp->start + strbuflen(sb);
- }
- }
- strclose(curp->sb);
- curp->sb = NULL;
- if (curp == &stack[0])
- break;
- /*
- * Pop stack.
- */
- curp--;
- *(curp->dirp) = 0;
- }
- return NULL;
-}
-void
-findclose(void)
-{
- assert(opened == 1);
- for (curp = &stack[0]; curp < topp; curp++)
- if (curp->sb != NULL)
- strclose(curp->sb);
- else
- break;
- opened = 0;
-}
-#endif /* !USEFIND */
diff --git a/contrib/global/lib/find.h b/contrib/global/lib/find.h
index ae16f7230872..bb140e05ddcb 100644
--- a/contrib/global/lib/find.h
+++ b/contrib/global/lib/find.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/contrib/global/lib/getdbpath.c b/contrib/global/lib/getdbpath.c
index 4529988ed6c8..73f1a4f48055 100644
--- a/contrib/global/lib/getdbpath.c
+++ b/contrib/global/lib/getdbpath.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,10 +41,12 @@
#include "die.h"
#include "getdbpath.h"
+#include "locatestring.h"
#include "test.h"
-static const char *makeobjdirprefix; /* obj partition */
-static const char *makeobjdir; /* obj directory */
+static char *makeobjdirprefix; /* obj partition */
+static char *makeobjdir; /* obj directory */
+static int bsd; /* if BSD */
/*
* gtagsexist: test whether GTAGS's existence.
@@ -65,15 +67,17 @@ char *dbpath;
strcpy(dbpath, candidate);
return 1;
}
- sprintf(path, "%s/%s/GTAGS", candidate, makeobjdir);
- if (test("fr", path)) {
- sprintf(dbpath, "%s/%s", candidate, makeobjdir);
- return 1;
- }
- sprintf(path, "%s%s/GTAGS", makeobjdirprefix, candidate);
- if (test("fr", path)) {
- sprintf(dbpath, "%s%s", makeobjdirprefix, candidate);
- return 1;
+ if (bsd) {
+ sprintf(path, "%s/%s/GTAGS", candidate, makeobjdir);
+ if (test("fr", path)) {
+ sprintf(dbpath, "%s/%s", candidate, makeobjdir);
+ return 1;
+ }
+ sprintf(path, "%s%s/GTAGS", makeobjdirprefix, candidate);
+ if (test("fr", path)) {
+ sprintf(dbpath, "%s%s", makeobjdirprefix, candidate);
+ return 1;
+ }
}
return 0;
}
@@ -106,14 +110,17 @@ char *dbpath;
if (!strcmp(cwd, "/"))
die("It's root directory! What are you doing?");
- if ((p = getenv("MAKEOBJDIRPREFIX")) != NULL)
- makeobjdirprefix = p;
- else
- makeobjdirprefix = "/usr/obj";
- if ((p = getenv("MAKEOBJDIR")) != NULL)
- makeobjdir = p;
- else
- makeobjdir = "obj";
+ if (getenv("OSTYPE") && locatestring(getenv("OSTYPE"), "BSD", 0)) {
+ if ((p = getenv("MAKEOBJDIRPREFIX")) != NULL)
+ makeobjdirprefix = p;
+ else
+ makeobjdirprefix = "/usr/obj";
+ if ((p = getenv("MAKEOBJDIR")) != NULL)
+ makeobjdir = p;
+ else
+ makeobjdir = "obj";
+ bsd = 1;
+ }
if ((p = getenv("GTAGSROOT")) != NULL) {
if (*p != '/')
diff --git a/contrib/global/lib/getdbpath.h b/contrib/global/lib/getdbpath.h
index 063d2367055a..193dfffc596a 100644
--- a/contrib/global/lib/getdbpath.h
+++ b/contrib/global/lib/getdbpath.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/contrib/global/lib/global.h b/contrib/global/lib/global.h
index 5ab2ca563dc4..7fbc2b8ef230 100644
--- a/contrib/global/lib/global.h
+++ b/contrib/global/lib/global.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,30 +28,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * global.h 2-May-98
+ * global.h 16-Oct-97
*
*/
#ifndef _GLOBAL_H_
#define _GLOBAL_H_
-#include "conf.h"
-#include "dbop.h"
-#include "defined.h"
-#include "die.h"
-#include "find.h"
-#include "getdbpath.h"
#include "gparam.h"
-#include "gtagsop.h"
-#include "locatestring.h"
+#include "dbname.h"
#include "makepath.h"
+#include "dbio.h"
+#include "locatestring.h"
#include "mgets.h"
-#include "pathop.h"
-#include "strbuf.h"
-#include "strmake.h"
+#include "die.h"
+#include "find.h"
+#include "getdbpath.h"
+#include "strop.h"
+#include "gtagsopen.h"
+#include "lookup.h"
#include "tab.h"
+#include "tag.h"
#include "test.h"
-#include "token.h"
-#include "usable.h"
#endif /* ! _GLOBAL_H_ */
diff --git a/contrib/global/lib/gparam.h b/contrib/global/lib/gparam.h
index 8a13c7e64349..8a506c465cae 100644
--- a/contrib/global/lib/gparam.h
+++ b/contrib/global/lib/gparam.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,17 +28,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * gparam.h 16-Jul-98
+ * gparam.h 16-Oct-97
*
*/
#ifndef _GPARAM_H_
#define _GPARAM_H_
-#define MAXFILLEN 1024 /* max length of filter */
-#define IDENTLEN 512 /* max length of ident */
-#define MAXENVLEN 1024 /* max length of env */
-#define MAXBUFLEN 1024 /* max length of buffer */
-#define MAXPROPLEN 1024 /* max length of property */
-#define MAXARGLEN 512 /* max length of argment */
+#define MAXCOMLINE 1024 /* max length of filter */
+#define IDENTLEN 512 /* max length of ident */
+#define MAXENVLEN 1024 /* max length of env */
+#define MAXBUFLEN 1024 /* max length of buffer */
#endif /* ! _GPARAM_H_ */
diff --git a/contrib/global/lib/gtagsop.c b/contrib/global/lib/gtagsop.c
deleted file mode 100644
index 41635695fef3..000000000000
--- a/contrib/global/lib/gtagsop.c
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * gtagsop.c 12-Nov-98
- *
- */
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "dbop.h"
-#include "die.h"
-#include "gtagsop.h"
-#include "locatestring.h"
-#include "makepath.h"
-#include "mgets.h"
-#include "pathop.h"
-#include "strbuf.h"
-#include "strmake.h"
-#include "tab.h"
-
-static char *genrecord __P((GTOP *));
-static int belongto __P((GTOP *, char *, char *));
-
-static int support_version = 2; /* acceptable format version */
-static const char *tagslist[] = {"GTAGS", "GRTAGS", "GSYMS"};
-/*
- * dbname: return db name
- *
- * i) db 0: GTAGS, 1: GRTAGS, 2: GSYMS
- * r) dbname
- */
-const char *
-dbname(db)
-int db;
-{
- assert(db >= 0 && db < GTAGLIM);
- return tagslist[db];
-}
-/*
- * makecommand: make command line to make global tag file
- *
- * i) comline skelton command line
- * i) path path name
- * o) sb command line
- */
-void
-makecommand(comline, path, sb)
-char *comline;
-char *path;
-STRBUF *sb;
-{
- char *p;
-
- if (!(p = strmake(comline, "%")))
- die1("'%%s' is needed in tag command line. (%s)\n", comline);
- strputs(sb, p);
- strputs(sb, path);
- if (!(p = locatestring(comline, "%s", MATCH_FIRST)))
- die1("'%%s' is needed in tag command line. (%s)\n", comline);
- strputs(sb, p+2);
-}
-/*
- * formatcheck: check format of tag command's output
- *
- * i) line input
- * i) flags flag
- * r) 0: normal
- * -1: tag name
- * -2: line number
- * -3: path
- *
- * [example of right format]
- *
- * $1 $2 $3 $4
- * ----------------------------------------------------
- * main 83 ./ctags.c main(argc, argv)
- */
-int
-formatcheck(line, flags)
-char *line;
-int flags;
-{
- char *p, *q;
- /*
- * $1 = tagname: allowed any char except sepalator.
- */
- p = q = line;
- while (*p && !isspace(*p))
- p++;
- while (*p && isspace(*p))
- p++;
- if (p == q)
- return -1;
- /*
- * $2 = line number: must be digit.
- */
- q = p;
- while (*p && !isspace(*p))
- if (!isdigit(*p))
- return -2;
- else
- p++;
- if (p == q)
- return -2;
- while (*p && isspace(*p))
- p++;
- /*
- * $3 = path:
- * standard format: must start with './'.
- * compact format: must be digit.
- */
- if (flags & GTAGS_PATHINDEX) {
- while (*p && !isspace(*p))
- if (!isdigit(*p))
- return -3;
- else
- p++;
- } else {
- if (!(*p == '.' && *(p + 1) == '/' && *(p + 2)))
- return -3;
- }
- return 0;
-}
-/*
- * gtagsopen: open global tag.
- *
- * i) dbpath dbpath directory
- * i) root root directory (needed when compact format)
- * i) db GTAGS, GRTAGS, GSYMS
- * i) mode GTAGS_READ: read only
- * GTAGS_CREATE: create tag
- * GTAGS_MODIFY: modify tag
- * i) flags GTAGS_COMPACT
- * GTAGS_PATHINDEX
- * r) GTOP structure
- *
- * when error occurred, gtagopen doesn't return.
- * GTAGS_PATHINDEX needs GTAGS_COMPACT.
- */
-GTOP *
-gtagsopen(dbpath, root, db, mode, flags)
-char *dbpath;
-char *root;
-int db;
-int mode;
-int flags;
-{
- GTOP *gtop;
- int dbmode = 0;
-
- if ((gtop = (GTOP *)calloc(sizeof(GTOP), 1)) == NULL)
- die("short of memory.");
- gtop->db = db;
- gtop->mode = mode;
- switch (gtop->mode) {
- case GTAGS_READ:
- dbmode = 0;
- break;
- case GTAGS_CREATE:
- dbmode = 1;
- break;
- case GTAGS_MODIFY:
- dbmode = 2;
- break;
- default:
- assert(0);
- }
-
- /*
- * allow duplicate records.
- */
- gtop->dbop = dbop_open(makepath(dbpath, dbname(db)), dbmode, 0644, DBOP_DUP);
- if (gtop->dbop == NULL) {
- if (dbmode == 1)
- die1("cannot make %s.", dbname(db));
- die1("%s not found.", dbname(db));
- }
- /*
- * decide format version.
- */
- gtop->format_version = 1;
- gtop->format = GTAGS_STANDARD;
- /*
- * This is a special case. GSYMS had compact format even if
- * format version 1.
- */
- if (db == GSYMS)
- gtop->format |= GTAGS_COMPACT;
- if (gtop->mode == GTAGS_CREATE) {
- if (flags & GTAGS_COMPACT) {
- char buf[80];
-
- gtop->format_version = 2;
- sprintf(buf, "%s %d", VERSIONKEY, gtop->format_version);
- dbop_put(gtop->dbop, VERSIONKEY, buf);
- gtop->format |= GTAGS_COMPACT;
- dbop_put(gtop->dbop, COMPACTKEY, COMPACTKEY);
- if (flags & GTAGS_PATHINDEX) {
- gtop->format |= GTAGS_PATHINDEX;
- dbop_put(gtop->dbop, PATHINDEXKEY, PATHINDEXKEY);
- }
- }
- } else {
- /*
- * recognize format version of GTAGS. 'format version record'
- * is saved as a META record in GTAGS and GRTAGS.
- * if 'format version record' is not found, it's assumed
- * version 1.
- */
- char *p;
-
- if ((p = dbop_get(gtop->dbop, VERSIONKEY)) != NULL) {
- for (p += strlen(VERSIONKEY); *p && isspace(*p); p++)
- ;
- gtop->format_version = atoi(p);
- }
- if (gtop->format_version > support_version)
- die("GTAGS seems new format. Please install the latest GLOBAL.");
- if (gtop->format_version > 1) {
- if (dbop_get(gtop->dbop, COMPACTKEY) != NULL)
- gtop->format |= GTAGS_COMPACT;
- if (dbop_get(gtop->dbop, PATHINDEXKEY) != NULL)
- gtop->format |= GTAGS_PATHINDEX;
- }
- }
- if (gtop->format & GTAGS_PATHINDEX || gtop->mode != GTAGS_READ) {
- if (pathopen(dbpath, dbmode) < 0) {
- if (dbmode == 1)
- die("cannot create GPATH.");
- else
- die("GPATH not found.");
- }
- }
- /*
- * Stuff for compact format.
- */
- if (gtop->format & GTAGS_COMPACT) {
- assert(root != NULL);
- strcpy(gtop->root, root);
- if (gtop->mode != GTAGS_READ)
- gtop->sb = stropen();
- }
- return gtop;
-}
-/*
- * gtagsput: put tag record with packing.
- *
- * i) gtop descripter of GTOP
- * i) tag tag name
- * i) record ctags -x image
- */
-void
-gtagsput(gtop, tag, record)
-GTOP *gtop;
-char *tag;
-char *record;
-{
- char *p, *q;
- char lno[10];
- char path[MAXPATHLEN+1];
-
- if (gtop->format == GTAGS_STANDARD) {
- entab(record);
- dbop_put(gtop->dbop, tag, record);
- return;
- }
- /*
- * gtop->format & GTAGS_COMPACT
- */
- p = record; /* ignore $1 */
- while (*p && !isspace(*p))
- p++;
- while (*p && isspace(*p))
- p++;
- q = lno; /* lno = $2 */
- while (*p && !isspace(*p))
- *q++ = *p++;
- *q = 0;
- while (*p && isspace(*p))
- p++;
- q = path; /* path = $3 */
- while (*p && !isspace(*p))
- *q++ = *p++;
- *q = 0;
- /*
- * First time, it occurs, because 'prev_tag' and 'prev_path' are NULL.
- */
- if (strcmp(gtop->prev_tag, tag) || strcmp(gtop->prev_path, path)) {
- if (gtop->prev_tag[0])
- dbop_put(gtop->dbop, gtop->prev_tag, strvalue(gtop->sb));
- strcpy(gtop->prev_tag, tag);
- strcpy(gtop->prev_path, path);
- /*
- * Start creating new record.
- */
- strstart(gtop->sb);
- strputs(gtop->sb, strmake(record, " \t"));
- strputc(gtop->sb, ' ');
- strputs(gtop->sb, path);
- strputc(gtop->sb, ' ');
- strputs(gtop->sb, lno);
- } else {
- strputc(gtop->sb, ',');
- strputs(gtop->sb, lno);
- }
-}
-/*
- * gtagsadd: add tags belonging to the path into tag file.
- *
- * i) gtop descripter of GTOP
- * i) comline tag command line
- * i) path source file
- * i) flags GTAGS_UNIQUE, GTAGS_EXTRACTMETHOD
- */
-void
-gtagsadd(gtop, comline, path, flags)
-GTOP *gtop;
-char *comline;
-char *path;
-int flags;
-{
- char *tagline;
- FILE *ip;
- STRBUF *sb = stropen();
-
- /*
- * add path index if not yet.
- */
- pathput(path);
- /*
- * make command line.
- */
- makecommand(comline, path, sb);
- /*
- * Compact format.
- */
- if (gtop->format & GTAGS_PATHINDEX) {
- char *pno;
-
- if ((pno = pathget(path)) == NULL)
- die1("GPATH is corrupted.('%s' not found)", path);
- strputs(sb, "| sed 's!");
- strputs(sb, path);
- strputs(sb, "!");
- strputs(sb, pno);
- strputs(sb, "!'");
- }
- if (gtop->format & GTAGS_COMPACT)
- strputs(sb, "| sort +0 -1 +1n -2");
- if (flags & GTAGS_UNIQUE)
- strputs(sb, "| uniq");
- if (!(ip = popen(strvalue(sb), "r")))
- die1("cannot execute '%s'.", strvalue(sb));
- while ((tagline = mgets(ip, NULL, MGETS_TAILCUT)) != NULL) {
- char *tag, *p;
-
- if (formatcheck(tagline, gtop->format) < 0)
- die1("illegal parser output.\n'%s'", tagline);
- tag = strmake(tagline, " \t"); /* tag = $1 */
- /*
- * extract method when class method definition.
- *
- * Ex: Class::method(...)
- *
- * key = 'method'
- * data = 'Class::method 103 ./class.cpp ...'
- */
- if (flags & GTAGS_EXTRACTMETHOD) {
- if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL)
- tag = p + 1;
- else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL)
- tag = p + 2;
- }
- gtagsput(gtop, tag, tagline);
- }
- pclose(ip);
- strclose(sb);
-}
-/*
- * belongto: wheather or not record belongs to the path.
- *
- * i) gtop GTOP structure
- * i) path path name (in standard format)
- * path number (in compact format)
- * i) p record
- * r) 1: belong, 0: not belong
- */
-static int
-belongto(gtop, path, p)
-GTOP *gtop;
-char *path;
-char *p;
-{
- char *q;
- int length = strlen(path);
-
- /*
- * seek to path part.
- */
- if (gtop->format & GTAGS_PATHINDEX) {
- for (q = p; *q && !isspace(*q); q++)
- ;
- if (*q == 0)
- die1("illegal tag format. '%s'", p);
- for (; *q && isspace(*q); q++)
- ;
- } else
- q = locatestring(p, "./", MATCH_FIRST);
- if (*q == 0)
- die1("illegal tag format. '%s'", p);
- if (!strncmp(q, path, length) && isspace(*(q + length)))
- return 1;
- return 0;
-}
-/*
- * gtagsdelete: delete records belong to path.
- *
- * i) gtop GTOP structure
- * i) path path name
- */
-void
-gtagsdelete(gtop, path)
-GTOP *gtop;
-char *path;
-{
- char *p, *key;
- int length;
-
- /*
- * In compact format, a path is saved as a file number.
- */
- key = path;
- if (gtop->format & GTAGS_PATHINDEX)
- if ((key = pathget(path)) == NULL)
- die1("GPATH is corrupted.('%s' not found)", path);
- length = strlen(key);
- /*
- * read sequentially, because db(1) has just one index.
- */
- for (p = dbop_first(gtop->dbop, NULL, 0); p; p = dbop_next(gtop->dbop))
- if (belongto(gtop, key, p))
- dbop_del(gtop->dbop, NULL);
- /*
- * don't delete from path index.
- */
-}
-/*
- * gtagsfirst: return first record
- *
- * i) gtop GTOP structure
- * i) tag tag name
- * i) flags GTOP_PREFIX prefix read
- * GTOP_KEY read key only
- * r) record
- */
-char *
-gtagsfirst(gtop, tag, flags)
-GTOP *gtop;
-char *tag;
-int flags;
-{
- int dbflags = 0;
- char *line;
-
- gtop->flags = flags;
- if (flags & GTOP_PREFIX && tag != NULL)
- dbflags |= DBOP_PREFIX;
- if (flags & GTOP_KEY)
- dbflags |= DBOP_KEY;
- if ((line = dbop_first(gtop->dbop, tag, dbflags)) == NULL)
- return NULL;
- if (gtop->format == GTAGS_STANDARD || gtop->flags & GTOP_KEY)
- return line;
- /*
- * Compact format.
- */
- gtop->line = line; /* gtop->line = $0 */
- gtop->opened = 0;
- return genrecord(gtop);
-}
-/*
- * gtagsnext: return followed record
- *
- * i) gtop GTOP structure
- * r) record
- * NULL end of tag
- */
-char *
-gtagsnext(gtop)
-GTOP *gtop;
-{
- char *line;
-
- /*
- * If it is standard format or only key.
- * Just return it.
- */
- if (gtop->format == GTAGS_STANDARD || gtop->flags & GTOP_KEY)
- return dbop_next(gtop->dbop);
- /*
- * gtop->format & GTAGS_COMPACT
- */
- if ((line = genrecord(gtop)) != NULL)
- return line;
- /*
- * read next record.
- */
- if ((line = dbop_next(gtop->dbop)) == NULL)
- return line;
- gtop->line = line; /* gtop->line = $0 */
- gtop->opened = 0;
- return genrecord(gtop);
-}
-/*
- * gtagsclose: close tag file
- *
- * i) gtop GTOP structure
- */
-void
-gtagsclose(gtop)
-GTOP *gtop;
-{
- if (gtop->format & GTAGS_PATHINDEX || gtop->mode != GTAGS_READ)
- pathclose();
- if (gtop->sb && gtop->prev_tag[0])
- dbop_put(gtop->dbop, gtop->prev_tag, strvalue(gtop->sb));
- if (gtop->sb)
- strclose(gtop->sb);
- dbop_close(gtop->dbop);
- free(gtop);
-}
-static char *
-genrecord(gtop)
-GTOP *gtop;
-{
- static char output[MAXBUFLEN+1];
- char path[MAXPATHLEN+1];
- static char buf[1];
- char *buffer = buf;
- char *lnop;
- int tagline;
-
- if (!gtop->opened) {
- char *p, *q;
-
- gtop->opened = 1;
- p = gtop->line;
- q = gtop->tag; /* gtop->tag = $1 */
- while (!isspace(*p))
- *q++ = *p++;
- *q = 0;
- for (; isspace(*p) ; p++)
- ;
- if (gtop->format & GTAGS_PATHINDEX) { /* gtop->path = $2 */
- char *name;
-
- q = path;
- while (!isspace(*p))
- *q++ = *p++;
- *q = 0;
- if ((name = pathget(path)) == NULL)
- die1("GPATH is corrupted.('%s' not found)", path);
- strcpy(gtop->path, name);
- } else {
- q = gtop->path;
- while (!isspace(*p))
- *q++ = *p++;
- *q = 0;
- }
- for (; isspace(*p) ; p++)
- ;
- gtop->lnop = p; /* gtop->lnop = $3 */
-
- if (gtop->root)
- sprintf(path, "%s/%s", gtop->root, &gtop->path[2]);
- else
- sprintf(path, "%s", &gtop->path[2]);
- if ((gtop->fp = fopen(path, "r")) != NULL) {
- buffer = mgets(gtop->fp, NULL, MGETS_TAILCUT);
- gtop->lno = 1;
- }
- }
-
- lnop = gtop->lnop;
- if (*lnop >= '0' && *lnop <= '9') {
- /* get line number */
- for (tagline = 0; *lnop >= '0' && *lnop <= '9'; lnop++)
- tagline = tagline * 10 + *lnop - '0';
- if (*lnop == ',')
- lnop++;
- gtop->lnop = lnop;
- if (gtop->fp) {
- if (gtop->lno == tagline)
- return output;
- while (gtop->lno < tagline) {
- if (!(buffer = mgets(gtop->fp, NULL, MGETS_TAILCUT)))
- die1("unexpected end of file. '%s'", path);
- gtop->lno++;
- }
- }
- if (strlen(gtop->tag) >= 16 && tagline >= 1000)
- sprintf(output, "%-16s %4d %-16s %s",
- gtop->tag, tagline, gtop->path, buffer);
- else
- sprintf(output, "%-16s%4d %-16s %s",
- gtop->tag, tagline, gtop->path, buffer);
- return output;
- }
- if (gtop->opened && gtop->fp != NULL) {
- gtop->opened = 0;
- fclose(gtop->fp);
- }
- return NULL;
-}
diff --git a/contrib/global/lib/gtagsop.h b/contrib/global/lib/gtagsop.h
deleted file mode 100644
index c6e75d72a63e..000000000000
--- a/contrib/global/lib/gtagsop.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * gtagsop.h 23-Dec-97
- *
- */
-
-#ifndef _GTOP_H_
-#define _GTOP_H_
-#include <stdio.h>
-#include "dbop.h"
-#include "gparam.h"
-#include "strbuf.h"
-
-#define VERSIONKEY " __.VERSION"
-#define COMPACTKEY " __.COMPACT"
-#define PATHINDEXKEY " __.PATHINDEX"
-
-#define GTAGS 0
-#define GRTAGS 1
-#define GSYMS 2
-#define GTAGLIM 3
-
-#define GTAGS_READ 0
-#define GTAGS_CREATE 1
-#define GTAGS_MODIFY 2
-
-/* gtagsopen() */
-#define GTAGS_STANDARD 0 /* standard format */
-#define GTAGS_COMPACT 1 /* compact format */
-#define GTAGS_PATHINDEX 2 /* use path index */
-/* gtagsadd() */
-#define GTAGS_UNIQUE 1 /* compress duplicate lines */
-#define GTAGS_EXTRACTMETHOD 2 /* extract method from class definition */
-/* gtagsfirst() */
-#define GTOP_KEY 1 /* read key part */
-#define GTOP_PREFIX 2 /* prefixed read */
-
-typedef struct {
- DBOP *dbop; /* descripter of DBOP */
- int format_version; /* format version */
- int format; /* GTAGS_STANDARD, GTAGS_COMPACT */
- int mode; /* mode */
- int db; /* 0:GTAGS, 1:GRTAGS, 2:GSYMS */
- int flags; /* flags */
- char root[MAXPATHLEN+1]; /* root directory of source tree */
- /*
- * Stuff for compact format
- */
- int opened; /* wether or not file opened */
- char *line; /* current record */
- char tag[IDENTLEN+1]; /* current tag */
- char prev_tag[IDENTLEN+1]; /* previous tag */
- char path[MAXPATHLEN+1]; /* current path */
- char prev_path[MAXPATHLEN+1];/* previous path */
- STRBUF *sb; /* string buffer */
- FILE *fp; /* descriptor of 'path' */
- char *lnop; /* current line number */
- int lno; /* integer value of 'lnop' */
-} GTOP;
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-const char *dbname __P((int));
-void makecommand __P((char *, char *, STRBUF *));
-int formatcheck __P((char *, int));
-GTOP *gtagsopen __P((char *, char *, int, int, int));
-void gtagsput __P((GTOP *, char *, char *));
-char *gtagsget __P((GTOP *, char *));
-void gtagsadd __P((GTOP *, char *, char *, int));
-void gtagsdelete __P((GTOP *, char *));
-char *gtagsfirst __P((GTOP *, char *, int));
-char *gtagsnext __P((GTOP *));
-void gtagsclose __P((GTOP *));
-
-#endif /* ! _GTOP_H_ */
diff --git a/contrib/global/lib/gtagsopen.c b/contrib/global/lib/gtagsopen.c
new file mode 100644
index 000000000000..90f0481603f5
--- /dev/null
+++ b/contrib/global/lib/gtagsopen.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * gtagsopen.c 20-Oct-97
+ *
+ */
+#include <sys/param.h>
+
+#include <ctype.h>
+#include <db.h>
+#include <fcntl.h>
+#include <stdlib.h>
+
+#include "dbio.h"
+#include "dbname.h"
+#include "die.h"
+#include "gtagsopen.h"
+#include "makepath.h"
+
+#define VERSIONKEY " __.VERSION"
+static int support_version = 1; /* accept this format version */
+
+/*
+ * gtagsopen: open global database.
+ *
+ * i) dbpath dbpath directory
+ * i) db GTAGS, GRTAGS, GSYMS
+ * i) mode 0: read only
+ * 1: write only
+ * 2: read and write
+ * r) DB structure
+ *
+ * when error occurred, gtagopen doesn't return.
+ */
+DBIO *
+gtagsopen(dbpath, db, mode)
+char *dbpath;
+int db;
+int mode;
+{
+ DBIO *dbio;
+ int version_number;
+ char *p;
+
+ /*
+ * allow duplicate records.
+ */
+ dbio = db_open(makepath(dbpath, dbname(db)), mode, 0644, DBIO_DUP);
+ if (dbio == NULL) {
+ if (mode == 1)
+ die1("cannot make database (%s).", makepath(dbpath, dbname(db)));
+ die1("database not found (%s).", makepath(dbpath, dbname(db)));
+ }
+ if (mode == 1) {
+ /* nothing to do now */
+ } else {
+ /*
+ * recognize format version of GTAGS. 'format version record'
+ * is saved as a META record in GTAGS and GRTAGS.
+ * if 'format version record' is not found, it's assumed
+ * version 1.
+ */
+ if ((p = db_get(dbio, VERSIONKEY)) != NULL) {
+ for (p += strlen(VERSIONKEY); *p && isspace(*p); p++)
+ ;
+ version_number = atoi(p);
+ } else
+ version_number = 1;
+ if (version_number > support_version)
+ die("GTAGS seems new format. Please install the latest GLOBAL.");
+ }
+ return dbio;
+}
diff --git a/contrib/global/lib/gtagsopen.h b/contrib/global/lib/gtagsopen.h
new file mode 100644
index 000000000000..2afb2ab56892
--- /dev/null
+++ b/contrib/global/lib/gtagsopen.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * gtagsopen.h 16-Oct-97
+ *
+ */
+
+#ifndef _GTAGSOPEN_H_
+#define _GTAGSOPEN_H_
+#include "dbio.h"
+
+DBIO *gtagsopen __P((char *, int, int));
+
+#endif /* ! _GTAGSOPEN_H_ */
diff --git a/contrib/global/lib/locatestring.c b/contrib/global/lib/locatestring.c
index 76285994befb..230ccce5149a 100644
--- a/contrib/global/lib/locatestring.c
+++ b/contrib/global/lib/locatestring.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * locatestring.c 25-Jul-98
+ * locatestring.c 20-Oct-97
*
*/
#include <string.h>
@@ -40,36 +40,35 @@
*
* i) string string
* i) pattern pattern
- * i) flag MATCH_FIRST: match first
- * MATCH_AT_FIRST: match only at first column
- * MATCH_LAST: match last
- * MATCH_AT_LAST: match only at last column
+ * i) flag 0: match first
+ * 1: match only at first column
+ * 2: match last
+ * 3: match only at last column
* r) pointer or NULL
*
* This function is made to avoid compatibility problems.
*/
char *
locatestring(string, pattern, flag)
-const char *string;
-const char *pattern;
+char *string;
+char *pattern;
int flag;
{
int c = *pattern;
- int slen, plen;
- const char *p = NULL;
+ char *p = (char *)0;
- plen = strlen(pattern);
- if (flag == MATCH_AT_LAST && (slen = strlen(string)) > plen)
- string += (slen - plen);
+ if (flag == 3 && strlen(string) > strlen(pattern)) {
+ string += strlen(string) - strlen(pattern);
+ }
for (; *string; string++) {
if (*string == c)
- if (!strncmp(string, pattern, plen)) {
+ if (!strncmp(string, pattern, strlen(pattern))) {
p = string;
- if (flag == MATCH_FIRST)
+ if (flag == 0)
break;
}
- if (flag == MATCH_AT_FIRST || flag == MATCH_AT_LAST)
+ if (flag == 1 || flag == 3)
break;
}
- return (char *)p;
+ return p;
}
diff --git a/contrib/global/lib/locatestring.h b/contrib/global/lib/locatestring.h
index 2b881c6f447e..cdaeedb1e5b0 100644
--- a/contrib/global/lib/locatestring.h
+++ b/contrib/global/lib/locatestring.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,18 +28,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * locatestring.h 25-Jul-98
+ * locatestring.h 16-Oct-97
*
*/
#ifndef _LOCATESTRING_H_
#define _LOCATESTRING_H_
-#define MATCH_FIRST 0
-#define MATCH_AT_FIRST 1
-#define MATCH_LAST 2
-#define MATCH_AT_LAST 3
-
#ifndef __P
#if defined(__STDC__)
#define __P(protos) protos
@@ -48,6 +43,6 @@
#endif
#endif
-char *locatestring __P((const char *, const char *, int));
+char *locatestring __P((char *, char *, int));
#endif /* ! _LOCATESTRING_H_ */
diff --git a/contrib/global/lib/lookup.c b/contrib/global/lib/lookup.c
new file mode 100644
index 000000000000..d317ba6f3434
--- /dev/null
+++ b/contrib/global/lib/lookup.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * lookup.c 20-Oct-97
+ *
+ */
+#include "gtagsopen.h"
+#include "lookup.h"
+#include "dbio.h"
+#include "die.h"
+#include "dbname.h"
+
+static DBIO *dbio;
+static int opened;
+
+void
+lookupopen(dbpath)
+char *dbpath;
+{
+ if (opened)
+ die("nested call to lookupopen.");
+ opened = 1;
+ dbio = gtagsopen(dbpath, GTAGS, 0);
+}
+int
+lookup(name)
+char *name;
+{
+ char *p = db_get(dbio, name);
+ return (p) ? 1 : 0;
+}
+void
+lookupclose(void)
+{
+ db_close(dbio);
+ opened = 0;
+}
diff --git a/contrib/global/lib/lookup.h b/contrib/global/lib/lookup.h
new file mode 100644
index 000000000000..037102f53600
--- /dev/null
+++ b/contrib/global/lib/lookup.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * lookup.h 16-Oct-97
+ *
+ */
+
+#ifndef _LOOKUP_H_
+#define _LOOKUP_H_
+
+#ifndef __P
+#if defined(__STDC__)
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+void lookupopen __P((char *));
+int lookup __P((char *));
+void lookupclose __P((void));
+
+#endif /* ! _LOOKUP_H_ */
diff --git a/contrib/global/lib/makepath.c b/contrib/global/lib/makepath.c
index 26de06532454..7efba18dd293 100644
--- a/contrib/global/lib/makepath.c
+++ b/contrib/global/lib/makepath.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,16 +28,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * makepath.c 15-May-98
+ * makepath.c 20-Oct-97
*
*/
#include <string.h>
#include <sys/param.h>
-#include "die.h"
#include "makepath.h"
-#include "strbuf.h"
-
-static STRBUF *sb;
/*
* makepath: make path from directory and file.
*
@@ -47,21 +43,16 @@ static STRBUF *sb;
*/
char *
makepath(dir, file)
-const char *dir;
-const char *file;
+char *dir;
+char *file;
{
- int length;
+ static char path[MAXPATHLEN+1];
+ char *p;
- if (sb == NULL)
- sb = stropen();
- strstart(sb);
- if ((length = strlen(dir)) > MAXPATHLEN)
- die1("path name too long. '%s'\n", dir);
- strputs(sb, dir);
- strunputc(sb, '/');
- strputc(sb, '/');
- strputs(sb, file);
- if ((length = strlen(strvalue(sb))) > MAXPATHLEN)
- die1("path name too long. '%s'\n", dir);
- return strvalue(sb);
+ strcpy(path, dir);
+ p = path + strlen(path);
+ if (*(p - 1) != '/')
+ *p++ = '/';
+ strcpy(p, file);
+ return path;
}
diff --git a/contrib/global/lib/makepath.h b/contrib/global/lib/makepath.h
index 74b1c16f7620..47d292d482dc 100644
--- a/contrib/global/lib/makepath.h
+++ b/contrib/global/lib/makepath.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,6 +43,6 @@
#endif
#endif
-char *makepath __P((const char *, const char *));
+char *makepath __P((char *, char *));
#endif /* ! _MAKEPATH_H_ */
diff --git a/contrib/global/lib/mgets.c b/contrib/global/lib/mgets.c
index 6b9bb731f70c..b30cae643936 100644
--- a/contrib/global/lib/mgets.c
+++ b/contrib/global/lib/mgets.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,20 +28,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * mgets.c 29-Aug-98
+ * mgets.c 8-Nov-97
*
*/
-#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "die.h"
#include "mgets.h"
+#include "die.h"
-#define EXPANDSIZE 127
-#define MINSIZE 16
-
+#define EXPANDSIZE 512
static int mbufsize = EXPANDSIZE;
static char *mbuf;
@@ -49,21 +46,20 @@ static char *mbuf;
* mgets: read whole record into allocated buffer
*
* i) ip input stream
- * o) length record length
* i) flags flags
- * MGETS_CONT \\ + \n -> ''
+ * MGETS_CONT \\ + \n -> \n
* MGETS_SKIPCOM skip line which start with '#'.
- * MGETS_TAILCUT remove following blanks
+ * o) length length of record
* r) record buffer (NULL at end of file)
*
* Returned buffer has whole record.
* The buffer end with '\0' and doesn't include '\r' and '\n'.
*/
char *
-mgets(ip, length, flags)
+mgets(ip, flags, length)
FILE *ip;
-int *length;
int flags;
+int *length;
{
char *p;
@@ -77,33 +73,27 @@ int flags;
* read whole record.
*/
if (!fgets(mbuf, mbufsize, ip))
- return NULL;
+ return (char *)0;
if (flags & MGETS_SKIPCOM)
while (*mbuf == '#')
if (!fgets(mbuf, mbufsize, ip))
- return NULL;
+ return (char *)0;
p = mbuf + strlen(mbuf);
-
for (;;) {
/*
* get a line.
*/
while (*(p - 1) != '\n') {
/*
- * expand buffer and read additionally.
+ * expand and read additionally.
*/
int count = p - mbuf;
-
- if (mbufsize - count < MINSIZE) {
- mbufsize += EXPANDSIZE;
- if (!(mbuf = (char *)realloc(mbuf, mbufsize + 1)))
- die("short of memory.");
- p = mbuf + count;
- }
- if (!fgets(p, mbufsize - count, ip)) {
- *p++ = '\n';
- break;
- }
+ mbufsize += EXPANDSIZE;
+ if (!(mbuf = (char *)realloc(mbuf, mbufsize + 1)))
+ die("short of memory.");
+ p = mbuf + count;
+ if (!fgets(p, mbufsize - count, ip))
+ die("illegal end of file.");
p += strlen(p);
}
/*
@@ -120,17 +110,6 @@ int flags;
else
break;
}
-/*
- if (flags & MGETS_SKIPCOM)
- for (p = mbuf; *p; p++)
- if (*p == '#') {
- *p = 0;
- break;
- }
-*/
- if (flags & MGETS_TAILCUT)
- while (isspace(*(--p)))
- *p = 0;
if (length)
*length = p - mbuf;
return mbuf;
diff --git a/contrib/global/lib/mgets.h b/contrib/global/lib/mgets.h
index 75b5e831268f..ea3aef2fa8d8 100644
--- a/contrib/global/lib/mgets.h
+++ b/contrib/global/lib/mgets.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redilogibution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,7 +37,6 @@
#include <stdio.h>
#define MGETS_CONT 1
#define MGETS_SKIPCOM 2
-#define MGETS_TAILCUT 4
#ifndef __P
#if defined(__STDC__)
@@ -47,6 +46,6 @@
#endif
#endif
-char *mgets __P((FILE *, int *, int));
+char *mgets __P((FILE *, int, int *));
#endif /* ! _MGETS_H_ */
diff --git a/contrib/global/lib/pathop.c b/contrib/global/lib/pathop.c
deleted file mode 100644
index 2eb9e6982675..000000000000
--- a/contrib/global/lib/pathop.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * pathop.c 12-Nov-98
- *
- */
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "die.h"
-#include "dbop.h"
-#include "makepath.h"
-#include "pathop.h"
-
-static DBOP *dbop;
-static const char *gpath = "GPATH";
-static int _nextkey;
-static int _mode;
-static int opened;
-static int created;
-
-/*
- * pathopen: open path dictionary tag.
- *
- * i) mode 0: read only
- * 1: create
- * 2: modify
- * r) 0: normal
- * -1: error
- */
-int
-pathopen(dbpath, mode)
-char *dbpath;
-int mode;
-{
- char *p;
-
- assert(opened == 0);
- /*
- * We create GPATH just first time.
- */
- _mode = mode;
- if (mode == 1 && created)
- mode = 0;
- dbop = dbop_open(makepath(dbpath, gpath), mode, 0644, 0);
- if (dbop == NULL)
- return -1;
- if (mode == 1)
- _nextkey = 0;
- else {
- if (!(p = dbop_get(dbop, NEXTKEY)))
- die("nextkey not found in GPATH.");
- _nextkey = atoi(p);
- }
- opened = 1;
- return 0;
-}
-void
-pathput(path)
-char *path;
-{
- char buf[10];
-
- assert(opened == 1);
- if (_mode == 1 && created)
- return;
- if (dbop_get(dbop, path) != NULL)
- return;
- sprintf(buf, "%d", _nextkey++);
- dbop_put(dbop, path, buf);
- dbop_put(dbop, buf, path);
-}
-char *
-pathget(key)
-char *key;
-{
- assert(opened == 1);
- return dbop_get(dbop, key);
-}
-char *
-pathiget(n)
-int n;
-{
- char key[80];
- assert(opened == 1);
- sprintf(key, "%d", n);
- return dbop_get(dbop, key);
-}
-void
-pathdel(key)
-char *key;
-{
- char *d;
-
- assert(opened == 1);
- assert(_mode == 2);
- assert(key[0] == '.' && key[1] == '/');
- d = dbop_get(dbop, key);
- if (d == NULL)
- return;
- dbop_del(dbop, d);
- dbop_del(dbop, key);
-}
-int
-nextkey(void)
-{
- assert(_mode != 1);
- return _nextkey;
-}
-void
-pathclose(void)
-{
- char buf[10];
-
- assert(opened == 1);
- opened = 0;
- if (_mode == 1 && created) {
- dbop_close(dbop);
- return;
- }
- sprintf(buf, "%d", _nextkey);
- if (_mode == 1 || _mode == 2)
- dbop_put(dbop, NEXTKEY, buf);
- dbop_close(dbop);
- if (_mode == 1)
- created = 1;
-}
diff --git a/contrib/global/lib/pathop.h b/contrib/global/lib/pathop.h
deleted file mode 100644
index 5bfef5dbaf55..000000000000
--- a/contrib/global/lib/pathop.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * pathop.h 14-May-98
- *
- */
-
-#ifndef _PATHOP_H_
-#define _PATHOP_H_
-#include <stdio.h>
-#include "dbop.h"
-#include "gparam.h"
-
-#define NEXTKEY " __.NEXTKEY"
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-int pathopen __P((char *, int));
-char *pathget __P((char *));
-char *pathiget __P((int));
-void pathput __P((char *));
-void pathdel __P((char *));
-void pathclose __P((void));
-int nextkey __P((void));
-
-#endif /* ! _PATHOP_H_ */
diff --git a/contrib/global/lib/strbuf.c b/contrib/global/lib/strbuf.c
deleted file mode 100644
index 3df14c9ee370..000000000000
--- a/contrib/global/lib/strbuf.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * strbuf.c 5-Jul-98
- *
- */
-#include <stdlib.h>
-#include <string.h>
-
-#include "die.h"
-#include "strbuf.h"
-
-/*
- * usage: string buffer
- *
- * sb = stropen();
- * for (s = string; *s; s++)
- * strputc(sb, *s);
- * s = strvalue(sb);
- * strstart(sb);
- * strputs(sb, "hello");
- * s = strvalue(sb);
- * strclose(sb);
- */
-/*
- * expandbuf: expand buffer so that afford to the length data at least.
- *
- * i) sb STRBUF structure
- * i) length required room
- */
-void
-expandbuf(sb, length)
-STRBUF *sb;
-int length;
-{
- int count = sb->curp - sb->sbuf;
-
- sb->sbufsize += (length > EXPANDSIZE) ? length : EXPANDSIZE;
- if (!(sb->sbuf = (char *)realloc(sb->sbuf, sb->sbufsize + 1)))
- die("short of memory.");
- sb->curp = sb->sbuf + count;
- sb->endp = sb->sbuf + sb->sbufsize;
-}
-/*
- * stropen: open string buffer.
- *
- * r) sb STRBUF structure
- */
-STRBUF *
-stropen(void)
-{
- STRBUF *sb = (STRBUF *)calloc(sizeof(STRBUF), 1);
-
- if (sb == NULL)
- die("short of memory.");
- sb->sbufsize = INITIALSIZE;
- if (!(sb->sbuf = (char *)malloc(sb->sbufsize + 1)))
- die("short of memory.");
- sb->curp = sb->sbuf;
- sb->endp = sb->sbuf + sb->sbufsize;
-
- return sb;
-}
-/*
- * strstart: reset string buffer for new string.
- *
- * i) sb STRBUF structure
- */
-void
-strstart(sb)
-STRBUF *sb;
-{
- sb->curp = sb->sbuf;
-}
-/*
- * strbuflen: return the length of string buffer.
- *
- * i) sb STRBUF structure
- */
-int
-strbuflen(sb)
-STRBUF *sb;
-{
- return sb->curp - sb->sbuf;
-}
-/*
- * strvalue: return the content of string buffer.
- *
- * i) sb STRBUF structure
- * r) string
- */
-char *
-strvalue(sb)
-STRBUF *sb;
-{
- *sb->curp = 0;
- return sb->sbuf;
-}
-/*
- * strclose: close string buffer.
- *
- * i) sb STRBUF structure
- */
-void
-strclose(sb)
-STRBUF *sb;
-{
- (void)free(sb->sbuf);
- (void)free(sb);
-}
diff --git a/contrib/global/lib/strbuf.h b/contrib/global/lib/strbuf.h
deleted file mode 100644
index e62c7ab3e034..000000000000
--- a/contrib/global/lib/strbuf.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * strbuf.h 5-Jul-98
- *
- */
-
-#ifndef _STRBUF_H
-#define _STRBUF_H
-
-#include <string.h>
-#define INITIALSIZE 80
-#define EXPANDSIZE 80
-
-typedef struct {
- char *sbuf;
- char *endp;
- char *curp;
- int sbufsize;
-} STRBUF;
-
-#define strputc(sb,c) do {\
- if (sb->curp + 1 > sb->endp)\
- expandbuf(sb, 0);\
- *sb->curp++ = c;\
-} while (0)
-#define strunputc(sb,c) do {\
- if (sb->curp > sb->sbuf && *(sb->curp - 1) == c)\
- sb->curp--;\
-} while (0)
-#define strnputs(sb, s, len) do {\
- unsigned int _length = len;\
- if (sb->curp + _length > sb->endp)\
- expandbuf(sb, _length);\
- strncpy(sb->curp, s, _length);\
- sb->curp += _length;\
-} while (0)
-#define strputs(sb, s) strnputs(sb, s, strlen(s))
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-void expandbuf __P((STRBUF *, int));
-STRBUF *stropen __P((void));
-void strstart __P((STRBUF *));
-int strbuflen __P((STRBUF *));
-char *strvalue __P((STRBUF *));
-void strclose __P((STRBUF *));
-
-#endif /* ! _STRBUF_H */
diff --git a/contrib/global/lib/strmake.c b/contrib/global/lib/strmake.c
deleted file mode 100644
index da5dea4f25be..000000000000
--- a/contrib/global/lib/strmake.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * strmake.c 15-May-98
- *
- */
-#include <stdlib.h>
-
-#include "strbuf.h"
-#include "strmake.h"
-
-static STRBUF *sb;
-
-char *
-strmake(p, lim)
-const char *p;
-const char *lim;
-{
- const char *c;
-
- if (sb == NULL)
- sb = stropen();
- strstart(sb);
- for (; *p; p++) {
- for (c = lim; *c; c++)
- if (*p == *c)
- goto end;
- strputc(sb,*p);
- }
-end:
- return strvalue(sb);
-}
diff --git a/contrib/global/lib/strmake.h b/contrib/global/lib/strmake.h
deleted file mode 100644
index 3558c5514972..000000000000
--- a/contrib/global/lib/strmake.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * strmake.h 17-Apr-98
- *
- */
-
-#ifndef _STRMAKE_H_
-#define _STRMAKE_H_
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-char *strmake __P((const char *, const char *));
-
-#endif /* ! _STRMAKE_H_ */
diff --git a/contrib/global/lib/strop.c b/contrib/global/lib/strop.c
new file mode 100644
index 000000000000..b024abca8371
--- /dev/null
+++ b/contrib/global/lib/strop.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * strop.c 20-Oct-97
+ *
+ */
+#include <stdlib.h>
+#include <string.h>
+
+#include "die.h"
+#include "strop.h"
+
+/*
+ * usage: string buffer
+ *
+ * stropen();
+ * for (s = string; *s; s++)
+ * strputc(*s);
+ * s = strclose();
+ */
+#define EXPANDSIZE 80
+static char *sbuf;
+static char *endp;
+static char *curp;
+static int sbufsize;
+static int opened;
+
+void
+stropen(void)
+{
+ if (opened)
+ die("nested call to stropen.");
+ opened = 1;
+ /*
+ * allocate initial buffer.
+ */
+ if (!sbuf)
+ if (!(sbuf = (char *)malloc(sbufsize + 1)))
+ die("short of memory.");
+ curp = sbuf;
+ endp = sbuf + sbufsize;
+ *curp = 0;
+}
+void
+strputs(s)
+char *s;
+{
+ int length = strlen(s);
+
+ strnputs(s, length);
+}
+void
+strnputs(s, length)
+char *s;
+int length;
+{
+ if (curp + length > endp) {
+ int count = curp - sbuf;
+
+ sbufsize += (length > EXPANDSIZE) ? length : EXPANDSIZE;
+ if (!(sbuf = (char *)realloc(sbuf, sbufsize + 1)))
+ die("short of memory.");
+ curp = sbuf + count;
+ endp = sbuf + sbufsize;
+ }
+ strncpy(curp, s, length);
+ curp += length;
+ *curp = 0;
+}
+void
+strputc(c)
+int c;
+{
+ if (curp + 1 > endp) {
+ int count = curp - sbuf;
+
+ sbufsize += EXPANDSIZE;
+ if (!(sbuf = (char *)realloc(sbuf, sbufsize + 1)))
+ die("short of memory.");
+ curp = sbuf + count;
+ endp = sbuf + sbufsize;
+ }
+ *curp++ = c;
+ *curp = 0;
+}
+char *
+strclose(void)
+{
+ opened = 0;
+ /*
+ * doesn't free area in current implementation.
+ */
+ return sbuf;
+}
diff --git a/contrib/global/lib/strop.h b/contrib/global/lib/strop.h
new file mode 100644
index 000000000000..9289566d0097
--- /dev/null
+++ b/contrib/global/lib/strop.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * strop.h 16-Oct-97
+ *
+ */
+
+#ifndef _STROP_H_
+#define _STROP_H_
+
+#ifndef __P
+#if defined(__STDC__)
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+void stropen __P((void));
+void strputs __P((char *));
+void strnputs __P((char *, int));
+void strputc __P((int));
+char *strclose __P((void));
+
+#endif /* ! _STROP_H_ */
diff --git a/contrib/global/lib/tab.c b/contrib/global/lib/tab.c
index 1a9896ff8b26..d309386a2d41 100644
--- a/contrib/global/lib/tab.c
+++ b/contrib/global/lib/tab.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,29 +28,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * tab.c 8-Oct-98
+ * tab.c 20-Oct-97
*
*/
#include <stdio.h>
#include "tab.h"
-static int tabs = 8;
-
-#define TABPOS(i) ((i)%tabs == 0)
-/*
- * settabs: set default tab stop
- *
- * i) n tab stop
- */
-void
-settabs(n)
-int n;
-{
- if (n < 1 || n > 32)
- return;
- tabs = n;
-}
+#define TABPOS(i) ((i)%8 == 0)
/*
* detab: convert tabs into spaces and print
*
@@ -99,8 +84,7 @@ char *buf;
blanks++; /* count blanks */
continue;
}
- /* don't convert single blank into tab */
- buf[dst++] = (blanks == 0) ? ' ' : '\t';
+ buf[dst++] = '\t';
} else if (c == '\t') {
while (!TABPOS(++pos))
;
@@ -113,8 +97,5 @@ char *buf;
}
blanks = 0;
}
- if (blanks > 0)
- while (blanks--)
- buf[dst++] = ' ';
buf[dst] = 0;
}
diff --git a/contrib/global/lib/tab.h b/contrib/global/lib/tab.h
index 6153ff186c31..c2b507969506 100644
--- a/contrib/global/lib/tab.h
+++ b/contrib/global/lib/tab.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * tab.h 8-Oct-98
+ * tab.h 16-Oct-97
*
*/
@@ -43,7 +43,6 @@
#endif
#endif
-void settabs __P((int));
void detab __P((FILE *, char *));
void entab __P((char *));
diff --git a/contrib/global/lib/tag.c b/contrib/global/lib/tag.c
new file mode 100644
index 000000000000..e80d634c2708
--- /dev/null
+++ b/contrib/global/lib/tag.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * tag.c 20-Oct-97
+ *
+ */
+#include <ctype.h>
+#include <string.h>
+
+#include "dbio.h"
+#include "die.h"
+#include "gtagsopen.h"
+#include "locatestring.h"
+#include "tab.h"
+#include "tag.h"
+
+
+static DBIO *dbio;
+static int opened;
+
+void
+tagopen(dbpath, db, mode)
+char *dbpath;
+int db;
+int mode;
+{
+ if (opened)
+ die("nested call to tagopen.");
+ opened = 1;
+ dbio = gtagsopen(dbpath, db, mode);
+}
+void
+tagput(entry, record)
+char *entry;
+char *record;
+{
+ entab(record);
+ db_put(dbio, entry, record);
+}
+void
+tagdelete(path)
+char *path;
+{
+ char *p;
+ int length = strlen(path);
+
+ for (p = db_first(dbio, NULL, DBIO_SKIPMETA); p; p = db_next(dbio)) {
+ p = locatestring(p, "./", 0);
+ if (!strncmp(p, path, length) && isspace(*(p + length)))
+ db_del(dbio, NULL);
+ }
+}
+void
+tagclose(void)
+{
+ db_close(dbio);
+ opened = 0;
+}
diff --git a/contrib/global/lib/tag.h b/contrib/global/lib/tag.h
new file mode 100644
index 000000000000..8bac2ac2f9b6
--- /dev/null
+++ b/contrib/global/lib/tag.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Shigio Yamaguchi.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * 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.
+ *
+ * tag.h 16-Oct-97
+ *
+ */
+
+#ifndef _TAG_H_
+#define _TAG_H_
+
+#ifndef __P
+#if defined(__STDC__)
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+void tagopen __P((char *, int, int));
+void tagput __P((char *, char *));
+void tagdelete __P((char *));
+void tagclose __P((void));
+
+#endif /* ! _TAG_H_ */
diff --git a/contrib/global/lib/test.c b/contrib/global/lib/test.c
index d5c940ea294c..a3b5966e26a4 100644
--- a/contrib/global/lib/test.c
+++ b/contrib/global/lib/test.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,8 +31,8 @@
* test.c 12-Dec-97
*
*/
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
@@ -50,23 +50,21 @@
* "x" [ -x path ]
*
* i) path path
- * if NULL then previous path.
* r) 0: no, 1: ok
*
* You can specify more than one character. It assumed 'and' test.
*/
int
test(flags, path)
-const char *flags;
-const char *path;
+char *flags;
+char *path;
{
- static struct stat sb;
+ struct stat sb;
int c;
- if (path != NULL)
- if (stat(path, &sb) < 0)
- return 0;
- while ((c = *flags++) != 0) {
+ if (stat(path, &sb) < 0)
+ return 0;
+ while ((c = *flags++) != NULL) {
switch (c) {
case 'f':
if (!S_ISREG(sb.st_mode))
diff --git a/contrib/global/lib/test.h b/contrib/global/lib/test.h
index c44ee48bb340..edadbdaafd7a 100644
--- a/contrib/global/lib/test.h
+++ b/contrib/global/lib/test.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. All rights reserved.
+ * Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,6 +43,6 @@
#endif
#endif
-int test __P((const char *, const char *));
+int test __P((char *, char *));
#endif /* ! _TEST_H_ */
diff --git a/contrib/global/lib/token.c b/contrib/global/lib/token.c
deleted file mode 100644
index 27dbe4226eef..000000000000
--- a/contrib/global/lib/token.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * token.c 14-Aug-98
- */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/param.h>
-
-#include "mgets.h"
-#include "token.h"
-
-/*
- * File input method.
- */
-int lineno;
-char *sp, *cp, *lp;
-int crflag; /* 1: return '\n', 0: doesn't return */
-int cmode; /* allow token which start with '#' */
-int ymode; /* allow token which start with '%' */
-char token[MAXTOKEN];
-char curfile[MAXPATHLEN];
-
-static char ptok[MAXTOKEN];
-static int lasttok;
-static FILE *ip;
-
-static void pushbackchar __P((void));
-
-/*
- * opentoken:
- */
-int
-opentoken(file)
- char *file;
-{
- if ((ip = fopen(file, "r")) == NULL)
- return 0;
- strcpy(curfile, file);
- sp = cp = lp = NULL; lineno = 0;
- return 1;
-}
-/*
- * closetoken:
- */
-void
-closetoken()
-{
- fclose(ip);
-}
-
-/*
- * nexttoken: get next token
- *
- * i) interested interested special charactor
- * if NULL then all charactor.
- * i) reserved converter from token to token number
- * if this is specified, nexttoken() return
- * word number, else return symbol.
- * r) EOF(-1) end of file
- * ==0 symbol ('tok' has the value.)
- * > 255 reserved word
- * <=255 interested special charactor
- *
- * nexttoken() doesn't return followings.
- *
- * o comment
- * o space (' ', '\t', '\f')
- * o quoted string ("...", '.')
- */
-
-int
-nexttoken(interested, reserved)
- const char *interested;
- int (*reserved)(char *);
-{
- int c;
- char *p;
- int sharp = 0;
- int percent = 0;
-
- /* check push back buffer */
- if (ptok[0]) {
- strcpy(token, ptok);
- ptok[0] = 0;
- return lasttok;
- }
-
- for (;;) {
- /* skip spaces */
- if (!crflag)
- while ((c = nextchar()) != EOF && isspace(c))
- ;
- else
- while ((c = nextchar()) != EOF && (c == ' ' || c == '\t' || c == '\f'))
- ;
- if (c == EOF || c == '\n')
- break;
-
- if (c == '"' || c == '\'') { /* quoted string */
- int quote = c;
-
- while ((c = nextchar()) != EOF) {
- if (c == quote)
- break;
- if (quote == '\'' && c == '\n')
- break;
- if (c == '\\' && (c = nextchar()) == EOF)
- break;
- }
- } else if (c == '/') { /* comment */
- if ((c = nextchar()) == '/') {
- while ((c = nextchar()) != EOF)
- if (c == '\n')
- break;
- } else if (c == '*') {
- while ((c = nextchar()) != EOF) {
- if (c == '*') {
- if ((c = nextchar()) == '/')
- break;
- pushbackchar();
- }
- }
- } else
- pushbackchar();
- } else if (c == '\\') {
- (void)nextchar();
- } else if (isdigit(c)) { /* digit */
- while ((c = nextchar()) != EOF && (c == '.' || isdigit(c) || isalpha(c)))
- ;
- pushbackchar();
- } else if (c == '#' && cmode) {
- /* recognize '##' as a token if it is reserved word. */
- if (peekc(1) == '#') {
- p = token;
- *p++ = c;
- *p++ = nextchar();
- *p = 0;
- if (reserved && (c = (*reserved)(token)) == 0)
- break;
- } else if (atfirst_exceptspace()) {
- sharp = 1;
- continue;
- }
- } else if (c == '%' && ymode) {
- /* recognize '%%' as a token if it is reserved word. */
- if (atfirst) {
- p = token;
- *p++ = c;
- if ((c = peekc(1)) == '%' || c == '{' || c == '}') {
- *p++ = nextchar();
- *p = 0;
- if (reserved && (c = (*reserved)(token)) != 0)
- break;
- } else if (!isspace(c)) {
- percent = 1;
- continue;
- }
- }
- } else if (c & 0x80 || isalpha(c) || c == '_') {/* symbol */
- p = token;
- if (sharp) {
- sharp = 0;
- *p++ = '#';
- } else if (percent) {
- percent = 0;
- *p++ = '%';
- }
- for (*p++ = c; (c = nextchar()) != EOF && (c & 0x80 || isalnum(c) || c == '_'); *p++ = c)
- ;
- *p = 0;
- if (c != EOF)
- pushbackchar();
- /* convert token string into token number */
- if (reserved)
- c = (*reserved)(token);
- break;
- } else { /* special char */
- if (interested == NULL || strchr(interested, c))
- break;
- /* otherwise ignore it */
- }
- sharp = percent = 0;
- }
- return lasttok = c;
-}
-/*
- * pushbacktoken: push back token
- *
- * following nexttoken() return same token again.
- */
-void
-pushbacktoken()
-{
- strcpy(ptok, token);
-}
-/*
- * peekc: peek next char
- *
- * i) immediate 0: ignore blank, 1: include blank
- *
- * Peekc() read ahead following blanks but doesn't chage line.
- */
-int
-peekc(immediate)
- int immediate;
-{
- int c;
- long pos;
-
- if (cp != NULL) {
- if (immediate)
- c = nextchar();
- else
- while ((c = nextchar()) != EOF && c != '\n' && isspace(c))
- ;
- if (c != EOF)
- pushbackchar();
- if (c != '\n' || immediate)
- return c;
- }
- pos = ftell(ip);
- if (immediate)
- c = getc(ip);
- else
- while ((c = getc(ip)) != EOF && isspace(c))
- ;
- (void)fseek(ip, pos, SEEK_SET);
-
- return c;
-}
-/*
- * atfirst_exceptspace: return if current position is the first column
- * except for space.
- * | 1 0
- * | v v
- * | # define
- */
-int
-atfirst_exceptspace()
-{
- char *start = sp;
- char *end = cp ? cp - 1 : lp;
-
- while (start < end && *start && isspace(*start))
- start++;
- return (start == end) ? 1 : 0;
-}
-/*
- * pushbackchar: push back charactor.
- *
- * following nextchar() return same charactor again.
- *
- */
-static void
-pushbackchar()
-{
- if (sp == NULL)
- return; /* nothing to do */
- if (cp == NULL)
- cp = lp;
- else
- --cp;
-}
diff --git a/contrib/global/lib/token.h b/contrib/global/lib/token.h
deleted file mode 100644
index 571b8505c88d..000000000000
--- a/contrib/global/lib/token.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * token.h 14-Aug-98
- */
-
-#ifndef _TOKEN_H_
-#define _TOKEN_H_
-
-#include <sys/param.h>
-#include "mgets.h"
-#define MAXTOKEN 512
-#define SYMBOL 0
-
-extern char *sp, *cp, *lp;
-extern int lineno;
-extern int crflag;
-extern int cmode;
-extern int ymode;
-extern char token[MAXTOKEN];
-extern char curfile[MAXPATHLEN];
-
-#define nextchar() \
- (cp == NULL ? \
- ((sp = cp = mgets(ip, NULL, 0)) == NULL ? \
- EOF : \
- (lineno++, *cp == 0 ? \
- lp = cp, cp = NULL, '\n' : \
- *cp++)) : \
- (*cp == 0 ? (lp = cp, cp = NULL, '\n') : *cp++))
-#define atfirst (sp && sp == (cp ? cp - 1 : lp))
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-int opentoken __P((char *));
-void closetoken __P((void));
-int nexttoken __P((const char *, int (*)(char *)));
-void pushbacktoken __P((void));
-int peekc __P((int));
-int atfirst_exceptspace __P((void));
-
-#endif /* ! _TOKEN_H_ */
diff --git a/contrib/global/lib/usable.c b/contrib/global/lib/usable.c
deleted file mode 100644
index af8dd0ab0fbb..000000000000
--- a/contrib/global/lib/usable.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * usable.c 22-Jun-98
- *
- */
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "locatestring.h"
-#include "gparam.h"
-#include "makepath.h"
-#include "test.h"
-#include "usable.h"
-
-/*
- * usable: check executable or not about the command.
- *
- * i) command
- * r) 1: executable
- * 0: non executable
- */
-int
-usable(command)
-char *command;
-{
- char buf[MAXENVLEN+1], *p, *dir;
-
- if (*command == '/' || locatestring(command, "./", MATCH_AT_FIRST) || locatestring(command, "../", MATCH_AT_FIRST))
- return test("fx", command);
-
- strcpy(buf, getenv("PATH"));
- p = buf;
- while (p) {
- dir = p;
- if ((p = locatestring(p, ":", MATCH_FIRST)) != NULL)
- *p++ = 0;
- if (test("fx", makepath(dir, command)))
- return 1;
- }
- return 0;
-}
diff --git a/contrib/global/lib/usable.h b/contrib/global/lib/usable.h
deleted file mode 100644
index 647769d7ac4a..000000000000
--- a/contrib/global/lib/usable.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, 1998 Shigio Yamaguchi. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Shigio Yamaguchi.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- * usable.h 22-Jul-98
- *
- */
-
-#ifndef _USABLE_H_
-#define _USABLE_H_
-
-#ifndef __P
-#if defined(__STDC__)
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-
-int usable __P((char *));
-
-#endif /* ! _USABLE_H_ */
diff --git a/contrib/global/nvi-1.34.diff b/contrib/global/nvi-1.34.diff
new file mode 100644
index 000000000000..f289e9a8fa98
--- /dev/null
+++ b/contrib/global/nvi-1.34.diff
@@ -0,0 +1,900 @@
+diff -c -r -N /usr/src/usr.bin/vi/USD.doc/vi.man/vi.1 ./USD.doc/vi.man/vi.1
+*** /usr/src/usr.bin/vi/USD.doc/vi.man/vi.1 Wed Aug 17 08:36:39 1994
+--- ./USD.doc/vi.man/vi.1 Sat Dec 14 11:54:14 1996
+***************
+*** 39,59 ****
+ .Nd text editors
+ .Sh SYNOPSIS
+ .Nm \&ex
+! .Op Fl eFRrsv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+ .\".Op Fl X Ar \&aw
+ .Op Ar "file ..."
+ .Nm \&vi
+! .Op Fl eFRrv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+ .\".Op Fl X Ar \&aw
+ .Op Ar "file ..."
+ .Nm view
+! .Op Fl eFRrv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+--- 39,59 ----
+ .Nd text editors
+ .Sh SYNOPSIS
+ .Nm \&ex
+! .Op Fl eFGRrsv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+ .\".Op Fl X Ar \&aw
+ .Op Ar "file ..."
+ .Nm \&vi
+! .Op Fl eFGRrv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+ .\".Op Fl X Ar \&aw
+ .Op Ar "file ..."
+ .Nm view
+! .Op Fl eFGRrv
+ .Op Fl c Ar cmd
+ .Op Fl t Ar tag
+ .Op Fl w Ar size
+***************
+*** 124,129 ****
+--- 124,131 ----
+ Don't copy the entire file when first starting to edit.
+ (The default is to make a copy in case someone else modifies
+ the file during your edit session.)
++ .It Fl G
++ Start editing in gtags mode, as if the gtagsmode option was set.
+ .It Fl R
+ Start editing in read-only mode, as if the command name was
+ .Nm view ,
+***************
+*** 377,382 ****
+--- 379,385 ----
+ Move the cursor down
+ .Li count
+ lines to the first nonblank character of that line.
++ In gtags select mode, <control-M> select current line as a tag.
+ .It Sy "[count] <control-P>"
+ .It Sy "[count] k"
+ Move the cursor up
+***************
+*** 402,408 ****
+ .Nm \&ex
+ commands or cancel partial commands.
+ .It Sy "<control-]>"
+! Push a tag reference onto the tag stack.
+ .It Sy "<control-^>"
+ Switch to the most recently edited file.
+ .It Sy "[count] <space>"
+--- 405,412 ----
+ .Nm \&ex
+ commands or cancel partial commands.
+ .It Sy "<control-]>"
+! Push a tag reference onto the tag stack. In gtagsmode, if at the first column
+! of line, locate function references otherwise function definitions.
+ .It Sy "<control-^>"
+ Switch to the most recently edited file.
+ .It Sy "[count] <space>"
+***************
+*** 780,785 ****
+--- 784,793 ----
+ Grow or shrink the current screen.
+ .It Sy "rew[ind][!]"
+ Rewind the argument list.
++ .It Sy "rta[g][!] tagstring"
++ Edit the file refering the specified tag. (Only in gtagsmode)
++ .It Sy "se[lect]"
++ Select a tag from gtags list.
+ .It Sy "se[t] [option[=[value]] ...] [nooption ...] [option? ...] [all]"
+ Display or set editor options.
+ .It Sy "sh[ell]"
+***************
+*** 901,906 ****
+--- 909,916 ----
+ style) expressions.
+ .It Sy "flash [on]"
+ Flash the screen instead of beeping the keyboard on error.
++ .It Sy "gtagsmode, gt [off]"
++ Use GTAGS and GRTAGS instead of tags.
+ .It Sy "hardtabs, ht [8]"
+ Set the spacing between hardware tab settings.
+ .It Sy "ignorecase, ic [off]"
+diff -c -r -N /usr/src/usr.bin/vi/common/Makefile ./common/Makefile
+*** /usr/src/usr.bin/vi/common/Makefile Mon Sep 12 07:01:45 1994
+--- ./common/Makefile Sat Dec 14 11:55:27 1996
+***************
+*** 9,15 ****
+ LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
+ MAN1= ${.CURDIR}/../USD.doc/vi.man/vi.1
+
+! CFLAGS+=-I. -I${.CURDIR}
+ DPADD+= ${LIBCURSES} ${LIBTERMCAP} ${LIBUTIL}
+ LDADD+= -lcurses -ltermcap -lutil
+
+--- 9,15 ----
+ LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
+ MAN1= ${.CURDIR}/../USD.doc/vi.man/vi.1
+
+! CFLAGS+=-I. -I${.CURDIR} -DGTAGS
+ DPADD+= ${LIBCURSES} ${LIBTERMCAP} ${LIBUTIL}
+ LDADD+= -lcurses -ltermcap -lutil
+
+diff -c -r -N /usr/src/usr.bin/vi/common/exf.c ./common/exf.c
+*** /usr/src/usr.bin/vi/common/exf.c Tue May 30 15:35:44 1995
+--- ./common/exf.c Sat Dec 14 11:54:15 1996
+***************
+*** 156,162 ****
+--- 156,169 ----
+ * Required FRP initialization; the only flag we keep is the
+ * cursor information.
+ */
++ #ifdef GTAGS
++ /*
++ * we must keep gtagstmp information too.
++ */
++ F_CLR(frp, ~(FR_CURSORSET|FR_GTAGSTMP));
++ #else
+ F_CLR(frp, ~FR_CURSORSET);
++ #endif
+
+ /*
+ * Required EXF initialization:
+***************
+*** 290,295 ****
+--- 297,305 ----
+ * an error.
+ */
+ if (rcv_name == NULL)
++ #ifdef GTAGS
++ if (!F_ISSET(frp, FR_GTAGSTMP))
++ #endif
+ switch (file_lock(oname,
+ &ep->fcntl_fd, ep->db->fd(ep->db), 0)) {
+ case LOCK_FAILED:
+diff -c -r -N /usr/src/usr.bin/vi/common/gs.h ./common/gs.h
+*** /usr/src/usr.bin/vi/common/gs.h Wed Aug 17 08:36:42 1994
+--- ./common/gs.h Sat Dec 14 11:54:15 1996
+***************
+*** 48,53 ****
+--- 48,56 ----
+
+ sigset_t blockset; /* Signal mask. */
+
++ #ifdef GTAGS
++ char *gtagstmp; /* gtagstmp made by -t option */
++ #endif
+ #ifdef DEBUG
+ FILE *tracefp; /* Trace file pointer. */
+ #endif
+diff -c -r -N /usr/src/usr.bin/vi/common/main.c ./common/main.c
+*** /usr/src/usr.bin/vi/common/main.c Tue May 30 15:35:45 1995
+--- ./common/main.c Sat Dec 14 11:54:15 1996
+***************
+*** 98,103 ****
+--- 98,106 ----
+ SCR *sp;
+ u_int flags, saved_vi_mode;
+ int ch, eval, flagchk, readonly, silent, snapshot;
++ #ifdef GTAGS
++ int gtags = 0;
++ #endif
+ char *excmdarg, *myname, *p, *tag_f, *trace_f, *wsizearg;
+ char path[MAXPATHLEN];
+
+***************
+*** 134,140 ****
+--- 137,147 ----
+ excmdarg = tag_f = trace_f = wsizearg = NULL;
+ silent = 0;
+ snapshot = 1;
++ #ifdef GTAGS
++ while ((ch = getopt(argc, argv, "c:eFGRrsT:t:vw:X:")) != EOF)
++ #else
+ while ((ch = getopt(argc, argv, "c:eFRrsT:t:vw:X:")) != EOF)
++ #endif
+ switch (ch) {
+ case 'c': /* Run the command. */
+ excmdarg = optarg;
+***************
+*** 146,151 ****
+--- 153,163 ----
+ case 'F': /* No snapshot. */
+ snapshot = 0;
+ break;
++ #ifdef GTAGS
++ case 'G': /* gtags mode. */
++ gtags = 1;
++ break;
++ #endif
+ case 'R': /* Readonly. */
+ readonly = 1;
+ break;
+***************
+*** 245,250 ****
+--- 257,266 ----
+ goto err;
+ if (readonly) /* Global read-only bit. */
+ O_SET(sp, O_READONLY);
++ #ifdef GTAGS
++ if (gtags) /* Global gtags bit. */
++ O_SET(sp, O_GTAGSMODE);
++ #endif
+ if (silent) { /* Ex batch mode. */
+ O_CLR(sp, O_AUTOPRINT);
+ O_CLR(sp, O_PROMPT);
+***************
+*** 515,520 ****
+--- 531,539 ----
+ LIST_INIT(&gp->cutq);
+ LIST_INIT(&gp->seqq);
+
++ #ifdef GTAGS
++ gp->gtagstmp = NULL;
++ #endif
+ /* Set a flag if we're reading from the tty. */
+ if (isatty(STDIN_FILENO))
+ F_SET(gp, G_STDIN_TTY);
+***************
+*** 554,559 ****
+--- 573,584 ----
+ SCR *sp;
+ char *tty;
+
++ #ifdef GTAGS
++ if (gp->gtagstmp) {
++ if (!strncmp(gp->gtagstmp, _PATH_GTAGSTMP, strlen(_PATH_GTAGSTMP)))
++ (void)unlink(gp->gtagstmp);
++ }
++ #endif
+ /* Default buffer storage. */
+ (void)text_lfree(&gp->dcb_store.textq);
+
+diff -c -r -N /usr/src/usr.bin/vi/common/msg.c ./common/msg.c
+*** /usr/src/usr.bin/vi/common/msg.c Thu Aug 18 10:10:54 1994
+--- ./common/msg.c Sat Dec 14 11:54:15 1996
+***************
+*** 338,343 ****
+--- 338,352 ----
+ #else
+ pid = "";
+ #endif
++ #ifdef GTAGS
++ if (F_ISSET(sp->frp, FR_GTAGSTMP)) {
++ if (file_lline(sp, ep, &last)) {
++ return (1);
++ }
++ msgq(sp, M_INFO, "[GTAGS SELECT MODE] %d lines", last);
++ return (0);
++ }
++ #endif
+ /*
+ * See nvi/exf.c:file_init() for a description of how and
+ * when the read-only bit is set.
+diff -c -r -N /usr/src/usr.bin/vi/common/options.c ./common/options.c
+*** /usr/src/usr.bin/vi/common/options.c Tue May 30 15:35:46 1995
+--- ./common/options.c Sat Dec 14 11:54:15 1996
+***************
+*** 103,108 ****
+--- 103,112 ----
+ {"extended", NULL, OPT_0BOOL, 0},
+ /* O_FLASH HPUX */
+ {"flash", NULL, OPT_1BOOL, 0},
++ #ifdef GTAGS
++ /* O_GTAGSMODE SPECIAL */
++ {"gtagsmode", NULL, OPT_0BOOL, 0},
++ #endif
+ /* O_HARDTABS 4BSD */
+ {"hardtabs", NULL, OPT_NUM, 0},
+ /* O_IGNORECASE 4BSD */
+***************
+*** 228,233 ****
+--- 232,240 ----
+ {"eb", O_ERRORBELLS}, /* 4BSD */
+ {"ed", O_EDCOMPATIBLE}, /* 4BSD */
+ {"ex", O_EXRC}, /* System V (undocumented) */
++ #ifdef GTAGS
++ {"gt", O_GTAGSMODE}, /* Special */
++ #endif
+ {"ht", O_HARDTABS}, /* 4BSD */
+ {"ic", O_IGNORECASE}, /* 4BSD */
+ {"li", O_LINES}, /* 4.4BSD */
+diff -c -r -N /usr/src/usr.bin/vi/common/pathnames.h ./common/pathnames.h
+*** /usr/src/usr.bin/vi/common/pathnames.h Wed Aug 17 08:36:43 1994
+--- ./common/pathnames.h Sat Dec 14 11:54:15 1996
+***************
+*** 43,45 ****
+--- 43,48 ----
+ #define _PATH_TAGS "tags"
+ #define _PATH_TMP "/tmp"
+ #define _PATH_TTY "/dev/tty"
++ #ifdef GTAGS
++ #define _PATH_GTAGSTMP "/var/tmp/gtags"
++ #endif
+diff -c -r -N /usr/src/usr.bin/vi/common/screen.h ./common/screen.h
+*** /usr/src/usr.bin/vi/common/screen.h Wed Aug 17 08:36:43 1994
+--- ./common/screen.h Sat Dec 14 11:54:15 1996
+***************
+*** 87,92 ****
+--- 87,95 ----
+ #define FR_TMPEXIT 0x100 /* Modified temporary file, no exit. */
+ #define FR_TMPFILE 0x200 /* If file has no name. */
+ #define FR_UNLOCKED 0x400 /* File couldn't be locked. */
++ #ifdef GTAGS
++ #define FR_GTAGSTMP 0x800 /* File is gtags temporary file. */
++ #endif
+ u_int16_t flags;
+ };
+
+diff -c -r -N /usr/src/usr.bin/vi/ex/ex_tag.c ./ex/ex_tag.c
+*** /usr/src/usr.bin/vi/ex/ex_tag.c Thu Aug 18 10:13:20 1994
+--- ./ex/ex_tag.c Sat Dec 14 11:54:15 1996
+***************
+*** 64,69 ****
+--- 64,72 ----
+ #include "vi.h"
+ #include "excmd.h"
+ #include "tag.h"
++ #ifdef GTAGS
++ #include "pathnames.h"
++ #endif
+
+ static char *binary_search __P((char *, char *, char *));
+ static int compare __P((char *, char *, char *));
+***************
+*** 71,76 ****
+--- 74,288 ----
+ static int search __P((SCR *, char *, char *, char **));
+ static int tag_get __P((SCR *, char *, char **, char **, char **));
+
++ #ifdef DEBUG
++ void
++ trace(fp)
++ FILE *fp;
++ {
++ SCR *sp;
++ TAG *tp;
++ FREF *frp;
++ int scr, fref, tag;
++
++ fprintf(fp, "------------------------------------\n");
++ scr = 0;
++ for (sp = __global_list->dq.cqh_first; sp != (void *)&__global_list->dq; sp = sp->q.cqe_next) {
++ fprintf(fp, "screen %d {\n", ++scr);
++ fref = 0;
++ for (frp = sp->frefq.cqh_first;
++ frp != (FREF *)&sp->frefq; frp = frp->q.cqe_next) {
++ fprintf(fp, " FREF %d ", ++fref);
++ if (F_ISSET(frp, FR_GTAGSTMP))
++ fprintf(fp, "<%s>\n", frp->name);
++ else
++ fprintf(fp, "%s\n", frp->name);
++ }
++ tag = 0;
++ if (!EXP(sp))
++ continue;
++ fprintf(fp, " ................................\n");
++ for (tp = EXP(sp)->tagq.tqh_first; tp != NULL; tp = tp->q.tqe_next) {
++ fprintf(fp, " TAG %d ", ++tag);
++ if (F_ISSET(tp->frp, FR_GTAGSTMP))
++ fprintf(fp, "<%s>\n", tp->frp->name);
++ else
++ fprintf(fp, "%s\n", tp->frp->name);
++ }
++ fprintf(fp, "}\n");
++ }
++ fprintf(fp, "------------------------------------\n");
++ }
++ #endif
++ #ifdef GTAGS
++ /*
++ * getentry --
++ * get tag information from current line.
++ *
++ * gtags temporary file format.
++ * <tag> <lineno> <file> <image>
++ *
++ * sample.
++ * +------------------------------------------------
++ * |main 30 main.c main(argc, argv)
++ * |func 21 subr.c func(arg)
++ */
++ static int
++ getentry(buf, tag, file, line)
++ char *buf, *tag, *file, *line;
++ {
++ char *p;
++
++ p = tag;
++ while (*buf && !isspace(*buf)) /* tag name */
++ *p++ = *buf++;
++ *p = 0;
++ while (*buf && isspace(*buf)) /* skip blanks */
++ buf++;
++ p = line;
++ while (*buf && !isspace(*buf)) /* line no */
++ *p++ = *buf++;
++ *p = 0;
++ while (*buf && isspace(*buf)) /* skip blanks */
++ buf++;
++ p = file;
++ while (*buf && !isspace(*buf)) /* file name */
++ *p++ = *buf++;
++ *p = 0;
++
++ /* value check */
++ if (strlen(tag) && strlen(line) && strlen(file) && atoi(line) > 0)
++ return 1; /* OK */
++ return 0; /* ERROR */
++ }
++
++ /*
++ * gtag_get --
++ * Get a gtag from the GTAGS files.
++ */
++ static int
++ gtag_get(sp, ref, gtagselect, tag, tagp, filep, searchp)
++ SCR *sp;
++ int ref;
++ int *gtagselect;
++ char *tag, **tagp, **filep, **searchp;
++ {
++ static char name[80], file[200], line[10], gtagstmp[80];
++ char command[200];
++ char buf[BUFSIZ+1];
++ FILE *fp;
++
++ sprintf(gtagstmp, "%s.XXXXXXXX", _PATH_GTAGSTMP);
++ if (mktemp(gtagstmp) == 0) {
++ msgq(sp, M_ERR, "cannot generate temporary file name");
++ return (1);
++ }
++ sprintf(command, "global -%s '%s' > %s; chmod 600 %s",
++ ref ? "rx" : "x", tag, gtagstmp, gtagstmp);
++ if (system(command)) {
++ msgq(sp, M_ERR, "cannot exec global");
++ goto err;
++ }
++ if (!(fp = fopen(gtagstmp, "r"))) {
++ msgq(sp, M_ERR, "tag file cannot open.");
++ goto err;
++ }
++ if (!(fgets(buf, BUFSIZ, fp))) {
++ msgq(sp, M_ERR, "%s: tag not found", tag);
++ fclose(fp);
++ goto err;
++ }
++
++ if (getentry(buf, name, file, line) == 0) {
++ msgq(sp, M_ERR, "%s: illegal tag entry", tag);
++ fclose(fp);
++ goto err;
++ }
++
++ if (!(fgets(buf, BUFSIZ, fp))) { /* just one line */
++ fclose(fp);
++ (void)unlink(gtagstmp);
++ *gtagselect = 0; /* go to user's file immediately */
++ *tagp = strdup(name);
++ *filep = file;
++ *searchp = line;
++ if (*tagp == NULL) {
++ msgq(sp, M_SYSERR, NULL);
++ return (1);
++ }
++ return (0);
++ }
++ fclose(fp);
++ *gtagselect = 1; /* go to gtags select mode */
++ *tagp = strdup(name);
++ *filep = gtagstmp;
++ *searchp = "1";
++ if (*tagp == NULL) {
++ msgq(sp, M_SYSERR, NULL);
++ return (1);
++ }
++ return (0);
++ err:
++ (void)unlink(gtagstmp);
++ return (1);
++ }
++
++ /*
++ * ex_gtagselect --
++ * The tag code can be entered from gtag select mode.
++ */
++ int
++ ex_gtagselect(sp, ep, cmdp)
++ SCR *sp;
++ EXF *ep;
++ EXCMDARG *cmdp;
++ {
++ if (!F_ISSET(sp->frp, FR_GTAGSTMP)) {
++ msgq(sp, M_ERR, "illegal tag entry");
++ return (1);
++ }
++ cmdp->cmd = &cmds[C_TAG];
++ cmdp->flags |= (E_GTAGSELECT|E_FORCE);
++ return ex_tagpush(sp, ep, cmdp);
++ }
++
++ /*
++ * should_delete --
++ * 1: should delete, 0: should not delete
++ */
++ int
++ should_delete(gtagstmp)
++ char *gtagstmp;
++ {
++ SCR *sp;
++ TAG *tp;
++ int tagcnt = 0;
++
++ /* make sure */
++ if (strncmp(gtagstmp, _PATH_GTAGSTMP, strlen(_PATH_GTAGSTMP)))
++ return 0;
++ /* this gtag is generated by -t option. don't delete here */
++ if (__global_list->gtagstmp && !strcmp(gtagstmp, __global_list->gtagstmp))
++ return 0;
++
++ for (sp = __global_list->dq.cqh_first; sp != (void *)&__global_list->dq; sp = sp->q.cqe_next) {
++ if (!EXP(sp))
++ continue;
++ for (tp = EXP(sp)->tagq.tqh_first; tp != NULL; tp = tp->q.tqe_next) {
++ if (!tp->frp || !F_ISSET(tp->frp, FR_GTAGSTMP))
++ continue;
++ if (!strcmp(tp->frp->name, gtagstmp))
++ ++tagcnt;
++ }
++ }
++ if (tagcnt == 1)
++ return 1;
++ if (tagcnt > 1)
++ return 0;
++ /* IMPOSSIBLE */
++ return 0;
++ }
++ #endif
++
+ /*
+ * ex_tagfirst --
+ * The tag code can be entered from main, i.e. "vi -t tag".
+***************
+*** 86,96 ****
+--- 298,317 ----
+ u_int flags;
+ int sval;
+ char *p, *tag, *name, *search;
++ #ifdef GTAGS
++ int gtagselect = 0;
++ #endif
+
+ /* Taglength may limit the number of characters. */
+ if ((tl = O_VAL(sp, O_TAGLENGTH)) != 0 && strlen(tagarg) > tl)
+ tagarg[tl] = '\0';
+
++ #ifdef GTAGS
++ if (O_ISSET(sp, O_GTAGSMODE)) {
++ if (gtag_get(sp, 0, &gtagselect, tagarg, &tag, &name, &search))
++ return (1);
++ } else
++ #endif
+ /* Get the tag information. */
+ if (tag_get(sp, tagarg, &tag, &name, &search))
+ return (1);
+***************
+*** 106,111 ****
+--- 327,336 ----
+ * The historic tags file format (from a long, long time ago...)
+ * used a line number, not a search string. I got complaints, so
+ * people are still using the format.
++ #ifdef GTAGS
++ * Yes, gtags use the old format. Search string is very flexible
++ * but is not suitable to treat duplicate entries.
++ #endif
+ */
+ if (isdigit(search[0])) {
+ m.lno = atoi(search);
+***************
+*** 132,137 ****
+--- 357,371 ----
+ frp->lno = m.lno;
+ frp->cno = m.cno;
+ F_SET(frp, FR_CURSORSET);
++ #ifdef GTAGS
++ if (gtagselect) {
++ F_SET(frp, FR_GTAGSTMP);
++ if (!(sp->gp->gtagstmp = strdup(name))) {
++ msgq(sp, M_SYSERR, NULL);
++ return (1);
++ }
++ }
++ #endif
+
+ /* Might as well make this the default tag. */
+ if ((EXP(sp)->tlast = strdup(tagarg)) == NULL) {
+***************
+*** 142,153 ****
+--- 376,399 ----
+ }
+
+ /* Free a tag or tagf structure from a queue. */
++ #ifdef GTAGS
+ #define FREETAG(tp) { \
++ if (F_ISSET(tp->frp, FR_GTAGSTMP)) \
++ if (should_delete(tp->frp->name)) \
++ unlink(tp->frp->name); \
+ TAILQ_REMOVE(&exp->tagq, (tp), q); \
+ if ((tp)->search != NULL) \
+ free((tp)->search); \
+ FREE((tp), sizeof(TAGF)); \
+ }
++ #else
++ #define FREETAG(tp) { \
++ TAILQ_REMOVE(&exp->tagq, (tp), q); \
++ if ((tp)->search != NULL) \
++ free((tp)->search); \
++ FREE((tp), sizeof(TAGF)); \
++ }
++ #endif
+ #define FREETAGF(tfp) { \
+ TAILQ_REMOVE(&exp->tagfq, (tfp), q); \
+ free((tfp)->name); \
+***************
+*** 182,189 ****
+--- 428,464 ----
+ int sval;
+ long tl;
+ char *name, *p, *search, *tag;
++ #ifdef GTAGS
++ int gtagselect = 0;
++ char *line;
++ size_t len;
++ char tagbuf[80], namebuf[200], linebuf[10];
++ #endif
+
+ exp = EXP(sp);
++ #ifdef GTAGS
++ /*
++ * Enter from gtag select mode.
++ * get tag information from current line.
++ */
++ if (F_ISSET(cmdp, E_GTAGSELECT)) {
++ if ((line = file_gline(sp, ep, sp->lno, &len)) == NULL) {
++ GETLINE_ERR(sp, sp->lno);
++ return (1);
++ }
++ if (getentry(line, tagbuf, namebuf, linebuf) == 0) {
++ msgq(sp, M_ERR, "illegal tag entry");
++ return (1);
++ }
++ if (!(tag = strdup(tagbuf))) {
++ msgq(sp, M_SYSERR, NULL);
++ return (1);
++ }
++ name = namebuf;
++ search = linebuf;
++ goto getfref;
++ }
++ #endif
+ switch (cmdp->argc) {
+ case 1:
+ if (exp->tlast != NULL)
+***************
+*** 207,216 ****
+--- 482,504 ----
+ if ((tl = O_VAL(sp, O_TAGLENGTH)) != 0 && strlen(exp->tlast) > tl)
+ exp->tlast[tl] = '\0';
+
++ #ifdef GTAGS
++ if (O_ISSET(sp, O_GTAGSMODE)) {
++ if (gtag_get(sp, F_ISSET(cmdp->cmd, E_REFERENCE), &gtagselect,
++ exp->tlast, &tag, &name, &search))
++ return (1);
++ } else if (F_ISSET(cmdp->cmd, E_REFERENCE)) {
++ msgq(sp, M_ERR, "Please set gtagsmode");
++ return (1);
++ } else
++ #endif
+ /* Get the tag information. */
+ if (tag_get(sp, exp->tlast, &tag, &name, &search))
+ return (1);
+
++ #ifdef GTAGS
++ getfref:
++ #endif
+ /* Get the (possibly new) FREF structure. */
+ if ((frp = file_add(sp, name)) == NULL)
+ goto err;
+***************
+*** 305,310 ****
+--- 593,603 ----
+ sp->cno = m.cno;
+ break;
+ }
++ #ifdef GTAGS
++ if (gtagselect) {
++ F_SET(frp, FR_GTAGSTMP);
++ }
++ #endif
+ return (0);
+ }
+
+***************
+*** 490,495 ****
+--- 783,793 ----
+ for (cnt = 1, tp = exp->tagq.tqh_first; tp != NULL;
+ ++cnt, tp = tp->q.tqe_next) {
+ len = strlen(name = tp->frp->name); /* The original name. */
++ #ifdef GTAGS
++ if (F_ISSET(tp->frp, FR_GTAGSTMP)) {
++ (void)ex_printf(EXCOOKIE, "%2d [GTAGS]\n", cnt);
++ } else
++ #endif
+ if (len > maxlen || len + tp->slen > sp->cols)
+ if (tp == NULL || tp->search == NULL)
+ (void)ex_printf(EXCOOKIE,
+diff -c -r -N /usr/src/usr.bin/vi/ex/excmd.c ./ex/excmd.c
+*** /usr/src/usr.bin/vi/ex/excmd.c Thu Aug 18 10:13:29 1994
+--- ./ex/excmd.c Sat Dec 14 11:54:15 1996
+***************
+*** 319,324 ****
+--- 319,331 ----
+ "!",
+ "rew[ind][!]",
+ "re-edit all the files in the file argument list"},
++ #ifdef GTAGS
++ /* C_RTAG */
++ {"rtag", ex_tagpush, E_NOGLOBAL|E_REFERENCE,
++ "!w1o",
++ "rta[g][!] [string]",
++ "edit the file containing the tag"},
++ #endif
+ /* C_SUBSTITUTE */
+ {"substitute", ex_substitute, E_ADDR2|E_NORC,
+ "s",
+***************
+*** 329,334 ****
+--- 336,348 ----
+ "!f1o",
+ "sc[ript][!] [file]",
+ "run a shell in a screen"},
++ #ifdef GTAGS
++ /* C_GTAGSELECT */
++ {"select", ex_gtagselect, E_NOGLOBAL,
++ "",
++ "sel[ect]",
++ "edit the file containing the tag"},
++ #endif
+ /* C_SET */
+ {"set", ex_set, E_NOGLOBAL,
+ "wN",
+diff -c -r -N /usr/src/usr.bin/vi/ex/excmd.h.stub ./ex/excmd.h.stub
+*** /usr/src/usr.bin/vi/ex/excmd.h.stub Wed Aug 17 08:36:28 1994
+--- ./ex/excmd.h.stub Sat Dec 14 11:54:15 1996
+***************
+*** 69,74 ****
+--- 69,79 ----
+ #define E_NORC 0x0800000 /* Not from a .exrc or EXINIT. */
+ #define E_ZERO 0x1000000 /* 0 is a legal addr1. */
+ #define E_ZERODEF 0x2000000 /* 0 is default addr1 of empty files. */
++
++ #ifdef GTAGS
++ #define E_REFERENCE 0x4000000 /* locate function references */
++ #define E_GTAGSELECT 0x8000000 /* current line is gtags entry */
++ #endif
+ u_int32_t flags;
+ char *syntax; /* Syntax script. */
+ char *usage; /* Usage line. */
+***************
+*** 234,239 ****
+--- 239,245 ----
+ EXPROTO(ex_fg);
+ EXPROTO(ex_file);
+ EXPROTO(ex_global);
++ EXPROTO(ex_gtagselect);
+ EXPROTO(ex_help);
+ EXPROTO(ex_insert);
+ EXPROTO(ex_join);
+diff -c -r -N /usr/src/usr.bin/vi/svi/svi_refresh.c ./svi/svi_refresh.c
+*** /usr/src/usr.bin/vi/svi/svi_refresh.c Tue May 30 15:35:56 1995
+--- ./svi/svi_refresh.c Sat Dec 14 11:54:16 1996
+***************
+*** 725,731 ****
+--- 725,736 ----
+ EXF *ep;
+ {
+ size_t cols, curlen, endpoint, len, midpoint;
++ #ifdef GTAGS
++ char *p, buf[30];
++ recno_t last;
++ #else
+ char *p, buf[20];
++ #endif
+
+ /* Clear the mode line. */
+ MOVE(sp, INFOLINE(sp), 0);
+***************
+*** 746,751 ****
+--- 751,765 ----
+
+ curlen = 0;
+ if (sp->q.cqe_next != (void *)&sp->gp->dq) {
++ #ifdef GTAGS
++ if (F_ISSET(sp->frp, FR_GTAGSTMP)) {
++ if (file_lline(sp, ep, &last)) {
++ return (1);
++ }
++ sprintf(buf, "[GTAGS SELECT MODE] %d lines", last);
++ p = buf;
++ } else {
++ #endif
+ for (p = sp->frp->name; *p != '\0'; ++p);
+ while (--p > sp->frp->name) {
+ if (*p == '/') {
+***************
+*** 758,764 ****
+ break;
+ }
+ }
+!
+ MOVE(sp, INFOLINE(sp), 0);
+ standout();
+ for (; *p != '\0'; ++p)
+--- 772,780 ----
+ break;
+ }
+ }
+! #ifdef GTAGS
+! }
+! #endif
+ MOVE(sp, INFOLINE(sp), 0);
+ standout();
+ for (; *p != '\0'; ++p)
+diff -c -r -N /usr/src/usr.bin/vi/vi/v_ex.c ./vi/v_ex.c
+*** /usr/src/usr.bin/vi/vi/v_ex.c Thu Aug 18 10:15:03 1994
+--- ./vi/v_ex.c Sat Dec 14 11:54:16 1996
+***************
+*** 298,303 ****
+--- 298,308 ----
+ ARGS *ap[2], a;
+ EXCMDARG cmd;
+
++ #ifdef GTAGS
++ if (O_ISSET(sp, O_GTAGSMODE) && vp->m_start.cno == 0)
++ excmd(&cmd, C_RTAG, 0, OOBLNO, 0, 0, ap, &a, vp->keyword);
++ else
++ #endif
+ excmd(&cmd, C_TAG, 0, OOBLNO, 0, 0, ap, &a, vp->keyword);
+ return (sp->s_ex_cmd(sp, ep, &cmd, &vp->m_final));
+ }
+diff -c -r -N /usr/src/usr.bin/vi/vi/v_scroll.c ./vi/v_scroll.c
+*** /usr/src/usr.bin/vi/vi/v_scroll.c Thu Aug 18 10:15:15 1994
+--- ./vi/v_scroll.c Sat Dec 14 11:54:16 1996
+***************
+*** 255,260 ****
+--- 255,269 ----
+ EXF *ep;
+ VICMDARG *vp;
+ {
++ #ifdef GTAGS
++ EXCMDARG cmd;
++
++ if (F_ISSET(sp->frp, FR_GTAGSTMP)) {
++ memset(&cmd, 0, sizeof(EXCMDARG));
++ cmd.cmd = &cmds[C_GTAGSELECT];
++ return (sp->s_ex_cmd(sp, ep, &cmd, &vp->m_final));
++ }
++ #endif
+ /*
+ * If it's a script window, exec the line,
+ * otherwise it's the same as v_down().
diff --git a/contrib/global/nvi-1.66.diff b/contrib/global/nvi-1.66.diff
deleted file mode 100644
index bf1400b5679a..000000000000
--- a/contrib/global/nvi-1.66.diff
+++ /dev/null
@@ -1,673 +0,0 @@
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/build/Makefile ./build/Makefile
-*** /usr/src/usr.bin/nvi-1.66.org/build/Makefile Tue May 5 15:57:21 1998
---- ./build/Makefile Sun Aug 16 03:22:53 1998
-***************
-*** 3,9 ****
- # from: @(#)Makefile.in 8.56 (Berkeley) 5/18/96
-
- WARNS= 0
-! CPPFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
-
- LDADD+= -lcurses -ltermcap
- DPADD+= ${LIBCURSES} ${LIBTERMCAP}
---- 3,9 ----
- # from: @(#)Makefile.in 8.56 (Berkeley) 5/18/96
-
- WARNS= 0
-! CPPFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include -DGTAGS
-
- LDADD+= -lcurses -ltermcap
- DPADD+= ${LIBCURSES} ${LIBTERMCAP}
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/common/main.c ./common/main.c
-*** /usr/src/usr.bin/nvi-1.66.org/common/main.c Tue May 5 15:57:26 1998
---- ./common/main.c Sun Aug 16 03:27:19 1998
-***************
-*** 63,68 ****
---- 63,71 ----
- size_t len;
- u_int flags;
- int ch, fd, flagchk, lflag, startup, readonly, rval, silent;
-+ #ifdef GTAGS
-+ int gtags = 0;
-+ #endif
- char *tag_f, *wsizearg;
- char path[256];
-
-***************
-*** 113,123 ****
---- 116,135 ----
- /* Set the file snapshot flag. */
- F_SET(gp, G_SNAPSHOT);
-
-+ #ifdef GTAGS
-+ #ifdef DEBUG
-+ while ((ch = getopt(argc, argv, "c:D:eFGlRrsT:t:vw:")) != EOF)
-+ #else
-+ while ((ch = getopt(argc, argv, "c:eFGlRrst:vw:")) != EOF)
-+ #endif
-+ #else
- #ifdef DEBUG
- while ((ch = getopt(argc, argv, "c:D:eFlRrsT:t:vw:")) != EOF)
- #else
- while ((ch = getopt(argc, argv, "c:eFlRrst:vw:")) != EOF)
- #endif
-+ #endif
-+
- switch (ch) {
- case 'c': /* Run the command. */
- /*
-***************
-*** 167,172 ****
---- 179,189 ----
- case 'F': /* No snapshot. */
- F_CLR(gp, G_SNAPSHOT);
- break;
-+ #ifdef GTAGS
-+ case 'G': /* gtags mode. */
-+ gtags = 1;
-+ break;
-+ #endif
- case 'l': /* Set lisp, showmatch options. */
- lflag = 1;
- break;
-***************
-*** 258,263 ****
---- 275,284 ----
- { int oargs[4], *oargp = oargs;
- if (readonly) /* Command-line options. */
- *oargp++ = O_READONLY;
-+ #ifdef GTAGS
-+ if (gtags)
-+ *oargp++ = O_GTAGSMODE;
-+ #endif
- if (lflag) {
- *oargp++ = O_LISP;
- *oargp++ = O_SHOWMATCH;
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/common/options.c ./common/options.c
-*** /usr/src/usr.bin/nvi-1.66.org/common/options.c Tue May 5 15:57:26 1998
---- ./common/options.c Sun Aug 16 03:29:51 1998
-***************
-*** 80,85 ****
---- 80,89 ----
- {"filec", NULL, OPT_STR, 0},
- /* O_FLASH HPUX */
- {"flash", NULL, OPT_1BOOL, 0},
-+ #ifdef GTAGS
-+ /* O_GTAGSMODE FreeBSD, NetBSD */
-+ {"gtagsmode", NULL, OPT_0BOOL, 0},
-+ #endif
- /* O_HARDTABS 4BSD */
- {"hardtabs", NULL, OPT_NUM, 0},
- /* O_ICLOWER 4.4BSD */
-***************
-*** 240,245 ****
---- 244,252 ----
- {"eb", O_ERRORBELLS}, /* 4BSD */
- {"ed", O_EDCOMPATIBLE}, /* 4BSD */
- {"ex", O_EXRC}, /* System V (undocumented) */
-+ #ifdef GTAGS
-+ {"gt", O_GTAGSMODE}, /* FreeBSD, NetBSD */
-+ #endif
- {"ht", O_HARDTABS}, /* 4BSD */
- {"ic", O_IGNORECASE}, /* 4BSD */
- {"li", O_LINES}, /* 4.4BSD */
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/docs/USD.doc/vi.man/vi.1 ./docs/USD.doc/vi.man/vi.1
-*** /usr/src/usr.bin/nvi-1.66.org/docs/USD.doc/vi.man/vi.1 Tue May 5 15:57:31 1998
---- ./docs/USD.doc/vi.man/vi.1 Sun Aug 16 03:34:12 1998
-***************
-*** 40,46 ****
- .SH SYNOPSIS
- .B ex
- [\c
-! .B -eFRrsv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
---- 40,46 ----
- .SH SYNOPSIS
- .B ex
- [\c
-! .B -eFGRrsv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
-***************
-*** 51,57 ****
- .br
- .B vi
- [\c
-! .B -eFlRrv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
---- 51,57 ----
- .br
- .B vi
- [\c
-! .B -eFGlRrv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
-***************
-*** 62,68 ****
- .br
- .B view
- [\c
-! .B -eFRrv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
---- 62,68 ----
- .br
- .B view
- [\c
-! .B -eFGRrv\c
- ] [\c
- .BI -c " cmd"\c
- ] [\c
-***************
-*** 135,140 ****
---- 135,143 ----
- (The default is to make a copy in case someone else modifies
- the file during your edit session.)
- .TP
-+ .B \-G
-+ Start editing in gtags mode, as if the gtagsmode option was set.
-+ .TP
- .B \-l
- Start editing with the lisp and showmatch options set.
- .TP
-***************
-*** 441,446 ****
---- 444,451 ----
- .TP
- .B "<control-]>"
- Push a tag reference onto the tag stack.
-+ In gtagsmode, if at the first column of line,
-+ locate function references otherwise function definitions.
- .TP
- .B "<control-^>"
- Switch to the most recently edited file.
-***************
-*** 952,957 ****
---- 957,965 ----
- .B "rew[ind][!]"
- Rewind the argument list.
- .TP
-+ .B "rta[g][!] tagstring"
-+ Edit the file refering the specified tag. (Only in gtagsmode)
-+ .TP
- .B "se[t] [option[=[value]] ...] [nooption ...] [option? ...] [all]"
- Display or set editor options.
- .TP
-***************
-*** 1121,1126 ****
---- 1129,1137 ----
- .TP
- .B "flash [on]"
- Flash the screen instead of beeping the keyboard on error.
-+ .TP
-+ .B "gtagsmode, gt [off]"
-+ Use GTAGS and GRTAGS instead of tags.
- .TP
- .B "hardtabs, ht [8]"
- Set the spacing between hardware tab settings.
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/ex/ex.h ./ex/ex.h
-*** /usr/src/usr.bin/nvi-1.66.org/ex/ex.h Tue May 5 15:57:37 1998
---- ./ex/ex.h Sun Aug 16 03:35:58 1998
-***************
-*** 162,167 ****
---- 162,170 ----
- #define E_NEWLINE 0x00800000 /* Found ending <newline>. */
- #define E_USELASTCMD 0x01000000 /* Use the last command. */
- #define E_VISEARCH 0x02000000 /* It's really a vi search command. */
-+ #ifdef GTAGS
-+ #define E_REFERENCE 0x04000000 /* locate function references */
-+ #endif
- u_int32_t flags; /* Current flags. */
- };
-
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/ex/ex_cmd.c ./ex/ex_cmd.c
-*** /usr/src/usr.bin/nvi-1.66.org/ex/ex_cmd.c Tue May 5 15:57:37 1998
---- ./ex/ex_cmd.c Sun Aug 16 03:38:03 1998
-***************
-*** 302,307 ****
---- 302,314 ----
- "!",
- "rew[ind][!]",
- "re-edit all the files in the file argument list"},
-+ #ifdef GTAGS
-+ /* C_RTAG */
-+ {"rtag", ex_rtag_push, E_NEWSCREEN,
-+ "!w1o",
-+ "rta[g][!] [string]",
-+ "edit the file containing the tag"},
-+ #endif
- /*
- * !!!
- * Adding new commands starting with 's' may break the substitute command code
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/ex/ex_tag.c ./ex/ex_tag.c
-*** /usr/src/usr.bin/nvi-1.66.org/ex/ex_tag.c Tue May 5 15:57:41 1998
---- ./ex/ex_tag.c Sun Aug 16 03:46:43 1998
-***************
-*** 46,51 ****
---- 46,55 ----
- static int compare __P((char *, char *, char *));
- static void ctag_file __P((SCR *, TAGF *, char *, char **, size_t *));
- static int ctag_search __P((SCR *, char *, char *));
-+ #ifdef GTAGS
-+ static int getentry __P((char *, char **, char **, char **));
-+ static TAGQ *gtag_slist __P((SCR *, char *, int));
-+ #endif
- static int ctag_sfile __P((SCR *, TAGF *, TAGQ *, char *));
- static TAGQ *ctag_slist __P((SCR *, char *));
- static char *linear_search __P((char *, char *, char *));
-***************
-*** 89,94 ****
---- 93,117 ----
- return (0);
- }
-
-+ #ifdef GTAGS
-+ /*
-+ * ex_rtag_push -- ^]
-+ * :rtag[!] [string]
-+ *
-+ * Enter a new TAGQ context based on a ctag string.
-+ *
-+ * PUBLIC: int ex_rtag_push __P((SCR *, EXCMD *));
-+ */
-+ int
-+ ex_rtag_push(sp, cmdp)
-+ SCR *sp;
-+ EXCMD *cmdp;
-+ {
-+ F_SET(cmdp, E_REFERENCE);
-+ return ex_tag_push(sp, cmdp);
-+ }
-+ #endif
-+
- /*
- * ex_tag_push -- ^]
- * :tag[!] [string]
-***************
-*** 138,143 ****
---- 161,172 ----
- }
-
- /* Get the tag information. */
-+ #ifdef GTAGS
-+ if (O_ISSET(sp, O_GTAGSMODE)) {
-+ if ((tqp = gtag_slist(sp, exp->tag_last, F_ISSET(cmdp, E_REFERENCE))) == NULL)
-+ return (1);
-+ } else
-+ #endif
- if ((tqp = ctag_slist(sp, exp->tag_last)) == NULL)
- return (1);
-
-***************
-*** 963,969 ****
---- 992,1120 ----
- (void)nonblank(sp, sp->lno, &sp->cno);
- return (0);
- }
-+ #ifdef GTAGS
-+ /*
-+ * getentry --
-+ * get tag information from current line.
-+ *
-+ * gtags temporary file format.
-+ * <tag> <lineno> <file> <image>
-+ *
-+ * sample.
-+ * +------------------------------------------------
-+ * |main 30 main.c main(argc, argv)
-+ * |func 21 subr.c func(arg)
-+ */
-+ static int
-+ getentry(buf, tag, file, line)
-+ char *buf, **tag, **file, **line;
-+ {
-+ char *p = buf;
-+
-+ for (*tag = p; *p && !isspace(*p); p++) /* tag name */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *p++ = 0;
-+ for (; *p && isspace(*p); p++) /* (skip blanks) */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *line = p; /* line no */
-+ for (*line = p; *p && !isspace(*p); p++)
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *p++ = 0;
-+ for (; *p && isspace(*p); p++) /* (skip blanks) */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *file = p; /* file name */
-+ for (*file = p; *p && !isspace(*p); p++)
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *p = 0;
-+
-+ /* value check */
-+ if (strlen(*tag) && strlen(*line) && strlen(*file) && atoi(*line) > 0)
-+ return 1; /* OK */
-+ err:
-+ return 0; /* ERROR */
-+ }
-+
-+ /*
-+ * gtag_slist --
-+ * Search the list of tags files for a tag, and return tag queue.
-+ */
-+ static TAGQ *
-+ gtag_slist(sp, tag, ref)
-+ SCR *sp;
-+ char *tag;
-+ int ref;
-+ {
-+ EX_PRIVATE *exp;
-+ TAGF *tfp;
-+ TAGQ *tqp;
-+ size_t len;
-+ int echk;
-+ TAG *tp;
-+ char *name, *file, *line;
-+ char command[BUFSIZ];
-+ char buf[BUFSIZ];
-+ FILE *fp;
-+
-+ /* Allocate and initialize the tag queue structure. */
-+ len = strlen(tag);
-+ CALLOC_GOTO(sp, tqp, TAGQ *, 1, sizeof(TAGQ) + len + 1);
-+ CIRCLEQ_INIT(&tqp->tagq);
-+ tqp->tag = tqp->buf;
-+ memcpy(tqp->tag, tag, (tqp->tlen = len) + 1);
-+
-+ /*
-+ * Find the tag, only display missing file messages once, and
-+ * then only if we didn't find the tag.
-+ */
-+ snprintf(command, sizeof(command), "global -%s '%s' 2>/dev/null", ref ? "rx" : "x", tag);
-+ if (fp = popen(command, "r")) {
-+ while (fgets(buf, sizeof(buf), fp)) {
-+ if (buf[strlen(buf)-1] == '\n') /* chop(buf) */
-+ buf[strlen(buf)-1] = 0;
-+ else
-+ while (fgetc(fp) != '\n')
-+ ;
-+ if (getentry(buf, &name, &file, &line) == 0) {
-+ echk = 1;
-+ F_SET(tfp, TAGF_ERR);
-+ break;
-+ }
-+ CALLOC_GOTO(sp, tp,
-+ TAG *, 1, sizeof(TAG) + strlen(file) + 1 + strlen(line) + 1);
-+ tp->fname = tp->buf;
-+ strcpy(tp->fname, file);
-+ tp->fnlen = strlen(file);
-+ tp->search = tp->fname + tp->fnlen + 1;
-+ strcpy(tp->search, line);
-+ CIRCLEQ_INSERT_TAIL(&tqp->tagq, tp, q);
-+ }
-+ pclose(fp);
-+ }
-+
-+ /* Check to see if we found anything. */
-+ if (tqp->tagq.cqh_first == (void *)&tqp->tagq) {
-+ msgq_str(sp, M_ERR, tag, "162|%s: tag not found");
-+ free(tqp);
-+ return (NULL);
-+ }
-
-+ tqp->current = tqp->tagq.cqh_first;
-+ return (tqp);
-+
-+ alloc_err:
-+ return (NULL);
-+ }
-+ #endif
- /*
- * ctag_slist --
- * Search the list of tags files for a tag, and return tag queue.
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/include/ex_def.h ./include/ex_def.h
-*** /usr/src/usr.bin/nvi-1.66.org/include/ex_def.h Tue May 5 15:57:42 1998
---- ./include/ex_def.h Sun Aug 16 03:49:40 1998
-***************
-*** 47,78 ****
- #define C_RECOVER 46
- #define C_RESIZE 47
- #define C_REWIND 48
-! #define C_SUBSTITUTE 49
-! #define C_SCRIPT 50
-! #define C_SET 51
-! #define C_SHELL 52
-! #define C_SOURCE 53
-! #define C_STOP 54
-! #define C_SUSPEND 55
-! #define C_T 56
-! #define C_TAG 57
-! #define C_TAGNEXT 58
-! #define C_TAGPOP 59
-! #define C_TAGPREV 60
-! #define C_TAGTOP 61
-! #define C_TCLCMD 62
-! #define C_UNDO 63
-! #define C_UNABBREVIATE 64
-! #define C_UNMAP 65
-! #define C_V 66
-! #define C_VERSION 67
-! #define C_VISUAL_EX 68
-! #define C_VISUAL_VI 69
-! #define C_VIUSAGE 70
-! #define C_WRITE 71
-! #define C_WN 72
-! #define C_WQ 73
-! #define C_XIT 74
-! #define C_YANK 75
-! #define C_Z 76
-! #define C_SUBTILDE 77
---- 47,79 ----
- #define C_RECOVER 46
- #define C_RESIZE 47
- #define C_REWIND 48
-! #define C_RTAG 49
-! #define C_SUBSTITUTE 50
-! #define C_SCRIPT 51
-! #define C_SET 52
-! #define C_SHELL 53
-! #define C_SOURCE 54
-! #define C_STOP 55
-! #define C_SUSPEND 56
-! #define C_T 57
-! #define C_TAG 58
-! #define C_TAGNEXT 59
-! #define C_TAGPOP 60
-! #define C_TAGPREV 61
-! #define C_TAGTOP 62
-! #define C_TCLCMD 63
-! #define C_UNDO 64
-! #define C_UNABBREVIATE 65
-! #define C_UNMAP 66
-! #define C_V 67
-! #define C_VERSION 68
-! #define C_VISUAL_EX 69
-! #define C_VISUAL_VI 70
-! #define C_VIUSAGE 71
-! #define C_WRITE 72
-! #define C_WN 73
-! #define C_WQ 74
-! #define C_XIT 75
-! #define C_YANK 76
-! #define C_Z 77
-! #define C_SUBTILDE 78
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/include/ex_extern.h ./include/ex_extern.h
-*** /usr/src/usr.bin/nvi-1.66.org/include/ex_extern.h Tue May 5 15:57:42 1998
---- ./include/ex_extern.h Sun Aug 16 03:50:24 1998
-***************
-*** 92,97 ****
---- 92,100 ----
- char *, char **, size_t *, regex_t *, u_int));
- void re_error __P((SCR *, int, regex_t *));
- int ex_tag_first __P((SCR *, char *));
-+ #ifdef GTAGS
-+ int ex_rtag_push __P((SCR *, EXCMD *));
-+ #endif
- int ex_tag_push __P((SCR *, EXCMD *));
- int ex_tag_next __P((SCR *, EXCMD *));
- int ex_tag_prev __P((SCR *, EXCMD *));
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/include/options_def.h ./include/options_def.h
-*** /usr/src/usr.bin/nvi-1.66.org/include/options_def.h Tue May 5 15:57:42 1998
---- ./include/options_def.h Sun Aug 16 03:54:45 1998
-***************
-*** 16,77 ****
- #define O_EXTENDED 15
- #define O_FILEC 16
- #define O_FLASH 17
-! #define O_HARDTABS 18
-! #define O_ICLOWER 19
-! #define O_IGNORECASE 20
-! #define O_KEYTIME 21
-! #define O_LEFTRIGHT 22
-! #define O_LINES 23
-! #define O_LISP 24
-! #define O_LIST 25
-! #define O_LOCKFILES 26
-! #define O_MAGIC 27
-! #define O_MATCHTIME 28
-! #define O_MESG 29
-! #define O_MODELINE 30
-! #define O_MSGCAT 31
-! #define O_NOPRINT 32
-! #define O_NUMBER 33
-! #define O_OCTAL 34
-! #define O_OPEN 35
-! #define O_OPTIMIZE 36
-! #define O_PARAGRAPHS 37
-! #define O_PRINT 38
-! #define O_PROMPT 39
-! #define O_READONLY 40
-! #define O_RECDIR 41
-! #define O_REDRAW 42
-! #define O_REMAP 43
-! #define O_REPORT 44
-! #define O_RULER 45
-! #define O_SCROLL 46
-! #define O_SEARCHINCR 47
-! #define O_SECTIONS 48
-! #define O_SECURE 49
-! #define O_SHELL 50
-! #define O_SHELLMETA 51
-! #define O_SHIFTWIDTH 52
-! #define O_SHOWMATCH 53
-! #define O_SHOWMODE 54
-! #define O_SIDESCROLL 55
-! #define O_SLOWOPEN 56
-! #define O_SOURCEANY 57
-! #define O_TABSTOP 58
-! #define O_TAGLENGTH 59
-! #define O_TAGS 60
-! #define O_TERM 61
-! #define O_TERSE 62
-! #define O_TILDEOP 63
-! #define O_TIMEOUT 64
-! #define O_TTYWERASE 65
-! #define O_VERBOSE 66
-! #define O_W1200 67
-! #define O_W300 68
-! #define O_W9600 69
-! #define O_WARN 70
-! #define O_WINDOW 71
-! #define O_WRAPLEN 72
-! #define O_WRAPMARGIN 73
-! #define O_WRAPSCAN 74
-! #define O_WRITEANY 75
-! #define O_OPTIONCOUNT 76
---- 16,78 ----
- #define O_EXTENDED 15
- #define O_FILEC 16
- #define O_FLASH 17
-! #define O_GTAGSMODE 18
-! #define O_HARDTABS 19
-! #define O_ICLOWER 20
-! #define O_IGNORECASE 21
-! #define O_KEYTIME 22
-! #define O_LEFTRIGHT 23
-! #define O_LINES 24
-! #define O_LISP 25
-! #define O_LIST 26
-! #define O_LOCKFILES 27
-! #define O_MAGIC 28
-! #define O_MATCHTIME 29
-! #define O_MESG 30
-! #define O_MODELINE 31
-! #define O_MSGCAT 32
-! #define O_NOPRINT 33
-! #define O_NUMBER 34
-! #define O_OCTAL 35
-! #define O_OPEN 36
-! #define O_OPTIMIZE 37
-! #define O_PARAGRAPHS 38
-! #define O_PRINT 39
-! #define O_PROMPT 40
-! #define O_READONLY 41
-! #define O_RECDIR 42
-! #define O_REDRAW 43
-! #define O_REMAP 44
-! #define O_REPORT 45
-! #define O_RULER 46
-! #define O_SCROLL 47
-! #define O_SEARCHINCR 48
-! #define O_SECTIONS 49
-! #define O_SECURE 50
-! #define O_SHELL 51
-! #define O_SHELLMETA 52
-! #define O_SHIFTWIDTH 53
-! #define O_SHOWMATCH 54
-! #define O_SHOWMODE 55
-! #define O_SIDESCROLL 56
-! #define O_SLOWOPEN 57
-! #define O_SOURCEANY 58
-! #define O_TABSTOP 59
-! #define O_TAGLENGTH 60
-! #define O_TAGS 61
-! #define O_TERM 62
-! #define O_TERSE 63
-! #define O_TILDEOP 64
-! #define O_TIMEOUT 65
-! #define O_TTYWERASE 66
-! #define O_VERBOSE 67
-! #define O_W1200 68
-! #define O_W300 69
-! #define O_W9600 70
-! #define O_WARN 71
-! #define O_WINDOW 72
-! #define O_WRAPLEN 73
-! #define O_WRAPMARGIN 74
-! #define O_WRAPSCAN 75
-! #define O_WRITEANY 76
-! #define O_OPTIONCOUNT 77
-diff -c -r -N /usr/src/usr.bin/nvi-1.66.org/vi/v_ex.c ./vi/v_ex.c
-*** /usr/src/usr.bin/nvi-1.66.org/vi/v_ex.c Tue May 5 15:57:45 1998
---- ./vi/v_ex.c Sun Aug 16 03:55:38 1998
-***************
-*** 221,226 ****
---- 221,231 ----
- ARGS *ap[2], a;
- EXCMD cmd;
-
-+ #ifdef GTAGS
-+ if (O_ISSET(sp, O_GTAGSMODE) && vp->m_start.cno == 0)
-+ ex_cinit(&cmd, C_RTAG, 0, OOBLNO, 0, 0, ap);
-+ else
-+ #endif
- ex_cinit(&cmd, C_TAG, 0, OOBLNO, 0, 0, ap);
- ex_cadd(&cmd, &a, VIP(sp)->keyw, strlen(VIP(sp)->keyw));
- return (v_exec_ex(sp, vp, &cmd));
diff --git a/contrib/global/nvi-1.79.diff b/contrib/global/nvi-1.79.diff
index 7b601b204482..a0c8d55c0772 100644
--- a/contrib/global/nvi-1.79.diff
+++ b/contrib/global/nvi-1.79.diff
@@ -1,6 +1,6 @@
diff -c -r -N /usr/local/src/nvi-1.79/build/Makefile.in ./build/Makefile.in
*** /usr/local/src/nvi-1.79/build/Makefile.in Wed Oct 23 22:43:38 1996
---- ./build/Makefile.in Fri Aug 14 01:41:14 1998
+--- ./build/Makefile.in Wed Apr 16 21:20:09 1997
***************
*** 3,9 ****
srcdir= @srcdir@/..
@@ -20,7 +20,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/build/Makefile.in ./build/Makefile.in
PERLLIB=@vi_cv_perllib@
diff -c -r -N /usr/local/src/nvi-1.79/common/main.c ./common/main.c
*** /usr/local/src/nvi-1.79/common/main.c Sat Oct 12 07:28:28 1996
---- ./common/main.c Fri Aug 14 01:41:14 1998
+--- ./common/main.c Wed Apr 16 21:20:09 1997
***************
*** 64,69 ****
--- 64,72 ----
@@ -84,7 +84,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/common/main.c ./common/main.c
*oargp = -1; /* Options initialization. */
diff -c -r -N /usr/local/src/nvi-1.79/common/options.c ./common/options.c
*** /usr/local/src/nvi-1.79/common/options.c Tue Oct 15 03:56:29 1996
---- ./common/options.c Fri Aug 14 01:41:14 1998
+--- ./common/options.c Wed Apr 16 21:20:09 1997
***************
*** 80,85 ****
--- 80,89 ----
@@ -112,7 +112,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/common/options.c ./common/options.c
{"li", O_LINES}, /* 4.4BSD */
diff -c -r -N /usr/local/src/nvi-1.79/docs/USD.doc/vi.man/vi.1 ./docs/USD.doc/vi.man/vi.1
*** /usr/local/src/nvi-1.79/docs/USD.doc/vi.man/vi.1 Fri Oct 11 10:34:05 1996
---- ./docs/USD.doc/vi.man/vi.1 Fri Aug 14 01:41:14 1998
+--- ./docs/USD.doc/vi.man/vi.1 Wed Apr 16 21:20:09 1997
***************
*** 17,23 ****
.SH SYNOPSIS
@@ -213,7 +213,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/docs/USD.doc/vi.man/vi.1 ./docs/USD.doc/vi
Set the spacing between hardware tab settings.
diff -c -r -N /usr/local/src/nvi-1.79/ex/ex.h ./ex/ex.h
*** /usr/local/src/nvi-1.79/ex/ex.h Tue Aug 13 09:24:00 1996
---- ./ex/ex.h Fri Aug 14 01:41:14 1998
+--- ./ex/ex.h Wed Apr 16 21:20:09 1997
***************
*** 152,157 ****
--- 152,160 ----
@@ -228,7 +228,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex.h ./ex/ex.h
diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_cmd.c ./ex/ex_cmd.c
*** /usr/local/src/nvi-1.79/ex/ex_cmd.c Wed Oct 23 22:31:01 1996
---- ./ex/ex_cmd.c Fri Aug 14 01:41:14 1998
+--- ./ex/ex_cmd.c Wed Apr 16 21:20:09 1997
***************
*** 302,307 ****
--- 302,314 ----
@@ -239,7 +239,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_cmd.c ./ex/ex_cmd.c
+ /* C_RTAG */
+ {"rtag", ex_rtag_push, E_NEWSCREEN,
+ "!w1o",
-+ "rta[g][!] [string]",
++ "[Rr]ta[g][!] [string]",
+ "edit the file containing the tag"},
+ #endif
/*
@@ -247,7 +247,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_cmd.c ./ex/ex_cmd.c
* Adding new commands starting with 's' may break the substitute command code
diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
*** /usr/local/src/nvi-1.79/ex/ex_tag.c Mon Sep 16 05:02:43 1996
---- ./ex/ex_tag.c Fri Aug 14 01:53:35 1998
+--- ./ex/ex_tag.c Wed Apr 16 21:20:09 1997
***************
*** 46,51 ****
--- 46,55 ----
@@ -255,7 +255,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
static void ctag_file __P((SCR *, TAGF *, char *, char **, size_t *));
static int ctag_search __P((SCR *, char *, size_t, char *));
+ #ifdef GTAGS
-+ static int getentry __P((char *, char **, char **, char **));
++ static int getentry __P((char *, char *, char *, char *));
+ static TAGQ *gtag_slist __P((SCR *, char *, int));
+ #endif
static int ctag_sfile __P((SCR *, TAGF *, TAGQ *, char *));
@@ -306,7 +306,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
***************
*** 969,974 ****
---- 998,1126 ----
+--- 998,1116 ----
return (0);
}
@@ -325,40 +325,30 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
+ */
+ static int
+ getentry(buf, tag, file, line)
-+ char *buf, **tag, **file, **line;
++ char *buf, *tag, *file, *line;
+ {
-+ char *p = buf;
++ char *p;
+
-+ for (*tag = p; *p && !isspace(*p); p++) /* tag name */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *p++ = 0;
-+ for (; *p && isspace(*p); p++) /* (skip blanks) */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *line = p; /* line no */
-+ for (*line = p; *p && !isspace(*p); p++)
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *p++ = 0;
-+ for (; *p && isspace(*p); p++) /* (skip blanks) */
-+ ;
-+ if (*p == 0)
-+ goto err;
-+ *file = p; /* file name */
-+ for (*file = p; *p && !isspace(*p); p++)
-+ ;
-+ if (*p == 0)
-+ goto err;
++ p = tag;
++ while (*buf && !isspace(*buf)) /* tag name */
++ *p++ = *buf++;
++ *p = 0;
++ while (*buf && isspace(*buf)) /* skip blanks */
++ buf++;
++ p = line;
++ while (*buf && !isspace(*buf)) /* line no */
++ *p++ = *buf++;
++ *p = 0;
++ while (*buf && isspace(*buf)) /* skip blanks */
++ buf++;
++ p = file;
++ while (*buf && !isspace(*buf)) /* file name */
++ *p++ = *buf++;
+ *p = 0;
+
+ /* value check */
-+ if (strlen(*tag) && strlen(*line) && strlen(*file) && atoi(*line) > 0)
++ if (strlen(tag) && strlen(line) && strlen(file) && atoi(line) > 0)
+ return 1; /* OK */
-+ err:
+ return 0; /* ERROR */
+ }
+
@@ -378,9 +368,9 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
+ size_t len;
+ int echk;
+ TAG *tp;
-+ char *name, *file, *line;
-+ char command[BUFSIZ];
-+ char buf[BUFSIZ];
++ static char name[80], file[200], line[10];
++ char command[200];
++ char buf[BUFSIZ+1];
+ FILE *fp;
+
+ /* Allocate and initialize the tag queue structure. */
@@ -394,7 +384,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
+ * Find the tag, only display missing file messages once, and
+ * then only if we didn't find the tag.
+ */
-+ snprintf(command, sizeof(command), "global -%s '%s' 2>/dev/null", ref ? "rx" : "x", tag);
++ sprintf(command, "global -%s '%s'", ref ? "rx" : "x", tag);
+ if (fp = popen(command, "r")) {
+ while (fgets(buf, sizeof(buf), fp)) {
+ if (buf[strlen(buf)-1] == '\n') /* chop(buf) */
@@ -402,7 +392,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
+ else
+ while (fgetc(fp) != '\n')
+ ;
-+ if (getentry(buf, &name, &file, &line) == 0) {
++ if (getentry(buf, name, file, line) == 0) {
+ echk = 1;
+ F_SET(tfp, TAGF_ERR);
+ break;
@@ -438,7 +428,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
* Search the list of tags files for a tag, and return tag queue.
diff -c -r -N /usr/local/src/nvi-1.79/include/ex_def.h ./include/ex_def.h
*** /usr/local/src/nvi-1.79/include/ex_def.h Wed Oct 23 22:53:09 1996
---- ./include/ex_def.h Fri Aug 14 01:41:14 1998
+--- ./include/ex_def.h Wed Apr 16 21:20:09 1997
***************
*** 47,78 ****
#define C_RECOVER 46
@@ -509,7 +499,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/include/ex_def.h ./include/ex_def.h
! #define C_SUBTILDE 78
diff -c -r -N /usr/local/src/nvi-1.79/include/ex_extern.h ./include/ex_extern.h
*** /usr/local/src/nvi-1.79/include/ex_extern.h Wed Oct 23 22:53:10 1996
---- ./include/ex_extern.h Fri Aug 14 01:41:14 1998
+--- ./include/ex_extern.h Wed Apr 16 21:20:09 1997
***************
*** 89,94 ****
--- 89,95 ----
@@ -522,7 +512,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/include/ex_extern.h ./include/ex_extern.h
int ex_tag_prev __P((SCR *, EXCMD *));
diff -c -r -N /usr/local/src/nvi-1.79/include/options_def.h ./include/options_def.h
*** /usr/local/src/nvi-1.79/include/options_def.h Wed Oct 23 22:53:10 1996
---- ./include/options_def.h Fri Aug 14 01:41:14 1998
+--- ./include/options_def.h Wed Apr 16 21:20:09 1997
***************
*** 16,79 ****
#define O_EXTENDED 15
@@ -657,7 +647,7 @@ diff -c -r -N /usr/local/src/nvi-1.79/include/options_def.h ./include/options_de
! #define O_OPTIONCOUNT 79
diff -c -r -N /usr/local/src/nvi-1.79/vi/v_ex.c ./vi/v_ex.c
*** /usr/local/src/nvi-1.79/vi/v_ex.c Mon Sep 16 05:03:02 1996
---- ./vi/v_ex.c Fri Aug 14 01:41:14 1998
+--- ./vi/v_ex.c Wed Apr 16 21:20:09 1997
***************
*** 226,231 ****
--- 226,236 ----
diff --git a/contrib/global/systags/systags.sh b/contrib/global/systags/systags.sh
index 97f43e2665fb..09fa205a57b7 100755
--- a/contrib/global/systags/systags.sh
+++ b/contrib/global/systags/systags.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 1997, 1998 Shigio Yamaguchi. All rights reserved.
+# Copyright (c) 1997 Shigio Yamaguchi. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -29,219 +29,59 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# systags.sh 17-Aug-98
+# systags.sh 7-Jul-97
#
# script to make hypertext of kernel source.
-# support OS: FreeBSD, NetBSD, OpenBSD, Linux, GNUmach, GNUhurd
+# supporting FreeBSD and Linux.
#
-while case $1 in
- -*)
- if grep '[^-cfgn]' <<! >/dev/null 2>&1; then
-$1
-!
- echo "usage: systags [-c][-f][-g][-n][dir]"
- exit 1
- fi
- case $1 in
- *c*) cflag=c;;
- esac
- case $1 in
- *f*) fflag=f;;
- esac
- case $1 in
- *g*) gflag=g;;
- esac
- case $1 in
- *n*) nflag=n;;
- esac
- ;;
- *) false;;
- esac
-do
- shift
-done
+case $1 in
+-n) nflag=1; shift;;
+esac
case $1 in
"") dir=.;;
*) dir=$1;;
esac
-if [ ! -d $dir -o ! -w $dir ]; then
- echo "systags: '$dir' is not a directory or not writable."
- exit 1
-fi
-tmpdir=$dir/systags_tmpdir_$$
#
# get release number from source tree.
#
if [ -f conf/newvers.sh ]; then
- # (Free|Net|Open)BSD?
- if ! mkdir $tmpdir 2>/dev/null; then
- echo "systags: '$dir' is not writable."
- exit 1
- fi
- cwd=`pwd`
- (cd $tmpdir; sh $cwd/conf/newvers.sh)
- os=`awk -F\" '/char[ \t]+ostype\[\][ \t]*=[ \t]*\"[^"]+\"/ {print $2}' < $tmpdir/vers.c`;
- release=`awk -F\" '/char[ \t]+osrelease\[\][ \t]*=[ \t]*\"[^"]+\"/ {print $2}' < $tmpdir/vers.c`;
- rm -rf $tmpdir
+ os=FreeBSD
+ release=`awk -F= '/^RELEASE=/ {print $2}' < conf/newvers.sh`
elif [ -f Makefile ] && grep '^vmlinux:' Makefile >/dev/null; then
- # Linux?
os=Linux
version=`awk -F= '/^VERSION *=/ {print $2}' < Makefile`
patchlevel=`awk -F= '/^PATCHLEVEL *=/ {print $2}' < Makefile`
sublevel=`awk -F= '/^SUBLEVEL *=/ {print $2}' < Makefile`
release=`echo "$version.$patchlevel.$sublevel" | tr -d ' '`
-elif [ -f version.c ]; then
- # GNU mach?
- version=`awk -F\" '/char[ \t]+version\[\][ \t]*=[ \t]*\"[^"]+\"/ {print $2}' < version.c`
- os=`echo $version | awk '{print $1}'`
- release=`echo $version | awk '{print $2}'`
-elif [ -f version.h ]; then
- # GNU hurd?
- release=`awk -F\" '/^#define[ \t]+HURD_VERSION[ \t]+"[^"]+\"/ {print $2}' < version.h`
- if [ ${release}X != X ]; then
- os=GNUhurd
- fi
fi
#
# remove old files
#
-files=
-for f in htags.log gtags.log GTAGS GRTAGS GSYMS GPATH HTML; do
- files="$files $dir/$f";
-done
-com="rm -rf $files"
case $nflag in
-n) echo $com;;
-*) eval $com;;
+1) echo "rm -rf $dir/htags.log $dir/gtags.log $dir/GTAGS $dir/GRTAGS $dir/GSYMS $dir/HTML";;
+*) rm -rf $dir/htags.log $dir/gtags.log $dir/GTAGS $dir/GRTAGS $dir/GSYMS $dir/HTML;;
esac
#
-# FreeBSD System macros.
+# make global database(GTAGS, GRTAGS, GSYMS).
#
-# These macros with argument are used out of function.
-# gctags(1) knows these are not function by '.notfunction' list.
-#
-# kernel.h MAKE_SET,TEXT_SET,DATA_SET,BSS_SET,ABS_SET,
-# SYSINIT,SYSINIT_KT,SYSINIT_KP,PSEUDO_SET
-# sysctl.h SYSCTL_OID,SYSCTL_NODE,SYSCTL_STRING,SYSCTL_INT,SYSCTL_OPAQUE,
-# SYSCTL_STRUCT,SYSCTL_PROC
-# domain.h DOMAIN_SET
-# mount.h VFS_SET
-# lkm.h MOD_DECL,MOD_SYSCALL,MOD_VFS,MOD_DEV,MOD_EXEC,MOD_MISC
-# vnode.h VNODEOP_SET
-# spl.h GENSPL
-# queue.h SLIST_HEAD,SLIST_ENTRY,SLIST_INIT,SLIST_INSERT_AFTER,
-# SLIST_INSERT_HEAD,SLIST_REMOVE_HEAD,SLIST_REMOVE,STAILQ_HEAD,
-# STAILQ_ENTRY,STAILQ_INIT,STAILQ_INSERT_HEAD,STAILQ_INSERT_TAIL,
-# STAILQ_INSERT_AFTER,STAILQ_REMOVE_HEAD,STAILQ_REMOVE,
-# LIST_HEAD,LIST_ENTRY,LIST_INIT,LIST_INSERT_AFTER,LIST_INSERT_BEFORE,
-# LIST_INSERT_HEAD,LIST_REMOVE,TAILQ_HEAD,TAILQ_ENTRY,
-# TAILQ_EMPTY,TAILQ_FIRST,TAILQ_LAST,TAILQ_NEXT,TAILQ_PREV,
-# TAILQ_INIT,TAILQ_INSERT_HEAD,TAILQ_INSERT_TAIL,TAILQ_INSERT_AFTER,
-# TAILQ_INSERT_BEFORE,TAILQ_REMOVE,CIRCLEQ_HEAD,CIRCLEQ_ENTRY,
-# CIRCLEQ_INIT,CIRCLEQ_INSERT_AFTER,CIRCLEQ_INSERT_BEFORE,
-# CIRCLEQ_INSERT_HEAD,CIRCLEQ_INSERT_TAIL,CIRCLEQ_REMOVE
-#
-case $os in
-FreeBSD)
- cat <<-! >.notfunction
- MAKE_SET
- TEXT_SET
- DATA_SET
- BSS_SET
- ABS_SET
- SYSINIT
- SYSINIT_KT
- SYSINIT_KP
- PSEUDO_SET
- SYSCTL_OID
- SYSCTL_NODE
- SYSCTL_STRING
- SYSCTL_INT
- SYSCTL_OPAQUE
- SYSCTL_STRUCT
- SYSCTL_PROC
- DOMAIN_SET
- VFS_SET
- MOD_DECL
- MOD_SYSCALL
- MOD_VFS
- MOD_DEV
- MOD_EXEC
- MOD_MISC
- VNODEOP_SET
- GENSPL
- SLIST_HEAD
- SLIST_ENTRY
- SLIST_INIT
- SLIST_INSERT_AFTER
- SLIST_INSERT_HEAD
- SLIST_REMOVE_HEAD
- SLIST_REMOVE
- STAILQ_HEAD
- STAILQ_ENTRY
- STAILQ_INIT
- STAILQ_INSERT_HEAD
- STAILQ_INSERT_TAIL
- STAILQ_INSERT_AFTER
- STAILQ_REMOVE_HEAD
- STAILQ_REMOVE
- LIST_HEAD
- LIST_ENTRY
- LIST_INIT
- LIST_INSERT_AFTER
- LIST_INSERT_BEFORE
- LIST_INSERT_HEAD
- LIST_REMOVE
- TAILQ_HEAD
- TAILQ_ENTRY
- TAILQ_EMPTY
- TAILQ_FIRST
- TAILQ_LAST
- TAILQ_NEXT
- TAILQ_PREV
- TAILQ_INIT
- TAILQ_INSERT_HEAD
- TAILQ_INSERT_TAIL
- TAILQ_INSERT_AFTER
- TAILQ_INSERT_BEFORE
- TAILQ_REMOVE
- CIRCLEQ_HEAD
- CIRCLEQ_ENTRY
- CIRCLEQ_INIT
- CIRCLEQ_INSERT_AFTER
- CIRCLEQ_INSERT_BEFORE
- CIRCLEQ_INSERT_HEAD
- CIRCLEQ_INSERT_TAIL
- CIRCLEQ_REMOVE
-!
-esac
-#
-# make global database(GTAGS, GRTAGS).
-#
-com="gtags -owv $dir > $dir/gtags.log 2>&1"
case $nflag in
-n) echo $com;;
-*) eval $com;;
+1) echo "gtags -v $dir > $dir/gtags.log 2>&1";;
+*) gtags -v $dir > $dir/gtags.log 2>&1;;
esac
case $? in
0) ;;
*) exit 1;;
esac
-case $gflag in
-g) exit 0;;
-esac
#
# make hypertext.
# (please replace this title with a suitable one.)
#
-if [ ${os}X != X -a ${release}X != X ]; then
- title="Welcome to $os $release kernel source tour!"
-else
- program=`/bin/pwd | sed 's/.*\///'`
- title="Welcome to $program source tour!"
-fi
-com="htags -${cflag}${fflag}lhnvat '$title' -d $dir $dir > $dir/htags.log 2>&1"
+case $os$release in
+"") program=`/bin/pwd | sed 's/.*\///'`
+ title="Welcome to $program source tour!";;
+*) title="Welcome to $os $release kernel source tour!";;
+esac
case $nflag in
-n) echo $com;;
-*) eval $com;;
+1) echo "htags -fnvat '$title' -d $dir $dir > $dir/htags.log 2>&1";;
+*) htags -fnvat "$title" -d $dir $dir> $dir/htags.log 2>&1;;
esac
diff --git a/contrib/groff/tmac/doc-common b/contrib/groff/tmac/doc-common
index 4888e1e5f2f2..e5507a26927c 100644
--- a/contrib/groff/tmac/doc-common
+++ b/contrib/groff/tmac/doc-common
@@ -266,8 +266,7 @@
. if "\\n(mo"10" .ds dD October
. if "\\n(mo"11" .ds dD November
. if "\\n(mo"12" .ds dD December
-. nr _y \\n(yr+1900
-. as dD \&\ \\n(dy, \\n(_y
+. as dD \&\ \\n(dy, \\n(yr+1900
. \}
.\}
.el \{\
diff --git a/contrib/groff/tmac/doc-syms b/contrib/groff/tmac/doc-syms
index 1e284243a55b..d5c451a684b0 100644
--- a/contrib/groff/tmac/doc-syms
+++ b/contrib/groff/tmac/doc-syms
@@ -250,12 +250,6 @@
\&is currently in beta test.
..
.\" NS St macro - standards (posix, ansi - formal standard names)
-.\" ISO/IEC 9945-1 : 1996 (-iso9945-1) comprises:
-.\" IEEE 1003.1-1996
-.\" IEEE 1003.1b-1993
-.\" IEEE 1003.1i-1995
-.\" and IEEE 1003.1c-1995
-.\"
.ds Px \\*(tNPOSIX
.ds Ai \\*(tNANSI
.de St
@@ -364,16 +358,6 @@
. as b1 (``\\*(tN\\*(Px.2\\*(aa'')
. \}
. \}
-. if "\\*(A\\n(aP"-iso9945-1" \{\
-. ie \\n(sT==1 \{\
-. ds b1 \&\\*(tNISO/IEC \\*(aa9945-1: 1996\\*(sV
-. as b1 (``\\*(tN\\*(Px.1\\*(aa'')
-. \}
-. el \{\
-. ds b1 \&\\*(tNISO/IEC \\*(aa9945-1: 1996\\*(sV
-. as b1 (``\\*(tN\\*(Px.1\\*(aa'')
-. \}
-. \}
. if "\\*(A\\n(aP"-ansiC" \{\
. ie \\n(sT==1 \{\
. ds b1 \&\\*(tNISO \\*(aa9899:\ 1990\\*(sV
diff --git a/contrib/groff/tmac/hyphen.us-ru b/contrib/groff/tmac/hyphen.us-ru
deleted file mode 100644
index 3ccef48465fe..000000000000
--- a/contrib/groff/tmac/hyphen.us-ru
+++ /dev/null
@@ -1,4833 +0,0 @@
-% Hyphenation patterns for US English and Russian (koi8-r).
-% These are the standard Plain TeX hyphenation patterns (in hyphen.tex).
-.ach4
-.ad4der
-.af1t
-.al3t
-.am5at
-.an5c
-.ang4
-.ani5m
-.ant4
-.an3te
-.anti5s
-.ar5s
-.ar4tie
-.ar4ty
-.as3c
-.as1p
-.as1s
-.aster5
-.atom5
-.au1d
-.av4i
-.awn4
-.ba4g
-.ba5na
-.bas4e
-.ber4
-.be5ra
-.be3sm
-.be5sto
-.bri2
-.but4ti
-.cam4pe
-.can5c
-.capa5b
-.car5ol
-.ca4t
-.ce4la
-.ch4
-.chill5i
-.ci2
-.cit5r
-.co3e
-.co4r
-.cor5ner
-.de4moi
-.de3o
-.de3ra
-.de3ri
-.des4c
-.dictio5
-.do4t
-.du4c
-.dumb5
-.earth5
-.eas3i
-.eb4
-.eer4
-.eg2
-.el5d
-.el3em
-.enam3
-.en3g
-.en3s
-.eq5ui5t
-.er4ri
-.es3
-.eu3
-.eye5
-.fes3
-.for5mer
-.ga2
-.ge2
-.gen3t4
-.ge5og
-.gi5a
-.gi4b
-.go4r
-.hand5i
-.han5k
-.he2
-.hero5i
-.hes3
-.het3
-.hi3b
-.hi3er
-.hon5ey
-.hon3o
-.hov5
-.id4l
-.idol3
-.im3m
-.im5pin
-.in1
-.in3ci
-.ine2
-.in2k
-.in3s
-.ir5r
-.is4i
-.ju3r
-.la4cy
-.la4m
-.lat5er
-.lath5
-.le2
-.leg5e
-.len4
-.lep5
-.lev1
-.li4g
-.lig5a
-.li2n
-.li3o
-.li4t
-.mag5a5
-.mal5o
-.man5a
-.mar5ti
-.me2
-.mer3c
-.me5ter
-.mis1
-.mist5i
-.mon3e
-.mo3ro
-.mu5ta
-.muta5b
-.ni4c
-.od2
-.odd5
-.of5te
-.or5ato
-.or3c
-.or1d
-.or3t
-.os3
-.os4tl
-.oth3
-.out3
-.ped5al
-.pe5te
-.pe5tit
-.pi4e
-.pio5n
-.pi2t
-.pre3m
-.ra4c
-.ran4t
-.ratio5na
-.ree2
-.re5mit
-.res2
-.re5stat
-.ri4g
-.rit5u
-.ro4q
-.ros5t
-.row5d
-.ru4d
-.sci3e
-.self5
-.sell5
-.se2n
-.se5rie
-.sh2
-.si2
-.sing4
-.st4
-.sta5bl
-.sy2
-.ta4
-.te4
-.ten5an
-.th2
-.ti2
-.til4
-.tim5o5
-.ting4
-.tin5k
-.ton4a
-.to4p
-.top5i
-.tou5s
-.trib5ut
-.un1a
-.un3ce
-.under5
-.un1e
-.un5k
-.un5o
-.un3u
-.up3
-.ure3
-.us5a
-.ven4de
-.ve5ra
-.wil5i
-.ye4
-4ab.
-a5bal
-a5ban
-abe2
-ab5erd
-abi5a
-ab5it5ab
-ab5lat
-ab5o5liz
-4abr
-ab5rog
-ab3ul
-a4car
-ac5ard
-ac5aro
-a5ceou
-ac1er
-a5chet
-4a2ci
-a3cie
-ac1in
-a3cio
-ac5rob
-act5if
-ac3ul
-ac4um
-a2d
-ad4din
-ad5er.
-2adi
-a3dia
-ad3ica
-adi4er
-a3dio
-a3dit
-a5diu
-ad4le
-ad3ow
-ad5ran
-ad4su
-4adu
-a3duc
-ad5um
-ae4r
-aeri4e
-a2f
-aff4
-a4gab
-aga4n
-ag5ell
-age4o
-4ageu
-ag1i
-4ag4l
-ag1n
-a2go
-3agog
-ag3oni
-a5guer
-ag5ul
-a4gy
-a3ha
-a3he
-ah4l
-a3ho
-ai2
-a5ia
-a3ic.
-ai5ly
-a4i4n
-ain5in
-ain5o
-ait5en
-a1j
-ak1en
-al5ab
-al3ad
-a4lar
-4aldi
-2ale
-al3end
-a4lenti
-a5le5o
-al1i
-al4ia.
-ali4e
-al5lev
-4allic
-4alm
-a5log.
-a4ly.
-4alys
-5a5lyst
-5alyt
-3alyz
-4ama
-am5ab
-am3ag
-ama5ra
-am5asc
-a4matis
-a4m5ato
-am5era
-am3ic
-am5if
-am5ily
-am1in
-ami4no
-a2mo
-a5mon
-amor5i
-amp5en
-a2n
-an3age
-3analy
-a3nar
-an3arc
-anar4i
-a3nati
-4and
-ande4s
-an3dis
-an1dl
-an4dow
-a5nee
-a3nen
-an5est.
-a3neu
-2ang
-ang5ie
-an1gl
-a4n1ic
-a3nies
-an3i3f
-an4ime
-a5nimi
-a5nine
-an3io
-a3nip
-an3ish
-an3it
-a3niu
-an4kli
-5anniz
-ano4
-an5ot
-anoth5
-an2sa
-an4sco
-an4sn
-an2sp
-ans3po
-an4st
-an4sur
-antal4
-an4tie
-4anto
-an2tr
-an4tw
-an3ua
-an3ul
-a5nur
-4ao
-apar4
-ap5at
-ap5ero
-a3pher
-4aphi
-a4pilla
-ap5illar
-ap3in
-ap3ita
-a3pitu
-a2pl
-apoc5
-ap5ola
-apor5i
-apos3t
-aps5es
-a3pu
-aque5
-2a2r
-ar3act
-a5rade
-ar5adis
-ar3al
-a5ramete
-aran4g
-ara3p
-ar4at
-a5ratio
-ar5ativ
-a5rau
-ar5av4
-araw4
-arbal4
-ar4chan
-ar5dine
-ar4dr
-ar5eas
-a3ree
-ar3ent
-a5ress
-ar4fi
-ar4fl
-ar1i
-ar5ial
-ar3ian
-a3riet
-ar4im
-ar5inat
-ar3io
-ar2iz
-ar2mi
-ar5o5d
-a5roni
-a3roo
-ar2p
-ar3q
-arre4
-ar4sa
-ar2sh
-4as.
-as4ab
-as3ant
-ashi4
-a5sia.
-a3sib
-a3sic
-5a5si4t
-ask3i
-as4l
-a4soc
-as5ph
-as4sh
-as3ten
-as1tr
-asur5a
-a2ta
-at3abl
-at5ac
-at3alo
-at5ap
-ate5c
-at5ech
-at3ego
-at3en.
-at3era
-ater5n
-a5terna
-at3est
-at5ev
-4ath
-ath5em
-a5then
-at4ho
-ath5om
-4ati.
-a5tia
-at5i5b
-at1ic
-at3if
-ation5ar
-at3itu
-a4tog
-a2tom
-at5omiz
-a4top
-a4tos
-a1tr
-at5rop
-at4sk
-at4tag
-at5te
-at4th
-a2tu
-at5ua
-at5ue
-at3ul
-at3ura
-a2ty
-au4b
-augh3
-au3gu
-au4l2
-aun5d
-au3r
-au5sib
-aut5en
-au1th
-a2va
-av3ag
-a5van
-ave4no
-av3era
-av5ern
-av5ery
-av1i
-avi4er
-av3ig
-av5oc
-a1vor
-3away
-aw3i
-aw4ly
-aws4
-ax4ic
-ax4id
-ay5al
-aye4
-ays4
-azi4er
-azz5i
-5ba.
-bad5ger
-ba4ge
-bal1a
-ban5dag
-ban4e
-ban3i
-barbi5
-bari4a
-bas4si
-1bat
-ba4z
-2b1b
-b2be
-b3ber
-bbi4na
-4b1d
-4be.
-beak4
-beat3
-4be2d
-be3da
-be3de
-be3di
-be3gi
-be5gu
-1bel
-be1li
-be3lo
-4be5m
-be5nig
-be5nu
-4bes4
-be3sp
-be5str
-3bet
-bet5iz
-be5tr
-be3tw
-be3w
-be5yo
-2bf
-4b3h
-bi2b
-bi4d
-3bie
-bi5en
-bi4er
-2b3if
-1bil
-bi3liz
-bina5r4
-bin4d
-bi5net
-bi3ogr
-bi5ou
-bi2t
-3bi3tio
-bi3tr
-3bit5ua
-b5itz
-b1j
-bk4
-b2l2
-blath5
-b4le.
-blen4
-5blesp
-b3lis
-b4lo
-blun4t
-4b1m
-4b3n
-bne5g
-3bod
-bod3i
-bo4e
-bol3ic
-bom4bi
-bon4a
-bon5at
-3boo
-5bor.
-4b1ora
-bor5d
-5bore
-5bori
-5bos4
-b5ota
-both5
-bo4to
-bound3
-4bp
-4brit
-broth3
-2b5s2
-bsor4
-2bt
-bt4l
-b4to
-b3tr
-buf4fer
-bu4ga
-bu3li
-bumi4
-bu4n
-bunt4i
-bu3re
-bus5ie
-buss4e
-5bust
-4buta
-3butio
-b5uto
-b1v
-4b5w
-5by.
-bys4
-1ca
-cab3in
-ca1bl
-cach4
-ca5den
-4cag4
-2c5ah
-ca3lat
-cal4la
-call5in
-4calo
-can5d
-can4e
-can4ic
-can5is
-can3iz
-can4ty
-cany4
-ca5per
-car5om
-cast5er
-cas5tig
-4casy
-ca4th
-4cativ
-cav5al
-c3c
-ccha5
-cci4a
-ccompa5
-ccon4
-ccou3t
-2ce.
-4ced.
-4ceden
-3cei
-5cel.
-3cell
-1cen
-3cenc
-2cen4e
-4ceni
-3cent
-3cep
-ce5ram
-4cesa
-3cessi
-ces5si5b
-ces5t
-cet4
-c5e4ta
-cew4
-2ch
-4ch.
-4ch3ab
-5chanic
-ch5a5nis
-che2
-cheap3
-4ched
-che5lo
-3chemi
-ch5ene
-ch3er.
-ch3ers
-4ch1in
-5chine.
-ch5iness
-5chini
-5chio
-3chit
-chi2z
-3cho2
-ch4ti
-1ci
-3cia
-ci2a5b
-cia5r
-ci5c
-4cier
-5cific.
-4cii
-ci4la
-3cili
-2cim
-2cin
-c4ina
-3cinat
-cin3em
-c1ing
-c5ing.
-5cino
-cion4
-4cipe
-ci3ph
-4cipic
-4cista
-4cisti
-2c1it
-cit3iz
-5ciz
-ck1
-ck3i
-1c4l4
-4clar
-c5laratio
-5clare
-cle4m
-4clic
-clim4
-cly4
-c5n
-1co
-co5ag
-coe2
-2cog
-co4gr
-coi4
-co3inc
-col5i
-5colo
-col3or
-com5er
-con4a
-c4one
-con3g
-con5t
-co3pa
-cop3ic
-co4pl
-4corb
-coro3n
-cos4e
-cov1
-cove4
-cow5a
-coz5e
-co5zi
-c1q
-cras5t
-5crat.
-5cratic
-cre3at
-5cred
-4c3reta
-cre4v
-cri2
-cri5f
-c4rin
-cris4
-5criti
-cro4pl
-crop5o
-cros4e
-cru4d
-4c3s2
-2c1t
-cta4b
-ct5ang
-c5tant
-c2te
-c3ter
-c4ticu
-ctim3i
-ctu4r
-c4tw
-cud5
-c4uf
-c4ui
-cu5ity
-5culi
-cul4tis
-3cultu
-cu2ma
-c3ume
-cu4mi
-3cun
-cu3pi
-cu5py
-cur5a4b
-cu5ria
-1cus
-cuss4i
-3c4ut
-cu4tie
-4c5utiv
-4cutr
-1cy
-cze4
-1d2a
-5da.
-2d3a4b
-dach4
-4daf
-2dag
-da2m2
-dan3g
-dard5
-dark5
-4dary
-3dat
-4dativ
-4dato
-5dav4
-dav5e
-5day
-d1b
-d5c
-d1d4
-2de.
-deaf5
-deb5it
-de4bon
-decan4
-de4cil
-de5com
-2d1ed
-4dee.
-de5if
-deli4e
-del5i5q
-de5lo
-d4em
-5dem.
-3demic
-dem5ic.
-de5mil
-de4mons
-demor5
-1den
-de4nar
-de3no
-denti5f
-de3nu
-de1p
-de3pa
-depi4
-de2pu
-d3eq
-d4erh
-5derm
-dern5iz
-der5s
-des2
-d2es.
-de1sc
-de2s5o
-des3ti
-de3str
-de4su
-de1t
-de2to
-de1v
-dev3il
-4dey
-4d1f
-d4ga
-d3ge4t
-dg1i
-d2gy
-d1h2
-5di.
-1d4i3a
-dia5b
-di4cam
-d4ice
-3dict
-3did
-5di3en
-d1if
-di3ge
-di4lato
-d1in
-1dina
-3dine.
-5dini
-di5niz
-1dio
-dio5g
-di4pl
-dir2
-di1re
-dirt5i
-dis1
-5disi
-d4is3t
-d2iti
-1di1v
-d1j
-d5k2
-4d5la
-3dle.
-3dled
-3dles.
-4dless
-2d3lo
-4d5lu
-2dly
-d1m
-4d1n4
-1do
-3do.
-do5de
-5doe
-2d5of
-d4og
-do4la
-doli4
-do5lor
-dom5iz
-do3nat
-doni4
-doo3d
-dop4p
-d4or
-3dos
-4d5out
-do4v
-3dox
-d1p
-1dr
-drag5on
-4drai
-dre4
-drea5r
-5dren
-dri4b
-dril4
-dro4p
-4drow
-5drupli
-4dry
-2d1s2
-ds4p
-d4sw
-d4sy
-d2th
-1du
-d1u1a
-du2c
-d1uca
-duc5er
-4duct.
-4ducts
-du5el
-du4g
-d3ule
-dum4be
-du4n
-4dup
-du4pe
-d1v
-d1w
-d2y
-5dyn
-dy4se
-dys5p
-e1a4b
-e3act
-ead1
-ead5ie
-ea4ge
-ea5ger
-ea4l
-eal5er
-eal3ou
-eam3er
-e5and
-ear3a
-ear4c
-ear5es
-ear4ic
-ear4il
-ear5k
-ear2t
-eart3e
-ea5sp
-e3ass
-east3
-ea2t
-eat5en
-eath3i
-e5atif
-e4a3tu
-ea2v
-eav3en
-eav5i
-eav5o
-2e1b
-e4bel.
-e4bels
-e4ben
-e4bit
-e3br
-e4cad
-ecan5c
-ecca5
-e1ce
-ec5essa
-ec2i
-e4cib
-ec5ificat
-ec5ifie
-ec5ify
-ec3im
-eci4t
-e5cite
-e4clam
-e4clus
-e2col
-e4comm
-e4compe
-e4conc
-e2cor
-ec3ora
-eco5ro
-e1cr
-e4crem
-ec4tan
-ec4te
-e1cu
-e4cul
-ec3ula
-2e2da
-4ed3d
-e4d1er
-ede4s
-4edi
-e3dia
-ed3ib
-ed3ica
-ed3im
-ed1it
-edi5z
-4edo
-e4dol
-edon2
-e4dri
-e4dul
-ed5ulo
-ee2c
-eed3i
-ee2f
-eel3i
-ee4ly
-ee2m
-ee4na
-ee4p1
-ee2s4
-eest4
-ee4ty
-e5ex
-e1f
-e4f3ere
-1eff
-e4fic
-5efici
-efil4
-e3fine
-ef5i5nite
-3efit
-efor5es
-e4fuse.
-4egal
-eger4
-eg5ib
-eg4ic
-eg5ing
-e5git5
-eg5n
-e4go.
-e4gos
-eg1ul
-e5gur
-5egy
-e1h4
-eher4
-ei2
-e5ic
-ei5d
-eig2
-ei5gl
-e3imb
-e3inf
-e1ing
-e5inst
-eir4d
-eit3e
-ei3th
-e5ity
-e1j
-e4jud
-ej5udi
-eki4n
-ek4la
-e1la
-e4la.
-e4lac
-elan4d
-el5ativ
-e4law
-elaxa4
-e3lea
-el5ebra
-5elec
-e4led
-el3ega
-e5len
-e4l1er
-e1les
-el2f
-el2i
-e3libe
-e4l5ic.
-el3ica
-e3lier
-el5igib
-e5lim
-e4l3ing
-e3lio
-e2lis
-el5ish
-e3liv3
-4ella
-el4lab
-ello4
-e5loc
-el5og
-el3op.
-el2sh
-el4ta
-e5lud
-el5ug
-e4mac
-e4mag
-e5man
-em5ana
-em5b
-e1me
-e2mel
-e4met
-em3ica
-emi4e
-em5igra
-em1in2
-em5ine
-em3i3ni
-e4mis
-em5ish
-e5miss
-em3iz
-5emniz
-emo4g
-emoni5o
-em3pi
-e4mul
-em5ula
-emu3n
-e3my
-en5amo
-e4nant
-ench4er
-en3dic
-e5nea
-e5nee
-en3em
-en5ero
-en5esi
-en5est
-en3etr
-e3new
-en5ics
-e5nie
-e5nil
-e3nio
-en3ish
-en3it
-e5niu
-5eniz
-4enn
-4eno
-eno4g
-e4nos
-en3ov
-en4sw
-ent5age
-4enthes
-en3ua
-en5uf
-e3ny.
-4en3z
-e5of
-eo2g
-e4oi4
-e3ol
-eop3ar
-e1or
-eo3re
-eo5rol
-eos4
-e4ot
-eo4to
-e5out
-e5ow
-e2pa
-e3pai
-ep5anc
-e5pel
-e3pent
-ep5etitio
-ephe4
-e4pli
-e1po
-e4prec
-ep5reca
-e4pred
-ep3reh
-e3pro
-e4prob
-ep4sh
-ep5ti5b
-e4put
-ep5uta
-e1q
-equi3l
-e4q3ui3s
-er1a
-era4b
-4erand
-er3ar
-4erati.
-2erb
-er4bl
-er3ch
-er4che
-2ere.
-e3real
-ere5co
-ere3in
-er5el.
-er3emo
-er5ena
-er5ence
-4erene
-er3ent
-ere4q
-er5ess
-er3est
-eret4
-er1h
-er1i
-e1ria4
-5erick
-e3rien
-eri4er
-er3ine
-e1rio
-4erit
-er4iu
-eri4v
-e4riva
-er3m4
-er4nis
-4ernit
-5erniz
-er3no
-2ero
-er5ob
-e5roc
-ero4r
-er1ou
-er1s
-er3set
-ert3er
-4ertl
-er3tw
-4eru
-eru4t
-5erwau
-e1s4a
-e4sage.
-e4sages
-es2c
-e2sca
-es5can
-e3scr
-es5cu
-e1s2e
-e2sec
-es5ecr
-es5enc
-e4sert.
-e4serts
-e4serva
-4esh
-e3sha
-esh5en
-e1si
-e2sic
-e2sid
-es5iden
-es5igna
-e2s5im
-es4i4n
-esis4te
-esi4u
-e5skin
-es4mi
-e2sol
-es3olu
-e2son
-es5ona
-e1sp
-es3per
-es5pira
-es4pre
-2ess
-es4si4b
-estan4
-es3tig
-es5tim
-4es2to
-e3ston
-2estr
-e5stro
-estruc5
-e2sur
-es5urr
-es4w
-eta4b
-eten4d
-e3teo
-ethod3
-et1ic
-e5tide
-etin4
-eti4no
-e5tir
-e5titio
-et5itiv
-4etn
-et5ona
-e3tra
-e3tre
-et3ric
-et5rif
-et3rog
-et5ros
-et3ua
-et5ym
-et5z
-4eu
-e5un
-e3up
-eu3ro
-eus4
-eute4
-euti5l
-eu5tr
-eva2p5
-e2vas
-ev5ast
-e5vea
-ev3ell
-evel3o
-e5veng
-even4i
-ev1er
-e5verb
-e1vi
-ev3id
-evi4l
-e4vin
-evi4v
-e5voc
-e5vu
-e1wa
-e4wag
-e5wee
-e3wh
-ewil5
-ew3ing
-e3wit
-1exp
-5eyc
-5eye.
-eys4
-1fa
-fa3bl
-fab3r
-fa4ce
-4fag
-fain4
-fall5e
-4fa4ma
-fam5is
-5far
-far5th
-fa3ta
-fa3the
-4fato
-fault5
-4f5b
-4fd
-4fe.
-feas4
-feath3
-fe4b
-4feca
-5fect
-2fed
-fe3li
-fe4mo
-fen2d
-fend5e
-fer1
-5ferr
-fev4
-4f1f
-f4fes
-f4fie
-f5fin.
-f2f5is
-f4fly
-f2fy
-4fh
-1fi
-fi3a
-2f3ic.
-4f3ical
-f3ican
-4ficate
-f3icen
-fi3cer
-fic4i
-5ficia
-5ficie
-4fics
-fi3cu
-fi5del
-fight5
-fil5i
-fill5in
-4fily
-2fin
-5fina
-fin2d5
-fi2ne
-f1in3g
-fin4n
-fis4ti
-f4l2
-f5less
-flin4
-flo3re
-f2ly5
-4fm
-4fn
-1fo
-5fon
-fon4de
-fon4t
-fo2r
-fo5rat
-for5ay
-fore5t
-for4i
-fort5a
-fos5
-4f5p
-fra4t
-f5rea
-fres5c
-fri2
-fril4
-frol5
-2f3s
-2ft
-f4to
-f2ty
-3fu
-fu5el
-4fug
-fu4min
-fu5ne
-fu3ri
-fusi4
-fus4s
-4futa
-1fy
-1ga
-gaf4
-5gal.
-3gali
-ga3lo
-2gam
-ga5met
-g5amo
-gan5is
-ga3niz
-gani5za
-4gano
-gar5n4
-gass4
-gath3
-4gativ
-4gaz
-g3b
-gd4
-2ge.
-2ged
-geez4
-gel4in
-ge5lis
-ge5liz
-4gely
-1gen
-ge4nat
-ge5niz
-4geno
-4geny
-1geo
-ge3om
-g4ery
-5gesi
-geth5
-4geto
-ge4ty
-ge4v
-4g1g2
-g2ge
-g3ger
-gglu5
-ggo4
-gh3in
-gh5out
-gh4to
-5gi.
-1gi4a
-gia5r
-g1ic
-5gicia
-g4ico
-gien5
-5gies.
-gil4
-g3imen
-3g4in.
-gin5ge
-5g4ins
-5gio
-3gir
-gir4l
-g3isl
-gi4u
-5giv
-3giz
-gl2
-gla4
-glad5i
-5glas
-1gle
-gli4b
-g3lig
-3glo
-glo3r
-g1m
-g4my
-gn4a
-g4na.
-gnet4t
-g1ni
-g2nin
-g4nio
-g1no
-g4non
-1go
-3go.
-gob5
-5goe
-3g4o4g
-go3is
-gon2
-4g3o3na
-gondo5
-go3ni
-5goo
-go5riz
-gor5ou
-5gos.
-gov1
-g3p
-1gr
-4grada
-g4rai
-gran2
-5graph.
-g5rapher
-5graphic
-4graphy
-4gray
-gre4n
-4gress.
-4grit
-g4ro
-gruf4
-gs2
-g5ste
-gth3
-gu4a
-3guard
-2gue
-5gui5t
-3gun
-3gus
-4gu4t
-g3w
-1gy
-2g5y3n
-gy5ra
-h3ab4l
-hach4
-hae4m
-hae4t
-h5agu
-ha3la
-hala3m
-ha4m
-han4ci
-han4cy
-5hand.
-han4g
-hang5er
-hang5o
-h5a5niz
-han4k
-han4te
-hap3l
-hap5t
-ha3ran
-ha5ras
-har2d
-hard3e
-har4le
-harp5en
-har5ter
-has5s
-haun4
-5haz
-haz3a
-h1b
-1head
-3hear
-he4can
-h5ecat
-h4ed
-he5do5
-he3l4i
-hel4lis
-hel4ly
-h5elo
-hem4p
-he2n
-hena4
-hen5at
-heo5r
-hep5
-h4era
-hera3p
-her4ba
-here5a
-h3ern
-h5erou
-h3ery
-h1es
-he2s5p
-he4t
-het4ed
-heu4
-h1f
-h1h
-hi5an
-hi4co
-high5
-h4il2
-himer4
-h4ina
-hion4e
-hi4p
-hir4l
-hi3ro
-hir4p
-hir4r
-his3el
-his4s
-hith5er
-hi2v
-4hk
-4h1l4
-hlan4
-h2lo
-hlo3ri
-4h1m
-hmet4
-2h1n
-h5odiz
-h5ods
-ho4g
-hoge4
-hol5ar
-3hol4e
-ho4ma
-home3
-hon4a
-ho5ny
-3hood
-hoon4
-hor5at
-ho5ris
-hort3e
-ho5ru
-hos4e
-ho5sen
-hos1p
-1hous
-house3
-hov5el
-4h5p
-4hr4
-hree5
-hro5niz
-hro3po
-4h1s2
-h4sh
-h4tar
-ht1en
-ht5es
-h4ty
-hu4g
-hu4min
-hun5ke
-hun4t
-hus3t4
-hu4t
-h1w
-h4wart
-hy3pe
-hy3ph
-hy2s
-2i1a
-i2al
-iam4
-iam5ete
-i2an
-4ianc
-ian3i
-4ian4t
-ia5pe
-iass4
-i4ativ
-ia4tric
-i4atu
-ibe4
-ib3era
-ib5ert
-ib5ia
-ib3in
-ib5it.
-ib5ite
-i1bl
-ib3li
-i5bo
-i1br
-i2b5ri
-i5bun
-4icam
-5icap
-4icar
-i4car.
-i4cara
-icas5
-i4cay
-iccu4
-4iceo
-4ich
-2ici
-i5cid
-ic5ina
-i2cip
-ic3ipa
-i4cly
-i2c5oc
-4i1cr
-5icra
-i4cry
-ic4te
-ictu2
-ic4t3ua
-ic3ula
-ic4um
-ic5uo
-i3cur
-2id
-i4dai
-id5anc
-id5d
-ide3al
-ide4s
-i2di
-id5ian
-idi4ar
-i5die
-id3io
-idi5ou
-id1it
-id5iu
-i3dle
-i4dom
-id3ow
-i4dr
-i2du
-id5uo
-2ie4
-ied4e
-5ie5ga
-ield3
-ien5a4
-ien4e
-i5enn
-i3enti
-i1er.
-i3esc
-i1est
-i3et
-4if.
-if5ero
-iff5en
-if4fr
-4ific.
-i3fie
-i3fl
-4ift
-2ig
-iga5b
-ig3era
-ight3i
-4igi
-i3gib
-ig3il
-ig3in
-ig3it
-i4g4l
-i2go
-ig3or
-ig5ot
-i5gre
-igu5i
-ig1ur
-i3h
-4i5i4
-i3j
-4ik
-i1la
-il3a4b
-i4lade
-i2l5am
-ila5ra
-i3leg
-il1er
-ilev4
-il5f
-il1i
-il3ia
-il2ib
-il3io
-il4ist
-2ilit
-il2iz
-ill5ab
-4iln
-il3oq
-il4ty
-il5ur
-il3v
-i4mag
-im3age
-ima5ry
-imenta5r
-4imet
-im1i
-im5ida
-imi5le
-i5mini
-4imit
-im4ni
-i3mon
-i2mu
-im3ula
-2in.
-i4n3au
-4inav
-incel4
-in3cer
-4ind
-in5dling
-2ine
-i3nee
-iner4ar
-i5ness
-4inga
-4inge
-in5gen
-4ingi
-in5gling
-4ingo
-4ingu
-2ini
-i5ni.
-i4nia
-in3io
-in1is
-i5nite.
-5initio
-in3ity
-4ink
-4inl
-2inn
-2i1no
-i4no4c
-ino4s
-i4not
-2ins
-in3se
-insur5a
-2int.
-2in4th
-in1u
-i5nus
-4iny
-2io
-4io.
-ioge4
-io2gr
-i1ol
-io4m
-ion3at
-ion4ery
-ion3i
-io5ph
-ior3i
-i4os
-io5th
-i5oti
-io4to
-i4our
-2ip
-ipe4
-iphras4
-ip3i
-ip4ic
-ip4re4
-ip3ul
-i3qua
-iq5uef
-iq3uid
-iq3ui3t
-4ir
-i1ra
-ira4b
-i4rac
-ird5e
-ire4de
-i4ref
-i4rel4
-i4res
-ir5gi
-ir1i
-iri5de
-ir4is
-iri3tu
-5i5r2iz
-ir4min
-iro4g
-5iron.
-ir5ul
-2is.
-is5ag
-is3ar
-isas5
-2is1c
-is3ch
-4ise
-is3er
-3isf
-is5han
-is3hon
-ish5op
-is3ib
-isi4d
-i5sis
-is5itiv
-4is4k
-islan4
-4isms
-i2so
-iso5mer
-is1p
-is2pi
-is4py
-4is1s
-is4sal
-issen4
-is4ses
-is4ta.
-is1te
-is1ti
-ist4ly
-4istral
-i2su
-is5us
-4ita.
-ita4bi
-i4tag
-4ita5m
-i3tan
-i3tat
-2ite
-it3era
-i5teri
-it4es
-2ith
-i1ti
-4itia
-4i2tic
-it3ica
-5i5tick
-it3ig
-it5ill
-i2tim
-2itio
-4itis
-i4tism
-i2t5o5m
-4iton
-i4tram
-it5ry
-4itt
-it3uat
-i5tud
-it3ul
-4itz.
-i1u
-2iv
-iv3ell
-iv3en.
-i4v3er.
-i4vers.
-iv5il.
-iv5io
-iv1it
-i5vore
-iv3o3ro
-i4v3ot
-4i5w
-ix4o
-4iy
-4izar
-izi4
-5izont
-5ja
-jac4q
-ja4p
-1je
-jer5s
-4jestie
-4jesty
-jew3
-jo4p
-5judg
-3ka.
-k3ab
-k5ag
-kais4
-kal4
-k1b
-k2ed
-1kee
-ke4g
-ke5li
-k3en4d
-k1er
-kes4
-k3est.
-ke4ty
-k3f
-kh4
-k1i
-5ki.
-5k2ic
-k4ill
-kilo5
-k4im
-k4in.
-kin4de
-k5iness
-kin4g
-ki4p
-kis4
-k5ish
-kk4
-k1l
-4kley
-4kly
-k1m
-k5nes
-1k2no
-ko5r
-kosh4
-k3ou
-kro5n
-4k1s2
-k4sc
-ks4l
-k4sy
-k5t
-k1w
-lab3ic
-l4abo
-laci4
-l4ade
-la3dy
-lag4n
-lam3o
-3land
-lan4dl
-lan5et
-lan4te
-lar4g
-lar3i
-las4e
-la5tan
-4lateli
-4lativ
-4lav
-la4v4a
-2l1b
-lbin4
-4l1c2
-lce4
-l3ci
-2ld
-l2de
-ld4ere
-ld4eri
-ldi4
-ld5is
-l3dr
-l4dri
-le2a
-le4bi
-left5
-5leg.
-5legg
-le4mat
-lem5atic
-4len.
-3lenc
-5lene.
-1lent
-le3ph
-le4pr
-lera5b
-ler4e
-3lerg
-3l4eri
-l4ero
-les2
-le5sco
-5lesq
-3less
-5less.
-l3eva
-lev4er.
-lev4era
-lev4ers
-3ley
-4leye
-2lf
-l5fr
-4l1g4
-l5ga
-lgar3
-l4ges
-lgo3
-2l3h
-li4ag
-li2am
-liar5iz
-li4as
-li4ato
-li5bi
-5licio
-li4cor
-4lics
-4lict.
-l4icu
-l3icy
-l3ida
-lid5er
-3lidi
-lif3er
-l4iff
-li4fl
-5ligate
-3ligh
-li4gra
-3lik
-4l4i4l
-lim4bl
-lim3i
-li4mo
-l4im4p
-l4ina
-1l4ine
-lin3ea
-lin3i
-link5er
-li5og
-4l4iq
-lis4p
-l1it
-l2it.
-5litica
-l5i5tics
-liv3er
-l1iz
-4lj
-lka3
-l3kal
-lka4t
-l1l
-l4law
-l2le
-l5lea
-l3lec
-l3leg
-l3lel
-l3le4n
-l3le4t
-ll2i
-l2lin4
-l5lina
-ll4o
-lloqui5
-ll5out
-l5low
-2lm
-l5met
-lm3ing
-l4mod
-lmon4
-2l1n2
-3lo.
-lob5al
-lo4ci
-4lof
-3logic
-l5ogo
-3logu
-lom3er
-5long
-lon4i
-l3o3niz
-lood5
-5lope.
-lop3i
-l3opm
-lora4
-lo4rato
-lo5rie
-lor5ou
-5los.
-los5et
-5losophiz
-5losophy
-los4t
-lo4ta
-loun5d
-2lout
-4lov
-2lp
-lpa5b
-l3pha
-l5phi
-lp5ing
-l3pit
-l4pl
-l5pr
-4l1r
-2l1s2
-l4sc
-l2se
-l4sie
-4lt
-lt5ag
-ltane5
-l1te
-lten4
-ltera4
-lth3i
-l5ties.
-ltis4
-l1tr
-ltu2
-ltur3a
-lu5a
-lu3br
-luch4
-lu3ci
-lu3en
-luf4
-lu5id
-lu4ma
-5lumi
-l5umn.
-5lumnia
-lu3o
-luo3r
-4lup
-luss4
-lus3te
-1lut
-l5ven
-l5vet4
-2l1w
-1ly
-4lya
-4lyb
-ly5me
-ly3no
-2lys4
-l5yse
-1ma
-2mab
-ma2ca
-ma5chine
-ma4cl
-mag5in
-5magn
-2mah
-maid5
-4mald
-ma3lig
-ma5lin
-mal4li
-mal4ty
-5mania
-man5is
-man3iz
-4map
-ma5rine.
-ma5riz
-mar4ly
-mar3v
-ma5sce
-mas4e
-mas1t
-5mate
-math3
-ma3tis
-4matiza
-4m1b
-mba4t5
-m5bil
-m4b3ing
-mbi4v
-4m5c
-4me.
-2med
-4med.
-5media
-me3die
-m5e5dy
-me2g
-mel5on
-mel4t
-me2m
-mem1o3
-1men
-men4a
-men5ac
-men4de
-4mene
-men4i
-mens4
-mensu5
-3ment
-men4te
-me5on
-m5ersa
-2mes
-3mesti
-me4ta
-met3al
-me1te
-me5thi
-m4etr
-5metric
-me5trie
-me3try
-me4v
-4m1f
-2mh
-5mi.
-mi3a
-mid4a
-mid4g
-mig4
-3milia
-m5i5lie
-m4ill
-min4a
-3mind
-m5inee
-m4ingl
-min5gli
-m5ingly
-min4t
-m4inu
-miot4
-m2is
-mis4er.
-mis5l
-mis4ti
-m5istry
-4mith
-m2iz
-4mk
-4m1l
-m1m
-mma5ry
-4m1n
-mn4a
-m4nin
-mn4o
-1mo
-4mocr
-5mocratiz
-mo2d1
-mo4go
-mois2
-moi5se
-4mok
-mo5lest
-mo3me
-mon5et
-mon5ge
-moni3a
-mon4ism
-mon4ist
-mo3niz
-monol4
-mo3ny.
-mo2r
-4mora.
-mos2
-mo5sey
-mo3sp
-moth3
-m5ouf
-3mous
-mo2v
-4m1p
-mpara5
-mpa5rab
-mpar5i
-m3pet
-mphas4
-m2pi
-mpi4a
-mp5ies
-m4p1in
-m5pir
-mp5is
-mpo3ri
-mpos5ite
-m4pous
-mpov5
-mp4tr
-m2py
-4m3r
-4m1s2
-m4sh
-m5si
-4mt
-1mu
-mula5r4
-5mult
-multi3
-3mum
-mun2
-4mup
-mu4u
-4mw
-1na
-2n1a2b
-n4abu
-4nac.
-na4ca
-n5act
-nag5er.
-nak4
-na4li
-na5lia
-4nalt
-na5mit
-n2an
-nanci4
-nan4it
-nank4
-nar3c
-4nare
-nar3i
-nar4l
-n5arm
-n4as
-nas4c
-nas5ti
-n2at
-na3tal
-nato5miz
-n2au
-nau3se
-3naut
-nav4e
-4n1b4
-ncar5
-n4ces.
-n3cha
-n5cheo
-n5chil
-n3chis
-nc1in
-nc4it
-ncour5a
-n1cr
-n1cu
-n4dai
-n5dan
-n1de
-nd5est.
-ndi4b
-n5d2if
-n1dit
-n3diz
-n5duc
-ndu4r
-nd2we
-2ne.
-n3ear
-ne2b
-neb3u
-ne2c
-5neck
-2ned
-ne4gat
-neg5ativ
-5nege
-ne4la
-nel5iz
-ne5mi
-ne4mo
-1nen
-4nene
-3neo
-ne4po
-ne2q
-n1er
-nera5b
-n4erar
-n2ere
-n4er5i
-ner4r
-1nes
-2nes.
-4nesp
-2nest
-4nesw
-3netic
-ne4v
-n5eve
-ne4w
-n3f
-n4gab
-n3gel
-nge4n4e
-n5gere
-n3geri
-ng5ha
-n3gib
-ng1in
-n5git
-n4gla
-ngov4
-ng5sh
-n1gu
-n4gum
-n2gy
-4n1h4
-nha4
-nhab3
-nhe4
-3n4ia
-ni3an
-ni4ap
-ni3ba
-ni4bl
-ni4d
-ni5di
-ni4er
-ni2fi
-ni5ficat
-n5igr
-nik4
-n1im
-ni3miz
-n1in
-5nine.
-nin4g
-ni4o
-5nis.
-nis4ta
-n2it
-n4ith
-3nitio
-n3itor
-ni3tr
-n1j
-4nk2
-n5kero
-n3ket
-nk3in
-n1kl
-4n1l
-n5m
-nme4
-nmet4
-4n1n2
-nne4
-nni3al
-nni4v
-nob4l
-no3ble
-n5ocl
-4n3o2d
-3noe
-4nog
-noge4
-nois5i
-no5l4i
-5nologis
-3nomic
-n5o5miz
-no4mo
-no3my
-no4n
-non4ag
-non5i
-n5oniz
-4nop
-5nop5o5li
-nor5ab
-no4rary
-4nosc
-nos4e
-nos5t
-no5ta
-1nou
-3noun
-nov3el3
-nowl3
-n1p4
-npi4
-npre4c
-n1q
-n1r
-nru4
-2n1s2
-ns5ab
-nsati4
-ns4c
-n2se
-n4s3es
-nsid1
-nsig4
-n2sl
-ns3m
-n4soc
-ns4pe
-n5spi
-nsta5bl
-n1t
-nta4b
-nter3s
-nt2i
-n5tib
-nti4er
-nti2f
-n3tine
-n4t3ing
-nti4p
-ntrol5li
-nt4s
-ntu3me
-nu1a
-nu4d
-nu5en
-nuf4fe
-n3uin
-3nu3it
-n4um
-nu1me
-n5umi
-3nu4n
-n3uo
-nu3tr
-n1v2
-n1w4
-nym4
-nyp4
-4nz
-n3za
-4oa
-oad3
-o5a5les
-oard3
-oas4e
-oast5e
-oat5i
-ob3a3b
-o5bar
-obe4l
-o1bi
-o2bin
-ob5ing
-o3br
-ob3ul
-o1ce
-och4
-o3chet
-ocif3
-o4cil
-o4clam
-o4cod
-oc3rac
-oc5ratiz
-ocre3
-5ocrit
-octor5a
-oc3ula
-o5cure
-od5ded
-od3ic
-odi3o
-o2do4
-odor3
-od5uct.
-od5ucts
-o4el
-o5eng
-o3er
-oe4ta
-o3ev
-o2fi
-of5ite
-ofit4t
-o2g5a5r
-og5ativ
-o4gato
-o1ge
-o5gene
-o5geo
-o4ger
-o3gie
-1o1gis
-og3it
-o4gl
-o5g2ly
-3ogniz
-o4gro
-ogu5i
-1ogy
-2ogyn
-o1h2
-ohab5
-oi2
-oic3es
-oi3der
-oiff4
-oig4
-oi5let
-o3ing
-oint5er
-o5ism
-oi5son
-oist5en
-oi3ter
-o5j
-2ok
-o3ken
-ok5ie
-o1la
-o4lan
-olass4
-ol2d
-old1e
-ol3er
-o3lesc
-o3let
-ol4fi
-ol2i
-o3lia
-o3lice
-ol5id.
-o3li4f
-o5lil
-ol3ing
-o5lio
-o5lis.
-ol3ish
-o5lite
-o5litio
-o5liv
-olli4e
-ol5ogiz
-olo4r
-ol5pl
-ol2t
-ol3ub
-ol3ume
-ol3un
-o5lus
-ol2v
-o2ly
-om5ah
-oma5l
-om5atiz
-om2be
-om4bl
-o2me
-om3ena
-om5erse
-o4met
-om5etry
-o3mia
-om3ic.
-om3ica
-o5mid
-om1in
-o5mini
-5ommend
-omo4ge
-o4mon
-om3pi
-ompro5
-o2n
-on1a
-on4ac
-o3nan
-on1c
-3oncil
-2ond
-on5do
-o3nen
-on5est
-on4gu
-on1ic
-o3nio
-on1is
-o5niu
-on3key
-on4odi
-on3omy
-on3s
-onspi4
-onspir5a
-onsu4
-onten4
-on3t4i
-ontif5
-on5um
-onva5
-oo2
-ood5e
-ood5i
-oo4k
-oop3i
-o3ord
-oost5
-o2pa
-ope5d
-op1er
-3opera
-4operag
-2oph
-o5phan
-o5pher
-op3ing
-o3pit
-o5pon
-o4posi
-o1pr
-op1u
-opy5
-o1q
-o1ra
-o5ra.
-o4r3ag
-or5aliz
-or5ange
-ore5a
-o5real
-or3ei
-ore5sh
-or5est.
-orew4
-or4gu
-4o5ria
-or3ica
-o5ril
-or1in
-o1rio
-or3ity
-o3riu
-or2mi
-orn2e
-o5rof
-or3oug
-or5pe
-3orrh
-or4se
-ors5en
-orst4
-or3thi
-or3thy
-or4ty
-o5rum
-o1ry
-os3al
-os2c
-os4ce
-o3scop
-4oscopi
-o5scr
-os4i4e
-os5itiv
-os3ito
-os3ity
-osi4u
-os4l
-o2so
-os4pa
-os4po
-os2ta
-o5stati
-os5til
-os5tit
-o4tan
-otele4g
-ot3er.
-ot5ers
-o4tes
-4oth
-oth5esi
-oth3i4
-ot3ic.
-ot5ica
-o3tice
-o3tif
-o3tis
-oto5s
-ou2
-ou3bl
-ouch5i
-ou5et
-ou4l
-ounc5er
-oun2d
-ou5v
-ov4en
-over4ne
-over3s
-ov4ert
-o3vis
-oviti4
-o5v4ol
-ow3der
-ow3el
-ow5est
-ow1i
-own5i
-o4wo
-oy1a
-1pa
-pa4ca
-pa4ce
-pac4t
-p4ad
-5pagan
-p3agat
-p4ai
-pain4
-p4al
-pan4a
-pan3el
-pan4ty
-pa3ny
-pa1p
-pa4pu
-para5bl
-par5age
-par5di
-3pare
-par5el
-p4a4ri
-par4is
-pa2te
-pa5ter
-5pathic
-pa5thy
-pa4tric
-pav4
-3pay
-4p1b
-pd4
-4pe.
-3pe4a
-pear4l
-pe2c
-2p2ed
-3pede
-3pedi
-pedia4
-ped4ic
-p4ee
-pee4d
-pek4
-pe4la
-peli4e
-pe4nan
-p4enc
-pen4th
-pe5on
-p4era.
-pera5bl
-p4erag
-p4eri
-peri5st
-per4mal
-perme5
-p4ern
-per3o
-per3ti
-pe5ru
-per1v
-pe2t
-pe5ten
-pe5tiz
-4pf
-4pg
-4ph.
-phar5i
-phe3no
-ph4er
-ph4es.
-ph1ic
-5phie
-ph5ing
-5phisti
-3phiz
-ph2l
-3phob
-3phone
-5phoni
-pho4r
-4phs
-ph3t
-5phu
-1phy
-pi3a
-pian4
-pi4cie
-pi4cy
-p4id
-p5ida
-pi3de
-5pidi
-3piec
-pi3en
-pi4grap
-pi3lo
-pi2n
-p4in.
-pind4
-p4ino
-3pi1o
-pion4
-p3ith
-pi5tha
-pi2tu
-2p3k2
-1p2l2
-3plan
-plas5t
-pli3a
-pli5er
-4plig
-pli4n
-ploi4
-plu4m
-plum4b
-4p1m
-2p3n
-po4c
-5pod.
-po5em
-po3et5
-5po4g
-poin2
-5point
-poly5t
-po4ni
-po4p
-1p4or
-po4ry
-1pos
-pos1s
-p4ot
-po4ta
-5poun
-4p1p
-ppa5ra
-p2pe
-p4ped
-p5pel
-p3pen
-p3per
-p3pet
-ppo5site
-pr2
-pray4e
-5preci
-pre5co
-pre3em
-pref5ac
-pre4la
-pre3r
-p3rese
-3press
-pre5ten
-pre3v
-5pri4e
-prin4t3
-pri4s
-pris3o
-p3roca
-prof5it
-pro3l
-pros3e
-pro1t
-2p1s2
-p2se
-ps4h
-p4sib
-2p1t
-pt5a4b
-p2te
-p2th
-pti3m
-ptu4r
-p4tw
-pub3
-pue4
-puf4
-pul3c
-pu4m
-pu2n
-pur4r
-5pus
-pu2t
-5pute
-put3er
-pu3tr
-put4ted
-put4tin
-p3w
-qu2
-qua5v
-2que.
-3quer
-3quet
-2rab
-ra3bi
-rach4e
-r5acl
-raf5fi
-raf4t
-r2ai
-ra4lo
-ram3et
-r2ami
-rane5o
-ran4ge
-r4ani
-ra5no
-rap3er
-3raphy
-rar5c
-rare4
-rar5ef
-4raril
-r2as
-ration4
-rau4t
-ra5vai
-rav3el
-ra5zie
-r1b
-r4bab
-r4bag
-rbi2
-rbi4f
-r2bin
-r5bine
-rb5ing.
-rb4o
-r1c
-r2ce
-rcen4
-r3cha
-rch4er
-r4ci4b
-rc4it
-rcum3
-r4dal
-rd2i
-rdi4a
-rdi4er
-rdin4
-rd3ing
-2re.
-re1al
-re3an
-re5arr
-5reav
-re4aw
-r5ebrat
-rec5oll
-rec5ompe
-re4cre
-2r2ed
-re1de
-re3dis
-red5it
-re4fac
-re2fe
-re5fer.
-re3fi
-re4fy
-reg3is
-re5it
-re1li
-re5lu
-r4en4ta
-ren4te
-re1o
-re5pin
-re4posi
-re1pu
-r1er4
-r4eri
-rero4
-re5ru
-r4es.
-re4spi
-ress5ib
-res2t
-re5stal
-re3str
-re4ter
-re4ti4z
-re3tri
-reu2
-re5uti
-rev2
-re4val
-rev3el
-r5ev5er.
-re5vers
-re5vert
-re5vil
-rev5olu
-re4wh
-r1f
-rfu4
-r4fy
-rg2
-rg3er
-r3get
-r3gic
-rgi4n
-rg3ing
-r5gis
-r5git
-r1gl
-rgo4n
-r3gu
-rh4
-4rh.
-4rhal
-ri3a
-ria4b
-ri4ag
-r4ib
-rib3a
-ric5as
-r4ice
-4rici
-5ricid
-ri4cie
-r4ico
-rid5er
-ri3enc
-ri3ent
-ri1er
-ri5et
-rig5an
-5rigi
-ril3iz
-5riman
-rim5i
-3rimo
-rim4pe
-r2ina
-5rina.
-rin4d
-rin4e
-rin4g
-ri1o
-5riph
-riph5e
-ri2pl
-rip5lic
-r4iq
-r2is
-r4is.
-ris4c
-r3ish
-ris4p
-ri3ta3b
-r5ited.
-rit5er.
-rit5ers
-rit3ic
-ri2tu
-rit5ur
-riv5el
-riv3et
-riv3i
-r3j
-r3ket
-rk4le
-rk4lin
-r1l
-rle4
-r2led
-r4lig
-r4lis
-rl5ish
-r3lo4
-r1m
-rma5c
-r2me
-r3men
-rm5ers
-rm3ing
-r4ming.
-r4mio
-r3mit
-r4my
-r4nar
-r3nel
-r4ner
-r5net
-r3ney
-r5nic
-r1nis4
-r3nit
-r3niv
-rno4
-r4nou
-r3nu
-rob3l
-r2oc
-ro3cr
-ro4e
-ro1fe
-ro5fil
-rok2
-ro5ker
-5role.
-rom5ete
-rom4i
-rom4p
-ron4al
-ron4e
-ro5n4is
-ron4ta
-1room
-5root
-ro3pel
-rop3ic
-ror3i
-ro5ro
-ros5per
-ros4s
-ro4the
-ro4ty
-ro4va
-rov5el
-rox5
-r1p
-r4pea
-r5pent
-rp5er.
-r3pet
-rp4h4
-rp3ing
-r3po
-r1r4
-rre4c
-rre4f
-r4reo
-rre4st
-rri4o
-rri4v
-rron4
-rros4
-rrys4
-4rs2
-r1sa
-rsa5ti
-rs4c
-r2se
-r3sec
-rse4cr
-rs5er.
-rs3es
-rse5v2
-r1sh
-r5sha
-r1si
-r4si4b
-rson3
-r1sp
-r5sw
-rtach4
-r4tag
-r3teb
-rten4d
-rte5o
-r1ti
-rt5ib
-rti4d
-r4tier
-r3tig
-rtil3i
-rtil4l
-r4tily
-r4tist
-r4tiv
-r3tri
-rtroph4
-rt4sh
-ru3a
-ru3e4l
-ru3en
-ru4gl
-ru3in
-rum3pl
-ru2n
-runk5
-run4ty
-r5usc
-ruti5n
-rv4e
-rvel4i
-r3ven
-rv5er.
-r5vest
-r3vey
-r3vic
-rvi4v
-r3vo
-r1w
-ry4c
-5rynge
-ry3t
-sa2
-2s1ab
-5sack
-sac3ri
-s3act
-5sai
-salar4
-sal4m
-sa5lo
-sal4t
-3sanc
-san4de
-s1ap
-sa5ta
-5sa3tio
-sat3u
-sau4
-sa5vor
-5saw
-4s5b
-scan4t5
-sca4p
-scav5
-s4ced
-4scei
-s4ces
-sch2
-s4cho
-3s4cie
-5scin4d
-scle5
-s4cli
-scof4
-4scopy
-scour5a
-s1cu
-4s5d
-4se.
-se4a
-seas4
-sea5w
-se2c3o
-3sect
-4s4ed
-se4d4e
-s5edl
-se2g
-seg3r
-5sei
-se1le
-5self
-5selv
-4seme
-se4mol
-sen5at
-4senc
-sen4d
-s5ened
-sen5g
-s5enin
-4sentd
-4sentl
-sep3a3
-4s1er.
-s4erl
-ser4o
-4servo
-s1e4s
-se5sh
-ses5t
-5se5um
-5sev
-sev3en
-sew4i
-5sex
-4s3f
-2s3g
-s2h
-2sh.
-sh1er
-5shev
-sh1in
-sh3io
-3ship
-shiv5
-sho4
-sh5old
-shon3
-shor4
-short5
-4shw
-si1b
-s5icc
-3side.
-5sides
-5sidi
-si5diz
-4signa
-sil4e
-4sily
-2s1in
-s2ina
-5sine.
-s3ing
-1sio
-5sion
-sion5a
-si2r
-sir5a
-1sis
-3sitio
-5siu
-1siv
-5siz
-sk2
-4ske
-s3ket
-sk5ine
-sk5ing
-s1l2
-s3lat
-s2le
-slith5
-2s1m
-s3ma
-small3
-sman3
-smel4
-s5men
-5smith
-smol5d4
-s1n4
-1so
-so4ce
-soft3
-so4lab
-sol3d2
-so3lic
-5solv
-3som
-3s4on.
-sona4
-son4g
-s4op
-5sophic
-s5ophiz
-s5ophy
-sor5c
-sor5d
-4sov
-so5vi
-2spa
-5spai
-spa4n
-spen4d
-2s5peo
-2sper
-s2phe
-3spher
-spho5
-spil4
-sp5ing
-4spio
-s4ply
-s4pon
-spor4
-4spot
-squal4l
-s1r
-2ss
-s1sa
-ssas3
-s2s5c
-s3sel
-s5seng
-s4ses.
-s5set
-s1si
-s4sie
-ssi4er
-ss5ily
-s4sl
-ss4li
-s4sn
-sspend4
-ss2t
-ssur5a
-ss5w
-2st.
-s2tag
-s2tal
-stam4i
-5stand
-s4ta4p
-5stat.
-s4ted
-stern5i
-s5tero
-ste2w
-stew5a
-s3the
-st2i
-s4ti.
-s5tia
-s1tic
-5stick
-s4tie
-s3tif
-st3ing
-5stir
-s1tle
-5stock
-stom3a
-5stone
-s4top
-3store
-st4r
-s4trad
-5stratu
-s4tray
-s4trid
-4stry
-4st3w
-s2ty
-1su
-su1al
-su4b3
-su2g3
-su5is
-suit3
-s4ul
-su2m
-sum3i
-su2n
-su2r
-4sv
-sw2
-4swo
-s4y
-4syc
-3syl
-syn5o
-sy5rin
-1ta
-3ta.
-2tab
-ta5bles
-5taboliz
-4taci
-ta5do
-4taf4
-tai5lo
-ta2l
-ta5la
-tal5en
-tal3i
-4talk
-tal4lis
-ta5log
-ta5mo
-tan4de
-tanta3
-ta5per
-ta5pl
-tar4a
-4tarc
-4tare
-ta3riz
-tas4e
-ta5sy
-4tatic
-ta4tur
-taun4
-tav4
-2taw
-tax4is
-2t1b
-4tc
-t4ch
-tch5et
-4t1d
-4te.
-tead4i
-4teat
-tece4
-5tect
-2t1ed
-te5di
-1tee
-teg4
-te5ger
-te5gi
-3tel.
-teli4
-5tels
-te2ma2
-tem3at
-3tenan
-3tenc
-3tend
-4tenes
-1tent
-ten4tag
-1teo
-te4p
-te5pe
-ter3c
-5ter3d
-1teri
-ter5ies
-ter3is
-teri5za
-5ternit
-ter5v
-4tes.
-4tess
-t3ess.
-teth5e
-3teu
-3tex
-4tey
-2t1f
-4t1g
-2th.
-than4
-th2e
-4thea
-th3eas
-the5at
-the3is
-3thet
-th5ic.
-th5ica
-4thil
-5think
-4thl
-th5ode
-5thodic
-4thoo
-thor5it
-tho5riz
-2ths
-1tia
-ti4ab
-ti4ato
-2ti2b
-4tick
-t4ico
-t4ic1u
-5tidi
-3tien
-tif2
-ti5fy
-2tig
-5tigu
-till5in
-1tim
-4timp
-tim5ul
-2t1in
-t2ina
-3tine.
-3tini
-1tio
-ti5oc
-tion5ee
-5tiq
-ti3sa
-3tise
-tis4m
-ti5so
-tis4p
-5tistica
-ti3tl
-ti4u
-1tiv
-tiv4a
-1tiz
-ti3za
-ti3zen
-2tl
-t5la
-tlan4
-3tle.
-3tled
-3tles.
-t5let.
-t5lo
-4t1m
-tme4
-2t1n2
-1to
-to3b
-to5crat
-4todo
-2tof
-to2gr
-to5ic
-to2ma
-tom4b
-to3my
-ton4ali
-to3nat
-4tono
-4tony
-to2ra
-to3rie
-tor5iz
-tos2
-5tour
-4tout
-to3war
-4t1p
-1tra
-tra3b
-tra5ch
-traci4
-trac4it
-trac4te
-tras4
-tra5ven
-trav5es5
-tre5f
-tre4m
-trem5i
-5tria
-tri5ces
-5tricia
-4trics
-2trim
-tri4v
-tro5mi
-tron5i
-4trony
-tro5phe
-tro3sp
-tro3v
-tru5i
-trus4
-4t1s2
-t4sc
-tsh4
-t4sw
-4t3t2
-t4tes
-t5to
-ttu4
-1tu
-tu1a
-tu3ar
-tu4bi
-tud2
-4tue
-4tuf4
-5tu3i
-3tum
-tu4nis
-2t3up.
-3ture
-5turi
-tur3is
-tur5o
-tu5ry
-3tus
-4tv
-tw4
-4t1wa
-twis4
-4two
-1ty
-4tya
-2tyl
-type3
-ty5ph
-4tz
-tz4e
-4uab
-uac4
-ua5na
-uan4i
-uar5ant
-uar2d
-uar3i
-uar3t
-u1at
-uav4
-ub4e
-u4bel
-u3ber
-u4bero
-u1b4i
-u4b5ing
-u3ble.
-u3ca
-uci4b
-uc4it
-ucle3
-u3cr
-u3cu
-u4cy
-ud5d
-ud3er
-ud5est
-udev4
-u1dic
-ud3ied
-ud3ies
-ud5is
-u5dit
-u4don
-ud4si
-u4du
-u4ene
-uens4
-uen4te
-uer4il
-3ufa
-u3fl
-ugh3en
-ug5in
-2ui2
-uil5iz
-ui4n
-u1ing
-uir4m
-uita4
-uiv3
-uiv4er.
-u5j
-4uk
-u1la
-ula5b
-u5lati
-ulch4
-5ulche
-ul3der
-ul4e
-u1len
-ul4gi
-ul2i
-u5lia
-ul3ing
-ul5ish
-ul4lar
-ul4li4b
-ul4lis
-4ul3m
-u1l4o
-4uls
-uls5es
-ul1ti
-ultra3
-4ultu
-u3lu
-ul5ul
-ul5v
-um5ab
-um4bi
-um4bly
-u1mi
-u4m3ing
-umor5o
-um2p
-unat4
-u2ne
-un4er
-u1ni
-un4im
-u2nin
-un5ish
-uni3v
-un3s4
-un4sw
-unt3ab
-un4ter.
-un4tes
-unu4
-un5y
-un5z
-u4ors
-u5os
-u1ou
-u1pe
-uper5s
-u5pia
-up3ing
-u3pl
-up3p
-upport5
-upt5ib
-uptu4
-u1ra
-4ura.
-u4rag
-u4ras
-ur4be
-urc4
-ur1d
-ure5at
-ur4fer
-ur4fr
-u3rif
-uri4fic
-ur1in
-u3rio
-u1rit
-ur3iz
-ur2l
-url5ing.
-ur4no
-uros4
-ur4pe
-ur4pi
-urs5er
-ur5tes
-ur3the
-urti4
-ur4tie
-u3ru
-2us
-u5sad
-u5san
-us4ap
-usc2
-us3ci
-use5a
-u5sia
-u3sic
-us4lin
-us1p
-us5sl
-us5tere
-us1tr
-u2su
-usur4
-uta4b
-u3tat
-4ute.
-4utel
-4uten
-uten4i
-4u1t2i
-uti5liz
-u3tine
-ut3ing
-ution5a
-u4tis
-5u5tiz
-u4t1l
-ut5of
-uto5g
-uto5matic
-u5ton
-u4tou
-uts4
-u3u
-uu4m
-u1v2
-uxu3
-uz4e
-1va
-5va.
-2v1a4b
-vac5il
-vac3u
-vag4
-va4ge
-va5lie
-val5o
-val1u
-va5mo
-va5niz
-va5pi
-var5ied
-3vat
-4ve.
-4ved
-veg3
-v3el.
-vel3li
-ve4lo
-v4ely
-ven3om
-v5enue
-v4erd
-5vere.
-v4erel
-v3eren
-ver5enc
-v4eres
-ver3ie
-vermi4n
-3verse
-ver3th
-v4e2s
-4ves.
-ves4te
-ve4te
-vet3er
-ve4ty
-vi5ali
-5vian
-5vide.
-5vided
-4v3iden
-5vides
-5vidi
-v3if
-vi5gn
-vik4
-2vil
-5vilit
-v3i3liz
-v1in
-4vi4na
-v2inc
-vin5d
-4ving
-vio3l
-v3io4r
-vi1ou
-vi4p
-vi5ro
-vis3it
-vi3so
-vi3su
-4viti
-vit3r
-4vity
-3viv
-5vo.
-voi4
-3vok
-vo4la
-v5ole
-5volt
-3volv
-vom5i
-vor5ab
-vori4
-vo4ry
-vo4ta
-4votee
-4vv4
-v4y
-w5abl
-2wac
-wa5ger
-wag5o
-wait5
-w5al.
-wam4
-war4t
-was4t
-wa1te
-wa5ver
-w1b
-wea5rie
-weath3
-wed4n
-weet3
-wee5v
-wel4l
-w1er
-west3
-w3ev
-whi4
-wi2
-wil2
-will5in
-win4de
-win4g
-wir4
-3wise
-with3
-wiz5
-w4k
-wl4es
-wl3in
-w4no
-1wo2
-wom1
-wo5ven
-w5p
-wra4
-wri4
-writa4
-w3sh
-ws4l
-ws4pe
-w5s4t
-4wt
-wy4
-x1a
-xac5e
-x4ago
-xam3
-x4ap
-xas5
-x3c2
-x1e
-xe4cuto
-x2ed
-xer4i
-xe5ro
-x1h
-xhi2
-xhil5
-xhu4
-x3i
-xi5a
-xi5c
-xi5di
-x4ime
-xi5miz
-x3o
-x4ob
-x3p
-xpan4d
-xpecto5
-xpe3d
-x1t2
-x3ti
-x1u
-xu3a
-xx4
-y5ac
-3yar4
-y5at
-y1b
-y1c
-y2ce
-yc5er
-y3ch
-ych4e
-ycom4
-ycot4
-y1d
-y5ee
-y1er
-y4erf
-yes4
-ye4t
-y5gi
-4y3h
-y1i
-y3la
-ylla5bl
-y3lo
-y5lu
-ymbol5
-yme4
-ympa3
-yn3chr
-yn5d
-yn5g
-yn5ic
-5ynx
-y1o4
-yo5d
-y4o5g
-yom4
-yo5net
-y4ons
-y4os
-y4ped
-yper5
-yp3i
-y3po
-y4poc
-yp2ta
-y5pu
-yra5m
-yr5ia
-y3ro
-yr4r
-ys4c
-y3s2e
-ys3ica
-ys3io
-3ysis
-y4so
-yss4
-ys1t
-ys3ta
-ysur4
-y3thin
-yt3ic
-y1w
-za1
-z5a2b
-zar2
-4zb
-2ze
-ze4n
-ze4p
-z1er
-ze3ro
-zet4
-2z1i
-z4il
-z4is
-5zl
-4zm
-1zo
-zo4m
-zo5ol
-zte4
-4z1z2
-z4zy
-Á1Á
-Á1Å
-Á1É
-Á1Ï
-Á1Õ
-Á1Ù
-Á1Ü
-Á1À
-Á1Ñ
-Å1Á
-Å1Å
-Å1É
-Å1Ï
-Å1Õ
-Å1Ù
-Å1Ü
-Å1À
-Å1Ñ
-É1Á
-É1Å
-É1É
-É1Ï
-É1Õ
-É1Ù
-É1Ü
-É1À
-É1Ñ
-Ï1Á
-Ï1Å
-Ï1É
-Ï1Ï
-Ï1Õ
-Ï1Ù
-Ï1Ü
-Ï1À
-Ï1Ñ
-Õ1Á
-Õ1Å
-Õ1É
-Õ1Ï
-Õ1Õ
-Õ1Ù
-Õ1Ü
-Õ1À
-Õ1Ñ
-Ù1Á
-Ù1Å
-Ù1É
-Ù1Ï
-Ù1Õ
-Ù1Ù
-Ù1Ü
-Ù1À
-Ù1Ñ
-Ü1Á
-Ü1Å
-Ü1É
-Ü1Ï
-Ü1Õ
-Ü1Ù
-Ü1Ü
-Ü1À
-Ü1Ñ
-À1Á
-À1Å
-À1É
-À1Ï
-À1Õ
-À1Ù
-À1Ü
-À1À
-À1Ñ
-Ñ1Á
-Ñ1Å
-Ñ1É
-Ñ1Ï
-Ñ1Õ
-Ñ1Ù
-Ñ1Ü
-Ñ1À
-Ñ1Ñ
-.ÂÄ2
-.ÂÌ2
-.ÂÒ2
-.ÂØ2
-.×Â2
-.×ÂÌ2
-.×ÂÒ2
-.××2
-.××Ò2
-.×ÇÌ2
-.×Ä2
-.×Ä×2
-.×ÄÒ2
-.×Ú2
-.×ÚÂ2
-.×Ú×2
-.×ÚÇ2
-.×ÚÇÌ2
-.×ÚÇÒ2
-.×ÚÄ2
-.×ÚÄÒ2
-.×ÚÌ2
-.×ÚÍ2
-.×ÚÒ2
-.×Úß2
-.×Ë2
-.×ËÌ2
-.×ËÒ2
-.×Ì2
-.×Í2
-.×Î2
-.×Ð2
-.×ÐÌ2
-.×ÐÒ2
-.×Ò2
-.×Ó2
-.×ÓË2
-.×ÓËÒ2
-.×ÓÌ2
-.×ÓÍ2
-.×ÓÐ2
-.×ÓÐÌ2
-.×ÓÐÒ2
-.×ÓÔ2
-.×ÓÔÒ2
-.×ÓÈ2
-.×ÓÈÌ2
-.×Ô2
-.×ÔÒ2
-.×È2
-.×Ã2
-.×Þ2
-.×Ø2
-.Ç×2
-.ÇÄ2
-.ÇÌ2
-.ÇÎ2
-.ÇÒ2
-.Ä×2
-.ÄÌ2
-.ÄÎ2
-.ÄÒ2
-.ÄØ2
-.Ö×2
-.ÖÇ2
-.ÖÇÌ2
-.ÖÄ2
-.ÖÖ2
-.ÖÒ2
-.Ú×2
-.ÚÄ2
-.ÚÄÒ2
-.ÚÌ2
-.ÚÍ2
-.ÚÎ2
-.ÚÒ2
-.Ë×2
-.ËÌ2
-.ËÎ2
-.ËÒ2
-.ËÓÔ2
-.ËÔ2
-.ÌÂ2
-.ÌÇ2
-.ÌÖ2
-.ÌØ2
-.ÌØ×2
-.ÍÇÌ2
-.ÍÇÎ2
-.ÍÌ2
-.ÍÎ2
-.ÍÒ2
-.ÍÓÔ2
-.ÍÈ2
-.ÍÞ2
-.ÍÝ2
-.ÎÒ2
-.ÐÌ2
-.ÐÎ2
-.ÐÒ2
-.ÐÓ2
-.ÐÔ2
-.ÐÈ2
-.ÐÞ2
-.ÐÛ2
-.ÐØ2
-.Ò×2
-.ÒÖ2
-.ÒÔ2
-.ÓÂ2
-.ÓÂÌ2
-.ÓÂÒ2
-.Ó×2
-.Ó×ÓÔ2
-.ÓÇ2
-.ÓÇÎ2
-.ÓÇÒ2
-.ÓÄ2
-.ÓÄ×2
-.ÓÄÒ2
-.ÓÖ2
-.ÓÚ2
-.ÓË2
-.ÓË×2
-.ÓËÌ2
-.ÓËÒ2
-.ÓÌ2
-.ÓÍ2
-.ÓÎ2
-.ÓÐ2
-.ÓÐÌ2
-.ÓÐÒ2
-.ÓÒ2
-.ÓÓ2
-.ÓÔ2
-.ÓÔ×2
-.ÓÔÌ2
-.ÓÔÒ2
-.ÓÆ2
-.ÓÈ2
-.ÓÈ×2
-.ÓÈÌ2
-.ÓÞ2
-.ÓÛ2
-.Óß2
-.Ô×2
-.ÔË2
-.ÔËÎ2
-.ÔÌ2
-.ÔÒ2
-.ÔÝ2
-.ÔØÍ2
-.ÔØÆ2
-.ÆÌ2
-.ÆÒ2
-.È×2
-.ÈÌ2
-.ÈÍ2
-.ÈÎ2
-.ÈÒ2
-.Ã×2
-.ÞÌ2
-.ÞÒ2
-.ÞÔ2
-.ÞØ2
-.Û×2
-.ÛË2
-.ÛË×2
-.ÛÌ2
-.ÛÎ2
-.ÛÐ2
-.ÛÒ2
-.ÛÔ2
-.ÛÔÒ2
-1ÂÁ
-1ÂÅ
-1ÂÉ
-1ÂÏ
-1ÂÕ
-1ÂÙ
-1ÂÑ
-1×Á
-1×Å
-1×É
-1×Ï
-1×Õ
-1×Ù
-1×Ñ
-1ÇÁ
-1ÇÅ
-1ÇÉ
-1ÇÏ
-1ÇÕ
-1ÄÁ
-1ÄÅ
-1ÄÉ
-1ÄÏ
-1ÄÕ
-1ÄÙ
-1ÄÀ
-1ÄÑ
-1ÖÁ
-1ÖÅ
-1ÖÉ
-1ÖÏ
-1ÖÕ
-1ÖÙ
-1ÚÁ
-1ÚÅ
-1ÚÉ
-1ÚÏ
-1ÚÕ
-1ÚÙ
-1ÚÑ
-1ËÁ
-1ËÅ
-1ËÉ
-1ËÏ
-1ËÕ
-1ÌÁ
-1ÌÅ
-1ÌÉ
-1ÌÏ
-1ÌÕ
-1ÌÙ
-1ÌÀ
-1ÌÑ
-1ÍÁ
-1ÍÅ
-1ÍÉ
-1ÍÏ
-1ÍÕ
-1ÍÙ
-1ÍÑ
-1ÎÁ
-1ÎÅ
-1ÎÉ
-1ÎÏ
-1ÎÕ
-1ÎÙ
-1ÎÀ
-1ÎÑ
-1ÐÁ
-1ÐÅ
-1ÐÉ
-1ÐÏ
-1ÐÕ
-1ÐÙ
-1ÐÑ
-1ÒÁ
-1ÒÅ
-1ÒÉ
-1ÒÏ
-1ÒÕ
-1ÒÙ
-1ÒÀ
-1ÒÑ
-1ÓÁ
-1ÓÅ
-1ÓÉ
-1ÓÏ
-1ÓÕ
-1ÓÙ
-1ÓÑ
-1ÔÁ
-1ÔÅ
-1ÔÉ
-1ÔÏ
-1ÔÕ
-1ÔÙ
-1ÔÀ
-1ÔÑ
-1ÆÁ
-1ÆÅ
-1ÆÉ
-1ÆÏ
-1ÆÕ
-1ÆÙ
-1ÈÁ
-1ÈÅ
-1ÈÉ
-1ÈÏ
-1ÈÕ
-1ÃÁ
-1ÃÅ
-1ÃÉ
-1ÃÏ
-1ÃÕ
-1ÃÙ
-1ÞÁ
-1ÞÅ
-1ÞÉ
-1ÞÏ
-1ÞÕ
-1ÛÁ
-1ÛÅ
-1ÛÉ
-1ÛÏ
-1ÛÕ
-1ÝÁ
-1ÝÅ
-1ÝÉ
-1ÝÏ
diff --git a/contrib/groff/tmac/locale/hyphen.us-ru b/contrib/groff/tmac/locale/hyphen.us-ru
deleted file mode 100644
index 3ccef48465fe..000000000000
--- a/contrib/groff/tmac/locale/hyphen.us-ru
+++ /dev/null
@@ -1,4833 +0,0 @@
-% Hyphenation patterns for US English and Russian (koi8-r).
-% These are the standard Plain TeX hyphenation patterns (in hyphen.tex).
-.ach4
-.ad4der
-.af1t
-.al3t
-.am5at
-.an5c
-.ang4
-.ani5m
-.ant4
-.an3te
-.anti5s
-.ar5s
-.ar4tie
-.ar4ty
-.as3c
-.as1p
-.as1s
-.aster5
-.atom5
-.au1d
-.av4i
-.awn4
-.ba4g
-.ba5na
-.bas4e
-.ber4
-.be5ra
-.be3sm
-.be5sto
-.bri2
-.but4ti
-.cam4pe
-.can5c
-.capa5b
-.car5ol
-.ca4t
-.ce4la
-.ch4
-.chill5i
-.ci2
-.cit5r
-.co3e
-.co4r
-.cor5ner
-.de4moi
-.de3o
-.de3ra
-.de3ri
-.des4c
-.dictio5
-.do4t
-.du4c
-.dumb5
-.earth5
-.eas3i
-.eb4
-.eer4
-.eg2
-.el5d
-.el3em
-.enam3
-.en3g
-.en3s
-.eq5ui5t
-.er4ri
-.es3
-.eu3
-.eye5
-.fes3
-.for5mer
-.ga2
-.ge2
-.gen3t4
-.ge5og
-.gi5a
-.gi4b
-.go4r
-.hand5i
-.han5k
-.he2
-.hero5i
-.hes3
-.het3
-.hi3b
-.hi3er
-.hon5ey
-.hon3o
-.hov5
-.id4l
-.idol3
-.im3m
-.im5pin
-.in1
-.in3ci
-.ine2
-.in2k
-.in3s
-.ir5r
-.is4i
-.ju3r
-.la4cy
-.la4m
-.lat5er
-.lath5
-.le2
-.leg5e
-.len4
-.lep5
-.lev1
-.li4g
-.lig5a
-.li2n
-.li3o
-.li4t
-.mag5a5
-.mal5o
-.man5a
-.mar5ti
-.me2
-.mer3c
-.me5ter
-.mis1
-.mist5i
-.mon3e
-.mo3ro
-.mu5ta
-.muta5b
-.ni4c
-.od2
-.odd5
-.of5te
-.or5ato
-.or3c
-.or1d
-.or3t
-.os3
-.os4tl
-.oth3
-.out3
-.ped5al
-.pe5te
-.pe5tit
-.pi4e
-.pio5n
-.pi2t
-.pre3m
-.ra4c
-.ran4t
-.ratio5na
-.ree2
-.re5mit
-.res2
-.re5stat
-.ri4g
-.rit5u
-.ro4q
-.ros5t
-.row5d
-.ru4d
-.sci3e
-.self5
-.sell5
-.se2n
-.se5rie
-.sh2
-.si2
-.sing4
-.st4
-.sta5bl
-.sy2
-.ta4
-.te4
-.ten5an
-.th2
-.ti2
-.til4
-.tim5o5
-.ting4
-.tin5k
-.ton4a
-.to4p
-.top5i
-.tou5s
-.trib5ut
-.un1a
-.un3ce
-.under5
-.un1e
-.un5k
-.un5o
-.un3u
-.up3
-.ure3
-.us5a
-.ven4de
-.ve5ra
-.wil5i
-.ye4
-4ab.
-a5bal
-a5ban
-abe2
-ab5erd
-abi5a
-ab5it5ab
-ab5lat
-ab5o5liz
-4abr
-ab5rog
-ab3ul
-a4car
-ac5ard
-ac5aro
-a5ceou
-ac1er
-a5chet
-4a2ci
-a3cie
-ac1in
-a3cio
-ac5rob
-act5if
-ac3ul
-ac4um
-a2d
-ad4din
-ad5er.
-2adi
-a3dia
-ad3ica
-adi4er
-a3dio
-a3dit
-a5diu
-ad4le
-ad3ow
-ad5ran
-ad4su
-4adu
-a3duc
-ad5um
-ae4r
-aeri4e
-a2f
-aff4
-a4gab
-aga4n
-ag5ell
-age4o
-4ageu
-ag1i
-4ag4l
-ag1n
-a2go
-3agog
-ag3oni
-a5guer
-ag5ul
-a4gy
-a3ha
-a3he
-ah4l
-a3ho
-ai2
-a5ia
-a3ic.
-ai5ly
-a4i4n
-ain5in
-ain5o
-ait5en
-a1j
-ak1en
-al5ab
-al3ad
-a4lar
-4aldi
-2ale
-al3end
-a4lenti
-a5le5o
-al1i
-al4ia.
-ali4e
-al5lev
-4allic
-4alm
-a5log.
-a4ly.
-4alys
-5a5lyst
-5alyt
-3alyz
-4ama
-am5ab
-am3ag
-ama5ra
-am5asc
-a4matis
-a4m5ato
-am5era
-am3ic
-am5if
-am5ily
-am1in
-ami4no
-a2mo
-a5mon
-amor5i
-amp5en
-a2n
-an3age
-3analy
-a3nar
-an3arc
-anar4i
-a3nati
-4and
-ande4s
-an3dis
-an1dl
-an4dow
-a5nee
-a3nen
-an5est.
-a3neu
-2ang
-ang5ie
-an1gl
-a4n1ic
-a3nies
-an3i3f
-an4ime
-a5nimi
-a5nine
-an3io
-a3nip
-an3ish
-an3it
-a3niu
-an4kli
-5anniz
-ano4
-an5ot
-anoth5
-an2sa
-an4sco
-an4sn
-an2sp
-ans3po
-an4st
-an4sur
-antal4
-an4tie
-4anto
-an2tr
-an4tw
-an3ua
-an3ul
-a5nur
-4ao
-apar4
-ap5at
-ap5ero
-a3pher
-4aphi
-a4pilla
-ap5illar
-ap3in
-ap3ita
-a3pitu
-a2pl
-apoc5
-ap5ola
-apor5i
-apos3t
-aps5es
-a3pu
-aque5
-2a2r
-ar3act
-a5rade
-ar5adis
-ar3al
-a5ramete
-aran4g
-ara3p
-ar4at
-a5ratio
-ar5ativ
-a5rau
-ar5av4
-araw4
-arbal4
-ar4chan
-ar5dine
-ar4dr
-ar5eas
-a3ree
-ar3ent
-a5ress
-ar4fi
-ar4fl
-ar1i
-ar5ial
-ar3ian
-a3riet
-ar4im
-ar5inat
-ar3io
-ar2iz
-ar2mi
-ar5o5d
-a5roni
-a3roo
-ar2p
-ar3q
-arre4
-ar4sa
-ar2sh
-4as.
-as4ab
-as3ant
-ashi4
-a5sia.
-a3sib
-a3sic
-5a5si4t
-ask3i
-as4l
-a4soc
-as5ph
-as4sh
-as3ten
-as1tr
-asur5a
-a2ta
-at3abl
-at5ac
-at3alo
-at5ap
-ate5c
-at5ech
-at3ego
-at3en.
-at3era
-ater5n
-a5terna
-at3est
-at5ev
-4ath
-ath5em
-a5then
-at4ho
-ath5om
-4ati.
-a5tia
-at5i5b
-at1ic
-at3if
-ation5ar
-at3itu
-a4tog
-a2tom
-at5omiz
-a4top
-a4tos
-a1tr
-at5rop
-at4sk
-at4tag
-at5te
-at4th
-a2tu
-at5ua
-at5ue
-at3ul
-at3ura
-a2ty
-au4b
-augh3
-au3gu
-au4l2
-aun5d
-au3r
-au5sib
-aut5en
-au1th
-a2va
-av3ag
-a5van
-ave4no
-av3era
-av5ern
-av5ery
-av1i
-avi4er
-av3ig
-av5oc
-a1vor
-3away
-aw3i
-aw4ly
-aws4
-ax4ic
-ax4id
-ay5al
-aye4
-ays4
-azi4er
-azz5i
-5ba.
-bad5ger
-ba4ge
-bal1a
-ban5dag
-ban4e
-ban3i
-barbi5
-bari4a
-bas4si
-1bat
-ba4z
-2b1b
-b2be
-b3ber
-bbi4na
-4b1d
-4be.
-beak4
-beat3
-4be2d
-be3da
-be3de
-be3di
-be3gi
-be5gu
-1bel
-be1li
-be3lo
-4be5m
-be5nig
-be5nu
-4bes4
-be3sp
-be5str
-3bet
-bet5iz
-be5tr
-be3tw
-be3w
-be5yo
-2bf
-4b3h
-bi2b
-bi4d
-3bie
-bi5en
-bi4er
-2b3if
-1bil
-bi3liz
-bina5r4
-bin4d
-bi5net
-bi3ogr
-bi5ou
-bi2t
-3bi3tio
-bi3tr
-3bit5ua
-b5itz
-b1j
-bk4
-b2l2
-blath5
-b4le.
-blen4
-5blesp
-b3lis
-b4lo
-blun4t
-4b1m
-4b3n
-bne5g
-3bod
-bod3i
-bo4e
-bol3ic
-bom4bi
-bon4a
-bon5at
-3boo
-5bor.
-4b1ora
-bor5d
-5bore
-5bori
-5bos4
-b5ota
-both5
-bo4to
-bound3
-4bp
-4brit
-broth3
-2b5s2
-bsor4
-2bt
-bt4l
-b4to
-b3tr
-buf4fer
-bu4ga
-bu3li
-bumi4
-bu4n
-bunt4i
-bu3re
-bus5ie
-buss4e
-5bust
-4buta
-3butio
-b5uto
-b1v
-4b5w
-5by.
-bys4
-1ca
-cab3in
-ca1bl
-cach4
-ca5den
-4cag4
-2c5ah
-ca3lat
-cal4la
-call5in
-4calo
-can5d
-can4e
-can4ic
-can5is
-can3iz
-can4ty
-cany4
-ca5per
-car5om
-cast5er
-cas5tig
-4casy
-ca4th
-4cativ
-cav5al
-c3c
-ccha5
-cci4a
-ccompa5
-ccon4
-ccou3t
-2ce.
-4ced.
-4ceden
-3cei
-5cel.
-3cell
-1cen
-3cenc
-2cen4e
-4ceni
-3cent
-3cep
-ce5ram
-4cesa
-3cessi
-ces5si5b
-ces5t
-cet4
-c5e4ta
-cew4
-2ch
-4ch.
-4ch3ab
-5chanic
-ch5a5nis
-che2
-cheap3
-4ched
-che5lo
-3chemi
-ch5ene
-ch3er.
-ch3ers
-4ch1in
-5chine.
-ch5iness
-5chini
-5chio
-3chit
-chi2z
-3cho2
-ch4ti
-1ci
-3cia
-ci2a5b
-cia5r
-ci5c
-4cier
-5cific.
-4cii
-ci4la
-3cili
-2cim
-2cin
-c4ina
-3cinat
-cin3em
-c1ing
-c5ing.
-5cino
-cion4
-4cipe
-ci3ph
-4cipic
-4cista
-4cisti
-2c1it
-cit3iz
-5ciz
-ck1
-ck3i
-1c4l4
-4clar
-c5laratio
-5clare
-cle4m
-4clic
-clim4
-cly4
-c5n
-1co
-co5ag
-coe2
-2cog
-co4gr
-coi4
-co3inc
-col5i
-5colo
-col3or
-com5er
-con4a
-c4one
-con3g
-con5t
-co3pa
-cop3ic
-co4pl
-4corb
-coro3n
-cos4e
-cov1
-cove4
-cow5a
-coz5e
-co5zi
-c1q
-cras5t
-5crat.
-5cratic
-cre3at
-5cred
-4c3reta
-cre4v
-cri2
-cri5f
-c4rin
-cris4
-5criti
-cro4pl
-crop5o
-cros4e
-cru4d
-4c3s2
-2c1t
-cta4b
-ct5ang
-c5tant
-c2te
-c3ter
-c4ticu
-ctim3i
-ctu4r
-c4tw
-cud5
-c4uf
-c4ui
-cu5ity
-5culi
-cul4tis
-3cultu
-cu2ma
-c3ume
-cu4mi
-3cun
-cu3pi
-cu5py
-cur5a4b
-cu5ria
-1cus
-cuss4i
-3c4ut
-cu4tie
-4c5utiv
-4cutr
-1cy
-cze4
-1d2a
-5da.
-2d3a4b
-dach4
-4daf
-2dag
-da2m2
-dan3g
-dard5
-dark5
-4dary
-3dat
-4dativ
-4dato
-5dav4
-dav5e
-5day
-d1b
-d5c
-d1d4
-2de.
-deaf5
-deb5it
-de4bon
-decan4
-de4cil
-de5com
-2d1ed
-4dee.
-de5if
-deli4e
-del5i5q
-de5lo
-d4em
-5dem.
-3demic
-dem5ic.
-de5mil
-de4mons
-demor5
-1den
-de4nar
-de3no
-denti5f
-de3nu
-de1p
-de3pa
-depi4
-de2pu
-d3eq
-d4erh
-5derm
-dern5iz
-der5s
-des2
-d2es.
-de1sc
-de2s5o
-des3ti
-de3str
-de4su
-de1t
-de2to
-de1v
-dev3il
-4dey
-4d1f
-d4ga
-d3ge4t
-dg1i
-d2gy
-d1h2
-5di.
-1d4i3a
-dia5b
-di4cam
-d4ice
-3dict
-3did
-5di3en
-d1if
-di3ge
-di4lato
-d1in
-1dina
-3dine.
-5dini
-di5niz
-1dio
-dio5g
-di4pl
-dir2
-di1re
-dirt5i
-dis1
-5disi
-d4is3t
-d2iti
-1di1v
-d1j
-d5k2
-4d5la
-3dle.
-3dled
-3dles.
-4dless
-2d3lo
-4d5lu
-2dly
-d1m
-4d1n4
-1do
-3do.
-do5de
-5doe
-2d5of
-d4og
-do4la
-doli4
-do5lor
-dom5iz
-do3nat
-doni4
-doo3d
-dop4p
-d4or
-3dos
-4d5out
-do4v
-3dox
-d1p
-1dr
-drag5on
-4drai
-dre4
-drea5r
-5dren
-dri4b
-dril4
-dro4p
-4drow
-5drupli
-4dry
-2d1s2
-ds4p
-d4sw
-d4sy
-d2th
-1du
-d1u1a
-du2c
-d1uca
-duc5er
-4duct.
-4ducts
-du5el
-du4g
-d3ule
-dum4be
-du4n
-4dup
-du4pe
-d1v
-d1w
-d2y
-5dyn
-dy4se
-dys5p
-e1a4b
-e3act
-ead1
-ead5ie
-ea4ge
-ea5ger
-ea4l
-eal5er
-eal3ou
-eam3er
-e5and
-ear3a
-ear4c
-ear5es
-ear4ic
-ear4il
-ear5k
-ear2t
-eart3e
-ea5sp
-e3ass
-east3
-ea2t
-eat5en
-eath3i
-e5atif
-e4a3tu
-ea2v
-eav3en
-eav5i
-eav5o
-2e1b
-e4bel.
-e4bels
-e4ben
-e4bit
-e3br
-e4cad
-ecan5c
-ecca5
-e1ce
-ec5essa
-ec2i
-e4cib
-ec5ificat
-ec5ifie
-ec5ify
-ec3im
-eci4t
-e5cite
-e4clam
-e4clus
-e2col
-e4comm
-e4compe
-e4conc
-e2cor
-ec3ora
-eco5ro
-e1cr
-e4crem
-ec4tan
-ec4te
-e1cu
-e4cul
-ec3ula
-2e2da
-4ed3d
-e4d1er
-ede4s
-4edi
-e3dia
-ed3ib
-ed3ica
-ed3im
-ed1it
-edi5z
-4edo
-e4dol
-edon2
-e4dri
-e4dul
-ed5ulo
-ee2c
-eed3i
-ee2f
-eel3i
-ee4ly
-ee2m
-ee4na
-ee4p1
-ee2s4
-eest4
-ee4ty
-e5ex
-e1f
-e4f3ere
-1eff
-e4fic
-5efici
-efil4
-e3fine
-ef5i5nite
-3efit
-efor5es
-e4fuse.
-4egal
-eger4
-eg5ib
-eg4ic
-eg5ing
-e5git5
-eg5n
-e4go.
-e4gos
-eg1ul
-e5gur
-5egy
-e1h4
-eher4
-ei2
-e5ic
-ei5d
-eig2
-ei5gl
-e3imb
-e3inf
-e1ing
-e5inst
-eir4d
-eit3e
-ei3th
-e5ity
-e1j
-e4jud
-ej5udi
-eki4n
-ek4la
-e1la
-e4la.
-e4lac
-elan4d
-el5ativ
-e4law
-elaxa4
-e3lea
-el5ebra
-5elec
-e4led
-el3ega
-e5len
-e4l1er
-e1les
-el2f
-el2i
-e3libe
-e4l5ic.
-el3ica
-e3lier
-el5igib
-e5lim
-e4l3ing
-e3lio
-e2lis
-el5ish
-e3liv3
-4ella
-el4lab
-ello4
-e5loc
-el5og
-el3op.
-el2sh
-el4ta
-e5lud
-el5ug
-e4mac
-e4mag
-e5man
-em5ana
-em5b
-e1me
-e2mel
-e4met
-em3ica
-emi4e
-em5igra
-em1in2
-em5ine
-em3i3ni
-e4mis
-em5ish
-e5miss
-em3iz
-5emniz
-emo4g
-emoni5o
-em3pi
-e4mul
-em5ula
-emu3n
-e3my
-en5amo
-e4nant
-ench4er
-en3dic
-e5nea
-e5nee
-en3em
-en5ero
-en5esi
-en5est
-en3etr
-e3new
-en5ics
-e5nie
-e5nil
-e3nio
-en3ish
-en3it
-e5niu
-5eniz
-4enn
-4eno
-eno4g
-e4nos
-en3ov
-en4sw
-ent5age
-4enthes
-en3ua
-en5uf
-e3ny.
-4en3z
-e5of
-eo2g
-e4oi4
-e3ol
-eop3ar
-e1or
-eo3re
-eo5rol
-eos4
-e4ot
-eo4to
-e5out
-e5ow
-e2pa
-e3pai
-ep5anc
-e5pel
-e3pent
-ep5etitio
-ephe4
-e4pli
-e1po
-e4prec
-ep5reca
-e4pred
-ep3reh
-e3pro
-e4prob
-ep4sh
-ep5ti5b
-e4put
-ep5uta
-e1q
-equi3l
-e4q3ui3s
-er1a
-era4b
-4erand
-er3ar
-4erati.
-2erb
-er4bl
-er3ch
-er4che
-2ere.
-e3real
-ere5co
-ere3in
-er5el.
-er3emo
-er5ena
-er5ence
-4erene
-er3ent
-ere4q
-er5ess
-er3est
-eret4
-er1h
-er1i
-e1ria4
-5erick
-e3rien
-eri4er
-er3ine
-e1rio
-4erit
-er4iu
-eri4v
-e4riva
-er3m4
-er4nis
-4ernit
-5erniz
-er3no
-2ero
-er5ob
-e5roc
-ero4r
-er1ou
-er1s
-er3set
-ert3er
-4ertl
-er3tw
-4eru
-eru4t
-5erwau
-e1s4a
-e4sage.
-e4sages
-es2c
-e2sca
-es5can
-e3scr
-es5cu
-e1s2e
-e2sec
-es5ecr
-es5enc
-e4sert.
-e4serts
-e4serva
-4esh
-e3sha
-esh5en
-e1si
-e2sic
-e2sid
-es5iden
-es5igna
-e2s5im
-es4i4n
-esis4te
-esi4u
-e5skin
-es4mi
-e2sol
-es3olu
-e2son
-es5ona
-e1sp
-es3per
-es5pira
-es4pre
-2ess
-es4si4b
-estan4
-es3tig
-es5tim
-4es2to
-e3ston
-2estr
-e5stro
-estruc5
-e2sur
-es5urr
-es4w
-eta4b
-eten4d
-e3teo
-ethod3
-et1ic
-e5tide
-etin4
-eti4no
-e5tir
-e5titio
-et5itiv
-4etn
-et5ona
-e3tra
-e3tre
-et3ric
-et5rif
-et3rog
-et5ros
-et3ua
-et5ym
-et5z
-4eu
-e5un
-e3up
-eu3ro
-eus4
-eute4
-euti5l
-eu5tr
-eva2p5
-e2vas
-ev5ast
-e5vea
-ev3ell
-evel3o
-e5veng
-even4i
-ev1er
-e5verb
-e1vi
-ev3id
-evi4l
-e4vin
-evi4v
-e5voc
-e5vu
-e1wa
-e4wag
-e5wee
-e3wh
-ewil5
-ew3ing
-e3wit
-1exp
-5eyc
-5eye.
-eys4
-1fa
-fa3bl
-fab3r
-fa4ce
-4fag
-fain4
-fall5e
-4fa4ma
-fam5is
-5far
-far5th
-fa3ta
-fa3the
-4fato
-fault5
-4f5b
-4fd
-4fe.
-feas4
-feath3
-fe4b
-4feca
-5fect
-2fed
-fe3li
-fe4mo
-fen2d
-fend5e
-fer1
-5ferr
-fev4
-4f1f
-f4fes
-f4fie
-f5fin.
-f2f5is
-f4fly
-f2fy
-4fh
-1fi
-fi3a
-2f3ic.
-4f3ical
-f3ican
-4ficate
-f3icen
-fi3cer
-fic4i
-5ficia
-5ficie
-4fics
-fi3cu
-fi5del
-fight5
-fil5i
-fill5in
-4fily
-2fin
-5fina
-fin2d5
-fi2ne
-f1in3g
-fin4n
-fis4ti
-f4l2
-f5less
-flin4
-flo3re
-f2ly5
-4fm
-4fn
-1fo
-5fon
-fon4de
-fon4t
-fo2r
-fo5rat
-for5ay
-fore5t
-for4i
-fort5a
-fos5
-4f5p
-fra4t
-f5rea
-fres5c
-fri2
-fril4
-frol5
-2f3s
-2ft
-f4to
-f2ty
-3fu
-fu5el
-4fug
-fu4min
-fu5ne
-fu3ri
-fusi4
-fus4s
-4futa
-1fy
-1ga
-gaf4
-5gal.
-3gali
-ga3lo
-2gam
-ga5met
-g5amo
-gan5is
-ga3niz
-gani5za
-4gano
-gar5n4
-gass4
-gath3
-4gativ
-4gaz
-g3b
-gd4
-2ge.
-2ged
-geez4
-gel4in
-ge5lis
-ge5liz
-4gely
-1gen
-ge4nat
-ge5niz
-4geno
-4geny
-1geo
-ge3om
-g4ery
-5gesi
-geth5
-4geto
-ge4ty
-ge4v
-4g1g2
-g2ge
-g3ger
-gglu5
-ggo4
-gh3in
-gh5out
-gh4to
-5gi.
-1gi4a
-gia5r
-g1ic
-5gicia
-g4ico
-gien5
-5gies.
-gil4
-g3imen
-3g4in.
-gin5ge
-5g4ins
-5gio
-3gir
-gir4l
-g3isl
-gi4u
-5giv
-3giz
-gl2
-gla4
-glad5i
-5glas
-1gle
-gli4b
-g3lig
-3glo
-glo3r
-g1m
-g4my
-gn4a
-g4na.
-gnet4t
-g1ni
-g2nin
-g4nio
-g1no
-g4non
-1go
-3go.
-gob5
-5goe
-3g4o4g
-go3is
-gon2
-4g3o3na
-gondo5
-go3ni
-5goo
-go5riz
-gor5ou
-5gos.
-gov1
-g3p
-1gr
-4grada
-g4rai
-gran2
-5graph.
-g5rapher
-5graphic
-4graphy
-4gray
-gre4n
-4gress.
-4grit
-g4ro
-gruf4
-gs2
-g5ste
-gth3
-gu4a
-3guard
-2gue
-5gui5t
-3gun
-3gus
-4gu4t
-g3w
-1gy
-2g5y3n
-gy5ra
-h3ab4l
-hach4
-hae4m
-hae4t
-h5agu
-ha3la
-hala3m
-ha4m
-han4ci
-han4cy
-5hand.
-han4g
-hang5er
-hang5o
-h5a5niz
-han4k
-han4te
-hap3l
-hap5t
-ha3ran
-ha5ras
-har2d
-hard3e
-har4le
-harp5en
-har5ter
-has5s
-haun4
-5haz
-haz3a
-h1b
-1head
-3hear
-he4can
-h5ecat
-h4ed
-he5do5
-he3l4i
-hel4lis
-hel4ly
-h5elo
-hem4p
-he2n
-hena4
-hen5at
-heo5r
-hep5
-h4era
-hera3p
-her4ba
-here5a
-h3ern
-h5erou
-h3ery
-h1es
-he2s5p
-he4t
-het4ed
-heu4
-h1f
-h1h
-hi5an
-hi4co
-high5
-h4il2
-himer4
-h4ina
-hion4e
-hi4p
-hir4l
-hi3ro
-hir4p
-hir4r
-his3el
-his4s
-hith5er
-hi2v
-4hk
-4h1l4
-hlan4
-h2lo
-hlo3ri
-4h1m
-hmet4
-2h1n
-h5odiz
-h5ods
-ho4g
-hoge4
-hol5ar
-3hol4e
-ho4ma
-home3
-hon4a
-ho5ny
-3hood
-hoon4
-hor5at
-ho5ris
-hort3e
-ho5ru
-hos4e
-ho5sen
-hos1p
-1hous
-house3
-hov5el
-4h5p
-4hr4
-hree5
-hro5niz
-hro3po
-4h1s2
-h4sh
-h4tar
-ht1en
-ht5es
-h4ty
-hu4g
-hu4min
-hun5ke
-hun4t
-hus3t4
-hu4t
-h1w
-h4wart
-hy3pe
-hy3ph
-hy2s
-2i1a
-i2al
-iam4
-iam5ete
-i2an
-4ianc
-ian3i
-4ian4t
-ia5pe
-iass4
-i4ativ
-ia4tric
-i4atu
-ibe4
-ib3era
-ib5ert
-ib5ia
-ib3in
-ib5it.
-ib5ite
-i1bl
-ib3li
-i5bo
-i1br
-i2b5ri
-i5bun
-4icam
-5icap
-4icar
-i4car.
-i4cara
-icas5
-i4cay
-iccu4
-4iceo
-4ich
-2ici
-i5cid
-ic5ina
-i2cip
-ic3ipa
-i4cly
-i2c5oc
-4i1cr
-5icra
-i4cry
-ic4te
-ictu2
-ic4t3ua
-ic3ula
-ic4um
-ic5uo
-i3cur
-2id
-i4dai
-id5anc
-id5d
-ide3al
-ide4s
-i2di
-id5ian
-idi4ar
-i5die
-id3io
-idi5ou
-id1it
-id5iu
-i3dle
-i4dom
-id3ow
-i4dr
-i2du
-id5uo
-2ie4
-ied4e
-5ie5ga
-ield3
-ien5a4
-ien4e
-i5enn
-i3enti
-i1er.
-i3esc
-i1est
-i3et
-4if.
-if5ero
-iff5en
-if4fr
-4ific.
-i3fie
-i3fl
-4ift
-2ig
-iga5b
-ig3era
-ight3i
-4igi
-i3gib
-ig3il
-ig3in
-ig3it
-i4g4l
-i2go
-ig3or
-ig5ot
-i5gre
-igu5i
-ig1ur
-i3h
-4i5i4
-i3j
-4ik
-i1la
-il3a4b
-i4lade
-i2l5am
-ila5ra
-i3leg
-il1er
-ilev4
-il5f
-il1i
-il3ia
-il2ib
-il3io
-il4ist
-2ilit
-il2iz
-ill5ab
-4iln
-il3oq
-il4ty
-il5ur
-il3v
-i4mag
-im3age
-ima5ry
-imenta5r
-4imet
-im1i
-im5ida
-imi5le
-i5mini
-4imit
-im4ni
-i3mon
-i2mu
-im3ula
-2in.
-i4n3au
-4inav
-incel4
-in3cer
-4ind
-in5dling
-2ine
-i3nee
-iner4ar
-i5ness
-4inga
-4inge
-in5gen
-4ingi
-in5gling
-4ingo
-4ingu
-2ini
-i5ni.
-i4nia
-in3io
-in1is
-i5nite.
-5initio
-in3ity
-4ink
-4inl
-2inn
-2i1no
-i4no4c
-ino4s
-i4not
-2ins
-in3se
-insur5a
-2int.
-2in4th
-in1u
-i5nus
-4iny
-2io
-4io.
-ioge4
-io2gr
-i1ol
-io4m
-ion3at
-ion4ery
-ion3i
-io5ph
-ior3i
-i4os
-io5th
-i5oti
-io4to
-i4our
-2ip
-ipe4
-iphras4
-ip3i
-ip4ic
-ip4re4
-ip3ul
-i3qua
-iq5uef
-iq3uid
-iq3ui3t
-4ir
-i1ra
-ira4b
-i4rac
-ird5e
-ire4de
-i4ref
-i4rel4
-i4res
-ir5gi
-ir1i
-iri5de
-ir4is
-iri3tu
-5i5r2iz
-ir4min
-iro4g
-5iron.
-ir5ul
-2is.
-is5ag
-is3ar
-isas5
-2is1c
-is3ch
-4ise
-is3er
-3isf
-is5han
-is3hon
-ish5op
-is3ib
-isi4d
-i5sis
-is5itiv
-4is4k
-islan4
-4isms
-i2so
-iso5mer
-is1p
-is2pi
-is4py
-4is1s
-is4sal
-issen4
-is4ses
-is4ta.
-is1te
-is1ti
-ist4ly
-4istral
-i2su
-is5us
-4ita.
-ita4bi
-i4tag
-4ita5m
-i3tan
-i3tat
-2ite
-it3era
-i5teri
-it4es
-2ith
-i1ti
-4itia
-4i2tic
-it3ica
-5i5tick
-it3ig
-it5ill
-i2tim
-2itio
-4itis
-i4tism
-i2t5o5m
-4iton
-i4tram
-it5ry
-4itt
-it3uat
-i5tud
-it3ul
-4itz.
-i1u
-2iv
-iv3ell
-iv3en.
-i4v3er.
-i4vers.
-iv5il.
-iv5io
-iv1it
-i5vore
-iv3o3ro
-i4v3ot
-4i5w
-ix4o
-4iy
-4izar
-izi4
-5izont
-5ja
-jac4q
-ja4p
-1je
-jer5s
-4jestie
-4jesty
-jew3
-jo4p
-5judg
-3ka.
-k3ab
-k5ag
-kais4
-kal4
-k1b
-k2ed
-1kee
-ke4g
-ke5li
-k3en4d
-k1er
-kes4
-k3est.
-ke4ty
-k3f
-kh4
-k1i
-5ki.
-5k2ic
-k4ill
-kilo5
-k4im
-k4in.
-kin4de
-k5iness
-kin4g
-ki4p
-kis4
-k5ish
-kk4
-k1l
-4kley
-4kly
-k1m
-k5nes
-1k2no
-ko5r
-kosh4
-k3ou
-kro5n
-4k1s2
-k4sc
-ks4l
-k4sy
-k5t
-k1w
-lab3ic
-l4abo
-laci4
-l4ade
-la3dy
-lag4n
-lam3o
-3land
-lan4dl
-lan5et
-lan4te
-lar4g
-lar3i
-las4e
-la5tan
-4lateli
-4lativ
-4lav
-la4v4a
-2l1b
-lbin4
-4l1c2
-lce4
-l3ci
-2ld
-l2de
-ld4ere
-ld4eri
-ldi4
-ld5is
-l3dr
-l4dri
-le2a
-le4bi
-left5
-5leg.
-5legg
-le4mat
-lem5atic
-4len.
-3lenc
-5lene.
-1lent
-le3ph
-le4pr
-lera5b
-ler4e
-3lerg
-3l4eri
-l4ero
-les2
-le5sco
-5lesq
-3less
-5less.
-l3eva
-lev4er.
-lev4era
-lev4ers
-3ley
-4leye
-2lf
-l5fr
-4l1g4
-l5ga
-lgar3
-l4ges
-lgo3
-2l3h
-li4ag
-li2am
-liar5iz
-li4as
-li4ato
-li5bi
-5licio
-li4cor
-4lics
-4lict.
-l4icu
-l3icy
-l3ida
-lid5er
-3lidi
-lif3er
-l4iff
-li4fl
-5ligate
-3ligh
-li4gra
-3lik
-4l4i4l
-lim4bl
-lim3i
-li4mo
-l4im4p
-l4ina
-1l4ine
-lin3ea
-lin3i
-link5er
-li5og
-4l4iq
-lis4p
-l1it
-l2it.
-5litica
-l5i5tics
-liv3er
-l1iz
-4lj
-lka3
-l3kal
-lka4t
-l1l
-l4law
-l2le
-l5lea
-l3lec
-l3leg
-l3lel
-l3le4n
-l3le4t
-ll2i
-l2lin4
-l5lina
-ll4o
-lloqui5
-ll5out
-l5low
-2lm
-l5met
-lm3ing
-l4mod
-lmon4
-2l1n2
-3lo.
-lob5al
-lo4ci
-4lof
-3logic
-l5ogo
-3logu
-lom3er
-5long
-lon4i
-l3o3niz
-lood5
-5lope.
-lop3i
-l3opm
-lora4
-lo4rato
-lo5rie
-lor5ou
-5los.
-los5et
-5losophiz
-5losophy
-los4t
-lo4ta
-loun5d
-2lout
-4lov
-2lp
-lpa5b
-l3pha
-l5phi
-lp5ing
-l3pit
-l4pl
-l5pr
-4l1r
-2l1s2
-l4sc
-l2se
-l4sie
-4lt
-lt5ag
-ltane5
-l1te
-lten4
-ltera4
-lth3i
-l5ties.
-ltis4
-l1tr
-ltu2
-ltur3a
-lu5a
-lu3br
-luch4
-lu3ci
-lu3en
-luf4
-lu5id
-lu4ma
-5lumi
-l5umn.
-5lumnia
-lu3o
-luo3r
-4lup
-luss4
-lus3te
-1lut
-l5ven
-l5vet4
-2l1w
-1ly
-4lya
-4lyb
-ly5me
-ly3no
-2lys4
-l5yse
-1ma
-2mab
-ma2ca
-ma5chine
-ma4cl
-mag5in
-5magn
-2mah
-maid5
-4mald
-ma3lig
-ma5lin
-mal4li
-mal4ty
-5mania
-man5is
-man3iz
-4map
-ma5rine.
-ma5riz
-mar4ly
-mar3v
-ma5sce
-mas4e
-mas1t
-5mate
-math3
-ma3tis
-4matiza
-4m1b
-mba4t5
-m5bil
-m4b3ing
-mbi4v
-4m5c
-4me.
-2med
-4med.
-5media
-me3die
-m5e5dy
-me2g
-mel5on
-mel4t
-me2m
-mem1o3
-1men
-men4a
-men5ac
-men4de
-4mene
-men4i
-mens4
-mensu5
-3ment
-men4te
-me5on
-m5ersa
-2mes
-3mesti
-me4ta
-met3al
-me1te
-me5thi
-m4etr
-5metric
-me5trie
-me3try
-me4v
-4m1f
-2mh
-5mi.
-mi3a
-mid4a
-mid4g
-mig4
-3milia
-m5i5lie
-m4ill
-min4a
-3mind
-m5inee
-m4ingl
-min5gli
-m5ingly
-min4t
-m4inu
-miot4
-m2is
-mis4er.
-mis5l
-mis4ti
-m5istry
-4mith
-m2iz
-4mk
-4m1l
-m1m
-mma5ry
-4m1n
-mn4a
-m4nin
-mn4o
-1mo
-4mocr
-5mocratiz
-mo2d1
-mo4go
-mois2
-moi5se
-4mok
-mo5lest
-mo3me
-mon5et
-mon5ge
-moni3a
-mon4ism
-mon4ist
-mo3niz
-monol4
-mo3ny.
-mo2r
-4mora.
-mos2
-mo5sey
-mo3sp
-moth3
-m5ouf
-3mous
-mo2v
-4m1p
-mpara5
-mpa5rab
-mpar5i
-m3pet
-mphas4
-m2pi
-mpi4a
-mp5ies
-m4p1in
-m5pir
-mp5is
-mpo3ri
-mpos5ite
-m4pous
-mpov5
-mp4tr
-m2py
-4m3r
-4m1s2
-m4sh
-m5si
-4mt
-1mu
-mula5r4
-5mult
-multi3
-3mum
-mun2
-4mup
-mu4u
-4mw
-1na
-2n1a2b
-n4abu
-4nac.
-na4ca
-n5act
-nag5er.
-nak4
-na4li
-na5lia
-4nalt
-na5mit
-n2an
-nanci4
-nan4it
-nank4
-nar3c
-4nare
-nar3i
-nar4l
-n5arm
-n4as
-nas4c
-nas5ti
-n2at
-na3tal
-nato5miz
-n2au
-nau3se
-3naut
-nav4e
-4n1b4
-ncar5
-n4ces.
-n3cha
-n5cheo
-n5chil
-n3chis
-nc1in
-nc4it
-ncour5a
-n1cr
-n1cu
-n4dai
-n5dan
-n1de
-nd5est.
-ndi4b
-n5d2if
-n1dit
-n3diz
-n5duc
-ndu4r
-nd2we
-2ne.
-n3ear
-ne2b
-neb3u
-ne2c
-5neck
-2ned
-ne4gat
-neg5ativ
-5nege
-ne4la
-nel5iz
-ne5mi
-ne4mo
-1nen
-4nene
-3neo
-ne4po
-ne2q
-n1er
-nera5b
-n4erar
-n2ere
-n4er5i
-ner4r
-1nes
-2nes.
-4nesp
-2nest
-4nesw
-3netic
-ne4v
-n5eve
-ne4w
-n3f
-n4gab
-n3gel
-nge4n4e
-n5gere
-n3geri
-ng5ha
-n3gib
-ng1in
-n5git
-n4gla
-ngov4
-ng5sh
-n1gu
-n4gum
-n2gy
-4n1h4
-nha4
-nhab3
-nhe4
-3n4ia
-ni3an
-ni4ap
-ni3ba
-ni4bl
-ni4d
-ni5di
-ni4er
-ni2fi
-ni5ficat
-n5igr
-nik4
-n1im
-ni3miz
-n1in
-5nine.
-nin4g
-ni4o
-5nis.
-nis4ta
-n2it
-n4ith
-3nitio
-n3itor
-ni3tr
-n1j
-4nk2
-n5kero
-n3ket
-nk3in
-n1kl
-4n1l
-n5m
-nme4
-nmet4
-4n1n2
-nne4
-nni3al
-nni4v
-nob4l
-no3ble
-n5ocl
-4n3o2d
-3noe
-4nog
-noge4
-nois5i
-no5l4i
-5nologis
-3nomic
-n5o5miz
-no4mo
-no3my
-no4n
-non4ag
-non5i
-n5oniz
-4nop
-5nop5o5li
-nor5ab
-no4rary
-4nosc
-nos4e
-nos5t
-no5ta
-1nou
-3noun
-nov3el3
-nowl3
-n1p4
-npi4
-npre4c
-n1q
-n1r
-nru4
-2n1s2
-ns5ab
-nsati4
-ns4c
-n2se
-n4s3es
-nsid1
-nsig4
-n2sl
-ns3m
-n4soc
-ns4pe
-n5spi
-nsta5bl
-n1t
-nta4b
-nter3s
-nt2i
-n5tib
-nti4er
-nti2f
-n3tine
-n4t3ing
-nti4p
-ntrol5li
-nt4s
-ntu3me
-nu1a
-nu4d
-nu5en
-nuf4fe
-n3uin
-3nu3it
-n4um
-nu1me
-n5umi
-3nu4n
-n3uo
-nu3tr
-n1v2
-n1w4
-nym4
-nyp4
-4nz
-n3za
-4oa
-oad3
-o5a5les
-oard3
-oas4e
-oast5e
-oat5i
-ob3a3b
-o5bar
-obe4l
-o1bi
-o2bin
-ob5ing
-o3br
-ob3ul
-o1ce
-och4
-o3chet
-ocif3
-o4cil
-o4clam
-o4cod
-oc3rac
-oc5ratiz
-ocre3
-5ocrit
-octor5a
-oc3ula
-o5cure
-od5ded
-od3ic
-odi3o
-o2do4
-odor3
-od5uct.
-od5ucts
-o4el
-o5eng
-o3er
-oe4ta
-o3ev
-o2fi
-of5ite
-ofit4t
-o2g5a5r
-og5ativ
-o4gato
-o1ge
-o5gene
-o5geo
-o4ger
-o3gie
-1o1gis
-og3it
-o4gl
-o5g2ly
-3ogniz
-o4gro
-ogu5i
-1ogy
-2ogyn
-o1h2
-ohab5
-oi2
-oic3es
-oi3der
-oiff4
-oig4
-oi5let
-o3ing
-oint5er
-o5ism
-oi5son
-oist5en
-oi3ter
-o5j
-2ok
-o3ken
-ok5ie
-o1la
-o4lan
-olass4
-ol2d
-old1e
-ol3er
-o3lesc
-o3let
-ol4fi
-ol2i
-o3lia
-o3lice
-ol5id.
-o3li4f
-o5lil
-ol3ing
-o5lio
-o5lis.
-ol3ish
-o5lite
-o5litio
-o5liv
-olli4e
-ol5ogiz
-olo4r
-ol5pl
-ol2t
-ol3ub
-ol3ume
-ol3un
-o5lus
-ol2v
-o2ly
-om5ah
-oma5l
-om5atiz
-om2be
-om4bl
-o2me
-om3ena
-om5erse
-o4met
-om5etry
-o3mia
-om3ic.
-om3ica
-o5mid
-om1in
-o5mini
-5ommend
-omo4ge
-o4mon
-om3pi
-ompro5
-o2n
-on1a
-on4ac
-o3nan
-on1c
-3oncil
-2ond
-on5do
-o3nen
-on5est
-on4gu
-on1ic
-o3nio
-on1is
-o5niu
-on3key
-on4odi
-on3omy
-on3s
-onspi4
-onspir5a
-onsu4
-onten4
-on3t4i
-ontif5
-on5um
-onva5
-oo2
-ood5e
-ood5i
-oo4k
-oop3i
-o3ord
-oost5
-o2pa
-ope5d
-op1er
-3opera
-4operag
-2oph
-o5phan
-o5pher
-op3ing
-o3pit
-o5pon
-o4posi
-o1pr
-op1u
-opy5
-o1q
-o1ra
-o5ra.
-o4r3ag
-or5aliz
-or5ange
-ore5a
-o5real
-or3ei
-ore5sh
-or5est.
-orew4
-or4gu
-4o5ria
-or3ica
-o5ril
-or1in
-o1rio
-or3ity
-o3riu
-or2mi
-orn2e
-o5rof
-or3oug
-or5pe
-3orrh
-or4se
-ors5en
-orst4
-or3thi
-or3thy
-or4ty
-o5rum
-o1ry
-os3al
-os2c
-os4ce
-o3scop
-4oscopi
-o5scr
-os4i4e
-os5itiv
-os3ito
-os3ity
-osi4u
-os4l
-o2so
-os4pa
-os4po
-os2ta
-o5stati
-os5til
-os5tit
-o4tan
-otele4g
-ot3er.
-ot5ers
-o4tes
-4oth
-oth5esi
-oth3i4
-ot3ic.
-ot5ica
-o3tice
-o3tif
-o3tis
-oto5s
-ou2
-ou3bl
-ouch5i
-ou5et
-ou4l
-ounc5er
-oun2d
-ou5v
-ov4en
-over4ne
-over3s
-ov4ert
-o3vis
-oviti4
-o5v4ol
-ow3der
-ow3el
-ow5est
-ow1i
-own5i
-o4wo
-oy1a
-1pa
-pa4ca
-pa4ce
-pac4t
-p4ad
-5pagan
-p3agat
-p4ai
-pain4
-p4al
-pan4a
-pan3el
-pan4ty
-pa3ny
-pa1p
-pa4pu
-para5bl
-par5age
-par5di
-3pare
-par5el
-p4a4ri
-par4is
-pa2te
-pa5ter
-5pathic
-pa5thy
-pa4tric
-pav4
-3pay
-4p1b
-pd4
-4pe.
-3pe4a
-pear4l
-pe2c
-2p2ed
-3pede
-3pedi
-pedia4
-ped4ic
-p4ee
-pee4d
-pek4
-pe4la
-peli4e
-pe4nan
-p4enc
-pen4th
-pe5on
-p4era.
-pera5bl
-p4erag
-p4eri
-peri5st
-per4mal
-perme5
-p4ern
-per3o
-per3ti
-pe5ru
-per1v
-pe2t
-pe5ten
-pe5tiz
-4pf
-4pg
-4ph.
-phar5i
-phe3no
-ph4er
-ph4es.
-ph1ic
-5phie
-ph5ing
-5phisti
-3phiz
-ph2l
-3phob
-3phone
-5phoni
-pho4r
-4phs
-ph3t
-5phu
-1phy
-pi3a
-pian4
-pi4cie
-pi4cy
-p4id
-p5ida
-pi3de
-5pidi
-3piec
-pi3en
-pi4grap
-pi3lo
-pi2n
-p4in.
-pind4
-p4ino
-3pi1o
-pion4
-p3ith
-pi5tha
-pi2tu
-2p3k2
-1p2l2
-3plan
-plas5t
-pli3a
-pli5er
-4plig
-pli4n
-ploi4
-plu4m
-plum4b
-4p1m
-2p3n
-po4c
-5pod.
-po5em
-po3et5
-5po4g
-poin2
-5point
-poly5t
-po4ni
-po4p
-1p4or
-po4ry
-1pos
-pos1s
-p4ot
-po4ta
-5poun
-4p1p
-ppa5ra
-p2pe
-p4ped
-p5pel
-p3pen
-p3per
-p3pet
-ppo5site
-pr2
-pray4e
-5preci
-pre5co
-pre3em
-pref5ac
-pre4la
-pre3r
-p3rese
-3press
-pre5ten
-pre3v
-5pri4e
-prin4t3
-pri4s
-pris3o
-p3roca
-prof5it
-pro3l
-pros3e
-pro1t
-2p1s2
-p2se
-ps4h
-p4sib
-2p1t
-pt5a4b
-p2te
-p2th
-pti3m
-ptu4r
-p4tw
-pub3
-pue4
-puf4
-pul3c
-pu4m
-pu2n
-pur4r
-5pus
-pu2t
-5pute
-put3er
-pu3tr
-put4ted
-put4tin
-p3w
-qu2
-qua5v
-2que.
-3quer
-3quet
-2rab
-ra3bi
-rach4e
-r5acl
-raf5fi
-raf4t
-r2ai
-ra4lo
-ram3et
-r2ami
-rane5o
-ran4ge
-r4ani
-ra5no
-rap3er
-3raphy
-rar5c
-rare4
-rar5ef
-4raril
-r2as
-ration4
-rau4t
-ra5vai
-rav3el
-ra5zie
-r1b
-r4bab
-r4bag
-rbi2
-rbi4f
-r2bin
-r5bine
-rb5ing.
-rb4o
-r1c
-r2ce
-rcen4
-r3cha
-rch4er
-r4ci4b
-rc4it
-rcum3
-r4dal
-rd2i
-rdi4a
-rdi4er
-rdin4
-rd3ing
-2re.
-re1al
-re3an
-re5arr
-5reav
-re4aw
-r5ebrat
-rec5oll
-rec5ompe
-re4cre
-2r2ed
-re1de
-re3dis
-red5it
-re4fac
-re2fe
-re5fer.
-re3fi
-re4fy
-reg3is
-re5it
-re1li
-re5lu
-r4en4ta
-ren4te
-re1o
-re5pin
-re4posi
-re1pu
-r1er4
-r4eri
-rero4
-re5ru
-r4es.
-re4spi
-ress5ib
-res2t
-re5stal
-re3str
-re4ter
-re4ti4z
-re3tri
-reu2
-re5uti
-rev2
-re4val
-rev3el
-r5ev5er.
-re5vers
-re5vert
-re5vil
-rev5olu
-re4wh
-r1f
-rfu4
-r4fy
-rg2
-rg3er
-r3get
-r3gic
-rgi4n
-rg3ing
-r5gis
-r5git
-r1gl
-rgo4n
-r3gu
-rh4
-4rh.
-4rhal
-ri3a
-ria4b
-ri4ag
-r4ib
-rib3a
-ric5as
-r4ice
-4rici
-5ricid
-ri4cie
-r4ico
-rid5er
-ri3enc
-ri3ent
-ri1er
-ri5et
-rig5an
-5rigi
-ril3iz
-5riman
-rim5i
-3rimo
-rim4pe
-r2ina
-5rina.
-rin4d
-rin4e
-rin4g
-ri1o
-5riph
-riph5e
-ri2pl
-rip5lic
-r4iq
-r2is
-r4is.
-ris4c
-r3ish
-ris4p
-ri3ta3b
-r5ited.
-rit5er.
-rit5ers
-rit3ic
-ri2tu
-rit5ur
-riv5el
-riv3et
-riv3i
-r3j
-r3ket
-rk4le
-rk4lin
-r1l
-rle4
-r2led
-r4lig
-r4lis
-rl5ish
-r3lo4
-r1m
-rma5c
-r2me
-r3men
-rm5ers
-rm3ing
-r4ming.
-r4mio
-r3mit
-r4my
-r4nar
-r3nel
-r4ner
-r5net
-r3ney
-r5nic
-r1nis4
-r3nit
-r3niv
-rno4
-r4nou
-r3nu
-rob3l
-r2oc
-ro3cr
-ro4e
-ro1fe
-ro5fil
-rok2
-ro5ker
-5role.
-rom5ete
-rom4i
-rom4p
-ron4al
-ron4e
-ro5n4is
-ron4ta
-1room
-5root
-ro3pel
-rop3ic
-ror3i
-ro5ro
-ros5per
-ros4s
-ro4the
-ro4ty
-ro4va
-rov5el
-rox5
-r1p
-r4pea
-r5pent
-rp5er.
-r3pet
-rp4h4
-rp3ing
-r3po
-r1r4
-rre4c
-rre4f
-r4reo
-rre4st
-rri4o
-rri4v
-rron4
-rros4
-rrys4
-4rs2
-r1sa
-rsa5ti
-rs4c
-r2se
-r3sec
-rse4cr
-rs5er.
-rs3es
-rse5v2
-r1sh
-r5sha
-r1si
-r4si4b
-rson3
-r1sp
-r5sw
-rtach4
-r4tag
-r3teb
-rten4d
-rte5o
-r1ti
-rt5ib
-rti4d
-r4tier
-r3tig
-rtil3i
-rtil4l
-r4tily
-r4tist
-r4tiv
-r3tri
-rtroph4
-rt4sh
-ru3a
-ru3e4l
-ru3en
-ru4gl
-ru3in
-rum3pl
-ru2n
-runk5
-run4ty
-r5usc
-ruti5n
-rv4e
-rvel4i
-r3ven
-rv5er.
-r5vest
-r3vey
-r3vic
-rvi4v
-r3vo
-r1w
-ry4c
-5rynge
-ry3t
-sa2
-2s1ab
-5sack
-sac3ri
-s3act
-5sai
-salar4
-sal4m
-sa5lo
-sal4t
-3sanc
-san4de
-s1ap
-sa5ta
-5sa3tio
-sat3u
-sau4
-sa5vor
-5saw
-4s5b
-scan4t5
-sca4p
-scav5
-s4ced
-4scei
-s4ces
-sch2
-s4cho
-3s4cie
-5scin4d
-scle5
-s4cli
-scof4
-4scopy
-scour5a
-s1cu
-4s5d
-4se.
-se4a
-seas4
-sea5w
-se2c3o
-3sect
-4s4ed
-se4d4e
-s5edl
-se2g
-seg3r
-5sei
-se1le
-5self
-5selv
-4seme
-se4mol
-sen5at
-4senc
-sen4d
-s5ened
-sen5g
-s5enin
-4sentd
-4sentl
-sep3a3
-4s1er.
-s4erl
-ser4o
-4servo
-s1e4s
-se5sh
-ses5t
-5se5um
-5sev
-sev3en
-sew4i
-5sex
-4s3f
-2s3g
-s2h
-2sh.
-sh1er
-5shev
-sh1in
-sh3io
-3ship
-shiv5
-sho4
-sh5old
-shon3
-shor4
-short5
-4shw
-si1b
-s5icc
-3side.
-5sides
-5sidi
-si5diz
-4signa
-sil4e
-4sily
-2s1in
-s2ina
-5sine.
-s3ing
-1sio
-5sion
-sion5a
-si2r
-sir5a
-1sis
-3sitio
-5siu
-1siv
-5siz
-sk2
-4ske
-s3ket
-sk5ine
-sk5ing
-s1l2
-s3lat
-s2le
-slith5
-2s1m
-s3ma
-small3
-sman3
-smel4
-s5men
-5smith
-smol5d4
-s1n4
-1so
-so4ce
-soft3
-so4lab
-sol3d2
-so3lic
-5solv
-3som
-3s4on.
-sona4
-son4g
-s4op
-5sophic
-s5ophiz
-s5ophy
-sor5c
-sor5d
-4sov
-so5vi
-2spa
-5spai
-spa4n
-spen4d
-2s5peo
-2sper
-s2phe
-3spher
-spho5
-spil4
-sp5ing
-4spio
-s4ply
-s4pon
-spor4
-4spot
-squal4l
-s1r
-2ss
-s1sa
-ssas3
-s2s5c
-s3sel
-s5seng
-s4ses.
-s5set
-s1si
-s4sie
-ssi4er
-ss5ily
-s4sl
-ss4li
-s4sn
-sspend4
-ss2t
-ssur5a
-ss5w
-2st.
-s2tag
-s2tal
-stam4i
-5stand
-s4ta4p
-5stat.
-s4ted
-stern5i
-s5tero
-ste2w
-stew5a
-s3the
-st2i
-s4ti.
-s5tia
-s1tic
-5stick
-s4tie
-s3tif
-st3ing
-5stir
-s1tle
-5stock
-stom3a
-5stone
-s4top
-3store
-st4r
-s4trad
-5stratu
-s4tray
-s4trid
-4stry
-4st3w
-s2ty
-1su
-su1al
-su4b3
-su2g3
-su5is
-suit3
-s4ul
-su2m
-sum3i
-su2n
-su2r
-4sv
-sw2
-4swo
-s4y
-4syc
-3syl
-syn5o
-sy5rin
-1ta
-3ta.
-2tab
-ta5bles
-5taboliz
-4taci
-ta5do
-4taf4
-tai5lo
-ta2l
-ta5la
-tal5en
-tal3i
-4talk
-tal4lis
-ta5log
-ta5mo
-tan4de
-tanta3
-ta5per
-ta5pl
-tar4a
-4tarc
-4tare
-ta3riz
-tas4e
-ta5sy
-4tatic
-ta4tur
-taun4
-tav4
-2taw
-tax4is
-2t1b
-4tc
-t4ch
-tch5et
-4t1d
-4te.
-tead4i
-4teat
-tece4
-5tect
-2t1ed
-te5di
-1tee
-teg4
-te5ger
-te5gi
-3tel.
-teli4
-5tels
-te2ma2
-tem3at
-3tenan
-3tenc
-3tend
-4tenes
-1tent
-ten4tag
-1teo
-te4p
-te5pe
-ter3c
-5ter3d
-1teri
-ter5ies
-ter3is
-teri5za
-5ternit
-ter5v
-4tes.
-4tess
-t3ess.
-teth5e
-3teu
-3tex
-4tey
-2t1f
-4t1g
-2th.
-than4
-th2e
-4thea
-th3eas
-the5at
-the3is
-3thet
-th5ic.
-th5ica
-4thil
-5think
-4thl
-th5ode
-5thodic
-4thoo
-thor5it
-tho5riz
-2ths
-1tia
-ti4ab
-ti4ato
-2ti2b
-4tick
-t4ico
-t4ic1u
-5tidi
-3tien
-tif2
-ti5fy
-2tig
-5tigu
-till5in
-1tim
-4timp
-tim5ul
-2t1in
-t2ina
-3tine.
-3tini
-1tio
-ti5oc
-tion5ee
-5tiq
-ti3sa
-3tise
-tis4m
-ti5so
-tis4p
-5tistica
-ti3tl
-ti4u
-1tiv
-tiv4a
-1tiz
-ti3za
-ti3zen
-2tl
-t5la
-tlan4
-3tle.
-3tled
-3tles.
-t5let.
-t5lo
-4t1m
-tme4
-2t1n2
-1to
-to3b
-to5crat
-4todo
-2tof
-to2gr
-to5ic
-to2ma
-tom4b
-to3my
-ton4ali
-to3nat
-4tono
-4tony
-to2ra
-to3rie
-tor5iz
-tos2
-5tour
-4tout
-to3war
-4t1p
-1tra
-tra3b
-tra5ch
-traci4
-trac4it
-trac4te
-tras4
-tra5ven
-trav5es5
-tre5f
-tre4m
-trem5i
-5tria
-tri5ces
-5tricia
-4trics
-2trim
-tri4v
-tro5mi
-tron5i
-4trony
-tro5phe
-tro3sp
-tro3v
-tru5i
-trus4
-4t1s2
-t4sc
-tsh4
-t4sw
-4t3t2
-t4tes
-t5to
-ttu4
-1tu
-tu1a
-tu3ar
-tu4bi
-tud2
-4tue
-4tuf4
-5tu3i
-3tum
-tu4nis
-2t3up.
-3ture
-5turi
-tur3is
-tur5o
-tu5ry
-3tus
-4tv
-tw4
-4t1wa
-twis4
-4two
-1ty
-4tya
-2tyl
-type3
-ty5ph
-4tz
-tz4e
-4uab
-uac4
-ua5na
-uan4i
-uar5ant
-uar2d
-uar3i
-uar3t
-u1at
-uav4
-ub4e
-u4bel
-u3ber
-u4bero
-u1b4i
-u4b5ing
-u3ble.
-u3ca
-uci4b
-uc4it
-ucle3
-u3cr
-u3cu
-u4cy
-ud5d
-ud3er
-ud5est
-udev4
-u1dic
-ud3ied
-ud3ies
-ud5is
-u5dit
-u4don
-ud4si
-u4du
-u4ene
-uens4
-uen4te
-uer4il
-3ufa
-u3fl
-ugh3en
-ug5in
-2ui2
-uil5iz
-ui4n
-u1ing
-uir4m
-uita4
-uiv3
-uiv4er.
-u5j
-4uk
-u1la
-ula5b
-u5lati
-ulch4
-5ulche
-ul3der
-ul4e
-u1len
-ul4gi
-ul2i
-u5lia
-ul3ing
-ul5ish
-ul4lar
-ul4li4b
-ul4lis
-4ul3m
-u1l4o
-4uls
-uls5es
-ul1ti
-ultra3
-4ultu
-u3lu
-ul5ul
-ul5v
-um5ab
-um4bi
-um4bly
-u1mi
-u4m3ing
-umor5o
-um2p
-unat4
-u2ne
-un4er
-u1ni
-un4im
-u2nin
-un5ish
-uni3v
-un3s4
-un4sw
-unt3ab
-un4ter.
-un4tes
-unu4
-un5y
-un5z
-u4ors
-u5os
-u1ou
-u1pe
-uper5s
-u5pia
-up3ing
-u3pl
-up3p
-upport5
-upt5ib
-uptu4
-u1ra
-4ura.
-u4rag
-u4ras
-ur4be
-urc4
-ur1d
-ure5at
-ur4fer
-ur4fr
-u3rif
-uri4fic
-ur1in
-u3rio
-u1rit
-ur3iz
-ur2l
-url5ing.
-ur4no
-uros4
-ur4pe
-ur4pi
-urs5er
-ur5tes
-ur3the
-urti4
-ur4tie
-u3ru
-2us
-u5sad
-u5san
-us4ap
-usc2
-us3ci
-use5a
-u5sia
-u3sic
-us4lin
-us1p
-us5sl
-us5tere
-us1tr
-u2su
-usur4
-uta4b
-u3tat
-4ute.
-4utel
-4uten
-uten4i
-4u1t2i
-uti5liz
-u3tine
-ut3ing
-ution5a
-u4tis
-5u5tiz
-u4t1l
-ut5of
-uto5g
-uto5matic
-u5ton
-u4tou
-uts4
-u3u
-uu4m
-u1v2
-uxu3
-uz4e
-1va
-5va.
-2v1a4b
-vac5il
-vac3u
-vag4
-va4ge
-va5lie
-val5o
-val1u
-va5mo
-va5niz
-va5pi
-var5ied
-3vat
-4ve.
-4ved
-veg3
-v3el.
-vel3li
-ve4lo
-v4ely
-ven3om
-v5enue
-v4erd
-5vere.
-v4erel
-v3eren
-ver5enc
-v4eres
-ver3ie
-vermi4n
-3verse
-ver3th
-v4e2s
-4ves.
-ves4te
-ve4te
-vet3er
-ve4ty
-vi5ali
-5vian
-5vide.
-5vided
-4v3iden
-5vides
-5vidi
-v3if
-vi5gn
-vik4
-2vil
-5vilit
-v3i3liz
-v1in
-4vi4na
-v2inc
-vin5d
-4ving
-vio3l
-v3io4r
-vi1ou
-vi4p
-vi5ro
-vis3it
-vi3so
-vi3su
-4viti
-vit3r
-4vity
-3viv
-5vo.
-voi4
-3vok
-vo4la
-v5ole
-5volt
-3volv
-vom5i
-vor5ab
-vori4
-vo4ry
-vo4ta
-4votee
-4vv4
-v4y
-w5abl
-2wac
-wa5ger
-wag5o
-wait5
-w5al.
-wam4
-war4t
-was4t
-wa1te
-wa5ver
-w1b
-wea5rie
-weath3
-wed4n
-weet3
-wee5v
-wel4l
-w1er
-west3
-w3ev
-whi4
-wi2
-wil2
-will5in
-win4de
-win4g
-wir4
-3wise
-with3
-wiz5
-w4k
-wl4es
-wl3in
-w4no
-1wo2
-wom1
-wo5ven
-w5p
-wra4
-wri4
-writa4
-w3sh
-ws4l
-ws4pe
-w5s4t
-4wt
-wy4
-x1a
-xac5e
-x4ago
-xam3
-x4ap
-xas5
-x3c2
-x1e
-xe4cuto
-x2ed
-xer4i
-xe5ro
-x1h
-xhi2
-xhil5
-xhu4
-x3i
-xi5a
-xi5c
-xi5di
-x4ime
-xi5miz
-x3o
-x4ob
-x3p
-xpan4d
-xpecto5
-xpe3d
-x1t2
-x3ti
-x1u
-xu3a
-xx4
-y5ac
-3yar4
-y5at
-y1b
-y1c
-y2ce
-yc5er
-y3ch
-ych4e
-ycom4
-ycot4
-y1d
-y5ee
-y1er
-y4erf
-yes4
-ye4t
-y5gi
-4y3h
-y1i
-y3la
-ylla5bl
-y3lo
-y5lu
-ymbol5
-yme4
-ympa3
-yn3chr
-yn5d
-yn5g
-yn5ic
-5ynx
-y1o4
-yo5d
-y4o5g
-yom4
-yo5net
-y4ons
-y4os
-y4ped
-yper5
-yp3i
-y3po
-y4poc
-yp2ta
-y5pu
-yra5m
-yr5ia
-y3ro
-yr4r
-ys4c
-y3s2e
-ys3ica
-ys3io
-3ysis
-y4so
-yss4
-ys1t
-ys3ta
-ysur4
-y3thin
-yt3ic
-y1w
-za1
-z5a2b
-zar2
-4zb
-2ze
-ze4n
-ze4p
-z1er
-ze3ro
-zet4
-2z1i
-z4il
-z4is
-5zl
-4zm
-1zo
-zo4m
-zo5ol
-zte4
-4z1z2
-z4zy
-Á1Á
-Á1Å
-Á1É
-Á1Ï
-Á1Õ
-Á1Ù
-Á1Ü
-Á1À
-Á1Ñ
-Å1Á
-Å1Å
-Å1É
-Å1Ï
-Å1Õ
-Å1Ù
-Å1Ü
-Å1À
-Å1Ñ
-É1Á
-É1Å
-É1É
-É1Ï
-É1Õ
-É1Ù
-É1Ü
-É1À
-É1Ñ
-Ï1Á
-Ï1Å
-Ï1É
-Ï1Ï
-Ï1Õ
-Ï1Ù
-Ï1Ü
-Ï1À
-Ï1Ñ
-Õ1Á
-Õ1Å
-Õ1É
-Õ1Ï
-Õ1Õ
-Õ1Ù
-Õ1Ü
-Õ1À
-Õ1Ñ
-Ù1Á
-Ù1Å
-Ù1É
-Ù1Ï
-Ù1Õ
-Ù1Ù
-Ù1Ü
-Ù1À
-Ù1Ñ
-Ü1Á
-Ü1Å
-Ü1É
-Ü1Ï
-Ü1Õ
-Ü1Ù
-Ü1Ü
-Ü1À
-Ü1Ñ
-À1Á
-À1Å
-À1É
-À1Ï
-À1Õ
-À1Ù
-À1Ü
-À1À
-À1Ñ
-Ñ1Á
-Ñ1Å
-Ñ1É
-Ñ1Ï
-Ñ1Õ
-Ñ1Ù
-Ñ1Ü
-Ñ1À
-Ñ1Ñ
-.ÂÄ2
-.ÂÌ2
-.ÂÒ2
-.ÂØ2
-.×Â2
-.×ÂÌ2
-.×ÂÒ2
-.××2
-.××Ò2
-.×ÇÌ2
-.×Ä2
-.×Ä×2
-.×ÄÒ2
-.×Ú2
-.×ÚÂ2
-.×Ú×2
-.×ÚÇ2
-.×ÚÇÌ2
-.×ÚÇÒ2
-.×ÚÄ2
-.×ÚÄÒ2
-.×ÚÌ2
-.×ÚÍ2
-.×ÚÒ2
-.×Úß2
-.×Ë2
-.×ËÌ2
-.×ËÒ2
-.×Ì2
-.×Í2
-.×Î2
-.×Ð2
-.×ÐÌ2
-.×ÐÒ2
-.×Ò2
-.×Ó2
-.×ÓË2
-.×ÓËÒ2
-.×ÓÌ2
-.×ÓÍ2
-.×ÓÐ2
-.×ÓÐÌ2
-.×ÓÐÒ2
-.×ÓÔ2
-.×ÓÔÒ2
-.×ÓÈ2
-.×ÓÈÌ2
-.×Ô2
-.×ÔÒ2
-.×È2
-.×Ã2
-.×Þ2
-.×Ø2
-.Ç×2
-.ÇÄ2
-.ÇÌ2
-.ÇÎ2
-.ÇÒ2
-.Ä×2
-.ÄÌ2
-.ÄÎ2
-.ÄÒ2
-.ÄØ2
-.Ö×2
-.ÖÇ2
-.ÖÇÌ2
-.ÖÄ2
-.ÖÖ2
-.ÖÒ2
-.Ú×2
-.ÚÄ2
-.ÚÄÒ2
-.ÚÌ2
-.ÚÍ2
-.ÚÎ2
-.ÚÒ2
-.Ë×2
-.ËÌ2
-.ËÎ2
-.ËÒ2
-.ËÓÔ2
-.ËÔ2
-.ÌÂ2
-.ÌÇ2
-.ÌÖ2
-.ÌØ2
-.ÌØ×2
-.ÍÇÌ2
-.ÍÇÎ2
-.ÍÌ2
-.ÍÎ2
-.ÍÒ2
-.ÍÓÔ2
-.ÍÈ2
-.ÍÞ2
-.ÍÝ2
-.ÎÒ2
-.ÐÌ2
-.ÐÎ2
-.ÐÒ2
-.ÐÓ2
-.ÐÔ2
-.ÐÈ2
-.ÐÞ2
-.ÐÛ2
-.ÐØ2
-.Ò×2
-.ÒÖ2
-.ÒÔ2
-.ÓÂ2
-.ÓÂÌ2
-.ÓÂÒ2
-.Ó×2
-.Ó×ÓÔ2
-.ÓÇ2
-.ÓÇÎ2
-.ÓÇÒ2
-.ÓÄ2
-.ÓÄ×2
-.ÓÄÒ2
-.ÓÖ2
-.ÓÚ2
-.ÓË2
-.ÓË×2
-.ÓËÌ2
-.ÓËÒ2
-.ÓÌ2
-.ÓÍ2
-.ÓÎ2
-.ÓÐ2
-.ÓÐÌ2
-.ÓÐÒ2
-.ÓÒ2
-.ÓÓ2
-.ÓÔ2
-.ÓÔ×2
-.ÓÔÌ2
-.ÓÔÒ2
-.ÓÆ2
-.ÓÈ2
-.ÓÈ×2
-.ÓÈÌ2
-.ÓÞ2
-.ÓÛ2
-.Óß2
-.Ô×2
-.ÔË2
-.ÔËÎ2
-.ÔÌ2
-.ÔÒ2
-.ÔÝ2
-.ÔØÍ2
-.ÔØÆ2
-.ÆÌ2
-.ÆÒ2
-.È×2
-.ÈÌ2
-.ÈÍ2
-.ÈÎ2
-.ÈÒ2
-.Ã×2
-.ÞÌ2
-.ÞÒ2
-.ÞÔ2
-.ÞØ2
-.Û×2
-.ÛË2
-.ÛË×2
-.ÛÌ2
-.ÛÎ2
-.ÛÐ2
-.ÛÒ2
-.ÛÔ2
-.ÛÔÒ2
-1ÂÁ
-1ÂÅ
-1ÂÉ
-1ÂÏ
-1ÂÕ
-1ÂÙ
-1ÂÑ
-1×Á
-1×Å
-1×É
-1×Ï
-1×Õ
-1×Ù
-1×Ñ
-1ÇÁ
-1ÇÅ
-1ÇÉ
-1ÇÏ
-1ÇÕ
-1ÄÁ
-1ÄÅ
-1ÄÉ
-1ÄÏ
-1ÄÕ
-1ÄÙ
-1ÄÀ
-1ÄÑ
-1ÖÁ
-1ÖÅ
-1ÖÉ
-1ÖÏ
-1ÖÕ
-1ÖÙ
-1ÚÁ
-1ÚÅ
-1ÚÉ
-1ÚÏ
-1ÚÕ
-1ÚÙ
-1ÚÑ
-1ËÁ
-1ËÅ
-1ËÉ
-1ËÏ
-1ËÕ
-1ÌÁ
-1ÌÅ
-1ÌÉ
-1ÌÏ
-1ÌÕ
-1ÌÙ
-1ÌÀ
-1ÌÑ
-1ÍÁ
-1ÍÅ
-1ÍÉ
-1ÍÏ
-1ÍÕ
-1ÍÙ
-1ÍÑ
-1ÎÁ
-1ÎÅ
-1ÎÉ
-1ÎÏ
-1ÎÕ
-1ÎÙ
-1ÎÀ
-1ÎÑ
-1ÐÁ
-1ÐÅ
-1ÐÉ
-1ÐÏ
-1ÐÕ
-1ÐÙ
-1ÐÑ
-1ÒÁ
-1ÒÅ
-1ÒÉ
-1ÒÏ
-1ÒÕ
-1ÒÙ
-1ÒÀ
-1ÒÑ
-1ÓÁ
-1ÓÅ
-1ÓÉ
-1ÓÏ
-1ÓÕ
-1ÓÙ
-1ÓÑ
-1ÔÁ
-1ÔÅ
-1ÔÉ
-1ÔÏ
-1ÔÕ
-1ÔÙ
-1ÔÀ
-1ÔÑ
-1ÆÁ
-1ÆÅ
-1ÆÉ
-1ÆÏ
-1ÆÕ
-1ÆÙ
-1ÈÁ
-1ÈÅ
-1ÈÉ
-1ÈÏ
-1ÈÕ
-1ÃÁ
-1ÃÅ
-1ÃÉ
-1ÃÏ
-1ÃÕ
-1ÃÙ
-1ÞÁ
-1ÞÅ
-1ÞÉ
-1ÞÏ
-1ÞÕ
-1ÛÁ
-1ÛÅ
-1ÛÉ
-1ÛÏ
-1ÛÕ
-1ÝÁ
-1ÝÅ
-1ÝÉ
-1ÝÏ
diff --git a/contrib/groff/tmac/tmac.e b/contrib/groff/tmac/tmac.e
index 144565aabcee..eb5f730f3b32 100644
--- a/contrib/groff/tmac/tmac.e
+++ b/contrib/groff/tmac/tmac.e
@@ -1519,8 +1519,7 @@ in \\f2\\*([B\\f1, \c
.if \n(dw=5 .ds dw Thursday
.if \n(dw=6 .ds dw Friday
.if \n(dw=7 .ds dw Saturday
-.nr _y \n(yr+1900
-.ds td \*(mo \n(dy, \n(_y
+.ds td \*(mo \n(dy, \n(yr+1900
.\" *** PARAMETRIC INITIALIZATIONS ***
.rr x
.nr $v \n(.v00+\n(.sp-1/\n(.sp \" vs as percentage of ps for .sz request
diff --git a/contrib/ipfilter/ipmon.c b/contrib/ipfilter/ipmon.c
index aed6a8206d86..aea7f2075689 100644
--- a/contrib/ipfilter/ipmon.c
+++ b/contrib/ipfilter/ipmon.c
@@ -94,7 +94,7 @@ static FILE *newlog = NULL;
static char *logfile = NULL;
static int donehup = 0;
static void usage __P((char *));
-static void handlehup __P((int));
+static void handlehup __P((void));
static void flushlogs __P((char *, FILE *));
static void print_log __P((int, FILE *, char *, int));
static void print_ipflog __P((FILE *, char *, int));
@@ -126,8 +126,7 @@ static void logopts __P((int, char *));
#endif
-static void handlehup(sig)
-int sig;
+static void handlehup()
{
FILE *fp;
diff --git a/contrib/ipfilter/ipsend/ipsend.5 b/contrib/ipfilter/ipsend/ipsend.5
index 1e4e82e4729c..9fa459355fb6 100644
--- a/contrib/ipfilter/ipsend/ipsend.5
+++ b/contrib/ipfilter/ipsend/ipsend.5
@@ -323,7 +323,7 @@ If the new total length would exceed 64k, an error will be reported.
.SH "ICMP TYPES"
.TP
.B echorep
-Echo Reply.
+Eecho Reply.
.TP
.B "unreach [ unreachable-code ]"
Generic Unreachable error. This is used to indicate that an error has
diff --git a/contrib/ipfilter/man/ipf.1 b/contrib/ipfilter/man/ipf.1
index 912d7ef475d0..5ea06fa74c35 100644
--- a/contrib/ipfilter/man/ipf.1
+++ b/contrib/ipfilter/man/ipf.1
@@ -99,7 +99,7 @@ Zero global statistics held in the kernel for filtering only (this doesn't
affect fragment or state statistics).
.DT
.SH SEE ALSO
-ipfstat(1), ipftest(1), ipf(5)
+ipfstat(1), ipftest(1), ipf(5), mkfilters(1)
.SH DIAGNOSTICS
.PP
Needs to be run as root for the packet filtering lists to actually
diff --git a/contrib/ipfilter/man/ipf.5 b/contrib/ipfilter/man/ipf.5
index a186193002ef..79ab393b1fd2 100644
--- a/contrib/ipfilter/man/ipf.5
+++ b/contrib/ipfilter/man/ipf.5
@@ -351,7 +351,7 @@ with which they are associated can be used. The most important from
a security point of view is the ICMP redirect.
.SH KEEP HISTORY
.PP
-The second last parameter which can be set for a filter rule is whether or not
+The second last parameter which can be set for a filter rule is whether on not
to record historical information for that packet, and what sort to keep. The
following information can be kept:
.TP
@@ -487,4 +487,4 @@ qualifies all service/port names with the protocol specified.
.br
/etc/services
.SH SEE ALSO
-ipftest(1), iptest(1), ipf(4), ipnat(5), ipf(8), ipfstat(8)
+ipftest(1), iptest(1), mkfilters(1), ipf(4), ipnat(5), ipf(8), ipfstat(8)
diff --git a/contrib/ipfilter/man/ipf.8 b/contrib/ipfilter/man/ipf.8
index 16edfadccc8e..06d2723ffc15 100644
--- a/contrib/ipfilter/man/ipf.8
+++ b/contrib/ipfilter/man/ipf.8
@@ -113,7 +113,7 @@ affect fragment or state statistics).
.br
/dev/ipstate
.SH SEE ALSO
-ipftest(1), ipf(4), ipl(4), ipf(5), ipfstat(8), ipmon(8), ipnat(8)
+ipftest(1), mkfilters(1), ipf(4), ipl(4), ipf(5), ipfstat(8), ipmon(8), ipnat(8)
.SH DIAGNOSTICS
.PP
Needs to be run as root for the packet filtering lists to actually
diff --git a/contrib/ipfilter/man/ipfilter.5 b/contrib/ipfilter/man/ipfilter.5
index 44f313062e26..2826359ad16a 100644
--- a/contrib/ipfilter/man/ipfilter.5
+++ b/contrib/ipfilter/man/ipfilter.5
@@ -4,4 +4,4 @@ IP FIlter
.SH DESCRIPTION
.PP
.SH SEE ALSO
-ipf(8), ipf(1), ipf(5), ipnat(1), ipnat(5)
+ipf(8), ipf(1), ipf(5), ipnat(1), ipnat(5), mkfilters(1)
diff --git a/contrib/ipfilter/man/ipfstat.8 b/contrib/ipfilter/man/ipfstat.8
index eff21d302eaa..94525eb2d491 100644
--- a/contrib/ipfilter/man/ipfstat.8
+++ b/contrib/ipfilter/man/ipfstat.8
@@ -14,7 +14,7 @@ ipfstat \- reports on packet filter statistics and filter list
\fBipfstat\fP examines /dev/kmem using the symbols \fB_fr_flags\fP,
\fB_frstats\fP, \fB_filterin\fP, and \fB_filterout\fP.
To run and work, it needs to be able to read both /dev/kmem and the
-kernel itself. The kernel name defaults to \fB/kernel\fP.
+kernel itself. The kernel name defaults to \fB/vmunix\fP.
.PP
The default behaviour of \fBipfstat\fP
is to retrieve and display the accumulated statistics which have been
@@ -73,7 +73,7 @@ kernel.
.br
/dev/ipstate
.br
-/kernel
+/vmunix
.SH SEE ALSO
ipf(8)
.SH BUGS
diff --git a/contrib/ipfilter/man/ipmon.8 b/contrib/ipfilter/man/ipmon.8
index 82898e18d8f7..6388bf69ee54 100644
--- a/contrib/ipfilter/man/ipmon.8
+++ b/contrib/ipfilter/man/ipmon.8
@@ -42,6 +42,9 @@ for normal IP Filter log records.
Flush the current packet log buffer. The number of bytes flushed is displayed,
even should the result be zero.
.TP
+.B "\-N <device>"
+Set the logfile to be opened for reading NAT log records from to <device>.
+.TP
.B \-n
IP addresses and port numbers will be mapped, where possible, back into
hostnames and service names.
@@ -62,6 +65,10 @@ as for \fB-o\fP.
.B \-s
Packet information read in will be sent through syslogd rather than
saved to a file. The following levels are used:
+.TP
+.B "\-S <device>"
+Set the logfile to be opened for reading state log records from to <device>.
+.TP
.IP
.B LOG_INFO
\- packets logged using the "log" keyword as the action rather
@@ -77,8 +84,8 @@ than pass or block.
\- packets which have been logged and which can be considered
"short".
.TP
-.B "\-S <device>"
-Set the logfile to be opened for reading state log records from to <device>.
+.B \-S
+Treat the logfile as being composed of state log records.
.TP
.B \-t
read the input file/device in a manner akin to tail(1).
@@ -100,4 +107,4 @@ recorded data.
/dev/ipstate
.SH SEE ALSO
ipl(4), ipf(8), ipfstat(8), ipnat(8)
-.\".SH BUGS
+.SH BUGS
diff --git a/contrib/libpam/CHANGELOG b/contrib/libpam/CHANGELOG
deleted file mode 100644
index 99872a4704c7..000000000000
--- a/contrib/libpam/CHANGELOG
+++ /dev/null
@@ -1,1091 +0,0 @@
-
-$Id$
-
------------------------------
-
-0.66: whenever
-
-TODO
- - need to supply a backward compatability path for syslog & friends
- - need to make pam_system_log() thread safe.
- - need to make logging fix available to non-Linux PAM libraries
- - need to change modules to make use of new logging API.
- - document PAM_INCOMPLETE changes
- - document pam_system_log() changes
- - verify that the PAM_INCOMPLETE interface is sensible. Can we
- catch errors? should we permit item changing etc between
- pam_authenticate re-invocations?
- - verify that the PAM_INCOMPLETE interface works
- - add PAM_INCOMPLETE support to modules
- - verify that
- - work on RFC.
-
-0.65: Sun Apr 5 22:29:09 PDT 1998 <morgan@linux.kernel.org>
-
-* added event driven programming extensions to libpam
- - added PAM_INCOMPLETE handling to libpam/pam_dispatch.c
- - added PAM_CONV_AGAIN which is a new conversation response that
- should be mapped to PAM_INCOMPLETE by the module.
- - ensured that the pam_get_user() function can resume
- - changes to pam_strerror to accommodate above return codes
- - clean up _pam_former_state at pam_end()
- - ensured that former state is correctly initialized
- - added resumption tests to pam_authenticate(), pam_chauthtok()
- - added PAM_FAIL_DELAY item for pausing on failure
-
-* improved _pam_macros.h so that macros can be used as single commands
- (Andrey)
-
-* reimplemented logging to avoid bad interactions with libc. Added
- new functions, pam_[,v]system_log() to libpam's API. A programmer
- can check for this function's availablility by checking if
- HAVE_PAM_SYSTEM_LOG is #defined.
-
-* removed the reduce conflict from pam_conv1 creation -- I can sleep
- again now. :^]
-
-* made building of static and dynamic libpam separate. This is
- towards making it possible to build both under Solaris (for Derrick)
-
-* made USE_CRACKLIB a condition in unix module (Luke Kenneth Casson Leighton)
-
-* automated (quiet) config installation (Andrey)
-
-0.64: Thu Feb 19 23:30:24 PST 1998 Andrew Morgan <morgan@linux.kernel.org>
-
-* miscellaneous patches for building under Solaris (Derrick J Brashear)
-
-* removed STATIC support from a number of module Makefiles. Notably,
- these modules are those that use libpwdb and caused difficulties
- satisfying the build process. (Please submit patches to fix this...;)
-
-* reomved the union for binary packet conversations from
- (_pam_types.h). This is now completely implemented in libpam_client.
-
-* Andrey's patch for working environment variable handling in
- sh_secret module.
-
-* made the libpam_misc conversation function a bit more flexible with
- respect to binary conversations.
-
-* added top level define (DEBUG_REL) for compiling in the form of
- a debugging release. I use this on a Red Hat 4.2 system with little
- chance of crashing the system as a whole. (Andrey has another
- implementation of this -- with a spec file to match..)
-
-0.63: Wed Jan 28 22:55:30 PST 1998 Andrew Morgan <morgan@linux.kernel.org>
-
-* added libpam_client "convention" library. This makes explicit the
- use of PAM_BINARY_PROMPT. It is a first cut, so don't take it too
- seriously yet. Comments/suggestions for improvements are very
- welcome. Note, this library does not compile by default. It will
- be enabled when it is judged stable. The library comes with two
- module/agent pairs and can be used with ssh using a patch available
- from my pre-release directory [where you got this file.]
-
-* backward compatibility patch for libpam/pam_handlers.c (PAM_IGNORE
- was working with neither "requistie" nor "required") and a DEBUG'ing
- compile time bug with pam_dispatch.c (Savochkin Andrey Vladimirovich)
-
-* minor Makefile change from (Savochkin Andrey Vladimirovich)
-
-* added pam_afsauth, pam_afspass, pam_restrict, and pam_syslog hooks
- (Derrick J Brashear)
-
-* pam_access use of uname(2) problematic (security problem
- highlighted by Olaf Kirch).
-
-* pam_listfile went a bit crazy reading group membersips (problem
- highlighted by Olaf Kirch and patched independently by Cristian
- Gafton and Savochkin Andrey Vladimirovich)
-
-* compatibility hooks for solaris and hpux (Derrick J Brashear)
-
-* 64 bit Linux/alpha bug fixed in pam_rhosts (Andrew D. Isaacson)
-
-0.62: Wed Jan 14 14:10:55 PST 1998 Andrew Morgan <morgan@linux.kernel.org>
-
-* Derrick J Brashear's patches: adds the HP stuff missed in the first
- patch; adds SunOS support; adds support for the Solaris native ld
- instead of requiring gnu ld.
-
-* last line of .rhosts file need not contain a newline. (Bug reported by
- Thompson Freeman.)
-
-0.61: Thu Jan 8 22:57:44 PST 1998 Andrew Morgan <morgan@linux.kernel.org>
-
-* complete rewrite of the "control flag" logic. Formerly, we were
- limited to four flags: requisite, required, sufficient, optional.
- We can now use these keywords _and_ a great deal more besides.
- The extra logic was inspired by Vipin Samar, a preliminary patch was
- written by Andy Berkheimer, but I "had some ideas of my own" and
- that's what I've actually included. The basic idea is to allow the
- admin to custom build a control flag with a series of token=value
- pairs inside square brackets. Eg., '[default=die success=ok]' which
- is pretty close to a synonym for 'requisite'. I'll try to document it
- better in the sys-admin guide but I'm pretty sure it is a change for
- the better.... If what is in the sys-admin guide is not good enough
- for you, just take a look at the source for libpam ;^)
-
-0.59: Thu Jan 8 22:27:22 PST 1998 Andrew Morgan <morgan@linux.kernel.org>
-
-* better handling of empty lines in .rhosts file. (Formerly, we asked
- the nameserver about them!) Fix from Hugh Daschbach.
-
-* _broke_some_binary_compatibility_ with previous versions to become
- compliant with X/Open's XSSO spec. Specifically, this has been
- by changing the prototype for pam_strerror().
-
-* altered the convention for the conversation mechanism to agree
- with that of Sun. (number of responses 'now=' number of messages
- with help from Cristian for finding a bug.. Cristian also found a
- nasty speradic segfault bug -- Thanks!)
-
-* added NIS+ support to pam_unix_*
-
-* fixed a "regular file checking" problem with the ~/.rhosts sanity
- check. Added "privategroup" option to permit group write permission
- on the ~/.rhosts file in the case that the group owner has the same
- name as the authenticating user. :*) "promiscuous" and "suppress"
- were not usable!
-
-* added glibc compatibility to pam_rhosts_auth (protected __USE_MISC
- with #ifndef since my libc already defines it!).
-
-* Security fix from Savochkin Andrey Vladimirovich with suggested
- modification from Olaf Seibert.
-
-* preC contains mostly code clean-ups and a number of changes to
- _pam_macros.
-
-0.58: whenever
-
-* pam_getenvlist() has a more robust definition (XSSO) than was previously
- thought. It would seem that we no longer need pam_misc_copy_env()
- which was there to provide the robustness that pam_getenvlist()
- lacked before...
-
- Accordingly, I have REMOVED the prototype from libpam_misc. (The
- function, however, will remain in the library as a wrapper for
- legacy apps, but will likely be removed from libpam_misc-1.0.) PLEASE
- FIX YOUR APPS *BEFORE* WE GET THERE!
-
-* Alexy Nogin reported garbage output from pam_env in the case of
- a non-existent environment variable.
-
-* 'fixed' pwdb compilation for pam_wheel. Not very cleanly
- done.. Mmmm. Should really clean up the entire source tree...
-
-* added prototypes for mapping functions
-
- <**WARNING**>
-
- various constants have had there names changed. Numerical values have
- been retained but be aware some source old modules/applications will
- need to be fixed before recompilation.
-
- </**WARNING**>
-
-* appended documentation to README for pam_rhosts module (Nicolai
- Langfeldt).
-
-* verified X/Open compatibility of header files - note, where we differ
- it is at the level of compilation warnings and the use of 'const char *'
- instead of 'char *'. Previously, Sun(X/open) have revised their spec
- to be more 'const'-ervative in the light of comments from Linux-PAM
- development.
-
-* Ooops! PAM_AUTHTOKEN_REQD should have been PAM_NEW_AUTHTOK_REQD.
-
- changed: pam_pwdb(pam_unix_acct) (also bug fix for
- _shadow_acct_mgmt_exp() return value), pam_stress,
- libpam/pam_dispatch, blank, xsh.
-
-* New: PAM_AUTHTOK_EXPIRED - password has expired.
-
-* Ooops! PAM_CRED_ESTABLISH (etc.) should have been PAM_ESTABLISH_CRED
- etc... (changed - this may break some people's modules - PLEASE TAKE
- NOTE!)
- changed: pam_group, pam_mail, blank, xsh; module and appl
- docs, pam_setcred manual page.
-
-* renamed internal _pam_handle structure to be pam_handle as per XSSO.
-
-* added PAM_RADIO_TYPE (for multiple choice input method). Also
- added PAM_BINARY_{MSG,PROMPT} (for interaction out of sight of user
- - this could be used for RSA type authentication but is currently
- just there for experimental purposes). The _BINARY_ types are now
- usable with hooks in the libpam_misc conversation function. Still
- have to add PAM_RADIO_TYPE.
-
-* added pam_access module (Alexei Nogin)
-
-* added documentation for pam_lastlog. Also modified the module to
- not (by default) print "welcome to your new account" when it cannot
- find a utmp entry for the user (you can turn this on with the
- "never" argument).
-
-* small correction to the pam_fail_delay manual page. Either the appl or
- the modules header file will prototype this function.
-
-* added "bigcrypt" (DEC's C2) algorithm(0) to pam_pwdb. (Andy Phillips)
-
-* *BSD tweaking for various #include's etc. (pam_lastlog, pam_rhosts,
- pam_wheel, libpam/pam_handlers). (Michael Smith)
-
-* added configuration directory $SCONFIGED for module specific
- configuration files.
-
-* added two new "linked" man pages (pam.conf(8) and pam.d(8))
-
-* included a reasonable default for /etc/pam.conf (which can be
- translated to /etc/pam.d/* files with the pam_conv1 binary)
-
-* fixed the names of the new configuration files in
- conf/pam_conv1/pam_conv.y
-
-* fixed make check.
-
-* pam_lastlog fixed to handle UID in virgin part of /var/log/lastlog
- (bug report from Ronald Wahl).
-
-* grammar fix in pam_cracklib
-
-* segfault avoided in pam_pwdb (getting user). Updating of passwords
- that are directed to a "new" database are more robust now (bug noted
- by Michael K. Johnson). Added "unix" module argument for migrating
- passwords from another database to /etc/passwd. (documentation
- updated). Removed "bad username []" warning for empty passwords -
- on again if you supply the 'debug' module argument.
-
-* ctrl-D respected in conversation function (libpam_misc)
-
-* Removed -DPAM_FAIL_DELAY_ON from top-level Makefile. Nothing in
- the distribution uses it. I guess this change happened a while
- back, basically I'm trying to make the module parts of the
- distribution "source compatible" with the RFC definition of PAM.
- This implementation of PAM is a superset of that definition. I have
- added the following symbols to the Linux-PAM header files:
-
- PAM_DATA_SILENT (see _pam_types.h)
- HAVE_PAM_FAIL_DELAY (see _pam_types.h)
- PAM_DATA_REPLACE (see _pam_modules.h)
-
- Any module (or application) that wants to utilize these features,
- should check (#ifdef) for these tokens before using the associated
- functionality. (Credit to Michael K. Johnson for pointing out my
- earlier omission: not documenting this change :*)
-
-* first stab at making modules more independent of full library
- source. Modules converted:
- pam_deny
- pam_permit
- pam_lastlog
- pam_pwdb
-
-* pam_env.c: #include <errno.h> added to ease GNU libc use. (Michael
- K. Johnson)
-
-* pam_unix_passwd fixes to shadow aging code (Eliot Frank)
-
-* added README for pam_tally
-
-0.57: Fri Apr 4 23:00:45 PST 1997 Andrew Morgan <morgan@parc.power.net>
-
-* added "nodelay" argument to pam_pwdb. This can be used to turn off
- the call to pam_fail_delay that takes effect when the user fails to
- authenticate themself.
-
-* added "suppress" argument to pam_rhosts_auth module. This will stop
- printing the "rlogin failure message" when the user does not have a
- .rhosts file.
-
-* Extra fixes for FAKEROOT in Makefiles (Savochkin Andrey
- Vladimirovich)
-
-* pam_tally added to tree courtesy of Tim Baverstock
-
-* pam_rhosts_auth was failing to read NFS mounted .rhosts
- files. (Fixed by Peter Allgeyer). Refixed and further enhanced
- (netgroups) by Nicolai Langfeldt. [Credit also to G.Wilford for some
- changes that were not actually included..]
-
-* optional (#ifdef PAM_READ_BOTH_CONFS) support for parsing of pam.d/
- AND pam.conf files (Elliot Lee).
-
-* Added (and signed) Cristian's PGP key. (I've never met him, but I am
- convinced the key belongs to the guy that is making the PAM rpms and
- also producing libpwdb. Please note, I will not be signing anyone
- else's key without a personal introduction..)
-
-* fixed erroneous syslog warning in pam_listfile (Savochkin Andrey
- Vladimirovich, whole file reformatted by Cristian)
-
-* modified pam_securetty to return PAM_IGNORE in the case that the user's
- name is not known to the system (was previously, PAM_USER_UNKNOWN). The
- Rationale is that pam_securetty's sole purpose is to prevent superuser
- login anywhere other than at the console. It is not its concern that the
- user is unknown - only that they are _not_ root. Returning
- PAM_IGNORE, however, insures that the pam_securetty can never be used to
- "authenticate" a non-existent user. (Cristian Gafton with bug report from
- Roger Hu)
-
-* Modified pam_nologin to display the no-login message when the user
- is not known. The return value in this case is still PAM_USER_UNKNOWN.
- (Bug report from Cristian Gafton)
-
-* Added NEED_LCKPWD for pam_unix/ This is used to define the locking
- functions and should only be turned on if you don't have them in
- your libc.
-
-* tidied up pam_lastlog and pam_pwdb: removed function that was never used.
-
-* Note for package maintainers: I have added $(FAKEROOT) to the list of
- environment variables. This should help greatly when you build PAM
- in a subdirectory. I've gone through the tree and tried to make
- everything compatible with it.
-
-* added pam_env (courtesy of Dave Kinchlea)
-
-* removed pam_passwd+ from the tree. It has not been maintained in a
- long time and running a shell script was basically insecure. I've
- indicated where you can pick up the source if you want it.
-
-* #define HAVE_PAM_FAIL_DELAY . Applications can conditionally compile
- with this if they want to see if the facility is available. It is
- now always available. (corresponding compilation cleanups..)
-
-* _pam_sanitize() added to pam_misc. It purges the PAM_AUTHTOK and
- PAM_OLDAUTHTOK items. (calls replaced in pam_auth and pam_password)
-
-* pam_rhosts now knows about the '+' entry. Since I think this is a
- dangerous thing, I have required that the sysadmin supply the
- "promiscuous" flag for it in the corresponding configuration file
- before it will work.
-
-* FULL_LINUX_PAM_SOURCE_TREE exported from the top level make file.
- If you want to build a module, you can test for this to determine if
- it should take its directions from above or supply default locations
- for installation. Etc.
-
-0.56: Sat Feb 15 12:21:01 PST 1997 <morgan@parc.power.net>
-
-* pam_handlers.c can now interpret the pam.d/ service config tree:
- - if /etc/pam.d/ exists /etc/pam.conf is IGNORED
- (otherwise /etc/pam.conf is treated as before)
- - given /etc/pam.d/
- . config files are named (in lower case) by service-name
- . config files have same syntax as /etc/pam.conf except
- that the "service-name" field is not present. (there
- are thus three manditory fields (and arguments are
- optional):
-
- module-type control-flag module-path optional-args...
-
- )
-
-* included conf/pam_conv1 for converting pam.conf to a pam.d/ version
- 1.0 directory tree. This program reads a pam.conf file on the
- standard input stream and creates ./pam.d/ (in the local directory)
- and fills it with ./pam.d/"service-name" files.
-
- *> Note: It will fail if ./pam.d/ already exists.
-
- PLEASE REPORT ANY BUGS WITH THIS CONVERSION PROGRAM... It currently
- cannot retain comments from the old conf file, so take care to do this
- by hand. Also, please email me with the fix that makes the
- shift/reduce conflict go away...
-
-* Added default module path to libpam for modules (see pam_handlers.c)
- it makes use of Makfile defined symbol: DEFAULT_MODULE_PATH which is
- inhereted from the defs/* variable $(SECUREDIR). Removed module
- paths from the sample pam.conf file as they are no longer needed.
-
-* pam_pwdb can now verify read protected passwords when it is not run
- by root. This is via a helper binary that is setuid root.
-
-* pam_permit now prompts for a username if it is not already determined
-
-* pam_rhosts now honors "debug" and no longer hardwire's "root" as the
- superuser's name.
-
-* pam_securetty now honors the "debug" flag
-
-* trouble parsing extra spaces fixed in pam_time and pam_group
-
-* added Michael K. Johnson's PGP key to the pgp.keys.asc list
-
-* pam_end->env not being free()'d: fixed
-
-* manuals relocated to section 3
-
-* fixed bug in pam_mail.c, and enhanced to recognize '~' as a prefix
- to indicate the $HOME of the user (courtesy David
- Kinchlea). *Changed* from a "session" module to an "auth"
- module. It cannot be used to authenticate a user, but it can be used
- in setting credentials.
-
-* fixed a stupid bug in pam_warn.. Only PAM_SERVICE was being read :*(
-
-* pam_radius rewritten to exclusively make use of libpwdb. (minor fix
- to Makefile for cleaning up - AGM)
-
-* pam_limits extended to limit the total number of logins on a system
- at any given time.
-
-* libpam and libpam_misc use $(MAJOR_REL) and $(MINOR_REL) to set their
- version numbers [defined in top level makefile]
-
-* bugfix in sed command in defs/redhat.defs (AGM's fault)
-
-* The following was related to a possibility of buffer overruns in
- the syslogging code: removed fixed length array from syslogging
- function in the following modules [capitalized the log identifier
- so the sysadmin can "know" these are fixed on the local system],
-
- pam_ftp, pam_stress, pam_rootok, pam_securetty,
- pam_listfile, pam_shells, pam_warn, pam_lastlog
- and
- pam_unix_passwd (where it was definitely _not_ exploitable)
-
-0.55: Sat Jan 4 14:43:02 PST 1997, Andrew Morgan <morgan@parc.power.net>
-
-* added "requisite" control_flag to /etc/pam.conf syntax. [See
- Sys. Admin. Guide for explanation] changes to pam_handlers.c
-
-* completely new handling of garbled pam.conf lines. The modus
- operandi now is to assume that any errors in the line are minor.
- Errors of this sort should *most definitely* lead to the module
- failing, however, just ignoring the line (as was the case
- previously) can lead to gaping security holes(! Not foreseen by the
- RFC). The "motivation" for the RFC's comments about ignoring garbled
- lines is present in spirit in the new code: basically a garbled line
- is treated like an instance of the pam_deny.so module.
- changes to pam_handlers.c and pam_dispatch.c .
-
-* patched libpam, to (a) call _pam_init_handlers from pam_start() and
- (b) to log a text error if there are no modules defined for a given
- service when a call to a module is requested. [pam_start() and
- pam_dispatch() were changed].
-
-* patched pam_securetty to deal with "/dev/" prefix on PAM_TTY item.
-
-* reorganized the modules/Makefile to include *ALL* modules. It is now
- the responsibility of the modules themselves to test whether they can
- be compiled locally or not.
-
-* modified pam_group to add to the getgroups() list rather than overwrite
- it. [In the case of "HAVE_LIBPWDB" we use the pwdb_..() calls to
- translate the group names.]. Module now pays attention to
- PAM_CRED_.. flag(!)
-
-* identified and removed bugs in field reading code of pam_time and
- (thus) pam_group.
-
-* Cristian's patches to pam_listfile module, corresponding change to
- documentation.
-
-* I've discovered &ero; for sgml!
- Added pam_time documentation to the admin guide.
-
-* added manual pages: pam.8, pam_start.2(=pam_end.2),
- pam_authenticate.2, pam_setcred.2, pam_strerror.2,
- pam_open_session.2(=pam_close_session.2) and pam_chauthtok.2 .
-
-* added new modules:
-
- - pam_mail (tells the user if they have any new mail
- and sets their MAIL env variable)
- - pam_lastlog (reports on the last time this user called
- this module)
-
-* new module hooks provided.
-
-* added a timeout feature to the conversation function in
- libpam_misc. Documented it in the application developers' guide.
-
-* fixed bug in pam_misc_paste_env() function..
-
-* slight modifications to wheel and rhosts writeup.
-
-* more security issues added to module and application guides.
-
---
-Things present but not mentioned in previous release (sorry)
-
-* pam_pwdb module now resets the "last_change" entry before updating a
- password.
---
-
-Sat Nov 30 19:30:20 PST 1996, Andrew Morgan <morgan@parc.power.net>
-
-* added environment handling to libpam. involved change to _pam_types.h
- also added supplementary functions to libpam_misc
-
-* added pam_radius - Cristian
-
-* slight speed up for pam_rhosts
-
-* significantly enhanced sys-admin documentation (8 p -> 41 p in
- PostScript). Added to other documentation too. Mostly the changes
- in the other docs concern the new PAM-environment support, there is
- also some coverage of libpam_misc in the App. Developers' guide.
-
-* Cristian's patches to pam_limits and pam_pwdb. Fixing bugs. (MORE added)
-
-* adopted Cristian's _pam_macros.h file to help with common macros and
- debugging stuff, gone through tree tidying up debugging lines to use
- this [not complete].
-
- - for consistency replaced DROP() with _pam_drop()
-
-* commented memory debugging in top level makefile
-
-* added the following modules
-
- - pam_warn log information to syslog(3) about service application
- - pam_ftp if user is 'ftp' then set PAM_RUSER/PAM_RHOST with password
- (comment about nologin added to last release's notes)
-
-* modified the pam_listfile module. It now declares a meaningful static
- structure name.
-
-Sun Nov 10 13:26:39 PST 1996, Andrew Morgan <morgan@parc.power.net>
-
- **PLEASE *RE*AMEND YOUR PERSONAL LINKS**
-
- -------> http://parc.power.net/morgan/Linux-PAM/index.html <-------
-
- **PLEASE *RE*AMEND YOUR PERSONAL LINKS**
-
-A brief summary of what has changed:
-
-* many modules have been modified to accomodate fixing the pam_get_user()
- change. Please take note if you have a module in this distribution.
-
-* pam_unix is now the pam_unix that Red Hat has been using and which
- should be fairly well debugged.
-
- - I've added some #ifdef's to make it compile for me, and also
- updated it with respect to the libpam-0.53, so have a look at the
- .../modules/pam_unix/Makefile to enable cracklib and shadow features
-
- ** BECAUSE OF THIS, I cannot guarantee this code works as it **
- ** did for Red Hat. Please test and report any problems. **
-
-* the pam_unix of .52 (renamed to pam_pwdb) has been enhanced and made
- more flexible with by implementing it with respect to the new
- "Password Database Library" see
-
- http://parc.power.net/morgan/libpwdb/index.html
-
- modules included in this release that require this library to
- function are the following:
-
- - pam_pwdb (ne pam_unix-0.52 + some enhancements)
- - pam_wheel
- - pam_limits
- - pam_nologin
-
-* Added some optional code for memory debugging. In order to support
- this you have to enable MEMORY_DEBUG in the top level makefile and
- also #define MEMORY_DEBUG in your applications when they are compiled.
- The extra code resides in libpam (compiled if MEMORY_DEBUG is defined)
- and the macros for malloc etc. are to be found at the end of
- _pam_types.h
-
-* used above code to locate two memory leaks in pam_unix module and two
- in libpam (pam_handlers.h)
-
-* pam_get_user() now sets the PAM_USER item. After reading the Sun
- manual page again, it was clear that it should do this. Various
- modules have been assuming this and now I have modified most of them
- to account for this change. Additionally, pam_get_user() is now
- located in the module include file; modules are supposed to be the
- ones that use it(!) [Note, this is explicitly contrary to the Sun
- manual page, but in the spirit of the Linux distribution to date.]
-
-* replaced -D"LINUX" with -D"LINUX_PAM" as this is more explicit and less
- likely to be confused with -D"linux".
- Also, modified the libpam #include files to behave more like the Sun
- ones #ifndef LINUX_PAM.
-
-* removed <bf/ .. / from documentation titles. This was not giving
- politically correct html..
-
------ My vvvvvvvvvvvvvvvvvvv was a long time ago ;*] -----
-
-Wed Sep 4 23:57:19 PDT 1996 (Andrew Morgan <morgan@physics.ucla.edu>
-
-0. Before I begin, Linux-PAM has a new primary distribution site (kindly
-donated by Power Net Inc., Los Angeles)
-
- **PLEASE AMMEND YOUR PERSONAL LINKS**
-
- -------> http://www.power.net/morgan/Linux-PAM <-------
-
- **PLEASE AMMEND YOUR PERSONAL LINKS**
-
-1. I'm hoping to make the next release a bug-fix release... So please find
- all the bugs(! ;^)
-
-2. here are the changes for .52:
-
-* minor changes to module documentation [Incidently, it is now
- available on-line from the WWW page above]. More changes to follow in
- the next two releases. PLEASE EMAIL me or the list if there is
- anything that isn't clear!
-
-* completely changed the unix module. Now a single module for all four
- management groups (this meant that I could define all functions as
- static that were not part of the pam_sm_... scheme. AGM)
-
- - Shadow support added
-PASSWD - Elliot's account management included, and enhanced by Cristian Gafton.
- - MD5 password support added by Cristian Gafton.
- - maxtries for authentication now enforced.
- - Password changing function in pam_unix now works!
- Although obviously, I'm not going to *guarantee* it ;^) .
- - stole Marek's locking code from the Red Hat unix module.
- [ If you like you can #ifdef it in or out ... ]
-
- You can configure the module more from its Makefile in
- 0.52/modules/pam_unix/
-
- If you are nervous that it will destroy your /etc/passwd or shadow
- files then EDIT the 0.52/modules/pam_unix/pam_unix_pass.-c file.
- Here is the warning comment from this file...
-
--------------8<-----------------
-/* <WARNING>
- *
- * Uncomment the following #define if you are paranoid, and do not
- * want to risk losing your /etc/passwd or shadow files.
- * It works for me (AGM) but there are no guarantees.
- *
- * </WARNING>
- */
-/* #define TMP__FILE */
-------------->8-----------------
-
- *** If anyone has any trouble, please *say*. Your problem will be
- fixed in the next release. Also please feel free to scour the
- code for race conditions etc...
-
-[* The above change requires that you purge your /usr/lib/security
- directory of the old pam_unix_XXX.so modules: they will NOT be deleted
- with a 'make remove'.]
-
-* the prototype for the cleanup function supplied to pam_set_data used
- to return "int". According to Sun it should be "void". CHANGED.
-
-* added some definitions for the 'error_status' mask values that are
- passed to the cleanup function associated with each
- module-data-item. These numbers were needed to keep up with changing
- a data item (see for example the code in pam_unix/support.-c that
- manages the maximum number of retries so far). Will see what Sun says
- (current indications are positive); this may be undone before 1.0 is
- released. Here are the definitions (from pam_modules.h).
-
-#define PAM_DATA_SILENT 0x40000000 /* used to suppress messages... */
-#define PAM_DATA_REPLACE 0x20000000 /* used when replacing a data item */
-
-* Changed the .../conf/pam.conf file. It now points to the new
- pam_unix module for 'su' and 'passwd' [can get these as SimpleApps --
- I use them for testing. A more extensive selection of applications is
- available from Red Hat...]
-
-* corrected a bug in pam_dispatch. Basically, the problem was that if
- all the modules were "sufficient" then the return value for this
- function was never set. The net effect was that _pam_dispatch_aux
- returned success when all the sufficient modules failed. :^( I think
- this is the correct fix to a problem that the Red Hat folks had
- found...
-
-sopwith* Removed advisory locking from libpam (thanks for the POSIX patch
- goes to Josh Wilmes's, my apologies for not using it in the
- end.). Advisory locking did not seem sufficiently secure for libpam.
- Thanks to Werner Almesberger for identifying the corresponding "denial
- of service attack". :*(
-
-* related to fix, have introduced a lock file /var/lock/subsys/PAM
- that can be used to indicate the system should pay attention to
- advisory locking on /etc/pam.conf file. To implement this you need to
- define PAM_LOCKING though. (see .52/libpam)
-
-* modified pam_fail_delay() function. Couldn't find the "not working"
- problem indicated by Michael, but modified it to do pseudo-random
- delays based on the values indicated by pam_fail_delay() -- the
- function "that may eventually go away"... Although Sun is warming to
- the idea.
-
-* new modules include:
-
- pam_shells - authentication for users with a shell listed in
- /etc/shells. Erik Troan <ewt@redhat.com>
-
- pam_listfile - authentication based on the contents of files.
- Set to be more general than the above in the
- future. UNTESTED. Elliot Lee <@redhat.com>
- [Note, this module compiles with a non-trivial
- warning: AGM]
-
-Thu Aug 8 22:32:15 PDT 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* modified makefiles to take more of their installation instructions
- from the top level makefile. Desired for integration into the Debian
- distribution, and generally a good idea.
-
-* fixed memory arithmetic in pam_handlers
- -- still need to track down why failure to load modules can lead to
- authentication succeding..
-
-* added tags for new modules (smartcards from Alex -- just a promise
- at this stage) and a new module from Elliot Lee; pam_securetty
-
-* I have not had time to smooth out the wrinkles with it, but Alex's
- pam_unix modifications are provided in pam_unix-alex (in the modules
- directory) they will not be compiled by 'make all' and I can't even
- say if they do compile... I will try to look at them for .52 but, in
- the mean time please feel free to study/fix/discuss what is there.
-
-* pam_rhosts module. Removed code for manually setting the ruser
- etc. This was not very secure.
-
-* [remade .ps docs to be in letter format -- my printer complains
- about a4]
-
-Sunday July, 7 12:45:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* No longer accompanying the Linux-PAM release with apps installed.
- [Will provide what was here in a separate package.. (soon)
-lib Also see http://www.redhat.com/pam for some more (in .rpm form...)]
-
-* renamed libmisc to libpam_misc. It is currently configured to only compile
- the static library. For some strange reason (perhaps someone can
- investigate) my Linux 2.0.0 kernel with RedHat 3.0.3 system
- segfaults when I compile it to be a dynamic library. The segfault
- seems to be inside the call to the ** dl_XXX ** function...!?
-
- There is a simple flag in the libpam_misc/Makefile to turn on dynamic
- compiles.
-
-* Added a little unofficial code for delay support in libpam (will probably
- disappear later..) There is some documentation for it in the pam_modules
- doc now. That will obviously go too.
-
-* rewritten pam_time to use *logic* to specify the stringing together of
- users/times/terminals etc.. (what was there before was superficially
- logical but basically un-predictable!)
-
-* added pam_group. Its syntax is almost identical to pam_time but it
- has another field added; a list of groups to make the user a member
- of if they pass the previous tests. It seems to not co-exist too well
- with the groups in the /etc/group but I hope to have that fixed by
- the next release...
-
-* minor re-formatting of pam_modules documentation
-
-* removed ...// since it wasn't being used and didn't look like it
- would be!
-
-GCCSunday 23 22:35:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* The major change is the addition of a new module: pam_time for
- restricting access on terminals at given times for indicated users
- it comes with its own configuration file /etc/security/time.conf
- and the sample file simply restricts 'you' from satisfying the blank
- application if they try to use blank from any tty*
-
-* Small changes include
-- altered pam.conf to demonstrate above new module (try typing username: you)
-- very minor changes to the docs (pam_appl and pam_modules)
-
-Saturday June 2 01:40:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-*** PLEASE READ THE README, it has changed ***
-
-* NOTE, 'su' exhibits a "system error", when static linking is
- used. This is because the pam_unix_... module currently only has
- partial static linking support. This is likely to change on Monday
- June 3, when Alex makes his latest version availible. I will include
- the updated module in next release.
-
-changes for .42:
-
-* modified the way in which libpam/pam_modules.h defines prototypes for
- the pam_sm_ functions. Now the module must declare which functions it
- is to provide *before* the #include <security/pam_modules.h> line.
- (for contrasting examples, see the pam_deny and pam_rootok modules)
- This removed the ugly hack of defining functions that are never called
- to overcome warnings... This seems much tidier.
-insterted* updated the TODO list. (changed mailing list address)
-* updated README in .../modules to reflect modifications to static
- compliation protocol
-* modified the pam_modules documentation to describe this.
-* corrected last argument of pam_get_item( ... ) in
- pam_appl/modules.sgml, to "const void **".
-* altered GNU GPL's in the documentation, and various other parts of
- the distribution. *Please check* that any code you are responsible for
- is corrected.
-* Added ./Copyright (please check that it is acceptable)
-* updated ./README to make current and indicate the new mailing list
- address
-* have completely rewritten pam_filter. It now runs modular filter
- executables (stored in /usr/sbin/pam_filter/) This should make it
- trivial for others to write their own filters.. If you want yours
- included in the distribution please email the list/me.
-* changes to libpam; there was a silly bug with multiple arguments on a
- pam.conf line that was broken with a '\<LF>'.
-* 'su' rearranged code (to make better use of PAM)
- *Also* now uses POSIX signals--this should help the Alpha port.
-* 'passwd' now uses getlogin() to determine who's passwords to change.
-
-Sunday May 26 9:00:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* fixed module makefiles to create needed dynamic/static subdirectories
-
-Saturday May 25 20:30:27.8 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* LOTS has changed regarding how the modules/libpam are built.
-* Michael's mostly complete changes for static support--see below
- (Andrew got a little carried away and automated the static linking
- of modules---bugs are likely mine ;( )
-* Thanks mostly to Michael, libpam now compiles without a single warning :^]
-* made static modules/library optional.
-CFLAGS* added 'make sterile' to top level makefile. This does extraclean and remove
-* added Michael and Joseph to documentation credits (and a subsection for
- future documentation of static module support in pam_modules.sgml)
-* libpam; many changes to makefiles and also automated the inclusion of
- static module objects in pam_static.c
-* modified modules for automated static/dynamic support. Added static &
- dynamic subdirectories, as instructed by Michael
-* removed an annoying syslog message from pam_filter: "parent exited.."
-* updated todo list (anyone know anything about svgalib/X? we probably should
- have some support for these...)
-
-Friday May 24 16:30:15 EDT 1996 (Michael K. Johnson <johnsonm@redhat.com>)
-
-* Added first (incomplete) cut at static support.
- This includes:
- . changes in libpam, including a new file, pam_static.c
- . changes to modules including exporting struct of function pointers
- . static and dynamic linking can be combined
- . right now, the only working combinations are just dynamic
- linking and dynamic libpam.so with static modules linked
- into libpam.so. That's on the list of things to fix...
- . modules are built differently depending on whether they
- are static or dynamic. Therefore, there are two directories
- under each module directory, one for static, and one for
- dynamic modules.
-* Fixed random brokenness in the Makefiles. [ foo -nt bar ] is
- rather redundant in a makefile, for instance. Also, passing
- on the command line is broken because it cannot be
- overridden in any way (even adding important parts) in lower-level
- makefiles.
-* Unfortunately, fixing some of the brokenness meant that I used
- GNU-specific stuff. However, I *think* that there was GNU-specific
- stuff already. And I think that we should just use the GNU
- extensions, because any platform that GNU make doesn't port to
- easily will be hard to port to anyway. It also won't be likely
-passwd to handle autoconf, which was Ted's suggestion for getting
- around limitations in standard make...
- For now, I suggest that we just use some simple GNU-specific
- extensions.
-
-Monday May 20 22:00:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* added some text to pam_modules.sgml
-* corrected Marek's name in all documentation
-* made pam_stress conform to chauthtok conventions -- ie can now request
- old password before proceeding.
-* included Alex's latest unix module
-* included Al's + password strength checking module
-* included pam_rootok module
-* fixed too many bugs in libpam.. all subtly related to the argument lists
- or use of syslog. Added more debugging lines here too.
-* fixed the pam.conf file
-* deleted pam_test module. It is pretty old and basically superceeded
- by pam_stress
-
-Friday May 9 1:00:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* updated documentaion, added Al Longyear to credits and corrected the
- spelling of Jeff's name(!). Most changes to pam.sgml (even added a figure!)
-* new module pam_rhosts_auth (from Al Longyear)
-* new apps rlogind and ftpd (a patch) from Al.
-* modified 'passwd' to not call pam_authenticate (note, none of the
- modules respect this convention yet!)
-* fixed bug in libpam that caused trouble if the last line of a
- pam.conf file ends with a module name and no newline character
-* also made more compatable with documentation, in that bad lines in
- pam.conf are now ignored rather than causing libpam to return an
- error to the app.
-* libpam now overwrites the AUTHTOKs when returning from
- pam_authenticate and pam_chauthtok calls (as per Sun/RFC too)
-* libpam is now installed as libpam.so.XXX in a way that ldconfig can
- handle!
-
-
-Wednesday May 1 22:00:00 PST 1996 (Andrew Morgan <morgan@physics.ucla.edu>)
-
-* removed .../test directory, use .../examples from now on.
-* added .../apps directory for fully functional applications
- - the apps directory contains directories that actually contain the apps.
- the idea is to make application compilation conditional on the presence
- of the directory. Note, there are entries in the Makefile for
- 'login' and 'ftpd' that are ready for installation... Email me if
- you want to reserve a directory name for an application you are
- working on...
-* similar changes to .../modules makefile [entries for pam_skey and
- pam_kerberos created---awaiting the directories.] Email me if you
- want to register another module...
-* minor changes to docs.. Not really worth reprinting them quite yet!
- [save the trees]
-* added misc_conv to libmisc. it is a generic conversation function
- for text based applications. [would be nice to see someone create
- an Xlib and/or svgalib version]
-* fixed ctrl-z/c bug with pam_filter module [try xsh with the default
- pam.conf file]
-* added 'required' argument to 'pam_stress' module.
-* added a TODO list... other suggestions to the list please.
-
-Saturday April 7 00:00:00 PST 1996 ( Andrew Morgan <morgan@physics.ucla.edu> )
-
-* Alex and Marek please note I have altered _pam_auth_unix a little, to
- make it get the passwords with the "proper method" (and also fixed it
- to not have as many compiler warnings)
-* updated the conf/pam.conf file
-* added new example application examples/xsh.c (like blank but invokes
- /bin/sh)
-* Marc's patches for examples/blank.c (and AGM's too)
-* fixed stacking of modules in libpam/pam_handlers.c
-* fixed RESETing in libpam/pam_item.c
-* added new module modules/pam_filter/ to demonstrate the possibility
- of inserting an arbitrary filter between the terminal and the
- application that could do customized logging etc... (see use of
- bin/xsh as defined in conf/pam.conf)
-
-
-Saturday March 16 19:00:00 PST 1996 ( Andrew Morgan <morgan@physics.ucla.edu> )
-
-These notes are for 0.3 I don't think I've left anything important
-out, but I will use emacs 'C-x v a' next time! (Thanks Jeff)
-
- * not much has changed with the functionality of the Linux-PAM lib
- .../libpam
- - pam_password calls module twice with different arguments
- - added const to some of the function arguments
- - added PAM_MAX_MES_ to <security/_pam_types.h>
- - was a lot over zealous about purging old passwords...
- I have removed much of this from source to make it
- more compatible with SUN.
- - moved some PAM_... tokens to pam_modules.h from _pam_types.h
- (no-one should notice)
-
- * added three modules: pam_permit pam_deny pam_stress
- no prizes for guessing what the first two do. The third is
- a reasonably complete (functional) module. Is intended for testing
- applications with.
-
- * fixed a few pieces of examples/blank.c so that it works (with
- pam_stress)
-
- * ammended the documentation. Looking better, but suggestions/comments
- very welcome!
-
-Sunday March 10 10:50:00 PST 1996 ( Andrew Morgan <morgan@physics.ucla.edu> )
-
-These notes are for Linux-PAM release 0.21. They cover what's changed
-since I relased 0.2.
-
- * am now using RCS
- * substantially changed ./README
- * fixed bug reading \\\n in pam.conf file
- * small changes to documentation
- * added `blank' application to ./examples (could be viewed as
- a `Linux-PAM aware' application template.)
- * oops. now including pam_passwd.o and pam_session.o in pamlib.so
- * compute md5 checksums for all the source when making a release
- - added `make check' and `make RCScheck' to compute md5 checksums
- * create a second tar file with all the RCS files in.
- * removed the .html and .txt docs, supplying sgml sources instead.
- - see README for info on where to get .ps files
-
-Thursday March 6 0:44:?? PST 1996 ( Andrew Morgan <morgan@physics.ucla.edu> )
-
-These notes are for Linux-PAM release 0.2. They cover what's changed
-since Marc Ewing relased 0.1.
-
-**** Please note. All of the directories in this release have been modified
-**** slightly to conform to the new pamlib. A couple of new directories have
-**** been added. As well as some documentation. If some of your code
-**** was in the previous release. Feel free to update it, but please
-**** try to conform to the new headers and Makefiles.
-
-* Andrew Morgan (morgan@physics.ucla.edu) is making this release
- availible, Marc has been busy...!
-
-* Marc's pam-0.1/lib has been (quietly) enhanced and integrated into
- Alex Yurie's collected tree of library and module code
- (linux-pam.prop.1.tar.gz). Most of the changes are to do with error
- checking. Some more robustness in the reading of the pam.conf file
- and the addition of the pam_get_user() function.
-
-* The pam_*.h files have been reorganized to logically enforce the
- separation of modules from applications. [Don't panic! Apart from
- changing references of the form
-
- #include "pam_appl.h"
-
- to
-
- #include <security/pam_appl.h>
-
- The reorganization should be backwardly compatable (ie. a module
- written for SUN will be as compatable as it was before with the
- previous version ;)~ ]
-
- (All of the source in this tree now conforms to this scheme...)
-
- The new reorganization means that modules can be compiled with a
- single header, <security/pam_modules.h>, and applications with
- <security/pam_appl.h>.
-
-* I have tried to remove all the compiler warnings from the updated
- "pamlib/*.c" files. On my system, (with a slightly modified <dlfcn.h>
- email me if it interests you..) there are only two warnings that
- remain: they are that ansi does not permit void --> fn ptr
- assignment. K&Rv2 doesn't mention this....? As a matter of principle,
- if anyone knows how to get rid of that warning... please
- tell. Thanks! "-pedantic"
-
-* you can "make all" as a plain user, but
-
-* to "make install" you must be root. The include files are placed in
- /usr/include/security. The libpam.so library is installed in /usr/lib
- and the modules in /usr/lib/security. The two test binaries
- are installed in the Linux-PAM-0.2/bin directory and a chance is given to
- replace your /etc/pam.conf file with the one in Linux-PAM-0.2/conf.
-
-* I have included some documentation (pretty preliminary at the
-moment) which I have been working on in .../doc .
-
-I have had a little trouble with the modules, but atleast there are no
-segfaults! Please try it out and discuss your results... I actually
-hope it all works for you. But, Email any bugs/suggestions to the
-Linux-PAM list: linux-pam@mit.edu .....
-
-Regards,
-
-Andrew Morgan
-(morgan@physics.ucla.edu)
-
-
-Sat Feb 17 17:30:24 EST 1996 (Alexander O. Yuriev alex@bach.cis.temple.edu)
-
- * conf directory created with example of pam_conf
- * stable code from pam_unix is added to modules/pam_unix
- * test/test.c now requests username and password and attempts
- to perform authentication
-
diff --git a/contrib/libpam/Copyright b/contrib/libpam/Copyright
deleted file mode 100644
index 2f27a2ee0efd..000000000000
--- a/contrib/libpam/Copyright
+++ /dev/null
@@ -1,41 +0,0 @@
-Unless otherwise *explicitly* stated the following text describes the
-licensed conditions under which the contents of this Linux-PAM release
-may be distributed:
-
--------------------------------------------------------------------------
-Redistribution and use in source and binary forms of Linux-PAM, with
-or without modification, are permitted provided that the following
-conditions are met:
-
-1. Redistributions of source code must retain any existing copyright
- notice, and this entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-2. Redistributions in binary form must reproduce all prior and current
- copyright notices, this list of conditions, and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
-3. The name of any author may not be used to endorse or promote
- products derived from this software without their specific prior
- written permission.
-
-ALTERNATIVELY, this product may be distributed under the terms of the
-GNU General Public License, in which case the provisions of the GNU
-GPL are required INSTEAD OF the above restrictions. (This clause is
-necessary due to a potential conflict between the GNU GPL and the
-restrictions contained in a BSD-style copyright.)
-
-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(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.
--------------------------------------------------------------------------
-
diff --git a/contrib/libpam/FREEBSD-Xlist b/contrib/libpam/FREEBSD-Xlist
deleted file mode 100644
index 33110324f399..000000000000
--- a/contrib/libpam/FREEBSD-Xlist
+++ /dev/null
@@ -1,18 +0,0 @@
-*.a
-*.asc
-*.o
-*.so
-*.tar.gz
-*/.[a-zA-Z]*
-*/CONFIGURE_COMMAND
-*/bin/pam_conv1
-*/blank
-*/blank
-*/check_user
-*/check_user
-*/default.defs
-*/dynamic
-*/pam_conv1/pam_conv1
-*/upperLOWER/upperLOWER
-*/xsh
-*/xsh
diff --git a/contrib/libpam/FREEBSD-upgrade b/contrib/libpam/FREEBSD-upgrade
deleted file mode 100644
index 3f3b37938aca..000000000000
--- a/contrib/libpam/FREEBSD-upgrade
+++ /dev/null
@@ -1,9 +0,0 @@
-To strip down a new version of Linux PAM for import, extract
-the files like this:
-
- tar -xvzf pam-xxx.tar.gz -X FREEBSD-Xlist
-
-If you decide to bring in more of the files, import them -- don't
-use "cvs add". And please remember to adjust the contents of
-"FREEBSD-Xlist" so that it reflects what is really imported from
-the vendor.
diff --git a/contrib/libpam/Makefile b/contrib/libpam/Makefile
deleted file mode 100644
index d25f58bb570e..000000000000
--- a/contrib/libpam/Makefile
+++ /dev/null
@@ -1,282 +0,0 @@
-##
-## $Id: Makefile,v 1.31 1997/04/05 07:04:25 morgan Exp morgan $
-##
-## $Log: Makefile,v $
-##
-##
-
-# major and minor numbers of this release
-MAJOR_REL=0
-MINOR_REL=65
-DEBUG_REL=no
-#DEBUG_REL=yes
-
-# this should be the name of this directory
-RELNAME = Linux-PAM-$(MAJOR_REL).$(MINOR_REL)
-
-# this is the name of the archive file
-DISTFILE = $(RELNAME).tar.gz
-
-# define this to indicate to subdirectories that they are part of the
-# full source tree.
-FULL_LINUX_PAM_SOURCE_TREE=yes
-export FULL_LINUX_PAM_SOURCE_TREE
-
-DYNLOAD="dl"
-DYNTYPE="so"
-
-# Comment out either line to disable that type of linking for *modules only*
-# Both at once is a legal configuration!
-DYNAMIC=-DPAM_DYNAMIC
-#STATIC=-DPAM_STATIC
-
-# Comment out these lines to disable building dynamic/static libpam.*
-DYNAMIC_LIBPAM=yes
-#STATIC_LIBPAM=yes
-
-# All combinations of the above four variable definitions are legal,
-# however, not defining either dynamic or static modules and yet
-# creating a some flavor of LIBPAM will make an authentication library
-# that always fails!
-
-# Here we indicate which libraries are present on the local system
-# they control the building of some modules in this distribution
-# Note, these definitions are all "export"ed below...
-
-HAVE_PWDBLIB=no
-HAVE_CRACKLIB=no
-HAVE_AFSLIBS=no
-HAVE_KRBLIBS=no
-
-# NB. The following is the generic defines for compilation.
-# They can be overridden in the default.defs file below
-#
-WARNINGS = -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
- -Wpointer-arith -Wcast-qual -Wcast-align \
- -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
- -Wnested-externs -Winline -Wshadow -pedantic
-PIC=-fPIC
-
-# Mode to install shared libraries with
-SHLIBMODE=644
-
-#
-# Conditional defines..
-#
-
-ifdef DYNAMIC
-# need the dynamic library functions
-LIBDL=-l$(DYNLOAD)
-ifdef STATIC_LIBPAM
-# needed because pam_xxx() fn's are now in statically linked library
-RDYNAMIC = -rdynamic
-endif
-endif
-
-# Here we include the defines for the preferred operating system
-# these include things like CC, CFLAGS and destination directories
-# etc.. By default, this is a symbolic link to one of the .defs files
-# the .../defs/ directory. Please take a moment to check that you are
-# using the correct one.
-
-include default.defs
-
-# to turn on the fprintf(stderr, ..) debugging lines throughout the
-# distribution uncomment this line
-#EXTRAS += -DDEBUG
-
-# For serious memory allocation tracing uncomment the following
-#MEMORY_DEBUG=-DMEMORY_DEBUG
-
-#######################################################################
-# The pam_unix module in this file will not work on NIS based systems.#
-#######################################################################
-
-# ////////////////////////////////////////////////////
-# // You should not modify anything below this line //
-# ////////////////////////////////////////////////////
-
-# the sub-directories to make things in
-
-DIRS = modules libpam conf libpam_misc examples
-
-#
-# basic defines
-#
-
-INCLUDEDIR=-I$(shell pwd)/include
-PAMLIB=-L$(shell pwd)/libpam
-PAMMISCLIB=-L$(shell pwd)/libpam_misc
-ifeq ($(DEBUG_REL),yes)
- PAMLIB += -lpamd
- PAMMISCLIB += -lpamd_misc
-else
- PAMLIB += -lpam
- PAMMISCLIB += -lpam_misc
-endif
-
-
-# This is Linux-PAM and not a version from Sun etc..
-# [Note, this does not describe the operating system you are using
-# only that you are compiling the "Linux" (read FREE) implementation
-# of Pluggable Authentication Modules.
-EXTRAS += -DLINUX_PAM
-
-#
-# build composite defines
-#
-
-LOADLIBES = $(PAMLIB) $(RDYNAMIC) $(PAMMISCLIB) $(LIBDL) $(ULIBS)
-
-CFLAGS += $(EXTRAS) $(MEMORY_DEBUG) $(WARNINGS) $(INCLUDEDIR) $(PIC)
-ifneq ($(strip $(OS)),)
-CFLAGS += -D$(OS)
-endif
-ifneq ($(strip $(ARCH)),)
-CFLAGS += -D$(ARCH)
-endif
-
-#
-# export the libraries-available info; the modules should know how
-# to deal with this...
-#
-export HAVE_PWDBLIB
-export HAVE_CRACKLIB
-export HAVE_AFSLIBS
-export HAVE_KRBLIBS
-
-#
-# generic exports
-#
-export MAJOR_REL # the major release of this distribution
-export MINOR_REL # the minor release of this distribution
-export DEBUG_REL # for installing a debugging version of PAM
-export OS # operating system
-export ARCH # architecture
-export CC # the C compiler
-export INSTALL # to do instalations with
-export MKDIR # to ensure directories exist
-export CFLAGS # CC flags used to compile everything
-export LD_D # build a shared object file (module)
-export LD_L # build a shared library (e.g. libpam)
-export USESONAME # does shlib link command require soname option
-export SOSWITCH # shlib lib soname switch name
-export NEEDSONAME # does shared library link need versioned lib
-export LD # build a generic library
-export LDCONFIG # rebuild the shared libraries
-export AR # build a static library
-export RANLIB # reorder a static library
-export LOADLIBES # libraries needed for application linking
-export PAMLIB # where to find the local libpam.xx file
-export DYNTYPE # which suffix is used for libraries
-export SHLIBMODE # file mode for shared objects
-#
-# where to install things
-#
-export FAKEROOT # for package maintainers
-#
-export PREFIX # basic prefix for all other directories
-export SUPLEMENTED # where to store module helper binaries
-export LIBDIR # where libpam and libpam_misc go
-export SECUREDIR # where the modules will be placed
-export INCLUDED # where to store pam---.h files
-export CONFIGED # where pam.conf and pam.d/ go
-export SCONFIGED # where modules' config files go
-
-#
-# Conditional exporting ( ... these go on for a while... )
-#
-ifdef DYNAMIC
-export DYNAMIC
-endif
-ifdef STATIC
-export STATIC
-endif
-ifdef DYNAMIC_LIBPAM
-export DYNAMIC_LIBPAM
-endif
-ifdef STATIC_LIBPAM
-export STATIC_LIBPAM
-endif
-ifdef MEMORY_DEBUG
-export MEMORY_DEBUG
-endif
-
-##
-## the rules
-##
-
-all: .freezemake
- @for i in $(DIRS) ; do \
- $(MAKE) -C $$i all ; \
- if [ $$? -ne 0 ]; then break ; fi ; \
- done
-
-.freezemake:
-# Do nothing
-
-.old_freezemake: Makefile
- @touch .freezemake
- @echo "*WARNING*: If you are running a system that is dependent"
- @echo " on PAM to work. DO NOT make sterile NOR make remove."
- @echo " These options will delete the PAM files on your system"
- @echo " and make it unusable!"
- @echo ""
- @echo "If you are in any doubt, just do 'make all' (or just"
- @echo "'make'). It is likely that this is the SAFEST thing to do...."
- @exit 1
-
-install:
- @for i in $(DIRS) ; do \
- $(MAKE) -C $$i install ; \
- if [ $$? -ne 0 ]; then break ; fi ; \
- done
- install ./doc/man/*.3 $(PREFIX)/man/man3/
- install ./doc/man/*.8 $(PREFIX)/man/man8/
-
-sterile: .freezemake
- @$(MAKE) remove
- @$(MAKE) extraclean
-
-remove: .freezemake
- @for i in $(DIRS) ; do \
- $(MAKE) -C $$i remove ; \
- done
-
-clean:
- @rm -f *~ core
- @for i in $(DIRS) ; do \
- $(MAKE) -C $$i clean ; \
- done
-
-extraclean:
- @for i in $(DIRS) doc; do \
- $(MAKE) -C $$i extraclean ; \
- done
-
-check:
- @$(MAKE) -C conf check
-
-RCScheck:
- @$(MAKE) -C conf RCScheck
-
-# this can be used to see what hasn't been check'd into RCS
-
-open:
- @find . \( -type f -a -perm 644 \) -print
-
-release:
- @egrep '^DEBUG\_REL\=yes' Makefile|grep -v grep > /dev/null ;\
- if [ $$? -eq 0 ]; then \
- echo "You should first set DEBUG_REL to no" ; exit 1 ; fi
- $(MAKE) extraclean
- rm -f .freezemake
- touch .filelist .RCSlist
- chmod 600 .filelist .RCSlist
- cd .. ; find $(RELNAME) \! -type d -print | fgrep -v RCS | fgrep -v 'conf/.md5sum' > $(RELNAME)/.filelist
- cd .. ; find $(RELNAME) -type f -print | fgrep RCS | fgrep -v 'conf/.RCSsum' > $(RELNAME)/.RCSlist
- chmod 400 .filelist .RCSlist
- $(MAKE) check
- $(MAKE) RCScheck
- (cat .filelist ; echo $(RELNAME)/conf/.md5sum) | (cd .. ; tar -cz -f$(DISTFILE) -T-)
- (cat .RCSlist ; echo $(RELNAME)/conf/.RCSsum) | (cd .. ; tar -cz -fRCS+$(DISTFILE) -T-)
diff --git a/contrib/libpam/README b/contrib/libpam/README
deleted file mode 100644
index 78a428ef46d3..000000000000
--- a/contrib/libpam/README
+++ /dev/null
@@ -1,167 +0,0 @@
-#
-# $Id: README,v 1.14 1997/04/05 07:04:46 morgan Exp $
-#
-
-Hello!
-
-Thanks for downloading Linux-PAM-0.65.
-
---------------------------------------------------------------------
-Before you begin:
-
- * This distribution requires GNU's Make
- * It requires GNU's C-compiler: gcc (and 'ld')
- * it also requires the GNU shell: bash
- * some of the modules require the presence of libpwdb see redhat
- * two modules have some need for libcrack too..
-
---------------------------------------------------------------------
-[
-Zeroth (optional) thing to do: check the detatched "pgp" signature for
-this distribution file, it should be signed by
-
-Type Bits/KeyID Date User ID
-pub 1024/2A398175 1996/11/17 Andrew G. Morgan <morgan@linux.kernel.org>
-]
-
-First thing to do (I assume you have successfully unpacked it!) is to
-run:
-
- make check [ requires md5sum to be present ]
-
-This will also check that the distribution has arrived intact. [
-Later, If you change some things, running this command from this
-directory will show you what files you have altered. ]
-
-If you choose to get and install the RCS files that accompany this
-release, you may also run
-
- make RCScheck
-
-from this directory.
-
-Next, you should check the symbolic link
-
- .../Linux-PAM-X.YY/default.defs
-
-points to the file that best describes your system. The various *.defs
-files that are included in this distribution are to be found in the
-directory:
-
- .../Linux-PAM-X.YY/defs/
-
-This should configure the distribution to compile on your system. The
-default is the version I use for maintaining the distribution. [If you
-don't find one that suits your needs, please try to create one, email
-it to me and I will include it in a future release.]
-
-If you are running an ELF based Linux system you should be able to
-compile the distribution straight from the box. If you are running an
-a.out based system, then some of the functionality of Linux-PAM will
-be unavailable to you. Instead, you must switch the DYNAMIC variables
-*off* in your "defs" file: comment out the DYNAMIC and DYNAMIC_LIBPAM
-defines and uncomment the STATIC and STATIC_LIBPAM defines. NOTE, for
-ELF based systems, almost any combination of these four definitions is
-legal... If you have ELF, I recommend the default however.
-
-Second, try to compile it. Use the following command in *this*
-directory:
-
- make
-
-[ or 'make all' if you prefer ]. The first time you type make, it is
-likely to complain. This is to remind you to remove any libraries from
-previous versions of the distribution that are likely to confuse this
-make... Type 'make' again.
-
-Before you do the third thing. You should think about whether you want
-the default configuration scripts to be installed or not. If you have
-a working PAM based system you probably do *not* want this.. Whatever,
-before Linux-PAM installs the default scripts you will be prompted as
-to whether it is a good idea. Be sure to say NO if you are worried!
-** You have been warned. **
-
-Third, to install the stuff you need to be root. Do the following:
-
- su -c "make install"
-
-If everything has worked as intended there should now be
-
- some executables in ./bin/
- some filters for pam_filter in /usr/sbin/pam_filter/
- some configuration files:
- /etc/pam.conf
- /etc/security/*.conf
- libpam_misc.a (static library) in /usr/lib/
-
-In addition:
-
- if dynamically linked:
-
- libpam.so.XXX (shared library) in /usr/lib/
- libpam_misc.so.XXX (shared library) in /usr/lib/
- pam_*.so (modules) in /usr/lib/security/
-
- if statically linked:
-
- libpam.a (static library) in /usr/lib/
-
-[These are the default directories that I use. Your own system may
-differ as specified in your XXX.defs file.]
-
-NOTES:
-
-* The documentation, what there is of it, is in ./doc. I am only
-including the sgml format source-files. But try to make .ps files
-available from the above http address. To locally use these sgml files
-you should have linuxdoc-sgml installed. Sorry, but I'm conserving net
-bandwidth by only including sources!
-
-* The source for each module is to be found in ./modules/XXX. If you
-want to add a new one, make a directory like XXX for it. Add the name
-(XXX) to MODDIRS in ./modules/Makefile and hopefully it will become
-part of the overall make. Note, the Makefile in ./modules/ is now
-smart enough to check if the directory is there before it changes into
-it; If you want to start working on a module, send me its name and I
-will add it to the "official" Makefile.. This way, you should be able
-to insert your developing module into any new release, and not have to
-worry at first about letting it out to the public. This may also give
-other people some idea about whether a module is currently being
-worked on or not.
-
-* Currently, you have to 'make' binaries from this directory. 'make
-clean', however, works in any directory that has a Makefile.
-
-* Also, you can 'make remove' (as root) from *this* directory and it
-will delete the various installed files dotted around the system. THIS
-IS A VERY BAD IDEA IF YOUR SYSTEM DEPENDS ON PAM TO WORK!!!
-
-* 'make sterile' does 'make remove' and then 'make extraclean', this
-might be required if you are alternating your choice of
-STATIC(_LIBPAM) and DYNAMIC(_LIBPAM) compilation. SEE COMMENT IN
-UPPERCASE IN PARAGRAPH ABOVE!!!!
-
-Best wishes
-
-Andrew Morgan
-
-Email bugs/comments to: the Linux-PAM list <pam-list@redhat.com>
-or me <morgan@linux.kernel.org>
-
-To see about joining the mailing list, send the following email:
---------------------------------
-To: pam-list-request@redhat.com
-Subject: help
-<empty text>
---------------------------------
-
-Additionally, some Linux-PAM files have been known to be found at one
-or more of the following places (they are not always the most up to
-date...):
-
-http://www.redhat.com/linux-info/pam/
-
-ftp://bach.cis.temple.edu/pub/People/Alex/private/PAM
-ftp://ftp.redhat.com/pub/misc/
-ftp://linux.nrao.edu/pub/linux/ALPHA/PAM/
-ftp://tsx-11.mit.edu/pub/linux/ALPHA/PAM/
diff --git a/contrib/libpam/TODO b/contrib/libpam/TODO
deleted file mode 100644
index 5ed6acb7a26d..000000000000
--- a/contrib/libpam/TODO
+++ /dev/null
@@ -1,59 +0,0 @@
-$Id: TODO,v 1.10 1997/02/15 19:30:51 morgan Exp morgan $
-
-Here are some things to think about if you are interested in
-contributing to the Linux-PAM effort.
-
-1. If you have a suggestion mail the pam-list!
-
-2. TODO: Comments
- ----- --------
-
- [modules]
-
-pam_time should log an error if it denies access.
-
-pam_smartcard?? It has already started to happen. (Alex Yuriev has a
- smart-card module...)
-
-pam_floppy?? A alternative login mechanism might involve
- authenticating with a personal specially
- formatted floppy!? (got to make some use of
- all those strange Linux incompatible floppies
- I keep getting from ISPs ;^)
-
-pam_??? If you are interested in another type of
- authentication method--just make a module!
- If you want it registered/some help, email the
- list.
-
- [misc]
-
-SVGA & X-conv Currently, libpam-misc contains a text-only
- conversation function. A graphical one,
- for X or SVGA would be very welcome,
- [Ben Buxton is working on an X one (as of
- 1996/12/1)] applications like xlock
- etc.. would benefit from this.
-
-
-Issues that need to be resolved:
---------------------------------
-
-- can we support the use_mapped_pass flag without running into problems
- with ITAR rules? [this problem is likely to mutate. The DCE-RFC
- people are considering the addition of a mapping module type - one
- that other modules can use to safely store passwords...]
-
- - anyone know where someone to email for FREE legal advice/support?
-
------------
-Comments to <pam-list@redhat.com>
-(administrative requests to <pam-list-request@redhat.com> use
-
- Subject: help
- <empty_message>
-
-)
------------
-Andrew Morgan <morgan@linux.kernel.org>.
-http://linux.kernel.org/pub/linux/libs/pam/index.html
diff --git a/contrib/libpam/doc/CREDITS b/contrib/libpam/doc/CREDITS
deleted file mode 100644
index 95ca2ab36e02..000000000000
--- a/contrib/libpam/doc/CREDITS
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- an sgml list of people to credit for their contributions to Linux-PAM
- $Id: CREDITS,v 1.4 1997/04/05 06:47:26 morgan Exp morgan $
- -->
-Peter Allgeyer,
-Tim Baverstock,
-Craig S. Bell,
-Derrick J. Brashear,
-Ben Buxton,
-Oliver Crow,
-Chris Dent,
-Marc Ewing,
-Cristian Gafton,
-Eric Hester,
-Roger Hu,
-Eric Jacksch,
-Michael K. Johnson,
-David Kinchlea,
-Nicolai Langfeldt,
-Elliot Lee,
-Al Longyear,
-Ingo Luetkebohle,
-Marek Michalkiewicz,
-Aleph One,
-Martin Pool,
-Sean Reifschneider,
-Erik Troan,
-Theodore Ts'o,
-Jeff Uphoff,
-Myles Uyema,
-Savochkin Andrey Vladimirovich,
-Ronald Wahl,
-David Wood,
-John Wilmes,
-Joseph S. D. Yao
-and
-Alex O. Yuriev.
diff --git a/contrib/libpam/doc/Makefile b/contrib/libpam/doc/Makefile
deleted file mode 100644
index 866b408512df..000000000000
--- a/contrib/libpam/doc/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-
-### $Id: Makefile,v 1.9 1997/01/04 21:55:52 morgan Exp $
-
-TXTER=sgml2txt
-HTMLER=sgml2html
-# older distributions use, sgml2ps
-PSER=sgml2latex -p
-
-FILES=pam pam_appl pam_modules
-FSRCS=pam.sgml pam_appl.sgml pam_modules.sgml
-
-TEXTS=txts/pam.txt txts/pam_appl.txt txts/pam_modules.txt
-HTMLS=html/pam.html html/pam_appl.html html/pam_modules.html
-PSFILES=ps/pam.ps ps/pam_appl.ps ps/pam_modules.ps
-
-MODULES=$(shell ls modules/*.sgml)
-
-#######################################################
-
-dummy:
- @echo "Making the documentation..."
- @make all
-
-all: htmls texts postscript
-
-htmls: $(HTMLS)
-
-$(HTMLS) : $(FSRCS)
- @for i in $(FILES) ; do \
- if [ ! -f "html/$$i.html" ] || [ "$$i.sgml" -nt "html/$$i.html" ]; \
- then \
- cd html ; $(HTMLER) ../$$i ; \
- if [ $$? -ne 0 ]; then exit 1 ; fi ; \
- cd .. ; \
- fi ; \
- done
-
-texts: $(TEXTS)
-
-$(TEXTS) : $(FSRCS)
- @for i in $(FILES) ; do \
- if [ ! -f "txts/$$i.txt" ] \
- || [ "$$i.sgml" -nt "txts/$$i.txt" ]; then \
- cd txts ; $(TXTER) ../$$i ; cd .. ; \
- fi ; \
- done
-
-postscript: $(PSFILES)
-
-$(PSFILES): $(FSRCS)
- @for i in $(FILES) ; do \
- if [ ! -f "ps/$$i.ps" ] || [ "$$i.sgml" -nt "ps/$$i.ps" ]; then \
- cd ps ; $(PSER) ../$$i ; cd .. ; \
- fi ; \
- done
-
-pam.sgml: pam_source.sgml MODULES-SGML
- @sed -e '/^<!\-\- insert\-file MODULES\-SGML \-\->/r MODULES-SGML' pam_source.sgml > pam.sgml
-
-MODULES-SGML: $(MODULES)
- @echo 'Building module text from files in modules/*.sgml'
- @rm -f MODULES-SGML
- @echo '<!-- modules included:' > MODULES-SGML
- @ls modules/*.sgml >> MODULES-SGML
- @echo ' and that is all -->' >> MODULES-SGML
- @cat modules/*.sgml >> MODULES-SGML
-
-extraclean: clean
-
-clean:
- rm -f *~ *.bak
- rm -f html/pam*.html
- rm -f man/*~
- rm -f $(TEXTS)
- rm -f $(PSFILES)
- rm -f MODULES-SGML pam.sgml
-
diff --git a/contrib/libpam/doc/NOTES b/contrib/libpam/doc/NOTES
deleted file mode 100644
index b0f40d47d59f..000000000000
--- a/contrib/libpam/doc/NOTES
+++ /dev/null
@@ -1,16 +0,0 @@
-Things to be added:
-
-@ modules:
-@ application:
-
- use of
- 'user' = user to become,
- 'uid' = user requesting service
- 'euid' = privilege of current process.
-
-@ sysadmin:
-
- included modules:
- behavior
- non-included modules:
- behavior/pointers.
diff --git a/contrib/libpam/doc/figs/pam_orient.txt b/contrib/libpam/doc/figs/pam_orient.txt
deleted file mode 100644
index a8b745a1628b..000000000000
--- a/contrib/libpam/doc/figs/pam_orient.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- +----------------+
- | application: X |
- +----------------+ / +----------+ +================+
- | authentication-[---->--\--] Linux- |--<--| /etc/pam.conf |
- | + [----<--/--] PAM | |================|
- |[conversation()][--+ \ | | | X auth .. a.so |
- +----------------+ | / +-n--n-----+ | X auth .. b.so |
- | | | __| | | _____/
- | service user | A | | |____,-----'
- | | | V A
- +----------------+ +------|-----|---------+ -----+------+
- +---u-----u----+ | | |
- | auth.... |--[ a ]--[ b ]--[ c ]
- +--------------+
- | acct.... |--[ b ]--[ d ]
- +--------------+
- | password |--[ b ]--[ c ]
- +--------------+
- | session |--[ e ]--[ c ]
- +--------------+ \ No newline at end of file
diff --git a/contrib/libpam/doc/html/index.html b/contrib/libpam/doc/html/index.html
deleted file mode 100644
index 91f990fc01e0..000000000000
--- a/contrib/libpam/doc/html/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-<HTML>
-<HEAD>
-<TITLE>Linux-PAM - Pluggable Authentication Modules for Linux</TITLE>
-</HEAD>
-<BODY>
-
-<p>
-Here is the documentation for Linux-PAM. As you will see it is
-currently not complete. However, in order of decreasing length:
-
-<ul>
-<li> <a href="pam.html">The System Administrators' Guide</a>
-<li> <a href="pam_modules.html">The Module Writers' Manual</a>
-<li> <a href="pam_appl.html">The Application developers' Manual</a>
-</ul>
-
-<hr>
-<p>
-REVISION: <tt>$Id: index.html,v 1.4 1996/11/21 06:51:01 morgan Exp $</tt>
-</BODY>
diff --git a/contrib/libpam/doc/man/pam.8 b/contrib/libpam/doc/man/pam.8
deleted file mode 100644
index b60be4d6337a..000000000000
--- a/contrib/libpam/doc/man/pam.8
+++ /dev/null
@@ -1,273 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam.8,v 1.2 1997/02/15 18:37:27 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1996-7 <morgan@linux.kernel.org>
-.TH PAM 8 "1997 Feb 9" "PAM 0.56" "PAM Manual"
-.SH NAME
-
-PAM \- Pluggable Authentication Modules
-
-.SH SYNOPSIS
-.B /etc/pam.conf
-.sp 2
-.SH DESCRIPTION
-
-This manual is intended to offer a quick introduction to
-.BR PAM ". "
-For more information the reader is directed to the
-.BR "Linux-PAM system administrators' guide".
-
-.sp
-.BR PAM
-Is a system of libraries that handle the authentication tasks of
-applications (services) on the system. The library provides a stable
-general interface (Application Programming Interface - API) that
-privilege granting programs (such as
-.BR login "(1) "
-and
-.BR su "(1)) "
-defer to to perform standard authentication tasks.
-
-.sp
-The principal feature of the PAM approach is that the nature of the
-authentication is dynamically configurable. In other words, the
-system administrator is free to choose how individual
-service-providing applications will authenticate users. This dynamic
-configuration is set by the contents of the single
-.BR PAM
-configuration file
-.BR /etc/pam.conf "."
-Alternatively, the configuration can be set by individual
-configuration files located in the
-.B /etc/pam.d/
-directory.
-.IB "The presence of this directory will cause " PAM " to ignore"
-.BI /etc/pam.conf "."
-
-.sp
-From the point of view of the system administrator, for whom this
-manual is provided, it is not of primary importance to understand the
-internal behavior of the
-.BR PAM
-library. The important point to recognize is that the configuration
-file(s)
-.I define
-the connection between applications
-.BR "" "(" services ")"
-and the pluggable authentication modules
-.BR "" "(" PAM "s)"
-that perform the actual authentication tasks.
-
-.sp
-.BR PAM
-separates the tasks of
-.I authentication
-into four independent management groups:
-.BR "account" " management; "
-.BR "auth" "entication management; "
-.BR "password" " management; "
-and
-.BR "session" " management."
-(We highlight the abbreviations used for these groups in the
-configuration file.)
-
-.sp
-Simply put, these groups take care of different aspects of a typical
-user's request for a restricted service:
-
-.sp
-.BR account " - "
-provide account verification types of service: has the user's password
-expired?; is this user permitted access to the requested service?
-
-.br
-.BR auth "entication - "
-establish the user is who they claim to be. Typically this is via some
-challenge-response request that the user must satisfy: if you are who
-you claim to be please enter your password. Not all authentications
-are of this type, there exist hardware based authentication schemes
-(such as the use of smart-cards and biometric devices), with suitable
-modules, these may be substituted seamlessly for more standard
-approaches to authentication - such is the flexibility of
-.BR PAM "."
-
-.br
-.BR password " - "
-this group's responsibility is the task of updating authentication
-mechanisms. Typically, such services are strongly coupled to those of
-the
-.BR auth
-group. Some authentication mechanisms lend themselves well to being
-updated with such a function. Standard UN*X password-based access is
-the obvious example: please enter a replacement password.
-
-.br
-.BR session " - "
-this group of tasks cover things that should be done prior to a
-service being given and after it is withdrawn. Such tasks include the
-maintenance of audit trails and the mounting of the user's home
-directory. The
-.BR session
-management group is important as it provides both an opening and
-closing hook for modules to affect the services available to a user.
-
-.SH The configuration file(s)
-
-When a
-.BR PAM
-aware privilege granting application is started, it activates its
-attachment to the PAM-API. This activation performs a number of
-tasks, the most important being the reading of the configuration file(s):
-.BR /etc/pam.conf "."
-Alternatively, this may be the contents of the
-.BR /etc/pam.d/
-directory.
-
-These files list the
-.BR PAM "s"
-that will do the authentication tasks required by this service, and
-the appropriate behavior of the PAM-API in the event that individual
-.BR PAM "s "
-fail.
-
-.sp
-The syntax of the
-.B /etc/pam.conf
-configuration file is as follows. The file is made
-up of a list of rules, each rule is typically placed on a single line,
-but may be extended with an escaped end of line: `\\<LF>'. Comments
-are preceded with `#' marks and extend to the next end of line.
-
-.sp
-The format of each rule is a space separated collection of tokens, the
-first three being case-insensitive:
-
-.sp
-.br
-.BR " service type control module-path module-arguments"
-
-.sp
-The syntax of files contained in the
-.B /etc/pam.d/
-directory, are identical except for the absence of any
-.I service
-field. In this case, the
-.I service
-is the name of the file in the
-.B /etc/pam.d/
-directory. This filename must be in lower case.
-
-.sp
-An important feature of
-.BR PAM ", "
-is that a number of rules may be
-.I stacked
-to combine the services of a number of PAMs for a given authentication
-task.
-
-.sp
-The
-.BR service
-is typically the familiar name of the corresponding application:
-.BR login
-and
-.BR su
-are good examples. The
-.BR service "-name, " other ", "
-is reserved for giving
-.I default
-rules. Only lines that mention the current service (or in the absence
-of such, the
-.BR other
-entries) will be associated with the given service-application.
-
-.sp
-The
-.BR type
-is the management group that the rule corresponds to. It is used to
-specify which of the management groups the subsequent module is to
-be associated with. Valid entries are:
-.BR account "; "
-.BR auth "; "
-.BR password "; "
-and
-.BR session "."
-The meaning of each of these tokens was explained above.
-
-.sp
-The third field,
-.BR control ", "
-indicates the behavior of the PAM-API should the module fail to
-succeed in its authentication task. Valid
-.BR control
-values are:
-.BR requisite
-- failure of such a PAM results in the immediate termination of the
-authentication process;
-.BR required
-- failure of such a PAM will ultimately lead to the PAM-API returning
-failure but only after the remaining
-.I stacked
-modules (for this
-.BR service
-and
-.BR type ")"
-have been invoked;
-.BR sufficient
-- success of such a module is enough to satisfy the authentication
-requirements of the stack of modules (if a prior
-.BR required
-module has failed the success of this one is
-.IR ignored "); "
-.BR optional
-- the success or failure of this module is only important if it is the
-only module in the stack associated with this
-.BR service "+" type "."
-
-.sp
-.BR module-path
-- this is the full filename of the PAM to be used by the application
-
-.sp
-.BR module-arguments
-- these are a space separated list of tokens that can be used to
-modify the specific behavior of the given PAM. Such arguments will be
-documented for each individual module.
-
-.SH "FILES"
-.BR /etc/pam.conf " - the configuration file"
-.br
-.BR /etc/pam.d/ " - the"
-.BR PAM
-configuration directory. If this directory is present, the
-.B /etc/pam.conf
-file is ignored.
-.br
-.BR /usr/lib/libpam.so.X " - the dynamic library"
-.br
-.BR /usr/lib/pam_*.so " - the PAMs
-
-.SH ERRORS
-Typically errors generated by the
-.BR PAM
-system of libraries, will be written to
-.BR syslog "(3)."
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-.br
-Contains additional features, currently under consideration by the
-DCE-RFC committee.
-
-.SH BUGS
-.sp 2
-None known.
-
-.SH "SEE ALSO"
-
-The three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam.conf.8 b/contrib/libpam/doc/man/pam.conf.8
deleted file mode 100644
index ea2dd98bfc9f..000000000000
--- a/contrib/libpam/doc/man/pam.conf.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/pam.8
diff --git a/contrib/libpam/doc/man/pam.d.8 b/contrib/libpam/doc/man/pam.d.8
deleted file mode 100644
index ea2dd98bfc9f..000000000000
--- a/contrib/libpam/doc/man/pam.d.8
+++ /dev/null
@@ -1 +0,0 @@
-.so man8/pam.8
diff --git a/contrib/libpam/doc/man/pam_authenticate.3 b/contrib/libpam/doc/man/pam_authenticate.3
deleted file mode 100644
index 1baffc9b4333..000000000000
--- a/contrib/libpam/doc/man/pam_authenticate.3
+++ /dev/null
@@ -1,91 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_authenticate.3,v 1.2 1997/02/15 18:39:59 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1996-7 <morgan@parc.power.net>
-.TH PAM_AUTHENTICATE 3 "1996 Dec 9" "PAM 0.55" "App. Programmers' Manual"
-.SH NAME
-
-pam_authenticate \- authenticate a user
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.sp
-.BI "int pam_authenticate(pam_handle_t " *pamh ", int " flags ");"
-.sp 2
-.SH DESCRIPTION
-.B pam_authenticate
-
-.br
-Use this function to authenticate an applicant user. It is linked
-.I dynamically
-to the authentication modules by
-.BR PAM ". "
-It is the task of these module to perform such an authentication. The
-specific nature of the authentication is not the concern of the
-application.
-
-.br
-Following successful completion, the
-.BR name
-of the authenticated user will be present in the
-.BR PAM
-item
-.BR PAM_USER ". "
-This item may be recovered with a call to
-.BR pam_get_item "(3)."
-
-.br
-The application developer should note that the modules may request
-that the user enter their username via the conversation mechanism (see
-.BR pam_start "(3))."
-Should this be the case, the user-prompt string can be set via
-the
-.BR PAM_USER_PROMPT
-item (see
-.BR pam_set_item "(3))."
-
-.SH "RETURN VALUE"
-On success
-.BR PAM_SUCCESS
-is returned. All other returns should be considered
-authentication failures and will be
-.I delayed
-by an amount specified with prior calls to
-.BR pam_fail_delay "(3). "
-Specific failures that demand special attention are the following:
-.TP
-.B PAM_ABORT
-the application should exit immediately. Of course,
-.BR pam_end "(3)"
-should be called first.
-
-.TP
-.B PAM_MAXTRIES
-the application has tried too many times to authenticate the
-user, authentication should not be attempted again.
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_start "(3), "
-.BR pam_get_item "(3) "
-.BR pam_fail_delay "(3) "
-and
-.BR pam_strerror "(3). "
-
-Also, see the three
-.BR PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_chauthtok.3 b/contrib/libpam/doc/man/pam_chauthtok.3
deleted file mode 100644
index 8ccf55d4dca2..000000000000
--- a/contrib/libpam/doc/man/pam_chauthtok.3
+++ /dev/null
@@ -1,101 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_chauthtok.3,v 1.2 1997/02/15 18:42:23 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
-.TH PAM_CHAUTHTOK 3 "1997 Jan 4" "PAM 0.55" "App. Programmers' Manual"
-.SH NAME
-
-pam_chauthtok \- updating authentication tokens
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.sp
-.BI "int pam_chauthtok(pam_handle_t " *pamh ", int " flags ");"
-.sp 2
-.SH DESCRIPTION
-.B pam_chauthtok
-
-.br
-Use this function to rejuvenate the authentication tokens (passwords
-etc.) of an applicant user.
-
-.br
-Note, the application should not pre-authenticate the user, as this is
-performed (if required) by the
-.BR PAM
-framework.
-
-.br
-The
-.I flags
-argument can
-.I optionally
-take the value,
-.BR PAM_CHANGE_EXPIRED_AUTHTOK "."
-In such cases the framework is only required to update those
-authentication tokens that have expired. Without this argument, the
-framework will attempt to obtain new tokens for all configured
-authentication mechanisms. The details of the types and number of such
-schemes should not concern the calling application.
-
-.SH RETURN VALUE
-A successful return from this function will be indicated with
-.BR PAM_SUCCESS "."
-
-.br
-Specific errors of special interest when calling this function are
-
-.br
-.BR PAM_AUTHTOK_ERROR
-- a valid new token was not obtained
-
-.br
-.BR PAM_AUTHTOK_RECOVERY_ERR
-- old authentication token was not available
-
-.br
-.BR PAM_AUTHTOK_LOCK_BUSY
-- a resource needed to update the token was locked (try again later)
-
-.br
-.BR PAM_AUTHTOK_DISABLE_AGING
-- one or more of the authentication modules does not honor
-authentication token aging
-
-.br
-.BR PAM_TRY_AGAIN
-- one or more authentication mechanism is not prepared to update a
-token at this time
-
-.br
-In general other return values may be returned. They should be treated
-as indicating failure.
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_start "(3), "
-.BR pam_authenticate "(3), "
-.BR pam_setcred "(3), "
-.BR pam_get_item "(3), "
-.BR pam_strerror "(3) "
-and
-.BR pam "(8)."
-
-.br
-Also, see the three
-.BR PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_close_session.3 b/contrib/libpam/doc/man/pam_close_session.3
deleted file mode 100644
index c809a0e4f0d8..000000000000
--- a/contrib/libpam/doc/man/pam_close_session.3
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/pam_open_session.3
diff --git a/contrib/libpam/doc/man/pam_end.3 b/contrib/libpam/doc/man/pam_end.3
deleted file mode 100644
index 06fdabb9c462..000000000000
--- a/contrib/libpam/doc/man/pam_end.3
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/pam_start.3
diff --git a/contrib/libpam/doc/man/pam_fail_delay.3 b/contrib/libpam/doc/man/pam_fail_delay.3
deleted file mode 100644
index b2b57acf3344..000000000000
--- a/contrib/libpam/doc/man/pam_fail_delay.3
+++ /dev/null
@@ -1,130 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_fail_delay.3,v 1.2 1997/02/15 18:47:46 morgan Exp morgan $
-.\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
-.TH PAM_FAIL_DELAY 3 "1997 Jan 12" "PAM 0.56" "Programmers' Manual"
-.SH NAME
-
-pam_fail_delay \- request a delay on failure
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.br
-or,
-.br
-.B #include <security/pam_modules.h>
-.sp
-.BI "int pam_fail_delay(pam_handle_t " "*pamh" ", unsigned int " "usec" ");"
-.sp 2
-.SH DESCRIPTION
-.br
-It is often possible to attack an authentication scheme by exploiting
-the time it takes the scheme to deny access to an applicant user. In
-cases of
-.I short
-timeouts, it may prove possible to attempt a
-.I brute force
-dictionary attack -- with an automated process, the attacker tries all
-possible passwords to gain access to the system. In other cases,
-where individual failures can take measurable amounts of time
-(indicating the nature of the failure), an attacker can obtain useful
-information about the authentication process. These latter attacks
-make use of procedural delays that constitute a
-.I covert channel
-of useful information.
-
-.br
-To minimize the effectiveness of such attacks, it is desirable to
-introduce a random delay in a failed authentication process.
-.B PAM
-provides such a facility. The delay occurs upon failure of the
-.BR pam_authenticate "(3) "
-and
-.BR pam_chauthtok "(3) "
-functions. It occurs
-.I after
-all authentication modules have been called, but
-.I before
-control is returned to the service application.
-
-.br
-The function,
-.BR pam_fail_delay "(3),"
-is used to specify a required minimum for the length of the
-failure-delay; the
-.I usec
-argument. This function can be called by the service application
-and/or the authentication modules, both may have an interest in
-delaying a reapplication for service by the user. The length of the
-delay is computed at the time it is required. Its length is
-pseudo-gausianly distributed about the
-.I maximum
-requested value; the resultant delay will differ by as much as 25% of
-this maximum requested value (both up and down).
-
-.br
-On return from
-.BR pam_authenticate "(3) or " pam_chauthtok "(3),"
-independent of success or failure, the new requested delay is reset to
-its default value: zero.
-
-.SH EXAMPLE
-.br
-For example, a
-.B login
-application may require a failure delay of roughly 3 seconds. It will
-contain the following code:
-.sp
-.br
-.B " pam_fail_delay(pamh, 3000000 /* micro-seconds */ );"
-.br
-.B " pam_authenticate(pamh, 0);"
-.sp
-.br
-if the modules do not request a delay, the failure delay will be
-between 2.25 and 3.75 seconds.
-
-.br
-However, the modules, invoked in the authentication process, may
-also request delays:
-.sp
-.br
-.RB " (module #1) " "pam_fail_delay(pamh, 2000000);"
-.sp
-.br
-.RB " (module #2) " "pam_fail_delay(pamh, 4000000);"
-.sp
-.br
-in this case, it is the largest requested value that is used to
-compute the actual failed delay: here between 3 and 5 seconds.
-
-.SH "RETURN VALUE"
-Following a successful call to
-.BR pam_fail_delay "(3), " PAM_SUCCESS
-is returned. All other returns should be considered serious failures.
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-Under consideration by the X/Open group for future inclusion in the
-PAM RFC. 1996/1/10
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_start "(3), "
-.BR pam_get_item "(3) "
-and
-.BR pam_strerror "(3). "
-
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_open_session.3 b/contrib/libpam/doc/man/pam_open_session.3
deleted file mode 100644
index 79a219082649..000000000000
--- a/contrib/libpam/doc/man/pam_open_session.3
+++ /dev/null
@@ -1,99 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_open_session.3,v 1.2 1997/02/15 18:49:02 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
-.TH PAM_OPEN_SESSION 3 "1997 Jan 4" "PAM 0.55" "App. Programmers' Manual"
-.SH NAME
-
-pam_open/close_session \- PAM session management
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.sp
-.BI "int pam_open_session(pam_handle_t " *pamh ", int " flags ");"
-.sp
-.BI "int pam_close_session(pam_handle_t " *pamh ", int " flags ");"
-.sp 2
-.SH DESCRIPTION
-
-PAM provides management-hooks for the initialization and termination
-of a session.
-
-.TP
-.B pam_open_session
-.br
-Use this function to signal that an authenticated user session has
-begun. It should be called only after the user is properly identified
-and (where necessary) has been granted their credentials with
-.BR pam_authenticate "(3)"
-and
-.BR pam_setcred "(3)"
-respectively.
-
-.br
-Some types of functions associated with session
-initialization are logging for the purposes of system-audit and
-mounting directories (the user's home directory for example). These
-should not concern the application. It should be noted that the
-.I effective
-uid,
-.BR geteuid "(2),"
-of the application should be of sufficient privilege to perform such
-tasks.
-
-.TP
-.B pam_close_session
-.br
-Use this function to signal that a user session has
-terminated. In general this function may not need to be located in the
-same application as the initialization function,
-.BR pam_open_session "."
-
-.br
-Typically, this function will undo the actions of
-.BR pam_open_session "."
-That is, log audit information concerning the end of the user session
-or unmount the user's home directory. Apart from having sufficient
-privilege the details of the session termination should not concern
-the calling application. It is good programming practice, however, to
-cease acting on behalf of the user on returning from this call.
-
-.SH RETURN VALUE
-A successful return from the session management functions will be
-indicated with
-.BR PAM_SUCCESS "."
-
-.br
-The specific error indicating a failure to open or close a session is
-.BR PAM_SESSION_ERR "."
-In general other return values may be returned. They should be treated
-as indicating failure.
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-OSF-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_start "(3), "
-.BR pam_authenticate "(3), "
-.BR pam_setcred "(3), "
-.BR pam_get_item "(3), "
-.BR pam_strerror "(3) "
-and
-.BR pam "(3)."
-
-.br
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_setcred.3 b/contrib/libpam/doc/man/pam_setcred.3
deleted file mode 100644
index 317b0eb5b48f..000000000000
--- a/contrib/libpam/doc/man/pam_setcred.3
+++ /dev/null
@@ -1,79 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_setcred.3,v 1.1.1.1 1998/07/09 22:10:18 jdp Exp $
-.\" Copyright (c) Andrew G. Morgan 1996,1997 <morgan@parc.power.net>
-.TH PAM_SETCRED 3 "1997 July 6" "PAM 0.58" "App. Programmers' Manual"
-.SH NAME
-
-pam_setcred \- set the credentials for the user
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.sp
-.BI "int pam_setcred(pam_handle_t " *pamh ", int " flags ");"
-.sp 2
-.SH DESCRIPTION
-.B pam_setcred
-
-This function is used to establish, maintain and delete the
-credentials of a user. It should be called after a user has been
-authenticated and before a session is opened for the user (with
-.BR pam_open_session "(3))."
-
-It should be noted that credentials come in many forms. Examples
-include: group memberships; ticket-files; and PAM environment
-variables. For this reason, it is important that the basic identity
-of the user is established, by the application, prior to a call to
-this function. For example, the default
-.BR PAM
-environment variables should be set and also
-.BR initgroups "(2) "
-(or equivalent) should have been performed.
-
-.SH "VALID FLAGS"
-.TP
-.BR PAM_ESTABLISH_CRED
-initialize the credentials for the user.
-
-.TP
-.BR PAM_DELETE_CRED
-delete the user's credentials.
-
-.TP
-.BR PAM_REINITIALIZE_CRED
-delete and then initialize the user's credentials.
-
-.TP
-.BR PAM_REFRESH_CRED
-extend the lifetime of the existing credentials.
-
-.SH "RETURN VALUE"
-
-On success
-.BR PAM_SUCCESS
-is returned, all other return values should be treated as errors.
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_authenticate "(3), "
-.BR pam_strerror "(3)"
-and
-.BR pam_open_session "(3). "
-
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_start.3 b/contrib/libpam/doc/man/pam_start.3
deleted file mode 100644
index f2e166f7b3f2..000000000000
--- a/contrib/libpam/doc/man/pam_start.3
+++ /dev/null
@@ -1,98 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: pam_start.3,v 1.2 1997/02/15 18:51:54 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1996-7 <morgan@parc.power.net>
-.TH PAM_START 3 "1997 Feb 15" "PAM 0.56" "Application Programmers' Manual"
-.SH NAME
-
-pam_start, pam_end \- activating PAM
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.sp
-.BI "int pam_start(const char " *service ", const char " *user ", const struct pam_conv " *conv ", pam_handle_t " **pamh_p ");"
-.sp
-.BI "int pam_end(pam_handle_t " *pamh ", int " pam_status ");"
-.sp 2
-.SH DESCRIPTION
-.TP
-.B pam_start
-Initialize the
-.I PAM
-library. Identifying the application with a particular
-.IR service
-name. The
-.IR user "name"
-can take the value
-.IR NULL ", "
-if not known at the time the interface is initialized. The
-conversation structure is passed to the library via the
-.IR conv
-argument. (For a complete description of this and other structures
-the reader is directed to the more verbose
-.IR PAM
-application developers' guide). Upon successful initialization, an
-opaque pointer-handle for future access to the library is returned
-through the contents of the
-.IR pamh_p
-pointer.
-
-.TP
-.B pam_end
-Terminate the
-.B PAM
-library. The service application associated with the
-.IR pamh
-handle, is terminated. The argument,
-.IR pam_status ", "
-passes the value most recently returned to the application from the
-library; it indicates the manner in which the library should be
-shutdown. Besides carrying a return value, this argument may be
-logically OR'd with
-.IR PAM_DATA_SILENT
-to indicate that the module should not treat the call too
-seriously. It is generally used to indicate that the current closing
-of the library is in a
-.IR fork "(2)ed"
-process, and that the parent will take care of cleaning up things that
-exist outside of the current process space (files etc.).
-
-.SH "RETURN VALUE"
-.TP
-.B pam_start
-.TP
-.B pam_end
-On success,
-.BR PAM_SUCCESS
-is returned
-
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(3). "
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-.sp
-Note, the
-.BR PAM_DATA_SILENT
-flag is pending acceptance with the DCE (as of 1996/12/4).
-
-.SH BUGS
-.sp 2
-None known.
-
-.SH "SEE ALSO"
-
-.BR fork "(2), "
-.BR pam_authenticate "(3), "
-.BR pam_acct_mgmt "(3), "
-.BR pam_open_session "(3), "
-and
-.BR pam_chauthtok "(3)."
-
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/pam_strerror.3 b/contrib/libpam/doc/man/pam_strerror.3
deleted file mode 100644
index 28d5f3436976..000000000000
--- a/contrib/libpam/doc/man/pam_strerror.3
+++ /dev/null
@@ -1,49 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" ripped off from Rick Faith's getgroups man page
-.\" $Id: pam_strerror.3,v 1.2 1997/02/15 18:53:04 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1996-7 <morgan@parc.power.net>
-.TH PAM_STRERROR 3 "1997 Feb 15" "PAM 0.56" "Programmers' Manual"
-.SH NAME
-
-pam_strerror \- return a textual description of a PAM error
-
-.SH SYNOPSIS
-.B #include <security/pam_appl.h>
-.br
-or,
-.br
-.B #include <security/pam_modules.h>
-.sp
-.BI "const char *pam_strerror(" int " pam_error);
-.sp 2
-.SH DESCRIPTION
-.B pam_strerror
-
-This function returns a pointer to a line of text describing the
-.BR PAM
-error passed as its sole argument.
-
-.SH "RETURN VALUE"
-
-On success this function returns a description of the indicated
-error. Should the function not recognize the error, ``Unknown
-PAM error'' is returned.
-
-.SH "CONFORMING TO"
-DCE-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-This function should be internationalized.
-
-.SH "SEE ALSO"
-
-.BR pam "(8). "
-
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/man/template-man b/contrib/libpam/doc/man/template-man
deleted file mode 100644
index a635c8bd8024..000000000000
--- a/contrib/libpam/doc/man/template-man
+++ /dev/null
@@ -1,52 +0,0 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\" $Id: template-man,v 1.1 1997/01/04 18:25:13 morgan Exp $
-.\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
-.TH PAM_???? 2 "1997 Jan 4" "Linux-PAM 0.55" "Application Programmers' Manual"
-.SH NAME
-
-function names \- brief summary of function
-
-.SH SYNOPSIS
-.B #include <security/pam_????.h>
-.sp
-.BI "int pam_???(pam_handle_t " pamh ", int " flags);
-.sp 2
-.SH DESCRIPTION
-.TP
-.B pam_???
-Here goes the
-.I explanation
-it may be quite
-.IR long .
-.TP
-.SH "RETURN VALUE"
-.B pam_???
-On success...
-.BR PAM_SUCCESS
-is returned
-.TP
-.SH ERRORS
-May be translated to text with
-.BR pam_strerror "(2). "
-
-.SH "CONFORMING TO"
-.B pam_???
-DCE-RFC 86.0, October 1995.
-
-.SH BUGS
-.sp 2
-none known.
-
-.SH "SEE ALSO"
-
-.BR pam_??? "(2), "
-and
-.BR pam_??? "(2). "
-
-Also, see the three
-.BR Linux-PAM
-Guides, for
-.BR "System administrators" ", "
-.BR "module developers" ", "
-and
-.BR "application developers" ". "
diff --git a/contrib/libpam/doc/pam_appl.sgml b/contrib/libpam/doc/pam_appl.sgml
deleted file mode 100644
index 7c4170ae47ba..000000000000
--- a/contrib/libpam/doc/pam_appl.sgml
+++ /dev/null
@@ -1,1567 +0,0 @@
-<!doctype linuxdoc system>
-
-<!--
-
- $Id: pam_appl.sgml,v 1.16 1997/04/05 06:49:14 morgan Exp morgan $
-
- Copyright (C) Andrew G. Morgan 1996, 1997. All rights reserved.
-
-Redistribution and use in source (sgml) and binary (derived) 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, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-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.
-
-ALTERNATIVELY, this product may be distributed under the terms of the
-GNU General Public License, in which case the provisions of the GNU
-GPL are required INSTEAD OF the above restrictions. (This clause is
-necessary due to a potential bad interaction between the GNU GPL and
-the restrictions contained in a BSD-style copyright.)
-
-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.
-
- -->
-
-<article>
-
-<title>The Linux-PAM Application Developers' Guide
-<author>Andrew G. Morgan, <tt>morgan@linux.kernel.org</tt>
-<date>DRAFT v0.63 1998/1/18
-<abstract>
-This manual documents what an application developer needs to know
-about the <bf>Linux-PAM</bf> library. It describes how an application
-might use the <bf>Linux-PAM</bf> library to authenticate users. In
-addition it contains a description of the funtions to be found in
-<tt/libpam_misc/ library, that can be used in general applications.
-Finally, it contains some comments on PAM related security issues for
-the application developer.
-</abstract>
-
-<toc>
-
-<sect>Introduction
-
-<sect1>Synopsis
-
-<p>
-For general applications that wish to use the services provided by
-<bf/Linux-PAM/ the following is a summary of the relevant linking
-information:
-<tscreen>
-<verb>
-#include <security/pam_appl.h>
-
-cc -o application .... -lpam
-</verb>
-</tscreen>
-
-<p>
-In addition to <tt/libpam/, there is a library of miscellaneous
-functions that make the job of writing <em/PAM-aware/ applications
-easier (this library is not covered in the DCE-RFC for PAM and is
-specific to the Linux-PAM distribution):
-<tscreen>
-<verb>
-...
-#include <security/pam_misc.h>
-
-cc -o application .... -lpam -lpam_misc
-</verb>
-</tscreen>
-
-<sect1> Description
-
-<p>
-<bf>Linux-PAM</bf> (Pluggable Authentication Modules for Linux) is a
-library that enables the local system administrator to choose how
-individual applications authenticate users. For an overview of the
-<bf>Linux-PAM</bf> library see the <bf/Linux-PAM/ System
-Administrators' Guide.
-
-<p>
-It is the purpose of the <bf>Linux-PAM</bf> project to liberate the
-development of privilege granting software from the development of
-secure and appropriate authentication schemes. This is accomplished
-by providing a documented library of functions that an application may
-use for all forms of user authentication management. This library
-dynamically loads locally configured authentication modules that
-actually perform the authentication tasks.
-
-<p>
-From the perspective of an application developer the information
-contained in the local configuration of the PAM library should not be
-important. Indeed it is intended that an application treat the
-functions documented here as a ``black box'' that will deal with all
-aspects of user authentication. ``All aspects'' includes user
-verification, account management, session initialization/termination
-and also the resetting of passwords (<em/authentication tokens/).
-
-<sect>Overview
-
-<p>
-Most service-giving applications are restricted. In other words,
-their service is not available to all and every prospective client.
-Instead, the applying client must jump through a number of hoops to
-convince the serving application that they are authorized to obtain
-service.
-
-The process of <em/authenticating/ a client is what PAM is designed to
-manage. In addition to authentication, PAM provides account
-management, credential management, session management and
-authentication-token (password changing) management services. It is
-important to realize when writing a PAM based application that these
-services are provided in a manner that is <bf>transparent</bf> to the
-the application. That is to say, when the application is written, no
-assumptions can be made about <em>how</em> the client will be
-authenticated.
-
-<p>
-The process of authentication is performed by the PAM library via a
-call to <tt>pam_authenticate()</tt>. The return value of this
-function will indicate whether a named client (the <em>user</em>) has
-been authenticated. If the PAM library needs to prompt the user for
-any information, such as their <em>name</em> or a <em>password</em>
-then it will do so. If the PAM library is configured to authenticate
-the user using some silent protocol, it will do this too. (This
-latter case might be via some hardware interface for example.)
-
-<p>
-It is important to note that the application must leave all decisions
-about when to prompt the user at the discretion of the PAM library.
-
-<p>
-The PAM library, however, must work equally well for different styles
-of application. Some applications, like the familiar <tt>login</tt>
-and <tt>passwd</tt> are terminal based applications, exchanges of
-information with the client in these cases is as plain text messages.
-Graphically based applications, however, have a more sophisticated
-interface. They generally interact with the user via specially
-constructed dialogue boxes. Additionally, network based services
-require that text messages exchanged with the client are specially
-formatted for automated processing: one such example is <tt>ftpd</tt>
-which prefixes each exchanged message with a numeric identifier.
-
-<p>
-The presentation of simple requests to a client is thus something very
-dependent on the protocol that the serving application will use. In
-spite of the fact that PAM demands that it drives the whole
-authentication process, it is not possible to leave such protocol
-subtleties up to the PAM library. To overcome this potential problem,
-the application provides the PAM library with a <em>conversation</em>
-function. This function is called from <bf>within</bf> the PAM
-library and enables the PAM to directly interact with the client. The
-sorts of things that this conversation function must be able to do are
-prompt the user with text and/or obtain textual input from the user
-for processing by the PAM library. The details of this function are
-provided in a later section.
-
-<p>
-For example, the conversation function may be called by the PAM library
-with a request to prompt the user for a password. Its job is to
-reformat the prompt request into a form that the client will
-understand. In the case of <tt>ftpd</tt>, this will involve prefixing
-the string with the number <tt>331</tt> and sending the request over
-the network to a connected client. The conversation function will
-then obtain any reply and, after extracting the typed password, will
-return this string of text to the PAM library. Similar concerns need
-to be addressed in the case of an X-based graphical server.
-
-<p>
-There are a number of issues that need to be addressed when one is
-porting an existing application to become PAM compliant. A section
-below has been devoted to this: Porting legacy applications.
-
-<p>
-Besides authentication, PAM provides other forms of management.
-Session management is provided with calls to
-<tt>pam_open_session()</tt> and <tt>pam_close_session()</tt>. What
-these functions actually do is up to the local administrator. But
-typically, they could be used to log entry and exit from the system or
-for mounting and unmounting the user's home directory. If an
-application provides continuous service for a period of time, it
-should probably call these functions, first open after the user is
-authenticated and then close when the service is terminated.
-
-<p>
-Account management is another area that an application developer
-should include with a call to <tt/pam_acct_mgmt()/. This call will
-perform checks on the good health of the user's account (has it
-expired etc.). One of the things this function may check is whether
-the user's authentication token has expired - in such a case the
-application may choose to attempt to update it with a call to
-<tt/pam_chauthtok()/, although some applications are not suited to
-this task (<em>ftp</em> for example) and in this case the application
-should deny access to the user.
-
-<p>
-PAM is also capable of setting and deleting the users credentials with
-the call <tt>pam_setcred()</tt>. This function should always be
-called after the user is authenticated and before service is offered
-to the user. By convention, this should be the last call to the PAM
-library before service is given to the user. What exactly a
-credential is, is not well defined. However, some examples are given
-in the glossary below.
-
-<sect>The public interface to <bf>Linux-PAM</bf>
-
-<p>
-Firstly, the relevant include file for the <bf>Linux-PAM</bf> library
-is <tt>&lt;security/pam_appl.h&gt;</tt>. It contains the definitions
-for a number of functions. After listing these functions, we collect
-some guiding remarks for programmers.
-
-<sect1>What can be expected by the application
-
-<p>
-Here we document those functions in the <bf/Linux-PAM/ library that
-may be called from an application.
-
-<sect2>Initialization of Linux-PAM
-<label id="pam-start-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_start(const char *service_name, const char *user,
- const struct pam_conv *pam_conversation,
- pam_handle_t **pamh);
-</verb>
-</tscreen>
-
-<p>
-This is the first of the <bf>Linux-PAM</bf> functions that must be
-called by an application. It initializes the interface and reads the
-system configuration file, <tt>/etc/pam.conf</tt> (see the
-<bf/Linux-PAM/ System Administrators' Guide). Following a successful
-return (<tt/PAM_SUCCESS/) the contents of <tt/*pamh/ is a handle that
-provides continuity for successive calls to the <bf/Linux-PAM/
-library. The arguments expected by <tt/pam_start/ are as follows: the
-<tt/service_name/ of the program, the <tt/user/name of the individual
-to be authenticated, a pointer to an application-supplied
-<tt/pam_conv/ structure and a pointer to a <tt/pam_handle_t/
-<em/pointer/.
-
-<p>
-The <tt>pam_conv</tt> structure is discussed more fully in the section
-<ref id="the-conversation-function" name="below">. The
-<tt>pam_handle_t</tt> is a <em>blind</em> structure and the
-application should not attempt to probe it directly for information.
-Instead the <bf>Linux-PAM</bf> library provides the functions
-<tt>pam_set_item</tt> and <tt>pam_get_item</tt>. These functions are
-documented below.
-
-<sect2>Termination of the library
-<label id="pam-end-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_end(pam_handle_t *pamh, int pam_status);
-</verb>
-</tscreen>
-
-<p>
-This function is the last function an application should call in the
-<bf>Linux-PAM</bf> library. Upon return the handle <tt/pamh/ is no
-longer valid and all memory associated with it will be invalid (likely
-to cause a segmentation fault if accessed).
-
-<p>
-Under normal conditions the argument <tt/pam_status/ has the value
-PAM_SUCCESS, but in the event of an unsuccessful service application
-the approprite <bf/Linux-PAM/ error-return value should be used
-here.
-attempt its purpose is to be passed as an argument to the
-module specific function <tt/cleanup()/ (see the <bf/Linux-PAM/
-<htmlurl url="pam_modules.html" name="Module Developers' Guide">).
-
-<sect2>Setting PAM items
-<label id="pam-set-item-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_set_item(pam_handle_t *pamh, int item_type,
- const void *item);
-</verb>
-</tscreen>
-
-<p>This function is used to (re)set the value of one of the following
-<bf/item_type/s:
-
-<p><descrip>
-<tag><tt/PAM_SERVICE/</tag>
- The service name
-
-<tag><tt/PAM_USER/</tag>
- The user name
-
-<tag><tt/PAM_TTY/</tag>
- The terminal name: prefixed by <tt>/dev/</tt> if it is a
-device file; for graphical, X-based, applications the value for this
-item should be the <tt/&dollar;DISPLAY/ variable.
-
-<tag><tt/PAM_RHOST/</tag>
- The remote host name
-
-<tag><tt/PAM_CONV/</tag>
- The conversation structure (see section <ref
-id="the-conversation-function" name="below">)
-
-<tag><tt/PAM_RUSER/</tag>
- The remote user name
-
-<tag><tt/PAM_USER_PROMPT/</tag>
- The string used when prompting for a user's name. The default
-value for this string is ``Please enter username: ''.
-
-</descrip>
-
-<p>
-For all <tt/item_type/s, other than <tt/PAM_CONV/, <tt/item/ is a
-pointer to a <tt>&lt;NUL&gt;</tt> terminated character string. In the
-case of <tt/PAM_CONV/, <tt/item/ points to an initialized
-<tt/pam_conv/ structure (see section <ref
-id="the-conversation-function" name="below">).
-
-<p>
-A successful call to this function returns <tt/PAM_SUCCESS/. However,
-the application should expect one of the following errors:
-
-<p>
-<descrip>
-<tag><tt/PAM_PERM_DENIED/</tag>
- An attempt was made to replace the conversation structure with
-a <tt/NULL/ value.
-<tag><tt/PAM_BUF_ERR/</tag>
- The function ran out of memory making a copy of the item.
-<tag><tt/PAM_BAD_ITEM/</tag>
- The application attempted to set an undefined item.
-</descrip>
-
-<sect2>Getting PAM items
-<label id="pam-get-item-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_get_item(const pam_handle_t *pamh, int item_type,
- const void **item);
-</verb>
-</tscreen>
-
-<p>
-This function is used to obtain the value of the indicated
-<tt/item_type/. Upon successful return, <tt/*item/ contains a pointer
-to the value of the corresponding item. Note, this is a pointer to
-the <em/actual/ data and should <em/not/ be <tt/free()/'ed or
-over-written! A successful call is signaled by a return value of
-<tt/PAM_SUCCESS/. If an attempt is made to get an undefined item,
-<tt/PAM_BAD_ITEM/ is returned.
-
-<sect2>Understanding errors
-<label id="pam-strerror-section">
-
-<p>
-<tscreen>
-<verb>
-extern const char *pam_strerror(pam_handle_t *pamh, int errnum);
-</verb>
-</tscreen>
-
-<p>
-This function returns some text describing the <bf>Linux-PAM</bf>
-error associated with the argument <tt/errnum/. If the error is not
-recognized ``<tt/Unknown Linux-PAM error/'' is returned.
-
-<sect2>Planning for delays
-
-<p>
-<tscreen>
-<verb>
-extern int pam_fail_delay(pam_handle_t *pamh, unsigned int micro_sec);
-</verb>
-</tscreen>
-
-<p>
-This function is offered by <bf/Linux-PAM/ to facilitate time delays
-following a failed call to <tt/pam_authenticate()/ and before control
-is returned to the application. When using this function the
-application programmer should check if it is available with,
-<tscreen>
-<verb>
-#ifdef HAVE_PAM_FAIL_DELAY
- ....
-#endif /* HAVE_PAM_FAIL_DELAY */
-</verb>
-</tscreen>
-
-
-<p>
-Generally, an application requests that a user is authenticated by
-<bf/Linux-PAM/ through a call to <tt/pam_authenticate()/ or
-<tt/pam_chauthtok()/. These functions calls each of the <em/stacked/
-authentication modules listed in the <tt>/etc/pam.conf</tt> file. As
-directed by this file, one of more of the modules may fail causing the
-<tt/pam_...()/ call to return an error. It is desirable for there to
-also be a pause before the application continues. The principal reason
-for such a delay is security: a delay acts to discourage <em/brute
-force/ dictionary attacks primarily, but also helps hinder
-<em/timed/ (covert channel) attacks.
-
-<p>
-The <tt/pam_fail_delay()/ function provides the mechanism by which an
-application or module can suggest a minimum delay (of <tt/micro_sec/
-<em/micro-seconds/). <bf/Linux-PAM/ keeps a record of the longest time
-requested with this function. Should <tt/pam_authenticate()/ fail,
-the failing return to the application is delayed by an amount of time
-randomly distributed (by up to 25%) about this longest value.
-
-<p>
-Independent of success, the delay time is reset to its zero default
-value when <bf/Linux-PAM/ returns control to the application.
-
-<sect2>Authenticating the user
-
-<p>
-<tscreen>
-<verb>
-extern int pam_authenticate(pam_handle_t *pamh, int flags);
-</verb>
-</tscreen>
-
-<p>
-This function serves as an interface to the authentication mechanisms
-of the loaded modules. The single <em/optional/ flag, which may be
-logically OR'd with <tt/PAM_SILENT/, takes the following value,
-
-<p><descrip>
-
-<tag><tt/PAM_DISALLOW_NULL_AUTHTOK/</tag>
- Instruct the authentication modules to return
-<tt/PAM_AUTH_ERR/ if the user does not have a registered
-authorization token---it is set to <tt/NULL/ in the system database.
-</descrip>
-
-<p>
-The value returned by this function is one of the following:
-
-<p><descrip>
-
-<tag><tt/PAM_AUTH_ERR/</tag>
- The user was not authenticated
-<tag><tt/PAM_CRED_INSUFFICIENT/</tag>
- For some reason the application does not have sufficient
-credentials to authenticate the user.
-<tag><tt/PAM_AUTHINFO_UNAVAIL/</tag>
- The modules were not able to access the authentication
-information. This might be due to a network or hardware failure etc.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The supplied username is not known to the authentication
-service
-<tag><tt/PAM_MAXTRIES/</tag>
- One or more of the authentication modules has reached its
-limit of tries authenticating the user. Do not try again.
-
-</descrip>
-
-<p>
-If one or more of the authentication modules fails to load, for
-whatever reason, this function will return <tt/PAM_ABORT/.
-
-<sect2>Setting user credentials
-<label id="pam-setcred-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_setcred(pam_handle_t *pamh, int flags);
-</verb>
-</tscreen>
-
-<p>
-This function is used to set the module-specific credentials of the
-user. It is usually called after the user has been authenticated,
-after the account management function has been called and after a
-session has been opened for the user.
-
-<p>
-A credential is something that the user possesses. It is some
-property, such as a <em>Kerberos</em> ticket, or a supplementary group
-membership that make up the uniqueness of a given user. On a Linux
-(or UN*X system) the user's <tt>UID</tt> and <tt>GID</tt>'s are
-credentials too. However, it has been decided that these properties
-(along with the default supplementary groups of which the user is a
-member) are credentials that should be set directly by the application
-and not by PAM.
-
-<p>
-This function simply calls the <tt/pam_sm_setcred/ functions of each
-of the loaded modules. Valid <tt/flags/, any one of which, may be
-logically OR'd with <tt/PAM_SILENT/, are:
-
-<p><descrip>
-<tag><tt/PAM_ESTABLISH_CRED/</tag>
- Set the credentials for the authentication service,
-<tag><tt/PAM_DELETE_CRED/</tag>
- Delete the credentials associated with the authentication service,
-<tag><tt/PAM_REINITIALIZE_CRED/</tag>
- Reinitialize the user credentials, and
-<tag><tt/PAM_REFRESH_CRED/</tag>
- Extend the lifetime of the user credentials.
-</descrip>
-
-<p>
-A successful return is signalled with <tt/PAM_SUCCESS/. Errors that
-are especially relevant to this function are the following:
-
-<p><descrip>
-<tag><tt/PAM_CRED_UNAVAIL/</tag>
- A module cannot retrieve the user's credentials.
-<tag><tt/PAM_CRED_EXPIRED/</tag>
- The user's credentials have expired.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to an authentication module.
-<tag><tt/PAM_CRED_ERR/</tag>
- A module was unable to set the credentials of the user.
-</descrip>
-
-<sect2>Account management
-
-<p>
-<tscreen>
-<verb>
-extern int pam_acct_mgmt(pam_handle_t *pamh, int flags);
-</verb>
-</tscreen>
-
-<p>
-This function is typically called after the user has been
-authenticated. It establishes whether the user's account is healthy.
-That is to say, whether the user's account is still active and whether
-the user is permitted to gain access to the system at this time.
-Valid flags, any one of which, may be logically OR'd with
-<tt/PAM_SILENT/, and are the same as those applicable to the
-<tt/flags/ argument of <tt/pam_authenticate/.
-
-<p>
-This function simply calls the corresponding functions of each of the
-loaded modules, as instructed by the configuration file,
-<tt>/etc/pam.conf</tt>.
-
-<p>
-The normal response from this function is <tt/PAM_SUCCESS/, however,
-specific failures are indicated by the following error returns:
-
-<descrip>
-<tag><tt/PAM_AUTHTOKEN_REQD/</tag>
-The user <bf/is/ valid but their authentication token has
-<em/expired/. The correct response to this return-value is to require
-that the user satisfies the <tt/pam_chauthtok()/ function before
-obtaining service. It may not be possible for some applications to do
-this. In such cases, the user should be denied access until such time
-as they can update their password.
-
-<tag><tt/PAM_ACCT_EXPIRED/</tag>
- The user is no longer permitted access to the system.
-<tag><tt/PAM_AUTH_ERR/</tag>
- There was an authentication error.
-
-<tag><tt/PAM_PERM_DENIED/</tag>
- The user is not permitted to gain access at this time.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to a module's account management
-component.
-
-</descrip>
-
-<sect2>Updating authentication tokens
-<label id="pam-chauthtok-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_chauthtok(pam_handle_t *pamh, const int flags);
-</verb>
-</tscreen>
-
-<p>
-This function is used to change the authentication token for a given
-user (as indicated by the state associated with the handle,
-<tt/pamh/). The following is a valid but optional flag which may be
-logically OR'd with <tt/PAM_SILENT/,
-
-<descrip>
-<tag><tt/PAM_CHANGE_EXPIRED_AUTHTOK/</tag>
- This argument indicates to the modules that the users
-authentication token (password) should only be changed if it has
-expired.
-</descrip>
-
-<p>
-Note, if this argument is not passed, the application requires that
-<em/all/ authentication tokens are to be changed.
-
-<p>
-<tt/PAM_SUCCESS/ is the only successful return value, valid
-error-returns are:
-
-<descrip>
-<tag><tt/PAM_AUTHTOK_ERR/</tag>
- A module was unable to obtain the new authentication token.
-
-<tag><tt/PAM_AUTHTOK_RECOVERY_ERR/</tag>
- A module was unable to obtain the old authentication token.
-
-<tag><tt/PAM_AUTHTOK_LOCK_BUSY/</tag>
- One or more of the modules was unable to change the
-authentication token since it is currently locked.
-
-<tag><tt/PAM_AUTHTOK_DISABLE_AGING/</tag>
- Authentication token aging has been disabled for at least one
-of the modules.
-
-<tag><tt/PAM_PERM_DENIED/</tag>
- Permission denied.
-
-<tag><tt/PAM_TRY_AGAIN/</tag>
- Not all of the modules were in a position to update the
-authentication token(s). In such a case none of the user's
-authentication tokens are updated.
-
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to the authentication token changing
-service.
-
-</descrip>
-
-<sect2>Session initialization
-<label id="pam-open-session-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_open_session(pam_handle_t *pamh, int flags);
-</verb>
-</tscreen>
-
-<p>
-This function is used to indicate that an authenticated session has
-begun. It is used to inform the module that the user is currently in
-a session. It should be possible for the <bf>Linux-PAM</bf> library
-to open a session and close the same session (see section <ref
-id="pam-close-session-section" name="below">) from different
-applications.
-
-<p>
-Currently, this function simply calls each of the corresponding
-functions of the loaded modules. The only valid flag is
-<tt/PAM_SILENT/ and this is, of course, <em/optional/.
-
-<p>
-If any of the <em/required/ loaded modules are unable to open a
-session for the user, this function will return <tt/PAM_SESSION_ERR/.
-
-<sect2>Terminating sessions
-<label id="pam-close-session-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_close_session(pam_handle_t *pamh, int flags);
-</verb>
-</tscreen>
-
-<p>
-This function is used to indicate that an authenticated session has
-ended. It is used to inform the module that the user is exiting a
-session. It should be possible for the <bf>Linux-PAM</bf> library to
-open a session and close the same session from different applications.
-
-<p>
-Currently, this function simply calls each of the corresponding
-functions of the loaded modules. The only valid flag is
-<tt/PAM_SILENT/ and this is, of course, <em/optional/.
-
-<p>
-If any of the <em/required/ loaded modules are unable to close a
-session for the user, this function will return <tt/PAM_SESSION_ERR/.
-
-<sect2>Setting PAM environment variables
-<label id="pam-putenv-section">
-
-<p>
-<tscreen>
-<verb>
-extern int pam_putenv(pam_handle_t *pamh, const char *name_value);
-</verb>
-</tscreen>
-
-<p>
-<em>
-Warning, the environment support in <bf/Linux-PAM/ is based solely
-on a six line email from the developers at Sun. Its interface is
-likely to be generally correct, however, the details are likely to be
-changed as more information becomes available.
-</em>
-
-<p>
-This function attempts to (re)set a <bf/Linux-PAM/ environment
-variable. The <tt/name_value/ argument is a single <tt/NUL/ terminated
-string of one of the following forms:
-<descrip>
-<tag>``<tt/NAME=value of variable/''</tag>
-
-In this case the environment variable of the given <tt/NAME/ is set to
-the indicated value: ``<tt/value of variable/''. If this variable is
-already known, it is overwritten. Otherwise it is added to the
-<bf/Linux-PAM/ environment.
-
-<tag>``<tt/NAME=/''</tag>
-
-This function sets the variable to an empty value. It is listed
-separately to indicate that this is the correct way to achieve such a
-setting.
-
-<tag>``<tt/NAME/''</tag>
-
-Without an `<tt/=/' the <tt/pam_putenv()/ function will delete the
-correspoding variable from the <bf/Linux-PAM/ environment.
-
-</descrip>
-
-<p>
-Success is indicated with a return value of <tt/PAM_SUCCESS/. Failure
-is indicated by one of the following returns:
-
-<descrip>
-<tag><tt/PAM_PERM_DENIED/</tag>
- name given is a <tt/NULL/ pointer
-
-<tag><tt/PAM_BAD_ITEM/</tag>
- variable requested (for deletion) is not currently set
-
-<tag><tt/PAM_ABORT/</tag>
- the <bf/Linux-PAM/ handle, <tt/pamh/, is corrupt
-
-<tag><tt/PAM_BUF_ERR/</tag>
- failed to allocate memory when attempting update
-
-</descrip>
-
-<sect2>Getting a PAM environment variable
-<label id="pam-getenv-section">
-
-<p>
-<tscreen>
-<verb>
-extern const char *pam_getenv(pam_handle_t *pamh, const char *name);
-</verb>
-</tscreen>
-
-<p>
-<em>
-Warning, the environment support in <bf/Linux-PAM/ is based solely
-on a six-line email from the developers at Sun. Its interface is
-likely to be generally correct, however, the details are likely to be
-changed as more information becomes available.
-</em>
-
-<p>
-Obtain the value of the indicated <bf/Linux-PAM/ environment
-variable. On error, internal failure or the unavailability of the
-given variable (unspecified), this function simply returns <tt/NULL/.
-
-<sect2>Getting the PAM environment
-<label id="pam-getenvlist-section">
-
-<p>
-<tscreen>
-<verb>
-extern const char * const *pam_getenvlist(pam_handle_t *pamh);
-</verb>
-</tscreen>
-
-<p>
-<em>
-Warning, the environment support in <bf/Linux-PAM/ is based solely
-on a six line email from the developers at Sun. Its interface is
-likely to be generally correct, however, the details are likely to be
-changed as more information becomes available.
-</em>
-
-<p>
-This function returns a pointer to the complete <tt/Linux-PAM/
-environment. It is a pointer to a <em/read-only/ list of
-<em/read-only/ environment variables. It should be noted that this
-memory will become invalid after a call to <tt/pam_end()/ (see the
-section <ref id="pam-end-section" name="above">). If application
-wishes to make use of this list after such a call, it should first
-make a copy of all the set variables. (A function that performs such a
-transcription is to be found in <tt/libpam_misc/.)
-
-<sect1>What is expected of an application
-
-<sect2>The conversation function
-<label id="the-conversation-function">
-
-<p>
-An application must provide a ``conversation function''. It is used
-for direct communication between a loaded module and the application
-and will typically provide a means for the module to prompt the user
-for a password etc. . The structure, <tt/pam_conv/, is defined by
-including <tt>&lt;security/pam_appl.h&gt</tt>; to be,
-
-<p>
-<tscreen>
-<verb>
-struct pam_conv {
- int (*conv)(int num_msg,
- const struct pam_message **msg,
- struct pam_response **resp,
- void *appdata_ptr);
- void *appdata_ptr;
-};
-</verb>
-</tscreen>
-
-<p>
-It is initialized by the application before it is passed to the
-library. The <em/contents/ of this structure are attached to the
-<tt/*pamh/ handle. The point of this argument is to provide a
-mechanism for any loaded module to interact directly with the
-application program. This is why it is called a <em/conversation/
-structure.
-
-<p>
-When a module calls the referenced <tt/conv()/ function, the argument
-<tt/*appdata_ptr/ is set to the second element of this structure.
-
-<p>
-The other arguments of a call to <tt/conv()/ concern the information
-exchanged by module and application. That is to say, <tt/num_msg/
-holds the length of the array of pointers, <tt/msg/. After a
-successful return, the pointer <tt/*resp/ points to an array of
-<tt/pam_response/ structures, holding the application supplied text.
-Note, <tt/*resp/ is an <tt/struct pam_response/ array and <em/not/ an
-array of pointers.
-
-<p>
-The message (from the module to the application) passing structure is
-defined by <tt>&lt;security/pam_appl.h&gt;</tt> as:
-
-<p>
-<tscreen>
-<verb>
-struct pam_message {
- int msg_style;
- const char *msg;
-};
-</verb>
-</tscreen>
-
-<p>
-Valid choices for <tt/msg_style/ are:
-
-<p><descrip>
-<tag><tt/PAM_PROMPT_ECHO_OFF/</tag>
- Obtain a string without echoing any text
-<tag><tt/PAM_PROMPT_ECHO_ON/</tag>
- Obtain a string whilst echoing text
-<tag><tt/PAM_ERROR_MSG/</tag>
- Display an error
-<tag><tt/PAM_TEXT_INFO/</tag>
- Display some text.
-</descrip>
-
-<p>
-The point of having an array of messages is that it becomes possible
-to pass a number of things to the application in a single call from
-the module. It can also be convenient for the application that related
-things come at once: a windows based application can then present a
-single form with many messages/prompts on at once.
-
-<p>
-The response (from the application to the module) passing structure is
-defined by including <tt>&lt;security/pam_appl.h&gt;</tt> as:
-
-<p><tscreen><verb>
-struct pam_response {
- char *resp;
- int resp_retcode;
-};
-</verb></tscreen>
-
-<p>
-Currently, there are no definitions for <tt/resp_retcode/ values; the
-normal value is <tt/0/.
-
-<p>
-Prior to the 0.59 release of Linux-PAM, the length of the returned
-<tt/pam_response/ array was equal to the number of <em/prompts/ (types
-<tt/PAM_PROMPT_ECHO_OFF/ and <tt/PAM_PROMPT_ECHO_ON/) in the
-<tt/pam_message/ array with which the conversation function was
-called. This meant that it was not always necessary for the module to
-<tt/free(3)/ the responses if the conversation function was only used
-to display some text.
-
-<p>
-Post Linux-PAM-0.59 (and in the interests of compatibility with
-Sunsoft). The number of resposes is always equal to the <tt/num_msg/
-conversation function argument. This is slightly easier to program
-but does require that the response array is <tt/free(3)/'d after every
-call to the conversation function. The index of the responses
-corresponds directly to the prompt index in the <tt/pam_message/
-array.
-
-<p>
-The maximum length of the <tt/pam_msg.msg/ and <tt/pam_response.resp/
-character strings is <tt/PAM_MAX_MSG_SIZE/. (This is not enforced by
-Linux-PAM.)
-
-<p>
-<tt/PAM_SUCCESS/ is the expected return value of this
-function. However, should an error occur the application should not
-set <tt/*resp/ but simply return <tt/PAM_CONV_ERR/.
-
-<p>
-Note, if an application wishes to use two conversation functions, it
-should activate the second with a call to <tt/pam_set_item()/.
-
-<p>
-<bf>Notes:</bf> New item types are being added to the conversation
-protocol. Currently Linux-PAM supports: <tt>PAM_BINARY_PROMPT</tt>
-and <tt>PAM_BINARY_MSG</tt>. These two are intended for server-client
-hidden information exchange and may be used as an interface for
-maching-machine authentication.
-
-<sect1>Programming notes
-
-<p>
-Note, all of the authentication service function calls accept the
-token <tt/PAM_SILENT/, which instructs the modules to not send
-messages to the application. This token can be logically OR'd with any
-one of the permitted tokens specific to the individual function calls.
-<tt/PAM_SILENT/ does not override the prompting of the user for
-passwords etc., it only stops informative messages from being
-generated.
-
-<sect>Security issues of <bf>Linux-PAM</bf>
-
-<p>
-A poorly (or maliciously) written application can defeat any
-<bf/Linux-PAM/ module's authentication mechanisms by simply ignoring
-it's return values. It is the applications task and responsibility to
-grant privileges and access to services. The <bf/Linux-PAM/ library
-simply assumes the responsibility of <em/authenticating/ the user;
-ascertaining that the user <em/is/ who they say they are. Care should
-be taken to anticipate all of the documented behavior of the
-<bf/Linux-PAM/ library functions. A failure to do this will most
-certainly lead to a future security breach.
-
-<sect1>Care about standard library calls
-
-<p>
-In general, writers of authorization-granting applications should
-assume that each module is likely to call any or <em/all/ `libc'
-functions. For `libc' functions that return pointers to
-static/dynamically allocated structures (ie. the library allocates the
-memory and the user is not expected to `<tt/free()/' it) any module
-call to this function is likely to corrupt a pointer previously
-obtained by the application. The application programmer should either
-re-call such a `libc' function after a call to the <bf/Linux-PAM/
-library, or copy the structure contents to some safe area of memory
-before passing control to the <bf/Linux-PAM/ library.
-
-<p>
-Two function classes that fall into this category are
-<tt>getpwnam(3)</tt> and <tt>syslog(3)</tt>.
-
-<sect1>Choice of a service name
-
-<p>
-When picking the <em/service-name/ that corresponds to the first entry
-in the <tt>/etc/pam.conf</tt> file, the application programmer should
-<bf/avoid/ the temptation of choosing something related to
-<tt/argv[0]/. It is a trivial matter for any user to invoke any
-application on a system under a different name -- this should not be
-permitted to cause a security breach.
-
-<p>
-To invoke some <tt/target/ application by another name, the user may
-symbolically link the target application with the desired name. To be
-precise all the user need do is,
-<tscreen>
-<verb>
-ln -s /target/application ./preferred_name
-</verb>
-</tscreen>
-and then <em/run/ <tt>./preferred_name</tt>
-
-<p>
-By studying the <bf/Linux-PAM/ configuration file,
-<tt>/etc/pam.conf</tt>, an attacker can choose the <tt/preferred_name/
-to be that of a service enjoying minimal protection; for example a
-game which uses <bf/Linux-PAM/ to restrict access to certain hours of
-the day. If the service-name were to be linked to the filename under
-which the service was invoked, it is clear that the user is
-effectively in the position of dictating which authentication scheme
-the service uses. Needless to say, this is not a secure situation.
-
-<p>
-The conclusion is that the application developer should carefully
-define the service-name of an application. The safest thing is to make
-it a single hard-wired name.
-
-<sect1>The conversation function
-
-<p>
-Care should be taken to ensure that the <tt/conv()/ function is
-robust. Such a function is provided in the library <tt/libpam_misc/
-(see <ref id="libpam-misc-section" name="below">).
-
-<sect1>The identity of the user
-
-<p>
-The <bf/Linux-PAM/ modules will need to determine the identity of the
-user who requests a service, and the identity of the user who grants
-the service. These two users will seldom be the same. Indeed there
-is generally a third user identity to be considered, the new (assumed)
-identity of the user once the service is granted.
-
-<p>
-The need for keeping tabs on these identities is clearly an issue of
-security. Basically, the identity of the user requesting a service
-should be the current <tt/uid/ (userid) of the running process; the
-identity of the privilege granting user is the <tt/euid/ (effective
-userid) of the running process; the identity of the user, under whose
-name the service will be executed, is given by the contents of the
-<tt/PAM_USER/ <tt/pam_get_item(2)/.
-
-<p>
-In addition the identity of a remote user, requesting the service from
-a distant location, will be placed in the <tt/PAM_RUSER/ item.
-
-<sect1>Sufficient resources
-
-<p>
-Care should be taken to ensure that the proper execution of an
-application is not compromised by a lack of system resources. If an
-application is unable to open sufficient files to perform its service,
-it should fail gracefully, or request additional resources.
-Specifically, the quantities manipulated by the <tt/setrlimit(2)/
-family of commands should be taken into consideration.
-
-<sect>A library of miscellaneous helper functions
-<label id="libpam-misc-section">
-
-<p>
-To aid the work of the application developer a library of
-miscellaneous functions is provided. It is called <tt/libpam_misc/,
-and contains functions for allocating memory (securely), a text based
-conversation function, and routines for enhancing the standard
-PAM-environment variable support.
-
-<sect1>Requirements
-
-<p>
-The functions, structures and macros, made available by this library
-can be defined by including <tt>&lt;security/pam_misc.h&gt;</tt>. It
-should be noted that this library is specific to <bf/Linux-PAM/ and is
-not referred to in the defining DCE-RFC (see <ref id="bibliography"
-name="the bibliography">) below.
-
-<sect1>Functions supplied
-
-<sect2>Safe string duplication
-
-<p>
-<tscreen>
-<verb>
-extern char *xstrdup(const char *s)
-</verb>
-</tscreen>
-Return a duplicate copy of the <tt/NUL/ terminated string,
-<tt/s/. <tt/NULL/ is returned if there is insufficient memory
-available for the duplicate or if <tt/s=NULL/.
-
-<sect2>A text based conversation function
-
-<p>
-<tscreen>
-<verb>
-extern int misc_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response, void *appdata_ptr);
-</verb>
-</tscreen>
-
-<p>
-This is a function that will prompt the user with the appropriate
-comments and obtain the appropriate inputs as directed by
-authentication modules.
-
-<p>
-In addition to simply slotting into the appropriate <tt/struct
-pam_conv/, this function provides some time-out facilities. The
-function exports five variables that can be used by an application
-programmer to limit the amount of time this conversation function will
-spend waiting for the user to type something.
-
-<p>
-The five variables are as follows:
-<descrip>
-<tag><tt>extern time_t pam_misc_conv_warn_time;</tt></tag>
-
-This variable contains the <em/time/ (as returned by <tt/time()/) that
-the user should be first warned that the clock is ticking. By default
-it has the value <tt/0/, which indicates that no such warning will be
-given. The application may set its value to sometime in the future,
-but this should be done prior to passing control to the <bf/Linux-PAM/
-library.
-
-<tag><tt>extern const char *pam_misc_conv_warn_line;</tt></tag>
-
-Used in conjuction with <tt/pam_misc_conv_warn_time/, this variable is
-a pointer to the string that will be displayed when it becomes time to
-warn the user that the timeout is approaching. Its default value is
-``..&bsol;a.Time is running out...&bsol;n'', but this can be changed
-by the application prior to passing control to <bf/Linux-PAM/.
-
-<tag><tt>extern time_t pam_misc_conv_die_time;</tt></tag>
-
-This variable contains the <em/time/ (as returned by <tt/time()/) that
-the conversation will time out. By default it has the value <tt/0/,
-which indicates that the conversation function will not timeout. The
-application may set its value to sometime in the future, this should
-be done prior to passing control to the <bf/Linux-PAM/ library.
-
-<tag><tt>extern const char *pam_misc_conv_die_line;</tt></tag>
-
-Used in conjuction with <tt/pam_misc_conv_die_time/, this variable is
-a pointer to the string that will be displayed when the conversation
-times out. Its default value is ``..&bsol;a.Sorry, your time is
-up!&bsol;n'', but this can be changed by the application prior to
-passing control to <bf/Linux-PAM/.
-
-<tag><tt>extern int pam_misc_conv_died;</tt></tag>
-
-Following a return from the <bf/Linux-PAM/ libraray, the value of this
-variable indicates whether the conversation has timed out. A value of
-<tt/1/ indicates the time-out occurred.
-
-<tag><tt>extern int (*pam_binary_handler_fn)(const union pam_u_packet_p send,
- union pam_u_packet_p *receive);</tt></tag>
-
-This function pointer is initialized to <tt/NULL/ but can be filled
-with a function that provides machine-machine (hidden) message
-exchange. It is intended for use with hidden authentication protocols
-such as RSA or Diffie-Hellman key exchanges. (This is still under
-development.)
-
-</descrip>
-
-<sect2>Transcribing an environment to that of Linux-PAM
-<p>
-<tscreen>
-<verb>
-extern int pam_misc_paste_env(pam_handle_t *pamh,
- const char * const * user_env);
-</verb>
-</tscreen>
-
-This function takes the supplied list of environment pointers and
-<em/uploads/ its contents to the <bf/Linux-PAM/ environment. Success
-is indicated by <tt/PAM_SUCCESS/.
-
-<sect2>Saving the Linux-PAM environment for later use
-<p>
-<tscreen>
-<verb>
-extern char **pam_misc_copy_env(pam_handle_t *pamh);
-</verb>
-</tscreen>
-
-This function returns a pointer to a list of environment variables
-that are a direct copy of the <bf/Linux-PAM/ environment. The memory
-associated with these variables are the responsibility of the
-application and should be liberated with a call to
-<tt/pam_misc_drop_env()/.
-
-<sect2>Liberating a locally saved environment
-<p>
-<tscreen>
-<verb>
-extern char **pam_misc_drop_env(char **env);
-</verb>
-</tscreen>
-
-This function is defined to complement the <tt/pam_misc_copy_env()/
-function. It liberates the memory associated with <tt/env/,
-<em/overwriting/ with <tt/0/ all memory before <tt/free()/ing it.
-
-<sect2>BSD like Linux-PAM environment variable setting
-<p>
-<tscreen>
-<verb>
-extern int pam_misc_setenv(pam_handle_t *pamh, const char *name,
- const char *value, int readonly);
-</verb>
-</tscreen>
-
-This function performs a task equivalent to <tt/pam_putenv()/, its
-syntax is, however, more like the BSD style function; <tt/setenv()/.
-The <tt/name/ and <tt/value/ are concatenated with an ``<tt/=/'' to
-form a <tt/name_value/ and passed to <tt/pam_putenv()/. If, however,
-the <bf/Linux-PAM/ variable is already set, the replacement will only
-be applied if the last argument, <tt/readonly/, is zero.
-
-<sect>Porting legacy applications
-
-<p>
-The following is extracted from an email. I'll tidy it up later.
-
-<p>
-The point of PAM is that the application is not supposed to have any
-idea how the attatched authentication modules will choose to
-authenticate the user. So all they can do is provide a conversation
-function that will talk directly to the user(client) on the modules'
-behalf.
-
-<p>
-Consider the case that you plug a retinal scanner into the login
-program. In this situation the user would be prompted: "please look
-into the scanner". No username or password would be needed - all this
-information could be deduced from the scan and a database lookup. The
-point is that the retinal scanner is an ideal task for a "module".
-
-<p>
-While it is true that a pop-daemon program is designed with the POP
-protocol in mind and no-one ever considered attatching a retinal
-scanner to it, it is also the case that the "clean" PAM'ification of
-such a daemon would allow for the possibility of a scanner module
-being be attatched to it. The point being that the "standard"
-pop-authentication protocol(s) [which will be needed to satisfy
-inflexible/legacy clients] would be supported by inserting an
-appropriate pam_qpopper module(s). However, having rewritten popd
-once in this way any new protocols can be implemented in-situ.
-
-<p>
-One simple test of a ported application would be to insert the
-<tt/pam_permit/ module and see if the application demands you type a
-password... In such a case, <tt/xlock/ would fail to lock the
-terminal - or would at best be a screen-saver, ftp would give password
-free access to all etc.. Neither of these is a very secure thing to
-do, but they do illustrate how much flexibility PAM puts in the hands
-of the local admin.
-
-<p>
-The key issue, in doing things correctly, is identifying what is part
-of the authentication procedure (how many passwords etc..) the
-exchange protocol (prefixes to prompts etc., numbers like 331 in the
-case of ftpd) and what is part of the service that the application
-delivers. PAM really needs to have total control in the
-authentication "proceedure", the conversation function should only
-deal with reformatting user prompts and extracting responses from raw
-input.
-
-<sect>Glossary of PAM related terms
-
-<p>
-The following are a list of terms used within this document.
-
-<p>
-<descrip>
-
-<tag>Authentication token</tag>
-Generally, this is a password. However, a user can authenticate
-him/herself in a variety of ways. Updating the user's authentication
-token thus corresponds to <em>refreshing</em> the object they use to
-authenticate themself with the system. The word password is avoided
-to keep open the possibility that the authentication involves a
-retinal scan or other non-textual mode of challenge/response.
-
-<tag>Credentials</tag>
-Having successfully authenticated the user, PAM is able to establish
-certain characteristics/attributes of the user. These are termed
-<em>credentials</em>. Examples of which are group memberships to
-perform privileged tasks with, and <em>tickets</em> in the form of
-environment variables etc. . Some user-credentials, such as the
-user's UID and GID (plus default group memberships) are not deemed to
-be PAM-credentials. It is the responsibility of the application to
-grant these directly.
-
-</descrip>
-
-<sect>An example application
-
-<p>
-To get a flavor of the way a <tt/Linux-PAM/ application is written we
-include the following example. It prompts the user for their password
-and indicates whether their account is valid on the standard output,
-its return code also indicates the success (<tt/0/ for success; <tt/1/
-for failure).
-
-<p>
-<tscreen>
-<verb>
-/*
- This program was contributed by Shane Watts
- [modifications by AGM]
-
- You need to add the following (or equivalent) to the /etc/pam.conf file.
- # check authorization
- check_user auth required /usr/lib/security/pam_unix_auth.so
- check_user account required /usr/lib/security/pam_unix_acct.so
- */
-
-#include <security/pam_appl.h>
-#include <security/pam_misc.h>
-#include <stdio.h>
-
-static struct pam_conv conv = {
- misc_conv,
- NULL
-};
-
-int main(int argc, char *argv[])
-{
- pam_handle_t *pamh=NULL;
- int retval;
- const char *user="nobody";
-
- if(argc == 2) {
- user = argv[1];
- }
-
- if(argc > 2) {
- fprintf(stderr, "Usage: check_user [username]\n");
- exit(1);
- }
-
- retval = pam_start("check_user", user, &ero;conv, &ero;pamh);
-
- if (retval == PAM_SUCCESS)
- retval = pam_authenticate(pamh, 0); /* is user really user? */
-
- if (retval == PAM_SUCCESS)
- retval = pam_acct_mgmt(pamh, 0); /* permitted access? */
-
- /* This is where we have been authorized or not. */
-
- if (retval == PAM_SUCCESS) {
- fprintf(stdout, "Authenticated\n");
- } else {
- fprintf(stdout, "Not Authenticated\n");
- }
-
- if (pam_end(pamh,retval) != PAM_SUCCESS) { /* close Linux-PAM */
- pamh = NULL;
- fprintf(stderr, "check_user: failed to release authenticator\n");
- exit(1);
- }
-
- return ( retval == PAM_SUCCESS ? 0:1 ); /* indicate success */
-}
-</verb>
-</tscreen>
-
-<sect>Files
-
-<p><descrip>
-
-<tag><tt>/usr/include/security/pam_appl.h</tt></tag>
-
-header file for <bf/Linux-PAM/ applications interface
-
-<tag><tt>/usr/include/security/pam_misc.h</tt></tag>
-
-header file for useful library functions for making applications
-easier to write
-
-<tag><tt>/usr/lib/libpam.so.*</tt></tag>
-
-the shared library providing applications with access to
-<bf/Linux-PAM/.
-
-<tag><tt>/etc/pam.conf</tt></tag>
-
-the <bf/Linux-PAM/ configuration file.
-
-<tag><tt>/usr/lib/security/pam_*.so</tt></tag>
-
-the primary location for <bf/Linux-PAM/ dynamically loadable object
-files; the modules.
-
-</descrip>
-
-<sect>See also
-<label id="bibliography">
-
-<p><itemize>
-
-<item>The <bf/Linux-PAM/
-<htmlurl url="pam.html" name="System Administrators' Guide">.
-
-<item>The <bf/Linux-PAM/
-<htmlurl url="pam_modules.html" name="Module Writers' Guide">.
-
-<item>The V. Samar and R. Schemers (SunSoft), ``UNIFIED LOGIN WITH
-PLUGGABLE AUTHENTICATION MODULES'', Open Software Foundation Request
-For Comments 86.0, October 1995.
-
-</itemize>
-
-<sect>Notes
-
-<p>
-I intend to put development comments here... like ``at the moment
-this isn't actually supported''. At release time what ever is in
-this section will be placed in the Bugs section below! :)
-
-<p>
-<itemize>
-
-<item> <tt/pam_strerror()/ should be internationalized....
-
-<item>
-Note, the <tt/resp_retcode/ of struct <tt/pam_message/, has no
-purpose at the moment. Ideas/suggestions welcome!
-
-<item> more security issues are required....
-
-</itemize>
-
-<sect>Author/acknowledgments
-
-<p>
-This document was written by Andrew G. Morgan
-(morgan@transmeta.com) with many contributions from
-<!-- insert credits here -->
-<!--
- an sgml list of people to credit for their contributions to Linux-PAM
- $Id: CREDITS,v 1.4 1997/04/05 06:47:26 morgan Exp morgan $
- -->
-Peter Allgeyer,
-Tim Baverstock,
-Craig S. Bell,
-Derrick J. Brashear,
-Ben Buxton,
-Oliver Crow,
-Chris Dent,
-Marc Ewing,
-Cristian Gafton,
-Eric Hester,
-Roger Hu,
-Eric Jacksch,
-Michael K. Johnson,
-David Kinchlea,
-Nicolai Langfeldt,
-Elliot Lee,
-Al Longyear,
-Ingo Luetkebohle,
-Marek Michalkiewicz,
-Aleph One,
-Martin Pool,
-Sean Reifschneider,
-Erik Troan,
-Theodore Ts'o,
-Jeff Uphoff,
-Myles Uyema,
-Savochkin Andrey Vladimirovich,
-Ronald Wahl,
-David Wood,
-John Wilmes,
-Joseph S. D. Yao
-and
-Alex O. Yuriev.
-
-
-<p>
-Thanks are also due to Sun Microsystems, especially to Vipin Samar and
-Charlie Lai for their advice. At an early stage in the development of
-<bf/Linux-PAM/, Sun graciously made the documentation for their
-implementation of PAM available. This act greatly accelerated the
-development of <bf/Linux-PAM/.
-
-<sect>Bugs/omissions
-
-<p>
-This manual is hopelessly unfinished. Only a partial list of people is
-credited for all the good work they have done.
-
-<sect>Copyright information for this document
-
-<p>
-Copyright (c) Andrew G. Morgan 1996, 1997. All rights reserved.
-<newline>
-Email: <tt>&lt;morgan@transmeta.com&gt;</tt>
-
-<p>
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-<p>
-<itemize>
-
-<item>
-1. Redistributions of source code must retain the above copyright
- notice, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-<item>
-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.
-
-<item>
-3. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
-</itemize>
-
-<p>
-<bf/Alternatively/, this product may be distributed under the terms of
-the GNU General Public License (GPL), in which case the provisions of
-the GNU GPL are required <bf/instead of/ the above restrictions.
-(This clause is necessary due to a potential bad interaction between
-the GNU GPL and the restrictions contained in a BSD-style copyright.)
-
-<p>
-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.
-
-<p>
-<tt>$Id: pam_appl.sgml,v 1.16 1997/04/05 06:49:14 morgan Exp morgan $</tt>
-
-</article>
diff --git a/contrib/libpam/doc/pam_modules.sgml b/contrib/libpam/doc/pam_modules.sgml
deleted file mode 100644
index 418b09beafd3..000000000000
--- a/contrib/libpam/doc/pam_modules.sgml
+++ /dev/null
@@ -1,1425 +0,0 @@
-<!doctype linuxdoc system>
-
-<!--
-
- $Id: pam_modules.sgml,v 1.19 1997/04/05 06:49:14 morgan Exp morgan $
-
- Copyright (c) Andrew G. Morgan 1996, 1997. All rights reserved.
-
- ** some sections, in this document, were contributed by other
- ** authors. They carry individual copyrights.
-
-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, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-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.
-
-ALTERNATIVELY, this product may be distributed under the terms of the
-GNU General Public License, in which case the provisions of the GNU
-GPL are required INSTEAD OF the above restrictions. (This clause is
-necessary due to a potential bad interaction between the GNU GPL and
-the restrictions contained in a BSD-style copyright.)
-
-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.
-
- -->
-
-<article>
-
-<title>The Linux-PAM Module Writers' Guide
-<author>Andrew G. Morgan, <tt>morgan@transmeta.com</tt>
-<date>DRAFT v0.59 1997/10/17
-<abstract>
-This manual documents what a programmer needs to know in order to
-write a module that conforms to the <bf/Linux-PAM/ standard. It also
-discusses some security issues from the point of view of the module
-programmer.
-</abstract>
-
-<toc>
-
-<sect>Introduction
-
-<sect1> Synopsis
-<p>
-<tscreen>
-<verb>
-#include <security/pam_modules.h>
-
-gcc -fPIC -c pam_module-name.c
-ld -x --shared -o pam_module-name.so pam_module-name.o -lpam
-</verb>
-</tscreen>
-
-<sect1> Description
-
-<p>
-<bf/Linux-PAM/ (Pluggable Authentication Modules for Linux) is a
-library that enables the local system administrator to choose how
-individual applications authenticate users. For an overview of the
-<bf/Linux-PAM/ library see the <bf/Linux-PAM/ System Administrators'
-Guide.
-
-<p>
-A <bf/Linux-PAM/ module is a single executable binary file that can be
-loaded by the <bf/Linux-PAM/ interface library. This PAM library is
-configured locally with a system file, <tt>/etc/pam.conf</tt>, to
-authenticate a user request via the locally available authentication
-modules. The modules themselves will usually be located in the
-directory <tt>/usr/lib/security</tt> and take the form of dynamically
-loadable object files (see dlopen(3)). Alternatively, the modules can
-be statically linked into the <bf/Linux-PAM/ library; this is mostly to
-allow <bf/Linux-PAM/ to be used on platforms without dynamic linking
-available, but the two forms can be used together. It is the
-<bf/Linux-PAM/ interface that is called by an application and it is
-the responsibility of the library to locate, load and call the
-appropriate functions in a <bf/Linux-PAM/-module.
-
-<p>
-Except for the immediate purpose of interacting with the user
-(entering a password etc..) the module should never call the
-application directly. This exception requires a "conversation
-mechanism" which is documented below.
-
-<sect>What can be expected by the module
-
-<p>
-Here we list the interface that the conventions that all
-<bf/Linux-PAM/ modules must adhere to.
-
-<sect1>Getting and setting <tt/PAM_ITEM/s and <em/data/
-
-<p>
-First, we cover what the module should expect from the <bf/Linux-PAM/
-library and a <bf/Linux-PAM/ <em/aware/ application. Essesntially this
-is the <tt/libpam.*/ library.
-
-<sect2>
-Setting data
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_set_data(pam_handle_t *pamh
- , const char *module_data_name
- , void *data
- , void (*cleanup)(pam_handle_t *pamh
- , void *data
- , int error_status)
- );
-</verb>
-</tscreen>
-
-<p>
-The modules may be dynamically loadable objects. In general such files
-should not contain <tt/static/ variables. This and the subsequent
-function provide a mechanism for a module to associate some data with
-the handle <tt/pamh/. Typically a module will call the
-<tt/pam_set_data()/ function to register some data under a (hopefully)
-unique <tt/module_data_name/. The data is available for use by other
-modules too but <em/not/ by an application.
-
-<p>
-The function <tt/cleanup()/ is associated with the <tt/data/ and, if
-non-<tt/NULL/, it is called when this data is over-written or
-following a call to <tt/pam_end()/ (see the Linux-PAM Application
-Developers' Guide).
-
-<p>
-The <tt/error_status/ argument is used to indicate to the module the
-sort of action it is to take in cleaning this data item. As an
-example, Kerberos creates a ticket file during the authentication
-phase, this file might be associated with a data item. When
-<tt/pam_end()/ is called by the module, the <tt/error_status/
-carries the return value of the <tt/pam_authenticate()/ or other
-<tt/libpam/ function as appropriate. Based on this value the Kerberos
-module may choose to delete the ticket file (<em/authentication
-failure/) or leave it in place.
-
-<p>
-(*This paragraph is currently under advisement with Sun*) The
-<tt/error_status/ may have been logically OR'd with either of the
-following two values:
-
-<p>
-<descrip>
-<tag><tt/PAM_DATA_REPLACE/</tag>
- When a data item is being replaced (through a second call to
-<tt/pam_set_data()/) this mask is used is used. Otherwise, the call is
-assumed to be from <tt/pam_end()/.
-
-<tag><tt/PAM_DATA_SILENT/</tag>
- Which indicates that the process would prefer to perform the
-<tt/cleanup()/ quietly. That is, discourages logging/messages to the
-user.
-
-</descrip>
-
-
-<sect2>
-Getting data
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_get_data(const pam_handle_t *pamh
- , const char *module_data_name
- , const void **data
- );
-</verb>
-</tscreen>
-
-<p>
-This function together with the previous one provides a method of
-associating module-specific data with the handle <tt/pamh/. A
-successful call to <tt/pam_get_data/ will result in <tt/*data/
-pointing to the data associated with the <tt/module_data_name/. Note,
-this data is <em/not/ a copy and should be treated as <em/constant/
-by the module.
-
-<p>
-Note, if there is an entry but it has the value <tt/NULL/, then this
-call returns <tt/PAM_NO_MODULE_DATA/.
-
-<sect2>
-Setting items
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_set_item(pam_handle_t *pamh
- , int item_type
- , const void *item
- );
-</verb>
-</tscreen>
-
-<p>
-This function is used to (re)set the value of one of the
-<tt/item_type/s. The reader is urged to read the entry for this
-function in the <bf/Linux-PAM/ application developers' manual.
-
-<p>
-In addition to the <tt/item/s listed there, the module can set the
-following two <tt/item_type/s:
-
-<p>
-<descrip>
-<tag><tt/PAM_AUTHTOK/</tag>
-
-The authentication token (password). This token should be ignored by
-all module functions besides <tt/pam_sm_authenticate()/ and
-<tt/pam_sm_chauthtok()/. In the former function it is used to pass the
-most recent authentication token from one stacked module to
-another. In the latter function the token is used for another
-purpose. It contains the currently active authentication token.
-
-<tag><tt/PAM_OLDAUTHTOK/</tag>
-
-The old authentication token. This token should be ignored by all
-module functions except <tt/pam_sm_chauthtok()/.
-
-</descrip>
-
-<p>
-Both of these items are reset before returning to the application.
-When resetting these items, the <bf/Linux-PAM/ library first writes
-<tt/0/'s to the current tokens and then <tt/free()/'s the associated
-memory.
-
-<p>
-The return values for this function are listed in the
-<bf>Linux-PAM</bf> Application Developers' Guide.
-
-<sect2>
-Getting items
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_get_item(const pam_handle_t *pamh
- , int item_type
- , const void **item
- );
-</verb>
-</tscreen>
-
-<p>
-This function is used to obtain the value of the specified
-<tt/item_type/. It is better documented in the <bf/Linux-PAM/
-Application Developers' Guide. However, there are three things worth
-stressing here:
-<itemize>
-
-<item>
-Generally, if the module wishes to obtain the name of the user, it
-should not use this function, but instead perform a call to
-<tt/pam_get_user()/ (see section <ref id="pam-get-user"
-name="below">).
-
-<item>
-The module is additionally privileged to read the authentication
-tokens, <tt/PAM_AUTHTOK/ and <tt/PAM_OLDAUTHTOK/ (see the section
-above on <tt/pam_set_data()/).
-
-<item>
-The module should <em/not/ <tt/free()/ or alter the data pointed to by
-<tt/*item/ after a successful return from <tt/pam_get_item()/. This
-pointer points directly at the data contained within the <tt/*pamh/
-structure. Should a module require that a change is made to the this
-<tt/ITEM/ it should make the appropriate call to <tt/pam_set_item()/.
-</itemize>
-
-<sect2>The <em/conversation/ mechanism
-
-<p>
-Following the call <tt>pam_get_item(pamh,PAM_CONV,&amp;item)</tt>, the
-pointer <tt/item/ points to a <em/conversation/-function that provides
-limited but direct access to the application. The purpose of this
-function is to allow the module to prompt the user for their password
-and pass other information in a manner consistent with the
-application. For example, an X-windows based program might pop up a
-dialog box to report a login failure. Just as the application should
-not be concerned with the method of authentication, so the module
-should not dictate the manner in which input (output) is
-obtained from (presented to) to the user.
-
-<p>
-The reader is strongly urged to read the more complete description of
-the <tt/pam_conv/ structure, written from the perspective of the
-application developer, in the <bf/Linux-PAM/ Application Developers'
-Guide.
-
-<p>
-The <tt/pam_response/ structure returned after a call to the
-<tt/pam_conv/ function must be <tt/free()/'d by the module. Since the
-call to the conversation function originates from the module, it is
-clear that either this <tt/pam_response/ structure could be either
-statically or dynamically (using <tt/malloc()/ etc.) allocated within
-the application. Repeated calls to the conversation function would
-likely overwrite static memory, so it is required that for a
-successful return from the conversation function the memory for the
-response structure is dynamically allocated by the application with
-one of the <tt/malloc()/ family of commands and <em/must/ be
-<tt/free()/'d by the module.
-
-<p>
-If the <tt/pam_conv/ mechanism is used to enter authentication tokens,
-the module should either pass the result to the <tt/pam_set_item()/
-library function, or copy it itself. In such a case, once the token
-has been stored (by one of these methods or another one), the memory
-returned by the application should be overwritten with <tt/0/'s, and
-then <tt/free()/'d.
-
-<p>
-The return values for this function are listed in the
-<bf>Linux-PAM</bf> Application Developers' Guide.
-
-<sect2>Getting the name of a user<label id="pam-get-user">
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_get_user(pam_handle_t *pamh
- , const char **user
- , const char *prompt
- );
-</verb>
-</tscreen>
-
-<p>
-This is a <bf/Linux-PAM/ library function that returns the
-(prospective) name of the user. To determine the username it does the
-following things, in this order:
-<itemize>
-
-<item> checks what <tt/pam_get_item(pamh, PAM_USER, ... );/ would have
-returned. If this is not <tt/NULL/ this is what it returns. Otherwise,
-
-<item> obtains a username from the application via the <tt/pam_conv/
-mechanism, it prompts the user with the first non-<tt/NULL/ string in
-the following list:
-<itemize>
-
-<item> The <tt/prompt/ argument passed to the function
-<item> What is returned by <tt/pam_get_item(pamh,PAM_USER_PROMPT, ... );/
-<item> The default prompt: ``Please enter username: ''
-
-</itemize>
-</itemize>
-
-<p>
-By whatever means the username is obtained, a pointer to it is
-returned as the contents of <tt/*user/. Note, this memory should
-<em/not/ be <tt/free()/'d by the module. Instead, it will be liberated
-on the next call to <tt/pam_get_user()/, or by <tt/pam_end()/ when the
-application ends its interaction with <bf/Linux-PAM/.
-
-<p>
-Also, in addition, it should be noted that this function sets the
-<tt/PAM_USER/ item that is associated with the <tt/pam_[gs]et_item()/
-function.
-
-<sect2>Setting a Linux-PAM environment variable
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern int pam_putenv(pam_handle_t *pamh, const char *name_value);
-</verb>
-</tscreen>
-
-<p>
-<bf/Linux-PAM/ (0.54+) comes equipped with a series of functions for
-maintaining a set of <em/environment/ variables. The environment is
-initialized by the call to <tt/pam_start()/ and is <bf/erased/ with a
-call to <tt/pam_end()/. This <em/environment/ is associated with the
-<tt/pam_handle_t/ pointer returned by the former call.
-
-<p>
-The default environment is all but empty. It contains a single
-<tt/NULL/ pointer, which is always required to terminate the
-variable-list. The <tt/pam_putenv()/ function can be used to add a
-new environment variable, replace an existing one, or delete an old
-one.
-
-<p>
-<itemize>
-<item>Adding/replacing a variable<newline>
-
-To add or overwrite a <bf/Linux-PAM/ environment variable the value of
-the argument <tt/name_value/, should be of the following form:
-<tscreen>
-<verb>
-name_value="VARIABLE=VALUE OF VARIABLE"
-</verb>
-</tscreen>
-Here, <tt/VARIABLE/ is the environment variable's name and what
-follows the `<tt/=/' is its (new) value. (Note, that <tt/"VARIABLE="/
-is a valid value for <tt/name_value/, indicating that the variable is
-set to <tt/""/.)
-
-<item> Deleting a variable<newline>
-
-To delete a <bf/Linux-PAM/ environment variable the value of
-the argument <tt/name_value/, should be of the following form:
-<tscreen>
-<verb>
-name_value="VARIABLE"
-</verb>
-</tscreen>
-Here, <tt/VARIABLE/ is the environment variable's name and the absence
-of an `<tt/=/' indicates that the variable should be removed.
-
-</itemize>
-
-<p>
-In all cases <tt/PAM_SUCCESS/ indicates success.
-
-<sect2>Getting a Linux-PAM environment variable
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern const char *pam_getenv(pam_handle_t *pamh, const char *name);
-</verb>
-</tscreen>
-
-<p>
-This function can be used to return the value of the given
-variable. If the returned value is <tt/NULL/, the variable is not
-known.
-
-<sect2>Listing the Linux-PAM environment
-
-<p>
-Synopsis:
-<tscreen>
-<verb>
-extern char * const *pam_getenvlist(pam_handle_t *pamh);
-</verb>
-</tscreen>
-
-<p>
-This function returns a pointer to the entire <bf/Linux-PAM/
-environment array. At first sight the <em/type/ of the returned data
-may appear a little confusing. It is basically a <em/read-only/ array
-of character pointers, that lists the <tt/NULL/ terminated list of
-environment variables set so far.
-
-<p>
-Although, this is not a concern for the module programmer, we mention
-here that an application should be careful to copy this entire array
-before executing <tt/pam_end()/ otherwise all the variable information
-will be lost. (There are functions in <tt/libpam_misc/ for this
-purpose: <tt/pam_misc_copy_env()/ and <tt/pam_misc_drop_env()/.)
-
-<sect1>Other functions provided by <tt/libpam/
-
-<sect2>Understanding errors
-
-<p>
-<itemize>
-
-<item>
-<tt>extern const char *pam_strerror(pam_handle_t *pamh, int errnum);</tt>
-
-<p>
-This function returns some text describing the <bf/Linux-PAM/ error
-associated with the argument <tt/errnum/. If the error is not
-recognized <tt/``Unknown Linux-PAM error''/ is returned.
-
-</itemize>
-
-<sect2>Planning for delays
-
-<p>
-<itemize>
-
-<item>
-<tt>extern int pam_fail_delay(pam_handle_t *pamh, unsigned int
-micro_sec)</tt>
-
-<p>
-This function is offered by <bf/Linux-PAM/ to facilitate time delays
-following a failed call to <tt/pam_authenticate()/ and before control
-is returned to the application. When using this function the module
-programmer should check if it is available with,
-<tscreen>
-<verb>
-#ifdef HAVE_PAM_FAIL_DELAY
- ....
-#endif /* HAVE_PAM_FAIL_DELAY */
-</verb>
-</tscreen>
-
-<p>
-Generally, an application requests that a user is authenticated by
-<bf/Linux-PAM/ through a call to <tt/pam_authenticate()/ or
-<tt/pam_chauthtok()/. These functions calls each of the <em/stacked/
-authentication modules listed in the <tt>/etc/pam.conf</tt> file. As
-directed by this file, one of more of the modules may fail causing the
-<tt/pam_...()/ call to return an error. It is desirable for there to
-also be a pause before the application continues. The principal reason
-for such a delay is security: a delay acts to discourage <em/brute
-force/ dictionary attacks primarily, but also helps hinder
-<em/timed/ (covert channel) attacks.
-
-<p>
-The <tt/pam_fail_delay()/ function provides the mechanism by which an
-application or module can suggest a minimum delay (of <tt/micro_sec/
-<em/micro-seconds/). <bf/Linux-PAM/ keeps a record of the longest time
-requested with this function. Should <tt/pam_authenticate()/ fail,
-the failing return to the application is delayed by an amount of time
-randomly distributed (by up to 25%) about this longest value.
-
-<p>
-Independent of success, the delay time is reset to its zero default
-value when <bf/Linux-PAM/ returns control to the application.
-
-</itemize>
-
-<sect>What is expected of a module
-
-<p>
-The module must supply a sub-set of the six functions listed
-below. Together they define the function of a <bf/Linux-PAM
-module/. Module developers are strongly urged to read the comments on
-security that follow this list.
-
-<sect1> Overview
-
-<p>
-The six module functions are grouped into four independent management
-groups. These groups are as follows: <em/authentication/,
-<em/account/, <em/session/ and <em/password/. To be properly defined,
-a module must define all functions within at least one of these
-groups. A single module may contain the necessary functions for
-<em/all/ four groups.
-
-<sect2> Functional independence
-
-<p>
-The independence of the four groups of service a module can offer
-means that the module should allow for the possibility that any one of
-these four services may legitimately be called in any order. Thus, the
-module writer should consider the appropriateness of performing a
-service without the prior success of some other part of the module.
-
-<p>
-As an informative example, consider the possibility that an
-application applies to change a user's authentication token, without
-having first requested that <bf/Linux-PAM/ authenticate the user. In
-some cases this may be deemed appropriate: when <tt/root/ wants to
-change the authentication token of some lesser user. In other cases it
-may not be appropriate: when <tt/joe/ maliciously wants to reset
-<tt/alice/'s password; or when anyone other than the user themself
-wishes to reset their <em/KERBEROS/ authentication token. A policy for
-this action should be defined by any reasonable authentication scheme,
-the module writer should consider this when implementing a given
-module.
-
-<sect2> Minimizing administration problems
-
-<p>
-To avoid system administration problems and the poor construction of a
-<tt>/etc/pam.conf</tt> file, the module developer may define all
-six of the following functions. For those functions that would not be
-called, the module should return <tt/PAM_SERVICE_ERR/ and write an
-appropriate message to the system log. When this action is deemed
-inappropriate, the function would simply return <tt/PAM_IGNORE/.
-
-<sect2> Arguments supplied to the module
-
-<p>
-The <tt/flags/ argument of each of the following functions can be
-logically OR'd with <tt/PAM_SILENT/, which is used to inform the
-module to not pass any <em/text/ (errors or warnings) to the
-application.
-
-<p>
-The <tt/argc/ and <tt/argv/ arguments are taken from the line
-appropriate to this module---that is, with the <em/service_name/
-matching that of the application---in the configuration file (see the
-<bf/Linux-PAM/ System Administrators' Guide). Together these two
-parameters provide the number of arguments and an array of pointers to
-the individual argument tokens. This will be familiar to C programmers
-as the ubiquitous method of passing command arguments to the function
-<tt/main()/. Note, however, that the first argument (<tt/argv[0]/) is
-a true argument and <bf/not/ the name of the module.
-
-<sect1> Authentication management
-
-<p>
-To be correctly initialized, <tt/PAM_SM_AUTH/ must be <tt/#define/'d
-prior to including <tt>&lt;security/pam_modules.h&gt;</tt>. This will
-ensure that the prototypes for static modules are properly declared.
-
-<p>
-<itemize>
-
-<item>
-<tt>PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,
-int argc, const char **argv);</tt>
-
-<p>
-This function performs the task of authenticating the user.
-
-<p>
-The <tt/flags/ argument can be a logically OR'd with <tt/PAM_SILENT/
-and optionally take the following value:
-
-<p><descrip>
-<tag><tt/PAM_DISALLOW_NULL_AUTHTOK/</tag>
- return <tt/PAM_AUTH_ERR/ if the database of authentication
-tokens for this authentication mechanism has a <tt/NULL/ entry for the
-user. Without this flag, such a <tt/NULL/ token will lead to a success
-without the user being prompted.
-</descrip>
-
-<p>
-Besides <tt/PAM_SUCCESS/ return values that can be sent by this
-function are one of the following:
-
-<descrip>
-
-<tag><tt/PAM_AUTH_ERR/</tag>
- The user was not authenticated
-<tag><tt/PAM_CRED_INSUFFICIENT/</tag>
- For some reason the application does not have sufficient
-credentials to authenticate the user.
-<tag><tt/PAM_AUTHINFO_UNAVAIL/</tag>
- The modules were not able to access the authentication
-information. This might be due to a network or hardware failure etc.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The supplied username is not known to the authentication
-service
-<tag><tt/PAM_MAXTRIES/</tag>
- One or more of the authentication modules has reached its
-limit of tries authenticating the user. Do not try again.
-
-</descrip>
-
-<item>
-<tt>PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int
-argc, const char **argv);</tt>
-
-<p>
-This function performs the task of altering the credentials of the
-user with respect to the corresponding authorization
-scheme. Generally, an authentication module may have access to more
-information about a user than their authentication token. This
-function is used to append such information to the application. It
-should only be called <em/after/ the user has been authenticated.
-
-<p>
-Permitted flags, one of which, may be logically OR'd with
-<tt/PAM_SILENT/ are,
-
-<p><descrip>
-<tag><tt/PAM_ESTABLISH_CRED/</tag>
- Set the credentials for the authentication service,
-<tag><tt/PAM_DELETE_CRED/</tag>
- Delete the credentials associated with the authentication service,
-<tag><tt/PAM_REINITIALIZE_CRED/</tag>
- Reinitialize the user credentials, and
-<tag><tt/PAM_REFRESH_CRED/</tag>
- Extend the lifetime of the user credentials.
-</descrip>
-
-<p>
-Besides <tt/PAM_SUCCESS/, the module may return one of the following
-errors:
-
-<p><descrip>
-<tag><tt/PAM_CRED_UNAVAIL/</tag>
- This module cannot retrieve the user's credentials.
-<tag><tt/PAM_CRED_EXPIRED/</tag>
- The user's credentials have expired.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to this authentication module.
-<tag><tt/PAM_CRED_ERR/</tag>
- This module was unable to set the credentials of the user.
-</descrip>
-
-</itemize>
-
-<sect1> Account management
-
-<p>
-To be correctly initialized, <tt/PAM_SM_ACCOUNT/ must be
-<tt/#define/'d prior to including <tt>&lt;security/pam_modules.h&gt;</tt>.
-This will ensure that the prototype for a static module is properly
-declared.
-
-<p>
-<itemize>
-
-<item>
-<tt>PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int
-argc, const char **argv);</tt>
-
-<p>
-This function performs the task of establishing whether the user is
-permitted to gain access at this time. It should be understood that
-the user has previously been validated by an authentication
-module. This function checks for other things. Such things might be:
-the time of day or the date, the terminal line, remote
-hostname, etc. .
-
-<p>
-This function may also determine things like the expiration on
-passwords, and respond that the user change it before continuing.
-
-<p>
-Valid flags, which may be logically OR'd with <tt/PAM_SILENT/, are the
-same as those applicable to the <tt/flags/ argument of
-<tt/pam_sm_authenticate/.
-
-<p>
-This function may return one of the following errors,
-
-<descrip>
-
-<tag><tt/PAM_ACCT_EXPIRED/</tag>
- The user is no longer permitted access to the system.
-<tag><tt/PAM_AUTH_ERR/</tag>
- There was an authentication error.
-<tag><tt/PAM_AUTHTOKEN_REQD/</tag>
- The user's authentication token has expired. Before calling
-this function again the application will arrange for a new one to be
-given. This will likely result in a call to <tt/pam_sm_chauthtok()/.
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to the module's account management
-component.
-
-</descrip>
-
-</itemize>
-
-<sect1> Session management
-
-<p>
-To be correctly initialized, <tt/PAM_SM_SESSION/ must be
-<tt/#define/'d prior to including
-<tt>&lt;security/pam_modules.h&gt;</tt>. This will ensure that the
-prototypes for static modules are properly declared.
-
-<p>
-The following two functions are defined to handle the
-initialization/termination of a session. For example, at the beginning
-of a session the module may wish to log a message with the system
-regarding the user. Similarly, at the end of the session the module
-would inform the system that the user's session has ended.
-
-<p>
-It should be possible for sessions to be opened by one application and
-closed by another. This either requires that the module uses only
-information obtained from <tt/pam_get_item()/, or that information
-regarding the session is stored in some way by the operating system
-(in a file for example).
-
-<p>
-<itemize>
-
-<item>
-<tt>PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int
-argc, const char **argv);</tt>
-
-<p>
-This function is called to commence a session. The only valid, but
-optional, flag is <tt/PAM_SILENT/.
-
-<p>
-As a return value, <tt/PAM_SUCCESS/ signals success and
-<tt/PAM_SESSION_ERR/ failure.
-
-<item>
-<tt>PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int
-argc, const char **argv);</tt>
-
-<p>
-This function is called to terminate a session. The only valid, but
-optional, flag is <tt/PAM_SILENT/.
-
-<p>
-As a return value, <tt/PAM_SUCCESS/ signals success and
-<tt/PAM_SESSION_ERR/ failure.
-
-</itemize>
-
-<sect1> Password management
-
-<p>
-To be correctly initialized, <tt/PAM_SM_PASSWORD/ must be
-<tt/#define/'d prior to including <tt>&lt;security/pam_modules.h&gt;</tt>.
-This will ensure that the prototype for a static module is properly
-declared.
-
-<p>
-<itemize>
-
-<item>
-<tt>PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int
-argc, const char **argv);</tt>
-
-<p>
-This function is used to (re-)set the authentication token of the
-user. A valid flag, which may be logically OR'd with <tt/PAM_SILENT/,
-can be built from the following list,
-
-<descrip>
-<tag><tt/PAM_CHANGE_EXPIRED_AUTHTOK/</tag>
- This argument indicates to the module that the users
-authentication token (password) should only be changed if it has
-expired. This flag is optional and <em/must/ be combined with one of
-the following two flags. Note, however, the following two options are
-<em/mutually exclusive/.
-
-<tag><tt/PAM_PRELIM_CHECK/</tag>
- This indicates that the modules are being probed as to their
-ready status for altering the user's authentication token. If the
-module requires access to another system over some network it should
-attempt to verify it can connect to this system on receiving this
-flag. If a module cannot establish it is ready to update the user's
-authentication token it should return <tt/PAM_TRY_AGAIN/, this
-information will be passed back to the application.
-
-<tag><tt/PAM_UPDATE_AUTHTOK/</tag>
- This informs the module that this is the call it should change
-the authorization tokens. If the flag is logically OR'd with
-<tt/PAM_CHANGE_EXPIRED_AUTHTOK/, the token is only changed if it has
-actually expired.
-
-</descrip>
-
-<p>
-Note, the <bf/Linux-PAM/ library calls this function twice in
-succession. The first time with <tt/PAM_PRELIM_CHECK/ and then, if the
-module does not return <tt/PAM_TRY_AGAIN/, subsequently with
-<tt/PAM_UPDATE_AUTHTOK/. It is only on the second call that the
-authorization token is (possibly) changed.
-
-<p>
-<tt/PAM_SUCCESS/ is the only successful return value, valid
-error-returns are:
-
-<descrip>
-<tag><tt/PAM_AUTHTOK_ERR/</tag>
- The module was unable to obtain the new authentication token.
-
-<tag><tt/PAM_AUTHTOK_RECOVERY_ERR/</tag>
- The module was unable to obtain the old authentication token.
-
-<tag><tt/PAM_AUTHTOK_LOCK_BUSY/</tag>
- Cannot change the authentication token since it is currently
-locked.
-
-<tag><tt/PAM_AUTHTOK_DISABLE_AGING/</tag>
- Authentication token aging has been disabled.
-
-<tag><tt/PAM_PERM_DENIED/</tag>
- Permission denied.
-
-<tag><tt/PAM_TRY_AGAIN/</tag>
- Preliminary check was unsuccessful. Signals an immediate return
-to the application is desired.
-
-<tag><tt/PAM_USER_UNKNOWN/</tag>
- The user is not known to the authentication token changing
-service.
-
-</descrip>
-
-</itemize>
-
-<sect>Generic optional arguments
-
-<p>
-Here we list the generic arguments that all modules can expect to
-be passed. They are not mandatory, and their absence should be
-accepted without comment by the module.
-
-<p>
-<descrip>
-<tag><tt/debug/</tag>
-
-Use the <tt/syslog(3)/ call to log debugging information to the system
-log files.
-
-<tag><tt/no_warn/</tag>
-
-Instruct module to not give warning messages to the application.
-
-<tag><tt/use_first_pass/</tag>
-
-The module should not prompt the user for a password. Instead, it
-should obtain the previously typed password (by a call to
-<tt/pam_get_item()/ for the <tt/PAM_AUTHTOK/ item), and use that. If
-that doesn't work, then the user will not be authenticated. (This
-option is intended for <tt/auth/ and <tt/passwd/ modules only).
-
-<tag><tt/try_first_pass/</tag>
-
-The module should attempt authentication with the previously typed
-password (by a call to <tt/pam_get_item()/ for the <tt/PAM_AUTHTOK/
-item). If that doesn't work, then the user is prompted for a
-password. (This option is intended for <tt/auth/ modules only).
-
-<tag><tt/use_mapped_pass/</tag>
-
-<bf/WARNING:/ coding this functionality may cause the module writer to
-break <em/local/ encryption laws. For example, in the U.S. there are
-restrictions on the export computer code that is capable of strong
-encryption. It has not been established whether this option is
-affected by this law, but one might reasonably assume that it does
-until told otherwise. For this reason, this option is not supported
-by any of the modules distributed with <bf/Linux-PAM/.
-
-The intended function of this argument, however, is that the module
-should take the existing authentication token from a previously
-invoked module and use it as a key to retrieve the authentication
-token for this module. For example, the module might create a strong
-hash of the <tt/PAM_AUTHTOK/ item (established by a previously
-executed module). Then, with logical-exclusive-or, use the result as a
-<em/key/ to safely store/retrieve the authentication token for this
-module in/from a local file <em/etc/. .
-
-</descrip>
-
-<sect>Programming notes
-
-<p>
-Here we collect some pointers for the module writer to bear in mind
-when writing/developing a <bf/Linux-PAM/ compatible module.
-
-<sect1>Security issues for module creation
-
-<sect2>Sufficient resources
-
-<p>
-Care should be taken to ensure that the proper execution of a module
-is not compromised by a lack of system resources. If a module is
-unable to open sufficient files to perform its task, it should fail
-gracefully, or request additional resources. Specifically, the
-quantities manipulated by the <tt/setrlimit(2)/ family of commands
-should be taken into consideration.
-
-<sect2>Who's who?
-
-<p>
-Generally, the module may wish to establish the identity of the user
-requesting a service. This may not be the same as the username
-returned by <tt/pam_get_user()/. Indeed, that is only going to be the
-name of the user under whose identity the service will be given. This
-is not necessarily the user that requests the service.
-
-<p>
-In other words, user X runs a program that is setuid-Y, it grants the
-user to have the permissions of Z. A specific example of this sort of
-service request is the <em/su/ program: user <tt/joe/ executes
-<em/su/ to become the user <em/jane/. In this situation X=<tt/joe/,
-Y=<tt/root/ and Z=<tt/jane/. Clearly, it is important that the module
-does not confuse these different users and grant an inappropriate
-level of privilege.
-
-<p>
-The following is the convention to be adhered to when juggling
-user-identities.
-
-<p>
-<itemize>
-<item>X, the identity of the user invoking the service request.
-This is the user identifier; returned by the function <tt/getuid(2)/.
-
-<item>Y, the privileged identity of the application used to grant the
-requested service. This is the <em/effective/ user identifier;
-returned by the function <tt/geteuid(2)/.
-
-<item>Z, the user under whose identity the service will be granted.
-This is the username returned by <tt/pam_get_user(2)/ and also stored
-in the <bf/Linux-PAM/ item, <tt/PAM_USER/.
-
-<item><bf/Linux-PAM/ has a place for an additional user identity that
-a module may care to make use of. This is the <tt/PAM_RUSER/ item.
-Generally, network sensitive modules/applications may wish to set/read
-this item to establish the identity of the user requesting a service
-from a remote location.
-
-</itemize>
-
-<p>
-Note, if a module wishes to modify the identity of either the <tt/uid/
-or <tt/euid/ of the running process, it should take care to restore
-the original values prior to returning control to the <bf/Linux-PAM/
-library.
-
-<sect2>Using the conversation function
-<p>
-Prior to calling the conversation function, the module should reset
-the contents of the pointer that will return the applications
-response. This is a good idea since the application may fail to fill
-the pointer and the module should be in a position to notice!
-
-<p>
-The module should be prepared for a failure from the conversation. The
-generic error would be <tt/PAM_CONV_ERR/, but anything other than
-<tt/PAM_SUCCESS/ should be treated as indicating failure.
-
-<sect2>Authentication tokens
-
-<p>
-To ensure that the authentication tokens are not left lying around the
-items, <tt/PAM_AUTHTOK/ and <tt/PAM_OLDAUTHTOK/, are not available to
-the application: they are defined in
-<tt>&lt;security/pam_modules.h&gt;</tt>. This is ostensibly for
-security reasons, but a maliciously programmed application will always
-have access to all memory of the process, so it is only superficially
-enforced. As a general rule the module should overwrite
-authentication tokens as soon as they are no longer needed.
-Especially before <tt/free()/'ing them. The <bf/Linux-PAM/ library is
-required to do this when either of these authentication token items
-are (re)set.
-
-<p>
-Not to dwell too little on this concern; should the module store the
-authentication tokens either as (automatic) function variables or
-using <tt/pam_[gs]et_data()/ the associated memory should be
-over-written explicitly before it is released. In the case of the
-latter storage mechanism, the associated <tt/cleanup()/ function
-should explicitly overwrite the <tt/*data/ before <tt/free()/'ing it:
-for example,
-
-<tscreen>
-<verb>
-/*
- * An example cleanup() function for releasing memory that was used to
- * store a password.
- */
-
-int cleanup(pam_handle_t *pamh, void *data, int error_status)
-{
- char *xx;
-
- if ((xx = data)) {
- while (*xx)
- *xx++ = '\0';
- free(data);
- }
- return PAM_SUCCESS;
-}
-</verb>
-</tscreen>
-
-<sect1>Use of <tt/syslog(3)/
-
-<p>
-Only rarely should error information be directed to the user. Usually,
-this is to be limited to ``<em/sorry you cannot login now/'' type
-messages. Information concerning errors in the configuration file,
-<tt>/etc/pam.conf</tt>, or due to some system failure encountered by
-the module, should be written to <tt/syslog(3)/ with
-<em/facility-type/ <tt/LOG_AUTHPRIV/.
-
-<p>
-With a few exceptions, the level of logging is, at the discretion of
-the module developer. Here is the recommended usage of different
-logging levels:
-
-<p>
-<itemize>
-
-<item>
-As a general rule, errors encountered by a module should be logged at
-the <tt/LOG_ERR/ level. However, information regarding an unrecognized
-argument, passed to a module from an entry in the
-<tt>/etc/pam.conf</tt> file, is <bf/required/ to be logged at the
-<tt/LOG_ERR/ level.
-
-<item>
-Debugging information, as activated by the <tt/debug/ argument to the
-module in <tt>/etc/pam.conf</tt>, should be logged at the
-<tt/LOG_DEBUG/ level.
-
-<item>
-If a module discovers that its personal configuration file or some
-system file it uses for information is corrupted or somehow unusable,
-it should indicate this by logging messages at level, <tt/LOG_ALERT/.
-
-<item>
-Shortages of system resources, such as a failure to manipulate a file
-or <tt/malloc()/ failures should be logged at level <tt/LOG_CRIT/.
-
-<item>
-Authentication failures, associated with an incorrectly typed password
-should be logged at level, <tt/LOG_NOTICE/.
-
-</itemize>
-
-<sect1> Modules that require system libraries
-
-<p>
-Writing a module is much like writing an application. You have to
-provide the "conventional hooks" for it to work correctly, like
-<tt>pam_sm_authenticate()</tt> etc., which would correspond to the
-<tt/main()/ function in a normal function.
-
-<p>
-Typically, the author may want to link against some standard system
-libraries. As when one compiles a normal program, this can be done for
-modules too: you simply append the <tt>-l</tt><em>XXX</em> arguments
-for the desired libraries when you create the shared module object. To
-make sure a module is linked to the <tt>lib<em>whatever</em>.so</tt>
-library when it is <tt>dlopen()</tt>ed, try:
-<tscreen>
-<verb>
-% gcc -shared -Xlinker -x -o pam_module.so pam_module.o -lwhatever
-</verb>
-</tscreen>
-
-<sect1> Added requirements for <em/statically/ loaded modules.
-
-<!--
- Copyright (C) Michael K. Johnson 1996.
- Last modified: AGM 1996/5/31.
- -->
-
-<p>
-Modules may be statically linked into libpam. This should be true of
-all the modules distributed with the basic <bf/Linux-PAM/
-distribution. To be statically linked, a module needs to export
-information about the functions it contains in a manner that does not
-clash with other modules.
-
-The extra code necessary to build a static module should be delimited
-with <tt/#ifdef PAM_STATIC/ and <tt/#endif/. The static code should do
-the following:
-<itemize>
-<item> Define a single structure, <tt/struct pam_module/, called
-<tt>_pam_<it>modname</it>_modstruct</tt>, where
-<tt><it>modname</it></tt> is the name of the module <bf/as used in the
-filesystem/ but without the leading directory name (generally
-<tt>/usr/lib/security/</tt> or the suffix (generally <tt/.so/).
-
-</itemize>
-
-<p>
-As a simple example, consider the following module code which defines
-a module that can be compiled to be <em/static/ or <em/dynamic/:
-
-<p>
-<tscreen>
-<verb>
-#include <stdio.h> /* for NULL define */
-
-#define PAM_SM_PASSWORD /* the only pam_sm_... function declared */
-#include <security/pam_modules.h>
-
-PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
- int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-#ifdef PAM_STATIC /* for the case that this module is static */
-
-struct pam_module _pam_modname_modstruct = { /* static module data */
- "pam_modname",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- pam_sm_chauthtok,
-};
-
-#endif /* end PAM_STATIC */
-</verb>
-</tscreen>
-
-<p>
-To be linked with <em/libpam/, staticly-linked modules must be built
-from within the <tt>Linux-PAM-X.YY/modules/</tt> subdirectory of the
-<bf/Linux-PAM/ source directory as part of a normal build of the
-<bf/Linux-PAM/ system.
-
-The <em/Makefile/, for the module in question, must execute the
-<tt/register_static/ shell script that is located in the
-<tt>Linux-PAM-X.YY/modules/</tt> subdirectory. This is to ensure that
-the module is properly registered with <em/libpam/.
-
-The <bf/two/ manditory arguments to <tt/register_static/ are the
-title, and the pathname of the object file containing the module's
-code. The pathname is specified relative to the
-<tt>Linux-PAM-X.YY/modules</tt> directory. The pathname may be an
-empty string---this is for the case that a single object file needs to
-register more than one <tt/struct pam_module/. In such a case, exactly
-one call to <tt/register_static/ must indicate the object file.
-
-<p>
-Here is an example; a line in the <em/Makefile/ might look like this:
-<tscreen>
-<verb>
-register:
-ifdef STATIC
- (cd ..; ./register_static pam_modname pam_modname/pam_modname.o)
-endif
-</verb>
-</tscreen>
-
-For some further examples, see the <tt>modules</tt> subdirectory of
-the current <bf/Linux-PAM/ distribution.
-
-<p>
-<sect>An example module file
-
-<p>
-<em>
-perhaps this should point to a place in the file structure!?
-</em>
-
-<sect>Files
-
-<p><descrip>
-
-<tag><tt>/usr/lib/libpam.so.*</tt></tag>
-
-the shared library providing applications with access to
-<bf/Linux-PAM/.
-
-<tag><tt>/etc/pam.conf</tt></tag>
-
-the <bf/Linux-PAM/ configuration file.
-
-<tag><tt>/usr/lib/security/pam_*.so</tt></tag>
-
-the primary location for <bf/Linux-PAM/ dynamically loadable object
-files; the modules.
-
-</descrip>
-
-<sect>See also
-
-<p><itemize>
-<item>The <bf/Linux-PAM/ System Administrators' Guide.
-<item>The <bf/Linux-PAM/ Application Writers' Guide.
-<item>
-V. Samar and R. Schemers (SunSoft), ``UNIFIED LOGIN WITH PLUGGABLE
-AUTHENTICATION MODULES'', Open Software Foundation Request For
-Comments 86.0, October 1995.
-</itemize>
-
-<sect>Notes
-
-<p>
-I intend to put development comments here... like ``at the moment
-this isn't actually supported''. At release time what ever is in
-this section will be placed in the Bugs section below! :)
-
-<p>
-<itemize>
-<item>
-Perhaps we should keep a registry of data-names as used by
-<tt/pam_[gs]et_data()/ so there are no unintentional problems due to
-conflicts?
-
-<item>
-<tt/pam_strerror()/ should be internationalized....
-
-<item>
-There has been some debate about whether <tt/initgroups()/ should be
-in an application or in a module. It was settled by Sun who stated
-that initgroups is an action of the <em/application/. The modules are
-permitted to add additional groups, however.
-
-<item>
-Refinements/futher suggestions to <tt/syslog(3)/ usage by modules are
-needed.
-
-</itemize>
-
-<sect>Author/acknowledgments
-
-<p>
-This document was written by Andrew G. Morgan
-(<tt/morgan@transmeta.com/) with many contributions from
-<!-- insert credits here -->
-<!--
- an sgml list of people to credit for their contributions to Linux-PAM
- -->
-<!--
- an sgml list of people to credit for their contributions to Linux-PAM
- $Id: CREDITS,v 1.4 1997/04/05 06:47:26 morgan Exp morgan $
- -->
-Peter Allgeyer,
-Tim Baverstock,
-Craig S. Bell,
-Derrick J. Brashear,
-Ben Buxton,
-Oliver Crow,
-Chris Dent,
-Marc Ewing,
-Cristian Gafton,
-Eric Hester,
-Roger Hu,
-Eric Jacksch,
-Michael K. Johnson,
-David Kinchlea,
-Nicolai Langfeldt,
-Elliot Lee,
-Al Longyear,
-Ingo Luetkebohle,
-Marek Michalkiewicz,
-Aleph One,
-Martin Pool,
-Sean Reifschneider,
-Erik Troan,
-Theodore Ts'o,
-Jeff Uphoff,
-Myles Uyema,
-Savochkin Andrey Vladimirovich,
-Ronald Wahl,
-David Wood,
-John Wilmes,
-Joseph S. D. Yao
-and
-Alex O. Yuriev.
-
-<p>
-Thanks are also due to Sun Microsystems, especially to Vipin Samar and
-Charlie Lai for their advice. At an early stage in the development of
-<bf/Linux-PAM/, Sun graciously made the documentation for their
-implementation of PAM available. This act greatly accelerated the
-development of <bf/Linux-PAM/.
-
-<sect>Bugs/omissions
-
-<p>
-Few PAM modules currently exist. Few PAM-aware applications exist.
-This document is hopelessly unfinished. Only a partial list of people is
-credited for all the good work they have done.
-
-<sect>Copyright information for this document
-
-<p>
-Copyright (c) Andrew G. Morgan 1996, 1997. All rights reserved.
-<newline>
-Email: <tt>&lt;morgan@transmeta.com&gt;</tt>
-
-<p>
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-<p>
-<itemize>
-
-<item>
-1. Redistributions of source code must retain the above copyright
- notice, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-<item>
-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.
-
-<item>
-3. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
-</itemize>
-
-<p>
-<bf/Alternatively/, this product may be distributed under the terms of
-the GNU General Public License (GPL), in which case the provisions of
-the GNU GPL are required <bf/instead of/ the above restrictions.
-(This clause is necessary due to a potential bad interaction between
-the GNU GPL and the restrictions contained in a BSD-style copyright.)
-
-<p>
-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.
-
-<p>
-<tt>$Id: pam_modules.sgml,v 1.19 1997/04/05 06:49:14 morgan Exp morgan $</tt>
-
-</article>
diff --git a/contrib/libpam/doc/pam_source.sgml b/contrib/libpam/doc/pam_source.sgml
deleted file mode 100644
index 093998a0aad1..000000000000
--- a/contrib/libpam/doc/pam_source.sgml
+++ /dev/null
@@ -1,985 +0,0 @@
-<!doctype linuxdoc system>
-
-<!--
-
- $Id: pam_source.sgml,v 1.5 1997/04/05 06:49:14 morgan Exp morgan $
-
- Copyright (c) Andrew G. Morgan 1996,1997. All rights reserved.
-
-Redistribution and use in source (sgml) and binary (derived) 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, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-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.
-
-ALTERNATIVELY, this product may be distributed under the terms of the
-GNU General Public License, in which case the provisions of the GNU
-GPL are required INSTEAD OF the above restrictions. (This clause is
-necessary due to a potential bad interaction between the GNU GPL and
-the restrictions contained in a BSD-style copyright.)
-
-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.
-
- -->
-
-<article>
-
-<title>The Linux-PAM System Administrators' Guide
-<author>Andrew G. Morgan, <tt>morgan@linux.kernel.org</tt>
-<date>DRAFT v0.59 1998/1/7
-<abstract>
-This manual documents what a system-administrator needs to know about
-the <bf>Linux-PAM</bf> library. It covers the correct syntax of the
-PAM configuration file and discusses strategies for maintaining a
-secure system.
-</abstract>
-
-<!-- Table of contents -->
-<toc>
-
-<!-- Begin the document -->
-
-<sect>Introduction
-
-<p><bf/Linux-PAM/ (Pluggable Authentication Modules for Linux) is a
-suite of shared libraries that enable the local system administrator
-to choose how applications authenticate users.
-
-<p>In other words, without (rewriting and) recompiling a PAM-aware
-application, it is possible to switch between the authentication
-mechanism(s) it uses. Indeed, one may entirely upgrade the local
-authentication system without touching the applications themselves.
-
-<p>Historically an application that has required a given user to be
-authenticated, has had to be compiled to use a specific authentication
-mechanism. For example, in the case of traditional UN*X systems, the
-identity of the user is verified by the user entering a correct
-password. This password, after being prefixed by a two character
-``salt'', is encrypted (with crypt(3)). The user is then authenticated
-if this encrypted password is identical to the second field of the
-user's entry in the system password database (the <tt>/etc/passwd</tt>
-file). On such systems, most if not all forms of privileges are
-granted based on this single authentication scheme. Privilege comes in
-the form of a personal user-identifier (<tt/uid/) and membership of
-various groups. Services and applications are available based on the
-personal and group identity of the user. Traditionally, group
-membership has been assigned based on entries in the
-<tt>/etc/group</tt> file.
-
-<p>
-Unfortunately, increases in the speed of computers and the
-widespread introduction of network based computing, have made once
-secure authentication mechanisms, such as this, vulnerable to
-attack. In the light of such realities, new methods of authentication
-are continuously being developed.
-
-<p>
-It is the purpose of the <bf/Linux-PAM/ project to separate the
-development of privilege granting software from the development of
-secure and appropriate authentication schemes. This is accomplished
-by providing a library of functions that an application may use to
-request that a user be authenticated. This PAM library is configured
-locally with a system file, <tt>/etc/pam.conf</tt> (or a series of
-configuration files located in <tt>/etc/pam.d/</tt>) to authenticate a
-user request via the locally available authentication modules. The
-modules themselves will usually be located in the directory
-<tt>/usr/lib/security</tt> and take the form of dynamically loadable
-object files (see <tt/dlopen(3)/).
-
-<sect>Some comments on the text<label id="text-conventions">
-
-<p>
-Before proceeding to read the rest of this document, it should be
-noted that the text assumes that certain files are placed in certain
-directories. Where they have been specified, the conventions we adopt
-here for locating these files are those of the relevant RFC (RFC-86.0,
-see <ref id="see-also-sec" name="bibliography">). If you are using a
-distribution of Linux (or some other operating system) that supports
-PAM but chooses to distribute these files in a diferent way (Red Hat
-is one such distribution), you should be careful when copying examples
-directly from the text.
-
-<p>
-As an example of the above, where it is explicit, the text assumes
-that PAM loadable object files (the <em/modules/) are to be located in
-the following directory: <tt>/usr/lib/security/</tt>. However, Red Hat
-Linux, in agreement with the Linux File System Standard (the FSSTND),
-places these files in <tt>/lib/security</tt>. Please be careful to
-perform the necessary transcription when using the examples from the
-text.
-
-<sect>Overview<label id="overview-section">
-
-<p>
-For the uninitiated, we begin by considering an example. We take an
-application that grants some service to users; <em/login/ is one such
-program. <em/Login/ does two things, it first establishes that the
-requesting user is whom they claim to be and second provides them with
-the requested service: in the case of <em/login/ the service is a
-command shell (<em>bash, tcsh, zsh, etc.</em>) running with the
-identity of the user.
-
-<p>
-Traditinally, the former step is achieved by the <em/login/
-application prompting the user for a password and then verifying that
-it agrees with that located on the system; hence verifying that the
-so far as the system is concerned the user is who they claim to be.
-This is the task that is delegated to <bf/Linux-PAM/.
-
-<p>
-From the perspective of the application programmer (in this case the
-person that wrote the <em/login/ application), <bf/Linux-PAM/ takes
-care of this authentication task -- verifying the identity of the user.
-
-<p>
-The flexibility of <bf/Linux-PAM/ is that <em/you/, the system
-administrator, have the freedom to stipulate which authentication
-scheme is to be used. You have the freedom to set the scheme for
-any/all PAM-aware applications on your Linux system. That is, you can
-authenticate from anything as naive as <em/simple trust/
-(<tt/pam_permit/) to something as paranoid as a combination of a
-retinal scan, a voice print and a one-time password!
-
-<p>
-To illustrate the flexibility you face, consider the following
-situation: a system administrator (parent) wishes to improve the
-mathematical ability of her users (children). She can configure their
-favorite ``Shoot 'em up game'' (PAM-aware of course) to authenticate
-them with a request for the product of a couple of random numbers less
-than 12. It is clear that if the game is any good they will soon learn
-their <em/multiplication tables/. As they mature, the authentication
-can be upgraded to include (long) division!
-
-<p>
-<bf/Linux-PAM/ deals with four separate types of (management)
-task. These are: <em/authentication management/; <em/account
-management/; <em/session management/; and <em/password management/.
-The association of the preferred management scheme with the behavior
-of an application is made with entries in the relevant <bf/Linux-PAM/
-configuration file. The management functions are performed by
-<em/modules/ specified in the configuration file. The syntax for this
-file is discussed in the section <ref id="configuration"
-name="below">.
-
-<p>
-Here is a figure that describes the overall organization of
-<bf/Linux-PAM/.
-<tscreen>
-<verb>
- +----------------+
- | application: X |
- +----------------+ / +----------+ +================+
- | authentication-[---->--\--] Linux- |--<--| PAM config file|
- | + [----<--/--] PAM | |================|
- |[conversation()][--+ \ | | | X auth .. a.so |
- +----------------+ | / +-n--n-----+ | X auth .. b.so |
- | | | __| | | _____/
- | service user | A | | |____,-----'
- | | | V A
- +----------------+ +------|-----|---------+ -----+------+
- +---u-----u----+ | | |
- | auth.... |--[ a ]--[ b ]--[ c ]
- +--------------+
- | acct.... |--[ b ]--[ d ]
- +--------------+
- | password |--[ b ]--[ c ]
- +--------------+
- | session |--[ e ]--[ c ]
- +--------------+
-</verb>
-</tscreen>
-By way of explanation, the left of the figure represents the
-application; application X. Such an application interfaces with the
-<bf/Linux-PAM/ library and knows none of the specifics of its
-configured authentication method. The <bf/Linux-PAM/ library (in the
-center) consults the contents of the PAM configuration file and loads
-the modules that are appropriate for application-X. These modules fall
-into one of four management groups (lower-center) and are stacked in
-the order they appear in the configuaration file. These modules, when
-called by <bf/Linux-PAM/, perform the various authentication tasks for
-the application. Textual information, required from/or offered to the
-user, can be exchanged through the use of the application-supplied
-<em/conversation/ function.
-
-<sect>The Linux-PAM configuration file
-<label id="configuration">
-
-<p>
-<bf/Linux-PAM/ is designed to provide the system administrator with a
-great deal of flexibility in configuring the privilege granting
-applications of their system. The local configuration of those aspects
-of system security controlled by <tt/Linux-PAM/ is contained in one of
-two places: either the single system file, <tt>/etc/pam.conf</tt>; or
-the <tt>/etc/pam.d/</tt> directory. In this section we discuss the
-correct syntax of and generic options respected by entries to these
-files.
-
-<sect1>Configuration file syntax
-
-<p>
-The reader should note that the <bf/Linux-PAM/ specific tokens in this
-file are case <em/insensitive/. The module paths, however, are case
-sensitive since they indicate a file's <em/name/ and reflect the case
-dependence of typical Linux file-systems. The case-sensitivity of the
-arguments to any given module is defined for each module in turn.
-
-<p>
-In addition to the lines described below, there are two <em/special/
-characters provided for the convenience of the system administrator:
-comments are preceded by a `<tt/&num;/' and extend to the
-next end-of-line; also, module specification lines may be extended
-with a `<tt/&bsol;/' escaped newline.
-
-<p>
-A general configuration line of the <tt>/etc/pam.conf</tt> file has
-the following form:
-<tscreen>
-<verb>
-service-name module-type control-flag module-path arguments
-</verb>
-</tscreen>
-Below, we explain the meaning of each of these tokens. The second (and
-more recently adopted) way of configuring <bf/Linux-PAM/ is via the
-contents of the <tt>/etc/pam.d/</tt> directory. Once we have explained
-the meaning of the above tokens, we will describe this method.
-
-<p>
-<descrip>
-<tag><tt/service-name/</tag>
-The name of the service associated with this entry. Frequently the
-service name is the conventional name of the given application. For
-example, `<tt/ftpd/', `<tt/rlogind/' and `<tt/su/', <em/etc./ .
-
-<p>
-There is a special <tt/service-name/, reserved for defining a default
-authentication mechanism. It has the name `<tt/OTHER/' and may be
-specified in either lower or upper case characters. Note, when there
-is a module specified for a named service, the `<tt/OTHER/' entries
-are ignored.
-
-<tag><tt/module-type/</tag>
-One of (currently) four types of module. The four types are as
-follows:
-<itemize>
-<item> <tt/auth/; this module type provides two aspects of
-authenticating the user. Firstly, it establishes that the user is who
-they claim to be, by instructing the application to prompt the user
-for a password or other means of identification. Secondly, the module
-can grant <tt/group/ membership (independently of the
-<tt>/etc/groups</tt> file discussed above) or other privileges through
-its <em/credential/ granting properties.
-
-<item> <tt/account/; this module performs non-authentication based
-account management. It is typically used to restrict/permit access to
-a service based on the time of day, currently available system
-resources (maximum number of users) or perhaps the location of the
-applicant user---`<tt/root/' login only on the console.
-
-<item> <tt/session/; primarily, this module is associated with doing
-things that need to be done for the user before/after they can be
-given service. Such things include the logging of information
-concerning the opening/closing of some data exchange with a user,
-mounting directories, etc. .
-
-<item> <tt/password/; this last module type is required for updating the
-authentication token associated with the user. Typically, there is one
-module for each `challenge/response' based authentication (<tt/auth/)
-module-type.
-
-</itemize>
-
-<tag><tt/control-flag/</tag>
-
-The control-flag is used to indicate how the PAM library will react to
-the success or failure of the module it is associated with. Since
-modules can be <em/stacked/ (modules of the same type execute in
-series, one after another), the control-flags determine the relative
-importance of each module. The application is not made aware of the
-individual success or failure of modules listed in the
-`<tt>/etc/pam.conf</tt>' file. Instead, it receives a summary
-<em/success/ or <em/fail/ response from the <bf/Linux-PAM/ library.
-The order of execution of these modules is that of the entries in the
-<tt>/etc/pam.conf</tt> file; earlier entries are executed before later
-ones. As of Linux-PAM v0.60, this <em/control-flag/ can be defined
-with one of two syntaxes.
-
-<p>
-The simpler (and historical) syntax for the control-flag is a single
-keyword defined to indicate the severity of concern associated with
-the success or failure of a specific module. There are four such
-keywords: <tt/required/, <tt/requisite/, <tt/sufficient/ and
-<tt/optional/.
-
-<p>
-The Linux-PAM library interprets these keywords in the following
-manner:
-
-<itemize>
-
-<item> <tt/required/; this indicates that the success of the module is
-required for the <tt/module-type/ facility to succeed. Failure of this
-module will not be apparent to the user until all of the remaining
-modules (of the same <tt/module-type/) have been executed.
-
-<item> <tt/requisite/; like <tt/required/, however, in the case that
-such a module returns a failure, control is directly returned to the
-application. The return value is that associated with the <em/first/
-<tt/required/ or <tt/requisite/ module to fail. Note, this flag can be
-used to protect against the possibility of a user getting the
-opportunity to enter a password over an unsafe medium. It is
-conceivable that such behavior might inform an attacker of valid
-accounts on a system. This possibility should be weighed against the
-not insignificant concerns of exposing a sensitive password in a
-hostile environment.
-
-<item> <tt/sufficient/; the success of this module is deemed
-`<em/sufficient/' to satisfy the <bf/Linux-PAM/ library that this
-module-type has succeeded in its purpose. In the event that no
-previous <tt/required/ module has failed, no more `<em/stacked/'
-modules of this type are invoked. (Note, in this case subsequent
-<tt/required/ modules are <bf/not/ invoked.). A failure of this module
-is not deemed as fatal to satisfying the application that this
-<tt/module-type/ has succeeded.
-
-<item> <tt/optional/; as its name suggests, this <tt/control-flag/
-marks the module as not being critical to the success or failure of
-the user's application for service. However, in the absence of any
-successes of previous or subsequent stacked modules this module will
-determine the nature of the response to the application.
-
-</itemize>
-
-<p>
-The more elaborate (newer) syntax is much more specific and gives the
-administrator a great deal of control over how the user is
-authenticated. This form of the control flag is delimeted with square
-brackets and consists of a series of <tt/value=action/ tokens:
-<tscreen>
-<verb>
- [value1=action1 value2=action2 ...]
-</verb>
-</tscreen>
-
-<p>
-Here, <tt/valueI/ is one of the following <em/return values/:
-<tt/success/; <tt/open_err/; <tt/symbol_err/; <tt/service_err/;
-<tt/system_err/; <tt/buf_err/; <tt/perm_denied/; <tt/auth_err/;
-<tt/cred_insufficient/; <tt/authinfo_unavail/; <tt/user_unknown/;
-<tt/maxtries/; <tt/new_authtok_reqd/; <tt/acct_expired/;
-<tt/session_err/; <tt/cred_unavail/; <tt/cred_expired/; <tt/cred_err/;
-<tt/no_module_data/; <tt/conv_err/; <tt/authtok_err/;
-<tt/authtok_recover_err/; <tt/authtok_lock_busy/;
-<tt/authtok_disable_aging/; <tt/try_again/; <tt/ignore/; <tt/abort/;
-<tt/authtok_expired/; <tt/module_unknown/; <tt/bad_item/; and
-<tt/default/. The last of these (<tt/default/) can be used to set the
-action for those return values that are not set explicitly.
-
-<p>
-The <tt/actionI/ can be a positive integer or one of the following
-tokens: <tt/ignore/; <tt/ok/; <tt/done/; <tt/bad/; <tt/die/; and
-<tt/reset/. A positive integer, <tt/J/, when specified as the action
-can be used to indicate that the next <em/J/ modules of the current
-type will be skipped. In this way, the administrator can develop a
-moderately sophisticated stack of modules with a number of different
-paths of execution. Which path is taken can be determined by the
-reactions of individual modules.
-
-<p>
-<bf>Note, at time of writing, this newer syntax is so new that I don't
-want to write too much about it. Please play with this. Report all
-the bugs and make suggestions for new actions (etc.).</bf>
-
-<tag> <tt/module-path/</tag>
-
-The path-name of the dynamically loadable object file; <em/the
-pluggable module/ itself. If the first character of the module path is
-`<tt>/</tt>', it is assumed to be a complete path. If this is not the
-case, the given module path is appended to the default module path:
-<tt>/usr/lib/security</tt> (but see the notes <ref
-id="text-conventions" name="above">).
-
-<tag> <tt/args/</tag>
-
-The <tt/args/ are a list of tokens that are passed to the module when
-it is invoked. Much like arguments to a typical Linux shell command.
-Generally, valid arguments are optional and are specific to any given
-module. Invalid arguments are ignored by a module, however, when
-encountering an invalid argument, the module is required to write an
-error to <tt/syslog(3)/. For a list of <em/generic/ options see the
-next section.
-
-</descrip>
-
-<p>
-Any line in (one of) the confiuration file(s), that is not formatted
-correctly, will generally tend (erring on the side of caution) to make
-the authentication process fail. A corresponding error is written to
-the system log files with a call to <tt/syslog(3)/.
-
-<sect1>Directory based configuration
-
-<p>
-More flexible than the single configuration file, as of version 0.56,
-it is possible to configure <tt>libpam</tt> via the contents of the
-<tt>/etc/pam.d/</tt> directory. In this case the directory is filled
-with files each of which has a filename equal to a service-name (in
-lower-case): it is the personal configuration file for the named
-service.
-
-<p>
-<bf/Linux-PAM/ can be compiled in one of two modes. The preferred
-mode uses either <tt>/etc/pam.d/</tt> or <tt>/etc/pam.conf</tt>
-configuration but not both. That is to say, if there is a
-<tt>/etc/pam.d/</tt> directory then libpam only uses the files
-contained in this directory. However, in the absence of the
-<tt>/etc/pam.d/</tt> directory the <tt>/etc/pam.conf</tt> file is
-used. The other mode (and the one currently supported by Red Hat 4.2)
-is to use both <tt>/etc/pam.d/</tt> and <tt>/etc/pam.conf</tt> in
-sequence. In this mode, entries in <tt>/etc/pam.d/</tt> override
-those of <tt>/etc/pam.conf</tt>.
-
-The syntax of each file in <tt>/etc/pam.d/</tt> is similar to that of
-the <tt>/etc/pam.conf</tt> file and is made up of lines of the
-following form:
-<tscreen>
-<verb>
-module-type control-flag module-path arguments
-</verb>
-</tscreen>
-The only difference being that the <tt>service-name</tt> is not
-present. The service-name is of course the name of the given
-configuration file. For example, <tt>/etc/pam.d/login</tt> contains
-the configuration for the <em>login</em> service.
-
-<p>
-This method of configuration has a number of advantages over the
-single file approach. We list them here to assist the reader in
-deciding which scheme to adopt:
-
-<p>
-<itemize>
-
-<item>A lower chance of misconfiguring an application. There is one
-less field to mis-type when editing the configuration files by hand.
-
-<item>Easier to maintain. One application may be reconfigured without
-risk of interfering with other applications on the system.
-
-<item>It is possible to symbolically link different services
-configuration files to a single file. This makes it easier to keep the
-system policy for access consistent across different applications.
-(It should be noted, to conserve space, it is equally possible to
-<em>hard</em> link a number of configuration files. However, care
-should be taken when administering this arrangement as editing a hard
-linked file is likely to break the link.)
-
-<item>A potential for quicker configuration file parsing. Only the
-relevant entries are parsed when a service gets bound to its modules.
-
-<item>It is possible to limit read access to individual <bf/Linux-PAM/
-configuration files using the file protections of the filesystem.
-
-<item>Package management becomes simpler. Every time a new
-application is installed, it can be accompanied by an
-<tt>/etc/pam.d/</tt><em>xxxxxx</em> file.
-
-</itemize>
-
-<sect1>Generic optional arguments
-
-<p>
-The following are optional arguments which are likely to be understood
-by any module. Arguments (including these) are in general
-<em/optional/.
-
-<p>
-<descrip>
-<tag><tt/debug/</tag>
-
-Use the <tt/syslog(3)/ call to log debugging information to the system
-log files.
-
-<tag> <tt/no_warn/</tag>
-
-Instruct module to not give warning messages to the application.
-
-<tag> <tt/use_first_pass/</tag>
-
-The module should not prompt the user for a password. Instead, it
-should obtain the previously typed password (from the preceding
-<tt/auth/ module), and use that. If that doesn't work, then the user
-will not be authenticated. (This option is intended for <tt/auth/
-and <tt/password/ modules only).
-
-<tag> <tt/try_first_pass/</tag>
-
-The module should attempt authentication with the previously typed
-password (from the preceding <tt/auth/ module). If that doesn't work,
-then the user is prompted for a password. (This option is intended for
-<tt/auth/ modules only).
-
-<tag> <tt/use_mapped_pass/</tag>
-
-This argument is not currently supported by any of the modules in the
-<bf/Linux-PAM/ distribution because of possible consequences
-associated with U.S. encryption exporting restrictions. Within the
-U.S., module developers are, of course, free to implement it (as are
-developers in other countries). For compatibility reasons we describe
-its use as suggested in the <bf/DCE-RFC 86.0/, see section <ref
-id="see-also-sec" name="bibliography"> for a pointer to this document.
-
-<p>
-The <tt/use_mapped_pass/ argument instructs the module to take the
-clear text authentication token entered by a previous module (that
-requests such a token) and use it to generate an encryption/decryption
-key with which to safely store/retrieve the authentication token
-required for this module. In this way the user can enter a single
-authentication token and be quietly authenticated by a number of
-stacked modules. Obviously a convenient feature that necessarily
-requires some reliably strong encryption to make it secure.
-This argument is intended for the <tt/auth/ and <tt/password/ module
-types only.
-
-</descrip>
-
-<sect1>Example configuration file entries
-
-<p>
-In this section, we give some examples of entries that can be present
-in the <bf/Linux-PAM/ configuration file. As a first attempt at
-configuring your system you could do worse than to implement these.
-
-<sect2>Default policy
-
-<p>
-If a system is to be considered secure, it had better have a
-reasonably secure `<tt/OTHER/' entry. The following is a paranoid
-setting (which is not a bad place to start!):
-<tscreen>
-<verb>
-#
-# default; deny access
-#
-OTHER auth required /usr/lib/security/pam_deny.so
-OTHER account required /usr/lib/security/pam_deny.so
-OTHER password required /usr/lib/security/pam_deny.so
-OTHER session required /usr/lib/security/pam_deny.so
-</verb>
-</tscreen>
-Whilst fundamentally a secure default, this is not very sympathetic to
-a misconfigured system. For example, such a system is vulnerable to
-locking everyone out should the rest of the file become badly written.
-
-<p>
-The module <tt/pam_deny/ (documented in a later section) is not very
-sophisticated. For example, it logs no information when it is invoked
-so unless the users of a system contact the administrator when failing
-to execute a service application, the administrator may go for a long
-while in ignorance of the fact that his system is misconfigured.
-
-<p>
-The addition of the following line before those in the above example
-would provide a suitable warning to the administrator.
-<tscreen>
-<verb>
-#
-# default; wake up! This application is not configured
-#
-OTHER auth required /usr/lib/security/pam_warn.so
-OTHER password required /usr/lib/security/pam_warn.so
-</verb>
-</tscreen>
-Having two ``<tt/OTHER auth/'' lines is an example of stacking.
-
-<p>
-On a system that uses the <tt>/etc/pam.d/</tt> configuration, the
-corresponding default setup would be achieved with the following file:
-<tscreen>
-<verb>
-#
-# default configuration: /etc/pam.d/other
-#
-auth required /usr/lib/security/pam_warn.so
-auth required /usr/lib/security/pam_deny.so
-account required /usr/lib/security/pam_deny.so
-password required /usr/lib/security/pam_warn.so
-password required /usr/lib/security/pam_deny.so
-session required /usr/lib/security/pam_deny.so
-</verb>
-</tscreen>
-This is the only explicit example we give for an <tt>/etc/pam.d/</tt>
-file. In general, it should be clear how to transpose the remaining
-examples to this configuration scheme.
-
-<p>
-On a less sensitive computer, one on which the system administrator
-wishes to remain ignorant of much of the power of <tt/Linux-PAM/, the
-following selection of lines (in <tt>/etc/pam.conf</tt>) is likely to
-mimic the historically familiar Linux setup.
-<tscreen>
-<verb>
-#
-# default; standard UNIX access
-#
-OTHER auth required /usr/lib/security/pam_unix_auth.so
-OTHER account required /usr/lib/security/pam_unix_acct.so
-OTHER password required /usr/lib/security/pam_unix_passwd.so
-OTHER session required /usr/lib/security/pam_unix_session.so
-</verb>
-</tscreen>
-In general this will provide a starting place for most applications.
-Unfortunately, most is not all. One application that might require
-additional lines is <em/ftpd/ if you wish to enable
-<em/anonymous-ftp/.
-
-<p>
-To enable anonymous-ftp, the following lines might be used to replace
-the default (<tt/OTHER/) ones. (<bf/*WARNING*/ as of 1996/12/28 this
-does not work correctly with any ftpd. Consequently, this description
-may be subject to change or the application will be fixed.)
-<tscreen>
-<verb>
-#
-# ftpd; add ftp-specifics. These lines enable anonymous ftp over
-# standard UNIX access (the listfile entry blocks access to
-# users listed in /etc/ftpusers)
-#
-ftpd auth sufficient /usr/lib/security/pam_ftp.so
-ftpd auth required /usr/lib/security/pam_unix_auth.so use_first_pass
-ftpd auth required /usr/lib/security/pam_listfile.so \
- onerr=succeed item=user sense=deny file=/etc/ftpusers
-</verb>
-</tscreen>
-Note, the second line is necessary since the default entries are
-ignored by a service application (here <em/ftpd/) if there are
-<em/any/ entries in <tt>/etc/pam.conf</tt> for that specified service.
-Again, this is an example of authentication module stacking. Note the
-use of the <tt/sufficient/ control-flag. It says that ``if this module
-authenticates the user, ignore the subsequent <tt/auth/
-modules''. Also note the use of the ``<tt/use_first_pass/''
-module-argument, this instructs the UNIX authentication module that it
-is not to prompt for a password but rely one already having been
-obtained by the ftp module.
-
-<p>
-The standard UNIX modules, used above, are strongly tied to using the
-default `<tt/libc/' user database functions (see for example, <tt/man
-getpwent/). It is the opinion of the author that these functions are
-not sufficently flexible to make full use of the power of
-<bf/Linux-PAM/. For this reason, and as a small plug, I mention in
-passing that there is a pluggable replacement for the <tt/pam_unix_../
-modules; <tt/pam_pwdb/. See the section below for a more complete
-description.
-
-
-<sect>Security issues of Linux-PAM
-
-<p>
-This section will discuss good practices for using Linux-PAM in a
-secure manner. <em>It is currently sadly lacking...suggestions are
-welcome!</em>
-
-<sect1>If something goes wrong
-
-<p>
-<bf/Linux-PAM/ has the potential to seriously change the security of
-your system. You can choose to have no security or absolute security
-(no access permitted). In general, <bf/Linux-PAM/ errs towards the
-latter. Any number of configuration errors can dissable access to
-your system partially, or completely.
-
-<p>
-The most dramatic problem that is likely to be encountered when
-configuring <bf/Linux-PAM/ is that of <em>deleting</em> the
-configuration file(s): <tt>/etc/pam.d/*</tt> and/or
-<tt>/etc/pam.conf</tt>. This will lock you out of your own system!
-
-<p>
-To recover, your best bet is to reboot the system in single user mode
-and set about correcting things from there. The following has been
-<em>adapted</em> from a life-saving email on the subject from David
-Wood:
-<verb>
-> What the hell do I do now?
-
-OK, don't panic. The first thing you have to realize is that
-this happens to 50% of users who ever do anything with PAM.
-It happened here, not once, not twice, but three times, all
-different, and in the end, the solution was the same every
-time.
-
-First, I hope you installed LILO with a delay. If you can,
-reboot, hit shift or tab or something and type:
-
- LILO boot: linux single
-
-(Replace 'linux' with 'name-of-your-normal-linux-image').
-This will let you in without logging in. Ever wondered how
-easy it is to break into a linux machine from the console?
-Now you know.
-
-If you can't do that, then get yourself a bootkernel floppy
-and a root disk a-la slackware's rescue.gz. (Red Hat's
-installation disks can be used in this mode too.)
-
-In either case, the point is to get back your root prompt.
-
-Second, I'm going to assume that you haven't completely
-nuked your pam installation - just your configuration files.
-Here's how you make your configs nice again:
-
- cd /etc
- mv pam.conf pam.conf.orig
- mv pam.d pam.d.orig
- mkdir pam.d
- cd pam.d
-
-and then use vi to create a file called "other" in this
-directory. It should contain the following four lines:
-
- auth required pam_unix_auth.so
- account required pam_unix_acct.so
- password required pam_unix_passwd.so
- session required pam_unix_session.so
-
-Now you have the simplest possible PAM configuration that
-will work the way you're used to. Everything should
-magically start to work again. Try it out by hitting ALT-F2
-and logging in on another virtual console. If it doesn't
-work, you have bigger problems, or you've mistyped
-something. One of the wonders of this system (seriously,
-perhaps) is that if you mistype anything in the conf files,
-you usually get no error reporting of any kind on the
-console - just some entries in the log file. So look there!
-(Try 'tail /var/log/messages'.)
-
-From here you can go back and get a real configuration
-going, hopefully after you've tested it first on a machine
-you don't care about screwing up. :/
-
-Some pointers (to make everything "right" with Red Hat...):
-
- Install the newest pam, pamconfig, and pwdb from the
- redhat current directory, and do it all on the same
- command line with rpm...
-
- rpm -Uvh [maybe --force too] pam-* pamconfig-* pwdb-*
-
- Then make sure you install (or reinstall) the newest
- version of libc, util-linux, wuftp, and NetKit. For
- kicks you might try installing the newest versions of
- the affected x apps, like xlock, but I haven't gotten
- those to work at all yet.
-
-</verb>
-
-<sect1>Avoid having a weak `other' configuration
-
-<p>
-It is not a good thing to have a weak default (<tt/OTHER/) entry.
-This service is the default configuration for all PAM aware
-applications and if it is weak, your system is likely to be vulnerable
-to attack.
-
-<sect>A reference guide for available modules
-
-<p>
-Here, we collect together some descriptions of the various modules
-available for <bf/Linux-PAM/. In general these modules should be
-freely available. Where this is not the case, it will be indicated.
-
-<p>
-Also please note the comments contained in the section <ref
-id="text-conventions" name="on text conventions above"> when copying
-the examples listed below.
-
-<!-- insert-file MODULES-SGML -->
-
-<sect>Files
-
-<p><descrip>
-
-<tag><tt>/usr/lib/libpam.so.*</tt></tag>
-
-the shared library providing applications with access to
-<bf/Linux-PAM/.
-
-<tag><tt>/etc/pam.conf</tt></tag>
-
-the <bf/Linux-PAM/ configuration file.
-
-<tag><tt>/usr/lib/security/pam_*.so</tt></tag>
-
-the primary location for <bf/Linux-PAM/ dynamically loadable object
-files; the modules.
-
-</descrip>
-
-<sect>See also<label id="see-also-sec">
-
-<p><itemize>
-
-<item>The <bf/Linux-PAM/ Application Writers' Guide.
-
-<item>The <bf/Linux-PAM/ Module Writers' Guide.
-
-<item>The V. Samar and R. Schemers (SunSoft), ``UNIFIED LOGIN WITH
-PLUGGABLE AUTHENTICATION MODULES'', Open Software Foundation Request
-For Comments 86.0, October 1995. See this url:
-<tt><htmlurl
-url="http://www.pilgrim.umass.edu/pub/osf_dce/RFC/rfc86.0.txt"
-name="http://www.pilgrim.umass.edu/pub/osf&lowbar;dce/RFC/rfc86.0.txt"></tt>
-
-</itemize>
-
-<sect>Notes
-
-<p>
-I intend to put development comments here... like ``at the moment
-this isn't actually supported''. At release time what ever is in
-this section will be placed in the Bugs section below! :)
-
-<p>
-Are we going to be able to support the <tt/use_mapped_pass/ module
-argument? Anyone know a cheap (free) good lawyer?!
-
-<p>
-<itemize>
-<item>
-This issue may go away, as Sun have investigated adding a new
-management group for mappings. In this way, libpam would have mapping
-modules that could securely store passwords using strong cryptography
-and in such a way that they need not be distributed with Linux-PAM.
-</itemize>
-
-<sect>Author/acknowledgments
-
-<p>
-This document was written by Andrew G. Morgan (morgan@parc.power.net)
-with many contributions from
-<!-- insert credits here -->
-<!--
- an sgml list of people to credit for their contributions to Linux-PAM
- $Id: pam_source.sgml,v 1.5 1997/04/05 06:49:14 morgan Exp morgan $
- -->
-Craig S. Bell,
-Derrick J. Brashear,
-Ben Buxton,
-Oliver Crow,
-Marc Ewing,
-Cristian Gafton,
-Eric Hester,
-Eric Jacksch,
-Michael K. Johnson,
-David Kinchlea,
-Elliot Lee,
-Al Longyear,
-Marek Michalkiewicz,
-Aleph One,
-Sean Reifschneider,
-Eric Troan,
-Theodore Ts'o,
-Jeff Uphoff,
-Ronald Wahl,
-John Wilmes,
-Joseph S. D. Yao
-and
-Alex O. Yuriev.
-
-
-<p>
-Thanks are also due to Sun Microsystems, especially to Vipin Samar and
-Charlie Lai for their advice. At an early stage in the development of
-<bf/Linux-PAM/, Sun graciously made the documentation for their
-implementation of PAM available. This act greatly accelerated the
-development of <bf/Linux-PAM/.
-
-<sect>Bugs/omissions
-
-<p>
-More PAM modules are being developed all the time. It is unlikely that
-this document will ever be truely up to date!
-
-<p>
-Currently there is no documentation for PAM-aware applications.
-
-<p>
-This manual is unfinished. Only a partial list of people is credited
-for all the good work they have done.
-
-<sect>Copyright information for this document
-
-<p>
-Copyright (c) Andrew G. Morgan 1996. All rights reserved.
-<newline>
-Email: <tt>&lt;morgan@parc.power.net&gt;</tt>
-
-<p>
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-<p>
-<itemize>
-
-<item>
-1. Redistributions of source code must retain the above copyright
- notice, and the entire permission notice in its entirety,
- including the disclaimer of warranties.
-
-<item>
-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.
-
-<item>
-3. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
-</itemize>
-
-<p>
-<bf/Alternatively/, this product may be distributed under the terms of
-the GNU General Public License (GPL), in which case the provisions of
-the GNU GPL are required <bf/instead of/ the above restrictions.
-(This clause is necessary due to a potential bad interaction between
-the GNU GPL and the restrictions contained in a BSD-style copyright.)
-
-<p>
-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.
-
-<p>
-<tt>$Id: pam_source.sgml,v 1.5 1997/04/05 06:49:14 morgan Exp morgan $</tt>
-
-</article>
diff --git a/contrib/libpam/doc/specs/rfc86.0.txt b/contrib/libpam/doc/specs/rfc86.0.txt
deleted file mode 100644
index 6dd5e6ea36dc..000000000000
--- a/contrib/libpam/doc/specs/rfc86.0.txt
+++ /dev/null
@@ -1,1851 +0,0 @@
-
-
-
-
-
-
-
-
- Open Software Foundation V. Samar (SunSoft)
- Request For Comments: 86.0 R. Schemers (SunSoft)
- October 1995
-
-
-
- UNIFIED LOGIN WITH
- PLUGGABLE AUTHENTICATION MODULES (PAM)
-
-
- 1. INTRODUCTION
-
- Since low-level authentication mechanisms constantly evolve, it is
- important to shield the high-level consumers of these mechanisms
- (system-entry services and users) from such low-level changes. With
- the Pluggable Authentication Module (PAM) framework, we can provide
- pluggability for a variety of system-entry services -- not just
- system authentication _per se_, but also for account, session and
- password management. PAM's ability to _stack_ authentication modules
- can be used to integrate `login' with different authentication
- mechanisms such as RSA, DCE, and Kerberos, and thus unify login
- mechanisms. The PAM framework can also provide easy integration of
- smart cards into the system.
-
- Modular design and pluggability have become important for users who
- want ease of use. In the PC hardware arena, no one wants to set the
- interrupt vector numbers or resolve the addressing conflict between
- various devices. In the software arena, people also want to be able
- to replace components easily for easy customization, maintenance, and
- upgrades.
-
- Authentication software deserves special attention because
- authentication forms a very critical component of any secure computer
- system. The authentication infrastructure and its components may
- have to be modified or replaced either because some deficiencies have
- been found in the current algorithms, or because sites want to
- enforce a different security policy than what was provided by the
- system vendor. The replacement and modification should be done in
- such a way that the user is not affected by these changes.
-
- The solution has to address not just how the applications use the new
- authentication mechanisms in a generic fashion, but also how the user
- will be authenticated to these mechanisms in a generic way. The
- former is addressed by GSS-API [Linn 93], while this RFC addresses
- the later; these two efforts are complementary to each other.
-
- Since most system-entry services (for example, `login', `dtlogin',
- `rlogin', `ftp', `rsh') may want to be independent of the specific
- authentication mechanisms used by the machine, it is important that
- there be a framework for _plugging_ in various mechanisms. This
- requires that the system applications use a standard API to interact
-
-
-
- Samar, Schemers Page 1
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- with the authentication services. If these system-entry services
- remain independent of the actual mechanism used on that machine, the
- system administrator can install suitable authentication modules
- without requiring changes to these applications.
-
- For any security system to be successful, it has to be easy to use.
- In the case of authentication, the single most important ease-of-use
- characteristic is that the user should not be required to learn about
- various ways of authentication and remember multiple passwords.
- Ideally, there should be one all-encompassing authentication system
- where there is only one password, but for heterogeneous sites,
- multiple authentication mechanisms have to co-exist. The problem of
- integrating multiple authentication mechanisms such as Kerberos
- [Steiner 88], RSA [Rivest 78], and Diffie-Hellman [Diffie 76, Taylor
- 88], is also referred to as _integrated login_, or _unified login_
- problem. Even if the user has to use multiple authentication
- mechanisms, the user should not be forced to type multiple passwords.
- Furthermore, the user should be able to use the new network identity
- without taking any further actions. The key here is in modular
- integration of the network authentication technologies with `login'
- and other system-entry services.
-
- In this RFC we discuss the architecture and design of pluggable
- authentication modules. This design gives the capability to use
- field-replaceable authentication modules along with unified login
- capability. It thus provides for both _pluggability_ and _ease-of-
- use_.
-
- The RFC is organized as follows. We first motivate the need for a
- generic way to authenticate the user by various system-entry services
- within the operating system. We describe the goals and constraints
- of the design. This leads to the architecture, description of the
- interfaces, and _stacking_ of modules to get unified login
- functionality. We then describe our experience with the design, and
- end with a description of future work.
-
-
- 2. OVERVIEW OF IDENTIFICATION AND AUTHENTICATION MECHANISMS
-
- An identification and authentication ("I&A") mechanism is used to
- establish a user's identity the system (i.e., to a local machine's
- operating system) and to other principals on the network. On a
- typical UNIX system, there are various ports of entry into the
- system, such as `login', `dtlogin', `rlogin', `ftp', `rsh', `su', and
- `telnet'. In all cases, the user has to be identified and
- authenticated before granting appropriate access rights to the user.
- The user identification and authentication for all these entry points
- needs to be coordinated to ensure a secure system.
-
- In most of the current UNIX systems, the login mechanism is based
- upon verification of the password using the modified DES algorithm.
-
-
-
- Samar, Schemers Page 2
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- The security of the implementation assumes that the password cannot
- be guessed, and that the password does not go over the wire in the
- clear. These assumptions, however, are not universally valid.
- Various programs are now available freely on the Internet that can
- run dictionary attack against the encrypted password. Further, some
- of the network services (for example, `rlogin', `ftp', `telnet') send
- the password over in clear, and there are "sniffer" programs freely
- available to steal these passwords. The classical assumptions may be
- acceptable on a trusted network, but in an open environment there is
- a need to use more restrictive and stronger authentication
- mechanisms. Examples of such mechanisms include Kerberos, RSA,
- Diffie-Hellman, one-time password [Skey 94], and challenge-response
- based smart card authentication systems. Since this list will
- continue to evolve, it is important that the system-entry services do
- not have hard-coded dependencies on any of these authentication
- mechanisms.
-
-
- 3. DESIGN GOALS
-
- The goals of the PAM framework are as follows:
-
- (a) The system administrator should be able to choose the default
- authentication mechanism for the machine. This can range from
- a simple password-based mechanism to a biometric or a smart
- card based system.
-
- (b) It should be possible to configure the user authentication
- mechanism on a per application basis. For example, a site may
- require S/Key password authentication for `telnet' access,
- while allowing machine `login' sessions with just UNIX password
- authentication.
-
- (c) The framework should support the display requirements of the
- applications. For example, for a graphical login session such
- as `dtlogin', the user name and the password may have to be
- entered in a new window. For networking system-entry
- applications such as `ftp' and `telnet', the user name and
- password has to be transmitted over the network to the client
- machine.
-
- (d) It should be possible to configure multiple authentication
- protocols for each of those applications. For example, one may
- want the users to get authenticated by both Kerberos and RSA
- authentication systems.
-
- (e) The system administrator should be able to _stack_ multiple
- user authentication mechanisms such that the user is
- authenticated with all authentication protocols without
- retyping the password.
-
-
-
-
- Samar, Schemers Page 3
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- (f) The architecture should allow for multiple passwords if
- necessary to achieve higher security for users with specific
- security requirements.
-
- (g) The system-entry services should not be required to change when
- the underlying mechanism changes. This can be very useful for
- third-party developers because they often do not have the
- source code for these services.
-
- (h) The architecture should provide for a _pluggable_ model for
- system authentication, as well as for other related tasks such
- as password, account, and session management.
-
- (i) For backward-compatibility reasons, the PAM API should support
- the authentication requirements of the current system-entry
- services.
-
- There are certain issues that the PAM framework does not specifically
- address:
-
- (a) We focus only on providing a generic scheme through which users
- use passwords to establish their identities to the machine.
- Once the identity is established, how the identity is
- communicated to other interested parties is outside the scope
- of this design. There are efforts underway at IETF [Linn 93]
- to develop a Generic Security Services Application Interface
- (GSSAPI) that can be used by applications for secure and
- authenticated communication without knowing the underlying
- mechanism.
-
- (b) The _single-signon_ problem of securely transferring the
- identity of the caller to a remote site is not addressed. For
- example, the problem of delegating credentials from the
- `rlogin' client to the other machine without typing the
- password is not addressed by our work. We also do not address
- the problem of sending the passwords over the network in the
- clear.
-
- (c) We do not address the source of information obtained from the
- "`getXbyY()'" family of calls (e.g., `getpwnam()'). Different
- operating systems address this problem differently. For
- example, Solaris uses the name service switch (NSS) to
- determine the source of information for the "`getXbyY()'"
- calls. It is expected that data which is stored in multiple
- sources (such as passwd entries in NIS+ and the DCE registry)
- is kept in sync using the appropriate commands (such as
- `passwd_export').
-
-
-
-
-
-
-
- Samar, Schemers Page 4
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- 4. OVERVIEW OF THE PAM FRAMEWORK
-
- We propose that the goals listed above can be met through a framework
- in which authentication modules can be _plugged_ independently of the
- application. We call this the _Pluggable Authentication Modules_
- (PAM) framework.
-
- The core components of the PAM framework are the authentication
- library API (the front end) and the authentication mechanism-specific
- modules (the back end), connected through the Service Provider
- Interface (SPI). Applications write to the PAM API, while the
- authentication-system providers write to the PAM SPI and supply the
- back end modules that are independent of the application.
-
- ftp telnet login (Applications)
- | | |
- | | |
- +--------+--------+
- |
- +-----+-----+
- | PAM API | <-- pam.conf file
- +-----+-----+
- |
- +--------+--------+
- UNIX Kerberos Smart Cards (Mechanisms)
-
- Figure 1: The Basic PAM Architecture
-
- Figure 1 illustrates the relationship between the application, the
- PAM library, and the authentication modules. Three applications
- (`login', `telnet' and `ftp') are shown which use the PAM
- authentication interfaces. When an application makes a call to the
- PAM API, it loads the appropriate authentication module as determined
- by the configuration file, `pam.conf'. The request is forwarded to
- the underlying authentication module (for example, UNIX password,
- Kerberos, smart cards) to perform the specified operation. The PAM
- layer then returns the response from the authentication module to the
- application.
-
- PAM unifies system authentication and access control for the system,
- and allows plugging of associated authentication modules through well
- defined interfaces. The plugging can be defined through various
- means, one of which uses a configuration file, such as the one in
- Table 1. For each of the system applications, the file specifies the
- authentication module that should be loaded. In the example below,
- `login' uses the UNIX password module, while `ftp' and `telnet' use
- the S/Key module.
-
-
-
-
-
-
-
- Samar, Schemers Page 5
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- Table 1: A Simplified View of a Sample PAM Configuration File.
-
- service module_path
- ------- -----------
- login pam_unix.so
- ftp pam_skey.so
- telnet pam_skey.so
-
- Authentication configuration is only one aspect of this interface.
- Other critical components include account management, session
- management, and password management. For example, the `login'
- program may want to verify not only the password but also whether the
- account has aged or expired. Generic interfaces also need to be
- provided so that the password can be changed according to the
- requirements of the module. Furthermore, the application may want to
- log information about the current session as determined by the
- module.
-
- Not all applications or services may need all of the above
- components, and not each authentication module may need to provide
- support for all of the interfaces. For example, while `login' may
- need access to all four components, `su' may need access to just the
- authentication component. Some applications may use some specific
- authentication and password management modules but share the account
- and session management modules with others.
-
- This reasoning leads to a partitioning of the entire set of
- interfaces into four areas of functionality: (1) authentication, (2)
- account, (3) session, and (4) password. The concept of PAM was
- extended to these functional areas by implementing each of them as a
- separate pluggable module.
-
- Breaking the functionality into four modules helps the module
- providers because they can use the system-provided libraries for the
- modules that they are not changing. For example, if a supplier wants
- to provide a better version of Kerberos, they can just provide that
- new authentication and password module, and reuse the existing ones
- for account and session.
-
- 4.1. Module Description
-
- More details on specific API's are described in Appendix A. A brief
- description of four modules follows:
-
- (a) Authentication management: This set includes the
- `pam_authenticate()' function to authenticate the user, and the
- `pam_setcred()' interface to set, refresh or destroy the user
- credentials.
-
- (b) Account management: This set includes the `pam_acct_mgmt()'
- function to check whether the authenticated user should be
-
-
-
- Samar, Schemers Page 6
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- given access to his/her account. This function can implement
- account expiration and access hour restrictions.
-
- (c) Session management: This set includes the `pam_open_session()'
- and `pam_close_session()' functions for session management and
- accounting. For example, the system may want to store the
- total time for the session.
-
- (d) Password management: This set includes a function,
- `pam_chauthtok()', to change the password.
-
-
- 5. FRAMEWORK INTERFACES
-
- The PAM framework further provides a set of administrative interfaces
- to support the above modules and to provide for application-module
- communication. There is no corresponding service provider interface
- (SPI) for such functions.
-
- 5.1. Administrative Interfaces
-
- Each set of PAM transactions starts with `pam_start()' and ends with
- the `pam_end()' function. The interfaces `pam_get_item()' and
- `pam_set_item()' are used to read and write the state information
- associated with the PAM transaction.
-
- If there is any error with any of the PAM interfaces, the error
- message can be printed with `pam_strerror()'.
-
- 5.2. Application-Module Communication
-
- During application initialization, certain data such as the user name
- is saved in the PAM framework layer through `pam_start()' so that it
- can be used by the underlying modules. The application can also pass
- opaque data to the module which the modules will pass back while
- communicating with the user.
-
- 5.3. User-Module Communication
-
- The `pam_start()' function also passes conversation function that has
- to be used by the underlying modules to read and write module
- specific authentication information. For example, these functions
- can be used to prompt the user for the password in a way determined
- by the application. PAM can thus be used by graphical, non-
- graphical, or networked applications.
-
-
-
-
-
-
-
-
-
- Samar, Schemers Page 7
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- 5.4. Inter-Module Communication
-
- Though the modules are independent, they can share certain common
- information about the authentication session such as user name,
- service name, password, and conversation function through the
- `pam_get_item()' and `pam_set_item()' interfaces. These API's can
- also be used by the application to change the state information after
- having called `pam_start()' once.
-
- 5.5. Module State Information
-
- The PAM service modules may want to keep certain module-specific
- state information about the session. The interfaces `pam_get_data()'
- and `pam_set_data()' can be used by the service modules to access and
- update module-specific information as needed from the PAM handle.
- The modules can also attach a cleanup function with the data. The
- cleanup function is executed when `pam_end()' is called to indicate
- the end of the current authentication activity.
-
- Since the PAM modules are loaded upon demand, there is no direct
- module initialization support in the PAM framework. If there are
- certain initialization tasks that the PAM service modules have to do,
- they should be done upon the first invocation. However, if there are
- certain clean-up tasks to be done when the authentication session
- ends, the modules should use `pam_set_data()' to specify the clean-up
- functions, which would be called when `pam_end()' is called by the
- application.
-
-
- 6. MODULE CONFIGURATION MANAGEMENT
-
- Table 2 shows an example of a configuration file `pam.conf' with
- support for authentication, session, account, and password management
- modules. `login' has three entries: one each for authentication
- processing, session management and account management. Each entry
- specifies the module name that should be loaded for the given module
- type. In this example, the `ftp' service uses the authentication and
- session modules. Note that all services here share the same session
- management module, while having different authentication modules.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Samar, Schemers Page 8
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- Table 2: Configuration File (pam.conf) with Different Modules
- and Control Flow
-
- service module_type control_flag module_path options
- ------- ----------- ------------ ----------- -------
- login auth required pam_unix_auth.so nowarn
- login session required pam_unix_session.so
- login account required pam_unix_account.so
- ftp auth required pam_skey_auth.so debug
- ftp session required pam_unix_session.so
- telnet session required pam_unix_session.so
- login password required pam_unix_passwd.so
- passwd password required pam_unix_passwd.so
- OTHER auth required pam_unix_auth.so
- OTHER session required pam_unix_session.so
- OTHER account required pam_unix_account.so
-
- The first field, _service_, denotes the service (for example,
- `login', `passwd', `rlogin'). The name `OTHER' indicates the module
- used by all other applications that have not been specified in this
- file. This name can also be used if all services have the same
- requirements. In the example, since all the services use the same
- session module, we could have replaced those lines with a single
- `OTHER' line.
-
- The second field, _module_type_, indicates the type of the PAM
- functional module. It can be one of `auth', `account', `session', or
- `password' modules.
-
- The third field, _control_flag_ determines the behavior of stacking
- multiple modules by specifying whether any particular module is
- _required_, _sufficient_, or _optional_. The next section describes
- stacking in more detail.
-
- The fourth field, _module_path_, specifies the location of the
- module. The PAM framework loads this module upon demand to invoke
- the required function.
-
- The fifth field, _options_, is used by the PAM framework layer to
- pass module specific options to the modules. It is up to the module
- to parse and interpret the options. This field can be used by the
- modules to turn on debugging or to pass any module specific
- parameters such as a timeout value. It is also used to support
- unified login as described below. The options field can be used by
- the system administrator to fine-tune the PAM modules.
-
- If any of the fields are invalid, or if a module is not found, that
- line is ignored and the error is logged as a critical error via
- `syslog(3)'. If no entries are found for the given module type, then
- the PAM framework returns an error to the application.
-
-
-
-
- Samar, Schemers Page 9
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- 7. INTEGRATING MULTIPLE AUTHENTICATION SERVICES WITH STACKING
-
- In the world of heterogeneous systems, the system administrator often
- has to deal with the problem of integrating multiple authentication
- mechanisms. The user is often required to know about the
- authentication command of the new authentication module (for example,
- `kinit', `dce_login') after logging into the system. This is not
- user-friendly because it forces people to remember to type the new
- command and enter the new password. This functionality should be
- invisible instead of burdening the user with it.
-
- There are two problems to be addressed here:
-
- (a) Supporting multiple authentication mechanisms.
-
- (b) Providing unified login in the presence of multiple mechanisms.
-
- In the previous section, we described how one could replace the
- default authentication module with any other module of choice. Now
- we demonstrate how the same model can be extended to provide support
- for multiple modules.
-
- 7.1. Design for Stacked Modules
-
- One possibility was to provide hard-coded rules in `login' or other
- applications requiring authentication services [Adamson 95]. But
- this becomes very specific to the particular combination of
- authentication protocols, and also requires the source code of the
- application. Digital's Security Integration Architecture [SIA 95]
- addresses this problem by specifying the same list of authentication
- modules for all applications. Since requirements for various
- applications can vary, it is essential that the configuration be on a
- per-application basis.
-
- To support multiple authentication mechanisms, the PAM framework was
- extended to support _stacking_. When any API is called, the back
- ends for the stacked modules are invoked in the order listed, and the
- result returned to the caller. In Figure 2, the authentication
- service of `login' is stacked and the user is authenticated by UNIX,
- Kerberos, and RSA authentication mechanisms. Note that in this
- example, there is no stacking for session or account management
- modules.
-
-
-
-
-
-
-
-
-
-
-
-
- Samar, Schemers Page 10
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- login
- |
- +--------+--------+
- | | |
- session auth account
- | | |
- +--+--+ +--+--+ +--+--+
- | PAM | | PAM | | PAM |
- +--+--+ +--+--+ +--+--+
- | | |
- UNIX UNIX UNIX
- session auth account
- |
- Kerberos
- auth
- |
- RSA
- auth
-
- Figure 2: Stacking With the PAM Architecture
-
- Stacking is specified through additional entries in the configuration
- file shown earlier. As shown in Table 2, for each application (such
- as `login') the configuration file can specify multiple mechanisms
- that have to be invoked in the specified order. When mechanisms
- fail, the _control_flag_ decides which error should be returned to
- the application. Since the user should not know which authentication
- module failed when a bad password was typed, the PAM framework
- continues to call other authentication modules on the stack even on
- failure. The semantics of the control flag are as follows:
-
- (a) `required': With this flag, the module failure results in the
- PAM framework returning the error to the caller _after_
- executing all other modules on the stack. For the function to
- be able to return success to the application all `required'
- modules have to report success. This flag is normally set when
- authentication by this module is a _must_.
-
- (b) `optional': With this flag, the PAM framework ignores the
- module failure and continues with the processing of the next
- module in sequence. This flag is used when the user is allowed
- to login even if that particular module has failed.
-
- (c) `sufficient': With this flag, if the module succeeds the PAM
- framework returns success to the application immediately
- without trying any other modules. For failure cases, the
- _sufficient_ modules are treated as `optional'.
-
- Table 3 shows a sample configuration file that stacks the `login'
- command. Here the user is authenticated by UNIX, Kerberos, and RSA
- authentication services. The `required' key word for _control_flag_
-
-
-
- Samar, Schemers Page 11
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- enforces that the user is allowed to login only if he/she is
- authenticated by _both_ UNIX and Kerberos services. RSA
- authentication is optional by virtue of the `optional' key word in
- the _control_flag_ field. The user can still log in even if RSA
- authentication fails.
-
- Table 3: PAM Configuration File with Support for Stacking
-
- service module_type control_flag module_path options
- ------- ----------- ------------ ----------- -------
- login auth required pam_unix.so debug
- login auth required pam_kerb.so use_mapped_pass
- login auth optional pam_rsa.so use_first_pass
-
- Table 4 illustrates the use of the sufficient flag for the `rlogin'
- service. The Berkeley `rlogin' protocol specifies that if the remote
- host is trusted (as specified in the `/etc/hosts.equiv' file or in
- the `.rhosts' file in the home directory of the user), then the
- `rlogin' daemon should not require the user to type the password. If
- this is not the case, then the user is required to type the password.
- Instead of hard coding this policy in the `rlogin' daemon, this can
- be expressed with the `pam.conf' file in Table 4. The PAM module
- `pam_rhosts_auth.so.1' implements the `.rhosts' policy described
- above. If a site administrator wants to enable remote login with
- only passwords, then the first line should be deleted.
-
- Table 4: PAM Configuration File for the rlogin service
-
- service module_type control_flag module_path options
- ------- ----------- ------------ ----------- -------
- rlogin auth sufficient pam_rhosts_auth.so
- rlogin auth required pam_unix.so
-
- 7.2. Password-Mapping
-
- Multiple authentication mechanisms on a machine can lead to multiple
- passwords that users have to remember. One attractive solution from
- the ease-of-use viewpoint is to use the same password for all
- mechanisms. This, however, can also weaken the security because if
- that password were to be compromised in any of the multiple
- mechanisms, all mechanisms would be compromised at the same time.
- Furthermore, different authentication mechanisms may have their own
- distinctive password requirements in regards to its length, allowed
- characters, time interval between updates, aging, locking, and so
- forth. These requirements make it problematic to use the same
- password for multiple authentication mechanisms.
-
- The solution we propose, while not precluding use of the same
- password for every mechanism, allows for a different password for
- each mechanism through what we call _password-mapping_. This
- basically means using the user's _primary_ password to encrypt the
-
-
-
- Samar, Schemers Page 12
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- user's other (_secondary_) passwords, and storing these encrypted
- passwords in a place where they are available to the user. Once the
- primary password is verified, the authentication modules would obtain
- the other passwords for their own mechanisms by decrypting the
- mechanism-specific encrypted password with the primary password, and
- passing it to the authentication service. The security of this
- design for password-mapping assumes that the primary password is the
- user's strongest password, in terms of its unguessability (length,
- type and mix of characters used, etc.).
-
- If there is any error in password-mapping, or if the mapping does not
- exist, the user will be prompted for the password by each
- authentication module.
-
- To support password-mapping, the PAM framework saves the primary
- password and provides it to stacked authentication modules. The
- password is cleared out before the `pam_authenticate' function
- returns.
-
- How the password is encrypted depends completely on the module
- implementation. The encrypted secondary password (also called a
- "mapped password") can be stored in a trusted or untrusted place,
- such as a smart card, a local file, or a directory service. If the
- encrypted passwords are stored in an untrusted publicly accessible
- place, this does provide an intruder with opportunities for potential
- dictionary attack.
-
- Though password-mapping is voluntary, it is recommended that all
- module providers add support for the following four mapping options:
-
- (a) `use_first_pass': Use the same password used by the first
- mechanism that asked for a password. The module should not ask
- for the password if the user cannot be authenticated by the
- first password. This option is normally used when the system
- administrator wants to enforce the same password across
- multiple modules.
-
- (b) `try_first_pass': This is the same as `use_first_pass', except
- that if the primary password is not valid, it should prompt the
- user for the password.
-
- (c) `use_mapped_pass': Use the password-mapping scheme to get the
- actual password for this module. One possible implementation
- is to get the mapped-password using the XFN API [XFN 94], and
- decrypt it with the primary password to get the module-specific
- password. The module should not ask for the password if the
- user cannot be authenticated by the first password. The XFN
- API allows user-defined attributes (such as _mapped-password_)
- to be stored in the _user-context_. Using the XFN API is
- particularly attractive because support for the XFN may be
- found on many systems in the future.
-
-
-
- Samar, Schemers Page 13
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- (d) `try_mapped_pass': This is the same as `use_mapped_pass',
- except that if the primary password is not valid, it should
- prompt the user for the password.
-
- When passwords get updated, the PAM framework stores both the old as
- well as the new password to be able to inform other dependent
- authentication modules about the change. Other modules can use this
- information to update the encrypted password without forcing the user
- to type the sequence of passwords again. The PAM framework clears
- out the passwords before returning to the application.
-
- Table 3 illustrates how the same password can be used by `login' for
- authenticating to the standard UNIX login, Kerberos and RSA services.
- Once the user has been authenticated to the primary authentication
- service (UNIX `login' in this example) with the primary password, the
- option `use_mapped_pass' indicates to the Kerberos module that it
- should use the primary password to decrypt the stored Kerberos
- password and then use the Kerberos password to get the ticket for the
- ticket-granting-service. After that succeeds, the option
- `use_first_pass' indicates to the RSA module that instead of
- prompting the user for a password, it should use the primary password
- typed earlier for authenticating the user. Note that in this
- scenario, the user has to enter the password just once.
-
- Note that if a one-time password scheme (e.g., S/Key) is used,
- password mapping cannot apply.
-
- 7.3. Implications of Stacking on the PAM Design
-
- Because of the stacking capability of PAM, we have designed the PAM
- API's to not return any data to the application, except status. If
- this were not the case, it would be difficult for the PAM framework
- to decide which module should return data to the application. When
- there is any error, the application does not know which of the
- modules failed. This behavior enables (even requires) the
- application to be completely independent from the modules.
-
- Another design decision we have made is that PAM gives only the user
- name to all the underlying PAM modules, hence it is the
- responsibility of the PAM modules to convert the name to their own
- internal format. For example, the Kerberos module may have to
- convert the UNIX user name to a Kerberos principal name.
-
- Stacking also forces the modules to be designed such that they can
- occur anywhere in the stack without any side-effects.
-
- Since modules such as the authentication and the password module are
- very closely related, it is important they be configured in the same
- order and with compatible options.
-
-
-
-
-
- Samar, Schemers Page 14
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- 8. INTEGRATION WITH SMART CARDS
-
- Many networking authentication protocols require possession of a long
- key to establish the user identity. For ease-of-use reasons, that
- long key is normally encrypted with the user's password so that the
- user is not required to memorize it. However, weak passwords can be
- compromised through a dictionary attack and thus undermine the
- stronger network authentication mechanism. Furthermore, the
- encrypted data is normally stored in a centrally accessible service
- whose availability depends upon the reliability of the associated
- service. Solutions have been proposed to use a pass-phrase or one-
- time-password, but those are much longer than the regular eight
- character passwords traditionally used with UNIX `login'. This makes
- the solution user-unfriendly because it requires longer strings to be
- remembered and typed.
-
- For most authentication protocol implementations, the trust boundary
- is the local machine. This assumption may not be valid in cases
- where the user is mobile and has to use publicly available networked
- computers. In such cases, it is required that the clear text of the
- key or the password never be made available to the machine.
-
- Smart cards solve the above problems by reducing password exposure by
- supporting a _two factor_ authentication mechanism: the first with
- the possession of the card, and the second with the knowledge of the
- PIN associated with the card. Not only can the smart cards be a
- secure repository of multiple passwords, they can also provide the
- encryption and authentication functions such that the long (private)
- key is never exposed outside the card.
-
- The PAM framework allows for integrating smart cards to the system by
- providing a smart card specific module for authentication.
- Furthermore, the unified login problem is simplified because the
- multiple passwords for various authentication mechanisms can be
- stored on the smart card itself. This can be enabled by adding a
- suitable key-word such as `use_smart_card' in the _options_ field.
-
-
- 9. SECURITY ISSUES
-
- It is important to understand the impact of PAM on the security of
- any system so that the site-administrator can make an informed
- decision.
-
- (a) Sharing of passwords with multiple authentication mechanisms.
-
- If there are multiple authentication modules, one possibility
- is to use the same password for all of them. If the password
- for any of the multiple authentication system is compromised,
- the user's password in all systems would be compromised. If
- this is a concern, then multiple passwords might be considered
-
-
-
- Samar, Schemers Page 15
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- at the cost of ease-of-use.
-
- (b) Password-mapping.
-
- This technique of encrypting all other passwords with the
- primary password assumes that it is lot more difficult to crack
- the primary password and that reasonable steps have been taken
- to ensure limited availability of the encrypted primary
- password. If this is not done, an intruder could target the
- primary password as the first point of dictionary attack. If
- one of the other modules provide stronger security than the
- password based security, the site would be negating the strong
- security by using password-mapping. If this is a concern, then
- multiple passwords might be considered at the cost of ease-of-
- use. If smart cards are used, they obviate the need for
- password-mapping completely.
-
- (c) Security of the configuration file.
-
- Since the policy file dictates how the user is authenticated,
- this file should be protected from unauthorized modifications.
-
- (d) Stacking various PAM modules.
-
- The system administrator should fully understand the
- implications of stacking various modules that will be installed
- on the system and their respective orders and interactions.
- The composition of various authentication modules should be
- carefully examined. The trusted computing base of the machine
- now includes the PAM modules.
-
-
- 10. EXPERIENCE WITH PAM
-
- The PAM framework was first added in Solaris 2.3 release as a private
- internal interface. PAM is currently being used by several system
- entry applications such as `login', `passwd', `su', `dtlogin',
- `rlogind', `rshd', `telnetd', `ftpd', `in.rexecd', `uucpd', `init',
- `sac', and `ttymon'. We have found that PAM provides an excellent
- framework to encapsulate the authentication-related tasks for the
- entire system. The Solaris 2.3 PAM API's were hence enhanced and
- simplified to support stacking.
-
- PAM modules have been developed for UNIX, DCE, Kerberos, S/Key,
- remote user authentication, and dialpass authentication. Other PAM
- modules are under development, and integration with smart cards is
- being planned.
-
- Some third parties have used the PAM interface to extend the security
- mechanisms offered by the Solaris environment.
-
-
-
-
- Samar, Schemers Page 16
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- The PAM API has been accepted by Common Desktop Environment (CDE)
- vendors as the API to be used for integrating the graphical interface
- for login, `dtlogin' with multiple authentication mechanisms.
-
-
- 11. FUTURE WORK
-
- Amongst the various components of PAM, the password component needs
- to be carefully examined to see whether the stacking semantics are
- particularly applicable, and how PAM should deal with partial
- failures when changing passwords.
-
- The _control_flag_ of the configuration file can be extended to
- include other semantics. For example, if the error is "name service
- not available", one may want to retry. It is also possible to offer
- semantics of "return success if any of the modules return success".
-
- In an earlier section, we had mentioned integration of smart cards
- with PAM. Though we feel that integration should be straight forward
- from the PAM architecture point of view, there may be some issues
- with implementation because the interfaces to the smart cards have
- not yet been standardized.
-
- One possible extension to PAM is to allow the passing of module-
- specific data between applications and PAM modules. For example, the
- `login' program likes to build its new environment from a select list
- of variables, yet the DCE module needs the `KRB5CCNAME' variable to
- be exported to the child process. For now we have modified the
- `login' program to explicitly export the `KRB5CCNAME' variable.
-
- Administrative tools are needed to help system administrators modify
- `pam.conf', and perform sanity checks on it (i.e., a `pam_check'
- utility).
-
-
- 12. CONCLUSION
-
- The PAM framework and the module interfaces provide pluggability for
- user authentication, as well as for account, session and password
- management. The PAM architecture can be used by `login' and by all
- other system-entry services, and thus ensure that all entry points
- for the system have been secured. This architecture enables
- replacement and modification of authentication modules in the field
- to secure the system against the newly found weaknesses without
- changing any of the system services.
-
- The PAM framework can be used to integrate `login' and `dtlogin' with
- different authentication mechanisms such as RSA and Kerberos.
- Multiple authentication systems can be accessed with the same
- password. The PAM framework also provides easy integration of smart
- cards into the system.
-
-
-
- Samar, Schemers Page 17
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- PAM provides complementary functionality to GSS-API, in that it
- provides mechanisms through which the user gets authenticated to any
- new system-level authentication service on the machine. GSS-API then
- uses the credentials for authenticated and secure communications with
- other application-level service entities on the network.
-
-
- 13. ACKNOWLEDGEMENTS
-
- PAM development has spanned several release cycles at SunSoft.
- Shau-Ping Lo, Chuck Hickey, and Alex Choy did the first design and
- implementation. Bill Shannon and Don Stephenson helped with the PAM
- architecture. Rocky Wu prototyped stacking of multiple modules.
- Paul Fronberg, Charlie Lai, and Roland Schemers made very significant
- enhancements to the PAM interfaces and took the project to completion
- within a very short time. Kathy Slattery wrote the PAM
- documentation. John Perry integrated PAM within the CDE framework.
-
-
- APPENDIX A. PAM API'S
-
- This appendix gives an informal description of the various interfaces
- of PAM. Since the goal here is just for the reader to get a working
- knowledge about the PAM interfaces, not all flags and options have
- been fully defined and explained. The API's described here are
- subject to change.
-
- The PAM Service Provider Interface is very similar to the PAM API,
- except for one extra parameter to pass module-specific options to the
- underlying modules.
-
- A.1. Framework Layer API's
-
- int
- pam_start(
- char *service_name,
- char *user,
- struct pam_conv *pam_conversation,
- pam_handle_t **pamh
- );
-
- `pam_start()' is called to initiate an authentication transaction.
- `pam_start()' takes as arguments the name of the service, the name of
- the user to be authenticated, the address of the conversation
- structure. `pamh' is later used as a handle for subsequent calls to
- the PAM library.
-
- The PAM modules do not communicate directly with the user; instead
- they rely on the application to perform all such interaction. The
- application needs to provide the conversation functions, `conv()',
- and associated application data pointers through a `pam_conv'
-
-
-
- Samar, Schemers Page 18
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- structure when it initiates an authentication transaction. The
- module uses the `conv()' function to prompt the user for data,
- display error messages, or text information.
-
- int
- pam_end(
- pam_handle_t *pamh,
- int pam_status
- );
-
- `pam_end()' is called to terminate the PAM transaction as specified
- by `pamh', and to free any storage area allocated by the PAM modules
- with `pam_set_item()'.
-
- int
- pam_set_item(
- pam_handle_t *pamh,
- int item_type,
- void *item
- );
-
- int
- pam_get_item(
- pam_handle_t *pamh,
- int item_type,
- void **item);
-
- `pam_get_item()' and `pam_set_item()' allow the parameters specified
- in the initial call to `pam_start()' to be read and updated. This is
- useful when a particular parameter is not available when
- `pam_start()' is called or must be modified after the initial call to
- `pam_start()'. `pam_set_item()' is passed a pointer to the object,
- `item', and its type, `item_type'. `pam_get_item()' is passed the
- address of the pointer, `item', which is assigned the address of the
- requested object.
-
- The `item_type' is one of the following:
-
- Table 5: Possible Values for Item_type
-
- Item Name Description
- --------- -----------
- PAM_SERVICE The service name
- PAM_USER The user name
- PAM_TTY The tty name
- PAM_RHOST The remote host name
- PAM_CONV The pam_conv structure
- PAM_AUTHTOK The authentication token (password)
- PAM_OLDAUTHTOK The old authentication token
- PAM_RUSER The remote user name
-
-
-
-
- Samar, Schemers Page 19
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- Note that the values of `PAM_AUTHTOK' and `PAM_OLDAUTHTOK' are only
- available to PAM modules and not to the applications. They are
- explicitly cleared out by the framework before returning to the
- application.
-
- char *
- pam_strerror(
- int errnum
- );
-
- `pam_strerror()' maps the error number to a PAM error message string,
- and returns a pointer to that string.
-
- int
- pam_set_data(
- pam_handle_t *pamh,
- char *module_data_name,
- char *data,
- (*cleanup)(pam_handle_t *pamh, char *data,
- int error_status)
- );
-
- The `pam_set_data()' function stores module specific data within the
- PAM handle. The `module_data_name' uniquely specifies the name to
- which some data and cleanup callback function can be attached. The
- cleanup function is called when `pam_end()' is invoked.
-
- int
- pam_get_data(
- pam_handle_t *pamh,
- char *module_data_name,
- void **datap
- );
-
- The `pam_get_data()' function obtains module-specific data from the
- PAM handle stored previously by the `pam_get_data()' function. The
- `module_data_name' uniquely specifies the name for which data has to
- be obtained. This function is normally used to retrieve module
- specific state information.
-
- A.2. Authentication API's
-
- int
- pam_authenticate(
- pam_handle_t *pamh,
- int flags
- );
-
- The `pam_authenticate()' function is called to verify the identity of
- the current user. The user is usually required to enter a password
- or similar authentication token, depending upon the authentication
-
-
-
- Samar, Schemers Page 20
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- module configured with the system. The user in question is specified
- by a prior call to `pam_start()', and is referenced by the
- authentication handle, `pamh'.
-
- int
- pam_setcred(
- pam_handle_t *pamh,
- int flags
- );
-
- The `pam_setcred()' function is called to set the credentials of the
- current process associated with the authentication handle, `pamh'.
- The actions that can be denoted through `flags' include credential
- initialization, refresh, reinitialization and deletion.
-
- A.3. Account Management API
-
- int
- pam_acct_mgmt(
- pam_handle_t *pamh,
- int flags
- );
-
- The function `pam_acct_mgmt()' is called to determine whether the
- current user's account and password are valid. This typically
- includes checking for password and account expiration, valid login
- times, etc. The user in question is specified by a prior call to
- `pam_start()', and is referenced by the authentication handle,
- `pamh'.
-
- A.4. Session Management API's
-
- int
- pam_open_session(
- pam_handle_t *pamh,
- int flags
- );
-
- `pam_open_session()' is called to inform the session modules that a
- new session has been initialized. All programs which use PAM should
- invoke `pam_open_session()' when beginning a new session.
-
- int
- pam_close_session(
- pam_handle_t *pamh,
- int flags
- );
-
- Upon termination of this session, the `pam_close_session()' function
- should be invoked to inform the underlying modules that the session
- has terminated.
-
-
-
- Samar, Schemers Page 21
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- A.5. Password Management API's
-
- int
- pam_chauthtok(
- pam_handle_t *pamh,
- int flags
- );
-
- `pam_chauthtok()' is called to change the authentication token
- associated with the user referenced by the authentication handle
- `pamh'. After the call, the authentication token of the user will be
- changed in accordance with the authentication module configured on
- the system.
-
-
- APPENDIX B. SAMPLE PAM APPLICATION
-
- This appendix shows a sample `login' application which uses the PAM
- API's. It is not meant to be a fully functional login program, as
- some functionality has been left out in order to emphasize the use of
- PAM API's.
-
- #include <security/pam_appl.h>
-
- static int login_conv(int num_msg, struct pam_message **msg,
- struct pam_response **response, void *appdata_ptr);
-
- static struct pam_conv pam_conv = {login_conv, NULL};
-
- static pam_handle_t *pamh; /* Authentication handle */
-
- void
- main(int argc, char *argv[], char **renvp)
- {
-
- /*
- * Call pam_start to initiate a PAM authentication operation
- */
-
- if ((pam_start("login", user_name, &pam_conv, &pamh))
- != PAM_SUCCESS)
- login_exit(1);
-
- pam_set_item(pamh, PAM_TTY, ttyn);
- pam_set_item(pamh, PAM_RHOST, remote_host);
-
- while (!authenticated && retry < MAX_RETRIES) {
- status = pam_authenticate(pamh, 0);
- authenticated = (status == PAM_SUCCESS);
- }
-
-
-
-
- Samar, Schemers Page 22
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- if (status != PAM_SUCCESS) {
- fprintf(stderr,"error: %s\n", pam_strerror(status));
- login_exit(1);
- }
-
- /* now check if the authenticated user is allowed to login. */
-
- if ((status = pam_acct_mgmt(pamh, 0)) != PAM_SUCCESS) {
- if (status == PAM_AUTHTOK_EXPIRED) {
- status = pam_chauthtok(pamh, 0);
- if (status != PAM_SUCCESS)
- login_exit(1);
- } else {
- login_exit(1);
- }
- }
-
- /*
- * call pam_open_session to open the authenticated session
- * pam_close_session gets called by the process that
- * cleans up the utmp entry (i.e., init)
- */
- if (status = pam_open_session(pamh, 0) != PAM_SUCCESS) {
- login_exit(status);
- }
-
- /* set up the process credentials */
- setgid(pwd->pw_gid);
-
- /*
- * Initialize the supplementary group access list.
- * This should be done before pam_setcred because
- * the PAM modules might add groups during the pam_setcred call
- */
- initgroups(user_name, pwd->pw_gid);
-
- status = pam_setcred(pamh, PAM_ESTABLISH_CRED);
- if (status != PAM_SUCCESS) {
- login_exit(status);
- }
-
- /* set the real (and effective) UID */
- setuid(pwd->pw_uid);
-
- pam_end(pamh, PAM_SUCCESS); /* Done using PAM */
-
- /*
- * Add DCE/Kerberos cred name, if any.
- * XXX - The module specific stuff should be removed from login
- * program eventually. This is better placed in DCE module and
- * will be once PAM has routines for "exporting" environment
-
-
-
- Samar, Schemers Page 23
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- * variables.
- */
- krb5p = getenv("KRB5CCNAME");
- if (krb5p != NULL) {
- ENVSTRNCAT(krb5ccname, krb5p);
- envinit[basicenv++] = krb5ccname;
- }
- environ = envinit; /* Switch to the new environment. */
- exec_the_shell();
-
- /* All done */
- }
-
- /*
- * login_exit - Call exit() and terminate.
- * This function is here for PAM so cleanup can
- * be done before the process exits.
- */
- static void
- login_exit(int exit_code)
- {
- if (pamh)
- pam_end(pamh, PAM_ABORT);
- exit(exit_code);
- /*NOTREACHED*/
- }
-
- /*
- * login_conv():
- * This is the conv (conversation) function called from
- * a PAM authentication module to print error messages
- * or garner information from the user.
- */
-
- static int
- login_conv(int num_msg, struct pam_message **msg,
- struct pam_response **response, void *appdata_ptr)
- {
-
- while (num_msg--) {
- switch (m->msg_style) {
-
- case PAM_PROMPT_ECHO_OFF:
- r->resp = strdup(getpass(m->msg));
- break;
-
- case PAM_PROMPT_ECHO_ON:
- (void) fputs(m->msg, stdout);
- r->resp = malloc(PAM_MAX_RESP_SIZE);
- fgets(r->resp, PAM_MAX_RESP_SIZE, stdin);
- /* add code here to remove \n from fputs */
-
-
-
- Samar, Schemers Page 24
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- break;
-
- case PAM_ERROR_MSG:
- (void) fputs(m->msg, stderr);
- break;
-
- case PAM_TEXT_INFO:
- (void) fputs(m->msg, stdout);
- break;
-
- default:
- /* add code here to log error message, etc */
- break;
- }
- }
- return (PAM_SUCCESS);
- }
-
-
- APPENDIX C. DCE MODULE
-
- This appendix describes a sample implementation of a DCE PAM module.
- In order to simplify the description, we do not address the issues
- raised by password-mapping or stacking. The intent is to show which
- DCE calls are being made by the DCE module.
-
- The `pam_sm_*()' functions implement the PAM SPI functions which are
- called from the PAM API functions.
-
- C.1. DCE Authentication Management
-
- The algorithm for authenticating with DCE (not including error
- checking, prompting for passwords, etc.) is as follows:
-
- pam_sm_authenticate()
- {
- sec_login_setup_identity(...);
- pam_set_data(...);
- sec_login_valid_and_cert_ident(...);
- }
-
- pam_sm_setcred()
- {
- pam_get_data(...);
- sec_login_set_context(...);
- }
-
- The `pam_sm_authenticate()' function for DCE uses the
- `pam_set_data()' and `pam_get_data()' functions to keep state (like
- the `sec_login_handle_t' context) between calls. The following
- cleanup function is also registered and gets called when `pam_end()'
-
-
-
- Samar, Schemers Page 25
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- is called:
-
- dce_cleanup()
- {
- if (/* PAM_SUCCESS and
- sec_login_valid_and_cert_ident success */) {
- sec_login_release_context(...);
- } else {
- sec_login_purge_context(...);
- }
- }
-
- If everything was successful we release the login context, but leave
- the credentials file intact. If the status passed to `pam_end()' was
- not `PAM_SUCCESS' (i.e., a required module failed) we purge the login
- context which also removes the credentials file.
-
- C.2. DCE Account Management
-
- The algorithm for DCE account management is as follows:
-
- pam_sm_acct_mgmt()
- {
- pam_get_data(...);
- sec_login_inquire_net_info(...);
- /* check for expired password and account */
- sec_login_free_net_info(...);
- }
-
- The `sec_login_inquire_net_info()' function is called to obtain
- information about when the user's account and/or password are going
- to expire. A warning message is displayed (using the conversation
- function) if the user's account or password is going to expire in the
- near future, or has expired. These warning messages can be disabled
- using the `nowarn' option in the `pam.conf' file.
-
- C.3. DCE Session Management
-
- The DCE session management functions are currently empty. They could
- be modified to optionally remove the DCE credentials file upon
- logout, etc.
-
- C.4. DCE Password Management
-
- The algorithm for DCE password management is as follows:
-
-
-
-
-
-
-
-
-
- Samar, Schemers Page 26
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- pam_sm_chauthtok
- {
- sec_rgy_site_open(...);
- sec_rgy_acct_lookup(...);
- sec_rgy_acct_passwd(...);
- sec_rgy_site_close(...);
- }
-
- The `sec_rgy_acct_passwd()' function is called to change the user's
- password in the DCE registry.
-
-
- REFERENCES
-
- [Adamson 95] W. A. Adamson, J. Rees, and P. Honeyman, "Joining
- Security Realms: A Single Login for Netware and
- Kerberos", CITI Technical Report 95-1, Center for
- Information Technology Integration, University of
- Michigan, Ann Arbor, MI, February 1995.
-
- [Diffie 76] W. Diffie and M. E. Hellman, "New Directions in
- Cryptography", IEEE Transactions on Information
- Theory, November 1976.
-
- [Linn 93] J. Linn, "Generic Security Service Application
- Programming Interface", Internet RFC 1508, 1509, 1993.
-
- [Rivest 78] R. L. Rivest, A. Shamir, and L. Adleman., "A Method
- for Obtaining Digital Signatures and Pubic-key
- Cryptosystems", Communications of the ACM, 21(2),
- 1978.
-
- [SIA 95] "Digital UNIX Security", Digital Equipment
- Corporation, Order Number AA-Q0R2C-TE, July 1995.
-
- [Skey 94] N. M. Haller, "The S/Key One-Time Password System",
- ISOC Symposium on Network and Distributed Security,
- 1994.
-
- [Steiner 88] J.G. Steiner, B. C. Neuman, and J. I. Schiller,
- "Kerberos, An Authentication Service for Open Network
- Systems", in Proceedings of the Winter USENIX
- Conference, Dallas, Jan 1988.
-
- [Taylor 88] B. Taylor and D. Goldberg, "Secure Networking in the
- Sun Environment", Sun Microsystems Technical Paper,
- 1988.
-
- [XFN 94] "Federated Naming: the XFN Specifications", X/Open
- Preliminary Specification, X/Open Document #P403,
- ISBN:1-85912-045-8, X/Open Co. Ltd., July 1994.
-
-
-
- Samar, Schemers Page 27
-
-
-
-
-
-
-
- OSF-RFC 86.0 PAM October 1995
-
-
-
- AUTHOR'S ADDRESS
-
- Vipin Samar Internet email: vipin@eng.sun.com
- SunSoft, Inc. Telephone: +1-415-336-1002
- 2550 Garcia Avenue
- Mountain View, CA 94043
- USA
-
- Roland J. Schemers III Internet email: schemers@eng.sun.com
- SunSoft, Inc. Telephone: +1-415-336-1035
- 2550 Garcia Avenue
- Mountain View, CA 94043
- USA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Samar, Schemers Page 28
-
-
-
-
-
-
diff --git a/contrib/libpam/libpam/Makefile b/contrib/libpam/libpam/Makefile
deleted file mode 100644
index f3914a478b9a..000000000000
--- a/contrib/libpam/libpam/Makefile
+++ /dev/null
@@ -1,177 +0,0 @@
-#
-# $Id: Makefile,v 1.19 1997/04/05 06:58:43 morgan Exp morgan $
-#
-# $Log: Makefile,v $
-# Revision 1.19 1997/04/05 06:58:43 morgan
-# fakeroot
-#
-# Revision 1.18 1997/02/15 15:56:09 morgan
-# inherit major and minor numbers
-#
-# Revision 1.17 1997/01/04 20:03:09 morgan
-# update for .55
-#
-# Revision 1.16 1996/12/01 03:14:13 morgan
-# update for .54
-#
-# Revision 1.15 1996/11/10 20:07:51 morgan
-# updated for .53
-#
-# Revision 1.14 1996/09/05 06:06:53 morgan
-# added local flag for locking, slight reorganization too.
-#
-
-# need to tell libpam about the default directory for PAMs
-MOREFLAGS=-D"DEFAULT_MODULE_PATH=\"$(SECUREDIR)/\""
-
-# you may uncomment the following to build libpam in modified ways
-
-# lots of debugging information goes to /tmp/pam-debug.log
-#MOREFLAGS += -D"DEBUG"
-
-# pay attention to locked /etc/pam.conf or /etc/pam.d/* files
-#MOREFLAGS += -D"PAM_LOCKING"
-
-# read both the /etc/pam.d/ and pam.conf files specific to the deisred service
-#MOREFLAGS += -D"PAM_READ_BOTH_CONFS"
-
-# make a kludge attempt to be compatible with the old pam_strerror
-# calling convention
-#MOREFLAGS += -D"UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT"
-
-ifeq ($(DEBUG_REL),yes)
- LIBNAME=libpamd
-else
- LIBNAME=libpam
-endif
-VERSION=.$(MAJOR_REL)
-MODIFICATION=.$(MINOR_REL)
-
-# ---------------------------------------------
-
-dummy:
- @echo "*** This is not a top-level Makefile!"
-
-# ---------------------------------------------
-
-CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS)
-
-# dynamic library names
-
-LIBPAM = $(LIBNAME).$(DYNTYPE)
-LIBPAMNAME = $(LIBPAM)$(VERSION)
-LIBPAMFULL = $(LIBPAMNAME)$(MODIFICATION)
-
-# static library name
-
-LIBPAMSTATIC = $(LIBNAME).a
-
-ifdef STATIC
-MODULES = $(shell cat ../modules/_static_module_objects)
-STATICOBJ = pam_static.o
-endif
-
-ifdef MEMORY_DEBUG
-EXTRAS += pam_malloc.o
-endif
-
-LIBOBJECTS = pam_item.o pam_strerror.o pam_end.o pam_start.o pam_data.o \
- pam_delay.o pam_dispatch.o pam_handlers.o pam_misc.o \
- pam_account.o pam_auth.o pam_session.o pam_password.o \
- pam_env.o pam_log.o $(EXTRAS)
-
-ifdef DYNAMIC_LIBPAM
-DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS) $(STATICOBJ))
-ifdef STATICOBJ
-dynamic/pam_static.o: pam_static.c ../modules/_static_module_objects
- $(CC) $(CFLAGS) -c pam_static.c -o $@
-endif
-endif
-
-ifdef STATIC_LIBPAM
-SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS) $(STATICOBJ))
-ifdef STATICOBJ
-static/pam_static.o: pam_static.c ../modules/_static_module_objects
- $(CC) $(CFLAGS) -c pam_static.c -o $@
-endif
-endif
-
-# ---------------------------------------------
-## rules
-
-all: dirs $(LIBPAM) $(LIBPAMSTATIC)
-
-dirs:
-ifdef DYNAMIC_LIBPAM
- mkdir -p dynamic
-endif
-ifdef STATIC_LIBPAM
- mkdir -p static
-endif
-
-dynamic/%.o : %.c
- $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-
-static/%.o : %.c
- $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-
-$(LIBPAM): $(DLIBOBJECTS)
-ifdef DYNAMIC_LIBPAM
- ifeq ($(USESONAME),yes)
- $(LD_L) $(SOSWITCH) $(LIBPAMNAME) -o $@ $(DLIBOBJECTS) $(MODULES)
- else
- $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
- endif
- ifeq ($(NEEDSONAME),yes)
- rm -f $(LIBPAMFULL)
- ln -s $(LIBPAM) $(LIBPAMFULL)
- rm -f $(LIBPAMNAME)
- ln -s $(LIBPAM) $(LIBPAMNAME)
- endif
-endif
-
-$(LIBPAMSTATIC): $(SLIBOBJECTS)
-ifdef STATIC_LIBPAM
- $(AR) $@ $(SLIBOBJECTS) $(MODULES)
- $(RANLIB) $@
-endif
-
-install: all
- $(MKDIR) $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/security/pam_appl.h $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/security/pam_modules.h $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/security/_pam_macros.h $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/security/_pam_types.h $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 include/security/_pam_compat.h $(FAKEROOT)$(INCLUDED)
-ifdef MEMORY_DEBUG
- $(INSTALL) -m 644 include/security/pam_malloc.h $(FAKEROOT)$(INCLUDED)
-endif
-ifdef DYNAMIC_LIBPAM
- $(INSTALL) -m $(SHLIBMODE) $(LIBPAM) $(FAKEROOT)$(LIBDIR)/$(LIBPAMFULL)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
- ( cd $(FAKEROOT)$(LIBDIR) ; rm -f $(LIBPAM) ; ln -s $(LIBPAMNAME) $(LIBPAM) )
- endif
-endif
-ifdef STATIC_LIBPAM
- $(INSTALL) -m 644 $(LIBPAMSTATIC) $(FAKEROOT)$(LIBDIR)
-endif
-
-remove:
- rm -f $(FAKEROOT)$(INCLUDED)/_pam_types.h
- rm -f $(FAKEROOT)$(INCLUDED)/_pam_macros.h
- rm -f $(FAKEROOT)$(INCLUDED)/pam_appl.h
- rm -f $(FAKEROOT)$(INCLUDED)/pam_modules.h
- rm -f $(FAKEROOT)$(INCLUDED)/pam_malloc.h
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAM).*
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAM)
- $(LDCONFIG)
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAMSTATIC)
-
-clean:
- rm -f a.out core *~ static/*.o dynamic/*.o
-
-extraclean: clean
- rm -f *.a *.out *.o *.so ./include/security/*~
- if [ -d dynamic ]; then rmdir dynamic ; fi
- if [ -d static ]; then rmdir static ; fi
diff --git a/contrib/libpam/libpam/include/security/_pam_compat.h b/contrib/libpam/libpam/include/security/_pam_compat.h
deleted file mode 100644
index acfc59231af0..000000000000
--- a/contrib/libpam/libpam/include/security/_pam_compat.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef _PAM_COMPAT_H
-#define _PAM_COMPAT_H
-
-/*
- * This file was contributed by Derrick J Brashear <shadow@dementia.org>
- *
- * A number of operating systems have started to implement PAM.
- * unfortunately, they have a different set of numeric values for
- * certain constants. This file is included for compatibility's sake.
- */
-
-/* Solaris uses different constants. We redefine to those here */
-#if defined(solaris) || (defined(__SVR4) && defined(sun))
-
-/* generic for pam_* functions */
-# undef PAM_SILENT
-# define PAM_SILENT 0x80000000
-
-/* flags for pam_chauthtok() */
-# undef PAM_PRELIM_CHECK
-# define PAM_PRELIM_CHECK 0x1
-
-# undef PAM_UPDATE_AUTHTOK
-# define PAM_UPDATE_AUTHTOK 0x2
-
-/* flags for pam_setcred() */
-# undef PAM_ESTABLISH_CRED
-# define PAM_ESTABLISH_CRED 0x1
-
-# undef PAM_DELETE_CRED
-# define PAM_DELETE_CRED 0x2
-
-# undef PAM_REINITIALIZE_CRED
-# define PAM_REINITIALIZE_CRED 0x4
-
-# define PAM_REFRESH_CRED 0x8
-# undef PAM_REFRESH_CRED
-
-/* another binary incompatibility comes from the return codes! */
-
-# undef PAM_CONV_ERR
-# define PAM_CONV_ERR 6
-
-# undef PAM_PERM_DENIED
-# define PAM_PERM_DENIED 7
-
-# undef PAM_MAXTRIES
-# define PAM_MAXTRIES 8
-
-# undef PAM_AUTH_ERR
-# define PAM_AUTH_ERR 9
-
-# undef PAM_NEW_AUTHTOK_REQD
-# define PAM_NEW_AUTHTOK_REQD 10
-
-# undef PAM_CRED_INSUFFICIENT
-# define PAM_CRED_INSUFFICIENT 11
-
-# undef PAM_AUTHINFO_UNAVAIL
-# define PAM_AUTHINFO_UNAVAIL 12
-
-# undef PAM_USER_UNKNOWN
-# define PAM_USER_UNKNOWN 13
-
-# undef PAM_CRED_UNAVAIL
-# define PAM_CRED_UNAVAIL 14
-
-# undef PAM_CRED_EXPIRED
-# define PAM_CRED_EXPIRED 15
-
-# undef PAM_CRED_ERR
-# define PAM_CRED_ERR 16
-
-# undef PAM_ACCT_EXPIRED
-# define PAM_ACCT_EXPIRED 17
-
-# undef PAM_AUTHTOK_EXPIRED
-# define PAM_AUTHTOK_EXPIRED 18
-
-# undef PAM_SESSION_ERR
-# define PAM_SESSION_ERR 19
-
-# undef PAM_AUTHTOK_ERR
-# define PAM_AUTHTOK_ERR 20
-
-# undef PAM_AUTHTOK_RECOVERY_ERR
-# define PAM_AUTHTOK_RECOVERY_ERR 21
-
-# undef PAM_AUTHTOK_LOCK_BUSY
-# define PAM_AUTHTOK_LOCK_BUSY 22
-
-# undef PAM_AUTHTOK_DISABLE_AGING
-# define PAM_AUTHTOK_DISABLE_AGING 23
-
-# undef PAM_NO_MODULE_DATA
-# define PAM_NO_MODULE_DATA 24
-
-# undef PAM_IGNORE
-# define PAM_IGNORE 25
-
-# undef PAM_ABORT
-# define PAM_ABORT 26
-
-# undef PAM_TRY_AGAIN
-# define PAM_TRY_AGAIN 27
-
-#endif /* defined(solaris) || (defined(__SVR4) && defined(sun)) */
-
-#endif /* _PAM_COMPAT_H */
diff --git a/contrib/libpam/libpam/include/security/_pam_macros.h b/contrib/libpam/libpam/include/security/_pam_macros.h
deleted file mode 100644
index b033aa63fab6..000000000000
--- a/contrib/libpam/libpam/include/security/_pam_macros.h
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef PAM_MACROS_H
-#define PAM_MACROS_H
-
-/*
- * All kind of macros used by PAM, but usable in some other
- * programs too.
- * Organized by Cristian Gafton <gafton@redhat.com>
- */
-
-/* a 'safe' version of strdup */
-
-extern char *strdup(const char *s);
-#define x_strdup(s) ( (s) ? strdup(s):NULL )
-
-/* Good policy to strike out passwords with some characters not just
- free the memory */
-
-#define _pam_overwrite(x) \
-do { \
- register char *__xx__; \
- if ((__xx__=(x))) \
- while (*__xx__) \
- *__xx__++ = '\0'; \
-} while (0)
-
-/*
- * Don't just free it, forget it too.
- */
-
-#define _pam_drop(X) \
-do { \
- if (X) { \
- free(X); \
- X=NULL; \
- } \
-} while (0)
-
-#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
-do { \
- int reply_i; \
- \
- for (reply_i=0; reply_i<replies; ++reply_i) { \
- if (reply[reply_i].resp) { \
- _pam_overwrite(reply[reply_i].resp); \
- free(reply[reply_i].resp); \
- } \
- } \
- if (reply) \
- free(reply); \
-} while (0)
-
-/* some debugging code */
-
-#ifdef DEBUG
-
-/*
- * This provides the necessary function to do debugging in PAM.
- * Cristian Gafton <gafton@redhat.com>
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <errno.h>
-
-/*
- * This is for debugging purposes ONLY. DO NOT use on live systems !!!
- * You have been warned :-) - CG
- *
- * to get automated debugging to the log file, it must be created manually.
- * _PAM_LOGFILE must exist, mode 666
- */
-
-#ifndef _PAM_LOGFILE
-#define _PAM_LOGFILE "/tmp/pam-debug.log"
-#endif
-
-static void _pam_output_debug_info(const char *file, const char *fn
- , const int line)
-{
- FILE *logfile;
- int must_close = 1;
-
- if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
- logfile = stderr;
- must_close = 0;
- }
- fprintf(logfile,"[%s:%s(%d)] ",file, fn, line);
- if (must_close) {
- fflush(logfile);
- fclose(logfile);
- }
-}
-
-static void _pam_output_debug(const char *format, ...)
-{
- va_list args;
- FILE *logfile;
- int must_close = 1;
-
- va_start(args, format);
-
- if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
- logfile = stderr;
- must_close = 0;
- }
- vfprintf(logfile, format, args);
- fprintf(logfile, "\n");
- if (must_close) {
- fflush(logfile);
- fclose(logfile);
- }
-
- va_end(args);
-}
-
-#define D(x) do { \
- _pam_output_debug_info(__FILE__, __FUNCTION__, __LINE__); \
- _pam_output_debug x ; \
-} while (0)
-
-#define _pam_show_mem(X,XS) do { \
- int i; \
- register unsigned char *x; \
- x = (unsigned char *)X; \
- fprintf(stderr, " <start at %p>\n", X); \
- for (i = 0; i < XS ; ++x, ++i) { \
- fprintf(stderr, " %02X. <%p:%02X>\n", i, x, *x); \
- } \
- fprintf(stderr, " <end for %p after %d bytes>\n", X, XS); \
-} while (0)
-
-#define _pam_show_reply(/* struct pam_response * */reply, /* int */replies) \
-do { \
- int reply_i; \
- setbuf(stderr, NULL); \
- fprintf(stderr, "array at %p of size %d\n",reply,replies); \
- fflush(stderr); \
- if (reply) { \
- for (reply_i = 0; reply_i < replies; reply_i++) { \
- fprintf(stderr, " elem# %d at %p: resp = %p, retcode = %d\n", \
- reply_i, reply+reply_i, reply[reply_i].resp, \
- reply[reply_i].resp, _retcode); \
- fflush(stderr); \
- if (reply[reply_i].resp) { \
- fprintf(stderr, " resp[%d] = '%s'\n", \
- strlen(reply[reply_i].resp), reply[reply_i].resp); \
- fflush(stderr); \
- } \
- } \
- } \
- fprintf(stderr, "done here\n"); \
- fflush(stderr); \
-} while (0)
-
-#else
-
-#define D(x) do { } while (0)
-#define _pam_show_mem(X,XS) do { } while (0)
-#define _pam_show_reply(reply, replies) do { } while (0)
-
-#endif /* DEBUG */
-
-#endif /* PAM_MACROS_H */
diff --git a/contrib/libpam/libpam/include/security/_pam_types.h b/contrib/libpam/libpam/include/security/_pam_types.h
deleted file mode 100644
index b68368b0c8e2..000000000000
--- a/contrib/libpam/libpam/include/security/_pam_types.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * <security/_pam_types.h>
- *
- * $Id: _pam_types.h,v 1.10 1997/04/05 06:52:50 morgan Exp morgan $
- *
- * This file defines all of the types common to the Linux-PAM library
- * applications and modules.
- *
- * Note, the copyright+license information is at end of file.
- *
- * Created: 1996/3/5 by AGM
- *
- * $Log$
- */
-
-#ifndef _SECURITY__PAM_TYPES_H
-#define _SECURITY__PAM_TYPES_H
-
-/*
- * include local definition for POSIX - NULL
- */
-
-#include <locale.h>
-
-/* This is a blind structure; users aren't allowed to see inside a
- * pam_handle_t, so we don't define struct pam_handle here. This is
- * defined in a file private to the PAM library. (i.e., it's private
- * to PAM service modules, too!) */
-
-typedef struct pam_handle pam_handle_t;
-
-/* ----------------- The Linux-PAM return values ------------------ */
-
-#define PAM_SUCCESS 0 /* Successful function return */
-#define PAM_OPEN_ERR 1 /* dlopen() failure when dynamically */
- /* loading a service module */
-#define PAM_SYMBOL_ERR 2 /* Symbol not found */
-#define PAM_SERVICE_ERR 3 /* Error in service module */
-#define PAM_SYSTEM_ERR 4 /* System error */
-#define PAM_BUF_ERR 5 /* Memory buffer error */
-#define PAM_PERM_DENIED 6 /* Permission denied */
-#define PAM_AUTH_ERR 7 /* Authentication failure */
-#define PAM_CRED_INSUFFICIENT 8 /* Can not access authentication data */
- /* due to insufficient credentials */
-#define PAM_AUTHINFO_UNAVAIL 9 /* Underlying authentication service */
- /* can not retrieve authenticaiton */
- /* information */
-#define PAM_USER_UNKNOWN 10 /* User not known to the underlying */
- /* authenticaiton module */
-#define PAM_MAXTRIES 11 /* An authentication service has */
- /* maintained a retry count which has */
- /* been reached. No further retries */
- /* should be attempted */
-#define PAM_NEW_AUTHTOK_REQD 12 /* New authentication token required. */
- /* This is normally returned if the */
- /* machine security policies require */
- /* that the password should be changed */
- /* beccause the password is NULL or it */
- /* has aged */
-#define PAM_ACCT_EXPIRED 13 /* User account has expired */
-#define PAM_SESSION_ERR 14 /* Can not make/remove an entry for */
- /* the specified session */
-#define PAM_CRED_UNAVAIL 15 /* Underlying authentication service */
- /* can not retrieve user credentials */
- /* unavailable */
-#define PAM_CRED_EXPIRED 16 /* User credentials expired */
-#define PAM_CRED_ERR 17 /* Failure setting user credentials */
-#define PAM_NO_MODULE_DATA 18 /* No module specific data is present */
-#define PAM_CONV_ERR 19 /* Conversation error */
-#define PAM_AUTHTOK_ERR 20 /* Authentication token manipulation error */
-#define PAM_AUTHTOK_RECOVER_ERR 21 /* Authentication information */
- /* cannot be recovered */
-#define PAM_AUTHTOK_LOCK_BUSY 22 /* Authentication token lock busy */
-#define PAM_AUTHTOK_DISABLE_AGING 23 /* Authentication token aging disabled */
-#define PAM_TRY_AGAIN 24 /* Preliminary check by password service */
-#define PAM_IGNORE 25 /* Ingore underlying account module */
- /* regardless of whether the control */
- /* flag is required, optional, or sufficient */
-#define PAM_ABORT 26 /* Critical error (?module fail now request) */
-#define PAM_AUTHTOK_EXPIRED 27 /* user's authentication token has expired */
-#define PAM_MODULE_UNKNOWN 28 /* module is not known */
-
-#define PAM_BAD_ITEM 29 /* Bad item passed to pam_*_item() */
-#define PAM_CONV_AGAIN 30 /* conversation function is event driven
- and data is not available yet */
-#define PAM_INCOMPLETE 31 /* please call this function again to
- complete authentication stack. Before
- calling again, verify that conversation
- is completed */
-
-/* Add new #define's here */
-
-#define _PAM_RETURN_VALUES 32 /* this is the number of return values */
-
-
-/* ---------------------- The Linux-PAM flags -------------------- */
-
-/* Authentication service should not generate any messages */
-#define PAM_SILENT 0x8000U
-
-/* Note: these flags are used by pam_authenticate{,_secondary}() */
-
-/* The authentication service should return PAM_AUTH_ERROR if the
- * user has a null authentication token */
-#define PAM_DISALLOW_NULL_AUTHTOK 0x0001U
-
-/* Note: these flags are used for pam_setcred() */
-
-/* Set user credentials for an authentication service */
-#define PAM_ESTABLISH_CRED 0x0002U
-
-/* Delete user credentials associated with an authentication service */
-#define PAM_DELETE_CRED 0x0004U
-
-/* Reinitialize user credentials */
-#define PAM_REINITIALIZE_CRED 0x0008U
-
-/* Extend lifetime of user credentials */
-#define PAM_REFRESH_CRED 0x0010U
-
-/* Note: these flags are used by pam_chauthtok */
-
-/* The password service should only update those passwords that have
- * aged. If this flag is not passed, the password service should
- * update all passwords. */
-#define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U
-
-/* ------------------ The Linux-PAM item types ------------------- */
-
-/* these defines are used by pam_set_item() and pam_get_item() */
-
-#define PAM_SERVICE 1 /* The service name */
-#define PAM_USER 2 /* The user name */
-#define PAM_TTY 3 /* The tty name */
-#define PAM_RHOST 4 /* The remote host name */
-#define PAM_CONV 5 /* The pam_conv structure */
-
-/* missing entries found in <security/pam_modules.h> for modules only! */
-
-#define PAM_RUSER 8 /* The remote user name */
-#define PAM_USER_PROMPT 9 /* the prompt for getting a username */
-#define PAM_FAIL_DELAY 10 /* app supplied function to override failure
- delays */
-#define PAM_LOG_STATE 11 /* ident, facility etc. logging info */
-
-/* ---------- Common Linux-PAM application/module PI ----------- */
-
-extern int pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
-extern int pam_get_item(const pam_handle_t *pamh, int item_type,
- const void **item);
-extern const char *pam_strerror(pam_handle_t *pamh, int errnum);
-
-extern int pam_putenv(pam_handle_t *pamh, const char *name_value);
-extern const char *pam_getenv(pam_handle_t *pamh, const char *name);
-extern char **pam_getenvlist(pam_handle_t *pamh);
-
-/* ---------- Common Linux-PAM application/module PI ----------- */
-
-/*
- * here are some proposed error status definitions for the
- * 'error_status' argument used by the cleanup function associated
- * with data items they should be logically OR'd with the error_status
- * of the latest return from libpam -- new with .52 and positive
- * impression from Sun although not official as of 1996/9/4
- * [generally the other flags are to be found in pam_modules.h]
- */
-
-#define PAM_DATA_SILENT 0x40000000 /* used to suppress messages... */
-
-/*
- * here we define an externally (by apps or modules) callable function
- * that primes the libpam library to delay when a stacked set of
- * modules results in a failure. In the case of PAM_SUCCESS this delay
- * is ignored.
- *
- * Note, the pam_[gs]et_item(... PAM_FAIL_DELAY ...) can be used to set
- * a function pointer which can override the default fail-delay behavior.
- * This item was added to accommodate event driven programs that need to
- * manage delays more carefully. The function prototype for this data
- * item is
- * void (*fail_delay)(int status, unsigned int delay);
- */
-
-#define HAVE_PAM_FAIL_DELAY
-extern int pam_fail_delay(pam_handle_t *pamh, unsigned int musec_delay);
-
-/*
- * the standard libc interface for syslog suffers from some problems.
- * The first is that it is not thread safe. It is also three functions
- * where PAM only really needs a "log this" function. It also does
- * not provide modules and applications with information about whether
- * the log is currently open or not etc... All of these things mean
- * that we need to centralize PAM's logging facility. These two functions
- * provide this centralization. They are, however, just a gateway to
- * libc's openlog/syslog/closelog functions. Please note, your apps/modules
- * will likely start to segfault if you do not use this function for
- * system logging.
- */
-
-struct pam_log_state {
- char *ident;
- int option;
- int facility;
-};
-
-#ifndef LOG_ERR
-# include <syslog.h> /* this is a sad HACK. But we need LOG_CRIT etc.. */
-#endif
-
-#define PAM_LOG_STATE_IDENT "PAM"
-#define PAM_LOG_STATE_OPTION LOG_PID
-#define PAM_LOG_STATE_FACILITY LOG_AUTHPRIV
-
-#ifndef va_start
-# include <stdarg.h>
-#endif
-
-#define HAVE_PAM_SYSTEM_LOG
-extern void pam_vsystem_log(const pam_handle_t *pamh,
- const struct pam_log_state *log_state,
- int priority, const char *format, va_list args);
-extern void pam_system_log(const pam_handle_t *pamh,
- const struct pam_log_state *log_state,
- int priority, const char *format, ... );
-
-#ifdef MEMORY_DEBUG
-/*
- * this defines some macros that keep track of what memory has been
- * allocated and indicates leakage etc... It should not be included in
- * production application/modules.
- */
-#include <security/pam_malloc.h>
-#endif
-
-/* ------------ The Linux-PAM conversation structures ------------ */
-
-/* Message styles */
-
-#define PAM_PROMPT_ECHO_OFF 1
-#define PAM_PROMPT_ECHO_ON 2
-#define PAM_ERROR_MSG 3
-#define PAM_TEXT_INFO 4
-
-/* Linux-PAM specific types */
-
-#define PAM_RADIO_TYPE 5 /* yes/no/maybe conditionals */
-
-/* This is for server client non-human interaction.. these are NOT
- part of the X/Open PAM specification (yet although Vipin has hinted
- that they may well be 1997/7/8) but are currently included for
- exploritory reasons. Basically, they are for the module to obtain a
- binary chunk of data from the client (via the server). Such data
- is intercepted by the server and unpacked in preparation for the
- module */
-
-#define PAM_BINARY_MSG 6
-#define PAM_BINARY_PROMPT 7
-
-/* maximum size of messages/responses etc.. (these are mostly
- arbitrary so Linux-PAM should handle longer values). */
-
-#define PAM_MAX_NUM_MSG 32
-#define PAM_MAX_MSG_SIZE 512
-#define PAM_MAX_RESP_SIZE 512
-
-/* Used to pass prompting text, error messages, or other informatory
- * text to the user. This structure is allocated and freed by the PAM
- * library (or loaded module). */
-
-struct pam_message {
- int msg_style;
- const char *msg;
-};
-
-/* if the pam_message.msg_style = PAM_BINARY_PROMPT
- the 'pam_message.msg' is a pointer to a 'const *' for the following
- pseudo-structure. When used with a PAM_BINARY_PROMPT, the returned
- pam_response.resp pointer points to an object with the following
- structure:
-
- struct {
- u32 length; # network byte order
- unsigned char data[length];
- };
-
- The 'libpam_client' library is designed around this flavor of
- message and should be used to handle this flavor of msg_style.
- */
-
-/* Used to return the user's response to the PAM library. This
- structure is allocated by the application program, and free()'d by
- the Linux-PAM library (or calling module). */
-
-struct pam_response {
- char *resp;
- int resp_retcode; /* currently un-used, zero expected */
-};
-
-/* The actual conversation structure itself */
-
-struct pam_conv {
- int (*conv)(int num_msg, const struct pam_message **msg,
- struct pam_response **resp, void *appdata_ptr);
- void *appdata_ptr;
-};
-
-#ifndef LINUX_PAM
-/*
- * the following few lines represent a hack. They are there to make
- * the Linux-PAM headers more compatible with the Sun ones, which have a
- * less strictly separated notion of module specific and application
- * specific definitions.
- */
-#include <security/pam_appl.h>
-#include <security/pam_modules.h>
-#endif
-
-
-/* ... adapted from the pam_appl.h file created by Theodore Ts'o and
- *
- * Copyright Theodore Ts'o, 1996. All rights reserved.
- * Copyright (c) Andrew G. Morgan <morgan@linux.kernel.org>, 1996-8
- *
- * 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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * 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. */
-
-#endif /* _SECURITY__PAM_TYPES_H */
-
diff --git a/contrib/libpam/libpam/include/security/pam_appl.h b/contrib/libpam/libpam/include/security/pam_appl.h
deleted file mode 100644
index d9c5eddd145b..000000000000
--- a/contrib/libpam/libpam/include/security/pam_appl.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * <security/pam_appl.h>
- *
- * This header file collects definitions for the PAM API --- that is,
- * public interface between the PAM library and an application program
- * that wishes to use it.
- *
- * Note, the copyright information is at end of file.
- *
- * Created: 15-Jan-96 by TYT
- * Last modified: 1996/3/5 by AGM
- *
- * $Log: pam_appl.h,v $
- * Revision 1.5 1996/11/10 19:56:11 morgan
- * minor prototype change
- *
- * Revision 1.4 1996/03/16 22:38:17 morgan
- * made all of the pam_start input arguments constant
- *
- * Revision 1.3 1996/03/16 20:22:59 morgan
- * changed name comment at top of file.
- *
- * Revision 1.2 1996/03/09 20:39:06 morgan
- * added RCS information
- *
- *
- * $Id: pam_appl.h,v 1.5 1996/11/10 19:56:11 morgan Exp $
- *
- */
-
-#ifndef _SECURITY_PAM_APPL_H
-#define _SECURITY_PAM_APPL_H
-
-#include <security/_pam_types.h> /* Linux-PAM common defined types */
-
-/* -------------- The Linux-PAM Framework layer API ------------- */
-
-extern int pam_start(const char *service_name, const char *user,
- const struct pam_conv *pam_conversation,
- pam_handle_t **pamh);
-extern int pam_end(pam_handle_t *pamh, int pam_status);
-
-/* Authentication API's */
-
-extern int pam_authenticate(pam_handle_t *pamh, int flags);
-extern int pam_setcred(pam_handle_t *pamh, int flags);
-
-/* Account Management API's */
-
-extern int pam_acct_mgmt(pam_handle_t *pamh, int flags);
-
-/* Session Management API's */
-
-extern int pam_open_session(pam_handle_t *pamh, int flags);
-extern int pam_close_session(pam_handle_t *pamh, int flags);
-
-/* Password Management API's */
-
-extern int pam_chauthtok(pam_handle_t *pamh, int flags);
-
-/* take care of any compatibility issues */
-#include <security/_pam_compat.h>
-
-/*
- * Copyright Theodore Ts'o, 1996. 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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * 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.
- */
-
-#endif /* _SECURITY_PAM_APPL_H */
diff --git a/contrib/libpam/libpam/include/security/pam_malloc.h b/contrib/libpam/libpam/include/security/pam_malloc.h
deleted file mode 100644
index b5865cd305ad..000000000000
--- a/contrib/libpam/libpam/include/security/pam_malloc.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $Id: pam_malloc.h,v 1.1 1996/11/10 21:23:14 morgan Exp $
- *
- * $Log: pam_malloc.h,v $
- * Revision 1.1 1996/11/10 21:23:14 morgan
- * Initial revision
- *
- */
-
-/*
- * This file (via the use of macros) defines a wrapper for the malloc
- * family of calls. It logs where the memory was requested and also
- * where it was free()'d and keeps a list of currently requested memory.
- *
- * It is hoped that it will provide some help in locating memory leaks.
- */
-
-#ifndef PAM_MALLOC_H
-#define PAM_MALLOC_H
-
-/* these are the macro definitions for the stdlib.h memory functions */
-
-#define malloc(s) pam_malloc(s,__FILE__,__FUNCTION__,__LINE__)
-#define calloc(n,s) pam_calloc(n,s,__FILE__,__FUNCTION__,__LINE__)
-#define free(x) pam_free(x,__FILE__,__FUNCTION__,__LINE__)
-/* #define memalign(a,s) pam_memalign(a,s,__FILE__,__FUNCTION__,__LINE__) */
-#define realloc(x,s) pam_realloc(x,s,__FILE__,__FUNCTION__,__LINE__)
-/* #define valloc(s) pam_valloc(s,__FILE__,__FUNCTION__,__LINE__) */
-/* #define alloca(s) pam_alloca(s,__FILE__,__FUNCTION__,__LINE__) */
-#define exit(i) pam_exit(i,__FILE__,__FUNCTION__,__LINE__)
-
-/* these are the prototypes for the wrapper functions */
-
-#include <sys/types.h>
-
-extern void *pam_malloc(size_t s,const char *,const char *,const int);
-extern void *pam_calloc(size_t n,size_t s,const char *,const char *,const int);
-extern void pam_free(void *x,const char *,const char *,const int);
-extern void *pam_memalign(size_t a,size_t s
- ,const char *,const char *,const int);
-extern void *pam_realloc(void *x,size_t s,const char *,const char *,const int);
-extern void *pam_valloc(size_t s,const char *,const char *,const int);
-extern void *pam_alloca(size_t s,const char *,const char *,const int);
-extern void pam_exit(int i,const char *,const char *,const int);
-
-/* these are the flags used to turn on and off diagnostics */
-
-#define PAM_MALLOC_LEAKED 01
-#define PAM_MALLOC_REQUEST 02
-#define PAM_MALLOC_FREE 04
-#define PAM_MALLOC_EXCH (PAM_MALLOC_FREED|PAM_MALLOC_EXCH)
-#define PAM_MALLOC_RESIZE 010
-#define PAM_MALLOC_FAIL 020
-#define PAM_MALLOC_NULL 040
-#define PAM_MALLOC_VERIFY 0100
-#define PAM_MALLOC_FUNC 0200
-#define PAM_MALLOC_PAUSE 0400
-#define PAM_MALLOC_STOP 01000
-
-#define PAM_MALLOC_ALL 0777
-
-#define PAM_MALLOC_DEFAULT \
- (PAM_MALLOC_LEAKED|PAM_MALLOC_PAUSE|PAM_MALLOC_FAIL)
-
-#include <stdio.h>
-
-extern FILE *pam_malloc_outfile; /* defaults to stdout */
-
-/* how much output do you want? */
-
-extern int pam_malloc_flags;
-extern int pam_malloc_delay_length; /* how long to pause on errors */
-
-#endif /* PAM_MALLOC_H */
diff --git a/contrib/libpam/libpam/include/security/pam_modules.h b/contrib/libpam/libpam/include/security/pam_modules.h
deleted file mode 100644
index 080bcfcdb1bd..000000000000
--- a/contrib/libpam/libpam/include/security/pam_modules.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * <security/pam_modules.h>
- *
- * $Id: pam_modules.h,v 1.8 1997/01/04 20:14:42 morgan Exp morgan $
- *
- * This header file documents the PAM SPI --- that is, interface
- * between the PAM library and a PAM service library which is called
- * by the PAM library.
- *
- * Note, the copyright information is at end of file.
- *
- * $Log: pam_modules.h,v $
- * Revision 1.8 1997/01/04 20:14:42 morgan
- * moved PAM_DATA_SILENT to _pam_types.h so applications can use it too
- *
- * Revision 1.7 1996/11/10 19:57:08 morgan
- * pam_get_user prototype.
- *
- * Revision 1.6 1996/09/05 06:18:45 morgan
- * added some data error_status masks, changed prototype for cleanup()
- *
- * Revision 1.5 1996/06/02 07:58:37 morgan
- * altered the way in which modules obtain static prototypes for
- * functions
- *
- */
-
-#ifndef _SECURITY_PAM_MODULES_H
-#define _SECURITY_PAM_MODULES_H
-
-/*
- * Define either PAM_STATIC or PAM_DYNAMIC, based on whether PIC
- * compilation is being used.
- */
-#if !defined(PIC) && !defined(PAM_STATIC)
-#define PAM_STATIC
-#endif
-#ifndef PAM_STATIC
-#define PAM_DYNAMIC
-#endif
-
-#ifdef PAM_STATIC
-#include <linker_set.h>
-#endif
-
-#include <security/_pam_types.h> /* Linux-PAM common defined types */
-
-/* these defines are used by pam_set_item() and pam_get_item() and are
- * in addition to those found in <security/_pam_types.h> */
-
-#define PAM_AUTHTOK 6 /* The authentication token (password) */
-#define PAM_OLDAUTHTOK 7 /* The old authentication token */
-
-/* -------------- The Linux-PAM Module PI ------------- */
-
-extern int pam_set_data(pam_handle_t *pamh, const char *module_data_name,
- void *data,
- void (*cleanup)(pam_handle_t *pamh, void *data,
- int error_status));
-extern int pam_get_data(const pam_handle_t *pamh,
- const char *module_data_name, const void **data);
-
-extern int pam_get_user(pam_handle_t *pamh, const char **user
- , const char *prompt);
-
-#ifdef PAM_STATIC
-
-#define PAM_EXTERN static
-
-struct pam_module {
- const char *name; /* Name of the module */
-
- /* These are function pointers to the module's key functions. */
-
- int (*pam_sm_authenticate)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
- int (*pam_sm_setcred)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
- int (*pam_sm_acct_mgmt)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
- int (*pam_sm_open_session)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
- int (*pam_sm_close_session)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
- int (*pam_sm_chauthtok)(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-};
-
-#ifdef PAM_SM_AUTH
-#define PAM_SM_AUTH_ENTRY pam_sm_authenticate
-#define PAM_SM_SETCRED_ENTRY pam_sm_setcred
-#else
-#define PAM_SM_AUTH_ENTRY NULL
-#define PAM_SM_SETCRED_ENTRY NULL
-#endif
-
-#ifdef PAM_SM_ACCOUNT
-#define PAM_SM_ACCOUNT_ENTRY pam_sm_acct_mgmt
-#else
-#define PAM_SM_ACCOUNT_ENTRY NULL
-#endif
-
-#ifdef PAM_SM_SESSION
-#define PAM_SM_OPEN_SESSION_ENTRY pam_sm_open_session
-#define PAM_SM_CLOSE_SESSION_ENTRY pam_sm_close_session
-#else
-#define PAM_SM_OPEN_SESSION_ENTRY NULL
-#define PAM_SM_CLOSE_SESSION_ENTRY NULL
-#endif
-
-#ifdef PAM_SM_PASSWORD
-#define PAM_SM_PASSWORD_ENTRY pam_sm_chauthtok
-#else
-#define PAM_SM_PASSWORD_ENTRY NULL
-#endif
-
-#define PAM_MODULE_ENTRY(name) \
- static struct pam_module _pam_modstruct = { \
- name, \
- PAM_SM_AUTH_ENTRY, \
- PAM_SM_SETCRED_ENTRY, \
- PAM_SM_ACCOUNT_ENTRY, \
- PAM_SM_OPEN_SESSION_ENTRY, \
- PAM_SM_CLOSE_SESSION_ENTRY, \
- PAM_SM_PASSWORD_ENTRY \
- }; \
- DATA_SET(_pam_static_modules, _pam_modstruct)
-
-#else /* !PAM_STATIC */
-
-#define PAM_EXTERN extern
-#define PAM_MODULE_ENTRY(name)
-
-#endif /* PAM_STATIC */
-
-/* Lots of files include pam_modules.h that don't need these
- * declared. However, when they are declared static, they
- * need to be defined later. So we have to protect C files
- * that include these without wanting these functions defined.. */
-
-#if (defined(PAM_STATIC) && defined(PAM_SM_AUTH)) || !defined(PAM_STATIC)
-
-/* Authentication API's */
-PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-
-#endif /*(defined(PAM_STATIC) && defined(PAM_SM_AUTH))
- || !defined(PAM_STATIC)*/
-
-#if (defined(PAM_STATIC) && defined(PAM_SM_ACCOUNT)) || !defined(PAM_STATIC)
-
-/* Account Management API's */
-PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-
-#endif /*(defined(PAM_STATIC) && defined(PAM_SM_ACCOUNT))
- || !defined(PAM_STATIC)*/
-
-#if (defined(PAM_STATIC) && defined(PAM_SM_SESSION)) || !defined(PAM_STATIC)
-
-/* Session Management API's */
-PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-
-PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-
-#endif /*(defined(PAM_STATIC) && defined(PAM_SM_SESSION))
- || !defined(PAM_STATIC)*/
-
-#if (defined(PAM_STATIC) && defined(PAM_SM_PASSWORD)) || !defined(PAM_STATIC)
-
-/* Password Management API's */
-PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
- int argc, const char **argv);
-
-#endif /*(defined(PAM_STATIC) && defined(PAM_SM_PASSWORD))
- || !defined(PAM_STATIC)*/
-
-/* The following two flags are for use across the Linux-PAM/module
- * interface only. The Application is not permitted to use these
- * tokens.
- *
- * The password service should only perform preliminary checks. No
- * passwords should be updated. */
-#define PAM_PRELIM_CHECK 0x4000
-
-/* The password service should update passwords Note: PAM_PRELIM_CHECK
- * and PAM_UPDATE_AUTHTOK can not both be set simultaneously! */
-#define PAM_UPDATE_AUTHTOK 0x2000
-
-
-/*
- * here are some proposed error status definitions for the
- * 'error_status' argument used by the cleanup function associated
- * with data items they should be logically OR'd with the error_status
- * of the latest return from libpam -- new with .52 and positive
- * impression from Sun although not official as of 1996/9/4 there are
- * others in _pam_types.h -- they are for common module/app use.
- */
-
-#define PAM_DATA_REPLACE 0x20000000 /* used when replacing a data item */
-
-/* take care of any compatibility issues */
-#include <security/_pam_compat.h>
-
-/* Copyright (C) Theodore Ts'o, 1996.
- * Copyright (C) Andrew Morgan, 1996-8.
- * 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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU General Public License, in which case the provisions of the
- * GNU GPL are required INSTEAD OF the above restrictions. (This
- * clause is necessary due to a potential bad interaction between the
- * GNU GPL and the restrictions contained in a BSD-style copyright.)
- *
- * 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. */
-
-#endif /* _SECURITY_PAM_MODULES_H */
-
diff --git a/contrib/libpam/libpam/pam_account.c b/contrib/libpam/libpam/pam_account.c
deleted file mode 100644
index ffc01acd2a1b..000000000000
--- a/contrib/libpam/libpam/pam_account.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* pam_account.c - PAM Account Management */
-
-#include <stdio.h>
-
-#include "pam_private.h"
-
-int pam_acct_mgmt(pam_handle_t *pamh, int flags)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_acct_mgmt",pamh,PAM_SYSTEM_ERR);
- return _pam_dispatch(pamh, flags, PAM_ACCOUNT);
-}
diff --git a/contrib/libpam/libpam/pam_auth.c b/contrib/libpam/libpam/pam_auth.c
deleted file mode 100644
index ac461f5ba863..000000000000
--- a/contrib/libpam/libpam/pam_auth.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * pam_auth.c -- PAM authentication
- *
- * $Id: pam_auth.c,v 1.7 1997/04/05 06:53:52 morgan Exp morgan $
- *
- * $Log: pam_auth.c,v $
- * Revision 1.7 1997/04/05 06:53:52 morgan
- * fail-delay changes
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pam_private.h"
-
-int pam_authenticate(pam_handle_t *pamh, int flags)
-{
- int retval;
-
- D(("pam_authenticate called"));
-
- if (pamh->former.choice == PAM_NOT_STACKED) {
- _pam_sanitize(pamh);
- _pam_start_timer(pamh); /* we try to make the time for a failure
- independent of the time it takes to
- fail */
- }
-
- IF_NO_PAMH("pam_authenticate",pamh,PAM_SYSTEM_ERR);
- retval = _pam_dispatch(pamh, flags, PAM_AUTHENTICATE);
-
- if (retval != PAM_INCOMPLETE) {
- _pam_sanitize(pamh);
- _pam_await_timer(pamh, retval); /* if unsuccessful then wait now */
- D(("pam_authenticate exit"));
- } else {
- D(("will resume when ready"));
- }
-
- return retval;
-}
-
-int pam_setcred(pam_handle_t *pamh, int flags)
-{
- int retval;
-
- IF_NO_PAMH("pam_setcred", pamh, PAM_SYSTEM_ERR);
-
- D(("pam_setcred called"));
-
- if (! flags) {
- flags = PAM_ESTABLISH_CRED;
- }
-
- retval = _pam_dispatch(pamh, flags, PAM_SETCRED);
-
- D(("pam_setcred exit"));
-
- return retval;
-}
diff --git a/contrib/libpam/libpam/pam_data.c b/contrib/libpam/libpam/pam_data.c
deleted file mode 100644
index 397fb9d820d1..000000000000
--- a/contrib/libpam/libpam/pam_data.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* pam_data.c */
-
-/*
- * $Id: pam_data.c,v 1.5 1996/12/01 03:14:13 morgan Exp $
- *
- * $Log: pam_data.c,v $
- * Revision 1.5 1996/12/01 03:14:13 morgan
- * use _pam_macros.h
- *
- * Revision 1.4 1996/11/10 19:59:56 morgan
- * internalized strdup for malloc debugging
- *
- * Revision 1.3 1996/09/05 06:10:31 morgan
- * changed type of cleanup(), added PAM_DATA_REPLACE to replacement
- * cleanup() call.
- *
- * Revision 1.2 1996/03/16 21:33:05 morgan
- * removed const from cleanup argument, also deleted comment about SUN stuff
- *
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "pam_private.h"
-
-struct pam_data *_pam_locate_data(const pam_handle_t *pamh, const char *name);
-
-int pam_set_data(
- pam_handle_t *pamh,
- const char *module_data_name,
- void *data,
- void (*cleanup)(pam_handle_t *pamh, void *data, int error_status))
-{
- struct pam_data *data_entry;
-
- IF_NO_PAMH("pam_set_data",pamh,PAM_SYSTEM_ERR);
-
- /* first check if there is some data already. If so clean it up */
-
- if ((data_entry = _pam_locate_data(pamh, module_data_name))) {
- if (data_entry->cleanup) {
- data_entry->cleanup(pamh, data_entry->data
- , PAM_DATA_REPLACE | PAM_SUCCESS );
- }
- } else if ((data_entry = malloc(sizeof(*data_entry)))) {
- char *tname;
-
- if ((tname = _pam_strdup(module_data_name)) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "pam_set_data: no memory for data name");
- _pam_drop(data_entry);
- return PAM_BUF_ERR;
- }
- data_entry->next = pamh->data;
- pamh->data = data_entry;
- data_entry->name = tname;
- } else {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "pam_set_data: cannot allocate data entry");
- return PAM_BUF_ERR;
- }
-
- data_entry->data = data; /* note this could be NULL */
- data_entry->cleanup = cleanup;
-
- return PAM_SUCCESS;
-}
-
-int pam_get_data(
- const pam_handle_t *pamh,
- const char *module_data_name,
- const void **datap)
-{
- struct pam_data *data;
-
- IF_NO_PAMH("pam_get_data",pamh,PAM_SYSTEM_ERR);
-
- data = _pam_locate_data(pamh, module_data_name);
- if (data) {
- *datap = data->data;
- return PAM_SUCCESS;
- }
-
- return PAM_NO_MODULE_DATA;
-}
-
-struct pam_data *_pam_locate_data(const pam_handle_t *pamh, const char *name)
-{
- struct pam_data *data;
-
- IF_NO_PAMH("_pam_locate_data",pamh,NULL);
- data = pamh->data;
-
- while (data) {
- if (!strcmp(data->name, name)) {
- return data;
- }
- data = data->next;
- }
-
- return NULL;
-}
-
-void _pam_free_data(pam_handle_t *pamh, int status)
-{
- struct pam_data *last;
- struct pam_data *data;
-
- IF_NO_PAMH("_pam_free_data",pamh,/* no return value for void fn */);
- data = pamh->data;
-
- while (data) {
- last = data;
- data = data->next;
- if (last->cleanup) {
- last->cleanup(pamh, last->data, status);
- }
- _pam_drop(last->name);
- _pam_drop(last);
- }
-}
diff --git a/contrib/libpam/libpam/pam_delay.c b/contrib/libpam/libpam/pam_delay.c
deleted file mode 100644
index e6950e2a966b..000000000000
--- a/contrib/libpam/libpam/pam_delay.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * pam_delay.c
- *
- * Copyright (c) Andrew G. Morgan <morgan@linux.kernel.org> 1996-8
- * All rights reserved.
- *
- * $Id: pam_delay.c,v 1.5 1997/04/05 06:54:19 morgan Exp $
- *
- * $Log: pam_delay.c,v $
- */
-
-/*
- * This is a simple implementation of a delay on failure mechanism; an
- * attempt to overcome authentication-time attacks in a simple manner.
- */
-
-#include <unistd.h>
-#include "pam_private.h"
-
-/* **********************************************************************
- * initialize the time as unset, this is set on the return from the
- * authenticating pair of of the libpam pam_XXX calls.
- */
-
-void _pam_reset_timer(pam_handle_t *pamh)
-{
- D(("setting pamh->fail_delay.set to FALSE"));
- pamh->fail_delay.set = PAM_FALSE;
-}
-
-/* **********************************************************************
- * this function sets the start time for possible delayed failing.
- *
- * Eventually, it may set the timer so libpam knows how long the program
- * has already been executing. Currently, this value is used to seed
- * a pseudo-random number generator...
- */
-
-void _pam_start_timer(pam_handle_t *pamh)
-{
- pamh->fail_delay.begin = time(NULL);
- D(("starting timer..."));
-}
-
-/* *******************************************************************
- * Compute a pseudo random time. The value is base*(1 +/- 1/5) where
- * the distribution is pseudo gausian (the sum of three evenly
- * distributed random numbers -- central limit theorem and all ;^) The
- * linear random numbers are based on a formulae given in Knuth's
- * Seminumerical recipies that was reproduced in `Numerical Recipies
- * in C'. It is *not* a cryptographically strong generator, but it is
- * probably "good enough" for our purposes here.
- *
- * /dev/random might be a better place to look for some numbers...
- */
-
-static unsigned int _pam_rand(unsigned int seed)
-{
-#define N1 1664525
-#define N2 1013904223
- return N1*seed + N2;
-}
-
-static unsigned int _pam_compute_delay(unsigned int seed, unsigned int base)
-{
- int i;
- double sum;
- unsigned int ans;
-
- for (sum=i=0; i<3; ++i) {
- seed = _pam_rand(seed);
- sum += (double) ((seed / 10) % 1000000);
- }
- sum = (sum/3.)/1e6 - .5; /* rescale */
- ans = (unsigned int) ( base*(1.+sum) );
- D(("random number: base=%u -> ans=%u\n", base, ans));
-
- return ans;
-}
-
-/* **********************************************************************
- * the following function sleeps for a random time. The actual time
- * slept is computed above.. It is based on the requested time but will
- * differ by up to +/- 25%.
- */
-
-void _pam_await_timer(pam_handle_t *pamh, int status)
-{
- unsigned int delay;
- D(("waiting?..."));
-
- delay = _pam_compute_delay(pamh->fail_delay.begin,
- pamh->fail_delay.delay);
- if (pamh->fail_delay.delay_fn_ptr) {
- union {
- const void *value;
- void (*fn)(int, unsigned);
- } hack_fn_u;
-
- /* always call the applications delay function, even if
- the delay is zero - indicate status */
- hack_fn_u.value = pamh->fail_delay.delay_fn_ptr;
- hack_fn_u.fn(status, delay);
-
- } else if (status != PAM_SUCCESS && pamh->fail_delay.set) {
-
- D(("will wait %u usec", delay));
-
- if (delay > 0) {
- struct timeval tval;
-
- tval.tv_sec = delay / 1000000;
- tval.tv_usec = delay % 1000000;
- select(0, NULL, NULL, NULL, &tval);
- }
- }
-
- _pam_reset_timer(pamh);
- D(("waiting done"));
-}
-
-/* **********************************************************************
- * this function is known to both the module and the application, it
- * keeps a running score of the largest-requested delay so far, as
- * specified by either modules or an application.
- */
-
-int pam_fail_delay(pam_handle_t *pamh, unsigned int usec)
-{
- int largest;
-
- IF_NO_PAMH("pam_fail_delay", pamh, PAM_SYSTEM_ERR);
-
- D(("setting delay to %u",usec));
-
- if (pamh->fail_delay.set) {
- largest = pamh->fail_delay.delay;
- } else {
- pamh->fail_delay.set = PAM_TRUE;
- largest = 0;
- }
-
- D(("largest = %u",largest));
-
- if (largest < usec) {
- D(("resetting largest delay"));
- pamh->fail_delay.delay = usec;
- }
-
- return PAM_SUCCESS;
-}
-
diff --git a/contrib/libpam/libpam/pam_dispatch.c b/contrib/libpam/libpam/pam_dispatch.c
deleted file mode 100644
index d0bbc3872103..000000000000
--- a/contrib/libpam/libpam/pam_dispatch.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* pam_dispatch.c - handles module function dispatch */
-
-/*
- * $Id: pam_dispatch.c,v 1.8 1997/01/04 20:04:09 morgan Exp morgan $
- *
- * last modified by AGM
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "pam_private.h"
-
-/*
- * this is the return code we return when a function pointer is NULL
- * or, the handler structure indicates a broken module config line
- */
-#define PAM_MUST_FAIL_CODE PAM_PERM_DENIED
-
-/* impression codes - this gives some sense to the logical choices */
-#define _PAM_UNDEF 0
-#define _PAM_POSITIVE +1
-#define _PAM_NEGATIVE -1
-
-/*
- * walk a stack of modules. Interpret the administrator's instructions
- * when combining the return code of each module.
- */
-
-static int _pam_dispatch_aux(pam_handle_t *pamh, int flags, struct handler *h,
- _pam_boolean resumed)
-{
- int depth, impression, status, skip_depth;
-
- IF_NO_PAMH("_pam_dispatch_aux", pamh, PAM_SYSTEM_ERR);
-
- if (h == NULL) {
- const char *service=NULL;
-
- (void) pam_get_item(pamh, PAM_SERVICE, (const void **)&service);
- pam_system_log(pamh, NULL, LOG_ERR,
- "no modules loaded for `%s' service",
- service ? service:"<unknown>" );
- service = NULL;
- return PAM_MUST_FAIL_CODE;
- }
-
- /* if we are recalling this module stack because a former call did
- not complete, we restore the state of play from pamh. */
- if (resumed) {
- skip_depth = pamh->former.depth;
- status = pamh->former.status;
- impression = pamh->former.impression;
- /* forget all that */
- pamh->former.impression = _PAM_UNDEF;
- pamh->former.status = PAM_MUST_FAIL_CODE;
- pamh->former.depth = 0;
- } else {
- skip_depth = 0;
- impression = _PAM_UNDEF;
- status = PAM_MUST_FAIL_CODE;
- }
-
- /* Loop through module logic stack */
- for (depth=0 ; h != NULL ; h = h->next, ++depth) {
- int retval, action;
-
- /* skip leading modules if they have already returned */
- if (depth < skip_depth) {
- continue;
- }
-
- /* attempt to call the module */
- if (h->func == NULL) {
- D(("module function is not defined, indicating failure"));
- retval = PAM_MODULE_UNKNOWN;
- } else {
- D(("passing control to module..."));
- retval = h->func(pamh, flags, h->argc, h->argv);
- D(("module returned: %s", pam_strerror(pamh, retval)));
- if (h->must_fail) {
- D(("module poorly listed in pam.conf; forcing failure"));
- retval = PAM_MUST_FAIL_CODE;
- }
- }
-
- /*
- * PAM_INCOMPLETE return is special. It indicates that the
- * module wants to wait for the application before continuing.
- * In order to return this, the module will have saved its
- * state so it can resume from an equivalent position when it
- * is called next time. (This was added as of 0.65)
- */
- if (retval == PAM_INCOMPLETE) {
- pamh->former.impression = impression;
- pamh->former.status = status;
- pamh->former.depth = depth;
-
- D(("module %d returned PAM_INCOMPLETE", depth));
- return retval;
- }
-
- /* verify that the return value is a valid one */
- if (retval < PAM_SUCCESS || retval >= _PAM_RETURN_VALUES) {
- retval = PAM_MUST_FAIL_CODE;
- action = _PAM_ACTION_BAD;
- } else {
- action = h->actions[retval];
- }
-
- /* decide what to do */
- switch (action) {
- case _PAM_ACTION_RESET:
- impression = _PAM_UNDEF;
- status = PAM_MUST_FAIL_CODE;
- break;
-
- case _PAM_ACTION_OK:
- case _PAM_ACTION_DONE:
- if ( impression == _PAM_UNDEF
- || (impression == _PAM_POSITIVE && status == PAM_SUCCESS) ) {
- impression = _PAM_POSITIVE;
- status = retval;
- }
- if ( impression == _PAM_POSITIVE && action == _PAM_ACTION_DONE ) {
- goto decision_made;
- }
- break;
-
- case _PAM_ACTION_BAD:
- case _PAM_ACTION_DIE:
-#ifdef PAM_FAIL_NOW_ON
- if ( retval == PAM_ABORT ) {
- impression = _PAM_NEGATIVE;
- status = PAM_PERM_DENIED;
- goto decision_made;
- }
-#endif /* PAM_FAIL_NOW_ON */
- if ( impression != _PAM_NEGATIVE ) {
- impression = _PAM_NEGATIVE;
- status = retval;
- }
- if ( action == _PAM_ACTION_DIE ) {
- goto decision_made;
- }
- break;
-
- case _PAM_ACTION_IGNORE:
- break;
-
- /* if we get here, we expect action is a positive number --
- this is what the ...JUMP macro checks. */
-
- default:
- if ( _PAM_ACTION_IS_JUMP(action) ) {
- /* this means that we need to skip #action stacked modules */
- do {
- h = h->next;
- } while ( --action > 0 && h != NULL );
-
- /* note if we try to skip too many modules action is
- still non-zero and we snag the next if. */
- }
-
- /* this case is a syntax error: we can't succeed */
- if (action) {
- D(("action syntax error"));
- impression = _PAM_NEGATIVE;
- status = PAM_MUST_FAIL_CODE;
- }
- }
- }
-
-decision_made: /* by getting here we have made a decision */
-
- /* Sanity check */
- if ( status == PAM_SUCCESS && impression != _PAM_POSITIVE ) {
- D(("caught on sanity check -- this is probably a config error!"));
- status = PAM_MUST_FAIL_CODE;
- }
-
- /* We have made a decision about the modules executed */
- return status;
-}
-
-/*
- * This function translates the module dispatch request into a pointer
- * to the stack of modules that will actually be run. the
- * _pam_dispatch_aux() function (above) is responsible for walking the
- * module stack.
- */
-
-int _pam_dispatch(pam_handle_t *pamh, int flags, int choice)
-{
- struct handler *h = NULL;
- int retval;
- _pam_boolean resumed;
-
- IF_NO_PAMH("_pam_dispatch",pamh,PAM_SYSTEM_ERR);
-
- /* Load all modules, resolve all symbols */
-
- if ((retval = _pam_init_handlers(pamh)) != PAM_SUCCESS) {
- pam_system_log(pamh, NULL, LOG_ERR, "unable to dispatch function");
- return retval;
- }
-
- switch (choice) {
- case PAM_AUTHENTICATE:
- h = pamh->handlers.conf.authenticate;
- break;
- case PAM_SETCRED:
- h = pamh->handlers.conf.setcred;
- break;
- case PAM_ACCOUNT:
- h = pamh->handlers.conf.acct_mgmt;
- break;
- case PAM_OPEN_SESSION:
- h = pamh->handlers.conf.open_session;
- break;
- case PAM_CLOSE_SESSION:
- h = pamh->handlers.conf.close_session;
- break;
- case PAM_CHAUTHTOK:
- h = pamh->handlers.conf.chauthtok;
- break;
- default:
- pam_system_log(pamh, NULL, LOG_ERR, "undefined fn choice; %d", choice);
- return PAM_ABORT;
- }
-
- if (h == NULL) { /* there was no handlers.conf... entry; will use
- * handlers.other... */
- switch (choice) {
- case PAM_AUTHENTICATE:
- h = pamh->handlers.other.authenticate;
- break;
- case PAM_SETCRED:
- h = pamh->handlers.other.setcred;
- break;
- case PAM_ACCOUNT:
- h = pamh->handlers.other.acct_mgmt;
- break;
- case PAM_OPEN_SESSION:
- h = pamh->handlers.other.open_session;
- break;
- case PAM_CLOSE_SESSION:
- h = pamh->handlers.other.close_session;
- break;
- case PAM_CHAUTHTOK:
- h = pamh->handlers.other.chauthtok;
- break;
- }
- }
-
- /* Did a module return an "incomplete state" last time? */
- if (pamh->former.choice != PAM_NOT_STACKED) {
- if (pamh->former.choice != choice) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "application failed to re-exec stack [%d:%d]",
- pamh->former.choice, choice);
- return PAM_ABORT;
- }
- resumed = PAM_TRUE;
- } else {
- resumed = PAM_FALSE;
- }
-
- /* call the list of module functions */
- retval = _pam_dispatch_aux(pamh, flags, h, resumed);
- resumed = PAM_FALSE;
-
- /* Should we recall where to resume next time? */
- if (retval == PAM_INCOMPLETE) {
- D(("module [%d] returned PAM_INCOMPLETE"));
- pamh->former.choice = choice;
- } else {
- pamh->former.choice = PAM_NOT_STACKED;
- }
-
- return retval;
-}
-
-/*
- * $Log: pam_dispatch.c,v $
- */
diff --git a/contrib/libpam/libpam/pam_end.c b/contrib/libpam/libpam/pam_end.c
deleted file mode 100644
index 34f98f579779..000000000000
--- a/contrib/libpam/libpam/pam_end.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* pam_end.c */
-
-/*
- * $Id: pam_end.c,v 1.5 1996/12/01 03:14:13 morgan Exp $
- *
- * $Log: pam_end.c,v $
- */
-
-#include <stdlib.h>
-
-#include "pam_private.h"
-
-int pam_end(pam_handle_t *pamh, int pam_status)
-{
- int ret;
-
- IF_NO_PAMH("pam_end", pamh, PAM_SYSTEM_ERR);
-
- D(("entering pam_end()"));
-
- /* first liberate the modules (it is not inconcevible that the
- modules may need to use the service_name etc. to clean up) */
-
- _pam_free_data(pamh, pam_status);
-
- /* now drop all modules */
-
- if ((ret = _pam_free_handlers(pamh)) != PAM_SUCCESS) {
- return ret; /* error occurred */
- }
-
- /* from this point we cannot call the modules any more. Free the remaining
- memory used by the Linux-PAM interface */
-
- _pam_drop_env(pamh); /* purge the environment */
-
- _pam_overwrite(pamh->authtok); /* blank out old token */
- _pam_drop(pamh->authtok);
-
- _pam_overwrite(pamh->oldauthtok); /* blank out old token */
- _pam_drop(pamh->oldauthtok);
-
- _pam_overwrite(pamh->former.prompt);
- _pam_drop(pamh->former.prompt); /* drop saved prompt */
-
- _pam_overwrite(pamh->service_name);
- _pam_drop(pamh->service_name);
-
- _pam_overwrite(pamh->user);
- _pam_drop(pamh->user);
-
- _pam_overwrite(pamh->prompt);
- _pam_drop(pamh->prompt); /* prompt for pam_get_user() */
-
- _pam_overwrite(pamh->tty);
- _pam_drop(pamh->tty);
-
- _pam_overwrite(pamh->rhost);
- _pam_drop(pamh->rhost);
-
- _pam_overwrite(pamh->ruser);
- _pam_drop(pamh->ruser);
-
- _pam_drop(pamh->pam_conversation);
- pamh->fail_delay.delay_fn_ptr = NULL;
-
- _pam_overwrite(pamh->pam_default_log.ident);
- _pam_drop(pamh->pam_default_log.ident);
-
- /* and finally liberate the memory for the pam_handle structure */
-
- _pam_drop(pamh);
-
- D(("exiting pam_end() successfully"));
-
- return PAM_SUCCESS;
-}
diff --git a/contrib/libpam/libpam/pam_env.c b/contrib/libpam/libpam/pam_env.c
deleted file mode 100644
index 2632b81342a2..000000000000
--- a/contrib/libpam/libpam/pam_env.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * pam_env.c
- *
- * Copyright (c) Andrew G. Morgan <morgan@parc.power.net> 1996,1997
- * All rights reserved.
- *
- * This file was written from a "hint" provided by the people at SUN.
- * and the X/Open XSSO draft of March 1997.
- *
- * $Id: pam_env.c,v 1.2 1997/02/15 15:56:48 morgan Exp morgan $
- *
- * $Log: pam_env.c,v $
- * Revision 1.2 1997/02/15 15:56:48 morgan
- * liberate pamh->env structure too!
- *
- * Revision 1.1 1996/12/01 03:14:13 morgan
- * Initial revision
- */
-
-#include <string.h>
-#include <stdlib.h>
-#ifdef sunos
-#define memmove(x,y,z) bcopy(y,x,z)
-#endif
-
-#include "pam_private.h"
-
-/* helper functions */
-
-#ifdef DEBUG
-static void _pam_dump_env(pam_handle_t *pamh)
-{
- int i;
-
- D(("Listing environment of pamh=%p", pamh));
- D(("pamh->env = %p", pamh->env));
- D(("environment entries used = %d [of %d allocated]"
- , pamh->env->requested, pamh->env->entries));
-
- for (i=0; i<pamh->env->requested; ++i) {
- _pam_output_debug(">%-3d [%9p]:[%s]"
- , i, pamh->env->list[i], pamh->env->list[i]);
- }
- _pam_output_debug("*NOTE* the last item should be (nil)");
-}
-#else
-#define _pam_dump_env(x)
-#endif
-
-/*
- * Create the environment
- */
-
-int _pam_make_env(pam_handle_t *pamh)
-{
- D(("called."));
- IF_NO_PAMH("_pam_make_env", pamh, PAM_ABORT);
-
- /*
- * get structure memory
- */
-
- pamh->env = (struct pam_environ *) malloc(sizeof(struct pam_environ));
- if (pamh->env == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT, "_pam_make_env: out of memory");
- return PAM_BUF_ERR;
- }
-
- /*
- * get list memory
- */
-
- pamh->env->list = (char **)calloc( PAM_ENV_CHUNK, sizeof(char *) );
- if (pamh->env->list == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "_pam_make_env: no memory for list");
- _pam_drop(pamh->env);
- return PAM_BUF_ERR;
- }
-
- /*
- * fill entries in pamh->env
- */
-
- pamh->env->entries = PAM_ENV_CHUNK;
- pamh->env->requested = 1;
- pamh->env->list[0] = NULL;
-
- _pam_dump_env(pamh); /* only active when debugging */
-
- return PAM_SUCCESS;
-}
-
-/*
- * purge the environment
- */
-
-void _pam_drop_env(pam_handle_t *pamh)
-{
- D(("called."));
- IF_NO_PAMH("_pam_make_env", pamh, /* nothing to return */);
-
- if (pamh->env != NULL) {
- int i;
- /* we will only purge the pamh->env->requested number of elements */
-
- for (i=pamh->env->requested-1; i-- > 0; ) {
- D(("dropping #%3d>%s<", i, pamh->env->list[i]));
- _pam_overwrite(pamh->env->list[i]); /* clean */
- _pam_drop(pamh->env->list[i]); /* forget */
- }
- pamh->env->requested = 0;
- pamh->env->entries = 0;
- _pam_drop(pamh->env->list); /* forget */
- _pam_drop(pamh->env); /* forget */
- } else {
- D(("no environment present in pamh?"));
- }
-}
-
-/*
- * Return the item number of the given variable = first 'length' chars
- * of 'name_value'. Since this is a static function, it is safe to
- * assume its supplied arguments are well defined.
- */
-
-static int _pam_search_env(const struct pam_environ *env
- , const char *name_value, int length)
-{
- int i;
-
- for (i=env->requested-1; i-- > 0; ) {
- if (strncmp(name_value,env->list[i],length) == 0
- && env->list[i][length] == '=') {
-
- return i; /* Got it! */
-
- }
- }
-
- return -1; /* no luck */
-}
-
-/*
- * externally visible functions
- */
-
-/*
- * pam_putenv(): Add/replace/delete a PAM-environment variable.
- *
- * Add/replace:
- * name_value = "NAME=VALUE" or "NAME=" (for empty value="\0")
- *
- * delete:
- * name_value = "NAME"
- */
-
-int pam_putenv(pam_handle_t *pamh, const char *name_value)
-{
- int l2eq, item, retval;
-
- D(("called."));
- IF_NO_PAMH("pam_putenv", pamh, PAM_ABORT);
-
- if (name_value == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_putenv: no variable indicated");
- return PAM_PERM_DENIED;
- }
-
- /*
- * establish if we are setting or deleting; scan for '='
- */
-
- for (l2eq=0; name_value[l2eq] && name_value[l2eq] != '='; ++l2eq);
- if (l2eq <= 0) {
- pam_system_log(pamh, NULL, LOG_ERR, "pam_putenv: bad variable");
- return PAM_BAD_ITEM;
- }
-
- /*
- * Look first for environment.
- */
-
- if (pamh->env == NULL || pamh->env->list == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR, "pam_putenv: no env%s found"
- , pamh->env == NULL ? "":"-list");
- return PAM_ABORT;
- }
-
- /* find the item to replace */
-
- item = _pam_search_env(pamh->env, name_value, l2eq);
-
- if (name_value[l2eq]) { /* (re)setting */
-
- if (item == -1) { /* new variable */
- D(("adding item: %s", name_value));
- /* enough space? */
- if (pamh->env->entries <= pamh->env->requested) {
- register int i;
- register char **tmp;
-
- /* get some new space */
- tmp = calloc( pamh->env->entries + PAM_ENV_CHUNK
- , sizeof(char *) );
- if (tmp == NULL) {
- /* nothing has changed - old env intact */
- pam_system_log(pamh, NULL, LOG_CRIT,
- "pam_putenv: cannot grow environment");
- return PAM_BUF_ERR;
- }
-
- /* copy old env-item pointers/forget old */
- for (i=0; i<pamh->env->requested; ++i) {
- tmp[i] = pamh->env->list[i];
- pamh->env->list[i] = NULL;
- }
-
- /* drop old list and replace with new */
- _pam_drop(pamh->env->list);
- pamh->env->list = tmp;
- pamh->env->entries += PAM_ENV_CHUNK;
-
- D(("resized env list"));
- _pam_dump_env(pamh); /* only when debugging */
- }
-
- item = pamh->env->requested-1; /* old last item (NULL) */
-
- /* add a new NULL entry at end; increase counter */
- pamh->env->list[pamh->env->requested++] = NULL;
-
- } else { /* replace old */
- D(("replacing item: %s\n with: %s"
- , pamh->env->list[item], name_value));
- _pam_overwrite(pamh->env->list[item]);
- _pam_drop(pamh->env->list[item]);
- }
-
- /*
- * now we have a place to put the new env-item, insert at 'item'
- */
-
- pamh->env->list[item] = _pam_strdup(name_value);
- if (pamh->env->list[item] != NULL) {
- _pam_dump_env(pamh); /* only when debugging */
- return PAM_SUCCESS;
- }
-
- /* something went wrong; we should delete the item - fall through */
-
- retval = PAM_BUF_ERR; /* an error occurred */
- } else {
- retval = PAM_SUCCESS; /* we requested delete */
- }
-
- /* getting to here implies we are deleting an item */
-
- if (item < 0) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_putenv: delete non-existent entry; %s",
- name_value);
- return PAM_BAD_ITEM;
- }
-
- /*
- * remove item: purge memory; reset counter; resize [; display-env]
- */
-
- D(("deleting: env#%3d:[%s]", item, pamh->env->list[item]));
- _pam_overwrite(pamh->env->list[item]);
- _pam_drop(pamh->env->list[item]);
- --(pamh->env->requested);
- D(("mmove: item[%d]+%d -> item[%d]"
- , item+1, ( pamh->env->requested - item ), item));
- (void) memmove(&pamh->env->list[item], &pamh->env->list[item+1]
- , ( pamh->env->requested - item )*sizeof(char *) );
-
- _pam_dump_env(pamh); /* only when debugging */
-
- /*
- * deleted.
- */
-
- return retval;
-}
-
-/*
- * Return the value of the requested environment variable
- */
-
-const char *pam_getenv(pam_handle_t *pamh, const char *name)
-{
- int item;
-
- D(("called."));
- IF_NO_PAMH("pam_getenv", pamh, NULL);
-
- if (name == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_getenv: no variable indicated");
- return NULL;
- }
-
- if (pamh->env == NULL || pamh->env->list == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR, "pam_getenv: no env%s found",
- pamh->env == NULL ? "":"-list" );
- return NULL;
- }
-
- /* find the requested item */
-
- item = _pam_search_env(pamh->env, name, strlen(name));
- if (item != -1) {
-
- D(("env-item: %s, found!", name));
- return (pamh->env->list[item] + 1 + strlen(name));
-
- } else {
-
- D(("env-item: %s, not found", name));
- return NULL;
-
- }
-}
-
-static char **_copy_env(pam_handle_t *pamh)
-{
- char **dump;
- int i = pamh->env->requested; /* reckon size of environment */
- char *const *env = pamh->env->list;
-
- D(("now get some memory for dump"));
-
- /* allocate some memory for this (plus the null tail-pointer) */
- dump = (char **) calloc(i, sizeof(char *));
- D(("dump = %p", dump));
- if (dump == NULL) {
- return NULL;
- }
-
- /* now run through entries and copy the variables over */
- dump[--i] = NULL;
- while (i-- > 0) {
- D(("env[%d]=`%s'", i,env[i]));
- dump[i] = _pam_strdup(env[i]);
- D(("->dump[%d]=`%s'", i,dump[i]));
- if (dump[i] == NULL) {
- /* out of memory */
-
- while (dump[++i]) {
- _pam_overwrite(dump[i]);
- _pam_drop(dump[i]);
- }
- return NULL;
- }
- }
-
- env = NULL; /* forget now */
-
- /* return transcribed environment */
- return dump;
-}
-
-char **pam_getenvlist(pam_handle_t *pamh)
-{
- int i;
-
- D(("called."));
- IF_NO_PAMH("pam_getenvlist", pamh, NULL);
-
- if (pamh->env == NULL || pamh->env->list == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_getenvlist: no env%s found",
- pamh->env == NULL ? "":"-list" );
- return NULL;
- }
-
- /* some quick checks */
-
- if (pamh->env->requested > pamh->env->entries) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_getenvlist: environment corruption");
- _pam_dump_env(pamh); /* only active when debugging */
- return NULL;
- }
-
- for (i=pamh->env->requested-1; i-- > 0; ) {
- if (pamh->env->list[i] == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_getenvlist: environment broken");
- _pam_dump_env(pamh); /* only active when debugging */
- return NULL; /* somehow we've broken the environment!? */
- }
- }
-
- /* Seems fine; copy environment */
-
- _pam_dump_env(pamh); /* only active when debugging */
-
- return _copy_env(pamh);
-}
diff --git a/contrib/libpam/libpam/pam_handlers.c b/contrib/libpam/libpam/pam_handlers.c
deleted file mode 100644
index 53d77158edf5..000000000000
--- a/contrib/libpam/libpam/pam_handlers.c
+++ /dev/null
@@ -1,901 +0,0 @@
-/* pam_handlers.c -- pam config file parsing and module loading */
-
-/*
- * created by Marc Ewing.
- * Currently maintained by Andrew G. Morgan <morgan@linux.kernel.org>
- *
- * $Id: pam_handlers.c,v 1.17 1997/04/05 06:55:24 morgan Exp morgan $
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef PAM_SHL
-# include <dl.h>
-#else
-# include <dlfcn.h>
-#endif
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "pam_private.h"
-
-/* FreeBSD doesn't define this */
-#ifndef RTLD_NOW
-# define RTLD_NOW 1
-#endif
-
-/* If not required, define as nothing - FreeBSD needs it to be "_"... */
-#ifndef SHLIB_SYM_PREFIX
-# define SHLIB_SYM_PREFIX ""
-#endif
-
-#define BUF_SIZE 1024
-#define MODULE_CHUNK 4
-
-static int _pam_assemble_line(FILE *f, char *buf, int buf_len);
-
-static void _pam_free_handlers_aux(struct handler **hp);
-
-static int _pam_add_handler(pam_handle_t *pamh
- , int must_fail, int other, int type
- , int *actions, const char *mod_path
- , int argc, char **argv, int argvlen);
-
-/* Values for module type */
-
-#define PAM_T_AUTH 1
-#define PAM_T_SESS 2
-#define PAM_T_ACCT 4
-#define PAM_T_PASS 8
-
-static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f
- , const char *known_service /* specific file */
-#ifdef PAM_READ_BOTH_CONFS
- , int not_other
-#endif /* PAM_READ_BOTH_CONFS */
- )
-{
- char buf[BUF_SIZE];
- int x; /* read a line from the FILE *f ? */
- /*
- * read a line from the configuration (FILE *) f
- */
- while ((x = _pam_assemble_line(f, buf, BUF_SIZE)) > 0) {
- char *tok, *nexttok=NULL;
- const char *this_service;
- const char *mod_path;
- int module_type, actions[_PAM_RETURN_VALUES];
- int other; /* set if module is for PAM_DEFAULT_SERVICE */
- int res; /* module added successfully? */
- int must_fail=0; /* a badly formatted line must fail when used */
- int argc;
- char **argv;
- int argvlen;
-
- D(("_pam_init_handler: LINE: %s", buf));
- if (known_service != NULL) {
- nexttok = buf;
- /* No service field: all lines are for the known service. */
- this_service = known_service;
- } else {
- this_service = tok = _pam_StrTok(buf, " \n\t", &nexttok);
- }
-
-#ifdef PAM_READ_BOTH_CONFS
- if (not_other)
- other = 0;
- else
-#endif /* PAM_READ_BOTH_CONFS */
- other = !_pam_strCMP(this_service, PAM_DEFAULT_SERVICE);
-
- /* accept "service name" or PAM_DEFAULT_SERVICE modules */
- if (!_pam_strCMP(this_service, pamh->service_name) || other) {
- /* This is a service we are looking for */
- D(("_pam_init_handlers: Found PAM config entry for: %s"
- , this_service));
-
- tok = _pam_StrTok(NULL, " \n\t", &nexttok);
- if (!_pam_strCMP("auth", tok)) {
- module_type = PAM_T_AUTH;
- } else if (!_pam_strCMP("session", tok)) {
- module_type = PAM_T_SESS;
- } else if (!_pam_strCMP("account", tok)) {
- module_type = PAM_T_ACCT;
- } else if (!_pam_strCMP("password", tok)) {
- module_type = PAM_T_PASS;
- } else {
- /* Illegal module type */
- D(("_pam_init_handlers: bad module type: %s", tok));
- pam_system_log(pamh, NULL, LOG_ERR,
- "(%s) illegal module type: %s"
- , this_service, tok);
- module_type = PAM_T_AUTH; /* most sensitive */
- must_fail = 1; /* install as normal but fail when dispatched */
- }
- D(("Using %s config entry: %s", must_fail?"BAD ":"", tok));
-
- /* reset the actions to .._UNDEF's -- this is so that
- we can work out which entries are not yet set (for default). */
- {
- int i;
- for (i=0; i<_PAM_RETURN_VALUES;
- actions[i++] = _PAM_ACTION_UNDEF);
- }
- tok = _pam_StrTok(NULL, " \n\t", &nexttok);
- if (!_pam_strCMP("required", tok)) {
- D(("*PAM_F_REQUIRED*"));
- actions[PAM_SUCCESS] = _PAM_ACTION_OK;
- actions[PAM_NEW_AUTHTOK_REQD] = _PAM_ACTION_OK;
- actions[PAM_IGNORE] = _PAM_ACTION_IGNORE;
- _pam_set_default_control(actions, _PAM_ACTION_BAD);
- } else if (!_pam_strCMP("requisite", tok)) {
- D(("*PAM_F_REQUISITE*"));
- actions[PAM_SUCCESS] = _PAM_ACTION_OK;
- actions[PAM_NEW_AUTHTOK_REQD] = _PAM_ACTION_OK;
- actions[PAM_IGNORE] = _PAM_ACTION_IGNORE;
- _pam_set_default_control(actions, _PAM_ACTION_DIE);
- } else if (!_pam_strCMP("optional", tok)) {
- D(("*PAM_F_OPTIONAL*"));
- actions[PAM_SUCCESS] = _PAM_ACTION_OK;
- actions[PAM_NEW_AUTHTOK_REQD] = _PAM_ACTION_OK;
- _pam_set_default_control(actions, _PAM_ACTION_IGNORE);
- } else if (!_pam_strCMP("sufficient", tok)) {
- D(("*PAM_F_SUFFICIENT*"));
- actions[PAM_SUCCESS] = _PAM_ACTION_DONE;
- actions[PAM_NEW_AUTHTOK_REQD] = _PAM_ACTION_DONE;
- _pam_set_default_control(actions, _PAM_ACTION_IGNORE);
- } else {
- D(("will need to parse %s", tok));
- _pam_parse_control(actions, tok);
- /* by default the default is to treat as failure */
- _pam_set_default_control(actions, _PAM_ACTION_BAD);
- }
-
- tok = _pam_StrTok(NULL, " \n\t", &nexttok);
- if (tok != NULL) {
- mod_path = tok;
- D(("mod_path = %s",mod_path));
- } else {
- /* no module name given */
- D(("_pam_init_handlers: no module name supplied"));
- pam_system_log(pamh, NULL, LOG_ERR,
- "(%s) no module name supplied", this_service);
- mod_path = NULL;
- must_fail = 1;
- }
-
- /* nexttok points to remaining arguments... */
-
- if (nexttok != NULL) {
- D(("list: %s",nexttok));
- argvlen = _pam_mkargv(nexttok, &argv, &argc);
- D(("argvlen = %d",argvlen));
- } else { /* there are no arguments so fix by hand */
- D(("_pam_init_handlers: empty argument list"));
- argvlen = argc = 0;
- argv = NULL;
- }
-
-#ifdef DEBUG
- {
- int y;
-
- D(("CONF%s: %s%s %d %s %d"
- , must_fail?"<*will fail*>":""
- , this_service, other ? "(backup)":""
- , module_type
- , mod_path, argc));
- for (y = 0; y < argc; y++) {
- D(("CONF: %s", argv[y]));
- }
- for (y = 0; y<_PAM_RETURN_VALUES; ++y) {
- D(("RETURN %s(%d) -> %d %s",
- _pam_token_returns[y], y, actions[y],
- actions[y]>0 ? "jump":
- _pam_token_actions[-actions[y]]));
- }
- fprintf(stderr, "pause to look at debugging: ");
- getchar();
- }
-#endif
-
- res = _pam_add_handler(pamh, must_fail, other
- , module_type, actions, mod_path
- , argc, argv, argvlen);
- if (res != PAM_SUCCESS) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "error loading %s", mod_path);
- D(("failed to load module - aborting"));
- return PAM_ABORT;
- }
- }
- }
-
- return ( (x < 0) ? PAM_ABORT:PAM_SUCCESS );
-}
-
-/* Parse config file, allocate handler structures, dlopen() */
-int _pam_init_handlers(pam_handle_t *pamh)
-{
- FILE *f;
- int retval;
-
- D(("_pam_init_handlers called"));
- IF_NO_PAMH("_pam_init_handlers",pamh,PAM_SYSTEM_ERR);
-
- /* Return immediately if everything is already loaded */
- if (pamh->handlers.handlers_loaded) {
- return PAM_SUCCESS;
- }
-
- D(("_pam_init_handlers: initializing"));
-
- /* First clean the service structure */
-
- _pam_free_handlers(pamh);
- if (! pamh->handlers.module) {
- if ((pamh->handlers.module =
- malloc(MODULE_CHUNK * sizeof(struct loaded_module))) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "_pam_init_handlers: no memory loading module");
- return PAM_BUF_ERR;
- }
- pamh->handlers.modules_allocated = MODULE_CHUNK;
- pamh->handlers.modules_used = 0;
- }
-
- if (pamh->service_name == NULL) {
- return PAM_BAD_ITEM; /* XXX - better error? */
- }
-
-#ifdef PAM_LOCKING
- /* Is the PAM subsystem locked? */
- {
- int fd_tmp;
-
- if ((fd_tmp = open( PAM_LOCK_FILE, O_RDONLY )) != -1) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: PAM lockfile ("
- PAM_LOCK_FILE ") exists - aborting");
- (void) close(fd_tmp);
- /*
- * to avoid swamping the system with requests
- */
- _pam_start_timer(pamh);
- pam_fail_delay(pamh, 5000000);
- _pam_await_timer(pamh, PAM_ABORT);
-
- return PAM_ABORT;
- }
- }
-#endif /* PAM_LOCKING */
-
- /*
- * Now parse the config file(s) and add handlers
- */
- {
- struct stat test_d;
-
- /* Is there a PAM_CONFIG_D directory? */
- if ( stat(PAM_CONFIG_D, &test_d) == 0 && S_ISDIR(test_d.st_mode) ) {
- char *filename;
- int read_something=0;
-
- D(("searching " PAM_CONFIG_D " for config files"));
- filename = malloc(sizeof(PAM_CONFIG_DF)
- +strlen(pamh->service_name));
- if (filename == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: no memory; service %s",
- pamh->service_name);
- return PAM_BUF_ERR;
- }
- sprintf(filename, PAM_CONFIG_DF, pamh->service_name);
- D(("opening %s", filename));
- f = fopen(filename, "r");
- if (f != NULL) {
- /* would test magic here? */
- retval = _pam_parse_conf_file(pamh, f, pamh->service_name
-#ifdef PAM_READ_BOTH_CONFS
- , 0
-#endif /* PAM_READ_BOTH_CONFS */
- );
- fclose(f);
- if (retval != PAM_SUCCESS) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: error reading %s",
- filename);
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: [%s]",
- pam_strerror(pamh, retval));
- } else {
- read_something = 1;
- }
- } else {
- D(("unable to open %s", filename));
-#ifdef PAM_READ_BOTH_CONFS
- D(("checking %s", PAM_CONFIG));
-
- if ((f = fopen(PAM_CONFIG,"r")) != NULL) {
- retval = _pam_parse_conf_file(pamh, f, NULL, 1);
- fclose(f);
- } else
-#endif /* PAM_READ_BOTH_CONFS */
- retval = PAM_SUCCESS;
- /*
- * XXX - should we log an error? Some people want to always
- * use "other"
- */
- }
- _pam_drop(filename);
-
- if (retval == PAM_SUCCESS) {
- /* now parse the PAM_DEFAULT_SERVICE_FILE */
-
- D(("opening %s", PAM_DEFAULT_SERVICE_FILE));
- f = fopen(PAM_DEFAULT_SERVICE_FILE, "r");
- if (f != NULL) {
- /* would test magic here? */
- retval = _pam_parse_conf_file(pamh, f
- , PAM_DEFAULT_SERVICE
-#ifdef PAM_READ_BOTH_CONFS
- , 0
-#endif /* PAM_READ_BOTH_CONFS */
- );
- fclose(f);
- if (retval != PAM_SUCCESS) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: error reading %s",
- PAM_DEFAULT_SERVICE_FILE);
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: [%s]",
- pam_strerror(pamh, retval));
- } else {
- read_something = 1;
- }
- } else {
- D(("unable to open %s", PAM_DEFAULT_SERVICE_FILE));
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: no default config %s",
- PAM_DEFAULT_SERVICE_FILE);
- }
- if (!read_something) { /* nothing read successfully */
- retval = PAM_ABORT;
- }
- }
- } else {
- if ((f = fopen(PAM_CONFIG, "r")) == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "_pam_init_handlers: could not open "
- PAM_CONFIG );
- return PAM_ABORT;
- }
-
- retval = _pam_parse_conf_file(pamh, f, NULL
-#ifdef PAM_READ_BOTH_CONFS
- , 0
-#endif /* PAM_READ_BOTH_CONFS */
- );
-
- D(("closing configuration file"));
- fclose(f);
- }
- }
-
- if (retval != PAM_SUCCESS) {
- /* Read error */
- pam_system_log(pamh, NULL, LOG_ERR,
- "error reading PAM configuration file");
- return PAM_ABORT;
- }
-
- pamh->handlers.handlers_loaded = 1;
-
- D(("_pam_init_handlers exiting"));
- return PAM_SUCCESS;
-}
-
-/*
- * This is where we read a line of the PAM config file. The line may be
- * preceeded by lines of comments and also extended with "\\\n"
- */
-
-int _pam_assemble_line(FILE *f, char *buffer, int buf_len)
-{
- char *p = buffer;
- char *s, *os;
- int used = 0;
-
- /* loop broken with a 'break' when a non-'\\n' ended line is read */
-
- D(("called."));
- for (;;) {
- if (used >= buf_len) {
- /* Overflow */
- D(("_pam_assemble_line: overflow"));
- return -1;
- }
- if (fgets(p, buf_len - used, f) == NULL) {
- if (used) {
- /* Incomplete read */
- return -1;
- } else {
- /* EOF */
- return 0;
- }
- }
-
- /* skip leading spaces --- line may be blank */
-
- s = p + strspn(p, " \n\t");
- if (*s && (*s != '#')) {
- os = s;
-
- /*
- * we are only interested in characters before the first '#'
- * character
- */
-
- while (*s && *s != '#')
- ++s;
- if (*s == '#') {
- *s = '\0';
- used += strlen(os);
- break; /* the line has been read */
- }
-
- s = os;
-
- /*
- * Check for backslash by scanning back from the end of
- * the entered line, the '\n' has been included since
- * normally a line is terminated with this
- * character. fgets() should only return one though!
- */
-
- s += strlen(s);
- while (s > os && ((*--s == ' ') || (*s == '\t')
- || (*s == '\n')));
-
- /* check if it ends with a backslash */
- if (*s == '\\') {
- *s++ = ' '; /* replace backslash with ' ' */
- *s = '\0'; /* truncate the line here */
- used += strlen(os);
- p = s; /* there is more ... */
- } else {
- /* End of the line! */
- used += strlen(os);
- break; /* this is the complete line */
- }
-
- } else {
- /* Nothing in this line */
- /* Don't move p */
- }
- }
-
- return used;
-}
-
-typedef int (*servicefn)(pam_handle_t *, int, int, char **);
-
-int _pam_add_handler(pam_handle_t *pamh
- , int must_fail, int other, int type
- , int *actions, const char *mod_path
- , int argc, char **argv, int argvlen)
-{
- struct loaded_module *mod;
- int x = 0;
- struct handler **handler_p;
- struct handler **handler_p2;
- struct handlers *the_handlers;
- const char *sym, *sym2;
-#ifdef PAM_SHL
- const char *_sym, *_sym2;
-#endif
- char *mod_full_path=NULL;
- servicefn func, func2;
- int success;
-
- D(("called."));
- IF_NO_PAMH("_pam_add_handler",pamh,PAM_SYSTEM_ERR);
-
- /* if NULL set to something that can be searched for */
- if (mod_path == NULL) {
- mod_path = "<*unknown module path*>";
- } else if (mod_path[0] != '/') {
- mod_full_path = malloc(sizeof(DEFAULT_MODULE_PATH)+strlen(mod_path));
- sprintf(mod_full_path, DEFAULT_MODULE_PATH "%s", mod_path);
- mod_path = mod_full_path;
- }
-
- D(("_pam_add_handler: adding type %d, module `%s'",type,mod_path));
- mod = pamh->handlers.module;
-
- /* First, ensure the module is loaded */
- while (x < pamh->handlers.modules_used) {
- if (!strcmp(mod[x].name, mod_path)) { /* case sensitive ! */
- break;
- }
- x++;
- }
- if (x == pamh->handlers.modules_used) {
- /* Not found */
- if (pamh->handlers.modules_allocated == pamh->handlers.modules_used) {
- /* will need more memory */
- void *tmp = realloc(pamh->handlers.module,
- (pamh->handlers.modules_allocated+MODULE_CHUNK)
- *sizeof(struct loaded_module));
- if (tmp == NULL) {
- D(("cannot enlarge module pointer memory"));
- pam_system_log(pamh, NULL, LOG_ERR,
- "realloc returned NULL in _pam_add_handler");
- _pam_drop(mod_full_path);
- return PAM_ABORT;
- }
- pamh->handlers.module = tmp;
- pamh->handlers.modules_allocated += MODULE_CHUNK;
- }
- mod = &(pamh->handlers.module[x]);
- /* Be pessimistic... */
- success = PAM_ABORT;
-
-#ifdef PAM_DYNAMIC
- D(("_pam_add_handler: dlopen(%s) -> %lx", mod_path, &mod->dl_handle));
- mod->dl_handle =
-# ifdef PAM_SHL
- shl_load(mod_path, BIND_IMMEDIATE, 0L);
-# else /* PAM_SHL */
- dlopen(mod_path, RTLD_NOW);
-# endif /* PAM_SHL */
- D(("_pam_add_handler: dlopen'ed"));
- if (mod->dl_handle == NULL) {
- D(("_pam_add_handler: dlopen(%s) failed", mod_path));
- pam_system_log(pamh, NULL, LOG_ERR, "unable to dlopen(%s)",
- mod_path);
-# ifndef PAM_SHL
- pam_system_log(pamh, NULL, LOG_ERR, "[dlerror: %s]", dlerror());
-# endif /* PAM_SHL */
- /* Don't abort yet; static code may be able to find function.
- * But defaults to abort if nothing found below... */
- } else {
- D(("module added successfully"));
- success = PAM_SUCCESS;
- mod->type = PAM_MT_DYNAMIC_MOD;
- pamh->handlers.modules_used++;
- }
-#endif
-#ifdef PAM_STATIC
- /* Only load static function if function was not found dynamically.
- * This code should work even if no dynamic loading is available. */
- if (success != PAM_SUCCESS) {
- D(("_pam_add_handler: open static handler %s", mod_path));
- mod->dl_handle = _pam_open_static_handler(mod_path);
- if (mod->dl_handle == NULL) {
- D(("_pam_add_handler: unable to find static handler %s",
- mod_path));
- pam_system_log(pamh, NULL, LOG_ERR,
- "unable to open static handler %s", mod_path);
- /* Didn't find module in dynamic or static..will mark bad */
- } else {
- D(("static module added successfully"));
- success = PAM_SUCCESS;
- mod->type = PAM_MT_STATIC_MOD;
- pamh->handlers.modules_used++;
- }
- }
-#endif
-
- if (success != PAM_SUCCESS) { /* add a malformed module */
- mod->dl_handle = NULL;
- mod->type = PAM_MT_FAULTY_MOD;
- pamh->handlers.modules_used++;
- pam_system_log(pamh, NULL, LOG_ERR,
- "adding faulty module: %s", mod_path);
- success = PAM_SUCCESS; /* We have successfully added a module */
- }
-
- /* indicate its name - later we will search for it by this */
- if ((mod->name = _pam_strdup(mod_path)) == NULL) {
- D(("_pam_handler: couldn't get memory for mod_path"));
- pam_system_log(pamh, NULL, LOG_ERR,
- "no memory for module path", mod_path);
- success = PAM_ABORT;
- }
-
- } else { /* x != pamh->handlers.modules_used */
- mod += x; /* the located module */
- success = PAM_SUCCESS;
- }
-
- _pam_drop(mod_full_path);
- mod_path = NULL; /* no longer needed or trusted */
-
- /* Now return error if necessary after trying all possible ways... */
- if (success != PAM_SUCCESS)
- return(success);
-
- /*
- * At this point 'mod' points to the stored/loaded module. If its
- * dl_handle is unknown, then we must be able to indicate dispatch
- * failure with 'must_fail'
- */
-
- /* Now define the handler(s) based on mod->dlhandle and type */
-
- /* decide which list of handlers to use */
- the_handlers = (other) ? &pamh->handlers.other : &pamh->handlers.conf;
-
- handler_p = handler_p2 = NULL;
- func = func2 = NULL;
-#ifdef PAM_SHL
- _sym2 =
-#endif /* PAM_SHL */
- sym2 = NULL;
-
- /* point handler_p's at the root addresses of the function stacks */
- switch (type) {
- case PAM_T_AUTH:
- handler_p = &the_handlers->authenticate;
- sym = SHLIB_SYM_PREFIX "pam_sm_authenticate";
- handler_p2 = &the_handlers->setcred;
- sym2 = SHLIB_SYM_PREFIX "pam_sm_setcred";
-#ifdef PAM_SHL
- _sym = "_pam_sm_authenticate";
- _sym2 = "_pam_sm_setcred";
-#endif
- break;
- case PAM_T_SESS:
- handler_p = &the_handlers->open_session;
- sym = SHLIB_SYM_PREFIX "pam_sm_open_session";
- handler_p2 = &the_handlers->close_session;
- sym2 = SHLIB_SYM_PREFIX "pam_sm_close_session";
-#ifdef PAM_SHL
- _sym = "_pam_sm_open_session";
- _sym2 = "_pam_sm_close_session";
-#endif
- break;
- case PAM_T_ACCT:
- handler_p = &the_handlers->acct_mgmt;
- sym = SHLIB_SYM_PREFIX "pam_sm_acct_mgmt";
-#ifdef PAM_SHL
- _sym = "_pam_sm_acct_mgmt";
-#endif
- break;
- case PAM_T_PASS:
- handler_p = &the_handlers->chauthtok;
- sym = SHLIB_SYM_PREFIX "pam_sm_chauthtok";
-#ifdef PAM_SHL
- _sym = "_pam_sm_chauthtok";
-#endif
- break;
- default:
- /* Illegal module type */
- D(("_pam_add_handler: illegal module type %d", type));
- return PAM_ABORT;
- }
-
- /* are the modules reliable? */
- if (
-#ifdef PAM_DYNAMIC
- mod->type != PAM_MT_DYNAMIC_MOD
- &&
-#endif /* PAM_DYNAMIC */
-#ifdef PAM_STATIC
- mod->type != PAM_MT_STATIC_MOD
- &&
-#endif /* PAM_STATIC */
- mod->type != PAM_MT_FAULTY_MOD
- ) {
- D(("_pam_add_handlers: illegal module library type; %d", mod->type));
- pam_system_log(pamh, NULL, LOG_ERR,
- "internal error: module library type not known: %s;%d",
- sym, mod->type);
- return PAM_ABORT;
- }
-
- /* now identify this module's functions - for non-faulty modules */
-
-#ifdef PAM_DYNAMIC
- if ((mod->type == PAM_MT_DYNAMIC_MOD) &&
-# ifdef PAM_SHL
- (shl_findsym(&mod->dl_handle, sym, (short) TYPE_PROCEDURE, &func) &&
- shl_findsym(&mod->dl_handle, _sym, (short) TYPE_PROCEDURE, &func))
-# else /* PAM_SHL */
- (func = (servicefn) dlsym(mod->dl_handle, sym)) == NULL
-# endif /* PAM_SHL */
- ) {
- pam_system_log(pamh, NULL, LOG_ERR, "unable to resolve symbol: %s",
- sym);
- }
-#endif
-#ifdef PAM_STATIC
- if ((mod->type == PAM_MT_STATIC_MOD) &&
- (func = (servicefn)_pam_get_static_sym(mod->dl_handle, sym)) == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "unable to resolve static symbol: %s", sym);
- }
-#endif
- if (sym2) {
-#ifdef PAM_DYNAMIC
- if ((mod->type == PAM_MT_DYNAMIC_MOD) &&
-# ifdef PAM_SHL
- (shl_findsym(&mod->dl_handle,sym2,(short)TYPE_PROCEDURE, &func2)&&
- shl_findsym(&mod->dl_handle,_sym2,(short)TYPE_PROCEDURE, &func2))
-# else /* PAM_SHL */
- (func2 = (servicefn) dlsym(mod->dl_handle, sym2)) == NULL
-# endif /* PAM_SHL */
- ) {
- pam_system_log(pamh, NULL, LOG_ERR, "unable to resolve symbol: %s",
- sym2);
- }
-#endif
-#ifdef PAM_STATIC
- if ((mod->type == PAM_MT_STATIC_MOD) &&
- (func2 = (servicefn)_pam_get_static_sym(mod->dl_handle, sym2))
- == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR, "unable to resolve symbol: %s",
- sym2);
- }
-#endif
- }
-
- /* here func (and perhaps func2) point to the appropriate functions */
-
- /* add new handler to end of existing list */
- while (*handler_p != NULL) {
- handler_p = &((*handler_p)->next);
- }
-
- if ((*handler_p = malloc(sizeof(struct handler))) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "cannot malloc struct handler #1");
- return (PAM_ABORT);
- }
-
- (*handler_p)->must_fail = must_fail; /* failure forced? */
- (*handler_p)->func = func;
- memcpy((*handler_p)->actions,actions,sizeof((*handler_p)->actions));
- (*handler_p)->argc = argc;
- (*handler_p)->argv = argv; /* not a copy */
- (*handler_p)->next = NULL;
-
- /* some of the modules have a second calling function */
- if (handler_p2) {
- /* add new handler to end of existing list */
- while (*handler_p2) {
- handler_p2 = &((*handler_p2)->next);
- }
-
- if ((*handler_p2 = malloc(sizeof(struct handler))) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "cannot malloc struct handler #2");
- return (PAM_ABORT);
- }
-
- (*handler_p2)->must_fail = must_fail; /* failure forced? */
- (*handler_p2)->func = func2;
- memcpy((*handler_p2)->actions,actions,sizeof((*handler_p2)->actions));
- (*handler_p2)->argc = argc;
- if (argv) {
- if (((*handler_p2)->argv = malloc(argvlen)) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "cannot malloc argv for handler #2");
- return (PAM_ABORT);
- }
- memcpy((*handler_p2)->argv, argv, argvlen);
- } else {
- (*handler_p2)->argv = NULL; /* no arguments */
- }
- (*handler_p2)->next = NULL;
- }
-
- D(("_pam_add_handler: returning successfully"));
-
- return PAM_SUCCESS;
-}
-
-/* Free various allocated structures and dlclose() the libs */
-int _pam_free_handlers(pam_handle_t *pamh)
-{
- struct loaded_module *mod;
-
- D(("called."));
- IF_NO_PAMH("_pam_free_handlers",pamh,PAM_SYSTEM_ERR);
-
- mod = pamh->handlers.module;
-
- /* Close all loaded modules */
-
- while (pamh->handlers.modules_used) {
- D(("_pam_free_handlers: dlclose(%s)", mod->name));
- free(mod->name);
-#ifdef PAM_DYNAMIC
-# ifdef PAM_SHL
- if (mod->type == PAM_MT_DYNAMIC_MOD) shl_unload(mod->dl_handle);
-# else
- if (mod->type == PAM_MT_DYNAMIC_MOD) dlclose(mod->dl_handle);
-# endif
-#endif
- mod++;
- pamh->handlers.modules_used--;
- }
-
- /* Free all the handlers */
-
- _pam_free_handlers_aux(&(pamh->handlers.conf.authenticate));
- _pam_free_handlers_aux(&(pamh->handlers.conf.setcred));
- _pam_free_handlers_aux(&(pamh->handlers.conf.acct_mgmt));
- _pam_free_handlers_aux(&(pamh->handlers.conf.open_session));
- _pam_free_handlers_aux(&(pamh->handlers.conf.close_session));
- _pam_free_handlers_aux(&(pamh->handlers.conf.chauthtok));
-
- _pam_free_handlers_aux(&(pamh->handlers.other.authenticate));
- _pam_free_handlers_aux(&(pamh->handlers.other.setcred));
- _pam_free_handlers_aux(&(pamh->handlers.other.acct_mgmt));
- _pam_free_handlers_aux(&(pamh->handlers.other.open_session));
- _pam_free_handlers_aux(&(pamh->handlers.other.close_session));
- _pam_free_handlers_aux(&(pamh->handlers.other.chauthtok));
-
- /* no more loaded modules */
-
- _pam_drop(pamh->handlers.module);
-
- /* Indicate that handlers are not initialized for this pamh */
-
- pamh->handlers.handlers_loaded = 0;
-
- return PAM_SUCCESS;
-}
-
-void _pam_start_handlers(pam_handle_t *pamh)
-{
- D(("called."));
- /* NB. There is no check for a NULL pamh here, since no return
- * value to communicate the fact! */
-
- /* Indicate that handlers are not initialized for this pamh */
- pamh->handlers.handlers_loaded = 0;
-
- pamh->handlers.modules_allocated = 0;
- pamh->handlers.modules_used = 0;
- pamh->handlers.module = NULL;
-
- /* initialize the .conf and .other entries */
-
- pamh->handlers.conf.authenticate = NULL;
- pamh->handlers.conf.setcred = NULL;
- pamh->handlers.conf.acct_mgmt = NULL;
- pamh->handlers.conf.open_session = NULL;
- pamh->handlers.conf.close_session = NULL;
- pamh->handlers.conf.chauthtok = NULL;
-
- pamh->handlers.other.authenticate = NULL;
- pamh->handlers.other.setcred = NULL;
- pamh->handlers.other.acct_mgmt = NULL;
- pamh->handlers.other.open_session = NULL;
- pamh->handlers.other.close_session = NULL;
- pamh->handlers.other.chauthtok = NULL;
-}
-
-void _pam_free_handlers_aux(struct handler **hp)
-{
- struct handler *h = *hp;
- struct handler *last;
-
- D(("called."));
- while (h) {
- last = h;
- _pam_drop(h->argv); /* This is all alocated in a single chunk */
- h = h->next;
- memset(last, 0, sizeof(*last));
- free(last);
- }
-
- *hp = NULL;
-}
diff --git a/contrib/libpam/libpam/pam_item.c b/contrib/libpam/libpam/pam_item.c
deleted file mode 100644
index 0e8142bf5ce4..000000000000
--- a/contrib/libpam/libpam/pam_item.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/* pam_item.c */
-
-/*
- * $Id: pam_item.c,v 1.8 1997/02/15 15:58:49 morgan Exp morgan $
- *
- * $Log: pam_item.c,v $
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-
-#include "pam_private.h"
-
-#define RESET(X, Y) \
-{ \
- char *_TMP_ = (X); \
- if (_TMP_ != (Y)) { \
- (X) = (Y) ? _pam_strdup(Y) : NULL; \
- if (_TMP_) \
- free(_TMP_); \
- } \
-}
-
-/* functions */
-
-int pam_set_item (
- pam_handle_t *pamh,
- int item_type,
- const void *item)
-{
- int retval;
-
- D(("called"));
-
- IF_NO_PAMH("pam_set_item", pamh, PAM_SYSTEM_ERR);
-
- retval = PAM_SUCCESS;
-
- switch (item_type) {
- case PAM_SERVICE:
- /* Setting handlers_loaded to 0 will cause the handlers
- * to be reloaded on the next call to a service module.
- */
- pamh->handlers.handlers_loaded = 0;
- RESET(pamh->service_name, item);
- {
- char *tmp;
- for (tmp=pamh->service_name; *tmp; ++tmp)
- *tmp = tolower(*tmp); /* require lower case */
- }
- break;
- case PAM_USER:
- RESET(pamh->user, item);
- break;
- case PAM_USER_PROMPT:
- RESET(pamh->prompt, item);
- break;
- case PAM_TTY:
- D(("setting tty to %s", item));
- RESET(pamh->tty, item);
- break;
- case PAM_RUSER:
- RESET(pamh->ruser, item);
- break;
- case PAM_RHOST:
- RESET(pamh->rhost, item);
- break;
- case PAM_AUTHTOK:
- /*
- * The man page says this is only supposed to be available to
- * the module providers. In order to use this item the app
- * has to #include <security/pam_modules.h>. This is something
- * it is *not* supposed to do with "Linux-"PAM! - AGM.
- */
- {
- char *_TMP_ = pamh->authtok;
- if (_TMP_ == item) /* not changed so leave alone */
- break;
- pamh->authtok = (item) ? _pam_strdup(item) : NULL;
- if (_TMP_) {
- _pam_overwrite(_TMP_);
- free(_TMP_);
- }
- break;
- }
- case PAM_OLDAUTHTOK:
- /* See note above. */
- {
- char *_TMP_ = pamh->oldauthtok;
- if (_TMP_ == item) /* not changed so leave alone */
- break;
- pamh->oldauthtok = (item) ? _pam_strdup(item) : NULL;
- if (_TMP_) {
- _pam_overwrite(_TMP_);
- free(_TMP_);
- }
- break;
- }
- case PAM_CONV: /* want to change the conversation function */
- if (item == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_set_item: attempt to set conv() to NULL");
- retval = PAM_PERM_DENIED;
- } else {
- struct pam_conv *tconv;
-
- if ((tconv=
- (struct pam_conv *) malloc(sizeof(struct pam_conv))
- ) == NULL) {
- pam_system_log(pamh, NULL, LOG_CRIT,
- "pam_set_item: malloc failed for pam_conv");
- retval = PAM_BUF_ERR;
- } else {
- memcpy(tconv, item, sizeof(struct pam_conv));
- _pam_drop(pamh->pam_conversation);
- pamh->pam_conversation = tconv;
- }
- }
- break;
- case PAM_FAIL_DELAY:
- pamh->fail_delay.delay_fn_ptr = item;
- break;
- case PAM_LOG_STATE:
- {
- char *old_ident = pamh->pam_default_log.ident;
-
- if (item == NULL) {
- /* reset the default state */
- pamh->pam_default_log.ident = x_strdup(PAM_LOG_STATE_IDENT);
- pamh->pam_default_log.option = PAM_LOG_STATE_OPTION;
- pamh->pam_default_log.facility = PAM_LOG_STATE_FACILITY;
- } else {
- const struct pam_log_state *state = item;
-
- pamh->pam_default_log.ident = x_strdup(state->ident);
- pamh->pam_default_log.option = state->option;
- pamh->pam_default_log.facility = state->facility;
- }
- _pam_overwrite(old_ident);
- _pam_drop(old_ident);
-
- break;
- }
- default:
- retval = PAM_BAD_ITEM;
- }
-
- return (retval);
-}
-
-int pam_get_item (
- const pam_handle_t *pamh,
- int item_type,
- const void **item)
-{
- D(("called."));
- IF_NO_PAMH("pam_get_item",pamh,PAM_SYSTEM_ERR);
-
- if (item == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_get_item: nowhere to place requested item");
- return PAM_PERM_DENIED;
- }
-
- switch (item_type) {
- case PAM_SERVICE:
- *item = pamh->service_name;
- break;
- case PAM_USER:
- *item = pamh->user;
- break;
- case PAM_USER_PROMPT:
- *item = pamh->prompt;
- break;
- case PAM_TTY:
- D(("returning tty=%s", pamh->tty));
- *item = pamh->tty;
- break;
- case PAM_RUSER:
- *item = pamh->ruser;
- break;
- case PAM_RHOST:
- *item = pamh->rhost;
- break;
- case PAM_AUTHTOK:
- *item = pamh->authtok;
- break;
- case PAM_OLDAUTHTOK:
- *item = pamh->oldauthtok;
- break;
- case PAM_CONV:
- *item = pamh->pam_conversation;
- break;
- case PAM_FAIL_DELAY:
- *item = pamh->fail_delay.delay_fn_ptr;
- break;
- case PAM_LOG_STATE:
- *item = &(pamh->pam_default_log);
- break;
- default:
- /* XXX - I made this up */
- return PAM_BAD_ITEM;
- }
-
- return PAM_SUCCESS;
-}
-
-/* added by AGM 1996/3/2 */
-
-int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt)
-{
- const char *use_prompt;
- int retval;
- struct pam_message msg,*pmsg;
- struct pam_response *resp;
-
- D(("called."));
- IF_NO_PAMH("pam_get_user", pamh, PAM_SYSTEM_ERR);
-
- if (pamh->pam_conversation == NULL) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_get_user: no conv element in pamh");
- return PAM_SERVICE_ERR;
- }
-
- if (user == NULL) { /* ensure the the module has suplied a destination */
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_get_user: nowhere to record username");
- return PAM_PERM_DENIED;
- } else
- *user = NULL;
-
- if (pamh->user) { /* have one so return it */
- *user = pamh->user;
- return PAM_SUCCESS;
- }
-
- /* will need a prompt */
- use_prompt = prompt;
- if (use_prompt == NULL) {
- use_prompt = pamh->prompt;
- if (use_prompt == NULL) {
- use_prompt = PAM_DEFAULT_PROMPT;
- }
- }
-
- /* If we are resuming an old conversation, we verify that the prompt
- is the same. Anything else is an error. */
- if (pamh->former.want_user) {
- /* must have a prompt to resume with */
- if (! pamh->former.prompt) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_get_user: failed to resume with prompt"
- );
- return PAM_ABORT;
- }
-
- /* must be the same prompt as last time */
- if (strcmp(pamh->former.prompt, use_prompt)) {
- pam_system_log(pamh, NULL, LOG_ERR,
- "pam_get_user: resumed with different prompt");
- return PAM_ABORT;
- }
-
- /* ok, we can resume where we left off last time */
- pamh->former.want_user = PAM_FALSE;
- _pam_overwrite(pamh->former.prompt);
- _pam_drop(pamh->former.prompt);
- }
-
- /* converse with application -- prompt user for a username */
- pmsg = &msg;
- msg.msg_style = PAM_PROMPT_ECHO_ON;
- msg.msg = use_prompt;
- resp = NULL;
-
- retval = pamh->pam_conversation->
- conv(1, (const struct pam_message **) &pmsg, &resp,
- pamh->pam_conversation->appdata_ptr);
-
- if (retval == PAM_CONV_AGAIN) {
- /* conversation function is waiting for an event - save state */
- D(("conversation function is not ready yet"));
- pamh->former.want_user = PAM_TRUE;
- pamh->former.prompt = _pam_strdup(use_prompt);
- } else if (resp == NULL) {
- /*
- * conversation should have given a response
- */
- D(("pam_get_user: no response provided"));
- retval = PAM_CONV_ERR;
- } else if (retval == PAM_SUCCESS) { /* copy the username */
- /*
- * now we set the PAM_USER item -- this was missing from pre.53
- * releases. However, reading the Sun manual, it is part of
- * the standard API.
- */
- RESET(pamh->user, resp->resp);
- *user = pamh->user;
- }
-
- if (resp) {
- /*
- * note 'resp' is allocated by the application and is
- * correctly free()'d here
- */
- _pam_drop_reply(resp, 1);
- }
-
- return retval; /* pass on any error from conversation */
-}
diff --git a/contrib/libpam/libpam/pam_log.c b/contrib/libpam/libpam/pam_log.c
deleted file mode 100644
index 433d27a83539..000000000000
--- a/contrib/libpam/libpam/pam_log.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * pam_log.c -- PAM system logging
- *
- * $Id$
- *
- * $Log$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "pam_private.h"
-
-#ifdef __hpux
-# include <stdio.h>
-# include <syslog.h>
-# ifdef __STDC__
-# ifndef __P
-# define __P(p) p
-# endif /* __P */
-# include <stdarg.h>
-# define VA_LOCAL_DECL va_list ap;
-# define VA_START(f) va_start(ap, f)
-# define VA_END va_end(ap)
-# else /* __STDC__ */
-# ifndef __P
-# define __P(p) ()
-# endif /* __P */
-# include <varargs.h>
-# define VA_LOCAL_DECL va_list ap;
-# define VA_START(f) va_start(ap)
-# define VA_END va_end(ap)
-# endif /* __STDC__ */
-/**************************************************************
- * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
- * A bombproof version of doprnt (dopr) included.
- * Sigh. This sort of thing is always nasty do deal with. Note that
- * the version here does not include floating point...
- *
- * snprintf() is used instead of sprintf() as it does limit checks
- * for string length. This covers a nasty loophole.
- *
- * The other functions are there to prevent NULL pointers from
- * causing nast effects.
- **************************************************************/
-
-static void dopr();
-static char *end;
-# ifndef _SCO_DS
-/* VARARGS3 */
-int
-# ifdef __STDC__
-snprintf(char *str, size_t count, const char *fmt, ...)
-# else /* __STDC__ */
-snprintf(str, count, fmt, va_alist)
- char *str;
- size_t count;
- const char *fmt;
- va_dcl
-# endif /* __STDC__ */
-{
- int len;
- VA_LOCAL_DECL
-
- VA_START(fmt);
- len = vsnprintf(str, count, fmt, ap);
- VA_END;
- return len;
-}
-# endif /* _SCO_DS */
-
-int
-# ifdef __STDC__
-vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-# else /* __STDC__ */
-vsnprintf(str, count, fmt, args)
- char *str;
- int count;
- char *fmt;
- va_list args;
-# endif /* __STDC__ */
-{
- str[0] = 0;
- end = str + count - 1;
- dopr( str, fmt, args );
- if (count > 0)
- end[0] = 0;
- return strlen(str);
-}
-
-/*
- * dopr(): poor man's version of doprintf
- */
-
-static void fmtstr __P((char *value, int ljust, int len, int zpad,
- int maxwidth));
-static void fmtnum __P((long value, int base, int dosign, int ljust, int len,
- int zpad));
-static void dostr __P(( char * , int ));
-static char *output;
-static void dopr_outch __P(( int c ));
-
-static void
-# ifdef __STDC__
-dopr(char * buffer, const char * format, va_list args )
-# else /* __STDC__ */
-dopr( buffer, format, args )
- char *buffer;
- char *format;
- va_list args;
-# endif /* __STDC__ */
-{
- int ch;
- long value;
- int longflag = 0;
- int pointflag = 0;
- int maxwidth = 0;
- char *strvalue;
- int ljust;
- int len;
- int zpad;
-
- output = buffer;
- while( (ch = *format++) ){
- switch( ch ){
- case '%':
- ljust = len = zpad = maxwidth = 0;
- longflag = pointflag = 0;
- nextch:
- ch = *format++;
- switch( ch ){
- case 0:
- dostr( "**end of format**" , 0);
- return;
- case '-': ljust = 1; goto nextch;
- case '0': /* set zero padding if len not set */
- if(len==0 && !pointflag) zpad = '0';
- case '1': case '2': case '3':
- case '4': case '5': case '6':
- case '7': case '8': case '9':
- if (pointflag)
- maxwidth = maxwidth*10 + ch - '0';
- else
- len = len*10 + ch - '0';
- goto nextch;
- case '*':
- if (pointflag)
- maxwidth = va_arg( args, int );
- else
- len = va_arg( args, int );
- goto nextch;
- case '.': pointflag = 1; goto nextch;
- case 'l': longflag = 1; goto nextch;
- case 'u': case 'U':
- /*fmtnum(value,base,dosign,ljust,len,zpad) */
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 10,0, ljust, len, zpad ); break;
- case 'o': case 'O':
- /*fmtnum(value,base,dosign,ljust,len,zpad) */
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 8,0, ljust, len, zpad ); break;
- case 'd': case 'D':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 10,1, ljust, len, zpad ); break;
- case 'x':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 16,0, ljust, len, zpad ); break;
- case 'X':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value,-16,0, ljust, len, zpad ); break;
- case 's':
- strvalue = va_arg( args, char *);
- if (maxwidth > 0 || !pointflag) {
- if (pointflag && len > maxwidth)
- len = maxwidth; /* Adjust padding */
- fmtstr( strvalue,ljust,len,zpad, maxwidth);
- }
- break;
- case 'c':
- ch = va_arg( args, int );
- dopr_outch( ch ); break;
- case '%': dopr_outch( ch ); continue;
- default:
- dostr( "???????" , 0);
- }
- break;
- default:
- dopr_outch( ch );
- break;
- }
- }
- *output = 0;
-}
-
-static void
-fmtstr( value, ljust, len, zpad, maxwidth )
- char *value;
- int ljust, len, zpad, maxwidth;
-{
- int padlen, strlen; /* amount to pad */
-
- if( value == 0 ){
- value = "<NULL>";
- }
- for( strlen = 0; value[strlen]; ++ strlen ); /* strlen */
- if (strlen > maxwidth && maxwidth)
- strlen = maxwidth;
- padlen = len - strlen;
- if( padlen < 0 ) padlen = 0;
- if( ljust ) padlen = -padlen;
- while( padlen > 0 ) {
- dopr_outch( ' ' );
- --padlen;
- }
- dostr( value, maxwidth );
- while( padlen < 0 ) {
- dopr_outch( ' ' );
- ++padlen;
- }
-}
-
-static void
-fmtnum( value, base, dosign, ljust, len, zpad )
- long value;
- int base, dosign, ljust, len, zpad;
-{
- int signvalue = 0;
- unsigned long uvalue;
- char convert[20];
- int place = 0;
- int padlen = 0; /* amount to pad */
- int caps = 0;
-
- /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n",
- value, base, dosign, ljust, len, zpad )); */
- uvalue = value;
- if( dosign ){
- if( value < 0 ) {
- signvalue = '-';
- uvalue = -value;
- }
- }
- if( base < 0 ){
- caps = 1;
- base = -base;
- }
- do{
- convert[place++] =
- (caps? "0123456789ABCDEF":"0123456789abcdef")
- [uvalue % (unsigned)base ];
- uvalue = (uvalue / (unsigned)base );
- }while(uvalue);
- convert[place] = 0;
- padlen = len - place;
- if( padlen < 0 ) padlen = 0;
- if( ljust ) padlen = -padlen;
- /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n",
- convert,place,signvalue,padlen)); */
- if( zpad && padlen > 0 ){
- if( signvalue ){
- dopr_outch( signvalue );
- --padlen;
- signvalue = 0;
- }
- while( padlen > 0 ){
- dopr_outch( zpad );
- --padlen;
- }
- }
- while( padlen > 0 ) {
- dopr_outch( ' ' );
- --padlen;
- }
- if( signvalue ) dopr_outch( signvalue );
- while( place > 0 ) dopr_outch( convert[--place] );
- while( padlen < 0 ){
- dopr_outch( ' ' );
- ++padlen;
- }
-}
-
-static void
-dostr( str , cut)
- char *str;
- int cut;
-{
- if (cut) {
- while(*str && cut-- > 0) dopr_outch(*str++);
- } else {
- while(*str) dopr_outch(*str++);
- }
-}
-
-static void
-dopr_outch( c )
- int c;
-{
- if( end == 0 || output < end )
- *output++ = c;
-}
-
-int
-# ifdef __STDC__
-vsyslog(int priority, const char *fmt, ...)
-# else /* __STDC__ */
-vsyslog(priority, fmt, va_alist)
- int priority;
- const char *fmt;
- va_dcl
-# endif /* __STDC__ */
-{
- VA_LOCAL_DECL
- char logbuf[BUFSIZ];
-
- VA_START(fmt);
-
- vsnprintf(logbuf, BUFSIZ, fmt, ap);
- syslog(priority, "%s", logbuf);
-
- VA_END;
-}
-#endif /* __hpux */
-
-void pam_vsystem_log(const pam_handle_t *pamh,
- const struct pam_log_state *log_state,
- int priority, const char *format, va_list args)
-{
- const char *ident;
- int option, facility;
-
- D(("pam_vsystem_log called"));
-
-#ifndef __FreeBSD__
- /* make sure we have a log state to use */
- if (NULL == log_state) {
- if (NULL != pamh && NULL != pamh->pam_default_log.ident) {
- ident = pamh->pam_default_log.ident;
- option = pamh->pam_default_log.option;
- facility = pamh->pam_default_log.facility;
- } else {
- ident = PAM_LOG_STATE_IDENT;
- option = PAM_LOG_STATE_OPTION;
- facility = PAM_LOG_STATE_FACILITY;
- }
- openlog(ident, option, facility);
- } else {
- openlog(log_state->ident, log_state->option, log_state->facility);
- }
-#endif
-
- vsyslog(priority, format, args);
-#ifndef __FreeBSD__
- closelog();
-#endif
-
- D(("done."));
-}
-
-void pam_system_log(const pam_handle_t *pamh,
- const struct pam_log_state *log_state,
- int priority, const char *format, ... )
-{
- const char *ident;
- int option, facility;
- va_list args;
-
- D(("pam_system_log called"));
-
-#ifndef __FreeBSD__
- /* make sure we have a log state to use */
- if (NULL == log_state) {
- if (NULL != pamh && NULL != pamh->pam_default_log.ident) {
- ident = pamh->pam_default_log.ident;
- option = pamh->pam_default_log.option;
- facility = pamh->pam_default_log.facility;
- } else {
- ident = PAM_LOG_STATE_IDENT;
- option = PAM_LOG_STATE_OPTION;
- facility = PAM_LOG_STATE_FACILITY;
- }
- openlog(ident, option, facility);
- } else {
- openlog(log_state->ident, log_state->option, log_state->facility);
- }
-#endif
-
- va_start(args, format);
- vsyslog(priority, format, args);
- va_end(args);
-#ifndef __FreeBSD__
- closelog();
-#endif
-
- D(("done."));
-}
-
-/*
- * Recommended #defines to make porting legacy apps easier [Ed. at this
- * point, the syslog() #define is breoken -- suggestions?]
- *
- * #ifdef PAM_LOG_STATE
- * # define openlog(ident, option, facility) { \
- * struct pam_log_state tmp_state; \
- * tmp_state.ident = ident; \
- * tmp_state.option = option; \
- * tmp_state.facility = facility; \
- * (void) pam_set_item(pamh, PAM_LOG_STATE, &tmp_state); \
- * }
- * # define syslog pam_system_log
- * # define closelog()
- * #endif
- */
diff --git a/contrib/libpam/libpam/pam_malloc.c b/contrib/libpam/libpam/pam_malloc.c
deleted file mode 100644
index cc66f1aad6c7..000000000000
--- a/contrib/libpam/libpam/pam_malloc.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * $Id: pam_malloc.c,v 1.2 1996/12/01 03:14:13 morgan Exp $
- *
- * $Log: pam_malloc.c,v $
- * Revision 1.2 1996/12/01 03:14:13 morgan
- * use _pam_macros.h
- *
- * Revision 1.1 1996/11/10 21:26:11 morgan
- * Initial revision
- *
- */
-
-/*
- * This pair of files helps to locate memory leaks. It is a wrapper for
- * the malloc family of calls. (Actutally, it currently only deals
- * with calloc, malloc, realloc, free and exit)
- *
- * To use these functions the header "pam_malloc.h" must be included
- * in all parts of the code (that use the malloc functions) and this
- * file must be linked with the result. The pam_malloc_flags can be
- * set from another function and determine the level of logging.
- *
- * The output is via the macros defined in _pam_macros.h
- *
- * It is a debugging tool and should be turned off in released code.
- *
- * This suite was written by Andrew Morgan <morgan@parc.power.net> for
- * Linux-PAM.
- */
-
-#ifndef DEBUG
-#define DEBUG
-#endif
-
-#include "pam_private.h"
-
-#include <security/pam_malloc.h>
-#include <security/_pam_macros.h>
-
-/* this must be done to stop infinite recursion! */
-#undef malloc
-#undef calloc
-#undef free
-#undef realloc
-#undef exit
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/*
- * default debugging level
- */
-
-int pam_malloc_flags = PAM_MALLOC_DEFAULT;
-int pam_malloc_delay_length = 4;
-
-#define on(x) ((pam_malloc_flags&(x))==(x))
-
-/*
- * the implementation
- */
-
-static const char *last_fn=NULL;
-static const char *last_file=NULL;
-static const char *last_call=NULL;
-static int last_line = 1;
-
-#define err(x) { _pam_output_xdebug_info(); _pam_output_debug x ; }
-
-static void set_last_(const char *x, const char *f
- , const char *fn, const int l)
-{
- last_fn = x ? x : "error-in-pam_malloc..";
- last_file = f ? f : "*bad-file*";
- last_call = fn ? fn: "*bad-fn*";
- last_line = l;
-}
-
-static void _pam_output_xdebug_info(void)
-{
- FILE *logfile;
- int must_close = 1;
-
- if (!(logfile = fopen(_PAM_LOGFILE,"a"))) {
- logfile = stderr;
- must_close = 0;
- }
- fprintf(logfile, "[%s:%s(%d)->%s()] ",
- last_file, last_call, last_line, last_fn);
- if (must_close) {
- fflush(logfile);
- fclose(logfile);
- }
-}
-
-static void hinder(void)
-{
- if (on(PAM_MALLOC_PAUSE)) {
- if (on(0)) err(("pause requested"));
- sleep(pam_malloc_delay_length);
- }
-
- if (on(PAM_MALLOC_STOP)) {
- if (on(0)) err(("stop requested"));
- exit(1);
- }
-}
-
-/*
- * here are the memory pointer registering functions.. these actually
- * use malloc(!) but that's ok! ;^)
- */
-
-struct reference {
- void *ptr; /* pointer */
- int nelements; /* number of elements */
- int size; /* - each of this size */
- char *file; /* where it was requested - filename */
- char *function; /* - function */
- int line; /* - line number */
-/*
- * linking info
- */
- struct reference *next;
-};
-
-static void _dump(const char *say, const struct reference *ref)
-{
- _pam_output_debug(" <%s: %p (#%d of %d) req. by %s(); %s line %d>\n"
- , say
- , ref->ptr,ref->nelements,ref->size
- , ref->function,ref->file,ref->line);
-}
-
-static struct reference *root=NULL;
-
-static char *_strdup(const char *x)
-{
- char *s;
-
- s = (char *)malloc(strlen(x)+1);
- if (s == NULL) {
- if (on(0)) err(("_strdup failed"));
- exit(1);
- }
-
- strcpy(s,x);
- return s;
-}
-
-static void add_new_ref(void *new, int n, int size)
-{
- struct reference *ref=NULL;
-
- ref = (struct reference *) malloc( sizeof(struct reference) );
- if (new == NULL || ref == NULL) {
- if (on(0)) err(("internal error {add_new_ref}"));
- exit(1);
- }
-
- ref->ptr = new;
- ref->nelements = n;
- ref->size = size;
-
- ref->file = _strdup(last_file);
- ref->function = _strdup(last_call);
- ref->line = last_line;
-
- ref->next = root;
-
- if (on(PAM_MALLOC_REQUEST)) {
- _dump("new_ptr", ref);
- }
-
- root = ref;
-}
-
-static void del_old_ref(void *old)
-{
- struct reference *this,*last;
-
- if (old == NULL) {
- if (on(0)) err(("internal error {del_old_ref}"));
- exit(1);
- }
-
- /* locate old pointer */
-
- last = NULL;
- this = root;
- while (this) {
- if (this->ptr == old)
- break;
- last = this;
- this = this->next;
- }
-
- /* Did we find a reference ? */
-
- if (this) {
- if (on(PAM_MALLOC_FREE)) {
- _dump("free old_ptr", this);
- }
- if (last == NULL) {
- root = this->next;
- } else {
- last->next = this->next;
- }
- free(this->file);
- free(this->function);
- free(this);
- } else {
- if (on(0)) err(("ERROR!: bad memory"));
- hinder();
- }
-}
-
-static void verify_old_ref(void *old)
-{
- struct reference *this;
-
- if (old == NULL) {
- if (on(0)) err(("internal error {verify_old_ref}"));
- exit(1);
- }
-
- /* locate old pointer */
-
- this = root;
- while (this) {
- if (this->ptr == old)
- break;
- this = this->next;
- }
-
- /* Did we find a reference ? */
-
- if (this) {
- if (on(PAM_MALLOC_VERIFY)) {
- _dump("verify_ptr", this);
- }
- } else {
- if (on(0)) err(("ERROR!: bad request"));
- hinder();
- }
-}
-
-static void dump_memory_list(const char *dump)
-{
- struct reference *this;
-
- this = root;
- if (this) {
- if (on(0)) err(("un-free()'d memory"));
- while (this) {
- _dump(dump, this);
- this = this->next;
- }
- } else {
- if (on(0)) err(("no memory allocated"));
- }
-}
-
-/* now for the wrappers */
-
-#define _fn(x) set_last_(x,file,fn,line)
-
-void *pam_malloc(size_t size, const char *file, const char *fn, const int line)
-{
- void *new;
-
- _fn("malloc");
-
- if (on(PAM_MALLOC_FUNC)) err(("request for %d", size));
-
- new = malloc(size);
- if (new == NULL) {
- if (on(PAM_MALLOC_FAIL)) err(("returned NULL"));
- } else {
- if (on(PAM_MALLOC_REQUEST)) err(("request new"));
- add_new_ref(new, 1, size);
- }
-
- return new;
-}
-
-void *pam_calloc(size_t nelm, size_t size
- , const char *file, const char *fn, const int line)
-{
- void *new;
-
- _fn("calloc");
-
- if (on(PAM_MALLOC_FUNC)) err(("request for %d of %d", nelm, size));
-
- new = calloc(nelm,size);
- if (new == NULL) {
- if (on(PAM_MALLOC_FAIL)) err(("returned NULL"));
- } else {
- if (on(PAM_MALLOC_REQUEST)) err(("request new"));
- add_new_ref(new, nelm, size);
- }
-
- return new;
-}
-
-void pam_free(void *ptr
- , const char *file, const char *fn, const int line)
-{
- _fn("free");
-
- if (on(PAM_MALLOC_FUNC)) err(("request to free %p", ptr));
-
- if (ptr == NULL) {
- if (on(PAM_MALLOC_NULL)) err(("passed NULL pointer"));
- } else {
- if (on(PAM_MALLOC_FREE)) err(("deleted old"));
- del_old_ref(ptr);
- free(ptr);
- }
-}
-
-void *pam_memalign(size_t ali, size_t size
- , const char *file, const char *fn, const int line)
-{
- _fn("memalign");
- if (on(0)) err(("not implemented currently (Sorry)"));
- exit(1);
-}
-
-void *pam_realloc(void *ptr, size_t size
- , const char *file, const char *fn, const int line)
-{
- void *new;
-
- _fn("realloc");
-
- if (on(PAM_MALLOC_FUNC)) err(("resize %p to %d", ptr, size));
-
- if (ptr == NULL) {
- if (on(PAM_MALLOC_NULL)) err(("passed NULL pointer"));
- } else {
- verify_old_ref(ptr);
- }
-
- new = realloc(ptr, size);
- if (new == NULL) {
- if (on(PAM_MALLOC_FAIL)) err(("returned NULL"));
- } else {
- if (ptr) {
- if (on(PAM_MALLOC_FREE)) err(("deleted old"));
- del_old_ref(ptr);
- } else {
- if (on(PAM_MALLOC_NULL)) err(("old is NULL"));
- }
- if (on(PAM_MALLOC_REQUEST)) err(("request new"));
- add_new_ref(new, 1, size);
- }
-
- return new;
-}
-
-void *pam_valloc(size_t size
- , const char *file, const char *fn, const int line)
-{
- _fn("valloc");
- if (on(0)) err(("not implemented currently (Sorry)"));
- exit(1);
-}
-
-#include <alloca.h>
-
-void *pam_alloca(size_t size
- , const char *file, const char *fn, const int line)
-{
- _fn("alloca");
- if (on(0)) err(("not implemented currently (Sorry)"));
- exit(1);
-}
-
-void pam_exit(int i
- , const char *file, const char *fn, const int line)
-{
- _fn("exit");
-
- if (on(0)) err(("passed (%d)", i));
- if (on(PAM_MALLOC_LEAKED)) {
- dump_memory_list("leaked");
- }
- exit(i);
-}
-
-/* end of file */
diff --git a/contrib/libpam/libpam/pam_map.c b/contrib/libpam/libpam/pam_map.c
deleted file mode 100644
index 6e186b703bb0..000000000000
--- a/contrib/libpam/libpam/pam_map.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* pam_map.c - PAM mapping interface
- *
- * $Id$
- *
- * This is based on the X/Open XSSO specification of March 1997.
- * It is not implemented as it is going to change... after 1997/9/25.
- *
- * $Log$
- */
-
-#include <stdio.h>
-
-#include "pam_private.h"
-
-/* p 54 */
-
-int pam_get_mapped_authtok(pam_handle_t *pamh,
- const char *target_module_username,
- const char *target_module_type,
- const char *target_authn_domain,
- size_t *target_authtok_len
- unsigned char **target_module_authtok);
-{
- D(("called"));
-
- IF_NO_PAMH("pam_get_mapped_authtok",pamh,PAM_SYSTEM_ERR);
-
- return PAM_SYSTEM_ERROR;
-}
-
-/* p 68 */
-
-int pam_set_mapped_authtok(pam_handle_t *pamh,
- char *target_module_username,
- size_t *target_authtok_len,
- unsigned char *target_module_authtok,
- char *target_module_type,
- char *target_authn_domain)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_set_mapped_authtok",pamh,PAM_SYSTEM_ERR);
-
- return PAM_SYSTEM_ERROR;
-}
-
-/* p 56 */
-
-int pam_get_mapped_username(pam_handle_t *pamh,
- const char *src_username,
- const char *src_module_type,
- const char *src_authn_domain,
- const char *target_module_type,
- const char *target_authn_domain,
- char **target_module_username)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_get_mapped_username",pamh,PAM_SYSTEM_ERR);
-
- return PAM_SYSTEM_ERROR;
-}
-
-/* p 70 */
-
-int pam_set_mapped_username(pam_handle_t *pamh,
- char *src_username,
- char *src_module_type,
- char *src_authn_domain,
- char *target_module_username,
- char *target_module_type,
- char *target_authn_domain)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_set_mapped_username",pamh,PAM_SYSTEM_ERR);
-
- return PAM_SYSTEM_ERROR;
-}
diff --git a/contrib/libpam/libpam/pam_misc.c b/contrib/libpam/libpam/pam_misc.c
deleted file mode 100644
index 6fed9ba126b9..000000000000
--- a/contrib/libpam/libpam/pam_misc.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/* pam_misc.c -- This is random stuff */
-
-/* $Id: pam_misc.c,v 1.9 1997/04/05 06:56:19 morgan Exp $
- *
- * $Log: pam_misc.c,v $
- * Revision 1.9 1997/04/05 06:56:19 morgan
- * enforce AUTHTOK restrictions
- *
- * Revision 1.8 1997/02/15 15:59:46 morgan
- * modified ..strCMP comment
- *
- * Revision 1.7 1996/12/01 03:14:13 morgan
- * use _pam_macros.h
- *
- * Revision 1.6 1996/11/10 20:05:52 morgan
- * name convention _pam_ enforced. Also modified _pam_strdup()
- *
- * Revision 1.5 1996/07/07 23:57:14 morgan
- * deleted debuggin function and replaced it with a static function
- * defined in pam_private.h
- *
- * Revision 1.4 1996/06/02 08:00:56 morgan
- * added StrTok function
- *
- * Revision 1.3 1996/05/21 04:36:58 morgan
- * added debugging information
- * replaced the _pam_log need for a local buffer with a call to vsyslog()
- * [Al Longyear had some segfaulting problems related to this]
- *
- * Revision 1.2 1996/03/16 21:55:13 morgan
- * changed pam_mkargv to _pam_mkargv
- *
- */
-
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <syslog.h>
-#include <ctype.h>
-
-#include "pam_private.h"
-
-/* caseless string comparison: POSIX does not define this.. */
-int _pam_strCMP(const char *s, const char *t)
-{
- int cf;
-
- do {
- cf = tolower(*s) - tolower(*t);
- ++t;
- } while (!cf && *s++);
-
- return cf;
-}
-
-char *_pam_StrTok(char *from, const char *format, char **next)
-/*
- * this function is a variant of the standard strtok, it differs in that
- * it takes an additional argument and doesn't nul terminate tokens until
- * they are actually reached.
- */
-{
- char table[256], *end;
- int i;
-
- if (from == NULL && (from = *next) == NULL)
- return from;
-
- /* initialize table */
- for (i=1; i<256; table[i++] = '\0');
- for (i=0; format[i] ; table[(int)format[i++]] = 'y');
-
- /* look for first non-blank char */
- while (*from && table[(int)*from]) {
- ++from;
- }
-
- if (*from == '[') {
- /*
- * special case, "[...]" is considered to be a single
- * object. Note, however, if one of the format[] chars is
- * '[' this single string will not be read correctly.
- */
- for (end=++from; *end && *end != ']'; ++end) {
- if (*end == '\\' && end[1] == ']')
- ++end;
- }
- /* note, this string is stripped of its edges: "..." is what
- remains */
- } else if (*from) {
- /* simply look for next blank char */
- for (end=from; *end && !table[(int)*end]; ++end);
- } else {
- return (*next = NULL); /* no tokens left */
- }
-
- /* now terminate what we have */
- if (*end)
- *end++ = '\0';
-
- /* indicate what it left */
- if (*end) {
- *next = end;
- } else {
- *next = NULL; /* have found last token */
- }
-
- /* return what we have */
- return from;
-}
-
-/*
- * Safe duplication of character strings. "Paranoid"; don't leave
- * evidence of old token around for later stack analysis.
- */
-
-char *_pam_strdup(const char *x)
-{
- register char *new=NULL;
-
- if (x != NULL) {
- register int i;
-
- for (i=0; x[i]; ++i); /* length of string */
- if ((new = malloc(++i)) == NULL) {
- i = 0;
- pam_system_log(NULL, NULL, LOG_CRIT,
- "_pam_strdup: failed to get memory");
- } else {
- while (i-- > 0) {
- new[i] = x[i];
- }
- }
- x = NULL;
- }
-
- return new; /* return the duplicate or NULL on error */
-}
-
-/* Generate argv, argc from s */
-/* caller must free(argv) */
-
-int _pam_mkargv(char *s, char ***argv, int *argc)
-{
- int l;
- int argvlen = 0;
- char *sbuf, *sbuf_start;
- char **our_argv = NULL;
- char **argvbuf;
- char *argvbufp;
-#ifdef DEBUG
- int count=0;
-#endif
-
- D(("_pam_mkargv called: %s",s));
-
- *argc = 0;
-
- l = strlen(s);
- if (l) {
- if ((sbuf = sbuf_start = _pam_strdup(s)) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_mkargv: null returned by _pam_strdup");
- D(("arg NULL"));
- } else {
- /* Overkill on the malloc, but not large */
- argvlen = (l + 1) * ((sizeof(char)) + sizeof(char *));
- if ((our_argv = argvbuf = malloc(argvlen)) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_mkargv: null returned by malloc");
- } else {
- char *tmp=NULL;
-
- argvbufp = (char *) argvbuf + (l * sizeof(char *));
- D(("[%s]",sbuf));
- while ((sbuf = _pam_StrTok(sbuf, " \n\t", &tmp))) {
- D(("arg #%d",++count));
- D(("->[%s]",sbuf));
- strcpy(argvbufp, sbuf);
- D(("copied token"));
- *argvbuf = argvbufp;
- argvbufp += strlen(argvbufp) + 1;
- D(("stepped in argvbufp"));
- (*argc)++;
- argvbuf++;
- sbuf = NULL;
- D(("loop again?"));
- }
- _pam_drop(sbuf_start);
- }
- }
- }
-
- *argv = our_argv;
-
- D(("_pam_mkargv returned"));
-
- return(argvlen);
-}
-
-/*
- * this function is used to protect the modules from accidental or
- * semi-mallicious harm that an application may do to confuse the API.
- */
-
-void _pam_sanitize(pam_handle_t *pamh)
-{
- /*
- * this is for security. We reset the auth-tokens here.
- */
- pam_set_item(pamh,PAM_AUTHTOK,NULL);
- pam_set_item(pamh,PAM_OLDAUTHTOK,NULL);
-}
-
-/*
- * This function scans the array and replaces the _PAM_ACTION_UNDEF
- * entries with the default action.
- */
-
-void _pam_set_default_control(int *control_array, int default_action)
-{
- int i;
-
- for (i=0; i<_PAM_RETURN_VALUES; ++i) {
- if (control_array[i] == _PAM_ACTION_UNDEF) {
- control_array[i] = default_action;
- }
- }
-}
-
-/*
- * This function is used to parse a control string. This string is a
- * series of tokens of the following form:
- *
- * "[ ]*return_code[ ]*=[ ]*action/[ ]".
- */
-
-#include "pam_tokens.h"
-
-void _pam_parse_control(int *control_array, char *tok)
-{
- const char *error;
- int ret;
-
- while (*tok) {
- int act, len;
-
- /* skip leading space */
- while (isspace(*tok) && *++tok);
- if (!*tok)
- break;
-
- /* identify return code */
- for (ret=0; ret<=_PAM_RETURN_VALUES; ++ret) {
- len = strlen(_pam_token_returns[ret]);
- if (!strncmp(_pam_token_returns[ret], tok, len)) {
- break;
- }
- }
- if (ret > _PAM_RETURN_VALUES || !*(tok += len)) {
- error = "expecting return value";
- goto parse_error;
- }
-
- /* observe '=' */
- while (isspace(*tok) && *++tok);
- if (!*tok || *tok++ != '=') {
- error = "expecting '='";
- goto parse_error;
- }
-
- /* skip leading space */
- while (isspace(*tok) && *++tok);
- if (!*tok) {
- error = "expecting action";
- goto parse_error;
- }
-
- /* observe action type */
- for (act=0; act<=-_PAM_ACTION_UNDEF; ++act) {
- len = strlen(_pam_token_actions[act]);
- if (!strncmp(_pam_token_actions[act], tok, len)) {
- act *= -1;
- tok += len;
- break;
- }
- }
- if (act > 0) {
- /*
- * Either we have a number or we have hit an error. In
- * principle, there is nothing to stop us accepting
- * negative offsets. (Although we would have to think of
- * another way of encoding the tokens.) However, I really
- * think this would be both hard to administer and easily
- * cause looping problems. So, for now, we will just
- * allow forward jumps. (AGM 1998/1/7)
- */
- if (!isdigit(*tok)) {
- error = "expecting jump number";
- goto parse_error;
- }
- /* parse a number */
- act = 0;
- do {
- act *= 10;
- act += *tok - '0'; /* XXX - this assumes ascii behavior */
- } while (*++tok && isdigit(*tok));
- if (! act) {
- /* we do not allow 0 jumps. There is a token ('ignore')
- for that */
- error = "expecting non-zero";
- goto parse_error;
- }
- }
-
- /* set control_array element */
- if (ret != _PAM_RETURN_VALUES) {
- control_array[ret] = act;
- } else {
- /* set the default to 'act' */
- _pam_set_default_control(control_array, act);
- }
- }
-
- /* that was a success */
- return;
-
-parse_error:
- /* treat everything as bad */
- pam_system_log(NULL, NULL, LOG_ERR, "pam_parse: %s; [...%s]", error, tok);
- for (ret=0; ret<_PAM_RETURN_VALUES; control_array[ret++]=_PAM_ACTION_BAD);
-
-}
diff --git a/contrib/libpam/libpam/pam_password.c b/contrib/libpam/libpam/pam_password.c
deleted file mode 100644
index 303425ab6254..000000000000
--- a/contrib/libpam/libpam/pam_password.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* pam_password.c - PAM Password Management */
-
-/*
- * $Id: pam_password.c,v 1.7 1997/04/05 06:56:45 morgan Exp $
- *
- * $Log: pam_password.c,v $
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pam_private.h"
-
-int pam_chauthtok(pam_handle_t *pamh, int flags)
-{
- int retval;
-
- D(("called."));
-
- IF_NO_PAMH("pam_chauthtok", pamh, PAM_SYSTEM_ERR);
-
- if (pamh->former.choice == PAM_NOT_STACKED) {
- _pam_start_timer(pamh); /* we try to make the time for a failure
- independent of the time it takes to
- fail */
- _pam_sanitize(pamh);
- pamh->former.update = PAM_FALSE;
- }
-
- /* first loop through to check if there will be a problem */
- if (pamh->former.update ||
- (retval = _pam_dispatch(pamh, flags|PAM_PRELIM_CHECK,
- PAM_CHAUTHTOK)) == PAM_SUCCESS) {
- pamh->former.update = PAM_TRUE;
- retval = _pam_dispatch(pamh, flags|PAM_UPDATE_AUTHTOK,
- PAM_CHAUTHTOK);
- }
-
- /* if we completed we should clean up */
- if (retval != PAM_INCOMPLETE) {
- _pam_sanitize(pamh);
- pamh->former.update = PAM_FALSE;
- _pam_await_timer(pamh, retval); /* if unsuccessful then wait now */
- D(("pam_authenticate exit"));
- } else {
- D(("will resume when ready"));
- }
-
- return retval;
-}
-
diff --git a/contrib/libpam/libpam/pam_private.h b/contrib/libpam/libpam/pam_private.h
deleted file mode 100644
index f8a0da54fc94..000000000000
--- a/contrib/libpam/libpam/pam_private.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * pam_private.h
- *
- * $Id: pam_private.h,v 1.12 1997/04/05 06:57:37 morgan Exp morgan $
- *
- * This is the Linux-PAM Library Private Header. It contains things
- * internal to the Linux-PAM library. Things not needed by either an
- * application or module.
- *
- * Please see end of file for copyright.
- *
- * Creator: Marc Ewing.
- * Maintained: AGM
- *
- * $Log: pam_private.h,v $
- */
-
-#ifndef _PAM_PRIVATE_H
-#define _PAM_PRIVATE_H
-
-/* this is not used at the moment --- AGM */
-#define LIBPAM_VERSION 65
-
-#include <security/pam_appl.h>
-#include <security/pam_modules.h>
-
-/* the Linux-PAM configuration file */
-
-#define PAM_CONFIG "/etc/pam.conf"
-#define PAM_CONFIG_D "/etc/pam.d"
-#define PAM_CONFIG_DF "/etc/pam.d/%s"
-
-#define PAM_DEFAULT_SERVICE "other" /* lower case */
-#define PAM_DEFAULT_SERVICE_FILE PAM_CONFIG_D "/" PAM_DEFAULT_SERVICE
-
-#ifdef PAM_LOCKING
-/*
- * the Linux-PAM lock file. If it exists Linux-PAM will abort. Use it
- * to block access to libpam
- */
-#define PAM_LOCK_FILE "/var/lock/subsys/PAM"
-#endif
-
-/* components of the pam_handle structure */
-
-struct handler {
- int must_fail;
- int (*func)(pam_handle_t *pamh, int flags, int argc, char **argv);
- int actions[_PAM_RETURN_VALUES];
- int argc;
- char **argv;
- struct handler *next;
-};
-
-struct loaded_module {
- char *name;
- int type; /* PAM_STATIC_MOD or PAM_DYNAMIC_MOD */
- void *dl_handle;
-};
-
-#define PAM_MT_DYNAMIC_MOD 0
-#define PAM_MT_STATIC_MOD 1
-#define PAM_MT_FAULTY_MOD 2
-
-struct handlers {
- struct handler *authenticate;
- struct handler *setcred;
- struct handler *acct_mgmt;
- struct handler *open_session;
- struct handler *close_session;
- struct handler *chauthtok;
-};
-
-struct service {
- struct loaded_module *module; /* Only used for dynamic loading */
- int modules_allocated;
- int modules_used;
- int handlers_loaded;
-
- struct handlers conf; /* the configured handlers */
- struct handlers other; /* the default handlers */
-};
-
-/*
- * Environment helper functions
- */
-
-#define PAM_ENV_CHUNK 10 /* chunks of memory calloc()'d *
- * at once */
-
-struct pam_environ {
- int entries; /* the number of pointers available */
- int requested; /* the number of pointers used: *
- * 1 <= requested <= entries */
- char **list; /* the environment storage (a list *
- * of pointers to malloc() memory) */
-};
-
-#include <sys/time.h>
-
-typedef enum { PAM_FALSE, PAM_TRUE } _pam_boolean;
-
-struct _pam_fail_delay {
- _pam_boolean set;
- unsigned int delay;
- time_t begin;
- const void *delay_fn_ptr;
-};
-
-struct _pam_former_state {
-/* this is known and set by _pam_dispatch() */
- int choice; /* which flavor of module function did we call? */
-
-/* state info for the _pam_dispatch_aux() function */
- int depth; /* how deep in the stack were we? */
- int impression; /* the impression at that time */
- int status; /* the status before returning incomplete */
-
-/* state info used by pam_get_user() function */
- int want_user;
- char *prompt; /* saved prompt information */
-
-/* state info for the pam_chauthtok() function */
- _pam_boolean update;
-};
-
-struct pam_handle {
- char *authtok;
- struct pam_conv *pam_conversation;
- char *oldauthtok;
- char *prompt; /* for use by pam_get_user() */
- char *service_name;
- char *user;
- char *rhost;
- char *ruser;
- char *tty;
- struct pam_log_state pam_default_log; /* for ident etc., log state */
- struct pam_data *data;
- struct pam_environ *env; /* structure to maintain environment list */
- struct _pam_fail_delay fail_delay; /* helper function for easy delays */
- struct service handlers;
- struct _pam_former_state former; /* library state - support for
- event driven applications */
-};
-
-/* Values for select arg to _pam_dispatch() */
-#define PAM_NOT_STACKED 0
-#define PAM_AUTHENTICATE 1
-#define PAM_SETCRED 2
-#define PAM_ACCOUNT 3
-#define PAM_OPEN_SESSION 4
-#define PAM_CLOSE_SESSION 5
-#define PAM_CHAUTHTOK 6
-
-#define _PAM_ACTION_IS_JUMP(x) ((x) > 0)
-#define _PAM_ACTION_IGNORE 0
-#define _PAM_ACTION_OK -1
-#define _PAM_ACTION_DONE -2
-#define _PAM_ACTION_BAD -3
-#define _PAM_ACTION_DIE -4
-#define _PAM_ACTION_RESET -5
-/* Add any new entries here. Will need to change ..._UNDEF and then
- * need to change pam_tokens.h */
-#define _PAM_ACTION_UNDEF -6 /* this is treated as an error
- ( = _PAM_ACTION_BAD) */
-
-/* character tables for parsing config files */
-extern const char * const _pam_token_actions[-_PAM_ACTION_UNDEF];
-extern const char * const _pam_token_returns[_PAM_RETURN_VALUES+1];
-
-/*
- * internally defined functions --- these should not be directly
- * called by applications or modules
- */
-int _pam_dispatch(pam_handle_t *pamh, int flags, int choice);
-
-/* Free various allocated structures and dlclose() the libs */
-int _pam_free_handlers(pam_handle_t *pamh);
-
-/* Parse config file, allocate handler structures, dlopen() */
-int _pam_init_handlers(pam_handle_t *pamh);
-
-/* Set all hander stuff to 0/NULL - called once from pam_start() */
-void _pam_start_handlers(pam_handle_t *pamh);
-
-/* environment helper functions */
-
-/* create the environment structure */
-int _pam_make_env(pam_handle_t *pamh);
-
-/* delete the environment structure */
-void _pam_drop_env(pam_handle_t *pamh);
-
-#ifdef LINUX_PAM
-
-/* these functions deal with failure delays as required by the
- authentication modules and application. Their *interface* is likely
- to remain the same although their function is hopefully going to
- improve */
-
-/* reset the timer to no-delay */
-void _pam_reset_timer(pam_handle_t *pamh);
-
-/* this sets the clock ticking */
-void _pam_start_timer(pam_handle_t *pamh);
-
-/* this waits for the clock to stop ticking if status != PAM_SUCCESS */
-void _pam_await_timer(pam_handle_t *pamh, int status);
-
-
-#endif /* LINUX_PAM */
-
-typedef void (*voidfunc(void))(void);
-#ifdef PAM_STATIC
-
-/* The next two in ../modules/_pam_static/pam_static.c */
-
-/* Return pointer to data structure used to define a static module */
-struct pam_module * _pam_open_static_handler(char *path);
-
-/* Return pointer to function requested from static module */
-
-voidfunc *_pam_get_static_sym(struct pam_module *mod, const char *symname);
-
-#endif
-
-/* For now we just use a stack and linear search for module data. */
-/* If it becomes apparent that there is a lot of data, it should */
-/* changed to either a sorted list or a hash table. */
-
-struct pam_data {
- char *name;
- void *data;
- void (*cleanup)(pam_handle_t *pamh, void *data, int error_status);
- struct pam_data *next;
-};
-
-void _pam_free_data(pam_handle_t *pamh, int status);
-
-int _pam_strCMP(const char *s, const char *t);
-char *_pam_StrTok(char *from, const char *format, char **next);
-
-char *_pam_strdup(const char *s);
-
-int _pam_mkargv(char *s, char ***argv, int *argc);
-
-void _pam_sanitize(pam_handle_t *pamh);
-
-void _pam_set_default_control(int *control_array, int default_action);
-
-void _pam_parse_control(int *control_array, char *tok);
-
-/*
- * XXX - Take care with this. It could confuse the logic of a trailing
- * else
- */
-
-#define IF_NO_PAMH(X,pamh,ERR) \
-if ((pamh) == NULL) { \
- pam_system_log(NULL, NULL, LOG_ERR, X ": NULL pam handle passed"); \
- return ERR; \
-}
-
-/* Definition for the default username prompt used by pam_get_user() */
-
-#define PAM_DEFAULT_PROMPT "Please enter username: "
-
-/*
- * pam_system_log default ident/facility..
- */
-
-#define PAM_LOG_STATE_DEFAULT { \
- PAM_LOG_STATE_IDENT, \
- PAM_LOG_STATE_OPTION, \
- PAM_LOG_STATE_FACILITY \
-}
-
-/*
- * include some helpful macros
- */
-
-#include <security/_pam_macros.h>
-
-/*
- * Copyright (C) 1995 by Red Hat Software, Marc Ewing
- * Copyright (c) 1996-8, Andrew G. Morgan <morgan@linux.kernel.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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * 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.
- */
-
-#endif /* _PAM_PRIVATE_H_ */
diff --git a/contrib/libpam/libpam/pam_second.c b/contrib/libpam/libpam/pam_second.c
deleted file mode 100644
index b720774e7e61..000000000000
--- a/contrib/libpam/libpam/pam_second.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * pam_second.c -- PAM secondary authentication
- * (based on XSSO draft spec of March 1997)
- *
- * $Id$
- *
- * $Log$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pam_private.h"
-
-/* p 42 */
-
-int pam_authenticate_secondary(pam_handle_t *pamh,
- char *target_username,
- char *target_module_type,
- char *target_authn_domain,
- char *target_supp_data,
- unsigned char *target_module_authtok,
- int flags)
-{
- int retval=PAM_SYSTEM_ERR;
-
- D(("called"));
-
- _pam_start_timer(pamh); /* we try to make the time for a failure
- independent of the time it takes to
- fail */
-
- IF_NO_PAMH("pam_authenticate_secondary",pamh,PAM_SYSTEM_ERR);
-
- _pam_await_timer(pamh, retval); /* if unsuccessful then wait now */
-
- D(("pam_authenticate_secondary exit"));
-
- return retval;
-}
diff --git a/contrib/libpam/libpam/pam_session.c b/contrib/libpam/libpam/pam_session.c
deleted file mode 100644
index 38b93fe70549..000000000000
--- a/contrib/libpam/libpam/pam_session.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* pam_session.c - PAM Session Management */
-
-/*
- * $Id: pam_session.c,v 1.3 1996/12/01 03:14:13 morgan Exp $
- *
- * $Log: pam_session.c,v $
- * Revision 1.3 1996/12/01 03:14:13 morgan
- * use _pam_macros.h
- *
- * Revision 1.2 1996/03/10 02:19:12 morgan
- * some oversight meant that this wasn't being compiled. It needed a
- * couple of changes.
- *
- *
- */
-
-#include <stdio.h>
-
-#include "pam_private.h"
-
-int pam_open_session(pam_handle_t *pamh, int flags)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_open_session",pamh,PAM_SYSTEM_ERR);
- return _pam_dispatch(pamh, flags, PAM_OPEN_SESSION);
-}
-
-int pam_close_session(pam_handle_t *pamh, int flags)
-{
- D(("called"));
-
- IF_NO_PAMH("pam_close_session",pamh,PAM_SYSTEM_ERR);
- return _pam_dispatch(pamh, flags, PAM_CLOSE_SESSION);
-}
diff --git a/contrib/libpam/libpam/pam_start.c b/contrib/libpam/libpam/pam_start.c
deleted file mode 100644
index 53700a091029..000000000000
--- a/contrib/libpam/libpam/pam_start.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* pam_start.c */
-
-/* Creator Marc Ewing
- * Maintained by AGM
- *
- * $Id: pam_start.c,v 1.10 1997/04/05 06:58:11 morgan Exp $
- *
- * $Log: pam_start.c,v $
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <syslog.h>
-
-#include "pam_private.h"
-
-int pam_start (
- const char *service_name,
- const char *user,
- const struct pam_conv *pam_conversation,
- pam_handle_t **pamh)
-{
- D(("called pam_start: [%s] [%s] [%p] [%p]"
- ,service_name, user, pam_conversation, pamh));
-
- if ((*pamh = calloc(1, sizeof(**pamh))) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_start: calloc failed for *pamh");
- return (PAM_BUF_ERR);
- }
-
- if (service_name) {
- char *tmp;
-
- if (((*pamh)->service_name = _pam_strdup(service_name)) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_start: _pam_strdup failed for service name");
- _pam_drop(*pamh);
- return (PAM_BUF_ERR);
- }
- for (tmp=(*pamh)->service_name; *tmp; ++tmp)
- *tmp = tolower(*tmp); /* require lower case */
- } else
- (*pamh)->service_name = NULL;
-
- if (user) {
- if (((*pamh)->user = _pam_strdup(user)) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_start: _pam_strdup failed for user");
- _pam_drop((*pamh)->service_name);
- _pam_drop(*pamh);
- return (PAM_BUF_ERR);
- }
- } else
- (*pamh)->user = NULL;
-
- (*pamh)->tty = NULL;
- (*pamh)->prompt = NULL; /* prompt for pam_get_user() */
- (*pamh)->ruser = NULL;
- (*pamh)->rhost = NULL;
- (*pamh)->authtok = NULL;
- (*pamh)->oldauthtok = NULL;
- (*pamh)->fail_delay.delay_fn_ptr = NULL;
- (*pamh)->former.choice = PAM_NOT_STACKED;
-
- if (pam_conversation == NULL
- || ((*pamh)->pam_conversation = (struct pam_conv *)
- malloc(sizeof(struct pam_conv))) == NULL) {
- pam_system_log(NULL, NULL, LOG_CRIT,
- "pam_start: malloc failed for pam_conv");
- _pam_drop((*pamh)->service_name);
- _pam_drop((*pamh)->user);
- _pam_drop(*pamh);
- return (PAM_BUF_ERR);
- } else {
- memcpy((*pamh)->pam_conversation, pam_conversation,
- sizeof(struct pam_conv));
- }
-
- (*pamh)->data = NULL;
- if ( _pam_make_env(*pamh) != PAM_SUCCESS ) {
- pam_system_log(NULL, NULL, LOG_ERR,
- "pam_start: failed to initialize environment");
- _pam_drop((*pamh)->service_name);
- _pam_drop((*pamh)->user);
- _pam_drop(*pamh);
- return PAM_ABORT;
- }
-
- _pam_reset_timer(*pamh); /* initialize timer support */
-
- _pam_start_handlers(*pamh); /* cannot fail */
-
- /* According to the SunOS man pages, loading modules and resolving
- * symbols happens on the first call from the application. */
-
- /*
- * XXX - should we call _pam_init_handlers() here ? The following
- * is new as of Linux-PAM 0.55
- */
-
- if ( _pam_init_handlers(*pamh) != PAM_SUCCESS ) {
- pam_system_log(NULL, NULL, LOG_ERR,
- "pam_start: failed to initialize handlers");
- _pam_drop_env(*pamh); /* purge the environment */
- _pam_drop((*pamh)->service_name);
- _pam_drop((*pamh)->user);
- _pam_drop(*pamh);
- return PAM_ABORT;
- }
-
- D(("exiting pam_start successfully"));
-
- return PAM_SUCCESS;
-}
diff --git a/contrib/libpam/libpam/pam_static.c b/contrib/libpam/libpam/pam_static.c
deleted file mode 100644
index c94895ea86fb..000000000000
--- a/contrib/libpam/libpam/pam_static.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* pam_static.c -- static module loading helper functions */
-
-/* created by Michael K. Johnson, johnsonm@redhat.com
- *
- * $Id: pam_static.c,v 1.4 1996/12/01 03:14:13 morgan Exp $
- *
- * $Log: pam_static.c,v $
- * Revision 1.4 1996/12/01 03:14:13 morgan
- * use _pam_macros.h
- *
- * Revision 1.3 1996/11/10 20:09:16 morgan
- * name convention change _pam_
- *
- * Revision 1.2 1996/06/02 08:02:56 morgan
- * Michael's minor alterations
- *
- * Revision 1.1 1996/05/26 04:34:04 morgan
- * Initial revision
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "pam_private.h"
-
-/* This whole file is only used for PAM_STATIC */
-
-#ifdef PAM_STATIC
-
-extern struct linker_set _pam_static_modules;
-
-/* Return pointer to data structure used to define a static module */
-struct pam_module * _pam_open_static_handler(char *path) {
- int i;
- char *lpath = path, *end;
- struct pam_module **static_modules =
- (struct pam_module **)_pam_static_modules.ls_items;
-
- if (strchr(lpath, '/')) {
- /* ignore path and leading "/" */
- lpath = strrchr(lpath, '/') + 1;
- }
- /* create copy to muck with (must free before return) */
- lpath = _pam_strdup(lpath);
- /* chop .so off copy if it exists (or other extension on other
- platform...) */
- end = strstr(lpath, ".so");
- if (end) {
- *end = '\0';
- }
-
- /* now go find the module */
- for (i = 0; static_modules[i] != NULL; i++) {
- D(("%s=?%s\n", lpath, static_modules[i]->name));
- if (static_modules[i]->name &&
- ! strcmp(static_modules[i]->name, lpath)) {
- break;
- }
- }
-
- free(lpath);
- return (static_modules[i]);
-}
-
-/* Return pointer to function requested from static module
- * Can't just return void *, because ANSI C disallows casting a
- * pointer to a function to a void *...
- * This definition means:
- * _pam_get_static_sym is a function taking two arguments and
- * returning a pointer to a function which takes no arguments
- * and returns void... */
-voidfunc *_pam_get_static_sym(struct pam_module *mod, const char *symname) {
-
- if (! strcmp(symname, "pam_sm_authenticate")) {
- return ((voidfunc *)mod->pam_sm_authenticate);
- } else if (! strcmp(symname, "pam_sm_setcred")) {
- return ((voidfunc *)mod->pam_sm_setcred);
- } else if (! strcmp(symname, "pam_sm_acct_mgmt")) {
- return ((voidfunc *)mod->pam_sm_acct_mgmt);
- } else if (! strcmp(symname, "pam_sm_open_session")) {
- return ((voidfunc *)mod->pam_sm_open_session);
- } else if (! strcmp(symname, "pam_sm_close_session")) {
- return ((voidfunc *)mod->pam_sm_close_session);
- } else if (! strcmp(symname, "pam_sm_chauthtok")) {
- return ((voidfunc *)mod->pam_sm_chauthtok);
- }
- /* getting to this point is an error */
- return ((voidfunc *)NULL);
-}
-
-#endif /* PAM_STATIC */
-
-/*
- * Copyright (C) 1995 by Red Hat Software, Michael K. Johnson
- * 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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * 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.
- */
diff --git a/contrib/libpam/libpam/pam_strerror.c b/contrib/libpam/libpam/pam_strerror.c
deleted file mode 100644
index 607c6d5dbfef..000000000000
--- a/contrib/libpam/libpam/pam_strerror.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* pam_strerror.c */
-
-/* $Id: pam_strerror.c,v 1.6 1997/01/04 20:12:02 morgan Exp morgan $
- *
- * $Log: pam_strerror.c,v $
- * Revision 1.6 1997/01/04 20:12:02 morgan
- * replaced conditional FAIL_NOW with ABORT
- *
- * Revision 1.5 1996/07/07 23:58:56 morgan
- * corrected "... " to "..."
- *
- * Revision 1.4 1996/06/02 08:03:29 morgan
- * spelling correction
- *
- * Revision 1.3 1996/03/16 23:08:54 morgan
- * PAM --> Linux-PAM ;)
- *
- */
-
-#include "pam_private.h"
-
-const char *pam_strerror(pam_handle_t *pamh, int errnum)
-{
-#ifdef UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT /* will be removed from v 1.0 */
-
- int possible_error;
-
- possible_error = (int) pamh;
- if (!(possible_error >= 0 && possible_error <= PAM_BAD_ITEM)) {
- possible_error = errnum;
- }
-
-/* mask standard behavior to use possible_error variable. */
-#define errnum possible_error
-
-#endif /* UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT */
-
- switch (errnum) {
- case PAM_SUCCESS:
- return "Success";
- case PAM_ABORT:
- return "Critical error - immediate abort";
- case PAM_OPEN_ERR:
- return "dlopen() failure";
- case PAM_SYMBOL_ERR:
- return "Symbol not found";
- case PAM_SERVICE_ERR:
- return "Error in service module";
- case PAM_SYSTEM_ERR:
- return "System error";
- case PAM_BUF_ERR:
- return "Memory buffer error";
- case PAM_PERM_DENIED:
- return "Permission denied";
- case PAM_AUTH_ERR:
- return "Authentication failure";
- case PAM_CRED_INSUFFICIENT:
- return "Insufficient credentials to access authentication data";
- case PAM_AUTHINFO_UNAVAIL:
- return "Authentication service cannot retrieve authentication info.";
- case PAM_USER_UNKNOWN:
- return "User not known to the underlying authentication module";
- case PAM_MAXTRIES:
- return "Have exhasted maximum number of retries for service.";
- case PAM_NEW_AUTHTOK_REQD:
- return "Authentication token is no longer valid; new one required.";
- case PAM_ACCT_EXPIRED:
- return "User account has expired";
- case PAM_SESSION_ERR:
- return "Cannot make/remove an entry for the specified session";
- case PAM_CRED_UNAVAIL:
- return "Authentication service cannot retrieve user credentials";
- case PAM_CRED_EXPIRED:
- return "User credentials expired";
- case PAM_CRED_ERR:
- return "Failure setting user credentials";
- case PAM_NO_MODULE_DATA:
- return "No module specific data is present";
- case PAM_BAD_ITEM:
- return "Bad item passed to pam_*_item()";
- case PAM_CONV_ERR:
- return "Conversation error";
- case PAM_AUTHTOK_ERR:
- return "Authentication token manipulation error";
- case PAM_AUTHTOK_RECOVER_ERR:
- return "Authentication information cannot be recovered";
- case PAM_AUTHTOK_LOCK_BUSY:
- return "Authentication token lock busy";
- case PAM_AUTHTOK_DISABLE_AGING:
- return "Authentication token aging disabled";
- case PAM_TRY_AGAIN:
- return "Failed preliminary check by password service";
- case PAM_IGNORE:
- return "Please ignore underlying account module";
- case PAM_MODULE_UNKNOWN:
- return "Module is unknown";
- case PAM_AUTHTOK_EXPIRED:
- return "Authentication token expired";
- case PAM_CONV_AGAIN:
- return "Conversation is waiting for event";
- case PAM_INCOMPLETE:
- return "Application needs to call libpam again";
- }
-
- return "Unknown Linux-PAM error (need to upgrde libpam?)";
-}
diff --git a/contrib/libpam/libpam/pam_tokens.h b/contrib/libpam/libpam/pam_tokens.h
deleted file mode 100644
index 9380f8837b96..000000000000
--- a/contrib/libpam/libpam/pam_tokens.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * pam_tokens.h
- *
- * $Id$
- *
- * This is a Linux-PAM Library Private Header file. It contains tokens
- * that are used when we parse the configuration file(s).
- *
- * Please see end of file for copyright.
- *
- * Creator: Andrew Morgan.
- *
- * $Log$
- */
-
-#ifndef _PAM_TOKENS_H
-#define _PAM_TOKENS_H
-
-/* an array of actions */
-
-const char * const _pam_token_actions[-_PAM_ACTION_UNDEF] = {
- "ignore", /* 0 */
- "ok", /* -1 */
- "done", /* -2 */
- "bad", /* -3 */
- "die", /* -4 */
- "reset", /* -5 */
-};
-
-/* an array of possible return values */
-
-const char * const _pam_token_returns[_PAM_RETURN_VALUES+1] = {
- "success", /* 0 */
- "open_err", /* 1 */
- "symbol_err", /* 2 */
- "service_err", /* 3 */
- "system_err", /* 4 */
- "buf_err", /* 5 */
- "perm_denied", /* 6 */
- "auth_err", /* 7 */
- "cred_insufficient", /* 8 */
- "authinfo_unavail", /* 9 */
- "user_unknown", /* 10 */
- "maxtries", /* 11 */
- "new_authtok_reqd", /* 12 */
- "acct_expired", /* 13 */
- "session_err", /* 14 */
- "cred_unavail", /* 15 */
- "cred_expired", /* 16 */
- "cred_err", /* 17 */
- "no_module_data", /* 18 */
- "conv_err", /* 19 */
- "authtok_err", /* 20 */
- "authtok_recover_err", /* 21 */
- "authtok_lock_busy", /* 22 */
- "authtok_disable_aging", /* 23 */
- "try_again", /* 24 */
- "ignore", /* 25 */
- "abort", /* 26 */
- "authtok_expired", /* 27 */
- "module_unknown", /* 28 */
- "bad_item", /* 29 */
-/* add new return codes here */
- "default" /* this is _PAM_RETURN_VALUES and indicates
- the default return action */
-};
-
-/*
- * Copyright (C) 1998, Andrew G. Morgan <morgan@linux.kernel.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, and the entire permission notice in its entirety,
- * including the disclaimer of warranties.
- * 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.
- *
- * ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
- * required INSTEAD OF the above restrictions. (This clause is
- * necessary due to a potential bad interaction between the GPL and
- * the restrictions contained in a BSD-style copyright.)
- *
- * 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.
- */
-
-#endif /* _PAM_PRIVATE_H_ */
diff --git a/contrib/libpam/libpam_misc/Makefile b/contrib/libpam/libpam_misc/Makefile
deleted file mode 100644
index 1cfc86577b1f..000000000000
--- a/contrib/libpam/libpam_misc/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
-# $Header: /home/morgan/pam/Linux-PAM-0.57/libpam_misc/RCS/Makefile,v 1.10 1997/04/05 07:00:18 morgan Exp $
-#
-# $Log: Makefile,v $
-# Revision 1.10 1997/04/05 07:00:18 morgan
-# fakeroot
-#
-# Revision 1.9 1997/02/15 15:46:56 morgan
-# inherit major and minor numbers from top level
-#
-# Revision 1.8 1997/01/04 20:20:11 morgan
-# update for .55 and make -> $(MAKE)
-#
-# Revision 1.7 1996/12/01 03:28:11 morgan
-# update for 0.54
-#
-
-dummy:
- @echo "*** This is not a top-level Makefile!"
-
-# ///////////////////////////////////////////////////////////////////
-
-# uncomment if you wnat libpam_misc to be made as a dynamic library
-# AGM has had some segfaulting from libdl when I did this. I have not
-# investigated the cause...
-
-MAKE_DYNAMIC=yes
-
-ifeq ($(DEBUG_REL),yes)
- LIBNAME=pamd_misc
-else
- LIBNAME=pam_misc
-endif
-LIBMAJOR=$(MAJOR_REL)
-LIBMINOR=$(MINOR_REL)
-
-FILES=misc_conv help_env
-
-#
-# Probably no need to alter anything below here.
-#
-
-# build dynamic library names
-
-LIBDYNAMIC=lib$(LIBNAME).$(DYNTYPE)
-LIBDYNMAJ=$(LIBDYNAMIC).$(LIBMAJOR)
-LIBDYNMIN=$(LIBDYNMAJ).$(LIBMINOR)
-
-# static library name
-
-LIBSTATIC = lib$(LIBNAME).a
-
-# sources and object files
-
-LIBSRC = $(addsuffix .c,$(FILES))
-LIBOBJ = $(addsuffix .o,$(FILES))
-
-# rules
-
-all: $(LIBSTATIC) $(LIBDYNAMIC)
-
-$(LIBDYNAMIC): $(LIBOBJ)
-ifdef MAKE_DYNAMIC
- ifeq ($(USESONAME),yes)
- $(LD_L) $(SOSWITCH) $(LIBDYNMAJ) -o $@ $(LIBOBJ)
- else
- $(LD_L) -o $@ $(LIBOBJ)
- endif
- ifeq ($(NEEDSONAME),yes)
- rm -f $(LIBDYNMIN)
- ln -s $(LIBDYNAMIC) $(LIBDYNMAJ)
- rm -f $(LIBDYNMAJ)
- ln -s $(LIBDYNAMIC) $(LIBDYNMIN)
- endif
-endif
-
-$(LIBSTATIC): $(LIBOBJ)
- $(AR) $@ $(LIBOBJ)
- $(RANLIB) $@
-
-install: all
- $(MKDIR) $(FAKEROOT)$(INCLUDED)
- $(INSTALL) -m 644 ./pam_misc.h $(FAKEROOT)$(INCLUDED)
-ifdef MAKE_DYNAMIC
- $(INSTALL) -m $(SHLIBMODE) $(LIBDYNAMIC) $(FAKEROOT)$(LIBDIR)/$(LIBDYNMIN)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
- ( cd $(FAKEROOT)$(LIBDIR) ; ln -sf $(LIBDYNMAJ) $(LIBDYNAMIC) )
- endif
-endif
- $(INSTALL) -m 644 $(LIBSTATIC) $(FAKEROOT)$(LIBDIR)
-
-clean:
- rm -f *.so *.a core a.out *~
-
-remove:
- rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBDYNAMIC).*
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBDYNAMIC)
- $(LDCONFIG)
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBSTATIC)
- rm -f $(FAKEROOT)$(INCLUDED)/chk_malloc.h
-
-.c.o:
- $(CC) -c $(DEFS) $(CFLAGS) $<
-
-extraclean:
- @$(MAKE) clean
- rm -f *.o *.bak
-
diff --git a/contrib/libpam/libpam_misc/help_env.c b/contrib/libpam/libpam_misc/help_env.c
deleted file mode 100644
index d35b66b948ca..000000000000
--- a/contrib/libpam/libpam_misc/help_env.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * $Id: help_env.c,v 1.2 1997/01/04 20:19:20 morgan Exp morgan $
- *
- * This file was written by Andrew G. Morgan <morgan@parc.power.net>
- *
- * $Log: help_env.c,v $
- * Revision 1.2 1997/01/04 20:19:20 morgan
- * added a prototype (no warning) and fixed paste function
- *
- * Revision 1.1 1996/12/01 03:25:37 morgan
- * Initial revision
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <security/pam_misc.h>
-
-/*
- * This is a useful function for dumping the Linux-PAM environment
- * into some local memory, prior to it all getting lost when pam_end()
- * is called.
- *
- * Initially it was assumed that libpam did not do this part correctly
- * (based on a loose email definition). The X/Open XSSO spec makes it
- * clear that this function is a duplicate of the one already in
- * libpam and therefore unnecessary. IT WILL BE COMPLETELY REMOVED
- * IN libpam_misc 1.0 */
-
-char **pam_misc_copy_env(pam_handle_t *pamh);
-char **pam_misc_copy_env(pam_handle_t *pamh)
-{
- return pam_getenvlist(pamh);
-}
-
-/*
- * This function should be used to carefully dispose of the copied
- * environment.
- *
- * usage: env = pam_misc_drop_env(env);
- */
-
-char **pam_misc_drop_env(char **dump)
-{
- int i;
-
- for (i=0; dump[i] != NULL; ++i) {
- D(("dump[%d]=`%s'", i, dump[i]));
- _pam_overwrite(dump[i]);
- _pam_drop(dump[i]);
- }
- _pam_drop(dump);
-
- return NULL;
-}
-
-/*
- * This function takes the supplied environment and uploads it to be
- * the PAM one.
- */
-
-int pam_misc_paste_env(pam_handle_t *pamh, const char * const * user_env)
-{
- for (; user_env && *user_env; ++user_env) {
- int retval;
-
- D(("uploading: %s", *user_env));
- retval = pam_putenv(pamh, *user_env);
- if (retval != PAM_SUCCESS) {
- D(("error setting %s: %s", *user_env, pam_strerror(pamh,retval)));
- return retval;
- }
- }
- D(("done."));
- return PAM_SUCCESS;
-}
-
-/*
- * This is a wrapper to make pam behave in the way that setenv() does.
- */
-
-int pam_misc_setenv(pam_handle_t *pamh, const char *name
- , const char *value, int readonly)
-{
- char *tmp;
- int retval;
-
- if (readonly) {
- const char *etmp;
-
- /* we check if the variable is there already */
- etmp = pam_getenv(pamh, name);
- if (etmp != NULL) {
- D(("failed to set readonly variable: %s", name));
- return PAM_PERM_DENIED; /* not allowed to overwrite */
- }
- }
- tmp = malloc(2+strlen(name)+strlen(value));
- if (tmp != NULL) {
- sprintf(tmp,"%s=%s",name,value);
- D(("pam_putt()ing: %s", tmp));
- retval = pam_putenv(pamh, tmp);
- _pam_overwrite(tmp); /* purge */
- _pam_drop(tmp); /* forget */
- } else {
- D(("malloc failure"));
- retval = PAM_BUF_ERR;
- }
-
- return retval;
-}
diff --git a/contrib/libpam/libpam_misc/misc_conv.c b/contrib/libpam/libpam_misc/misc_conv.c
deleted file mode 100644
index 53cf51b76ccc..000000000000
--- a/contrib/libpam/libpam_misc/misc_conv.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * $Id: misc_conv.c,v 1.5 1997/01/04 20:16:48 morgan Exp morgan $
- *
- * A generic conversation function for text based applications
- *
- * Written by Andrew Morgan <morgan@linux.kernel.org>
- *
- * $Log: misc_conv.c,v $
- * Revision 1.5 1997/01/04 20:16:48 morgan
- * removed getpass. Replaced with POSIX code for same function which
- * also observes timeouts specified by the parent application
- *
- * Revision 1.4 1996/12/01 03:26:51 morgan
- * *** empty log message ***
- *
- * Revision 1.3 1996/11/10 20:10:01 morgan
- * sgi definition
- *
- * Revision 1.2 1996/07/07 23:59:56 morgan
- * changed the name of the misc include file
- *
- * Revision 1.1 1996/05/02 05:17:06 morgan
- * Initial revision
- */
-
-#ifdef linux
-#define _GNU_SOURCE
-#include <features.h>
-#endif
-
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <termios.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <security/pam_appl.h>
-#include <security/pam_misc.h>
-
-#define INPUTSIZE PAM_MAX_MSG_SIZE /* maximum length of input+1 */
-#define CONV_ECHO_ON 1 /* types of echo state */
-#define CONV_ECHO_OFF 0
-
-/*
- * external timeout definitions - these can be overriden by the
- * application.
- */
-
-time_t pam_misc_conv_warn_time = 0; /* time when we warn */
-time_t pam_misc_conv_die_time = 0; /* time when we timeout */
-
-const char *pam_misc_conv_warn_line = "..\a.Time is running out...\n";
-const char *pam_misc_conv_die_line = "..\a.Sorry, your time is up!\n";
-
-int pam_misc_conv_died=0; /* application can probe this for timeout */
-
-static void pam_misc_conv_delete_binary(void **delete_me)
-{
- if (delete_me && *delete_me) {
- unsigned char *packet = *(unsigned char **)delete_me;
- int length;
-
- length = 4+(packet[0]<<24)+(packet[1]<<16)+(packet[2]<<8)+packet[3];
- memset(packet, 0, length);
- free(packet);
- *delete_me = packet = NULL;
- }
-}
-
-/* These function pointers are for application specific binary
- conversations. One or both of the arguments to the first function
- must be non-NULL. The first function must return PAM_SUCCESS or
- PAM_CONV_ERR. If input is non-NULL, a response is expected, this
- response should be malloc()'d and will eventually be free()'d by
- the calling module. The structure of this malloc()'d response is as
- follows:
-
- { int length, char data[length] }
-
- For convenience, the pointer used by the two function pointer
- prototypes is 'void *'.
-
- The ...free() fn pointer is used to discard a binary message that
- is not of the default form. It should be explicitly overwritten
- when using some other convention for the structure of a binary
- prompt (not recommended). */
-
-int (*pam_binary_handler_fn)(const void *send, void **receive) = NULL;
-void (*pam_binary_handler_free)(void **packet_p) = pam_misc_conv_delete_binary;
-
-/* the following code is used to get text input */
-
-volatile static int expired=0;
-
-/* return to the previous signal handling */
-static void reset_alarm(struct sigaction *o_ptr)
-{
- (void) alarm(0); /* stop alarm clock - if still ticking */
- (void) sigaction(SIGALRM, o_ptr, NULL);
-}
-
-/* this is where we intercept the alarm signal */
-static void time_is_up(int ignore)
-{
- expired = 1;
-}
-
-/* set the new alarm to hit the time_is_up() function */
-static int set_alarm(int delay, struct sigaction *o_ptr)
-{
- struct sigaction new_sig;
-
- sigemptyset(&new_sig.sa_mask);
- new_sig.sa_flags = 0;
- new_sig.sa_handler = time_is_up;
- if ( sigaction(SIGALRM, &new_sig, o_ptr) ) {
- return 1; /* setting signal failed */
- }
- if ( alarm(delay) ) {
- (void) sigaction(SIGALRM, o_ptr, NULL);
- return 1; /* failed to set alarm */
- }
- return 0; /* all seems to have worked */
-}
-
-/* return the number of seconds to next alarm. 0 = no delay, -1 = expired */
-static int get_delay(void)
-{
- time_t now;
-
- expired = 0; /* reset flag */
- (void) time(&now);
-
- /* has the quit time past? */
- if (pam_misc_conv_die_time && now >= pam_misc_conv_die_time) {
- fprintf(stderr,"%s",pam_misc_conv_die_line);
-
- pam_misc_conv_died = 1; /* note we do not reset the die_time */
- return -1; /* time is up */
- }
-
- /* has the warning time past? */
- if (pam_misc_conv_warn_time && now >= pam_misc_conv_warn_time) {
- fprintf(stderr, "%s", pam_misc_conv_warn_line);
- pam_misc_conv_warn_time = 0; /* reset warn_time */
-
- /* indicate remaining delay - if any */
-
- return (pam_misc_conv_die_time ? pam_misc_conv_die_time - now:0 );
- }
-
- /* indicate possible warning delay */
-
- if (pam_misc_conv_warn_time)
- return (pam_misc_conv_warn_time - now);
- else if (pam_misc_conv_die_time)
- return (pam_misc_conv_die_time - now);
- else
- return 0;
-}
-
-/* read a line of input string, giving prompt when appropriate */
-static char *read_string(int echo, const char *prompt)
-{
- struct termios term_before, term_tmp;
- char line[INPUTSIZE];
- struct sigaction old_sig;
- int delay, nc, have_term=0;
-
- D(("called with echo='%s', prompt='%s'.", echo ? "ON":"OFF" , prompt));
-
- if (isatty(STDIN_FILENO)) { /* terminal state */
-
- /* is a terminal so record settings and flush it */
- if ( tcgetattr(STDIN_FILENO, &term_before) != 0 ) {
- D(("<error: failed to get terminal settings>"));
- return NULL;
- }
- memcpy(&term_tmp, &term_before, sizeof(term_tmp));
- if (!echo) {
- term_tmp.c_lflag &= ~(ECHO);
- }
- have_term = 1;
-
- } else if (!echo) {
- D(("<warning: cannot turn echo off>"));
- }
-
- /* set up the signal handling */
- delay = get_delay();
-
- /* reading the line */
- while (delay >= 0) {
-
- fprintf(stderr, "%s", prompt);
- /* this may, or may not set echo off -- drop pending input */
- if (have_term)
- (void) tcsetattr(STDIN_FILENO, TCSAFLUSH, &term_tmp);
-
- if ( delay > 0 && set_alarm(delay, &old_sig) ) {
- D(("<failed to set alarm>"));
- break;
- } else {
- nc = read(STDIN_FILENO, line, INPUTSIZE-1);
- if (have_term) {
- (void) tcsetattr(STDIN_FILENO, TCSADRAIN, &term_before);
- if (!echo || expired) /* do we need a newline? */
- fprintf(stderr,"\n");
- }
- if ( delay > 0 ) {
- reset_alarm(&old_sig);
- }
- if (expired) {
- delay = get_delay();
- } else if (nc > 0) { /* we got some user input */
- char *input;
-
- if (nc > 0 && line[nc-1] == '\n') { /* <NUL> terminate */
- line[--nc] = '\0';
- } else {
- line[nc] = '\0';
- }
- input = x_strdup(line);
- _pam_overwrite(line);
-
- return input; /* return malloc()ed string */
- } else if (nc == 0) { /* Ctrl-D */
- D(("user did not want to type anything"));
- fprintf(stderr, "\n");
- break;
- }
- }
- }
-
- /* getting here implies that the timer expired */
- if (have_term)
- (void) tcsetattr(STDIN_FILENO, TCSADRAIN, &term_before);
-
- memset(line, 0, INPUTSIZE); /* clean up */
- return NULL;
-}
-
-/* end of read_string functions */
-
-int misc_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response, void *appdata_ptr)
-{
- int count=0;
- struct pam_response *reply;
-
- if (num_msg <= 0)
- return PAM_CONV_ERR;
-
- D(("allocating empty response structure array."));
-
- reply = (struct pam_response *) calloc(num_msg,
- sizeof(struct pam_response));
- if (reply == NULL) {
- D(("no memory for responses"));
- return PAM_CONV_ERR;
- }
-
- D(("entering conversation function."));
-
- for (count=0; count < num_msg; ++count) {
- char *string=NULL;
-
- switch (msgm[count]->msg_style) {
- case PAM_PROMPT_ECHO_OFF:
- string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
- if (string == NULL) {
- goto failed_conversation;
- }
- break;
- case PAM_PROMPT_ECHO_ON:
- string = read_string(CONV_ECHO_ON,msgm[count]->msg);
- if (string == NULL) {
- goto failed_conversation;
- }
- break;
- case PAM_ERROR_MSG:
- if (fprintf(stderr,"%s\n",msgm[count]->msg) < 0) {
- goto failed_conversation;
- }
- break;
- case PAM_TEXT_INFO:
- if (fprintf(stdout,"%s\n",msgm[count]->msg) < 0) {
- goto failed_conversation;
- }
- break;
- case PAM_BINARY_PROMPT:
- {
- void *pack_out=NULL;
- const void *pack_in = msgm[count]->msg;
-
- if (!pam_binary_handler_fn
- || pam_binary_handler_fn(pack_in, &pack_out) != PAM_SUCCESS
- || pack_out == NULL) {
- goto failed_conversation;
- }
- string = (char *) pack_out;
- pack_out = NULL;
-
- break;
- }
- case PAM_BINARY_MSG:
- {
- const void *pack_in = msgm[count]->msg;
- if (!pam_binary_handler_fn
- || pam_binary_handler_fn(pack_in, NULL) != PAM_SUCCESS) {
- goto failed_conversation;
- }
- break;
- }
- default:
- fprintf(stderr, "erroneous conversation (%d)\n"
- ,msgm[count]->msg_style);
- goto failed_conversation;
- }
-
- if (string) { /* must add to reply array */
- /* add string to list of responses */
-
- reply[count].resp_retcode = 0;
- reply[count].resp = string;
- string = NULL;
- }
- }
-
- /* New (0.59+) behavior is to always have a reply - this is
- compatable with the X/Open (March 1997) spec. */
- *response = reply;
- reply = NULL;
-
- return PAM_SUCCESS;
-
-failed_conversation:
-
- if (reply) {
- for (count=0; count<num_msg; ++count) {
- if (reply[count].resp == NULL) {
- continue;
- }
- switch (msgm[count]->msg_style) {
- case PAM_PROMPT_ECHO_ON:
- case PAM_PROMPT_ECHO_OFF:
- _pam_overwrite(reply[count].resp);
- free(reply[count].resp);
- break;
- case PAM_BINARY_PROMPT:
- pam_binary_handler_free((void **) &reply[count].resp);
- break;
- case PAM_ERROR_MSG:
- case PAM_TEXT_INFO:
- case PAM_BINARY_MSG:
- /* should not actually be able to get here... */
- free(reply[count].resp);
- }
- reply[count].resp = NULL;
- }
- /* forget reply too */
- free(reply);
- reply = NULL;
- }
-
- return PAM_CONV_ERR;
-}
-
diff --git a/contrib/libpam/libpam_misc/pam_misc.h b/contrib/libpam/libpam_misc/pam_misc.h
deleted file mode 100644
index 4823973a4f01..000000000000
--- a/contrib/libpam/libpam_misc/pam_misc.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $Id: pam_misc.h,v 1.3 1997/01/04 20:15:52 morgan Exp morgan $ */
-
-/* $Log: pam_misc.h,v $
- * Revision 1.3 1997/01/04 20:15:52 morgan
- * added timeout to misc_conv
- *
- * Revision 1.2 1996/12/01 03:27:00 morgan
- * add env prototypes
- *
- * Revision 1.1 1996/07/06 19:31:38 morgan
- * Initial revision
- *
- * Revision 1.1 1996/07/06 19:16:30 morgan
- * Initial revision
- */
-
-#ifndef __PAMMISC_H
-#define __PAMMISC_H
-
-#include <security/pam_appl.h>
-
-/* include some useful macros */
-
-#include <security/_pam_macros.h>
-
-/* functions defined in pam_misc.* libraries */
-
-extern int misc_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response, void *appdata_ptr);
-
-#include <time.h>
-
-extern time_t pam_misc_conv_warn_time; /* time that we should warn user */
-extern time_t pam_misc_conv_die_time; /* cut-off time for input */
-extern const char *pam_misc_conv_warn_line; /* warning notice */
-extern const char *pam_misc_conv_die_line; /* cut-off remark */
-extern int pam_misc_conv_died; /* 1 = cut-off time reached (0 not) */
-extern int (*pam_binary_handler_fn)(const void *send, void **receive);
-
-/*
- * Environment helper functions
- */
-
-/* transcribe given environment (to pam) */
-extern int pam_misc_paste_env(pam_handle_t *pamh
- , const char * const * user_env);
-
-/* char **pam_misc_copy_env(pam_handle_t *pamh);
-
- This is no longer defined as a prototype because the X/Open XSSO
- spec makes it clear that PAM's pam_getenvlist() does exactly
- what this was needed for.
-
- A wrapper is still provided in the pam_misc library - so that
- legacy applications will still work. But _BE_WARNED_ it will
- disappear by the release of libpam 1.0 . */
-
-/* delete environment as obtained from (pam_getenvlist) */
-extern char **pam_misc_drop_env(char **env);
-
-/* provide something like the POSIX setenv function for the (Linux-)PAM
- * environment. */
-
-extern int pam_misc_setenv(pam_handle_t *pamh, const char *name
- , const char *value, int readonly);
-
-#endif
-
-
-
diff --git a/contrib/libpam/libpam_misc/xstrdup.c b/contrib/libpam/libpam_misc/xstrdup.c
deleted file mode 100644
index 202112e38780..000000000000
--- a/contrib/libpam/libpam_misc/xstrdup.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $Header: /home/morgan/pam/Linux-PAM-0.53/libpam_misc/RCS/xstrdup.c,v 1.4 1996/11/10 20:10:56 morgan Exp $ */
-
-/*
- * $Log: xstrdup.c,v $
- * Revision 1.4 1996/11/10 20:10:56 morgan
- * modification for stack paranoia
- *
- */
-
-#include <stdlib.h>
-#include <security/pam_misc.h>
-
-/*
- * Safe duplication of character strings. "Paranoid"; don't leave
- * evidence of old token around for later stack analysis.
- */
-
-char *xstrdup(const char *x)
-{
- register char *new=NULL;
-
- if (x != NULL) {
- register int i;
-
- for (i=0; x[i]; ++i); /* length of string */
- if ((new = malloc(++i)) == NULL) {
- i = 0;
- } else {
- while (i-- > 0) {
- new[i] = x[i];
- }
- }
- x = NULL;
- }
-
- return new; /* return the duplicate or NULL on error */
-}
diff --git a/contrib/libpam/modules/register_static b/contrib/libpam/modules/register_static
deleted file mode 100755
index 2067ac7e98d1..000000000000
--- a/contrib/libpam/modules/register_static
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-if [ `basename $PWD` != "modules" ]; then
- echo "$0 must be run from the .../modules directory"
- exit 1
-fi
-
-merge_line ()
-{
- if [ $# != 3 ]; then
- echo "usage: merge_line token filename 'new line'"
- fi
- if [ -f $2 ]; then
-# remove any existing entry...
- grep -v "$1" $2 > tmp.$2
- rm -f $2
- mv {tmp.,}$2
- fi
- cat << EOT >> $2
-$3
-EOT
-
-}
-
-
-if [ $# -ne 2 ]; then
-
- cat << EOT 2>&1
-$0: this script takes TWO arguments:
- the 'alphanumeric label' of the module and the location of
- its object file from the .../modules/ directory
-EOT
- exit 1
-
-else
- echo "
- *> registering static module: $1 ($2) <*
-"
- merge_line "$1" _static_module_list "\
-extern struct pam_module _$1_modstruct;"
-
- merge_line "$1" _static_module_entry " &_$1_modstruct,"
- if [ -n "$2" ]; then
- merge_line "$2" _static_module_objects "../modules/$2"
- fi
-
-fi
-
-exit 0
diff --git a/contrib/nvi/perl_api/perl.xs b/contrib/nvi/perl_api/perl.xs
index 056b2d2cd13c..0b48cded5bfc 100644
--- a/contrib/nvi/perl_api/perl.xs
+++ b/contrib/nvi/perl_api/perl.xs
@@ -18,7 +18,6 @@ static const char sccsid[] = "@(#)perl.xs 8.27 (Berkeley) 10/16/96";
#endif /* not lint */
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/time.h>
@@ -31,7 +30,6 @@ static const char sccsid[] = "@(#)perl.xs 8.27 (Berkeley) 10/16/96";
#include <string.h>
#include <termios.h>
#include <unistd.h>
-#include <errno.h>
#include "../common/common.h"
@@ -144,7 +142,7 @@ perl_init(scrp)
perl_call_argv("VI::bootstrap", G_DISCARD, bootargs);
perl_eval("$SIG{__WARN__}='VI::Warn'");
- av_unshift(av = GvAVn(PL_incgv), 1);
+ av_unshift(av = GvAVn(incgv), 1);
av_store(av, 0, newSVpv(_PATH_PERLSCRIPTS,
sizeof(_PATH_PERLSCRIPTS)-1));
@@ -419,11 +417,11 @@ extern void boot_VI _((CV* cv));
static void
xs_init()
{
- char *file = __FILE__;
-
#ifdef HAVE_PERL_5_003_01
dXSUB_SYS;
#endif
+ char *file = __FILE__;
+
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("VI::bootstrap", boot_VI, file);
}
diff --git a/contrib/nvi/perl_api/perlsfio.c b/contrib/nvi/perl_api/perlsfio.c
index d507585aa48d..20ff4773495a 100644
--- a/contrib/nvi/perl_api/perlsfio.c
+++ b/contrib/nvi/perl_api/perlsfio.c
@@ -14,7 +14,6 @@ static const char sccsid[] = "@(#)perlsfio.c 8.1 (Berkeley) 9/24/96";
#endif /* not lint */
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/time.h>
@@ -27,7 +26,6 @@ static const char sccsid[] = "@(#)perlsfio.c 8.1 (Berkeley) 9/24/96";
#include <string.h>
#include <termios.h>
#include <unistd.h>
-#include <errno.h>
#include "../common/common.h"
diff --git a/contrib/perl5/lib/ExtUtils/MM_Unix.pm b/contrib/perl5/lib/ExtUtils/MM_Unix.pm
index 421bd5464f59..dc214789c71b 100644
--- a/contrib/perl5/lib/ExtUtils/MM_Unix.pm
+++ b/contrib/perl5/lib/ExtUtils/MM_Unix.pm
@@ -8,8 +8,8 @@ use strict;
use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_PERL_OBJECT
$Verbose %pm %static $Xsubpp_Version);
-$VERSION = substr q$Revision: 1.2 $, 10;
-# $Id: MM_Unix.pm,v 1.2 1998/09/09 13:10:46 markm Exp $
+$VERSION = substr q$Revision: 1.1.1.1 $, 10;
+# $Id: MM_Unix.pm,v 1.1.1.1 1998/09/09 06:59:54 markm Exp $
Exporter::import('ExtUtils::MakeMaker',
qw( $Verbose &neatvalue));
@@ -1707,12 +1707,11 @@ usually solves this kind of problem.
# prefix/lib/perl5/man/ INSTALLMAN1DIR
$replace_prefix = qq[\$\(PREFIX\)];
- $search_prefix = $self->catdir($configure_prefix,"local");
for $install_variable (qw/
INSTALLBIN
INSTALLSCRIPT
/) {
- $self->prefixify($install_variable,$search_prefix,$replace_prefix);
+ $self->prefixify($install_variable,$configure_prefix,$replace_prefix);
}
$search_prefix = $configure_prefix =~ /perl/ ?
$self->catdir($configure_prefix,"lib") :
diff --git a/contrib/sendmail/BuildTools/M4/depend/BSD.m4 b/contrib/sendmail/BuildTools/M4/depend/BSD.m4
index 83827a7a7f6f..661f69ec12ec 100644
--- a/contrib/sendmail/BuildTools/M4/depend/BSD.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/BSD.m4
@@ -1,4 +1,4 @@
-# @(#)BSD.m4 8.3 (Berkeley) 2/9/1998
+# @(#)BSD.m4 8.3 (Berkeley) 2/9/98
depend: ${BEFORE}
@mv Makefile Makefile.old
@sed -e '/^# Do not edit or remove this line or anything below it.$$/,$$d' < Makefile.old > Makefile
diff --git a/contrib/sendmail/BuildTools/M4/depend/CC-M.m4 b/contrib/sendmail/BuildTools/M4/depend/CC-M.m4
index 10d61b8ccebc..01d82662b1bc 100644
--- a/contrib/sendmail/BuildTools/M4/depend/CC-M.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/CC-M.m4
@@ -1,4 +1,4 @@
-# @(#)CC-M.m4 8.2 (Berkeley) 2/19/1998
+# @(#)CC-M.m4 8.2 (Berkeley) 2/19/98
depend: ${BEFORE}
@mv Makefile Makefile.old
@sed -e '/^# Do not edit or remove this line or anything below it.$$/,$$d' < Makefile.old > Makefile
diff --git a/contrib/sendmail/BuildTools/M4/depend/NCR.m4 b/contrib/sendmail/BuildTools/M4/depend/NCR.m4
index 22af77da8b5f..03e0c10dd387 100644
--- a/contrib/sendmail/BuildTools/M4/depend/NCR.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/NCR.m4
@@ -1,4 +1,4 @@
-# @(#)NCR.m4 8.3 (Berkeley) 2/19/1998
+# @(#)NCR.m4 8.3 (Berkeley) 2/19/98
depend: ${BEFORE}
@mv Makefile Makefile.old
@sed -e '/^# Do not edit or remove this line or anything below it.$$/,$$d' < Makefile.old > Makefile
diff --git a/contrib/sendmail/BuildTools/M4/depend/Solaris.m4 b/contrib/sendmail/BuildTools/M4/depend/Solaris.m4
index bf245f6fa191..cbdc618abfc8 100644
--- a/contrib/sendmail/BuildTools/M4/depend/Solaris.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/Solaris.m4
@@ -1,4 +1,4 @@
-# @(#)Solaris.m4 8.1 (Berkeley) 3/5/1998
+# @(#)Solaris.m4 8.1 (Berkeley) 3/5/98
depend: ${BEFORE}
@mv Makefile Makefile.old
@sed -e '/^# Do not edit or remove this line or anything below it.$$/,$$d' < Makefile.old > Makefile
diff --git a/contrib/sendmail/BuildTools/M4/depend/X11.m4 b/contrib/sendmail/BuildTools/M4/depend/X11.m4
index 3afbfe95d821..27f90361f4c3 100644
--- a/contrib/sendmail/BuildTools/M4/depend/X11.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/X11.m4
@@ -1,4 +1,4 @@
-# @(#)X11.m4 8.1 (Berkeley) 4/8/1998
+# @(#)X11.m4 8.1 (Berkeley) 4/8/98
depend: ${BEFORE}
makedepend -- ${COPTS} -- *.c
diff --git a/contrib/sendmail/BuildTools/M4/depend/generic.m4 b/contrib/sendmail/BuildTools/M4/depend/generic.m4
index 330d4cf2e072..e7452d9e3297 100644
--- a/contrib/sendmail/BuildTools/M4/depend/generic.m4
+++ b/contrib/sendmail/BuildTools/M4/depend/generic.m4
@@ -1,4 +1,4 @@
-# @(#)generic.m4 8.2 (Berkeley) 2/9/1998
+# @(#)generic.m4 8.2 (Berkeley) 2/9/98
# dependencies
# gross overkill, and yet still not quite enough....
${OBJS}: ${SRCDIR}/sendmail.h ${SRCDIR}/conf.h
diff --git a/contrib/sendmail/BuildTools/M4/header.m4 b/contrib/sendmail/BuildTools/M4/header.m4
index 087cf0e48dce..df216bb96714 100644
--- a/contrib/sendmail/BuildTools/M4/header.m4
+++ b/contrib/sendmail/BuildTools/M4/header.m4
@@ -8,7 +8,7 @@
#
# Definitions for Makefile construction for sendmail
#
-# @(#)header.m4 8.14 (Berkeley) 5/19/1998
+# @(#)header.m4 8.14 (Berkeley) 5/19/98
#
changecom(^A)
undefine(`format')
diff --git a/contrib/sendmail/BuildTools/OS/386BSD b/contrib/sendmail/BuildTools/OS/386BSD
index cb6ea87a796a..34af745c8a57 100644
--- a/contrib/sendmail/BuildTools/OS/386BSD
+++ b/contrib/sendmail/BuildTools/OS/386BSD
@@ -1,4 +1,4 @@
-# @(#)386BSD 8.1 (Berkeley) 1/30/1998
+# @(#)386BSD 8.1 (Berkeley) 1/30/98
define(`confENVDEF', ` -DMIME')
define(`confLIBS', `-lutil')
define(`confLINKS', `/usr/sbin/sendmail /usr/bin/newaliases \
diff --git a/contrib/sendmail/BuildTools/OS/A-UX b/contrib/sendmail/BuildTools/OS/A-UX
index 3a23f367d680..782106d7e155 100644
--- a/contrib/sendmail/BuildTools/OS/A-UX
+++ b/contrib/sendmail/BuildTools/OS/A-UX
@@ -1,4 +1,4 @@
-# @(#)A-UX 8.4 (Berkeley) 3/12/1998
+# @(#)A-UX 8.4 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-D_POSIX_SOURCE ')
define(`confLIBS', `-ldbm -lposix -lUTIL')
diff --git a/contrib/sendmail/BuildTools/OS/AIX b/contrib/sendmail/BuildTools/OS/AIX
index 03d8407a12b1..ebf1f123262a 100644
--- a/contrib/sendmail/BuildTools/OS/AIX
+++ b/contrib/sendmail/BuildTools/OS/AIX
@@ -1,4 +1,4 @@
-# @(#)AIX 8.6 (Berkeley) 3/12/1998
+# @(#)AIX 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-D_AIX3 ')
define(`confOPTIMIZE', `-g')
diff --git a/contrib/sendmail/BuildTools/OS/AIX.2 b/contrib/sendmail/BuildTools/OS/AIX.2
index 8cec811f59c1..3838e893631a 100644
--- a/contrib/sendmail/BuildTools/OS/AIX.2
+++ b/contrib/sendmail/BuildTools/OS/AIX.2
@@ -1,4 +1,4 @@
-# @(#)AIX.2 8.8 (Berkeley) 3/12/1998
+# @(#)AIX.2 8.8 (Berkeley) 3/12/98
PUSHDIVERT(1)
SMROOT= /usr/local/newmail
POPDIVERT
diff --git a/contrib/sendmail/BuildTools/OS/AIX.4.2 b/contrib/sendmail/BuildTools/OS/AIX.4.2
index 3e1be252ae6b..e302f5a11369 100644
--- a/contrib/sendmail/BuildTools/OS/AIX.4.2
+++ b/contrib/sendmail/BuildTools/OS/AIX.4.2
@@ -1,7 +1,7 @@
-# @(#)AIX.4.2 8.6 (Berkeley) 8/6/1998
+# @(#)AIX.4.2 8.5 (Berkeley) 3/14/98
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confENVDEF', `-D_AIX4=40200 ')
-define(`confOPTIMIZE', `-O3 -qstrict')
+define(`confOPTIMIZE', `-O3')
define(`confLIBS', `-ldbm')
define(`confSTDIR', `/etc')
define(`confHFDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/AIX.4.3 b/contrib/sendmail/BuildTools/OS/AIX.4.3
index 00688c6e903a..75a4272f04b0 100644
--- a/contrib/sendmail/BuildTools/OS/AIX.4.3
+++ b/contrib/sendmail/BuildTools/OS/AIX.4.3
@@ -1,7 +1,7 @@
-# @(#)AIX.4.3 8.5 (Berkeley) 8/6/1998
+# @(#)AIX.4.3 8.4 (Berkeley) 3/14/98
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confENVDEF', `-D_AIX4=40300 ')
-define(`confOPTIMIZE', `-O3 -qstrict')
+define(`confOPTIMIZE', `-O3')
define(`confCC', `/usr/bin/xlc')
define(`confLIBS', `-ldbm')
define(`confSTDIR', `/etc')
diff --git a/contrib/sendmail/BuildTools/OS/AIX.4.x b/contrib/sendmail/BuildTools/OS/AIX.4.x
index a427d07860d4..f08bfcb4a357 100644
--- a/contrib/sendmail/BuildTools/OS/AIX.4.x
+++ b/contrib/sendmail/BuildTools/OS/AIX.4.x
@@ -1,7 +1,7 @@
-# @(#)AIX.4.x 8.8 (Berkeley) 8/6/1998
+# @(#)AIX.4.x 8.7 (Berkeley) 3/14/98
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confENVDEF', `-D_AIX4 ')
-define(`confOPTIMIZE', `-O3 -qstrict')
+define(`confOPTIMIZE', `-O3')
define(`confLIBS', `-ldbm')
define(`confSTDIR', `/etc')
define(`confHFDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/Altos b/contrib/sendmail/BuildTools/OS/Altos
index 9865f9a14ec5..9c1f301d18d0 100644
--- a/contrib/sendmail/BuildTools/OS/Altos
+++ b/contrib/sendmail/BuildTools/OS/Altos
@@ -1,4 +1,4 @@
-# @(#)Altos 8.6 (Berkeley) 2/19/1998
+# @(#)Altos 8.6 (Berkeley) 2/19/98
define(`confCC', `gcc')
define(`confENVDEF', `-DALTOS_SYSTEM_V ')
define(`confLIBS', `-lsocket -lrpc')
diff --git a/contrib/sendmail/BuildTools/OS/BSD-OS b/contrib/sendmail/BuildTools/OS/BSD-OS
index 67a6243ddd01..58586dd596f3 100644
--- a/contrib/sendmail/BuildTools/OS/BSD-OS
+++ b/contrib/sendmail/BuildTools/OS/BSD-OS
@@ -1,4 +1,4 @@
-# @(#)BSD-OS 8.8 (Berkeley) 6/3/1998
+# @(#)BSD-OS 8.8 (Berkeley) 6/3/98
define(`confMAPDEF', `-DNEWDB -DMAP_REGEX')
define(`confENVDEF', `-DNETISO')
define(`confLIBS', `-lutil -lkvm')
diff --git a/contrib/sendmail/BuildTools/OS/BSD43 b/contrib/sendmail/BuildTools/OS/BSD43
index 6a04bef287c3..1bbccea2c7fa 100644
--- a/contrib/sendmail/BuildTools/OS/BSD43
+++ b/contrib/sendmail/BuildTools/OS/BSD43
@@ -1,4 +1,4 @@
-# @(#)BSD43 8.5 (Berkeley) 3/12/1998
+# @(#)BSD43 8.5 (Berkeley) 3/12/98
define(`confBEFORE', `unistd.h stddef.h stdlib.h dirent.h sys/time.h')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DoldBSD43 ')
diff --git a/contrib/sendmail/BuildTools/OS/CLIX b/contrib/sendmail/BuildTools/OS/CLIX
index 35b67a69752e..69f422965bbd 100644
--- a/contrib/sendmail/BuildTools/OS/CLIX
+++ b/contrib/sendmail/BuildTools/OS/CLIX
@@ -1,4 +1,4 @@
-# @(#)CLIX 8.8 (Berkeley) 3/12/1998
+# @(#)CLIX 8.8 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DCLIX ')
diff --git a/contrib/sendmail/BuildTools/OS/CRAYT3E.2.0.x b/contrib/sendmail/BuildTools/OS/CRAYT3E.2.0.x
index 4455e51ec816..6f5abb5de390 100644
--- a/contrib/sendmail/BuildTools/OS/CRAYT3E.2.0.x
+++ b/contrib/sendmail/BuildTools/OS/CRAYT3E.2.0.x
@@ -1,4 +1,4 @@
-# @(#)CRAYT3E.2.0.x 8.1 (Berkeley) 4/21/1998
+# @(#)CRAYT3E.2.0.x 8.1 (Berkeley) 4/21/98
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DUNICOS ')
define(`confOPTIMIZE', `-O')
diff --git a/contrib/sendmail/BuildTools/OS/CSOS b/contrib/sendmail/BuildTools/OS/CSOS
index e39218efe8c6..3a995c9496f2 100644
--- a/contrib/sendmail/BuildTools/OS/CSOS
+++ b/contrib/sendmail/BuildTools/OS/CSOS
@@ -1,4 +1,4 @@
-# @(#)CSOS 8.5 (Berkeley) 2/8/1998
+# @(#)CSOS 8.5 (Berkeley) 2/8/98
define(`confLIBS', `-lnet')
define(`confMBINDIR', `/usr/lib')
define(`confSBINDIR', `/usr/etc')
diff --git a/contrib/sendmail/BuildTools/OS/ConvexOS b/contrib/sendmail/BuildTools/OS/ConvexOS
index cdb81eb901c8..8ea990c6e664 100644
--- a/contrib/sendmail/BuildTools/OS/ConvexOS
+++ b/contrib/sendmail/BuildTools/OS/ConvexOS
@@ -1,4 +1,4 @@
-# @(#)ConvexOS 8.6 (Berkeley) 3/12/1998
+# @(#)ConvexOS 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DYPCOMPAT -DNIS')
define(`confENVDEF', `-D__STDC__ -d non_int_bit_field')
define(`confOPTIMIZE', `-g')
diff --git a/contrib/sendmail/BuildTools/OS/Dell b/contrib/sendmail/BuildTools/OS/Dell
index 55fc05179465..2b9c1ea44a1f 100644
--- a/contrib/sendmail/BuildTools/OS/Dell
+++ b/contrib/sendmail/BuildTools/OS/Dell
@@ -1,4 +1,4 @@
-# @(#)Dell 8.8 (Berkeley) 3/12/1998
+# @(#)Dell 8.8 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-D__svr4__ ')
diff --git a/contrib/sendmail/BuildTools/OS/DomainOS b/contrib/sendmail/BuildTools/OS/DomainOS
index 06b1e3825cac..ee6be2726b81 100644
--- a/contrib/sendmail/BuildTools/OS/DomainOS
+++ b/contrib/sendmail/BuildTools/OS/DomainOS
@@ -1,4 +1,4 @@
-# @(#)DomainOS 8.6 (Berkeley) 6/24/1998
+# @(#)DomainOS 8.6 (Berkeley) 6/24/98
define(`confCC', `cc -A nansi -A,systype,any -A,runtype,bsd4.3')
define(`confBEFORE', `unistd.h dirent.h')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/DomainOS.10.4 b/contrib/sendmail/BuildTools/OS/DomainOS.10.4
index c8a4acf06d26..a92051b6befd 100644
--- a/contrib/sendmail/BuildTools/OS/DomainOS.10.4
+++ b/contrib/sendmail/BuildTools/OS/DomainOS.10.4
@@ -1,4 +1,4 @@
-# @(#)DomainOS.10.4 8.1 (Berkeley) 6/24/1998
+# @(#)DomainOS.10.4 8.1 (Berkeley) 6/24/98
define(`confCC', `cc -A nansi -A,systype,any -A,runtype,bsd4.3')
define(`confBEFORE', `dirent.h')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/Dynix b/contrib/sendmail/BuildTools/OS/Dynix
index 0da6fb583c23..2781e49d1c1e 100644
--- a/contrib/sendmail/BuildTools/OS/Dynix
+++ b/contrib/sendmail/BuildTools/OS/Dynix
@@ -1,4 +1,4 @@
-# @(#)Dynix 8.7 (Berkeley) 2/26/1998
+# @(#)Dynix 8.7 (Berkeley) 2/26/98
define(`confCC', `gcc')
define(`confOPTIMIZE', `-O -g')
define(`confLIBS', `-lseq')
diff --git a/contrib/sendmail/BuildTools/OS/EWS-UX_V b/contrib/sendmail/BuildTools/OS/EWS-UX_V
index 7875fdce7f48..bf11275a2cd1 100644
--- a/contrib/sendmail/BuildTools/OS/EWS-UX_V
+++ b/contrib/sendmail/BuildTools/OS/EWS-UX_V
@@ -1,4 +1,4 @@
-# @(#)EWS-UX_V 8.6 (Berkeley) 3/12/1998
+# @(#)EWS-UX_V 8.6 (Berkeley) 3/12/98
define(`confCC', `/usr/abiccs/bin/cc -KOlimit=900')
define(`confBEFORE', `sysexits.h ndbm.h ndbm.o')
define(`confMAPDEF', `-DNDBM -DNIS')
diff --git a/contrib/sendmail/BuildTools/OS/FreeBSD b/contrib/sendmail/BuildTools/OS/FreeBSD
index baede69c7d7d..bec2c599060b 100644
--- a/contrib/sendmail/BuildTools/OS/FreeBSD
+++ b/contrib/sendmail/BuildTools/OS/FreeBSD
@@ -1,3 +1,3 @@
-# @(#)FreeBSD 8.5 (Berkeley) 3/12/1998
+# @(#)FreeBSD 8.5 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX')
define(`confLIBS', `-lutil')
diff --git a/contrib/sendmail/BuildTools/OS/HP-UX b/contrib/sendmail/BuildTools/OS/HP-UX
index 2ba83c9b5dda..66d71a45eed0 100644
--- a/contrib/sendmail/BuildTools/OS/HP-UX
+++ b/contrib/sendmail/BuildTools/OS/HP-UX
@@ -1,4 +1,4 @@
-# @(#)HP-UX 8.9 (Berkeley) 3/14/1998
+# @(#)HP-UX 8.9 (Berkeley) 3/14/98
define(`confCC', `cc -Aa -D_HPUX_SOURCE')
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confOPTIMIZE', `+O1')
diff --git a/contrib/sendmail/BuildTools/OS/HP-UX.10.x b/contrib/sendmail/BuildTools/OS/HP-UX.10.x
index 5deacd0eaeab..a4b3a816048f 100644
--- a/contrib/sendmail/BuildTools/OS/HP-UX.10.x
+++ b/contrib/sendmail/BuildTools/OS/HP-UX.10.x
@@ -1,4 +1,4 @@
-# @(#)HP-UX.10.x 8.10 (Berkeley) 3/21/1998
+# @(#)HP-UX.10.x 8.10 (Berkeley) 3/21/98
define(`confCC', `cc -Aa -D_HPUX_SOURCE')
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confENVDEF', `-DV4FS ')
diff --git a/contrib/sendmail/BuildTools/OS/HP-UX.11.x b/contrib/sendmail/BuildTools/OS/HP-UX.11.x
index 1717430a0611..9e13c58e979a 100644
--- a/contrib/sendmail/BuildTools/OS/HP-UX.11.x
+++ b/contrib/sendmail/BuildTools/OS/HP-UX.11.x
@@ -1,4 +1,4 @@
-# @(#)HP-UX.11.x 8.7 (Berkeley) 3/30/1998
+# @(#)HP-UX.11.x 8.7 (Berkeley) 3/30/98
define(`confCC', `cc -Ae')
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confENVDEF', `-DV4FS -DHPUX11 ')
diff --git a/contrib/sendmail/BuildTools/OS/IRIX b/contrib/sendmail/BuildTools/OS/IRIX
index ed5e3e23380c..dafbda6a5fb6 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX
+++ b/contrib/sendmail/BuildTools/OS/IRIX
@@ -1,4 +1,4 @@
-# @(#)IRIX 8.7 (Berkeley) 3/12/1998
+# @(#)IRIX 8.7 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DIRIX ')
define(`confLIBS', `-lmld -lmalloc -lsun')
diff --git a/contrib/sendmail/BuildTools/OS/IRIX.5.x b/contrib/sendmail/BuildTools/OS/IRIX.5.x
index 6d492a29c646..4ac44c29aea1 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX.5.x
+++ b/contrib/sendmail/BuildTools/OS/IRIX.5.x
@@ -1,4 +1,4 @@
-# @(#)IRIX.5.x 8.7 (Berkeley) 3/12/1998
+# @(#)IRIX.5.x 8.7 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DIRIX5 ')
define(`confLIBS', `-lmld -lmalloc')
diff --git a/contrib/sendmail/BuildTools/OS/IRIX.6.5 b/contrib/sendmail/BuildTools/OS/IRIX.6.5
index 1b34f2e6e6d2..3056ff449128 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX.6.5
+++ b/contrib/sendmail/BuildTools/OS/IRIX.6.5
@@ -1,4 +1,4 @@
-# @(#)IRIX.6.5 8.2 (Berkeley) 4/24/1998
+# @(#)IRIX.6.5 8.2 (Berkeley) 4/24/98
PUSHDIVERT(1)
# Select what ABI we are using -- see abi(5) for details
# -32 ~ IRIX 5.3 (default: -mips2)
diff --git a/contrib/sendmail/BuildTools/OS/IRIX.6.x b/contrib/sendmail/BuildTools/OS/IRIX.6.x
index 0424933da9bd..c52fd4ea41dc 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX.6.x
+++ b/contrib/sendmail/BuildTools/OS/IRIX.6.x
@@ -1,4 +1,4 @@
-# @(#)IRIX.6.x 8.11 (Berkeley) 4/24/1998
+# @(#)IRIX.6.x 8.11 (Berkeley) 4/24/98
PUSHDIVERT(1)
# Select what ABI we are using -- see abi(5) for details
# -32 ~ IRIX 5.3 (default: -mips2)
diff --git a/contrib/sendmail/BuildTools/OS/IRIX64.6.0 b/contrib/sendmail/BuildTools/OS/IRIX64.6.0
index e8b2e3a82f69..5226bb535c52 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX64.6.0
+++ b/contrib/sendmail/BuildTools/OS/IRIX64.6.0
@@ -1,4 +1,4 @@
-# @(#)IRIX64.6.0 8.10 (Berkeley) 3/12/1998
+# @(#)IRIX64.6.0 8.10 (Berkeley) 3/12/98
PUSHDIVERT(1)
# Select what ABI we are using -- see abi(5) for details
# -32 ~ IRIX 5.3 (default: -mips2)
diff --git a/contrib/sendmail/BuildTools/OS/IRIX64.6.1 b/contrib/sendmail/BuildTools/OS/IRIX64.6.1
index 1183766b1eab..4876a8807a47 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX64.6.1
+++ b/contrib/sendmail/BuildTools/OS/IRIX64.6.1
@@ -1,4 +1,4 @@
-# @(#)IRIX64.6.1 8.10 (Berkeley) 3/12/1998
+# @(#)IRIX64.6.1 8.10 (Berkeley) 3/12/98
PUSHDIVERT(1)
# Select what ABI we are using -- see abi(5) for details
# -32 ~ IRIX 5.3 (default: -mips2)
diff --git a/contrib/sendmail/BuildTools/OS/IRIX64.6.5 b/contrib/sendmail/BuildTools/OS/IRIX64.6.5
deleted file mode 100644
index d0281f5c070b..000000000000
--- a/contrib/sendmail/BuildTools/OS/IRIX64.6.5
+++ /dev/null
@@ -1,35 +0,0 @@
-# @(#)IRIX64.6.5 8.1 (Berkeley) 11/29/1998
-PUSHDIVERT(1)
-# Select what ABI we are using -- see abi(5) for details
-# -32 ~ IRIX 5.3 (default: -mips2)
-# - long and pointer are 32 bit
-# -n32 New to IRIX 6.2 (default: -mips3)
-# - long and pointer are 32 bit
-# -64 ~ IRIX 6.1 (default: -mips4)
-# - long and pointer are 64 bit
-# We force ABI here, so then it does not depend on CPU
-#
-# With IDO 6.2 (IRIX 6.2) you need subsystem compiler_dev.sw32.lib
-# for compilation with ABI=-n32 -- alternatively you can set ABI=-32
-# ABI=-64 requires subsystem compiler_dev.sw64.lib, but this runs
-# only with IRIX64 (ie. 64 bit kernels)
-#
-# NOTE: Do not set `confABI' in a site configuration file! The ABI MUST
-# be given on the Build command line using the -E parameter, e.g.:
-#
-# Build -E ABI=-n32
-#
-ABI= confABI
-POPDIVERT
-define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
-define(`confENVDEF', `-DIRIX6 -DHASSNPRINTF=1 ${ABI} ')
-define(`confLDOPTS', `${ABI}')
-define(`confMBINDIR', `/usr/lib')
-define(`confSBINDIR', `/usr/etc')
-define(`confUBINDIR', `/usr/bsd')
-define(`confEBINDIR', `/usr/lib')
-define(`confSBINGRP', `sys')
-define(`confSTDIR', `/var')
-define(`confHFDIR', `/etc')
-define(`confINSTALL', `${BUILDBIN}/install.sh')
-define(`confDEPEND_TYPE', `CC-M')
diff --git a/contrib/sendmail/BuildTools/OS/IRIX64.6.x b/contrib/sendmail/BuildTools/OS/IRIX64.6.x
index f105edf8ff43..503df04b42c6 100644
--- a/contrib/sendmail/BuildTools/OS/IRIX64.6.x
+++ b/contrib/sendmail/BuildTools/OS/IRIX64.6.x
@@ -1,4 +1,4 @@
-# @(#)IRIX64.6.x 8.11 (Berkeley) 4/24/1998
+# @(#)IRIX64.6.x 8.11 (Berkeley) 4/24/98
PUSHDIVERT(1)
# Select what ABI we are using -- see abi(5) for details
# -32 ~ IRIX 5.3 (default: -mips2)
diff --git a/contrib/sendmail/BuildTools/OS/ISC b/contrib/sendmail/BuildTools/OS/ISC
index 58b8b78aabc3..f07093f660b0 100644
--- a/contrib/sendmail/BuildTools/OS/ISC
+++ b/contrib/sendmail/BuildTools/OS/ISC
@@ -1,4 +1,4 @@
-# @(#)ISC 8.5 (Berkeley) 3/12/1998
+# @(#)ISC 8.5 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DISC_UNIX -D_POSIX_SOURCE -D_SYSV3 ')
define(`confLIBS', `-lyp -lrpc -lndbm -linet -lcposix')
diff --git a/contrib/sendmail/BuildTools/OS/KSR b/contrib/sendmail/BuildTools/OS/KSR
index 9169cba61437..d3931a464051 100644
--- a/contrib/sendmail/BuildTools/OS/KSR
+++ b/contrib/sendmail/BuildTools/OS/KSR
@@ -1,4 +1,4 @@
-# @(#)KSR 8.4 (Berkeley) 3/12/1998
+# @(#)KSR 8.4 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confLIBDIRS', `-L/usr/shlib -L/usr/lib')
define(`confLIBS', `-ldbm')
diff --git a/contrib/sendmail/BuildTools/OS/LUNA b/contrib/sendmail/BuildTools/OS/LUNA
index e4637c9f72d1..2a0fe1d78c22 100644
--- a/contrib/sendmail/BuildTools/OS/LUNA
+++ b/contrib/sendmail/BuildTools/OS/LUNA
@@ -1,4 +1,4 @@
-# @(#)LUNA 8.8 (Berkeley) 3/12/1998
+# @(#)LUNA 8.8 (Berkeley) 3/12/98
define(`confBEFORE', `dirent.h stddef.h stdlib.h unistd.h limits.h time.h sys/time.h')
define(`confMAPDEF', `-DNDBM')
define(`confMBINDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/Linux b/contrib/sendmail/BuildTools/OS/Linux
index 306c9efce756..e908c478a944 100644
--- a/contrib/sendmail/BuildTools/OS/Linux
+++ b/contrib/sendmail/BuildTools/OS/Linux
@@ -1,4 +1,4 @@
-# @(#)Linux 8.4 (Berkeley) 3/22/1998
+# @(#)Linux 8.4 (Berkeley) 3/22/98
define(`confSTDIR', `/etc')
define(`confHFDIR', `/usr/lib')
define(`confDEPEND_TYPE', `CC-M')
diff --git a/contrib/sendmail/BuildTools/OS/Linux.ppc b/contrib/sendmail/BuildTools/OS/Linux.ppc
index e0712e372834..d2c3cafa7ca7 100644
--- a/contrib/sendmail/BuildTools/OS/Linux.ppc
+++ b/contrib/sendmail/BuildTools/OS/Linux.ppc
@@ -1,3 +1,3 @@
-# @(#)Linux.ppc 8.3 (Berkeley) 2/12/1998
+# @(#)Linux.ppc 8.3 (Berkeley) 2/12/98
define(`confHFDIR', `/usr/lib')
define(`confSBINGRP', `mail')
diff --git a/contrib/sendmail/BuildTools/OS/Mach386 b/contrib/sendmail/BuildTools/OS/Mach386
index 7ff806e445b8..981478120463 100644
--- a/contrib/sendmail/BuildTools/OS/Mach386
+++ b/contrib/sendmail/BuildTools/OS/Mach386
@@ -1,4 +1,4 @@
-# @(#)Mach386 8.6 (Berkeley) 3/12/1998
+# @(#)Mach386 8.6 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confLIBS', `-ldbm')
diff --git a/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.2.x b/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.2.x
index bd76038a975a..74d733401675 100644
--- a/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.2.x
+++ b/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.2.x
@@ -1,4 +1,4 @@
-# @(#)NCR.MP-RAS.2.x 8.9 (Berkeley) 3/12/1998
+# @(#)NCR.MP-RAS.2.x 8.9 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DNCR_MP_RAS2 ')
define(`confOPTIMIZE', `-O2')
diff --git a/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.3.x b/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.3.x
index 7af96677d888..14e02e3ab05c 100644
--- a/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.3.x
+++ b/contrib/sendmail/BuildTools/OS/NCR.MP-RAS.3.x
@@ -1,10 +1,10 @@
-# @(#)NCR.MP-RAS.3.x 8.10 (Berkeley) 8/6/1998
+# @(#)NCR.MP-RAS.3.x 8.9 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DNCR_MP_RAS3 ')
define(`confOPTIMIZE', `-O2')
define(`confINCDIRS', `-I/usr/include -I/usr/ucbinclude')
define(`confLIBDIRS', `-L/usr/ucblib')
-define(`confLIBS', `-lresolv -lsocket -lnsl -lelf -lc -lucb')
+define(`confLIBS', `-lsocket -lnsl -lelf -lc -lucb')
define(`confMBINDIR', `/usr/ucblib')
define(`confSBINDIR', `/usr/ucbetc')
define(`confUBINDIR', `/usr/ucb')
diff --git a/contrib/sendmail/BuildTools/OS/NEWS-OS.4.x b/contrib/sendmail/BuildTools/OS/NEWS-OS.4.x
index 71aa4d46b31b..4fa83bbb7c45 100644
--- a/contrib/sendmail/BuildTools/OS/NEWS-OS.4.x
+++ b/contrib/sendmail/BuildTools/OS/NEWS-OS.4.x
@@ -1,4 +1,4 @@
-# @(#)NEWS-OS.4.x 8.6 (Berkeley) 3/12/1998
+# @(#)NEWS-OS.4.x 8.6 (Berkeley) 3/12/98
define(`confBEFORE', `limits.h')
define(`confMAPDEF', `-DNDBM')
define(`confLIBS', `-lmld')
diff --git a/contrib/sendmail/BuildTools/OS/NEWS-OS.6.x b/contrib/sendmail/BuildTools/OS/NEWS-OS.6.x
index 4e5c809642de..dec79b5e9ec2 100644
--- a/contrib/sendmail/BuildTools/OS/NEWS-OS.6.x
+++ b/contrib/sendmail/BuildTools/OS/NEWS-OS.6.x
@@ -1,4 +1,4 @@
-# @(#)NEWS-OS.6.x 8.8 (Berkeley) 3/12/1998
+# @(#)NEWS-OS.6.x 8.8 (Berkeley) 3/12/98
define(`confCC', `/bin/cc')
define(`confBEFORE', `sysexits.h ndbm.o')
define(`confMAPDEF', `-DNDBM -DNIS')
diff --git a/contrib/sendmail/BuildTools/OS/NEXTSTEP.4.x b/contrib/sendmail/BuildTools/OS/NEXTSTEP.4.x
index b77581378d18..4fd6b0386089 100644
--- a/contrib/sendmail/BuildTools/OS/NEXTSTEP.4.x
+++ b/contrib/sendmail/BuildTools/OS/NEXTSTEP.4.x
@@ -1,4 +1,4 @@
-# @(#)NEXTSTEP.4.x 8.1 (Berkeley) 3/21/1998
+# @(#)NEXTSTEP.4.x 8.1 (Berkeley) 3/21/98
PUSHDIVERT(1)
# NEXTSTEP 3.1 and 3.2 only support m68k and i386
#ARCH= -arch m68k -arch i386 -arch hppa -arch sparc
diff --git a/contrib/sendmail/BuildTools/OS/NeXT.2.x b/contrib/sendmail/BuildTools/OS/NeXT.2.x
index 0a9d918318f0..d8f469495045 100644
--- a/contrib/sendmail/BuildTools/OS/NeXT.2.x
+++ b/contrib/sendmail/BuildTools/OS/NeXT.2.x
@@ -1,4 +1,4 @@
-# @(#)NeXT.2.x 8.7 (Berkeley) 3/12/1998
+# @(#)NeXT.2.x 8.7 (Berkeley) 3/12/98
define(`confBEFORE', `unistd.h dirent.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNETINFO')
define(`confENVDEF', `-DNeXT ')
diff --git a/contrib/sendmail/BuildTools/OS/NeXT.3.x b/contrib/sendmail/BuildTools/OS/NeXT.3.x
index f5e313dd8510..05aad6f85a51 100644
--- a/contrib/sendmail/BuildTools/OS/NeXT.3.x
+++ b/contrib/sendmail/BuildTools/OS/NeXT.3.x
@@ -1,4 +1,4 @@
-# @(#)NeXT.3.x 8.7 (Berkeley) 3/12/1998
+# @(#)NeXT.3.x 8.7 (Berkeley) 3/12/98
PUSHDIVERT(1)
# NEXTSTEP 3.1 and 3.2 only support m68k and i386
#ARCH= -arch m68k -arch i386 -arch hppa -arch sparc
diff --git a/contrib/sendmail/BuildTools/OS/NeXT.4.x b/contrib/sendmail/BuildTools/OS/NeXT.4.x
index 8736b74f327c..35f3bdb35e51 100644
--- a/contrib/sendmail/BuildTools/OS/NeXT.4.x
+++ b/contrib/sendmail/BuildTools/OS/NeXT.4.x
@@ -1,4 +1,4 @@
-# @(#)NeXT.4.x 8.9 (Berkeley) 7/15/1998
+# @(#)NeXT.4.x 8.8 (Berkeley) 5/25/98
PUSHDIVERT(1)
# NEXTSTEP 3.1 and 3.2 only support m68k and i386
#ARCH= -arch m68k -arch i386 -arch hppa -arch sparc
@@ -11,7 +11,7 @@ define(`confMAPDEF', `-DNDBM -DNIS -DNETINFO')
define(`confENVDEF', `-DNeXT -Wno-precomp -pipe ${RC_CFLAGS}')
define(`confLDOPTS', `${RC_CFLAGS}')
define(`confLIBS', `-ldbm')
-define(`confMANROOT', `/usr/man/cat')
+define(`confMANROOT', `/usr/lib/man/cat')
define(`confMBINDIR', `/usr/lib')
define(`confSBINDIR', `/usr/etc')
define(`confUBINDIR', `/usr/ucb')
diff --git a/contrib/sendmail/BuildTools/OS/NetBSD b/contrib/sendmail/BuildTools/OS/NetBSD
index cd800ef3d953..595fd2df289d 100644
--- a/contrib/sendmail/BuildTools/OS/NetBSD
+++ b/contrib/sendmail/BuildTools/OS/NetBSD
@@ -1,4 +1,4 @@
-# @(#)NetBSD 8.6 (Berkeley) 3/12/1998
+# @(#)NetBSD 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX')
define(`confENVDEF', ` -DNETISO')
define(`confDEPEND_TYPE', `CC-M')
diff --git a/contrib/sendmail/BuildTools/OS/NetBSD.8.3 b/contrib/sendmail/BuildTools/OS/NetBSD.8.3
index 714de1e6fbae..6576660f44e8 100644
--- a/contrib/sendmail/BuildTools/OS/NetBSD.8.3
+++ b/contrib/sendmail/BuildTools/OS/NetBSD.8.3
@@ -1,3 +1,3 @@
-# @(#)NetBSD.8.3 8.6 (Berkeley) 3/12/1998
+# @(#)NetBSD.8.3 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX')
define(`confENVDEF', ` # -DNETISO')
diff --git a/contrib/sendmail/BuildTools/OS/NonStop-UX b/contrib/sendmail/BuildTools/OS/NonStop-UX
index 6ccdead5e480..02bdb7801d4d 100644
--- a/contrib/sendmail/BuildTools/OS/NonStop-UX
+++ b/contrib/sendmail/BuildTools/OS/NonStop-UX
@@ -1,4 +1,4 @@
-# @(#)NonStop-UX 8.8 (Berkeley) 3/12/1998
+# @(#)NonStop-UX 8.8 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-DNonStop_UX_BXX -D_SVID ')
diff --git a/contrib/sendmail/BuildTools/OS/OSF1 b/contrib/sendmail/BuildTools/OS/OSF1
index 75fecfe93c6d..cc65dbc7844d 100644
--- a/contrib/sendmail/BuildTools/OS/OSF1
+++ b/contrib/sendmail/BuildTools/OS/OSF1
@@ -1,4 +1,4 @@
-# @(#)OSF1 8.7 (Berkeley) 3/14/1998
+# @(#)OSF1 8.7 (Berkeley) 3/14/98
define(`confCC', `cc -Olimit 1000')
define(`confMAPDEF', `-DNDBM -DNIS -DMAP_REGEX')
define(`confLIBS', `-ldbm')
diff --git a/contrib/sendmail/BuildTools/OS/OpenBSD b/contrib/sendmail/BuildTools/OS/OpenBSD
index 423ab2d6463b..fb7bc8f42c36 100644
--- a/contrib/sendmail/BuildTools/OS/OpenBSD
+++ b/contrib/sendmail/BuildTools/OS/OpenBSD
@@ -1,3 +1,3 @@
-# @(#)OpenBSD 8.5 (Berkeley) 3/12/1998
+# @(#)OpenBSD 8.5 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX')
define(`confENVDEF', ` -DNETISO')
diff --git a/contrib/sendmail/BuildTools/OS/PTX b/contrib/sendmail/BuildTools/OS/PTX
index 7dd05eecc187..9af372792a8a 100644
--- a/contrib/sendmail/BuildTools/OS/PTX
+++ b/contrib/sendmail/BuildTools/OS/PTX
@@ -1,4 +1,4 @@
-# @(#)PTX 8.6 (Berkeley) 3/12/1998
+# @(#)PTX 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM')
define(`confOPTIMIZE', `-g')
define(`confLIBS', `-lsocket -linet -lelf -lnsl -lseq')
diff --git a/contrib/sendmail/BuildTools/OS/Paragon b/contrib/sendmail/BuildTools/OS/Paragon
index 868780f66531..e16e051f734a 100644
--- a/contrib/sendmail/BuildTools/OS/Paragon
+++ b/contrib/sendmail/BuildTools/OS/Paragon
@@ -1,4 +1,4 @@
-# @(#)Paragon 8.3 (Berkeley) 3/12/1998
+# @(#)Paragon 8.3 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM')
define(`confLIBDIRS', `-L/usr/shlib -L/usr/lib')
define(`confLIBS', `-ldbm')
diff --git a/contrib/sendmail/BuildTools/OS/PowerUX b/contrib/sendmail/BuildTools/OS/PowerUX
index 47ab87c66b3d..b0f133d0a8c7 100644
--- a/contrib/sendmail/BuildTools/OS/PowerUX
+++ b/contrib/sendmail/BuildTools/OS/PowerUX
@@ -1,4 +1,4 @@
-# @(#)PowerUX 8.5 (Berkeley) 2/12/1998
+# @(#)PowerUX 8.5 (Berkeley) 2/12/98
define(`confENVDEF', `-D__svr4__ ')
define(`confLIBS', `-Bstatic -lsocket -lnsl -lelf -lgen')
define(`confMBINDIR', `/usr/local/etc')
diff --git a/contrib/sendmail/BuildTools/OS/QNX b/contrib/sendmail/BuildTools/OS/QNX
index a8a67fe94cc1..3cc01821afc8 100644
--- a/contrib/sendmail/BuildTools/OS/QNX
+++ b/contrib/sendmail/BuildTools/OS/QNX
@@ -1,4 +1,4 @@
-# @(#)QNX 8.4 (Berkeley) 2/19/1998
+# @(#)QNX 8.4 (Berkeley) 2/19/98
PUSHDIVERT(1)
#
# For this Makefile to work you must compile and install the libdb package
diff --git a/contrib/sendmail/BuildTools/OS/RISCos b/contrib/sendmail/BuildTools/OS/RISCos
index 4b2d79ee0d06..1888ae691616 100644
--- a/contrib/sendmail/BuildTools/OS/RISCos
+++ b/contrib/sendmail/BuildTools/OS/RISCos
@@ -1,4 +1,4 @@
-# @(#)RISCos 8.5 (Berkeley) 3/12/1998
+# @(#)RISCos 8.5 (Berkeley) 3/12/98
define(`confCC', `cc -systype bsd43 -Olimit 900')
define(`confBEFORE', `stdlib.h dirent.h unistd.h stddef.h')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/RISCos.4_0 b/contrib/sendmail/BuildTools/OS/RISCos.4_0
index 1557b8aa1fd3..e057fb433cfe 100644
--- a/contrib/sendmail/BuildTools/OS/RISCos.4_0
+++ b/contrib/sendmail/BuildTools/OS/RISCos.4_0
@@ -1,4 +1,4 @@
-# @(#)RISCos.4_0 8.6 (Berkeley) 3/12/1998
+# @(#)RISCos.4_0 8.6 (Berkeley) 3/12/98
define(`confCC', `cc -systype bsd43 -Olimit 900')
define(`confBEFORE', `stdlib.h dirent.h unistd.h stddef.h')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/Rhapsody b/contrib/sendmail/BuildTools/OS/Rhapsody
deleted file mode 100644
index 16cf89d80be4..000000000000
--- a/contrib/sendmail/BuildTools/OS/Rhapsody
+++ /dev/null
@@ -1,16 +0,0 @@
-# @(#)Rhapsody 8.1 (Berkeley) 11/7/1998
-#
-# Wilfredo Sanchez <wsanchez@apple.com>:
-# We look a lot more like 4.4BSD than NeXTStep or OpenStep.
-#
-define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX -DNETINFO -DAUTO_NETINFO_ALIASES -DAUTO_NETINFO_HOSTS')
-define(`confENVDEF', `-DNETISO -traditional-cpp -pipe ${Extra_CC_Flags}')
-define(`confLDOPTS', `${Extra_LD_Flags}')
-define(`confOPTIMIZE', `-O3')
-define(`confHFDIR', `/usr/share/sendmail')
-define(`confMANOWN', `root')
-define(`confMANGRP', `wheel')
-define(`confUBINOWN', `root')
-define(`confUBINGRP', `wheel')
-define(`confSBINOWN', `root')
-define(`confSBINGRP', `wheel')
diff --git a/contrib/sendmail/BuildTools/OS/SCO b/contrib/sendmail/BuildTools/OS/SCO
index e995052e225d..a72ba53eebe4 100644
--- a/contrib/sendmail/BuildTools/OS/SCO
+++ b/contrib/sendmail/BuildTools/OS/SCO
@@ -1,4 +1,4 @@
-# @(#)SCO 8.3 (Berkeley) 2/8/1998
+# @(#)SCO 8.3 (Berkeley) 2/8/98
define(`confENVDEF', `-D_SCO_unix_ ')
define(`confLIBS', `-lsocket -lprot_s -lx -lc_s')
define(`confMBINDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/SCO.4.2 b/contrib/sendmail/BuildTools/OS/SCO.4.2
index 0d458befa3a1..027f7300667a 100644
--- a/contrib/sendmail/BuildTools/OS/SCO.4.2
+++ b/contrib/sendmail/BuildTools/OS/SCO.4.2
@@ -1,4 +1,4 @@
-# @(#)SCO.4.2 8.5 (Berkeley) 6/30/1998
+# @(#)SCO.4.2 8.5 (Berkeley) 6/30/98
define(`confENVDEF', `-D_SCO_unix_4_2 ')
define(`confLIBS', `-lsocket -lndbm -lprot_s -lx -lc_s')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/SCO.5.x b/contrib/sendmail/BuildTools/OS/SCO.5.x
index d7fdc736e68a..8f095ac5aed3 100644
--- a/contrib/sendmail/BuildTools/OS/SCO.5.x
+++ b/contrib/sendmail/BuildTools/OS/SCO.5.x
@@ -1,4 +1,4 @@
-# @(#)SCO.5.x 8.10 (Berkeley) 6/30/1998
+# @(#)SCO.5.x 8.10 (Berkeley) 6/30/98
define(`confCC', `cc -b elf')
define(`confLIBS', `-lsocket -lndbm -lprot -lcurses -lm -lx -lgen')
define(`confMAPDEF', `-DMAP_REGEX -DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/SINIX b/contrib/sendmail/BuildTools/OS/SINIX
index 3c27937af937..93cc78135012 100644
--- a/contrib/sendmail/BuildTools/OS/SINIX
+++ b/contrib/sendmail/BuildTools/OS/SINIX
@@ -1,4 +1,4 @@
-# @(#)SINIX 8.5 (Berkeley) 2/12/1998
+# @(#)SINIX 8.5 (Berkeley) 2/12/98
define(`confCC', `/usr/bin/cc')
define(`confENVDEF', `-D__svr4__ ')
define(`confLIBS', `-lsocket -lnsl -lelf')
diff --git a/contrib/sendmail/BuildTools/OS/SVR4 b/contrib/sendmail/BuildTools/OS/SVR4
index 92cf10101202..f342c3feeb3e 100644
--- a/contrib/sendmail/BuildTools/OS/SVR4
+++ b/contrib/sendmail/BuildTools/OS/SVR4
@@ -1,4 +1,4 @@
-# @(#)SVR4 8.6 (Berkeley) 3/12/1998
+# @(#)SVR4 8.6 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-D__svr4__ ')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS b/contrib/sendmail/BuildTools/OS/SunOS
index 9db95698a4b2..2a8897825acf 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS
+++ b/contrib/sendmail/BuildTools/OS/SunOS
@@ -1,4 +1,4 @@
-# @(#)SunOS 8.6 (Berkeley) 3/12/1998
+# @(#)SunOS 8.6 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confLDOPTS', `-Bstatic')
define(`confMBINDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.4.0 b/contrib/sendmail/BuildTools/OS/SunOS.4.0
index 0bcbc5f57754..05bbc57d5049 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.4.0
+++ b/contrib/sendmail/BuildTools/OS/SunOS.4.0
@@ -1,4 +1,4 @@
-# @(#)SunOS.4.0 8.6 (Berkeley) 3/12/1998
+# @(#)SunOS.4.0 8.6 (Berkeley) 3/12/98
define(`confBEFORE', `stdlib.h stddef.h limits.h')
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DSUNOS403 ')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.1 b/contrib/sendmail/BuildTools/OS/SunOS.5.1
index fe39bb9c3a73..2383609ef14a 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.1
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.1
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.1 8.8 (Berkeley) 3/21/1998
+# @(#)SunOS.5.1 8.8 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.2 b/contrib/sendmail/BuildTools/OS/SunOS.5.2
index 80bc0870ae1d..5e635db694e2 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.2
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.2
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.2 8.8 (Berkeley) 3/21/1998
+# @(#)SunOS.5.2 8.8 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.3 b/contrib/sendmail/BuildTools/OS/SunOS.5.3
index dcee93ec33de..8f64d219b7be 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.3
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.3
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.3 8.8 (Berkeley) 3/21/1998
+# @(#)SunOS.5.3 8.8 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.4 b/contrib/sendmail/BuildTools/OS/SunOS.5.4
index 4a6b880a3138..65e84002c7b7 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.4
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.4
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.4 8.10 (Berkeley) 3/21/1998
+# @(#)SunOS.5.4 8.10 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.5 b/contrib/sendmail/BuildTools/OS/SunOS.5.5
index 64264d7deb24..267f16d22a1b 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.5
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.5
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.5 8.11 (Berkeley) 3/21/1998
+# @(#)SunOS.5.5 8.11 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS -DMAP_REGEX')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.6 b/contrib/sendmail/BuildTools/OS/SunOS.5.6
index da17de8ed32d..0537007008d1 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.6
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.6
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.6 8.10 (Berkeley) 3/21/1998
+# @(#)SunOS.5.6 8.10 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS -DMAP_REGEX')
diff --git a/contrib/sendmail/BuildTools/OS/SunOS.5.7 b/contrib/sendmail/BuildTools/OS/SunOS.5.7
index 962095dbbcbe..b030e77c6506 100644
--- a/contrib/sendmail/BuildTools/OS/SunOS.5.7
+++ b/contrib/sendmail/BuildTools/OS/SunOS.5.7
@@ -1,4 +1,4 @@
-# @(#)SunOS.5.7 8.11 (Berkeley) 3/21/1998
+# @(#)SunOS.5.7 8.11 (Berkeley) 3/21/98
define(`confCC', `gcc')
define(`confBEFORE', `sysexits.h')
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS -DMAP_REGEX')
diff --git a/contrib/sendmail/BuildTools/OS/Titan b/contrib/sendmail/BuildTools/OS/Titan
index 938b46df369c..b66820089fd1 100644
--- a/contrib/sendmail/BuildTools/OS/Titan
+++ b/contrib/sendmail/BuildTools/OS/Titan
@@ -1,4 +1,4 @@
-# @(#)Titan 8.5 (Berkeley) 3/12/1998
+# @(#)Titan 8.5 (Berkeley) 3/12/98
define(`confCC', `cc -43')
define(`confBEFORE', `stddef.h stdlib.h')
define(`confMAPDEF', `-DNDBM')
diff --git a/contrib/sendmail/BuildTools/OS/ULTRIX b/contrib/sendmail/BuildTools/OS/ULTRIX
index e9073f97a56a..f5df633e52ef 100644
--- a/contrib/sendmail/BuildTools/OS/ULTRIX
+++ b/contrib/sendmail/BuildTools/OS/ULTRIX
@@ -1,5 +1,5 @@
-# @(#)ULTRIX 8.8 (Berkeley) 12/18/1998
-define(`confCC', `cc -Olimit 970')
+# @(#)ULTRIX 8.7 (Berkeley) 3/12/98
+define(`confCC', `cc -Olimit 950')
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DIDENTPROTO=0 ')
define(`confMBINDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/UMAX b/contrib/sendmail/BuildTools/OS/UMAX
index 078b827a8499..450c91da7500 100644
--- a/contrib/sendmail/BuildTools/OS/UMAX
+++ b/contrib/sendmail/BuildTools/OS/UMAX
@@ -1,4 +1,4 @@
-# @(#)UMAX 8.5 (Berkeley) 3/12/1998
+# @(#)UMAX 8.5 (Berkeley) 3/12/98
define(`confBEFORE', `stddef.h')
define(`confMAPDEF', `-DNIS')
define(`confENVDEF', `-DUMAXV ')
diff --git a/contrib/sendmail/BuildTools/OS/UNICOS b/contrib/sendmail/BuildTools/OS/UNICOS
index 3b05dc059b9d..7984fa927c95 100644
--- a/contrib/sendmail/BuildTools/OS/UNICOS
+++ b/contrib/sendmail/BuildTools/OS/UNICOS
@@ -1,4 +1,4 @@
-# @(#)UNICOS 8.7 (Berkeley) 2/26/1998
+# @(#)UNICOS 8.7 (Berkeley) 2/26/98
define(`confENVDEF', `-DUNICOS ')
define(`confOPTIMIZE', `-O')
define(`confMBINDIR', `/usr/lib')
diff --git a/contrib/sendmail/BuildTools/OS/UNIX_SV.4.x.i386 b/contrib/sendmail/BuildTools/OS/UNIX_SV.4.x.i386
index b0e27537714d..a6865e786aed 100644
--- a/contrib/sendmail/BuildTools/OS/UNIX_SV.4.x.i386
+++ b/contrib/sendmail/BuildTools/OS/UNIX_SV.4.x.i386
@@ -1,4 +1,4 @@
-# @(#)UNIX_SV.4.x.i386 8.6 (Berkeley) 3/12/1998
+# @(#)UNIX_SV.4.x.i386 8.6 (Berkeley) 3/12/98
define(`confCC', `gcc')
define(`confMAPDEF', `-DNDBM')
define(`confENVDEF', `-D__svr4__ -DUNIXWARE ')
diff --git a/contrib/sendmail/BuildTools/OS/UX4800 b/contrib/sendmail/BuildTools/OS/UX4800
index 7c1822ae7054..207b370baa0c 100644
--- a/contrib/sendmail/BuildTools/OS/UX4800
+++ b/contrib/sendmail/BuildTools/OS/UX4800
@@ -1,4 +1,4 @@
-# @(#)UX4800 8.8 (Berkeley) 3/12/1998
+# @(#)UX4800 8.8 (Berkeley) 3/12/98
define(`confCC', `/usr/abiccs/bin/cc -KOlimit=900')
define(`confBEFORE', `sysexits.h ndbm.h')
define(`confMAPDEF', `-DNDBM -DNIS # without NEWDB')
diff --git a/contrib/sendmail/BuildTools/OS/UXPDS.V10 b/contrib/sendmail/BuildTools/OS/UXPDS.V10
index 438d88d1c8bf..bf3014034378 100644
--- a/contrib/sendmail/BuildTools/OS/UXPDS.V10
+++ b/contrib/sendmail/BuildTools/OS/UXPDS.V10
@@ -1,4 +1,4 @@
-# @(#)UXPDS.V10 8.9 (Berkeley) 3/12/1998
+# @(#)UXPDS.V10 8.9 (Berkeley) 3/12/98
define(`confCC', `/usr/ccs/bin/cc')
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confENVDEF', `-DUXPDS=10 ')
diff --git a/contrib/sendmail/BuildTools/OS/UXPDS.V20 b/contrib/sendmail/BuildTools/OS/UXPDS.V20
index f2d0b37bbcf6..cacdb4af68b3 100644
--- a/contrib/sendmail/BuildTools/OS/UXPDS.V20
+++ b/contrib/sendmail/BuildTools/OS/UXPDS.V20
@@ -1,4 +1,4 @@
-# @(#)UXPDS.V20 8.8 (Berkeley) 3/12/1998
+# @(#)UXPDS.V20 8.8 (Berkeley) 3/12/98
define(`confCC', `/usr/ccs/bin/cc')
define(`confBEFORE', `netinet/ip_var.h')
define(`confMAPDEF', `-DNDBM -DNIS')
diff --git a/contrib/sendmail/BuildTools/OS/UnixWare.5.i386 b/contrib/sendmail/BuildTools/OS/UnixWare.5.i386
deleted file mode 100644
index 77ca82da0a26..000000000000
--- a/contrib/sendmail/BuildTools/OS/UnixWare.5.i386
+++ /dev/null
@@ -1,18 +0,0 @@
-# @(#)UnixWare.5.i386 8.2 (Berkeley) 10/15/1998
-#
-# System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatiblity Libs ie. native)
-# Contributed by Paul Gampe <paulg@apnic.net>
-#
-define(`confCC', `/usr/ccs/bin/cc')
-define(`confMAPDEF', `-DNDBM -DMAP_REGEX')
-define(`confENVDEF', `-D__svr5__')
-define(`confLIBS', `-lsocket -lnsl -lelf')
-define(`confSHELL', `/usr/bin/sh')
-define(`confMBINDIR', `/usr/lib')
-define(`confSBINDIR', `/etc/mail')
-define(`confUBINDIR', `/etc/mail')
-define(`confEBINDIR', `/usr/lib')
-define(`confSBINGRP', `mail')
-define(`confSTDIR', `/etc/mail')
-define(`confHFDIR', `/etc/mail')
-define(`confINSTALL', `/usr/ucb/install')
diff --git a/contrib/sendmail/BuildTools/OS/dcosx.1.x.NILE b/contrib/sendmail/BuildTools/OS/dcosx.1.x.NILE
index 095de367dad8..900afcd632b9 100644
--- a/contrib/sendmail/BuildTools/OS/dcosx.1.x.NILE
+++ b/contrib/sendmail/BuildTools/OS/dcosx.1.x.NILE
@@ -1,4 +1,4 @@
-# @(#)dcosx.1.x.NILE 8.3 (Berkeley) 2/8/1998
+# @(#)dcosx.1.x.NILE 8.3 (Berkeley) 2/8/98
define(`confENVDEF', `-D__svr4__ -DDCOSx ')
define(`confLIBS', `-lsocket -lnsl -lelf')
define(`confHFDIR', `/usr/share/lib/mail')
diff --git a/contrib/sendmail/BuildTools/OS/dgux b/contrib/sendmail/BuildTools/OS/dgux
index 66132c091b0f..7d6d867b1ec1 100644
--- a/contrib/sendmail/BuildTools/OS/dgux
+++ b/contrib/sendmail/BuildTools/OS/dgux
@@ -1,4 +1,4 @@
-# @(#)dgux 8.5 (Berkeley) 3/12/1998
+# @(#)dgux 8.5 (Berkeley) 3/12/98
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confLIBS', `-ldbm')
define(`confMBINDIR', `/usr/bin')
diff --git a/contrib/sendmail/BuildTools/OS/maxion b/contrib/sendmail/BuildTools/OS/maxion
index 0177911dfe13..3bb6e0e2e2cd 100644
--- a/contrib/sendmail/BuildTools/OS/maxion
+++ b/contrib/sendmail/BuildTools/OS/maxion
@@ -1,4 +1,4 @@
-# @(#)maxion 8.6 (Berkeley) 3/12/1998
+# @(#)maxion 8.6 (Berkeley) 3/12/98
define(`confCC', `/usr/ucb/cc')
define(`confMAPDEF', `-DNDBM -DNIS')
define(`confLIBDIRS', `-L/usr/ucblib')
diff --git a/contrib/sendmail/BuildTools/OS/uts.systemV b/contrib/sendmail/BuildTools/OS/uts.systemV
index acee532530f5..c5f841fb5ab0 100644
--- a/contrib/sendmail/BuildTools/OS/uts.systemV
+++ b/contrib/sendmail/BuildTools/OS/uts.systemV
@@ -1,4 +1,4 @@
-# @(#)uts.systemV 8.10 (Berkeley) 3/12/1998
+# @(#)uts.systemV 8.10 (Berkeley) 3/12/98
PUSHDIVERT(1)
# Sendmail 8 on UTS requires BIND 4.9's include files and lib44bsd and
# libresolv libraries. The BIND version on UTS is much too old.
diff --git a/contrib/sendmail/BuildTools/README b/contrib/sendmail/BuildTools/README
index 65726165c733..0efc1548b391 100644
--- a/contrib/sendmail/BuildTools/README
+++ b/contrib/sendmail/BuildTools/README
@@ -107,4 +107,4 @@ confUBINGRP bin The group for user-executable binaries.
confUBINMODE 555 The mode for user-executable binaries.
-@(#)README 8.22 (Berkeley) 6/30/1998
+@(#)README 8.22 (Berkeley) 6/30/98
diff --git a/contrib/sendmail/BuildTools/Site/README b/contrib/sendmail/BuildTools/Site/README
index 44e14e886aad..d5ecb96001dc 100644
--- a/contrib/sendmail/BuildTools/Site/README
+++ b/contrib/sendmail/BuildTools/Site/README
@@ -13,4 +13,4 @@ directory.
See the README in the BuildTools directory for more information.
-@(#)README 8.3 (Berkeley) 3/27/1998
+@(#)README 8.3 (Berkeley) 3/27/98
diff --git a/contrib/sendmail/BuildTools/bin/Build b/contrib/sendmail/BuildTools/bin/Build
index bca061f54667..ab8a49d78cac 100755
--- a/contrib/sendmail/BuildTools/bin/Build
+++ b/contrib/sendmail/BuildTools/bin/Build
@@ -10,7 +10,7 @@
# the sendmail distribution.
#
#
-# @(#)Build 8.93 (Berkeley) 6/24/1998
+# @(#)Build 8.93 (Berkeley) 6/24/98
#
#
diff --git a/contrib/sendmail/BuildTools/bin/configure.sh b/contrib/sendmail/BuildTools/bin/configure.sh
index aff771c8127a..eb149b2cdd46 100644
--- a/contrib/sendmail/BuildTools/bin/configure.sh
+++ b/contrib/sendmail/BuildTools/bin/configure.sh
@@ -7,7 +7,7 @@
# the sendmail distribution.
#
#
-# @(#)configure.sh 8.27 (Berkeley) 5/19/1998
+# @(#)configure.sh 8.27 (Berkeley) 5/19/98
#
# Special script to autoconfigure for M4 generation of Makefile
diff --git a/contrib/sendmail/BuildTools/bin/find_m4.sh b/contrib/sendmail/BuildTools/bin/find_m4.sh
index 632e86f0467a..d2cf66556d82 100755
--- a/contrib/sendmail/BuildTools/bin/find_m4.sh
+++ b/contrib/sendmail/BuildTools/bin/find_m4.sh
@@ -7,7 +7,7 @@
# the sendmail distribution.
#
#
-# @(#)find_m4.sh 8.4 (Berkeley) 5/19/1998
+# @(#)find_m4.sh 8.4 (Berkeley) 5/19/98
#
# Try to find a working M4 program.
diff --git a/contrib/sendmail/BuildTools/bin/install.sh b/contrib/sendmail/BuildTools/bin/install.sh
index 840aa3385ff9..58f7623a1475 100755
--- a/contrib/sendmail/BuildTools/bin/install.sh
+++ b/contrib/sendmail/BuildTools/bin/install.sh
@@ -7,7 +7,7 @@
# the sendmail distribution.
#
#
-# @(#)install.sh 8.9 (Berkeley) 5/19/1998
+# @(#)install.sh 8.9 (Berkeley) 5/19/98
# Set default program
program=mv
diff --git a/contrib/sendmail/KNOWNBUGS b/contrib/sendmail/KNOWNBUGS
index 0a83bb0aaf97..cd62b20eb12e 100644
--- a/contrib/sendmail/KNOWNBUGS
+++ b/contrib/sendmail/KNOWNBUGS
@@ -65,8 +65,9 @@ This list is not guaranteed to be complete.
* accept() problem on Linux.
- The accept() in sendmail daemon loop can return ETIMEDOUT. An
- error is reported to syslog:
+ Apparently, the accept() in sendmail daemon loop can return ETIMEDOUT
+ and cause sendmail to sleep for 5 seconds during which time no new
+ connections will be accepted. An error is reported to syslog:
Jun 9 17:14:12 hostname sendmail[207]: NOQUEUE: SYSERR(root):
getrequests: accept: Connection timed out
@@ -142,12 +143,5 @@ This list is not guaranteed to be complete.
MustQuoteChars even though it is not listed as a special character in
STD 11.
-* bestmx map with -z flag truncates the list of MX hosts
- A bestmx map configured with the -z flag will truncate the list
- of MX hosts. This prevents creation of strings which are too
- long for ruleset parsing. This can have an adverse effect on the
- relay_based_on_MX feature.
-
-
-(Version 8.34, last updated 12/17/1998)
+(Version 8.32, last updated 6/30/98)
diff --git a/contrib/sendmail/LICENSE b/contrib/sendmail/LICENSE
index d0ff63a9cb13..bb1c3a79c7f0 100644
--- a/contrib/sendmail/LICENSE
+++ b/contrib/sendmail/LICENSE
@@ -86,4 +86,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.
-(Version 8.6, last updated 6/24/1998)
+(Version 8.6, last updated 6/24/98)
diff --git a/contrib/sendmail/Makefile b/contrib/sendmail/Makefile
index 98ad6e5b8f4e..0b44c4203190 100644
--- a/contrib/sendmail/Makefile
+++ b/contrib/sendmail/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile.dist 8.2 (Berkeley) 2/17/1998
+# @(#)Makefile.dist 8.2 (Berkeley) 2/17/98
SHELL= /bin/sh
SUBDIRS= src mail.local mailstats makemap praliases rmail smrsh
diff --git a/contrib/sendmail/README b/contrib/sendmail/README
index eff3fb2ef550..5de10764212e 100644
--- a/contrib/sendmail/README
+++ b/contrib/sendmail/README
@@ -1,5 +1,5 @@
/*-
- * @(#)README 8.50 (Berkeley) 12/17/1998
+ * @(#)README 8.48 (Berkeley) 5/19/98
*/
SENDMAIL RELEASE 8
@@ -13,12 +13,11 @@ There is a web site at http://WWW.Sendmail.ORG -- see that site for
the latest updates.
******************************************************************
-** A new Build architecture is in place that allows you to **
-** use the "Build" shell script in any of the program **
-** directories. On many environments this will do everything **
-** for you, no fuss, no muss. See src/README for more details **
-** of compilation. See cf/README for details about building **
-** a runtime configuration file. **
+** DO NOT USE MAKE to compile sendmail. Instead, cd src and **
+** use the "Build" shell script. On many environments this **
+** will do everything for you, no fuss, no muss. See **
+** src/README for more details of compilation. See cf/README **
+** for details about building a runtime configuration file. **
******************************************************************
Sendmail is a trademark of Sendmail, Inc.
@@ -233,7 +232,6 @@ Important RFCs for electronic mail are:
RFC1894 An Extensible Message Format for Delivery Status
Notifications
RFC1985 SMTP Service Extension for Remote Message Queue Starting
- RFC2033 Local Mail Transfer Protocol
Other standards that may be of interest (but which are less directly
relevant to sendmail) are:
diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES
index a8d299a102f9..2b3475ffbcc6 100644
--- a/contrib/sendmail/RELEASE_NOTES
+++ b/contrib/sendmail/RELEASE_NOTES
@@ -1,187 +1,11 @@
SENDMAIL RELEASE NOTES
- @(#)RELEASE_NOTES 8.9.2.4 (Berkeley) 12/29/1998
+ @(#)RELEASE_NOTES 8.9.1.1 (Berkeley) 7/2/98
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.9.2/8.9.2 98/12/30
- SECURITY: Remove five second sleep on accepting daemon connections
- due to an accept() failure. This sleep could be used
- for a denial of service attack.
- Do not silently ignore queue files with names which are too long.
- Patch from Bryan Costales of InfoBeat, Inc.
- Do not store failures closing an SMTP session in persistent
- host status. Reported by Graeme Hewson of Oracle
- Corporation UK.
- Allow symbolic link forward files if they are in safe directories.
- Problem noted by Andreas Schott of the Max Planck Society.
- Missing columns in a text map could cause a segmentation fault.
- Fix from David Lee of the University of Durham.
- Note that for 8.9.X, PrivacyFlags=goaway also includes the
- noetrn flag. This is scheduled to change in a future
- version of sendmail. Problem noted by Theo Van Dinter of
- Chrysalis Symbolic Designa and Alan Brown of Manawatu
- Internet Services.
- When trying to do host canonification in a Wildcard MX
- environment, try an MX lookup of the hostname without the
- default domain appended. Problem noted by Olaf Seibert of
- Polderland Language & Speech Technology.
- Reject SMTP RCPT To: commands with only comments (i.e.
- 'RCPT TO: (comment)'. Problem noted by Earle Ake of
- Hassler Communication Systems Technology, Inc.
- Handle any number of %s in the LDAP filter spec. Patch from
- Per Hedeland of Ericsson.
- Clear ldapx open timeouts even if the map open failed to prevent
- a segmentation fault. Patch from Wayne Knowles of the
- National Institute of Water & Atmospheric Research Ltd.
- Do not syslog envelope clone messages when using address
- verification (-bv). Problem noted by Kari Hurtta of the
- Finnish Meteorological Institute.
- Continue to perform queue runs while in daemon mode even if the
- daemon is rejecting connections due to a disk full
- condition. Problem noted by JR Oldroyd of TerraNet
- Internet Services.
- Include full filename on installation of the sendmail.hf file
- in case the $HFDIR directory does not exist. Problem
- noted by Josef Svitak of Montana State University.
- Close all maps when exiting the process with one exception.
- Berkeley DB can use internal shared memory locking for
- its memory pool. Closing a map opened by another process
- will interfere with the shared memory and locks of the
- parent process leaving things in a bad state. For
- Berkeley DB, only close the map if the current process
- is also the one that opened the map, otherwise only close
- the map file descriptor. Thanks to Yoseff Francus of
- Collective Technologies for volunteering his system for
- extended testing.
- Avoid null pointer dereference on XDEBUG output for SMTP reply
- failures. Problem noted by Carlos Canau of EUnet Portugal.
- On mailq and hoststat listings being piped to another program, such
- as more, if the pipe closes (i.e. the user quits more),
- stop sending output and exit. Patch from Allan E Johannesen
- of Worcester Polytechnic Institute.
- In accordance with the documentation, LDAP map lookup failures
- are now considered temporary failures instead of permanent
- failures unless the -t flag is used in the map definition.
- Problem noted by Booker Bense of Stanford University and
- Eric C. Hagberg of Morgan Stanley.
- Fix by one error reporting on long alias names. Problem noted by
- H. Paul Hammann of the Missouri Research and Education
- Network.
- Fix DontBlameSendmail=IncludeFileInUnsafeDirPath behavior. Problem
- noted by Barry S. Finkel of Argonne National Laboratory.
- When automatically converting from 8 bit to quoted printable MIME,
- be careful not to miss a multi-part boundary if that
- boundary is preceded by a boundary-like line. Problem
- noted by Andreas Raschle of Ansid Inc. Fix from
- Kari Hurtta of the Finnish Meteorological Institute.
- Avoid bogus reporting of "LMTP tobuf overflow" when the buffer
- has enough space for the additional address. Problem
- noted by Steve Cliffe of the University of Wollongong.
- Fix DontBlameSendmail=FileDeliveryToSymlinks behavior. Problem
- noted by Alex Vorobiev of Swarthmore College.
- If the check_compat ruleset resolves to the $#discard mailer,
- discard the current recipient. Unlike check_relay,
- check_mail, and check_rcpt, the entire envelope is not
- discarded. Problem noted by RZ D. Rahlfs. Fix from
- Claus Assmann of Christian-Albrechts-University of Kiel.
- Avoid segmentation fault when reading ServiceSwitch files with
- bogus formatting. Patch from Kari Hurtta of the Finnish
- Meteorological Institute.
- Support Berkeley DB 2.6.4 API change.
- OP.ME: Pages weren't properly output on duplexed printers. Fix
- from Matthew Black of CSU Long Beach.
- Portability:
- Apple Rhapsody from Wilfredo Sanchez of Apple Computer, Inc.
- Avoid a clash with IRIX 6.2 getopt.h and the UserDatabase
- option structure. Problem noted by Ashley M.
- Kirchner of Photo Craft Laboratories, Inc.
- Break out IP address to hostname translation for
- reading network interface addresses into
- class 'w'. Patch from John Kennedy of
- Cal State University, Chico.
- AIX 4.x use -qstrict with -O3 to prevent the optimized
- from changing the semantics of the compiled
- program. From Simon Travaglia of the
- University of Waikato, New Zealand.
- FreeBSD 2.2.2 and later support setusercontext(). From
- Peter Wemm of DIALix.
- FreeBSD 3.x fix from Peter Wemm of DIALix.
- IRIX 5.x has a syslog buffer size of 512 bytes. From
- Nao NINOMIYA of Utsunomiya University.
- IRIX 6.5 64-bit Build support.
- LDAP Version 3 support from John Beck and Ravi Iyer
- of Sun Microsystems.
- Linux does not implement seteuid() properly. From
- John Kennedy of Cal State University, Chico.
- Linux timezone type was set improperly. From Takeshi Itoh
- of Bits Co., Ltd.
- NCR MP-RAS 3.x needs -lresolv for confLIBS. From
- Tom J. Moore of NCR.
- NeXT 4.x correction to man page path. From J. P. McCann
- of E I A.
- System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs)
- from Paul Gampe of the Asia Pacific Network
- Information Center.
- ULTRIX now requires an optimization limit of 970 from
- Allan E Johannesen of Worcester Polytechnic
- Institute.
- Fix extern declaration for sm_dopr(). Fix from Henk
- van Oers of Algemeen Nederlands Persbureau.
- CONFIG: Catch @hostname,user@anotherhost.domain as relaying.
- Problem noted by Mark Rogov of AirMedia, Inc. Fix from
- Claus Assmann of Christian-Albrechts-University of Kiel.
- CONFIG: Do not refer to http://maps.vix.com/ on RBL rejections as
- there are multiple RBL's available and the MAPS RBL may
- not be the one in use. Suggested by Alan Brown of
- Manawatu Internet Services.
- CONFIG: Properly strip route addresses (i.e. @host1:user@host2)
- when stripping down a recipient address to check for
- relaying. Patch from Claus Assmann of
- Christian-Albrechts-University of Kiel and Neil W Rickert
- of Northern Illinois University.
- CONFIG: Allow the access database to override RBL lookups. Patch
- from Claus Assmann of Christian-Albrechts-University of
- Kiel.
- CONFIG: UnixWare 7 support from Phillip P. Porch of The Porch
- Dot Com.
- CONFIG: Fixed check for deferred delivery mode warning. Patch
- from Claus Assmann of Christian-Albrechts-University of
- Kiel and Per Hedeland of Ericsson.
- CONFIG: If a recipient using % addressing is used, e.g.
- user%site@othersite, and othersite's MX records are now
- checked for local hosts if FEATURE(relay_based_on_MX) is
- used. Problem noted by Alexander Litvin of Lucky Net Ltd.
- Patch from Alexander Litvin of Lucky Net Ltd and
- Claus Assmann of Christian-Albrechts-University of Kiel.
- MAIL.LOCAL: Prevent warning messages from appearing in the LMTP
- stream. Do not allow more than one response per recipient.
- MAIL.LOCAL: Handle routed addresses properly when using LMTP. Fix
- from John Beck of Sun Microsystems.
- MAIL.LOCAL: Properly check for CRLF when using LMTP. Fix from
- John Beck of Sun Microsystems.
- MAIL.LOCAL: Substitute MAILER-DAEMON for the LMTP empty sender in
- the envelope From header.
- MAIL.LOCAL: Accept underscores in hostnames in LMTP mode.
- Problem noted by Glenn A. Malling of Syracuse University.
- MAILSTATS: Document msgsrej and msgsdis fields in the man page.
- Problem noted by Richard Wong of Princeton University.
- MAKEMAP: Build group list so group writable files are allowed with
- the -s flag. Problem noted by Curt Sampson of Internet
- Portal Services, Inc.
- PRALIASES: Automatically handle alias files created without the
- NULL byte at the end of the key. Patch from John Beck of
- Sun Microsystems.
- PRALIASES: Support Berkeley DB 2.6.4 API change.
- New Files:
- BuildTools/OS/IRIX64.6.5
- BuildTools/OS/UnixWare.5.i386
- cf/cf/unixware7.m4
- contrib/smcontrol.pl
- src/control.c
-
8.9.1/8.9.1 98/07/02
If both an OS specific site configuration file and a generic
site.config.m4 file existed, only the latter was used
@@ -264,8 +88,6 @@ summary of the changes in that release.
RMAIL: Do not install rmail by default, require 'make force-install'
as this rmail isn't the same as others. Suggested by
Kari Hurtta of the Finnish Meteorological Institute.
- New Files:
- BuildTools/OS/DomainOS.10.4
8.9.0/8.9.0 98/05/19
SECURITY: To prevent users from reading files not normally
diff --git a/contrib/sendmail/cf/README b/contrib/sendmail/cf/README
index 46a9475563f4..df50c9da1d03 100644
--- a/contrib/sendmail/cf/README
+++ b/contrib/sendmail/cf/README
@@ -4,7 +4,7 @@
Eric Allman <eric@Sendmail.ORG>
- @(#)README 8.184 (Berkeley) 12/29/1998
+ @(#)README 8.174 (Berkeley) 6/30/98
This document describes the sendmail configuration files being used
@@ -719,9 +719,6 @@ nullclient This is a special case -- it creates a stripped down
they are qualified with the masquerade name, which
defaults to the name of the hub machine). No mailers
should be defined. No aliasing or forwarding is done.
- Also, note that absolutely no anti-spam or anti-relaying
- is done in a null client configuration. More information
- can be found in the ANTI-SPAM CONFIGURATION CONTROL section.
local_lmtp Use an LMTP capable local mailer. The argument to this
feature is the pathname of an LMTP capable mailer. By
@@ -786,27 +783,14 @@ relay_hosts_only
relay_based_on_MX
Turns on the ability to allow relaying based on the MX
- records of the host portion of an incoming recipient; that
- is, if an MX record for host foo.com points to your site,
- you will accept and relay mail addressed to foo.com. See
+ records of the host portion of an incoming recipient. See
description below for more information before using this
- feature. Also, see the KNOWNBUGS entry regarding bestmx
- map lookups.
-
- FEATURE(relay_based_on_MX) does not necessarily allow
- routing of these messages which you expect to be allowed,
- if route address syntax (or %-hack syntax) is used. If
- this is a problem, add entries to the access-table or use
- FEATURE(loose_relay_check).
+ feature.
relay_local_from
Allows relaying if the domain portion of the mail sender
is a local host. This should only be used if absolutely
- necessary as it opens a window for spammers. Specifically,
- they can send mail to your mail server that claims to be
- from your domain (either directly or via a routed address),
- and you will go ahead and relay it out to arbitrary hosts
- on the Internet.
+ necessary as it opens a window for spammers.
accept_unqualified_senders
Normally, MAIL FROM: commands in the SMTP session will be
@@ -1219,8 +1203,7 @@ If you use
FEATURE(relay_entire_domain)
then any host in any of your local domains (that is, the $=m class)
-will be relayed (that is, you will accept mail either to or from any
-host in your domain).
+will be relayed.
You can also allow relaying based on the MX records of the host
portion of an incoming recipient address by using
@@ -1229,11 +1212,9 @@ portion of an incoming recipient address by using
For example, if your server receives a recipient of user@domain.com
and domain.com lists your server in its MX records, the mail will be
-accepted for relay to domain.com. Note that this will stop spammers
-from using your host to relay spam but it will not stop outsiders from
-using your server as a relay for their site (that is, they set up an
-MX record pointing to your mail server, and you will relay mail addressed
-to them without any prior arrangement). Along the same lines,
+accepted. Note that this will stop spammers from using your host to
+relay spam but it will not stop outsiders from using your server as a
+relay for their site. Along the same lines,
FEATURE(relay_local_from)
@@ -1284,39 +1265,28 @@ definition for the database; for example
FEATURE(access_db, hash -o /etc/mail/access)
-Remember, since /etc/mail/access is a database, after creating the text
-file as described below, you must use makemap to create the database
-map. For example:
-
-makemap hash /etc/mail/access < /etc/mail/access
-
The table itself uses e-mail addresses, domain names, and network
numbers as keys. For example,
spammer@aol.com REJECT
cyberspammer.com REJECT
- 192.168.212 REJECT
+ 206.117.147 REJECT
would refuse mail from spammer@aol.com, any user from cyberspammer.com
(or any host within the cyberspammer.com domain), and any host on the
-192.168.212.* network.
+206.117.147.* network.
The value part of the map can contain:
- OK Accept mail even if other rules in the
- running ruleset would reject it, for example,
- if the domain name is unresolvable.
- RELAY Accept mail addressed to the indicated domain or
- received from the indicated domain for relaying
- through your SMTP server. RELAY also serves as
- an implicit OK for the other checks.
- REJECT Reject the sender or recipient with a general
+ OK accept mail even if other rules in the
+ running ruleset would reject it.
+ RELAY Allow domain to relay through your SMTP
+ server. RELAY also serves an implicit
+ OK for the other checks.
+ REJECT reject the sender/recipient with a general
purpose message.
- DISCARD Discard the message completely using the
- $#discard mailer. This only works for sender
- addresses (i.e., it indicates that you should
- discard anything received from the indicated
- domain).
+ DISCARD discard the message completely using
+ the $#discard mailer
### any text where ### is an RFC 821 compliant error code
and "any text" is a message to return for
the command.
@@ -1363,15 +1333,7 @@ domains, or addresses in your domain which should not receive mail:
This would prevent a recipient of badlocaluser@mydomain.com, any
user at host.mydomain.com, and the single address
-user@otherhost.mydomain.com from receiving mail. Enabling this
-feature will keep you from sending mails to all addresses that
-have an error message or REJECT as value part in the access map.
-Taking the example from above:
-
- spammer@aol.com REJECT
- cyberspammer.com REJECT
-
-Mail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
+user@otherhost.mydomain.com from receiving mail.
There is also a ``Realtime Blackhole List'' run by the MAPS project
at http://maps.vix.com/. This is a database maintained in DNS of
@@ -1420,17 +1382,6 @@ a Message-ID: header:
R< $+ @ $+ > $@ OK
R$* $#error $: 553 Header Error
-Users of FEATURE(nullclient) who desire to use the anti-spam and
-anti-relaying capabilities should replace FEATURE(nullclient, mailhub)
-with:
-
- undefine(`ALIAS_FILE')
- define(`MAIL_HUB', `mailhub')
- define(`SMART_HOST', `mailhub')
- define(`confFORWARD_PATH', `')
-
-where mailhub is the fully qualified hostname for their mail server.
-
+--------------------------------+
| ADDING NEW MAILERS OR RULESETS |
@@ -1761,7 +1712,7 @@ confAUTO_REBUILD AutoRebuildAliases
file if needed.
confERROR_MODE ErrorMode [print] Error message mode.
confERROR_MESSAGE ErrorHeader [undefined] Error message header/file.
-confSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines.
+confSAVE_FROM_LINES SafeFromLine Save extra leading From_ lines.
confTEMP_FILE_MODE TempFileMode [0600] Temporary file mode.
confMATCH_GECOS MatchGECOS [False] Match GECOS field.
confMAX_HOP MaxHopCount [25] Maximum hop count.
diff --git a/contrib/sendmail/cf/cf/Build b/contrib/sendmail/cf/cf/Build
index 3a91477cdf10..3efaffdcdba8 100755
--- a/contrib/sendmail/cf/cf/Build
+++ b/contrib/sendmail/cf/cf/Build
@@ -7,7 +7,7 @@
# the sendmail distribution.
#
#
-# @(#)Build 8.3 (Berkeley) 5/19/1998
+# @(#)Build 8.3 (Berkeley) 5/19/98
#
#
diff --git a/contrib/sendmail/cf/cf/Makefile b/contrib/sendmail/cf/cf/Makefile
index 7d0f373d348e..8b6fb4d64e96 100644
--- a/contrib/sendmail/cf/cf/Makefile
+++ b/contrib/sendmail/cf/cf/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for configuration files.
#
-# @(#)Makefile 8.17 (Berkeley) 4/2/1998
+# @(#)Makefile 8.17 (Berkeley) 4/2/98
#
#
diff --git a/contrib/sendmail/cf/cf/chez.cs.mc b/contrib/sendmail/cf/cf/chez.cs.mc
index a5334b5a50ab..9858330bd407 100644
--- a/contrib/sendmail/cf/cf/chez.cs.mc
+++ b/contrib/sendmail/cf/cf/chez.cs.mc
@@ -23,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)chez.cs.mc 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)chez.cs.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/clientproto.mc b/contrib/sendmail/cf/cf/clientproto.mc
index b0fd9bdf4a5e..f0a6ae7d6b23 100644
--- a/contrib/sendmail/cf/cf/clientproto.mc
+++ b/contrib/sendmail/cf/cf/clientproto.mc
@@ -27,7 +27,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)clientproto.mc 8.12 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)clientproto.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(unknown)
FEATURE(nullclient, mailhost.$m)
diff --git a/contrib/sendmail/cf/cf/cs-hpux10.mc b/contrib/sendmail/cf/cf/cs-hpux10.mc
index 0be009c5b6b1..527f9308b990 100644
--- a/contrib/sendmail/cf/cf/cs-hpux10.mc
+++ b/contrib/sendmail/cf/cf/cs-hpux10.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-hpux10.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-hpux10.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(hpux10)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/cs-hpux9.mc b/contrib/sendmail/cf/cf/cs-hpux9.mc
index 9b5edfe3ea48..f65505296fec 100644
--- a/contrib/sendmail/cf/cf/cs-hpux9.mc
+++ b/contrib/sendmail/cf/cf/cs-hpux9.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-hpux9.mc 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-hpux9.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/cs-osf1.mc b/contrib/sendmail/cf/cf/cs-osf1.mc
index 230023ceb137..ba35c04ac687 100644
--- a/contrib/sendmail/cf/cf/cs-osf1.mc
+++ b/contrib/sendmail/cf/cf/cs-osf1.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-osf1.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-osf1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/cs-solaris2.mc b/contrib/sendmail/cf/cf/cs-solaris2.mc
index 03fd5e275586..395d19fc7aa5 100644
--- a/contrib/sendmail/cf/cf/cs-solaris2.mc
+++ b/contrib/sendmail/cf/cf/cs-solaris2.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-solaris2.mc 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-solaris2.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(solaris2)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/cs-sunos4.1.mc b/contrib/sendmail/cf/cf/cs-sunos4.1.mc
index 39136399732a..45dcd124d99f 100644
--- a/contrib/sendmail/cf/cf/cs-sunos4.1.mc
+++ b/contrib/sendmail/cf/cf/cs-sunos4.1.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-sunos4.1.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-sunos4.1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/cs-ultrix4.mc b/contrib/sendmail/cf/cf/cs-ultrix4.mc
index a12b9898ef35..f2a4b423b907 100644
--- a/contrib/sendmail/cf/cf/cs-ultrix4.mc
+++ b/contrib/sendmail/cf/cf/cs-ultrix4.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-ultrix4.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cs-ultrix4.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-bsd4.4.mc b/contrib/sendmail/cf/cf/generic-bsd4.4.mc
index b09760532d49..106fa31c44dd 100644
--- a/contrib/sendmail/cf/cf/generic-bsd4.4.mc
+++ b/contrib/sendmail/cf/cf/generic-bsd4.4.mc
@@ -20,7 +20,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-bsd4.4.mc 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-bsd4.4.mc 8.7 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-hpux10.mc b/contrib/sendmail/cf/cf/generic-hpux10.mc
index 200050557c7f..1a7eda909423 100644
--- a/contrib/sendmail/cf/cf/generic-hpux10.mc
+++ b/contrib/sendmail/cf/cf/generic-hpux10.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-hpux10.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-hpux10.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(hpux10)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-hpux9.mc b/contrib/sendmail/cf/cf/generic-hpux9.mc
index 531b4eec5572..6aaf3b65e3de 100644
--- a/contrib/sendmail/cf/cf/generic-hpux9.mc
+++ b/contrib/sendmail/cf/cf/generic-hpux9.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-hpux9.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-hpux9.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-nextstep3.3.mc b/contrib/sendmail/cf/cf/generic-nextstep3.3.mc
index 1511ce7bb919..5c81faaf6e7a 100644
--- a/contrib/sendmail/cf/cf/generic-nextstep3.3.mc
+++ b/contrib/sendmail/cf/cf/generic-nextstep3.3.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-nextstep3.3.mc 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-nextstep3.3.mc 8.7 (Berkeley) 5/19/98')
OSTYPE(nextstep)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-osf1.mc b/contrib/sendmail/cf/cf/generic-osf1.mc
index 83858d13680a..2113b927223f 100644
--- a/contrib/sendmail/cf/cf/generic-osf1.mc
+++ b/contrib/sendmail/cf/cf/generic-osf1.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-osf1.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-osf1.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-solaris2.mc b/contrib/sendmail/cf/cf/generic-solaris2.mc
index a696e019a9aa..1e1aa96a6c43 100644
--- a/contrib/sendmail/cf/cf/generic-solaris2.mc
+++ b/contrib/sendmail/cf/cf/generic-solaris2.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-solaris2.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-solaris2.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-sunos4.1.mc b/contrib/sendmail/cf/cf/generic-sunos4.1.mc
index fc0de356137b..7e916c15ea88 100644
--- a/contrib/sendmail/cf/cf/generic-sunos4.1.mc
+++ b/contrib/sendmail/cf/cf/generic-sunos4.1.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-sunos4.1.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-sunos4.1.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/generic-ultrix4.mc b/contrib/sendmail/cf/cf/generic-ultrix4.mc
index 6fed36e8af5d..8c900b86e713 100644
--- a/contrib/sendmail/cf/cf/generic-ultrix4.mc
+++ b/contrib/sendmail/cf/cf/generic-ultrix4.mc
@@ -19,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-ultrix4.mc 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic-ultrix4.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/huginn.cs.mc b/contrib/sendmail/cf/cf/huginn.cs.mc
index a58d121f09ae..949e917882d5 100644
--- a/contrib/sendmail/cf/cf/huginn.cs.mc
+++ b/contrib/sendmail/cf/cf/huginn.cs.mc
@@ -21,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)huginn.cs.mc 8.12 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)huginn.cs.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/knecht.mc b/contrib/sendmail/cf/cf/knecht.mc
index 026c8fbca0c0..97e5e43eb36a 100644
--- a/contrib/sendmail/cf/cf/knecht.mc
+++ b/contrib/sendmail/cf/cf/knecht.mc
@@ -16,7 +16,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)knecht.mc 8.30 (Berkeley) 6/11/1998')
+VERSIONID(`@(#)knecht.mc 8.30 (Berkeley) 6/11/98')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward+$h:$z/.forward')dnl
diff --git a/contrib/sendmail/cf/cf/mail.cs.mc b/contrib/sendmail/cf/cf/mail.cs.mc
index 8abd9451ca9b..1ecf34e2a910 100644
--- a/contrib/sendmail/cf/cf/mail.cs.mc
+++ b/contrib/sendmail/cf/cf/mail.cs.mc
@@ -21,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mail.cs.mc 8.15 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)mail.cs.mc 8.15 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/mail.eecs.mc b/contrib/sendmail/cf/cf/mail.eecs.mc
index 6522141d265c..42d053d70ee1 100644
--- a/contrib/sendmail/cf/cf/mail.eecs.mc
+++ b/contrib/sendmail/cf/cf/mail.eecs.mc
@@ -21,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mail.eecs.mc 8.15 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)mail.eecs.mc 8.15 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(EECS.Berkeley.EDU)dnl
MASQUERADE_AS(EECS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/mailspool.cs.mc b/contrib/sendmail/cf/cf/mailspool.cs.mc
index 08dcce6cc9c7..7ae62b24d607 100644
--- a/contrib/sendmail/cf/cf/mailspool.cs.mc
+++ b/contrib/sendmail/cf/cf/mailspool.cs.mc
@@ -23,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mailspool.cs.mc 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)mailspool.cs.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/python.cs.mc b/contrib/sendmail/cf/cf/python.cs.mc
index ddf4fc34300b..2cb111d0b655 100644
--- a/contrib/sendmail/cf/cf/python.cs.mc
+++ b/contrib/sendmail/cf/cf/python.cs.mc
@@ -23,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)python.cs.mc 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)python.cs.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/cf/s2k-osf1.mc b/contrib/sendmail/cf/cf/s2k-osf1.mc
index 6f1099a69fd3..1c7b1ccd1d74 100644
--- a/contrib/sendmail/cf/cf/s2k-osf1.mc
+++ b/contrib/sendmail/cf/cf/s2k-osf1.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)s2k-osf1.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)s2k-osf1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/s2k-ultrix4.mc b/contrib/sendmail/cf/cf/s2k-ultrix4.mc
index db8e45599753..06c70d45be63 100644
--- a/contrib/sendmail/cf/cf/s2k-ultrix4.mc
+++ b/contrib/sendmail/cf/cf/s2k-ultrix4.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)s2k-ultrix4.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)s2k-ultrix4.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/tcpproto.mc b/contrib/sendmail/cf/cf/tcpproto.mc
index 692a08fbb375..eb6eadecb656 100644
--- a/contrib/sendmail/cf/cf/tcpproto.mc
+++ b/contrib/sendmail/cf/cf/tcpproto.mc
@@ -25,7 +25,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)tcpproto.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)tcpproto.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(unknown)
FEATURE(nouucp)
MAILER(local)
diff --git a/contrib/sendmail/cf/cf/ucbarpa.mc b/contrib/sendmail/cf/cf/ucbarpa.mc
index 40bb6c22636c..925d47fefb74 100644
--- a/contrib/sendmail/cf/cf/ucbarpa.mc
+++ b/contrib/sendmail/cf/cf/ucbarpa.mc
@@ -20,7 +20,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)ucbarpa.mc 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)ucbarpa.mc 8.9 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/cf/ucbvax.mc b/contrib/sendmail/cf/cf/ucbvax.mc
index 2395f8264559..76027fb951e4 100644
--- a/contrib/sendmail/cf/cf/ucbvax.mc
+++ b/contrib/sendmail/cf/cf/ucbvax.mc
@@ -21,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)ucbvax.mc 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)ucbvax.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(bsd4.3)
DOMAIN(CS.Berkeley.EDU)
MASQUERADE_AS(CS.Berkeley.EDU)
diff --git a/contrib/sendmail/cf/cf/uucpproto.mc b/contrib/sendmail/cf/cf/uucpproto.mc
index a547d1037fa6..4f1c54a332e2 100644
--- a/contrib/sendmail/cf/cf/uucpproto.mc
+++ b/contrib/sendmail/cf/cf/uucpproto.mc
@@ -25,7 +25,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)uucpproto.mc 8.12 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)uucpproto.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(unknown)
FEATURE(promiscuous_relay)dnl
FEATURE(accept_unresolvable_domains)dnl
diff --git a/contrib/sendmail/cf/cf/vangogh.cs.mc b/contrib/sendmail/cf/cf/vangogh.cs.mc
index f60dca79c368..deefc29febde 100644
--- a/contrib/sendmail/cf/cf/vangogh.cs.mc
+++ b/contrib/sendmail/cf/cf/vangogh.cs.mc
@@ -22,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)vangogh.cs.mc 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)vangogh.cs.mc 8.10 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/contrib/sendmail/cf/domain/Berkeley.EDU.m4 b/contrib/sendmail/cf/domain/Berkeley.EDU.m4
index 85d5e5be60d5..48e151b7b285 100644
--- a/contrib/sendmail/cf/domain/Berkeley.EDU.m4
+++ b/contrib/sendmail/cf/domain/Berkeley.EDU.m4
@@ -11,7 +11,7 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)Berkeley.EDU.m4 8.14 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)Berkeley.EDU.m4 8.14 (Berkeley) 5/19/98')
DOMAIN(berkeley-only)dnl
define(`BITNET_RELAY', `bitnet-relay.Berkeley.EDU')dnl
define(`UUCP_RELAY', `uucp-relay.Berkeley.EDU')dnl
diff --git a/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 b/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4
index 5609ce8464a5..20309210b8c6 100644
--- a/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4
+++ b/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4
@@ -11,7 +11,7 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)CS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)CS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(Berkeley.EDU)dnl
HACK(cssubdomain)dnl
define(`confUSERDB_SPEC',
diff --git a/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 b/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4
index 095fbc800e6e..022dddd13a57 100644
--- a/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4
+++ b/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4
@@ -11,6 +11,6 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)EECS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)EECS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(Berkeley.EDU)dnl
MASQUERADE_AS(EECS.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 b/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4
index a951f8b24e34..14965a6bff0e 100644
--- a/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4
+++ b/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4
@@ -11,6 +11,6 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)S2K.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)S2K.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
MASQUERADE_AS(postgres.Berkeley.EDU)dnl
diff --git a/contrib/sendmail/cf/domain/berkeley-only.m4 b/contrib/sendmail/cf/domain/berkeley-only.m4
index 805bab6a682a..d3d770811c68 100644
--- a/contrib/sendmail/cf/domain/berkeley-only.m4
+++ b/contrib/sendmail/cf/domain/berkeley-only.m4
@@ -11,7 +11,7 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)unspecified-domain.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)unspecified-domain.m4 8.7 (Berkeley) 5/19/98')
errprint(`*** ERROR: You are trying to use the Berkeley sample configuration')
errprint(` files outside of the Computer Science Division at Berkeley.')
errprint(` The configuration (.mc) files must be customized to reference')
diff --git a/contrib/sendmail/cf/domain/generic.m4 b/contrib/sendmail/cf/domain/generic.m4
index 93057d09a98e..1329e4499b81 100644
--- a/contrib/sendmail/cf/domain/generic.m4
+++ b/contrib/sendmail/cf/domain/generic.m4
@@ -19,7 +19,7 @@ divert(-1)
# files.
#
divert(0)
-VERSIONID(`@(#)generic.m4 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)generic.m4 8.9 (Berkeley) 5/19/98')
define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward')dnl
FEATURE(redirect)dnl
FEATURE(use_cw_file)dnl
diff --git a/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 b/contrib/sendmail/cf/feature/accept_unqualified_senders.m4
index bf1b1e798452..16bef7825394 100644
--- a/contrib/sendmail/cf/feature/accept_unqualified_senders.m4
+++ b/contrib/sendmail/cf/feature/accept_unqualified_senders.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)accept_unqualified_senders.m4 8.3 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)accept_unqualified_senders.m4 8.3 (Berkeley) 5/19/98')
divert(-1)
define(`_ACCEPT_UNQUALIFIED_SENDERS_', 1)
diff --git a/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 b/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4
index cbc4747d2207..5b7241a314e5 100644
--- a/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4
+++ b/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)accept_unresolvable_domains.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)accept_unresolvable_domains.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
define(`_ACCEPT_UNRESOLVABLE_DOMAINS_', 1)
diff --git a/contrib/sendmail/cf/feature/access_db.m4 b/contrib/sendmail/cf/feature/access_db.m4
index 75b5551ac2ce..85820723deee 100644
--- a/contrib/sendmail/cf/feature/access_db.m4
+++ b/contrib/sendmail/cf/feature/access_db.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)access_db.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)access_db.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
define(`ACCESS_TABLE',
diff --git a/contrib/sendmail/cf/feature/allmasquerade.m4 b/contrib/sendmail/cf/feature/allmasquerade.m4
index ed622dcac6c6..42121e5cc488 100644
--- a/contrib/sendmail/cf/feature/allmasquerade.m4
+++ b/contrib/sendmail/cf/feature/allmasquerade.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)allmasquerade.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)allmasquerade.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
diff --git a/contrib/sendmail/cf/feature/always_add_domain.m4 b/contrib/sendmail/cf/feature/always_add_domain.m4
index 69092e31d008..e609bf000277 100644
--- a/contrib/sendmail/cf/feature/always_add_domain.m4
+++ b/contrib/sendmail/cf/feature/always_add_domain.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)always_add_domain.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)always_add_domain.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_ALWAYS_ADD_DOMAIN_', 1)
diff --git a/contrib/sendmail/cf/feature/bestmx_is_local.m4 b/contrib/sendmail/cf/feature/bestmx_is_local.m4
index 40643877af88..2d3048809ecc 100644
--- a/contrib/sendmail/cf/feature/bestmx_is_local.m4
+++ b/contrib/sendmail/cf/feature/bestmx_is_local.m4
@@ -12,11 +12,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bestmx_is_local.m4 8.13 (Berkeley) 8/13/1998')
+VERSIONID(`@(#)bestmx_is_local.m4 8.12 (Berkeley) 5/19/98')
divert(-1)
-define(_BESTMX_IS_LOCAL_, _ARG_)
-
LOCAL_CONFIG
# turn on bestMX lookup table
Kbestmx bestmx
diff --git a/contrib/sendmail/cf/feature/bitdomain.m4 b/contrib/sendmail/cf/feature/bitdomain.m4
index 7f9a181e4826..be5155bd3242 100644
--- a/contrib/sendmail/cf/feature/bitdomain.m4
+++ b/contrib/sendmail/cf/feature/bitdomain.m4
@@ -12,11 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bitdomain.m4 8.14 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)bitdomain.m4 8.13 (Berkeley) 5/19/98')
divert(-1)
-define(`BITDOMAIN_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/bitdomain',
- DATABASE_MAP_TYPE` -o /etc/bitdomain'),
- `_ARG_'))dnl
+define(`BITDOMAIN_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/bitdomain', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/blacklist_recipients.m4 b/contrib/sendmail/cf/feature/blacklist_recipients.m4
index e3478d36ff1a..4417fe093695 100644
--- a/contrib/sendmail/cf/feature/blacklist_recipients.m4
+++ b/contrib/sendmail/cf/feature/blacklist_recipients.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)blacklist_recipients.m4 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)blacklist_recipients.m4 8.9 (Berkeley) 5/19/98')
divert(-1)
ifdef(`ACCESS_TABLE',
diff --git a/contrib/sendmail/cf/feature/domaintable.m4 b/contrib/sendmail/cf/feature/domaintable.m4
index e7303dcdd87c..0bf9f05fb340 100644
--- a/contrib/sendmail/cf/feature/domaintable.m4
+++ b/contrib/sendmail/cf/feature/domaintable.m4
@@ -12,12 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)domaintable.m4 8.9 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)domaintable.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
-define(`DOMAIN_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/domaintable',
- DATABASE_MAP_TYPE` -o /etc/domaintable'),
- `_ARG_'))dnl
-
+define(`DOMAIN_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/domaintable', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/genericstable.m4 b/contrib/sendmail/cf/feature/genericstable.m4
index 654db5d9a168..ec7a4d3f7d51 100644
--- a/contrib/sendmail/cf/feature/genericstable.m4
+++ b/contrib/sendmail/cf/feature/genericstable.m4
@@ -12,11 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)genericstable.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)genericstable.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
-define(`GENERICS_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/genericstable',
- DATABASE_MAP_TYPE` -o /etc/genericstable'),
- `_ARG_'))dnl
+define(`GENERICS_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/genericstable', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/limited_masquerade.m4 b/contrib/sendmail/cf/feature/limited_masquerade.m4
index b036ae134be6..ae5e868ed966 100644
--- a/contrib/sendmail/cf/feature/limited_masquerade.m4
+++ b/contrib/sendmail/cf/feature/limited_masquerade.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)limited_masquerade.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)limited_masquerade.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_LIMITED_MASQUERADE_', 1)
diff --git a/contrib/sendmail/cf/feature/local_lmtp.m4 b/contrib/sendmail/cf/feature/local_lmtp.m4
index f328ce54a293..f323b5b1908e 100644
--- a/contrib/sendmail/cf/feature/local_lmtp.m4
+++ b/contrib/sendmail/cf/feature/local_lmtp.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)local_lmtp.m4 8.5 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)local_lmtp.m4 8.5 (Berkeley) 5/19/98')
divert(-1)
define(`LOCAL_MAILER_PATH',
diff --git a/contrib/sendmail/cf/feature/local_procmail.m4 b/contrib/sendmail/cf/feature/local_procmail.m4
index 20618dd5551c..adf1237b3987 100644
--- a/contrib/sendmail/cf/feature/local_procmail.m4
+++ b/contrib/sendmail/cf/feature/local_procmail.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)local_procmail.m4 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)local_procmail.m4 8.11 (Berkeley) 5/19/98')
divert(-1)
define(`LOCAL_MAILER_PATH',
diff --git a/contrib/sendmail/cf/feature/loose_relay_check.m4 b/contrib/sendmail/cf/feature/loose_relay_check.m4
index 988e44144f6a..6e3584b02ed8 100644
--- a/contrib/sendmail/cf/feature/loose_relay_check.m4
+++ b/contrib/sendmail/cf/feature/loose_relay_check.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)loose_relay_check.m4 8.3 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)loose_relay_check.m4 8.3 (Berkeley) 5/19/98')
divert(-1)
define(`_LOOSE_RELAY_CHECK_', 1)
diff --git a/contrib/sendmail/cf/feature/mailertable.m4 b/contrib/sendmail/cf/feature/mailertable.m4
index 71a41adf3a75..3078261a452c 100644
--- a/contrib/sendmail/cf/feature/mailertable.m4
+++ b/contrib/sendmail/cf/feature/mailertable.m4
@@ -12,11 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)mailertable.m4 8.10 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)mailertable.m4 8.9 (Berkeley) 5/19/98')
divert(-1)
-define(`MAILER_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/mailertable',
- DATABASE_MAP_TYPE` -o /etc/mailertable'),
- `_ARG_'))dnl
+define(`MAILER_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/mailertable', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 b/contrib/sendmail/cf/feature/masquerade_entire_domain.m4
index 4455b9a70851..9766ae4499a0 100644
--- a/contrib/sendmail/cf/feature/masquerade_entire_domain.m4
+++ b/contrib/sendmail/cf/feature/masquerade_entire_domain.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)masquerade_entire_domain.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)masquerade_entire_domain.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_MASQUERADE_ENTIRE_DOMAIN_', 1)
diff --git a/contrib/sendmail/cf/feature/masquerade_envelope.m4 b/contrib/sendmail/cf/feature/masquerade_envelope.m4
index 276c7f41d40c..75d257e64f5d 100644
--- a/contrib/sendmail/cf/feature/masquerade_envelope.m4
+++ b/contrib/sendmail/cf/feature/masquerade_envelope.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)masquerade_envelope.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)masquerade_envelope.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_MASQUERADE_ENVELOPE_', 1)
diff --git a/contrib/sendmail/cf/feature/nocanonify.m4 b/contrib/sendmail/cf/feature/nocanonify.m4
index 279a8eaae1bc..6211a8ebec55 100644
--- a/contrib/sendmail/cf/feature/nocanonify.m4
+++ b/contrib/sendmail/cf/feature/nocanonify.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nocanonify.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)nocanonify.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_NO_CANONIFY_', 1)
diff --git a/contrib/sendmail/cf/feature/nodns.m4 b/contrib/sendmail/cf/feature/nodns.m4
index 5d383d5475e7..26458fc3af89 100644
--- a/contrib/sendmail/cf/feature/nodns.m4
+++ b/contrib/sendmail/cf/feature/nodns.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nodns.m4 8.9 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)nodns.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
undefine(`confBIND_OPTS')dnl
errprint(`FEATURE(nodns) is no-op.
-Use ServiceSwitchFile ('ifdef(`confSERVICE_SWITCH_FILE',confSERVICE_SWITCH_FILE,ifdef(`_USE_ETC_MAIL_',`/etc/mail/service.switch',`/etc/service.switch'))`) if your OS does not provide its own instead.
+Use ServiceSwitchFile ('ifdef(`confSERVICE_SWITCH_FILE',confSERVICE_SWITCH_FILE,`/etc/service.switch' if your OS does not provide its own)`) instead.
')
diff --git a/contrib/sendmail/cf/feature/notsticky.m4 b/contrib/sendmail/cf/feature/notsticky.m4
index 5ba6b2f70ce1..4fa344d70696 100644
--- a/contrib/sendmail/cf/feature/notsticky.m4
+++ b/contrib/sendmail/cf/feature/notsticky.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)notsticky.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)notsticky.m4 8.8 (Berkeley) 5/19/98')
#
# This is now the default. Use ``FEATURE(stickyhost)'' if you want
# the old default behaviour.
diff --git a/contrib/sendmail/cf/feature/nouucp.m4 b/contrib/sendmail/cf/feature/nouucp.m4
index 7cf241f77f70..3c1098cac4e6 100644
--- a/contrib/sendmail/cf/feature/nouucp.m4
+++ b/contrib/sendmail/cf/feature/nouucp.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nouucp.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)nouucp.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_NO_UUCP_', 1)
diff --git a/contrib/sendmail/cf/feature/nullclient.m4 b/contrib/sendmail/cf/feature/nullclient.m4
index 99346ae03153..1df782e24dea 100644
--- a/contrib/sendmail/cf/feature/nullclient.m4
+++ b/contrib/sendmail/cf/feature/nullclient.m4
@@ -23,7 +23,7 @@ POPDIVERT
# sendmail.
#
-VERSIONID(`@(#)nullclient.m4 8.12 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)nullclient.m4 8.12 (Berkeley) 5/19/98')
PUSHDIVERT(6)
# hub host (to which all mail is sent)
diff --git a/contrib/sendmail/cf/feature/promiscuous_relay.m4 b/contrib/sendmail/cf/feature/promiscuous_relay.m4
index cc3dae62f639..975afab752d6 100644
--- a/contrib/sendmail/cf/feature/promiscuous_relay.m4
+++ b/contrib/sendmail/cf/feature/promiscuous_relay.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)promiscuous_relay.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)promiscuous_relay.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
define(`_PROMISCUOUS_RELAY_', 1)
diff --git a/contrib/sendmail/cf/feature/rbl.m4 b/contrib/sendmail/cf/feature/rbl.m4
index 0284aa3cbd87..a9251e049782 100644
--- a/contrib/sendmail/cf/feature/rbl.m4
+++ b/contrib/sendmail/cf/feature/rbl.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)rbl.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)rbl.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
define(`_RBL_', ifelse(_ARG_, `', `rbl.maps.vix.com', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/redirect.m4 b/contrib/sendmail/cf/feature/redirect.m4
index a9b333ff1c88..721d2260c284 100644
--- a/contrib/sendmail/cf/feature/redirect.m4
+++ b/contrib/sendmail/cf/feature/redirect.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)redirect.m4 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)redirect.m4 8.10 (Berkeley) 5/19/98')
divert(-1)
diff --git a/contrib/sendmail/cf/feature/relay_based_on_MX.m4 b/contrib/sendmail/cf/feature/relay_based_on_MX.m4
index f19e89b6d782..44d07116ceb0 100644
--- a/contrib/sendmail/cf/feature/relay_based_on_MX.m4
+++ b/contrib/sendmail/cf/feature/relay_based_on_MX.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)relay_based_on_MX.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)relay_based_on_MX.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
define(`_RELAY_MX_SERVED_', 1)
diff --git a/contrib/sendmail/cf/feature/relay_entire_domain.m4 b/contrib/sendmail/cf/feature/relay_entire_domain.m4
index c932a70ab396..823da1e50ff1 100644
--- a/contrib/sendmail/cf/feature/relay_entire_domain.m4
+++ b/contrib/sendmail/cf/feature/relay_entire_domain.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)relay_entire_domain.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)relay_entire_domain.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
define(`_RELAY_ENTIRE_DOMAIN_', 1)
diff --git a/contrib/sendmail/cf/feature/relay_hosts_only.m4 b/contrib/sendmail/cf/feature/relay_hosts_only.m4
index 35f7ab528494..98f72c8f82d8 100644
--- a/contrib/sendmail/cf/feature/relay_hosts_only.m4
+++ b/contrib/sendmail/cf/feature/relay_hosts_only.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)relay_hosts_only.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)relay_hosts_only.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
define(`_RELAY_HOSTS_ONLY_', 1)
diff --git a/contrib/sendmail/cf/feature/relay_local_from.m4 b/contrib/sendmail/cf/feature/relay_local_from.m4
index ab040f6c2ff3..549bc9c74232 100644
--- a/contrib/sendmail/cf/feature/relay_local_from.m4
+++ b/contrib/sendmail/cf/feature/relay_local_from.m4
@@ -9,7 +9,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)relay_local_from.m4 8.2 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)relay_local_from.m4 8.2 (Berkeley) 5/19/98')
divert(-1)
define(`_RELAY_LOCAL_FROM_', 1)
diff --git a/contrib/sendmail/cf/feature/smrsh.m4 b/contrib/sendmail/cf/feature/smrsh.m4
index 3b44fa88a67d..2c47632649b3 100644
--- a/contrib/sendmail/cf/feature/smrsh.m4
+++ b/contrib/sendmail/cf/feature/smrsh.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)smrsh.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)smrsh.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
ifdef(`_MAILER_local_',
diff --git a/contrib/sendmail/cf/feature/stickyhost.m4 b/contrib/sendmail/cf/feature/stickyhost.m4
index 1d0d1cd590e4..8bbeb49cac62 100644
--- a/contrib/sendmail/cf/feature/stickyhost.m4
+++ b/contrib/sendmail/cf/feature/stickyhost.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)stickyhost.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)stickyhost.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_STICKY_LOCAL_DOMAIN_', 1)
diff --git a/contrib/sendmail/cf/feature/use_ct_file.m4 b/contrib/sendmail/cf/feature/use_ct_file.m4
index 924dd06e0c8f..344d178504d1 100644
--- a/contrib/sendmail/cf/feature/use_ct_file.m4
+++ b/contrib/sendmail/cf/feature/use_ct_file.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)use_ct_file.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)use_ct_file.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
# if defined, the sendmail.cf will read the /etc/sendmail.ct file
diff --git a/contrib/sendmail/cf/feature/use_cw_file.m4 b/contrib/sendmail/cf/feature/use_cw_file.m4
index 5bbbf7b2b07b..9abf2c1b4992 100644
--- a/contrib/sendmail/cf/feature/use_cw_file.m4
+++ b/contrib/sendmail/cf/feature/use_cw_file.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)use_cw_file.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)use_cw_file.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
# if defined, the sendmail.cf will read the /etc/sendmail.cw file
diff --git a/contrib/sendmail/cf/feature/uucpdomain.m4 b/contrib/sendmail/cf/feature/uucpdomain.m4
index 0c584aa2e59f..1c6a33a81fa7 100644
--- a/contrib/sendmail/cf/feature/uucpdomain.m4
+++ b/contrib/sendmail/cf/feature/uucpdomain.m4
@@ -12,11 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)uucpdomain.m4 8.14 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)uucpdomain.m4 8.13 (Berkeley) 5/19/98')
divert(-1)
-define(`UUDOMAIN_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/uudomain',
- DATABASE_MAP_TYPE` -o /etc/uudomain'),
- `_ARG_'))dnl
+define(`UUDOMAIN_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/uudomain', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/feature/virtusertable.m4 b/contrib/sendmail/cf/feature/virtusertable.m4
index 316f7ea61dcd..337f635766c0 100644
--- a/contrib/sendmail/cf/feature/virtusertable.m4
+++ b/contrib/sendmail/cf/feature/virtusertable.m4
@@ -12,11 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)virtusertable.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)virtusertable.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
-define(`VIRTUSER_TABLE', ifelse(_ARG_, `',
- ifdef(`_USE_ETC_MAIL_',
- DATABASE_MAP_TYPE` -o /etc/mail/virtusertable',
- DATABASE_MAP_TYPE` -o /etc/virtusertable'),
- `_ARG_'))dnl
+define(`VIRTUSER_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/virtusertable', `_ARG_'))dnl
diff --git a/contrib/sendmail/cf/hack/cssubdomain.m4 b/contrib/sendmail/cf/hack/cssubdomain.m4
index 6297d64b6c85..b79b69b5b119 100644
--- a/contrib/sendmail/cf/hack/cssubdomain.m4
+++ b/contrib/sendmail/cf/hack/cssubdomain.m4
@@ -11,7 +11,7 @@ divert(-1)
#
#
divert(0)
-VERSIONID(`@(#)cssubdomain.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)cssubdomain.m4 8.6 (Berkeley) 5/19/98')
divert(2)
# find possible (old & new) versions of our name via short circuit hack
diff --git a/contrib/sendmail/cf/m4/cf.m4 b/contrib/sendmail/cf/m4/cf.m4
index 0b058098e32b..21655822b226 100644
--- a/contrib/sendmail/cf/m4/cf.m4
+++ b/contrib/sendmail/cf/m4/cf.m4
@@ -25,4 +25,4 @@ ifdef(`_CF_DIR_', `',
divert(0)dnl
ifdef(`OSTYPE', `dnl',
`include(_CF_DIR_`'m4/cfhead.m4)dnl
-VERSIONID(`@(#)cf.m4 8.29 (Berkeley) 5/19/1998')')
+VERSIONID(`@(#)cf.m4 8.29 (Berkeley) 5/19/98')')
diff --git a/contrib/sendmail/cf/m4/cfhead.m4 b/contrib/sendmail/cf/m4/cfhead.m4
index abd390e69b44..d5778e8a4b19 100644
--- a/contrib/sendmail/cf/m4/cfhead.m4
+++ b/contrib/sendmail/cf/m4/cfhead.m4
@@ -105,7 +105,7 @@ define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
m4wrap(`include(_CF_DIR_`m4/proto.m4')')
# set up default values for options
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/aliases'))
+define(`ALIAS_FILE', `/etc/aliases')
define(`confMAILER_NAME', ``MAILER-DAEMON'')
define(`confFROM_LINE', `From $g $d')
define(`confOPERATORS', `.:%@!^/[]+')
@@ -134,10 +134,10 @@ define(`confSAFE_QUEUE', `True')
define(`confTO_QUEUERETURN', `5d')
define(`confTO_QUEUEWARN', `4h')
define(`confTIME_ZONE', `USE_SYSTEM')
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/sendmail.cw'))
+define(`confCW_FILE', `/etc/sendmail.cw')
define(`confMIME_FORMAT_ERRORS', `True')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
define(`confCR_FILE', `-o /etc/mail/relay-domains')
divert(0)dnl
-VERSIONID(`@(#)cfhead.m4 8.23 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)cfhead.m4 8.22 (Berkeley) 5/19/98')
diff --git a/contrib/sendmail/cf/m4/nullrelay.m4 b/contrib/sendmail/cf/m4/nullrelay.m4
index b71fd570654c..02020697a862 100644
--- a/contrib/sendmail/cf/m4/nullrelay.m4
+++ b/contrib/sendmail/cf/m4/nullrelay.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nullrelay.m4 8.19 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)nullrelay.m4 8.19 (Berkeley) 5/19/98')
#
# This configuration applies only to relay-only hosts. They send
diff --git a/contrib/sendmail/cf/m4/proto.m4 b/contrib/sendmail/cf/m4/proto.m4
index 8e79454bc04e..d8842bfff1f5 100644
--- a/contrib/sendmail/cf/m4/proto.m4
+++ b/contrib/sendmail/cf/m4/proto.m4
@@ -12,12 +12,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)proto.m4 8.237 (Berkeley) 12/17/1998')
+VERSIONID(`@(#)proto.m4 8.223 (Berkeley) 6/30/98')
MAILER(local)dnl
# level 8 config file format
-V8/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')
+V8/Berkeley
divert(-1)
# do some sanity checking
@@ -220,7 +220,7 @@ ifdef(`_NULL_CLIENT_ONLY_', `dnl', `
_OPTION(AliasWait, `confALIAS_WAIT', 5m)
# location of alias file
-_OPTION(AliasFile, `ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/aliases, /etc/aliases))
+_OPTION(AliasFile, `ALIAS_FILE', /etc/aliases)
')
# minimum number of free blocks on filesystem
_OPTION(MinFreeBlocks, `confMIN_FREE_BLOCKS', 100)
@@ -244,7 +244,7 @@ _OPTION(DeliveryMode, `confDELIVERY_MODE', background)
_OPTION(AutoRebuildAliases, `confAUTO_REBUILD')
# error message header/file
-_OPTION(ErrorHeader, `confERROR_MESSAGE', ifdef(`_USE_ETC_MAIL_', /etc/mail/error-header, /etc/sendmail.oE))
+_OPTION(ErrorHeader, `confERROR_MESSAGE', /etc/sendmail.oE)
# error mode
_OPTION(ErrorMode, `confERROR_MODE', print)
@@ -262,7 +262,7 @@ _OPTION(MatchGECOS, `confMATCH_GECOS')
_OPTION(MaxHopCount, `confMAX_HOP', 17)
# location of help file
-O HelpFile=ifdef(`HELP_FILE', HELP_FILE, ifdef(`_USE_ETC_MAIL_', /etc/mail/helpfile, /usr/lib/sendmail.hf))
+O HelpFile=ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf)
# ignore dots as terminators in incoming messages?
_OPTION(IgnoreDots, `confIGNORE_DOTS')
@@ -351,7 +351,7 @@ _OPTION(DontPruneRoutes, `confDONT_PRUNE_ROUTES')
_OPTION(SuperSafe, `confSAFE_QUEUE')
# status file
-O StatusFile=ifdef(`STATUS_FILE', `STATUS_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/statistics, /etc/sendmail.st))
+O StatusFile=ifdef(`STATUS_FILE', `STATUS_FILE', /etc/sendmail.st)
# time zone handling:
# if undefined, use system default
@@ -365,7 +365,7 @@ ifelse(confTIME_ZONE, `USE_SYSTEM', `#O TimeZoneSpec=',
_OPTION(DefaultUser, `confDEF_USER_ID', mailnull)
# list of locations of user database file (null means no lookup)
-_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', ifdef(`_USE_ETC_MAIL_', /etc/mail/userdb, /etc/userdb))
+_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', /etc/userdb)
# fallback MX host
_OPTION(FallbackMXhost, `confFALLBACK_MX', fall.back.host.net)
@@ -407,7 +407,7 @@ _OPTION(MinQueueAge, `confMIN_QUEUE_AGE', 30m)
_OPTION(DefaultCharSet, `confDEF_CHAR_SET', iso-8859-1)
# service switch file (ignored on Solaris, Ultrix, OSF/1, others)
-_OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/service.switch, /etc/service.switch))
+_OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', /etc/service.switch)
# hosts file (normally /etc/hosts)
_OPTION(HostsFile, `confHOSTS_FILE', /etc/hosts)
@@ -466,19 +466,6 @@ _OPTION(MaxRecipientsPerMessage, `confMAX_RCPTS_PER_MESSAGE', 100)
# shall we get local names from our installed interfaces?
_OPTION(DontProbeInterfaces, `confDONT_PROBE_INTERFACES')
-ifdef(`confTRUSTED_USER',
-`# Trusted user for file ownership and starting the daemon
-O TrustedUser=confTRUSTED_USER
-')
-ifdef(`confCONTROL_SOCKET_NAME',
-`# Control socket for daemon management
-O ControlSocketName=confCONTROL_SOCKET_NAME
-')
-ifdef(`confMAX_MIME_HEADER_LENGTH',
-`# Maximum MIME header length to protect MUAs
-O MaxMimeHeaderLength=confMAX_MIME_HEADER_LENGTH
-')
-
###########################
# Message precedences #
###########################
@@ -494,7 +481,7 @@ Pjunk=-100
#####################
# this is equivalent to setting class "t"
-ifdef(`_USE_CT_FILE_', `', `#')Ft`'ifdef(`confCT_FILE', confCT_FILE, ifdef(`_USE_ETC_MAIL_', `/etc/mail/trusted-users', `/etc/sendmail.ct'))
+ifdef(`_USE_CT_FILE_', `', `#')Ft`'ifdef(`confCT_FILE', confCT_FILE, `/etc/sendmail.ct')
Troot
Tdaemon
ifdef(`_NO_UUCP_', `dnl', `Tuucp')
@@ -840,7 +827,7 @@ R$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name
# deal with other remote names
ifdef(`_MAILER_smtp_',
`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain',
-`R$* < @$* > $* $#error $@ 5.1.2 $: "Unrecognized host name " $2')
+`R$* < @$* > $* $#error $@ 5.1.2 $: "Unrecognized host name" $2')
# handle locally delivered names
R$=L $#_LOCAL_ $: @ $1 special local names
@@ -978,7 +965,7 @@ ifdef(`_MASQUERADE_ENVELOPE_',
S98
undivert(3)dnl
-ifelse(substr(confDELIVERY_MODE,0,1), `d', `errprint(`WARNING: Antispam rules not available in deferred delivery mode.')')
+ifelse(confDELIVERY_MODE, defer, `errprint(`WARNING: Antispam rules not available in deferred delivery mode.')')
ifdef(`ACCESS_TABLE', `dnl
######################################################################
### LookUpDomain -- search for domain in access database
@@ -1012,24 +999,6 @@ R<$*> <$+> <$+> <$*> $@ <$1> <$4>',
`dnl')
######################################################################
-### CanonAddr -- Convert an address into a standard form for
-### relay checking. Route address syntax is
-### crudely converted into a %-hack address.
-###
-### Parameters:
-### $1 -- full recipient address
-###
-### Returns:
-### parsed address, not in source route form
-######################################################################
-
-SCanonAddr
-R$* $: $>Parse0 $>3 $1 make domain canonical
-R< @ $+ > : $* @ $* < @ $1 > : $2 % $3 change @ to % in src route
-R$* < @ $+ > : $* : $* $3 $1 < @ $2 > : $4 change to % hack.
-R$* < @ $+ > : $* $3 $1 < @ $2 >
-
-######################################################################
### ParseRecipient -- Strip off hosts in $=R as well as possibly
### $* $=m or the access database.
### Check user portion for host separators.
@@ -1042,35 +1011,27 @@ R$* < @ $+ > : $* $3 $1 < @ $2 >
######################################################################
SParseRecipient
-R$* $: <?> $>CanonAddr $1
-R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
-R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
+R$* $: <?> $>Parse0 $>3 $1
+R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
+R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
# if no $=O character, no host in the user portion, we are done
-R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
-R<?> $* $@ $1
+R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
+R<?> $* $@ $1
ifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl
# if we relay, check username portion for user%host so host can be checked also
-R<NO> $* < @ $* $=m > $: <RELAY> $1 < @ $2 $3 >', `dnl')
-
-ifdef(`_RELAY_MX_SERVED_', `dnl
-R<NO> $* < @ $+ > $: <MX> < : $(mxserved $2 $) : > < $1 < @$2 > >
-R<MX> < : $* <TEMP> : > $* $#error $@ 4.7.1 $: "450 Can not check MX records for recipient host " $1
-R<MX> < $* : $=w. : $* > < $+ > $: <RELAY> $4
-R<MX> < : $* : > < $+ > $: <NO> $2', `dnl')
-
+R<NO> $* < @ $* $=m > $: <RELAY> $1 < @ $2 $3 >', `dnl')
ifdef(`_RELAY_HOSTS_ONLY_',
-`R<NO> $* < @ $=R > $: <RELAY> $1 < @ $2 >
+`R<NO> $* < @ $=R > $: <RELAY> $1 < @ $2 >
ifdef(`ACCESS_TABLE', `dnl
-R<NO> $* < @ $+ > $: <$(access $2 $: NO $)> $1 < @ $2 >',`dnl')',
-`R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
+R<NO> $* < @ $* > $: <$(access $2 $: NO $)> $1 < @ $2 >',`dnl')',
+`R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
ifdef(`ACCESS_TABLE', `dnl
-R<NO> $* < @ $+ > $: $>LookUpDomain <$2> <NO> <$1 < @ $2 >>
-R<$+> <$+> $: <$1> $2',`dnl')')
-
-R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
-R<$-> $* $@ $2
+R<NO> $* < @ $* > $: $>LookUpDomain <$2> <NO> <$1 < @ $2 >>
+R<$+> <$+> $: <$1> $2',`dnl')')
+R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
+R<$-> $* $@ $2
######################################################################
### check_relay -- check hostname/address on SMTP startup
@@ -1090,20 +1051,19 @@ R< $* > $* $: $2
ifdef(`ACCESS_TABLE', `dnl
R$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 >
-R<?> < $+ > $: $>LookUpAddress < $1 > <?> < $1 >
-R<?> < $+ > $: $1
-R<OK> < $* > $@ OK
-R<RELAY> < $* > $@ RELAY
+R<?> < $+ > $: $>LookUpAddress < $1 > <OK> < $1 >
+R<OK> < $* > $: $1
+R<RELAY> < $* > $: $1
R<REJECT> $* $#error $@ 5.7.1 $: "ifdef(`confREJECT_MSG', `confREJECT_MSG', `550 Access denied')"
R<DISCARD> $* $#discard $: discard
R<$+> $* $#error $@ 5.7.1 $: $1', `dnl')
ifdef(`_RBL_', `dnl
-# DNS based IP address spam lists
+# MAPS project checks -- http://maps.vix.com/
R$* $: $&{client_addr}
R$-.$-.$-.$- $: $(host $4.$3.$2.$1._RBL_. $: OK $)
ROK $@ OK
-R$+ $#error $@ 5.7.1 $: "Mail from " $&{client_addr} " refused by blackhole site _RBL_"',
+R$+ $#error $@ 5.7.1 $: "Mail from " $&{client_addr} " refused; see http://maps.vix.com/rbl/"',
`dnl')
######################################################################
@@ -1123,8 +1083,8 @@ R< d > $* $@ deferred
R< $* > $* $: $2
R<> $@ <OK>
-R$* $: <?> $>CanonAddr $1
-R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
+R$* $: <?> $>Parse0 $>3 $1 make domain canonical
+R<?> $* < @ $+ . > $* <?> $1 < @ $2 > $3 strip trailing dots
# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
R<?> $* < $* $=P > $* $: <OK> $1 < @ $2 $3 > $4
ifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_',
@@ -1198,21 +1158,10 @@ R< d > $* $@ deferred
R< $* > $* $: $2
ifdef(`_LOOSE_RELAY_CHECK_',`dnl
-R$* $: $>CanonAddr $1
+R$* $: $>Parse0 $>3 $1
R$* < @ $* . > $1 < @ $2 > strip trailing dots',
`R$* $: $>ParseRecipient $1 strip relayable hosts')
-ifdef(`_BESTMX_IS_LOCAL_',`dnl
-ifelse(_BESTMX_IS_LOCAL_, `', `dnl
-# unlimited bestmx
-R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3',
-`dnl
-# limit bestmx to $=B
-R$* < @ $* $=B > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 $) > $4')
-R$* $=O $* < @ $* @@ $=w . > $* $@ $>Basic_check_rcpt $1 $2 $3
-R$* < @ $* @@ $=w . > $* $: $1 < @ $3 > $4
-R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4')
-
ifdef(`_BLACKLIST_RCPT_',`dnl
ifdef(`ACCESS_TABLE', `dnl
# blacklist local users or any host from receiving mail
@@ -1252,12 +1201,12 @@ ifdef(`_RELAY_MX_SERVED_', `dnl
R$+ < @ $* > $: < : $(mxserved $2 $) : > $1 < @ $2 >
R< : $* <TEMP> : > $* $#error $@ 4.7.1 $: "450 Can not check MX records for recipient host " $1
R<$* : $=w . : $*> $* $@ OK
-R< : $* : > $* $: $2',
+R<$*> $* $: $2',
`dnl')
# check for local user (i.e. unqualified address)
R$* $: <?> $1
-R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
+R<?> $+ < @ $+ > $: <REMOTE> $1 < @ $2 >
# local user is ok
R<?> $+ $@ OK
R<$+> $* $: $2
@@ -1299,7 +1248,7 @@ R$=w $@ OK ... and see if it is local
ifdef(`_RELAY_LOCAL_FROM_', `dnl
# anything with a local FROM is ok
-R$* $: $1 $| $>CanonAddr $&f
+R$* $: $1 $| $>Parse0 $>3 $&f
R$* $| $+ < @ $=w . > $@ OK FROM local
R$* $| $* $: $1
', `dnl')
diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4
index 6d03e3761a3b..2db220271ad5 100644
--- a/contrib/sendmail/cf/m4/version.m4
+++ b/contrib/sendmail/cf/m4/version.m4
@@ -10,8 +10,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`@(#)version.m4 8.9.2.1 (Berkeley) 12/29/1998')
+VERSIONID(`@(#)version.m4 8.9.1.1 (Berkeley) 7/2/98')
#
divert(0)
# Configuration version number
-DZ8.9.2`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.9.1`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/contrib/sendmail/cf/mailer/cyrus.m4 b/contrib/sendmail/cf/mailer/cyrus.m4
index 567025ffdd0e..6e4badcce29b 100644
--- a/contrib/sendmail/cf/mailer/cyrus.m4
+++ b/contrib/sendmail/cf/mailer/cyrus.m4
@@ -47,7 +47,7 @@ POPDIVERT
### Cyrus Mailer specification ###
##################################################
-VERSIONID(`@(#)cyrus.m4 8.9 (Carnegie Mellon) 5/19/1998')
+VERSIONID(`@(#)cyrus.m4 8.9 (Carnegie Mellon) 5/19/98')
Mcyrus, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnPq', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER,
diff --git a/contrib/sendmail/cf/mailer/fax.m4 b/contrib/sendmail/cf/mailer/fax.m4
index 3ee94bdc308b..581cfed088c3 100644
--- a/contrib/sendmail/cf/mailer/fax.m4
+++ b/contrib/sendmail/cf/mailer/fax.m4
@@ -26,7 +26,7 @@ POPDIVERT
### FAX Mailer specification ###
####################################
-VERSIONID(`@(#)fax.m4 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)fax.m4 8.11 (Berkeley) 5/19/98')
Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX, T=X-Phone/X-FAX/X-Unix,
A=FAX_MAILER_ARGS
diff --git a/contrib/sendmail/cf/mailer/local.m4 b/contrib/sendmail/cf/mailer/local.m4
index 6b4b679d832b..705e723c6ca4 100644
--- a/contrib/sendmail/cf/mailer/local.m4
+++ b/contrib/sendmail/cf/mailer/local.m4
@@ -23,7 +23,7 @@ POPDIVERT
### Local and Program Mailer specification ###
##################################################
-VERSIONID(`@(#)local.m4 8.30 (Berkeley) 6/30/1998')
+VERSIONID(`@(#)local.m4 8.30 (Berkeley) 6/30/98')
Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMAw5:/|@q', LOCAL_MAILER_FLAGS), S=10/30, R=20/40,
_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')_OPTINS(`LOCAL_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/X-Unix,
diff --git a/contrib/sendmail/cf/mailer/mail11.m4 b/contrib/sendmail/cf/mailer/mail11.m4
index 222b53fc91d4..5c9d94810c6b 100644
--- a/contrib/sendmail/cf/mailer/mail11.m4
+++ b/contrib/sendmail/cf/mailer/mail11.m4
@@ -40,7 +40,7 @@ POPDIVERT
### UTK-MAIL11 Mailer specification ###
###########################################
-VERSIONID(`@(#)mail11.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)mail11.m4 8.8 (Berkeley) 5/19/98')
Mmail11, P=MAIL11_MAILER_PATH, F=MAIL11_MAILER_FLAGS, S=15, R=25,
A=MAIL11_MAILER_ARGS
diff --git a/contrib/sendmail/cf/mailer/phquery.m4 b/contrib/sendmail/cf/mailer/phquery.m4
index 3e0891ae37b9..5f1b6b41ce86 100644
--- a/contrib/sendmail/cf/mailer/phquery.m4
+++ b/contrib/sendmail/cf/mailer/phquery.m4
@@ -23,7 +23,7 @@ POPDIVERT
### PH Mailer specification ###
####################################
-VERSIONID(`@(#)phquery.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)phquery.m4 8.6 (Berkeley) 5/19/98')
Mph, P=PH_MAILER_PATH, F=CONCAT(`nrDFM', PH_MAILER_FLAGS), S=10, R=20/40,
A=PH_MAILER_ARGS
diff --git a/contrib/sendmail/cf/mailer/pop.m4 b/contrib/sendmail/cf/mailer/pop.m4
index 0acea7d9fd5e..a4f3128f19fd 100644
--- a/contrib/sendmail/cf/mailer/pop.m4
+++ b/contrib/sendmail/cf/mailer/pop.m4
@@ -21,7 +21,7 @@ POPDIVERT
### POP Mailer specification ###
####################################
-VERSIONID(`@(#)pop.m4 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)pop.m4 8.11 (Berkeley) 5/19/98')
Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFMq', POP_MAILER_FLAGS), S=10, R=20/40, T=DNS/RFC822/X-Unix,
A=POP_MAILER_ARGS
diff --git a/contrib/sendmail/cf/mailer/procmail.m4 b/contrib/sendmail/cf/mailer/procmail.m4
index 38b6d200dd58..b6131c06678d 100644
--- a/contrib/sendmail/cf/mailer/procmail.m4
+++ b/contrib/sendmail/cf/mailer/procmail.m4
@@ -26,7 +26,7 @@ POPDIVERT
### PROCMAIL Mailer specification ###
##################*****##################
-VERSIONID(`@(#)procmail.m4 8.11 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)procmail.m4 8.11 (Berkeley) 5/19/98')
Mprocmail, P=PROCMAIL_MAILER_PATH, F=CONCAT(`DFM', PROCMAIL_MAILER_FLAGS), S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
ifdef(`PROCMAIL_MAILER_MAX', `M=PROCMAIL_MAILER_MAX, ')A=PROCMAIL_MAILER_ARGS
diff --git a/contrib/sendmail/cf/mailer/smtp.m4 b/contrib/sendmail/cf/mailer/smtp.m4
index 75455970ae40..d70195e70669 100644
--- a/contrib/sendmail/cf/mailer/smtp.m4
+++ b/contrib/sendmail/cf/mailer/smtp.m4
@@ -22,7 +22,7 @@ POPDIVERT
### SMTP Mailer specification ###
#####################################
-VERSIONID(`@(#)smtp.m4 8.38 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)smtp.m4 8.38 (Berkeley) 5/19/98')
Msmtp, P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `21/31', `21'), E=\r\n, L=990,
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
diff --git a/contrib/sendmail/cf/mailer/usenet.m4 b/contrib/sendmail/cf/mailer/usenet.m4
index 153575187f09..6c92f5f8dadf 100644
--- a/contrib/sendmail/cf/mailer/usenet.m4
+++ b/contrib/sendmail/cf/mailer/usenet.m4
@@ -19,7 +19,7 @@ POPDIVERT
### USENET Mailer specification ###
####################################
-VERSIONID(`@(#)usenet.m4 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)usenet.m4 8.10 (Berkeley) 5/19/98')
Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
_OPTINS(`USENET_MAILER_MAX', `M=', `, ')T=X-Usenet/X-Usenet/X-Unix,
diff --git a/contrib/sendmail/cf/mailer/uucp.m4 b/contrib/sendmail/cf/mailer/uucp.m4
index badd307c963d..cd2619db47ec 100644
--- a/contrib/sendmail/cf/mailer/uucp.m4
+++ b/contrib/sendmail/cf/mailer/uucp.m4
@@ -22,7 +22,7 @@ POPDIVERT
### UUCP Mailer specification ###
#####################################
-VERSIONID(`@(#)uucp.m4 8.30 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)uucp.m4 8.30 (Berkeley) 5/19/98')
#
# There are innumerable variations on the UUCP mailer. It really
diff --git a/contrib/sendmail/cf/ostype/aix2.m4 b/contrib/sendmail/cf/ostype/aix2.m4
index 2bda79c60e43..1e77c1cd1e39 100644
--- a/contrib/sendmail/cf/ostype/aix2.m4
+++ b/contrib/sendmail/cf/ostype/aix2.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aix2.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)aix2.m4 8.8 (Berkeley) 5/19/98')
define(`LOCAL_MAILER_PATH', /bin/bellmail)dnl
define(`LOCAL_MAILER_ARGS', mail $u)dnl
define(`LOCAL_MAILER_FLAGS', `mn9')dnl
diff --git a/contrib/sendmail/cf/ostype/aix3.m4 b/contrib/sendmail/cf/ostype/aix3.m4
index fb74d9e46190..2cfc8c58220a 100644
--- a/contrib/sendmail/cf/ostype/aix3.m4
+++ b/contrib/sendmail/cf/ostype/aix3.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aix3.m4 8.12 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)aix3.m4 8.12 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/bellmail)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', mail $u)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn9')')dnl
diff --git a/contrib/sendmail/cf/ostype/aix4.m4 b/contrib/sendmail/cf/ostype/aix4.m4
index 24ff001ae3e6..06c7d1aba15e 100644
--- a/contrib/sendmail/cf/ostype/aix4.m4
+++ b/contrib/sendmail/cf/ostype/aix4.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aix4.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)aix4.m4 8.7 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/bellmail)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', mail -F $g $u)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn9')')dnl
diff --git a/contrib/sendmail/cf/ostype/altos.m4 b/contrib/sendmail/cf/ostype/altos.m4
index 4dcefa943a6b..38a07a0a3199 100644
--- a/contrib/sendmail/cf/ostype/altos.m4
+++ b/contrib/sendmail/cf/ostype/altos.m4
@@ -14,11 +14,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)altos.m4 8.10 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)altos.m4 8.9 (Berkeley) 5/19/98')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/mail/aliases'))dnl
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mPuhCE9)')dnl
diff --git a/contrib/sendmail/cf/ostype/amdahl-uts.m4 b/contrib/sendmail/cf/ostype/amdahl-uts.m4
index 84d47cdb17e3..022b50741371 100644
--- a/contrib/sendmail/cf/ostype/amdahl-uts.m4
+++ b/contrib/sendmail/cf/ostype/amdahl-uts.m4
@@ -12,12 +12,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)amdahl-uts.m4 8.11 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)amdahl-uts.m4 8.10 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/mail/sendmail.hf'))')
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSn9')')
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/mail/sendmail.cw'))
+define(`confCW_FILE', /etc/mail/sendmail.cw)
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/aux.m4 b/contrib/sendmail/cf/ostype/aux.m4
index 8038cb55d833..2adbfe4d221a 100644
--- a/contrib/sendmail/cf/ostype/aux.m4
+++ b/contrib/sendmail/cf/ostype/aux.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aux.m4 8.11 (Berkeley) 10/6/1998')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
+VERSIONID(`@(#)aux.m4 8.10 (Berkeley) 5/19/98')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mn9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d -r $f $u')')dnl
diff --git a/contrib/sendmail/cf/ostype/bsd4.3.m4 b/contrib/sendmail/cf/ostype/bsd4.3.m4
index d0f3f8a32191..47c02cc764ae 100644
--- a/contrib/sendmail/cf/ostype/bsd4.3.m4
+++ b/contrib/sendmail/cf/ostype/bsd4.3.m4
@@ -12,6 +12,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsd4.3.m4 8.9 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)bsd4.3.m4 8.9 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$g $h!rmail ($u)')')dnl
diff --git a/contrib/sendmail/cf/ostype/bsd4.4.m4 b/contrib/sendmail/cf/ostype/bsd4.4.m4
index f94e6532ef75..711610cb8fdc 100644
--- a/contrib/sendmail/cf/ostype/bsd4.4.m4
+++ b/contrib/sendmail/cf/ostype/bsd4.4.m4
@@ -13,9 +13,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsd4.4.m4 8.10 (Berkeley) 10/6/1998')
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/share/misc/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/log/sendmail.st'))')dnl
+VERSIONID(`@(#)bsd4.4.m4 8.9 (Berkeley) 5/19/98')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/misc/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail $u')')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$g $h!rmail ($u)')')dnl
diff --git a/contrib/sendmail/cf/ostype/bsdi1.0.m4 b/contrib/sendmail/cf/ostype/bsdi1.0.m4
index 08bd2a574b2e..48d60b333808 100644
--- a/contrib/sendmail/cf/ostype/bsdi1.0.m4
+++ b/contrib/sendmail/cf/ostype/bsdi1.0.m4
@@ -12,5 +12,5 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsdi1.0.m4 8.7 (Berkeley) 5/19/1998')dnl
+VERSIONID(`@(#)bsdi1.0.m4 8.7 (Berkeley) 5/19/98')dnl
include(_CF_DIR_`'ostype/bsd4.4.m4)dnl
diff --git a/contrib/sendmail/cf/ostype/bsdi2.0.m4 b/contrib/sendmail/cf/ostype/bsdi2.0.m4
index 6883eb067056..73b0447ec369 100644
--- a/contrib/sendmail/cf/ostype/bsdi2.0.m4
+++ b/contrib/sendmail/cf/ostype/bsdi2.0.m4
@@ -12,5 +12,5 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsdi2.0.m4 8.6 (Berkeley) 5/19/1998')dnl
+VERSIONID(`@(#)bsdi2.0.m4 8.6 (Berkeley) 5/19/98')dnl
include(_CF_DIR_`'ostype/bsd4.4.m4)dnl
diff --git a/contrib/sendmail/cf/ostype/dgux.m4 b/contrib/sendmail/cf/ostype/dgux.m4
index 2f25cd83251a..eeb8c4de3a2d 100644
--- a/contrib/sendmail/cf/ostype/dgux.m4
+++ b/contrib/sendmail/cf/ostype/dgux.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)dgux.m4 8.10 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)dgux.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', m9)')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/domainos.m4 b/contrib/sendmail/cf/ostype/domainos.m4
index 9f4ea92b8b88..c03dee5fc94f 100644
--- a/contrib/sendmail/cf/ostype/domainos.m4
+++ b/contrib/sendmail/cf/ostype/domainos.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)domainos.m4 8.10 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)domainos.m4 8.9 (Berkeley) 5/19/98')
divert(-1)
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')
+define(`ALIAS_FILE', /usr/lib/aliases)
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/dynix3.2.m4 b/contrib/sendmail/cf/ostype/dynix3.2.m4
index 38364466ba5c..94d59b5f3712 100644
--- a/contrib/sendmail/cf/ostype/dynix3.2.m4
+++ b/contrib/sendmail/cf/ostype/dynix3.2.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)dynix3.2.m4 8.10 (Berkeley) 10/6/1998')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
+VERSIONID(`@(#)dynix3.2.m4 8.9 (Berkeley) 5/19/98')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/gnuhurd.m4 b/contrib/sendmail/cf/ostype/gnuhurd.m4
index a8ed66765e24..d7127f6b7eb8 100644
--- a/contrib/sendmail/cf/ostype/gnuhurd.m4
+++ b/contrib/sendmail/cf/ostype/gnuhurd.m4
@@ -13,8 +13,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)gnuhurd.m4 8.8 (Berkeley) 10/6/1998')
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/share/misc/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/log/sendmail.st'))')dnl
+VERSIONID(`@(#)gnuhurd.m4 8.7 (Berkeley) 5/19/98')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /share/misc/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /libexec/mail.local)')dnl
define(`confEBINDIR', `/libexec')dnl
diff --git a/contrib/sendmail/cf/ostype/hpux10.m4 b/contrib/sendmail/cf/ostype/hpux10.m4
index d349b5488e38..9499474de74b 100644
--- a/contrib/sendmail/cf/ostype/hpux10.m4
+++ b/contrib/sendmail/cf/ostype/hpux10.m4
@@ -12,12 +12,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)hpux10.m4 8.14 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)hpux10.m4 8.13 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
define(`ALIAS_FILE', /etc/mail/aliases)dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mail/sendmail.st'))')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/share/lib/sendmail.hf'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/lib/sendmail.hf)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/rmail)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m9')')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
diff --git a/contrib/sendmail/cf/ostype/hpux9.m4 b/contrib/sendmail/cf/ostype/hpux9.m4
index 55f1b97c13ae..19579caef067 100644
--- a/contrib/sendmail/cf/ostype/hpux9.m4
+++ b/contrib/sendmail/cf/ostype/hpux9.m4
@@ -12,11 +12,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)hpux9.m4 8.19 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)hpux9.m4 8.18 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', `/bin/rmail')')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m9')')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
diff --git a/contrib/sendmail/cf/ostype/irix4.m4 b/contrib/sendmail/cf/ostype/irix4.m4
index aea6e9e847c3..69890e6acbce 100644
--- a/contrib/sendmail/cf/ostype/irix4.m4
+++ b/contrib/sendmail/cf/ostype/irix4.m4
@@ -12,9 +12,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix4.m4 8.14 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)irix4.m4 8.13 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehm9)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/irix5.m4 b/contrib/sendmail/cf/ostype/irix5.m4
index 426f00207a13..32f23756e005 100644
--- a/contrib/sendmail/cf/ostype/irix5.m4
+++ b/contrib/sendmail/cf/ostype/irix5.m4
@@ -28,13 +28,13 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix5.m4 8.11 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)irix5.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -s -d $u')')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/aliases'))dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/sendmail.st'))')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/sendmail.hf'))')dnl
+define(`ALIAS_FILE', /etc/aliases)dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confDEF_USER_ID', `998:998')dnl
define(`confTIME_ZONE', USE_TZ)dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/irix6.m4 b/contrib/sendmail/cf/ostype/irix6.m4
index d41920211b40..f046dbf0e8fb 100644
--- a/contrib/sendmail/cf/ostype/irix6.m4
+++ b/contrib/sendmail/cf/ostype/irix6.m4
@@ -28,13 +28,13 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix6.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)irix6.m4 8.7 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -s -d $u')')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/aliases'))dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/sendmail.st'))')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/sendmail.hf'))')dnl
+define(`ALIAS_FILE', /etc/aliases)dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confDEF_USER_ID', `998:998')dnl
define(`confTIME_ZONE', USE_TZ)dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/isc4.1.m4 b/contrib/sendmail/cf/ostype/isc4.1.m4
index 629835bb2ee9..1869eecfc636 100644
--- a/contrib/sendmail/cf/ostype/isc4.1.m4
+++ b/contrib/sendmail/cf/ostype/isc4.1.m4
@@ -13,14 +13,14 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)isc4.1.m4 8.11 (Berkeley) 10/6/1998')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/lib/sendmail.hf'))')dnl
+VERSIONID(`@(#)isc4.1.m4 8.10 (Berkeley) 5/19/98')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail -s $u')')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `humS9')')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/lmail)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -gC $h!rmail ($u)')')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/contrib/sendmail/cf/ostype/linux.m4 b/contrib/sendmail/cf/ostype/linux.m4
index e1f7a92119f8..d7c3b190b47a 100644
--- a/contrib/sendmail/cf/ostype/linux.m4
+++ b/contrib/sendmail/cf/ostype/linux.m4
@@ -12,5 +12,5 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)linux.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)linux.m4 8.7 (Berkeley) 5/19/98')
define(`LOCAL_MAILER_PATH', /bin/mail.local)dnl
diff --git a/contrib/sendmail/cf/ostype/maxion.m4 b/contrib/sendmail/cf/ostype/maxion.m4
index a8ecfd0315c9..c07ce876e300 100644
--- a/contrib/sendmail/cf/ostype/maxion.m4
+++ b/contrib/sendmail/cf/ostype/maxion.m4
@@ -15,12 +15,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)maxion.m4 8.11 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)maxion.m4 8.10 (Berkeley) 5/19/98')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/ucbmail/aliases'))dnl
-define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/ucbmail/sendmail.hf'))dnl
+define(`ALIAS_FILE', `/etc/ucbmail/aliases')dnl
+define(`HELP_FILE', `/etc/ucbmail/sendmail.hf')dnl
define(`QUEUE_DIR', `/var/spool/mqueue')dnl
-define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/adm/log/sendmail.st'))dnl
+define(`STATUS_FILE', `/var/adm/log/sendmail.st')dnl
define(`LOCAL_MAILER_PATH', `/usr/bin/mail')dnl
define(`LOCAL_MAILER_FLAGS',`rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
diff --git a/contrib/sendmail/cf/ostype/mklinux.m4 b/contrib/sendmail/cf/ostype/mklinux.m4
index abcdbae786c0..2f40c72d8e2c 100644
--- a/contrib/sendmail/cf/ostype/mklinux.m4
+++ b/contrib/sendmail/cf/ostype/mklinux.m4
@@ -14,9 +14,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)mklinux.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)mklinux.m4 8.7 (Berkeley) 5/19/98')
ifdef(`STATUS_FILE',,
- `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/log/sendmail.st'))')
+ `define(`STATUS_FILE', /var/log/sendmail.st)')
ifdef(`PROCMAIL_MAILER_PATH',,
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail'))
FEATURE(local_procmail)
diff --git a/contrib/sendmail/cf/ostype/nextstep.m4 b/contrib/sendmail/cf/ostype/nextstep.m4
index ebe6957df9b8..73c995fb983c 100644
--- a/contrib/sendmail/cf/ostype/nextstep.m4
+++ b/contrib/sendmail/cf/ostype/nextstep.m4
@@ -12,11 +12,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)nextstep.m4 8.15 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)nextstep.m4 8.14 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/sendmail/sendmail.cw'))dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/lib/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/sendmail/sendmail.st'))')dnl
+define(`confCW_FILE', /etc/sendmail/sendmail.cw)dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/sendmail/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmnP9')')dnl
diff --git a/contrib/sendmail/cf/ostype/osf1.m4 b/contrib/sendmail/cf/ostype/osf1.m4
index 7fcf1cf65343..fe17b35ee6c9 100644
--- a/contrib/sendmail/cf/ostype/osf1.m4
+++ b/contrib/sendmail/cf/ostype/osf1.m4
@@ -12,8 +12,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)osf1.m4 8.11 (Berkeley) 10/6/1998')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/adm/sendmail/aliases'))dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/adm/sendmail/sendmail.st'))')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/share/lib/sendmail.hf'))')dnl
+VERSIONID(`@(#)osf1.m4 8.10 (Berkeley) 5/19/98')
+define(`ALIAS_FILE', /usr/adm/sendmail/aliases)dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/adm/sendmail/sendmail.st)')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/lib/sendmail.hf)')dnl
define(`confDEF_USER_ID', `daemon')
diff --git a/contrib/sendmail/cf/ostype/powerux.m4 b/contrib/sendmail/cf/ostype/powerux.m4
index 068bd8e7f166..dc23c7ed2956 100644
--- a/contrib/sendmail/cf/ostype/powerux.m4
+++ b/contrib/sendmail/cf/ostype/powerux.m4
@@ -12,11 +12,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)powerux.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)powerux.m4 8.7 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /etc/mail/aliases)dnl
-ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/mail/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',,`define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mail/sendmail.st'))')dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /etc/mail/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /etc/mail/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/usr/bin/rmail')dnl
define(`LOCAL_MAILER_FLAGS', `mn9')dnl
define(`LOCAL_MAILER_ARGS', `rmail $u')dnl
diff --git a/contrib/sendmail/cf/ostype/ptx2.m4 b/contrib/sendmail/cf/ostype/ptx2.m4
index d564ead49e30..83a05580b14a 100644
--- a/contrib/sendmail/cf/ostype/ptx2.m4
+++ b/contrib/sendmail/cf/ostype/ptx2.m4
@@ -14,11 +14,11 @@ divert(-1)
# Support for DYNIX/ptx 2.x.
divert(0)
-VERSIONID(`@(#)ptx2.m4 8.12 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)ptx2.m4 8.11 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
-ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/lib/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',,`define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/bin/mail')dnl
define(`LOCAL_MAILER_FLAGS', `fmn9')dnl
define(`LOCAL_SHELL_FLAGS', `eu')dnl
diff --git a/contrib/sendmail/cf/ostype/qnx.m4 b/contrib/sendmail/cf/ostype/qnx.m4
index 91ed669622fb..10624dde39f1 100644
--- a/contrib/sendmail/cf/ostype/qnx.m4
+++ b/contrib/sendmail/cf/ostype/qnx.m4
@@ -12,9 +12,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)qnx.m4 8.8 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)qnx.m4 8.7 (Berkeley) 5/19/98')
define(`QUEUE_DIR', /usr/spool/mqueue)dnl
-define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/sendmail.hf'))dnl
+define(`HELP_FILE', /etc/sendmail.hf)dnl
define(`LOCAL_MAILER_ARGS', `mail $u')dnl
define(`LOCAL_MAILER_FLAGS', `Sh')dnl
define(`LOCAL_MAILER_PATH', /usr/bin/mailx)dnl
diff --git a/contrib/sendmail/cf/ostype/riscos4.5.m4 b/contrib/sendmail/cf/ostype/riscos4.5.m4
index c44a1800ed89..02db750c023b 100644
--- a/contrib/sendmail/cf/ostype/riscos4.5.m4
+++ b/contrib/sendmail/cf/ostype/riscos4.5.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)riscos4.5.m4 8.11 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)riscos4.5.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/aliases'))dnl
+define(`ALIAS_FILE', `/usr/lib/aliases')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', `/usr/spool/mqueue')')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/lib/sendmail.hf'))')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', `/usr/lib/sendmail.hf')')dnl
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 b/contrib/sendmail/cf/ostype/sco-uw-2.1.m4
index 07da0ad9b418..356c984fa422 100644
--- a/contrib/sendmail/cf/ostype/sco-uw-2.1.m4
+++ b/contrib/sendmail/cf/ostype/sco-uw-2.1.m4
@@ -12,11 +12,11 @@ divert(-1)
# Contributed by Christopher Durham <chrisdu@SCO.COM> of SCO.
#
divert(0)
-VERSIONID(`@(#)sco-uw-2.1.m4 8.7 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)sco-uw-2.1.m4 8.6 (Berkeley) 5/19/98')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/mail/aliases'))dnl
-ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/ucblib/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',,`define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/ucblib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/usr/bin/rmail')dnl
define(`LOCAL_MAILER_FLAGS', `fhCEn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
diff --git a/contrib/sendmail/cf/ostype/sco3.2.m4 b/contrib/sendmail/cf/ostype/sco3.2.m4
index 135fefaa0a89..1c58585035be 100644
--- a/contrib/sendmail/cf/ostype/sco3.2.m4
+++ b/contrib/sendmail/cf/ostype/sco3.2.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)sco3.2.m4 8.11 (Berkeley) 10/6/1998')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/lib/mail/aliases'))dnl
+VERSIONID(`@(#)sco3.2.m4 8.10 (Berkeley) 5/19/98')
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/lib/sendmail.st'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', PuhCE9)')dnl
diff --git a/contrib/sendmail/cf/ostype/sinix.m4 b/contrib/sendmail/cf/ostype/sinix.m4
index 37d12d4211cb..51c469d8d741 100644
--- a/contrib/sendmail/cf/ostype/sinix.m4
+++ b/contrib/sendmail/cf/ostype/sinix.m4
@@ -12,10 +12,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)sinix.m4 8.9 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)sinix.m4 8.8 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/aliases'))dnl
+define(`ALIAS_FILE', /etc/aliases)dnl
define(`LOCAL_MAILER_PATH', `/bin/mail.local')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/sendmail.st'))')dnl
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/sendmail.hf'))')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confEBINDIR', `/usr/ucblib')dnl
diff --git a/contrib/sendmail/cf/ostype/solaris2.m4 b/contrib/sendmail/cf/ostype/solaris2.m4
index 5a0e2a9024f0..5a90175bd363 100644
--- a/contrib/sendmail/cf/ostype/solaris2.m4
+++ b/contrib/sendmail/cf/ostype/solaris2.m4
@@ -12,14 +12,14 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)solaris2.m4 8.16 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)solaris2.m4 8.15 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/mail/sendmail.hf'))')
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mail/sendmail.st'))')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `SnE9')')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -f $g -d $u')')
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/mail/sendmail.cw'))
+define(`confCW_FILE', /etc/mail/sendmail.cw)
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/solaris2.ml.m4 b/contrib/sendmail/cf/ostype/solaris2.ml.m4
index f99cebb84d13..0995d50ff18e 100644
--- a/contrib/sendmail/cf/ostype/solaris2.ml.m4
+++ b/contrib/sendmail/cf/ostype/solaris2.ml.m4
@@ -16,15 +16,15 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)solaris2.ml.m4 8.9 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)solaris2.ml.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/etc/mail/sendmail.hf'))')
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mail/sendmail.st'))')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', `/usr/lib/mail.local')')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSmn9')')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail.local -d $u')')
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/mail/sendmail.cw'))
+define(`confCW_FILE', /etc/mail/sendmail.cw)
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/sunos3.5.m4 b/contrib/sendmail/cf/ostype/sunos3.5.m4
index aeda27249848..540d36e60756 100644
--- a/contrib/sendmail/cf/ostype/sunos3.5.m4
+++ b/contrib/sendmail/cf/ostype/sunos3.5.m4
@@ -12,6 +12,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)sunos3.5.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)sunos3.5.m4 8.7 (Berkeley) 5/19/98')
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/sunos4.1.m4 b/contrib/sendmail/cf/ostype/sunos4.1.m4
index 78648da7658e..aec96d2fdc9c 100644
--- a/contrib/sendmail/cf/ostype/sunos4.1.m4
+++ b/contrib/sendmail/cf/ostype/sunos4.1.m4
@@ -12,6 +12,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)sunos4.1.m4 8.7 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)sunos4.1.m4 8.7 (Berkeley) 5/19/98')
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/svr4.m4 b/contrib/sendmail/cf/ostype/svr4.m4
index d0de2783b104..1451414797fe 100644
--- a/contrib/sendmail/cf/ostype/svr4.m4
+++ b/contrib/sendmail/cf/ostype/svr4.m4
@@ -12,11 +12,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)svr4.m4 8.11 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)svr4.m4 8.10 (Berkeley) 5/19/98')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/ucblib/aliases'))dnl
-ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/ucblib/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',,`define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/ucblib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
diff --git a/contrib/sendmail/cf/ostype/ultrix4.m4 b/contrib/sendmail/cf/ostype/ultrix4.m4
index d10518ae6a95..874fa8b89d6b 100644
--- a/contrib/sendmail/cf/ostype/ultrix4.m4
+++ b/contrib/sendmail/cf/ostype/ultrix4.m4
@@ -12,6 +12,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)ultrix4.m4 8.8 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)ultrix4.m4 8.8 (Berkeley) 5/19/98')
define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/unixware7.m4 b/contrib/sendmail/cf/ostype/unixware7.m4
deleted file mode 100644
index af1bcc8be0f2..000000000000
--- a/contrib/sendmail/cf/ostype/unixware7.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-divert(-1)
-#
-# Copyright (c) 1998 Sendmail, Inc. 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.
-#
-#
-
-divert(0)
-VERSIONID(`@(#)unixware7.m4 8.1 (Berkeley) 10/13/1998')
-define(`ALIAS_FILE', `/etc/mail/aliases')dnl
-ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/etc/mailer/sendmail.st'))')dnl
-define(`confEBINDIR', `/usr/lib')dnl
diff --git a/contrib/sendmail/cf/ostype/unknown.m4 b/contrib/sendmail/cf/ostype/unknown.m4
index 629c31bc23c4..bb85604efa13 100644
--- a/contrib/sendmail/cf/ostype/unknown.m4
+++ b/contrib/sendmail/cf/ostype/unknown.m4
@@ -12,7 +12,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)unknown.m4 8.6 (Berkeley) 5/19/1998')
+VERSIONID(`@(#)unknown.m4 8.6 (Berkeley) 5/19/98')
errprint(`*** ERROR: You have not specified a valid operating system type.')
errprint(` Use the OSTYPE macro to select a valid system type. This')
errprint(` is necessary in order to get the proper pathnames and flags')
diff --git a/contrib/sendmail/cf/ostype/uxpds.m4 b/contrib/sendmail/cf/ostype/uxpds.m4
index 0f1d908f23b6..2fb147eb5223 100644
--- a/contrib/sendmail/cf/ostype/uxpds.m4
+++ b/contrib/sendmail/cf/ostype/uxpds.m4
@@ -15,12 +15,12 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)uxpds.m4 8.10 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)uxpds.m4 8.9 (Berkeley) 5/19/98')
define(`confDEF_GROUP_ID', `6')
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/usr/ucblib/aliases'))dnl
-ifdef(`HELP_FILE',,`define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/ucblib/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',,`define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/usr/ucblib/sendmail.st'))')dnl
+define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
diff --git a/contrib/sendmail/cf/sh/makeinfo.sh b/contrib/sendmail/cf/sh/makeinfo.sh
index 91de99b68d01..0cbb335881a5 100644
--- a/contrib/sendmail/cf/sh/makeinfo.sh
+++ b/contrib/sendmail/cf/sh/makeinfo.sh
@@ -10,7 +10,7 @@
# the sendmail distribution.
#
#
-# @(#)makeinfo.sh 8.11 (Berkeley) 5/19/1998
+# @(#)makeinfo.sh 8.11 (Berkeley) 5/19/98
#
usewhoami=0
diff --git a/contrib/sendmail/contrib/smcontrol.pl b/contrib/sendmail/contrib/smcontrol.pl
deleted file mode 100755
index b5ef1f8af677..000000000000
--- a/contrib/sendmail/contrib/smcontrol.pl
+++ /dev/null
@@ -1,361 +0,0 @@
-#!/usr/local/bin/perl -w
-
-use FileHandle;
-use Socket;
-
-$sendmailDaemon = "/usr/sbin/sendmail -q30m -bd";
-
-##########################################################################
-#
-# &get_controlname -- read ControlSocketName option from sendmail.cf
-#
-# Parameters:
-# none.
-#
-# Returns:
-# control socket filename, undef if not found
-#
-
-sub get_controlname
-{
- my $cn = undef;
- my $qd = undef;
-
- open(CF, "</etc/sendmail.cf") or return $cn;
- while (<CF>)
- {
- chomp;
- if (/^O ControlSocketName\s*=\s*([^#]+)$/o)
- {
- $cn = $1;
- }
- if (/^O QueueDirectory\s*=\s*([^#]+)$/o)
- {
- $qd = $1;
- }
- if (/^OQ([^#]+)$/o)
- {
- $qd = $1;
- }
- }
- close(CF);
- if (not defined $cn)
- {
- return undef;
- }
- if ($cn !~ /^\//o)
- {
- return undef if (not defined $qd);
-
- $cn = $qd . "/" . $cn;
- }
- return $cn;
-}
-
-##########################################################################
-#
-# &do_command -- send command to sendmail daemon view control socket
-#
-# Parameters:
-# controlsocket -- filename for socket
-# command -- command to send
-#
-# Returns:
-# reply from sendmail daemon
-#
-
-sub do_command
-{
- my $controlsocket = shift;
- my $command = shift;
- my $proto = getprotobyname('ip');
- my @reply;
-
- socket(SOCK, PF_UNIX, SOCK_STREAM, $proto) or return undef;
-
- for ($i = 0; $i < 4; $i++)
- {
- if (!connect(SOCK, sockaddr_un($controlsocket)))
- {
- if ($i == 3)
- {
- close(SOCK);
- return undef;
- }
- sleep 1;
- next;
- }
- last;
- }
- autoflush SOCK 1;
- print SOCK "$command\n";
- @reply = <SOCK>;
- close(SOCK);
- return join '', @reply;
-}
-
-##########################################################################
-#
-# &sendmail_running -- check if sendmail is running via SMTP
-#
-# Parameters:
-# none
-#
-# Returns:
-# 1 if running, undef otherwise
-#
-
-sub sendmail_running
-{
- my $port = getservbyname("smtp", "tcp") || 25;
- my $proto = getprotobyname("tcp");
- my $iaddr = inet_aton("localhost");
- my $paddr = sockaddr_in($port, $iaddr);
-
- socket(SOCK, PF_INET, SOCK_STREAM, $proto) or return undef;
- if (!connect(SOCK, $paddr))
- {
- close(SOCK);
- return undef;
- }
- autoflush SOCK 1;
- while (<SOCK>)
- {
- if (/^(\d{3})([ -])/)
- {
- if ($1 != 220)
- {
- close(SOCK);
- return undef;
- }
- }
- else
- {
- close(SOCK);
- return undef;
- }
- last if ($2 eq " ");
- }
- print SOCK "QUIT\n";
- while (<SOCK>)
- {
- last if (/^\d{3} /);
- }
- close(SOCK);
- return 1;
-}
-
-##########################################################################
-#
-# &munge_status -- turn machine readable status into human readable text
-#
-# Parameters:
-# raw -- raw results from sendmail daemon STATUS query
-#
-# Returns:
-# human readable text
-#
-
-sub munge_status
-{
- my $raw = shift;
- my $cooked = "";
- my $daemonStatus = "";
-
- if ($raw =~ /^(\d+)\/(\d+)$/mg)
- {
- $cooked .= "Current number of children: $1";
- if ($2 > 0)
- {
- $cooked .= " (maximum $2)";
- }
- $cooked .= "\n";
- }
- while ($raw =~ /^(\d+) (.*)$/mg)
- {
- if (not $daemonStatus)
- {
- $daemonStatus = "(process $1) " . ucfirst($2) . "\n";
- }
- else
- {
- $cooked .= "Child Process $1 Status: $2\n";
- }
- }
- return ($daemonStatus, $cooked);
-}
-
-##########################################################################
-#
-# &start_daemon -- fork off a sendmail daemon
-#
-# Parameters:
-# control -- control socket name
-#
-# Returns:
-# Error message or "OK" if successful
-#
-
-sub start_daemon
-{
- my $control = shift;
- my $pid;
-
- if ($pid = fork)
- {
- my $exitstat;
-
- waitpid $pid, 0 or return "Could not get status of created process: $!\n";
- $exitstat = $? / 256;
- if ($exitstat != 0)
- {
- return "sendmail daemon startup exited with exit value $exitstat";
- }
- }
- elsif (defined $pid)
- {
- exec($main::sendmailDaemon);
- die "Unable to start sendmail daemon: $!.\n";
- }
- else
- {
- return "Could not create new process: $!\n";
- }
- return "OK\n";
-}
-
-##########################################################################
-#
-# &stop_daemon -- stop the sendmail daemon using control socket
-#
-# Parameters:
-# control -- control socket name
-#
-# Returns:
-# Error message or status message
-#
-
-sub stop_daemon
-{
- my $control = shift;
- my $status;
-
- if (not defined $control)
- {
- return "The control socket is not configured so the daemon can not be stopped.\n";
- }
- return &do_command($control, "SHUTDOWN");
-}
-
-##########################################################################
-#
-# &restart_daemon -- restart the sendmail daemon using control socket
-#
-# Parameters:
-# control -- control socket name
-#
-# Returns:
-# Error message or status message
-#
-
-sub restart_daemon
-{
- my $control = shift;
- my $status;
-
- if (not defined $control)
- {
- return "The control socket is not configured so the daemon can not be restarted.";
- }
- return &do_command($control, "RESTART");
-}
-
-##########################################################################
-#
-# &help -- get help from the daemon using the control socket
-#
-# Parameters:
-# control -- control socket name
-#
-# Returns:
-# Error message or status message
-#
-
-sub help
-{
- my $control = shift;
- my $status;
-
- if (not defined $control)
- {
- return "The control socket is not configured so the daemon can not be queried for help.";
- }
- return &do_command($control, "HELP");
-}
-
-my $command = shift;
-my $control = &get_controlname;
-my $status = undef;
-my $daemonStatus = undef;
-
-if (not defined $control)
-{
- die "No control socket available.\n";
-}
-if (not defined $command)
-{
- die "Usage: $0 command\n";
-}
-if ($command eq "status")
-{
- $status = &do_command($control, "STATUS");
- if (not defined $status)
- {
- # Not responding on control channel, query via SMTP
- if (&sendmail_running)
- {
- $daemonStatus = "Sendmail is running but not answering status queries.";
- }
- else
- {
- $daemonStatus = "Sendmail does not appear to be running.";
- }
- }
- else
- {
- # Munge control channel output
- ($daemonStatus, $status) = &munge_status($status);
- }
-}
-elsif (lc($command) eq "shutdown")
-{
- $status = &stop_daemon($control);
-}
-elsif (lc($command) eq "restart")
-{
- $status = &restart_daemon($control);
-}
-elsif (lc($command) eq "start")
-{
- $status = &start_daemon($control);
-}
-elsif (lc($command) eq "help")
-{
- $status = &help($control);
-}
-else
-{
- die "Unrecognized command $command\n";
-}
-if (defined $daemonStatus)
-{
- print "Daemon Status: $daemonStatus\n";
-}
-if (defined $status)
-{
- print "$status\n";
-}
-else
-{
- die "No response\n";
-}
diff --git a/contrib/sendmail/doc/changes/Makefile b/contrib/sendmail/doc/changes/Makefile
index 76eaa3912ee2..46447c2e5340 100644
--- a/contrib/sendmail/doc/changes/Makefile
+++ b/contrib/sendmail/doc/changes/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 8.1 (Berkeley) 4/13/1994
+# @(#)Makefile 8.1 (Berkeley) 4/13/94
DIR= smm/09.sendmail
SRCS= changes.me
diff --git a/contrib/sendmail/doc/changes/changes.me b/contrib/sendmail/doc/changes/changes.me
index b963396ba49d..dbe9bea3cb89 100644
--- a/contrib/sendmail/doc/changes/changes.me
+++ b/contrib/sendmail/doc/changes/changes.me
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)changes.me 8.7 (Berkeley) 5/19/1998
+.\" @(#)changes.me 8.7 (Berkeley) 5/19/98
.\"
.\" ditroff -me -Pxx changes.me
.eh '%''Changes in Sendmail Version 8'
diff --git a/contrib/sendmail/doc/intro/Makefile b/contrib/sendmail/doc/intro/Makefile
index 6369a4a0fec8..939cd6c17eb0 100644
--- a/contrib/sendmail/doc/intro/Makefile
+++ b/contrib/sendmail/doc/intro/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 8.2 (Berkeley) 2/28/1994
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
DIR= smm/09.sendmail
SRCS= intro.me
diff --git a/contrib/sendmail/doc/intro/intro.me b/contrib/sendmail/doc/intro/intro.me
index 03cfa336994d..5bb5e8947a0b 100644
--- a/contrib/sendmail/doc/intro/intro.me
+++ b/contrib/sendmail/doc/intro/intro.me
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)intro.me 8.7 (Berkeley) 5/19/1998
+.\" @(#)intro.me 8.7 (Berkeley) 5/19/98
.\"
.\" pic -Pxx intro.me | ditroff -me -Pxx
.eh 'SMM:9-%''SENDMAIL \*- An Internetwork Mail Router'
diff --git a/contrib/sendmail/doc/op/Makefile b/contrib/sendmail/doc/op/Makefile
index 0d86e91de917..e8f791a4959c 100644
--- a/contrib/sendmail/doc/op/Makefile
+++ b/contrib/sendmail/doc/op/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 8.2 (Berkeley) 2/28/1994
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
DIR= smm/08.sendmailop
SRCS= op.me
diff --git a/contrib/sendmail/doc/op/op.me b/contrib/sendmail/doc/op/op.me
index a2b0ef142501..fc3290ef2d38 100644
--- a/contrib/sendmail/doc/op/op.me
+++ b/contrib/sendmail/doc/op/op.me
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)op.me 8.134 (Berkeley) 9/16/1998
+.\" @(#)op.me 8.129 (Berkeley) 6/29/98
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
@@ -46,7 +46,7 @@ Eric Allman
Sendmail, Inc.
eric@Sendmail.COM
.sp
-Version 8.134
+Version 8.129
.sp
For Sendmail Version 8.9
.)l
@@ -259,7 +259,7 @@ program.
For now, see the file BuildTools/README for details.)
.sh 3 "Tweaking the Makefile"
.pp
-.\" .b "XXX This should all be in the Site Configuration File section."
+.b "XXX This should all be in the Site Configuration File section."
.i Sendmail
supports two different formats
for the local (on disk) version of databases,
@@ -1157,7 +1157,7 @@ does not use the native service switch in this release.
.)f
.pp
If the underlying operating system does not support a service switch
-(e.g., SunOS 4.X, HP-UX, BSD)
+(e.g., SunOS, HP-UX, BSD)
then
.i sendmail
will provide a stub implementation.
@@ -2083,8 +2083,6 @@ The timeout waiting for a reply to an IDENT query
.(f
\**On some systems the default is zero to turn the protocol off entirely.
.)f
-.ip fileopen
-The timeout for opening .forward and :include: files [60s, none].
.ip hoststatus
How long status information about a host
(e.g., host down)
@@ -2733,7 +2731,7 @@ although system routines may use other services
service for user name lookups by
.i getpwname ).
.pp
-However, some systems (such as SunOS 4.X)
+However, some systems (such as SunOS)
will do DNS lookups
regardless of the setting of the service switch entry.
In particular, the system routine
@@ -2825,7 +2823,7 @@ it will not assume that all names match.
.pp
To completely turn off all name server access
on systems without service switch support
-(such as SunOS 4.X)
+(such as SunOS)
you will have to recompile with
\-DNAMED_BIND=0
and remove \-lresolv from the list of libraries to be searched
@@ -3676,7 +3674,7 @@ will be
or whatever is appropriate for the receiving mailer.
.ip $h
The recipient host.
-This is set in ruleset 0 from the $@ field of a parsed address.
+This is set in ruleset 0 from the $# field of a parsed address.
.ip $i
The queue id,
e.g.,
@@ -3790,9 +3788,6 @@ The IP address of the SMTP client.
Defined in the SMTP server only.
.ip ${client_name}
The host name of the SMTP client.
-This may be the client's bracketed IP address
-in the form [ nnn.nnn.nnn.nnn ] if the client's
-IP address is not resolvable.
Defined in the SMTP server only.
.ip ${client_port}
The port number of the SMTP client.
@@ -4604,7 +4599,6 @@ or may be two ids separated by a slash;
if so, the first rewriting set is applied to envelope
addresses
and the second is applied to headers.
-Setting any value zero disables corresponding mailer-specific rewriting.
.pp
The Directory
is actually a colon-separated path of directories to try.
@@ -6129,7 +6123,7 @@ For example,
as of this writing
version 8 config files
(specifically, 8.9)
-used version level 8 configurations.
+used version level 7 configurations.
.pp
.q Old
configuration files are defined as version level one.
@@ -6224,10 +6218,6 @@ flag (use 250 instead of 252 return value for
commands)
was assumed.
.pp
-Version level eight configuration files allow
-.b $#
-on the left hand side of ruleset lines.
-.pp
The
.b V
line may have an optional
@@ -6526,7 +6516,7 @@ if used, it is substituted by the substring matches, delimited by
.b $|
or the string specified with the the
.b \-d
-flag. The flags available for the map are
+flag. The flags availble for the map are
.(b
-n not
-f case sensitive
@@ -6539,8 +6529,7 @@ flag. The flags available for the map are
replace/discard value
.)b
The
-.b \-s
-flag can include an optional parameter which can be used
+.b \-s flag can include an optional parameter which can be used
to select the substrings in the result of the lookup. For example,
.(b
-s1,3,4
@@ -8189,7 +8178,7 @@ Temporary versions of the qf files,
used during queue file rebuild.
.ip /var/spool/mqueue/xf*
A transcript of the current session.
-.if o \
+.if e \
\{\
. bp
. rs
@@ -8213,7 +8202,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version 8.134
+.\"Version 8.129
.\".ce 0
.bp 3
.ce
@@ -8235,12 +8224,3 @@ TABLE OF CONTENTS
.rm ef
.rm of
.xp
-.if o \
-\{\
-. bp
-. rs
-. sp |4i
-. ce 2
-This page intentionally left blank;
-replace it with a blank sheet for double-sided output.
-.\}
diff --git a/contrib/sendmail/doc/usenix/Makefile b/contrib/sendmail/doc/usenix/Makefile
index d2308cb891bc..ea0665c67bed 100644
--- a/contrib/sendmail/doc/usenix/Makefile
+++ b/contrib/sendmail/doc/usenix/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 8.2 (Berkeley) 2/28/1994
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
SRCS= usenix.me
MACROS= -me
diff --git a/contrib/sendmail/doc/usenix/usenix.me b/contrib/sendmail/doc/usenix/usenix.me
index 4f88a94f8f24..0fbb6723c136 100644
--- a/contrib/sendmail/doc/usenix/usenix.me
+++ b/contrib/sendmail/doc/usenix/usenix.me
@@ -1,6 +1,6 @@
.nr si 3n
.he 'Mail Systems and Addressing in 4.2bsd''%'
-.fo 'Version 8.2'USENIX \- Jan 83'Last Mod 11/27/1993'
+.fo 'Version 8.2'USENIX \- Jan 83'Last Mod 11/27/93'
.if n .ls 2
.+c
.(l C
diff --git a/contrib/sendmail/mail.local/Build b/contrib/sendmail/mail.local/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/mail.local/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/mail.local/Makefile.m4 b/contrib/sendmail/mail.local/Makefile.m4
index bf9a155eefb1..5dc1857d3b7f 100644
--- a/contrib/sendmail/mail.local/Makefile.m4
+++ b/contrib/sendmail/mail.local/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.22 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.21 (Berkeley) 6/4/98
#
# C compiler
@@ -34,7 +34,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of mail.local binary (usually /usr/sbin or /usr/etc)
-EBINDIR=${DESTDIR}ifdef(`confEBINDIR', `confEBINDIR', `/usr/libexec')
+BINDIR= ${DESTDIR}ifdef(`confEBINDIR', `confEBINDIR', `/usr/libexec')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -91,7 +91,7 @@ install:
force-install: install-mail.local install-docs
install-mail.local: mail.local
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} mail.local ${EBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} mail.local ${BINDIR}
install-docs: mail.local.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/mail.local/README b/contrib/sendmail/mail.local/README
index 5da44bbfa1cf..a20506831c9d 100644
--- a/contrib/sendmail/mail.local/README
+++ b/contrib/sendmail/mail.local/README
@@ -1,4 +1,4 @@
-# @(#)README 8.1 (Berkeley) 2/17/1998
+# @(#)README 8.1 (Berkeley) 2/17/98
This directory contains the source files for mail.local.
diff --git a/contrib/sendmail/mail.local/mail.local.8 b/contrib/sendmail/mail.local/mail.local.8
index 541a7ee10264..7aa7cdbfa826 100644
--- a/contrib/sendmail/mail.local/mail.local.8
+++ b/contrib/sendmail/mail.local/mail.local.8
@@ -7,7 +7,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mail.local.8 8.7 (Berkeley) 5/19/1998
+.\" @(#)mail.local.8 8.7 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt MAIL.LOCAL 8
diff --git a/contrib/sendmail/mail.local/mail.local.c b/contrib/sendmail/mail.local/mail.local.c
index 2a405c5e86b1..2a3b07273bdb 100644
--- a/contrib/sendmail/mail.local/mail.local.c
+++ b/contrib/sendmail/mail.local/mail.local.c
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1998 Sendmail, Inc. All rights reserved.
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -16,7 +16,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mail.local.c 8.83 (Berkeley) 12/17/1998";
+static char sccsid[] = "@(#)mail.local.c 8.78 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -102,7 +102,7 @@ static char sccsid[] = "@(#)mail.local.c 8.83 (Berkeley) 12/17/1998";
# define USE_VSYSLOG 0
#endif
-#if defined(NeXT) && !defined(__APPLE__)
+#if defined(NeXT)
# include <libc.h>
# define _PATH_MAILDIR "/usr/spool/mail"
# define __dead /* empty */
@@ -216,20 +216,18 @@ extern char *strerror __P((int));
# define S_ISREG(mode) (((mode) & _S_IFMT) == S_IFREG)
#endif
-#ifndef MAILER_DAEMON
-# define MAILER_DAEMON "MAILER-DAEMON"
-#endif
-
int eval = EX_OK; /* sysexits.h error value. */
int lmtpmode = 0;
u_char tTdvect[100];
void deliver __P((int, char *, int, int));
void e_to_sys __P((int));
+void err __P((const char *, ...)) __dead2;
void notifybiff __P((char *));
int store __P((char *, int));
void usage __P((void));
void vwarn __P((const char *, _BSD_VA_LIST_));
+void warn __P((const char *, ...));
void lockmbox __P((char *));
void unlockmbox __P((void));
void mailerr __P((const char *, const char *, ...));
@@ -273,7 +271,7 @@ main(argc, argv)
case 'f':
case 'r': /* Backward compatible. */
if (from != NULL) {
- mailerr(NULL, "multiple -f options");
+ warn("multiple -f options");
usage();
}
from = optarg;
@@ -346,7 +344,7 @@ parseaddr(s)
return NULL;
} else {
while ((isascii(*p) && isalnum(*p)) ||
- strchr(".-_", *p))
+ *p == '.' || *p == '-')
p++;
}
if (*p == ',' && p[1] == '@')
@@ -357,8 +355,6 @@ parseaddr(s)
return NULL;
}
- s = p;
-
/* local-part */
if (*p == '\"') {
p++;
@@ -398,7 +394,7 @@ parseaddr(s)
return NULL;
} else {
while ((isascii(*p) && isalnum(*p)) ||
- strchr(".-_", *p))
+ *p == '.' || *p == '-')
p++;
}
}
@@ -408,11 +404,6 @@ parseaddr(s)
if (*p && *p != ' ')
return NULL;
len = p - s - 1;
- if (*s == '\0' || len <= 0)
- {
- s = MAILER_DAEMON;
- len = strlen(s);
- }
p = malloc(len + 1);
if (p == NULL) {
@@ -600,7 +591,7 @@ store(from, lmtprcpts)
char *from;
int lmtprcpts;
{
- FILE *fp = NULL;
+ FILE *fp;
time_t tval;
int fd, eline;
char line[2048];
@@ -612,8 +603,8 @@ store(from, lmtprcpts)
printf("451 4.3.0 unable to open temporary file\r\n");
return -1;
} else {
- mailerr("451 4.3.0", "unable to open temporary file");
- exit(eval);
+ e_to_sys(errno);
+ err("unable to open temporary file");
}
}
(void)unlink(tmpbuf);
@@ -628,21 +619,13 @@ store(from, lmtprcpts)
line[0] = '\0';
for (eline = 1; fgets(line, sizeof(line), stdin);) {
- size_t line_len = strlen(line);
-
- if (line_len >= 2 &&
- line[line_len - 2] == '\r' &&
- line[line_len - 1] == '\n') {
- strcpy(line + line_len - 2, "\n");
+ if (line[strlen(line)-2] == '\r') {
+ strcpy(line+strlen(line)-2, "\n");
}
if (lmtprcpts && line[0] == '.') {
- char *src = line + 1, *dest = line;
-
if (line[1] == '\n')
goto lmtpdot;
- while (*src != '\0')
- *dest++ = *src++;
- *dest = '\0';
+ strcpy(line, line+1);
}
if (line[0] == '\n')
eline = 1;
@@ -661,10 +644,8 @@ store(from, lmtprcpts)
fclose(fp);
return -1;
} else {
- mailerr("451 4.3.0",
- "temporary file write error");
- fclose(fp);
- exit(eval);
+ e_to_sys(errno);
+ err("temporary file write error");
}
}
}
@@ -691,9 +672,8 @@ store(from, lmtprcpts)
fclose(fp);
return -1;
} else {
- mailerr("451 4.3.0", "temporary file write error");
- fclose(fp);
- exit(eval);
+ e_to_sys(errno);
+ err("temporary file write error");
}
}
return (fd);
@@ -728,13 +708,7 @@ deliver(fd, name, nobiff, nofsync)
}
}
else {
- char *errcode = NULL;
-
- if (eval == EX_TEMPFAIL)
- errcode = "451 4.3.0";
- else
- errcode = "550 5.1.1";
- mailerr(errcode, "unknown name: %s", name);
+ warn("unknown name: %s", name);
}
return;
}
@@ -789,8 +763,7 @@ tryagain:
if (lstat(path, &sb) < 0)
{
eval = EX_CANTCREAT;
- mailerr("550 5.2.0",
- "%s: lstat: file changed after open", path);
+ warn("%s: lstat: file changed after open", path);
goto err1;
}
else
@@ -829,8 +802,7 @@ tryagain:
#endif
sb.st_uid != fsb.st_uid) {
eval = EX_TEMPFAIL;
- mailerr("550 5.2.0", "%s: fstat: file changed after open",
- path);
+ warn("%s: fstat: file changed after open", path);
goto err1;
}
@@ -883,12 +855,9 @@ tryagain:
mailerr("450 4.2.0", "%s: %s", path, strerror(errno));
err3:
if (setreuid(0, 0) < 0) {
-#if 0
- /* already printed an error above for this recipient */
e_to_sys(errno);
mailerr("450 4.2.0", "setreuid(0, 0): %s",
strerror(errno));
-#endif
}
#ifdef DEBUG
printf("reset euid = %d\n", geteuid());
@@ -991,6 +960,7 @@ notifybiff(msg)
if ((sp = getservbyname("biff", "udp")) == NULL)
return;
if ((hp = gethostbyname("localhost")) == NULL) {
+ warn("localhost: %s", strerror(errno));
return;
}
addr.sin_family = hp->h_addrtype;
@@ -998,18 +968,20 @@ notifybiff(msg)
addr.sin_port = sp->s_port;
}
if (f < 0 && (f = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+ warn("socket: %s", strerror(errno));
return;
}
len = strlen(msg) + 1;
- (void) sendto(f, msg, len, 0, (struct sockaddr *)&addr, sizeof(addr));
+ if (sendto(f, msg, len, 0, (struct sockaddr *)&addr, sizeof(addr))
+ != len)
+ warn("sendto biff: %s", strerror(errno));
}
void
usage()
{
eval = EX_USAGE;
- mailerr(NULL, "usage: mail.local [-b] [-l] [-f from] [-s] user ...");
- exit(eval);
+ err("usage: mail.local [-b] [-l] [-f from] [-s] user ...");
}
void
@@ -1031,8 +1003,7 @@ mailerr(hdr, fmt, va_alist)
#endif
if (lmtpmode)
{
- if (hdr != NULL)
- printf("%s ", hdr);
+ printf("%s ", hdr);
vprintf(fmt, ap);
printf("\r\n");
}
@@ -1043,6 +1014,49 @@ mailerr(hdr, fmt, va_alist)
}
}
+#ifdef __STDC__
+void
+err(const char *fmt, ...)
+#else
+void
+err(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ va_list ap;
+
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ vwarn(fmt, ap);
+ va_end(ap);
+
+ exit(eval);
+}
+
+void
+#ifdef __STDC__
+warn(const char *fmt, ...)
+#else
+warn(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ va_list ap;
+
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ vwarn(fmt, ap);
+ va_end(ap);
+}
+
void
vwarn(fmt, ap)
const char *fmt;
diff --git a/contrib/sendmail/mail.local/pathnames.h b/contrib/sendmail/mail.local/pathnames.h
index 33d949e4370c..5ec006866d85 100644
--- a/contrib/sendmail/mail.local/pathnames.h
+++ b/contrib/sendmail/mail.local/pathnames.h
@@ -8,7 +8,7 @@
* the sendmail distribution.
*
*
- * @(#)pathnames.h 8.5 (Berkeley) 5/19/1998
+ * @(#)pathnames.h 8.5 (Berkeley) 5/19/98
*/
#include <paths.h>
diff --git a/contrib/sendmail/mailstats/Build b/contrib/sendmail/mailstats/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/mailstats/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/mailstats/Makefile.m4 b/contrib/sendmail/mailstats/Makefile.m4
index 2de9904f9c3d..ae5489c62eee 100644
--- a/contrib/sendmail/mailstats/Makefile.m4
+++ b/contrib/sendmail/mailstats/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.15 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.14 (Berkeley) 6/4/98
#
# C compiler
@@ -34,7 +34,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of mailstats binary (usually /usr/sbin or /usr/etc)
-SBINDIR=${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
+BINDIR= ${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -82,7 +82,7 @@ mailstats.${MAN8SRC}: mailstats.8
install: install-mailstats install-docs
install-mailstats: mailstats
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} mailstats ${SBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} mailstats ${BINDIR}
install-docs: mailstats.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/mailstats/mailstats.8 b/contrib/sendmail/mailstats/mailstats.8
index be2203d85fa6..3a8847a6f647 100644
--- a/contrib/sendmail/mailstats/mailstats.8
+++ b/contrib/sendmail/mailstats/mailstats.8
@@ -5,7 +5,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mailstats.8 8.8 (Berkeley) 11/13/1998
+.\" @(#)mailstats.8 8.5 (Berkeley) 5/19/98
.\"
.Dd April 25, 1996
.Dt MAILSTATS 1
@@ -16,7 +16,6 @@
.Sh SYNOPSIS
.Nm mailstats
.Op Fl o
-.if \nP .Op Fl p
.Op Fl C Ar cffile
.Op Fl f Ar stfile
.Sh DESCRIPTION
@@ -42,10 +41,6 @@ Kbytes from the mailer.
Number of messages to the mailer.
.It Sy bytes_to
Kbytes to the mailer.
-.It Sy msgsrej
-Number of messages rejected.
-.It Sy msgsdis
-Number of messages discarded.
.It Sy Mailer
The name of the mailer.
.El
@@ -69,11 +64,6 @@ specified in the
.Nm sendmail
.Dq cf
file.
-.if \nP \
-\{
-.It Fl p
-Output information in program-readable mode and clear statistics.
-.\}
.It Fl o
Don't display the name of the mailer in the output.
.El
@@ -83,14 +73,12 @@ The
utility exits 0 on success, and >0 if an error occurs.
.Sh FILES
.Bl -tag -width /var/log/sendmail.stXX -compact
-.ie \nP .It Pa /etc/mail/sendmail.cf
-.el .It Pa /etc/sendmail.cf
+.It Pa /etc/sendmail.cf
The default
.Nm sendmail
.Dq cf
file.
-.ie \nP .It Pa /etc/mail/statistics
-.el .It Pa /var/log/sendmail.st
+.It Pa /var/log/sendmail.st
The default
.Nm sendmail
statistics file.
diff --git a/contrib/sendmail/mailstats/mailstats.c b/contrib/sendmail/mailstats/mailstats.c
index 55a7b96b007e..2ad489fac712 100644
--- a/contrib/sendmail/mailstats/mailstats.c
+++ b/contrib/sendmail/mailstats/mailstats.c
@@ -18,7 +18,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.28 (Berkeley) 9/14/1998";
+static char sccsid[] = "@(#)mailstats.c 8.26 (Berkeley) 7/2/98";
#endif /* not lint */
#ifndef NOT_SENDMAIL
@@ -45,20 +45,17 @@ main(argc, argv)
char *cfile;
FILE *cfp;
bool mnames;
- bool progmode;
long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0, rejmsgs = 0;
long dismsgs = 0;
char mtable[MAXMAILERS][MNAMELEN+1];
char sfilebuf[MAXLINE];
char buf[MAXLINE];
- time_t now;
extern char *ctime();
cfile = _PATH_SENDMAILCF;
sfile = NULL;
mnames = TRUE;
- progmode = FALSE;
- while ((ch = getopt(argc, argv, "C:f:op")) != -1)
+ while ((ch = getopt(argc, argv, "C:f:o")) != -1)
{
switch (ch)
{
@@ -74,22 +71,11 @@ main(argc, argv)
mnames = FALSE;
break;
-#if _FFR_MAILSTATS_PROGMODE
- case 'p':
- progmode = TRUE;
- break;
-#endif
-
case '?':
default:
usage:
-#if _FFR_MAILSTATS_PROGMODE
- fputs("usage: mailstats [-o] [-C cffile] [-f stfile] -o -p\n",
- stderr);
-#else
- fputs("usage: mailstats [-o] [-C cffile] [-f stfile] -o \n",
+ fputs("usage: mailstats [-o] [-C cffile] [-f stfile]\n",
stderr);
-#endif
exit(EX_USAGE);
}
}
@@ -240,29 +226,15 @@ main(argc, argv)
}
}
- if (progmode)
- {
- time(&now);
- printf("%ld %ld\n", (long) stat.stat_itime, (long) now);
- }
- else
- {
- printf("Statistics from %s", ctime(&stat.stat_itime));
- printf(" M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n",
- mnames ? " Mailer" : "");
- }
+ printf("Statistics from %s", ctime(&stat.stat_itime));
+ printf(" M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n",
+ mnames ? " Mailer" : "");
for (i = 0; i < MAXMAILERS; i++)
{
if (stat.stat_nf[i] || stat.stat_nt[i] ||
stat.stat_nr[i] || stat.stat_nd[i])
{
- char *format;
-
- if (progmode)
- format = "%2d %8ld %10ld %8ld %10ld %6ld %6ld";
- else
- format = "%2d %8ld %10ldK %8ld %10ldK %6ld %6ld";
- printf(format, i,
+ printf("%2d %8ld %10ldK %8ld %10ldK %6ld %6ld", i,
stat.stat_nf[i], stat.stat_bf[i],
stat.stat_nt[i], stat.stat_bt[i],
stat.stat_nr[i], stat.stat_nd[i]);
@@ -277,20 +249,8 @@ main(argc, argv)
dismsgs += stat.stat_nd[i];
}
}
- if (progmode)
- {
- printf(" T %8ld %10ld %8ld %10ld %6ld %6ld\n",
- frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
- close(fd);
- fd = open(sfile, O_RDWR | O_TRUNC);
- if (fd > 0)
- close(fd);
- }
- else
- {
- printf("=============================================================\n");
- printf(" T %8ld %10ldK %8ld %10ldK %6ld %6ld\n",
- frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
- }
+ printf("=============================================================\n");
+ printf(" T %8ld %10ldK %8ld %10ldK %6ld %6ld\n",
+ frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
exit(EX_OK);
}
diff --git a/contrib/sendmail/makemap/Build b/contrib/sendmail/makemap/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/makemap/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/makemap/Makefile.m4 b/contrib/sendmail/makemap/Makefile.m4
index 983ffdf3ff82..0f0c242d8958 100644
--- a/contrib/sendmail/makemap/Makefile.m4
+++ b/contrib/sendmail/makemap/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.21 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.20 (Berkeley) 6/4/98
#
# C compiler
@@ -41,7 +41,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of makemap binary (usually /usr/sbin or /usr/etc)
-SBINDIR=${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
+BINDIR= ${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -95,7 +95,7 @@ makemap.${MAN8SRC}: makemap.8
install: install-makemap install-docs
install-makemap: makemap
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${SBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${BINDIR}
install-docs: makemap.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/makemap/makemap.8 b/contrib/sendmail/makemap/makemap.8
index 81f53a85b52a..6180c8bda8b1 100644
--- a/contrib/sendmail/makemap/makemap.8
+++ b/contrib/sendmail/makemap/makemap.8
@@ -7,7 +7,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)makemap.8 8.12 (Berkeley) 11/13/1998
+.\" @(#)makemap.8 8.10 (Berkeley) 5/19/98
.\"
.Dd November 16, 1992
.Dt MAKEMAP 8
@@ -18,10 +18,8 @@
.Sh SYNOPSIS
.Nm
.Op Fl N
-.if \nP .Op Fl c Ar cachesize
.Op Fl d
.Op Fl f
-.if \nP .Op Fl l
.Op Fl o
.Op Fl r
.Op Fl s
@@ -78,11 +76,6 @@ Include the null byte that terminates strings
in the map.
This must match the \-N flag in the sendmail.cf
``K'' line.
-.if \nP \
-\{\
-.It Fl c
-Use the specified hash and B-Tree cache size.
-.\}
.It Fl d
Allow duplicate keys in the map.
This is only allowed on B-Tree format maps.
@@ -97,11 +90,6 @@ This is intended to mesh with the
\fBK\fP
line in sendmail.cf.
The value is never case folded.
-.if \nP \
-\{\
-.It Fl l
-List supported map types.
-.\}
.It Fl o
Append to an old file.
This allows you to augment an existing file.
diff --git a/contrib/sendmail/makemap/makemap.c b/contrib/sendmail/makemap/makemap.c
index 9717a4310ac5..5891d75ce919 100644
--- a/contrib/sendmail/makemap/makemap.c
+++ b/contrib/sendmail/makemap/makemap.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)makemap.c 8.71 (Berkeley) 11/29/1998";
+static char sccsid[] = "@(#)makemap.c 8.62 (Berkeley) 6/24/98";
#endif /* not lint */
#include <sys/types.h>
@@ -57,10 +57,10 @@ uid_t RunAsUid;
uid_t RunAsGid;
char *RunAsUserName;
int Verbose = 2;
-bool DontInitGroups = FALSE;
+bool DontInitGroups = TRUE;
long DontBlameSendmail = DBS_SAFE;
u_char tTdvect[100];
-uid_t TrustedUid = 0;
+uid_t TrustedFileUid = 0;
#define BUFSIZE 1024
@@ -79,20 +79,16 @@ main(argc, argv)
bool foldcase = TRUE;
int exitstat;
int opt;
- char *typename = NULL;
- char *mapname = NULL;
- char *ext = NULL;
+ char *typename;
+ char *mapname;
+ char *ext;
int lineno;
int st;
int mode;
- int putflags = 0;
-#ifdef NEWDB
+ int putflags;
long dbcachesize = 1024 * 1024;
-#endif
enum type type;
-#if !O_EXLOCK
int fd;
-#endif
int sff = SFF_ROOTOK|SFF_REGONLY;
struct passwd *pw;
union
@@ -120,7 +116,7 @@ main(argc, argv)
#ifdef NDBM
char pbuf[MAXNAME];
#endif
-#if _FFR_TRUSTED_USER
+#if _FFR_TRUSTED_FILE_OWNER
FILE *cfp;
char buf[MAXLINE];
#endif
@@ -149,7 +145,7 @@ main(argc, argv)
RunAsUserName = RealUserName = rnamebuf;
#if _FFR_NEW_MAKEMAP_FLAGS
-#define OPTIONS "C:Nc:dflorsv"
+#define OPTIONS "C:Nc:dforsv"
#else
#define OPTIONS "C:Ndforsv"
#endif
@@ -167,9 +163,7 @@ main(argc, argv)
#if _FFR_NEW_MAKEMAP_FLAGS
case 'c':
-# ifdef NEWDB
dbcachesize = atol(optarg);
-# endif
break;
#endif
@@ -181,19 +175,6 @@ main(argc, argv)
foldcase = FALSE;
break;
-#if _FFR_NEW_MAKEMAP_FLAGS
- case 'l':
-# ifdef NDBM
- printf("dbm\n");
-# endif
-# ifdef NEWDB
- printf("hash\n");
- printf("btree\n");
-# endif
- exit(EX_OK);
- break;
-#endif
-
case 'o':
notrunc = TRUE;
break;
@@ -251,7 +232,7 @@ main(argc, argv)
type = T_UNKNOWN;
}
-#if _FFR_TRUSTED_USER
+#if _FFR_TRUSTED_FILE_OWNER
if ((cfp = fopen(cfile, "r")) == NULL)
{
fprintf(stderr, "mailstats: ");
@@ -269,8 +250,8 @@ main(argc, argv)
switch (*b++)
{
case 'O': /* option */
- if (strncasecmp(b, " TrustedUser", 12) == 0 &&
- !(isascii(b[12]) && isalnum(b[12])))
+ if (strncasecmp(b, " TrustedFileOwner", 17) == 0 &&
+ !(isascii(b[17]) && isalnum(b[17])))
{
b = strchr(b, '=');
if (b == NULL)
@@ -278,26 +259,26 @@ main(argc, argv)
while (isascii(*++b) && isspace(*b))
continue;
if (isascii(*b) && isdigit(*b))
- TrustedUid = atoi(b);
+ TrustedFileUid = atoi(b);
else
{
register struct passwd *pw;
- TrustedUid = 0;
+ TrustedFileUid = 0;
pw = getpwnam(b);
if (pw == NULL)
fprintf(stderr,
- "TrustedUser: unknown user %s\n", b);
+ "TrustedFileOwner: unknown user %s", b);
else
- TrustedUid = pw->pw_uid;
+ TrustedFileUid = pw->pw_uid;
}
# ifdef UID_MAX
- if (TrustedUid > UID_MAX)
+ if (TrustedFileUid > UID_MAX)
{
- syserr("TrustedUser: uid value (%ld) > UID_MAX (%ld)",
- TrustedUid, UID_MAX);
- TrustedUid = 0;
+ syserr("TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
}
# endif
break;
@@ -315,7 +296,7 @@ main(argc, argv)
case T_ERR:
#if _FFR_NEW_MAKEMAP_FLAGS
fprintf(stderr,
- "Usage: %s [-N] [-c cachesize] [-d] [-f] [-l] [-o] [-r] [-s] [-v] type mapname\n",
+ "Usage: %s [-N] [-c cachesize] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n",
progname);
#else
fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n", progname);
@@ -524,18 +505,16 @@ main(argc, argv)
dbm_close(dbp.dbm);
exit(EX_CANTCREAT);
}
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(dbm_dirfno(dbp.dbm), TrustedUid, -1) < 0 ||
- fchown(dbm_pagfno(dbp.dbm), TrustedUid, -1) < 0)
+ if (fchown(dbm_dirfno(dbp.dbm), TrustedFileUid, -1) < 0 ||
+ fchown(dbm_pagfno(dbp.dbm), TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
break;
#endif
@@ -590,17 +569,15 @@ main(argc, argv)
exit(EX_CANTCREAT);
}
(void) (*dbp.db->sync)(dbp.db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
}
break;
@@ -651,17 +628,15 @@ main(argc, argv)
exit(EX_CANTCREAT);
}
(void) (*dbp.db->sync)(dbp.db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
}
break;
#endif
@@ -961,12 +936,10 @@ const char *
errstring(err)
int err;
{
-#if !HASSTRERROR
static char errstr[64];
-# if !defined(ERRLIST_PREDEFINED)
+#if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
extern char *sys_errlist[];
extern int sys_nerr;
-# endif
#endif
/* handle pseudo-errors internal to sendmail */
diff --git a/contrib/sendmail/praliases/Build b/contrib/sendmail/praliases/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/praliases/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/praliases/Makefile.m4 b/contrib/sendmail/praliases/Makefile.m4
index 7e78412f06ad..a4a2e61fa49b 100644
--- a/contrib/sendmail/praliases/Makefile.m4
+++ b/contrib/sendmail/praliases/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.16 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.15 (Berkeley) 6/4/98
#
# C compiler
@@ -41,7 +41,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of praliases binary (usually /usr/sbin or /usr/etc)
-SBINDIR=${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
+BINDIR= ${DESTDIR}ifdef(`confSBINDIR', `confSBINDIR', `/usr/sbin')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -89,7 +89,7 @@ praliases.${MAN8SRC}: praliases.8
install: install-praliases install-docs
install-praliases: praliases
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} praliases ${SBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} praliases ${BINDIR}
install-docs: praliases.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/praliases/praliases.8 b/contrib/sendmail/praliases/praliases.8
index 08337019dce4..f47121840de1 100644
--- a/contrib/sendmail/praliases/praliases.8
+++ b/contrib/sendmail/praliases/praliases.8
@@ -5,7 +5,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)praliases.8 8.5 (Berkeley) 5/19/1998
+.\" @(#)praliases.8 8.5 (Berkeley) 5/19/98
.\"
.Dd April 25, 1996
.Dt PRALIASES 1
diff --git a/contrib/sendmail/praliases/praliases.c b/contrib/sendmail/praliases/praliases.c
index 8b0057af7e75..db7aa683adc3 100644
--- a/contrib/sendmail/praliases/praliases.c
+++ b/contrib/sendmail/praliases/praliases.c
@@ -17,7 +17,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
+static char sccsid[] = "@(#)praliases.c 8.17 (Berkeley) 6/25/98";
#endif /* not lint */
#if !defined(NDBM) && !defined(NEWDB)
@@ -32,7 +32,6 @@ static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
# define NOT_SENDMAIL
#endif
#include <sendmail.h>
-#include <pathnames.h>
#ifdef NEWDB
# include <db.h>
# ifndef DB_VERSION_MAJOR
@@ -51,11 +50,6 @@ static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
extern char *strerror __P((int));
#endif
-static void praliases __P((char *, int, char **));
-#ifdef NDBM
-static void praliases_dbm __P((char *, int, char **));
-#endif
-
int
main(argc, argv)
int argc;
@@ -63,148 +57,32 @@ main(argc, argv)
{
extern char *optarg;
extern int optind;
- char *cfile;
-#if _FFR_GRAB_ALIASFILE_OPTION
- char *filename = NULL;
-#else
- char *filename = "/etc/aliases";
+#ifdef NDBM
+ DBM *dbp;
+ datum content, key;
#endif
- FILE *cfp;
+ char *filename;
int ch;
- char afilebuf[MAXLINE];
- char buf[MAXLINE];
+#ifdef NEWDB
+ DB *db;
+ DBT newdbkey, newdbcontent;
+ char buf[MAXNAME];
+#endif
- cfile = _PATH_SENDMAILCF;
-#if _FFR_GRAB_ALIASFILE_OPTION
- while ((ch = getopt(argc, argv, "C:f:")) != -1)
-#else
+ filename = "/etc/aliases";
while ((ch = getopt(argc, argv, "f:")) != -1)
-#endif
- {
- switch ((char)ch) {
- case 'C':
- cfile = optarg;
- break;
+ switch((char)ch) {
case 'f':
filename = optarg;
break;
case '?':
default:
- (void)fprintf(stderr,
-#if _FFR_GRAB_ALIASFILE_OPTION
- "usage: praliases [-C cffile] [-f aliasfile]\n");
-#else
- "usage: praliases [-f aliasfile]\n");
-#endif
+ (void)fprintf(stderr, "usage: praliases [-f file]\n");
exit(EX_USAGE);
}
- }
argc -= optind;
argv += optind;
- if (filename != NULL)
- {
- praliases(filename, argc, argv);
- exit(EX_OK);
- }
-
- if ((cfp = fopen(cfile, "r")) == NULL)
- {
- fprintf(stderr, "praliases: ");
- perror(cfile);
- exit(EX_NOINPUT);
- }
-
- while (fgets(buf, sizeof(buf), cfp) != NULL)
- {
- register char *b, *p;
-
- b = buf;
- switch (*b++)
- {
- case 'O': /* option -- see if alias file */
- if (strncasecmp(b, " AliasFile", 10) == 0 &&
- !(isascii(b[10]) && isalnum(b[10])))
- {
- /* new form -- find value */
- b = strchr(b, '=');
- if (b == NULL)
- continue;
- while (isascii(*++b) && isspace(*b))
- continue;
- }
- else if (*b++ != 'A')
- {
- /* something else boring */
- continue;
- }
-
- /* this is the A or AliasFile option -- save it */
- if (strlen(b) >= sizeof afilebuf)
- {
- fprintf(stderr,
- "AliasFile filename too long: %.30s...\n",
- b);
- (void) fclose(cfp);
- exit(EX_CONFIG);
- }
- strcpy(afilebuf, b);
- b = afilebuf;
-
- for (p = b; p != NULL; )
- {
- while (isascii(*p) && isspace(*p))
- p++;
- if (*p == '\0')
- break;
- b = p;
-
- p = strpbrk(p, " ,/");
- /* find end of spec */
- if (p != NULL)
- p = strpbrk(p, ",\n");
- if (p != NULL)
- *p++ = '\0';
-
- praliases(b, argc, argv);
- }
-
- default:
- continue;
- }
- }
- (void) fclose(cfp);
- exit(EX_OK);
-}
-
-static void
-praliases(filename, argc, argv)
- char *filename;
- int argc;
- char **argv;
-{
-#ifdef NEWDB
- DB *db;
- DBT newdbkey, newdbcontent;
- char buf[MAXNAME];
-#endif
- char *class;
-
- class = strchr(filename, ':');
- if (class != NULL)
- {
- if (strncasecmp(filename, "dbm:", 4) == 0)
- {
-#ifdef NDBM
- praliases_dbm(class + 1, argc, argv);
- return;
-#else
- fprintf(stderr, "class dbm not available\n");
- exit(EX_DATAERR);
-#endif
- }
- filename = class + 1;
- }
#ifdef NEWDB
if (strlen(filename) + 4 >= sizeof buf)
{
@@ -221,8 +99,7 @@ praliases(filename, argc, argv)
# endif
if (db != NULL)
{
- if (!argc)
- {
+ if (!argc) {
# if DB_VERSION_MAJOR > 1
DBC *dbc;
# endif
@@ -232,11 +109,7 @@ praliases(filename, argc, argv)
# if DB_VERSION_MAJOR < 2
while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
# else
-# if DB_VERSION_MAJOR > 2 || DB_VERSION_MINOR >=6
- if ((errno = db->cursor(db, NULL, &dbc, 0)) == 0)
-# else
if ((errno = db->cursor(db, NULL, &dbc)) == 0)
-# endif
{
while ((errno = dbc->c_get(dbc, &newdbkey,
&newdbcontent,
@@ -255,13 +128,11 @@ praliases(filename, argc, argv)
fprintf(stderr,
"praliases: %s: Could not set cursor: %s\n",
buf, strerror(errno));
- errno = db->close(db, 0);
exit(EX_DATAERR);
}
# endif
}
- else for (; *argv; ++argv)
- {
+ else for (; *argv; ++argv) {
bzero(&newdbkey, sizeof newdbkey);
bzero(&newdbcontent, sizeof newdbcontent);
newdbkey.data = *argv;
@@ -285,71 +156,39 @@ praliases(filename, argc, argv)
errno = db->close(db, 0);
# endif
}
- else
- {
-#endif
-#ifdef NDBM
- praliases_dbm(filename, argc, argv);
-#endif
-#ifdef NEWDB
- }
+ else {
#endif
-}
-
#ifdef NDBM
-static void
-praliases_dbm(filename, argc, argv)
- char *filename;
- int argc;
- char **argv;
-{
- DBM *dbp;
- datum content, key;
-
- if ((dbp = dbm_open(filename, O_RDONLY, 0)) == NULL)
- {
- (void)fprintf(stderr,
- "praliases: %s: %s\n", filename, strerror(errno));
- exit(EX_OSFILE);
- }
- if (!argc)
- {
- for (key = dbm_firstkey(dbp);
- key.dptr != NULL; key = dbm_nextkey(dbp))
- {
- content = dbm_fetch(dbp, key);
- (void)printf("%.*s:%.*s\n",
- (int) key.dsize, key.dptr,
- (int) content.dsize, content.dptr);
+ if ((dbp = dbm_open(filename, O_RDONLY, 0)) == NULL) {
+ (void)fprintf(stderr,
+ "praliases: %s: %s\n", filename, strerror(errno));
+ exit(EX_OSFILE);
}
- }
- else
- {
- for (; *argv; ++argv)
- {
- /*
- ** Use the sendmail adaptive algorithm of trying
- ** the key first without, then if needed with,
- ** the terminating NULL byte.
- */
- key.dptr = *argv;
- key.dsize = strlen(*argv);
- content = dbm_fetch(dbp, key);
- if (content.dptr == NULL)
- {
- key.dsize++;
+ if (!argc)
+ for (key = dbm_firstkey(dbp);
+ key.dptr != NULL; key = dbm_nextkey(dbp)) {
content = dbm_fetch(dbp, key);
+ (void)printf("%.*s:%.*s\n",
+ (int) key.dsize, key.dptr,
+ (int) content.dsize, content.dptr);
}
- if (content.dptr != NULL)
+ else for (; *argv; ++argv) {
+ key.dptr = *argv;
+ key.dsize = strlen(*argv) + 1;
+ content = dbm_fetch(dbp, key);
+ if (!content.dptr)
+ (void)printf("%s: No such key\n", key.dptr);
+ else
(void)printf("%s:%.*s\n", key.dptr,
(int) content.dsize, content.dptr);
- else
- (void)printf("%s: No such key\n", key.dptr);
}
+ dbm_close(dbp);
+#endif
+#ifdef NEWDB
}
- dbm_close(dbp);
-}
#endif
+ exit(EX_OK);
+}
#if !HASSTRERROR
diff --git a/contrib/sendmail/rmail/Build b/contrib/sendmail/rmail/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/rmail/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/rmail/Makefile.m4 b/contrib/sendmail/rmail/Makefile.m4
index 9f2d87b68a53..55468bd4f5cf 100644
--- a/contrib/sendmail/rmail/Makefile.m4
+++ b/contrib/sendmail/rmail/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.17 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.16 (Berkeley) 6/18/98
#
# C compiler
@@ -34,7 +34,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of rmail binary (usually /usr/sbin or /usr/etc)
-UBINDIR=${DESTDIR}ifdef(`confUBINDIR', `confUBINDIR', `/usr/bin')
+BINDIR= ${DESTDIR}ifdef(`confUBINDIR', `confUBINDIR', `/usr/bin')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -90,7 +90,7 @@ install:
force-install: install-rmail install-docs
install-rmail: rmail
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} rmail ${UBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} rmail ${BINDIR}
install-docs: rmail.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/rmail/rmail.8 b/contrib/sendmail/rmail/rmail.8
index 9f6ee26a88c8..ad70e5b5652a 100644
--- a/contrib/sendmail/rmail/rmail.8
+++ b/contrib/sendmail/rmail/rmail.8
@@ -7,7 +7,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)rmail.8 6.14 (Berkeley) 5/19/1998
+.\" @(#)rmail.8 6.14 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt RMAIL 8
diff --git a/contrib/sendmail/rmail/rmail.c b/contrib/sendmail/rmail/rmail.c
index 3c268abf613e..ff3fcef8e84b 100644
--- a/contrib/sendmail/rmail/rmail.c
+++ b/contrib/sendmail/rmail/rmail.c
@@ -16,7 +16,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)rmail.c 8.18 (Berkeley) 10/23/1998";
+static char sccsid[] = "@(#)rmail.c 8.17 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -136,10 +136,10 @@ main(argc, argv)
extern int errno, optind;
FILE *fp;
struct stat sb;
- size_t fplen = 0, fptlen = 0, len;
+ size_t fplen, fptlen, len;
off_t offset;
int ch, debug, i, pdes[2], pid, status;
- char *addrp = NULL, *domain, *p, *t;
+ char *addrp, *domain, *p, *t;
char *from_path, *from_sys, *from_user;
char *args[100], buf[2048], lbuf[2048];
diff --git a/contrib/sendmail/smrsh/Build b/contrib/sendmail/smrsh/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/smrsh/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/smrsh/Makefile.m4 b/contrib/sendmail/smrsh/Makefile.m4
index 5cae3f033366..19b2723e8859 100644
--- a/contrib/sendmail/smrsh/Makefile.m4
+++ b/contrib/sendmail/smrsh/Makefile.m4
@@ -1,7 +1,7 @@
#
# This Makefile is designed to work on the old "make" program.
#
-# @(#)Makefile.m4 8.14 (Berkeley) 7/12/1998
+# @(#)Makefile.m4 8.13 (Berkeley) 6/4/98
#
# C compiler
@@ -32,7 +32,7 @@ LIBDIRS=confLIBDIRS
LIBS= ifdef(`confLIBS', `confLIBS')
# location of smrsh binary (usually /usr/libexec or /usr/etc)
-EBINDIR=${DESTDIR}ifdef(`confEBINDIR', `confEBINDIR', `/usr/libexec')
+BINDIR= ${DESTDIR}ifdef(`confEBINDIR', `confEBINDIR', `/usr/libexec')
# additional .o files needed
OBJADD= ifdef(`confOBJADD', `confOBJADD')
@@ -81,7 +81,7 @@ smrsh.${MAN8SRC}: smrsh.8
install: install-smrsh install-docs
install-smrsh: smrsh
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} smrsh ${EBINDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} smrsh ${BINDIR}
install-docs: smrsh.${MAN8SRC}
ifdef(`confNO_MAN_INSTALL', `dnl',
diff --git a/contrib/sendmail/smrsh/README b/contrib/sendmail/smrsh/README
index fa4e2de31616..13f545c7e666 100644
--- a/contrib/sendmail/smrsh/README
+++ b/contrib/sendmail/smrsh/README
@@ -3,7 +3,7 @@
README smrsh - sendmail restricted shell.
- @(#)README 8.2 11/11/1995
+ @(#)README 8.2 11/11/95
This README file is provided as a courtesy of the CERT Coordination Center,
diff --git a/contrib/sendmail/smrsh/smrsh.8 b/contrib/sendmail/smrsh/smrsh.8
index bd0fb69db433..2e76f7efca35 100644
--- a/contrib/sendmail/smrsh/smrsh.8
+++ b/contrib/sendmail/smrsh/smrsh.8
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)smrsh.8 8.7 (Berkeley) 5/19/1998
+.\" @(#)smrsh.8 8.7 (Berkeley) 5/19/98
.\"
.TH SMRSH 8 11/02/93
.SH NAME
diff --git a/contrib/sendmail/smrsh/smrsh.c b/contrib/sendmail/smrsh/smrsh.c
index cf7768fcc476..ff90733c2630 100644
--- a/contrib/sendmail/smrsh/smrsh.c
+++ b/contrib/sendmail/smrsh/smrsh.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/98";
#endif /* not lint */
/*
diff --git a/contrib/sendmail/src/Build b/contrib/sendmail/src/Build
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/src/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/src/Makefile.m4 b/contrib/sendmail/src/Makefile.m4
index ad9e1c911a52..f4229c2ad6b4 100644
--- a/contrib/sendmail/src/Makefile.m4
+++ b/contrib/sendmail/src/Makefile.m4
@@ -2,7 +2,7 @@
# This Makefile is designed to work on any reasonably current version of
# "make" program.
#
-# @(#)Makefile.m4 8.25 (Berkeley) 10/5/1998
+# @(#)Makefile.m4 8.23 (Berkeley) 6/16/98
#
# C compiler
@@ -68,9 +68,9 @@ COPTS= -I. ${INCDIRS} ${MAPDEF} ${ENVDEF}
CFLAGS= $O ${COPTS}
BEFORE= confBEFORE
-OBJS= alias.o arpadate.o clock.o collect.o conf.o control.o convtime.o \
- daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o \
- main.o map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
safefile.o savemail.o snprintf.o srvrsmtp.o stab.o stats.o \
sysexits.o trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
@@ -130,8 +130,7 @@ install: install-sendmail install-docs
install-sendmail: sendmail
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf \
- ${HFDIR}/sendmail.hf
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 sendmail.st \
${STDIR}/sendmail.st
diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README
index 817b3a4f396f..a6f7dcfd6640 100644
--- a/contrib/sendmail/src/README
+++ b/contrib/sendmail/src/README
@@ -8,7 +8,7 @@
# the sendmail distribution.
#
#
-# @(#)README 8.209 (Berkeley) 10/6/1998
+# @(#)README 8.206 (Berkeley) 6/30/98
#
This directory contains the source files for sendmail(TM).
@@ -844,12 +844,6 @@ Digital UNIX (formerly DEC OSF/1)
This warning can be ignored.
- Digital UNIX's linker checks /usr/ccs/lib/ before /usr/lib/.
- If you have installed a new version of BIND in /usr/include
- and /usr/lib, you will experience difficulties as Digital ships
- libresolv.a in /usr/ccs/lib/ as well. Be sure to replace both
- copies of libresolv.a.
-
IRIX
The header files on SGI IRIX are completely prototyped, and as
a result you can sometimes get some warning messages during
@@ -1078,13 +1072,6 @@ Linux
to LIBS. Data structures may change and you'd be asking for a
core dump.
-AIX 4.2
- The AIX m4 implements a different mechanism for ifdef which is
- inconsistent with other versions of m4. Therefore, it will not
- work properly with the sendmail Build architecture or m4
- configuration method. To work around this problem, please use
- GNU m4 from ftp://ftp.gnu.org/pub/gnu/.
-
AIX 3.x
This version of sendmail does not support MB, MG, and MR resource
records, which are supported by AIX sendmail.
@@ -1452,4 +1439,4 @@ version.c The version number and information about this
Eric Allman
-(Version 8.209, last update 10/6/1998 17:10:21)
+(Version 8.206, last update 6/30/98 22:08:36)
diff --git a/contrib/sendmail/src/TRACEFLAGS b/contrib/sendmail/src/TRACEFLAGS
index 04b9b3c58423..588714da7f23 100644
--- a/contrib/sendmail/src/TRACEFLAGS
+++ b/contrib/sendmail/src/TRACEFLAGS
@@ -1,4 +1,4 @@
-# @(#)TRACEFLAGS 8.21 (Berkeley) 4/27/1998
+# @(#)TRACEFLAGS 8.21 (Berkeley) 4/27/98
0, 1 main.c main skip background fork
0, 4 main.c main canonical name, UUCP node name, a.k.a.s
0, 15 main.c main print configuration
diff --git a/contrib/sendmail/src/alias.c b/contrib/sendmail/src/alias.c
index a7149f2f849b..8da3317a3c1d 100644
--- a/contrib/sendmail/src/alias.c
+++ b/contrib/sendmail/src/alias.c
@@ -13,7 +13,7 @@
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.96 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)alias.c 8.92 (Berkeley) 6/5/98";
#endif /* not lint */
@@ -382,7 +382,7 @@ aliaswait(map, ext, isopen)
/* database is out of date */
if (AutoRebuild && stb.st_ino != 0 &&
(stb.st_uid == geteuid() ||
- (geteuid() == 0 && stb.st_uid == TrustedUid)))
+ (geteuid() == 0 && stb.st_uid == TrustedFileUid)))
{
bool oldSuprErrs;
@@ -510,7 +510,6 @@ rebuildaliases(map, automatic)
username());
}
map->map_mflags |= MF_OPEN|MF_WRITABLE;
- map->map_pid = getpid();
readaliases(map, af, !automatic, TRUE);
success = TRUE;
}
diff --git a/contrib/sendmail/src/aliases.5 b/contrib/sendmail/src/aliases.5
index 513bf49fd9a7..3fa4d6ea2637 100644
--- a/contrib/sendmail/src/aliases.5
+++ b/contrib/sendmail/src/aliases.5
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)aliases.5 8.8 (Berkeley) 5/19/1998
+.\" @(#)aliases.5 8.8 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt ALIASES 5
diff --git a/contrib/sendmail/src/arpadate.c b/contrib/sendmail/src/arpadate.c
index 1b539b6ce998..7a9576bdd4d2 100644
--- a/contrib/sendmail/src/arpadate.c
+++ b/contrib/sendmail/src/arpadate.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/clock.c b/contrib/sendmail/src/clock.c
index aab301c2c921..e81c9725d6e7 100644
--- a/contrib/sendmail/src/clock.c
+++ b/contrib/sendmail/src/clock.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/1998";
+static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c
index e334e968e020..190e6995743f 100644
--- a/contrib/sendmail/src/collect.c
+++ b/contrib/sendmail/src/collect.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)collect.c 8.91 (Berkeley) 8/19/1998";
+static char sccsid[] = "@(#)collect.c 8.89 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -81,6 +81,7 @@ collect(fp, smtpmode, hdrp, e)
char dfname[MAXQFNAME];
char bufbuf[MAXLINE];
extern bool isheader __P((char *));
+ extern void eatheader __P((ENVELOPE *, bool));
extern void tferror __P((FILE *volatile, ENVELOPE *));
headeronly = hdrp != NULL;
@@ -100,7 +101,7 @@ collect(fp, smtpmode, hdrp, e)
{
syserr("Cannot create %s", dfname);
e->e_flags |= EF_NO_BODY_RETN;
- finis(TRUE, ExitStat);
+ finis();
}
if (fstat(fileno(tf), &stbuf) < 0)
e->e_dfino = -1;
@@ -158,6 +159,8 @@ collect(fp, smtpmode, hdrp, e)
for (;;)
{
+ extern int chompheader __P((char *, bool, HDR **, ENVELOPE *));
+
if (tTd(30, 35))
printf("top, istate=%d, mstate=%d\n", istate, mstate);
for (;;)
@@ -411,7 +414,7 @@ readerr:
{
tferror(tf, e);
flush_errors(TRUE);
- finis(TRUE, ExitStat);
+ finis();
}
/* An EOF when running SMTP is an error */
@@ -453,7 +456,7 @@ readerr:
/* and don't try to deliver the partial message either */
if (InChild)
ExitStat = EX_QUIT;
- finis(TRUE, ExitStat);
+ finis();
}
/*
@@ -501,6 +504,7 @@ readerr:
/* no valid recipient headers */
register ADDRESS *q;
char *hdr = NULL;
+ extern void addheader __P((char *, char *, HDR **));
/* create an Apparently-To: field */
/* that or reject the message.... */
@@ -573,7 +577,7 @@ readerr:
{
/* we haven't acked receipt yet, so just chuck this */
syserr("Cannot reopen %s", dfname);
- finis(TRUE, ExitStat);
+ finis();
}
}
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index 82e7543f1047..838cd17d2356 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.450 (Berkeley) 12/17/1998";
+static char sccsid[] = "@(#)conf.c 8.431 (Berkeley) 6/25/98";
#endif /* not lint */
# include "sendmail.h"
@@ -217,6 +217,7 @@ setdefaults(e)
int i;
struct passwd *pw;
char buf[MAXNAME];
+ extern void inittimeouts __P((char *));
extern void setdefuser __P((void));
extern void setupmaps __P((void));
extern void setupmailers __P((void));
@@ -246,7 +247,7 @@ setdefaults(e)
DefGid = 1; /* option g */
setdefuser();
}
- TrustedUid = 0;
+ TrustedFileUid = 0;
if (tTd(37, 4))
printf("setdefaults: DefUser=%s, DefUid=%d, DefGid=%d\n",
DefUser != NULL ? DefUser : "<1:1>",
@@ -291,7 +292,6 @@ setdefaults(e)
#ifdef HESIOD_INIT
HesiodContext = NULL;
#endif
- ControlSocketName = NULL;
setupmaps();
setupmailers();
setupheaders();
@@ -324,6 +324,7 @@ void
setupmailers()
{
char buf[100];
+ extern void makemailer __P((char *));
strcpy(buf, "prog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c \201u");
makemailer(buf);
@@ -837,14 +838,6 @@ switch_map_find(service, maptype, mapreturn)
*p++ = '\0';
if (buf[0] == '\0')
continue;
- if (p == NULL)
- {
- sm_syslog(LOG_ERR, NOQID,
- "Bad line on %.100s: %.100s",
- ServiceSwitchFile,
- buf);
- continue;
- }
while (isspace(*p))
p++;
if (*p == '\0')
@@ -1287,10 +1280,10 @@ init_md(argc, argv)
#endif
#ifdef __QNX__
/*
- ** Due to QNX's network distributed nature, you can target a tcpip
- ** stack on a different node in the qnx network; this patch lets
- ** this feature work. The __sock_locate() must be done before the
- ** environment is clear.
+ ** Due to QNX's network distributed nature, you can target a tcpip
+ ** stack on a different node in the qnx network; this patch lets
+ ** this feature work. The __sock_locate() must be done before the
+ ** environment is clear.
*/
__sock_locate();
#endif
@@ -2054,7 +2047,7 @@ refuseconnections(port)
else if (conncnt++ > ConnRateThrottle && ConnRateThrottle > 0)
{
/* sleep to flatten out connection load */
- sm_setproctitle(TRUE, "deferring connections on port %d: %d per second",
+ setproctitle("deferring connections on port %d: %d per second",
port, ConnRateThrottle);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2066,7 +2059,7 @@ refuseconnections(port)
CurrentLA = getla();
if (CurrentLA >= refusela)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: load average: %d",
+ setproctitle("rejecting connections on port %d: load average: %d",
port, CurrentLA);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2077,7 +2070,7 @@ refuseconnections(port)
if (!enoughdiskspace(MinBlocksFree + 1))
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: min free: %d",
+ setproctitle("rejecting connections on port %d: min free: %d",
port, MinBlocksFree);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2088,10 +2081,12 @@ refuseconnections(port)
if (MaxChildren > 0 && CurChildren >= MaxChildren)
{
+ extern void proc_list_probe __P((void));
+
proc_list_probe();
if (CurChildren >= MaxChildren)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: %d children, max %d",
+ setproctitle("rejecting connections on port %d: %d children, max %d",
port, CurChildren, MaxChildren);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2175,12 +2170,12 @@ typedef unsigned int *pt_entry_t;
# define SPT_PADCHAR ' '
# endif
-#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
-
# ifndef SPT_BUFSIZE
# define SPT_BUFSIZE MAXLINE
# endif
+#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
+
/*
** Pointers for setproctitle.
** This allows "ps" listings to give more useful information.
@@ -2325,44 +2320,6 @@ setproctitle(fmt, va_alist)
#endif /* SPT_TYPE != SPT_BUILTIN */
/*
-** SM_SETPROCTITLE -- set process task and set process title for ps
-**
-** Possibly set process status and call setproctitle() to
-** change the ps display.
-**
-** Parameters:
-** status -- whether or not to store as process status
-** fmt -- a printf style format string.
-** a, b, c -- possible parameters to fmt.
-**
-** Returns:
-** none.
-*/
-
-/*VARARGS2*/
-void
-# ifdef __STDC__
-sm_setproctitle(bool status, const char *fmt, ...)
-# else
-sm_setproctitle(status, fmt, va_alist)
- bool status;
- const char *fmt;
- va_dcl
-#endif
-{
- char buf[SPT_BUFSIZE];
-
- VA_LOCAL_DECL
- /* print the argument string */
- VA_START(fmt);
- (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap);
- VA_END;
-
- if (status)
- proc_list_set(getpid(), buf);
- setproctitle("%s", buf);
-}
- /*
** WAITFOR -- wait for a particular process id.
**
** Parameters:
@@ -2832,8 +2789,8 @@ dgux_inet_addr(host)
/*
-** this version hacked to add `atend' flag to allow state machine
-** to reset if invoked by the program to scan args for a 2nd time
+** this version hacked to add `atend' flag to allow state machine
+** to reset if invoked by the program to scan args for a 2nd time
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -3005,7 +2962,7 @@ char *DefaultUserShells[] =
"/bin/bsh", /* Bourne shell */
"/usr/bin/bsh",
#endif
-#if defined(__svr4__) || defined(__svr5__)
+#ifdef __svr4__
"/bin/ksh", /* Korn shell */
"/usr/bin/ksh",
#endif
@@ -3708,63 +3665,9 @@ setvendor(vendor)
}
#endif
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- if (strcasecmp(vendor, VENDOR_NAME) == 0)
- {
- VendorCode = VENDOR_CODE;
- return TRUE;
- }
-#endif
-
return FALSE;
}
/*
-** GETVENDOR -- return vendor name based on vendor code
-**
-** Parameters:
-** vendorcode -- numeric representation of vendor.
-**
-** Returns:
-** string containing vendor name.
-*/
-
-char *
-getvendor(vendorcode)
- int vendorcode;
-{
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- /*
- ** Can't have the same switch case twice so need to
- ** handle VENDOR_CODE outside of switch. It might
- ** match one of the existing VENDOR_* codes.
- */
-
- if (vendorcode == VENDOR_CODE)
- return VENDOR_NAME;
-#endif
-
- switch (vendorcode)
- {
- case VENDOR_BERKELEY:
- return "Berkeley";
-
- case VENDOR_SUN:
- return "Sun";
-
- case VENDOR_HP:
- return "HP";
-
- case VENDOR_IBM:
- return "IBM";
-
- case VENDOR_SENDMAIL:
- return "Sendmail";
-
- default:
- return "Unknown";
- }
-}
- /*
** VENDOR_PRE_DEFAULTS, VENDOR_POST_DEFAULTS -- set vendor-specific defaults
**
** Vendor_pre_defaults is called before reading the configuration
@@ -3827,7 +3730,7 @@ vendor_daemon_setup(e)
if (getluid() != -1)
{
usrerr("Daemon cannot have LUID");
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
#endif /* SECUREWARE */
}
@@ -4270,88 +4173,11 @@ secureware_setup_secure(uid)
rc, uid);
break;
}
- finis(FALSE, EX_NOPERM);
+ exit(EX_NOPERM);
}
}
#endif /* SECUREWARE */
/*
-** ADD_LOCAL_HOST_NAMES -- Add a hostname to class 'w' based on IP address
-**
-** Add hostnames to class 'w' based on the IP address read from
-** the network interface.
-**
-** Parameters:
-** sa -- a pointer to a SOCKADDR containing the address
-**
-** Returns:
-** 0 if successful, -1 if host lookup fails.
-*/
-
-int
-add_hostnames(sa)
- SOCKADDR *sa;
-{
- struct hostent *hp;
-
- /* lookup name with IP address */
- switch (sa->sa.sa_family)
- {
- case AF_INET:
- hp = sm_gethostbyaddr((char *) &sa->sin.sin_addr,
- sizeof(sa->sin.sin_addr), sa->sa.sa_family);
- break;
-
- default:
-#if _FFR_LOG_UNSUPPORTED_FAMILIES
- /* XXX: Give warning about unsupported family */
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "Unsupported address family %d: %.100s",
- sa->sa.sa_family, anynet_ntoa(sa));
-#endif
- return -1;
- }
-
- if (hp == NULL)
- {
- int save_errno = errno;
-
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "gethostbyaddr(%.100s) failed: %d\n",
- anynet_ntoa(sa),
-#if NAMED_BIND
- h_errno
-#else
- -1
-#endif
- );
- errno = save_errno;
- return -1;
- }
-
- /* save its cname */
- if (!wordinclass((char *) hp->h_name, 'w'))
- {
- setclass('w', (char *) hp->h_name);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", hp->h_name);
- }
-
- /* save all it aliases name */
- while (*hp->h_aliases)
- {
- if (!wordinclass(*hp->h_aliases, 'w'))
- {
- setclass('w', *hp->h_aliases);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", *hp->h_aliases);
- }
- hp->h_aliases++;
- }
- return 0;
-}
- /*
** LOAD_IF_NAMES -- load interface-specific names into $=w
**
** Parameters:
@@ -4428,8 +4254,9 @@ load_if_names()
for (i = 0; i < ifc.ifc_len; )
{
struct ifreq *ifr = (struct ifreq *) &ifc.ifc_buf[i];
- SOCKADDR *sa = (SOCKADDR *) &ifr->ifr_addr;
+ struct sockaddr *sa = &ifr->ifr_addr;
struct in_addr ia;
+ struct hostent *hp;
#ifdef SIOCGIFFLAGS
struct ifreq ifrf;
#endif
@@ -4437,14 +4264,14 @@ load_if_names()
extern char *inet_ntoa();
#ifdef BSD4_4_SOCKADDR
- if (sa->sa.sa_len > sizeof ifr->ifr_addr)
- i += sizeof ifr->ifr_name + sa->sa.sa_len;
+ if (sa->sa_len > sizeof ifr->ifr_addr)
+ i += sizeof ifr->ifr_name + sa->sa_len;
else
#endif
i += sizeof *ifr;
if (tTd(0, 20))
- printf("%s\n", anynet_ntoa(sa));
+ printf("%s\n", anynet_ntoa((SOCKADDR *) sa));
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
@@ -4463,7 +4290,7 @@ load_if_names()
continue;
/* extract IP address from the list*/
- ia = sa->sin.sin_addr;
+ ia = (((struct sockaddr_in *) sa)->sin_addr);
if (ia.s_addr == INADDR_ANY || ia.s_addr == INADDR_NONE)
{
message("WARNING: interface %s is UP with %s address",
@@ -4473,7 +4300,7 @@ load_if_names()
/* save IP address in text from */
(void) snprintf(ip_addr, sizeof ip_addr, "[%.*s]",
- (int)sizeof ip_addr - 3,
+ sizeof ip_addr - 3,
inet_ntoa(ia));
if (!wordinclass(ip_addr, 'w'))
{
@@ -4486,7 +4313,41 @@ load_if_names()
if (bitset(IFF_LOOPBACK, IFRFREF.ifr_flags))
continue;
- (void) add_hostnames(sa);
+ /* lookup name with IP address */
+ hp = sm_gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);
+ if (hp == NULL)
+ {
+ if (LogLevel > 3)
+ sm_syslog(LOG_WARNING, NOQID,
+ "gethostbyaddr(%.100s) failed: %d\n",
+ inet_ntoa(ia),
+#if NAMED_BIND
+ h_errno);
+#else
+ -1);
+#endif
+ continue;
+ }
+
+ /* save its cname */
+ if (!wordinclass((char *) hp->h_name, 'w'))
+ {
+ setclass('w', (char *) hp->h_name);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", hp->h_name);
+ }
+
+ /* save all it aliases name */
+ while (*hp->h_aliases)
+ {
+ if (!wordinclass(*hp->h_aliases, 'w'))
+ {
+ setclass('w', *hp->h_aliases);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", *hp->h_aliases);
+ }
+ hp->h_aliases++;
+ }
}
free(ifc.ifc_buf);
close(s);
@@ -4551,7 +4412,7 @@ sm_syslog(level, id, fmt, va_alist)
extern int SyslogErrno;
extern char *DoprEnd;
VA_LOCAL_DECL
- extern void sm_dopr __P((char *, const char *, va_list));
+ extern void sm_dopr __P((char *, const char *, ...));
SyslogErrno = errno;
if (id == NULL)
diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h
index b9cdc6862caa..a8ad46e2706f 100644
--- a/contrib/sendmail/src/conf.h
+++ b/contrib/sendmail/src/conf.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)conf.h 8.380 (Berkeley) 11/9/1998
+ * @(#)conf.h 8.372 (Berkeley) 6/4/98
*/
/*
@@ -64,11 +64,6 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# define MACBUFSIZE 4096 /* max expanded macro buffer size */
# define TOBUFSIZE 512 /* max buffer to hold address list */
# define MAXSHORTSTR 203 /* max short string length */
-# if _FFR_MAX_MIME_HEADER_LENGTH
-# define MAXMACNAMELEN 25 /* max macro name length */
-# else
-# define MAXMACNAMELEN 20 /* max macro name length */
-# endif
/**********************************************************************
** Compilation options.
@@ -349,12 +344,12 @@ typedef int pid_t;
# define GIDSET_T gid_t
# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# define SFS_BAVAIL f_bfree /* alternate field name */
-# define SYSLOG_BUFSIZE 512
# ifdef IRIX6
# define STAT64 1
# define QUAD_T unsigned long long
# define LA_TYPE LA_IRIX6 /* figure out at run time */
# define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */
+# define SYSLOG_BUFSIZE 512
# else
# define LA_TYPE LA_INT
@@ -679,41 +674,6 @@ typedef int pid_t;
#endif
-/*
-** Apple Rhapsody
-** Contributed by Wilfredo Sanchez <wsanchez@apple.com>
-*/
-
-#ifdef __APPLE__
-# define HASFCHMOD 1 /* has fchmod(2) syscall */
-# define HASFLOCK 1 /* has flock(2) syscall */
-# define HASUNAME 1 /* has uname(2) syscall */
-# define HASUNSETENV 1
-# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
-# define HASINITGROUPS 1
-# define HASSETVBUF 1
-# define HASSETREUID 1
-# define USESETEUID 1 /* has useable seteuid(2) call */
-# define HASLSTAT 1
-# define HASSETRLIMIT 1
-# define HASWAITPID 1
-# define HASSTRERROR 1 /* has strerror(3) */
-# define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */
-# define USESTRERROR 1 /* has strerror(3) */
-# define HASGETDTABLESIZE 1
-# define HASGETUSERSHELL 1
-# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
-# define BSD4_4_SOCKADDR /* has sa_len */
-# define NETLINK 1 /* supports AF_LINK */
-# define HAS_ST_GEN 1 /* has st_gen field in stat struct */
-# define GIDSET_T gid_t
-# define LA_TYPE LA_SUBR /* use getloadavg(3) */
-# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
-# define SPT_TYPE SPT_PSSTRINGS
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
-#endif
-
/*
** 4.4 BSD
@@ -861,7 +821,7 @@ typedef int pid_t;
# define SPT_TYPE SPT_BUILTIN
# endif
# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
-# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
+# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
# endif
# endif
# ifndef SPT_TYPE
@@ -1259,9 +1219,9 @@ extern void *malloc();
** Florian La Roche <rzsfl@rz.uni-sb.de>
** Karl London <karl@borg.demon.co.uk>
**
-** Last compiled against: [07/21/98 @ 11:47:34 AM (Tuesday)]
-** sendmail 8.9.1 bind-8.1.2 db-2.4.14
-** gcc-2.8.1 glibc-2.0.94 linux-2.1.109
+** Last compiled against: [06/10/96 @ 09:21:40 PM (Monday)]
+** sendmail 8.8-a4 named bind-4.9.4-T4B db-1.85
+** gcc 2.7.2 libc-5.3.12 linux 2.0.0
**
** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
** file locking is no longer allowed. In particular, make sure
@@ -1271,7 +1231,6 @@ extern void *malloc();
#ifdef __linux__
# define BSD 1 /* include BSD defines */
-# define USESETEUID 0 /* Have it due to POSIX, but doesn't work */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
@@ -1299,7 +1258,7 @@ extern void *malloc();
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
-# define TZ_TYPE TZ_TZNAME
+# define TZ_TYPE TZ_TNAME
# include <sys/sysmacros.h>
# undef atol /* wounded in <stdlib.h> */
#endif
@@ -1528,37 +1487,6 @@ typedef int pid_t;
# endif
#endif
-/*
-** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatiblity Libs ie. native)
-**
-** Contributed by Paul Gampe <paulg@apnic.net>
-*/
-
-#ifdef __svr5__
-# include <sys/mkdev.h>
-# define __svr4__
-# define SYS5SIGNALS 1
-# define HASSETSID 1
-# define HASSETREUID 1
-# define HASWAITPID 1
-# define HASGETDTABLESIZE 1
-# define GIDSET_T gid_t
-# define SOCKADDR_LEN_T size_t
-# define SOCKOPT_LEN_T size_t
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/stand/unix"
-# endif
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define SYSLOG_BUFSIZE 1024 /* unsure */
-# ifndef _PATH_VENDOR_CF
-# define _PATH_VENDOR_CF "/etc/sendmail.cf"
-# endif
-# ifndef _PATH_SENDMAILPID
-# define _PATH_SENDMAILPID "/etc/sendmail.pid"
-# endif
-#endif
-
-/* ###################################################################### */
/*
** UnixWare 2.x
@@ -1591,9 +1519,7 @@ typedef int pid_t;
# define LA_TYPE LA_ZERO
# undef WIFEXITED
# undef WEXITSTATUS
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/unix"
-# endif
+# define _PATH_UNIX "/unix"
# ifndef _PATH_VENDOR_CF
# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
# endif
diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c
deleted file mode 100644
index 157ca08548ec..000000000000
--- a/contrib/sendmail/src/control.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1998 Sendmail, Inc. 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.
- *
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)control.c 8.17 (Berkeley) 12/1/1998";
-#endif /* not lint */
-
-#include "sendmail.h"
-
-int ControlSocket = -1;
-
- /*
-** OPENCONTROLSOCKET -- create/open the daemon control named socket
-**
-** Creates and opens a named socket for external control over
-** the sendmail daemon.
-**
-** Parameters:
-** none.
-**
-** Returns:
-** 0 if successful, -1 otherwise
-*/
-
-int
-opencontrolsocket()
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- int rval;
- int sff = SFF_SAFEDIRPATH|SFF_OPENASROOT|SFF_NOLINK|SFF_CREAT|SFF_MUSTOWN;
- struct sockaddr_un controladdr;
-
- if (ControlSocketName == NULL)
- return 0;
-
- if (strlen(ControlSocketName) >= sizeof controladdr.sun_path)
- {
- errno = ENAMETOOLONG;
- return -1;
- }
-
- rval = safefile(ControlSocketName, RunAsUid, RunAsGid, RunAsUserName,
- sff, S_IRUSR|S_IWUSR, NULL);
-
- /* if not safe, don't create */
- if (rval != 0)
- {
- errno = rval;
- return -1;
- }
-
- ControlSocket = socket(AF_UNIX, SOCK_STREAM, 0);
- if (ControlSocket < 0)
- return -1;
-
- unlink(ControlSocketName);
- bzero(&controladdr, sizeof controladdr);
- controladdr.sun_family = AF_UNIX;
- strcpy(controladdr.sun_path, ControlSocketName);
-
- if (bind(ControlSocket, (struct sockaddr *) &controladdr,
- sizeof controladdr) < 0)
- {
- int save_errno = errno;
-
- (void) close(ControlSocket);
- ControlSocket = -1;
- errno = save_errno;
- return -1;
- }
-
-# if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
- {
- if (chown(ControlSocketName, TrustedUid, -1) < 0)
- {
- int save_errno = errno;
-
- sm_syslog(LOG_ALERT, NOQID,
- "ownership change on %s failed: %s",
- ControlSocketName, errstring(save_errno));
- message("050 ownership change on %s failed: %s",
- ControlSocketName, errstring(save_errno));
- errno = save_errno;
- return -1;
- }
- }
-# endif
-
- if (chmod(ControlSocketName, S_IRUSR|S_IWUSR) < 0)
- {
- int save_errno = errno;
-
- closecontrolsocket(TRUE);
- errno = save_errno;
- return -1;
- }
-
- if (listen(ControlSocket, 8) < 0)
- {
- int save_errno = errno;
-
- closecontrolsocket(TRUE);
- errno = save_errno;
- return -1;
- }
-# endif
-#endif
- return 0;
-}
- /*
-** CLOSECONTROLSOCKET -- close the daemon control named socket
-**
-** Close a named socket.
-**
-** Parameters:
-** fullclose -- if set, close the socket and remove it;
-** otherwise, just remove it
-**
-** Returns:
-** none.
-*/
-
-void
-closecontrolsocket(fullclose)
- bool fullclose;
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- int sff = SFF_SAFEDIRPATH|SFF_OPENASROOT|SFF_NOLINK|SFF_CREAT|SFF_MUSTOWN;
-
- if (ControlSocket >= 0)
- {
- int rval;
-
- if (fullclose)
- {
- (void) close(ControlSocket);
- ControlSocket = -1;
- }
-
- rval = safefile(ControlSocketName, RunAsUid, RunAsGid, RunAsUserName,
- sff, S_IRUSR|S_IWUSR, NULL);
-
- /* if not safe, don't unlink */
- if (rval != 0)
- return;
-
- if (unlink(ControlSocketName) < 0)
- {
- sm_syslog(LOG_WARNING, NOQID,
- "Could not remove control socket: %s",
- errstring(errno));
- return;
- }
- }
-# endif
-#endif
- return;
-}
- /*
-** CLRCONTROL -- reset the control connection
-**
-** Parameters:
-** none.
-**
-** Returns:
-** none.
-**
-** Side Effects:
-** releases any resources used by the control interface.
-*/
-
-void
-clrcontrol()
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- if (ControlSocket >= 0)
- (void) close(ControlSocket);
- ControlSocket = -1;
-# endif
-#endif
-}
-
-#ifndef NOT_SENDMAIL
-
- /*
-** CONTROL_COMMAND -- read and process command from named socket
-**
-** Read and process the command from the opened socket.
-** Return the results down the same socket.
-**
-** Parameters:
-** sock -- the opened socket from getrequests()
-** e -- the current envelope
-**
-** Returns:
-** none.
-*/
-
-struct cmd
-{
- char *cmdname; /* command name */
- int cmdcode; /* internal code, see below */
-};
-
-/* values for cmdcode */
-# define CMDERROR 0 /* bad command */
-# define CMDRESTART 1 /* restart daemon */
-# define CMDSHUTDOWN 2 /* end daemon */
-# define CMDHELP 3 /* help */
-# define CMDSTATUS 4 /* daemon status */
-
-static struct cmd CmdTab[] =
-{
- { "help", CMDHELP },
- { "restart", CMDRESTART },
- { "shutdown", CMDSHUTDOWN },
- { "status", CMDSTATUS },
- { NULL, CMDERROR }
-};
-
-void
-control_command(sock, e)
- int sock;
- ENVELOPE *e;
-{
- FILE *s;
- FILE *traffic;
- FILE *oldout;
- char *cmd;
- char *p;
- struct cmd *c;
- char cmdbuf[MAXLINE];
- char inp[MAXLINE];
- extern char **SaveArgv;
- extern void help __P((char *));
-
- sm_setproctitle(FALSE, "control cmd read");
-
- s = fdopen(sock, "r+");
- if (s == NULL)
- {
- int save_errno = errno;
-
- close(sock);
- errno = save_errno;
- return;
- }
- setbuf(s, NULL);
-
- if (fgets(inp, sizeof inp, s) == NULL)
- {
- fclose(s);
- return;
- }
- (void) fflush(s);
-
- /* clean up end of line */
- fixcrlf(inp, TRUE);
-
- sm_setproctitle(FALSE, "control: %s", inp);
-
- /* break off command */
- for (p = inp; isascii(*p) && isspace(*p); p++)
- continue;
- cmd = cmdbuf;
- while (*p != '\0' &&
- !(isascii(*p) && isspace(*p)) &&
- cmd < &cmdbuf[sizeof cmdbuf - 2])
- *cmd++ = *p++;
- *cmd = '\0';
-
- /* throw away leading whitespace */
- while (isascii(*p) && isspace(*p))
- p++;
-
- /* decode command */
- for (c = CmdTab; c->cmdname != NULL; c++)
- {
- if (!strcasecmp(c->cmdname, cmdbuf))
- break;
- }
-
- switch (c->cmdcode)
- {
- case CMDHELP: /* get help */
- traffic = TrafficLogFile;
- TrafficLogFile = NULL;
- oldout = OutChannel;
- OutChannel = s;
- help("control");
- TrafficLogFile = traffic;
- OutChannel = oldout;
- break;
-
- case CMDRESTART: /* restart the daemon */
- if (SaveArgv[0][0] != '/')
- {
- fprintf(s, "ERROR: could not restart: need full path\r\n");
- break;
- }
- if (LogLevel > 3)
- sm_syslog(LOG_INFO, NOQID,
- "restarting %s on due to control command",
- SaveArgv[0]);
- closecontrolsocket(FALSE);
- if (drop_privileges(TRUE) != EX_OK)
- {
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID,
- "could not set[ug]id(%d, %d): %m",
- RunAsUid, RunAsGid);
-
- fprintf(s, "ERROR: could not set[ug]id(%d, %d): %s, exiting...\r\n",
- (int)RunAsUid, (int)RunAsGid, errstring(errno));
- finis(FALSE, EX_OSERR);
- }
- fprintf(s, "OK\r\n");
- clrcontrol();
- (void) fcntl(sock, F_SETFD, 1);
- execve(SaveArgv[0], (ARGV_T) SaveArgv, (ARGV_T) ExternalEnviron);
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID, "could not exec %s: %m",
- SaveArgv[0]);
- fprintf(s, "ERROR: could not exec %s: %s, exiting...\r\n",
- SaveArgv[0], errstring(errno));
- finis(FALSE, EX_OSFILE);
- break;
-
- case CMDSHUTDOWN: /* kill the daemon */
- fprintf(s, "OK\r\n");
- finis(FALSE, EX_OK);
- break;
-
- case CMDSTATUS: /* daemon status */
- proc_list_probe();
- fprintf(s, "%d/%d\r\n", CurChildren, MaxChildren);
- proc_list_display(s);
- break;
-
- case CMDERROR: /* unknown command */
- fprintf(s, "Bad command (%s)\r\n", cmdbuf);
- break;
- }
- fclose(s);
-}
-#endif
diff --git a/contrib/sendmail/src/convtime.c b/contrib/sendmail/src/convtime.c
index ab8591d970ee..02c287b13722 100644
--- a/contrib/sendmail/src/convtime.c
+++ b/contrib/sendmail/src/convtime.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)convtime.c 8.14 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)convtime.c 8.14 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index b74a7a72efe8..dc0b5b5bd2d5 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -15,9 +15,9 @@
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (with daemon mode)";
#else
-static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (without daemon mode)";
#endif
#endif /* not lint */
@@ -103,22 +103,15 @@ getrequests(e)
ENVELOPE *e;
{
int t;
- time_t refuse_connections_until = 0;
- bool firsttime = TRUE;
+ bool refusingconnections = TRUE;
FILE *pidf;
- int sff;
int socksize;
u_short port;
#if XDEBUG
bool j_has_dot;
#endif
- char status[MAXLINE];
extern void reapchild __P((int));
-#ifdef NETUNIX
- extern int ControlSocket;
-#endif
extern int opendaemonsocket __P((bool));
- extern int opencontrolsocket __P((void));
/*
** Set up the address for the mailer.
@@ -176,18 +169,11 @@ getrequests(e)
/* get a socket for the SMTP connection */
socksize = opendaemonsocket(TRUE);
- if (opencontrolsocket() < 0)
- sm_syslog(LOG_WARNING, NOQID,
- "daemon could not open control socket: %s",
- errstring(errno));
-
(void) setsignal(SIGCHLD, reapchild);
/* write the pid to the log file for posterity */
- sff = SFF_NOLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT;
- if (TrustedUid != 0 && RealUid == TrustedUid)
- sff |= SFF_OPENASROOT;
- pidf = safefopen(PidFile, O_WRONLY|O_TRUNC, 0644, sff);
+ pidf = safefopen(PidFile, O_WRONLY|O_TRUNC, 0644,
+ SFF_NOLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT);
if (pidf == NULL)
{
sm_syslog(LOG_ERR, NOQID, "unable to write %s", PidFile);
@@ -215,9 +201,6 @@ getrequests(e)
}
#endif
- /* Add parent process as first item */
- proc_list_add(getpid(), "Sendmail daemon");
-
if (tTd(15, 1))
printf("getrequests: %d\n", DaemonSocket);
@@ -225,34 +208,30 @@ getrequests(e)
{
register pid_t pid;
auto SOCKADDR_LEN_T lotherend;
- bool timedout = FALSE;
- bool control = FALSE;
int savederrno;
int pipefd[2];
extern bool refuseconnections __P((int));
/* see if we are rejecting connections */
(void) blocksignal(SIGALRM);
- if (curtime() >= refuse_connections_until)
+ if (refuseconnections(ntohs(port)))
{
- if (refuseconnections(ntohs(port)))
- {
- if (DaemonSocket >= 0)
- {
- /* close socket so peer fails quickly */
- (void) close(DaemonSocket);
- DaemonSocket = -1;
- }
-
- /* refuse connections for next 15 seconds */
- refuse_connections_until = curtime() + 15;
- }
- else if (DaemonSocket < 0 || firsttime)
+ if (DaemonSocket >= 0)
{
- /* arrange to (re)open the socket if needed */
- (void) opendaemonsocket(FALSE);
- firsttime = FALSE;
+ /* close socket so peer will fail quickly */
+ (void) close(DaemonSocket);
+ DaemonSocket = -1;
}
+ refusingconnections = TRUE;
+ sleep(15);
+ continue;
+ }
+
+ /* arrange to (re)open the socket if necessary */
+ if (refusingconnections)
+ {
+ (void) opendaemonsocket(FALSE);
+ refusingconnections = FALSE;
}
#if XDEBUG
@@ -279,6 +258,9 @@ getrequests(e)
}
#endif
+ /* wait for a connection */
+ setproctitle("accepting connections on port %d",
+ ntohs(port));
#if 0
/*
** Andrew Sun <asun@ieps-sun.ml.com> claims that this will
@@ -286,97 +268,34 @@ getrequests(e)
** so is it worth doing this?
*/
- if (DaemonSocket >= 0 &&
- SetNonBlocking(DaemonSocket, FALSE) < 0)
+ if (SetNonBlocking(DaemonSocket, FALSE) < 0)
log an error here;
#endif
(void) releasesignal(SIGALRM);
for (;;)
{
- int highest = -1;
fd_set readfds;
struct timeval timeout;
FD_ZERO(&readfds);
-
- /* wait for a connection */
- if (DaemonSocket >= 0)
- {
- sm_setproctitle(TRUE,
- "accepting connections on port %d",
- ntohs(port));
- if (DaemonSocket > highest)
- highest = DaemonSocket;
- FD_SET(DaemonSocket, &readfds);
- }
-#ifdef NETUNIX
- if (ControlSocket >= 0)
- {
- if (ControlSocket > highest)
- highest = ControlSocket;
- FD_SET(ControlSocket, &readfds);
- }
-#endif
- if (DaemonSocket >= 0)
- timeout.tv_sec = 60;
- else
- timeout.tv_sec = 5;
+ FD_SET(DaemonSocket, &readfds);
+ timeout.tv_sec = 60;
timeout.tv_usec = 0;
- t = select(highest + 1, FDSET_CAST &readfds,
- NULL, NULL, &timeout);
-
+ t = select(DaemonSocket + 1, FDSET_CAST &readfds,
+ NULL, NULL, &timeout);
if (DoQueueRun)
(void) runqueue(TRUE, FALSE);
- if (t <= 0)
- {
- timedout = TRUE;
- break;
- }
+ if (t <= 0 || !FD_ISSET(DaemonSocket, &readfds))
+ continue;
- control = FALSE;
errno = 0;
- if (DaemonSocket >= 0 &&
- FD_ISSET(DaemonSocket, &readfds))
- {
- lotherend = socksize;
- t = accept(DaemonSocket,
- (struct sockaddr *)&RealHostAddr,
- &lotherend);
- }
-#ifdef NETUNIX
- else if (ControlSocket >= 0 &&
- FD_ISSET(ControlSocket, &readfds))
- {
- struct sockaddr_un sa_un;
-
- lotherend = sizeof sa_un;
- t = accept(ControlSocket,
- (struct sockaddr *)&sa_un,
- &lotherend);
- control = TRUE;
- }
-#endif
+ lotherend = socksize;
+ t = accept(DaemonSocket,
+ (struct sockaddr *)&RealHostAddr, &lotherend);
if (t >= 0 || errno != EINTR)
break;
}
- if (timedout)
- {
- timedout = FALSE;
- continue;
- }
- if (control)
- {
- if (t >= 0)
- {
- extern void control_command __P((int, ENVELOPE *));
-
- control_command(t, e);
- }
- else
- syserr("getrequests: control accept");
- continue;
- }
savederrno = errno;
(void) blocksignal(SIGALRM);
if (t < 0)
@@ -387,6 +306,8 @@ getrequests(e)
/* arrange to re-open the socket next time around */
(void) close(DaemonSocket);
DaemonSocket = -1;
+ refusingconnections = TRUE;
+ sleep(5);
continue;
}
@@ -439,16 +360,12 @@ getrequests(e)
(void) setsignal(SIGCHLD, SIG_DFL);
(void) setsignal(SIGHUP, intsig);
(void) close(DaemonSocket);
- clrcontrol();
proc_list_clear();
- /* Add parent process as first child item */
- proc_list_add(getpid(), "daemon child");
-
/* don't schedule queue runs if we are told to ETRN */
QueueIntvl = 0;
- sm_setproctitle(TRUE, "startup with %s",
+ setproctitle("startup with %s",
anynet_ntoa(&RealHostAddr));
if (pipefd[0] != -1)
@@ -478,34 +395,36 @@ getrequests(e)
if (strlen(p) > (SIZE_T) MAXNAME)
p[MAXNAME] = '\0';
RealHostName = newstr(p);
- sm_setproctitle(TRUE, "startup with %s", p);
+ setproctitle("startup with %s", p);
if ((inchannel = fdopen(t, "r")) == NULL ||
(t = dup(t)) < 0 ||
(outchannel = fdopen(t, "w")) == NULL)
{
syserr("cannot open SMTP server channel, fd=%d", t);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
}
InChannel = inchannel;
OutChannel = outchannel;
DisConnected = FALSE;
+ /* open maps for check_relay ruleset */
+ initmaps(FALSE, e);
+
#ifdef XLA
if (!xla_host_ok(RealHostName))
{
message("421 Too many SMTP sessions for this host");
- finis(FALSE, EX_OK);
+ exit(EX_OK);
}
#endif
+
break;
}
/* parent -- keep track of children */
- snprintf(status, MAXLINE, "SMTP server child for %s",
- anynet_ntoa(&RealHostAddr));
- proc_list_add(pid, status);
+ proc_list_add(pid);
(void) releasesignal(SIGCHLD);
/* close the read end of the synchronization pipe */
@@ -633,7 +552,7 @@ opendaemonsocket(firsttime)
return socksize;
} while (ntries++ < MAXOPENTRIES && transienterror(saveerrno));
syserr("!opendaemonsocket: server SMTP socket wedged: exiting");
- /*NOTREACHED*/
+ finis();
return -1; /* avoid compiler warning on IRIX */
}
/*
@@ -1361,7 +1280,7 @@ getauthinfo(fd, may_be_forged)
/* translate that to a host name */
RealHostName = newstr(hostnamebyanyaddr(&RealHostAddr));
if (strlen(RealHostName) > MAXNAME)
- RealHostName[MAXNAME] = '\0';
+ RealHostName[MAXNAME - 1] = '\0';
}
/* cross check RealHostName with forward DNS lookup */
@@ -1369,8 +1288,8 @@ getauthinfo(fd, may_be_forged)
RealHostName[0] == '[')
{
/*
- ** address is not a socket or have an
- ** IP address with no forward lookup
+ ** address is not a socket or have an
+ ** IP address with no forward lookup
*/
*may_be_forged = FALSE;
}
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index e70f17e675aa..0e5eb0729905 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)deliver.c 8.366 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)deliver.c 8.353 (Berkeley) 6/30/98";
#endif /* not lint */
#include "sendmail.h"
@@ -360,7 +360,7 @@ sendall(e, mode)
if (mode != SM_VERIFY && bitset(EF_HAS_DF, e->e_flags))
dup_queue_file(e, ee, 'd');
openxscript(ee);
- if (mode != SM_VERIFY && LogLevel > 4)
+ if (LogLevel > 4)
sm_syslog(LOG_INFO, ee->e_id,
"clone %s, owner=%s",
e->e_id, owner);
@@ -552,7 +552,7 @@ sendall(e, mode)
# else
e->e_id = NULL;
# endif /* HASFLOCK */
- finis(TRUE, ExitStat);
+ finis();
}
/* be sure to give error messages in child */
@@ -570,15 +570,6 @@ sendall(e, mode)
mci_flush(FALSE, NULL);
- /*
- ** Since the delivery may happen in a child and the parent
- ** does not wait, the parent may close the maps thereby
- ** removing any shared memory used by the map. Therefore,
- ** open a copy of the maps for the delivery process.
- */
-
- initmaps(FALSE, e);
-
# if HASFLOCK
break;
# else
@@ -595,7 +586,7 @@ sendall(e, mode)
ee->e_sibling = sibling;
}
(void) dowork(e->e_id, FALSE, FALSE, e);
- finis(TRUE, ExitStat);
+ finis();
# endif /* !HASFLOCK */
}
@@ -613,7 +604,7 @@ sendall(e, mode)
Verbose = oldverbose;
if (mode == SM_FORK)
- finis(TRUE, ExitStat);
+ finis();
}
void
@@ -1100,9 +1091,8 @@ deliver(e, firstto)
e->e_from.q_paddr, to->q_paddr, e);
if (rcode == EX_OK)
{
- /* do in-code checking if not discarding */
- if (!bitset(EF_DISCARD, e->e_flags))
- rcode = checkcompat(to, e);
+ /* do in-code checking */
+ rcode = checkcompat(to, e);
}
if (rcode != EX_OK)
{
@@ -1110,22 +1100,6 @@ deliver(e, firstto)
giveresponse(rcode, m, NULL, ctladdr, xstart, e);
continue;
}
- if (bitset(EF_DISCARD, e->e_flags))
- {
- if (tTd(10, 5))
- {
- printf("deliver: discarding recipient ");
- printaddr(to, FALSE);
- }
-
- /*
- ** Remove discard bit to prevent discard of
- ** future recipients
- */
- e->e_flags &= ~EF_DISCARD;
-
- continue;
- }
/*
** Strip quote bits from names if the mailer is dumb
@@ -1435,7 +1409,7 @@ tryhost:
}
/* try the connection */
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, hostbuf, "user open");
+ setproctitle("%s %s: %s", e->e_id, hostbuf, "user open");
if (port == 0)
message("Connecting to %s via %s...",
hostbuf, m->m_name);
@@ -2122,7 +2096,7 @@ do_transfer:
rcode = smtpgetstat(m, mci, e);
if (rcode == EX_OK)
{
- if (strlen(to->q_paddr) + strlen(tobuf) + 2 > sizeof tobuf)
+ if (strlen(to->q_paddr) + strlen(tobuf) + 2 >= sizeof tobuf)
{
syserr("LMTP tobuf overflow");
}
@@ -2853,7 +2827,7 @@ putfromline(mci, e)
char hname[MAXNAME];
/*
- ** If we can construct a UUCP path, do so
+ ** If we can construct a UUCP path, do so
*/
at = strrchr(buf, '@');
@@ -2908,7 +2882,6 @@ putbody(mci, e, separator)
char *separator;
{
char buf[MAXLINE];
- char *boundaries[MAXMIMENESTING + 1];
/*
** Output the body of the message
@@ -2950,6 +2923,8 @@ putbody(mci, e, separator)
#if MIME8TO7
if (bitset(MCIF_CVT8TO7, mci->mci_flags))
{
+ char *boundaries[MAXMIMENESTING + 1];
+
/*
** Do 8 to 7 bit MIME conversion.
*/
@@ -2977,13 +2952,6 @@ putbody(mci, e, separator)
mime7to8(mci, e->e_header, e);
}
# endif
- else if (MaxMimeHeaderLength > 0 || MaxMimeFieldLength > 0)
- {
- /* Use mime8to7 to check multipart for MIME header overflows */
- boundaries[0] = NULL;
- mci->mci_flags |= MCIF_INHEADER;
- mime8to7(mci, e->e_header, e, boundaries, M87F_OUTER|M87F_NO8TO7);
- }
else
#endif
{
@@ -2998,6 +2966,7 @@ putbody(mci, e, separator)
size_t eol_len;
char peekbuf[10];
+ /* we can pass it through unmodified */
if (bitset(MCIF_INHEADER, mci->mci_flags))
{
putline("", mci);
@@ -3323,7 +3292,6 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
/* child -- actually write to file */
struct stat stb;
MCI mcibuf;
- int err;
volatile int oflags = O_WRONLY|O_APPEND;
if (e->e_lockfp != NULL)
@@ -3347,11 +3315,7 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
ev = NULL;
#ifdef HASLSTAT
- if (bitset(DBS_FILEDELIVERYTOSYMLINK, DontBlameSendmail))
- err = stat(filename, &stb);
- else
- err = lstat(filename, &stb);
- if (err < 0)
+ if (lstat(filename, &stb) < 0)
#else
if (stat(filename, &stb) < 0)
#endif
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c
index a279c0e69a96..e3a5500b5516 100644
--- a/contrib/sendmail/src/domain.c
+++ b/contrib/sendmail/src/domain.c
@@ -14,9 +14,9 @@
#ifndef lint
#if NAMED_BIND
-static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (with name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (with name server)";
#else
-static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (without name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (without name server)";
#endif
#endif /* not lint */
@@ -451,7 +451,7 @@ bestmx_map_lookup(map, name, av, statp)
int i, len = 0;
char *p;
char *mxhosts[MAXMXHOSTS + 1];
- char buf[PSBUFSIZE / 2];
+ char buf[MXHOSTBUFSIZE + 1];
_res.options &= ~(RES_DNSRCH|RES_DEFNAMES);
nmx = getmxrr(name, mxhosts, FALSE, &rcode);
@@ -464,8 +464,8 @@ bestmx_map_lookup(map, name, av, statp)
return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av);
/*
- ** We were given a -z flag (return all MXs) and there are multiple
- ** ones. We need to build them all into a list.
+ ** We were given a -z flag (return all MXs) and there are multiple
+ ** ones. We need to build them all into a list.
*/
p = buf;
for (i = 0; i < nmx; i++)
@@ -663,7 +663,7 @@ cnameloop:
qtype = T_A;
continue;
}
- else if (qtype == T_A && !gotmx && (trymx || **dp == '\0'))
+ else if (qtype == T_A && !gotmx && trymx)
{
qtype = T_MX;
continue;
@@ -824,7 +824,7 @@ cnameloop:
if (qtype == T_ANY)
qtype = T_A;
- else if (qtype == T_A && !gotmx && (trymx || **dp == '\0'))
+ else if (qtype == T_A && !gotmx && trymx)
qtype = T_MX;
else
{
diff --git a/contrib/sendmail/src/envelope.c b/contrib/sendmail/src/envelope.c
index a17aa8c2dfcf..092148a2a0ca 100644
--- a/contrib/sendmail/src/envelope.c
+++ b/contrib/sendmail/src/envelope.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.121 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)envelope.c 8.117 (Berkeley) 6/4/98";
#endif /* not lint */
#include "sendmail.h"
@@ -827,7 +827,7 @@ setsender(from, e, delimptr, delimchar, internal)
sm_syslog(LOG_NOTICE, e->e_id,
"cannot prescan from (%s)",
shortenstring(from, MAXSHORTSTR));
- finis(TRUE, ExitStat);
+ finis();
}
(void) rewrite(pvp, 3, 0, e);
(void) rewrite(pvp, 1, 0, e);
diff --git a/contrib/sendmail/src/err.c b/contrib/sendmail/src/err.c
index 38a357666958..066139557a00 100644
--- a/contrib/sendmail/src/err.c
+++ b/contrib/sendmail/src/err.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/1998";
+static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
@@ -216,7 +216,7 @@ usrerr(fmt, va_alist)
char buf[MAXLINE];
snprintf(buf, sizeof buf, "Postmaster warning: %.*s",
- (int)sizeof buf - 22, MsgBuf + 4);
+ sizeof buf - 22, MsgBuf + 4);
CurEnv->e_message = newstr(buf);
}
else
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index 500e375d6732..a04f59e14f4d 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.134 (Berkeley) 11/29/1998";
+static char sccsid[] = "@(#)headers.c 8.127 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -521,8 +521,8 @@ eatheader(e, full)
#if 0
/*
- ** Change functionality so a fatal error on an
- ** address doesn't affect the entire envelope.
+ ** Change functionality so a fatal error on an
+ ** address doesn't affect the entire envelope.
*/
/* delete fatal errors generated by this address */
@@ -1198,59 +1198,6 @@ putheader(mci, hdr, e)
xputs(p);
}
-#if _FFR_MAX_MIME_HEADER_LENGTH
- /* heuristic shortening of MIME fields to avoid MUA overflows */
- if (MaxMimeFieldLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEFieldHeaders}", NULL)))
- {
- extern bool fix_mime_header __P((char *));
-
- if (fix_mime_header(h->h_value))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated MIME %s header due to field size (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated MIME %s header due to field size (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMETextHeaders}", NULL)))
- {
- if (strlen(h->h_value) > MaxMimeHeaderLength)
- {
- h->h_value[MaxMimeHeaderLength - 1] = '\0';
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEHeaders}", NULL)))
- {
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (shorten_rfc822_string(h->h_value, MaxMimeHeaderLength))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-#endif
-
/* suppress Content-Transfer-Encoding: if we are MIMEing */
if (bitset(H_CTE, h->h_flags) &&
bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags))
@@ -1418,7 +1365,7 @@ put_vanilla_header(h, v, mci)
*obp++ = ' ';
}
snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
- (int)(sizeof obuf - (obp - obuf) - 1), v);
+ sizeof obuf - (obp - obuf) - 1, v);
putxline(obuf, strlen(obuf), mci, putflags);
}
/*
@@ -1621,69 +1568,3 @@ copyheader(header)
return ret;
}
- /*
-** FIX_MIME_HEADER -- possibly truncate/rebalance parameters in a MIME header
-**
-** Run through all of the parameters of a MIME header and
-** possibly truncate and rebalance the parameter according
-** to MaxMimeFieldLength.
-**
-** Parameters:
-** string -- the full header
-**
-** Returns:
-** TRUE if the header was modified, FALSE otherwise
-**
-** Side Effects:
-** string modified in place
-*/
-
-bool
-fix_mime_header(string)
- char *string;
-{
- bool modified = FALSE;
- char *begin = string;
- char *end;
- extern char *find_character __P((char *, char));
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (string == NULL || *string == '\0')
- return FALSE;
-
- /* Split on each ';' */
- while ((end = find_character(begin, ';')) != NULL)
- {
- char save = *end;
- char *bp;
-
- *end = '\0';
-
- /* Shorten individual parameter */
- if (shorten_rfc822_string(begin, MaxMimeFieldLength))
- modified = TRUE;
-
- /* Collapse the possibly shortened string with rest */
- bp = begin + strlen(begin);
- if (bp != end)
- {
- char *ep = end;
-
- *end = save;
- end = bp;
-
- /* copy character by character due to overlap */
- while (*ep != '\0')
- *bp++ = *ep++;
- *bp = '\0';
- }
- else
- *end = save;
- if (*end == '\0')
- break;
-
- /* Move past ';' */
- begin = end + 1;
- }
- return modified;
-}
diff --git a/contrib/sendmail/src/ldap_map.h b/contrib/sendmail/src/ldap_map.h
index 97eb29ec072c..9f6a6796d7a6 100644
--- a/contrib/sendmail/src/ldap_map.h
+++ b/contrib/sendmail/src/ldap_map.h
@@ -14,7 +14,7 @@
** Please go to him for support -- since I (Eric) don't run LDAP, I
** can't help you at all.
**
-** @(#)ldap_map.h 8.10 (Berkeley) 9/14/1998
+** @(#)ldap_map.h 8.9 (Berkeley) 5/19/98
*/
#ifndef _LDAP_MAP_H
@@ -61,7 +61,7 @@ typedef struct ldap_map_struct LDAP_MAP_STRUCT;
#define DEFAULT_LDAP_MAP_DEREF LDAP_DEREF_NEVER
#define DEFAULT_LDAP_MAP_SIZELIMIT 0
#define DEFAULT_LDAP_MAP_ATTRSONLY 0
-#define LDAP_MAP_MAX_FILTER 1024
+#define LDAP_MAP_MAX_FILTER 256
#ifdef LDAP_REFERRALS
# define DEFAULT_LDAP_MAP_LDAP_OPTIONS LDAP_OPT_REFERRALS
#else /* LDAP_REFERRALS */
diff --git a/contrib/sendmail/src/macro.c b/contrib/sendmail/src/macro.c
index d45a0c7080e9..c1f9f7bb06cf 100644
--- a/contrib/sendmail/src/macro.c
+++ b/contrib/sendmail/src/macro.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)macro.c 8.26 (Berkeley) 11/8/1998";
+static char sccsid[] = "@(#)macro.c 8.25 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -333,7 +333,7 @@ macid(p, ep)
{
int mid;
register char *bp;
- char mbuf[MAXMACNAMELEN + 1];
+ char mbuf[21];
if (tTd(35, 14))
{
@@ -361,7 +361,7 @@ macid(p, ep)
return *p;
}
bp = mbuf;
- while (*++p != '\0' && *p != '}' && bp < &mbuf[sizeof mbuf - 1])
+ while (*++p != '\0' && *p != '}' && bp < &mbuf[sizeof mbuf])
{
if (isascii(*p) && (isalnum(*p) || *p == '_'))
*bp++ = *p;
diff --git a/contrib/sendmail/src/mailq.1 b/contrib/sendmail/src/mailq.1
index bead1a26db1e..ed6c0f6a06e5 100644
--- a/contrib/sendmail/src/mailq.1
+++ b/contrib/sendmail/src/mailq.1
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mailq.1 8.10 (Berkeley) 5/19/1998
+.\" @(#)mailq.1 8.10 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt MAILQ 1
diff --git a/contrib/sendmail/src/mailstats.h b/contrib/sendmail/src/mailstats.h
index 86390b3911a3..2121e149587e 100644
--- a/contrib/sendmail/src/mailstats.h
+++ b/contrib/sendmail/src/mailstats.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)mailstats.h 8.8 (Berkeley) 5/19/1998
+ * @(#)mailstats.h 8.8 (Berkeley) 5/19/98
*/
#define STAT_VERSION 2
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c
index cea9d158d711..f014d83c359f 100644
--- a/contrib/sendmail/src/main.c
+++ b/contrib/sendmail/src/main.c
@@ -19,7 +19,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.322 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)main.c 8.302 (Berkeley) 6/4/98";
#endif /* not lint */
#define _DEFINE
@@ -129,7 +129,6 @@ main(argc, argv, envp)
extern char *getcfname __P((void));
extern SIGFUNC_DECL sigusr1 __P((int));
extern SIGFUNC_DECL sighup __P((int));
- extern SIGFUNC_DECL quiesce __P((int));
extern void initmacros __P((ENVELOPE *));
extern void init_md __P((int, char **));
extern int getdtsize __P((void));
@@ -305,7 +304,9 @@ main(argc, argv, envp)
if (tTd(0, 101))
{
printf("Version %s\n", Version);
- finis(FALSE, EX_OK);
+ endpwent();
+ setuid(RealUid);
+ exit(EX_OK);
}
/*
@@ -418,8 +419,8 @@ main(argc, argv, envp)
environ = emptyenviron;
/*
- ** restore any original TZ setting until TimeZoneSpec has been
- ** determined - or early log messages may get bogus time stamps
+ ** restore any original TZ setting until TimeZoneSpec has been
+ ** determined - or early log messages may get bogus time stamps
*/
if ((p = getextenv("TZ")) != NULL)
{
@@ -548,7 +549,7 @@ main(argc, argv, envp)
QueueLimitId = (QUEUE_CHAR *) NULL;
/*
- ** Crack argv.
+ ** Crack argv.
*/
av = argv;
@@ -834,7 +835,8 @@ main(argc, argv, envp)
# endif
default:
- finis(TRUE, EX_USAGE);
+ ExitStat = EX_USAGE;
+ finis();
break;
}
}
@@ -969,11 +971,8 @@ main(argc, argv, envp)
}
/* check for permissions */
- if ((OpMode == MD_DAEMON ||
- OpMode == MD_FGDAEMON ||
- OpMode == MD_PURGESTAT) &&
- RealUid != 0 &&
- RealUid != TrustedUid)
+ if ((OpMode == MD_DAEMON || OpMode == MD_FGDAEMON ||
+ OpMode == MD_PURGESTAT) && RealUid != 0)
{
if (LogLevel > 1)
sm_syslog(LOG_ALERT, NOQID,
@@ -982,7 +981,7 @@ main(argc, argv, envp)
OpMode != MD_PURGESTAT ? "run daemon"
: "purge host status");
usrerr("Permission denied");
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
if (MeToo)
@@ -1084,17 +1083,6 @@ main(argc, argv, envp)
setoption('d', "", TRUE, FALSE, CurEnv);
}
-#ifdef VENDOR_CODE
- /* check for vendor mismatch */
- if (VendorCode != VENDOR_CODE)
- {
- extern char *getvendor __P((int));
-
- message("Warning: .cf file vendor code mismatch: sendmail expects vendor %s, .cf file vendor is %s",
- getvendor(VENDOR_CODE), getvendor(VendorCode));
- }
-#endif
-
/* check for out of date configuration level */
if (ConfigLevel < MAXCONFIGLEVEL)
{
@@ -1211,22 +1199,6 @@ main(argc, argv, envp)
setclass('b', "application/octet-stream");
#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
- /* MIME headers which have fields to check for overflow */
- setclass(macid("{checkMIMEFieldHeaders}", NULL), "content-disposition");
- setclass(macid("{checkMIMEFieldHeaders}", NULL), "content-type");
-
- /* MIME headers to check for length overflow */
- setclass(macid("{checkMIMETextHeaders}", NULL), "content-description");
-
- /* MIME headers to check for overflow and rebalance */
- setclass(macid("{checkMIMEHeaders}", NULL), "content-disposition");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-id");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-transfer-encoding");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-type");
- setclass(macid("{checkMIMEHeaders}", NULL), "mime-version");
-#endif
-
/* operate in queue directory */
if (QueueDir == NULL)
{
@@ -1269,14 +1241,18 @@ main(argc, argv, envp)
{
/* nope, really a botch */
usrerr("You do not have permission to process the queue");
- finis(FALSE, EX_NOPERM);
+ exit (EX_NOPERM);
}
}
# endif /* QUEUE */
/* if we've had errors so far, exit now */
if (ExitStat != EX_OK && OpMode != MD_TEST)
- finis(FALSE, ExitStat);
+ {
+ endpwent();
+ setuid(RealUid);
+ exit(ExitStat);
+ }
#if XDEBUG
checkfd012("before main() initmaps");
@@ -1292,31 +1268,31 @@ main(argc, argv, envp)
/* print the queue */
#if QUEUE
dropenvelope(CurEnv, TRUE);
- signal(SIGPIPE, quiesce);
printqueue();
- finis(FALSE, EX_OK);
+ endpwent();
+ setuid(RealUid);
+ exit(EX_OK);
#else /* QUEUE */
usrerr("No queue to print");
- finis(FALSE, ExitStat);
+ finis();
#endif /* QUEUE */
- break;
case MD_HOSTSTAT:
- signal(SIGPIPE, quiesce);
mci_traverse_persistent(mci_print_persistent, NULL);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
break;
case MD_PURGESTAT:
mci_traverse_persistent(mci_purge_persistent, NULL);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
break;
case MD_INITALIAS:
- /* initialize maps */
+ /* initialize alias database */
initmaps(TRUE, CurEnv);
- finis(FALSE, ExitStat);
- break;
+ endpwent();
+ setuid(RealUid);
+ exit(ExitStat);
case MD_SMTP:
case MD_DAEMON:
@@ -1325,11 +1301,11 @@ main(argc, argv, envp)
CurEnv->e_envid = NULL;
CurEnv->e_flags &= ~(EF_RET_PARAM|EF_NO_BODY_RETN);
- /* don't open maps for daemon -- done below in child */
+ /* don't open alias database -- done in srvrsmtp */
break;
default:
- /* open the maps */
+ /* open the alias database */
initmaps(FALSE, CurEnv);
break;
}
@@ -1383,7 +1359,7 @@ main(argc, argv, envp)
printf("> ");
(void) fflush(stdout);
if (fgets(buf, sizeof buf, stdin) == NULL)
- finis(TRUE, ExitStat);
+ finis();
p = strchr(buf, '\n');
if (p != NULL)
*p = '\0';
@@ -1401,7 +1377,7 @@ main(argc, argv, envp)
if (queuemode && OpMode != MD_DAEMON && QueueIntvl == 0)
{
(void) runqueue(FALSE, Verbose);
- finis(TRUE, ExitStat);
+ finis();
}
# endif /* QUEUE */
@@ -1426,7 +1402,7 @@ main(argc, argv, envp)
if (i < 0)
syserr("daemon: cannot fork");
if (i != 0)
- finis(FALSE, EX_OK);
+ exit(EX_OK);
/* disconnect from our controlling tty */
disconnect(2, CurEnv);
@@ -1519,9 +1495,6 @@ main(argc, argv, envp)
snprintf(pbuf, sizeof pbuf, "0");
define(macid("{client_port}", NULL), newstr(pbuf), &BlankEnvelope);
- /* initialize maps now for check_relay ruleset */
- initmaps(FALSE, CurEnv);
-
if (OpMode == MD_DAEMON)
{
/* validate the connection */
@@ -1566,7 +1539,7 @@ main(argc, argv, envp)
/* collect body for UUCP return */
if (OpMode != MD_VERIFY)
collect(InChannel, FALSE, NULL, CurEnv);
- finis(TRUE, ExitStat);
+ finis();
}
/*
@@ -1610,7 +1583,7 @@ main(argc, argv, envp)
/* bail out if message too large */
if (bitset(EF_CLRQUEUE, CurEnv->e_flags))
{
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return -1;
}
@@ -1642,18 +1615,11 @@ main(argc, argv, envp)
** Don't send return error message if in VERIFY mode.
*/
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return -1;
}
-/* ARGSUSED */
-SIGFUNC_DECL
-quiesce(sig)
- int sig;
-{
- finis(FALSE, EX_OK);
-}
/* ARGSUSED */
SIGFUNC_DECL
@@ -1669,8 +1635,7 @@ intindebug(sig)
** FINIS -- Clean up and exit.
**
** Parameters:
-** drop -- whether or not to drop CurEnv envelope
-** exitstat -- exit status to use for exit() call
+** none
**
** Returns:
** never
@@ -1680,21 +1645,14 @@ intindebug(sig)
*/
void
-finis(drop, exitstat)
- bool drop;
- volatile int exitstat;
+finis()
{
- extern void closemaps __P((void));
-#ifdef USERDB
- extern void _udbx_close __P((void));
-#endif
-
if (tTd(2, 1))
{
extern void printenvflags __P((ENVELOPE *));
printf("\n====finis: stat %d e_id=%s e_flags=",
- exitstat,
+ ExitStat,
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id);
printenvflags(CurEnv);
}
@@ -1710,20 +1668,12 @@ finis(drop, exitstat)
/* clean up temp files */
CurEnv->e_to = NULL;
- if (drop && CurEnv->e_id != NULL)
+ if (CurEnv->e_id != NULL)
dropenvelope(CurEnv, TRUE);
/* flush any cached connections */
mci_flush(TRUE, NULL);
- /* close maps belonging to this pid */
- closemaps();
-
-#ifdef USERDB
- /* close UserDatabase */
- _udbx_close();
-#endif
-
# ifdef XLA
/* clean up extended load average stuff */
xla_all_end();
@@ -1735,14 +1685,14 @@ finis(drop, exitstat)
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"finis, pid=%d",
getpid());
- if (exitstat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
- exitstat = EX_OK;
+ if (ExitStat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
+ ExitStat = EX_OK;
/* reset uid for process accounting */
endpwent();
setuid(RealUid);
- exit(exitstat);
+ exit(ExitStat);
}
/*
** INTSIG -- clean up on interrupt
@@ -1769,11 +1719,15 @@ intsig(sig)
sm_syslog(LOG_DEBUG, CurEnv->e_id, "interrupt");
FileName = NULL;
unlockqueue(CurEnv);
- closecontrolsocket(TRUE);
#ifdef XLA
xla_all_end();
#endif
- finis(FALSE, EX_OK);
+
+ /* reset uid for process accounting */
+ endpwent();
+ setuid(RealUid);
+
+ exit(EX_OK);
}
/*
** INITMACROS -- initialize the macro system
@@ -2203,24 +2157,23 @@ sighup(sig)
{
if (LogLevel > 3)
sm_syslog(LOG_INFO, NOQID, "could not restart: need full path");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (LogLevel > 3)
sm_syslog(LOG_INFO, NOQID, "restarting %s on signal", SaveArgv[0]);
alarm(0);
releasesignal(SIGHUP);
- closecontrolsocket(TRUE);
if (drop_privileges(TRUE) != EX_OK)
{
if (LogLevel > 0)
sm_syslog(LOG_ALERT, NOQID, "could not set[ug]id(%d, %d): %m",
RunAsUid, RunAsGid);
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
execve(SaveArgv[0], (ARGV_T) SaveArgv, (ARGV_T) ExternalEnviron);
if (LogLevel > 0)
sm_syslog(LOG_ALERT, NOQID, "could not exec %s: %m", SaveArgv[0]);
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
/*
** DROP_PRIVILEGES -- reduce privileges to those of the RunAsUser option
diff --git a/contrib/sendmail/src/makesendmail b/contrib/sendmail/src/makesendmail
new file mode 100755
index 000000000000..ab8a49d78cac
--- /dev/null
+++ b/contrib/sendmail/src/makesendmail
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. 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.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c
index 787ae07deb8d..4c95b7fd6ab4 100644
--- a/contrib/sendmail/src/map.c
+++ b/contrib/sendmail/src/map.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.256 (Berkeley) 11/15/1998";
+static char sccsid[] = "@(#)map.c 8.239 (Berkeley) 6/5/98";
#endif /* not lint */
#include "sendmail.h"
@@ -437,9 +437,9 @@ map_init(s, pass)
pass);
/*
- ** Pass 0 opens all non-rebuildable maps.
- ** Pass 1 opens all rebuildable maps for read.
- ** Pass 2 rebuilds all rebuildable maps.
+ ** Pass 0 opens all non-rebuildable maps.
+ ** Pass 1 opens all rebuildable maps for read.
+ ** Pass 2 rebuilds all rebuildable maps.
*/
rebuildable = (bitset(MF_ALIAS, map->map_mflags) &&
@@ -478,7 +478,6 @@ map_init(s, pass)
map->map_file == NULL ? "NULL" :
map->map_file);
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
}
else
{
@@ -497,55 +496,10 @@ map_init(s, pass)
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
}
}
}
/*
-** CLOSEMAPS -- close all open maps opened by the current pid.
-**
-** Parameters:
-** none
-**
-** Returns:
-** none.
-*/
-
-void
-closemaps()
-{
- extern void map_close __P((STAB *, int));
-
- stabapply(map_close, 0);
-}
-
-/* ARGSUSED1 */
-void
-map_close(s, unused)
- register STAB *s;
- int unused;
-{
- MAP *map;
-
- if (s->s_type != ST_MAP)
- return;
-
- map = &s->s_map;
-
- if (!bitset(MF_VALID, map->map_mflags) ||
- !bitset(MF_OPEN, map->map_mflags) ||
- map->map_pid != getpid())
- return;
-
- if (tTd(38, 5))
- printf("closemaps: closing %s (%s)\n",
- map->map_mname == NULL ? "NULL" : map->map_mname,
- map->map_file == NULL ? "NULL" : map->map_file);
-
- map->map_class->map_close(map);
- map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
-}
- /*
** GETCANONNAME -- look up name using service switch
**
** Parameters:
@@ -999,11 +953,10 @@ ndbm_map_open(map, mode)
else
{
map->map_mflags |= MF_LOCKED;
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(dfd, TrustedUid, -1) < 0 ||
- fchown(pfd, TrustedUid, -1) < 0)
+ if (fchown(dfd, TrustedFileUid, -1) < 0 ||
+ fchown(pfd, TrustedFileUid, -1) < 0)
{
int err = errno;
@@ -1014,7 +967,6 @@ ndbm_map_open(map, mode)
map->map_file, errstring(err));
}
}
-#endif
}
if (fstat(dfd, &st) >= 0)
map->map_mtime = st.st_mtime;
@@ -1068,7 +1020,6 @@ lockdbm:
if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
if ((omode && O_ACCMODE) == O_RDWR)
map->map_mflags |= MF_WRITABLE;
goto lockdbm;
@@ -1082,7 +1033,6 @@ lockdbm:
*statp = EX_TEMPFAIL;
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
syserr("Cannot reopen NDBM database %s",
map->map_file);
}
@@ -1209,7 +1159,7 @@ ndbm_map_close(map)
{
#ifdef NDBM_YP_COMPAT
bool inclnull;
- char buf[MAXHOSTNAMELEN];
+ char buf[200];
inclnull = bitset(MF_INCLNULL, map->map_mflags);
map->map_mflags &= ~MF_INCLNULL;
@@ -1550,10 +1500,9 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
if (mode == O_RDWR)
{
(void) db->sync(db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
int err = errno;
@@ -1564,7 +1513,6 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
buf, errstring(err));
}
}
-#endif
}
if (fd >= 0 && fstat(fd, &st) >= 0)
@@ -1642,7 +1590,6 @@ db_map_lookup(map, name, av, statp)
if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
if ((omode && O_ACCMODE) == O_RDWR)
map->map_mflags |= MF_WRITABLE;
db = (DB *) map->map_db2;
@@ -1657,7 +1604,6 @@ db_map_lookup(map, name, av, statp)
*statp = EX_TEMPFAIL;
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
syserr("Cannot reopen DB database %s",
map->map_file);
}
@@ -1871,31 +1817,9 @@ db_map_close(map)
#if DB_VERSION_MAJOR < 2
if (db->close(db) != 0)
#else
- /*
- ** Berkeley DB can use internal shared memory
- ** locking for its memory pool. Closing a map
- ** opened by another process will interfere
- ** with the shared memory and locks of the parent
- ** process leaving things in a bad state.
- **
- ** If this map was not opened by the current
- ** process, do not close it here but recover
- ** the file descriptor.
- */
- if (map->map_pid != getpid())
- {
- int fd = -1;
-
- errno = db->fd(db, &fd);
- if (fd >= 0)
- (void) close(fd);
- return;
- }
-
if ((errno = db->close(db, 0)) != 0)
#endif
- syserr("db_map_close(%s, %s, %lx): db close failure",
- map->map_mname, map->map_file, map->map_mflags);
+ syserr("readaliases: db close failure");
}
#endif
@@ -2326,10 +2250,7 @@ nisplus_map_lookup(map, name, av, statp)
if (!bitset(MF_OPEN, map->map_mflags))
{
if (nisplus_map_open(map, O_RDONLY))
- {
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
- }
else
{
*statp = EX_UNAVAILABLE;
@@ -2670,38 +2591,18 @@ ldap_map_start(map)
ev = setevent(lmap->timeout.tv_sec, ldaptimeout, 0);
}
-#ifdef LDAP_VERSION3
- ld = ldap_init(lmap->ldaphost,lmap->ldapport);
-#else
- ld = ldap_open(lmap->ldaphost,lmap->ldapport);
-#endif
-
- /* clear the event if it has not sprung */
- if (lmap->timeout.tv_sec != 0)
- clrevent(ev);
-
- if (ld == NULL)
+ if ((ld = ldap_open(lmap->ldaphost,lmap->ldapport)) == NULL)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
{
- syserr("%sldapopen failed to %s in map %s",
- bitset(MF_NODEFER, map->map_mflags) ? "" : "421 ",
+ syserr("ldapopen failed to %s in map %s",
lmap->ldaphost, map->map_mname);
}
return FALSE;
}
-#ifdef LDAP_VERSION3
- ldap_set_option(ld, LDAP_OPT_DEREF, &lmap->deref);
- ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &lmap->timelimit);
- ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &lmap->sizelimit);
- ldap_set_option(ld, LDAP_OPT_REFERRALS, &lmap->ldap_options);
-
- /* ld needs to be cast into the map struct */
- lmap->ld = ld;
- return TRUE;
-#else
-
+ /* clear the event if it has not sprung */
+ clrevent(ev);
/* From here on in we can use ldap internal timelimits */
ld->ld_deref = lmap->deref;
ld->ld_timelimit = lmap->timelimit;
@@ -2724,12 +2625,11 @@ ldap_map_start(map)
}
return FALSE;
-#endif
}
/*
-** LDAP_MAP_CLOSE -- close ldap map
+** LDAP_MAP_CLOSE -- close ldap map
*/
void
@@ -2745,8 +2645,8 @@ ldap_map_close(map)
#ifdef SUNET_ID
/*
-** SUNET_ID_HASH -- Convert a string to it's Sunet_id canonical form
-** This only makes sense at Stanford University.
+** SUNET_ID_HASH -- Convert a string to it's Sunet_id canonical form
+** This only makes sense at Stanford University.
*/
char *
@@ -2780,7 +2680,7 @@ sunet_id_hash(str)
#endif /* SUNET_ID */
/*
-** LDAP_MAP_LOOKUP -- look up a datum in a LDAP map
+** LDAP_MAP_LOOKUP -- look up a datum in a LDAP map
*/
char *
@@ -2799,7 +2699,6 @@ ldap_map_lookup(map, name, av, statp)
char **attr_values = NULL;
char *result;
int name_len;
- char *fp, *p, *q;
if (tTd(38, 20))
printf("ldap_map_lookup(%s, %s)\n", map->map_mname, name);
@@ -2828,28 +2727,8 @@ ldap_map_lookup(map, name, av, statp)
makelower(keybuf);
#endif /*SUNET_ID */
- /* substitute keybuf into filter, perhaps multiple times */
- fp = filter;
- p = lmap->filter;
- while ((q = strchr(p, '%')) != NULL)
- {
- if (q[1] == 's')
- {
- snprintf(fp, SPACELEFT(filter, fp), "%.*s%s",
- q - p, p, keybuf);
- p = q + 2;
- }
- else
- {
- snprintf(fp, SPACELEFT(filter, fp), "%.*s",
- q - p + 1, p);
- p = q + (q[1] == '%' ? 2 : 1);
- }
- fp += strlen(fp);
- }
- snprintf(fp, SPACELEFT(filter, fp), "%s", p);
- if (tTd(38, 20))
- printf("ldap search filter=%s\n", filter);
+ /* sprintf keybuf into filter */
+ snprintf(filter, sizeof filter, lmap->filter, keybuf);
if (ldap_search_st(lmap->ld, lmap->base,lmap->scope,filter,
lmap->attr, lmap->attrsonly, &(lmap->timeout),
@@ -2870,8 +2749,7 @@ ldap_map_lookup(map, name, av, statp)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
{
- syserr("%sError in ldap_search_st using %s in map %s",
- bitset(MF_NODEFER, map->map_mflags) ? "" : "421 ",
+ syserr("Error in ldap_search_st using %s in map %s",
filter, map->map_mname);
}
result = NULL;
@@ -2924,7 +2802,7 @@ ldap_map_lookup(map, name, av, statp)
/*
-** LDAP_MAP_DEQUOTE - helper routine for ldap_map_parseargs
+** LDAP_MAP_DEQUOTE - helper routine for ldap_map_parseargs
*/
char *
@@ -2954,7 +2832,7 @@ ldap_map_dequote(str)
}
/*
-** LDAP_MAP_PARSEARGS -- parse ldap map definition args.
+** LDAP_MAP_PARSEARGS -- parse ldap map definition args.
*/
bool
@@ -3158,8 +3036,8 @@ ldap_map_parseargs(map,args)
map->map_domain = newstr(ldap_map_dequote(map->map_domain));
/*
- ** We need to swallow up all the stuff into a struct
- ** and dump it into map->map_dbptr1
+ ** We need to swallow up all the stuff into a struct
+ ** and dump it into map->map_dbptr1
*/
if (lmap->ldaphost != NULL)
@@ -3217,7 +3095,7 @@ ldap_map_parseargs(map,args)
#endif /* LDAP Modules */
/*
-** syslog map
+** syslog map
*/
#if _FFR_MAP_SYSLOG
@@ -3225,7 +3103,7 @@ ldap_map_parseargs(map,args)
#define map_prio map_lockfd /* overload field */
/*
-** SYSLOG_MAP_PARSEARGS -- check for priority level to syslog messages.
+** SYSLOG_MAP_PARSEARGS -- check for priority level to syslog messages.
*/
bool
@@ -3307,7 +3185,7 @@ syslog_map_parseargs(map, args)
}
/*
-** SYSLOG_MAP_LOOKUP -- rewrite and syslog message. Always return empty string
+** SYSLOG_MAP_LOOKUP -- rewrite and syslog message. Always return empty string
*/
char *
@@ -3504,6 +3382,8 @@ ni_map_open(map, mode)
MAP *map;
int mode;
{
+ char *p;
+
if (tTd(38, 2))
printf("ni_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
@@ -3786,7 +3666,7 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
return propval;
}
-#endif /* NETINFO */
+#endif
/*
** TEXT (unindexed text file) Modules
**
@@ -3962,11 +3842,6 @@ text_map_lookup(map, name, av, statp)
return NULL;
}
vp = get_column(linebuf, map->map_valcolno, delim, buf, sizeof buf);
- if (vp == NULL)
- {
- *statp = EX_NOTFOUND;
- return NULL;
- }
vsize = strlen(vp);
*statp = EX_OK;
if (bitset(MF_MATCHONLY, map->map_mflags))
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index 8ebb7a000a4c..efb8cbad67a8 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.83 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)mci.c 8.82 (Berkeley) 6/15/98";
#endif /* not lint */
#include "sendmail.h"
@@ -428,9 +428,7 @@ mci_dump(mci, logit)
sep = logit ? " " : "\n\t";
p = buf;
- snprintf(p, SPACELEFT(buf, p), "MCI@%lx: ",
- sizeof(void *) == sizeof(u_long) ?
- (u_long)(void *)mci : (u_long)(u_int)(void *)mci);
+ snprintf(p, SPACELEFT(buf, p), "MCI@%x: ", mci);
p += strlen(p);
if (mci == NULL)
{
@@ -505,7 +503,7 @@ mci_dump_all(logit)
mci_dump(MciCache[i], logit);
}
/*
-** MCI_LOCK_HOST -- Lock host while sending.
+** MCI_LOCK_HOST -- Lock host while sending.
**
** If we are contacting a host, we'll need to
** update the status information in the host status
@@ -645,7 +643,7 @@ mci_unlock_host(mci)
errno = saveErrno;
}
/*
-** MCI_LOAD_PERSISTENT -- load persistent host info
+** MCI_LOAD_PERSISTENT -- load persistent host info
**
** Load information about host that is kept
** in common for all running sendmails.
@@ -1018,8 +1016,8 @@ mci_traverse_persistent(action, pathname)
*hostptr = '\0';
/*
- ** Do something with the file containing the persistent
- ** information.
+ ** Do something with the file containing the persistent
+ ** information.
*/
ret = (*action)(pathname, host);
}
@@ -1169,7 +1167,7 @@ mci_purge_persistent(pathname, hostname)
return 0;
}
/*
-** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
+** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
**
** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
** putting the result into `path'. if `createflag' is set, intervening
diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c
index a1429cb950d0..11a141e4f8a3 100644
--- a/contrib/sendmail/src/mime.c
+++ b/contrib/sendmail/src/mime.c
@@ -14,7 +14,7 @@
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.70 (Berkeley) 11/10/1998";
+static char sccsid[] = "@(#)mime.c 8.66 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -225,8 +225,7 @@ mime8to7(mci, header, e, boundaries, flags)
** Do a recursive descent into the message.
*/
- if (strcasecmp(type, "multipart") == 0 &&
- (!bitset(M87F_NO8BIT, flags) || bitset(M87F_NO8TO7, flags)))
+ if (strcasecmp(type, "multipart") == 0 && !bitset(M87F_NO8BIT, flags))
{
int blen;
@@ -380,7 +379,7 @@ mime8to7(mci, header, e, boundaries, flags)
*/
sectionsize = sectionhighbits = 0;
- if (!bitset(M87F_NO8BIT|M87F_NO8TO7, flags))
+ if (!bitset(M87F_NO8BIT, flags))
{
/* remember where we were */
offset = ftell(e->e_dfp);
@@ -442,13 +441,8 @@ mime8to7(mci, header, e, boundaries, flags)
if (sectionhighbits == 0)
{
/* no encoding necessary */
- if (cte != NULL && bitset(MCIF_INMIME, mci->mci_flags))
+ if (cte != NULL)
{
- /*
- ** Skip _unless_ in MIME mode; see putheader() for the
- ** counterpart where this is skipped _if_ in MIME mode.
- */
-
snprintf(buf, sizeof buf,
"Content-Transfer-Encoding: %.200s", cte);
putline(buf, mci);
@@ -668,22 +662,15 @@ mime_getchar(fp, boundaries, btp)
static bool atbol = TRUE; /* at beginning of line */
static int bt = MBT_SYNTAX; /* boundary type of next EOF */
static u_char buf[128]; /* need not be a full line */
- int start = 0; /* indicates position of - in buffer */
- if (buflen == 1 && *bp == '\n')
- {
- /* last \n in buffer may be part of next MIME boundary */
- c = *bp;
- }
- else if (buflen > 0)
+ if (buflen > 0)
{
buflen--;
return *bp++;
}
- else
- c = getc(fp);
bp = buf;
buflen = 0;
+ c = getc(fp);
if (c == '\n')
{
/* might be part of a MIME boundary */
@@ -695,7 +682,6 @@ mime_getchar(fp, boundaries, btp)
ungetc(c, fp);
return c;
}
- start = 1;
}
if (c != EOF)
*bp++ = c;
@@ -724,7 +710,7 @@ mime_getchar(fp, boundaries, btp)
*bp++ = c;
}
*bp = '\0';
- bt = mimeboundary((char *) &buf[start], boundaries);
+ bt = mimeboundary((char *) &buf[1], boundaries);
switch (bt)
{
case MBT_FINAL:
diff --git a/contrib/sendmail/src/newaliases.1 b/contrib/sendmail/src/newaliases.1
index b9673cd35353..acf324531640 100644
--- a/contrib/sendmail/src/newaliases.1
+++ b/contrib/sendmail/src/newaliases.1
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)newaliases.1 8.10 (Berkeley) 5/19/1998
+.\" @(#)newaliases.1 8.10 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt NEWALIASES 1
diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c
index 86762fd66945..c3c89b45d2f2 100644
--- a/contrib/sendmail/src/parseaddr.c
+++ b/contrib/sendmail/src/parseaddr.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)parseaddr.c 8.156 (Berkeley) 10/27/1998";
+static char sccsid[] = "@(#)parseaddr.c 8.153 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
@@ -67,6 +67,7 @@ parseaddr(addr, a, flags, delim, delimptr, e)
auto char *delimptrbuf;
bool queueup;
char pvpbuf[PSBUFSIZE];
+ extern ADDRESS *buildaddr __P((char **, ADDRESS *, int, ENVELOPE *));
extern bool invalidaddr __P((char *, char *));
extern void allocaddr __P((ADDRESS *, int, char *));
@@ -1449,17 +1450,8 @@ map_lookup(map, key, argvect, pstat, e)
/* XXX should try to auto-open the map here */
if (tTd(60, 1))
- {
- printf("map_lookup(%s, %s", map->s_name, key);
- if (tTd(60, 5))
- {
- int i;
-
- for (i = 0; argvect[i] != NULL; i++)
- printf(", %%%d=%s", i, argvect[i]);
- }
- printf(") => ");
- }
+ printf("map_lookup(%s, %s) => ",
+ map->s_name, key);
replac = (*map->s_map.map_class->map_lookup)(&map->s_map,
key, argvect, &stat);
if (tTd(60, 1))
@@ -1561,7 +1553,7 @@ buildaddr(tv, a, flags, e)
static MAILER errormailer;
static char *discardargv[] = { "DISCARD", NULL };
static char *errorargv[] = { "ERROR", NULL };
- static char ubuf[MAXNAME + 2];
+ static char ubuf[MAXNAME + 1];
if (tTd(24, 5))
{
diff --git a/contrib/sendmail/src/pathnames.h b/contrib/sendmail/src/pathnames.h
index 7a06b120652c..e10387ee398e 100644
--- a/contrib/sendmail/src/pathnames.h
+++ b/contrib/sendmail/src/pathnames.h
@@ -8,7 +8,7 @@
* the sendmail distribution.
*
*
- * @(#)pathnames.h 8.8 (Berkeley) 5/19/1998
+ * @(#)pathnames.h 8.8 (Berkeley) 5/19/98
*/
#ifndef _PATH_SENDMAILCF
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 65e777ac5aba..24b789a251b8 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -14,9 +14,9 @@
#ifndef lint
#if QUEUE
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (without queueing)";
#endif
#endif /* not lint */
@@ -611,7 +611,7 @@ runqueue(forkflag, verbose)
{
/* parent -- pick up intermediate zombie */
(void) blocksignal(SIGALRM);
- proc_list_add(pid, "Queue runner");
+ proc_list_add(pid);
(void) releasesignal(SIGALRM);
releasesignal(SIGCHLD);
if (QueueIntvl != 0)
@@ -619,17 +619,13 @@ runqueue(forkflag, verbose)
return TRUE;
}
/* child -- double fork and clean up signals */
- clrcontrol();
proc_list_clear();
-
- /* Add parent process as first child item */
- proc_list_add(getpid(), "Queue runner child process");
releasesignal(SIGCHLD);
(void) setsignal(SIGCHLD, SIG_DFL);
(void) setsignal(SIGHUP, intsig);
}
- sm_setproctitle(TRUE, "running queue: %s", QueueDir);
+ setproctitle("running queue: %s", QueueDir);
if (LogLevel > 69)
sm_syslog(LOG_DEBUG, NOQID,
@@ -754,6 +750,7 @@ runqueue(forkflag, verbose)
else
{
pid_t pid;
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
if (Verbose)
{
@@ -774,7 +771,7 @@ runqueue(forkflag, verbose)
/* exit without the usual cleanup */
e->e_id = NULL;
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return TRUE;
}
@@ -896,16 +893,7 @@ orderq(doall)
continue;
if (strlen(d->d_name) > MAXQFNAME)
- {
- if (Verbose)
- printf("orderq: %s too long, %d max characters\n",
- d->d_name, MAXQFNAME);
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID,
- "orderq: %s too long, %d max characters",
- d->d_name, MAXQFNAME);
continue;
- }
check = QueueLimitId;
while (check != NULL)
@@ -1455,16 +1443,6 @@ dowork(id, forkflag, requeueflag, e)
{
/* child -- error messages to the transcript */
QuickAbort = OnlyOneError = FALSE;
-
- /*
- ** Since the delivery may happen in a child and the
- ** parent does not wait, the parent may close the
- ** maps thereby removing any shared memory used by
- ** the map. Therefore, open a copy of the maps for
- ** the delivery process.
- */
-
- initmaps(FALSE, e);
}
}
else
@@ -1496,7 +1474,7 @@ dowork(id, forkflag, requeueflag, e)
disconnect(1, e);
OpMode = MD_DELIVER;
}
- sm_setproctitle(TRUE, "%s: from queue", id);
+ setproctitle("%s: from queue", id);
if (LogLevel > 76)
sm_syslog(LOG_DEBUG, e->e_id,
"dowork, pid=%d",
@@ -1512,7 +1490,7 @@ dowork(id, forkflag, requeueflag, e)
printf("readqf(%s) failed\n", e->e_id);
e->e_id = NULL;
if (forkflag)
- finis(FALSE, EX_OK);
+ exit(EX_OK);
else
return 0;
}
@@ -1528,7 +1506,7 @@ dowork(id, forkflag, requeueflag, e)
/* finish up and exit */
if (forkflag)
- finis(TRUE, ExitStat);
+ finis();
else
dropenvelope(e, TRUE);
}
@@ -1799,6 +1777,7 @@ readqf(e)
curtime() < e->e_dtime + MinQueueAge)
{
char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
+ extern void unlockqueue __P((ENVELOPE *));
if (Verbose || tTd(40, 8))
printf("%s: too young (%s)\n",
@@ -2206,7 +2185,7 @@ queuename(e, type)
continue;
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_UNAVAILABLE);
+ exit(EX_UNAVAILABLE);
}
do
{
@@ -2233,7 +2212,7 @@ queuename(e, type)
{
syserr("queuename: Cannot lock \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
/* a reader got the file; abandon it and try again */
@@ -2243,7 +2222,7 @@ queuename(e, type)
{
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
e->e_id = newstr(&qf[2]);
define('i', e->e_id, e);
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index 56aa825981b4..db71937fba6e 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)readcf.c 8.235 (Berkeley) 8/18/1998";
+static char sccsid[] = "@(#)readcf.c 8.230 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -106,19 +106,19 @@ readcf(cfname, safe, e)
if (cf == NULL)
{
syserr("cannot open");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (fstat(fileno(cf), &statb) < 0)
{
syserr("cannot fstat");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (!S_ISREG(statb.st_mode))
{
syserr("not a plain file");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (OpMode != MD_TEST && bitset(S_IWGRP|S_IWOTH, statb.st_mode))
@@ -518,7 +518,7 @@ readcf(cfname, safe, e)
if (ferror(cf))
{
syserr("I/O read error");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
fclose(cf);
FileName = NULL;
@@ -1515,18 +1515,11 @@ struct optioninfo
#define O_CNCTONLYTO 0xa6
{ "ConnectOnlyTo", O_CNCTONLYTO, FALSE },
#endif
-#if _FFR_TRUSTED_USER
-#define O_TRUSTUSER 0xa7
- { "TrustedUser", O_TRUSTUSER, FALSE },
-#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
-#define O_MAXMIMEHDRLEN 0xa8
- { "MaxMimeHeaderLength", O_MAXMIMEHDRLEN, FALSE },
-#endif
-#if _FFR_CONTROL_SOCKET
-#define O_CONTROLSOCKET 0xa9
- { "ControlSocketName", O_CONTROLSOCKET, FALSE },
+#if _FFR_TRUSTED_FILE_OWNER
+#define O_TRUSTFILEOWN 0xa7
+ { "TrustedFileOwner", O_TRUSTFILEOWN, FALSE },
#endif
+
{ NULL, '\0', FALSE }
};
@@ -1714,7 +1707,7 @@ setoption(opt, val, safe, sticky, e)
default:
syserr("Unknown 8-bit mode %c", *val);
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
break;
#endif
@@ -1778,7 +1771,7 @@ setoption(opt, val, safe, sticky, e)
default:
syserr("Unknown delivery mode %c", *val);
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
buf[0] = (char)e->e_sendmode;
buf[1] = '\0';
@@ -2408,64 +2401,33 @@ setoption(opt, val, safe, sticky, e)
break;
#endif
-#if _FFR_TRUSTED_USER
- case O_TRUSTUSER:
+#if _FFR_TRUSTED_FILE_OWNER
+ case O_TRUSTFILEOWN:
if (isascii(*val) && isdigit(*val))
- TrustedUid = atoi(val);
+ TrustedFileUid = atoi(val);
else
{
register struct passwd *pw;
- TrustedUid = 0;
+ TrustedFileUid = 0;
pw = sm_getpwnam(val);
if (pw == NULL)
- syserr("readcf: option TrustedUser: unknown user %s", val);
+ syserr("readcf: option TrustedFileOwner: unknown user %s", val);
else
- TrustedUid = pw->pw_uid;
+ TrustedFileUid = pw->pw_uid;
}
#ifdef UID_MAX
- if (TrustedUid > UID_MAX)
+ if (TrustedFileUid > UID_MAX)
{
- syserr("readcf: option TrustedUser: uid value (%ld) > UID_MAX (%ld)",
- TrustedUid, UID_MAX);
- TrustedUid = 0;
+ syserr("readcf: option TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
}
#endif
break;
#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
- case O_MAXMIMEHDRLEN:
- p = strchr(val, '/');
- if (p != NULL)
- *p++ = '\0';
- MaxMimeHeaderLength = atoi(val);
- if (p != NULL && *p != '\0')
- MaxMimeFieldLength = atoi(p);
- else
- MaxMimeFieldLength = MaxMimeHeaderLength / 2;
-
- if (MaxMimeHeaderLength < 0)
- MaxMimeHeaderLength = 0;
- else if (MaxMimeHeaderLength < 128)
- printf("Warning: MaxMimeHeaderLength: header length limit set lower than 128\n");
-
- if (MaxMimeFieldLength < 0)
- MaxMimeFieldLength = 0;
- else if (MaxMimeFieldLength < 40)
- printf("Warning: MaxMimeHeaderLength: field length limit set lower than 40\n");
- break;
-#endif
-
-#if _FFR_CONTROL_SOCKET
- case O_CONTROLSOCKET:
- if (ControlSocketName != NULL)
- free(ControlSocketName);
- ControlSocketName = newstr(val);
- break;
-#endif
-
default:
if (tTd(37, 1))
{
diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c
index 59412a842c65..9a73b6a39cf9 100644
--- a/contrib/sendmail/src/recipient.c
+++ b/contrib/sendmail/src/recipient.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)recipient.c 8.161 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)recipient.c 8.154 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
@@ -331,11 +331,8 @@ recipient(a, sendq, aliaslevel, e)
}
/* add address on list */
- if (pq != NULL)
- {
- *pq = a;
- a->q_next = NULL;
- }
+ *pq = a;
+ a->q_next = NULL;
/*
** Alias the name and handle special mailer types.
@@ -343,10 +340,7 @@ recipient(a, sendq, aliaslevel, e)
trylocaluser:
if (tTd(29, 7))
- {
- printf("at trylocaluser: ");
- printaddr(a, FALSE);
- }
+ printf("at trylocaluser %s\n", a->q_user);
if (bitset(QDONTSEND|QBADADDR|QVERIFIED, a->q_flags))
goto testselfdestruct;
@@ -937,7 +931,7 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
(int) getuid(), (int) geteuid());
if (forwarding)
- sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOWLINK;
+ sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOSLINK;
ca = getctladdr(ctladdr);
if (ca == NULL)
@@ -1201,7 +1195,7 @@ resetuid:
}
/*
- ** Check to see if some bad guy can write this file
+ ** Check to see if some bad guy can write this file
**
** Group write checking could be more clever, e.g.,
** guessing as to which groups are actually safe ("sys"
diff --git a/contrib/sendmail/src/safefile.c b/contrib/sendmail/src/safefile.c
index ff94b3d243bf..16f3f3927c99 100644
--- a/contrib/sendmail/src/safefile.c
+++ b/contrib/sendmail/src/safefile.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)safefile.c 8.43 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)safefile.c 8.40 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -102,7 +102,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (bitset(S_ISUID, st->st_mode))
#else
if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0 &&
- st->st_uid != TrustedUid)
+ st->st_uid != TrustedFileUid)
#endif
{
uid = st->st_uid;
@@ -206,7 +206,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (stbuf.st_uid == uid)
;
- else if (uid == 0 && stbuf.st_uid == TrustedUid)
+ else if (uid == 0 && TrustedFileUid != 0 && stbuf.st_uid == TrustedFileUid)
;
else
{
@@ -299,7 +299,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
mode >>= 6;
else if (st->st_uid == uid)
;
- else if (uid == 0 && st->st_uid == TrustedUid)
+ else if (uid == 0 && TrustedFileUid != 0 && st->st_uid == TrustedFileUid)
;
else
{
@@ -328,7 +328,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
(int) st->st_uid, (int) st->st_nlink,
(u_long) st->st_mode, (u_long) mode);
if ((st->st_uid == uid || st->st_uid == 0 ||
- st->st_uid == TrustedUid ||
+ st->st_uid == TrustedFileUid ||
!bitset(SFF_MUSTOWN, flags)) &&
(st->st_mode & mode) == mode)
{
@@ -429,9 +429,9 @@ safedirpath(fn, uid, gid, uname, flags)
}
/*
- ** Let OS determine access to file if we are not
- ** running as a privileged user. This allows ACLs
- ** to work.
+ ** Let OS determine access to file if we are not
+ ** running as a privileged user. This allows ACLs
+ ** to work.
*/
if (geteuid() != 0)
continue;
diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c
index 53e1a51756ca..4fbfd675621b 100644
--- a/contrib/sendmail/src/savemail.c
+++ b/contrib/sendmail/src/savemail.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.139 (Berkeley) 8/5/1998";
+static char sccsid[] = "@(#)savemail.c 8.138 (Berkeley) 6/17/98";
#endif /* not lint */
# include "sendmail.h"
@@ -91,7 +91,8 @@ savemail(e, sendbody)
RF_COPYPARSE|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Cannot parse Postmaster!");
- finis(TRUE, EX_SOFTWARE);
+ ExitStat = EX_SOFTWARE;
+ finis();
}
}
e->e_to = NULL;
@@ -550,7 +551,7 @@ returntosender(msg, returnq, flags, e)
addheader("MIME-Version", "1.0", &ee->e_header);
(void) snprintf(buf, sizeof buf, "%s.%ld/%.100s",
- ee->e_id, (long)curtime(), MyHostName);
+ ee->e_id, curtime(), MyHostName);
ee->e_msgboundary = newstr(buf);
(void) snprintf(buf, sizeof buf,
#if DSN
@@ -587,14 +588,14 @@ returntosender(msg, returnq, flags, e)
else if (bitset(RTSF_PM_BOUNCE, flags))
{
snprintf(buf, sizeof buf, "Postmaster notify: %.*s",
- (int)sizeof buf - 20, msg);
+ sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "postmaster-notification";
}
else
{
snprintf(buf, sizeof buf, "Returned mail: %.*s",
- (int)sizeof buf - 20, msg);
+ sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "failure";
}
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index be31d2eb7c63..7738e128643b 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -8,9 +8,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)sendmail.8 8.20 (Berkeley) 8/2/1998
+.\" @(#)sendmail.8 8.19 (Berkeley) 5/19/98
.\"
-.Dd August 2, 1998
+.Dd May 19, 1998
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
@@ -277,9 +277,6 @@ Log all traffic in and out of mailers in the indicated log file.
This should only be used as a last resort
for debugging mailer bugs.
It will log a lot of data very quickly.
-.It Fl -
-Stop processing command flags and use the rest of the arguments
-as addresses.
.El
.Ss Options
There are also a number of processing options that may be set.
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index 023799d7e81b..7bfe11b76069 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)sendmail.h 8.292 (Berkeley) 11/21/1998
+ * @(#)sendmail.h 8.280 (Berkeley) 6/5/98
*/
/*
@@ -19,7 +19,7 @@
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.292 11/21/1998";
+static char SmailSccsId[] = "@(#)sendmail.h 8.280 6/5/98";
# endif
# else /* _DEFINE */
# define EXTERN extern
@@ -684,7 +684,6 @@ MAP
char *map_domain; /* the (nominal) NIS domain */
char *map_rebuild; /* program to run to do auto-rebuild */
time_t map_mtime; /* last database modification time */
- pid_t map_pid; /* PID of process which opened map */
int map_lockfd; /* auxiliary lock file descriptor */
short map_specificity; /* specificity of aliases */
MAP *map_stack[MAXMAPSTACK]; /* list for stacked maps */
@@ -1009,7 +1008,6 @@ extern bool filechanged __P((char *, int, struct stat *));
#define M87F_OUTER 0 /* outer context */
#define M87F_NO8BIT 0x0001 /* can't have 8-bit in this section */
#define M87F_DIGEST 0x0002 /* processing multipart/digest */
-#define M87F_NO8TO7 0x0004 /* don't do 8->7 bit conversions */
/*
@@ -1079,7 +1077,6 @@ extern char *validate_connection __P((SOCKADDR *, char *, ENVELOPE *));
#define VENDOR_SUN 2 /* Sun-native configuration file */
#define VENDOR_HP 3 /* Hewlett-Packard specific config syntax */
#define VENDOR_IBM 4 /* IBM specific config syntax */
-#define VENDOR_SENDMAIL 5 /* Sendmail, Inc. specific config syntax */
EXTERN int VendorCode; /* vendor-specific operation enhancements */
@@ -1100,6 +1097,7 @@ extern void vendor_daemon_setup __P((ENVELOPE *));
#define DBS_GROUPWRITABLEALIASFILE 0x00000010
#define DBS_WORLDWRITABLEALIASFILE 0x00000020
#define DBS_FORWARDFILEINUNSAFEDIRPATH 0x00000040
+#define DBS_INCLUDEFILEINUNSAFEDIRPATH 0x00000060
#define DBS_MAPINUNSAFEDIRPATH 0x00000080
#define DBS_LINKEDALIASFILEINWRITABLEDIR 0x00000100
#define DBS_LINKEDCLASSFILEINWRITABLEDIR 0x00000200
@@ -1122,7 +1120,6 @@ extern void vendor_daemon_setup __P((ENVELOPE *));
#define DBS_INCLUDEFILEINUNSAFEDIRPATHSAFE 0x04000000
#define DBS_RUNPROGRAMINUNSAFEDIRPATH 0x08000000
#define DBS_RUNWRITABLEPROGRAM 0x10000000
-#define DBS_INCLUDEFILEINUNSAFEDIRPATH 0x20000000
/* struct defining such things */
struct dbsval
@@ -1186,7 +1183,7 @@ EXTERN gid_t RealGid; /* real gid of caller */
EXTERN uid_t DefUid; /* default uid to run as */
EXTERN gid_t DefGid; /* default gid to run as */
EXTERN char *DefUser; /* default user to run as (from DefUid) */
-EXTERN uid_t TrustedUid; /* uid of trusted user for files and startup */
+EXTERN uid_t TrustedFileUid; /* uid of trusted owner of files and dirs */
EXTERN MODE_T OldUmask; /* umask when sendmail starts up */
EXTERN int Verbose; /* set if blow-by-blow desired */
EXTERN int Errors; /* set if errors (local to single pass) */
@@ -1224,7 +1221,6 @@ EXTERN char SpaceSub; /* substitution for <lwsp> */
EXTERN int PrivacyFlags; /* privacy flags */
EXTERN char *ConfFile; /* location of configuration file [conf.c] */
EXTERN char *PidFile; /* location of proc id file [conf.c] */
-EXTERN char *ControlSocketName; /* control socket filename [control.c] */
extern ADDRESS NullAddress; /* a null (template) address [main.c] */
EXTERN long WkClassFact; /* multiplier for message class -> priority */
EXTERN long WkRecipFact; /* multiplier for # of recipients -> priority */
@@ -1289,13 +1285,10 @@ EXTERN char *DoubleBounceAddr; /* where to send double bounces */
EXTERN char **ExternalEnviron; /* input environment */
EXTERN char *UserEnviron[MAXUSERENVIRON + 1];
/* saved user environment */
-EXTERN int MaxMimeHeaderLength; /* maximum MIME header length */
-EXTERN int MaxMimeFieldLength; /* maximum MIME field length */
-
extern int errno;
/*
-** Queue Run Limitations
+** Queue Run Limitations
*/
struct queue_char
{
@@ -1407,7 +1400,7 @@ extern char *denlstring __P((char *, bool, bool));
extern void makelower __P((char *));
extern bool rebuildaliases __P((MAP *, bool));
extern void readaliases __P((MAP *, FILE *, bool, bool));
-extern void finis __P((bool, volatile int));
+extern void finis __P((void));
extern void setsender __P((char *, ENVELOPE *, char **, int, bool));
extern void xputs __P((const char *));
extern void logsender __P((ENVELOPE *, char *));
@@ -1435,12 +1428,9 @@ extern void xfclose __P((FILE *, char *, char *));
extern int switch_map_find __P((char *, char *[], short []));
extern void shorten_hostname __P((char []));
extern int waitfor __P((pid_t));
-extern void proc_list_add __P((pid_t, char *));
-extern void proc_list_set __P((pid_t, char *));
+extern void proc_list_add __P((pid_t));
extern void proc_list_drop __P((pid_t));
extern void proc_list_clear __P((void));
-extern void proc_list_display __P((FILE *));
-extern void proc_list_probe __P((void));
extern void buffer_errors __P((void));
extern void flush_errors __P((bool));
extern void putline __P((char *, MCI *));
@@ -1478,8 +1468,6 @@ extern bool path_is_dir __P((char *, bool));
extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
extern int drop_privileges __P((bool));
extern void fill_fd __P((int, char *));
-extern void closecontrolsocket __P((bool));
-extern void clrcontrol __P((void));
extern const char *errstring __P((int));
extern sigfunc_t setsignal __P((int, sigfunc_t));
@@ -1503,7 +1491,6 @@ extern void usrerr __P((const char *, ...));
extern void message __P((const char *, ...));
extern void nmessage __P((const char *, ...));
extern void setproctitle __P((const char *, ...));
-extern void sm_setproctitle __P((bool, const char *, ...));
extern void sm_syslog __P((int, const char *, const char *, ...));
#if !HASSNPRINTF
diff --git a/contrib/sendmail/src/sendmail.hf b/contrib/sendmail/src/sendmail.hf
index 0952963b8bd2..12a306012b38 100644
--- a/contrib/sendmail/src/sendmail.hf
+++ b/contrib/sendmail/src/sendmail.hf
@@ -9,7 +9,7 @@ cpyr By using this file, you agree to the terms and conditions set
cpyr forth in the LICENSE file which can be found at the top level of
cpyr the sendmail distribution.
cpyr
-cpyr @(#)sendmail.hf 8.18 (Berkeley) 11/19/1998
+cpyr @(#)sendmail.hf 8.16 (Berkeley) 5/19/98
cpyr
smtp Topics:
smtp HELO EHLO MAIL RCPT DATA
@@ -117,8 +117,3 @@ dsn ORCPT Original recipient.
-bt /map mapname key :look up `key' in the indicated `mapname'.
-bt rules addr :run the indicated address through the named rules.
-bt Rules can be a comma separated list of rules.
-control Help for smcontrol:
-control help This message.
-control restart Restart sendmail.
-control shutdown Shutdown sendmail.
-control status Show sendmail status.
diff --git a/contrib/sendmail/src/snprintf.c b/contrib/sendmail/src/snprintf.c
index 3e07e1b9920f..9e0b6f14f15a 100644
--- a/contrib/sendmail/src/snprintf.c
+++ b/contrib/sendmail/src/snprintf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)snprintf.c 8.12 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)snprintf.c 8.11 (Berkeley) 6/4/98";
#endif /* not lint */
#include "sendmail.h"
@@ -367,10 +367,10 @@ quad_to_string(value)
static char buf[64];
/*
- ** Use sprintf() instead of snprintf() since snprintf()
- ** does not support %qu or %llu. The buffer is large enough
- ** to hold the string so there is no danger of buffer
- ** overflow.
+ ** Use sprintf() instead of snprintf() since snprintf()
+ ** does not support %qu or %llu. The buffer is large enough
+ ** to hold the string so there is no danger of buffer
+ ** overflow.
*/
#if NEED_PERCENTQ
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index f4ffe8c0dfa6..fba103c6f045 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -14,9 +14,9 @@
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.187 (Berkeley) 10/23/1998 (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)srvrsmtp.c 8.187 (Berkeley) 10/23/1998 (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ smtp(nullserver, e)
char *id;
volatile int nrcpts = 0; /* number of RCPT commands */
bool doublequeue;
- volatile bool discard;
+ bool discard;
volatile int badcommands = 0; /* count of bad commands */
volatile int nverifies = 0; /* count of VRFY/EXPN commands */
volatile int n_etrn = 0; /* count of ETRN commands */
@@ -163,7 +163,7 @@ smtp(nullserver, e)
/* check_relay may have set discard bit, save for later */
discard = bitset(EF_DISCARD, e->e_flags);
- sm_setproctitle(TRUE, "server %s startup", CurSmtpClient);
+ setproctitle("server %s startup", CurSmtpClient);
#if DAEMON
if (LogLevel > 11)
{
@@ -222,7 +222,7 @@ smtp(nullserver, e)
/* read the input line */
SmtpPhase = "server cmd read";
- sm_setproctitle(TRUE, "server %s cmd read", CurSmtpClient);
+ setproctitle("server %s cmd read", CurSmtpClient);
p = sfgets(inp, sizeof inp, InChannel, TimeOuts.to_nextcommand,
SmtpPhase);
@@ -243,15 +243,15 @@ smtp(nullserver, e)
CurSmtpClient);
/*
- ** If have not accepted mail (DATA), do not bounce
- ** bad addresses back to sender.
+ ** If have not accepted mail (DATA), do not bounce
+ ** bad addresses back to sender.
*/
if (bitset(EF_CLRQUEUE, e->e_flags))
e->e_sendqueue = NULL;
if (InChild)
ExitStat = EX_QUIT;
- finis(TRUE, ExitStat);
+ finis();
}
/* clean up end of line */
@@ -267,9 +267,9 @@ smtp(nullserver, e)
inp);
if (e->e_id == NULL)
- sm_setproctitle(TRUE, "%s: %.80s", CurSmtpClient, inp);
+ setproctitle("%s: %.80s", CurSmtpClient, inp);
else
- sm_setproctitle(TRUE, "%s %s: %.80s", e->e_id, CurSmtpClient, inp);
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* break off command */
for (p = inp; isascii(*p) && isspace(*p); p++)
@@ -457,7 +457,7 @@ smtp(nullserver, e)
{
errno = 0;
syserr("503 Nested MAIL command: MAIL %s", p);
- finis(TRUE, ExitStat);
+ finis();
}
/* make sure we know who the sending host is */
@@ -498,7 +498,7 @@ smtp(nullserver, e)
goto undo_subproc_no_pm;
nrcpts = 0;
e->e_flags |= EF_LOGSENDER|EF_CLRQUEUE;
- sm_setproctitle(TRUE, "%s %s: %.80s", e->e_id, CurSmtpClient, inp);
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* child -- go do the processing */
if (setjmp(TopFrame) > 0)
@@ -512,7 +512,7 @@ smtp(nullserver, e)
QuickAbort = FALSE;
SuprErrs = TRUE;
e->e_flags &= ~EF_FATALERRS;
- finis(TRUE, ExitStat);
+ finis();
}
break;
}
@@ -633,14 +633,8 @@ smtp(nullserver, e)
if (p == NULL)
break;
a = parseaddr(p, NULLADDR, RF_COPYALL, ' ', &delimptr, e);
- if (Errors > 0)
- break;
- if (a == NULL)
- {
- usrerr("501 Missing recipient");
+ if (a == NULL || Errors > 0)
break;
- }
-
if (delimptr != NULL && *delimptr != '\0')
*delimptr++ = '\0';
@@ -814,6 +808,8 @@ smtp(nullserver, e)
if (!shouldqueue(e->e_msgpriority, e->e_ctime))
{
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
+
unlockqueue(e);
(void) dowork(id, TRUE, TRUE, e);
}
@@ -822,7 +818,7 @@ smtp(nullserver, e)
abortmessage:
/* if in a child, pop back to our parent */
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
/* clean up a bit */
gotmail = FALSE;
@@ -841,7 +837,7 @@ smtp(nullserver, e)
e->e_sendqueue = NULL;
e->e_flags |= EF_CLRQUEUE;
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
/* clean up a bit */
gotmail = FALSE;
@@ -920,7 +916,7 @@ smtp(nullserver, e)
vrfyqueue = vrfyqueue->q_next;
}
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
break;
case CMDETRN: /* etrn -- force queue flush */
@@ -996,7 +992,7 @@ doquit:
sm_syslog(LOG_INFO, NULL,
"Null connection from %.100s",
CurSmtpClient);
- finis(TRUE, ExitStat);
+ finis();
case CMDVERB: /* set verbose mode */
if (bitset(PRIV_NOEXPN, PrivacyFlags) ||
@@ -1421,7 +1417,7 @@ runinchild(label, e)
auto int st;
/* parent -- wait for child to complete */
- sm_setproctitle(TRUE, "server %s child wait", CurSmtpClient);
+ setproctitle("server %s child wait", CurSmtpClient);
st = waitfor(childpid);
if (st == -1)
syserr("451 %s: lost child", label);
@@ -1433,7 +1429,7 @@ runinchild(label, e)
if (WEXITSTATUS(st) == EX_QUIT)
{
disconnect(1, e);
- finis(TRUE, ExitStat);
+ finis();
}
/* restore the child signal */
@@ -1451,6 +1447,10 @@ runinchild(label, e)
(void) releasesignal(SIGCHLD);
}
}
+
+ /* open alias database */
+ initmaps(FALSE, e);
+
return (0);
}
diff --git a/contrib/sendmail/src/stab.c b/contrib/sendmail/src/stab.c
index 37b87a371246..1ffc7cb1fcf3 100644
--- a/contrib/sendmail/src/stab.c
+++ b/contrib/sendmail/src/stab.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stab.c 8.19 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)stab.c 8.19 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/stats.c b/contrib/sendmail/src/stats.c
index b1162ff79ea2..767a55e17413 100644
--- a/contrib/sendmail/src/stats.c
+++ b/contrib/sendmail/src/stats.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stats.c 8.22 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)stats.c 8.22 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/sysexits.c b/contrib/sendmail/src/sysexits.c
index c7934c738409..10d7c85a1824 100644
--- a/contrib/sendmail/src/sysexits.c
+++ b/contrib/sendmail/src/sysexits.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)sysexits.c 8.13 (Berkeley) 5/24/1998";
+static char sccsid[] = "@(#)sysexits.c 8.13 (Berkeley) 5/24/98";
#endif /* not lint */
#include "sendmail.h"
diff --git a/contrib/sendmail/src/trace.c b/contrib/sendmail/src/trace.c
index 5ab60325133f..5ff9795c5122 100644
--- a/contrib/sendmail/src/trace.c
+++ b/contrib/sendmail/src/trace.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)trace.c 8.12 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)trace.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/udb.c b/contrib/sendmail/src/udb.c
index a279afff1552..e7f42af2ba91 100644
--- a/contrib/sendmail/src/udb.c
+++ b/contrib/sendmail/src/udb.c
@@ -14,9 +14,9 @@
#ifndef lint
#if USERDB
-static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (with USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (with USERDB)";
#else
-static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (without USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (without USERDB)";
#endif
#endif
@@ -49,7 +49,6 @@ struct udbent
{
char *udb_spec; /* string version of spec */
int udb_type; /* type of entry */
- pid_t udb_pid; /* PID of process which opened db */
char *udb_default; /* default host for outgoing mail */
union
{
@@ -92,7 +91,7 @@ struct udbent
#define MAXUDBENT 10 /* maximum number of UDB entries */
-struct udb_option
+struct option
{
char *name;
char *val;
@@ -141,7 +140,6 @@ udbexpand(a, sendq, aliaslevel, e)
register struct udbent *up;
int keylen;
int naddrs;
- char *user;
char keybuf[MAXKEY];
bzero(&key, sizeof key);
@@ -166,24 +164,20 @@ udbexpand(a, sendq, aliaslevel, e)
if (UdbSpec == NULL || UdbSpec[0] == '\0')
return EX_OK;
- /* extract user to do userdb matching on */
- user = a->q_user;
-
/* short circuit name begins with '\\' since it can't possibly match */
- /* (might want to treat this as unquoted instead) */
- if (user[0] == '\\')
+ if (a->q_user[0] == '\\')
return EX_OK;
/* if name is too long, assume it won't match */
- if (strlen(user) > (SIZE_T) sizeof keybuf - 12)
+ if (strlen(a->q_user) > (SIZE_T) sizeof keybuf - 12)
return EX_OK;
/* if name begins with a colon, it indicates our metadata */
- if (user[0] == ':')
+ if (a->q_user[0] == ':')
return EX_OK;
/* build actual database key */
- (void) strcpy(keybuf, user);
+ (void) strcpy(keybuf, a->q_user);
(void) strcat(keybuf, ":maildrop");
keylen = strlen(keybuf);
@@ -228,13 +222,8 @@ udbexpand(a, sendq, aliaslevel, e)
#else
i = 0;
if (dbc == NULL &&
-# if DB_VERSION_MAJOR > 2 || DB_VERSION_MINOR >=6
- (errno = (*up->udb_dbp->cursor)(up->udb_dbp,
- NULL, &dbc, 0)) != 0)
-# else
(errno = (*up->udb_dbp->cursor)(up->udb_dbp,
NULL, &dbc)) != 0)
-# endif
i = -1;
if (i != 0 || dbc == NULL ||
(errno = dbc->c_get(dbc, &key,
@@ -903,8 +892,8 @@ _udbx_init(e)
register struct hostent *h;
char *mxhosts[MAXMXHOSTS + 1];
# endif
- struct udb_option opts[MAXUDBOPTS + 1];
- extern int _udb_parsespec __P((char *, struct udb_option [], int));
+ struct option opts[MAXUDBOPTS + 1];
+ extern int _udb_parsespec __P((char *, struct option [], int));
while (*p == ' ' || *p == '\t' || *p == ',')
p++;
@@ -983,7 +972,6 @@ _udbx_init(e)
if (h == NULL)
continue;
up->udb_type = UDB_REMOTE;
- up->udb_pid = getpid();
up->udb_addr.sin_family = h->h_addrtype;
bcopy(h->h_addr_list[0],
(char *) &up->udb_addr.sin_addr,
@@ -1005,7 +993,6 @@ _udbx_init(e)
case '@': /* forward to remote host */
up->udb_type = UDB_FORWARD;
- up->udb_pid = getpid();
up->udb_fwdhost = spec + 1;
ents++;
up++;
@@ -1017,7 +1004,6 @@ _udbx_init(e)
if (strcasecmp(spec, "hesiod") != 0)
goto badspec;
up->udb_type = UDB_HESIOD;
- up->udb_pid = getpid();
ents++;
up++;
break;
@@ -1080,17 +1066,7 @@ _udbx_init(e)
free(up->udb_dbname);
break;
}
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: dbopen(%s)\n",
-#else
- printf("_udbx_init: db_open(%s)\n",
-#endif
- up->udb_dbname);
- }
up->udb_type = UDB_DBFETCH;
- up->udb_pid = getpid();
ents++;
up++;
break;
@@ -1162,15 +1138,6 @@ badspec:
#else
errno = (*up->udb_dbp->close)(up->udb_dbp, 0);
#endif
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: db->close(%s)\n",
-#else
- printf("_udbx_init: db->close(%s)\n",
-#endif
- up->udb_dbname);
- }
}
}
#endif
@@ -1180,7 +1147,7 @@ badspec:
int
_udb_parsespec(udbspec, opt, maxopts)
char *udbspec;
- struct udb_option opt[];
+ struct option opt[];
int maxopts;
{
register char *spec;
@@ -1206,52 +1173,6 @@ _udb_parsespec(udbspec, opt, maxopts)
}
return optnum;
}
- /*
-** _UDBX_CLOSE -- close all file based UDB entries.
-**
-** Parameters:
-** none
-**
-** Returns:
-** none
-*/
-void
-_udbx_close()
-{
- pid_t pid;
- struct udbent *up;
-
- if (!UdbInitialized)
- return;
-
- pid = getpid();
-
- for (up = UdbEnts; up->udb_type != UDB_EOLIST; up++)
- {
- if (up->udb_pid != pid)
- continue;
-
-#ifdef NEWDB
- if (up->udb_type == UDB_DBFETCH)
- {
-#if DB_VERSION_MAJOR < 2
- (*up->udb_dbp->close)(up->udb_dbp);
-#else
- errno = (*up->udb_dbp->close)(up->udb_dbp, 0);
-#endif
- }
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: db->close(%s)\n",
-#else
- printf("_udbx_init: db->close(%s)\n",
-#endif
- up->udb_dbname);
- }
-#endif
- }
-}
#ifdef HESIOD
diff --git a/contrib/sendmail/src/useful.h b/contrib/sendmail/src/useful.h
index a19dd9e0305d..2a283ab7b8be 100644
--- a/contrib/sendmail/src/useful.h
+++ b/contrib/sendmail/src/useful.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)useful.h 8.12 (Berkeley) 5/19/1998
+ * @(#)useful.h 8.12 (Berkeley) 5/19/98
*/
# include <sys/types.h>
diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c
index 99ea64696f03..23e4d0256933 100644
--- a/contrib/sendmail/src/usersmtp.c
+++ b/contrib/sendmail/src/usersmtp.c
@@ -14,9 +14,9 @@
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -118,7 +118,7 @@ smtpinit(m, mci, e)
*/
SmtpPhase = mci->mci_phase = "client greeting";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check);
if (r < 0)
goto tempfail1;
@@ -151,7 +151,7 @@ tryhelo:
smtpmessage("HELO %s", m, mci, MyHostName);
SmtpPhase = mci->mci_phase = "client HELO";
}
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_helo, helo_options);
if (r < 0)
goto tempfail1;
@@ -439,7 +439,7 @@ smtpmailfrom(m, mci, e)
*bufp == '@' ? ',' : ':', bufp, optbuf);
}
SmtpPhase = mci->mci_phase = "client MAIL";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_mail, NULL);
if (r < 0)
{
@@ -580,7 +580,7 @@ smtprcpt(to, m, mci, e)
smtpmessage("RCPT To:<%s>%s", m, mci, to->q_user, optbuf);
SmtpPhase = mci->mci_phase = "client RCPT";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_rcpt, NULL);
to->q_rstatus = newstr(SmtpReplyBuffer);
to->q_status = smtptodsn(r);
@@ -661,7 +661,7 @@ smtpdata(m, mci, e)
/* send the command and check ok to proceed */
smtpmessage("DATA", m, mci);
SmtpPhase = mci->mci_phase = "client DATA 354";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_datainit, NULL);
if (r < 0 || REPLYTYPE(r) == 4)
{
@@ -741,7 +741,7 @@ smtpdata(m, mci, e)
/* check for the results of the transaction */
SmtpPhase = mci->mci_phase = "client DATA status";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
if (bitnset(M_LMTP, m->m_flags))
return EX_OK;
r = reply(m, mci, e, TimeOuts.to_datafinal, NULL);
@@ -974,6 +974,7 @@ reply(m, mci, e, timeout, pfunc)
for (;;)
{
register char *p;
+ extern time_t curtime __P((void));
/* actually do the read */
if (e->e_xfp != NULL)
@@ -1007,10 +1008,7 @@ reply(m, mci, e, timeout, pfunc)
oldholderrs = HoldErrs;
HoldErrs = TRUE;
usrerr("451 reply: read error from %s", CurHostName);
-
- /* errors on QUIT should not be persistent */
- if (strncmp(SmtpMsgBuffer, "QUIT", 4) != 0)
- mci_setstat(mci, EX_TEMPFAIL, "4.4.2", MsgBuf);
+ mci_setstat(mci, EX_TEMPFAIL, "4.4.2", MsgBuf);
/* if debugging, pause so we can see state */
if (tTd(18, 100))
@@ -1034,8 +1032,7 @@ reply(m, mci, e, timeout, pfunc)
wbufleft -= plen;
}
snprintf(p, wbufleft, "reply(%.100s) during %s",
- CurHostName == NULL ? "NO_HOST" : CurHostName,
- SmtpPhase);
+ CurHostName, SmtpPhase);
checkfd012(wbuf);
}
#endif
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index 785d36269eb9..ba35dcd9531c 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c 8.167 (Berkeley) 12/1/1998";
+static char sccsid[] = "@(#)util.c 8.159 (Berkeley) 7/1/98";
#endif /* not lint */
# include "sendmail.h"
@@ -174,182 +174,6 @@ rfc822_string(s)
return TRUE;
}
/*
-** SHORTEN_RFC822_STRING -- Truncate and rebalance an RFC822 string
-**
-** Arbitratily shorten (in place) an RFC822 string and rebalance
-** comments and quotes.
-**
-** Parameters:
-** string -- the string to shorten
-** length -- the maximum size, 0 if no maximum
-**
-** Returns:
-** TRUE if string is changed, FALSE otherwise
-**
-** Side Effects:
-** Changes string in place, possibly resulting
-** in a shorter string.
-*/
-
-bool
-shorten_rfc822_string(string, length)
- char *string;
- size_t length;
-{
- bool backslash = FALSE;
- bool modified = FALSE;
- bool quoted = FALSE;
- size_t slen;
- int parencount = 0;
- char *ptr = string;
-
- /*
- ** If have to rebalance an already short enough string,
- ** need to do it within allocated space.
- */
- slen = strlen(string);
- if (length == 0 || slen < length)
- length = slen;
-
- while (*ptr != '\0')
- {
- if (backslash)
- {
- backslash = FALSE;
- goto increment;
- }
-
- if (*ptr == '\\')
- backslash = TRUE;
- else if (*ptr == '(')
- {
- if (!quoted)
- parencount++;
- }
- else if (*ptr == ')')
- {
- if (--parencount < 0)
- parencount = 0;
- }
-
- /* Inside a comment, quotes don't matter */
- if (parencount <= 0 && *ptr == '"')
- quoted = !quoted;
-
-increment:
- /* Check for sufficient space for next character */
- if (length - (ptr - string) <= ((backslash ? 1 : 0) +
- parencount +
- (quoted ? 1 : 0)))
- {
- /* Not enough, backtrack */
- if (*ptr == '\\')
- backslash = FALSE;
- else if (*ptr == '(' && !quoted)
- parencount--;
- else if (*ptr == '"' && parencount == 0)
- quoted = FALSE;
- break;
- }
- ptr++;
- }
-
- /* Rebalance */
- while (parencount-- > 0)
- {
- if (*ptr != ')')
- {
- modified = TRUE;
- *ptr = ')';
- }
- ptr++;
- }
- if (quoted)
- {
- if (*ptr != '"')
- {
- modified = TRUE;
- *ptr = '"';
- }
- ptr++;
- }
- if (*ptr != '\0')
- {
- modified = TRUE;
- *ptr = '\0';
- }
- return modified;
-}
- /*
-** FIND_CHARACTER -- find an unquoted character in an RFC822 string
-**
-** Find an unquoted, non-commented character in an RFC822
-** string and return a pointer to its location in the
-** string.
-**
-** Parameters:
-** string -- the string to search
-** character -- the character to find
-**
-** Returns:
-** pointer to the character, or
-** a pointer to the end of the line if character is not found
-*/
-
-char *
-find_character(string, character)
- char *string;
- char character;
-{
- bool backslash = FALSE;
- bool quoted = FALSE;
- int parencount = 0;
-
- while (string != NULL && *string != '\0')
- {
- if (backslash)
- {
- backslash = FALSE;
- if (!quoted && character == '\\' && *string == '\\')
- break;
- string++;
- continue;
- }
- switch (*string)
- {
- case '\\':
- backslash = TRUE;
- break;
-
- case '(':
- if (!quoted)
- parencount++;
- break;
-
- case ')':
- if (--parencount < 0)
- parencount = 0;
- break;
- }
-
- /* Inside a comment, nothing matters */
- if (parencount > 0)
- {
- string++;
- continue;
- }
-
- if (*string == '"')
- quoted = !quoted;
- else if (*string == character && !quoted)
- break;
- string++;
- }
-
- /* Return pointer to the character */
- return string;
-}
- /*
** XALLOC -- Allocate memory and bitch wildly on failure.
**
** THIS IS A CLUDGE. This should be made to give a proper
@@ -2022,13 +1846,7 @@ path_is_dir(pathname, createflag)
** none
*/
-struct procs
-{
- pid_t proc_pid;
- char *proc_task;
-};
-
-static struct procs *ProcListVec = NULL;
+static pid_t *ProcListVec = NULL;
static int ProcListSize = 0;
#define NO_PID ((pid_t) 0)
@@ -2037,15 +1855,15 @@ static int ProcListSize = 0;
#endif
void
-proc_list_add(pid, task)
+proc_list_add(pid)
pid_t pid;
- char *task;
{
int i;
+ extern void proc_list_probe __P((void));
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
break;
}
if (i >= ProcListSize)
@@ -2056,66 +1874,29 @@ proc_list_add(pid, task)
/* now scan again */
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
break;
}
}
if (i >= ProcListSize)
{
/* grow process list */
- struct procs *npv;
+ pid_t *npv;
- npv = (struct procs *) xalloc(sizeof (struct procs) * (ProcListSize + PROC_LIST_SEG));
+ npv = (pid_t *) xalloc(sizeof (pid_t) * (ProcListSize + PROC_LIST_SEG));
if (ProcListSize > 0)
{
- bcopy(ProcListVec, npv, ProcListSize *
- sizeof (struct procs));
+ bcopy(ProcListVec, npv, ProcListSize * sizeof (pid_t));
free(ProcListVec);
}
for (i = ProcListSize; i < ProcListSize + PROC_LIST_SEG; i++)
- {
- npv[i].proc_pid = NO_PID;
- npv[i].proc_task = NULL;
- }
+ npv[i] = NO_PID;
i = ProcListSize;
ProcListSize += PROC_LIST_SEG;
ProcListVec = npv;
}
- ProcListVec[i].proc_pid = pid;
- ProcListVec[i].proc_task = newstr(task);
-
- /* if process adding itself, it's not a child */
- if (pid != getpid())
- CurChildren++;
-}
- /*
-** PROC_LIST_SET -- set pid task in process list
-**
-** Parameters:
-** pid -- pid to set
-** task -- task of pid
-**
-** Returns:
-** none.
-*/
-
-void
-proc_list_set(pid, task)
- pid_t pid;
- char *task;
-{
- int i;
-
- for (i = 0; i < ProcListSize; i++)
- {
- if (ProcListVec[i].proc_pid == pid)
- {
- if (ProcListVec[i].proc_task != NULL)
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = newstr(task);
- break;
- }
- }
+ ProcListVec[i] = pid;
+ CurChildren++;
}
/*
** PROC_LIST_DROP -- drop pid from process list
@@ -2135,14 +1916,9 @@ proc_list_drop(pid)
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == pid)
+ if (ProcListVec[i] == pid)
{
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
+ ProcListVec[i] = NO_PID;
break;
}
}
@@ -2164,16 +1940,8 @@ proc_list_clear()
{
int i;
- /* start from 1 since 0 is the daemon itself */
- for (i = 1; i < ProcListSize; i++)
- {
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
- }
+ for (i = 0; i < ProcListSize; i++)
+ ProcListVec[i] = NO_PID;
CurChildren = 0;
}
/*
@@ -2191,23 +1959,17 @@ proc_list_probe()
{
int i;
- /* start from 1 since 0 is the daemon itself */
- for (i = 1; i < ProcListSize; i++)
+ for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
continue;
- if (kill(ProcListVec[i].proc_pid, 0) < 0)
+ if (kill(ProcListVec[i], 0) < 0)
{
if (LogLevel > 3)
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"proc_list_probe: lost pid %d",
- (int) ProcListVec[i].proc_pid);
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
+ ProcListVec[i]);
+ ProcListVec[i] = NO_PID;
CurChildren--;
}
}
@@ -2215,35 +1977,6 @@ proc_list_probe()
CurChildren = 0;
}
/*
-** PROC_LIST_DISPLAY -- display the process list
-**
-** Parameters:
-** out -- output file pointer
-**
-** Returns:
-** none.
-*/
-
-void
-proc_list_display(out)
- FILE *out;
-{
- int i;
-
- for (i = 0; i < ProcListSize; i++)
- {
- if (ProcListVec[i].proc_pid == NO_PID)
- continue;
-
- fprintf(out, "%d %s%s\n", (int) ProcListVec[i].proc_pid,
- ProcListVec[i].proc_task != NULL ?
- ProcListVec[i].proc_task : "(unknown)",
- (OpMode == MD_SMTP ||
- OpMode == MD_DAEMON ||
- OpMode == MD_ARPAFTP) ? "\r" : "");
- }
-}
- /*
** SM_STRCASECMP -- 8-bit clean version of strcasecmp
**
** Thank you, vendors, for making this all necessary.
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index 8e8707b7a9f5..bf0b3918adc4 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.9.2.1 (Berkeley) 12/29/1998";
+static char sccsid[] = "@(#)version.c 8.9.1.1 (Berkeley) 7/2/98";
#endif /* not lint */
-char Version[] = "8.9.2";
+char Version[] = "8.9.1";
diff --git a/contrib/sendmail/test/Results b/contrib/sendmail/test/Results
index e31a68bf9a25..3d930daa129d 100644
--- a/contrib/sendmail/test/Results
+++ b/contrib/sendmail/test/Results
@@ -60,7 +60,6 @@ Linux 0.99p14 OK 93.11.30 Christian Kuhtz <chk@data-hh.Hanse.DE>
Linux 1.0 OK 94.03.19 Shayne Smith <snsmith@rastus.brisnet.org.au>
Linux 1.2.13 OK 95.11.02 Sven Neuhaus <sven@ping.de>
Linux 2.0.17 OK 96.09.03 Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
-Linux 2.1.109 OK 98.07.21 John Kennedy <jk@csuchico.edu>
BSD/386 1.0 OK 93.11.13 Tony Sanders
@@ -82,7 +81,6 @@ Solaris 2.5.1 OK 96.11.29 Gregory Neil Shapiro <gshapiro@wpi.edu>
Linux 1.2.13 FAIL 95.11.02 Sven Neuhaus <sven@ping.de>
Linux 2.0.17 FAIL 96.09.03 Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
-Linux 2.1.109 FAIL 98.07.21 John Kennedy <jk@csuchico.edu>
AIX 4.1 OK 96.10.21 Hakan Lindholm <hakan@af.lu.se>
diff --git a/contrib/sys/softupdates/ffs_softdep.c b/contrib/sys/softupdates/ffs_softdep.c
index 433cafe5faf5..c4a2cd80702f 100644
--- a/contrib/sys/softupdates/ffs_softdep.c
+++ b/contrib/sys/softupdates/ffs_softdep.c
@@ -54,7 +54,7 @@
* SUCH DAMAGE.
*
* from: @(#)ffs_softdep.c 9.28 (McKusick) 8/8/98
- * $Id: ffs_softdep.c,v 1.19 1999/01/06 18:18:04 bde Exp $
+ * $Id: ffs_softdep.c,v 1.14 1998/09/24 15:02:46 luoqi Exp $
*/
/*
@@ -982,7 +982,7 @@ softdep_mount(devvp, mp, fs, cred)
}
#ifdef DEBUG
if (!bcmp(&cstotal, &fs->fs_cstotal, sizeof cstotal))
- printf("ffs_mountfs: superblock updated for soft updates\n");
+ printf("ffs_mountfs: superblock updated\n");
#endif
bcopy(&cstotal, &fs->fs_cstotal, sizeof cstotal);
return (0);
@@ -1261,7 +1261,7 @@ allocdirect_merge(adphead, newadp, oldadp)
if (newadp->ad_oldblkno != oldadp->ad_newblkno ||
newadp->ad_oldsize != oldadp->ad_newsize ||
newadp->ad_lbn >= NDADDR)
- panic("allocdirect_check: old %d != new %d || lbn %ld >= %d",
+ panic("allocdirect_check: old %d != new %d || lbn %d >= %d",
newadp->ad_oldblkno, oldadp->ad_newblkno, newadp->ad_lbn,
NDADDR);
newadp->ad_oldblkno = oldadp->ad_oldblkno;
@@ -1664,8 +1664,8 @@ softdep_setup_freeblocks(ip, length)
tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "sdsetf", 0);
ACQUIRE_LOCK_INTERLOCKED(&lk);
}
- while (getdirtybuf(&TAILQ_FIRST(&vp->v_dirtyblkhd), MNT_WAIT)) {
- bp = TAILQ_FIRST(&vp->v_dirtyblkhd);
+ while (getdirtybuf(&LIST_FIRST(&vp->v_dirtyblkhd), MNT_WAIT)) {
+ bp = LIST_FIRST(&vp->v_dirtyblkhd);
(void) inodedep_lookup(fs, ip->i_number, 0, &inodedep);
deallocate_dependencies(bp, inodedep);
bp->b_flags |= B_INVAL | B_NOCACHE;
@@ -2827,12 +2827,12 @@ initiate_write_inodeblock(inodedep, bp)
prevlbn = adp->ad_lbn;
if (adp->ad_lbn < NDADDR &&
dp->di_db[adp->ad_lbn] != adp->ad_newblkno)
- panic("%s: direct pointer #%ld mismatch %d != %d",
+ panic("%s: direct pointer #%d mismatch %d != %d",
"softdep_write_inodeblock", adp->ad_lbn,
dp->di_db[adp->ad_lbn], adp->ad_newblkno);
if (adp->ad_lbn >= NDADDR &&
dp->di_ib[adp->ad_lbn - NDADDR] != adp->ad_newblkno)
- panic("%s: indirect pointer #%ld mismatch %d != %d",
+ panic("%s: indirect pointer #%d mismatch %d != %d",
"softdep_write_inodeblock", adp->ad_lbn - NDADDR,
dp->di_ib[adp->ad_lbn - NDADDR], adp->ad_newblkno);
deplist |= 1 << adp->ad_lbn;
@@ -3137,9 +3137,11 @@ handle_written_inodeblock(inodedep, bp)
struct inodedep *inodedep;
struct buf *bp; /* buffer containing the inode block */
{
+ struct pagedep *pagedep;
struct worklist *wk, *filefree;
struct allocdirect *adp, *nextadp;
struct dinode *dp;
+ struct diradd *dap;
int hadchanges;
if ((inodedep->id_state & IOSTARTED) == 0)
@@ -3173,14 +3175,14 @@ handle_written_inodeblock(inodedep, bp)
panic("handle_written_inodeblock: new entry");
if (adp->ad_lbn < NDADDR) {
if (dp->di_db[adp->ad_lbn] != adp->ad_oldblkno)
- panic("%s: %s #%ld mismatch %d != %d",
+ panic("%s: %s #%d mismatch %d != %d",
"handle_written_inodeblock",
"direct pointer", adp->ad_lbn,
dp->di_db[adp->ad_lbn], adp->ad_oldblkno);
dp->di_db[adp->ad_lbn] = adp->ad_newblkno;
} else {
if (dp->di_ib[adp->ad_lbn - NDADDR] != 0)
- panic("%s: %s #%ld allocated as %d",
+ panic("%s: %s #%d allocated as %d",
"handle_written_inodeblock",
"indirect pointer", adp->ad_lbn - NDADDR,
dp->di_ib[adp->ad_lbn - NDADDR]);
@@ -3430,6 +3432,7 @@ softdep_load_inodeblock(ip)
struct inode *ip; /* the "in_core" copy of the inode */
{
struct inodedep *inodedep;
+ int error, gotit;
/*
* Check for alternate nlink count.
@@ -3463,7 +3466,7 @@ void
softdep_update_inodeblock(ip, bp, waitfor)
struct inode *ip; /* the "in_core" copy of the inode */
struct buf *bp; /* the buffer containing the inode block */
- int waitfor; /* nonzero => update must be allowed */
+ int waitfor; /* 1 => update must be allowed */
{
struct inodedep *inodedep;
struct worklist *wk;
@@ -3583,9 +3586,7 @@ softdep_fsync(vp)
struct fs *fs;
struct proc *p = CURPROC; /* XXX */
int error, ret, flushparent;
-#ifndef __FreeBSD__
struct timeval tv;
-#endif
ino_t parentino;
ufs_lbn_t lbn;
@@ -3652,13 +3653,12 @@ softdep_fsync(vp)
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
if (flushparent) {
-#ifdef __FreeBSD__
- error = UFS_UPDATE(pvp, 1);
-#else
+#ifndef __FreeBSD__
tv = time;
- error = UFS_UPDATE(pvp, &tv, &tv, 1);
-#endif
- if (error) {
+#else
+ getmicrotime(&tv);
+#endif /* __FreeBSD__ */
+ if (error = UFS_UPDATE(pvp, &tv, &tv, MNT_WAIT)) {
vput(pvp);
return (error);
}
@@ -3740,7 +3740,7 @@ softdep_sync_metadata(ap)
*/
waitfor = MNT_NOWAIT;
top:
- if (getdirtybuf(&TAILQ_FIRST(&vp->v_dirtyblkhd), MNT_WAIT) == 0) {
+ if (getdirtybuf(&LIST_FIRST(&vp->v_dirtyblkhd), MNT_WAIT) == 0) {
while (vp->v_numoutput) {
vp->v_flag |= VBWAIT;
FREE_LOCK_INTERLOCKED(&lk);
@@ -3751,7 +3751,7 @@ top:
FREE_LOCK(&lk);
return (0);
}
- bp = TAILQ_FIRST(&vp->v_dirtyblkhd);
+ bp = LIST_FIRST(&vp->v_dirtyblkhd);
loop:
/*
* As we hold the buffer locked, none of its dependencies
@@ -3850,8 +3850,8 @@ loop:
/* NOTREACHED */
}
}
- (void) getdirtybuf(&TAILQ_NEXT(bp, b_vnbufs), MNT_WAIT);
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ (void) getdirtybuf(&LIST_NEXT(bp, b_vnbufs), MNT_WAIT);
+ nbp = LIST_NEXT(bp, b_vnbufs);
FREE_LOCK(&lk);
bawrite(bp);
ACQUIRE_LOCK(&lk);
@@ -3887,7 +3887,7 @@ loop:
* then we are done. For certain directories and block
* devices, we may need to do further work.
*/
- if (TAILQ_FIRST(&vp->v_dirtyblkhd) == NULL) {
+ if (LIST_FIRST(&vp->v_dirtyblkhd) == NULL) {
FREE_LOCK(&lk);
return (0);
}
@@ -4012,9 +4012,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
struct inodedep *inodedep;
struct ufsmount *ump;
struct diradd *dap;
-#ifndef __FreeBSD__
struct timeval tv;
-#endif
struct vnode *vp;
int gotit, error = 0;
struct buf *bp;
@@ -4027,14 +4025,13 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
* has a MKDIR_PARENT dependency.
*/
if (dap->da_state & MKDIR_PARENT) {
- FREE_LOCK(&lk);
-#ifdef __FreeBSD__
- error = UFS_UPDATE(pvp, 1);
-#else
+#ifndef __FreeBSD__
tv = time;
- error = UFS_UPDATE(pvp, &tv, &tv, 1);
-#endif
- if (error)
+#else
+ getmicrotime(&tv);
+#endif /* __FreeBSD__ */
+ FREE_LOCK(&lk);
+ if (error = UFS_UPDATE(pvp, &tv, &tv, MNT_WAIT))
break;
ACQUIRE_LOCK(&lk);
/*
@@ -4116,12 +4113,12 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
}
FREE_LOCK(&lk);
}
-#ifdef __FreeBSD__
- error = UFS_UPDATE(vp, 1);
-#else
+#ifndef __FreeBSD__
tv = time;
- error = UFS_UPDATE(vp, &tv, &tv, 1);
-#endif
+#else
+ getmicrotime(&tv);
+#endif /* __FreeBSD__ */
+ error = UFS_UPDATE(vp, &tv, &tv, MNT_WAIT);
vput(vp);
if (error)
break;
diff --git a/contrib/tcpdump/tcpdump.1 b/contrib/tcpdump/tcpdump.1
index 9781c49d8362..a7775ebe9c36 100644
--- a/contrib/tcpdump/tcpdump.1
+++ b/contrib/tcpdump/tcpdump.1
@@ -646,7 +646,7 @@ ping packets):
.RS
.nf
.B
-tcpdump 'icmp[0] != 8 and icmp[0] != 0'
+tcpdump 'icmp[0] != 8 and icmp[0] != 0"
.fi
.RE
.SH OUTPUT FORMAT
@@ -1190,7 +1190,7 @@ is made to account for the time lag between when the
ethernet interface removed the packet from the wire and when the kernel
serviced the `new packet' interrupt.
.SH "SEE ALSO"
-bpf(4), pcap(3)
+traffic(1C), nit(4P), bpf(4), pcap(3)
.SH AUTHORS
Van Jacobson,
Craig Leres and
diff --git a/contrib/texinfo/ABOUT-NLS b/contrib/texinfo/ABOUT-NLS
deleted file mode 100644
index dacb8b18bed2..000000000000
--- a/contrib/texinfo/ABOUT-NLS
+++ /dev/null
@@ -1,225 +0,0 @@
-Notes on the Free Translation Project
-*************************************
-
- Free software is going international! The Free Translation Project
-is a way to get maintainers of free software, translators, and users all
-together, so that will gradually become able to speak many languages.
-A few packages already provide translations for their messages.
-
- If you found this `ABOUT-NLS' file inside a distribution, you may
-assume that the distributed package does use GNU `gettext' internally,
-itself available at your nearest GNU archive site. But you do *not*
-need to install GNU `gettext' prior to configuring, installing or using
-this package with messages translated.
-
- Installers will find here some useful hints. These notes also
-explain how users should proceed for getting the programs to use the
-available translations. They tell how people wanting to contribute and
-work at translations should contact the appropriate team.
-
- When reporting bugs in the `intl/' directory or bugs which may be
-related to internationalization, you should tell about the version of
-`gettext' which is used. The information can be found in the
-`intl/VERSION' file, in internationalized packages.
-
-One advise in advance
-=====================
-
- If you want to exploit the full power of internationalization, you
-should configure it using
-
- ./configure --with-included-gettext
-
-to force usage of internationalizing routines provided within this
-package, despite the existence of internationalizing capabilities in the
-operating system where this package is being installed. So far, only
-the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias or message inheritance) as the
-implementation here. It is also not possible to offer this additional
-functionality on top of a `catgets' implementation. Future versions of
-GNU `gettext' will very likely convey even more functionality. So it
-might be a good idea to change to GNU `gettext' as soon as possible.
-
- So you need not provide this option if you are using GNU libc 2 or
-you have installed a recent copy of the GNU gettext package with the
-included `libintl'.
-
-INSTALL Matters
-===============
-
- Some packages are "localizable" when properly installed; the
-programs they contain can be made to speak your own native language.
-Most such packages use GNU `gettext'. Other packages have their own
-ways to internationalization, predating GNU `gettext'.
-
- By default, this package will be installed to allow translation of
-messages. It will automatically detect whether the system provides
-usable `catgets' (if using this is selected by the installer) or
-`gettext' functions. If neither is available, the GNU `gettext' own
-library will be used. This library is wholly contained within this
-package, usually in the `intl/' subdirectory, so prior installation of
-the GNU `gettext' package is *not* required. Installers may use
-special options at configuration time for changing the default
-behaviour. The commands:
-
- ./configure --with-included-gettext
- ./configure --with-catgets
- ./configure --disable-nls
-
-will respectively bypass any pre-existing `catgets' or `gettext' to use
-the internationalizing routines provided within this package, enable
-the use of the `catgets' functions (if found on the locale system), or
-else, *totally* disable translation of messages.
-
- When you already have GNU `gettext' installed on your system and run
-configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl.a' file and
-will decide to use this. This might be not what is desirable. You
-should use the more recent version of the GNU `gettext' library. I.e.
-if the file `intl/VERSION' shows that the library which comes with this
-package is more recent, you should use
-
- ./configure --with-included-gettext
-
-to prevent auto-detection.
-
- By default the configuration process will not test for the `catgets'
-function and therefore they will not be used. The reasons are already
-given above: the emulation on top of `catgets' cannot provide all the
-extensions provided by the GNU `gettext' library. If you nevertheless
-want to use the `catgets' functions use
-
- ./configure --with-catgets
-
-to enable the test for `catgets' (this causes no harm if `catgets' is
-not available on your system). If you really select this option we
-would like to hear about the reasons because we cannot think of any
-good one ourself.
-
- Internationalized packages have usually many `po/LL.po' files, where
-LL gives an ISO 639 two-letter code identifying the language. Unless
-translations have been forbidden at `configure' time by using the
-`--disable-nls' switch, all available translations are installed
-together with the package. However, the environment variable `LINGUAS'
-may be set, prior to configuration, to limit the installed set.
-`LINGUAS' should then contain a space separated list of two-letter
-codes, stating which languages are allowed.
-
-Using This Package
-==================
-
- As a user, if your language has been installed for this package, you
-only have to set the `LANG' environment variable to the appropriate
-ISO 639 `LL' two-letter code prior to using the programs in the
-package. For example, let's suppose that you speak German. At the
-shell prompt, merely execute `setenv LANG de' (in `csh'),
-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
-can be done from your `.login' or `.profile' file, once and for all.
-
- An operating system might already offer message localization for
-many of its programs, while other programs have been installed locally
-with the full capabilities of GNU `gettext'. Just using `gettext'
-extended syntax for `LANG' would break proper localization of already
-available operating system programs. In this case, users should set
-both `LANGUAGE' and `LANG' variables in their environment, as programs
-using GNU `gettext' give preference to `LANGUAGE'. For example, some
-Swedish users would rather read translations in German than English for
-when Swedish is not available. This is easily accomplished by setting
-`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
-
-Translating Teams
-=================
-
- For the Free Translation Project to be a success, we need interested
-people who like their own language and write it well, and who are also
-able to synergize with other translators speaking the same language.
-Each translation team has its own mailing list, courtesy of Linux
-International. You may reach your translation team at the address
-`LL@li.org', replacing LL by the two-letter ISO 639 code for your
-language. Language codes are *not* the same as the country codes given
-in ISO 3166. The following translation teams exist, as of August 1997:
-
- Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
- Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
- `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
- Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
- `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
- Swedish `sv', and Turkish `tr'.
-
-For example, you may reach the Chinese translation team by writing to
-`zh@li.org'.
-
- If you'd like to volunteer to *work* at translating messages, you
-should become a member of the translating team for your own language.
-The subscribing address is *not* the same as the list itself, it has
-`-request' appended. For example, speakers of Swedish can send a
-message to `sv-request@li.org', having this message body:
-
- subscribe
-
- Keep in mind that team members are expected to participate
-*actively* in translations, or at solving translational difficulties,
-rather than merely lurking around. If your team does not exist yet and
-you want to start one, or if you are unsure about what to do or how to
-get started, please write to `translation@iro.umontreal.ca' to reach the
-coordinator for all translator teams.
-
- The English team is special. It works at improving and uniformizing
-the terminology in use. Proven linguistic skill are praised more than
-programming skill, here.
-
-Available Packages
-==================
-
- Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of August
-1997. The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination.
-
- Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
- .-------------------------------------------------.
- bash | [] [] [] | 3
- bison | [] [] [] | 3
- clisp | [] [] [] [] | 4
- cpio | [] [] [] [] [] | 5
- diffutils | [] [] [] [] [] | 5
- enscript | [] [] [] [] [] [] | 6
- fileutils | [] [] [] [] [] [] [] [] [] [] | 10
- findutils | [] [] [] [] [] [] [] [] | 8
- flex | [] [] [] [] | 4
- gcal | [] [] [] [] [] | 5
- gettext | [] [] [] [] [] [] [] [] [] [] | 11
- grep | [] [] [] [] [] [] [] [] [] | 9
- hello | [] [] [] [] [] [] [] [] [] [] | 10
- id-utils | [] [] [] | 3
- indent | [] [] [] [] | 4
- libc | [] [] [] [] [] [] [] | 7
- m4 | [] [] [] [] [] | 5
- make | [] [] [] [] [] [] | 6
- music | [] [] | 2
- ptx | [] [] [] [] [] [] [] [] | 8
- recode | [] [] [] [] [] [] [] [] [] | 9
- sh-utils | [] [] [] [] [] [] [] | 7
- sharutils | [] [] [] [] [] | 5
- tar | [] [] [] [] [] [] [] [] [] [] | 10
- texinfo | [] | 1
- textutils | [] [] [] [] [] [] [] [] [] | 9
- wdiff | [] [] [] [] [] [] [] [] | 8
- `-------------------------------------------------'
- 16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
- 27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
-
- Some counters in the preceding matrix are higher than the number of
-visible blocks let us expect. This is because a few extra PO files are
-used for implementing regional variants of languages, or language
-dialects.
-
- For a PO file in the matrix above to be effective, the package to
-which it applies should also have been internationalized and
-distributed as such by its maintainer. There might be an observable
-lag between the mere existence a PO file and its wide availability in a
-distribution.
-
- If August 1997 seems to be old, you may fetch a more recent copy of
-this `ABOUT-NLS' file on most GNU archive sites.
-
diff --git a/contrib/texinfo/AUTHORS b/contrib/texinfo/AUTHORS
deleted file mode 100644
index 647ea29772d4..000000000000
--- a/contrib/texinfo/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Richard Stallman, Brian Fox, Bob Chassell, Noah Friedman, Paul Rubin,
-Karl Berry, and no doubt many others.
-
diff --git a/contrib/texinfo/COPYING b/contrib/texinfo/COPYING
index eeb586b392a5..916d1f0f2842 100644
--- a/contrib/texinfo/COPYING
+++ b/contrib/texinfo/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -305,8 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
diff --git a/contrib/texinfo/ChangeLog b/contrib/texinfo/ChangeLog
index 8e3fb78ebe7e..06d0464a688f 100644
--- a/contrib/texinfo/ChangeLog
+++ b/contrib/texinfo/ChangeLog
@@ -1,1120 +1,3 @@
-Tue Mar 3 13:29:17 1998 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: Version 3.12.
-
- * po/de.po: New version.
-
- * po/POTFILES.in: Do not include doc.c; that gets built at
- runtime, thus causing texinfo.pot to try to get rebuilt. Besides,
- it doesn't have any translatable strings.
-
-Sun Mar 1 10:38:47 1998 Karl Berry <karl@cs.umb.edu>
-
- * util/install-info.c: No need for i18n on version message. From
- ke@suse.de.
-
-Fri Feb 27 16:06:23 1998 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: Run texconfig conf instead of confall.
-
- * doc/Makefile.am (INSTALL_INFO): New variable.
- (install-info-am): Use install-info from our distribution.
-
- * info/info.c (info_minor_version): Increment.
- * (info_patch_level),
- * info/info.h (info_patch_level): Remove.
-
- * info/info.c (program_name): Move decl.
-
- * util/install-info.c (ensure_dirfile_exists): Use commas and \t
- instead of an explicit tab, which make dist expands.
-
- * doc/texinfo.txi: @prep.ai.mit.edu -> @gnu.org.
-
- * info/info.c: Make help messages consistent with others.
-
- * util/install-info.c (print_help): Format consistently.
-
- (readfile): Support gzipped files via libz.
- From: Elliot Lee <sopwith@redhat.com>
- Date: Mon, 1 Sep 1997 23:37:14 -0400 (EDT)
-
-Thu Feb 26 16:13:14 1998 Karl Berry <karl@cs.umb.edu>
-
- * info/echo-area.c: Whoops, _ might not start with parens.
-
- * configure.in: Check for libz.
- Do not output emacs/Makefile.
-
- * Makefile.am (AUTOMAKE_OPTIONS): Set to 1.2f.
-
- * util/texi2dvi: Always remove temporary directories. (From Akim.)
- Formatting changes.
-
-Wed Feb 25 15:26:26 1998 Karl Berry <karl@cs.umb.edu>
-
- * util/texi2dvi: New options --batch, --clean.
- From: Akim Demaille <demaille@inf.enst.fr>
- Date: 15 Aug 1997 18:05:33 +0200
- * doc/texinfo.txi (Format with texi2dvi): Mention --help.
-
- Applied this:
-1997-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * makeinfo/makeinfo.c (me_executing_string): New variable.
- (me_execute_string): Use it instead of executing_string.
- (popfile): Check for me_executing_string as well as
- executing_string.
- (get_until_in_line): Likewise.
- (insert_and_underscore): Do not write any expansion output if
- executing a string.
- (cm_node, cm_include, index_add_arg, cm_footnote, execute_macro,
- cm_macro, cm_unmacro): Likewise.
- (cm_footnote): Include the footnote marker in the expansion
- output.
- (append_to_expansion_output): Do nothing if the input_text wasn't
- a remembered text.
- (defun_internal): Make the index entry even if expanding macros.
- (expansion): Don't reset macro_expansion_output_stream around call
- to execute_string.
- (apply): Fix typo.
-
-Tue Feb 24 17:33:44 1998 Karl Berry <karl@cs.umb.edu>
-
- 1997-11-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- * makeinfo/makeinfo.c (get_until_in_line): Don't use xstrdup on
- the unterminated input_text.
-
- * makeinfo/makeinfo.c: Don't assume all \'s in macro bodies are
- arguments.
- From: Mathias.Herberts@irisa.fr (Mathias Herberts)
- Date: Tue, 6 Jan 1998 18:54:26 +0100
-
- * configure.in: Check for sigblock in libc before libbsd.
- * From: hjl@lucon.org (H.J. Lu)
- * Date: Fri, 23 Jan 1998 21:50:25 -0800 (PST)
-
-Mon Feb 23 16:26:31 1998 Karl Berry <karl@cs.umb.edu>
-
- * info/window.c (character_width): If ISO_Latin_p is set, make
- printable_limit 255, not 160. ISO Latin 1 uses
- essentially all of the 256 characters.
- Reported by: Marius Groeger <mag@sysgo.de>
- Date: Wed, 17 Dec 1997 16:05:27 +0100
-
- * info/info.c: Improve help message.
-
-Sun Feb 22 17:38:32 1998 Karl Berry <karl@cs.umb.edu>
-
- * Makefile.am (SUBDIRS): Remove emacs; we'll just distribute the
- Elisp files with Emacs.
-
- * doc/Makefile.am (info_TEXINFOS, texinfo): Rename manual to
- texinfo.txi to avoid DOS filename clash with texinfo.tex.
-
- * info/tilde.c: Copy slightly updated alloca stuff from makeinfo.
-
- * util/texindex.c (main): Declare as returning int to placate
- warnings.
-
- * info/Makefile.am: Uncomment BUILT_SOURCES stuff and add missing _.
- From: "Joel N. Weber II" <devnull@gnu.org>
- Date: Fri, 30 Jan 1998 17:21:38 -1000
-
- * util/texindex.c,
- * util/install-info.c,
- * makeinfo/makeinfo.c,
- * info/info.c: Change help address to @gnu.org.
-
- 1998-01-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- * makeinfo/makeinfo.c (usage): Fix order of arguments to help
- format string.
-
- * makeinfo/makeinfo.c (cm_top): Error message wording.
-
- * doc/texinfo.texi (Functions in Typed Languages): Remove
- duplicate description of @deftypemethod.
- From: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise)
- Date: Wed, 07 Jan 1998 11:11:50 +0100
-
- * info/session.c (info_get_input_char) [EINTR]: Keep reading if we
- get EINTR.
- From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Date: 22 Dec 1997 10:32:53 +0100
-
-Sat Feb 21 17:41:26 1998 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (find_and_load): Malloc enough room for the
- null as well as the newline.
- From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
- Date: Tue, 30 Sep 1997 21:12:01 -0500
-
- * util/texindex.c (--version),
- * makeinfo/makeinfo.c (cm_today),
- * makeinfo/makeinfo.c (print_version_info): Version strings etc. do not
- need translation.
- From: Karl Eichwalder <ke@suse.de>
- Date: 13 Sep 1997 16:20:02 +0200
-
- * info/echo-area.c: Rewrite pluralization to be translatable.
- From: Karl Eichwalder <ke@suse.de>
- Date: 13 Sep 1997 16:20:02 +0200
-
- * util/texindex.c,
- * info/info.c,
- * makeinfo/makeinfo.c,
- * util/install-info.c: --version: Give year as argument to printf,
- to reduce the number of translations needed.
- From: Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
- Date: 02 Sep 1997 18:01:26 +0200
-
- * util/texindex.c: Remove the fnctl.h and sys/file.h conditional #includes, they are
- already in lib/system.h.
- From: "Philippe De Muyter" <phdm@macqel.be>
- Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST)
-
- * info/terminal.c (terminal_begin_using_terminal,
- terminal_end_using_terminal): #ifdef SIGWINCH settings for
- m68k-motorola-sysv.
- From: "Philippe De Muyter" <phdm@macqel.be>
- Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST)
-
- * info/filesys.c (info_suffixes): Add /index as a possibility for
- subdirectories.
- From: Matthew Wilcox <willy@odie.barnet.ac.uk>
- Date: Wed, 6 Aug 1997 15:55:16 +0100 (BST)
-
- * configure.in: Redirect texconfig input from /dev/null to avoid
- stoppage.
- From: Thomas Esser <te@informatik.uni-hannover.de>
- Date: Mon, 4 Aug 1997 18:15:49 +0200
-
- * makeinfo/makeinfo.c (find_and_load): Null-terminate the input text.
- From: Kenneth Stailey <kstailey@disclosure.com>.
-
- * info/Makefile.am (INCLUDES): Add -I.. -I$(srcdir).
-
-Fri Aug 22 16:24:59 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Adjust ISBN, edition number for print run.
-
-Mon Aug 4 16:12:42 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/info.c (main) [INFODIR]: Add this to infopath, if set.
- * info/Makefile.am (DEFS): New define, include -DINFODIR.
- From: Larry Schwimmer <rosebud@cyclone.Stanford.EDU>.
-
- * util/install-info.c (ensure_dirfile_exists): Use tabs instead of
- spaces on the File: dir line.
- Bug from: Dave Love <d.love@dl.ac.uk>.
-
-Sat Aug 2 12:43:57 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (cm_value, cm_email, cm_uref): Have to cast
- from unsigned char * to char * or IRIX cc complains.
- From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>.
-
-Fri Aug 1 14:05:10 1997 Karl Berry <karl@cs.umb.edu>
-
- * Makefile.am (EXTRA_DIST): Remove README-alpha.
- From: "ir. Mark M._Kettenis" <kettenis@phys.uva.nl>.
-
-1997-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure.in: Use AC_CHECK_HEADERS, not AC_CHECK_HEADER.
-
-Thu Jul 31 11:57:46 1997 Karl Berry <karl@cs.umb.edu>
-
- * Version 3.11.
-
- * info/man.c (reap_children): Declare status as int, not unsigned,
- since that's what POSIX says the arg to wait should be.
-
- * makeinfo/makeinfo.c (cm_uref, cm_email): Rewrite to do macro
- expansion in the arguments.
-
- * makeinfo/makeinfo.c (main): setlocale LC_MESSAGES and LC_TIME,
- instead of LC_ALL.
- From: Akim Demaille <demaille@inf.enst.fr>.
-
- * makeinfo/makeinfo.c (cm_today): Let the %d %s %d be translated,
- so other languages can change the order of day/month/year.
- From: Akim Demaille <demaille@inf.enst.fr>.
-
- * info/infomap.c: Doc fix.
-
- * lib/system.h [!O_RDONLY]: Prefer <fcntl.h> to <sys/fcntl.h>.
-
- * configure.in (AC_CHECK_HEADERS): Check for fcntl.h.
-
- * doc/Makefile.am (install-data-local): Suggest tex/generic/dvips
- for epsf.tex.
- From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>.
-
- * configure.in (TEXMF): Move check to block with other program
- checks.
-
-Wed Jul 30 11:20:37 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (defun_internal): Allow extra text after
- most @def... commands, for tzname[2] in libc.texinfo.
-
- * info/info.c: Include indices.h.
- * configure.in (AC_CHECK_HEADERS): Test for sys/wait.h, info/man.c
- uses it.
- From: Erick Branderhorst <Erick.Branderhorst@asml.nl>.
-
-Tue Jul 29 15:55:19 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: Version 3.9j.
-
- * info/terminal.c (output_character_function): Return int (the
- arg), not void.
-
- * info/infomap.c: Don't define term_kP as 'v', since that's undefined.
- From: Tom Hageman <tom@basil.icce.rug.nl>.
-
- * makeinfo/makeinfo.c: Parameterize some messages to avoid
- duplicate translations.
-
- * info/terminal.c: Only try to declare ospeed, PC, tputs, etc. if
- we don't have <ncurses.h/termcap.h> or <termcap.h>.
-
- * makeinfo/makeinfo.c (cm_email): New function, like cm_uref.
-
-Sun Jul 27 17:09:20 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: Only check for <ncurses/termcap.h> if we're using
- -lncurses.
- From: Bo Johansson <bo.johansson@mbox2.swipnet.se>.
-
- * info/dir.c (new_dir_file_p): Avoid automatic struct
- initialization, SunOS 4 etc. cc can't handle it.
- From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>.
-
-Sat Jul 26 15:08:13 1997 Karl Berry <karl@cs.umb.edu>
-
- * Version 3.9i.
-
- * configure.in: Check for termcap.h and ncurses/termcap.h.
- From: bo.johansson@mbox2.swipnet.se.
-
-Fri Jul 25 14:09:05 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Document new second optional arg to email.
-
- * info/infodoc.c: Document CTRL-x 0 as the way to get out of help.
-
- * info/dir.c (maybe_build_dir_node): Really check for the same dir
- file twice, not just by name.
- (new_dir_file_p): New function.
-
- * util/install-info.c: Tell them about --help in doc strings.
-
-Thu Jul 24 14:25:44 1997 Karl Berry <karl@cs.umb.edu>
-
- * util/texindex.c (memory_error): Move to avoid incorrect implicit
- decl.
-
- * makeinfo/makeinfo.c,
- * makeinfo/multi.c,
- * util/install-info.c,
- * util/texindex.c,
- * info/tilde.c,
- * info/man.c,
- * info/gc.c,
- * info/session.c (info_replace_key_to_typeahead): Remove unused
- function,
- * info/nodemenu.c,
- * info/man.c,
- * info/m-x.c,
- * info/footnotes.c
- * info/info.c
- * info/indices.c,
- * info/filesys.c: Parenthesize to avoid -Wall warnings
- remove unused variables,
- make return types explicit,
- printf type corrections.
-
- * lib/system.h: <ctype.h>: Include this.
- * util/texindex.c,
- * makeinfo/makeinfo.c,
- * info/echo-area.c,
- * info/display.c: ctype.h: Included in system.h now.
-
- * info/echo-area.c: Parenthesize to avoid -Wall warnings.
- (ctype.h): #include for isprint.
- (echo_area_stack_depth): Remove unused function.
- * info/display.c: Parenthesize to avoid -Wall warnings.
- (ctype.h): #include for isprint.
- * info/dir.c: Parenthesize to avoid -Wall warnings.
- (build_dir_node_internal): Remove declaration of nonexistent function.
- From: Erick Branderhorst <Erick.Branderhorst@asml.nl>.
-
- * configure.in (TEXMF): Call texconfig to discover the default value,
- for the sake of the warning in doc/Makefile.
- From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>.
-
- * doc/Makefile.am (TEXMF): New variable.
- (install-data-local): Use it in warning.
- From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>.
-
- * info/session.c (initialize_info_session): Only call
- terminal_prep_terminal if clear_screen is true. Otherwise, failed
- --index-searches prep the terminal but do not unprep it.
- From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>.
-
- * info/nodemenu.c: Doc fix.
-
-Mon Jul 21 17:11:09 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Comment out @smallbook and @set smallbook so
- people at other sites can print it the way they want.
- From: Thomas Walter <walter@pctc.chemie.uni-erlangen.de>
-
-Sun Jul 20 07:52:25 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: 3.9h.
-
- * doc/Makefile.am (install-info-am, distclean-aminfo): New targets
- to avoid assuming info files are in srcdir.
-
- * lib/system.h (xstrdup): Returns char *, not void *.
-
- * doc/Makefile.am (.texi.info),
- * doc/Makefile.am (texinfo): Don't run in $(srcdir).
-
- * util/install-info.c (main): Remove unnecessary decl of strrchr.
-
- * info/tilde.c: Include info.h (for config.h) before alloca stuff.
-
- * makeinfo/makeinfo.c (validate_file): Rename `valid' to `valid_p'
- to avoid conflict with SunOS 4 header files.
- From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>.
-
- * info/session.c (initialize_info_session): Call
- terminal_prep_terminal here (before calling terminal_clear_screen).
- (info_session): Instead of here.
- From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>.
-
- * Makefile.am (EXTRA_DIST): Add README-alpha.
-
-Sat Jul 19 13:50:27 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/terminal.c: Use `keypad transmit' sequence if it's defined:
- (term_keypad_on, term_keypad_off): New statics.
- (terminal_begin_using_terminal): If term_keypad_on, send it.
- (terminal_end_using_terminal): If term_keypad_off, send it.
- (terminal_initialize_terminal): Look up ks and ke termcap strings.
- From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>.
-
- * info/infomap.c (initialize_info_keymaps): Initialize hardwired
- cases for arrow keys a la readline. Found by John Eaton,
- jwe@bevo.che.wisc.edu.
-
- * makeinfo/makeinfo.c (output_pending_notes): Remove footnote
- macro expansion code I #if 0'd out some time ago. And doc fixes.
-
- * Applied this patch:
-
-Sat Jul 19 16:29:01 1997 Karl Eichwalder <ke@suse.de>
-
- * info/info.c (main): setlocale, bindtextdomain, and textdomain.
-
-Fri Jul 18 10:02:18 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/Makefile.am (install-data-local),
- * emacs/Makefile.am (install-data-local): Give subdir in warning.
-
- * configure.in: Version 3.9f.
-
- * doc/texinfo.texi: Correct \^ to @^.
- From Andreas S.
-
- * Merged these changes:
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * info/display.c (display_cursor_at_point): Flush ouput.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * info/session.c (remember_window_and_node): Don't crash when the
- current window has no current node.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * util/texindex.c (usage): Translate the doc strings.
- * makeinfo/makeinfo.c (cm_today): Translate the month names.
- * info/variables.c (describe_variable): Translate the doc strings.
- * info/nodes.h: Don't translate the strings defining the info format.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * makeinfo/makeinfo.c (get_item_function): Remove superfluous call
- to canon_white after get_rest_of_line.
- (cm_end): Likewise.
- (handle_variable): Likewise.
- (cm_item): Likewise.
- (cm_unmacro): Likewise.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * info/nodemenu.c (list_visited_nodes): Don't clear the internal
- flag, this and other functions depend on it. Don't insist on
- displaying the menu below the current window.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * makeinfo/makeinfo.c (cm_uref): Fix memory leaks.
- (cm_inforef): Likewise. Handle empty cross reference name.
-
-1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * info/echo-area.c (ea_possible_completions): Check that the
- current window can actually be split.
-
-Thu Jul 17 17:19:34 1997 Karl Berry <karl@cs.umb.edu>
-
-
- * emacs/Makefile.am (*clean-lisp): Define, as Automake didn't.
- From: Kenneth Stailey <kstailey@disclosure.com>.
-
- * doc/Makefile.am: Do not distribute info.1.
- * makeinfo/macros: Do not distribute this directory, it's merged
- into the main documentation.
- * doc/makeinfo.texi: Don't distribute this either, it's in the
- main manual.
-
- * util/install-info.c: Use \n\ for multiline string constant.
- From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>.
-
-Wed Jul 16 15:29:50 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: @set must be after @setfilename, I guess.
- Noted by Erick Branderhorst.
-
- * Applied this change:
-
-Tue Nov 12 22:20:22 1996 John Eaton <jwe@bevo.che.wisc.edu>
-
- * makeinfo.c (INDEX_ALIST): Use two indices, read_index and
- write_index, instead of just one.
- (find_index_offset): If a match is found, return index to the
- current INDEX_ALIST struct, not the index pointing to the list of
- index entries.
- (translate_index): Return read_index from the matching
- INDEX_ALIST.
- (undefindex): Delete the list of index elements pointed to by
- read_index from the INDEX_ALIST that matches name.
- (defindex): Initialize read_index and write_index.
- (index_add_arg): Add entries to the list pointed to by write_index
- from the INDEX_ALIST matching name.
- (index_append): Delete unused function.
- (cm_synindex): Don't merge indcies, just make the write_index for
- redirectee the same as the write_index for redirector.
-
-Tue Jul 15 09:32:04 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Bump edition number for 2.24.
-
- * util/Makefile.am (localedir): Define.
-
- * info/window.h: Rename __window__ to window_struct.
-
- * info/window.h,
- * info/variables.h,
- * info/search.h,
- * info/man.h,
- * info/info-utils.h,
- * info/gc.h,
- * info/footnotes.h,
- * info/filesys.h,
- * info/echo-area.h,
- * info/display.h: Avoid leading _ in #define for #include protection.
-
- * makeinfo/makeinfo.c: Version 1.68.
- * info/info.c: Version 2.17.
-
- * Most all files: Untabify.
-
- * doc/Makefile.am (texinfo): Add explicit target.
-
- * emacs/Makefile.am (noinst_LISP): Remove the obsolete
- detexinfo.el (makeinfo --no-headers is better) and
- texnfo-tex.el (now handled by TeX modes in general).
-
-Mon Jul 14 15:21:03 1997 Karl Berry <karl@cs.umb.edu>
-
- * util/texi2dvi: Update RCS file from 3.9 distribution.
-
- * util/Makefile.am (EXTRA_DIST): Add update-info, from
- rhawes@dmapub.dma.org
-
-Sun Jul 13 17:05:03 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/signals.c: Use RETSIGTYPE instead of hardwiring void.
- From: "Jeffery L. JT Vogt" <lfm@atw.earthreach.com>.
-
- * info/session.c (info_history_node): Rewrite as
- info_kill_node (current_node).
- (kill_node, read_nodename_to_kill): New functions from info_kill_node.
- (info_kill_node): Now this just calls them.
-
-Fri Jul 11 11:56:58 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Fix `Conditionals' xref.
-
-Thu Jul 10 17:58:12 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/info.texi: Don't say SPC clears ? screen.
-
-Sun Jul 6 16:26:41 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/info-stnd.texi: Document --index-search.
-
- * info/tilde.c,
- * info/session.c: Remove redundant getenv decl.
-
- * Installed following change:
-Tue Nov 12 14:44:00 1996 John W. Eaton <jwe@bevo.che.wisc.edu>
-
- * info/info.c (main): Handle new option, --index-search STRING.
- (index_search_p, index_search_string): New static variables, used
- to handle --index-search option.
-
- * info/session.c (initialize_info_session): New arg,
- clear_screen. Change all callers.
-
- * info/indices.h (do_info_index_search, index_intry_exists):
- Provide declarations here.
-
- * info/indices.c (do_info_index_search): New function, extracted
- from info_index_search.
- (info_index_search): Simply call do_info_index_search() with
- search_string set to NULL.
- (index_entry_exists): New function.
-
-Sat Jul 5 17:17:14 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Document @kbdinputstyle.
-
- * makeinfo/makeinfo.c (kbdinputstyle): New command.
- (cm_no_op_line_arg): New function.
-
- * info/termdep.h (HAVE_TERMIOS_H) [NeXT]: #undef.
- From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de> et al.
-
-Fri Jul 4 14:18:08 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/Makefile.am (EXTRA_DIST),
- * util/Makefile.am (EXTRA_DIST),
- * makeinfo/Makefile.am (EXTRA_DIST),
- * lib/Makefile.am (EXTRA_DIST): Include README.
-
- * doc/texinfo.texi (makeinfo options): Document --paragraph-indent
- values more completely.
- * makeinfo/makeinfo.c (set_paragraph_indent): Allow translated
- asis or none, improve doc.
- From ke.
-
- * doc/Makefile.am (dist-info): New empty target so that we do not
- distribute info files.
- From Erick Branderhorst.
-
- * doc/texinfo.texi (Invoking install-info): Document that the dir
- file is created now if need be.
- * Makefile.am (EXTRA_DIST): No longer need dir.
- * util/install-info.c (ensure_dirfile_exists): New routine.
- (main): Call it before trying to open dirfile for reading.
-
- * doc/texinfo.texi: Document install-info --delete a little better.
- * util/install-info.c: Set something_deleted when we delete a
- normal line.
- Bug from: Denis Kosygin <dkosygin@math.Princeton.EDU>.
-
- * util/install-info.c: If no info dir entry, give warning and exit 0.
-
-Wed Jul 2 06:35:17 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in (ALL_LINGUAS): Add fr.
-
- * makeinfo/makeinfo.h (insertion_type, insertion_type_names): Add
- ifnot... entries. Alphabetize.
-
-Tue Jul 1 17:21:54 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (sort_index): Set defining_line and
- input_filename so errors in index entries are reported at
- the correct location. From rms.
-
- * makeinfo/makeinfo.c (cm_ifnothtml, etc.): Routines for new
- commands.
-
-Sun Jun 29 09:44:01 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Document new @ifnot... commands, etc.
- * doc/texinfo.texi: Document @image, etc.
-
-Thu Jun 26 17:57:37 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (cm_image): New routine for new command @image.
- (cm_end): Move to better place, doesn't need its own page.
- Doc fixes.
-
-Mon Jun 23 16:54:03 1997 Karl Berry <karl@cs.umb.edu>
-
- * Makefile.am (SUBDIRS): Do intl first.
-
- * doc/Makefile.am (EXTRA_DIST): Include epsf.tex.
- (install-data-local): Suggest possible installation directory.
- * epsf.tex: New file.
-
-Wed Jun 18 17:51:52 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Document texinfo.cnf.
-
-Sun Jun 15 14:37:58 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi (Command List): Various commands missing or
- erroneous.
- From: Karl_Heinz_Marbaise@p69.ks.fido.de.
-
- * makeinfo/makeinfo.c: Oops, failed to break out of loop.
-
- * util/texindex.c: Use <getopt.h> not "getopt.h".
-
- * All source files: Merge gettext changes from Karl E.;
- his ChangeLog entries below.
-
-Sat Jun 14 17:04:28 1997 Karl Berry <karl@cs.umb.edu>
-
- * Makefile.am,
- * makeinfo/Makefile.am: Doc fix.
- * util/Makefile.am (EXTRA_DIST): Add texi2dvi. From Karl E.
-
-Fri Jun 13 17:39:34 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c [WIN32]: Handle read bogosity and c:\
- absolute paths.
- From: Eric Hanchrow <erich@MICROSOFT.com>.
-
- * configure.in (AC_CHECK_HEADERS): Check for pwd.h.
- * info/tilde.c (pwd.h): Move #include to system.h.
-
- * makeinfo/makeinfo.c (main): New option -P to prepend to search path.
- From: Kenneth Stailey <kstailey@cvs.openbsd.org>.
-
- * doc/texinfo.texi (Invoking makeinfo),
- * doc/makeinfo.texi: Mention -P.
-
-Thu Jun 12 16:25:40 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/signals.h (SIGCHLD): #define as SIGCLD if undefined, for sysV68.
- From: "Philippe De Muyter" <phdm%labauto1@ulb.ac.be>.
-
- * util/install-info.c (O_RDONLY): Remove this stuff, it's in system.h.
- (main): Handle existing entry in dir file having .info extension.
- From: "Bradley C. Kuszmaul" <bradley@GRANITE.SYSTEMSX.CS.YALE.EDU>.
-
- * makeinfo/makeinfo.c (get_char_len): Don't count 8-bit characters
- as two chars in the output.
- From: Sung-Hyun Nam <namsh@amuna.rms.lgic.co.kr>.
-
-Wed Jun 11 16:36:51 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi (Other Info Directories): Document new trailing
- : in INFOPATH feature.
-
- * info/info.c (main): Have trailing : in INFOPATH expand to the
- default path.
-
-Fri Jun 6 13:22:02 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi (uref): New node for new command.
-
-Thu Jun 5 18:13:48 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (cm_uref): New function to accept optional
- second argument. Call it in command table.
-
-Sat Jun 14 10:54:16 1997 Karl Eichwalder <ke@suse.de>
-
- * mkinstalldirs: Update from automake-1.1p.
-
- * configure.in: Touch po/ChangeLog (gettext needs it).
-
-Thu Jun 12 08:37:52 1997 Karl Eichwalder <ke@ke.Central.DE>
-
- * util/texindex.c: Include system.h, remove config.h.
-
- * po/POTFILES.in: Fill it.
-
- * makeinfo/multi.c: Include system.h.
-
- * info/Makefile.am:
- * makeinfo/Makefile.am:
- * util/Makefile.am:
- (localedir): Set.
- (INCLUDES): Add intl/ and LOCALEDIR.
- (LDADD): Add @INTLLIBS@.
-
- * makeinfo/makeinfo.c (main):
- * util/texindex.c (main):
- * util/install-info.c (main):
- setlocale, bindtextdomain, and textdomain.
-
- * lib/system.h: Include locale.h and libintl.h.
-
- * acconfig.h: Include libintl.h.
- (_, N_): Define.
- Add ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES,
- HAVE_STPCPY for libintl.
- Add @TOP@ and @BOTTOM@.
-
- * configure.in (AM_GNU_GETTEXT): Add.
- (AC_OUTPUT): Process Makefiles in intl/ and po/.
- (ALL_LINGUAS): Available languages.
-
- * Makefile.am (AUTOMAKE_OPTIONS): Now use 1.1p.
-
-Wed Jun 11 17:05:37 1997 Karl Eichwalder <ke@ke.Central.DE>
-
- * Makefile.am (SUBDIRS): Add intl/ and po/ for NLS.
-
- * run `gettextize -c' to get the i18n skeleton.
-
-Wed Jun 4 17:51:08 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (uref): New command, another alias for @code
- for now.
-
-Wed Jun 4 02:02:33 1997 Miles Bader <miles@gnu.ai.mit.edu>
-
- * doc/texinfo.texi (email): { and } need @ escapes.
-
-Sun Jun 1 16:34:12 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi (itemx): @itemx should always follow @item.
-
- * makeinfo/makeinfo.c (cm_item): Insert blank line if two
- consecutive @item's.
- From: Karl Eichwalder <ke@ke.central.de>.
- Also various doc fixes.
-
-Tue May 27 17:20:44 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi (various): Document @deftypemethod.
- (email): @ should have been @@ in the example.
- From: Mate Wierdl <mw@wierdlmpc.msci.memphis.edu>
-
-Mon May 26 16:56:26 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/multi.c (setup_multitable_parameters): Avoid use of %n
- for sake of m68k-hp-bsd.
- From: Derek L Davies <ddavies@world.std.com>.
-
- * info/terminal.c (terminal_begin_using_terminal,
- terminal_end_using_terminal): Call fflush and sleep to handle
- cmdtool/shelltool with scrollbars. Also ignore
- SIGWINCH so we do not prematurely exit. Move call.
- (terminal_prep_terminal): Disable LNEXT (CTRL-V).
- From: strube@physik3.gwdg.de (Hans Werner Strube).
-
- * configure.in (AC_TYPE_SIGNAL): Check this.
-
-Sun May 25 16:49:58 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (discard_insertions): Take arg saying
- whether ifinfo/ifset/etc. are ok.
- (convert_from_loaded_file): At `finished', call discard_insertions.
- (handle_variable_internal): Complain if we reach eof before the
- @end for a false condition.
- From: HERBERT@boevm4.vnet.ibm.com.
-
- * info/Makefile.am (ginfo_SOURCES): Add doc.h.
- * lib/Makefile.am (libtxi_a_SOURCES): Add system.h.
-
-Sat May 24 18:08:27 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c: Check that we have macro_expansion_filename
- before using strcmp.
-
-Thu May 22 17:59:46 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/makeinfo.texi: Minimally document --force.
-
- * makeinfo/makeinfo.c (--force): New option.
- (-E): Allow stdout via `-'.
- (convert_from_loaded_file): Unlink output files if errors and !force.
-
-Tue May 20 17:48:42 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c: Change all strdup calls to xstrdup.
- (xmalloc, xrealloc, memory_error): Remove these functions, they're
- in lib.
- (set_paragraph_indent, cm_paragraph_indent): Move to misc page.
- (cm_footnote): Expand macros in the arg for the macro expansion output.
-
-Fri May 16 17:26:59 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (cm_macro): Allocate an empty body if the
- macro was empty.
- (cm_unmacro): Allocate one more byte for the null.
- From: Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>.
-
-Sun May 11 17:51:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * makeinfo/makeinfo.c (cm_printindex): Fix calculation of the
- length of an index line.
-
-Sun May 11 14:47:42 1997 Tom Tromey <tromey@cygnus.com>
-
- * makeinfo/makeinfo.c (main): Don't unconditionally run usage when
- -e specified.
-
-Sun May 11 17:47:42 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (init_indices): Free the source for an @synindex.
- (undefindex): Do not go further if the target was already freed.
- (free_index): Do not free the node names, as init_tags already did.
- (cm_synindex, index_add_arg): Improve error message.
- (program_index, function_index, etc.): Remove these unused #defines.
-
-Tue May 6 17:53:37 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (init_internals): Do not free current_node,
- it already is, at least when multiple input files are specified.
- From: Karl Eichwalder <ke@ke.central.de>.
-
-Mon May 5 16:14:39 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Mention both alignment and non-alignment of
- continuation description lines in menus (Arnold).
-
-Sun Apr 27 16:12:44 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (apply): Handle body being `\string'.
- Also, avoid dereferencing a null pointer when a macro has no named
- parameters.
- From: Eli Zaretskii <eliz@is.elta.co.il>.
-
- * makeinfo/makeinfo.c: Wording changes/fixes in warnings.
-
- * info/session.c (info_get_input_char): Do not mix stdio with raw I/O.
- From: Egil Kvaleberg <egilk@sn.no>.
-
- From Tom Hageman <tom@basil.icce.rug.nl>. These changes make
- arrow keys work:
- * info/infomap.c: Add arrow key bindings.
- (keymap_bind_keyseq): New support function.
- (initialize_info_keymaps): Use it.
- (term_ku,term_kd,term_kl,term_kr): Remove explicit declarations;
- use #include "terminal.h" instead.
- * info/session.c (initialize_info_session): Unbuffer stdin.
- (info_get_another_input_char): Fix bug in `ready' logic.
- * info/terminal.h,
- * info/terminal.c (term_kP, term_kN): New variables to hold
- PageUp, PageDown key sequences.
- (terminal_initialize_terminal): Set them.
-
- * util/texindex.c (main),
- * util/install-info.c (main),
- * makeinfo/makeinfo.c (print_version_info),
- * info/info.c (main): Use PACKAGE and VERSION from Automake for
- printing version number.
-
-Sat Apr 26 19:19:46 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (get_until_in_line): Do not expand if
- executing_string.
- Also, free temporary strings.
- Also, untabify entire file.
-
- * doc/texinfo.texi: Many corrections from Arnold.
-
-Thu Apr 24 16:31:09 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/multi.c (draw_horizontal_separator): Account for indent
- here also. From Ulrich.
-
-Wed Apr 23 15:15:34 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (cm_today): Use time_t instead of long;
- everyone else does.
- (LOCALTIME_CAST): Remove kludge, we'll always use time_t now.
-
- * info/Makefile.am (ginfo_SOURCES): Remove general.h, that got
- merged into system.h.
-
-Mon Apr 21 17:13:25 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/multi.c (output_multitable_row): Account for
- column_indent, both the global one and for each column.
- (setup_multitable_parameters): Account for column_indent in the table
- width in the columnfrac case, but don't bother with the template
- case for now.
-
-Sun Apr 20 16:32:00 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (output_stream): Remove redundant
- definition; it's in makeinfo.h,
- and a vaxstation-ultrix4.3 fails to link because of the two defns.
- From: Anders Olofsson <anders@kid025.ericsson.se>.
-
- * makeinfo/makeinfo.c (expansion): Inhibit appending to the macro
- expansion stream.
- (get_until_in_line): Possibly expand the text.
- Change caller in get_node_token to do the expansion,
- all other calls to remain the same.
-
- * makeinfo/makeinfo.c (cm_node): No need to call strlen to check
- for the empty string.
-
- * doc/texinfo.texi: Restore missing @c for initial comment.
-
-Fri Apr 18 17:41:36 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Mention that .info is unnecessary in the info
- file name argument of an xref.
-
- * doc/texinfo.texi: Mention texi2dvi -t instead of embedding
- @smallbook or @afourpaper in the document source.
-
-Sun Apr 13 15:19:08 1997 Karl Berry <karl@cs.umb.edu>
-
- * lib/system.h (_GNU_SOURCE): #define.
-
-Mon Apr 7 16:30:11 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/info.texi,
- * doc/info-stnd.texi,
- * doc/texinfo.texi: Do not make (dir) the previous ptr from the top node,
- and tell people not to do that in the manual.
- From: rmedina@kanojo.ivic.ve (Rodrigo Medina),
- confirmed by rms.
-
-Fri Apr 4 16:30:33 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c: Move error page to top to avoid
- prototypes, and do add prototypes for add_word_args and execute_string,
- so we can use <stdarg.h>.
-
- * info/makedoc.c,
- * info/nodemenu.c: Use %ld instead of %d for file offsets.
- * makeinfo/makeinfo.c (delete_macro): Decrement macro_list_len.
- (get_macro_args): Decrement line number if see \n.
- * utils/texindex.c (indexify): Use fputs instead of fprintf
- for constant string.
- From: Eli Zaretskii <eliz@is.elta.co.il>.
-
-Thu Apr 3 17:40:52 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in (AC_CHECK_HEADERS): No need to check for vararg.h
- here, AC_FUNC_VPRINTF does it.
- (AC_CHECK_FUNCS): Likewise for vsprintf and vfprintf.
- * makeinfo/makeinfo.c (add_word_args, execute_string): Rewrite
- like the error functions.
-
-Wed Apr 2 17:46:28 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in: Add AC_FUNC_VPRINTF.
- * makeinfo/makeinfo.c (error, line_error, warning): Rewrite a la
- error.c from the *utils to use <stdarg.h> if available.
-
-Tue Apr 1 11:48:40 1997 Karl Berry <karl@cs.umb.edu>
-
- * doc/texinfo.texi: Tabs are a bad idea.
-
- * doc/userdoc.texi,
- * doc/info.texi: Untabify.
-
-Sun Mar 30 17:36:47 1997 Karl Berry <karl@cs.umb.edu>
-
- * makeinfo/makeinfo.c (end_of_sentence_p): New function.
- (add_char): Call it, instead of simply sentence_ender.
- (post_sentence): New macro.
- Also, remove some #include's now in system.h.
- * lib/system.h [VMS]: #include <perror.h>, from makeinfo.
-
-Thu Mar 27 17:41:03 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/search.c (skip_node_characters): Do not arbitrarily
- strip trailing period from end of node name; this is valid.
-
-Mon Mar 24 16:44:42 1997 Karl Berry <karl@cs.umb.edu>
-
- * configure.in (AC_OUTPUT): Don't need to create stamp-h here,
- tromey says AM_CONFIG_HEADER will do it.
-
- * info/Makefile.am, util/Makefile.am, makeinfo/Makefile.am (INCLUDES):
- Don't need -I.. (for config.h) or -I$(srcdir), says tromey.
- Automake includes those already.
-
-Fri Mar 14 15:05:17 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/Makefile.am: Build as ginfo, install as info,
- to avoid conflict with the standard info target.
-
- * lib/system.h: New file.
- * makeinfo/makeinfo.c (strerror): Remove declaration,
- include system.h, remove other redundant #if stuff.
- * info/general.h: Include system.h instead of doing common stuff.
- * util/install-info.c (my_strerror): Remove this, use strerror,
- include system.h.
-
- * info/terminal.c (terminal_prep_terminal): Only use OCRNL and
- ONLCR if they are defined. Reported by many people.
-
- * Installed:
-
- Sun Dec 1 19:23:54 1996 Karl Eichwalder <ke@ke.Central.DE>
-
- * configure.in (TERMLIBS): Add ncurses.
-
-Thu Mar 13 13:59:45 1997 Karl Berry <karl@cs.umb.edu>
-
- * lib/Makefile.am (libtxi_a_SOURCES): Add xstrdup.c.
- * info/*.c: Use xstrdup instead of strdup everywhere.
-
- * info/tilde.c: Do not include clib.h, move stdlib.h include to
- * info/general.h: here.
-
- * configure.in (AC_CONFIG_HEADER): Use this,
- to avoid hugely long compile line with all the -D's.
- * info/general.h: Include <config.h>.
-
- * emacs/Makefile.am (install, install-data): Do @echo
- to tell the user to compile/install the elisp manually.
-
- * configure.in (AC_REPLACE_FUNCS): Move strerror check to here.
- (AC_CHECK_FUNCS): From here.
-
- * lib/strerror.c: New file, from enscript (et al.) distribution.
-
-Tue Mar 11 16:36:25 1997 Karl Berry <karl@cs.umb.edu>
-
- * info/Makefile.am (info_SOURCES): Add doc.c, dribble.c, infodoc.c.
- (LDADD): Add @TERMLIBS@.
-
- * info/info.h: HANDLE_MAN_PAGES, NAMED_FUNCTIONS: Define these.
-
- * info/filesys.h: Spurious ! when DEFAULT_INFOPATH is not defined.
-
- * configure.in (AC_OUTPUT): Do lib first and doc last.
-
- * info/echo-area.c,
- * info/echo-area.h,
- * info/info.h: Rename echo_area to echo-area.
-
-Mon Mar 10 17:59:05 1997 Karl Berry <karl@cs.umb.edu>
-
- * */Makefile.am: Write Makefile.am files for Automake.
- * doc: New subdirectory, move all manuals and texinfo.tex there.
- * AUTHORS, THANKS, config.guess, config.sub, mkinstalldirs: New files,
- required by Automake.
- * lib/xmalloc.c: Move from info/.
-
Fri Oct 4 07:49:49 1996 Karl Berry <karl@cs.umb.edu>
* Version 3.9.
diff --git a/contrib/texinfo/INTRODUCTION b/contrib/texinfo/INTRODUCTION
index 1355e6fcf4af..1d298ca36a7b 100644
--- a/contrib/texinfo/INTRODUCTION
+++ b/contrib/texinfo/INTRODUCTION
@@ -1,6 +1,14 @@
Getting Started with Texinfo
============================
+25 March 1993
+
+Most of the installation instructions are described in the file `INSTALL'.
+One additional note to make is that if your info files are in a nonstandard
+place (i.e. not in the `info' directory immediately under $prefix) you may
+wish to change the default info path as specified via DEFAULT_INFOPATH in
+info/Makefile.in.
+
"Texinfo" is a documentation system that uses a single source file to
produce both on-line information and printed output. Using Texinfo,
you can create a printed document with the normal features of a book,
@@ -8,23 +16,23 @@ including chapters, sections, cross references, and indices. From the
same Texinfo source file, you can create a menu-driven, on-line Info
file with nodes, menus, cross references, and indices.
-The name of the Texinfo source documentation file is `texinfo.txi'.
+The name of the Texinfo source documentation file is `texinfo.texi'.
You can produce both on-line information and printed output from this
source file. The documentation describes Texinfo in detail, including
how to write Texinfo files, how to format them for both hard copy and
Info, and how to install Info files.
To get started, you need to create either a printed manual or an
-on-line Info file from the `texinfo.txi' file. You do not need to
+on-line Info file from the `texinfo.texi' file. You do not need to
create both, although you will probably want both eventually.
To learn how to use Info, read the info documentation. You can do this in
one of two ways: using the standalone `info' program, or using Info mode in
GNU Emacs.
- * If you want to use the `info' program, run
+ * If you want to use the `info' program, type
- info -f info-stnd
+ $ info -f info-stnd
* If you want to use Emacs, start up emacs and type `C-h i' [M-x info].
Follow the instructions to learn how to use Info.
@@ -32,7 +40,7 @@ GNU Emacs.
After learning how to use Info, you can read the Texinfo documentation.
Using the standalone `info', type the following at the shell prompt:
- info -f texinfo
+ $ info -f texinfo
To use read this manual in Emacs, you first need to edit the Info-directory
menu (the file `dir' in the system info directory) to contain the
@@ -106,6 +114,6 @@ The name of the printing command depends on the system; `lpr -d' is
common, and is illustrated here. You may use a different name for the
printing command.
-Please report bugs to bug-texinfo@gnu.org.
+Please report bugs to bug-texinfo@prep.ai.mit.edu.
Happy formatting.
diff --git a/contrib/texinfo/Makefile.am b/contrib/texinfo/Makefile.am
deleted file mode 100644
index 045c115eb4ba..000000000000
--- a/contrib/texinfo/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-## Makefile.am for texinfo.
-## $Id: Makefile.am,v 1.9 1998/02/26 21:33:56 karl Exp $
-## Process this file with automake to produce Makefile.in in all directories.
-
-# Be sure we're using the right version of Automake.
-# 1.2f was the first version that supported .txi as a Texinfo suffix.
-AUTOMAKE_OPTIONS = 1.2f
-
-# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example
-
-# All subdirectories.
-# Do intl/ and lib/ first since the C programs depend on them.
-# Do doc/ last so makeinfo will be built when we get there.
-# Others are alphabetical.
-SUBDIRS = intl lib info makeinfo po util doc
diff --git a/contrib/texinfo/Makefile.in b/contrib/texinfo/Makefile.in
index 51989e7b42e4..3e93b61f1d20 100644
--- a/contrib/texinfo/Makefile.in
+++ b/contrib/texinfo/Makefile.in
@@ -1,347 +1,211 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile for Texinfo distribution.
+# $Id: Makefile.in,v 1.11 1996/10/04 18:40:33 karl Exp $
+#
+# Copyright (C) 1993, 96 Free Software Foundation, Inc.
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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 free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
# 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.
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-# Be sure we're using the right version of Automake.
-# 1.2f was the first version that supported .txi as a Texinfo suffix.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-SHELL = /bin/sh
+#### Start of system configuration section. ####
srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
+VPATH = $(srcdir):$(common)
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
+common = $(srcdir)/libtxi
+
+CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-AUTOMAKE_OPTIONS = 1.2f
-
-# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example
-
-# All subdirectories.
-# Do intl/ and lib/ first since the C programs depend on them.
-# Do doc/ last so makeinfo will be built when we get there.
-# Others are alphabetical.
-SUBDIRS = intl lib info makeinfo po util doc
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
-Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess \
-config.h.in config.sub configure configure.in install-sh missing \
-mkinstalldirs stamp-h.in texinfo.tex
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-default: all
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4): configure.in
- cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure
- $(SHELL) ./config.status --recheck
-$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
- cd $(srcdir) && $(AUTOCONF)
-
-config.h: stamp-h
- @:
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h \
- $(SHELL) ./config.status
- @echo timestamp > stamp-h
-$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in
-
-mostlyclean-hdr:
-
-clean-hdr:
-
-distclean-hdr:
- -rm -f config.h
-
-maintainer-clean-hdr:
-
-# 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.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- target=`echo $@ | sed s/-recursive//`; \
- echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- done; \
- for subdir in $$rev; do \
- target=`echo $@ | sed s/-recursive//`; \
- echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) tags); \
- done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
- done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(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
- -rm -rf $(distdir)
- GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) \
- && $(MAKE) dvi \
- && $(MAKE) check \
- && $(MAKE) install \
- && $(MAKE) installcheck \
- && $(MAKE) dist
- -rm -rf $(distdir)
- @echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
- echo "========================"
-dist: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-distdir: $(DISTFILES)
- -rm -rf $(distdir)
- mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
- for subdir in $(SUBDIRS); do \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
- || exit 1; \
- done
-info: info-recursive
-dvi: dvi-recursive
-check: all-am
- $(MAKE) check-recursive
-installcheck: installcheck-recursive
-all-recursive-am: config.h
- $(MAKE) all-recursive
-
-all-am: Makefile config.h
-
-install-exec: install-exec-recursive
- @$(NORMAL_INSTALL)
-
-install-data: install-data-recursive
- @$(NORMAL_INSTALL)
-
-install: install-recursive
- @:
-uninstall: uninstall-recursive
+LN = ln
+RM = rm -f
+TAR = tar
+MKDIR = mkdir
-all: all-recursive-am all-am
+DEFS = @DEFS@
+LIBS = @LIBS@
+LOADLIBES = $(LIBS)
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs: installdirs-recursive
+ALLOCA = @ALLOCA@
+SHELL = /bin/sh
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
-
-clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
-
-distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
-
-maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
-mostlyclean: mostlyclean-recursive mostlyclean-am
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+# Prefix for each installed program, normally empty or `g'.
+binprefix =
+# Prefix for each installed man page, normally empty or `g'.
+manprefix =
+manext = 1
+mandir = $(prefix)/man/man$(manext)
+infodir = $(prefix)/info
+
+# For info program.
+DEFAULT_INFOPATH = $(infodir):.
+
+#### End of system configuration section. ####
+
+VERSION = 3.9
+DISTNAME = texinfo-$(VERSION)
+
+# Subdirectories that have makefiles
+SUBDIRS = libtxi makeinfo info util emacs
+
+# All subdirectories that go into a distribution
+ALL_SUBDIRS = $(SUBDIRS) makeinfo/macros
+
+MDEFINES = bindir='$(bindir)' mandir='$(mandir)' manext='$(manext)' \
+ prefix='$(prefix)' binprefix='$(binprefix)' \
+ manprefix='$(manprefix)' infodir='$(infodir)' CFLAGS='$(CFLAGS)' \
+ CC='$(CC)' ALLOCA='$(ALLOCA)' LDFLAGS='$(LDFLAGS)' \
+ DEFAULT_INFOPATH='$(DEFAULT_INFOPATH)'
+
+all: sub-all texinfo
+
+install: all installdirs
+ test -f $(infodir)/dir || $(INSTALL_DATA) $(srcdir)/dir $(infodir)
+ for dir in $(SUBDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $(MDEFINES) $@ || exit 1); \
+ done
+ d=$(srcdir); test -f ./texinfo && d=.; \
+ (cd $$d && for f in texinfo texinfo-* ; do \
+ $(INSTALL_DATA) $$f $(infodir)/$$f; done)
+ $(POST_INSTALL)
+ ./util/install-info --info-dir=$(infodir) $(infodir)/texinfo
+ @echo Please install $(srcdir)/texinfo.tex manually.
+
+installdirs:
+ -$(SHELL) $(srcdir)/util/mkinstalldirs $(bindir) $(datadir) $(infodir) $(mandir)
+
+uninstall:
+ for dir in $(SUBDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $(MDEFINES) $@ || exit 1); \
+ done
+ $(RM) $(infodir)/texinfo $(infodir)/texinfo-*
-clean: clean-recursive clean-am
+Makefile: Makefile.in config.status
+ $(SHELL) ./config.status
-distclean: distclean-recursive distclean-am
- -rm -f config.status
+config.status: configure
+ $(SHELL) ./config.status --recheck
-maintainer-clean: maintainer-clean-recursive maintainer-clean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f config.status
+configure: configure.in
+ cd $(srcdir) && autoconf
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr install-data-recursive uninstall-data-recursive \
-install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
-installcheck-recursive info-recursive dvi-recursive \
-mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck all-recursive-am all-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+sub-all TAGS:
+ for dir in $(SUBDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $(MDEFINES) $@ || exit 1); \
+ done
+.PHONY: sub-all
+clean mostlyclean:
+ for dir in $(SUBDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $(MDEFINES) $@ || exit 1); \
+ done
-# 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.
+distclean: clean texclean
+ for dir in $(SUBDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $(MDEFINES) $@ || exit 1); \
+ done
+ $(RM) Makefile *.status *.cache *.log texinfo texinfo-? texinfo-??
+
+texclean:
+ $(RM) *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs
+ $(RM) *.toc *.tp *.tps *.vr *.vrs
+
+realclean: distclean
+
+# Let's hope we weren't cross-compiling.
+# If we depend on sub-all, this always gets remade. Annoying.
+info texinfo: texinfo.texi
+ ./makeinfo/makeinfo -I$(srcdir) texinfo.texi
+.PHONY: info
+
+dvi texinfo.dvi:
+ PATH="$(srcdir)/util:$${PATH}" TEXINPUTS="$(srcdir):$(common):$${TEXINPUTS}" texi2dvi $(srcdir)/texinfo.texi
+.PHONY: dvi
+
+dist: DISTFILES
+ $(RM) -r $(DISTNAME)
+ $(MKDIR) $(DISTNAME)
+ for d in `find . -type d ! -name RCS -print`; do \
+ d=`echo $$d | grep -v '[@=]'`; \
+ test -z "$$d" || test "$$d" = . || test "$$d" = "./$(DISTNAME)" \
+ || mkdir $(DISTNAME)/$$d; done
+ for f in `cat DISTFILES`; do \
+ $(LN) $(srcdir)/$$f $(DISTNAME)/$$f || \
+ { echo copying $$f; cp -p $(srcdir)/$$f $(DISTNAME)/$$f ; } \
+ done
+ (cd $(DISTNAME); $(MAKE) $(MFLAGS) distclean)
+ $(TAR) chvf - $(DISTNAME) | gzip >$(DISTNAME).tar.gz
+ $(RM) -r $(DISTNAME)
+
+# Gets rid of most of the unwanted files. Verify manually (if necessary)
+# that this produces a list of all the files desired in the distribution.
+DISTFILES: force
+ (cd $(srcdir); find . ! -type d -print) \
+ | sed '/\/RCS\//d; \
+ /\/EMACS-BACKUPS\//d; \
+ /\.tar.*/d; \
+ /~$$/d; /\.o$$/d; \
+ /\.gdbinit$$/d; \
+ /\.orig$$/d; \
+ /\#$$/d; \
+ /\/info\/info$$/d; \
+ /\.info$$/d; \
+ /\.elc/d; \
+ /\/makeinfo\/makeinfo$$/d; \
+ /\/$(DISTNAME)\/.*$$/d; \
+ /\/util\/texindex$$/d; \
+ /texinfo$$/d; \
+ /texinfo-[0-9]+$$/d; \
+ /\/.*\.BAK$$/d; \
+ /\/.*\.a$$/d; \
+ /\/core$$/d; \
+ /\/*\.core$$/d; \
+ /\/core\..*$$/d; \
+ /\/a.out$$/d; \
+ /\/[=@]/d; \
+ /\/conftest\.c$$/d; \
+ /\/DISTFILES$$/d; \
+ /\/foo$$/d; \
+ /\/bar$$/d; \
+ /\.toc$$/d; \
+ /\.bak$$/d; \
+ /\.aux$$/d; /\.log$$/d; \
+ /\.cps$$/d; /\.cp$$/d; \
+ /\.fns$$/d; /\.fn$$/d; \
+ /\.tps$$/d; /\.tp$$/d; \
+ /\.vrs$$/d; /\.vr$$/d; \
+ /\.pgs$$/d; /\.pg$$/d; \
+ /\.kys$$/d; /\.ky$$/d; \
+ /\.ops$$/d; /\.op$$/d; \
+ s/^.\///; /^\.$$/d;' \
+ | sort | uniq > DISTFILES
+
+force:
+
+# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
diff --git a/contrib/texinfo/NEWS b/contrib/texinfo/NEWS
index a9d80d8f50c8..ffc70933396d 100644
--- a/contrib/texinfo/NEWS
+++ b/contrib/texinfo/NEWS
@@ -1,45 +1,5 @@
This file records noteworthy changes.
-3.12 (3 March 1998)
-* Elisp files removed, since they are only usefully distributed with Emacs.
-* Restore inclusion of compile-time $(infodir) to INFOPATH.
-* install-info creates a proper dir file.
-* Various portability fixes.
-
-3.11 (31 July 1997)
-* New commands:
- - @uref to make a reference to a url; @url now only indicates such.
- - @image to include graphics (epsf for TeX).
- - @deftypemethod and @deftypemethodx to document methods in strongly
- typed object-oriented languages, such as C++.
- - @html for raw HTML.
- - @ifnothtml @ifnotinfo @ifnottex for more precise conditionals.
- - @kbdinputstyle to control when @kbd uses the slanted typewriter font.
- - @email takes second optional argument.
-* texinfo.tex reads texinfo.cnf (if present) for site-wide TeX
- configuration; for example, A4 paper sizes.
-* info:
- - arrow keys supported.
- - trailing : in INFOPATH appends default path.
- - new option --index-search for online help support.
-* makeinfo:
- - output files removed if errors unless (new option) --force.
- - new option -P to prepend to search path.
- - macro expansion file can be standard output.
-* install-info creates a new dir file if necessary.
-* update-info script to create a dir file from all info files.
-* Elisp: texnfo-tex.el and detexinfo.el removed from the distribution;
- - texnfo-tex features are now part of standard TeX & Texinfo packages;
- - makeinfo --no-headers does a better job than detexinfo.el.
-* Documentation:
- - Updates, revisions, corrections in the manual.
- - makeinfo.texi removed, as it was a copy of what was in texinfo.texi.
-* gettext support in sources, French and German translations included.
-* info man page removed; use the Texinfo manual.
-* Automake used, other portability fixes.
-
-3.10 (nonexistent)
-
3.9 (4 October 1996)
* makeinfo:
- Give a suppressible (with --no-validate) error for references
@@ -131,205 +91,3 @@ This file records noteworthy changes.
Just bug fixes, see ChangeLog for full details.
texinfo-3.0: first release of Texinfo version 2, with many new commands.
-
-
-Here is the separate NEWS for old releases of Info:
-
-Version 2.11, Sat Apr 1 09:15:21 1995
-
-Changes since 2.7 beta:
-
-Although the basic code remains the same, there are numerous nits
-fixed, including some display bugs, and a memory leak. Some changes
-that have taken place with larger impact include the way in which the
-(dir) node is built; I have added in support for "localdir"
-directories among other things. Info files may be stored in
-compressed formats, and in their own subdirectories; menu items which
-do not explicitly name the node to which they are attached have the
-menu item name looked up as an Info file if it is not found within the
-current document. This means that the menu item:
-
-* Info:: The Info documentation reader.
-
-in (dir) refers to the info node "(info)Top".
-
-Please see the ChangeLog and documentation for details on other
-changes.
-
-Version 2.7 beta, Wed Dec 30 02:02:38 1992
-Version 2.6 beta, Tue Dec 22 03:58:07 1992
-Version 2.5 beta, Tue Dec 8 14:50:35 1992
-Version 2.4 beta, Sat Nov 28 14:34:02 1992
-Version 2.3 beta, Fri Nov 27 01:04:13 1992
-Version 2.2 beta, Tue Nov 24 09:36:08 1992
-Version 2.1 beta, Tue Nov 17 23:29:36 1992
-
-Changes since 2.5 beta:
-
-Note that versions 2.6 and 2.7 Beta were only released to a select group.
-
-* "info-" removed from the front of M-x commands.
-
-* Automatic footnote display. When you enter a node which contains
- footnotes, and the variable "automatic-footnotes" is "On", Info pops
- up a window containing the footnotes. Likewise, when you leave that
- node, the window containing the footnotes goes away.
-
-* Cleaner built in documentation, and documentation functions.
-
- Use:
- o `M-x describe-variable' to read a variable's documenation
- o `M-x describe-key' to find out what a particular keystroke does.
- o `M-x describe-function' to read a function's documentation.
- o `M-x where-is' to find out what keys invoke a particular function.
-
-* Info can "tile" the displayed windows (via "M-x tile-windows"). If
- the variable "automatic-tiling" is "On", then splitting a window or
- deleting a window causes the remaining windows to be retiled.
-
-* You can save every keystroke you type in a "dribble file" by using the
- `--dribble FILENAME' option. You can initially read keystrokes from an
- alternate input stream with `--restore FILENAME', or by redirecting
- input on the command line `info < old-dribble'.
-
-* New behaviour of menu items. If the label is the same as the
- target node name, and the node couldn't be found in the current file,
- treat the label as a file name. For example, a menu entry in "DIR"
- might contain:
-
- * Emacs:: Cool text-editor.
-
- Info would not find the node "(dir)Emacs", so just plain "(emacs)"
- would be tried.
-
-* New variable "ISO-Latin" allows you to use European machines with
- 8-bit character sets.
-
-* Cleanups in echo area reading, and redisplay. Cleanups in handling the
- window which shows possible completions.
-
-* Info can now read files that have been compressed. An array in filesys.c
- maps extensions to programs that can decompress stdin, and write the results
- to stdout. Currently, ".Z"/uncompress, ".z"/gunzip, and ".Y"/unyabba are
- supported. The modeline for a compressed file shows "zz" in it.
-
-* There is a new variable "gc-compressed-files" which, if non-zero, says
- it is okay to reclaim the file buffer space allocated to a file which
- was compressed, if, and only if, that file's contents do not appear in
- any history node.
-
-* New file `nodemenu.c' implements a few functions for manipulating
- previously visited nodes. `C-x C-b' (list-visited-nodes) produces a
- menu of the nodes that could be reached by info-history-node in some
- window. `C-x b' (select-visited-node) is similar, but reads one of
- the node names with completion.
-
-* Keystroke `M-r' (move_to_screen_line) allows the user to place the cursor at
- the start of a specific screen line. Without a numeric argument, place the
- cursor on the center line; with an arg, place the cursor on that line.
-
-* Interruptible display implemented. Basic display speedups and hacks.
-* The message "*** Tags Out of Date ***" now means what it says.
-* Index searching with `,' (info-index-next) has been improved.
-* When scrolling with C-v, C-M-v, or M-v, only "Page Only" scrolling
- will happen.
-
-* Continous scrolling (along with `]' (info-global-next) and `['
- (info-global-prev) works better. `]' and `[' accept numeric
- arguments, moving that many nodes in that case.
-
-* `C-x w' (info-toggle-wrap) controls how lines wider than the width
- of the screen are displayed. If a line is too long, a `$' is
- displayed in the rightmost column of the window.
-
-* There are some new variables for controlling the behaviour of Info
- interactively. The current list of variables is as follows:
-
- Variable Name Default Value Description
- ------------- ------------- -----------
- `automatic-footnotes' On When "On", footnotes appear and
- disappear automatically.
-
- `automatic-tiling' Off When "On", creating of deleting a
- window resizes other windows.
-
- `visible-bell' Off If non-zero, try to use a visible bell.
-
- `errors-ring-bell' On If non-zero, errors cause a ring.
-
- `show-index-match' On If non-zero, the portion of the string
- matched is highlighted by changing its
- case.
-
- `scroll-behaviour' Continuous One of "Continuous", "Next Only", or
- "Page Only". "Page Only" prevents you from
- scrolling past the bottom or top of a node.
- "Next Only" causes the Next or Prev node to
- be selected when you scroll past the bottom
- or top of a node. "Continous" moves
- linearly through the files hierchichal
- structure.
-
- `scroll-step' 0 Controls how scrolling is done for you when
- the cursor moves out of the current window.
- Non-zero means it is the number of lines
- you would like the screen to shift. A
- value of 0 means to center the line
- containing the cursor in the window.
-
- `gc-compressed-files' Off If non-zero means it is okay to reclaim the
- file buffer space allocated to a file which
- was compressed, if, and only if, that
- file's contents do not appear in the node
- list of any window.
-
- `ISO-Latin' Off Non-zero means that you are using an ISO
- Latin character set. By default, standard
- ASCII characters are assumed.
-________________________________________
-This release of Info is version 2.5 beta.
-
-Changes since 2.4 beta:
-
-* Index (i) and (,) commands fully implemented.
-* "configure" script now shipped with Info.
-* New function "set-variable" allows users to set various variables.
-* User-settable behaviour on end or beginning of node scrolling. This
- supercedes the SPC and DEL changes in 2.3 beta.
-
-________________________________________
-This release of Info is version 2.4 beta.
-
-Changes since 2.3 beta:
-
-* info-last-node now means move to the last node of this info file.
-* info-history-node means move backwards through this window's node history.
-* info-first-node moves to the first node in the Info file. This node is
- not necessarily "Top"!
-* SPC and DEL can select the Next or Prev node after printing an informative
- message when pressed at the end/beg of a node.
-
-----------------------------------------
-This release of Info is version 2.3 beta.
-
-Changes since 2.2 beta:
-
-* M-x command lines if NAMED_COMMANDS is #defined. Variable in Makefile.
-* Screen height changes made quite robust.
-* Interactive function "set-screen-height" implements user height changes.
-* Scrolling on some terminals is faster now.
-* C-l with numeric arguement is fixed.
-
-----------------------------------------
-This release of Info is version 2.2 beta.
-
-Changes since 2.0:
-
-* C-g can now interrupt multi-file searches.
-* Incremental search is fully implemented.
-* Loading large tag tables is much faster now.
-* makedoc.c replaces shell script, speeding incremental builds.
-* Scrolling in redisplay is implemented.
-* Recursive uses of the echo area made more robust.
-* Garbage collection of unreferenced nodes.
-
diff --git a/contrib/texinfo/README b/contrib/texinfo/README
index 15f83239d422..357a98fb5554 100644
--- a/contrib/texinfo/README
+++ b/contrib/texinfo/README
@@ -1,48 +1,54 @@
-This is the README file for the GNU Texinfo distribution.
-The primary distribution point is ftp://ftp.gnu.org/pub/gnu.
-
-Please email bugs or suggestions to bug-texinfo@gnu.org. (If you wish,
-you can join this list by sending a subscribe message to
-bug-texinfo-request@gnu.org.) Patches are welcome; if possible, please
-make them with diff -c and include ChangeLog entries.
-
-Programs within this distribution have their own version numbers. When
-you refer to a file, please mention its own version, as well as the
-version number of the Texinfo distribution.
-
-For generic installation instructions on compiling and installing this
-Automake-based distribution, please read the file `INSTALL'.
-Installation notes specific to Texinfo:
-
- * The Info tree uses a file `dir' as its root node; the `dir-example'
- file in this distribution is included for informative purposes.
- Use it, modify it, or ignore it just as you like.
-
- * You can create a file texinfo.cnf to be read by TeX when
- processing Texinfo manuals. For example, it might contain the
- command @afourpaper. See the `Preparing for TeX' node in
- texinfo.texi for more details.
-
- * If your info files are not in $prefix/info, you may wish to add a line
-#define DEFAULT_INFOPATH "/mydir1:/mydir2:/etc"
- to config.h after running configure.
-
+Texinfo, Version 3
+==================
+
+This is the README file for version 3 of the Texinfo distribution.
+Files within this distribution have their own version and edition
+numbers. When you refer to a file, please mention its own number, as
+well as the version number of the Texinfo distribution.
+
+PLEASE REPORT BUGS TO: bug-texinfo@prep.ai.mit.edu
+
+Texinfo is a documentation system that uses a single source file to
+produce both on-line information and printed output. This means that
+instead of writing two different documents, one for the on-line help
+or other on-line information and the other for a typeset manual or
+other printed work, you need write only one document. When the work
+is revised, you need revise only one document. You can read the
+on-line information, known as an "Info file", with an Info
+documentation-reading program. By convention, Texinfo source file
+names end with a `.texi' or `.texinfo' extension. Texinfo is
+described in the Texinfo manual (the file ./texinfo.texi).
+
+You can write and format Texinfo files into Info files within GNU Emacs,
+and read them using the Emacs Info reader. If you do not have Emacs,
+you can format Texinfo files into Info files using `makeinfo' and read
+them using `info'. Use TeX, which is not included in this package (see
+`How to Obtain TeX' in the Texinfo manual for information), to typeset
+Texinfo files for printing.
+
+For instructions on compiling and installing info, makeinfo, texi2dvi,
+and texindex, please read the file `INSTALL'. The Emacs Lisp files are
+not installed by default; to install them, use `make install' in the
+`emacs' subdirectory. The Info tree uses a file `dir' as its root node;
+a sample `dir' file is included in the distribution, but not installed
+anywhere. Use it or not as you like.
This distribution includes (but is not limited to) the following files:
README This file.
- INTRODUCTION Brief introduction to the system, and
- how to create readable files from the
- Texinfo source files in this distribution.
-Texinfo source files (in ./doc):
+ INTRODUCTION This file tells you how to create
+ readable files from the Texinfo source
+ files in this distribution.
- texinfo.texi This manual describes the Texinfo language
- and many of the associated tools. It
+Texinfo source files:
+
+ texinfo.texi This manual describes Texinfo. It
tells how to use Texinfo to write
documentation, how to use Texinfo mode
- in GNU Emacs, TeX, makeinfo, and the
- Emacs Lisp Texinfo formatting commands.
+ in GNU Emacs, how to use TeX,
+ makeinfo, and the Emacs Lisp Texinfo
+ formatting commands.
info.texi This manual tells you how to use
Info. This document comes as part of
@@ -55,28 +61,58 @@ Texinfo source files (in ./doc):
info-stnd.texi This manual tells you how to use
the standalone GNU Info reader that is
- included in this distribution as C
- source (./info).
+ included in this distribution as a C
+ source file, `info.c'.
+
+ makeinfo.texi This manual tells you how to use
+ makeinfo. The same information is
+ contained in a chapter of the Texinfo
+ manual; it has been extracted here for
+ your convenience.
+
Printing related files:
- doc/texinfo.tex This TeX definitions file tells
+ texinfo.tex This TeX definitions file tells
the TeX program how to typeset a
Texinfo file into a DVI file ready for
printing.
- util/texindex.c This file contains the source for
+ texindex.c This file contains the source for
the `texindex' program that generates
sorted indices used by TeX when
typesetting a file for printing.
- util/texi2dvi This is a shell script for
+ texi2dvi This is a shell script for
producing an indexed DVI file using
TeX and texindex. Must be used if the
source document uses Texinfo @macros.
-Source files for standalone C programs (./lib, ./makeinfo, ./info):
+GNU Emacs related files:
+
+ texinfmt.el This Emacs Lisp file provides the
+ functions that GNU Emacs uses to
+ format a Texinfo file into an Info
+ file.
+
+ texinfo.el This file provides Texinfo mode
+ for GNU Emacs.
+
+ texnfo-upd.el These files provides commands to
+ texnfo-tex.el help you write Texinfo files
+ makeinfo.el using GNU Emacs Texinfo mode.
+
+ detexinfo.el This extra utility file contains functions
+ to remove Texinfo commands from a
+ Texinfo source file.
+
+ info.el These are the standard GNU Emacs
+ informat.el Info reading and support files,
+ included here for your convenience.
+
+
+Source files for standalone C programs:
makeinfo.c This file contains the source for
the `makeinfo' program that you can
@@ -92,7 +128,7 @@ Source files for standalone C programs (./lib, ./makeinfo, ./info):
getopt.h
-Installation files:
+C Installation files:
configure This file creates creates a Makefile
which in turn creates an `info' or
@@ -100,22 +136,22 @@ Installation files:
distribution.
configure.in This is a template for creating
- `configure' using Autoconf.
+ `configure' using m4 macros.
Makefile.in This is a template for `configure'
- to use to make a Makefile. Created by
- Automake.
-
- Makefile.am This is a template for Automake
- to use to make a Makefile.in.
+ to use to make a Makefile.
-Other files (util):
+Other files:
NEWS This contains a summary of new
features since the first edition
of Texinfo.
+ info.1 This is a `man' page that briefly
+ describes the standalone `info'
+ program.
+
fixfonts This is a shell script to install the
`lcircle10' TeX fonts as an alias for
the `circle10' fonts. In some older
diff --git a/contrib/texinfo/TODO b/contrib/texinfo/TODO
index 6df65a872ef1..de5b571722f5 100644
--- a/contrib/texinfo/TODO
+++ b/contrib/texinfo/TODO
@@ -1,79 +1,35 @@
-If you are interested in working on any of these, email bug-texinfo@gnu.org.
+If you are interested in working on any of these,
+email bug-texinfo@prep.ai.mit.edu.
-* Makeinfo:
- - HTML output is being actively worked on, and with luck will be in
- the next release.
- - A detexinfo program, like detex or delatex. This command would
- strip all the texinfo commands out, and would be used as a filter on
- the way to a speller. An option would be to NOT strip comments out.
- makeinfo --no-headers comes close.
- - If node name contains an @ command, complain explicitly.
- - Better ASCII output: convert menus to single table of contents,
- enumerate chapters and sections, convert cross-refs and indices to
- chapter/section references. See:
- ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip
- - Call Ghostscript to get ASCII output for the @image command.
+* Use Automake.
-* TeX:
- - Use @ as the escape character, and Texinfo syntax generally, in the
- table of contents, aux, and index files. Eliminate all the crazy
- multiple redefinitions of every Texinfo command in different contexts.
- - Handle @hsep and @vsep in @multitables.
+* Use a config header file instead of @DEFS@.
-* General:
- - Better i18n support, including support for 8-bit input characters,
- and 8-bit output in info. Perhaps have to use the ec fonts.
- - Support compressed image files, automatic generation of .txt
- or .jpg from .eps by Ghostscript.
- - Repeat TeX run until cross-references stabilize, not just twice.
- (Document this in manual and fix texi2dvi.)
- - Handle reference card creation, perhaps by only paying attention to
- sectioning and @def... commands.
- - Allow : in node names for info files, for names like `class::method'.
- - Get Info declared as a MIME Content-Type.
+* A detexinfo program, like detex or delatex. This command would
+ strip all the texinfo commands out, and would be used as a filter on
+ the way to a speller. An option would be to NOT strip comments out.
+ makeinfo --no-headers come close.
-* Language:
- - @figure:
-@figure [xref-label]
-@figureinclude <filename>, [<height>], [<width>]
-@figurehsize <dimen>
-@figurevsize <dimen>
-@caption ... @end caption
-<arbitrary Texinfo commands>
-@end figure
- - @flushboth to combine @flushleft and @flushright, for RFC's.
- - @part sectioning command.
- - Anchors a la HTML?
- - Allow subitems and `see' and `see also' in indices.
- - @exercise/@answer command for, e.g., gawk.
- - Allow @hsep/@vsep at @item, instead of just in template.
- - The dark corner symbol for the gawk manual.
- - Change bars. This is difficult or impossible in TeX,
- unfortunately. To do it right requires device driver support.
+* Change bars. This is difficult or impossible in TeX,
+ unfortunately. To do it right requires device driver support.
-* Doc:
- - Include a complete functional summary, as in a reference card, in
- the manual.
- - Improve the manuals for makeinfo, standalone info, etc.
- - Page 39, need a new section on doing dedication pages. See gawk.texi
- for an example of doing it in both the tex and info versions.
+* The dark corner symbol for the gawk manual.
-* Info:
- - Search all nodes of dir file at startup, then can have
- INFO-DIR-SEPARATE-GROUPS and other such.
- - Better dir file merging.
- - Steal interface ideas from Lynx: TAB for navigating to next link
- within a page, number links, etc.
- - q within help should quit help like C-x 0.
- - Full-text search on all available info files.
- - Incorporate an X-based viewer, perhaps tkinfo:
- http://www.math.ucsb.edu/~boldt/tkinfo/.
- - Perhaps process Texinfo files directly instead of converting to Info:
- ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z
- + ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/rman.tar.Z
- + Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory.
- From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps)
+* Better i18n support, including support for 8-bit input
+ characters. Requires fonts, and the DC fonts are not (as of this
+ writing) free.
-* Install-info:
- - be able to copy the info file to compile-time $(infodir), to
- simplify by-hand installation.
+* @exercise/@answer command for, e.g., gawk.
+
+* @figure.
+
+* HTML output in makeinfo.
+
+* Include a complete functional summary, a la a reference card, in the manual.
+
+* Use @ as the escape character, and Texinfo syntax generally, in the
+ table of contents, aux, and index files. Eliminate all the crazy
+ redefinitions of every Texinfo command (which lists always seem to be
+ incomplete).
+
+* Improve the manuals for makeinfo, standalone info, etc.
diff --git a/contrib/texinfo/acconfig.h b/contrib/texinfo/acconfig.h
deleted file mode 100644
index 6c34c33acc2b..000000000000
--- a/contrib/texinfo/acconfig.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-@TOP@
-
-/* Define to 1 if NLS is requested. */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define as 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define to the name of the distribution. */
-#undef PACKAGE
-
-/* Define to the version of the distribution. */
-#undef VERSION
-
-@BOTTOM@
-
-/* For gettext (NLS) */
-#include <libintl.h>
-#define _(String) gettext (String)
-#define N_(String) (String)
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/contrib/texinfo/aclocal.m4 b/contrib/texinfo/aclocal.m4
deleted file mode 100644
index 1c120d3dfa2f..000000000000
--- a/contrib/texinfo/aclocal.m4
+++ /dev/null
@@ -1,513 +0,0 @@
-dnl aclocal.m4 generated automatically by aclocal 1.2f
-
-dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-dnl This Makefile.in is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-AC_DEFUN(AM_CONFIG_HEADER,
-[AC_PREREQ([2.12])
-AC_CONFIG_HEADER([$1])
-dnl When config.status generates a header, we must update the stamp-h file.
-dnl This file resides in the same directory as the config header
-dnl that is generated. We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
- case " <<$>>CONFIG_HEADERS " in
- *" <<$>>am_file "*<<)>>
- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
-
-# Do all the work for Automake. This macro actually does too much --
-# some checks are only needed if your package does certain things.
-# But this isn't really a big deal.
-
-# serial 1
-
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
-
-AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AM_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
-
-
-# serial 1
-
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_REQUIRE([AC_PROG_INSTALL])
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
-
-#
-# Check to make sure that the build environment is sane.
-#
-
-AC_DEFUN(AM_SANITY_CHECK,
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftestfile
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "[$]*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
- fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "[$]2" = conftestfile
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-rm -f conftest*
-AC_MSG_RESULT(yes)])
-
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
-else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
-fi
-AC_SUBST($1)])
-
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 3
-
-AC_DEFUN(AM_WITH_NLS,
- [AC_MSG_CHECKING([whether NLS is requested])
- dnl Default is enabled NLS
- AC_ARG_ENABLE(nls,
- [ --disable-nls do not use Native Language Support],
- USE_NLS=$enableval, USE_NLS=yes)
- AC_MSG_RESULT($USE_NLS)
- AC_SUBST(USE_NLS)
-
- USE_INCLUDED_LIBINTL=no
-
- dnl If we use NLS figure out what method
- if test "$USE_NLS" = "yes"; then
- AC_DEFINE(ENABLE_NLS)
- AC_MSG_CHECKING([whether included gettext is requested])
- AC_ARG_WITH(included-gettext,
- [ --with-included-gettext use the GNU gettext library included here],
- nls_cv_force_use_gnu_gettext=$withval,
- nls_cv_force_use_gnu_gettext=no)
- AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
-
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- dnl User does not insist on using GNU NLS library. Figure out what
- dnl to use. If gettext or catgets are available (in this order) we
- dnl use this. Else we have to fall back to GNU NLS library.
- dnl catgets is only used if permitted by option --with-catgets.
- nls_cv_header_intl=
- nls_cv_header_libgt=
- CATOBJEXT=NONE
-
- AC_CHECK_HEADER(libintl.h,
- [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
- [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
- gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
-
- if test "$gt_cv_func_gettext_libc" != "yes"; then
- AC_CHECK_LIB(intl, bindtextdomain,
- [AC_CACHE_CHECK([for gettext in libintl],
- gt_cv_func_gettext_libintl,
- [AC_TRY_LINK([], [return (int) gettext ("")],
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)])])
- fi
-
- if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes"; then
- AC_DEFINE(HAVE_GETTEXT)
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
- if test "$MSGFMT" != "no"; then
- AC_CHECK_FUNCS(dcgettext)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr],
- [CATOBJEXT=.gmo
- DATADIRNAME=share],
- [CATOBJEXT=.mo
- DATADIRNAME=lib])
- INSTOBJEXT=.mo
- fi
- fi
- ])
-
- if test "$CATOBJEXT" = "NONE"; then
- AC_MSG_CHECKING([whether catgets can be used])
- AC_ARG_WITH(catgets,
- [ --with-catgets use catgets functions if available],
- nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
- AC_MSG_RESULT($nls_cv_use_catgets)
-
- if test "$nls_cv_use_catgets" = "yes"; then
- dnl No gettext in C library. Try catgets next.
- AC_CHECK_LIB(i, main)
- AC_CHECK_FUNC(catgets,
- [AC_DEFINE(HAVE_CATGETS)
- INTLOBJS="\$(CATOBJS)"
- AC_PATH_PROG(GENCAT, gencat, no)dnl
- if test "$GENCAT" != "no"; then
- AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
- if test "$GMSGFMT" = "no"; then
- AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
- fi
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.cat
- INSTOBJEXT=.cat
- DATADIRNAME=lib
- INTLDEPS='$(top_builddir)/intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi])
- fi
- fi
-
- if test "$CATOBJEXT" = "NONE"; then
- dnl Neither gettext nor catgets in included in the C library.
- dnl Fall back on GNU gettext library.
- nls_cv_use_gnu_gettext=yes
- fi
- fi
-
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- dnl Mark actions used to generate GNU NLS library.
- INTLOBJS="\$(GETTOBJS)"
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_SUBST(MSGFMT)
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.gmo
- INSTOBJEXT=.mo
- DATADIRNAME=share
- INTLDEPS='$(top_builddir)/intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi
-
- dnl Test whether we really found GNU xgettext.
- if test "$XGETTEXT" != ":"; then
- dnl If it is no GNU xgettext we define it as : so that the
- dnl Makefiles still can work.
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
- : ;
- else
- AC_MSG_RESULT(
- [found xgettext programs is not GNU xgettext; ignore it])
- XGETTEXT=":"
- fi
- fi
-
- # We need to process the po/ directory.
- POSUB=po
- else
- DATADIRNAME=share
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi
-
- # If this is used in GNU gettext we have to set USE_NLS to `yes'
- # because some of the sources are only built for this goal.
- if test "$PACKAGE" = gettext; then
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
- fi
-
- dnl These rules are solely for the distribution goal. While doing this
- dnl we only have to keep exactly one list of the available catalogs
- dnl in configure.in.
- for lang in $ALL_LINGUAS; do
- GMOFILES="$GMOFILES $lang.gmo"
- POFILES="$POFILES $lang.po"
- done
-
- dnl Make all variables we use known to autoconf.
- AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATALOGS)
- AC_SUBST(CATOBJEXT)
- AC_SUBST(DATADIRNAME)
- AC_SUBST(GMOFILES)
- AC_SUBST(INSTOBJEXT)
- AC_SUBST(INTLDEPS)
- AC_SUBST(INTLLIBS)
- AC_SUBST(INTLOBJS)
- AC_SUBST(POFILES)
- AC_SUBST(POSUB)
- ])
-
-AC_DEFUN(AM_GNU_GETTEXT,
- [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_OFF_T])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
-
- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h])
- AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
-
- if test "${ac_cv_func_stpcpy+set}" != "set"; then
- AC_CHECK_FUNCS(stpcpy)
- fi
- if test "${ac_cv_func_stpcpy}" = "yes"; then
- AC_DEFINE(HAVE_STPCPY)
- fi
-
- AM_LC_MESSAGES
- AM_WITH_NLS
-
- if test "x$CATOBJEXT" != "x"; then
- if test "x$ALL_LINGUAS" = "x"; then
- LINGUAS=
- else
- AC_MSG_CHECKING(for catalogs to be installed)
- NEW_LINGUAS=
- for lang in ${LINGUAS=$ALL_LINGUAS}; do
- case "$ALL_LINGUAS" in
- *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
- esac
- done
- LINGUAS=$NEW_LINGUAS
- AC_MSG_RESULT($LINGUAS)
- fi
-
- dnl Construct list of names of catalog files to be constructed.
- if test -n "$LINGUAS"; then
- for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
- fi
- fi
-
- dnl The reference to <locale.h> in the installed <libintl.h> file
- dnl must be resolved because we cannot expect the users of this
- dnl to define HAVE_LOCALE_H.
- if test $ac_cv_header_locale_h = yes; then
- INCLUDE_LOCALE_H="#include <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. Take care yourself. */"
- fi
- AC_SUBST(INCLUDE_LOCALE_H)
-
- dnl Determine which catalog format we have (if any is needed)
- dnl For now we know about two different formats:
- dnl Linux libc-5 and the normal X/Open format
- test -d intl || mkdir intl
- if test "$CATOBJEXT" = ".cat"; then
- AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
-
- dnl Transform the SED scripts while copying because some dumb SEDs
- dnl cannot handle comments.
- sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
- fi
- dnl po2tbl.sed is always needed.
- sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
- $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
-
- dnl In the intl/Makefile.in we have a special dependency which makes
- dnl only sense for gettext. We comment this out for non-gettext
- dnl packages.
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- fi
- AC_SUBST(GT_NO)
- AC_SUBST(GT_YES)
-
- dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
- dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
- dnl Try to locate is.
- MKINSTALLDIRS=
- if test -n "$ac_aux_dir"; then
- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
- fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
- fi
- AC_SUBST(MKINSTALLDIRS)
-
- dnl *** For now the libtool support in intl/Makefile is not for real.
- l=
- AC_SUBST(l)
-
- dnl Generate list of files to be processed by xgettext which will
- dnl be included in po/Makefile.
- test -d po || mkdir po
- if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
- posrcprefix="$srcdir/"
- else
- posrcprefix="../$srcdir/"
- fi
- else
- posrcprefix="../"
- fi
- rm -f po/POTFILES
- sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
- < $srcdir/po/POTFILES.in > po/POTFILES
- ])
-
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 1996.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-AC_DEFUN(AM_LC_MESSAGES,
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
- if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES)
- fi
- fi])
-
diff --git a/contrib/texinfo/config.guess b/contrib/texinfo/config.guess
deleted file mode 100755
index 30230b3dfe9d..000000000000
--- a/contrib/texinfo/config.guess
+++ /dev/null
@@ -1,890 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- cat <<EOF >dummy.s
- .globl main
- .ent main
-main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- ${CC-cc} dummy.s -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
- fi
- rm -f dummy.s dummy
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-cbm-sysv4
- exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc64:OpenBSD:*:*)
- echo mips64el-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hkmips:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- arm32:NetBSD:*:*)
- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- SR2?01:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >dummy.c
- int main (argc, argv) int argc; char **argv; {
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- ${CC-cc} dummy.c -o dummy \
- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:4)
- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=4.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[3478]??:HP-UX:*:*)
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
- 9000/8?? ) HP_ARCH=hppa1.0 ;;
- esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i?86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- F300:UNIX_System_V:*:*)
- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- i?86:BSD/386:*:* | *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin32
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin32
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- arm* | sa110*) UNAME_MACHINE="arm" ;;
- esac
-
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us.
- ld_help_string=`ld --help 2>&1`
- ld_supported_emulations=`echo $ld_help_string \
- | sed -ne '/supported emulations:/!d
- s/[ ][ ]*/ /g
- s/.*supported emulations: *//
- s/ .*//
- p'`
- case "$ld_supported_emulations" in
- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
- esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- LIBC=""
- ${CC-cc} dummy.s -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
-
- objdump --private-headers dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f dummy.s dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >dummy.c <<EOF
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
- echo i386-sequent-sysv4
- exit 0 ;;
- i?86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- i?86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- i?86:LynxOS:2.*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:*:6*)
- echo mips-sony-newsos6
- exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-cat >dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-#echo '(Unable to guess system type)' 1>&2
-
-exit 1
diff --git a/contrib/texinfo/config.h b/contrib/texinfo/config.h
deleted file mode 100644
index d6906afe2482..000000000000
--- a/contrib/texinfo/config.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* 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 if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if you don't have vprintf but do have _doprnt. */
-/* #undef HAVE_DOPRNT */
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define if you have the vprintf function. */
-#define HAVE_VPRINTF 1
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-/* #undef SETVBUF_REVERSED */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
-
-/* 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 run-time.
- 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 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if your <sys/time.h> declares struct tm. */
-/* #undef TM_IN_SYS_TIME */
-
-/* Define to 1 if NLS is requested. */
-#define ENABLE_NLS 1
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-/* #undef HAVE_CATGETS */
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
-
-/* Define as 1 if you have the stpcpy function. */
-/* #undef HAVE_STPCPY */
-
-/* Define to the name of the distribution. */
-#define PACKAGE "texinfo"
-
-/* Define to the version of the distribution. */
-#define VERSION "3.12"
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the bzero function. */
-#define HAVE_BZERO 1
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the memcpy function. */
-#define HAVE_MEMCPY 1
-
-/* Define if you have the memmove function. */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the memset function. */
-#define HAVE_MEMSET 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the setvbuf function. */
-#define HAVE_SETVBUF 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the sigsetmask function. */
-#define HAVE_SIGSETMASK 1
-
-/* Define if you have the stpcpy function. */
-/* #undef HAVE_STPCPY */
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 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 <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
-
-/* Define if you have the <ncurses/termcap.h> header file. */
-/* #undef HAVE_NCURSES_TERMCAP_H */
-
-/* Define if you have the <nl_types.h> header file. */
-#define HAVE_NL_TYPES_H 1
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <sys/fcntl.h> header file. */
-#define HAVE_SYS_FCNTL_H 1
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/ptem.h> header file. */
-/* #undef HAVE_SYS_PTEM_H */
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/ttold.h> header file. */
-/* #undef HAVE_SYS_TTOLD_H */
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <termcap.h> header file. */
-#define HAVE_TERMCAP_H 1
-
-/* Define if you have the <termio.h> header file. */
-/* #undef HAVE_TERMIO_H */
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <values.h> header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the bsd library (-lbsd). */
-/* #undef HAVE_LIBBSD */
-
-/* Define if you have the i library (-li). */
-/* #undef HAVE_LIBI */
-
-/* Define if you have the z library (-lz). */
-#define HAVE_LIBZ 1
-
-/* For gettext (NLS) */
-#include <libintl.h>
-#define _(String) gettext (String)
-#define N_(String) (String)
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/contrib/texinfo/config.h.in b/contrib/texinfo/config.h.in
deleted file mode 100644
index f814b6573c5e..000000000000
--- a/contrib/texinfo/config.h.in
+++ /dev/null
@@ -1,257 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* 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 if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-#undef SETVBUF_REVERSED
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* 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 run-time.
- 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 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define to 1 if NLS is requested. */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define as 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define to the name of the distribution. */
-#undef PACKAGE
-
-/* Define to the version of the distribution. */
-#undef VERSION
-
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
-
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
-
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
-
-/* Define if you have the bzero function. */
-#undef HAVE_BZERO
-
-/* Define if you have the dcgettext function. */
-#undef HAVE_DCGETTEXT
-
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
-
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define if you have the memcpy function. */
-#undef HAVE_MEMCPY
-
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the memset function. */
-#undef HAVE_MEMSET
-
-/* Define if you have the munmap function. */
-#undef HAVE_MUNMAP
-
-/* Define if you have the putenv function. */
-#undef HAVE_PUTENV
-
-/* Define if you have the setenv function. */
-#undef HAVE_SETENV
-
-/* Define if you have the setlocale function. */
-#undef HAVE_SETLOCALE
-
-/* Define if you have the setvbuf function. */
-#undef HAVE_SETVBUF
-
-/* Define if you have the sigprocmask function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if you have the sigsetmask function. */
-#undef HAVE_SIGSETMASK
-
-/* Define if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define if you have the strcasecmp function. */
-#undef HAVE_STRCASECMP
-
-/* Define if you have the strchr function. */
-#undef HAVE_STRCHR
-
-/* 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 <argz.h> header file. */
-#undef HAVE_ARGZ_H
-
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the <ncurses/termcap.h> header file. */
-#undef HAVE_NCURSES_TERMCAP_H
-
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
-
-/* Define if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define if you have the <sys/fcntl.h> header file. */
-#undef HAVE_SYS_FCNTL_H
-
-/* Define if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the <sys/ptem.h> header file. */
-#undef HAVE_SYS_PTEM_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/ttold.h> header file. */
-#undef HAVE_SYS_TTOLD_H
-
-/* Define if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if you have the <termcap.h> header file. */
-#undef HAVE_TERMCAP_H
-
-/* Define if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
-/* Define if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the <values.h> header file. */
-#undef HAVE_VALUES_H
-
-/* Define if you have the bsd library (-lbsd). */
-#undef HAVE_LIBBSD
-
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
-
-/* Define if you have the z library (-lz). */
-#undef HAVE_LIBZ
-
-/* For gettext (NLS) */
-#include <libintl.h>
-#define _(String) gettext (String)
-#define N_(String) (String)
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/contrib/texinfo/config.sub b/contrib/texinfo/config.sub
deleted file mode 100755
index e24b8504126a..000000000000
--- a/contrib/texinfo/config.sub
+++ /dev/null
@@ -1,952 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
-
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- linux-gnu*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
- os=
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 \
- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
- | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
- | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | v850)
- basic_machine=$basic_machine-unknown
- ;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
- | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
- | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
- | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mipstx39-* | mipstx39el-* \
- | f301-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-cbm
- ;;
- amigaos | amigados)
- basic_machine=m68k-cbm
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-cbm
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [ctj]90-cray)
- basic_machine=c90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- os=-mvs
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i[34567]86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i[34567]86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i[34567]86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | nexen)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | k6 | 6x86)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | nexen-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | k6-* | 6x86-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=rs6000-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sparc)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -xenix)
- os=-xenix
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-semi)
- os=-aout
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-ibm)
- os=-aix
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f301-fujitsu)
- os=-uxpv
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -hpux*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
diff --git a/contrib/texinfo/configure b/contrib/texinfo/configure
index 86ba98ee409d..b02b2784a3e7 100755
--- a/contrib/texinfo/configure
+++ b/contrib/texinfo/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.10
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -11,12 +11,6 @@
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
-ac_help="$ac_help
- --disable-nls do not use Native Language Support"
-ac_help="$ac_help
- --with-included-gettext use the GNU gettext library included here"
-ac_help="$ac_help
- --with-catgets use catgets functions if available"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -55,8 +49,6 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
ac_prev=
for ac_option
@@ -338,7 +330,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.10"
exit 0 ;;
-with-* | --with-*)
@@ -440,14 +432,11 @@ do
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
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
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
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
@@ -456,7 +445,7 @@ 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=makeinfo/makeinfo.c
+ac_unique_file=texinfo.texi
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
@@ -509,7 +498,6 @@ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
@@ -525,265 +513,9 @@ fi
-
-
-
-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
-# 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:562: 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="${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.
- for ac_prog in ginstall installbsd 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.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- 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_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:615: checking whether build environment is sane" >&5
-# Just in case
-sleep 1
-echo timestamp > conftestfile
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
- fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
- fi
-
- test "$2" = conftestfile
- )
-then
- # Ok.
- :
-else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-rm -f conftest*
-echo "$ac_t""yes" 1>&6
-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,"
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:672: 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
-
-
-PACKAGE=texinfo
-
-VERSION=3.12
-
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
-fi
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
-
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
-
-
-
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:718: checking for working aclocal" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal
- echo "$ac_t""found" 1>&6
-else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:731: checking for working autoconf" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
-else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:744: checking for working automake" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake
- echo "$ac_t""found" 1>&6
-else
- AUTOMAKE="$missing_dir/missing automake"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:757: checking for working autoheader" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
-else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:770: checking for working makeinfo" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
-else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
-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:787: 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
@@ -812,7 +544,6 @@ 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:816: 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
@@ -859,47 +590,7 @@ 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:864: 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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 874 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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*
-
-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:898: 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:903: 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
@@ -908,7 +599,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:603: \"$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
@@ -916,34 +607,29 @@ fi
fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- 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:927: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ if test "${CFLAGS+set}" != set; then
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_prog_gcc_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
+ ac_cv_prog_gcc_g=yes
else
- ac_cv_prog_cc_g=no
+ ac_cv_prog_gcc_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
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
+echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
+ if test $ac_cv_prog_gcc_g = yes; then
+ CFLAGS="-g -O"
+ else
+ CFLAGS="-O"
+ fi
fi
else
GCC=
@@ -951,7 +637,6 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:955: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -966,37 +651,33 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 970 "configure"
+#line 655 "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:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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 987 "configure"
+#line 670 "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:993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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
@@ -1013,13 +694,12 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1017: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1023 "configure"
+#line 703 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1037,7 +717,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1041 "configure"
+#line 721 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1058,6 +738,25 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
fi
fi
+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:
@@ -1069,12 +768,11 @@ fi
# 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:1073: 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="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
@@ -1097,7 +795,7 @@ else
;;
esac
done
- IFS="$ac_save_IFS"
+ IFS="$ac_save_ifs"
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -1121,7 +819,6 @@ 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:1125: 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
@@ -1148,42 +845,7 @@ else
fi
-# We do this for the sake of a more helpful warning in doc/Makefile.
-TEXMF='$(datadir)/texmf'
-# Extract the first word of "texconfig", so it can be a program name with args.
-set dummy texconfig; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1157: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_TEXCONFIG'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$TEXCONFIG"; then
- ac_cv_prog_TEXCONFIG="$TEXCONFIG" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_TEXCONFIG="true"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_TEXCONFIG" && ac_cv_prog_TEXCONFIG="false"
-fi
-fi
-TEXCONFIG="$ac_cv_prog_TEXCONFIG"
-if test -n "$TEXCONFIG"; then
- echo "$ac_t""$TEXCONFIG" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
-
-
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1187: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -1203,27 +865,24 @@ else
ISC=
fi
-ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
+ac_safe=`echo "minix/config.h" | tr './\055' '___'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1209: checking for minix/config.h" >&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 1214 "configure"
+#line 875 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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
@@ -1253,127 +912,31 @@ EOF
fi
-echo $ac_n "checking for gzdopen in -lz""... $ac_c" 1>&6
-echo "configure:1258: checking for gzdopen in -lz" >&5
-ac_lib_var=`echo z'_'gzdopen | 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="-lz $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1266 "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 gzdopen();
-
-int main() {
-gzdopen()
-; return 0; }
-EOF
-if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lz $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
-echo $ac_n "checking for sigblock""... $ac_c" 1>&6
-echo "configure:1307: checking for sigblock" >&5
-if eval "test \"`echo '$''{'ac_cv_func_sigblock'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1312 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char sigblock(); 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 sigblock();
-
-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_sigblock) || defined (__stub___sigblock)
-choke me
-#else
-sigblock();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_sigblock=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_sigblock=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'sigblock`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for sigblock in -lbsd""... $ac_c" 1>&6
-echo "configure:1353: checking for sigblock in -lbsd" >&5
-ac_lib_var=`echo bsd'_'sigblock | sed 'y%./+-%__p_%'`
+# Needed on sysV68 for sigblock, sigsetmask.
+echo $ac_n "checking for -lbsd""... $ac_c" 1>&6
+ac_lib_var=`echo bsd'_'sigblock | tr './+\055' '__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="-lbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1361 "configure"
+#line 925 "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 sigblock();
-int main() {
+int main() { return 0; }
+int t() {
sigblock()
; return 0; }
EOF
-if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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
@@ -1383,8 +946,7 @@ 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 bsd | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ ac_tr_lib=HAVE_LIB`echo bsd | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
@@ -1395,39 +957,33 @@ else
echo "$ac_t""no" 1>&6
fi
-fi
-
-# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
-# rather ncurses. So we check for it.
TERMLIBS=
-for termlib in ncurses curses termcap terminfo termlib ; do
- echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6
-echo "configure:1407: checking for tputs in -l${termlib}" >&5
-ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'`
+for termlib in curses termcap terminfo termlib ; do
+ echo $ac_n "checking for -l${termlib}""... $ac_c" 1>&6
+ac_lib_var=`echo ${termlib}'_'tputs | tr './+\055' '__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="-l${termlib} $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1415 "configure"
+#line 972 "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 tputs();
-int main() {
+int main() { return 0; }
+int t() {
tputs()
; return 0; }
EOF
-if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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
@@ -1445,55 +1001,38 @@ fi
done
-if test "x$termlib" = xncurses; then
- for ac_hdr in ncurses/termcap.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1454: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+# If we cannot run a trivial program, we must be cross compiling.
+echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1459 "configure"
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_cross=yes
+else
+cat > conftest.$ac_ext <<EOF
+#line 1014 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+main(){return(0);}
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+{ (eval echo configure:1018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
+ ac_cv_c_cross=no
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"
+ ac_cv_c_cross=yes
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
+rm -fr conftest*
fi
-done
-fi
+echo "$ac_t""$ac_cv_c_cross" 1>&6
+cross_compiling=$ac_cv_c_cross
+
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1492: 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 1497 "configure"
+#line 1036 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1501,15 +1040,13 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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
@@ -1518,7 +1055,7 @@ 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 1522 "configure"
+#line 1059 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1536,7 +1073,7 @@ 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 1540 "configure"
+#line 1077 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1556,8 +1093,8 @@ if test $ac_cv_header_stdc = yes; then
if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1561 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 1098 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1568,18 +1105,14 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+{ (eval echo configure:1109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+if test -s conftest && (./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
-
+rm -fr conftest*
fi
fi
@@ -1591,31 +1124,27 @@ EOF
fi
-for ac_hdr in fcntl.h pwd.h string.h strings.h termcap.h termio.h \
- termios.h unistd.h \
- sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h
+for ac_hdr in unistd.h termios.h termio.h strings.h string.h varargs.h \
+ sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1601: 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 1606 "configure"
+#line 1137 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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
@@ -1623,7 +1152,7 @@ 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___%'`
+ ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
@@ -1635,21 +1164,19 @@ done
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1639: 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 1644 "configure"
+#line 1172 "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 "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "off_t" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_off_t=yes
else
@@ -1667,57 +1194,16 @@ EOF
fi
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1672: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_type_signal=void
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1713: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
+#line 1203 "configure"
#include "confdefs.h"
-int main() {
+int main() { return 0; }
+int t() {
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x;
@@ -1763,16 +1249,15 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_const=no
fi
rm -f conftest*
+
fi
echo "$ac_t""$ac_cv_c_const" 1>&6
@@ -1784,29 +1269,28 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1788: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1793 "configure"
+#line 1277 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
-int main() {
+int main() { return 0; }
+int t() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:1801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_struct_tm=sys/time.h
fi
rm -f conftest*
+
fi
echo "$ac_t""$ac_cv_struct_tm" 1>&6
@@ -1821,28 +1305,27 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1825: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1830 "configure"
+#line 1313 "configure"
#include "confdefs.h"
#include <alloca.h>
-int main() {
+int main() { return 0; }
+int t() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_alloca_h=no
fi
rm -f conftest*
+
fi
echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
@@ -1854,12 +1337,11 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1858: checking for alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1863 "configure"
+#line 1345 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1878,31 +1360,31 @@ char *alloca ();
# endif
#endif
-int main() {
+int main() { return 0; }
+int t() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
- ac_cv_func_alloca_works=yes
+ ac_cv_func_alloca=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_func_alloca_works=no
+ ac_cv_func_alloca=no
fi
rm -f conftest*
+
fi
-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
-if test $ac_cv_func_alloca_works = yes; then
+echo "$ac_t""$ac_cv_func_alloca" 1>&6
+if test $ac_cv_func_alloca = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA 1
EOF
fi
-if test $ac_cv_func_alloca_works = no; then
+if test $ac_cv_func_alloca = no; then
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
@@ -1914,12 +1396,11 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1918: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1923 "configure"
+#line 1404 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1944,12 +1425,11 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1948: 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 1953 "configure"
+#line 1433 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1959,7 +1439,8 @@ else
builtin and then its argument prototype would still apply. */
char $ac_func();
-int main() {
+int main() { return 0; }
+int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
@@ -1972,18 +1453,16 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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
+fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<EOF
@@ -1999,15 +1478,14 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2003: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
- cat > conftest.$ac_ext <<EOF
-#line 2011 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 1489 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2026,18 +1504,14 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+{ (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_stack_direction=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
ac_cv_c_stack_direction=-1
fi
-rm -fr conftest*
fi
-
+rm -fr conftest*
fi
echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
@@ -2047,121 +1521,15 @@ EOF
fi
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2052: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2057 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vprintf(); 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 vprintf();
-
-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_vprintf) || defined (__stub___vprintf)
-choke me
-#else
-vprintf();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_vprintf=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2104: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2109 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char _doprnt(); 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 _doprnt();
-
-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__doprnt) || defined (__stub____doprnt)
-choke me
-#else
-_doprnt();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func__doprnt=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_DOPRNT 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
-echo "configure:2157: checking whether setvbuf arguments are reversed" >&5
if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
- cat > conftest.$ac_ext <<EOF
-#line 2165 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 1533 "configure"
#include "confdefs.h"
#include <stdio.h>
/* If setvbuf has the reversed format, exit 0. */
@@ -2175,18 +1543,14 @@ main () {
exit(0); /* Non-reversed systems segv here. */
}
EOF
-if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+{ (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_func_setvbuf_reversed=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
ac_cv_func_setvbuf_reversed=no
fi
-rm -fr conftest*
fi
-
+rm -fr conftest*
rm -f core core.* *.core
fi
@@ -2199,70 +1563,14 @@ EOF
fi
for ac_func in setvbuf getcwd memset bzero strchr strcasecmp \
- sigprocmask sigsetmask
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2206: 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 2211 "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:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
-
-for ac_func in memcpy memmove strdup strerror
+ vfprintf vsprintf strerror sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2261: 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 2266 "configure"
+#line 1574 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2272,7 +1580,8 @@ else
builtin and then its argument prototype would still apply. */
char $ac_func();
-int main() {
+int main() { return 0; }
+int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
@@ -2285,190 +1594,16 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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}.o"
-fi
-done
-
-
-
-ALL_LINGUAS="de fr"
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2318: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat > conftest.$ac_ext <<EOF
-#line 2325 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_inline=$ac_kw; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
- inline | yes) ;;
- no) cat >> confdefs.h <<\EOF
-#define inline
-EOF
- ;;
- *) cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
-EOF
- ;;
-esac
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2358: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2363 "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 "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
-else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-for ac_hdr in unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2394: 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 2399 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
-
-for ac_func in getpagesize
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2433: 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 2438 "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:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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'`
@@ -2481,229 +1616,14 @@ else
fi
done
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2486: checking for working mmap" >&5
-if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat > conftest.$ac_ext <<EOF
-#line 2494 "configure"
-#include "confdefs.h"
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
-
-/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
-int
-main()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
-}
-
-EOF
-if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_mmap_fixed_mapped=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -fr conftest*
-fi
-
-fi
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
-
-fi
-
-
- for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2662: 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 2667 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
-
- for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next
+for ac_func in memcpy memmove strdup
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2702: 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 2707 "configure"
+#line 1627 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2713,7 +1633,8 @@ else
builtin and then its argument prototype would still apply. */
char $ac_func();
-int main() {
+int main() { return 0; }
+int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
@@ -2726,1006 +1647,26 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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_stpcpy+set}" != "set"; then
- for ac_func in stpcpy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2759: 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 2764 "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:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
-
- fi
- if test "${ac_cv_func_stpcpy}" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_STPCPY 1
-EOF
-
- fi
-
- if test $ac_cv_header_locale_h = yes; then
- echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2821: checking for LC_MESSAGES" >&5
-if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2826 "configure"
-#include "confdefs.h"
-#include <locale.h>
-int main() {
-return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- am_cv_val_LC_MESSAGES=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- am_cv_val_LC_MESSAGES=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
- if test $am_cv_val_LC_MESSAGES = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_LC_MESSAGES 1
-EOF
-
- fi
- fi
- echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2854: checking whether NLS is requested" >&5
- # Check whether --enable-nls or --disable-nls was given.
-if test "${enable_nls+set}" = set; then
- enableval="$enable_nls"
- USE_NLS=$enableval
-else
- USE_NLS=yes
-fi
-
- echo "$ac_t""$USE_NLS" 1>&6
-
-
- USE_INCLUDED_LIBINTL=no
-
- if test "$USE_NLS" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define ENABLE_NLS 1
-EOF
-
- echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2874: checking whether included gettext is requested" >&5
- # Check whether --with-included-gettext or --without-included-gettext was given.
-if test "${with_included_gettext+set}" = set; then
- withval="$with_included_gettext"
- nls_cv_force_use_gnu_gettext=$withval
-else
- nls_cv_force_use_gnu_gettext=no
-fi
-
- echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
-
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- nls_cv_header_intl=
- nls_cv_header_libgt=
- CATOBJEXT=NONE
-
- ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2893: checking for libintl.h" >&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 2898 "configure"
-#include "confdefs.h"
-#include <libintl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
- echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2920: checking for gettext in libc" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2925 "configure"
-#include "confdefs.h"
-#include <libintl.h>
-int main() {
-return (int) gettext ("")
-; return 0; }
-EOF
-if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- gt_cv_func_gettext_libc=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gettext_libc=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
-
- if test "$gt_cv_func_gettext_libc" != "yes"; then
- echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2948: checking for bindtextdomain in -lintl" >&5
-ac_lib_var=`echo intl'_'bindtextdomain | 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="-lintl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2956 "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 bindtextdomain();
-
-int main() {
-bindtextdomain()
-; return 0; }
-EOF
-if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
- echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2983: checking for gettext in libintl" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2988 "configure"
-#include "confdefs.h"
-
-int main() {
-return (int) gettext ("")
-; return 0; }
-EOF
-if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- gt_cv_func_gettext_libintl=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gettext_libintl=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- fi
-
- if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_GETTEXT 1
-EOF
-
- # Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3023: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MSGFMT" in
- /*)
- ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
- ac_cv_path_MSGFMT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
- ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test -n "$MSGFMT"; then
- echo "$ac_t""$MSGFMT" 1>&6
+ :
else
echo "$ac_t""no" 1>&6
-fi
- if test "$MSGFMT" != "no"; then
- for ac_func in dcgettext
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3057: 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 3062 "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:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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*
+LIBOBJS="$LIBOBJS ${ac_func}.o"
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
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3112: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
- ;;
-esac
-fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- # Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3144: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$XGETTEXT" in
- /*)
- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
- ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
- ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- cat > conftest.$ac_ext <<EOF
-#line 3176 "configure"
-#include "confdefs.h"
-
-int main() {
-extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr
-; return 0; }
-EOF
-if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- CATOBJEXT=.gmo
- DATADIRNAME=share
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CATOBJEXT=.mo
- DATADIRNAME=lib
-fi
-rm -f conftest*
- INSTOBJEXT=.mo
- fi
- fi
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- if test "$CATOBJEXT" = "NONE"; then
- echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:3207: checking whether catgets can be used" >&5
- # Check whether --with-catgets or --without-catgets was given.
-if test "${with_catgets+set}" = set; then
- withval="$with_catgets"
- nls_cv_use_catgets=$withval
-else
- nls_cv_use_catgets=no
-fi
-
- echo "$ac_t""$nls_cv_use_catgets" 1>&6
-
- if test "$nls_cv_use_catgets" = "yes"; then
- echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:3220: checking for main in -li" >&5
-ac_lib_var=`echo i'_'main | 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="-li $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3228 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 i | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-li $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
- echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:3263: checking for catgets" >&5
-if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3268 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char catgets(); 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 catgets();
-
-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_catgets) || defined (__stub___catgets)
-choke me
-#else
-catgets();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_catgets=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_catgets=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_CATGETS 1
-EOF
-
- INTLOBJS="\$(CATOBJS)"
- # Extract the first word of "gencat", so it can be a program name with args.
-set dummy gencat; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3313: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GENCAT" in
- /*)
- ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GENCAT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no"
- ;;
-esac
-fi
-GENCAT="$ac_cv_path_GENCAT"
-if test -n "$GENCAT"; then
- echo "$ac_t""$GENCAT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- if test "$GENCAT" != "no"; then
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3345: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
- ;;
-esac
-fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test "$GMSGFMT" = "no"; then
- # Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3378: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
- ;;
-esac
-fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- fi
- # Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3413: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$XGETTEXT" in
- /*)
- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
- ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
- ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.cat
- INSTOBJEXT=.cat
- DATADIRNAME=lib
- INTLDEPS='$(top_builddir)/intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi
-else
- echo "$ac_t""no" 1>&6
-fi
-
- fi
- fi
-
- if test "$CATOBJEXT" = "NONE"; then
- nls_cv_use_gnu_gettext=yes
- fi
- fi
-
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- INTLOBJS="\$(GETTOBJS)"
- # Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3471: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MSGFMT" in
- /*)
- ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
- ac_cv_path_MSGFMT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
- ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test -n "$MSGFMT"; then
- echo "$ac_t""$MSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3505: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
- ;;
-esac
-fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- # Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3537: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$XGETTEXT" in
- /*)
- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
- ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
- ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.gmo
- INSTOBJEXT=.mo
- DATADIRNAME=share
- INTLDEPS='$(top_builddir)/intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi
-
- if test "$XGETTEXT" != ":"; then
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
- : ;
- else
- echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
- XGETTEXT=":"
- fi
- fi
-
- # We need to process the po/ directory.
- POSUB=po
- else
- DATADIRNAME=share
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi
-
- # If this is used in GNU gettext we have to set USE_NLS to `yes'
- # because some of the sources are only built for this goal.
- if test "$PACKAGE" = gettext; then
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
- fi
-
- for lang in $ALL_LINGUAS; do
- GMOFILES="$GMOFILES $lang.gmo"
- POFILES="$POFILES $lang.po"
- done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if test "x$CATOBJEXT" != "x"; then
- if test "x$ALL_LINGUAS" = "x"; then
- LINGUAS=
- else
- echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3627: checking for catalogs to be installed" >&5
- NEW_LINGUAS=
- for lang in ${LINGUAS=$ALL_LINGUAS}; do
- case "$ALL_LINGUAS" in
- *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
- esac
- done
- LINGUAS=$NEW_LINGUAS
- echo "$ac_t""$LINGUAS" 1>&6
- fi
-
- if test -n "$LINGUAS"; then
- for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
- fi
- fi
-
- if test $ac_cv_header_locale_h = yes; then
- INCLUDE_LOCALE_H="#include <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. Take care yourself. */"
- fi
-
-
- test -d intl || mkdir intl
- if test "$CATOBJEXT" = ".cat"; then
- ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3655: checking for linux/version.h" >&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 3660 "configure"
-#include "confdefs.h"
-#include <linux/version.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
- msgformat=linux
-else
- echo "$ac_t""no" 1>&6
-msgformat=xopen
-fi
-
-
- sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
- fi
- sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
- $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
-
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- fi
-
-
-
- MKINSTALLDIRS=
- if test -n "$ac_aux_dir"; then
- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
- fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
- fi
-
-
- l=
-
-
- test -d po || mkdir po
- if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
- posrcprefix="$srcdir/"
- else
- posrcprefix="../$srcdir/"
- fi
- else
- posrcprefix="../"
- fi
- rm -f po/POTFILES
- sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
- < $srcdir/po/POTFILES.in > po/POTFILES
-
-
trap '' 1 2 15
cat > confcache <<\EOF
@@ -3744,25 +1685,11 @@ cat > confcache <<\EOF
# --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) 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
+ sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
+ >> confcache
if cmp -s $cache_file confcache; then
:
else
@@ -3790,7 +1717,19 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-DEFS=-DHAVE_CONFIG_H
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -3817,7 +1756,7 @@ do
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.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.10"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -3828,15 +1767,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile \
- doc/Makefile \
- info/Makefile \
- intl/Makefile \
- lib/Makefile \
- makeinfo/Makefile \
- po/Makefile.in \
- util/Makefile \
- config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -3866,107 +1797,31 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-s%@AUTOMAKE@%$AUTOMAKE%g
-s%@AUTOHEADER@%$AUTOHEADER%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@SET_MAKE@%$SET_MAKE%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
-s%@TEXCONFIG@%$TEXCONFIG%g
-s%@TEXMF@%$TEXMF%g
s%@TERMLIBS@%$TERMLIBS%g
s%@ALLOCA@%$ALLOCA%g
s%@LIBOBJS@%$LIBOBJS%g
-s%@USE_NLS@%$USE_NLS%g
-s%@MSGFMT@%$MSGFMT%g
-s%@GMSGFMT@%$GMSGFMT%g
-s%@XGETTEXT@%$XGETTEXT%g
-s%@GENCAT@%$GENCAT%g
-s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
-s%@CATALOGS@%$CATALOGS%g
-s%@CATOBJEXT@%$CATOBJEXT%g
-s%@DATADIRNAME@%$DATADIRNAME%g
-s%@GMOFILES@%$GMOFILES%g
-s%@INSTOBJEXT@%$INSTOBJEXT%g
-s%@INTLDEPS@%$INTLDEPS%g
-s%@INTLLIBS@%$INTLLIBS%g
-s%@INTLOBJS@%$INTLOBJS%g
-s%@POFILES@%$POFILES%g
-s%@POSUB@%$POSUB%g
-s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
-s%@GT_NO@%$GT_NO%g
-s%@GT_YES@%$GT_YES%g
-s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
-s%@l@%$l%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 \
- doc/Makefile \
- info/Makefile \
- intl/Makefile \
- lib/Makefile \
- makeinfo/Makefile \
- po/Makefile.in \
- util/Makefile \
- "}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/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".
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ *:*) 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.
+ # Adjust relative srcdir, etc. for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
@@ -3994,7 +1849,6 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
[/$]*) 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."
@@ -4003,177 +1857,17 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# $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
+" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
+rm -f conftest.subs
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$nls_cv_header_libgt"
-ac_dests="$nls_cv_header_intl"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
-done
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/texinfo/configure.in b/contrib/texinfo/configure.in
index 425188beb0b3..52950dc880c2 100644
--- a/contrib/texinfo/configure.in
+++ b/contrib/texinfo/configure.in
@@ -1,80 +1,42 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.32 1998/03/03 18:29:17 karl Exp $
-dnl
-AC_INIT(makeinfo/makeinfo.c)
-AC_PREREQ(2.12)dnl Minimum Autoconf version required.
-AM_CONFIG_HEADER(config.h)
-
-AM_INIT_AUTOMAKE([texinfo], [3.12])
+dnl $Id: configure.in,v 1.3 1996/10/03 18:33:52 karl Exp $
+AC_INIT(texinfo.texi)
dnl Checks for programs.
-AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_RANLIB
-# We do this for the sake of a more helpful warning in doc/Makefile.
-TEXMF='$(datadir)/texmf'
-AC_CHECK_PROG(TEXCONFIG, texconfig, true, false)
-$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
-AC_SUBST(TEXMF)
-
AC_ISC_POSIX
AC_MINIX
dnl Checks for libraries.
-AC_CHECK_LIB(z, gzdopen)
+# Needed on sysV68 for sigblock, sigsetmask.
+AC_CHECK_LIB(bsd, sigblock)
-# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
-AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
-
-# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
-# rather ncurses. So we check for it.
TERMLIBS=
-for termlib in ncurses curses termcap terminfo termlib ; do
+for termlib in curses termcap terminfo termlib ; do
AC_CHECK_LIB(${termlib}, tputs,
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done
AC_SUBST(TERMLIBS)
dnl Checks for header files.
-dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
-if test "x$termlib" = xncurses; then
- dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
- AC_CHECK_HEADERS(ncurses/termcap.h)
-fi
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
- termios.h unistd.h \
- sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
+AC_CHECK_HEADERS(unistd.h termios.h termio.h strings.h string.h varargs.h \
+ sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
-AC_TYPE_SIGNAL
AC_C_CONST
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
-AC_FUNC_VPRINTF
AC_FUNC_SETVBUF_REVERSED
AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \
- sigprocmask sigsetmask)
+ vfprintf vsprintf strerror sigprocmask sigsetmask)
dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
-AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
-
-dnl Set of available languages and i18n macros.
-ALL_LINGUAS="de fr"
-AM_GNU_GETTEXT
-AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+AC_REPLACE_FUNCS(memcpy memmove strdup)
-AC_OUTPUT([Makefile \
- doc/Makefile \
- info/Makefile \
- intl/Makefile \
- lib/Makefile \
- makeinfo/Makefile \
- po/Makefile.in \
- util/Makefile \
- ],
- [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])
+AC_OUTPUT(Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/Makefile)
diff --git a/contrib/texinfo/dir b/contrib/texinfo/dir
new file mode 100644
index 000000000000..f1b19187eb94
--- /dev/null
+++ b/contrib/texinfo/dir
@@ -0,0 +1,16 @@
+$Id: dir,v 1.2 1996/09/24 18:43:01 karl Exp $
+This is the file .../info/dir, which contains the topmost node of the
+Info hierarchy. The first time you invoke Info you start off
+looking at that node, which is (dir)Top.
+
+File: dir Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs topic, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
diff --git a/contrib/texinfo/dir-example b/contrib/texinfo/dir-example
index 33d35730cc69..df5efc856fff 100644
--- a/contrib/texinfo/dir-example
+++ b/contrib/texinfo/dir-example
@@ -1,341 +1,309 @@
This is the directory file `dir' a.k.a. `DIR', which contains the
- topmost node of the Info hierarchy.
-This particular dir file is merely made available for your hacking
- pleasure, not official or standard in any way. If it doesn't make sense
- to you, or you don't like it, ignore it.
-If you have dir entries for Texinfo manuals you'd like to be added here,
- please send them to karl@gnu.org.
+topmost node of the Info hierarchy. This file is merely made available
+for your hacking pleasure, not official or standard in any way.
+If it doesn't make sense to you, or you don't like it, ignore it.
-$Id: dir,v 1.9 1998/02/27 21:29:52 karl Exp $
+$Id: dir,v 1.20 1996/10/04 18:39:29 karl Exp $

-File: dir, Node: Top, This is the top of the INFO tree.
+File: dir Node: Top This is the top of the INFO tree.
-This is the Info main menu (aka directory node).
-A few useful Info commands:
+This node gives a menu of the major topics accessible through Info.
`q' quits;
`?' lists all Info commands;
`h' starts the Info tutorial;
`mTexinfo RET' visits the Texinfo manual, etc.
-Not all of the topics shown below may be available on this system.
-
* Menu:
GNU packages
-* Bash: (bash). Bourne-Again SHell.
-* Cpio: (cpio). Copy-in-copy-out archiver.
-* DC: (dc). Postfix desk calculator.
-* Diff: (diff). Comparing and merging programs.
-* Ed: (ed). Line editor.
-* Emacs: (emacs). Extensible self-documenting text editor.
-* File utilities: (fileutils). GNU file utilities.
-* Finding files: (find). Operating on files matching certain criteria.
-* Font utilities: (fontu). Programs for font manipulation.
-* Gawk: (gawk.info). A text scanning and processing language.
-* Gcal: (gcal). GNU calendar program.
-* Gzip: (gzip). General (de)compression.
-* Identifier DB: (id-utils). Identifier database utilities.
-* Ispell: (ispell). Interactive spelling corrector.
-* M4: (m4). Macro processor.
-* Make: (make). Remake files automatically.
-* Ptx: (ptx). Permuted index generator.
-* Shar: (sharutils). Shell archiver, uudecode/uuencode.
-* Shell utilities: (sh-utils). GNU shell utilities.
-* tar: (tar). Making tape (or disk) archives.
-* Text utilities: (textutils). GNU text utilities.
-* Time: (time). Measuring program resource usage.
-* UUCP: (uucp). Copying between machines, offline.
-* Wdiff: (wdiff). Word-by-word comparison.
-* Wget: (wget). URL download.
+* Bash: (bash). Bourne again shell.
+* Cpio: (cpio). Cpio archiver.
+* DC: (dc). Postfix arbitrary expression calculator.
+* Diff: (diff). Comparing and merging programs.
+* Ed: (ed). Line editor.
+* Emacs: (emacs). Extensible self-documenting text editor.
+* File utilities: (fileutils). GNU file utilities.
+* Finding files: (find). Operating on files matching certain criteria.
+* Font utilities: (fontu). Programs for font manipulation.
+* Gawk: (gawk). A text processing and scanning language.
+* Gzip: (gzip). General (de)compression.
+* Identifier DB: (id-utils). Identifier database utilities.
+* Ispell: (ispell). Interactive spelling corrector.
+* M4: (m4). Macro processor.
+* Make: (make). Remake files automatically.
+* Ptx: (ptx). Permuted index generator.
+* Shar: (sharutils). Shell archiver, uudecode/uuencode.
+* Shell utilities: (sh-utils). GNU shell utilities.
+* Tar: (tar). ``Tape'' archiver.
+* Text utilities: (textutils). GNU text utilities.
+* Time: (time). Measuring program resource usage.
+* UUCP: (uucp). Copying between machines, offline.
+* Wdiff: (wdiff). Word-by-word comparison.
GNU programming tools
-* As: (as). Assembler.
-* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
-* Bison: (bison). LALR(1) parser generator.
-* CPP: (cpp). C preprocessor.
-* CVS: (cvs). Concurrent versions system for source control.
-* DejaGnu: (dejagnu). Testing framework.
-* Flex: (flex). A fast scanner generator.
-* Gasp: (gasp). GNU Assembler preprocessor.
-* Libtool: (libtool). Generic library support script.
-* GCC: (gcc). C compiler.
-* GDB: (gdb). Source-level debugger for C and C++.
-* Gettext Utilities: (gettext). GNU gettext utilities.
-* Gperf: (gperf). Perfect hash function generator.
-* Gprof: (gprof). Profiler.
-* Indent: (indent). Prettyprinter for programs.
-* Ld: (ld). Linker.
+* As: (as). Assembler.
+* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
+* Bison: (bison). LALR(1) parser generator.
+* CPP: (cpp). C preprocessor.
+* CVS: (cvs). Concurrent versions system for source control.
+* DejaGnu: (dejagnu). Testing framework.
+* Flex: (flex). A fast scanner generator.
+* Gasp: (gasp). GNU Assembler preprocessor.
+* Libtool: (libtool). Generic library support script.
+* GCC: (gcc). C compiler.
+* GDB: (gdb). Source-level debugger for C and C++.
+* Gperf: (gperf). Perfect hash function generator.
+* Gprof: (gprof). Profiler.
+* Indent: (indent). Prettyprinter for programs.
+* Ld: (ld). Linker.
Texinfo documentation system
-* Info: (info). Documentation browsing system.
-* Texinfo: (texinfo). The GNU documentation format.
-* info program: (info-stnd). Standalone Info-reading program.
+* Info: (info). Documentation browsing system.
+* Texinfo: (texinfo). The GNU documentation format.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
-* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
-* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
-* makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
+* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
+* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
+* info program: (info-stnd). Standalone Info-reading program.
+* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
GNU Emacs Lisp
-* Elisp: (elisp). GNU Emacs Lisp reference manual.
+* Elisp: (elisp). GNU Emacs Lisp reference manual.
* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming.
-* AUC TeX: (auctex). Editing (La)TeX files.
-* Calc: (calc). Calculator and more.
-* CC mode: (cc-mode). Editing C, C++, Objective C, and Java.
-* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
-* Dired-x: (dired-x). Extra directory editor features.
-* Edebug: (edebug). Source-level debugger for Emacs Lisp.
-* Ediff: (ediff). Comprehensive visual interface to diff & patch.
-* EDB: (edb). Database for Emacs.
-* Forms: (forms). Fill-in-the-form data entry.
-* Gmhist: (gmhist). Generic minibuffer history.
-* GNUS: (gnus). Netnews reading and posting.
-* Mailcrypt: (mailcrypt). Use PGP in Emacs.
-* MH-E: (mh-e). Emacs interface to the MH mail system.
-* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
-* Supercite: (sc). Supercite for including other people's words.
-* VIP: (vip). vi emulation.
-* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
-* VM: (vm). Mail reader.
-* W3: (w3). WWW browser.
+* Calc: (calc). Calculator and more.
+* CC-mode: (ccmode). Editing C, C++, and Objective C.
+* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
+* Dired-x: (dired-x). Extra directory editor features.
+* Edebug: (edebug). Source-level debugger for Emacs Lisp.
+* Ediff: (ediff). Comprehensive visual interface to diff & patch.
+* EDB: (edb). Database for Emacs.
+* Forms: (forms). Fill-in-the-form data entry.
+* Gmhist: (gmhist). Generic minibuffer history.
+* GNUS: (gnus). Netnews reading and posting.
+* Mailcrypt: (mailcrypt). Use PGP in Emacs.
+* MH-E: (mh-e). Emacs interface to the MH mail system.
+* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
+* Supercite: (sc). Supercite for including other people's words.
+* VIP: (vip). vi emulation.
+* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
+* VM: (vm). Mail reader.
+* W3: (w3). WWW browser.
-GNU programming support
-* Autoconf: (autoconf). Automatic generation of package configuration.
-* Configure: (configure). Cygnus configure.
-* Gnats: (gnats). Cygnus bug tracking system.
-* Remsync: (remsync). Remote synchronization of directory trees.
-* Send PR: (send-pr). Cygnus bug reporting for Gnats.
+GNU admin
+* Autoconf: (autoconf). Automatic generation of package configuration.
+* Automake: (automake). Making Makefile.in's.
+* Configure: (configure). Cygnus configure.
+* Gettext: (gettext). Internationalization.
+* Gnats: (gnats). Cygnus bug tracking system.
+* Maintaining: (maintain). Maintaining GNU software.
+* Remsync: (remsync). Remote synchronization of directory trees.
+* Send PR: (send-pr). Cygnus bug reporting for Gnats.
+* Source config: (cfg-paper). Some theory on configuring source packages.
+* Standards: (standards). GNU coding standards.
GNU libraries
-* Annotate: (annotate). High-level GDB to GUI's.
-* BFD: (bfd). Binary file descriptors for object file IO.
-* GDB library: (libgdb). Application programming interface to GDB.
-* GDBM: (gdbm). Hashed databases.
-* History: (history). Recall previous lines of input.
-* Iostream: (iostream). C++ input/output.
-* Libc: (libc). C library.
-* Libg++: (libg++). C++ classes.
-* Mmalloc: (mmalloc). Memory-mapped malloc.
-* Readline: (readline). General command-line interface.
-* Regex: (regex). Regular expressions.
-* Termcap: (termcap). All about /etc/termcap.
+* Annotate: (annotate). High-level GDB to GUI's.
+* BFD: (bfd). Binary file descriptors for object file IO.
+* GDB library: (libgdb). Application programming interface to GDB.
+* GDBM: (gdbm). Hashed databases.
+* History: (history). Recall previous lines of input.
+* Iostream: (iostream). C++ input/output.
+* Libc: (libc). C library.
+* Libg++: (libg++). C++ classes.
+* Mmalloc: (mmalloc). Memory-mapped malloc.
+* Readline: (readline). General command-line interface.
+* Regex: (regex). Regular expressions.
+* Termcap: (termcap). All about /etc/termcap.
GNU programming documentation
-* GDB internals: (gdbint). Debugger internals.
-* Ld internals: (ldint). GNU linker internals.
-* Maintaining: (maintain). Maintaining GNU software.
-* Source config: (cfg-paper). Some theory on configuring source packages.
-* Stabs: (stabs). Symbol table debugging information format.
-* Standards: (standards). GNU coding standards.
+* GDB internals: (gdbint). Debugger internals.
+* Ld internals: (ldint). GNU linker internals.
+* Stabs: (stabs). Symbol table debugging information format.
-Linux
-* dosemu: (dosemu). Linux DOS emulator.
-* gpm: (gpm). Linux general purpose mouse interface.
-* linux-faq: (linux-faq). The Linux FAQ List
+DOS
+* Demacs: (demacs). GNU Emacs for DOS.
+* GNUish: (gnuish). GNU utilities for DOS.
TeX things
* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX.
-* Dvips: (dvips). DVI-to-PostScript translator.
-* Eplain: (eplain). Expanding on plain TeX.
-* Kpathsearch: (kpathsea). File lookup along search paths.
-* LaTeX: (latex). LaTeX.
-* MakeIndex: (makeindex). Index creation for TeX.
-* Naming fonts: (fontname). Filenames for TeX fonts.
-* TDS: (tds). Standard TeX directory structure.
-* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
-* Web2c: (web2c). TeX, Metafont, and their companion programs.
-
-DOS
-* Demacs: (demacs). GNU Emacs for DOS.
-* GNUish: (gnuish). GNU utilities for DOS.
+* Dvips: (dvips). DVI-to-PostScript translator.
+* Eplain: (eplain). Expanding on plain TeX.
+* Kpathsearch: (kpathsea). File lookup along search paths.
+* LaTeX: (latex). LaTeX.
+* MakeIndex: (makeindex). Index creation for TeX.
+* Naming fonts: (fontname). Filenames for TeX fonts.
+* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
+* Web2c: (web2c). TeX, Metafont, and their companion programs.
Other things
-* Amd: (amdref). Filesystem automounter.
-* CMUCL: (cmu-user). CMU Common Lisp.
-* File headers: (filehdr). Bibliographic information for computer files.
-* GCP: (gcp). Game club protocol.
-* GIMP: (pdb). The GIMP procedural database.
-* HTML: (snafu). Hypertext Markup Language 2.0 specification.
-* Jargon: (jargon). The jargon file.
-* JED: (jed). JED editor documentation.
-* octave: (octave). Octave - A language for numerical computation.
-* Perl: (perl). Practical extraction and report language.
+* Amd: (amdref). Filesystem automounter.
+* CMUCL: (cmu-user). CMU Common Lisp.
+* File headers: (filehdr). Bibliographic information for computer files.
+* HTML: (snafu). Hypertext Markup Language 2.0 specification.
+* Jargon: (jargon). The jargon file.
+* Perl: (perl). Practical extraction and report language.
* PRCS: (prcs). Project revision control system.
-* Screen: (screen). Virtual screen manager.
-* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
+* Screen: (screen). Virtual screen manager.
+* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
Individual utilities
-* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
-* aid: (id-utils)aid invocation. Matching strings.
-* ar: (binutils)ar. Create/modify/extract archives.
-* at-pr: (gnats)at-pr. Bug report timely reminders.
-* automake: (automake). Making Makefile.in's.
-* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
-* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
-* awk: (gawk)Invoking gawk. Text processing and scanning.
-* basename: (sh-utils)basename invocation. Strip directory and suffix.
-* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
-* c++filt: (binutils)c++filt. Demangle C++ symbols.
-* cat: (textutils)cat invocation. Concatenate and write files.
-* chgrp: (fileutils)chgrp invocation. Change file groups.
-* chmod: (fileutils)chmod invocation. Change file permissions.
-* chown: (fileutils)chown invocation. Change file owners/groups.
-* chroot: (sh-utils)chroot invocation. Specify the root directory.
-* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
-* cmp: (diff)Invoking cmp. Character-by-character diff.
-* comm: (textutils)comm invocation. Compare sorted files by line.
-* cp: (fileutils)cp invocation. Copy files.
-* csplit: (textutils)csplit invocation. Split by context.
-* cut: (textutils)cut invocation. Print selected parts of lines.
-* date: (sh-utils)date invocation. Print/set system date and time.
-* dd: (fileutils)dd invocation. Copy and convert a file.
-* df: (fileutils)df invocation. Report filesystem disk usage.
-* diff3: (diff)Invoking diff3. Three-way diff.
-* dir: (fileutils)dir invocation. List directories briefly.
-* dircolors: (fileutils)dircolors invocation. Color setup for ls.
-* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
-* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
-* du: (fileutils)du invocation. Report on disk usage.
-* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
-* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
-* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
-* echo: (sh-utils)echo invocation. Print a line of text.
-* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
-* eid: (id-utils)eid invocation. Invoking an editor on matches.
+* aid: (id-utils)aid invocation. Matching strings.
+* ar: (binutils)ar. Create/modify/extract archives.
+* at-pr: (gnats)at-pr. Bug report timely reminders.
+* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
+* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
+* awk: (Gawk)Invoking gawk. Text processing and scanning.
+* basename: (sh-utils)basename invocation. Strip directory and suffix.
+* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
+* c++filt: (binutils)c++filt. Demangle C++ symbols.
+* cat: (textutils)cat invocation. Concatenate and write files.
+* chgrp: (fileutils)chgrp invocation. Change file groups.
+* chmod: (fileutils)chmod invocation. Change file permissions.
+* chown: (fileutils)chown invocation. Change file owners/groups.
+* chroot: (sh-utils)chroot invocation. Specify the root directory.
+* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
+* cmp: (diff)Invoking cmp. Character-by-character diff.
+* comm: (textutils)comm invocation. Compare sorted files by line.
+* cp: (fileutils)cp invocation. Copy files.
+* csplit: (textutils)csplit invocation. Split by context.
+* cut: (textutils)cut invocation. Print selected parts of lines.
+* date: (sh-utils)date invocation. Print/set system date and time.
+* dd: (fileutils)dd invocation. Copy and convert a file.
+* df: (fileutils)df invocation. Report filesystems' disk usage.
+* diff3: (diff)Invoking diff3. Three-way diff.
+* dir: (fileutils)dir invocation. List directories briefly.
+* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
+* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
+* du: (fileutils)du invocation. Report on disk usage.
+* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
+* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
+* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
+* echo: (sh-utils)echo invocation. Print a line of text.
+* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
+* eid: (id-utils)eid invocation. Invoking an editor on matches.
* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs.
* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs.
-* env: (sh-utils)env invocation. Modify the environment.
+* env: (sh-utils)env invocation. Modify the environment.
* etags: (emacs)Create Tags Table. Creating a TAGS table.
-* expand: (textutils)expand invocation. Convert tabs to spaces.
-* expr: (sh-utils)expr invocation. Evaluate expressions.
-* factor: (sh-utils)factor invocation. Print prime factors
-* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
-* fid: (id-utils)fid invocation. Listing a file's identifiers.
-* file-pr: (gnats)file-pr. Processing incoming traffic.
-* find: (find)Invoking find. Finding and acting on files.
-* fmt: (textutils)fmt invocation. Reformat paragraph text.
-* fold: (textutils)fold invocation. Wrap long input lines.
-* g++: (gcc)Invoking G++. The GNU C++ compiler.
-* gcal2txt: (gcal)Invoking gcal2txt. Calendar resource to text file.
-* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
-* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
-* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
-* gftype: (web2c)GFtype invocation. GF to human-readable text.
-* gid: (id-utils)gid invocation. Listing all matching lines.
-* git: (git). GNU interactive tools.
-* groups: (sh-utils)groups invocation. Print group names a user is in.
-* gunzip: (gzip)Overview. Decompression.
-* head: (textutils)head invocation. Output the first part of files.
-* hostname: (sh-utils)hostname invocation. Print or set system name.
-* id: (sh-utils)id invocation. Print real/effective uid/gid.
-* idx: (id-utils)idx invocation. Testing mkid scanners.
-* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
-* iid: (id-utils)iid invocation. Interactive complex queries.
-* inimf: (web2c)inimf invocation. Initial Metafont.
-* inimp: (web2c)inimp invocation. Initial MetaPost.
-* initex: (web2c)initex invocation. Initial TeX.
-* install: (fileutils)install invocation. Copy and change attributes.
-* join: (textutils)join invocation. Join lines on a common field.
-* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
-* lid: (id-utils)lid invocation. Matching identifier patterns.
-* ln: (fileutils)ln invocation. Make links between files.
-* locate: (find)Invoking locate. Finding files in a database.
-* logname: (sh-utils)logname invocation. Print current login name.
-* ls: (fileutils)ls invocation. List directory contents.
-* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
-* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
-* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
-* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
-* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
-* md5sum: (textutils)md5sum invocation. Print or check message-digests.
-* mf: (web2c)mf invocation. Creating typeface families.
-* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
-* mkdir: (fileutils)mkdir invocation. Create directories.
-* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
-* mkid: (id-utils)mkid invocation. Creating an ID database.
-* mknod: (fileutils)mknod invocation. Create special files.
-* mp: (web2c)mp invocation. Creating technical diagrams.
-* mpto: (web2c)MPto invocation. MetaPost label extraction.
-* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
-* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
-* mv: (fileutils)mv invocation. Rename files.
-* newer: (web2c)Newer invocation. Compare modification times.
-* nice: (sh-utils)nice invocation. Modify scheduling priority.
-* nl: (textutils)nl invocation. Number lines and write files.
-* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
-* nm: (binutils)nm. List symbols in object files.
-* nohup: (sh-utils)nohup invocation. Immunize to hangups.
-* objcopy: (binutils)objcopy. Copy/translate object files.
-* objdump: (binutils)objdump. Display info from object files.
-* od: (textutils)od invocation. Dump files in octal, etc.
-* paste: (textutils)paste invocation. Merge lines of files.
-* patch: (diff)Invoking patch. Automatically applying diffs.
-* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
-* pathchk: (sh-utils)pathchk invocation. Check file name portability.
-* pid: (id-utils)pid invocation. Looking up filenames.
-* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
-* pktype: (web2c)PKtype invocation. PK to human-readable text.
-* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
-* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
-* pr-addr: (gnats)pr-addr. Bug report address retrieval.
-* pr-edit: (gnats)pr-edit. The edit-pr driver.
-* pr: (textutils)pr invocation. Paginate or columnate files.
-* printenv: (sh-utils)printenv invocation. Print environment variables.
-* printf: (sh-utils)printf invocation. Format and print data.
-* pwd: (sh-utils)pwd invocation. Print working directory.
-* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
-* queue-pr: (gnats)queue-pr. Handling incoming traffic.
-* ranlib: (binutils)ranlib. Index archive file contents.
-* rm: (fileutils)rm invocation. Remove files.
-* rmdir: (fileutils)rmdir invocation. Remove empty directories.
-* sdiff: (diff)Invoking sdiff. Interactively merge files.
-* send-pr: (gnats)Invoking send-pr. Submitting bugs.
-* seq: (sh-utils)seq invocation. Print numeric sequences
-* shar: (sharutils)shar invocation. Create shell archive.
-* size: (binutils)size. List object file section sizes.
-* sleep: (sh-utils)sleep invocation. Delay for a specified time.
-* sort: (textutils)sort invocation. Sort text files.
-* split: (textutils)split invocation. Split into fixed-size pieces.
-* strings: (binutils)strings. List printable strings.
-* strip: (binutils)strip. Discard symbols.
-* stty: (sh-utils)stty invocation. Print/change terminal settings.
-* su: (sh-utils)su invocation. Modify user and group id.
-* sum: (textutils)sum invocation. Print traditional checksum.
-* sync: (fileutils)sync invocation. Synchronize memory and disk.
-* tabs: (tput)Invoking tabs. Tab settings.
-* tac: (textutils)tac invocation. Reverse files.
-* tail: (textutils)tail invocation. Output the last part of files.
-* tangle: (web2c)Tangle invocation. WEB to Pascal.
-* tcal: (gcal)Invoking tcal. Run Gcal with tomorrow's date.
-* tee: (sh-utils)tee invocation. Redirect to multiple files.
-* test: (sh-utils)test invocation. File/string tests.
-* tex: (web2c)tex invocation. Typesetting.
-* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
-* touch: (fileutils)touch invocation. Change file timestamps.
-* tput: (tput)Invoking tput. Termcap in shell scripts.
-* tr: (textutils)tr invocation. Translate characters.
-* true: (sh-utils)true invocation. Do nothing, successfully.
-* tty: (sh-utils)tty invocation. Print terminal name.
-* txt2gcal: (gcal)Invoking txt2gcal. Calendar text to resource file.
-* uname: (sh-utils)uname invocation. Print system information.
-* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
-* uniq: (textutils)uniq invocation. Uniqify files.
-* unshar: (sharutils)unshar invocation. Extract from shell archive.
-* updatedb: (find)Invoking updatedb. Building the locate database.
-* users: (sh-utils)users invocation. Print current user names.
-* vdir: (fileutils)vdir invocation. List directories verbosely.
-* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
-* view-pr: (gnats)Invoking view-pr. Showing bug reports.
-* virmf: (web2c)virmf invocation. Virgin Metafont.
-* virmp: (web2c)virmp invocation. Virgin MetaPost.
-* virtex: (web2c)virtex invocation. Virgin TeX.
-* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
-* wc: (textutils)wc invocation. Byte, word, and line counts.
-* weave: (web2c)Weave invocation. WEB to TeX.
-* who: (sh-utils)who invocation. Print who is logged in.
-* whoami: (sh-utils)whoami invocation. Print effective user id.
-* xargs: (find)Invoking xargs. Operating on many files.
-* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
-* yes: (sh-utils)yes invocation. Print a string indefinitely.
-* zcat: (gzip)Overview. Decompression to stdout.
+* expand: (textutils)expand invocation. Convert tabs to spaces.
+* expr: (sh-utils)expr invocation. Evaluate expressions.
+* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
+* fid: (id-utils)fid invocation. Listing a file's identifiers.
+* file-pr: (gnats)file-pr. Processing incoming traffic.
+* find: (find)Invoking find. Finding and acting on files.
+* fmt: (textutils)fmt invocation. Reformat paragraph text.
+* fold: (textutils)fold invocation. Wrap long input lines.
+* g++: (gcc)Invoking G++. The GNU C++ compiler.
+* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
+* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
+* gftype: (web2c)GFtype invocation. GF to human-readable text.
+* gid: (id-utils)gid invocation. Listing all matching lines.
+* groups: (sh-utils)groups invocation. Print group names a user is in.
+* gunzip: (gzip)Overview. Decompression.
+* head: (textutils)head invocation. Output the first part of files.
+* hostname: (sh-utils)hostname invocation. Print or set system name.
+* id: (sh-utils)id invocation. Print real/effective uid/gid.
+* idx: (id-utils)idx invocation. Testing mkid scanners.
+* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
+* iid: (id-utils)iid invocation. Interactive complex queries.
+* inimf: (web2c)inimf invocation. Initial Metafont.
+* inimp: (web2c)inimp invocation. Initial MetaPost.
+* initex: (web2c)initex invocation. Initial TeX.
+* install: (fileutils)install invocation. Copy and change attributes.
+* join: (textutils)join invocation. Join lines on a common field.
+* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
+* lid: (id-utils)lid invocation. Matching identifier patterns.
+* ln: (fileutils)ln invocation. Make links between files.
+* locate: (find)Invoking locate. Finding files in a database.
+* logname: (sh-utils)logname invocation. Print current login name.
+* ls: (fileutils)ls invocation. List directory contents.
+* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
+* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
+* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
+* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
+* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
+* mf: (web2c)mf invocation. Creating typeface families.
+* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
+* mkdir: (fileutils)mkdir invocation. Create directories.
+* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
+* mkid: (id-utils)mkid invocation. Creating an ID database.
+* mknod: (fileutils)mknod invocation. Create special files.
+* mp: (web2c)mp invocation. Creating technical diagrams.
+* mpto: (web2c)MPto invocation. MetaPost label extraction.
+* mv: (fileutils)mv invocation. Rename files.
+* newer: (web2c)Newer invocation. Compare modification times.
+* nice: (sh-utils)nice invocation. Modify scheduling priority.
+* nl: (textutils)nl invocation. Number lines and write files.
+* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
+* nm: (binutils)nm. List symbols in object files.
+* nohup: (sh-utils)nohup invocation. Immunize to hangups.
+* objcopy: (binutils)objcopy. Copy/translate object files.
+* objdump: (binutils)objdump. Display info from object files.
+* od: (textutils)od invocation. Dump files in octal, etc.
+* paste: (textutils)paste invocation. Merge lines of files.
+* patch: (diff)Invoking patch. Automatically applying diffs.
+* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
+* pathchk: (sh-utils)pathchk invocation. Check file name portability.
+* pid: (id-utils)pid invocation. Looking up filenames.
+* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
+* pktype: (web2c)PKtype invocation. PK to human-readable text.
+* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
+* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
+* pr-addr: (gnats)pr-addr. Bug report address retrieval.
+* pr-edit: (gnats)pr-edit. The edit-pr driver.
+* pr: (textutils)pr invocation. Paginate or columnate files.
+* printenv: (sh-utils)printenv invocation. Print environment variables.
+* printf: (sh-utils)printf invocation. Format and print data.
+* pwd: (sh-utils)pwd invocation. Print working directory.
+* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
+* queue-pr: (gnats)queue-pr. Handling incoming traffic.
+* ranlib: (binutils)ranlib. Index archive file contents.
+* rm: (fileutils)rm invocation. Remove files.
+* rmdir: (fileutils)rmdir invocation. Remove empty directories.
+* sdiff: (diff)Invoking sdiff. Interactively merge files.
+* send-pr: (gnats)Invoking send-pr. Submitting bugs.
+* shar: (sharutils)shar invocation. Create shell archive.
+* size: (binutils)size. List object file section sizes.
+* sleep: (sh-utils)sleep invocation. Delay for a specified time.
+* sort: (textutils)sort invocation. Sort text files.
+* split: (textutils)split invocation. Split into fixed-size pieces.
+* strings: (binutils)strings. List printable strings.
+* strip: (binutils)strip. Discard symbols.
+* stty: (sh-utils)stty invocation. Print/change terminal settings.
+* su: (sh-utils)su invocation. Modify user and group id.
+* sum: (textutils)sum invocation. Print traditional checksum.
+* sync: (fileutils)sync invocation. Synchronize memory and disk.
+* tabs: (tput)Invoking tabs. Tab settings.
+* tac: (textutils)tac invocation. Reverse files.
+* tail: (textutils)tail invocation. Output the last part of files.
+* tangle: (web2c)Tangle invocation. WEB to Pascal.
+* tee: (sh-utils)tee invocation. Redirect to multiple files.
+* test: (sh-utils)test invocation. File/string tests.
+* tex: (web2c)tex invocation. Typesetting.
+* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
+* touch: (fileutils)touch invocation. Change file timestamps.
+* tput: (tput)Invoking tput. Termcap in shell scripts.
+* tr: (textutils)tr invocation. Translate characters.
+* true: (sh-utils)true invocation. Do nothing, successfully.
+* tty: (sh-utils)tty invocation. Print terminal name.
+* uname: (sh-utils)uname invocation. Print system information.
+* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
+* uniq: (textutils)uniq invocation. Uniqify files.
+* unshar: (sharutils)unshar invocation. Extract from shell archive.
+* updatedb: (find)Invoking updatedb. Building the locate database.
+* users: (sh-utils)users invocation. Print current user names.
+* vdir: (fileutils)vdir invocation. List directories verbosely.
+* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
+* view-pr: (gnats)Invoking view-pr. Showing bug reports.
+* virmf: (web2c)virmf invocation. Virgin Metafont.
+* virmp: (web2c)virmp invocation. Virgin MetaPost.
+* virtex: (web2c)virtex invocation. Virgin TeX.
+* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
+* wc: (textutils)wc invocation. Byte, word, and line counts.
+* weave: (web2c)Weave invocation. WEB to TeX.
+* who: (sh-utils)who invocation. Print who is logged in.
+* whoami: (sh-utils)whoami invocation. Print effective user id.
+* xargs: (find)Invoking xargs. Operating on many files.
+* yes: (sh-utils)yes invocation. Print a string indefinitely.
+* zcat: (gzip)Overview. Decompression to stdout.
diff --git a/contrib/texinfo/doc/Makefile.am b/contrib/texinfo/doc/Makefile.am
deleted file mode 100644
index 8d53acd09167..000000000000
--- a/contrib/texinfo/doc/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-## Makefile.am for texinfo/emacs.
-## $Id: Makefile.am,v 1.12 1998/02/27 21:46:23 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
-
-# Use the programs built in our distribution.
-MAKEINFO = ../makeinfo/makeinfo
-INSTALL_INFO = ../util/install-info
-
-# Include our texinfo.tex, not Automake's.
-EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
-
-# We try to discover this via configure just to give a better help message.
-TEXMF = @TEXMF@
-
-install-data-local:
- @echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
- @echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
- @echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
- @echo "WARNING: See doc/README for some considerations."
-
-# Do not create info files for distribution.
-dist-info:
-
-# Do not try to build the info files in $(srcdir),
-# since we don't distribute them.
-.texi.info:
- $(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
-texinfo: $(srcdir)/texinfo.txi
- $(MAKEINFO) -I$(srcdir) texinfo.txi
-
-# Similarly, Do not try to install the info files from $(srcdir).
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(infodir)
- @for file in $(INFO_DEPS); do \
- d=.; \
- for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- for file in $(INFO_DEPS); do \
- echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
- $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
- done; \
- else : ; fi
-
-
-# Remove the info files at make distclean.
-distclean-aminfo:
- rm -f texinfo texinfo-* info*.info*
diff --git a/contrib/texinfo/doc/Makefile.in b/contrib/texinfo/doc/Makefile.in
deleted file mode 100644
index c021d3e9ab30..000000000000
--- a/contrib/texinfo/doc/Makefile.in
+++ /dev/null
@@ -1,332 +0,0 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
-
-# Use the programs built in our distribution.
-MAKEINFO = ../makeinfo/makeinfo
-INSTALL_INFO = ../util/install-info
-
-# Include our texinfo.tex, not Automake's.
-EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
-
-# We try to discover this via configure just to give a better help message.
-TEXMF = @TEXMF@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-TEXI2DVI = texi2dvi
-TEXINFO_TEX = $(srcdir)/texinfo.tex
-INFO_DEPS = info-stnd.info info.info texinfo
-DVIS = info-stnd.dvi info.dvi texinfo.dvi
-TEXINFOS = info-stnd.texi info.texi texinfo.txi
-DIST_COMMON = README $(info_TEXINFOS) Makefile.am Makefile.in \
-texinfo.tex
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-default: all
-
-.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-info-stnd.info: info-stnd.texi
-info-stnd.dvi: info-stnd.texi
-
-
-info.info: info.texi $(info_TEXINFOS)
-info.dvi: info.texi $(info_TEXINFOS)
-
-
-texinfo: texinfo.txi
-texinfo.dvi: texinfo.txi
-
-
-DVIPS = dvips
-
-.texi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.txi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-.dvi.ps:
- $(DVIPS) $< -o $@
-
-uninstall-info:
- $(PRE_UNINSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- ii=yes; \
- else ii=; fi; \
- for file in $(INFO_DEPS); do \
- test -z "$ii" \
- || install-info --info-dir=$(infodir) --remove $$file; \
- done
- @$(NORMAL_UNINSTALL)
- for file in $(INFO_DEPS); do \
- (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
- done
-
-mostlyclean-aminfo:
- -rm -f info-stnd.aux info-stnd.cp info-stnd.cps info-stnd.dvi \
- info-stnd.fn info-stnd.fns info-stnd.ky info-stnd.kys \
- info-stnd.ps info-stnd.log info-stnd.pg info-stnd.toc \
- info-stnd.tp info-stnd.tps info-stnd.vr info-stnd.vrs \
- info-stnd.op info-stnd.tr info-stnd.cv info-stnd.cn info.aux \
- info.cp info.cps info.dvi info.fn info.fns info.ky info.kys \
- info.ps info.log info.pg info.toc info.tp info.tps info.vr \
- info.vrs info.op info.tr info.cv info.cn texinfo.aux \
- texinfo.cp texinfo.cps texinfo.dvi texinfo.fn texinfo.fns \
- texinfo.ky texinfo.kys texinfo.ps texinfo.log texinfo.pg \
- texinfo.toc texinfo.tp texinfo.tps texinfo.vr texinfo.vrs \
- texinfo.op texinfo.tr texinfo.cv texinfo.cn
-
-clean-aminfo:
-
-distclean-aminfo:
-
-maintainer-clean-aminfo:
- for i in $(INFO_DEPS); do \
- rm -f $$i; \
- if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
- rm -f $$i-[0-9]*; \
- fi; \
- done
-tags: TAGS
-TAGS:
-
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = doc
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
- $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info: $(INFO_DEPS)
-dvi: $(DVIS)
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data: install-info-am install-data-local
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall: uninstall-info
-
-all: Makefile $(INFO_DEPS)
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
- $(mkinstalldirs) $(infodir)
-
-
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-aminfo mostlyclean-generic
-
-clean: clean-aminfo clean-generic mostlyclean
-
-distclean: distclean-aminfo distclean-generic clean
- -rm -f config.status
-
-maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
- distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
-dvi installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-install-data-local:
- @echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
- @echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
- @echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
- @echo "WARNING: See doc/README for some considerations."
-
-# Do not create info files for distribution.
-dist-info:
-
-# Do not try to build the info files in $(srcdir),
-# since we don't distribute them.
-.texi.info:
- $(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
-texinfo: $(srcdir)/texinfo.txi
- $(MAKEINFO) -I$(srcdir) texinfo.txi
-
-# Similarly, Do not try to install the info files from $(srcdir).
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(infodir)
- @for file in $(INFO_DEPS); do \
- d=.; \
- for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- for file in $(INFO_DEPS); do \
- echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
- $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
- done; \
- else : ; fi
-
-# Remove the info files at make distclean.
-distclean-aminfo:
- rm -f texinfo texinfo-* info*.info*
-
-# 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/texinfo/doc/README b/contrib/texinfo/doc/README
deleted file mode 100644
index fe8e65444f89..000000000000
--- a/contrib/texinfo/doc/README
+++ /dev/null
@@ -1,27 +0,0 @@
-This directory contains documentation on the Texinfo system and the TeX
-sources needed to process Texinfo sources. (Use texi2dvi to run a
-Texinfo manual through TeX to produce a DVI file.)
-
-The .tex files are not installed automatically because TeX installations
-vary so widely. Installing them in the wrong place would give a false
-sense of security. So, you should simply cp *.tex to the appropriate
-place. If your installation follows the TeX Directory Structure
-standard (http://www.tug.org/tds/), this will be the directory
-<texmf>/tex/texinfo/ for texinfo.tex and <texmf>/tex/plain/dvips/ for
-epsf.tex. If you use the default installation paths, <texmf> will be
-/usr/local/share/texmf. If you have teTeX, you can find <texmf> by
-running:
- texconfig confall | grep \^TEXMF=
-(The configure script tries to do this for you.)
-
-You can get the latest texinfo.tex from
-ftp://ftp.tug.org/tex/texinfo.tex
-ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
-or on the FSF machines in /home/gd/gnu/doc/texinfo.tex.
-If you have problems with the version in this distribution, please check
-for a newer version.
-
-epsf.tex comes with dvips distributions, and you may already have it
-installed. The version here is functionally identical but slightly
-nicer than the one in dvips574. The changes have been sent to the
-epsf.tex maintainer.
diff --git a/contrib/texinfo/doc/epsf.tex b/contrib/texinfo/doc/epsf.tex
deleted file mode 100644
index 4f9dded4fdd6..000000000000
--- a/contrib/texinfo/doc/epsf.tex
+++ /dev/null
@@ -1,546 +0,0 @@
-%%% ====================================================================
-%%% This file is freely redistributable and placed into the
-%%% public domain by Tomas Rokicki.
-%%% @TeX-file{
-%%% author = "Tom Rokicki",
-%%% version = "2.7k",
-%%% date = "19 July 1997",
-%%% time = "10:00:05 MDT",
-%%% filename = "epsf.tex",
-%%% address = "Tom Rokicki
-%%% Box 2081
-%%% Stanford, CA 94309
-%%% USA",
-%%% telephone = "+1 415 855 9989",
-%%% email = "rokicki@cs.stanford.edu (Internet)",
-%%% codetable = "ISO/ASCII",
-%%% keywords = "PostScript, TeX",
-%%% supported = "yes",
-%%% abstract = "This file contains macros to support the inclusion
-%%% of Encapsulated PostScript files in TeX documents.",
-%%% docstring = "This file contains TeX macros to include an
-%%% Encapsulated PostScript graphic. It works
-%%% by finding the bounding box comment,
-%%% calculating the correct scale values, and
-%%% inserting a vbox of the appropriate size at
-%%% the current position in the TeX document.
-%%%
-%%% To use, simply say
-%%%
-%%% \input epsf % somewhere early on in your TeX file
-%%%
-%%% % then where you want to insert a vbox for a figure:
-%%% \epsfbox{filename.ps}
-%%%
-%%% Alternatively, you can supply your own
-%%% bounding box by
-%%%
-%%% \epsfbox[0 0 30 50]{filename.ps}
-%%%
-%%% This will not read in the file, and will
-%%% instead use the bounding box you specify.
-%%%
-%%% The effect will be to typeset the figure as
-%%% a TeX box, at the point of your \epsfbox
-%%% command. By default, the graphic will have
-%%% its `natural' width (namely the width of
-%%% its bounding box, as described in
-%%% filename.ps). The TeX box will have depth
-%%% zero.
-%%%
-%%% You can enlarge or reduce the figure by
-%%% saying
-%%%
-%%% \epsfxsize=<dimen> \epsfbox{filename.ps}
-%%% or
-%%% \epsfysize=<dimen> \epsfbox{filename.ps}
-%%%
-%%% instead. Then the width of the TeX box will
-%%% be \epsfxsize and its height will be scaled
-%%% proportionately (or the height will be
-%%% \epsfysize and its width will be scaled
-%%% proportionately).
-%%%
-%%% The width (and height) is restored to zero
-%%% after each use, so \epsfxsize or \epsfysize
-%%% must be specified before EACH use of
-%%% \epsfbox.
-%%%
-%%% A more general facility for sizing is
-%%% available by defining the \epsfsize macro.
-%%% Normally you can redefine this macro to do
-%%% almost anything. The first parameter is
-%%% the natural x size of the PostScript
-%%% graphic, the second parameter is the
-%%% natural y size of the PostScript graphic.
-%%% It must return the xsize to use, or 0 if
-%%% natural scaling is to be used. Common uses
-%%% include:
-%%%
-%%% \epsfxsize % just leave the old value alone
-%%% 0pt % use the natural sizes
-%%% #1 % use the natural sizes
-%%% \hsize % scale to full width
-%%% 0.5#1 % scale to 50% of natural size
-%%% \ifnum #1>\hsize\hsize\else#1\fi
-%%% % smaller of natural, hsize
-%%%
-%%% If you want TeX to report the size of the
-%%% figure (as a message on your terminal when
-%%% it processes each figure), say
-%%% `\epsfverbosetrue'.
-%%%
-%%% If you only want to get the bounding box
-%%% extents, without producing any output boxes
-%%% or \special{}, then say
-%%% \epsfgetbb{filename}. The extents will be
-%%% saved in the macros \epsfllx \epsflly
-%%% \epsfurx \epsfury in PostScript units of
-%%% big points.
-%%%
-%%% Revision history:
-%%%
-%%% ---------------------------------------------
-%%% epsf.tex macro file:
-%%% Originally written by Tomas Rokicki of
-%%% Radical Eye Software, 29 Mar 1989.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Don Knuth, 3 Jan 1990.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Tomas Rokicki, 18 Jul 1990.
-%%% Accept bounding boxes with no space after
-%%% the colon.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 03 Dec 1991 [2.0].
-%%% Add version number and date typeout.
-%%%
-%%% Use \immediate\write16 instead of \message
-%%% to ensure output on new line.
-%%%
-%%% Handle nested EPS files.
-%%%
-%%% Handle %%BoundingBox: (atend) lines.
-%%%
-%%% Do not quit when blank lines are found.
-%%%
-%%% Add a few percents to remove generation of
-%%% spurious blank space.
-%%%
-%%% Move \special output to
-%%% \epsfspecial{filename} so that other macro
-%%% packages can input this one, then change
-%%% the definition of \epsfspecial to match
-%%% another DVI driver.
-%%%
-%%% Move size computation to \epsfsetsize which
-%%% can be called by the user; the verbose
-%%% output of the bounding box and scaled width
-%%% and height happens here.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 05 May 1992 [2.1].
-%%% Wrap \leavevmode\hbox{} around \vbox{} with
-%%% the \special so that \epsffile{} can be
-%%% used inside \begin{center}...\end{center}
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 09 Dec 1992 [2.2].
-%%% Introduce \epsfshow{true,false} and
-%%% \epsfframe{true,false} macros; the latter
-%%% suppresses the insertion of the PostScript,
-%%% and instead just creates an empty box,
-%%% which may be handy for rapid prototyping.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 14 Dec 1992 [2.3].
-%%% Add \epsfshowfilename{true,false}. When
-%%% true, and \epsfshowfalse is specified, the
-%%% PostScript file name will be displayed
-%%% centered in the figure box.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 20 June 1993 [2.4].
-%%% Remove non-zero debug setting of \epsfframemargin,
-%%% and change margin handling to preserve EPS image
-%%% size and aspect ratio, so that the actual
-%%% box is \epsfxsize+\epsfframemargin wide by
-%%% \epsfysize+\epsfframemargin high.
-%%% Reduce output of \epsfshowfilenametrue to
-%%% just the bare file name.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 13 July 1993 [2.5].
-%%% Add \epsfframethickness for control of
-%%% \epsfframe frame lines.
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 02 July 1996 [2.6]
-%%% Add missing initialization \epsfatendfalse;
-%%% the lack of this resulted in the wrong
-%%% BoundingBox being picked up, mea culpa, sigh...
-%%% ---------------------------------------------
-%%%
-%%% ---------------------------------------------
-%%% Revised by Nelson H. F. Beebe
-%%% <beebe@math.utah.edu>, 25 October 1996 [2.7]
-%%% Update to match changes in from dvips 5-600
-%%% distribution: new user-accessible macros:
-%%% \epsfclipon, \epsfclipoff, \epsfdrafton,
-%%% \epsfdraftoff, change \empty to \epsfempty.
-%%% ---------------------------------------------
-%%%
-%%% Modified to avoid verbosity, give help.
-%%% --kb@cs.umb.edu, for Texinfo.
-%%% }
-%%% ====================================================================
-%
-\ifx\epsfannounce\undefined \def\epsfannounce{\immediate\write16}\fi
- \epsfannounce{This is `epsf.tex' v2.7k <10 July 1997>}%
-%
-\newread\epsffilein % file to \read
-\newif\ifepsfatend % need to scan to LAST %%BoundingBox comment?
-\newif\ifepsfbbfound % success?
-\newif\ifepsfdraft % use draft mode?
-\newif\ifepsffileok % continue looking for the bounding box?
-\newif\ifepsfframe % frame the bounding box?
-\newif\ifepsfshow % show PostScript file, or just bounding box?
-\epsfshowtrue % default is to display PostScript file
-\newif\ifepsfshowfilename % show the file name if \epsfshowfalse specified?
-\newif\ifepsfverbose % report what you're making?
-\newdimen\epsfframemargin % margin between box and frame
-\newdimen\epsfframethickness % thickness of frame rules
-\newdimen\epsfrsize % vertical size before scaling
-\newdimen\epsftmp % register for arithmetic manipulation
-\newdimen\epsftsize % horizontal size before scaling
-\newdimen\epsfxsize % horizontal size after scaling
-\newdimen\epsfysize % vertical size after scaling
-\newdimen\pspoints % conversion factor
-%
-\pspoints = 1bp % Adobe points are `big'
-\epsfxsize = 0pt % default value, means `use natural size'
-\epsfysize = 0pt % ditto
-\epsfframemargin = 0pt % default value: frame box flush around picture
-\epsfframethickness = 0.4pt % TeX's default rule thickness
-%
-\def\epsfbox#1{\global\def\epsfllx{72}\global\def\epsflly{72}%
- \global\def\epsfurx{540}\global\def\epsfury{720}%
- \def\lbracket{[}\def\testit{#1}\ifx\testit\lbracket
- \let\next=\epsfgetlitbb\else\let\next=\epsfnormal\fi\next{#1}}%
-%
-% We use \epsfgetlitbb if the user specified an explicit bounding box,
-% and \epsfnormal otherwise. Because \epsfgetbb can be called
-% separately to retrieve the bounding box, we move the verbose
-% printing the bounding box extents and size on the terminal to
-% \epsfstatus. Therefore, when the user provided the bounding box,
-% \epsfgetbb will not be called, so we must call \epsfsetsize and
-% \epsfstatus ourselves.
-%
-\def\epsfgetlitbb#1#2 #3 #4 #5]#6{%
- \epsfgrab #2 #3 #4 #5 .\\%
- \epsfsetsize
- \epsfstatus{#6}%
- \epsfsetgraph{#6}%
-}%
-%
-\def\epsfnormal#1{%
- \epsfgetbb{#1}%
- \epsfsetgraph{#1}%
-}%
-%
-\newhelp\epsfnoopenhelp{The PostScript image file must be findable by
-TeX, i.e., somewhere in the TEXINPUTS (or equivalent) path.}%
-%
-\def\epsfgetbb#1{%
-%
-% The first thing we need to do is to open the
-% PostScript file, if possible.
-%
- \openin\epsffilein=#1
- \ifeof\epsffilein
- \errhelp = \epsfnoopenhelp
- \errmessage{Could not open file #1, ignoring it}%
- \else %process the file
- {% %start a group to contain catcode changes
- % Make all special characters, except space, to be of type
- % `other' so we process the file in almost verbatim mode
- % (TeXbook, p. 344).
- \chardef\other=12
- \def\do##1{\catcode`##1=\other}%
- \dospecials
- \catcode`\ =10
- \epsffileoktrue %true while we are looping
- \epsfatendfalse %[02-Jul-1996]: add forgotten initialization
- \loop %reading lines from the EPS file
- \read\epsffilein to \epsffileline
- \ifeof\epsffilein %then no more input
- \epsffileokfalse %so set completion flag
- \else %otherwise process one line
- \expandafter\epsfaux\epsffileline:. \\%
- \fi
- \ifepsffileok
- \repeat
- \ifepsfbbfound
- \else
- \ifepsfverbose
- \immediate\write16{No BoundingBox comment found in %
- file #1; using defaults}%
- \fi
- \fi
- }% %end catcode changes
- \closein\epsffilein
- \fi %end of file processing
- \epsfsetsize %compute size parameters
- \epsfstatus{#1}%
-}%
-%
-% Clipping control:
-\def\epsfclipon{\def\epsfclipstring{ clip}}%
-\def\epsfclipoff{\def\epsfclipstring{\ifepsfdraft\space clip\fi}}%
-\epsfclipoff % default for dvips is OFF
-%
-% The special that is emitted by \epsfsetgraph comes from this macro.
-% It is defined separately to allow easy customization by other
-% packages that first \input epsf.tex, then redefine \epsfspecial.
-% This macro is invoked in the lower-left corner of a box of the
-% width and height determined from the arguments to \epsffile, or
-% from the %%BoundingBox in the EPS file itself.
-%
-% This version is for dvips:
-\def\epsfspecial#1{%
- \epsftmp=10\epsfxsize
- \divide\epsftmp\pspoints
- \ifnum\epsfrsize=0\relax
- \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
- llx=\epsfllx\space
- lly=\epsflly\space
- urx=\epsfurx\space
- ury=\epsfury\space
- rwi=\number\epsftmp
- \epsfclipstring
- }%
- \else
- \epsfrsize=10\epsfysize
- \divide\epsfrsize\pspoints
- \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
- llx=\epsfllx\space
- lly=\epsflly\space
- urx=\epsfurx\space
- ury=\epsfury\space
- rwi=\number\epsftmp
- rhi=\number\epsfrsize
- \epsfclipstring
- }%
- \fi
-}%
-%
-% \epsfframe macro adapted from the TeXbook, exercise 21.3, p. 223, 331.
-% but modified to set the box width to the natural width, rather
-% than the line width, and to include space for margins and rules
-\def\epsfframe#1%
-{%
- \leavevmode % so we can put this inside
- % a centered environment
- \setbox0 = \hbox{#1}%
- \dimen0 = \wd0 % natural width of argument
- \advance \dimen0 by 2\epsfframemargin % plus width of 2 margins
- \advance \dimen0 by 2\epsfframethickness % plus width of 2 rule lines
- \vbox
- {%
- \hrule height \epsfframethickness depth 0pt
- \hbox to \dimen0
- {%
- \hss
- \vrule width \epsfframethickness
- \kern \epsfframemargin
- \vbox {\kern \epsfframemargin \box0 \kern \epsfframemargin }%
- \kern \epsfframemargin
- \vrule width \epsfframethickness
- \hss
- }% end hbox
- \hrule height 0pt depth \epsfframethickness
- }% end vbox
-}%
-%
-\def\epsfsetgraph#1%
-{%
- %
- % Make the vbox and stick in a \special that the DVI driver can
- % parse. \vfil and \hfil are used to place the \special origin at
- % the lower-left corner of the vbox. \epsfspecial can be redefined
- % to produce alternate \special syntaxes.
- %
- \leavevmode
- \hbox{% so we can put this in \begin{center}...\end{center}
- \ifepsfframe\expandafter\epsfframe\fi
- {\vbox to\epsfysize
- {%
- \ifepsfshow
- % output \special{} at lower-left corner of figure box
- \vfil
- \hbox to \epsfxsize{\epsfspecial{#1}\hfil}%
- \else
- \vfil
- \hbox to\epsfxsize{%
- \hss
- \ifepsfshowfilename
- {%
- \epsfframemargin=3pt % local change of margin
- \epsfframe{{\tt #1}}%
- }%
- \fi
- \hss
- }%
- \vfil
- \fi
- }%
- }}%
- %
- % Reset \epsfxsize and \epsfysize, as documented above.
- %
- \global\epsfxsize=0pt
- \global\epsfysize=0pt
-}%
-%
-% Now we have to calculate the scale and offset values to use.
-% First we compute the natural sizes.
-%
-\def\epsfsetsize
-{%
- \epsfrsize=\epsfury\pspoints
- \advance\epsfrsize by-\epsflly\pspoints
- \epsftsize=\epsfurx\pspoints
- \advance\epsftsize by-\epsfllx\pspoints
-%
-% If `epsfxsize' is 0, we default to the natural size of the picture.
-% Otherwise we scale the graph to be \epsfxsize wide.
-%
- \epsfxsize=\epsfsize{\epsftsize}{\epsfrsize}%
- \ifnum \epsfxsize=0
- \ifnum \epsfysize=0
- \epsfxsize=\epsftsize
- \epsfysize=\epsfrsize
- \epsfrsize=0pt
-%
-% We have a sticky problem here: TeX doesn't do floating point arithmetic!
-% Our goal is to compute y = rx/t. The following loop does this reasonably
-% fast, with an error of at most about 16 sp (about 1/4000 pt).
-%
- \else
- \epsftmp=\epsftsize \divide\epsftmp\epsfrsize
- \epsfxsize=\epsfysize \multiply\epsfxsize\epsftmp
- \multiply\epsftmp\epsfrsize \advance\epsftsize-\epsftmp
- \epsftmp=\epsfysize
- \loop \advance\epsftsize\epsftsize \divide\epsftmp 2
- \ifnum \epsftmp>0
- \ifnum \epsftsize<\epsfrsize
- \else
- \advance\epsftsize-\epsfrsize \advance\epsfxsize\epsftmp
- \fi
- \repeat
- \epsfrsize=0pt
- \fi
- \else
- \ifnum \epsfysize=0
- \epsftmp=\epsfrsize \divide\epsftmp\epsftsize
- \epsfysize=\epsfxsize \multiply\epsfysize\epsftmp
- \multiply\epsftmp\epsftsize \advance\epsfrsize-\epsftmp
- \epsftmp=\epsfxsize
- \loop \advance\epsfrsize\epsfrsize \divide\epsftmp 2
- \ifnum \epsftmp>0
- \ifnum \epsfrsize<\epsftsize
- \else
- \advance\epsfrsize-\epsftsize \advance\epsfysize\epsftmp
- \fi
- \repeat
- \epsfrsize=0pt
- \else
- \epsfrsize=\epsfysize
- \fi
- \fi
-}%
-%
-% Issue some status messages if the user requested them
-%
-\def\epsfstatus#1{% arg = filename
- \ifepsfverbose
- \immediate\write16{#1: BoundingBox:
- llx = \epsfllx\space lly = \epsflly\space
- urx = \epsfurx\space ury = \epsfury\space}%
- \immediate\write16{#1: scaled width = \the\epsfxsize\space
- scaled height = \the\epsfysize}%
- \fi
-}%
-%
-% We still need to define the tricky \epsfaux macro. This requires
-% a couple of magic constants for comparison purposes.
-%
-{\catcode`\%=12 \global\let\epsfpercent=%\global\def\epsfbblit{%BoundingBox}}%
-\global\def\epsfatend{(atend)}%
-%
-% So we're ready to check for `%BoundingBox:' and to grab the
-% values if they are found.
-%
-% If we find a line
-%
-% %%BoundingBox: (atend)
-%
-% then we ignore it, but set a flag to force parsing all of the
-% file, so the last %%BoundingBox parsed will be the one used. This
-% is necessary, because EPS files can themselves contain other EPS
-% files with their own %%BoundingBox comments.
-%
-% If we find a line
-%
-% %%BoundingBox: llx lly urx ury
-%
-% then we save the 4 values in \epsfllx, \epsflly, \epsfurx, \epsfury.
-% Then, if we have not previously parsed an (atend), we flag completion
-% and can stop reading the file. Otherwise, we must keep on reading
-% to end of file so that we find the values on the LAST %%BoundingBox.
-\long\def\epsfaux#1#2:#3\\%
-{%
- \def\testit{#2}% % save second character up to just before colon
- \ifx#1\epsfpercent % then first char is percent (quick test)
- \ifx\testit\epsfbblit % then (slow test) we have %%BoundingBox
- \epsfgrab #3 . . . \\%
- \ifx\epsfllx\epsfatend % then ignore %%BoundingBox: (atend)
- \global\epsfatendtrue
- \else % else found %%BoundingBox: llx lly urx ury
- \ifepsfatend % then keep parsing ALL %%BoundingBox lines
- \else % else stop after first one parsed
- \epsffileokfalse
- \fi
- \global\epsfbbfoundtrue
- \fi
- \fi
- \fi
-}%
-%
-% Here we grab the values and stuff them in the appropriate definitions.
-%
-\def\epsfempty{}%
-\def\epsfgrab #1 #2 #3 #4 #5\\{%
- \global\def\epsfllx{#1}\ifx\epsfllx\epsfempty
- \epsfgrab #2 #3 #4 #5 .\\\else
- \global\def\epsflly{#2}%
- \global\def\epsfurx{#3}\global\def\epsfury{#4}\fi
-}%
-%
-% We default the epsfsize macro.
-%
-\def\epsfsize#1#2{\epsfxsize}%
-%
-% Finally, another definition for compatibility with older macros.
-%
-\let\epsffile=\epsfbox
-\endinput
diff --git a/contrib/texinfo/doc/info-stnd.texi b/contrib/texinfo/doc/info-stnd.texi
deleted file mode 100644
index 9eb6836d71df..000000000000
--- a/contrib/texinfo/doc/info-stnd.texi
+++ /dev/null
@@ -1,1373 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@comment %**start of header
-@setfilename info-stnd.info
-@settitle GNU Info
-@set InfoProgVer 2.11
-@paragraphindent none
-@footnotestyle end
-@synindex vr cp
-@synindex fn cp
-@synindex ky cp
-@comment %**end of header
-@comment $Id: info-stnd.texi,v 1.3 1997/07/06 21:49:30 karl Exp $
-
-@dircategory Texinfo documentation system
-@direntry
-* info program: (info-stnd). Standalone Info-reading program.
-@end direntry
-
-@ifinfo
-This file documents GNU Info, a program for viewing the on-line formatted
-versions of Texinfo files. This documentation is different from the
-documentation for the Info reader that is part of GNU Emacs. If you do
-not know how to use Info, but have a working Info reader, you should
-read that documentation first.
-
-Copyright @copyright{} 1992, 93, 96, 97 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries a copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``Copying'' and ``GNU General Public License'' are
-included exactly as in the original, and provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation
-approved by the Free Software Foundation.
-@end ifinfo
-
-@titlepage
-@title GNU Info User's Guide
-@subtitle For GNU Info version @value{InfoProgVer}
-@author Brian J. Fox (bfox@@ai.mit.edu)
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1997 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``Copying'' and ``GNU General Public License'' are
-included exactly as in the original, and provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation
-approved by the Free Software Foundation.
-@end titlepage
-
-@ifinfo
-@node Top, What is Info, , (dir)
-@top The GNU Info Program
-
-This file documents GNU Info, a program for viewing the on-line
-formatted versions of Texinfo files, version @value{InfoProgVer}. This
-documentation is different from the documentation for the Info reader
-that is part of GNU Emacs.
-@end ifinfo
-
-@menu
-* What is Info::
-* Options:: Options you can pass on the command line.
-* Cursor Commands:: Commands which move the cursor within a node.
-* Scrolling Commands:: Commands for moving the node around
- in a window.
-* Node Commands:: Commands for selecting a new node.
-* Searching Commands:: Commands for searching an Info file.
-* Xref Commands:: Commands for selecting cross references.
-* Window Commands:: Commands which manipulate multiple windows.
-* Printing Nodes:: How to print out the contents of a node.
-* Miscellaneous Commands:: A few commands that defy categories.
-* Variables:: How to change the default behavior of Info.
-* GNU Info Global Index:: Global index containing keystrokes,
- command names, variable names,
- and general concepts.
-@end menu
-
-@node What is Info, Options, Top, Top
-@chapter What is Info?
-
-@iftex
-This file documents GNU Info, a program for viewing the on-line formatted
-versions of Texinfo files, version @value{InfoProgVer}.
-@end iftex
-
-@dfn{Info} is a program which is used to view Info files on an ASCII
-terminal. @dfn{Info files} are the result of processing Texinfo files
-with the program @code{makeinfo} or with one of the Emacs commands, such
-as @code{M-x texinfo-format-buffer}. Texinfo itself is a documentation
-system that uses a single source file to produce both on-line
-information and printed output. You can typeset and print the
-files that you read in Info.@refill
-
-@node Options, Cursor Commands, What is Info, Top
-@chapter Command Line Options
-@cindex command line options
-@cindex arguments, command line
-
-GNU Info accepts several options to control the initial node being
-viewed, and to specify which directories to search for Info files. Here
-is a template showing an invocation of GNU Info from the shell:
-
-@example
-info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
-@end example
-
-The following @var{option-names} are available when invoking Info from
-the shell:
-
-@table @code
-@cindex directory path
-@item --directory @var{directory-path}
-@itemx -d @var{directory-path}
-Add @var{directory-path} to the list of directory paths searched when
-Info needs to find a file. You may issue @code{--directory} multiple
-times; once for each directory which contains Info files.
-Alternatively, you may specify a value for the environment variable
-@code{INFOPATH}; if @code{--directory} is not given, the value of
-@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon
-separated list of directory names. If you do not supply @code{INFOPATH}
-or @code{--directory-path}, Info uses a default path.
-
-@item --file @var{filename}
-@itemx -f @var{filename}
-@cindex Info file, selecting
-Specify a particular Info file to visit. By default, Info visits
-the file @code{dir}; if you use this option, Info will start with
-@code{(@var{filename})Top} as the first file and node.
-
-@item --index-search @var{string}
-@cindex index search, selecting
-@cindex online help, using Info as
-Go to the index entry @var{string} in the Info file specified with
-@samp{--file}. If no such entry, print @samp{no entries found} and exit
-with nonzero status. This can used from another program as a way to
-provide online help.
-
-@item --node @var{nodename}
-@itemx -n @var{nodename}
-@cindex node, selecting
-Specify a particular node to visit in the initial file that Info
-loads. This is especially useful in conjunction with
-@code{--file}@footnote{Of course, you can specify both the file and node
-in a @code{--node} command; but don't forget to escape the open and
-close parentheses from the shell as in: @code{info --node
-"(emacs)Buffers"}}. You may specify @code{--node} multiple times; for
-an interactive Info, each @var{nodename} is visited in its own window,
-for a non-interactive Info (such as when @code{--output} is given) each
-@var{nodename} is processed sequentially.
-
-@item --output @var{filename}
-@itemx -o @var{filename}
-@cindex file, outputting to
-@cindex outputting to a file
-Specify @var{filename} as the name of a file to which to direct output.
-Each node that Info visits will be output to @var{filename} instead of
-interactively viewed. A value of @code{-} for @var{filename} specifies
-the standard output.
-
-@item --subnodes
-@cindex @code{--subnodes}, command line option
-This option only has meaning when given in conjunction with
-@code{--output}. It means to recursively output the nodes appearing in
-the menus of each node being output. Menu items which resolve to
-external Info files are not output, and neither are menu items which are
-members of an index. Each node is only output once.
-
-@item --help
-@itemx -h
-Produces a relatively brief description of the available Info options.
-
-@item --version
-@cindex version information
-Prints the version information of Info and exits.
-
-@item @var{menu-item}
-@cindex menu, following
-Info treats its remaining arguments as the names of menu items. The
-first argument is a menu item in the initial node visited, while
-the second argument is a menu item in the first argument's node.
-You can easily move to the node of your choice by specifying the menu
-names which describe the path to that node. For example,
-
-@example
-info emacs buffers
-@end example
-
-@noindent
-first selects the menu item @samp{Emacs} in the node @samp{(dir)Top},
-and then selects the menu item @samp{Buffers} in the node
-@samp{(emacs)Top}.
-@end table
-
-@node Cursor Commands, Scrolling Commands, Options, Top
-@chapter Moving the Cursor
-@cindex cursor, moving
-
-Many people find that reading screens of text page by page is made
-easier when one is able to indicate particular pieces of text with some
-kind of pointing device. Since this is the case, GNU Info (both the
-Emacs and standalone versions) have several commands which allow you to
-move the cursor about the screen. The notation used in this manual to
-describe keystrokes is identical to the notation used within the Emacs
-manual, and the GNU Readline manual. @xref{Characters, , Character
-Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the
-notation.
-
-The following table lists the basic cursor movement commands in Info.
-Each entry consists of the key sequence you should type to execute the
-cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it
-invokes @code{execute-extended-command}. @xref{M-x, , Executing an
-extended command, emacs, the GNU Emacs Manual}, for more detailed
-information.} command name (displayed in parentheses), and a short
-description of what the command does. All of the cursor motion commands
-can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
-@code{universal-argument}}), to find out how to supply them. With a
-numeric argument, the motion commands are simply executed that
-many times; for example, a numeric argument of 4 given to
-@code{next-line} causes the cursor to move down 4 lines. With a
-negative numeric argument, the motion is reversed; an argument of -4
-given to the @code{next-line} command would cause the cursor to move
-@emph{up} 4 lines.
-
-@table @asis
-@item @code{C-n} (@code{next-line})
-@kindex C-n
-@findex next-line
-Move the cursor down to the next line.
-
-@item @code{C-p} (@code{prev-line})
-@kindex C-p
-@findex prev-line
-Move the cursor up to the previous line.
-
-@item @code{C-a} (@code{beginning-of-line})
-@kindex C-a, in Info windows
-@findex beginning-of-line
-Move the cursor to the start of the current line.
-
-@item @code{C-e} (@code{end-of-line})
-@kindex C-e, in Info windows
-@findex end-of-line
-Move the cursor to the end of the current line.
-
-@item @code{C-f} (@code{forward-char})
-@kindex C-f, in Info windows
-@findex forward-char
-Move the cursor forward a character.
-
-@item @code{C-b} (@code{backward-char})
-@kindex C-b, in Info windows
-@findex backward-char
-Move the cursor backward a character.
-
-@item @code{M-f} (@code{forward-word})
-@kindex M-f, in Info windows
-@findex forward-word
-Move the cursor forward a word.
-
-@item @code{M-b} (@code{backward-word})
-@kindex M-b, in Info windows
-@findex backward-word
-Move the cursor backward a word.
-
-@item @code{M-<} (@code{beginning-of-node})
-@itemx @code{b}
-@kindex b, in Info windows
-@kindex M-<
-@findex beginning-of-node
-Move the cursor to the start of the current node.
-
-@item @code{M->} (@code{end-of-node})
-@kindex M->
-@findex end-of-node
-Move the cursor to the end of the current node.
-
-@item @code{M-r} (@code{move-to-window-line})
-@kindex M-r
-@findex move-to-window-line
-Move the cursor to a specific line of the window. Without a numeric
-argument, @code{M-r} moves the cursor to the start of the line in the
-center of the window. With a numeric argument of @var{n}, @code{M-r}
-moves the cursor to the start of the @var{n}th line in the window.
-@end table
-
-@node Scrolling Commands, Node Commands, Cursor Commands, Top
-@chapter Moving Text Within a Window
-@cindex scrolling
-
-Sometimes you are looking at a screenful of text, and only part of the
-current paragraph you are reading is visible on the screen. The
-commands detailed in this section are used to shift which part of the
-current node is visible on the screen.
-
-@table @asis
-@item @code{SPC} (@code{scroll-forward})
-@itemx @code{C-v}
-@kindex SPC, in Info windows
-@kindex C-v
-@findex scroll-forward
-Shift the text in this window up. That is, show more of the node which
-is currently below the bottom of the window. With a numeric argument,
-show that many more lines at the bottom of the window; a numeric
-argument of 4 would shift all of the text in the window up 4 lines
-(discarding the top 4 lines), and show you four new lines at the bottom
-of the window. Without a numeric argument, @key{SPC} takes the bottom
-two lines of the window and places them at the top of the window,
-redisplaying almost a completely new screenful of lines.
-
-@item @code{DEL} (@code{scroll-backward})
-@itemx @code{M-v}
-@kindex DEL, in Info windows
-@kindex M-v
-@findex scroll-backward
-Shift the text in this window down. The inverse of
-@code{scroll-forward}.
-@end table
-
-@cindex scrolling through node structure
-The @code{scroll-forward} and @code{scroll-backward} commands can also
-move forward and backward through the node structure of the file. If
-you press @key{SPC} while viewing the end of a node, or @key{DEL} while
-viewing the beginning of a node, what happens is controlled by the
-variable @code{scroll-behavior}. @xref{Variables,
-@code{scroll-behavior}}, for more information.
-
-@table @asis
-@item @code{C-l} (@code{redraw-display})
-@kindex C-l
-@findex redraw-display
-Redraw the display from scratch, or shift the line containing the cursor
-to a specified location. With no numeric argument, @samp{C-l} clears
-the screen, and then redraws its entire contents. Given a numeric
-argument of @var{n}, the line containing the cursor is shifted so that
-it is on the @var{n}th line of the window.
-
-@item @code{C-x w} (@code{toggle-wrap})
-@kindex C-w
-@findex toggle-wrap
-Toggles the state of line wrapping in the current window. Normally,
-lines which are longer than the screen width @dfn{wrap}, i.e., they are
-continued on the next line. Lines which wrap have a @samp{\} appearing
-in the rightmost column of the screen. You can cause such lines to be
-terminated at the rightmost column by changing the state of line
-wrapping in the window with @code{C-x w}. When a line which needs more
-space than one screen width to display is displayed, a @samp{$} appears
-in the rightmost column of the screen, and the remainder of the line is
-invisible.
-@end table
-
-@node Node Commands, Searching Commands, Scrolling Commands, Top
-@chapter Selecting a New Node
-@cindex nodes, selection of
-
-This section details the numerous Info commands which select a new node
-to view in the current window.
-
-The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
-@samp{l}.
-
-When you are viewing a node, the top line of the node contains some Info
-@dfn{pointers} which describe where the next, previous, and up nodes
-are. Info uses this line to move about the node structure of the file
-when you use the following commands:
-
-@table @asis
-@item @code{n} (@code{next-node})
-@kindex n
-@findex next-node
-Select the `Next' node.
-
-@item @code{p} (@code{prev-node})
-@kindex p
-@findex prev-node
-Select the `Prev' node.
-
-@item @code{u} (@code{up-node})
-@kindex u
-@findex up-node
-Select the `Up' node.
-@end table
-
-You can easily select a node that you have already viewed in this window
-by using the @samp{l} command -- this name stands for "last", and
-actually moves through the list of already visited nodes for this
-window. @samp{l} with a negative numeric argument moves forward through
-the history of nodes for this window, so you can quickly step between
-two adjacent (in viewing history) nodes.
-
-@table @asis
-@item @code{l} (@code{history-node})
-@kindex l
-@findex history-node
-Select the most recently selected node in this window.
-@end table
-
-Two additional commands make it easy to select the most commonly
-selected nodes; they are @samp{t} and @samp{d}.
-
-@table @asis
-@item @code{t} (@code{top-node})
-@kindex t
-@findex top-node
-Select the node @samp{Top} in the current Info file.
-
-@item @code{d} (@code{dir-node})
-@kindex d
-@findex dir-node
-Select the directory node (i.e., the node @samp{(dir)}).
-@end table
-
-Here are some other commands which immediately result in the selection
-of a different node in the current window:
-
-@table @asis
-@item @code{<} (@code{first-node})
-@kindex <
-@findex first-node
-Selects the first node which appears in this file. This node is most
-often @samp{Top}, but it does not have to be.
-
-@item @code{>} (@code{last-node})
-@kindex >
-@findex last-node
-Select the last node which appears in this file.
-
-@item @code{]} (@code{global-next-node})
-@kindex ]
-@findex global-next-node
-Move forward or down through node structure. If the node that you are
-currently viewing has a @samp{Next} pointer, that node is selected.
-Otherwise, if this node has a menu, the first menu item is selected. If
-there is no @samp{Next} and no menu, the same process is tried with the
-@samp{Up} node of this node.
-
-@item @code{[} (@code{global-prev-node})
-@kindex [
-@findex global-prev-node
-Move backward or up through node structure. If the node that you are
-currently viewing has a @samp{Prev} pointer, that node is selected.
-Otherwise, if the node has an @samp{Up} pointer, that node is selected,
-and if it has a menu, the last item in the menu is selected.
-@end table
-
-You can get the same behavior as @code{global-next-node} and
-@code{global-prev-node} while simply scrolling through the file with
-@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behavior}}, for
-more information.
-
-@table @asis
-@item @code{g} (@code{goto-node})
-@kindex g
-@findex goto-node
-Read the name of a node and select it. No completion is done while
-reading the node name, since the desired node may reside in a separate
-file. The node must be typed exactly as it appears in the Info file. A
-file name may be included as with any node specification, for example
-
-@example
-@code{g(emacs)Buffers}
-@end example
-
-finds the node @samp{Buffers} in the Info file @file{emacs}.
-
-@item @code{C-x k} (@code{kill-node})
-@kindex C-x k
-@findex kill-node
-Kill a node. The node name is prompted for in the echo area, with a
-default of the current node. @dfn{Killing} a node means that Info tries
-hard to forget about it, removing it from the list of history nodes kept
-for the window where that node is found. Another node is selected in
-the window which contained the killed node.
-
-@item @code{C-x C-f} (@code{view-file})
-@kindex C-x C-f
-@findex view-file
-Read the name of a file and selects the entire file. The command
-@example
-@code{C-x C-f @var{filename}}
-@end example
-is equivalent to typing
-@example
-@code{g(@var{filename})*}
-@end example
-
-@item @code{C-x C-b} (@code{list-visited-nodes})
-@kindex C-x C-b
-@findex list-visited-nodes
-Make a window containing a menu of all of the currently visited nodes.
-This window becomes the selected window, and you may use the standard
-Info commands within it.
-
-@item @code{C-x b} (@code{select-visited-node})
-@kindex C-x b
-@findex select-visited-node
-Select a node which has been previously visited in a visible window.
-This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
-created.
-@end table
-
-@node Searching Commands, Xref Commands, Node Commands, Top
-@chapter Searching an Info File
-@cindex searching
-
-GNU Info allows you to search for a sequence of characters throughout an
-entire Info file, search through the indices of an Info file, or find
-areas within an Info file which discuss a particular topic.
-
-@table @asis
-@item @code{s} (@code{search})
-@kindex s
-@findex search
-Read a string in the echo area and search for it.
-
-@item @code{C-s} (@code{isearch-forward})
-@kindex C-s
-@findex isearch-forward
-Interactively search forward through the Info file for a string as you
-type it.
-
-@item @code{C-r} (@code{isearch-backward})
-@kindex C-r
-@findex isearch-backward
-Interactively search backward through the Info file for a string as
-you type it.
-
-@item @code{i} (@code{index-search})
-@kindex i
-@findex index-search
-Look up a string in the indices for this Info file, and select a node
-where the found index entry points to.
-
-@item @code{,} (@code{next-index-match})
-@kindex ,
-@findex next-index-match
-Move to the node containing the next matching index item from the last
-@samp{i} command.
-@end table
-
-The most basic searching command is @samp{s} (@code{search}). The
-@samp{s} command prompts you for a string in the echo area, and then
-searches the remainder of the Info file for an occurrence of that string.
-If the string is found, the node containing it is selected, and the
-cursor is left positioned at the start of the found string. Subsequent
-@samp{s} commands show you the default search string within @samp{[} and
-@samp{]}; pressing @key{RET} instead of typing a new string will use the
-default search string.
-
-@dfn{Incremental searching} is similar to basic searching, but the
-string is looked up while you are typing it, instead of waiting until
-the entire search string has been specified.
-
-@node Xref Commands, Window Commands, Searching Commands, Top
-@chapter Selecting Cross References
-
-We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
-pointers which appear at the top of a node. In addition to these
-pointers, a node may contain other pointers which refer you to a
-different node, perhaps in another Info file. Such pointers are called
-@dfn{cross references}, or @dfn{xrefs} for short.
-
-@menu
-* Parts of an Xref:: What a cross reference is made of.
-* Selecting Xrefs:: Commands for selecting menu or note items.
-@end menu
-
-@node Parts of an Xref, Selecting Xrefs, , Xref Commands
-@section Parts of an Xref
-
-Cross references have two major parts: the first part is called the
-@dfn{label}; it is the name that you can use to refer to the cross
-reference, and the second is the @dfn{target}; it is the full name of
-the node that the cross reference points to.
-
-The target is separated from the label by a colon @samp{:}; first the
-label appears, and then the target. For example, in the sample menu
-cross reference below, the single colon separates the label from the
-target.
-
-@example
-* Foo Label: Foo Target. More information about Foo.
-@end example
-
-Note the @samp{.} which ends the name of the target. The @samp{.} is
-not part of the target; it serves only to let Info know where the target
-name ends.
-
-A shorthand way of specifying references allows two adjacent colons to
-stand for a target name which is the same as the label name:
-
-@example
-* Foo Commands:: Commands pertaining to Foo.
-@end example
-
-In the above example, the name of the target is the same as the name of
-the label, in this case @code{Foo Commands}.
-
-You will normally see two types of cross reference while viewing nodes:
-@dfn{menu} references, and @dfn{note} references. Menu references
-appear within a node's menu; they begin with a @samp{*} at the beginning
-of a line, and continue with a label, a target, and a comment which
-describes what the contents of the node pointed to contains.
-
-Note references appear within the body of the node text; they begin with
-@code{*Note}, and continue with a label and a target.
-
-Like @samp{Next}, @samp{Prev}, and @samp{Up} pointers, cross references
-can point to any valid node. They are used to refer you to a place
-where more detailed information can be found on a particular subject.
-Here is a cross reference which points to a node within the Texinfo
-documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo
-Manual}, for more information on creating your own texinfo cross
-references.
-
-@node Selecting Xrefs, , Parts of an Xref, Xref Commands
-@section Selecting Xrefs
-
-The following table lists the Info commands which operate on menu items.
-
-@table @asis
-@item @code{1} (@code{menu-digit})
-@itemx @code{2} @dots{} @code{9}
-@cindex 1 @dots{} 9, in Info windows
-@kindex 1 @dots{} 9, in Info windows
-@findex menu-digit
-Within an Info window, pressing a single digit, (such as @samp{1}),
-selects that menu item, and places its node in the current window.
-For convenience, there is one exception; pressing @samp{0} selects the
-@emph{last} item in the node's menu.
-
-@item @code{0} (@code{last-menu-item})
-@kindex 0, in Info windows
-@findex last-menu-item
-Select the last item in the current node's menu.
-
-@item @code{m} (@code{menu-item})
-@kindex m
-@findex menu-item
-Reads the name of a menu item in the echo area and selects its node.
-Completion is available while reading the menu label.
-
-@item @code{M-x find-menu}
-@findex find-menu
-Move the cursor to the start of this node's menu.
-@end table
-
-This table lists the Info commands which operate on note cross references.
-
-@table @asis
-@item @code{f} (@code{xref-item})
-@itemx @code{r}
-@kindex f
-@kindex r
-@findex xref-item
-Reads the name of a note cross reference in the echo area and selects
-its node. Completion is available while reading the cross reference
-label.
-@end table
-
-Finally, the next few commands operate on menu or note references alike:
-
-@table @asis
-@item @code{TAB} (@code{move-to-next-xref})
-@kindex TAB, in Info windows
-@findex move-to-next-xref
-Move the cursor to the start of the next nearest menu item or note
-reference in this node. You can then use @key{RET}
-(@code{select-reference-this-line}) to select the menu or note reference.
-
-@item @code{M-TAB} (@code{move-to-prev-xref})
-@kindex M-TAB, in Info windows
-@findex move-to-prev-xref
-Move the cursor the start of the nearest previous menu item or note
-reference in this node.
-
-@item @code{RET} (@code{select-reference-this-line})
-@kindex RET, in Info windows
-@findex select-reference-this-line
-Select the menu item or note reference appearing on this line.
-@end table
-
-@node Window Commands, Printing Nodes, Xref Commands, Top
-@chapter Manipulating Multiple Windows
-@cindex windows, manipulating
-
-A @dfn{window} is a place to show the text of a node. Windows have a
-view area where the text of the node is displayed, and an associated
-@dfn{mode line}, which briefly describes the node being viewed.
-
-GNU Info supports multiple windows appearing in a single screen; each
-window is separated from the next by its modeline. At any time, there
-is only one @dfn{active} window, that is, the window in which the cursor
-appears. There are commands available for creating windows, changing
-the size of windows, selecting which window is active, and for deleting
-windows.
-
-@menu
-* The Mode Line:: What appears in the mode line?
-* Basic Windows:: Manipulating windows in Info.
-* The Echo Area:: Used for displaying errors and reading input.
-@end menu
-
-@node The Mode Line, Basic Windows, , Window Commands
-@section The Mode Line
-
-A @dfn{mode line} is a line of inverse video which appears at the bottom
-of an Info window. It describes the contents of the window just above
-it; this information includes the name of the file and node appearing in
-that window, the number of screen lines it takes to display the node,
-and the percentage of text that is above the top of the window. It can
-also tell you if the indirect tags table for this Info file needs to be
-updated, and whether or not the Info file was compressed when stored on
-disk.
-
-Here is a sample mode line for a window containing an uncompressed file
-named @file{dir}, showing the node @samp{Top}.
-
-@example
-@group
------Info: (dir)Top, 40 lines --Top---------------------------------------
- ^^ ^ ^^^ ^^
- (file)Node #lines where
-@end group
-@end example
-
-When a node comes from a file which is compressed on disk, this is
-indicated in the mode line with two small @samp{z}'s. In addition, if
-the Info file containing the node has been split into subfiles, the name
-of the subfile containing the node appears in the modeline as well:
-
-@example
---zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
-@end example
-
-When Info makes a node internally, such that there is no corresponding
-info file on disk, the name of the node is surrounded by asterisks
-(@samp{*}). The name itself tells you what the contents of the window
-are; the sample mode line below shows an internally constructed node
-showing possible completions:
-
-@example
------Info: *Completions*, 7 lines --All-----------------------------------
-@end example
-
-@node Basic Windows, The Echo Area, The Mode Line, Window Commands
-@section Window Commands
-
-It can be convenient to view more than one node at a time. To allow
-this, Info can display more than one @dfn{window}. Each window has its
-own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
-window (@pxref{Node Commands, , @code{history-node}}).
-
-@table @asis
-@item @code{C-x o} (@code{next-window})
-@cindex windows, selecting
-@kindex C-x o
-@findex next-window
-Select the next window on the screen. Note that the echo area can only be
-selected if it is already in use, and you have left it temporarily.
-Normally, @samp{C-x o} simply moves the cursor into the next window on
-the screen, or if you are already within the last window, into the first
-window on the screen. Given a numeric argument, @samp{C-x o} moves over
-that many windows. A negative argument causes @samp{C-x o} to select
-the previous window on the screen.
-
-@item @code{M-x prev-window}
-@findex prev-window
-Select the previous window on the screen. This is identical to
-@samp{C-x o} with a negative argument.
-
-@item @code{C-x 2} (@code{split-window})
-@cindex windows, creating
-@kindex C-x 2
-@findex split-window
-Split the current window into two windows, both showing the same node.
-Each window is one half the size of the original window, and the cursor
-remains in the original window. The variable @code{automatic-tiling}
-can cause all of the windows on the screen to be resized for you
-automatically, please @pxref{Variables, , automatic-tiling} for more
-information.
-
-@item @code{C-x 0} (@code{delete-window})
-@cindex windows, deleting
-@kindex C-x 0
-@findex delete-window
-Delete the current window from the screen. If you have made too many
-windows and your screen appears cluttered, this is the way to get rid of
-some of them.
-
-@item @code{C-x 1} (@code{keep-one-window})
-@kindex C-x 1
-@findex keep-one-window
-Delete all of the windows excepting the current one.
-
-@item @code{ESC C-v} (@code{scroll-other-window})
-@kindex ESC C-v, in Info windows
-@findex scroll-other-window
-Scroll the other window, in the same fashion that @samp{C-v} might
-scroll the current window. Given a negative argument, scroll the
-"other" window backward.
-
-@item @code{C-x ^} (@code{grow-window})
-@kindex C-x ^
-@findex grow-window
-Grow (or shrink) the current window. Given a numeric argument, grow
-the current window that many lines; with a negative numeric argument,
-shrink the window instead.
-
-@item @code{C-x t} (@code{tile-windows})
-@cindex tiling
-@kindex C-x t
-@findex tile-windows
-Divide the available screen space among all of the visible windows.
-Each window is given an equal portion of the screen in which to display
-its contents. The variable @code{automatic-tiling} can cause
-@code{tile-windows} to be called when a window is created or deleted.
-@xref{Variables, , @code{automatic-tiling}}.
-@end table
-
-@node The Echo Area, , Basic Windows, Window Commands
-@section The Echo Area
-@cindex echo area
-
-The @dfn{echo area} is a one line window which appears at the bottom of
-the screen. It is used to display informative or error messages, and to
-read lines of input from you when that is necessary. Almost all of the
-commands available in the echo area are identical to their Emacs
-counterparts, so please refer to that documentation for greater depth of
-discussion on the concepts of editing a line of text. The following
-table briefly lists the commands that are available while input is being
-read in the echo area:
-
-@table @asis
-@item @code{C-f} (@code{echo-area-forward})
-@kindex C-f, in the echo area
-@findex echo-area-forward
-Move forward a character.
-
-@item @code{C-b} (@code{echo-area-backward})
-@kindex C-b, in the echo area
-@findex echo-area-backward
-Move backward a character.
-
-@item @code{C-a} (@code{echo-area-beg-of-line})
-@kindex C-a, in the echo area
-@findex echo-area-beg-of-line
-Move to the start of the input line.
-
-@item @code{C-e} (@code{echo-area-end-of-line})
-@kindex C-e, in the echo area
-@findex echo-area-end-of-line
-Move to the end of the input line.
-
-@item @code{M-f} (@code{echo-area-forward-word})
-@kindex M-f, in the echo area
-@findex echo-area-forward-word
-Move forward a word.
-
-@item @code{M-b} (@code{echo-area-backward-word})
-@kindex M-b, in the echo area
-@findex echo-area-backward-word
-Move backward a word.
-
-@item @code{C-d} (@code{echo-area-delete})
-@kindex C-d, in the echo area
-@findex echo-area-delete
-Delete the character under the cursor.
-
-@item @code{DEL} (@code{echo-area-rubout})
-@kindex DEL, in the echo area
-@findex echo-area-rubout
-Delete the character behind the cursor.
-
-@item @code{C-g} (@code{echo-area-abort})
-@kindex C-g, in the echo area
-@findex echo-area-abort
-Cancel or quit the current operation. If completion is being read,
-@samp{C-g} discards the text of the input line which does not match any
-completion. If the input line is empty, @samp{C-g} aborts the calling
-function.
-
-@item @code{RET} (@code{echo-area-newline})
-@kindex RET, in the echo area
-@findex echo-area-newline
-Accept (or forces completion of) the current input line.
-
-@item @code{C-q} (@code{echo-area-quoted-insert})
-@kindex C-q, in the echo area
-@findex echo-area-quoted-insert
-Insert the next character verbatim. This is how you can insert control
-characters into a search string, for example.
-
-@item @var{printing character} (@code{echo-area-insert})
-@kindex printing characters, in the echo area
-@findex echo-area-insert
-Insert the character.
-
-@item @code{M-TAB} (@code{echo-area-tab-insert})
-@kindex M-TAB, in the echo area
-@findex echo-area-tab-insert
-Insert a TAB character.
-
-@item @code{C-t} (@code{echo-area-transpose-chars})
-@kindex C-t, in the echo area
-@findex echo-area-transpose-chars
-Transpose the characters at the cursor.
-@end table
-
-The next group of commands deal with @dfn{killing}, and @dfn{yanking}
-text. For an in depth discussion of killing and yanking,
-@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
-
-@table @asis
-@item @code{M-d} (@code{echo-area-kill-word})
-@kindex M-d, in the echo area
-@findex echo-area-kill-word
-Kill the word following the cursor.
-
-@item @code{M-DEL} (@code{echo-area-backward-kill-word})
-@kindex M-DEL, in the echo area
-@findex echo-area-backward-kill-word
-Kill the word preceding the cursor.
-
-@item @code{C-k} (@code{echo-area-kill-line})
-@kindex C-k, in the echo area
-@findex echo-area-kill-line
-Kill the text from the cursor to the end of the line.
-
-@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
-@kindex C-x DEL, in the echo area
-@findex echo-area-backward-kill-line
-Kill the text from the cursor to the beginning of the line.
-
-@item @code{C-y} (@code{echo-area-yank})
-@kindex C-y, in the echo area
-@findex echo-area-yank
-Yank back the contents of the last kill.
-
-@item @code{M-y} (@code{echo-area-yank-pop})
-@kindex M-y, in the echo area
-@findex echo-area-yank-pop
-Yank back a previous kill, removing the last yanked text first.
-@end table
-
-Sometimes when reading input in the echo area, the command that needed
-input will only accept one of a list of several choices. The choices
-represent the @dfn{possible completions}, and you must respond with one
-of them. Since there are a limited number of responses you can make,
-Info allows you to abbreviate what you type, only typing as much of the
-response as is necessary to uniquely identify it. In addition, you can
-request Info to fill in as much of the response as is possible; this
-is called @dfn{completion}.
-
-The following commands are available when completing in the echo area:
-
-@table @asis
-@item @code{TAB} (@code{echo-area-complete})
-@itemx @code{SPC}
-@kindex TAB, in the echo area
-@kindex SPC, in the echo area
-@findex echo-area-complete
-Insert as much of a completion as is possible.
-
-@item @code{?} (@code{echo-area-possible-completions})
-@kindex ?, in the echo area
-@findex echo-area-possible-completions
-Display a window containing a list of the possible completions of what
-you have typed so far. For example, if the available choices are:
-
-@example
-@group
-bar
-foliate
-food
-forget
-@end group
-@end example
-
-@noindent
-and you have typed an @samp{f}, followed by @samp{?}, the possible
-completions would contain:
-
-@example
-@group
-foliate
-food
-forget
-@end group
-@end example
-
-@noindent
-i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC}
-or @key{TAB} would result in @samp{fo} appearing in the echo area, since
-all of the choices which begin with @samp{f} continue with @samp{o}.
-Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
-appearing in the echo area, since that is the only choice which begins
-with @samp{fol}.
-
-@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
-@kindex ESC C-v, in the echo area
-@findex echo-area-scroll-completions-window
-Scroll the completions window, if that is visible, or the "other"
-window if not.
-@end table
-
-@node Printing Nodes, Miscellaneous Commands, Window Commands, Top
-@chapter Printing Out Nodes
-@cindex printing
-
-You may wish to print out the contents of a node as a quick reference
-document for later use. Info provides you with a command for doing
-this. In general, we recommend that you use @TeX{} to format the
-document and print sections of it, by running @code{tex} on the Texinfo
-source file.
-
-@table @asis
-@item @code{M-x print-node}
-@findex print-node
-@cindex INFO_PRINT_COMMAND, environment variable
-Pipe the contents of the current node through the command in the
-environment variable @code{INFO_PRINT_COMMAND}. If the variable does not
-exist, the node is simply piped to @code{lpr}.
-@end table
-
-@node Miscellaneous Commands, Variables, Printing Nodes, Top
-@chapter Miscellaneous Commands
-
-GNU Info contains several commands which self-document GNU Info:
-
-@table @asis
-@item @code{M-x describe-command}
-@cindex functions, describing
-@cindex commands, describing
-@findex describe-command
-Read the name of an Info command in the echo area and then display a
-brief description of what that command does.
-
-@item @code{M-x describe-key}
-@cindex keys, describing
-@findex describe-key
-Read a key sequence in the echo area, and then display the name and
-documentation of the Info command that the key sequence invokes.
-
-@item @code{M-x describe-variable}
-Read the name of a variable in the echo area and then display a brief
-description of what the variable affects.
-
-@item @code{M-x where-is}
-@findex where-is
-Read the name of an Info command in the echo area, and then display
-a key sequence which can be typed in order to invoke that command.
-
-@item @code{C-h} (@code{get-help-window})
-@itemx @code{?}
-@kindex C-h
-@kindex ?, in Info windows
-@findex get-help-window
-Create (or Move into) the window displaying @code{*Help*}, and place
-a node containing a quick reference card into it. This window displays
-the most concise information about GNU Info available.
-
-@item @code{h} (@code{get-info-help-node})
-@kindex h
-@findex get-info-help-node
-Try hard to visit the node @code{(info)Help}. The Info file
-@file{info.texi} distributed with GNU Info contains this node. Of
-course, the file must first be processed with @code{makeinfo}, and then
-placed into the location of your Info directory.
-@end table
-
-Here are the commands for creating a numeric argument:
-
-@table @asis
-@item @code{C-u} (@code{universal-argument})
-@cindex numeric arguments
-@kindex C-u
-@findex universal-argument
-Start (or multiply by 4) the current numeric argument. @samp{C-u} is
-a good way to give a small numeric argument to cursor movement or
-scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
-@samp{C-u C-u C-n} moves the cursor down 16 lines.
-
-@item @code{M-1} (@code{add-digit-to-numeric-arg})
-@itemx @code{M-2} @dots{} @code{M-9}
-@kindex M-1 @dots{} M-9
-@findex add-digit-to-numeric-arg
-Add the digit value of the invoking key to the current numeric
-argument. Once Info is reading a numeric argument, you may just type
-the digits of the argument, without the Meta prefix. For example, you
-might give @samp{C-l} a numeric argument of 32 by typing:
-
-@example
-@kbd{C-u 3 2 C-l}
-@end example
-
-@noindent
-or
-
-@example
-@kbd{M-3 2 C-l}
-@end example
-@end table
-
-@samp{C-g} is used to abort the reading of a multi-character key
-sequence, to cancel lengthy operations (such as multi-file searches) and
-to cancel reading input in the echo area.
-
-@table @asis
-@item @code{C-g} (@code{abort-key})
-@cindex cancelling typeahead
-@cindex cancelling the current operation
-@kindex C-g, in Info windows
-@findex abort-key
-Cancel current operation.
-@end table
-
-The @samp{q} command of Info simply quits running Info.
-
-@table @asis
-@item @code{q} (@code{quit})
-@cindex quitting
-@kindex q
-@findex quit
-Exit GNU Info.
-@end table
-
-If the operating system tells GNU Info that the screen is 60 lines tall,
-and it is actually only 40 lines tall, here is a way to tell Info that
-the operating system is correct.
-
-@table @asis
-@item @code{M-x set-screen-height}
-@findex set-screen-height
-@cindex screen, changing the height of
-Read a height value in the echo area and set the height of the
-displayed screen to that value.
-@end table
-
-Finally, Info provides a convenient way to display footnotes which might
-be associated with the current node that you are viewing:
-
-@table @asis
-@item @code{ESC C-f} (@code{show-footnotes})
-@kindex ESC C-f
-@findex show-footnotes
-@cindex footnotes, displaying
-Show the footnotes (if any) associated with the current node in another
-window. You can have Info automatically display the footnotes
-associated with a node when the node is selected by setting the variable
-@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}.
-@end table
-
-@node Variables, GNU Info Global Index, Miscellaneous Commands, Top
-@chapter Manipulating Variables
-
-GNU Info contains several @dfn{variables} whose values are looked at by
-various Info commands. You can change the values of these variables,
-and thus change the behavior of Info to more closely match your
-environment and Info file reading manner.
-
-@table @asis
-@item @code{M-x set-variable}
-@cindex variables, setting
-@findex set-variable
-Read the name of a variable, and the value for it, in the echo area and
-then set the variable to that value. Completion is available when
-reading the variable name; often, completion is available when reading
-the value to give to the variable, but that depends on the variable
-itself. If a variable does @emph{not} supply multiple choices to
-complete over, it expects a numeric value.
-
-@item @code{M-x describe-variable}
-@cindex variables, describing
-@findex describe-variable
-Read the name of a variable in the echo area and then display a brief
-description of what the variable affects.
-@end table
-
-Here is a list of the variables that you can set in Info.
-
-@table @code
-@item automatic-footnotes
-@vindex automatic-footnotes
-When set to @code{On}, footnotes appear and disappear automatically.
-This variable is @code{On} by default. When a node is selected, a
-window containing the footnotes which appear in that node is created,
-and the footnotes are displayed within the new window. The window that
-Info creates to contain the footnotes is called @samp{*Footnotes*}. If
-a node is selected which contains no footnotes, and a @samp{*Footnotes*}
-window is on the screen, the @samp{*Footnotes*} window is deleted.
-Footnote windows created in this fashion are not automatically tiled so
-that they can use as little of the display as is possible.
-
-@item automatic-tiling
-@vindex automatic-tiling
-When set to @code{On}, creating or deleting a window resizes other
-windows. This variable is @code{Off} by default. Normally, typing
-@samp{C-x 2} divides the current window into two equal parts. When
-@code{automatic-tiling} is set to @code{On}, all of the windows are
-resized automatically, keeping an equal number of lines visible in each
-window. There are exceptions to the automatic tiling; specifically, the
-windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
-resized through automatic tiling; they remain their original size.
-
-@item visible-bell
-@vindex visible-bell
-When set to @code{On}, GNU Info attempts to flash the screen instead of
-ringing the bell. This variable is @code{Off} by default. Of course,
-Info can only flash the screen if the terminal allows it; in the case
-that the terminal does not allow it, the setting of this variable has no
-effect. However, you can make Info perform quietly by setting the
-@code{errors-ring-bell} variable to @code{Off}.
-
-@item errors-ring-bell
-@vindex errors-ring-bell
-When set to @code{On}, errors cause the bell to ring. The default
-setting of this variable is @code{On}.
-
-@item gc-compressed-files
-@vindex gc-compressed-files
-When set to @code{On}, Info garbage collects files which had to be
-uncompressed. The default value of this variable is @code{Off}.
-Whenever a node is visited in Info, the Info file containing that node
-is read into core, and Info reads information about the tags and nodes
-contained in that file. Once the tags information is read by Info, it
-is never forgotten. However, the actual text of the nodes does not need
-to remain in core unless a particular Info window needs it. For
-non-compressed files, the text of the nodes does not remain in core when
-it is no longer in use. But de-compressing a file can be a time
-consuming operation, and so Info tries hard not to do it twice.
-@code{gc-compressed-files} tells Info it is okay to garbage collect the
-text of the nodes of a file which was compressed on disk.
-
-@item show-index-match
-@vindex show-index-match
-When set to @code{On}, the portion of the matched search string is
-highlighted in the message which explains where the matched search
-string was found. The default value of this variable is @code{On}.
-When Info displays the location where an index match was found,
-(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
-string that you had typed is highlighted by displaying it in the inverse
-case from its surrounding characters.
-
-@item scroll-behavior
-@vindex scroll-behavior
-Control what happens when forward scrolling is requested at the end of
-a node, or when backward scrolling is requested at the beginning of a
-node. The default value for this variable is @code{Continuous}. There
-are three possible values for this variable:
-
-@table @code
-@item Continuous
-Try to get the first item in this node's menu, or failing that, the
-@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}.
-This behavior is identical to using the @samp{]}
-(@code{global-next-node}) and @samp{[} (@code{global-prev-node})
-commands.
-
-@item Next Only
-Only try to get the @samp{Next} node.
-
-@item Page Only
-Simply give up, changing nothing. If @code{scroll-behavior} is
-@code{Page Only}, no scrolling command can change the node that is being
-viewed.
-@end table
-
-@item scroll-step
-@vindex scroll-step
-The number of lines to scroll when the cursor moves out of the window.
-Scrolling happens automatically if the cursor has moved out of the
-visible portion of the node text when it is time to display. Usually
-the scrolling is done so as to put the cursor on the center line of the
-current window. However, if the variable @code{scroll-step} has a
-nonzero value, Info attempts to scroll the node text by that many lines;
-if that is enough to bring the cursor back into the window, that is what
-is done. The default value of this variable is 0, thus placing the
-cursor (and the text it is attached to) in the center of the window.
-Setting this variable to 1 causes a kind of "smooth scrolling" which
-some people prefer.
-
-@item ISO-Latin
-@cindex ISO Latin characters
-@vindex ISO-Latin
-When set to @code{On}, Info accepts and displays ISO Latin characters.
-By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
-Info that it is running in an environment where the European standard
-character set is in use, and allows you to input such characters to
-Info, as well as display them.
-@end table
-
-
-
-@c the following is incomplete
-@ignore
-@c node Info for Sys Admins
-@c chapter Info for System Administrators
-
-This text describes some common ways of setting up an Info hierarchy
-from scratch, and details the various options that are available when
-installing Info. This text is designed for the person who is installing
-GNU Info on the system; although users may find the information present
-in this section interesting, none of it is vital to understanding how to
-use GNU Info.
-
-@menu
-* Setting the INFOPATH:: Where are my Info files kept?
-* Editing the DIR node:: What goes in `DIR', and why?
-* Storing Info files:: Alternate formats allow flexibility in setups.
-* Using `localdir':: Building DIR on the fly.
-* Example setups:: Some common ways to organize Info files.
-@end menu
-
-@c node Setting the INFOPATH
-@c section Setting the INFOPATH
-
-Where are my Info files kept?
-
-@c node Editing the DIR node
-@c section Editing the DIR node
-
-What goes in `DIR', and why?
-
-@c node Storing Info files
-@c section Storing Info files
-
-Alternate formats allow flexibility in setups.
-
-@c node Using `localdir'
-@c section Using `localdir'
-
-Building DIR on the fly.
-
-@c node Example setups
-@c section Example setups
-
-Some common ways to organize Info files.
-@end ignore
-
-@node GNU Info Global Index, , Variables, Top
-@appendix Global Index
-
-@printindex cp
-
-@contents
-@bye
diff --git a/contrib/texinfo/doc/info.texi b/contrib/texinfo/doc/info.texi
deleted file mode 100644
index f7cb1cd71882..000000000000
--- a/contrib/texinfo/doc/info.texi
+++ /dev/null
@@ -1,911 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@comment %**start of header
-@setfilename info.info
-@settitle Info 1.0
-@comment %**end of header
-@comment $Id: info.texi,v 1.4 1997/07/10 21:58:11 karl Exp $
-
-@dircategory Texinfo documentation system
-@direntry
-* Info: (info). Documentation browsing system.
-@end direntry
-
-@ifinfo
-This file describes how to use Info,
-the on-line, menu-driven GNU documentation system.
-
-Copyright (C) 1989, 92, 96, 97 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end ifinfo
-
-@titlepage
-@title Info
-@subtitle The online, menu-driven GNU documentation system
-@author Brian Fox
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1992, 1993, 1996, 1997 Free Software
-Foundation, Inc.
-@sp 2
-
-Published by the Free Software Foundation @*
-59 Temple Place - Suite 330 @*
-Boston, MA 02111-1307, USA.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end titlepage
-
-@ifinfo
-@node Top, Getting Started, , (dir)
-@top Info: An Introduction
-
-Info is a program for reading documentation, which you are using now.
-
-To learn how to use Info, type the command @kbd{h}. It brings you
-to a programmed instruction sequence.
-
-@c Need to make sure that `Info-help' goes to the right node,
-@c which is the first node of the first chapter. (It should.)
-@c (Info-find-node "info"
-@c (if (< (window-height) 23)
-@c "Help-Small-Screen"
-@c "Help")))
-
-To learn advanced Info commands, type @kbd{n} twice. This brings you to
-@cite{Info for Experts}, skipping over the `Getting Started' chapter.
-@end ifinfo
-
-@menu
-* Getting Started:: Getting started using an Info reader.
-* Advanced Info:: Advanced commands within Info.
-* Create an Info File:: How to make your own Info file.
-* The Standalone Info Program: (info-stnd.info).
-@end menu
-
-@node Getting Started, Advanced Info, Top, Top
-@comment node-name, next, previous, up
-@chapter Getting Started
-
-This first part of the Info manual describes how to get around inside
-of Info. The second part of the manual describes various advanced
-Info commands, and how to write an Info as distinct from a Texinfo
-file. The third part is about how to generate Info files from
-Texinfo files.
-
-@iftex
-This manual is primarily designed for use on a computer, so that you can
-try Info commands while reading about them. Reading it on paper is less
-effective, since you must take it on faith that the commands described
-really do what the manual says. By all means go through this manual now
-that you have it; but please try going through the on-line version as
-well.
-
-There are two ways of looking at the online version of this manual:
-
-@enumerate
-@item
-Type @code{info} at your shell's command line. This approach uses a
-small stand-alone program designed just to read Info files.
-
-@item
-Type @code{emacs} at the command line; then type @kbd{C-h i} (Control
-@kbd{h}, followed by @kbd{i}). This approach uses the Info mode of the
-Emacs program, an editor with many other capabilities.
-@end enumerate
-
-In either case, then type @kbd{mInfo} (just the letters), followed by
-@key{RET}---the ``Return'' or ``Enter'' key. At this point, you should
-be ready to follow the instructions in this manual as you read them on
-the screen.
-@c FIXME! (pesch@cygnus.com, 14 dec 1992)
-@c Is it worth worrying about what-if the beginner goes to somebody
-@c else's Emacs session, which already has an Info running in the middle
-@c of something---in which case these simple instructions won't work?
-@end iftex
-
-@menu
-* Help-Small-Screen:: Starting Info on a Small Screen
-* Help:: How to use Info
-* Help-P:: Returning to the Previous node
-* Help-^L:: The Space, Rubout, B and ^L commands.
-* Help-M:: Menus
-* Help-Adv:: Some advanced Info commands
-* Help-Q:: Quitting Info
-@end menu
-
-@node Help-Small-Screen, Help, , Getting Started
-@comment node-name, next, previous, up
-@section Starting Info on a Small Screen
-
-@iftex
-(In Info, you only see this section if your terminal has a small
-number of lines; most readers pass by it without seeing it.)
-@end iftex
-
-Since your terminal has an unusually small number of lines on its
-screen, it is necessary to give you special advice at the beginning.
-
-If you see the text @samp{--All----} at near the bottom right corner
-of the screen, it means the entire text you are looking at fits on the
-screen. If you see @samp{--Top----} instead, it means that there is
-more text below that does not fit. To move forward through the text
-and see another screen full, press the Space bar, @key{SPC}. To move
-back up, press the key labeled @samp{Backspace} or @key{Delete}.
-
-@ifinfo
-Here are 40 lines of junk, so you can try Spaces and Deletes and
-see what they do. At the end are instructions of what you should do
-next.
-
-This is line 17 @*
-This is line 18 @*
-This is line 19 @*
-This is line 20 @*
-This is line 21 @*
-This is line 22 @*
-This is line 23 @*
-This is line 24 @*
-This is line 25 @*
-This is line 26 @*
-This is line 27 @*
-This is line 28 @*
-This is line 29 @*
-This is line 30 @*
-This is line 31 @*
-This is line 32 @*
-This is line 33 @*
-This is line 34 @*
-This is line 35 @*
-This is line 36 @*
-This is line 37 @*
-This is line 38 @*
-This is line 39 @*
-This is line 40 @*
-This is line 41 @*
-This is line 42 @*
-This is line 43 @*
-This is line 44 @*
-This is line 45 @*
-This is line 46 @*
-This is line 47 @*
-This is line 48 @*
-This is line 49 @*
-This is line 50 @*
-This is line 51 @*
-This is line 52 @*
-This is line 53 @*
-This is line 54 @*
-This is line 55 @*
-This is line 56 @*
-
-If you have managed to get here, go back to the beginning with
-Delete, and come back here again, then you understand Space and
-Delete. So now type an @kbd{n} ---just one character; don't type
-the quotes and don't type the Return key afterward--- to
-get to the normal start of the course.
-@end ifinfo
-
-@node Help, Help-P, Help-Small-Screen, Getting Started
-@comment node-name, next, previous, up
-@section How to use Info
-
-You are talking to the program Info, for reading documentation.
-
- Right now you are looking at one @dfn{Node} of Information.
-A node contains text describing a specific topic at a specific
-level of detail. This node's topic is ``how to use Info''.
-
- The top line of a node is its @dfn{header}. This node's header (look at
-it now) says that it is the node named @samp{Help} in the file
-@file{info}. It says that the @samp{Next} node after this one is the node
-called @samp{Help-P}. An advanced Info command lets you go to any node
-whose name you know.
-
- Besides a @samp{Next}, a node can have a @samp{Previous} or an @samp{Up}.
-This node has a @samp{Previous} but no @samp{Up}, as you can see.
-
- Now it is time to move on to the @samp{Next} node, named @samp{Help-P}.
-
->> Type @samp{n} to move there. Type just one character;
- do not type the quotes and do not type a @key{RET} afterward.
-
-@samp{>>} in the margin means it is really time to try a command.
-
-@node Help-P, Help-^L, Help, Getting Started
-@comment node-name, next, previous, up
-@section Returning to the Previous node
-
-This node is called @samp{Help-P}. The @samp{Previous} node, as you see,
-is @samp{Help}, which is the one you just came from using the @kbd{n}
-command. Another @kbd{n} command now would take you to the next
-node, @samp{Help-^L}.
-
->> But do not do that yet. First, try the @kbd{p} command, which takes
- you to the @samp{Previous} node. When you get there, you can do an
- @kbd{n} again to return here.
-
- This all probably seems insultingly simple so far, but @emph{do not} be
-led into skimming. Things will get more complicated soon. Also,
-do not try a new command until you are told it is time to. Otherwise,
-you may make Info skip past an important warning that was coming up.
-
->> Now do an @kbd{n} to get to the node @samp{Help-^L} and learn more.
-
-@node Help-^L, Help-M, Help-P, Getting Started
-@comment node-name, next, previous, up
-@section The Space, Delete, B and ^L commands.
-
- This node's header tells you that you are now at node @samp{Help-^L}, and
-that @kbd{p} would get you back to @samp{Help-P}. The node's title is
-underlined; it says what the node is about (most nodes have titles).
-
- This is a big node and it does not all fit on your display screen.
-You can tell that there is more that is not visible because you
-can see the string @samp{--Top-----} rather than @samp{--All----} near
-the bottom right corner of the screen.
-
- The Space, Delete and @kbd{B} commands exist to allow you to ``move
-around'' in a node that does not all fit on the screen at once.
-Space moves forward, to show what was below the bottom of the screen.
-Delete moves backward, to show what was above the top of the screen
-(there is not anything above the top until you have typed some spaces).
-
->> Now try typing a Space (afterward, type a Delete to return here).
-
- When you type the space, the two lines that were at the bottom of
-the screen appear at the top, followed by more lines. Delete takes
-the two lines from the top and moves them to the bottom,
-@emph{usually}, but if there are not a full screen's worth of lines
-above them they may not make it all the way to the bottom.
-
- If you type Space when there is no more to see, it rings the
-bell and otherwise does nothing. The same goes for Delete when
-the header of the node is visible.
-
- If your screen is ever garbaged, you can tell Info to print it out
-again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down ``Control'' and
-type an @key{L} or @kbd{l}).
-
->> Type @kbd{C-l} now.
-
- To move back to the beginning of the node you are on, you can type
-a lot of Deletes. You can also type simply @kbd{b} for beginning.
->> Try that now. (We have put in enough verbiage to push this past
-the first screenful, but screens are so big nowadays that perhaps it
-isn't enough. You may need to shrink your Emacs or Info window.)
-Then come back, with Spaces.
-
- If your screen is very tall, all of this node might fit at once.
-In that case, "b" won't do anything. Sorry; what can we do?
-
- You have just learned a considerable number of commands. If you
-want to use one but have trouble remembering which, you should type
-a @key{?} which prints out a brief list of commands. When you are
-finished looking at the list, make it go away by pressing @key{SPC}
-repeatedly.
-
->> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of
->> the list until finished.
-
- From now on, you will encounter large nodes without warning, and
-will be expected to know how to use Space and Delete to move
-around in them without being told. Since not all terminals have
-the same size screen, it would be impossible to warn you anyway.
-
->> Now type @kbd{n} to see the description of the @kbd{m} command.
-
-@node Help-M, Help-Adv, Help-^L, Getting Started
-@comment node-name, next, previous, up
-@section Menus
-
-Menus and the @kbd{m} command
-
- With only the @kbd{n} and @kbd{p} commands for moving between nodes, nodes
-are restricted to a linear sequence. Menus allow a branching
-structure. A menu is a list of other nodes you can move to. It is
-actually just part of the text of the node formatted specially so that
-Info can interpret it. The beginning of a menu is always identified
-by a line which starts with @samp{* Menu:}. A node contains a menu if and
-only if it has a line in it which starts that way. The only menu you
-can use at any moment is the one in the node you are in. To use a
-menu in any other node, you must move to that node first.
-
- After the start of the menu, each line that starts with a @samp{*}
-identifies one subtopic. The line usually contains a brief name
-for the subtopic (followed by a @samp{:}), the name of the node that talks
-about that subtopic, and optionally some further description of the
-subtopic. Lines in the menu that do not start with a @samp{*} have no
-special meaning---they are only for the human reader's benefit and do
-not define additional subtopics. Here is an example:
-
-@example
-* Foo: FOO's Node This tells about FOO
-@end example
-
-The subtopic name is Foo, and the node describing it is @samp{FOO's Node}.
-The rest of the line is just for the reader's Information.
-[[ But this line is not a real menu item, simply because there is
-no line above it which starts with @samp{* Menu:}.]]
-
- When you use a menu to go to another node (in a way that will be
-described soon), what you specify is the subtopic name, the first
-thing in the menu line. Info uses it to find the menu line, extracts
-the node name from it, and goes to that node. The reason that there
-is both a subtopic name and a node name is that the node name must be
-meaningful to the computer and may therefore have to be ugly looking.
-The subtopic name can be chosen just to be convenient for the user to
-specify. Often the node name is convenient for the user to specify
-and so both it and the subtopic name are the same. There is an
-abbreviation for this:
-
-@example
-* Foo:: This tells about FOO
-@end example
-
-@noindent
-This means that the subtopic name and node name are the same; they are
-both @samp{Foo}.
-
->> Now use Spaces to find the menu in this node, then come back to
- the front with a @kbd{b} and some Spaces. As you see, a menu is
- actually visible in its node. If you cannot find a menu in a node
- by looking at it, then the node does not have a menu and the
- @kbd{m} command is not available.
-
- The command to go to one of the subnodes is @kbd{m}---but @emph{do
-not do it yet!} Before you use @kbd{m}, you must understand the
-difference between commands and arguments. So far, you have learned
-several commands that do not need arguments. When you type one, Info
-processes it and is instantly ready for another command. The @kbd{m}
-command is different: it is incomplete without the @dfn{name of the
-subtopic}. Once you have typed @kbd{m}, Info tries to read the
-subtopic name.
-
- Now look for the line containing many dashes near the bottom of the
-screen. There is one more line beneath that one, but usually it is
-blank. If it is empty, Info is ready for a command, such as @kbd{n}
-or @kbd{b} or Space or @kbd{m}. If that line contains text ending
-in a colon, it mean Info is trying to read the @dfn{argument} to a
-command. At such times, commands do not work, because Info tries to
-use them as the argument. You must either type the argument and
-finish the command you started, or type @kbd{Control-g} to cancel the
-command. When you have done one of those things, the line becomes
-blank again.
-
- The command to go to a subnode via a menu is @kbd{m}. After you type
-the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }.
-You must then type the name of the subtopic you want, and end it with
-a @key{RET}.
-
- You can abbreviate the subtopic name. If the abbreviation is not
-unique, the first matching subtopic is chosen. Some menus put
-the shortest possible abbreviation for each subtopic name in capital
-letters, so you can see how much you need to type. It does not
-matter whether you use upper case or lower case when you type the
-subtopic. You should not put any spaces at the end, or inside of the
-item name, except for one space where a space appears in the item in
-the menu.
-
- You can also use the @dfn{completion} feature to help enter the subtopic
-name. If you type the Tab key after entering part of a name, it will
-magically fill in more of the name---as much as follows uniquely from
-what you have entered.
-
- If you move the cursor to one of the menu subtopic lines, then you do
-not need to type the argument: you just type a Return, and it stands for
-the subtopic of the line you are on.
-
-Here is a menu to give you a chance to practice.
-
-* Menu: The menu starts here.
-
-This menu gives you three ways of going to one place, Help-FOO.
-
-* Foo: Help-FOO. A node you can visit for fun.@*
-* Bar: Help-FOO. Strange! two ways to get to the same place.@*
-* Help-FOO:: And yet another!@*
-
-
->> Now type just an @kbd{m} and see what happens:
-
- Now you are ``inside'' an @kbd{m} command. Commands cannot be used
-now; the next thing you will type must be the name of a subtopic.
-
- You can change your mind about doing the @kbd{m} by typing Control-g.
-
->> Try that now; notice the bottom line clear.
-
->> Then type another @kbd{m}.
-
->> Now type @samp{BAR} item name. Do not type Return yet.
-
- While you are typing the item name, you can use the Delete key to
-cancel one character at a time if you make a mistake.
-
->> Type one to cancel the @samp{R}. You could type another @samp{R} to
- replace it. You do not have to, since @samp{BA} is a valid abbreviation.
-
->> Now you are ready to go. Type a @key{RET}.
-
- After visiting Help-FOO, you should return here.
-
->> Type @kbd{n} to see more commands.
-
-@c If a menu appears at the end of this node, remove it.
-@c It is an accident of the menu updating command.
-
-Here is another way to get to Help-FOO, a menu. You can ignore this
-if you want, or else try it (but then please come back to here).
-
-@menu
-* Help-FOO::
-@end menu
-
-@node Help-FOO, , , Help-M
-@comment node-name, next, previous, up
-@subsection The @kbd{u} command
-
- Congratulations! This is the node @samp{Help-FOO}. Unlike the other
-nodes you have seen, this one has an @samp{Up}: @samp{Help-M}, the node you
-just came from via the @kbd{m} command. This is the usual
-convention---the nodes you reach from a menu have @samp{Up} nodes that lead
-back to the menu. Menus move Down in the tree, and @samp{Up} moves Up.
-@samp{Previous}, on the other hand, is usually used to ``stay on the same
-level but go backwards''
-
- You can go back to the node @samp{Help-M} by typing the command
-@kbd{u} for ``Up''. That puts you at the @emph{front} of the
-node---to get back to where you were reading you have to type
-some @key{SPC}s.
-
->> Now type @kbd{u} to move back up to @samp{Help-M}.
-
-@node Help-Adv, Help-Q, Help-M, Getting Started
-@comment node-name, next, previous, up
-@section Some advanced Info commands
-
- The course is almost over, so please stick with it to the end.
-
- If you have been moving around to different nodes and wish to
-retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will
-do that, one node-step at a time. As you move from node to node, Info
-records the nodes where you have been in a special history list. The
-@kbd{l} command revisits nodes in the history list; each successive
-@kbd{l} command moves one step back through the history.
-
- If you have been following directions, ad @kbd{l} command now will get
-you back to @samp{Help-M}. Another @kbd{l} command would undo the
-@kbd{u} and get you back to @samp{Help-FOO}. Another @kbd{l} would undo
-the @kbd{m} and get you back to @samp{Help-M}.
-
->> Try typing three @kbd{l}'s, pausing in between to see what each
- @kbd{l} does.
-
-Then follow directions again and you will end up back here.
-
- Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to
-where @emph{you} last were, whereas @kbd{p} always moves to the node
-which the header says is the @samp{Previous} node (from this node, to
-@samp{Help-M}).
-
- The @samp{d} command gets you instantly to the Directory node.
-This node, which is the first one you saw when you entered Info,
-has a menu which leads (directly, or indirectly through other menus),
-to all the nodes that exist.
-
->> Try doing a @samp{d}, then do an @kbd{l} to return here (yes,
- @emph{do} return).
-
- Sometimes, in Info documentation, you will see a cross reference.
-Cross references look like this: @xref{Help-Cross, Cross}. That is a
-real, live cross reference which is named @samp{Cross} and points at
-the node named @samp{Help-Cross}.
-
- If you wish to follow a cross reference, you must use the @samp{f}
-command. The @samp{f} must be followed by the cross reference name
-(in this case, @samp{Cross}). While you enter the name, you can use the
-Delete key to edit your input. If you change your mind about following
-any reference, you can use @kbd{Control-g} to cancel the command.
-
- Completion is available in the @samp{f} command; you can complete among
-all the cross reference names in the current node by typing a Tab.
-
->> Type @samp{f}, followed by @samp{Cross}, and a @key{RET}.
-
- To get a list of all the cross references in the current node, you can
-type @kbd{?} after an @samp{f}. The @samp{f} continues to await a
-cross reference name even after printing the list, so if you don't
-actually want to follow a reference, you should type a @kbd{Control-g}
-to cancel the @samp{f}.
-
->> Type "f?" to get a list of the cross references in this node. Then
- type a @kbd{Control-g} and see how the @samp{f} gives up.
-
->> Now type @kbd{n} to see the last node of the course.
-
-@c If a menu appears at the end of this node, remove it.
-@c It is an accident of the menu updating command.
-
-@node Help-Cross, , , Help-Adv
-@comment node-name, next, previous, up
-@unnumberedsubsec The node reached by the cross reference in Info
-
- This is the node reached by the cross reference named @samp{Cross}.
-
- While this node is specifically intended to be reached by a cross
-reference, most cross references lead to nodes that ``belong''
-someplace else far away in the structure of Info. So you cannot expect
-the footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing back to
-where you came from. In general, the @kbd{l} (el) command is the only
-way to get back there.
-
->> Type @kbd{l} to return to the node where the cross reference was.
-
-@node Help-Q, , Help-Adv, Getting Started
-@comment node-name, next, previous, up
-@section Quitting Info
-
- To get out of Info, back to what you were doing before, type @kbd{q}
-for @dfn{Quit}.
-
- This is the end of the course on using Info. There are some other
-commands that are meant for experienced users; they are useful, and you
-can find them by looking in the directory node for documentation on
-Info. Finding them will be a good exercise in using Info in the usual
-manner.
-
->> Type @samp{d} to go to the Info directory node; then type
- @samp{mInfo} and Return, to get to the node about Info and
- see what other help is available.
-
-@node Advanced Info, Create an Info File, Getting Started, Top
-@comment node-name, next, previous, up
-@chapter Info for Experts
-
-This chapter describes various advanced Info commands, and how to write
-an Info as distinct from a Texinfo file. (However, in most cases, writing a
-Texinfo file is better, since you can use it @emph{both} to generate an
-Info file and to make a printed manual. @xref{Top,, Overview of
-Texinfo, texinfo, Texinfo: The GNU Documentation Format}.)
-
-@menu
-* Expert:: Advanced Info commands: g, s, e, and 1 - 5.
-* Add:: Describes how to add new nodes to the hierarchy.
- Also tells what nodes look like.
-* Menus:: How to add to or create menus in Info nodes.
-* Cross-refs:: How to add cross-references to Info nodes.
-* Tags:: How to make tag tables for Info files.
-* Checking:: Checking an Info File
-* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
-@end menu
-
-@node Expert, Add, , Advanced Info
-@comment node-name, next, previous, up
-@section Advanced Info Commands
-
-@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}
-
-If you know a node's name, you can go there by typing @kbd{g}, the
-name, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the node
-called @samp{Top} in this file (its directory node).
-@kbd{gExpert@key{RET}} would come back here.
-
-Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
-
-To go to a node in another file, you can include the filename in the
-node name by putting it at the front, in parentheses. Thus,
-@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
-node @samp{Top} in the file @file{dir}.
-
-The node name @samp{*} specifies the whole file. So you can look at
-all of the current file by typing @kbd{g*@key{RET}} or all of any
-other file with @kbd{g(FILENAME)@key{RET}}.
-
-The @kbd{s} command allows you to search a whole file for a string.
-It switches to the next node if and when that is necessary. You
-type @kbd{s} followed by the string to search for, terminated by
-@key{RET}. To search for the same string again, just @kbd{s} followed
-by @key{RET} will do. The file's nodes are scanned in the order
-they are in in the file, which has no necessary relationship to the
-order that they may be in in the tree structure of menus and @samp{next} pointers.
-But normally the two orders are not very different. In any case,
-you can always do a @kbd{b} to find out what node you have reached, if
-the header is not visible (this can happen, because @kbd{s} puts your
-cursor at the occurrence of the string, not at the beginning of the
-node).
-
-If you grudge the system each character of type-in it requires, you
-might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...
-@kbd{9}. They are short for the @kbd{m} command together with an
-argument. @kbd{1} goes through the first item in the current node's
-menu; @kbd{2} goes through the second item, etc.
-
-If you display supports multiple fonts, and you are using Emacs' Info
-mode to read Info files, the @samp{*} for the fifth menu item is
-underlines, and so is the @samp{*} for the ninth item; these underlines
-make it easy to see at a glance which number to use for an item.
-
-On ordinary terminals, you won't have underlining. If you need to
-actually count items, it is better to use @kbd{m} instead, and specify
-the name.
-
-The Info command @kbd{e} changes from Info mode to an ordinary
-Emacs editing mode, so that you can edit the text of the current node.
-Type @kbd{C-c C-c} to switch back to Info. The @kbd{e} command is allowed
-only if the variable @code{Info-enable-edit} is non-@code{nil}.
-
-@node Add, Menus, Expert, Advanced Info
-@comment node-name, next, previous, up
-@section Adding a new node to Info
-
-To add a new topic to the list in the Info directory, you must:
-@enumerate
-@item
-Create some nodes, in some file, to document that topic.
-@item
-Put that topic in the menu in the directory. @xref{Menus, Menu}.
-@end enumerate
-
-Usually, the way to create the nodes is with Texinfo @pxref{Top,, Overview of
-Texinfo, texinfo, Texinfo: The GNU Documentation Format}); this has the
-advantage that you can also make a printed manual from them. However,
-if hyou want to edit an Info file, here is how.
-
- The new node can live in an existing documentation file, or in a new
-one. It must have a @key{^_} character before it (invisible to the
-user; this node has one but you cannot see it), and it ends with either
-a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a
-@key{^L} to end a new node, be sure that there is a @key{^_} after it
-to start the next one, since @key{^L} cannot @emph{start} a node.
-Also, a nicer way to make a node boundary be a page boundary as well
-is to put a @key{^L} @emph{right after} the @key{^_}.
-
- The @key{^_} starting a node must be followed by a newline or a
-@key{^L} newline, after which comes the node's header line. The
-header line must give the node's name (by which Info finds it),
-and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if
-there are any). As you can see, this node's @samp{Up} node is the node
-@samp{Top}, which points at all the documentation for Info. The @samp{Next}
-node is @samp{Menus}.
-
- The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
-may appear in any order, anywhere in the header line, but the
-recommended order is the one in this sentence. Each keyword must be
-followed by a colon, spaces and tabs, and then the appropriate name.
-The name may be terminated with a tab, a comma, or a newline. A space
-does not end it; node names may contain spaces. The case of letters
-in the names is insignificant.
-
- A node name has two forms. A node in the current file is named by
-what appears after the @samp{Node: } in that node's first line. For
-example, this node's name is @samp{Add}. A node in another file is
-named by @samp{(@var{filename})@var{node-within-file}}, as in
-@samp{(info)Add} for this node. If the file name starts with ``./'',
-then it is relative to the current directory; otherwise, it is relative
-starting from the standard Info file directory of your site.
-The name @samp{(@var{filename})Top} can be abbreviated to just
-@samp{(@var{filename})}. By convention, the name @samp{Top} is used for
-the ``highest'' node in any single file---the node whose @samp{Up} points
-out of the file. The Directory node is @file{(dir)}. The @samp{Top} node
-of a document file listed in the Directory should have an @samp{Up:
-(dir)} in it.
-
- The node name @kbd{*} is special: it refers to the entire file.
-Thus, @kbd{g*} shows you the whole current file. The use of the
-node @kbd{*} is to make it possible to make old-fashioned,
-unstructured files into nodes of the tree.
-
- The @samp{Node:} name, in which a node states its own name, must not
-contain a filename, since Info when searching for a node does not
-expect one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names may
-contain them. In this node, since the @samp{Up} node is in the same file,
-it was not necessary to use one.
-
- Note that the nodes in this file have a file name in the header
-line. The file names are ignored by Info, but they serve as comments
-to help identify the node for the user.
-
-@node Menus, Cross-refs, Add, Advanced Info
-@comment node-name, next, previous, up
-@section How to Create Menus
-
- Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
-The @kbd{m} command searches the current node's menu for the topic which it
-reads from the terminal.
-
- A menu begins with a line starting with @samp{* Menu:}. The rest of the
-line is a comment. After the starting line, every line that begins
-with a @samp{* } lists a single topic. The name of the topic--the
-argument that the user must give to the @kbd{m} command to select this
-topic---comes right after the star and space, and is followed by a
-colon, spaces and tabs, and the name of the node which discusses that
-topic. The node name, like node names following @samp{Next}, @samp{Previous}
-and @samp{Up}, may be terminated with a tab, comma, or newline; it may also
-be terminated with a period.
-
- If the node name and topic name are the same, then rather than
-giving the name twice, the abbreviation @samp{* NAME::} may be used
-(and should be used, whenever possible, as it reduces the visual
-clutter in the menu).
-
- It is considerate to choose the topic names so that they differ
-from each other very near the beginning---this allows the user to type
-short abbreviations. In a long menu, it is a good idea to capitalize
-the beginning of each item name which is the minimum acceptable
-abbreviation for it (a long menu is more than 5 or so entries).
-
- The nodes listed in a node's menu are called its ``subnodes'', and
-it is their ``superior''. They should each have an @samp{Up:} pointing at
-the superior. It is often useful to arrange all or most of the
-subnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone who
-wants to see them all need not keep revisiting the Menu.
-
- The Info Directory is simply the menu of the node @samp{(dir)Top}---that
-is, node @samp{Top} in file @file{.../info/dir}. You can put new entries
-in that menu just like any other menu. The Info Directory is @emph{not} the
-same as the file directory called @file{info}. It happens that many of
-Info's files live on that file directory, but they do not have to; and
-files on that directory are not automatically listed in the Info
-Directory node.
-
- Also, although the Info node graph is claimed to be a ``hierarchy'',
-in fact it can be @emph{any} directed graph. Shared structures and
-pointer cycles are perfectly possible, and can be used if they are
-appropriate to the meaning to be expressed. There is no need for all
-the nodes in a file to form a connected structure. In fact, this file
-has two connected components. You are in one of them, which is under
-the node @samp{Top}; the other contains the node @samp{Help} which the
-@kbd{h} command goes to. In fact, since there is no garbage
-collector, nothing terrible happens if a substructure is not pointed
-to, but such a substructure is rather useless since nobody can
-ever find out that it exists.
-
-@node Cross-refs, Tags, Menus, Advanced Info
-@comment node-name, next, previous, up
-@section Creating Cross References
-
- A cross reference can be placed anywhere in the text, unlike a menu
-item which must go at the front of a line. A cross reference looks
-like a menu item except that it has @samp{*note} instead of @kbd{*}.
-It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are
-so often part of node names. If you wish to enclose a cross reference
-in parentheses, terminate it with a period first. Here are two
-examples of cross references pointers:
-
-@example
-*Note details: commands. (See *note 3: Full Proof.)
-@end example
-
-They are just examples. The places they ``lead to'' do not really exist!
-
-@node Tags, Checking, Cross-refs, Advanced Info
-@comment node-name, next, previous, up
-@section Tag Tables for Info Files
-
- You can speed up the access to nodes of a large Info file by giving
-it a tag table. Unlike the tag table for a program, the tag table for
-an Info file lives inside the file itself and is used
-automatically whenever Info reads in the file.
-
- To make a tag table, go to a node in the file using Emacs Info mode and type
-@kbd{M-x Info-tagify}. Then you must use @kbd{C-x C-s} to save the
-file.
-
- Once the Info file has a tag table, you must make certain it is up
-to date. If, as a result of deletion of text, any node moves back
-more than a thousand characters in the file from the position
-recorded in the tag table, Info will no longer be able to find that
-node. To update the tag table, use the @code{Info-tagify} command again.
-
- An Info file tag table appears at the end of the file and looks like
-this:
-
-@example
-^_
-Tag Table:
-File: info, Node: Cross-refs^?21419
-File: info, Node: Tags^?22145
-^_
-End Tag Table
-@end example
-
-@noindent
-Note that it contains one line per node, and this line contains
-the beginning of the node's header (ending just after the node name),
-a Delete character, and the character position in the file of the
-beginning of the node.
-
-@node Checking, Emacs Info Variables, Tags, Advanced Info
-@comment node-name, next, previous, up
-@section Checking an Info File
-
- When creating an Info file, it is easy to forget the name of a node
-when you are making a pointer to it from another node. If you put in
-the wrong name for a node, this is not detected until someone
-tries to go through the pointer using Info. Verification of the Info
-file is an automatic process which checks all pointers to nodes and
-reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
-@samp{Up} is checked, as is every menu item and every cross reference. In
-addition, any @samp{Next} which does not have a @samp{Previous} pointing back is
-reported. Only pointers within the file are checked, because checking
-pointers to other files would be terribly slow. But those are usually
-few.
-
- To check an Info file, do @kbd{M-x Info-validate} while looking at
-any node of the file with Emacs Info mode.
-
-@node Emacs Info Variables, , Checking, Advanced Info
-@section Emacs Info-mode Variables
-
-The following variables may modify the behaviour of Info-mode in Emacs;
-you may wish to set one or several of these variables interactively, or
-in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting
-Variables, Examining and Setting Variables, emacs, The GNU Emacs
-Manual}.
-
-@vtable @code
-@item Info-enable-edit
-Set to @code{nil}, disables the @samp{e} (@code{Info-edit}) command. A
-non-@code{nil} value enables it. @xref{Add, Edit}.
-
-@item Info-enable-active-nodes
-When set to a non-@code{nil} value, allows Info to execute Lisp code
-associated with nodes. The Lisp code is executed when the node is
-selected.
-
-@item Info-directory-list
-The list of directories to search for Info files. Each element is a
-string (directory name) or @code{nil} (try default directory).
-
-@item Info-directory
-The standard directory for Info documentation files. Only used when the
-function @code{Info-directory} is called.
-@end vtable
-
-@node Create an Info File, , Advanced Info, Top
-@comment node-name, next, previous, up
-@chapter Creating an Info File from a Makeinfo file
-
-@code{makeinfo} is a utility that converts a Texinfo file into an Info
-file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
-GNU Emacs functions that do the same.
-
-@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo
-Manual}, to learn how to create an Info file from a Texinfo file.
-
-@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation
-Format}, to learn how to write a Texinfo file.
-
-@bye
diff --git a/contrib/texinfo/doc/texinfo.tex b/contrib/texinfo/doc/texinfo.tex
deleted file mode 100644
index b449f778bbbb..000000000000
--- a/contrib/texinfo/doc/texinfo.tex
+++ /dev/null
@@ -1,4977 +0,0 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-% $Id$
-%
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
-% Free Software Foundation, Inc.
-%
-% This texinfo.tex file is free software; you can redistribute it and/or
-% modify it under the terms of the GNU General Public License as
-% published by the Free Software Foundation; either version 2, or (at
-% your option) any later version.
-%
-% This texinfo.tex file is distributed in the hope that it will be
-% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-% General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with this texinfo.tex file; see the file COPYING. If not, write
-% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-% Boston, MA 02111-1307, USA.
-%
-% In other words, you are welcome to use, share and improve this program.
-% You are forbidden to forbid anyone else to use, share and improve
-% what you give them. Help stamp out software-hoarding!
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-% ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
-% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
-% Send bug reports to bug-texinfo@gnu.org.
-% Please include a precise test case in each bug report,
-% including a complete document with which we can reproduce the problem.
-%
-% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
-% have to run makeinfo -E to expand macros first; the texi2dvi script
-% does this.
-
-
-% Make it possible to create a .fmt file just by loading this file:
-% if the underlying format is not loaded, start by loading it now.
-% Added by gildea November 1993.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 2.227 $
-\message{Loading texinfo package [Version \texinfoversion]:}
-
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
- \catcode`+=\active \catcode`\_=\active}
-
-% Save some parts of plain tex whose names we will redefine.
-
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
-\let\ptexi=\i
-\let\ptexlbrace=\{
-\let\ptexrbrace=\}
-\let\ptexstar=\*
-\let\ptext=\t
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-
-\message{Basics,}
-\chardef\other=12
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{eshell}
-\hyphenation{white-space}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset
-\newdimen \normaloffset
-\newdimen\pagewidth \newdimen\pageheight
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{\tracingcommands2 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
-}%
-
-% For @cropmarks command.
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen\topandbottommargin
-\newdimen\outerhsize \newdimen\outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
-
-% Main output routine.
-\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions, but you have to call it yourself.
-\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
- \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
- %
- {%
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \escapechar = `\\ % use backslash in output files.
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- \shipout\vbox{%
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \ifdim\ht\footlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingxxx.)
- % The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 2\baselineskip
- \unvbox\footlinebox
- \fi
- %
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \turnoffactive
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1 \unvbox#1
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg#1{%
- \let\next = #1%
- \begingroup
- \obeylines
- \futurelet\temp\parseargx
-}
-
-% If the next token is an obeyed space (from an @example environment or
-% the like), remove it and recurse. Otherwise, we're done.
-\def\parseargx{%
- % \obeyedspace is defined far below, after the definition of \sepspaces.
- \ifx\obeyedspace\temp
- \expandafter\parseargdiscardspace
- \else
- \expandafter\parseargline
- \fi
-}
-
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- %
- % First remove any @c comment, then any @comment.
- % Result of each macro is put in \toks0.
- \argremovec #1\c\relax %
- \expandafter\argremovecomment \the\toks0 \comment\relax %
- %
- % Call the caller's macro, saved as \next in \parsearg.
- \expandafter\next\expandafter{\the\toks0}%
- }%
-}
-
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us. The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
-
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
-% @end itemize @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'. Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands. (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.) But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
- \begingroup
- \ignoreactivespaces
- \edef\temp{#1}%
- \global\toks0 = \expandafter{\temp}%
- \endgroup
-}
-
-% Change the active space to expand to nothing.
-%
-\begingroup
- \obeyspaces
- \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
-
-% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
-
-\outer\def\begin{\parsearg\beginxxx}
-
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
-
-% @end foo executes the definition of \Efoo.
-%
-\def\end{\parsearg\endxxx}
-\def\endxxx #1{%
- \removeactivespaces{#1}%
- \edef\endthing{\the\toks0}%
- %
- \expandafter\ifx\csname E\endthing\endcsname\relax
- \expandafter\ifx\csname \endthing\endcsname\relax
- % There's no \foo, i.e., no ``environment'' foo.
- \errhelp = \EMsimple
- \errmessage{Undefined command `@end \endthing'}%
- \else
- \unmatchedenderror\endthing
- \fi
- \else
- % Everything's ok; the right environment has been started.
- \csname E\endthing\endcsname
- \fi
-}
-
-% There is an environment #1, but it hasn't been started. Give an error.
-%
-\def\unmatchedenderror#1{%
- \errhelp = \EMsimple
- \errmessage{This `@end #1' doesn't have a matching `@#1'}%
-}
-
-% Define the control sequence \E#1 to give an unmatched @end error.
-%
-\def\defineunmatchedend#1{%
- \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
-}
-
-
-% Single-spacing is done by various environments (specifically, in
-% \nonfillstart and \quotations).
-\newskip\singlespaceskip \singlespaceskip = 12.5pt
-\def\singlespace{%
- % Why was this kern here? It messes up equalizing space above and below
- % environments. --karl, 6may93
- %{\advance \baselineskip by -\singlespaceskip
- %\kern \baselineskip}%
- \setleading \singlespaceskip
-}
-
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
- % Definitions to produce actual \{ & \} command in an index.
- \catcode`\{ = 12 \catcode`\} = 12
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\@ = 0 \catcode`\\ = 12
- @gdef@lbracecmd[\{]%
- @gdef@rbracecmd[\}]%
-@endgroup
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown
-% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ptexi
- \else\ifx\temp\jmacro \j
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=3000 }
-
-% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=3000 }
-
-% @? is an end-of-sentence query.
-\def\?{?\spacefactor=3000 }
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-\def\group{\begingroup
- \ifnum\catcode13=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- %
- % The \vtop we start below produces a box with normal height and large
- % depth; thus, TeX puts \baselineskip glue before it, and (when the
- % next line of text is done) \lineskip glue after it. (See p.82 of
- % the TeXbook.) Thus, space below is not quite equal to space
- % above. But it's pretty close.
- \def\Egroup{%
- \egroup % End the \vtop.
- \endgroup % End the \group.
- }%
- %
- \vtop\bgroup
- % We have to put a strut on the last line in case the @group is in
- % the midst of an example, rather than completely enclosing it.
- % Otherwise, the interline space between the last line of the group
- % and the first line afterwards is too small. But we can't put the
- % strut in \Egroup, since there it would be on a line by itself.
- % Hence this just inserts a strut at the beginning of each line.
- \everypar = {\strut}%
- %
- % Since we have a strut on every line, we don't need any of TeX's
- % normal interline spacing.
- \offinterlineskip
- %
- % OK, but now we have to do something about blank
- % lines in the input in @example-like environments, which normally
- % just turn into \lisppar, which will insert no space now that we've
- % turned off the interline space. Simplest is to make them be an
- % empty paragraph.
- \ifx\par\lisppar
- \edef\par{\leavevmode \par}%
- %
- % Reset ^^M's definition to new definition of \par.
- \obeylines
- \fi
- %
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\def\need{\parsearg\needx}
-
-% Old definition--didn't work.
-%\def\needx #1{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
-%\prevdepth=-1000pt
-%}}
-
-\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
-}
-
-% @br forces paragraph break
-
-\let\br = \par
-
-% @dots{} output an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in a typewriter
-% font as three actual period characters.
-%
-\def\dots{\hbox to 1.5em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
-}}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \hbox to 2em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
- }%
- \spacefactor=3000
-}
-
-
-% @page forces the start of a new page
-
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\def\exdent{\parsearg\exdentyyy}
-\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
-
-% This defn is used inside nofill environments such as @example.
-\def\nofillexdent{\parsearg\nofillexdentyyy}
-\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
-\leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
-
-\def\inmargin#1{%
-\strut\vadjust{\nobreak\kern-\strutdepth
- \vtop to \strutdepth{\baselineskip\strutdepth\vss
- \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-
-%\hbox{{\rm#1}}\hfil\break}}
-
-% @include file insert text of that file as input.
-% Allow normal characters that we make active in the argument (a file name).
-\def\include{\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
- \parsearg\includezzz}
-% Restore active chars for included file.
-\def\includezzz#1{\endgroup\begingroup
- % Read the included file in a group so nested @include's work.
- \def\thisfile{#1}%
- \input\thisfile
-\endgroup}
-
-\def\thisfile{}
-
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
-
-% @sp n outputs n lines of vertical space
-
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
-
-\let\c=\comment
-
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
- \let\evenheading = \relax
- \let\oddheading = \relax
- \let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\let\unmacro = \comment
-
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
-%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % Ignore braces, too, so mismatched braces don't cause trouble.
- \catcode`\{ = 9
- \catcode`\} = 9
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
- \fi
-}
-
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}%
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
- \endgroup
-}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-%
-\def\value{\begingroup
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \valuexxx}
-\def\valuexxx#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}%
- \else
- \csname SET#1\endcsname
- \fi
-\endgroup}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
- \else
- \expandafter\ifsetsucceed
- \fi
-}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
- \else
- \expandafter\ifclearfail
- \fi
-}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
-% following, through the first @end iftex (etc.). Make `@end iftex'
-% (etc.) valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\def\ifnothtml{\conditionalsucceed{ifnothtml}}
-\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
-\defineunmatchedend{iftex}
-\defineunmatchedend{ifnothtml}
-\defineunmatchedend{ifnotinfo}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math means output in math mode.
-% We don't use $'s directly in the definition of \math because control
-% sequences like \math are expanded when the toc file is written. Then,
-% we read the toc file back, the $'s will be normal characters (as they
-% should be, according to the definition of Texinfo). So we must use a
-% control sequence to switch into and out of math mode.
-%
-% This isn't quite enough for @math to work properly in indices, but it
-% seems unlikely it will ever be needed there.
-%
-\let\implicitmath = $
-\def\math#1{\implicitmath #1\implicitmath}
-
-% @bullet and @minus need the same treatment as @math, just above.
-\def\bullet{\implicitmath\ptexbullet\implicitmath}
-\def\minus{\implicitmath-\implicitmath}
-
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
- \readauxfile
- \opencontents
- \openindices
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
- %
- % If texinfo.cnf is present on the system, read it.
- % Useful for site-wide @afourpaper, etc.
- % Just to be on the safe side, close the input stream before the \input.
- \openin 1 texinfo.cnf
- \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
- \closein1
- \temp
- %
- \comment % Ignore the actual filename.
-}
-
-% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-
-%\def\butfirst#1{}
-
-
-\message{fonts,}
-
-% Font-change commands.
-
-% Texinfo supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf analogous to plain's \rm, etc.
-\newfam\sffam
-\def\sf{\fam=\sffam \tensf}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this one.
-\def\ttsl{\tenttsl}
-
-% Use Computer Modern fonts at \magstephalf (11pt).
-\newcount\mainmagstep
-\mainmagstep=\magstephalf
-
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
-% #3 is the font's design size, #4 is a scale factor
-\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\undefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx} %where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-\ifx\bigger\relax
-\let\mainmagstep=\magstep1
-\setfont\textrm\rmshape{12}{1000}
-\setfont\texttt\ttshape{12}{1000}
-\else
-\setfont\textrm\rmshape{10}{\mainmagstep}
-\setfont\texttt\ttshape{10}{\mainmagstep}
-\fi
-% Instead of cmb10, you many want to use cmbx10.
-% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
-\setfont\textbf\bfshape{10}{\mainmagstep}
-\setfont\textit\itshape{10}{\mainmagstep}
-\setfont\textsl\slshape{10}{\mainmagstep}
-\setfont\textsf\sfshape{10}{\mainmagstep}
-\setfont\textsc\scshape{10}{\mainmagstep}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-
-% A few fonts for @defun, etc.
-\setfont\defbf\bxshape{10}{\magstep1} %was 1314
-\setfont\deftt\ttshape{10}{\magstep1}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-
-% Fonts for indices and small examples (9pt).
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\setfont\ninett\ttshape{9}{1000}
-\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\slshape{9}{1000}
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indttsl=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\setfont\indsc\scshape{10}{900}
-\font\indi=cmmi9
-\font\indsy=cmsy9
-
-% Fonts for title page:
-\setfont\titlerm\rmbshape{12}{\magstep3}
-\setfont\titleit\itbshape{10}{\magstep4}
-\setfont\titlesl\slbshape{10}{\magstep4}
-\setfont\titlett\ttbshape{12}{\magstep3}
-\setfont\titlettsl\ttslshape{10}{\magstep4}
-\setfont\titlesf\sfbshape{17}{\magstep1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\authorrm{\secrm}
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\setfont\chaprm\rmbshape{12}{\magstep2}
-\setfont\chapit\itbshape{10}{\magstep3}
-\setfont\chapsl\slbshape{10}{\magstep3}
-\setfont\chaptt\ttbshape{12}{\magstep2}
-\setfont\chapttsl\ttslshape{10}{\magstep3}
-\setfont\chapsf\sfbshape{17}{1000}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-
-% Section fonts (14.4pt).
-\setfont\secrm\rmbshape{12}{\magstep1}
-\setfont\secit\itbshape{10}{\magstep2}
-\setfont\secsl\slbshape{10}{\magstep2}
-\setfont\sectt\ttbshape{12}{\magstep1}
-\setfont\secttsl\ttslshape{10}{\magstep2}
-\setfont\secsf\sfbshape{12}{\magstep1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-
-% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
-% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
-% \setfont\ssecsl\slshape{10}{\magstep1}
-% \setfont\ssectt\ttshape{10}{\magstep1}
-% \setfont\ssecsf\sfshape{10}{\magstep1}
-
-%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
-%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
-%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
-%\setfont\ssectt\ttshape{10}{1315}
-%\setfont\ssecsf\sfshape{10}{1315}
-
-%\let\ssecbf=\ssecrm
-
-% Subsection fonts (13.15pt).
-\setfont\ssecrm\rmbshape{12}{\magstephalf}
-\setfont\ssecit\itbshape{10}{1315}
-\setfont\ssecsl\slbshape{10}{1315}
-\setfont\ssectt\ttbshape{12}{\magstephalf}
-\setfont\ssecttsl\ttslshape{10}{1315}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{\magstep1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled 1315
-% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
-% but that is not a standard magnification.
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. Since
-% texinfo doesn't allow for producing subscripts and superscripts, we
-% don't bother to reset \scriptfont and \scriptscriptfont (which would
-% also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
- \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
- \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
- \textfont\ttfam = \tentt \textfont\sffam = \tensf
-}
-
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this so that font changes will continue to work
-% in math mode, where it is the current \fam that is relevant in most
-% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
-% \tenbf}, for example. By redefining \tenbf, we obviate the need to
-% redefine \bf itself.
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
- \resetmathfonts}
-\def\titlefonts{%
- \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
- \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
- \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
- \let\tenttsl=\titlettsl
- \resetmathfonts \setleading{25pt}}
-\def\titlefont#1{{\titlefonts\rm #1}}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
- \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
- \resetmathfonts \setleading{16pt}}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
- \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
- \resetmathfonts \setleading{12pt}}
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\textfonts
-
-% Define these so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}
-\setfont\shortcontbf\bxshape{12}{1000}
-\setfont\shortcontsl\slshape{12}{1000}
-
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
-
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
-
-\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
-\let\emph=\smartitalic
-\let\cite=\smartitalic
-
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-\def\t#1{%
- {\tt \rawbackslash \frenchspacing #1}%
- \null
-}
-\let\ttfont=\t
-\def\samp#1{`\tclose{#1}'\null}
-\setfont\smallrm\rmshape{8}{1000}
-\font\smallsy=cmsy9
-\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
- \vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
- \kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{\angleright}}}}
-% The old definition, with no lozenge:
-%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-\let\file=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % But `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- \nohyphenation
- %
- \rawbackslash
- \frenchspacing
- #1%
- }%
- \null
-}
-
-% We *must* turn on hyphenation at `-' and `_' in \code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-% -- rms.
-{
-\catcode`\-=\active
-\catcode`\_=\active
-\catcode`\|=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-% _ is always active; and it shouldn't be \let = to an _ that is a
-% subscript character anyway. Then, @cindex @samp{_} (for example)
-% fails. --karl
-\global\def\indexbreaks{%
- \catcode`\-=\active \let-\realdash
-}
-}
-
-\def\realdash{-}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
-\def\codex #1{\tclose{#1}\endgroup}
-
-%\let\exp=\tclose %Was temporary
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-% `example' (@kbd uses ttsl only inside of @example and friends),
-% or `code' (@kbd uses normal tty font always).
-\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
-\def\kbdinputstylexxx#1{%
- \def\arg{#1}%
- \ifx\arg\worddistinct
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
- \else\ifx\arg\wordexample
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
- \else\ifx\arg\wordcode
- \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
- \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
-% the catcodes are wrong for parsearg to work.)
-\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\look}}\fi
-\else{\tclose{\kbdfont\look}}\fi}
-
-% @url. Quotes do not seem necessary, so use \code.
-\let\url=\code
-
-% @uref (abbreviation for `urlref') takes an optional second argument
-% specifying the text to display. First (mandatory) arg is the url.
-% Perhaps eventually put in a hypertex \special here.
-%
-\def\uref#1{\urefxxx #1,,\finish}
-\def\urefxxx#1,#2,#3\finish{%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \unhbox0\ (\code{#1})%
- \else
- \code{#1}%
- \fi
-}
-
-% rms does not like the angle brackets --karl, 17may97.
-% So now @email is just like @uref.
-%\def\email#1{\angleleft{\tt #1}\angleright}
-\let\email=\uref
-
-% Check if we are currently using a typewriter font. Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter.
-%
-\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
-
-% @l was never documented to mean ``switch to the Lisp font'',
-% and it is not used as such in any manual I can find. We need it for
-% Polish suppressed-l. --karl, 22sep96.
-%\def\l#1{{\li #1}\null}
-
-\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-% @pounds{} is a sterling sign.
-\def\pounds{{\it\$}}
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-\def\shorttitlepage{\parsearg\shorttitlepagezzz}
-\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
-
-\def\titlepage{\begingroup \parindent=0pt \textfonts
- \let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
- \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
- %
- \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
- %
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- %
- % Now you can print the title using @title.
- \def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Now you can put text using @subtitle.
- \def\subtitle{\parsearg\subtitlezzz}%
- \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
- %
- % @author should come last, but may come many times.
- \def\author{\parsearg\authorzzz}%
- \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
- {\authorfont \leftline{##1}}}%
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \oldpage
- \let\page = \oldpage
- \hbox{}}%
-% \def\page{\oldpage \hbox{}}
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- \HEADINGSon
-}
-
-\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-%%% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
-
-% Now make Tex use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
- \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
- \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
- %
- % Leave some space for the footline. Hopefully ok to assume
- % @evenfooting will not be used by itself.
- \global\advance\pageheight by -\baselineskip
- \global\advance\vsize by -\baselineskip
-}
-
-\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-%
-}% unbind the catcode of @.
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\HEADINGSoff{
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
-
-
-\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
-% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
- \itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
- \itemzzz {#1}}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemfont{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. Unfortunately
- % we can't prevent a possible page break at the following
- % \baselineskip glue.
- \nobreak
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
- \noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
- \fi
-}
-
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-%% Contains a kludge to get @end[description] to work
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1 \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1 \endtabley
-\def\Eftable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
-{\obeylines\obeyspaces%
-\gdef\vtablex #1^^M{%
-\tabley\vritemindex#1 \endtabley
-\def\Evtable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-\def\vritemindex #1{\doind {vr}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Necessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\exdentamount=\tableindent
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\afterenvbreak\endgroup}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
-}
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\def\itemize{\parsearg\itemizezzz}
-
-\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
- \itemizey {#1}{\Eitemize}
-}
-
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\def\enumerate{\parsearg\enumeratezzz}
-\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- \begingroup % ended by the @end enumerate
- %
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call itemizey, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \itemizey{#1.}\Eenumerate\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{In hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 1200}}%
-\flushcr}
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @columnfractions .25 .3 .45
-% @item ...
-%
-% Numbers following @columnfractions are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-%
-% For those who want to use more than one line's worth of words in
-% the preamble, break the line within one argument and it
-% will parse correctly, i.e.,
-%
-% @multitable {Column 1 template} {Column 2 template} {Column 3
-% template}
-% Not:
-% @multitable {Column 1 template} {Column 2 template}
-% {Column 3 template}
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab, @multitable or @end multitable do not need to be on their
-% own lines, but it will not hurt if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-% to baseline.
-% 0pt means it depends on current normal line spacing.
-%
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
-
-% Macros used to set up halign preamble:
-%
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-% 2/1/96, to allow fractions to be given with more than one digit.
-\def\pickupwholefraction#1 {\global\advance\colcount by1 %
-\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
-\setuptable}
-
-\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
- \else
- \ifsetpercent
- \let\go\pickupwholefraction % In this case arg of setuptable
- % is the decimal point before the
- % number given in percent of hsize.
- % We don't need this so we don't use it.
- \else
- \global\advance\colcount by1
- \setbox0=\hbox{#1 }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi%
- \fi%
-\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
-\fi\go}
-
-% multitable syntax
-\def\tab{&\hskip1sp\relax} % 2/2/96
- % tiny skip here makes sure this column space is
- % maintained, even if it is never used.
-
-% @multitable ... @end multitable definitions:
-
-\def\multitable{\parsearg\dotable}
-\def\dotable#1{\bgroup
- \vskip\parskip
- \let\item\crcr
- \tolerance=9500
- \hbadness=9500
- \setmultitablespacing
- \parskip=\multitableparskip
- \parindent=\multitableparindent
- \overfullrule=0pt
- \global\colcount=0
- \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
- %
- % To parse everything between @multitable and @item:
- \setuptable#1 \endsetuptable
- %
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
- \everycr{\noalign{%
- %
- % \filbreak%% keeps underfull box messages off when table breaks over pages.
- % Maybe so, but it also creates really weird page breaks when the table
- % breaks over pages. Wouldn't \vfil be better? Wait until the problem
- % manifests itself, so it can be fixed for real --karl.
- \global\colcount=0\relax}}%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- \halign\bgroup&\global\advance\colcount by 1\relax
- \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
- \rightskip=0pt
- \ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
- \else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
- \fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
-}
-
-\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
-% If so, do nothing. If not, give it an appropriate dimension based on
-% current baselineskip.
-\ifdim\multitablelinespace=0pt
-%% strut to put in table in case some entry doesn't have descenders,
-%% to keep lines equally spaced
-\let\multistrut = \strut
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
-\else
-\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
-width0pt\relax} \fi
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
-\fi}
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within \newindex.
-{\catcode`\@=11
-\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
-}
-
-% @defindex foo == \newindex{foo}
-
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
-}
-
-\def\defcodeindex{\parsearg\newcodeindex}
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
-}
-
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-\def\indexdummies{%
-% Take care of the plain tex accent commands.
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\def\^{\realbackslash ^}%
-\def\~{\realbackslash ~}%
-\def\={\realbackslash =}%
-\def\b{\realbackslash b}%
-\def\c{\realbackslash c}%
-\def\d{\realbackslash d}%
-\def\u{\realbackslash u}%
-\def\v{\realbackslash v}%
-\def\H{\realbackslash H}%
-% Take care of the plain tex special European modified letters.
-\def\oe{\realbackslash oe}%
-\def\ae{\realbackslash ae}%
-\def\aa{\realbackslash aa}%
-\def\OE{\realbackslash OE}%
-\def\AE{\realbackslash AE}%
-\def\AA{\realbackslash AA}%
-\def\o{\realbackslash o}%
-\def\O{\realbackslash O}%
-\def\l{\realbackslash l}%
-\def\L{\realbackslash L}%
-\def\ss{\realbackslash ss}%
-% Take care of texinfo commands likely to appear in an index entry.
-% (Must be a way to avoid doing expansion at all, and thus not have to
-% laboriously list every single command here.)
-\def\@{@}% will be @@ when we switch to @ as escape char.
-%\let\{ = \lbracecmd
-%\let\} = \rbracecmd
-\def\_{{\realbackslash _}}%
-\def\w{\realbackslash w }%
-\def\bf{\realbackslash bf }%
-%\def\rm{\realbackslash rm }%
-\def\sl{\realbackslash sl }%
-\def\sf{\realbackslash sf}%
-\def\tt{\realbackslash tt}%
-\def\gtr{\realbackslash gtr}%
-\def\less{\realbackslash less}%
-\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
-\def\TeX{\realbackslash TeX}%
-\def\dots{\realbackslash dots }%
-\def\result{\realbackslash result}%
-\def\equiv{\realbackslash equiv}%
-\def\expansion{\realbackslash expansion}%
-\def\print{\realbackslash print}%
-\def\error{\realbackslash error}%
-\def\point{\realbackslash point}%
-\def\copyright{\realbackslash copyright}%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\code##1{\realbackslash code {##1}}%
-\def\dotless##1{\realbackslash dotless {##1}}%
-\def\samp##1{\realbackslash samp {##1}}%
-\def\,##1{\realbackslash ,{##1}}%
-\def\t##1{\realbackslash t {##1}}%
-\def\r##1{\realbackslash r {##1}}%
-\def\i##1{\realbackslash i {##1}}%
-\def\b##1{\realbackslash b {##1}}%
-\def\sc##1{\realbackslash sc {##1}}%
-\def\cite##1{\realbackslash cite {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\emph##1{\realbackslash emph {##1}}%
-\def\value##1{\realbackslash value {##1}}%
-\unsepspaces
-}
-
-% If an index command is used in an @example environment, any spaces
-% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\\leavevmode \penalty \@M \ ).
-{\obeyspaces
- \gdef\unsepspaces{\obeyspaces\let =\space}}
-
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
-\def\indexdummytex{TeX}
-\def\indexdummydots{...}
-
-\def\indexnofonts{%
-% Just ignore accents.
-\let\,=\indexdummyfont
-\let\"=\indexdummyfont
-\let\`=\indexdummyfont
-\let\'=\indexdummyfont
-\let\^=\indexdummyfont
-\let\~=\indexdummyfont
-\let\==\indexdummyfont
-\let\b=\indexdummyfont
-\let\c=\indexdummyfont
-\let\d=\indexdummyfont
-\let\u=\indexdummyfont
-\let\v=\indexdummyfont
-\let\H=\indexdummyfont
-\let\dotless=\indexdummyfont
-% Take care of the plain tex special European modified letters.
-\def\oe{oe}%
-\def\ae{ae}%
-\def\aa{aa}%
-\def\OE{OE}%
-\def\AE{AE}%
-\def\AA{AA}%
-\def\o{o}%
-\def\O{O}%
-\def\l{l}%
-\def\L{L}%
-\def\ss{ss}%
-\let\w=\indexdummyfont
-\let\t=\indexdummyfont
-\let\r=\indexdummyfont
-\let\i=\indexdummyfont
-\let\b=\indexdummyfont
-\let\emph=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\sc=\indexdummyfont
-%Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |...
-%\let\tt=\indexdummyfont
-\let\tclose=\indexdummyfont
-\let\code=\indexdummyfont
-\let\file=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\var=\indexdummyfont
-\let\TeX=\indexdummytex
-\let\dots=\indexdummydots
-\def\@{@}%
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
- \fi
- {%
- \count255=\lastpenalty
- {%
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \escapechar=`\\
- {%
- \let\folio=0% We will expand all macros now EXCEPT \folio.
- \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % First process the index-string with all font commands turned off
- % to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
- %
- % Now produce the complete index entry, with both the sort key and the
- % original text, including any font commands.
- \toks0 = {#2}%
- \edef\temp{%
- \write\csname#1indfile\endcsname{%
- \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
- }%
- \temp
- }%
- }%
- \penalty\count255
- }%
-}
-
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\def\printindex{\parsearg\doprintindex}
-\def\doprintindex#1{\begingroup
- \dobreak \chapheadingskip{10000}%
- %
- \indexfonts \rm
- \tolerance = 9500
- \indexbreaks
- %
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 11
- \openin 1 \jobname.#1s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- (Index is nonexistent)
- \else
- %
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \temp
- \ifeof 1
- (Index is empty)
- \else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\rawbackslashxx}%
- \catcode`\\ = 0
- \escapechar = `\\
- \begindoublecolumns
- \input \jobname.#1s
- \enddoublecolumns
- \fi
- \fi
- \closein 1
-\endgroup}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
-
-% This typesets a paragraph consisting of #1, dot leaders, and then #2
-% flush to the right margin. It is used for index and table of contents
-% entries. The paragraph is indented by \leftskip.
-%
-\def\entry #1#2{\begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent=2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % Start a ``paragraph'' for the index entry so the line breaking
- % parameters we've set above will have an effect.
- \noindent
- %
- % Insert the text of the index entry. TeX will do line-breaking on it.
- #1%
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \def\tempa{{\rm }}%
- \def\tempb{#2}%
- \edef\tempc{\tempa}%
- \edef\tempd{\tempb}%
- \ifx\tempc\tempd\ \else%
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ #2% The page number ends the paragraph.
- \fi%
- \par
-\endgroup}
-
-% Like \dotfill except takes at least 1 em.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
-}}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
- % Grab any single-column material above us.
- \output = {\global\setbox\partialpage = \vbox{%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case, we must prevent the second \partialpage from
- % simply overwriting the first, causing us to lose the page.
- % This will preserve it until a real output routine can ship it
- % out. Generally, \partialpage will be empty when this runs and
- % this will be a no-op.
- \unvbox\partialpage
- %
- % Unvbox the main output page.
- \unvbox255
- \kern-\topskip \kern\baselineskip
- }}%
- \eject
- %
- % Use the double-column output routine for subsequent pages.
- \output = {\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \vsize = 2\vsize
-}
-\def\doublecolumnout{%
- \splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
- % box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
- \onepageout\pagesofar
- \unvbox255
- \penalty\outputpenalty
-}
-\def\pagesofar{%
- % Re-output the contents of the output page -- any previous material,
- % followed by the two boxes we just split.
- \unvbox\partialpage
- \hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
-}
-\def\enddoublecolumns{%
- \output = {\balancecolumns}\eject % split what we have
- \endgroup % started in \begindoublecolumns
- %
- % Back to normal single-column typesetting, but take account of the
- % fact that we just accumulated some stuff on the output page.
- \pagegoal = \vsize
-}
-\def\balancecolumns{%
- % Called at the end of the double column material.
- \setbox0 = \vbox{\unvbox255}%
- \dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2
- \splittopskip = \topskip
- % Loop until we get a decent breakpoint.
- {\vbadness=10000 \loop
- \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt
- \repeat}%
- \setbox0=\vbox to\dimen@{\unvbox1}%
- \setbox2=\vbox to\dimen@{\unvbox3}%
- \pagesofar
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Define chapters, sections, etc.
-
-\newcount\chapno
-\newcount\secno \secno=0
-\newcount\subsecno \subsecno=0
-\newcount\subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite\contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout\contentsfile = \jobname.toc }
-
-% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\ifnum \pageno<0
- \errmessage{@#1 not allowed after generating table of contents}%
-\fi}
-
-\def\chapternofonts{%
- \let\rawbackslash=\relax
- \let\frenchspacing=\relax
- \def\result{\realbackslash result}%
- \def\equiv{\realbackslash equiv}%
- \def\expansion{\realbackslash expansion}%
- \def\print{\realbackslash print}%
- \def\TeX{\realbackslash TeX}%
- \def\dots{\realbackslash dots}%
- \def\result{\realbackslash result}%
- \def\equiv{\realbackslash equiv}%
- \def\expansion{\realbackslash expansion}%
- \def\print{\realbackslash print}%
- \def\error{\realbackslash error}%
- \def\point{\realbackslash point}%
- \def\copyright{\realbackslash copyright}%
- \def\tt{\realbackslash tt}%
- \def\bf{\realbackslash bf}%
- \def\w{\realbackslash w}%
- \def\less{\realbackslash less}%
- \def\gtr{\realbackslash gtr}%
- \def\hat{\realbackslash hat}%
- \def\char{\realbackslash char}%
- \def\tclose##1{\realbackslash tclose{##1}}%
- \def\code##1{\realbackslash code{##1}}%
- \def\samp##1{\realbackslash samp{##1}}%
- \def\r##1{\realbackslash r{##1}}%
- \def\b##1{\realbackslash b{##1}}%
- \def\key##1{\realbackslash key{##1}}%
- \def\file##1{\realbackslash file{##1}}%
- \def\kbd##1{\realbackslash kbd{##1}}%
- % These are redefined because @smartitalic wouldn't work inside xdef.
- \def\i##1{\realbackslash i{##1}}%
- \def\cite##1{\realbackslash cite{##1}}%
- \def\var##1{\realbackslash var{##1}}%
- \def\emph##1{\realbackslash emph{##1}}%
- \def\dfn##1{\realbackslash dfn{##1}}%
-}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raise/lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% Choose a numbered-heading macro
-% #1 is heading level if unmodified by @raisesections or @lowersections
-% #2 is text for heading
-\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \chapterzzz{#2}
-\or
- \seczzz{#2}
-\or
- \numberedsubseczzz{#2}
-\or
- \numberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \chapterzzz{#2}
- \else
- \numberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses appendix heading levels
-\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \appendixzzz{#2}
-\or
- \appendixsectionzzz{#2}
-\or
- \appendixsubseczzz{#2}
-\or
- \appendixsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \appendixzzz{#2}
- \else
- \appendixsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses numberless heading levels
-\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \unnumberedzzz{#2}
-\or
- \unnumberedseczzz{#2}
-\or
- \unnumberedsubseczzz{#2}
-\or
- \unnumberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \unnumberedzzz{#2}
- \else
- \unnumberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-
-\def\thischaptername{No Chapter Title}
-\outer\def\chapter{\parsearg\chapteryyy}
-\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-}}
-
-\outer\def\appendix{\parsearg\appendixyyy}
-\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
-\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}%
- {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
-}}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\def\centerchap{\parsearg\centerchapyyy}
-\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
-
-\outer\def\top{\parsearg\unnumberedyyy}
-\outer\def\unnumbered{\parsearg\unnumberedyyy}
-\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
-\toks0 = {#1}\message{(\the\toks0)}%
-%
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
-}}
-
-\outer\def\numberedsec{\parsearg\secyyy}
-\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsection{\parsearg\appendixsecyyy}
-\outer\def\appendixsec{\parsearg\appendixsecyyy}
-\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
-\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
-\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
-\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
-\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
-\plainsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
-\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
-\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
-\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
-\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-% These are variants which are not "outer", so they can appear in @ifinfo.
-% Actually, they should now be obsolete; ordinary section commands should work.
-\def\infotop{\parsearg\unnumberedzzz}
-\def\infounnumbered{\parsearg\unnumberedzzz}
-\def\infounnumberedsec{\parsearg\unnumberedseczzz}
-\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
-\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
-
-\def\infoappendix{\parsearg\appendixzzz}
-\def\infoappendixsec{\parsearg\appendixseczzz}
-\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
-\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
-
-\def\infochapter{\parsearg\chapterzzz}
-\def\infosection{\parsearg\sectionzzz}
-\def\infosubsection{\parsearg\subsectionzzz}
-\def\infosubsubsection{\parsearg\subsubsectionzzz}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
-
-\def\majorheading{\parsearg\majorheadingzzz}
-\def\majorheadingzzz #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-\def\chapheading{\parsearg\chapheadingzzz}
-\def\chapheadingzzz #1{\chapbreak %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-% @heading, @subheading, @subsubheading.
-\def\heading{\parsearg\plainsecheading}
-\def\subheading{\parsearg\plainsubsecheading}
-\def\subsubheading{\parsearg\plainsubsubsecheading}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-%%% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-
-%%% Define plain chapter starts, and page on/off switching for it
-% Parameter controlling skip before chapter headings (if needed)
-
-\newskip\chapheadingskip
-
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-\def\CHAPFplain{
-\global\let\chapmacro=\chfplain
-\global\let\unnumbchapmacro=\unnchfplain
-\global\let\centerchapmacro=\centerchfplain}
-
-% Plain chapter opening.
-% #1 is the text, #2 the chapter number or empty if unnumbered.
-\def\chfplain#1#2{%
- \pchapsepmacro
- {%
- \chapfonts \rm
- \def\chapnum{#2}%
- \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 \centerparametersmaybe
- \unhbox0 #1\par}%
- }%
- \nobreak\bigskip % no page break after a chapter title
- \nobreak
-}
-
-% Plain opening for unnumbered.
-\def\unnchfplain#1{\chfplain{#1}{}}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerchfplain#1{{%
- \def\centerparametersmaybe{%
- \advance\rightskip by 3\rightskip
- \leftskip = \rightskip
- \parfillskip = 0pt
- }%
- \chfplain{#1}{}%
-}}
-
-\CHAPFplain % The default
-
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-
-\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\CHAPFopen{
-\global\let\chapmacro=\chfopen
-\global\let\unnumbchapmacro=\unnchfopen
-\global\let\centerchapmacro=\centerchfopen}
-
-
-% Section titles.
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
-\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
-\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
-
-% Subsection titles.
-\newskip \subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
-\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
-\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
-
-% Subsubsection titles.
-\let\subsubsecheadingskip = \subsecheadingskip
-\let\subsubsecheadingbreak = \subsecheadingbreak
-\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
-\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
-
-
-% Print any size section title.
-%
-% #1 is the section type (sec/subsec/subsubsec), #2 is the section
-% number (maybe empty), #3 the text.
-\def\sectionheading#1#2#3{%
- {%
- \expandafter\advance\csname #1headingskip\endcsname by \parskip
- \csname #1headingbreak\endcsname
- }%
- {%
- % Switch to the right set of fonts.
- \csname #1fonts\endcsname \rm
- %
- % Only insert the separating space if we have a section number.
- \def\secnum{#2}%
- \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
- %
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 % zero if no section number
- \unhbox0 #3}%
- }%
- \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
-}
-
-
-\message{toc printing,}
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\def\startcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- \contentsalignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \unnumbchapmacro{#1}\def\thischapter{}%
- \begingroup % Set up to handle contents files properly.
- \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- % We can't do this, because then an actual ^ in a section
- % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
- %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
-}
-
-
-% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-
-% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
- %
- \let\chapentry = \shortchapentry
- \let\unnumbchapentry = \shortunnumberedentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \def\secentry ##1##2##3##4{}
- \def\unnumbsecentry ##1##2{}
- \def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2{}
- \def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-\let\shortcontents = \summarycontents
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Chapter-level things, for both the long and short contents.
-\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
-
-% See comments in \dochapentry re vbox and related settings
-\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
-}
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
-% We could simplify the code here by writing out an \appendixentry
-% command in the toc file for appendices, instead of using \chapentry
-% for both, but it doesn't seem worth it.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
-\def\shortchaplabel#1{%
- % We typeset #1 in a box of constant width, regardless of the text of
- % #1, so the chapter titles will come out aligned.
- \setbox0 = \hbox{#1}%
- \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
- %
- % This space should be plenty, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by \shortchapentry above.)
- \advance\dimen0 by 1.1em
- \hbox to \dimen0{#1\hfil}%
-}
-
-\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
-
-% Sections.
-\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
-\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
-
-% Subsections.
-\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
-\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
-
-% And subsubsections.
-\def\subsubsecentry#1#2#3#4#5#6{%
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
-\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
-
-% This parameter controls the indentation of the various levels.
-\newdimen\tocindent \tocindent = 3pc
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
- \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
- \begingroup
- \chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
- \endgroup
- \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-% Final typesetting of a toc entry; we use the same \entry macro as for
-% the index entries, but we want to suppress hyphenation here. (We
-% can't do that in the \entry macro, since index entries might consist
-% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-\def\tocentry#1#2{\begingroup
- \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- % Do not use \turnoffactive in these arguments. Since the toc is
- % typeset in cmr, so characters such as _ would come out wrong; we
- % have to do the usual translation tricks.
- \entry{#1}{#2}%
-\endgroup}
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\let\subsecentryfonts = \textfonts
-\let\subsubsecentryfonts = \textfonts
-
-
-\message{environments,}
-
-% Since these characters are used in examples, it should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-% Furthermore, these definitions must come after we define our fonts.
-\newbox\dblarrowbox \newbox\longdblarrowbox
-\newbox\pushcharbox \newbox\bullbox
-\newbox\equivbox \newbox\errorbox
-
-%{\tentt
-%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
-%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
-%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
-%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
-% Adapted from the manmac format (p.420 of TeXbook)
-%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
-% depth .1ex\hfil}
-%}
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-\def\point{$\star$}
-\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% Adapted from the TeXbook's \boxit.
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
-
-\global\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-
-% The @error{} command.
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @tex ... @end tex escapes into raw Tex temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
-
-\def\tex{\begingroup
- \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
- \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
- \catcode `\%=14
- \catcode 43=12 % plus
- \catcode`\"=12
- \catcode`\==12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \escapechar=`\\
- %
- \let\b=\ptexb
- \let\bullet=\ptexbullet
- \let\c=\ptexc
- \let\,=\ptexcomma
- \let\.=\ptexdot
- \let\dots=\ptexdots
- \let\equiv=\ptexequiv
- \let\!=\ptexexclam
- \let\i=\ptexi
- \let\{=\ptexlbrace
- \let\}=\ptexrbrace
- \let\*=\ptexstar
- \let\t=\ptext
- %
- \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
- \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
- \def\@{@}%
-\let\Etex=\endgroup}
-
-% Define @lisp ... @endlisp.
-% @lisp does a \begingroup so it can rebind things,
-% including the definition of @endlisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% Make each space character in the input produce a normal interword
-% space in the output. Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is. This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip
-%
-\def\aboveenvbreak{{\advance\envskipamount by \parskip
-\endgraf \ifdim\lastskip<\envskipamount
-\removelastskip \penalty-50 \vskip\envskipamount \fi}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
-\let\nonarrowing=\relax
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\long\def\cartouche{%
-\begingroup
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt %we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
-% side, and for 6pt waste from
-% each corner char
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing=\comment
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \hsize=\cartinner
- \kern3pt
- \begingroup
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
-\def\Ecartouche{%
- \endgroup
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
-\endgroup
-}}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\def\nonfillstart{%
- \aboveenvbreak
- \inENV % This group ends at the end of the body
- \hfuzz = 12pt % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \singlespace
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- \parindent = 0pt
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- % @cartouche defines \nonarrowing to inhibit narrowing
- % at next level down.
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \let\exdent=\nofillexdent
- \let\nonarrowing=\relax
- \fi
-}
-
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
-%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
-
-\def\lisp{\begingroup
- \nonfillstart
- \let\Elisp = \nonfillfinish
- \tt
- % Make @kbd do something special, if requested.
- \let\kbdfont\kbdexamplefont
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
-}
-
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
-\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
-%
-\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller fonts for small examples.
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
-}
-
-% This is @display; same as @lisp except use roman font.
-%
-\def\display{\begingroup
- \nonfillstart
- \let\Edisplay = \nonfillfinish
- \gobble
-}
-
-% This is @format; same as @display except don't narrow margins.
-%
-\def\format{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eformat = \nonfillfinish
- \gobble
-}
-
-% @flushleft (same as @format) and @flushright.
-%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
-}
-\def\flushright{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushright = \nonfillfinish
- \advance\leftskip by 0pt plus 1fill
- \gobble}
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins.
-%
-\def\quotation{%
- \begingroup\inENV %This group ends at the end of the @quotation body
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \singlespace
- \parindent=0pt
- % We have retained a nonzero parskip for the environment, since we're
- % doing normal filling. So to avoid extra space below the environment...
- \def\Equotation{\parskip = 0pt \nonfillfinish}%
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \let\nonarrowing = \relax
- \fi
-}
-
-\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deftypemargin \deftypemargin=12pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-
-\newcount\parencount
-% define \functionparens, which makes ( and ) and & do special things.
-% \functionparens affects the group it is contained in.
-\def\activeparens{%
-\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
-\catcode`\[=\active \catcode`\]=\active}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-\global\let(=\lparen \global\let)=\rparen
-\global\let[=\lbrack \global\let]=\rbrack
-
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-% This is used to turn on special parens
-% but make & act ordinary (given that it's active).
-\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
- \global\advance\parencount by 1
-}
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
- % also in that case restore the outer-level definition of (.
- \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
- \global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
-\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
-\def\ampnr{\&}
-\def\lbrb{{\bf\char`\[}}
-\def\rbrb{{\bf\char`\]}}
-
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-% Get the values of \leftskip and \rightskip as they were
-% outside the @def...
-\dimen2=\leftskip
-\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-{% Adjust \hsize to exclude the ambient margins,
-% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
-% Make all lines underfull and no complaints:
-\tolerance=10000 \hbadness=10000
-\advance\leftskip by -\defbodyindent
-\exdentamount=\defbodyindent
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active % 61 is `='
-\obeylines\activeparens\spacesplit#3}
-
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-
-\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
-
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
-
-\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active %
-\obeylines\spacesplit#3}
-
-% This is used for \def{tp,vr}parsebody. It could probably be used for
-% some of the others, too, with some judicious conditionals.
-%
-\def\parsebodycommon#1#2#3{%
- \begingroup\inENV %
- \medbreak %
- % Define the end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup\obeylines
-}
-
-\def\defvrparsebody#1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{#3{#4}}%
-}
-
-% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
-% type is just `struct', because we lose the braces in `{struct
-% termios}' when \spacesplit reads its undelimited argument. Sigh.
-% \let\deftpparsebody=\defvrparsebody
-%
-% So, to get around this, we put \empty in with the type name. That
-% way, TeX won't find exactly `{...}' as an undelimited argument, and
-% won't strip off the braces.
-%
-\def\deftpparsebody #1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{\parsetpheaderline{#3{#4}}}\empty
-}
-
-% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any). That's what this does.
-%
-\def\removeemptybraces\empty#1\relax{#1}
-
-% After \spacesplit has done its work, this is called -- #1 is the final
-% thing to call, #2 the type name (which starts with \empty), and #3
-% (which might be empty) the arguments.
-%
-\def\parsetpheaderline#1#2#3{%
- #1{\removeemptybraces#2\relax}{#3}%
-}%
-
-\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\spacesplit{#3{#5}}}
-
-% Split up #2 at the first space token.
-% call #1 with two arguments:
-% the first is all of #2 before the space token,
-% the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-
-{\obeylines
-\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
-\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
-\ifx\relax #3%
-#1{#2}{}\else #1{#2}{#3#4}\fi}}
-
-% So much for the things common to all kinds of definitions.
-
-% Define @defun.
-
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
-
-\def\defunargs #1{\functionparens \sl
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
-#1%
-\hyphenchar\tensl=45
-\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-\def\deftypefunargs #1{%
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Use \boldbraxnoamp, not \functionparens, so that & is not special.
-\boldbraxnoamp
-\tclose{#1}% avoid \code because of side effects on active chars
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-% Do complete processing of one @defun or @defunx line already parsed.
-
-% @deffn Command forward-char nchars
-
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defun == @deffn Function
-
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
-
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefun int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
-
-% #1 is the data type. #2 is the name and args.
-\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
-% #1 is the data type, #2 the name, #3 the args.
-\def\deftypefunheaderx #1#2 #3\relax{%
-\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
-\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-
-% \defheaderxcond#1\relax$$$
-% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
-
-% #1 is the classification. #2 is the data type. #3 is the name and args.
-\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
-% #1 is the classification, #2 the data type, #3 the name, #4 the args.
-\def\deftypefnheaderx #1#2#3 #4\relax{%
-\doind {fn}{\code{#3}}% Make entry in function index
-\begingroup
-\normalparens % notably, turn off `&' magic, which prevents
-% at least some C++ text from working
-\defname {\defheaderxcond#2\relax$$$#3}{#1}%
-\deftypefunargs {#4}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
-
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defspec == @deffn Special Form
-
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
-
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
-\def\defop #1 {\def\defoptype{#1}%
-\defopparsebody\Edefop\defopx\defopheader\defoptype}
-
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @deftypemethod foo-class return-type foo-method args
-%
-\def\deftypemethod{%
- \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
-%
-% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
-\def\deftypemethodheader#1#2#3#4{%
- \deftypefnheaderx{Method on #1}{#2}#3 #4\relax
-}
-
-% @defmethod == @defop Method
-
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
-
-\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% @defivar == @defcv {Instance Variable}
-
-\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
-\defvarargs {#2}\endgroup %
-}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
-\defvarargs {#2}\endgroup %
-}
-
-% @deftypevar int foobar
-
-\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-
-% #1 is the data type. #2 is the name, perhaps followed by text that
-% is actually part of the data type, which should not be put into the index.
-\def\deftypevarheader #1#2{%
-\dovarind#2 \relax% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
-
-% @deftypevr {Global Flag} int enable
-
-\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-
-\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
-
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-
-
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
-
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% @inforef is simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-% \setref{foo} defines a cross-reference point named foo.
-
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
-
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
-
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \def\printedmanual{\ignorespaces #5}%
- \def\printednodename{\ignorespaces #3}%
- \setbox1=\hbox{\printedmanual}%
- \setbox0=\hbox{\printednodename}%
- \ifdim \wd0 = 0pt
- % No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
- % Use the node name inside the square brackets.
- \def\printednodename{\ignorespaces #1}%
- \else
- % Use the actual chapter/section title appear inside
- % the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
- % It is in another manual, so we don't have it.
- \def\printednodename{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We know the real title if we have the xref values.
- \def\printednodename{\refx{#1-title}{}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printednodename{\ignorespaces #1}%
- \fi%
- \fi
- \fi
- \fi
- %
- % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
- % insert empty discretionaries after hyphens, which means that it will
- % not find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens, this
- % is a loss. Therefore, we give the text of the node name again, so it
- % is as if TeX is seeing it for the first time.
- \ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
- \else
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi
-\endgroup}
-
-% \dosetq is the interface for calls from other macros
-
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
-
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
-
-\def\Ypagenumber{\folio}
-
-\def\Ytitle{\thissection}
-
-\def\Ynothing{}
-
-\def\Ysectionnumberandtype{%
-\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\def\Yappendixletterandtype{%
-\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
-\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Non-3.0.
-\else
- \def\linenumber{\the\inputlineno:\space}
-\fi
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-
-\def\refx#1#2{%
- \expandafter\ifx\csname X#1\endcsname\relax
- % If not defined, say something at least.
- \angleleft un\-de\-fined\angleright
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \csname X#1\endcsname
- \fi
- #2% Output the suffix in any case.
-}
-
-% This is the macro invoked by entries in the aux file.
-%
-\def\xrdef#1{\begingroup
- % Reenable \ as an escape while reading the second argument.
- \catcode`\\ = 0
- \afterassignment\endgroup
- \expandafter\gdef\csname X#1\endcsname
-}
-
-% Read the last existing aux file, if any. No error if none exists.
-\def\readauxfile{\begingroup
- \catcode`\^^@=\other
- \catcode`\^^A=\other
- \catcode`\^^B=\other
- \catcode`\^^C=\other
- \catcode`\^^D=\other
- \catcode`\^^E=\other
- \catcode`\^^F=\other
- \catcode`\^^G=\other
- \catcode`\^^H=\other
- \catcode`\^^K=\other
- \catcode`\^^L=\other
- \catcode`\^^N=\other
- \catcode`\^^P=\other
- \catcode`\^^Q=\other
- \catcode`\^^R=\other
- \catcode`\^^S=\other
- \catcode`\^^T=\other
- \catcode`\^^U=\other
- \catcode`\^^V=\other
- \catcode`\^^W=\other
- \catcode`\^^X=\other
- \catcode`\^^Z=\other
- \catcode`\^^[=\other
- \catcode`\^^\=\other
- \catcode`\^^]=\other
- \catcode`\^^^=\other
- \catcode`\^^_=\other
- \catcode`\@=\other
- \catcode`\^=\other
- % It was suggested to define this as 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
- \catcode`\~=\other
- \catcode`\[=\other
- \catcode`\]=\other
- \catcode`\"=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\$=\other
- \catcode`\#=\other
- \catcode`\&=\other
- % `\+ does not work, so use 43.
- \catcode43=\other
- % Make the characters 128-255 be printing characters
- {%
- \count 1=128
- \def\loop{%
- \catcode\count 1=\other
- \advance\count 1 by 1
- \ifnum \count 1<256 \loop \fi
- }%
- }%
- % The aux file uses ' as the escape (for now).
- % Turn off \ as an escape so we do not lose on
- % entries which were dumped with control sequences in their names.
- % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
- % Reference to such entries still does not work the way one would wish,
- % but at least they do not bomb out when the aux file is read in.
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\%=\other
- \catcode`\'=0
- \catcode`\\=\other
- %
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \closein 1
- \input \jobname.aux
- \global\havexrefstrue
- \global\warnedobstrue
- \fi
- % Open the new aux file. TeX will close it automatically at exit.
- \openout\auxfile=\jobname.aux
-\endgroup}
-
-
-% Footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for info output only.
-\let\footnotestyle=\comment
-
-\let\ptexfootnote=\footnote
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \global\advance\footnoteno by \@ne
- \edef\thisfootno{$^{\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- \thisfootno\@sf
- \footnotezzz
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter. Our footnotes don't need to be so general.
-%
-% Oh yes, they do; otherwise, @ifset and anything else that uses
-% \parseargline fail inside footnotes because the tokens are fixed when
-% the footnote is read. --karl, 16nov96.
-%
-\long\gdef\footnotezzz{\insert\footins\bgroup
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- % Hang the footnote text off the number.
- \hang
- \textindent{\thisfootno}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- \futurelet\next\fo@t
-}
-\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
- \else\let\next\f@t\fi \next}
-\def\f@@t{\bgroup\aftergroup\@foot\let\next}
-\def\f@t#1{#1\@foot}
-\def\@foot{\strut\egroup}
-
-}%end \catcode `\@=11
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-\def\setleading#1{%
- \normalbaselineskip = #1\relax
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt}
-
-% @image. We use the macros from epsf.tex to support this.
-% If epsf.tex is not installed and @image is used, we complain.
-%
-% Check for and read epsf.tex up front. If we read it only at @image
-% time, we might be inside a group, and then its definitions would get
-% undone and the next image would fail.
-\openin 1 = epsf.tex
-\ifeof 1 \else
- \closein 1
- \def\epsfannounce{\toks0 = }% do not bother showing banner
- \input epsf.tex
-\fi
-%
-\newif\ifwarnednoepsf
-\newhelp\noepsfhelp{epsf.tex must be installed for images to
- work. It is also included in the Texinfo distribution, or you can get
- it from ftp://ftp.tug.org/tex/epsf.tex.}
-%
-% Only complain once about lack of epsf.tex.
-\def\image#1{%
- \ifx\epsfbox\undefined
- \ifwarnednoepsf \else
- \errhelp = \noepsfhelp
- \errmessage{epsf.tex not found, images will be ignored}%
- \global\warnednoepsftrue
- \fi
- \else
- \imagexxx #1,,,\finish
- \fi
-}
-%
-% Arguments to @image:
-% #1 is (mandatory) image filename; we tack on .eps extension.
-% #2 is (optional) width, #3 is (optional) height.
-% #4 is just the usual extra ignored arg for parsing this stuff.
-\def\imagexxx#1,#2,#3,#4\finish{%
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
-}
-
-% End of control word definitions.
-
-
-\message{and turning on texinfo input format.}
-
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
-% Set some numeric style parameters, for 8.5 x 11 format.
-
-\hsize = 6in
-\hoffset = .25in
-\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness=10000
-
-% Following George Bush, just get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
-%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
-
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
- %
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
- %
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- %
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
-}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
-% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
-
-% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-
-% This macro is used to make a character print one way in ttfont
-% where it can probably just be output, and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise. Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt \char '176}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
-
-\catcode`\|=\active
-\def|{{\tt \char '174}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
-
-% Set up an active definition for =, but don't enable it most of the time.
-{\catcode`\==\active
-\global\def={{\tt \char 61}}}
-
-\catcode`+=\active
-\catcode`\_=\active
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
-\catcode`\@=0
-
-% \rawbackslashxx output one backslash character in current font
-\global\chardef\rawbackslashxx=`\\
-%{\catcode`\\=\other
-%@gdef@rawbackslashxx{\}}
-
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
-{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
-
-% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
-
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
-% \catcode 17=0 % Define control-q
-\catcode`\\=\active
-
-% Used sometimes to turn off (effectively) the active characters
-% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-@def@normalturnoffactive{@let"=@normaldoublequote
-@let\=@normalbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
-@otherifyactive
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\{ in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also back turn on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active @catcode`@_=@active}
-
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
-
-@textfonts
-@rm
-
-@c Local variables:
-@c page-delimiter: "^\\\\message"
-@c End:
diff --git a/contrib/texinfo/doc/texinfo.txi b/contrib/texinfo/doc/texinfo.txi
deleted file mode 100644
index c0b7a20d3b6e..000000000000
--- a/contrib/texinfo/doc/texinfo.txi
+++ /dev/null
@@ -1,17280 +0,0 @@
-\input texinfo.tex @c -*-texinfo-*-
-@c $Id: texinfo.txi,v 1.50 1998/02/27 21:21:34 karl Exp $
-@c %**start of header
-
-@c All text is ignored before the setfilename.
-@setfilename texinfo
-@settitle Texinfo @value{edition}
-
-@c Edition number is now the same as the Texinfo distribution version number.
-@set edition 3.12
-@set update-month February 1998
-@set update-date 27 @value{update-month}
-
-@c Define a new index for options.
-@defcodeindex op
-@c Put everything except function (command, in this case) names in one
-@c index (arbitrarily chosen to be the concept index).
-@syncodeindex op cp
-@syncodeindex vr cp
-@syncodeindex pg cp
-
-@footnotestyle separate
-@paragraphindent 2
-@finalout
-@comment %**end of header
-
-@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
-@c prefix arg). This updates the node pointers, which texinfmt.el needs.
-
-@dircategory Texinfo documentation system
-@direntry
-* Texinfo: (texinfo). The GNU documentation format.
-* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
-* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
-* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
-* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source.
-@end direntry
-
-@c Set smallbook if printing in smallbook format so the example of the
-@c smallbook font is actually written using smallbook; in bigbook, a kludge
-@c is used for TeX output. Do this through the -t option to texi2dvi,
-@c so this same source can be used for other paper sizes as well.
-@c smallbook
-@c set smallbook
-@c @@clear smallbook
-
-@c Currently undocumented command, 5 December 1993:
-@c nwnode (Same as node, but no warnings; for `makeinfo'.)
-
-@ifinfo
-This file documents Texinfo, a documentation system that can produce
-both on-line information and a printed manual from a single source file.
-
-Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98
-Free Software Foundation, Inc.
-
-This edition is for Texinfo version @value{edition}.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end ifinfo
-
-@setchapternewpage odd
-
-@shorttitlepage Texinfo
-
-@titlepage
-@c use the new format for titles
-@title Texinfo
-@subtitle The GNU Documentation Format
-@subtitle for Texinfo version @value{edition}
-@subtitle @value{update-month}
-
-@author Robert J.@: Chassell
-@author Richard M.@: Stallman
-
-@c Include the Distribution inside the titlepage so
-@c that headings are turned off.
-
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 90, 91, 92, 93, 95, 96, 97, 98
-Free Software Foundation, Inc.
-
-Published by the Free Software Foundation @*
-59 Temple Place Suite 330 @*
-Boston, MA 02111-1307 @*
-USA @*
-ISBN 1-882114-65-5
-@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995
-@c ISBN 1-882114-64-7 is for edition 2.24 of November 1996.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@sp 2
-Cover art by Etienne Suvasa.
-@end titlepage
-
-@ifinfo
-@node Top, Copying, (dir), (dir)
-@top Texinfo
-
-Texinfo is a documentation system that uses a single source file to
-produce both on-line information and printed output.@refill
-
-The first part of this master menu lists the major nodes in this Info
-document, including the @@-command and concept indices. The rest of
-the menu lists all the lower level nodes in the document.@refill
-
-This is Edition @value{edition} of the Texinfo documentation,
-@w{@value{update-date}}.
-@end ifinfo
-
-@c Here is a spare copy of the chapter menu entry descriptions,
-@c in case they are accidently deleted
-@ignore
-Your rights.
-Texinfo in brief.
-How to use Texinfo mode.
-What is at the beginning of a Texinfo file?
-What is at the end of a Texinfo file?
-How to create chapters, sections, subsections,
- appendices, and other parts.
-How to provide structure for a document.
-How to write nodes.
-How to write menus.
-How to write cross references.
-How to mark words and phrases as code,
- keyboard input, meta-syntactic
- variables, and the like.
-How to write quotations, examples, etc.
-How to write lists and tables.
-How to create indices.
-How to insert @@-signs, braces, etc.
-How to indicate results of evaluation,
- expansion of macros, errors, etc.
-How to force and prevent line and page breaks.
-How to describe functions and the like in a uniform manner.
-How to write footnotes.
-How to specify text for either @TeX{} or Info.
-How to print hardcopy.
-How to create an Info file.
-How to install an Info file
-A list of all the Texinfo @@-commands.
-Hints on how to write a Texinfo document.
-A sample Texinfo file to look at.
-Tell readers they have the right to copy
- and distribute.
-How to incorporate other Texinfo files.
-How to write page headings and footings.
-How to find formatting mistakes.
-All about paragraph refilling.
-A description of @@-Command syntax.
-Texinfo second edition features.
-A menu containing commands and variables.
-A menu covering many topics.
-@end ignore
-
-@menu
-* Copying:: Your rights.
-* Overview:: Texinfo in brief.
-* Texinfo Mode:: How to use Texinfo mode.
-* Beginning a File:: What is at the beginning of a Texinfo file?
-* Ending a File:: What is at the end of a Texinfo file?
-* Structuring:: How to create chapters, sections, subsections,
- appendices, and other parts.
-* Nodes:: How to write nodes.
-* Menus:: How to write menus.
-* Cross References:: How to write cross references.
-* Marking Text:: How to mark words and phrases as code,
- keyboard input, meta-syntactic
- variables, and the like.
-* Quotations and Examples:: How to write quotations, examples, etc.
-* Lists and Tables:: How to write lists and tables.
-* Indices:: How to create indices.
-* Insertions:: How to insert @@-signs, braces, etc.
-* Breaks:: How to force and prevent line and page breaks.
-* Definition Commands:: How to describe functions and the like
- in a uniform manner.
-* Footnotes:: How to write footnotes.
-* Conditionals:: How to specify text for either @TeX{} or Info.
-* Macros:: Defining new Texinfo commands.
-* Format/Print Hardcopy:: How to convert a Texinfo file to a file
- for printing and how to print that file.
-* Create an Info File:: Convert a Texinfo file into an Info file.
-* Install an Info File:: Make an Info file accessible to users.
-* Command List:: All the Texinfo @@-commands.
-* Tips:: Hints on how to write a Texinfo document.
-* Sample Texinfo File:: A sample Texinfo file to look at.
-* Sample Permissions:: Tell readers they have the right to copy
- and distribute.
-* Include Files:: How to incorporate other Texinfo files.
-* Headings:: How to write page headings and footings.
-* Catching Mistakes:: How to find formatting mistakes.
-* Refilling Paragraphs:: All about paragraph refilling.
-* Command Syntax:: A description of @@-Command syntax.
-* Obtaining TeX:: How to Obtain @TeX{}.
-* Command and Variable Index:: A menu containing commands and variables.
-* Concept Index:: A menu covering many topics.
-
-@detailmenu
-
- --- The Detailed Node Listing ---
-
-Overview of Texinfo
-
-* Using Texinfo:: Create a conventional printed book
- or an Info file.
-* Info Files:: What is an Info file?
-* Printed Books:: Characteristics of a printed book or manual.
-* Formatting Commands:: @@-commands are used for formatting.
-* Conventions:: General rules for writing a Texinfo file.
-* Comments:: How to write comments and mark regions that
- the formatting commands will ignore.
-* Minimum:: What a Texinfo file must have.
-* Six Parts:: Usually, a Texinfo file has six parts.
-* Short Sample:: A short sample Texinfo file.
-* Acknowledgements::
-
-Using Texinfo Mode
-
-* Texinfo Mode Overview:: How Texinfo mode can help you.
-* Emacs Editing:: Texinfo mode adds to GNU Emacs' general
- purpose editing features.
-* Inserting:: How to insert frequently used @@-commands.
-* Showing the Structure:: How to show the structure of a file.
-* Updating Nodes and Menus:: How to update or create new nodes and menus.
-* Info Formatting:: How to format for Info.
-* Printing:: How to format and print part or all of a file.
-* Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
-
-Updating Nodes and Menus
-
-* Updating Commands:: Five major updating commands.
-* Updating Requirements:: How to structure a Texinfo file for
- using the updating command.
-* Other Updating Commands:: How to indent descriptions, insert
- missing nodes lines, and update
- nodes in sequence.
-
-Beginning a Texinfo File
-
-* Four Parts:: Four parts begin a Texinfo file.
-* Sample Beginning:: Here is a sample beginning for a Texinfo file.
-* Header:: The very beginning of a Texinfo file.
-* Info Summary and Permissions:: Summary and copying permissions for Info.
-* Titlepage & Copyright Page:: Creating the title and copyright pages.
-* The Top Node:: Creating the `Top' node and master menu.
-* Software Copying Permissions:: Ensure that you and others continue to
- have the right to use and share software.
-
-The Texinfo File Header
-
-* First Line:: The first line of a Texinfo file.
-* Start of Header:: Formatting a region requires this.
-* setfilename:: Tell Info the name of the Info file.
-* settitle:: Create a title for the printed work.
-* setchapternewpage:: Start chapters on right-hand pages.
-* paragraphindent:: An option to specify paragraph indentation.
-* End of Header:: Formatting a region requires this.
-
-The Title and Copyright Pages
-
-* titlepage:: Create a title for the printed document.
-* titlefont center sp:: The @code{@@titlefont}, @code{@@center},
- and @code{@@sp} commands.
-* title subtitle author:: The @code{@@title}, @code{@@subtitle},
- and @code{@@author} commands.
-* Copyright & Permissions:: How to write the copyright notice and
- include copying permissions.
-* end titlepage:: Turn on page headings after the title and
- copyright pages.
-* headings on off:: An option for turning headings on and off
- and double or single sided printing.
-
-The `Top' Node and Master Menu
-
-* Title of Top Node:: Sketch what the file is about.
-* Master Menu Parts:: A master menu has three or more parts.
-
-Ending a Texinfo File
-
-* Printing Indices & Menus:: How to print an index in hardcopy and
- generate index menus in Info.
-* Contents:: How to create a table of contents.
-* File End:: How to mark the end of a file.
-
-Chapter Structuring
-
-* Tree Structuring:: A manual is like an upside down tree @dots{}
-* Structuring Command Types:: How to divide a manual into parts.
-* makeinfo top:: The @code{@@top} command, part of the `Top' node.
-* chapter::
-* unnumbered & appendix::
-* majorheading & chapheading::
-* section::
-* unnumberedsec appendixsec heading::
-* subsection::
-* unnumberedsubsec appendixsubsec subheading::
-* subsubsection:: Commands for the lowest level sections.
-* Raise/lower sections:: How to change commands' hierarchical level.
-
-Nodes
-
-* Two Paths:: Different commands to structure
- Info output and printed output.
-* Node Menu Illustration:: A diagram, and sample nodes and menus.
-* node:: How to write a node, in detail.
-* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
-
-The @code{@@node} Command
-
-* Node Names:: How to choose node and pointer names.
-* Writing a Node:: How to write an @code{@@node} line.
-* Node Line Tips:: Keep names short.
-* Node Line Requirements:: Keep names unique, without @@-commands.
-* First Node:: How to write a `Top' node.
-* makeinfo top command:: How to use the @code{@@top} command.
-* Top Node Summary:: Write a brief description for readers.
-
-Menus
-
-* Menu Location:: Put a menu in a short node.
-* Writing a Menu:: What is a menu?
-* Menu Parts:: A menu entry has three parts.
-* Less Cluttered Menu Entry:: Two part menu entry.
-* Menu Example:: Two and three part menu entries.
-* Other Info Files:: How to refer to a different Info file.
-
-Cross References
-
-* References:: What cross references are for.
-* Cross Reference Commands:: A summary of the different commands.
-* Cross Reference Parts:: A cross reference has several parts.
-* xref:: Begin a reference with `See' @dots{}
-* Top Node Naming:: How to refer to the beginning of another file.
-* ref:: A reference for the last part of a sentence.
-* pxref:: How to write a parenthetical cross reference.
-* inforef:: How to refer to an Info-only file.
-* uref:: How to refer to a uniform resource locator.
-
-@code{@@xref}
-
-* Reference Syntax:: What a reference looks like and requires.
-* One Argument:: @code{@@xref} with one argument.
-* Two Arguments:: @code{@@xref} with two arguments.
-* Three Arguments:: @code{@@xref} with three arguments.
-* Four and Five Arguments:: @code{@@xref} with four and five arguments.
-
-Marking Words and Phrases
-
-* Indicating:: How to indicate definitions, files, etc.
-* Emphasis:: How to emphasize text.
-
-Indicating Definitions, Commands, etc.
-
-* Useful Highlighting:: Highlighting provides useful information.
-* code:: How to indicate code.
-* kbd:: How to show keyboard input.
-* key:: How to specify keys.
-* samp:: How to show a literal sequence of characters.
-* var:: How to indicate a metasyntactic variable.
-* file:: How to indicate the name of a file.
-* dfn:: How to specify a definition.
-* cite:: How to refer to a book that is not in Info.
-* url:: How to indicate a world wide web reference.
-* email:: How to indicate an electronic mail address.
-
-Emphasizing Text
-
-* emph & strong:: How to emphasize text in Texinfo.
-* Smallcaps:: How to use the small caps font.
-* Fonts:: Various font commands for printed output.
-* Customized Highlighting:: How to define highlighting commands.
-
-Quotations and Examples
-
-* Block Enclosing Commands:: Use different constructs for
- different purposes.
-* quotation:: How to write a quotation.
-* example:: How to write an example in a fixed-width font.
-* noindent:: How to prevent paragraph indentation.
-* Lisp Example:: How to illustrate Lisp code.
-* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
-* display:: How to write an example in the current font.
-* format:: How to write an example that does not narrow
- the margins.
-* exdent:: How to undo the indentation of a line.
-* flushleft & flushright:: How to push text flushleft or flushright.
-* cartouche:: How to draw cartouches around examples.
-
-Lists and Tables
-
-* Introducing Lists:: Texinfo formats lists for you.
-* itemize:: How to construct a simple list.
-* enumerate:: How to construct a numbered list.
-* Two-column Tables:: How to construct a two-column table.
-* Multi-column Tables:: How to construct generalized tables.
-
-Making a Two-column Table
-
-* table:: How to construct a two-column table.
-* ftable vtable:: Automatic indexing for two-column tables.
-* itemx:: How to put more entries in the first column.
-
-Multi-column Tables
-
-* Multitable Column Widths:: Defining multitable column widths.
-* Multitable Rows:: Defining multitable rows, with examples.
-
-Creating Indices
-
-* Index Entries:: Choose different words for index entries.
-* Predefined Indices:: Use different indices for different kinds
- of entry.
-* Indexing Commands:: How to make an index entry.
-* Combining Indices:: How to combine indices.
-* New Indices:: How to define your own indices.
-
-Combining Indices
-
-* syncodeindex:: How to merge two indices, using @code{@@code}
- font for the merged-from index.
-* synindex:: How to merge two indices, using the
- default font of the merged-to index.
-
-Special Insertions
-
-* Braces Atsigns:: How to insert braces, @samp{@@}.
-* Inserting Space:: How to insert the right amount of space
- within a sentence.
-* Inserting Accents:: How to insert accents and special characters.
-* Dots Bullets:: How to insert dots and bullets.
-* TeX and copyright:: How to insert the @TeX{} logo
- and the copyright symbol.
-* pounds:: How to insert the pounds currency symbol.
-* minus:: How to insert a minus sign.
-* math:: How to format a mathematical expression.
-* Glyphs:: How to indicate results of evaluation,
- expansion of macros, errors, etc.
-* Images:: How to include graphics.
-
-Inserting @@ and Braces
-
-* Inserting An Atsign:: How to insert @samp{@@}.
-* Inserting Braces:: How to insert @samp{@{} and @samp{@}}.
-
-Inserting Space
-
-* Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
-* Ending a Sentence:: Sometimes it does.
-* Multiple Spaces:: Inserting multiple spaces.
-* dmn:: How to format a dimension.
-
-Inserting Ellipsis, Dots, and Bullets
-
-* dots:: How to insert dots @dots{}
-* bullet:: How to insert a bullet.
-
-Inserting @TeX{} and the Copyright Symbol
-
-* tex:: How to insert the @TeX{} logo.
-* copyright symbol:: How to use @code{@@copyright}@{@}.
-
-Glyphs for Examples
-
-* Glyphs Summary::
-* result:: How to show the result of expression.
-* expansion:: How to indicate an expansion.
-* Print Glyph:: How to indicate printed output.
-* Error Glyph:: How to indicate an error message.
-* Equivalence:: How to indicate equivalence.
-* Point Glyph:: How to indicate the location of point.
-
-Glyphs Summary
-
-* result::
-* expansion::
-* Print Glyph::
-* Error Glyph::
-* Equivalence::
-* Point Glyph::
-
-Making and Preventing Breaks
-
-* Break Commands:: Cause and prevent splits.
-* Line Breaks:: How to force a single line to use two lines.
-* - and hyphenation:: How to tell TeX about hyphenation points.
-* w:: How to prevent unwanted line breaks.
-* sp:: How to insert blank lines.
-* page:: How to force the start of a new page.
-* group:: How to prevent unwanted page breaks.
-* need:: Another way to prevent unwanted page breaks.
-
-Definition Commands
-
-* Def Cmd Template:: How to structure a description using a
- definition command.
-* Optional Arguments:: How to handle optional and repeated arguments.
-* deffnx:: How to group two or more `first' lines.
-* Def Cmds in Detail:: All the definition commands.
-* Def Cmd Conventions:: Conventions for writing definitions.
-* Sample Function Definition::
-
-The Definition Commands
-
-* Functions Commands:: Commands for functions and similar entities.
-* Variables Commands:: Commands for variables and similar entities.
-* Typed Functions:: Commands for functions in typed languages.
-* Typed Variables:: Commands for variables in typed languages.
-* Abstract Objects:: Commands for object-oriented programming.
-* Data Types:: The definition command for data types.
-
-Footnotes
-
-* Footnote Commands:: How to write a footnote in Texinfo.
-* Footnote Styles:: Controlling how footnotes appear in Info.
-
-Conditionally Visible Text
-
-* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}.
-* Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}.
-* Raw Formatter Commands:: Using raw @TeX{} or HTML commands.
-* set clear value:: Designating which text to format (for
- all output formats); and how to set a
- flag to a string that you can insert.
-
-@code{@@set}, @code{@@clear}, and @code{@@value}
-
-* ifset ifclear:: Format a region if a flag is set.
-* value:: Replace a flag with a string.
-* value Example:: An easy way to update edition information.
-
-Macros: Defining New Texinfo Commands
-
-* Defining Macros:: Both defining and undefining new commands.
-* Invoking Macros:: Using a macro, once you've defined it.
-
-Format and Print Hardcopy
-
-* Use TeX:: Use @TeX{} to format for hardcopy.
-* Format with tex/texindex:: How to format in a shell.
-* Format with texi2dvi:: A simpler way to use the shell.
-* Print with lpr:: How to print.
-* Within Emacs:: How to format and print from an Emacs shell.
-* Texinfo Mode Printing:: How to format and print in Texinfo mode.
-* Compile-Command:: How to print using Emacs's compile command.
-* Requirements Summary:: @TeX{} formatting requirements summary.
-* Preparing for TeX:: What you need to do to use @TeX{}.
-* Overfull hboxes:: What are and what to do with overfull hboxes.
-* smallbook:: How to print small format books and manuals.
-* A4 Paper:: How to print on European A4 paper.
-* Cropmarks and Magnification:: How to print marks to indicate the size
- of pages and how to print scaled up output.
-
-Creating an Info File
-
-* makeinfo advantages:: @code{makeinfo} provides better error checking.
-* Invoking makeinfo:: How to run @code{makeinfo} from a shell.
-* makeinfo options:: Specify fill-column and other options.
-* Pointer Validation:: How to check that pointers point somewhere.
-* makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
-* texinfo-format commands:: Two Info formatting commands written
- in Emacs Lisp are an alternative
- to @code{makeinfo}.
-* Batch Formatting:: How to format for Info in Emacs Batch mode.
-* Tag and Split Files:: How tagged and split files help Info
- to run better.
-
-Installing an Info File
-
-* Directory file:: The top level menu for all Info files.
-* New Info File:: Listing a new info file.
-* Other Info Directories:: How to specify Info files that are
- located in other directories.
-* Installing Dir Entries:: How to specify what menu entry to add
- to the Info directory.
-* Invoking install-info:: @code{install-info} options.
-
-Sample Permissions
-
-* Inserting Permissions:: How to put permissions in your document.
-* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
-* Titlepage Permissions:: Sample Titlepage copying permissions.
-
-Include Files
-
-* Using Include Files:: How to use the @code{@@include} command.
-* texinfo-multiple-files-update:: How to create and update nodes and
- menus when using included files.
-* Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
-* Sample Include File:: A sample outer file with included files
- within it; and a sample included file.
-* Include Files Evolution:: How use of the @code{@@include} command
- has changed over time.
-
-Page Headings
-
-* Headings Introduced:: Conventions for using page headings.
-* Heading Format:: Standard page heading formats.
-* Heading Choice:: How to specify the type of page heading.
-* Custom Headings:: How to create your own headings and footings.
-
-Formatting Mistakes
-
-* makeinfo Preferred:: @code{makeinfo} finds errors.
-* Debugging with Info:: How to catch errors with Info formatting.
-* Debugging with TeX:: How to catch errors with @TeX{} formatting.
-* Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
-* Using occur:: How to list all lines containing a pattern.
-* Running Info-Validate:: How to find badly referenced nodes.
-
-Finding Badly Referenced Nodes
-
-* Using Info-validate:: How to run @code{Info-validate}.
-* Unsplit:: How to create an unsplit file.
-* Tagifying:: How to tagify a file.
-* Splitting:: How to split a file manually.
-
-How to Obtain @TeX{}
-
-* New Texinfo Mode Commands:: The updating commands are especially useful.
-* New Commands:: Many newly described @@-commands.
-@end detailmenu
-@end menu
-
-@node Copying, Overview, Top, Top
-@comment node-name, next, previous, up
-@unnumbered Texinfo Copying Conditions
-@cindex Copying conditions
-@cindex Conditions for copying Texinfo
-
-The programs currently being distributed that relate to Texinfo include
-portions of GNU Emacs, plus other separate programs (including
-@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}).
-These programs are @dfn{free}; this means that everyone is free to use
-them and free to redistribute them on a free basis. The Texinfo-related
-programs are not in the public domain; they are copyrighted and there
-are restrictions on their distribution, but these restrictions are
-designed to permit everything that a good cooperating citizen would want
-to do. What is not allowed is to try to prevent others from further
-sharing any version of these programs that they might get from
-you.@refill
-
- Specifically, we want to make sure that you have the right to give
-away copies of the programs that relate to Texinfo, that you receive
-source code or else can get it if you want it, that you can change these
-programs or use pieces of them in new free programs, and that you know
-you can do these things.@refill
-
- To make sure that everyone has such rights, we have to forbid you to
-deprive anyone else of these rights. For example, if you distribute
-copies of the Texinfo related programs, you must give the recipients all
-the rights that you have. You must make sure that they, too, receive or
-can get the source code. And you must tell them their rights.@refill
-
- Also, for our own protection, we must make certain that everyone finds
-out that there is no warranty for the programs that relate to Texinfo.
-If these programs are modified by someone else and passed on, we want
-their recipients to know that what they have is not what we distributed,
-so that any problems introduced by others will not reflect on our
-reputation.@refill
-
- The precise conditions of the licenses for the programs currently
-being distributed that relate to Texinfo are found in the General Public
-Licenses that accompany them.@refill
-
-@node Overview, Texinfo Mode, Copying, Top
-@comment node-name, next, previous, up
-@chapter Overview of Texinfo
-@cindex Overview of Texinfo
-@cindex Texinfo overview
-
-@dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' is
-pronounced like ``speck'', not ``hex''. This odd pronunciation is
-derived from, but is not the same as, the pronunciation of @TeX{}. In
-the word @TeX{}, the @samp{X} is actually the Greek letter ``chi''
-rather than the English letter ``ex''. Pronounce @TeX{} as if the
-@samp{X} were the last sound in the name `Bach'; but pronounce Texinfo
-as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T''
-and write the other letters in lower case.}
-is a documentation system that uses a single source file to produce both
-on-line information and printed output. This means that instead of
-writing two different documents, one for the on-line help or other on-line
-information and the other for a typeset manual or other printed work, you
-need write only one document. When the work is revised, you need revise
-only one document. (You can read the on-line information, known as an
-@dfn{Info file}, with an Info documentation-reading program.)@refill
-
-@menu
-* Using Texinfo:: Create a conventional printed book
- or an Info file.
-* Info Files:: What is an Info file?
-* Printed Books:: Characteristics of a printed book or manual.
-* Formatting Commands:: @@-commands are used for formatting.
-* Conventions:: General rules for writing a Texinfo file.
-* Comments:: How to write comments and mark regions that
- the formatting commands will ignore.
-* Minimum:: What a Texinfo file must have.
-* Six Parts:: Usually, a Texinfo file has six parts.
-* Short Sample:: A short sample Texinfo file.
-* Acknowledgements::
-@end menu
-
-@node Using Texinfo, Info Files, Overview, Overview
-@ifinfo
-@heading Using Texinfo
-@end ifinfo
-
-Using Texinfo, you can create a printed document with the normal
-features of a book, including chapters, sections, cross references,
-and indices. From the same Texinfo source file, you can create a
-menu-driven, on-line Info file with nodes, menus, cross references,
-and indices. You can, if you wish, make the chapters and sections of
-the printed document correspond to the nodes of the on-line
-information; and you use the same cross references and indices for
-both the Info file and the printed work. @cite{The GNU
-Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill
-
-To make a printed document, you process a Texinfo source file with the
-@TeX{} typesetting program. This creates a DVI file that you can
-typeset and print as a book or report. (Note that the Texinfo language
-is completely different from @TeX{}'s usual language, plain @TeX{}.) If
-you do not have @TeX{}, but do have @code{troff} or @code{nroff}, you
-can use the @code{texi2roff} program instead.@refill
-
-To make an Info file, you process a Texinfo source file with the
-@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;
-this creates an Info file that you can install on-line.@refill
-
-@TeX{} and @code{texi2roff} work with many types of printers; similarly,
-Info works with almost every type of computer terminal. This power
-makes Texinfo a general purpose system, but brings with it a constraint,
-which is that a Texinfo file may contain only the customary
-``typewriter'' characters (letters, numbers, spaces, and punctuation
-marks) but no special graphics.@refill
-
-A Texinfo file is a plain @sc{ascii} file containing text and
-@dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
-typesetting and formatting programs what to do. You may edit a
-Texinfo file with any text editor; but it is especially convenient to
-use GNU Emacs since that editor has a special mode, called Texinfo
-mode, that provides various Texinfo-related features. (@xref{Texinfo
-Mode}.)@refill
-
-Before writing a Texinfo source file, you should become familiar with
-the Info documentation reading program and learn about nodes,
-menus, cross references, and the rest. (@inforef{Top, info, info},
-for more information.)@refill
-
-You can use Texinfo to create both on-line help and printed manuals;
-moreover, Texinfo is freely redistributable. For these reasons, Texinfo
-is the format in which documentation for GNU utilities and libraries is
-written.@refill
-
-@node Info Files, Printed Books, Using Texinfo, Overview
-@comment node-name, next, previous, up
-@section Info files
-@cindex Info files
-
-An Info file is a Texinfo file formatted so that the Info documentation
-reading program can operate on it. (@code{makeinfo}
-and @code{texinfo-format-buffer} are two commands that convert a Texinfo file
-into an Info file.)@refill
-
-Info files are divided into pieces called @dfn{nodes}, each of which
-contains the discussion of one topic. Each node has a name, and
-contains both text for the user to read and pointers to other nodes,
-which are identified by their names. The Info program displays one node
-at a time, and provides commands with which the user can move to other
-related nodes.@refill
-
-@ifinfo
-@inforef{Top, info, info}, for more information about using Info.@refill
-@end ifinfo
-
-Each node of an Info file may have any number of child nodes that
-describe subtopics of the node's topic. The names of child
-nodes are listed in a @dfn{menu} within the parent node; this
-allows you to use certain Info commands to move to one of the child
-nodes. Generally, an Info file is organized like a book. If a node
-is at the logical level of a chapter, its child nodes are at the level
-of sections; likewise, the child nodes of sections are at the level
-of subsections.@refill
-
-All the children of any one parent are linked together in a
-bidirectional chain of `Next' and `Previous' pointers. The `Next'
-pointer provides a link to the next section, and the `Previous' pointer
-provides a link to the previous section. This means that all the nodes
-that are at the level of sections within a chapter are linked together.
-Normally the order in this chain is the same as the order of the
-children in the parent's menu. Each child node records the parent node
-name as its `Up' pointer. The last child has no `Next' pointer, and the
-first child has the parent both as its `Previous' and as its `Up'
-pointer.@footnote{In some documents, the first child has no `Previous'
-pointer. Occasionally, the last child has the node name of the next
-following higher level node as its `Next' pointer.}@refill
-
-The book-like structuring of an Info file into nodes that correspond
-to chapters, sections, and the like is a matter of convention, not a
-requirement. The `Up', `Previous', and `Next' pointers of a node can
-point to any other nodes, and a menu can contain any other nodes.
-Thus, the node structure can be any directed graph. But it is usually
-more comprehensible to follow a structure that corresponds to the
-structure of chapters and sections in a printed book or report.@refill
-
-In addition to menus and to `Next', `Previous', and `Up' pointers, Info
-provides pointers of another kind, called references, that can be
-sprinkled throughout the text. This is usually the best way to
-represent links that do not fit a hierarchical structure.@refill
-
-Usually, you will design a document so that its nodes match the
-structure of chapters and sections in the printed output. But
-occasionally there are times when this is not right for the material
-being discussed. Therefore, Texinfo uses separate commands to specify
-the node structure for the Info file and the section structure for the
-printed output.@refill
-
-Generally, you enter an Info file through a node that by convention is
-named `Top'. This node normally contains just a brief summary of the
-file's purpose, and a large menu through which the rest of the file is
-reached. From this node, you can either traverse the file
-systematically by going from node to node, or you can go to a specific
-node listed in the main menu, or you can search the index menus and then
-go directly to the node that has the information you want. Alternatively,
-with the standalone Info program, you can specify specific menu items on
-the command line (@pxref{Top,,, info, Info}).
-
-If you want to read through an Info file in sequence, as if it were a
-printed manual, you can hit @key{SPC} repeatedly, or you get the whole
-file with the advanced Info command @kbd{g *}. (@inforef{Expert,
-Advanced Info commands, info}.)@refill
-
-@c !!! dir file may be located in one of many places:
-@c /usr/local/emacs/info mentioned in info.c DEFAULT_INFOPATH
-@c /usr/local/lib/emacs/info mentioned in info.c DEFAULT_INFOPATH
-@c /usr/gnu/info mentioned in info.c DEFAULT_INFOPATH
-@c /usr/local/info
-@c /usr/local/lib/info
-The @file{dir} file in the @file{info} directory serves as the
-departure point for the whole Info system. From it, you can reach the
-`Top' nodes of each of the documents in a complete Info system.@refill
-
-@node Printed Books, Formatting Commands, Info Files, Overview
-@comment node-name, next, previous, up
-@section Printed Books
-@cindex Printed book and manual characteristics
-@cindex Manual characteristics, printed
-@cindex Book characteristics, printed
-@cindex Texinfo printed book characteristics
-@cindex Characteristics, printed books or manuals
-
-@cindex Knuth, Donald
-A Texinfo file can be formatted and typeset as a printed book or manual.
-To do this, you need @TeX{}, a powerful, sophisticated typesetting
-program written by Donald Knuth.@footnote{You can also use the
-@code{texi2roff} program if you do not have @TeX{}; since Texinfo is
-designed for use with @TeX{}, @code{texi2roff} is not described here.
-@code{texi2roff} is not part of the standard GNU distribution.}
-
-A Texinfo-based book is similar to any other typeset, printed work: it
-can have a title page, copyright page, table of contents, and preface,
-as well as chapters, numbered or unnumbered sections and subsections,
-page headers, cross references, footnotes, and indices.@refill
-
-You can use Texinfo to write a book without ever having the intention
-of converting it into on-line information. You can use Texinfo for
-writing a printed novel, and even to write a printed memo, although
-this latter application is not recommended since electronic mail is so
-much easier.@refill
-
-@TeX{} is a general purpose typesetting program. Texinfo provides a
-file called @file{texinfo.tex} that contains information (definitions or
-@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
-(@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
-to @TeX{} commands, which @TeX{} can then process to create the typeset
-document.) @file{texinfo.tex} contains the specifications for printing
-a document.@refill
-
-Most often, documents are printed on 8.5 inch by 11 inch
-pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you
-can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
-235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper
-(@code{@@afourpaper}). (@xref{smallbook, , Printing ``Small'' Books}.
-Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@refill
-
-By changing the parameters in @file{texinfo.tex}, you can change the
-size of the printed document. In addition, you can change the style in
-which the printed document is formatted; for example, you can change the
-sizes and fonts used, the amount of indentation for each paragraph, the
-degree to which words are hyphenated, and the like. By changing the
-specifications, you can make a book look dignified, old and serious, or
-light-hearted, young and cheery.@refill
-
-@TeX{} is freely distributable. It is written in a superset of Pascal
-called WEB and can be compiled either in Pascal or (by using a
-conversion program that comes with the @TeX{} distribution) in C.
-(@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information
-about @TeX{}.)@refill
-
-@TeX{} is very powerful and has a great many features. Because a
-Texinfo file must be able to present information both on a
-character-only terminal in Info form and in a typeset book, the
-formatting commands that Texinfo supports are necessarily
-limited.@refill
-
-@xref{Obtaining TeX, , How to Obtain @TeX{}}.
-
-
-@node Formatting Commands, Conventions, Printed Books, Overview
-@comment node-name, next, previous, up
-@section @@-commands
-@cindex @@-commands
-@cindex Formatting commands
-
-In a Texinfo file, the commands that tell @TeX{} how to typeset the
-printed manual and tell @code{makeinfo} and
-@code{texinfo-format-buffer} how to create an Info file are preceded
-by @samp{@@}; they are called @dfn{@@-commands}. For example,
-@code{@@node} is the command to indicate a node and @code{@@chapter}
-is the command to indicate the start of a chapter.@refill
-
-@quotation
-@strong{Please note:} All the @@-commands, with the exception of the
-@code{@@TeX@{@}} command, must be written entirely in lower
-case.@refill
-@end quotation
-
-The Texinfo @@-commands are a strictly limited set of constructs. The
-strict limits make it possible for Texinfo files to be understood both
-by @TeX{} and by the code that converts them into Info files. You can
-display Info files on any terminal that displays alphabetic and
-numeric characters. Similarly, you can print the output generated by
-@TeX{} on a wide variety of printers.@refill
-
-Depending on what they do or what arguments@footnote{The word
-@dfn{argument} comes from the way it is used in mathematics and does
-not refer to a disputation between two people; it refers to the
-information presented to the command. According to the @cite{Oxford
-English Dictionary}, the word derives from the Latin for @dfn{to make
-clear, prove}; thus it came to mean `the evidence offered as proof',
-which is to say, `the information offered', which led to its
-mathematical meaning. In its other thread of derivation, the word
-came to mean `to assert in a manner against which others may make
-counter assertions', which led to the meaning of `argument' as a
-disputation.} they take, you need to write @@-commands on lines of
-their own or as part of sentences:@refill
-
-@itemize @bullet
-@item
-Write a command such as @code{@@noindent} at the beginning of a line as
-the only text on the line. (@code{@@noindent} prevents the beginning of
-the next line from being indented as the beginning of a
-paragraph.)@refill
-
-@item
-Write a command such as @code{@@chapter} at the beginning of a line
-followed by the command's arguments, in this case the chapter title, on
-the rest of the line. (@code{@@chapter} creates chapter titles.)@refill
-
-@item
-Write a command such as @code{@@dots@{@}} wherever you wish but usually
-within a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill
-
-@item
-Write a command such as @code{@@code@{@var{sample-code}@}} wherever you
-wish (but usually within a sentence) with its argument,
-@var{sample-code} in this example, between the braces. (@code{@@code}
-marks text as being code.)@refill
-
-@item
-Write a command such as @code{@@example} at the beginning of a line of
-its own; write the body-text on following lines; and write the matching
-@code{@@end} command, @code{@@end example} in this case, at the
-beginning of a line of its own after the body-text. (@code{@@example}
-@dots{} @code{@@end example} indents and typesets body-text as an
-example.)@refill
-@end itemize
-
-@noindent
-@cindex Braces, when to use
-As a general rule, a command requires braces if it mingles among other
-text; but it does not need braces if it starts a line of its own. The
-non-alphabetic commands, such as @code{@@:}, are exceptions to the rule;
-they do not need braces.@refill
-
-As you gain experience with Texinfo, you will rapidly learn how to
-write the different commands: the different ways to write commands
-make it easier to write and read Texinfo files than if all commands
-followed exactly the same syntax. (For details about @@-command
-syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill
-
-@node Conventions, Comments, Formatting Commands, Overview
-@comment node-name, next, previous, up
-@section General Syntactic Conventions
-@cindex General syntactic conventions
-@cindex Syntactic conventions
-@cindex Conventions, syntactic
-
-All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and
-@samp{@}} can appear in a Texinfo file and stand for themselves.
-@samp{@@} is the escape character which introduces commands.
-@samp{@{} and @samp{@}} should be used only to surround arguments to
-certain commands. To put one of these special characters into the
-document, put an @samp{@@} character in front of it, like this:
-@samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill
-
-@ifinfo
-It is customary in @TeX{} to use doubled single-quote characters to
-begin and end quotations: ` ` and ' ' (but without a space between the
-two single-quote characters). This convention should be followed in
-Texinfo files. @TeX{} converts doubled single-quote characters to
-left- and right-hand doubled quotation marks and Info converts doubled
-single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill
-@end ifinfo
-@iftex
-It is customary in @TeX{} to use doubled single-quote characters to
-begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}. This
-convention should be followed in Texinfo files. @TeX{} converts
-doubled single-quote characters to left- and right-hand doubled
-quotation marks, ``like this'', and Info converts doubled single-quote
-characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and
-@w{@tt{ '' }} to @w{@tt{ " }}.@refill
-@end iftex
-
-Use three hyphens in a row, @samp{---}, for a dash---like this. In
-@TeX{}, a single or double hyphen produces a printed dash that is
-shorter than the usual typeset dash. Info reduces three hyphens to two
-for display on the screen.
-
-To prevent a paragraph from being indented in the printed manual, put
-the command @code{@@noindent} on a line by itself before the
-paragraph.@refill
-
-If you mark off a region of the Texinfo file with the @code{@@iftex}
-and @w{@code{@@end iftex}} commands, that region will appear only in
-the printed copy; in that region, you can use certain commands
-borrowed from plain @TeX{} that you cannot use in Info. Likewise, if
-you mark off a region with the @code{@@ifinfo} and @code{@@end ifinfo}
-commands, that region will appear only in the Info file; in that
-region, you can use Info commands that you cannot use in @TeX{}.
-Similarly for @code{@@ifhtml @dots{} @@end ifhtml},
-@code{@@ifnothtml @dots{} @@end ifnothtml},
-@code{@@ifnotinfo @dots{} @@end ifnotinfo},
-@code{@@ifnottex @dots{} @@end ifnottex},
-@xref{Conditionals}.
-
-@cindex Tabs; don't use!
-@quotation
-@strong{Caution:} Do not use tabs in a Texinfo file! @TeX{} uses
-variable-width fonts, which means that it cannot predefine a tab to work
-in all circumstances. Consequently, @TeX{} treats tabs like single
-spaces, and that is not what they look like. Furthermore,
-@code{makeinfo} does nothing special with tabs, and thus a tab character
-in your input file may appear differently in the output.
-
-@noindent
-To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple
-spaces when you press the @key{TAB} key.@refill
-
-@noindent
-Also, you can run @code{untabify} in Emacs to convert tabs in a region
-to multiple spaces.@refill
-
-@noindent
-Don't use tabs.
-@end quotation
-
-@node Comments, Minimum, Conventions, Overview
-@comment node-name, next, previous, up
-@section Comments
-
-You can write comments in a Texinfo file that will not appear in
-either the Info file or the printed manual by using the
-@code{@@comment} command (which may be abbreviated to @code{@@c}).
-Such comments are for the person who reads the Texinfo file. All the
-text on a line that follows either @code{@@comment} or @code{@@c} is a
-comment; the rest of the line does not appear in either the Info file
-or the printed manual. (Often, you can write the @code{@@comment} or
-@code{@@c} in the middle of a line, and only the text that follows after
-the @code{@@comment} or @code{@@c} command does not appear; but some
-commands, such as @code{@@settitle} and @code{@@setfilename}, work on a
-whole line. You cannot use @code{@@comment} or @code{@@c} in a line
-beginning with such a command.)@refill
-@cindex Comments
-@findex comment
-@findex c @r{(comment)}
-
-You can write long stretches of text that will not appear in either
-the Info file or the printed manual by using the @code{@@ignore} and
-@code{@@end ignore} commands. Write each of these commands on a line
-of its own, starting each command at the beginning of the line. Text
-between these two commands does not appear in the processed output.
-You can use @code{@@ignore} and @code{@@end ignore} for writing
-comments. Often, @code{@@ignore} and @code{@@end ignore} is used
-to enclose a part of the copying permissions that applies to the
-Texinfo source file of a document, but not to the Info or printed
-version of the document.@refill
-@cindex Ignored text
-@cindex Unprocessed text
-@findex ignore
-@c !!! Perhaps include this comment about ignore and ifset:
-@ignore
-Text enclosed by @code{@@ignore} or by failing @code{@@ifset} or
-@code{@@ifclear} conditions is ignored in the sense that it will not
-contribute to the formatted output. However, TeX and makeinfo must
-still parse the ignored text, in order to understand when to
-@emph{stop} ignoring text from the source file; that means that you
-will still get error messages if you have invalid Texinfo markup
-within ignored text.
-@end ignore
-
-@node Minimum, Six Parts, Comments, Overview
-@comment node-name, next, previous, up
-@section What a Texinfo File Must Have
-@cindex Minimal Texinfo file (requirements)
-@cindex Must have in Texinfo file
-@cindex Required in Texinfo file
-@cindex Texinfo file minimum
-
-By convention, the names of Texinfo files end with one of the
-extensions @file{.texinfo}, @file{.texi}, or @file{.tex}. The longer
-extension is preferred since it describes more clearly to a human
-reader the nature of the file. The shorter extensions are for
-operating systems that cannot handle long file names.@refill
-
-In order to be made into a printed manual and an Info file, a Texinfo
-file @strong{must} begin with lines like this:@refill
-
-@example
-@group
-\input texinfo
-@@setfilename @var{info-file-name}
-@@settitle @var{name-of-manual}
-@end group
-@end example
-
-@noindent
-The contents of the file follow this beginning, and then you @strong{must} end
-a Texinfo file with a line like this:@refill
-
-@example
-@@bye
-@end example
-
-@findex input @r{(@TeX{} command)}
-@noindent
-The @samp{\input texinfo} line tells @TeX{} to use the
-@file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
-@@-commands into @TeX{} typesetting commands. (Note the use of the
-backslash, @samp{\}; this is correct for @TeX{}.) The
-@samp{@@setfilename} line provides a name for the Info file and tells
-@TeX{} to open auxiliary files. The @samp{@@settitle} line specifies a
-title for the page headers (or footers) of the printed manual.@refill
-
-The @code{@@bye} line at the end of the file on a line of its own tells
-the formatters that the file is ended and to stop formatting.@refill
-
-Usually, you will not use quite such a spare format, but will include
-mode setting and start-of-header and end-of-header lines at the
-beginning of a Texinfo file, like this:@refill
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename @var{info-file-name}
-@@settitle @var{name-of-manual}
-@@c %**end of header
-@end group
-@end example
-
-@noindent
-In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into
-Texinfo mode when you edit the file.
-
-The @code{@@c} lines which surround the @samp{@@setfilename} and
-@samp{@@settitle} lines are optional, but you need them in order to
-run @TeX{} or Info on just part of the file. (@xref{Start of Header},
-for more information.)@refill
-
-Furthermore, you will usually provide a Texinfo file with a title
-page, indices, and the like. But the minimum, which can be useful
-for short documents, is just the three lines at the beginning and the
-one line at the end.@refill
-
-@node Six Parts, Short Sample, Minimum, Overview
-@comment node-name, next, previous, up
-@section Six Parts of a Texinfo File
-
-Generally, a Texinfo file contains more than the minimal
-beginning and end---it usually contains six parts:@refill
-
-@table @r
-@item 1. Header
-The @dfn{Header} names the file, tells @TeX{} which definitions' file to
-use, and performs other ``housekeeping'' tasks.@refill
-
-@item 2. Summary Description and Copyright
-The @dfn{Summary Description and Copyright} segment describes the document
-and contains the copyright notice and copying permissions for the Info
-file. The segment must be enclosed between @code{@@ifinfo} and
-@code{@@end ifinfo} commands so that the formatters place it only in the Info
-file.@refill
-
-@item 3. Title and Copyright
-The @dfn{Title and Copyright} segment contains the title and copyright pages
-and copying permissions for the printed manual. The segment must be
-enclosed between @code{@@titlepage} and @code{@@end titlepage} commands.
-The title and copyright page appear only in the printed @w{manual}.@refill
-
-@item 4. `Top' Node and Master Menu
-The @dfn{Master Menu} contains a complete menu of all the nodes in the whole
-Info file. It appears only in the Info file, in the `Top' node.@refill
-
-@item 5. Body
-The @dfn{Body} of the document may be structured like a traditional book or
-encyclopedia or it may be free form.@refill
-
-@item 6. End
-The @dfn{End} contains commands for printing indices and generating
-the table of contents, and the @code{@@bye} command on a line of its
-own.@refill
-@end table
-
-@node Short Sample, Acknowledgements, Six Parts, Overview
-@comment node-name, next, previous, up
-@section A Short Sample Texinfo File
-@cindex Sample Texinfo file
-
-Here is a complete but very short Texinfo file, in six parts. The first
-three parts of the file, from @samp{\input texinfo} through to
-@samp{@@end titlepage}, look more intimidating than they are. Most of
-the material is standard boilerplate; when you write a manual, simply
-insert the names for your own manual in this segment. (@xref{Beginning a
-File}.)@refill
-
-@noindent
-In the following, the sample text is @emph{indented}; comments on it are
-not. The complete file, without any comments, is shown in
-@ref{Sample Texinfo File}.
-
-@subheading Part 1: Header
-
-@noindent
-The header does not appear in either the Info file or the
-printed output. It sets various parameters, including the
-name of the Info file and the title used in the header.
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename sample.info
-@@settitle Sample Document
-@@c %**end of header
-
-@@setchapternewpage odd
-@end group
-@end example
-
-@subheading Part 2: Summary Description and Copyright
-
-@noindent
-The summary description and copyright segment does not
-appear in the printed document.
-
-@example
-@group
-@@ifinfo
-This is a short example of a complete Texinfo file.
-
-Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
-@@end ifinfo
-@end group
-@end example
-
-@subheading Part 3: Titlepage and Copyright
-
-@noindent
-The titlepage segment does not appear in the Info file.
-
-@example
-@group
-@@titlepage
-@@sp 10
-@@comment The title is printed in a large font.
-@@center @@titlefont@{Sample Title@}
-@end group
-
-@group
-@@c The following two commands start the copyright page.
-@@page
-@@vskip 0pt plus 1filll
-Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
-@@end titlepage
-@end group
-@end example
-
-@subheading Part 4: `Top' Node and Master Menu
-
-@noindent
-The `Top' node contains the master menu for the Info file.
-Since a printed manual uses a table of contents rather than
-a menu, the master menu appears only in the Info file.
-
-@example
-@group
-@@node Top, First Chapter, , (dir)
-@@comment node-name, next, previous, up
-@end group
-@end example
-
-@example
-@group
-@@menu
-* First Chapter:: The first chapter is the
- only chapter in this sample.
-* Concept Index:: This index has two entries.
-@@end menu
-@end group
-@end example
-
-@subheading Part 5: The Body of the Document
-
-@noindent
-The body segment contains all the text of the document, but not the
-indices or table of contents. This example illustrates a node and a
-chapter containing an enumerated list.@refill
-
-@example
-@group
-@@node First Chapter, Concept Index, Top, Top
-@@comment node-name, next, previous, up
-@@chapter First Chapter
-@@cindex Sample index entry
-@end group
-
-@group
-This is the contents of the first chapter.
-@@cindex Another sample index entry
-@end group
-
-@group
-Here is a numbered list.
-
-@@enumerate
-@@item
-This is the first item.
-
-@@item
-This is the second item.
-@@end enumerate
-@end group
-
-@group
-The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
-commands transform a Texinfo file such as this into
-an Info file; and @@TeX@{@} typesets it for a printed
-manual.
-@end group
-@end example
-
-@subheading Part 6: The End of the Document
-
-@noindent
-The end segment contains commands both for generating an index in a node
-and unnumbered chapter of its own and for generating the table of
-contents; and it contains the @code{@@bye} command that marks the end of
-the document.@refill
-
-@example
-@group
-@@node Concept Index, , First Chapter, Top
-@@comment node-name, next, previous, up
-@@unnumbered Concept Index
-@end group
-
-@group
-@@printindex cp
-
-@@contents
-@@bye
-@end group
-@end example
-
-@subheading The Results
-
-Here is what the contents of the first chapter of the sample look like:
-
-@sp 1
-@need 700
-@quotation
-This is the contents of the first chapter.
-
-Here is a numbered list.
-
-@enumerate
-@item
-This is the first item.
-
-@item
-This is the second item.
-@end enumerate
-
-The @code{makeinfo} and @code{texinfo-format-buffer}
-commands transform a Texinfo file such as this into
-an Info file; and @TeX{} typesets it for a printed
-manual.
-@end quotation
-
-@node Acknowledgements, , Short Sample, Overview
-@comment node-name, next, previous, up
-@section Acknowledgements
-
-@cindex Stallman, Richard M.
-@cindex Chassell, Robert J.
-@cindex Berry, Karl
-Richard M.@: Stallman wrote Edition 1.0 of this manual. @w{Robert J.@:
-Chassell} revised and extended it, starting with Edition 1.1. Karl
-Berry made updates for the Texinfo 3.8 and subsequent releases, starting
-with Edition 2.22.
-
-@cindex Pinard, Fran@,{c}ois
-@cindex Zuhn, David D.
-@cindex Weisshaus, Melissa
-Our thanks go out to all who helped improve this work, particularly to
-Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and
-reported mistakes and obscurities; our special thanks go to Melissa
-Weisshaus for her frequent and often tedious reviews of nearly similar
-editions. Our mistakes are our own.
-
-Please send suggestions and corrections to:
-
-@example
-@group
-@r{Internet address:}
- bug-texinfo@@gnu.org
-@end group
-@end example
-
-@noindent
-Please include the manual's edition number and update date in your messages.
-
-@node Texinfo Mode, Beginning a File, Overview, Top
-@comment node-name, next, previous, up
-@chapter Using Texinfo Mode
-@cindex Texinfo mode
-@cindex Mode, using Texinfo
-@cindex GNU Emacs
-@cindex Emacs
-
-You may edit a Texinfo file with any text editor you choose. A Texinfo
-file is no different from any other @sc{ascii} file. However, GNU Emacs
-comes with a special mode, called Texinfo
-mode, that provides Emacs commands and tools to help ease your work.@refill
-
-This chapter describes features of GNU Emacs' Texinfo mode but not any
-features of the Texinfo formatting language. If you are reading this
-manual straight through from the beginning, you may want to skim through
-this chapter briefly and come back to it after reading succeeding
-chapters which describe the Texinfo formatting language in
-detail.@refill
-
-@menu
-* Texinfo Mode Overview:: How Texinfo mode can help you.
-* Emacs Editing:: Texinfo mode adds to GNU Emacs' general
- purpose editing features.
-* Inserting:: How to insert frequently used @@-commands.
-* Showing the Structure:: How to show the structure of a file.
-* Updating Nodes and Menus:: How to update or create new nodes and menus.
-* Info Formatting:: How to format for Info.
-* Printing:: How to format and print part or all of a file.
-* Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
-@end menu
-
-@node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode
-@ifinfo
-@heading Texinfo Mode Overview
-@end ifinfo
-
-Texinfo mode provides special features for working with Texinfo
-files:@refill
-
-@itemize @bullet
-@item
-Insert frequently used @@-commands. @refill
-
-@item
-Automatically create @code{@@node} lines.
-
-@item
-Show the structure of a Texinfo source file.@refill
-
-@item
-Automatically create or update the `Next',
-`Previous', and `Up' pointers of a node.
-
-@item
-Automatically create or update menus.@refill
-
-@item
-Automatically create a master menu.@refill
-
-@item
-Format a part or all of a file for Info.@refill
-
-@item
-Typeset and print part or all of a file.@refill
-@end itemize
-
-Perhaps the two most helpful features are those for inserting frequently
-used @@-commands and for creating node pointers and menus.@refill
-
-@node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode
-@section The Usual GNU Emacs Editing Commands
-
-In most cases, the usual Text mode commands work the same in Texinfo
-mode as they do in Text mode. Texinfo mode adds new editing commands
-and tools to GNU Emacs' general purpose editing features. The major
-difference concerns filling. In Texinfo mode, the paragraph
-separation variable and syntax table are redefined so that Texinfo
-commands that should be on lines of their own are not inadvertently
-included in paragraphs. Thus, the @kbd{M-q} (@code{fill-paragraph})
-command will refill a paragraph but not mix an indexing command on a
-line adjacent to it into the paragraph.@refill
-
-In addition, Texinfo mode sets the @code{page-delimiter} variable to
-the value of @code{texinfo-chapter-level-regexp}; by default, this is
-a regular expression matching the commands for chapters and their
-equivalents, such as appendices. With this value for the page
-delimiter, you can jump from chapter title to chapter title with the
-@kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
-(@code{backward-page}) commands and narrow to a chapter with the
-@kbd{C-x p} (@code{narrow-to-page}) command. (@xref{Pages, , ,emacs,
-The GNU Emacs Manual}, for details about the page commands.)@refill
-
-You may name a Texinfo file however you wish, but the convention is to
-end a Texinfo file name with one of the three extensions
-@file{.texinfo}, @file{.texi}, or @file{.tex}. A longer extension is
-preferred, since it is explicit, but a shorter extension may be
-necessary for operating systems that limit the length of file names.
-GNU Emacs automatically enters Texinfo mode when you visit a file with
-a @file{.texinfo} or @file{.texi}
-extension. Also, Emacs switches to Texinfo mode
-when you visit a
-file that has @samp{-*-texinfo-*-} in its first line. If ever you are
-in another mode and wish to switch to Texinfo mode, type @code{M-x
-texinfo-mode}.@refill
-
-Like all other Emacs features, you can customize or enhance Texinfo
-mode as you wish. In particular, the keybindings are very easy to
-change. The keybindings described here are the default or standard
-ones.@refill
-
-@node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode
-@comment node-name, next, previous, up
-@section Inserting Frequently Used Commands
-@cindex Inserting frequently used commands
-@cindex Frequently used commands, inserting
-@cindex Commands, inserting them
-
-Texinfo mode provides commands to insert various frequently used
-@@-commands into the buffer. You can use these commands to save
-keystrokes.@refill
-
-The insert commands are invoked by typing @kbd{C-c} twice and then the
-first letter of the @@-command:@refill
-
-@table @kbd
-@item C-c C-c c
-@itemx M-x texinfo-insert-@@code
-@findex texinfo-insert-@@code
-Insert @code{@@code@{@}} and put the
-cursor between the braces.@refill
-
-@item C-c C-c d
-@itemx M-x texinfo-insert-@@dfn
-@findex texinfo-insert-@@dfn
-Insert @code{@@dfn@{@}} and put the
-cursor between the braces.@refill
-
-@item C-c C-c e
-@itemx M-x texinfo-insert-@@end
-@findex texinfo-insert-@@end
-Insert @code{@@end} and attempt to insert the correct following word,
-such as @samp{example} or @samp{table}. (This command does not handle
-nested lists correctly, but inserts the word appropriate to the
-immediately preceding list.)@refill
-
-@item C-c C-c i
-@itemx M-x texinfo-insert-@@item
-@findex texinfo-insert-@@item
-Insert @code{@@item} and put the
-cursor at the beginning of the next line.@refill
-
-@item C-c C-c k
-@itemx M-x texinfo-insert-@@kbd
-@findex texinfo-insert-@@kbd
-Insert @code{@@kbd@{@}} and put the
-cursor between the braces.@refill
-
-@item C-c C-c n
-@itemx M-x texinfo-insert-@@node
-@findex texinfo-insert-@@node
-Insert @code{@@node} and a comment line
-listing the sequence for the `Next',
-`Previous', and `Up' nodes.
-Leave point after the @code{@@node}.@refill
-
-@item C-c C-c o
-@itemx M-x texinfo-insert-@@noindent
-@findex texinfo-insert-@@noindent
-Insert @code{@@noindent} and put the
-cursor at the beginning of the next line.@refill
-
-@item C-c C-c s
-@itemx M-x texinfo-insert-@@samp
-@findex texinfo-insert-@@samp
-Insert @code{@@samp@{@}} and put the
-cursor between the braces.@refill
-
-@item C-c C-c t
-@itemx M-x texinfo-insert-@@table
-@findex texinfo-insert-@@table
-Insert @code{@@table} followed by a @key{SPC}
-and leave the cursor after the @key{SPC}.@refill
-
-@item C-c C-c v
-@itemx M-x texinfo-insert-@@var
-@findex texinfo-insert-@@var
-Insert @code{@@var@{@}} and put the
-cursor between the braces.@refill
-
-@item C-c C-c x
-@itemx M-x texinfo-insert-@@example
-@findex texinfo-insert-@@example
-Insert @code{@@example} and put the
-cursor at the beginning of the next line.@refill
-
-@c M-@{ was the binding for texinfo-insert-braces;
-@c in Emacs 19, backward-paragraph will take this binding.
-@item C-c C-c @{
-@itemx M-x texinfo-insert-braces
-@findex texinfo-insert-braces
-Insert @code{@{@}} and put the cursor between the braces.@refill
-
-@item C-c C-c @}
-@itemx C-c C-c ]
-@itemx M-x up-list
-@findex up-list
-Move from between a pair of braces forward past the closing brace.
-Typing @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which
-is, however, more mnemonic; hence the two keybindings. (Also, you can
-move out from between braces by typing @kbd{C-f}.)@refill
-@end table
-
-To put a command such as @w{@code{@@code@{@dots{}@}}} around an
-@emph{existing} word, position the cursor in front of the word and type
-@kbd{C-u 1 C-c C-c c}. This makes it easy to edit existing plain text.
-The value of the prefix argument tells Emacs how many words following
-point to include between braces---@samp{1} for one word, @samp{2} for
-two words, and so on. Use a negative argument to enclose the previous
-word or words. If you do not specify a prefix argument, Emacs inserts
-the @@-command string and positions the cursor between the braces. This
-feature works only for those @@-commands that operate on a word or words
-within one line, such as @code{@@kbd} and @code{@@var}.@refill
-
-This set of insert commands was created after analyzing the frequency
-with which different @@-commands are used in the @cite{GNU Emacs
-Manual} and the @cite{GDB Manual}. If you wish to add your own insert
-commands, you can bind a keyboard macro to a key, use abbreviations,
-or extend the code in @file{texinfo.el}.@refill
-
-@findex texinfo-start-menu-description
-@cindex Menu description, start
-@cindex Description for menu, start
-@kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
-command that works differently from the other insert commands. It
-inserts a node's section or chapter title in the space for the
-description in a menu entry line. (A menu entry has three parts, the
-entry name, the node name, and the description. Only the node name is
-required, but a description helps explain what the node is about.
-@xref{Menu Parts, , The Parts of a Menu}.)@refill
-
-To use @code{texinfo-start-menu-description}, position point in a menu
-entry line and type @kbd{C-c C-c C-d}. The command looks for and copies
-the title that goes with the node name, and inserts the title as a
-description; it positions point at beginning of the inserted text so you
-can edit it. The function does not insert the title if the menu entry
-line already contains a description.@refill
-
-This command is only an aid to writing descriptions; it does not do the
-whole job. You must edit the inserted text since a title tends to use
-the same words as a node name but a useful description uses different
-words.@refill
-
-@node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode
-@comment node-name, next, previous, up
-@section Showing the Section Structure of a File
-@cindex Showing the section structure of a file
-@cindex Section structure of a file, showing it
-@cindex Structure of a file, showing it
-@cindex Outline of file structure, showing it
-@cindex Contents-like outline of file structure
-@cindex File section structure, showing it
-@cindex Texinfo file section structure, showing it
-
-You can show the section structure of a Texinfo file by using the
-@kbd{C-c C-s} command (@code{texinfo-show-structure}). This command
-shows the section structure of a Texinfo file by listing the lines
-that begin with the @@-commands for @code{@@chapter},
-@code{@@section}, and the like. It constructs what amounts
-to a table of contents. These lines are displayed in another buffer
-called the @samp{*Occur*} buffer. In that buffer, you can position
-the cursor over one of the lines and use the @kbd{C-c C-c} command
-(@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
-in the Texinfo file.@refill
-
-@table @kbd
-@item C-c C-s
-@itemx M-x texinfo-show-structure
-@findex texinfo-show-structure
-Show the @code{@@chapter}, @code{@@section}, and such lines of a
-Texinfo file.@refill
-
-@item C-c C-c
-@itemx M-x occur-mode-goto-occurrence
-@findex occur-mode-goto-occurrence
-Go to the line in the Texinfo file corresponding to the line under the
-cursor in the @file{*Occur*} buffer.@refill
-@end table
-
-If you call @code{texinfo-show-structure} with a prefix argument by
-typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
-@@-commands for @code{@@chapter}, @code{@@section}, and the like,
-but also the @code{@@node} lines. (This is how the
-@code{texinfo-show-structure} command worked without an argument in
-the first version of Texinfo. It was changed because @code{@@node}
-lines clutter up the @samp{*Occur*} buffer and are usually not
-needed.) You can use @code{texinfo-show-structure} with a prefix
-argument to check whether the `Next', `Previous', and `Up' pointers of
-an @code{@@node} line are correct.@refill
-
-Often, when you are working on a manual, you will be interested only
-in the structure of the current chapter. In this case, you can mark
-off the region of the buffer that you are interested in by using the
-@kbd{C-x n n} (@code{narrow-to-region}) command and
-@code{texinfo-show-structure} will work on only that region. To see
-the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
-(@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
-information about the narrowing commands.)@refill
-
-@vindex page-delimiter
-@cindex Page delimiter in Texinfo mode
-In addition to providing the @code{texinfo-show-structure} command,
-Texinfo mode sets the value of the page delimiter variable to match
-the chapter-level @@-commands. This enables you to use the @kbd{C-x
-]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
-commands to move forward and backward by chapter, and to use the
-@kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter.
-@xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
-about the page commands.@refill
-
-@node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode
-@comment node-name, next, previous, up
-@section Updating Nodes and Menus
-@cindex Updating nodes and menus
-@cindex Create nodes, menus automatically
-@cindex Insert nodes, menus automatically
-@cindex Automatically insert nodes, menus
-
-Texinfo mode provides commands for automatically creating or updating
-menus and node pointers. The commands are called ``update'' commands
-because their most frequent use is for updating a Texinfo file after
-you have worked on it; but you can use them to insert the `Next',
-`Previous', and `Up' pointers into an @code{@@node} line that has none and to
-create menus in a file that has none.@refill
-
-If you do not use the updating commands, you need to write menus and
-node pointers by hand, which is a tedious task.@refill
-
-@menu
-* Updating Commands:: Five major updating commands.
-* Updating Requirements:: How to structure a Texinfo file for
- using the updating command.
-* Other Updating Commands:: How to indent descriptions, insert
- missing nodes lines, and update
- nodes in sequence.
-@end menu
-
-@node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus
-@ifinfo
-@subheading The Updating Commands
-@end ifinfo
-
-You can use the updating commands@refill
-
-@itemize @bullet
-@item
-to insert or update the `Next', `Previous', and `Up' pointers of a
-node,@refill
-
-@item
-to insert or update the menu for a section, and@refill
-
-@item
-to create a master menu for a Texinfo source file.@refill
-@end itemize
-
-You can also use the commands to update all the nodes and menus in a
-region or in a whole Texinfo file.@refill
-
-The updating commands work only with conventional Texinfo files, which
-are structured hierarchically like books. In such files, a structuring
-command line must follow closely after each @code{@@node} line, except
-for the `Top' @code{@@node} line. (A @dfn{structuring command line} is
-a line beginning with @code{@@chapter}, @code{@@section}, or other
-similar command.)
-
-You can write the structuring command line on the line that follows
-immediately after an @code{@@node} line or else on the line that
-follows after a single @code{@@comment} line or a single
-@code{@@ifinfo} line. You cannot interpose more than one line between
-the @code{@@node} line and the structuring command line; and you may
-interpose only an @code{@@comment} line or an @code{@@ifinfo} line.
-
-Commands which work on a whole buffer require that the `Top' node be
-followed by a node with an @code{@@chapter} or equivalent-level command.
-Note that the menu updating commands will not create a main or master
-menu for a Texinfo file that has only @code{@@chapter}-level nodes! The
-menu updating commands only create menus @emph{within} nodes for lower level
-nodes. To create a menu of chapters, you must provide a `Top'
-node.@refill
-
-The menu updating commands remove menu entries that refer to other Info
-files since they do not refer to nodes within the current buffer. This
-is a deficiency. Rather than use menu entries, you can use cross
-references to refer to other Info files. None of the updating commands
-affect cross references.@refill
-
-Texinfo mode has five updating commands that are used most often: two
-are for updating the node pointers or menu of a single node (or a
-region); two are for updating every node pointer and menu in a file;
-and one, the @code{texinfo-master-menu} command, is for creating a
-master menu for a complete file, and optionally, for updating every
-node and menu in the whole Texinfo file.@refill
-
-The @code{texinfo-master-menu} command is the primary command:@refill
-
-@table @kbd
-@item C-c C-u m
-@itemx M-x texinfo-master-menu
-@findex texinfo-master-menu
-Create or update a master menu that includes all the other menus
-(incorporating the descriptions from pre-existing menus, if
-any).@refill
-
-With an argument (prefix argument, @kbd{C-u,} if interactive), first create or
-update all the nodes and all the regular menus in the buffer before
-constructing the master menu. (@xref{The Top Node, , The Top Node and
-Master Menu}, for more about a master menu.)@refill
-
-For @code{texinfo-master-menu} to work, the Texinfo file must have a
-`Top' node and at least one subsequent node.@refill
-
-After extensively editing a Texinfo file, you can type the following:
-
-@example
-C-u M-x texinfo-master-menu
-@exdent or
-C-u C-c C-u m
-@end example
-
-@noindent
-This updates all the nodes and menus completely and all at once.@refill
-@end table
-
-The other major updating commands do smaller jobs and are designed for
-the person who updates nodes and menus as he or she writes a Texinfo
-file.@refill
-
-@need 1000
-The commands are:@refill
-
-@table @kbd
-@item C-c C-u C-n
-@itemx M-x texinfo-update-node
-@findex texinfo-update-node
-Insert the `Next', `Previous', and `Up' pointers for the node that point is
-within (i.e., for the @code{@@node} line preceding point). If the
-@code{@@node} line has pre-existing `Next', `Previous', or `Up'
-pointers in it, the old pointers are removed and new ones inserted.
-With an argument (prefix argument, @kbd{C-u}, if interactive), this command
-updates all @code{@@node} lines in the region (which is the text
-between point and mark).@refill
-
-@item C-c C-u C-m
-@itemx M-x texinfo-make-menu
-@findex texinfo-make-menu
-Create or update the menu in the node that point is within.
-With an argument (@kbd{C-u} as prefix argument, if
-interactive), the command makes or updates menus for the
-nodes which are either within or a part of the
-region.@refill
-
-Whenever @code{texinfo-make-menu} updates an existing menu, the
-descriptions from that menu are incorporated into the new menu. This
-is done by copying descriptions from the existing menu to the entries
-in the new menu that have the same node names. If the node names are
-different, the descriptions are not copied to the new menu.@refill
-
-@item C-c C-u C-e
-@itemx M-x texinfo-every-node-update
-@findex texinfo-every-node-update
-Insert or update the `Next', `Previous', and `Up' pointers for every
-node in the buffer.@refill
-
-@item C-c C-u C-a
-@itemx M-x texinfo-all-menus-update
-@findex texinfo-all-menus-update
-Create or update all the menus in the buffer. With an argument
-(@kbd{C-u} as prefix argument, if interactive), first insert
-or update all the node
-pointers before working on the menus.@refill
-
-If a master menu exists, the @code{texinfo-all-menus-update} command
-updates it; but the command does not create a new master menu if none
-already exists. (Use the @code{texinfo-master-menu} command for
-that.)@refill
-
-When working on a document that does not merit a master menu, you can
-type the following:
-
-@example
-C-u C-c C-u C-a
-@exdent or
-C-u M-x texinfo-all-menus-update
-@end example
-
-@noindent
-This updates all the nodes and menus.@refill
-@end table
-
-The @code{texinfo-column-for-description} variable specifies the
-column to which menu descriptions are indented. By default, the value
-is 32 although it is often useful to reduce it to as low as 24. You
-can set the variable with the @kbd{M-x edit-options} command
-(@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs
-Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining,
-, Examining and Setting Variables, emacs, The GNU Emacs
-Manual}).@refill
-
-Also, the @code{texinfo-indent-menu-description} command may be used to
-indent existing menu descriptions to a specified column. Finally, if
-you wish, you can use the @code{texinfo-insert-node-lines} command to
-insert missing @code{@@node} lines into a file. (@xref{Other Updating
-Commands}, for more information.)@refill
-
-@node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus
-@comment node-name, next, previous, up
-@subsection Updating Requirements
-@cindex Updating requirements
-@cindex Requirements for updating commands
-
-To use the updating commands, you must organize the Texinfo file
-hierarchically with chapters, sections, subsections, and the like.
-When you construct the hierarchy of the manual, do not `jump down'
-more than one level at a time: you can follow the `Top' node with a
-chapter, but not with a section; you can follow a chapter with a
-section, but not with a subsection. However, you may `jump up' any
-number of levels at one time---for example, from a subsection to a
-chapter.@refill
-
-Each @code{@@node} line, with the exception of the line for the `Top'
-node, must be followed by a line with a structuring command such as
-@code{@@chapter}, @code{@@section}, or
-@code{@@unnumberedsubsec}.@refill
-
-Each @code{@@node} line/structuring-command line combination
-must look either like this:@refill
-
-@example
-@group
-@@node Comments, Minimum, Conventions, Overview
-@@comment node-name, next, previous, up
-@@section Comments
-@end group
-@end example
-
-or like this (without the @code{@@comment} line):
-
-@example
-@group
-@@node Comments, Minimum, Conventions, Overview
-@@section Comments
-@end group
-@end example
-
-@noindent
-In this example, `Comments' is the name of both the node and the
-section. The next node is called `Minimum' and the previous node is
-called `Conventions'. The `Comments' section is within the `Overview'
-node, which is specified by the `Up' pointer. (Instead of an
-@code{@@comment} line, you can write an @code{@@ifinfo} line.)@refill
-
-If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
-and be the first node in the file.@refill
-
-The menu updating commands create a menu of sections within a chapter,
-a menu of subsections within a section, and so on. This means that
-you must have a `Top' node if you want a menu of chapters.@refill
-
-Incidentally, the @code{makeinfo} command will create an Info file for
-a hierarchically organized Texinfo file that lacks `Next', `Previous'
-and `Up' pointers. Thus, if you can be sure that your Texinfo file
-will be formatted with @code{makeinfo}, you have no need for the
-`update node' commands. (@xref{Create an Info File, , Creating an
-Info File}, for more information about @code{makeinfo}.) However,
-both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands
-require that you insert menus in the file.@refill
-
-@node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus
-@comment node-name, next, previous, up
-@subsection Other Updating Commands
-
-In addition to the five major updating commands, Texinfo mode
-possesses several less frequently used updating commands:@refill
-
-@table @kbd
-@item M-x texinfo-insert-node-lines
-@findex texinfo-insert-node-lines
-Insert @code{@@node} lines before the @code{@@chapter},
-@code{@@section}, and other sectioning commands wherever they are
-missing throughout a region in a Texinfo file.@refill
-
-With an argument (@kbd{C-u} as prefix argument, if interactive), the
-@code{texinfo-insert-node-lines} command not only inserts
-@code{@@node} lines but also inserts the chapter or section titles as
-the names of the corresponding nodes. In addition, it inserts the
-titles as node names in pre-existing @code{@@node} lines that lack
-names. Since node names should be more concise than section or
-chapter titles, you must manually edit node names so inserted.@refill
-
-For example, the following marks a whole buffer as a region and inserts
-@code{@@node} lines and titles throughout:@refill
-
-@example
-C-x h C-u M-x texinfo-insert-node-lines
-@end example
-
-(Note that this command inserts titles as node names in @code{@@node}
-lines; the @code{texinfo-start-menu-description} command
-(@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles
-as descriptions in menu entries, a different action. However, in both
-cases, you need to edit the inserted text.)@refill
-
-@item M-x texinfo-multiple-files-update
-@findex texinfo-multiple-files-update @r{(in brief)}
-Update nodes and menus in a document built from several separate files.
-With @kbd{C-u} as a prefix argument, create and insert a master menu in
-the outer file. With a numeric prefix argument, such as @kbd{C-u 2}, first
-update all the menus and all the `Next', `Previous', and `Up' pointers
-of all the included files before creating and inserting a master menu in
-the outer file. The @code{texinfo-multiple-files-update} command is
-described in the appendix on @code{@@include} files.
-@ifinfo
-@xref{texinfo-multiple-files-update}.@refill
-@end ifinfo
-@iftex
-@xref{texinfo-multiple-files-update, ,
-@code{texinfo-multiple-files-update}}.@refill
-@end iftex
-
-@item M-x texinfo-indent-menu-description
-@findex texinfo-indent-menu-description
-Indent every description in the menu following point to the specified
-column. You can use this command to give yourself more space for
-descriptions. With an argument (@kbd{C-u} as prefix argument, if
-interactive), the @code{texinfo-indent-menu-description} command indents
-every description in every menu in the region. However, this command
-does not indent the second and subsequent lines of a multi-line
-description.@refill
-
-@item M-x texinfo-sequential-node-update
-@findex texinfo-sequential-node-update
-Insert the names of the nodes immediately following and preceding the
-current node as the `Next' or `Previous' pointers regardless of those
-nodes' hierarchical level. This means that the `Next' node of a
-subsection may well be the next chapter. Sequentially ordered nodes are
-useful for novels and other documents that you read through
-sequentially. (However, in Info, the @kbd{g *} command lets
-you look through the file sequentially, so sequentially ordered nodes
-are not strictly necessary.) With an argument (prefix argument, if
-interactive), the @code{texinfo-sequential-node-update} command
-sequentially updates all the nodes in the region.@refill
-@end table
-
-@node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode
-@comment node-name, next, previous, up
-@section Formatting for Info
-@cindex Formatting for Info
-@cindex Running an Info formatter
-@cindex Info formatting
-
-Texinfo mode provides several commands for formatting part or all of a
-Texinfo file for Info. Often, when you are writing a document, you
-want to format only part of a file---that is, a region.@refill
-
-You can use either the @code{texinfo-format-region} or the
-@code{makeinfo-region} command to format a region:@refill
-
-@table @kbd
-@findex texinfo-format-region
-@item C-c C-e C-r
-@itemx M-x texinfo-format-region
-@itemx C-c C-m C-r
-@itemx M-x makeinfo-region
-Format the current region for Info.@refill
-@end table
-
-You can use either the @code{texinfo-format-buffer} or the
-@code{makeinfo-buffer} command to format a whole buffer:@refill
-
-@table @kbd
-@findex texinfo-format-buffer
-@item C-c C-e C-b
-@itemx M-x texinfo-format-buffer
-@itemx C-c C-m C-b
-@itemx M-x makeinfo-buffer
-Format the current buffer for Info.@refill
-@end table
-
-@need 1000
-For example, after writing a Texinfo file, you can type the following:
-
-@example
-C-u C-c C-u m
-@exdent or
-C-u M-x texinfo-master-menu
-@end example
-
-@noindent
-This updates all the nodes and menus. Then type the following to create
-an Info file:
-
-@example
-C-c C-m C-b
-@exdent or
-M-x makeinfo-buffer
-@end example
-
-For @TeX{} or the Info formatting commands to work, the file @emph{must}
-include a line that has @code{@@setfilename} in its header.@refill
-
-@xref{Create an Info File}, for details about Info formatting.@refill
-
-@node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode
-@comment node-name, next, previous, up
-@section Formatting and Printing
-@cindex Formatting for printing
-@cindex Printing a region or buffer
-@cindex Region formatting and printing
-@cindex Buffer formatting and printing
-@cindex Part of file formatting and printing
-
-Typesetting and printing a Texinfo file is a multi-step process in which
-you first create a file for printing (called a DVI file), and then
-print the file. Optionally, you may also create indices. To do this,
-you must run the @code{texindex} command after first running the
-@code{tex} typesetting command; and then you must run the @code{tex}
-command again. Or else run the @code{texi2dvi} command which
-automatically creates indices as needed (@pxref{Format with texi2dvi}).
-
-Often, when you are writing a document, you want to typeset and print
-only part of a file to see what it will look like. You can use the
-@code{texinfo-tex-region} and related commands for this purpose. Use
-the @code{texinfo-tex-buffer} command to format all of a
-buffer.@refill
-
-@table @kbd
-@item C-c C-t C-b
-@itemx M-x texinfo-tex-buffer
-@findex texinfo-tex-buffer
-Run @code{texi2dvi} on the buffer. In addition to running @TeX{} on the
-buffer, this command automatically creates or updates indices as
-needed.@refill
-
-@item C-c C-t C-r
-@itemx M-x texinfo-tex-region
-@findex texinfo-tex-region
-Run @TeX{} on the region.@refill
-
-@item C-c C-t C-i
-@itemx M-x texinfo-texindex
-Run @code{texindex} to sort the indices of a Texinfo file formatted with
-@code{texinfo-tex-region}. The @code{texinfo-tex-region} command does
-not run @code{texindex} automatically; it only runs the @code{tex}
-typesetting command. You must run the @code{texinfo-tex-region} command
-a second time after sorting the raw index files with the @code{texindex}
-command. (Usually, you do not format an index when you format a region,
-only when you format a buffer. Now that the @code{texi2dvi} command
-exists, there is little or no need for this command.)@refill
-
-@item C-c C-t C-p
-@itemx M-x texinfo-tex-print
-@findex texinfo-tex-print
-Print the file (or the part of the file) previously formatted with
-@code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill
-@end table
-
-For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
-file @emph{must} start with a @samp{\input texinfo} line and must
-include an @code{@@settitle} line. The file must end with @code{@@bye}
-on a line by itself. (When you use @code{texinfo-tex-region}, you must
-surround the @code{@@settitle} line with start-of-header and
-end-of-header lines.)@refill
-
-@xref{Format/Print Hardcopy}, for a description of the other @TeX{} related
-commands, such as @code{tex-show-print-queue}.@refill
-
-@node Texinfo Mode Summary, , Printing, Texinfo Mode
-@comment node-name, next, previous, up
-@section Texinfo Mode Summary
-
-In Texinfo mode, each set of commands has default keybindings that
-begin with the same keys. All the commands that are custom-created
-for Texinfo mode begin with @kbd{C-c}. The keys are somewhat
-mnemonic.@refill
-
-@subheading Insert Commands
-
-The insert commands are invoked by typing @kbd{C-c} twice and then the
-first letter of the @@-command to be inserted. (It might make more
-sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
-@kbd{C-c C-c} is quick to type.)@refill
-
-@example
-C-c C-c c @r{Insert} @samp{@@code}.
-C-c C-c d @r{Insert} @samp{@@dfn}.
-C-c C-c e @r{Insert} @samp{@@end}.
-C-c C-c i @r{Insert} @samp{@@item}.
-C-c C-c n @r{Insert} @samp{@@node}.
-C-c C-c s @r{Insert} @samp{@@samp}.
-C-c C-c v @r{Insert} @samp{@@var}.
-C-c C-c @{ @r{Insert braces.}
-C-c C-c ]
-C-c C-c @} @r{Move out of enclosing braces.}
-
-@group
-C-c C-c C-d @r{Insert a node's section title}
- @r{in the space for the description}
- @r{in a menu entry line.}
-@end group
-@end example
-
-@subheading Show Structure
-
-The @code{texinfo-show-structure} command is often used within a
-narrowed region.@refill
-
-@example
-C-c C-s @r{List all the headings.}
-@end example
-
-@subheading The Master Update Command
-
-The @code{texinfo-master-menu} command creates a master menu; and can
-be used to update every node and menu in a file as well.@refill
-
-@example
-@group
-C-c C-u m
-M-x texinfo-master-menu
- @r{Create or update a master menu.}
-@end group
-
-@group
-C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first}
- @r{create or update all nodes and regular}
- @r{menus, and then create a master menu.}
-@end group
-@end example
-
-@subheading Update Pointers
-
-The update pointer commands are invoked by typing @kbd{C-c C-u} and
-then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
-@code{texinfo-every-node-update}.@refill
-
-@example
-C-c C-u C-n @r{Update a node.}
-C-c C-u C-e @r{Update every node in the buffer.}
-@end example
-
-@subheading Update Menus
-
-Invoke the update menu commands by typing @kbd{C-c C-u}
-and then either @kbd{C-m} for @code{texinfo-make-menu} or
-@kbd{C-a} for @code{texinfo-all-menus-update}. To update
-both nodes and menus at the same time, precede @kbd{C-c C-u
-C-a} with @kbd{C-u}.@refill
-
-@example
-C-c C-u C-m @r{Make or update a menu.}
-
-@group
-C-c C-u C-a @r{Make or update all}
- @r{menus in a buffer.}
-@end group
-
-@group
-C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
- @r{first create or update all nodes and}
- @r{then create or update all menus.}
-@end group
-@end example
-
-@subheading Format for Info
-
-The Info formatting commands that are written in Emacs Lisp are
-invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
-or @kbd{C-b} for the whole buffer.@refill
-
-The Info formatting commands that are written in C and based on the
-@code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
-either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill
-
-@need 800
-@noindent
-Use the @code{texinfo-format@dots{}} commands:
-
-@example
-@group
-C-c C-e C-r @r{Format the region.}
-C-c C-e C-b @r{Format the buffer.}
-@end group
-@end example
-
-@need 750
-@noindent
-Use @code{makeinfo}:
-
-@example
-C-c C-m C-r @r{Format the region.}
-C-c C-m C-b @r{Format the buffer.}
-C-c C-m C-l @r{Recenter the @code{makeinfo} output buffer.}
-C-c C-m C-k @r{Kill the @code{makeinfo} formatting job.}
-@end example
-
-@subheading Typeset and Print
-
-The @TeX{} typesetting and printing commands are invoked by typing
-@kbd{C-c C-t} and then another control command: @kbd{C-r} for
-@code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
-and so on.@refill
-
-@example
-C-c C-t C-r @r{Run @TeX{} on the region.}
-C-c C-t C-b @r{Run} @code{texi2dvi} @r{on the buffer.}
-C-c C-t C-i @r{Run} @code{texindex}.
-C-c C-t C-p @r{Print the DVI file.}
-C-c C-t C-q @r{Show the print queue.}
-C-c C-t C-d @r{Delete a job from the print queue.}
-C-c C-t C-k @r{Kill the current @TeX{} formatting job.}
-C-c C-t C-x @r{Quit a currently stopped @TeX{} formatting job.}
-C-c C-t C-l @r{Recenter the output buffer.}
-@end example
-
-@subheading Other Updating Commands
-
-The `other updating commands' do not have standard keybindings because
-they are rarely used.
-
-@example
-@group
-M-x texinfo-insert-node-lines
- @r{Insert missing @code{@@node} lines in region.}
- @r{With @kbd{C-u} as a prefix argument,}
- @r{use section titles as node names.}
-@end group
-
-@group
-M-x texinfo-multiple-files-update
- @r{Update a multi-file document.}
- @r{With @kbd{C-u 2} as a prefix argument,}
- @r{create or update all nodes and menus}
- @r{in all included files first.}
-@end group
-
-@group
-M-x texinfo-indent-menu-description
- @r{Indent descriptions.}
-@end group
-
-@group
-M-x texinfo-sequential-node-update
- @r{Insert node pointers in strict sequence.}
-@end group
-@end example
-
-@node Beginning a File, Ending a File, Texinfo Mode, Top
-@comment node-name, next, previous, up
-@chapter Beginning a Texinfo File
-@cindex Beginning a Texinfo file
-@cindex Texinfo file beginning
-@cindex File beginning
-
-Certain pieces of information must be provided at the beginning of a
-Texinfo file, such as the name of the file and the title of the
-document.@refill
-
-@menu
-* Four Parts:: Four parts begin a Texinfo file.
-* Sample Beginning:: Here is a sample beginning for a Texinfo file.
-* Header:: The very beginning of a Texinfo file.
-* Info Summary and Permissions:: Summary and copying permissions for Info.
-* Titlepage & Copyright Page:: Creating the title and copyright pages.
-* The Top Node:: Creating the `Top' node and master menu.
-* Software Copying Permissions:: Ensure that you and others continue to
- have the right to use and share software.
-@end menu
-
-@node Four Parts, Sample Beginning, Beginning a File, Beginning a File
-@ifinfo
-@heading Four Parts Begin a File
-@end ifinfo
-
-Generally, the beginning of a Texinfo file has four parts:@refill
-
-@enumerate
-@item
-The header, delimited by special comment lines, that includes the
-commands for naming the Texinfo file and telling @TeX{} what
-definitions file to use when processing the Texinfo file.@refill
-
-@item
-A short statement of what the file is about, with a copyright notice
-and copying permissions. This is enclosed in @code{@@ifinfo} and
-@code{@@end ifinfo} commands so that the formatters place it only
-in the Info file.@refill
-
-@item
-A title page and copyright page, with a copyright notice and copying
-permissions. This is enclosed between @code{@@titlepage} and
-@code{@@end titlepage} commands. The title and copyright page appear
-only in the printed @w{manual}.@refill
-
-@item
-The `Top' node that contains a menu for the whole Info file. The
-contents of this node appear only in the Info file.@refill
-@end enumerate
-
-Also, optionally, you may include the copying conditions for a program
-and a warranty disclaimer. The copying section will be followed by an
-introduction or else by the first chapter of the manual.@refill
-
-Since the copyright notice and copying permissions for the Texinfo
-document (in contrast to the copying permissions for a program) are in
-parts that appear only in the Info file or only in the printed manual,
-this information must be given twice.@refill
-
-@node Sample Beginning, Header, Four Parts, Beginning a File
-@comment node-name, next, previous, up
-@section Sample Texinfo File Beginning
-
-The following sample shows what is needed.@refill
-
-@example
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename @var{name-of-info-file}
-@@settitle @var{name-of-manual}
-@@setchapternewpage odd
-@@c %**end of header
-
-@@ifinfo
-This file documents @dots{}
-
-Copyright @var{year} @var{copyright-owner}
-
-@group
-Permission is granted to @dots{}
-@@end ifinfo
-@end group
-
-@group
-@@c This title page illustrates only one of the
-@@c two methods of forming a title page.
-@end group
-
-@group
-@@titlepage
-@@title @var{name-of-manual-when-printed}
-@@subtitle @var{subtitle-if-any}
-@@subtitle @var{second-subtitle}
-@@author @var{author}
-@end group
-
-@group
-@@c The following two commands
-@@c start the copyright page.
-@@page
-@@vskip 0pt plus 1filll
-Copyright @@copyright@{@} @var{year} @var{copyright-owner}
-@end group
-
-Published by @dots{}
-
-Permission is granted to @dots{}
-@@end titlepage
-
-@@node Top, Overview, , (dir)
-
-@@ifinfo
-This document describes @dots{}
-
-This document applies to version @dots{}
-of the program named @dots{}
-@@end ifinfo
-
-@group
-@@menu
-* Copying:: Your rights and freedoms.
-* First Chapter:: Getting started @dots{}
-* Second Chapter:: @dots{}
- @dots{}
- @dots{}
-@@end menu
-@end group
-
-@group
-@@node First Chapter, Second Chapter, top, top
-@@comment node-name, next, previous, up
-@@chapter First Chapter
-@@cindex Index entry for First Chapter
-@end group
-@end example
-
-@node Header, Info Summary and Permissions, Sample Beginning, Beginning a File
-@comment node-name, next, previous, up
-@section The Texinfo File Header
-@cindex Header for Texinfo files
-@cindex Texinfo file header
-
-Texinfo files start with at least three lines that provide Info and
-@TeX{} with necessary information. These are the @code{\input
-texinfo} line, the @code{@@settitle} line, and the
-@code{@@setfilename} line. If you want to run @TeX{} on just a part
-of the Texinfo File, you must write the @code{@@settitle}
-and @code{@@setfilename} lines between start-of-header and end-of-header
-lines.@refill
-
-Thus, the beginning of a Texinfo file looks like this:
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@@setfilename sample.info
-@@settitle Sample Document
-@end group
-@end example
-
-@noindent
-or else like this:
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename sample.info
-@@settitle Sample Document
-@@c %**end of header
-@end group
-@end example
-
-@menu
-* First Line:: The first line of a Texinfo file.
-* Start of Header:: Formatting a region requires this.
-* setfilename:: Tell Info the name of the Info file.
-* settitle:: Create a title for the printed work.
-* setchapternewpage:: Start chapters on right-hand pages.
-* paragraphindent:: An option to specify paragraph indentation.
-* End of Header:: Formatting a region requires this.
-@end menu
-
-@node First Line, Start of Header, Header, Header
-@comment node-name, next, previous, up
-@subsection The First Line of a Texinfo File
-@cindex First line of a Texinfo file
-@cindex Beginning line of a Texinfo file
-@cindex Header of a Texinfo file
-
-Every Texinfo file that is to be the top-level input to @TeX{} must begin
-with a line that looks like this:@refill
-
-@example
-\input texinfo @@c -*-texinfo-*-
-@end example
-
-@noindent
-This line serves two functions:
-
-@enumerate
-@item
-When the file is processed by @TeX{}, the @samp{\input texinfo} command
-tells @TeX{} to load the macros needed for processing a Texinfo file.
-These are in a file called @file{texinfo.tex}, which is usually located
-in the @file{/usr/lib/tex/macros} directory. @TeX{} uses the backslash,
-@samp{\}, to mark the beginning of a command, just as Texinfo uses
-@samp{@@}. The @file{texinfo.tex} file causes the switch from @samp{\}
-to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which
-is why it appears at the beginning of the file.@refill
-
-@item
-When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode
-specification tells Emacs to use Texinfo mode.@refill
-@end enumerate
-
-@node Start of Header, setfilename, First Line, Header
-@comment node-name, next, previous, up
-@subsection Start of Header
-@cindex Start of header line
-
-Write a start-of-header line on the second line of a Texinfo file.
-Follow the start-of-header line with @code{@@setfilename} and
-@code{@@settitle} lines and, optionally, with other command lines, such
-as @code{@@smallbook} or @code{@@footnotestyle}; and then by an
-end-of-header line (@pxref{End of Header}).@refill
-
-With these lines, you can format part of a Texinfo file for Info or
-typeset part for printing.@refill
-
-A start-of-header line looks like this:@refill
-
-@example
-@@c %**start of header
-@end example
-
-The odd string of characters, @samp{%**}, is to ensure that no other
-comment is accidentally taken for a start-of-header line.@refill
-
-@node setfilename, settitle, Start of Header, Header
-@comment node-name, next, previous, up
-@subsection @code{@@setfilename}
-@cindex Info file requires @code{@@setfilename}
-@findex setfilename
-
-In order to serve as the primary input file for either @code{makeinfo}
-or @TeX{}, a Texinfo file must contain a line that looks like this:
-
-@example
-@@setfilename @var{info-file-name}
-@end example
-
-Write the @code{@@setfilename} command at the beginning of a line and
-follow it on the same line by the Info file name. Do not write anything
-else on the line; anything on the line after the command is considered
-part of the file name, including what would otherwise be a
-comment.
-
-The @code{@@setfilename} line specifies the name of the Info file to be
-generated. This name should be different from the name of the Texinfo
-file. There are two conventions for choosing the name: you can either
-remove the @samp{.texi} extension from the input file name, or replace
-it with the @samp{.info} extension.
-
-Some operating systems cannot handle long file names. You can run into
-a problem even when the file name you specify is itself short enough.
-This occurs because the Info formatters split a long Info file into
-short indirect subfiles, and name them by appending @samp{-1},
-@samp{-2}, @dots{}, @samp{-10}, @samp{-11}, and so on, to the original
-file name. (@xref{Tag and Split Files, , Tag Files and Split Files}.)
-The subfile name @file{texinfo.info-10}, for example, is too long for
-some systems; so the Info file name for this document is @file{texinfo}
-rather than @file{texinfo.info}.
-
-@cindex Ignored before @code{@@setfilename}
-The Info formatting commands ignore everything written before the
-@code{@@setfilename} line, which is why the very first line of
-the file (the @code{\input} line) does not show up in the output.
-
-@pindex texinfo.cnf
-The @code{@@setfilename} line produces no output when you typeset a
-manual with @TeX{}, but it nevertheless is essential: it opens the
-index, cross-reference, and other auxiliary files used by Texinfo, and
-also reads @file{texinfo.cnf} if that file is present on your system
-(@pxref{Preparing for TeX,, Preparing to Use @TeX{}}).
-
-
-@node settitle, setchapternewpage, setfilename, Header
-@comment node-name, next, previous, up
-@subsection @code{@@settitle}
-@findex settitle
-
-In order to be made into a printed manual, a Texinfo file must contain
-a line that looks like this:@refill
-
-@example
-@@settitle @var{title}
-@end example
-
-Write the @code{@@settitle} command at the beginning of a line and
-follow it on the same line by the title. This tells @TeX{} the title
-to use in a header or footer. Do not write anything else on the line;
-anything on the line after the command is considered part of the
-title, including a comment.@refill
-
-Conventionally, when @TeX{} formats a Texinfo file for double-sided
-output, the title is printed in the left-hand (even-numbered) page
-headings and the current chapter title is printed in the right-hand
-(odd-numbered) page headings. (@TeX{} learns the title of each chapter
-from each @code{@@chapter} command.) Page footers are not
-printed.@refill
-
-Even if you are printing in a single-sided style, @TeX{} looks for an
-@code{@@settitle} command line, in case you include the manual title
-in the heading. @refill
-
-The @code{@@settitle} command should precede everything that generates
-actual output in @TeX{}.@refill
-
-Although the title in the @code{@@settitle} command is usually the
-same as the title on the title page, it does not affect the title as
-it appears on the title page. Thus, the two do not need not match
-exactly; and the title in the @code{@@settitle} command can be a
-shortened or expanded version of the title as it appears on the title
-page. (@xref{titlepage, , @code{@@titlepage}}.)@refill
-
-@TeX{} prints page headings only for that text that comes after the
-@code{@@end titlepage} command in the Texinfo file, or that comes
-after an @code{@@headings} command that turns on headings.
-(@xref{headings on off, , The @code{@@headings} Command}, for more
-information.)@refill
-
-You may, if you wish, create your own, customized headings and
-footings. @xref{Headings, , Page Headings}, for a detailed discussion
-of this process.@refill
-
-@node setchapternewpage, paragraphindent, settitle, Header
-@comment node-name, next, previous, up
-@subsection @code{@@setchapternewpage}
-@cindex Starting chapters
-@cindex Pages, starting odd
-@findex setchapternewpage
-
-In a book or a manual, text is usually printed on both sides of the
-paper, chapters start on right-hand pages, and right-hand pages have
-odd numbers. But in short reports, text often is printed only on one
-side of the paper. Also in short reports, chapters sometimes do not
-start on new pages, but are printed on the same page as the end of the
-preceding chapter, after a small amount of vertical whitespace.@refill
-
-You can use the @code{@@setchapternewpage} command with various
-arguments to specify how @TeX{} should start chapters and whether it
-should typeset pages for printing on one or both sides of the paper
-(single-sided or double-sided printing).@refill
-
-Write the @code{@@setchapternewpage} command at the beginning of a
-line followed by its argument.@refill
-
-For example, you would write the following to cause each chapter to
-start on a fresh odd-numbered page:@refill
-
-@example
-@@setchapternewpage odd
-@end example
-
-You can specify one of three alternatives with the
-@code{@@setchapternewpage} command:@refill
-
-@table @asis
-@ignore
-@item No @code{@@setchapternewpage} command
-If the Texinfo file does not contain an @code{@@setchapternewpage}
-command before the @code{@@titlepage} command, @TeX{} automatically
-begins chapters on new pages and prints headings in the standard
-format for single-sided printing. This is the conventional format for
-single-sided printing.@refill
-
-The result is exactly the same as when you write
-@code{@@setchapternewpage on}.@refill
-@end ignore
-@item @code{@@setchapternewpage off}
-Cause @TeX{} to typeset a new chapter on the same page as the last
-chapter, after skipping some vertical whitespace. Also, cause @TeX{} to
-format page headers for single-sided printing. (You can override the
-headers format with the @code{@@headings double} command; see
-@ref{headings on off, , The @code{@@headings} Command}.)@refill
-
-@item @code{@@setchapternewpage on}
-Cause @TeX{} to start new chapters on new pages and to typeset page
-headers for single-sided printing. This is the form most often
-used for short reports.@refill
-
-This alternative is the default.@refill
-
-@item @code{@@setchapternewpage odd}
-Cause @TeX{} to start new chapters on new, odd-numbered pages
-(right-handed pages) and to typeset for double-sided printing. This is
-the form most often used for books and manuals.@refill
-@end table
-
-@noindent
-Texinfo does not have an @code{@@setchapternewpage even} command.@refill
-
-@noindent
-(You can countermand or modify an @code{@@setchapternewpage} command
-with an @code{@@headings} command. @xref{headings on off, , The
-@code{@@headings} Command}.)@refill
-
-At the beginning of a manual or book, pages are not numbered---for
-example, the title and copyright pages of a book are not numbered.
-By convention, table of contents pages are numbered with roman
-numerals and not in sequence with the rest of the document.@refill
-
-Since an Info file does not have pages, the @code{@@setchapternewpage}
-command has no effect on it.@refill
-
-Usually, you do not write an @code{@@setchapternewpage} command for
-single-sided printing, but accept the default which is to typeset for
-single-sided printing and to start new chapters on new pages. Usually,
-you write an @code{@@setchapternewpage odd} command for double-sided
-printing.@refill
-
-@node paragraphindent, End of Header, setchapternewpage, Header
-@comment node-name, next, previous, up
-@subsection Paragraph Indenting
-@cindex Indenting paragraphs
-@cindex Paragraph indentation
-@findex paragraphindent
-
-The Info formatting commands may insert spaces at the beginning of the
-first line of each paragraph, thereby indenting that paragraph. You
-can use the @code{@@paragraphindent} command to specify the
-indentation. Write an @code{@@paragraphindent} command at the
-beginning of a line followed by either @samp{asis} or a number. The
-template is:@refill
-
-@example
-@@paragraphindent @var{indent}
-@end example
-
-The Info formatting commands indent according to the value of
-@var{indent}:@refill
-
-@itemize @bullet
-@item
-If the value of @var{indent} is @samp{asis}, the Info formatting
-commands do not change the existing indentation.@refill
-
-@item
-If the value of @var{indent} is zero, the Info formatting commands delete
-existing indentation.@refill
-
-@item
-If the value of @var{indent} is greater than zero, the Info formatting
-commands indent the paragraph by that number of spaces.@refill
-@end itemize
-
-The default value of @var{indent} is @samp{asis}.@refill
-
-Write the @code{@@paragraphindent} command before or shortly after the
-end-of-header line at the beginning of a Texinfo file. (If you write
-the command between the start-of-header and end-of-header lines, the
-region formatting commands indent paragraphs as specified.)@refill
-
-A peculiarity of the @code{texinfo-format-buffer} and
-@code{texinfo-format-region} commands is that they do not indent (nor
-fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
-@xref{Refilling Paragraphs}, for a detailed description of what goes
-on.@refill
-
-@node End of Header, , paragraphindent, Header
-@comment node-name, next, previous, up
-@subsection End of Header
-@cindex End of header line
-
-Follow the header lines with an @w{end-of-header} line.
-An end-of-header line looks like this:@refill
-
-@example
-@@c %**end of header
-@end example
-
-If you include the @code{@@setchapternewpage} command between the
-start-of-header and end-of-header lines, @TeX{} will typeset a region as
-that command specifies. Similarly, if you include an @code{@@smallbook}
-command between the start-of-header and end-of-header lines, @TeX{} will
-typeset a region in the ``small'' book format.@refill
-
-@ifinfo
-The reason for the odd string of characters (@samp{%**}) is so that the
-@code{texinfo-tex-region} command does not accidentally find
-something that it should not when it is looking for the header.@refill
-
-The start-of-header line and the end-of-header line are Texinfo mode
-variables that you can change.@refill
-@end ifinfo
-
-@iftex
-@xref{Start of Header}.
-@end iftex
-
-@node Info Summary and Permissions, Titlepage & Copyright Page, Header, Beginning a File
-@comment node-name, next, previous, up
-@section Summary and Copying Permissions for Info
-
-The title page and the copyright page appear only in the printed copy of
-the manual; therefore, the same information must be inserted in a
-section that appears only in the Info file. This section usually
-contains a brief description of the contents of the Info file, a
-copyright notice, and copying permissions.@refill
-
-The copyright notice should read:@refill
-
-@example
-Copyright @var{year} @var{copyright-owner}
-@end example
-
-@noindent
-and be put on a line by itself.@refill
-
-Standard text for the copyright permissions is contained in an appendix
-to this manual; see @ref{ifinfo Permissions, , @samp{ifinfo} Copying
-Permissions}, for the complete text.@refill
-
-The permissions text appears in an Info file @emph{before} the first
-node. This mean that a reader does @emph{not} see this text when
-reading the file using Info, except when using the advanced Info command
-@kbd{g *}.
-
-@node Titlepage & Copyright Page, The Top Node, Info Summary and Permissions, Beginning a File
-@comment node-name, next, previous, up
-@section The Title and Copyright Pages
-
-A manual's name and author are usually printed on a title page.
-Sometimes copyright information is printed on the title page as well;
-more often, copyright information is printed on the back of the title
-page.
-
-The title and copyright pages appear in the printed manual, but not in the
-Info file. Because of this, it is possible to use several slightly
-obscure @TeX{} typesetting commands that cannot be used in an Info file.
-In addition, this part of the beginning of a Texinfo file contains the text
-of the copying permissions that will appear in the printed manual.@refill
-
-@xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the
-standard text for the copyright permissions.@refill
-
-@menu
-* titlepage:: Create a title for the printed document.
-* titlefont center sp:: The @code{@@titlefont}, @code{@@center},
- and @code{@@sp} commands.
-* title subtitle author:: The @code{@@title}, @code{@@subtitle},
- and @code{@@author} commands.
-* Copyright & Permissions:: How to write the copyright notice and
- include copying permissions.
-* end titlepage:: Turn on page headings after the title and
- copyright pages.
-* headings on off:: An option for turning headings on and off
- and double or single sided printing.
-@end menu
-
-@node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection @code{@@titlepage}
-@cindex Title page
-@findex titlepage
-
-Start the material for the title page and following copyright page
-with @code{@@titlepage} on a line by itself and end it with
-@code{@@end titlepage} on a line by itself.@refill
-
-The @code{@@end titlepage} command starts a new page and turns on page
-numbering. (@xref{Headings, , Page Headings}, for details about how to
-generate page headings.) All the material that you want to
-appear on unnumbered pages should be put between the
-@code{@@titlepage} and @code{@@end titlepage} commands. By using the
-@code{@@page} command you can force a page break within the region
-delineated by the @code{@@titlepage} and @code{@@end titlepage}
-commands and thereby create more than one unnumbered page. This is
-how the copyright page is produced. (The @code{@@titlepage} command
-might perhaps have been better named the
-@code{@@titleandadditionalpages} command, but that would have been
-rather long!)@refill
-
-@c !!! append refill to footnote when makeinfo can handle it.
-When you write a manual about a computer program, you should write the
-version of the program to which the manual applies on the title
-page. If the manual changes more frequently than the program or is
-independent of it, you should also include an edition
-number@footnote{We have found that it is helpful to refer to versions
-of manuals as `editions' and versions of programs as `versions';
-otherwise, we find we are liable to confuse each other in conversation
-by referring to both the documentation and the software with the same
-words.} for the manual. This helps readers keep track of which manual
-is for which version of the program. (The `Top' node
-should also contain this information; see @ref{makeinfo top, ,
-@code{@@top}}.)@refill
-
-Texinfo provides two main methods for creating a title page. One method
-uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
-to generate a title page in which the words on the page are
-centered.@refill
-
-The second method uses the @code{@@title}, @code{@@subtitle}, and
-@code{@@author} commands to create a title page with black rules under
-the title and author lines and the subtitle text set flush to the
-right hand side of the page. With this method, you do not specify any
-of the actual formatting of the title page. You specify the text
-you want, and Texinfo does the formatting. You may use either
-method.@refill
-
-@findex shorttitlepage
-For extremely simple applications, Texinfo also provides a command
-@code{@@shorttitlepage} which takes a single argument as the title.
-The argument is typeset on a page by itself and followed by a blank
-page.
-
-
-@node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
-@findex titlefont
-@findex center
-@findex sp @r{(titlepage line spacing)}
-
-You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
-commands to create a title page for a printed document. (This is the
-first of the two methods for creating a title page in Texinfo.)@refill
-
-Use the @code{@@titlefont} command to select a large font suitable for
-the title itself.@refill
-
-@need 700
-For example:
-
-@example
-@@titlefont@{Texinfo@}
-@end example
-
-Use the @code{@@center} command at the beginning of a line to center
-the remaining text on that line. Thus,@refill
-
-@example
-@@center @@titlefont@{Texinfo@}
-@end example
-
-@noindent
-centers the title, which in this example is ``Texinfo'' printed
-in the title font.@refill
-
-Use the @code{@@sp} command to insert vertical space. For example:@refill
-
-@example
-@@sp 2
-@end example
-
-@noindent
-This inserts two blank lines on the printed page. (@xref{sp, ,
-@code{@@sp}}, for more information about the @code{@@sp}
-command.)@refill
-
-A template for this method looks like this:@refill
-
-@example
-@group
-@@titlepage
-@@sp 10
-@@center @@titlefont@{@var{name-of-manual-when-printed}@}
-@@sp 2
-@@center @var{subtitle-if-any}
-@@sp 2
-@@center @var{author}
-@dots{}
-@@end titlepage
-@end group
-@end example
-
-The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
-
-@node title subtitle author, Copyright & Permissions, titlefont center sp, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
-@findex title
-@findex subtitle
-@findex author
-
-You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
-commands to create a title page in which the vertical and horizontal
-spacing is done for you automatically. This contrasts with the method
-described in
-the previous section, in which the @code{@@sp} command is needed to
-adjust vertical spacing.@refill
-
-Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
-commands at the beginning of a line followed by the title, subtitle,
-or author.@refill
-
-The @code{@@title} command produces a line in which the title is set
-flush to the left-hand side of the page in a larger than normal font.
-The title is underlined with a black rule.@refill
-
-The @code{@@subtitle} command sets subtitles in a normal-sized font
-flush to the right-hand side of the page.@refill
-
-The @code{@@author} command sets the names of the author or authors in
-a middle-sized font flush to the left-hand side of the page on a line
-near the bottom of the title page. The names are underlined with a
-black rule that is thinner than the rule that underlines the title.
-(The black rule only occurs if the @code{@@author} command line is
-followed by an @code{@@page} command line.)@refill
-
-There are two ways to use the @code{@@author} command: you can write
-the name or names on the remaining part of the line that starts with
-an @code{@@author} command:@refill
-
-@example
-@@author by Jane Smith and John Doe
-@end example
-
-@noindent
-or you can write the names one above each other by using two (or more)
-@code{@@author} commands:@refill
-
-@example
-@group
-@@author Jane Smith
-@@author John Doe
-@end group
-@end example
-
-@noindent
-(Only the bottom name is underlined with a black rule.)@refill
-
-@need 950
-A template for this method looks like this:@refill
-
-@example
-@group
-@@titlepage
-@@title @var{name-of-manual-when-printed}
-@@subtitle @var{subtitle-if-any}
-@@subtitle @var{second-subtitle}
-@@author @var{author}
-@@page
-@dots{}
-@@end titlepage
-@end group
-@end example
-
-@ifinfo
-@noindent
-Contrast this form with the form of a title page written using the
-@code{@@sp}, @code{@@center}, and @code{@@titlefont} commands:@refill
-
-@example
-@@titlepage
-@@sp 10
-@@center @@titlefont@{Name of Manual When Printed@}
-@@sp 2
-@@center Subtitle, If Any
-@@sp 1
-@@center Second subtitle
-@@sp 2
-@@center Author
-@@page
-@dots{}
-@@end titlepage
-@end example
-@end ifinfo
-
-@node Copyright & Permissions, end titlepage, title subtitle author, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection Copyright Page and Permissions
-@cindex Copyright page
-@cindex Printed permissions
-@cindex Permissions, printed
-
-By international treaty, the copyright notice for a book should be
-either on the title page or on the back of the title page. The
-copyright notice should include the year followed by the name of the
-organization or person who owns the copyright.@refill
-
-When the copyright notice is on the back of the title page, that page
-is customarily not numbered. Therefore, in Texinfo, the information
-on the copyright page should be within @code{@@titlepage} and
-@code{@@end titlepage} commands.@refill
-
-@findex vskip
-@findex filll
-@cindex Vertical whitespace (@samp{vskip})
-Use the @code{@@page} command to cause a page break. To push the
-copyright notice and the other text on the copyright page towards the
-bottom of the page, you can write a somewhat mysterious line after the
-@code{@@page} command that reads like this:@refill
-
-@example
-@@vskip 0pt plus 1filll
-@end example
-
-@noindent
-This is a @TeX{} command that is not supported by the Info formatting
-commands. The @code{@@vskip} command inserts whitespace. The
-@samp{0pt plus 1filll} means to put in zero points of mandatory whitespace,
-and as much optional whitespace as needed to push the
-following text to the bottom of the page. Note the use of three
-@samp{l}s in the word @samp{filll}; this is the correct usage in
-@TeX{}.@refill
-
-@findex copyright
-In a printed manual, the @code{@@copyright@{@}} command generates a
-@samp{c} inside a circle. (In Info, it generates @samp{(C)}.) The
-copyright notice itself has the following legally defined sequence:@refill
-
-@example
-Copyright @copyright{} @var{year} @var{copyright-owner}
-@end example
-
-It is customary to put information on how to get a manual after the
-copyright notice, followed by the copying permissions for the
-manual.@refill
-
-Note that permissions must be given here as well as in the summary
-segment within @code{@@ifinfo} and @code{@@end ifinfo} that
-immediately follows the header since this text appears only in the
-printed manual and the @samp{ifinfo} text appears only in the Info
-file.@refill
-
-@xref{Sample Permissions}, for the standard text.@refill
-
-@node end titlepage, headings on off, Copyright & Permissions, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection Heading Generation
-@findex end titlepage
-@cindex Headings, page, begin to appear
-@cindex Titlepage end starts headings
-@cindex End titlepage starts headings
-
-An @code{@@end titlepage} command on a line by itself not only marks
-the end of the title and copyright pages, but also causes @TeX{} to start
-generating page headings and page numbers.
-
-To repeat what is said elsewhere, Texinfo has two standard page heading
-formats, one for documents which are printed on one side of each sheet of paper
-(single-sided printing), and the other for documents which are printed on both
-sides of each sheet (double-sided printing).
-(@xref{setchapternewpage, ,@code{@@setchapternewpage}}.)
-You can specify these formats in different ways:@refill
-
-@itemize @bullet
-@item
-The conventional way is to write an @code{@@setchapternewpage} command
-before the title page commands, and then have the @code{@@end
-titlepage} command start generating page headings in the manner desired.
-(@xref{setchapternewpage, , @code{@@setchapternewpage}}.)@refill
-
-@item
-Alternatively, you can use the @code{@@headings} command to prevent page
-headings from being generated or to start them for either single or
-double-sided printing. (Write an @code{@@headings} command immediately
-after the @code{@@end titlepage} command. @xref{headings on off, , The
-@code{@@headings} Command}, for more information.)@refill
-
-@item
-Or, you may specify your own page heading and footing format.
-@xref{Headings, , Page Headings}, for detailed
-information about page headings and footings.@refill
-@end itemize
-
-Most documents are formatted with the standard single-sided or
-double-sided format, using @code{@@setchapternewpage odd} for
-double-sided printing and no @code{@@setchapternewpage} command for
-single-sided printing.@refill
-
-@node headings on off, , end titlepage, Titlepage & Copyright Page
-@comment node-name, next, previous, up
-@subsection The @code{@@headings} Command
-@findex headings
-
-The @code{@@headings} command is rarely used. It specifies what kind of
-page headings and footings to print on each page. Usually, this is
-controlled by the @code{@@setchapternewpage} command. You need the
-@code{@@headings} command only if the @code{@@setchapternewpage} command
-does not do what you want, or if you want to turn off pre-defined page
-headings prior to defining your own. Write an @code{@@headings} command
-immediately after the @code{@@end titlepage} command.@refill
-
-You can use @code{@@headings} as follows:@refill
-
-@table @code
-@item @@headings off
-Turn off printing of page headings.@refill
-
-@item @@headings single
-Turn on page headings appropriate for single-sided printing.
-@refill
-
-@item @@headings double
-Turn on page headings appropriate for double-sided printing. The two
-commands, @code{@@headings on} and @code{@@headings double}, are
-synonymous.@refill
-
-@item @@headings singleafter
-@itemx @@headings doubleafter
-Turn on @code{single} or @code{double} headings, respectively, after the
-current page is output.
-
-@item @@headings on
-Turn on page headings: @code{single} if @samp{@@setchapternewpage
-on}, @code{double} otherwise.
-@end table
-
-For example, suppose you write @code{@@setchapternewpage off} before the
-@code{@@titlepage} command to tell @TeX{} to start a new chapter on the
-same page as the end of the last chapter. This command also causes
-@TeX{} to typeset page headers for single-sided printing. To cause
-@TeX{} to typeset for double sided printing, write @code{@@headings
-double} after the @code{@@end titlepage} command.
-
-You can stop @TeX{} from generating any page headings at all by
-writing @code{@@headings off} on a line of its own immediately after the
-line containing the @code{@@end titlepage} command, like this:@refill
-
-@example
-@@end titlepage
-@@headings off
-@end example
-
-@noindent
-The @code{@@headings off} command overrides the @code{@@end titlepage}
-command, which would otherwise cause @TeX{} to print page
-headings.@refill
-
-You can also specify your own style of page heading and footing.
-@xref{Headings, , Page Headings}, for more information.@refill
-
-@node The Top Node, Software Copying Permissions, Titlepage & Copyright Page, Beginning a File
-@comment node-name, next, previous, up
-@section The `Top' Node and Master Menu
-@cindex @samp{@r{Top}} node
-@cindex Master menu
-@cindex Node, `Top'
-
-The `Top' node is the node from which you enter an Info file.@refill
-
-A `Top' node should contain a brief description of the Info file and an
-extensive, master menu for the whole Info file.
-This helps the reader understand what the Info file is
-about. Also, you should write the version number of the program to
-which the Info file applies; or, at least, the edition number.@refill
-
-The contents of the `Top' node should appear only in the Info file; none
-of it should appear in printed output, so enclose it between
-@code{@@ifinfo} and @code{@@end ifinfo} commands. (@TeX{} does not
-print either an @code{@@node} line or a menu; they appear only in Info;
-strictly speaking, you are not required to enclose these parts between
-@code{@@ifinfo} and @code{@@end ifinfo}, but it is simplest to do so.
-@xref{Conditionals, , Conditionally Visible Text}.)@refill
-
-@menu
-* Title of Top Node:: Sketch what the file is about.
-* Master Menu Parts:: A master menu has three or more parts.
-@end menu
-
-@node Title of Top Node, Master Menu Parts, The Top Node, The Top Node
-@ifinfo
-@subheading `Top' Node Title
-@end ifinfo
-
-Sometimes, you will want to place an @code{@@top} sectioning command
-line containing the title of the document immediately after the
-@code{@@node Top} line (@pxref{makeinfo top command, , The @code{@@top}
-Sectioning Command}, for more information).@refill
-
-For example, the beginning of the Top node of this manual contains an
-@code{@@top} sectioning command, a short description, and edition and
-version information. It looks like this:@refill
-
-@example
-@group
-@dots{}
-@@end titlepage
-
-@@ifinfo
-@@node Top, Copying, , (dir)
-@@top Texinfo
-
-Texinfo is a documentation system@dots{}
-@end group
-
-@group
-This is edition@dots{}
-@dots{}
-@@end ifinfo
-@end group
-
-@group
-@@menu
-* Copying:: Texinfo is freely
- redistributable.
-* Overview:: What is Texinfo?
-@dots{}
-@end group
-@@end menu
-@end example
-
-In a `Top' node, the `Previous', and `Up' nodes usually refer to the top
-level directory of the whole Info system, which is called @samp{(dir)}.
-The `Next' node refers to the first node that follows the main or master
-menu, which is usually the copying permissions, introduction, or first
-chapter.@refill
-
-@node Master Menu Parts, , Title of Top Node, The Top Node
-@subsection Parts of a Master Menu
-@cindex Master menu parts
-@cindex Parts of a master menu
-
-A @dfn{master menu} is a detailed main menu listing all the nodes in a
-file.
-
-A master menu is enclosed in @code{@@menu} and @code{@@end menu}
-commands and does not appear in the printed document.@refill
-
-Generally, a master menu is divided into parts.@refill
-
-@itemize @bullet
-@item
-The first part contains the major nodes in the Texinfo file: the nodes
-for the chapters, chapter-like sections, and the appendices.@refill
-
-@item
-The second part contains nodes for the indices.@refill
-
-@item
-The third and subsequent parts contain a listing of the other, lower
-level nodes, often ordered by chapter. This way, rather than go
-through an intermediary menu, an inquirer can go directly to a
-particular node when searching for specific information. These menu
-items are not required; add them if you think they are a
-convenience. If you do use them, put @code{@@detailmenu} before the
-first one, and @code{@@end detailmenu} after the last; otherwise,
-@code{makeinfo} will get confused.
-@end itemize
-
-Each section in the menu can be introduced by a descriptive line. So
-long as the line does not begin with an asterisk, it will not be
-treated as a menu entry. (@xref{Writing a Menu}, for more
-information.)@refill
-
-For example, the master menu for this manual looks like the following
-(but has many more entries):@refill
-
-@example
-@group
-@@menu
-* Copying:: Texinfo is freely
- redistributable.
-* Overview:: What is Texinfo?
-* Texinfo Mode:: Special features in GNU Emacs.
-@dots{}
-@dots{}
-@end group
-@group
-* Command and Variable Index::
- An entry for each @@-command.
-* Concept Index:: An entry for each concept.
-@end group
-
-@group
-@@detailmenu
- --- The Detailed Node Listing ---
-
-Overview of Texinfo
-
-* Info Files:: What is an Info file?
-* Printed Manuals:: Characteristics of
- a printed manual.
-@dots{}
-@dots{}
-@end group
-
-@group
-Using Texinfo Mode
-
-* Info on a Region:: Formatting part of a file
- for Info.
-@dots{}
-@dots{}
-@@end detailmenu
-@@end menu
-@end group
-@end example
-
-@node Software Copying Permissions, , The Top Node, Beginning a File
-@comment node-name, next, previous, up
-@section Software Copying Permissions
-@cindex Software copying permissions
-@cindex Copying software
-@cindex Distribution
-@cindex License agreement
-
-If the Texinfo file has a section containing the ``General Public
-License'' and the distribution information and a warranty disclaimer
-for the software that is documented, this section usually follows the
-`Top' node. The General Public License is very important to Project
-GNU software. It ensures that you and others will continue to have a
-right to use and share the software.@refill
-
-The copying and distribution information and the disclaimer are
-followed by an introduction or else by the first chapter of the
-manual.@refill
-
-@cindex Introduction, as part of file
-Although an introduction is not a required part of a Texinfo file, it
-is very helpful. Ideally, it should state clearly and concisely what
-the file is about and who would be interested in reading it. In
-general, an introduction would follow the licensing and distribution
-information, although sometimes people put it earlier in the document.
-Usually, an introduction is put in an @code{@@unnumbered} section.
-(@xref{unnumbered & appendix, , The @code{@@unnumbered} and
-@code{@@appendix} Commands}.)@refill
-
-@node Ending a File, Structuring, Beginning a File, Top
-@comment node-name, next, previous, up
-@chapter Ending a Texinfo File
-@cindex Ending a Texinfo file
-@cindex Texinfo file ending
-@cindex File ending
-@findex bye
-
-The end of a Texinfo file should include the commands that create
-indices and generate detailed and summary tables of contents.
-And it must include the @code{@@bye} command that marks the last line
-processed by @TeX{}.@refill
-
-@need 700
-For example:
-
-@example
-@@node Concept Index, , Variables Index, Top
-@@c node-name, next, previous, up
-@@unnumbered Concept Index
-
-@@printindex cp
-
-@@contents
-@@bye
-@end example
-
-@menu
-* Printing Indices & Menus:: How to print an index in hardcopy and
- generate index menus in Info.
-* Contents:: How to create a table of contents.
-* File End:: How to mark the end of a file.
-@end menu
-
-@node Printing Indices & Menus, Contents, Ending a File, Ending a File
-@comment node-name, next, previous, up
-@section Index Menus and Printing an Index
-@findex printindex
-@cindex Printing an index
-@cindex Indices, printing and menus
-@cindex Generating menus with indices
-@cindex Menus generated with indices
-
-To print an index means to include it as part of a manual or Info
-file. This does not happen automatically just because you use
-@code{@@cindex} or other index-entry generating commands in the
-Texinfo file; those just cause the raw data for the index to be
-accumulated. To generate an index, you must include the
-@code{@@printindex} command at the place in the document where you
-want the index to appear. Also, as part of the process of creating a
-printed manual, you must run a program called @code{texindex}
-(@pxref{Format/Print Hardcopy}) to sort the raw data to produce a sorted
-index file. The sorted index file is what is actually used to
-print the index.@refill
-
-Texinfo offers six different types of predefined index: the concept
-index, the function index, the variables index, the keystroke index, the
-program index, and the data type index (@pxref{Predefined Indices}). Each
-index type has a two-letter name: @samp{cp}, @samp{fn}, @samp{vr},
-@samp{ky}, @samp{pg}, and @samp{tp}. You may merge indices, or put them
-into separate sections (@pxref{Combining Indices}); or you may define
-your own indices (@pxref{New Indices, , Defining New Indices}).@refill
-
-The @code{@@printindex} command takes a two-letter index name, reads
-the corresponding sorted index file and formats it appropriately into
-an index.@refill
-
-@ignore
-The two-letter index names are:
-
-@table @samp
-@item cp
-concept index
-@item fn
-function index
-@item vr
-variable index
-@item ky
-key index
-@item pg
-program index
-@item tp
-data type index
-@end table
-@end ignore
-The @code{@@printindex} command does not generate a chapter heading
-for the index. Consequently, you should precede the
-@code{@@printindex} command with a suitable section or chapter command
-(usually @code{@@unnumbered}) to supply the chapter heading and put
-the index into the table of contents. Precede the @code{@@unnumbered}
-command with an @code{@@node} line.@refill
-
-@need 1200
-For example:
-
-@smallexample
-@group
-@@node Variable Index, Concept Index, Function Index, Top
-@@comment node-name, next, previous, up
-@@unnumbered Variable Index
-
-@@printindex vr
-@end group
-
-@group
-@@node Concept Index, , Variable Index, Top
-@@comment node-name, next, previous, up
-@@unnumbered Concept Index
-
-@@printindex cp
-@end group
-
-@group
-@@summarycontents
-@@contents
-@@bye
-@end group
-@end smallexample
-
-@noindent
-(Readers often prefer that the concept index come last in a book,
-since that makes it easiest to find.)@refill
-
-@ignore
-@c TeX can do sorting, just not conveniently enough to handle sorting
-@c Texinfo indexes. --karl, 5may97.
-In @TeX{}, the @code{@@printindex} command needs a sorted index file
-to work from. @TeX{} does not know how to do sorting; this is a
-deficiency. @TeX{} writes output files of raw index data; use the
-@code{texindex} program to convert these files to sorted index files.
-(@xref{Format/Print Hardcopy}, for more information.)@refill
-@end ignore
-
-
-@node Contents, File End, Printing Indices & Menus, Ending a File
-@comment node-name, next, previous, up
-@section Generating a Table of Contents
-@cindex Table of contents
-@cindex Contents, Table of
-@findex contents
-@findex summarycontents
-@findex shortcontents
-
-The @code{@@chapter}, @code{@@section}, and other structuring commands
-supply the information to make up a table of contents, but they do not
-cause an actual table to appear in the manual. To do this, you must
-use the @code{@@contents} and @code{@@summarycontents}
-commands:@refill
-
-@table @code
-@item @@contents
-Generate a table of contents in a printed manual, including all
-chapters, sections, subsections, etc., as well as appendices and
-unnumbered chapters. (Headings generated by the @code{@@heading}
-series of commands do not appear in the table of contents.) The
-@code{@@contents} command should be written on a line by
-itself.@refill
-
-@item @@shortcontents
-@itemx @@summarycontents
-(@code{@@summarycontents} is a synonym for @code{@@shortcontents}; the
-two commands are exactly the same.)@refill
-
-Generate a short or summary table of contents that lists only the
-chapters (and appendices and unnumbered chapters). Omit sections, subsections
-and subsubsections. Only a long manual needs a short table
-of contents in addition to the full table of contents.@refill
-
-Write the @code{@@shortcontents} command on a line by itself right
-@emph{before} the @code{@@contents} command.@refill
-@end table
-
-The table of contents commands automatically generate a chapter-like
-heading at the top of the first table of contents page. Write the table
-of contents commands at the very end of a Texinfo file, just before the
-@code{@@bye} command, following any index sections---anything in the
-Texinfo file after the table of contents commands will be omitted from
-the table of contents.@refill
-
-When you print a manual with a table of contents, the table of
-contents are printed last and numbered with roman numerals. You need
-to place those pages in their proper place, after the title page,
-yourself. (This is the only collating you need to do for a printed
-manual. The table of contents is printed last because it is generated
-after the rest of the manual is typeset.)@refill
-
-@need 700
-Here is an example of where to write table of contents commands:@refill
-
-@example
-@group
-@var{indices}@dots{}
-@@shortcontents
-@@contents
-@@bye
-@end group
-@end example
-
-Since an Info file uses menus instead of tables of contents, the Info
-formatting commands ignore the @code{@@contents} and
-@code{@@shortcontents} commands.@refill
-
-@node File End, , Contents, Ending a File
-@comment node-name, next, previous, up
-@section @code{@@bye} File Ending
-@findex bye
-
-An @code{@@bye} command terminates @TeX{} or Info formatting. None of
-the formatting commands see any of the file following @code{@@bye}.
-The @code{@@bye} command should be on a line by itself.@refill
-
-If you wish, you may follow the @code{@@bye} line with notes. These notes
-will not be formatted and will not appear in either Info or a printed
-manual; it is as if text after @code{@@bye} were within @code{@@ignore}
-@dots{} @code{@@end ignore}. Also, you may follow the @code{@@bye} line
-with a local variables list. @xref{Compile-Command, , Using Local
-Variables and the Compile Command}, for more information.@refill
-
-@node Structuring, Nodes, Ending a File, Top
-@comment node-name, next, previous, up
-@chapter Chapter Structuring
-@cindex Chapter structuring
-@cindex Structuring of chapters
-
-The @dfn{chapter structuring} commands divide a document into a hierarchy of
-chapters, sections, subsections, and subsubsections. These commands
-generate large headings; they also provide information for the table
-of contents of a printed manual (@pxref{Contents, , Generating a Table
-of Contents}).@refill
-
-The chapter structuring commands do not create an Info node structure,
-so normally you should put an @code{@@node} command immediately before
-each chapter structuring command (@pxref{Nodes}). The only time you
-are likely to use the chapter structuring commands without using the
-node structuring commands is if you are writing a document that
-contains no cross references and will never be transformed into Info
-format.@refill
-
-It is unlikely that you will ever write a Texinfo file that is
-intended only as an Info file and not as a printable document. If you
-do, you might still use chapter structuring commands to create a
-heading at the top of each node---but you don't need to.@refill
-
-@menu
-* Tree Structuring:: A manual is like an upside down tree @dots{}
-* Structuring Command Types:: How to divide a manual into parts.
-* makeinfo top:: The @code{@@top} command, part of the `Top' node.
-* chapter::
-* unnumbered & appendix::
-* majorheading & chapheading::
-* section::
-* unnumberedsec appendixsec heading::
-* subsection::
-* unnumberedsubsec appendixsubsec subheading::
-* subsubsection:: Commands for the lowest level sections.
-* Raise/lower sections:: How to change commands' hierarchical level.
-@end menu
-
-@node Tree Structuring, Structuring Command Types, Structuring, Structuring
-@comment node-name, next, previous, up
-@section Tree Structure of Sections
-@cindex Tree structuring
-
-A Texinfo file is usually structured like a book with chapters,
-sections, subsections, and the like. This structure can be visualized
-as a tree (or rather as an upside-down tree) with the root at the top
-and the levels corresponding to chapters, sections, subsection, and
-subsubsections.@refill
-
-Here is a diagram that shows a Texinfo file with three chapters,
-each of which has two sections.@refill
-
-@example
-@group
- Top
- |
- -------------------------------------
- | | |
- Chapter 1 Chapter 2 Chapter 3
- | | |
- -------- -------- --------
- | | | | | |
- Section Section Section Section Section Section
- 1.1 1.2 2.1 2.2 3.1 3.2
-
-@end group
-@end example
-
-In a Texinfo file that has this structure, the beginning of Chapter 2
-looks like this:@refill
-
-@example
-@group
-@@node Chapter 2, Chapter 3, Chapter 1, top
-@@chapter Chapter 2
-@end group
-@end example
-
-The chapter structuring commands are described in the sections that
-follow; the @code{@@node} and @code{@@menu} commands are described in
-following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
-
-@node Structuring Command Types, makeinfo top, Tree Structuring, Structuring
-@comment node-name, next, previous, up
-@section Types of Structuring Commands
-
-The chapter structuring commands fall into four groups or series, each
-of which contains structuring commands corresponding to the
-hierarchical levels of chapters, sections, subsections, and
-subsubsections.@refill
-
-The four groups are the @code{@@chapter} series, the
-@code{@@unnumbered} series, the @code{@@appendix} series, and the
-@code{@@heading} series.@refill
-
-Each command produces titles that have a different appearance on the
-printed page or Info file; only some of the commands produce
-titles that are listed in the table of contents of a printed book or
-manual.@refill
-
-@itemize @bullet
-@item
-The @code{@@chapter} and @code{@@appendix} series of commands produce
-numbered or lettered entries both in the body of a printed work and in
-its table of contents.@refill
-
-@item
-The @code{@@unnumbered} series of commands produce unnumbered entries
-both in the body of a printed work and in its table of contents. The
-@code{@@top} command, which has a special use, is a member of this
-series (@pxref{makeinfo top, , @code{@@top}}).@refill
-
-@item
-The @code{@@heading} series of commands produce unnumbered headings
-that do not appear in a table of contents. The heading commands never
-start a new page.@refill
-
-@item
-The @code{@@majorheading} command produces results similar to using
-the @code{@@chapheading} command but generates a larger vertical
-whitespace before the heading.@refill
-
-@item
-When an @code{@@setchapternewpage} command says to do so, the
-@code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
-start new pages in the printed manual; the @code{@@heading} commands
-do not.@refill
-@end itemize
-
-@need 1000
-Here are the four groups of chapter structuring commands:@refill
-
-@c Slightly different formatting for regular sized books and smallbooks.
-@ifset smallbook
-@sp 1
-@tex
-{\let\rm=\indrm \let\tt=\indtt
-\halign{\hskip\itemindent#\hfil& \hskip.5em#\hfil& \hskip.5em#\hfil&
-\hskip.5em#\hfil\cr
-
-& & & \rm No new pages\cr
-\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
-\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
-
-& & & \cr
- & \tt @@top& & \tt @@majorheading\cr
-\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
-\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
-\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
-\tt @@subheading\cr
-\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
-\tt @@subsubheading\cr}}
-@end tex
-@end ifset
-@ifclear smallbook
-@sp 1
-@tex
-\vbox{
-\halign{\hskip\itemindent\hskip.5em#\hfil& \hskip.5em#\hfil&
-\hskip.5em#\hfil& \hskip.5em #\hfil\cr
-
-& & & \cr
-& & & \rm No new pages\cr
-\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
-\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
-
-& & & \cr
- & \tt @@top& & \tt @@majorheading\cr
-\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
-\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
-\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
-\tt @@subheading\cr
-\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
-\tt @@subsubheading\cr}}
-@end tex
-@end ifclear
-@ifinfo
-@example
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end example
-@end ifinfo
-
-@c Cannot line up columns properly inside of an example because of roman
-@c proportional fonts.
-@ignore
-@ifset smallbook
-@iftex
-@smallexample
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end smallexample
-@end iftex
-@end ifset
-@ifclear smallbook
-@iftex
-@smallexample
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end smallexample
-@end iftex
-@end ignore
-
-@node makeinfo top, chapter, Structuring Command Types, Structuring
-@comment node-name, next, previous, up
-@section @code{@@top}
-
-The @code{@@top} command is a special sectioning command that you use
-only after an @samp{@@node Top} line at the beginning of a Texinfo file.
-The @code{@@top} command tells the @code{makeinfo} formatter
-which node is the `Top'
-node. It has the same typesetting effect as @code{@@unnumbered}
-(@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}).
-For detailed information, see
-@ref{makeinfo top command, , The @code{@@top} Command}.@refill
-
-@node chapter, unnumbered & appendix, makeinfo top, Structuring
-@comment node-name, next, previous, up
-@section @code{@@chapter}
-@findex chapter
-
-@code{@@chapter} identifies a chapter in the document. Write the
-command at the beginning of a line and follow it on the same line by
-the title of the chapter.@refill
-
-For example, this chapter in this manual is entitled ``Chapter
-Structuring''; the @code{@@chapter} line looks like this:@refill
-
-@example
-@@chapter Chapter Structuring
-@end example
-
-In @TeX{}, the @code{@@chapter} command creates a chapter in the
-document, specifying the chapter title. The chapter is numbered
-automatically.@refill
-
-In Info, the @code{@@chapter} command causes the title to appear on a
-line by itself, with a line of asterisks inserted underneath. Thus,
-in Info, the above example produces the following output:@refill
-
-@example
-Chapter Structuring
-*******************
-@end example
-
-@findex centerchap
-Texinfo also provides a command @code{@@centerchap}, which is analogous
-to @code{@@unnumbered}, but centers its argument in the printed output.
-This kind of stylistic choice is not usually offered by Texinfo.
-@c but the Hacker's Dictionary wanted it ...
-
-
-@node unnumbered & appendix, majorheading & chapheading, chapter, Structuring
-@comment node-name, next, previous, up
-@section @code{@@unnumbered}, @code{@@appendix}
-@findex unnumbered
-@findex appendix
-
-Use the @code{@@unnumbered} command to create a chapter that appears
-in a printed manual without chapter numbers of any kind. Use the
-@code{@@appendix} command to create an appendix in a printed manual
-that is labelled by letter instead of by number.@refill
-
-For Info file output, the @code{@@unnumbered} and @code{@@appendix}
-commands are equivalent to @code{@@chapter}: the title is printed on a
-line by itself with a line of asterisks underneath. (@xref{chapter, ,
-@code{@@chapter}}.)@refill
-
-To create an appendix or an unnumbered chapter, write an
-@code{@@appendix} or @code{@@unnumbered} command at the beginning of a
-line and follow it on the same line by the title, as you would if you
-were creating a chapter.@refill
-
-
-@node majorheading & chapheading, section, unnumbered & appendix, Structuring
-@section @code{@@majorheading}, @code{@@chapheading}
-@findex majorheading
-@findex chapheading
-
-The @code{@@majorheading} and @code{@@chapheading} commands put
-chapter-like headings in the body of a document.@refill
-
-However, neither command causes @TeX{} to produce a numbered heading
-or an entry in the table of contents; and neither command causes
-@TeX{} to start a new page in a printed manual.@refill
-
-In @TeX{}, an @code{@@majorheading} command generates a larger vertical
-whitespace before the heading than an @code{@@chapheading} command but
-is otherwise the same.@refill
-
-In Info,
-the @code{@@majorheading} and
-@code{@@chapheading} commands are equivalent to
-@code{@@chapter}: the title is printed on a line by itself with a line
-of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill
-
-@node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring
-@comment node-name, next, previous, up
-@section @code{@@section}
-@findex section
-
-In a printed manual, an @code{@@section} command identifies a
-numbered section within a chapter. The section title appears in the
-table of contents. In Info, an @code{@@section} command provides a
-title for a segment of text, underlined with @samp{=}.@refill
-
-This section is headed with an @code{@@section} command and looks like
-this in the Texinfo file:@refill
-
-@example
-@@section @@code@{@@@@section@}
-@end example
-
-To create a section, write the @code{@@section} command at the
-beginning of a line and follow it on the same line by the section
-title.@refill
-
-Thus,
-
-@example
-@@section This is a section
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This is a section
-=================
-@end group
-@end example
-
-@noindent
-in Info.
-
-@node unnumberedsec appendixsec heading, subsection, section, Structuring
-@comment node-name, next, previous, up
-@section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
-@findex unnumberedsec
-@findex appendixsec
-@findex heading
-
-The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
-commands are, respectively, the unnumbered, appendix-like, and
-heading-like equivalents of the @code{@@section} command.
-(@xref{section, , @code{@@section}}.)@refill
-
-@table @code
-@item @@unnumberedsec
-The @code{@@unnumberedsec} command may be used within an
-unnumbered chapter or within a regular chapter or appendix to
-provide an unnumbered section.@refill
-
-@item @@appendixsec
-@itemx @@appendixsection
-@code{@@appendixsection} is a longer spelling of the
-@code{@@appendixsec} command; the two are synonymous.@refill
-@findex appendixsection
-
-Conventionally, the @code{@@appendixsec} or @code{@@appendixsection}
-command is used only within appendices.@refill
-
-@item @@heading
-You may use the @code{@@heading} command anywhere you wish for a
-section-style heading that will not appear in the table of contents.@refill
-@end table
-
-@node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring
-@comment node-name, next, previous, up
-@section The @code{@@subsection} Command
-@findex subsection
-
-Subsections are to sections as sections are to chapters.
-(@xref{section, , @code{@@section}}.) In Info, subsection titles are
-underlined with @samp{-}. For example,@refill
-
-@example
-@@subsection This is a subsection
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This is a subsection
---------------------
-@end group
-@end example
-
-In a printed manual, subsections are listed in the table of contents
-and are numbered three levels deep.@refill
-
-@node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring
-@comment node-name, next, previous, up
-@section The @code{@@subsection}-like Commands
-@cindex Subsection-like commands
-@findex unnumberedsubsec
-@findex appendixsubsec
-@findex subheading
-
-The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
-@code{@@subheading} commands are, respectively, the unnumbered,
-appendix-like, and heading-like equivalents of the @code{@@subsection}
-command. (@xref{subsection, , @code{@@subsection}}.)@refill
-
-In Info, the @code{@@subsection}-like commands generate a title
-underlined with hyphens. In a printed manual, an @code{@@subheading}
-command produces a heading like that of a subsection except that it is
-not numbered and does not appear in the table of contents. Similarly,
-an @code{@@unnumberedsubsec} command produces an unnumbered heading like
-that of a subsection and an @code{@@appendixsubsec} command produces a
-subsection-like heading labelled with a letter and numbers; both of
-these commands produce headings that appear in the table of
-contents.@refill
-
-@node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring
-@comment node-name, next, previous, up
-@section The `subsub' Commands
-@cindex Subsub commands
-@findex subsubsection
-@findex unnumberedsubsubsec
-@findex appendixsubsubsec
-@findex subsubheading
-
-The fourth and lowest level sectioning commands in Texinfo are the
-`subsub' commands. They are:@refill
-
-@table @code
-@item @@subsubsection
-Subsubsections are to subsections as subsections are to sections.
-(@xref{subsection, , @code{@@subsection}}.) In a printed manual,
-subsubsection titles appear in the table of contents and are numbered
-four levels deep.@refill
-
-@item @@unnumberedsubsubsec
-Unnumbered subsubsection titles appear in the table of contents of a
-printed manual, but lack numbers. Otherwise, unnumbered
-subsubsections are the same as subsubsections. In Info, unnumbered
-subsubsections look exactly like ordinary subsubsections.@refill
-
-@item @@appendixsubsubsec
-Conventionally, appendix commands are used only for appendices and are
-lettered and numbered appropriately in a printed manual. They also
-appear in the table of contents. In Info, appendix subsubsections look
-exactly like ordinary subsubsections.@refill
-
-@item @@subsubheading
-The @code{@@subsubheading} command may be used anywhere that you need
-a small heading that will not appear in the table of contents. In
-Info, subsubheadings look exactly like ordinary subsubsection
-headings.@refill
-@end table
-
-In Info, `subsub' titles are underlined with periods.
-For example,@refill
-
-@example
-@@subsubsection This is a subsubsection
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This is a subsubsection
-.......................
-@end group
-@end example
-
-@node Raise/lower sections, , subsubsection, Structuring
-@comment node-name, next, previous, up
-@section @code{@@raisesections} and @code{@@lowersections}
-@findex raisesections
-@findex lowersections
-@cindex Raising and lowering sections
-@cindex Sections, raising and lowering
-
-The @code{@@raisesections} and @code{@@lowersections} commands raise and
-lower the hierarchical level of chapters, sections, subsections and the
-like. The @code{@@raisesections} command changes sections to chapters,
-subsections to sections, and so on. The @code{@@lowersections} command
-changes chapters to sections, sections to subsections, and so on.
-
-@cindex Include files, and section levels
-An @code{@@lowersections} command is useful if you wish to include text
-that is written as an outer or standalone Texinfo file in another
-Texinfo file as an inner, included file. If you write the command at
-the beginning of the file, all your @code{@@chapter} commands are
-formatted as if they were @code{@@section} commands, all your
-@code{@@section} command are formatted as if they were
-@code{@@subsection} commands, and so on.
-
-@need 1000
-@code{@@raisesections} raises a command one level in the chapter
-structuring hierarchy:@refill
-
-@example
-@group
- @r{Change} @r{To}
-
-@@subsection @@section,
-@@section @@chapter,
-@@heading @@chapheading,
- @r{etc.}
-@end group
-@end example
-
-@need 1000
-@code{@@lowersections} lowers a command one level in the chapter
-structuring hierarchy:@refill
-
-@example
-@group
- @r{Change} @r{To}
-
-@@chapter @@section,
-@@subsection @@subsubsection,
-@@heading @@subheading,
- @r{etc.}
-@end group
-@end example
-
-An @code{@@raisesections} or @code{@@lowersections} command changes only
-those structuring commands that follow the command in the Texinfo file.
-Write an @code{@@raisesections} or @code{@@lowersections} command on a
-line of its own.
-
-An @code{@@lowersections} command cancels an @code{@@raisesections}
-command, and vice versa. Typically, the commands are used like this:
-
-@example
-@@lowersections
-@@include somefile.texi
-@@raisesections
-@end example
-
-Without the @code{@@raisesections}, all the subsequent sections in your
-document will be lowered.
-
-Repeated use of the commands continue to raise or lower the hierarchical
-level a step at a time.
-
-An attempt to raise above `chapters' reproduces chapter commands; an
-attempt to lower below `subsubsections' reproduces subsubsection
-commands.
-
-@node Nodes, Menus, Structuring, Top
-@comment node-name, next, previous, up
-@chapter Nodes
-
-@dfn{Nodes} are the primary segments of a Texinfo file. They do not
-themselves impose a hierarchic or any other kind of structure on a file.
-Nodes contain @dfn{node pointers} that name other nodes, and can contain
-@dfn{menus} which are lists of nodes. In Info, the movement commands
-can carry you to a pointed-to node or to a node listed in a menu. Node
-pointers and menus provide structure for Info files just as chapters,
-sections, subsections, and the like, provide structure for printed
-books.@refill
-
-@menu
-* Two Paths:: Different commands to structure
- Info output and printed output.
-* Node Menu Illustration:: A diagram, and sample nodes and menus.
-* node:: How to write a node, in detail.
-* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
-@end menu
-
-@node Two Paths, Node Menu Illustration, Nodes, Nodes
-@ifinfo
-@heading Two Paths
-@end ifinfo
-
-The node and menu commands and the chapter structuring commands are
-independent of each other:
-
-@itemize @bullet
-@item
-In Info, node and menu commands provide structure. The chapter
-structuring commands generate headings with different kinds of
-underlining---asterisks for chapters, hyphens for sections, and so on;
-they do nothing else.@refill
-
-@item
-In @TeX{}, the chapter structuring commands generate chapter and section
-numbers and tables of contents. The node and menu commands provide
-information for cross references; they do nothing else.@refill
-@end itemize
-
-You can use node pointers and menus to structure an Info file any way
-you want; and you can write a Texinfo file so that its Info output has a
-different structure than its printed output. However, most Texinfo
-files are written such that the structure for the Info output
-corresponds to the structure for the printed output. It is not
-convenient to do otherwise.@refill
-
-Generally, printed output is structured in a tree-like hierarchy in
-which the chapters are the major limbs from which the sections branch
-out. Similarly, node pointers and menus are organized to create a
-matching structure in the Info output.@refill
-
-@node Node Menu Illustration, node, Two Paths, Nodes
-@comment node-name, next, previous, up
-@section Node and Menu Illustration
-
-Here is a copy of the diagram shown earlier that illustrates a Texinfo
-file with three chapters, each of which contains two sections.@refill
-
-Note that the ``root'' is at the top of the diagram and the ``leaves''
-are at the bottom. This is how such a diagram is drawn conventionally;
-it illustrates an upside-down tree. For this reason, the root node is
-called the `Top' node, and `Up' node pointers carry you closer to the
-root.@refill
-
-@example
-@group
- Top
- |
- -------------------------------------
- | | |
- Chapter 1 Chapter 2 Chapter 3
- | | |
- -------- -------- --------
- | | | | | |
- Section Section Section Section Section Section
- 1.1 1.2 2.1 2.2 3.1 3.2
-
-@end group
-@end example
-
-Write the beginning of the node for Chapter 2 like this:@refill
-
-@example
-@group
-@@node Chapter 2, Chapter 3, Chapter 1, top
-@@comment node-name, next, previous, up
-@end group
-@end example
-
-@noindent
-This @code{@@node} line says that the name of this node is ``Chapter 2'', the
-name of the `Next' node is ``Chapter 3'', the name of the `Previous'
-node is ``Chapter 1'', and the name of the `Up' node is ``Top''.
-
-@quotation
-@strong{Please Note:} `Next' refers to the next node at the same
-hierarchical level in the manual, not necessarily to the next node
-within the Texinfo file. In the Texinfo file, the subsequent node may
-be at a lower level---a section-level node may follow a chapter-level
-node, and a subsection-level node may follow a section-level node.
-`Next' and `Previous' refer to nodes at the @emph{same} hierarchical
-level. (The `Top' node contains the exception to this rule. Since the
-`Top' node is the only node at that level, `Next' refers to the first
-following node, which is almost always a chapter or chapter-level
-node.)@refill
-@end quotation
-
-To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
-2. (@xref{Menus}.) You would write the menu just
-before the beginning of Section 2.1, like this:@refill
-
-@example
-@group
- @@menu
- * Sect. 2.1:: Description of this section.
- * Sect. 2.2::
- @@end menu
-@end group
-@end example
-
-Write the node for Sect. 2.1 like this:@refill
-
-@example
-@group
- @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
- @@comment node-name, next, previous, up
-@end group
-@end example
-
-In Info format, the `Next' and `Previous' pointers of a node usually
-lead to other nodes at the same level---from chapter to chapter or from
-section to section (sometimes, as shown, the `Previous' pointer points
-up); an `Up' pointer usually leads to a node at the level above (closer
-to the `Top' node); and a `Menu' leads to nodes at a level below (closer
-to `leaves'). (A cross reference can point to a node at any level;
-see @ref{Cross References}.)@refill
-
-Usually, an @code{@@node} command and a chapter structuring command are
-used in sequence, along with indexing commands. (You may follow the
-@code{@@node} line with a comment line that reminds you which pointer is
-which.)@refill
-
-Here is the beginning of the chapter in this manual called ``Ending a
-Texinfo File''. This shows an @code{@@node} line followed by a comment
-line, an @code{@@chapter} line, and then by indexing lines.@refill
-
-@example
-@group
-@@node Ending a File, Structuring, Beginning a File, Top
-@@comment node-name, next, previous, up
-@@chapter Ending a Texinfo File
-@@cindex Ending a Texinfo file
-@@cindex Texinfo file ending
-@@cindex File ending
-@end group
-@end example
-
-@node node, makeinfo Pointer Creation, Node Menu Illustration, Nodes
-@comment node-name, next, previous, up
-@section The @code{@@node} Command
-
-@cindex Node, defined
-A @dfn{node} is a segment of text that begins at an @code{@@node}
-command and continues until the next @code{@@node} command. The
-definition of node is different from that for chapter or section. A
-chapter may contain sections and a section may contain subsections;
-but a node cannot contain subnodes; the text of a node continues only
-until the next @code{@@node} command in the file. A node usually
-contains only one chapter structuring command, the one that follows
-the @code{@@node} line. On the other hand, in printed output nodes
-are used only for cross references, so a chapter or section may
-contain any number of nodes. Indeed, a chapter usually contains
-several nodes, one for each section, subsection, and
-subsubsection.@refill
-
-To create a node, write an @code{@@node} command at the beginning of a
-line, and follow it with four arguments, separated by commas, on the
-rest of the same line. These arguments are the name of the node, and
-the names of the `Next', `Previous', and `Up' pointers, in that order.
-You may insert spaces before each pointer if you wish; the spaces are
-ignored. You must write the name of the node, and the names of the
-`Next', `Previous', and `Up' pointers, all on the same line. Otherwise,
-the formatters fail. (@inforef{Top, info, info}, for more information
-about nodes in Info.)@refill
-
-Usually, you write one of the chapter-structuring command lines
-immediately after an @code{@@node} line---for example, an
-@code{@@section} or @code{@@subsection} line. (@xref{Structuring
-Command Types, , Types of Structuring Commands}.)@refill
-
-@quotation
-@strong{Please note:} The GNU Emacs Texinfo mode updating commands work
-only with Texinfo files in which @code{@@node} lines are followed by chapter
-structuring lines. @xref{Updating Requirements}.@refill
-@end quotation
-
-@TeX{} uses @code{@@node} lines to identify the names to use for cross
-references. For this reason, you must write @code{@@node} lines in a
-Texinfo file that you intend to format for printing, even if you do not
-intend to format it for Info. (Cross references, such as the one at the
-end of this sentence, are made with @code{@@xref} and its related
-commands; see @ref{Cross References}.)@refill
-
-@menu
-* Node Names:: How to choose node and pointer names.
-* Writing a Node:: How to write an @code{@@node} line.
-* Node Line Tips:: Keep names short.
-* Node Line Requirements:: Keep names unique, without @@-commands.
-* First Node:: How to write a `Top' node.
-* makeinfo top command:: How to use the @code{@@top} command.
-* Top Node Summary:: Write a brief description for readers.
-@end menu
-
-@node Node Names, Writing a Node, node, node
-@ifinfo
-@subheading Choosing Node and Pointer Names
-@end ifinfo
-
-The name of a node identifies the node. The pointers enable
-you to reach other nodes and consist of the names of those nodes.@refill
-
-Normally, a node's `Up' pointer contains the name of the node whose menu
-mentions that node. The node's `Next' pointer contains the name of the
-node that follows that node in that menu and its `Previous' pointer
-contains the name of the node that precedes it in that menu. When a
-node's `Previous' node is the same as its `Up' node, both node pointers
-name the same node.@refill
-
-Usually, the first node of a Texinfo file is the `Top' node, and its
-`Up' and `Previous' pointers point to the @file{dir} file, which
-contains the main menu for all of Info.@refill
-
-The `Top' node itself contains the main or master menu for the manual.
-Also, it is helpful to include a brief description of the manual in the
-`Top' node. @xref{First Node}, for information on how to write the
-first node of a Texinfo file.@refill
-
-@node Writing a Node, Node Line Tips, Node Names, node
-@comment node-name, next, previous, up
-@subsection How to Write an @code{@@node} Line
-@cindex Writing an @code{@@node} line
-@cindex @code{@@node} line writing
-@cindex Node line writing
-
-The easiest way to write an @code{@@node} line is to write @code{@@node}
-at the beginning of a line and then the name of the node, like
-this:@refill
-
-@example
-@@node @var{node-name}
-@end example
-
-If you are using GNU Emacs, you can use the update node commands
-provided by Texinfo mode to insert the names of the pointers; or you
-can leave the pointers out of the Texinfo file and let @code{makeinfo}
-insert node pointers into the Info file it creates. (@xref{Texinfo
-Mode}, and @ref{makeinfo Pointer Creation}.)@refill
-
-Alternatively, you can insert the `Next', `Previous', and `Up'
-pointers yourself. If you do this, you may find it helpful to use the
-Texinfo mode keyboard command @kbd{C-c C-c n}. This command inserts
-@samp{@@node} and a comment line listing the names of the pointers in
-their proper order. The comment line helps you keep track of which
-arguments are for which pointers. This comment line is especially useful
-if you are not familiar with Texinfo.@refill
-
-The template for a node line with `Next', `Previous', and `Up' pointers
-looks like this:@refill
-
-@example
-@@node @var{node-name}, @var{next}, @var{previous}, @var{up}
-@end example
-
-If you wish, you can ignore @code{@@node} lines altogether in your first
-draft and then use the @code{texinfo-insert-node-lines} command to
-create @code{@@node} lines for you. However, we do not
-recommend this practice. It is better to name the node itself
-at the same time that you
-write a segment so you can easily make cross references. A large number
-of cross references are an especially important feature of a good Info
-file.@refill
-
-After you have inserted an @code{@@node} line, you should immediately
-write an @@-command for the chapter or section and insert its name.
-Next (and this is important!), put in several index entries. Usually,
-you will find at least two and often as many as four or five ways of
-referring to the node in the index. Use them all. This will make it
-much easier for people to find the node.@refill
-
-@node Node Line Tips, Node Line Requirements, Writing a Node, node
-@comment node-name, next, previous, up
-@subsection @code{@@node} Line Tips
-
-Here are three suggestions:
-
-@itemize @bullet
-@item
-Try to pick node names that are informative but short.@refill
-
-In the Info file, the file name, node name, and pointer names are all
-inserted on one line, which may run into the right edge of the window.
-(This does not cause a problem with Info, but is ugly.)@refill
-
-@item
-Try to pick node names that differ from each other near the beginnings
-of their names. This way, it is easy to use automatic name completion in
-Info.@refill
-
-@item
-By convention, node names are capitalized just as they would be for
-section or chapter titles---initial and significant words are
-capitalized; others are not.@refill
-@end itemize
-
-@node Node Line Requirements, First Node, Node Line Tips, node
-@comment node-name, next, previous, up
-@subsection @code{@@node} Line Requirements
-
-@cindex Node line requirements
-Here are several requirements for @code{@@node} lines:
-
-@itemize @bullet
-@cindex Unique nodename requirement
-@cindex Nodename must be unique
-@item
-All the node names for a single Info file must be unique.@refill
-
-Duplicates confuse the Info movement commands. This means, for
-example, that if you end every chapter with a summary, you must name
-each summary node differently. You cannot just call each one
-``Summary''. You may, however, duplicate the titles of chapters, sections,
-and the like. Thus you can end each chapter in a book with a section
-called ``Summary'', so long as the node names for those sections are all
-different.@refill
-
-@item
-A pointer name must be the name of a node.@refill
-
-The node to which a pointer points may come before or after the
-node containing the pointer.@refill
-
-@cindex @@-command in nodename
-@cindex Nodename, cannot contain
-@item
-You cannot use any of the Texinfo @@-commands in a node name;
-@w{@@-commands} confuse Info.@refill
-
-@need 750
-Thus, the beginning of the section called @code{@@chapter} looks like
-this:@refill
-
-@smallexample
-@group
-@@node chapter, unnumbered & appendix, makeinfo top, Structuring
-@@comment node-name, next, previous, up
-@@section @@code@{@@@@chapter@}
-@@findex chapter
-@end group
-@end smallexample
-
-@cindex Comma in nodename
-@cindex Apostrophe in nodename
-@item
-You cannot use commas or apostrophes within a node name; these
-confuse @TeX{} or the Info formatters.@refill
-
-@need 700
-For example, the following is a section title:
-
-@smallexample
-@@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@}
-@end smallexample
-
-@noindent
-The corresponding node name is:
-
-@smallexample
-unnumberedsec appendixsec heading
-@end smallexample
-
-@cindex Case in nodename
-@item
-Case is significant.
-@end itemize
-
-
-@node First Node, makeinfo top command, Node Line Requirements, node
-@comment node-name, next, previous, up
-@subsection The First Node
-@cindex Top node is first
-@cindex First node
-
-The first node of a Texinfo file is the @dfn{Top} node, except in an
-included file (@pxref{Include Files}). The Top node contains the main
-or master menu for the document, and a short summary of the document
-(@pxref{Top Node Summary}).
-
-@cindex Up node of Top node
-@cindex (dir) as Up node of Top node
-The Top node (which must be named @samp{top} or @samp{Top}) should have
-as its `Up' node the name of a node in another file, where there is a
-menu that leads to this file. Specify the file name in parentheses. If
-the file is to be installed directly in the Info directory file, use
-@samp{(dir)} as the parent of the Top node; this is short for
-@samp{(dir)top}, and specifies the Top node in the @file{dir} file,
-which contains the main menu for the Info system as a whole. For
-example, the @code{@@node Top} line of this manual looks like this:
-
-@example
-@@node Top, Copying, , (dir)
-@end example
-
-@noindent
-(You can use the Texinfo updating commands or the @code{makeinfo}
-utility to insert these pointers automatically.)
-
-@cindex Previous node of Top node
-Do not define the `Previous' node of the Top node to be @samp{(dir)}, as
-it causes confusing behavior for users: if you are in the Top node and
-hits @key{DEL} to go backwards, you wind up in the middle of the
-some other entry in the @file{dir} file, which has nothing to do with
-what you were reading.
-
-@xref{Install an Info File}, for more information about installing
-an Info file in the @file{info} directory.
-
-
-@node makeinfo top command, Top Node Summary, First Node, node
-@comment node-name, next, previous, up
-@subsection The @code{@@top} Sectioning Command
-@findex top @r{(@@-command)}
-
-A special sectioning command, @code{@@top}, has been created for use
-with the @code{@@node Top} line. The @code{@@top} sectioning command tells
-@code{makeinfo} that it marks the `Top' node in the file. It provides
-the information that @code{makeinfo} needs to insert node
-pointers automatically. Write the @code{@@top} command at the
-beginning of the line immediately following the @code{@@node Top}
-line. Write the title on the remaining part of the same line as the
-@code{@@top} command.@refill
-
-In Info, the @code{@@top} sectioning command causes the title to appear on a
-line by itself, with a line of asterisks inserted underneath.@refill
-
-In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
-sectioning command is merely a synonym for @code{@@unnumbered}.
-Neither of these formatters require an @code{@@top} command, and do
-nothing special with it. You can use @code{@@chapter} or
-@code{@@unnumbered} after the @code{@@node Top} line when you use
-these formatters. Also, you can use @code{@@chapter} or
-@code{@@unnumbered} when you use the Texinfo updating commands to
-create or update pointers and menus.@refill
-
-
-@node Top Node Summary, , makeinfo top command, node
-@subsection The `Top' Node Summary
-@cindex @samp{@r{Top}} node summary
-
-You can help readers by writing a summary in the `Top' node, after the
-@code{@@top} line, before the main or master menu. The summary should
-briefly describe the document. In Info, this summary will appear just
-before the master menu. In a printed manual, this summary will appear
-on a page of its own.@refill
-
-If you do not want the summary to appear on a page of its own in a
-printed manual, you can enclose the whole of the `Top' node, including
-the @code{@@node Top} line and the @code{@@top} sectioning command line
-or other sectioning command line between @code{@@ifinfo} and @code{@@end
-ifinfo}. This prevents any of the text from appearing in the printed
-output. (@pxref{Conditionals, , Conditionally Visible Text}). You can
-repeat the brief description from the `Top' node within @code{@@iftex}
-@dots{} @code{@@end iftex} at the beginning of the first chapter, for
-those who read the printed manual. This saves paper and may look
-neater.@refill
-
-You should write the version number of the program to which the manual
-applies in the summary. This helps the reader keep track of which
-manual is for which version of the program. If the manual changes more
-frequently than the program or is independent of it, you should also
-include an edition number for the manual. (The title page should also
-contain this information: see @ref{titlepage, ,
-@code{@@titlepage}}.)@refill
-
-@node makeinfo Pointer Creation, , node, Nodes
-@section Creating Pointers with @code{makeinfo}
-@cindex Creating pointers with @code{makeinfo}
-@cindex Pointer creation with @code{makeinfo}
-@cindex Automatic pointer creation with @code{makeinfo}
-
-The @code{makeinfo} program has a feature for automatically creating
-node pointers for a hierarchically organized file that lacks
-them.@refill
-
-When you take advantage of this feature, you do not need to write the
-`Next', `Previous', and `Up' pointers after the name of a node.
-However, you must write a sectioning command, such as @code{@@chapter}
-or @code{@@section}, on the line immediately following each truncated
-@code{@@node} line. You cannot write a comment line after a node
-line; the section line must follow it immediately.@refill
-
-In addition, you must follow the `Top' @code{@@node} line with a line beginning
-with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo
-top, , @code{@@top}}.
-
-Finally, you must write the name of each node (except for the `Top'
-node) in a menu that is one or more hierarchical levels above the
-node's hierarchical level.@refill
-
-This node pointer insertion feature in @code{makeinfo} is an
-alternative to the menu and pointer creation and update commands in
-Texinfo mode. (@xref{Updating Nodes and Menus}.) It is especially
-helpful to people who do not use GNU Emacs for writing Texinfo
-documents.@refill
-
-@node Menus, Cross References, Nodes, Top
-@comment node-name, next, previous, up
-@chapter Menus
-@cindex Menus
-@findex menu
-
-@dfn{Menus} contain pointers to subordinate
-nodes.@footnote{Menus can carry you to any node, regardless
-of the hierarchical structure; even to nodes in a different
-Info file. However, the GNU Emacs Texinfo mode updating
-commands work only to create menus of subordinate nodes.
-Conventionally, cross references are used to refer to other
-nodes.} In Info, you use menus to go to such nodes. Menus
-have no effect in printed manuals and do not appear in
-them.@refill
-
-By convention, a menu is put at the end of a node since a reader who
-uses the menu may not see text that follows it.@refill
-
-@ifinfo
-A node that has a menu should @emph{not} contain much text. If you
-have a lot of text and a menu, move most of the text into a new
-subnode---all but a few lines.@refill
-@end ifinfo
-@iftex
-@emph{A node that has a menu should not contain much text.} If you
-have a lot of text and a menu, move most of the text into a new
-subnode---all but a few lines. Otherwise, a reader with a terminal
-that displays only a few lines may miss the menu and its associated
-text. As a practical matter, you should locate a menu within 20 lines
-of the beginning of the node.@refill
-@end iftex
-
-@menu
-* Menu Location:: Put a menu in a short node.
-* Writing a Menu:: What is a menu?
-* Menu Parts:: A menu entry has three parts.
-* Less Cluttered Menu Entry:: Two part menu entry.
-* Menu Example:: Two and three part menu entries.
-* Other Info Files:: How to refer to a different Info file.
-@end menu
-
-@node Menu Location, Writing a Menu, Menus, Menus
-@ifinfo
-@heading Menus Need Short Nodes
-@end ifinfo
-@cindex Menu location
-@cindex Location of menus
-@cindex Nodes for menus are short
-@cindex Short nodes for menus
-
-@ifinfo
-A reader can easily see a menu that is close to the beginning of the
-node. The node should be short. As a practical matter, you should
-locate a menu within 20 lines of the beginning of the node.
-Otherwise, a reader with a terminal that displays only a few lines may
-miss the menu and its associated text.@refill
-@end ifinfo
-
-The short text before a menu may look awkward in a printed manual. To
-avoid this, you can write a menu near the beginning of its node and
-follow the menu by an @code{@@node} line, and then an @code{@@heading}
-line located within @code{@@ifinfo} and @code{@@end ifinfo}. This way,
-the menu, @code{@@node} line, and title appear only in the Info file,
-not the printed document.@refill
-
-For example, the preceding two paragraphs follow an Info-only menu,
-@code{@@node} line, and heading, and look like this:@refill
-
-@example
-@group
-@@menu
-* Menu Location:: Put a menu in a short node.
-* Writing a Menu:: What is a menu?
-* Menu Parts:: A menu entry has three parts.
-* Less Cluttered Menu Entry:: Two part menu entry.
-* Menu Example:: Two and three part entries.
-* Other Info Files:: How to refer to a different
- Info file.
-@@end menu
-
-@@node Menu Location, Writing a Menu, , Menus
-@@ifinfo
-@@heading Menus Need Short Nodes
-@@end ifinfo
-@end group
-@end example
-
-The Texinfo file for this document contains more than a dozen
-examples of this procedure. One is at the beginning of this chapter;
-another is at the beginning of the ``Cross References'' chapter.@refill
-
-@node Writing a Menu, Menu Parts, Menu Location, Menus
-@section Writing a Menu
-@cindex Writing a menu
-@cindex Menu writing
-
-A menu consists of an @code{@@menu} command on a line by
-itself followed by menu entry lines or menu comment lines
-and then by an @code{@@end menu} command on a line by
-itself.@refill
-
-A menu looks like this:@refill
-
-@example
-@group
-@@menu
-Larger Units of Text
-
-* Files:: All about handling files.
-* Multiples: Buffers. Multiple buffers; editing
- several files at once.
-@@end menu
-@end group
-@end example
-
-In a menu, every line that begins with an @w{@samp{* }} is a
-@dfn{menu entry}. (Note the space after the asterisk.) A
-line that does not start with an @w{@samp{* }} may also
-appear in a menu. Such a line is not a menu entry but is a
-menu comment line that appears in the Info file. In
-the example above, the line @samp{Larger Units of Text} is a
-menu comment line; the two lines starting with @w{@samp{* }}
-are menu entries.
-
-@node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus
-@section The Parts of a Menu
-@cindex Parts of a menu
-@cindex Menu parts
-@cindex @code{@@menu} parts
-
-A menu entry has three parts, only the second of which is required:
-
-@enumerate
-@item
-The menu entry name (optional).
-
-@item
-The name of the node (required).
-
-@item
-A description of the item (optional).
-@end enumerate
-
-The template for a menu entry looks like this:@refill
-
-@example
-* @var{menu-entry-name}: @var{node-name}. @var{description}
-@end example
-
-Follow the menu entry name with a single colon and follow the node name
-with tab, comma, period, or newline.@refill
-
-In Info, a user selects a node with the @kbd{m} (@code{Info-menu})
-command. The menu entry name is what the user types after the @kbd{m}
-command.@refill
-
-The third part of a menu entry is a descriptive phrase or sentence.
-Menu entry names and node names are often short; the description
-explains to the reader what the node is about. A useful description
-complements the node name rather than repeats it. The description,
-which is optional, can spread over two or more lines; if it does, some
-authors prefer to indent the second line while others prefer to align it
-with the first (and all others). It's up to you.
-
-
-@node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus
-@comment node-name, next, previous, up
-@section Less Cluttered Menu Entry
-@cindex Two part menu entry
-@cindex Double-colon menu entries
-@cindex Menu entries with two colons
-@cindex Less cluttered menu entry
-@cindex Uncluttered menu entry
-
-When the menu entry name and node name are the same, you can write
-the name immediately after the asterisk and space at the beginning of
-the line and follow the name with two colons.@refill
-
-@need 800
-For example, write
-
-@example
-* Name:: @var{description}
-@end example
-
-@need 800
-@noindent
-instead of
-
-@example
-* Name: Name. @var{description}
-@end example
-
-You should use the node name for the menu entry name whenever possible,
-since it reduces visual clutter in the menu.@refill
-
-@node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus
-@comment node-name, next, previous, up
-@section A Menu Example
-@cindex Menu example
-@cindex Example menu
-
-A menu looks like this in Texinfo:@refill
-
-@example
-@group
-@@menu
-* menu entry name: Node name. A short description.
-* Node name:: This form is preferred.
-@@end menu
-@end group
-@end example
-
-@need 800
-@noindent
-This produces:
-
-@example
-@group
-* menu:
-
-* menu entry name: Node name. A short description.
-* Node name:: This form is preferred.
-@end group
-@end example
-
-@need 700
-Here is an example as you might see it in a Texinfo file:@refill
-
-@example
-@group
-@@menu
-Larger Units of Text
-
-* Files:: All about handling files.
-* Multiples: Buffers. Multiple buffers; editing
- several files at once.
-@@end menu
-@end group
-@end example
-
-@need 800
-@noindent
-This produces:
-
-@example
-@group
-* menu:
-Larger Units of Text
-
-* Files:: All about handling files.
-* Multiples: Buffers. Multiple buffers; editing
- several files at once.
-@end group
-@end example
-
-In this example, the menu has two entries. @samp{Files} is both a menu
-entry name and the name of the node referred to by that name.
-@samp{Multiples} is the menu entry name; it refers to the node named
-@samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
-appears in the menu, but is not an entry.@refill
-
-Since no file name is specified with either @samp{Files} or
-@samp{Buffers}, they must be the names of nodes in the same Info file
-(@pxref{Other Info Files, , Referring to Other Info Files}).@refill
-
-@node Other Info Files, , Menu Example, Menus
-@comment node-name, next, previous, up
-@section Referring to Other Info Files
-@cindex Referring to other Info files
-@cindex Nodes in other Info files
-@cindex Other Info files' nodes
-@cindex Going to other Info files' nodes
-@cindex Info; other files' nodes
-
-You can create a menu entry that enables a reader in Info to go to a
-node in another Info file by writing the file name in parentheses just
-before the node name. In this case, you should use the three-part menu
-entry format, which saves the reader from having to type the file
-name.@refill
-
-@need 800
-The format looks like this:@refill
-
-@example
-@group
-@@menu
-* @var{first-entry-name}:(@var{filename})@var{nodename}. @var{description}
-* @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description}
-@@end menu
-@end group
-@end example
-
-For example, to refer directly to the @samp{Outlining} and
-@samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a
-menu like this:@refill
-
-@example
-@group
-@@menu
-* Outlining: (emacs)Outline Mode. The major mode for
- editing outlines.
-* Rebinding: (emacs)Rebinding. How to redefine the
- meaning of a key.
-@@end menu
-@end group
-@end example
-
-If you do not list the node name, but only name the file, then Info
-presumes that you are referring to the `Top' node.@refill
-
-The @file{dir} file that contains the main menu for Info has menu
-entries that list only file names. These take you directly to the `Top'
-nodes of each Info document. (@xref{Install an Info File}.)@refill
-
-@need 700
-For example:
-
-@example
-@group
-* Info: (info). Documentation browsing system.
-* Emacs: (emacs). The extensible, self-documenting
- text editor.
-@end group
-@end example
-
-@noindent
-(The @file{dir} top level directory for the Info system is an Info file,
-not a Texinfo file, but a menu entry looks the same in both types of
-file.)@refill
-
-Note that the GNU Emacs Texinfo mode menu updating commands only work
-with nodes within the current buffer, so you cannot use them to create
-menus that refer to other files. You must write such menus by hand.@refill
-
-@node Cross References, Marking Text, Menus, Top
-@comment node-name, next, previous, up
-@chapter Cross References
-@cindex Making cross references
-@cindex Cross references
-@cindex References
-
-@dfn{Cross references} are used to refer the reader to other parts of the
-same or different Texinfo files. In Texinfo, nodes are the
-places to which cross references can refer.@refill
-
-@menu
-* References:: What cross references are for.
-* Cross Reference Commands:: A summary of the different commands.
-* Cross Reference Parts:: A cross reference has several parts.
-* xref:: Begin a reference with `See' @dots{}
-* Top Node Naming:: How to refer to the beginning of another file.
-* ref:: A reference for the last part of a sentence.
-* pxref:: How to write a parenthetical cross reference.
-* inforef:: How to refer to an Info-only file.
-* uref:: How to refer to a uniform resource locator.
-@end menu
-
-@node References, Cross Reference Commands, Cross References, Cross References
-@ifinfo
-@heading What References Are For
-@end ifinfo
-
-Often, but not always, a printed document should be designed so that
-it can be read sequentially. People tire of flipping back and forth
-to find information that should be presented to them as they need
-it.@refill
-
-However, in any document, some information will be too detailed for
-the current context, or incidental to it; use cross references to
-provide access to such information. Also, an on-line help system or a
-reference manual is not like a novel; few read such documents in
-sequence from beginning to end. Instead, people look up what they
-need. For this reason, such creations should contain many cross
-references to help readers find other information that they may not
-have read.@refill
-
-In a printed manual, a cross reference results in a page reference,
-unless it is to another manual altogether, in which case the cross
-reference names that manual.@refill
-
-In Info, a cross reference results in an entry that you can follow using
-the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info
-commands, info}.)@refill
-
-The various cross reference commands use nodes to define cross
-reference locations. This is evident in Info, in which a cross
-reference takes you to the specified node. @TeX{} also uses nodes to
-define cross reference locations, but the action is less obvious. When
-@TeX{} generates a DVI file, it records nodes' page numbers and
-uses the page numbers in making references. Thus, if you are writing
-a manual that will only be printed, and will not be used on-line, you
-must nonetheless write @code{@@node} lines to name the places to which
-you make cross references.@refill
-
-@need 800
-@node Cross Reference Commands, Cross Reference Parts, References, Cross References
-@comment node-name, next, previous, up
-@section Different Cross Reference Commands
-@cindex Different cross reference commands
-
-There are four different cross reference commands:@refill
-
-@table @code
-@item @@xref
-Used to start a sentence in the printed manual saying @w{`See @dots{}'}
-or an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}.
-
-@item @@ref
-Used within or, more often, at the end of a sentence; same as
-@code{@@xref} for Info; produces just the reference in the printed
-manual without a preceding `See'.@refill
-
-@item @@pxref
-Used within parentheses to make a reference that suits both an Info
-file and a printed book. Starts with a lower case `see' within the
-printed manual. (@samp{p} is for `parenthesis'.)@refill
-
-@item @@inforef
-Used to make a reference to an Info file for which there is no printed
-manual.@refill
-@end table
-
-@noindent
-(The @code{@@cite} command is used to make references to books and
-manuals for which there is no corresponding Info file and, therefore,
-no node to which to point. @xref{cite, , @code{@@cite}}.)@refill
-
-@node Cross Reference Parts, xref, Cross Reference Commands, Cross References
-@comment node-name, next, previous, up
-@section Parts of a Cross Reference
-@cindex Cross reference parts
-@cindex Parts of a cross reference
-
-A cross reference command requires only one argument, which is the
-name of the node to which it refers. But a cross reference command
-may contain up to four additional arguments. By using these
-arguments, you can provide a cross reference name for Info, a topic
-description or section title for the printed output, the name of a
-different Info file, and the name of a different printed
-manual.@refill
-
-Here is a simple cross reference example:@refill
-
-@example
-@@xref@{Node name@}.
-@end example
-
-@noindent
-which produces
-
-@example
-*Note Node name::.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section @var{nnn} [Node name], page @var{ppp}.
-@end quotation
-
-@need 700
-Here is an example of a full five-part cross reference:@refill
-
-@example
-@group
-@@xref@{Node name, Cross Reference Name, Particular Topic,
-info-file-name, A Printed Manual@}, for details.
-@end group
-@end example
-
-@noindent
-which produces
-
-@example
-*Note Cross Reference Name: (info-file-name)Node name,
-for details.
-@end example
-
-@noindent
-in Info and
-
-@quotation
-See section ``Particular Topic'' in @i{A Printed Manual}, for details.
-@end quotation
-
-@noindent
-in a printed book.
-
-The five possible arguments for a cross reference are:@refill
-
-@enumerate
-@item
-The node name (required). This is the node to which the
-cross reference takes you. In a printed document, the location of the
-node provides the page reference only for references within the same
-document.@refill
-
-@item
-The cross reference name for the Info reference, if it is to be different
-from the node name. If you include this argument, it becomes
-the first part of the cross reference. It is usually omitted.@refill
-
-@item
-A topic description or section name. Often, this is the title of the
-section. This is used as the name of the reference in the printed
-manual. If omitted, the node name is used.@refill
-
-@item
-The name of the Info file in which the reference is located, if it is
-different from the current file. You need not include any @samp{.info}
-suffix on the file name, since Info readers try appending it
-automatically.
-
-@item
-The name of a printed manual from a different Texinfo file.@refill
-@end enumerate
-
-The template for a full five argument cross reference looks like
-this:@refill
-
-@example
-@group
-@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
-@var{info-file-name}, @var{printed-manual-title}@}.
-@end group
-@end example
-
-Cross references with one, two, three, four, and five arguments are
-described separately following the description of @code{@@xref}.@refill
-
-Write a node name in a cross reference in exactly the same way as in
-the @code{@@node} line, including the same capitalization; otherwise, the
-formatters may not find the reference.@refill
-
-You can write cross reference commands within a paragraph, but note
-how Info and @TeX{} format the output of each of the various commands:
-write @code{@@xref} at the beginning of a sentence; write
-@code{@@pxref} only within parentheses, and so on.@refill
-
-@node xref, Top Node Naming, Cross Reference Parts, Cross References
-@comment node-name, next, previous, up
-@section @code{@@xref}
-@findex xref
-@cindex Cross references using @code{@@xref}
-@cindex References using @code{@@xref}
-
-The @code{@@xref} command generates a cross reference for the
-beginning of a sentence. The Info formatting commands convert it into
-an Info cross reference, which the Info @samp{f} command can use to
-bring you directly to another node. The @TeX{} typesetting commands
-convert it into a page reference, or a reference to another book or
-manual.@refill
-
-@menu
-* Reference Syntax:: What a reference looks like and requires.
-* One Argument:: @code{@@xref} with one argument.
-* Two Arguments:: @code{@@xref} with two arguments.
-* Three Arguments:: @code{@@xref} with three arguments.
-* Four and Five Arguments:: @code{@@xref} with four and five arguments.
-@end menu
-
-@node Reference Syntax, One Argument, xref, xref
-@ifinfo
-@subheading What a Reference Looks Like and Requires
-@end ifinfo
-
-Most often, an Info cross reference looks like this:@refill
-
-@example
-*Note @var{node-name}::.
-@end example
-
-@noindent
-or like this
-
-@example
-*Note @var{cross-reference-name}: @var{node-name}.
-@end example
-
-@noindent
-In @TeX{}, a cross reference looks like this:
-
-@example
-See Section @var{section-number} [@var{node-name}], page @var{page}.
-@end example
-
-@noindent
-or like this
-
-@example
-See Section @var{section-number} [@var{title-or-topic}], page @var{page}.
-@end example
-
-The @code{@@xref} command does not generate a period or comma to end
-the cross reference in either the Info file or the printed output.
-You must write that period or comma yourself; otherwise, Info will not
-recognize the end of the reference. (The @code{@@pxref} command works
-differently. @xref{pxref, , @code{@@pxref}}.)@refill
-
-@quotation
-@strong{Please note:} A period or comma @strong{must} follow the closing
-brace of an @code{@@xref}. It is required to terminate the cross
-reference. This period or comma will appear in the output, both in
-the Info file and in the printed manual.@refill
-@end quotation
-
-@code{@@xref} must refer to an Info node by name. Use @code{@@node}
-to define the node (@pxref{Writing a Node}).@refill
-
-@code{@@xref} is followed by several arguments inside braces, separated by
-commas. Whitespace before and after these commas is ignored.@refill
-
-A cross reference requires only the name of a node; but it may contain
-up to four additional arguments. Each of these variations produces a
-cross reference that looks somewhat different.@refill
-
-@quotation
-@strong{Please note:} Commas separate arguments in a cross reference;
-avoid including them in the title or other part lest the formatters
-mistake them for separators.@refill
-@end quotation
-
-@node One Argument, Two Arguments, Reference Syntax, xref
-@subsection @code{@@xref} with One Argument
-
-The simplest form of @code{@@xref} takes one argument, the name of
-another node in the same Info file. The Info formatters produce
-output that the Info readers can use to jump to the reference; @TeX{}
-produces output that specifies the page and section number for you.@refill
-
-@need 700
-@noindent
-For example,
-
-@example
-@@xref@{Tropical Storms@}.
-@end example
-
-@noindent
-produces
-
-@example
-*Note Tropical Storms::.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section 3.1 [Tropical Storms], page 24.
-@end quotation
-
-@noindent
-(Note that in the preceding example the closing brace is followed by a
-period.)@refill
-
-You can write a clause after the cross reference, like this:@refill
-
-@example
-@@xref@{Tropical Storms@}, for more info.
-@end example
-
-@noindent
-which produces
-
-@example
-*Note Tropical Storms::, for more info.
-@end example
-
-@quotation
-See Section 3.1 [Tropical Storms], page 24, for more info.
-@end quotation
-
-@noindent
-(Note that in the preceding example the closing brace is followed by a
-comma, and then by the clause, which is followed by a period.)@refill
-
-@node Two Arguments, Three Arguments, One Argument, xref
-@subsection @code{@@xref} with Two Arguments
-
-With two arguments, the second is used as the name of the Info cross
-reference, while the first is still the name of the node to which the
-cross reference points.@refill
-
-@need 750
-@noindent
-The template is like this:
-
-@example
-@@xref@{@var{node-name}, @var{cross-reference-name}@}.
-@end example
-
-@need 700
-@noindent
-For example,
-
-@example
-@@xref@{Electrical Effects, Lightning@}.
-@end example
-
-@noindent
-produces:
-
-@example
-*Note Lightning: Electrical Effects.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section 5.2 [Electrical Effects], page 57.
-@end quotation
-
-@noindent
-(Note that in the preceding example the closing brace is followed by a
-period; and that the node name is printed, not the cross reference name.)@refill
-
-You can write a clause after the cross reference, like this:@refill
-
-@example
-@@xref@{Electrical Effects, Lightning@}, for more info.
-@end example
-
-@noindent
-which produces
-@example
-*Note Lightning: Electrical Effects, for more info.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section 5.2 [Electrical Effects], page 57, for more info.
-@end quotation
-
-@noindent
-(Note that in the preceding example the closing brace is followed by a
-comma, and then by the clause, which is followed by a period.)@refill
-
-@node Three Arguments, Four and Five Arguments, Two Arguments, xref
-@subsection @code{@@xref} with Three Arguments
-
-A third argument replaces the node name in the @TeX{} output. The third
-argument should be the name of the section in the printed output, or
-else state the topic discussed by that section. Often, you will want to
-use initial upper case letters so it will be easier to read when the
-reference is printed. Use a third argument when the node name is
-unsuitable because of syntax or meaning.@refill
-
-Remember to avoid placing a comma within the title or topic section of
-a cross reference, or within any other section. The formatters divide
-cross references into arguments according to the commas; a comma
-within a title or other section will divide it into two arguments. In
-a reference, you need to write a title such as ``Clouds, Mist, and
-Fog'' without the commas.@refill
-
-Also, remember to write a comma or period after the closing brace of a
-@code{@@xref} to terminate the cross reference. In the following
-examples, a clause follows a terminating comma.@refill
-
-
-@need 750
-@noindent
-The template is like this:
-
-@example
-@group
-@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}.
-@end group
-@end example
-
-@need 700
-@noindent
-For example,
-
-@example
-@group
-@@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
-for details.
-@end group
-@end example
-
-@noindent
-produces
-
-@example
-*Note Lightning: Electrical Effects, for details.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section 5.2 [Thunder and Lightning], page 57, for details.
-@end quotation
-
-If a third argument is given and the second one is empty, then the
-third argument serves both. (Note how two commas, side by side, mark
-the empty second argument.)@refill
-
-@example
-@group
-@@xref@{Electrical Effects, , Thunder and Lightning@},
-for details.
-@end group
-@end example
-
-@noindent
-produces
-
-@example
-*Note Thunder and Lightning: Electrical Effects, for details.
-@end example
-
-@noindent
-and
-
-@quotation
-See Section 5.2 [Thunder and Lightning], page 57, for details.
-@end quotation
-
-As a practical matter, it is often best to write cross references with
-just the first argument if the node name and the section title are the
-same, and with the first and third arguments if the node name and title
-are different.@refill
-
-Here are several examples from @cite{The GNU Awk User's Guide}:@refill
-
-@smallexample
-@@xref@{Sample Program@}.
-@@xref@{Glossary@}.
-@@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}.
-@@xref@{Close Output, , Closing Output Files and Pipes@},
- for more information.
-@@xref@{Regexp, , Regular Expressions as Patterns@}.
-@end smallexample
-
-@node Four and Five Arguments, , Three Arguments, xref
-@subsection @code{@@xref} with Four and Five Arguments
-
-In a cross reference, a fourth argument specifies the name of another
-Info file, different from the file in which the reference appears, and
-a fifth argument specifies its title as a printed manual.@refill
-
-Remember that a comma or period must follow the closing brace of an
-@code{@@xref} command to terminate the cross reference. In the
-following examples, a clause follows a terminating comma.@refill
-
-@need 800
-@noindent
-The template is:
-
-@example
-@group
-@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
-@var{info-file-name}, @var{printed-manual-title}@}.
-@end group
-@end example
-
-@need 700
-@noindent
-For example,
-
-@example
-@@xref@{Electrical Effects, Lightning, Thunder and Lightning,
-weather, An Introduction to Meteorology@}, for details.
-@end example
-
-@noindent
-produces
-
-@example
-*Note Lightning: (weather)Electrical Effects, for details.
-@end example
-
-@noindent
-The name of the Info file is enclosed in parentheses and precedes
-the name of the node.
-
-@noindent
-In a printed manual, the reference looks like this:@refill
-
-@quotation
-See section ``Thunder and Lightning'' in @i{An Introduction to
-Meteorology}, for details.
-@end quotation
-
-@noindent
-The title of the printed manual is typeset in italics; and the
-reference lacks a page number since @TeX{} cannot know to which page a
-reference refers when that reference is to another manual.@refill
-
-Often, you will leave out the second argument when you use the long
-version of @code{@@xref}. In this case, the third argument, the topic
-description, will be used as the cross reference name in Info.@refill
-
-@noindent
-The template looks like this:
-
-@example
-@@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name},
-@var{printed-manual-title}@}, for details.
-@end example
-
-@noindent
-which produces
-
-@example
-*Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details.
-@end example
-
-@noindent
-and
-
-@quotation
-See section @var{title-or-topic} in @var{printed-manual-title}, for details.
-@end quotation
-
-@need 700
-@noindent
-For example,
-
-@example
-@@xref@{Electrical Effects, , Thunder and Lightning,
-weather, An Introduction to Meteorology@}, for details.
-@end example
-
-@noindent
-produces
-
-@example
-@group
-*Note Thunder and Lightning: (weather)Electrical Effects,
-for details.
-@end group
-@end example
-
-@noindent
-and
-
-@quotation
-See section ``Thunder and Lightning'' in @i{An Introduction to
-Meteorology}, for details.
-@end quotation
-
-On rare occasions, you may want to refer to another Info file that
-is within a single printed manual---when multiple Texinfo files are
-incorporated into the same @TeX{} run but make separate Info files.
-In this case, you need to specify only the fourth argument, and not
-the fifth.@refill
-
-@node Top Node Naming, ref, xref, Cross References
-@section Naming a `Top' Node
-@cindex Naming a `Top' Node in references
-@cindex @samp{@r{Top}} node naming for references
-
-In a cross reference, you must always name a node. This means that in
-order to refer to a whole manual, you must identify the `Top' node by
-writing it as the first argument to the @code{@@xref} command. (This
-is different from the way you write a menu entry; see @ref{Other Info
-Files, , Referring to Other Info Files}.) At the same time, to
-provide a meaningful section topic or title in the printed cross
-reference (instead of the word `Top'), you must write an appropriate
-entry for the third argument to the @code{@@xref} command.
-@refill
-
-@noindent
-Thus, to make a cross reference to @cite{The GNU Make Manual},
-write:@refill
-
-@example
-@@xref@{Top, , Overview, make, The GNU Make Manual@}.
-@end example
-
-@noindent
-which produces
-
-@example
-*Note Overview: (make)Top.
-@end example
-
-@noindent
-and
-
-@quotation
-See section ``Overview'' in @i{The GNU Make Manual}.
-@end quotation
-
-@noindent
-In this example, @samp{Top} is the name of the first node, and
-@samp{Overview} is the name of the first section of the manual.@refill
-@node ref, pxref, Top Node Naming, Cross References
-@comment node-name, next, previous, up
-@section @code{@@ref}
-@cindex Cross references using @code{@@ref}
-@cindex References using @code{@@ref}
-@findex ref
-
-@code{@@ref} is nearly the same as @code{@@xref} except that it does
-not generate a `See' in the printed output, just the reference itself.
-This makes it useful as the last part of a sentence.@refill
-
-@need 700
-@noindent
-For example,
-
-@example
-For more information, see @@ref@{Hurricanes@}.
-@end example
-
-@noindent
-produces
-
-@example
-For more information, see *Note Hurricanes.
-@end example
-
-@noindent
-and
-
-@quotation
-For more information, see Section 8.2 [Hurricanes], page 123.
-@end quotation
-
-The @code{@@ref} command sometimes leads writers to express themselves
-in a manner that is suitable for a printed manual but looks awkward
-in the Info format. Bear in mind that your audience will be using
-both the printed and the Info format.@refill
-
-@need 800
-@noindent
-For example,
-
-@example
-@group
-Sea surges are described in @@ref@{Hurricanes@}.
-@end group
-@end example
-
-@need 800
-@noindent
-produces
-
-@quotation
-Sea surges are described in Section 6.7 [Hurricanes], page 72.
-@end quotation
-
-@need 800
-@noindent
-in a printed document, and the following in Info:
-
-@example
-Sea surges are described in *Note Hurricanes::.
-@end example
-
-@quotation
-@strong{Caution:} You @emph{must} write a period or comma immediately
-after an @code{@@ref} command with two or more arguments. Otherwise,
-Info will not find the end of the cross reference entry and its
-attempt to follow the cross reference will fail. As a general rule,
-you should write a period or comma after every @code{@@ref} command.
-This looks best in both the printed and the Info output.@refill
-@end quotation
-
-@node pxref, inforef, ref, Cross References
-@comment node-name, next, previous, up
-@section @code{@@pxref}
-@cindex Cross references using @code{@@pxref}
-@cindex References using @code{@@pxref}
-@findex pxref
-
-The parenthetical reference command, @code{@@pxref}, is nearly the
-same as @code{@@xref}, but you use it @emph{only} inside parentheses
-and you do @emph{not} type a comma or period after the command's
-closing brace. The command differs from @code{@@xref} in two
-ways:@refill
-
-@enumerate
-@item
-@TeX{} typesets the reference for the printed manual with a lower case
-`see' rather than an upper case `See'.@refill
-
-@item
-The Info formatting commands automatically end the reference with a
-closing colon or period.@refill
-@end enumerate
-
-Because one type of formatting automatically inserts closing
-punctuation and the other does not, you should use @code{@@pxref}
-@emph{only} inside parentheses as part of another sentence. Also, you
-yourself should not insert punctuation after the reference, as you do
-with @code{@@xref}.@refill
-
-@code{@@pxref} is designed so that the output looks right and works
-right between parentheses both in printed output and in an Info file.
-In a printed manual, a closing comma or period should not follow a
-cross reference within parentheses; such punctuation is wrong. But in
-an Info file, suitable closing punctuation must follow the cross
-reference so Info can recognize its end. @code{@@pxref} spares you
-the need to use complicated methods to put a terminator into one form
-of the output and not the other.@refill
-
-@noindent
-With one argument, a parenthetical cross reference looks like
-this:@refill
-
-@example
-@dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
-@end example
-
-@need 800
-@noindent
-which produces
-
-@example
-@group
-@dots{} storms cause flooding (*Note Hurricanes::) @dots{}
-@end group
-@end example
-
-@noindent
-and
-
-@quotation
-@dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
-@end quotation
-
-With two arguments, a parenthetical cross reference has this
-template:@refill
-
-@example
-@dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
-@end example
-
-@noindent
-which produces
-
-@example
-@dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{}
-@end example
-
-@noindent
-and
-
-@need 1500
-@quotation
-@dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
-@end quotation
-
-@code{@@pxref} can be used with up to five arguments just like
-@code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill
-
-@quotation
-@strong{Please note:} Use @code{@@pxref} only as a parenthetical
-reference. Do not try to use @code{@@pxref} as a clause in a sentence.
-It will look bad in either the Info file, the printed output, or
-both.@refill
-
-Also, parenthetical cross references look best at the ends of sentences.
-Although you may write them in the middle of a sentence, that location
-breaks up the flow of text.@refill
-@end quotation
-
-@node inforef, uref, pxref, Cross References
-@section @code{@@inforef}
-@cindex Cross references using @code{@@inforef}
-@cindex References using @code{@@inforef}
-@findex inforef
-
-@code{@@inforef} is used for cross references to Info files for which
-there are no printed manuals. Even in a printed manual,
-@code{@@inforef} generates a reference directing the user to look in
-an Info file.@refill
-
-The command takes either two or three arguments, in the following
-order:@refill
-
-@enumerate
-@item
-The node name.
-
-@item
-The cross reference name (optional).
-
-@item
-The Info file name.
-@end enumerate
-
-@noindent
-Separate the arguments with commas, as with @code{@@xref}. Also, you
-must terminate the reference with a comma or period after the
-@samp{@}}, as you do with @code{@@xref}.@refill
-
-@noindent
-The template is:
-
-@example
-@@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@},
-@end example
-
-@need 800
-@noindent
-Thus,
-
-@example
-@group
-@@inforef@{Expert, Advanced Info commands, info@},
-for more information.
-@end group
-@end example
-
-@need 800
-@noindent
-produces
-
-@example
-@group
-*Note Advanced Info commands: (info)Expert,
-for more information.
-@end group
-@end example
-
-@need 800
-@noindent
-and
-
-@quotation
-See Info file @file{info}, node @samp{Expert}, for more information.
-@end quotation
-
-@need 800
-@noindent
-Similarly,
-
-@example
-@group
-@@inforef@{Expert, , info@}, for more information.
-@end group
-@end example
-
-@need 800
-@noindent
-produces
-
-@example
-*Note (info)Expert::, for more information.
-@end example
-
-@need 800
-@noindent
-and
-
-@quotation
-See Info file @file{info}, node @samp{Expert}, for more information.
-@end quotation
-
-The converse of @code{@@inforef} is @code{@@cite}, which is used to
-refer to printed works for which no Info form exists. @xref{cite, ,
-@code{@@cite}}.@refill
-
-
-@node uref, , inforef, Cross References
-@section @code{@@uref@{@var{url}[, @var{displayed-text}]@}}
-@findex uref
-@cindex Uniform resource locator, referring to
-@cindex URL, referring to
-
-@code{@@uref} produces a reference to a uniform resource locator (URL).
-It takes one mandatory argument, the URL, and one optional argument, the
-text to display (the default is the URL itself). In HTML output,
-@code{@@uref} produces a link you can follow. For example:
-
-@example
-The official GNU ftp site is
-@@uref@{ftp://ftp.gnu.ai.mit.edu/pub/gnu@}
-@end example
-
-@noindent produces (in text):
-@display
-The official GNU ftp site is
-@uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu}
-@end display
-
-@noindent whereas
-@example
-The official
-@@uref@{ftp://ftp.gnu.ai.mit.edu/pub/gnu,
- GNU ftp site@} holds programs and texts.
-@end example
-
-@noindent produces (in text):
-@display
-The official @uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu, GNU ftp site} holds
-programs and texts.
-@end display
-
-@noindent and (in HTML):
-@example
-The official <A HREF="ftp://ftp.gnu.ai.mit.edu/pub/gnu">GNU ftp
-site</A> holds programs and texts.
-@end example
-
-To merely indicate a URL, use @code{@@url} (@pxref{url, @code{@@url}}).
-
-
-@node Marking Text, Quotations and Examples, Cross References, Top
-@comment node-name, next, previous, up
-@chapter Marking Words and Phrases
-@cindex Paragraph, marking text within
-@cindex Marking words and phrases
-@cindex Words and phrases, marking them
-@cindex Marking text within a paragraph
-
-In Texinfo, you can mark words and phrases in a variety of ways.
-The Texinfo formatters use this information to determine how to
-highlight the text.
-You can specify, for example, whether a word or phrase is a
-defining occurrence, a metasyntactic variable, or a symbol used in a
-program. Also, you can emphasize text.@refill
-
-@menu
-* Indicating:: How to indicate definitions, files, etc.
-* Emphasis:: How to emphasize text.
-@end menu
-
-@node Indicating, Emphasis, Marking Text, Marking Text
-@comment node-name, next, previous, up
-@section Indicating Definitions, Commands, etc.
-@cindex Highlighting text
-@cindex Indicating commands, definitions, etc.
-
-Texinfo has commands for indicating just what kind of object a piece of
-text refers to. For example, metasyntactic variables are marked by
-@code{@@var}, and code by @code{@@code}. Since the pieces of text are
-labelled by commands that tell what kind of object they are, it is easy
-to change the way the Texinfo formatters prepare such text. (Texinfo is
-an @emph{intentional} formatting language rather than a @emph{typesetting}
-formatting language.)@refill
-
-For example, in a printed manual,
-code is usually illustrated in a typewriter font;
-@code{@@code} tells @TeX{} to typeset this text in this font. But it
-would be easy to change the way @TeX{} highlights code to use another
-font, and this change would not effect how keystroke examples are
-highlighted. If straight typesetting commands were used in the body
-of the file and you wanted to make a change, you would need to check
-every single occurrence to make sure that you were changing code and
-not something else that should not be changed.@refill
-
-@menu
-* Useful Highlighting:: Highlighting provides useful information.
-* code:: How to indicate code.
-* kbd:: How to show keyboard input.
-* key:: How to specify keys.
-* samp:: How to show a literal sequence of characters.
-* var:: How to indicate a metasyntactic variable.
-* file:: How to indicate the name of a file.
-* dfn:: How to specify a definition.
-* cite:: How to refer to a book that is not in Info.
-* url:: How to indicate a world wide web reference.
-* email:: How to indicate an electronic mail address.
-@end menu
-
-@node Useful Highlighting, code, Indicating, Indicating
-@ifinfo
-@subheading Highlighting Commands are Useful
-@end ifinfo
-
-The highlighting commands can be used to generate useful information
-from the file, such as lists of functions or file names. It is
-possible, for example, to write a program in Emacs Lisp (or a keyboard
-macro) to insert an index entry after every paragraph that contains
-words or phrases marked by a specified command. You could do this to
-construct an index of functions if you had not already made the
-entries.@refill
-
-The commands serve a variety of purposes:@refill
-
-@table @code
-@item @@code@{@var{sample-code}@}
-Indicate text that is a literal example of a piece of a program.@refill
-
-@item @@kbd@{@var{keyboard-characters}@}
-Indicate keyboard input.@refill
-
-@item @@key@{@var{key-name}@}
-Indicate the conventional name for a key on a keyboard.@refill
-
-@item @@samp@{@var{text}@}
-Indicate text that is a literal example of a sequence of characters.@refill
-
-@item @@var@{@var{metasyntactic-variable}@}
-Indicate a metasyntactic variable.@refill
-
-@item @@url@{@var{uniform-resource-locator}@}
-Indicate a uniform resource locator for the World Wide Web.
-
-@item @@file@{@var{file-name}@}
-Indicate the name of a file.@refill
-
-@item @@email@{@var{email-address}[, @var{displayed-text}]@}
-Indicate an electronic mail address.
-
-@item @@dfn@{@var{term}@}
-Indicate the introductory or defining use of a term.@refill
-
-@item @@cite@{@var{reference}@}
-Indicate the name of a book.@refill
-
-@ignore
-@item @@ctrl@{@var{ctrl-char}@}
-Use for an @sc{ascii} control character.@refill
-@end ignore
-@end table
-
-@node code, kbd, Useful Highlighting, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@code}@{@var{sample-code}@}
-@findex code
-
-Use the @code{@@code} command to indicate text that is a piece of a
-program and which consists of entire syntactic tokens. Enclose the
-text in braces.@refill
-
-Thus, you should use @code{@@code} for an expression in a program, for
-the name of a variable or function used in a program, or for a
-keyword. Also, you should use @code{@@code} for the name of a
-program, such as @code{diff}, that is a name used in the machine. (You
-should write the name of a program in the ordinary text font if you
-regard it as a new English word, such as `Emacs' or `Bison'.)@refill
-
-Use @code{@@code} for environment variables such as @code{TEXINPUTS},
-and other variables.@refill
-
-Use @code{@@code} for command names in command languages that
-resemble programming languages, such as Texinfo or the shell.
-For example, @code{@@code} and @code{@@samp} are produced by writing
-@samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo
-source, respectively.@refill
-
-Note, however, that you should not use @code{@@code} for shell options
-such as @samp{-c} when such options stand alone. (Use @code{@@samp}.)
-Also, an entire shell command often looks better if written using
-@code{@@samp} rather than @code{@@code}. In this case, the rule is to
-choose the more pleasing format.@refill
-
-It is incorrect to alter the case of a word inside an @code{@@code}
-command when it appears at the beginning of a sentence. Most computer
-languages are case sensitive. In C, for example, @code{Printf} is
-different from the identifier @code{printf}, and most likely is a
-misspelling of it. Even in languages which are not case sensitive, it
-is confusing to a human reader to see identifiers spelled in different
-ways. Pick one spelling and always use that. If you do not want to
-start a sentence with a command written all in lower case, you should
-rearrange the sentence.@refill
-
-Do not use the @code{@@code} command for a string of characters shorter
-than a syntactic token. If you are writing about @samp{TEXINPU}, which
-is just a part of the name for the @code{TEXINPUTS} environment
-variable, you should use @code{@@samp}.@refill
-
-In particular, you should not use the @code{@@code} command when writing
-about the characters used in a token; do not, for example, use
-@code{@@code} when you are explaining what letters or printable symbols
-can be used in the names of functions. (Use @code{@@samp}.) Also, you
-should not use @code{@@code} to mark text that is considered input to
-programs unless the input is written in a language that is like a
-programming language. For example, you should not use @code{@@code} for
-the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although
-you may use @code{@@code} for the names of the Emacs Lisp functions that
-the keystroke commands invoke.@refill
-
-In the printed manual, @code{@@code} causes @TeX{} to typeset the
-argument in a typewriter face. In the Info file, it causes the Info
-formatting commands to use single quotation marks around the text.
-
-@need 700
-For example,
-
-@example
-Use @@code@{diff@} to compare two files.
-@end example
-
-@noindent
-produces this in the printed manual:@refill
-
-@quotation
-Use @code{diff} to compare two files.
-@end quotation
-@iftex
-
-@noindent
-and this in the Info file:@refill
-
-@example
-Use `diff' to compare two files.
-@end example
-@end iftex
-
-
-@node kbd, key, code, Indicating
-@subsection @code{@@kbd}@{@var{keyboard-characters}@}
-@findex kbd
-@cindex keyboard input
-
-Use the @code{@@kbd} command for characters of input to be typed by
-users. For example, to refer to the characters @kbd{M-a},
-write@refill
-
-@example
-@@kbd@{M-a@}
-@end example
-
-@noindent
-and to refer to the characters @kbd{M-x shell}, write@refill
-
-@example
-@@kbd@{M-x shell@}
-@end example
-
-@cindex user input
-@cindex slanted typewriter font, for @code{@@kbd}
-The @code{@@kbd} command has the same effect as @code{@@code} in Info,
-but by default produces a different font (slanted typewriter instead of
-normal typewriter) in the printed manual, so users can distinguish the
-characters they are supposed to type from those the computer outputs.
-
-@findex kbdinputstyle
-Since the usage of @code{@@kbd} varies from manual to manual, you can
-control the font switching with the @code{@@kbdinputstyle} command.
-This command has no effect on Info output. Write this command at the
-beginning of a line with a single word as an argument, one of the
-following:
-@vindex distinct@r{, arg to @@kbdinputstyle}
-@vindex example@r{, arg to @@kbdinputstyle}
-@vindex code@r{, arg to @@kbdinputstyle}
-@table @samp
-@item code
-Always use the same font for @code{@@kbd} as @code{@@code}.
-@item example
-Use the distinguishing font for @code{@@kbd} only in @code{@@example}
-and similar environments.
-@item example
-(the default) Always use the distinguishing font for @code{@@kbd}.
-@end table
-
-You can embed another @@-command inside the braces of an @code{@@kbd}
-command. Here, for example, is the way to describe a command that
-would be described more verbosely as ``press an @samp{r} and then
-press the @key{RET} key'':@refill
-
-@example
-@@kbd@{r @@key@{RET@}@}
-@end example
-
-@noindent
-This produces: @kbd{r @key{RET}}
-
-You also use the @code{@@kbd} command if you are spelling out the letters
-you type; for example:@refill
-
-@example
-To give the @@code@{logout@} command,
-type the characters @@kbd@{l o g o u t @@key@{RET@}@}.
-@end example
-
-@noindent
-This produces:
-
-@quotation
-To give the @code{logout} command,
-type the characters @kbd{l o g o u t @key{RET}}.
-@end quotation
-
-(Also, this example shows that you can add spaces for clarity. If you
-really want to mention a space character as one of the characters of
-input, write @kbd{@@key@{SPC@}} for it.)@refill
-
-
-@node key, samp, kbd, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@key}@{@var{key-name}@}
-@findex key
-
-Use the @code{@@key} command for the conventional name for a key on a
-keyboard, as in:@refill
-
-@example
-@@key@{RET@}
-@end example
-
-You can use the @code{@@key} command within the argument of an
-@code{@@kbd} command when the sequence of characters to be typed
-includes one or more keys that are described by name.@refill
-
-@need 700
-For example, to produce @kbd{C-x @key{ESC}} you would type:@refill
-
-@example
-@@kbd@{C-x @@key@{ESC@}@}
-@end example
-
-Here is a list of the recommended names for keys:
-@cindex Recommended names for keys
-@cindex Keys, recommended names
-@cindex Names recommended for keys
-@cindex Abbreviations for keys
-
-@quotation
-@table @t
-@item SPC
-Space
-@item RET
-Return
-@item LFD
-Linefeed (however, since most keyboards nowadays do not have a Linefeed key,
-it might be better to call this character @kbd{C-j}.
-@item TAB
-Tab
-@item BS
-Backspace
-@item ESC
-Escape
-@item DEL
-Delete
-@item SHIFT
-Shift
-@item CTRL
-Control
-@item META
-Meta
-@end table
-@end quotation
-
-@cindex META key
-There are subtleties to handling words like `meta' or `ctrl' that are
-names of modifier keys. When mentioning a character in which the
-modifier key is used, such as @kbd{Meta-a}, use the @code{@@kbd} command
-alone; do not use the @code{@@key} command; but when you are referring
-to the modifier key in isolation, use the @code{@@key} command. For
-example, write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
-@samp{@@key@{META@}} to produce @key{META}.
-
-@c I don't think this is a good explanation.
-@c I think it will puzzle readers more than it clarifies matters. -- rms.
-@c In other words, use @code{@@kbd} for what you do, and use @code{@@key}
-@c for what you talk about: ``Press @code{@@kbd@{M-a@}} to move point to
-@c the beginning of the sentence. The @code{@@key@{META@}} key is often in
-@c the lower left of the keyboard.''@refill
-
-@node samp, var, key, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@samp}@{@var{text}@}
-@findex samp
-
-Use the @code{@@samp} command to indicate text that is a literal example
-or `sample' of a sequence of characters in a file, string, pattern, etc.
-Enclose the text in braces. The argument appears within single
-quotation marks in both the Info file and the printed manual; in
-addition, it is printed in a fixed-width font.@refill
-
-@example
-To match @@samp@{foo@} at the end of the line,
-use the regexp @@samp@{foo$@}.
-@end example
-
-@noindent
-produces
-
-@quotation
-To match @samp{foo} at the end of the line, use the regexp
-@samp{foo$}.@refill
-@end quotation
-
-Any time you are referring to single characters, you should use
-@code{@@samp} unless @code{@@kbd} or @code{@@key} is more appropriate.
-Use @code{@@samp} for the names of command-line options (except in an
-@code{@@table}, where @code{@@code} seems to read more easily). Also,
-you may use @code{@@samp} for entire statements in C and for entire
-shell commands---in this case, @code{@@samp} often looks better than
-@code{@@code}. Basically, @code{@@samp} is a catchall for whatever is
-not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
-
-Only include punctuation marks within braces if they are part of the
-string you are specifying. Write punctuation marks outside the braces
-if those punctuation marks are part of the English text that surrounds
-the string. In the following sentence, for example, the commas and
-period are outside of the braces:@refill
-
-@example
-@group
-In English, the vowels are @@samp@{a@}, @@samp@{e@},
-@@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
-@@samp@{y@}.
-@end group
-@end example
-
-@noindent
-This produces:
-
-@quotation
-In English, the vowels are @samp{a}, @samp{e},
-@samp{i}, @samp{o}, @samp{u}, and sometimes
-@samp{y}.
-@end quotation
-
-@node var, file, samp, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@var}@{@var{metasyntactic-variable}@}
-@findex var
-
-Use the @code{@@var} command to indicate metasyntactic variables. A
-@dfn{metasyntactic variable} is something that stands for another piece of
-text. For example, you should use a metasyntactic variable in the
-documentation of a function to describe the arguments that are passed
-to that function.@refill
-
-Do not use @code{@@var} for the names of particular variables in
-programming languages. These are specific names from a program, so
-@code{@@code} is correct for them. For example, the Emacs Lisp variable
-@code{texinfo-tex-command} is not a metasyntactic variable; it is
-properly formatted using @code{@@code}.@refill
-
-The effect of @code{@@var} in the Info file is to change the case of
-the argument to all upper case; in the printed manual, to italicize it.
-
-@need 700
-For example,
-
-@example
-To delete file @@var@{filename@},
-type @@code@{rm @@var@{filename@}@}.
-@end example
-
-@noindent
-produces
-
-@quotation
-To delete file @var{filename}, type @code{rm @var{filename}}.
-@end quotation
-
-@noindent
-(Note that @code{@@var} may appear inside @code{@@code},
-@code{@@samp}, @code{@@file}, etc.)@refill
-
-Write a metasyntactic variable all in lower case without spaces, and
-use hyphens to make it more readable. Thus, the Texinfo source for
-the illustration of how to begin a Texinfo manual looks like
-this:@refill
-
-@example
-@group
-\input texinfo
-@@@@setfilename @@var@{info-file-name@}
-@@@@settitle @@var@{name-of-manual@}
-@end group
-@end example
-
-@noindent
-This produces:
-
-@example
-@group
-\input texinfo
-@@setfilename @var{info-file-name}
-@@settitle @var{name-of-manual}
-@end group
-@end example
-
-In some documentation styles, metasyntactic variables are shown with
-angle brackets, for example:@refill
-
-@example
-@dots{}, type rm <filename>
-@end example
-
-@noindent
-However, that is not the style that Texinfo uses. (You can, of
-course, modify the sources to @TeX{} and the Info formatting commands
-to output the @code{<@dots{}>} format if you wish.)@refill
-
-@node file, dfn, var, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@file}@{@var{file-name}@}
-@findex file
-
-Use the @code{@@file} command to indicate text that is the name of a
-file, buffer, or directory, or is the name of a node in Info. You can
-also use the command for file name suffixes. Do not use @code{@@file}
-for symbols in a programming language; use @code{@@code}.
-
-Currently, @code{@@file} is equivalent to @code{@@samp} in its effects.
-For example,@refill
-
-@example
-The @@file@{.el@} files are in
-the @@file@{/usr/local/emacs/lisp@} directory.
-@end example
-
-@noindent
-produces
-
-@quotation
-The @file{.el} files are in
-the @file{/usr/local/emacs/lisp} directory.
-@end quotation
-
-@node dfn, cite, file, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@dfn}@{@var{term}@}
-@findex dfn
-
-Use the @code{@@dfn} command to identify the introductory or defining
-use of a technical term. Use the command only in passages whose
-purpose is to introduce a term which will be used again or which the
-reader ought to know. Mere passing mention of a term for the first
-time does not deserve @code{@@dfn}. The command generates italics in
-the printed manual, and double quotation marks in the Info file. For
-example:@refill
-
-@example
-Getting rid of a file is called @@dfn@{deleting@} it.
-@end example
-
-@noindent
-produces
-
-@quotation
-Getting rid of a file is called @dfn{deleting} it.
-@end quotation
-
-As a general rule, a sentence containing the defining occurrence of a
-term should be a definition of the term. The sentence does not need
-to say explicitly that it is a definition, but it should contain the
-information of a definition---it should make the meaning clear.
-
-@node cite, url, dfn, Indicating
-@comment node-name, next, previous, up
-@subsection @code{@@cite}@{@var{reference}@}
-@findex cite
-
-Use the @code{@@cite} command for the name of a book that lacks a
-companion Info file. The command produces italics in the printed
-manual, and quotation marks in the Info file.@refill
-
-(If a book is written in Texinfo, it is better to use a cross reference
-command since a reader can easily follow such a reference in Info.
-@xref{xref, , @code{@@xref}}.)@refill
-
-@ignore
-@c node ctrl, , cite, Indicating
-@comment node-name, next, previous, up
-@c subsection @code{@@ctrl}@{@var{ctrl-char}@}
-@findex ctrl
-
-The @code{@@ctrl} command is seldom used. It describes an @sc{ascii}
-control character by inserting the actual character into the Info
-file.
-
-Usually, in Texinfo, you talk what you type as keyboard entry by
-describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for
-@kbd{C-a}. Use @code{@@kbd} in this way when talking about a control
-character that is typed on the keyboard by the user. When talking
-about a control character appearing in a file or a string, do not use
-@code{@@kbd} since the control character is not typed. Also, do not
-use @samp{C-} but spell out @code{control-}, as in @samp{control-a},
-to make it easier for a reader to understand.@refill
-
-@code{@@ctrl} is an idea from the beginnings of Texinfo which may not
-really fit in to the scheme of things. But there may be times when
-you want to use the command. The pattern is
-@code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character
-whose control-equivalent is wanted. For example, to specify
-@samp{control-f}, you would enter@refill
-
-@example
-@@ctrl@{f@}
-@end example
-
-@noindent
-produces
-
-@quotation
-@ctrl{f}
-@end quotation
-
-In the Info file, this generates the specified control character, output
-literally into the file. This is done so a user can copy the specified
-control character (along with whatever else he or she wants) into another
-Emacs buffer and use it. Since the `control-h',`control-i', and
-`control-j' characters are formatting characters, they should not be
-indicated with @code{@@ctrl}.@refill
-
-In a printed manual, @code{@@ctrl} generates text to describe or
-identify that control character: an uparrow followed by the character
-@var{ch}.@refill
-@end ignore
-
-
-@node url, email, cite, Indicating
-@subsection @code{@@url}@{@var{uniform-resource-locator}@}
-@findex url
-@cindex Uniform resource locator, indicating
-@cindex URL, indicating
-
-Use the @code{@@url} to indicate a uniform resource locator on the World
-Wide Web. This is analogous to @code{@@file}, @code{@@var}, etc., and
-is purely for markup purposes. It does not produce a link you can
-follow in HTML output (the @code{@@uref} command does, @pxref{uref,,
-@code{@@uref}}). It is useful for example URL's which do not actually
-exist. For example:
-
-@c Two lines because one is too long for smallbook format.
-@example
-For example, the url might be
-@@url@{http://host.domain.org/path@}.
-@end example
-
-
-@node email, , url, Indicating
-@subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@}
-@findex email
-
-Use the @code{@@email} command to indicate an electronic mail address.
-It takes one mandatory argument, the address, and one optional argument, the
-text to display (the default is the address itself).
-
-@cindex mailto link
-In Info and @TeX{}, the address is shown in angle brackets, preceded by
-the text to display if any. In HTML output, @code{@@email} produces a
-@samp{mailto} link that usually brings up a mail composition window.
-For example:
-
-@example
-Send bug reports to @@email@{bug-texinfo@@@@gnu.org@}.
-Send suggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}.
-@end example
-@noindent produces
-@example
-Send bug reports to @email{bug-texinfo@@gnu.org}.
-Send suggestions to the @email{bug-texinfo@@gnu.org, same place}.
-@end example
-
-
-@node Emphasis, , Indicating, Marking Text
-@comment node-name, next, previous, up
-@section Emphasizing Text
-@cindex Emphasizing text
-
-Usually, Texinfo changes the font to mark words in the text according to
-what category the words belong to; an example is the @code{@@code} command.
-Most often, this is the best way to mark words.
-However, sometimes you will want to emphasize text without indicating a
-category. Texinfo has two commands to do this. Also, Texinfo has
-several commands that specify the font in which @TeX{} will typeset
-text. These commands have no affect on Info and only one of them,
-the @code{@@r} command, has any regular use.@refill
-
-@menu
-* emph & strong:: How to emphasize text in Texinfo.
-* Smallcaps:: How to use the small caps font.
-* Fonts:: Various font commands for printed output.
-* Customized Highlighting:: How to define highlighting commands.
-@end menu
-
-@node emph & strong, Smallcaps, Emphasis, Emphasis
-@comment node-name, next, previous, up
-@subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
-@cindex Emphasizing text, font for
-@findex emph
-@findex strong
-
-The @code{@@emph} and @code{@@strong} commands are for emphasis;
-@code{@@strong} is stronger. In printed output, @code{@@emph}
-produces @emph{italics} and @code{@@strong} produces
-@strong{bold}.@refill
-
-@need 800
-For example,
-
-@example
-@group
-@@quotation
-@@strong@{Caution:@} @@samp@{rm * .[^.]*@} removes @@emph@{all@}
-files in the directory.
-@@end quotation
-@end group
-@end example
-
-@iftex
-@noindent
-produces the following in printed output:
-
-@quotation
-@strong{Caution}: @code{rm * .[^.]*} removes @emph{all}
-files in the directory.
-@end quotation
-
-@noindent
-and the following in Info:
-@end iftex
-@ifinfo
-@noindent
-produces:
-@end ifinfo
-
-@example
- *Caution*: `rm * .[^.]*' removes *all*
- files in the directory.
-@end example
-
-The @code{@@strong} command is seldom used except to mark what is, in
-effect, a typographical element, such as the word `Caution' in the
-preceding example.
-
-In the Info file, both @code{@@emph} and @code{@@strong} put asterisks
-around the text.@refill
-
-@quotation
-@strong{Caution:} Do not use @code{@@emph} or @code{@@strong} with the
-word @samp{Note}; Info will mistake the combination for a cross
-reference. Use a phrase such as @strong{Please note} or
-@strong{Caution} instead.@refill
-@end quotation
-
-@node Smallcaps, Fonts, emph & strong, Emphasis
-@subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
-@cindex Small caps font
-@findex sc @r{(small caps font)}
-
-@iftex
-Use the @samp{@@sc} command to set text in the printed output in @sc{a
-small caps font} and set text in the Info file in upper case letters.@refill
-@end iftex
-@ifinfo
-Use the @samp{@@sc} command to set text in the printed output in a
-small caps font and set text in the Info file in upper case letters.@refill
-@end ifinfo
-
-Write the text between braces in lower case, like this:@refill
-
-@example
-The @@sc@{acm@} and @@sc@{ieee@} are technical societies.
-@end example
-
-@noindent
-This produces:
-
-@display
-The @sc{acm} and @sc{ieee} are technical societies.
-@end display
-
-@TeX{} typesets the small caps font in a manner that prevents the
-letters from `jumping out at you on the page'. This makes small caps
-text easier to read than text in all upper case. The Info formatting
-commands set all small caps text in upper case.@refill
-
-@ifinfo
-If the text between the braces of an @code{@@sc} command is upper case,
-@TeX{} typesets in full-size capitals. Use full-size capitals
-sparingly.@refill
-@end ifinfo
-@iftex
-If the text between the braces of an @code{@@sc} command is upper case,
-@TeX{} typesets in @sc{FULL-SIZE CAPITALS}. Use full-size capitals
-sparingly.@refill
-@end iftex
-
-You may also use the small caps font for a jargon word such as
-@sc{ato} (a @sc{nasa} word meaning `abort to orbit').@refill
-
-There are subtleties to using the small caps font with a jargon word
-such as @sc{cdr}, a word used in Lisp programming. In this case, you
-should use the small caps font when the word refers to the second and
-subsequent elements of a list (the @sc{cdr} of the list), but you
-should use @samp{@@code} when the word refers to the Lisp function of
-the same spelling.@refill
-
-@node Fonts, Customized Highlighting, Smallcaps, Emphasis
-@comment node-name, next, previous, up
-@subsection Fonts for Printing, Not Info
-@cindex Fonts for printing, not for Info
-@findex i @r{(italic font)}
-@findex b @r{(bold font)}
-@findex t @r{(typewriter font)}
-@findex r @r{(Roman font)}
-
-Texinfo provides four font commands that specify font changes in the
-printed manual but have no effect in the Info file. @code{@@i}
-requests @i{italic} font (in some versions of @TeX{}, a slanted font
-is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the
-@t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a
-@r{roman} font, which is the usual font in which text is printed. All
-four commands apply to an argument that follows, surrounded by
-braces.@refill
-
-Only the @code{@@r} command has much use: in example programs, you
-can use the @code{@@r} command to convert code comments from the
-fixed-width font to a roman font. This looks better in printed
-output.@refill
-
-@need 700
-For example,
-
-@example
-@group
-@@lisp
-(+ 2 2) ; @@r@{Add two plus two.@}
-@@end lisp
-@end group
-@end example
-
-@noindent
-produces
-
-@lisp
-(+ 2 2) ; @r{Add two plus two.}
-@end lisp
-
-If possible, you should avoid using the other three font commands. If
-you need to use one, it probably indicates a gap in the Texinfo
-language.@refill
-
-@node Customized Highlighting, , Fonts, Emphasis
-@comment node-name, next, previous, up
-@subsection Customized Highlighting
-@cindex Highlighting, customized
-@cindex Customized highlighting
-
-@c I think this whole section is obsolete with the advent of macros
-@c --karl, 15sep96.
-You can use regular @TeX{} commands inside of @code{@@iftex} @dots{}
-@code{@@end iftex} to create your own customized highlighting commands
-for Texinfo. The easiest way to do this is to equate your customized
-commands with pre-existing commands, such as those for italics. Such
-new commands work only with @TeX{}.@refill
-
-@findex definfoenclose
-@cindex Enclosure command for Info
-You can use the @code{@@definfoenclose} command inside of
-@code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info
-with the same names as new commands for @TeX{}.
-@code{@@definfoenclose} creates new commands for Info that mark text by
-enclosing it in strings that precede and follow the text.
-@footnote{Currently, @code{@@definfoenclose} works only with
-@code{texinfo-format-buffer} and @code{texinfo-format-region}, not with
-@code{makeinfo}.}@refill
-
-Here is how to create a new @@-command called @code{@@phoo} that causes
-@TeX{} to typeset its argument in italics and causes Info to display the
-argument between @samp{//} and @samp{\\}.@refill
-
-@need 1300
-For @TeX{}, write the following to equate the @code{@@phoo} command with
-the existing @code{@@i} italics command:@refill
-
-@example
-@group
-@@iftex
-@@global@@let@@phoo=@@i
-@@end iftex
-@end group
-@end example
-
-@noindent
-This defines @code{@@phoo} as a command that causes @TeX{} to typeset
-the argument to @code{@@phoo} in italics. @code{@@global@@let} tells
-@TeX{} to equate the next argument with the argument that follows the
-equals sign.
-
-@need 1300
-For Info, write the following to tell the Info formatters to enclose the
-argument between @samp{//} and @samp{\\}:
-
-@example
-@group
-@@ifinfo
-@@definfoenclose phoo, //, \\
-@@end ifinfo
-@end group
-@end example
-
-@noindent
-Write the @code{@@definfoenclose} command on a line and follow it with
-three arguments separated by commas (commas are used as separators in an
-@code{@@node} line in the same way).@refill
-
-@itemize @bullet
-@item
-The first argument to @code{@@definfoenclose} is the @@-command name
-@strong{without} the @samp{@@};
-
-@item
-the second argument is the Info start delimiter string; and,
-
-@item
-the third argument is the Info end delimiter string.
-@end itemize
-
-@noindent
-The latter two arguments enclose the highlighted text in the Info file.
-A delimiter string may contain spaces. Neither the start nor end
-delimiter is required. However, if you do not provide a start
-delimiter, you must follow the command name with two commas in a row;
-otherwise, the Info formatting commands will misinterpret the end
-delimiter string as a start delimiter string.@refill
-
-After you have defined @code{@@phoo} both for @TeX{} and for Info, you
-can then write @code{@@phoo@{bar@}} to see @samp{//bar\\}
-in Info and see
-@ifinfo
-@samp{bar} in italics in printed output.
-@end ifinfo
-@iftex
-@i{bar} in italics in printed output.
-@end iftex
-
-Note that each definition applies to its own formatter: one for @TeX{},
-the other for Info.
-
-@need 1200
-Here is another example:
-
-@example
-@group
-@@ifinfo
-@@definfoenclose headword, , :
-@@end ifinfo
-@@iftex
-@@global@@let@@headword=@@b
-@@end iftex
-@end group
-@end example
-
-@noindent
-This defines @code{@@headword} as an Info formatting command that
-inserts nothing before and a colon after the argument and as a @TeX{}
-formatting command to typeset its argument in bold.
-
-@node Quotations and Examples, Lists and Tables, Marking Text, Top
-@comment node-name, next, previous, up
-@chapter Quotations and Examples
-
-Quotations and examples are blocks of text consisting of one or more
-whole paragraphs that are set off from the bulk of the text and
-treated differently. They are usually indented.@refill
-
-In Texinfo, you always begin a quotation or example by writing an
-@@-command at the beginning of a line by itself, and end it by writing
-an @code{@@end} command that is also at the beginning of a line by
-itself. For instance, you begin an example by writing @code{@@example}
-by itself at the beginning of a line and end the example by writing
-@code{@@end example} on a line by itself, at the beginning of that
-line.@refill
-@findex end
-
-@menu
-* Block Enclosing Commands:: Use different constructs for
- different purposes.
-* quotation:: How to write a quotation.
-* example:: How to write an example in a fixed-width font.
-* noindent:: How to prevent paragraph indentation.
-* Lisp Example:: How to illustrate Lisp code.
-* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
-* display:: How to write an example in the current font.
-* format:: How to write an example that does not narrow
- the margins.
-* exdent:: How to undo the indentation of a line.
-* flushleft & flushright:: How to push text flushleft or flushright.
-* cartouche:: How to draw cartouches around examples.
-@end menu
-
-@node Block Enclosing Commands, quotation, Quotations and Examples, Quotations and Examples
-@section The Block Enclosing Commands
-
-Here are commands for quotations and examples:@refill
-
-@table @code
-@item @@quotation
-Indicate text that is quoted. The text is filled, indented, and
-printed in a roman font by default.@refill
-
-@item @@example
-Illustrate code, commands, and the like. The text is printed
-in a fixed-width font, and indented but not filled.@refill
-
-@item @@lisp
-Illustrate Lisp code. The text is printed in a fixed-width font,
-and indented but not filled.@refill
-
-@item @@smallexample
-Illustrate code, commands, and the like. Similar to
-@code{@@example}, except that in @TeX{} this command typesets text in
-a smaller font for the smaller @code{@@smallbook} format than for the
-8.5 by 11 inch format.@refill
-
-@item @@smalllisp
-Illustrate Lisp code. Similar to @code{@@lisp}, except that
-in @TeX{} this command typesets text in a smaller font for the smaller
-@code{@@smallbook} format than for the 8.5 by 11 inch format.@refill
-
-@item @@display
-Display illustrative text. The text is indented but not filled, and
-no font is specified (so, by default, the font is roman).@refill
-
-@item @@format
-Print illustrative text. The text is not indented and not filled
-and no font is specified (so, by default, the font is roman).@refill
-@end table
-
-The @code{@@exdent} command is used within the above constructs to
-undo the indentation of a line.
-
-The @code{@@flushleft} and @code{@@flushright} commands are used to line
-up the left or right margins of unfilled text.@refill
-
-The @code{@@noindent} command may be used after one of the above
-constructs to prevent the following text from being indented as a new
-paragraph.@refill
-
-You can use the @code{@@cartouche} command within one of the above
-constructs to highlight the example or quotation by drawing a box with
-rounded corners around it. (The @code{@@cartouche} command affects
-only the printed manual; it has no effect in the Info file; see
-@ref{cartouche, , Drawing Cartouches Around Examples}.)@refill
-
-@node quotation, example, Block Enclosing Commands, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@quotation}
-@cindex Quotations
-@findex quotation
-
-The text of a quotation is
-processed normally except that:@refill
-
-@itemize @bullet
-@item
-the margins are closer to the center of the page, so the whole of the
-quotation is indented;@refill
-
-@item
-the first lines of paragraphs are indented no more than other
-lines;@refill
-
-@item
-in the printed output, interparagraph spacing is reduced.@refill
-@end itemize
-
-@quotation
-This is an example of text written between an @code{@@quotation}
-command and an @code{@@end quotation} command. An @code{@@quotation}
-command is most often used to indicate text that is excerpted from
-another (real or hypothetical) printed work.@refill
-@end quotation
-
-Write an @code{@@quotation} command as text on a line by itself. This
-line will disappear from the output. Mark the end of the quotation
-with a line beginning with and containing only @code{@@end quotation}.
-The @code{@@end quotation} line will likewise disappear from the
-output. Thus, the following,@refill
-
-@example
-@@quotation
-This is
-a foo.
-@@end quotation
-@end example
-
-@noindent
-produces
-
-@quotation
-This is a foo.
-@end quotation
-
-@node example, noindent, quotation, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@example}
-@cindex Examples, formatting them
-@cindex Formatting examples
-@findex example
-
-The @code{@@example} command is used to indicate an example that is
-not part of the running text, such as computer input or output.@refill
-
-@example
-@group
-This is an example of text written between an
-@code{@@example} command
-and an @code{@@end example} command.
-The text is indented but not filled.
-@end group
-
-@group
-In the printed manual, the text is typeset in a
-fixed-width font, and extra spaces and blank lines are
-significant. In the Info file, an analogous result is
-obtained by indenting each line with five spaces.
-@end group
-@end example
-
-Write an @code{@@example} command at the beginning of a line by itself.
-This line will disappear from the output. Mark the end of the example
-with an @code{@@end example} command, also written at the beginning of a
-line by itself. The @code{@@end example} will disappear from the
-output.@refill
-
-@need 700
-For example,
-
-@example
-@@example
-mv foo bar
-@@end example
-@end example
-
-@noindent
-produces
-
-@example
-mv foo bar
-@end example
-
-Since the lines containing @code{@@example} and @code{@@end example}
-will disappear, you should put a blank line before the
-@code{@@example} and another blank line after the @code{@@end
-example}. (Remember that blank lines between the beginning
-@code{@@example} and the ending @code{@@end example} will appear in
-the output.)@refill
-
-@quotation
-@strong{Caution:} Do not use tabs in the lines of an example (or anywhere
-else in Texinfo, for that matter)! @TeX{} treats tabs as single
-spaces, and that is not what they look like. This is a problem with
-@TeX{}. (If necessary, in Emacs, you can use @kbd{M-x untabify} to
-convert tabs in a region to multiple spaces.)@refill
-@end quotation
-
-Examples are often, logically speaking, ``in the middle'' of a
-paragraph, and the text continues after an example should not be
-indented. The @code{@@noindent} command prevents a piece of text from
-being indented as if it were a new paragraph.
-@ifinfo
-(@xref{noindent}.)
-@end ifinfo
-
-(The @code{@@code} command is used for examples of code that are
-embedded within sentences, not set off from preceding and following
-text. @xref{code, , @code{@@code}}.)
-
-@node noindent, Lisp Example, example, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@noindent}
-@findex noindent
-
-An example or other inclusion can break a paragraph into segments.
-Ordinarily, the formatters indent text that follows an example as a new
-paragraph. However, you can prevent this by writing @code{@@noindent}
-at the beginning of a line by itself preceding the continuation
-text.@refill
-
-@need 1500
-For example:
-
-@example
-@group
-@@example
-This is an example
-@@end example
-
-@@noindent
-This line is not indented. As you can see, the
-beginning of the line is fully flush left with the line
-that follows after it. (This whole example is between
-@@code@{@@@@display@} and @@code@{@@@@end display@}.)
-@end group
-@end example
-
-@noindent
-produces
-
-@display
-@example
-This is an example
-@end example
-@tex
-% Remove extra vskip; this is a kludge to counter the effect of display
-\vskip-3.5\baselineskip
-@end tex
-
-@noindent
-This line is not indented. As you can see, the
-beginning of the line is fully flush left with the line
-that follows after it. (This whole example is between
-@code{@@display} and @code{@@end display}.)
-@end display
-
-To adjust the number of blank lines properly in the Info file output,
-remember that the line containing @code{@@noindent} does not generate a
-blank line, and neither does the @code{@@end example} line.@refill
-
-In the Texinfo source file for this manual, each line that says
-`produces' is preceded by a line containing @code{@@noindent}.@refill
-
-Do not put braces after an @code{@@noindent} command; they are not
-necessary, since @code{@@noindent} is a command used outside of
-paragraphs (@pxref{Command Syntax}).@refill
-
-@node Lisp Example, smallexample & smalllisp, noindent, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@lisp}
-@cindex Lisp example
-@findex lisp
-
-The @code{@@lisp} command is used for Lisp code. It is synonymous
-with the @code{@@example} command.
-
-@lisp
-This is an example of text written between an
-@code{@@lisp} command and an @code{@@end lisp} command.
-@end lisp
-
-Use @code{@@lisp} instead of @code{@@example} to preserve information
-regarding the nature of the example. This is useful, for example, if
-you write a function that evaluates only and all the Lisp code in a
-Texinfo file. Then you can use the Texinfo file as a Lisp
-library.@footnote{It would be straightforward to extend Texinfo to work
-in a similar fashion for C, Fortran, or other languages.}@refill
-
-Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by
-itself.@refill
-
-@node smallexample & smalllisp, display, Lisp Example, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@smallexample} and @code{@@smalllisp}
-@cindex Small book example
-@cindex Example for a small book
-@cindex Lisp example for a small book
-@findex smallexample
-@findex smalllisp
-
-In addition to the regular @code{@@example} and @code{@@lisp} commands,
-Texinfo has two other ``example-style'' commands. These are the
-@code{@@smallexample} and @code{@@smalllisp} commands. Both these
-commands are designed for use with the @code{@@smallbook} command that
-causes @TeX{} to produce a printed manual in a 7 by 9.25 inch format
-rather than the regular 8.5 by 11 inch format.@refill
-
-In @TeX{}, the @code{@@smallexample} and @code{@@smalllisp} commands
-typeset text in a smaller font for the smaller @code{@@smallbook}
-format than for the 8.5 by 11 inch format. Consequently, many examples
-containing long lines fit in a narrower, @code{@@smallbook} page
-without needing to be shortened. Both commands typeset in the normal
-font size when you format for the 8.5 by 11 inch size; indeed,
-in this situation, the @code{@@smallexample} and @code{@@smalllisp}
-commands are defined to be the @code{@@example} and @code{@@lisp}
-commands.@refill
-
-In Info, the @code{@@smallexample} and @code{@@smalllisp} commands are
-equivalent to the @code{@@example} and @code{@@lisp} commands, and work
-exactly the same.@refill
-
-Mark the end of @code{@@smallexample} or @code{@@smalllisp} with
-@code{@@end smallexample} or @code{@@end smalllisp},
-respectively.@refill
-
-@iftex
-Here is an example written in the small font used by the
-@code{@@smallexample} and @code{@@smalllisp} commands:
-
-@ifclear smallbook
-@display
-@tex
-% Remove extra vskip; this is a kludge to counter the effect of display
-\vskip-3\baselineskip
-{\ninett
-\dots{} to make sure that you have the freedom to
-distribute copies of free software (and charge for
-this service if you wish), that you receive source
-code or can get it if you want it, that you can
-change the software or use pieces of it in new free
-programs; and that you know you can do these things.}
-@end tex
-@end display
-@end ifclear
-@end iftex
-@ifset smallbook
-@iftex
-@smallexample
-This is an example of text written between @code{@@smallexample} and
-@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
-this text appears in its normal size; but in a 7 by 9.25 inch manual,
-this text appears in a smaller font.
-@end smallexample
-@end iftex
-@end ifset
-@ifinfo
-@smallexample
-This is an example of text written between @code{@@smallexample} and
-@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
-this text appears in its normal size; but in a 7 by 9.25 inch manual,
-this text appears in a smaller font.
-@end smallexample
-@end ifinfo
-
-The @code{@@smallexample} and @code{@@smalllisp} commands make it
-easier to prepare smaller format manuals without forcing you to edit
-examples by hand to fit them onto narrower pages.@refill
-
-As a general rule, a printed document looks better if you write all the
-examples in a chapter consistently in @code{@@example} or in
-@code{@@smallexample}. Only occasionally should you mix the two
-formats.@refill
-
-@xref{smallbook, , Printing ``Small'' Books}, for more information
-about the @code{@@smallbook} command.@refill
-
-@node display, format, smallexample & smalllisp, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@display}
-@cindex Display formatting
-@findex display
-
-The @code{@@display} command begins a kind of example. It is like the
-@code{@@example} command
-except that, in
-a printed manual, @code{@@display} does not select the fixed-width
-font. In fact, it does not specify the font at all, so that the text
-appears in the same font it would have appeared in without the
-@code{@@display} command.@refill
-
-@display
-This is an example of text written between an @code{@@display} command
-and an @code{@@end display} command. The @code{@@display} command
-indents the text, but does not fill it.
-@end display
-
-@node format, exdent, display, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@format}
-@findex format
-
-The @code{@@format} command is similar to @code{@@example} except
-that, in the printed manual, @code{@@format} does not select the
-fixed-width font and does not narrow the margins.@refill
-
-@format
-This is an example of text written between an @code{@@format} command
-and an @code{@@end format} command. As you can see
-from this example,
-the @code{@@format} command does not fill the text.
-@end format
-
-@node exdent, flushleft & flushright, format, Quotations and Examples
-@section @code{@@exdent}: Undoing a Line's Indentation
-@cindex Indentation undoing
-@findex exdent
-
-The @code{@@exdent} command removes any indentation a line might have.
-The command is written at the beginning of a line and applies only to
-the text that follows the command that is on the same line. Do not use
-braces around the text. In a printed manual, the text on an
-@code{@@exdent} line is printed in the roman font.@refill
-
-@code{@@exdent} is usually used within examples. Thus,@refill
-
-@example
-@group
-@@example
-This line follows an @@@@example command.
-@@exdent This line is exdented.
-This line follows the exdented line.
-The @@@@end example comes on the next line.
-@@end group
-@end group
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This line follows an @@example command.
-@exdent This line is exdented.
-This line follows the exdented line.
-The @@end example comes on the next line.
-@end group
-@end example
-
-In practice, the @code{@@exdent} command is rarely used.
-Usually, you un-indent text by ending the example and
-returning the page to its normal width.@refill
-
-@node flushleft & flushright, cartouche, exdent, Quotations and Examples
-@section @code{@@flushleft} and @code{@@flushright}
-@findex flushleft
-@findex flushright
-
-The @code{@@flushleft} and @code{@@flushright} commands line up the
-ends of lines on the left and right margins of a page,
-but do not fill the text. The commands are written on lines of their
-own, without braces. The @code{@@flushleft} and @code{@@flushright}
-commands are ended by @code{@@end flushleft} and @code{@@end
-flushright} commands on lines of their own.@refill
-
-@need 1500
-For example,
-
-@example
-@group
-@@flushleft
-This text is
-written flushleft.
-@@end flushleft
-@end group
-@end example
-
-@noindent
-produces
-
-@quotation
-@flushleft
-This text is
-written flushleft.
-@end flushleft
-@end quotation
-
-
-@code{@@flushright} produces the type of indentation often used in the
-return address of letters. For example,
-
-@example
-@group
-@@flushright
-Here is an example of text written
-flushright. The @@code@{@@flushright@} command
-right justifies every line but leaves the
-left end ragged.
-@@end flushright
-@end group
-@end example
-
-@noindent
-produces
-
-@flushright
-Here is an example of text written
-flushright. The @code{@@flushright} command
-right justifies every line but leaves the
-left end ragged.
-@end flushright
-
-@node cartouche, , flushleft & flushright, Quotations and Examples
-@section Drawing Cartouches Around Examples
-@findex cartouche
-@cindex Box with rounded corners
-
-In a printed manual, the @code{@@cartouche} command draws a box with
-rounded corners around its contents. You can use this command to
-further highlight an example or quotation. For instance, you could
-write a manual in which one type of example is surrounded by a cartouche
-for emphasis.@refill
-
-The @code{@@cartouche} command affects only the printed manual; it has
-no effect in the Info file.@refill
-
-@need 1500
-For example,
-
-@example
-@group
-@@example
-@@cartouche
-% pwd
-/usr/local/share/emacs
-@@end cartouche
-@@end example
-@end group
-@end example
-
-@noindent
-surrounds the two-line example with a box with rounded corners, in the
-printed manual.
-
-@iftex
-In a printed manual, the example looks like this:@refill
-
-@example
-@group
-@cartouche
-% pwd
-/usr/local/lib/emacs/info
-@end cartouche
-@end group
-@end example
-@end iftex
-
-
-@node Lists and Tables, Indices, Quotations and Examples, Top
-@chapter Lists and Tables
-@cindex Making lists and tables
-@cindex Lists and tables, making
-@cindex Tables and lists, making
-
-Texinfo has several ways of making lists and tables. Lists can be
-bulleted or numbered; two-column tables can highlight the items in
-the first column; multi-column tables are also supported.
-
-@menu
-* Introducing Lists:: Texinfo formats lists for you.
-* itemize:: How to construct a simple list.
-* enumerate:: How to construct a numbered list.
-* Two-column Tables:: How to construct a two-column table.
-* Multi-column Tables:: How to construct generalized tables.
-@end menu
-
-@ifinfo
-@node Introducing Lists, itemize, Lists and Tables, Lists and Tables
-@heading Introducing Lists
-@end ifinfo
-
-Texinfo automatically indents the text in lists or tables, and numbers
-an enumerated list. This last feature is useful if you modify the
-list, since you do not need to renumber it yourself.@refill
-
-Numbered lists and tables begin with the appropriate @@-command at the
-beginning of a line, and end with the corresponding @code{@@end}
-command on a line by itself. The table and itemized-list commands
-also require that you write formatting information on the same line as
-the beginning @@-command.@refill
-
-Begin an enumerated list, for example, with an @code{@@enumerate}
-command and end the list with an @code{@@end enumerate} command.
-Begin an itemized list with an @code{@@itemize} command, followed on
-the same line by a formatting command such as @code{@@bullet}, and end
-the list with an @code{@@end itemize} command.@refill
-@findex end
-
-Precede each element of a list with an @code{@@item} or @code{@@itemx}
-command.@refill
-
-@sp 1
-@noindent
-Here is an itemized list of the different kinds of table and lists:@refill
-
-@itemize @bullet
-@item
-Itemized lists with and without bullets.
-
-@item
-Enumerated lists, using numbers or letters.
-
-@item
-Two-column tables with highlighting.
-@end itemize
-
-@sp 1
-@noindent
-Here is an enumerated list with the same items:@refill
-
-@enumerate
-@item
-Itemized lists with and without bullets.
-
-@item
-Enumerated lists, using numbers or letters.
-
-@item
-Two-column tables with highlighting.
-@end enumerate
-
-@sp 1
-@noindent
-And here is a two-column table with the same items and their
-@w{@@-commands}:@refill
-
-@table @code
-@item @@itemize
-Itemized lists with and without bullets.
-
-@item @@enumerate
-Enumerated lists, using numbers or letters.
-
-@item @@table
-@itemx @@ftable
-@itemx @@vtable
-Two-column tables with indexing.
-@end table
-
-@node itemize, enumerate, Introducing Lists, Lists and Tables
-@comment node-name, next, previous, up
-@section Making an Itemized List
-@cindex Itemization
-@findex itemize
-
-The @code{@@itemize} command produces sequences of indented
-paragraphs, with a bullet or other mark inside the left margin
-at the beginning of each paragraph for which such a mark is desired.@refill
-
-Begin an itemized list by writing @code{@@itemize} at the beginning of
-a line. Follow the command, on the same line, with a character or a
-Texinfo command that generates a mark. Usually, you will write
-@code{@@bullet} after @code{@@itemize}, but you can use
-@code{@@minus}, or any character or any special symbol that results in
-a single character in the Info file. (When you write @code{@@bullet}
-or @code{@@minus} after an @code{@@itemize} command, you may omit the
-@samp{@{@}}.)@refill
-
-Write the text of the indented paragraphs themselves after the
-@code{@@itemize}, up to another line that says @code{@@end
-itemize}.@refill
-
-Before each paragraph for which a mark in the margin is desired, write
-a line that says just @code{@@item}. Do not write any other text on this
-line.@refill
-@findex item
-
-Usually, you should put a blank line before an @code{@@item}. This
-puts a blank line in the Info file. (@TeX{} inserts the proper
-interline whitespace in either case.) Except when the entries are
-very brief, these blank lines make the list look better.@refill
-
-Here is an example of the use of @code{@@itemize}, followed by the
-output it produces. Note that @code{@@bullet} produces an @samp{*} in
-Info and a round dot in @TeX{}.@refill
-
-@example
-@group
-@@itemize @@bullet
-@@item
-Some text for foo.
-
-@@item
-Some text
-for bar.
-@@end itemize
-@end group
-@end example
-
-@noindent
-This produces:
-
-@quotation
-@itemize @bullet
-@item
-Some text for foo.
-
-@item
-Some text
-for bar.
-@end itemize
-@end quotation
-
-Itemized lists may be embedded within other itemized lists. Here is a
-list marked with dashes embedded in a list marked with bullets:@refill
-
-@example
-@group
-@@itemize @@bullet
-@@item
-First item.
-
-@@itemize @@minus
-@@item
-Inner item.
-
-@@item
-Second inner item.
-@@end itemize
-
-@@item
-Second outer item.
-@@end itemize
-@end group
-@end example
-
-@noindent
-This produces:
-
-@quotation
-@itemize @bullet
-@item
-First item.
-
-@itemize @minus
-@item
-Inner item.
-
-@item
-Second inner item.
-@end itemize
-
-@item
-Second outer item.
-@end itemize
-@end quotation
-
-@node enumerate, Two-column Tables, itemize, Lists and Tables
-@comment node-name, next, previous, up
-@section Making a Numbered or Lettered List
-@cindex Enumeration
-@findex enumerate
-
-@code{@@enumerate} is like @code{@@itemize} (@pxref{itemize,,
-@code{@@itemize}}), except that the labels on the items are
-successive integers or letters instead of bullets.
-
-Write the @code{@@enumerate} command at the beginning of a line. The
-command does not require an argument, but accepts either a number or a
-letter as an option. Without an argument, @code{@@enumerate} starts the
-list with the number @samp{1}. With a numeric argument, such as
-@samp{3}, the command starts the list with that number. With an upper
-or lower case letter, such as @samp{a} or @samp{A}, the command starts
-the list with that letter.@refill
-
-Write the text of the enumerated list in the same way you write an
-itemized list: put @code{@@item} on a line of its own before the start
-of each paragraph that you want enumerated. Do not write any other text
-on the line beginning with @code{@@item}.@refill
-
-You should put a blank line between entries in the list.
-This generally makes it easier to read the Info file.@refill
-
-@need 1500
-Here is an example of @code{@@enumerate} without an argument:@refill
-
-@example
-@group
-@@enumerate
-@@item
-Underlying causes.
-
-@@item
-Proximate causes.
-@@end enumerate
-@end group
-@end example
-
-@noindent
-This produces:
-
-@enumerate
-@item
-Underlying causes.
-
-@item
-Proximate causes.
-@end enumerate
-@sp 1
-Here is an example with an argument of @kbd{3}:@refill
-@sp 1
-@example
-@group
-@@enumerate 3
-@@item
-Predisposing causes.
-
-@@item
-Precipitating causes.
-
-@@item
-Perpetuating causes.
-@@end enumerate
-@end group
-@end example
-
-@noindent
-This produces:
-
-@enumerate 3
-@item
-Predisposing causes.
-
-@item
-Precipitating causes.
-
-@item
-Perpetuating causes.
-@end enumerate
-@sp 1
-Here is a brief summary of the alternatives. The summary is constructed
-using @code{@@enumerate} with an argument of @kbd{a}.@refill
-@sp 1
-@enumerate a
-@item
-@code{@@enumerate}
-
-Without an argument, produce a numbered list, starting with the number
-1.@refill
-
-@item
-@code{@@enumerate @var{positive-integer}}
-
-With a (positive) numeric argument, start a numbered list with that
-number. You can use this to continue a list that you interrupted with
-other text.@refill
-
-@item
-@code{@@enumerate @var{upper-case-letter}}
-
-With an upper case letter as argument, start a list
-in which each item is marked
-by a letter, beginning with that upper case letter.@refill
-
-@item
-@code{@@enumerate @var{lower-case-letter}}
-
-With a lower case letter as argument, start a list
-in which each item is marked by
-a letter, beginning with that lower case letter.@refill
-@end enumerate
-
-You can also nest enumerated lists, as in an outline.@refill
-
-@node Two-column Tables, Multi-column Tables, enumerate, Lists and Tables
-@section Making a Two-column Table
-@cindex Tables, making two-column
-@findex table
-
-@code{@@table} is similar to @code{@@itemize} (@pxref{itemize,,
-@code{@@itemize}}), but allows you to specify a name or heading line for
-each item. The @code{@@table} command is used to produce two-column
-tables, and is especially useful for glossaries, explanatory
-exhibits, and command-line option summaries.
-
-@menu
-* table:: How to construct a two-column table.
-* ftable vtable:: Automatic indexing for two-column tables.
-* itemx:: How to put more entries in the first column.
-@end menu
-
-@ifinfo
-@node table, ftable vtable, Two-column Tables, Two-column Tables
-@subheading Using the @code{@@table} Command
-
-Use the @code{@@table} command to produce two-column tables.@refill
-@end ifinfo
-
-Write the @code{@@table} command at the beginning of a line and follow
-it on the same line with an argument that is a Texinfo ``indicating''
-command such as @code{@@code}, @code{@@samp}, @code{@@var}, or
-@code{@@kbd} (@pxref{Indicating}). Although these commands are usually
-followed by arguments in braces, in this case you use the command name
-without an argument because @code{@@item} will supply the argument.
-This command will be applied to the text that goes into the first column
-of each item and determines how it will be highlighted. For example,
-@code{@@code} will cause the text in the first column to be highlighted
-with an @code{@@code} command. (We recommend @code{@@code} for
-@code{@@table}'s of command-line options.)
-
-@findex asis
-You may also choose to use the @code{@@asis} command as an argument to
-@code{@@table}. @code{@@asis} is a command that does nothing; if you
-use this command after @code{@@table}, @TeX{} and the Info formatting
-commands output the first column entries without added highlighting
-(``as is'').@refill
-
-(The @code{@@table} command may work with other commands besides those
-listed here. However, you can only use commands that normally take
-arguments in braces.)@refill
-
-Begin each table entry with an @code{@@item} command at the beginning
-of a line. Write the first column text on the same line as the
-@code{@@item} command. Write the second column text on the line
-following the @code{@@item} line and on subsequent lines. (You do not
-need to type anything for an empty second column entry.) You may
-write as many lines of supporting text as you wish, even several
-paragraphs. But only text on the same line as the @code{@@item} will
-be placed in the first column.@refill
-@findex item
-
-Normally, you should put a blank line before an @code{@@item} line.
-This puts a blank like in the Info file. Except when the entries are
-very brief, a blank line looks better.@refill
-
-@need 1500
-The following table, for example, highlights the text in the first
-column with an @code{@@samp} command:@refill
-
-@example
-@group
-@@table @@samp
-@@item foo
-This is the text for
-@@samp@{foo@}.
-
-@@item bar
-Text for @@samp@{bar@}.
-@@end table
-@end group
-@end example
-
-@noindent
-This produces:
-
-@table @samp
-@item foo
-This is the text for
-@samp{foo}.
-@item bar
-Text for @samp{bar}.
-@end table
-
-If you want to list two or more named items with a single block of
-text, use the @code{@@itemx} command. (@xref{itemx, ,
-@code{@@itemx}}.)@refill
-
-@node ftable vtable, itemx, table, Two-column Tables
-@comment node-name, next, previous, up
-@subsection @code{@@ftable} and @code{@@vtable}
-@cindex Tables with indexes
-@cindex Indexing table entries automatically
-@findex ftable
-@findex vtable
-
-The @code{@@ftable} and @code{@@vtable} commands are the same as the
-@code{@@table} command except that @code{@@ftable} automatically enters
-each of the items in the first column of the table into the index of
-functions and @code{@@vtable} automatically enters each of the items in
-the first column of the table into the index of variables. This
-simplifies the task of creating indices. Only the items on the same
-line as the @code{@@item} commands are indexed, and they are indexed in
-exactly the form that they appear on that line. @xref{Indices, ,
-Creating Indices}, for more information about indices.@refill
-
-Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
-writing the @@-command at the beginning of a line, followed on the same
-line by an argument that is a Texinfo command such as @code{@@code},
-exactly as you would for an @code{@@table} command; and end the table
-with an @code{@@end ftable} or @code{@@end vtable} command on a line by
-itself.
-
-See the example for @code{@@table} in the previous section.
-
-@node itemx, , ftable vtable, Two-column Tables
-@comment node-name, next, previous, up
-@subsection @code{@@itemx}
-@cindex Two named items for @code{@@table}
-@findex itemx
-
-Use the @code{@@itemx} command inside a table when you have two or more
-first column entries for the same item, each of which should appear on a
-line of its own. Use @code{@@itemx} for all but the first entry;
-@code{@@itemx} should always follow an @code{@@item} command. The
-@code{@@itemx} command works exactly like @code{@@item} except that it
-does not generate extra vertical space above the first column text.
-
-@need 1000
-For example,
-
-@example
-@group
-@@table @@code
-@@item upcase
-@@itemx downcase
-These two functions accept a character or a string as
-argument, and return the corresponding upper case (lower
-case) character or string.
-@@end table
-@end group
-@end example
-
-@noindent
-This produces:
-
-@table @code
-@item upcase
-@itemx downcase
-These two functions accept a character or a string as
-argument, and return the corresponding upper case (lower
-case) character or string.@refill
-@end table
-
-@noindent
-(Note also that this example illustrates multi-line supporting text in
-a two-column table.)@refill
-
-
-@node Multi-column Tables, , Two-column Tables, Lists and Tables
-@section Multi-column Tables
-@cindex Tables, making multi-column
-@findex multitable
-
-@code{@@multitable} allows you to construct tables with any number of
-columns, with each column having any width you like.
-
-You define the column widths on the @code{@@multitable} line itself, and
-write each row of the actual table following an @code{@@item} command,
-with columns separated by an @code{@@tab} command. Finally, @code{@@end
-multitable} completes the table. Details in the sections below.
-
-@menu
-* Multitable Column Widths:: Defining multitable column widths.
-* Multitable Rows:: Defining multitable rows, with examples.
-@end menu
-
-@node Multitable Column Widths, Multitable Rows, Multi-column Tables, Multi-column Tables
-@subsection Multitable Column Widths
-@cindex Multitable column widths
-@cindex Column widths, defining for multitables
-@cindex Widths, defining multitable column
-
-You can define the column widths for a multitable in two ways: as
-fractions of the line length; or with a prototype row. Mixing the two
-methods is not supported. In either case, the widths are defined
-entirely on the same line as the @code{@@multitable} command.
-
-@enumerate
-@item
-@findex columnfractions
-@cindex Line length, column widths as fraction of
-To specify column widths as fractions of the line length, write
-@code{@@columnfractions} and the decimal numbers (presumably less than
-1) after the @code{@@multitable} command, as in:
-
-@example
-@@multitable @@columnfractions .33 .33 .33
-@end example
-
-@noindent The fractions need not add up exactly to 1.0, as these do
-not. This allows you to produce tables that do not need the full line
-length.
-
-@item
-@cindex Prototype row, column widths defined by
-To specify a prototype row, write the longest entry for each column
-enclosed in braces after the @code{@@multitable} command. For example:
-
-@example
-@@multitable @{some text for column one@} @{for column two@}
-@end example
-
-@noindent
-The first column will then have the width of the typeset `some text for
-column one', and the second column the width of `for column two'.
-
-The prototype entries need not appear in the table itself.
-
-Although we used simple text in this example, the prototype entries can
-contain Texinfo commands; markup commands such as @code{@@code} are
-particularly likely to be useful.
-
-@end enumerate
-
-
-@node Multitable Rows, , Multitable Column Widths, Multi-column Tables
-@subsection Multitable Rows
-@cindex Multitable rows
-@cindex Rows, of a multitable
-
-@findex item
-@cindex tab
-After the @code{@@multitable} command defining the column widths (see
-the previous section), you begin each row in the body of a multitable
-with @code{@@item}, and separate the column entries with @code{@@tab}.
-Line breaks are not special within the table body, and you may break
-input lines in your source file as necessary.
-
-Here is a complete example of a multi-column table (the text is from
-@cite{The GNU Emacs Manual}, @pxref{Split Window,, Splitting Windows,
-emacs, The GNU Emacs Manual}):
-
-@example
-@@multitable @@columnfractions .15 .45 .4
-@@item Key @@tab Command @@tab Description
-@@item C-x 2
-@@tab @@code@{split-window-vertically@}
-@@tab Split the selected window into two windows,
-with one above the other.
-@@item C-x 3
-@@tab @@code@{split-window-horizontally@}
-@@tab Split the selected window into two windows
-positioned side by side.
-@@item C-Mouse-2
-@@tab
-@@tab In the mode line or scroll bar of a window,
-split that window.
-@@end multitable
-@end example
-
-@noindent produces:
-
-@multitable @columnfractions .15 .45 .4
-@item Key @tab Command @tab Description
-@item C-x 2
-@tab @code{split-window-vertically}
-@tab Split the selected window into two windows,
-with one above the other.
-@item C-x 3
-@tab @code{split-window-horizontally}
-@tab Split the selected window into two windows
-positioned side by side.
-@item C-Mouse-2
-@tab
-@tab In the mode line or scroll bar of a window,
-split that window.
-@end multitable
-
-
-@node Indices, Insertions, Lists and Tables, Top
-@comment node-name, next, previous, up
-@chapter Creating Indices
-@cindex Indices
-@cindex Creating indices
-
-Using Texinfo, you can generate indices without having to sort and
-collate entries manually. In an index, the entries are listed in
-alphabetical order, together with information on how to find the
-discussion of each entry. In a printed manual, this information
-consists of page numbers. In an Info file, this information is a menu
-entry leading to the first node referenced.@refill
-
-Texinfo provides several predefined kinds of index: an index
-for functions, an index for variables, an index for concepts, and so
-on. You can combine indices or use them for other than their
-canonical purpose. If you wish, you can define your own indices.@refill
-
-@menu
-* Index Entries:: Choose different words for index entries.
-* Predefined Indices:: Use different indices for different kinds
- of entry.
-* Indexing Commands:: How to make an index entry.
-* Combining Indices:: How to combine indices.
-* New Indices:: How to define your own indices.
-@end menu
-
-@node Index Entries, Predefined Indices, Indices, Indices
-@comment node-name, next, previous, up
-@section Making Index Entries
-@cindex Index entries, making
-@cindex Entries, making index
-
-When you are making index entries, it is good practice to think of the
-different ways people may look for something. Different people
-@emph{do not} think of the same words when they look something up. A
-helpful index will have items indexed under all the different words
-that people may use. For example, one reader may think it obvious that
-the two-letter names for indices should be listed under ``Indices,
-two-letter names'', since the word ``Index'' is the general concept.
-But another reader may remember the specific concept of two-letter
-names and search for the entry listed as ``Two letter names for
-indices''. A good index will have both entries and will help both
-readers.@refill
-
-Like typesetting, the construction of an index is a highly skilled,
-professional art, the subtleties of which are not appreciated until you
-need to do it yourself.@refill
-
-@xref{Printing Indices & Menus}, for information about printing an index
-at the end of a book or creating an index menu in an Info file.@refill
-
-@node Predefined Indices, Indexing Commands, Index Entries, Indices
-@comment node-name, next, previous, up
-@section Predefined Indices
-
-Texinfo provides six predefined indices:@refill
-
-@itemize @bullet
-@item
-A @dfn{concept index} listing concepts that are discussed.@refill
-
-@item
-A @dfn{function index} listing functions (such as entry points of
-libraries).@refill
-
-@item
-A @dfn{variables index} listing variables (such as global variables
-of libraries).@refill
-
-@item
-A @dfn{keystroke index} listing keyboard commands.@refill
-
-@item
-A @dfn{program index} listing names of programs.@refill
-
-@item
-A @dfn{data type index} listing data types (such as structures defined in
-header files).@refill
-@end itemize
-
-@noindent
-Not every manual needs all of these, and most manuals use two or three
-of them. This manual has two indices: a
-concept index and an @@-command index (that is actually the function
-index but is called a command index in the chapter heading). Two or
-more indices can be combined into one using the @code{@@synindex} or
-@code{@@syncodeindex} commands. @xref{Combining Indices}.@refill
-
-@node Indexing Commands, Combining Indices, Predefined Indices, Indices
-@comment node-name, next, previous, up
-@section Defining the Entries of an Index
-@cindex Defining indexing entries
-@cindex Index entries
-@cindex Entries for an index
-@cindex Specifying index entries
-@cindex Creating index entries
-
-The data to make an index come from many individual indexing commands
-scattered throughout the Texinfo source file. Each command says to add
-one entry to a particular index; after formatting, the index will give
-the current page number or node name as the reference.@refill
-
-An index entry consists of an indexing command at the beginning of a
-line followed, on the rest of the line, by the entry.@refill
-
-For example, this section begins with the following five entries for
-the concept index:@refill
-
-@example
-@@cindex Defining indexing entries
-@@cindex Index entries
-@@cindex Entries for an index
-@@cindex Specifying index entries
-@@cindex Creating index entries
-@end example
-
-Each predefined index has its own indexing command---@code{@@cindex}
-for the concept index, @code{@@findex} for the function index, and so
-on.@refill
-
-@cindex Writing index entries
-@cindex Index entry writing
-Concept index entries consist of text. The best way to write an index
-is to choose entries that are terse yet clear. If you can do this,
-the index often looks better if the entries are not capitalized, but
-written just as they would appear in the middle of a sentence.
-(Capitalize proper names and acronyms that always call for upper case
-letters.) This is the case convention we use in most GNU manuals'
-indices.
-
-If you don't see how to make an entry terse yet clear, make it longer
-and clear---not terse and confusing. If many of the entries are several
-words long, the index may look better if you use a different convention:
-to capitalize the first word of each entry. But do not capitalize a
-case-sensitive name such as a C or Lisp function name or a shell
-command; that would be a spelling error.
-
-Whichever case convention you use, please use it consistently!
-
-@ignore
-Concept index entries consist of English text. The usual convention
-is to capitalize the first word of each such index entry, unless that
-word is the name of a function, variable, or other such entity that
-should not be capitalized. However, if your concept index entries are
-consistently short (one or two words each) it may look better for each
-regular entry to start with a lower case letter, aside from proper
-names and acronyms that always call for upper case letters. Whichever
-convention you adapt, please be consistent!
-@end ignore
-
-Entries in indices other than the concept index are symbol names in
-programming languages, or program names; these names are usually
-case-sensitive, so use upper and lower case as required for them.
-
-By default, entries for a concept index are printed in a small roman
-font and entries for the other indices are printed in a small
-@code{@@code} font. You may change the way part of an entry is
-printed with the usual Texinfo commands, such as @code{@@file} for
-file names and @code{@@emph} for emphasis (@pxref{Marking
-Text}).@refill
-@cindex Index font types
-
-@cindex Predefined indexing commands
-@cindex Indexing commands, predefined
-The six indexing commands for predefined indices are:
-
-@table @code
-@item @@cindex @var{concept}
-@findex cindex
-Make an entry in the concept index for @var{concept}.@refill
-
-@item @@findex @var{function}
-@findex findex
-Make an entry in the function index for @var{function}.@refill
-
-@item @@vindex @var{variable}
-@findex vindex
-Make an entry in the variable index for @var{variable}.@refill
-
-@item @@kindex @var{keystroke}
-@findex kindex
-Make an entry in the key index for @var{keystroke}.@refill
-
-@item @@pindex @var{program}
-@findex pindex
-Make an entry in the program index for @var{program}.@refill
-
-@item @@tindex @var{data type}
-@findex tindex
-Make an entry in the data type index for @var{data type}.@refill
-@end table
-
-@quotation
-@strong{Caution:} Do not use a colon in an index entry. In Info, a
-colon separates the menu entry name from the node name. An extra
-colon confuses Info.
-@xref{Menu Parts, , The Parts of a Menu},
-for more information about the structure of a menu entry.@refill
-@end quotation
-
-If you write several identical index entries in different places in a
-Texinfo file, the index in the printed manual will list all the pages to
-which those entries refer. However, the index in the Info file will
-list @strong{only} the node that references the @strong{first} of those
-index entries. Therefore, it is best to write indices in which each
-entry refers to only one place in the Texinfo file. Fortunately, this
-constraint is a feature rather than a loss since it means that the index
-will be easy to use. Otherwise, you could create an index that lists
-several pages for one entry and your reader would not know to which page
-to turn. If you have two identical entries for one topic, change the
-topics slightly, or qualify them to indicate the difference.@refill
-
-You are not actually required to use the predefined indices for their
-canonical purposes. For example, suppose you wish to index some C
-preprocessor macros. You could put them in the function index along
-with actual functions, just by writing @code{@@findex} commands for
-them; then, when you print the ``Function Index'' as an unnumbered
-chapter, you could give it the title `Function and Macro Index' and
-all will be consistent for the reader. Or you could put the macros in
-with the data types by writing @code{@@tindex} commands for them, and
-give that index a suitable title so the reader will understand.
-(@xref{Printing Indices & Menus}.)@refill
-
-@node Combining Indices, New Indices, Indexing Commands, Indices
-@comment node-name, next, previous, up
-@section Combining Indices
-@cindex Combining indices
-@cindex Indices, combining them
-
-Sometimes you will want to combine two disparate indices such as functions
-and concepts, perhaps because you have few enough of one of them that
-a separate index for them would look silly.@refill
-
-You could put functions into the concept index by writing
-@code{@@cindex} commands for them instead of @code{@@findex} commands,
-and produce a consistent manual by printing the concept index with the
-title `Function and Concept Index' and not printing the `Function
-Index' at all; but this is not a robust procedure. It works only if
-your document is never included as part of another
-document that is designed to have a separate function index; if your
-document were to be included with such a document, the functions from
-your document and those from the other would not end up together.
-Also, to make your function names appear in the right font in the
-concept index, you would need to enclose every one of them between
-the braces of @code{@@code}.@refill
-
-@menu
-* syncodeindex:: How to merge two indices, using @code{@@code}
- font for the merged-from index.
-* synindex:: How to merge two indices, using the
- default font of the merged-to index.
-@end menu
-
-@node syncodeindex, synindex, Combining Indices, Combining Indices
-@subsection @code{@@syncodeindex}
-@findex syncodeindex
-
-When you want to combine functions and concepts into one index, you
-should index the functions with @code{@@findex} and index the concepts
-with @code{@@cindex}, and use the @code{@@syncodeindex} command to
-redirect the function index entries into the concept index.@refill
-@findex syncodeindex
-
-The @code{@@syncodeindex} command takes two arguments; they are the name
-of the index to redirect, and the name of the index to redirect it to.
-The template looks like this:@refill
-
-@example
-@@syncodeindex @var{from} @var{to}
-@end example
-
-@cindex Predefined names for indices
-@cindex Two letter names for indices
-@cindex Indices, two letter names
-@cindex Names for indices
-For this purpose, the indices are given two-letter names:@refill
-
-@table @samp
-@item cp
-concept index
-@item fn
-function index
-@item vr
-variable index
-@item ky
-key index
-@item pg
-program index
-@item tp
-data type index
-@end table
-
-Write an @code{@@syncodeindex} command before or shortly after the
-end-of-header line at the beginning of a Texinfo file. For example,
-to merge a function index with a concept index, write the
-following:@refill
-
-@example
-@@syncodeindex fn cp
-@end example
-
-@noindent
-This will cause all entries designated for the function index to merge
-in with the concept index instead.@refill
-
-To merge both a variables index and a function index into a concept
-index, write the following:@refill
-
-@example
-@group
-@@syncodeindex vr cp
-@@syncodeindex fn cp
-@end group
-@end example
-
-@cindex Fonts for indices
-The @code{@@syncodeindex} command puts all the entries from the `from'
-index (the redirected index) into the @code{@@code} font, overriding
-whatever default font is used by the index to which the entries are
-now directed. This way, if you direct function names from a function
-index into a concept index, all the function names are printed in the
-@code{@@code} font as you would expect.@refill
-
-@node synindex, , syncodeindex, Combining Indices
-@subsection @code{@@synindex}
-@findex synindex
-
-The @code{@@synindex} command is nearly the same as the
-@code{@@syncodeindex} command, except that it does not put the
-`from' index entries into the @code{@@code} font; rather it puts
-them in the roman font. Thus, you use @code{@@synindex} when you
-merge a concept index into a function index.@refill
-
-@xref{Printing Indices & Menus}, for information about printing an index
-at the end of a book or creating an index menu in an Info file.@refill
-
-@node New Indices, , Combining Indices, Indices
-@section Defining New Indices
-@cindex Defining new indices
-@cindex Indices, defining new
-@cindex New index defining
-@findex defindex
-@findex defcodeindex
-
-In addition to the predefined indices, you may use the
-@code{@@defindex} and @code{@@defcodeindex} commands to define new
-indices. These commands create new indexing @@-commands with which
-you mark index entries. The @code{@@defindex }command is used like
-this:@refill
-
-@example
-@@defindex @var{name}
-@end example
-
-The name of an index should be a two letter word, such as @samp{au}.
-For example:@refill
-
-@example
-@@defindex au
-@end example
-
-This defines a new index, called the @samp{au} index. At the same
-time, it creates a new indexing command, @code{@@auindex}, that you
-can use to make index entries. Use the new indexing command just as
-you would use a predefined indexing command.@refill
-
-For example, here is a section heading followed by a concept index
-entry and two @samp{au} index entries.@refill
-
-@example
-@@section Cognitive Semantics
-@@cindex kinesthetic image schemas
-@@auindex Johnson, Mark
-@@auindex Lakoff, George
-@end example
-
-@noindent
-(Evidently, @samp{au} serves here as an abbreviation for ``author''.)
-Texinfo constructs the new indexing command by concatenating the name
-of the index with @samp{index}; thus, defining an @samp{au} index
-leads to the automatic creation of an @code{@@auindex} command.@refill
-
-Use the @code{@@printindex} command to print the index, as you do with
-the predefined indices. For example:@refill
-
-@example
-@group
-@@node Author Index, Subject Index, , Top
-@@unnumbered Author Index
-
-@@printindex au
-@end group
-@end example
-
-The @code{@@defcodeindex} is like the @code{@@defindex} command, except
-that, in the printed output, it prints entries in an @code{@@code} font
-instead of a roman font. Thus, it parallels the @code{@@findex} command
-rather than the @code{@@cindex} command.@refill
-
-You should define new indices within or right after the end-of-header
-line of a Texinfo file, before any @code{@@synindex} or
-@code{@@syncodeindex} commands (@pxref{Header}).@refill
-
-@node Insertions, Breaks, Indices, Top
-@comment node-name, next, previous, up
-@chapter Special Insertions
-@cindex Inserting special characters and symbols
-@cindex Special insertions
-
-Texinfo provides several commands for inserting characters that have
-special meaning in Texinfo, such as braces, and for other graphic
-elements that do not correspond to simple characters you can type.
-
-@iftex
-These are:
-
-@itemize @bullet
-@item Braces, @samp{@@} and periods.
-@item Whitespace within and around a sentence.
-@item Accents.
-@item Dots and bullets.
-@item The @TeX{} logo and the copyright symbol.
-@item Mathematical expressions.
-@end itemize
-@end iftex
-
-@menu
-* Braces Atsigns:: How to insert braces, @samp{@@}.
-* Inserting Space:: How to insert the right amount of space
- within a sentence.
-* Inserting Accents:: How to insert accents and special characters.
-* Dots Bullets:: How to insert dots and bullets.
-* TeX and copyright:: How to insert the @TeX{} logo
- and the copyright symbol.
-* pounds:: How to insert the pounds currency symbol.
-* minus:: How to insert a minus sign.
-* math:: How to format a mathematical expression.
-* Glyphs:: How to indicate results of evaluation,
- expansion of macros, errors, etc.
-* Images:: How to include graphics.
-@end menu
-
-
-@node Braces Atsigns, Inserting Space, Insertions, Insertions
-@section Inserting @@ and Braces
-@cindex Inserting @@, braces
-@cindex Braces, inserting
-@cindex Special characters, commands to insert
-@cindex Commands to insert special characters
-
-@samp{@@} and curly braces are special characters in Texinfo. To insert
-these characters so they appear in text, you must put an @samp{@@} in
-front of these characters to prevent Texinfo from misinterpreting
-them.
-
-Do not put braces after any of these commands; they are not
-necessary.
-
-@menu
-* Inserting An Atsign:: How to insert @samp{@@}.
-* Inserting Braces:: How to insert @samp{@{} and @samp{@}}.
-@end menu
-
-@node Inserting An Atsign, Inserting Braces, Braces Atsigns, Braces Atsigns
-@subsection Inserting @samp{@@} with @@@@
-@findex @@ @r{(single @samp{@@})}
-
-@code{@@@@} stands for a single @samp{@@} in either printed or Info
-output.
-
-Do not put braces after an @code{@@@@} command.
-
-@node Inserting Braces, , Inserting An Atsign, Braces Atsigns
-@subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@}
-@findex @{ @r{(single @samp{@{})}
-@findex @} @r{(single @samp{@}})}
-
-@code{@@@{} stands for a single @samp{@{} in either printed or Info
-output.
-
-@code{@@@}} stands for a single @samp{@}} in either printed or Info
-output.
-
-Do not put braces after either an @code{@@@{} or an @code{@@@}}
-command.
-
-
-@node Inserting Space, Inserting Accents, Braces Atsigns, Insertions
-@section Inserting Space
-
-@cindex Inserting space
-@cindex Spacing, inserting
-@cindex Whitespace, inserting
-The following sections describe commands that control spacing of various
-kinds within and after sentences.
-
-@menu
-* Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
-* Ending a Sentence:: Sometimes it does.
-* Multiple Spaces:: Inserting multiple spaces.
-* dmn:: How to format a dimension.
-@end menu
-
-@node Not Ending a Sentence, Ending a Sentence, Inserting Space, Inserting Space
-@subsection Not Ending a Sentence
-
-@cindex Not ending a sentence
-@cindex Sentence non-ending punctuation
-@cindex Periods, inserting
-Depending on whether a period or exclamation point or question mark is
-inside or at the end of a sentence, less or more space is inserted after
-a period in a typeset manual. Since it is not always possible for
-Texinfo to determine when a period ends a sentence and when it is used
-in an abbreviation, special commands are needed in some circumstances.
-(Usually, Texinfo can guess how to handle periods, so you do not need to
-use the special commands; you just enter a period as you would if you
-were using a typewriter, which means you put two spaces after the
-period, question mark, or exclamation mark that ends a sentence.)
-
-@findex : @r{(suppress widening)}
-Use the @code{@@:}@: command after a period, question mark,
-exclamation mark, or colon that should not be followed by extra space.
-For example, use @code{@@:}@: after periods that end abbreviations
-which are not at the ends of sentences.
-
-@need 700
-For example,
-
-@example
-The s.o.p.@@: has three parts @dots{}
-The s.o.p. has three parts @dots{}
-@end example
-
-@noindent
-@ifinfo
-produces
-@end ifinfo
-@iftex
-produces the following. If you look carefully at this printed output,
-you will see a little more whitespace after @samp{s.o.p.} in the second
-line.@refill
-@end iftex
-
-@quotation
-The s.o.p.@: has three parts @dots{}@*
-The s.o.p. has three parts @dots{}
-@end quotation
-
-@noindent
-(Incidentally, @samp{s.o.p.} is an abbreviation for ``Standard Operating
-Procedure''.)
-
-@code{@@:} has no effect on the Info output. Do not put braces after
-@code{@@:}.
-
-
-@node Ending a Sentence, Multiple Spaces, Not Ending a Sentence, Inserting Space
-@subsection Ending a Sentence
-
-@cindex Ending a Sentence
-@cindex Sentence ending punctuation
-
-@findex . @r{(end of sentence)}
-@findex ! @r{(end of sentence)}
-@findex ? @r{(end of sentence)}
-Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an
-exclamation point, and @code{@@?}@: instead of a question mark at the end
-of a sentence that ends with a single capital letter. Otherwise, @TeX{}
-will think the letter is an abbreviation and will not insert the correct
-end-of-sentence spacing. Here is an example:
-
-@example
-Give it to M.I.B. and to M.E.W@@. Also, give it to R.J.C@@.
-Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
-@end example
-
-@noindent
-@ifinfo
-produces
-@end ifinfo
-@iftex
-produces the following. If you look carefully at this printed output,
-you will see a little more whitespace after the @samp{W} in the first
-line.
-@end iftex
-
-@quotation
-Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@.@*
-Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
-@end quotation
-
-In the Info file output, @code{@@.}@: is equivalent to a simple
-@samp{.}; likewise for @code{@@!}@: and @code{@@?}@:.
-
-The meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to
-work well with the Emacs sentence motion commands (@pxref{Sentences,,,
-emacs, The GNU Emacs Manual}). This made it necessary for them to be
-incompatible with some other formatting systems that use @@-commands.
-
-Do not put braces after any of these commands.
-
-
-@node Multiple Spaces, dmn, Ending a Sentence, Inserting Space
-@subsection Multiple Spaces
-
-@cindex Multiple spaces
-@cindex Whitespace, inserting
-@findex (space)
-@findex (tab)
-@findex (newline)
-
-Ordinarily, @TeX{} collapses multiple whitespace characters (space, tab,
-and newline) into a single space. Info output, on the other hand,
-preserves whitespace as you type it, except for changing a newline into
-a space; this is why it is important to put two spaces at the end of
-sentences in Texinfo documents.
-
-Occasionally, you may want to actually insert several consecutive
-spaces, either for purposes of example (what your program does with
-multiple spaces as input), or merely for purposes of appearance in
-headings or lists. Texinfo supports three commands:
-@code{@@@kbd{SPACE}}, @code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of
-which insert a single space into the output. (Here,
-@code{@@@kbd{SPACE}} represents an @samp{@@} character followed by a
-space, i.e., @samp{@@ }, and @kbd{TAB} and @kbd{NL} represent the tab
-character and end-of-line, i.e., when @samp{@@} is the last character on
-a line.)
-
-For example,
-@example
-Spacey@@ @@ @@ @@
-example.
-@end example
-
-@noindent produces
-
-@example
-Spacey@ @ @ @
-example.
-@end example
-
-Other possible uses of @code{@@@kbd{SPACE}} have been subsumed by
-@code{@@multitable} (@pxref{Multi-column Tables}).
-
-Do not follow any of these commands with braces.
-
-
-@node dmn, , Multiple Spaces, Inserting Space
-@subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
-@cindex Thin space between number, dimension
-@cindex Dimension formatting
-@cindex Format a dimension
-@findex dmn
-
-At times, you may want to write @samp{12@dmn{pt}} or
-@samp{8.5@dmn{in}} with little or no space between the number and the
-abbreviation for the dimension. You can use the @code{@@dmn} command
-to do this. On seeing the command, @TeX{} inserts just enough space
-for proper typesetting; the Info formatting commands insert no space
-at all, since the Info file does not require it.@refill
-
-To use the @code{@@dmn} command, write the number and then follow it
-immediately, with no intervening space, by @code{@@dmn}, and then by
-the dimension within braces. For example,
-
-@example
-A4 paper is 8.27@@dmn@{in@} wide.
-@end example
-
-@noindent
-produces
-
-@quotation
-A4 paper is 8.27@dmn{in} wide.
-@end quotation
-
-Not everyone uses this style. Some people prefer @w{@samp{8.27 in.@@:}}
-or @w{@samp{8.27 inches}} to @samp{8.27@@dmn@{in@}} in the Texinfo file.
-In these cases, however, the formatters may insert a line break between
-the number and the dimension, so use @code{@@w} (@pxref{w}). Also, if
-you write a period after an abbreviation within a sentence, you should
-write @samp{@@:} after the period to prevent @TeX{} from inserting extra
-whitespace, as shown here. @xref{Inserting Space}.
-
-
-@node Inserting Accents, Dots Bullets, Inserting Space, Insertions
-@section Inserting Accents
-
-@cindex Inserting accents
-@cindex Accents, inserting
-@cindex Floating accents, inserting
-
-Here is a table with the commands Texinfo provides for inserting
-floating accents. The commands with non-alphabetic names do not take
-braces around their argument (which is taken to be the next character).
-(Exception: @code{@@,} @emph{does} take braces around its argument.)
-This is so as to make the source as convenient to type and read as
-possible, since accented characters are very common in some languages.
-
-@findex "
-@cindex Umlaut accent
-@findex '
-@cindex Acute accent
-@findex =
-@cindex Macron accent
-@findex ^
-@cindex Circumflex accent
-@findex `
-@cindex Grave accent
-@findex ~
-@cindex Tilde accent
-@findex ,
-@cindex Cedilla accent
-@findex dotaccent
-@cindex Dot accent
-@findex H
-@cindex Hungariam umlaut accent
-@findex ringaccent
-@cindex Ring accent
-@findex tieaccent
-@cindex Tie-after accent
-@findex u
-@cindex Breve accent
-@findex ubaraccent
-@cindex Underbar accent
-@findex udotaccent
-@cindex Underdot accent
-@findex v
-@cindex Check accent
-@multitable {@@questiondown@{@}} {Output} {macron/overbar accent}
-@item Command @tab Output @tab What
-@item @t{@@"o} @tab @"o @tab umlaut accent
-@item @t{@@'o} @tab @'o @tab acute accent
-@item @t{@@,@{c@}} @tab @,{c} @tab cedilla accent
-@item @t{@@=o} @tab @=o @tab macron/overbar accent
-@item @t{@@^o} @tab @^o @tab circumflex accent
-@item @t{@@`o} @tab @`o @tab grave accent
-@item @t{@@~o} @tab @~o @tab tilde accent
-@item @t{@@dotaccent@{o@}} @tab @dotaccent{o} @tab overdot accent
-@item @t{@@H@{o@}} @tab @H{o} @tab long Hungarian umlaut
-@item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent
-@item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent
-@item @t{@@u@{o@}} @tab @u{o} @tab breve accent
-@item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent
-@item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent
-@item @t{@@v@{o@}} @tab @v{o} @tab hacek or check accent
-@end multitable
-
-This table lists the Texinfo commands for inserting other characters
-commonly used in languages other than English.
-
-@findex questiondown
-@cindex @questiondown{}
-@findex exclamdown
-@cindex @exclamdown{}
-@findex aa
-@cindex @aa{}
-@findex AA
-@cindex @AA{}
-@findex ae
-@cindex @ae{}
-@findex AE
-@cindex @AE{}
-@findex dotless
-@cindex @dotless{i}
-@cindex @dotless{j}
-@cindex Dotless i, j
-@findex l
-@cindex @l{}
-@findex L
-@cindex @L{}
-@findex o
-@cindex @o{}
-@findex O
-@cindex @O{}
-@findex oe
-@cindex @oe{}
-@findex OE
-@cindex @OE{}
-@findex ss
-@cindex @ss{}
-@cindex Es-zet
-@cindex Sharp S
-@cindex German S
-@multitable {@@questiondown@{@}} {oe,OE} {es-zet or sharp S}
-@item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down !
-@item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
-@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab A,a with circle
-@item @t{@@ae@{@},@@AE@{@}} @tab @ae{},@AE{} @tab ae,AE ligatures
-@item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i
-@item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j
-@item @t{@@l@{@},@@L@{@}} @tab @l{},@L{} @tab suppressed-L,l
-@item @t{@@o@{@},@@O@{@}} @tab @o{},@O{} @tab O,o with slash
-@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab OE,oe ligatures
-@item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S
-@end multitable
-
-
-@node Dots Bullets, TeX and copyright, Inserting Accents, Insertions
-@section Inserting Ellipsis, Dots, and Bullets
-@cindex Dots, inserting
-@cindex Bullets, inserting
-@cindex Ellipsis, inserting
-@cindex Inserting ellipsis
-@cindex Inserting dots
-@cindex Special typesetting commands
-@cindex Typesetting commands for dots, etc.
-
-An @dfn{ellipsis} (a line of dots) is not typeset as a string of
-periods, so a special command is used for ellipsis in Texinfo. The
-@code{@@bullet} command is special, too. Each of these commands is
-followed by a pair of braces, @samp{@{@}}, without any whitespace
-between the name of the command and the braces. (You need to use braces
-with these commands because you can use them next to other text; without
-the braces, the formatters would be confused. @xref{Command Syntax, ,
-@@-Command Syntax}, for further information.)@refill
-
-@menu
-* dots:: How to insert dots @dots{}
-* bullet:: How to insert a bullet.
-@end menu
-
-
-@node dots, bullet, Dots Bullets, Dots Bullets
-@subsection @code{@@dots}@{@} (@dots{})
-@findex dots
-@cindex Inserting dots
-@cindex Dots, inserting
-
-Use the @code{@@dots@{@}} command to generate an ellipsis, which is
-three dots in a row, appropriately spaced, like this: `@dots{}'. Do
-not simply write three periods in the input file; that would work for
-the Info file output, but would produce the wrong amount of space
-between the periods in the printed manual.
-
-Similarly, the @code{@@enddots@{@}} command generates an
-end-of-sentence ellipsis (four dots) @enddots{}
-
-@iftex
-Here is an ellipsis: @dots{}
-Here are three periods in a row: ...
-
-In printed output, the three periods in a row are closer together than
-the dots in the ellipsis.
-@end iftex
-
-
-@node bullet, , dots, Dots Bullets
-@subsection @code{@@bullet}@{@} (@bullet{})
-@findex bullet
-
-Use the @code{@@bullet@{@}} command to generate a large round dot, or
-the closest possible thing to one. In Info, an asterisk is used.@refill
-
-Here is a bullet: @bullet{}
-
-When you use @code{@@bullet} in @code{@@itemize}, you do not need to
-type the braces, because @code{@@itemize} supplies them.
-(@xref{itemize, , @code{@@itemize}}.)@refill
-
-
-@node TeX and copyright, pounds, Dots Bullets, Insertions
-@section Inserting @TeX{} and the Copyright Symbol
-
-The logo `@TeX{}' is typeset in a special fashion and it needs an
-@@-command. The copyright symbol, `@copyright{}', is also special.
-Each of these commands is followed by a pair of braces, @samp{@{@}},
-without any whitespace between the name of the command and the
-braces.@refill
-
-@menu
-* tex:: How to insert the @TeX{} logo.
-* copyright symbol:: How to use @code{@@copyright}@{@}.
-@end menu
-
-
-@node tex, copyright symbol, TeX and copyright, TeX and copyright
-@subsection @code{@@TeX}@{@} (@TeX{})
-@findex tex (command)
-
-Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed
-manual, this is a special logo that is different from three ordinary
-letters. In Info, it just looks like @samp{TeX}. The
-@code{@@TeX@{@}} command is unique among Texinfo commands in that the
-@kbd{T} and the @kbd{X} are in upper case.@refill
-
-
-@node copyright symbol, , tex, TeX and copyright
-@subsection @code{@@copyright}@{@} (@copyright{})
-@findex copyright
-
-Use the @code{@@copyright@{@}} command to generate `@copyright{}'. In
-a printed manual, this is a @samp{c} inside a circle, and in Info,
-this is @samp{(C)}.@refill
-
-
-@node pounds, minus, TeX and copyright, Insertions
-@section @code{@@pounds}@{@} (@pounds{}): Pounds Sterling
-@findex pounds
-
-Use the @code{@@pounds@{@}} command to generate `@pounds{}'. In a
-printed manual, this is the symbol for the currency pounds sterling.
-In Info, it is a @samp{#}. Other currency symbols are unfortunately not
-available.
-
-
-@node minus, math, pounds, Insertions
-@section @code{@@minus}@{@} (@minus{}): Inserting a Minus Sign
-@findex minus
-
-Use the @code{@@minus@{@}} command to generate a minus sign. In a
-fixed-width font, this is a single hyphen, but in a proportional font,
-the symbol is the customary length for a minus sign---a little longer
-than a hyphen, shorter than an em-dash:
-
-@display
-@samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
-
-`-' is a hyphen generated with the character @samp{-},
-
-`---' is an em-dash for text.
-@end display
-
-@noindent
-In the fixed-width font used by Info, @code{@@minus@{@}} is the same
-as a hyphen.
-
-You should not use @code{@@minus@{@}} inside @code{@@code} or
-@code{@@example} because the width distinction is not made in the
-fixed-width font they use.
-
-When you use @code{@@minus} to specify the mark beginning each entry in
-an itemized list, you do not need to type the braces
-(@pxref{itemize, , @code{@@itemize}}.)
-
-
-@node math, Glyphs, minus, Insertions
-@section @code{@@math}: Inserting Mathematical Expressions
-@findex math
-@cindex Mathematical expressions
-
-You can write a short mathematical expression with the @code{@@math}
-command. Write the mathematical expression between braces, like this:
-
-@example
-@@math@{(a + b)(a + b) = a^2 + 2ab + b^2@}
-@end example
-
-@iftex
-@need 1000
-@noindent
-This produces the following in @TeX{}:
-
-@display
-@math{(a + b)(a + b) = a^2 + 2ab + b^2}
-@end display
-
-@noindent
-and the following in Info:
-@end iftex
-@ifinfo
-@noindent
-This produces the following in Info:
-@end ifinfo
-
-@example
-(a + b)(a + b) = a^2 + 2ab + b^2
-@end example
-
-Thus, the @code{@@math} command has no effect on the Info output.
-
-For complex mathematical expressions, you can also use @TeX{} directly
-(@pxref{Raw Formatter Commands}). When you use @TeX{} directly,
-remember to write the mathematical expression between one or two
-@samp{$} (dollar-signs) as appropriate.
-
-
-@node Glyphs, Images, math, Insertions
-@section Glyphs for Examples
-@cindex Glyphs
-
-In Texinfo, code is often illustrated in examples that are delimited
-by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
-@code{@@end lisp}. In such examples, you can indicate the results of
-evaluation or an expansion using @samp{@result{}} or
-@samp{@expansion{}}. Likewise, there are commands to insert glyphs
-to indicate
-printed output, error messages, equivalence of expressions, and the
-location of point.@refill
-
-The glyph-insertion commands do not need to be used within an example, but
-most often they are. Every glyph-insertion command is followed by a pair of
-left- and right-hand braces.@refill
-
-@menu
-* Glyphs Summary::
-* result:: How to show the result of expression.
-* expansion:: How to indicate an expansion.
-* Print Glyph:: How to indicate printed output.
-* Error Glyph:: How to indicate an error message.
-* Equivalence:: How to indicate equivalence.
-* Point Glyph:: How to indicate the location of point.
-@end menu
-
-@node Glyphs Summary, result, Glyphs, Glyphs
-@ifinfo
-@subheading Glyphs Summary
-
-Here are the different glyph commands:@refill
-@end ifinfo
-
-@table @asis
-@item @result{}
-@code{@@result@{@}} points to the result of an expression.@refill
-
-@item @expansion{}
-@code{@@expansion@{@}} shows the results of a macro expansion.@refill
-
-@item @print{}
-@code{@@print@{@}} indicates printed output.@refill
-
-@item @error{}
-@code{@@error@{@}} indicates that the following text is an error
-message.@refill
-
-@item @equiv{}
-@code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill
-
-@item @point{}
-@code{@@point@{@}} shows the location of point.@refill
-@end table
-
-
-@menu
-* result::
-* expansion::
-* Print Glyph::
-* Error Glyph::
-* Equivalence::
-* Point Glyph::
-@end menu
-
-@node result, expansion, Glyphs Summary, Glyphs
-@subsection @code{@@result@{@}} (@result{}): Indicating Evaluation
-@cindex Result of an expression
-@cindex Indicating evaluation
-@cindex Evaluation glyph
-@cindex Value of an expression, indicating
-
-Use the @code{@@result@{@}} command to indicate the result of
-evaluating an expression.@refill
-
-@iftex
-The @code{@@result@{@}} command is displayed as @samp{=>} in Info and
-as @samp{@result{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info
-and as a double stemmed arrow in the printed output.@refill
-@end ifinfo
-
-Thus, the following,
-
-@lisp
-(cdr '(1 2 3))
- @result{} (2 3)
-@end lisp
-
-@noindent
-may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
-
-
-@node expansion, Print Glyph, result, Glyphs
-@subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion
-@cindex Expansion, indicating it
-
-When an expression is a macro call, it expands into a new expression.
-You can indicate the result of the expansion with the
-@code{@@expansion@{@}} command.@refill
-
-@iftex
-The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and
-as @samp{@expansion{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
-in Info and as a long arrow with a flat base in the printed output.@refill
-@end ifinfo
-
-@need 700
-For example, the following
-
-@example
-@group
-@@lisp
-(third '(a b c))
- @@expansion@{@} (car (cdr (cdr '(a b c))))
- @@result@{@} c
-@@end lisp
-@end group
-@end example
-
-@noindent
-produces
-
-@lisp
-@group
-(third '(a b c))
- @expansion{} (car (cdr (cdr '(a b c))))
- @result{} c
-@end group
-@end lisp
-
-@noindent
-which may be read as:
-
-@quotation
-@code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
-the result of evaluating the expression is @code{c}.
-@end quotation
-
-@noindent
-Often, as in this case, an example looks better if the
-@code{@@expansion@{@}} and @code{@@result@{@}} commands are indented
-five spaces.@refill
-
-
-@node Print Glyph, Error Glyph, expansion, Glyphs
-@subsection @code{@@print@{@}} (@print{}): Indicating Printed Output
-@cindex Printed output, indicating it
-
-Sometimes an expression will print output during its execution. You
-can indicate the printed output with the @code{@@print@{@}} command.@refill
-
-@iftex
-The @code{@@print@{@}} command is displayed as @samp{-|} in Info and
-as @samp{@print{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info
-and similarly, as a horizontal dash butting against a vertical bar, in
-the printed output.@refill
-@end ifinfo
-
-In the following example, the printed text is indicated with
-@samp{@print{}}, and the value of the expression follows on the
-last line.@refill
-
-@lisp
-@group
-(progn (print 'foo) (print 'bar))
- @print{} foo
- @print{} bar
- @result{} bar
-@end group
-@end lisp
-
-@noindent
-In a Texinfo source file, this example is written as follows:
-
-@lisp
-@group
-@@lisp
-(progn (print 'foo) (print 'bar))
- @@print@{@} foo
- @@print@{@} bar
- @@result@{@} bar
-@@end lisp
-@end group
-@end lisp
-
-
-@node Error Glyph, Equivalence, Print Glyph, Glyphs
-@subsection @code{@@error@{@}} (@error{}): Indicating an Error Message
-@cindex Error message, indicating it
-
-A piece of code may cause an error when you evaluate it. You can
-designate the error message with the @code{@@error@{@}} command.@refill
-
-@iftex
-The @code{@@error@{@}} command is displayed as @samp{error-->} in Info
-and as @samp{@error{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info
-and as the word `error' in a box in the printed output.@refill
-@end ifinfo
-
-@need 700
-Thus,
-
-@example
-@@lisp
-(+ 23 'x)
-@@error@{@} Wrong type argument: integer-or-marker-p, x
-@@end lisp
-@end example
-
-@noindent
-produces
-
-@lisp
-(+ 23 'x)
-@error{} Wrong type argument: integer-or-marker-p, x
-@end lisp
-
-@noindent
-This indicates that the following error message is printed
-when you evaluate the expression:
-
-@lisp
-Wrong type argument: integer-or-marker-p, x
-@end lisp
-
-@samp{@error{}} itself is not part of the error message.
-
-
-@node Equivalence, Point Glyph, Error Glyph, Glyphs
-@subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence
-@cindex Equivalence, indicating it
-
-Sometimes two expressions produce identical results. You can indicate the
-exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
-
-@iftex
-The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and
-as @samp{@equiv{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info
-and as a three parallel horizontal lines in the printed output.@refill
-@end ifinfo
-
-Thus,
-
-@example
-@@lisp
-(make-sparse-keymap) @@equiv@{@} (list 'keymap)
-@@end lisp
-@end example
-
-@noindent
-produces
-
-@lisp
-(make-sparse-keymap) @equiv{} (list 'keymap)
-@end lisp
-
-@noindent
-This indicates that evaluating @code{(make-sparse-keymap)} produces
-identical results to evaluating @code{(list 'keymap)}.
-
-
-@node Point Glyph, , Equivalence, Glyphs
-@subsection @code{@@point@{@}} (@point{}): Indicating Point in a Buffer
-@cindex Point, indicating it in a buffer
-
-Sometimes you need to show an example of text in an Emacs buffer. In
-such examples, the convention is to include the entire contents of the
-buffer in question between two lines of dashes containing the buffer
-name.@refill
-
-You can use the @samp{@@point@{@}} command to show the location of point
-in the text in the buffer. (The symbol for point, of course, is not
-part of the text in the buffer; it indicates the place @emph{between}
-two characters where point is located.)@refill
-
-@iftex
-The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and
-as @samp{@point{}} in the printed output.
-@end iftex
-@ifinfo
-The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info
-and as a small five pointed star in the printed output.@refill
-@end ifinfo
-
-The following example shows the contents of buffer @file{foo} before
-and after evaluating a Lisp command to insert the word @code{changed}.@refill
-
-@example
-@group
----------- Buffer: foo ----------
-This is the @point{}contents of foo.
----------- Buffer: foo ----------
-
-@end group
-@end example
-
-@example
-@group
-(insert "changed ")
- @result{} nil
----------- Buffer: foo ----------
-This is the changed @point{}contents of foo.
----------- Buffer: foo ----------
-
-@end group
-@end example
-
-In a Texinfo source file, the example is written like this:@refill
-
-@example
-@@example
----------- Buffer: foo ----------
-This is the @@point@{@}contents of foo.
----------- Buffer: foo ----------
-
-(insert "changed ")
- @@result@{@} nil
----------- Buffer: foo ----------
-This is the changed @@point@{@}contents of foo.
----------- Buffer: foo ----------
-@@end example
-@end example
-
-
-@c this should be described with figures when we have them
-@c perhaps in the quotation/example chapter.
-@node Images, , Glyphs, Insertions
-@section Inserting Images
-
-@cindex Images, inserting
-@cindex Pictures, inserting
-@findex image
-
-You can insert an image in an external file with the @code{@@image}
-command:
-
-@example
-@@image@{@var{filename}, @r{[}@var{width}@r{]}, @r{[}@var{height}@r{]}@}
-@end example
-
-@cindex Formats for images
-@cindex Image formats
-The @var{filename} argument is mandatory, and must not have an
-extension, because the different processors support different formats:
-@TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript
-format); @code{makeinfo} uses @file{@var{filename}.txt} verbatim for
-Info output (more or less as if it was an @code{@@example}). HTML
-output requires @file{@var{filename}.jpg}.
-
-@cindex Width of images
-@cindex Height of images
-@cindex Aspect ratio of images
-@cindex Distorting images
-The optional @var{width} and @var{height} arguments specify the size to
-scale the image to (they are ignored for Info output). If they are both
-specified, the image is presented in its natural size (given in the
-file); if only one is specified, the other is scaled proportionately;
-and if both are specified, both are respected, thus possibly distorting
-the original image by changing its aspect ratio.
-
-@cindex Dimensions and image sizes
-The @var{width} and @var{height} may be specified using any valid @TeX{}
-dimension, namely:
-
-@table @asis
-@item pt
-@cindex Points (dimension)
-point (72.27pt = 1in)
-@item pc
-@cindex Picas
-pica (1pc = 12pt)
-@item bp
-@cindex Big points
-big point (72bp = 1in)
-@item in
-@cindex Inches
-inch
-@item cm
-@cindex Centimeters
-centimeter (2.54cm = 1in)
-@item mm
-@cindex Millimeters
-millimeter (10mm = 1cm)
-@item dd
-@cindex Did@^ot points
-did@^ot point (1157dd = 1238pt)
-@item cc
-@cindex Ciceros
-cicero (1cc = 12dd)
-@item sp
-@cindex Scaled points
-scaled point (65536sp = 1pt)
-@end table
-
-@pindex ridt.eps
-For example, the following will scale a file @file{ridt.eps} to one
-inch vertically, with the width scaled proportionately:
-
-@example
-@@image@{ridt,,1in@}
-@end example
-
-@pindex epsf.tex
-For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be
-installed somewhere that @TeX{} can find it. This file is included in
-the Texinfo distribution and is available from
-@uref{ftp://ftp.tug.org/tex/epsf.tex}.
-
-
-@node Breaks, Definition Commands, Insertions, Top
-@chapter Making and Preventing Breaks
-@cindex Making line and page breaks
-@cindex Preventing line and page breaks
-
-Usually, a Texinfo file is processed both by @TeX{} and by one of the
-Info formatting commands. Line, paragraph, or page breaks sometimes
-occur in the `wrong' place in one or other form of output. You must
-ensure that text looks right both in the printed manual and in the
-Info file.@refill
-
-For example, in a printed manual, page breaks may occur awkwardly in
-the middle of an example; to prevent this, you can hold text together
-using a grouping command that keeps the text from being split across
-two pages. Conversely, you may want to force a page break where none
-would occur normally. Fortunately, problems like these do not often
-arise. When they do, use the break, break prevention, or pagination
-commands.@refill
-
-@menu
-* Break Commands:: Cause and prevent splits.
-* Line Breaks:: How to force a single line to use two lines.
-* - and hyphenation:: How to tell TeX about hyphenation points.
-* w:: How to prevent unwanted line breaks.
-* sp:: How to insert blank lines.
-* page:: How to force the start of a new page.
-* group:: How to prevent unwanted page breaks.
-* need:: Another way to prevent unwanted page breaks.
-@end menu
-
-@ifinfo
-@node Break Commands, Line Breaks, Breaks, Breaks
-@heading The Break Commands
-@end ifinfo
-@iftex
-@sp 1
-@end iftex
-
-The break commands create or allow line and paragraph breaks:@refill
-
-@table @code
-@item @@*
-Force a line break.
-
-@item @@sp @var{n}
-Skip @var{n} blank lines.@refill
-
-@item @@-
-Insert a discretionary hyphen.
-
-@item @@hyphenation@{@var{hy-phen-a-ted words}@}
-Define hyphen points in @var{hy-phen-a-ted words}.
-@end table
-
-The line-break-prevention command holds text together all on one
-line:@refill
-
-@table @code
-@item @@w@{@var{text}@}
-Prevent @var{text} from being split and hyphenated across two lines.@refill
-@end table
-@iftex
-@sp 1
-@end iftex
-
-The pagination commands apply only to printed output, since Info
-files do not have pages.@refill
-
-@table @code
-@item @@page
-Start a new page in the printed manual.@refill
-
-@item @@group
-Hold text together that must appear on one printed page.@refill
-
-@item @@need @var{mils}
-Start a new printed page if not enough space on this one.@refill
-@end table
-
-@node Line Breaks, - and hyphenation, Break Commands, Breaks
-@comment node-name, next, previous, up
-@section @code{@@*}: Generate Line Breaks
-@findex * @r{(force line break)}
-@cindex Line breaks
-@cindex Breaks in a line
-
-The @code{@@*} command forces a line break in both the printed manual and
-in Info.@refill
-
-@need 700
-For example,
-
-@example
-This line @@* is broken @@*in two places.
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This line
- is broken
-in two places.
-@end group
-@end example
-
-@noindent
-(Note that the space after the first @code{@@*} command is faithfully
-carried down to the next line.)@refill
-
-@need 800
-The @code{@@*} command is often used in a file's copyright page:@refill
-
-@example
-@group
-This is edition 2.0 of the Texinfo documentation,@@*
-and is for @dots{}
-@end group
-@end example
-
-@noindent
-In this case, the @code{@@*} command keeps @TeX{} from stretching the
-line across the whole page in an ugly manner.@refill
-
-@quotation
-@strong{Please note:} Do not write braces after an @code{@@*} command;
-they are not needed.@refill
-
-Do not write an @code{@@refill} command at the end of a paragraph
-containing an @code{@@*} command; it will cause the paragraph to be
-refilled after the line break occurs, negating the effect of the line
-break.@refill
-@end quotation
-
-@node - and hyphenation, w, Line Breaks, Breaks
-@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} hyphenate
-
-@findex -
-@findex hyphenation
-@cindex Hyphenation, helping @TeX{} do
-@cindex Fine-tuning, and hyphenation
-
-Although @TeX{}'s hyphenation algorithm is generally pretty good, it
-does miss useful hyphenation points from time to time. (Or, far more
-rarely, insert an incorrect hyphenation.) So, for documents with an
-unusual vocabulary or when fine-tuning for a printed edition, you may
-wish to help @TeX{} out. Texinfo supports two commands for this:
-
-@table @code
-@item @@-
-Insert a discretionary hyphen, i.e., a place where @TeX{} can (but does
-not have to) hyphenate. This is especially useful when you notice
-an overfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull
-hboxes}). @TeX{} will not insert any hyphenation points in a word
-containing @code{@@-}.
-
-@item @@hyphenation@{@var{hy-phen-a-ted words}@}
-Tell @TeX{} how to hyphenate @var{hy-phen-a-ted words}. As shown, you
-put a @samp{-} at each hyphenation point. For example:
-@example
-@@hyphenation@{man-u-script man-u-scripts@}
-@end example
-@noindent @TeX{} only uses the specified hyphenation points when the
-words match exactly, so give all necessary variants.
-@end table
-
-Info output is not hyphenated, so these commands have no effect there.
-
-@node w, sp, - and hyphenation, Breaks
-@comment node-name, next, previous, up
-@section @code{@@w}@{@var{text}@}: Prevent Line Breaks
-@findex w @r{(prevent line break)}
-@cindex Line breaks, preventing
-@cindex Hyphenation, preventing
-
-@code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks
-within @var{text}.@refill
-
-You can use the @code{@@w} command to prevent @TeX{} from automatically
-hyphenating a long name or phrase that happens to fall near the end of a
-line.@refill
-
-@example
-You can copy GNU software from @@w@{@@samp@{ftp.gnu.ai.mit.edu@}@}.
-@end example
-
-@noindent
-produces
-
-@quotation
-You can copy GNU software from @w{@samp{ftp.gnu.ai.mit.edu}}.
-@end quotation
-
-@quotation
-@strong{Caution:} Do not write an @code{@@refill} command at the end
-of a paragraph containing an @code{@@w} command; it will cause the
-paragraph to be refilled and may thereby negate the effect of the
-@code{@@w} command.@refill
-@end quotation
-
-@node sp, page, w, Breaks
-@comment node-name, next, previous, up
-@section @code{@@sp} @var{n}: Insert Blank Lines
-@findex sp @r{(line spacing)}
-@cindex Spaces (blank lines)
-@cindex Blank lines
-@cindex Line spacing
-
-A line beginning with and containing only @code{@@sp @var{n}}
-generates @var{n} blank lines of space in both the printed manual and
-the Info file. @code{@@sp} also forces a paragraph break. For
-example,@refill
-
-@example
-@@sp 2
-@end example
-
-@noindent
-generates two blank lines.
-
-The @code{@@sp} command is most often used in the title page.@refill
-
-@ignore
-@c node br, page, sp, Breaks
-@comment node-name, next, previous, up
-@c section @code{@@br}: Generate Paragraph Breaks
-@findex br @r{(paragraph breaks)}
-@cindex Paragraph breaks
-@cindex Breaks in a paragraph
-
-The @code{@@br} command forces a paragraph break. It inserts a blank
-line. You can use the command within or at the end of a line. If
-used within a line, the @code{@@br@{@}} command must be followed by
-left and right braces (as shown here) to mark the end of the
-command.@refill
-
-@need 700
-For example,
-
-@example
-@group
-This line @@br@{@}contains and is ended by paragraph breaks@@br
-and is followed by another line.
-@end group
-@end example
-
-@noindent
-produces
-
-@example
-@group
-This line
-
-contains and is ended by paragraph breaks
-
-and is followed by another line.
-@end group
-@end example
-
-The @code{@@br} command is seldom used.
-@end ignore
-
-@node page, group, sp, Breaks
-@comment node-name, next, previous, up
-@section @code{@@page}: Start a New Page
-@cindex Page breaks
-@findex page
-
-A line containing only @code{@@page} starts a new page in a printed
-manual. The command has no effect on Info files since they are not
-paginated. An @code{@@page} command is often used in the @code{@@titlepage}
-section of a Texinfo file to start the copyright page.@refill
-
-@node group, need, page, Breaks
-@comment node-name, next, previous, up
-@section @code{@@group}: Prevent Page Breaks
-@cindex Group (hold text together vertically)
-@cindex Holding text together vertically
-@cindex Vertically holding text together
-@findex group
-
-The @code{@@group} command (on a line by itself) is used inside an
-@code{@@example} or similar construct to begin an unsplittable vertical
-group, which will appear entirely on one page in the printed output.
-The group is terminated by a line containing only @code{@@end group}.
-These two lines produce no output of their own, and in the Info file
-output they have no effect at all.@refill
-
-@c Once said that these environments
-@c turn off vertical spacing between ``paragraphs''.
-@c Also, quotation used to work, but doesn't in texinfo-2.72
-Although @code{@@group} would make sense conceptually in a wide
-variety of contexts, its current implementation works reliably only
-within @code{@@example} and variants, and within @code{@@display},
-@code{@@format}, @code{@@flushleft} and @code{@@flushright}.
-@xref{Quotations and Examples}. (What all these commands have in
-common is that each line of input produces a line of output.) In
-other contexts, @code{@@group} can cause anomalous vertical
-spacing.@refill
-
-@need 750
-This formatting requirement means that you should write:
-
-@example
-@group
-@@example
-@@group
-@dots{}
-@@end group
-@@end example
-@end group
-@end example
-
-@noindent
-with the @code{@@group} and @code{@@end group} commands inside the
-@code{@@example} and @code{@@end example} commands.
-
-The @code{@@group} command is most often used to hold an example
-together on one page. In this Texinfo manual, more than 100 examples
-contain text that is enclosed between @code{@@group} and @code{@@end
-group}.
-
-If you forget to end a group, you may get strange and unfathomable
-error messages when you run @TeX{}. This is because @TeX{} keeps
-trying to put the rest of the Texinfo file onto the one page and does
-not start to generate error messages until it has processed
-considerable text. It is a good rule of thumb to look for a missing
-@code{@@end group} if you get incomprehensible error messages in
-@TeX{}.@refill
-
-@node need, , group, Breaks
-@comment node-name, next, previous, up
-@section @code{@@need @var{mils}}: Prevent Page Breaks
-@cindex Need space at page bottom
-@findex need
-
-A line containing only @code{@@need @var{n}} starts
-a new page in a printed manual if fewer than @var{n} mils (thousandths
-of an inch) remain on the current page. Do not use
-braces around the argument @var{n}. The @code{@@need} command has no
-effect on Info files since they are not paginated.@refill
-
-@need 800
-This paragraph is preceded by an @code{@@need} command that tells
-@TeX{} to start a new page if fewer than 800 mils (eight-tenths
-inch) remain on the page. It looks like this:@refill
-
-@example
-@group
-@@need 800
-This paragraph is preceded by @dots{}
-@end group
-@end example
-
-The @code{@@need} command is useful for preventing orphans (single
-lines at the bottoms of printed pages).@refill
-
-@node Definition Commands, Footnotes, Breaks, Top
-@chapter Definition Commands
-@cindex Definition commands
-
-The @code{@@deffn} command and the other @dfn{definition commands}
-enable you to describe functions, variables, macros, commands, user
-options, special forms and other such artifacts in a uniform
-format.@refill
-
-In the Info file, a definition causes the entity
-category---`Function', `Variable', or whatever---to appear at the
-beginning of the first line of the definition, followed by the
-entity's name and arguments. In the printed manual, the command
-causes @TeX{} to print the entity's name and its arguments on the left
-margin and print the category next to the right margin. In both
-output formats, the body of the definition is indented. Also, the
-name of the entity is entered into the appropriate index:
-@code{@@deffn} enters the name into the index of functions,
-@code{@@defvr} enters it into the index of variables, and so
-on.@refill
-
-A manual need not and should not contain more than one definition for
-a given name. An appendix containing a summary should use
-@code{@@table} rather than the definition commands.@refill
-
-@menu
-* Def Cmd Template:: How to structure a description using a
- definition command.
-* Optional Arguments:: How to handle optional and repeated arguments.
-* deffnx:: How to group two or more `first' lines.
-* Def Cmds in Detail:: All the definition commands.
-* Def Cmd Conventions:: Conventions for writing definitions.
-* Sample Function Definition::
-@end menu
-
-@node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands
-@section The Template for a Definition
-@cindex Definition template
-@cindex Template for a definition
-
-The @code{@@deffn} command is used for definitions of entities that
-resemble functions. To write a definition using the @code{@@deffn}
-command, write the @code{@@deffn} command at the beginning of a line
-and follow it on the same line by the category of the entity, the name
-of the entity itself, and its arguments (if any). Then write the body
-of the definition on succeeding lines. (You may embed examples in the
-body.) Finally, end the definition with an @code{@@end deffn} command
-written on a line of its own. (The other definition commands follow
-the same format.)@refill
-
-The template for a definition looks like this:
-
-@example
-@group
-@@deffn @var{category} @var{name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end deffn
-@end group
-@end example
-
-@need 700
-@noindent
-For example,
-
-@example
-@group
-@@deffn Command forward-word count
-This command moves point forward @@var@{count@} words
-(or backward if @@var@{count@} is negative). @dots{}
-@@end deffn
-@end group
-@end example
-
-@noindent
-produces
-
-@quotation
-@deffn Command forward-word count
-This function moves point forward @var{count} words
-(or backward if @var{count} is negative). @dots{}
-@end deffn
-@end quotation
-
-Capitalize the category name like a title. If the name of the
-category contains spaces, as in the phrase `Interactive Command',
-write braces around it. For example:@refill
-
-@example
-@group
-@@deffn @{Interactive Command@} isearch-forward
-@dots{}
-@@end deffn
-@end group
-@end example
-
-@noindent
-Otherwise, the second word will be mistaken for the name of the
-entity.@refill
-
-Some of the definition commands are more general than others. The
-@code{@@deffn} command, for example, is the general definition command
-for functions and the like---for entities that may take arguments. When
-you use this command, you specify the category to which the entity
-belongs. The @code{@@deffn} command possesses three predefined,
-specialized variations, @code{@@defun}, @code{@@defmac}, and
-@code{@@defspec}, that specify the category for you: ``Function'',
-``Macro'', and ``Special Form'' respectively. (In Lisp, a special form
-is an entity much like a function.) The @code{@@defvr} command also is
-accompanied by several predefined, specialized variations for describing
-particular kinds of variables.@refill
-
-The template for a specialized definition, such as @code{@@defun}, is
-similar to the template for a generalized definition, except that you
-do not need to specify the category:@refill
-
-@example
-@group
-@@defun @var{name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end defun
-@end group
-@end example
-
-@noindent
-Thus,
-
-@example
-@group
-@@defun buffer-end flag
-This function returns @@code@{(point-min)@} if @@var@{flag@}
-is less than 1, @@code@{(point-max)@} otherwise.
-@dots{}
-@@end defun
-@end group
-@end example
-
-@noindent
-produces
-
-@quotation
-@defun buffer-end flag
-This function returns @code{(point-min)} if @var{flag} is less than 1,
-@code{(point-max)} otherwise. @dots{}
-@end defun
-@end quotation
-
-@noindent
-@xref{Sample Function Definition, Sample Function Definition, A Sample
-Function Definition}, for a more detailed example of a function
-definition, including the use of @code{@@example} inside the
-definition.@refill
-
-The other specialized commands work like @code{@@defun}.@refill
-
-@node Optional Arguments, deffnx, Def Cmd Template, Definition Commands
-@section Optional and Repeated Arguments
-@cindex Optional and repeated arguments
-@cindex Repeated and optional arguments
-@cindex Arguments, repeated and optional
-@cindex Syntax, optional & repeated arguments
-@cindex Meta-syntactic chars for arguments
-
-Some entities take optional or repeated arguments, which may be
-specified by a distinctive glyph that uses square brackets and
-ellipses. For @w{example}, a special form often breaks its argument list
-into separate arguments in more complicated ways than a
-straightforward function.@refill
-
-@iftex
-An argument enclosed within square brackets is optional.
-Thus, the phrase
-@samp{@code{@r{[}@var{optional-arg}@r{]}}} means that
-@var{optional-arg} is optional.
-An argument followed by an ellipsis is optional
-and may be repeated more than once.
-@c This is consistent with Emacs Lisp Reference manual
-Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments.
-Parentheses are used when several arguments are grouped
-into additional levels of list structure in Lisp.
-@end iftex
-@c The following looks better in Info (no `r', `samp' and `code'):
-@ifinfo
-An argument enclosed within square brackets is optional.
-Thus, [@var{optional-arg}] means that @var{optional-arg} is optional.
-An argument followed by an ellipsis is optional
-and may be repeated more than once.
-@c This is consistent with Emacs Lisp Reference manual
-Thus, @var{repeated-args}@dots{} stands for zero or more arguments.
-Parentheses are used when several arguments are grouped
-into additional levels of list structure in Lisp.
-@end ifinfo
-
-Here is the @code{@@defspec} line of an example of an imaginary
-special form:@refill
-
-@quotation
-@defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
-@end defspec
-@tex
-\vskip \parskip
-@end tex
-@end quotation
-
-@noindent
-In this example, the arguments @var{from} and @var{to} are optional,
-but must both be present or both absent. If they are present,
-@var{inc} may optionally be specified as well. These arguments are
-grouped with the argument @var{var} into a list, to distinguish them
-from @var{body}, which includes all remaining elements of the
-form.@refill
-
-In a Texinfo source file, this @code{@@defspec} line is written like
-this (except it would not be split over two lines, as it is in this
-example).@refill
-
-@example
-@group
-@@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@}
- [@@var@{inc@}]]) @@var@{body@}@@dots@{@}
-@end group
-@end example
-
-@noindent
-The function is listed in the Command and Variable Index under
-@samp{foobar}.@refill
-
-@node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands
-@section Two or More `First' Lines
-@cindex Two `First' Lines for @code{@@deffn}
-@cindex Grouping two definitions together
-@cindex Definitions grouped together
-@findex deffnx
-
-To create two or more `first' or header lines for a definition, follow
-the first @code{@@deffn} line by a line beginning with @code{@@deffnx}.
-The @code{@@deffnx} command works exactly like @code{@@deffn}
-except that it does not generate extra vertical white space between it
-and the preceding line.@refill
-
-@need 1000
-For example,
-
-@example
-@group
-@@deffn @{Interactive Command@} isearch-forward
-@@deffnx @{Interactive Command@} isearch-backward
-These two search commands are similar except @dots{}
-@@end deffn
-@end group
-@end example
-
-@noindent
-produces
-
-@deffn {Interactive Command} isearch-forward
-@deffnx {Interactive Command} isearch-backward
-These two search commands are similar except @dots{}
-@end deffn
-
-Each of the other definition commands has an `x' form: @code{@@defunx},
-@code{@@defvrx}, @code{@@deftypefunx}, etc.
-
-The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}.
-
-@node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands
-@section The Definition Commands
-
-Texinfo provides more than a dozen definition commands, all of which
-are described in this section.@refill
-
-The definition commands automatically enter the name of the entity in
-the appropriate index: for example, @code{@@deffn}, @code{@@defun},
-and @code{@@defmac} enter function names in the index of functions;
-@code{@@defvr} and @code{@@defvar} enter variable names in the index
-of variables.@refill
-
-Although the examples that follow mostly illustrate Lisp, the commands
-can be used for other programming languages.@refill
-
-@menu
-* Functions Commands:: Commands for functions and similar entities.
-* Variables Commands:: Commands for variables and similar entities.
-* Typed Functions:: Commands for functions in typed languages.
-* Typed Variables:: Commands for variables in typed languages.
-* Abstract Objects:: Commands for object-oriented programming.
-* Data Types:: The definition command for data types.
-@end menu
-
-@node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail
-@subsection Functions and Similar Entities
-
-This section describes the commands for describing functions and similar
-entities:@refill
-
-@table @code
-@findex deffn
-@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
-The @code{@@deffn} command is the general definition command for
-functions, interactive commands, and similar entities that may take
-arguments. You must choose a term to describe the category of entity
-being defined; for example, ``Function'' could be used if the entity is
-a function. The @code{@@deffn} command is written at the beginning of a
-line and is followed on the same line by the category of entity being
-described, the name of this particular entity, and its arguments, if
-any. Terminate the definition with @code{@@end deffn} on a line of its
-own.@refill
-
-@need 750
-For example, here is a definition:
-
-@example
-@group
-@@deffn Command forward-char nchars
-Move point forward @@var@{nchars@} characters.
-@@end deffn
-@end group
-@end example
-
-@noindent
-This shows a rather terse definition for a ``command'' named
-@code{forward-char} with one argument, @var{nchars}.
-
-@code{@@deffn} prints argument names such as @var{nchars} in italics or
-upper case, as if @code{@@var} had been used, because we think of these
-names as metasyntactic variables---they stand for the actual argument
-values. Within the text of the description, write an argument name
-explicitly with @code{@@var} to refer to the value of the argument. In
-the example above, we used @samp{@@var@{nchars@}} in this way.
-
-The template for @code{@@deffn} is:
-
-@example
-@group
-@@deffn @var{category} @var{name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end deffn
-@end group
-@end example
-
-@findex defun
-@item @@defun @var{name} @var{arguments}@dots{}
-The @code{@@defun} command is the definition command for functions.
-@code{@@defun} is equivalent to @samp{@@deffn Function
-@dots{}}.@refill
-
-@need 800
-@noindent
-For example,
-
-@example
-@group
-@@defun set symbol new-value
-Change the value of the symbol @@var@{symbol@}
-to @@var@{new-value@}.
-@@end defun
-@end group
-@end example
-
-@noindent
-shows a rather terse definition for a function @code{set} whose
-arguments are @var{symbol} and @var{new-value}. The argument names on
-the @code{@@defun} line automatically appear in italics or upper case as
-if they were enclosed in @code{@@var}. Terminate the definition with
-@code{@@end defun} on a line of its own.@refill
-
-The template is:
-
-@example
-@group
-@@defun @var{function-name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end defun
-@end group
-@end example
-
-@code{@@defun} creates an entry in the index of functions.
-
-@findex defmac
-@item @@defmac @var{name} @var{arguments}@dots{}
-The @code{@@defmac} command is the definition command for macros.
-@code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
-works like @code{@@defun}.@refill
-
-@findex defspec
-@item @@defspec @var{name} @var{arguments}@dots{}
-The @code{@@defspec} command is the definition command for special
-forms. (In Lisp, a special form is an entity much like a function,
-@pxref{Special Forms,,, elisp, GNU Emacs Lisp Reference Manual}.)
-@code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
-@dots{}} and works like @code{@@defun}.@refill
-@end table
-
-@node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail
-@subsection Variables and Similar Entities
-
-Here are the commands for defining variables and similar
-entities:@refill
-
-@table @code
-@findex defvr
-@item @@defvr @var{category} @var{name}
-The @code{@@defvr} command is a general definition command for
-something like a variable---an entity that records a value. You must
-choose a term to describe the category of entity being defined; for
-example, ``Variable'' could be used if the entity is a variable.
-Write the @code{@@defvr} command at the beginning of a line and
-followed it on the same line by the category of the entity and the
-name of the entity.@refill
-
-Capitalize the category name like a title. If the name of the category
-contains spaces, as in the name ``User Option'', enclose it in braces.
-Otherwise, the second word will be mistaken for the name of the entity.
-For example,
-
-@example
-@group
-@@defvr @{User Option@} fill-column
-This buffer-local variable specifies
-the maximum width of filled lines.
-@dots{}
-@@end defvr
-@end group
-@end example
-
-Terminate the definition with @code{@@end defvr} on a line of its
-own.@refill
-
-The template is:
-
-@example
-@group
-@@defvr @var{category} @var{name}
-@var{body-of-definition}
-@@end defvr
-@end group
-@end example
-
-@code{@@defvr} creates an entry in the index of variables for @var{name}.
-
-@findex defvar
-@item @@defvar @var{name}
-The @code{@@defvar} command is the definition command for variables.
-@code{@@defvar} is equivalent to @samp{@@defvr Variable
-@dots{}}.@refill
-
-@need 750
-For example:
-
-@example
-@group
-@@defvar kill-ring
-@dots{}
-@@end defvar
-@end group
-@end example
-
-The template is:
-
-@example
-@group
-@@defvar @var{name}
-@var{body-of-definition}
-@@end defvar
-@end group
-@end example
-
-@code{@@defvar} creates an entry in the index of variables for
-@var{name}.@refill
-
-@findex defopt
-@item @@defopt @var{name}
-@cindex User options, marking
-The @code{@@defopt} command is the definition command for @dfn{user
-options}, i.e., variables intended for users to change according to
-taste; Emacs has many such (@pxref{Variables,,, emacs, The GNU Emacs
-Manual}). @code{@@defopt} is equivalent to @samp{@@defvr @{User
-Option@} @dots{}} and works like @code{@@defvar}.@refill
-@end table
-
-
-@node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail
-@subsection Functions in Typed Languages
-
-The @code{@@deftypefn} command and its variations are for describing
-functions in languages in which you must declare types of variables and
-functions, such as C and C++.
-
-@table @code
-@findex deftypefn
-@item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
-The @code{@@deftypefn} command is the general definition command for
-functions and similar entities that may take arguments and that are
-typed. The @code{@@deftypefn} command is written at the beginning of
-a line and is followed on the same line by the category of entity
-being described, the type of the returned value, the name of this
-particular entity, and its arguments, if any.@refill
-
-@need 800
-@noindent
-For example,
-
-@example
-@group
-@@deftypefn @{Library Function@} int foobar
- (int @@var@{foo@}, float @@var@{bar@})
-@dots{}
-@@end deftypefn
-@end group
-@end example
-
-@need 1000
-@noindent
-(where the text before the ``@dots{}'', shown above as two lines, would
-actually be a single line in a real Texinfo file) produces the following
-in Info:
-
-@smallexample
-@group
--- Library Function: int foobar (int FOO, float BAR)
-@dots{}
-@end group
-@end smallexample
-@iftex
-
-In a printed manual, it produces:
-
-@quotation
-@deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-@dots{}
-@end deftypefn
-@end quotation
-@end iftex
-
-This means that @code{foobar} is a ``library function'' that returns an
-@code{int}, and its arguments are @var{foo} (an @code{int}) and
-@var{bar} (a @code{float}).@refill
-
-The argument names that you write in @code{@@deftypefn} are not subject
-to an implicit @code{@@var}---since the actual names of the arguments in
-@code{@@deftypefn} are typically scattered among data type names and
-keywords, Texinfo cannot find them without help. Instead, you must write
-@code{@@var} explicitly around the argument names. In the example
-above, the argument names are @samp{foo} and @samp{bar}.@refill
-
-The template for @code{@@deftypefn} is:@refill
-
-@example
-@group
-@@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
-@var{body-of-description}
-@@end deftypefn
-@end group
-@end example
-
-@noindent
-Note that if the @var{category} or @var{data type} is more than one
-word then it must be enclosed in braces to make it a single argument.@refill
-
-If you are describing a procedure in a language that has packages,
-such as Ada, you might consider using @code{@@deftypefn} in a manner
-somewhat contrary to the convention described in the preceding
-paragraphs.@refill
-
-@need 800
-@noindent
-For example:
-
-@example
-@group
-@@deftypefn stacks private push
- (@@var@{s@}:in out stack;
- @@var@{n@}:in integer)
-@dots{}
-@@end deftypefn
-@end group
-@end example
-
-@noindent
-(The @code{@@deftypefn} arguments are shown split into three lines, but
-would be a single line in a real Texinfo file.)
-
-In this instance, the procedure is classified as belonging to the
-package @code{stacks} rather than classified as a `procedure' and its
-data type is described as @code{private}. (The name of the procedure
-is @code{push}, and its arguments are @var{s} and @var{n}.)@refill
-
-@code{@@deftypefn} creates an entry in the index of functions for
-@var{name}.@refill
-
-@item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
-@findex deftypefun
-The @code{@@deftypefun} command is the specialized definition command
-for functions in typed languages. The command is equivalent to
-@samp{@@deftypefn Function @dots{}}.@refill
-
-@need 800
-@noindent
-Thus,
-
-@smallexample
-@group
-@@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@})
-@dots{}
-@@end deftypefun
-@end group
-@end smallexample
-
-@noindent
-produces the following in Info:
-
-@example
-@group
--- Function: int foobar (int FOO, float BAR)
-@dots{}
-@end group
-@end example
-@iftex
-
-@need 800
-@noindent
-and the following in a printed manual:
-
-@quotation
-@deftypefun int foobar (int @var{foo}, float @var{bar})
-@dots{}
-@end deftypefun
-@end quotation
-@end iftex
-
-@need 800
-The template is:
-
-@example
-@group
-@@deftypefun @var{type} @var{name} @var{arguments}@dots{}
-@var{body-of-description}
-@@end deftypefun
-@end group
-@end example
-
-@code{@@deftypefun} creates an entry in the index of functions for
-@var{name}.@refill
-
-@end table
-
-
-@node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail
-@subsection Variables in Typed Languages
-
-Variables in typed languages are handled in a manner similar to
-functions in typed languages. @xref{Typed Functions}. The general
-definition command @code{@@deftypevr} corresponds to
-@code{@@deftypefn} and the specialized definition command
-@code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill
-
-@table @code
-@findex deftypevr
-@item @@deftypevr @var{category} @var{data-type} @var{name}
-The @code{@@deftypevr} command is the general definition command for
-something like a variable in a typed language---an entity that records
-a value. You must choose a term to describe the category of the
-entity being defined; for example, ``Variable'' could be used if the
-entity is a variable.@refill
-
-The @code{@@deftypevr} command is written at the beginning of a line
-and is followed on the same line by the category of the entity
-being described, the data type, and the name of this particular
-entity.@refill
-
-@need 800
-@noindent
-For example:
-
-@example
-@group
-@@deftypevr @{Global Flag@} int enable
-@dots{}
-@@end deftypevr
-@end group
-@end example
-
-@noindent
-produces the following in Info:
-
-@example
-@group
--- Global Flag: int enable
-@dots{}
-@end group
-@end example
-@iftex
-
-@noindent
-and the following in a printed manual:
-
-@quotation
-@deftypevr {Global Flag} int enable
-@dots{}
-@end deftypevr
-@end quotation
-@end iftex
-
-@need 800
-The template is:
-
-@example
-@@deftypevr @var{category} @var{data-type} @var{name}
-@var{body-of-description}
-@@end deftypevr
-@end example
-
-@code{@@deftypevr} creates an entry in the index of variables for
-@var{name}.@refill
-
-@findex deftypevar
-@item @@deftypevar @var{data-type} @var{name}
-The @code{@@deftypevar} command is the specialized definition command
-for variables in typed languages. @code{@@deftypevar} is equivalent
-to @samp{@@deftypevr Variable @dots{}}.@refill
-
-@need 800
-@noindent
-For example:
-
-@example
-@group
-@@deftypevar int fubar
-@dots{}
-@@end deftypevar
-@end group
-@end example
-
-@noindent
-produces the following in Info:
-
-@example
-@group
--- Variable: int fubar
-@dots{}
-@end group
-@end example
-@iftex
-
-@need 800
-@noindent
-and the following in a printed manual:
-
-@quotation
-@deftypevar int fubar
-@dots{}
-@end deftypevar
-@end quotation
-@end iftex
-
-@need 800
-@noindent
-The template is:
-
-@example
-@group
-@@deftypevar @var{data-type} @var{name}
-@var{body-of-description}
-@@end deftypevar
-@end group
-@end example
-
-@code{@@deftypevar} creates an entry in the index of variables for
-@var{name}.@refill
-@end table
-
-@node Abstract Objects, Data Types, Typed Variables, Def Cmds in Detail
-@subsection Object-Oriented Programming
-
-Here are the commands for formatting descriptions about abstract
-objects, such as are used in object-oriented programming. A class is
-a defined type of abstract object. An instance of a class is a
-particular object that has the type of the class. An instance
-variable is a variable that belongs to the class but for which each
-instance has its own value.@refill
-
-In a definition, if the name of a class is truly a name defined in the
-programming system for a class, then you should write an @code{@@code}
-around it. Otherwise, it is printed in the usual text font.@refill
-
-@table @code
-@findex defcv
-@item @@defcv @var{category} @var{class} @var{name}
-The @code{@@defcv} command is the general definition command for
-variables associated with classes in object-oriented programming. The
-@code{@@defcv} command is followed by three arguments: the category of
-thing being defined, the class to which it belongs, and its
-name. Thus,@refill
-
-@example
-@group
-@@defcv @{Class Option@} Window border-pattern
-@dots{}
-@@end defcv
-@end group
-@end example
-
-@noindent
-illustrates how you would write the first line of a definition of the
-@code{border-pattern} class option of the class @code{Window}.@refill
-
-The template is
-
-@example
-@group
-@@defcv @var{category} @var{class} @var{name}
-@dots{}
-@@end defcv
-@end group
-@end example
-
-@code{@@defcv} creates an entry in the index of variables.
-
-@findex defivar
-@item @@defivar @var{class} @var{name}
-The @code{@@defivar} command is the definition command for instance
-variables in object-oriented programming. @code{@@defivar} is
-equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill
-
-The template is:
-
-@example
-@group
-@@defivar @var{class} @var{instance-variable-name}
-@var{body-of-definition}
-@@end defivar
-@end group
-@end example
-
-@code{@@defivar} creates an entry in the index of variables.
-
-@findex defop
-@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
-The @code{@@defop} command is the general definition command for
-entities that may resemble methods in object-oriented programming.
-These entities take arguments, as functions do, but are associated
-with particular classes of objects.@refill
-
-For example, some systems have constructs called @dfn{wrappers} that
-are associated with classes as methods are, but that act more like
-macros than like functions. You could use @code{@@defop Wrapper} to
-describe one of these.@refill
-
-Sometimes it is useful to distinguish methods and @dfn{operations}.
-You can think of an operation as the specification for a method.
-Thus, a window system might specify that all window classes have a
-method named @code{expose}; we would say that this window system
-defines an @code{expose} operation on windows in general. Typically,
-the operation has a name and also specifies the pattern of arguments;
-all methods that implement the operation must accept the same
-arguments, since applications that use the operation do so without
-knowing which method will implement it.@refill
-
-Often it makes more sense to document operations than methods. For
-example, window application developers need to know about the
-@code{expose} operation, but need not be concerned with whether a
-given class of windows has its own method to implement this operation.
-To describe this operation, you would write:@refill
-
-@example
-@@defop Operation windows expose
-@end example
-
-The @code{@@defop} command is written at the beginning of a line and
-is followed on the same line by the overall name of the category of
-operation, the name of the class of the operation, the name of the
-operation, and its arguments, if any.@refill
-
-@need 800
-@noindent
-The template is:
-
-@example
-@group
-@@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end defop
-@end group
-@end example
-
-@code{@@defop} creates an entry, such as `@code{expose} on
-@code{windows}', in the index of functions.@refill
-
-@item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
-@findex defmethod
-The @code{@@defmethod} command is the definition command for methods
-in object-oriented programming. A method is a kind of function that
-implements an operation for a particular class of objects and its
-subclasses. In the Lisp Machine, methods actually were functions, but
-they were usually defined with @code{defmethod}.
-
-@code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
-The command is written at the beginning of a line and is followed by
-the name of the class of the method, the name of the method, and its
-arguments, if any.@refill
-
-@need 800
-@noindent
-For example,
-
-@example
-@group
-@@defmethod @code{bar-class} bar-method argument
-@dots{}
-@@end defmethod
-@end group
-@end example
-
-@noindent
-illustrates the definition for a method called @code{bar-method} of
-the class @code{bar-class}. The method takes an argument.@refill
-
-The template is:
-
-@example
-@group
-@@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
-@var{body-of-definition}
-@@end defmethod
-@end group
-@end example
-
-@code{@@defmethod} creates an entry, such as `@code{bar-method} on
-@code{bar-class}', in the index of functions.@refill
-
-@item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
-@findex defmethod
-The @code{@@deftypemethod} command is the definition command for methods
-in object-oriented typed languages, such as C++ and Java. It is similar
-to the @code{@@defmethod} command with the addition of the
-@var{data-type} parameter to specify the return type of the method.
-
-@end table
-
-
-@node Data Types, , Abstract Objects, Def Cmds in Detail
-@subsection Data Types
-
-Here is the command for data types:@refill
-
-@table @code
-@findex deftp
-@item @@deftp @var{category} @var{name} @var{attributes}@dots{}
-The @code{@@deftp} command is the generic definition command for data
-types. The command is written at the beginning of a line and is
-followed on the same line by the category, by the name of the type
-(which is a word like @code{int} or @code{float}), and then by names of
-attributes of objects of that type. Thus, you could use this command
-for describing @code{int} or @code{float}, in which case you could use
-@code{data type} as the category. (A data type is a category of
-certain objects for purposes of deciding which operations can be
-performed on them.)@refill
-
-In Lisp, for example, @dfn{pair} names a particular data
-type, and an object of that type has two slots called the
-@sc{car} and the @sc{cdr}. Here is how you would write the first line
-of a definition of @code{pair}.@refill
-
-@example
-@group
-@@deftp @{Data type@} pair car cdr
-@dots{}
-@@end deftp
-@end group
-@end example
-
-@need 950
-The template is:
-
-@example
-@group
-@@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
-@var{body-of-definition}
-@@end deftp
-@end group
-@end example
-
-@code{@@deftp} creates an entry in the index of data types.
-@end table
-
-@node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands
-@section Conventions for Writing Definitions
-@cindex Definition conventions
-@cindex Conventions for writing definitions
-
-When you write a definition using @code{@@deffn}, @code{@@defun}, or
-one of the other definition commands, please take care to use
-arguments that indicate the meaning, as with the @var{count} argument
-to the @code{forward-word} function. Also, if the name of an argument
-contains the name of a type, such as @var{integer}, take care that the
-argument actually is of that type.@refill
-
-@node Sample Function Definition, , Def Cmd Conventions, Definition Commands
-@section A Sample Function Definition
-@cindex Function definitions
-@cindex Command definitions
-@cindex Macro definitions
-@cindex Sample function definition
-
-A function definition uses the @code{@@defun} and @code{@@end defun}
-commands. The name of the function follows immediately after the
-@code{@@defun} command and it is followed, on the same line, by the
-parameter list.@refill
-
-Here is a definition from @ref{Calling Functions,,, elisp, The GNU Emacs
-Lisp Reference Manual}.
-
-@quotation
-@defun apply function &rest arguments
-@code{apply} calls @var{function} with @var{arguments}, just
-like @code{funcall} but with one difference: the last of
-@var{arguments} is a list of arguments to give to
-@var{function}, rather than a single argument. We also say
-that this list is @dfn{appended} to the other arguments.
-
-@code{apply} returns the result of calling @var{function}.
-As with @code{funcall}, @var{function} must either be a Lisp
-function or a primitive function; special forms and macros
-do not make sense in @code{apply}.
-
-@example
-(setq f 'list)
- @result{} list
-(apply f 'x 'y 'z)
-@error{} Wrong type argument: listp, z
-(apply '+ 1 2 '(3 4))
- @result{} 10
-(apply '+ '(1 2 3 4))
- @result{} 10
-
-(apply 'append '((a b c) nil (x y z) nil))
- @result{} (a b c x y z)
-@end example
-
-An interesting example of using @code{apply} is found in the description
-of @code{mapcar}.@refill
-@end defun
-@end quotation
-
-@need 1200
-In the Texinfo source file, this example looks like this:
-
-@example
-@group
-@@defun apply function &rest arguments
-
-@@code@{apply@} calls @@var@{function@} with
-@@var@{arguments@}, just like @@code@{funcall@} but with one
-difference: the last of @@var@{arguments@} is a list of
-arguments to give to @@var@{function@}, rather than a single
-argument. We also say that this list is @@dfn@{appended@}
-to the other arguments.
-@end group
-
-@group
-@@code@{apply@} returns the result of calling
-@@var@{function@}. As with @@code@{funcall@},
-@@var@{function@} must either be a Lisp function or a
-primitive function; special forms and macros do not make
-sense in @@code@{apply@}.
-@end group
-
-@group
-@@example
-(setq f 'list)
- @@result@{@} list
-(apply f 'x 'y 'z)
-@@error@{@} Wrong type argument: listp, z
-(apply '+ 1 2 '(3 4))
- @@result@{@} 10
-(apply '+ '(1 2 3 4))
- @@result@{@} 10
-
-(apply 'append '((a b c) nil (x y z) nil))
- @@result@{@} (a b c x y z)
-@@end example
-@end group
-
-@group
-An interesting example of using @@code@{apply@} is found
-in the description of @@code@{mapcar@}.@@refill
-@@end defun
-@end group
-@end example
-
-@noindent
-In this manual, this function is listed in the Command and Variable
-Index under @code{apply}.@refill
-
-Ordinary variables and user options are described using a format like
-that for functions except that variables do not take arguments.
-
-
-@node Footnotes, Conditionals, Definition Commands, Top
-@chapter Footnotes
-@cindex Footnotes
-@findex footnote
-
-A @dfn{footnote} is for a reference that documents or elucidates the
-primary text.@footnote{A footnote should complement or expand upon
-the primary text, but a reader should not need to read a footnote to
-understand the primary text. For a thorough discussion of footnotes,
-see @cite{The Chicago Manual of Style}, which is published by the
-University of Chicago Press.}@refill
-
-@menu
-* Footnote Commands:: How to write a footnote in Texinfo.
-* Footnote Styles:: Controlling how footnotes appear in Info.
-@end menu
-
-@node Footnote Commands, Footnote Styles, Footnotes, Footnotes
-@section Footnote Commands
-
-In Texinfo, footnotes are created with the @code{@@footnote} command.
-This command is followed immediately by a left brace, then by the text
-of the footnote, and then by a terminating right brace. Footnotes may
-be of any length (they will be broken across pages if necessary), but
-are usually short. The template is:
-
-@example
-ordinary text@@footnote@{@var{text of footnote}@}
-@end example
-
-As shown here, the @code{@@footnote} command should come right after the
-text being footnoted, with no intervening space; otherwise, the
-formatters the footnote mark might end up starting up a line.
-
-For example, this clause is followed by a sample
-footnote@footnote{Here is the sample footnote.}; in the Texinfo
-source, it looks like this:@refill
-
-@example
-@dots{}a sample footnote@@footnote@{Here is the sample
-footnote.@}; in the Texinfo source@dots{}
-@end example
-
-@strong{Warning:} Don't use footnotes in the argument of the
-@code{@@item} command for a @code{@@table} table. This doesn't work, and
-because of limitations of @TeX{}, there is no way to fix it. You must
-put the footnote into the body text of the table.
-
-In a printed manual or book, the reference mark for a footnote is a
-small, superscripted number; the text of the footnote appears at the
-bottom of the page, below a horizontal line.@refill
-
-In Info, the reference mark for a footnote is a pair of parentheses
-with the footnote number between them, like this: @samp{(1)}.@refill
-
-
-@node Footnote Styles, , Footnote Commands, Footnotes
-@section Footnote Styles
-
-Info has two footnote styles, which determine where the text of the
-footnote is located:@refill
-
-@itemize @bullet
-@cindex @samp{@r{End}} node footnote style
-@item
-In the `End' node style, all the footnotes for a single node
-are placed at the end of that node. The footnotes are separated from
-the rest of the node by a line of dashes with the word
-@samp{Footnotes} within it. Each footnote begins with an
-@samp{(@var{n})} reference mark.@refill
-
-@need 700
-@noindent
-Here is an example of a single footnote in the end of node style:@refill
-
-@example
-@group
- --------- Footnotes ---------
-
-(1) Here is a sample footnote.
-@end group
-@end example
-
-@cindex @samp{@r{Separate}} footnote style
-@item
-In the `Separate' node style, all the footnotes for a single
-node are placed in an automatically constructed node of
-their own. In this style, a ``footnote reference'' follows
-each @samp{(@var{n})} reference mark in the body of the
-node. The footnote reference is actually a cross reference
-which you use to reach the footnote node.@refill
-
-The name of the node containing the footnotes is constructed
-by appending @w{@samp{-Footnotes}} to the name of the node
-that contains the footnotes. (Consequently, the footnotes'
-node for the @file{Footnotes} node is
-@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
-`Up' node pointer that leads back to its parent node.@refill
-
-@noindent
-Here is how the first footnote in this manual looks after being
-formatted for Info in the separate node style:@refill
-
-@smallexample
-@group
-File: texinfo.info Node: Overview-Footnotes, Up: Overview
-
-(1) Note that the first syllable of "Texinfo" is
-pronounced like "speck", not "hex". @dots{}
-@end group
-@end smallexample
-@end itemize
-
-A Texinfo file may be formatted into an Info file with either footnote
-style.@refill
-
-@findex footnotestyle
-Use the @code{@@footnotestyle} command to specify an Info file's
-footnote style. Write this command at the beginning of a line followed
-by an argument, either @samp{end} for the end node style or
-@samp{separate} for the separate node style.
-
-@need 700
-For example,
-
-@example
-@@footnotestyle end
-@end example
-@noindent
-or
-@example
-@@footnotestyle separate
-@end example
-
-Write an @code{@@footnotestyle} command before or shortly after the
-end-of-header line at the beginning of a Texinfo file. (If you
-include the @code{@@footnotestyle} command between the start-of-header
-and end-of-header lines, the region formatting commands will format
-footnotes as specified.)@refill
-
-If you do not specify a footnote style, the formatting commands use
-their default style. Currently, @code{texinfo-format-buffer} and
-@code{texinfo-format-region} use the `separate' style and
-@code{makeinfo} uses the `end' style.@refill
-
-@c !!! note: makeinfo's --footnote-style option overrides footnotestyle
-@ignore
-If you use @code{makeinfo} to create the Info file, the
-@samp{--footnote-style} option determines which style is used,
-@samp{end} for the end of node style or @samp{separate} for the
-separate node style. Thus, to format the Texinfo manual in the
-separate node style, you would use the following shell command:@refill
-
-@example
-makeinfo --footnote-style=separate texinfo.texi
-@end example
-
-@noindent
-To format the Texinfo manual in the end of node style, you would
-type:@refill
-
-@example
-makeinfo --footnote-style=end texinfo.texi
-@end example
-@end ignore
-@ignore
-If you use @code{texinfo-format-buffer} or
-@code{texinfo-format-region} to create the Info file, the value of the
-@code{texinfo-footnote-style} variable controls the footnote style.
-It can be either @samp{"separate"} for the separate node style or
-@samp{"end"} for the end of node style. (You can change the value of
-this variable with the @kbd{M-x edit-options} command (@pxref{Edit
-Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
-with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
-and Setting Variables, emacs, The GNU Emacs Manual}).@refill
-
-The @code{texinfo-footnote-style} variable also controls the style if
-you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
-command in Emacs.@refill
-@end ignore
-This chapter contains two footnotes.@refill
-
-
-@node Conditionals, Macros, Footnotes, Top
-@comment node-name, next, previous, up
-@chapter Conditionally Visible Text
-@cindex Conditionally visible text
-@cindex Text, conditionally visible
-@cindex Visibility of conditional text
-@cindex If text conditionally visible
-
-Sometimes it is good to use different text for a printed manual and
-its corresponding Info file. In this case, you can use the
-@dfn{conditional commands} to specify which text is for the printed manual
-and which is for the Info file.@refill
-
-@menu
-* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}.
-* Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}.
-* Raw Formatter Commands:: Using raw @TeX{} or HTML commands.
-* set clear value:: Designating which text to format (for
- all output formats); and how to set a
- flag to a string that you can insert.
-@end menu
-
-@node Conditional Commands, Conditional Not Commands, Conditionals, Conditionals
-@ifinfo
-@heading Conditional Commands
-@end ifinfo
-
-@findex ifinfo
-@code{@@ifinfo} begins segments of text that should be ignored
-by @TeX{} when it
-typesets the printed manual. The segment of text appears only
-in the Info file.
-The @code{@@ifinfo} command should appear on a line by itself; end
-the Info-only text with a line containing @code{@@end ifinfo} by
-itself. At the beginning of a Texinfo file, the Info permissions are
-contained within a region marked by @code{@@ifinfo} and @code{@@end
-ifinfo}. (@xref{Info Summary and Permissions}.)@refill
-
-@findex iftex
-@findex ifhtml
-The @code{@@iftex} and @code{@@end iftex} commands are similar to the
-@code{@@ifinfo} and @code{@@end ifinfo} commands, except that they
-specify text that will appear in the printed manual but not in the Info
-file. Likewise for @code{@@ifhtml} and @code{@@end ifhtml}, which
-specify text to appear only in HTML output.@refill
-
-For example,
-
-@example
-@@iftex
-This text will appear only in the printed manual.
-@@end iftex
-@@ifinfo
-However, this text will appear only in Info.
-@@end ifinfo
-@end example
-
-@noindent
-The preceding example produces the following line:
-@iftex
-This text will appear only in the printed manual.
-@end iftex
-@ifinfo
-However, this text will appear only in Info.
-@end ifinfo
-
-@noindent
-Note how you only see one of the two lines, depending on whether you
-are reading the Info version or the printed version of this
-manual.@refill
-
-The @code{@@titlepage} command is a special variant of @code{@@iftex} that
-is used for making the title and copyright pages of the printed
-manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill
-
-
-@node Conditional Not Commands, Raw Formatter Commands, Conditional Commands, Conditionals
-@section Conditional Not Commands
-@findex ifnothtml
-@findex ifnotinfo
-@findex ifnottex
-
-You can specify text to be included in any output format @emph{other}
-than some given one with the @code{@@ifnot@dots{}} commands:
-@example
-@@ifnothtml @dots{} @@end ifnothtml
-@@ifnotinfo @dots{} @@end ifnotinfo
-@@ifnottex @dots{} @@end ifnottex
-@end example
-@noindent
-(The @code{@@ifnot@dots{}} command and the @code{@@end} command must
-actually appear on lines by themselves.)
-
-If the output file is not being made for the given format, the region is
-included. Otherwise, it is ignored.
-
-The regions delimited by these commands are ordinary Texinfo source as
-with @code{@@iftex}, not raw formatter source as with @code{@@tex}.
-
-
-@node Raw Formatter Commands, set clear value, Conditional Not Commands, Conditionals
-@section Raw Formatter Commands
-@cindex @TeX{} commands, using ordinary
-@cindex HTML commands, using ordinary
-@cindex Raw formatter commands
-@cindex Ordinary @TeX{} commands, using
-@cindex Ordinary HTML commands, using
-@cindex Commands using raw @TeX{}
-@cindex Commands using raw HTML
-@cindex plain @TeX{}
-
-Inside a region delineated by @code{@@iftex} and @code{@@end iftex}, you
-can embed some raw @TeX{} commands. Info will ignore these commands
-since they are only in that part of the file which is seen by @TeX{}.
-You can write the @TeX{} commands as you would write them in a normal
-@TeX{} file, except that you must replace the @samp{\} used by @TeX{}
-with an @samp{@@}. For example, in the @code{@@titlepage} section of a
-Texinfo file, you can use the @TeX{} command @code{@@vskip} to format
-the copyright page. (The @code{@@titlepage} command causes Info to
-ignore the region automatically, as it does with the @code{@@iftex}
-command.)
-
-However, many features of plain @TeX{} will not work, as they are
-overridden by Texinfo features.
-
-@findex tex
-You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{}
-commands, by delineating a region with the @code{@@tex} and @code{@@end
-tex} commands. (The @code{@@tex} command also causes Info to ignore the
-region, like the @code{@@iftex} command.) The sole exception is that
-@code{@@} chracter still introduces a command, so that @code{@@end tex}
-can be recognized properly.
-
-@cindex Mathematical expressions
-For example, here is a mathematical expression written in
-plain @TeX{}:
-
-@example
-@@tex
-$$ \chi^2 = \sum_@{i=1@}^N
- \left (y_i - (a + b x_i)
- \over \sigma_i\right)^2 $$
-@@end tex
-@end example
-
-@noindent
-The output of this example will appear only in a printed manual. If
-you are reading this in Info, you will not see the equation that appears
-in the printed manual.
-@iftex
-In a printed manual, the above expression looks like
-this:
-@end iftex
-
-@tex
-$$ \chi^2 = \sum_{i=1}^N
- \left(y_i - (a + b x_i)
- \over \sigma_i\right)^2 $$
-@end tex
-
-@findex ifhtml
-@findex html
-Analogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to delimit
-a region to be included in HTML output only, and @code{@@html @dots{}
-@@end ifhtml} for a region of raw HTML (again, except that @code{@@} is
-still the escape character, so the @code{@@end} command can be
-recognized.)
-
-
-@node set clear value, , Raw Formatter Commands, Conditionals
-@comment node-name, next, previous, up
-@section @code{@@set}, @code{@@clear}, and @code{@@value}
-
-You can direct the Texinfo formatting commands to format or ignore parts
-of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
-and @code{@@ifclear} commands.@refill
-
-In addition, you can use the @code{@@set @var{flag}} command to set the
-value of @var{flag} to a string of characters; and use
-@code{@@value@{@var{flag}@}} to insert that string. You can use
-@code{@@set}, for example, to set a date and use @code{@@value} to
-insert the date in several places in the Texinfo file.@refill
-
-@menu
-* ifset ifclear:: Format a region if a flag is set.
-* value:: Replace a flag with a string.
-* value Example:: An easy way to update edition information.
-@end menu
-
-
-@node ifset ifclear, value, set clear value, set clear value
-@subsection @code{@@ifset} and @code{@@ifclear}
-
-@findex ifset
-When a @var{flag} is set, the Texinfo formatting commands format text
-between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
-ifset} commands. When the @var{flag} is cleared, the Texinfo formatting
-commands do @emph{not} format the text.
-
-Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a
-@var{flag}; a @dfn{flag} can be any single word. The format for the
-command looks like this:@refill
-@findex set
-
-@example
-@@set @var{flag}
-@end example
-
-Write the conditionally formatted text between @code{@@ifset @var{flag}}
-and @code{@@end ifset} commands, like this:@refill
-
-@example
-@group
-@@ifset @var{flag}
-@var{conditional-text}
-@@end ifset
-@end group
-@end example
-
-For example, you can create one document that has two variants, such as
-a manual for a `large' and `small' model:@refill
-
-@example
-You can use this machine to dig up shrubs
-without hurting them.
-
-@@set large
-
-@@ifset large
-It can also dig up fully grown trees.
-@@end ifset
-
-Remember to replant promptly @dots{}
-@end example
-
-@noindent
-In the example, the formatting commands will format the text between
-@code{@@ifset large} and @code{@@end ifset} because the @code{large}
-flag is set.@refill
-
-@findex clear
-Use the @code{@@clear @var{flag}} command to turn off, or @dfn{clear},
-a flag. Clearing a flag is the opposite of setting a flag. The
-command looks like this:@refill
-
-@example
-@@clear @var{flag}
-@end example
-
-@noindent
-Write the command on a line of its own.
-
-When @var{flag} is cleared, the Texinfo formatting commands do
-@emph{not} format the text between @code{@@ifset @var{flag}} and
-@code{@@end ifset}; that text is ignored and does not appear in either
-printed or Info output.@refill
-
-For example, if you clear the flag of the preceding example by writing
-an @code{@@clear large} command after the @code{@@set large} command
-(but before the conditional text), then the Texinfo formatting commands
-ignore the text between the @code{@@ifset large} and @code{@@end ifset}
-commands. In the formatted output, that text does not appear; in both
-printed and Info output, you see only the lines that say, ``You can use
-this machine to dig up shrubs without hurting them. Remember to replant
-promptly @dots{}''.
-
-@findex ifclear
-If a flag is cleared with an @code{@@clear @var{flag}} command, then
-the formatting commands format text between subsequent pairs of
-@code{@@ifclear} and @code{@@end ifclear} commands. But if the flag
-is set with @code{@@set @var{flag}}, then the formatting commands do
-@emph{not} format text between an @code{@@ifclear} and an @code{@@end
-ifclear} command; rather, they ignore that text. An @code{@@ifclear}
-command looks like this:@refill
-
-@example
-@@ifclear @var{flag}
-@end example
-
-@need 700
-In brief, the commands are:@refill
-
-@table @code
-@item @@set @var{flag}
-Tell the Texinfo formatting commands that @var{flag} is set.@refill
-
-@item @@clear @var{flag}
-Tell the Texinfo formatting commands that @var{flag} is cleared.@refill
-
-@item @@ifset @var{flag}
-If @var{flag} is set, tell the Texinfo formatting commands to format
-the text up to the following @code{@@end ifset} command.@refill
-
-If @var{flag} is cleared, tell the Texinfo formatting commands to
-ignore text up to the following @code{@@end ifset} command.@refill
-
-@item @@ifclear @var{flag}
-If @var{flag} is set, tell the Texinfo formatting commands to ignore
-the text up to the following @code{@@end ifclear} command.@refill
-
-If @var{flag} is cleared, tell the Texinfo formatting commands to
-format the text up to the following @code{@@end ifclear}
-command.@refill
-@end table
-
-@node value, value Example, ifset ifclear, set clear value
-@subsection @code{@@value}
-@findex value
-
-You can use the @code{@@set} command to specify a value for a flag,
-which is expanded by the @code{@@value} command. The value is a string
-a characters.
-
-Write the @code{@@set} command like this:
-
-@example
-@@set foo This is a string.
-@end example
-
-@noindent
-This sets the value of @code{foo} to ``This is a string.''
-
-The Texinfo formatters replace an @code{@@value@{@var{flag}@}} command with
-the string to which @var{flag} is set.@refill
-
-Thus, when @code{foo} is set as shown above, the Texinfo formatters convert
-
-@example
-@group
-@@value@{foo@}
-@exdent @r{to}
-This is a string.
-@end group
-@end example
-
-You can write an @code{@@value} command within a paragraph; but you
-must write an @code{@@set} command on a line of its own.
-
-If you write the @code{@@set} command like this:
-
-@example
-@@set foo
-@end example
-
-@noindent
-without specifying a string, the value of @code{foo} is an empty string.
-
-If you clear a previously set flag with an @code{@@clear @var{flag}}
-command, a subsequent @code{@@value@{flag@}} command is invalid and the
-string is replaced with an error message that says @samp{@{No value for
-"@var{flag}"@}}.
-
-For example, if you set @code{foo} as follows:@refill
-
-@example
-@@set how-much very, very, very
-@end example
-
-@noindent
-then the formatters transform
-
-@example
-@group
-It is a @@value@{how-much@} wet day.
-@exdent @r{into}
-It is a very, very, very wet day.
-@end group
-@end example
-
-If you write
-
-@example
-@@clear how-much
-@end example
-
-@noindent
-then the formatters transform
-
-@example
-@group
-It is a @@value@{how-much@} wet day.
-@exdent @r{into}
-It is a @{No value for "how-much"@} wet day.
-@end group
-@end example
-
-@node value Example, , value, set clear value
-@subsection @code{@@value} Example
-
-You can use the @code{@@value} command to limit the number of places you
-need to change when you record an update to a manual.
-Here is how it is done in @cite{The GNU Make Manual}:
-
-@need 1000
-@noindent
-Set the flags:
-
-@example
-@group
-@@set EDITION 0.35 Beta
-@@set VERSION 3.63 Beta
-@@set UPDATED 14 August 1992
-@@set UPDATE-MONTH August 1992
-@end group
-@end example
-
-@need 750
-@noindent
-Write text for the first @code{@@ifinfo} section, for people reading the
-Texinfo file:
-
-@example
-@group
-This is Edition @@value@{EDITION@},
-last updated @@value@{UPDATED@},
-of @@cite@{The GNU Make Manual@},
-for @@code@{make@}, Version @@value@{VERSION@}.
-@end group
-@end example
-
-@need 1000
-@noindent
-Write text for the title page, for people reading the printed manual:
-@c List only the month and the year since that looks less fussy on a
-@c printed cover than a date that lists the day as well.
-
-@example
-@group
-@@title GNU Make
-@@subtitle A Program for Directing Recompilation
-@@subtitle Edition @@value@{EDITION@}, @dots{}
-@@subtitle @@value@{UPDATE-MONTH@}
-@end group
-@end example
-
-@noindent
-(On a printed cover, a date listing the month and the year looks less
-fussy than a date listing the day as well as the month and year.)
-
-@need 750
-@noindent
-Write text for the Top node, for people reading the Info file:
-
-@example
-@group
-This is Edition @@value@{EDITION@}
-of the @@cite@{GNU Make Manual@},
-last updated @@value@{UPDATED@}
-for @@code@{make@} Version @@value@{VERSION@}.
-@end group
-@end example
-
-@need 950
-After you format the manual, the text in the first @code{@@ifinfo}
-section looks like this:
-
-@example
-@group
-This is Edition 0.35 Beta, last updated 14 August 1992,
-of `The GNU Make Manual', for `make', Version 3.63 Beta.
-@end group
-@end example
-
-When you update the manual, change only the values of the flags; you do
-not need to rewrite the three sections.
-
-
-@node Macros, Format/Print Hardcopy, Conditionals, Top
-@chapter Macros: Defining New Texinfo Commands
-@cindex Macros
-@cindex Defining new Texinfo commands
-@cindex New Texinfo commands, defining
-@cindex Texinfo commands, defining new
-@cindex User-defined Texinfo commands
-
-A Texinfo @dfn{macro} allows you to define a new Texinfo command as any
-sequence of text and/or existing commands (including other macros). The
-macro can have any number of @dfn{parameters}---text you supply each
-time you use the macro. (This has nothing to do with the
-@code{@@defmac} command, which is for documenting macros in the subject
-of the manual; @pxref{Def Cmd Template}.)
-
-@menu
-* Defining Macros:: Both defining and undefining new commands.
-* Invoking Macros:: Using a macro, once you've defined it.
-@end menu
-
-
-@node Defining Macros, Invoking Macros, Macros, Macros
-@section Defining Macros
-@cindex Defining macros
-@cindex Macro definitions
-
-@findex macro
-You use the Texinfo @code{@@macro} command to define a macro. For example:
-
-@example
-@@macro @var{macro-name}@{@var{param1}, @var{param2}, @dots{}@}
-@var{text} @dots{} \@var{param1}\ @dots{}
-@@end macro
-@end example
-
-The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
-arguments supplied when the macro is subsequently used in the document
-(see the next section).
-
-If a macro needs no parameters, you can define it either with an empty
-list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
-foo}).
-
-@cindex Body of a macro
-@cindex Mutually recursive macros
-@cindex Recursion, mutual
-The definition or @dfn{body} of the macro can contain any Texinfo
-commands, including previously-defined macros. (It is not possible to
-have mutually recursive Texinfo macros.) In the body, instances of a
-parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in
-the example above, are replaced by the corresponding argument from the
-macro invocation.
-
-@findex unmacro
-@cindex Macros, undefining
-@cindex Undefining macros
-You can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}.
-It is not an error to undefine a macro that is already undefined.
-For example:
-
-@example
-@@unmacro foo
-@end example
-
-
-@node Invoking Macros, , Defining Macros, Macros
-@section Invoking Macros
-@cindex Invoking macros
-@cindex Macro invocation
-
-After a macro is defined (see the previous section), you can use
-(@dfn{invoke}) it in your document like this:
-
-@example
-@@@var{macro-name} @{@var{arg1}, @var{arg2}, @dots{}@}
-@end example
-
-@noindent and the result will be just as if you typed the body of
-@var{macro-name} at that spot. For example:
-
-@example
-@@macro foo @{p, q@}
-Together: \p\ & \q\.
-@@end macro
-@@foo@{a, b@}
-@end example
-
-@noindent produces:
-
-@display
-Together: a & b.
-@end display
-
-@cindex Backslash, and macros
-Thus, the arguments and parameters are separated by commas and delimited
-by braces; any whitespace after (but not before) a comma is ignored. To
-insert a comma, brace, or backslash in an argument, prepend a backslash,
-as in
-
-@example
-@@@var{macro-name} @{\\\@{\@}\,@}
-@end example
-
-@noindent
-which will pass the (almost certainly error-producing) argument
-@samp{\@{@},} to @var{macro-name}.
-
-If the macro is defined to take a single argument, and is invoked
-without any braces, the entire rest of the line after the macro name is
-supplied as the argument. For example:
-
-@example
-@@macro bar @{p@}
-Twice: \p\, \p\.
-@@end macro
-@@bar aah
-@end example
-
-@noindent produces:
-
-@display
-Twice: aah, aah.
-@end display
-
-
-@node Format/Print Hardcopy, Create an Info File, Macros, Top
-@comment node-name, next, previous, up
-@chapter Format and Print Hardcopy
-@cindex Format and print hardcopy
-@cindex Hardcopy, printing it
-@cindex Making a printed manual
-@cindex Sorting indices
-@cindex Indices, sorting
-@cindex @TeX{} index sorting
-@pindex texindex
-
-There are three major shell commands for making a printed manual from a
-Texinfo file: one for converting the Texinfo file into a file that will be
-printed, a second for sorting indices, and a third for printing the
-formatted document. When you use the shell commands, you can either
-work directly in the operating system shell or work within a shell
-inside GNU Emacs.@refill
-
-If you are using GNU Emacs, you can use commands provided by Texinfo
-mode instead of shell commands. In addition to the three commands to
-format a file, sort the indices, and print the result, Texinfo mode
-offers key bindings for commands to recenter the output buffer, show the
-print queue, and delete a job from the print queue.@refill
-
-@menu
-* Use TeX:: Use @TeX{} to format for hardcopy.
-* Format with tex/texindex:: How to format in a shell.
-* Format with texi2dvi:: A simpler way to use the shell.
-* Print with lpr:: How to print.
-* Within Emacs:: How to format and print from an Emacs shell.
-* Texinfo Mode Printing:: How to format and print in Texinfo mode.
-* Compile-Command:: How to print using Emacs's compile command.
-* Requirements Summary:: @TeX{} formatting requirements summary.
-* Preparing for TeX:: What you need to do to use @TeX{}.
-* Overfull hboxes:: What are and what to do with overfull hboxes.
-* smallbook:: How to print small format books and manuals.
-* A4 Paper:: How to print on European A4 paper.
-* Cropmarks and Magnification:: How to print marks to indicate the size
- of pages and how to print scaled up output.
-@end menu
-
-@node Use TeX, Format with tex/texindex, Format/Print Hardcopy, Format/Print Hardcopy
-@ifinfo
-@heading Use @TeX{}
-@end ifinfo
-
-The typesetting program called @TeX{} is used for formatting a Texinfo
-file. @TeX{} is a very powerful typesetting program and, if used right,
-does an exceptionally good job. (@xref{Obtaining TeX, , How to Obtain
-@TeX{}}, for information on how to obtain @TeX{}.)
-
-The @code{makeinfo}, @code{texinfo-format-region}, and
-@code{texinfo-format-buffer} commands read the very same @@-commands
-in the Texinfo file as does @TeX{}, but process them differently to
-make an Info file; see @ref{Create an Info File}.@refill
-
-@node Format with tex/texindex, Format with texi2dvi, Use TeX, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Format using @code{tex} and @code{texindex}
-@cindex Shell formatting with @code{tex} and @code{texindex}
-@cindex Formatting with @code{tex} and @code{texindex}
-@cindex DVI file
-
-Format the Texinfo file with the shell command @code{tex} followed by
-the name of the Texinfo file. For example:
-
-@example
-tex foo.texi
-@end example
-
-@noindent @TeX{} will produce a @dfn{DVI file} as well as several auxiliary
-files containing information for indices, cross references, etc. The
-DVI file (for @dfn{DeVice Independent} file) can be printed on virtually
-any printe (see the following sections).
-
-@pindex texindex
-The @code{tex} formatting command itself does not sort the indices; it
-writes an output file of unsorted index data. (The @code{texi2dvi}
-command automatically generates indices; see @ref{Format with texi2dvi,,
-Format using @code{texi2dvi}}.) To generate a printed index after
-running the @code{tex} command, you first need a sorted index to work
-from. The @code{texindex} command sorts indices. (The source file
-@file{texindex.c} comes as part of the standard Texinfo distribution,
-among other places.)@refill
-
-@cindex Names of index files
-The @code{tex} formatting command outputs unsorted index files under
-names that obey a standard convention: the name of your main input file
-with any @samp{.tex} (or similar, @pxref{tex invocation,,, web2c,
-Web2c}) extension removed, followed by the two letter names of indices.
-For example, the raw index output files for the input file
-@file{foo.texinfo} would be @file{foo.cp}, @file{foo.vr}, @file{foo.fn},
-@file{foo.tp}, @file{foo.pg} and @file{foo.ky}. Those are exactly the
-arguments to give to @code{texindex}.@refill
-
-@need 1000
-@cindex Wildcards
-@cindex Globbing
-Instead of specifying all the unsorted index file names explicitly, you
-can use @samp{??} as shell wildcards and give the command in this
-form:@refill
-
-@example
-texindex foo.??
-@end example
-
-@noindent
-This command will run @code{texindex} on all the unsorted index files,
-including any that you have defined yourself using @code{@@defindex}
-or @code{@@defcodeindex}. (You may execute @samp{texindex foo.??}
-even if there are similarly named files with two letter extensions
-that are not index files, such as @samp{foo.el}. The @code{texindex}
-command reports but otherwise ignores such files.)@refill
-
-For each file specified, @code{texindex} generates a sorted index file
-whose name is made by appending @samp{s} to the input file name. The
-@code{@@printindex} command knows to look for a file of that name
-(@pxref{Printing Indices & Menus}). @code{texindex} does not alter the
-raw index output file.@refill
-
-After you have sorted the indices, you need to rerun the @code{tex}
-formatting command on the Texinfo file. This regenerates the DVI file,
-this time with up-to-date index entries.
-
-Finally, you may need to run @code{tex} one more time, to get the page
-numbers in the cross-references correct.
-
-To summarize, this is a four step process:
-
-@enumerate
-@item
-Run @code{tex} on your Texinfo file. This generates a DVI file (with
-undefined cross-references and no indices), and the raw index files
-(with two letter extensions).
-
-@item
-Run @code{texindex} on the raw index files. This creates the
-corresponding sorted index files (with three letter extensions).
-
-@item
-Run @code{tex} again on your Texinfo file. This regenerates the DVI
-file, this time with indices and defined cross-references, but with page
-numbers for the cross-references from last time, generally incorrect.
-
-@item
-Run @code{tex} one last time. This time the correct page numbers are
-written for the cross-references.
-@end enumerate
-
-@pindex texi2dvi
-Alternatively, it's a one-step process: run @code{texi2dvi}.
-
-You need not run @code{texindex} each time after you run @code{tex}. If
-you do not, on the next run, the @code{tex} formatting command will use
-whatever sorted index files happen to exist from the previous use of
-@code{texindex}. This is usually ok while you are
-debugging.@refill
-
-
-@node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Format using @code{texi2dvi}
-@pindex texi2dvi @r{(shell script)}
-
-The @code{texi2dvi} command automatically runs both @code{tex} and
-@code{texindex} as many times as necessary to produce a DVI file with
-up-to-date, sorted indices. It simplifies the
-@code{tex}---@code{texindex}---@code{tex} sequence described in the
-previous section.
-
-The syntax for @code{texi2dvi} is like this (where @samp{prompt$} is your
-shell prompt):@refill
-
-@example
-prompt$ @kbd{texi2dvi @var{filename}@dots{}}
-@end example
-
-For a list of options, run @samp{texi2dvi --help}.
-
-
-@node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Shell Print Using @code{lpr -d}
-@pindex lpr @r{(DVI print command)}
-
-The precise command to print a DVI file depends on your system
-installation, but @samp{lpr -d} is common. The command may require the
-DVI file name without any extension or with a @samp{.dvi}
-extension. (If it is @samp{lpr}, you must include the @samp{.dvi}.)
-
-The following commands, for example, will (probably) suffice to sort the
-indices, format, and print the @cite{Bison Manual}:
-
-@example
-@group
-tex bison.texinfo
-texindex bison.??
-tex bison.texinfo
-lpr -d bison.dvi
-@end group
-@end example
-
-@noindent
-(Remember that the shell commands may be different at your site; but
-these are commonly used versions.)@refill
-
-@need 1000
-Using the @code{texi2dvi} shell script, you simply need type:@refill
-
-@example
-@group
-texi2dvi bison.texinfo
-lpr -d bison.dvi
-@end group
-@end example
-
-@node Within Emacs, Texinfo Mode Printing, Print with lpr, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section From an Emacs Shell
-@cindex Print, format from Emacs shell
-@cindex Format, print from Emacs shell
-@cindex Shell, format, print from
-@cindex Emacs shell, format, print from
-@cindex GNU Emacs shell, format, print from
-
-You can give formatting and printing commands from a shell within GNU
-Emacs. To create a shell within Emacs, type @kbd{M-x shell}. In this
-shell, you can format and print the document. @xref{Format/Print
-Hardcopy, , Format and Print Hardcopy}, for details.@refill
-
-You can switch to and from the shell buffer while @code{tex} is
-running and do other editing. If you are formatting a long document
-on a slow machine, this can be very convenient.@refill
-
-You can also use @code{texi2dvi} from an Emacs shell. For example,
-here is how to use @code{texi2dvi} to format and print @cite{Using and
-Porting GNU CC} from a shell within Emacs:
-
-@example
-@group
-texi2dvi gcc.texinfo
-lpr -d gcc.dvi
-@end group
-@end example
-@ifinfo
-
-@xref{Texinfo Mode Printing}, for more information about formatting
-and printing in Texinfo mode.@refill
-@end ifinfo
-
-@node Texinfo Mode Printing, Compile-Command, Within Emacs, Format/Print Hardcopy
-@section Formatting and Printing in Texinfo Mode
-@cindex Region printing in Texinfo mode
-@cindex Format and print in Texinfo mode
-@cindex Print and format in Texinfo mode
-
-Texinfo mode provides several predefined key commands for @TeX{}
-formatting and printing. These include commands for sorting indices,
-looking at the printer queue, killing the formatting job, and
-recentering the display of the buffer in which the operations
-occur.@refill
-
-@table @kbd
-@item C-c C-t C-b
-@itemx M-x texinfo-tex-buffer
-Run @code{texi2dvi} on the current buffer.@refill
-
-@item C-c C-t C-r
-@itemx M-x texinfo-tex-region
-Run @TeX{} on the current region.@refill
-
-@item C-c C-t C-i
-@itemx M-x texinfo-texindex
-Sort the indices of a Texinfo file formatted with
-@code{texinfo-tex-region}.@refill
-
-@item C-c C-t C-p
-@itemx M-x texinfo-tex-print
-Print a DVI file that was made with @code{texinfo-tex-region} or
-@code{texinfo-tex-buffer}.@refill
-
-@item C-c C-t C-q
-@itemx M-x tex-show-print-queue
-Show the print queue.@refill
-
-@item C-c C-t C-d
-@itemx M-x texinfo-delete-from-print-queue
-Delete a job from the print queue; you will be prompted for the job
-number shown by a preceding @kbd{C-c C-t C-q} command
-(@code{texinfo-show-tex-print-queue}).@refill
-
-@item C-c C-t C-k
-@itemx M-x tex-kill-job
-Kill the currently running @TeX{} job started by
-@code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
-process running in the Texinfo shell buffer.@refill
-
-@item C-c C-t C-x
-@itemx M-x texinfo-quit-job
-Quit a @TeX{} formatting job that has stopped because of an error by
-sending an @key{x} to it. When you do this, @TeX{} preserves a record
-of what it did in a @file{.log} file.@refill
-
-@item C-c C-t C-l
-@itemx M-x tex-recenter-output-buffer
-Redisplay the shell buffer in which the @TeX{} printing and formatting
-commands are run to show its most recent output.@refill
-@end table
-
-@need 1000
-Thus, the usual sequence of commands for formatting a buffer is as
-follows (with comments to the right):@refill
-
-@example
-@group
-C-c C-t C-b @r{Run @code{texi2dvi} on the buffer.}
-C-c C-t C-p @r{Print the DVI file.}
-C-c C-t C-q @r{Display the printer queue.}
-@end group
-@end example
-
-The Texinfo mode @TeX{} formatting commands start a subshell in Emacs
-called the @file{*tex-shell*}. The @code{texinfo-tex-command},
-@code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
-commands are all run in this shell.
-
-You can watch the commands operate in the @samp{*tex-shell*} buffer,
-and you can switch to and from and use the @samp{*tex-shell*} buffer
-as you would any other shell buffer.@refill
-
-@need 1500
-The formatting and print commands depend on the values of several variables.
-The default values are:@refill
-
-@example
-@group
- @r{Variable} @r{Default value}
-
-texinfo-texi2dvi-command "texi2dvi"
-texinfo-tex-command "tex"
-texinfo-texindex-command "texindex"
-texinfo-delete-from-print-queue-command "lprm"
-texinfo-tex-trailer "@@bye"
-tex-start-of-header "%**start"
-tex-end-of-header "%**end"
-tex-dvi-print-command "lpr -d"
-tex-show-queue-command "lpq"
-@end group
-@end example
-
-You can change the values of these variables with the @kbd{M-x
-edit-options} command (@pxref{Edit Options, , Editing Variable Values,
-emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command
-(@pxref{Examining, , Examining and Setting Variables, emacs, The GNU
-Emacs Manual}), or with your @file{.emacs} initialization file
-(@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill
-
-@node Compile-Command, Requirements Summary, Texinfo Mode Printing, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Using the Local Variables List
-@cindex Local variables
-@cindex Compile command for formatting
-@cindex Format with the compile command
-
-Yet another way to apply the @TeX{} formatting command to a Texinfo file
-is to put that command in a @dfn{local variables list} at the end of the
-Texinfo file. You can then specify the @code{tex} or @code{texi2dvi}
-commands as a @code{compile-command} and have Emacs run it by typing
-@kbd{M-x compile}. This creates a special shell called the
-@file{*compilation*} buffer in which Emacs runs the compile command.
-For example, at the end of the @file{gdb.texinfo} file, after the
-@code{@@bye}, you could put the following:@refill
-
-@example
-@group
-Local Variables:
-compile-command: "texi2dvi gdb.texinfo"
-End:
-@end group
-@end example
-
-@noindent
-This technique is most often used by programmers who also compile programs
-this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
-
-
-@node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section @TeX{} Formatting Requirements Summary
-@cindex Requirements for formatting
-@cindex Minimal requirements for formatting
-@cindex Formatting requirements
-
-Every Texinfo file that is to be input to @TeX{} must begin with a
-@code{\input} command and must contain an @code{@@setfilename} command:
-
-@example
-\input texinfo
-@@setfilename @var{arg-not-used-by-@TeX{}}
-@end example
-
-@noindent
-The first command instructs @TeX{} to load the macros it needs to
-process a Texinfo file and the second command opens auxiliary files.
-
-Every Texinfo file must end with a line that terminates @TeX{}'s
-processing and forces out unfinished pages:
-
-@example
-@@bye
-@end example
-
-Strictly speaking, these lines are all a Texinfo file needs to be
-processed successfully by @TeX{}.
-
-Usually, however, the beginning includes an @code{@@settitle} command to
-define the title of the printed manual, an @code{@@setchapternewpage}
-command, a title page, a copyright page, and permissions. Besides an
-@code{@@bye}, the end of a file usually includes indices and a table of
-contents. (And of course most manuals contain a body of text as well.)
-
-@iftex
-For more information, see
-@ref{settitle, , @code{@@settitle}},
-@ref{setchapternewpage, , @code{@@setchapternewpage}},
-@ref{Headings, ,Page Headings},
-@ref{Titlepage & Copyright Page},
-@ref{Printing Indices & Menus}, and
-@ref{Contents}.
-@end iftex
-@noindent
-@ifinfo
-For more information, see@*
-@ref{settitle, , @code{@@settitle}},@*
-@ref{setchapternewpage, , @code{@@setchapternewpage}},@*
-@ref{Headings, ,Page Headings},@*
-@ref{Titlepage & Copyright Page},@*
-@ref{Printing Indices & Menus}, and@*
-@ref{Contents}.
-@end ifinfo
-
-
-@node Preparing for TeX, Overfull hboxes, Requirements Summary, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Preparing to Use @TeX{}
-@cindex Preparing to use @TeX{}
-@cindex @TeX{} input initialization
-@cindex @code{TEXINPUTS} environment variable
-@vindex TEXINPUTS
-@cindex @b{.profile} initialization file
-@cindex @b{.cshrc} initialization file
-@cindex Initialization file for @TeX{} input
-
-@TeX{} needs to know where to find the @file{texinfo.tex} file that you
-have told it to input with the @samp{\input texinfo} command at the
-beginning of the first line. The @file{texinfo.tex} file tells @TeX{}
-how to handle @@-commands; it is included in all standard GNU
-distributions.
-
-@pindex texinfo.tex@r{, installing}
-Usually, the @file{texinfo.tex} file is put under the default directory
-that contains @TeX{} macros
-(@file{/usr/local/share/texmf/tex/texinfo/texinfo.tex} by default) when
-GNU Emacs or other GNU software is installed. In this case, @TeX{} will
-find the file and you do not need to do anything special.
-Alternatively, you can put @file{texinfo.tex} in the current directory
-when you run @TeX{}, and @TeX{} will find it there.
-
-@pindex epsf.tex@r{, installing}
-Also, you should install @file{epsf.tex} in the same place as
-@file{texinfo.tex}, if it is not already installed from another
-distribution. This file is needed to support the @code{@@image} command
-(@pxref{Images}).
-
-@pindex texinfo.cnf @r{installation}
-@cindex Customizing of @TeX{} for Texinfo
-@cindex Site-wide Texinfo configuration file
-Optionally, you may create an additional @file{texinfo.cnf}, and install
-it as well. This file is read by @TeX{} at the @code{@@setfilename}
-command (@pxref{setfilename,, @code{@@setfilename}}). You can put any
-commands you like there according to local site-wide conventions, and
-they will be read by @TeX{} when processing any Texinfo document. For
-example, if @file{texinfo.cnf} contains the a single line
-@samp{@@afourpaper} (@pxref{A4 Paper}), then all Texinfo documents will
-be processed with that page size in effect. If you have nothing to put
-in @file{texinfo.cnf}, you do not need to create it.
-
-@vindex TEXINPUTS
-If neither of the above locations for these system files suffice for
-you, you can specify the directories explicitly. For
-@file{texinfo.tex}, you can do this by writing the complete path for the
-file after the @code{\input} command. Another way, that works for both
-@file{texinfo.tex} and @file{texinfo.cnf} (and any other file @TeX{}
-might read), is to set the @code{TEXINPUTS} environment variable in your
-@file{.cshrc} or @file{.profile} file.
-
-Which you use of @file{.cshrc} or @file{.profile} depends on
-whether you use a Bourne shell-compatible (@code{sh}, @code{bash},
-@code{ksh}, @dots{}) or C shell-compatible (@code{csh}, @code{tcsh})
-command interpreter. The latter read the @file{.cshrc} file for
-initialization information, and the former read @file{.profile}.
-
-In a @file{.cshrc} file, you could use the following @code{csh} command
-sequence:
-
-@example
-setenv TEXINPUTS .:/home/me/mylib:/usr/lib/tex/macros
-@end example
-
-@need 1000
-In a @file{.profile} file, you could use the following @code{sh} command
-sequence:
-
-@example
-@group
-TEXINPUTS=.:/home/me/mylib:/usr/lib/tex/macros
-export TEXINPUTS
-@end group
-@end example
-
-@noindent
-This would cause @TeX{} to look for @file{\input} file first in the current
-directory, indicated by the @samp{.}, then in a hypothetical user's
-@file{me/mylib} directory, and finally in a system directory.
-
-
-@node Overfull hboxes, smallbook, Preparing for TeX, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Overfull ``hboxes''
-@cindex Overfull @samp{hboxes}
-@cindex @samp{hboxes}, overfull
-@cindex Final output
-
-@TeX{} is sometimes unable to typeset a line without extending it into
-the right margin. This can occur when @TeX{} comes upon what it
-interprets as a long word that it cannot hyphenate, such as an
-electronic mail network address or a very long title. When this
-happens, @TeX{} prints an error message like this:@refill
-
-@example
-Overfull \hbox (20.76302pt too wide)
-@end example
-
-@noindent
-(In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
-The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill
-
-@TeX{} also provides the line number in the Texinfo source file and
-the text of the offending line, which is marked at all the places that
-@TeX{} knows how to hyphenate words.
-@xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
-for more information about typesetting errors.@refill
-
-If the Texinfo file has an overfull hbox, you can rewrite the sentence
-so the overfull hbox does not occur, or you can decide to leave it. A
-small excursion into the right margin often does not matter and may not
-even be noticeable.@refill
-
-@cindex Black rectangle in hardcopy
-@cindex Rectangle, ugly, black in hardcopy
-However, unless told otherwise, @TeX{} will print a large, ugly, black
-rectangle beside the line that contains the overfull hbox. This is so
-you will notice the location of the problem if you are correcting a
-draft.@refill
-
-@need 1000
-@findex finalout
-To prevent such a monstrosity from marring your final printout, write
-the following in the beginning of the Texinfo file on a line of its own,
-before the @code{@@titlepage} command:@refill
-
-@example
-@@finalout
-@end example
-
-@node smallbook, A4 Paper, Overfull hboxes, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Printing ``Small'' Books
-@findex smallbook
-@cindex Small book size
-@cindex Book, printing small
-@cindex Page sizes for books
-@cindex Size of printed book
-
-By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
-format. However, you can direct @TeX{} to typeset a document in a 7 by
-9.25 inch format that is suitable for bound books by inserting the
-following command on a line by itself at the beginning of the Texinfo
-file, before the title page:@refill
-
-@example
-@@smallbook
-@end example
-
-@noindent
-(Since regular sized books are often about 7 by 9.25 inches, this
-command might better have been called the @code{@@regularbooksize}
-command, but it came to be called the @code{@@smallbook} command by
-comparison to the 8.5 by 11 inch format.)@refill
-
-If you write the @code{@@smallbook} command between the
-start-of-header and end-of-header lines, the Texinfo mode @TeX{}
-region formatting command, @code{texinfo-tex-region}, will format the
-region in ``small'' book size (@pxref{Start of Header}).@refill
-
-The Free Software Foundation distributes printed copies of @cite{The GNU
-Emacs Manual} and other manuals in the ``small'' book size.
-@xref{smallexample & smalllisp, , @code{@@smallexample} and
-@code{@@smalllisp}}, for information about commands that make it easier
-to produce examples for a smaller manual.@refill
-
-Alternatively, to avoid embedding this physical paper size in your
-document, use @code{texi2dvi} to format your document (@pxref{Format
-with texi2dvi}), and supply @samp{-t @@smallbook} as an argument. Then
-other people do not have to change the document source file to format it
-differently.
-
-
-@node A4 Paper, Cropmarks and Magnification, smallbook, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Printing on A4 Paper
-@cindex A4 paper, printing on
-@cindex Paper size, European A4
-@cindex European A4 paper
-@findex afourpaper
-
-You can tell @TeX{} to typeset a document for printing on European size
-A4 paper with the @code{@@afourpaper} command. Write the command on a
-line by itself between @code{@@iftex} and @code{@@end iftex} lines near
-the beginning of the Texinfo file, before the title page:@refill
-
-For example, this is how you would write the header for this manual:@refill
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename texinfo
-@@settitle Texinfo
-@@syncodeindex vr fn
-@@iftex
-@@afourpaper
-@@end iftex
-@@c %**end of header
-@end group
-@end example
-
-Alternatively, to avoid embedding this physical paper size in your
-document, use @code{texi2dvi} to format your document (@pxref{Format
-with texi2dvi}), and supply @samp{-t @@afourpaper} as an argument. Then
-other people do not have to change the document source file to format it
-differently.
-
-@pindex texinfo.cnf
-Another alternative: put the @code{@@afourpaper} command in the file
-@file{texinfo.cnf} that @TeX{} will read. (No need for @code{@@iftex}
-there.) This will automatically typeset all the Texinfo documents at
-your site with that paper size in effect.
-
-
-@node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Cropmarks and Magnification
-
-@findex cropmarks
-@cindex Cropmarks for printing
-@cindex Printing cropmarks
-You can attempt to direct @TeX{} to print cropmarks at the corners of
-pages with the @code{@@cropmarks} command. Write the @code{@@cropmarks}
-command on a line by itself between @code{@@iftex} and @code{@@end
-iftex} lines near the beginning of the Texinfo file, before the title
-page, like this:@refill
-
-@example
-@group
-@@iftex
-@@cropmarks
-@@end iftex
-@end group
-@end example
-
-This command is mainly for printers that typeset several pages on one
-sheet of film; but you can attempt to use it to mark the corners of a
-book set to 7 by 9.25 inches with the @code{@@smallbook} command.
-(Printers will not produce cropmarks for regular sized output that is
-printed on regular sized paper.) Since different printing machines work
-in different ways, you should explore the use of this command with a
-spirit of adventure. You may have to redefine the command in the
-@file{texinfo.tex} definitions file.@refill
-
-@findex mag @r{(@TeX{} command)}
-@cindex Magnified printing
-@cindex Larger or smaller pages
-You can attempt to direct @TeX{} to typeset pages larger or smaller than
-usual with the @code{\mag} @TeX{} command. Everything that is typeset
-is scaled proportionally larger or smaller. (@code{\mag} stands for
-``magnification''.) This is @emph{not} a Texinfo @@-command, but is a
-plain @TeX{} command that is prefixed with a backslash. You have to
-write this command between @code{@@tex} and @code{@@end tex}
-(@pxref{Raw Formatter Commands}).
-
-Follow the @code{\mag} command with an @samp{=} and then a number that
-is 1000 times the magnification you desire. For example, to print pages
-at 1.2 normal size, write the following near the beginning of the
-Texinfo file, before the title page:@refill
-
-@example
-@group
-@@tex
-\mag=1200
-@@end tex
-@end group
-@end example
-
-With some printing technologies, you can print normal-sized copies that
-look better than usual by using a larger-than-normal master.@refill
-
-Depending on your system, @code{\mag} may not work or may work only at
-certain magnifications. Be prepared to experiment.@refill
-
-@node Create an Info File, Install an Info File, Format/Print Hardcopy, Top
-@comment node-name, next, previous, up
-@chapter Creating an Info File
-@cindex Creating an Info file
-@cindex Info, creating an on-line file
-@cindex Formatting a file for Info
-
-@code{makeinfo} is a utility that converts a Texinfo file into an Info
-file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
-GNU Emacs functions that do the same.@refill
-
-A Texinfo file must contain an @code{@@setfilename} line near its
-beginning, otherwise the Info formatting commands will fail.
-
-For information on installing the Info file in the Info system, see
-@ref{Install an Info File}.@refill
-
-@menu
-* makeinfo advantages:: @code{makeinfo} provides better error checking.
-* Invoking makeinfo:: How to run @code{makeinfo} from a shell.
-* makeinfo options:: Specify fill-column and other options.
-* Pointer Validation:: How to check that pointers point somewhere.
-* makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
-* texinfo-format commands:: Two Info formatting commands written
- in Emacs Lisp are an alternative
- to @code{makeinfo}.
-* Batch Formatting:: How to format for Info in Emacs Batch mode.
-* Tag and Split Files:: How tagged and split files help Info
- to run better.
-@end menu
-
-@node makeinfo advantages, Invoking makeinfo, Create an Info File, Create an Info File
-@ifinfo
-@heading @code{makeinfo} Preferred
-@end ifinfo
-
-The @code{makeinfo} utility creates an Info file from a Texinfo source
-file more quickly than either of the Emacs formatting commands and
-provides better error messages. We recommend it. @code{makeinfo} is a
-C program that is independent of Emacs. You do not need to run Emacs to
-use @code{makeinfo}, which means you can use @code{makeinfo} on machines
-that are too small to run Emacs. You can run @code{makeinfo} in
-any one of three ways: from an operating system shell, from a shell
-inside Emacs, or by typing a key command in Texinfo mode in Emacs.
-@refill
-
-The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
-commands are useful if you cannot run @code{makeinfo}. Also, in some
-circumstances, they format short regions or buffers more quickly than
-@code{makeinfo}.@refill
-
-@node Invoking makeinfo, makeinfo options, makeinfo advantages, Create an Info File
-@section Running @code{makeinfo} from a Shell
-
-To create an Info file from a Texinfo file, type @code{makeinfo}
-followed by the name of the Texinfo file. Thus, to create the Info
-file for Bison, type the following to the shell:
-is the prompt):@refill
-
-@example
-makeinfo bison.texinfo
-@end example
-
-(You can run a shell inside Emacs by typing @kbd{M-x shell}.)@refill
-
-@ifinfo
-Sometimes you will want to specify options. For example, if you wish
-to discover which version of @code{makeinfo} you are using,
-type:@refill
-
-@example
-makeinfo --version
-@end example
-
-@xref{makeinfo options}, for more information.
-@end ifinfo
-
-
-@node makeinfo options, Pointer Validation, Invoking makeinfo, Create an Info File
-@comment node-name, next, previous, up
-@section Options for @code{makeinfo}
-@cindex @code{makeinfo} options
-@cindex Options for @code{makeinfo}
-
-The @code{makeinfo} command takes a number of options. Most often,
-options are used to set the value of the fill column and specify the
-footnote style. Each command line option is a word preceded by
-@samp{--} or a letter preceded by @samp{-}. You can use abbreviations
-for the long option names as long as they are unique.@refill
-
-For example, you could use the following shell command to create an Info
-file for @file{bison.texinfo} in which each line is filled to only 68
-columns:@refill
-
-@example
-makeinfo --fill-column=68 bison.texinfo
-@end example
-
-You can write two or more options in sequence, like this:@refill
-
-@example
-makeinfo --no-split --fill-column=70 @dots{}
-@end example
-
-@noindent
-This would keep the Info file together as one possibly very long
-file and would also set the fill column to 70.@refill
-
-The options are:
-
-@table @code
-
-@item -D @var{var}
-@opindex -D @var{var}
-Cause the variable @var{var} to be defined. This is equivalent to
-@code{@@set @var{var}} in the Texinfo file (@pxref{set clear value}).
-
-@item --error-limit=@var{limit}
-@opindex --error-limit=@var{limit}
-Set the maximum number of errors that @code{makeinfo} will report
-before exiting (on the assumption that continuing would be useless);
-default 100.
-
-@need 150
-@item --fill-column=@var{width}
-@opindex --fill-column=@var{width}
-Specify the maximum number of columns in a line; this is the right-hand
-edge of a line. Paragraphs that are filled will be filled to this
-width. (Filling is the process of breaking up and connecting lines so
-that lines are the same length as or shorter than the number specified
-as the fill column. Lines are broken between words.) The default value
-is 72.
-
-@item --footnote-style=@var{style}
-@opindex --footnote-style=@var{style}
-Set the footnote style to @var{style}, either @samp{end} for the end
-node style (the default) or @samp{separate} for the separate node style.
-The value set by this option overrides the value set in a Texinfo file
-by an @code{@@footnotestyle} command (@pxref{Footnotes}). When the
-footnote style is @samp{separate}, @code{makeinfo} makes a new node
-containing the footnotes found in the current node. When the footnote
-style is @samp{end}, @code{makeinfo} places the footnote references at
-the end of the current node.
-
-@item --force
-@opindex --force
-Ordinarily, if the input file has errors, the output files are not
-created. With this option, they are preserved.
-
-@item --help
-@opindex --help
-Print a usage message listing all available options, then exit successfully.
-
-@item -I @var{dir}
-@opindex -I @var{dir}
-Add @code{dir} to the directory search list for finding files that are
-included using the @code{@@include} command. By default,
-@code{makeinfo} searches only the current directory.
-
-@item --no-headers
-@opindex --no-headers
-Do not include menus or node lines in the output. This results in an
-@sc{ascii} file that you cannot read in Info since it does not contain
-the requisite nodes or menus. It is primarily useful to extract certain
-pieces of a manual into separate files to be included in a distribution,
-such as @file{INSTALL} files.
-
-@item --no-split
-@opindex --no-split
-Suppress the splitting stage of @code{makeinfo}. By default, large
-output files (where the size is greater than 70k bytes) are split into
-smaller subfiles, each one approximately 50k bytes.
-
-@item --no-pointer-validate
-@itemx --no-validate
-@opindex --no-pointer-validate
-@opindex --no-validate
-Suppress the pointer-validation phase of @code{makeinfo}. Normally,
-after a Texinfo file is processed, some consistency checks are made to
-ensure that cross references can be resolved, etc.
-@xref{Pointer Validation}.@refill
-
-@item --no-warn
-@opindex --no-warn
-Suppress warning messages (but @emph{not} error messages). You might
-want this if the file you are creating has examples of Texinfo cross
-references within it, and the nodes that are referenced do not actually
-exist.
-
-@item --no-number-footnotes
-@opindex --no-number-footnotes
-Suppress automatic footnote numbering. By default, @code{makeinfo}
-numbers each footnote sequentially in a single node, resetting the
-current footnote number to 1 at the start of each node.
-
-@item --output=@var{file}
-@itemx -o @var{file}
-@opindex --output=@var{file}
-@opindex -o @var{file}
-Specify that the output should be directed to @var{file} and not to the
-file name specified in the @code{@@setfilename} command found in the
-Texinfo source (@pxref{setfilename}). If @var{file} is @samp{-}, output
-goes to standard output and @samp{--no-split} is implied.
-
-@item -P @var{dir}
-@opindex -P @var{dir}
-Prepend @code{dir} to the directory search list for @code{@@include}.
-See @samp{-I} for more details.
-
-@item --paragraph-indent=@var{indent}
-@opindex --paragraph-indent=@var{indent}
-Set the paragraph indentation style to @var{indent}. The value set by
-this option overrides the value set in a Texinfo file by an
-@code{@@paragraphindent} command (@pxref{paragraphindent}). The value
-of @var{indent} is interpreted as follows:
-
-@table @asis
-@item @samp{asis}
-Preserve any existing indentation at the starts of paragraphs.
-
-@item @samp{0} or @samp{none}
-Delete any existing indentation.
-
-@item @var{num}
-Indent each paragraph by that number of spaces.
-@end table
-
-@item --reference-limit=@var{limit}
-@opindex --reference-limit=@var{limit}
-Set the value of the number of references to a node that
-@code{makeinfo} will make without reporting a warning. If a node has more
-than this number of references in it, @code{makeinfo} will make the
-references but also report a warning. The default is 1000.
-
-@item -U @var{var}
-Cause @var{var} to be undefined. This is equivalent to
-@code{@@clear @var{var}} in the Texinfo file (@pxref{set clear value}).
-
-@item --verbose
-@opindex --verbose
-Cause @code{makeinfo} to display messages saying what it is doing.
-Normally, @code{makeinfo} only outputs messages if there are errors or
-warnings.
-
-@item --version
-@opindex --version
-Print the version number, then exit successfully.
-
-@end table
-
-
-@node Pointer Validation, makeinfo in Emacs, makeinfo options, Create an Info File
-@section Pointer Validation
-@cindex Pointer validation with @code{makeinfo}
-@cindex Validation of pointers
-
-If you do not suppress pointer-validation, @code{makeinfo} will check
-the validity of the final Info file. Mostly, this means ensuring that
-nodes you have referenced really exist. Here is a complete list of what
-is checked:@refill
-
-@enumerate
-@item
-If a `Next', `Previous', or `Up' node reference is a reference to a
-node in the current file and is not an external reference such as to
-@file{(dir)}, then the referenced node must exist.@refill
-
-@item
-In every node, if the `Previous' node is different from the `Up' node,
-then the `Previous' node must also be pointed to by a `Next' node.@refill
-
-@item
-Every node except the `Top' node must have an `Up' pointer.@refill
-
-@item
-The node referenced by an `Up' pointer must contain a reference to the
-current node in some manner other than through a `Next' reference.
-This includes menu entries and cross references.@refill
-
-@item
-If the `Next' reference of a node is not the same as the `Next' reference
-of the `Up' reference, then the node referenced by the `Next' pointer
-must have a `Previous' pointer that points back to the current node.
-This rule allows the last node in a section to point to the first node
-of the next chapter.@refill
-@end enumerate
-
-@node makeinfo in Emacs, texinfo-format commands, Pointer Validation, Create an Info File
-@section Running @code{makeinfo} inside Emacs
-@cindex Running @code{makeinfo} in Emacs
-@cindex @code{makeinfo} inside Emacs
-@cindex Shell, running @code{makeinfo} in
-
-You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
-@code{makeinfo-region} or the @code{makeinfo-buffer} commands. In
-Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
-C-m C-b} by default.@refill
-
-@table @kbd
-@item C-c C-m C-r
-@itemx M-x makeinfo-region
-Format the current region for Info.@refill
-@findex makeinfo-region
-
-@item C-c C-m C-b
-@itemx M-x makeinfo-buffer
-Format the current buffer for Info.@refill
-@findex makeinfo-buffer
-@end table
-
-When you invoke either @code{makeinfo-region} or
-@code{makeinfo-buffer}, Emacs prompts for a file name, offering the
-name of the visited file as the default. You can edit the default
-file name in the minibuffer if you wish, before pressing @key{RET} to
-start the @code{makeinfo} process.@refill
-
-The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
-run the @code{makeinfo} program in a temporary shell buffer. If
-@code{makeinfo} finds any errors, Emacs displays the error messages in
-the temporary buffer.@refill
-
-@cindex Errors, parsing
-@cindex Parsing errors
-@findex next-error
-You can parse the error messages by typing @kbd{C-x `}
-(@code{next-error}). This causes Emacs to go to and position the
-cursor on the line in the Texinfo source that @code{makeinfo} thinks
-caused the error. @xref{Compilation, , Running @code{make} or
-Compilers Generally, emacs, The GNU Emacs Manual}, for more
-information about using the @code{next-error} command.@refill
-
-In addition, you can kill the shell in which the @code{makeinfo}
-command is running or make the shell buffer display its most recent
-output.@refill
-
-@table @kbd
-@item C-c C-m C-k
-@itemx M-x makeinfo-kill-job
-@findex makeinfo-kill-job
-Kill the current running @code{makeinfo} job created by
-@code{makeinfo-region} or @code{makeinfo-buffer}.@refill
-
-@item C-c C-m C-l
-@itemx M-x makeinfo-recenter-output-buffer
-@findex makeinfo-recenter-output-buffer
-Redisplay the @code{makeinfo} shell buffer to display its most recent
-output.@refill
-@end table
-
-@noindent
-(Note that the parallel commands for killing and recentering a @TeX{}
-job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}. @xref{Texinfo Mode
-Printing}.)@refill
-
-You can specify options for @code{makeinfo} by setting the
-@code{makeinfo-options} variable with either the @kbd{M-x
-edit-options} or the @kbd{M-x set-variable} command, or by setting the
-variable in your @file{.emacs} initialization file.@refill
-
-For example, you could write the following in your @file{.emacs} file:@refill
-
-@example
-@group
-(setq makeinfo-options
- "--paragraph-indent=0 --no-split
- --fill-column=70 --verbose")
-@end group
-@end example
-
-@c If you write these three cross references using xref, you see
-@c three references to the same named manual, which looks strange.
-@iftex
-For more information, see @ref{makeinfo options, , Options for
-@code{makeinfo}}, as well as ``Editing Variable Values,''``Examining and
-Setting Variables,'' and ``Init File'' in the @cite{The GNU Emacs
-Manual}.
-@end iftex
-@noindent
-@ifinfo
-For more information, see@*
-@ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@*
-@ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
-@ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
-@ref{makeinfo options, , Options for @code{makeinfo}}.
-@end ifinfo
-
-@node texinfo-format commands, Batch Formatting, makeinfo in Emacs, Create an Info File
-@comment node-name, next, previous, up
-@section The @code{texinfo-format@dots{}} Commands
-@findex texinfo-format-region
-@findex texinfo-format-buffer
-
-In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
-file with the @code{texinfo-format-region} command. This formats the
-current region and displays the formatted text in a temporary buffer
-called @samp{*Info Region*}.@refill
-
-Similarly, you can format a buffer with the
-@code{texinfo-format-buffer} command. This command creates a new
-buffer and generates the Info file in it. Typing @kbd{C-x C-s} will
-save the Info file under the name specified by the
-@code{@@setfilename} line which must be near the beginning of the
-Texinfo file.@refill
-
-@table @kbd
-@item C-c C-e C-r
-@itemx @code{texinfo-format-region}
-Format the current region for Info.
-@findex texinfo-format-region
-
-@item C-c C-e C-b
-@itemx @code{texinfo-format-buffer}
-Format the current buffer for Info.
-@findex texinfo-format-buffer
-@end table
-
-The @code{texinfo-format-region} and @code{texinfo-format-buffer}
-commands provide you with some error checking, and other functions can
-provide you with further help in finding formatting errors. These
-procedures are described in an appendix; see @ref{Catching Mistakes}.
-However, the @code{makeinfo} program is often faster and
-provides better error checking (@pxref{makeinfo in Emacs}).@refill
-
-@node Batch Formatting, Tag and Split Files, texinfo-format commands, Create an Info File
-@comment node-name, next, previous, up
-@section Batch Formatting
-@cindex Batch formatting for Info
-@cindex Info batch formatting
-
-You can format Texinfo files for Info using @code{batch-texinfo-format}
-and Emacs Batch mode. You can run Emacs in Batch mode from any shell,
-including a shell inside of Emacs. (@xref{Command Switches, , Command
-Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill
-
-Here is a shell command to format all the files that end in
-@file{.texinfo} in the current directory:
-
-@example
-emacs -batch -funcall batch-texinfo-format *.texinfo
-@end example
-
-@noindent
-Emacs processes all the files listed on the command line, even if an
-error occurs while attempting to format some of them.@refill
-
-Run @code{batch-texinfo-format} only with Emacs in Batch mode as shown;
-it is not interactive. It kills the Batch mode Emacs on completion.@refill
-
-@code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
-and want to format several Texinfo files at once. When you use Batch
-mode, you create a new Emacs process. This frees your current Emacs, so
-you can continue working in it. (When you run
-@code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
-use that Emacs for anything else until the command finishes.)@refill
-
-@node Tag and Split Files, , Batch Formatting, Create an Info File
-@comment node-name, next, previous, up
-@section Tag Files and Split Files
-@cindex Making a tag table automatically
-@cindex Tag table, making automatically
-
-If a Texinfo file has more than 30,000 bytes,
-@code{texinfo-format-buffer} automatically creates a tag table
-for its Info file; @code{makeinfo} always creates a tag table. With
-a @dfn{tag table}, Info can jump to new nodes more quickly than it can
-otherwise.@refill
-
-@cindex Indirect subfiles
-In addition, if the Texinfo file contains more than about 70,000
-bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
-large Info file into shorter @dfn{indirect} subfiles of about 50,000
-bytes each. Big files are split into smaller files so that Emacs does
-not need to make a large buffer to hold the whole of a large Info
-file; instead, Emacs allocates just enough memory for the small, split
-off file that is needed at the time. This way, Emacs avoids wasting
-memory when you run Info. (Before splitting was implemented, Info
-files were always kept short and @dfn{include files} were designed as
-a way to create a single, large printed manual out of the smaller Info
-files. @xref{Include Files}, for more information. Include files are
-still used for very large documents, such as @cite{The Emacs Lisp
-Reference Manual}, in which each chapter is a separate file.)@refill
-
-When a file is split, Info itself makes use of a shortened version of
-the original file that contains just the tag table and references to
-the files that were split off. The split off files are called
-@dfn{indirect} files.@refill
-
-The split off files have names that are created by appending @w{@samp{-1}},
-@w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
-@code{@@setfilename} command. The shortened version of the original file
-continues to have the name specified by @code{@@setfilename}.@refill
-
-At one stage in writing this document, for example, the Info file was saved
-as @file{test-texinfo} and that file looked like this:@refill
-
-@example
-@group
-Info file: test-texinfo, -*-Text-*-
-produced by texinfo-format-buffer
-from file: new-texinfo-manual.texinfo
-
-^_
-Indirect:
-test-texinfo-1: 102
-test-texinfo-2: 50422
-@end group
-@group
-test-texinfo-3: 101300
-^_^L
-Tag table:
-(Indirect)
-Node: overview^?104
-Node: info file^?1271
-@end group
-@group
-Node: printed manual^?4853
-Node: conventions^?6855
-@dots{}
-@end group
-@end example
-
-@noindent
-(But @file{test-texinfo} had far more nodes than are shown here.) Each of
-the split off, indirect files, @file{test-texinfo-1},
-@file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
-after the line that says @samp{Indirect:}. The tag table is listed after
-the line that says @samp{Tag table:}. @refill
-
-In the list of indirect files, the number following the file name
-records the cumulative number of bytes in the preceding indirect files,
-not counting the file list itself, the tag table, or the permissions
-text in each file. In the tag table, the number following the node name
-records the location of the beginning of the node, in bytes from the
-beginning.@refill
-
-If you are using @code{texinfo-format-buffer} to create Info files,
-you may want to run the @code{Info-validate} command. (The
-@code{makeinfo} command does such a good job on its own, you do not
-need @code{Info-validate}.) However, you cannot run the @kbd{M-x
-Info-validate} node-checking command on indirect files. For
-information on how to prevent files from being split and how to
-validate the structure of the nodes, see @ref{Using
-Info-validate}.@refill
-
-
-@node Install an Info File, Command List, Create an Info File, Top
-@comment node-name, next, previous, up
-@chapter Installing an Info File
-@cindex Installing an Info file
-@cindex Info file installation
-@cindex @file{dir} directory for Info installation
-
-Info files are usually kept in the @file{info} directory. You can read
-Info files using the standalone Info program or the Info reader built
-into Emacs. (@inforef{Top, info, info}, for an introduction to Info.)
-
-@menu
-* Directory file:: The top level menu for all Info files.
-* New Info File:: Listing a new info file.
-* Other Info Directories:: How to specify Info files that are
- located in other directories.
-* Installing Dir Entries:: How to specify what menu entry to add
- to the Info directory.
-* Invoking install-info:: @code{install-info} options.
-@end menu
-
-@node Directory file, New Info File, Install an Info File, Install an Info File
-@ifinfo
-@heading The @file{dir} File
-@end ifinfo
-
-For Info to work, the @file{info} directory must contain a file that
-serves as a top level directory for the Info system. By convention,
-this file is called @file{dir}. (You can find the location of this file
-within Emacs by typing @kbd{C-h i} to enter Info and then typing
-@kbd{C-x C-f} to see the pathname to the @file{info} directory.)
-
-The @file{dir} file is itself an Info file. It contains the top level
-menu for all the Info files in the system. The menu looks like
-this:@refill
-
-@example
-@group
-* Menu:
-
-* Info: (info). Documentation browsing system.
-* Emacs: (emacs). The extensible, self-documenting
- text editor.
-* Texinfo: (texinfo). With one source file, make
- either a printed manual using
- TeX or an Info file.
-@dots{}
-@end group
-@end example
-
-Each of these menu entries points to the `Top' node of the Info file
-that is named in parentheses. (The menu entry does not need to
-specify the `Top' node, since Info goes to the `Top' node if no node
-name is mentioned. @xref{Other Info Files, , Nodes in Other Info
-Files}.)@refill
-
-Thus, the @samp{Info} entry points to the `Top' node of the
-@file{info} file and the @samp{Emacs} entry points to the `Top' node
-of the @file{emacs} file.@refill
-
-In each of the Info files, the `Up' pointer of the `Top' node refers
-back to the @code{dir} file. For example, the line for the `Top'
-node of the Emacs manual looks like this in Info:@refill
-
-@example
-File: emacs Node: Top, Up: (DIR), Next: Distrib
-@end example
-
-@noindent
-(Note that in this case, the @file{dir} file name is written in upper
-case letters---it can be written in either upper or lower case. Info
-has a feature that it will change the case of the file name to lower
-case if it cannot find the name as written.)@refill
-@c !!! Can any file name be written in upper or lower case,
-@c or is dir a special case?
-@c Yes, apparently so, at least with Gillespie's Info. --rjc 24mar92
-
-
-@node New Info File, Other Info Directories, Directory file, Install an Info File
-@section Listing a New Info File
-@cindex Adding a new info file
-@cindex Listing a new info file
-@cindex New info file, listing it in @file{dir} file
-@cindex Info file, listing new one
-@cindex @file{dir} file listing
-
-To add a new Info file to your system, you must write a menu entry to
-add to the menu in the @file{dir} file in the @file{info} directory.
-For example, if you were adding documentation for GDB, you would write
-the following new entry:@refill
-
-@example
-* GDB: (gdb). The source-level C debugger.
-@end example
-
-@noindent
-The first part of the menu entry is the menu entry name, followed by a
-colon. The second part is the name of the Info file, in parentheses,
-followed by a period. The third part is the description.
-
-The name of an Info file often has a @file{.info} extension. Thus, the
-Info file for GDB might be called either @file{gdb} or @file{gdb.info}.
-The Info reader programs automatically try the file name both with and
-without @file{.info}; so it is better to avoid clutter and not to write
-@samp{.info} explicitly in the menu entry. For example, the GDB menu
-entry should use just @samp{gdb} for the file name, not @samp{gdb.info}.
-
-
-@node Other Info Directories, Installing Dir Entries, New Info File, Install an Info File
-@comment node-name, next, previous, up
-@section Info Files in Other Directories
-@cindex Installing Info in another directory
-@cindex Info installed in another directory
-@cindex Another Info directory
-
-If an Info file is not in the @file{info} directory, there are three
-ways to specify its location:@refill
-
-@itemize @bullet
-@item
-Write the pathname in the @file{dir} file as the second part of the
-menu.@refill
-
-@item
-If you are using Emacs, list the name of the file in a second @file{dir}
-file, in its directory; and then add the name of that directory to the
-@code{Info-directory-list} variable in your personal or site
-initialization file.
-
-This tells Emacs where to look for @file{dir} files. Emacs merges the
-files named @file{dir} from each of the listed directories. (In Emacs
-version 18, you can set the @code{Info-directory} variable to the name
-of only one directory.)@refill
-
-@item
-Specify the Info directory name in the @code{INFOPATH} environment
-variable in your @file{.profile} or @file{.cshrc} initialization file.
-(Only you and others who set this environment variable will be able to
-find Info files whose location is specified this way.)@refill
-@end itemize
-
-For example, to reach a test file in the @file{/home/bob/manuals}
-directory, you could add an entry like this to the menu in the
-@file{dir} file:@refill
-
-@example
-* Test: (/home/bob/manuals/info-test). Bob's own test file.
-@end example
-
-@noindent
-In this case, the absolute file name of the @file{info-test} file is
-written as the second part of the menu entry.@refill
-
-@vindex Info-directory-list
-Alternatively, you could write the following in your @file{.emacs}
-file:@refill
-
-@example
-@group
-(setq Info-directory-list
- '("/home/bob/manuals"
- "/usr/local/info"))
-@end group
-@end example
-
-@c reworded to avoid overfill hbox
-This tells Emacs to merge the @file{dir} file from the
-@file{/home/bob/manuals} directory with the @file{dir} file from the
-@file{/usr/local/info} directory. Info will list the
-@file{/home/bob/manuals/info-test} file as a menu entry in the
-@file{/home/bob/manuals/dir} file.@refill
-
-@vindex INFOPATH
-Finally, you can tell Info where to look by setting the @code{INFOPATH}
-environment variable in your @file{.cshrc} or @file{.profile} file. If
-you use a Bourne-compatible shell such as @code{sh} or @code{bash} for
-your shell command interpreter, you set the @code{INFOPATH} environment
-variable in the @file{.profile} initialization file; but if you use
-@code{csh} or @code{tcsh}, you must set the variable in the
-@file{.cshrc} initialization file. The two types of shells use
-different syntax.
-
-@itemize @bullet
-@item
-In a @file{.cshrc} file, you could set the @code{INFOPATH}
-variable as follows:@refill
-
-@smallexample
-setenv INFOPATH .:~/manuals:/usr/local/emacs/info
-@end smallexample
-
-@item
-In a @file{.profile} file, you would achieve the same effect by
-writing:@refill
-
-@smallexample
-INFOPATH=.:$HOME/manuals:/usr/local/emacs/info
-export INFOPATH
-@end smallexample
-@end itemize
-
-@noindent
-The @samp{.} indicates the current directory as usual. Emacs uses the
-@code{INFOPATH} environment variable to initialize the value of Emacs's
-own @code{Info-directory-list} variable.
-
-@cindex @samp{:} @r{last in @code{INFOPATH}}
-However you set @code{INFOPATH}, if its last character is a colon, this
-is replaced by the default (compiled-in) path. This gives you a way to
-augment the default path with new directories without having to list all
-the standard places. For example (using @code{sh} syntax:
-
-@example
-INFOPATH=/local/info:
-export INFOPATH
-@end example
-
-@noindent
-will search @file{/local/info} first, then the standard directories.
-Leading or doubled colons are not treated specially.
-
-
-@node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File
-@section Installing Info Directory Files
-
-When you install an Info file onto your system, you can use the program
-@code{install-info} to update the Info directory file @file{dir}.
-Normally the makefile for the package runs @code{install-info}, just
-after copying the Info file into its proper installed location.
-
-@findex dircategory
-@findex direntry
-In order for the Info file to work with @code{install-info}, you should
-use the commands @code{@@dircategory} and @code{@@direntry} in the
-Texinfo source file. Use @code{@@direntry} to specify the menu entry to
-add to the Info directory file, and use @code{@@dircategory} to specify
-which part of the Info directory to put it in. Here is how these
-commands are used in this manual:
-
-@smallexample
-@@dircategory Texinfo documentation system
-@@direntry
-* Texinfo: (texinfo). The GNU documentation format.
-* install-info: (texinfo)Invoking install-info. @dots{}
-@dots{}
-@@end direntry
-@end smallexample
-
-Here's what this produces in the Info file:
-
-@smallexample
-INFO-DIR-SECTION Texinfo documentation system
-START-INFO-DIR-ENTRY
-* Texinfo: (texinfo). The GNU documentation format.
-* install-info: (texinfo)Invoking install-info. @dots{}
-@dots{}
-END-INFO-DIR-ENTRY
-@end smallexample
-
-@noindent
-The @code{install-info} program sees these lines in the Info file, and
-that is how it knows what to do.
-
-Always use the @code{@@direntry} and @code{@@dircategory} commands near
-the beginning of the Texinfo input, before the first @code{@@node}
-command. If you use them later on in the input, @code{install-info}
-will not notice them.
-
-If you use @code{@@dircategory} more than once in the Texinfo source,
-each usage specifies one category; the new menu entry is added to the
-Info directory file in each of the categories you specify. If you use
-@code{@@direntry} more than once, each usage specifies one menu entry;
-each of these menu entries is added to the directory in each of the
-specified categories.
-
-
-@node Invoking install-info, , Installing Dir Entries, Install an Info File
-@section Invoking install-info
-
-@pindex install-info
-
-@code{install-info} inserts menu entries from an Info file into the
-top-level @file{dir} file in the Info system (see the previous sections
-for an explanation of how the @file{dir} file works). It's most often
-run as part of software installation, or when constructing a dir file
-for all manuals on a system. Synopsis:
-
-@example
-install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]]
-@end example
-
-If @var{info-file} or @var{dir-file} are not specified, the various
-options (described below) that define them must be. There are no
-compile-time defaults, and standard input is never used.
-@code{install-info} can read only one info file and write only one dir
-file per invocation.
-
-@cindex @file{dir}, created by @code{install-info}
-If @var{dir-file} (however specified) does not exist,
-@code{install-info} creates it if possible (with no entries).
-
-Options:
-
-@table @code
-@item --delete
-@opindex --delete
-Delete the entries in @var{info-file} from @var{dir-file}. The file
-name in the entry in @var{dir-file} must be @var{info-file} (except for
-an optional @samp{.info} in either one). Don't insert any new entries.
-
-@item --dir-file=@var{name}
-@opindex --dir-file=@var{name}
-Specify file name of the Info directory file. This is equivalent to
-using the @var{dir-file} argument.
-
-@item --entry=@var{text}
-@opindex --entry=@var{text}
-Insert @var{text} as an Info directory entry; @var{text} should have the
-form of an Info menu item line plus zero or more extra lines starting
-with whitespace. If you specify more than one entry, they are all
-added. If you don't specify any entries, they are determined from
-information in the Info file itself.
-
-@item --help
-@opindex --help
-Display a usage message listing basic usage and all available options,
-then exit successfully.
-
-@item --info-file=@var{file}
-@opindex --info-file=@var{file}
-Specify Info file to install in the directory.
-This is equivalent to using the @var{info-file} argument.
-
-@item --info-dir=@var{dir}
-@opindex --info-dir=@var{dir}
-Equivalent to @samp{--dir-file=@var{dir}/dir}.
-
-@item --item=@var{text}
-@opindex --item=@var{text}
-Same as @samp{--entry=@var{text}}. An Info directory entry is actually
-a menu item.
-
-@item --quiet
-@opindex --quiet
-Suppress warnings.
-
-@item --remove
-@opindex --remove
-Same as @samp{--delete}.
-
-@item --section=@var{sec}
-@opindex --section=@var{sec}
-Put this file's entries in section @var{sec} of the directory. If you
-specify more than one section, all the entries are added in each of the
-sections. If you don't specify any sections, they are determined from
-information in the Info file itself.
-
-@item --version
-@opindex --version
-@cindex version number, finding
-Display version information and exit successfully.
-
-@end table
-
-
-@node Command List, Tips, Install an Info File, Top
-@appendix @@-Command List
-@cindex Alphabetical @@-command list
-@cindex List of @@-commands
-@cindex @@-command list
-
-Here is an alphabetical list of the @@-commands in Texinfo. Square
-brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
-@samp{@dots{}}, indicates repeated text.@refill
-
-@sp 1
-@table @code
-@item @@@var{whitespace}
-An @code{@@} followed by a space, tab, or newline produces a normal,
-stretchable, interword space. @xref{Multiple Spaces}.
-
-@item @@!
-Generate an exclamation point that really does end a sentence (usually
-after an end-of-sentence capital letter). @xref{Ending a Sentence}.
-
-@item @@"
-@itemx @@'
-Generate an umlaut or acute accent, respectively, over the next
-character, as in @"o and @'o. @xref{Inserting Accents}.
-
-@item @@*
-Force a line break. Do not end a paragraph that uses @code{@@*} with
-an @code{@@refill} command. @xref{Line Breaks}.@refill
-
-@item @@,@{@var{c}@}
-Generate a cedilla accent under @var{c}, as in @,{c}. @xref{Inserting
-Accents}.
-
-@item @@-
-Insert a discretionary hyphenation point. @xref{- and hyphenation}.
-
-@item @@.
-Produce a period that really does end a sentence (usually after an
-end-of-sentence capital letter). @xref{Ending a Sentence}.
-
-@item @@:
-Indicate to @TeX{} that an immediately preceding period, question
-mark, exclamation mark, or colon does not end a sentence. Prevent
-@TeX{} from inserting extra whitespace as it does at the end of a
-sentence. The command has no effect on the Info file output.
-@xref{Not Ending a Sentence}.@refill
-
-@item @@=
-Generate a macro (bar) accent over the next character, as in @=o.
-@xref{Inserting Accents}.
-
-@item @@?
-Generate a question mark that really does end a sentence (usually after
-an end-of-sentence capital letter). @xref{Ending a Sentence}.
-
-@item @@@@
-Stands for an at sign, @samp{@@}.
-@xref{Braces Atsigns, , Inserting @@ and braces}.
-
-@item @@^
-@itemx @@`
-Generate a circumflex (hat) or grave accent, respectively, over the next
-character, as in @^o.
-@xref{Inserting Accents}.
-
-@item @@@{
-Stands for a left brace, @samp{@{}.
-@xref{Braces Atsigns, , Inserting @@ and braces}.
-
-@item @@@}
-Stands for a right-hand brace, @samp{@}}.@*
-@xref{Braces Atsigns, , Inserting @@ and braces}.
-
-@item @@=
-Generate a tilde accent over the next character, as in @~N.
-@xref{Inserting Accents}.
-
-@item @@AA@{@}
-@itemx @@aa@{@}
-Generate the uppercase and lowercase Scandinavian A-ring letters,
-respectively: @AA{}, @aa{}. @xref{Inserting Accents}.
-
-@item @@AE@{@}
-@itemx @@ae@{@}
-Generate the uppercase and lowercase AE ligatures, respectively:
-@AE{}, @ae{}. @xref{Inserting Accents}.
-
-@item @@afourpaper
-Change page dimensions for the A4 paper size.
-Only allowed inside @code{@@iftex} @dots{} @code{@@end iftex}.
-@xref{A4 Paper}.
-
-@item @@appendix @var{title}
-Begin an appendix. The title appears in the table
-of contents of a printed manual. In Info, the title is
-underlined with asterisks. @xref{unnumbered & appendix, , The
-@code{@@unnumbered} and @code{@@appendix} Commands}.@refill
-
-@item @@appendixsec @var{title}
-@itemx @@appendixsection @var{title}
-Begin an appendix section within an appendix. The section title appears
-in the table of contents of a printed manual. In Info, the title is
-underlined with equal signs. @code{@@appendixsection} is a longer
-spelling of the @code{@@appendixsec} command. @xref{unnumberedsec
-appendixsec heading, , Section Commands}.@refill
-
-@item @@appendixsubsec @var{title}
-Begin an appendix subsection within an appendix. The title appears
-in the table of contents of a printed manual. In Info, the title is
-underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
-subheading, , Subsection Commands}.@refill
-
-@item @@appendixsubsubsec @var{title}
-Begin an appendix subsubsection within an appendix subsection. The
-title appears in the table of contents of a printed manual. In Info,
-the title is underlined with periods. @xref{subsubsection,, The
-`subsub' Commands}.@refill
-
-@item @@asis
-Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
-print the table's first column without highlighting (``as is'').
-@xref{Two-column Tables, , Making a Two-column Table}.@refill
-
-@item @@author @var{author}
-Typeset @var{author} flushleft and underline it. @xref{title
-subtitle author, , The @code{@@title} and @code{@@author}
-Commands}.@refill
-
-@item @@b@{@var{text}@}
-Print @var{text} in @b{bold} font. No effect in Info. @xref{Fonts}.@refill
-
-@ignore
-@item @@br
-Force a paragraph break. If used within a line, follow @code{@@br}
-with braces. @xref{br, , @code{@@br}}.@refill
-@end ignore
-
-@item @@bullet@{@}
-Generate a large round dot, or the closest possible
-thing to one. @xref{bullet, , @code{@@bullet}}.@refill
-
-@item @@bye
-Stop formatting a file. The formatters do not see the contents of a
-file following an @code{@@bye} command. @xref{Ending a File}.@refill
-
-@item @@c @var{comment}
-Begin a comment in Texinfo. The rest of the line does not appear in
-either the Info file or the printed manual. A synonym for
-@code{@@comment}. @xref{Comments, , Comments}.@refill
-
-@item @@cartouche
-Highlight an example or quotation by drawing a box with rounded
-corners around it. Pair with @code{@@end cartouche}. No effect in
-Info. @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill
-
-@item @@center @var{line-of-text}
-Center the line of text following the command.
-@xref{titlefont center sp, , @code{@@center}}.@refill
-
-@item @@centerchap @var{line-of-text}
-Like @code{@@chapter}, but centers the chapter title. @xref{chapter,,
-@code{@@chapter}}.
-
-@item @@chapheading @var{title}
-Print a chapter-like heading in the text, but not in the table of
-contents of a printed manual. In Info, the title is underlined with
-asterisks. @xref{majorheading & chapheading, , @code{@@majorheading}
-and @code{@@chapheading}}.@refill
-
-@item @@chapter @var{title}
-Begin a chapter. The chapter title appears in the table of
-contents of a printed manual. In Info, the title is underlined with
-asterisks. @xref{chapter, , @code{@@chapter}}.@refill
-
-@item @@cindex @var{entry}
-Add @var{entry} to the index of concepts. @xref{Index Entries, ,
-Defining the Entries of an Index}.@refill
-
-@item @@cite@{@var{reference}@}
-Highlight the name of a book or other reference that lacks a
-companion Info file. @xref{cite, , @code{@@cite}}.@refill
-
-@item @@clear @var{flag}
-Unset @var{flag}, preventing the Texinfo formatting commands from
-formatting text between subsequent pairs of @code{@@ifset @var{flag}}
-and @code{@@end ifset} commands, and preventing
-@code{@@value@{@var{flag}@}} from expanding to the value to which
-@var{flag} is set.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@item @@code@{@var{sample-code}@}
-Highlight text that is an expression, a syntactically complete token
-of a program, or a program name. @xref{code, , @code{@@code}}.@refill
-
-@item @@comment @var{comment}
-Begin a comment in Texinfo. The rest of the line does not appear in
-either the Info file or the printed manual. A synonym for @code{@@c}.
-@xref{Comments, , Comments}.@refill
-
-@item @@contents
-Print a complete table of contents. Has no effect in Info, which uses
-menus instead. @xref{Contents, , Generating a Table of
-Contents}.@refill
-
-@item @@copyright@{@}
-Generate a copyright symbol. @xref{copyright symbol, ,
-@code{@@copyright}}.@refill
-
-@ignore
-@item @@ctrl@{@var{ctrl-char}@}
-Describe an @sc{ascii} control character. Insert actual control character
-into Info file. @xref{ctrl, , @code{@@ctrl}}.@refill
-@end ignore
-
-@item @@defcodeindex @var{index-name}
-Define a new index and its indexing command. Print entries in an
-@code{@@code} font. @xref{New Indices, , Defining New
-Indices}.@refill
-
-@item @@defcv @var{category} @var{class} @var{name}
-@itemx @@defcvx @var{category} @var{class} @var{name}
-Format a description for a variable associated with a class in
-object-oriented programming. Takes three arguments: the category of
-thing being defined, the class to which it belongs, and its name.
-@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
-@itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{}
-Format a description for a function, interactive command, or similar
-entity that may take arguments. @code{@@deffn} takes as arguments the
-category of entity being described, the name of this particular
-entity, and its arguments, if any. @xref{Definition Commands}.@refill
-
-@item @@defindex @var{index-name}
-Define a new index and its indexing command. Print entries in a roman
-font. @xref{New Indices, , Defining New Indices}.@refill
-
-@c Unused so far as I can see and unsupported by makeinfo -- karl, 15sep96.
-@item @@definfoenclose @var{new-command}, @var{before}, @var{after},
-Create new @@-command for Info that marks text by enclosing it in
-strings that precede and follow the text. Write definition inside of
-@code{@@ifinfo} @dots{} @code{@@end ifinfo}. @xref{Customized
-Highlighting}.@refill
-
-@item @@defivar @var{class} @var{instance-variable-name}
-@itemx @@defivarx @var{class} @var{instance-variable-name}
-This command formats a description for an instance variable in
-object-oriented programming. The command is equivalent to @samp{@@defcv
-@{Instance Variable@} @dots{}}. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defmac @var{macro-name} @var{arguments}@dots{}
-@itemx @@defmacx @var{macro-name} @var{arguments}@dots{}
-Format a description for a macro. The command is equivalent to
-@samp{@@deffn Macro @dots{}}. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
-@itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{}
-Format a description for a method in object-oriented programming. The
-command is equivalent to @samp{@@defop Method @dots{}}. Takes as
-arguments the name of the class of the method, the name of the
-method, and its arguments, if any. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
-@itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{}
-Format a description for an operation in object-oriented programming.
-@code{@@defop} takes as arguments the overall name of the category of
-operation, the name of the class of the operation, the name of the
-operation, and its arguments, if any. @xref{Definition
-Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defopt @var{option-name}
-@itemx @@defoptx @var{option-name}
-Format a description for a user option. The command is equivalent to
-@samp{@@defvr @{User Option@} @dots{}}. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defspec @var{special-form-name} @var{arguments}@dots{}
-@itemx @@defspecx @var{special-form-name} @var{arguments}@dots{}
-Format a description for a special form. The command is equivalent to
-@samp{@@deffn @{Special Form@} @dots{}}. @xref{Definition Commands},
-and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
-@itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{}
-Format a description for a data type. @code{@@deftp} takes as arguments
-the category, the name of the type (which is a word like @samp{int} or
-@samp{float}), and then the names of attributes of objects of that type.
-@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
-@itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
-Format a description for a function or similar entity that may take
-arguments and that is typed. @code{@@deftypefn} takes as arguments the
-classification of entity being described, the type, the name of the
-entity, and its arguments, if any. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
-@itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
-Format a description for a function in a typed language.
-The command is equivalent to @samp{@@deftypefn Function @dots{}}.
-@xref{Definition Commands},
-and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deftypemethod @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
-@itemx @@deftypemethodx @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
-Format a description for a typed method in object-oriented programming.
-Takes as arguments the name of the class of the method, the return type
-of the method, the name of the method, and its arguments, if any.
-@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@deftypevr @var{classification} @var{data-type} @var{name}
-@itemx @@deftypevrx @var{classification} @var{data-type} @var{name}
-Format a description for something like a variable in a typed
-language---an entity that records a value. Takes as arguments the
-classification of entity being described, the type, and the name of the
-entity. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in
-Detail}.
-
-@item @@deftypevar @var{data-type} @var{variable-name}
-@itemx @@deftypevarx @var{data-type} @var{variable-name}
-Format a description for a variable in a typed language. The command is
-equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
-Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defun @var{function-name} @var{arguments}@dots{}
-@itemx @@defunx @var{function-name} @var{arguments}@dots{}
-Format a description for functions. The command is equivalent to
-@samp{@@deffn Function @dots{}}. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defvar @var{variable-name}
-@itemx @@defvarx @var{variable-name}
-Format a description for variables. The command is equivalent to
-@samp{@@defvr Variable @dots{}}. @xref{Definition Commands}, and
-@ref{deffnx,, Def Cmds in Detail}.
-
-@item @@defvr @var{category} @var{name}
-@itemx @@defvrx @var{category} @var{name}
-Format a description for any kind of variable. @code{@@defvr} takes
-as arguments the category of the entity and the name of the entity.
-@xref{Definition Commands},
-and @ref{deffnx,, Def Cmds in Detail}.
-
-@item @@detailmenu@{@}
-Avoid @code{makeinfo} confusion stemming from the detailed node listing
-in a master menu. @xref{Master Menu Parts}.
-
-@item @@dfn@{@var{term}@}
-Highlight the introductory or defining use of a term.
-@xref{dfn, , @code{@@dfn}}.@refill
-
-@item @@dircategory @var{dirpart}
-Specify a part of the Info directory menu where this file's entry should
-go. @xref{Installing Dir Entries}.
-
-@item @@direntry
-Begin the Info directory menu entry for this file.
-@xref{Installing Dir Entries}.
-
-@need 100
-@item @@display
-Begin a kind of example. Indent text, do not fill, do not select a
-new font. Pair with @code{@@end display}. @xref{display, ,
-@code{@@display}}.@refill
-
-@item @@dmn@{@var{dimension}@}
-Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a
-thin space before @var{dimension}. No effect in Info.
-@xref{dmn, , @code{@@dmn}}.@refill
-
-@item @@dotaccent@{@var{c}@}
-Generate a dot accent over the character @var{c}, as in @dotaccent{oo}.
-@xref{Inserting Accents}.
-
-@item @@dots@{@}
-Insert an ellipsis: @samp{@dots{}}.
-@xref{dots, , @code{@@dots}}.@refill
-
-@item @@email@{@var{address}[, @var{displayed-text}]@}
-Indicate an electronic mail address.
-@xref{email, , @code{@@email}}.@refill
-
-@need 100
-@item @@emph@{@var{text}@}
-Highlight @var{text}; text is displayed in @emph{italics} in printed
-output, and surrounded by asterisks in Info. @xref{Emphasis, ,
-Emphasizing Text}.
-
-@item @@end @var{environment}
-Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting
-Commands,,@@-commands}.
-
-@item @@enddots@{@}
-Generate an end-of-sentence of ellipsis, like this @enddots{}
-@xref{dots,,@code{@@dots@{@}}}.
-
-@need 100
-@item @@enumerate [@var{number-or-letter}]
-Begin a numbered list, using @code{@@item} for each entry.
-Optionally, start list with @var{number-or-letter}. Pair with
-@code{@@end enumerate}. @xref{enumerate, ,
-@code{@@enumerate}}.@refill
-
-@need 100
-@item @@equiv@{@}
-Indicate to the reader the exact equivalence of two forms with a
-glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill
-
-@item @@error@{@}
-Indicate to the reader with a glyph that the following text is
-an error message: @samp{@error{}}. @xref{Error Glyph}.@refill
-
-@item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
-@itemx @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
-Specify page footings resp.@: headings for even-numbered (left-hand)
-pages. Only allowed inside @code{@@iftex}. @xref{Custom Headings, ,
-How to Make Your Own Headings}.@refill
-
-@item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
-@itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
-Specify page footings resp.@: headings for every page. Not relevant to
-Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
-
-@item @@example
-Begin an example. Indent text, do not fill, and select fixed-width font.
-Pair with @code{@@end example}. @xref{example, ,
-@code{@@example}}.@refill
-
-@item @@exclamdown@{@}
-Produce an upside-down exclamation point. @xref{Inserting Accents}.
-
-@item @@exdent @var{line-of-text}
-Remove any indentation a line might have. @xref{exdent, ,
-Undoing the Indentation of a Line}.@refill
-
-@item @@expansion@{@}
-Indicate the result of a macro expansion to the reader with a special
-glyph: @samp{@expansion{}}.
-@xref{expansion, , @expansion{} Indicating an Expansion}.@refill
-
-@item @@file@{@var{filename}@}
-Highlight the name of a file, buffer, node, or directory. @xref{file, ,
-@code{@@file}}.@refill
-
-@item @@finalout
-Prevent @TeX{} from printing large black warning rectangles beside
-over-wide lines. @xref{Overfull hboxes}.@refill
-
-@need 100
-@item @@findex @var{entry}
-Add @var{entry} to the index of functions. @xref{Index Entries, ,
-Defining the Entries of an Index}.@refill
-
-@need 200
-@item @@flushleft
-@itemx @@flushright
-Left justify every line but leave the right end ragged.
-Leave font as is. Pair with @code{@@end flushleft}.
-@code{@@flushright} analogous.
-@xref{flushleft & flushright, , @code{@@flushleft} and
-@code{@@flushright}}.@refill
-
-@need 200
-@item @@footnote@{@var{text-of-footnote}@}
-Enter a footnote. Footnote text is printed at the bottom of the page
-by @TeX{}; Info may format in either `End' node or `Separate' node style.
-@xref{Footnotes}.@refill
-
-@item @@footnotestyle @var{style}
-Specify an Info file's footnote style, either @samp{end} for the end
-node style or @samp{separate} for the separate node style.
-@xref{Footnotes}.@refill
-
-@item @@format
-Begin a kind of example. Like @code{@@example} or @code{@@display},
-but do not narrow the margins and do not select the fixed-width font.
-Pair with @code{@@end format}. @xref{example, ,
-@code{@@example}}.@refill
-
-@item @@ftable @var{formatting-command}
-Begin a two-column table, using @code{@@item} for each entry.
-Automatically enter each of the items in the first column into the
-index of functions. Pair with @code{@@end ftable}. The same as
-@code{@@table}, except for indexing. @xref{ftable vtable, ,
-@code{@@ftable} and @code{@@vtable}}.@refill
-
-@item @@group
-Hold text together that must appear on one printed page. Pair with
-@code{@@end group}. Not relevant to Info. @xref{group, ,
-@code{@@group}}.@refill
-
-@item @@H@{@var{c}@}
-Generate the long Hungarian umlaut accent over @var{c}, as in @H{o}.
-
-@item @@heading @var{title}
-Print an unnumbered section-like heading in the text, but not in the
-table of contents of a printed manual. In Info, the title is
-underlined with equal signs. @xref{unnumberedsec appendixsec heading,
-, Section Commands}.@refill
-
-@item @@headings @var{on-off-single-double}
-Turn page headings on or off, and/or specify single-sided or double-sided
-page headings for printing. @xref{headings on off, , The
-@code{@@headings} Command}.
-
-@item @@html
-Enter HTML completely. Pair with @code{@@end html}. @xref{Raw
-Formatter Commands}.
-
-@item @@hyphenation@{@var{hy-phen-a-ted words}@}
-Explicitly define hyphenation points. @xref{- and hyphenation,,
-@code{@@-} and @code{@@hyphenation}}.
-
-@item @@i@{@var{text}@}
-Print @var{text} in @i{italic} font. No effect in Info.
-@xref{Fonts}.@refill
-
-@item @@ifclear @var{flag}
-If @var{flag} is cleared, the Texinfo formatting commands format text
-between @code{@@ifclear @var{flag}} and the following @code{@@end
-ifclear} command.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@item @@ifhtml
-@itemx @@ifinfo
-Begin a stretch of text that will be ignored by @TeX{} when it typesets
-the printed manual. The text appears only in the HTML resp.@: Info
-file. Pair with @code{@@end ifhtml} resp.@: @code{@@end ifinfo}.
-@xref{Conditionals}.
-
-@item @@ifnothtml
-@itemx @@ifnotinfo
-@itemx @@ifnottex
-Begin a stretch of text that will be ignored in one output format but
-not the others. The text appears only in the format not specified.
-Pair with @code{@@end ifnothtml} resp.@: @code{@@end ifnotinfo} resp.@:
-@code{@@end ifnotinfo}. @xref{Conditionals}.
-
-@item @@ifset @var{flag}
-If @var{flag} is set, the Texinfo formatting commands format text
-between @code{@@ifset @var{flag}} and the following @code{@@end ifset}
-command.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@item @@iftex
-Begin a stretch of text that will not appear in the Info file, but
-will be processed only by @TeX{}. Pair with @code{@@end iftex}.
-@xref{Conditionals, , Conditionally Visible Text}.@refill
-
-@item @@ignore
-Begin a stretch of text that will not appear in either the Info file
-or the printed output. Pair with @code{@@end ignore}.
-@xref{Comments, , Comments and Ignored Text}.@refill
-
-@item @@image@{@var{filename}, [@var{width}], [@var{height}]@}
-Include graphics image in external @var{filename} scaled to the given
-@var{width} and/or @var{height}. @xref{Images}.
-
-@item @@include @var{filename}
-Incorporate the contents of the file @var{filename} into the Info file
-or printed document. @xref{Include Files}.@refill
-
-@item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
-Make a cross reference to an Info file for which there is no printed
-manual. @xref{inforef, , Cross references using
-@code{@@inforef}}.@refill
-
-@item \input @var{macro-definitions-file}
-Use the specified macro definitions file. This command is used only
-in the first line of a Texinfo file to cause @TeX{} to make use of the
-@file{texinfo} macro definitions file. The backslash in @code{\input}
-is used instead of an @code{@@} because @TeX{} does not
-recognize @code{@@} until after it has read the definitions file.
-@xref{Header, , The Texinfo File Header}.@refill
-
-@item @@item
-Indicate the beginning of a marked paragraph for @code{@@itemize} and
-@code{@@enumerate}; indicate the beginning of the text of a first column
-entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
-@xref{Lists and Tables}.@refill
-
-@item @@itemize @var{mark-generating-character-or-command}
-Produce a sequence of indented paragraphs, with a mark inside the left
-margin at the beginning of each paragraph. Pair with @code{@@end
-itemize}. @xref{itemize, , @code{@@itemize}}.@refill
-
-@item @@itemx
-Like @code{@@item} but do not generate extra vertical space above the
-item text. @xref{itemx, , @code{@@itemx}}.@refill
-
-@item @@kbd@{@var{keyboard-characters}@}
-Indicate text that is characters of input to be typed by
-users. @xref{kbd, , @code{@@kbd}}.@refill
-
-@item @@kbdinputstyle @var{style}
-Specify when @code{@@kbd} should use a font distinct from @code{@@code}.
-@xref{kbd, , @code{@@kbd}}.@refill
-
-@item @@key@{@var{key-name}@}
-Indicate a name for a key on a keyboard.
-@xref{key, , @code{@@key}}.@refill
-
-@item @@kindex @var{entry}
-Add @var{entry} to the index of keys.
-@xref{Index Entries, , Defining the Entries of an Index}.@refill
-
-@item @@L@{@}
-@itemx @@l@{@}
-Generate the uppercase and lowercase Polish suppressed-L letters,
-respectively: @L{}, @l{}.
-
-@c Possibly this can be tossed now that we have macros. --karl, 16sep96.
-@c Yes, let's toss it, it's pretty weird. --karl, 15jun97.
-@c @item @@global@@let@var{new-command}=@var{existing-command}
-@c Equate a new highlighting command with an existing one. Only for
-@c @TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end
-@c iftex}. @xref{Customized Highlighting}.@refill
-
-@item @@lisp
-Begin an example of Lisp code. Indent text, do not fill, and select
-fixed-width font. Pair with @code{@@end lisp}. @xref{Lisp Example, ,
-@code{@@lisp}}.@refill
-
-@item @@lowersections
-Change subsequent chapters to sections, sections to subsections, and so
-on. @xref{Raise/lower sections, , @code{@@raisesections} and
-@code{@@lowersections}}.@refill
-
-@item @@macro @var{macro-name} @{@var{params}@}
-Define a new Texinfo command @code{@@@var{macro-name}@{@var{params}@}}.
-Only supported by @code{makeinfo} and @code{texi2dvi}. @xref{Defining
-Macros}.
-
-@item @@majorheading @var{title}
-Print a chapter-like heading in the text, but not in the table of
-contents of a printed manual. Generate more vertical whitespace before
-the heading than the @code{@@chapheading} command. In Info, the chapter
-heading line is underlined with asterisks. @xref{majorheading &
-chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill
-
-@item @@math@{@var{mathematical-expression}@}
-Format a mathematical expression.
-@xref{math, , @code{@@math}: Inserting Mathematical Expressions}.
-
-@item @@menu
-Mark the beginning of a menu of nodes in Info. No effect in a printed
-manual. Pair with @code{@@end menu}. @xref{Menus}.@refill
-
-@item @@minus@{@}
-Generate a minus sign, `@minus{}'. @xref{minus, , @code{@@minus}}.@refill
-
-@item @@multitable @var{column-width-spec}
-Begin a multi-column table. Pair with @code{@@end multitable}.
-@xref{Multitable Column Widths}.
-
-@item @@need @var{n}
-Start a new page in a printed manual if fewer than @var{n} mils
-(thousandths of an inch) remain on the current page. @xref{need, ,
-@code{@@need}}.@refill
-
-@item @@node @var{name, next, previous, up}
-Define the beginning of a new node in Info, and serve as a locator for
-references for @TeX{}. @xref{node, , @code{@@node}}.@refill
-
-@item @@noindent
-Prevent text from being indented as if it were a new paragraph.
-@xref{noindent, , @code{@@noindent}}.@refill
-
-@item @@O@{@}
-@itemx @@o@{@}
-Generate the uppercase and lowercase O-with-slash letters, respectively:
-@O{}, @o{}.
-
-@item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
-@itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
-Specify page footings resp.@: headings for odd-numbered (right-hand)
-pages. Only allowed inside @code{@@iftex}. @xref{Custom Headings, ,
-How to Make Your Own Headings}.@refill
-
-@item @@OE@{@}
-@itemx @@oe@{@}
-Generate the uppercase and lowercase OE ligatures, respectively:
-@OE{}, @oe{}. @xref{Inserting Accents}.
-
-@item @@page
-Start a new page in a printed manual. No effect in Info.
-@xref{page, , @code{@@page}}.@refill
-
-@item @@paragraphindent @var{indent}
-Indent paragraphs by @var{indent} number of spaces; delete indentation
-if the value of @var{indent} is 0; and do not change indentation if
-@var{indent} is @code{asis}. @xref{paragraphindent, , Paragraph
-Indenting}.@refill
-
-@item @@pindex @var{entry}
-Add @var{entry} to the index of programs. @xref{Index Entries, , Defining
-the Entries of an Index}.@refill
-
-@item @@point@{@}
-Indicate the position of point in a buffer to the reader with a
-glyph: @samp{@point{}}. @xref{Point Glyph, , Indicating
-Point in a Buffer}.@refill
-
-@item @@pounds@{@}
-Generate the pounds sterling currency sign.
-@xref{pounds,,@code{@@pounds@{@}}}.
-
-@item @@print@{@}
-Indicate printed output to the reader with a glyph:
-@samp{@print{}}. @xref{Print Glyph}.@refill
-
-@item @@printindex @var{index-name}
-Print an alphabetized two-column index in a printed manual or generate
-an alphabetized menu of index entries for Info. @xref{Printing
-Indices & Menus}.@refill
-
-@item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
-Make a reference that starts with a lower case `see' in a printed
-manual. Use within parentheses only. Do not follow command with a
-punctuation mark---the Info formatting commands automatically insert
-terminating punctuation as needed. Only the first argument is mandatory.
-@xref{pxref, , @code{@@pxref}}.@refill
-
-@item @@questiondown@{@}
-Generate an upside-down question mark. @xref{Inserting Accents}.
-
-@item @@quotation
-Narrow the margins to indicate text that is quoted from another real
-or imaginary work. Write command on a line of its own. Pair with
-@code{@@end quotation}. @xref{quotation, ,
-@code{@@quotation}}.@refill
-
-@need 100
-@item @@r@{@var{text}@}
-Print @var{text} in @r{roman} font. No effect in Info.
-@xref{Fonts}.@refill
-
-@item @@raisesections
-Change subsequent sections to chapters, subsections to sections, and so
-on. @xref{Raise/lower sections, , @code{@@raisesections} and
-@code{@@lowersections}}.@refill
-
-@need 300
-@item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
-Make a reference. In a printed manual, the reference does not start
-with a `See'. Follow command with a punctuation mark. Only the first
-argument is mandatory. @xref{ref, , @code{@@ref}}.@refill
-
-@need 300
-@item @@refill
-In Info, refill and indent the paragraph after all the other processing
-has been done. No effect on @TeX{}, which always refills. This command
-is no longer needed, since all formatters now automatically refill.
-@xref{Refilling Paragraphs}.@refill
-
-@need 300
-@item @@result@{@}
-Indicate the result of an expression to the reader with a special
-glyph: @samp{@result{}}. @xref{result, , @code{@@result}}.@refill
-
-@item @@ringaccent@{@var{c}@}
-Generate a ring accent over the next character, as in @ringaccent{o}.
-@xref{Inserting Accents}.
-
-@item @@samp@{@var{text}@}
-Highlight @var{text} that is a literal example of a sequence of
-characters. Used for single characters, for statements, and often for
-entire shell commands. @xref{samp, , @code{@@samp}}.@refill
-
-@item @@sc@{@var{text}@}
-Set @var{text} in a printed output in @sc{the small caps font} and
-set text in the Info file in uppercase letters.
-@xref{Smallcaps}.@refill
-
-@item @@section @var{title}
-Begin a section within a chapter. In a printed manual, the section
-title is numbered and appears in the table of contents. In Info, the
-title is underlined with equal signs. @xref{section, ,
-@code{@@section}}.@refill
-
-@item @@set @var{flag} [@var{string}]
-Make @var{flag} active, causing the Texinfo formatting commands to
-format text between subsequent pairs of @code{@@ifset @var{flag}} and
-@code{@@end ifset} commands. Optionally, set value of @var{flag} to
-@var{string}.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@item @@setchapternewpage @var{on-off-odd}
-Specify whether chapters start on new pages, and if so, whether on
-odd-numbered (right-hand) new pages. @xref{setchapternewpage, ,
-@code{@@setchapternewpage}}.@refill
-
-@item @@setfilename @var{info-file-name}
-Provide a name to be used by the Info file. This command is essential
-for @TeX{} formatting as well, even though it produces no output.
-@xref{setfilename, , @code{@@setfilename}}.@refill
-
-@item @@settitle @var{title}
-Provide a title for page headers in a printed manual.
-@xref{settitle, , @code{@@settitle}}.@refill
-
-@item @@shortcontents
-Print a short table of contents. Not relevant to Info, which uses
-menus rather than tables of contents. A synonym for
-@code{@@summarycontents}. @xref{Contents, , Generating a Table of
-Contents}.@refill
-
-@item @@shorttitlepage@{@var{title}@}
-Generate a minimal title page. @xref{titlepage,,@code{@@titlepage}}.
-
-@need 400
-@item @@smallbook
-Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
-rather than the regular 8.5 by 11 inch format. @xref{smallbook, ,
-Printing Small Books}. Also, see @ref{smallexample & smalllisp, ,
-@code{@@smallexample} and @code{@@smalllisp}}.@refill
-
-@need 400
-@item @@smallexample
-Indent text to indicate an example. Do not fill, select fixed-width
-font. In @code{@@smallbook} format, print text in a smaller font than
-with @code{@@example}. Pair with @code{@@end smallexample}.
-@xref{smallexample & smalllisp, , @code{@@smallexample} and
-@code{@@smalllisp}}.@refill
-
-@need 400
-@item @@smalllisp
-Begin an example of Lisp code. Indent text, do not fill, select
-fixed-width font. In @code{@@smallbook} format, print text in a
-smaller font. Pair with @code{@@end smalllisp}. @xref{smallexample &
-smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill
-
-@need 700
-@item @@sp @var{n}
-Skip @var{n} blank lines. @xref{sp, , @code{@@sp}}.@refill
-
-@item @@ss@{@}
-Generate the German sharp-S es-zet letter, @ss{}. @xref{Inserting Accents}.
-
-@need 700
-@item @@strong @var{text}
-Emphasize @var{text} by typesetting it in a @strong{bold} font for the
-printed manual and by surrounding it with asterisks for Info.
-@xref{emph & strong, , Emphasizing Text}.@refill
-
-@item @@subheading @var{title}
-Print an unnumbered subsection-like heading in the text, but not in
-the table of contents of a printed manual. In Info, the title is
-underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
-subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec}
-@code{@@subheading}}.@refill
-
-@item @@subsection @var{title}
-Begin a subsection within a section. In a printed manual, the
-subsection title is numbered and appears in the table of contents. In
-Info, the title is underlined with hyphens. @xref{subsection, ,
-@code{@@subsection}}.@refill
-
-@item @@subsubheading @var{title}
-Print an unnumbered subsubsection-like heading in the text, but not in
-the table of contents of a printed manual. In Info, the title is
-underlined with periods. @xref{subsubsection, , The `subsub'
-Commands}.@refill
-
-@item @@subsubsection @var{title}
-Begin a subsubsection within a subsection. In a printed manual,
-the subsubsection title is numbered and appears in the table of
-contents. In Info, the title is underlined with periods.
-@xref{subsubsection, , The `subsub' Commands}.@refill
-
-@item @@subtitle @var{title}
-In a printed manual, set a subtitle in a normal sized font flush to
-the right-hand side of the page. Not relevant to Info, which does not
-have title pages. @xref{title subtitle author, , @code{@@title}
-@code{@@subtitle} and @code{@@author} Commands}.@refill
-
-@item @@summarycontents
-Print a short table of contents. Not relevant to Info, which uses
-menus rather than tables of contents. A synonym for
-@code{@@shortcontents}. @xref{Contents, , Generating a Table of
-Contents}.@refill
-
-@need 300
-@item @@syncodeindex @var{from-index} @var{into-index}
-Merge the index named in the first argument into the index named in
-the second argument, printing the entries from the first index in
-@code{@@code} font. @xref{Combining Indices}.@refill
-
-@need 300
-@item @@synindex @var{from-index} @var{into-index}
-Merge the index named in the first argument into the index named in
-the second argument. Do not change the font of @var{from-index}
-entries. @xref{Combining Indices}.@refill
-
-@need 100
-@item @@t@{@var{text}@}
-Print @var{text} in a @t{fixed-width}, typewriter-like font.
-No effect in Info. @xref{Fonts}.@refill
-
-@item @@tab
-Separate columns in a multitable. @xref{Multitable Rows}.
-
-@need 400
-@item @@table @var{formatting-command}
-Begin a two-column table, using @code{@@item} for each entry. Write
-each first column entry on the same line as @code{@@item}. First
-column entries are printed in the font resulting from
-@var{formatting-command}. Pair with @code{@@end table}.
-@xref{Two-column Tables, , Making a Two-column Table}.
-Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}},
-and @ref{itemx, , @code{@@itemx}}.@refill
-
-@item @@TeX@{@}
-Insert the logo @TeX{}. @xref{TeX and copyright, , Inserting @TeX{}
-and @copyright{}}.@refill
-
-@item @@tex
-Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Raw
-Formatter Commands}.
-
-@item @@thischapter
-@itemx @@thischaptername
-@itemx @@thisfile
-@itemx @@thispage
-@itemx @@thistitle
-Only allowed in a heading or footing. Stands for the number and name of
-the current chapter (in the format `Chapter 1: Title'), the chapter name
-only, the filename, the current page number, and the title of the
-document, respectively. @xref{Custom Headings, , How to Make Your Own
-Headings}.@refill
-
-@item @@tieaccent@{@var{cc}@}
-Generate a tie-after accent over the next two characters @var{cc}, as in
-`@tieaccent{oo}'. @xref{Inserting Accents}.
-
-@item @@tindex @var{entry}
-Add @var{entry} to the index of data types. @xref{Index Entries, ,
-Defining the Entries of an Index}.@refill
-
-@item @@title @var{title}
-In a printed manual, set a title flush to the left-hand side of the
-page in a larger than normal font and underline it with a black rule.
-Not relevant to Info, which does not have title pages. @xref{title
-subtitle author, , The @code{@@title} @code{@@subtitle} and
-@code{@@author} Commands}.@refill
-
-@need 400
-@item @@titlefont@{@var{text}@}
-In a printed manual, print @var{text} in a larger than normal font.
-Not relevant to Info, which does not have title pages.
-@xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
-and @code{@@sp} Commands}.@refill
-
-@need 300
-@item @@titlepage
-Indicate to Texinfo the beginning of the title page. Write command on
-a line of its own. Pair with @code{@@end titlepage}. Nothing between
-@code{@@titlepage} and @code{@@end titlepage} appears in Info.
-@xref{titlepage, , @code{@@titlepage}}.@refill
-
-@need 150
-@item @@today@{@}
-Insert the current date, in `1 Jan 1900' style. @xref{Custom
-Headings, , How to Make Your Own Headings}.@refill
-
-@item @@top @var{title}
-In a Texinfo file to be formatted with @code{makeinfo}, identify the
-topmost @code{@@node} line in the file, which must be written on the line
-immediately preceding the @code{@@top} command. Used for
-@code{makeinfo}'s node pointer insertion feature. The title is
-underlined with asterisks. Both the @code{@@node} line and the @code{@@top}
-line normally should be enclosed by @code{@@ifinfo} and @code{@@end
-ifinfo}. In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
-command is merely a synonym for @code{@@unnumbered}. @xref{makeinfo
-Pointer Creation, , Creating Pointers with @code{makeinfo}}.
-
-@item @@u@{@var{c}@}
-@itemx @@ubaraccent@{@var{c}@}
-@itemx @@udotaccent@{@var{c}@}
-Generate a breve, underbar, or underdot accent, respectively, over or
-under the character @var{c}, as in @u{o}, @ubaraccent{o},
-@udotaccent{o}. @xref{Inserting Accents}.
-
-@item @@unnumbered @var{title}
-In a printed manual, begin a chapter that appears without chapter
-numbers of any kind. The title appears in the table of contents of a
-printed manual. In Info, the title is underlined with asterisks.
-@xref{unnumbered & appendix, , @code{@@unnumbered} and
-@code{@@appendix}}.@refill
-
-@item @@unnumberedsec @var{title}
-In a printed manual, begin a section that appears without section
-numbers of any kind. The title appears in the table of contents of a
-printed manual. In Info, the title is underlined with equal signs.
-@xref{unnumberedsec appendixsec heading, , Section Commands}.@refill
-
-@item @@unnumberedsubsec @var{title}
-In a printed manual, begin an unnumbered subsection within a
-chapter. The title appears in the table of contents of a printed
-manual. In Info, the title is underlined with hyphens.
-@xref{unnumberedsubsec appendixsubsec subheading, ,
-@code{@@unnumberedsubsec} @code{@@appendixsubsec}
-@code{@@subheading}}.@refill
-
-@item @@unnumberedsubsubsec @var{title}
-In a printed manual, begin an unnumbered subsubsection within a
-chapter. The title appears in the table of contents of a printed
-manual. In Info, the title is underlined with periods.
-@xref{subsubsection, , The `subsub' Commands}.@refill
-
-@item @@uref@{@var{url}[, @var{displayed-text}@}
-Define a cross reference to an external uniform resource locator for the
-World Wide Web. @xref{url, , @code{@@url}}.@refill
-
-@item @@url@{@var{url}@}
-Indicate text that is a uniform resource locator for the World Wide
-Web. @xref{url, , @code{@@url}}.@refill
-
-@item @@v@{@var{c}@}
-Generate check accent over the character @var{c}, as in @v{o}.
-@xref{Inserting Accents}.
-
-@item @@value@{@var{flag}@}
-Replace @var{flag} with the value to which it is set by @code{@@set
-@var{flag}}.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@item @@var@{@var{metasyntactic-variable}@}
-Highlight a metasyntactic variable, which is something that stands for
-another piece of text. @xref{var, , Indicating Metasyntactic
-Variables}.@refill
-
-@need 400
-@item @@vindex @var{entry}
-Add @var{entry} to the index of variables. @xref{Index Entries, ,
-Defining the Entries of an Index}.@refill
-
-@need 400
-@item @@vskip @var{amount}
-In a printed manual, insert whitespace so as to push text on the
-remainder of the page towards the bottom of the page. Used in
-formatting the copyright page with the argument @samp{0pt plus
-1filll}. (Note spelling of @samp{filll}.) @code{@@vskip} may be used
-only in contexts ignored for Info. @xref{Copyright & Permissions, ,
-The Copyright Page and Printed Permissions}.@refill
-
-@need 400
-@item @@vtable @var{formatting-command}
-Begin a two-column table, using @code{@@item} for each entry.
-Automatically enter each of the items in the first column into the
-index of variables. Pair with @code{@@end vtable}. The same as
-@code{@@table}, except for indexing. @xref{ftable vtable, ,
-@code{@@ftable} and @code{@@vtable}}.@refill
-
-@need 400
-@item @@w@{@var{text}@}
-Prevent @var{text} from being split across two lines. Do not end a
-paragraph that uses @code{@@w} with an @code{@@refill} command.
-@xref{w, , @code{@@w}}.@refill
-
-@need 400
-@item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
-Make a reference that starts with `See' in a printed manual. Follow
-command with a punctuation mark. Only the first argument is
-mandatory. @xref{xref, , @code{@@xref}}.@refill
-@end table
-
-
-@node Tips, Sample Texinfo File, Command List, Top
-@appendix Tips and Hints
-
-Here are some tips for writing Texinfo documentation:@refill
-
-@cindex Tips
-@cindex Usage tips
-@cindex Hints
-@itemize @bullet
-@item
-Write in the present tense, not in the past or the future.
-
-@item
-Write actively! For example, write ``We recommend that @dots{}'' rather
-than ``It is recommended that @dots{}''.
-
-@item
-Use 70 or 72 as your fill column. Longer lines are hard to read.
-
-@item
-Include a copyright notice and copying permissions.
-@end itemize
-
-@subsubheading Index, Index, Index!
-
-Write many index entries, in different ways.
-Readers like indices; they are helpful and convenient.
-
-Although it is easiest to write index entries as you write the body of
-the text, some people prefer to write entries afterwards. In either
-case, write an entry before the paragraph to which it applies. This
-way, an index entry points to the first page of a paragraph that is
-split across pages.
-
-Here are more hints we have found valuable:
-
-@itemize @bullet
-@item
-Write each index entry differently, so each entry refers to a different
-place in the document.
-
-@item
-Write index entries only where a topic is discussed significantly. For
-example, it is not useful to index ``debugging information'' in a
-chapter on reporting bugs. Someone who wants to know about debugging
-information will certainly not find it in that chapter.
-
-@item
-Consistently capitalize the first word of every concept index entry,
-or else consistently use lower case. Terse entries often call for
-lower case; longer entries for capitalization. Whichever case
-convention you use, please use one or the other consistently! Mixing
-the two styles looks bad.
-
-@item
-Always capitalize or use upper case for those words in an index for
-which this is proper, such as names of countries or acronyms. Always
-use the appropriate case for case-sensitive names, such as those in C or
-Lisp.
-
-@item
-Write the indexing commands that refer to a whole section immediately
-after the section command, and write the indexing commands that refer to
-the paragraph before the paragraph.
-
-@need 1000
-In the example that follows, a blank line comes after the index
-entry for ``Leaping'':
-
-@example
-@group
-@@section The Dog and the Fox
-@@cindex Jumping, in general
-@@cindex Leaping
-
-@@cindex Dog, lazy, jumped over
-@@cindex Lazy dog jumped over
-@@cindex Fox, jumps over dog
-@@cindex Quick fox jumps over dog
-The quick brown fox jumps over the lazy dog.
-@end group
-@end example
-
-@noindent
-(Note that the example shows entries for the same concept that are
-written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
-readers can look up the concept in different ways.)
-@end itemize
-
-@subsubheading Blank Lines
-
-@itemize @bullet
-@item
-Insert a blank line between a sectioning command and the first following
-sentence or paragraph, or between the indexing commands associated with
-the sectioning command and the first following sentence or paragraph, as
-shown in the tip on indexing. Otherwise, a formatter may fold title and
-paragraph together.
-
-@item
-Always insert a blank line before an @code{@@table} command and after an
-@code{@@end table} command; but never insert a blank line after an
-@code{@@table} command or before an @code{@@end table} command.
-
-@need 1000
-For example,
-
-@example
-@group
-Types of fox:
-
-@@table @@samp
-@@item Quick
-Jump over lazy dogs.
-@end group
-
-@group
-@@item Brown
-Also jump over lazy dogs.
-@@end table
-
-@end group
-@group
-@@noindent
-On the other hand, @dots{}
-@end group
-@end example
-
-Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end
-itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
-same way.
-@end itemize
-
-@subsubheading Complete Phrases
-
-Complete phrases are easier to read than @dots{}
-
-@itemize @bullet
-@item
-Write entries in an itemized list as complete sentences; or at least, as
-complete phrases. Incomplete expressions @dots{} awkward @dots{} like
-this.
-
-@item
-Write the prefatory sentence or phrase for a multi-item list or table as
-a complete expression. Do not write ``You can set:''; instead, write
-``You can set these variables:''. The former expression sounds cut off.
-@end itemize
-
-@subsubheading Editions, Dates and Versions
-
-Write the edition and version numbers and date in three places in every
-manual:
-
-@enumerate
-@item
-In the first @code{@@ifinfo} section, for people reading the Texinfo file.
-
-@item
-In the @code{@@titlepage} section, for people reading the printed manual.
-
-@item
-In the `Top' node, for people reading the Info file.
-@end enumerate
-
-@noindent
-Also, it helps to write a note before the first @code{@@ifinfo}
-section to explain what you are doing.
-
-@need 800
-@noindent
-For example:
-
-@example
-@group
-@@c ===> NOTE! <==
-@@c Specify the edition and version numbers and date
-@@c in *three* places:
-@@c 1. First ifinfo section 2. title page 3. top node
-@@c To find the locations, search for !!set
-@end group
-
-@group
-@@ifinfo
-@@c !!set edition, date, version
-This is Edition 4.03, January 1992,
-of the @@cite@{GDB Manual@} for GDB Version 4.3.
-@dots{}
-@end group
-@end example
-
-@noindent
----or use @code{@@set} and @code{@@value}
-(@pxref{value Example, , @code{@@value} Example}).
-
-@subsubheading Definition Commands
-
-Definition commands are @code{@@deffn}, @code{@@defun},
-@code{@@defmac}, and the like, and enable you to write descriptions in
-a uniform format.@refill
-
-@itemize @bullet
-@item
-Write just one definition command for each entity you define with a
-definition command. The automatic indexing feature creates an index
-entry that leads the reader to the definition.
-
-@item
-Use @code{@@table} @dots{} @code{@@end table} in an appendix that
-contains a summary of functions, not @code{@@deffn} or other definition
-commands.
-@end itemize
-
-@subsubheading Capitalization
-
-@itemize @bullet
-@item
-Capitalize ``Texinfo''; it is a name. Do not write the @samp{x} or
-@samp{i} in upper case.
-
-@item
-Capitalize ``Info''; it is a name.
-
-@item
-Write @TeX{} using the @code{@@TeX@{@}} command. Note the uppercase
-@samp{T} and @samp{X}. This command causes the formatters to
-typeset the name according to the wishes of Donald Knuth, who wrote
-@TeX{}.
-@end itemize
-
-@subsubheading Spaces
-
-Do not use spaces to format a Texinfo file, except inside of
-@code{@@example} @dots{} @code{@@end example} and similar commands.
-
-@need 700
-For example, @TeX{} fills the following:
-
-@example
-@group
- @@kbd@{C-x v@}
- @@kbd@{M-x vc-next-action@}
- Perform the next logical operation
- on the version-controlled file
- corresponding to the current buffer.
-@end group
-@end example
-
-@need 950
-@noindent
-so it looks like this:
-
-@iftex
-@quotation
- @kbd{C-x v}
- @kbd{M-x vc-next-action}
- Perform the next logical operation on the version-controlled file
- corresponding to the current buffer.
-@end quotation
-@end iftex
-@ifinfo
-@quotation
-`C-x v' `M-x vc-next-action' Perform the next logical operation on the
-version-controlled file corresponding to the current buffer.
-@end quotation
-@end ifinfo
-
-@noindent
-In this case, the text should be formatted with
-@code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
-
-@subsubheading @@code, @@samp, @@var, and @samp{---}
-
-@itemize @bullet
-@item
-Use @code{@@code} around Lisp symbols, including command names.
-For example,
-
-@example
-The main function is @@code@{vc-next-action@}, @dots{}
-@end example
-
-@item
-Avoid putting letters such as @samp{s} immediately after an
-@samp{@@code}. Such letters look bad.
-
-@item
-Use @code{@@var} around meta-variables. Do not write angle brackets
-around them.
-
-@item
-Use three hyphens in a row, @samp{---}, to indicate a long dash. @TeX{}
-typesets these as a long dash and the Info formatters reduce three
-hyphens to two.
-@end itemize
-
-@subsubheading Periods Outside of Quotes
-
-Place periods and other punctuation marks @emph{outside} of quotations,
-unless the punctuation is part of the quotation. This practice goes
-against publishing conventions in the United States, but enables the
-reader to distinguish between the contents of the quotation and the
-whole passage.
-
-For example, you should write the following sentence with the period
-outside the end quotation marks:
-
-@example
-Evidently, @samp{au} is an abbreviation for ``author''.
-@end example
-
-@noindent
-since @samp{au} does @emph{not} serve as an abbreviation for
-@samp{author.} (with a period following the word).
-
-@subsubheading Introducing New Terms
-
-@itemize @bullet
-@item
-Introduce new terms so that a reader who does not know them can
-understand them from context; or write a definition for the term.
-
-For example, in the following, the terms ``check in'', ``register'' and
-``delta'' are all appearing for the first time; the example sentence should be
-rewritten so they are understandable.
-
-@quotation
-The major function assists you in checking in a file to your
-version control system and registering successive sets of changes to
-it as deltas.
-@end quotation
-
-@item
-Use the @code{@@dfn} command around a word being introduced, to indicate
-that the reader should not expect to know the meaning already, and
-should expect to learn the meaning from this passage.
-@end itemize
-
-@subsubheading @@pxref
-
-@c !!! maybe include this in the tips on pxref
-@ignore
-By the way, it is okay to use pxref with something else in front of
-it within the parens, as long as the pxref is followed by the close
-paren, and the material inside the parens is not part of a larger
-sentence. Also, you can use xref inside parens as part of a complete
-sentence so long as you terminate the cross reference with punctuation.
-@end ignore
-Absolutely never use @code{@@pxref} except in the special context for
-which it is designed: inside parentheses, with the closing parenthesis
-following immediately after the closing brace. One formatter
-automatically inserts closing punctuation and the other does not. This
-means that the output looks right both in printed output and in an Info
-file, but only when the command is used inside parentheses.
-
-@subsubheading Invoking from a Shell
-
-You can invoke programs such as Emacs, GCC, and @code{gawk} from a
-shell. The documentation for each program should contain a section that
-describes this. Unfortunately, if the node names and titles for these
-sections are all different, readers find it hard to search for the
-section.@refill
-
-Name such sections with a phrase beginning with the word
-@w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way
-users can find the section easily.
-
-@subsubheading ANSI C Syntax
-
-When you use @code{@@example} to describe a C function's calling
-conventions, use the ANSI C syntax, like this:@refill
-
-@example
-void dld_init (char *@@var@{path@});
-@end example
-
-@noindent
-And in the subsequent discussion, refer to the argument values by
-writing the same argument names, again highlighted with
-@code{@@var}.@refill
-
-@need 800
-Avoid the obsolete style that looks like this:@refill
-
-@example
-#include <dld.h>
-
-dld_init (path)
-char *path;
-@end example
-
-Also, it is best to avoid writing @code{#include} above the
-declaration just to indicate that the function is declared in a
-header file. The practice may give the misimpression that the
-@code{#include} belongs near the declaration of the function. Either
-state explicitly which header file holds the declaration or, better
-yet, name the header file used for a group of functions at the
-beginning of the section that describes the functions.@refill
-
-@subsubheading Bad Examples
-
-Here are several examples of bad writing to avoid:
-
-In this example, say, `` @dots{} you must @code{@@dfn}@{check
-in@} the new version.'' That flows better.
-
-@quotation
-When you are done editing the file, you must perform a
-@code{@@dfn}@{check in@}.
-@end quotation
-
-In the following example, say, ``@dots{} makes a unified interface such as VC
-mode possible.''
-
-@quotation
-SCCS, RCS and other version-control systems all perform similar
-functions in broadly similar ways (it is this resemblance which makes
-a unified control mode like this possible).
-@end quotation
-
-And in this example, you should specify what `it' refers to:
-
-@quotation
-If you are working with other people, it assists in coordinating
-everyone's changes so they do not step on each other.
-@end quotation
-
-@subsubheading And Finally @dots{}
-
-@itemize @bullet
-@item
-Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
-sound in the name `Bach'. But pronounce Texinfo as in `speck':
-``teckinfo''.
-
-@item
-Write notes for yourself at the very end of a Texinfo file after the
-@code{@@bye}. None of the formatters process text after the
-@code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
-@code{@@end ignore}.
-@end itemize
-
-
-@node Sample Texinfo File, Sample Permissions, Tips, Top
-@appendix A Sample Texinfo File
-@cindex Sample Texinfo file, no comments
-
-Here is a complete, short sample Texinfo file, without any commentary.
-You can see this file, with comments, in the first chapter.
-@xref{Short Sample, , A Short Sample Texinfo File}.
-
-@sp 1
-@example
-\input texinfo @@c -*-texinfo-*-
-@@c %**start of header
-@@setfilename sample.info
-@@settitle Sample Document
-@@c %**end of header
-
-@@setchapternewpage odd
-
-@@ifinfo
-This is a short example of a complete Texinfo file.
-
-Copyright 1990 Free Software Foundation, Inc.
-@@end ifinfo
-
-@@titlepage
-@@sp 10
-@@comment The title is printed in a large font.
-@@center @@titlefont@{Sample Title@}
-
-@@c The following two commands start the copyright page.
-@@page
-@@vskip 0pt plus 1filll
-Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
-@@end titlepage
-
-@@node Top, First Chapter, , (dir)
-@@comment node-name, next, previous, up
-
-@@menu
-* First Chapter:: The first chapter is the
- only chapter in this sample.
-* Concept Index:: This index has two entries.
-@@end menu
-
-@@node First Chapter, Concept Index, Top, Top
-@@comment node-name, next, previous, up
-@@chapter First Chapter
-@@cindex Sample index entry
-
-This is the contents of the first chapter.
-@@cindex Another sample index entry
-
-Here is a numbered list.
-
-@@enumerate
-@@item
-This is the first item.
-
-@@item
-This is the second item.
-@@end enumerate
-
-The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
-commands transform a Texinfo file such as this into
-an Info file; and @@TeX@{@} typesets it for a printed
-manual.
-
-@@node Concept Index, , First Chapter, Top
-@@comment node-name, next, previous, up
-@@unnumbered Concept Index
-
-@@printindex cp
-
-@@contents
-@@bye
-@end example
-
-
-@node Sample Permissions, Include Files, Sample Texinfo File, Top
-@appendix Sample Permissions
-@cindex Permissions
-@cindex Copying permissions
-
-Texinfo files should contain sections that tell the readers that they
-have the right to copy and distribute the Texinfo file, the Info file,
-and the printed manual.@refill
-
-Also, if you are writing a manual about software, you should explain
-that the software is free and either include the GNU General Public
-License (GPL) or provide a reference to it. @xref{Distrib, ,
-Distribution, emacs, The GNU Emacs Manual}, for an example of the text
-that could be used in the software ``Distribution'', ``General Public
-License'', and ``NO WARRANTY'' sections of a document. @xref{Copying,
-, Texinfo Copying Conditions}, for an example of a brief explanation
-of how the copying conditions provide you with rights. @refill
-
-@menu
-* Inserting Permissions:: How to put permissions in your document.
-* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
-* Titlepage Permissions:: Sample Titlepage copying permissions.
-@end menu
-
-@node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions
-@ifinfo
-@appendixsec Inserting Permissions
-@end ifinfo
-
-In a Texinfo file, the first @code{@@ifinfo} section usually begins
-with a line that says what the file documents. This is what a person
-reading the unprocessed Texinfo file or using the advanced Info
-command @kbd{g *} sees first. @inforef{Expert, Advanced Info
-commands, info}, for more information. (A reader using the regular
-Info commands usually starts reading at the first node and skips
-this first section, which is not in a node.)@refill
-
-In the @code{@@ifinfo} section, the summary sentence is followed by a
-copyright notice and then by the copying permission notice. One of
-the copying permission paragraphs is enclosed in @code{@@ignore} and
-@code{@@end ignore} commands. This paragraph states that the Texinfo
-file can be processed through @TeX{} and printed, provided the printed
-manual carries the proper copying permission notice. This paragraph
-is not made part of the Info file since it is not relevant to the Info
-file; but it is a mandatory part of the Texinfo file since it permits
-people to process the Texinfo file in @TeX{} and print the
-results.@refill
-
-In the printed manual, the Free Software Foundation copying permission
-notice follows the copyright notice and publishing information and is
-located within the region delineated by the @code{@@titlepage} and
-@code{@@end titlepage} commands. The copying permission notice is exactly
-the same as the notice in the @code{@@ifinfo} section except that the
-paragraph enclosed in @code{@@ignore} and @code{@@end ignore} commands is
-not part of the notice.@refill
-
-To make it simple to insert a permission notice into each section of
-the Texinfo file, sample permission notices for each section are
-reproduced in full below.@refill
-
-Note that you may need to specify the correct name of a section
-mentioned in the permission notice. For example, in @cite{The GDB
-Manual}, the name of the section referring to the General Public
-License is called the ``GDB General Public License'', but in the
-sample shown below, that section is referred to generically as the
-``GNU General Public License''. If the Texinfo file does not carry a
-copy of the General Public License, leave out the reference to it, but
-be sure to include the rest of the sentence.@refill
-
-@node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions
-@comment node-name, next, previous, up
-@appendixsec @samp{ifinfo} Copying Permissions
-@cindex @samp{ifinfo} permissions
-
-In the @code{@@ifinfo} section of a Texinfo file, the standard Free
-Software Foundation permission notice reads as follows:@refill
-
-@example
-This file documents @dots{}
-
-Copyright 1998 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim
-copies of this manual provided the copyright notice and
-this permission notice are preserved on all copies.
-
-@@ignore
-Permission is granted to process this file through TeX
-and print the results, provided the printed document
-carries a copying permission notice identical to this
-one except for the removal of this paragraph (this
-paragraph not being relevant to the printed manual).
-
-@@end ignore
-Permission is granted to copy and distribute modified
-versions of this manual under the conditions for
-verbatim copying, provided also that the sections
-entitled ``Copying'' and ``GNU General Public License''
-are included exactly as in the original, and provided
-that the entire resulting derived work is distributed
-under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute
-translations of this manual into another language,
-under the above conditions for modified versions,
-except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-@end example
-
-@node Titlepage Permissions, , ifinfo Permissions, Sample Permissions
-@comment node-name, next, previous, up
-@appendixsec Titlepage Copying Permissions
-@cindex Titlepage permissions
-
-In the @code{@@titlepage} section of a Texinfo file, the standard Free
-Software Foundation copying permission notice follows the copyright
-notice and publishing information. The standard phrasing is as
-follows:@refill
-
-@example
-Permission is granted to make and distribute verbatim
-copies of this manual provided the copyright notice and
-this permission notice are preserved on all copies.
-
-Permission is granted to copy and distribute modified
-versions of this manual under the conditions for
-verbatim copying, provided also that the sections
-entitled ``Copying'' and ``GNU General Public License''
-are included exactly as in the original, and provided
-that the entire resulting derived work is distributed
-under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute
-translations of this manual into another language,
-under the above conditions for modified versions,
-except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-@end example
-
-
-@node Include Files, Headings, Sample Permissions, Top
-@appendix Include Files
-@cindex Include files
-
-When @TeX{} or an Info formatting command sees an @code{@@include}
-command in a Texinfo file, it processes the contents of the file named
-by the command and incorporates them into the DVI or Info file being
-created. Index entries from the included file are incorporated into
-the indices of the output file.@refill
-
-Include files let you keep a single large document as a collection of
-conveniently small parts.@refill
-
-@menu
-* Using Include Files:: How to use the @code{@@include} command.
-* texinfo-multiple-files-update:: How to create and update nodes and
- menus when using included files.
-* Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
-* Sample Include File:: A sample outer file with included files
- within it; and a sample included file.
-* Include Files Evolution:: How use of the @code{@@include} command
- has changed over time.
-@end menu
-
-@node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files
-@appendixsec How to Use Include Files
-@findex include
-
-To include another file within a Texinfo file, write the
-@code{@@include} command at the beginning of a line and follow it on
-the same line by the name of a file to be included. For
-example:@refill
-
-@example
-@@include buffers.texi
-@end example
-
-An included file should simply be a segment of text that you expect to
-be included as is into the overall or @dfn{outer} Texinfo file; it
-should not contain the standard beginning and end parts of a Texinfo
-file. In particular, you should not start an included file with a
-line saying @samp{\input texinfo}; if you do, that phrase is inserted
-into the output file as is. Likewise, you should not end an included
-file with an @code{@@bye} command; nothing after @code{@@bye} is
-formatted.@refill
-
-In the past, you were required to write an @code{@@setfilename} line at the
-beginning of an included file, but no longer. Now, it does not matter
-whether you write such a line. If an @code{@@setfilename} line exists
-in an included file, it is ignored.@refill
-
-Conventionally, an included file begins with an @code{@@node} line that
-is followed by an @code{@@chapter} line. Each included file is one
-chapter. This makes it easy to use the regular node and menu creating
-and updating commands to create the node pointers and menus within the
-included file. However, the simple Emacs node and menu creating and
-updating commands do not work with multiple Texinfo files. Thus you
-cannot use these commands to fill in the `Next', `Previous', and `Up'
-pointers of the @code{@@node} line that begins the included file. Also,
-you cannot use the regular commands to create a master menu for the
-whole file. Either you must insert the menus and the `Next',
-`Previous', and `Up' pointers by hand, or you must use the GNU Emacs
-Texinfo mode command, @code{texinfo-multiple-files-update}, that is
-designed for @code{@@include} files.@refill
-
-@node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files
-@appendixsec @code{texinfo-multiple-files-update}
-@findex texinfo-multiple-files-update
-
-GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
-command. This command creates or updates `Next', `Previous', and `Up'
-pointers of included files as well as those in the outer or overall
-Texinfo file, and it creates or updates a main menu in the outer file.
-Depending whether you call it with optional arguments, the command
-updates only the pointers in the first @code{@@node} line of the
-included files or all of them:@refill
-
-@table @kbd
-@item M-x texinfo-multiple-files-update
-Called without any arguments:@refill
-
-@itemize @minus
-@item
-Create or update the `Next', `Previous', and `Up' pointers of the
-first @code{@@node} line in each file included in an outer or overall
-Texinfo file.@refill
-
-@item
-Create or update the `Top' level node pointers of the outer or
-overall file.@refill
-
-@item
-Create or update a main menu in the outer file.@refill
-@end itemize
-
-@item C-u M-x texinfo-multiple-files-update
-Called with @kbd{C-u} as a prefix argument:
-
-@itemize @minus{}
-@item
-Create or update pointers in the first @code{@@node} line in each
-included file.
-
-@item
-Create or update the `Top' level node pointers of the outer file.
-
-@item
-Create and insert a master menu in the outer file. The master menu
-is made from all the menus in all the included files.@refill
-@end itemize
-
-@item C-u 8 M-x texinfo-multiple-files-update
-Called with a numeric prefix argument, such as @kbd{C-u 8}:
-
-@itemize @minus
-@item
-Create or update @strong{all} the `Next', `Previous', and `Up' pointers
-of all the included files.@refill
-
-@item
-Create or update @strong{all} the menus of all the included
-files.@refill
-
-@item
-Create or update the `Top' level node pointers of the outer or
-overall file.@refill
-
-@item
-And then create a master menu in the outer file. This is similar to
-invoking @code{texinfo-master-menu} with an argument when you are
-working with just one file.@refill
-@end itemize
-@end table
-
-Note the use of the prefix argument in interactive use: with a regular
-prefix argument, just @w{@kbd{C-u}}, the
-@code{texinfo-multiple-files-update} command inserts a master menu;
-with a numeric prefix argument, such as @kbd{C-u 8}, the command
-updates @strong{every} pointer and menu in @strong{all} the files and then inserts a
-master menu.@refill
-
-@node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files
-@appendixsec Include File Requirements
-@cindex Include file requirements
-@cindex Requirements for include files
-
-If you plan to use the @code{texinfo-multiple-files-update} command,
-the outer Texinfo file that lists included files within it should
-contain nothing but the beginning and end parts of a Texinfo file, and
-a number of @code{@@include} commands listing the included files. It
-should not even include indices, which should be listed in an included
-file of their own.@refill
-
-Moreover, each of the included files must contain exactly one highest
-level node (conventionally, @code{@@chapter} or equivalent),
-and this node must be the first node in the included file.
-Furthermore, each of these highest level nodes in each included file
-must be at the same hierarchical level in the file structure.
-Usually, each is an @code{@@chapter}, an @code{@@appendix}, or an
-@code{@@unnumbered} node. Thus, normally, each included file contains
-one, and only one, chapter or equivalent-level node.@refill
-
-The outer file should contain only @emph{one} node, the `Top' node. It
-should @emph{not} contain any nodes besides the single `Top' node. The
-@code{texinfo-multiple-files-update} command will not process
-them.@refill
-
-@node Sample Include File, Include Files Evolution, Include File Requirements, Include Files
-@appendixsec Sample File with @code{@@include}
-@cindex Sample @code{@@include} file
-@cindex Include file sample
-@cindex @code{@@include} file sample
-
-Here is an example of a complete outer Texinfo file with @code{@@include} files
-within it before running @code{texinfo-multiple-files-update}, which
-would insert a main or master menu:@refill
-
-@example
-@group
-\input texinfo @@c -*-texinfo-*-
-@c %**start of header
-@@setfilename include-example.info
-@@settitle Include Example
-@c %**end of header
-@end group
-
-@group
-@@setchapternewpage odd
-@@titlepage
-@@sp 12
-@@center @@titlefont@{Include Example@}
-@@sp 2
-@@center by Whom Ever
-@end group
-
-@group
-@@page
-@@vskip 0pt plus 1filll
-Copyright @@copyright@{@} 1998 Free Software Foundation, Inc.
-@@end titlepage
-@end group
-
-@group
-@@ifinfo
-@@node Top, First, , (dir)
-@@top Master Menu
-@@end ifinfo
-@end group
-
-@group
-@@include foo.texinfo
-@@include bar.texinfo
-@@include concept-index.texinfo
-@end group
-
-@group
-@@summarycontents
-@@contents
-
-@@bye
-@end group
-@end example
-
-An included file, such as @file{foo.texinfo}, might look like
-this:@refill
-
-@example
-@group
-@@node First, Second, , Top
-@@chapter First Chapter
-
-Contents of first chapter @dots{}
-@end group
-@end example
-
-The full contents of @file{concept-index.texinfo} might be as simple as this:
-
-@example
-@group
-@@node Concept Index, , Second, Top
-@@unnumbered Concept Index
-
-@@printindex cp
-@end group
-@end example
-
-The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
-Manual} is named @file{elisp.texi}. This outer file contains a master
-menu with 417 entries and a list of 41 @code{@@include}
-files.@refill
-
-@node Include Files Evolution, , Sample Include File, Include Files
-@comment node-name, next, previous, up
-@appendixsec Evolution of Include Files
-
-When Info was first created, it was customary to create many small
-Info files on one subject. Each Info file was formatted from its own
-Texinfo source file. This custom meant that Emacs did not need to
-make a large buffer to hold the whole of a large Info file when
-someone wanted information; instead, Emacs allocated just enough
-memory for the small Info file that contained the particular
-information sought. This way, Emacs could avoid wasting memory.@refill
-
-References from one file to another were made by referring to the file
-name as well as the node name. (@xref{Other Info Files, , Referring to
-Other Info Files}. Also, see @ref{Four and Five Arguments, ,
-@code{@@xref} with Four and Five Arguments}.)@refill
-
-Include files were designed primarily as a way to create a single,
-large printed manual out of several smaller Info files. In a printed
-manual, all the references were within the same document, so @TeX{}
-could automatically determine the references' page numbers. The Info
-formatting commands used include files only for creating joint
-indices; each of the individual Texinfo files had to be formatted for
-Info individually. (Each, therefore, required its own
-@code{@@setfilename} line.)@refill
-
-However, because large Info files are now split automatically, it is
-no longer necessary to keep them small.@refill
-
-Nowadays, multiple Texinfo files are used mostly for large documents,
-such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
-in which several different people write different sections of a
-document simultaneously.@refill
-
-In addition, the Info formatting commands have been extended to work
-with the @code{@@include} command so as to create a single large Info
-file that is split into smaller files if necessary. This means that
-you can write menus and cross references without naming the different
-Texinfo files.@refill
-
-
-@node Headings, Catching Mistakes, Include Files, Top
-@appendix Page Headings
-@cindex Headings
-@cindex Footings
-@cindex Page numbering
-@cindex Page headings
-@cindex Formatting headings and footings
-
-Most printed manuals contain headings along the top of every page
-except the title and copyright pages. Some manuals also contain
-footings. (Headings and footings have no meaning to Info, which is
-not paginated.)@refill
-
-@menu
-* Headings Introduced:: Conventions for using page headings.
-* Heading Format:: Standard page heading formats.
-* Heading Choice:: How to specify the type of page heading.
-* Custom Headings:: How to create your own headings and footings.
-@end menu
-
-@node Headings Introduced, Heading Format, Headings, Headings
-@ifinfo
-@heading Headings Introduced
-@end ifinfo
-
-Texinfo provides standard page heading formats for manuals that are
-printed on one side of each sheet of paper and for manuals that are
-printed on both sides of the paper. Typically, you will use these
-formats, but you can specify your own format if you wish.@refill
-
-In addition, you can specify whether chapters should begin on a new
-page, or merely continue the same page as the previous chapter; and if
-chapters begin on new pages, you can specify whether they must be
-odd-numbered pages.@refill
-
-By convention, a book is printed on both sides of each sheet of paper.
-When you open a book, the right-hand page is odd-numbered, and
-chapters begin on right-hand pages---a preceding left-hand page is
-left blank if necessary. Reports, however, are often printed on just
-one side of paper, and chapters begin on a fresh page immediately
-following the end of the preceding chapter. In short or informal
-reports, chapters often do not begin on a new page at all, but are
-separated from the preceding text by a small amount of whitespace.@refill
-
-The @code{@@setchapternewpage} command controls whether chapters begin
-on new pages, and whether one of the standard heading formats is used.
-In addition, Texinfo has several heading and footing commands that you
-can use to generate your own heading and footing formats.@refill
-
-In Texinfo, headings and footings are single lines at the tops and
-bottoms of pages; you cannot create multiline headings or footings.
-Each header or footer line is divided into three parts: a left part, a
-middle part, and a right part. Any part, or a whole line, may be left
-blank. Text for the left part of a header or footer line is set
-flushleft; text for the middle part is centered; and, text for the
-right part is set flushright.@refill
-
-@node Heading Format, Heading Choice, Headings Introduced, Headings
-@comment node-name, next, previous, up
-@appendixsec Standard Heading Formats
-
-Texinfo provides two standard heading formats, one for manuals printed
-on one side of each sheet of paper, and the other for manuals printed
-on both sides of the paper.
-
-By default, nothing is specified for the footing of a Texinfo file,
-so the footing remains blank.@refill
-
-The standard format for single-sided printing consists of a header
-line in which the left-hand part contains the name of the chapter, the
-central part is blank, and the right-hand part contains the page
-number.@refill
-
-@need 950
-A single-sided page looks like this:
-
-@example
-@group
- _______________________
- | |
- | chapter page number |
- | |
- | Start of text ... |
- | ... |
- | |
-
-@end group
-@end example
-
-The standard format for two-sided printing depends on whether the page
-number is even or odd. By convention, even-numbered pages are on the
-left- and odd-numbered pages are on the right. (@TeX{} will adjust the
-widths of the left- and right-hand margins. Usually, widths are
-correct, but during double-sided printing, it is wise to check that
-pages will bind properly---sometimes a printer will produce output in
-which the even-numbered pages have a larger right-hand margin than the
-odd-numbered pages.)@refill
-
-In the standard double-sided format, the left part of the left-hand
-(even-numbered) page contains the page number, the central part is
-blank, and the right part contains the title (specified by the
-@code{@@settitle} command). The left part of the right-hand
-(odd-numbered) page contains the name of the chapter, the central part
-is blank, and the right part contains the page number.@refill
-
-@need 750
-Two pages, side by side as in an open book, look like this:@refill
-
-@example
-@group
- _______________________ _______________________
- | | | |
- | page number title | | chapter page number |
- | | | |
- | Start of text ... | | More text ... |
- | ... | | ... |
- | | | |
-
-@end group
-@end example
-
-@noindent
-The chapter name is preceded by the word ``Chapter'', the chapter number
-and a colon. This makes it easier to keep track of where you are in the
-manual.@refill
-
-@node Heading Choice, Custom Headings, Heading Format, Headings
-@comment node-name, next, previous, up
-@appendixsec Specifying the Type of Heading
-
-@TeX{} does not begin to generate page headings for a standard Texinfo
-file until it reaches the @code{@@end titlepage} command. Thus, the
-title and copyright pages are not numbered. The @code{@@end
-titlepage} command causes @TeX{} to begin to generate page headings
-according to a standard format specified by the
-@code{@@setchapternewpage} command that precedes the
-@code{@@titlepage} section.@refill
-
-@need 1000
-There are four possibilities:@refill
-
-@table @asis
-@item No @code{@@setchapternewpage} command
-Cause @TeX{} to specify the single-sided heading format, with chapters
-on new pages. This is the same as @code{@@setchapternewpage on}.@refill
-
-@item @code{@@setchapternewpage on}
-Specify the single-sided heading format, with chapters on new pages.@refill
-
-@item @code{@@setchapternewpage off}
-Cause @TeX{} to start a new chapter on the same page as the last page of
-the preceding chapter, after skipping some vertical whitespace. Also
-cause @TeX{} to typeset for single-sided printing. (You can override
-the headers format with the @code{@@headings double} command; see
-@ref{headings on off, , The @code{@@headings} Command}.)@refill
-
-@item @code{@@setchapternewpage odd}
-Specify the double-sided heading format, with chapters on new pages.@refill
-@end table
-
-@noindent
-Texinfo lacks an @code{@@setchapternewpage even} command.@refill
-
-@node Custom Headings, , Heading Choice, Headings
-@comment node-name, next, previous, up
-@appendixsec How to Make Your Own Headings
-
-You can use the standard headings provided with Texinfo or specify
-your own. By default, Texinfo has no footers, so if you specify them,
-the available page size for the main text will be slightly reduced.
-
-@c Following paragraph is verbose to prevent overfull hboxes.
-Texinfo provides six commands for specifying headings and
-footings. The @code{@@everyheading} command and
-@code{@@everyfooting} command generate page headers and footers
-that are the same for both even- and odd-numbered pages.
-The @code{@@evenheading} command and @code{@@evenfooting}
-command generate headers and footers for even-numbered
-(left-hand) pages; and the @code{@@oddheading} command and
-@code{@@oddfooting} command generate headers and footers for
-odd-numbered (right-hand) pages.@refill
-
-Write custom heading specifications in the Texinfo file immediately
-after the @code{@@end titlepage} command. Enclose your specifications
-between @code{@@iftex} and @code{@@end iftex} commands since the
-@code{texinfo-format-buffer} command may not recognize them. Also,
-you must cancel the predefined heading commands with the
-@code{@@headings off} command before defining your own
-specifications.@refill
-
-@need 1000
-Here is how to tell @TeX{} to place the chapter name at the left, the
-page number in the center, and the date at the right of every header
-for both even- and odd-numbered pages:@refill
-
-@example
-@group
-@@iftex
-@@headings off
-@@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
-@@end iftex
-@end group
-@end example
-
-@noindent
-You need to divide the left part from the central part and the central
-part from the right part by inserting @samp{@@|} between parts.
-Otherwise, the specification command will not be able to tell where
-the text for one part ends and the next part begins.@refill
-
-Each part can contain text or @@-commands. The text
-is printed as if the part were within an ordinary paragraph in the
-body of the page. The @@-commands replace
-themselves with the page number, date, chapter name, or
-whatever.@refill
-
-@need 950
-Here are the six heading and footing commands:@refill
-
-@findex everyheading
-@findex everyfooting
-@table @code
-@item @@everyheading @var{left} @@| @var{center} @@| @var{right}
-@itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
-
-The `every' commands specify the format for both even- and odd-numbered
-pages. These commands are for documents that are printed on one side
-of each sheet of paper, or for documents in which you want symmetrical
-headers or footers.@refill
-
-@findex evenheading
-@findex evenfooting
-@findex oddheading
-@findex oddfooting
-@item @@evenheading @var{left} @@| @var{center} @@| @var{right}
-@itemx @@oddheading @var{left} @@| @var{center} @@| @var{right}
-
-@itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
-@itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right}
-
-The `even' and `odd' commands specify the format for even-numbered
-pages and odd-numbered pages. These commands are for books and
-manuals that are printed on both sides of each sheet of paper.
-@end table
-
-Use the @samp{@@this@dots{}} series of @@-commands to
-provide the names of chapters
-and sections and the page number. You can use the
-@samp{@@this@dots{}} commands in the left, center, or right portions
-of headers and footers, or anywhere else in a Texinfo file so long as
-they are between @code{@@iftex} and @code{@@end iftex} commands.@refill
-
-@need 1000
-Here are the @samp{@@this@dots{}} commands:@refill
-
-@table @code
-@findex thispage
-@item @@thispage
-Expands to the current page number.@refill
-@c !!! Karl Berry says that `thissection' can fail on page breaks.
-@ignore
-@item @@thissection
-Expands to the name of the current section.@refill
-@end ignore
-
-@findex thischaptername
-@item @@thischaptername
-Expands to the name of the current chapter.@refill
-
-@findex thischapter
-@item @@thischapter
-Expands to the number and name of the current
-chapter, in the format `Chapter 1: Title'.@refill
-
-@findex thistitle
-@item @@thistitle
-Expands to the name of the document, as specified by the
-@code{@@settitle} command.@refill
-
-@findex thisfile
-@item @@thisfile
-For @code{@@include} files only: expands to the name of the current
-@code{@@include} file. If the current Texinfo source file is not an
-@code{@@include} file, this command has no effect. This command does
-@emph{not} provide the name of the current Texinfo source file unless
-it is an @code{@@include} file. (@xref{Include Files}, for more
-information about @code{@@include} files.)@refill
-@end table
-
-@noindent
-You can also use the @code{@@today@{@}} command, which expands to the
-current date, in `1 Jan 1900' format.@refill
-@findex today
-
-Other @@-commands and text are printed in a header or footer just as
-if they were in the body of a page. It is useful to incorporate text,
-particularly when you are writing drafts:@refill
-
-@example
-@group
-@@iftex
-@@headings off
-@@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
-@@everyfooting @@| @@| Version: 0.27: @@today@{@}
-@@end iftex
-@end group
-@end example
-
-Beware of overlong titles: they may overlap another part of the
-header or footer and blot it out.@refill
-
-
-@node Catching Mistakes, Refilling Paragraphs, Headings, Top
-@appendix Formatting Mistakes
-@cindex Structure, catching mistakes in
-@cindex Nodes, catching mistakes
-@cindex Catching mistakes
-@cindex Correcting mistakes
-@cindex Mistakes, catching
-@cindex Problems, catching
-@cindex Debugging the Texinfo structure
-
-Besides mistakes in the content of your documentation, there
-are two kinds of mistake you can make with Texinfo: you can make mistakes
-with @@-commands, and you can make mistakes with the structure of the
-nodes and chapters.@refill
-
-Emacs has two tools for catching the @@-command mistakes and two for
-catching structuring mistakes.@refill
-
-For finding problems with @@-commands, you can run @TeX{} or a region
-formatting command on the region that has a problem; indeed, you can
-run these commands on each region as you write it.@refill
-
-For finding problems with the structure of nodes and chapters, you can use
-@kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
-command and you can use the @kbd{M-x Info-validate} command.@refill
-
-@menu
-* makeinfo Preferred:: @code{makeinfo} finds errors.
-* Debugging with Info:: How to catch errors with Info formatting.
-* Debugging with TeX:: How to catch errors with @TeX{} formatting.
-* Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
-* Using occur:: How to list all lines containing a pattern.
-* Running Info-Validate:: How to find badly referenced nodes.
-@end menu
-
-@node makeinfo Preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
-@ifinfo
-@heading @code{makeinfo} Find Errors
-@end ifinfo
-
-The @code{makeinfo} program does an excellent job of catching errors
-and reporting them---far better than @code{texinfo-format-region} or
-@code{texinfo-format-buffer}. In addition, the various functions for
-automatically creating and updating node pointers and menus remove
-many opportunities for human error.@refill
-
-If you can, use the updating commands to create and insert pointers
-and menus. These prevent many errors. Then use @code{makeinfo} (or
-its Texinfo mode manifestations, @code{makeinfo-region} and
-@code{makeinfo-buffer}) to format your file and check for other
-errors. This is the best way to work with Texinfo. But if you
-cannot use @code{makeinfo}, or your problem is very puzzling, then you
-may want to use the tools described in this appendix.@refill
-
-@node Debugging with Info, Debugging with TeX, makeinfo Preferred, Catching Mistakes
-@comment node-name, next, previous, up
-@appendixsec Catching Errors with Info Formatting
-@cindex Catching errors with Info formatting
-@cindex Debugging with Info formatting
-
-After you have written part of a Texinfo file, you can use the
-@code{texinfo-format-region} or the @code{makeinfo-region} command to
-see whether the region formats properly.@refill
-
-Most likely, however, you are reading this section because for some
-reason you cannot use the @code{makeinfo-region} command; therefore, the
-rest of this section presumes that you are using
-@code{texinfo-format-region}.@refill
-
-If you have made a mistake with an @@-command,
-@code{texinfo-format-region} will stop processing at or after the
-error and display an error message. To see where in the buffer the
-error occurred, switch to the @samp{*Info Region*} buffer; the cursor
-will be in a position that is after the location of the error. Also,
-the text will not be formatted after the place where the error
-occurred (or more precisely, where it was detected).@refill
-
-For example, if you accidentally end a menu with the command @code{@@end
-menus} with an `s' on the end, instead of with @code{@@end menu}, you
-will see an error message that says:@refill
-
-@example
-@@end menus is not handled by texinfo
-@end example
-
-@noindent
-The cursor will stop at the point in the buffer where the error
-occurs, or not long after it. The buffer will look like this:@refill
-
-@example
-@group
----------- Buffer: *Info Region* ----------
-* Menu:
-
-* Using texinfo-show-structure:: How to use
- `texinfo-show-structure'
- to catch mistakes.
-* Running Info-Validate:: How to check for
- unreferenced nodes.
-@@end menus
-@point{}
----------- Buffer: *Info Region* ----------
-@end group
-@end example
-
-The @code{texinfo-format-region} command sometimes provides slightly
-odd error messages. For example, the following cross reference fails to format:@refill
-
-@example
-(@@xref@{Catching Mistakes, for more info.)
-@end example
-
-@noindent
-In this case, @code{texinfo-format-region} detects the missing closing
-brace but displays a message that says @samp{Unbalanced parentheses}
-rather than @samp{Unbalanced braces}. This is because the formatting
-command looks for mismatches between braces as if they were
-parentheses.@refill
-
-Sometimes @code{texinfo-format-region} fails to detect mistakes. For
-example, in the following, the closing brace is swapped with the
-closing parenthesis:@refill
-
-@example
-(@@xref@{Catching Mistakes), for more info.@}
-@end example
-
-@noindent
-Formatting produces:
-@example
-(*Note for more info.: Catching Mistakes)
-@end example
-
-The only way for you to detect this error is to realize that the
-reference should have looked like this:@refill
-
-@example
-(*Note Catching Mistakes::, for more info.)
-@end example
-
-Incidentally, if you are reading this node in Info and type @kbd{f
-@key{RET}} (@code{Info-follow-reference}), you will generate an error
-message that says:
-
-@example
-No such node: "Catching Mistakes) The only way @dots{}
-@end example
-
-@noindent
-This is because Info perceives the example of the error as the first
-cross reference in this node and if you type a @key{RET} immediately
-after typing the Info @kbd{f} command, Info will attempt to go to the
-referenced node. If you type @kbd{f catch @key{TAB} @key{RET}}, Info
-will complete the node name of the correctly written example and take
-you to the `Catching Mistakes' node. (If you try this, you can return
-from the `Catching Mistakes' node by typing @kbd{l}
-(@code{Info-last}).)
-
-@c !!! section on using Elisp debugger ignored.
-@ignore
-Sometimes @code{texinfo-format-region} will stop long after the
-original error; this is because it does not discover the problem until
-then. In this case, you will need to backtrack.@refill
-
-@c menu
-@c * Using the Emacs Lisp Debugger:: How to use the Emacs Lisp debugger.
-@c end menu
-
-@c node Using the Emacs Lisp Debugger
-@c appendixsubsec Using the Emacs Lisp Debugger
-@c index Using the Emacs Lisp debugger
-@c index Emacs Lisp debugger
-@c index Debugger, using the Emacs Lisp
-
-If an error is especially elusive, you can turn on the Emacs Lisp
-debugger and look at the backtrace; this tells you where in the
-@code{texinfo-format-region} function the problem occurred. You can
-turn on the debugger with the command:@refill
-
-@example
-M-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET}
-@end example
-
-@noindent
-and turn it off with
-
-@example
-M-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET}
-@end example
-
-Often, when you are using the debugger, it is easier to follow what is
-going on if you use the Emacs Lisp files that are not byte-compiled.
-The byte-compiled sources send octal numbers to the debugger that may
-look mysterious. To use the uncompiled source files, load
-@file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file}
-command.@refill
-
-The debugger will not catch an error if @code{texinfo-format-region}
-does not detect one. In the example shown above,
-@code{texinfo-format-region} did not find the error when the whole
-list was formatted, but only when part of the list was formatted.
-When @code{texinfo-format-region} did not find an error, the debugger
-did not find one either. @refill
-
-However, when @code{texinfo-format-region} did report an error, it
-invoked the debugger. This is the backtrace it produced:@refill
-
-@example
----------- Buffer: *Backtrace* ----------
-Signalling: (search-failed "[@},]")
- re-search-forward("[@},]")
- (while ...)
- (let ...)
- texinfo-format-parse-args()
- (let ...)
- texinfo-format-xref()
- funcall(texinfo-format-xref)
- (if ...)
- (let ...)
- (if ...)
- (while ...)
- texinfo-format-scan()
- (save-excursion ...)
- (let ...)
- texinfo-format-region(103370 103631)
-* call-interactively(texinfo-format-region)
----------- Buffer: *Backtrace* ----------
-@end example
-
-The backtrace is read from the bottom up.
-@code{texinfo-format-region} was called interactively; and it, in
-turn, called various functions, including @code{texinfo-format-scan},
-@code{texinfo-format-xref} and @code{texinfo-format-parse-args}.
-Inside the function @code{texinfo-format-parse-args}, the function
-@code{re-search-forward} was called; it was this function that could
-not find the missing right-hand brace.@refill
-
-@xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs
-Manual}, for more information.@refill
-@end ignore
-
-@node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes
-@comment node-name, next, previous, up
-@appendixsec Catching Errors with @TeX{} Formatting
-@cindex Catching errors with @TeX{} formatting
-@cindex Debugging with @TeX{} formatting
-
-You can also catch mistakes when you format a file with @TeX{}.@refill
-
-Usually, you will want to do this after you have run
-@code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
-the same file, because @code{texinfo-format-buffer} sometimes displays
-error messages that make more sense than @TeX{}. (@xref{Debugging
-with Info}, for more information.)@refill
-
-For example, @TeX{} was run on a Texinfo file, part of which is shown
-here:@refill
-
-@example
----------- Buffer: texinfo.texi ----------
-name of the Texinfo file as an extension. The
-@@samp@{??@} are `wildcards' that cause the shell to
-substitute all the raw index files. (@@xref@{sorting
-indices, for more information about sorting
-indices.)@@refill
----------- Buffer: texinfo.texi ----------
-@end example
-
-@noindent
-(The cross reference lacks a closing brace.)
-@TeX{} produced the following output, after which it stopped:@refill
-
-@example
----------- Buffer: *tex-shell* ----------
-Runaway argument?
-@{sorting indices, for more information about sorting
-indices.) @@refill @@ETC.
-! Paragraph ended before @@xref was complete.
-<to be read again>
- @@par
-l.27
-
-?
----------- Buffer: *tex-shell* ----------
-@end example
-
-In this case, @TeX{} produced an accurate and
-understandable error message:
-
-@example
-Paragraph ended before @@xref was complete.
-@end example
-
-@noindent
-@samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
-@samp{l.27} means that @TeX{} detected the problem on line 27 of the
-Texinfo file. The @samp{?} is the prompt @TeX{} uses in this
-circumstance.@refill
-
-Unfortunately, @TeX{} is not always so helpful, and sometimes you must
-truly be a Sherlock Holmes to discover what went wrong.@refill
-
-In any case, if you run into a problem like this, you can do one of three
-things.@refill
-
-@enumerate
-@item
-You can tell @TeX{} to continue running and ignore just this error by
-typing @key{RET} at the @samp{?} prompt.@refill
-
-@item
-You can tell @TeX{} to continue running and to ignore all errors as best
-it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill
-
-This is often the best thing to do. However, beware: the one error
-may produce a cascade of additional error messages as its consequences
-are felt through the rest of the file. To stop @TeX{} when it is
-producing such an avalanche of error messages, type @kbd{C-c} (or
-@kbd{C-c C-c}, if you are running a shell inside Emacs).
-
-@item
-You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
-at the @samp{?} prompt.@refill
-@end enumerate
-
-Please note that if you are running @TeX{} inside Emacs, you need to
-switch to the shell buffer and line at which @TeX{} offers the @samp{?}
-prompt.@refill
-
-Sometimes @TeX{} will format a file without producing error messages even
-though there is a problem. This usually occurs if a command is not ended
-but @TeX{} is able to continue processing anyhow. For example, if you fail
-to end an itemized list with the @code{@@end itemize} command, @TeX{} will
-write a DVI file that you can print out. The only error message that
-@TeX{} will give you is the somewhat mysterious comment that@refill
-
-@example
-(@@end occurred inside a group at level 1)
-@end example
-
-@noindent
-However, if you print the DVI file, you will find that the text
-of the file that follows the itemized list is entirely indented as if
-it were part of the last item in the itemized list. The error message
-is the way @TeX{} says that it expected to find an @code{@@end}
-command somewhere in the file; but that it could not determine where
-it was needed.@refill
-
-Another source of notoriously hard-to-find errors is a missing
-@code{@@end group} command. If you ever are stumped by
-incomprehensible errors, look for a missing @code{@@end group} command
-first.@refill
-
-If the Texinfo file lacks header lines,
-@TeX{} may stop in the
-beginning of its run and display output that looks like the following.
-The @samp{*} indicates that @TeX{} is waiting for input.@refill
-
-@example
-This is TeX, Version 3.14159 (Web2c 7.0)
-(test.texinfo [1])
-*
-@end example
-
-@noindent
-In this case, simply type @kbd{\end @key{RET}} after the asterisk. Then
-write the header lines in the Texinfo file and run the @TeX{} command
-again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\}
-instead of @samp{@@}; and in this circumstance, you are working
-directly with @TeX{}, not with Texinfo.)@refill
-
-@node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes
-@comment node-name, next, previous, up
-@appendixsec Using @code{texinfo-show-structure}
-@cindex Showing the structure of a file
-@findex texinfo-show-structure
-
-It is not always easy to keep track of the nodes, chapters, sections, and
-subsections of a Texinfo file. This is especially true if you are revising
-or adding to a Texinfo file that someone else has written.@refill
-
-In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
-command lists all the lines that begin with the @@-commands that
-specify the structure: @code{@@chapter}, @code{@@section},
-@code{@@appendix}, and so on. With an argument (@w{@kbd{C-u}}
-as prefix argument, if interactive),
-the command also shows the @code{@@node} lines. The
-@code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
-Texinfo mode, by default.@refill
-
-The lines are displayed in a buffer called the @samp{*Occur*} buffer,
-indented by hierarchical level. For example, here is a part of what was
-produced by running @code{texinfo-show-structure} on this manual:@refill
-
-@example
-@group
- Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
- unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
- in buffer texinfo.texi.
- @dots{}
- 4177:@@chapter Nodes
- 4198: @@heading Two Paths
- 4231: @@section Node and Menu Illustration
- 4337: @@section The @@code@{@@@@node@} Command
- 4393: @@subheading Choosing Node and Pointer Names
- 4417: @@subsection How to Write an @@code@{@@@@node@} Line
- 4469: @@subsection @@code@{@@@@node@} Line Tips
- @dots{}
-@end group
-@end example
-
-This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
-with the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
-commands respectively. If you move your cursor into the @samp{*Occur*}
-window, you can position the cursor over one of the lines and use the
-@kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
-the corresponding spot in the Texinfo file. @xref{Other Repeating
-Search, , Using Occur, emacs, The GNU Emacs Manual}, for more
-information about @code{occur-mode-goto-occurrence}.@refill
-
-The first line in the @samp{*Occur*} window describes the @dfn{regular
-expression} specified by @var{texinfo-heading-pattern}. This regular
-expression is the pattern that @code{texinfo-show-structure} looks for.
-@xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
-for more information.@refill
-
-When you invoke the @code{texinfo-show-structure} command, Emacs will
-display the structure of the whole buffer. If you want to see the
-structure of just a part of the buffer, of one chapter, for example,
-use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
-region. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.) This is
-how the example used above was generated. (To see the whole buffer
-again, use @kbd{C-x n w} (@code{widen}).)@refill
-
-If you call @code{texinfo-show-structure} with a prefix argument by
-typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
-@code{@@node} as well as the lines beginning with the @@-sign commands
-for @code{@@chapter}, @code{@@section}, and the like.@refill
-
-You can remind yourself of the structure of a Texinfo file by looking at
-the list in the @samp{*Occur*} window; and if you have mis-named a node
-or left out a section, you can correct the mistake.@refill
-
-@node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes
-@comment node-name, next, previous, up
-@appendixsec Using @code{occur}
-@cindex Occurrences, listing with @code{@@occur}
-@findex occur
-
-Sometimes the @code{texinfo-show-structure} command produces too much
-information. Perhaps you want to remind yourself of the overall structure
-of a Texinfo file, and are overwhelmed by the detailed list produced by
-@code{texinfo-show-structure}. In this case, you can use the @code{occur}
-command directly. To do this, type@refill
-
-@example
-@kbd{M-x occur}
-@end example
-
-@noindent
-and then, when prompted, type a @dfn{regexp}, a regular expression for
-the pattern you want to match. (@xref{Regexps, , Regular Expressions,
-emacs, The GNU Emacs Manual}.) The @code{occur} command works from
-the current location of the cursor in the buffer to the end of the
-buffer. If you want to run @code{occur} on the whole buffer, place
-the cursor at the beginning of the buffer.@refill
-
-For example, to see all the lines that contain the word
-@samp{@@chapter} in them, just type @samp{@@chapter}. This will
-produce a list of the chapters. It will also list all the sentences
-with @samp{@@chapter} in the middle of the line.@refill
-
-If you want to see only those lines that start with the word
-@samp{@@chapter}, type @samp{^@@chapter} when prompted by
-@code{occur}. If you want to see all the lines that end with a word
-or phrase, end the last word with a @samp{$}; for example,
-@samp{catching mistakes$}. This can be helpful when you want to see
-all the nodes that are part of the same chapter or section and
-therefore have the same `Up' pointer.@refill
-
-@xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
-for more information.@refill
-
-@node Running Info-Validate, , Using occur, Catching Mistakes
-@comment node-name, next, previous, up
-@appendixsec Finding Badly Referenced Nodes
-@findex Info-validate
-@cindex Nodes, checking for badly referenced
-@cindex Checking for badly referenced nodes
-@cindex Looking for badly referenced nodes
-@cindex Finding badly referenced nodes
-@cindex Badly referenced nodes
-
-You can use the @code{Info-validate} command to check whether any of
-the `Next', `Previous', `Up' or other node pointers fail to point to a
-node. This command checks that every node pointer points to an
-existing node. The @code{Info-validate} command works only on Info
-files, not on Texinfo files.@refill
-
-The @code{makeinfo} program validates pointers automatically, so you
-do not need to use the @code{Info-validate} command if you are using
-@code{makeinfo}. You only may need to use @code{Info-validate} if you
-are unable to run @code{makeinfo} and instead must create an Info file
-using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
-if you write an Info file from scratch.@refill
-
-@menu
-* Using Info-validate:: How to run @code{Info-validate}.
-* Unsplit:: How to create an unsplit file.
-* Tagifying:: How to tagify a file.
-* Splitting:: How to split a file manually.
-@end menu
-
-@node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate
-@appendixsubsec Running @code{Info-validate}
-@cindex Running @code{Info-validate}
-@cindex Info validating a large file
-@cindex Validating a large file
-
-To use @code{Info-validate}, visit the Info file you wish to check and
-type:@refill
-
-@example
-M-x Info-validate
-@end example
-
-@noindent
-(Note that the @code{Info-validate} command requires an upper case
-`I'. You may also need to create a tag table before running
-@code{Info-validate}. @xref{Tagifying}.)@refill
-
-If your file is valid, you will receive a message that says ``File appears
-valid''. However, if you have a pointer that does not point to a node,
-error messages will be displayed in a buffer called @samp{*problems in
-info file*}.@refill
-
-For example, @code{Info-validate} was run on a test file that contained
-only the first node of this manual. One of the messages said:@refill
-
-@example
-In node "Overview", invalid Next: Texinfo Mode
-@end example
-
-@noindent
-This meant that the node called @samp{Overview} had a `Next' pointer that
-did not point to anything (which was true in this case, since the test file
-had only one node in it).@refill
-
-Now suppose we add a node named @samp{Texinfo Mode} to our test case
-but we do not specify a `Previous' for this node. Then we will get
-the following error message:@refill
-
-@example
-In node "Texinfo Mode", should have Previous: Overview
-@end example
-
-@noindent
-This is because every `Next' pointer should be matched by a
-`Previous' (in the node where the `Next' points) which points back.@refill
-
-@code{Info-validate} also checks that all menu entries and cross references
-point to actual nodes.@refill
-
-Note that @code{Info-validate} requires a tag table and does not work
-with files that have been split. (The @code{texinfo-format-buffer}
-command automatically splits large files.) In order to use
-@code{Info-validate} on a large file, you must run
-@code{texinfo-format-buffer} with an argument so that it does not split
-the Info file; and you must create a tag table for the unsplit
-file.@refill
-
-@node Unsplit, Tagifying, Using Info-validate, Running Info-Validate
-@comment node-name, next, previous, up
-@appendixsubsec Creating an Unsplit File
-@cindex Creating an unsplit file
-@cindex Unsplit file creation
-
-You can run @code{Info-validate} only on a single Info file that has a
-tag table. The command will not work on the indirect subfiles that
-are generated when a master file is split. If you have a large file
-(longer than 70,000 bytes or so), you need to run the
-@code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
-a way that it does not create indirect subfiles. You will also need
-to create a tag table for the Info file. After you have done this,
-you can run @code{Info-validate} and look for badly referenced
-nodes.@refill
-
-The first step is to create an unsplit Info file. To prevent
-@code{texinfo-format-buffer} from splitting a Texinfo file into
-smaller Info files, give a prefix to the @kbd{M-x
-texinfo-format-buffer} command:@refill
-
-@example
-C-u M-x texinfo-format-buffer
-@end example
-
-@noindent
-or else
-
-@example
-C-u C-c C-e C-b
-@end example
-
-@noindent
-When you do this, Texinfo will not split the file and will not create
-a tag table for it. @refill
-@cindex Making a tag table manually
-@cindex Tag table, making manually
-
-@node Tagifying, Splitting, Unsplit, Running Info-Validate
-@appendixsubsec Tagifying a File
-
-After creating an unsplit Info file, you must create a tag table for
-it. Visit the Info file you wish to tagify and type:@refill
-
-@example
-M-x Info-tagify
-@end example
-
-@noindent
-(Note the upper case @samp{I} in @code{Info-tagify}.) This creates an
-Info file with a tag table that you can validate.@refill
-
-The third step is to validate the Info file:@refill
-
-@example
-M-x Info-validate
-@end example
-
-@noindent
-(Note the upper case @samp{I} in @code{Info-validate}.)
-In brief, the steps are:@refill
-
-@example
-@group
-C-u M-x texinfo-format-buffer
-M-x Info-tagify
-M-x Info-validate
-@end group
-@end example
-
-After you have validated the node structure, you can rerun
-@code{texinfo-format-buffer} in the normal way so it will construct a
-tag table and split the file automatically, or you can make the tag
-table and split the file manually.@refill
-
-@node Splitting, , Tagifying, Running Info-Validate
-@comment node-name, next, previous, up
-@appendixsubsec Splitting a File Manually
-@cindex Splitting an Info file manually
-@cindex Info file, splitting manually
-
-You should split a large file or else let the
-@code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
-for you automatically. (Generally you will let one of the formatting
-commands do this job for you. @xref{Create an Info File}.)@refill
-
-The split-off files are called the indirect subfiles.@refill
-
-Info files are split to save memory. With smaller files, Emacs does not
-have make such a large buffer to hold the information.@refill
-
-If an Info file has more than 30 nodes, you should also make a tag
-table for it. @xref{Using Info-validate}, for information
-about creating a tag table. (Again, tag tables are usually created
-automatically by the formatting command; you only need to create a tag
-table yourself if you are doing the job manually. Most likely, you
-will do this for a large, unsplit file on which you have run
-@code{Info-validate}.)@refill
-
-@c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51
-@ignore
-Before running @code{Info-split}, you need to load the @code{info} library
-into Emacs by giving the command @kbd{M-x load-library @key{RET} info
-@key{RET}}.
-@end ignore
-
-Visit the Info file you wish to tagify and split and type the two
-commands:@refill
-
-@example
-M-x Info-tagify
-M-x Info-split
-@end example
-
-@noindent
-(Note that the @samp{I} in @samp{Info} is upper case.)@refill
-
-When you use the @code{Info-split} command, the buffer is modified into a
-(small) Info file which lists the indirect subfiles. This file should be
-saved in place of the original visited file. The indirect subfiles are
-written in the same directory the original file is in, with names generated
-by appending @samp{-} and a number to the original file name.@refill
-
-The primary file still functions as an Info file, but it contains just
-the tag table and a directory of subfiles.@refill
-
-
-@node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top
-@appendix Refilling Paragraphs
-@cindex Refilling paragraphs
-@cindex Filling paragraphs
-@findex refill
-
-The @code{@@refill} command refills and, optionally, indents the first
-line of a paragraph.@footnote{Perhaps the command should have been
-called the @code{@@refillandindent} command, but @code{@@refill} is
-shorter and the name was chosen before indenting was possible.} The
-@code{@@refill} command is no longer important, but we describe it here
-because you once needed it. You will see it in many old Texinfo
-files.@refill
-
-Without refilling, paragraphs containing long @@-constructs may look
-bad after formatting because the formatter removes @@-commands and
-shortens some lines more than others. In the past, neither the
-@code{texinfo-format-region} command nor the
-@code{texinfo-format-buffer} command refilled paragraphs
-automatically. The @code{@@refill} command had to be written at the
-end of every paragraph to cause these formatters to fill them. (Both
-@TeX{} and @code{makeinfo} have always refilled paragraphs
-automatically.) Now, all the Info formatters automatically fill and
-indent those paragraphs that need to be filled and indented.@refill
-
-The @code{@@refill} command causes @code{texinfo-format-region} and
-@code{texinfo-format-buffer} to refill a paragraph in the Info file
-@emph{after} all the other processing has been done. For this reason,
-you can not use @code{@@refill} with a paragraph containing either
-@code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will
-override those two commands.@refill
-
-The @code{texinfo-format-region} and @code{texinfo-format-buffer}
-commands now automatically append @code{@@refill} to the end of each
-paragraph that should be filled. They do not append @code{@@refill} to
-the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
-and therefore do not refill or indent them.@refill
-
-
-@node Command Syntax, Obtaining TeX, Refilling Paragraphs, Top
-@comment node-name, next, previous, up
-@appendix @@-Command Syntax
-@cindex @@-command syntax
-
-The character @samp{@@} is used to start special Texinfo commands.
-(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo
-has four types of @@-command:@refill
-
-@table @asis
-@item 1. Non-alphabetic commands.
-These commands consist of an @@ followed by a punctuation mark or other
-character that is not part of the alphabet. Non-alphabetic commands are
-almost always part of the text within a paragraph, and never take any
-argument. The two characters (@@ and the other one) are complete in
-themselves; none is followed by braces. The non-alphabetic commands
-are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@kbd{SPACE}},
-@code{@@@kbd{TAB}}, @code{@@@kbd{NL}}, @code{@@@@}, @code{@@@{}, and
-@code{@@@}}.@refill
-
-@item 2. Alphabetic commands that do not require arguments.
-These commands start with @@ followed by a word followed by left- and
-right-hand braces. These commands insert special symbols in the
-document; they do not require arguments. For example,
-@code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
-@result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}',
-and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill
-
-@item 3. Alphabetic commands that require arguments within braces.
-These commands start with @@ followed by a letter or a word, followed by an
-argument within braces. For example, the command @code{@@dfn} indicates
-the introductory or defining use of a term; it is used as follows: @samp{In
-Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill
-
-@item 4. Alphabetic commands that occupy an entire line.
-These commands occupy an entire line. The line starts with @@,
-followed by the name of the command (a word); for example, @code{@@center}
-or @code{@@cindex}. If no argument is needed, the word is followed by
-the end of the line. If there is an argument, it is separated from
-the command name by a space. Braces are not used.@refill
-@end table
-
-@cindex Braces and argument syntax
-Thus, the alphabetic commands fall into classes that have
-different argument syntaxes. You cannot tell to which class a command
-belongs by the appearance of its name, but you can tell by the
-command's meaning: if the command stands for a glyph, it is in
-class 2 and does not require an argument; if it makes sense to use the
-command together with other text as part of a paragraph, the command
-is in class 3 and must be followed by an argument in braces;
-otherwise, it is in class 4 and uses the rest of the line as its
-argument.@refill
-
-The purpose of having a different syntax for commands of classes 3 and
-4 is to make Texinfo files easier to read, and also to help the GNU
-Emacs paragraph and filling commands work properly. There is only one
-exception to this rule: the command @code{@@refill}, which is always
-used at the end of a paragraph immediately following the final period
-or other punctuation character. @code{@@refill} takes no argument and
-does @emph{not} require braces. @code{@@refill} never confuses the
-Emacs paragraph commands because it cannot appear at the beginning of
-a line.@refill
-
-
-@node Obtaining TeX, Command and Variable Index, Command Syntax, Top
-@appendix How to Obtain @TeX{}
-@cindex Obtaining @TeX{}
-@cindex @TeX{}, how to obtain
-
-@c !!! Here is information about obtaining TeX. Update it whenever.
-@c !!! Also consider updating TeX.README on ftp.gnu.org.
-@c Updated by RJC on 1 March 1995, conversation with MacKay.
-@c Updated by kb@cs.umb.edu on 29 July 1996.
-@c Updated by kb@cs.umb.edu on 25 April 1997.
-@c Updated by kb@cs.umb.edu on 27 February 1998.
-@TeX{} is freely redistributable. You can obtain @TeX{} for Unix
-systems via anonymous ftp or on physical media. The core material
-consists of the Web2c @TeX{} distribution (@uref{http://tug.org/web2c}).
-
-Instructions for retrieval by anonymous ftp and information on other
-available distributions:
-@example
-@uref{ftp://tug.org/tex/unixtex.ftp}
-@uref{http://tug.org/unixtex.ftp}
-@end example
-
-The Free Software Foundation provides a core distribution on its Source
-Code CD-ROM suitable for printing Texinfo manuals; the University of
-Washington maintains and supports a tape distribution; the @TeX{} Users
-Group co-sponsors a complete CD-ROM @TeX{} distribution.
-
-@itemize @bullet
-
-@item
-For the FSF Source Code CD-ROM, please contact:
-
-@iftex
-@display
-@group
-Free Software Foundation, Inc.
-59 Temple Place Suite 330
-Boston, MA @ @ 02111-1307
-USA
-Telephone: @w{+1-617-542-5942}
-Fax: (including Japan) @w{+1-617-542-2652}
-Free Dial Fax (in Japan):
-@w{ } @w{ } @w{ } 0031-13-2473 (KDD)
-@w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
-Electronic mail: @code{gnu@@gnu.org}
-@end group
-@end display
-@end iftex
-@ifinfo
-@display
-@group
-Free Software Foundation, Inc.
-59 Temple Place Suite 330
-Boston, MA @w{ } 02111-1307
-USA
-
-Telephone: @w{+1-617-542-5942}
-Fax: (including Japan) @w{+1-617-542-2652}
-Free Dial Fax (in Japan):
-@w{ } @w{ } @w{ } 0031-13-2473 (KDD)
-@w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
-Electronic mail: @code{gnu@@gnu.org}
-@end group
-@end display
-@end ifinfo
-
-@item
-To order a complete distribution on CD-ROM, please see
-@uref{http://tug.org/tex-live.html}. (This distribution is also
-available by FTP; see the URL's above.)
-
-@item
-To order a full distribution from the University of Washington on either
-a 1/4@dmn{in} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge,
-send $210 to:
-
-@display
-@group
-Pierre A. MacKay
-Denny Hall, Mail Stop DH-10
-University of Washington
-Seattle, WA @w{ } 98195
-USA
-Telephone: +1-206-543-2268
-Electronic mail: @code{mackay@@cs.washington.edu}
-@end group
-@end display
-
-@noindent Please make checks payable to the University of Washington.
-Checks must be in U.S.@: dollars, drawn on a U.S.@: bank. Overseas
-sites: please add to the base cost, if desired, $20.00 for shipment via
-air parcel post, or $30.00 for shipment via courier.
-
-@end itemize
-
-Many other @TeX{} distributions are available; see
-@uref{http://tug.org/}.
-
-
-@c These are no longer ``new'', and the explanations
-@c are all given elsewhere anyway, I think. --karl, 25apr97.
-@ignore (the entire appendix)
-@c node New Features, Command and Variable Index, Obtaining TeX, Top
-@c appendix Second Edition Features
-
-@tex
-% Widen the space for the first column so three control-character
-% strings fit in the first column. Switched back to default .8in
-% value at end of chapter.
-\global\tableindent=1.0in
-@end tex
-
-The second edition of the Texinfo manual describes more than 20 new
-Texinfo mode commands and more than 50 previously undocumented Texinfo
-@@-commands. This edition is more than twice the length of the first
-edition.@refill
-
-Here is a brief description of the new commands.@refill
-
-@menu
-* New Texinfo Mode Commands:: The updating commands are especially useful.
-* New Commands:: Many newly described @@-commands.
-@end menu
-
-@c node New Texinfo Mode Commands, New Commands, Obtaining TeX, Obtaining TeX
-@c appendixsec New Texinfo Mode Commands
-
-Texinfo mode provides commands and features especially designed for
-working with Texinfo files. More than 20 new commands have been
-added, including commands for automatically creating and updating
-both nodes and menus. This is a tedious task when done by hand.@refill
-
-The keybindings are intended to be somewhat mnemonic.@refill
-
-@c subheading Update all nodes and menus
-
-The @code{texinfo-master-menu} command is the primary command:
-
-@table @kbd
-@item C-c C-u m
-@itemx M-x texinfo-master-menu
-Create or update a master menu.
-With @kbd{C-u} as a prefix argument,
-first create or update all nodes
-and regular menus.
-@end table
-
-@c subheading Update Pointers
-
-@noindent
-Create or update `Next', `Previous', and `Up' node pointers.@refill
-
-@noindent
-@xref{Updating Nodes and Menus}.
-
-@table @kbd
-@item C-c C-u C-n
-@itemx M-x texinfo-update-node
-Update a node.
-
-@item C-c C-u C-e
-@itemx M-x texinfo-every-node-update
-Update every node in the buffer.
-@end table
-
-@c subheading Update Menus
-
-@noindent
-Create or update menus.@refill
-
-@noindent
-@xref{Updating Nodes and Menus}.
-
-@table @kbd
-@item C-c C-u C-m
-@itemx M-x texinfo-make-menu
-Make or update a menu.
-
-@item C-c C-u C-a
-@itemx M-x texinfo-all-menus-update
-Make or update all the menus in a buffer.
-With @kbd{C-u} as a prefix argument,
-first update all the nodes.
-@end table
-
-@c subheading Insert Title as Description
-
-@noindent
-Insert a node's chapter or section title in the space for the
-description in a menu entry line; position point so you can edit the
-insert. (This command works somewhat differently than the other
-insertion commands, which insert only a predefined string.)@refill
-
-@noindent
-@xref{Inserting, Inserting Frequently Used Commands}.
-
-@table @kbd
-@item C-c C-c C-d
-Insert title.
-@end table
-
-@c subheading Format for Info
-
-@noindent
-Provide keybindings both for the Info formatting commands that are
-written in Emacs Lisp and for @code{makeinfo} that is written in
-C.@refill
-
-@noindent
-@xref{Info Formatting}.
-
-@noindent
-Use the Emacs lisp @code{texinfo-format@dots{}} commands:
-
-@table @kbd
-@item C-c C-e C-r
-Format the region.
-
-@item C-c C-e C-b
-Format the buffer.
-@end table
-
-@noindent
-Use @code{makeinfo}:
-
-@table @kbd
-@item C-c C-m C-r
-Format the region.
-
-@item C-c C-m C-b
-Format the buffer.
-
-@item C-c C-m C-l
-Recenter the @code{makeinfo} output buffer.
-
-@item C-c C-m C-k
-Kill the @code{makeinfo} formatting job.
-@end table
-
-@c subheading Typeset and Print
-
-@noindent
-Typeset and print Texinfo documents from within Emacs.@refill
-
-@ifinfo
-@noindent
-@xref{Printing}.
-@end ifinfo
-@iftex
-@noindent
-@xref{Printing, , Formatting and Printing}.
-@end iftex
-
-@table @kbd
-@item C-c C-t C-b
-Run @code{texi2dvi} on the buffer.
-
-@item C-c C-t C-r
-Run @TeX{} on the region.
-
-@item C-c C-t C-i
-Run @code{texindex}.
-
-@item C-c C-t C-p
-Print the DVI file.
-
-@item C-c C-t C-q
-Show the print queue.
-
-@item C-c C-t C-d
-Delete a job from the print queue.
-
-@item C-c C-t C-k
-Kill the current @TeX{} formatting job.
-
-@item C-c C-t C-x
-Quit a currently stopped @TeX{} formatting job.
-
-@item C-c C-t C-l
-Recenter the output buffer.
-@end table
-
-@c subheading Other Updating Commands
-
-@noindent
-The ``other updating commands'' do not have standard keybindings because
-they are used less frequently.@refill
-
-@noindent
-@xref{Other Updating Commands}.
-
-@table @kbd
-@item M-x texinfo-insert-node-lines
-Insert missing @code{@@node} lines using
-section titles as node names.
-
-@item M-x texinfo-multiple-files-update
-Update a multi-file document.
-With a numeric prefix, such as @kbd{C-u 8},
-update @strong{every} pointer and
-menu in @strong{all} the files and
-then insert a master menu.
-
-@item M-x texinfo-indent-menu-description
-Indent descriptions in menus.
-
-@item M-x texinfo-sequential-node-update
-Insert node pointers in strict sequence.
-@end table
-
-@c node New Commands, , New Texinfo Mode Commands, Obtaining TeX
-@c appendixsec New Texinfo @@-Commands
-
-The second edition of the Texinfo manual describes more than 50
-commands that were not described in the first edition. A third or so
-of these commands existed in Texinfo but were not documented in the
-manual; the others are new. Here is a listing, with brief
-descriptions of them:@refill
-
-@c subheading Indexing
-
-@noindent
-Create your own index, and merge indices.@refill
-
-@noindent
-@xref{Indices}.
-
-@table @kbd
-@item @@defindex @var{index-name}
-Define a new index and its indexing command.
-See also the @code{@@defcodeindex} command.
-
-@c written verbosely to avoid overfull hbox
-@item @@synindex @var{from-index} @var{into-index}
-Merge the @var{from-index} index into the @var{into-index} index.
-See also the @code{@@syncodeindex} command.
-@end table
-
-@c subheading Definitions
-
-@noindent
-Describe functions, variables, macros,
-commands, user options, special forms, and other such artifacts in a
-uniform format.@refill
-
-@noindent
-@xref{Definition Commands}.
-
-@table @kbd
-@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
-Format a description for functions, interactive
-commands, and similar entities.
-
-@item @@defvr, @@defop, @dots{}
-15 other related commands.
-@end table
-
-@c subheading Glyphs
-
-@noindent
-Indicate the results of evaluation, expansion,
-printed output, an error message, equivalence of expressions, and the
-location of point.@refill
-
-@noindent
-@xref{Glyphs}.
-
-@table @kbd
-@item @@equiv@{@}
-@itemx @equiv{}
-Equivalence:
-
-@item @@error@{@}
-@itemx @error{}
-Error message
-
-@item @@expansion@{@}
-@itemx @expansion{}
-Macro expansion
-
-@item @@point@{@}
-@itemx @point{}
-Position of point
-
-@item @@print@{@}
-@itemx @print{}
-Printed output
-
-@item @@result@{@}
-@itemx @result{}
-Result of an expression
-@end table
-
-@c subheading Page Headings
-
-@noindent
-Customize page headings.
-
-@noindent
-@xref{Headings}.
-
-@table @kbd
-@item @@headings @var{on-off-single-double}
-Headings on or off, single, or double-sided.
-
-@item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
-Footings for even-numbered (left-hand) pages.
-
-@item @@evenheading, @@everyheading, @@oddheading, @dots{}
-Five other related commands.
-
-@item @@thischapter
-Insert name of chapter and chapter number.
-
-@item @@thischaptername, @@thisfile, @@thistitle, @@thispage
-Related commands.
-@end table
-
-@c subheading Formatting
-
-@noindent
-Format blocks of text.
-
-@noindent
-@xref{Quotations and Examples}, and@*
-@ref{Lists and Tables, , Making Lists and Tables}.
-
-@table @kbd
-@item @@cartouche
-Draw rounded box surrounding text (not in Info).
-
-@item @@enumerate @var{optional-arg}
-Enumerate a list with letters or numbers.
-
-@item @@exdent @var{line-of-text}
-Remove indentation.
-
-@item @@flushleft
-Left justify.
-
-@item @@flushright
-Right justify.
-
-@item @@format
-Do not narrow nor change font.
-
-@item @@ftable @var{formatting-command}
-@itemx @@vtable @var{formatting-command}
-Two-column table with indexing.
-
-@item @@lisp
-For an example of Lisp code.
-
-@item @@smallexample
-@itemx @@smalllisp
-Like @@table and @@lisp @r{but for} @@smallbook.
-@end table
-
-@c subheading Conditionals
-
-@noindent
-Conditionally format text.
-
-@noindent
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
-
-@table @kbd
-@item @@set @var{flag} [@var{string}]
-Set a flag. Optionally, set value
-of @var{flag} to @var{string}.
-
-@item @@clear @var{flag}
-Clear a flag.
-
-@item @@value@{@var{flag}@}
-Replace with value to which @var{flag} is set.
-
-@item @@ifset @var{flag}
-Format, if @var{flag} is set.
-
-@item @@ifclear @var{flag}
-Ignore, if @var{flag} is set.
-@end table
-
-@c subheading @@heading series for Titles
-
-@noindent
-Produce unnumbered headings that do not appear in a table of contents.
-
-@noindent
-@xref{Structuring}.
-
-@table @kbd
-@item @@heading @var{title}
-Unnumbered section-like heading not listed
-in the table of contents of a printed manual.
-
-@item @@chapheading, @@majorheading, @@c subheading, @@subsubheading
-Related commands.
-@end table
-
-@need 1000
-@c subheading Font commands
-
-@need 1000
-@noindent
-@xref{Smallcaps}, and @*
-@ref{Fonts}.
-
-@table @kbd
-@item @@r@{@var{text}@}
-Print in roman font.
-
-@item @@sc@{@var{text}@}
-Print in @sc{small caps} font.
-@end table
-
-@c subheading Miscellaneous
-
-@noindent
-See @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@*
-see @ref{Customized Highlighting},@*
-see @ref{Overfull hboxes},@*
-see @ref{Footnotes},@*
-see @ref{dmn, , Format a Dimension},@*
-see @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@*
-see @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@*
-see @ref{minus, , Inserting a Minus Sign},@*
-see @ref{paragraphindent, , Paragraph Indenting},@*
-see @ref{Cross Reference Commands},@*
-see @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@*
-see @ref{Custom Headings, , How to Make Your Own Headings}.
-
-@table @kbd
-@item @@author @var{author}
-Typeset author's name.
-
-@c @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
-@c Define a highlighting command for Info. (Info only.)
-
-@item @@finalout
-Produce cleaner printed output.
-
-@item @@footnotestyle @var{end-or-separate}
-Specify footnote style.
-
-@item @@dmn@{@var{dimension}@}
-Format a dimension.
-
-@item @@global@@let@var{new-cmd}=@var{existing-cmd}
-Define a highlighting command for @TeX{}. (@TeX{} only.)
-
-@item @@lowersections
-Reduce hierarchical level of sectioning commands.
-
-@item @@math@{@var{mathematical-expression}@}
-Format a mathematical expression.
-
-@item @@minus@{@}
-Generate a minus sign.
-
-@item @@paragraphindent @var{asis-or-number}
-Specify paragraph indentation.
-
-@item @@raisesections
-Raise hierarchical level of sectioning commands.
-
-@item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@}
-Make a reference. In the printed manual, the
-reference does not start with the word `see'.
-
-@item @@title @var{title}
-Typeset @var{title} in the alternative
-title page format.
-
-@item @@subtitle @var{subtitle}
-Typeset @var{subtitle} in the alternative
-title page format.
-
-@item @@today@{@}
-Insert the current date.
-@end table
-@tex
-% Switch width of first column of tables back to default value
-\global\tableindent=.8in
-@end tex
-@end ignore
-
-@node Command and Variable Index, Concept Index, Obtaining TeX, Top
-@comment node-name, next, previous, up
-@unnumbered Command and Variable Index
-
-This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
-functions, and several variables. To make the list easier to use, the
-commands are listed without their preceding @samp{@@}.@refill
-
-@printindex fn
-
-
-@node Concept Index, , Command and Variable Index, Top
-@unnumbered Concept Index
-
-@printindex cp
-
-
-@summarycontents
-@contents
-@bye
diff --git a/contrib/texinfo/doc/userdoc.texi b/contrib/texinfo/doc/userdoc.texi
deleted file mode 100644
index cee6b084efab..000000000000
--- a/contrib/texinfo/doc/userdoc.texi
+++ /dev/null
@@ -1,1270 +0,0 @@
-@c This file is meant to be included in any arbitrary piece of
-@c documentation that wishes to describe the info program. Some day
-@c info-stnd.texi should probably use this file instead of duplicating
-@c its contents.
-@c
-@c This file documents the use of the standalone GNU Info program,
-@c versions 2.7 and later.
-
-@ifclear InfoProgVer
-@set InfoProgVer 2.11
-@end ifclear
-@synindex vr cp
-@synindex fn cp
-@synindex ky cp
-
-@heading What is Info?
-
-This text documents the use of the GNU Info program, version
-@value{InfoProgVer}.
-
-@dfn{Info} is a program which is used to view info files on an ASCII
-terminal. @dfn{info files} are the result of processing texinfo files
-with the program @code{makeinfo} or with the Emacs command @code{M-x
-texinfo-format-buffer}. Finally, @dfn{texinfo} is a documentation
-language which allows a printed manual and online documentation (an info
-file) to be produced from a single source file.
-
-@menu
-* Options:: Options you can pass on the command line.
-* Cursor Commands:: Commands which move the cursor within a node.
-* Scrolling Commands:: Commands for moving the node around in a window.
-* Node Commands:: Commands for selecting a new node.
-* Searching Commands:: Commands for searching an info file.
-* Xref Commands:: Commands for selecting cross references.
-* Window Commands:: Commands which manipulate multiple windows.
-* Printing Nodes:: How to print out the contents of a node.
-* Miscellaneous Commands:: A few commands that defy categories.
-* Variables:: How to change the default behaviour of Info.
-@ifset NOTSET
-* Info for Sys Admins:: How to setup Info. Using special options.
-@end ifset
-@ifset STANDALONE
-* GNU Info Global Index:: Global index containing keystrokes, command names,
- variable names, and general concepts.
-@end ifset
-@end menu
-
-@node Options
-@chapter Command Line Options
-@cindex command line options
-@cindex arguments, command line
-
-GNU Info accepts several options to control the initial node being
-viewed, and to specify which directories to search for info files. Here
-is a template showing an invocation of GNU Info from the shell:
-
-@example
-info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
-@end example
-
-The following @var{option-names} are available when invoking Info from
-the shell:
-
-@table @code
-@cindex directory path
-@item --directory @var{directory-path}
-@itemx -d @var{directory-path}
-Adds @var{directory-path} to the list of directory paths searched when
-Info needs to find a file. You may issue @code{--directory} multiple
-times; once for each directory which contains info files.
-Alternatively, you may specify a value for the environment variable
-@code{INFOPATH}; if @code{--directory} is not given, the value of
-@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon
-separated list of directory names. If you do not supply
-@code{INFOPATH} or @code{--directory-path} a default path is used.
-
-@item --file @var{filename}
-@itemx -f @var{filename}
-@cindex info file, selecting
-Specifies a particular info file to visit. Instead of visiting the file
-@code{dir}, Info will start with @code{(@var{filename})Top} as the first
-file and node.
-
-@item --node @var{nodename}
-@itemx -n @var{nodename}
-@cindex node, selecting
-Specifies a particular node to visit in the initial file loaded. This
-is especially useful in conjunction with @code{--file}@footnote{Of
-course, you can specify both the file and node in a @code{--node}
-command; but don't forget to escape the open and close parentheses from
-the shell as in: @code{info --node '(emacs)Buffers'}}. You may specify
-@code{--node} multiple times; for an interactive Info, each
-@var{nodename} is visited in its own window, for a non-interactive Info
-(such as when @code{--output} is given) each @var{nodename} is processed
-sequentially.
-
-@item --output @var{filename}
-@itemx -o @var{filename}
-@cindex file, outputting to
-@cindex outputting to a file
-Specify @var{filename} as the name of a file to output to. Each node
-that Info visits will be output to @var{filename} instead of
-interactively viewed. A value of @code{-} for @var{filename} specifies
-the standard output.
-
-@item --subnodes
-@cindex @code{--subnodes}, command line option
-This option only has meaning when given in conjunction with
-@code{--output}. It means to recursively output the nodes appearing in
-the menus of each node being output. Menu items which resolve to
-external info files are not output, and neither are menu items which are
-members of an index. Each node is only output once.
-
-@item --help
-@itemx -h
-Produces a relatively brief description of the available Info options.
-
-@item --version
-@cindex version information
-Prints the version information of Info and exits.
-
-@item @var{menu-item}
-@cindex menu, following
-Remaining arguments to Info are treated as the names of menu items. The
-first argument would be a menu item in the initial node visited, while
-the second argument would be a menu item in the first argument's node.
-You can easily move to the node of your choice by specifying the menu
-names which describe the path to that node. For example,
-
-@example
-info emacs buffers
-@end example
-
-first selects the menu item @samp{Emacs} in the node @samp{(dir)Top},
-and then selects the menu item @samp{Buffers} in the node
-@samp{(emacs)Top}.
-
-@end table
-
-@node Cursor Commands
-@chapter Moving the Cursor
-@cindex cursor, moving
-Many people find that reading screens of text page by page is made
-easier when one is able to indicate particular pieces of text with some
-kind of pointing device. Since this is the case, GNU Info (both the
-Emacs and standalone versions) have several commands which allow you to
-move the cursor about the screen. The notation used in this manual to
-describe keystrokes is identical to the notation used within the Emacs
-manual, and the GNU Readline manual. @xref{Characters, , Character
-Conventions, emacs, the GNU Emacs Manual}, if you are unfamilar with the
-notation.
-
-The following table lists the basic cursor movement commands in Info.
-Each entry consists of the key sequence you should type to execute the
-cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it
-invokes @code{execute-extended-command}. @xref{M-x, , Executing an
-extended command, emacs, the GNU Emacs Manual}, for more detailed
-information.} command name (displayed in parentheses), and a short
-description of what the command does. All of the cursor motion commands
-can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
-@code{universal-argument}}), to find out how to supply them. With a
-numeric argument, the motion commands are simply executed that
-many times; for example, a numeric argument of 4 given to
-@code{next-line} causes the cursor to move down 4 lines. With a
-negative numeric argument, the motion is reversed; an argument of -4
-given to the @code{next-line} command would cause the cursor to move
-@emph{up} 4 lines.
-
-@table @asis
-@item @code{C-n} (@code{next-line})
-@kindex C-n
-@findex next-line
-Moves the cursor down to the next line.
-
-@item @code{C-p} (@code{prev-line})
-@kindex C-p
-@findex prev-line
-Move the cursor up to the previous line.
-
-@item @code{C-a} (@code{beginning-of-line})
-@kindex C-a, in Info windows
-@findex beginning-of-line
-Move the cursor to the start of the current line.
-
-@item @code{C-e} (@code{end-of-line})
-@kindex C-e, in Info windows
-@findex end-of-line
-Moves the cursor to the end of the current line.
-
-@item @code{C-f} (@code{forward-char})
-@kindex C-f, in Info windows
-@findex forward-char
-Move the cursor forward a character.
-
-@item @code{C-b} (@code{backward-char})
-@kindex C-b, in Info windows
-@findex backward-char
-Move the cursor backward a character.
-
-@item @code{M-f} (@code{forward-word})
-@kindex M-f, in Info windows
-@findex forward-word
-Moves the cursor forward a word.
-
-@item @code{M-b} (@code{backward-word})
-@kindex M-b, in Info winows
-@findex backward-word
-Moves the cursor backward a word.
-
-@item @code{M-<} (@code{beginning-of-node})
-@itemx @code{b}
-@kindex b, in Info winows
-@kindex M-<
-@findex beginning-of-node
-Moves the cursor to the start of the current node.
-
-@item @code{M->} (@code{end-of-node})
-@kindex M->
-@findex end-of-node
-Moves the cursor to the end of the current node.
-
-@item @code{M-r} (@code{move-to-window-line})
-@kindex M-r
-@findex move-to-window-line
-Moves the cursor to a specific line of the window. Without a numeric
-argument, @code{M-r} moves the cursor to the start of the line in the
-center of the window. With a numeric argument of @var{n}, @code{M-r}
-moves the cursor to the start of the @var{n}th line in the window.
-@end table
-
-@node Scrolling Commands
-@chapter Moving Text Within a Window
-@cindex scrolling
-
-Sometimes you are looking at a screenful of text, and only part of the
-current paragraph you are reading is visible on the screen. The
-commands detailed in this section are used to shift which part of the
-current node is visible on the screen.
-
-@table @asis
-@item @code{SPC} (@code{scroll-forward})
-@itemx @code{C-v}
-@kindex SPC, in Info windows
-@kindex C-v
-@findex scroll-forward
-Shift the text in this window up. That is, show more of the node which
-is currently below the bottom of the window. With a numeric argument,
-show that many more lines at the bottom of the window; a numeric
-argument of 4 would shift all of the text in the window up 4 lines
-(discarding the top 4 lines), and show you four new lines at the bottom
-of the window. Without a numeric argument, @key{SPC} takes the bottom
-two lines of the window and places them at the top of the window,
-redisplaying almost a completely new screenful of lines.
-
-@item @code{DEL} (@code{scroll-backward})
-@itemx @code{M-v}
-@kindex DEL, in Info windows
-@kindex M-v
-@findex scroll-backward
-Shift the text in this window down. The inverse of
-@code{scroll-forward}.
-
-@end table
-
-@cindex scrolling through node structure
-The @code{scroll-forward} and @code{scroll-backward} commands can also
-move forward and backward through the node structure of the file. If
-you press @key{SPC} while viewing the end of a node, or @key{DEL} while
-viewing the beginning of a node, what happens is controlled by the
-variable @code{scroll-behaviour}. @xref{Variables,
-@code{scroll-behaviour}}, for more information.
-
-@table @asis
-@item @code{C-l} (@code{redraw-display})
-@kindex C-l
-@findex redraw-display
-Redraw the display from scratch, or shift the line containing the cursor
-to a specified location. With no numeric argument, @samp{C-l} clears
-the screen, and then redraws its entire contents. Given a numeric
-argument of @var{n}, the line containing the cursor is shifted so that
-it is on the @var{n}th line of the window.
-
-@item @code{C-x w} (@code{toggle-wrap})
-@kindex C-w
-@findex toggle-wrap
-Toggles the state of line wrapping in the current window. Normally,
-lines which are longer than the screen width @dfn{wrap}, i.e., they are
-continued on the next line. Lines which wrap have a @samp{\} appearing
-in the rightmost column of the screen. You can cause such lines to be
-terminated at the rightmost column by changing the state of line
-wrapping in the window with @code{C-x w}. When a line which needs more
-space than one screen width to display is displayed, a @samp{$} appears
-in the rightmost column of the screen, and the remainder of the line is
-invisible.
-@end table
-
-@node Node Commands
-@chapter Selecting a New Node
-@cindex nodes, selection of
-
-This section details the numerous Info commands which select a new node
-to view in the current window.
-
-The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
-@samp{l}.
-
-When you are viewing a node, the top line of the node contains some Info
-@dfn{pointers} which describe where the next, previous, and up nodes
-are. Info uses this line to move about the node structure of the file
-when you use the following commands:
-
-@table @asis
-@item @code{n} (@code{next-node})
-@kindex n
-@findex next-node
-Selects the `Next' node.
-
-@item @code{p} (@code{prev-node})
-@kindex p
-@findex prev-node
-Selects the `Prev' node.
-
-@item @code{u} (@code{up-node})
-@kindex u
-@findex up-node
-Selects the `Up' node.
-@end table
-
-You can easily select a node that you have already viewed in this window
-by using the @samp{l} command -- this name stands for "last", and
-actually moves through the list of already visited nodes for this
-window. @samp{l} with a negative numeric argument moves forward through
-the history of nodes for this window, so you can quickly step between
-two adjacent (in viewing history) nodes.
-
-@table @asis
-@item @code{l} (@code{history-node})
-@kindex l
-@findex history-node
-Selects the most recently selected node in this window.
-@end table
-
-Two additional commands make it easy to select the most commonly
-selected nodes; they are @samp{t} and @samp{d}.
-
-@table @asis
-@item @code{t} (@code{top-node})
-@kindex t
-@findex top-node
-Selects the node @samp{Top} in the current info file.
-
-@item @code{d} (@code{dir-node})
-@kindex d
-@findex dir-node
-Selects the directory node (i.e., the node @samp{(dir)}).
-@end table
-
-Here are some other commands which immediately result in the selection
-of a different node in the current window:
-
-@table @asis
-@item @code{<} (@code{first-node})
-@kindex <
-@findex first-node
-Selects the first node which appears in this file. This node is most
-often @samp{Top}, but it doesn't have to be.
-
-@item @code{>} (@code{last-node})
-@kindex >
-@findex last-node
-Selects the last node which appears in this file.
-
-@item @code{]} (@code{global-next-node})
-@kindex ]
-@findex global-next-node
-Moves forward or down through node structure. If the node that you are
-currently viewing has a @samp{Next} pointer, that node is selected.
-Otherwise, if this node has a menu, the first menu item is selected. If
-there is no @samp{Next} and no menu, the same process is tried with the
-@samp{Up} node of this node.
-
-@item @code{[} (@code{global-prev-node})
-@kindex [
-@findex global-prev-node
-Moves backward or up through node structure. If the node that you are
-currently viewing has a @samp{Prev} pointer, that node is selected.
-Otherwise, if the node has an @samp{Up} pointer, that node is selected,
-and if it has a menu, the last item in the menu is selected.
-@end table
-
-You can get the same behaviour as @code{global-next-node} and
-@code{global-prev-node} while simply scrolling through the file with
-@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behaviour}}, for
-more information.
-
-@table @asis
-@item @code{g} (@code{goto-node})
-@kindex g
-@findex goto-node
-Reads the name of a node and selects it. No completion is done while
-reading the node name, since the desired node may reside in a separate
-file. The node must be typed exactly as it appears in the info file. A
-file name may be included as with any node specification, for example
-
-@example
-@code{g(emacs)Buffers}
-@end example
-
-finds the node @samp{Buffers} in the info file @file{emacs}.
-
-@item @code{C-x k} (@code{kill-node})
-@kindex C-x k
-@findex kill-node
-Kills a node. The node name is prompted for in the echo area, with a
-default of the current node. @dfn{Killing} a node means that Info tries
-hard to forget about it, removing it from the list of history nodes kept
-for the window where that node is found. Another node is selected in
-the window which contained the killed node.
-
-@item @code{C-x C-f} (@code{view-file})
-@kindex C-x C-f
-@findex view-file
-Reads the name of a file and selects the entire file. The command
-@example
-@code{C-x C-f @var{filename}}
-@end example
-is equivalent to typing
-@example
-@code{g(@var{filename})*}
-@end example
-
-@item @code{C-x C-b} (@code{list-visited-nodes})
-@kindex C-x C-b
-@findex list-visited-nodes
-Makes a window containing a menu of all of the currently visited nodes.
-This window becomes the selected window, and you may use the standard
-Info commands within it.
-
-@item @code{C-x b} (@code{select-visited-node})
-@kindex C-x b
-@findex select-visited-node
-Selects a node which has been previously visited in a visible window.
-This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
-created.
-@end table
-
-@node Searching Commands
-@chapter Searching an Info File
-@cindex searching
-
-GNU Info allows you to search for a sequence of characters throughout an
-entire info file, search through the indices of an info file, or find
-areas within an info file which discuss a particular topic.
-
-@table @asis
-@item @code{s} (@code{search})
-@kindex s
-@findex search
-Reads a string in the echo area and searches for it.
-
-@item @code{C-s} (@code{isearch-forward})
-@kindex C-s
-@findex isearch-forward
-Interactively searches forward through the info file for a string as you
-type it.
-
-@item @code{C-r} (@code{isearch-backward})
-@kindex C-r
-@findex isearch-backward
-Interactively searches backward through the info file for a string as
-you type it.
-
-@item @code{i} (@code{index-search})
-@kindex i
-@findex index-search
-Looks up a string in the indices for this info file, and selects a node
-where the found index entry points to.
-
-@item @code{,} (@code{next-index-match})
-@kindex ,
-@findex next-index-match
-Moves to the node containing the next matching index item from the last
-@samp{i} command.
-@end table
-
-The most basic searching command is @samp{s} (@code{search}). The
-@samp{s} command prompts you for a string in the echo area, and then
-searches the remainder of the info file for an ocurrence of that string.
-If the string is found, the node containing it is selected, and the
-cursor is left positioned at the start of the found string. Subsequent
-@samp{s} commands show you the default search string within @samp{[} and
-@samp{]}; pressing @key{RET} instead of typing a new string will use the
-default search string.
-
-@dfn{Incremental searching} is similar to basic searching, but the
-string is looked up while you are typing it, instead of waiting until
-the entire search string has been specified.
-
-@node Xref Commands
-@chapter Selecting Cross References
-
-We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
-pointers which appear at the top of a node. In addition to these
-pointers, a node may contain other pointers which refer you to a
-different node, perhaps in another info file. Such pointers are called
-@dfn{cross references}, or @dfn{xrefs} for short.
-
-@menu
-* Parts of an Xref:: What a cross reference is made of.
-* Selecting Xrefs:: Commands for selecting menu or note items.
-@end menu
-
-@node Parts of an Xref
-@section Parts of an Xref
-
-Cross references have two major parts: the first part is called the
-@dfn{label}; it is the name that you can use to refer to the cross
-reference, and the second is the @dfn{target}; it is the full name of
-the node that the cross reference points to.
-
-The target is separated from the label by a colon @samp{:}; first the
-label appears, and then the target. For example, in the sample menu
-cross reference below, the single colon separates the label from the
-target.
-
-@example
-* Foo Label: Foo Target. More information about Foo.
-@end example
-
-Note the @samp{.} which ends the name of the target. The @samp{.} is
-not part of the target; it serves only to let Info know where the target
-name ends.
-
-A shorthand way of specifying references allows two adjacent colons to
-stand for a target name which is the same as the label name:
-
-@example
-* Foo Commands:: Commands pertaining to Foo.
-@end example
-
-In the above example, the name of the target is the same as the name of
-the label, in this case @code{Foo Commands}.
-
-You will normally see two types of cross references while viewing nodes:
-@dfn{menu} references, and @dfn{note} references. Menu references
-appear within a node's menu; they begin with a @samp{*} at the beginning
-of a line, and continue with a label, a target, and a comment which
-describes what the contents of the node pointed to contains.
-
-Note references appear within the body of the node text; they begin with
-@code{*Note}, and continue with a label and a target.
-
-Like @samp{Next}, @samp{Prev} and @samp{Up} pointers, cross references
-can point to any valid node. They are used to refer you to a place
-where more detailed information can be found on a particular subject.
-Here is a cross reference which points to a node within the Texinfo
-documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo
-Manual}, for more information on creating your own texinfo cross
-references.
-
-@node Selecting Xrefs
-@section Selecting Xrefs
-
-The following table lists the Info commands which operate on menu items.
-
-@table @asis
-@item @code{1} (@code{menu-digit})
-@itemx @code{2} @dots{} @code{9}
-@cindex 1 @dots{} 9, in Info windows
-@kindex 1 @dots{} 9, in Info windows
-@findex menu-digit
-Within an Info window, pressing a single digit, (such as @samp{1}),
-selects that menu item, and places its node in the current window.
-For convenience, there is one exception; pressing @samp{0} selects the
-@emph{last} item in the node's menu.
-
-@item @code{0} (@code{last-menu-item})
-@kindex 0, in Info windows
-@findex last-menu-item
-Select the last item in the current node's menu.
-
-@item @code{m} (@code{menu-item})
-@kindex m
-@findex menu-item
-Reads the name of a menu item in the echo area and selects its node.
-Completion is available while reading the menu label.
-
-@item @code{M-x find-menu}
-@findex find-menu
-Moves the cursor to the start of this node's menu.
-@end table
-
-This table lists the Info commands which operate on note cross references.
-
-@table @asis
-@item @code{f} (@code{xref-item})
-@itemx @code{r}
-@kindex f
-@kindex r
-@findex xref-item
-Reads the name of a note cross reference in the echo area and selects
-its node. Completion is available while reading the cross reference
-label.
-@end table
-
-Finally, the next few commands operate on menu or note references alike:
-
-@table @asis
-@item @code{TAB} (@code{move-to-next-xref})
-@kindex TAB, in Info windows
-@findex move-to-next-xref
-Moves the cursor to the start of the next nearest menu item or note
-reference in this node. You can then use @key{RET}
-(@code{select-reference-this-line} to select the menu or note reference.
-
-@item @code{M-TAB} (@code{move-to-prev-xref})
-@kindex M-TAB, in Info windows
-@findex move-to-prev-xref
-Moves the cursor the start of the nearest previous menu item or note
-reference in this node.
-
-@item @code{RET} (@code{select-reference-this-line})
-@kindex RET, in Info windows
-@findex select-reference-this-line
-Selects the menu item or note reference appearing on this line.
-@end table
-
-@node Window Commands
-@chapter Manipulating Multiple Windows
-@cindex windows, manipulating
-
-A @dfn{window} is a place to show the text of a node. Windows have a
-view area where the text of the node is displayed, and an associated
-@dfn{mode line}, which briefly describes the node being viewed.
-
-GNU Info supports multiple windows appearing in a single screen; each
-window is separated from the next by its modeline. At any time, there
-is only one @dfn{active} window, that is, the window in which the cursor
-appears. There are commands available for creating windows, changing
-the size of windows, selecting which window is active, and for deleting
-windows.
-
-@menu
-* The Mode Line:: What appears in the mode line?
-* Basic Windows:: Manipulating windows in Info.
-* The Echo Area:: Used for displaying errors and reading input.
-@end menu
-
-@node The Mode Line
-@section The Mode Line
-
-A @dfn{mode line} is a line of inverse video which appears at the bottom
-of an info window. It describes the contents of the window just above
-it; this information includes the name of the file and node appearing in
-that window, the number of screen lines it takes to display the node,
-and the percentage of text that is above the top of the window. It can
-also tell you if the indirect tags table for this info file needs to be
-updated, and whether or not the info file was compressed when stored on
-disk.
-
-Here is a sample mode line for a window containing an uncompressed file
-named @file{dir}, showing the node @samp{Top}.
-
-@example
------Info: (dir)Top, 40 lines --Top---------------------------------------
- ^^ ^ ^^^ ^^
- (file)Node #lines where
-@end example
-
-When a node comes from a file which is compressed on disk, this is
-indicated in the mode line with two small @samp{z}'s. In addition, if
-the info file containing the node has been split into subfiles, the name
-of the subfile containing the node appears in the modeline as well:
-
-@example
---zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
-@end example
-
-When Info makes a node internally, such that there is no corresponding
-info file on disk, the name of the node is surrounded by asterisks
-(@samp{*}). The name itself tells you what the contents of the window
-are; the sample mode line below shows an internally constructed node
-showing possible completions:
-
-@example
------Info: *Completions*, 7 lines --All-----------------------------------
-@end example
-
-@node Basic Windows
-@section Window Commands
-
-It can be convenient to view more than one node at a time. To allow
-this, Info can display more than one @dfn{window}. Each window has its
-own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
-window (@pxref{Node Commands, , @code{history-node}}).
-
-@table @asis
-@item @code{C-x o} (@code{next-window})
-@cindex windows, selecting
-@kindex C-x o
-@findex next-window
-Selects the next window on the screen. Note that the echo area can only be
-selected if it is already in use, and you have left it temporarily.
-Normally, @samp{C-x o} simply moves the cursor into the next window on
-the screen, or if you are already within the last window, into the first
-window on the screen. Given a numeric argument, @samp{C-x o} moves over
-that many windows. A negative argument causes @samp{C-x o} to select
-the previous window on the screen.
-
-@item @code{M-x prev-window}
-@findex prev-window
-Selects the previous window on the screen. This is identical to
-@samp{C-x o} with a negative argument.
-
-@item @code{C-x 2} (@code{split-window})
-@cindex windows, creating
-@kindex C-x 2
-@findex split-window
-Splits the current window into two windows, both showing the same node.
-Each window is one half the size of the original window, and the cursor
-remains in the original window. The variable @code{automatic-tiling}
-can cause all of the windows on the screen to be resized for you
-automatically, please @pxref{Variables, , automatic-tiling} for more
-information.
-
-@item @code{C-x 0} (@code{delete-window})
-@cindex windows, deleting
-@kindex C-x 0
-@findex delete-window
-Deletes the current window from the screen. If you have made too many
-windows and your screen appears cluttered, this is the way to get rid of
-some of them.
-
-@item @code{C-x 1} (@code{keep-one-window})
-@kindex C-x 1
-@findex keep-one-window
-Deletes all of the windows excepting the current one.
-
-@item @code{ESC C-v} (@code{scroll-other-window})
-@kindex ESC C-v, in Info windows
-@findex scroll-other-window
-Scrolls the other window, in the same fashion that @samp{C-v} might
-scroll the current window. Given a negative argument, the "other"
-window is scrolled backward.
-
-@item @code{C-x ^} (@code{grow-window})
-@kindex C-x ^
-@findex grow-window
-Grows (or shrinks) the current window. Given a numeric argument, grows
-the current window that many lines; with a negative numeric argument,
-the window is shrunk instead.
-
-@item @code{C-x t} (@code{tile-windows})
-@cindex tiling
-@kindex C-x t
-@findex tile-windows
-Divides the available screen space among all of the visible windows.
-Each window is given an equal portion of the screen in which to display
-its contents. The variable @code{automatic-tiling} can cause
-@code{tile-windows} to be called when a window is created or deleted.
-@xref{Variables, , @code{automatic-tiling}}.
-@end table
-
-@node The Echo Area
-@section The Echo Area
-@cindex echo area
-
-The @dfn{echo area} is a one line window which appears at the bottom of
-the screen. It is used to display informative or error messages, and to
-read lines of input from you when that is necessary. Almost all of the
-commands available in the echo area are identical to their Emacs
-counterparts, so please refer to that documentation for greater depth of
-discussion on the concepts of editing a line of text. The following
-table briefly lists the commands that are available while input is being
-read in the echo area:
-
-@table @asis
-@item @code{C-f} (@code{echo-area-forward})
-@kindex C-f, in the echo area
-@findex echo-area-forward
-Moves forward a character.
-
-@item @code{C-b} (@code{echo-area-backward})
-@kindex C-b, in the echo area
-@findex echo-area-backward
-Moves backward a character.
-
-@item @code{C-a} (@code{echo-area-beg-of-line})
-@kindex C-a, in the echo area
-@findex echo-area-beg-of-line
-Moves to the start of the input line.
-
-@item @code{C-e} (@code{echo-area-end-of-line})
-@kindex C-e, in the echo area
-@findex echo-area-end-of-line
-Moves to the end of the input line.
-
-@item @code{M-f} (@code{echo-area-forward-word})
-@kindex M-f, in the echo area
-@findex echo-area-forward-word
-Moves forward a word.
-
-@item @code{M-b} (@code{echo-area-backward-word})
-@kindex M-b, in the echo area
-@findex echo-area-backward-word
-Moves backward a word.
-
-@item @code{C-d} (@code{echo-area-delete})
-@kindex C-d, in the echo area
-@findex echo-area-delete
-Deletes the character under the cursor.
-
-@item @code{DEL} (@code{echo-area-rubout})
-@kindex DEL, in the echo area
-@findex echo-area-rubout
-Deletes the character behind the cursor.
-
-@item @code{C-g} (@code{echo-area-abort})
-@kindex C-g, in the echo area
-@findex echo-area-abort
-Cancels or quits the current operation. If completion is being read,
-@samp{C-g} discards the text of the input line which does not match any
-completion. If the input line is empty, @samp{C-g} aborts the calling
-function.
-
-@item @code{RET} (@code{echo-area-newline})
-@kindex RET, in the echo area
-@findex echo-area-newline
-Accepts (or forces completion of) the current input line.
-
-@item @code{C-q} (@code{echo-area-quoted-insert})
-@kindex C-q, in the echo area
-@findex echo-area-quoted-insert
-Inserts the next character verbatim. This is how you can insert control
-characters into a search string, for example.
-
-@item @var{printing character} (@code{echo-area-insert})
-@kindex printing characters, in the echo area
-@findex echo-area-insert
-Inserts the character.
-
-@item @code{M-TAB} (@code{echo-area-tab-insert})
-@kindex M-TAB, in the echo area
-@findex echo-area-tab-insert
-Inserts a TAB character.
-
-@item @code{C-t} (@code{echo-area-transpose-chars})
-@kindex C-t, in the echo area
-@findex echo-area-transpose-chars
-Transposes the characters at the cursor.
-@end table
-
-The next group of commands deal with @dfn{killing}, and @dfn{yanking}
-text. For an in depth discussion of killing and yanking,
-@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
-
-@table @asis
-@item @code{M-d} (@code{echo-area-kill-word})
-@kindex M-d, in the echo area
-@findex echo-area-kill-word
-Kills the word following the cursor.
-
-@item @code{M-DEL} (@code{echo-area-backward-kill-word})
-@kindex M-DEL, in the echo area
-@findex echo-area-backward-kill-word
-Kills the word preceding the cursor.
-
-@item @code{C-k} (@code{echo-area-kill-line})
-@kindex C-k, in the echo area
-@findex echo-area-kill-line
-Kills the text from the cursor to the end of the line.
-
-@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
-@kindex C-x DEL, in the echo area
-@findex echo-area-backward-kill-line
-Kills the text from the cursor to the beginning of the line.
-
-@item @code{C-y} (@code{echo-area-yank})
-@kindex C-y, in the echo area
-@findex echo-area-yank
-Yanks back the contents of the last kill.
-
-@item @code{M-y} (@code{echo-area-yank-pop})
-@kindex M-y, in the echo area
-@findex echo-area-yank-pop
-Yanks back a previous kill, removing the last yanked text first.
-@end table
-
-Sometimes when reading input in the echo area, the command that needed
-input will only accept one of a list of several choices. The choices
-represent the @dfn{possible completions}, and you must respond with one
-of them. Since there are a limited number of responses you can make,
-Info allows you to abbreviate what you type, only typing as much of the
-response as is necessary to uniquely identify it. In addition, you can
-request Info to fill in as much of the response as is possible; this
-is called @dfn{completion}.
-
-The following commands are available when completing in the echo area:
-
-@table @asis
-@item @code{TAB} (@code{echo-area-complete})
-@itemx @code{SPC}
-@kindex TAB, in the echo area
-@kindex SPC, in the echo area
-@findex echo-area-complete
-Inserts as much of a completion as is possible.
-
-@item @code{?} (@code{echo-area-possible-completions})
-@kindex ?, in the echo area
-@findex echo-area-possible-completions
-Displays a window containing a list of the possible completions of what
-you have typed so far. For example, if the available choices are:
-@example
-bar
-foliate
-food
-forget
-@end example
-and you have typed an @samp{f}, followed by @samp{?}, the possible
-completions would contain:
-@example
-foliate
-food
-forget
-@end example
-i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC}
-or @key{TAB} would result in @samp{fo} appearing in the echo area, since
-all of the choices which begin with @samp{f} continue with @samp{o}.
-Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
-appearing in the echo area, since that is the only choice which begins
-with @samp{fol}.
-
-@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
-@kindex ESC C-v, in the echo area
-@findex echo-area-scroll-completions-window
-Scrolls the completions window, if that is visible, or the "other"
-window if not.
-@end table
-
-@node Printing Nodes
-@chapter Printing Out Nodes
-@cindex printing
-
-You may wish to print out the contents of a node as a quick reference
-document for later use. Info provides you with a command for doing
-this. In general, we recommend that you use @TeX{} to format the
-document and print sections of it, by running @code{tex} on the texinfo
-source file.
-
-@table @asis
-@item @code{M-x print-node}
-@findex print-node
-@cindex INFO_PRINT_COMMAND, environment variable
-Pipes the contents of the current node through the command in the
-environment variable @code{INFO_PRINT_COMMAND}. If the variable doesn't
-exist, the node is simply piped to @code{lpr}.
-@end table
-
-@node Miscellaneous Commands
-@chapter Miscellaneous Commands
-
-GNU Info contains several commands which self-document GNU Info:
-
-@table @asis
-@item @code{M-x describe-command}
-@cindex functions, describing
-@cindex commands, describing
-@findex describe-command
-Reads the name of an Info command in the echo area and then displays a
-brief description of what that command does.
-
-@item @code{M-x describe-key}
-@cindex keys, describing
-@findex describe-key
-Reads a key sequence in the echo area, and then displays the name and
-documentation of the Info command that the key sequence invokes.
-
-@item @code{M-x describe-variable}
-Reads the name of a variable in the echo area and then displays a brief
-description of what the variable affects.
-
-@item @code{M-x where-is}
-@findex where-is
-Reads the name of an Info command in the echo area, and then displays
-a key sequence which can be typed in order to invoke that command.
-
-@item @code{C-h} (@code{get-help-window})
-@itemx @code{?}
-@kindex C-h
-@kindex ?, in Info windows
-@findex get-help-window
-Creates (or moves into) the window displaying @code{*Help*}, and places
-a node containing a quick reference card into it. This window displays
-the most concise information about GNU Info available.
-
-@item @code{h} (@code{get-info-help-node})
-@kindex h
-@findex get-info-help-node
-Tries hard to visit the node @code{(info)Help}. The info file
-@file{info.texi} distributed with GNU Info contains this node. Of
-course, the file must first be processed with @code{makeinfo}, and then
-placed into the location of your info directory.
-@end table
-
-Here are the commands for creating a numeric argument:
-
-@table @asis
-@item @code{C-u} (@code{universal-argument})
-@cindex numeric arguments
-@kindex C-u
-@findex universal-argument
-Starts (or multiplies by 4) the current numeric argument. @samp{C-u} is
-a good way to give a small numeric argument to cursor movement or
-scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
-@samp{C-u C-u C-n} moves the cursor down 16 lines.
-
-@item @code{M-1} (@code{add-digit-to-numeric-arg})
-@itemx @code{M-2} @dots{} @code{M-9}
-@kindex M-1 @dots{} M-9
-@findex add-digit-to-numeric-arg
-Adds the digit value of the invoking key to the current numeric
-argument. Once Info is reading a numeric argument, you may just type
-the digits of the argument, without the Meta prefix. For example, you
-might give @samp{C-l} a numeric argument of 32 by typing:
-
-@example
-@kbd{C-u 3 2 C-l}
-@end example
-or
-@example
-@kbd{M-3 2 C-l}
-@end example
-@end table
-
-@samp{C-g} is used to abort the reading of a multi-character key
-sequence, to cancel lengthy operations (such as multi-file searches) and
-to cancel reading input in the echo area.
-
-@table @asis
-@item @code{C-g} (@code{abort-key})
-@cindex cancelling typeahead
-@cindex cancelling the current operation
-@kindex C-g, in Info windows
-@findex abort-key
-Cancels current operation.
-@end table
-
-The @samp{q} command of Info simply quits running Info.
-
-@table @asis
-@item @code{q} (@code{quit})
-@cindex quitting
-@kindex q
-@findex quit
-Exits GNU Info.
-@end table
-
-If the operating system tells GNU Info that the screen is 60 lines tall,
-and it is actually only 40 lines tall, here is a way to tell Info that
-the operating system is correct.
-
-@table @asis
-@item @code{M-x set-screen-height}
-@findex set-screen-height
-@cindex screen, changing the height of
-Reads a height value in the echo area and sets the height of the
-displayed screen to that value.
-@end table
-
-Finally, Info provides a convenient way to display footnotes which might
-be associated with the current node that you are viewing:
-
-@table @asis
-@item @code{ESC C-f} (@code{show-footnotes})
-@kindex ESC C-f
-@findex show-footnotes
-@cindex footnotes, displaying
-Shows the footnotes (if any) associated with the current node in another
-window. You can have Info automatically display the footnotes
-associated with a node when the node is selected by setting the variable
-@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}.
-@end table
-
-@node Variables
-@chapter Manipulating Variables
-
-GNU Info contains several @dfn{variables} whose values are looked at by various
-Info commands. You can change the values of these variables, and thus
-change the behaviour of Info to more closely match your environment and
-info file reading manner.
-
-@table @asis
-@item @code{M-x set-variable}
-@cindex variables, setting
-@findex set-variable
-Reads the name of a variable, and the value for it, in the echo area and
-then sets the variable to that value. Completion is available when
-reading the variable name; often, completion is available when reading
-the value to give to the variable, but that depends on the variable
-itself. If a variable does @emph{not} supply multiple choices to
-complete over, it expects a numeric value.
-
-@item @code{M-x describe-variable}
-@cindex variables, describing
-@findex describe-variable
-Reads the name of a variable in the echo area and then displays a brief
-description of what the variable affects.
-@end table
-
-Here is a list of the variables that you can set in Info.
-
-@table @code
-@item automatic-footnotes
-@vindex automatic-footnotes
-When set to @code{On}, footnotes appear and disappear automatically.
-This variable is @code{On} by default. When a node is selected, a
-window containing the footnotes which appear in that node is created,
-and the footnotes are displayed within the new window. The window that
-Info creates to contain the footnotes is called @samp{*Footnotes*}. If
-a node is selected which contains no footnotes, and a @samp{*Footnotes*}
-window is on the screen, the @samp{*Footnotes*} window is deleted.
-Footnote windows created in this fashion are not automatically tiled so
-that they can use as little of the display as is possible.
-
-@item automatic-tiling
-@vindex automatic-tiling
-When set to @code{On}, creating or deleting a window resizes other
-windows. This variable is @code{Off} by default. Normally, typing
-@samp{C-x 2} divides the current window into two equal parts. When
-@code{automatic-tiling} is set to @code{On}, all of the windows are
-resized automatically, keeping an equal number of lines visible in each
-window. There are exceptions to the automatic tiling; specifically, the
-windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
-resized through automatic tiling; they remain their original size.
-
-@item visible-bell
-@vindex visible-bell
-When set to @code{On}, GNU Info attempts to flash the screen instead of
-ringing the bell. This variable is @code{Off} by default. Of course,
-Info can only flash the screen if the terminal allows it; in the case
-that the terminal does not allow it, the setting of this variable has no
-effect. However, you can make Info perform quietly by setting the
-@code{errors-ring-bell} variable to @code{Off}.
-
-@item errors-ring-bell
-@vindex errors-ring-bell
-When set to @code{On}, errors cause the bell to ring. The default
-setting of this variable is @code{On}.
-
-@item gc-compressed-files
-@vindex gc-compressed-files
-When set to @code{On}, Info garbage collects files which had to be
-uncompressed. The default value of this variable is @code{Off}.
-Whenever a node is visited in Info, the info file containing that node
-is read into core, and Info reads information about the tags and nodes
-contained in that file. Once the tags information is read by Info, it
-is never forgotten. However, the actual text of the nodes does not need
-to remain in core unless a particular info window needs it. For
-non-compressed files, the text of the nodes does not remain in core when
-it is no longer in use. But de-compressing a file can be a time
-consuming operation, and so Info tries hard not to do it twice.
-@code{gc-compressed-files} tells Info it is okay to garbage collect the
-text of the nodes of a file which was compressed on disk.
-
-@item show-index-match
-@vindex show-index-match
-When set to @code{On}, the portion of the matched search string is
-highlighted in the message which explains where the matched search
-string was found. The default value of this variable is @code{On}.
-When Info displays the location where an index match was found,
-(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
-string that you had typed is highlighted by displaying it in the inverse
-case from its surrounding characters.
-
-@item scroll-behaviour
-@vindex scroll-behaviour
-Controls what happens when forward scrolling is requested at the end of
-a node, or when backward scrolling is requested at the beginning of a
-node. The default value for this variable is @code{Continuous}. There
-are three possible values for this variable:
-
-@table @code
-@item Continuous
-Tries to get the first item in this node's menu, or failing that, the
-@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}.
-This behaviour is identical to using the @samp{]}
-(@code{global-next-node}) and @samp{[} (@code{global-prev-node})
-commands.
-
-@item Next Only
-Only tries to get the @samp{Next} node.
-
-@item Page Only
-Simply gives up, changing nothing. If @code{scroll-behaviour} is
-@code{Page Only}, no scrolling command can change the node that is being
-viewed.
-@end table
-
-@item scroll-step
-@vindex scroll-step
-The number of lines to scroll when the cursor moves out of the window.
-Scrolling happens automatically if the cursor has moved out of the
-visible portion of the node text when it is time to display. Usually
-the scrolling is done so as to put the cursor on the center line of the
-current window. However, if the variable @code{scroll-step} has a
-nonzero value, Info attempts to scroll the node text by that many lines;
-if that is enough to bring the cursor back into the window, that is what
-is done. The default value of this variable is 0, thus placing the
-cursor (and the text it is attached to) in the center of the window.
-Setting this variable to 1 causes a kind of "smooth scrolling" which
-some people prefer.
-
-@item ISO-Latin
-@cindex ISO Latin characters
-@vindex ISO-Latin
-When set to @code{On}, Info accepts and displays ISO Latin characters.
-By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
-Info that it is running in an environment where the European standard
-character set is in use, and allows you to input such characters to
-Info, as well as display them.
-@end table
-
-@c The following node and its children are currently unfinished. Please feel
-@c free to finish it!
-
-@ifset NOTSET
-@node Info for Sys Admins
-@chapter Info for System Administrators
-
-This text describes some common ways of setting up an Info heierarchy
-from scratch, and details the various options that are available when
-installing Info. This text is designed for the person who is installing
-GNU Info on the system; although users may find the information present
-in this section interesting, none of it is vital to understanding how to
-use GNU Info.
-
-@menu
-* Setting the INFOPATH:: Where are my Info files kept?
-* Editing the DIR node:: What goes in `DIR', and why?
-* Storing Info files:: Alternate formats allow flexibilty in setups.
-* Using `localdir':: Building DIR on the fly.
-* Example setups:: Some common ways to origanize Info files.
-@end menu
-
-@node Setting the INFOPATH
-@section Setting the INFOPATH
-Where are my Info files kept?
-
-@node Editing the DIR node
-@section Editing the DIR node
-What goes in `DIR', and why?
-
-@node Storing Info files
-@section Storing Info files
-Alternate formats allow flexibilty in setups.
-
-@node Using `localdir'
-@section Using `localdir'
-Building DIR on the fly.
-
-@node Example setups
-@section Example setups
-Some common ways to origanize Info files.
-@end ifset
-
-@ifset STANDALONE
-@node GNU Info Global Index
-@appendix Global Index
-@printindex cp
-@end ifset
diff --git a/contrib/texinfo/emacs/Makefile.in b/contrib/texinfo/emacs/Makefile.in
new file mode 100644
index 000000000000..f011b33aea81
--- /dev/null
+++ b/contrib/texinfo/emacs/Makefile.in
@@ -0,0 +1,88 @@
+# Makefile for Texinfo/emacs.
+# Copyright (C) 1995, 96 Free Software Foundation, Inc.
+# $Id: Makefile.in,v 1.4 1996/09/28 21:34:34 karl Exp $
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Author: Brian J. Fox (bfox@ai.mit.edu)
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+SHELL = /bin/sh
+RM = rm -f
+
+
+ELISP_SRCS = info.el makeinfo.el texinfo.el texnfo-upd.el \
+ texnfo-tex.el texinfmt.el informat.el detexinfo.el
+ELISP_OBJS = info.elc makeinfo.elc texinfo.elc texnfo-upd.elc \
+ texnfo-tex.elc texinfmt.elc informat.elc detexinfo.elc
+
+.SUFFIXES: .el .elc
+
+.el.elc:
+ $(srcdir)/elisp-comp $<
+
+all:
+sub-all: all
+
+elisp: $(ELISP_OBJS)
+.PHONY: elisp
+
+# Nobody likes any of these install targets. Fine. Install it
+# manually, then.
+install:
+ @echo Please install the Emacs Lisp files manually.
+
+uninstall:
+ @echo Please uninstall the Emacs Lisp files manually.
+
+# install: $(ELISP_OBJS)
+# @(echo "(print (car load-path))" >/tmp/elc.$$$$; \
+# lispdir=`emacs -batch -q -l /tmp/elc.$$$$ -nw | grep site-lisp`; \
+# rm /tmp/elc.$$$$; \
+# if [ "$$lispdir" != "" ]; then \
+# lispdir=`echo $$lispdir | sed -e 's/"//g'`; \
+# echo "Installing .elc files in $$lispdir."; \
+# $(CP) $(ELISP_OBJS) $$lispdir; \
+# else \
+# echo "To install the elisp files, please copy *.elc to the"; \
+# echo "emacs site-lisp directory."; \
+# fi)
+#
+# install: $(ELISP_OBJS)
+# for file in $(ELISP_OBJS); do \
+# $(INSTALL_DATA) $$file $(lispdir); \
+# done
+#
+# uninstall: $(ELISP_OBJS)
+# cd $(lispdir) && rm -f $(ELISP_OBJS)
+#
+informat.elc: info.elc
+makeinfo.elc: texinfo.elc
+texinfmt.elc: texinfo.elc
+texinfmt.elc: texnfo-upd.elc
+
+Makefile: $(srcdir)/Makefile.in ../config.status
+ cd .. && sh config.status
+
+realclean distclean: clean
+ $(RM) Makefile *.log
+
+clean: FORCE
+ $(RM) *.elc
+
+FORCE:
+
diff --git a/contrib/texinfo/emacs/detexinfo.el b/contrib/texinfo/emacs/detexinfo.el
new file mode 100644
index 000000000000..fda99091c49a
--- /dev/null
+++ b/contrib/texinfo/emacs/detexinfo.el
@@ -0,0 +1,250 @@
+;;; Here is a handy keybinding:
+
+(global-set-key "\C-x\\" 'detexinfo)
+
+;;;;;;;;;;;;;;;; detexinfo.el ;;;;;;;;;;;;;;;;
+;;;
+;;; Remove Texinfo commands from a Texinfo source file.
+;;;
+;;; Copyright (C) 1991, 1992 Free Software Foundation
+;;; Robert J. Chassell
+;;; bugs to bug-texinfo@prep.ai.mit.edu
+;;;
+;;; ==> test version <==
+;;; Fails if Texinfo source file contains formatting errors.
+;;;
+;;; Version 0.05 - 3 Jun 1992
+;;; Add to list of removed commands. Improve messages.
+;;;
+;;; Version 0.04 - 27 Jan 1992
+;;; Rewrite to insert detexinfo'd text into a temporary buffer.
+;;;
+;;; Version 0.03 - 27 Dec 1991
+;;; Improved messages.
+;;;
+;;; Version 0.02 - 13 Nov 1991
+;;; detexinfo-remove-inline-cmd, detexinfo-syntax-table: Handle
+;;; nested commands.
+;;; detexinfo: Handle nested @'s, eg @samp{@}} and @samp{@@};
+;;; replace @TeX{} with TeX.
+;;;
+;;; Version 0.01 - 13 Nov 1991
+;;;
+;;; Based on detex.el, by Bengt Martensson, 4 Oct 1987
+;;;
+;;;;;;;;;;;;;;;;
+
+(defvar detexinfo-buffer-name "*detexinfo*"
+ "*Name of the temporary buffer used by \\[detexinfo].")
+
+(defvar detexinfo-syntax-table nil)
+
+(if detexinfo-syntax-table
+ nil
+ (setq detexinfo-syntax-table (make-syntax-table))
+ (modify-syntax-entry ?\[ "." detexinfo-syntax-table)
+ (modify-syntax-entry ?\] "." detexinfo-syntax-table)
+ (modify-syntax-entry ?\" "." detexinfo-syntax-table)
+ (modify-syntax-entry ?\\ "." detexinfo-syntax-table)
+ (modify-syntax-entry ?\( "." detexinfo-syntax-table)
+ (modify-syntax-entry ?\) "." detexinfo-syntax-table)
+ (modify-syntax-entry ?{ "(}" detexinfo-syntax-table)
+ (modify-syntax-entry ?} "){" detexinfo-syntax-table))
+
+(defun detexinfo ()
+ "Remove Texinfo commands from current buffer, copying result to new buffer.
+BUG: Fails if Texinfo source file contains formatting errors."
+ (interactive)
+ (let ((input-buffer (current-buffer)))
+ ;; Find a buffer to use.
+ (switch-to-buffer (get-buffer-create detexinfo-buffer-name))
+ (setq major-mode 'detexinfo-mode)
+ (set-syntax-table detexinfo-syntax-table)
+ (erase-buffer)
+ (insert-buffer-substring input-buffer)
+
+ ;; Replace @{ and @} with %#* and *#% temporarily, so @samp{@{} works.
+ ;; What is a better way of doing this??
+ (goto-char (point-min))
+ (while (search-forward "@{" nil t) ; e.g., @samp{@{}
+ (replace-match "%#*"))
+ (goto-char (point-min))
+ (while (search-forward "@}" nil t)
+ (forward-char -3) ; e.g., @samp{@@}
+ (if (looking-at "@") ; Two @@ in a row
+ (progn
+ (delete-char 2)
+ (insert "%&%#"))
+ (forward-char 1)
+ (delete-char 2)
+ (insert "*#%")))
+
+ (goto-char (point-min))
+ ;; Remove @refill, the only inline command without braces.
+ (while (search-forward "@refill" nil t)
+ (replace-match ""))
+ ;; Replace @TeX{} with TeX
+ (goto-char (point-min))
+ (while (search-forward "@TeX{}" nil t) (replace-match "TeX" t t))
+
+ (detexinfo-remove-line-cmds-without-arg)
+ (detexinfo-remove-inline-cmds-without-arg)
+ (detexinfo-remove-inline-cmds-keep-arg)
+ (detexinfo-remove-line-cmds-deletable-arg)
+ (detexinfo-remove-line-cmds-maybe-delete-arg)
+ (detexinfo-remove-line-cmds-keep-arg)
+
+ ;; Now replace %#*, *#%, and %&%# with {, }, and @@.
+ (goto-char (point-min))
+ (while (search-forward "%#*" nil t)
+ (replace-match "{"))
+ (goto-char (point-min))
+ (while (search-forward "*#%" nil t)
+ (replace-match "}"))
+ (goto-char (point-min))
+ (while (search-forward "%&%#" nil t)
+ (replace-match "@@"))
+
+ ;; Scan for remaining two character @-commands
+ (goto-char (point-min))
+ (while (search-forward "@" nil t)
+ (cond ((looking-at "[*:]")
+ (delete-region (1- (point)) (1+ (point))))
+ ((looking-at "[{}^@.'`]\"?!")
+ (delete-region (1- (point)) (point)))))
+
+ (goto-char (point-min))
+ (message "Done...removed Texinfo commands from buffer. You may save it.")))
+
+(defun detexinfo-remove-whole-line (cmd)
+ "Delete Texinfo line command CMD at beginning of line and rest of line."
+ (goto-char (point-min))
+ (while
+ (re-search-forward
+ (concat "^@" cmd "[ \n]+") (point-max) t)
+ (goto-char (match-beginning 0))
+ (delete-region
+ (point) (save-excursion (end-of-line) (1+ (point))))))
+
+(defun detexinfo-remove-inline-cmd (cmd)
+ "Delete Texinfo inline command CMD, eg. @point, @code."
+ (goto-char (point-min))
+ (while
+ (re-search-forward (concat "@" cmd "{") (point-max) t)
+ (save-excursion
+ (forward-char -1)
+ (forward-sexp 1)
+ (delete-char -1)) ; delete right brace
+ (delete-region (point) (match-beginning 0))))
+
+;;;;;;;;;;;;;;;;
+
+;;; 1. @setfilename and other line commands with args to delete
+
+(defvar detexinfo-line-cmds-deletable-arg
+ '("enumerate" "ftable" "vtable" "itemize" "table"
+ "setfilename" "settitle" "setchapternewpage"
+ "footnotestyle" "paragraphindent"
+ "include" "need" "sp"
+ "clear" "ifclear" "ifset" "set"
+ "defcodeindex" "defindex" "syncodeindex" "synindex")
+ "List of Texinfo commands whose arguments should be deleted.")
+
+(defun detexinfo-remove-line-cmds-deletable-arg ()
+ "Delete Texinfo line commands together with their args, eg @setfilename."
+ (message "Removing commands such as @enumerate...with their arguments...")
+ (mapcar 'detexinfo-remove-whole-line
+ detexinfo-line-cmds-deletable-arg))
+
+;;; 2. @cindex and other cmds with args that may be deleted
+;;; This list is here just to make it easier to revise the
+;;; categories. In particular, you might want to keep the index entries.
+
+(defvar detexinfo-line-cmds-maybe-delete-arg
+ '("cindex" "findex" "kindex" "pindex" "tindex" "vindex" "node"
+ "c" "comment" "end" "headings" "printindex" "vskip"
+ "evenfooting" "evenheading" "everyfooting" "everyheading"
+ "oddfooting" "oddheading")
+ "List of Texinfo commands whose arguments may possibly be deleted.")
+
+(defun detexinfo-remove-line-cmds-maybe-delete-arg ()
+ "Delete Texinfo line commands together with their arguments, eg, @cindex."
+ (message "Removing commands such as @cindex...with their arguments...")
+ (mapcar 'detexinfo-remove-whole-line
+ detexinfo-line-cmds-maybe-delete-arg))
+
+;;; 3. @chapter and other line cmds with args to keep.
+
+(defvar detexinfo-line-cmds-keep-arg
+ '("top" "chapter" "section" "subsection" "subsubsection"
+ "unnumbered" "unnumberedsec" "unnumberedsubsec" "unnumberedsubsubsec"
+ "majorheading" "chapheading" "heading" "subheading" "subsubheading"
+ "appendix" "appendixsec" "appendixsubsec" "appendixsubsubsec"
+ "item" "itemx"
+ "title" "subtitle" "center" "author" "exdent"
+ "defcv" "deffn" "defivar" "defmac" "defmethod" "defop" "defopt"
+ "defspec" "deftp" "deftypefn" "deftypefun" "deftypvr"
+ "deftypevar" "defun" "defvar" "defvr")
+ "List of Texinfo line commands whose arguments should be kept.")
+
+(defun detexinfo-remove-line-cmds-keep-arg ()
+ "Delete Texinfo line commands but keep their arguments, eg @chapter."
+ (message "Removing commands such as @chapter...but not their arguments...")
+ (mapcar 'detexinfo-remove-line-cmd-keep-arg
+ detexinfo-line-cmds-keep-arg))
+
+(defun detexinfo-remove-line-cmd-keep-arg (cmd)
+ "Delete Texinfo line command CMD but keep its argument, eg @chapter."
+ (goto-char (point-min))
+ (while
+ (re-search-forward
+ (concat "^@" cmd "[ \n]+") (point-max) t)
+ (delete-region (match-beginning 0) (match-end 0))))
+
+;;; 4. @bye and other line commands without args.
+
+(defvar detexinfo-line-cmds-without-arg
+ '("bye" "contents" "display" "example" "finalout"
+ "flushleft" "flushright" "format" "group" "ifhtml" "ifinfo" "iftex"
+ "ignore" "lisp" "menu" "noindent" "page" "quotation"
+ "shortcontents" "smallbook" "smallexample" "smalllisp"
+ "summarycontents" "tex" "thischapter" "thischaptername"
+ "thisfile" "thispage" "thissection" "thistitle" "titlepage")
+ "List of Texinfo commands without arguments that should be deleted.")
+
+(defun detexinfo-remove-line-cmds-without-arg ()
+ "Delete line Texinfo commands that lack args, eg. @example."
+ (message "Removing commands such as @example...that lack arguments...")
+ (mapcar 'detexinfo-remove-whole-line
+ detexinfo-line-cmds-without-arg))
+
+;;; 5. @equiv and other inline cmds without args.
+
+(defvar detexinfo-inline-cmds-without-arg
+ '("equiv" "error" "expansion" "point" "print" "result"
+ "asis" "br" "bullet" "dots" "minus" "today")
+ "List of Texinfo inline commands without arguments that should be deleted.")
+
+(defun detexinfo-remove-inline-cmds-without-arg ()
+ "Delete Texinfo inline commands in that lack arguments."
+ (message "Removing within line commands such as @result...")
+ (mapcar 'detexinfo-remove-inline-cmd
+ detexinfo-inline-cmds-without-arg))
+
+;;; 6. @code and other inline cmds with args to keep
+
+(defvar detexinfo-inline-cmds-keep-arg
+ '("b" "cartouche" "cite" "code" "copyright" "ctrl" "dfn" "dmn"
+ "emph" "file" "footnote" "i" "inforef"
+ "kbd" "key" "pxref" "r" "ref" "samp" "sc" "titlefont"
+ "strong" "t" "var" "w" "xref")
+ "List of Texinfo inline commands with arguments that should be kept.")
+
+(defun detexinfo-remove-inline-cmds-keep-arg ()
+ "Delete Texinfo inline commands but keep its arg, eg. @code."
+ (message
+ "Removing within line commands such as @code...but not their arguments...")
+ (mapcar 'detexinfo-remove-inline-cmd
+ detexinfo-inline-cmds-keep-arg))
+
+;;;;;;;;;;;;;;;; end detexinfo.el ;;;;;;;;;;;;;;;;
diff --git a/contrib/texinfo/emacs/elisp-comp b/contrib/texinfo/emacs/elisp-comp
new file mode 100755
index 000000000000..650582625f33
--- /dev/null
+++ b/contrib/texinfo/emacs/elisp-comp
@@ -0,0 +1,7 @@
+#!/bin/sh
+# $Id: elisp-comp,v 1.2 1996/09/26 23:41:08 karl Exp $
+# Trivial script to compile the Elisp files.
+setpath=${TMPDIR-/tmp}/elc.$$
+echo "(setq load-path (cons nil load-path))" > $setpath
+emacs -batch -l $setpath -f batch-byte-compile "$@"
+rm -f $setpath
diff --git a/contrib/texinfo/emacs/info.el b/contrib/texinfo/emacs/info.el
new file mode 100644
index 000000000000..ead6ab92c987
--- /dev/null
+++ b/contrib/texinfo/emacs/info.el
@@ -0,0 +1,1846 @@
+;;; info.el --- info package for Emacs.
+
+;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
+
+;; Maintainer: FSF
+;; Keywords: help
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Note that nowadays we expect info files to be made using makeinfo.
+
+;;; Code:
+
+(defvar Info-history nil
+ "List of info nodes user has visited.
+Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
+
+(defvar Info-enable-edit nil
+ "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
+This is convenient if you want to write info files by hand.
+However, we recommend that you not do this.
+It is better to write a Texinfo file and generate the Info file from that,
+because that gives you a printed manual as well.")
+
+(defvar Info-enable-active-nodes nil
+ "Non-nil allows Info to execute Lisp code associated with nodes.
+The Lisp code is executed when the node is selected.")
+(put 'Info-enable-active-nodes 'risky-local-variable t)
+
+(defvar Info-fontify t
+ "*Non-nil enables highlighting and fonts in Info nodes.")
+
+(defvar Info-fontify-maximum-menu-size 30000
+ "*Maximum size of menu to fontify if `Info-fontify' is non-nil.")
+
+(defvar Info-directory-list
+ (let ((path (getenv "INFOPATH"))
+ ;; This is for older Emacs versions
+ ;; which might get this info.el from the Texinfo distribution.
+ (path-separator (if (boundp 'path-separator) path-separator
+ (if (eq system-type 'ms-dos) ";" ":")))
+ (source (expand-file-name "info/" source-directory))
+ (sibling (if installation-directory
+ (expand-file-name "info/" installation-directory)))
+ alternative)
+ (if path
+ (let ((list nil)
+ idx)
+ (while (> (length path) 0)
+ (setq idx (or (string-match path-separator path) (length path))
+ list (cons (substring path 0 idx) list)
+ path (substring path (min (1+ idx)
+ (length path)))))
+ (nreverse list))
+ (if (and sibling (file-exists-p sibling))
+ (setq alternative sibling)
+ (setq alternative source))
+ (if (or (member alternative Info-default-directory-list)
+ (not (file-exists-p alternative))
+ ;; On DOS/NT, we use movable executables always,
+ ;; and we must always find the Info dir at run time.
+ (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
+ nil
+ ;; Use invocation-directory for Info only if we used it for
+ ;; exec-directory also.
+ (not (string= exec-directory
+ (expand-file-name "lib-src/"
+ installation-directory)))))
+ Info-default-directory-list
+ (reverse (cons alternative
+ (cdr (reverse Info-default-directory-list)))))))
+ "List of directories to search for Info documentation files.
+nil means not yet initialized. In this case, Info uses the environment
+variable INFOPATH to initialize it, or `Info-default-directory-list'
+if there is no INFOPATH variable in the environment.
+The last element of `Info-default-directory-list' is the directory
+where Emacs installs the Info files that come with it.
+
+If you run the Emacs executable from the `src' directory in the Emacs
+source tree, the `info' directory in the source tree is used as the last
+element, in place of the installation Info directory. This is useful
+when you run a version of Emacs without installing it.")
+
+(defvar Info-additional-directory-list nil
+ "List of additional directories to search for Info documentation files.
+These directories are not searched for merging the `dir' file.")
+
+(defvar Info-current-file nil
+ "Info file that Info is now looking at, or nil.
+This is the name that was specified in Info, not the actual file name.
+It doesn't contain directory names or file name extensions added by Info.")
+
+(defvar Info-current-subfile nil
+ "Info subfile that is actually in the *info* buffer now,
+or nil if current info file is not split into subfiles.")
+
+(defvar Info-current-node nil
+ "Name of node that Info is now looking at, or nil.")
+
+(defvar Info-tag-table-marker (make-marker)
+ "Marker pointing at beginning of current Info file's tag table.
+Marker points nowhere if file has no tag table.")
+
+(defvar Info-current-file-completions nil
+ "Cached completion list for current Info file.")
+
+(defvar Info-index-alternatives nil
+ "List of possible matches for last Info-index command.")
+
+(defvar Info-standalone nil
+ "Non-nil if Emacs was started solely as an Info browser.")
+
+(defvar Info-suffix-list
+ (if (eq system-type 'ms-dos)
+ '( (".gz" . "gunzip")
+ (".z" . "gunzip")
+ (".inf" . nil)
+ ("" . nil))
+ '( (".info.Z" . "uncompress")
+ (".info.Y" . "unyabba")
+ (".info.gz" . "gunzip")
+ (".info.z" . "gunzip")
+ (".info" . nil)
+ (".Z" . "uncompress")
+ (".Y" . "unyabba")
+ (".gz" . "gunzip")
+ (".z" . "gunzip")
+ ("" . nil)))
+ "List of file name suffixes and associated decoding commands.
+Each entry should be (SUFFIX . STRING); the file is given to
+the command as standard input. If STRING is nil, no decoding is done.
+Because the SUFFIXes are tried in order, the empty string should
+be last in the list.")
+
+;; Concatenate SUFFIX onto FILENAME. SUFFIX should start with a dot.
+;; First, on ms-dos, delete some of the extension in FILENAME
+;; to make room.
+(defun info-insert-file-contents-1 (filename suffix)
+ (if (not (eq system-type 'ms-dos))
+ (concat filename suffix)
+ (let* ((sans-exts (file-name-sans-extension filename))
+ ;; How long is the extension in FILENAME (not counting the dot).
+ (ext-len (max 0 (- (length filename) (length sans-exts) 1)))
+ ext-left)
+ ;; SUFFIX starts with a dot. If FILENAME already has one,
+ ;; get rid of the one in SUFFIX (unless suffix is empty).
+ (or (and (<= ext-len 0)
+ (not (eq (aref filename (1- (length filename))) ?.)))
+ (= (length suffix) 0)
+ (setq suffix (substring suffix 1)))
+ ;; How many chars of that extension should we keep?
+ (setq ext-left (min ext-len (max 0 (- 3 (length suffix)))))
+ ;; Get rid of the rest of the extension, and add SUFFIX.
+ (concat (substring filename 0 (- (length filename)
+ (- ext-len ext-left)))
+ suffix))))
+
+(defun info-insert-file-contents (filename &optional visit)
+ "Insert the contents of an info file in the current buffer.
+Do the right thing if the file has been compressed or zipped."
+ (let ((tail Info-suffix-list)
+ fullname decoder)
+ (if (file-exists-p filename)
+ ;; FILENAME exists--see if that name contains a suffix.
+ ;; If so, set DECODE accordingly.
+ (progn
+ (while (and tail
+ (not (string-match
+ (concat (regexp-quote (car (car tail))) "$")
+ filename)))
+ (setq tail (cdr tail)))
+ (setq fullname filename
+ decoder (cdr (car tail))))
+ ;; Try adding suffixes to FILENAME and see if we can find something.
+ (while (and tail
+ (not (file-exists-p (info-insert-file-contents-1
+ filename (car (car tail))))))
+ (setq tail (cdr tail)))
+ ;; If we found a file with a suffix, set DECODER according to the suffix
+ ;; and set FULLNAME to the file's actual name.
+ (setq fullname (info-insert-file-contents-1 filename (car (car tail)))
+ decoder (cdr (car tail)))
+ (or tail
+ (error "Can't find %s or any compressed version of it" filename)))
+ ;; check for conflict with jka-compr
+ (if (and (featurep 'jka-compr)
+ (jka-compr-installed-p)
+ (jka-compr-get-compression-info fullname))
+ (setq decoder nil))
+ (insert-file-contents fullname visit)
+ (if decoder
+ (let ((buffer-read-only nil)
+ (default-directory (or (file-name-directory fullname)
+ default-directory)))
+ (call-process-region (point-min) (point-max) decoder t t)))))
+
+;;;###autoload (add-hook 'same-window-buffer-names "*info*")
+
+;;;###autoload
+(defun info (&optional file)
+ "Enter Info, the documentation browser.
+Optional argument FILE specifies the file to examine;
+the default is the top-level directory of Info.
+
+In interactive use, a prefix argument directs this command
+to read a file name from the minibuffer.
+
+The search path for Info files is in the variable `Info-directory-list'.
+The top-level Info directory is made by combining all the files named `dir'
+in all the directories in that path."
+ (interactive (if current-prefix-arg
+ (list (read-file-name "Info file name: " nil nil t))))
+ (if file
+ (Info-goto-node (concat "(" file ")"))
+ (if (get-buffer "*info*")
+ (pop-to-buffer "*info*")
+ (Info-directory))))
+
+;;;###autoload
+(defun info-standalone ()
+ "Run Emacs as a standalone Info reader.
+Usage: emacs -f info-standalone [filename]
+In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
+ (setq Info-standalone t)
+ (if (and command-line-args-left
+ (not (string-match "^-" (car command-line-args-left))))
+ (condition-case err
+ (progn
+ (info (car command-line-args-left))
+ (setq command-line-args-left (cdr command-line-args-left)))
+ (error (send-string-to-terminal
+ (format "%s\n" (if (eq (car-safe err) 'error)
+ (nth 1 err) err)))
+ (save-buffers-kill-emacs)))
+ (info)))
+
+;; Go to an info node specified as separate filename and nodename.
+;; no-going-back is non-nil if recovering from an error in this function;
+;; it says do not attempt further (recursive) error recovery.
+(defun Info-find-node (filename nodename &optional no-going-back)
+ ;; Convert filename to lower case if not found as specified.
+ ;; Expand it.
+ (if filename
+ (let (temp temp-downcase found)
+ (setq filename (substitute-in-file-name filename))
+ (if (string= (downcase filename) "dir")
+ (setq found t)
+ (let ((dirs (if (string-match "^\\./" filename)
+ ;; If specified name starts with `./'
+ ;; then just try current directory.
+ '("./")
+ (if (file-name-absolute-p filename)
+ ;; No point in searching for an
+ ;; absolute file name
+ '(nil)
+ (if Info-additional-directory-list
+ (append Info-directory-list
+ Info-additional-directory-list)
+ Info-directory-list)))))
+ ;; Search the directory list for file FILENAME.
+ (while (and dirs (not found))
+ (setq temp (expand-file-name filename (car dirs)))
+ (setq temp-downcase
+ (expand-file-name (downcase filename) (car dirs)))
+ ;; Try several variants of specified name.
+ (let ((suffix-list Info-suffix-list))
+ (while (and suffix-list (not found))
+ (cond ((file-exists-p
+ (info-insert-file-contents-1
+ temp (car (car suffix-list))))
+ (setq found temp))
+ ((file-exists-p
+ (info-insert-file-contents-1
+ temp-downcase (car (car suffix-list))))
+ (setq found temp-downcase)))
+ (setq suffix-list (cdr suffix-list))))
+ (setq dirs (cdr dirs)))))
+ (if found
+ (setq filename found)
+ (error "Info file %s does not exist" filename))))
+ ;; Record the node we are leaving.
+ (if (and Info-current-file (not no-going-back))
+ (setq Info-history
+ (cons (list Info-current-file Info-current-node (point))
+ Info-history)))
+ ;; Go into info buffer.
+ (switch-to-buffer "*info*")
+ (buffer-disable-undo (current-buffer))
+ (or (eq major-mode 'Info-mode)
+ (Info-mode))
+ (widen)
+ (setq Info-current-node nil)
+ (unwind-protect
+ (progn
+ ;; Switch files if necessary
+ (or (null filename)
+ (equal Info-current-file filename)
+ (let ((buffer-read-only nil))
+ (setq Info-current-file nil
+ Info-current-subfile nil
+ Info-current-file-completions nil
+ Info-index-alternatives nil
+ buffer-file-name nil)
+ (erase-buffer)
+ (if (eq filename t)
+ (Info-insert-dir)
+ (info-insert-file-contents filename t)
+ (setq default-directory (file-name-directory filename)))
+ (set-buffer-modified-p nil)
+ ;; See whether file has a tag table. Record the location if yes.
+ (set-marker Info-tag-table-marker nil)
+ (goto-char (point-max))
+ (forward-line -8)
+ ;; Use string-equal, not equal, to ignore text props.
+ (or (string-equal nodename "*")
+ (not (search-forward "\^_\nEnd tag table\n" nil t))
+ (let (pos)
+ ;; We have a tag table. Find its beginning.
+ ;; Is this an indirect file?
+ (search-backward "\nTag table:\n")
+ (setq pos (point))
+ (if (save-excursion
+ (forward-line 2)
+ (looking-at "(Indirect)\n"))
+ ;; It is indirect. Copy it to another buffer
+ ;; and record that the tag table is in that buffer.
+ (save-excursion
+ (let ((buf (current-buffer)))
+ (set-buffer (get-buffer-create " *info tag table*"))
+ (buffer-disable-undo (current-buffer))
+ (setq case-fold-search t)
+ (erase-buffer)
+ (insert-buffer-substring buf)
+ (set-marker Info-tag-table-marker
+ (match-end 0))))
+ (set-marker Info-tag-table-marker pos))))
+ (setq Info-current-file
+ (if (eq filename t) "dir" filename))))
+ ;; Use string-equal, not equal, to ignore text props.
+ (if (string-equal nodename "*")
+ (progn (setq Info-current-node nodename)
+ (Info-set-mode-line))
+ ;; Search file for a suitable node.
+ (let ((guesspos (point-min))
+ (regexp (concat "Node: *" (regexp-quote nodename) " *[,\t\n\177]")))
+ ;; First get advice from tag table if file has one.
+ ;; Also, if this is an indirect info file,
+ ;; read the proper subfile into this buffer.
+ (if (marker-position Info-tag-table-marker)
+ (save-excursion
+ (set-buffer (marker-buffer Info-tag-table-marker))
+ (goto-char Info-tag-table-marker)
+ (if (re-search-forward regexp nil t)
+ (progn
+ (setq guesspos (read (current-buffer)))
+ ;; If this is an indirect file,
+ ;; determine which file really holds this node
+ ;; and read it in.
+ (if (not (eq (current-buffer) (get-buffer "*info*")))
+ (setq guesspos
+ (Info-read-subfile guesspos))))
+ (error "No such node: %s" nodename))))
+ (goto-char (max (point-min) (- guesspos 1000)))
+ ;; Now search from our advised position (or from beg of buffer)
+ ;; to find the actual node.
+ (catch 'foo
+ (while (search-forward "\n\^_" nil t)
+ (forward-line 1)
+ (let ((beg (point)))
+ (forward-line 1)
+ (if (re-search-backward regexp beg t)
+ (throw 'foo t))))
+ (error "No such node: %s" nodename)))
+ (Info-select-node)))
+ ;; If we did not finish finding the specified node,
+ ;; go back to the previous one.
+ (or Info-current-node no-going-back (null Info-history)
+ (let ((hist (car Info-history)))
+ (setq Info-history (cdr Info-history))
+ (Info-find-node (nth 0 hist) (nth 1 hist) t)
+ (goto-char (nth 2 hist)))))
+ (goto-char (point-min)))
+
+;; Cache the contents of the (virtual) dir file, once we have merged
+;; it for the first time, so we can save time subsequently.
+(defvar Info-dir-contents nil)
+
+;; Cache for the directory we decided to use for the default-directory
+;; of the merged dir text.
+(defvar Info-dir-contents-directory nil)
+
+;; Record the file attributes of all the files from which we
+;; constructed Info-dir-contents.
+(defvar Info-dir-file-attributes nil)
+
+;; Construct the Info directory node by merging the files named `dir'
+;; from various directories. Set the *info* buffer's
+;; default-directory to the first directory we actually get any text
+;; from.
+(defun Info-insert-dir ()
+ (if (and Info-dir-contents Info-dir-file-attributes
+ ;; Verify that none of the files we used has changed
+ ;; since we used it.
+ (eval (cons 'and
+ (mapcar '(lambda (elt)
+ (let ((curr (file-attributes (car elt))))
+ ;; Don't compare the access time.
+ (if curr (setcar (nthcdr 4 curr) 0))
+ (setcar (nthcdr 4 (cdr elt)) 0)
+ (equal (cdr elt) curr)))
+ Info-dir-file-attributes))))
+ (insert Info-dir-contents)
+ (let ((dirs Info-directory-list)
+ buffers buffer others nodes dirs-done)
+
+ (setq Info-dir-file-attributes nil)
+
+ ;; Search the directory list for the directory file.
+ (while dirs
+ (let ((truename (file-truename (expand-file-name (car dirs)))))
+ (or (member truename dirs-done)
+ (member (directory-file-name truename) dirs-done)
+ ;; Try several variants of specified name.
+ ;; Try upcasing, appending `.info', or both.
+ (let* (file
+ (attrs
+ (or
+ (progn (setq file (expand-file-name "dir" truename))
+ (file-attributes file))
+ (progn (setq file (expand-file-name "DIR" truename))
+ (file-attributes file))
+ (progn (setq file (expand-file-name "dir.info" truename))
+ (file-attributes file))
+ (progn (setq file (expand-file-name "DIR.INFO" truename))
+ (file-attributes file)))))
+ (setq dirs-done
+ (cons truename
+ (cons (directory-file-name truename)
+ dirs-done)))
+ (if attrs
+ (save-excursion
+ (or buffers
+ (message "Composing main Info directory..."))
+ (set-buffer (generate-new-buffer "info dir"))
+ (insert-file-contents file)
+ (setq buffers (cons (current-buffer) buffers)
+ Info-dir-file-attributes
+ (cons (cons file attrs)
+ Info-dir-file-attributes))))))
+ (or (cdr dirs) (setq Info-dir-contents-directory (car dirs)))
+ (setq dirs (cdr dirs))))
+
+ (or buffers
+ (error "Can't find the Info directory node"))
+ ;; Distinguish the dir file that comes with Emacs from all the
+ ;; others. Yes, that is really what this is supposed to do.
+ ;; If it doesn't work, fix it.
+ (setq buffer (car buffers)
+ others (cdr buffers))
+
+ ;; Insert the entire original dir file as a start; note that we've
+ ;; already saved its default directory to use as the default
+ ;; directory for the whole concatenation.
+ (insert-buffer buffer)
+
+ ;; Look at each of the other buffers one by one.
+ (while others
+ (let ((other (car others)))
+ ;; In each, find all the menus.
+ (save-excursion
+ (set-buffer other)
+ (goto-char (point-min))
+ ;; Find each menu, and add an elt to NODES for it.
+ (while (re-search-forward "^\\* Menu:" nil t)
+ (let (beg nodename end)
+ (forward-line 1)
+ (setq beg (point))
+ (search-backward "\n\^_")
+ (search-forward "Node: ")
+ (setq nodename (Info-following-node-name))
+ (search-forward "\n\^_" nil 'move)
+ (beginning-of-line)
+ (setq end (point))
+ (setq nodes (cons (list nodename other beg end) nodes))))))
+ (setq others (cdr others)))
+ ;; Add to the main menu a menu item for each other node.
+ (re-search-forward "^\\* Menu:")
+ (forward-line 1)
+ (let ((menu-items '("top"))
+ (nodes nodes)
+ (case-fold-search t)
+ (end (save-excursion (search-forward "\^_" nil t) (point))))
+ (while nodes
+ (let ((nodename (car (car nodes))))
+ (save-excursion
+ (or (member (downcase nodename) menu-items)
+ (re-search-forward (concat "^\\* "
+ (regexp-quote nodename)
+ "::")
+ end t)
+ (progn
+ (insert "* " nodename "::" "\n")
+ (setq menu-items (cons nodename menu-items))))))
+ (setq nodes (cdr nodes))))
+ ;; Now take each node of each of the other buffers
+ ;; and merge it into the main buffer.
+ (while nodes
+ (let ((nodename (car (car nodes))))
+ (goto-char (point-min))
+ ;; Find the like-named node in the main buffer.
+ (if (re-search-forward (concat "\n\^_.*\n.*Node: "
+ (regexp-quote nodename)
+ "[,\n\t]")
+ nil t)
+ (progn
+ (search-forward "\n\^_" nil 'move)
+ (beginning-of-line)
+ (insert "\n"))
+ ;; If none exists, add one.
+ (goto-char (point-max))
+ (insert "\^_\nFile: dir\tNode: " nodename "\n\n* Menu:\n\n"))
+ ;; Merge the text from the other buffer's menu
+ ;; into the menu in the like-named node in the main buffer.
+ (apply 'insert-buffer-substring (cdr (car nodes))))
+ (setq nodes (cdr nodes)))
+ ;; Kill all the buffers we just made.
+ (while buffers
+ (kill-buffer (car buffers))
+ (setq buffers (cdr buffers)))
+ (message "Composing main Info directory...done"))
+ (setq Info-dir-contents (buffer-string)))
+ (setq default-directory Info-dir-contents-directory))
+
+(defun Info-read-subfile (nodepos)
+ (set-buffer (marker-buffer Info-tag-table-marker))
+ (goto-char (point-min))
+ (search-forward "\n\^_")
+ (let (lastfilepos
+ lastfilename)
+ (forward-line 2)
+ (catch 'foo
+ (while (not (looking-at "\^_"))
+ (if (not (eolp))
+ (let ((beg (point))
+ thisfilepos thisfilename)
+ (search-forward ": ")
+ (setq thisfilename (buffer-substring beg (- (point) 2)))
+ (setq thisfilepos (read (current-buffer)))
+ ;; read in version 19 stops at the end of number.
+ ;; Advance to the next line.
+ (forward-line 1)
+ (if (> thisfilepos nodepos)
+ (throw 'foo t))
+ (setq lastfilename thisfilename)
+ (setq lastfilepos thisfilepos))
+ (forward-line 1))))
+ (set-buffer (get-buffer "*info*"))
+ (or (equal Info-current-subfile lastfilename)
+ (let ((buffer-read-only nil))
+ (setq buffer-file-name nil)
+ (widen)
+ (erase-buffer)
+ (info-insert-file-contents lastfilename)
+ (set-buffer-modified-p nil)
+ (setq Info-current-subfile lastfilename)))
+ (goto-char (point-min))
+ (search-forward "\n\^_")
+ (+ (- nodepos lastfilepos) (point))))
+
+;; Select the info node that point is in.
+(defun Info-select-node ()
+ (save-excursion
+ ;; Find beginning of node.
+ (search-backward "\n\^_")
+ (forward-line 2)
+ ;; Get nodename spelled as it is in the node.
+ (re-search-forward "Node:[ \t]*")
+ (setq Info-current-node
+ (buffer-substring-no-properties (point)
+ (progn
+ (skip-chars-forward "^,\t\n")
+ (point))))
+ (Info-set-mode-line)
+ ;; Find the end of it, and narrow.
+ (beginning-of-line)
+ (let (active-expression)
+ (narrow-to-region (point)
+ (if (re-search-forward "\n[\^_\f]" nil t)
+ (prog1
+ (1- (point))
+ (if (looking-at "[\n\^_\f]*execute: ")
+ (progn
+ (goto-char (match-end 0))
+ (setq active-expression
+ (read (current-buffer))))))
+ (point-max)))
+ (if Info-enable-active-nodes (eval active-expression))
+ (if Info-fontify (Info-fontify-node))
+ (run-hooks 'Info-selection-hook))))
+
+(defun Info-set-mode-line ()
+ (setq mode-line-buffer-identification
+ (concat
+ "Info: ("
+ (if Info-current-file
+ (file-name-nondirectory Info-current-file)
+ "")
+ ")"
+ (or Info-current-node ""))))
+
+;; Go to an info node specified with a filename-and-nodename string
+;; of the sort that is found in pointers in nodes.
+
+(defun Info-goto-node (nodename)
+ "Go to info node named NAME. Give just NODENAME or (FILENAME)NODENAME."
+ (interactive (list (Info-read-node-name "Goto node: ")))
+ (let (filename)
+ (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)"
+ nodename)
+ (setq filename (if (= (match-beginning 1) (match-end 1))
+ ""
+ (substring nodename (match-beginning 2) (match-end 2)))
+ nodename (substring nodename (match-beginning 3) (match-end 3)))
+ (let ((trim (string-match "\\s *\\'" filename)))
+ (if trim (setq filename (substring filename 0 trim))))
+ (let ((trim (string-match "\\s *\\'" nodename)))
+ (if trim (setq nodename (substring nodename 0 trim))))
+ (if transient-mark-mode (deactivate-mark))
+ (Info-find-node (if (equal filename "") nil filename)
+ (if (equal nodename "") "Top" nodename))))
+
+;; This function is used as the "completion table" while reading a node name.
+;; It does completion using the alist in completion-table
+;; unless STRING starts with an open-paren.
+(defun Info-read-node-name-1 (string predicate code)
+ (let ((no-completion (and (> (length string) 0) (eq (aref string 0) ?\())))
+ (cond ((eq code nil)
+ (if no-completion
+ string
+ (try-completion string completion-table predicate)))
+ ((eq code t)
+ (if no-completion
+ nil
+ (all-completions string completion-table predicate)))
+ ((eq code 'lambda)
+ (if no-completion
+ t
+ (assoc string completion-table))))))
+
+(defun Info-read-node-name (prompt &optional default)
+ (let* ((completion-ignore-case t)
+ (completion-table (Info-build-node-completions))
+ (nodename (completing-read prompt 'Info-read-node-name-1)))
+ (if (equal nodename "")
+ (or default
+ (Info-read-node-name prompt))
+ nodename)))
+
+(defun Info-build-node-completions ()
+ (or Info-current-file-completions
+ (let ((compl nil))
+ (save-excursion
+ (save-restriction
+ (if (marker-buffer Info-tag-table-marker)
+ (progn
+ (set-buffer (marker-buffer Info-tag-table-marker))
+ (widen)
+ (goto-char Info-tag-table-marker)
+ (while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
+ (setq compl
+ (cons (list (buffer-substring (match-beginning 1)
+ (match-end 1)))
+ compl))))
+ (widen)
+ (goto-char (point-min))
+ (while (search-forward "\n\^_" nil t)
+ (forward-line 1)
+ (let ((beg (point)))
+ (forward-line 1)
+ (if (re-search-backward "Node: *\\([^,\n]*\\) *[,\n\t]"
+ beg t)
+ (setq compl
+ (cons (list (buffer-substring (match-beginning 1)
+ (match-end 1)))
+ compl))))))))
+ (setq Info-current-file-completions compl))))
+
+(defun Info-restore-point (hl)
+ "If this node has been visited, restore the point value when we left."
+ (while hl
+ (if (and (equal (nth 0 (car hl)) Info-current-file)
+ ;; Use string-equal, not equal, to ignore text props.
+ (string-equal (nth 1 (car hl)) Info-current-node))
+ (progn
+ (goto-char (nth 2 (car hl)))
+ (setq hl nil)) ;terminate the while at next iter
+ (setq hl (cdr hl)))))
+
+(defvar Info-last-search nil
+ "Default regexp for \\<Info-mode-map>\\[Info-search] command to search for.")
+
+(defun Info-search (regexp)
+ "Search for REGEXP, starting from point, and select node it's found in."
+ (interactive "sSearch (regexp): ")
+ (if transient-mark-mode (deactivate-mark))
+ (if (equal regexp "")
+ (setq regexp Info-last-search)
+ (setq Info-last-search regexp))
+ (let ((found ()) current
+ (onode Info-current-node)
+ (ofile Info-current-file)
+ (opoint (point))
+ (osubfile Info-current-subfile))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (if (null Info-current-subfile)
+ (progn (re-search-forward regexp) (setq found (point)))
+ (condition-case err
+ (progn (re-search-forward regexp) (setq found (point)))
+ (search-failed nil)))))
+ (if (not found) ;can only happen in subfile case -- else would have erred
+ (unwind-protect
+ (let ((list ()))
+ (set-buffer (marker-buffer Info-tag-table-marker))
+ (goto-char (point-min))
+ (search-forward "\n\^_\nIndirect:")
+ (save-restriction
+ (narrow-to-region (point)
+ (progn (search-forward "\n\^_")
+ (1- (point))))
+ (goto-char (point-min))
+ (search-forward (concat "\n" osubfile ": "))
+ (beginning-of-line)
+ (while (not (eobp))
+ (re-search-forward "\\(^.*\\): [0-9]+$")
+ (goto-char (+ (match-end 1) 2))
+ (setq list (cons (cons (read (current-buffer))
+ (buffer-substring (match-beginning 1)
+ (match-end 1)))
+ list))
+ (goto-char (1+ (match-end 0))))
+ (setq list (nreverse list)
+ current (car (car list))
+ list (cdr list)))
+ (while list
+ (message "Searching subfile %s..." (cdr (car list)))
+ (Info-read-subfile (car (car list)))
+ (setq list (cdr list))
+;; (goto-char (point-min))
+ (if (re-search-forward regexp nil t)
+ (setq found (point) list ())))
+ (if found
+ (message "")
+ (signal 'search-failed (list regexp))))
+ (if (not found)
+ (progn (Info-read-subfile opoint)
+ (goto-char opoint)
+ (Info-select-node)))))
+ (widen)
+ (goto-char found)
+ (Info-select-node)
+ ;; Use string-equal, not equal, to ignore text props.
+ (or (and (string-equal onode Info-current-node)
+ (equal ofile Info-current-file))
+ (setq Info-history (cons (list ofile onode opoint)
+ Info-history)))))
+
+;; Extract the value of the node-pointer named NAME.
+;; If there is none, use ERRORNAME in the error message;
+;; if ERRORNAME is nil, just return nil.
+(defun Info-extract-pointer (name &optional errorname)
+ (save-excursion
+ (goto-char (point-min))
+ (forward-line 1)
+ (if (re-search-backward (concat name ":") nil t)
+ (progn
+ (goto-char (match-end 0))
+ (Info-following-node-name))
+ (if (eq errorname t)
+ nil
+ (error "Node has no %s" (capitalize (or errorname name)))))))
+
+;; Return the node name in the buffer following point.
+;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
+;; saying which chas may appear in the node name.
+(defun Info-following-node-name (&optional allowedchars)
+ (skip-chars-forward " \t")
+ (buffer-substring-no-properties
+ (point)
+ (progn
+ (while (looking-at (concat "[" (or allowedchars "^,\t\n") "]"))
+ (skip-chars-forward (concat (or allowedchars "^,\t\n") "("))
+ (if (looking-at "(")
+ (skip-chars-forward "^)")))
+ (skip-chars-backward " ")
+ (point))))
+
+(defun Info-next ()
+ "Go to the next node of this node."
+ (interactive)
+ (Info-goto-node (Info-extract-pointer "next")))
+
+(defun Info-prev ()
+ "Go to the previous node of this node."
+ (interactive)
+ (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous")))
+
+(defun Info-up ()
+ "Go to the superior node of this node."
+ (interactive)
+ (Info-goto-node (Info-extract-pointer "up"))
+ (Info-restore-point Info-history))
+
+(defun Info-last ()
+ "Go back to the last node visited."
+ (interactive)
+ (or Info-history
+ (error "This is the first Info node you looked at"))
+ (let (filename nodename opoint)
+ (setq filename (car (car Info-history)))
+ (setq nodename (car (cdr (car Info-history))))
+ (setq opoint (car (cdr (cdr (car Info-history)))))
+ (setq Info-history (cdr Info-history))
+ (Info-find-node filename nodename)
+ (setq Info-history (cdr Info-history))
+ (goto-char opoint)))
+
+(defun Info-directory ()
+ "Go to the Info directory node."
+ (interactive)
+ (Info-find-node "dir" "top"))
+
+(defun Info-follow-reference (footnotename)
+ "Follow cross reference named NAME to the node it refers to.
+NAME may be an abbreviation of the reference name."
+ (interactive
+ (let ((completion-ignore-case t)
+ completions default alt-default (start-point (point)) str i bol eol)
+ (save-excursion
+ ;; Store end and beginning of line.
+ (end-of-line)
+ (setq eol (point))
+ (beginning-of-line)
+ (setq bol (point))
+
+ (goto-char (point-min))
+ (while (re-search-forward "\\*note[ \n\t]*\\([^:]*\\):" nil t)
+ (setq str (buffer-substring
+ (match-beginning 1)
+ (1- (point))))
+ ;; See if this one should be the default.
+ (and (null default)
+ (<= (match-beginning 0) start-point)
+ (<= start-point (point))
+ (setq default t))
+ ;; See if this one should be the alternate default.
+ (and (null alt-default)
+ (and (<= bol (match-beginning 0))
+ (<= (point) eol))
+ (setq alt-default t))
+ (setq i 0)
+ (while (setq i (string-match "[ \n\t]+" str i))
+ (setq str (concat (substring str 0 i) " "
+ (substring str (match-end 0))))
+ (setq i (1+ i)))
+ ;; Record as a completion and perhaps as default.
+ (if (eq default t) (setq default str))
+ (if (eq alt-default t) (setq alt-default str))
+ (setq completions
+ (cons (cons str nil)
+ completions))))
+ ;; If no good default was found, try an alternate.
+ (or default
+ (setq default alt-default))
+ ;; If only one cross-reference found, then make it default.
+ (if (eq (length completions) 1)
+ (setq default (car (car completions))))
+ (if completions
+ (let ((input (completing-read (if default
+ (concat "Follow reference named: ("
+ default ") ")
+ "Follow reference named: ")
+ completions nil t)))
+ (list (if (equal input "")
+ default input)))
+ (error "No cross-references in this node"))))
+ (let (target beg i (str (concat "\\*note " (regexp-quote footnotename))))
+ (while (setq i (string-match " " str i))
+ (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i))))
+ (setq i (+ i 6)))
+ (save-excursion
+ (goto-char (point-min))
+ (or (re-search-forward str nil t)
+ (error "No cross-reference named %s" footnotename))
+ (goto-char (+ (match-beginning 0) 5))
+ (setq target
+ (Info-extract-menu-node-name "Bad format cross reference" t)))
+ (while (setq i (string-match "[ \t\n]+" target i))
+ (setq target (concat (substring target 0 i) " "
+ (substring target (match-end 0))))
+ (setq i (+ i 1)))
+ (Info-goto-node target)))
+
+(defun Info-extract-menu-node-name (&optional errmessage multi-line)
+ (skip-chars-forward " \t\n")
+ (let ((beg (point))
+ str i)
+ (skip-chars-forward "^:")
+ (forward-char 1)
+ (setq str
+ (if (looking-at ":")
+ (buffer-substring-no-properties beg (1- (point)))
+ (skip-chars-forward " \t\n")
+ (Info-following-node-name (if multi-line "^.,\t" "^.,\t\n"))))
+ (while (setq i (string-match "\n" str i))
+ (aset str i ?\ ))
+ ;; Collapse multiple spaces.
+ (while (string-match " +" str)
+ (setq str (replace-match " " t t str)))
+ str))
+
+;; No one calls this.
+;;(defun Info-menu-item-sequence (list)
+;; (while list
+;; (Info-menu (car list))
+;; (setq list (cdr list))))
+
+(defun Info-complete-menu-item (string predicate action)
+ (let ((case-fold-search t))
+ (cond ((eq action nil)
+ (let (completions
+ (pattern (concat "\n\\* \\("
+ (regexp-quote string)
+ "[^:\t\n]*\\):")))
+ (save-excursion
+ (set-buffer Info-complete-menu-buffer)
+ (goto-char (point-min))
+ (search-forward "\n* Menu:")
+ (while (re-search-forward pattern nil t)
+ (setq completions (cons (cons (format "%s"
+ (buffer-substring
+ (match-beginning 1)
+ (match-end 1)))
+ (match-beginning 1))
+ completions))))
+ (try-completion string completions predicate)))
+ ((eq action t)
+ (let (completions
+ (pattern (concat "\n\\* \\("
+ (regexp-quote string)
+ "[^:\t\n]*\\):")))
+ (save-excursion
+ (set-buffer Info-complete-menu-buffer)
+ (goto-char (point-min))
+ (search-forward "\n* Menu:")
+ (while (re-search-forward pattern nil t)
+ (setq completions (cons (cons (format "%s"
+ (buffer-substring
+ (match-beginning 1)
+ (match-end 1)))
+ (match-beginning 1))
+ completions))))
+ (all-completions string completions predicate)))
+ (t
+ (save-excursion
+ (set-buffer Info-complete-menu-buffer)
+ (goto-char (point-min))
+ (search-forward "\n* Menu:")
+ (re-search-forward (concat "\n\\* "
+ (regexp-quote string)
+ ":")
+ nil t))))))
+
+
+(defun Info-menu (menu-item)
+ "Go to node for menu item named (or abbreviated) NAME.
+Completion is allowed, and the menu item point is on is the default."
+ (interactive
+ (let ((completions '())
+ ;; If point is within a menu item, use that item as the default
+ (default nil)
+ (p (point))
+ beg
+ (last nil))
+ (save-excursion
+ (goto-char (point-min))
+ (if (not (search-forward "\n* menu:" nil t))
+ (error "No menu in this node"))
+ (setq beg (point))
+ (and (< (point) p)
+ (save-excursion
+ (goto-char p)
+ (end-of-line)
+ (re-search-backward "\n\\* \\([^:\t\n]*\\):" beg t)
+ (setq default (format "%s" (buffer-substring
+ (match-beginning 1)
+ (match-end 1)))))))
+ (let ((item nil))
+ (while (null item)
+ (setq item (let ((completion-ignore-case t)
+ (Info-complete-menu-buffer (current-buffer)))
+ (completing-read (if default
+ (format "Menu item (default %s): "
+ default)
+ "Menu item: ")
+ 'Info-complete-menu-item nil t)))
+ ;; we rely on the fact that completing-read accepts an input
+ ;; of "" even when the require-match argument is true and ""
+ ;; is not a valid possibility
+ (if (string= item "")
+ (if default
+ (setq item default)
+ ;; ask again
+ (setq item nil))))
+ (list item))))
+ ;; there is a problem here in that if several menu items have the same
+ ;; name you can only go to the node of the first with this command.
+ (Info-goto-node (Info-extract-menu-item menu-item)))
+
+(defun Info-extract-menu-item (menu-item)
+ (setq menu-item (regexp-quote menu-item))
+ (save-excursion
+ (goto-char (point-min))
+ (or (search-forward "\n* menu:" nil t)
+ (error "No menu in this node"))
+ (or (re-search-forward (concat "\n\\* " menu-item ":") nil t)
+ (re-search-forward (concat "\n\\* " menu-item) nil t)
+ (error "No such item in menu"))
+ (beginning-of-line)
+ (forward-char 2)
+ (Info-extract-menu-node-name)))
+
+;; If COUNT is nil, use the last item in the menu.
+(defun Info-extract-menu-counting (count)
+ (save-excursion
+ (goto-char (point-min))
+ (or (search-forward "\n* menu:" nil t)
+ (error "No menu in this node"))
+ (if count
+ (or (search-forward "\n* " nil t count)
+ (error "Too few items in menu"))
+ (while (search-forward "\n* " nil t)
+ nil))
+ (Info-extract-menu-node-name)))
+
+(defun Info-nth-menu-item ()
+ "Go to the node of the Nth menu item.
+N is the digit argument used to invoke this command."
+ (interactive)
+ (Info-goto-node
+ (Info-extract-menu-counting
+ (- (aref (this-command-keys) (1- (length (this-command-keys)))) ?0))))
+
+(defun Info-top-node ()
+ "Go to the Top node of this file."
+ (interactive)
+ (Info-goto-node "Top"))
+
+(defun Info-final-node ()
+ "Go to the final node in this file."
+ (interactive)
+ (Info-goto-node "Top")
+ (let (Info-history)
+ ;; Go to the last node in the menu of Top.
+ (Info-goto-node (Info-extract-menu-counting nil))
+ ;; If the last node in the menu is not last in pointer structure,
+ ;; move forward until we can't go any farther.
+ (while (Info-forward-node t t) nil)
+ ;; Then keep moving down to last subnode, unless we reach an index.
+ (while (and (not (string-match "\\<index\\>" Info-current-node))
+ (save-excursion (search-forward "\n* Menu:" nil t)))
+ (Info-goto-node (Info-extract-menu-counting nil)))))
+
+(defun Info-forward-node (&optional not-down no-error)
+ "Go forward one node, considering all nodes as forming one sequence."
+ (interactive)
+ (goto-char (point-min))
+ (forward-line 1)
+ ;; three possibilities, in order of priority:
+ ;; 1. next node is in a menu in this node (but not in an index)
+ ;; 2. next node is next at same level
+ ;; 3. next node is up and next
+ (cond ((and (not not-down)
+ (save-excursion (search-forward "\n* menu:" nil t))
+ (not (string-match "\\<index\\>" Info-current-node)))
+ (Info-goto-node (Info-extract-menu-counting 1))
+ t)
+ ((save-excursion (search-backward "next:" nil t))
+ (Info-next)
+ t)
+ ((and (save-excursion (search-backward "up:" nil t))
+ ;; Use string-equal, not equal, to ignore text props.
+ (not (string-equal (downcase (Info-extract-pointer "up"))
+ "top")))
+ (let ((old-node Info-current-node))
+ (Info-up)
+ (let (Info-history success)
+ (unwind-protect
+ (setq success (Info-forward-node t no-error))
+ (or success (Info-goto-node old-node))))))
+ (no-error nil)
+ (t (error "No pointer forward from this node"))))
+
+(defun Info-backward-node ()
+ "Go backward one node, considering all nodes as forming one sequence."
+ (interactive)
+ (let ((prevnode (Info-extract-pointer "prev[ious]*" t))
+ (upnode (Info-extract-pointer "up" t)))
+ (cond ((and upnode (string-match "(" upnode))
+ (error "First node in file"))
+ ((and upnode (or (null prevnode)
+ ;; Use string-equal, not equal,
+ ;; to ignore text properties.
+ (string-equal (downcase prevnode)
+ (downcase upnode))))
+ (Info-up))
+ (prevnode
+ ;; If we move back at the same level,
+ ;; go down to find the last subnode*.
+ (Info-prev)
+ (let (Info-history)
+ (while (and (not (string-match "\\<index\\>" Info-current-node))
+ (save-excursion (search-forward "\n* Menu:" nil t)))
+ (Info-goto-node (Info-extract-menu-counting nil)))))
+ (t
+ (error "No pointer backward from this node")))))
+
+(defun Info-exit ()
+ "Exit Info by selecting some other buffer."
+ (interactive)
+ (if Info-standalone
+ (save-buffers-kill-emacs)
+ (switch-to-buffer (prog1 (other-buffer (current-buffer))
+ (bury-buffer (current-buffer))))))
+
+(defun Info-next-menu-item ()
+ (interactive)
+ (save-excursion
+ (forward-line -1)
+ (search-forward "\n* menu:" nil t)
+ (or (search-forward "\n* " nil t)
+ (error "No more items in menu"))
+ (Info-goto-node (Info-extract-menu-node-name))))
+
+(defun Info-last-menu-item ()
+ (interactive)
+ (save-excursion
+ (forward-line 1)
+ (let ((beg (save-excursion
+ (and (search-backward "\n* menu:" nil t)
+ (point)))))
+ (or (and beg (search-backward "\n* " beg t))
+ (error "No previous items in menu")))
+ (Info-goto-node (save-excursion
+ (goto-char (match-end 0))
+ (Info-extract-menu-node-name)))))
+
+(defmacro Info-no-error (&rest body)
+ (list 'condition-case nil (cons 'progn (append body '(t))) '(error nil)))
+
+(defun Info-next-preorder ()
+ "Go to the next subnode or the next node, or go up a level."
+ (interactive)
+ (cond ((Info-no-error (Info-next-menu-item)))
+ ((Info-no-error (Info-next)))
+ ((Info-no-error (Info-up))
+ ;; Since we have already gone thru all the items in this menu,
+ ;; go up to the end of this node.
+ (goto-char (point-max))
+ ;; Since logically we are done with the node with that menu,
+ ;; move on from it.
+ (Info-next-preorder))
+ (t
+ (error "No more nodes"))))
+
+(defun Info-last-preorder ()
+ "Go to the last node, popping up a level if there is none."
+ (interactive)
+ (cond ((Info-no-error
+ (Info-last-menu-item)
+ ;; If we go down a menu item, go to the end of the node
+ ;; so we can scroll back through it.
+ (goto-char (point-max)))
+ ;; Keep going down, as long as there are nested menu nodes.
+ (while (Info-no-error
+ (Info-last-menu-item)
+ ;; If we go down a menu item, go to the end of the node
+ ;; so we can scroll back through it.
+ (goto-char (point-max))))
+ (recenter -1))
+ ((Info-no-error (Info-prev))
+ (goto-char (point-max))
+ (while (Info-no-error
+ (Info-last-menu-item)
+ ;; If we go down a menu item, go to the end of the node
+ ;; so we can scroll back through it.
+ (goto-char (point-max))))
+ (recenter -1))
+ ((Info-no-error (Info-up))
+ (goto-char (point-min))
+ (or (search-forward "\n* Menu:" nil t)
+ (goto-char (point-max))))
+ (t (error "No previous nodes"))))
+
+(defun Info-scroll-up ()
+ "Scroll one screenful forward in Info, considering all nodes as one sequence.
+Once you scroll far enough in a node that its menu appears on the screen,
+the next scroll moves into its first subnode. When you scroll past
+the end of a node, that goes to the next node or back up to the parent node."
+ (interactive)
+ (if (or (< (window-start) (point-min))
+ (> (window-start) (point-max)))
+ (set-window-start (selected-window) (point)))
+ (let ((virtual-end (save-excursion
+ (goto-char (point-min))
+ (if (search-forward "\n* Menu:" nil t)
+ (point)
+ (point-max)))))
+ (if (or (< virtual-end (window-start))
+ (pos-visible-in-window-p virtual-end))
+ (Info-next-preorder)
+ (scroll-up))))
+
+(defun Info-scroll-down ()
+ "Scroll one screenful back in Info, considering all nodes as one sequence.
+Within the menu of a node, this goes to its last subnode.
+When you scroll past the beginning of a node, that goes to the
+previous node or back up to the parent node."
+ (interactive)
+ (if (or (< (window-start) (point-min))
+ (> (window-start) (point-max)))
+ (set-window-start (selected-window) (point)))
+ (let* ((current-point (point))
+ (virtual-end (save-excursion
+ (beginning-of-line)
+ (setq current-point (point))
+ (goto-char (point-min))
+ (search-forward "\n* Menu:"
+ current-point
+ t))))
+ (if (or virtual-end (pos-visible-in-window-p (point-min)))
+ (Info-last-preorder)
+ (scroll-down))))
+
+(defun Info-next-reference (&optional recur)
+ "Move cursor to the next cross-reference or menu item in the node."
+ (interactive)
+ (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
+ (old-pt (point)))
+ (or (eobp) (forward-char 1))
+ (or (re-search-forward pat nil t)
+ (progn
+ (goto-char (point-min))
+ (or (re-search-forward pat nil t)
+ (progn
+ (goto-char old-pt)
+ (error "No cross references in this node")))))
+ (goto-char (match-beginning 0))
+ (if (looking-at "\\* Menu:")
+ (if recur
+ (error "No cross references in this node")
+ (Info-next-reference t)))))
+
+(defun Info-prev-reference (&optional recur)
+ "Move cursor to the previous cross-reference or menu item in the node."
+ (interactive)
+ (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
+ (old-pt (point)))
+ (or (re-search-backward pat nil t)
+ (progn
+ (goto-char (point-max))
+ (or (re-search-backward pat nil t)
+ (progn
+ (goto-char old-pt)
+ (error "No cross references in this node")))))
+ (goto-char (match-beginning 0))
+ (if (looking-at "\\* Menu:")
+ (if recur
+ (error "No cross references in this node")
+ (Info-prev-reference t)))))
+
+(defun Info-index (topic)
+ "Look up a string in the index for this file.
+The index is defined as the first node in the top-level menu whose
+name contains the word \"Index\", plus any immediately following
+nodes whose names also contain the word \"Index\".
+If there are no exact matches to the specified topic, this chooses
+the first match which is a case-insensitive substring of a topic.
+Use the `,' command to see the other matches.
+Give a blank topic name to go to the Index node itself."
+ (interactive "sIndex topic: ")
+ (let ((orignode Info-current-node)
+ (rnode nil)
+ (pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*\\([^.\n]*\\)\\.[ \t]*\\([0-9]*\\)"
+ (regexp-quote topic)))
+ node)
+ (Info-goto-node "Top")
+ (or (search-forward "\n* menu:" nil t)
+ (error "No index"))
+ (or (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t)
+ (error "No index"))
+ (goto-char (match-beginning 1))
+ ;; Here, and subsequently in this function,
+ ;; we bind Info-history to nil for internal node-switches
+ ;; so that we don't put junk in the history.
+ ;; In the first Info-goto-node call, above, we do update the history
+ ;; because that is what the user's previous node choice into it.
+ (let ((Info-history nil))
+ (Info-goto-node (Info-extract-menu-node-name)))
+ (or (equal topic "")
+ (let ((matches nil)
+ (exact nil)
+ (Info-history nil)
+ found)
+ (while
+ (progn
+ (goto-char (point-min))
+ (while (re-search-forward pattern nil t)
+ (setq matches
+ (cons (list (buffer-substring (match-beginning 1)
+ (match-end 1))
+ (buffer-substring (match-beginning 2)
+ (match-end 2))
+ Info-current-node
+ (string-to-int (concat "0"
+ (buffer-substring
+ (match-beginning 3)
+ (match-end 3)))))
+ matches)))
+ (and (setq node (Info-extract-pointer "next" t))
+ (string-match "\\<Index\\>" node)))
+ (Info-goto-node node))
+ (or matches
+ (progn
+ (Info-goto-node orignode)
+ (error "No `%s' in index" topic)))
+ ;; Here it is a feature that assoc is case-sensitive.
+ (while (setq found (assoc topic matches))
+ (setq exact (cons found exact)
+ matches (delq found matches)))
+ (setq Info-index-alternatives (nconc exact (nreverse matches)))
+ (Info-index-next 0)))))
+
+(defun Info-index-next (num)
+ "Go to the next matching index item from the last `i' command."
+ (interactive "p")
+ (or Info-index-alternatives
+ (error "No previous `i' command in this file"))
+ (while (< num 0)
+ (setq num (+ num (length Info-index-alternatives))))
+ (while (> num 0)
+ (setq Info-index-alternatives
+ (nconc (cdr Info-index-alternatives)
+ (list (car Info-index-alternatives)))
+ num (1- num)))
+ (Info-goto-node (nth 1 (car Info-index-alternatives)))
+ (if (> (nth 3 (car Info-index-alternatives)) 0)
+ (forward-line (nth 3 (car Info-index-alternatives)))
+ (forward-line 3) ; don't search in headers
+ (let ((name (car (car Info-index-alternatives))))
+ (Info-find-index-name name)))
+ (message "Found `%s' in %s. %s"
+ (car (car Info-index-alternatives))
+ (nth 2 (car Info-index-alternatives))
+ (if (cdr Info-index-alternatives)
+ "(Press `,' for more)"
+ "(Only match)")))
+
+(defun Info-find-index-name (name)
+ "Move point to the place within the current node where NAME is defined."
+ (if (or (re-search-forward (format
+ "[a-zA-Z]+: %s\\( \\|$\\)"
+ (regexp-quote name)) nil t)
+ (search-forward (format "`%s'" name) nil t)
+ (and (string-match "\\`.*\\( (.*)\\)\\'" name)
+ (search-forward
+ (format "`%s'" (substring name 0 (match-beginning 1)))
+ nil t))
+ (search-forward name nil t))
+ (beginning-of-line)
+ (goto-char (point-min))))
+
+(defun Info-undefined ()
+ "Make command be undefined in Info."
+ (interactive)
+ (ding))
+
+(defun Info-help ()
+ "Enter the Info tutorial."
+ (interactive)
+ (delete-other-windows)
+ (Info-find-node "info"
+ (if (< (window-height) 23)
+ "Help-Small-Screen"
+ "Help")))
+
+(defun Info-summary ()
+ "Display a brief summary of all Info commands."
+ (interactive)
+ (save-window-excursion
+ (switch-to-buffer "*Help*")
+ (erase-buffer)
+ (insert (documentation 'Info-mode))
+ (help-mode)
+ (goto-char (point-min))
+ (let (ch flag)
+ (while (progn (setq flag (not (pos-visible-in-window-p (point-max))))
+ (message (if flag "Type Space to see more"
+ "Type Space to return to Info"))
+ (if (not (eq ?\ (setq ch (read-event))))
+ (progn (setq unread-command-events (list ch)) nil)
+ flag))
+ (scroll-up)))
+ (bury-buffer "*Help*")))
+
+(defun Info-get-token (pos start all &optional errorstring)
+ "Return the token around POS,
+POS must be somewhere inside the token
+START is a regular expression which will match the
+ beginning of the tokens delimited string
+ALL is a regular expression with a single
+ parenthesized subpattern which is the token to be
+ returned. E.g. '{\(.*\)}' would return any string
+ enclosed in braces around POS.
+SIG optional fourth argument, controls action on no match
+ nil: return nil
+ t: beep
+ a string: signal an error, using that string."
+ (save-excursion
+ (goto-char pos)
+ (re-search-backward start (max (point-min) (- pos 200)) 'yes)
+ (let (found)
+ (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes)
+ (not (setq found (and (<= (match-beginning 0) pos)
+ (> (match-end 0) pos))))))
+ (if (and found (<= (match-beginning 0) pos)
+ (> (match-end 0) pos))
+ (buffer-substring (match-beginning 1) (match-end 1))
+ (cond ((null errorstring)
+ nil)
+ ((eq errorstring t)
+ (beep)
+ nil)
+ (t
+ (error "No %s around position %d" errorstring pos)))))))
+
+(defun Info-mouse-follow-nearest-node (click)
+ "\\<Info-mode-map>Follow a node reference near point.
+Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where you click.
+At end of the node's text, moves to the next node, or up if none."
+ (interactive "e")
+ (let* ((start (event-start click))
+ (window (car start))
+ (pos (car (cdr start))))
+ (select-window window)
+ (goto-char pos))
+ (and (not (Info-try-follow-nearest-node))
+ (save-excursion (forward-line 1) (eobp))
+ (Info-next-preorder)))
+
+(defun Info-follow-nearest-node ()
+ "\\<Info-mode-map>Follow a node reference near point.
+Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where point is.
+If no reference to follow, moves to the next node, or up if none."
+ (interactive)
+ (or (Info-try-follow-nearest-node)
+ (Info-next-preorder)))
+
+;; Common subroutine.
+(defun Info-try-follow-nearest-node ()
+ "Follow a node reference near point. Return non-nil if successful."
+ (let (node)
+ (cond
+ ((setq node (Info-get-token (point) "\\*note[ \n]"
+ "\\*note[ \n]\\([^:]*\\):"))
+ (Info-follow-reference node))
+ ((setq node (Info-get-token (point) "\\* " "\\* \\([^:]*\\)::"))
+ (Info-goto-node node))
+ ((setq node (Info-get-token (point) "\\* " "\\* \\([^:]*\\):"))
+ (Info-menu node))
+ ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)"))
+ (Info-goto-node node))
+ ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)"))
+ (Info-goto-node node))
+ ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)"))
+ (Info-goto-node "Top"))
+ ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)"))
+ (Info-goto-node node)))
+ node))
+
+(defvar Info-mode-map nil
+ "Keymap containing Info commands.")
+(if Info-mode-map
+ nil
+ (setq Info-mode-map (make-keymap))
+ (suppress-keymap Info-mode-map)
+ (define-key Info-mode-map "." 'beginning-of-buffer)
+ (define-key Info-mode-map " " 'Info-scroll-up)
+ (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)
+ (define-key Info-mode-map "\t" 'Info-next-reference)
+ (define-key Info-mode-map "\e\t" 'Info-prev-reference)
+ (define-key Info-mode-map "1" 'Info-nth-menu-item)
+ (define-key Info-mode-map "2" 'Info-nth-menu-item)
+ (define-key Info-mode-map "3" 'Info-nth-menu-item)
+ (define-key Info-mode-map "4" 'Info-nth-menu-item)
+ (define-key Info-mode-map "5" 'Info-nth-menu-item)
+ (define-key Info-mode-map "6" 'Info-nth-menu-item)
+ (define-key Info-mode-map "7" 'Info-nth-menu-item)
+ (define-key Info-mode-map "8" 'Info-nth-menu-item)
+ (define-key Info-mode-map "9" 'Info-nth-menu-item)
+ (define-key Info-mode-map "0" 'undefined)
+ (define-key Info-mode-map "?" 'Info-summary)
+ (define-key Info-mode-map "]" 'Info-forward-node)
+ (define-key Info-mode-map "[" 'Info-backward-node)
+ (define-key Info-mode-map "<" 'Info-top-node)
+ (define-key Info-mode-map ">" 'Info-final-node)
+ (define-key Info-mode-map "b" 'beginning-of-buffer)
+ (define-key Info-mode-map "d" 'Info-directory)
+ (define-key Info-mode-map "e" 'Info-edit)
+ (define-key Info-mode-map "f" 'Info-follow-reference)
+ (define-key Info-mode-map "g" 'Info-goto-node)
+ (define-key Info-mode-map "h" 'Info-help)
+ (define-key Info-mode-map "i" 'Info-index)
+ (define-key Info-mode-map "l" 'Info-last)
+ (define-key Info-mode-map "m" 'Info-menu)
+ (define-key Info-mode-map "n" 'Info-next)
+ (define-key Info-mode-map "p" 'Info-prev)
+ (define-key Info-mode-map "q" 'Info-exit)
+ (define-key Info-mode-map "s" 'Info-search)
+ ;; For consistency with Rmail.
+ (define-key Info-mode-map "\M-s" 'Info-search)
+ (define-key Info-mode-map "t" 'Info-top-node)
+ (define-key Info-mode-map "u" 'Info-up)
+ (define-key Info-mode-map "," 'Info-index-next)
+ (define-key Info-mode-map "\177" 'Info-scroll-down)
+ (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
+ )
+
+;; Info mode is suitable only for specially formatted data.
+(put 'info-mode 'mode-class 'special)
+
+(defun Info-mode ()
+ "\\<Info-mode-map>
+Info mode provides commands for browsing through the Info documentation tree.
+Documentation in Info is divided into \"nodes\", each of which discusses
+one topic and contains references to other nodes which discuss related
+topics. Info has commands to follow the references and show you other nodes.
+
+\\[Info-help] Invoke the Info tutorial.
+
+Selecting other nodes:
+\\[Info-mouse-follow-nearest-node]
+ Follow a node reference you click on.
+ This works with menu items, cross references, and
+ the \"next\", \"previous\" and \"up\", depending on where you click.
+\\[Info-next] Move to the \"next\" node of this node.
+\\[Info-prev] Move to the \"previous\" node of this node.
+\\[Info-up] Move \"up\" from this node.
+\\[Info-menu] Pick menu item specified by name (or abbreviation).
+ Picking a menu item causes another node to be selected.
+\\[Info-directory] Go to the Info directory node.
+\\[Info-follow-reference] Follow a cross reference. Reads name of reference.
+\\[Info-last] Move to the last node you were at.
+\\[Info-index] Look up a topic in this file's Index and move to that node.
+\\[Info-index-next] (comma) Move to the next match from a previous `i' command.
+
+Moving within a node:
+\\[Info-scroll-up] Normally, scroll forward a full screen. If the end of the buffer is
+already visible, try to go to the next menu entry, or up if there is none.
+\\[Info-scroll-down] Normally, scroll backward. If the beginning of the buffer is
+already visible, try to go to the previous menu entry, or up if there is none.
+\\[beginning-of-buffer] Go to beginning of node.
+
+Advanced commands:
+\\[Info-exit] Quit Info: reselect previously selected buffer.
+\\[Info-edit] Edit contents of selected node.
+1 Pick first item in node's menu.
+2, 3, 4, 5 Pick second ... fifth item in node's menu.
+\\[Info-goto-node] Move to node specified by name.
+ You may include a filename as well, as (FILENAME)NODENAME.
+\\[universal-argument] \\[info] Move to new Info file with completion.
+\\[Info-search] Search through this Info file for specified regexp,
+ and select the node in which the next occurrence is found.
+\\[Info-next-reference] Move cursor to next cross-reference or menu item.
+\\[Info-prev-reference] Move cursor to previous cross-reference or menu item."
+ (kill-all-local-variables)
+ (setq major-mode 'Info-mode)
+ (setq mode-name "Info")
+ (use-local-map Info-mode-map)
+ (set-syntax-table text-mode-syntax-table)
+ (setq local-abbrev-table text-mode-abbrev-table)
+ (setq case-fold-search t)
+ (setq buffer-read-only t)
+ (make-local-variable 'Info-current-file)
+ (make-local-variable 'Info-current-subfile)
+ (make-local-variable 'Info-current-node)
+ (make-local-variable 'Info-tag-table-marker)
+ (make-local-variable 'Info-history)
+ (make-local-variable 'Info-index-alternatives)
+ (if (memq (framep (selected-frame)) '(x pc))
+ (progn
+ (make-face 'info-node)
+ (make-face 'info-menu-5)
+ (make-face 'info-xref)
+ (or (face-differs-from-default-p 'info-node)
+ (if (face-differs-from-default-p 'bold-italic)
+ (copy-face 'bold-italic 'info-node)
+ (copy-face 'bold 'info-node)))
+ (or (face-differs-from-default-p 'info-menu-5)
+ (set-face-underline-p 'info-menu-5 t))
+ (or (face-differs-from-default-p 'info-xref)
+ (copy-face 'bold 'info-xref)))
+ (setq Info-fontify nil))
+ (Info-set-mode-line)
+ (run-hooks 'Info-mode-hook))
+
+(defvar Info-edit-map nil
+ "Local keymap used within `e' command of Info.")
+(if Info-edit-map
+ nil
+ (setq Info-edit-map (nconc (make-sparse-keymap) text-mode-map))
+ (define-key Info-edit-map "\C-c\C-c" 'Info-cease-edit))
+
+;; Info-edit mode is suitable only for specially formatted data.
+(put 'info-edit-mode 'mode-class 'special)
+
+(defun Info-edit-mode ()
+ "Major mode for editing the contents of an Info node.
+Like text mode with the addition of `Info-cease-edit'
+which returns to Info mode for browsing.
+\\{Info-edit-map}"
+ (use-local-map Info-edit-map)
+ (setq major-mode 'Info-edit-mode)
+ (setq mode-name "Info Edit")
+ (kill-local-variable 'mode-line-buffer-identification)
+ (setq buffer-read-only nil)
+ (force-mode-line-update)
+ (buffer-enable-undo (current-buffer))
+ (run-hooks 'Info-edit-mode-hook))
+
+(defun Info-edit ()
+ "Edit the contents of this Info node.
+Allowed only if variable `Info-enable-edit' is non-nil."
+ (interactive)
+ (or Info-enable-edit
+ (error "Editing info nodes is not enabled"))
+ (Info-edit-mode)
+ (message "%s" (substitute-command-keys
+ "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
+
+(defun Info-cease-edit ()
+ "Finish editing Info node; switch back to Info proper."
+ (interactive)
+ ;; Do this first, so nothing has changed if user C-g's at query.
+ (and (buffer-modified-p)
+ (y-or-n-p "Save the file? ")
+ (save-buffer))
+ (use-local-map Info-mode-map)
+ (setq major-mode 'Info-mode)
+ (setq mode-name "Info")
+ (Info-set-mode-line)
+ (setq buffer-read-only t)
+ (force-mode-line-update)
+ (and (marker-position Info-tag-table-marker)
+ (buffer-modified-p)
+ (message "Tags may have changed. Use Info-tagify if necessary")))
+
+(defvar Info-file-list-for-emacs
+ '("ediff" "forms" "gnus" "info" ("mh" . "mh-e") "sc")
+ "List of Info files that describe Emacs commands.
+An element can be a file name, or a list of the form (PREFIX . FILE)
+where PREFIX is a name prefix and FILE is the file to look in.
+If the element is just a file name, the file name also serves as the prefix.")
+
+(defun Info-find-emacs-command-nodes (command)
+ "Return a list of locations documenting COMMAND.
+The `info-file' property of COMMAND says which Info manual to search.
+If COMMAND has no property, the variable `Info-file-list-for-emacs'
+defines heuristics for which Info manual to try.
+The locations are of the format used in Info-history, i.e.
+\(FILENAME NODENAME BUFFERPOS\)."
+ (let ((where '())
+ (cmd-desc (concat "^\\* " (regexp-quote (symbol-name command))
+ ":\\s *\\(.*\\)\\.$"))
+ (info-file "emacs")) ;default
+ ;; Determine which info file this command is documented in.
+ (if (get command 'info-file)
+ (setq info-file (get command 'info-file))
+ ;; If it doesn't say explicitly, test its name against
+ ;; various prefixes that we know.
+ (let ((file-list Info-file-list-for-emacs))
+ (while file-list
+ (let* ((elt (car file-list))
+ (name (if (consp elt)
+ (car elt)
+ elt))
+ (file (if (consp elt) (cdr elt) elt))
+ (regexp (concat "\\`" (regexp-quote name)
+ "\\(\\'\\|-\\)")))
+ (if (string-match regexp (symbol-name command))
+ (setq info-file file file-list nil))
+ (setq file-list (cdr file-list))))))
+ (save-excursion
+ (condition-case nil
+ (Info-find-node info-file "Command Index")
+ ;; Some manuals may not have a separate Command Index node,
+ ;; so try just Index instead.
+ (error
+ (Info-find-node info-file "Index")))
+ ;; Take the index node off the Info history.
+ (setq Info-history (cdr Info-history))
+ (goto-char (point-max))
+ (while (re-search-backward cmd-desc nil t)
+ (setq where (cons (list Info-current-file
+ (buffer-substring
+ (match-beginning 1)
+ (match-end 1))
+ 0)
+ where)))
+ where)))
+
+;;;###autoload
+(defun Info-goto-emacs-command-node (command)
+ "Go to the Info node in the Emacs manual for command COMMAND.
+The command is found by looking up in Emacs manual's Command Index
+or in another manual found via COMMAND's `info-file' property or
+the variable `Info-file-list-for-emacs'."
+ (interactive "CFind documentation for command: ")
+ (or (commandp command)
+ (signal 'wrong-type-argument (list 'commandp command)))
+ (let ((where (Info-find-emacs-command-nodes command)))
+ (if where
+ (let ((num-matches (length where)))
+ ;; Get Info running, and pop to it in another window.
+ (save-window-excursion
+ (info))
+ (pop-to-buffer "*info*")
+ (Info-find-node (car (car where))
+ (car (cdr (car where))))
+ (if (> num-matches 1)
+ (progn
+ ;; Info-find-node already pushed (car where) onto
+ ;; Info-history. Put the other nodes that were found on
+ ;; the history.
+ (setq Info-history (nconc (cdr where) Info-history))
+ (message "Found %d other entr%s. Use %s to see %s."
+ (1- num-matches)
+ (if (> num-matches 2) "ies" "y")
+ (substitute-command-keys "\\[Info-last]")
+ (if (> num-matches 2) "them" "it")))))
+ (error "Couldn't find documentation for %s" command))))
+
+;;;###autoload
+(defun Info-goto-emacs-key-command-node (key)
+ "Go to the Info node in the Emacs manual the command bound to KEY, a string.
+Interactively, if the binding is execute-extended-command, a command is read.
+The command is found by looking up in Emacs manual's Command Index
+or in another manual found via COMMAND's `info-file' property or
+the variable `Info-file-list-for-emacs'."
+ (interactive "kFind documentation for key:")
+ (let ((command (key-binding key)))
+ (cond ((null command)
+ (message "%s is undefined" (key-description key)))
+ ((and (interactive-p)
+ (eq command 'execute-extended-command))
+ (Info-goto-emacs-command-node
+ (read-command "Find documentation for command: ")))
+ (t
+ (Info-goto-emacs-command-node command)))))
+
+(defvar Info-title-face-alist
+ '((?* bold underline)
+ (?= bold-italic underline)
+ (?- italic underline))
+ "*Alist of face or list of faces to use for pseudo-underlined titles.
+The alist key is the character the title is underlined with (?*, ?= or ?-).")
+
+(defun Info-fontify-node ()
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (goto-char (point-min))
+ (if (looking-at "^File: [^,: \t]+,?[ \t]+")
+ (progn
+ (goto-char (match-end 0))
+ (while
+ (looking-at "[ \t]*[^:, \t\n]+:[ \t]+\\([^:,\t\n]+\\),?")
+ (goto-char (match-end 0))
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face 'info-xref)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'mouse-face 'highlight))))
+ (goto-char (point-min))
+ (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$"
+ nil t)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face
+ (cdr (assq (preceding-char) Info-title-face-alist)))
+ (put-text-property (match-end 1) (match-end 2)
+ 'invisible t))
+ (goto-char (point-min))
+ (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t)
+ (if (= (char-after (1- (match-beginning 0))) ?\") ; hack
+ nil
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face 'info-xref)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'mouse-face 'highlight)))
+ (goto-char (point-min))
+ (if (and (search-forward "\n* Menu:" nil t)
+ (not (string-match "\\<Index\\>" Info-current-node))
+ ;; Don't take time to annotate huge menus
+ (< (- (point-max) (point)) Info-fontify-maximum-menu-size))
+ (let ((n 0))
+ (while (re-search-forward "^\\* \\([^:\t\n]*\\):" nil t)
+ (setq n (1+ n))
+ (if (memq n '(5 9)) ; visual aids to help with 1-9 keys
+ (put-text-property (match-beginning 0)
+ (1+ (match-beginning 0))
+ 'face 'info-menu-5))
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face 'info-node)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'mouse-face 'highlight))))
+ (set-buffer-modified-p nil))))
+
+(provide 'info)
+
+;;; info.el ends here
diff --git a/contrib/texinfo/emacs/informat.el b/contrib/texinfo/emacs/informat.el
new file mode 100644
index 000000000000..0b195b9e620f
--- /dev/null
+++ b/contrib/texinfo/emacs/informat.el
@@ -0,0 +1,429 @@
+;;; informat.el --- info support functions package for Emacs
+
+;; Copyright (C) 1986 Free Software Foundation, Inc.
+
+;; Maintainer: FSF
+;; Keywords: help
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'info)
+
+;;;###autoload
+(defun Info-tagify ()
+ "Create or update Info-file tag table in current buffer."
+ (interactive)
+ ;; Save and restore point and restrictions.
+ ;; save-restrictions would not work
+ ;; because it records the old max relative to the end.
+ ;; We record it relative to the beginning.
+ (message "Tagifying %s ..." (file-name-nondirectory (buffer-file-name)))
+ (let ((omin (point-min))
+ (omax (point-max))
+ (nomax (= (point-max) (1+ (buffer-size))))
+ (opoint (point)))
+ (unwind-protect
+ (progn
+ (widen)
+ (goto-char (point-min))
+ (if (search-forward "\^_\nIndirect:\n" nil t)
+ (message "Cannot tagify split info file")
+ (let ((regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
+ (case-fold-search t)
+ list)
+ (while (search-forward "\n\^_" nil t)
+ ;; We want the 0-origin character position of the ^_.
+ ;; That is the same as the Emacs (1-origin) position
+ ;; of the newline before it.
+ (let ((beg (match-beginning 0)))
+ (forward-line 2)
+ (if (re-search-backward regexp beg t)
+ (setq list
+ (cons (list (buffer-substring-no-properties
+ (match-beginning 1)
+ (match-end 1))
+ beg)
+ list)))))
+ (goto-char (point-max))
+ (forward-line -8)
+ (let ((buffer-read-only nil))
+ (if (search-forward "\^_\nEnd tag table\n" nil t)
+ (let ((end (point)))
+ (search-backward "\nTag table:\n")
+ (beginning-of-line)
+ (delete-region (point) end)))
+ (goto-char (point-max))
+ (insert "\^_\f\nTag table:\n")
+ (move-marker Info-tag-table-marker (point))
+ (setq list (nreverse list))
+ (while list
+ (insert "Node: " (car (car list)) ?\177)
+ (princ (car (cdr (car list))) (current-buffer))
+ (insert ?\n)
+ (setq list (cdr list)))
+ (insert "\^_\nEnd tag table\n")))))
+ (goto-char opoint)
+ (narrow-to-region omin (if nomax (1+ (buffer-size))
+ (min omax (point-max))))))
+ (message "Tagifying %s ... done" (file-name-nondirectory (buffer-file-name))))
+
+;;;###autoload
+(defun Info-split ()
+ "Split an info file into an indirect file plus bounded-size subfiles.
+Each subfile will be up to 50,000 characters plus one node.
+
+To use this command, first visit a large Info file that has a tag
+table. The buffer is modified into a (small) indirect info file which
+should be saved in place of the original visited file.
+
+The subfiles are written in the same directory the original file is
+in, with names generated by appending `-' and a number to the original
+file name. The indirect file still functions as an Info file, but it
+contains just the tag table and a directory of subfiles."
+
+ (interactive)
+ (if (< (buffer-size) 70000)
+ (error "This is too small to be worth splitting"))
+ (goto-char (point-min))
+ (search-forward "\^_")
+ (forward-char -1)
+ (let ((start (point))
+ (chars-deleted 0)
+ subfiles
+ (subfile-number 1)
+ (case-fold-search t)
+ (filename (file-name-sans-versions buffer-file-name)))
+ (goto-char (point-max))
+ (forward-line -8)
+ (setq buffer-read-only nil)
+ (or (search-forward "\^_\nEnd tag table\n" nil t)
+ (error "Tag table required; use M-x Info-tagify"))
+ (search-backward "\nTag table:\n")
+ (if (looking-at "\nTag table:\n\^_")
+ (error "Tag table is just a skeleton; use M-x Info-tagify"))
+ (beginning-of-line)
+ (forward-char 1)
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (goto-char (point-min))
+ (while (< (1+ (point)) (point-max))
+ (goto-char (min (+ (point) 50000) (point-max)))
+ (search-forward "\^_" nil 'move)
+ (setq subfiles
+ (cons (list (+ start chars-deleted)
+ (concat (file-name-nondirectory filename)
+ (format "-%d" subfile-number)))
+ subfiles))
+ ;; Put a newline at end of split file, to make Unix happier.
+ (insert "\n")
+ (write-region (point-min) (point)
+ (concat filename (format "-%d" subfile-number)))
+ (delete-region (1- (point)) (point))
+ ;; Back up over the final ^_.
+ (forward-char -1)
+ (setq chars-deleted (+ chars-deleted (- (point) start)))
+ (delete-region start (point))
+ (setq subfile-number (1+ subfile-number))))
+ (while subfiles
+ (goto-char start)
+ (insert (nth 1 (car subfiles))
+ (format ": %d" (1- (car (car subfiles))))
+ "\n")
+ (setq subfiles (cdr subfiles)))
+ (goto-char start)
+ (insert "\^_\nIndirect:\n")
+ (search-forward "\nTag Table:\n")
+ (insert "(Indirect)\n")))
+
+;;;###autoload
+(defun Info-validate ()
+ "Check current buffer for validity as an Info file.
+Check that every node pointer points to an existing node."
+ (interactive)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (if (search-forward "\nTag table:\n(Indirect)\n" nil t)
+ (error "Don't yet know how to validate indirect info files: \"%s\""
+ (buffer-name (current-buffer))))
+ (goto-char (point-min))
+ (let ((allnodes '(("*")))
+ (regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
+ (case-fold-search t)
+ (tags-losing nil)
+ (lossages ()))
+ (while (search-forward "\n\^_" nil t)
+ (forward-line 1)
+ (let ((beg (point)))
+ (forward-line 1)
+ (if (re-search-backward regexp beg t)
+ (let ((name (downcase
+ (buffer-substring-no-properties
+ (match-beginning 1)
+ (progn
+ (goto-char (match-end 1))
+ (skip-chars-backward " \t")
+ (point))))))
+ (if (assoc name allnodes)
+ (setq lossages
+ (cons (list name "Duplicate node-name" nil)
+ lossages))
+ (setq allnodes
+ (cons (list name
+ (progn
+ (end-of-line)
+ (and (re-search-backward
+ "prev[ious]*:" beg t)
+ (progn
+ (goto-char (match-end 0))
+ (downcase
+ (Info-following-node-name)))))
+ beg)
+ allnodes)))))))
+ (goto-char (point-min))
+ (while (search-forward "\n\^_" nil t)
+ (forward-line 1)
+ (let ((beg (point))
+ thisnode next)
+ (forward-line 1)
+ (if (re-search-backward regexp beg t)
+ (save-restriction
+ (search-forward "\n\^_" nil 'move)
+ (narrow-to-region beg (point))
+ (setq thisnode (downcase
+ (buffer-substring-no-properties
+ (match-beginning 1)
+ (progn
+ (goto-char (match-end 1))
+ (skip-chars-backward " \t")
+ (point)))))
+ (end-of-line)
+ (and (search-backward "next:" nil t)
+ (setq next (Info-validate-node-name "invalid Next"))
+ (assoc next allnodes)
+ (if (equal (car (cdr (assoc next allnodes)))
+ thisnode)
+ ;; allow multiple `next' pointers to one node
+ (let ((tem lossages))
+ (while tem
+ (if (and (equal (car (cdr (car tem)))
+ "should have Previous")
+ (equal (car (car tem))
+ next))
+ (setq lossages (delq (car tem) lossages)))
+ (setq tem (cdr tem))))
+ (setq lossages
+ (cons (list next
+ "should have Previous"
+ thisnode)
+ lossages))))
+ (end-of-line)
+ (if (re-search-backward "prev[ious]*:" nil t)
+ (Info-validate-node-name "invalid Previous"))
+ (end-of-line)
+ (if (search-backward "up:" nil t)
+ (Info-validate-node-name "invalid Up"))
+ (if (re-search-forward "\n* Menu:" nil t)
+ (while (re-search-forward "\n\\* " nil t)
+ (Info-validate-node-name
+ (concat "invalid menu item "
+ (buffer-substring (point)
+ (save-excursion
+ (skip-chars-forward "^:")
+ (point))))
+ (Info-extract-menu-node-name))))
+ (goto-char (point-min))
+ (while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t)
+ (goto-char (+ (match-beginning 0) 5))
+ (skip-chars-forward " \n")
+ (Info-validate-node-name
+ (concat "invalid reference "
+ (buffer-substring (point)
+ (save-excursion
+ (skip-chars-forward "^:")
+ (point))))
+ (Info-extract-menu-node-name "Bad format cross-reference")))))))
+ (setq tags-losing (not (Info-validate-tags-table)))
+ (if (or lossages tags-losing)
+ (with-output-to-temp-buffer " *problems in info file*"
+ (while lossages
+ (princ "In node \"")
+ (princ (car (car lossages)))
+ (princ "\", ")
+ (let ((tem (nth 1 (car lossages))))
+ (cond ((string-match "\n" tem)
+ (princ (substring tem 0 (match-beginning 0)))
+ (princ "..."))
+ (t
+ (princ tem))))
+ (if (nth 2 (car lossages))
+ (progn
+ (princ ": ")
+ (let ((tem (nth 2 (car lossages))))
+ (cond ((string-match "\n" tem)
+ (princ (substring tem 0 (match-beginning 0)))
+ (princ "..."))
+ (t
+ (princ tem))))))
+ (terpri)
+ (setq lossages (cdr lossages)))
+ (if tags-losing (princ "\nTags table must be recomputed\n")))
+ ;; Here if info file is valid.
+ ;; If we already made a list of problems, clear it out.
+ (save-excursion
+ (if (get-buffer " *problems in info file*")
+ (progn
+ (set-buffer " *problems in info file*")
+ (kill-buffer (current-buffer)))))
+ (message "File appears valid"))))))
+
+(defun Info-validate-node-name (kind &optional name)
+ (if name
+ nil
+ (goto-char (match-end 0))
+ (skip-chars-forward " \t")
+ (if (= (following-char) ?\()
+ nil
+ (setq name
+ (buffer-substring-no-properties
+ (point)
+ (progn
+ (skip-chars-forward "^,\t\n")
+ (skip-chars-backward " ")
+ (point))))))
+ (if (null name)
+ nil
+ (setq name (downcase name))
+ (or (and (> (length name) 0) (= (aref name 0) ?\())
+ (assoc name allnodes)
+ (setq lossages
+ (cons (list thisnode kind name) lossages))))
+ name)
+
+(defun Info-validate-tags-table ()
+ (goto-char (point-min))
+ (if (not (search-forward "\^_\nEnd tag table\n" nil t))
+ t
+ (not (catch 'losing
+ (let* ((end (match-beginning 0))
+ (start (progn (search-backward "\nTag table:\n")
+ (1- (match-end 0))))
+ tem)
+ (setq tem allnodes)
+ (while tem
+ (goto-char start)
+ (or (equal (car (car tem)) "*")
+ (search-forward (concat "Node: "
+ (car (car tem))
+ "\177")
+ end t)
+ (throw 'losing 'x))
+ (setq tem (cdr tem)))
+ (goto-char (1+ start))
+ (while (looking-at ".*Node: \\(.*\\)\177\\([0-9]+\\)$")
+ (setq tem (downcase (buffer-substring-no-properties
+ (match-beginning 1)
+ (match-end 1))))
+ (setq tem (assoc tem allnodes))
+ (if (or (not tem)
+ (< 1000 (progn
+ (goto-char (match-beginning 2))
+ (setq tem (- (car (cdr (cdr tem)))
+ (read (current-buffer))))
+ (if (> tem 0) tem (- tem)))))
+ (throw 'losing 'y))
+ (forward-line 1)))
+ (if (looking-at "\^_\n")
+ (forward-line 1))
+ (or (looking-at "End tag table\n")
+ (throw 'losing 'z))
+ nil))))
+
+;;;###autoload
+(defun batch-info-validate ()
+ "Runs `Info-validate' on the files remaining on the command line.
+Must be used only with -batch, and kills Emacs on completion.
+Each file will be processed even if an error occurred previously.
+For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
+ (if (not noninteractive)
+ (error "batch-info-validate may only be used -batch."))
+ (let ((version-control t)
+ (auto-save-default nil)
+ (find-file-run-dired nil)
+ (kept-old-versions 259259)
+ (kept-new-versions 259259))
+ (let ((error 0)
+ file
+ (files ()))
+ (while command-line-args-left
+ (setq file (expand-file-name (car command-line-args-left)))
+ (cond ((not (file-exists-p file))
+ (message ">> %s does not exist!" file)
+ (setq error 1
+ command-line-args-left (cdr command-line-args-left)))
+ ((file-directory-p file)
+ (setq command-line-args-left (nconc (directory-files file)
+ (cdr command-line-args-left))))
+ (t
+ (setq files (cons file files)
+ command-line-args-left (cdr command-line-args-left)))))
+ (while files
+ (setq file (car files)
+ files (cdr files))
+ (let ((lose nil))
+ (condition-case err
+ (progn
+ (if buffer-file-name (kill-buffer (current-buffer)))
+ (find-file file)
+ (buffer-disable-undo (current-buffer))
+ (set-buffer-modified-p nil)
+ (fundamental-mode)
+ (let ((case-fold-search nil))
+ (goto-char (point-max))
+ (cond ((search-backward "\n\^_\^L\nTag table:\n" nil t)
+ (message "%s already tagified" file))
+ ((< (point-max) 30000)
+ (message "%s too small to bother tagifying" file))
+ (t
+ (Info-tagify))))
+ (let ((loss-name " *problems in info file*"))
+ (message "Checking validity of info file %s..." file)
+ (if (get-buffer loss-name)
+ (kill-buffer loss-name))
+ (Info-validate)
+ (if (not (get-buffer loss-name))
+ nil ;(message "Checking validity of info file %s... OK" file)
+ (message "----------------------------------------------------------------------")
+ (message ">> PROBLEMS IN INFO FILE %s" file)
+ (save-excursion
+ (set-buffer loss-name)
+ (princ (buffer-substring-no-properties
+ (point-min) (point-max))))
+ (message "----------------------------------------------------------------------")
+ (setq error 1 lose t)))
+ (if (and (buffer-modified-p)
+ (not lose))
+ (progn (message "Saving modified %s" file)
+ (save-buffer))))
+ (error (message ">> Error: %s" (prin1-to-string err))))))
+ (kill-emacs error))))
+
+;;; informat.el ends here
diff --git a/contrib/texinfo/emacs/makeinfo.el b/contrib/texinfo/emacs/makeinfo.el
new file mode 100644
index 000000000000..a649d522156c
--- /dev/null
+++ b/contrib/texinfo/emacs/makeinfo.el
@@ -0,0 +1,247 @@
+;;; makeinfo.el --- run makeinfo conveniently
+
+;; Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+;; Author: Robert J. Chassell
+;; Maintainer: FSF
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; The Texinfo mode `makeinfo' related commands are:
+
+;; makeinfo-region to run makeinfo on the current region.
+;; makeinfo-buffer to run makeinfo on the current buffer, or
+;; with optional prefix arg, on current region
+;; kill-compilation to kill currently running makeinfo job
+;; makeinfo-recenter-makeinfo-buffer to redisplay *compilation* buffer
+
+;;; Keybindings (defined in `texinfo.el')
+
+;; makeinfo bindings
+; (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
+; (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
+; (define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
+; (define-key texinfo-mode-map "\C-c\C-m\C-l"
+; 'makeinfo-recenter-compilation-buffer)
+
+;;; Code:
+
+;;; Variables used by `makeinfo'
+
+(require 'compile)
+
+(defvar makeinfo-run-command "makeinfo"
+ "*Command used to run `makeinfo' subjob.
+The name of the file is appended to this string, separated by a space.")
+
+(defvar makeinfo-options "--fill-column=70"
+ "*String containing options for running `makeinfo'.
+Do not include `--footnote-style' or `--paragraph-indent';
+the proper way to specify those is with the Texinfo commands
+`@footnotestyle` and `@paragraphindent'.")
+
+(require 'texinfo)
+
+(defvar makeinfo-compilation-process nil
+ "Process that runs `makeinfo'. Should start out nil.")
+
+(defvar makeinfo-temp-file nil
+ "Temporary file name used for text being sent as input to `makeinfo'.")
+
+(defvar makeinfo-output-file-name nil
+ "Info file name used for text output by `makeinfo'.")
+
+
+;;; The `makeinfo' function definitions
+
+(defun makeinfo-region (region-beginning region-end)
+ "Make Info file from region of current Texinfo file, and switch to it.
+
+This command does not offer the `next-error' feature since it would
+apply to a temporary file, not the original; use the `makeinfo-buffer'
+command to gain use of `next-error'."
+
+ (interactive "r")
+ (let (filename-or-header
+ filename-or-header-beginning
+ filename-or-header-end)
+ ;; Cannot use `let' for makeinfo-temp-file or
+ ;; makeinfo-output-file-name since `makeinfo-compilation-sentinel'
+ ;; needs them.
+
+ (setq makeinfo-temp-file
+ (concat
+ (make-temp-name
+ (substring (buffer-file-name)
+ 0
+ (or (string-match "\\.tex" (buffer-file-name))
+ (length (buffer-file-name)))))
+ ".texinfo"))
+
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (let ((search-end (save-excursion (forward-line 100) (point))))
+ ;; Find and record the Info filename,
+ ;; or else explain that a filename is needed.
+ (if (re-search-forward
+ "^@setfilename[ \t]+\\([^ \t\n]+\\)[ \t]*"
+ search-end t)
+ (setq makeinfo-output-file-name
+ (buffer-substring (match-beginning 1) (match-end 1)))
+ (error
+ "The texinfo file needs a line saying: @setfilename <name>"))
+
+ ;; Find header and specify its beginning and end.
+ (goto-char (point-min))
+ (if (and
+ (prog1
+ (search-forward tex-start-of-header search-end t)
+ (beginning-of-line)
+ ;; Mark beginning of header.
+ (setq filename-or-header-beginning (point)))
+ (prog1
+ (search-forward tex-end-of-header nil t)
+ (beginning-of-line)
+ ;; Mark end of header
+ (setq filename-or-header-end (point))))
+
+ ;; Insert the header into the temporary file.
+ (write-region
+ (min filename-or-header-beginning region-beginning)
+ filename-or-header-end
+ makeinfo-temp-file nil nil)
+
+ ;; Else no header; insert @filename line into temporary file.
+ (goto-char (point-min))
+ (search-forward "@setfilename" search-end t)
+ (beginning-of-line)
+ (setq filename-or-header-beginning (point))
+ (forward-line 1)
+ (setq filename-or-header-end (point))
+ (write-region
+ (min filename-or-header-beginning region-beginning)
+ filename-or-header-end
+ makeinfo-temp-file nil nil))
+
+ ;; Insert the region into the file.
+ (write-region
+ (max region-beginning filename-or-header-end)
+ region-end
+ makeinfo-temp-file t nil)
+
+ ;; Run the `makeinfo-compile' command in the *compilation* buffer
+ (save-excursion
+ (makeinfo-compile
+ (concat makeinfo-run-command
+ " "
+ makeinfo-options
+ " "
+ makeinfo-temp-file)
+ "Use `makeinfo-buffer' to gain use of the `next-error' command"
+ nil)))))))
+
+;;; Actually run makeinfo. COMMAND is the command to run.
+;;; ERROR-MESSAGE is what to say when next-error can't find another error.
+;;; If PARSE-ERRORS is non-nil, do try to parse error messages.
+(defun makeinfo-compile (command error-message parse-errors)
+ (let ((buffer
+ (compile-internal command error-message nil
+ (and (not parse-errors)
+ ;; If we do want to parse errors, pass nil.
+ ;; Otherwise, use this function, which won't
+ ;; ever find any errors.
+ '(lambda (&rest ignore)
+ (setq compilation-error-list nil))))))
+ (set-process-sentinel (get-buffer-process buffer)
+ 'makeinfo-compilation-sentinel)))
+
+;; Delete makeinfo-temp-file after processing is finished,
+;; and visit Info file.
+;; This function is called when the compilation process changes state.
+;; Based on `compilation-sentinel' in compile.el
+(defun makeinfo-compilation-sentinel (proc msg)
+ (compilation-sentinel proc msg)
+ (if (and makeinfo-temp-file (file-exists-p makeinfo-temp-file))
+ (delete-file makeinfo-temp-file))
+ ;; Always use the version on disk.
+ (if (get-file-buffer makeinfo-output-file-name)
+ (progn (set-buffer makeinfo-output-file-name)
+ (revert-buffer t t))
+ (find-file makeinfo-output-file-name))
+ (goto-char (point-min)))
+
+(defun makeinfo-buffer ()
+ "Make Info file from current buffer.
+
+Use the \\[next-error] command to move to the next error
+\(if there are errors\)."
+
+ (interactive)
+ (cond ((null buffer-file-name)
+ (error "Buffer not visiting any file"))
+ ((buffer-modified-p)
+ (if (y-or-n-p "Buffer modified; do you want to save it? ")
+ (save-buffer))))
+
+ ;; Find and record the Info filename,
+ ;; or else explain that a filename is needed.
+ (save-excursion
+ (goto-char (point-min))
+ (let ((search-end (save-excursion (forward-line 100) (point))))
+ (if (re-search-forward
+ "^@setfilename[ \t]+\\([^ \t\n]+\\)[ \t]*"
+ search-end t)
+ (setq makeinfo-output-file-name
+ (buffer-substring (match-beginning 1) (match-end 1)))
+ (error
+ "The texinfo file needs a line saying: @setfilename <name>"))))
+
+ (save-excursion
+ (makeinfo-compile
+ (concat makeinfo-run-command " " makeinfo-options
+ " " buffer-file-name)
+ "No more errors."
+ t)))
+
+(defun makeinfo-recenter-compilation-buffer (linenum)
+ "Redisplay `*compilation*' buffer so most recent output can be seen.
+The last line of the buffer is displayed on
+line LINE of the window, or centered if LINE is nil."
+ (interactive "P")
+ (let ((makeinfo-buffer (get-buffer "*compilation*"))
+ (old-buffer (current-buffer)))
+ (if (null makeinfo-buffer)
+ (message "No *compilation* buffer")
+ (pop-to-buffer makeinfo-buffer)
+ (bury-buffer makeinfo-buffer)
+ (goto-char (point-max))
+ (recenter (if linenum
+ (prefix-numeric-value linenum)
+ (/ (window-height) 2)))
+ (pop-to-buffer old-buffer)
+ )))
+
+;;; Place `provide' at end of file.
+(provide 'makeinfo)
+
+;;; makeinfo.el ends here
+
diff --git a/contrib/texinfo/emacs/new-useful-setqs b/contrib/texinfo/emacs/new-useful-setqs
new file mode 100644
index 000000000000..4241ae429efb
--- /dev/null
+++ b/contrib/texinfo/emacs/new-useful-setqs
@@ -0,0 +1,180 @@
+;; -*- Mode: Emacs-Lisp -*-
+
+;; This is the `new-useful-setqs' file
+;; This overrides old defvars since they were revised.
+
+(setq texinfmt-version "2.35 of 10 September 1996")
+
+(setq texinfo-master-menu-header
+ "\n@detailmenu\n --- The Detailed Node Listing ---\n")
+
+(setq texinfo-environment-regexp
+ (concat
+ "^@"
+ "\\("
+ "cartouche\\|"
+ "display\\|"
+ "end\\|"
+ "enumerate\\|"
+ "example\\|"
+ "f?table\\|"
+ "flushleft\\|"
+ "flushright\\|"
+ "format\\|"
+ "group\\|"
+ "ifhtml\\|"
+ "ifinfo\\|"
+ "iftex\\|"
+ "ignore\\|"
+ "itemize\\|"
+ "lisp\\|"
+ "macro\\|"
+ "multitable\\|"
+ "quotation\\|"
+ "smallexample\\|"
+ "smalllisp\\|"
+ "tex"
+ "\\)")
+)
+
+(setq texinfo-no-refill-regexp
+ (concat
+ "^@"
+ "\\("
+ "example\\|"
+ "smallexample\\|"
+ "lisp\\|"
+ "smalllisp\\|"
+ "display\\|"
+ "format\\|"
+ "flushleft\\|"
+ "flushright\\|"
+ "menu\\|"
+ "multitable\\|"
+ "titlepage\\|"
+ "iftex\\|"
+ "ifhtml\\|"
+ "tex\\|"
+ "html"
+ "\\)"))
+
+
+(setq texinfo-accent-commands
+ (concat
+ "@OE\\|"
+ "@oe\\|"
+ "@AA\\|"
+ "@aa\\|"
+ "@AE\\|"
+ "@ae\\|"
+ "@ss\\|"
+ "@^\\|"
+ "@`\\|"
+ "@'\\|"
+ "@\"\\|"
+ "@,\\|"
+ "@=\\|"
+ "@~\\|"
+ "@questiondown{\\|"
+ "@exclamdown{\\|"
+ "@L{\\|"
+ "@l{\\|"
+ "@O{\\|"
+ "@o{\\|"
+ "@dotaccent{\\|"
+ "@ubaraccent{\\|"
+ "@d{\\|"
+ "@H{\\|"
+ "@ringaccent{\\|"
+ "@tieaccent{\\|"
+ "@u{\\|"
+ "@v{\\|"
+ "@dotless{"
+ ))
+
+(setq texinfo-part-of-para-regexp
+ (concat
+ "^@"
+ "\\("
+ "b{\\|"
+ "bullet{\\|"
+ "cite{\\|"
+ "code{\\|"
+ "emph{\\|"
+ "equiv{\\|"
+ "error{\\|"
+ "expansion{\\|"
+ "file{\\|"
+ "i{\\|"
+ "inforef{\\|"
+ "kbd{\\|"
+ "key{\\|"
+ "lisp{\\|"
+ "email{\\|"
+ "minus{\\|"
+ "point{\\|"
+ "print{\\|"
+ "pxref{\\|"
+ "r{\\|"
+ "ref{\\|"
+ "result{\\|"
+ "samp{\\|"
+ "sc{\\|"
+ "t{\\|"
+ "TeX{\\|"
+ "today{\\|"
+ "url{\\|"
+ "var{\\|"
+ "w{\\|"
+ "xref{\\|"
+ "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop).
+ texinfo-accent-commands
+ "\\)"
+ ))
+
+(setq texinfo-raisesections-alist
+ '((@chapter . @chapter) ; Cannot go higher
+ (@unnumbered . @unnumbered)
+ (@centerchap . @unnumbered)
+
+ (@majorheading . @majorheading)
+ (@chapheading . @chapheading)
+ (@appendix . @appendix)
+
+ (@section . @chapter)
+ (@unnumberedsec . @unnumbered)
+ (@heading . @chapheading)
+ (@appendixsec . @appendix)
+
+ (@subsection . @section)
+ (@unnumberedsubsec . @unnumberedsec)
+ (@subheading . @heading)
+ (@appendixsubsec . @appendixsec)
+
+ (@subsubsection . @subsection)
+ (@unnumberedsubsubsec . @unnumberedsubsec)
+ (@subsubheading . @subheading)
+ (@appendixsubsubsec . @appendixsubsec)))
+
+(setq texinfo-lowersections-alist
+ '((@chapter . @section)
+ (@unnumbered . @unnumberedsec)
+ (@centerchap . @unnumberedsec)
+ (@majorheading . @heading)
+ (@chapheading . @heading)
+ (@appendix . @appendixsec)
+
+ (@section . @subsection)
+ (@unnumberedsec . @unnumberedsubsec)
+ (@heading . @subheading)
+ (@appendixsec . @appendixsubsec)
+
+ (@subsection . @subsubsection)
+ (@unnumberedsubsec . @unnumberedsubsubsec)
+ (@subheading . @subsubheading)
+ (@appendixsubsec . @appendixsubsubsec)
+
+ (@subsubsection . @subsubsection) ; Cannot go lower.
+ (@unnumberedsubsubsec . @unnumberedsubsubsec)
+ (@subsubheading . @subsubheading)
+ (@appendixsubsubsec . @appendixsubsubsec)))
diff --git a/contrib/texinfo/emacs/texinfmt.el b/contrib/texinfo/emacs/texinfmt.el
new file mode 100644
index 000000000000..c0d09635a8d4
--- /dev/null
+++ b/contrib/texinfo/emacs/texinfmt.el
@@ -0,0 +1,3979 @@
+;;; texinfmt.el --- format Texinfo files into Info files.
+
+;; Copyright (C) 1985, 1986, 1988, 1990, 1991,
+;; 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+
+;; Author: Robert J. Chassell
+;; Date: 10 Sep 1996
+;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
+;; Keywords: maint, tex, docs
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+;;; Emacs lisp functions to convert Texinfo files to Info files.
+
+(defvar texinfmt-version "2.35 of 10 September 1996")
+
+(defun texinfmt-version (&optional here)
+ "Show the version of texinfmt.el in the minibuffer.
+If optional argument HERE is non-nil, insert info at point."
+ (interactive "P")
+ (let ((version-string
+ (format "Version of \`texinfmt.el\': %s" texinfmt-version)))
+ (if here
+ (insert version-string)
+ (if (interactive-p)
+ (message "%s" version-string)
+ version-string))))
+
+
+;;; Variable definitions
+
+(require 'texinfo) ; So `texinfo-footnote-style' is defined.
+(require 'texnfo-upd) ; So `texinfo-section-types-regexp' is defined.
+
+(defvar texinfo-format-syntax-table nil)
+
+(defvar texinfo-vindex)
+(defvar texinfo-findex)
+(defvar texinfo-cindex)
+(defvar texinfo-pindex)
+(defvar texinfo-tindex)
+(defvar texinfo-kindex)
+(defvar texinfo-last-node)
+(defvar texinfo-node-names)
+(defvar texinfo-enclosure-list)
+(defvar texinfo-alias-list)
+
+(defvar texinfo-command-start)
+(defvar texinfo-command-end)
+(defvar texinfo-command-name)
+(defvar texinfo-defun-type)
+(defvar texinfo-last-node-pos)
+(defvar texinfo-stack)
+(defvar texinfo-short-index-cmds-alist)
+(defvar texinfo-short-index-format-cmds-alist)
+(defvar texinfo-format-filename)
+(defvar texinfo-footnote-number)
+(defvar texinfo-start-of-header)
+(defvar texinfo-end-of-header)
+(defvar texinfo-raisesections-alist)
+(defvar texinfo-lowersections-alist)
+
+;;; Syntax table
+
+(if texinfo-format-syntax-table
+ nil
+ (setq texinfo-format-syntax-table (make-syntax-table))
+ (modify-syntax-entry ?\" " " texinfo-format-syntax-table)
+ (modify-syntax-entry ?\\ " " texinfo-format-syntax-table)
+ (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table)
+ (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table)
+ (modify-syntax-entry ?\[ "." texinfo-format-syntax-table)
+ (modify-syntax-entry ?\] "." texinfo-format-syntax-table)
+ (modify-syntax-entry ?\( "." texinfo-format-syntax-table)
+ (modify-syntax-entry ?\) "." texinfo-format-syntax-table)
+ (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table)
+ (modify-syntax-entry ?} "){" texinfo-format-syntax-table)
+ (modify-syntax-entry ?\' "." texinfo-format-syntax-table))
+
+
+;;; Top level buffer and region formatting functions
+
+;;;###autoload
+(defun texinfo-format-buffer (&optional notagify)
+ "Process the current buffer as texinfo code, into an Info file.
+The Info file output is generated in a buffer visiting the Info file
+names specified in the @setfilename command.
+
+Non-nil argument (prefix, if interactive) means don't make tag table
+and don't split the file if large. You can use Info-tagify and
+Info-split to do these manually."
+ (interactive "P")
+ (let ((lastmessage "Formatting Info file..."))
+ (message lastmessage)
+ (texinfo-format-buffer-1)
+ (if notagify
+ nil
+ (if (> (buffer-size) 30000)
+ (progn
+ (message (setq lastmessage "Making tags table for Info file..."))
+ (Info-tagify)))
+ (if (> (buffer-size) 100000)
+ (progn
+ (message (setq lastmessage "Splitting Info file..."))
+ (Info-split))))
+ (message (concat lastmessage
+ (if (interactive-p) "done. Now save it." "done.")))))
+
+(defvar texinfo-region-buffer-name "*Info Region*"
+ "*Name of the temporary buffer used by \\[texinfo-format-region].")
+
+;;;###autoload
+(defun texinfo-format-region (region-beginning region-end)
+ "Convert the current region of the Texinfo file to Info format.
+This lets you see what that part of the file will look like in Info.
+The command is bound to \\[texinfo-format-region]. The text that is
+converted to Info is stored in a temporary buffer."
+ (interactive "r")
+ (message "Converting region to Info format...")
+ (let (texinfo-command-start
+ texinfo-command-end
+ texinfo-command-name
+ texinfo-vindex
+ texinfo-findex
+ texinfo-cindex
+ texinfo-pindex
+ texinfo-tindex
+ texinfo-kindex
+ texinfo-stack
+ (texinfo-format-filename "")
+ texinfo-example-start
+ texinfo-last-node-pos
+ texinfo-last-node
+ texinfo-node-names
+ (texinfo-footnote-number 0)
+ last-input-buffer
+ (fill-column-for-info fill-column)
+ (input-buffer (current-buffer))
+ (input-directory default-directory)
+ (header-text "")
+ (header-beginning 1)
+ (header-end 1))
+
+;;; Copy lines between beginning and end of header lines,
+;;; if any, or else copy the `@setfilename' line, if any.
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (let ((search-end (save-excursion (forward-line 100) (point))))
+ (if (or
+ ;; Either copy header text.
+ (and
+ (prog1
+ (search-forward tex-start-of-header search-end t)
+ (forward-line 1)
+ ;; Mark beginning of header.
+ (setq header-beginning (point)))
+ (prog1
+ (search-forward tex-end-of-header nil t)
+ (beginning-of-line)
+ ;; Mark end of header
+ (setq header-end (point))))
+ ;; Or copy @filename line.
+ (prog2
+ (goto-char (point-min))
+ (search-forward "@setfilename" search-end t)
+ (beginning-of-line)
+ (setq header-beginning (point))
+ (forward-line 1)
+ (setq header-end (point))))
+
+ ;; Copy header
+ (setq header-text
+ (buffer-substring
+ (min header-beginning region-beginning)
+ header-end))))))
+
+;;; Find a buffer to use.
+ (switch-to-buffer (get-buffer-create texinfo-region-buffer-name))
+ (erase-buffer)
+ ;; Insert the header into the buffer.
+ (insert header-text)
+ ;; Insert the region into the buffer.
+ (insert-buffer-substring
+ input-buffer
+ (max region-beginning header-end)
+ region-end)
+ ;; Make sure region ends in a newline.
+ (or (= (preceding-char) ?\n)
+ (insert "\n"))
+
+ (goto-char (point-min))
+ (texinfo-mode)
+ (message "Converting region to Info format...")
+ (setq fill-column fill-column-for-info)
+ ;; Install a syntax table useful for scanning command operands.
+ (set-syntax-table texinfo-format-syntax-table)
+
+ ;; Insert @include files so `texinfo-raise-lower-sections' can
+ ;; work on them without losing track of multiple
+ ;; @raise/@lowersections commands.
+ (while (re-search-forward "^@include" nil t)
+ (setq texinfo-command-end (point))
+ (let ((filename (concat input-directory
+ (texinfo-parse-line-arg))))
+ (re-search-backward "^@include")
+ (delete-region (point) (save-excursion (forward-line 1) (point)))
+ (message "Reading included file: %s" filename)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region
+ (point)
+ (+ (point) (car (cdr (insert-file-contents filename)))))
+ (goto-char (point-min))
+ ;; Remove `@setfilename' line from included file, if any,
+ ;; so @setfilename command not duplicated.
+ (if (re-search-forward
+ "^@setfilename" (save-excursion (forward-line 100) (point)) t)
+ (progn
+ (beginning-of-line)
+ (delete-region
+ (point) (save-excursion (forward-line 1) (point)))))))))
+
+ ;; Raise or lower level of each section, if necessary.
+ (goto-char (point-min))
+ (texinfo-raise-lower-sections)
+ ;; Append @refill to appropriate paragraphs for filling.
+ (goto-char (point-min))
+ (texinfo-append-refill)
+ ;; If the region includes the effective end of the data,
+ ;; discard everything after that.
+ (goto-char (point-max))
+ (if (re-search-backward "^@bye" nil t)
+ (delete-region (point) (point-max)))
+ ;; Make sure buffer ends in a newline.
+ (or (= (preceding-char) ?\n)
+ (insert "\n"))
+ ;; Don't use a previous value of texinfo-enclosure-list.
+ (setq texinfo-enclosure-list nil)
+ (setq texinfo-alias-list nil)
+
+ (goto-char (point-min))
+ (if (looking-at "\\\\input[ \t]+texinfo")
+ (delete-region (point) (save-excursion (forward-line 1) (point))))
+
+ ;; Insert Info region title text.
+ (goto-char (point-min))
+ (if (search-forward
+ "@setfilename" (save-excursion (forward-line 100) (point)) t)
+ (progn
+ (setq texinfo-command-end (point))
+ (beginning-of-line)
+ (setq texinfo-command-start (point))
+ (let ((arg (texinfo-parse-arg-discard)))
+ (insert " "
+ texinfo-region-buffer-name
+ " buffer for: `")
+ (insert (file-name-nondirectory (expand-file-name arg)))
+ (insert "', -*-Text-*-\n")))
+ ;; Else no `@setfilename' line
+ (insert " "
+ texinfo-region-buffer-name
+ " buffer -*-Text-*-\n"))
+ (insert "produced by `texinfo-format-region'\n"
+ "from a region in: "
+ (if (buffer-file-name input-buffer)
+ (concat "`"
+ (file-name-sans-versions
+ (file-name-nondirectory
+ (buffer-file-name input-buffer)))
+ "'")
+ (concat "buffer `" (buffer-name input-buffer) "'"))
+ "\nusing `texinfmt.el' version "
+ texinfmt-version
+ ".\n\n")
+
+ ;; Now convert for real.
+ (goto-char (point-min))
+ (texinfo-format-scan)
+ (goto-char (point-min))
+
+ (message "Done.")))
+
+
+;;; Primary internal formatting function for the whole buffer.
+
+(defun texinfo-format-buffer-1 ()
+ (let (texinfo-format-filename
+ texinfo-example-start
+ texinfo-command-start
+ texinfo-command-end
+ texinfo-command-name
+ texinfo-last-node
+ texinfo-last-node-pos
+ texinfo-vindex
+ texinfo-findex
+ texinfo-cindex
+ texinfo-pindex
+ texinfo-tindex
+ texinfo-kindex
+ texinfo-stack
+ texinfo-node-names
+ (texinfo-footnote-number 0)
+ last-input-buffer
+ outfile
+ (fill-column-for-info fill-column)
+ (input-buffer (current-buffer))
+ (input-directory default-directory))
+ (setq texinfo-enclosure-list nil)
+ (setq texinfo-alias-list nil)
+ (save-excursion
+ (goto-char (point-min))
+ (or (search-forward "@setfilename" nil t)
+ (error "Texinfo file needs an `@setfilename FILENAME' line."))
+ (setq texinfo-command-end (point))
+ (setq outfile (texinfo-parse-line-arg)))
+ (find-file outfile)
+ (texinfo-mode)
+ (setq fill-column fill-column-for-info)
+ (set-syntax-table texinfo-format-syntax-table)
+ (erase-buffer)
+ (insert-buffer-substring input-buffer)
+ (message "Converting %s to Info format..." (buffer-name input-buffer))
+
+ ;; Insert @include files so `texinfo-raise-lower-sections' can
+ ;; work on them without losing track of multiple
+ ;; @raise/@lowersections commands.
+ (goto-char (point-min))
+ (while (re-search-forward "^@include" nil t)
+ (setq texinfo-command-end (point))
+ (let ((filename (concat input-directory
+ (texinfo-parse-line-arg))))
+ (re-search-backward "^@include")
+ (delete-region (point) (save-excursion (forward-line 1) (point)))
+ (message "Reading included file: %s" filename)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region
+ (point)
+ (+ (point) (car (cdr (insert-file-contents filename)))))
+ (goto-char (point-min))
+ ;; Remove `@setfilename' line from included file, if any,
+ ;; so @setfilename command not duplicated.
+ (if (re-search-forward
+ "^@setfilename"
+ (save-excursion (forward-line 100) (point)) t)
+ (progn
+ (beginning-of-line)
+ (delete-region
+ (point) (save-excursion (forward-line 1) (point)))))))))
+ ;; Raise or lower level of each section, if necessary.
+ (goto-char (point-min))
+ (texinfo-raise-lower-sections)
+ ;; Append @refill to appropriate paragraphs
+ (goto-char (point-min))
+ (texinfo-append-refill)
+ (goto-char (point-min))
+ (search-forward "@setfilename")
+ (beginning-of-line)
+ (delete-region (point-min) (point))
+ ;; Remove @bye at end of file, if it is there.
+ (goto-char (point-max))
+ (if (search-backward "@bye" nil t)
+ (delete-region (point) (point-max)))
+ ;; Make sure buffer ends in a newline.
+ (or (= (preceding-char) ?\n)
+ (insert "\n"))
+ ;; Scan the whole buffer, converting to Info format.
+ (texinfo-format-scan)
+ ;; Return data for indices.
+ (goto-char (point-min))
+ (list outfile
+ texinfo-vindex texinfo-findex texinfo-cindex
+ texinfo-pindex texinfo-tindex texinfo-kindex)))
+
+
+;;; Perform non-@-command file conversions: quotes and hyphens
+
+(defun texinfo-format-convert (min max)
+ ;; Convert left and right quotes to typewriter font quotes.
+ (goto-char min)
+ (while (search-forward "``" max t)
+ (replace-match "\""))
+ (goto-char min)
+ (while (search-forward "''" max t)
+ (replace-match "\""))
+ ;; Convert three hyphens in a row to two.
+ (goto-char min)
+ (while (re-search-forward "\\( \\|\\w\\)\\(---\\)\\( \\|\\w\\)" max t)
+ (delete-region (1+ (match-beginning 2)) (+ 2 (match-beginning
+ 2)))))
+
+
+;;; Handle paragraph filling
+
+;; Keep as concatinated lists for ease of maintenance
+
+(defvar texinfo-no-refill-regexp
+ (concat
+ "^@"
+ "\\("
+ "example\\|"
+ "smallexample\\|"
+ "lisp\\|"
+ "smalllisp\\|"
+ "display\\|"
+ "format\\|"
+ "flushleft\\|"
+ "flushright\\|"
+ "menu\\|"
+ "multitable\\|"
+ "titlepage\\|"
+ "iftex\\|"
+ "ifhtml\\|"
+ "tex\\|"
+ "html"
+ "\\)")
+ "Regexp specifying environments in which paragraphs are not filled.")
+
+(defvar texinfo-accent-commands
+ (concat
+ "@^\\|"
+ "@`\\|"
+ "@'\\|"
+ "@\"\\|"
+ "@,\\|"
+ "@=\\|"
+ "@~\\|"
+ "@OE{\\|"
+ "@oe{\\|"
+ "@AA{\\|"
+ "@aa{\\|"
+ "@AE{\\|"
+ "@ae{\\|"
+ "@ss{\\|"
+ "@questiondown{\\|"
+ "@exclamdown{\\|"
+ "@L{\\|"
+ "@l{\\|"
+ "@O{\\|"
+ "@o{\\|"
+ "@dotaccent{\\|"
+ "@ubaraccent{\\|"
+ "@d{\\|"
+ "@H{\\|"
+ "@ringaccent{\\|"
+ "@tieaccent{\\|"
+ "@u{\\|"
+ "@v{\\|"
+ "@dotless{"
+ ))
+
+(defvar texinfo-part-of-para-regexp
+ (concat
+ "^@"
+ "\\("
+ "b{\\|"
+ "bullet{\\|"
+ "cite{\\|"
+ "code{\\|"
+ "emph{\\|"
+ "equiv{\\|"
+ "error{\\|"
+ "expansion{\\|"
+ "file{\\|"
+ "i{\\|"
+ "inforef{\\|"
+ "kbd{\\|"
+ "key{\\|"
+ "lisp{\\|"
+ "email{\\|"
+ "minus{\\|"
+ "point{\\|"
+ "print{\\|"
+ "pxref{\\|"
+ "r{\\|"
+ "ref{\\|"
+ "result{\\|"
+ "samp{\\|"
+ "sc{\\|"
+ "t{\\|"
+ "TeX{\\|"
+ "today{\\|"
+ "url{\\|"
+ "var{\\|"
+ "w{\\|"
+ "xref{\\|"
+ "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop).
+ texinfo-accent-commands
+ "\\)"
+ )
+ "Regexp specifying @-commands found within paragraphs.")
+
+(defun texinfo-append-refill ()
+ "Append @refill at end of each paragraph that should be filled.
+Do not append @refill to paragraphs within @example and similar environments.
+Do not append @refill to paragraphs containing @w{TEXT} or @*."
+
+ ;; It is necessary to append @refill before other processing because
+ ;; the other processing removes information that tells Texinfo
+ ;; whether the text should or should not be filled.
+
+ (while (< (point) (point-max))
+ (let ((refill-blank-lines "^[ \t\n]*$")
+ (case-fold-search nil)) ; Don't confuse @TeX and @tex....
+ (beginning-of-line)
+ ;; 1. Skip over blank lines;
+ ;; skip over lines beginning with @-commands,
+ ;; but do not skip over lines
+ ;; that are no-refill environments such as @example or
+ ;; that begin with within-paragraph @-commands such as @code.
+ (while (and (looking-at (concat "^@\\|^\\\\\\|" refill-blank-lines))
+ (not (looking-at
+ (concat
+ "\\("
+ texinfo-no-refill-regexp
+ "\\|"
+ texinfo-part-of-para-regexp
+ "\\)")))
+ (< (point) (point-max)))
+ (forward-line 1))
+ ;; 2. Skip over @example and similar no-refill environments.
+ (if (looking-at texinfo-no-refill-regexp)
+ (let ((environment
+ (buffer-substring (match-beginning 1) (match-end 1))))
+ (progn (re-search-forward (concat "^@end " environment) nil t)
+ (forward-line 1)))
+ ;; Else
+ ;; 3. Do not refill a paragraph containing @w or @*, or ending
+ ;; with @<newline> followed by a newline.
+ (if (or
+ (>= (point) (point-max))
+ (re-search-forward
+ "@w{\\|@\\*\\|@\n\n"
+ (save-excursion
+ (forward-paragraph)
+ (forward-line 1)
+ (point)) t))
+ ;; Go to end of paragraph and do nothing.
+ (forward-paragraph)
+ ;; 4. Else go to end of paragraph and insert @refill
+ (forward-paragraph)
+ (forward-line -1)
+ (end-of-line)
+ (delete-region
+ (point)
+ (save-excursion (skip-chars-backward " \t") (point)))
+ ;; `looking-at-backward' not available in v. 18.57
+ ;; (if (not (looking-at-backward "@refill\\|@bye")) ;)
+ (if (not (re-search-backward
+ "@refill\\|@bye"
+ (save-excursion (beginning-of-line) (point))
+ t))
+ (insert "@refill"))
+ (forward-line 1))))))
+
+
+;;; Handle `@raisesections' and `@lowersections' commands
+
+;; These commands change the hierarchical level of chapter structuring
+;; commands.
+;;
+;; @raisesections changes @subsection to @section,
+;; @section to @chapter,
+;; etc.
+;;
+;; @lowersections changes @chapter to @section
+;; @subsection to @subsubsection,
+;; etc.
+;;
+;; An @raisesections/@lowersections command changes only those
+;; structuring commands that follow the @raisesections/@lowersections
+;; command.
+;;
+;; Repeated @raisesections/@lowersections continue to raise or lower
+;; the heading level.
+;;
+;; An @lowersections command cancels an @raisesections command, and
+;; vice versa.
+;;
+;; You cannot raise or lower "beyond" chapters or subsubsections, but
+;; trying to do so does not elicit an error---you just get more
+;; headings that mean the same thing as you keep raising or lowering
+;; (for example, after a single @raisesections, both @chapter and
+;; @section produce chapter headings).
+
+(defun texinfo-raise-lower-sections ()
+ "Raise or lower the hierarchical level of chapters, sections, etc.
+
+This function acts according to `@raisesections' and `@lowersections'
+commands in the Texinfo file.
+
+For example, an `@lowersections' command is useful if you wish to
+include what is written as an outer or standalone Texinfo file in
+another Texinfo file as an inner, included file. The `@lowersections'
+command changes chapters to sections, sections to subsections and so
+on.
+
+@raisesections changes @subsection to @section,
+ @section to @chapter,
+ @heading to @chapheading,
+ etc.
+
+@lowersections changes @chapter to @section,
+ @subsection to @subsubsection,
+ @heading to @subheading,
+ etc.
+
+An `@raisesections' or `@lowersections' command changes only those
+structuring commands that follow the `@raisesections' or
+`@lowersections' command.
+
+An `@lowersections' command cancels an `@raisesections' command, and
+vice versa.
+
+Repeated use of the commands continue to raise or lower the hierarchical
+level a step at a time.
+
+An attempt to raise above `chapters' reproduces chapter commands; an
+attempt to lower below subsubsections reproduces subsubsection
+commands."
+
+ ;; `texinfo-section-types-regexp' is defined in `texnfo-upd.el';
+ ;; it is a regexp matching chapter, section, other headings
+ ;; (but not the top node).
+
+ (let (type (level 0))
+ (while
+ (re-search-forward
+ (concat
+ "\\(\\(^@\\(raise\\|lower\\)sections\\)\\|\\("
+ texinfo-section-types-regexp
+ "\\)\\)")
+ nil t)
+ (beginning-of-line)
+ (save-excursion (setq type (read (current-buffer))))
+ (cond
+
+ ;; 1. Increment level
+ ((eq type '@raisesections)
+ (setq level (1+ level))
+ (delete-region
+ (point) (save-excursion (forward-line 1) (point))))
+
+ ;; 2. Decrement level
+ ((eq type '@lowersections)
+ (setq level (1- level))
+ (delete-region
+ (point) (save-excursion (forward-line 1) (point))))
+
+ ;; Now handle structuring commands
+ ((cond
+
+ ;; 3. Raise level when positive
+ ((> level 0)
+ (let ((count level)
+ (new-level type))
+ (while (> count 0)
+ (setq new-level
+ (cdr (assq new-level texinfo-raisesections-alist)))
+ (setq count (1- count)))
+ (kill-word 1)
+ (insert (symbol-name new-level))))
+
+ ;; 4. Do nothing except move point when level is zero
+ ((= level 0) (forward-line 1))
+
+ ;; 5. Lower level when positive
+ ((< level 0)
+ (let ((count level)
+ (new-level type))
+ (while (< count 0)
+ (setq new-level
+ (cdr (assq new-level texinfo-lowersections-alist)))
+ (setq count (1+ count)))
+ (kill-word 1)
+ (insert (symbol-name new-level))))))))))
+
+(defvar texinfo-raisesections-alist
+ '((@chapter . @chapter) ; Cannot go higher
+ (@unnumbered . @unnumbered)
+ (@centerchap . @unnumbered)
+
+ (@majorheading . @majorheading)
+ (@chapheading . @chapheading)
+ (@appendix . @appendix)
+
+ (@section . @chapter)
+ (@unnumberedsec . @unnumbered)
+ (@heading . @chapheading)
+ (@appendixsec . @appendix)
+
+ (@subsection . @section)
+ (@unnumberedsubsec . @unnumberedsec)
+ (@subheading . @heading)
+ (@appendixsubsec . @appendixsec)
+
+ (@subsubsection . @subsection)
+ (@unnumberedsubsubsec . @unnumberedsubsec)
+ (@subsubheading . @subheading)
+ (@appendixsubsubsec . @appendixsubsec))
+ "*An alist of next higher levels for chapters, sections. etc.
+For example, section to chapter, subsection to section.
+Used by `texinfo-raise-lower-sections'.
+The keys specify types of section; the values correspond to the next
+higher types.")
+
+(defvar texinfo-lowersections-alist
+ '((@chapter . @section)
+ (@unnumbered . @unnumberedsec)
+ (@centerchap . @unnumberedsec)
+ (@majorheading . @heading)
+ (@chapheading . @heading)
+ (@appendix . @appendixsec)
+
+ (@section . @subsection)
+ (@unnumberedsec . @unnumberedsubsec)
+ (@heading . @subheading)
+ (@appendixsec . @appendixsubsec)
+
+ (@subsection . @subsubsection)
+ (@unnumberedsubsec . @unnumberedsubsubsec)
+ (@subheading . @subsubheading)
+ (@appendixsubsec . @appendixsubsubsec)
+
+ (@subsubsection . @subsubsection) ; Cannot go lower.
+ (@unnumberedsubsubsec . @unnumberedsubsubsec)
+ (@subsubheading . @subsubheading)
+ (@appendixsubsubsec . @appendixsubsubsec))
+ "*An alist of next lower levels for chapters, sections. etc.
+For example, chapter to section, section to subsection.
+Used by `texinfo-raise-lower-sections'.
+The keys specify types of section; the values correspond to the next
+lower types.")
+
+
+;;; Perform those texinfo-to-info conversions that apply to the whole input
+;;; uniformly.
+
+(defun texinfo-format-scan ()
+ (texinfo-format-convert (point-min) (point-max))
+ ;; Scan for @-commands.
+ (goto-char (point-min))
+ (while (search-forward "@" nil t)
+ ;;
+ ;; These are the single-character accent commands: @^ @` @' @" @= @~
+ ;; In Info, they are simply quoted and the @ deleted.
+ ;; Other single-character commands:
+ ;; @* forces a line break,
+ ;; @- is a discretionary hyphenation point; does nothing in Info.
+ ;; @<space>, @<tab>, @<newline> each produce a single space,
+ ;; unless followed by a newline.
+ ;;
+ ;; Old version 2.34 expression: (looking-at "[@{}^'` *\"?!]")
+ (if (looking-at "[@{}^'`\"=~ \t\n*?!-]")
+ ;; @*, causes a line break.
+ (cond
+ ;; @*, a line break
+ ((= (following-char) ?*)
+ ;; remove command
+ (delete-region (1- (point)) (1+ (point)))
+ ;; insert return if not at end of line;
+ ;; else line is already broken.
+ (if (not (= (following-char) ?\n))
+ (insert ?\n)))
+ ;; @-, deleted
+ ((= (following-char) ?-)
+ (delete-region (1- (point)) (1+ (point))))
+ ;; @<space>, @<tab>, @<newline>: produce a single space,
+ ;; unless followed by a newline.
+ ((= (following-char) ? )
+ (delete-region (1- (point)) (1+ (point)))
+ ;; insert single space if not at end of line;
+ ;; else line is already broken.
+ (if (not (= (following-char) ?\n))
+ (insert ? )))
+ ((= (following-char) ?\t)
+ (delete-region (1- (point)) (1+ (point)))
+ ;; insert single space if not at end of line;
+ ;; else line is already broken.
+ (if (not (= (following-char) ?\n))
+ (insert ? )))
+ ;; following char is a carriage return
+ ((= (following-char) ?
+)
+ ;; remove command
+ (delete-region (1- (point)) (1+ (point)))
+ ;; insert single space if not at end of line;
+ ;; else line is already broken.
+ (if (not (= (following-char) ?\n))
+ (insert ? )))
+ ;; Otherwise: the other characters are simply quoted. Delete the @.
+ (t
+ (delete-char -1)
+ (forward-char 1)))
+ ;; @ is followed by a command-word; find the end of the word.
+ (setq texinfo-command-start (1- (point)))
+ (if (= (char-syntax (following-char)) ?w)
+ (forward-word 1)
+ (forward-char 1))
+ (setq texinfo-command-end (point))
+ ;; Handle let aliasing
+ (setq texinfo-command-name
+ (let (trial
+ (cmdname
+ (buffer-substring
+ (1+ texinfo-command-start) texinfo-command-end)))
+ (while (setq trial (assoc cmdname texinfo-alias-list))
+ (setq cmdname (cdr trial)))
+ (intern cmdname)))
+ ;; Call the handler for this command.
+ (let ((enclosure-type
+ (assoc
+ (symbol-name texinfo-command-name)
+ texinfo-enclosure-list)))
+ (if enclosure-type
+ (progn
+ (insert
+ (car (car (cdr enclosure-type)))
+ (texinfo-parse-arg-discard)
+ (car (cdr (car (cdr enclosure-type)))))
+ (goto-char texinfo-command-start))
+ (let ((cmd (get texinfo-command-name 'texinfo-format)))
+ (if cmd (funcall cmd) (texinfo-unsupported)))))))
+
+ (cond (texinfo-stack
+ (goto-char (nth 2 (car texinfo-stack)))
+ (error "Unterminated @%s" (car (car texinfo-stack))))))
+
+(put 'begin 'texinfo-format 'texinfo-format-begin)
+(defun texinfo-format-begin ()
+ (texinfo-format-begin-end 'texinfo-format))
+
+(put 'end 'texinfo-format 'texinfo-format-end)
+(defun texinfo-format-end ()
+ (texinfo-format-begin-end 'texinfo-end))
+
+(defun texinfo-format-begin-end (prop)
+ (setq texinfo-command-name (intern (texinfo-parse-line-arg)))
+ (let ((cmd (get texinfo-command-name prop)))
+ (if cmd (funcall cmd)
+ (texinfo-unsupported))))
+
+;;; Parsing functions
+
+(defun texinfo-parse-line-arg ()
+ "Return argument of @-command as string.
+Argument is separated from command either by a space or by a brace.
+If a space, return rest of line, with beginning and ending white
+space removed. If a brace, return string between braces.
+Leave point after argument."
+ (goto-char texinfo-command-end)
+ (let ((start (point)))
+ (cond ((looking-at " ")
+ (skip-chars-forward " ")
+ (setq start (point))
+ (end-of-line)
+ (skip-chars-backward " ")
+ (delete-region (point) (progn (end-of-line) (point)))
+ (setq texinfo-command-end (1+ (point))))
+ ((looking-at "{")
+ (setq start (1+ (point)))
+ (forward-list 1)
+ (setq texinfo-command-end (point))
+ (forward-char -1))
+ (t
+ (error "Invalid texinfo command arg format")))
+ (prog1 (buffer-substring start (point))
+ (if (eolp) (forward-char 1)))))
+
+(defun texinfo-parse-expanded-arg ()
+ (goto-char texinfo-command-end)
+ (let ((start (point))
+ marker)
+ (cond ((looking-at " ")
+ (skip-chars-forward " ")
+ (setq start (point))
+ (end-of-line)
+ (setq texinfo-command-end (1+ (point))))
+ ((looking-at "{")
+ (setq start (1+ (point)))
+ (forward-list 1)
+ (setq texinfo-command-end (point))
+ (forward-char -1))
+ (t
+ (error "Invalid texinfo command arg format")))
+ (setq marker (move-marker (make-marker) texinfo-command-end))
+ (texinfo-format-expand-region start (point))
+ (setq texinfo-command-end (marker-position marker))
+ (move-marker marker nil)
+ (prog1 (buffer-substring start (point))
+ (if (eolp) (forward-char 1)))))
+
+(defun texinfo-format-expand-region (start end)
+ (save-restriction
+ (narrow-to-region start end)
+ (let (texinfo-command-start
+ texinfo-command-end
+ texinfo-command-name
+ texinfo-stack)
+ (texinfo-format-scan))
+ (goto-char (point-max))))
+
+(defun texinfo-parse-arg-discard ()
+ "Delete command and argument; return argument of command."
+ (prog1 (texinfo-parse-line-arg)
+ (texinfo-discard-command)))
+
+(defun texinfo-discard-command ()
+ (delete-region texinfo-command-start texinfo-command-end))
+
+(defun texinfo-optional-braces-discard ()
+ "Discard braces following command, if any."
+ (goto-char texinfo-command-end)
+ (let ((start (point)))
+ (cond ((looking-at "[ \t]*\n")) ; do nothing
+ ((looking-at "{") ; remove braces, if any
+ (forward-list 1)
+ (setq texinfo-command-end (point)))
+ (t
+ (error
+ "Invalid `texinfo-optional-braces-discard' format \(need braces?\)")))
+ (delete-region texinfo-command-start texinfo-command-end)))
+
+(defun texinfo-format-parse-line-args ()
+ (let ((start (1- (point)))
+ next beg end
+ args)
+ (skip-chars-forward " ")
+ (while (not (eolp))
+ (setq beg (point))
+ (re-search-forward "[\n,]")
+ (setq next (point))
+ (if (bolp) (setq next (1- next)))
+ (forward-char -1)
+ (skip-chars-backward " ")
+ (setq end (point))
+ (setq args (cons (if (> end beg) (buffer-substring beg end))
+ args))
+ (goto-char next)
+ (skip-chars-forward " "))
+ (if (eolp) (forward-char 1))
+ (setq texinfo-command-end (point))
+ (nreverse args)))
+
+(defun texinfo-format-parse-args ()
+ (let ((start (1- (point)))
+ next beg end
+ args)
+ (search-forward "{")
+ (save-excursion
+ (texinfo-format-expand-region
+ (point)
+ (save-excursion (up-list 1) (1- (point)))))
+ ;; The following does not handle cross references of the form:
+ ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the
+ ;; re-search-forward finds the first right brace after the second
+ ;; comma.
+ (while (/= (preceding-char) ?\})
+ (skip-chars-forward " \t\n")
+ (setq beg (point))
+ (re-search-forward "[},]")
+ (setq next (point))
+ (forward-char -1)
+ (skip-chars-backward " \t\n")
+ (setq end (point))
+ (cond ((< beg end)
+ (goto-char beg)
+ (while (search-forward "\n" end t)
+ (replace-match " "))))
+ (setq args (cons (if (> end beg) (buffer-substring beg end))
+ args))
+ (goto-char next))
+ (if (eolp) (forward-char 1))
+ (setq texinfo-command-end (point))
+ (nreverse args)))
+
+(defun texinfo-format-parse-defun-args ()
+ (goto-char texinfo-command-end)
+ (let ((start (point)))
+ (end-of-line)
+ (setq texinfo-command-end (1+ (point)))
+ (let ((marker (move-marker (make-marker) texinfo-command-end)))
+ (texinfo-format-expand-region start (point))
+ (setq texinfo-command-end (marker-position marker))
+ (move-marker marker nil))
+ (goto-char start)
+ (let ((args '())
+ beg end)
+ (skip-chars-forward " ")
+ (while (not (eolp))
+ (cond ((looking-at "{")
+ (setq beg (1+ (point)))
+ (forward-list 1)
+ (setq end (1- (point))))
+ (t
+ (setq beg (point))
+ (re-search-forward "[\n ]")
+ (forward-char -1)
+ (setq end (point))))
+ (setq args (cons (buffer-substring beg end) args))
+ (skip-chars-forward " "))
+ (forward-char 1)
+ (nreverse args))))
+
+(defun texinfo-discard-line ()
+ (goto-char texinfo-command-end)
+ (skip-chars-forward " \t")
+ (or (eolp)
+ (error "Extraneous text at end of command line."))
+ (goto-char texinfo-command-start)
+ (or (bolp)
+ (error "Extraneous text at beginning of command line."))
+ (delete-region (point) (progn (forward-line 1) (point))))
+
+(defun texinfo-discard-line-with-args ()
+ (goto-char texinfo-command-start)
+ (delete-region (point) (progn (forward-line 1) (point))))
+
+
+;;; @setfilename
+
+;; Only `texinfo-format-buffer' handles @setfilename with this
+;; definition; `texinfo-format-region' handles @setfilename, if any,
+;; specially.
+(put 'setfilename 'texinfo-format 'texinfo-format-setfilename)
+(defun texinfo-format-setfilename ()
+ (let ((arg (texinfo-parse-arg-discard)))
+ (message "Formatting Info file: %s" arg)
+ (setq texinfo-format-filename
+ (file-name-nondirectory (expand-file-name arg)))
+ (insert "Info file: "
+ texinfo-format-filename ", -*-Text-*-\n"
+ ;; Date string removed so that regression testing is easier.
+ ;; "produced on "
+ ;; (substring (current-time-string) 8 10) " "
+ ;; (substring (current-time-string) 4 7) " "
+ ;; (substring (current-time-string) -4) " "
+ "produced by `texinfo-format-buffer'\n"
+ "from file"
+ (if (buffer-file-name input-buffer)
+ (concat " `"
+ (file-name-sans-versions
+ (file-name-nondirectory
+ (buffer-file-name input-buffer)))
+ "'")
+ (concat "buffer `" (buffer-name input-buffer) "'"))
+ "\nusing `texinfmt.el' version "
+ texinfmt-version
+ ".\n\n")))
+
+;;; @node, @menu, @detailmenu
+
+(put 'node 'texinfo-format 'texinfo-format-node)
+(put 'nwnode 'texinfo-format 'texinfo-format-node)
+(defun texinfo-format-node ()
+ (let* ((args (texinfo-format-parse-line-args))
+ (name (nth 0 args))
+ (next (nth 1 args))
+ (prev (nth 2 args))
+ (up (nth 3 args)))
+ (texinfo-discard-command)
+ (setq texinfo-last-node name)
+ (let ((tem (downcase name)))
+ (if (assoc tem texinfo-node-names)
+ (error "Duplicate node name: %s" name)
+ (setq texinfo-node-names (cons (list tem) texinfo-node-names))))
+ (setq texinfo-footnote-number 0)
+ ;; insert "\n\^_" unconditionally since this is what info is looking for
+ (insert "\n\^_\nFile: " texinfo-format-filename
+ ", Node: " name)
+ (if next
+ (insert ", Next: " next))
+ (if prev
+ (insert ", Prev: " prev))
+ (if up
+ (insert ", Up: " up))
+ (insert ?\n)
+ (setq texinfo-last-node-pos (point))))
+
+(put 'menu 'texinfo-format 'texinfo-format-menu)
+(defun texinfo-format-menu ()
+ (texinfo-discard-line)
+ (insert "* Menu:\n\n"))
+
+(put 'menu 'texinfo-end 'texinfo-discard-command)
+
+;; The @detailmenu should be removed eventually.
+
+;; According to Karl Berry, 31 August 1996:
+;;
+;; You don't like, I don't like it. I agree, it would be better just to
+;; fix the bug [in `makeinfo']. .. At this point, since inserting those
+;; two commands in the Elisp fn is trivial, I don't especially want to
+;; expend more effort...
+;;
+;; I added a couple sentences of documentation to the manual (putting the
+;; blame on makeinfo where it belongs :-().
+
+(put 'detailmenu 'texinfo-format 'texinfo-discard-line)
+(put 'detailmenu 'texinfo-end 'texinfo-discard-command)
+
+;; (Also see `texnfo-upd.el')
+
+
+;;; Cross references
+
+;; @xref {NODE, FNAME, NAME, FILE, DOCUMENT}
+;; -> *Note FNAME: (FILE)NODE
+;; If FILE is missing,
+;; *Note FNAME: NODE
+;; If FNAME is empty and NAME is present
+;; *Note NAME: Node
+;; If both NAME and FNAME are missing
+;; *Note NODE::
+;; texinfo ignores the DOCUMENT argument.
+;; -> See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
+;; If FILE is specified, (FILE)NODE is used for xrefs.
+;; If fifth argument DOCUMENT is specified, produces
+;; See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
+;; of DOCUMENT
+
+;; @ref a reference that does not put `See' or `see' in
+;; the hardcopy and is the same as @xref in Info
+(put 'ref 'texinfo-format 'texinfo-format-xref)
+
+(put 'xref 'texinfo-format 'texinfo-format-xref)
+(defun texinfo-format-xref ()
+ (let ((args (texinfo-format-parse-args)))
+ (texinfo-discard-command)
+ (insert "*Note ")
+ (let ((fname (or (nth 1 args) (nth 2 args))))
+ (if (null (or fname (nth 3 args)))
+ (insert (car args) "::")
+ (insert (or fname (car args)) ": ")
+ (if (nth 3 args)
+ (insert "(" (nth 3 args) ")"))
+ (insert (car args))))))
+
+(put 'pxref 'texinfo-format 'texinfo-format-pxref)
+(defun texinfo-format-pxref ()
+ (texinfo-format-xref)
+ (or (save-excursion
+ (forward-char -2)
+ (looking-at "::"))
+ (insert ".")))
+
+;; @inforef{NODE, FNAME, FILE}
+;; Like @xref{NODE, FNAME,,FILE} in texinfo.
+;; In Tex, generates "See Info file FILE, node NODE"
+(put 'inforef 'texinfo-format 'texinfo-format-inforef)
+(defun texinfo-format-inforef ()
+ (let ((args (texinfo-format-parse-args)))
+ (texinfo-discard-command)
+ (if (nth 1 args)
+ (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args))
+ (insert "*Note " "(" (nth 2 args) ")" (car args) "::"))))
+
+
+;;; Section headings
+
+(put 'majorheading 'texinfo-format 'texinfo-format-chapter)
+(put 'chapheading 'texinfo-format 'texinfo-format-chapter)
+(put 'ichapter 'texinfo-format 'texinfo-format-chapter)
+(put 'chapter 'texinfo-format 'texinfo-format-chapter)
+(put 'iappendix 'texinfo-format 'texinfo-format-chapter)
+(put 'appendix 'texinfo-format 'texinfo-format-chapter)
+(put 'iunnumbered 'texinfo-format 'texinfo-format-chapter)
+(put 'top 'texinfo-format 'texinfo-format-chapter)
+(put 'unnumbered 'texinfo-format 'texinfo-format-chapter)
+(put 'centerchap 'texinfo-format 'texinfo-format-chapter)
+(defun texinfo-format-chapter ()
+ (texinfo-format-chapter-1 ?*))
+
+(put 'heading 'texinfo-format 'texinfo-format-section)
+(put 'isection 'texinfo-format 'texinfo-format-section)
+(put 'section 'texinfo-format 'texinfo-format-section)
+(put 'iappendixsection 'texinfo-format 'texinfo-format-section)
+(put 'appendixsection 'texinfo-format 'texinfo-format-section)
+(put 'iappendixsec 'texinfo-format 'texinfo-format-section)
+(put 'appendixsec 'texinfo-format 'texinfo-format-section)
+(put 'iunnumberedsec 'texinfo-format 'texinfo-format-section)
+(put 'unnumberedsec 'texinfo-format 'texinfo-format-section)
+(defun texinfo-format-section ()
+ (texinfo-format-chapter-1 ?=))
+
+(put 'subheading 'texinfo-format 'texinfo-format-subsection)
+(put 'isubsection 'texinfo-format 'texinfo-format-subsection)
+(put 'subsection 'texinfo-format 'texinfo-format-subsection)
+(put 'iappendixsubsec 'texinfo-format 'texinfo-format-subsection)
+(put 'appendixsubsec 'texinfo-format 'texinfo-format-subsection)
+(put 'iunnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
+(put 'unnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
+(defun texinfo-format-subsection ()
+ (texinfo-format-chapter-1 ?-))
+
+(put 'subsubheading 'texinfo-format 'texinfo-format-subsubsection)
+(put 'isubsubsection 'texinfo-format 'texinfo-format-subsubsection)
+(put 'subsubsection 'texinfo-format 'texinfo-format-subsubsection)
+(put 'iappendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
+(put 'appendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
+(put 'iunnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
+(put 'unnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
+(defun texinfo-format-subsubsection ()
+ (texinfo-format-chapter-1 ?.))
+
+(defun texinfo-format-chapter-1 (belowchar)
+ (let ((arg (texinfo-parse-arg-discard)))
+ (message "Formatting: %s ... " arg) ; So we can see where we are.
+ (insert ?\n arg ?\n "@SectionPAD " belowchar ?\n)
+ (forward-line -2)))
+
+(put 'SectionPAD 'texinfo-format 'texinfo-format-sectionpad)
+(defun texinfo-format-sectionpad ()
+ (let ((str (texinfo-parse-arg-discard)))
+ (forward-char -1)
+ (let ((column (current-column)))
+ (forward-char 1)
+ (while (> column 0)
+ (insert str)
+ (setq column (1- column))))
+ (insert ?\n)))
+
+
+;;; Space controlling commands: @. and @:, and the soft hyphen.
+
+(put '\. 'texinfo-format 'texinfo-format-\.)
+(defun texinfo-format-\. ()
+ (texinfo-discard-command)
+ (insert "."))
+
+(put '\: 'texinfo-format 'texinfo-format-\:)
+(defun texinfo-format-\: ()
+ (texinfo-discard-command))
+
+(put '\- 'texinfo-format 'texinfo-format-soft-hyphen)
+(defun texinfo-format-soft-hyphen ()
+ (texinfo-discard-command))
+
+
+;;; @center, @sp, and @br
+
+(put 'center 'texinfo-format 'texinfo-format-center)
+(defun texinfo-format-center ()
+ (let ((arg (texinfo-parse-expanded-arg)))
+ (texinfo-discard-command)
+ (insert arg)
+ (insert ?\n)
+ (save-restriction
+ (goto-char (1- (point)))
+ (let ((indent-tabs-mode nil))
+ (center-line)))))
+
+(put 'sp 'texinfo-format 'texinfo-format-sp)
+(defun texinfo-format-sp ()
+ (let* ((arg (texinfo-parse-arg-discard))
+ (num (read arg)))
+ (insert-char ?\n num)))
+
+(put 'br 'texinfo-format 'texinfo-format-paragraph-break)
+(defun texinfo-format-paragraph-break ()
+ "Force a paragraph break.
+If used within a line, follow `@br' with braces."
+ (texinfo-optional-braces-discard)
+ ;; insert one return if at end of line;
+ ;; else insert two returns, to generate a blank line.
+ (if (= (following-char) ?\n)
+ (insert ?\n)
+ (insert-char ?\n 2)))
+
+
+;;; @footnote and @footnotestyle
+
+;; In Texinfo, footnotes are created with the `@footnote' command.
+;; This command is followed immediately by a left brace, then by the text of
+;; the footnote, and then by a terminating right brace. The
+;; template for a footnote is:
+;;
+;; @footnote{TEXT}
+;;
+;; Info has two footnote styles:
+;;
+;; * In the End of node style, all the footnotes for a single node
+;; are placed at the end of that node. The footnotes are
+;; separated from the rest of the node by a line of dashes with
+;; the word `Footnotes' within it.
+;;
+;; * In the Separate node style, all the footnotes for a single node
+;; are placed in an automatically constructed node of their own.
+
+;; Footnote style is specified by the @footnotestyle command, either
+;; @footnotestyle separate
+;; or
+;; @footnotestyle end
+;;
+;; The default is separate
+
+(defvar texinfo-footnote-style "separate"
+ "Footnote style, either separate or end.")
+
+(put 'footnotestyle 'texinfo-format 'texinfo-footnotestyle)
+(defun texinfo-footnotestyle ()
+ "Specify whether footnotes are at end of node or in separate nodes.
+Argument is either end or separate."
+ (setq texinfo-footnote-style (texinfo-parse-arg-discard)))
+
+(defvar texinfo-footnote-number)
+
+(put 'footnote 'texinfo-format 'texinfo-format-footnote)
+(defun texinfo-format-footnote ()
+ "Format a footnote in either end of node or separate node style.
+The texinfo-footnote-style variable controls which style is used."
+ (setq texinfo-footnote-number (1+ texinfo-footnote-number))
+ (cond ((string= texinfo-footnote-style "end")
+ (texinfo-format-end-node))
+ ((string= texinfo-footnote-style "separate")
+ (texinfo-format-separate-node))))
+
+(defun texinfo-format-separate-node ()
+ "Format footnote in Separate node style, with notes in own node.
+The node is constructed automatically."
+ (let* (start
+ (arg (texinfo-parse-line-arg))
+ (node-name-beginning
+ (save-excursion
+ (re-search-backward
+ "^File: \\w+\\(\\w\\|\\s_\\|\\.\\|,\\)*[ \t]+Node:")
+ (match-end 0)))
+ (node-name
+ (save-excursion
+ (buffer-substring
+ (progn (goto-char node-name-beginning) ; skip over node command
+ (skip-chars-forward " \t") ; and over spaces
+ (point))
+ (if (search-forward
+ ","
+ (save-excursion (end-of-line) (point)) t) ; bound search
+ (1- (point))
+ (end-of-line) (point))))))
+ (texinfo-discard-command) ; remove or insert whitespace, as needed
+ (delete-region (save-excursion (skip-chars-backward " \t\n") (point))
+ (point))
+ (insert (format " (%d) (*Note %s-Footnotes::)"
+ texinfo-footnote-number node-name))
+ (fill-paragraph nil)
+ (save-excursion
+ (if (re-search-forward "^@node" nil 'move)
+ (forward-line -1))
+
+ ;; two cases: for the first footnote, we must insert a node header;
+ ;; for the second and subsequent footnotes, we need only insert
+ ;; the text of the footnote.
+
+ (if (save-excursion
+ (re-search-backward
+ (concat node-name "-Footnotes, Up: ")
+ node-name-beginning
+ t))
+ (progn ; already at least one footnote
+ (setq start (point))
+ (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
+ (fill-region start (point)))
+ ;; else not yet a footnote
+ (insert "\n\^_\nFile: " texinfo-format-filename
+ " Node: " node-name "-Footnotes, Up: " node-name "\n")
+ (setq start (point))
+ (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
+ (fill-region start (point))))))
+
+(defun texinfo-format-end-node ()
+ "Format footnote in the End of node style, with notes at end of node."
+ (let (start
+ (arg (texinfo-parse-line-arg)))
+ (texinfo-discard-command) ; remove or insert whitespace, as needed
+ (delete-region (save-excursion (skip-chars-backward " \t\n") (point))
+ (point))
+ (insert (format " (%d) " texinfo-footnote-number))
+ (fill-paragraph nil)
+ (save-excursion
+ (if (search-forward "\n--------- Footnotes ---------\n" nil t)
+ (progn ; already have footnote, put new one before end of node
+ (if (re-search-forward "^@node" nil 'move)
+ (forward-line -1))
+ (setq start (point))
+ (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
+ (fill-region start (point)))
+ ;; else no prior footnote
+ (if (re-search-forward "^@node" nil 'move)
+ (forward-line -1))
+ (insert "\n--------- Footnotes ---------\n")
+ (setq start (point))
+ (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))))))
+
+
+;;; @itemize, @enumerate, and similar commands
+
+;; @itemize pushes (itemize "COMMANDS" STARTPOS) on texinfo-stack.
+;; @enumerate pushes (enumerate 0 STARTPOS).
+;; @item dispatches to the texinfo-item prop of the first elt of the list.
+;; For itemize, this puts in and rescans the COMMANDS.
+;; For enumerate, this increments the number and puts it in.
+;; In either case, it puts a Backspace at the front of the line
+;; which marks it not to be indented later.
+;; All other lines get indented by 5 when the @end is reached.
+
+(defvar texinfo-stack-depth 0
+ "Count of number of unpopped texinfo-push-stack calls.
+Used by @refill indenting command to avoid indenting within lists, etc.")
+
+(defun texinfo-push-stack (check arg)
+ (setq texinfo-stack-depth (1+ texinfo-stack-depth))
+ (setq texinfo-stack
+ (cons (list check arg texinfo-command-start)
+ texinfo-stack)))
+
+(defun texinfo-pop-stack (check)
+ (setq texinfo-stack-depth (1- texinfo-stack-depth))
+ (if (null texinfo-stack)
+ (error "Unmatched @end %s" check))
+ (if (not (eq (car (car texinfo-stack)) check))
+ (error "@end %s matches @%s"
+ check (car (car texinfo-stack))))
+ (prog1 (cdr (car texinfo-stack))
+ (setq texinfo-stack (cdr texinfo-stack))))
+
+(put 'itemize 'texinfo-format 'texinfo-itemize)
+(defun texinfo-itemize ()
+ (texinfo-push-stack
+ 'itemize
+ (progn (skip-chars-forward " \t")
+ (if (eolp)
+ "@bullet"
+ (texinfo-parse-line-arg))))
+ (texinfo-discard-line-with-args)
+ (setq fill-column (- fill-column 5)))
+
+(put 'itemize 'texinfo-end 'texinfo-end-itemize)
+(defun texinfo-end-itemize ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'itemize)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+(put 'enumerate 'texinfo-format 'texinfo-enumerate)
+(defun texinfo-enumerate ()
+ (texinfo-push-stack
+ 'enumerate
+ (progn (skip-chars-forward " \t")
+ (if (eolp)
+ 1
+ (read (current-buffer)))))
+ (if (and (symbolp (car (cdr (car texinfo-stack))))
+ (> 1 (length (symbol-name (car (cdr (car texinfo-stack)))))))
+ (error
+ "@enumerate: Use a number or letter, eg: 1, A, a, 3, B, or d." ))
+ (texinfo-discard-line-with-args)
+ (setq fill-column (- fill-column 5)))
+
+(put 'enumerate 'texinfo-end 'texinfo-end-enumerate)
+(defun texinfo-end-enumerate ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'enumerate)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+;; @alphaenumerate never became a standard part of Texinfo
+(put 'alphaenumerate 'texinfo-format 'texinfo-alphaenumerate)
+(defun texinfo-alphaenumerate ()
+ (texinfo-push-stack 'alphaenumerate (1- ?a))
+ (setq fill-column (- fill-column 5))
+ (texinfo-discard-line))
+
+(put 'alphaenumerate 'texinfo-end 'texinfo-end-alphaenumerate)
+(defun texinfo-end-alphaenumerate ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'alphaenumerate)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+;; @capsenumerate never became a standard part of Texinfo
+(put 'capsenumerate 'texinfo-format 'texinfo-capsenumerate)
+(defun texinfo-capsenumerate ()
+ (texinfo-push-stack 'capsenumerate (1- ?A))
+ (setq fill-column (- fill-column 5))
+ (texinfo-discard-line))
+
+(put 'capsenumerate 'texinfo-end 'texinfo-end-capsenumerate)
+(defun texinfo-end-capsenumerate ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'capsenumerate)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+;; At the @end, indent all the lines within the construct
+;; except those marked with backspace. FROM says where
+;; construct started.
+(defun texinfo-do-itemize (from)
+ (save-excursion
+ (while (progn (forward-line -1)
+ (>= (point) from))
+ (if (= (following-char) ?\b)
+ (save-excursion
+ (delete-char 1)
+ (end-of-line)
+ (delete-char 6))
+ (if (not (looking-at "[ \t]*$"))
+ (save-excursion (insert " ")))))))
+
+(put 'item 'texinfo-format 'texinfo-item)
+(put 'itemx 'texinfo-format 'texinfo-item)
+(defun texinfo-item ()
+ (funcall (get (car (car texinfo-stack)) 'texinfo-item)))
+
+(put 'itemize 'texinfo-item 'texinfo-itemize-item)
+(defun texinfo-itemize-item ()
+ ;; (texinfo-discard-line) ; Did not handle text on same line as @item.
+ (delete-region (1+ (point)) (save-excursion (beginning-of-line) (point)))
+ (if (looking-at "[ \t]*[^ \t\n]+")
+ ;; Text on same line as @item command.
+ (insert "\b " (nth 1 (car texinfo-stack)) " \n")
+ ;; Else text on next line.
+ (insert "\b " (nth 1 (car texinfo-stack)) " "))
+ (forward-line -1))
+
+(put 'enumerate 'texinfo-item 'texinfo-enumerate-item)
+(defun texinfo-enumerate-item ()
+ (texinfo-discard-line)
+ (let (enumerating-symbol)
+ (cond ((integerp (car (cdr (car texinfo-stack))))
+ (setq enumerating-symbol (car (cdr (car texinfo-stack))))
+ (insert ?\b (format "%3d. " enumerating-symbol) ?\n)
+ (setcar (cdr (car texinfo-stack)) (1+ enumerating-symbol)))
+ ((symbolp (car (cdr (car texinfo-stack))))
+ (setq enumerating-symbol
+ (symbol-name (car (cdr (car texinfo-stack)))))
+ (if (or (equal ?\[ (string-to-char enumerating-symbol))
+ (equal ?\{ (string-to-char enumerating-symbol)))
+ (error
+ "Too many items in enumerated list; alphabet ends at Z."))
+ (insert ?\b (format "%3s. " enumerating-symbol) ?\n)
+ (setcar (cdr (car texinfo-stack))
+ (make-symbol
+ (char-to-string
+ (1+
+ (string-to-char enumerating-symbol))))))
+ (t
+ (error
+ "@enumerate: Use a number or letter, eg: 1, A, a, 3, B or d." )))
+ (forward-line -1)))
+
+(put 'alphaenumerate 'texinfo-item 'texinfo-alphaenumerate-item)
+(defun texinfo-alphaenumerate-item ()
+ (texinfo-discard-line)
+ (let ((next (1+ (car (cdr (car texinfo-stack))))))
+ (if (> next ?z)
+ (error "More than 26 items in @alphaenumerate; get a bigger alphabet."))
+ (setcar (cdr (car texinfo-stack)) next)
+ (insert "\b " next ". \n"))
+ (forward-line -1))
+
+(put 'capsenumerate 'texinfo-item 'texinfo-capsenumerate-item)
+(defun texinfo-capsenumerate-item ()
+ (texinfo-discard-line)
+ (let ((next (1+ (car (cdr (car texinfo-stack))))))
+ (if (> next ?Z)
+ (error "More than 26 items in @capsenumerate; get a bigger alphabet."))
+ (setcar (cdr (car texinfo-stack)) next)
+ (insert "\b " next ". \n"))
+ (forward-line -1))
+
+
+;;; @table
+
+;; The `@table' command produces two-column tables.
+
+(put 'table 'texinfo-format 'texinfo-table)
+(defun texinfo-table ()
+ (texinfo-push-stack
+ 'table
+ (progn (skip-chars-forward " \t")
+ (if (eolp)
+ "@asis"
+ (texinfo-parse-line-arg))))
+ (texinfo-discard-line-with-args)
+ (setq fill-column (- fill-column 5)))
+
+(put 'table 'texinfo-item 'texinfo-table-item)
+(defun texinfo-table-item ()
+ (let ((arg (texinfo-parse-arg-discard))
+ (itemfont (car (cdr (car texinfo-stack)))))
+ (insert ?\b itemfont ?\{ arg "}\n \n"))
+ (forward-line -2))
+
+(put 'table 'texinfo-end 'texinfo-end-table)
+(defun texinfo-end-table ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'table)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+;; @description appears to be an undocumented variant on @table that
+;; does not require an arg. It fails in texinfo.tex 2.58 and is not
+;; part of makeinfo.c The command appears to be a relic of the past.
+(put 'description 'texinfo-end 'texinfo-end-table)
+(put 'description 'texinfo-format 'texinfo-description)
+(defun texinfo-description ()
+ (texinfo-push-stack 'table "@asis")
+ (setq fill-column (- fill-column 5))
+ (texinfo-discard-line))
+
+
+;;; @ftable, @vtable
+
+;; The `@ftable' and `@vtable' commands are like the `@table' command
+;; but they also insert each entry in the first column of the table
+;; into the function or variable index.
+
+;; Handle the @ftable and @vtable commands:
+
+(put 'ftable 'texinfo-format 'texinfo-ftable)
+(put 'vtable 'texinfo-format 'texinfo-vtable)
+
+(defun texinfo-ftable () (texinfo-indextable 'ftable))
+(defun texinfo-vtable () (texinfo-indextable 'vtable))
+
+(defun texinfo-indextable (table-type)
+ (texinfo-push-stack table-type (texinfo-parse-arg-discard))
+ (setq fill-column (- fill-column 5)))
+
+;; Handle the @item commands within ftable and vtable:
+
+(put 'ftable 'texinfo-item 'texinfo-ftable-item)
+(put 'vtable 'texinfo-item 'texinfo-vtable-item)
+
+(defun texinfo-ftable-item () (texinfo-indextable-item 'texinfo-findex))
+(defun texinfo-vtable-item () (texinfo-indextable-item 'texinfo-vindex))
+
+(defun texinfo-indextable-item (index-type)
+ (let ((item (texinfo-parse-arg-discard))
+ (itemfont (car (cdr (car texinfo-stack))))
+ (indexvar index-type))
+ (insert ?\b itemfont ?\{ item "}\n \n")
+ (set indexvar
+ (cons
+ (list item texinfo-last-node)
+ (symbol-value indexvar)))
+ (forward-line -2)))
+
+;; Handle @end ftable, @end vtable
+
+(put 'ftable 'texinfo-end 'texinfo-end-ftable)
+(put 'vtable 'texinfo-end 'texinfo-end-vtable)
+
+(defun texinfo-end-ftable () (texinfo-end-indextable 'ftable))
+(defun texinfo-end-vtable () (texinfo-end-indextable 'vtable))
+
+(defun texinfo-end-indextable (table-type)
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack table-type)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+
+;;; @multitable ... @end multitable
+
+;; Produce a multi-column table, with as many columns as desired.
+;;
+;; A multi-column table has this template:
+;;
+;; @multitable {A1} {A2} {A3}
+;; @item A1 @tab A2 @tab A3
+;; @item B1 @tab B2 @tab B3
+;; @item C1 @tab C2 @tab C3
+;; @end multitable
+;;
+;; where the width of the text in brackets specifies the width of the
+;; respective column.
+;;
+;; Or else:
+;;
+;; @multitable @columnfractions .25 .3 .45
+;; @item A1 @tab A2 @tab A3
+;; @item B1 @tab B2 @tab B3
+;; @end multitable
+;;
+;; where the fractions specify the width of each column as a percent
+;; of the current width of the text (i.e., of the fill-column).
+;;
+;; Long lines of text are filled within columns.
+;;
+;; Using the Emacs Lisp formatter, texinfmt.el,
+;; the whitespace between columns can be increased by setting
+;; `extra-inter-column-width' to a value greater than 0. By default,
+;; there is at least one blank space between columns.
+;;
+;; The Emacs Lisp formatter, texinfmt.el, ignores the following four
+;; commands that are defined in texinfo.tex for printed output.
+;;
+;; @multitableparskip,
+;; @multitableparindent,
+;; @multitablecolmargin,
+;; @multitablelinespace.
+
+;; How @multitable works.
+;; =====================
+;;
+;; `texinfo-multitable' reads the @multitable line and determines from it
+;; how wide each column should be.
+;;
+;; Also, it pushes this information, along with an identifying symbol,
+;; onto the `texinfo-stack'. At the @end multitable command, the stack
+;; is checked for its matching @multitable command, and then popped, or
+;; else an error is signaled. Also, this command pushes the location of
+;; the start of the table onto the stack.
+;;
+;; `texinfo-end-multitable' checks the `texinfo-stack' that the @end
+;; multitable truly is ending a corresponding beginning, and if it is,
+;; pops the stack.
+;;
+;; `texinfo-multitable-widths' is called by `texinfo-multitable'.
+;; The function returns a list of the widths of each column in a
+;; multi-column table, based on the information supplied by the arguments
+;; to the @multitable command (by arguments, I mean the text on the rest
+;; of the @multitable line, not the remainder of the multi-column table
+;; environment).
+;;
+;; `texinfo-multitable-item' formats a row within a multicolumn table.
+;; This command is executed when texinfmt sees @item inside @multitable.
+;; Cells in row are separated by `@tab's. Widths of cells are specified
+;; by the arguments in the @multitable line. Cells are filled. All cells
+;; are made to be the same height by padding their bottoms, as needed,
+;; with blanks.
+;;
+;; `texinfo-multitable-extract-row' is called by `texinfo-multitable-item'.
+;; This function returns the text in a multitable row, as a string.
+;; The start of a row is marked by an @item and the end of row is the
+;; beginning of next @item or beginning of the @end multitable line.
+;; Cells within a row are separated by @tab.
+;;
+;; Note that @tab, the cell separators, are not treated as independent
+;; Texinfo commands.
+
+(defvar extra-inter-column-width 0
+"*Insert NUMBER of additional columns of whitespace between entries of
+a multi-column table.")
+
+(defvar multitable-temp-buffer-name "*multitable-temporary-buffer*")
+(defvar multitable-temp-rectangle-name "texinfo-multitable-temp-")
+
+;; These commands are defined in texinfo.tex for printed output.
+(put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitableparindent 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitablecolmargin 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args)
+
+(put 'multitable 'texinfo-format 'texinfo-multitable)
+(defun texinfo-multitable ()
+ "Produce multi-column tables.
+
+A multi-column table has this template:
+
+ @multitable {A1} {A2} {A3}
+ @item A1 @tab A2 @tab A3
+ @item B1 @tab B2 @tab B3
+ @item C1 @tab C2 @tab C3
+ @end multitable
+
+where the width of the text in brackets specifies the width of the
+respective column.
+
+Or else:
+
+ @multitable @columnfractions .25 .3 .45
+ @item A1 @tab A2 @tab A3
+ @item B1 @tab B2 @tab B3
+ @end multitable
+
+where the fractions specify the width of each column as a percent
+of the current width of the text (i.e., of the fill-column).
+
+Long lines of text are filled within columns.
+
+Using the Emacs Lisp formatter, texinfmt.el,
+the whitespace between columns can be increased by setting
+`extra-inter-column-width' to a value greater than 0. By default,
+there is at least one blank space between columns.
+
+The Emacs Lisp formatter, texinfmt.el, ignores the following four
+commands that are defined in texinfo.tex for printed output.
+
+ @multitableparskip,
+ @multitableparindent,
+ @multitablecolmargin,
+ @multitablelinespace."
+
+;; This function pushes information onto the `texinfo-stack'.
+;; A stack element consists of:
+;; - type-of-command, i.e., multitable
+;; - the information about column widths, and
+;; - the position of texinfo-command-start.
+;; e.g., ('multitable (1 2 3 4) 123)
+;; The command line is then deleted.
+ (texinfo-push-stack
+ 'multitable
+ ;; push width information on stack
+ (texinfo-multitable-widths))
+ (texinfo-discard-line-with-args))
+
+(put 'multitable 'texinfo-end 'texinfo-end-multitable)
+(defun texinfo-end-multitable ()
+ "Discard the @end multitable line and pop the stack of multitable."
+ (texinfo-discard-command)
+ (texinfo-pop-stack 'multitable))
+
+(defun texinfo-multitable-widths ()
+ "Return list of widths of each column in a multi-column table."
+ (let (texinfo-multitable-width-list)
+ ;; Fractions format:
+ ;; @multitable @columnfractions .25 .3 .45
+ ;;
+ ;; Template format:
+ ;; @multitable {Column 1 template} {Column 2} {Column 3 example}
+ ;; Place point before first argument
+ (skip-chars-forward " \t")
+ (cond
+ ;; Check for common misspelling
+ ((looking-at "@columnfraction ")
+ (error "In @multitable, @columnfractions misspelled"))
+ ;; Case 1: @columnfractions .25 .3 .45
+ ((looking-at "@columnfractions")
+ (forward-word 1)
+ (while (not (eolp))
+ (setq texinfo-multitable-width-list
+ (cons
+ (truncate
+ (1-
+ (* fill-column (read (get-buffer (current-buffer))))))
+ texinfo-multitable-width-list))))
+ ;;
+ ;; Case 2: {Column 1 template} {Column 2} {Column 3 example}
+ ((looking-at "{")
+ (let ((start-of-templates (point)))
+ (while (not (eolp))
+ (skip-chars-forward " \t")
+ (let* ((start-of-template (1+ (point)))
+ (end-of-template
+ ;; forward-sexp works with braces in Texinfo mode
+ (progn (forward-sexp 1) (1- (point)))))
+ (setq texinfo-multitable-width-list
+ (cons (- end-of-template start-of-template)
+ texinfo-multitable-width-list))
+ ;; Remove carriage return from within a template, if any.
+ ;; This helps those those who want to use more than
+ ;; one line's worth of words in @multitable line.
+ (narrow-to-region start-of-template end-of-template)
+ (goto-char (point-min))
+ (while (search-forward "
+" nil t)
+ (delete-char -1))
+ (goto-char (point-max))
+ (widen)
+ (forward-char 1)))))
+ ;;
+ ;; Case 3: Trouble
+ (t
+ (error
+ "You probably need to specify column widths for @multitable correctly.")))
+ ;; Check whether columns fit on page.
+ (let ((desired-columns
+ (+
+ ;; between column spaces
+ (length texinfo-multitable-width-list)
+ ;; additional between column spaces, if any
+ extra-inter-column-width
+ ;; sum of spaces for each entry
+ (apply '+ texinfo-multitable-width-list))))
+ (if (> desired-columns fill-column)
+ (error
+ (format
+ "Multi-column table width, %d chars, is greater than page width, %d chars."
+ desired-columns fill-column))))
+ texinfo-multitable-width-list))
+
+;; @item A1 @tab A2 @tab A3
+(defun texinfo-multitable-extract-row ()
+ "Return multitable row, as a string.
+End of row is beginning of next @item or beginning of @end.
+Cells within rows are separated by @tab."
+ (skip-chars-forward " \t")
+ (let* ((start (point))
+ (end (progn
+ (re-search-forward "@item\\|@end")
+ (match-beginning 0)))
+ (row (progn (goto-char end)
+ (skip-chars-backward " ")
+ ;; remove whitespace at end of argument
+ (delete-region (point) end)
+ (buffer-substring start (point)))))
+ (delete-region texinfo-command-start end)
+ row))
+
+(put 'multitable 'texinfo-item 'texinfo-multitable-item)
+(defun texinfo-multitable-item ()
+ "Format a row within a multicolumn table.
+Cells in row are separated by @tab.
+Widths of cells are specified by the arguments in the @multitable line.
+All cells are made to be the same height.
+This command is executed when texinfmt sees @item inside @multitable."
+ (let ((original-buffer (current-buffer))
+ (table-widths (reverse (car (cdr (car texinfo-stack)))))
+ (existing-fill-column fill-column)
+ start
+ end
+ (table-column 0)
+ (table-entry-height 0)
+ ;; unformatted row looks like: A1 @tab A2 @tab A3
+ ;; extract-row command deletes the source line in the table.
+ (unformated-row (texinfo-multitable-extract-row)))
+ ;; Use a temporary buffer
+ (set-buffer (get-buffer-create multitable-temp-buffer-name))
+ (delete-region (point-min) (point-max))
+ (insert unformated-row)
+ (goto-char (point-min))
+;; 1. Check for correct number of @tab in line.
+ (let ((tab-number 1)) ; one @tab between two columns
+ (while (search-forward "@tab" nil t)
+ (setq tab-number (1+ tab-number)))
+ (if (/= tab-number (length table-widths))
+ (error "Wrong number of @tab's in a @multitable row.")))
+ (goto-char (point-min))
+;; 2. Format each cell, and copy to a rectangle
+ ;; buffer looks like this: A1 @tab A2 @tab A3
+ ;; Cell #1: format up to @tab
+ ;; Cell #2: format up to @tab
+ ;; Cell #3: format up to eob
+ (while (not (eobp))
+ (setq start (point))
+ (setq end (save-excursion
+ (if (search-forward "@tab" nil 'move)
+ ;; Delete the @tab command, including the @-sign
+ (delete-region
+ (point)
+ (progn (forward-word -1) (1- (point)))))
+ (point)))
+ ;; Set fill-column *wider* than needed to produce inter-column space
+ (setq fill-column (+ 1
+ extra-inter-column-width
+ (nth table-column table-widths)))
+ (narrow-to-region start end)
+ ;; Remove whitespace before and after entry.
+ (skip-chars-forward " ")
+ (delete-region (point) (save-excursion (beginning-of-line) (point)))
+ (goto-char (point-max))
+ (skip-chars-backward " ")
+ (delete-region (point) (save-excursion (end-of-line) (point)))
+ ;; Temorarily set texinfo-stack to nil so texinfo-format-scan
+ ;; does not see an unterminated @multitable.
+ (let (texinfo-stack) ; nil
+ (texinfo-format-scan))
+ (let (fill-prefix) ; no fill prefix
+ (fill-region (point-min) (point-max)))
+ (setq table-entry-height
+ (max table-entry-height (count-lines (point-min) (point-max))))
+;; 3. Move point to end of bottom line, and pad that line to fill column.
+ (goto-char (point-min))
+ (forward-line (1- table-entry-height))
+ (let* ((beg (point)) ; beginning of line
+ ;; add one more space for inter-column spacing
+ (needed-whitespace
+ (1+
+ (- fill-column
+ (-
+ (progn (end-of-line) (point)) ; end of existing line
+ beg)))))
+ (insert (make-string
+ (if (> needed-whitespace 0) needed-whitespace 1)
+ ? )))
+ ;; now, put formatted cell into a rectangle
+ (set (intern (concat multitable-temp-rectangle-name
+ (int-to-string table-column)))
+ (extract-rectangle (point-min) (point)))
+ (delete-region (point-min) (point))
+ (goto-char (point-max))
+ (setq table-column (1+ table-column))
+ (widen))
+;; 4. Add extra lines to rectangles so all are of same height
+ (let ((total-number-of-columns table-column)
+ (column-number 0)
+ here)
+ (while (> table-column 0)
+ (let ((this-rectangle (int-to-string table-column)))
+ (while (< (length this-rectangle) table-entry-height)
+ (setq this-rectangle (append this-rectangle '("")))))
+ (setq table-column (1- table-column)))
+;; 5. Insert formatted rectangles in original buffer
+ (switch-to-buffer original-buffer)
+ (open-line table-entry-height)
+ (while (< column-number total-number-of-columns)
+ (setq here (point))
+ (insert-rectangle
+ (eval (intern
+ (concat multitable-temp-rectangle-name
+ (int-to-string column-number)))))
+ (goto-char here)
+ (end-of-line)
+ (setq column-number (1+ column-number))))
+ (kill-buffer multitable-temp-buffer-name)
+ (setq fill-column existing-fill-column)))
+
+
+;;; @ifinfo, @iftex, @tex, @ifhtml, @html
+
+(put 'ifinfo 'texinfo-format 'texinfo-discard-line)
+(put 'ifinfo 'texinfo-end 'texinfo-discard-command)
+
+(put 'iftex 'texinfo-format 'texinfo-format-iftex)
+(defun texinfo-format-iftex ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end iftex[ \t]*\n")
+ (point))))
+
+(put 'ifhtml 'texinfo-format 'texinfo-format-ifhtml)
+(defun texinfo-format-ifhtml ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end ifhtml[ \t]*\n")
+ (point))))
+
+(put 'tex 'texinfo-format 'texinfo-format-tex)
+(defun texinfo-format-tex ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end tex[ \t]*\n")
+ (point))))
+
+(put 'html 'texinfo-format 'texinfo-format-html)
+(defun texinfo-format-html ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end html[ \t]*\n")
+ (point))))
+
+
+;;; @titlepage
+
+(put 'titlepage 'texinfo-format 'texinfo-format-titlepage)
+(defun texinfo-format-titlepage ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end titlepage[ \t]*\n")
+ (point))))
+
+(put 'endtitlepage 'texinfo-format 'texinfo-discard-line)
+
+;; @titlespec an alternative titling command; ignored by Info
+
+(put 'titlespec 'texinfo-format 'texinfo-format-titlespec)
+(defun texinfo-format-titlespec ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end titlespec[ \t]*\n")
+ (point))))
+
+(put 'endtitlespec 'texinfo-format 'texinfo-discard-line)
+
+
+;;; @today
+
+(put 'today 'texinfo-format 'texinfo-format-today)
+
+;; Produces Day Month Year style of output. eg `1 Jan 1900'
+;; The `@today{}' command requires a pair of braces, like `@dots{}'.
+(defun texinfo-format-today ()
+ (texinfo-parse-arg-discard)
+ (insert (format "%s %s %s"
+ (substring (current-time-string) 8 10)
+ (substring (current-time-string) 4 7)
+ (substring (current-time-string) -4))))
+
+
+;;; @ignore
+
+(put 'ignore 'texinfo-format 'texinfo-format-ignore)
+(defun texinfo-format-ignore ()
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end ignore[ \t]*\n")
+ (point))))
+
+(put 'endignore 'texinfo-format 'texinfo-discard-line)
+
+
+;;; Define the Info enclosure command: @definfoenclose
+
+;; A `@definfoenclose' command may be used to define a highlighting
+;; command for Info, but not for TeX. A command defined using
+;; `@definfoenclose' marks text by enclosing it in strings that precede
+;; and follow the text.
+;;
+;; Presumably, if you define a command with `@definfoenclose` for Info,
+;; you will also define the same command in the TeX definitions file,
+;; `texinfo.tex' in a manner appropriate for typesetting.
+;;
+;; Write a `@definfoenclose' command on a line and follow it with three
+;; arguments separated by commas (commas are used as separators in an
+;; `@node' line in the same way). The first argument to
+;; `@definfoenclose' is the @-command name \(without the `@'\); the
+;; second argument is the Info start delimiter string; and the third
+;; argument is the Info end delimiter string. The latter two arguments
+;; enclose the highlighted text in the Info file. A delimiter string
+;; may contain spaces. Neither the start nor end delimiter is
+;; required. However, if you do not provide a start delimiter, you
+;; must follow the command name with two commas in a row; otherwise,
+;; the Info formatting commands will misinterpret the end delimiter
+;; string as a start delimiter string.
+;;
+;; If you do a @definfoenclose{} on the name of a pre-defined macro (such
+;; as @emph{}, @strong{}, @tt{}, or @i{}) the enclosure definition will
+;; override the built-in definition.
+;;
+;; An enclosure command defined this way takes one argument in braces.
+;;
+;; For example, you can write:
+;;
+;; @ifinfo
+;; @definfoenclose phoo, //, \\
+;; @end ifinfo
+;;
+;; near the beginning of a Texinfo file at the beginning of the lines
+;; to define `@phoo' as an Info formatting command that inserts `//'
+;; before and `\\' after the argument to `@phoo'. You can then write
+;; `@phoo{bar}' wherever you want `//bar\\' highlighted in Info.
+;;
+;; Also, for TeX formatting, you could write
+;;
+;; @iftex
+;; @global@let@phoo=@i
+;; @end iftex
+;;
+;; to define `@phoo' as a command that causes TeX to typeset
+;; the argument to `@phoo' in italics.
+;;
+;; Note that each definition applies to its own formatter: one for TeX,
+;; the other for texinfo-format-buffer or texinfo-format-region.
+;;
+;; Here is another example: write
+;;
+;; @definfoenclose headword, , :
+;;
+;; near the beginning of the file, to define `@headword' as an Info
+;; formatting command that inserts nothing before and a colon after the
+;; argument to `@headword'.
+
+(put 'definfoenclose 'texinfo-format 'texinfo-define-info-enclosure)
+(defun texinfo-define-info-enclosure ()
+ (let* ((args (texinfo-format-parse-line-args))
+ (command-name (nth 0 args))
+ (beginning-delimiter (or (nth 1 args) ""))
+ (end-delimiter (or (nth 2 args) "")))
+ (texinfo-discard-command)
+ (setq texinfo-enclosure-list
+ (cons
+ (list command-name
+ (list
+ beginning-delimiter
+ end-delimiter))
+ texinfo-enclosure-list))))
+
+
+;;; @var, @code and the like
+
+(put 'var 'texinfo-format 'texinfo-format-var)
+;; @sc a small caps font for TeX; formatted as `var' in Info
+(put 'sc 'texinfo-format 'texinfo-format-var)
+(defun texinfo-format-var ()
+ (insert (upcase (texinfo-parse-arg-discard)))
+ (goto-char texinfo-command-start))
+
+(put 'url 'texinfo-format 'texinfo-format-code)
+(put 'cite 'texinfo-format 'texinfo-format-code)
+(put 'code 'texinfo-format 'texinfo-format-code)
+(put 'file 'texinfo-format 'texinfo-format-code)
+(put 'samp 'texinfo-format 'texinfo-format-code)
+(defun texinfo-format-code ()
+ (insert "`" (texinfo-parse-arg-discard) "'")
+ (goto-char texinfo-command-start))
+
+(put 'emph 'texinfo-format 'texinfo-format-emph)
+(put 'strong 'texinfo-format 'texinfo-format-emph)
+(defun texinfo-format-emph ()
+ (insert "*" (texinfo-parse-arg-discard) "*")
+ (goto-char texinfo-command-start))
+
+(put 'dfn 'texinfo-format 'texinfo-format-defn)
+(put 'defn 'texinfo-format 'texinfo-format-defn)
+(defun texinfo-format-defn ()
+ (insert "\"" (texinfo-parse-arg-discard) "\"")
+ (goto-char texinfo-command-start))
+
+(put 'email 'texinfo-format 'texinfo-format-key)
+(put 'key 'texinfo-format 'texinfo-format-key)
+(defun texinfo-format-key ()
+ (insert "<" (texinfo-parse-arg-discard) ">")
+ (goto-char texinfo-command-start))
+
+(put 'bullet 'texinfo-format 'texinfo-format-bullet)
+(defun texinfo-format-bullet ()
+ "Insert an asterisk.
+If used within a line, follow `@bullet' with braces."
+ (texinfo-optional-braces-discard)
+ (insert "*"))
+
+
+;;; @kbd
+
+;; Inside of @example ... @end example and similar environments,
+;; @kbd does nothing; but outside of such environments, it places
+;; single quotation markes around its argument.
+
+(defvar texinfo-format-kbd-regexp
+ (concat
+ "^@"
+ "\\("
+ "example\\|"
+ "smallexample\\|"
+ "lisp\\|"
+ "smalllisp"
+ "\\)")
+ "Regexp specifying environments in which @kbd does not put `...'
+ around argument.")
+
+(defvar texinfo-format-kbd-end-regexp
+ (concat
+ "^@end "
+ "\\("
+ "example\\|"
+ "smallexample\\|"
+ "lisp\\|"
+ "smalllisp"
+ "\\)")
+ "Regexp specifying end of environments in which @kbd does not put `...'
+ around argument. (See `texinfo-format-kbd-regexp')")
+
+(put 'kbd 'texinfo-format 'texinfo-format-kbd)
+(defun texinfo-format-kbd ()
+ "Place single quote marks around arg, except in @example and similar."
+ ;; Search forward for @end example closer than an @example.
+ ;; Can stop search at nearest @node or texinfo-section-types-regexp
+ (let* ((stop
+ (save-excursion
+ (re-search-forward
+ (concat "^@node\\|\\(" texinfo-section-types-regexp "\\)")
+ nil
+ 'move-to-end) ; if necessary, return point at end of buffer
+ (point)))
+ (example-location
+ (save-excursion
+ (re-search-forward texinfo-format-kbd-regexp stop 'move-to-end)
+ (point)))
+ (end-example-location
+ (save-excursion
+ (re-search-forward texinfo-format-kbd-end-regexp stop 'move-to-end)
+ (point))))
+ ;; If inside @example, @end example will be closer than @example
+ ;; or end of search i.e., end-example-location less than example-location
+ (if (>= end-example-location example-location)
+ ;; outside an @example or equivalent
+ (insert "`" (texinfo-parse-arg-discard) "'")
+ ;; else, in @example; do not surround with `...'
+ (insert (texinfo-parse-arg-discard)))
+ (goto-char texinfo-command-start)))
+
+
+;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample
+
+(put 'display 'texinfo-format 'texinfo-format-example)
+(put 'example 'texinfo-format 'texinfo-format-example)
+(put 'lisp 'texinfo-format 'texinfo-format-example)
+(put 'quotation 'texinfo-format 'texinfo-format-example)
+(put 'smallexample 'texinfo-format 'texinfo-format-example)
+(put 'smalllisp 'texinfo-format 'texinfo-format-example)
+(defun texinfo-format-example ()
+ (texinfo-push-stack 'example nil)
+ (setq fill-column (- fill-column 5))
+ (texinfo-discard-line))
+
+(put 'example 'texinfo-end 'texinfo-end-example)
+(put 'display 'texinfo-end 'texinfo-end-example)
+(put 'lisp 'texinfo-end 'texinfo-end-example)
+(put 'quotation 'texinfo-end 'texinfo-end-example)
+(put 'smallexample 'texinfo-end 'texinfo-end-example)
+(put 'smalllisp 'texinfo-end 'texinfo-end-example)
+(defun texinfo-end-example ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((stacktop
+ (texinfo-pop-stack 'example)))
+ (texinfo-do-itemize (nth 1 stacktop))))
+
+(put 'exdent 'texinfo-format 'texinfo-format-exdent)
+(defun texinfo-format-exdent ()
+ (texinfo-discard-command)
+ (delete-region (point)
+ (progn
+ (skip-chars-forward " ")
+ (point)))
+ (insert ?\b)
+ ;; Cancel out the deletion that texinfo-do-itemize
+ ;; is going to do at the end of this line.
+ (save-excursion
+ (end-of-line)
+ (insert "\n ")))
+
+
+;;; @cartouche
+
+;; The @cartouche command is a noop in Info; in a printed manual,
+;; it makes a box with rounded corners.
+
+(put 'cartouche 'texinfo-format 'texinfo-discard-line)
+(put 'cartouche 'texinfo-end 'texinfo-discard-command)
+
+
+;;; @flushleft and @format
+
+;; The @flushleft command left justifies every line but leaves the
+;; right end ragged. As far as Info is concerned, @flushleft is a
+;; `do-nothing' command
+
+;; The @format command is similar to @example except that it does not
+;; indent; this means that in Info, @format is similar to @flushleft.
+
+(put 'format 'texinfo-format 'texinfo-format-flushleft)
+(put 'flushleft 'texinfo-format 'texinfo-format-flushleft)
+(defun texinfo-format-flushleft ()
+ (texinfo-discard-line))
+
+(put 'format 'texinfo-end 'texinfo-end-flushleft)
+(put 'flushleft 'texinfo-end 'texinfo-end-flushleft)
+(defun texinfo-end-flushleft ()
+ (texinfo-discard-command))
+
+
+;;; @flushright
+
+;; The @flushright command right justifies every line but leaves the
+;; left end ragged. Spaces and tabs at the right ends of lines are
+;; removed so that visible text lines up on the right side.
+
+(put 'flushright 'texinfo-format 'texinfo-format-flushright)
+(defun texinfo-format-flushright ()
+ (texinfo-push-stack 'flushright nil)
+ (texinfo-discard-line))
+
+(put 'flushright 'texinfo-end 'texinfo-end-flushright)
+(defun texinfo-end-flushright ()
+ (texinfo-discard-command)
+
+ (let ((stacktop
+ (texinfo-pop-stack 'flushright)))
+
+ (texinfo-do-flushright (nth 1 stacktop))))
+
+(defun texinfo-do-flushright (from)
+ (save-excursion
+ (while (progn (forward-line -1)
+ (>= (point) from))
+
+ (beginning-of-line)
+ (insert
+ (make-string
+ (- fill-column
+ (save-excursion
+ (end-of-line)
+ (skip-chars-backward " \t")
+ (delete-region (point) (progn (end-of-line) (point)))
+ (current-column)))
+ ? )))))
+
+
+;;; @ctrl, @TeX, @copyright, @minus, @dots, @enddots, @pounds
+
+(put 'ctrl 'texinfo-format 'texinfo-format-ctrl)
+(defun texinfo-format-ctrl ()
+ (let ((str (texinfo-parse-arg-discard)))
+ (insert (logand 31 (aref str 0)))))
+
+(put 'TeX 'texinfo-format 'texinfo-format-TeX)
+(defun texinfo-format-TeX ()
+ (texinfo-parse-arg-discard)
+ (insert "TeX"))
+
+(put 'copyright 'texinfo-format 'texinfo-format-copyright)
+(defun texinfo-format-copyright ()
+ (texinfo-parse-arg-discard)
+ (insert "(C)"))
+
+(put 'minus 'texinfo-format 'texinfo-format-minus)
+(defun texinfo-format-minus ()
+ "Insert a minus sign.
+If used within a line, follow `@minus' with braces."
+ (texinfo-optional-braces-discard)
+ (insert "-"))
+
+(put 'dots 'texinfo-format 'texinfo-format-dots)
+(defun texinfo-format-dots ()
+ (texinfo-parse-arg-discard)
+ (insert "..."))
+
+(put 'enddots 'texinfo-format 'texinfo-format-enddots)
+(defun texinfo-format-enddots ()
+ (texinfo-parse-arg-discard)
+ (insert "...."))
+
+(put 'pounds 'texinfo-format 'texinfo-format-pounds)
+(defun texinfo-format-pounds ()
+ (texinfo-parse-arg-discard)
+ (insert "#"))
+
+
+;;; Refilling and indenting: @refill, @paragraphindent, @noindent
+
+;;; Indent only those paragraphs that are refilled as a result of an
+;;; @refill command.
+
+;; * If the value is `asis', do not change the existing indentation at
+;; the starts of paragraphs.
+
+;; * If the value zero, delete any existing indentation.
+
+;; * If the value is greater than zero, indent each paragraph by that
+;; number of spaces.
+
+;;; But do not refill paragraphs with an @refill command that are
+;;; preceded by @noindent or are part of a table, list, or deffn.
+
+(defvar texinfo-paragraph-indent "asis"
+ "Number of spaces for @refill to indent a paragraph; else to leave as is.")
+
+(put 'paragraphindent 'texinfo-format 'texinfo-paragraphindent)
+
+(defun texinfo-paragraphindent ()
+ "Specify the number of spaces for @refill to indent a paragraph.
+Default is to leave the number of spaces as is."
+ (let ((arg (texinfo-parse-arg-discard)))
+ (if (string= "asis" arg)
+ (setq texinfo-paragraph-indent "asis")
+ (setq texinfo-paragraph-indent (string-to-int arg)))))
+
+(put 'refill 'texinfo-format 'texinfo-format-refill)
+(defun texinfo-format-refill ()
+ "Refill paragraph. Also, indent first line as set by @paragraphindent.
+Default is to leave paragraph indentation as is."
+ (texinfo-discard-command)
+ (forward-paragraph -1)
+ (if (looking-at "[ \t\n]*$") (forward-line 1))
+ ;; Do not indent if an entry in a list, table, or deffn,
+ ;; or if paragraph is preceded by @noindent.
+ ;; Otherwise, indent
+ (cond
+ ;; delete a @noindent line and do not indent paragraph
+ ((save-excursion (forward-line -1)
+ (looking-at "^@noindent"))
+ (forward-line -1)
+ (delete-region (point) (progn (forward-line 1) (point))))
+ ;; do nothing if "asis"
+ ((equal texinfo-paragraph-indent "asis"))
+ ;; do no indenting in list, etc.
+ ((> texinfo-stack-depth 0))
+ ;; otherwise delete existing whitespace and indent
+ (t
+ (delete-region (point) (progn (skip-chars-forward " \t") (point)))
+ (insert (make-string texinfo-paragraph-indent ? ))))
+ (forward-paragraph 1)
+ (forward-line -1)
+ (end-of-line)
+ ;; Do not fill a section title line with asterisks, hyphens, etc. that
+ ;; are used to underline it. This could occur if the line following
+ ;; the underlining is not an index entry and has text within it.
+ (let* ((previous-paragraph-separate paragraph-separate)
+ (paragraph-separate
+ (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+"))
+ (previous-paragraph-start paragraph-start)
+ (paragraph-start
+ (concat paragraph-start "\\|[-=.]+\\|\\*\\*+")))
+ (unwind-protect
+ (fill-paragraph nil)
+ (setq paragraph-separate previous-paragraph-separate)
+ (setq paragraph-start previous-paragraph-start))))
+
+(put 'noindent 'texinfo-format 'texinfo-noindent)
+(defun texinfo-noindent ()
+ (save-excursion
+ (forward-paragraph 1)
+ (if (search-backward "@refill"
+ (save-excursion (forward-line -1) (point)) t)
+ () ; leave @noindent command so @refill command knows not to indent
+ ;; else
+ (texinfo-discard-line))))
+
+
+;;; Index generation
+
+(put 'vindex 'texinfo-format 'texinfo-format-vindex)
+(defun texinfo-format-vindex ()
+ (texinfo-index 'texinfo-vindex))
+
+(put 'cindex 'texinfo-format 'texinfo-format-cindex)
+(defun texinfo-format-cindex ()
+ (texinfo-index 'texinfo-cindex))
+
+(put 'findex 'texinfo-format 'texinfo-format-findex)
+(defun texinfo-format-findex ()
+ (texinfo-index 'texinfo-findex))
+
+(put 'pindex 'texinfo-format 'texinfo-format-pindex)
+(defun texinfo-format-pindex ()
+ (texinfo-index 'texinfo-pindex))
+
+(put 'tindex 'texinfo-format 'texinfo-format-tindex)
+(defun texinfo-format-tindex ()
+ (texinfo-index 'texinfo-tindex))
+
+(put 'kindex 'texinfo-format 'texinfo-format-kindex)
+(defun texinfo-format-kindex ()
+ (texinfo-index 'texinfo-kindex))
+
+(defun texinfo-index (indexvar)
+ (let ((arg (texinfo-parse-expanded-arg)))
+ (texinfo-discard-command)
+ (set indexvar
+ (cons (list arg
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value indexvar)))))
+
+(defconst texinfo-indexvar-alist
+ '(("cp" . texinfo-cindex)
+ ("fn" . texinfo-findex)
+ ("vr" . texinfo-vindex)
+ ("tp" . texinfo-tindex)
+ ("pg" . texinfo-pindex)
+ ("ky" . texinfo-kindex)))
+
+
+;;; @defindex @defcodeindex
+(put 'defindex 'texinfo-format 'texinfo-format-defindex)
+(put 'defcodeindex 'texinfo-format 'texinfo-format-defindex)
+
+(defun texinfo-format-defindex ()
+ (let* ((index-name (texinfo-parse-arg-discard)) ; eg: `aa'
+ (indexing-command (intern (concat index-name "index")))
+ (index-formatting-command ; eg: `texinfo-format-aaindex'
+ (intern (concat "texinfo-format-" index-name "index")))
+ (index-alist-name ; eg: `texinfo-aaindex'
+ (intern (concat "texinfo-" index-name "index"))))
+
+ (set index-alist-name nil)
+
+ (put indexing-command ; eg, aaindex
+ 'texinfo-format
+ index-formatting-command) ; eg, texinfo-format-aaindex
+
+ ;; eg: "aa" . texinfo-aaindex
+ (or (assoc index-name texinfo-indexvar-alist)
+ (setq texinfo-indexvar-alist
+ (cons
+ (cons index-name
+ index-alist-name)
+ texinfo-indexvar-alist)))
+
+ (fset index-formatting-command
+ (list 'lambda 'nil
+ (list 'texinfo-index
+ (list 'quote index-alist-name))))))
+
+
+;;; @synindex @syncodeindex
+
+(put 'synindex 'texinfo-format 'texinfo-format-synindex)
+(put 'syncodeindex 'texinfo-format 'texinfo-format-synindex)
+
+(defun texinfo-format-synindex ()
+ (let* ((args (texinfo-parse-arg-discard))
+ (second (cdr (read-from-string args)))
+ (joiner (symbol-name (car (read-from-string args))))
+ (joined (symbol-name (car (read-from-string args second)))))
+
+ (if (assoc joiner texinfo-short-index-cmds-alist)
+ (put
+ (cdr (assoc joiner texinfo-short-index-cmds-alist))
+ 'texinfo-format
+ (or (cdr (assoc joined texinfo-short-index-format-cmds-alist))
+ (intern (concat "texinfo-format-" joined "index"))))
+ (put
+ (intern (concat joiner "index"))
+ 'texinfo-format
+ (or (cdr(assoc joined texinfo-short-index-format-cmds-alist))
+ (intern (concat "texinfo-format-" joined "index")))))))
+
+(defconst texinfo-short-index-cmds-alist
+ '(("cp" . cindex)
+ ("fn" . findex)
+ ("vr" . vindex)
+ ("tp" . tindex)
+ ("pg" . pindex)
+ ("ky" . kindex)))
+
+(defconst texinfo-short-index-format-cmds-alist
+ '(("cp" . texinfo-format-cindex)
+ ("fn" . texinfo-format-findex)
+ ("vr" . texinfo-format-vindex)
+ ("tp" . texinfo-format-tindex)
+ ("pg" . texinfo-format-pindex)
+ ("ky" . texinfo-format-kindex)))
+
+
+;;; Sort and index (for VMS)
+
+;; Sort an index which is in the current buffer between START and END.
+;; Used on VMS, where the `sort' utility is not available.
+(defun texinfo-sort-region (start end)
+ (require 'sort)
+ (save-restriction
+ (narrow-to-region start end)
+ (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun)))
+
+;; Subroutine for sorting an index.
+;; At start of a line, return a string to sort the line under.
+(defun texinfo-sort-startkeyfun ()
+ (let ((line
+ (buffer-substring (point) (save-excursion (end-of-line) (point)))))
+ ;; Canonicalize whitespace and eliminate funny chars.
+ (while (string-match "[ \t][ \t]+\\|[^a-z0-9 ]+" line)
+ (setq line (concat (substring line 0 (match-beginning 0))
+ " "
+ (substring line (match-end 0) (length line)))))
+ line))
+
+
+;;; @printindex
+
+(put 'printindex 'texinfo-format 'texinfo-format-printindex)
+
+(defun texinfo-format-printindex ()
+ (let ((indexelts (symbol-value
+ (cdr (assoc (texinfo-parse-arg-discard)
+ texinfo-indexvar-alist))))
+ opoint)
+ (insert "\n* Menu:\n\n")
+ (setq opoint (point))
+ (texinfo-print-index nil indexelts)
+
+ (if (memq system-type '(vax-vms windows-nt ms-dos))
+ (texinfo-sort-region opoint (point))
+ (shell-command-on-region opoint (point) "sort -fd" 1))))
+
+(defun texinfo-print-index (file indexelts)
+ (while indexelts
+ (if (stringp (car (car indexelts)))
+ (progn
+ (insert "* " (car (car indexelts)) ": " )
+ (indent-to 32)
+ (insert
+ (if file (concat "(" file ")") "")
+ (nth 1 (car indexelts)) ".")
+ (indent-to 54)
+ (insert
+ (if (nth 2 (car indexelts))
+ (format " %d." (nth 2 (car indexelts)))
+ "")
+ "\n"))
+ ;; index entries from @include'd file
+ (texinfo-print-index (nth 1 (car indexelts))
+ (nth 2 (car indexelts))))
+ (setq indexelts (cdr indexelts))))
+
+
+;;; Glyphs: @equiv, @error, etc
+
+;; @equiv to show that two expressions are equivalent
+;; @error to show an error message
+;; @expansion to show what a macro expands to
+;; @point to show the location of point in an example
+;; @print to show what an evaluated expression prints
+;; @result to indicate the value returned by an expression
+
+(put 'equiv 'texinfo-format 'texinfo-format-equiv)
+(defun texinfo-format-equiv ()
+ (texinfo-parse-arg-discard)
+ (insert "=="))
+
+(put 'error 'texinfo-format 'texinfo-format-error)
+(defun texinfo-format-error ()
+ (texinfo-parse-arg-discard)
+ (insert "error-->"))
+
+(put 'expansion 'texinfo-format 'texinfo-format-expansion)
+(defun texinfo-format-expansion ()
+ (texinfo-parse-arg-discard)
+ (insert "==>"))
+
+(put 'point 'texinfo-format 'texinfo-format-point)
+(defun texinfo-format-point ()
+ (texinfo-parse-arg-discard)
+ (insert "-!-"))
+
+(put 'print 'texinfo-format 'texinfo-format-print)
+(defun texinfo-format-print ()
+ (texinfo-parse-arg-discard)
+ (insert "-|"))
+
+(put 'result 'texinfo-format 'texinfo-format-result)
+(defun texinfo-format-result ()
+ (texinfo-parse-arg-discard)
+ (insert "=>"))
+
+
+;;; Accent commands
+
+;; Info presumes a plain ASCII output, so the accented characters do
+;; not look as they would if typeset, or output with a different
+;; character set.
+
+;; See the `texinfo-accent-commands' variable
+;; in the section for `texinfo-append-refill'.
+;; Also, see the defun for `texinfo-format-scan'
+;; for single-character accent commands.
+
+;; Command Info output Name
+
+;; These do not have braces:
+;; @^ ==> ^ circumflex accent
+;; @` ==> ` grave accent
+;; @' ==> ' acute accent
+;; @" ==> " umlaut accent
+;; @= ==> = overbar accent
+;; @~ ==> ~ tilde accent
+
+;; These have braces, but take no argument:
+;; @OE{} ==> OE French-OE-ligature
+;; @oe{} ==> oe
+;; @AA{} ==> AA Scandinavian-A-with-circle
+;; @aa{} ==> aa
+;; @AE{} ==> AE Latin-Scandinavian-AE
+;; @ae{} ==> ae
+;; @ss{} ==> ss German-sharp-S
+
+;; @questiondown{} ==> ? upside-down-question-mark
+;; @exclamdown{} ==> ! upside-down-exclamation-mark
+;; @L{} ==> L/ Polish suppressed-L (Lslash)
+;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case)
+;; @O{} ==> O/ Scandinavian O-with-slash
+;; @o{} ==> o/ Scandinavian O-with-slash (lower case)
+
+;; These have braces, and take an argument:
+;; @,{c} ==> c, cedilla accent
+;; @dotaccent{o} ==> .o overdot-accent
+;; @ubaraccent{o} ==> _o underbar-accent
+;; @udotaccent{o} ==> o-. underdot-accent
+;; @H{o} ==> ""o long Hungarian umlaut
+;; @ringaccent{o} ==> *o ring accent
+;; @tieaccent{oo} ==> [oo tie after accent
+;; @u{o} ==> (o breve accent
+;; @v{o} ==> <o hacek accent
+;; @dotless{i} ==> i dotless i and dotless j
+
+;; ==========
+
+;; Note: The defun texinfo-format-scan
+;; looks at "[@{}^'`\",=~ *?!-]"
+;; In the case of @*, a line break is inserted;
+;; in the other cases, the characters are simply quoted and the @ is deleted.
+;; Thus, `texinfo-format-scan' handles the following
+;; single-character accent commands: @^ @` @' @" @, @- @= @~
+
+;; @^ ==> ^ circumflex accent
+;; (put '^ 'texinfo-format 'texinfo-format-circumflex-accent)
+;; (defun texinfo-format-circumflex-accent ()
+;; (texinfo-discard-command)
+;; (insert "^"))
+;;
+;; @` ==> ` grave accent
+;; (put '\` 'texinfo-format 'texinfo-format-grave-accent)
+;; (defun texinfo-format-grave-accent ()
+;; (texinfo-discard-command)
+;; (insert "\`"))
+;;
+;; @' ==> ' acute accent
+;; (put '\' 'texinfo-format 'texinfo-format-acute-accent)
+;; (defun texinfo-format-acute-accent ()
+;; (texinfo-discard-command)
+;; (insert "'"))
+;;
+;; @" ==> " umlaut accent
+;; (put '\" 'texinfo-format 'texinfo-format-umlaut-accent)
+;; (defun texinfo-format-umlaut-accent ()
+;; (texinfo-discard-command)
+;; (insert "\""))
+;;
+;; @= ==> = overbar accent
+;; (put '= 'texinfo-format 'texinfo-format-overbar-accent)
+;; (defun texinfo-format-overbar-accent ()
+;; (texinfo-discard-command)
+;; (insert "="))
+;;
+;; @~ ==> ~ tilde accent
+;; (put '~ 'texinfo-format 'texinfo-format-tilde-accent)
+;; (defun texinfo-format-tilde-accent ()
+;; (texinfo-discard-command)
+;; (insert "~"))
+
+;; @OE{} ==> OE French-OE-ligature
+(put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature)
+(defun texinfo-format-French-OE-ligature ()
+ (insert "OE" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @oe{} ==> oe
+(put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature)
+(defun texinfo-format-French-oe-ligature () ; lower case
+ (insert "oe" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @AA{} ==> AA Scandinavian-A-with-circle
+(put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle)
+(defun texinfo-format-Scandinavian-A-with-circle ()
+ (insert "AA" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @aa{} ==> aa
+(put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle)
+(defun texinfo-format-Scandinavian-a-with-circle () ; lower case
+ (insert "aa" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @AE{} ==> AE Latin-Scandinavian-AE
+(put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE)
+(defun texinfo-format-Latin-Scandinavian-AE ()
+ (insert "AE" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @ae{} ==> ae
+(put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae)
+(defun texinfo-format-Latin-Scandinavian-ae () ; lower case
+ (insert "ae" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @ss{} ==> ss German-sharp-S
+(put 'ss 'texinfo-format 'texinfo-format-German-sharp-S)
+(defun texinfo-format-German-sharp-S ()
+ (insert "ss" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @questiondown{} ==> ? upside-down-question-mark
+(put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark)
+(defun texinfo-format-upside-down-question-mark ()
+ (insert "?" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @exclamdown{} ==> ! upside-down-exclamation-mark
+(put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark)
+(defun texinfo-format-upside-down-exclamation-mark ()
+ (insert "!" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @L{} ==> L/ Polish suppressed-L (Lslash)
+(put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L)
+(defun texinfo-format-Polish-suppressed-L ()
+ (insert (texinfo-parse-arg-discard) "/L")
+ (goto-char texinfo-command-start))
+
+;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case)
+(put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case)
+(defun texinfo-format-Polish-suppressed-l-lower-case ()
+ (insert (texinfo-parse-arg-discard) "/l")
+ (goto-char texinfo-command-start))
+
+
+;; @O{} ==> O/ Scandinavian O-with-slash
+(put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash)
+(defun texinfo-format-Scandinavian-O-with-slash ()
+ (insert (texinfo-parse-arg-discard) "O/")
+ (goto-char texinfo-command-start))
+
+;; @o{} ==> o/ Scandinavian O-with-slash (lower case)
+(put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case)
+(defun texinfo-format-Scandinavian-o-with-slash-lower-case ()
+ (insert (texinfo-parse-arg-discard) "o/")
+ (goto-char texinfo-command-start))
+
+;; Take arguments
+
+;; @,{c} ==> c, cedilla accent
+(put ', 'texinfo-format 'texinfo-format-cedilla-accent)
+(defun texinfo-format-cedilla-accent ()
+ (insert (texinfo-parse-arg-discard) ",")
+ (goto-char texinfo-command-start))
+
+
+;; @dotaccent{o} ==> .o overdot-accent
+(put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent)
+(defun texinfo-format-overdot-accent ()
+ (insert "." (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @ubaraccent{o} ==> _o underbar-accent
+(put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent)
+(defun texinfo-format-underbar-accent ()
+ (insert "_" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @udotaccent{o} ==> o-. underdot-accent
+(put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent)
+(defun texinfo-format-underdot-accent ()
+ (insert (texinfo-parse-arg-discard) "-.")
+ (goto-char texinfo-command-start))
+
+;; @H{o} ==> ""o long Hungarian umlaut
+(put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut)
+(defun texinfo-format-long-Hungarian-umlaut ()
+ (insert "\"\"" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @ringaccent{o} ==> *o ring accent
+(put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent)
+(defun texinfo-format-ring-accent ()
+ (insert "*" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @tieaccent{oo} ==> [oo tie after accent
+(put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent)
+(defun texinfo-format-tie-after-accent ()
+ (insert "[" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+
+;; @u{o} ==> (o breve accent
+(put 'u 'texinfo-format 'texinfo-format-breve-accent)
+(defun texinfo-format-breve-accent ()
+ (insert "(" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @v{o} ==> <o hacek accent
+(put 'v 'texinfo-format 'texinfo-format-hacek-accent)
+(defun texinfo-format-hacek-accent ()
+ (insert "<" (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+
+;; @dotless{i} ==> i dotless i and dotless j
+(put 'dotless 'texinfo-format 'texinfo-format-dotless)
+(defun texinfo-format-dotless ()
+ (insert (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+
+;;; Definition formatting: @deffn, @defun, etc
+
+;; What definition formatting produces:
+;;
+;; @deffn category name args...
+;; In Info, `Category: name ARGS'
+;; In index: name: node. line#.
+;;
+;; @defvr category name
+;; In Info, `Category: name'
+;; In index: name: node. line#.
+;;
+;; @deftp category name attributes...
+;; `category name attributes...' Note: @deftp args in lower case.
+;; In index: name: node. line#.
+;;
+;; Specialized function-like or variable-like entity:
+;;
+;; @defun, @defmac, @defspec, @defvar, @defopt
+;;
+;; @defun name args In Info, `Function: name ARGS'
+;; @defmac name args In Info, `Macro: name ARGS'
+;; @defvar name In Info, `Variable: name'
+;; etc.
+;; In index: name: node. line#.
+;;
+;; Generalized typed-function-like or typed-variable-like entity:
+;; @deftypefn category data-type name args...
+;; In Info, `Category: data-type name args...'
+;; @deftypevr category data-type name
+;; In Info, `Category: data-type name'
+;; In index: name: node. line#.
+;;
+;; Specialized typed-function-like or typed-variable-like entity:
+;; @deftypefun data-type name args...
+;; In Info, `Function: data-type name ARGS'
+;; In index: name: node. line#.
+;;
+;; @deftypevar data-type name
+;; In Info, `Variable: data-type name'
+;; In index: name: node. line#. but include args after name!?
+;;
+;; Generalized object oriented entity:
+;; @defop category class name args...
+;; In Info, `Category on class: name ARG'
+;; In index: name on class: node. line#.
+;;
+;; @defcv category class name
+;; In Info, `Category of class: name'
+;; In index: name of class: node. line#.
+;;
+;; Specialized object oriented entity:
+;; @defmethod class name args...
+;; In Info, `Method on class: name ARGS'
+;; In index: name on class: node. line#.
+;;
+;; @defivar class name
+;; In Info, `Instance variable of class: name'
+;; In index: name of class: node. line#.
+
+
+;;; The definition formatting functions
+
+(defun texinfo-format-defun ()
+ (texinfo-push-stack 'defun nil)
+ (setq fill-column (- fill-column 5))
+ (texinfo-format-defun-1 t))
+
+(defun texinfo-end-defun ()
+ (setq fill-column (+ fill-column 5))
+ (texinfo-discard-command)
+ (let ((start (nth 1 (texinfo-pop-stack 'defun))))
+ (texinfo-do-itemize start)
+ ;; Delete extra newline inserted after header.
+ (save-excursion
+ (goto-char start)
+ (delete-char -1))))
+
+(defun texinfo-format-defunx ()
+ (texinfo-format-defun-1 nil))
+
+(defun texinfo-format-defun-1 (first-p)
+ (let ((parse-args (texinfo-format-parse-defun-args))
+ (texinfo-defun-type (get texinfo-command-name 'texinfo-defun-type)))
+ (texinfo-discard-command)
+ ;; Delete extra newline inserted after previous header line.
+ (if (not first-p)
+ (delete-char -1))
+ (funcall
+ (get texinfo-command-name 'texinfo-deffn-formatting-property) parse-args)
+ ;; Insert extra newline so that paragraph filling does not mess
+ ;; with header line.
+ (insert "\n\n")
+ (rplaca (cdr (cdr (car texinfo-stack))) (point))
+ (funcall
+ (get texinfo-command-name 'texinfo-defun-indexing-property) parse-args)))
+
+;;; Formatting the first line of a definition
+
+;; @deffn, @defvr, @deftp
+(put 'deffn 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(put 'deffnx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(put 'defvr 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(put 'defvrx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(put 'deftp 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(put 'deftpx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
+(defun texinfo-format-deffn (parsed-args)
+ ;; Generalized function-like, variable-like, or generic data-type entity:
+ ;; @deffn category name args...
+ ;; In Info, `Category: name ARGS'
+ ;; @deftp category name attributes...
+ ;; `category name attributes...' Note: @deftp args in lower case.
+ (let ((category (car parsed-args))
+ (name (car (cdr parsed-args)))
+ (args (cdr (cdr parsed-args))))
+ (insert " -- " category ": " name)
+ (while args
+ (insert " "
+ (if (or (= ?& (aref (car args) 0))
+ (eq (eval (car texinfo-defun-type)) 'deftp-type))
+ (car args)
+ (upcase (car args))))
+ (setq args (cdr args)))))
+
+;; @defun, @defmac, @defspec, @defvar, @defopt: Specialized, simple
+(put 'defun 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defunx 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defmac 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defmacx 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defspec 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defspecx 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defvar 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defvarx 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defopt 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(put 'defoptx 'texinfo-deffn-formatting-property
+ 'texinfo-format-specialized-defun)
+(defun texinfo-format-specialized-defun (parsed-args)
+ ;; Specialized function-like or variable-like entity:
+ ;; @defun name args In Info, `Function: Name ARGS'
+ ;; @defmac name args In Info, `Macro: Name ARGS'
+ ;; @defvar name In Info, `Variable: Name'
+ ;; Use cdr of texinfo-defun-type to determine category:
+ (let ((category (car (cdr texinfo-defun-type)))
+ (name (car parsed-args))
+ (args (cdr parsed-args)))
+ (insert " -- " category ": " name)
+ (while args
+ (insert " "
+ (if (= ?& (aref (car args) 0))
+ (car args)
+ (upcase (car args))))
+ (setq args (cdr args)))))
+
+;; @deftypefn, @deftypevr: Generalized typed
+(put 'deftypefn 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
+(put 'deftypefnx 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
+(put 'deftypevr 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
+(put 'deftypevrx 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
+(defun texinfo-format-deftypefn (parsed-args)
+ ;; Generalized typed-function-like or typed-variable-like entity:
+ ;; @deftypefn category data-type name args...
+ ;; In Info, `Category: data-type name args...'
+ ;; @deftypevr category data-type name
+ ;; In Info, `Category: data-type name'
+ ;; Note: args in lower case, unless modified in command line.
+ (let ((category (car parsed-args))
+ (data-type (car (cdr parsed-args)))
+ (name (car (cdr (cdr parsed-args))))
+ (args (cdr (cdr (cdr parsed-args)))))
+ (insert " -- " category ": " data-type " " name)
+ (while args
+ (insert " " (car args))
+ (setq args (cdr args)))))
+
+;; @deftypefun, @deftypevar: Specialized typed
+(put 'deftypefun 'texinfo-deffn-formatting-property 'texinfo-format-deftypefun)
+(put 'deftypefunx 'texinfo-deffn-formatting-property
+ 'texinfo-format-deftypefun)
+(put 'deftypevar 'texinfo-deffn-formatting-property 'texinfo-format-deftypefun)
+(put 'deftypevarx 'texinfo-deffn-formatting-property
+ 'texinfo-format-deftypefun)
+(defun texinfo-format-deftypefun (parsed-args)
+ ;; Specialized typed-function-like or typed-variable-like entity:
+ ;; @deftypefun data-type name args...
+ ;; In Info, `Function: data-type name ARGS'
+ ;; @deftypevar data-type name
+ ;; In Info, `Variable: data-type name'
+ ;; Note: args in lower case, unless modified in command line.
+ ;; Use cdr of texinfo-defun-type to determine category:
+ (let ((category (car (cdr texinfo-defun-type)))
+ (data-type (car parsed-args))
+ (name (car (cdr parsed-args)))
+ (args (cdr (cdr parsed-args))))
+ (insert " -- " category ": " data-type " " name)
+ (while args
+ (insert " " (car args))
+ (setq args (cdr args)))))
+
+;; @defop: Generalized object-oriented
+(put 'defop 'texinfo-deffn-formatting-property 'texinfo-format-defop)
+(put 'defopx 'texinfo-deffn-formatting-property 'texinfo-format-defop)
+(defun texinfo-format-defop (parsed-args)
+ ;; Generalized object oriented entity:
+ ;; @defop category class name args...
+ ;; In Info, `Category on class: name ARG'
+ ;; Note: args in upper case; use of `on'
+ (let ((category (car parsed-args))
+ (class (car (cdr parsed-args)))
+ (name (car (cdr (cdr parsed-args))))
+ (args (cdr (cdr (cdr parsed-args)))))
+ (insert " -- " category " on " class ": " name)
+ (while args
+ (insert " " (upcase (car args)))
+ (setq args (cdr args)))))
+
+;; @defcv: Generalized object-oriented
+(put 'defcv 'texinfo-deffn-formatting-property 'texinfo-format-defcv)
+(put 'defcvx 'texinfo-deffn-formatting-property 'texinfo-format-defcv)
+(defun texinfo-format-defcv (parsed-args)
+ ;; Generalized object oriented entity:
+ ;; @defcv category class name
+ ;; In Info, `Category of class: name'
+ ;; Note: args in upper case; use of `of'
+ (let ((category (car parsed-args))
+ (class (car (cdr parsed-args)))
+ (name (car (cdr (cdr parsed-args))))
+ (args (cdr (cdr (cdr parsed-args)))))
+ (insert " -- " category " of " class ": " name)
+ (while args
+ (insert " " (upcase (car args)))
+ (setq args (cdr args)))))
+
+;; @defmethod: Specialized object-oriented
+(put 'defmethod 'texinfo-deffn-formatting-property 'texinfo-format-defmethod)
+(put 'defmethodx 'texinfo-deffn-formatting-property 'texinfo-format-defmethod)
+(defun texinfo-format-defmethod (parsed-args)
+ ;; Specialized object oriented entity:
+ ;; @defmethod class name args...
+ ;; In Info, `Method on class: name ARGS'
+ ;; Note: args in upper case; use of `on'
+ ;; Use cdr of texinfo-defun-type to determine category:
+ (let ((category (car (cdr texinfo-defun-type)))
+ (class (car parsed-args))
+ (name (car (cdr parsed-args)))
+ (args (cdr (cdr parsed-args))))
+ (insert " -- " category " on " class ": " name)
+ (while args
+ (insert " " (upcase (car args)))
+ (setq args (cdr args)))))
+
+;; @defivar: Specialized object-oriented
+(put 'defivar 'texinfo-deffn-formatting-property 'texinfo-format-defivar)
+(put 'defivarx 'texinfo-deffn-formatting-property 'texinfo-format-defivar)
+(defun texinfo-format-defivar (parsed-args)
+ ;; Specialized object oriented entity:
+ ;; @defivar class name
+ ;; In Info, `Instance variable of class: name'
+ ;; Note: args in upper case; use of `of'
+ ;; Use cdr of texinfo-defun-type to determine category:
+ (let ((category (car (cdr texinfo-defun-type)))
+ (class (car parsed-args))
+ (name (car (cdr parsed-args)))
+ (args (cdr (cdr parsed-args))))
+ (insert " -- " category " of " class ": " name)
+ (while args
+ (insert " " (upcase (car args)))
+ (setq args (cdr args)))))
+
+
+;;; Indexing for definitions
+
+;; An index entry has three parts: the `entry proper', the node name, and the
+;; line number. Depending on the which command is used, the entry is
+;; formatted differently:
+;;
+;; @defun,
+;; @defmac,
+;; @defspec,
+;; @defvar,
+;; @defopt all use their 1st argument as the entry-proper
+;;
+;; @deffn,
+;; @defvr,
+;; @deftp
+;; @deftypefun
+;; @deftypevar all use their 2nd argument as the entry-proper
+;;
+;; @deftypefn,
+;; @deftypevr both use their 3rd argument as the entry-proper
+;;
+;; @defmethod uses its 2nd and 1st arguments as an entry-proper
+;; formatted: NAME on CLASS
+
+;; @defop uses its 3rd and 2nd arguments as an entry-proper
+;; formatted: NAME on CLASS
+;;
+;; @defivar uses its 2nd and 1st arguments as an entry-proper
+;; formatted: NAME of CLASS
+;;
+;; @defcv uses its 3rd and 2nd argument as an entry-proper
+;; formatted: NAME of CLASS
+
+(put 'defun 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defunx 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defmac 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defmacx 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defspec 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defspecx 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defvar 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defvarx 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defopt 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(put 'defoptx 'texinfo-defun-indexing-property 'texinfo-index-defun)
+(defun texinfo-index-defun (parsed-args)
+ ;; use 1st parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (car parsed-args)
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'deffn 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deffnx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'defvr 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'defvrx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftp 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftpx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftypefun 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftypefunx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftypevar 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(put 'deftypevarx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
+(defun texinfo-index-deffn (parsed-args)
+ ;; use 2nd parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (car (cdr parsed-args))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'deftypefn 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
+(put 'deftypefnx 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
+(put 'deftypevr 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
+(put 'deftypevrx 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
+(defun texinfo-index-deftypefn (parsed-args)
+ ;; use 3rd parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (car (cdr (cdr parsed-args)))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'defmethod 'texinfo-defun-indexing-property 'texinfo-index-defmethod)
+(put 'defmethodx 'texinfo-defun-indexing-property 'texinfo-index-defmethod)
+(defun texinfo-index-defmethod (parsed-args)
+ ;; use 2nd on 1st parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (format "%s on %s"
+ (car (cdr parsed-args))
+ (car parsed-args))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'defop 'texinfo-defun-indexing-property 'texinfo-index-defop)
+(put 'defopx 'texinfo-defun-indexing-property 'texinfo-index-defop)
+(defun texinfo-index-defop (parsed-args)
+ ;; use 3rd on 2nd parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (format "%s on %s"
+ (car (cdr (cdr parsed-args)))
+ (car (cdr parsed-args)))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'defivar 'texinfo-defun-indexing-property 'texinfo-index-defivar)
+(put 'defivarx 'texinfo-defun-indexing-property 'texinfo-index-defivar)
+(defun texinfo-index-defivar (parsed-args)
+ ;; use 2nd of 1st parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (format "%s of %s"
+ (car (cdr parsed-args))
+ (car parsed-args))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+(put 'defcv 'texinfo-defun-indexing-property 'texinfo-index-defcv)
+(put 'defcvx 'texinfo-defun-indexing-property 'texinfo-index-defcv)
+(defun texinfo-index-defcv (parsed-args)
+ ;; use 3rd of 2nd parsed-arg as entry-proper
+ ;; `index-list' will be texinfo-findex or the like
+ (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
+ (set index-list
+ (cons
+ ;; Three elements: entry-proper, node-name, line-number
+ (list
+ (format "%s of %s"
+ (car (cdr (cdr parsed-args)))
+ (car (cdr parsed-args)))
+ texinfo-last-node
+ ;; Region formatting may not provide last node position.
+ (if texinfo-last-node-pos
+ (1+ (count-lines texinfo-last-node-pos (point)))
+ 1))
+ (symbol-value index-list)))))
+
+
+;;; Properties for definitions
+
+;; Each definition command has six properties:
+;;
+;; 1. texinfo-deffn-formatting-property to format definition line
+;; 2. texinfo-defun-indexing-property to create index entry
+;; 3. texinfo-format formatting command
+;; 4. texinfo-end end formatting command
+;; 5. texinfo-defun-type type of deffn to format
+;; 6. texinfo-defun-index type of index to use
+;;
+;; The `x' forms of each definition command are used for the second
+;; and subsequent header lines.
+
+;; The texinfo-deffn-formatting-property and texinfo-defun-indexing-property
+;; are listed just before the appropriate formatting and indexing commands.
+
+(put 'deffn 'texinfo-format 'texinfo-format-defun)
+(put 'deffnx 'texinfo-format 'texinfo-format-defunx)
+(put 'deffn 'texinfo-end 'texinfo-end-defun)
+(put 'deffn 'texinfo-defun-type '('deffn-type nil))
+(put 'deffnx 'texinfo-defun-type '('deffn-type nil))
+(put 'deffn 'texinfo-defun-index 'texinfo-findex)
+(put 'deffnx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defun 'texinfo-format 'texinfo-format-defun)
+(put 'defunx 'texinfo-format 'texinfo-format-defunx)
+(put 'defun 'texinfo-end 'texinfo-end-defun)
+(put 'defun 'texinfo-defun-type '('defun-type "Function"))
+(put 'defunx 'texinfo-defun-type '('defun-type "Function"))
+(put 'defun 'texinfo-defun-index 'texinfo-findex)
+(put 'defunx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defmac 'texinfo-format 'texinfo-format-defun)
+(put 'defmacx 'texinfo-format 'texinfo-format-defunx)
+(put 'defmac 'texinfo-end 'texinfo-end-defun)
+(put 'defmac 'texinfo-defun-type '('defun-type "Macro"))
+(put 'defmacx 'texinfo-defun-type '('defun-type "Macro"))
+(put 'defmac 'texinfo-defun-index 'texinfo-findex)
+(put 'defmacx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defspec 'texinfo-format 'texinfo-format-defun)
+(put 'defspecx 'texinfo-format 'texinfo-format-defunx)
+(put 'defspec 'texinfo-end 'texinfo-end-defun)
+(put 'defspec 'texinfo-defun-type '('defun-type "Special form"))
+(put 'defspecx 'texinfo-defun-type '('defun-type "Special form"))
+(put 'defspec 'texinfo-defun-index 'texinfo-findex)
+(put 'defspecx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defvr 'texinfo-format 'texinfo-format-defun)
+(put 'defvrx 'texinfo-format 'texinfo-format-defunx)
+(put 'defvr 'texinfo-end 'texinfo-end-defun)
+(put 'defvr 'texinfo-defun-type '('deffn-type nil))
+(put 'defvrx 'texinfo-defun-type '('deffn-type nil))
+(put 'defvr 'texinfo-defun-index 'texinfo-vindex)
+(put 'defvrx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'defvar 'texinfo-format 'texinfo-format-defun)
+(put 'defvarx 'texinfo-format 'texinfo-format-defunx)
+(put 'defvar 'texinfo-end 'texinfo-end-defun)
+(put 'defvar 'texinfo-defun-type '('defun-type "Variable"))
+(put 'defvarx 'texinfo-defun-type '('defun-type "Variable"))
+(put 'defvar 'texinfo-defun-index 'texinfo-vindex)
+(put 'defvarx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'defconst 'texinfo-format 'texinfo-format-defun)
+(put 'defconstx 'texinfo-format 'texinfo-format-defunx)
+(put 'defconst 'texinfo-end 'texinfo-end-defun)
+(put 'defconst 'texinfo-defun-type '('defun-type "Constant"))
+(put 'defconstx 'texinfo-defun-type '('defun-type "Constant"))
+(put 'defconst 'texinfo-defun-index 'texinfo-vindex)
+(put 'defconstx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'defcmd 'texinfo-format 'texinfo-format-defun)
+(put 'defcmdx 'texinfo-format 'texinfo-format-defunx)
+(put 'defcmd 'texinfo-end 'texinfo-end-defun)
+(put 'defcmd 'texinfo-defun-type '('defun-type "Command"))
+(put 'defcmdx 'texinfo-defun-type '('defun-type "Command"))
+(put 'defcmd 'texinfo-defun-index 'texinfo-findex)
+(put 'defcmdx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defopt 'texinfo-format 'texinfo-format-defun)
+(put 'defoptx 'texinfo-format 'texinfo-format-defunx)
+(put 'defopt 'texinfo-end 'texinfo-end-defun)
+(put 'defopt 'texinfo-defun-type '('defun-type "User Option"))
+(put 'defoptx 'texinfo-defun-type '('defun-type "User Option"))
+(put 'defopt 'texinfo-defun-index 'texinfo-vindex)
+(put 'defoptx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'deftp 'texinfo-format 'texinfo-format-defun)
+(put 'deftpx 'texinfo-format 'texinfo-format-defunx)
+(put 'deftp 'texinfo-end 'texinfo-end-defun)
+(put 'deftp 'texinfo-defun-type '('deftp-type nil))
+(put 'deftpx 'texinfo-defun-type '('deftp-type nil))
+(put 'deftp 'texinfo-defun-index 'texinfo-tindex)
+(put 'deftpx 'texinfo-defun-index 'texinfo-tindex)
+
+;;; Object-oriented stuff is a little hairier.
+
+(put 'defop 'texinfo-format 'texinfo-format-defun)
+(put 'defopx 'texinfo-format 'texinfo-format-defunx)
+(put 'defop 'texinfo-end 'texinfo-end-defun)
+(put 'defop 'texinfo-defun-type '('defop-type nil))
+(put 'defopx 'texinfo-defun-type '('defop-type nil))
+(put 'defop 'texinfo-defun-index 'texinfo-findex)
+(put 'defopx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defmethod 'texinfo-format 'texinfo-format-defun)
+(put 'defmethodx 'texinfo-format 'texinfo-format-defunx)
+(put 'defmethod 'texinfo-end 'texinfo-end-defun)
+(put 'defmethod 'texinfo-defun-type '('defmethod-type "Method"))
+(put 'defmethodx 'texinfo-defun-type '('defmethod-type "Method"))
+(put 'defmethod 'texinfo-defun-index 'texinfo-findex)
+(put 'defmethodx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'defcv 'texinfo-format 'texinfo-format-defun)
+(put 'defcvx 'texinfo-format 'texinfo-format-defunx)
+(put 'defcv 'texinfo-end 'texinfo-end-defun)
+(put 'defcv 'texinfo-defun-type '('defop-type nil))
+(put 'defcvx 'texinfo-defun-type '('defop-type nil))
+(put 'defcv 'texinfo-defun-index 'texinfo-vindex)
+(put 'defcvx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'defivar 'texinfo-format 'texinfo-format-defun)
+(put 'defivarx 'texinfo-format 'texinfo-format-defunx)
+(put 'defivar 'texinfo-end 'texinfo-end-defun)
+(put 'defivar 'texinfo-defun-type '('defmethod-type "Instance variable"))
+(put 'defivarx 'texinfo-defun-type '('defmethod-type "Instance variable"))
+(put 'defivar 'texinfo-defun-index 'texinfo-vindex)
+(put 'defivarx 'texinfo-defun-index 'texinfo-vindex)
+
+;;; Typed functions and variables
+
+(put 'deftypefn 'texinfo-format 'texinfo-format-defun)
+(put 'deftypefnx 'texinfo-format 'texinfo-format-defunx)
+(put 'deftypefn 'texinfo-end 'texinfo-end-defun)
+(put 'deftypefn 'texinfo-defun-type '('deftypefn-type nil))
+(put 'deftypefnx 'texinfo-defun-type '('deftypefn-type nil))
+(put 'deftypefn 'texinfo-defun-index 'texinfo-findex)
+(put 'deftypefnx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'deftypefun 'texinfo-format 'texinfo-format-defun)
+(put 'deftypefunx 'texinfo-format 'texinfo-format-defunx)
+(put 'deftypefun 'texinfo-end 'texinfo-end-defun)
+(put 'deftypefun 'texinfo-defun-type '('deftypefun-type "Function"))
+(put 'deftypefunx 'texinfo-defun-type '('deftypefun-type "Function"))
+(put 'deftypefun 'texinfo-defun-index 'texinfo-findex)
+(put 'deftypefunx 'texinfo-defun-index 'texinfo-findex)
+
+(put 'deftypevr 'texinfo-format 'texinfo-format-defun)
+(put 'deftypevrx 'texinfo-format 'texinfo-format-defunx)
+(put 'deftypevr 'texinfo-end 'texinfo-end-defun)
+(put 'deftypevr 'texinfo-defun-type '('deftypefn-type nil))
+(put 'deftypevrx 'texinfo-defun-type '('deftypefn-type nil))
+(put 'deftypevr 'texinfo-defun-index 'texinfo-vindex)
+(put 'deftypevrx 'texinfo-defun-index 'texinfo-vindex)
+
+(put 'deftypevar 'texinfo-format 'texinfo-format-defun)
+(put 'deftypevarx 'texinfo-format 'texinfo-format-defunx)
+(put 'deftypevar 'texinfo-end 'texinfo-end-defun)
+(put 'deftypevar 'texinfo-defun-type '('deftypevar-type "Variable"))
+(put 'deftypevarx 'texinfo-defun-type '('deftypevar-type "Variable"))
+(put 'deftypevar 'texinfo-defun-index 'texinfo-vindex)
+(put 'deftypevarx 'texinfo-defun-index 'texinfo-vindex)
+
+
+;;; @set, @clear, @ifset, @ifclear
+
+;; If a flag is set with @set FLAG, then text between @ifset and @end
+;; ifset is formatted normally, but if the flag is is cleared with
+;; @clear FLAG, then the text is not formatted; it is ignored.
+
+;; If a flag is cleared with @clear FLAG, then text between @ifclear
+;; and @end ifclear is formatted normally, but if the flag is is set with
+;; @set FLAG, then the text is not formatted; it is ignored. @ifclear
+;; is the opposite of @ifset.
+
+;; If a flag is set to a string with @set FLAG,
+;; replace @value{FLAG} with the string.
+;; If a flag with a value is cleared,
+;; @value{FLAG} is invalid,
+;; as if there had never been any @set FLAG previously.
+
+(put 'clear 'texinfo-format 'texinfo-clear)
+(defun texinfo-clear ()
+ "Clear the value of the flag."
+ (let* ((arg (texinfo-parse-arg-discard))
+ (flag (car (read-from-string arg)))
+ (value (substring arg (cdr (read-from-string arg)))))
+ (put flag 'texinfo-whether-setp 'flag-cleared)
+ (put flag 'texinfo-set-value "")))
+
+(put 'set 'texinfo-format 'texinfo-set)
+(defun texinfo-set ()
+ "Set the value of the flag, optionally to a string.
+The command `@set foo This is a string.'
+sets flag foo to the value: `This is a string.'
+The command `@value{foo}' expands to the value."
+ (let* ((arg (texinfo-parse-arg-discard))
+ (flag (car (read-from-string arg)))
+ (value (substring arg (cdr (read-from-string arg)))))
+ (put flag 'texinfo-whether-setp 'flag-set)
+ (put flag 'texinfo-set-value value)))
+
+(put 'value 'texinfo-format 'texinfo-value)
+(defun texinfo-value ()
+ "Insert the string to which the flag is set.
+The command `@set foo This is a string.'
+sets flag foo to the value: `This is a string.'
+The command `@value{foo}' expands to the value."
+ (let ((arg (texinfo-parse-arg-discard)))
+ (cond ((and
+ (eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-set)
+ (get (car (read-from-string arg)) 'texinfo-set-value))
+ (insert (get (car (read-from-string arg)) 'texinfo-set-value)))
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-cleared)
+ (insert (format "{No value for \"%s\"}" arg)))
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) nil)
+ (insert (format "{No value for \"%s\"}" arg))))))
+
+(put 'ifset 'texinfo-end 'texinfo-discard-command)
+(put 'ifset 'texinfo-format 'texinfo-if-set)
+(defun texinfo-if-set ()
+ "If set, continue formatting; else do not format region up to @end ifset"
+ (let ((arg (texinfo-parse-arg-discard)))
+ (cond
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-set)
+ ;; Format the text (i.e., do not remove it); do nothing here.
+ ())
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-cleared)
+ ;; Clear region (i.e., cause the text to be ignored).
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end ifset[ \t]*\n")
+ (point))))
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ nil)
+ ;; In this case flag is neither set nor cleared.
+ ;; Act as if set, i.e. do nothing.
+ ()))))
+
+(put 'ifclear 'texinfo-end 'texinfo-discard-command)
+(put 'ifclear 'texinfo-format 'texinfo-if-clear)
+(defun texinfo-if-clear ()
+ "If clear, continue formatting; if set, do not format up to @end ifset"
+ (let ((arg (texinfo-parse-arg-discard)))
+ (cond
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-set)
+ ;; Clear region (i.e., cause the text to be ignored).
+ (delete-region texinfo-command-start
+ (progn (re-search-forward "@end ifclear[ \t]*\n")
+ (point))))
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ 'flag-cleared)
+ ;; Format the text (i.e., do not remove it); do nothing here.
+ ())
+ ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
+ nil)
+ ;; In this case flag is neither set nor cleared.
+ ;; Act as if clear, i.e. do nothing.
+ ()))))
+
+
+;;; @ifeq
+
+(put 'ifeq 'texinfo-format 'texinfo-format-ifeq)
+(defun texinfo-format-ifeq ()
+ "If ARG1 and ARG2 caselessly string compare to same string, performs COMMAND.
+Otherwise produces no output.
+
+Thus:
+ @ifeq{ arg1 , arg1 , @code{foo}} bar
+
+ ==> `foo' bar.
+but
+ @ifeq{ arg1 , arg2 , @code{foo}} bar
+
+ ==> bar
+
+Note that the Texinfo command and its arguments must be arguments to
+the @ifeq command."
+ ;; compare-buffer-substrings does not exist in version 18; don't use
+ (goto-char texinfo-command-end)
+ (let* ((case-fold-search t)
+ (stop (save-excursion (forward-sexp 1) (point)))
+ start end
+ ;; @ifeq{arg1, arg2, @command{optional-args}}
+ (arg1
+ (progn
+ (forward-char 1)
+ (skip-chars-forward " ")
+ (setq start (point))
+ (search-forward "," stop t)
+ (skip-chars-backward ", ")
+ (buffer-substring start (point))))
+ (arg2
+ (progn
+ (search-forward "," stop t)
+ (skip-chars-forward " ")
+ (setq start (point))
+ (search-forward "," stop t)
+ (skip-chars-backward ", ")
+ (buffer-substring start (point))))
+ (texinfo-command
+ (progn
+ (search-forward "," stop t)
+ (skip-chars-forward " ")
+ (setq start (point))
+ (goto-char (1- stop))
+ (skip-chars-backward " ")
+ (buffer-substring start (point)))))
+ (delete-region texinfo-command-start stop)
+ (if (equal arg1 arg2)
+ (insert texinfo-command))
+ (goto-char texinfo-command-start)))
+
+
+;;; Process included files: `@include' command
+
+;; Updated 19 October 1990
+;; In the original version, include files were ignored by Info but
+;; incorporated in to the printed manual. To make references to the
+;; included file, the Texinfo source file has to refer to the included
+;; files using the `(filename)nodename' format for referring to other
+;; Info files. Also, the included files had to be formatted on their
+;; own. It was just like they were another file.
+
+;; Currently, include files are inserted into the buffer that is
+;; formatted for Info. If large, the resulting info file is split and
+;; tagified. For current include files to work, the master menu must
+;; refer to all the nodes, and the highest level nodes in the include
+;; files must have the correct next, prev, and up pointers.
+
+;; The included file may have an @setfilename and even an @settitle,
+;; but not an `\input texinfo' line.
+
+;; Updated 24 March 1993
+;; In order for @raisesections and @lowersections to work, included
+;; files must be inserted into the buffer holding the outer file
+;; before other Info formatting takes place. So @include is no longer
+;; is treated like other @-commands.
+(put 'include 'texinfo-format 'texinfo-format-noop)
+
+;; Original definition:
+;; (defun texinfo-format-include ()
+;; (let ((filename (texinfo-parse-arg-discard))
+;; (default-directory input-directory)
+;; subindex)
+;; (setq subindex
+;; (save-excursion
+;; (progn (find-file
+;; (cond ((file-readable-p (concat filename ".texinfo"))
+;; (concat filename ".texinfo"))
+;; ((file-readable-p (concat filename ".texi"))
+;; (concat filename ".texi"))
+;; ((file-readable-p (concat filename ".tex"))
+;; (concat filename ".tex"))
+;; ((file-readable-p filename)
+;; filename)
+;; (t (error "@include'd file %s not found"
+;; filename))))
+;; (texinfo-format-buffer-1))))
+;; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex))
+;; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex))
+;; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex))
+;; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex))
+;; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex))
+;; (texinfo-subindex 'texinfo-kindex (car subindex) (nth 6 subindex))))
+;;
+;;(defun texinfo-subindex (indexvar file content)
+;; (set indexvar (cons (list 'recurse file content)
+;; (symbol-value indexvar))))
+
+;; Second definition:
+;; (put 'include 'texinfo-format 'texinfo-format-include)
+;; (defun texinfo-format-include ()
+;; (let ((filename (concat input-directory
+;; (texinfo-parse-arg-discard)))
+;; (default-directory input-directory))
+;; (message "Reading: %s" filename)
+;; (save-excursion
+;; (save-restriction
+;; (narrow-to-region
+;; (point)
+;; (+ (point) (car (cdr (insert-file-contents filename)))))
+;; (goto-char (point-min))
+;; (texinfo-append-refill)
+;; (texinfo-format-convert (point-min) (point-max))))
+;; (setq last-input-buffer input-buffer) ; to bypass setfilename
+;; ))
+
+
+;;; Numerous commands do nothing in Info
+;; These commands are defined in texinfo.tex for printed output.
+
+
+;;; various noops, such as @b{foo}, that take arguments in braces
+
+(put 'b 'texinfo-format 'texinfo-format-noop)
+(put 'i 'texinfo-format 'texinfo-format-noop)
+(put 'r 'texinfo-format 'texinfo-format-noop)
+(put 't 'texinfo-format 'texinfo-format-noop)
+(put 'w 'texinfo-format 'texinfo-format-noop)
+(put 'asis 'texinfo-format 'texinfo-format-noop)
+(put 'dmn 'texinfo-format 'texinfo-format-noop)
+(put 'math 'texinfo-format 'texinfo-format-noop)
+(put 'titlefont 'texinfo-format 'texinfo-format-noop)
+(defun texinfo-format-noop ()
+ (insert (texinfo-parse-arg-discard))
+ (goto-char texinfo-command-start))
+
+;; @hyphenation command discards an argument within braces
+(put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg)
+(defun texinfo-discard-command-and-arg ()
+ "Discard both @-command and its argument in braces."
+ (goto-char texinfo-command-end)
+ (forward-list 1)
+ (setq texinfo-command-end (point))
+ (delete-region texinfo-command-start texinfo-command-end))
+
+
+;;; Do nothing commands, such as @smallbook, that have no args and no braces
+;; These must appear on a line of their own
+
+(put 'bye 'texinfo-format 'texinfo-discard-line)
+(put 'smallbook 'texinfo-format 'texinfo-discard-line)
+(put 'finalout 'texinfo-format 'texinfo-discard-line)
+(put 'overfullrule 'texinfo-format 'texinfo-discard-line)
+(put 'smallbreak 'texinfo-format 'texinfo-discard-line)
+(put 'medbreak 'texinfo-format 'texinfo-discard-line)
+(put 'bigbreak 'texinfo-format 'texinfo-discard-line)
+
+
+;;; These noop commands discard the rest of the line.
+
+(put 'c 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'comment 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'contents 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'group 'texinfo-end 'texinfo-discard-line-with-args)
+(put 'group 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'headings 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'setchapterstyle 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'hsize 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'itemindent 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'lispnarrowing 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'need 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'nopara 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'page 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'parindent 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'setq 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'settitle 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'setx 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'shortcontents 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'shorttitlepage 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'input 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'dircategory 'texinfo-format 'texinfo-discard-line-with-args)
+
+
+;;; Some commands cannot be handled
+
+(defun texinfo-unsupported ()
+ (error "%s is not handled by texinfo"
+ (buffer-substring texinfo-command-start texinfo-command-end)))
+
+;;; Batch formatting
+
+(defun batch-texinfo-format ()
+ "Runs texinfo-format-buffer on the files remaining on the command line.
+Must be used only with -batch, and kills emacs on completion.
+Each file will be processed even if an error occurred previously.
+For example, invoke
+ \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"."
+ (if (not noninteractive)
+ (error "batch-texinfo-format may only be used -batch."))
+ (let ((version-control t)
+ (auto-save-default nil)
+ (find-file-run-dired nil)
+ (kept-old-versions 259259)
+ (kept-new-versions 259259))
+ (let ((error 0)
+ file
+ (files ()))
+ (while command-line-args-left
+ (setq file (expand-file-name (car command-line-args-left)))
+ (cond ((not (file-exists-p file))
+ (message ">> %s does not exist!" file)
+ (setq error 1
+ command-line-args-left (cdr command-line-args-left)))
+ ((file-directory-p file)
+ (setq command-line-args-left
+ (nconc (directory-files file)
+ (cdr command-line-args-left))))
+ (t
+ (setq files (cons file files)
+ command-line-args-left (cdr command-line-args-left)))))
+ (while files
+ (setq file (car files)
+ files (cdr files))
+ (condition-case err
+ (progn
+ (if buffer-file-name (kill-buffer (current-buffer)))
+ (find-file file)
+ (buffer-disable-undo (current-buffer))
+ (set-buffer-modified-p nil)
+ (texinfo-mode)
+ (message "texinfo formatting %s..." file)
+ (texinfo-format-buffer nil)
+ (if (buffer-modified-p)
+ (progn (message "Saving modified %s" (buffer-file-name))
+ (save-buffer))))
+ (error
+ (message ">> Error: %s" (prin1-to-string err))
+ (message ">> point at")
+ (let ((s (buffer-substring (point)
+ (min (+ (point) 100)
+ (point-max))))
+ (tem 0))
+ (while (setq tem (string-match "\n+" s tem))
+ (setq s (concat (substring s 0 (match-beginning 0))
+ "\n>> "
+ (substring s (match-end 0)))
+ tem (1+ tem)))
+ (message ">> %s" s))
+ (setq error 1))))
+ (kill-emacs error))))
+
+
+;;; Place `provide' at end of file.
+(provide 'texinfmt)
+
+;;; texinfmt.el ends here.
diff --git a/contrib/texinfo/emacs/texinfo.el b/contrib/texinfo/emacs/texinfo.el
new file mode 100644
index 000000000000..0a1ab13401ea
--- /dev/null
+++ b/contrib/texinfo/emacs/texinfo.el
@@ -0,0 +1,932 @@
+;;; texinfo.el--major mode for editing Texinfo files.
+
+;; Copyright (C) 1985, '88, '89, '90, '91,
+;; '92, '93, '96 Free Software Foundation, Inc.
+
+;; Author: Robert J. Chassell
+;; Date: 6 Sep 1996
+;; Maintainer: bug-texinfo@prep.ai.mit.edu
+;; Keywords: maint, tex, docs
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+
+;;; Autoloads:
+
+(autoload 'makeinfo-region
+ "makeinfo"
+ "Make Info file from region of current Texinfo file, and switch to it.
+
+This command does not offer the `next-error' feature since it would
+apply to a temporary file, not the original; use the `makeinfo-buffer'
+command to gain use of `next-error'."
+ t nil)
+
+(autoload 'makeinfo-buffer
+ "makeinfo"
+ "Make Info file from current buffer.
+
+Use the \\[next-error] command to move to the next error
+\(if there are errors\)."
+ t nil)
+
+(autoload 'kill-compilation
+ "compile"
+ "Kill the process made by the \\[compile] command."
+ t nil)
+
+(autoload 'makeinfo-recenter-compilation-buffer
+ "makeinfo"
+ "Redisplay `*compilation*' buffer so most recent output can be seen.
+The last line of the buffer is displayed on
+line LINE of the window, or centered if LINE is nil."
+ t nil)
+
+(autoload 'texinfo-update-node
+ "texnfo-upd"
+ "Without any prefix argument, update the node in which point is located.
+Non-nil argument (prefix, if interactive) means update the nodes in the
+marked region.
+
+The functions for creating or updating nodes and menus, and their
+keybindings, are:
+
+ texinfo-update-node (&optional region-p) \\[texinfo-update-node]
+ texinfo-every-node-update () \\[texinfo-every-node-update]
+ texinfo-sequential-node-update (&optional region-p)
+
+ texinfo-make-menu (&optional region-p) \\[texinfo-make-menu]
+ texinfo-all-menus-update () \\[texinfo-all-menus-update]
+ texinfo-master-menu ()
+
+ texinfo-indent-menu-description (column &optional region-p)
+
+The `texinfo-column-for-description' variable specifies the column to
+which menu descriptions are indented. Its default value is 32."
+ t nil)
+
+(autoload 'texinfo-every-node-update
+ "texnfo-upd"
+ "Update every node in a Texinfo file."
+ t nil)
+
+(autoload 'texinfo-sequential-node-update
+ "texnfo-upd"
+ "Update one node (or many) in a Texinfo file with sequential pointers.
+
+This function causes the `Next' or `Previous' pointer to point to the
+immediately preceding or following node, even if it is at a higher or
+lower hierarchical level in the document. Continually pressing `n' or
+`p' takes you straight through the file.
+
+Without any prefix argument, update the node in which point is located.
+Non-nil argument (prefix, if interactive) means update the nodes in the
+marked region.
+
+This command makes it awkward to navigate among sections and
+subsections; it should be used only for those documents that are meant
+to be read like a novel rather than a reference, and for which the
+Info `g*' command is inadequate."
+ t nil)
+
+(autoload 'texinfo-make-menu
+ "texnfo-upd"
+ "Without any prefix argument, make or update a menu.
+Make the menu for the section enclosing the node found following point.
+
+Non-nil argument (prefix, if interactive) means make or update menus
+for nodes within or part of the marked region.
+
+Whenever a menu exists, and is being updated, the descriptions that
+are associated with node names in the pre-existing menu are
+incorporated into the new menu. Otherwise, the nodes' section titles
+are inserted as descriptions."
+ t nil)
+
+(autoload 'texinfo-all-menus-update
+ "texnfo-upd"
+ "Update every regular menu in a Texinfo file.
+Remove pre-existing master menu, if there is one.
+
+If called with a non-nil argument, this function first updates all the
+nodes in the buffer before updating the menus."
+ t nil)
+
+(autoload 'texinfo-master-menu
+ "texnfo-upd"
+ "Make a master menu for a whole Texinfo file.
+Non-nil argument (prefix, if interactive) means first update all
+existing nodes and menus. Remove pre-existing master menu, if there is one.
+
+This function creates a master menu that follows the top node. The
+master menu includes every entry from all the other menus. It
+replaces any existing ordinary menu that follows the top node.
+
+If called with a non-nil argument, this function first updates all the
+menus in the buffer (incorporating descriptions from pre-existing
+menus) before it constructs the master menu.
+
+The function removes the detailed part of an already existing master
+menu. This action depends on the pre-existing master menu using the
+standard `texinfo-master-menu-header'.
+
+The master menu has the following format, which is adapted from the
+recommendation in the Texinfo Manual:
+
+ * The first part contains the major nodes in the Texinfo file: the
+ nodes for the chapters, chapter-like sections, and the major
+ appendices. This includes the indices, so long as they are in
+ chapter-like sections, such as unnumbered sections.
+
+ * The second and subsequent parts contain a listing of the other,
+ lower level menus, in order. This way, an inquirer can go
+ directly to a particular node if he or she is searching for
+ specific information.
+
+Each of the menus in the detailed node listing is introduced by the
+title of the section containing the menu."
+ t nil)
+
+(autoload 'texinfo-indent-menu-description
+ "texnfo-upd"
+ "Indent every description in menu following point to COLUMN.
+Non-nil argument (prefix, if interactive) means indent every
+description in every menu in the region. Does not indent second and
+subsequent lines of a multi-line description."
+ t nil)
+
+(autoload 'texinfo-insert-node-lines
+ "texnfo-upd"
+ "Insert missing `@node' lines in region of Texinfo file.
+Non-nil argument (prefix, if interactive) means also to insert the
+section titles as node names; and also to insert the section titles as
+node names in pre-existing @node lines that lack names."
+ t nil)
+
+(autoload 'texinfo-start-menu-description
+ "texnfo-upd"
+ "In this menu entry, insert the node's section title as a description.
+Position point at beginning of description ready for editing.
+Do not insert a title if the line contains an existing description.
+
+You will need to edit the inserted text since a useful description
+complements the node name rather than repeats it as a title does."
+ t nil)
+
+(autoload 'texinfo-multiple-files-update
+ "texnfo-upd"
+ "Update first node pointers in each file included in OUTER-FILE;
+create or update main menu in the outer file that refers to such nodes.
+This does not create or update menus or pointers within the included files.
+
+With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
+insert a master menu in OUTER-FILE. This does not create or update
+menus or pointers within the included files.
+
+With optional UPDATE-EVERYTHING argument (numeric prefix arg, if
+interactive), update all the menus and all the `Next', `Previous', and
+`Up' pointers of all the files included in OUTER-FILE before inserting
+a master menu in OUTER-FILE.
+
+The command also updates the `Top' level node pointers of OUTER-FILE.
+
+Notes:
+
+ * this command does NOT save any files--you must save the
+ outer file and any modified, included files.
+
+ * except for the `Top' node, this command does NOT handle any
+ pre-existing nodes in the outer file; hence, indices must be
+ enclosed in an included file.
+
+Requirements:
+
+ * each of the included files must contain exactly one highest
+ hierarchical level node,
+ * this highest node must be the first node in the included file,
+ * each highest hierarchical level node must be of the same type.
+
+Thus, normally, each included file contains one, and only one,
+chapter."
+ t nil)
+
+
+;;; Code:
+
+;;; Don't you dare insert any `require' calls at top level in this file--rms.
+
+;;; Syntax table
+
+(defvar texinfo-mode-syntax-table nil)
+
+(if texinfo-mode-syntax-table
+ nil
+ (setq texinfo-mode-syntax-table (make-syntax-table))
+ (modify-syntax-entry ?\" " " texinfo-mode-syntax-table)
+ (modify-syntax-entry ?\\ " " texinfo-mode-syntax-table)
+ (modify-syntax-entry ?@ "\\" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?\^q "\\" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?\[ "(]" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?\] ")[" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?{ "(}" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?} "){" texinfo-mode-syntax-table)
+ (modify-syntax-entry ?\' "w" texinfo-mode-syntax-table))
+
+;; Written by Wolfgang Bangerth <zcg51122@rpool1.rus.uni-stuttgart.de>
+;; To override this example, set either `imenu-generic-expression'
+;; or `imenu-create-index-function'.
+(defvar texinfo-imenu-generic-expression
+ '((nil "^@node[ \t]+\\([^,\n]*\\)" 1)
+ ("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1))
+
+ "Imenu generic expression for TexInfo mode. See `imenu-generic-expression'.")
+
+(defvar texinfo-font-lock-keywords
+ '(;; All but the first 2 had an OVERRIDE of t.
+ ;; It didn't seem to be any better, and it's slower--simon.
+ ("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments
+ ;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line.
+ ;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
+ ("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands
+ ("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
+ ("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face)
+ ("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face)
+ ("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)"
+ 2 font-lock-variable-name-face)
+ ("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face)
+ ("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-function-name-face keep)
+ )
+ "Additional expressions to highlight in TeXinfo mode.")
+
+(defvar texinfo-section-list
+ '(("top" 1)
+ ("majorheading" 1)
+ ("chapter" 2)
+ ("unnumbered" 2)
+ ("appendix" 2)
+ ("chapheading" 2)
+ ("section" 3)
+ ("unnumberedsec" 3)
+ ("appendixsec" 3)
+ ("heading" 3)
+ ("subsection" 4)
+ ("unnumberedsubsec" 4)
+ ("appendixsubsec" 4)
+ ("subheading" 4)
+ ("subsubsection" 5)
+ ("unnumberedsubsubsec" 5)
+ ("appendixsubsubsec" 5)
+ ("subsubheading" 5))
+ "Alist of sectioning commands and their relative level.")
+
+(defun texinfo-outline-level ()
+ ;; Calculate level of current texinfo outline heading.
+ (save-excursion
+ (if (bobp)
+ 0
+ (forward-char 1)
+ (let* ((word (buffer-substring-no-properties
+ (point) (progn (forward-word 1) (point))))
+ (entry (assoc word texinfo-section-list)))
+ (if entry
+ (nth 1 entry)
+ 5)))))
+
+
+;;; Keybindings
+(defvar texinfo-mode-map nil)
+
+;;; Keys common both to Texinfo mode and to TeX shell.
+
+(defun texinfo-define-common-keys (keymap)
+ "Define the keys both in Texinfo mode and in the texinfo-tex-shell."
+ (define-key keymap "\C-c\C-t\C-k" 'tex-kill-job)
+ (define-key keymap "\C-c\C-t\C-x" 'texinfo-quit-job)
+ (define-key keymap "\C-c\C-t\C-l" 'tex-recenter-output-buffer)
+ (define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue)
+ (define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue)
+ (define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
+ (define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
+
+ (define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
+ (define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
+
+;; Mode documentation displays commands in reverse order
+;; from how they are listed in the texinfo-mode-map.
+
+(if texinfo-mode-map
+ nil
+ (setq texinfo-mode-map (make-sparse-keymap))
+
+ ;; bindings for `texnfo-tex.el'
+ (texinfo-define-common-keys texinfo-mode-map)
+
+ ;; bindings for `makeinfo.el'
+ (define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
+ (define-key texinfo-mode-map "\C-c\C-m\C-l"
+ 'makeinfo-recenter-compilation-buffer)
+ (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
+ (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
+
+ ;; bindings for `texinfmt.el'
+ (define-key texinfo-mode-map "\C-c\C-e\C-r" 'texinfo-format-region)
+ (define-key texinfo-mode-map "\C-c\C-e\C-b" 'texinfo-format-buffer)
+
+ ;; bindings for updating nodes and menus
+
+ (define-key texinfo-mode-map "\C-c\C-um" 'texinfo-master-menu)
+
+ (define-key texinfo-mode-map "\C-c\C-u\C-m" 'texinfo-make-menu)
+ (define-key texinfo-mode-map "\C-c\C-u\C-n" 'texinfo-update-node)
+ (define-key texinfo-mode-map "\C-c\C-u\C-e" 'texinfo-every-node-update)
+ (define-key texinfo-mode-map "\C-c\C-u\C-a" 'texinfo-all-menus-update)
+
+ (define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure)
+
+ (define-key texinfo-mode-map "\C-c}" 'up-list)
+ (define-key texinfo-mode-map "\C-c]" 'up-list)
+ (define-key texinfo-mode-map "\C-c{" 'texinfo-insert-braces)
+
+ ;; bindings for inserting strings
+
+ (define-key texinfo-mode-map "\C-c\C-c\C-d" 'texinfo-start-menu-description)
+
+ (define-key texinfo-mode-map "\C-c\C-cv" 'texinfo-insert-@var)
+ (define-key texinfo-mode-map "\C-c\C-ct" 'texinfo-insert-@table)
+ (define-key texinfo-mode-map "\C-c\C-cs" 'texinfo-insert-@samp)
+ (define-key texinfo-mode-map "\C-c\C-co" 'texinfo-insert-@noindent)
+ (define-key texinfo-mode-map "\C-c\C-cn" 'texinfo-insert-@node)
+ (define-key texinfo-mode-map "\C-c\C-ck" 'texinfo-insert-@kbd)
+ (define-key texinfo-mode-map "\C-c\C-ci" 'texinfo-insert-@item)
+ (define-key texinfo-mode-map "\C-c\C-cf" 'texinfo-insert-@file)
+ (define-key texinfo-mode-map "\C-c\C-cx" 'texinfo-insert-@example)
+ (define-key texinfo-mode-map "\C-c\C-ce" 'texinfo-insert-@end)
+ (define-key texinfo-mode-map "\C-c\C-cd" 'texinfo-insert-@dfn)
+ (define-key texinfo-mode-map "\C-c\C-cc" 'texinfo-insert-@code))
+
+
+;;; Texinfo mode
+
+(defvar texinfo-chapter-level-regexp
+ "chapter\\|unnumbered \\|appendix \\|majorheading\\|chapheading"
+ "Regular expression matching Texinfo chapter-level headings.
+This does not match `@node' and does not match the `@top' command.")
+
+;;;###autoload
+(defun texinfo-mode ()
+ "Major mode for editing Texinfo files.
+
+ It has these extra commands:
+\\{texinfo-mode-map}
+
+ These are files that are used as input for TeX to make printed manuals
+and also to be turned into Info files with \\[makeinfo-buffer] or
+the `makeinfo' program. These files must be written in a very restricted and
+modified version of TeX input format.
+
+ Editing commands are like text-mode except that the syntax table is
+set up so expression commands skip Texinfo bracket groups. To see
+what the Info version of a region of the Texinfo file will look like,
+use \\[makeinfo-region], which runs `makeinfo' on the current region.
+
+ You can show the structure of a Texinfo file with \\[texinfo-show-structure].
+This command shows the structure of a Texinfo file by listing the
+lines with the @-sign commands for @chapter, @section, and the like.
+These lines are displayed in another window called the *Occur* window.
+In that window, you can position the cursor over one of the lines and
+use \\[occur-mode-goto-occurrence], to jump to the corresponding spot
+in the Texinfo file.
+
+ In addition, Texinfo mode provides commands that insert various
+frequently used @-sign commands into the buffer. You can use these
+commands to save keystrokes. And you can insert balanced braces with
+\\[texinfo-insert-braces] and later use the command \\[up-list] to
+move forward past the closing brace.
+
+Also, Texinfo mode provides functions for automatically creating or
+updating menus and node pointers. These functions
+
+ * insert the `Next', `Previous' and `Up' pointers of a node,
+ * insert or update the menu for a section, and
+ * create a master menu for a Texinfo source file.
+
+Here are the functions:
+
+ texinfo-update-node \\[texinfo-update-node]
+ texinfo-every-node-update \\[texinfo-every-node-update]
+ texinfo-sequential-node-update
+
+ texinfo-make-menu \\[texinfo-make-menu]
+ texinfo-all-menus-update \\[texinfo-all-menus-update]
+ texinfo-master-menu
+
+ texinfo-indent-menu-description (column &optional region-p)
+
+The `texinfo-column-for-description' variable specifies the column to
+which menu descriptions are indented.
+
+Passed an argument (a prefix argument, if interactive), the
+`texinfo-update-node' and `texinfo-make-menu' functions do their jobs
+in the region.
+
+To use the updating commands, you must structure your Texinfo file
+hierarchically, such that each `@node' line, with the exception of the
+Top node, is accompanied by some kind of section line, such as an
+`@chapter' or `@section' line.
+
+If the file has a `top' node, it must be called `top' or `Top' and
+be the first node in the file.
+
+Entering Texinfo mode calls the value of text-mode-hook, and then the
+value of texinfo-mode-hook."
+ (interactive)
+ (text-mode)
+ (setq mode-name "Texinfo")
+ (setq major-mode 'texinfo-mode)
+ (use-local-map texinfo-mode-map)
+ (set-syntax-table texinfo-mode-syntax-table)
+ (make-local-variable 'page-delimiter)
+ (setq page-delimiter
+ (concat
+ "^@node [ \t]*[Tt]op\\|^@\\("
+ texinfo-chapter-level-regexp
+ "\\)"))
+ (make-local-variable 'require-final-newline)
+ (setq require-final-newline t)
+ (make-local-variable 'indent-tabs-mode)
+ (setq indent-tabs-mode nil)
+ (make-local-variable 'paragraph-separate)
+ (setq paragraph-separate (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-separate))
+ (make-local-variable 'paragraph-start)
+ (setq paragraph-start (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-start))
+ (make-local-variable 'fill-column)
+ (setq fill-column 72)
+ (make-local-variable 'comment-start)
+ (setq comment-start "@c ")
+ (make-local-variable 'comment-start-skip)
+ (setq comment-start-skip "@c +")
+ (make-local-variable 'words-include-escapes)
+ (setq words-include-escapes t)
+ (make-local-variable 'imenu-generic-expression)
+ (setq imenu-generic-expression texinfo-imenu-generic-expression)
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults '(texinfo-font-lock-keywords t))
+ (make-local-variable 'outline-regexp)
+ (setq outline-regexp
+ (concat "@\\("
+ (mapconcat 'car texinfo-section-list "\\>\\|")
+ "\\>\\)"))
+ (make-local-variable 'outline-level)
+ (setq outline-level 'texinfo-outline-level)
+ (make-local-variable 'tex-start-of-header)
+ (setq tex-start-of-header "%**start")
+ (make-local-variable 'tex-end-of-header)
+ (setq tex-end-of-header "%**end")
+ (run-hooks 'text-mode-hook 'texinfo-mode-hook))
+
+
+;;; Insert string commands
+
+;; Keep as concatinated lists for ease of maintenance
+(defconst texinfo-environment-regexp
+ (concat
+ "^@"
+ "\\("
+ "cartouche\\|"
+ "display\\|"
+ "end\\|"
+ "enumerate\\|"
+ "example\\|"
+ "f?table\\|"
+ "flushleft\\|"
+ "flushright\\|"
+ "format\\|"
+ "group\\|"
+ "ifhtml\\|"
+ "ifinfo\\|"
+ "iftex\\|"
+ "ignore\\|"
+ "itemize\\|"
+ "lisp\\|"
+ "macro\\|"
+ "multitable\\|"
+ "quotation\\|"
+ "smallexample\\|"
+ "smalllisp\\|"
+ "tex"
+ "\\)")
+ "Regexp for environment-like TexInfo list commands.
+ Subexpression 1 is what goes into the corresponding `@end' statement.")
+
+;; The following texinfo-insert-@end command not only inserts a SPC
+;; after the @end, but tries to find out what belongs there. It is
+;; not very smart: it does not understand nested lists.
+
+(defun texinfo-insert-@end ()
+ "Insert the matching `@end' for the last Texinfo command that needs one."
+ (interactive)
+ (let ((depth 1) string)
+ (save-excursion
+ (while (and (> depth 0)
+ (re-search-backward texinfo-environment-regexp nil t)
+ (if (looking-at "@end")
+ (setq depth (1+ depth))
+ (setq depth (1- depth)))))
+ (looking-at texinfo-environment-regexp)
+ (if (zerop depth)
+ (setq string
+ (buffer-substring (match-beginning 1)
+ (match-end 1)))))
+ (insert "@end ")
+ (if string (insert string "\n"))))
+
+;; The following insert commands accept a prefix arg N, which is the
+;; number of words (actually s-exprs) that should be surrounded by
+;; braces. Thus you can first paste a variable name into a .texinfo
+;; buffer, then say C-u 1 C-c C-c v at the beginning of the just
+;; pasted variable name to put @var{...} *around* the variable name.
+;; Operate on previous word or words with negative arg.
+
+;; These commands use texinfo-insert-@-with-arg
+(defun texinfo-insert-@-with-arg (string &optional arg)
+ (if arg
+ (progn
+ (setq arg (prefix-numeric-value arg))
+ (if (< arg 0)
+ (progn
+ (skip-chars-backward " \t\n\r\f")
+ (save-excursion
+ (forward-sexp arg)
+ (insert "@" string "{"))
+ (insert "}"))
+ (skip-chars-forward " \t\n\r\f")
+ (insert "@" string "{")
+ (forward-sexp arg)
+ (insert "}")))
+ (insert "@" string "{}")
+ (backward-char)))
+
+(defun texinfo-insert-braces ()
+ "Make a pair of braces and be poised to type inside of them.
+Use \\[up-list] to move forward out of the braces."
+ (interactive)
+ (insert "{}")
+ (backward-char))
+
+(defun texinfo-insert-@code (&optional arg)
+ "Insert a `@code{...}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "code" arg))
+
+(defun texinfo-insert-@dfn (&optional arg)
+ "Insert a `@dfn{...}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "dfn" arg))
+
+(defun texinfo-insert-@example ()
+ "Insert the string `@example' in a Texinfo buffer."
+ (interactive)
+ (insert "@example\n"))
+
+(defun texinfo-insert-@file (&optional arg)
+ "Insert a `@file{...}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "file" arg))
+
+(defun texinfo-insert-@item ()
+ "Insert the string `@item' in a Texinfo buffer."
+ (interactive)
+ (insert "@item")
+ (newline))
+
+(defun texinfo-insert-@kbd (&optional arg)
+ "Insert a `@kbd{...}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "kbd" arg))
+
+(defun texinfo-insert-@node ()
+ "Insert the string `@node' in a Texinfo buffer.
+This also inserts on the following line a comment indicating
+the order of arguments to @node."
+ (interactive)
+ (insert "@node \n@comment node-name, next, previous, up")
+ (forward-line -1)
+ (forward-char 6))
+
+(defun texinfo-insert-@noindent ()
+ "Insert the string `@noindent' in a Texinfo buffer."
+ (interactive)
+ (insert "@noindent\n"))
+
+(defun texinfo-insert-@samp (&optional arg)
+ "Insert a `@samp{...}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "samp" arg))
+
+(defun texinfo-insert-@table (&optional arg)
+ "Insert the string `@table' in a Texinfo buffer."
+ (interactive "P")
+ (insert "@table "))
+
+(defun texinfo-insert-@var (&optional arg)
+ "Insert a `@var{}' command in a Texinfo buffer.
+A numeric argument says how many words the braces should surround.
+The default is not to surround any existing words with the braces."
+ (interactive "P")
+ (texinfo-insert-@-with-arg "var" arg))
+
+;;; Texinfo file structure
+
+;; These are defined in texnfo-upd.el.
+;; texinfo-section-types-regexp
+;; texinfo-section-level-regexp
+;; texinfo-subsection-level-regexp
+;; texinfo-subsubsection-level-regexp
+
+;; `texinfo-show-structure' requires texnfo-upd.el
+(defun texinfo-show-structure (&optional nodes-too)
+ "Show the structure of a Texinfo file.
+List the lines in the file that begin with the @-sign commands for
+@chapter, @section, and the like.
+
+With optional argument (prefix if interactive), list both the lines
+with @-sign commands for @chapter, @section, and the like, and list
+@node lines.
+
+Lines with structuring commands beginning in them are displayed in
+another buffer named `*Occur*'. In that buffer, you can move point to
+one of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],
+to jump to the corresponding spot in the Texinfo source file."
+
+ (interactive "P")
+ (require 'texnfo-upd)
+ (save-excursion
+ (goto-char (point-min))
+ (if nodes-too
+ (occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))
+ (occur texinfo-section-types-regexp)))
+ (pop-to-buffer "*Occur*")
+ (goto-char (point-min))
+ (flush-lines "-----")
+ ;; Now format the "*Occur*" buffer to show the structure.
+ ;; Thanks to ceder@signum.se (Per Cederqvist)
+ (goto-char (point-max))
+ (let ((margin 5))
+ (while (re-search-backward "^ *[0-9]*:" nil 0)
+ (re-search-forward ":")
+ (setq margin
+ (cond
+ ((looking-at
+ (concat "@\\(" texinfo-chapter-level-regexp "\\)")) 5)
+ ;; ((looking-at "@chapter ") 5)
+ ;; ((looking-at "@unnumbered ") 5)
+ ;; ((looking-at "@appendix ") 5)
+ ;; ((looking-at "@majorheading ") 5)
+ ;; ((looking-at "@chapheading ") 5)
+
+ ((looking-at
+ (concat "@\\(" texinfo-section-level-regexp "\\)")) 9)
+ ;; ((looking-at "@section ") 9)
+ ;; ((looking-at "@unnumberedsec ") 9)
+ ;; ((looking-at "@appendixsec ") 9)
+ ;; ((looking-at "@heading ") 9)
+
+ ((looking-at
+ (concat "@\\(" texinfo-subsection-level-regexp "\\)")) 13)
+ ;; ((looking-at "@subsection ") 13)
+ ;; ((looking-at "@unnumberedsubsec ") 13)
+ ;; ((looking-at "@appendixsubsec ") 13)
+ ;; ((looking-at "@subheading ") 13)
+
+ ((looking-at
+ (concat "@\\(" texinfo-subsubsection-level-regexp "\\)")) 17)
+ ;; ((looking-at "@subsubsection ") 17)
+ ;; ((looking-at "@unnumberedsubsubsec ") 17)
+ ;; ((looking-at "@appendixsubsubsec ") 17)
+ ;; ((looking-at "@subsubheading ") 17)
+ (t margin)))
+ (indent-to-column margin)
+ (beginning-of-line))))
+
+;;; The tex and print function definitions:
+
+(defvar texinfo-texi2dvi-command "texi2dvi"
+ "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer.")
+
+(defvar texinfo-tex-command "tex"
+ "*Command used by `texinfo-tex-region' to run TeX on a region.")
+
+(defvar texinfo-texindex-command "texindex"
+ "*Command used by `texinfo-texindex' to sort unsorted index files.")
+
+(defvar texinfo-delete-from-print-queue-command "lprm"
+ "*Command string used to delete a job from the line printer queue.
+Command is used by \\[texinfo-delete-from-print-queue] based on
+number provided by a previous \\[tex-show-print-queue]
+command.")
+
+(defvar texinfo-tex-trailer "@bye"
+ "String appended after a region sent to TeX by `texinfo-tex-region'.")
+
+(defun texinfo-tex-region (beg end)
+ "Run TeX on the current region.
+This works by writing a temporary file (`tex-zap-file') in the directory
+that is the value of `tex-directory', then running TeX on that file.
+
+The first line of the buffer is copied to the
+temporary file; and if the buffer has a header, it is written to the
+temporary file before the region itself. The buffer's header is all lines
+between the strings defined by `tex-start-of-header' and `tex-end-of-header'
+inclusive. The header must start in the first 100 lines.
+
+The value of `texinfo-tex-trailer' is appended to the temporary file after the region."
+ (interactive "r")
+ (require 'tex-mode)
+ (if (get-buffer "*tex-shell*")
+ (tex-kill-job)
+ (tex-start-shell))
+ (or tex-zap-file (setq tex-zap-file (make-temp-name "#tz")))
+ (let ((tex-out-file (concat tex-zap-file ".tex"))
+ (temp-buffer (get-buffer-create " tex-Output-Buffer"))
+ (zap-directory
+ (file-name-as-directory (expand-file-name tex-directory))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line 100)
+ (let ((search-end (point))
+ (hbeg (point-min)) (hend (point-min))
+ (default-directory zap-directory))
+ (goto-char (point-min))
+
+ ;; Copy first line, the `\input texinfo' line, to temp file
+ (write-region (point)
+ (save-excursion (end-of-line) (point))
+ tex-out-file nil nil)
+
+ ;; Don't copy first line twice if region includes it.
+ (forward-line 1)
+ (if (< beg (point)) (setq beg (point)))
+
+ ;; Initialize the temp file with either the header or nothing
+ (if (search-forward tex-start-of-header search-end t)
+ (progn
+ (beginning-of-line)
+ (setq hbeg (point)) ; Mark beginning of header.
+ (if (search-forward tex-end-of-header nil t)
+ (progn (beginning-of-line)
+ (setq hend (point))) ; Mark end of header.
+ (setq hbeg (point-min))))) ; Else no header.
+
+ ;; Copy header to temp file.
+ (write-region (min hbeg beg) hend tex-out-file t nil)
+
+ ;; Copy region to temp file.
+ (write-region (max beg hend) end tex-out-file t nil))
+
+ ;; This is a kludge to insert the tex-trailer into the tex-out-file.
+ ;; We have to create a special buffer in which to insert
+ ;; the tex-trailer first because there is no function with
+ ;; which to append a literal string directly to a file.
+ (let ((local-tex-trailer texinfo-tex-trailer))
+ (set-buffer temp-buffer)
+ (erase-buffer)
+ ;; make sure trailer isn't hidden by a comment
+ (insert-string "\n")
+ (if local-tex-trailer (insert-string local-tex-trailer))
+ (tex-set-buffer-directory temp-buffer zap-directory)
+ (write-region (point-min) (point-max) tex-out-file t nil))
+
+;;; The following is sufficient in Emacs 19.
+;;; (write-region (concat "\n" texinfo-tex-trailer) nil
+;;; tex-out-file t nil)
+ ))
+
+ (tex-set-buffer-directory "*tex-shell*" zap-directory)
+ (tex-send-command tex-shell-cd-command zap-directory)
+ (tex-send-command texinfo-tex-command tex-out-file)
+ ;; alternatively:
+ ;; (send-string "tex-shell" (concat tex-shell-cd-command " "
+ ;; zap-directory "\n"))
+ ;; (send-string "tex-shell" (concat texinfo-tex-command " "
+ ;; tex-out-file "\n"))
+ (tex-recenter-output-buffer 0)))
+
+(defun texinfo-tex-buffer ()
+ "Run TeX on visited file, once or twice, to make a correct `.dvi' file."
+ (interactive)
+
+ ;; Make sure TeX shell is running.
+ (require 'tex-mode)
+ (if (get-buffer "*tex-shell*")
+ (quit-process (get-process "tex-shell") t)
+ (tex-start-shell))
+
+ (cond ((null buffer-file-name)
+ (error "Buffer not visiting any file!"))
+ ((buffer-modified-p)
+ (error "Buffer has been modified since last saved!")))
+
+ (setq tex-zap-file buffer-file-name)
+
+ (tex-send-command tex-shell-cd-command (file-name-directory tex-zap-file))
+
+ (tex-send-command texinfo-texi2dvi-command tex-zap-file)
+
+ ;; alternatively:
+ ;; (send-string "tex-shell"
+ ;; (concat tex-shell-cd-command
+ ;; " " (file-name-directory tex-zap-file) "\n"))
+ ;; )
+ ;;
+ ;; (send-string "tex-shell"
+ ;; (concat texinfo-texi2dvi-command " " tex-zap-file "\n"))
+
+
+ (tex-recenter-output-buffer 0))
+
+(defun texinfo-texindex ()
+ "Run `texindex' on unsorted index files.
+The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
+This runs the shell command defined by `texinfo-texindex-command'."
+ (interactive)
+ (require 'tex-mode)
+ (tex-send-command texinfo-texindex-command (concat tex-zap-file ".??"))
+ ;; alternatively
+ ;; (send-string "tex-shell"
+ ;; (concat texinfo-texindex-command
+ ;; " " tex-zap-file ".??" "\n"))
+ (tex-recenter-output-buffer nil))
+
+(defun texinfo-tex-print ()
+ "Print `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
+This runs the shell command defined by `tex-dvi-print-command'."
+ (interactive)
+ (require 'tex-mode)
+ (tex-send-command tex-dvi-print-command (concat tex-zap-file ".dvi"))
+ ;; alternatively:
+ ;; (send-string "tex-shell"
+ ;; (concat tex-dvi-print-command
+ ;; " " tex-zap-file ".dvi" "\n"))
+ (tex-recenter-output-buffer nil))
+
+(defun texinfo-quit-job ()
+ "Quit currently running TeX job, by sending an `x' to it."
+ (interactive)
+ (if (not (get-process "tex-shell"))
+ (error "No TeX shell running"))
+ (tex-send-command "x"))
+;; alternatively:
+;; save-excursion
+;; (set-buffer (get-buffer "*tex-shell*"))
+;; (goto-char (point-max))
+;; (insert "x")
+;; (comint-send-input)
+
+(defun texinfo-delete-from-print-queue (job-number)
+ "Delete job from the line printer spooling queue.
+You are prompted for the job number (use a number shown by a previous
+\\[tex-show-print-queue] command)."
+ (interactive "nPrinter job number for deletion: ")
+ (require 'tex-mode)
+ (if (tex-shell-running)
+ (tex-kill-job)
+ (tex-start-shell))
+ (tex-send-command texinfo-delete-from-print-queue-command job-number)
+ ;; alternatively
+ ;; (send-string "tex-shell"
+ ;; (concat
+ ;; texinfo-delete-from-print-queue-command
+ ;; " "
+ ;; job-number"\n"))
+ (tex-recenter-output-buffer nil))
+
+(provide 'texinfo)
+
+;;; texinfo.el ends here
diff --git a/contrib/texinfo/emacs/texnfo-tex.el b/contrib/texinfo/emacs/texnfo-tex.el
new file mode 100644
index 000000000000..225ea685c042
--- /dev/null
+++ b/contrib/texinfo/emacs/texnfo-tex.el
@@ -0,0 +1,346 @@
+;;;; texnfo-tex.el
+
+;;; Texinfo mode TeX and hardcopy printing commands.
+
+;; These commands are for running TeX on a region of a Texinfo file in
+;; GNU Emacs, or on the whole buffer, and for printing the resulting
+;; DVI file.
+
+;;; Version 2.07 22 October 1991
+;;; Robert J. Chassell
+;;; Please send bug reports to: bug-texinfo@prep.ai.mit.edu
+
+;;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
+
+
+;;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+
+
+;;; The Texinfo mode TeX related commands are:
+
+; texinfo-tex-region to run tex on the current region.
+; texinfo-tex-buffer to run tex on the current buffer.
+; texinfo-texindex to sort unsorted index files.
+; texinfo-tex-print to print the .dvi file made by tex.
+; texinfo-kill-tex-job to kill the currently running tex job.
+; texinfo-recenter-tex-output-buffer to redisplay tex output buffer.
+; texinfo-show-tex-print-queue to show the print queue.
+
+
+;;; Keys common both to Texinfo mode and to TeX shell.
+
+;; Defined in `texinfo.el'
+; (defun texinfo-define-common-keys (keymap)
+; "Define the keys both in Texinfo mode and in the texinfo-tex-shell."
+; (define-key keymap "\C-c\C-t\C-k" 'texinfo-kill-tex-job)
+; (define-key keymap "\C-c\C-t\C-x" 'texinfo-quit-tex-job)
+; (define-key keymap "\C-c\C-t\C-l" 'texinfo-recenter-tex-output-buffer)
+; (define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-tex-print-queue)
+; (define-key keymap "\C-c\C-t\C-q" 'texinfo-show-tex-print-queue)
+; (define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
+; (define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
+; (define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
+; (define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
+
+;; See also texinfo-tex-start-shell.
+;; The following is executed in the `texinfo.el' file
+;(texinfo-define-common-keys texinfo-mode-map)
+
+
+;;; Variable definitions:
+
+(require 'shell)
+
+(defvar texinfo-tex-shell-cd-command "cd"
+ "Command to give to shell running TeX to change directory.")
+
+(defvar texinfo-tex-command "tex"
+ "*Command used by texinfo-tex-region to run tex on a region.")
+
+(defvar texinfo-texindex-command "texindex"
+ "*Command used by texinfo-texindex to sort unsorted index files.")
+
+(defvar texinfo-tex-dvi-print-command "lpr -d"
+ "*Command string used by \\[tex-print] to print a .dvi file.")
+
+(defvar texinfo-show-tex-queue-command "lpq"
+ "*Command string used to show the Texinfo TeX print queue.
+Command is used by \\[texinfo-show-tex-print-queue] and it
+should show the queue that \\[texinfo-tex-print] puts jobs on.")
+
+(defvar texinfo-delete-from-print-queue-command "lprm"
+ "*Command string used to delete a job from the line printer queue.
+Command is used by \\[texinfo-delete-from-tex-print-queue] based on
+number provided by a previous \\[texinfo-show-tex-print-queue]
+command.")
+
+(defvar texinfo-tex-trailer "@bye"
+ "String appended after a region sent to TeX by texinfo-tex-region.")
+
+(defvar texinfo-tex-original-file ""
+ "Original name of file on which to run TeX.")
+
+(defvar texinfo-tex-temp-file nil
+ "Temporary file name used for text being sent as input to TeX.")
+
+(defvar texinfo-tex-root-temp-file nil
+ "Temporary file name used for text being sent as input to TeX.")
+
+
+;;; Texinfo TeX main functions
+
+(defun texinfo-tex-region (beginning end)
+ "Run tex on the current region.
+
+A temporary file is written in the default directory, and tex is run
+in that directory. The first line of the file is copied to the
+temporary file; and if the buffer has a header, it is written to the
+temporary file before the region itself. The buffer's header is all
+lines between the strings defined by texinfo-start-of-header and
+texinfo-end-of-header inclusive. The header must start in the first 100
+lines. The value of texinfo-tex-trailer is appended to the temporary file
+after the region."
+
+ (interactive "r")
+ (if (get-buffer "*texinfo-tex-shell*")
+ (quit-process (get-process "texinfo-tex-shell") t)
+ (texinfo-tex-start-shell))
+
+ (setq texinfo-tex-root-temp-file
+ (expand-file-name
+ (make-temp-name
+ (prin1-to-string (read (buffer-name))))))
+
+ (let ((texinfo-tex-temp-file (concat texinfo-tex-root-temp-file ".tex")))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line 100)
+ (let ((search-end (point))
+ (header-beginning (point-min)) (header-end (point-min)))
+ (goto-char (point-min))
+ ;; Copy first line, the `\input texinfo' line, to temp file
+ (write-region (point)
+ (save-excursion (forward-line 1) (point))
+ texinfo-tex-temp-file nil nil)
+ ;; Don't copy first line twice if region includes it.
+ (forward-line 1)
+ (if (< beginning (point)) (setq beginning (point)))
+ ;; Initialize the temp file with either the header or nothing
+ (if (search-forward texinfo-start-of-header search-end t)
+ (progn
+ (beginning-of-line)
+ (setq header-beginning (point)) ; Mark beginning of header.
+ (if (search-forward texinfo-end-of-header nil t)
+ (progn (beginning-of-line)
+ (setq header-end (point))) ; Mark end of header.
+ (setq header-beginning (point-min))))) ; Else no header.
+ ;; Copy header to temp file.
+ (write-region
+ (min header-beginning beginning )
+ header-end
+ texinfo-tex-temp-file t nil)
+ ;; Copy region to temp file.
+ (write-region
+ (max beginning header-end)
+ end
+ texinfo-tex-temp-file t nil)
+ ;; This is a kludge to insert the texinfo-tex-trailer into the
+ ;; texinfo-tex-temp-file. We have to create a special buffer
+ ;; in which to insert the texinfo-tex-trailer first because there is
+ ;; no function with which to append a literal string directly
+ ;; to a file.
+ (let ((local-tex-trailer texinfo-tex-trailer)
+ (temp-buffer (get-buffer-create " texinfo-trailer-buffer")))
+ (set-buffer temp-buffer)
+ (erase-buffer)
+ ;; make sure trailer isn't hidden by a comment
+ (insert-string "\n")
+ (if local-tex-trailer (insert local-tex-trailer))
+ (write-region (point-min) (point-max)
+ texinfo-tex-temp-file t nil)))
+ (set-process-sentinel (get-process "texinfo-tex-shell")
+ 'texinfo-tex-shell-sentinel)
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-tex-shell-cd-command " "
+ default-directory "\n"))
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-tex-command " "
+ texinfo-tex-temp-file "\n "))
+ (texinfo-recenter-tex-output-buffer 0)))))
+
+(defun texinfo-tex-buffer (buffer)
+ "Run TeX on current buffer.
+After running TeX the first time, you may have to run \\[texinfo-texindex]
+and then \\[texinfo-tex-buffer] again."
+ (interactive
+ (list
+ ;; Sometimes you put point into *texinfo-tex-shell*; this prompts
+ ;; you for the correct file regardless.
+ (if (and
+ (string= (buffer-name (current-buffer)) "*texinfo-tex-shell*")
+ texinfo-tex-root-temp-file)
+ (read-string (format "Run TeX on: ")
+ texinfo-tex-original-file)
+ (read-string (format "Run TeX on: ") (buffer-name (current-buffer))))))
+
+ ;; Set to original buffer if in *texinfo-tex-shell*; otherwise,
+ ;; record name of current buffer.
+ (if (string= (buffer-name (current-buffer)) "*texinfo-tex-shell*")
+ (set-buffer buffer)
+ (setq texinfo-tex-original-file
+ (buffer-name (current-buffer))))
+
+ (if (get-buffer "*texinfo-tex-shell*")
+ (quit-process (get-process "texinfo-tex-shell") t)
+ (texinfo-tex-start-shell))
+ (cond ((null buffer-file-name)
+ (error "Buffer not visiting any file!"))
+ ((buffer-modified-p)
+ (error "Buffer has been modified since last saved!"))
+ (t (set-process-sentinel (get-process "texinfo-tex-shell")
+ 'texinfo-tex-shell-sentinel)
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-tex-shell-cd-command
+ " "
+ (file-name-directory
+ (buffer-file-name
+ (get-buffer buffer)))
+ "\n"))
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-tex-command " " buffer "\n "))
+
+ ;; so the texinfo-tex-print command works
+ (setq texinfo-tex-root-temp-file
+ (substring buffer 0
+ (or (string-match "\\.tex" buffer)
+ (length buffer))))
+
+ (texinfo-recenter-tex-output-buffer 0))))
+
+(defun texinfo-texindex ()
+ "Run texindex on unsorted index files.
+The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
+Runs the shell command defined by texinfo-texindex-command."
+ (interactive)
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-texindex-command
+ " " texinfo-tex-root-temp-file ".??" "\n"))
+ (texinfo-recenter-tex-output-buffer nil))
+
+(defun texinfo-tex-print ()
+ "Print .dvi file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
+Runs the shell command defined by texinfo-tex-dvi-print-command."
+ (interactive)
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-tex-dvi-print-command
+ " " texinfo-tex-root-temp-file ".dvi" "\n"))
+ (texinfo-recenter-tex-output-buffer nil))
+
+
+;;; Texinfo TeX utility functions
+
+(defun texinfo-tex-start-shell ()
+ (save-excursion
+ (require 'texinfo)
+ (set-buffer (make-shell "texinfo-tex-shell" "/bin/sh" nil "-v"))
+ (setq texinfo-tex-shell-map (copy-keymap shell-mode-map))
+ (texinfo-define-common-keys texinfo-tex-shell-map)
+ (use-local-map texinfo-tex-shell-map)
+ (run-hooks 'texinfo-tex-shell-hook)
+ (if (zerop (buffer-size))
+ (sleep-for 1))))
+
+(defun texinfo-quit-tex-job ()
+ "Quit currently running TeX job, by sending an `x' to it."
+ (interactive)
+ (if (not (get-process "texinfo-tex-shell"))
+ (error "No TeX shell running."))
+ (save-excursion
+ (set-buffer (get-buffer "*texinfo-tex-shell*"))
+ (goto-char (point-max))
+ (insert "x")
+ (shell-send-input)))
+
+(defun texinfo-kill-tex-job ()
+ "Kill the currently running TeX job."
+ (interactive)
+ (if (get-process "texinfo-tex-shell")
+ ;; Use `texinfo-tex-shell-sentinel' to restart
+ ;; texinfo-tex-shell after it is killed.
+ (kill-process (get-process "texinfo-tex-shell"))))
+
+(defun texinfo-tex-shell-sentinel (process event)
+ "Restart texinfo-tex-shell after it is killed."
+ (if (equal event "killed\n")
+ (save-excursion
+ (set-buffer "*texinfo-tex-shell*")
+ (insert "\n")
+ (texinfo-tex-start-shell))))
+
+(defun texinfo-recenter-tex-output-buffer (linenum)
+ "Redisplay buffer of TeX job output so that most recent output can be seen.
+The last line of the buffer is displayed on
+line LINE of the window, or centered if LINE is nil."
+ (interactive "P")
+ (let ((texinfo-tex-shell (get-buffer "*texinfo-tex-shell*"))
+ (old-buffer (current-buffer)))
+ (if (null texinfo-tex-shell)
+ (message "No TeX output buffer")
+ (pop-to-buffer texinfo-tex-shell)
+ (bury-buffer texinfo-tex-shell)
+ (goto-char (point-max))
+ (recenter (if linenum
+ (prefix-numeric-value linenum)
+ (/ (window-height) 2)))
+ (pop-to-buffer old-buffer)
+ )))
+
+(defun texinfo-show-tex-print-queue ()
+ "Show the print queue that \\[texinfo-tex-print] put your job on.
+Runs the shell command defined by texinfo-show-tex-queue-command."
+ (interactive)
+ (if (not (texinfo-tex-shell-running-p))
+ (texinfo-tex-start-shell))
+ (send-string "texinfo-tex-shell"
+ (concat texinfo-show-tex-queue-command "\n"))
+ (texinfo-recenter-tex-output-buffer nil))
+
+(defun texinfo-delete-from-tex-print-queue (job-number)
+ "Delete job from the line printer spooling queue.
+You are prompted for the job number (shown by a previous
+\\[texinfo-show-tex-print-queue] command."
+ (interactive "nPrinter job number for deletion: ")
+ (if (texinfo-tex-shell-running-p)
+ (texinfo-kill-tex-job)
+ (texinfo-tex-start-shell))
+ (send-string "texinfo-tex-shell"
+ (concat
+ texinfo-delete-from-print-queue-command
+ " "
+ job-number"\n"))
+ (texinfo-recenter-tex-output-buffer nil))
+
+(defun texinfo-tex-shell-running-p ()
+ (and (get-process "texinfo-tex-shell")
+ (eq (process-status (get-process "texinfo-tex-shell")) 'run)))
+
+
+;;; Place `provide' at end of file.
+(provide 'texnfo-tex)
+;;;;;;;;;;;;;;;; end texnfo-tex.el ;;;;;;;;;;;;;;;;
diff --git a/contrib/texinfo/emacs/texnfo-upd.el b/contrib/texinfo/emacs/texnfo-upd.el
new file mode 100644
index 000000000000..4827fe5f8190
--- /dev/null
+++ b/contrib/texinfo/emacs/texnfo-upd.el
@@ -0,0 +1,2058 @@
+;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
+
+;; Copyright 1989, 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
+
+;; Author: Robert J. Chassell
+;; Date: 12 Sep 1996
+;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
+;; Keywords: maint, tex, docs
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Known bug: update commands fail to ignore @ignore.
+
+;; Summary: how to use the updating commands
+
+;; The node and menu updating functions automatically
+
+;; * insert missing `@node' lines,
+;; * insert the `Next', `Previous' and `Up' pointers of a node,
+;; * insert or update the menu for a section,
+;; * create a master menu for a Texinfo source file.
+;;
+;; Passed an argument, the `texinfo-update-node' and
+;; `texinfo-make-menu' functions do their jobs in the region.
+;;
+;; In brief, the functions for creating or updating nodes and menus, are:
+;;
+;; texinfo-update-node (&optional region-p)
+;; texinfo-every-node-update ()
+;; texinfo-sequential-node-update (&optional region-p)
+;;
+;; texinfo-make-menu (&optional region-p)
+;; texinfo-all-menus-update ()
+;; texinfo-master-menu ()
+;;
+;; texinfo-insert-node-lines (&optional title-p)
+;;
+;; texinfo-indent-menu-description (column &optional region-p)
+
+;; The `texinfo-column-for-description' variable specifies the column to
+;; which menu descriptions are indented.
+
+;; Texinfo file structure
+;; ----------------------
+
+;; To use the updating commands, you must structure your Texinfo file
+;; hierarchically. Each `@node' line, with the exception of the top
+;; node, must be accompanied by some kind of section line, such as an
+;; `@chapter' or `@section' line. Each node-line/section-line
+;; combination must look like this:
+
+;; @node Lists and Tables, Cross References, Structuring, Top
+;; @comment node-name, next, previous, up
+;; @chapter Making Lists and Tables
+
+;; or like this (without the `@comment' line):
+
+;; @node Lists and Tables, Cross References, Structuring, Top
+;; @chapter Making Lists and Tables
+
+;; If the file has a `top' node, it must be called `top' or `Top' and
+;; be the first node in the file.
+
+
+;;; The update node functions described in detail
+
+;; The `texinfo-update-node' function without an argument inserts
+;; the correct next, previous and up pointers for the node in which
+;; point is located (i.e., for the node preceding point).
+
+;; With an argument, the `texinfo-update-node' function inserts the
+;; correct next, previous and up pointers for the nodes inside the
+;; region.
+
+;; It does not matter whether the `@node' line has pre-existing
+;; `Next', `Previous', or `Up' pointers in it. They are removed.
+
+;; The `texinfo-every-node-update' function runs `texinfo-update-node'
+;; on the whole buffer.
+
+;; The `texinfo-sequential-node-update' function inserts the
+;; immediately following and preceding node into the `Next' or
+;; `Previous' pointers regardless of their hierarchical level. This is
+;; only useful for certain kinds of text, like a novel, which you go
+;; through sequentially.
+
+
+;;; The menu making functions described in detail
+
+;; The `texinfo-make-menu' function without an argument creates or
+;; updates a menu for the section encompassing the node that follows
+;; point. With an argument, it makes or updates menus for the nodes
+;; within or part of the marked region.
+
+;; Whenever an existing menu is updated, the descriptions from
+;; that menu are incorporated into the new menu. This is done by copying
+;; descriptions from the existing menu to the entries in the new menu
+;; that have the same node names. If the node names are different, the
+;; descriptions are not copied to the new menu.
+
+;; Menu entries that refer to other Info files are removed since they
+;; are not a node within current buffer. This is a deficiency.
+
+;; The `texinfo-all-menus-update' function runs `texinfo-make-menu'
+;; on the whole buffer.
+
+;; The `texinfo-master-menu' function creates an extended menu located
+;; after the top node. (The file must have a top node.) The function
+;; first updates all the regular menus in the buffer (incorporating the
+;; descriptions from pre-existing menus), and then constructs a master
+;; menu that includes every entry from every other menu. (However, the
+;; function cannot update an already existing master menu; if one
+;; exists, it must be removed before calling the function.)
+
+;; The `texinfo-indent-menu-description' function indents every
+;; description in the menu following point, to the specified column.
+;; Non-nil argument (prefix, if interactive) means indent every
+;; description in every menu in the region. This function does not
+;; indent second and subsequent lines of a multi-line description.
+
+;; The `texinfo-insert-node-lines' function inserts `@node' before the
+;; `@chapter', `@section', and such like lines of a region in a Texinfo
+;; file where the `@node' lines are missing.
+;;
+;; With a non-nil argument (prefix, if interactive), the function not
+;; only inserts `@node' lines but also inserts the chapter or section
+;; titles as the names of the corresponding nodes; and inserts titles
+;; as node names in pre-existing `@node' lines that lack names.
+;;
+;; Since node names should be more concise than section or chapter
+;; titles, node names so inserted will need to be edited manually.
+
+
+;;; Code:
+
+;;; The menu making functions
+
+(defun texinfo-make-menu (&optional region-p)
+ "Without any prefix argument, make or update a menu.
+Make the menu for the section enclosing the node found following point.
+
+Non-nil argument (prefix, if interactive) means make or update menus
+for nodes within or part of the marked region.
+
+Whenever a menu exists, and is being updated, the descriptions that
+are associated with node names in the pre-existing menu are
+incorporated into the new menu. Otherwise, the nodes' section titles
+are inserted as descriptions."
+
+ (interactive "P")
+ (if (not region-p)
+ (let ((level (texinfo-hierarchic-level)))
+ (texinfo-make-one-menu level)
+ (message "Done...updated the menu. You may save the buffer."))
+ ;; else
+ (message "Making or updating menus in %s... " (buffer-name))
+ (let ((beginning (region-beginning))
+ (region-end (region-end))
+ (level (progn ; find section type following point
+ (goto-char (region-beginning))
+ (texinfo-hierarchic-level))))
+ (if (= region-end beginning)
+ (error "Please mark a region!"))
+ (save-excursion
+ (save-restriction
+ (widen)
+
+ (while (texinfo-find-lower-level-node level region-end)
+ (setq level (texinfo-hierarchic-level)) ; new, lower level
+ (texinfo-make-one-menu level))
+
+ (while (and (< (point) region-end)
+ (texinfo-find-higher-level-node level region-end))
+ (setq level (texinfo-hierarchic-level))
+ (while (texinfo-find-lower-level-node level region-end)
+ (setq level (texinfo-hierarchic-level)) ; new, lower level
+ (texinfo-make-one-menu level))))))
+ (message "Done...updated menus. You may save the buffer.")))
+
+(defun texinfo-make-one-menu (level)
+ "Make a menu of all the appropriate nodes in this section.
+`Appropriate nodes' are those associated with sections that are
+at the level specified by LEVEL. Point is left at the end of menu."
+ (let*
+ ((case-fold-search t)
+ (beginning
+ (save-excursion
+ (goto-char (texinfo-update-menu-region-beginning level))
+ (end-of-line)
+ (point)))
+ (end (texinfo-update-menu-region-end level))
+ (first (texinfo-menu-first-node beginning end))
+ (node-name (progn
+ (goto-char beginning)
+ (beginning-of-line)
+ (texinfo-copy-node-name)))
+ (new-menu-list (texinfo-make-menu-list beginning end level)))
+ (if (texinfo-old-menu-p beginning first)
+ (progn
+ (texinfo-incorporate-descriptions new-menu-list)
+ (texinfo-incorporate-menu-entry-names new-menu-list)
+ (texinfo-delete-old-menu beginning first)))
+ (texinfo-insert-menu new-menu-list node-name)))
+
+(defun texinfo-all-menus-update (&optional update-all-nodes-p)
+ "Update every regular menu in a Texinfo file.
+Update pre-existing master menu, if there is one.
+
+If called with a non-nil argument, this function first updates all the
+nodes in the buffer before updating the menus."
+ (interactive "P")
+ (let ((case-fold-search t)
+ master-menu-p)
+ (save-excursion
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ (message "Checking for a master menu in %s ... "(buffer-name))
+ (save-excursion
+ (if (re-search-forward texinfo-master-menu-header nil t)
+ ;; Remove detailed master menu listing
+ (progn
+ (setq master-menu-p t)
+ (goto-char (match-beginning 0))
+ (let ((end-of-detailed-menu-descriptions
+ (save-excursion ; beginning of end menu line
+ (goto-char (texinfo-menu-end))
+ (beginning-of-line) (forward-char -1)
+ (point))))
+ (delete-region (point) end-of-detailed-menu-descriptions)))))
+
+ (if update-all-nodes-p
+ (progn
+ (message "Updating all nodes in %s ... " (buffer-name))
+ (sleep-for 2)
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ ;; Using the mark to pass bounds this way
+ ;; is kludgy, but it's not worth fixing. -- rms.
+ (let ((mark-active t))
+ (texinfo-update-node t))))
+
+ (message "Updating all menus in %s ... " (buffer-name))
+ (sleep-for 2)
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ ;; Using the mark to pass bounds this way
+ ;; is kludgy, but it's not worth fixing. -- rms.
+ (let ((mark-active t))
+ (texinfo-make-menu t))
+
+ (if master-menu-p
+ (progn
+ (message "Updating the master menu in %s... " (buffer-name))
+ (sleep-for 2)
+ (texinfo-master-menu nil))))
+
+ (message "Done...updated all the menus. You may save the buffer.")))
+
+(defun texinfo-find-lower-level-node (level region-end)
+ "Search forward from point for node at any level lower than LEVEL.
+Search is limited to the end of the marked region, REGION-END,
+and to the end of the menu region for the level.
+
+Return t if the node is found, else nil. Leave point at the beginning
+of the node if one is found; else do not move point."
+ (let ((case-fold-search t))
+ (if (and (< (point) region-end)
+ (re-search-forward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ (eval (cdr (assoc level texinfo-update-menu-lower-regexps))))
+ ;; the next higher level node marks the end of this
+ ;; section, and no lower level node will be found beyond
+ ;; this position even if region-end is farther off
+ (texinfo-update-menu-region-end level)
+ t))
+ (goto-char (match-beginning 1)))))
+
+(defun texinfo-find-higher-level-node (level region-end)
+ "Search forward from point for node at any higher level than argument LEVEL.
+Search is limited to the end of the marked region, REGION-END.
+
+Return t if the node is found, else nil. Leave point at the beginning
+of the node if one is found; else do not move point."
+ (let ((case-fold-search t))
+ (cond
+ ((or (string-equal "top" level) (string-equal "chapter" level))
+ (if (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" region-end t)
+ (progn (beginning-of-line) t)))
+ (t
+ (if (re-search-forward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ (eval (cdr (assoc level texinfo-update-menu-higher-regexps))))
+ region-end t)
+ (progn (beginning-of-line) t))))))
+
+
+;;; Making the list of new menu entries
+
+(defun texinfo-make-menu-list (beginning end level)
+ "Make a list of node names and their descriptions.
+Point is left at the end of the menu region, but the menu is not inserted.
+
+First argument is position from which to start making menu list;
+second argument is end of region in which to try to locate entries;
+third argument is the level of the nodes that are the entries.
+
+Node names and descriptions are dotted pairs of strings. Each pair is
+an element of the list. If the description does not exist, the
+element consists only of the node name."
+ (goto-char beginning)
+ (let (new-menu-list)
+ (while (texinfo-menu-locate-entry-p level end)
+ (setq new-menu-list
+ (cons (cons
+ (texinfo-copy-node-name)
+ (prog1 "" (forward-line 1)))
+ ;; Use following to insert section titles automatically.
+ ;; (texinfo-copy-section-title))
+ new-menu-list)))
+ (reverse new-menu-list)))
+
+(defun texinfo-menu-locate-entry-p (level search-end)
+ "Find a node that will be part of menu for this section.
+First argument is a string such as \"section\" specifying the general
+hierarchical level of the menu; second argument is a position
+specifying the end of the search.
+
+The function returns t if the node is found, else nil. It searches
+forward from point, and leaves point at the beginning of the node.
+
+The function finds entries of the same type. Thus `subsections' and
+`unnumberedsubsecs' will appear in the same menu."
+ (let ((case-fold-search t))
+ (if (re-search-forward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ (eval
+ (cdr (assoc level texinfo-update-menu-same-level-regexps))))
+ search-end
+ t)
+ (goto-char (match-beginning 1)))))
+
+(defun texinfo-copy-node-name ()
+ "Return the node name as a string.
+
+Start with point at the beginning of the node line; copy the text
+after the node command up to the first comma on the line, if any, and
+return the text as a string. Leaves point at the beginning of the
+line. If there is no node name, returns an empty string."
+
+ (save-excursion
+ (buffer-substring
+ (progn (forward-word 1) ; skip over node command
+ (skip-chars-forward " \t") ; and over spaces
+ (point))
+ (if (search-forward
+ ","
+ (save-excursion (end-of-line) (point)) t) ; bound search
+ (1- (point))
+ (end-of-line) (point)))))
+
+(defun texinfo-copy-section-title ()
+ "Return the title of the section as a string.
+The title is used as a description line in the menu when one does not
+already exist.
+
+Move point to the beginning of the appropriate section line by going
+to the start of the text matched by last regexp searched for, which
+must have been done by `texinfo-menu-locate-entry-p'."
+
+ ;; could use the same re-search as in `texinfo-menu-locate-entry-p'
+ ;; instead of using `match-beginning'; such a variation would be
+ ;; more general, but would waste information already collected
+
+ (goto-char (match-beginning 7)) ; match section name
+
+ (buffer-substring
+ (progn (forward-word 1) ; skip over section type
+ (skip-chars-forward " \t") ; and over spaces
+ (point))
+ (progn (end-of-line) (point))))
+
+
+;;; Handling the old menu
+
+(defun texinfo-old-menu-p (beginning first)
+ "Move point to the beginning of the menu for this section, if any.
+Otherwise move point to the end of the first node of this section.
+Return t if a menu is found, nil otherwise.
+
+First argument is the position of the beginning of the section in which
+the menu will be located; second argument is the position of the first
+node within the section.
+
+If no menu is found, the function inserts two newlines just before the
+end of the section, and leaves point there where a menu ought to be."
+ (goto-char beginning)
+ (if (not (re-search-forward "^@menu" first 'goto-end))
+ (progn (insert "\n\n") (forward-line -2) nil)
+ t))
+
+(defun texinfo-incorporate-descriptions (new-menu-list)
+ "Copy the old menu line descriptions that exist to the new menu.
+
+Point must be at beginning of old menu.
+
+If the node-name of the new menu is found in the old menu, insert the
+old description into the new entry.
+
+For this function, the new menu is a list made up of lists of dotted
+pairs in which the first element of the pair is the node name and the
+second element the description. The new menu is changed destructively.
+The old menu is the menu as it appears in the texinfo file."
+
+ (let ((new-menu-list-pointer new-menu-list)
+ (end-of-menu (texinfo-menu-end)))
+ (while new-menu-list
+ (save-excursion ; keep point at beginning of menu
+ (if (re-search-forward
+ ;; Existing nodes can have the form
+ ;; * NODE NAME:: DESCRIPTION
+ ;; or
+ ;; * MENU ITEM: NODE NAME. DESCRIPTION.
+ ;;
+ ;; Recognize both when looking for the description.
+ (concat "\\* \\(" ; so only menu entries are found
+ (car (car new-menu-list)) "::"
+ "\\|"
+ ".*: " (car (car new-menu-list)) "[.,\t\n]"
+ "\\)"
+ ) ; so only complete entries are found
+ end-of-menu
+ t)
+ (setcdr (car new-menu-list)
+ (texinfo-menu-copy-old-description end-of-menu))))
+ (setq new-menu-list (cdr new-menu-list)))
+ (setq new-menu-list new-menu-list-pointer)))
+
+(defun texinfo-incorporate-menu-entry-names (new-menu-list)
+ "Copy any old menu entry names to the new menu.
+
+Point must be at beginning of old menu.
+
+If the node-name of the new menu entry cannot be found in the old
+menu, do nothing.
+
+For this function, the new menu is a list made up of lists of dotted
+pairs in which the first element of the pair is the node name and the
+second element is the description (or nil).
+
+If we find an existing menu entry name, we change the first element of
+the pair to be another dotted pair in which the car is the menu entry
+name and the cdr is the node name.
+
+NEW-MENU-LIST is changed destructively. The old menu is the menu as it
+appears in the texinfo file."
+
+ (let ((new-menu-list-pointer new-menu-list)
+ (end-of-menu (texinfo-menu-end)))
+ (while new-menu-list
+ (save-excursion ; keep point at beginning of menu
+ (if (re-search-forward
+ ;; Existing nodes can have the form
+ ;; * NODE NAME:: DESCRIPTION
+ ;; or
+ ;; * MENU ITEM: NODE NAME. DESCRIPTION.
+ ;;
+ ;; We're interested in the second case.
+ (concat "\\* " ; so only menu entries are found
+ "\\(.*\\): " (car (car new-menu-list)) "[.,\t\n]")
+ end-of-menu
+ t)
+ (setcar
+ (car new-menu-list) ; replace the node name
+ (cons (buffer-substring (match-beginning 1) (match-end 1))
+ (car (car new-menu-list)))))
+ (setq new-menu-list (cdr new-menu-list))))
+ (setq new-menu-list new-menu-list-pointer)))
+
+(defun texinfo-menu-copy-old-description (end-of-menu)
+ "Return description field of old menu line as string.
+Point must be located just after the node name. Point left before description.
+Single argument, END-OF-MENU, is position limiting search."
+ (skip-chars-forward "[:.,\t\n ]+")
+ ;; don't copy a carriage return at line beginning with asterisk!
+ ;; do copy a description that begins with an `@'!
+ ;; !! Known bug: does not copy descriptions starting with ^|\{?* etc.
+ (if (and (looking-at "\\(\\w+\\|@\\)")
+ (not (looking-at "\\(^\\* \\|^@end menu\\)")))
+ (buffer-substring
+ (point)
+ (save-excursion
+ (re-search-forward "\\(^\\* \\|^@end menu\\)" end-of-menu t)
+ (forward-line -1)
+ (end-of-line) ; go to end of last description line
+ (point)))
+ ""))
+
+(defun texinfo-menu-end ()
+ "Return position of end of menu. Does not change location of point.
+Signal an error if not end of menu."
+ (save-excursion
+ (if (re-search-forward "^@end menu" nil t)
+ (point)
+ (error "Menu does not have an end."))))
+
+(defun texinfo-delete-old-menu (beginning first)
+ "Delete the old menu. Point must be in or after menu.
+First argument is position of the beginning of the section in which
+the menu will be located; second argument is the position of the first
+node within the section."
+ ;; No third arg to search, so error if search fails.
+ (re-search-backward "^@menu" beginning)
+ (delete-region (point)
+ (save-excursion
+ (re-search-forward "^@end menu" first)
+ (point))))
+
+
+;;; Inserting new menu
+
+;; try 32, but perhaps 24 is better
+(defvar texinfo-column-for-description 32
+ "*Column at which descriptions start in a Texinfo menu.")
+
+(defun texinfo-insert-menu (menu-list node-name)
+ "Insert formatted menu at point.
+Indents the first line of the description, if any, to the value of
+texinfo-column-for-description.
+
+MENU-LIST has form:
+
+ \(\(\"node-name1\" . \"description\"\)
+ \(\"node-name2\" . \"description\"\) ... \)
+
+However, the description field might be nil.
+
+Also, the node-name field might itself be a dotted pair (call it P) of
+strings instead of just a string. In that case, the car of P
+is the menu entry name, and the cdr of P is the node name."
+
+ (insert "@menu\n")
+ (while menu-list
+ ;; Every menu entry starts with a star and a space.
+ (insert "* ")
+
+ ;; Insert the node name (and menu entry name, if present).
+ (let ((node-part (car (car menu-list))))
+ (if (stringp node-part)
+ ;; "Double colon" entry line; menu entry and node name are the same,
+ (insert (format "%s::" node-part))
+ ;; "Single colon" entry line; menu entry and node name are different.
+ (insert (format "%s: %s." (car node-part) (cdr node-part)))))
+
+ ;; Insert the description, if present.
+ (if (cdr (car menu-list))
+ (progn
+ ;; Move to right place.
+ (indent-to texinfo-column-for-description 2)
+ ;; Insert description.
+ (insert (format "%s" (cdr (car menu-list))))))
+
+ (insert "\n") ; end this menu entry
+ (setq menu-list (cdr menu-list)))
+ (insert "@end menu")
+ (message
+ "Updated \"%s\" level menu following node: %s ... " level node-name))
+
+
+;;; Starting menu descriptions by inserting titles
+
+(defun texinfo-start-menu-description ()
+ "In this menu entry, insert the node's section title as a description.
+Position point at beginning of description ready for editing.
+Do not insert a title if the line contains an existing description.
+
+You will need to edit the inserted text since a useful description
+complements the node name rather than repeats it as a title does."
+
+ (interactive)
+ (let (beginning end node-name title)
+ (save-excursion
+ (beginning-of-line)
+ (if (search-forward "* " (save-excursion (end-of-line) (point)) t)
+ (progn (skip-chars-forward " \t")
+ (setq beginning (point)))
+ (error "This is not a line in a menu!"))
+
+ (cond
+ ;; "Double colon" entry line; menu entry and node name are the same,
+ ((search-forward "::" (save-excursion (end-of-line) (point)) t)
+ (if (looking-at "[ \t]*[^ \t\n]+")
+ (error "Descriptive text already exists."))
+ (skip-chars-backward ": \t")
+ (setq node-name (buffer-substring beginning (point))))
+
+ ;; "Single colon" entry line; menu entry and node name are different.
+ ((search-forward ":" (save-excursion (end-of-line) (point)) t)
+ (skip-chars-forward " \t")
+ (setq beginning (point))
+ ;; Menu entry line ends in a period, comma, or tab.
+ (if (re-search-forward "[.,\t]"
+ (save-excursion (forward-line 1) (point)) t)
+ (progn
+ (if (looking-at "[ \t]*[^ \t\n]+")
+ (error "Descriptive text already exists."))
+ (skip-chars-backward "., \t")
+ (setq node-name (buffer-substring beginning (point))))
+ ;; Menu entry line ends in a return.
+ (re-search-forward ".*\n"
+ (save-excursion (forward-line 1) (point)) t)
+ (skip-chars-backward " \t\n")
+ (setq node-name (buffer-substring beginning (point)))
+ (if (= 0 (length node-name))
+ (error "No node name on this line.")
+ (insert "."))))
+ (t (error "No node name on this line.")))
+ ;; Search for node that matches node name, and copy the section title.
+ (if (re-search-forward
+ (concat
+ "^@node[ \t]+"
+ node-name
+ ".*\n" ; match node line
+ "\\("
+ "\\(\\(^@c \\|^@comment\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\)?")
+ nil t)
+ (progn
+ (setq title
+ (buffer-substring
+ ;; skip over section type
+ (progn (forward-word 1)
+ ;; and over spaces
+ (skip-chars-forward " \t")
+ (point))
+ (progn (end-of-line)
+ (skip-chars-backward " \t")
+ (point)))))
+ (error "Cannot find node to match node name in menu entry.")))
+ ;; Return point to the menu and insert the title.
+ (end-of-line)
+ (delete-region
+ (point)
+ (save-excursion (skip-chars-backward " \t") (point)))
+ (indent-to texinfo-column-for-description 2)
+ (save-excursion (insert title))))
+
+
+;;; Handling description indentation
+
+;; Since the make-menu functions indent descriptions, these functions
+;; are useful primarily for indenting a single menu specially.
+
+(defun texinfo-indent-menu-description (column &optional region-p)
+ "Indent every description in menu following point to COLUMN.
+Non-nil argument (prefix, if interactive) means indent every
+description in every menu in the region. Does not indent second and
+subsequent lines of a multi-line description."
+
+ (interactive
+ "nIndent menu descriptions to (column number): \nP")
+ (save-excursion
+ (save-restriction
+ (widen)
+ (if (not region-p)
+ (progn
+ (re-search-forward "^@menu")
+ (texinfo-menu-indent-description column)
+ (message
+ "Indented descriptions in menu. You may save the buffer."))
+ ;;else
+ (message "Indenting every menu description in region... ")
+ (goto-char (region-beginning))
+ (while (and (< (point) (region-end))
+ (texinfo-locate-menu-p))
+ (forward-line 1)
+ (texinfo-menu-indent-description column))
+ (message "Indenting done. You may save the buffer.")))))
+
+(defun texinfo-menu-indent-description (to-column-number)
+ "Indent the Texinfo file menu description to TO-COLUMN-NUMBER.
+Start with point just after the word `menu' in the `@menu' line and
+leave point on the line before the `@end menu' line. Does not indent
+second and subsequent lines of a multi-line description."
+ (let* ((beginning-of-next-line (point)))
+ (while (< beginning-of-next-line
+ (save-excursion ; beginning of end menu line
+ (goto-char (texinfo-menu-end))
+ (beginning-of-line)
+ (point)))
+
+ (if (re-search-forward "\\* \\(.*::\\|.*: [^.,\t\n]+[.,\t]\\)"
+ (texinfo-menu-end)
+ t)
+ (progn
+ (let ((beginning-white-space (point)))
+ (skip-chars-forward " \t") ; skip over spaces
+ (if (looking-at "\\(@\\|\\w\\)+") ; if there is text
+ (progn
+ ;; remove pre-existing indentation
+ (delete-region beginning-white-space (point))
+ (indent-to-column to-column-number))))))
+ ;; position point at beginning of next line
+ (forward-line 1)
+ (setq beginning-of-next-line (point)))))
+
+
+;;; Making the master menu
+
+(defun texinfo-master-menu (update-all-nodes-menus-p)
+ "Make a master menu for a whole Texinfo file.
+Non-nil argument (prefix, if interactive) means first update all
+existing nodes and menus. Remove pre-existing master menu, if there is one.
+
+This function creates a master menu that follows the top node. The
+master menu includes every entry from all the other menus. It
+replaces any existing ordinary menu that follows the top node.
+
+If called with a non-nil argument, this function first updates all the
+menus in the buffer (incorporating descriptions from pre-existing
+menus) before it constructs the master menu.
+
+The function removes the detailed part of an already existing master
+menu. This action depends on the pre-existing master menu using the
+standard `texinfo-master-menu-header'.
+
+The master menu has the following format, which is adapted from the
+recommendation in the Texinfo Manual:
+
+ * The first part contains the major nodes in the Texinfo file: the
+ nodes for the chapters, chapter-like sections, and the major
+ appendices. This includes the indices, so long as they are in
+ chapter-like sections, such as unnumbered sections.
+
+ * The second and subsequent parts contain a listing of the other,
+ lower level menus, in order. This way, an inquirer can go
+ directly to a particular node if he or she is searching for
+ specific information.
+
+Each of the menus in the detailed node listing is introduced by the
+title of the section containing the menu."
+
+ (interactive "P")
+ (let ((case-fold-search t))
+ (widen)
+ (goto-char (point-min))
+
+ ;; Move point to location after `top'.
+ (if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
+ (error "This buffer needs a Top node!"))
+
+ (let ((first-chapter
+ (save-excursion
+ (or (re-search-forward "^@node" nil t)
+ (error "Too few nodes for a master menu!"))
+ (point))))
+ (if (re-search-forward texinfo-master-menu-header first-chapter t)
+ ;; Remove detailed master menu listing
+ (progn
+ (goto-char (match-beginning 0))
+ (let ((end-of-detailed-menu-descriptions
+ (save-excursion ; beginning of end menu line
+ (goto-char (texinfo-menu-end))
+ (beginning-of-line) (forward-char -1)
+ (point))))
+ (delete-region (point) end-of-detailed-menu-descriptions)))))
+
+ (if update-all-nodes-menus-p
+ (progn
+ (message "Making a master menu in %s ...first updating all nodes... "
+ (buffer-name))
+ (sleep-for 2)
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ (texinfo-update-node t)
+
+ (message "Updating all menus in %s ... " (buffer-name))
+ (sleep-for 2)
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ (texinfo-make-menu t)))
+
+ (message "Now making the master menu in %s... " (buffer-name))
+ (sleep-for 2)
+ (goto-char (point-min))
+ (texinfo-insert-master-menu-list
+ (texinfo-master-menu-list))
+
+ ;; Remove extra newlines that texinfo-insert-master-menu-list
+ ;; may have inserted.
+
+ (save-excursion
+ (goto-char (point-min))
+
+ (if (re-search-forward texinfo-master-menu-header nil t)
+ (progn
+ (goto-char (match-beginning 0))
+ (insert "\n")
+ (delete-blank-lines)
+ (goto-char (point-min))))
+
+ (re-search-forward "^@menu")
+ (forward-line -1)
+ (delete-blank-lines)
+
+ (re-search-forward "^@end menu")
+ (forward-line 1)
+ (delete-blank-lines))
+
+ (message
+ "Done...completed making master menu. You may save the buffer.")))
+
+(defun texinfo-master-menu-list ()
+ "Return a list of menu entries and header lines for the master menu.
+
+Start with the menu for chapters and indices and then find each
+following menu and the title of the node preceding that menu.
+
+The master menu list has this form:
+
+ \(\(\(... \"entry-1-2\" \"entry-1\"\) \"title-1\"\)
+ \(\(... \"entry-2-2\" \"entry-2-1\"\) \"title-2\"\)
+ ...\)
+
+However, there does not need to be a title field."
+
+ (let (master-menu-list)
+ (while (texinfo-locate-menu-p)
+ (setq master-menu-list
+ (cons (list
+ (texinfo-copy-menu)
+ (texinfo-copy-menu-title))
+ master-menu-list)))
+ (reverse master-menu-list)))
+
+(defun texinfo-insert-master-menu-list (master-menu-list)
+ "Format and insert the master menu in the current buffer."
+ (goto-char (point-min))
+ ;; Insert a master menu only after `Top' node and before next node
+ ;; \(or include file if there is no next node\).
+ (if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
+ (error "This buffer needs a Top node!"))
+ (let ((first-chapter
+ (save-excursion (re-search-forward "^@node\\|^@include") (point))))
+ (if (not (re-search-forward "^@menu" first-chapter t))
+ (error
+ "Buffer lacks ordinary `Top' menu in which to insert master.")))
+ (beginning-of-line)
+ (delete-region ; buffer must have ordinary top menu
+ (point)
+ (save-excursion (re-search-forward "^@end menu") (point)))
+
+ (save-excursion ; leave point at beginning of menu
+ ;; Handle top of menu
+ (insert "\n@menu\n")
+ ;; Insert chapter menu entries
+ (setq this-very-menu-list (reverse (car (car master-menu-list))))
+ ;; Tell user what is going on.
+ (message "Inserting chapter menu entry: %s ... " this-very-menu-list)
+ (while this-very-menu-list
+ (insert "* " (car this-very-menu-list) "\n")
+ (setq this-very-menu-list (cdr this-very-menu-list)))
+
+ (setq master-menu-list (cdr master-menu-list))
+
+ ;; Only insert detailed master menu if there is one....
+ (if (car (car master-menu-list))
+;; @detailmenu added 5 Sept 1996 at Karl Berry's request to avert a
+;; bug in `makeinfo'; all agree this is a bad kluge and should
+;; eventually be removed. @detailmenu ... @end detailmenu is a noop
+;; in `texinfmt.el' See @end detailmenu below
+;; also see `texinfo-all-menus-update' above, `texinfo-master-menu',
+;; `texinfo-multiple-files-update'
+ (insert texinfo-master-menu-header))
+
+ ;; Now, insert all the other menus
+
+ ;; The menu master-menu-list has a form like this:
+ ;; ((("beta" "alpha") "title-A")
+ ;; (("delta" "gamma") "title-B"))
+
+ (while master-menu-list
+
+ (message
+ "Inserting menu for %s .... " (car (cdr (car master-menu-list))))
+ ;; insert title of menu section
+ (insert "\n" (car (cdr (car master-menu-list))) "\n\n")
+
+ ;; insert each menu entry
+ (setq this-very-menu-list (reverse (car (car master-menu-list))))
+ (while this-very-menu-list
+ (insert "* " (car this-very-menu-list) "\n")
+ (setq this-very-menu-list (cdr this-very-menu-list)))
+
+ (setq master-menu-list (cdr master-menu-list)))
+
+ ;; Finish menu
+;; @detailmenu (see note above)
+ (insert "\n@end detailmenu")
+ (insert "\n@end menu\n\n")))
+
+(defvar texinfo-master-menu-header
+ "\n@detailmenu\n --- The Detailed Node Listing ---\n"
+ "String inserted before lower level entries in Texinfo master menu.
+It comes after the chapter-level menu entries.")
+
+(defun texinfo-locate-menu-p ()
+ "Find the next menu in the texinfo file.
+If found, leave point after word `menu' on the `@menu' line, and return t.
+If a menu is not found, do not move point and return nil."
+ (re-search-forward "\\(^@menu\\)" nil t))
+
+(defun texinfo-copy-menu-title ()
+ "Return the title of the section preceding the menu as a string.
+If such a title cannot be found, return an empty string. Do not move
+point."
+ (let ((case-fold-search t))
+ (save-excursion
+ (if (re-search-backward
+ (concat
+ "\\(^@top"
+ "\\|" ; or
+ texinfo-section-types-regexp ; all other section types
+ "\\)")
+ nil
+ t)
+ (progn
+ (beginning-of-line)
+ (forward-word 1) ; skip over section type
+ (skip-chars-forward " \t") ; and over spaces
+ (buffer-substring
+ (point)
+ (progn (end-of-line) (point))))
+ ""))))
+
+(defun texinfo-copy-menu ()
+ "Return the entries of an existing menu as a list.
+Start with point just after the word `menu' in the `@menu' line
+and leave point on the line before the `@end menu' line."
+ (let* (this-menu-list
+ (end-of-menu (texinfo-menu-end)) ; position of end of `@end menu'
+ (last-entry (save-excursion ; position of beginning of
+ ; last `* ' entry
+ (goto-char end-of-menu)
+ ;; handle multi-line description
+ (if (not (re-search-backward "^\\* " nil t))
+ (error "No entries in menu."))
+ (point))))
+ (while (< (point) last-entry)
+ (if (re-search-forward "^\\* " end-of-menu t)
+ (progn
+ (setq this-menu-list
+ (cons
+ (buffer-substring
+ (point)
+ ;; copy multi-line descriptions
+ (save-excursion
+ (re-search-forward "\\(^\\* \\|^@e\\)" nil t)
+ (- (point) 3)))
+ this-menu-list)))))
+ this-menu-list))
+
+
+;;; Determining the hierarchical level in the texinfo file
+
+(defun texinfo-specific-section-type ()
+ "Return the specific type of next section, as a string.
+For example, \"unnumberedsubsec\". Return \"top\" for top node.
+
+Searches forward for a section. Hence, point must be before the
+section whose type will be found. Does not move point. Signal an
+error if the node is not the top node and a section is not found."
+ (let ((case-fold-search t))
+ (save-excursion
+ (cond
+ ((re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)"
+;;; Following search limit by cph but causes a bug
+;;; (save-excursion
+;;; (end-of-line)
+;;; (point))
+ nil
+ t)
+ "top")
+ ((re-search-forward texinfo-section-types-regexp nil t)
+ (buffer-substring-no-properties
+ (progn (beginning-of-line) ; copy its name
+ (1+ (point)))
+ (progn (forward-word 1)
+ (point))))
+ (t
+ (error
+ "texinfo-specific-section-type: Chapter or section not found."))))))
+
+(defun texinfo-hierarchic-level ()
+ "Return the general hierarchal level of the next node in a texinfo file.
+Thus, a subheading or appendixsubsec is of type subsection."
+ (let ((case-fold-search t))
+ (cdr (assoc
+ (texinfo-specific-section-type)
+ texinfo-section-to-generic-alist))))
+
+
+;;; Locating the major positions
+
+(defun texinfo-update-menu-region-beginning (level)
+ "Locate beginning of higher level section this section is within.
+Return position of the beginning of the node line; do not move point.
+Thus, if this level is subsection, searches backwards for section node.
+Only argument is a string of the general type of section."
+ (let ((case-fold-search t))
+ ;; !! Known bug: if section immediately follows top node, this
+ ;; returns the beginning of the buffer as the beginning of the
+ ;; higher level section.
+ (cond
+ ((or (string-equal "top" level)
+ (string-equal "chapter" level))
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t)
+ (beginning-of-line)
+ (point)))
+ (t
+ (save-excursion
+ (re-search-backward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ (eval
+ (cdr (assoc level texinfo-update-menu-higher-regexps))))
+ nil
+ 'goto-beginning)
+ (point))))))
+
+(defun texinfo-update-menu-region-end (level)
+ "Locate end of higher level section this section is within.
+Return position; do not move point. Thus, if this level is a
+subsection, find the node for the section this subsection is within.
+If level is top or chapter, returns end of file. Only argument is a
+string of the general type of section."
+ (let ((case-fold-search t))
+ (save-excursion
+ (if (re-search-forward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ (eval
+ ;; Never finds end of level above chapter so goes to end.
+ (cdr (assoc level texinfo-update-menu-higher-regexps))))
+ nil
+ 'goto-end)
+ (match-beginning 1)
+ (point-max)))))
+
+(defun texinfo-menu-first-node (beginning end)
+ "Locate first node of the section the menu will be placed in.
+Return position; do not move point.
+The menu will be located just before this position.
+
+First argument is the position of the beginning of the section in
+which the menu will be located; second argument is the position of the
+end of that region; it limits the search."
+
+ (save-excursion
+ (goto-char beginning)
+ (forward-line 1)
+ (re-search-forward "^@node" end t)
+ (beginning-of-line)
+ (point)))
+
+
+;;; Alists and regular expressions for defining hierarchical levels
+
+(defvar texinfo-section-to-generic-alist
+ '(("top" . "top")
+
+ ("chapter" . "chapter")
+ ("unnumbered" . "chapter")
+ ("majorheading" . "chapter")
+ ("chapheading" . "chapter")
+ ("appendix" . "chapter")
+
+ ("section" . "section")
+ ("unnumberedsec" . "section")
+ ("heading" . "section")
+ ("appendixsec" . "section")
+
+ ("subsection" . "subsection")
+ ("unnumberedsubsec" . "subsection")
+ ("subheading" . "subsection")
+ ("appendixsubsec" . "subsection")
+
+ ("subsubsection" . "subsubsection")
+ ("unnumberedsubsubsec" . "subsubsection")
+ ("subsubheading" . "subsubsection")
+ ("appendixsubsubsec" . "subsubsection"))
+ "*An alist of specific and corresponding generic Texinfo section types.
+The keys are strings specifying specific types of section; the values
+are strings of their corresponding general types.")
+
+;; We used to look for just sub, but that found @subtitle.
+(defvar texinfo-section-types-regexp
+ "^@\\(chapter \\|sect\\|subs\\|subh\\|unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
+ "Regexp matching chapter, section, other headings (but not the top node).")
+
+(defvar texinfo-chapter-level-regexp
+ "chapter\\|unnumbered \\|appendix \\|majorheading\\|chapheading"
+ "Regular expression matching just the Texinfo chapter level headings.")
+
+(defvar texinfo-section-level-regexp
+ "section\\|unnumberedsec\\|heading \\|appendixsec"
+ "Regular expression matching just the Texinfo section level headings.")
+
+(defvar texinfo-subsection-level-regexp
+ "subsection\\|unnumberedsubsec\\|subheading\\|appendixsubsec"
+ "Regular expression matching just the Texinfo subsection level headings.")
+
+(defvar texinfo-subsubsection-level-regexp
+ "subsubsection\\|unnumberedsubsubsec\\|subsubheading\\|appendixsubsubsec"
+ "Regular expression matching just the Texinfo subsubsection level headings.")
+
+(defvar texinfo-update-menu-same-level-regexps
+ '(("top" . "top[ \t]+")
+ ("chapter" .
+ (concat "\\(^@\\)\\(" texinfo-chapter-level-regexp "\\)[ \t]*"))
+ ("section" .
+ (concat "\\(^@\\)\\(" texinfo-section-level-regexp "\\)[ \t]*"))
+ ("subsection" .
+ (concat "\\(^@\\)\\(" texinfo-subsection-level-regexp "\\)[ \t]+"))
+ ("subsubsection" .
+ (concat "\\(^@\\)\\(" texinfo-subsubsection-level-regexp "\\)[ \t]+")))
+ "*Regexps for searching for same level sections in a Texinfo file.
+The keys are strings specifying the general hierarchical level in the
+document; the values are regular expressions.")
+
+(defvar texinfo-update-menu-higher-regexps
+ '(("top" . "^@node [ \t]*DIR")
+ ("chapter" . "^@node [ \t]*top[ \t]*\\(,\\|$\\)")
+ ("section" .
+ (concat
+ "\\(^@\\("
+ texinfo-chapter-level-regexp
+ "\\)[ \t]*\\)"))
+ ("subsection" .
+ (concat
+ "\\(^@\\("
+ texinfo-section-level-regexp
+ "\\|"
+ texinfo-chapter-level-regexp
+ "\\)[ \t]*\\)"))
+ ("subsubsection" .
+ (concat
+ "\\(^@\\("
+ texinfo-subsection-level-regexp
+ "\\|"
+ texinfo-section-level-regexp
+ "\\|"
+ texinfo-chapter-level-regexp
+ "\\)[ \t]*\\)")))
+ "*Regexps for searching for higher level sections in a Texinfo file.
+The keys are strings specifying the general hierarchical level in the
+document; the values are regular expressions.")
+
+(defvar texinfo-update-menu-lower-regexps
+ '(("top" .
+ (concat
+ "\\(^@\\("
+ texinfo-chapter-level-regexp
+ "\\|"
+ texinfo-section-level-regexp
+ "\\|"
+ texinfo-subsection-level-regexp
+ "\\|"
+ texinfo-subsubsection-level-regexp
+ "\\)[ \t]*\\)"))
+ ("chapter" .
+ (concat
+ "\\(^@\\("
+ texinfo-section-level-regexp
+ "\\|"
+ texinfo-subsection-level-regexp
+ "\\|"
+ texinfo-subsubsection-level-regexp
+ "\\)[ \t]*\\)"))
+ ("section" .
+ (concat
+ "\\(^@\\("
+ texinfo-subsection-level-regexp
+ "\\|"
+ texinfo-subsubsection-level-regexp
+ "\\)[ \t]+\\)"))
+ ("subsection" .
+ (concat
+ "\\(^@\\("
+ texinfo-subsubsection-level-regexp
+ "\\)[ \t]+\\)"))
+ ("subsubsection" . "nothing lower"))
+ "*Regexps for searching for lower level sections in a Texinfo file.
+The keys are strings specifying the general hierarchical level in the
+document; the values are regular expressions.")
+
+
+;;; Updating a node
+
+;;;###autoload
+(defun texinfo-update-node (&optional region-p)
+ "Without any prefix argument, update the node in which point is located.
+Non-nil argument (prefix, if interactive) means update the nodes in the
+marked region.
+
+The functions for creating or updating nodes and menus, and their
+keybindings, are:
+
+ texinfo-update-node (&optional region-p) \\[texinfo-update-node]
+ texinfo-every-node-update () \\[texinfo-every-node-update]
+ texinfo-sequential-node-update (&optional region-p)
+
+ texinfo-make-menu (&optional region-p) \\[texinfo-make-menu]
+ texinfo-all-menus-update () \\[texinfo-all-menus-update]
+ texinfo-master-menu ()
+
+ texinfo-indent-menu-description (column &optional region-p)
+
+The `texinfo-column-for-description' variable specifies the column to
+which menu descriptions are indented. Its default value is 32."
+
+ (interactive "P")
+ (if (not region-p)
+ ;; update a single node
+ (let ((auto-fill-function nil) (auto-fill-hook nil))
+ (if (not (re-search-backward "^@node" (point-min) t))
+ (error "Node line not found before this position."))
+ (texinfo-update-the-node)
+ (message "Done...updated the node. You may save the buffer."))
+ ;; else
+ (let ((auto-fill-function nil)
+ (auto-fill-hook nil)
+ (beginning (region-beginning))
+ (end (region-end)))
+ (if (= end beginning)
+ (error "Please mark a region!"))
+ (save-restriction
+ (narrow-to-region beginning end)
+ (goto-char beginning)
+ (push-mark (point) t)
+ (while (re-search-forward "^@node" (point-max) t)
+ (beginning-of-line)
+ (texinfo-update-the-node))
+ (message "Done...updated nodes in region. You may save the buffer.")))))
+
+;;;###autoload
+(defun texinfo-every-node-update ()
+ "Update every node in a Texinfo file."
+ (interactive)
+ (save-excursion
+ (push-mark (point-max) t)
+ (goto-char (point-min))
+ ;; Using the mark to pass bounds this way
+ ;; is kludgy, but it's not worth fixing. -- rms.
+ (let ((mark-active t))
+ (texinfo-update-node t))
+ (message "Done...updated every node. You may save the buffer.")))
+
+(defun texinfo-update-the-node ()
+ "Update one node. Point must be at the beginning of node line.
+Leave point at the end of the node line."
+ (texinfo-check-for-node-name)
+ (texinfo-delete-existing-pointers)
+ (message "Updating node: %s ... " (texinfo-copy-node-name))
+ (save-restriction
+ (widen)
+ (let*
+ ((case-fold-search t)
+ (level (texinfo-hierarchic-level))
+ (beginning (texinfo-update-menu-region-beginning level))
+ (end (texinfo-update-menu-region-end level)))
+ (if (string-equal level "top")
+ (texinfo-top-pointer-case)
+ ;; else
+ (texinfo-insert-pointer beginning end level 'next)
+ (texinfo-insert-pointer beginning end level 'previous)
+ (texinfo-insert-pointer beginning end level 'up)
+ (texinfo-clean-up-node-line)))))
+
+(defun texinfo-top-pointer-case ()
+ "Insert pointers in the Top node. This is a special case.
+
+The `Next' pointer is a pointer to a chapter or section at a lower
+hierarchical level in the file. The `Previous' and `Up' pointers are
+to `(dir)'. Point must be at the beginning of the node line, and is
+left at the end of the node line."
+
+ (texinfo-clean-up-node-line)
+ (insert ", "
+ (save-excursion
+ ;; There may be an @chapter or other such command between
+ ;; the top node line and the next node line, as a title
+ ;; for an `ifinfo' section. This @chapter command must
+ ;; must be skipped. So the procedure is to search for
+ ;; the next `@node' line, and then copy its name.
+ (if (re-search-forward "^@node" nil t)
+ (progn
+ (beginning-of-line)
+ (texinfo-copy-node-name))
+ " "))
+ ", (dir), (dir)"))
+
+(defun texinfo-check-for-node-name ()
+ "Determine whether the node has a node name. Prompt for one if not.
+Point must be at beginning of node line. Does not move point."
+ (save-excursion
+ (let ((initial (texinfo-copy-next-section-title)))
+ ;; This is not clean. Use `interactive' to read the arg.
+ (forward-word 1) ; skip over node command
+ (skip-chars-forward " \t") ; and over spaces
+ (if (not (looking-at "[^,\t\n ]+")) ; regexp based on what Info looks for
+ ; alternatively, use "[a-zA-Z]+"
+ (let ((node-name
+ (read-from-minibuffer
+ "Node name (use no @, commas, colons, or apostrophes): "
+ initial)))
+ (insert " " node-name))))))
+
+(defun texinfo-delete-existing-pointers ()
+ "Delete `Next', `Previous', and `Up' pointers.
+Starts from the current position of the cursor, and searches forward
+on the line for a comma and if one is found, deletes the rest of the
+line, including the comma. Leaves point at beginning of line."
+ (let ((eol-point (save-excursion (end-of-line) (point))))
+ (if (search-forward "," eol-point t)
+ (delete-region (1- (point)) eol-point)))
+ (beginning-of-line))
+
+(defun texinfo-find-pointer (beginning end level direction)
+ "Move point to section associated with next, previous, or up pointer.
+Return type of pointer (either 'normal or 'no-pointer).
+
+The first and second arguments bound the search for a pointer to the
+beginning and end, respectively, of the enclosing higher level
+section. The third argument is a string specifying the general kind
+of section such as \"chapter\" or \"section\". When looking for the
+`Next' pointer, the section found will be at the same hierarchical
+level in the Texinfo file; when looking for the `Previous' pointer,
+the section found will be at the same or higher hierarchical level in
+the Texinfo file; when looking for the `Up' pointer, the section found
+will be at some level higher in the Texinfo file. The fourth argument
+\(one of 'next, 'previous, or 'up\) specifies whether to find the
+`Next', `Previous', or `Up' pointer."
+ (let ((case-fold-search t))
+ (cond ((eq direction 'next)
+ (forward-line 3) ; skip over current node
+ ;; Search for section commands accompanied by node lines;
+ ;; ignore section commands in the middle of nodes.
+ (if (re-search-forward
+ ;; A `Top' node is never a next pointer, so won't find it.
+ (concat
+ ;; Match node line.
+ "\\(^@node\\).*\n"
+ ;; Match comment or ifinfo line, if any
+ "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ (eval
+ (cdr (assoc level texinfo-update-menu-same-level-regexps))))
+ end
+ t)
+ 'normal
+ 'no-pointer))
+ ((eq direction 'previous)
+ (if (re-search-backward
+ (concat
+ "\\("
+ ;; Match node line.
+ "\\(^@node\\).*\n"
+ ;; Match comment or ifinfo line, if any
+ "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ (eval
+ (cdr (assoc level texinfo-update-menu-same-level-regexps)))
+ "\\|"
+ ;; Match node line.
+ "\\(^@node\\).*\n"
+ ;; Match comment or ifinfo line, if any
+ "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ (eval
+ (cdr (assoc level texinfo-update-menu-higher-regexps)))
+ "\\|"
+ ;; Handle `Top' node specially.
+ "^@node [ \t]*top[ \t]*\\(,\\|$\\)"
+ "\\)")
+ beginning
+ t)
+ 'normal
+ 'no-pointer))
+ ((eq direction 'up)
+ (if (re-search-backward
+ (concat
+ "\\("
+ ;; Match node line.
+ "\\(^@node\\).*\n"
+ ;; Match comment or ifinfo line, if any
+ "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ (eval (cdr (assoc level texinfo-update-menu-higher-regexps)))
+ "\\|"
+ ;; Handle `Top' node specially.
+ "^@node [ \t]*top[ \t]*\\(,\\|$\\)"
+ "\\)")
+ (save-excursion
+ (goto-char beginning)
+ (beginning-of-line)
+ (point))
+ t)
+ 'normal
+ 'no-pointer))
+ (t
+ (error "texinfo-find-pointer: lack proper arguments")))))
+
+(defun texinfo-pointer-name (kind)
+ "Return the node name preceding the section command.
+The argument is the kind of section, either normal or no-pointer."
+ (let (name)
+ (cond ((eq kind 'normal)
+ (end-of-line) ; this handles prev node top case
+ (re-search-backward ; when point is already
+ "^@node" ; at the beginning of @node line
+ (save-excursion (forward-line -3))
+ t)
+ (setq name (texinfo-copy-node-name)))
+ ((eq kind 'no-pointer)
+ (setq name " "))) ; put a blank in the pointer slot
+ name))
+
+(defun texinfo-insert-pointer (beginning end level direction)
+ "Insert the `Next', `Previous' or `Up' node name at point.
+Move point forward.
+
+The first and second arguments bound the search for a pointer to the
+beginning and end, respectively, of the enclosing higher level
+section. The third argument is the hierarchical level of the Texinfo
+file, a string such as \"section\". The fourth argument is direction
+towards which the pointer is directed, one of `next, `previous, or
+'up."
+
+ (end-of-line)
+ (insert
+ ", "
+ (save-excursion
+ (texinfo-pointer-name
+ (texinfo-find-pointer beginning end level direction)))))
+
+(defun texinfo-clean-up-node-line ()
+ "Remove extra commas, if any, at end of node line."
+ (end-of-line)
+ (skip-chars-backward ", ")
+ (delete-region (point) (save-excursion (end-of-line) (point))))
+
+
+;;; Updating nodes sequentially
+;; These sequential update functions insert `Next' or `Previous'
+;; pointers that point to the following or preceding nodes even if they
+;; are at higher or lower hierarchical levels. This means that if a
+;; section contains one or more subsections, the section's `Next'
+;; pointer will point to the subsection and not the following section.
+;; (The subsection to which `Next' points will most likely be the first
+;; item on the section's menu.)
+
+;;;###autoload
+(defun texinfo-sequential-node-update (&optional region-p)
+ "Update one node (or many) in a Texinfo file with sequential pointers.
+
+This function causes the `Next' or `Previous' pointer to point to the
+immediately preceding or following node, even if it is at a higher or
+lower hierarchical level in the document. Continually pressing `n' or
+`p' takes you straight through the file.
+
+Without any prefix argument, update the node in which point is located.
+Non-nil argument (prefix, if interactive) means update the nodes in the
+marked region.
+
+This command makes it awkward to navigate among sections and
+subsections; it should be used only for those documents that are meant
+to be read like a novel rather than a reference, and for which the
+Info `g*' command is inadequate."
+
+ (interactive "P")
+ (if (not region-p)
+ ;; update a single node
+ (let ((auto-fill-function nil) (auto-fill-hook nil))
+ (if (not (re-search-backward "^@node" (point-min) t))
+ (error "Node line not found before this position."))
+ (texinfo-sequentially-update-the-node)
+ (message
+ "Done...sequentially updated the node . You may save the buffer."))
+ ;; else
+ (let ((auto-fill-function nil)
+ (auto-fill-hook nil)
+ (beginning (region-beginning))
+ (end (region-end)))
+ (if (= end beginning)
+ (error "Please mark a region!"))
+ (save-restriction
+ (narrow-to-region beginning end)
+ (goto-char beginning)
+ (push-mark (point) t)
+ (while (re-search-forward "^@node" (point-max) t)
+ (beginning-of-line)
+ (texinfo-sequentially-update-the-node))
+ (message
+ "Done...updated the nodes in sequence. You may save the buffer.")))))
+
+(defun texinfo-sequentially-update-the-node ()
+ "Update one node such that the pointers are sequential.
+A `Next' or `Previous' pointer points to any preceding or following node,
+regardless of its hierarchical level."
+
+ (texinfo-check-for-node-name)
+ (texinfo-delete-existing-pointers)
+ (message
+ "Sequentially updating node: %s ... " (texinfo-copy-node-name))
+ (save-restriction
+ (widen)
+ (let*
+ ((case-fold-search t)
+ (level (texinfo-hierarchic-level)))
+ (if (string-equal level "top")
+ (texinfo-top-pointer-case)
+ ;; else
+ (texinfo-sequentially-insert-pointer level 'next)
+ (texinfo-sequentially-insert-pointer level 'previous)
+ (texinfo-sequentially-insert-pointer level 'up)
+ (texinfo-clean-up-node-line)))))
+
+(defun texinfo-sequentially-find-pointer (level direction)
+ "Find next or previous pointer sequentially in Texinfo file, or up pointer.
+Move point to section associated with the pointer. Find point even if
+it is in a different section.
+
+Return type of pointer (either 'normal or 'no-pointer).
+
+The first argument is a string specifying the general kind of section
+such as \"chapter\" or \"section\". The section found will be at the
+same hierarchical level in the Texinfo file, or, in the case of the up
+pointer, some level higher. The second argument (one of 'next,
+'previous, or 'up) specifies whether to find the `Next', `Previous',
+or `Up' pointer."
+ (let ((case-fold-search t))
+ (cond ((eq direction 'next)
+ (forward-line 3) ; skip over current node
+ (if (re-search-forward
+ texinfo-section-types-regexp
+ (point-max)
+ t)
+ 'normal
+ 'no-pointer))
+ ((eq direction 'previous)
+ (if (re-search-backward
+ texinfo-section-types-regexp
+ (point-min)
+ t)
+ 'normal
+ 'no-pointer))
+ ((eq direction 'up)
+ (if (re-search-backward
+ (eval (cdr (assoc level texinfo-update-menu-higher-regexps)))
+ beginning
+ t)
+ 'normal
+ 'no-pointer))
+ (t
+ (error "texinfo-sequential-find-pointer: lack proper arguments")))))
+
+(defun texinfo-sequentially-insert-pointer (level direction)
+ "Insert the `Next', `Previous' or `Up' node name at point.
+Move point forward.
+
+The first argument is the hierarchical level of the Texinfo file, a
+string such as \"section\". The second argument is direction, one of
+`next, `previous, or 'up."
+
+ (end-of-line)
+ (insert
+ ", "
+ (save-excursion
+ (texinfo-pointer-name
+ (texinfo-sequentially-find-pointer level direction)))))
+
+
+;;; Inserting `@node' lines
+;; The `texinfo-insert-node-lines' function inserts `@node' lines as needed
+;; before the `@chapter', `@section', and such like lines of a region
+;; in a Texinfo file.
+
+(defun texinfo-insert-node-lines (beginning end &optional title-p)
+ "Insert missing `@node' lines in region of Texinfo file.
+Non-nil argument (prefix, if interactive) means also to insert the
+section titles as node names; and also to insert the section titles as
+node names in pre-existing @node lines that lack names."
+ (interactive "r\nP")
+
+ ;; Use marker; after inserting node lines, leave point at end of
+ ;; region and mark at beginning.
+
+ (let (beginning-marker end-marker title last-section-position)
+
+ ;; Save current position on mark ring and set mark to end.
+ (push-mark end t)
+ (setq end-marker (mark-marker))
+
+ (goto-char beginning)
+ (while (re-search-forward
+ texinfo-section-types-regexp
+ end-marker
+ 'end)
+ ;; Copy title if desired.
+ (if title-p
+ (progn
+ (beginning-of-line)
+ (forward-word 1)
+ (skip-chars-forward " \t")
+ (setq title (buffer-substring
+ (point)
+ (save-excursion (end-of-line) (point))))))
+ ;; Insert node line if necessary.
+ (if (re-search-backward
+ "^@node"
+ ;; Avoid finding previous node line if node lines are close.
+ (or last-section-position
+ (save-excursion (forward-line -2) (point))) t)
+ ;; @node is present, and point at beginning of that line
+ (forward-word 1) ; Leave point just after @node.
+ ;; Else @node missing; insert one.
+ (beginning-of-line) ; Beginning of `@section' line.
+ (insert "@node\n")
+ (backward-char 1)) ; Leave point just after `@node'.
+ ;; Insert title if desired.
+ (if title-p
+ (progn
+ (skip-chars-forward " \t")
+ ;; Use regexp based on what info looks for
+ ;; (alternatively, use "[a-zA-Z]+");
+ ;; this means we only insert a title if none exists.
+ (if (not (looking-at "[^,\t\n ]+"))
+ (progn
+ (beginning-of-line)
+ (forward-word 1)
+ (insert " " title)
+ (message "Inserted title %s ... " title)))))
+ ;; Go forward beyond current section title.
+ (re-search-forward texinfo-section-types-regexp
+ (save-excursion (forward-line 3) (point)) t)
+ (setq last-section-position (point))
+ (forward-line 1))
+
+ ;; Leave point at end of region, mark at beginning.
+ (set-mark beginning)
+
+ (if title-p
+ (message
+ "Done inserting node lines and titles. You may save the buffer.")
+ (message "Done inserting node lines. You may save the buffer."))))
+
+
+;;; Update and create menus for multi-file Texinfo sources
+
+;; 1. M-x texinfo-multiple-files-update
+;;
+;; Read the include file list of an outer Texinfo file and
+;; update all highest level nodes in the files listed and insert a
+;; main menu in the outer file after its top node.
+
+;; 2. C-u M-x texinfo-multiple-files-update
+;;
+;; Same as 1, but insert a master menu. (Saves reupdating lower
+;; level menus and nodes.) This command simply reads every menu,
+;; so if the menus are wrong, the master menu will be wrong.
+;; Similarly, if the lower level node pointers are wrong, they
+;; will stay wrong.
+
+;; 3. C-u 2 M-x texinfo-multiple-files-update
+;;
+;; Read the include file list of an outer Texinfo file and
+;; update all nodes and menus in the files listed and insert a
+;; master menu in the outer file after its top node.
+
+;;; Note: these functions:
+;;;
+;;; * Do not save or delete any buffers. You may fill up your memory.
+;;; * Do not handle any pre-existing nodes in outer file.
+;;; Hence, you may need a file for indices.
+
+
+;;; Auxiliary functions for multiple file updating
+
+(defun texinfo-multi-file-included-list (outer-file)
+ "Return a list of the included files in OUTER-FILE."
+ (let ((included-file-list (list outer-file))
+ start)
+ (save-excursion
+ (switch-to-buffer (find-file-noselect outer-file))
+ (widen)
+ (goto-char (point-min))
+ (while (re-search-forward "^@include" nil t)
+ (skip-chars-forward " \t")
+ (setq start (point))
+ (end-of-line)
+ (skip-chars-backward " \t")
+ (setq included-file-list
+ (cons (buffer-substring start (point))
+ included-file-list)))
+ (nreverse included-file-list))))
+
+(defun texinfo-copy-next-section-title ()
+ "Return the name of the immediately following section as a string.
+
+Start with point at the beginning of the node line. Leave point at the
+same place. If there is no title, returns an empty string."
+
+ (save-excursion
+ (end-of-line)
+ (let ((node-end (or
+ (save-excursion
+ (if (re-search-forward "\\(^@node\\)" nil t)
+ (match-beginning 0)))
+ (point-max))))
+ (if (re-search-forward texinfo-section-types-regexp node-end t)
+ (progn
+ (beginning-of-line)
+ ;; copy title
+ (let ((title
+ (buffer-substring
+ (progn (forward-word 1) ; skip over section type
+ (skip-chars-forward " \t") ; and over spaces
+ (point))
+ (progn (end-of-line) (point)))))
+ title))
+ ""))))
+
+(defun texinfo-multi-file-update (files &optional update-everything)
+ "Update first node pointers in each file in FILES.
+Return a list of the node names.
+
+The first file in the list is an outer file; the remaining are
+files included in the outer file with `@include' commands.
+
+If optional arg UPDATE-EVERYTHING non-nil, update every menu and
+pointer in each of the included files.
+
+Also update the `Top' level node pointers of the outer file.
+
+Requirements:
+
+ * the first file in the FILES list must be the outer file,
+ * each of the included files must contain exactly one highest
+ hierarchical level node,
+ * this node must be the first node in the included file,
+ * each highest hierarchical level node must be of the same type.
+
+Thus, normally, each included file contains one, and only one,
+chapter."
+
+;; The menu-list has the form:
+;;
+;; \(\(\"node-name1\" . \"title1\"\)
+;; \(\"node-name2\" . \"title2\"\) ... \)
+;;
+;; However, there does not need to be a title field and this function
+;; does not fill it; however a comment tells you how to do so.
+;; You would use the title field if you wanted to insert titles in the
+;; description slot of a menu as a description.
+
+ (let ((case-fold-search t)
+ menu-list)
+
+ ;; Find the name of the first node of the first included file.
+ (switch-to-buffer (find-file-noselect (car (cdr files))))
+ (widen)
+ (goto-char (point-min))
+ (if (not (re-search-forward "^@node" nil t))
+ (error "No `@node' line found in %s !" (buffer-name)))
+ (beginning-of-line)
+ (texinfo-check-for-node-name)
+ (setq next-node-name (texinfo-copy-node-name))
+
+ (setq menu-list
+ (cons (cons
+ next-node-name
+ (prog1 "" (forward-line 1)))
+ ;; Use following to insert section titles automatically.
+ ;; (texinfo-copy-next-section-title)
+ menu-list))
+
+ ;; Go to outer file
+ (switch-to-buffer (find-file-noselect (car files)))
+ (goto-char (point-min))
+ (if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
+ (error "This buffer needs a Top node!"))
+ (beginning-of-line)
+ (texinfo-delete-existing-pointers)
+ (end-of-line)
+ (insert ", " next-node-name ", (dir), (dir)")
+ (beginning-of-line)
+ (setq previous-node-name "Top")
+ (setq files (cdr files))
+
+ (while files
+
+ (if (not (cdr files))
+ ;; No next file
+ (setq next-node-name "")
+ ;; Else,
+ ;; find the name of the first node in the next file.
+ (switch-to-buffer (find-file-noselect (car (cdr files))))
+ (widen)
+ (goto-char (point-min))
+ (if (not (re-search-forward "^@node" nil t))
+ (error "No `@node' line found in %s !" (buffer-name)))
+ (beginning-of-line)
+ (texinfo-check-for-node-name)
+ (setq next-node-name (texinfo-copy-node-name))
+ (setq menu-list
+ (cons (cons
+ next-node-name
+ (prog1 "" (forward-line 1)))
+ ;; Use following to insert section titles automatically.
+ ;; (texinfo-copy-next-section-title)
+ menu-list)))
+
+ ;; Go to node to be updated.
+ (switch-to-buffer (find-file-noselect (car files)))
+ (goto-char (point-min))
+ (if (not (re-search-forward "^@node" nil t))
+ (error "No `@node' line found in %s !" (buffer-name)))
+ (beginning-of-line)
+
+ ;; Update other menus and nodes if requested.
+ (if update-everything (texinfo-all-menus-update t))
+
+ (beginning-of-line)
+ (texinfo-delete-existing-pointers)
+ (end-of-line)
+ (insert ", " next-node-name ", " previous-node-name ", " up-node-name)
+
+ (beginning-of-line)
+ (setq previous-node-name (texinfo-copy-node-name))
+
+ (setq files (cdr files)))
+ (nreverse menu-list)))
+
+(defun texinfo-multi-files-insert-main-menu (menu-list)
+ "Insert formatted main menu at point.
+Indents the first line of the description, if any, to the value of
+texinfo-column-for-description."
+
+ (insert "@menu\n")
+ (while menu-list
+ ;; Every menu entry starts with a star and a space.
+ (insert "* ")
+
+ ;; Insert the node name (and menu entry name, if present).
+ (let ((node-part (car (car menu-list))))
+ (if (stringp node-part)
+ ;; "Double colon" entry line; menu entry and node name are the same,
+ (insert (format "%s::" node-part))
+ ;; "Single colon" entry line; menu entry and node name are different.
+ (insert (format "%s: %s." (car node-part) (cdr node-part)))))
+
+ ;; Insert the description, if present.
+ (if (cdr (car menu-list))
+ (progn
+ ;; Move to right place.
+ (indent-to texinfo-column-for-description 2)
+ ;; Insert description.
+ (insert (format "%s" (cdr (car menu-list))))))
+
+ (insert "\n") ; end this menu entry
+ (setq menu-list (cdr menu-list)))
+ (insert "@end menu"))
+
+(defun texinfo-multi-file-master-menu-list (files-list)
+ "Return master menu list from files in FILES-LIST.
+Menu entries in each file collected using `texinfo-master-menu-list'.
+
+The first file in FILES-LIST must be the outer file; the others must
+be the files included within it. A main menu must already exist."
+ (save-excursion
+ (let (master-menu-list)
+ (while files-list
+ (switch-to-buffer (find-file-noselect (car files-list)))
+ (message "Working on: %s " (current-buffer))
+ (goto-char (point-min))
+ (setq master-menu-list
+ (append master-menu-list (texinfo-master-menu-list)))
+ (setq files-list (cdr files-list)))
+ master-menu-list)))
+
+
+;;; The multiple-file update function
+
+(defun texinfo-multiple-files-update
+ (outer-file &optional update-everything make-master-menu)
+ "Update first node pointers in each file included in OUTER-FILE;
+create or update the `Top' level node pointers and the main menu in
+the outer file that refers to such nodes. This does not create or
+update menus or pointers within the included files.
+
+With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
+insert a master menu in OUTER-FILE in addition to creating or updating
+pointers in the first @node line in each included file and creating or
+updating the `Top' level node pointers of the outer file. This does
+not create or update other menus and pointers within the included
+files.
+
+With optional UPDATE-EVERYTHING argument (numeric prefix arg, if
+interactive), update all the menus and all the `Next', `Previous', and
+`Up' pointers of all the files included in OUTER-FILE before inserting
+a master menu in OUTER-FILE. Also, update the `Top' level node
+pointers of OUTER-FILE.
+
+Notes:
+
+ * this command does NOT save any files--you must save the
+ outer file and any modified, included files.
+
+ * except for the `Top' node, this command does NOT handle any
+ pre-existing nodes in the outer file; hence, indices must be
+ enclosed in an included file.
+
+Requirements:
+
+ * each of the included files must contain exactly one highest
+ hierarchical level node,
+ * this highest node must be the first node in the included file,
+ * each highest hierarchical level node must be of the same type.
+
+Thus, normally, each included file contains one, and only one,
+chapter."
+
+ (interactive (cons
+ (read-string
+ "Name of outer `include' file: "
+ (buffer-file-name))
+ (cond ((not current-prefix-arg)
+ '(nil nil))
+ ((listp current-prefix-arg)
+ '(t nil)) ; make-master-menu
+ ((numberp current-prefix-arg)
+ '(t t)) ; update-everything
+ )))
+
+ (let* ((included-file-list (texinfo-multi-file-included-list outer-file))
+ (files included-file-list)
+ main-menu-list
+ next-node-name
+ previous-node-name
+ (up-node-name "Top"))
+
+;;; Update the pointers
+;;; and collect the names of the nodes and titles
+ (setq main-menu-list (texinfo-multi-file-update files update-everything))
+
+;;; Insert main menu
+
+ ;; Go to outer file
+ (switch-to-buffer (find-file-noselect (car included-file-list)))
+ (if (texinfo-old-menu-p
+ (point-min)
+ (save-excursion
+ (re-search-forward "^@include")
+ (beginning-of-line)
+ (point)))
+
+ ;; If found, leave point after word `menu' on the `@menu' line.
+ (progn
+ (texinfo-incorporate-descriptions main-menu-list)
+ ;; Delete existing menu.
+ (beginning-of-line)
+ (delete-region
+ (point)
+ (save-excursion (re-search-forward "^@end menu") (point)))
+ ;; Insert main menu
+ (texinfo-multi-files-insert-main-menu main-menu-list))
+
+ ;; Else no current menu; insert it before `@include'
+ (texinfo-multi-files-insert-main-menu main-menu-list))
+
+;;; Insert master menu
+
+ (if make-master-menu
+ (progn
+ ;; First, removing detailed part of any pre-existing master menu
+ (goto-char (point-min))
+ (if (re-search-forward texinfo-master-menu-header nil t)
+ ;; Remove detailed master menu listing
+ (progn
+ (goto-char (match-beginning 0))
+ (let ((end-of-detailed-menu-descriptions
+ (save-excursion ; beginning of end menu line
+ (goto-char (texinfo-menu-end))
+ (beginning-of-line) (forward-char -1)
+ (point))))
+ (delete-region (point) end-of-detailed-menu-descriptions))))
+
+ ;; Create a master menu and insert it
+ (texinfo-insert-master-menu-list
+ (texinfo-multi-file-master-menu-list
+ included-file-list)))))
+
+ ;; Remove unwanted extra lines.
+ (save-excursion
+ (goto-char (point-min))
+
+ (re-search-forward "^@menu")
+ (forward-line -1)
+ (insert "\n") ; Ensure at least one blank line.
+ (delete-blank-lines)
+
+ (re-search-forward "^@end menu")
+ (forward-line 1)
+ (insert "\n") ; Ensure at least one blank line.
+ (delete-blank-lines))
+
+ (message "Multiple files updated."))
+
+
+;;; Place `provide' at end of file.
+(provide 'texnfo-upd)
+
+;;; texnfo-upd.el ends here
diff --git a/contrib/texinfo/info/Makefile.am b/contrib/texinfo/info/Makefile.am
deleted file mode 100644
index 4680550f96a4..000000000000
--- a/contrib/texinfo/info/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-## Makefile.am for texinfo/info.
-## $Id: Makefile.am,v 1.11 1998/02/22 22:55:44 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-noinst_PROGRAMS = makedoc
-
-# Use `ginfo' for building to avoid confusion with the standard `info'
-# target. The install rule removes the `g' before applying any
-# user-specified name transformations.
-bin_PROGRAMS = ginfo
-transform = s/ginfo/info/; @program_transform_name@
-
-localedir = $(datadir)/locale
-
-# -I. for funs.h.
-# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
-# we need to override it, so include them ourselves.
-INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
-DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
-LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
-
-makedoc_SOURCES = makedoc.c
-ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
- echo-area.c echo-area.h \
- filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
- indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
- infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
- search.c search.h session.c session.h signals.c signals.h \
- termdep.h terminal.c terminal.h tilde.c tilde.h \
- variables.c variables.h window.c window.h
-
-EXTRA_DIST = README
-
-# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
-# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
-# listing the functions found. `doc.c' is a structure containing pointers
-# to those functions along with completable names and documentation strings.
-BUILT_SOURCES = doc.c funs.h
-
-cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
- $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
- $(srcdir)/footnotes.c $(srcdir)/variables.c
-
-$(BUILT_SOURCES): makedoc $(cmd_sources)
- ./makedoc $(cmd_sources)
diff --git a/contrib/texinfo/info/Makefile.in b/contrib/texinfo/info/Makefile.in
index c71d31959ec5..2f08d6126e0e 100644
--- a/contrib/texinfo/info/Makefile.in
+++ b/contrib/texinfo/info/Makefile.in
@@ -1,435 +1,227 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile for texinfo/info. -*- Indented-Text -*-
+# $Id: Makefile.in,v 1.9 1996/10/01 21:44:44 karl Exp $
+#
+# Copyright (C) 1993,96 Free Software Foundation, Inc.
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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 free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
# 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.
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-SHELL = /bin/sh
+#### Start of system configuration section. ####
srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
+VPATH = $(srcdir):$(common)
+
+common = $(srcdir)/../libtxi
+util = $(srcdir)/../util
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
+CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-noinst_PROGRAMS = makedoc
-
-# Use `ginfo' for building to avoid confusion with the standard `info'
-# target. The install rule removes the `g' before applying any
-# user-specified name transformations.
-bin_PROGRAMS = ginfo
-transform = s/ginfo/info/; @program_transform_name@
-
-localedir = $(datadir)/locale
-
-# -I. for funs.h.
-# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
-# we need to override it, so include them ourselves.
-INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
-DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
-LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
-
-makedoc_SOURCES = makedoc.c
-ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
- echo-area.c echo-area.h \
- filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
- indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
- infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
- search.c search.h session.c session.h signals.c signals.h \
- termdep.h terminal.c terminal.h tilde.c tilde.h \
- variables.c variables.h window.c window.h
-
-EXTRA_DIST = README
-# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
-# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
-# listing the functions found. `doc.c' is a structure containing pointers
-# to those functions along with completable names and documentation strings.
-BUILT_SOURCES = doc.c funs.h
+LN = ln
+RM = rm -f
+MKDIR = mkdir
+MAKEINFO= ../makeinfo/makeinfo
-cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
- $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
- $(srcdir)/footnotes.c $(srcdir)/variables.c
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+DEFS = @DEFS@
+
+LDEFS = -DHANDLE_MAN_PAGES -DNAMED_FUNCTIONS=1 -DDEFAULT_INFOPATH='"$(DEFAULT_INFOPATH)"'
+
+TERMLIBS = @TERMLIBS@
+LIBS = $(TERMLIBS) -L../libtxi -ltxi @LIBS@
+LOADLIBES = $(LIBS)
+
+SHELL = /bin/sh
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-ginfo_OBJECTS = dir.o display.o doc.o dribble.o echo-area.o filesys.o \
-footnotes.o gc.o indices.o info-utils.o info.o infodoc.o infomap.o \
-m-x.o man.o nodemenu.o nodes.o search.o session.o signals.o terminal.o \
-tilde.o variables.o window.o
-ginfo_LDADD = $(LDADD)
-ginfo_DEPENDENCIES = ../lib/libtxi.a
-ginfo_LDFLAGS =
-makedoc_OBJECTS = makedoc.o
-makedoc_LDADD = $(LDADD)
-makedoc_DEPENDENCIES = ../lib/libtxi.a
-makedoc_LDFLAGS =
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
+LDFLAGS = @LDFLAGS@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+# Prefix for each installed program, normally empty or `g'.
+binprefix =
+# Prefix for each installed man page, normally empty or `g'.
+manprefix =
+mandir = $(prefix)/man/man1
+manext = 1
+infodir = $(prefix)/info
+DEFAULT_INFOPATH= $(infodir):.
+
+#### End of system configuration section. ####
+
+SRCS = dir.c display.c echo_area.c filesys.c \
+ info-utils.c info.c infodoc.c infomap.c \
+ m-x.c nodes.c search.c session.c \
+ signals.c terminal.c tilde.c window.c \
+ xmalloc.c indices.c makedoc.c nodemenu.c \
+ footnotes.c dribble.c variables.c gc.c man.c \
+ clib.c
+
+HDRS = display.h doc.h echo_area.h filesys.h \
+ general.h getopt.h info-utils.h info.h \
+ infomap.h nodes.h search.h session.h \
+ signals.h termdep.h terminal.h tilde.h \
+ indices.h window.h footnotes.h dribble.h \
+ variables.h gc.h clib.h
+
+OBJS = dir.o display.o doc.o echo_area.o filesys.o info-utils.o info.o \
+ infodoc.o infomap.o m-x.o nodes.o search.o session.o signals.o \
+ terminal.o tilde.o window.o indices.o xmalloc.o nodemenu.o \
+ footnotes.o dribble.o variables.o gc.o man.o clib.o
+
+# The names of files which declare info commands.
+CMDFILES = $(srcdir)/session.c $(srcdir)/echo_area.c $(srcdir)/infodoc.c \
+ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
+ $(srcdir)/footnotes.c $(srcdir)/variables.c
+
+# The name of the program which builds documentation structure from CMDFILES.
+MAKEDOC_OBJECTS = makedoc.o clib.o xmalloc.o
+MAKEDOC_SOURCE = makedoc.c clib.c xmalloc.c
+
+infofiles = info.info info-stnd.info
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(LDEFS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $<
+all: info $(infofiles)
+sub-all: all
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+install: all
+ $(INSTALL_PROGRAM) info $(bindir)/$(binprefix)info
+ -d=$(srcdir); test -f ./info.info && d=.; $(INSTALL_DATA) $$d/info.info $(infodir)/info.info
+ -d=$(srcdir); test -f ./info-stnd.info && d=.; $(INSTALL_DATA) $$d/info-stnd.info $(infodir)/info-stnd.info
+ -$(INSTALL_DATA) $(srcdir)/info.1 $(mandir)/$(manprefix)info.$(manext)
+ $(POST_INSTALL)
+ ../util/install-info --info-dir=$(infodir) $(infodir)/info.info
+ ../util/install-info --info-dir=$(infodir) $(infodir)/info-stnd.info
-TAR = tar
-GZIP = --best
-SOURCES = $(ginfo_SOURCES) $(makedoc_SOURCES)
-OBJECTS = $(ginfo_OBJECTS) $(makedoc_OBJECTS)
+uninstall:
+ $(RM) $(bindir)/info
+ $(RM) $(infodir)/info.info
+ $(RM) $(infodir)/info-stnd.info
+ $(RM) $(mandir)/$(manprefix)info.$(manext)
-default: all
+info: $(OBJS) ../libtxi/libtxi.a
+ $(CC) $(LDFLAGS) -o info $(OBJS) $(LOADLIBES)
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps info/Makefile
+all-info: info.info info-stnd.info
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+info.info: info.texi
+ $(MAKEINFO) --no-split -I$(srcdir) info.texi
+info-stnd.info: info-stnd.texi
+ $(MAKEINFO) --no-split -I$(srcdir) info-stnd.texi
-mostlyclean-binPROGRAMS:
+dvi all-dvi: info.dvi info-stnd.dvi
+info.dvi: info.texi
+ PATH="$(util):$${PATH}" TEXINPUTS="$(srcdir):$(common):$${TEXINPUTS}" texi2dvi $(srcdir)/info.texi
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+info-stnd.dvi: info-stnd.texi
+ PATH="$(util):$${PATH}" TEXINPUTS="$(srcdir):$(common):$${TEXINPUTS}" texi2dvi $(srcdir)/info-stnd.texi
-distclean-binPROGRAMS:
+makedoc: $(MAKEDOC_OBJECTS) ../libtxi/libtxi.a
+ $(CC) $(LDFLAGS) -o makedoc $(MAKEDOC_OBJECTS) $(LOADLIBES)
-maintainer-clean-binPROGRAMS:
+Makefile: $(srcdir)/Makefile.in ../config.status
+ cd ..; sh config.status
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; \
- done
+clean:
+ $(RM) info funs.h doc.c makedoc $(OBJS) $(MAKEDOC_OBJECTS)
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
+distclean: clean texclean
+ $(RM) Makefile config.status config.cache *~ core core.* *.core
+ $(RM) *.BAK makedoc-TAGS TAGS \#* *.info*
-mostlyclean-noinstPROGRAMS:
+mostlyclean: clean
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+realclean: distclean
+ $(RM) info.info info-stnd.info
-distclean-noinstPROGRAMS:
+TAGS: $(SRCS) makedoc-TAGS
+ etags $(SRCS)
+ cat makedoc-TAGS >>TAGS && $(RM) makedoc-TAGS
-maintainer-clean-noinstPROGRAMS:
+makedoc-TAGS: $(CMDFILES)
+ ./makedoc -tags $(CMDFILES) >makedoc-TAGS
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-ginfo: $(ginfo_OBJECTS) $(ginfo_DEPENDENCIES)
- @rm -f ginfo
- $(LINK) $(ginfo_LDFLAGS) $(ginfo_OBJECTS) $(ginfo_LDADD) $(LIBS)
-
-makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
- @rm -f makedoc
- $(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS)
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = info
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
-dir.o: dir.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h tilde.h
-display.o: display.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-doc.o: doc.c doc.h info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h footnotes.h gc.h \
- funs.h
-dribble.o: dribble.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-echo-area.o: echo-area.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-filesys.o: filesys.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h tilde.h
-footnotes.o: footnotes.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-gc.o: gc.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-indices.o: indices.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h indices.h
-info-utils.o: info-utils.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h man.h
-info.o: info.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
- indices.h ../lib/getopt.h man.h
-infodoc.o: infodoc.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-infomap.o: infomap.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h funs.h
-m-x.o: m-x.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-makedoc.o: makedoc.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-man.o: man.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
- signals.h tilde.h man.h
-nodemenu.o: nodemenu.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-nodes.o: nodes.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h man.h
-search.o: search.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-session.o: session.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h man.h
-signals.o: signals.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h signals.h
-terminal.o: terminal.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h termdep.h
-tilde.o: tilde.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-variables.o: variables.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h variables.h
-window.o: window.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec: install-binPROGRAMS
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall: uninstall-binPROGRAMS
-
-all: Makefile $(PROGRAMS)
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
- $(mkinstalldirs) $(bindir)
-
-
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
- mostlyclean-compile mostlyclean-tags \
- mostlyclean-generic
-
-clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
- clean-generic mostlyclean
-
-distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
- distclean-compile distclean-tags distclean-generic \
- clean
- -rm -f config.status
-
-maintainer-clean: maintainer-clean-binPROGRAMS \
- maintainer-clean-noinstPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
-clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info dvi installcheck \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-$(BUILT_SOURCES): makedoc $(cmd_sources)
- ./makedoc $(cmd_sources)
-
-# 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.
+texclean:
+ $(RM) *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky *.cps
+ $(RM) *.tps *.fns *.kys *.pgs *.vrs
+
+check: info
+
+# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
+# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
+# listing the functions found. `doc.c' is a structure containing pointers
+# to those functions along with completable names and documentation strings.
+funs.h: makedoc $(CMDFILES)
+ -@if test -f funs.h; then mv -f funs.h old-funs.h; fi; :
+ -@if test -f doc.c; then mv -f doc.c old-doc.c; fi; :
+ ./makedoc $(CMDFILES)
+ -@if cmp -s old-funs.h funs.h; then mv old-funs.h funs.h; \
+ else $(RM) old-funs.h; fi; :
+ -@if cmp -s old-doc.c doc.c; then mv old-doc.c doc.c; \
+ else $(RM) old-doc.c; fi; :
+
+doc.c: funs.h
+dribble.o: dribble.c dribble.h
+display.o: display.c
+echo_area.o: echo_area.c
+filesys.o: filesys.c
+info-utils.o: info-utils.c
+info.o: info.c filesys.h
+infodoc.o: infodoc.c
+infomap.o: infomap.c
+m-x.o: m-x.c
+nodes.o: nodes.c
+search.o: search.c
+session.o: session.c
+signals.o: signals.c
+terminal.o: terminal.c
+tilde.o: tilde.c
+window.o: window.c
+xmalloc.o: xmalloc.c
+indices.o: indices.c
+makedoc.o: makedoc.c
+
+dir.o: dir.c
+display.o: nodes.h info-utils.h search.h
+display.o: terminal.h window.h display.h
+echo_area.o: info.h
+filesys.o: general.h tilde.h filesys.h
+footnotes.o: footnotes.h
+info-utils.o: info-utils.h nodes.h search.h
+info.o: info.h $(common)/getopt.h
+infodoc.o: info.h doc.h
+infomap.o: infomap.h funs.h
+gc.o: info.h
+m-x.o: info.h
+nodes.o: search.h filesys.h
+nodes.o: nodes.h info-utils.h
+search.o: general.h search.h nodes.h
+session.o: info.h
+signals.o: info.h signals.h
+terminal.o: terminal.h termdep.h
+tilde.o: tilde.h
+variables.c: variables.h
+window.o: nodes.h window.h display.h
+window.o: info-utils.h search.h infomap.h
+
+# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
+
+# eof
diff --git a/contrib/texinfo/info/NEWS b/contrib/texinfo/info/NEWS
new file mode 100644
index 000000000000..b13fb1531b50
--- /dev/null
+++ b/contrib/texinfo/info/NEWS
@@ -0,0 +1,200 @@
+This release of Info is version 2.11. Please read the file README.
+
+Version 2.11, Sat Apr 1 09:15:21 1995
+
+Changes since 2.7 beta:
+
+Although the basic code remains the same, there are numerous nits
+fixed, including some display bugs, and a memory leak. Some changes
+that have taken place with larger impact include the way in which the
+(dir) node is built; I have added in support for "localdir"
+directories among other things. Info files may be stored in
+compressed formats, and in their own subdirectories; menu items which
+do not explicitly name the node to which they are attached have the
+menu item name looked up as an Info file if it is not found within the
+current document. This means that the menu item:
+
+* Info:: The Info documentation reader.
+
+in (dir) refers to the info node "(info)Top".
+
+Please see the ChangeLog and documentation for details on other
+changes.
+
+Version 2.7 beta, Wed Dec 30 02:02:38 1992
+Version 2.6 beta, Tue Dec 22 03:58:07 1992
+Version 2.5 beta, Tue Dec 8 14:50:35 1992
+Version 2.4 beta, Sat Nov 28 14:34:02 1992
+Version 2.3 beta, Fri Nov 27 01:04:13 1992
+Version 2.2 beta, Tue Nov 24 09:36:08 1992
+Version 2.1 beta, Tue Nov 17 23:29:36 1992
+
+Changes since 2.5 beta:
+
+Note that versions 2.6 and 2.7 Beta were only released to a select group.
+
+* "info-" removed from the front of M-x commands.
+
+* Automatic footnote display. When you enter a node which contains
+ footnotes, and the variable "automatic-footnotes" is "On", Info pops
+ up a window containing the footnotes. Likewise, when you leave that
+ node, the window containing the footnotes goes away.
+
+* Cleaner built in documentation, and documentation functions.
+
+ Use:
+ o `M-x describe-variable' to read a variable's documenation
+ o `M-x describe-key' to find out what a particular keystroke does.
+ o `M-x describe-function' to read a function's documentation.
+ o `M-x where-is' to find out what keys invoke a particular function.
+
+* Info can "tile" the displayed windows (via "M-x tile-windows"). If
+ the variable "automatic-tiling" is "On", then splitting a window or
+ deleting a window causes the remaining windows to be retiled.
+
+* You can save every keystroke you type in a "dribble file" by using the
+ `--dribble FILENAME' option. You can initially read keystrokes from an
+ alternate input stream with `--restore FILENAME', or by redirecting
+ input on the command line `info < old-dribble'.
+
+* New behaviour of menu items. If the label is the same as the
+ target node name, and the node couldn't be found in the current file,
+ treat the label as a file name. For example, a menu entry in "DIR"
+ might contain:
+
+ * Emacs:: Cool text-editor.
+
+ Info would not find the node "(dir)Emacs", so just plain "(emacs)"
+ would be tried.
+
+* New variable "ISO-Latin" allows you to use European machines with
+ 8-bit character sets.
+
+* Cleanups in echo area reading, and redisplay. Cleanups in handling the
+ window which shows possible completions.
+
+* Info can now read files that have been compressed. An array in filesys.c
+ maps extensions to programs that can decompress stdin, and write the results
+ to stdout. Currently, ".Z"/uncompress, ".z"/gunzip, and ".Y"/unyabba are
+ supported. The modeline for a compressed file shows "zz" in it.
+
+* There is a new variable "gc-compressed-files" which, if non-zero, says
+ it is okay to reclaim the file buffer space allocated to a file which
+ was compressed, if, and only if, that file's contents do not appear in
+ any history node.
+
+* New file `nodemenu.c' implements a few functions for manipulating
+ previously visited nodes. `C-x C-b' (list-visited-nodes) produces a
+ menu of the nodes that could be reached by info-history-node in some
+ window. `C-x b' (select-visited-node) is similar, but reads one of
+ the node names with completion.
+
+* Keystroke `M-r' (move_to_screen_line) allows the user to place the cursor at
+ the start of a specific screen line. Without a numeric argument, place the
+ cursor on the center line; with an arg, place the cursor on that line.
+
+* Interruptible display implemented. Basic display speedups and hacks.
+* The message "*** Tags Out of Date ***" now means what it says.
+* Index searching with `,' (info-index-next) has been improved.
+* When scrolling with C-v, C-M-v, or M-v, only "Page Only" scrolling
+ will happen.
+
+* Continous scrolling (along with `]' (info-global-next) and `['
+ (info-global-prev) works better. `]' and `[' accept numeric
+ arguments, moving that many nodes in that case.
+
+* `C-x w' (info-toggle-wrap) controls how lines wider than the width
+ of the screen are displayed. If a line is too long, a `$' is
+ displayed in the rightmost column of the window.
+
+* There are some new variables for controlling the behaviour of Info
+ interactively. The current list of variables is as follows:
+
+ Variable Name Default Value Description
+ ------------- ------------- -----------
+ `automatic-footnotes' On When "On", footnotes appear and
+ disappear automatically.
+
+ `automatic-tiling' Off When "On", creating of deleting a
+ window resizes other windows.
+
+ `visible-bell' Off If non-zero, try to use a visible bell.
+
+ `errors-ring-bell' On If non-zero, errors cause a ring.
+
+ `show-index-match' On If non-zero, the portion of the string
+ matched is highlighted by changing its
+ case.
+
+ `scroll-behaviour' Continuous One of "Continuous", "Next Only", or
+ "Page Only". "Page Only" prevents you from
+ scrolling past the bottom or top of a node.
+ "Next Only" causes the Next or Prev node to
+ be selected when you scroll past the bottom
+ or top of a node. "Continous" moves
+ linearly through the files hierchichal
+ structure.
+
+ `scroll-step' 0 Controls how scrolling is done for you when
+ the cursor moves out of the current window.
+ Non-zero means it is the number of lines
+ you would like the screen to shift. A
+ value of 0 means to center the line
+ containing the cursor in the window.
+
+ `gc-compressed-files' Off If non-zero means it is okay to reclaim the
+ file buffer space allocated to a file which
+ was compressed, if, and only if, that
+ file's contents do not appear in the node
+ list of any window.
+
+ `ISO-Latin' Off Non-zero means that you are using an ISO
+ Latin character set. By default, standard
+ ASCII characters are assumed.
+________________________________________
+This release of Info is version 2.5 beta.
+
+Changes since 2.4 beta:
+
+* Index (i) and (,) commands fully implemented.
+* "configure" script now shipped with Info.
+* New function "set-variable" allows users to set various variables.
+* User-settable behaviour on end or beginning of node scrolling. This
+ supercedes the SPC and DEL changes in 2.3 beta.
+
+________________________________________
+This release of Info is version 2.4 beta.
+
+Changes since 2.3 beta:
+
+* info-last-node now means move to the last node of this info file.
+* info-history-node means move backwards through this window's node history.
+* info-first-node moves to the first node in the Info file. This node is
+ not necessarily "Top"!
+* SPC and DEL can select the Next or Prev node after printing an informative
+ message when pressed at the end/beg of a node.
+
+----------------------------------------
+This release of Info is version 2.3 beta.
+
+Changes since 2.2 beta:
+
+* M-x command lines if NAMED_COMMANDS is #defined. Variable in Makefile.
+* Screen height changes made quite robust.
+* Interactive function "set-screen-height" implements user height changes.
+* Scrolling on some terminals is faster now.
+* C-l with numeric arguement is fixed.
+
+----------------------------------------
+This release of Info is version 2.2 beta.
+
+Changes since 2.0:
+
+* C-g can now interrupt multi-file searches.
+* Incremental search is fully implemented.
+* Loading large tag tables is much faster now.
+* makedoc.c replaces shell script, speeding incremental builds.
+* Scrolling in redisplay is implemented.
+* Recursive uses of the echo area made more robust.
+* Garbage collection of unreferenced nodes.
+
diff --git a/contrib/texinfo/info/README b/contrib/texinfo/info/README
index 7e1ab327b993..d8f1ab624d84 100644
--- a/contrib/texinfo/info/README
+++ b/contrib/texinfo/info/README
@@ -1,3 +1,9 @@
+The file NEWS contains information about what has changed since the last
+release.
+
+The file ../INSTALL contains instructions on how to install Info.
+
+
Info 2.0 is a complete rewrite of the original standalone Info I wrote in
1987, the first program I wrote for rms. That program was something like
my second Unix program ever, and my die-hard machine language coding habits
@@ -6,7 +12,8 @@ maintain, and thus decided to write this one.
The rewrite consists of about 12,000 lines of code written in about 12
days. I believe this version of Info to be in much better shape than the
-original Info.
+original Info, and the only reason it is in Beta test is because of its
+short life span.
Info 2.0 is substantially different from its original standalone
predecessor. It appears almost identical to the GNU Emacs version, but has
@@ -23,4 +30,8 @@ A full listing of the commands available in Info can be gotten by typing
`?' while within an Info window. This produces a node in a window which
can be viewed just like any Info node.
---Brian Fox <bfox@gnu.org>
+Please send your comments, bug reports, and suggestions to
+
+ bug-texinfo@prep.ai.mit.edu
+
+--Brian Fox <bfox@ai.mit.edu>
diff --git a/contrib/texinfo/info/clib.c b/contrib/texinfo/info/clib.c
new file mode 100644
index 000000000000..2cebde03a17a
--- /dev/null
+++ b/contrib/texinfo/info/clib.c
@@ -0,0 +1,112 @@
+/* clib.c: Functions which we normally expect to find in the C library.
+ $Id: clib.c,v 1.2 1996/10/03 16:58:31 karl Exp $
+
+ This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1995 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by Brian Fox (bfox@ai.mit.edu). */
+
+#include <stdio.h>
+
+#if defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#if defined (HAVE_STDLIB_H)
+#include <stdlib.h>
+#endif
+
+#if defined (HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#include <sys/errno.h>
+
+extern void *xmalloc (), *xrealloc ();
+#include "general.h"
+
+#if !defined (errno)
+extern int errno;
+#endif
+
+#if !defined (HAVE_STRERROR)
+extern char *sys_errlist[];
+extern int sys_nerr;
+
+char *
+strerror (num)
+ int num;
+{
+ if (num >= sys_nerr)
+ return ("");
+ else
+ return (sys_errlist[num]);
+}
+#endif /* !HAVE_STRERROR */
+
+#if !defined (HAVE_STRCASECMP)
+/* This Unix doesn't have the strcasecmp () function. */
+int
+strcasecmp (string1, string2)
+ char *string1, *string2;
+{
+ char ch1, ch2;
+
+ for (;;)
+ {
+ ch1 = *string1++;
+ ch2 = *string2++;
+
+ if (!(ch1 | ch2))
+ return (0);
+
+ ch1 = info_toupper (ch1);
+ ch2 = info_toupper (ch2);
+
+ if (ch1 != ch2)
+ return (ch1 - ch2);
+ }
+}
+
+/* Compare at most COUNT characters from string1 to string2. Case
+ doesn't matter. */
+int
+strncasecmp (string1, string2, count)
+ char *string1, *string2;
+ int count;
+{
+ register char ch1, ch2;
+
+ while (count)
+ {
+ ch1 = *string1++;
+ ch2 = *string2++;
+
+ ch1 = info_toupper (ch1);
+ ch2 = info_toupper (ch2);
+
+ if (ch1 == ch2)
+ count--;
+ else
+ break;
+ }
+ return (count);
+}
+#endif /* !STRCASECMP */
+
diff --git a/contrib/texinfo/info/clib.h b/contrib/texinfo/info/clib.h
new file mode 100644
index 000000000000..c559fe51b607
--- /dev/null
+++ b/contrib/texinfo/info/clib.h
@@ -0,0 +1,42 @@
+/* clib.h: Declarations of functions which appear in clib.c (or libc.a). */
+
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1995 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by Brian Fox (bfox@ai.mit.edu). */
+
+#if !defined (_CLIB_H_)
+#define _CLIB_H_
+
+#if !defined (HAVE_STRDUP)
+extern char *strdup ();
+#endif
+
+#if !defined (HAVE_STRERROR)
+extern char *strerror ();
+#endif
+
+#if !defined (HAVE_STRCASECMP)
+extern int strcasecmp ();
+extern int strncasecmp ();
+#endif
+
+#endif /* !_CLIB_H_ */
+
+
diff --git a/contrib/texinfo/info/dir.c b/contrib/texinfo/info/dir.c
index 651e48a6e368..4ccf85613101 100644
--- a/contrib/texinfo/info/dir.c
+++ b/contrib/texinfo/info/dir.c
@@ -1,7 +1,9 @@
-/* dir.c -- How to build a special "dir" node from "localdir" files.
- $Id: dir.c,v 1.6 1997/07/27 21:09:20 karl Exp $
+/* dir.c -- How to build a special "dir" node from "localdir" files. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +21,13 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+#include <sys/errno.h>
#include "info-utils.h"
#include "filesys.h"
#include "tilde.h"
@@ -29,53 +37,23 @@
dirs_to_add which are found in INFOPATH. */
static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding ();
+static void build_dir_node_internal ();
static char *dirs_to_add[] = {
"dir", "localdir", (char *)NULL
};
-
-/* Return zero if the file represented in the stat structure TEST has
- already been seen, nonzero else. */
-
-typedef struct
-{
- unsigned long device;
- unsigned long inode;
-} dir_file_list_entry_type;
-
-static int
-new_dir_file_p (test)
- struct stat *test;
-{
- static unsigned dir_file_list_len = 0;
- static dir_file_list_entry_type *dir_file_list = NULL;
- unsigned i;
-
- for (i = 0; i < dir_file_list_len; i++)
- {
- dir_file_list_entry_type entry;
- entry = dir_file_list[i];
- if (entry.device == test->st_dev && entry.inode == test->st_ino)
- return 0;
- }
-
- dir_file_list_len++;
- dir_file_list = xrealloc (dir_file_list,
- dir_file_list_len * sizeof (dir_file_list_entry_type));
- dir_file_list[dir_file_list_len - 1].device = test->st_dev;
- dir_file_list[dir_file_list_len - 1].inode = test->st_ino;
- return 1;
-}
-
-
void
maybe_build_dir_node (dirname)
char *dirname;
{
+ FILE_BUFFER *dir_buffer;
int path_index, update_tags;
char *this_dir;
- FILE_BUFFER *dir_buffer = info_find_file (dirname);
+
+ /* Check to see if the file has already been built. If so, then
+ do not build it again. */
+ dir_buffer = info_find_file (dirname);
/* If there is no "dir" in the current info path, we cannot build one
from nothing. */
@@ -86,10 +64,6 @@ maybe_build_dir_node (dirname)
if (dir_buffer->flags & N_CannotGC)
return;
- /* Initialize the list we use to avoid reading the same dir file twice
- with the dir file just found. */
- new_dir_file_p (&dir_buffer->finfo);
-
path_index = update_tags = 0;
/* Using each element of the path, check for one of the files in
@@ -97,56 +71,62 @@ maybe_build_dir_node (dirname)
Only files explictly named are eligible. This is a design decision.
There can be an info file name "localdir.info" which contains
information on the setting up of "localdir" files. */
- while ((this_dir = extract_colon_unit (infopath, &path_index)))
+ while (this_dir = extract_colon_unit (infopath, &path_index))
{
register int da_index;
char *from_file;
/* Expand a leading tilde if one is present. */
if (*this_dir == '~')
- {
- char *tilde_expanded_dirname;
-
- tilde_expanded_dirname = tilde_expand_word (this_dir);
- if (tilde_expanded_dirname != this_dir)
- {
- free (this_dir);
- this_dir = tilde_expanded_dirname;
- }
- }
-
- /* For every different file named in DIRS_TO_ADD found in the
- search path, add that file's menu to our "dir" node. */
- for (da_index = 0; (from_file = dirs_to_add[da_index]); da_index++)
- {
- struct stat finfo;
- int statable;
- int namelen = strlen (from_file);
- char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
-
- strcpy (fullpath, this_dir);
- if (fullpath[strlen (fullpath) - 1] != '/')
- strcat (fullpath, "/");
- strcat (fullpath, from_file);
-
- statable = (stat (fullpath, &finfo) == 0);
-
- /* Only add this file if we have not seen it before. */
- if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
- {
- long filesize;
- char *contents = filesys_read_info_file (fullpath, &filesize,
- &finfo);
- if (contents)
- {
- update_tags++;
- add_menu_to_file_buffer (contents, filesize, dir_buffer);
- free (contents);
- }
- }
-
- free (fullpath);
- }
+ {
+ char *tilde_expanded_dirname;
+
+ tilde_expanded_dirname = tilde_expand_word (this_dir);
+ if (tilde_expanded_dirname != this_dir)
+ {
+ free (this_dir);
+ this_dir = tilde_expanded_dirname;
+ }
+ }
+
+ /* For every file named in DIRS_TO_ADD found in the search path,
+ add the contents of that file's menu to our "dir" node. */
+ for (da_index = 0; from_file = dirs_to_add[da_index]; da_index++)
+ {
+ struct stat finfo;
+ char *fullpath;
+ int namelen, statable;
+
+ namelen = strlen (from_file);
+
+ fullpath = (char *)xmalloc (3 + strlen (this_dir) + namelen);
+ strcpy (fullpath, this_dir);
+ if (fullpath[strlen (fullpath) - 1] != '/')
+ strcat (fullpath, "/");
+ strcat (fullpath, from_file);
+
+ statable = (stat (fullpath, &finfo) == 0);
+
+ /* Only add the contents of this file if it is not identical to the
+ file of the DIR buffer. */
+ if ((statable && S_ISREG (finfo.st_mode)) &&
+ (strcmp (dir_buffer->fullpath, fullpath) != 0))
+ {
+ long filesize;
+ char *contents;
+
+ contents = filesys_read_info_file (fullpath, &filesize, &finfo);
+
+ if (contents)
+ {
+ update_tags++;
+ add_menu_to_file_buffer (contents, filesize, dir_buffer);
+ free (contents);
+ }
+ }
+
+ free (fullpath);
+ }
free (this_dir);
}
@@ -196,37 +176,37 @@ add_menu_to_file_buffer (contents, size, fb)
if (fb_offset == -1)
{
/* Find the start of the second node in this file buffer. If there
- is only one node, we will be adding the contents to the end of
- this node. */
+ is only one node, we will be adding the contents to the end of
+ this node. */
fb_offset = find_node_separator (&fb_binding);
/* If not even a single node separator, give up. */
if (fb_offset == -1)
- return;
+ return;
fb_binding.start = fb_offset;
fb_binding.start +=
- skip_node_separator (fb_binding.buffer + fb_binding.start);
+ skip_node_separator (fb_binding.buffer + fb_binding.start);
/* Try to find the next node separator. */
fb_offset = find_node_separator (&fb_binding);
/* If found one, consider that the start of the menu. Otherwise, the
- start of this menu is the end of the file buffer (i.e., fb->size). */
+ start of this menu is the end of the file buffer (i.e., fb->size). */
if (fb_offset != -1)
- fb_binding.start = fb_offset;
+ fb_binding.start = fb_offset;
else
- fb_binding.start = fb_binding.end;
+ fb_binding.start = fb_binding.end;
insert_text_into_fb_at_binding
- (fb, &fb_binding, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL));
+ (fb, &fb_binding, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL));
fb_binding.buffer = fb->contents;
fb_binding.start = 0;
fb_binding.end = fb->filesize;
fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
if (fb_offset == -1)
- abort ();
+ abort ();
}
/* CONTENTS_OFFSET and FB_OFFSET point to the starts of the menus that
@@ -244,23 +224,23 @@ add_menu_to_file_buffer (contents, size, fb)
int num_found = 0;
while ((fb_binding.start > 0) &&
- (whitespace_or_newline (fb_binding.buffer[fb_binding.start - 1])))
+ (whitespace_or_newline (fb_binding.buffer[fb_binding.start - 1])))
{
- num_found++;
- fb_binding.start--;
+ num_found++;
+ fb_binding.start--;
}
/* Optimize if possible. */
if (num_found >= 2)
{
- fb_binding.buffer[fb_binding.start++] = '\n';
- fb_binding.buffer[fb_binding.start++] = '\n';
+ fb_binding.buffer[fb_binding.start++] = '\n';
+ fb_binding.buffer[fb_binding.start++] = '\n';
}
else
{
- /* Do it the hard way. */
- insert_text_into_fb_at_binding (fb, &fb_binding, "\n\n", 2);
- fb_binding.start += 2;
+ /* Do it the hard way. */
+ insert_text_into_fb_at_binding (fb, &fb_binding, "\n\n", 2);
+ fb_binding.start += 2;
}
}
diff --git a/contrib/texinfo/info/display.c b/contrib/texinfo/info/display.c
index 3f2abe34cb15..0194afafa200 100644
--- a/contrib/texinfo/info/display.c
+++ b/contrib/texinfo/info/display.c
@@ -1,7 +1,9 @@
-/* display.c -- How to display Info windows.
- $Id: display.c,v 1.6 1997/07/24 21:13:27 karl Exp $
+/* display.c -- How to display Info windows. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include "display.h"
extern int info_any_buffered_input_p (); /* Found in session.c. */
@@ -52,7 +57,7 @@ display_clear_display (display)
register int i;
register DISPLAY_LINE *display_line;
- for (i = 0; (display_line = display[i]); i++)
+ for (i = 0; display_line = display[i]; i++)
{
display[i]->text[0] = '\0';
display[i]->textlen = 0;
@@ -78,13 +83,13 @@ display_update_display (window)
{
/* Only re-display visible windows which need updating. */
if (((win->flags & W_WindowVisible) == 0) ||
- ((win->flags & W_UpdateWindow) == 0) ||
- (win->height == 0))
- continue;
+ ((win->flags & W_UpdateWindow) == 0) ||
+ (win->height == 0))
+ continue;
display_update_one_window (win);
if (display_was_interrupted_p)
- break;
+ break;
}
/* Always update the echo area. */
@@ -97,12 +102,12 @@ void
display_update_one_window (win)
WINDOW *win;
{
- register char *nodetext; /* Current character to display. */
+ register char *nodetext; /* Current character to display. */
register char *last_node_char; /* Position of the last character in node. */
- register int i; /* General use index. */
- char *printed_line; /* Buffer for a printed line. */
- int pl_index = 0; /* Index into PRINTED_LINE. */
- int line_index = 0; /* Number of lines done so far. */
+ register int i; /* General use index. */
+ char *printed_line; /* Buffer for a printed line. */
+ int pl_index = 0; /* Index into PRINTED_LINE. */
+ int line_index = 0; /* Number of lines done so far. */
DISPLAY_LINE **display = the_display;
/* If display is inhibited, that counts as an interrupted display. */
@@ -137,165 +142,165 @@ display_update_one_window (win)
int replen;
if (isprint (*nodetext))
- {
- rep_temp[0] = *nodetext;
- replen = 1;
- rep_temp[1] = '\0';
- rep = rep_temp;
- }
+ {
+ rep_temp[0] = *nodetext;
+ replen = 1;
+ rep_temp[1] = '\0';
+ rep = rep_temp;
+ }
else
- {
- if (*nodetext == '\r' || *nodetext == '\n')
- {
- replen = win->width - pl_index;
- }
- else
- {
- rep = printed_representation (*nodetext, pl_index);
- replen = strlen (rep);
- }
- }
+ {
+ if (*nodetext == '\r' || *nodetext == '\n')
+ {
+ replen = win->width - pl_index;
+ }
+ else
+ {
+ rep = printed_representation (*nodetext, pl_index);
+ replen = strlen (rep);
+ }
+ }
/* If this character can be printed without passing the width of
- the line, then stuff it into the line. */
+ the line, then stuff it into the line. */
if (replen + pl_index < win->width)
- {
- /* Optimize if possible. */
- if (replen == 1)
- {
- printed_line[pl_index++] = *rep;
- }
- else
- {
- for (i = 0; i < replen; i++)
- printed_line[pl_index++] = rep[i];
- }
- }
+ {
+ /* Optimize if possible. */
+ if (replen == 1)
+ {
+ printed_line[pl_index++] = *rep;
+ }
+ else
+ {
+ for (i = 0; i < replen; i++)
+ printed_line[pl_index++] = rep[i];
+ }
+ }
else
- {
- DISPLAY_LINE *entry;
-
- /* If this character cannot be printed in this line, we have
- found the end of this line as it would appear on the screen.
- Carefully print the end of the line, and then compare. */
- if (*nodetext == '\n' || *nodetext == '\r' || *nodetext == '\t')
- {
- printed_line[pl_index] = '\0';
- rep_carried_over = (char *)NULL;
- }
- else
- {
- /* The printed representation of this character extends into
- the next line. Remember the offset of the last character
- printed out of REP so that we can carry the character over
- to the next line. */
- for (i = 0; pl_index < (win->width - 1);)
- printed_line[pl_index++] = rep[i++];
-
- rep_carried_over = rep + i;
-
- /* If printing the last character in this window couldn't
- possibly cause the screen to scroll, place a backslash
- in the rightmost column. */
- if (1 + line_index + win->first_row < the_screen->height)
- {
- if (win->flags & W_NoWrap)
- printed_line[pl_index++] = '$';
- else
- printed_line[pl_index++] = '\\';
- }
- printed_line[pl_index] = '\0';
- }
-
- /* We have the exact line as it should appear on the screen.
- Check to see if this line matches the one already appearing
- on the screen. */
- entry = display[line_index + win->first_row];
-
- /* If the screen line is inversed, then we have to clear
- the line from the screen first. Why, I don't know. */
- if (entry->inverse)
- {
- terminal_goto_xy (0, line_index + win->first_row);
- terminal_clear_to_eol ();
- entry->inverse = 0;
- entry->text[0] = '\0';
- entry->textlen = 0;
- }
-
- /* Find the offset where these lines differ. */
- for (i = 0; i < pl_index; i++)
- if (printed_line[i] != entry->text[i])
- break;
-
- /* If the lines are not the same length, or if they differed
- at all, we must do some redrawing. */
- if ((i != pl_index) || (pl_index != entry->textlen))
- {
- /* Move to the proper point on the terminal. */
- terminal_goto_xy (i, line_index + win->first_row);
-
- /* If there is any text to print, print it. */
- if (i != pl_index)
- terminal_put_text (printed_line + i);
-
- /* If the printed text didn't extend all the way to the edge
- of the window, and text was appearing between here and the
- edge of the window, clear from here to the end of the line. */
- if ((pl_index < win->width && pl_index < entry->textlen) ||
- (entry->inverse))
- terminal_clear_to_eol ();
-
- fflush (stdout);
-
- /* Update the display text buffer. */
- strcpy (entry->text + i, printed_line + i);
- entry->textlen = pl_index;
-
- /* Lines showing node text are not in inverse. Only modelines
- have that distinction. */
- entry->inverse = 0;
- }
-
- /* We have done at least one line. Increment our screen line
- index, and check against the bottom of the window. */
- if (++line_index == win->height)
- break;
-
- /* A line has been displayed, and the screen reflects that state.
- If there is typeahead pending, then let that typeahead be read
- now, instead of continuing with the display. */
- if (info_any_buffered_input_p ())
- {
- free (printed_line);
- display_was_interrupted_p = 1;
- return;
- }
-
- /* Reset PL_INDEX to the start of the line. */
- pl_index = 0;
-
- /* If there are characters from REP left to print, stuff them
- into the buffer now. */
- if (rep_carried_over)
- for (; rep[pl_index]; pl_index++)
- printed_line[pl_index] = rep[pl_index];
-
- /* If this window has chosen not to wrap lines, skip to the end
- of the physical line in the buffer, and start a new line here. */
- if (pl_index && (win->flags & W_NoWrap))
- {
- char *begin;
-
- pl_index = 0;
- printed_line[0] = '\0';
-
- begin = nodetext;
-
- while ((nodetext < last_node_char) && (*nodetext != '\n'))
- nodetext++;
- }
- }
+ {
+ DISPLAY_LINE *entry;
+
+ /* If this character cannot be printed in this line, we have
+ found the end of this line as it would appear on the screen.
+ Carefully print the end of the line, and then compare. */
+ if (*nodetext == '\n' || *nodetext == '\r' || *nodetext == '\t')
+ {
+ printed_line[pl_index] = '\0';
+ rep_carried_over = (char *)NULL;
+ }
+ else
+ {
+ /* The printed representation of this character extends into
+ the next line. Remember the offset of the last character
+ printed out of REP so that we can carry the character over
+ to the next line. */
+ for (i = 0; pl_index < (win->width - 1);)
+ printed_line[pl_index++] = rep[i++];
+
+ rep_carried_over = rep + i;
+
+ /* If printing the last character in this window couldn't
+ possibly cause the screen to scroll, place a backslash
+ in the rightmost column. */
+ if (1 + line_index + win->first_row < the_screen->height)
+ {
+ if (win->flags & W_NoWrap)
+ printed_line[pl_index++] = '$';
+ else
+ printed_line[pl_index++] = '\\';
+ }
+ printed_line[pl_index] = '\0';
+ }
+
+ /* We have the exact line as it should appear on the screen.
+ Check to see if this line matches the one already appearing
+ on the screen. */
+ entry = display[line_index + win->first_row];
+
+ /* If the screen line is inversed, then we have to clear
+ the line from the screen first. Why, I don't know. */
+ if (entry->inverse)
+ {
+ terminal_goto_xy (0, line_index + win->first_row);
+ terminal_clear_to_eol ();
+ entry->inverse = 0;
+ entry->text[0] = '\0';
+ entry->textlen = 0;
+ }
+
+ /* Find the offset where these lines differ. */
+ for (i = 0; i < pl_index; i++)
+ if (printed_line[i] != entry->text[i])
+ break;
+
+ /* If the lines are not the same length, or if they differed
+ at all, we must do some redrawing. */
+ if ((i != pl_index) || (pl_index != entry->textlen))
+ {
+ /* Move to the proper point on the terminal. */
+ terminal_goto_xy (i, line_index + win->first_row);
+
+ /* If there is any text to print, print it. */
+ if (i != pl_index)
+ terminal_put_text (printed_line + i);
+
+ /* If the printed text didn't extend all the way to the edge
+ of the window, and text was appearing between here and the
+ edge of the window, clear from here to the end of the line. */
+ if ((pl_index < win->width && pl_index < entry->textlen) ||
+ (entry->inverse))
+ terminal_clear_to_eol ();
+
+ fflush (stdout);
+
+ /* Update the display text buffer. */
+ strcpy (entry->text + i, printed_line + i);
+ entry->textlen = pl_index;
+
+ /* Lines showing node text are not in inverse. Only modelines
+ have that distinction. */
+ entry->inverse = 0;
+ }
+
+ /* We have done at least one line. Increment our screen line
+ index, and check against the bottom of the window. */
+ if (++line_index == win->height)
+ break;
+
+ /* A line has been displayed, and the screen reflects that state.
+ If there is typeahead pending, then let that typeahead be read
+ now, instead of continuing with the display. */
+ if (info_any_buffered_input_p ())
+ {
+ free (printed_line);
+ display_was_interrupted_p = 1;
+ return;
+ }
+
+ /* Reset PL_INDEX to the start of the line. */
+ pl_index = 0;
+
+ /* If there are characters from REP left to print, stuff them
+ into the buffer now. */
+ if (rep_carried_over)
+ for (; rep[pl_index]; pl_index++)
+ printed_line[pl_index] = rep[pl_index];
+
+ /* If this window has chosen not to wrap lines, skip to the end
+ of the physical line in the buffer, and start a new line here. */
+ if (pl_index && (win->flags & W_NoWrap))
+ {
+ char *begin;
+
+ pl_index = 0;
+ printed_line[0] = '\0';
+
+ begin = nodetext;
+
+ while ((nodetext < last_node_char) && (*nodetext != '\n'))
+ nodetext++;
+ }
+ }
}
done_with_node_display:
@@ -308,13 +313,13 @@ display_update_one_window (win)
/* If this line has text on it then make it go away. */
if (entry && entry->textlen)
- {
- entry->textlen = 0;
- entry->text[0] = '\0';
+ {
+ entry->textlen = 0;
+ entry->text[0] = '\0';
- terminal_goto_xy (0, line_index + win->first_row);
- terminal_clear_to_eol ();
- }
+ terminal_goto_xy (0, line_index + win->first_row);
+ terminal_clear_to_eol ();
+ }
}
/* Finally, if this window has a modeline it might need to be redisplayed.
@@ -326,19 +331,19 @@ display_update_one_window (win)
line_index = win->first_row + win->height;
/* This display line must both be in inverse, and have the same
- contents. */
+ contents. */
if ((!display[line_index]->inverse) ||
- (strcmp (display[line_index]->text, win->modeline) != 0))
- {
- terminal_goto_xy (0, line_index);
- terminal_begin_inverse ();
- terminal_put_text (win->modeline);
- terminal_end_inverse ();
- strcpy (display[line_index]->text, win->modeline);
- display[line_index]->inverse = 1;
- display[line_index]->textlen = strlen (win->modeline);
- fflush (stdout);
- }
+ (strcmp (display[line_index]->text, win->modeline) != 0))
+ {
+ terminal_goto_xy (0, line_index);
+ terminal_begin_inverse ();
+ terminal_put_text (win->modeline);
+ terminal_end_inverse ();
+ strcpy (display[line_index]->text, win->modeline);
+ display[line_index]->inverse = 1;
+ display[line_index]->textlen = strlen (win->modeline);
+ fflush (stdout);
+ }
}
/* Okay, this window doesn't need updating anymore. */
@@ -382,40 +387,40 @@ display_scroll_display (start, end, amount)
/* Shift the lines to scroll right into place. */
for (i = 0; i < (end - start); i++)
- {
- temp = the_display[last - i];
- the_display[last - i] = the_display[end - i];
- the_display[end - i] = temp;
- }
+ {
+ temp = the_display[last - i];
+ the_display[last - i] = the_display[end - i];
+ the_display[end - i] = temp;
+ }
/* The lines have been shifted down in the buffer. Clear all of the
- lines that were vacated. */
+ lines that were vacated. */
for (i = start; i != (start + amount); i++)
- {
- the_display[i]->text[0] = '\0';
- the_display[i]->textlen = 0;
- the_display[i]->inverse = 0;
- }
+ {
+ the_display[i]->text[0] = '\0';
+ the_display[i]->textlen = 0;
+ the_display[i]->inverse = 0;
+ }
}
if (amount < 0)
{
last = start + amount;
for (i = 0; i < (end - start); i++)
- {
- temp = the_display[last + i];
- the_display[last + i] = the_display[start + i];
- the_display[start + i] = temp;
- }
+ {
+ temp = the_display[last + i];
+ the_display[last + i] = the_display[start + i];
+ the_display[start + i] = temp;
+ }
/* The lines have been shifted up in the buffer. Clear all of the
- lines that are left over. */
+ lines that are left over. */
for (i = end + amount; i != end; i++)
- {
- the_display[i]->text[0] = '\0';
- the_display[i]->textlen = 0;
- the_display[i]->inverse = 0;
- }
+ {
+ the_display[i]->text[0] = '\0';
+ the_display[i]->textlen = 0;
+ the_display[i]->inverse = 0;
+ }
}
}
@@ -429,9 +434,9 @@ display_scroll_line_starts (window, old_pagetop, old_starts, old_count)
int old_pagetop, old_count;
char **old_starts;
{
- register int i, old, new; /* Indices into the line starts arrays. */
- int last_new, last_old; /* Index of the last visible line. */
- int old_first, new_first; /* Index of the first changed line. */
+ register int i, old, new; /* Indices into the line starts arrays. */
+ int last_new, last_old; /* Index of the last visible line. */
+ int old_first, new_first; /* Index of the first changed line. */
int unchanged_at_top = 0;
int already_scrolled = 0;
@@ -461,39 +466,39 @@ display_scroll_line_starts (window, old_pagetop, old_starts, old_count)
for (old = old_first + unchanged_at_top; old < last_old; old++)
{
for (new = new_first; new < last_new; new++)
- if (old_starts[old] == window->line_starts[new])
- {
- /* Find the extent of the matching lines. */
- for (i = 0; (old + i) < last_old; i++)
- if (old_starts[old + i] != window->line_starts[new + i])
- break;
-
- /* Scroll these lines if there are enough of them. */
- {
- int start, end, amount;
-
- start = (window->first_row
- + ((old + already_scrolled) - old_pagetop));
- amount = new - (old + already_scrolled);
- end = window->first_row + window->height;
-
- /* If we are shifting the block of lines down, then the last
- AMOUNT lines will become invisible. Thus, don't bother
- scrolling them. */
- if (amount > 0)
- end -= amount;
-
- if ((end - start) > 0)
- {
- display_scroll_display (start, end, amount);
-
- /* Some lines have been scrolled. Simulate the scrolling
- by offsetting the value of the old index. */
- old += i;
- already_scrolled += amount;
- }
- }
- }
+ if (old_starts[old] == window->line_starts[new])
+ {
+ /* Find the extent of the matching lines. */
+ for (i = 0; (old + i) < last_old; i++)
+ if (old_starts[old + i] != window->line_starts[new + i])
+ break;
+
+ /* Scroll these lines if there are enough of them. */
+ {
+ int start, end, amount;
+
+ start = (window->first_row
+ + ((old + already_scrolled) - old_pagetop));
+ amount = new - (old + already_scrolled);
+ end = window->first_row + window->height;
+
+ /* If we are shifting the block of lines down, then the last
+ AMOUNT lines will become invisible. Thus, don't bother
+ scrolling them. */
+ if (amount > 0)
+ end -= amount;
+
+ if ((end - start) > 0)
+ {
+ display_scroll_display (start, end, amount);
+
+ /* Some lines have been scrolled. Simulate the scrolling
+ by offsetting the value of the old index. */
+ old += i;
+ already_scrolled += amount;
+ }
+ }
+ }
}
}
@@ -507,13 +512,12 @@ display_cursor_at_point (window)
vpos = window_line_of_point (window) - window->pagetop + window->first_row;
hpos = window_get_cursor_column (window);
terminal_goto_xy (hpos, vpos);
- fflush (stdout);
}
/* **************************************************************** */
-/* */
-/* Functions Static to this File */
-/* */
+/* */
+/* Functions Static to this File */
+/* */
/* **************************************************************** */
/* Make a DISPLAY_LINE ** with width and height. */
@@ -548,7 +552,7 @@ free_display (display)
if (!display)
return;
- for (i = 0; (display_line = display[i]); i++)
+ for (i = 0; display_line = display[i]; i++)
{
free (display_line->text);
free (display_line);
diff --git a/contrib/texinfo/info/display.h b/contrib/texinfo/info/display.h
index 439813576e21..d8bd5a166fe5 100644
--- a/contrib/texinfo/info/display.h
+++ b/contrib/texinfo/info/display.h
@@ -1,10 +1,9 @@
-/* display.h -- How the display in Info is done.
- $Id: display.h,v 1.2 1997/07/15 18:37:29 karl Exp $
+/* display.h -- How the display in Info is done. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_DISPLAY_H
-#define INFO_DISPLAY_H
+#if !defined (_DISPLAY_H_)
+#define _DISPLAY_H_
#include "info-utils.h"
#include "terminal.h"
@@ -74,4 +73,4 @@ extern void display_scroll_display ();
that appear in the OLD_STARTS array. */
extern void display_scroll_line_starts ();
-#endif /* not INFO_DISPLAY_H */
+#endif /* !_DISPLAY_H_ */
diff --git a/contrib/texinfo/info/doc.c b/contrib/texinfo/info/doc.c
index 673839601123..9c3b61593155 100644
--- a/contrib/texinfo/info/doc.c
+++ b/contrib/texinfo/info/doc.c
@@ -5,7 +5,7 @@
Source files groveled to make this file include:
./session.c
- ./echo-area.c
+ ./echo_area.c
./infodoc.c
./m-x.c
./indices.c
@@ -52,6 +52,7 @@ FUNCTION_DOC function_doc_array[] = {
{ info_up_node, "up-node", "Select the `Up' node" },
{ info_last_node, "last-node", "Select the last node in this file" },
{ info_first_node, "first-node", "Select the first node in this file" },
+ { info_history_node, "history-node", "Select the most recently selected node" },
{ info_last_menu_item, "last-menu-item", "Select the last item in this node's menu" },
{ info_menu_digit, "menu-digit", "Select this menu item" },
{ info_menu_item, "menu-item", "Read a menu item and select its node" },
@@ -62,7 +63,6 @@ FUNCTION_DOC function_doc_array[] = {
{ info_man, "man", "Read a manpage reference and select it" },
{ info_top_node, "top-node", "Select the node `Top' in this file" },
{ info_dir_node, "dir-node", "Select the node `(dir)'" },
- { info_history_node, "history-node", "Select the most recently selected node" },
{ info_kill_node, "kill-node", "Kill this node" },
{ info_view_file, "view-file", "Read the name of a file and select it" },
{ info_print_node, "print-node", "Pipe the contents of this node through INFO_PRINT_COMMAND" },
@@ -80,7 +80,7 @@ FUNCTION_DOC function_doc_array[] = {
{ info_add_digit_to_numeric_arg, "add-digit-to-numeric-arg", "Add this digit to the current numeric argument" },
{ info_universal_argument, "universal-argument", "Start (or multiply by 4) the current numeric argument" },
{ info_numeric_arg_digit_loop, "numeric-arg-digit-loop", "Internally used by \\[universal-argument]" },
-/* Commands found in "./echo-area.c". */
+/* Commands found in "./echo_area.c". */
{ ea_forward, "echo-area-forward", "Move forward a character" },
{ ea_backward, "echo-area-backward", "Move backward a character" },
{ ea_beg_of_line, "echo-area-beg-of-line", "Move to the start of this line" },
diff --git a/contrib/texinfo/info/doc.h b/contrib/texinfo/info/doc.h
index 423998e37c88..8afc28f74464 100644
--- a/contrib/texinfo/info/doc.h
+++ b/contrib/texinfo/info/doc.h
@@ -21,10 +21,18 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (DOC_H)
-#define DOC_H
+#if !defined (_DOC_H_)
+#define _DOC_H_
-#include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */
+#if !defined (NULL)
+# define NULL 0x0
+#endif /* !NULL */
+
+#if !defined (__FUNCTION_DEF)
+# define __FUNCTION_DEF
+typedef int Function ();
+typedef void VFunction ();
+#endif /* _FUNCTION_DEF */
typedef struct {
VFunction *func;
@@ -47,4 +55,4 @@ extern void dump_map_to_message_buffer ();
extern char *function_name ();
extern VFunction *named_function ();
#endif /* NAMED_FUNCTIONS */
-#endif /* !DOC_H */
+#endif /* !_DOC_H_ */
diff --git a/contrib/texinfo/info/dribble b/contrib/texinfo/info/dribble
new file mode 100644
index 000000000000..99d3a8448157
--- /dev/null
+++ b/contrib/texinfo/info/dribble
@@ -0,0 +1,5 @@
+mfoo
+em
+buffers
+
+ââ \ No newline at end of file
diff --git a/contrib/texinfo/info/dribble.c b/contrib/texinfo/info/dribble.c
index d1d584865606..8e16cea4e45f 100644
--- a/contrib/texinfo/info/dribble.c
+++ b/contrib/texinfo/info/dribble.c
@@ -21,7 +21,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h>
#include "dribble.h"
/* When non-zero, it is a stream to write all input characters to for the
diff --git a/contrib/texinfo/info/echo-area.c b/contrib/texinfo/info/echo-area.c
deleted file mode 100644
index 0d409e8dac04..000000000000
--- a/contrib/texinfo/info/echo-area.c
+++ /dev/null
@@ -1,1503 +0,0 @@
-/* echo-area.c -- How to read a line in the echo area.
- $Id: echo-area.c,v 1.10 1998/02/26 22:47:02 karl Exp $
-
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- Written by Brian Fox (bfox@ai.mit.edu). */
-
-#include "info.h"
-
-#if defined (FD_SET)
-# if defined (hpux)
-# define fd_set_cast(x) (int *)(x)
-# else
-# define fd_set_cast(x) (fd_set *)(x)
-# endif /* !hpux */
-#endif /* FD_SET */
-
-/* Non-zero means that C-g was used to quit reading input. */
-int info_aborted_echo_area = 0;
-
-/* Non-zero means that the echo area is being used to read input. */
-int echo_area_is_active = 0;
-
-/* The address of the last command executed in the echo area. */
-VFunction *ea_last_executed_command = (VFunction *)NULL;
-
-/* Non-zero means that the last command executed while reading input
- killed some text. */
-int echo_area_last_command_was_kill = 0;
-
-/* Variables which hold on to the current state of the input line. */
-static char input_line[1 + EA_MAX_INPUT];
-static char *input_line_prompt;
-static int input_line_point;
-static int input_line_beg;
-static int input_line_end;
-static NODE input_line_node = {
- (char *)NULL, (char *)NULL, (char *)NULL, input_line, EA_MAX_INPUT, 0
-};
-
-static void echo_area_initialize_node ();
-static void push_echo_area (), pop_echo_area ();
-static int echo_area_stack_contains_completions_p ();
-
-static void ea_kill_text ();
-
-/* Non-zero means we force the user to complete. */
-static int echo_area_must_complete_p = 0;
-static int completions_window_p ();
-
-/* If non-null, this is a window which was specifically created to display
- possible completions output. We remember it so we can delete it when
- appropriate. */
-static WINDOW *echo_area_completions_window = (WINDOW *)NULL;
-
-/* Variables which keep track of the window which was active prior to
- entering the echo area. */
-static WINDOW *calling_window = (WINDOW *)NULL;
-static NODE *calling_window_node = (NODE *)NULL;
-static long calling_window_point = 0;
-static long calling_window_pagetop = 0;
-
-/* Remember the node and pertinent variables of the calling window. */
-static void
-remember_calling_window (window)
- WINDOW *window;
-{
- /* Only do this if the calling window is not the completions window, or,
- if it is the completions window and there is no other window. */
- if (!completions_window_p (window) ||
- ((window == windows) && !(window->next)))
- {
- calling_window = window;
- calling_window_node = window->node;
- calling_window_point = window->point;
- calling_window_pagetop = window->pagetop;
- }
-}
-
-/* Restore the caller's window so that it shows the node that it was showing
- on entry to info_read_xxx_echo_area (). */
-static void
-restore_calling_window ()
-{
- register WINDOW *win, *compwin = (WINDOW *)NULL;
-
- /* If the calling window is still visible, and it is the window that
- we used for completions output, then restore the calling window. */
- for (win = windows; win; win = win->next)
- {
- if (completions_window_p (win))
- compwin = win;
-
- if (win == calling_window && win == compwin)
- {
- window_set_node_of_window (calling_window, calling_window_node);
- calling_window->point = calling_window_point;
- calling_window->pagetop = calling_window_pagetop;
- compwin = (WINDOW *)NULL;
- break;
- }
- }
-
- /* Delete the completions window if it is still present, it isn't the
- last window on the screen, and there aren't any prior echo area reads
- pending which created a completions window. */
- if (compwin)
- {
- if ((compwin != windows || windows->next) &&
- !echo_area_stack_contains_completions_p ())
- {
- WINDOW *next;
- int pagetop, start, end, amount;
-
- next = compwin->next;
- if (next)
- {
- start = next->first_row;
- end = start + next->height;
- amount = - (compwin->height + 1);
- pagetop = next->pagetop;
- }
-
- info_delete_window_internal (compwin);
-
- /* This is not necessary because info_delete_window_internal ()
- calls echo_area_inform_of_deleted_window (), which does the
- right thing. */
-#if defined (UNNECESSARY)
- echo_area_completions_window = (WINDOW *)NULL;
-#endif /* UNNECESSARY */
-
- if (next)
- {
- display_scroll_display (start, end, amount);
- next->pagetop = pagetop;
- display_update_display (windows);
- }
- }
- }
-}
-
-/* Set up a new input line with PROMPT. */
-static void
-initialize_input_line (prompt)
- char *prompt;
-{
- input_line_prompt = prompt;
- if (prompt)
- strcpy (input_line, prompt);
- else
- input_line[0] = '\0';
-
- input_line_beg = input_line_end = input_line_point = strlen (prompt);
-}
-
-static char *
-echo_area_after_read ()
-{
- char *return_value;
-
- if (info_aborted_echo_area)
- {
- info_aborted_echo_area = 0;
- return_value = (char *)NULL;
- }
- else
- {
- if (input_line_beg == input_line_end)
- return_value = xstrdup ("");
- else
- {
- int line_len = input_line_end - input_line_beg;
- return_value = (char *) xmalloc (1 + line_len);
- strncpy (return_value, &input_line[input_line_beg], line_len);
- return_value[line_len] = '\0';
- }
- }
- return (return_value);
-}
-
-/* Read a line of text in the echo area. Return a malloc ()'ed string,
- or NULL if the user aborted out of this read. WINDOW is the currently
- active window, so that we can restore it when we need to. PROMPT, if
- non-null, is a prompt to print before reading the line. */
-char *
-info_read_in_echo_area (window, prompt)
- WINDOW *window;
- char *prompt;
-{
- char *line;
-
- /* If the echo area is already active, remember the current state. */
- if (echo_area_is_active)
- push_echo_area ();
-
- /* Initialize our local variables. */
- initialize_input_line (prompt);
-
- /* Initialize the echo area for the first (but maybe not the last) time. */
- echo_area_initialize_node ();
-
- /* Save away the original node of this window, and the window itself,
- so echo area commands can temporarily use this window. */
- remember_calling_window (window);
-
- /* Let the rest of Info know that the echo area is active. */
- echo_area_is_active++;
- active_window = the_echo_area;
-
- /* Read characters in the echo area. */
- info_read_and_dispatch ();
-
- echo_area_is_active--;
-
- /* Restore the original active window and show point in it. */
- active_window = calling_window;
- restore_calling_window ();
- display_cursor_at_point (active_window);
- fflush (stdout);
-
- /* Get the value of the line. */
- line = echo_area_after_read ();
-
- /* If there is a previous loop waiting for us, restore it now. */
- if (echo_area_is_active)
- pop_echo_area ();
-
- /* Return the results to the caller. */
- return (line);
-}
-
-/* (re) Initialize the echo area node. */
-static void
-echo_area_initialize_node ()
-{
- register int i;
-
- for (i = input_line_end; i < sizeof (input_line); i++)
- input_line[i] = ' ';
-
- input_line[i - 1] = '\n';
- window_set_node_of_window (the_echo_area, &input_line_node);
- input_line[input_line_end] = '\n';
-}
-
-/* Prepare to read characters in the echo area. This can initialize the
- echo area node, but its primary purpose is to side effect the input
- line buffer contents. */
-void
-echo_area_prep_read ()
-{
- if (the_echo_area->node != &input_line_node)
- echo_area_initialize_node ();
-
- the_echo_area->point = input_line_point;
- input_line[input_line_end] = '\n';
- display_update_one_window (the_echo_area);
- display_cursor_at_point (active_window);
-}
-
-
-/* **************************************************************** */
-/* */
-/* Echo Area Movement Commands */
-/* */
-/* **************************************************************** */
-
-DECLARE_INFO_COMMAND (ea_forward, _("Move forward a character"))
-{
- if (count < 0)
- ea_backward (window, -count, key);
- else
- {
- input_line_point += count;
- if (input_line_point > input_line_end)
- input_line_point = input_line_end;
- }
-}
-
-DECLARE_INFO_COMMAND (ea_backward, _("Move backward a character"))
-{
- if (count < 0)
- ea_forward (window, -count, key);
- else
- {
- input_line_point -= count;
- if (input_line_point < input_line_beg)
- input_line_point = input_line_beg;
- }
-}
-
-DECLARE_INFO_COMMAND (ea_beg_of_line, _("Move to the start of this line"))
-{
- input_line_point = input_line_beg;
-}
-
-DECLARE_INFO_COMMAND (ea_end_of_line, _("Move to the end of this line"))
-{
- input_line_point = input_line_end;
-}
-
-#define alphabetic(c) (islower (c) || isupper (c) || isdigit (c))
-
-/* Move forward a word in the input line. */
-DECLARE_INFO_COMMAND (ea_forward_word, _("Move forward a word"))
-{
- int c;
-
- if (count < 0)
- ea_backward_word (window, -count, key);
- else
- {
- while (count--)
- {
- if (input_line_point == input_line_end)
- return;
-
- /* If we are not in a word, move forward until we are in one.
- Then, move forward until we hit a non-alphabetic character. */
- c = input_line[input_line_point];
-
- if (!alphabetic (c))
- {
- while (++input_line_point < input_line_end)
- {
- c = input_line[input_line_point];
- if (alphabetic (c))
- break;
- }
- }
-
- if (input_line_point == input_line_end)
- return;
-
- while (++input_line_point < input_line_end)
- {
- c = input_line[input_line_point];
- if (!alphabetic (c))
- break;
- }
- }
- }
-}
-
-DECLARE_INFO_COMMAND (ea_backward_word, _("Move backward a word"))
-{
- int c;
-
- if (count < 0)
- ea_forward_word (window, -count, key);
- else
- {
- while (count--)
- {
- if (input_line_point == input_line_beg)
- return;
-
- /* Like ea_forward_word (), except that we look at the
- characters just before point. */
-
- c = input_line[input_line_point - 1];
-
- if (!alphabetic (c))
- {
- while ((--input_line_point) != input_line_beg)
- {
- c = input_line[input_line_point - 1];
- if (alphabetic (c))
- break;
- }
- }
-
- while (input_line_point != input_line_beg)
- {
- c = input_line[input_line_point - 1];
- if (!alphabetic (c))
- break;
- else
- --input_line_point;
- }
- }
- }
-}
-
-DECLARE_INFO_COMMAND (ea_delete, _("Delete the character under the cursor"))
-{
- register int i;
-
- if (count < 0)
- ea_rubout (window, -count, key);
- else
- {
- if (input_line_point == input_line_end)
- return;
-
- if (info_explicit_arg || count > 1)
- {
- int orig_point;
-
- orig_point = input_line_point;
- ea_forward (window, count, key);
- ea_kill_text (orig_point, input_line_point);
- input_line_point = orig_point;
- }
- else
- {
- for (i = input_line_point; i < input_line_end; i++)
- input_line[i] = input_line[i + 1];
-
- input_line_end--;
- }
- }
-}
-
-DECLARE_INFO_COMMAND (ea_rubout, _("Delete the character behind the cursor"))
-{
- if (count < 0)
- ea_delete (window, -count, key);
- else
- {
- int start;
-
- if (input_line_point == input_line_beg)
- return;
-
- start = input_line_point;
- ea_backward (window, count, key);
-
- if (info_explicit_arg || count > 1)
- ea_kill_text (start, input_line_point);
- else
- ea_delete (window, count, key);
- }
-}
-
-DECLARE_INFO_COMMAND (ea_abort, _("Cancel or quit operation"))
-{
- /* If any text, just discard it, and restore the calling window's node.
- If no text, quit. */
- if (input_line_end != input_line_beg)
- {
- terminal_ring_bell ();
- input_line_end = input_line_point = input_line_beg;
- if (calling_window->node != calling_window_node)
- restore_calling_window ();
- }
- else
- info_aborted_echo_area = 1;
-}
-
-DECLARE_INFO_COMMAND (ea_newline, _("Accept (or force completion of) this line"))
-{
- /* Stub does nothing. Simply here to see if it has been executed. */
-}
-
-DECLARE_INFO_COMMAND (ea_quoted_insert, _("Insert next character verbatim"))
-{
- unsigned char character;
-
- character = info_get_another_input_char ();
- ea_insert (window, count, character);
-}
-
-DECLARE_INFO_COMMAND (ea_insert, _("Insert this character"))
-{
- register int i;
-
- if ((input_line_end + 1) == EA_MAX_INPUT)
- {
- terminal_ring_bell ();
- return;
- }
-
- for (i = input_line_end + 1; i != input_line_point; i--)
- input_line[i] = input_line[i - 1];
-
- input_line[input_line_point] = key;
- input_line_point++;
- input_line_end++;
-}
-
-DECLARE_INFO_COMMAND (ea_tab_insert, _("Insert a TAB character"))
-{
- ea_insert (window, count, '\t');
-}
-
-/* Transpose the characters at point. If point is at the end of the line,
- then transpose the characters before point. */
-DECLARE_INFO_COMMAND (ea_transpose_chars, _("Transpose characters at point"))
-{
- /* Handle conditions that would make it impossible to transpose
- characters. */
- if (!count || !input_line_point || (input_line_end - input_line_beg) < 2)
- return;
-
- while (count)
- {
- int t;
- if (input_line_point == input_line_end)
- {
- t = input_line[input_line_point - 1];
-
- input_line[input_line_point - 1] = input_line[input_line_point - 2];
- input_line[input_line_point - 2] = t;
- }
- else
- {
- t = input_line[input_line_point];
-
- input_line[input_line_point] = input_line[input_line_point - 1];
- input_line[input_line_point - 1] = t;
-
- if (count < 0 && input_line_point != input_line_beg)
- input_line_point--;
- else
- input_line_point++;
- }
-
- if (count < 0)
- count++;
- else
- count--;
- }
-}
-
-/* **************************************************************** */
-/* */
-/* Echo Area Killing and Yanking */
-/* */
-/* **************************************************************** */
-
-static char **kill_ring = (char **)NULL;
-static int kill_ring_index = 0; /* Number of kills appearing in KILL_RING. */
-static int kill_ring_slots = 0; /* Number of slots allocated to KILL_RING. */
-static int kill_ring_loc = 0; /* Location of current yank pointer. */
-
-/* The largest number of kills that we remember at one time. */
-static int max_retained_kills = 15;
-
-DECLARE_INFO_COMMAND (ea_yank, _("Yank back the contents of the last kill"))
-{
- register int i;
- register char *text;
-
- if (!kill_ring_index)
- {
- inform_in_echo_area (_("Kill ring is empty"));
- return;
- }
-
- text = kill_ring[kill_ring_loc];
-
- for (i = 0; text[i]; i++)
- ea_insert (window, 1, text[i]);
-}
-
-/* If the last command was yank, or yank_pop, and the text just before
- point is identical to the current kill item, then delete that text
- from the line, rotate the index down, and yank back some other text. */
-DECLARE_INFO_COMMAND (ea_yank_pop, _("Yank back a previous kill"))
-{
- register int len;
-
- if (((ea_last_executed_command != ea_yank) &&
- (ea_last_executed_command != ea_yank_pop)) ||
- (kill_ring_index == 0))
- return;
-
- len = strlen (kill_ring[kill_ring_loc]);
-
- /* Delete the last yanked item from the line. */
- {
- register int i, counter;
-
- counter = input_line_end - input_line_point;
-
- for (i = input_line_point - len; counter; i++, counter--)
- input_line[i] = input_line[i + len];
-
- input_line_end -= len;
- input_line_point -= len;
- }
-
- /* Get a previous kill, and yank that. */
- kill_ring_loc--;
- if (kill_ring_loc < 0)
- kill_ring_loc = kill_ring_index - 1;
-
- ea_yank (window, count, key);
-}
-
-/* Delete the text from point to end of line. */
-DECLARE_INFO_COMMAND (ea_kill_line, _("Kill to the end of the line"))
-{
- if (count < 0)
- {
- ea_kill_text (input_line_point, input_line_beg);
- input_line_point = input_line_beg;
- }
- else
- ea_kill_text (input_line_point, input_line_end);
-}
-
-/* Delete the text from point to beg of line. */
-DECLARE_INFO_COMMAND (ea_backward_kill_line,
- _("Kill to the beginning of the line"))
-{
- if (count < 0)
- ea_kill_text (input_line_point, input_line_end);
- else
- {
- ea_kill_text (input_line_point, input_line_beg);
- input_line_point = input_line_beg;
- }
-}
-
-/* Delete from point to the end of the current word. */
-DECLARE_INFO_COMMAND (ea_kill_word, _("Kill the word following the cursor"))
-{
- int orig_point = input_line_point;
-
- if (count < 0)
- ea_backward_kill_word (window, -count, key);
- else
- {
- ea_forward_word (window, count, key);
-
- if (input_line_point != orig_point)
- ea_kill_text (orig_point, input_line_point);
-
- input_line_point = orig_point;
- }
-}
-
-/* Delete from point to the start of the current word. */
-DECLARE_INFO_COMMAND (ea_backward_kill_word,
- _("Kill the word preceding the cursor"))
-{
- int orig_point = input_line_point;
-
- if (count < 0)
- ea_kill_word (window, -count, key);
- else
- {
- ea_backward_word (window, count, key);
-
- if (input_line_point != orig_point)
- ea_kill_text (orig_point, input_line_point);
- }
-}
-
-/* The way to kill something. This appends or prepends to the last
- kill, if the last command was a kill command. If FROM is less
- than TO, then the killed text is appended to the most recent kill,
- otherwise it is prepended. If the last command was not a kill command,
- then a new slot is made for this kill. */
-static void
-ea_kill_text (from, to)
- int from, to;
-{
- register int i, counter, distance;
- int killing_backwards, slot;
- char *killed_text;
-
- killing_backwards = (from > to);
-
- /* If killing backwards, reverse the values of FROM and TO. */
- if (killing_backwards)
- {
- int temp = from;
- from = to;
- to = temp;
- }
-
- /* Remember the text that we are about to delete. */
- distance = to - from;
- killed_text = (char *)xmalloc (1 + distance);
- strncpy (killed_text, &input_line[from], distance);
- killed_text[distance] = '\0';
-
- /* Actually delete the text from the line. */
- counter = input_line_end - to;
-
- for (i = from; counter; i++, counter--)
- input_line[i] = input_line[i + distance];
-
- input_line_end -= distance;
-
- /* If the last command was a kill, append or prepend the killed text to
- the last command's killed text. */
- if (echo_area_last_command_was_kill)
- {
- char *old, *new;
-
- slot = kill_ring_loc;
- old = kill_ring[slot];
- new = (char *)xmalloc (1 + strlen (old) + strlen (killed_text));
-
- if (killing_backwards)
- {
- /* Prepend TEXT to current kill. */
- strcpy (new, killed_text);
- strcat (new, old);
- }
- else
- {
- /* Append TEXT to current kill. */
- strcpy (new, old);
- strcat (new, killed_text);
- }
-
- free (old);
- free (killed_text);
- kill_ring[slot] = new;
- }
- else
- {
- /* Try to store the kill in a new slot, unless that would cause there
- to be too many remembered kills. */
- slot = kill_ring_index;
-
- if (slot == max_retained_kills)
- slot = 0;
-
- if (slot + 1 > kill_ring_slots)
- kill_ring = (char **) xrealloc
- (kill_ring,
- (kill_ring_slots += max_retained_kills) * sizeof (char *));
-
- if (slot != kill_ring_index)
- free (kill_ring[slot]);
- else
- kill_ring_index++;
-
- kill_ring[slot] = killed_text;
-
- kill_ring_loc = slot;
- }
-
- /* Notice that the last command was a kill. */
- echo_area_last_command_was_kill++;
-}
-
-/* **************************************************************** */
-/* */
-/* Echo Area Completion */
-/* */
-/* **************************************************************** */
-
-/* Pointer to an array of REFERENCE to complete over. */
-static REFERENCE **echo_area_completion_items = (REFERENCE **)NULL;
-
-/* Sorted array of REFERENCE * which is the possible completions found in
- the variable echo_area_completion_items. If there is only one element,
- it is the only possible completion. */
-static REFERENCE **completions_found = (REFERENCE **)NULL;
-static int completions_found_index = 0;
-static int completions_found_slots = 0;
-
-/* The lowest common denominator found while completing. */
-static REFERENCE *LCD_completion;
-
-/* Internal functions used by the user calls. */
-static void build_completions (), completions_must_be_rebuilt ();
-
-/* Variable which holds the output of completions. */
-static NODE *possible_completions_output_node = (NODE *)NULL;
-
-static char *compwin_name = "*Completions*";
-
-/* Return non-zero if WINDOW is a window used for completions output. */
-static int
-completions_window_p (window)
- WINDOW *window;
-{
- int result = 0;
-
- if (internal_info_node_p (window->node) &&
- (strcmp (window->node->nodename, compwin_name) == 0))
- result = 1;
-
- return (result);
-}
-
-/* Workhorse for completion readers. If FORCE is non-zero, the user cannot
- exit unless the line read completes, or is empty. */
-char *
-info_read_completing_internal (window, prompt, completions, force)
- WINDOW *window;
- char *prompt;
- REFERENCE **completions;
- int force;
-{
- char *line;
-
- /* If the echo area is already active, remember the current state. */
- if (echo_area_is_active)
- push_echo_area ();
-
- echo_area_must_complete_p = force;
-
- /* Initialize our local variables. */
- initialize_input_line (prompt);
-
- /* Initialize the echo area for the first (but maybe not the last) time. */
- echo_area_initialize_node ();
-
- /* Save away the original node of this window, and the window itself,
- so echo area commands can temporarily use this window. */
- remember_calling_window (window);
-
- /* Save away the list of items to complete over. */
- echo_area_completion_items = completions;
- completions_must_be_rebuilt ();
-
- active_window = the_echo_area;
- echo_area_is_active++;
-
- /* Read characters in the echo area. */
- while (1)
- {
- info_read_and_dispatch ();
-
- line = echo_area_after_read ();
-
- /* Force the completion to take place if the user hasn't accepted
- a default or aborted, and if FORCE is active. */
- if (force && line && *line && completions)
- {
- register int i;
-
- build_completions ();
-
- /* If there is only one completion, then make the line be that
- completion. */
- if (completions_found_index == 1)
- {
- free (line);
- line = xstrdup (completions_found[0]->label);
- break;
- }
-
- /* If one of the completions matches exactly, then that is okay, so
- return the current line. */
- for (i = 0; i < completions_found_index; i++)
- if (strcasecmp (completions_found[i]->label, line) == 0)
- {
- free (line);
- line = xstrdup (completions_found[i]->label);
- break;
- }
-
- /* If no match, go back and try again. */
- if (i == completions_found_index)
- {
- inform_in_echo_area (_("Not complete"));
- continue;
- }
- }
- break;
- }
- echo_area_is_active--;
-
- /* Restore the original active window and show point in it. */
- active_window = calling_window;
- restore_calling_window ();
- display_cursor_at_point (active_window);
- fflush (stdout);
-
- echo_area_completion_items = (REFERENCE **)NULL;
- completions_must_be_rebuilt ();
-
- /* If there is a previous loop waiting for us, restore it now. */
- if (echo_area_is_active)
- pop_echo_area ();
-
- return (line);
-}
-
-/* Read a line in the echo area with completion over COMPLETIONS. */
-char *
-info_read_completing_in_echo_area (window, prompt, completions)
- WINDOW *window;
- char *prompt;
- REFERENCE **completions;
-{
- return (info_read_completing_internal (window, prompt, completions, 1));
-}
-
-/* Read a line in the echo area allowing completion over COMPLETIONS, but
- not requiring it. */
-char *
-info_read_maybe_completing (window, prompt, completions)
- WINDOW *window;
- char *prompt;
- REFERENCE **completions;
-{
- return (info_read_completing_internal (window, prompt, completions, 0));
-}
-
-DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions"))
-{
- if (!echo_area_completion_items)
- {
- ea_insert (window, count, key);
- return;
- }
-
- build_completions ();
-
- if (!completions_found_index)
- {
- terminal_ring_bell ();
- inform_in_echo_area (_("No completions"));
- }
- else if ((completions_found_index == 1) && (key != '?'))
- {
- inform_in_echo_area (_("Sole completion"));
- }
- else
- {
- register int i, l;
- int limit, count, max_label = 0;
-
- initialize_message_buffer ();
- printf_to_message_buffer (completions_found_index == 1
- ? _("One completion:\n")
- : _("%d completions:\n"));
-
- /* Find the maximum length of a label. */
- for (i = 0; i < completions_found_index; i++)
- {
- int len = strlen (completions_found[i]->label);
- if (len > max_label)
- max_label = len;
- }
-
- max_label += 4;
-
- /* Find out how many columns we should print in. */
- limit = calling_window->width / max_label;
- if (limit != 1 && (limit * max_label == calling_window->width))
- limit--;
-
- /* Avoid a possible floating exception. If max_label > width then
- the limit will be 0 and a divide-by-zero fault will result. */
- if (limit == 0)
- limit = 1;
-
- /* How many iterations of the printing loop? */
- count = (completions_found_index + (limit - 1)) / limit;
-
- /* Watch out for special case. If the number of completions is less
- than LIMIT, then just do the inner printing loop. */
- if (completions_found_index < limit)
- count = 1;
-
- /* Print the sorted items, up-and-down alphabetically. */
- for (i = 0; i < count; i++)
- {
- register int j;
-
- for (j = 0, l = i; j < limit; j++)
- {
- if (l >= completions_found_index)
- break;
- else
- {
- char *label;
- int printed_length, k;
-
- label = completions_found[l]->label;
- printed_length = strlen (label);
- printf_to_message_buffer ("%s", label);
-
- if (j + 1 < limit)
- {
- for (k = 0; k < max_label - printed_length; k++)
- printf_to_message_buffer (" ");
- }
- }
- l += count;
- }
- printf_to_message_buffer ("\n");
- }
-
- /* Make a new node to hold onto possible completions. Don't destroy
- dangling pointers. */
- {
- NODE *temp;
-
- temp = message_buffer_to_node ();
- add_gcable_pointer (temp->contents);
- name_internal_node (temp, compwin_name);
- possible_completions_output_node = temp;
- }
-
- /* Find a suitable window for displaying the completions output.
- First choice is an existing window showing completions output.
- If there is only one window, and it is large, make another
- (smaller) window, and use that one. Otherwise, use the caller's
- window. */
- {
- WINDOW *compwin;
-
- compwin = get_internal_info_window (compwin_name);
-
- if (!compwin)
- {
- /* If we can split the window to display most of the completion
- items, then do so. */
- if (calling_window->height > (count * 2)
- && calling_window->height / 2 >= WINDOW_MIN_SIZE)
- {
- int start, pagetop;
-#ifdef SPLIT_BEFORE_ACTIVE
- int end;
-#endif
-
- active_window = calling_window;
-
- /* Perhaps we can scroll this window on redisplay. */
- start = calling_window->first_row;
- pagetop = calling_window->pagetop;
-
- compwin =
- window_make_window (possible_completions_output_node);
- active_window = the_echo_area;
- window_change_window_height
- (compwin, -(compwin->height - (count + 2)));
-
- window_adjust_pagetop (calling_window);
- remember_calling_window (calling_window);
-
-#if defined (SPLIT_BEFORE_ACTIVE)
- /* If the pagetop hasn't changed, scrolling the calling
- window is a reasonable thing to do. */
- if (pagetop == calling_window->pagetop)
- {
- end = start + calling_window->height;
- display_scroll_display
- (start, end, calling_window->prev->height + 1);
- }
-#else /* !SPLIT_BEFORE_ACTIVE */
- /* If the pagetop has changed, set the new pagetop here. */
- if (pagetop != calling_window->pagetop)
- {
- int newtop = calling_window->pagetop;
- calling_window->pagetop = pagetop;
- set_window_pagetop (calling_window, newtop);
- }
-#endif /* !SPLIT_BEFORE_ACTIVE */
-
- echo_area_completions_window = compwin;
- remember_window_and_node (compwin, compwin->node);
- }
- else
- compwin = calling_window;
- }
-
- if (compwin->node != possible_completions_output_node)
- {
- window_set_node_of_window
- (compwin, possible_completions_output_node);
- remember_window_and_node (compwin, compwin->node);
- }
-
- display_update_display (windows);
- }
- }
-}
-
-DECLARE_INFO_COMMAND (ea_complete, _("Insert completion"))
-{
- if (!echo_area_completion_items)
- {
- ea_insert (window, count, key);
- return;
- }
-
- /* If KEY is SPC, and we are not forcing completion to take place, simply
- insert the key. */
- if (!echo_area_must_complete_p && key == SPC)
- {
- ea_insert (window, count, key);
- return;
- }
-
- if (ea_last_executed_command == ea_complete)
- {
- /* If the keypress is a SPC character, and we have already tried
- completing once, and there are several completions, then check
- the batch of completions to see if any continue with a space.
- If there are some, insert the space character and continue. */
- if (key == SPC && completions_found_index > 1)
- {
- register int i, offset;
-
- offset = input_line_end - input_line_beg;
-
- for (i = 0; i < completions_found_index; i++)
- if (completions_found[i]->label[offset] == ' ')
- break;
-
- if (completions_found[i])
- ea_insert (window, 1, ' ');
- else
- {
- ea_possible_completions (window, count, key);
- return;
- }
- }
- else
- {
- ea_possible_completions (window, count, key);
- return;
- }
- }
-
- input_line_point = input_line_end;
- build_completions ();
-
- if (!completions_found_index)
- terminal_ring_bell ();
- else if (LCD_completion->label[0] == '\0')
- ea_possible_completions (window, count, key);
- else
- {
- register int i;
- input_line_point = input_line_end = input_line_beg;
- for (i = 0; LCD_completion->label[i]; i++)
- ea_insert (window, 1, LCD_completion->label[i]);
- }
-}
-
-/* Utility REFERENCE used to store possible LCD. */
-static REFERENCE LCD_reference = { (char *)NULL, (char *)NULL, (char *)NULL };
-
-static void remove_completion_duplicates ();
-
-/* Variables which remember the state of the most recent call
- to build_completions (). */
-static char *last_completion_request = (char *)NULL;
-static REFERENCE **last_completion_items = (REFERENCE **)NULL;
-
-/* How to tell the completion builder to reset internal state. */
-static void
-completions_must_be_rebuilt ()
-{
- maybe_free (last_completion_request);
- last_completion_request = (char *)NULL;
- last_completion_items = (REFERENCE **)NULL;
-}
-
-/* Build a list of possible completions from echo_area_completion_items,
- and the contents of input_line. */
-static void
-build_completions ()
-{
- register int i, len;
- register REFERENCE *entry;
- char *request;
- int informed_of_lengthy_job = 0;
-
- /* If there are no items to complete over, exit immediately. */
- if (!echo_area_completion_items)
- {
- completions_found_index = 0;
- LCD_completion = (REFERENCE *)NULL;
- return;
- }
-
- /* Check to see if this call to build completions is the same as the last
- call to build completions. */
- len = input_line_end - input_line_beg;
- request = (char *)xmalloc (1 + len);
- strncpy (request, &input_line[input_line_beg], len);
- request[len] = '\0';
-
- if (last_completion_request && last_completion_items &&
- last_completion_items == echo_area_completion_items &&
- (strcmp (last_completion_request, request) == 0))
- {
- free (request);
- return;
- }
-
- maybe_free (last_completion_request);
- last_completion_request = request;
- last_completion_items = echo_area_completion_items;
-
- /* Always start at the beginning of the list. */
- completions_found_index = 0;
- LCD_completion = (REFERENCE *)NULL;
-
- for (i = 0; (entry = echo_area_completion_items[i]); i++)
- {
- if (strncasecmp (request, entry->label, len) == 0)
- add_pointer_to_array (entry, completions_found_index,
- completions_found, completions_found_slots,
- 20, REFERENCE *);
-
- if (!informed_of_lengthy_job && completions_found_index > 100)
- {
- informed_of_lengthy_job = 1;
- window_message_in_echo_area (_("Building completions..."));
- }
- }
-
- if (!completions_found_index)
- return;
-
- /* Sort and prune duplicate entries from the completions array. */
- remove_completion_duplicates ();
-
- /* If there is only one completion, just return that. */
- if (completions_found_index == 1)
- {
- LCD_completion = completions_found[0];
- return;
- }
-
- /* Find the least common denominator. */
- {
- long shortest = 100000;
-
- for (i = 1; i < completions_found_index; i++)
- {
- register int j;
- int c1, c2;
-
- for (j = 0;
- (c1 = info_tolower (completions_found[i - 1]->label[j])) &&
- (c2 = info_tolower (completions_found[i]->label[j]));
- j++)
- if (c1 != c2)
- break;
-
- if (shortest > j)
- shortest = j;
- }
-
- maybe_free (LCD_reference.label);
- LCD_reference.label = (char *)xmalloc (1 + shortest);
- strncpy (LCD_reference.label, completions_found[0]->label, shortest);
- LCD_reference.label[shortest] = '\0';
- LCD_completion = &LCD_reference;
- }
-
- if (informed_of_lengthy_job)
- echo_area_initialize_node ();
-}
-
-/* Function called by qsort. */
-static int
-compare_references (entry1, entry2)
- REFERENCE **entry1, **entry2;
-{
- return (strcasecmp ((*entry1)->label, (*entry2)->label));
-}
-
-/* Prune duplicate entries from COMPLETIONS_FOUND. */
-static void
-remove_completion_duplicates ()
-{
- register int i, j;
- REFERENCE **temp;
- int newlen;
-
- if (!completions_found_index)
- return;
-
- /* Sort the items. */
- qsort (completions_found, completions_found_index, sizeof (REFERENCE *),
- compare_references);
-
- for (i = 0, newlen = 1; i < completions_found_index - 1; i++)
- {
- if (strcmp (completions_found[i]->label,
- completions_found[i + 1]->label) == 0)
- completions_found[i] = (REFERENCE *)NULL;
- else
- newlen++;
- }
-
- /* We have marked all the dead slots. It is faster to copy the live slots
- twice than to prune the dead slots one by one. */
- temp = (REFERENCE **)xmalloc ((1 + newlen) * sizeof (REFERENCE *));
- for (i = 0, j = 0; i < completions_found_index; i++)
- if (completions_found[i])
- temp[j++] = completions_found[i];
-
- for (i = 0; i < newlen; i++)
- completions_found[i] = temp[i];
-
- completions_found[i] = (REFERENCE *)NULL;
- completions_found_index = newlen;
- free (temp);
-}
-
-/* Scroll the "other" window. If there is a window showing completions, scroll
- that one, otherwise scroll the window which was active on entering the read
- function. */
-DECLARE_INFO_COMMAND (ea_scroll_completions_window, _("Scroll the completions window"))
-{
- WINDOW *compwin;
- int old_pagetop;
-
- compwin = get_internal_info_window (compwin_name);
-
- if (!compwin)
- compwin = calling_window;
-
- old_pagetop = compwin->pagetop;
-
- /* Let info_scroll_forward () do the work, and print any messages that
- need to be displayed. */
- info_scroll_forward (compwin, count, key);
-}
-
-/* Function which gets called when an Info window is deleted while the
- echo area is active. WINDOW is the window which has just been deleted. */
-void
-echo_area_inform_of_deleted_window (window)
- WINDOW *window;
-{
- /* If this is the calling_window, forget what we remembered about it. */
- if (window == calling_window)
- {
- if (active_window != the_echo_area)
- remember_calling_window (active_window);
- else
- remember_calling_window (windows);
- }
-
- /* If this window was the echo_area_completions_window, then notice that
- the window has been deleted. */
- if (window == echo_area_completions_window)
- echo_area_completions_window = (WINDOW *)NULL;
-}
-
-/* **************************************************************** */
-/* */
-/* Pushing and Popping the Echo Area */
-/* */
-/* **************************************************************** */
-
-/* Push and Pop the echo area. */
-typedef struct {
- char *line;
- char *prompt;
- REFERENCE **comp_items;
- int point, beg, end;
- int must_complete;
- NODE node;
- WINDOW *compwin;
-} PUSHED_EA;
-
-static PUSHED_EA **pushed_echo_areas = (PUSHED_EA **)NULL;
-static int pushed_echo_areas_index = 0;
-static int pushed_echo_areas_slots = 0;
-
-/* Pushing the echo_area has a side effect of zeroing the completion_items. */
-static void
-push_echo_area ()
-{
- PUSHED_EA *pushed;
-
- pushed = (PUSHED_EA *)xmalloc (sizeof (PUSHED_EA));
- pushed->line = xstrdup (input_line);
- pushed->prompt = input_line_prompt;
- pushed->point = input_line_point;
- pushed->beg = input_line_beg;
- pushed->end = input_line_end;
- pushed->node = input_line_node;
- pushed->comp_items = echo_area_completion_items;
- pushed->must_complete = echo_area_must_complete_p;
- pushed->compwin = echo_area_completions_window;
-
- add_pointer_to_array (pushed, pushed_echo_areas_index, pushed_echo_areas,
- pushed_echo_areas_slots, 4, PUSHED_EA *);
-
- echo_area_completion_items = (REFERENCE **)NULL;
-}
-
-static void
-pop_echo_area ()
-{
- PUSHED_EA *popped;
-
- popped = pushed_echo_areas[--pushed_echo_areas_index];
-
- strcpy (input_line, popped->line);
- free (popped->line);
- input_line_prompt = popped->prompt;
- input_line_point = popped->point;
- input_line_beg = popped->beg;
- input_line_end = popped->end;
- input_line_node = popped->node;
- echo_area_completion_items = popped->comp_items;
- echo_area_must_complete_p = popped->must_complete;
- echo_area_completions_window = popped->compwin;
- completions_must_be_rebuilt ();
-
- /* If the completion window no longer exists, forget about it. */
- if (echo_area_completions_window)
- {
- register WINDOW *win;
-
- for (win = windows; win; win = win->next)
- if (echo_area_completions_window == win)
- break;
-
- /* If the window wasn't found, then it has already been deleted. */
- if (!win)
- echo_area_completions_window = (WINDOW *)NULL;
- }
-
- free (popped);
-}
-
-/* Returns non-zero if any of the prior stacked calls to read in the echo
- area produced a completions window. */
-static int
-echo_area_stack_contains_completions_p ()
-{
- register int i;
-
- for (i = 0; i < pushed_echo_areas_index; i++)
- if (pushed_echo_areas[i]->compwin)
- return (1);
-
- return (0);
-}
-
-/* **************************************************************** */
-/* */
-/* Error Messages While Reading in Echo Area */
-/* */
-/* **************************************************************** */
-
-#if defined (HAVE_SYS_TIME_H)
-# include <sys/time.h>
-# define HAVE_STRUCT_TIMEVAL
-#endif /* HAVE_SYS_TIME_H */
-
-static void
-pause_or_input ()
-{
-#if defined (FD_SET)
- struct timeval timer;
- fd_set readfds;
- int ready;
-
- FD_ZERO (&readfds);
- FD_SET (fileno (stdin), &readfds);
- timer.tv_sec = 2;
- timer.tv_usec = 750;
- ready = select (fileno (stdin) + 1, &readfds, (fd_set *) NULL,
- (fd_set *) NULL, &timer);
-#endif /* FD_SET */
-}
-
-/* Print MESSAGE right after the end of the current line, and wait
- for input or 2.75 seconds, whichever comes first. Then flush the
- informational message that was printed. */
-void
-inform_in_echo_area (message)
- char *message;
-{
- register int i;
- char *text;
-
- text = xstrdup (message);
- for (i = 0; text[i] && text[i] != '\n'; i++);
- text[i] = '\0';
-
- echo_area_initialize_node ();
- sprintf (&input_line[input_line_end], "%s[%s]\n",
- echo_area_is_active ? " ": "", text);
- free (text);
- the_echo_area->point = input_line_point;
- display_update_one_window (the_echo_area);
- display_cursor_at_point (active_window);
- fflush (stdout);
- pause_or_input ();
- echo_area_initialize_node ();
-}
diff --git a/contrib/texinfo/info/echo-area.h b/contrib/texinfo/info/echo-area.h
deleted file mode 100644
index 7feec06770e9..000000000000
--- a/contrib/texinfo/info/echo-area.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* echo-area.h -- Functions used in reading information from the echo area.
- $Id: echo-area.h,v 1.3 1997/07/15 18:38:21 karl Exp $
-
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- Written by Brian Fox (bfox@ai.mit.edu). */
-
-#ifndef INFO_ECHO_AREA_H
-#define INFO_ECHO_AREA_H
-
-#define EA_MAX_INPUT 256
-
-extern int echo_area_is_active, info_aborted_echo_area;
-
-/* Non-zero means that the last command executed while reading input
- killed some text. */
-extern int echo_area_last_command_was_kill;
-
-extern void inform_in_echo_area (), echo_area_inform_of_deleted_window ();
-extern void echo_area_prep_read ();
-extern VFunction *ea_last_executed_command;
-
-/* Read a line of text in the echo area. Return a malloc ()'ed string,
- or NULL if the user aborted out of this read. WINDOW is the currently
- active window, so that we can restore it when we need to. PROMPT, if
- non-null, is a prompt to print before reading the line. */
-extern char *info_read_in_echo_area ();
-
-/* Read a line in the echo area with completion over COMPLETIONS.
- Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */
-char *info_read_completing_in_echo_area ();
-
-/* Read a line in the echo area allowing completion over COMPLETIONS, but
- not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS,
- a REFERENCE **. */
-extern char *info_read_maybe_completing ();
-
-extern void ea_insert (), ea_quoted_insert ();
-extern void ea_beg_of_line (), ea_backward (), ea_delete (), ea_end_of_line ();
-extern void ea_forward (), ea_abort (), ea_rubout (), ea_complete ();
-extern void ea_newline (), ea_kill_line (), ea_transpose_chars ();
-extern void ea_yank (), ea_tab_insert (), ea_possible_completions ();
-extern void ea_backward_word (), ea_kill_word (), ea_forward_word ();
-extern void ea_yank_pop (), ea_backward_kill_word ();
-extern void ea_scroll_completions_window ();
-
-#endif /* not INFO_ECHO_AREA_H */
diff --git a/contrib/texinfo/info/echo_area.c b/contrib/texinfo/info/echo_area.c
new file mode 100644
index 000000000000..265e98804259
--- /dev/null
+++ b/contrib/texinfo/info/echo_area.c
@@ -0,0 +1,1508 @@
+/* echo_area.c -- How to read a line in the echo area. */
+
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by Brian Fox (bfox@ai.mit.edu). */
+
+#include "info.h"
+
+#if defined (FD_SET)
+# if defined (hpux)
+# define fd_set_cast(x) (int *)(x)
+# else
+# define fd_set_cast(x) (fd_set *)(x)
+# endif /* !hpux */
+#endif /* FD_SET */
+
+/* Non-zero means that C-g was used to quit reading input. */
+int info_aborted_echo_area = 0;
+
+/* Non-zero means that the echo area is being used to read input. */
+int echo_area_is_active = 0;
+
+/* The address of the last command executed in the echo area. */
+VFunction *ea_last_executed_command = (VFunction *)NULL;
+
+/* Non-zero means that the last command executed while reading input
+ killed some text. */
+int echo_area_last_command_was_kill = 0;
+
+/* Variables which hold on to the current state of the input line. */
+static char input_line[1 + EA_MAX_INPUT];
+static char *input_line_prompt;
+static int input_line_point;
+static int input_line_beg;
+static int input_line_end;
+static NODE input_line_node = {
+ (char *)NULL, (char *)NULL, (char *)NULL, input_line, EA_MAX_INPUT, 0
+};
+
+static void echo_area_initialize_node ();
+static void push_echo_area (), pop_echo_area ();
+static int echo_area_stack_depth (), echo_area_stack_contains_completions_p ();
+
+static void ea_kill_text ();
+
+/* Non-zero means we force the user to complete. */
+static int echo_area_must_complete_p = 0;
+static int completions_window_p ();
+
+/* If non-null, this is a window which was specifically created to display
+ possible completions output. We remember it so we can delete it when
+ appropriate. */
+static WINDOW *echo_area_completions_window = (WINDOW *)NULL;
+
+/* Variables which keep track of the window which was active prior to
+ entering the echo area. */
+static WINDOW *calling_window = (WINDOW *)NULL;
+static NODE *calling_window_node = (NODE *)NULL;
+static long calling_window_point = 0;
+static long calling_window_pagetop = 0;
+
+/* Remember the node and pertinent variables of the calling window. */
+static void
+remember_calling_window (window)
+ WINDOW *window;
+{
+ /* Only do this if the calling window is not the completions window, or,
+ if it is the completions window and there is no other window. */
+ if (!completions_window_p (window) ||
+ ((window == windows) && !(window->next)))
+ {
+ calling_window = window;
+ calling_window_node = window->node;
+ calling_window_point = window->point;
+ calling_window_pagetop = window->pagetop;
+ }
+}
+
+/* Restore the caller's window so that it shows the node that it was showing
+ on entry to info_read_xxx_echo_area (). */
+static void
+restore_calling_window ()
+{
+ register WINDOW *win, *compwin = (WINDOW *)NULL;
+
+ /* If the calling window is still visible, and it is the window that
+ we used for completions output, then restore the calling window. */
+ for (win = windows; win; win = win->next)
+ {
+ if (completions_window_p (win))
+ compwin = win;
+
+ if (win == calling_window && win == compwin)
+ {
+ window_set_node_of_window (calling_window, calling_window_node);
+ calling_window->point = calling_window_point;
+ calling_window->pagetop = calling_window_pagetop;
+ compwin = (WINDOW *)NULL;
+ break;
+ }
+ }
+
+ /* Delete the completions window if it is still present, it isn't the
+ last window on the screen, and there aren't any prior echo area reads
+ pending which created a completions window. */
+ if (compwin)
+ {
+ if ((compwin != windows || windows->next) &&
+ !echo_area_stack_contains_completions_p ())
+ {
+ WINDOW *next;
+ int pagetop, start, end, amount;
+
+ next = compwin->next;
+ if (next)
+ {
+ start = next->first_row;
+ end = start + next->height;
+ amount = - (compwin->height + 1);
+ pagetop = next->pagetop;
+ }
+
+ info_delete_window_internal (compwin);
+
+ /* This is not necessary because info_delete_window_internal ()
+ calls echo_area_inform_of_deleted_window (), which does the
+ right thing. */
+#if defined (UNNECESSARY)
+ echo_area_completions_window = (WINDOW *)NULL;
+#endif /* UNNECESSARY */
+
+ if (next)
+ {
+ display_scroll_display (start, end, amount);
+ next->pagetop = pagetop;
+ display_update_display (windows);
+ }
+ }
+ }
+}
+
+/* Set up a new input line with PROMPT. */
+static void
+initialize_input_line (prompt)
+ char *prompt;
+{
+ input_line_prompt = prompt;
+ if (prompt)
+ strcpy (input_line, prompt);
+ else
+ input_line[0] = '\0';
+
+ input_line_beg = input_line_end = input_line_point = strlen (prompt);
+}
+
+static char *
+echo_area_after_read ()
+{
+ char *return_value;
+
+ if (info_aborted_echo_area)
+ {
+ info_aborted_echo_area = 0;
+ return_value = (char *)NULL;
+ }
+ else
+ {
+ if (input_line_beg == input_line_end)
+ return_value = strdup ("");
+ else
+ {
+ int line_len = input_line_end - input_line_beg;
+ return_value = (char *) xmalloc (1 + line_len);
+ strncpy (return_value, &input_line[input_line_beg], line_len);
+ return_value[line_len] = '\0';
+ }
+ }
+ return (return_value);
+}
+
+/* Read a line of text in the echo area. Return a malloc ()'ed string,
+ or NULL if the user aborted out of this read. WINDOW is the currently
+ active window, so that we can restore it when we need to. PROMPT, if
+ non-null, is a prompt to print before reading the line. */
+char *
+info_read_in_echo_area (window, prompt)
+ WINDOW *window;
+ char *prompt;
+{
+ char *line;
+
+ /* If the echo area is already active, remember the current state. */
+ if (echo_area_is_active)
+ push_echo_area ();
+
+ /* Initialize our local variables. */
+ initialize_input_line (prompt);
+
+ /* Initialize the echo area for the first (but maybe not the last) time. */
+ echo_area_initialize_node ();
+
+ /* Save away the original node of this window, and the window itself,
+ so echo area commands can temporarily use this window. */
+ remember_calling_window (window);
+
+ /* Let the rest of Info know that the echo area is active. */
+ echo_area_is_active++;
+ active_window = the_echo_area;
+
+ /* Read characters in the echo area. */
+ info_read_and_dispatch ();
+
+ echo_area_is_active--;
+
+ /* Restore the original active window and show point in it. */
+ active_window = calling_window;
+ restore_calling_window ();
+ display_cursor_at_point (active_window);
+ fflush (stdout);
+
+ /* Get the value of the line. */
+ line = echo_area_after_read ();
+
+ /* If there is a previous loop waiting for us, restore it now. */
+ if (echo_area_is_active)
+ pop_echo_area ();
+
+ /* Return the results to the caller. */
+ return (line);
+}
+
+/* (re) Initialize the echo area node. */
+static void
+echo_area_initialize_node ()
+{
+ register int i;
+
+ for (i = input_line_end; i < sizeof (input_line); i++)
+ input_line[i] = ' ';
+
+ input_line[i - 1] = '\n';
+ window_set_node_of_window (the_echo_area, &input_line_node);
+ input_line[input_line_end] = '\n';
+}
+
+/* Prepare to read characters in the echo area. This can initialize the
+ echo area node, but its primary purpose is to side effect the input
+ line buffer contents. */
+void
+echo_area_prep_read ()
+{
+ if (the_echo_area->node != &input_line_node)
+ echo_area_initialize_node ();
+
+ the_echo_area->point = input_line_point;
+ input_line[input_line_end] = '\n';
+ display_update_one_window (the_echo_area);
+ display_cursor_at_point (active_window);
+}
+
+
+/* **************************************************************** */
+/* */
+/* Echo Area Movement Commands */
+/* */
+/* **************************************************************** */
+
+DECLARE_INFO_COMMAND (ea_forward, "Move forward a character")
+{
+ if (count < 0)
+ ea_backward (window, -count, key);
+ else
+ {
+ input_line_point += count;
+ if (input_line_point > input_line_end)
+ input_line_point = input_line_end;
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_backward, "Move backward a character")
+{
+ if (count < 0)
+ ea_forward (window, -count, key);
+ else
+ {
+ input_line_point -= count;
+ if (input_line_point < input_line_beg)
+ input_line_point = input_line_beg;
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_beg_of_line, "Move to the start of this line")
+{
+ input_line_point = input_line_beg;
+}
+
+DECLARE_INFO_COMMAND (ea_end_of_line, "Move to the end of this line")
+{
+ input_line_point = input_line_end;
+}
+
+#define alphabetic(c) (islower (c) || isupper (c) || isdigit (c))
+
+/* Move forward a word in the input line. */
+DECLARE_INFO_COMMAND (ea_forward_word, "Move forward a word")
+{
+ int c;
+
+ if (count < 0)
+ ea_backward_word (window, -count, key);
+ else
+ {
+ while (count--)
+ {
+ if (input_line_point == input_line_end)
+ return;
+
+ /* If we are not in a word, move forward until we are in one.
+ Then, move forward until we hit a non-alphabetic character. */
+ c = input_line[input_line_point];
+
+ if (!alphabetic (c))
+ {
+ while (++input_line_point < input_line_end)
+ {
+ c = input_line[input_line_point];
+ if (alphabetic (c))
+ break;
+ }
+ }
+
+ if (input_line_point == input_line_end)
+ return;
+
+ while (++input_line_point < input_line_end)
+ {
+ c = input_line[input_line_point];
+ if (!alphabetic (c))
+ break;
+ }
+ }
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_backward_word, "Move backward a word")
+{
+ int c;
+
+ if (count < 0)
+ ea_forward_word (window, -count, key);
+ else
+ {
+ while (count--)
+ {
+ if (input_line_point == input_line_beg)
+ return;
+
+ /* Like ea_forward_word (), except that we look at the
+ characters just before point. */
+
+ c = input_line[input_line_point - 1];
+
+ if (!alphabetic (c))
+ {
+ while ((--input_line_point) != input_line_beg)
+ {
+ c = input_line[input_line_point - 1];
+ if (alphabetic (c))
+ break;
+ }
+ }
+
+ while (input_line_point != input_line_beg)
+ {
+ c = input_line[input_line_point - 1];
+ if (!alphabetic (c))
+ break;
+ else
+ --input_line_point;
+ }
+ }
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_delete, "Delete the character under the cursor")
+{
+ register int i;
+
+ if (count < 0)
+ ea_rubout (window, -count, key);
+ else
+ {
+ if (input_line_point == input_line_end)
+ return;
+
+ if (info_explicit_arg || count > 1)
+ {
+ int orig_point;
+
+ orig_point = input_line_point;
+ ea_forward (window, count, key);
+ ea_kill_text (orig_point, input_line_point);
+ input_line_point = orig_point;
+ }
+ else
+ {
+ for (i = input_line_point; i < input_line_end; i++)
+ input_line[i] = input_line[i + 1];
+
+ input_line_end--;
+ }
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_rubout, "Delete the character behind the cursor")
+{
+ if (count < 0)
+ ea_delete (window, -count, key);
+ else
+ {
+ int start;
+
+ if (input_line_point == input_line_beg)
+ return;
+
+ start = input_line_point;
+ ea_backward (window, count, key);
+
+ if (info_explicit_arg || count > 1)
+ ea_kill_text (start, input_line_point);
+ else
+ ea_delete (window, count, key);
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_abort, "Cancel or quit operation")
+{
+ /* If any text, just discard it, and restore the calling window's node.
+ If no text, quit. */
+ if (input_line_end != input_line_beg)
+ {
+ terminal_ring_bell ();
+ input_line_end = input_line_point = input_line_beg;
+ if (calling_window->node != calling_window_node)
+ restore_calling_window ();
+ }
+ else
+ info_aborted_echo_area = 1;
+}
+
+DECLARE_INFO_COMMAND (ea_newline, "Accept (or force completion of) this line")
+{
+ /* Stub does nothing. Simply here to see if it has been executed. */
+}
+
+DECLARE_INFO_COMMAND (ea_quoted_insert, "Insert next character verbatim")
+{
+ unsigned char character;
+
+ character = info_get_another_input_char ();
+ ea_insert (window, count, character);
+}
+
+DECLARE_INFO_COMMAND (ea_insert, "Insert this character")
+{
+ register int i;
+
+ if ((input_line_end + 1) == EA_MAX_INPUT)
+ {
+ terminal_ring_bell ();
+ return;
+ }
+
+ for (i = input_line_end + 1; i != input_line_point; i--)
+ input_line[i] = input_line[i - 1];
+
+ input_line[input_line_point] = key;
+ input_line_point++;
+ input_line_end++;
+}
+
+DECLARE_INFO_COMMAND (ea_tab_insert, "Insert a TAB character")
+{
+ ea_insert (window, count, '\t');
+}
+
+/* Transpose the characters at point. If point is at the end of the line,
+ then transpose the characters before point. */
+DECLARE_INFO_COMMAND (ea_transpose_chars, "Transpose characters at point")
+{
+ /* Handle conditions that would make it impossible to transpose
+ characters. */
+ if (!count || !input_line_point || (input_line_end - input_line_beg) < 2)
+ return;
+
+ while (count)
+ {
+ int t;
+ if (input_line_point == input_line_end)
+ {
+ t = input_line[input_line_point - 1];
+
+ input_line[input_line_point - 1] = input_line[input_line_point - 2];
+ input_line[input_line_point - 2] = t;
+ }
+ else
+ {
+ t = input_line[input_line_point];
+
+ input_line[input_line_point] = input_line[input_line_point - 1];
+ input_line[input_line_point - 1] = t;
+
+ if (count < 0 && input_line_point != input_line_beg)
+ input_line_point--;
+ else
+ input_line_point++;
+ }
+
+ if (count < 0)
+ count++;
+ else
+ count--;
+ }
+}
+
+/* **************************************************************** */
+/* */
+/* Echo Area Killing and Yanking */
+/* */
+/* **************************************************************** */
+
+static char **kill_ring = (char **)NULL;
+static int kill_ring_index = 0; /* Number of kills appearing in KILL_RING. */
+static int kill_ring_slots = 0; /* Number of slots allocated to KILL_RING. */
+static int kill_ring_loc = 0; /* Location of current yank pointer. */
+
+/* The largest number of kills that we remember at one time. */
+static int max_retained_kills = 15;
+
+DECLARE_INFO_COMMAND (ea_yank, "Yank back the contents of the last kill")
+{
+ register int i;
+ register char *text;
+
+ if (!kill_ring_index)
+ {
+ inform_in_echo_area ("Kill ring is empty");
+ return;
+ }
+
+ text = kill_ring[kill_ring_loc];
+
+ for (i = 0; text[i]; i++)
+ ea_insert (window, 1, text[i]);
+}
+
+/* If the last command was yank, or yank_pop, and the text just before
+ point is identical to the current kill item, then delete that text
+ from the line, rotate the index down, and yank back some other text. */
+DECLARE_INFO_COMMAND (ea_yank_pop, "Yank back a previous kill")
+{
+ register int len;
+
+ if (((ea_last_executed_command != ea_yank) &&
+ (ea_last_executed_command != ea_yank_pop)) ||
+ (kill_ring_index == 0))
+ return;
+
+ len = strlen (kill_ring[kill_ring_loc]);
+
+ /* Delete the last yanked item from the line. */
+ {
+ register int i, counter;
+
+ counter = input_line_end - input_line_point;
+
+ for (i = input_line_point - len; counter; i++, counter--)
+ input_line[i] = input_line[i + len];
+
+ input_line_end -= len;
+ input_line_point -= len;
+ }
+
+ /* Get a previous kill, and yank that. */
+ kill_ring_loc--;
+ if (kill_ring_loc < 0)
+ kill_ring_loc = kill_ring_index - 1;
+
+ ea_yank (window, count, key);
+}
+
+/* Delete the text from point to end of line. */
+DECLARE_INFO_COMMAND (ea_kill_line, "Kill to the end of the line")
+{
+ if (count < 0)
+ {
+ ea_kill_text (input_line_point, input_line_beg);
+ input_line_point = input_line_beg;
+ }
+ else
+ ea_kill_text (input_line_point, input_line_end);
+}
+
+/* Delete the text from point to beg of line. */
+DECLARE_INFO_COMMAND (ea_backward_kill_line,
+ "Kill to the beginning of the line")
+{
+ if (count < 0)
+ ea_kill_text (input_line_point, input_line_end);
+ else
+ {
+ ea_kill_text (input_line_point, input_line_beg);
+ input_line_point = input_line_beg;
+ }
+}
+
+/* Delete from point to the end of the current word. */
+DECLARE_INFO_COMMAND (ea_kill_word, "Kill the word following the cursor")
+{
+ int orig_point = input_line_point;
+
+ if (count < 0)
+ ea_backward_kill_word (window, -count, key);
+ else
+ {
+ ea_forward_word (window, count, key);
+
+ if (input_line_point != orig_point)
+ ea_kill_text (orig_point, input_line_point);
+
+ input_line_point = orig_point;
+ }
+}
+
+/* Delete from point to the start of the current word. */
+DECLARE_INFO_COMMAND (ea_backward_kill_word,
+ "Kill the word preceding the cursor")
+{
+ int orig_point = input_line_point;
+
+ if (count < 0)
+ ea_kill_word (window, -count, key);
+ else
+ {
+ ea_backward_word (window, count, key);
+
+ if (input_line_point != orig_point)
+ ea_kill_text (orig_point, input_line_point);
+ }
+}
+
+/* The way to kill something. This appends or prepends to the last
+ kill, if the last command was a kill command. If FROM is less
+ than TO, then the killed text is appended to the most recent kill,
+ otherwise it is prepended. If the last command was not a kill command,
+ then a new slot is made for this kill. */
+static void
+ea_kill_text (from, to)
+ int from, to;
+{
+ register int i, counter, distance;
+ int killing_backwards, slot;
+ char *killed_text;
+
+ killing_backwards = (from > to);
+
+ /* If killing backwards, reverse the values of FROM and TO. */
+ if (killing_backwards)
+ {
+ int temp = from;
+ from = to;
+ to = temp;
+ }
+
+ /* Remember the text that we are about to delete. */
+ distance = to - from;
+ killed_text = (char *)xmalloc (1 + distance);
+ strncpy (killed_text, &input_line[from], distance);
+ killed_text[distance] = '\0';
+
+ /* Actually delete the text from the line. */
+ counter = input_line_end - to;
+
+ for (i = from; counter; i++, counter--)
+ input_line[i] = input_line[i + distance];
+
+ input_line_end -= distance;
+
+ /* If the last command was a kill, append or prepend the killed text to
+ the last command's killed text. */
+ if (echo_area_last_command_was_kill)
+ {
+ char *old, *new;
+
+ slot = kill_ring_loc;
+ old = kill_ring[slot];
+ new = (char *)xmalloc (1 + strlen (old) + strlen (killed_text));
+
+ if (killing_backwards)
+ {
+ /* Prepend TEXT to current kill. */
+ strcpy (new, killed_text);
+ strcat (new, old);
+ }
+ else
+ {
+ /* Append TEXT to current kill. */
+ strcpy (new, old);
+ strcat (new, killed_text);
+ }
+
+ free (old);
+ free (killed_text);
+ kill_ring[slot] = new;
+ }
+ else
+ {
+ /* Try to store the kill in a new slot, unless that would cause there
+ to be too many remembered kills. */
+ slot = kill_ring_index;
+
+ if (slot == max_retained_kills)
+ slot = 0;
+
+ if (slot + 1 > kill_ring_slots)
+ kill_ring = (char **) xrealloc
+ (kill_ring,
+ (kill_ring_slots += max_retained_kills) * sizeof (char *));
+
+ if (slot != kill_ring_index)
+ free (kill_ring[slot]);
+ else
+ kill_ring_index++;
+
+ kill_ring[slot] = killed_text;
+
+ kill_ring_loc = slot;
+ }
+
+ /* Notice that the last command was a kill. */
+ echo_area_last_command_was_kill++;
+}
+
+/* **************************************************************** */
+/* */
+/* Echo Area Completion */
+/* */
+/* **************************************************************** */
+
+/* Pointer to an array of REFERENCE to complete over. */
+static REFERENCE **echo_area_completion_items = (REFERENCE **)NULL;
+
+/* Sorted array of REFERENCE * which is the possible completions found in
+ the variable echo_area_completion_items. If there is only one element,
+ it is the only possible completion. */
+static REFERENCE **completions_found = (REFERENCE **)NULL;
+static int completions_found_index = 0;
+static int completions_found_slots = 0;
+
+/* The lowest common denominator found while completing. */
+static REFERENCE *LCD_completion;
+
+/* Internal functions used by the user calls. */
+static void build_completions (), completions_must_be_rebuilt ();
+
+/* Variable which holds the output of completions. */
+static NODE *possible_completions_output_node = (NODE *)NULL;
+
+static char *compwin_name = "*Completions*";
+
+/* Return non-zero if WINDOW is a window used for completions output. */
+static int
+completions_window_p (window)
+ WINDOW *window;
+{
+ int result = 0;
+
+ if (internal_info_node_p (window->node) &&
+ (strcmp (window->node->nodename, compwin_name) == 0))
+ result = 1;
+
+ return (result);
+}
+
+/* Workhorse for completion readers. If FORCE is non-zero, the user cannot
+ exit unless the line read completes, or is empty. */
+char *
+info_read_completing_internal (window, prompt, completions, force)
+ WINDOW *window;
+ char *prompt;
+ REFERENCE **completions;
+ int force;
+{
+ char *line;
+
+ /* If the echo area is already active, remember the current state. */
+ if (echo_area_is_active)
+ push_echo_area ();
+
+ echo_area_must_complete_p = force;
+
+ /* Initialize our local variables. */
+ initialize_input_line (prompt);
+
+ /* Initialize the echo area for the first (but maybe not the last) time. */
+ echo_area_initialize_node ();
+
+ /* Save away the original node of this window, and the window itself,
+ so echo area commands can temporarily use this window. */
+ remember_calling_window (window);
+
+ /* Save away the list of items to complete over. */
+ echo_area_completion_items = completions;
+ completions_must_be_rebuilt ();
+
+ active_window = the_echo_area;
+ echo_area_is_active++;
+
+ /* Read characters in the echo area. */
+ while (1)
+ {
+ info_read_and_dispatch ();
+
+ line = echo_area_after_read ();
+
+ /* Force the completion to take place if the user hasn't accepted
+ a default or aborted, and if FORCE is active. */
+ if (force && line && *line && completions)
+ {
+ register int i;
+
+ build_completions ();
+
+ /* If there is only one completion, then make the line be that
+ completion. */
+ if (completions_found_index == 1)
+ {
+ free (line);
+ line = strdup (completions_found[0]->label);
+ break;
+ }
+
+ /* If one of the completions matches exactly, then that is okay, so
+ return the current line. */
+ for (i = 0; i < completions_found_index; i++)
+ if (strcasecmp (completions_found[i]->label, line) == 0)
+ {
+ free (line);
+ line = strdup (completions_found[i]->label);
+ break;
+ }
+
+ /* If no match, go back and try again. */
+ if (i == completions_found_index)
+ {
+ inform_in_echo_area ("Not complete");
+ continue;
+ }
+ }
+ break;
+ }
+ echo_area_is_active--;
+
+ /* Restore the original active window and show point in it. */
+ active_window = calling_window;
+ restore_calling_window ();
+ display_cursor_at_point (active_window);
+ fflush (stdout);
+
+ echo_area_completion_items = (REFERENCE **)NULL;
+ completions_must_be_rebuilt ();
+
+ /* If there is a previous loop waiting for us, restore it now. */
+ if (echo_area_is_active)
+ pop_echo_area ();
+
+ return (line);
+}
+
+/* Read a line in the echo area with completion over COMPLETIONS. */
+char *
+info_read_completing_in_echo_area (window, prompt, completions)
+ WINDOW *window;
+ char *prompt;
+ REFERENCE **completions;
+{
+ return (info_read_completing_internal (window, prompt, completions, 1));
+}
+
+/* Read a line in the echo area allowing completion over COMPLETIONS, but
+ not requiring it. */
+char *
+info_read_maybe_completing (window, prompt, completions)
+ WINDOW *window;
+ char *prompt;
+ REFERENCE **completions;
+{
+ return (info_read_completing_internal (window, prompt, completions, 0));
+}
+
+DECLARE_INFO_COMMAND (ea_possible_completions, "List possible completions")
+{
+ if (!echo_area_completion_items)
+ {
+ ea_insert (window, count, key);
+ return;
+ }
+
+ build_completions ();
+
+ if (!completions_found_index)
+ {
+ terminal_ring_bell ();
+ inform_in_echo_area ("No completions");
+ }
+ else if ((completions_found_index == 1) && (key != '?'))
+ {
+ inform_in_echo_area ("Sole completion");
+ }
+ else
+ {
+ register int i, l;
+ int limit, count, max_label = 0;
+
+ initialize_message_buffer ();
+ printf_to_message_buffer
+ ("There %s %d ", completions_found_index == 1 ? "is" : "are",
+ completions_found_index);
+ printf_to_message_buffer
+ ("completion%s:\n", completions_found_index == 1 ? "" : "s");
+
+ /* Find the maximum length of a label. */
+ for (i = 0; i < completions_found_index; i++)
+ {
+ int len = strlen (completions_found[i]->label);
+ if (len > max_label)
+ max_label = len;
+ }
+
+ max_label += 4;
+
+ /* Find out how many columns we should print in. */
+ limit = calling_window->width / max_label;
+ if (limit != 1 && (limit * max_label == calling_window->width))
+ limit--;
+
+ /* Avoid a possible floating exception. If max_label > width then
+ the limit will be 0 and a divide-by-zero fault will result. */
+ if (limit == 0)
+ limit = 1;
+
+ /* How many iterations of the printing loop? */
+ count = (completions_found_index + (limit - 1)) / limit;
+
+ /* Watch out for special case. If the number of completions is less
+ than LIMIT, then just do the inner printing loop. */
+ if (completions_found_index < limit)
+ count = 1;
+
+ /* Print the sorted items, up-and-down alphabetically. */
+ for (i = 0; i < count; i++)
+ {
+ register int j;
+
+ for (j = 0, l = i; j < limit; j++)
+ {
+ if (l >= completions_found_index)
+ break;
+ else
+ {
+ char *label;
+ int printed_length, k;
+
+ label = completions_found[l]->label;
+ printed_length = strlen (label);
+ printf_to_message_buffer ("%s", label);
+
+ if (j + 1 < limit)
+ {
+ for (k = 0; k < max_label - printed_length; k++)
+ printf_to_message_buffer (" ");
+ }
+ }
+ l += count;
+ }
+ printf_to_message_buffer ("\n");
+ }
+
+ /* Make a new node to hold onto possible completions. Don't destroy
+ dangling pointers. */
+ {
+ NODE *temp;
+
+ temp = message_buffer_to_node ();
+ add_gcable_pointer (temp->contents);
+ name_internal_node (temp, compwin_name);
+ possible_completions_output_node = temp;
+ }
+
+ /* Find a suitable window for displaying the completions output.
+ First choice is an existing window showing completions output.
+ If there is only one window, and it is large, make another
+ (smaller) window, and use that one. Otherwise, use the caller's
+ window. */
+ {
+ WINDOW *compwin;
+
+ compwin = get_internal_info_window (compwin_name);
+
+ if (!compwin)
+ {
+ /* If we can split the window to display most of the completion
+ items, then do so. */
+ if (calling_window->height > (count * 2))
+ {
+ int start, end, pagetop;
+
+ active_window = calling_window;
+
+ /* Perhaps we can scroll this window on redisplay. */
+ start = calling_window->first_row;
+ pagetop = calling_window->pagetop;
+
+ compwin =
+ window_make_window (possible_completions_output_node);
+ active_window = the_echo_area;
+ window_change_window_height
+ (compwin, -(compwin->height - (count + 2)));
+
+ window_adjust_pagetop (calling_window);
+ remember_calling_window (calling_window);
+
+#if defined (SPLIT_BEFORE_ACTIVE)
+ /* If the pagetop hasn't changed, scrolling the calling
+ window is a reasonable thing to do. */
+ if (pagetop == calling_window->pagetop)
+ {
+ end = start + calling_window->height;
+ display_scroll_display
+ (start, end, calling_window->prev->height + 1);
+ }
+#else /* !SPLIT_BEFORE_ACTIVE */
+ /* If the pagetop has changed, set the new pagetop here. */
+ if (pagetop != calling_window->pagetop)
+ {
+ int newtop = calling_window->pagetop;
+ calling_window->pagetop = pagetop;
+ set_window_pagetop (calling_window, newtop);
+ }
+#endif /* !SPLIT_BEFORE_ACTIVE */
+
+ echo_area_completions_window = compwin;
+ remember_window_and_node (compwin, compwin->node);
+ }
+ else
+ compwin = calling_window;
+ }
+
+ if (compwin->node != possible_completions_output_node)
+ {
+ window_set_node_of_window
+ (compwin, possible_completions_output_node);
+ remember_window_and_node (compwin, compwin->node);
+ }
+
+ display_update_display (windows);
+ }
+ }
+}
+
+DECLARE_INFO_COMMAND (ea_complete, "Insert completion")
+{
+ if (!echo_area_completion_items)
+ {
+ ea_insert (window, count, key);
+ return;
+ }
+
+ /* If KEY is SPC, and we are not forcing completion to take place, simply
+ insert the key. */
+ if (!echo_area_must_complete_p && key == SPC)
+ {
+ ea_insert (window, count, key);
+ return;
+ }
+
+ if (ea_last_executed_command == ea_complete)
+ {
+ /* If the keypress is a SPC character, and we have already tried
+ completing once, and there are several completions, then check
+ the batch of completions to see if any continue with a space.
+ If there are some, insert the space character and continue. */
+ if (key == SPC && completions_found_index > 1)
+ {
+ register int i, offset;
+
+ offset = input_line_end - input_line_beg;
+
+ for (i = 0; i < completions_found_index; i++)
+ if (completions_found[i]->label[offset] == ' ')
+ break;
+
+ if (completions_found[i])
+ ea_insert (window, 1, ' ');
+ else
+ {
+ ea_possible_completions (window, count, key);
+ return;
+ }
+ }
+ else
+ {
+ ea_possible_completions (window, count, key);
+ return;
+ }
+ }
+
+ input_line_point = input_line_end;
+ build_completions ();
+
+ if (!completions_found_index)
+ terminal_ring_bell ();
+ else if (LCD_completion->label[0] == '\0')
+ ea_possible_completions (window, count, key);
+ else
+ {
+ register int i;
+ input_line_point = input_line_end = input_line_beg;
+ for (i = 0; LCD_completion->label[i]; i++)
+ ea_insert (window, 1, LCD_completion->label[i]);
+ }
+}
+
+/* Utility REFERENCE used to store possible LCD. */
+static REFERENCE LCD_reference = { (char *)NULL, (char *)NULL, (char *)NULL };
+
+static void remove_completion_duplicates ();
+
+/* Variables which remember the state of the most recent call
+ to build_completions (). */
+static char *last_completion_request = (char *)NULL;
+static REFERENCE **last_completion_items = (REFERENCE **)NULL;
+
+/* How to tell the completion builder to reset internal state. */
+static void
+completions_must_be_rebuilt ()
+{
+ maybe_free (last_completion_request);
+ last_completion_request = (char *)NULL;
+ last_completion_items = (REFERENCE **)NULL;
+}
+
+/* Build a list of possible completions from echo_area_completion_items,
+ and the contents of input_line. */
+static void
+build_completions ()
+{
+ register int i, len;
+ register REFERENCE *entry;
+ char *request;
+ int informed_of_lengthy_job = 0;
+
+ /* If there are no items to complete over, exit immediately. */
+ if (!echo_area_completion_items)
+ {
+ completions_found_index = 0;
+ LCD_completion = (REFERENCE *)NULL;
+ return;
+ }
+
+ /* Check to see if this call to build completions is the same as the last
+ call to build completions. */
+ len = input_line_end - input_line_beg;
+ request = (char *)xmalloc (1 + len);
+ strncpy (request, &input_line[input_line_beg], len);
+ request[len] = '\0';
+
+ if (last_completion_request && last_completion_items &&
+ last_completion_items == echo_area_completion_items &&
+ (strcmp (last_completion_request, request) == 0))
+ {
+ free (request);
+ return;
+ }
+
+ maybe_free (last_completion_request);
+ last_completion_request = request;
+ last_completion_items = echo_area_completion_items;
+
+ /* Always start at the beginning of the list. */
+ completions_found_index = 0;
+ LCD_completion = (REFERENCE *)NULL;
+
+ for (i = 0; entry = echo_area_completion_items[i]; i++)
+ {
+ if (strncasecmp (request, entry->label, len) == 0)
+ add_pointer_to_array (entry, completions_found_index,
+ completions_found, completions_found_slots,
+ 20, REFERENCE *);
+
+ if (!informed_of_lengthy_job && completions_found_index > 100)
+ {
+ informed_of_lengthy_job = 1;
+ window_message_in_echo_area ("Building completions...");
+ }
+ }
+
+ if (!completions_found_index)
+ return;
+
+ /* Sort and prune duplicate entries from the completions array. */
+ remove_completion_duplicates ();
+
+ /* If there is only one completion, just return that. */
+ if (completions_found_index == 1)
+ {
+ LCD_completion = completions_found[0];
+ return;
+ }
+
+ /* Find the least common denominator. */
+ {
+ long shortest = 100000;
+
+ for (i = 1; i < completions_found_index; i++)
+ {
+ register int j;
+ int c1, c2;
+
+ for (j = 0;
+ (c1 = info_tolower (completions_found[i - 1]->label[j])) &&
+ (c2 = info_tolower (completions_found[i]->label[j]));
+ j++)
+ if (c1 != c2)
+ break;
+
+ if (shortest > j)
+ shortest = j;
+ }
+
+ maybe_free (LCD_reference.label);
+ LCD_reference.label = (char *)xmalloc (1 + shortest);
+ strncpy (LCD_reference.label, completions_found[0]->label, shortest);
+ LCD_reference.label[shortest] = '\0';
+ LCD_completion = &LCD_reference;
+ }
+
+ if (informed_of_lengthy_job)
+ echo_area_initialize_node ();
+}
+
+/* Function called by qsort. */
+static int
+compare_references (entry1, entry2)
+ REFERENCE **entry1, **entry2;
+{
+ return (strcasecmp ((*entry1)->label, (*entry2)->label));
+}
+
+/* Prune duplicate entries from COMPLETIONS_FOUND. */
+static void
+remove_completion_duplicates ()
+{
+ register int i, j;
+ REFERENCE **temp;
+ int newlen;
+
+ if (!completions_found_index)
+ return;
+
+ /* Sort the items. */
+ qsort (completions_found, completions_found_index, sizeof (REFERENCE *),
+ compare_references);
+
+ for (i = 0, newlen = 1; i < completions_found_index - 1; i++)
+ {
+ if (strcmp (completions_found[i]->label,
+ completions_found[i + 1]->label) == 0)
+ completions_found[i] = (REFERENCE *)NULL;
+ else
+ newlen++;
+ }
+
+ /* We have marked all the dead slots. It is faster to copy the live slots
+ twice than to prune the dead slots one by one. */
+ temp = (REFERENCE **)xmalloc ((1 + newlen) * sizeof (REFERENCE *));
+ for (i = 0, j = 0; i < completions_found_index; i++)
+ if (completions_found[i])
+ temp[j++] = completions_found[i];
+
+ for (i = 0; i < newlen; i++)
+ completions_found[i] = temp[i];
+
+ completions_found[i] = (REFERENCE *)NULL;
+ completions_found_index = newlen;
+ free (temp);
+}
+
+/* Scroll the "other" window. If there is a window showing completions, scroll
+ that one, otherwise scroll the window which was active on entering the read
+ function. */
+DECLARE_INFO_COMMAND (ea_scroll_completions_window, "Scroll the completions window")
+{
+ WINDOW *compwin;
+ int old_pagetop;
+
+ compwin = get_internal_info_window (compwin_name);
+
+ if (!compwin)
+ compwin = calling_window;
+
+ old_pagetop = compwin->pagetop;
+
+ /* Let info_scroll_forward () do the work, and print any messages that
+ need to be displayed. */
+ info_scroll_forward (compwin, count, key);
+}
+
+/* Function which gets called when an Info window is deleted while the
+ echo area is active. WINDOW is the window which has just been deleted. */
+void
+echo_area_inform_of_deleted_window (window)
+ WINDOW *window;
+{
+ /* If this is the calling_window, forget what we remembered about it. */
+ if (window == calling_window)
+ {
+ if (active_window != the_echo_area)
+ remember_calling_window (active_window);
+ else
+ remember_calling_window (windows);
+ }
+
+ /* If this window was the echo_area_completions_window, then notice that
+ the window has been deleted. */
+ if (window == echo_area_completions_window)
+ echo_area_completions_window = (WINDOW *)NULL;
+}
+
+/* **************************************************************** */
+/* */
+/* Pushing and Popping the Echo Area */
+/* */
+/* **************************************************************** */
+
+/* Push and Pop the echo area. */
+typedef struct {
+ char *line;
+ char *prompt;
+ REFERENCE **comp_items;
+ int point, beg, end;
+ int must_complete;
+ NODE node;
+ WINDOW *compwin;
+} PUSHED_EA;
+
+static PUSHED_EA **pushed_echo_areas = (PUSHED_EA **)NULL;
+static int pushed_echo_areas_index = 0;
+static int pushed_echo_areas_slots = 0;
+
+/* Pushing the echo_area has a side effect of zeroing the completion_items. */
+static void
+push_echo_area ()
+{
+ PUSHED_EA *pushed;
+
+ pushed = (PUSHED_EA *)xmalloc (sizeof (PUSHED_EA));
+ pushed->line = strdup (input_line);
+ pushed->prompt = input_line_prompt;
+ pushed->point = input_line_point;
+ pushed->beg = input_line_beg;
+ pushed->end = input_line_end;
+ pushed->node = input_line_node;
+ pushed->comp_items = echo_area_completion_items;
+ pushed->must_complete = echo_area_must_complete_p;
+ pushed->compwin = echo_area_completions_window;
+
+ add_pointer_to_array (pushed, pushed_echo_areas_index, pushed_echo_areas,
+ pushed_echo_areas_slots, 4, PUSHED_EA *);
+
+ echo_area_completion_items = (REFERENCE **)NULL;
+}
+
+static void
+pop_echo_area ()
+{
+ PUSHED_EA *popped;
+
+ popped = pushed_echo_areas[--pushed_echo_areas_index];
+
+ strcpy (input_line, popped->line);
+ free (popped->line);
+ input_line_prompt = popped->prompt;
+ input_line_point = popped->point;
+ input_line_beg = popped->beg;
+ input_line_end = popped->end;
+ input_line_node = popped->node;
+ echo_area_completion_items = popped->comp_items;
+ echo_area_must_complete_p = popped->must_complete;
+ echo_area_completions_window = popped->compwin;
+ completions_must_be_rebuilt ();
+
+ /* If the completion window no longer exists, forget about it. */
+ if (echo_area_completions_window)
+ {
+ register WINDOW *win;
+
+ for (win = windows; win; win = win->next)
+ if (echo_area_completions_window == win)
+ break;
+
+ /* If the window wasn't found, then it has already been deleted. */
+ if (!win)
+ echo_area_completions_window = (WINDOW *)NULL;
+ }
+
+ free (popped);
+}
+
+static int
+echo_area_stack_depth ()
+{
+ return (pushed_echo_areas_index);
+}
+
+/* Returns non-zero if any of the prior stacked calls to read in the echo
+ area produced a completions window. */
+static int
+echo_area_stack_contains_completions_p ()
+{
+ register int i;
+
+ for (i = 0; i < pushed_echo_areas_index; i++)
+ if (pushed_echo_areas[i]->compwin)
+ return (1);
+
+ return (0);
+}
+
+/* **************************************************************** */
+/* */
+/* Error Messages While Reading in Echo Area */
+/* */
+/* **************************************************************** */
+
+#if defined (HAVE_SYS_TIME_H)
+# include <sys/time.h>
+# define HAVE_STRUCT_TIMEVAL
+#endif /* HAVE_SYS_TIME_H */
+
+static void
+pause_or_input ()
+{
+#if defined (FD_SET)
+ struct timeval timer;
+ fd_set readfds;
+ int ready;
+
+ FD_ZERO (&readfds);
+ FD_SET (fileno (stdin), &readfds);
+ timer.tv_sec = 2;
+ timer.tv_usec = 750;
+ ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+#endif /* FD_SET */
+}
+
+/* Print MESSAGE right after the end of the current line, and wait
+ for input or 2.75 seconds, whichever comes first. Then flush the
+ informational message that was printed. */
+void
+inform_in_echo_area (message)
+ char *message;
+{
+ register int i;
+ char *text;
+
+ text = strdup (message);
+ for (i = 0; text[i] && text[i] != '\n'; i++);
+ text[i] = '\0';
+
+ echo_area_initialize_node ();
+ sprintf (&input_line[input_line_end], "%s[%s]\n",
+ echo_area_is_active ? " ": "", text);
+ free (text);
+ the_echo_area->point = input_line_point;
+ display_update_one_window (the_echo_area);
+ display_cursor_at_point (active_window);
+ fflush (stdout);
+ pause_or_input ();
+ echo_area_initialize_node ();
+}
diff --git a/contrib/texinfo/info/echo_area.h b/contrib/texinfo/info/echo_area.h
new file mode 100644
index 000000000000..09c2bc7e22eb
--- /dev/null
+++ b/contrib/texinfo/info/echo_area.h
@@ -0,0 +1,63 @@
+/* echo_area.h -- Functions used in reading information from the echo area. */
+
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by Brian Fox (bfox@ai.mit.edu). */
+
+#if !defined (_ECHO_AREA_H_)
+#define _ECHO_AREA_H_
+
+#define EA_MAX_INPUT 256
+
+extern int echo_area_is_active, info_aborted_echo_area;
+
+/* Non-zero means that the last command executed while reading input
+ killed some text. */
+extern int echo_area_last_command_was_kill;
+
+extern void inform_in_echo_area (), echo_area_inform_of_deleted_window ();
+extern void echo_area_prep_read ();
+extern VFunction *ea_last_executed_command;
+
+/* Read a line of text in the echo area. Return a malloc ()'ed string,
+ or NULL if the user aborted out of this read. WINDOW is the currently
+ active window, so that we can restore it when we need to. PROMPT, if
+ non-null, is a prompt to print before reading the line. */
+extern char *info_read_in_echo_area ();
+
+/* Read a line in the echo area with completion over COMPLETIONS.
+ Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */
+char *info_read_completing_in_echo_area ();
+
+/* Read a line in the echo area allowing completion over COMPLETIONS, but
+ not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS,
+ a REFERENCE **. */
+extern char *info_read_maybe_completing ();
+
+extern void ea_insert (), ea_quoted_insert ();
+extern void ea_beg_of_line (), ea_backward (), ea_delete (), ea_end_of_line ();
+extern void ea_forward (), ea_abort (), ea_rubout (), ea_complete ();
+extern void ea_newline (), ea_kill_line (), ea_transpose_chars ();
+extern void ea_yank (), ea_tab_insert (), ea_possible_completions ();
+extern void ea_backward_word (), ea_kill_word (), ea_forward_word ();
+extern void ea_yank_pop (), ea_backward_kill_word ();
+extern void ea_scroll_completions_window ();
+
+#endif /* _ECHO_AREA_H_ */
diff --git a/contrib/texinfo/info/filesys.c b/contrib/texinfo/info/filesys.c
index eb93fdf91276..e684bf81f7b1 100644
--- a/contrib/texinfo/info/filesys.c
+++ b/contrib/texinfo/info/filesys.c
@@ -1,7 +1,9 @@
-/* filesys.c -- File system specific functions for hacking this system.
- $Id: filesys.c,v 1.6 1998/02/21 22:52:46 karl Exp $
+/* filesys.c -- File system specific functions for hacking this system. */
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,17 +21,49 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
-
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+#include <sys/errno.h>
+#include "general.h"
#include "tilde.h"
#include "filesys.h"
+#if !defined (O_RDONLY)
+#if defined (HAVE_SYS_FCNTL_H)
+#include <sys/fcntl.h>
+#else /* !HAVE_SYS_FCNTL_H */
+#include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+#endif /* !O_RDONLY */
+
+#if !defined (errno)
+extern int errno;
+#endif /* !errno */
+
+/* Found in info-utils.c. */
+extern char *filename_non_directory ();
+
+#if !defined (BUILDING_LIBRARY)
+/* Found in session.c */
+extern int info_windows_initialized_p;
+
+/* Found in window.c. */
+extern void message_in_echo_area (), unmessage_in_echo_area ();
+#endif /* !BUILDING_LIBRARY */
+
/* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename ();
static void remember_info_filename (), maybe_initialize_infopath ();
-typedef struct
-{
+#if !defined (NULL)
+# define NULL 0x0
+#endif /* !NULL */
+
+typedef struct {
char *suffix;
char *decompressor;
} COMPRESSION_ALIST;
@@ -38,7 +72,6 @@ static char *info_suffixes[] = {
"",
".info",
"-info",
- "/index",
(char *)NULL
};
@@ -81,58 +114,58 @@ info_find_fullpath (partial)
expansion = lookup_info_filename (partial);
if (expansion)
- return (expansion);
+ return (expansion);
/* If we have the full path to this file, we still may have to add
- various extensions to it. I guess we have to stat this file
- after all. */
+ various extensions to it. I guess we have to stat this file
+ after all. */
if (initial_character == '/')
- temp = info_file_in_path (partial + 1, "/");
+ temp = info_file_in_path (partial + 1, "/");
else if (initial_character == '~')
- {
- expansion = tilde_expand_word (partial);
- if (*expansion == '/')
- {
- temp = info_file_in_path (expansion + 1, "/");
- free (expansion);
- }
- else
- temp = expansion;
- }
+ {
+ expansion = tilde_expand_word (partial);
+ if (*expansion == '/')
+ {
+ temp = info_file_in_path (expansion + 1, "/");
+ free (expansion);
+ }
+ else
+ temp = expansion;
+ }
else if (initial_character == '.' &&
- (partial[1] == '/' || (partial[1] == '.' && partial[2] == '/')))
- {
- if (local_temp_filename_size < 1024)
- local_temp_filename = (char *)xrealloc
- (local_temp_filename, (local_temp_filename_size = 1024));
+ (partial[1] == '/' || (partial[1] == '.' && partial[2] == '/')))
+ {
+ if (local_temp_filename_size < 1024)
+ local_temp_filename = (char *)xrealloc
+ (local_temp_filename, (local_temp_filename_size = 1024));
#if defined (HAVE_GETCWD)
- if (!getcwd (local_temp_filename, local_temp_filename_size))
+ if (!getcwd (local_temp_filename, local_temp_filename_size))
#else /* !HAVE_GETCWD */
- if (!getwd (local_temp_filename))
+ if (!getwd (local_temp_filename))
#endif /* !HAVE_GETCWD */
- {
- filesys_error_number = errno;
- return (partial);
- }
-
- strcat (local_temp_filename, "/");
- strcat (local_temp_filename, partial);
- return (local_temp_filename);
- }
+ {
+ filesys_error_number = errno;
+ return (partial);
+ }
+
+ strcat (local_temp_filename, "/");
+ strcat (local_temp_filename, partial);
+ return (local_temp_filename);
+ }
else
- temp = info_file_in_path (partial, infopath);
+ temp = info_file_in_path (partial, infopath);
if (temp)
- {
- remember_info_filename (partial, temp);
- if (strlen (temp) > local_temp_filename_size)
- local_temp_filename = (char *) xrealloc
- (local_temp_filename,
- (local_temp_filename_size = (50 + strlen (temp))));
- strcpy (local_temp_filename, temp);
- free (temp);
- return (local_temp_filename);
- }
+ {
+ remember_info_filename (partial, temp);
+ if (strlen (temp) > local_temp_filename_size)
+ local_temp_filename = (char *) xrealloc
+ (local_temp_filename,
+ (local_temp_filename_size = (50 + strlen (temp))));
+ strcpy (local_temp_filename, temp);
+ free (temp);
+ return (local_temp_filename);
+ }
}
return (partial);
}
@@ -150,25 +183,25 @@ info_file_in_path (filename, path)
dirname_index = 0;
- while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
+ while (temp_dirname = extract_colon_unit (path, &dirname_index))
{
register int i, pre_suffix_length;
char *temp;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
- {
- char *expanded_dirname;
+ {
+ char *expanded_dirname;
- expanded_dirname = tilde_expand_word (temp_dirname);
- free (temp_dirname);
- temp_dirname = expanded_dirname;
- }
+ expanded_dirname = tilde_expand_word (temp_dirname);
+ free (temp_dirname);
+ temp_dirname = expanded_dirname;
+ }
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
if (temp[(strlen (temp)) - 1] != '/')
- strcat (temp, "/");
+ strcat (temp, "/");
strcat (temp, filename);
pre_suffix_length = strlen (temp);
@@ -176,54 +209,54 @@ info_file_in_path (filename, path)
free (temp_dirname);
for (i = 0; info_suffixes[i]; i++)
- {
- strcpy (temp + pre_suffix_length, info_suffixes[i]);
-
- statable = (stat (temp, &finfo) == 0);
-
- /* If we have found a regular file, then use that. Else, if we
- have found a directory, look in that directory for this file. */
- if (statable)
- {
- if (S_ISREG (finfo.st_mode))
- {
- return (temp);
- }
- else if (S_ISDIR (finfo.st_mode))
- {
- char *newpath, *filename_only, *newtemp;
-
- newpath = xstrdup (temp);
- filename_only = filename_non_directory (filename);
- newtemp = info_file_in_path (filename_only, newpath);
-
- free (newpath);
- if (newtemp)
- {
- free (temp);
- return (newtemp);
- }
- }
- }
- else
- {
- /* Add various compression suffixes to the name to see if
- the file is present in compressed format. */
- register int j, pre_compress_suffix_length;
-
- pre_compress_suffix_length = strlen (temp);
-
- for (j = 0; compress_suffixes[j].suffix; j++)
- {
- strcpy (temp + pre_compress_suffix_length,
- compress_suffixes[j].suffix);
-
- statable = (stat (temp, &finfo) == 0);
- if (statable && (S_ISREG (finfo.st_mode)))
- return (temp);
- }
- }
- }
+ {
+ strcpy (temp + pre_suffix_length, info_suffixes[i]);
+
+ statable = (stat (temp, &finfo) == 0);
+
+ /* If we have found a regular file, then use that. Else, if we
+ have found a directory, look in that directory for this file. */
+ if (statable)
+ {
+ if (S_ISREG (finfo.st_mode))
+ {
+ return (temp);
+ }
+ else if (S_ISDIR (finfo.st_mode))
+ {
+ char *newpath, *filename_only, *newtemp;
+
+ newpath = strdup (temp);
+ filename_only = filename_non_directory (filename);
+ newtemp = info_file_in_path (filename_only, newpath);
+
+ free (newpath);
+ if (newtemp)
+ {
+ free (temp);
+ return (newtemp);
+ }
+ }
+ }
+ else
+ {
+ /* Add various compression suffixes to the name to see if
+ the file is present in compressed format. */
+ register int j, pre_compress_suffix_length;
+
+ pre_compress_suffix_length = strlen (temp);
+
+ for (j = 0; compress_suffixes[j].suffix; j++)
+ {
+ strcpy (temp + pre_compress_suffix_length,
+ compress_suffixes[j].suffix);
+
+ statable = (stat (temp, &finfo) == 0);
+ if (statable && (S_ISREG (finfo.st_mode)))
+ return (temp);
+ }
+ }
+ }
free (temp);
}
return ((char *)NULL);
@@ -257,7 +290,7 @@ extract_colon_unit (string, idx)
strncpy (value, &string[start], (i - start));
value[i - start] = '\0';
if (string[i])
- ++i;
+ ++i;
*idx = i;
return (value);
}
@@ -284,10 +317,10 @@ lookup_info_filename (filename)
{
register int i;
for (i = 0; names_and_files[i]; i++)
- {
- if (strcmp (names_and_files[i]->filename, filename) == 0)
- return (names_and_files[i]->expansion);
- }
+ {
+ if (strcmp (names_and_files[i]->filename, filename) == 0)
+ return (names_and_files[i]->expansion);
+ }
}
return (char *)NULL;;
}
@@ -307,12 +340,12 @@ remember_info_filename (filename, expansion)
alloc_size = names_and_files_slots * sizeof (FILENAME_LIST *);
names_and_files =
- (FILENAME_LIST **) xrealloc (names_and_files, alloc_size);
+ (FILENAME_LIST **) xrealloc (names_and_files, alloc_size);
}
new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST));
- new->filename = xstrdup (filename);
- new->expansion = expansion ? xstrdup (expansion) : (char *)NULL;
+ new->filename = strdup (filename);
+ new->expansion = expansion ? strdup (expansion) : (char *)NULL;
names_and_files[names_and_files_index++] = new;
names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL;
@@ -324,7 +357,7 @@ maybe_initialize_infopath ()
if (!infopath_size)
{
infopath = (char *)
- xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH)));
+ xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH)));
strcpy (infopath, DEFAULT_INFOPATH);
}
@@ -359,7 +392,7 @@ info_add_path (path, where)
}
else if (where == INFOPATH_PREPEND)
{
- char *temp = xstrdup (infopath);
+ char *temp = strdup (infopath);
strcpy (infopath, path);
strcat (infopath, ":");
strcat (infopath, temp);
@@ -403,21 +436,21 @@ filesys_read_info_file (pathname, filesize, finfo)
/* If the file couldn't be opened, give up. */
if (descriptor < 0)
- {
- filesys_error_number = errno;
- return ((char *)NULL);
- }
+ {
+ filesys_error_number = errno;
+ return ((char *)NULL);
+ }
/* Try to read the contents of this file. */
st_size = (long) finfo->st_size;
contents = (char *)xmalloc (1 + st_size);
if ((read (descriptor, contents, st_size)) != st_size)
- {
- filesys_error_number = errno;
- close (descriptor);
- free (contents);
- return ((char *)NULL);
- }
+ {
+ filesys_error_number = errno;
+ close (descriptor);
+ free (contents);
+ return ((char *)NULL);
+ }
close (descriptor);
@@ -477,20 +510,20 @@ filesys_read_compressed (pathname, filesize, finfo)
chunk = (char *)xmalloc (FILESYS_PIPE_BUFFER_SIZE);
while (1)
- {
- int bytes_read;
+ {
+ int bytes_read;
- bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream);
+ bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream);
- if (bytes_read + offset >= size)
- contents = (char *)xrealloc
- (contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE));
+ if (bytes_read + offset >= size)
+ contents = (char *)xrealloc
+ (contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE));
- memcpy (contents + offset, chunk, bytes_read);
- offset += bytes_read;
- if (bytes_read != FILESYS_PIPE_BUFFER_SIZE)
- break;
- }
+ memcpy (contents + offset, chunk, bytes_read);
+ offset += bytes_read;
+ if (bytes_read != FILESYS_PIPE_BUFFER_SIZE)
+ break;
+ }
free (chunk);
pclose (stream);
@@ -539,8 +572,8 @@ filesys_decompressor_for_file (filename)
for (i = strlen (filename) - 1; i > 0; i--)
if (filename[i] == '.')
{
- extension = filename + i;
- break;
+ extension = filename + i;
+ break;
}
if (!extension)
diff --git a/contrib/texinfo/info/filesys.h b/contrib/texinfo/info/filesys.h
index 440eb9b281b5..130a52a6357b 100644
--- a/contrib/texinfo/info/filesys.h
+++ b/contrib/texinfo/info/filesys.h
@@ -1,10 +1,9 @@
-/* filesys.h -- External declarations of functions and vars in filesys.c.
- $Id: filesys.h,v 1.3 1997/07/15 18:39:08 karl Exp $
+/* filesys.h -- External declarations of functions and vars in filesys.c. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_FILESYS_H
-#define INFO_FILESYS_H
+#if !defined (_FILESYS_H_)
+#define _FILESYS_H_
/* The path on which we look for info files. You can initialize this
from the environment variable INFOPATH if there is one, or you can
@@ -71,7 +70,7 @@ extern char *extract_colon_unit ();
/* The default value of INFOPATH. */
#if !defined (DEFAULT_INFOPATH)
-# define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
+! # define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
#endif /* !DEFAULT_INFOPATH */
#if !defined (S_ISREG) && defined (S_IFREG)
@@ -82,4 +81,4 @@ extern char *extract_colon_unit ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif /* !S_ISDIR && S_IFDIR */
-#endif /* not INFO_FILESYS_H */
+#endif /* !_FILESYS_H_ */
diff --git a/contrib/texinfo/info/footnotes.c b/contrib/texinfo/info/footnotes.c
index b6467431b64e..35a0f352de88 100644
--- a/contrib/texinfo/info/footnotes.c
+++ b/contrib/texinfo/info/footnotes.c
@@ -1,7 +1,9 @@
-/* footnotes.c -- Some functions for manipulating footnotes.
- $Id: footnotes.c,v 1.4 1997/07/24 21:23:33 karl Exp $
+/* footnotes.c -- Some functions for manipulating footnotes. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,7 +40,7 @@ find_footnotes_window ()
/* Try to find an existing window first. */
for (win = windows; win; win = win->next)
if (internal_info_node_p (win->node) &&
- (strcmp (win->node->nodename, footnote_nodename) == 0))
+ (strcmp (win->node->nodename, footnote_nodename) == 0))
break;
return (win);
@@ -70,37 +72,37 @@ make_footnotes_node (node)
refs = info_xrefs_of_node (node);
if (refs)
- {
- register int i;
- char *refname;
+ {
+ register int i;
+ char *refname;
- refname = (char *)xmalloc
- (1 + strlen ("-Footnotes") + strlen (node->nodename));
+ refname = (char *)xmalloc
+ (1 + strlen ("-Footnotes") + strlen (node->nodename));
- strcpy (refname, node->nodename);
- strcat (refname, "-Footnotes");
+ strcpy (refname, node->nodename);
+ strcat (refname, "-Footnotes");
- for (i = 0; refs[i]; i++)
- if ((refs[i]->nodename != (char *)NULL) &&
- (strcmp (refs[i]->nodename, refname) == 0))
- {
- char *filename;
+ for (i = 0; refs[i]; i++)
+ if ((refs[i]->nodename != (char *)NULL) &&
+ (strcmp (refs[i]->nodename, refname) == 0))
+ {
+ char *filename;
- filename = node->parent;
- if (!filename)
- filename = node->filename;
+ filename = node->parent;
+ if (!filename)
+ filename = node->filename;
- fn_node = info_get_node (filename, refname);
+ fn_node = info_get_node (filename, refname);
- if (fn_node)
- fn_start = 0;
+ if (fn_node)
+ fn_start = 0;
- break;
- }
+ break;
+ }
- free (refname);
- info_free_references (refs);
- }
+ free (refname);
+ info_free_references (refs);
+ }
}
/* If we never found the start of a footnotes area, quit now. */
@@ -124,7 +126,7 @@ make_footnotes_node (node)
This effectively skips either "---- footno...", or "File: foo...". */
while (text_start < fn_node->nodelen)
if (fn_node->contents[text_start++] == '\n')
- break;
+ break;
result->nodelen = strlen (header) + fn_node->nodelen - text_start;
@@ -132,7 +134,7 @@ make_footnotes_node (node)
result->contents = (char *)xmalloc (1 + result->nodelen);
sprintf (result->contents, "%s", header);
memcpy (result->contents + strlen (header),
- fn_node->contents + text_start, fn_node->nodelen - text_start);
+ fn_node->contents + text_start, fn_node->nodelen - text_start);
name_internal_node (result, footnote_nodename);
free (header);
@@ -174,7 +176,7 @@ info_get_or_remove_footnotes (window)
if (fn_win && !new_footnotes)
{
if (windows->next)
- info_delete_window_internal (fn_win);
+ info_delete_window_internal (fn_win);
}
/* If there are footnotes for this window's node, but no window around
@@ -185,27 +187,27 @@ info_get_or_remove_footnotes (window)
WINDOW *last, *win;
/* Always make this window be the last one appearing in the list. Find
- the last window in the chain. */
+ the last window in the chain. */
for (win = windows, last = windows; win; last = win, win = win->next);
/* Try to split this window, and make the split window the one to
- contain the footnotes. */
+ contain the footnotes. */
old_active = active_window;
active_window = last;
fn_win = window_make_window (new_footnotes);
active_window = old_active;
if (!fn_win)
- {
- free (new_footnotes->contents);
- free (new_footnotes);
-
- /* If we are hacking automatic footnotes, and there are footnotes
- but we couldn't display them, print a message to that effect. */
- if (auto_footnotes_p)
- inform_in_echo_area (_("Footnotes could not be displayed"));
- return (FN_UNABLE);
- }
+ {
+ free (new_footnotes->contents);
+ free (new_footnotes);
+
+ /* If we are hacking automatic footnotes, and there are footnotes
+ but we couldn't display them, print a message to that effect. */
+ if (auto_footnotes_p)
+ inform_in_echo_area ("Footnotes could not be displayed");
+ return (FN_UNABLE);
+ }
}
/* If there are footnotes, and there is a window to display them,
@@ -215,7 +217,7 @@ info_get_or_remove_footnotes (window)
window_set_node_of_window (fn_win, new_footnotes);
window_change_window_height
- (fn_win, fn_win->line_count - fn_win->height);
+ (fn_win, fn_win->line_count - fn_win->height);
remember_window_and_node (fn_win, new_footnotes);
add_gcable_pointer (new_footnotes->contents);
@@ -229,17 +231,19 @@ info_get_or_remove_footnotes (window)
/* Show the footnotes associated with this node in another window. */
DECLARE_INFO_COMMAND (info_show_footnotes,
- _("Show the footnotes associated with this node in another window"))
+ "Show the footnotes associated with this node in another window")
{
+ int result;
+
/* A negative argument means just make the window go away. */
if (count < 0)
{
WINDOW *fn_win = find_footnotes_window ();
/* If there is an old footnotes window, and it isn't the only window
- on the screen, delete it. */
+ on the screen, delete it. */
if (fn_win && windows->next)
- info_delete_window_internal (fn_win);
+ info_delete_window_internal (fn_win);
}
else
{
@@ -248,14 +252,14 @@ DECLARE_INFO_COMMAND (info_show_footnotes,
result = info_get_or_remove_footnotes (window);
switch (result)
- {
- case FN_UNFOUND:
- info_error (NO_FOOT_NODE);
- break;
-
- case FN_UNABLE:
- info_error (WIN_TOO_SMALL);
- break;
- }
+ {
+ case FN_UNFOUND:
+ info_error (NO_FOOT_NODE);
+ break;
+
+ case FN_UNABLE:
+ info_error (WIN_TOO_SMALL);
+ break;
+ }
}
}
diff --git a/contrib/texinfo/info/footnotes.h b/contrib/texinfo/info/footnotes.h
index 3406bcb67be1..89b1b3578e6d 100644
--- a/contrib/texinfo/info/footnotes.h
+++ b/contrib/texinfo/info/footnotes.h
@@ -1,10 +1,9 @@
-/* footnotes.h -- Some functions for manipulating footnotes.
- $Id: footnotes.h,v 1.3 1997/07/15 18:40:27 karl Exp $
+/* footnotes.h -- Some functions for manipulating footnotes. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,11 +21,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_FOOTNOTES_H
-#define INFO_FOOTNOTES_H
+#if !defined (_FOOTNOTES_H_)
+#define _FOOTNOTES_H_
/* Magic string which indicates following text is footnotes. */
-#define FOOTNOTE_LABEL _("---------- Footnotes ----------")
+#define FOOTNOTE_LABEL "---------- Footnotes ----------"
#define FN_FOUND 0
#define FN_UNFOUND 1
@@ -43,4 +42,5 @@ extern int info_get_or_remove_footnotes ();
/* Non-zero means attempt to show footnotes when displaying a new window. */
extern int auto_footnotes_p;
-#endif /* not INFO_FOOTNOTES_H */
+#endif /* !_FOOTNOTES_H_ */
+
diff --git a/contrib/texinfo/info/funs.h b/contrib/texinfo/info/funs.h
index 32d80d51c037..b91880c48086 100644
--- a/contrib/texinfo/info/funs.h
+++ b/contrib/texinfo/info/funs.h
@@ -29,6 +29,7 @@ extern void info_prev_node ();
extern void info_up_node ();
extern void info_last_node ();
extern void info_first_node ();
+extern void info_history_node ();
extern void info_last_menu_item ();
extern void info_menu_digit ();
extern void info_menu_item ();
@@ -39,7 +40,6 @@ extern void info_goto_node ();
extern void info_man ();
extern void info_top_node ();
extern void info_dir_node ();
-extern void info_history_node ();
extern void info_kill_node ();
extern void info_view_file ();
extern void info_print_node ();
@@ -58,7 +58,7 @@ extern void info_add_digit_to_numeric_arg ();
extern void info_universal_argument ();
extern void info_numeric_arg_digit_loop ();
-/* Functions declared in "./echo-area.c". */
+/* Functions declared in "./echo_area.c". */
extern void ea_forward ();
extern void ea_backward ();
extern void ea_beg_of_line ();
diff --git a/contrib/texinfo/info/gc.c b/contrib/texinfo/info/gc.c
index 1c868ba3284f..3b9b0907f511 100644
--- a/contrib/texinfo/info/gc.c
+++ b/contrib/texinfo/info/gc.c
@@ -56,7 +56,7 @@ gc_pointers ()
if (!info_windows || !gcable_pointers_index)
return;
- for (i = 0; (iw = info_windows[i]); i++)
+ for (i = 0; iw = info_windows[i]; i++)
{
for (j = 0; j < iw->nodes_index; j++)
{
diff --git a/contrib/texinfo/info/gc.h b/contrib/texinfo/info/gc.h
index b4d993af4f8c..876062ad2496 100644
--- a/contrib/texinfo/info/gc.h
+++ b/contrib/texinfo/info/gc.h
@@ -1,10 +1,9 @@
-/* gc.h -- Functions for garbage collecting unused node contents.
- $Id: gc.h,v 1.2 1997/07/15 18:41:53 karl Exp $
+/* gc.h -- Functions for garbage collecting unused node contents. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_GC_H
-#define INFO_GC_H
+#if !defined (_GC_H_)
+#define _GC_H_
/* Add POINTER to the list of garbage collectible pointers. A pointer
is not actually garbage collected until no info window contains a node
@@ -34,4 +33,4 @@ extern void add_gcable_pointer ();
node->contents which are collectible, and free them. */
extern void gc_pointers ();
-#endif /* not INFO_GC_H */
+#endif /* !_GC_H_ */
diff --git a/contrib/texinfo/info/general.h b/contrib/texinfo/info/general.h
new file mode 100644
index 000000000000..4b97dc8d8daa
--- /dev/null
+++ b/contrib/texinfo/info/general.h
@@ -0,0 +1,94 @@
+/* general.h -- Some generally useful defines. */
+
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by Brian Fox (bfox@ai.mit.edu). */
+
+#if !defined (_GENERAL_H_)
+#define _GENERAL_H_
+
+extern void *xmalloc (), *xrealloc ();
+
+#if defined (HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#else
+# include <strings.h>
+#endif /* !HAVE_STRING_H */
+
+#include "clib.h"
+
+#define info_toupper(x) (islower (x) ? toupper (x) : x)
+#define info_tolower(x) (isupper (x) ? tolower (x) : x)
+
+#if !defined (whitespace)
+# define whitespace(c) ((c == ' ') || (c == '\t'))
+#endif /* !whitespace */
+
+#if !defined (whitespace_or_newline)
+# define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
+#endif /* !whitespace_or_newline */
+
+#if !defined (__FUNCTION_DEF)
+# define __FUNCTION_DEF
+typedef int Function ();
+typedef void VFunction ();
+typedef char *CFunction ();
+#endif /* _FUNCTION_DEF */
+
+/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
+ of slots that have already been allocated. INDEX is the index into the
+ array where POINTER should be added. GROW is the number of slots to grow
+ ARRAY by, in the case that it needs growing. TYPE is a cast of the type
+ of object stored in ARRAY (e.g., NODE_ENTRY *. */
+#define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
+ do { \
+ if (idx + 2 >= slots) \
+ array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
+ array[idx++] = (type)pointer; \
+ array[idx] = (type)NULL; \
+ } while (0)
+
+#define maybe_free(x) do { if (x) free (x); } while (0)
+
+#if !defined (zero_mem) && defined (HAVE_MEMSET)
+# define zero_mem(mem, length) memset (mem, 0, length)
+#endif /* !zero_mem && HAVE_MEMSET */
+
+#if !defined (zero_mem) && defined (HAVE_BZERO)
+# define zero_mem(mem, length) bzero (mem, length)
+#endif /* !zero_mem && HAVE_BZERO */
+
+#if !defined (zero_mem)
+# define zero_mem(mem, length) \
+ do { \
+ register int zi; \
+ register unsigned char *place; \
+ \
+ place = (unsigned char *)mem; \
+ for (zi = 0; zi < length; zi++) \
+ place[zi] = 0; \
+ } while (0)
+#endif /* !zero_mem */
+
+#endif /* !_GENERAL_H_ */
diff --git a/contrib/texinfo/info/indices.c b/contrib/texinfo/info/indices.c
index 37e9b037762b..6848884288ba 100644
--- a/contrib/texinfo/info/indices.c
+++ b/contrib/texinfo/info/indices.c
@@ -1,7 +1,9 @@
-/* indices.c -- Commands for dealing with an Info file Index.
- $Id: indices.c,v 1.6 1997/07/24 21:25:53 karl Exp $
+/* indices.c -- Commands for dealing with an Info file Index. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,9 +43,9 @@ static char *initial_index_nodename = (char *)NULL;
/* A structure associating index names with index offset ranges. */
typedef struct {
- char *name; /* The nodename of this index. */
- int first; /* The index in our list of the first entry. */
- int last; /* The index in our list of the last entry. */
+ char *name; /* The nodename of this index. */
+ int first; /* The index in our list of the first entry. */
+ int last; /* The index in our list of the last entry. */
} INDEX_NAME_ASSOC;
/* An array associating index nodenames with index offset ranges. */
@@ -63,7 +65,7 @@ add_index_to_index_nodenames (array, node)
for (last = 0; array[last]; last++);
assoc = (INDEX_NAME_ASSOC *)xmalloc (sizeof (INDEX_NAME_ASSOC));
- assoc->name = xstrdup (node->nodename);
+ assoc->name = strdup (node->nodename);
if (!index_nodenames_index)
{
@@ -117,10 +119,10 @@ info_indices_of_file_buffer (file_buffer)
if (index_nodenames)
{
for (i = 0; index_nodenames[i]; i++)
- {
- free (index_nodenames[i]->name);
- free (index_nodenames[i]);
- }
+ {
+ free (index_nodenames[i]->name);
+ free (index_nodenames[i]);
+ }
index_nodenames_index = 0;
index_nodenames[0] = (INDEX_NAME_ASSOC *)NULL;
@@ -131,59 +133,48 @@ info_indices_of_file_buffer (file_buffer)
{
TAG *tag;
- for (i = 0; (tag = file_buffer->tags[i]); i++)
- {
- if (string_in_line ("Index", tag->nodename) != -1)
- {
- NODE *node;
- REFERENCE **menu;
-
- /* Found one. Get its menu. */
- node = info_get_node (tag->filename, tag->nodename);
- if (!node)
- continue;
-
- /* Remember the filename and nodename of this index. */
- initial_index_filename = xstrdup (file_buffer->filename);
- initial_index_nodename = xstrdup (tag->nodename);
-
- menu = info_menu_of_node (node);
-
- /* If we have a menu, add this index's nodename and range
- to our list of index_nodenames. */
- if (menu)
- {
- add_index_to_index_nodenames (menu, node);
-
- /* Concatenate the references found so far. */
- result = info_concatenate_references (result, menu);
- }
- free (node);
- }
- }
+ for (i = 0; tag = file_buffer->tags[i]; i++)
+ {
+ if (string_in_line ("Index", tag->nodename) != -1)
+ {
+ NODE *node;
+ REFERENCE **menu;
+
+ /* Found one. Get its menu. */
+ node = info_get_node (tag->filename, tag->nodename);
+ if (!node)
+ continue;
+
+ /* Remember the filename and nodename of this index. */
+ initial_index_filename = strdup (file_buffer->filename);
+ initial_index_nodename = strdup (tag->nodename);
+
+ menu = info_menu_of_node (node);
+
+ /* If we have a menu, add this index's nodename and range
+ to our list of index_nodenames. */
+ if (menu)
+ {
+ add_index_to_index_nodenames (menu, node);
+
+ /* Concatenate the references found so far. */
+ result = info_concatenate_references (result, menu);
+ }
+ free (node);
+ }
+ }
}
/* If there is a result, clean it up so that every entry has a filename. */
for (i = 0; result && result[i]; i++)
if (!result[i]->filename)
- result[i]->filename = xstrdup (file_buffer->filename);
+ result[i]->filename = strdup (file_buffer->filename);
return (result);
}
DECLARE_INFO_COMMAND (info_index_search,
- _("Look up a string in the index for this file"))
-{
- do_info_index_search (window, count, 0);
-}
-
-/* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING
- is NULL, prompt user for input. */
-void
-do_info_index_search (window, count, search_string)
- WINDOW *window;
- int count;
- char *search_string;
+ "Look up a string in the index for this file")
{
FILE_BUFFER *fb;
char *line;
@@ -202,52 +193,47 @@ do_info_index_search (window, count, search_string)
(strcmp (initial_index_filename, fb->filename) != 0))
{
info_free_references (index_index);
- window_message_in_echo_area (_("Finding index entries..."));
+ window_message_in_echo_area ("Finding index entries...");
index_index = info_indices_of_file_buffer (fb);
}
/* If there is no index, quit now. */
if (!index_index)
{
- info_error (_("No indices found."));
+ info_error ("No indices found.");
return;
}
- /* Okay, there is an index. Look for SEARCH_STRING, or, if it is
- empty, prompt for one. */
- if (search_string && *search_string)
- line = xstrdup (search_string);
- else
+ /* Okay, there is an index. Let the user select one of the members of it. */
+ line =
+ info_read_maybe_completing (window, "Index entry: ", index_index);
+
+ window = active_window;
+
+ /* User aborted? */
+ if (!line)
+ {
+ info_abort_key (active_window, 1, 0);
+ return;
+ }
+
+ /* Empty line means move to the Index node. */
+ if (!*line)
{
- line = info_read_maybe_completing (window, _("Index entry: "),
- index_index);
- window = active_window;
-
- /* User aborted? */
- if (!line)
- {
- info_abort_key (active_window, 1, 0);
- return;
- }
-
- /* Empty line means move to the Index node. */
- if (!*line)
- {
- free (line);
-
- if (initial_index_filename && initial_index_nodename)
- {
- NODE *node;
-
- node = info_get_node (initial_index_filename,
- initial_index_nodename);
- set_remembered_pagetop_and_point (window);
- window_set_node_of_window (window, node);
- remember_window_and_node (window, node);
- window_clear_echo_area ();
- return;
- }
- }
+ free (line);
+
+ if (initial_index_filename && initial_index_nodename)
+ {
+ NODE *node;
+
+ node =
+ info_get_node (initial_index_filename, initial_index_nodename);
+ set_remembered_pagetop_and_point (window);
+ window_set_node_of_window (window, node);
+ remember_window_and_node (window, node);
+ window_clear_echo_area ();
+ return;
+ }
}
/* The user typed either a completed index label, or a partial string.
@@ -260,9 +246,9 @@ do_info_index_search (window, count, search_string)
/* Start the search right after/before this index. */
if (count < 0)
{
- register int i;
- for (i = 0; index_index[i]; i++);
- index_offset = i;
+ register int i;
+ for (i = 0; index_index[i]; i++);
+ index_offset = i;
}
else
index_offset = -1;
@@ -281,55 +267,8 @@ do_info_index_search (window, count, search_string)
}
}
-int
-index_entry_exists (window, string)
- WINDOW *window;
- char *string;
-{
- register int i;
- FILE_BUFFER *fb;
-
- /* If there is no previous search string, the user hasn't built an index
- yet. */
- if (!string)
- return 0;
-
- fb = file_buffer_of_window (window);
- if (!initial_index_filename
- || (strcmp (initial_index_filename, fb->filename) != 0))
- {
- info_free_references (index_index);
- index_index = info_indices_of_file_buffer (fb);
- }
-
- /* If there is no index, that is an error. */
- if (!index_index)
- return 0;
-
- for (i = 0; (i > -1) && (index_index[i]); i++)
- if (strcmp (string, index_index[i]->label) == 0)
- break;
-
- /* If that failed, look for the next substring match. */
- if ((i < 0) || (!index_index[i]))
- {
- for (i = 0; (i > -1) && (index_index[i]); i++)
- if (string_in_line (string, index_index[i]->label) != -1)
- break;
-
- if ((i > -1) && (index_index[i]))
- string_in_line (string, index_index[i]->label);
- }
-
- /* If that failed, return 0. */
- if ((i < 0) || (!index_index[i]))
- return 0;
-
- return 1;
-}
-
DECLARE_INFO_COMMAND (info_next_index_match,
- _("Go to the next matching index item from the last `\\[index-search]' command"))
+ "Go to the next matching index item from the last `\\[index-search]' command")
{
register int i;
int partial, dir;
@@ -339,14 +278,14 @@ DECLARE_INFO_COMMAND (info_next_index_match,
yet. */
if (!index_search)
{
- info_error (_("No previous index search string."));
+ info_error ("No previous index search string.");
return;
}
/* If there is no index, that is an error. */
if (!index_index)
{
- info_error (_("No index entries."));
+ info_error ("No index entries.");
return;
}
@@ -369,18 +308,18 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if ((i < 0) || (!index_index[i]))
{
for (i = index_offset + dir; (i > -1) && (index_index[i]); i += dir)
- if (string_in_line (index_search, index_index[i]->label) != -1)
- break;
+ if (string_in_line (index_search, index_index[i]->label) != -1)
+ break;
if ((i > -1) && (index_index[i]))
- partial = string_in_line (index_search, index_index[i]->label);
+ partial = string_in_line (index_search, index_index[i]->label);
}
/* If that failed, print an error. */
if ((i < 0) || (!index_index[i]))
{
- info_error (_("No %sindex entries containing \"%s\"."),
- index_offset > 0 ? _("more ") : "", index_search);
+ info_error ("No %sindex entries containing \"%s\".",
+ index_offset > 0 ? "more " : "", index_search);
return;
}
@@ -390,43 +329,43 @@ DECLARE_INFO_COMMAND (info_next_index_match,
/* Report to the user on what we have found. */
{
register int j;
- char *name = _("CAN'T SEE THIS");
+ char *name = "CAN'T SEE THIS";
char *match;
for (j = 0; index_nodenames[j]; j++)
{
- if ((i >= index_nodenames[j]->first) &&
- (i <= index_nodenames[j]->last))
- {
- name = index_nodenames[j]->name;
- break;
- }
+ if ((i >= index_nodenames[j]->first) &&
+ (i <= index_nodenames[j]->last))
+ {
+ name = index_nodenames[j]->name;
+ break;
+ }
}
/* If we had a partial match, indicate to the user which part of the
string matched. */
- match = xstrdup (index_index[i]->label);
+ match = strdup (index_index[i]->label);
if (partial && show_index_match)
{
- int j, ls, start, upper;
+ int j, ls, start, upper;
- ls = strlen (index_search);
- start = partial - ls;
- upper = isupper (match[start]) ? 1 : 0;
+ ls = strlen (index_search);
+ start = partial - ls;
+ upper = isupper (match[start]) ? 1 : 0;
- for (j = 0; j < ls; j++)
- if (upper)
- match[j + start] = info_tolower (match[j + start]);
- else
- match[j + start] = info_toupper (match[j + start]);
+ for (j = 0; j < ls; j++)
+ if (upper)
+ match[j + start] = info_tolower (match[j + start]);
+ else
+ match[j + start] = info_toupper (match[j + start]);
}
{
char *format;
format = replace_in_documentation
- (_("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"));
+ ("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)");
window_message_in_echo_area (format, match, name);
}
@@ -440,7 +379,7 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if (!node)
{
info_error (CANT_FILE_NODE,
- index_index[i]->filename, index_index[i]->nodename);
+ index_index[i]->filename, index_index[i]->nodename);
return;
}
@@ -458,16 +397,16 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if (loc != -1)
{
- window->point = loc;
- window_adjust_pagetop (window);
+ window->point = loc;
+ window_adjust_pagetop (window);
}
}
}
/* **************************************************************** */
-/* */
-/* Info APROPOS: Search every known index. */
-/* */
+/* */
+/* Info APROPOS: Search every known index. */
+/* */
/* **************************************************************** */
/* For every menu item in DIR, search the indices of that file for
@@ -481,13 +420,14 @@ apropos_in_all_indices (search_string, inform)
REFERENCE **all_indices = (REFERENCE **)NULL;
REFERENCE **dir_menu = (REFERENCE **)NULL;
NODE *dir_node;
+ int printed = 0;
dir_node = info_get_node ("dir", "Top");
if (dir_node)
dir_menu = info_menu_of_node (dir_node);
if (!dir_menu)
- return NULL;
+ return;
/* For every menu item in DIR, get the associated node's file buffer and
read the indices of that file buffer. Gather all of the indices into
@@ -501,54 +441,54 @@ apropos_in_all_indices (search_string, inform)
this_item = dir_menu[dir_index];
if (!this_item->filename)
- {
- if (dir_node->parent)
- this_item->filename = xstrdup (dir_node->parent);
- else
- this_item->filename = xstrdup (dir_node->filename);
- }
+ {
+ if (dir_node->parent)
+ this_item->filename = strdup (dir_node->parent);
+ else
+ this_item->filename = strdup (dir_node->filename);
+ }
/* Find this node. If we cannot find it, try using the label of the
- entry as a file (i.e., "(LABEL)Top"). */
+ entry as a file (i.e., "(LABEL)Top"). */
this_node = info_get_node (this_item->filename, this_item->nodename);
if (!this_node && this_item->nodename &&
- (strcmp (this_item->label, this_item->nodename) == 0))
- this_node = info_get_node (this_item->label, "Top");
+ (strcmp (this_item->label, this_item->nodename) == 0))
+ this_node = info_get_node (this_item->label, "Top");
if (!this_node)
- continue;
+ continue;
/* Get the file buffer associated with this node. */
{
- char *files_name;
+ char *files_name;
- files_name = this_node->parent;
- if (!files_name)
- files_name = this_node->filename;
+ files_name = this_node->parent;
+ if (!files_name)
+ files_name = this_node->filename;
- this_fb = info_find_file (files_name);
+ this_fb = info_find_file (files_name);
- if (this_fb && inform)
- message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name);
+ if (this_fb && inform)
+ message_in_echo_area ("Scanning indices of \"%s\"...", files_name);
- this_index = info_indices_of_file_buffer (this_fb);
- free (this_node);
+ this_index = info_indices_of_file_buffer (this_fb);
+ free (this_node);
- if (this_fb && inform)
- unmessage_in_echo_area ();
+ if (this_fb && inform)
+ unmessage_in_echo_area ();
}
if (this_index)
- {
- /* Remember the filename which contains this set of references. */
- for (i = 0; this_index && this_index[i]; i++)
- if (!this_index[i]->filename)
- this_index[i]->filename = xstrdup (this_fb->filename);
-
- /* Concatenate with the other indices. */
- all_indices = info_concatenate_references (all_indices, this_index);
- }
+ {
+ /* Remember the filename which contains this set of references. */
+ for (i = 0; this_index && this_index[i]; i++)
+ if (!this_index[i]->filename)
+ this_index[i]->filename = strdup (this_fb->filename);
+
+ /* Concatenate with the other indices. */
+ all_indices = info_concatenate_references (all_indices, this_index);
+ }
}
info_free_references (dir_menu);
@@ -561,21 +501,21 @@ apropos_in_all_indices (search_string, inform)
int apropos_list_slots = 0;
for (i = 0; (entry = all_indices[i]); i++)
- {
- if (string_in_line (search_string, entry->label) != -1)
- {
- add_pointer_to_array
- (entry, apropos_list_index, apropos_list, apropos_list_slots,
- 100, REFERENCE *);
- }
- else
- {
- maybe_free (entry->label);
- maybe_free (entry->filename);
- maybe_free (entry->nodename);
- free (entry);
- }
- }
+ {
+ if (string_in_line (search_string, entry->label) != -1)
+ {
+ add_pointer_to_array
+ (entry, apropos_list_index, apropos_list, apropos_list_slots,
+ 100, REFERENCE *);
+ }
+ else
+ {
+ maybe_free (entry->label);
+ maybe_free (entry->filename);
+ maybe_free (entry->nodename);
+ free (entry);
+ }
+ }
free (all_indices);
all_indices = apropos_list;
@@ -584,7 +524,7 @@ apropos_in_all_indices (search_string, inform)
}
#define APROPOS_NONE \
- _("No available info files reference \"%s\" in their indices.")
+ "No available info files reference \"%s\" in their indices."
void
info_apropos (string)
@@ -604,8 +544,8 @@ info_apropos (string)
REFERENCE *entry;
for (i = 0; (entry = apropos_list[i]); i++)
- fprintf (stderr, "\"(%s)%s\" -- %s\n",
- entry->filename, entry->nodename, entry->label);
+ fprintf (stderr, "\"(%s)%s\" -- %s\n",
+ entry->filename, entry->nodename, entry->label);
}
info_free_references (apropos_list);
}
@@ -613,11 +553,11 @@ info_apropos (string)
static char *apropos_list_nodename = "*Apropos*";
DECLARE_INFO_COMMAND (info_index_apropos,
- _("Grovel all known info file's indices for a string and build a menu"))
+ "Grovel all known info file's indices for a string and build a menu")
{
char *line;
- line = info_read_in_echo_area (window, _("Index apropos: "));
+ line = info_read_in_echo_area (window, "Index apropos: ");
window = active_window;
@@ -637,85 +577,85 @@ DECLARE_INFO_COMMAND (info_index_apropos,
apropos_list = apropos_in_all_indices (line, 1);
if (!apropos_list)
- {
- info_error (APROPOS_NONE, line);
- }
+ {
+ info_error (APROPOS_NONE, line);
+ }
else
- {
- register int i;
- char *line_buffer;
-
- initialize_message_buffer ();
- printf_to_message_buffer
- (_("\n* Menu: Nodes whoses indices contain \"%s\":\n"), line);
- line_buffer = (char *)xmalloc (500);
-
- for (i = 0; apropos_list[i]; i++)
- {
- int len;
- sprintf (line_buffer, "* (%s)%s::",
- apropos_list[i]->filename, apropos_list[i]->nodename);
- len = pad_to (36, line_buffer);
- sprintf (line_buffer + len, "%s", apropos_list[i]->label);
- printf_to_message_buffer ("%s\n", line_buffer);
- }
- free (line_buffer);
- }
+ {
+ register int i;
+ char *line_buffer;
+
+ initialize_message_buffer ();
+ printf_to_message_buffer
+ ("\n* Menu: Nodes whoses indices contain \"%s\":\n", line);
+ line_buffer = (char *)xmalloc (500);
+
+ for (i = 0; apropos_list[i]; i++)
+ {
+ int len;
+ sprintf (line_buffer, "* (%s)%s::",
+ apropos_list[i]->filename, apropos_list[i]->nodename);
+ len = pad_to (36, line_buffer);
+ sprintf (line_buffer + len, "%s", apropos_list[i]->label);
+ printf_to_message_buffer ("%s\n", line_buffer);
+ }
+ free (line_buffer);
+ }
apropos_node = message_buffer_to_node ();
add_gcable_pointer (apropos_node->contents);
name_internal_node (apropos_node, apropos_list_nodename);
/* Even though this is an internal node, we don't want the window
- system to treat it specially. So we turn off the internalness
- of it here. */
+ system to treat it specially. So we turn off the internalness
+ of it here. */
apropos_node->flags &= ~N_IsInternal;
/* Find/Create a window to contain this node. */
{
- WINDOW *new;
- NODE *node;
-
- set_remembered_pagetop_and_point (window);
-
- /* If a window is visible and showing an apropos list already,
- re-use it. */
- for (new = windows; new; new = new->next)
- {
- node = new->node;
-
- if (internal_info_node_p (node) &&
- (strcmp (node->nodename, apropos_list_nodename) == 0))
- break;
- }
-
- /* If we couldn't find an existing window, try to use the next window
- in the chain. */
- if (!new && window->next)
- new = window->next;
-
- /* If we still don't have a window, make a new one to contain
- the list. */
- if (!new)
- {
- WINDOW *old_active;
-
- old_active = active_window;
- active_window = window;
- new = window_make_window ((NODE *)NULL);
- active_window = old_active;
- }
-
- /* If we couldn't make a new window, use this one. */
- if (!new)
- new = window;
-
- /* Lines do not wrap in this window. */
- new->flags |= W_NoWrap;
-
- window_set_node_of_window (new, apropos_node);
- remember_window_and_node (new, apropos_node);
- active_window = new;
+ WINDOW *new;
+ NODE *node;
+
+ set_remembered_pagetop_and_point (window);
+
+ /* If a window is visible and showing an apropos list already,
+ re-use it. */
+ for (new = windows; new; new = new->next)
+ {
+ node = new->node;
+
+ if (internal_info_node_p (node) &&
+ (strcmp (node->nodename, apropos_list_nodename) == 0))
+ break;
+ }
+
+ /* If we couldn't find an existing window, try to use the next window
+ in the chain. */
+ if (!new && window->next)
+ new = window->next;
+
+ /* If we still don't have a window, make a new one to contain
+ the list. */
+ if (!new)
+ {
+ WINDOW *old_active;
+
+ old_active = active_window;
+ active_window = window;
+ new = window_make_window ((NODE *)NULL);
+ active_window = old_active;
+ }
+
+ /* If we couldn't make a new window, use this one. */
+ if (!new)
+ new = window;
+
+ /* Lines do not wrap in this window. */
+ new->flags |= W_NoWrap;
+
+ window_set_node_of_window (new, apropos_node);
+ remember_window_and_node (new, apropos_node);
+ active_window = new;
}
info_free_references (apropos_list);
}
diff --git a/contrib/texinfo/info/indices.h b/contrib/texinfo/info/indices.h
index 8b8a7070c0b1..265b1472ba89 100644
--- a/contrib/texinfo/info/indices.h
+++ b/contrib/texinfo/info/indices.h
@@ -1,10 +1,9 @@
-/* indices.h -- Functions defined in indices.c.
- $Id: indices.h,v 1.2 1997/07/06 20:50:29 karl Exp $
+/* indices.h -- Functions defined in indices.c. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_INDICES_H
-#define INFO_INDICES_H
+#if !defined (_INDICES_H_)
+#define _INDICES_H_
/* User-visible variable controls the output of info-index-next. */
extern int show_index_match;
@@ -36,7 +35,5 @@ REFERENCE **apropos_in_all_indices ();
/* User visible functions declared in indices.c. */
extern void info_index_search (), info_next_index_match ();
-extern void do_info_index_search ();
-extern int index_intry_exists ();
-#endif /* not INFO_INDICES_H */
+#endif /* !_INDICES_H_ */
diff --git a/contrib/texinfo/info/info-stnd.texi b/contrib/texinfo/info/info-stnd.texi
new file mode 100644
index 000000000000..e0fdb20b7269
--- /dev/null
+++ b/contrib/texinfo/info/info-stnd.texi
@@ -0,0 +1,1365 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename info-stnd.info
+@settitle GNU Info
+@set InfoProgVer 2.11
+@paragraphindent none
+@footnotestyle end
+@synindex vr cp
+@synindex fn cp
+@synindex ky cp
+@comment %**end of header
+@comment $Id: info-stnd.texi,v 1.3 1996/09/30 15:34:02 karl Exp $
+
+@dircategory Texinfo documentation system
+@direntry
+* info program: (info-stnd). Standalone Info-reading program.
+@end direntry
+
+@ifinfo
+This file documents GNU Info, a program for viewing the on-line formatted
+versions of Texinfo files. This documentation is different from the
+documentation for the Info reader that is part of GNU Emacs. If you do
+not know how to use Info, but have a working Info reader, you should
+read that documentation first.
+
+Copyright @copyright{} 1992, 93, 96 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+@end ifinfo
+
+@titlepage
+@title GNU Info User's Guide
+@subtitle For GNU Info version @value{InfoProgVer}
+@author Brian J. Fox (bfox@@ai.mit.edu)
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992, 1993 Free Software Foundation
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+@end titlepage
+
+@ifinfo
+@node Top, What is Info, (dir), (dir)
+@top The GNU Info Program
+
+This file documents GNU Info, a program for viewing the on-line
+formatted versions of Texinfo files, version @value{InfoProgVer}. This
+documentation is different from the documentation for the Info reader
+that is part of GNU Emacs.
+@end ifinfo
+
+@menu
+* What is Info::
+* Options:: Options you can pass on the command line.
+* Cursor Commands:: Commands which move the cursor within a node.
+* Scrolling Commands:: Commands for moving the node around
+ in a window.
+* Node Commands:: Commands for selecting a new node.
+* Searching Commands:: Commands for searching an Info file.
+* Xref Commands:: Commands for selecting cross references.
+* Window Commands:: Commands which manipulate multiple windows.
+* Printing Nodes:: How to print out the contents of a node.
+* Miscellaneous Commands:: A few commands that defy categories.
+* Variables:: How to change the default behavior of Info.
+* GNU Info Global Index:: Global index containing keystrokes,
+ command names, variable names,
+ and general concepts.
+@end menu
+
+@node What is Info, Options, Top, Top
+@chapter What is Info?
+
+@iftex
+This file documents GNU Info, a program for viewing the on-line formatted
+versions of Texinfo files, version @value{InfoProgVer}.
+@end iftex
+
+@dfn{Info} is a program which is used to view Info files on an ASCII
+terminal. @dfn{Info files} are the result of processing Texinfo files
+with the program @code{makeinfo} or with one of the Emacs commands, such
+as @code{M-x texinfo-format-buffer}. Texinfo itself is a documentation
+system that uses a single source file to produce both on-line
+information and printed output. You can typeset and print the
+files that you read in Info.@refill
+
+@node Options, Cursor Commands, What is Info, Top
+@chapter Command Line Options
+@cindex command line options
+@cindex arguments, command line
+
+GNU Info accepts several options to control the initial node being
+viewed, and to specify which directories to search for Info files. Here
+is a template showing an invocation of GNU Info from the shell:
+
+@example
+info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
+@end example
+
+The following @var{option-names} are available when invoking Info from
+the shell:
+
+@table @code
+@cindex directory path
+@item --directory @var{directory-path}
+@itemx -d @var{directory-path}
+Add @var{directory-path} to the list of directory paths searched when
+Info needs to find a file. You may issue @code{--directory} multiple
+times; once for each directory which contains Info files.
+Alternatively, you may specify a value for the environment variable
+@code{INFOPATH}; if @code{--directory} is not given, the value of
+@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon
+separated list of directory names. If you do not supply @code{INFOPATH}
+or @code{--directory-path}, Info uses a default path.
+
+@item --file @var{filename}
+@itemx -f @var{filename}
+@cindex Info file, selecting
+Specify a particular Info file to visit. By default, Info visits
+the file @code{dir}; if you use this option, Info will start with
+@code{(@var{filename})Top} as the first file and node.
+
+@item --node @var{nodename}
+@itemx -n @var{nodename}
+@cindex node, selecting
+Specify a particular node to visit in the initial file that Info
+loads. This is especially useful in conjunction with
+@code{--file}@footnote{Of course, you can specify both the file and node
+in a @code{--node} command; but don't forget to escape the open and
+close parentheses from the shell as in: @code{info --node
+"(emacs)Buffers"}}. You may specify @code{--node} multiple times; for
+an interactive Info, each @var{nodename} is visited in its own window,
+for a non-interactive Info (such as when @code{--output} is given) each
+@var{nodename} is processed sequentially.
+
+@item --output @var{filename}
+@itemx -o @var{filename}
+@cindex file, outputting to
+@cindex outputting to a file
+Specify @var{filename} as the name of a file to which to direct output.
+Each node that Info visits will be output to @var{filename} instead of
+interactively viewed. A value of @code{-} for @var{filename} specifies
+the standard output.
+
+@item --subnodes
+@cindex @code{--subnodes}, command line option
+This option only has meaning when given in conjunction with
+@code{--output}. It means to recursively output the nodes appearing in
+the menus of each node being output. Menu items which resolve to
+external Info files are not output, and neither are menu items which are
+members of an index. Each node is only output once.
+
+@item --help
+@itemx -h
+Produces a relatively brief description of the available Info options.
+
+@item --version
+@cindex version information
+Prints the version information of Info and exits.
+
+@item @var{menu-item}
+@cindex menu, following
+Info treats its remaining arguments as the names of menu items. The
+first argument is a menu item in the initial node visited, while
+the second argument is a menu item in the first argument's node.
+You can easily move to the node of your choice by specifying the menu
+names which describe the path to that node. For example,
+
+@example
+info emacs buffers
+@end example
+
+@noindent
+first selects the menu item @samp{Emacs} in the node @samp{(dir)Top},
+and then selects the menu item @samp{Buffers} in the node
+@samp{(emacs)Top}.
+@end table
+
+@node Cursor Commands, Scrolling Commands, Options, Top
+@chapter Moving the Cursor
+@cindex cursor, moving
+
+Many people find that reading screens of text page by page is made
+easier when one is able to indicate particular pieces of text with some
+kind of pointing device. Since this is the case, GNU Info (both the
+Emacs and standalone versions) have several commands which allow you to
+move the cursor about the screen. The notation used in this manual to
+describe keystrokes is identical to the notation used within the Emacs
+manual, and the GNU Readline manual. @xref{Characters, , Character
+Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the
+notation.
+
+The following table lists the basic cursor movement commands in Info.
+Each entry consists of the key sequence you should type to execute the
+cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it
+invokes @code{execute-extended-command}. @xref{M-x, , Executing an
+extended command, emacs, the GNU Emacs Manual}, for more detailed
+information.} command name (displayed in parentheses), and a short
+description of what the command does. All of the cursor motion commands
+can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
+@code{universal-argument}}), to find out how to supply them. With a
+numeric argument, the motion commands are simply executed that
+many times; for example, a numeric argument of 4 given to
+@code{next-line} causes the cursor to move down 4 lines. With a
+negative numeric argument, the motion is reversed; an argument of -4
+given to the @code{next-line} command would cause the cursor to move
+@emph{up} 4 lines.
+
+@table @asis
+@item @code{C-n} (@code{next-line})
+@kindex C-n
+@findex next-line
+Move the cursor down to the next line.
+
+@item @code{C-p} (@code{prev-line})
+@kindex C-p
+@findex prev-line
+Move the cursor up to the previous line.
+
+@item @code{C-a} (@code{beginning-of-line})
+@kindex C-a, in Info windows
+@findex beginning-of-line
+Move the cursor to the start of the current line.
+
+@item @code{C-e} (@code{end-of-line})
+@kindex C-e, in Info windows
+@findex end-of-line
+Move the cursor to the end of the current line.
+
+@item @code{C-f} (@code{forward-char})
+@kindex C-f, in Info windows
+@findex forward-char
+Move the cursor forward a character.
+
+@item @code{C-b} (@code{backward-char})
+@kindex C-b, in Info windows
+@findex backward-char
+Move the cursor backward a character.
+
+@item @code{M-f} (@code{forward-word})
+@kindex M-f, in Info windows
+@findex forward-word
+Move the cursor forward a word.
+
+@item @code{M-b} (@code{backward-word})
+@kindex M-b, in Info windows
+@findex backward-word
+Move the cursor backward a word.
+
+@item @code{M-<} (@code{beginning-of-node})
+@itemx @code{b}
+@kindex b, in Info windows
+@kindex M-<
+@findex beginning-of-node
+Move the cursor to the start of the current node.
+
+@item @code{M->} (@code{end-of-node})
+@kindex M->
+@findex end-of-node
+Move the cursor to the end of the current node.
+
+@item @code{M-r} (@code{move-to-window-line})
+@kindex M-r
+@findex move-to-window-line
+Move the cursor to a specific line of the window. Without a numeric
+argument, @code{M-r} moves the cursor to the start of the line in the
+center of the window. With a numeric argument of @var{n}, @code{M-r}
+moves the cursor to the start of the @var{n}th line in the window.
+@end table
+
+@node Scrolling Commands, Node Commands, Cursor Commands, Top
+@chapter Moving Text Within a Window
+@cindex scrolling
+
+Sometimes you are looking at a screenful of text, and only part of the
+current paragraph you are reading is visible on the screen. The
+commands detailed in this section are used to shift which part of the
+current node is visible on the screen.
+
+@table @asis
+@item @code{SPC} (@code{scroll-forward})
+@itemx @code{C-v}
+@kindex SPC, in Info windows
+@kindex C-v
+@findex scroll-forward
+Shift the text in this window up. That is, show more of the node which
+is currently below the bottom of the window. With a numeric argument,
+show that many more lines at the bottom of the window; a numeric
+argument of 4 would shift all of the text in the window up 4 lines
+(discarding the top 4 lines), and show you four new lines at the bottom
+of the window. Without a numeric argument, @key{SPC} takes the bottom
+two lines of the window and places them at the top of the window,
+redisplaying almost a completely new screenful of lines.
+
+@item @code{DEL} (@code{scroll-backward})
+@itemx @code{M-v}
+@kindex DEL, in Info windows
+@kindex M-v
+@findex scroll-backward
+Shift the text in this window down. The inverse of
+@code{scroll-forward}.
+@end table
+
+@cindex scrolling through node structure
+The @code{scroll-forward} and @code{scroll-backward} commands can also
+move forward and backward through the node structure of the file. If
+you press @key{SPC} while viewing the end of a node, or @key{DEL} while
+viewing the beginning of a node, what happens is controlled by the
+variable @code{scroll-behavior}. @xref{Variables,
+@code{scroll-behavior}}, for more information.
+
+@table @asis
+@item @code{C-l} (@code{redraw-display})
+@kindex C-l
+@findex redraw-display
+Redraw the display from scratch, or shift the line containing the cursor
+to a specified location. With no numeric argument, @samp{C-l} clears
+the screen, and then redraws its entire contents. Given a numeric
+argument of @var{n}, the line containing the cursor is shifted so that
+it is on the @var{n}th line of the window.
+
+@item @code{C-x w} (@code{toggle-wrap})
+@kindex C-w
+@findex toggle-wrap
+Toggles the state of line wrapping in the current window. Normally,
+lines which are longer than the screen width @dfn{wrap}, i.e., they are
+continued on the next line. Lines which wrap have a @samp{\} appearing
+in the rightmost column of the screen. You can cause such lines to be
+terminated at the rightmost column by changing the state of line
+wrapping in the window with @code{C-x w}. When a line which needs more
+space than one screen width to display is displayed, a @samp{$} appears
+in the rightmost column of the screen, and the remainder of the line is
+invisible.
+@end table
+
+@node Node Commands, Searching Commands, Scrolling Commands, Top
+@chapter Selecting a New Node
+@cindex nodes, selection of
+
+This section details the numerous Info commands which select a new node
+to view in the current window.
+
+The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
+@samp{l}.
+
+When you are viewing a node, the top line of the node contains some Info
+@dfn{pointers} which describe where the next, previous, and up nodes
+are. Info uses this line to move about the node structure of the file
+when you use the following commands:
+
+@table @asis
+@item @code{n} (@code{next-node})
+@kindex n
+@findex next-node
+Select the `Next' node.
+
+@item @code{p} (@code{prev-node})
+@kindex p
+@findex prev-node
+Select the `Prev' node.
+
+@item @code{u} (@code{up-node})
+@kindex u
+@findex up-node
+Select the `Up' node.
+@end table
+
+You can easily select a node that you have already viewed in this window
+by using the @samp{l} command -- this name stands for "last", and
+actually moves through the list of already visited nodes for this
+window. @samp{l} with a negative numeric argument moves forward through
+the history of nodes for this window, so you can quickly step between
+two adjacent (in viewing history) nodes.
+
+@table @asis
+@item @code{l} (@code{history-node})
+@kindex l
+@findex history-node
+Select the most recently selected node in this window.
+@end table
+
+Two additional commands make it easy to select the most commonly
+selected nodes; they are @samp{t} and @samp{d}.
+
+@table @asis
+@item @code{t} (@code{top-node})
+@kindex t
+@findex top-node
+Select the node @samp{Top} in the current Info file.
+
+@item @code{d} (@code{dir-node})
+@kindex d
+@findex dir-node
+Select the directory node (i.e., the node @samp{(dir)}).
+@end table
+
+Here are some other commands which immediately result in the selection
+of a different node in the current window:
+
+@table @asis
+@item @code{<} (@code{first-node})
+@kindex <
+@findex first-node
+Selects the first node which appears in this file. This node is most
+often @samp{Top}, but it does not have to be.
+
+@item @code{>} (@code{last-node})
+@kindex >
+@findex last-node
+Select the last node which appears in this file.
+
+@item @code{]} (@code{global-next-node})
+@kindex ]
+@findex global-next-node
+Move forward or down through node structure. If the node that you are
+currently viewing has a @samp{Next} pointer, that node is selected.
+Otherwise, if this node has a menu, the first menu item is selected. If
+there is no @samp{Next} and no menu, the same process is tried with the
+@samp{Up} node of this node.
+
+@item @code{[} (@code{global-prev-node})
+@kindex [
+@findex global-prev-node
+Move backward or up through node structure. If the node that you are
+currently viewing has a @samp{Prev} pointer, that node is selected.
+Otherwise, if the node has an @samp{Up} pointer, that node is selected,
+and if it has a menu, the last item in the menu is selected.
+@end table
+
+You can get the same behavior as @code{global-next-node} and
+@code{global-prev-node} while simply scrolling through the file with
+@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behavior}}, for
+more information.
+
+@table @asis
+@item @code{g} (@code{goto-node})
+@kindex g
+@findex goto-node
+Read the name of a node and select it. No completion is done while
+reading the node name, since the desired node may reside in a separate
+file. The node must be typed exactly as it appears in the Info file. A
+file name may be included as with any node specification, for example
+
+@example
+@code{g(emacs)Buffers}
+@end example
+
+finds the node @samp{Buffers} in the Info file @file{emacs}.
+
+@item @code{C-x k} (@code{kill-node})
+@kindex C-x k
+@findex kill-node
+Kill a node. The node name is prompted for in the echo area, with a
+default of the current node. @dfn{Killing} a node means that Info tries
+hard to forget about it, removing it from the list of history nodes kept
+for the window where that node is found. Another node is selected in
+the window which contained the killed node.
+
+@item @code{C-x C-f} (@code{view-file})
+@kindex C-x C-f
+@findex view-file
+Read the name of a file and selects the entire file. The command
+@example
+@code{C-x C-f @var{filename}}
+@end example
+is equivalent to typing
+@example
+@code{g(@var{filename})*}
+@end example
+
+@item @code{C-x C-b} (@code{list-visited-nodes})
+@kindex C-x C-b
+@findex list-visited-nodes
+Make a window containing a menu of all of the currently visited nodes.
+This window becomes the selected window, and you may use the standard
+Info commands within it.
+
+@item @code{C-x b} (@code{select-visited-node})
+@kindex C-x b
+@findex select-visited-node
+Select a node which has been previously visited in a visible window.
+This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
+created.
+@end table
+
+@node Searching Commands, Xref Commands, Node Commands, Top
+@chapter Searching an Info File
+@cindex searching
+
+GNU Info allows you to search for a sequence of characters throughout an
+entire Info file, search through the indices of an Info file, or find
+areas within an Info file which discuss a particular topic.
+
+@table @asis
+@item @code{s} (@code{search})
+@kindex s
+@findex search
+Read a string in the echo area and search for it.
+
+@item @code{C-s} (@code{isearch-forward})
+@kindex C-s
+@findex isearch-forward
+Interactively search forward through the Info file for a string as you
+type it.
+
+@item @code{C-r} (@code{isearch-backward})
+@kindex C-r
+@findex isearch-backward
+Interactively search backward through the Info file for a string as
+you type it.
+
+@item @code{i} (@code{index-search})
+@kindex i
+@findex index-search
+Look up a string in the indices for this Info file, and select a node
+where the found index entry points to.
+
+@item @code{,} (@code{next-index-match})
+@kindex ,
+@findex next-index-match
+Move to the node containing the next matching index item from the last
+@samp{i} command.
+@end table
+
+The most basic searching command is @samp{s} (@code{search}). The
+@samp{s} command prompts you for a string in the echo area, and then
+searches the remainder of the Info file for an occurrence of that string.
+If the string is found, the node containing it is selected, and the
+cursor is left positioned at the start of the found string. Subsequent
+@samp{s} commands show you the default search string within @samp{[} and
+@samp{]}; pressing @key{RET} instead of typing a new string will use the
+default search string.
+
+@dfn{Incremental searching} is similar to basic searching, but the
+string is looked up while you are typing it, instead of waiting until
+the entire search string has been specified.
+
+@node Xref Commands, Window Commands, Searching Commands, Top
+@chapter Selecting Cross References
+
+We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
+pointers which appear at the top of a node. In addition to these
+pointers, a node may contain other pointers which refer you to a
+different node, perhaps in another Info file. Such pointers are called
+@dfn{cross references}, or @dfn{xrefs} for short.
+
+@menu
+* Parts of an Xref:: What a cross reference is made of.
+* Selecting Xrefs:: Commands for selecting menu or note items.
+@end menu
+
+@node Parts of an Xref, Selecting Xrefs, , Xref Commands
+@section Parts of an Xref
+
+Cross references have two major parts: the first part is called the
+@dfn{label}; it is the name that you can use to refer to the cross
+reference, and the second is the @dfn{target}; it is the full name of
+the node that the cross reference points to.
+
+The target is separated from the label by a colon @samp{:}; first the
+label appears, and then the target. For example, in the sample menu
+cross reference below, the single colon separates the label from the
+target.
+
+@example
+* Foo Label: Foo Target. More information about Foo.
+@end example
+
+Note the @samp{.} which ends the name of the target. The @samp{.} is
+not part of the target; it serves only to let Info know where the target
+name ends.
+
+A shorthand way of specifying references allows two adjacent colons to
+stand for a target name which is the same as the label name:
+
+@example
+* Foo Commands:: Commands pertaining to Foo.
+@end example
+
+In the above example, the name of the target is the same as the name of
+the label, in this case @code{Foo Commands}.
+
+You will normally see two types of cross reference while viewing nodes:
+@dfn{menu} references, and @dfn{note} references. Menu references
+appear within a node's menu; they begin with a @samp{*} at the beginning
+of a line, and continue with a label, a target, and a comment which
+describes what the contents of the node pointed to contains.
+
+Note references appear within the body of the node text; they begin with
+@code{*Note}, and continue with a label and a target.
+
+Like @samp{Next}, @samp{Prev}, and @samp{Up} pointers, cross references
+can point to any valid node. They are used to refer you to a place
+where more detailed information can be found on a particular subject.
+Here is a cross reference which points to a node within the Texinfo
+documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo
+Manual}, for more information on creating your own texinfo cross
+references.
+
+@node Selecting Xrefs, , Parts of an Xref, Xref Commands
+@section Selecting Xrefs
+
+The following table lists the Info commands which operate on menu items.
+
+@table @asis
+@item @code{1} (@code{menu-digit})
+@itemx @code{2} @dots{} @code{9}
+@cindex 1 @dots{} 9, in Info windows
+@kindex 1 @dots{} 9, in Info windows
+@findex menu-digit
+Within an Info window, pressing a single digit, (such as @samp{1}),
+selects that menu item, and places its node in the current window.
+For convenience, there is one exception; pressing @samp{0} selects the
+@emph{last} item in the node's menu.
+
+@item @code{0} (@code{last-menu-item})
+@kindex 0, in Info windows
+@findex last-menu-item
+Select the last item in the current node's menu.
+
+@item @code{m} (@code{menu-item})
+@kindex m
+@findex menu-item
+Reads the name of a menu item in the echo area and selects its node.
+Completion is available while reading the menu label.
+
+@item @code{M-x find-menu}
+@findex find-menu
+Move the cursor to the start of this node's menu.
+@end table
+
+This table lists the Info commands which operate on note cross references.
+
+@table @asis
+@item @code{f} (@code{xref-item})
+@itemx @code{r}
+@kindex f
+@kindex r
+@findex xref-item
+Reads the name of a note cross reference in the echo area and selects
+its node. Completion is available while reading the cross reference
+label.
+@end table
+
+Finally, the next few commands operate on menu or note references alike:
+
+@table @asis
+@item @code{TAB} (@code{move-to-next-xref})
+@kindex TAB, in Info windows
+@findex move-to-next-xref
+Move the cursor to the start of the next nearest menu item or note
+reference in this node. You can then use @key{RET}
+(@code{select-reference-this-line}) to select the menu or note reference.
+
+@item @code{M-TAB} (@code{move-to-prev-xref})
+@kindex M-TAB, in Info windows
+@findex move-to-prev-xref
+Move the cursor the start of the nearest previous menu item or note
+reference in this node.
+
+@item @code{RET} (@code{select-reference-this-line})
+@kindex RET, in Info windows
+@findex select-reference-this-line
+Select the menu item or note reference appearing on this line.
+@end table
+
+@node Window Commands, Printing Nodes, Xref Commands, Top
+@chapter Manipulating Multiple Windows
+@cindex windows, manipulating
+
+A @dfn{window} is a place to show the text of a node. Windows have a
+view area where the text of the node is displayed, and an associated
+@dfn{mode line}, which briefly describes the node being viewed.
+
+GNU Info supports multiple windows appearing in a single screen; each
+window is separated from the next by its modeline. At any time, there
+is only one @dfn{active} window, that is, the window in which the cursor
+appears. There are commands available for creating windows, changing
+the size of windows, selecting which window is active, and for deleting
+windows.
+
+@menu
+* The Mode Line:: What appears in the mode line?
+* Basic Windows:: Manipulating windows in Info.
+* The Echo Area:: Used for displaying errors and reading input.
+@end menu
+
+@node The Mode Line, Basic Windows, , Window Commands
+@section The Mode Line
+
+A @dfn{mode line} is a line of inverse video which appears at the bottom
+of an Info window. It describes the contents of the window just above
+it; this information includes the name of the file and node appearing in
+that window, the number of screen lines it takes to display the node,
+and the percentage of text that is above the top of the window. It can
+also tell you if the indirect tags table for this Info file needs to be
+updated, and whether or not the Info file was compressed when stored on
+disk.
+
+Here is a sample mode line for a window containing an uncompressed file
+named @file{dir}, showing the node @samp{Top}.
+
+@example
+@group
+-----Info: (dir)Top, 40 lines --Top---------------------------------------
+ ^^ ^ ^^^ ^^
+ (file)Node #lines where
+@end group
+@end example
+
+When a node comes from a file which is compressed on disk, this is
+indicated in the mode line with two small @samp{z}'s. In addition, if
+the Info file containing the node has been split into subfiles, the name
+of the subfile containing the node appears in the modeline as well:
+
+@example
+--zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
+@end example
+
+When Info makes a node internally, such that there is no corresponding
+info file on disk, the name of the node is surrounded by asterisks
+(@samp{*}). The name itself tells you what the contents of the window
+are; the sample mode line below shows an internally constructed node
+showing possible completions:
+
+@example
+-----Info: *Completions*, 7 lines --All-----------------------------------
+@end example
+
+@node Basic Windows, The Echo Area, The Mode Line, Window Commands
+@section Window Commands
+
+It can be convenient to view more than one node at a time. To allow
+this, Info can display more than one @dfn{window}. Each window has its
+own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
+window (@pxref{Node Commands, , @code{history-node}}).
+
+@table @asis
+@item @code{C-x o} (@code{next-window})
+@cindex windows, selecting
+@kindex C-x o
+@findex next-window
+Select the next window on the screen. Note that the echo area can only be
+selected if it is already in use, and you have left it temporarily.
+Normally, @samp{C-x o} simply moves the cursor into the next window on
+the screen, or if you are already within the last window, into the first
+window on the screen. Given a numeric argument, @samp{C-x o} moves over
+that many windows. A negative argument causes @samp{C-x o} to select
+the previous window on the screen.
+
+@item @code{M-x prev-window}
+@findex prev-window
+Select the previous window on the screen. This is identical to
+@samp{C-x o} with a negative argument.
+
+@item @code{C-x 2} (@code{split-window})
+@cindex windows, creating
+@kindex C-x 2
+@findex split-window
+Split the current window into two windows, both showing the same node.
+Each window is one half the size of the original window, and the cursor
+remains in the original window. The variable @code{automatic-tiling}
+can cause all of the windows on the screen to be resized for you
+automatically, please @pxref{Variables, , automatic-tiling} for more
+information.
+
+@item @code{C-x 0} (@code{delete-window})
+@cindex windows, deleting
+@kindex C-x 0
+@findex delete-window
+Delete the current window from the screen. If you have made too many
+windows and your screen appears cluttered, this is the way to get rid of
+some of them.
+
+@item @code{C-x 1} (@code{keep-one-window})
+@kindex C-x 1
+@findex keep-one-window
+Delete all of the windows excepting the current one.
+
+@item @code{ESC C-v} (@code{scroll-other-window})
+@kindex ESC C-v, in Info windows
+@findex scroll-other-window
+Scroll the other window, in the same fashion that @samp{C-v} might
+scroll the current window. Given a negative argument, scroll the
+"other" window backward.
+
+@item @code{C-x ^} (@code{grow-window})
+@kindex C-x ^
+@findex grow-window
+Grow (or shrink) the current window. Given a numeric argument, grow
+the current window that many lines; with a negative numeric argument,
+shrink the window instead.
+
+@item @code{C-x t} (@code{tile-windows})
+@cindex tiling
+@kindex C-x t
+@findex tile-windows
+Divide the available screen space among all of the visible windows.
+Each window is given an equal portion of the screen in which to display
+its contents. The variable @code{automatic-tiling} can cause
+@code{tile-windows} to be called when a window is created or deleted.
+@xref{Variables, , @code{automatic-tiling}}.
+@end table
+
+@node The Echo Area, , Basic Windows, Window Commands
+@section The Echo Area
+@cindex echo area
+
+The @dfn{echo area} is a one line window which appears at the bottom of
+the screen. It is used to display informative or error messages, and to
+read lines of input from you when that is necessary. Almost all of the
+commands available in the echo area are identical to their Emacs
+counterparts, so please refer to that documentation for greater depth of
+discussion on the concepts of editing a line of text. The following
+table briefly lists the commands that are available while input is being
+read in the echo area:
+
+@table @asis
+@item @code{C-f} (@code{echo-area-forward})
+@kindex C-f, in the echo area
+@findex echo-area-forward
+Move forward a character.
+
+@item @code{C-b} (@code{echo-area-backward})
+@kindex C-b, in the echo area
+@findex echo-area-backward
+Move backward a character.
+
+@item @code{C-a} (@code{echo-area-beg-of-line})
+@kindex C-a, in the echo area
+@findex echo-area-beg-of-line
+Move to the start of the input line.
+
+@item @code{C-e} (@code{echo-area-end-of-line})
+@kindex C-e, in the echo area
+@findex echo-area-end-of-line
+Move to the end of the input line.
+
+@item @code{M-f} (@code{echo-area-forward-word})
+@kindex M-f, in the echo area
+@findex echo-area-forward-word
+Move forward a word.
+
+@item @code{M-b} (@code{echo-area-backward-word})
+@kindex M-b, in the echo area
+@findex echo-area-backward-word
+Move backward a word.
+
+@item @code{C-d} (@code{echo-area-delete})
+@kindex C-d, in the echo area
+@findex echo-area-delete
+Delete the character under the cursor.
+
+@item @code{DEL} (@code{echo-area-rubout})
+@kindex DEL, in the echo area
+@findex echo-area-rubout
+Delete the character behind the cursor.
+
+@item @code{C-g} (@code{echo-area-abort})
+@kindex C-g, in the echo area
+@findex echo-area-abort
+Cancel or quit the current operation. If completion is being read,
+@samp{C-g} discards the text of the input line which does not match any
+completion. If the input line is empty, @samp{C-g} aborts the calling
+function.
+
+@item @code{RET} (@code{echo-area-newline})
+@kindex RET, in the echo area
+@findex echo-area-newline
+Accept (or forces completion of) the current input line.
+
+@item @code{C-q} (@code{echo-area-quoted-insert})
+@kindex C-q, in the echo area
+@findex echo-area-quoted-insert
+Insert the next character verbatim. This is how you can insert control
+characters into a search string, for example.
+
+@item @var{printing character} (@code{echo-area-insert})
+@kindex printing characters, in the echo area
+@findex echo-area-insert
+Insert the character.
+
+@item @code{M-TAB} (@code{echo-area-tab-insert})
+@kindex M-TAB, in the echo area
+@findex echo-area-tab-insert
+Insert a TAB character.
+
+@item @code{C-t} (@code{echo-area-transpose-chars})
+@kindex C-t, in the echo area
+@findex echo-area-transpose-chars
+Transpose the characters at the cursor.
+@end table
+
+The next group of commands deal with @dfn{killing}, and @dfn{yanking}
+text. For an in depth discussion of killing and yanking,
+@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
+
+@table @asis
+@item @code{M-d} (@code{echo-area-kill-word})
+@kindex M-d, in the echo area
+@findex echo-area-kill-word
+Kill the word following the cursor.
+
+@item @code{M-DEL} (@code{echo-area-backward-kill-word})
+@kindex M-DEL, in the echo area
+@findex echo-area-backward-kill-word
+Kill the word preceding the cursor.
+
+@item @code{C-k} (@code{echo-area-kill-line})
+@kindex C-k, in the echo area
+@findex echo-area-kill-line
+Kill the text from the cursor to the end of the line.
+
+@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
+@kindex C-x DEL, in the echo area
+@findex echo-area-backward-kill-line
+Kill the text from the cursor to the beginning of the line.
+
+@item @code{C-y} (@code{echo-area-yank})
+@kindex C-y, in the echo area
+@findex echo-area-yank
+Yank back the contents of the last kill.
+
+@item @code{M-y} (@code{echo-area-yank-pop})
+@kindex M-y, in the echo area
+@findex echo-area-yank-pop
+Yank back a previous kill, removing the last yanked text first.
+@end table
+
+Sometimes when reading input in the echo area, the command that needed
+input will only accept one of a list of several choices. The choices
+represent the @dfn{possible completions}, and you must respond with one
+of them. Since there are a limited number of responses you can make,
+Info allows you to abbreviate what you type, only typing as much of the
+response as is necessary to uniquely identify it. In addition, you can
+request Info to fill in as much of the response as is possible; this
+is called @dfn{completion}.
+
+The following commands are available when completing in the echo area:
+
+@table @asis
+@item @code{TAB} (@code{echo-area-complete})
+@itemx @code{SPC}
+@kindex TAB, in the echo area
+@kindex SPC, in the echo area
+@findex echo-area-complete
+Insert as much of a completion as is possible.
+
+@item @code{?} (@code{echo-area-possible-completions})
+@kindex ?, in the echo area
+@findex echo-area-possible-completions
+Display a window containing a list of the possible completions of what
+you have typed so far. For example, if the available choices are:
+
+@example
+@group
+bar
+foliate
+food
+forget
+@end group
+@end example
+
+@noindent
+and you have typed an @samp{f}, followed by @samp{?}, the possible
+completions would contain:
+
+@example
+@group
+foliate
+food
+forget
+@end group
+@end example
+
+@noindent
+i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC}
+or @key{TAB} would result in @samp{fo} appearing in the echo area, since
+all of the choices which begin with @samp{f} continue with @samp{o}.
+Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
+appearing in the echo area, since that is the only choice which begins
+with @samp{fol}.
+
+@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
+@kindex ESC C-v, in the echo area
+@findex echo-area-scroll-completions-window
+Scroll the completions window, if that is visible, or the "other"
+window if not.
+@end table
+
+@node Printing Nodes, Miscellaneous Commands, Window Commands, Top
+@chapter Printing Out Nodes
+@cindex printing
+
+You may wish to print out the contents of a node as a quick reference
+document for later use. Info provides you with a command for doing
+this. In general, we recommend that you use @TeX{} to format the
+document and print sections of it, by running @code{tex} on the Texinfo
+source file.
+
+@table @asis
+@item @code{M-x print-node}
+@findex print-node
+@cindex INFO_PRINT_COMMAND, environment variable
+Pipe the contents of the current node through the command in the
+environment variable @code{INFO_PRINT_COMMAND}. If the variable does not
+exist, the node is simply piped to @code{lpr}.
+@end table
+
+@node Miscellaneous Commands, Variables, Printing Nodes, Top
+@chapter Miscellaneous Commands
+
+GNU Info contains several commands which self-document GNU Info:
+
+@table @asis
+@item @code{M-x describe-command}
+@cindex functions, describing
+@cindex commands, describing
+@findex describe-command
+Read the name of an Info command in the echo area and then display a
+brief description of what that command does.
+
+@item @code{M-x describe-key}
+@cindex keys, describing
+@findex describe-key
+Read a key sequence in the echo area, and then display the name and
+documentation of the Info command that the key sequence invokes.
+
+@item @code{M-x describe-variable}
+Read the name of a variable in the echo area and then display a brief
+description of what the variable affects.
+
+@item @code{M-x where-is}
+@findex where-is
+Read the name of an Info command in the echo area, and then display
+a key sequence which can be typed in order to invoke that command.
+
+@item @code{C-h} (@code{get-help-window})
+@itemx @code{?}
+@kindex C-h
+@kindex ?, in Info windows
+@findex get-help-window
+Create (or Move into) the window displaying @code{*Help*}, and place
+a node containing a quick reference card into it. This window displays
+the most concise information about GNU Info available.
+
+@item @code{h} (@code{get-info-help-node})
+@kindex h
+@findex get-info-help-node
+Try hard to visit the node @code{(info)Help}. The Info file
+@file{info.texi} distributed with GNU Info contains this node. Of
+course, the file must first be processed with @code{makeinfo}, and then
+placed into the location of your Info directory.
+@end table
+
+Here are the commands for creating a numeric argument:
+
+@table @asis
+@item @code{C-u} (@code{universal-argument})
+@cindex numeric arguments
+@kindex C-u
+@findex universal-argument
+Start (or multiply by 4) the current numeric argument. @samp{C-u} is
+a good way to give a small numeric argument to cursor movement or
+scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
+@samp{C-u C-u C-n} moves the cursor down 16 lines.
+
+@item @code{M-1} (@code{add-digit-to-numeric-arg})
+@itemx @code{M-2} @dots{} @code{M-9}
+@kindex M-1 @dots{} M-9
+@findex add-digit-to-numeric-arg
+Add the digit value of the invoking key to the current numeric
+argument. Once Info is reading a numeric argument, you may just type
+the digits of the argument, without the Meta prefix. For example, you
+might give @samp{C-l} a numeric argument of 32 by typing:
+
+@example
+@kbd{C-u 3 2 C-l}
+@end example
+
+@noindent
+or
+
+@example
+@kbd{M-3 2 C-l}
+@end example
+@end table
+
+@samp{C-g} is used to abort the reading of a multi-character key
+sequence, to cancel lengthy operations (such as multi-file searches) and
+to cancel reading input in the echo area.
+
+@table @asis
+@item @code{C-g} (@code{abort-key})
+@cindex cancelling typeahead
+@cindex cancelling the current operation
+@kindex C-g, in Info windows
+@findex abort-key
+Cancel current operation.
+@end table
+
+The @samp{q} command of Info simply quits running Info.
+
+@table @asis
+@item @code{q} (@code{quit})
+@cindex quitting
+@kindex q
+@findex quit
+Exit GNU Info.
+@end table
+
+If the operating system tells GNU Info that the screen is 60 lines tall,
+and it is actually only 40 lines tall, here is a way to tell Info that
+the operating system is correct.
+
+@table @asis
+@item @code{M-x set-screen-height}
+@findex set-screen-height
+@cindex screen, changing the height of
+Read a height value in the echo area and set the height of the
+displayed screen to that value.
+@end table
+
+Finally, Info provides a convenient way to display footnotes which might
+be associated with the current node that you are viewing:
+
+@table @asis
+@item @code{ESC C-f} (@code{show-footnotes})
+@kindex ESC C-f
+@findex show-footnotes
+@cindex footnotes, displaying
+Show the footnotes (if any) associated with the current node in another
+window. You can have Info automatically display the footnotes
+associated with a node when the node is selected by setting the variable
+@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}.
+@end table
+
+@node Variables, GNU Info Global Index, Miscellaneous Commands, Top
+@chapter Manipulating Variables
+
+GNU Info contains several @dfn{variables} whose values are looked at by
+various Info commands. You can change the values of these variables,
+and thus change the behavior of Info to more closely match your
+environment and Info file reading manner.
+
+@table @asis
+@item @code{M-x set-variable}
+@cindex variables, setting
+@findex set-variable
+Read the name of a variable, and the value for it, in the echo area and
+then set the variable to that value. Completion is available when
+reading the variable name; often, completion is available when reading
+the value to give to the variable, but that depends on the variable
+itself. If a variable does @emph{not} supply multiple choices to
+complete over, it expects a numeric value.
+
+@item @code{M-x describe-variable}
+@cindex variables, describing
+@findex describe-variable
+Read the name of a variable in the echo area and then display a brief
+description of what the variable affects.
+@end table
+
+Here is a list of the variables that you can set in Info.
+
+@table @code
+@item automatic-footnotes
+@vindex automatic-footnotes
+When set to @code{On}, footnotes appear and disappear automatically.
+This variable is @code{On} by default. When a node is selected, a
+window containing the footnotes which appear in that node is created,
+and the footnotes are displayed within the new window. The window that
+Info creates to contain the footnotes is called @samp{*Footnotes*}. If
+a node is selected which contains no footnotes, and a @samp{*Footnotes*}
+window is on the screen, the @samp{*Footnotes*} window is deleted.
+Footnote windows created in this fashion are not automatically tiled so
+that they can use as little of the display as is possible.
+
+@item automatic-tiling
+@vindex automatic-tiling
+When set to @code{On}, creating or deleting a window resizes other
+windows. This variable is @code{Off} by default. Normally, typing
+@samp{C-x 2} divides the current window into two equal parts. When
+@code{automatic-tiling} is set to @code{On}, all of the windows are
+resized automatically, keeping an equal number of lines visible in each
+window. There are exceptions to the automatic tiling; specifically, the
+windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
+resized through automatic tiling; they remain their original size.
+
+@item visible-bell
+@vindex visible-bell
+When set to @code{On}, GNU Info attempts to flash the screen instead of
+ringing the bell. This variable is @code{Off} by default. Of course,
+Info can only flash the screen if the terminal allows it; in the case
+that the terminal does not allow it, the setting of this variable has no
+effect. However, you can make Info perform quietly by setting the
+@code{errors-ring-bell} variable to @code{Off}.
+
+@item errors-ring-bell
+@vindex errors-ring-bell
+When set to @code{On}, errors cause the bell to ring. The default
+setting of this variable is @code{On}.
+
+@item gc-compressed-files
+@vindex gc-compressed-files
+When set to @code{On}, Info garbage collects files which had to be
+uncompressed. The default value of this variable is @code{Off}.
+Whenever a node is visited in Info, the Info file containing that node
+is read into core, and Info reads information about the tags and nodes
+contained in that file. Once the tags information is read by Info, it
+is never forgotten. However, the actual text of the nodes does not need
+to remain in core unless a particular Info window needs it. For
+non-compressed files, the text of the nodes does not remain in core when
+it is no longer in use. But de-compressing a file can be a time
+consuming operation, and so Info tries hard not to do it twice.
+@code{gc-compressed-files} tells Info it is okay to garbage collect the
+text of the nodes of a file which was compressed on disk.
+
+@item show-index-match
+@vindex show-index-match
+When set to @code{On}, the portion of the matched search string is
+highlighted in the message which explains where the matched search
+string was found. The default value of this variable is @code{On}.
+When Info displays the location where an index match was found,
+(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
+string that you had typed is highlighted by displaying it in the inverse
+case from its surrounding characters.
+
+@item scroll-behavior
+@vindex scroll-behavior
+Control what happens when forward scrolling is requested at the end of
+a node, or when backward scrolling is requested at the beginning of a
+node. The default value for this variable is @code{Continuous}. There
+are three possible values for this variable:
+
+@table @code
+@item Continuous
+Try to get the first item in this node's menu, or failing that, the
+@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}.
+This behavior is identical to using the @samp{]}
+(@code{global-next-node}) and @samp{[} (@code{global-prev-node})
+commands.
+
+@item Next Only
+Only try to get the @samp{Next} node.
+
+@item Page Only
+Simply give up, changing nothing. If @code{scroll-behavior} is
+@code{Page Only}, no scrolling command can change the node that is being
+viewed.
+@end table
+
+@item scroll-step
+@vindex scroll-step
+The number of lines to scroll when the cursor moves out of the window.
+Scrolling happens automatically if the cursor has moved out of the
+visible portion of the node text when it is time to display. Usually
+the scrolling is done so as to put the cursor on the center line of the
+current window. However, if the variable @code{scroll-step} has a
+nonzero value, Info attempts to scroll the node text by that many lines;
+if that is enough to bring the cursor back into the window, that is what
+is done. The default value of this variable is 0, thus placing the
+cursor (and the text it is attached to) in the center of the window.
+Setting this variable to 1 causes a kind of "smooth scrolling" which
+some people prefer.
+
+@item ISO-Latin
+@cindex ISO Latin characters
+@vindex ISO-Latin
+When set to @code{On}, Info accepts and displays ISO Latin characters.
+By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
+Info that it is running in an environment where the European standard
+character set is in use, and allows you to input such characters to
+Info, as well as display them.
+@end table
+
+
+
+@c the following is incomplete
+@ignore
+@c node Info for Sys Admins
+@c chapter Info for System Administrators
+
+This text describes some common ways of setting up an Info hierarchy
+from scratch, and details the various options that are available when
+installing Info. This text is designed for the person who is installing
+GNU Info on the system; although users may find the information present
+in this section interesting, none of it is vital to understanding how to
+use GNU Info.
+
+@menu
+* Setting the INFOPATH:: Where are my Info files kept?
+* Editing the DIR node:: What goes in `DIR', and why?
+* Storing Info files:: Alternate formats allow flexibility in setups.
+* Using `localdir':: Building DIR on the fly.
+* Example setups:: Some common ways to organize Info files.
+@end menu
+
+@c node Setting the INFOPATH
+@c section Setting the INFOPATH
+
+Where are my Info files kept?
+
+@c node Editing the DIR node
+@c section Editing the DIR node
+
+What goes in `DIR', and why?
+
+@c node Storing Info files
+@c section Storing Info files
+
+Alternate formats allow flexibility in setups.
+
+@c node Using `localdir'
+@c section Using `localdir'
+
+Building DIR on the fly.
+
+@c node Example setups
+@c section Example setups
+
+Some common ways to organize Info files.
+@end ignore
+
+@node GNU Info Global Index, , Variables, Top
+@appendix Global Index
+
+@printindex cp
+
+@contents
+@bye
diff --git a/contrib/texinfo/info/info-utils.c b/contrib/texinfo/info/info-utils.c
index d9ab9a0634b3..6af3dd0e2cab 100644
--- a/contrib/texinfo/info/info-utils.c
+++ b/contrib/texinfo/info/info-utils.c
@@ -21,8 +21,15 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h> /* For "NULL". Yechhh! */
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#endif /* HAVE_STRING_H */
#include "info-utils.h"
+
#if defined (HANDLE_MAN_PAGES)
# include "man.h"
#endif /* HANDLE_MAN_PAGES */
@@ -77,7 +84,7 @@ info_parse_node (string, newlines_okay)
/* Find the closing paren. */
while (string[i] && string[i] != ')')
- i++;
+ i++;
/* Remember parsed filename. */
saven_filename (string, i);
@@ -86,7 +93,7 @@ info_parse_node (string, newlines_okay)
string += i;
if (*string)
- string++;
+ string++;
}
/* Parse out nodename. */
@@ -129,9 +136,9 @@ info_parse_label (label, node)
}
/* **************************************************************** */
-/* */
-/* Finding and Building Menus */
-/* */
+/* */
+/* Finding and Building Menus */
+/* */
/* **************************************************************** */
/* Return a NULL terminated array of REFERENCE * which represents the menu
@@ -239,23 +246,23 @@ info_references_internal (label, binding)
offset = string_in_line (":", refdef);
/* When searching for menu items, if no colon, there is no
- menu item on this line. */
+ menu item on this line. */
if (offset == -1)
- {
- if (searching_for_menu_items)
- continue;
- else
- {
- int temp;
-
- temp = skip_line (refdef);
- offset = string_in_line (":", refdef + temp);
- if (offset == -1)
- continue; /* Give up? */
- else
- offset += temp;
- }
- }
+ {
+ if (searching_for_menu_items)
+ continue;
+ else
+ {
+ int temp;
+
+ temp = skip_line (refdef);
+ offset = string_in_line (":", refdef + temp);
+ if (offset == -1)
+ continue; /* Give up? */
+ else
+ offset += temp;
+ }
+ }
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->filename = (char *)NULL;
@@ -270,32 +277,32 @@ info_references_internal (label, binding)
entry->end = refdef - binding->buffer;
/* If this reference entry continues with another ':' then the
- nodename is the same as the label. */
+ nodename is the same as the label. */
if (*refdef == ':')
- {
- entry->nodename = xstrdup (entry->label);
- }
+ {
+ entry->nodename = strdup (entry->label);
+ }
else
- {
- /* This entry continues with a specific nodename. Parse the
- nodename from the specification. */
+ {
+ /* This entry continues with a specific nodename. Parse the
+ nodename from the specification. */
- refdef += skip_whitespace_and_newlines (refdef);
+ refdef += skip_whitespace_and_newlines (refdef);
- if (searching_for_menu_items)
- info_parse_node (refdef, DONT_SKIP_NEWLINES);
- else
- info_parse_node (refdef, SKIP_NEWLINES);
+ if (searching_for_menu_items)
+ info_parse_node (refdef, DONT_SKIP_NEWLINES);
+ else
+ info_parse_node (refdef, SKIP_NEWLINES);
- if (info_parsed_filename)
- entry->filename = xstrdup (info_parsed_filename);
+ if (info_parsed_filename)
+ entry->filename = strdup (info_parsed_filename);
- if (info_parsed_nodename)
- entry->nodename = xstrdup (info_parsed_nodename);
- }
+ if (info_parsed_nodename)
+ entry->nodename = strdup (info_parsed_nodename);
+ }
add_pointer_to_array
- (entry, refs_index, refs, refs_slots, 50, REFERENCE *);
+ (entry, refs_index, refs, refs_slots, 50, REFERENCE *);
}
return (refs);
}
@@ -313,7 +320,7 @@ info_get_labeled_reference (label, references)
for (i = 0; references && (entry = references[i]); i++)
{
if (strcmp (label, entry->label) == 0)
- return (entry);
+ return (entry);
}
return ((REFERENCE *)NULL);
}
@@ -368,13 +375,13 @@ info_free_references (references)
if (references)
{
for (i = 0; references && (entry = references[i]); i++)
- {
- maybe_free (entry->label);
- maybe_free (entry->filename);
- maybe_free (entry->nodename);
+ {
+ maybe_free (entry->label);
+ maybe_free (entry->filename);
+ maybe_free (entry->nodename);
- free (entry);
- }
+ free (entry);
+ }
free (references);
}
@@ -404,24 +411,24 @@ canonicalize_whitespace (string)
for (i = 0, j = 0; string[i]; i++)
{
if (whitespace_or_newline (string[i]))
- {
- whitespace_found++;
- whitespace_loc = i;
- continue;
- }
+ {
+ whitespace_found++;
+ whitespace_loc = i;
+ continue;
+ }
else
- {
- if (whitespace_found && whitespace_loc)
- {
- whitespace_found = 0;
-
- /* Suppress whitespace at start of string. */
- if (j)
- temp[j++] = ' ';
- }
-
- temp[j++] = string[i];
- }
+ {
+ if (whitespace_found && whitespace_loc)
+ {
+ whitespace_found = 0;
+
+ /* Suppress whitespace at start of string. */
+ if (j)
+ temp[j++] = ' ';
+ }
+
+ temp[j++] = string[i];
+ }
}
/* Kill trailing whitespace. */
@@ -459,26 +466,26 @@ printed_representation (character, hpos)
else if (iscntrl (character))
{
switch (character)
- {
- case '\r':
- case '\n':
- the_rep[i++] = character;
- break;
-
- case '\t':
- {
- int tw;
-
- tw = ((hpos + 8) & 0xf8) - hpos;
- while (i < tw)
- the_rep[i++] = ' ';
- }
- break;
-
- default:
- the_rep[i++] = '^';
- the_rep[i++] = (character | 0x40);
- }
+ {
+ case '\r':
+ case '\n':
+ the_rep[i++] = character;
+ break;
+
+ case '\t':
+ {
+ int tw;
+
+ tw = ((hpos + 8) & 0xf8) - hpos;
+ while (i < tw)
+ the_rep[i++] = ' ';
+ }
+ break;
+
+ default:
+ the_rep[i++] = '^';
+ the_rep[i++] = (character | 0x40);
+ }
}
else if (character > printable_limit)
{
@@ -495,9 +502,9 @@ printed_representation (character, hpos)
/* **************************************************************** */
-/* */
-/* Functions Static To This File */
-/* */
+/* */
+/* Functions Static To This File */
+/* */
/* **************************************************************** */
/* Amount of space allocated to INFO_PARSED_FILENAME via xmalloc (). */
@@ -524,7 +531,7 @@ saven_filename (filename, len)
int len;
{
saven_string (filename, len,
- &info_parsed_filename, &parsed_filename_size);
+ &info_parsed_filename, &parsed_filename_size);
}
/* Remember NODENAME in PARSED_NODENAME. An empty NODENAME is translated
@@ -543,7 +550,7 @@ saven_nodename (nodename, len)
int len;
{
saven_string (nodename, len,
- &info_parsed_nodename, &parsed_nodename_size);
+ &info_parsed_nodename, &parsed_nodename_size);
}
/* Remember STRING in STRING_P. STRING_P should currently have STRING_SIZE_P
@@ -558,7 +565,7 @@ save_string (string, string_p, string_size_p)
if (!string || !*string)
{
if (*string_p)
- free (*string_p);
+ free (*string_p);
*string_p = (char *)NULL;
*string_size_p = 0;
@@ -566,8 +573,8 @@ save_string (string, string_p, string_size_p)
else
{
if (strlen (string) >= *string_size_p)
- *string_p = (char *)xrealloc
- (*string_p, (*string_size_p = 1 + strlen (string)));
+ *string_p = (char *)xrealloc
+ (*string_p, (*string_size_p = 1 + strlen (string)));
strcpy (*string_p, string);
}
@@ -584,7 +591,7 @@ saven_string (string, len, string_p, string_size_p)
if (!string)
{
if (*string_p)
- free (*string_p);
+ free (*string_p);
*string_p = (char *)NULL;
*string_size_p = 0;
@@ -592,7 +599,7 @@ saven_string (string, len, string_p, string_size_p)
else
{
if (len >= *string_size_p)
- *string_p = (char *)xrealloc (*string_p, (*string_size_p = 1 + len));
+ *string_p = (char *)xrealloc (*string_p, (*string_size_p = 1 + len));
strncpy (*string_p, string, len);
(*string_p)[len] = '\0';
@@ -658,7 +665,7 @@ get_internal_info_window (name)
for (win = windows; win; win = win->next)
if (internal_info_node_p (win->node) &&
- (strcmp (win->node->nodename, name) == 0))
+ (strcmp (win->node->nodename, name) == 0))
break;
return (win);
diff --git a/contrib/texinfo/info/info-utils.h b/contrib/texinfo/info/info-utils.h
index 879587c48443..e2627e17c6b9 100644
--- a/contrib/texinfo/info/info-utils.h
+++ b/contrib/texinfo/info/info-utils.h
@@ -1,5 +1,5 @@
/* info-utils.h -- Exported functions and variables from info-util.c.
- $Id: info-utils.h,v 1.3 1997/07/15 18:42:20 karl Exp $
+ $Id: info-utils.h,v 1.2 1996/10/02 22:24:11 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
@@ -22,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_UTILS_H
-#define INFO_UTILS_H
+#if !defined (_INFO_UTILS_H_)
+#define _INFO_UTILS_H_
#if !defined (HAVE_STRCHR)
# undef strchr
@@ -40,10 +40,10 @@
cross reference. Arrays of such references can be built by calling
info_menus_of_node () or info_xrefs_of_node (). */
typedef struct {
- char *label; /* User Label. */
- char *filename; /* File where this node can be found. */
- char *nodename; /* Name of the node. */
- int start, end; /* Offsets within the containing node of LABEL. */
+ char *label; /* User Label. */
+ char *filename; /* File where this node can be found. */
+ char *nodename; /* Name of the node. */
+ int start, end; /* Offsets within the containing node of LABEL. */
} REFERENCE;
/* When non-zero, various display and input functions handle ISO Latin
@@ -137,4 +137,4 @@ extern void info_parse_label (/* label, node */);
info_parse_label (INFO_ALTPREV_LABEL, n); \
} while (0)
-#endif /* not INFO_UTILS_H */
+#endif /* !_INFO_UTILS_H_ */
diff --git a/contrib/texinfo/info/info.1 b/contrib/texinfo/info/info.1
new file mode 100644
index 000000000000..63ec9a6cff1e
--- /dev/null
+++ b/contrib/texinfo/info/info.1
@@ -0,0 +1,232 @@
+.\" $Id$
+.\"
+.TH info 1 "7th December 1990"
+.SH NAME
+info \- GNU's hypertext system
+.SH SYNOPSIS
+.B info
+[
+.B \-\-option-name option-value
+]
+.B \menu-item...
+.SH COPYRIGHT
+.if n Copyright (C) 1989, 1993 Free Software Foundation, Inc.
+.if t Copyright \(co 1989, 1993 Free Software Foundation, Inc.
+.SH DESCRIPTION
+.LP
+The GNU project has a hypertext system called
+.I Info
+which allows the same source file to be either printed as a
+paper manual, or viewed using
+.B info.
+It is possible to use the
+.B info
+program from inside Emacs, or to use the stand-alone version described here.
+This manual page gives a brief summary of its capabilities.
+
+.SH OPTIONS
+.TP
+.B \-\-directory directory-path
+Add
+.B directory-path
+to the list of directory paths searched when
+.B info
+needs to find a file. You may issue
+.B \-\-directory
+multiple times.
+Alternatively, you may specify a value for the environment variable
+.B INFOPATH;
+if
+.B \-\-directory
+is not given, the value of
+.B INFOPATH
+is used. The value of
+.B INFOPATH
+is a colon separated list of directory names. If you do not supply either
+.B INFOPATH
+or
+.B \-\-directory-path,
+.B info
+uses a default path.
+.TP
+.B \-f filename
+Specify a particular
+.B info
+file to visit. By default,
+.B info
+visits
+the file
+.B dir;
+if you use this option,
+.B info
+will start with
+.B (FILENAME)Top
+as the first file and node.
+.TP
+.B \-n nodename
+Specify a particular node to visit in the initial file that
+.B info
+loads. This is especially useful in conjunction with
+.B \-\-file.
+You may specify
+.B \-\-node
+multiple times.
+.TP
+.B -o file
+Direct output to
+.B file
+instead of starting an interactive
+.B info
+session.
+.TP
+.B \-h
+Produce a relatively brief description of the available
+.B info
+options.
+.TP
+.B \-\-version
+Print the version information of
+.B info
+and exit.
+.TP
+.B menu-item
+.B info
+treats its remaining arguments as the names of menu items.
+The first argument is a menu item in the initial node visited,
+while the second argument is a menu item in the first argument's
+node. You can easily move to the node of your choice by
+specifying the menu names which describe the path to that node.
+For example,
+
+.B info emacs buffers
+
+first selects the menu item
+.B emacs
+in the node
+.B (dir)Top,
+and then selects the menu item
+.B buffers
+in the node
+.B (emacs)Top.
+.SH COMMANDS
+When in
+.B info
+the following commands are available:
+.TP
+.B h
+Invoke the Info tutorial.
+.TP
+.B ?
+Get a short summary of
+.B info
+commands.
+.TP
+.B h
+Select the
+.B info
+node from the main directory; this is much more complete than just
+using
+.B ?.
+.TP
+.B Ctrl-g
+Abort whatever you are doing.
+.TP
+.B Ctrl-l
+Redraw the screen.
+.PP
+Selecting other nodes:
+.TP
+.B n
+Move to the "next" node of this node.
+.TP
+.B p
+Move to the "previous" node of this node.
+.TP
+.B u
+Move to this node's "up" node.
+.TP
+.B m
+Pick a menu item specified by name. Picking a menu item causes another
+node to be selected. You do not need to type a complete nodename; if
+you type a few letters and then a space or tab
+.B info
+will try to fill in the rest of the nodename. If you ask for further
+completion without typing any more characters you'll be given a list
+of possibilities; you can also get the list with
+.B ?.
+If you type a few characters and then hit return
+.B info
+will try to do a completion, and if it is ambiguous use the first possibility.
+.TP
+.B f
+Follow a cross reference. You are asked for the name of the reference,
+using command completion as for
+.B m.
+.TP
+.B l
+Move to the last node you were at.
+.PP
+Moving within a node:
+.TP
+.B Space
+Scroll forward a page.
+.TP
+.B DEL
+Scroll backward a page.
+.TP
+.B b
+Go to the beginning of this node.
+.PP
+Advanced commands:
+.TP
+.B q
+Quit
+.B info.
+.TP
+.B 1
+Pick first item in node's menu.
+.TP
+.B 2 \-\- 5
+Pick second ... fifth item in node's menu.
+.TP
+.B g
+Move to node specified by name. You may include a filename as well,
+as
+.B (FILENAME)NODENAME.
+.TP
+.B s
+Search through this
+.B info
+file for a specified string, and select the node in which
+the next occurrence is found.
+.TP
+.B M-x print-node
+Pipe the contents of the current node through the command in the
+environment variable
+.B INFO_PRINT_COMMAND.
+If the variable does not exist, the node is simply piped to
+.B lpr.
+.SH ENVIRONMENT
+.TP
+.B INFOPATH
+A colon-separated list of directories to search for
+.B info
+files. Used if
+.B \-\-directory
+is not given.
+.TP
+.B INFO_PRINT_COMMAND
+The command used for printing.
+.SH SEE ALSO
+.BR man (1)
+.\" .BR emacs (1)
+.SH AUTHOR
+.RS
+Brian Fox, Free Software Foundation
+.br
+bfox@ai.mit.edu
+.SH MANUAL AUTHOR
+.RS
+Robert Lupton; updated by Robert J. Chassell.
+.br
+rhl@astro.princeton.edu; bob@gnu.ai.mit.edu
diff --git a/contrib/texinfo/info/info.c b/contrib/texinfo/info/info.c
index 81ab4608e440..223df55acb28 100644
--- a/contrib/texinfo/info/info.c
+++ b/contrib/texinfo/info/info.c
@@ -1,7 +1,9 @@
-/* info.c -- Display nodes of Info files in multiple windows.
- $Id: info.c,v 1.18 1998/02/27 21:37:27 karl Exp $
+/* info.c -- Display nodes of Info files in multiple windows. */
- Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +22,6 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h"
-#include "indices.h"
#include "dribble.h"
#include "getopt.h"
#if defined (HANDLE_MAN_PAGES)
@@ -29,10 +30,8 @@
/* The version numbers of this version of Info. */
int info_major_version = 2;
-int info_minor_version = 18;
-
-/* basename (argv[0]) */
-static char *program_name = NULL;
+int info_minor_version = 16;
+int info_patch_level = 0;
/* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
static int apropos_p = 0;
@@ -40,14 +39,6 @@ static int apropos_p = 0;
/* Variable containing the string to search for when apropos_p is non-zero. */
static char *apropos_search_string = (char *)NULL;
-/* Non-zero means search all indices for INDEX_SEARCH_STRING. Unlike
- apropos, this puts the user at the node, running info. */
-static int index_search_p = 0;
-
-/* Variable containing the string to search for when index_search_p is
- non-zero. */
-static char *index_search_string = (char *)NULL;
-
/* Non-zero means print version info only. */
static int print_version_p = 0;
@@ -79,7 +70,6 @@ int dump_subnodes = 0;
#define APROPOS_OPTION 1
#define DRIBBLE_OPTION 2
#define RESTORE_OPTION 3
-#define IDXSRCH_OPTION 4
static struct option long_options[] = {
{ "apropos", 1, 0, APROPOS_OPTION },
{ "directory", 1, 0, 'd' },
@@ -91,7 +81,6 @@ static struct option long_options[] = {
{ "version", 0, &print_version_p, 1 },
{ "dribble", 1, 0, DRIBBLE_OPTION },
{ "restore", 1, 0, RESTORE_OPTION },
- { "index-search", 1, 0, IDXSRCH_OPTION },
{NULL, 0, NULL, 0}
};
@@ -102,13 +91,13 @@ static char *short_options = "d:n:f:o:s";
int info_windows_initialized_p = 0;
/* Some "forward" declarations. */
-static void info_short_help (), remember_info_program_name ();
+static void usage (), info_short_help (), remember_info_program_name ();
/* **************************************************************** */
-/* */
-/* Main Entry Point to the Info Program */
-/* */
+/* */
+/* Main Entry Point to the Info Program */
+/* */
/* **************************************************************** */
int
@@ -116,102 +105,85 @@ main (argc, argv)
int argc;
char **argv;
{
- int getopt_long_index; /* Index returned by getopt_long (). */
- NODE *initial_node; /* First node loaded by Info. */
+ int getopt_long_index; /* Index returned by getopt_long (). */
+ NODE *initial_node; /* First node loaded by Info. */
remember_info_program_name (argv[0]);
-#ifdef HAVE_SETLOCALE
- /* Set locale via LC_ALL. */
- setlocale (LC_ALL, "");
-#endif
-
- /* Set the text message domain. */
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
while (1)
{
int option_character;
option_character = getopt_long
- (argc, argv, short_options, long_options, &getopt_long_index);
+ (argc, argv, short_options, long_options, &getopt_long_index);
/* getopt_long () returns EOF when there are no more long options. */
if (option_character == EOF)
- break;
+ break;
/* If this is a long option, then get the short version of it. */
if (option_character == 0 && long_options[getopt_long_index].flag == 0)
- option_character = long_options[getopt_long_index].val;
+ option_character = long_options[getopt_long_index].val;
/* Case on the option that we have received. */
switch (option_character)
- {
- case 0:
- break;
-
- /* User wants to add a directory. */
- case 'd':
- info_add_path (optarg, INFOPATH_PREPEND);
- break;
-
- /* User is specifying a particular node. */
- case 'n':
- add_pointer_to_array (optarg, user_nodenames_index, user_nodenames,
- user_nodenames_slots, 10, char *);
- break;
-
- /* User is specifying a particular Info file. */
- case 'f':
- if (user_filename)
- free (user_filename);
-
- user_filename = xstrdup (optarg);
- break;
-
- /* User is specifying the name of a file to output to. */
- case 'o':
- if (user_output_filename)
- free (user_output_filename);
- user_output_filename = xstrdup (optarg);
- break;
-
- /* User is specifying that she wishes to dump the subnodes of
- the node that she is dumping. */
- case 's':
- dump_subnodes = 1;
- break;
-
- /* User has specified a string to search all indices for. */
- case APROPOS_OPTION:
- apropos_p = 1;
- maybe_free (apropos_search_string);
- apropos_search_string = xstrdup (optarg);
- break;
-
- /* User has specified a dribble file to receive keystrokes. */
- case DRIBBLE_OPTION:
- close_dribble_file ();
- open_dribble_file (optarg);
- break;
-
- /* User has specified an alternate input stream. */
- case RESTORE_OPTION:
- info_set_input_from_file (optarg);
- break;
-
- /* User has specified a string to search all indices for. */
- case IDXSRCH_OPTION:
- index_search_p = 1;
- maybe_free (index_search_string);
- index_search_string = xstrdup (optarg);
- break;
-
- default:
- fprintf (stderr, _("Try --help for more information."));
- exit (1);
- }
+ {
+ case 0:
+ break;
+
+ /* User wants to add a directory. */
+ case 'd':
+ info_add_path (optarg, INFOPATH_PREPEND);
+ break;
+
+ /* User is specifying a particular node. */
+ case 'n':
+ add_pointer_to_array (optarg, user_nodenames_index, user_nodenames,
+ user_nodenames_slots, 10, char *);
+ break;
+
+ /* User is specifying a particular Info file. */
+ case 'f':
+ if (user_filename)
+ free (user_filename);
+
+ user_filename = strdup (optarg);
+ break;
+
+ /* User is specifying the name of a file to output to. */
+ case 'o':
+ if (user_output_filename)
+ free (user_output_filename);
+ user_output_filename = strdup (optarg);
+ break;
+
+ /* User is specifying that she wishes to dump the subnodes of
+ the node that she is dumping. */
+ case 's':
+ dump_subnodes = 1;
+ break;
+
+ /* User has specified a string to search all indices for. */
+ case APROPOS_OPTION:
+ apropos_p = 1;
+ maybe_free (apropos_search_string);
+ apropos_search_string = strdup (optarg);
+ break;
+
+ /* User has specified a dribble file to receive keystrokes. */
+ case DRIBBLE_OPTION:
+ close_dribble_file ();
+ open_dribble_file (optarg);
+ break;
+
+ /* User has specified an alternate input stream. */
+ case RESTORE_OPTION:
+ info_set_input_from_file (optarg);
+ break;
+
+ default:
+ usage ();
+ }
}
/* If the output device is not a terminal, and no output filename has been
@@ -219,20 +191,18 @@ main (argc, argv)
to stdout, and turn on the dumping of subnodes. */
if ((!isatty (fileno (stdout))) && (user_output_filename == (char *)NULL))
{
- user_output_filename = xstrdup ("-");
+ user_output_filename = strdup ("-");
dump_subnodes = 1;
}
/* If the user specified --version, then show the version and exit. */
if (print_version_p)
{
- printf ("%s (GNU %s %s) %s\n", program_name, PACKAGE, VERSION,
- version_string ());
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ printf ("GNU Info (Texinfo 3.9) %s\n", version_string ());
+ puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.\n"),
- "1998");
+For more information about these matters, see the files named COPYING.");
exit (0);
}
@@ -243,49 +213,34 @@ For more information about these matters, see the files named COPYING.\n"),
exit (0);
}
- /* If the user hasn't specified a path for Info files, default it.
- Lowest priority is our messy hardwired list in filesys.h.
- Then comes the user's INFODIR from the Makefile.
- Highest priority is the environment variable, if set. */
+ /* If the user hasn't specified a path for Info files, default that path
+ now. */
if (!infopath)
{
- char *path_from_env = getenv ("INFOPATH");
+ char *path_from_env, *getenv ();
+
+ path_from_env = getenv ("INFOPATH");
if (path_from_env)
- {
- unsigned len = strlen (path_from_env);
- /* Trailing : on INFOPATH means insert the default path. */
- if (len && path_from_env[len - 1] == ':')
- {
- path_from_env[len - 1] = 0;
- info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
- }
-#ifdef INFODIR /* from the Makefile */
- info_add_path (INFODIR, INFOPATH_PREPEND);
-#endif
- info_add_path (path_from_env, INFOPATH_PREPEND);
- }
+ info_add_path (path_from_env, INFOPATH_PREPEND);
else
- {
- info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
-#ifdef INFODIR /* from the Makefile */
- info_add_path (INFODIR, INFOPATH_PREPEND);
-#endif
- }
+ info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
}
/* If the user specified a particular filename, add the path of that
file to the contents of INFOPATH. */
if (user_filename)
{
- char *directory_name = xstrdup (user_filename);
- char *temp = filename_non_directory (directory_name);
+ char *directory_name, *temp;
+
+ directory_name = strdup (user_filename);
+ temp = filename_non_directory (directory_name);
if (temp != directory_name)
- {
- *temp = 0;
- info_add_path (directory_name, INFOPATH_PREPEND);
- }
+ {
+ *temp = 0;
+ info_add_path (directory_name, INFOPATH_PREPEND);
+ }
free (directory_name);
}
@@ -300,74 +255,39 @@ For more information about these matters, see the files named COPYING.\n"),
/* Get the initial Info node. It is either "(dir)Top", or what the user
specifed with values in user_filename and user_nodenames. */
- initial_node = info_get_node (user_filename,
- user_nodenames ? user_nodenames[0] : NULL);
+ if (user_nodenames)
+ initial_node = info_get_node (user_filename, user_nodenames[0]);
+ else
+ initial_node = info_get_node (user_filename, (char *)NULL);
/* If we couldn't get the initial node, this user is in trouble. */
if (!initial_node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- info_error
- (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
+ info_error
+ (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
exit (1);
}
- /* Special cases for when the user specifies multiple nodes. If we
- are dumping to an output file, dump all of the nodes specified.
- Otherwise, attempt to create enough windows to handle the nodes
- that this user wants displayed. */
+ /* Special cases for when the user specifies multiple nodes. If we are
+ dumping to an output file, dump all of the nodes specified. Otherwise,
+ attempt to create enough windows to handle the nodes that this user wants
+ displayed. */
if (user_nodenames_index > 1)
{
free (initial_node);
if (user_output_filename)
- dump_nodes_to_file
- (user_filename, user_nodenames, user_output_filename, dump_subnodes);
+ dump_nodes_to_file
+ (user_filename, user_nodenames, user_output_filename, dump_subnodes);
else
- begin_multiple_window_info_session (user_filename, user_nodenames);
+ begin_multiple_window_info_session (user_filename, user_nodenames);
exit (0);
}
- /* If the user specified `--index-search=STRING', start the info
- session in the node corresponding to the first match. */
- if (index_search_p)
- {
- int status = 0;
-
- initialize_info_session (initial_node, 0);
-
- if (index_entry_exists (windows, index_search_string))
- {
- terminal_clear_screen ();
- terminal_prep_terminal ();
- display_update_display (windows);
- info_last_executed_command = (VFunction *)NULL;
-
- do_info_index_search (windows, 0, index_search_string);
-
- info_read_and_dispatch ();
-
- terminal_unprep_terminal ();
-
- /* On program exit, leave the cursor at the bottom of the
- window, and restore the terminal IO. */
- terminal_goto_xy (0, screenheight - 1);
- terminal_clear_to_eol ();
- fflush (stdout);
- }
- else
- {
- fputs (_("no entries found\n"), stderr);
- status = 2;
- }
-
- close_dribble_file ();
- exit (status);
- }
-
/* If there are arguments remaining, they are the names of menu items
in sequential info files starting from the first one loaded. That
file name is either "dir", or the contents of user_filename if one
@@ -383,134 +303,134 @@ For more information about these matters, see the files named COPYING.\n"),
/* Remember the name of the menu entry we want. */
arg = argv[optind++];
- if (!first_arg)
- first_arg = arg;
+ if (first_arg == (char *)NULL)
+ first_arg = arg;
/* Build and return a list of the menu items in this node. */
menu = info_menu_of_node (initial_node);
/* If there wasn't a menu item in this node, stop here, but let
- the user continue to use Info. Perhaps they wanted this node
- and didn't realize it. */
+ the user continue to use Info. Perhaps they wanted this node
+ and didn't realize it. */
if (!menu)
- {
+ {
#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if (first_arg == arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
- begin_info_session_with_error
- (initial_node, _("There is no menu in this node."));
- exit (0);
- }
+ begin_info_session_with_error
+ (initial_node, "There is no menu in this node.");
+ exit (0);
+ }
/* Find the specified menu item. */
entry = info_get_labeled_reference (arg, menu);
/* If the item wasn't found, search the list sloppily. Perhaps this
- user typed "buffer" when they really meant "Buffers". */
+ user typed "buffer" when they really meant "Buffers". */
if (!entry)
- {
- register int i;
- int best_guess = -1;
-
- for (i = 0; (entry = menu[i]); i++)
- {
- if (strcasecmp (entry->label, arg) == 0)
- break;
- else
- if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
- best_guess = i;
- }
-
- if (!entry && best_guess != -1)
- entry = menu[best_guess];
- }
+ {
+ register int i;
+ int best_guess = -1;
+
+ for (i = 0; entry = menu[i]; i++)
+ {
+ if (strcasecmp (entry->label, arg) == 0)
+ break;
+ else
+ if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
+ best_guess = i;
+ }
+
+ if (!entry && best_guess != -1)
+ entry = menu[best_guess];
+ }
/* If we failed to find the reference, start Info with the current
- node anyway. It is probably a misspelling. */
+ node anyway. It is probably a misspelling. */
if (!entry)
- {
- char *error_message = _("There is no menu item \"%s\" in this node.");
+ {
+ char *error_message = "There is no menu item \"%s\" in this node.";
#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if (first_arg == arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
- info_free_references (menu);
+ info_free_references (menu);
- /* If we were supposed to dump this node, complain. */
- if (user_output_filename)
- info_error (error_message, arg);
- else
- begin_info_session_with_error (initial_node, error_message, arg);
+ /* If we were supposed to dump this node, complain. */
+ if (user_output_filename)
+ info_error (error_message, arg);
+ else
+ begin_info_session_with_error (initial_node, error_message, arg);
- exit (0);
- }
+ exit (0);
+ }
/* We have found the reference that the user specified. Clean it
- up a little bit. */
+ up a little bit. */
if (!entry->filename)
- {
- if (initial_node->parent)
- entry->filename = xstrdup (initial_node->parent);
- else
- entry->filename = xstrdup (initial_node->filename);
- }
+ {
+ if (initial_node->parent)
+ entry->filename = strdup (initial_node->parent);
+ else
+ entry->filename = strdup (initial_node->filename);
+ }
/* Find this node. If we can find it, then turn the initial_node
- into this one. If we cannot find it, try using the label of the
- entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
- malformed in some way, and we will just use the current value of
- initial node. */
+ into this one. If we cannot find it, try using the label of the
+ entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
+ malformed in some way, and we will just use the current value of
+ initial node. */
node = info_get_node (entry->filename, entry->nodename);
#if defined (HANDLE_MAN_PAGES)
- if ((first_arg == arg) && !node)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if ((first_arg == arg) && !node)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
if (!node && entry->nodename &&
- (strcmp (entry->label, entry->nodename) == 0))
- node = info_get_node (entry->label, "Top");
+ (strcmp (entry->label, entry->nodename) == 0))
+ node = info_get_node (entry->label, "Top");
maybe_got_node:
if (node)
- {
- free (initial_node);
- initial_node = node;
- info_free_references (menu);
- }
+ {
+ free (initial_node);
+ initial_node = node;
+ info_free_references (menu);
+ }
else
- {
- char *temp = xstrdup (entry->label);
- char *error_message;
+ {
+ char *temp = strdup (entry->label);
+ char *error_message;
- error_message = _("Unable to find the node referenced by \"%s\".");
+ error_message = "Unable to find the node referenced by \"%s\".";
- info_free_references (menu);
+ info_free_references (menu);
- /* If we were trying to dump the node, then give up. Otherwise,
- start the session with an error message. */
- if (user_output_filename)
- info_error (error_message, temp);
- else
- begin_info_session_with_error (initial_node, error_message, temp);
+ /* If we were trying to dump the node, then give up. Otherwise,
+ start the session with an error message. */
+ if (user_output_filename)
+ info_error (error_message, temp);
+ else
+ begin_info_session_with_error (initial_node, error_message, temp);
- exit (0);
- }
+ exit (0);
+ }
}
/* If the user specified that this node should be output, then do that
@@ -533,12 +453,19 @@ version_string ()
{
vstring = (char *)xmalloc (50);
sprintf (vstring, "%d.%d", info_major_version, info_minor_version);
+ if (info_patch_level)
+ sprintf (vstring + strlen (vstring), "-p%d", info_patch_level);
}
return (vstring);
}
-
-/* Error handling. */
+/* **************************************************************** */
+/* */
+/* Error Handling for Info */
+/* */
+/* **************************************************************** */
+
+static char *program_name = (char *)NULL;
static void
remember_info_program_name (fullpath)
@@ -547,7 +474,7 @@ remember_info_program_name (fullpath)
char *filename;
filename = filename_non_directory (fullpath);
- program_name = xstrdup (filename);
+ program_name = strdup (filename);
}
/* Non-zero if an error has been signalled. */
@@ -576,52 +503,63 @@ info_error (format, arg1, arg2)
else
{
if (!echo_area_is_active)
- {
- if (info_error_rings_bell_p)
- terminal_ring_bell ();
- window_message_in_echo_area (format, arg1, arg2);
- }
+ {
+ if (info_error_rings_bell_p)
+ terminal_ring_bell ();
+ window_message_in_echo_area (format, arg1, arg2);
+ }
else
- {
- NODE *temp;
-
- temp = build_message_node (format, arg1, arg2);
- if (info_error_rings_bell_p)
- terminal_ring_bell ();
- inform_in_echo_area (temp->contents);
- free (temp->contents);
- free (temp);
- }
+ {
+ NODE *temp;
+
+ temp = build_message_node (format, arg1, arg2);
+ if (info_error_rings_bell_p)
+ terminal_ring_bell ();
+ inform_in_echo_area (temp->contents);
+ free (temp->contents);
+ free (temp);
+ }
}
}
+/* Produce a very brief descripton of the available options and exit with
+ an error. */
+static void
+usage ()
+{
+ fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n",
+"Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...",
+" [--directory dir-path] [--file info-file] [--node node-name]...",
+" [--help] [--output output-file] [--subnodes] [--version]",
+" [--dribble dribble-file] [--restore from-file]",
+" [menu-selection ...]");
+ exit (1);
+}
+
/* Produce a scaled down description of the available options to Info. */
static void
info_short_help ()
{
- printf (_("\
-Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
-\n\
-Read documentation in Info format.\n\
-For more complete documentation on how to use Info, run `info info options'.\n\
+ puts ("\
+Here is a quick description of Info's options. For a more complete\n\
+description of how to use Info, type `info info options'.\n\
\n\
-Options:\n\
---directory DIR add DIR to INFOPATH.\n\
---dribble FILENAME remember user keystrokes in FILENAME.\n\
---file FILENAME specify Info file to visit.\n\
---node NODENAME specify nodes in first visited Info file.\n\
---output FILENAME output selected nodes to FILENAME.\n\
---restore FILENAME read initial keystrokes from FILENAME.\n\
---subnodes recursively output menu items.\n\
---help display this help and exit.\n\
---version display version information and exit.\n\
+ --directory DIR Add DIR to INFOPATH.\n\
+ --dribble FILENAME Remember user keystrokes in FILENAME.\n\
+ --file FILENAME Specify Info file to visit.\n\
+ --node NODENAME Specify nodes in first visited Info file.\n\
+ --output FILENAME Output selected nodes to FILENAME.\n\
+ --restore FILENAME Read initial keystrokes from FILENAME.\n\
+ --subnodes Recursively output menu items.\n\
+ --help Get this help message.\n\
+ --version Display Info's version information.\n\
\n\
-The first argument, if present, is the name of the Info file to read.\n\
-Any remaining arguments are treated as the names of menu\n\
-items in the initial node visited. For example, `info emacs buffers'\n\
-moves to the node `buffers' in the info file `emacs'.\n\
+Remaining arguments to Info are treated as the names of menu\n\
+items in the initial node visited. You can easily move to the\n\
+node of your choice by specifying the menu names which describe\n\
+the path to that node. For example, `info emacs buffers'.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org."), program_name);
+Email bug reports to bug-texinfo@prep.ai.mit.edu.");
exit (0);
}
diff --git a/contrib/texinfo/info/info.h b/contrib/texinfo/info/info.h
index 092ef4128369..a8759227758a 100644
--- a/contrib/texinfo/info/info.h
+++ b/contrib/texinfo/info/info.h
@@ -1,10 +1,9 @@
-/* info.h -- Header file which includes all of the other headers.
- $Id: info.h,v 1.7 1998/02/27 21:36:04 karl Exp $
+/* info.h -- Header file which includes all of the other headers. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,86 +21,33 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (INFO_H)
-#define INFO_H
-
-/* We always want these, so why clutter up the compile command? */
-#define HANDLE_MAN_PAGES
-#define NAMED_FUNCTIONS
-
-/* System dependencies. */
-#include "system.h"
-
-/* Some of our other include files use these. */
-typedef int Function ();
-typedef void VFunction ();
-typedef char *CFunction ();
-
+#if !defined (_INFO_H_)
+#define _INFO_H_
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined (HAVE_STRING_H)
+#include <string.h>
+#endif /* HAVE_STRING_H */
#include "filesys.h"
#include "display.h"
#include "session.h"
-#include "echo-area.h"
+#include "echo_area.h"
#include "doc.h"
#include "footnotes.h"
#include "gc.h"
-#define info_toupper(x) (islower (x) ? toupper (x) : x)
-#define info_tolower(x) (isupper (x) ? tolower (x) : x)
-
-#if !defined (whitespace)
-# define whitespace(c) ((c == ' ') || (c == '\t'))
-#endif /* !whitespace */
-
-#if !defined (whitespace_or_newline)
-# define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
-#endif /* !whitespace_or_newline */
-
-/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
- of slots that have already been allocated. INDEX is the index into the
- array where POINTER should be added. GROW is the number of slots to grow
- ARRAY by, in the case that it needs growing. TYPE is a cast of the type
- of object stored in ARRAY (e.g., NODE_ENTRY *. */
-#define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
- do { \
- if (idx + 2 >= slots) \
- array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
- array[idx++] = (type)pointer; \
- array[idx] = (type)NULL; \
- } while (0)
-
-#define maybe_free(x) do { if (x) free (x); } while (0)
-
-#if !defined (zero_mem) && defined (HAVE_MEMSET)
-# define zero_mem(mem, length) memset (mem, 0, length)
-#endif /* !zero_mem && HAVE_MEMSET */
-
-#if !defined (zero_mem) && defined (HAVE_BZERO)
-# define zero_mem(mem, length) bzero (mem, length)
-#endif /* !zero_mem && HAVE_BZERO */
-
-#if !defined (zero_mem)
-# define zero_mem(mem, length) \
- do { \
- register int zi; \
- register unsigned char *place; \
- \
- place = (unsigned char *)mem; \
- for (zi = 0; zi < length; zi++) \
- place[zi] = 0; \
- } while (0)
-#endif /* !zero_mem */
-
-
/* A structure associating the nodes visited in a particular window. */
typedef struct {
- WINDOW *window; /* The window that this list is attached to. */
- NODE **nodes; /* Array of nodes visited in this window. */
- int *pagetops; /* For each node in NODES, the pagetop. */
- long *points; /* For each node in NODES, the point. */
- int current; /* Index in NODES of the current node. */
- int nodes_index; /* Index where to add the next node. */
- int nodes_slots; /* Number of slots allocated to NODES. */
+ WINDOW *window; /* The window that this list is attached to. */
+ NODE **nodes; /* Array of nodes visited in this window. */
+ int *pagetops; /* For each node in NODES, the pagetop. */
+ long *points; /* For each node in NODES, the point. */
+ int current; /* Index in NODES of the current node. */
+ int nodes_index; /* Index where to add the next node. */
+ int nodes_slots; /* Number of slots allocated to NODES. */
} INFO_WINDOW;
/* Array of structures describing for each window which nodes have been
@@ -125,41 +71,30 @@ extern int info_error_rings_bell_p;
extern void info_error ();
/* The version numbers of Info. */
-extern int info_major_version, info_minor_version;
+extern int info_major_version, info_minor_version, info_patch_level;
/* How to get the version string for this version of Info. Returns
something similar to "2.11". */
extern char *version_string ();
/* Error message defines. */
-#define CANT_FIND_NODE _("Cannot find the node \"%s\".")
-#define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
-#define CANT_FIND_WIND _("Cannot find a window!")
-#define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
-#define CANT_KILL_LAST _("Cannot delete the last window.")
-#define NO_MENU_NODE _("No menu in this node.")
-#define NO_FOOT_NODE _("No footnotes in this node.")
-#define NO_XREF_NODE _("No cross references in this node.")
-#define NO_POINTER _("No \"%s\" pointer for this node.")
-#define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
-#define TERM_TOO_DUMB _("Terminal type \"%s\" is not smart enough to run Info.")
-#define AT_NODE_BOTTOM _("You are already at the last page of this node.")
-#define AT_NODE_TOP _("You are already at the first page of this node.")
-#define ONE_WINDOW _("Only one window.")
-#define WIN_TOO_SMALL _("Resulting window would be too small.")
-#define CANT_MAKE_HELP \
-_("There isn't enough room to make a help window. Please delete a window.")
-
-
-/* Found in info-utils.c. */
-extern char *filename_non_directory ();
-
-#if !defined (BUILDING_LIBRARY)
-/* Found in session.c */
-extern int info_windows_initialized_p;
-
-/* Found in window.c. */
-extern void message_in_echo_area (), unmessage_in_echo_area ();
-#endif /* !BUILDING_LIBRARY */
+#define CANT_FIND_NODE "Cannot find the node \"%s\"."
+#define CANT_FILE_NODE "Cannot find the node \"(%s)%s\"."
+#define CANT_FIND_WIND "Cannot find a window!"
+#define CANT_FIND_POINT "Point doesn't appear within this window's node!"
+#define CANT_KILL_LAST "Cannot delete the last window."
+#define NO_MENU_NODE "No menu in this node."
+#define NO_FOOT_NODE "No footnotes in this node."
+#define NO_XREF_NODE "No cross references in this node."
+#define NO_POINTER "No \"%s\" pointer for this node."
+#define UNKNOWN_COMMAND "Unknown Info command `%c'. `?' for help."
+#define TERM_TOO_DUMB "Terminal type \"%s\" is not smart enough to run Info."
+#define AT_NODE_BOTTOM "You are already at the last page of this node."
+#define AT_NODE_TOP "You are already at the first page of this node."
+#define ONE_WINDOW "Only one window."
+#define WIN_TOO_SMALL "Resulting window would be too small."
+#define CANT_MAKE_HELP \
+"There isn't enough room to make a help window. Please delete a window."
+
+#endif /* !_INFO_H_ */
-#endif /* !INFO_H */
diff --git a/contrib/texinfo/info/info.texi b/contrib/texinfo/info/info.texi
new file mode 100644
index 000000000000..cfdf78239482
--- /dev/null
+++ b/contrib/texinfo/info/info.texi
@@ -0,0 +1,916 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename info.info
+@settitle Info 1.0
+@comment %**end of header
+@comment $Id: info.texi,v 1.5 1996/09/29 16:58:42 karl Exp $
+
+@dircategory Texinfo documentation system
+@direntry
+* Info: (info). Documentation browsing system.
+@end direntry
+
+@ifinfo
+This file describes how to use Info,
+the on-line, menu-driven GNU documentation system.
+
+Copyright (C) 1989, 92, 96 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end ifinfo
+
+@titlepage
+@sp 11
+@center @titlefont{Info}
+@sp 2
+@center The
+@sp 2
+@center On-line, Menu-driven
+@sp 2
+@center GNU Documentation System
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1989, 1992, 1993 Free Software Foundation, Inc.
+@sp 2
+
+Published by the Free Software Foundation @*
+59 Temple Place - Suite 330 @*
+Boston, MA 02111-1307, USA.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end titlepage
+
+@ifinfo
+@node Top, Getting Started, (dir), (dir)
+@top Info: An Introduction
+
+Info is a program for reading documentation, which you are using now.
+
+To learn how to use Info, type the command @kbd{h}. It brings you
+to a programmed instruction sequence.
+
+@c Need to make sure that `Info-help' goes to the right node,
+@c which is the first node of the first chapter. (It should.)
+@c (Info-find-node "info"
+@c (if (< (window-height) 23)
+@c "Help-Small-Screen"
+@c "Help")))
+
+To learn advanced Info commands, type @kbd{n} twice. This brings you to
+@cite{Info for Experts}, skipping over the `Getting Started' chapter.
+@end ifinfo
+
+@menu
+* Getting Started:: Getting started using an Info reader.
+* Advanced Info:: Advanced commands within Info.
+* Create an Info File:: How to make your own Info file.
+* The Standalone Info Program: (info-stnd.info).
+@end menu
+
+@node Getting Started, Advanced Info, Top, Top
+@comment node-name, next, previous, up
+@chapter Getting Started
+
+This first part of the Info manual describes how to get around inside
+of Info. The second part of the manual describes various advanced
+Info commands, and how to write an Info as distinct from a Texinfo
+file. The third part is about how to generate Info files from
+Texinfo files.
+
+@iftex
+This manual is primarily designed for use on a computer, so that you can
+try Info commands while reading about them. Reading it on paper is less
+effective, since you must take it on faith that the commands described
+really do what the manual says. By all means go through this manual now
+that you have it; but please try going through the on-line version as
+well.
+
+There are two ways of looking at the online version of this manual:
+
+@enumerate
+@item
+Type @code{info} at your shell's command line. This approach uses a
+small stand-alone program designed just to read Info files.
+
+@item
+Type @code{emacs} at the command line; then type @kbd{C-h i} (Control
+@kbd{h}, followed by @kbd{i}). This approach uses the Info mode of the
+Emacs program, an editor with many other capabilities.
+@end enumerate
+
+In either case, then type @kbd{mInfo} (just the letters), followed by
+@key{RET}---the ``Return'' or ``Enter'' key. At this point, you should
+be ready to follow the instructions in this manual as you read them on
+the screen.
+@c FIXME! (pesch@cygnus.com, 14 dec 1992)
+@c Is it worth worrying about what-if the beginner goes to somebody
+@c else's Emacs session, which already has an Info running in the middle
+@c of something---in which case these simple instructions won't work?
+@end iftex
+
+@menu
+* Help-Small-Screen:: Starting Info on a Small Screen
+* Help:: How to use Info
+* Help-P:: Returning to the Previous node
+* Help-^L:: The Space, Rubout, B and ^L commands.
+* Help-M:: Menus
+* Help-Adv:: Some advanced Info commands
+* Help-Q:: Quitting Info
+@end menu
+
+@node Help-Small-Screen, Help, , Getting Started
+@comment node-name, next, previous, up
+@section Starting Info on a Small Screen
+
+@iftex
+(In Info, you only see this section if your terminal has a small
+number of lines; most readers pass by it without seeing it.)
+@end iftex
+
+Since your terminal has an unusually small number of lines on its
+screen, it is necessary to give you special advice at the beginning.
+
+If you see the text @samp{--All----} at near the bottom right corner
+of the screen, it means the entire text you are looking at fits on the
+screen. If you see @samp{--Top----} instead, it means that there is
+more text below that does not fit. To move forward through the text
+and see another screen full, press the Space bar, @key{SPC}. To move
+back up, press the key labeled @samp{Backspace} or @key{Delete}.
+
+@ifinfo
+Here are 40 lines of junk, so you can try Spaces and Deletes and
+see what they do. At the end are instructions of what you should do
+next.
+
+This is line 17 @*
+This is line 18 @*
+This is line 19 @*
+This is line 20 @*
+This is line 21 @*
+This is line 22 @*
+This is line 23 @*
+This is line 24 @*
+This is line 25 @*
+This is line 26 @*
+This is line 27 @*
+This is line 28 @*
+This is line 29 @*
+This is line 30 @*
+This is line 31 @*
+This is line 32 @*
+This is line 33 @*
+This is line 34 @*
+This is line 35 @*
+This is line 36 @*
+This is line 37 @*
+This is line 38 @*
+This is line 39 @*
+This is line 40 @*
+This is line 41 @*
+This is line 42 @*
+This is line 43 @*
+This is line 44 @*
+This is line 45 @*
+This is line 46 @*
+This is line 47 @*
+This is line 48 @*
+This is line 49 @*
+This is line 50 @*
+This is line 51 @*
+This is line 52 @*
+This is line 53 @*
+This is line 54 @*
+This is line 55 @*
+This is line 56 @*
+
+If you have managed to get here, go back to the beginning with
+Delete, and come back here again, then you understand Space and
+Delete. So now type an @kbd{n} ---just one character; don't type
+the quotes and don't type the Return key afterward--- to
+get to the normal start of the course.
+@end ifinfo
+
+@node Help, Help-P, Help-Small-Screen, Getting Started
+@comment node-name, next, previous, up
+@section How to use Info
+
+You are talking to the program Info, for reading documentation.
+
+ Right now you are looking at one @dfn{Node} of Information.
+A node contains text describing a specific topic at a specific
+level of detail. This node's topic is ``how to use Info''.
+
+ The top line of a node is its @dfn{header}. This node's header (look at
+it now) says that it is the node named @samp{Help} in the file
+@file{info}. It says that the @samp{Next} node after this one is the node
+called @samp{Help-P}. An advanced Info command lets you go to any node
+whose name you know.
+
+ Besides a @samp{Next}, a node can have a @samp{Previous} or an @samp{Up}.
+This node has a @samp{Previous} but no @samp{Up}, as you can see.
+
+ Now it is time to move on to the @samp{Next} node, named @samp{Help-P}.
+
+>> Type @samp{n} to move there. Type just one character;
+ do not type the quotes and do not type a @key{RET} afterward.
+
+@samp{>>} in the margin means it is really time to try a command.
+
+@node Help-P, Help-^L, Help, Getting Started
+@comment node-name, next, previous, up
+@section Returning to the Previous node
+
+This node is called @samp{Help-P}. The @samp{Previous} node, as you see,
+is @samp{Help}, which is the one you just came from using the @kbd{n}
+command. Another @kbd{n} command now would take you to the next
+node, @samp{Help-^L}.
+
+>> But do not do that yet. First, try the @kbd{p} command, which takes
+ you to the @samp{Previous} node. When you get there, you can do an
+ @kbd{n} again to return here.
+
+ This all probably seems insultingly simple so far, but @emph{do not} be
+led into skimming. Things will get more complicated soon. Also,
+do not try a new command until you are told it is time to. Otherwise,
+you may make Info skip past an important warning that was coming up.
+
+>> Now do an @kbd{n} to get to the node @samp{Help-^L} and learn more.
+
+@node Help-^L, Help-M, Help-P, Getting Started
+@comment node-name, next, previous, up
+@section The Space, Delete, B and ^L commands.
+
+ This node's header tells you that you are now at node @samp{Help-^L}, and
+that @kbd{p} would get you back to @samp{Help-P}. The node's title is
+underlined; it says what the node is about (most nodes have titles).
+
+ This is a big node and it does not all fit on your display screen.
+You can tell that there is more that is not visible because you
+can see the string @samp{--Top-----} rather than @samp{--All----} near
+the bottom right corner of the screen.
+
+ The Space, Delete and @kbd{B} commands exist to allow you to ``move
+around'' in a node that does not all fit on the screen at once.
+Space moves forward, to show what was below the bottom of the screen.
+Delete moves backward, to show what was above the top of the screen
+(there is not anything above the top until you have typed some spaces).
+
+>> Now try typing a Space (afterward, type a Delete to return here).
+
+ When you type the space, the two lines that were at the bottom of
+the screen appear at the top, followed by more lines. Delete takes
+the two lines from the top and moves them to the bottom,
+@emph{usually}, but if there are not a full screen's worth of lines
+above them they may not make it all the way to the bottom.
+
+ If you type Space when there is no more to see, it rings the
+bell and otherwise does nothing. The same goes for Delete when
+the header of the node is visible.
+
+ If your screen is ever garbaged, you can tell Info to print it out
+again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down ``Control'' and
+type an @key{L} or @kbd{l}).
+
+>> Type @kbd{C-l} now.
+
+ To move back to the beginning of the node you are on, you can type
+a lot of Deletes. You can also type simply @kbd{b} for beginning.
+>> Try that now. (We have put in enough verbiage to push this past
+the first screenful, but screens are so big nowadays that perhaps it
+isn't enough. You may need to shrink your Emacs or Info window.)
+Then come back, with Spaces.
+
+ If your screen is very tall, all of this node might fit at once.
+In that case, "b" won't do anything. Sorry; what can we do?
+
+ You have just learned a considerable number of commands. If you
+want to use one but have trouble remembering which, you should type
+a @key{?} which prints out a brief list of commands. When you are
+finished looking at the list, make it go away by typing a @key{SPC}.
+
+>> Type a @key{?} now. After it finishes, type a @key{SPC}.
+
+ (If you are using the standalone Info reader, type `l' to return here.)
+
+ From now on, you will encounter large nodes without warning, and
+will be expected to know how to use Space and Delete to move
+around in them without being told. Since not all terminals have
+the same size screen, it would be impossible to warn you anyway.
+
+>> Now type @kbd{n} to see the description of the @kbd{m} command.
+
+@node Help-M, Help-Adv, Help-^L, Getting Started
+@comment node-name, next, previous, up
+@section Menus
+
+Menus and the @kbd{m} command
+
+ With only the @kbd{n} and @kbd{p} commands for moving between nodes, nodes
+are restricted to a linear sequence. Menus allow a branching
+structure. A menu is a list of other nodes you can move to. It is
+actually just part of the text of the node formatted specially so that
+Info can interpret it. The beginning of a menu is always identified
+by a line which starts with @samp{* Menu:}. A node contains a menu if and
+only if it has a line in it which starts that way. The only menu you
+can use at any moment is the one in the node you are in. To use a
+menu in any other node, you must move to that node first.
+
+ After the start of the menu, each line that starts with a @samp{*}
+identifies one subtopic. The line usually contains a brief name
+for the subtopic (followed by a @samp{:}), the name of the node that talks
+about that subtopic, and optionally some further description of the
+subtopic. Lines in the menu that do not start with a @samp{*} have no
+special meaning---they are only for the human reader's benefit and do
+not define additional subtopics. Here is an example:
+
+@example
+* Foo: FOO's Node This tells about FOO
+@end example
+
+The subtopic name is Foo, and the node describing it is @samp{FOO's Node}.
+The rest of the line is just for the reader's Information.
+[[ But this line is not a real menu item, simply because there is
+no line above it which starts with @samp{* Menu:}.]]
+
+ When you use a menu to go to another node (in a way that will be
+described soon), what you specify is the subtopic name, the first
+thing in the menu line. Info uses it to find the menu line, extracts
+the node name from it, and goes to that node. The reason that there
+is both a subtopic name and a node name is that the node name must be
+meaningful to the computer and may therefore have to be ugly looking.
+The subtopic name can be chosen just to be convenient for the user to
+specify. Often the node name is convenient for the user to specify
+and so both it and the subtopic name are the same. There is an
+abbreviation for this:
+
+@example
+* Foo:: This tells about FOO
+@end example
+
+@noindent
+This means that the subtopic name and node name are the same; they are
+both @samp{Foo}.
+
+>> Now use Spaces to find the menu in this node, then come back to
+ the front with a @kbd{b} and some Spaces. As you see, a menu is
+ actually visible in its node. If you cannot find a menu in a node
+ by looking at it, then the node does not have a menu and the
+ @kbd{m} command is not available.
+
+ The command to go to one of the subnodes is @kbd{m}---but @emph{do
+not do it yet!} Before you use @kbd{m}, you must understand the
+difference between commands and arguments. So far, you have learned
+several commands that do not need arguments. When you type one, Info
+processes it and is instantly ready for another command. The @kbd{m}
+command is different: it is incomplete without the @dfn{name of the
+subtopic}. Once you have typed @kbd{m}, Info tries to read the
+subtopic name.
+
+ Now look for the line containing many dashes near the bottom of the
+screen. There is one more line beneath that one, but usually it is
+blank. If it is empty, Info is ready for a command, such as @kbd{n}
+or @kbd{b} or Space or @kbd{m}. If that line contains text ending
+in a colon, it mean Info is trying to read the @dfn{argument} to a
+command. At such times, commands do not work, because Info tries to
+use them as the argument. You must either type the argument and
+finish the command you started, or type @kbd{Control-g} to cancel the
+command. When you have done one of those things, the line becomes
+blank again.
+
+ The command to go to a subnode via a menu is @kbd{m}. After you type
+the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }.
+You must then type the name of the subtopic you want, and end it with
+a @key{RET}.
+
+ You can abbreviate the subtopic name. If the abbreviation is not
+unique, the first matching subtopic is chosen. Some menus put
+the shortest possible abbreviation for each subtopic name in capital
+letters, so you can see how much you need to type. It does not
+matter whether you use upper case or lower case when you type the
+subtopic. You should not put any spaces at the end, or inside of the
+item name, except for one space where a space appears in the item in
+the menu.
+
+ You can also use the @dfn{completion} feature to help enter the subtopic
+name. If you type the Tab key after entering part of a name, it will
+magically fill in more of the name---as much as follows uniquely from
+what you have entered.
+
+ If you move the cursor to one of the menu subtopic lines, then you do
+not need to type the argument: you just type a Return, and it stands for
+the subtopic of the line you are on.
+
+Here is a menu to give you a chance to practice.
+
+* Menu: The menu starts here.
+
+This menu gives you three ways of going to one place, Help-FOO.
+
+* Foo: Help-FOO. A node you can visit for fun.@*
+* Bar: Help-FOO. Strange! two ways to get to the same place.@*
+* Help-FOO:: And yet another!@*
+
+
+>> Now type just an @kbd{m} and see what happens:
+
+ Now you are ``inside'' an @kbd{m} command. Commands cannot be used
+now; the next thing you will type must be the name of a subtopic.
+
+ You can change your mind about doing the @kbd{m} by typing Control-g.
+
+>> Try that now; notice the bottom line clear.
+
+>> Then type another @kbd{m}.
+
+>> Now type @samp{BAR} item name. Do not type Return yet.
+
+ While you are typing the item name, you can use the Delete key to
+cancel one character at a time if you make a mistake.
+
+>> Type one to cancel the @samp{R}. You could type another @samp{R} to
+ replace it. You do not have to, since @samp{BA} is a valid abbreviation.
+
+>> Now you are ready to go. Type a @key{RET}.
+
+ After visiting Help-FOO, you should return here.
+
+>> Type @kbd{n} to see more commands.
+
+@c If a menu appears at the end of this node, remove it.
+@c It is an accident of the menu updating command.
+
+Here is another way to get to Help-FOO, a menu. You can ignore this
+if you want, or else try it (but then please come back to here).
+
+@menu
+* Help-FOO::
+@end menu
+
+@node Help-FOO, , , Help-M
+@comment node-name, next, previous, up
+@subsection The @kbd{u} command
+
+ Congratulations! This is the node @samp{Help-FOO}. Unlike the other
+nodes you have seen, this one has an @samp{Up}: @samp{Help-M}, the node you
+just came from via the @kbd{m} command. This is the usual
+convention---the nodes you reach from a menu have @samp{Up} nodes that lead
+back to the menu. Menus move Down in the tree, and @samp{Up} moves Up.
+@samp{Previous}, on the other hand, is usually used to ``stay on the same
+level but go backwards''
+
+ You can go back to the node @samp{Help-M} by typing the command
+@kbd{u} for ``Up''. That puts you at the @emph{front} of the
+node---to get back to where you were reading you have to type
+some @key{SPC}s.
+
+>> Now type @kbd{u} to move back up to @samp{Help-M}.
+
+@node Help-Adv, Help-Q, Help-M, Getting Started
+@comment node-name, next, previous, up
+@section Some advanced Info commands
+
+ The course is almost over, so please stick with it to the end.
+
+ If you have been moving around to different nodes and wish to
+retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will
+do that, one node-step at a time. As you move from node to node, Info
+records the nodes where you have been in a special history list. The
+@kbd{l} command revisits nodes in the history list; each successive
+@kbd{l} command moves one step back through the history.
+
+ If you have been following directions, ad @kbd{l} command now will get
+you back to @samp{Help-M}. Another @kbd{l} command would undo the
+@kbd{u} and get you back to @samp{Help-FOO}. Another @kbd{l} would undo
+the @kbd{m} and get you back to @samp{Help-M}.
+
+>> Try typing three @kbd{l}'s, pausing in between to see what each
+ @kbd{l} does.
+
+Then follow directions again and you will end up back here.
+
+ Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to
+where @emph{you} last were, whereas @kbd{p} always moves to the node
+which the header says is the @samp{Previous} node (from this node, to
+@samp{Help-M}).
+
+ The @samp{d} command gets you instantly to the Directory node.
+This node, which is the first one you saw when you entered Info,
+has a menu which leads (directly, or indirectly through other menus),
+to all the nodes that exist.
+
+>> Try doing a @samp{d}, then do an @kbd{l} to return here (yes,
+ @emph{do} return).
+
+ Sometimes, in Info documentation, you will see a cross reference.
+Cross references look like this: @xref{Help-Cross, Cross}. That is a
+real, live cross reference which is named @samp{Cross} and points at
+the node named @samp{Help-Cross}.
+
+ If you wish to follow a cross reference, you must use the @samp{f}
+command. The @samp{f} must be followed by the cross reference name
+(in this case, @samp{Cross}). While you enter the name, you can use the
+Delete key to edit your input. If you change your mind about following
+any reference, you can use @kbd{Control-g} to cancel the command.
+
+ Completion is available in the @samp{f} command; you can complete among
+all the cross reference names in the current node by typing a Tab.
+
+>> Type @samp{f}, followed by @samp{Cross}, and a @key{RET}.
+
+ To get a list of all the cross references in the current node, you can
+type @kbd{?} after an @samp{f}. The @samp{f} continues to await a
+cross reference name even after printing the list, so if you don't
+actually want to follow a reference, you should type a @kbd{Control-g}
+to cancel the @samp{f}.
+
+>> Type "f?" to get a list of the cross references in this node. Then
+ type a @kbd{Control-g} and see how the @samp{f} gives up.
+
+>> Now type @kbd{n} to see the last node of the course.
+
+@c If a menu appears at the end of this node, remove it.
+@c It is an accident of the menu updating command.
+
+@node Help-Cross, , , Help-Adv
+@comment node-name, next, previous, up
+@unnumberedsubsec The node reached by the cross reference in Info
+
+ This is the node reached by the cross reference named @samp{Cross}.
+
+ While this node is specifically intended to be reached by a cross
+reference, most cross references lead to nodes that ``belong''
+someplace else far away in the structure of Info. So you cannot expect
+the footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing back to
+where you came from. In general, the @kbd{l} (el) command is the only
+way to get back there.
+
+>> Type @kbd{l} to return to the node where the cross reference was.
+
+@node Help-Q, , Help-Adv, Getting Started
+@comment node-name, next, previous, up
+@section Quitting Info
+
+ To get out of Info, back to what you were doing before, type @kbd{q}
+for @dfn{Quit}.
+
+ This is the end of the course on using Info. There are some other
+commands that are meant for experienced users; they are useful, and you
+can find them by looking in the directory node for documentation on
+Info. Finding them will be a good exercise in using Info in the usual
+manner.
+
+>> Type @samp{d} to go to the Info directory node; then type
+ @samp{mInfo} and Return, to get to the node about Info and
+ see what other help is available.
+
+@node Advanced Info, Create an Info File, Getting Started, Top
+@comment node-name, next, previous, up
+@chapter Info for Experts
+
+This chapter describes various advanced Info commands, and how to write
+an Info as distinct from a Texinfo file. (However, in most cases, writing a
+Texinfo file is better, since you can use it @emph{both} to generate an
+Info file and to make a printed manual. @xref{Top,, Overview of
+Texinfo, texinfo, Texinfo: The GNU Documentation Format}.)
+
+@menu
+* Expert:: Advanced Info commands: g, s, e, and 1 - 5.
+* Add:: Describes how to add new nodes to the hierarchy.
+ Also tells what nodes look like.
+* Menus:: How to add to or create menus in Info nodes.
+* Cross-refs:: How to add cross-references to Info nodes.
+* Tags:: How to make tag tables for Info files.
+* Checking:: Checking an Info File
+* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
+@end menu
+
+@node Expert, Add, , Advanced Info
+@comment node-name, next, previous, up
+@section Advanced Info Commands
+
+@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}
+
+If you know a node's name, you can go there by typing @kbd{g}, the
+name, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the node
+called @samp{Top} in this file (its directory node).
+@kbd{gExpert@key{RET}} would come back here.
+
+Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
+
+To go to a node in another file, you can include the filename in the
+node name by putting it at the front, in parentheses. Thus,
+@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
+node @samp{Top} in the file @file{dir}.
+
+The node name @samp{*} specifies the whole file. So you can look at
+all of the current file by typing @kbd{g*@key{RET}} or all of any
+other file with @kbd{g(FILENAME)@key{RET}}.
+
+The @kbd{s} command allows you to search a whole file for a string.
+It switches to the next node if and when that is necessary. You
+type @kbd{s} followed by the string to search for, terminated by
+@key{RET}. To search for the same string again, just @kbd{s} followed
+by @key{RET} will do. The file's nodes are scanned in the order
+they are in in the file, which has no necessary relationship to the
+order that they may be in in the tree structure of menus and @samp{next} pointers.
+But normally the two orders are not very different. In any case,
+you can always do a @kbd{b} to find out what node you have reached, if
+the header is not visible (this can happen, because @kbd{s} puts your
+cursor at the occurrence of the string, not at the beginning of the
+node).
+
+If you grudge the system each character of type-in it requires, you
+might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...
+@kbd{9}. They are short for the @kbd{m} command together with an
+argument. @kbd{1} goes through the first item in the current node's
+menu; @kbd{2} goes through the second item, etc.
+
+If you display supports multiple fonts, and you are using Emacs' Info
+mode to read Info files, the @samp{*} for the fifth menu item is
+underlines, and so is the @samp{*} for the ninth item; these underlines
+make it easy to see at a glance which number to use for an item.
+
+On ordinary terminals, you won't have underlining. If you need to
+actually count items, it is better to use @kbd{m} instead, and specify
+the name.
+
+The Info command @kbd{e} changes from Info mode to an ordinary
+Emacs editing mode, so that you can edit the text of the current node.
+Type @kbd{C-c C-c} to switch back to Info. The @kbd{e} command is allowed
+only if the variable @code{Info-enable-edit} is non-@code{nil}.
+
+@node Add, Menus, Expert, Advanced Info
+@comment node-name, next, previous, up
+@section Adding a new node to Info
+
+To add a new topic to the list in the Info directory, you must:
+@enumerate
+@item
+Create some nodes, in some file, to document that topic.
+@item
+Put that topic in the menu in the directory. @xref{Menus, Menu}.
+@end enumerate
+
+Usually, the way to create the nodes is with Texinfo @pxref{Top,, Overview of
+Texinfo, texinfo, Texinfo: The GNU Documentation Format}); this has the
+advantage that you can also make a printed manual from them. However,
+if hyou want to edit an Info file, here is how.
+
+ The new node can live in an existing documentation file, or in a new
+one. It must have a @key{^_} character before it (invisible to the
+user; this node has one but you cannot see it), and it ends with either
+a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a
+@key{^L} to end a new node, be sure that there is a @key{^_} after it
+to start the next one, since @key{^L} cannot @emph{start} a node.
+Also, a nicer way to make a node boundary be a page boundary as well
+is to put a @key{^L} @emph{right after} the @key{^_}.
+
+ The @key{^_} starting a node must be followed by a newline or a
+@key{^L} newline, after which comes the node's header line. The
+header line must give the node's name (by which Info finds it),
+and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if
+there are any). As you can see, this node's @samp{Up} node is the node
+@samp{Top}, which points at all the documentation for Info. The @samp{Next}
+node is @samp{Menus}.
+
+ The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
+may appear in any order, anywhere in the header line, but the
+recommended order is the one in this sentence. Each keyword must be
+followed by a colon, spaces and tabs, and then the appropriate name.
+The name may be terminated with a tab, a comma, or a newline. A space
+does not end it; node names may contain spaces. The case of letters
+in the names is insignificant.
+
+ A node name has two forms. A node in the current file is named by
+what appears after the @samp{Node: } in that node's first line. For
+example, this node's name is @samp{Add}. A node in another file is
+named by @samp{(@var{filename})@var{node-within-file}}, as in
+@samp{(info)Add} for this node. If the file name starts with ``./'',
+then it is relative to the current directory; otherwise, it is relative
+starting from the standard Info file directory of your site.
+The name @samp{(@var{filename})Top} can be abbreviated to just
+@samp{(@var{filename})}. By convention, the name @samp{Top} is used for
+the ``highest'' node in any single file---the node whose @samp{Up} points
+out of the file. The Directory node is @file{(dir)}. The @samp{Top} node
+of a document file listed in the Directory should have an @samp{Up:
+(dir)} in it.
+
+ The node name @kbd{*} is special: it refers to the entire file.
+Thus, @kbd{g*} shows you the whole current file. The use of the
+node @kbd{*} is to make it possible to make old-fashioned,
+unstructured files into nodes of the tree.
+
+ The @samp{Node:} name, in which a node states its own name, must not
+contain a filename, since Info when searching for a node does not
+expect one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names may
+contain them. In this node, since the @samp{Up} node is in the same file,
+it was not necessary to use one.
+
+ Note that the nodes in this file have a file name in the header
+line. The file names are ignored by Info, but they serve as comments
+to help identify the node for the user.
+
+@node Menus, Cross-refs, Add, Advanced Info
+@comment node-name, next, previous, up
+@section How to Create Menus
+
+ Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
+The @kbd{m} command searches the current node's menu for the topic which it
+reads from the terminal.
+
+ A menu begins with a line starting with @samp{* Menu:}. The rest of the
+line is a comment. After the starting line, every line that begins
+with a @samp{* } lists a single topic. The name of the topic--the
+argument that the user must give to the @kbd{m} command to select this
+topic---comes right after the star and space, and is followed by a
+colon, spaces and tabs, and the name of the node which discusses that
+topic. The node name, like node names following @samp{Next}, @samp{Previous}
+and @samp{Up}, may be terminated with a tab, comma, or newline; it may also
+be terminated with a period.
+
+ If the node name and topic name are the same, then rather than
+giving the name twice, the abbreviation @samp{* NAME::} may be used
+(and should be used, whenever possible, as it reduces the visual
+clutter in the menu).
+
+ It is considerate to choose the topic names so that they differ
+from each other very near the beginning---this allows the user to type
+short abbreviations. In a long menu, it is a good idea to capitalize
+the beginning of each item name which is the minimum acceptable
+abbreviation for it (a long menu is more than 5 or so entries).
+
+ The nodes listed in a node's menu are called its ``subnodes'', and
+it is their ``superior''. They should each have an @samp{Up:} pointing at
+the superior. It is often useful to arrange all or most of the
+subnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone who
+wants to see them all need not keep revisiting the Menu.
+
+ The Info Directory is simply the menu of the node @samp{(dir)Top}---that
+is, node @samp{Top} in file @file{.../info/dir}. You can put new entries
+in that menu just like any other menu. The Info Directory is @emph{not} the
+same as the file directory called @file{info}. It happens that many of
+Info's files live on that file directory, but they do not have to; and
+files on that directory are not automatically listed in the Info
+Directory node.
+
+ Also, although the Info node graph is claimed to be a ``hierarchy'',
+in fact it can be @emph{any} directed graph. Shared structures and
+pointer cycles are perfectly possible, and can be used if they are
+appropriate to the meaning to be expressed. There is no need for all
+the nodes in a file to form a connected structure. In fact, this file
+has two connected components. You are in one of them, which is under
+the node @samp{Top}; the other contains the node @samp{Help} which the
+@kbd{h} command goes to. In fact, since there is no garbage
+collector, nothing terrible happens if a substructure is not pointed
+to, but such a substructure is rather useless since nobody can
+ever find out that it exists.
+
+@node Cross-refs, Tags, Menus, Advanced Info
+@comment node-name, next, previous, up
+@section Creating Cross References
+
+ A cross reference can be placed anywhere in the text, unlike a menu
+item which must go at the front of a line. A cross reference looks
+like a menu item except that it has @samp{*note} instead of @kbd{*}.
+It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are
+so often part of node names. If you wish to enclose a cross reference
+in parentheses, terminate it with a period first. Here are two
+examples of cross references pointers:
+
+@example
+*Note details: commands. (See *note 3: Full Proof.)
+@end example
+
+They are just examples. The places they ``lead to'' do not really exist!
+
+@node Tags, Checking, Cross-refs, Advanced Info
+@comment node-name, next, previous, up
+@section Tag Tables for Info Files
+
+ You can speed up the access to nodes of a large Info file by giving
+it a tag table. Unlike the tag table for a program, the tag table for
+an Info file lives inside the file itself and is used
+automatically whenever Info reads in the file.
+
+ To make a tag table, go to a node in the file using Emacs Info mode and type
+@kbd{M-x Info-tagify}. Then you must use @kbd{C-x C-s} to save the
+file.
+
+ Once the Info file has a tag table, you must make certain it is up
+to date. If, as a result of deletion of text, any node moves back
+more than a thousand characters in the file from the position
+recorded in the tag table, Info will no longer be able to find that
+node. To update the tag table, use the @code{Info-tagify} command again.
+
+ An Info file tag table appears at the end of the file and looks like
+this:
+
+@example
+^_
+Tag Table:
+File: info, Node: Cross-refs^?21419
+File: info, Node: Tags^?22145
+^_
+End Tag Table
+@end example
+
+@noindent
+Note that it contains one line per node, and this line contains
+the beginning of the node's header (ending just after the node name),
+a Delete character, and the character position in the file of the
+beginning of the node.
+
+@node Checking, Emacs Info Variables, Tags, Advanced Info
+@comment node-name, next, previous, up
+@section Checking an Info File
+
+ When creating an Info file, it is easy to forget the name of a node
+when you are making a pointer to it from another node. If you put in
+the wrong name for a node, this is not detected until someone
+tries to go through the pointer using Info. Verification of the Info
+file is an automatic process which checks all pointers to nodes and
+reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
+@samp{Up} is checked, as is every menu item and every cross reference. In
+addition, any @samp{Next} which does not have a @samp{Previous} pointing back is
+reported. Only pointers within the file are checked, because checking
+pointers to other files would be terribly slow. But those are usually
+few.
+
+ To check an Info file, do @kbd{M-x Info-validate} while looking at
+any node of the file with Emacs Info mode.
+
+@node Emacs Info Variables, , Checking, Advanced Info
+@section Emacs Info-mode Variables
+
+The following variables may modify the behaviour of Info-mode in Emacs;
+you may wish to set one or several of these variables interactively, or
+in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting
+Variables, Examining and Setting Variables, emacs, The GNU Emacs
+Manual}.
+
+@vtable @code
+@item Info-enable-edit
+Set to @code{nil}, disables the @samp{e} (@code{Info-edit}) command. A
+non-@code{nil} value enables it. @xref{Add, Edit}.
+
+@item Info-enable-active-nodes
+When set to a non-@code{nil} value, allows Info to execute Lisp code
+associated with nodes. The Lisp code is executed when the node is
+selected.
+
+@item Info-directory-list
+The list of directories to search for Info files. Each element is a
+string (directory name) or @code{nil} (try default directory).
+
+@item Info-directory
+The standard directory for Info documentation files. Only used when the
+function @code{Info-directory} is called.
+@end vtable
+
+@node Create an Info File, , Advanced Info, Top
+@comment node-name, next, previous, up
+@chapter Creating an Info File from a Makeinfo file
+
+@code{makeinfo} is a utility that converts a Texinfo file into an Info
+file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
+GNU Emacs functions that do the same.
+
+@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo
+Manual}, to learn how to create an Info file from a Texinfo file.
+
+@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation
+Format}, to learn how to write a Texinfo file.
+
+@bye
diff --git a/contrib/texinfo/info/infodoc.c b/contrib/texinfo/info/infodoc.c
index 4fc0419c5f90..35675095e70c 100644
--- a/contrib/texinfo/info/infodoc.c
+++ b/contrib/texinfo/info/infodoc.c
@@ -1,7 +1,9 @@
-/* infodoc.c -- Functions which build documentation nodes.
- $Id: infodoc.c,v 1.4 1997/07/25 21:08:40 karl Exp $
+/* infodoc.c -- Functions which build documentation nodes. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,9 +33,9 @@
/* #define HELP_NODE_GETS_REGENERATED 1 */
/* **************************************************************** */
-/* */
-/* Info Help Windows */
-/* */
+/* */
+/* Info Help Windows */
+/* */
/* **************************************************************** */
/* The name of the node used in the help window. */
@@ -47,12 +49,10 @@ static char *internal_info_help_node_contents = (char *)NULL;
/* The static text which appears in the internal info help node. */
static char *info_internal_help_text[] = {
- N_ ("Basic Commands in Info Windows"),
+ "Basic Commands in Info Windows",
"******************************",
"",
- " h Invoke the Info tutorial.",
- " CTRL-x 0 Quit this help.",
- " q Quit Info altogether.",
+ " h Invoke the Info tutorial.",
"",
"Selecting other nodes:",
"----------------------",
@@ -72,8 +72,9 @@ static char *info_internal_help_text[] = {
" b Go to the beginning of this node.",
" e Go to the end of this node.",
"",
- "Other commands:",
+ "\"Advanced\" commands:",
"--------------------",
+ " q Quit Info.",
" 1 Pick first item in node's menu.",
" 2-9 Pick second ... ninth item in node's menu.",
" 0 Pick last item in node's menu.",
@@ -81,7 +82,7 @@ static char *info_internal_help_text[] = {
" You may include a filename as well, as in (FILENAME)NODENAME.",
" s Search through this Info file for a specified string,",
" and select the node in which the next occurrence is found.",
- NULL
+ (char *)NULL
};
static char *where_is (), *where_is_internal ();
@@ -96,70 +97,70 @@ dump_map_to_message_buffer (prefix, map)
for (i = 0; i < 256; i++)
{
if (map[i].type == ISKMAP)
- {
- char *new_prefix, *keyname;
+ {
+ char *new_prefix, *keyname;
- keyname = pretty_keyname (i);
- new_prefix = (char *)
- xmalloc (3 + strlen (prefix) + strlen (keyname));
- sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname);
+ keyname = pretty_keyname (i);
+ new_prefix = (char *)
+ xmalloc (3 + strlen (prefix) + strlen (keyname));
+ sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname);
- dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function);
- free (new_prefix);
- }
+ dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function);
+ free (new_prefix);
+ }
else if (map[i].function)
- {
- register int last;
- char *doc, *name;
-
- doc = function_documentation (map[i].function);
- name = function_name (map[i].function);
-
- if (!*doc)
- continue;
-
- /* Find out if there is a series of identical functions, as in
- ea_insert (). */
- for (last = i + 1; last < 256; last++)
- if ((map[last].type != ISFUNC) ||
- (map[last].function != map[i].function))
- break;
-
- if (last - 1 != i)
- {
- printf_to_message_buffer
- ("%s%s .. ", prefix, pretty_keyname (i));
- printf_to_message_buffer
- ("%s%s\t", prefix, pretty_keyname (last - 1));
- i = last - 1;
- }
- else
- printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
+ {
+ register int last;
+ char *doc, *name;
+
+ doc = function_documentation (map[i].function);
+ name = function_name (map[i].function);
+
+ if (!*doc)
+ continue;
+
+ /* Find out if there is a series of identical functions, as in
+ ea_insert (). */
+ for (last = i + 1; last < 256; last++)
+ if ((map[last].type != ISFUNC) ||
+ (map[last].function != map[i].function))
+ break;
+
+ if (last - 1 != i)
+ {
+ printf_to_message_buffer
+ ("%s%s .. ", prefix, pretty_keyname (i));
+ printf_to_message_buffer
+ ("%s%s\t", prefix, pretty_keyname (last - 1));
+ i = last - 1;
+ }
+ else
+ printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
#if defined (NAMED_FUNCTIONS)
- /* Print the name of the function, and some padding before the
- documentation string is printed. */
- {
- int length_so_far;
- int desired_doc_start = 40; /* Must be multiple of 8. */
-
- printf_to_message_buffer ("(%s)", name);
- length_so_far = message_buffer_length_this_line ();
-
- if ((desired_doc_start + strlen (doc)) >= the_screen->width)
- printf_to_message_buffer ("\n ");
- else
- {
- while (length_so_far < desired_doc_start)
- {
- printf_to_message_buffer ("\t");
- length_so_far += character_width ('\t', length_so_far);
- }
- }
- }
+ /* Print the name of the function, and some padding before the
+ documentation string is printed. */
+ {
+ int length_so_far;
+ int desired_doc_start = 40; /* Must be multiple of 8. */
+
+ printf_to_message_buffer ("(%s)", name);
+ length_so_far = message_buffer_length_this_line ();
+
+ if ((desired_doc_start + strlen (doc)) >= the_screen->width)
+ printf_to_message_buffer ("\n ");
+ else
+ {
+ while (length_so_far < desired_doc_start)
+ {
+ printf_to_message_buffer ("\t");
+ length_so_far += character_width ('\t', length_so_far);
+ }
+ }
+ }
#endif /* NAMED_FUNCTIONS */
- printf_to_message_buffer ("%s\n", doc);
- }
+ printf_to_message_buffer ("%s\n", doc);
+ }
}
}
@@ -183,7 +184,7 @@ create_internal_info_help_node ()
initialize_message_buffer ();
for (i = 0; info_internal_help_text[i]; i++)
- printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
+ printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
printf_to_message_buffer ("---------------------\n\n");
printf_to_message_buffer ("The current search path is:\n");
@@ -198,34 +199,34 @@ create_internal_info_help_node ()
#if defined (NAMED_FUNCTIONS)
/* Get a list of the M-x commands which have no keystroke equivs. */
for (i = 0; function_doc_array[i].func; i++)
- {
- VFunction *func = function_doc_array[i].func;
-
- if ((!where_is_internal (info_keymap, func)) &&
- (!where_is_internal (echo_area_keymap, func)))
- {
- if (!printed_one_mx)
- {
- printf_to_message_buffer ("---------------------\n\n");
- printf_to_message_buffer
- (_("The following commands can only be invoked via M-x:\n\n"));
- printed_one_mx = 1;
- }
-
- printf_to_message_buffer
- ("M-x %s\n %s\n",
- function_doc_array[i].func_name,
- replace_in_documentation (function_doc_array[i].doc));
- }
- }
+ {
+ VFunction *func = function_doc_array[i].func;
+
+ if ((!where_is_internal (info_keymap, func)) &&
+ (!where_is_internal (echo_area_keymap, func)))
+ {
+ if (!printed_one_mx)
+ {
+ printf_to_message_buffer ("---------------------\n\n");
+ printf_to_message_buffer
+ ("The following commands can only be invoked via M-x:\n\n");
+ printed_one_mx = 1;
+ }
+
+ printf_to_message_buffer
+ ("M-x %s\n %s\n",
+ function_doc_array[i].func_name,
+ replace_in_documentation (function_doc_array[i].doc));
+ }
+ }
if (printed_one_mx)
- printf_to_message_buffer ("\n");
+ printf_to_message_buffer ("\n");
#endif /* NAMED_FUNCTIONS */
printf_to_message_buffer
- ("%s", replace_in_documentation
- (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")));
+ ("%s", replace_in_documentation
+ ("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"));
node = message_buffer_to_node ();
internal_info_help_node_contents = node->contents;
}
@@ -272,16 +273,16 @@ info_find_or_create_help_window ()
int max = 0;
for (window = windows; window; window = window->next)
- {
- if (window->height > max)
- {
- max = window->height;
- eligible = window;
- }
- }
+ {
+ if (window->height > max)
+ {
+ max = window->height;
+ eligible = window;
+ }
+ }
if (!eligible)
- return ((WINDOW *)NULL);
+ return ((WINDOW *)NULL);
}
#if !defined (HELP_NODE_GETS_REGENERATED)
else
@@ -296,28 +297,28 @@ info_find_or_create_help_window ()
if (!help_window)
{
/* Split the largest window into 2 windows, and show the help text
- in that window. */
+ in that window. */
if (eligible->height > 30)
- {
- active_window = eligible;
- help_window = window_make_window (internal_info_help_node);
- }
+ {
+ active_window = eligible;
+ help_window = window_make_window (internal_info_help_node);
+ }
else
- {
- set_remembered_pagetop_and_point (active_window);
- window_set_node_of_window (active_window, internal_info_help_node);
- help_window = active_window;
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ window_set_node_of_window (active_window, internal_info_help_node);
+ help_window = active_window;
+ }
}
else
{
/* Case where help node always gets regenerated, and we have an
- existing window in which to place the node. */
+ existing window in which to place the node. */
if (active_window != help_window)
- {
- set_remembered_pagetop_and_point (active_window);
- active_window = help_window;
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ active_window = help_window;
+ }
window_set_node_of_window (active_window, internal_info_help_node);
}
remember_window_and_node (help_window, help_window->node);
@@ -325,7 +326,7 @@ info_find_or_create_help_window ()
}
/* Create or move to the help window. */
-DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
+DECLARE_INFO_COMMAND (info_get_help_window, "Display help message")
{
WINDOW *help_window;
@@ -343,7 +344,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
/* Show the Info help node. This means that the "info" file is installed
where it can easily be found on your system. */
-DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'"))
+DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'")
{
NODE *node;
char *nodename;
@@ -355,15 +356,15 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'")
for (win = windows; win; win = win->next)
{
- if (win->node && win->node->filename &&
- (strcasecmp
- (filename_non_directory (win->node->filename), "info") == 0) &&
- ((strcmp (win->node->nodename, "Help") == 0) ||
- (strcmp (win->node->nodename, "Help-Small-Screen") == 0)))
- {
- active_window = win;
- return;
- }
+ if (win->node && win->node->filename &&
+ (strcasecmp
+ (filename_non_directory (win->node->filename), "info") == 0) &&
+ ((strcmp (win->node->nodename, "Help") == 0) ||
+ (strcmp (win->node->nodename, "Help-Small-Screen") == 0)))
+ {
+ active_window = win;
+ return;
+ }
}
}
@@ -379,32 +380,32 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'")
if (!node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- info_error (CANT_FILE_NODE, "Info", nodename);
+ info_error (CANT_FILE_NODE, "Info", nodename);
}
else
{
/* If the current window is very large (greater than 45 lines),
- then split it and show the help node in another window.
- Otherwise, use the current window. */
+ then split it and show the help node in another window.
+ Otherwise, use the current window. */
if (active_window->height > 45)
- active_window = window_make_window (node);
+ active_window = window_make_window (node);
else
- {
- set_remembered_pagetop_and_point (active_window);
- window_set_node_of_window (active_window, node);
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ window_set_node_of_window (active_window, node);
+ }
remember_window_and_node (active_window, node);
}
}
/* **************************************************************** */
-/* */
-/* Groveling Info Keymaps and Docs */
-/* */
+/* */
+/* Groveling Info Keymaps and Docs */
+/* */
/* **************************************************************** */
/* Return the documentation associated with the Info command FUNCTION. */
@@ -467,7 +468,7 @@ key_documentation (key, map)
return ((char *)NULL);
}
-DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
+DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
{
char keyname[50];
int keyname_index = 0;
@@ -480,24 +481,24 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
while (1)
{
- message_in_echo_area (_("Describe key: %s"), keyname);
+ message_in_echo_area ("Describe key: %s", keyname);
keystroke = info_get_input_char ();
unmessage_in_echo_area ();
if (Meta_p (keystroke) && (!ISO_Latin_p || key < 160))
- {
- if (map[ESC].type != ISKMAP)
- {
- window_message_in_echo_area
- (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
- return;
- }
-
- strcpy (keyname + keyname_index, "ESC ");
- keyname_index = strlen (keyname);
- keystroke = UnMeta (keystroke);
- map = (Keymap)map[ESC].function;
- }
+ {
+ if (map[ESC].type != ISKMAP)
+ {
+ window_message_in_echo_area
+ ("ESC %s is undefined.", pretty_keyname (UnMeta (keystroke)));
+ return;
+ }
+
+ strcpy (keyname + keyname_index, "ESC ");
+ keyname_index = strlen (keyname);
+ keystroke = UnMeta (keystroke);
+ map = (Keymap)map[ESC].function;
+ }
/* Add the printed representation of KEYSTROKE to our keyname. */
rep = pretty_keyname (keystroke);
@@ -505,40 +506,40 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
keyname_index = strlen (keyname);
if (map[keystroke].function == (VFunction *)NULL)
- {
- message_in_echo_area (_("%s is undefined."), keyname);
- return;
- }
+ {
+ message_in_echo_area ("%s is undefined.", keyname);
+ return;
+ }
else if (map[keystroke].type == ISKMAP)
- {
- map = (Keymap)map[keystroke].function;
- strcat (keyname, " ");
- keyname_index = strlen (keyname);
- continue;
- }
+ {
+ map = (Keymap)map[keystroke].function;
+ strcat (keyname, " ");
+ keyname_index = strlen (keyname);
+ continue;
+ }
else
- {
- char *message, *fundoc, *funname = "";
+ {
+ char *message, *fundoc, *funname = "";
#if defined (NAMED_FUNCTIONS)
- funname = function_name (map[keystroke].function);
+ funname = function_name (map[keystroke].function);
#endif /* NAMED_FUNCTIONS */
- fundoc = function_documentation (map[keystroke].function);
+ fundoc = function_documentation (map[keystroke].function);
- message = (char *)xmalloc
- (10 + strlen (keyname) + strlen (fundoc) + strlen (funname));
+ message = (char *)xmalloc
+ (10 + strlen (keyname) + strlen (fundoc) + strlen (funname));
#if defined (NAMED_FUNCTIONS)
- sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
+ sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
#else
- sprintf (message, _("%s is defined to %s."), keyname, fundoc);
+ sprintf (message, "%s is defined to %s.", keyname, fundoc);
#endif /* !NAMED_FUNCTIONS */
- window_message_in_echo_area ("%s", message);
- free (message);
- break;
- }
+ window_message_in_echo_area ("%s", message);
+ free (message);
+ break;
+ }
}
}
@@ -564,28 +565,28 @@ pretty_keyname (key)
else if (Control_p (key))
{
switch (key)
- {
- case '\n': rep = "LFD"; break;
- case '\t': rep = "TAB"; break;
- case '\r': rep = "RET"; break;
- case ESC: rep = "ESC"; break;
-
- default:
- sprintf (rep_buffer, "C-%c", UnControl (key));
- rep = rep_buffer;
- }
+ {
+ case '\n': rep = "LFD"; break;
+ case '\t': rep = "TAB"; break;
+ case '\r': rep = "RET"; break;
+ case ESC: rep = "ESC"; break;
+
+ default:
+ sprintf (rep_buffer, "C-%c", UnControl (key));
+ rep = rep_buffer;
+ }
}
else
{
switch (key)
- {
- case ' ': rep = "SPC"; break;
- case DEL: rep = "DEL"; break;
- default:
- rep_buffer[0] = key;
- rep_buffer[1] = '\0';
- rep = rep_buffer;
- }
+ {
+ case ' ': rep = "SPC"; break;
+ case DEL: rep = "DEL"; break;
+ default:
+ rep_buffer[0] = key;
+ rep_buffer[1] = '\0';
+ rep = rep_buffer;
+ }
}
return (rep);
}
@@ -608,39 +609,39 @@ replace_in_documentation (string)
{
/* Is this the start of a replaceable function name? */
if (string[i] == '\\' && string[i + 1] == '[')
- {
- char *fun_name, *rep;
- VFunction *function;
-
- /* Copy in the old text. */
- strncpy (result + next, string + start, i - start);
- next += (i - start);
- start = i + 2;
-
- /* Move to the end of the function name. */
- for (i = start; string[i] && (string[i] != ']'); i++);
-
- fun_name = (char *)xmalloc (1 + i - start);
- strncpy (fun_name, string + start, i - start);
- fun_name[i - start] = '\0';
-
- /* Find a key which invokes this function in the info_keymap. */
- function = named_function (fun_name);
-
- /* If the internal documentation string fails, there is a
- serious problem with the associated command's documentation.
- We croak so that it can be fixed immediately. */
- if (!function)
- abort ();
-
- rep = where_is (info_keymap, function);
- strcpy (result + next, rep);
- next = strlen (result);
-
- start = i;
- if (string[i])
- start++;
- }
+ {
+ char *fun_name, *rep;
+ VFunction *function;
+
+ /* Copy in the old text. */
+ strncpy (result + next, string + start, i - start);
+ next += (i - start);
+ start = i + 2;
+
+ /* Move to the end of the function name. */
+ for (i = start; string[i] && (string[i] != ']'); i++);
+
+ fun_name = (char *)xmalloc (1 + i - start);
+ strncpy (fun_name, string + start, i - start);
+ fun_name[i - start] = '\0';
+
+ /* Find a key which invokes this function in the info_keymap. */
+ function = named_function (fun_name);
+
+ /* If the internal documentation string fails, there is a
+ serious problem with the associated command's documentation.
+ We croak so that it can be fixed immediately. */
+ if (!function)
+ abort ();
+
+ rep = where_is (info_keymap, function);
+ strcpy (result + next, rep);
+ next = strlen (result);
+
+ start = i;
+ if (string[i])
+ start++;
+ }
}
strcpy (result + next, string + start);
return (result);
@@ -673,7 +674,7 @@ where_is (map, function)
name = function_name (function);
if (name)
- sprintf (where_is_rep, "M-x %s", name);
+ sprintf (where_is_rep, "M-x %s", name);
rep = where_is_rep;
}
@@ -693,29 +694,29 @@ where_is_internal (map, function)
for (i = 0; i < 256; i++)
if ((map[i].type == ISFUNC) && map[i].function == function)
{
- sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));
- return (where_is_rep);
+ sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));
+ return (where_is_rep);
}
/* Okay, search subsequent maps for this function. */
for (i = 0; i < 256; i++)
{
if (map[i].type == ISKMAP)
- {
- int saved_index = where_is_rep_index;
- char *rep;
+ {
+ int saved_index = where_is_rep_index;
+ char *rep;
- sprintf (where_is_rep + where_is_rep_index, "%s ",
- pretty_keyname (i));
+ sprintf (where_is_rep + where_is_rep_index, "%s ",
+ pretty_keyname (i));
- where_is_rep_index = strlen (where_is_rep);
- rep = where_is_internal ((Keymap)map[i].function, function);
+ where_is_rep_index = strlen (where_is_rep);
+ rep = where_is_internal ((Keymap)map[i].function, function);
- if (rep)
- return (where_is_rep);
+ if (rep)
+ return (where_is_rep);
- where_is_rep_index = saved_index;
- }
+ where_is_rep_index = saved_index;
+ }
}
return ((char *)NULL);
@@ -728,7 +729,7 @@ DECLARE_INFO_COMMAND (info_where_is,
{
char *command_name;
- command_name = read_function_name (_("Where is command: "), window);
+ command_name = read_function_name ("Where is command: ", window);
if (!command_name)
{
@@ -743,27 +744,27 @@ DECLARE_INFO_COMMAND (info_where_is,
function = named_function (command_name);
if (function)
- {
- char *location;
-
- location = where_is (active_window->keymap, function);
-
- if (!location)
- {
- info_error (_("`%s' is not on any keys"), command_name);
- }
- else
- {
- if (strncmp (location, "M-x ", 4) == 0)
- window_message_in_echo_area
- (_("%s can only be invoked via %s."), command_name, location);
- else
- window_message_in_echo_area
- (_("%s can be invoked via %s."), command_name, location);
- }
- }
+ {
+ char *location;
+
+ location = where_is (active_window->keymap, function);
+
+ if (!location)
+ {
+ info_error ("`%s' is not on any keys", command_name);
+ }
+ else
+ {
+ if (strncmp (location, "M-x ", 4) == 0)
+ window_message_in_echo_area
+ ("%s can only be invoked via %s.", command_name, location);
+ else
+ window_message_in_echo_area
+ ("%s can be invoked via %s.", command_name, location);
+ }
+ }
else
- info_error (_("There is no function named `%s'"), command_name);
+ info_error ("There is no function named `%s'", command_name);
}
free (command_name);
diff --git a/contrib/texinfo/info/infomap.c b/contrib/texinfo/info/infomap.c
index 7591283dc592..e67712fcb308 100644
--- a/contrib/texinfo/info/infomap.c
+++ b/contrib/texinfo/info/infomap.c
@@ -1,7 +1,9 @@
-/* infomap.c -- Keymaps for Info.
- $Id: infomap.c,v 1.7 1997/07/31 20:37:32 karl Exp $
+/* infomap.c -- Keymaps for Info. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,10 +21,16 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include "stdio.h"
+#include "ctype.h"
#include "infomap.h"
#include "funs.h"
-#include "terminal.h"
+#include "info.h"
+
+static void add_function_key(char *, VFunction *, Keymap);
+
+extern char *term_ku, *term_kd, *term_kr, *term_kl;
+extern char *term_kP, *term_kN, *term_kh, *term_kH;
/* Return a new keymap which has all the uppercase letters mapped to run
the function info_do_lowercase_version (). */
@@ -80,65 +88,18 @@ keymap_discard_keymap (map)
for (i = 0; i < 256; i++)
{
switch (map[i].type)
- {
- case ISFUNC:
- break;
+ {
+ case ISFUNC:
+ break;
- case ISKMAP:
- keymap_discard_keymap ((Keymap)map[i].function);
- break;
+ case ISKMAP:
+ keymap_discard_keymap ((Keymap)map[i].function);
+ break;
- }
+ }
}
}
-/* Conditionally bind key sequence. */
-int
-keymap_bind_keyseq (map, keyseq, keyentry)
- Keymap map;
- const unsigned char *keyseq;
- KEYMAP_ENTRY *keyentry;
-{
- register Keymap m = map;
- register const unsigned char *s = keyseq;
- register int c;
-
- if (s == NULL || *s == '\0') return 0;
-
- while ((c = *s++) != '\0')
- {
- switch (m[c].type)
- {
- case ISFUNC:
- if (!(m[c].function == NULL ||
- (m != map && m[c].function == info_do_lowercase_version)))
- return 0;
-
- if (*s != '\0')
- {
- m[c].type = ISKMAP;
- m[c].function = (VFunction *)keymap_make_keymap ();
- }
- break;
-
- case ISKMAP:
- if (*s == '\0')
- return 0;
- break;
- }
- if (*s != '\0')
- {
- m = (Keymap)m[c].function;
- }
- else
- {
- m[c] = *keyentry;
- }
- }
-
- return 1;
-}
-
/* Initialize the standard info keymaps. */
Keymap info_keymap = (Keymap)NULL;
@@ -162,15 +123,15 @@ initialize_info_keymaps ()
echo_area_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
echo_area_keymap[Control ('x')].type = ISKMAP;
echo_area_keymap[Control ('x')].function =
- (VFunction *)keymap_make_keymap ();
+ (VFunction *)keymap_make_keymap ();
}
/* Bind numeric arg functions for both echo area and info window maps. */
for (i = '0'; i < '9' + 1; i++)
{
((Keymap) info_keymap[ESC].function)[i].function =
- ((Keymap) echo_area_keymap[ESC].function)[i].function =
- info_add_digit_to_numeric_arg;
+ ((Keymap) echo_area_keymap[ESC].function)[i].function =
+ info_add_digit_to_numeric_arg;
}
((Keymap) info_keymap[ESC].function)['-'].function =
((Keymap) echo_area_keymap[ESC].function)['-'].function =
@@ -227,31 +188,6 @@ initialize_info_keymaps ()
map['o'].function = info_next_window;
map[DEL].function = ea_backward_kill_line;
- /* Arrow key bindings for echo area keymaps. It seems that some
- terminals do not match their termcap entries, so it's best to just
- define everything with both of the usual prefixes. */
- map = echo_area_keymap;
- keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
- keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
- keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
- keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
- keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
- keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
- keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
- keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
- keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
- keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
- keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
- keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
-
- map = (Keymap)echo_area_keymap[ESC].function;
- keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
- keymap_bind_keyseq (map, "\033OA", &map['b']);
- keymap_bind_keyseq (map, "\033[A", &map['b']);
- keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
- keymap_bind_keyseq (map, "\033OB", &map['f']);
- keymap_bind_keyseq (map, "\033[B", &map['f']);
-
/* Bind commands for Info window keymaps. */
map = info_keymap;
map[TAB].function = info_move_to_next_xref;
@@ -335,34 +271,58 @@ initialize_info_keymaps ()
map['t'].function = info_tile_windows;
map['w'].function = info_toggle_wrap;
- /* Arrow key bindings for Info windows keymap. */
- map = info_keymap;
- keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
- keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
- keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
- keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
- keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
- keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
- keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
- keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
- keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
- keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
- keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
- keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
- keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
+ /* Add functions for the arrow keys, PageUp, PageDown, Home, HomeDown */
+ add_function_key(term_ku, info_prev_line, info_keymap);
+ add_function_key(term_kd, info_next_line, info_keymap);
+ add_function_key(term_kl, info_backward_char, info_keymap);
+ add_function_key(term_kr, info_forward_char, info_keymap);
+ add_function_key(term_kP, info_scroll_backward, info_keymap);
+ add_function_key(term_kN, info_scroll_forward, info_keymap);
+ add_function_key(term_kh, info_beginning_of_node, info_keymap);
+ add_function_key(term_kH, info_end_of_node, info_keymap);
+}
- map = (Keymap)info_keymap[ESC].function;
- keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
- keymap_bind_keyseq (map, "\033OA", &map['b']);
- keymap_bind_keyseq (map, "\033[A", &map['b']);
- keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
- keymap_bind_keyseq (map, "\033OB", &map['f']);
- keymap_bind_keyseq (map, "\033[B", &map['f']);
- keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
-
- /* The alternative to this definition of a `main map' key in the
- `ESC map' section, is something like:
- keymap_bind_keyseq (map, term_kP, &((KeyMap)map[ESC].function).map['v']);
- */
- keymap_bind_keyseq (info_keymap/*sic*/, term_kP, &map['v']); /* pageup */
+static void add_function_key(char *esc_seq, VFunction *func, Keymap map)
+{
+ char *end_str, *p;
+
+ if (!esc_seq)
+ return; /* don't add keys which don't exist */
+
+ end_str = esc_seq + strlen(esc_seq);
+
+ for (p = esc_seq; p < end_str; p++)
+ {
+ if (isupper(*p))
+ *p = tolower(*p);
+ switch (map[*p].type)
+ {
+ case ISKMAP: /* Go one level down. Also has the effect
+ that we're not overwriting a previous
+ binding if we're at the end of p */
+ map = (Keymap)map[*p].function;
+ break;
+ case ISFUNC: /* two possibilities here:
+ 1. map[*p].function == NULL means we have
+ a virgin keymap to fill;
+ 2. else this entry is already taken */
+ if (map[*p].function == NULL)
+ {
+ if (p == end_str - 1)
+ {
+ map[*p].function = func;
+ return;
+ }
+ map[*p].type = ISKMAP;
+ map[*p].function = (VFunction *)keymap_make_keymap();
+ map = (Keymap)map[*p].function;
+ } else
+ return;
+ break;
+ default: /* can't happen */
+ info_error("unknown keymap type (%d).", map[*p].type);
+ break;
+ }
+ }
+ return;
}
diff --git a/contrib/texinfo/info/infomap.h b/contrib/texinfo/info/infomap.h
index 65968cbdff47..faf93884fd58 100644
--- a/contrib/texinfo/info/infomap.h
+++ b/contrib/texinfo/info/infomap.h
@@ -21,14 +21,14 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFOMAP_H
-#define INFOMAP_H
+#if !defined (_INFOMAP_H_)
+#define _INFOMAP_H_
-#include "info.h"
+#include "general.h"
#define ESC '\033'
#define DEL '\177'
-#define TAB '\011'
+#define TAB '\011'
#define RET '\r'
#define LFD '\n'
#define SPC ' '
@@ -79,4 +79,4 @@ extern void keymap_discard_keymap ();
/* Initialize the info keymaps. */
extern void initialize_info_keymaps ();
-#endif /* not INFOMAP_H */
+#endif /* !_INFOMAP_H_ */
diff --git a/contrib/texinfo/info/m-x.c b/contrib/texinfo/info/m-x.c
index 28b8e80e730b..03ac1a522326 100644
--- a/contrib/texinfo/info/m-x.c
+++ b/contrib/texinfo/info/m-x.c
@@ -1,7 +1,9 @@
-/* m-x.c -- Meta-X minibuffer reader.
- $Id: m-x.c,v 1.5 1997/07/24 21:28:00 karl Exp $
+/* m-x.c -- Meta-X minibuffer reader. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,9 +24,9 @@
#include "info.h"
/* **************************************************************** */
-/* */
-/* Reading Named Commands */
-/* */
+/* */
+/* Reading Named Commands */
+/* */
/* **************************************************************** */
/* Read the name of an Info function in the echo area and return the
@@ -47,12 +49,12 @@ read_function_name (prompt, window)
REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = xstrdup (function_doc_array[i].func_name);
+ entry->label = strdup (function_doc_array[i].func_name);
entry->nodename = (char *)NULL;
entry->filename = (char *)NULL;
add_pointer_to_array
- (entry, array_index, array, array_slots, 200, REFERENCE *);
+ (entry, array_index, array, array_slots, 200, REFERENCE *);
}
line = info_read_completing_in_echo_area (window, prompt, array);
@@ -66,11 +68,11 @@ read_function_name (prompt, window)
}
DECLARE_INFO_COMMAND (describe_command,
- _("Read the name of an Info command and describe it"))
+ "Read the name of an Info command and describe it")
{
char *line;
- line = read_function_name (_("Describe command: "), window);
+ line = read_function_name ("Describe command: ", window);
if (!line)
{
@@ -81,19 +83,22 @@ DECLARE_INFO_COMMAND (describe_command,
/* Describe the function named in "LINE". */
if (*line)
{
- VFunction *fun = named_function (line);
+ char *fundoc;
+ VFunction *fun;
+
+ fun = named_function (line);
if (!fun)
- return;
+ return;
window_message_in_echo_area ("%s: %s.",
- line, function_documentation (fun));
+ line, function_documentation (fun));
}
free (line);
}
DECLARE_INFO_COMMAND (info_execute_command,
- _("Read a command name in the echo area and execute it"))
+ "Read a command name in the echo area and execute it")
{
char *line;
@@ -128,11 +133,11 @@ DECLARE_INFO_COMMAND (info_execute_command,
VFunction *function;
if ((active_window != the_echo_area) &&
- (strncmp (line, "echo-area-", 10) == 0))
+ (strncmp (line, "echo-area-", 10) == 0))
{
- free (line);
- info_error (_("Cannot execute an `echo-area' command here."));
- return;
+ free (line);
+ info_error ("Cannot execute an `echo-area' command here.");
+ return;
}
function = named_function (line);
@@ -147,7 +152,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
/* Okay, now that we have M-x, let the user set the screen height. */
DECLARE_INFO_COMMAND (set_screen_height,
- _("Set the height of the displayed window"))
+ "Set the height of the displayed window")
{
int new_height;
@@ -160,24 +165,24 @@ DECLARE_INFO_COMMAND (set_screen_height,
new_height = screenheight;
- sprintf (prompt, _("Set screen height to (%d): "), new_height);
+ sprintf (prompt, "Set screen height to (%d): ", new_height);
line = info_read_in_echo_area (window, prompt);
/* If the user aborted, do that now. */
if (!line)
- {
- info_abort_key (active_window, count, 0);
- return;
- }
+ {
+ info_abort_key (active_window, count, 0);
+ return;
+ }
/* Find out what the new height is supposed to be. */
if (*line)
- new_height = atoi (line);
+ new_height = atoi (line);
/* Clear the echo area if it isn't active. */
if (!echo_area_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
free (line);
}
diff --git a/contrib/texinfo/info/makedoc.c b/contrib/texinfo/info/makedoc.c
index c88663fcddf1..c0c4587ff181 100644
--- a/contrib/texinfo/info/makedoc.c
+++ b/contrib/texinfo/info/makedoc.c
@@ -1,10 +1,9 @@
-/* makedoc.c -- Make doc.c and funs.h from input files.
- $Id: makedoc.c,v 1.4 1997/07/15 18:35:59 karl Exp $
+/* makedoc.c -- Make DOC.C and FUNS.H from input files. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,8 +26,24 @@
a header file which describes the contents. This only does the functions
declared with DECLARE_INFO_COMMAND. */
-#include "info.h"
-
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+#include <sys/stat.h>
+#include "general.h"
+
+#if !defined (O_RDONLY)
+#if defined (HAVE_SYS_FCNTL_H)
+#include <sys/fcntl.h>
+#else /* !HAVE_SYS_FCNTL_H */
+#include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+#endif /* !O_RDONLY */
+
+extern void *xmalloc (), *xrealloc ();
static void fatal_file_error ();
/* Name of the header file which receives the declarations of functions. */
@@ -64,15 +79,15 @@ static char *doc_header_1[] = {
/* How to remember the locations of the functions found so that Emacs
can use the information in a tag table. */
typedef struct {
- char *name; /* Name of the tag. */
- int line; /* Line number at which it appears. */
- long char_offset; /* Character offset at which it appears. */
+ char *name; /* Name of the tag. */
+ int line; /* Line number at which it appears. */
+ long char_offset; /* Character offset at which it appears. */
} EMACS_TAG;
typedef struct {
- char *filename; /* Name of the file containing entries. */
- long entrylen; /* Total number of characters in tag block. */
- EMACS_TAG **entries; /* Entries found in FILENAME. */
+ char *filename; /* Name of the file containing entries. */
+ long entrylen; /* Total number of characters in tag block. */
+ EMACS_TAG **entries; /* Entries found in FILENAME. */
int entries_index;
int entries_slots;
} EMACS_TAG_BLOCK;
@@ -99,8 +114,8 @@ main (argc, argv)
for (i = 1; i < argc; i++)
if (strcmp (argv[i], "-tags") == 0)
{
- tags_only++;
- break;
+ tags_only++;
+ break;
}
if (tags_only)
@@ -113,8 +128,8 @@ main (argc, argv)
doc_stream = must_fopen (doc_filename, "w");
fprintf (funs_stream,
- "/* %s -- Generated declarations for Info commands. */\n",
- funs_filename);
+ "/* %s -- Generated declarations for Info commands. */\n",
+ funs_filename);
for (i = 0; doc_header[i]; i++)
{
@@ -123,7 +138,7 @@ main (argc, argv)
}
fprintf (doc_stream,
- _(" Source files groveled to make this file include:\n\n"));
+ " Source files groveled to make this file include:\n\n");
for (i = 1; i < argc; i++)
fprintf (doc_stream, "\t%s\n", argv[i]);
@@ -140,17 +155,17 @@ main (argc, argv)
curfile = argv[i];
if (*curfile == '-')
- continue;
+ continue;
fprintf (doc_stream, "/* Commands found in \"%s\". */\n", curfile);
fprintf (funs_stream, "\n/* Functions declared in \"%s\". */\n",
- curfile);
+ curfile);
process_one_file (curfile, doc_stream, funs_stream);
}
fprintf (doc_stream,
- " { (VFunction *)NULL, (char *)NULL, (char *)NULL }\n};\n");
+ " { (VFunction *)NULL, (char *)NULL, (char *)NULL }\n};\n");
fclose (funs_stream);
fclose (doc_stream);
@@ -180,25 +195,25 @@ maybe_dump_tags (stream)
/* Calculate the length of the dumped block first. */
for (j = 0; j < block->entries_index; j++)
- {
- char digits[30];
- etag = block->entries[j];
- block_len += 3 + strlen (etag->name);
- sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
- block_len += strlen (digits);
- }
+ {
+ char digits[30];
+ etag = block->entries[j];
+ block_len += 3 + strlen (etag->name);
+ sprintf (digits, "%d,%d", etag->line, etag->char_offset);
+ block_len += strlen (digits);
+ }
/* Print out the defining line. */
- fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
+ fprintf (stream, "\f\n%s,%d\n", block->filename, block_len);
/* Print out the individual tags. */
for (j = 0; j < block->entries_index; j++)
- {
- etag = block->entries[j];
+ {
+ etag = block->entries[j];
- fprintf (stream, "%s,\177%d,%ld\n",
- etag->name, etag->line, etag->char_offset);
- }
+ fprintf (stream, "%s,\177%d,%d\n",
+ etag->name, etag->line, etag->char_offset);
+ }
}
}
@@ -211,7 +226,7 @@ make_emacs_tag_block (filename)
EMACS_TAG_BLOCK *block;
block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK));
- block->filename = xstrdup (filename);
+ block->filename = strdup (filename);
block->entrylen = 0;
block->entries = (EMACS_TAG **)NULL;
block->entries_index = 0;
@@ -233,7 +248,7 @@ add_tag_to_block (block, name, line, char_offset)
tag->line = line;
tag->char_offset = char_offset;
add_pointer_to_array (tag, block->entries_index, block->entries,
- block->entries_slots, 50, EMACS_TAG *);
+ block->entries_slots, 50, EMACS_TAG *);
}
/* Read the file represented by FILENAME into core, and search it for Info
@@ -282,51 +297,51 @@ process_one_file (filename, doc_stream, funs_stream)
#endif /* NAMED_FUNCTIONS */
for (; offset < (file_size - decl_len); offset++)
- {
- if (buffer[offset] == '\n')
- {
- line_number++;
- line_start = offset + 1;
- }
-
- if (strncmp (buffer + offset, decl_str, decl_len) == 0)
- {
- offset += decl_len;
- point = offset;
- break;
- }
- }
+ {
+ if (buffer[offset] == '\n')
+ {
+ line_number++;
+ line_start = offset + 1;
+ }
+
+ if (strncmp (buffer + offset, decl_str, decl_len) == 0)
+ {
+ offset += decl_len;
+ point = offset;
+ break;
+ }
+ }
if (!point)
- break;
+ break;
/* Skip forward until we find the open paren. */
while (point < file_size)
- {
- if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
- else if (buffer[point] == '(')
- break;
-
- point++;
- }
+ {
+ if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+ else if (buffer[point] == '(')
+ break;
+
+ point++;
+ }
while (point++ < file_size)
- {
- if (!whitespace_or_newline (buffer[point]))
- break;
- else if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
- }
+ {
+ if (!whitespace_or_newline (buffer[point]))
+ break;
+ else if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+ }
if (point >= file_size)
- break;
+ break;
/* Now looking at name of function. Get it. */
for (offset = point; buffer[offset] != ','; offset++);
@@ -336,42 +351,42 @@ process_one_file (filename, doc_stream, funs_stream)
/* Remember this tag in the current block. */
{
- char *tag_name;
+ char *tag_name;
- tag_name = (char *)xmalloc (1 + (offset - line_start));
- strncpy (tag_name, buffer + line_start, offset - line_start);
- tag_name[offset - line_start] = '\0';
- add_tag_to_block (block, tag_name, line_number, point);
+ tag_name = (char *)xmalloc (1 + (offset - line_start));
+ strncpy (tag_name, buffer + line_start, offset - line_start);
+ tag_name[offset - line_start] = '\0';
+ add_tag_to_block (block, tag_name, line_number, point);
}
#if defined (NAMED_FUNCTIONS)
/* Generate the user-visible function name from the function's name. */
{
- register int i;
- char *name_start;
+ register int i;
+ char *name_start;
- name_start = func;
+ name_start = func;
- if (strncmp (name_start, "info_", 5) == 0)
- name_start += 5;
+ if (strncmp (name_start, "info_", 5) == 0)
+ name_start += 5;
- func_name = xstrdup (name_start);
+ func_name = strdup (name_start);
- /* Fix up "ea" commands. */
- if (strncmp (func_name, "ea_", 3) == 0)
- {
- char *temp_func_name;
+ /* Fix up "ea" commands. */
+ if (strncmp (func_name, "ea_", 3) == 0)
+ {
+ char *temp_func_name;
- temp_func_name = (char *)xmalloc (10 + strlen (func_name));
- strcpy (temp_func_name, "echo_area_");
- strcat (temp_func_name, func_name + 3);
- free (func_name);
- func_name = temp_func_name;
- }
+ temp_func_name = (char *)xmalloc (10 + strlen (func_name));
+ strcpy (temp_func_name, "echo_area_");
+ strcat (temp_func_name, func_name + 3);
+ free (func_name);
+ func_name = temp_func_name;
+ }
- for (i = 0; func_name[i]; i++)
- if (func_name[i] == '_')
- func_name[i] = '-';
+ for (i = 0; func_name[i]; i++)
+ if (func_name[i] == '_')
+ func_name[i] = '-';
}
#endif /* NAMED_FUNCTIONS */
@@ -379,40 +394,40 @@ process_one_file (filename, doc_stream, funs_stream)
point = offset + 1;
while (point < file_size)
- {
- if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
-
- if (buffer[point] == '"')
- break;
- else
- point++;
- }
+ {
+ if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+
+ if (buffer[point] == '"')
+ break;
+ else
+ point++;
+ }
offset = point + 1;
while (offset < file_size)
- {
- if (buffer[offset] == '\n')
- {
- line_number++;
- line_start = offset + 1;
- }
-
- if (buffer[offset] == '\\')
- offset += 2;
- else if (buffer[offset] == '"')
- break;
- else
- offset++;
- }
+ {
+ if (buffer[offset] == '\n')
+ {
+ line_number++;
+ line_start = offset + 1;
+ }
+
+ if (buffer[offset] == '\\')
+ offset += 2;
+ else if (buffer[offset] == '"')
+ break;
+ else
+ offset++;
+ }
offset++;
if (offset >= file_size)
- break;
+ break;
doc = (char *)xmalloc (1 + (offset - point));
strncpy (doc, buffer + point, offset - point);
@@ -435,7 +450,7 @@ process_one_file (filename, doc_stream, funs_stream)
free the memory already allocated to it. */
if (block->entries)
add_pointer_to_array (block, emacs_tags_index, emacs_tags,
- emacs_tags_slots, 10, EMACS_TAG_BLOCK *);
+ emacs_tags_slots, 10, EMACS_TAG_BLOCK *);
else
{
free (block->filename);
@@ -447,7 +462,7 @@ static void
fatal_file_error (filename)
char *filename;
{
- fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
+ fprintf (stderr, "Couldn't manipulate the file %s.\n", filename);
exit (2);
}
diff --git a/contrib/texinfo/info/man.c b/contrib/texinfo/info/man.c
index a6695950b30a..b899ec1d273f 100644
--- a/contrib/texinfo/info/man.c
+++ b/contrib/texinfo/info/man.c
@@ -1,7 +1,9 @@
-/* man.c: How to read and format man files.
- $Id: man.c,v 1.6 1997/07/31 23:49:59 karl Exp $
+/* man.c: How to read and format man files. */
- Copyright (C) 1995, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,6 +23,7 @@
#include "info.h"
#include <sys/ioctl.h>
+#include <sys/file.h>
#include "signals.h"
#if defined (HAVE_SYS_TIME_H)
#include <sys/time.h>
@@ -28,8 +31,8 @@
#if defined (HAVE_SYS_WAIT_H)
#include <sys/wait.h>
#endif
-
#include "tilde.h"
+
#include "man.h"
#if !defined (_POSIX_VERSION)
@@ -72,31 +75,31 @@ get_manpage_node (file_buffer, pagename)
page = get_manpage_contents (pagename);
if (page)
- {
- char header[1024];
- long oldsize, newsize;
- int hlen, plen;
-
- sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
- INFO_COOKIE,
- INFO_FILE_LABEL, file_buffer->filename,
- INFO_NODE_LABEL, pagename,
- INFO_UP_LABEL);
- oldsize = file_buffer->filesize;
- hlen = strlen (header);
- plen = strlen (page);
- newsize = (oldsize + hlen + plen);
- file_buffer->contents =
- (char *)xrealloc (file_buffer->contents, 1 + newsize);
- memcpy (file_buffer->contents + oldsize, header, hlen);
- oldsize += hlen;
- memcpy (file_buffer->contents + oldsize, page, plen);
- file_buffer->contents[newsize] = '\0';
- file_buffer->filesize = newsize;
- file_buffer->finfo.st_size = newsize;
- build_tags_and_nodes (file_buffer);
- free (page);
- }
+ {
+ char header[1024];
+ long oldsize, newsize;
+ int hlen, plen;
+
+ sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
+ INFO_COOKIE,
+ INFO_FILE_LABEL, file_buffer->filename,
+ INFO_NODE_LABEL, pagename,
+ INFO_UP_LABEL);
+ oldsize = file_buffer->filesize;
+ hlen = strlen (header);
+ plen = strlen (page);
+ newsize = (oldsize + hlen + plen);
+ file_buffer->contents =
+ (char *)xrealloc (file_buffer->contents, 1 + newsize);
+ memcpy (file_buffer->contents + oldsize, header, hlen);
+ oldsize += hlen;
+ memcpy (file_buffer->contents + oldsize, page, plen);
+ file_buffer->contents[newsize] = '\0';
+ file_buffer->filesize = newsize;
+ file_buffer->finfo.st_size = newsize;
+ build_tags_and_nodes (file_buffer);
+ free (page);
+ }
node = manpage_node_of_file_buffer (file_buffer, pagename);
}
@@ -107,9 +110,12 @@ get_manpage_node (file_buffer, pagename)
FILE_BUFFER *
create_manpage_file_buffer ()
{
- FILE_BUFFER *file_buffer = make_file_buffer ();
- file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME);
- file_buffer->fullpath = xstrdup (MANPAGE_FILE_BUFFER_NAME);
+ FILE_BUFFER *file_buffer;
+ struct stat *finfo;
+
+ file_buffer = make_file_buffer ();
+ file_buffer->filename = strdup (MANPAGE_FILE_BUFFER_NAME);
+ file_buffer->fullpath = strdup (MANPAGE_FILE_BUFFER_NAME);
file_buffer->finfo.st_size = 0;
file_buffer->filesize = 0;
file_buffer->contents = (char *)NULL;
@@ -131,24 +137,25 @@ executable_file_in_path (filename, path)
dirname_index = 0;
- while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
+ while (temp_dirname = extract_colon_unit (path, &dirname_index))
{
+ register int i;
char *temp;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
- {
- char *expanded_dirname;
+ {
+ char *expanded_dirname;
- expanded_dirname = tilde_expand_word (temp_dirname);
- free (temp_dirname);
- temp_dirname = expanded_dirname;
- }
+ expanded_dirname = tilde_expand_word (temp_dirname);
+ free (temp_dirname);
+ temp_dirname = expanded_dirname;
+ }
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
if (temp[(strlen (temp)) - 1] != '/')
- strcat (temp, "/");
+ strcat (temp, "/");
strcat (temp, filename);
free (temp_dirname);
@@ -157,10 +164,10 @@ executable_file_in_path (filename, path)
/* If we have found a regular executable file, then use it. */
if ((statable) && (S_ISREG (finfo.st_mode)) &&
- (access (temp, X_OK) == 0))
- return (temp);
+ (access (temp, X_OK) == 0))
+ return (temp);
else
- free (temp);
+ free (temp);
}
return ((char *)NULL);
}
@@ -214,7 +221,7 @@ static void
reap_children (sig)
int sig;
{
- int status;
+ unsigned int status;
wait (&status);
}
@@ -226,6 +233,7 @@ get_manpage_contents (pagename)
int pipes[2];
pid_t child;
char *formatted_page = (char *)NULL;
+ char *section = (char *)NULL;
int arg_index = 1;
if (formatter_args[0] == (char *)NULL)
@@ -257,7 +265,7 @@ get_manpage_contents (pagename)
if (child != 0)
{
/* In the parent, close the writing end of the pipe, and read from
- the exec'd child. */
+ the exec'd child. */
close (pipes[1]);
formatted_page = read_from_fd (pipes[0]);
close (pipes[0]);
@@ -265,16 +273,16 @@ get_manpage_contents (pagename)
else
{
/* In the child, close the read end of the pipe, make the write end
- of the pipe be stdout, and execute the man page formatter. */
+ of the pipe be stdout, and execute the man page formatter. */
close (pipes[0]);
close (fileno (stderr));
- close (fileno (stdin)); /* Don't print errors. */
+ close (fileno (stdin)); /* Don't print errors. */
dup2 (pipes[1], fileno (stdout));
execv (formatter_args[0], formatter_args);
/* If we get here, we couldn't exec, so close out the pipe and
- exit. */
+ exit. */
close (pipes[1]);
exit (0);
}
@@ -296,21 +304,21 @@ clean_manpage (manpage)
newpage = (char *)xmalloc (1 + strlen (manpage));
- for (i = 0, j = 0; (newpage[j] = manpage[i]); i++, j++)
+ for (i = 0, j = 0; newpage[j] = manpage[i]; i++, j++)
{
if (manpage[i] == '\n')
- newline_count++;
+ newline_count++;
else
- newline_count = 0;
+ newline_count = 0;
if (newline_count == 3)
- {
- j--;
- newline_count--;
- }
+ {
+ j--;
+ newline_count--;
+ }
if (manpage[i] == '\b' || manpage[i] == '\f')
- j -= 2;
+ j -= 2;
}
newpage[j++] = '\0';
@@ -331,11 +339,11 @@ manpage_node_of_file_buffer (file_buffer, pagename)
{
register int i;
- for (i = 0; (tag = file_buffer->tags[i]); i++)
- {
- if (strcasecmp (pagename, tag->nodename) == 0)
- break;
- }
+ for (i = 0; tag = file_buffer->tags[i]; i++)
+ {
+ if (strcasecmp (pagename, tag->nodename) == 0)
+ break;
+ }
}
if (tag)
@@ -451,7 +459,7 @@ find_reference_section (node)
{
position = search_forward (reference_section_starters[i], &frs_binding);
if (position != -1)
- break;
+ break;
}
if (position == -1)
@@ -465,11 +473,11 @@ find_reference_section (node)
for (i = frs_binding.start; i < frs_binding.end - 2; i++)
{
if ((frs_binding.buffer[i] == '\n') &&
- (!whitespace (frs_binding.buffer[i + 1])))
- {
- frs_binding.end = i;
- break;
- }
+ (!whitespace (frs_binding.buffer[i + 1])))
+ {
+ frs_binding.end = i;
+ break;
+ }
}
return (&frs_binding);
@@ -500,43 +508,43 @@ xrefs_of_manpage (node)
register int start, end;
for (start = position; start > reference_section->start; start--)
- if (whitespace (reference_section->buffer[start]))
- break;
+ if (whitespace (reference_section->buffer[start]))
+ break;
start++;
for (end = position; end < reference_section->end; end++)
- {
- if (whitespace (reference_section->buffer[end]))
- {
- end = start;
- break;
- }
-
- if (reference_section->buffer[end] == ')')
- {
- end++;
- break;
- }
- }
+ {
+ if (whitespace (reference_section->buffer[end]))
+ {
+ end = start;
+ break;
+ }
+
+ if (reference_section->buffer[end] == ')')
+ {
+ end++;
+ break;
+ }
+ }
if (end != start)
- {
- REFERENCE *entry;
- int len = end - start;
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = (char *)xmalloc (1 + len);
- strncpy (entry->label, (reference_section->buffer) + start, len);
- entry->label[len] = '\0';
- entry->filename = xstrdup (node->filename);
- entry->nodename = xstrdup (entry->label);
- entry->start = start;
- entry->end = end;
-
- add_pointer_to_array
- (entry, refs_index, refs, refs_slots, 10, REFERENCE *);
- }
+ {
+ REFERENCE *entry;
+ int len = end - start;
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = (char *)xmalloc (1 + len);
+ strncpy (entry->label, (reference_section->buffer) + start, len);
+ entry->label[len] = '\0';
+ entry->filename = strdup (node->filename);
+ entry->nodename = strdup (entry->label);
+ entry->start = start;
+ entry->end = end;
+
+ add_pointer_to_array
+ (entry, refs_index, refs, refs_slots, 10, REFERENCE *);
+ }
reference_section->start = position + 1;
}
@@ -550,6 +558,7 @@ locate_manpage_xref (node, start, dir)
long start;
int dir;
{
+ register int i, count;
REFERENCE **refs;
long position = -1;
@@ -564,27 +573,27 @@ locate_manpage_xref (node, start, dir)
count = i;
if (dir > 0)
- {
- for (i = 0; (entry = refs[i]); i++)
- if (entry->start > start)
- {
- position = entry->start;
- break;
- }
- }
+ {
+ for (i = 0; entry = refs[i]; i++)
+ if (entry->start > start)
+ {
+ position = entry->start;
+ break;
+ }
+ }
else
- {
- for (i = count - 1; i > -1; i--)
- {
- entry = refs[i];
-
- if (entry->start < start)
- {
- position = entry->start;
- break;
- }
- }
- }
+ {
+ for (i = count - 1; i > -1; i--)
+ {
+ entry = refs[i];
+
+ if (entry->start < start)
+ {
+ position = entry->start;
+ break;
+ }
+ }
+ }
info_free_references (refs);
}
@@ -613,20 +622,20 @@ manpage_xrefs_in_binding (node, binding)
start = binding->start + (binding->buffer - node->contents);
end = binding->end + (binding->buffer - node->contents);
- for (i = 0; (entry = all_refs[i]); i++)
+ for (i = 0; entry = all_refs[i]; i++)
{
if ((entry->start > start) && (entry->end < end))
- {
- add_pointer_to_array
- (entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
- }
+ {
+ add_pointer_to_array
+ (entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
+ }
else
- {
- maybe_free (entry->label);
- maybe_free (entry->filename);
- maybe_free (entry->nodename);
- free (entry);
- }
+ {
+ maybe_free (entry->label);
+ maybe_free (entry->filename);
+ maybe_free (entry->nodename);
+ free (entry);
+ }
}
free (all_refs);
diff --git a/contrib/texinfo/info/man.h b/contrib/texinfo/info/man.h
index 3cf4b162a503..1584e260687e 100644
--- a/contrib/texinfo/info/man.h
+++ b/contrib/texinfo/info/man.h
@@ -1,10 +1,9 @@
-/* man.h: Defines and external function declarations for man.c.
- $Id: man.h,v 1.2 1997/07/15 18:42:56 karl Exp $
+/* man.h: Defines and external function declarations for man.c */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */
-#ifndef INFO_MAN_H
-#define INFO_MAN_H
+#if !defined (_MAN_H_)
+#define _MAN_H_
#define MANPAGE_FILE_BUFFER_NAME "*manpages*"
@@ -34,4 +33,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */);
extern REFERENCE **xrefs_of_manpage (/* NODE *node */);
extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */);
-#endif /* INFO_MAN_H */
+#endif /* !_MAN_H_ */
diff --git a/contrib/texinfo/info/nodemenu.c b/contrib/texinfo/info/nodemenu.c
index 263265747427..7704170e7d2c 100644
--- a/contrib/texinfo/info/nodemenu.c
+++ b/contrib/texinfo/info/nodemenu.c
@@ -1,7 +1,9 @@
-/* nodemenu.c -- Produce a menu of all visited nodes.
- $Id: nodemenu.c,v 1.7 1997/07/24 21:30:30 karl Exp $
+/* nodemenu.c -- Produce a menu of all visited nodes. */
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +27,10 @@
static char *
nodemenu_format_info ()
{
- return (_("\n\
+ return ("\n\
* Menu:\n\
(File)Node Lines Size Containing File\n\
- ---------- ----- ---- ---------------"));
+ ---------- ----- ---- ---------------");
}
/* Produce a formatted line of information about NODE. Here is what we want
@@ -39,7 +41,7 @@ nodemenu_format_info ()
---------- ----- ---- ---------------
* (emacs)Buffers:: 48 2230 /usr/gnu/info/emacs/emacs-1
* (autoconf)Writing configure.in:: 123 58789 /usr/gnu/info/autoconf/autoconf-1
-* (dir)Top:: 40 589 /usr/gnu/info/dir
+* (dir)Top:: 40 589 /usr/gnu/info/dir
*/
static char *
format_node_info (node)
@@ -56,7 +58,7 @@ format_node_info (node)
{
parent = filename_non_directory (node->parent);
if (!parent)
- parent = node->parent;
+ parent = node->parent;
}
else
parent = (char *)NULL;
@@ -70,15 +72,15 @@ format_node_info (node)
char *file = (char *)NULL;
if (parent)
- file = parent;
+ file = parent;
else
- file = filename_non_directory (containing_file);
+ file = filename_non_directory (containing_file);
if (!file)
- file = containing_file;
+ file = containing_file;
if (!*file)
- file = "dir";
+ file = "dir";
sprintf (line_buffer, "* (%s)%s::", file, node->nodename);
}
@@ -90,7 +92,7 @@ format_node_info (node)
for (i = 0; i < node->nodelen; i++)
if (node->contents[i] == '\n')
- lines++;
+ lines++;
sprintf (line_buffer + len, "%d", lines);
}
@@ -104,7 +106,7 @@ format_node_info (node)
sprintf (line_buffer + len, node->filename);
}
- return xstrdup (line_buffer);
+ return (strdup (line_buffer));
}
/* Little string comparison routine for qsort (). */
@@ -135,26 +137,26 @@ get_visited_nodes (filter_func)
if (!info_windows)
return ((NODE *)NULL);
- for (iw_index = 0; (info_win = info_windows[iw_index]); iw_index++)
+ for (iw_index = 0; info_win = info_windows[iw_index]; iw_index++)
{
for (i = 0; i < info_win->nodes_index; i++)
- {
- node = info_win->nodes[i];
-
- /* We skip mentioning "*Node Menu*" nodes. */
- if (internal_info_node_p (node) &&
- (strcmp (node->nodename, nodemenu_nodename) == 0))
- continue;
-
- if (node && (!filter_func || (*filter_func) (node)))
- {
- char *line;
-
- line = format_node_info (node);
- add_pointer_to_array
- (line, lines_index, lines, lines_slots, 20, char *);
- }
- }
+ {
+ node = info_win->nodes[i];
+
+ /* We skip mentioning "*Node Menu*" nodes. */
+ if (internal_info_node_p (node) &&
+ (strcmp (node->nodename, nodemenu_nodename) == 0))
+ continue;
+
+ if (node && (!filter_func || (*filter_func) (node)))
+ {
+ char *line;
+
+ line = format_node_info (node);
+ add_pointer_to_array
+ (line, lines_index, lines, lines_slots, 20, char *);
+ }
+ }
}
/* Sort the array of information lines, if there are any. */
@@ -167,22 +169,22 @@ get_visited_nodes (filter_func)
/* Delete duplicates. */
for (i = 0, newlen = 1; i < lines_index - 1; i++)
- {
- if (strcmp (lines[i], lines[i + 1]) == 0)
- {
- free (lines[i]);
- lines[i] = (char *)NULL;
- }
- else
- newlen++;
- }
+ {
+ if (strcmp (lines[i], lines[i + 1]) == 0)
+ {
+ free (lines[i]);
+ lines[i] = (char *)NULL;
+ }
+ else
+ newlen++;
+ }
/* We have free ()'d and marked all of the duplicate slots.
- Copy the live slots rather than pruning the dead slots. */
+ Copy the live slots rather than pruning the dead slots. */
temp = (char **)xmalloc ((1 + newlen) * sizeof (char *));
for (i = 0, j = 0; i < lines_index; i++)
- if (lines[i])
- temp[j++] = lines[i];
+ if (lines[i])
+ temp[j++] = lines[i];
temp[j] = (char *)NULL;
free (lines);
@@ -194,8 +196,8 @@ get_visited_nodes (filter_func)
printf_to_message_buffer
("%s", replace_in_documentation
- (_("Here is the menu of nodes you have recently visited.\n\
-Select one from this menu, or use `\\[history-node]' in another window.\n")));
+ ("Here is the menu of nodes you have recently visited.\n\
+Select one from this menu, or use `\\[history-node]' in another window.\n"));
printf_to_message_buffer ("%s\n", nodemenu_format_info ());
@@ -214,7 +216,7 @@ Select one from this menu, or use `\\[history-node]' in another window.\n")));
}
DECLARE_INFO_COMMAND (list_visited_nodes,
- _("Make a window containing a menu of all of the currently visited nodes"))
+ "Make a window containing a menu of all of the currently visited nodes")
{
WINDOW *new;
NODE *node;
@@ -227,20 +229,14 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = new->node;
if (internal_info_node_p (node) &&
- (strcmp (node->nodename, nodemenu_nodename) == 0))
- break;
+ (strcmp (node->nodename, nodemenu_nodename) == 0))
+ break;
}
/* If we couldn't find an existing window, try to use the next window
in the chain. */
- if (!new)
- {
- if (window->next)
- new = window->next;
- /* If there is more than one window, wrap around. */
- else if (window != windows)
- new = windows;
- }
+ if (!new && window->next)
+ new = window->next;
/* If we still don't have a window, make a new one to contain the list. */
if (!new)
@@ -262,16 +258,10 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = get_visited_nodes ((Function *)NULL);
name_internal_node (node, nodemenu_nodename);
-#if 0
/* Even if this is an internal node, we don't want the window
system to treat it specially. So we turn off the internalness
of it here. */
- /* Why? We depend on internal_info_node_p returning true, so we must
- not remove the flag. Otherwise, the *Node Menu* nodes themselves
- appear in the node menu. --Andreas Schwab
- <schwab@issan.informatik.uni-dortmund.de>. */
node->flags &= ~N_IsInternal;
-#endif
/* If this window is already showing a node menu, reuse the existing node
slot. */
@@ -280,7 +270,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
#if defined (NOTDEF)
if (internal_info_node_p (new->node) &&
- (strcmp (new->node->nodename, nodemenu_nodename) == 0))
+ (strcmp (new->node->nodename, nodemenu_nodename) == 0))
remember_me = 0;
#endif /* NOTDEF */
@@ -294,7 +284,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
}
DECLARE_INFO_COMMAND (select_visited_node,
- _("Select a node which has been previously visited in a visible window"))
+ "Select a node which has been previously visited in a visible window")
{
char *line;
NODE *node;
@@ -306,7 +296,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
free (node);
line =
- info_read_completing_in_echo_area (window, _("Select visited node: "), menu);
+ info_read_completing_in_echo_area (window, "Select visited node: ", menu);
window = active_window;
@@ -326,9 +316,9 @@ DECLARE_INFO_COMMAND (select_visited_node,
entry = info_get_labeled_reference (line, menu);
if (!entry)
- info_error (_("The reference disappeared! (%s)."), line);
+ info_error ("The reference disappeared! (%s).", line);
else
- info_select_reference (window, entry);
+ info_select_reference (window, entry);
}
free (line);
diff --git a/contrib/texinfo/info/nodes.c b/contrib/texinfo/info/nodes.c
index f2737e7b354c..8995c78195f6 100644
--- a/contrib/texinfo/info/nodes.c
+++ b/contrib/texinfo/info/nodes.c
@@ -21,8 +21,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
-
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+#include <sys/errno.h>
+#include <sys/stat.h>
+#if defined (HAVE_STRING_H)
+#include <string.h>
+#endif /* HAVE_STRING_H */
#include "nodes.h"
#include "search.h"
#include "filesys.h"
@@ -32,10 +41,22 @@
# include "man.h"
#endif /* HANDLE_MAN_PAGES */
+#if !defined (O_RDONLY)
+#if defined (HAVE_SYS_FCNTL_H)
+#include <sys/fcntl.h>
+#else /* !HAVE_SYS_FCNTL_H */
+#include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+#endif /* !O_RDONLY */
+
+#if !defined (errno)
+extern int errno;
+#endif /* !errno */
+
/* **************************************************************** */
-/* */
-/* Functions Static to this File */
-/* */
+/* */
+/* Functions Static to this File */
+/* */
/* **************************************************************** */
static void forget_info_file (), remember_info_file ();
@@ -60,9 +81,9 @@ static long get_node_length ();
#define INFO_GET_TAGS 1
/* **************************************************************** */
-/* */
-/* Global Variables */
-/* */
+/* */
+/* Global Variables */
+/* */
/* **************************************************************** */
/* When non-zero, this is a string describing the recent file error. */
@@ -75,9 +96,9 @@ FILE_BUFFER **info_loaded_files = (FILE_BUFFER **)NULL;
int info_loaded_files_slots = 0;
/* **************************************************************** */
-/* */
-/* Public Functions for Node Manipulation */
-/* */
+/* */
+/* Public Functions for Node Manipulation */
+/* */
/* **************************************************************** */
/* Used to build "dir" menu from "localdir" files found in INFOPATH. */
@@ -121,8 +142,8 @@ info_get_node (filename, nodename)
if (!file_buffer)
{
if (filesys_error_number)
- info_recent_file_error =
- filesys_error_string (filename, filesys_error_number);
+ info_recent_file_error =
+ filesys_error_string (filename, filesys_error_number);
return ((NODE *)NULL);
}
@@ -133,9 +154,9 @@ info_get_node (filename, nodename)
{
node = info_get_node_of_file_buffer ("Top", file_buffer);
if (!node)
- node = info_get_node_of_file_buffer ("top", file_buffer);
+ node = info_get_node_of_file_buffer ("top", file_buffer);
if (!node)
- node = info_get_node_of_file_buffer ("TOP", file_buffer);
+ node = info_get_node_of_file_buffer ("TOP", file_buffer);
}
return (node);
}
@@ -172,7 +193,7 @@ info_get_node_of_file_buffer (nodename, file_buffer)
node = (NODE *)xmalloc (sizeof (NODE));
node->filename = file_buffer->fullpath;
node->parent = (char *)NULL;
- node->nodename = xstrdup ("*");
+ node->nodename = strdup ("*");
node->contents = file_buffer->contents;
node->nodelen = file_buffer->filesize;
node->flags = 0;
@@ -182,7 +203,7 @@ info_get_node_of_file_buffer (nodename, file_buffer)
the manpage node finding function instead. */
else if (file_buffer->flags & N_IsManPage)
{
- node = get_manpage_node (file_buffer, nodename);
+ node = get_manpage_node (file_buffer, nodename);
}
#endif /* HANDLE_MAN_PAGES */
/* If this is the "main" info file, it might contain a tags table. Search
@@ -221,9 +242,9 @@ info_load_file (filename)
/* **************************************************************** */
-/* */
-/* Private Functions Implementation */
-/* */
+/* */
+/* Private Functions Implementation */
+/* */
/* **************************************************************** */
/* The workhorse for info_find_file (). Non-zero 2nd argument says to
@@ -242,58 +263,58 @@ info_find_file_internal (filename, get_tags)
/* First try to find the file in our list of already loaded files. */
if (info_loaded_files)
{
- for (i = 0; (file_buffer = info_loaded_files[i]); i++)
- if ((strcmp (filename, file_buffer->filename) == 0) ||
- (strcmp (filename, file_buffer->fullpath) == 0) ||
- ((*filename != '/') &&
- strcmp (filename,
- filename_non_directory (file_buffer->fullpath)) == 0))
- {
- struct stat new_info, *old_info;
-
- /* This file is loaded. If the filename that we want is
- specifically "dir", then simply return the file buffer. */
- if (strcasecmp (filename_non_directory (filename), "dir") == 0)
- return (file_buffer);
+ for (i = 0; file_buffer = info_loaded_files[i]; i++)
+ if ((strcmp (filename, file_buffer->filename) == 0) ||
+ (strcmp (filename, file_buffer->fullpath) == 0) ||
+ ((*filename != '/') &&
+ strcmp (filename,
+ filename_non_directory (file_buffer->fullpath)) == 0))
+ {
+ struct stat new_info, *old_info;
+
+ /* This file is loaded. If the filename that we want is
+ specifically "dir", then simply return the file buffer. */
+ if (strcasecmp (filename_non_directory (filename), "dir") == 0)
+ return (file_buffer);
#if defined (HANDLE_MAN_PAGES)
- /* Do the same for the magic MANPAGE file. */
- if (file_buffer->flags & N_IsManPage)
- return (file_buffer);
+ /* Do the same for the magic MANPAGE file. */
+ if (file_buffer->flags & N_IsManPage)
+ return (file_buffer);
#endif /* HANDLE_MAN_PAGES */
- /* The file appears to be already loaded, and it is not "dir".
- Check to see if it has changed since the last time it was
- loaded. */
- if (stat (file_buffer->fullpath, &new_info) == -1)
- {
- filesys_error_number = errno;
- return ((FILE_BUFFER *)NULL);
- }
-
- old_info = &file_buffer->finfo;
-
- if ((new_info.st_size != old_info->st_size) ||
- (new_info.st_mtime != old_info->st_mtime))
- {
- /* The file has changed. Forget that we ever had loaded it
- in the first place. */
- forget_info_file (filename);
- break;
- }
- else
- {
- /* The info file exists, and has not changed since the last
- time it was loaded. If the caller requested a nodes list
- for this file, and there isn't one here, build the nodes
- for this file_buffer. In any case, return the file_buffer
- object. */
- if (get_tags && !file_buffer->tags)
- build_tags_and_nodes (file_buffer);
-
- return (file_buffer);
- }
- }
+ /* The file appears to be already loaded, and it is not "dir".
+ Check to see if it has changed since the last time it was
+ loaded. */
+ if (stat (file_buffer->fullpath, &new_info) == -1)
+ {
+ filesys_error_number = errno;
+ return ((FILE_BUFFER *)NULL);
+ }
+
+ old_info = &file_buffer->finfo;
+
+ if ((new_info.st_size != old_info->st_size) ||
+ (new_info.st_mtime != old_info->st_mtime))
+ {
+ /* The file has changed. Forget that we ever had loaded it
+ in the first place. */
+ forget_info_file (filename);
+ break;
+ }
+ else
+ {
+ /* The info file exists, and has not changed since the last
+ time it was loaded. If the caller requested a nodes list
+ for this file, and there isn't one here, build the nodes
+ for this file_buffer. In any case, return the file_buffer
+ object. */
+ if (get_tags && !file_buffer->tags)
+ build_tags_and_nodes (file_buffer);
+
+ return (file_buffer);
+ }
+ }
}
/* The file wasn't loaded. Try to load it now. */
@@ -343,21 +364,21 @@ info_load_file_internal (filename, get_tags)
char *lowered_name;
char *basename;
- lowered_name = xstrdup (filename);
+ lowered_name = strdup (filename);
basename = (char *) strrchr (lowered_name, '/');
if (basename)
- basename++;
+ basename++;
else
- basename = lowered_name;
+ basename = lowered_name;
while (*basename)
- {
- if (isupper (*basename))
- *basename = tolower (*basename);
+ {
+ if (isupper (*basename))
+ *basename = tolower (*basename);
- basename++;
- }
+ basename++;
+ }
fullpath = info_find_fullpath (lowered_name);
free (lowered_name);
@@ -381,8 +402,8 @@ info_load_file_internal (filename, get_tags)
/* The file was found, and can be read. Allocate FILE_BUFFER and fill
in the various members. */
file_buffer = make_file_buffer ();
- file_buffer->filename = xstrdup (filename);
- file_buffer->fullpath = xstrdup (fullpath);
+ file_buffer->filename = strdup (filename);
+ file_buffer->fullpath = strdup (fullpath);
file_buffer->finfo = finfo;
file_buffer->filesize = filesize;
file_buffer->contents = contents;
@@ -423,81 +444,81 @@ build_tags_and_nodes (file_buffer)
if (position != -1)
while (1)
{
- long tags_table_begin, tags_table_end;
-
- binding.end = position;
- binding.start = binding.end - 5 - strlen (TAGS_TABLE_END_LABEL);
- if (binding.start < 0)
- binding.start = 0;
-
- position = find_node_separator (&binding);
-
- /* For this test, (and all others here) failure indicates a bogus
- tags table. Grovel the file. */
- if (position == -1)
- break;
-
- /* Remember the end of the tags table. */
- binding.start = position;
- tags_table_end = binding.start;
- binding.end = 0;
-
- /* Locate the start of the tags table. */
- position = search_backward (TAGS_TABLE_BEG_LABEL, &binding);
-
- if (position == -1)
- break;
-
- binding.end = position;
- binding.start = binding.end - 5 - strlen (TAGS_TABLE_BEG_LABEL);
- position = find_node_separator (&binding);
-
- if (position == -1)
- break;
-
- /* The file contains a valid tags table. Fill the FILE_BUFFER's
- tags member. */
- file_buffer->flags |= N_HasTagsTable;
- tags_table_begin = position;
-
- /* If this isn't an indirect tags table, just remember the nodes
- described locally in this tags table. Note that binding.end
- is pointing to just after the beginning label. */
- binding.start = binding.end;
- binding.end = file_buffer->filesize;
-
- if (!looking_at (TAGS_TABLE_IS_INDIRECT_LABEL, &binding))
- {
- binding.start = tags_table_begin;
- binding.end = tags_table_end;
- get_nodes_of_tags_table (file_buffer, &binding);
- return;
- }
- else
- {
- /* This is an indirect tags table. Build TAGS member. */
- SEARCH_BINDING indirect;
-
- indirect.start = tags_table_begin;
- indirect.end = 0;
- indirect.buffer = binding.buffer;
- indirect.flags = S_FoldCase;
-
- position = search_backward (INDIRECT_TAGS_TABLE_LABEL, &indirect);
-
- if (position == -1)
- {
- /* This file is malformed. Give up. */
- return;
- }
-
- indirect.start = position;
- indirect.end = tags_table_begin;
- binding.start = tags_table_begin;
- binding.end = tags_table_end;
- get_tags_of_indirect_tags_table (file_buffer, &indirect, &binding);
- return;
- }
+ long tags_table_begin, tags_table_end;
+
+ binding.end = position;
+ binding.start = binding.end - 5 - strlen (TAGS_TABLE_END_LABEL);
+ if (binding.start < 0)
+ binding.start = 0;
+
+ position = find_node_separator (&binding);
+
+ /* For this test, (and all others here) failure indicates a bogus
+ tags table. Grovel the file. */
+ if (position == -1)
+ break;
+
+ /* Remember the end of the tags table. */
+ binding.start = position;
+ tags_table_end = binding.start;
+ binding.end = 0;
+
+ /* Locate the start of the tags table. */
+ position = search_backward (TAGS_TABLE_BEG_LABEL, &binding);
+
+ if (position == -1)
+ break;
+
+ binding.end = position;
+ binding.start = binding.end - 5 - strlen (TAGS_TABLE_BEG_LABEL);
+ position = find_node_separator (&binding);
+
+ if (position == -1)
+ break;
+
+ /* The file contains a valid tags table. Fill the FILE_BUFFER's
+ tags member. */
+ file_buffer->flags |= N_HasTagsTable;
+ tags_table_begin = position;
+
+ /* If this isn't an indirect tags table, just remember the nodes
+ described locally in this tags table. Note that binding.end
+ is pointing to just after the beginning label. */
+ binding.start = binding.end;
+ binding.end = file_buffer->filesize;
+
+ if (!looking_at (TAGS_TABLE_IS_INDIRECT_LABEL, &binding))
+ {
+ binding.start = tags_table_begin;
+ binding.end = tags_table_end;
+ get_nodes_of_tags_table (file_buffer, &binding);
+ return;
+ }
+ else
+ {
+ /* This is an indirect tags table. Build TAGS member. */
+ SEARCH_BINDING indirect;
+
+ indirect.start = tags_table_begin;
+ indirect.end = 0;
+ indirect.buffer = binding.buffer;
+ indirect.flags = S_FoldCase;
+
+ position = search_backward (INDIRECT_TAGS_TABLE_LABEL, &indirect);
+
+ if (position == -1)
+ {
+ /* This file is malformed. Give up. */
+ return;
+ }
+
+ indirect.start = position;
+ indirect.end = tags_table_begin;
+ binding.start = tags_table_begin;
+ binding.end = tags_table_end;
+ get_tags_of_indirect_tags_table (file_buffer, &indirect, &binding);
+ return;
+ }
}
/* This file doesn't contain any kind of tags table. Grovel the
@@ -540,37 +561,37 @@ get_nodes_of_info_file (file_buffer)
/* If not there, this is not the start of a node. */
if (start == -1)
- continue;
+ continue;
/* Find the start of the nodename. */
start += skip_whitespace (nodeline + start);
/* Find the end of the nodename. */
end = start +
- skip_node_characters (nodeline + start, DONT_SKIP_NEWLINES);
+ skip_node_characters (nodeline + start, DONT_SKIP_NEWLINES);
/* Okay, we have isolated the node name, and we know where the
- node starts. Remember this information in a NODE structure. */
+ node starts. Remember this information in a NODE structure. */
entry = (TAG *)xmalloc (sizeof (TAG));
entry->nodename = (char *)xmalloc (1 + (end - start));
strncpy (entry->nodename, nodeline + start, end - start);
entry->nodename[end - start] = '\0';
entry->nodestart = nodestart;
{
- SEARCH_BINDING node_body;
+ SEARCH_BINDING node_body;
- node_body.buffer = binding.buffer + binding.start;
- node_body.start = 0;
- node_body.end = binding.end - binding.start;
- node_body.flags = S_FoldCase;
- entry->nodelen = get_node_length (&node_body);
+ node_body.buffer = binding.buffer + binding.start;
+ node_body.start = 0;
+ node_body.end = binding.end - binding.start;
+ node_body.flags = S_FoldCase;
+ entry->nodelen = get_node_length (&node_body);
}
entry->filename = file_buffer->fullpath;
/* Add this tag to the array of tag structures in this FILE_BUFFER. */
add_pointer_to_array (entry, tags_index, file_buffer->tags,
- file_buffer->tags_slots, 100, TAG *);
+ file_buffer->tags_slots, 100, TAG *);
}
}
@@ -587,7 +608,7 @@ get_node_length (binding)
for (i = binding->start, body = binding->buffer; i < binding->end; i++)
{
if (body[i] == INFO_FF || body[i] == INFO_COOKIE)
- break;
+ break;
}
return ((long) i - binding->start);
}
@@ -631,16 +652,16 @@ get_nodes_of_tags_table (file_buffer, buffer_binding)
/* Skip past informative "(Indirect)" tags table line. */
if (!tags_index && looking_at (TAGS_TABLE_IS_INDIRECT_LABEL, search))
- continue;
+ continue;
/* Find the label preceding the node name. */
offset =
- string_in_line (INFO_NODE_LABEL, search->buffer + search->start);
+ string_in_line (INFO_NODE_LABEL, search->buffer + search->start);
/* If not there, not a defining line, so we must be out of the
- tags table. */
+ tags table. */
if (offset == -1)
- break;
+ break;
/* Point to the beginning of the node definition. */
search->start += offset;
@@ -649,11 +670,11 @@ get_nodes_of_tags_table (file_buffer, buffer_binding)
/* Move past the node's name. */
for (offset = 0;
- (nodedef[offset]) && (nodedef[offset] != INFO_TAGSEP);
- offset++);
+ (nodedef[offset]) && (nodedef[offset] != INFO_TAGSEP);
+ offset++);
if (nodedef[offset] != INFO_TAGSEP)
- continue;
+ continue;
entry = (TAG *)xmalloc (sizeof (TAG));
entry->nodename = (char *)xmalloc (1 + offset);
@@ -666,13 +687,13 @@ get_nodes_of_tags_table (file_buffer, buffer_binding)
entry->nodelen = -1;
/* The filename of this node is currently known as the same as the
- name of this file. */
+ name of this file. */
entry->filename = file_buffer->fullpath;
/* Add this node structure to the array of node structures in this
- FILE_BUFFER. */
+ FILE_BUFFER. */
add_pointer_to_array (entry, tags_index, file_buffer->tags,
- file_buffer->tags_slots, 100, TAG *);
+ file_buffer->tags_slots, 100, TAG *);
}
free (search);
}
@@ -713,23 +734,23 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
while (line < end)
{
- int colon;
+ int colon;
- colon = string_in_line (":", line);
+ colon = string_in_line (":", line);
- if (colon == -1)
- break;
+ if (colon == -1)
+ break;
- subfile = (SUBFILE *)xmalloc (sizeof (SUBFILE));
- subfile->filename = (char *)xmalloc (colon);
- strncpy (subfile->filename, line, colon - 1);
- subfile->filename[colon - 1] = '\0';
- subfile->first_byte = (long) atol (line + colon);
+ subfile = (SUBFILE *)xmalloc (sizeof (SUBFILE));
+ subfile->filename = (char *)xmalloc (colon);
+ strncpy (subfile->filename, line, colon - 1);
+ subfile->filename[colon - 1] = '\0';
+ subfile->first_byte = (long) atol (line + colon);
- add_pointer_to_array
- (subfile, subfiles_index, subfiles, subfiles_slots, 10, SUBFILE *);
+ add_pointer_to_array
+ (subfile, subfiles_index, subfiles, subfiles_slots, 10, SUBFILE *);
- while (*line++ != '\n');
+ while (*line++ != '\n');
}
}
@@ -747,10 +768,10 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
SEARCH_BINDING binding;
/* Find the length of the header of the file containing the indirect
- tags table. This header appears at the start of every file. We
- want the absolute position of each node within each subfile, so
- we subtract the start of the containing subfile from the logical
- position of the node, and then add the length of the header in. */
+ tags table. This header appears at the start of every file. We
+ want the absolute position of each node within each subfile, so
+ we subtract the start of the containing subfile from the logical
+ position of the node, and then add the length of the header in. */
binding.buffer = file_buffer->contents;
binding.start = 0;
binding.end = file_buffer->filesize;
@@ -758,80 +779,81 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
header_length = find_node_separator (&binding);
if (header_length == -1)
- header_length = 0;
+ header_length = 0;
/* Build the file buffer's list of subfiles. */
{
- char *containing_dir, *temp;
- int len_containing_dir;
+ char *containing_dir, *temp;
+ int len_containing_dir;
- containing_dir = xstrdup (file_buffer->fullpath);
- temp = (char *) strrchr (containing_dir, '/');
+ containing_dir = strdup (file_buffer->fullpath);
+ temp = (char *) strrchr (containing_dir, '/');
- if (temp)
- *temp = '\0';
+ if (temp)
+ *temp = '\0';
- len_containing_dir = strlen (containing_dir);
+ len_containing_dir = strlen (containing_dir);
- for (i = 0; subfiles[i]; i++);
+ for (i = 0; subfiles[i]; i++);
- file_buffer->subfiles = (char **) xmalloc ((1 + i) * sizeof (char *));
+ file_buffer->subfiles = (char **) xmalloc ((1 + i) * sizeof (char *));
- for (i = 0; subfiles[i]; i++)
- {
- char *fullpath;
+ for (i = 0; subfiles[i]; i++)
+ {
+ char *fullpath;
- fullpath = (char *) xmalloc
- (2 + strlen (subfiles[i]->filename) + len_containing_dir);
+ fullpath = (char *) xmalloc
+ (2 + strlen (subfiles[i]->filename) + len_containing_dir);
- sprintf (fullpath, "%s/%s",
- containing_dir, subfiles[i]->filename);
+ sprintf (fullpath, "%s/%s",
+ containing_dir, subfiles[i]->filename);
- file_buffer->subfiles[i] = fullpath;
- }
- file_buffer->subfiles[i] = (char *)NULL;
- free (containing_dir);
+ file_buffer->subfiles[i] = fullpath;
+ }
+ file_buffer->subfiles[i] = (char *)NULL;
+ free (containing_dir);
}
/* For each node in the file's tags table, remember the starting
- position. */
- for (tags_index = 0; (entry = file_buffer->tags[tags_index]);
- tags_index++)
- {
- for (i = 0;
- subfiles[i] && entry->nodestart >= subfiles[i]->first_byte;
- i++);
-
- /* If the Info file containing the indirect tags table is
- malformed, then give up. */
- if (!i)
- {
- /* The Info file containing the indirect tags table is
- malformed. Give up. */
- for (i = 0; subfiles[i]; i++)
- {
- free (subfiles[i]->filename);
- free (subfiles[i]);
- free (file_buffer->subfiles[i]);
- }
- file_buffer->subfiles = (char **)NULL;
- free_file_buffer_tags (file_buffer);
- return;
- }
-
- /* SUBFILES[i] is the index of the first subfile whose logical
- first byte is greater than the logical offset of this node's
- starting position. This means that the subfile directly
- preceding this one is the one containing the node. */
-
- entry->filename = file_buffer->subfiles[i - 1];
- entry->nodestart -= subfiles[i -1]->first_byte;
- entry->nodestart += header_length;
- entry->nodelen = -1;
- }
+ position. */
+ for (tags_index = 0;
+ entry = file_buffer->tags[tags_index];
+ tags_index++)
+ {
+ for (i = 0;
+ subfiles[i] && entry->nodestart >= subfiles[i]->first_byte;
+ i++);
+
+ /* If the Info file containing the indirect tags table is
+ malformed, then give up. */
+ if (!i)
+ {
+ /* The Info file containing the indirect tags table is
+ malformed. Give up. */
+ for (i = 0; subfiles[i]; i++)
+ {
+ free (subfiles[i]->filename);
+ free (subfiles[i]);
+ free (file_buffer->subfiles[i]);
+ }
+ file_buffer->subfiles = (char **)NULL;
+ free_file_buffer_tags (file_buffer);
+ return;
+ }
+
+ /* SUBFILES[i] is the index of the first subfile whose logical
+ first byte is greater than the logical offset of this node's
+ starting position. This means that the subfile directly
+ preceding this one is the one containing the node. */
+
+ entry->filename = file_buffer->subfiles[i - 1];
+ entry->nodestart -= subfiles[i -1]->first_byte;
+ entry->nodestart += header_length;
+ entry->nodelen = -1;
+ }
/* We have successfully built the tags table. Remember that it
- was indirect. */
+ was indirect. */
file_buffer->flags |= N_TagsIndirect;
}
@@ -856,105 +878,105 @@ info_node_of_file_buffer_tags (file_buffer, nodename)
register int i;
TAG *tag;
- for (i = 0; (tag = file_buffer->tags[i]); i++)
+ for (i = 0; tag = file_buffer->tags[i]; i++)
if (strcmp (nodename, tag->nodename) == 0)
{
- FILE_BUFFER *subfile;
-
- subfile = info_find_file_internal (tag->filename, INFO_NO_TAGS);
-
- if (!subfile)
- return ((NODE *)NULL);
-
- if (!subfile->contents)
- {
- info_reload_file_buffer_contents (subfile);
-
- if (!subfile->contents)
- return ((NODE *)NULL);
- }
-
- /* If we were able to find this file and load it, then return
- the node within it. */
- {
- NODE *node;
-
- node = (NODE *)xmalloc (sizeof (NODE));
- node->filename = (subfile->fullpath);
- node->nodename = tag->nodename;
- node->contents = subfile->contents + tag->nodestart;
- node->flags = 0;
- node->parent = (char *)NULL;
-
- if (file_buffer->flags & N_HasTagsTable)
- {
- node->flags |= N_HasTagsTable;
-
- if (file_buffer->flags & N_TagsIndirect)
- {
- node->flags |= N_TagsIndirect;
- node->parent = file_buffer->fullpath;
- }
- }
-
- if (subfile->flags & N_IsCompressed)
- node->flags |= N_IsCompressed;
-
- /* If TAG->nodelen hasn't been calculated yet, then we aren't
- in a position to trust the entry pointer. Adjust things so
- that ENTRY->nodestart gets the exact address of the start of
- the node separator which starts this node, and NODE->contents
- gets the address of the line defining this node. If we cannot
- do that, the node isn't really here. */
- if (tag->nodelen == -1)
- {
- int min, max;
- char *node_sep;
- SEARCH_BINDING node_body;
- char *buff_end;
-
- min = max = DEFAULT_INFO_FUDGE;
-
- if (tag->nodestart < DEFAULT_INFO_FUDGE)
- min = tag->nodestart;
-
- if (DEFAULT_INFO_FUDGE >
- (subfile->filesize - tag->nodestart))
- max = subfile->filesize - tag->nodestart;
-
- /* NODE_SEP gets the address of the separator which defines
- this node, or (char *)NULL if the node wasn't found.
- NODE->contents is side-effected to point to right after
- the separator. */
- node_sep = adjust_nodestart (node, min, max);
- if (node_sep == (char *)NULL)
- {
- free (node);
- return ((NODE *)NULL);
- }
- /* Readjust tag->nodestart. */
- tag->nodestart = node_sep - subfile->contents;
-
- /* Calculate the length of the current node. */
- buff_end = subfile->contents + subfile->filesize;
-
- node_body.buffer = node->contents;
- node_body.start = 0;
- node_body.end = buff_end - node_body.buffer;
- node_body.flags = 0;
- tag->nodelen = get_node_length (&node_body);
- }
- else
- {
- /* Since we know the length of this node, we have already
- adjusted tag->nodestart to point to the exact start of
- it. Simply skip the node separator. */
- node->contents += skip_node_separator (node->contents);
- }
-
- node->nodelen = tag->nodelen;
- return (node);
- }
+ FILE_BUFFER *subfile;
+
+ subfile = info_find_file_internal (tag->filename, INFO_NO_TAGS);
+
+ if (!subfile)
+ return ((NODE *)NULL);
+
+ if (!subfile->contents)
+ {
+ info_reload_file_buffer_contents (subfile);
+
+ if (!subfile->contents)
+ return ((NODE *)NULL);
+ }
+
+ /* If we were able to find this file and load it, then return
+ the node within it. */
+ {
+ NODE *node;
+
+ node = (NODE *)xmalloc (sizeof (NODE));
+ node->filename = (subfile->fullpath);
+ node->nodename = tag->nodename;
+ node->contents = subfile->contents + tag->nodestart;
+ node->flags = 0;
+ node->parent = (char *)NULL;
+
+ if (file_buffer->flags & N_HasTagsTable)
+ {
+ node->flags |= N_HasTagsTable;
+
+ if (file_buffer->flags & N_TagsIndirect)
+ {
+ node->flags |= N_TagsIndirect;
+ node->parent = file_buffer->fullpath;
+ }
+ }
+
+ if (subfile->flags & N_IsCompressed)
+ node->flags |= N_IsCompressed;
+
+ /* If TAG->nodelen hasn't been calculated yet, then we aren't
+ in a position to trust the entry pointer. Adjust things so
+ that ENTRY->nodestart gets the exact address of the start of
+ the node separator which starts this node, and NODE->contents
+ gets the address of the line defining this node. If we cannot
+ do that, the node isn't really here. */
+ if (tag->nodelen == -1)
+ {
+ int min, max;
+ char *node_sep;
+ SEARCH_BINDING node_body;
+ char *buff_end;
+
+ min = max = DEFAULT_INFO_FUDGE;
+
+ if (tag->nodestart < DEFAULT_INFO_FUDGE)
+ min = tag->nodestart;
+
+ if (DEFAULT_INFO_FUDGE >
+ (subfile->filesize - tag->nodestart))
+ max = subfile->filesize - tag->nodestart;
+
+ /* NODE_SEP gets the address of the separator which defines
+ this node, or (char *)NULL if the node wasn't found.
+ NODE->contents is side-effected to point to right after
+ the separator. */
+ node_sep = adjust_nodestart (node, min, max);
+ if (node_sep == (char *)NULL)
+ {
+ free (node);
+ return ((NODE *)NULL);
+ }
+ /* Readjust tag->nodestart. */
+ tag->nodestart = node_sep - subfile->contents;
+
+ /* Calculate the length of the current node. */
+ buff_end = subfile->contents + subfile->filesize;
+
+ node_body.buffer = node->contents;
+ node_body.start = 0;
+ node_body.end = buff_end - node_body.buffer;
+ node_body.flags = 0;
+ tag->nodelen = get_node_length (&node_body);
+ }
+ else
+ {
+ /* Since we know the length of this node, we have already
+ adjusted tag->nodestart to point to the exact start of
+ it. Simply skip the node separator. */
+ node->contents += skip_node_separator (node->contents);
+ }
+
+ node->nodelen = tag->nodelen;
+ return (node);
+ }
}
/* There was a tag table for this file, and the node wasn't found.
@@ -963,9 +985,9 @@ info_node_of_file_buffer_tags (file_buffer, nodename)
}
/* **************************************************************** */
-/* */
-/* Managing file_buffers, nodes, and tags. */
-/* */
+/* */
+/* Managing file_buffers, nodes, and tags. */
+/* */
/* **************************************************************** */
/* Create a new, empty file buffer. */
@@ -996,7 +1018,7 @@ remember_info_file (file_buffer)
;
add_pointer_to_array (file_buffer, i, info_loaded_files,
- info_loaded_files_slots, 10, FILE_BUFFER *);
+ info_loaded_files_slots, 10, FILE_BUFFER *);
}
/* Forget the contents, tags table, nodes list, and names of FILENAME. */
@@ -1010,25 +1032,25 @@ forget_info_file (filename)
if (!info_loaded_files)
return;
- for (i = 0; (file_buffer = info_loaded_files[i]); i++)
+ for (i = 0; file_buffer = info_loaded_files[i]; i++)
if ((strcmp (filename, file_buffer->filename) == 0) ||
- (strcmp (filename, file_buffer->fullpath) == 0))
+ (strcmp (filename, file_buffer->fullpath) == 0))
{
- free (file_buffer->filename);
- free (file_buffer->fullpath);
+ free (file_buffer->filename);
+ free (file_buffer->fullpath);
- if (file_buffer->contents)
- free (file_buffer->contents);
-
- /* Note that free_file_buffer_tags () also kills the subfiles
- list, since the subfiles list is only of use in conjunction
- with tags. */
- free_file_buffer_tags (file_buffer);
+ if (file_buffer->contents)
+ free (file_buffer->contents);
+
+ /* Note that free_file_buffer_tags () also kills the subfiles
+ list, since the subfiles list is only of use in conjunction
+ with tags. */
+ free_file_buffer_tags (file_buffer);
- while ((info_loaded_files[i] = info_loaded_files[++i]))
- ;
+ while (info_loaded_files[i] = info_loaded_files[++i])
+ ;
- break;
+ break;
}
}
@@ -1043,8 +1065,8 @@ free_file_buffer_tags (file_buffer)
{
register TAG *tag;
- for (i = 0; (tag = file_buffer->tags[i]); i++)
- free_info_tag (tag);
+ for (i = 0; tag = file_buffer->tags[i]; i++)
+ free_info_tag (tag);
free (file_buffer->tags);
file_buffer->tags = (TAG **)NULL;
@@ -1054,7 +1076,7 @@ free_file_buffer_tags (file_buffer)
if (file_buffer->subfiles)
{
for (i = 0; file_buffer->subfiles[i]; i++)
- free (file_buffer->subfiles[i]);
+ free (file_buffer->subfiles[i]);
free (file_buffer->subfiles);
file_buffer->subfiles = (char **)NULL;
@@ -1138,29 +1160,29 @@ adjust_nodestart (node, min, max)
sep_len = skip_node_separator (node->contents);
/* If we managed to skip a node separator, then check for this node
- being the right one. */
+ being the right one. */
if (sep_len != 0)
- {
- char *nodedef, *nodestart;
- int offset;
-
- nodestart = node_body.buffer + position + sep_len;
- nodedef = nodestart;
- offset = string_in_line (INFO_NODE_LABEL, nodedef);
-
- if (offset != -1)
- {
- nodedef += offset;
- nodedef += skip_whitespace (nodedef);
- offset = skip_node_characters (nodedef, DONT_SKIP_NEWLINES);
- if ((offset == strlen (node->nodename)) &&
- (strncmp (node->nodename, nodedef, offset) == 0))
- {
- node->contents = nodestart;
- return (node_body.buffer + position);
- }
- }
- }
+ {
+ char *nodedef, *nodestart;
+ int offset;
+
+ nodestart = node_body.buffer + position + sep_len;
+ nodedef = nodestart;
+ offset = string_in_line (INFO_NODE_LABEL, nodedef);
+
+ if (offset != -1)
+ {
+ nodedef += offset;
+ nodedef += skip_whitespace (nodedef);
+ offset = skip_node_characters (nodedef, DONT_SKIP_NEWLINES);
+ if ((offset == strlen (node->nodename)) &&
+ (strncmp (node->nodename, nodedef, offset) == 0))
+ {
+ node->contents = nodestart;
+ return (node_body.buffer + position);
+ }
+ }
+ }
}
/* Oh well, I guess we have to try to find it in a larger area. */
diff --git a/contrib/texinfo/info/nodes.h b/contrib/texinfo/info/nodes.h
index a96c07c8a6e3..7ddea17ddda9 100644
--- a/contrib/texinfo/info/nodes.h
+++ b/contrib/texinfo/info/nodes.h
@@ -1,10 +1,9 @@
-/* nodes.h -- How we represent nodes internally.
- $Id: nodes.h,v 1.5 1997/07/18 14:33:44 karl Exp $
+/* nodes.h -- How we represent nodes internally. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,15 +21,15 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (NODES_H)
-#define NODES_H
+#if !defined (_NODES_H_)
+#define _NODES_H_
-#include "info.h"
+#include "general.h"
/* **************************************************************** */
-/* */
-/* User Code Interface */
-/* */
+/* */
+/* User Code Interface */
+/* */
/* **************************************************************** */
/* Callers generally only want the node itself. This structure is used
@@ -42,45 +41,45 @@
paths, so you might have: node->filename = "/usr/gnu/info/emacs-1",
with node->parent = "/usr/gnu/info/emacs". */
typedef struct {
- char *filename; /* The physical file containing this node. */
- char *parent; /* Non-null is the logical file name. */
- char *nodename; /* The name of this node. */
- char *contents; /* Characters appearing in this node. */
- long nodelen; /* The length of the CONTENTS member. */
- int flags; /* See immediately below. */
+ char *filename; /* The physical file containing this node. */
+ char *parent; /* Non-null is the logical file name. */
+ char *nodename; /* The name of this node. */
+ char *contents; /* Characters appearing in this node. */
+ long nodelen; /* The length of the CONTENTS member. */
+ int flags; /* See immediately below. */
} NODE;
/* Defines that can appear in NODE->flags. All informative. */
-#define N_HasTagsTable 0x01 /* This node was found through a tags table. */
-#define N_TagsIndirect 0x02 /* The tags table was an indirect one. */
-#define N_UpdateTags 0x04 /* The tags table is out of date. */
-#define N_IsCompressed 0x08 /* The file is compressed on disk. */
-#define N_IsInternal 0x10 /* This node was made by Info. */
-#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
-#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
+#define N_HasTagsTable 0x01 /* This node was found through a tags table. */
+#define N_TagsIndirect 0x02 /* The tags table was an indirect one. */
+#define N_UpdateTags 0x04 /* The tags table is out of date. */
+#define N_IsCompressed 0x08 /* The file is compressed on disk. */
+#define N_IsInternal 0x10 /* This node was made by Info. */
+#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
+#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
/* **************************************************************** */
-/* */
-/* Internal Data Structures */
-/* */
+/* */
+/* Internal Data Structures */
+/* */
/* **************************************************************** */
/* Some defines describing details about Info file contents. */
/* String Constants. */
-#define INFO_FILE_LABEL "File:"
-#define INFO_NODE_LABEL "Node:"
-#define INFO_PREV_LABEL "Prev:"
-#define INFO_ALTPREV_LABEL "Previous:"
-#define INFO_NEXT_LABEL "Next:"
-#define INFO_UP_LABEL "Up:"
-#define INFO_MENU_LABEL "\n* Menu:"
-#define INFO_MENU_ENTRY_LABEL "\n* "
-#define INFO_XREF_LABEL "*Note"
-#define TAGS_TABLE_END_LABEL "\nEnd Tag Table"
-#define TAGS_TABLE_BEG_LABEL "Tag Table:\n"
-#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
-#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
+#define INFO_FILE_LABEL "File:"
+#define INFO_NODE_LABEL "Node:"
+#define INFO_PREV_LABEL "Prev:"
+#define INFO_ALTPREV_LABEL "Previous:"
+#define INFO_NEXT_LABEL "Next:"
+#define INFO_UP_LABEL "Up:"
+#define INFO_MENU_LABEL "\n* Menu:"
+#define INFO_MENU_ENTRY_LABEL "\n* "
+#define INFO_XREF_LABEL "*Note"
+#define TAGS_TABLE_END_LABEL "\nEnd Tag Table"
+#define TAGS_TABLE_BEG_LABEL "Tag Table:\n"
+#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
+#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
/* Character Constants. */
#define INFO_COOKIE '\037'
@@ -95,10 +94,10 @@ typedef struct {
member in the structure below simply contains the name of the current
file. The following structure describes a single node within a file. */
typedef struct {
- char *filename; /* The file where this node can be found. */
- char *nodename; /* The node pointed to by this tag. */
- long nodestart; /* The offset of the start of this node. */
- long nodelen; /* The length of this node. */
+ char *filename; /* The file where this node can be found. */
+ char *nodename; /* The node pointed to by this tag. */
+ long nodestart; /* The offset of the start of this node. */
+ long nodelen; /* The length of this node. */
} TAG;
/* The following structure is used to remember information about the contents
@@ -109,21 +108,21 @@ typedef struct {
corresponding SLOTS member which says how many slots have been allocated
(with malloc ()) for this array. */
typedef struct {
- char *filename; /* The filename used to find this file. */
- char *fullpath; /* The full pathname of this info file. */
- struct stat finfo; /* Information about this file. */
- char *contents; /* The contents of this particular file. */
- long filesize; /* The number of bytes this file expands to. */
- char **subfiles; /* If non-null, the list of subfiles. */
- TAG **tags; /* If non-null, the indirect tags table. */
- int tags_slots; /* Number of slots allocated for TAGS. */
- int flags; /* Various flags. Mimics of N_* flags. */
+ char *filename; /* The filename used to find this file. */
+ char *fullpath; /* The full pathname of this info file. */
+ struct stat finfo; /* Information about this file. */
+ char *contents; /* The contents of this particular file. */
+ long filesize; /* The number of bytes this file expands to. */
+ char **subfiles; /* If non-null, the list of subfiles. */
+ TAG **tags; /* If non-null, the indirect tags table. */
+ int tags_slots; /* Number of slots allocated for TAGS. */
+ int flags; /* Various flags. Mimics of N_* flags. */
} FILE_BUFFER;
/* **************************************************************** */
-/* */
-/* Externally Visible Functions */
-/* */
+/* */
+/* Externally Visible Functions */
+/* */
/* **************************************************************** */
/* Array of FILE_BUFFER * which represents the currently loaded info files. */
@@ -166,4 +165,4 @@ extern char *info_recent_file_error;
/* Create a new, empty file buffer. */
extern FILE_BUFFER *make_file_buffer ();
-#endif /* !NODES_H */
+#endif /* !_NODES_H_ */
diff --git a/contrib/texinfo/info/search.c b/contrib/texinfo/info/search.c
index 0e8e619256a1..c5fd47794b08 100644
--- a/contrib/texinfo/info/search.c
+++ b/contrib/texinfo/info/search.c
@@ -3,7 +3,7 @@
/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +21,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
-
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "general.h"
#include "search.h"
#include "nodes.h"
+#if !defined (NULL)
+# define NULL 0x0
+#endif /* !NULL */
+
/* The search functions take two arguments:
1) a string to search for, and
@@ -67,9 +73,9 @@ copy_binding (binding)
/* **************************************************************** */
-/* */
-/* The Actual Searching Functions */
-/* */
+/* */
+/* The Actual Searching Functions */
+/* */
/* **************************************************************** */
/* Search forwards or backwards for the text delimited by BINDING.
@@ -109,15 +115,15 @@ search_forward (string, binding)
if (binding->flags & S_FoldCase)
{
- alternate = xstrdup (string);
+ alternate = strdup (string);
for (i = 0; i < len; i++)
- {
- if (islower (alternate[i]))
- alternate[i] = toupper (alternate[i]);
- else if (isupper (alternate[i]))
- alternate[i] = tolower (alternate[i]);
- }
+ {
+ if (islower (alternate[i]))
+ alternate[i] = toupper (alternate[i]);
+ else if (isupper (alternate[i]))
+ alternate[i] = tolower (alternate[i]);
+ }
}
buff = binding->buffer + binding->start;
@@ -126,21 +132,21 @@ search_forward (string, binding)
while (buff < (end - len))
{
for (i = 0; i < len; i++)
- {
- c = buff[i];
+ {
+ c = buff[i];
- if ((c != string[i]) && (!alternate || c != alternate[i]))
- break;
- }
+ if ((c != string[i]) && (!alternate || c != alternate[i]))
+ break;
+ }
if (!string[i])
- {
- if (alternate)
- free (alternate);
- if (binding->flags & S_SkipDest)
- buff += len;
- return ((long) (buff - binding->buffer));
- }
+ {
+ if (alternate)
+ free (alternate);
+ if (binding->flags & S_SkipDest)
+ buff += len;
+ return ((long) (buff - binding->buffer));
+ }
buff++;
}
@@ -178,15 +184,15 @@ search_backward (input_string, binding)
if (binding->flags & S_FoldCase)
{
- alternate = xstrdup (string);
+ alternate = strdup (string);
for (i = 0; i < len; i++)
- {
- if (islower (alternate[i]))
- alternate[i] = toupper (alternate[i]);
- else if (isupper (alternate[i]))
- alternate[i] = tolower (alternate[i]);
- }
+ {
+ if (islower (alternate[i]))
+ alternate[i] = toupper (alternate[i]);
+ else if (isupper (alternate[i]))
+ alternate[i] = tolower (alternate[i]);
+ }
}
buff = binding->buffer + binding->start - 1;
@@ -195,23 +201,23 @@ search_backward (input_string, binding)
while (buff > (end + len))
{
for (i = 0; i < len; i++)
- {
- c = *(buff - i);
+ {
+ c = *(buff - i);
- if (c != string[i] && (alternate && c != alternate[i]))
- break;
- }
+ if (c != string[i] && (alternate && c != alternate[i]))
+ break;
+ }
if (!string[i])
- {
- free (string);
- if (alternate)
- free (alternate);
+ {
+ free (string);
+ if (alternate)
+ free (alternate);
- if (binding->flags & S_SkipDest)
- buff -= len;
- return ((long) (1 + (buff - binding->buffer)));
- }
+ if (binding->flags & S_SkipDest)
+ buff -= len;
+ return ((long) (1 + (buff - binding->buffer)));
+ }
buff--;
}
@@ -262,9 +268,9 @@ looking_at (string, binding)
}
/* **************************************************************** */
-/* */
-/* Small String Searches */
-/* */
+/* */
+/* Small String Searches */
+/* */
/* **************************************************************** */
/* Function names that start with "skip" are passed a string, and return
@@ -340,43 +346,37 @@ skip_node_characters (string, newlines_okay)
for (; string && (c = string[i]); i++)
{
if (paren)
- {
- if (c == '(')
- paren++;
- else if (c == ')')
- paren--;
-
- continue;
- }
+ {
+ if (c == '(')
+ paren++;
+ else if (c == ')')
+ paren--;
+
+ continue;
+ }
/* If the character following the close paren is a space or period,
- then this node name has no more characters associated with it. */
+ then this node name has no more characters associated with it. */
if (c == '\t' ||
- c == ',' ||
- c == INFO_TAGSEP ||
- ((!newlines_okay) && (c == '\n')) ||
- ((paren_seen && string[i - 1] == ')') &&
- (c == ' ' || c == '.')) ||
- (c == '.' &&
- (
-#if 0
-/* This test causes a node name ending in a period, like `This.', not to
- be found. The trailing . is stripped. This occurs in the jargon
- file (`I see no X here.' is a node name). */
- (!string[i + 1]) ||
-#endif
- (whitespace_or_newline (string[i + 1])) ||
- (string[i + 1] == ')'))))
- break;
+ c == ',' ||
+ c == INFO_TAGSEP ||
+ ((!newlines_okay) && (c == '\n')) ||
+ ((paren_seen && string[i - 1] == ')') &&
+ (c == ' ' || c == '.')) ||
+ (c == '.' &&
+ ((!string[i + 1]) ||
+ (whitespace_or_newline (string[i + 1])) ||
+ (string[i + 1] == ')'))))
+ break;
}
return (i);
}
/* **************************************************************** */
-/* */
-/* Searching FILE_BUFFER's */
-/* */
+/* */
+/* Searching FILE_BUFFER's */
+/* */
/* **************************************************************** */
/* Return the absolute position of the first occurence of a node separator in
@@ -397,11 +397,11 @@ find_node_separator (binding)
table (if present) and the indirect tags table (if present). */
for (i = binding->start; i < binding->end - 1; i++)
if (((body[i] == INFO_FF && body[i + 1] == INFO_COOKIE) &&
- (body[i + 2] == '\n' ||
- (body[i + 2] == INFO_FF && body[i + 3] == '\n'))) ||
- ((body[i] == INFO_COOKIE) &&
- (body[i + 1] == '\n' ||
- (body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
+ (body[i + 2] == '\n' ||
+ (body[i + 2] == INFO_FF && body[i + 3] == '\n'))) ||
+ ((body[i] == INFO_COOKIE) &&
+ (body[i + 1] == '\n' ||
+ (body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
return (i);
return (-1);
}
@@ -467,7 +467,7 @@ find_tags_table (binding)
search.start += skip_node_separator (search.buffer + search.start);
if (looking_at (TAGS_TABLE_BEG_LABEL, &search))
- return (position);
+ return (position);
}
return (-1);
}
@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding)
char *nodename;
SEARCH_BINDING *binding;
{
- long position;
- int offset, namelen;
+ register long position;
+ register int offset, namelen;
SEARCH_BINDING search;
namelen = strlen (nodename);
@@ -501,19 +501,19 @@ find_node_in_binding (nodename, binding)
offset = string_in_line (INFO_NODE_LABEL, search.buffer + search.start);
if (offset == -1)
- continue;
+ continue;
search.start += offset;
search.start += skip_whitespace (search.buffer + search.start);
offset = skip_node_characters
- (search.buffer + search.start, DONT_SKIP_NEWLINES);
+ (search.buffer + search.start, DONT_SKIP_NEWLINES);
/* Notice that this is an exact match. You cannot grovel through
- the buffer with this function looking for random nodes. */
+ the buffer with this function looking for random nodes. */
if ((offset == namelen) &&
- (search.buffer[search.start] == nodename[0]) &&
- (strncmp (search.buffer + search.start, nodename, offset) == 0))
- return (position);
+ (search.buffer[search.start] == nodename[0]) &&
+ (strncmp (search.buffer + search.start, nodename, offset) == 0))
+ return (position);
}
return (-1);
}
diff --git a/contrib/texinfo/info/search.h b/contrib/texinfo/info/search.h
index 6425536f1724..72695c3f0b63 100644
--- a/contrib/texinfo/info/search.h
+++ b/contrib/texinfo/info/search.h
@@ -1,10 +1,9 @@
-/* search.h -- Structure used to search large bodies of text, with bounds.
- $Id: search.h,v 1.3 1997/07/15 18:43:49 karl Exp $
+/* search.h -- Structure used to search large bodies of text, with bounds. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,18 +31,18 @@
They return a long, which is the offset from the start of the buffer
at which the match was found. An offset of -1 indicates failure. */
-#ifndef INFO_SEARCH_H
-#define INFO_SEARCH_H
+#if !defined (_SEARCH_H_)
+#define _SEARCH_H_
typedef struct {
- char *buffer; /* The buffer of text to search. */
- long start; /* Offset of the start of the search. */
- long end; /* Offset of the end of the searh. */
- int flags; /* Flags controlling the type of search. */
+ char *buffer; /* The buffer of text to search. */
+ long start; /* Offset of the start of the search. */
+ long end; /* Offset of the end of the searh. */
+ int flags; /* Flags controlling the type of search. */
} SEARCH_BINDING;
-#define S_FoldCase 0x01 /* Set means fold case in searches. */
-#define S_SkipDest 0x02 /* Set means return pointing after the dest. */
+#define S_FoldCase 0x01 /* Set means fold case in searches. */
+#define S_SkipDest 0x02 /* Set means return pointing after the dest. */
SEARCH_BINDING *make_binding (), *copy_binding ();
extern long search_forward (), search_backward (), search ();
@@ -72,4 +71,5 @@ extern int skip_node_characters (), skip_node_separator ();
extern long find_node_separator (), find_tags_table ();
extern long find_node_in_binding ();
-#endif /* not INFO_SEARCH_H */
+#endif /* !_SEARCH_H_ */
+
diff --git a/contrib/texinfo/info/session.c b/contrib/texinfo/info/session.c
index 63a6ecdd35f3..494c4a1e5730 100644
--- a/contrib/texinfo/info/session.c
+++ b/contrib/texinfo/info/session.c
@@ -1,7 +1,9 @@
-/* session.c -- The user windowing interface to Info.
- $Id: session.c,v 1.13 1998/02/22 22:38:30 karl Exp $
+/* session.c -- The user windowing interface to Info. */
- Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +22,12 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h"
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <stdlib.h>
#if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
@@ -35,28 +42,28 @@ static void info_clear_pending_input (), info_set_pending_input ();
static void info_handle_pointer ();
/* **************************************************************** */
-/* */
-/* Running an Info Session */
-/* */
+/* */
+/* Running an Info Session */
+/* */
/* **************************************************************** */
/* The place that we are reading input from. */
-static FILE *info_input_stream = NULL;
+static FILE *info_input_stream = (FILE *)NULL;
/* The last executed command. */
-VFunction *info_last_executed_command = NULL;
+VFunction *info_last_executed_command = (VFunction *)NULL;
/* Becomes non-zero when 'q' is typed to an Info window. */
int quit_info_immediately = 0;
/* Array of structures describing for each window which nodes have been
visited in that window. */
-INFO_WINDOW **info_windows = NULL;
+INFO_WINDOW **info_windows = (INFO_WINDOW **)NULL;
/* Where to add the next window, if we need to add one. */
static int info_windows_index = 0;
-/* Number of slots allocated to `info_windows'. */
+/* Number of slots allocated to INFO_WINDOWS. */
static int info_windows_slots = 0;
void remember_window_and_node (), forget_window_and_nodes ();
@@ -81,52 +88,52 @@ begin_multiple_window_info_session (filename, nodenames)
node = info_get_node (filename, nodenames[i]);
if (!node)
- break;
+ break;
/* If this is the first node, initialize the info session. */
if (!window)
- {
- initialize_info_session (node, 1);
- window = active_window;
- }
+ {
+ initialize_info_session (node);
+ window = active_window;
+ }
else
- {
- /* Find the largest window in WINDOWS, and make that be the active
- one. Then split it and add our window and node to the list
- of remembered windows and nodes. Then tile the windows. */
- register WINDOW *win, *largest = (WINDOW *)NULL;
- int max_height = 0;
-
- for (win = windows; win; win = win->next)
- if (win->height > max_height)
- {
- max_height = win->height;
- largest = win;
- }
-
- if (!largest)
- {
- display_update_display (windows);
- info_error (CANT_FIND_WIND);
- info_session ();
- exit (0);
- }
-
- active_window = largest;
- window = window_make_window (node);
- if (window)
- {
- window_tile_windows (TILE_INTERNALS);
- remember_window_and_node (window, node);
- }
- else
- {
- display_update_display (windows);
- info_error (WIN_TOO_SMALL);
- info_session ();
- exit (0);
- }
- }
+ {
+ /* Find the largest window in WINDOWS, and make that be the active
+ one. Then split it and add our window and node to the list
+ of remembered windows and nodes. Then tile the windows. */
+ register WINDOW *win, *largest = (WINDOW *)NULL;
+ int max_height = 0;
+
+ for (win = windows; win; win = win->next)
+ if (win->height > max_height)
+ {
+ max_height = win->height;
+ largest = win;
+ }
+
+ if (!largest)
+ {
+ display_update_display (windows);
+ info_error (CANT_FIND_WIND);
+ info_session ();
+ exit (0);
+ }
+
+ active_window = largest;
+ window = window_make_window (node);
+ if (window)
+ {
+ window_tile_windows (TILE_INTERNALS);
+ remember_window_and_node (window, node);
+ }
+ else
+ {
+ display_update_display (windows);
+ info_error (WIN_TOO_SMALL);
+ info_session ();
+ exit (0);
+ }
+ }
}
display_startup_message_and_start ();
}
@@ -139,7 +146,7 @@ begin_info_session_with_error (initial_node, format, arg)
char *format;
void *arg;
{
- initialize_info_session (initial_node, 1);
+ initialize_info_session (initial_node);
info_error (format, arg, (void *)NULL);
info_session ();
}
@@ -149,7 +156,7 @@ void
begin_info_session (initial_node)
NODE *initial_node;
{
- initialize_info_session (initial_node, 1);
+ initialize_info_session (initial_node);
display_startup_message_and_start ();
}
@@ -159,7 +166,7 @@ display_startup_message_and_start ()
char *format;
format = replace_in_documentation
- (_("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item."));
+ ("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item.");
window_message_in_echo_area (format, version_string ());
info_session ();
@@ -169,8 +176,9 @@ display_startup_message_and_start ()
void
info_session ()
{
+ terminal_prep_terminal ();
display_update_display (windows);
- info_last_executed_command = NULL;
+ info_last_executed_command = (VFunction *)NULL;
info_read_and_dispatch ();
/* On program exit, leave the cursor at the bottom of the window, and
restore the terminal I/O. */
@@ -195,19 +203,19 @@ info_read_and_dispatch ()
int lk;
/* If we haven't just gone up or down a line, there is no
- goal column for this window. */
+ goal column for this window. */
if ((info_last_executed_command != info_next_line) &&
- (info_last_executed_command != info_prev_line))
- active_window->goal_column = -1;
+ (info_last_executed_command != info_prev_line))
+ active_window->goal_column = -1;
if (echo_area_is_active)
- {
- lk = echo_area_last_command_was_kill;
- echo_area_prep_read ();
- }
+ {
+ lk = echo_area_last_command_was_kill;
+ echo_area_prep_read ();
+ }
if (!info_any_buffered_input_p ())
- display_update_display (windows);
+ display_update_display (windows);
display_cursor_at_point (active_window);
info_initialize_numeric_arg ();
@@ -216,9 +224,9 @@ info_read_and_dispatch ()
key = info_get_input_char ();
/* No errors yet. We just read a character, that's all. Only clear
- the echo_area if it is not currently active. */
+ the echo_area if it is not currently active. */
if (!echo_area_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
info_error_was_printed = 0;
@@ -226,26 +234,26 @@ info_read_and_dispatch ()
info_dispatch_on_key (key, active_window->keymap);
if (echo_area_is_active)
- {
- /* Echo area commands that do killing increment the value of
- ECHO_AREA_LAST_COMMAND_WAS_KILL. Thus, if there is no
- change in the value of this variable, the last command
- executed was not a kill command. */
- if (lk == echo_area_last_command_was_kill)
- echo_area_last_command_was_kill = 0;
-
- if (ea_last_executed_command == ea_newline ||
- info_aborted_echo_area)
- {
- ea_last_executed_command = (VFunction *)NULL;
- done = 1;
- }
-
- if (info_last_executed_command == info_quit)
- quit_info_immediately = 1;
- }
+ {
+ /* Echo area commands that do killing increment the value of
+ ECHO_AREA_LAST_COMMAND_WAS_KILL. Thus, if there is no
+ change in the value of this variable, the last command
+ executed was not a kill command. */
+ if (lk == echo_area_last_command_was_kill)
+ echo_area_last_command_was_kill = 0;
+
+ if (ea_last_executed_command == ea_newline ||
+ info_aborted_echo_area)
+ {
+ ea_last_executed_command = (VFunction *)NULL;
+ done = 1;
+ }
+
+ if (info_last_executed_command == info_quit)
+ quit_info_immediately = 1;
+ }
else if (info_last_executed_command == info_quit)
- done = 1;
+ done = 1;
}
}
@@ -253,30 +261,26 @@ info_read_and_dispatch ()
extern void initialize_info_signal_handler ();
/* Initialize the first info session by starting the terminal, window,
- and display systems. If CLEAR_SCREEN is 0, don't clear the screen. */
+ and display systems. */
void
-initialize_info_session (node, clear_screen)
+initialize_info_session (node)
NODE *node;
- int clear_screen;
{
- char *term_name = getenv ("TERM");
+ char *getenv (), *term_name;
+
+ term_name = getenv ("TERM");
terminal_initialize_terminal (term_name);
if (terminal_is_dumb_p)
{
if (!term_name)
- term_name = "dumb";
+ term_name = "dumb";
info_error (TERM_TOO_DUMB, term_name);
exit (1);
}
- if (clear_screen)
- {
- terminal_prep_terminal ();
- terminal_clear_screen ();
- }
-
+ terminal_clear_screen ();
initialize_info_keymaps ();
window_initialize_windows (screenwidth, screenheight);
initialize_info_signal_handler ();
@@ -287,13 +291,9 @@ initialize_info_session (node, clear_screen)
asynchronously deleted (e.g., user resizes window very small). */
window_deletion_notifier = forget_window_and_nodes;
- /* If input has not been redirected yet, make it come from unbuffered
- standard input. */
+ /* If input has not been redirected yet, make it come from STDIN. */
if (!info_input_stream)
- {
- setbuf(stdin, NULL);
- info_input_stream = stdin;
- }
+ info_input_stream = stdin;
info_windows_initialized_p = 1;
}
@@ -362,8 +362,10 @@ remember_window_and_node (window, node)
WINDOW *window;
NODE *node;
{
+ INFO_WINDOW *info_win;
+
/* See if we already have this window in our list. */
- INFO_WINDOW *info_win = get_info_window_of_window (window);
+ info_win = get_info_window_of_window (window);
/* If the window wasn't already on our list, then make a new entry. */
if (!info_win)
@@ -378,19 +380,21 @@ remember_window_and_node (window, node)
info_win->nodes_slots = 0;
add_pointer_to_array (info_win, info_windows_index, info_windows,
- info_windows_slots, 10, INFO_WINDOW *);
+ info_windows_slots, 10, INFO_WINDOW *);
}
/* If this node, the current pagetop, and the current point are the
- same as the current saved node and pagetop, don't really add this to
- the list of history nodes. This may happen only at the very
- beginning of the program, I'm not sure. --karl */
- if (info_win->nodes
- && info_win->current >= 0
- && info_win->nodes[info_win->current]->contents == node->contents
- && info_win->pagetops[info_win->current] == window->pagetop
- && info_win->points[info_win->current] == window->point)
- return;
+ same as the last saved node and pagetop, don't really add this to
+ the list of history nodes. */
+ {
+ int ni = info_win->nodes_index - 1;
+
+ if ((ni != -1) &&
+ (info_win->nodes[ni]->contents == node->contents) &&
+ (info_win->pagetops[ni] == window->pagetop) &&
+ (info_win->points[ni] == window->point))
+ return;
+ }
/* Remember this node, the currently displayed pagetop, and the current
location of point in this window. Because we are updating pagetops
@@ -398,20 +402,22 @@ remember_window_and_node (window, node)
add_pointer_to_array macro here. */
if (info_win->nodes_index + 2 >= info_win->nodes_slots)
{
- info_win->nodes_slots += 20;
- info_win->nodes = (NODE **) xrealloc (info_win->nodes,
- info_win->nodes_slots * sizeof (NODE *));
- info_win->pagetops = (int *) xrealloc (info_win->pagetops,
- info_win->nodes_slots * sizeof (int));
- info_win->points = (long *) xrealloc (info_win->points,
- info_win->nodes_slots * sizeof (long));
+ info_win->nodes = (NODE **)
+ xrealloc (info_win->nodes,
+ (info_win->nodes_slots += 20) * sizeof (NODE *));
+
+ info_win->pagetops = (int *)
+ xrealloc (info_win->pagetops, info_win->nodes_slots * sizeof (int));
+
+ info_win->points = (long *)
+ xrealloc (info_win->points, info_win->nodes_slots * sizeof (long));
}
info_win->nodes[info_win->nodes_index] = node;
info_win->pagetops[info_win->nodes_index] = window->pagetop;
info_win->points[info_win->nodes_index] = window->point;
info_win->current = info_win->nodes_index++;
- info_win->nodes[info_win->nodes_index] = NULL;
+ info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
info_win->pagetops[info_win->nodes_index] = 0;
info_win->points[info_win->nodes_index] = 0;
}
@@ -422,17 +428,18 @@ static void
consistency_check_info_windows ()
{
register int i;
+ INFO_WINDOW *info_win;
for (i = 0; i < info_windows_index; i++)
{
WINDOW *win;
for (win = windows; win; win = win->next)
- if (win == info_windows[i]->window)
- break;
+ if (win == info_windows[i]->window)
+ break;
if (!win)
- abort ();
+ abort ();
}
}
#endif /* DEBUG_FORGET_WINDOW_AND_NODES */
@@ -453,27 +460,27 @@ forget_window_and_nodes (window)
if (info_win)
{
while (i < info_windows_index)
- {
- info_windows[i] = info_windows[i + 1];
- i++;
- }
+ {
+ info_windows[i] = info_windows[i + 1];
+ i++;
+ }
info_windows_index--;
info_windows[info_windows_index] = (INFO_WINDOW *)NULL;
if (info_win->nodes)
- {
- /* Free the node structures which held onto internal node contents
- here. This doesn't free the contents; we have a garbage collector
- which does that. */
- for (i = 0; info_win->nodes[i]; i++)
- if (internal_info_node_p (info_win->nodes[i]))
- free (info_win->nodes[i]);
- free (info_win->nodes);
-
- maybe_free (info_win->pagetops);
- maybe_free (info_win->points);
- }
+ {
+ /* Free the node structures which held onto internal node contents
+ here. This doesn't free the contents; we have a garbage collector
+ which does that. */
+ for (i = 0; info_win->nodes[i]; i++)
+ if (internal_info_node_p (info_win->nodes[i]))
+ free (info_win->nodes[i]);
+ free (info_win->nodes);
+
+ maybe_free (info_win->pagetops);
+ maybe_free (info_win->points);
+ }
free (info_win);
}
@@ -504,9 +511,9 @@ info_set_node_of_window (window, node)
/* **************************************************************** */
-/* */
-/* Info Movement Commands */
-/* */
+/* */
+/* Info Movement Commands */
+/* */
/* **************************************************************** */
/* Change the pagetop of WINDOW to DESIRED_TOP, perhaps scrolling the screen
@@ -550,8 +557,8 @@ set_window_pagetop (window, desired_top)
amount = desired_top - old_pagetop;
if ((amount >= window->height) ||
- (((window->height - amount) * 10) < window->height))
- return;
+ (((window->height - amount) * 10) < window->height))
+ return;
start = amount + window->first_row;
end = window->height + window->first_row;
@@ -565,8 +572,8 @@ set_window_pagetop (window, desired_top)
amount = old_pagetop - desired_top;
if ((amount >= window->height) ||
- (((window->height - amount) * 10) < window->height))
- return;
+ (((window->height - amount) * 10) < window->height))
+ return;
start = window->first_row;
end = (window->first_row + window->height) - amount;
@@ -614,7 +621,7 @@ move_to_new_line (old, new, window)
int goal;
if (new >= window->line_count || new < 0)
- return;
+ return;
goal = window_get_goal_column (window);
window->goal_column = goal;
@@ -626,7 +633,7 @@ move_to_new_line (old, new, window)
}
/* Move WINDOW's point down to the next line if possible. */
-DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
+DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line")
{
int old_line, new_line;
@@ -641,7 +648,7 @@ DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
}
/* Move WINDOW's point up to the previous line if possible. */
-DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
+DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line")
{
int old_line, new_line;
@@ -656,7 +663,7 @@ DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
}
/* Move WINDOW's point to the end of the true line. */
-DECLARE_INFO_COMMAND (info_end_of_line, _("Move to the end of the line"))
+DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line")
{
register int point, len;
register char *buffer;
@@ -676,7 +683,7 @@ DECLARE_INFO_COMMAND (info_end_of_line, _("Move to the end of the line"))
}
/* Move WINDOW's point to the beginning of the true line. */
-DECLARE_INFO_COMMAND (info_beginning_of_line, _("Move to the start of the line"))
+DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line")
{
register int point;
register char *buffer;
@@ -695,7 +702,7 @@ DECLARE_INFO_COMMAND (info_beginning_of_line, _("Move to the start of the line")
}
/* Move point forward in the node. */
-DECLARE_INFO_COMMAND (info_forward_char, _("Move forward a character"))
+DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character")
{
if (count < 0)
info_backward_char (window, -count, key);
@@ -704,14 +711,14 @@ DECLARE_INFO_COMMAND (info_forward_char, _("Move forward a character"))
window->point += count;
if (window->point >= window->node->nodelen)
- window->point = window->node->nodelen - 1;
+ window->point = window->node->nodelen - 1;
info_show_point (window);
}
}
/* Move point backward in the node. */
-DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
+DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character")
{
if (count < 0)
info_forward_char (window, -count, key);
@@ -720,7 +727,7 @@ DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
window->point -= count;
if (window->point < 0)
- window->point = 0;
+ window->point = 0;
info_show_point (window);
}
@@ -729,7 +736,7 @@ DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
#define alphabetic(c) (islower (c) || isupper (c) || isdigit (c))
/* Move forward a word in this node. */
-DECLARE_INFO_COMMAND (info_forward_word, _("Move forward a word"))
+DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word")
{
long point;
char *buffer;
@@ -748,37 +755,37 @@ DECLARE_INFO_COMMAND (info_forward_word, _("Move forward a word"))
while (count)
{
if (point + 1 >= end)
- return;
+ return;
/* If we are not in a word, move forward until we are in one.
- Then, move forward until we hit a non-alphabetic character. */
+ Then, move forward until we hit a non-alphabetic character. */
c = buffer[point];
if (!alphabetic (c))
- {
- while (++point < end)
- {
- c = buffer[point];
- if (alphabetic (c))
- break;
- }
- }
+ {
+ while (++point < end)
+ {
+ c = buffer[point];
+ if (alphabetic (c))
+ break;
+ }
+ }
if (point >= end) return;
while (++point < end)
- {
- c = buffer[point];
- if (!alphabetic (c))
- break;
- }
+ {
+ c = buffer[point];
+ if (!alphabetic (c))
+ break;
+ }
--count;
}
window->point = point;
info_show_point (window);
}
-DECLARE_INFO_COMMAND (info_backward_word, _("Move backward a word"))
+DECLARE_INFO_COMMAND (info_backward_word, "Move backward a word")
{
long point;
char *buffer;
@@ -796,31 +803,31 @@ DECLARE_INFO_COMMAND (info_backward_word, _("Move backward a word"))
while (count)
{
if (point == 0)
- break;
+ break;
/* Like info_forward_word (), except that we look at the
- characters just before point. */
+ characters just before point. */
c = buffer[point - 1];
if (!alphabetic (c))
- {
- while (--point)
- {
- c = buffer[point - 1];
- if (alphabetic (c))
- break;
- }
- }
+ {
+ while (--point)
+ {
+ c = buffer[point - 1];
+ if (alphabetic (c))
+ break;
+ }
+ }
while (point)
- {
- c = buffer[point - 1];
- if (!alphabetic (c))
- break;
- else
- --point;
- }
+ {
+ c = buffer[point - 1];
+ if (!alphabetic (c))
+ break;
+ else
+ --point;
+ }
--count;
}
window->point = point;
@@ -852,9 +859,9 @@ times_description (count)
break;
if (counter_names[i])
- sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? _(" times") : "");
+ sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? " times" : "");
else
- sprintf (td_buffer, _("%d times"), count);
+ sprintf (td_buffer, "%d times", count);
return (td_buffer);
}
@@ -863,11 +870,11 @@ times_description (count)
already at the bottom of a node. Possible values are defined in session.h.
The meanings are:
- IS_Continuous Try to get first menu item, or failing that, the
- "Next:" pointer, or failing that, the "Up:" and
- "Next:" of the up.
- IS_NextOnly Try to get "Next:" menu item.
- IS_PageOnly Simply give up at the bottom of a node. */
+ IS_Continuous Try to get first menu item, or failing that, the
+ "Next:" pointer, or failing that, the "Up:" and
+ "Next:" of the up.
+ IS_NextOnly Try to get "Next:" menu item.
+ IS_PageOnly Simply give up at the bottom of a node. */
int info_scroll_behaviour = IS_Continuous;
@@ -892,136 +899,136 @@ forward_move_node_structure (window, behaviour)
case IS_NextOnly:
info_next_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Next\" pointer for this node."));
+ info_error ("No \"Next\" pointer for this node.");
else
- {
- window_message_in_echo_area (_("Following \"Next\" node..."));
- info_handle_pointer (_("Next"), window);
- }
+ {
+ window_message_in_echo_area ("Following \"Next\" node...");
+ info_handle_pointer ("Next", window);
+ }
break;
case IS_Continuous:
{
- /* First things first. If this node contains a menu, move down
- into the menu. */
- {
- REFERENCE **menu;
-
- menu = info_menu_of_node (window->node);
-
- if (menu)
- {
- info_free_references (menu);
- window_message_in_echo_area (_("Selecting first menu item..."));
- info_menu_digit (window, 1, '1');
- return;
- }
- }
-
- /* Okay, this node does not contain a menu. If it contains a
- "Next:" pointer, use that. */
- info_next_label_of_node (window->node);
- if (info_label_was_found)
- {
- window_message_in_echo_area (_("Selecting \"Next\" node..."));
- info_handle_pointer (_("Next"), window);
- return;
- }
-
- /* Okay, there wasn't a "Next:" for this node. Move "Up:" until we
- can move "Next:". If that isn't possible, complain that there
- are no more nodes. */
- {
- int up_counter, old_current;
- INFO_WINDOW *info_win;
-
- /* Remember the current node and location. */
- info_win = get_info_window_of_window (window);
- old_current = info_win->current;
-
- /* Back up through the "Up:" pointers until we have found a "Next:"
- that isn't the same as the first menu item found in that node. */
- up_counter = 0;
- while (!info_error_was_printed)
- {
- info_up_label_of_node (window->node);
- if (info_label_was_found)
- {
- info_handle_pointer (_("Up"), window);
- if (info_error_was_printed)
- continue;
-
- up_counter++;
-
- info_next_label_of_node (window->node);
-
- /* If no "Next" pointer, keep backing up. */
- if (!info_label_was_found)
- continue;
-
- /* If this node's first menu item is the same as this node's
- Next pointer, keep backing up. */
- if (!info_parsed_filename)
- {
- REFERENCE **menu;
- char *next_nodename;
-
- /* Remember the name of the Next node, since reading
- the menu can overwrite the contents of the
- info_parsed_xxx strings. */
- next_nodename = xstrdup (info_parsed_nodename);
-
- menu = info_menu_of_node (window->node);
- if (menu &&
- (strcmp
- (menu[0]->nodename, next_nodename) == 0))
- {
- info_free_references (menu);
- free (next_nodename);
- continue;
- }
- else
- {
- /* Restore the world to where it was before
- reading the menu contents. */
- info_free_references (menu);
- free (next_nodename);
- info_next_label_of_node (window->node);
- }
- }
-
- /* This node has a "Next" pointer, and it is not the
- same as the first menu item found in this node. */
- window_message_in_echo_area
- ("Moving \"Up\" %s, then \"Next\".",
- times_description (up_counter));
-
- info_handle_pointer (_("Next"), window);
- return;
- }
- else
- {
- /* No more "Up" pointers. Print an error, and call it
- quits. */
- register int i;
-
- for (i = 0; i < up_counter; i++)
- {
- info_win->nodes_index--;
- free (info_win->nodes[info_win->nodes_index]);
- info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
- }
- info_win->current = old_current;
- window->node = info_win->nodes[old_current];
- window->pagetop = info_win->pagetops[old_current];
- window->point = info_win->points[old_current];
- recalculate_line_starts (window);
- window->flags |= W_UpdateWindow;
- info_error (_("No more nodes."));
- }
- }
- }
- break;
+ /* First things first. If this node contains a menu, move down
+ into the menu. */
+ {
+ REFERENCE **menu;
+
+ menu = info_menu_of_node (window->node);
+
+ if (menu)
+ {
+ info_free_references (menu);
+ window_message_in_echo_area ("Selecting first menu item...");
+ info_menu_digit (window, 1, '1');
+ return;
+ }
+ }
+
+ /* Okay, this node does not contain a menu. If it contains a
+ "Next:" pointer, use that. */
+ info_next_label_of_node (window->node);
+ if (info_label_was_found)
+ {
+ window_message_in_echo_area ("Selecting \"Next\" node...");
+ info_handle_pointer ("Next", window);
+ return;
+ }
+
+ /* Okay, there wasn't a "Next:" for this node. Move "Up:" until we
+ can move "Next:". If that isn't possible, complain that there
+ are no more nodes. */
+ {
+ int up_counter, old_current;
+ INFO_WINDOW *info_win;
+
+ /* Remember the current node and location. */
+ info_win = get_info_window_of_window (window);
+ old_current = info_win->current;
+
+ /* Back up through the "Up:" pointers until we have found a "Next:"
+ that isn't the same as the first menu item found in that node. */
+ up_counter = 0;
+ while (!info_error_was_printed)
+ {
+ info_up_label_of_node (window->node);
+ if (info_label_was_found)
+ {
+ info_handle_pointer ("Up", window);
+ if (info_error_was_printed)
+ continue;
+
+ up_counter++;
+
+ info_next_label_of_node (window->node);
+
+ /* If no "Next" pointer, keep backing up. */
+ if (!info_label_was_found)
+ continue;
+
+ /* If this node's first menu item is the same as this node's
+ Next pointer, keep backing up. */
+ if (!info_parsed_filename)
+ {
+ REFERENCE **menu;
+ char *next_nodename;
+
+ /* Remember the name of the Next node, since reading
+ the menu can overwrite the contents of the
+ info_parsed_xxx strings. */
+ next_nodename = strdup (info_parsed_nodename);
+
+ menu = info_menu_of_node (window->node);
+ if (menu &&
+ (strcmp
+ (menu[0]->nodename, next_nodename) == 0))
+ {
+ info_free_references (menu);
+ free (next_nodename);
+ continue;
+ }
+ else
+ {
+ /* Restore the world to where it was before
+ reading the menu contents. */
+ info_free_references (menu);
+ free (next_nodename);
+ info_next_label_of_node (window->node);
+ }
+ }
+
+ /* This node has a "Next" pointer, and it is not the
+ same as the first menu item found in this node. */
+ window_message_in_echo_area
+ ("Moving \"Up\" %s, then \"Next\".",
+ times_description (up_counter));
+
+ info_handle_pointer ("Next", window);
+ return;
+ }
+ else
+ {
+ /* No more "Up" pointers. Print an error, and call it
+ quits. */
+ register int i;
+
+ for (i = 0; i < up_counter; i++)
+ {
+ info_win->nodes_index--;
+ free (info_win->nodes[info_win->nodes_index]);
+ info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
+ }
+ info_win->current = old_current;
+ window->node = info_win->nodes[old_current];
+ window->pagetop = info_win->pagetops[old_current];
+ window->point = info_win->points[old_current];
+ recalculate_line_starts (window);
+ window->flags |= W_UpdateWindow;
+ info_error ("No more nodes.");
+ }
+ }
+ }
+ break;
}
}
}
@@ -1041,115 +1048,115 @@ backward_move_node_structure (window, behaviour)
case IS_NextOnly:
info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Prev\" for this node."));
+ info_error ("No \"Prev\" for this node.");
else
- {
- window_message_in_echo_area (_("Moving \"Prev\" in this window."));
- info_handle_pointer (_("Prev"), window);
- }
+ {
+ window_message_in_echo_area ("Moving \"Prev\" in this window.");
+ info_handle_pointer ("Prev", window);
+ }
break;
case IS_Continuous:
info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- {
- info_up_label_of_node (window->node);
- if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Prev\" or \"Up\" for this node."));
- else
- {
- window_message_in_echo_area (_("Moving \"Up\" in this window."));
- info_handle_pointer (_("Up"), window);
- }
- }
+ {
+ info_up_label_of_node (window->node);
+ if (!info_parsed_nodename && !info_parsed_filename)
+ info_error ("No \"Prev\" or \"Up\" for this node.");
+ else
+ {
+ window_message_in_echo_area ("Moving \"Up\" in this window.");
+ info_handle_pointer ("Up", window);
+ }
+ }
else
- {
- REFERENCE **menu;
- int inhibit_menu_traversing = 0;
-
- /* Watch out! If this node's Prev is the same as the Up, then
- move Up. Otherwise, we could move Prev, and then to the last
- menu item in the Prev. This would cause the user to loop
- through a subsection of the info file. */
- if (!info_parsed_filename && info_parsed_nodename)
- {
- char *pnode;
-
- pnode = xstrdup (info_parsed_nodename);
- info_up_label_of_node (window->node);
-
- if (!info_parsed_filename && info_parsed_nodename &&
- strcmp (info_parsed_nodename, pnode) == 0)
- {
- /* The nodes are the same. Inhibit moving to the last
- menu item. */
- free (pnode);
- inhibit_menu_traversing = 1;
- }
- else
- {
- free (pnode);
- info_prev_label_of_node (window->node);
- }
- }
-
- /* Move to the previous node. If this node now contains a menu,
- and we have not inhibited movement to it, move to the node
- corresponding to the last menu item. */
- window_message_in_echo_area (_("Moving \"Prev\" in this window."));
- info_handle_pointer (_("Prev"), window);
-
- if (!inhibit_menu_traversing)
- {
- while (!info_error_was_printed &&
- (menu = info_menu_of_node (window->node)))
- {
- info_free_references (menu);
- window_message_in_echo_area
- (_("Moving to \"Prev\"'s last menu item."));
- info_menu_digit (window, 1, '0');
- }
- }
- }
+ {
+ REFERENCE **menu;
+ int inhibit_menu_traversing = 0;
+
+ /* Watch out! If this node's Prev is the same as the Up, then
+ move Up. Otherwise, we could move Prev, and then to the last
+ menu item in the Prev. This would cause the user to loop
+ through a subsection of the info file. */
+ if (!info_parsed_filename && info_parsed_nodename)
+ {
+ char *pnode;
+
+ pnode = strdup (info_parsed_nodename);
+ info_up_label_of_node (window->node);
+
+ if (!info_parsed_filename && info_parsed_nodename &&
+ strcmp (info_parsed_nodename, pnode) == 0)
+ {
+ /* The nodes are the same. Inhibit moving to the last
+ menu item. */
+ free (pnode);
+ inhibit_menu_traversing = 1;
+ }
+ else
+ {
+ free (pnode);
+ info_prev_label_of_node (window->node);
+ }
+ }
+
+ /* Move to the previous node. If this node now contains a menu,
+ and we have not inhibited movement to it, move to the node
+ corresponding to the last menu item. */
+ window_message_in_echo_area ("Moving \"Prev\" in this window.");
+ info_handle_pointer ("Prev", window);
+
+ if (!inhibit_menu_traversing)
+ {
+ while (!info_error_was_printed &&
+ (menu = info_menu_of_node (window->node)))
+ {
+ info_free_references (menu);
+ window_message_in_echo_area
+ ("Moving to \"Prev\"'s last menu item.");
+ info_menu_digit (window, 1, '0');
+ }
+ }
+ }
break;
}
}
/* Move continuously forward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_next_node,
- _("Move forwards or down through node structure"))
+ "Move forwards or down through node structure")
{
if (count < 0)
info_global_prev_node (window, -count, key);
else
{
while (count && !info_error_was_printed)
- {
- forward_move_node_structure (window, IS_Continuous);
- count--;
- }
+ {
+ forward_move_node_structure (window, IS_Continuous);
+ count--;
+ }
}
}
/* Move continuously backward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_prev_node,
- _("Move backwards or up through node structure"))
+ "Move backwards or up through node structure")
{
if (count < 0)
info_global_next_node (window, -count, key);
else
{
while (count && !info_error_was_printed)
- {
- backward_move_node_structure (window, IS_Continuous);
- count--;
- }
+ {
+ backward_move_node_structure (window, IS_Continuous);
+ count--;
+ }
}
}
/* Show the next screen of WINDOW's node. */
-DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
+DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window")
{
if (count < 0)
info_scroll_backward (window, -count, key);
@@ -1158,43 +1165,43 @@ DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
int desired_top;
/* Without an explicit numeric argument, scroll the bottom two
- lines to the top of this window, Or, if at bottom of window,
- and the user wishes to scroll through nodes get the "Next" node
- for this window. */
+ lines to the top of this window, Or, if at bottom of window,
+ and the user wishes to scroll through nodes get the "Next" node
+ for this window. */
if (!info_explicit_arg && count == 1)
- {
- desired_top = window->pagetop + (window->height - 2);
-
- /* If there are no more lines to scroll here, error, or get
- another node, depending on INFO_SCROLL_BEHAVIOUR. */
- if (desired_top > window->line_count)
- {
- int behaviour = info_scroll_behaviour;
-
- /* Here is a hack. If the key being used is not SPC, do the
- PageOnly behaviour. */
- if (key != SPC && key != DEL)
- behaviour = IS_PageOnly;
-
- forward_move_node_structure (window, behaviour);
- return;
- }
- }
+ {
+ desired_top = window->pagetop + (window->height - 2);
+
+ /* If there are no more lines to scroll here, error, or get
+ another node, depending on INFO_SCROLL_BEHAVIOUR. */
+ if (desired_top > window->line_count)
+ {
+ int behaviour = info_scroll_behaviour;
+
+ /* Here is a hack. If the key being used is not SPC, do the
+ PageOnly behaviour. */
+ if (key != SPC && key != DEL)
+ behaviour = IS_PageOnly;
+
+ forward_move_node_structure (window, behaviour);
+ return;
+ }
+ }
else
- desired_top = window->pagetop + count;
+ desired_top = window->pagetop + count;
if (desired_top >= window->line_count)
- desired_top = window->line_count - 2;
+ desired_top = window->line_count - 2;
if (window->pagetop > desired_top)
- return;
+ return;
else
- set_window_pagetop (window, desired_top);
+ set_window_pagetop (window, desired_top);
}
}
/* Show the previous screen of WINDOW's node. */
-DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
+DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window")
{
if (count < 0)
info_scroll_forward (window, -count, key);
@@ -1203,58 +1210,58 @@ DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
int desired_top;
/* Without an explicit numeric argument, scroll the top two lines
- to the bottom of this window, or move to the previous, or Up'th
- node. */
+ to the bottom of this window, or move to the previous, or Up'th
+ node. */
if (!info_explicit_arg && count == 1)
- {
- desired_top = window->pagetop - (window->height - 2);
-
- if ((desired_top < 0) && (window->pagetop == 0))
- {
- int behaviour = info_scroll_behaviour;
-
- /* Same kind of hack as in info_scroll_forward. If the key
- used to invoke this command is not DEL, do only the PageOnly
- behaviour. */
- if (key != DEL && key != SPC)
- behaviour = IS_PageOnly;
-
- backward_move_node_structure (window, behaviour);
- return;
- }
- }
+ {
+ desired_top = window->pagetop - (window->height - 2);
+
+ if ((desired_top < 0) && (window->pagetop == 0))
+ {
+ int behaviour = info_scroll_behaviour;
+
+ /* Same kind of hack as in info_scroll_forward. If the key
+ used to invoke this command is not DEL, do only the PageOnly
+ behaviour. */
+ if (key != DEL && key != SPC)
+ behaviour = IS_PageOnly;
+
+ backward_move_node_structure (window, behaviour);
+ return;
+ }
+ }
else
- desired_top = window->pagetop - count;
+ desired_top = window->pagetop - count;
if (desired_top < 0)
- desired_top = 0;
+ desired_top = 0;
set_window_pagetop (window, desired_top);
}
}
/* Move to the beginning of the node. */
-DECLARE_INFO_COMMAND (info_beginning_of_node, _("Move to the start of this node"))
+DECLARE_INFO_COMMAND (info_beginning_of_node, "Move to the start of this node")
{
window->pagetop = window->point = 0;
window->flags |= W_UpdateWindow;
}
/* Move to the end of the node. */
-DECLARE_INFO_COMMAND (info_end_of_node, _("Move to the end of this node"))
+DECLARE_INFO_COMMAND (info_end_of_node, "Move to the end of this node")
{
window->point = window->node->nodelen - 1;
info_show_point (window);
}
/* **************************************************************** */
-/* */
-/* Commands for Manipulating Windows */
-/* */
+/* */
+/* Commands for Manipulating Windows */
+/* */
/* **************************************************************** */
/* Make the next window in the chain be the active window. */
-DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
+DECLARE_INFO_COMMAND (info_next_window, "Select the next window")
{
if (count < 0)
{
@@ -1272,20 +1279,20 @@ DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
while (count--)
{
if (window->next)
- window = window->next;
+ window = window->next;
else
- {
- if (window == the_echo_area || !echo_area_is_active)
- window = windows;
- else
- window = the_echo_area;
- }
+ {
+ if (window == the_echo_area || !echo_area_is_active)
+ window = windows;
+ else
+ window = the_echo_area;
+ }
}
if (active_window != window)
{
if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
+ info_get_or_remove_footnotes (window);
window->flags |= W_UpdateWindow;
active_window = window;
@@ -1293,7 +1300,7 @@ DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
}
/* Make the previous window in the chain be the active window. */
-DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
+DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window")
{
if (count < 0)
{
@@ -1312,30 +1319,30 @@ DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
while (count--)
{
/* If we are in the echo area, or if the echo area isn't active and we
- are in the first window, find the last window in the chain. */
+ are in the first window, find the last window in the chain. */
if (window == the_echo_area ||
- (window == windows && !echo_area_is_active))
- {
- register WINDOW *win, *last;
+ (window == windows && !echo_area_is_active))
+ {
+ register WINDOW *win, *last;
- for (win = windows; win; win = win->next)
- last = win;
+ for (win = windows; win; win = win->next)
+ last = win;
- window = last;
- }
+ window = last;
+ }
else
- {
- if (window == windows)
- window = the_echo_area;
- else
- window = window->prev;
- }
+ {
+ if (window == windows)
+ window = the_echo_area;
+ else
+ window = window->prev;
+ }
}
if (active_window != window)
{
if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
+ info_get_or_remove_footnotes (window);
window->flags |= W_UpdateWindow;
active_window = window;
@@ -1344,7 +1351,7 @@ DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
/* Split WINDOW into two windows, both showing the same node. If we
are automatically tiling windows, re-tile after the split. */
-DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
+DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
{
WINDOW *split, *old_active;
int pagetop;
@@ -1368,54 +1375,54 @@ DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
#if defined (SPLIT_BEFORE_ACTIVE)
/* Try to scroll the old window into its new postion. */
if (pagetop == window->pagetop)
- {
- int start, end, amount;
-
- start = split->first_row;
- end = start + window->height;
- amount = split->height + 1;
- display_scroll_display (start, end, amount);
- }
+ {
+ int start, end, amount;
+
+ start = split->first_row;
+ end = start + window->height;
+ amount = split->height + 1;
+ display_scroll_display (start, end, amount);
+ }
#else /* !SPLIT_BEFORE_ACTIVE */
/* Make sure point still appears in the active window. */
info_show_point (window);
#endif /* !SPLIT_BEFORE_ACTIVE */
/* If the window just split was one internal to Info, try to display
- something else in it. */
+ something else in it. */
if (internal_info_node_p (split->node))
- {
- register int i, j;
- INFO_WINDOW *iw;
- NODE *node = (NODE *)NULL;
- char *filename;
-
- for (i = 0; (iw = info_windows[i]); i++)
- {
- for (j = 0; j < iw->nodes_index; j++)
- if (!internal_info_node_p (iw->nodes[j]))
- {
- if (iw->nodes[j]->parent)
- filename = iw->nodes[j]->parent;
- else
- filename = iw->nodes[j]->filename;
-
- node = info_get_node (filename, iw->nodes[j]->nodename);
- if (node)
- {
- window_set_node_of_window (split, node);
- i = info_windows_index - 1;
- break;
- }
- }
- }
- }
+ {
+ register int i, j;
+ INFO_WINDOW *iw;
+ NODE *node = (NODE *)NULL;
+ char *filename;
+
+ for (i = 0; iw = info_windows[i]; i++)
+ {
+ for (j = 0; j < iw->nodes_index; j++)
+ if (!internal_info_node_p (iw->nodes[j]))
+ {
+ if (iw->nodes[j]->parent)
+ filename = iw->nodes[j]->parent;
+ else
+ filename = iw->nodes[j]->filename;
+
+ node = info_get_node (filename, iw->nodes[j]->nodename);
+ if (node)
+ {
+ window_set_node_of_window (split, node);
+ i = info_windows_index - 1;
+ break;
+ }
+ }
+ }
+ }
split->pagetop = window->pagetop;
if (auto_tiling_p)
- window_tile_windows (DONT_TILE_INTERNALS);
+ window_tile_windows (DONT_TILE_INTERNALS);
else
- window_adjust_pagetop (split);
+ window_adjust_pagetop (split);
remember_window_and_node (split, split->node);
}
@@ -1425,7 +1432,7 @@ DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
automatically displaying footnotes, show or remove the footnotes
window. If we are automatically tiling windows, re-tile after the
deletion. */
-DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window"))
+DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window")
{
if (!windows->next)
{
@@ -1433,17 +1440,17 @@ DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window"))
}
else if (window->flags & W_WindowIsPerm)
{
- info_error (_("Cannot delete a permanent window"));
+ info_error ("Cannot delete a permanent window");
}
else
{
info_delete_window_internal (window);
if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
+ info_get_or_remove_footnotes (active_window);
if (auto_tiling_p)
- window_tile_windows (DONT_TILE_INTERNALS);
+ window_tile_windows (DONT_TILE_INTERNALS);
}
}
@@ -1456,19 +1463,19 @@ info_delete_window_internal (window)
if (windows->next && ((window->flags & W_WindowIsPerm) == 0))
{
/* We not only delete the window from the display, we forget it from
- our list of remembered windows. */
+ our list of remembered windows. */
forget_window_and_nodes (window);
window_delete_window (window);
if (echo_area_is_active)
- echo_area_inform_of_deleted_window (window);
+ echo_area_inform_of_deleted_window (window);
}
}
/* Just keep WINDOW, deleting all others. */
-DECLARE_INFO_COMMAND (info_keep_one_window, _("Delete all other windows"))
+DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows")
{
- int num_deleted; /* The number of windows we deleted. */
+ int num_deleted; /* The number of windows we deleted. */
int pagetop, start, end;
/* Remember a few things about this window. We may be able to speed up
@@ -1484,14 +1491,14 @@ DECLARE_INFO_COMMAND (info_keep_one_window, _("Delete all other windows"))
WINDOW *win;
/* Find an eligible window and delete it. If no eligible windows
- are found, we are done. A window is eligible for deletion if
- is it not permanent, and it is not WINDOW. */
+ are found, we are done. A window is eligible for deletion if
+ is it not permanent, and it is not WINDOW. */
for (win = windows; win; win = win->next)
- if (win != window && ((win->flags & W_WindowIsPerm) == 0))
- break;
+ if (win != window && ((win->flags & W_WindowIsPerm) == 0))
+ break;
if (!win)
- break;
+ break;
info_delete_window_internal (win);
num_deleted++;
@@ -1512,7 +1519,7 @@ DECLARE_INFO_COMMAND (info_keep_one_window, _("Delete all other windows"))
}
/* Scroll the "other" window of WINDOW. */
-DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
+DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window")
{
WINDOW *other;
@@ -1532,7 +1539,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
}
/* Change the size of WINDOW by AMOUNT. */
-DECLARE_INFO_COMMAND (info_grow_window, _("Grow (or shrink) this window"))
+DECLARE_INFO_COMMAND (info_grow_window, "Grow (or shrink) this window")
{
window_change_window_height (window, count);
}
@@ -1543,22 +1550,22 @@ int auto_tiling_p = 0;
/* Tile all of the visible windows. */
DECLARE_INFO_COMMAND (info_tile_windows,
- _("Divide the available screen space among the visible windows"))
+ "Divide the available screen space among the visible windows")
{
window_tile_windows (TILE_INTERNALS);
}
/* Toggle the state of this window's wrapping of lines. */
DECLARE_INFO_COMMAND (info_toggle_wrap,
- _("Toggle the state of line wrapping in the current window"))
+ "Toggle the state of line wrapping in the current window")
{
window_toggle_wrap (window);
}
/* **************************************************************** */
-/* */
-/* Info Node Commands */
-/* */
+/* */
+/* Info Node Commands */
+/* */
/* **************************************************************** */
/* Using WINDOW for various defaults, select the node referenced by ENTRY
@@ -1580,12 +1587,12 @@ info_select_reference (window, entry)
filename = window->node->filename;
if (filename)
- filename = xstrdup (filename);
+ filename = strdup (filename);
if (entry->nodename)
- nodename = xstrdup (entry->nodename);
+ nodename = strdup (entry->nodename);
else
- nodename = xstrdup ("Top");
+ nodename = strdup ("Top");
node = info_get_node (filename, nodename);
@@ -1595,25 +1602,25 @@ info_select_reference (window, entry)
if (!node)
{
if (info_recent_file_error)
- file_system_error = xstrdup (info_recent_file_error);
+ file_system_error = strdup (info_recent_file_error);
if (entry->nodename && (strcmp (entry->nodename, entry->label) == 0))
- {
- node = info_get_node (entry->label, "Top");
- if (!node && info_recent_file_error)
- {
- maybe_free (file_system_error);
- file_system_error = xstrdup (info_recent_file_error);
- }
- }
+ {
+ node = info_get_node (entry->label, "Top");
+ if (!node && info_recent_file_error)
+ {
+ maybe_free (file_system_error);
+ file_system_error = strdup (info_recent_file_error);
+ }
+ }
}
if (!node)
{
if (file_system_error)
- info_error (file_system_error);
+ info_error (file_system_error);
else
- info_error (CANT_FIND_NODE, nodename);
+ info_error (CANT_FIND_NODE, nodename);
}
maybe_free (file_system_error);
@@ -1663,42 +1670,42 @@ info_handle_pointer (label, window)
filename = nodename = (char *)NULL;
if (info_parsed_filename)
- filename = xstrdup (info_parsed_filename);
+ filename = strdup (info_parsed_filename);
else
- {
- if (window->node->parent)
- filename = xstrdup (window->node->parent);
- else if (window->node->filename)
- filename = xstrdup (window->node->filename);
- }
+ {
+ if (window->node->parent)
+ filename = strdup (window->node->parent);
+ else if (window->node->filename)
+ filename = strdup (window->node->filename);
+ }
if (info_parsed_nodename)
- nodename = xstrdup (info_parsed_nodename);
+ nodename = strdup (info_parsed_nodename);
else
- nodename = xstrdup ("Top");
+ nodename = strdup ("Top");
node = info_get_node (filename, nodename);
if (node)
- {
- INFO_WINDOW *info_win;
-
- info_win = get_info_window_of_window (window);
- if (info_win)
- {
- info_win->pagetops[info_win->current] = window->pagetop;
- info_win->points[info_win->current] = window->point;
- }
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
- }
+ {
+ INFO_WINDOW *info_win;
+
+ info_win = get_info_window_of_window (window);
+ if (info_win)
+ {
+ info_win->pagetops[info_win->current] = window->pagetop;
+ info_win->points[info_win->current] = window->point;
+ }
+ set_remembered_pagetop_and_point (window);
+ info_set_node_of_window (window, node);
+ }
else
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error (CANT_FILE_NODE, filename, nodename);
- }
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error (CANT_FILE_NODE, filename, nodename);
+ }
free (filename);
free (nodename);
@@ -1711,30 +1718,30 @@ info_handle_pointer (label, window)
/* Make WINDOW display the "Next:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_next_node, _("Select the `Next' node"))
+DECLARE_INFO_COMMAND (info_next_node, "Select the `Next' node")
{
info_next_label_of_node (window->node);
- info_handle_pointer (_("Next"), window);
+ info_handle_pointer ("Next", window);
}
/* Make WINDOW display the "Prev:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_prev_node, _("Select the `Prev' node"))
+DECLARE_INFO_COMMAND (info_prev_node, "Select the `Prev' node")
{
info_prev_label_of_node (window->node);
- info_handle_pointer (_("Prev"), window);
+ info_handle_pointer ("Prev", window);
}
/* Make WINDOW display the "Up:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_up_node, _("Select the `Up' node"))
+DECLARE_INFO_COMMAND (info_up_node, "Select the `Up' node")
{
info_up_label_of_node (window->node);
- info_handle_pointer (_("Up"), window);
+ info_handle_pointer ("Up", window);
}
/* Make WINDOW display the last node of this info file. */
-DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
+DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
{
register int i;
FILE_BUFFER *fb = file_buffer_of_window (window);
@@ -1747,7 +1754,7 @@ DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
}
if (!node)
- info_error (_("This window has no additional nodes"));
+ info_error ("This window has no additional nodes");
else
{
set_remembered_pagetop_and_point (window);
@@ -1756,7 +1763,7 @@ DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
}
/* Make WINDOW display the first node of this info file. */
-DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
+DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
{
FILE_BUFFER *fb = file_buffer_of_window (window);
NODE *node = (NODE *)NULL;
@@ -1765,7 +1772,7 @@ DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
node = info_get_node (fb->filename, fb->tags[0]->nodename);
if (!node)
- info_error (_("This window has no additional nodes"));
+ info_error ("This window has no additional nodes");
else
{
set_remembered_pagetop_and_point (window);
@@ -1773,15 +1780,55 @@ DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
}
}
+/* Make WINDOW display the previous node displayed in this window. */
+DECLARE_INFO_COMMAND (info_history_node,
+ "Select the most recently selected node")
+{
+ INFO_WINDOW *info_win;
+
+ /* Find the INFO_WINDOW which contains WINDOW. */
+ info_win = get_info_window_of_window (window);
+
+ if (!info_win)
+ {
+ info_error ("Requested window is not present!");
+ return;
+ }
+
+ set_remembered_pagetop_and_point (window);
+ if (!info_win->current)
+ {
+ if (info_win->nodes_index > 1)
+ {
+ window_message_in_echo_area
+ ("Now wrapped around to beginning of history.");
+ info_win->current = info_win->nodes_index;
+ }
+ else
+ {
+ info_error ("No earlier nodes in this window.");
+ return;
+ }
+ }
+
+ info_win->current--;
+ window_set_node_of_window (window, info_win->nodes[info_win->current]);
+ window->pagetop = info_win->pagetops[info_win->current];
+ window->point = info_win->points[info_win->current];
+ window->flags |= W_UpdateWindow;
+ if (auto_footnotes_p)
+ info_get_or_remove_footnotes (window);
+}
+
/* Select the last menu item in WINDOW->node. */
DECLARE_INFO_COMMAND (info_last_menu_item,
- _("Select the last item in this node's menu"))
+ "Select the last item in this node's menu")
{
info_menu_digit (window, 1, '0');
}
/* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */
-DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
+DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item")
{
register int i, item;
register REFERENCE *entry, **menu;
@@ -1802,15 +1849,15 @@ DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
for (i = 0; menu[i + 1]; i++);
else
{
- for (i = 0; (entry = menu[i]); i++)
- if (i == item - 1)
- break;
+ for (i = 0; entry = menu[i]; i++)
+ if (i == item - 1)
+ break;
}
if (menu[i])
info_select_reference (window, menu[i]);
else
- info_error (_("There aren't %d items in this menu."), item);
+ info_error ("There aren't %d items in this menu.", item);
info_free_references (menu);
return;
@@ -1837,9 +1884,9 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (!menu)
{
if (builder == info_menu_of_node)
- info_error (NO_MENU_NODE);
+ info_error (NO_MENU_NODE);
else
- info_error (NO_XREF_NODE);
+ info_error (NO_XREF_NODE);
return;
}
@@ -1853,77 +1900,77 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (point_line != -1)
{
- SEARCH_BINDING binding;
-
- binding.buffer = window->node->contents;
- binding.start = window->line_starts[point_line] - binding.buffer;
- if (window->line_starts[point_line + 1])
- binding.end = window->line_starts[point_line + 1] - binding.buffer;
- else
- binding.end = window->node->nodelen;
- binding.flags = 0;
-
- if (builder == info_menu_of_node)
- {
- if (point_line)
- {
- binding.start--;
- refs = info_menu_items (&binding);
- }
- }
- else
- {
+ SEARCH_BINDING binding;
+
+ binding.buffer = window->node->contents;
+ binding.start = window->line_starts[point_line] - binding.buffer;
+ if (window->line_starts[point_line + 1])
+ binding.end = window->line_starts[point_line + 1] - binding.buffer;
+ else
+ binding.end = window->node->nodelen;
+ binding.flags = 0;
+
+ if (builder == info_menu_of_node)
+ {
+ if (point_line)
+ {
+ binding.start--;
+ refs = info_menu_items (&binding);
+ }
+ }
+ else
+ {
#if defined (HANDLE_MAN_PAGES)
- if (window->node->flags & N_IsManPage)
- refs = manpage_xrefs_in_binding (window->node, &binding);
- else
+ if (window->node->flags & N_IsManPage)
+ refs = manpage_xrefs_in_binding (window->node, &binding);
+ else
#endif /* HANDLE_MAN_PAGES */
- refs = info_xrefs (&binding);
- }
-
- if (refs)
- {
- if ((strcmp (refs[0]->label, "Menu") != 0) ||
- (builder == info_xrefs_of_node))
- {
- int which = 0;
-
- /* Find the closest reference to point. */
- if (builder == info_xrefs_of_node)
- {
- int closest = -1;
-
- for (; refs[which]; which++)
- {
- if ((window->point >= refs[which]->start) &&
- (window->point <= refs[which]->end))
- {
- closest = which;
- break;
- }
- else if (window->point < refs[which]->start)
- {
- break;
- }
- }
- if (closest == -1)
- which--;
- else
- which = closest;
- }
-
- defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- defentry->label = xstrdup (refs[which]->label);
- defentry->filename = refs[which]->filename;
- defentry->nodename = refs[which]->nodename;
-
- if (defentry->filename)
- defentry->filename = xstrdup (defentry->filename);
- if (defentry->nodename)
- defentry->nodename = xstrdup (defentry->nodename);
- }
- info_free_references (refs);
- }
+ refs = info_xrefs (&binding);
+ }
+
+ if (refs)
+ {
+ if ((strcmp (refs[0]->label, "Menu") != 0) ||
+ (builder == info_xrefs_of_node))
+ {
+ int which = 0;
+
+ /* Find the closest reference to point. */
+ if (builder == info_xrefs_of_node)
+ {
+ int closest = -1;
+
+ for (; refs[which]; which++)
+ {
+ if ((window->point >= refs[which]->start) &&
+ (window->point <= refs[which]->end))
+ {
+ closest = which;
+ break;
+ }
+ else if (window->point < refs[which]->start)
+ {
+ break;
+ }
+ }
+ if (closest == -1)
+ which--;
+ else
+ which = closest;
+ }
+
+ defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ defentry->label = strdup (refs[which]->label);
+ defentry->filename = refs[which]->filename;
+ defentry->nodename = refs[which]->nodename;
+
+ if (defentry->filename)
+ defentry->filename = strdup (defentry->filename);
+ if (defentry->nodename)
+ defentry->nodename = strdup (defentry->nodename);
+ }
+ info_free_references (refs);
+ }
}
}
@@ -1934,24 +1981,24 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* Build the prompt string. */
if (defentry)
- prompt = (char *)xmalloc (20 + strlen (defentry->label));
+ prompt = (char *)xmalloc (20 + strlen (defentry->label));
else
- prompt = (char *)xmalloc (20);
+ prompt = (char *)xmalloc (20);
if (builder == info_menu_of_node)
- {
- if (defentry)
- sprintf (prompt, _("Menu item (%s): "), defentry->label);
- else
- sprintf (prompt, _("Menu item: "));
- }
+ {
+ if (defentry)
+ sprintf (prompt, "Menu item (%s): ", defentry->label);
+ else
+ sprintf (prompt, "Menu item: ");
+ }
else
- {
- if (defentry)
- sprintf (prompt, _("Follow xref (%s): "), defentry->label);
- else
- sprintf (prompt, _("Follow xref: "));
- }
+ {
+ if (defentry)
+ sprintf (prompt, "Follow xref (%s): ", defentry->label);
+ else
+ sprintf (prompt, "Follow xref: ");
+ }
line = info_read_completing_in_echo_area (window, prompt, menu);
free (prompt);
@@ -1960,31 +2007,31 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* User aborts, just quit. */
if (!line)
- {
- maybe_free (defentry);
- info_free_references (menu);
- info_abort_key (window, 0, 0);
- return;
- }
+ {
+ maybe_free (defentry);
+ info_free_references (menu);
+ info_abort_key (window, 0, 0);
+ return;
+ }
/* If we had a default and the user accepted it, use that. */
if (!*line)
- {
- free (line);
- if (defentry)
- line = xstrdup (defentry->label);
- else
- line = (char *)NULL;
- }
+ {
+ free (line);
+ if (defentry)
+ line = strdup (defentry->label);
+ else
+ line = (char *)NULL;
+ }
}
else
{
/* Not going to ask any questions. If we have a default entry, use
- that, otherwise return. */
+ that, otherwise return. */
if (!defentry)
- return;
+ return;
else
- line = xstrdup (defentry->label);
+ line = strdup (defentry->label);
}
if (line)
@@ -1993,42 +2040,42 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
entry = info_get_labeled_reference (line, menu);
if (!entry && defentry)
- info_error (_("The reference disappeared! (%s)."), line);
+ info_error ("The reference disappeared! (%s).", line);
else
- {
- NODE *orig;
-
- orig = window->node;
- info_select_reference (window, entry);
- if ((builder == info_xrefs_of_node) && (window->node != orig))
- {
- long offset;
- long start;
-
- if (window->line_count > 0)
- start = window->line_starts[1] - window->node->contents;
- else
- start = 0;
-
- offset =
- info_target_search_node (window->node, entry->label, start);
-
- if (offset != -1)
- {
- window->point = offset;
- window_adjust_pagetop (window);
- }
- }
- }
+ {
+ NODE *orig;
+
+ orig = window->node;
+ info_select_reference (window, entry);
+ if ((builder == info_xrefs_of_node) && (window->node != orig))
+ {
+ long offset;
+ long start;
+
+ if (window->line_count > 0)
+ start = window->line_starts[1] - window->node->contents;
+ else
+ start = 0;
+
+ offset =
+ info_target_search_node (window->node, entry->label, start);
+
+ if (offset != -1)
+ {
+ window->point = offset;
+ window_adjust_pagetop (window);
+ }
+ }
+ }
free (line);
if (defentry)
- {
- free (defentry->label);
- maybe_free (defentry->filename);
- maybe_free (defentry->nodename);
- free (defentry);
- }
+ {
+ free (defentry->label);
+ maybe_free (defentry->filename);
+ maybe_free (defentry->nodename);
+ free (defentry);
+ }
}
info_free_references (menu);
@@ -2039,7 +2086,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* Read a line (with completion) which is the name of a menu item,
and select that item. */
-DECLARE_INFO_COMMAND (info_menu_item, _("Read a menu item and select its node"))
+DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node")
{
info_menu_or_ref_item (window, count, key, info_menu_of_node, 1);
}
@@ -2047,13 +2094,13 @@ DECLARE_INFO_COMMAND (info_menu_item, _("Read a menu item and select its node"))
/* Read a line (with completion) which is the name of a reference to
follow, and select the node. */
DECLARE_INFO_COMMAND
- (info_xref_item, _("Read a footnote or cross reference and select its node"))
+ (info_xref_item, "Read a footnote or cross reference and select its node")
{
info_menu_or_ref_item (window, count, key, info_xrefs_of_node, 1);
}
/* Position the cursor at the start of this node's menu. */
-DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu"))
+DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu")
{
SEARCH_BINDING binding;
long position;
@@ -2077,7 +2124,7 @@ DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu")
/* Visit as many menu items as is possible, each in a separate window. */
DECLARE_INFO_COMMAND (info_visit_menu,
- _("Visit as many menu items at once as possible"))
+ "Visit as many menu items at once as possible")
{
register int i;
REFERENCE *entry, **menu;
@@ -2095,19 +2142,20 @@ DECLARE_INFO_COMMAND (info_visit_menu,
window_tile_windows (TILE_INTERNALS);
if (!new)
- info_error (WIN_TOO_SMALL);
+ info_error (WIN_TOO_SMALL);
else
- {
- active_window = new;
- info_select_reference (new, entry);
- }
+ {
+ active_window = new;
+ info_select_reference (new, entry);
+ }
}
}
/* Read a line of input which is a node name, and go to that node. */
-DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
+DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
{
char *line;
+ NODE *node;
#define GOTO_COMPLETES
#if defined (GOTO_COMPLETES)
@@ -2123,54 +2171,54 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
for (fbi = 0; info_loaded_files && info_loaded_files[fbi]; fbi++)
{
- FILE_BUFFER *fb;
- REFERENCE *entry;
- int this_is_the_current_fb;
-
- fb = info_loaded_files[fbi];
- this_is_the_current_fb = (current == fb);
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = (char *)xmalloc (4 + strlen (fb->filename));
- sprintf (entry->label, "(%s)*", fb->filename);
-
- add_pointer_to_array
- (entry, items_index, items, items_slots, 10, REFERENCE *);
-
- if (fb->tags)
- {
- for (i = 0; fb->tags[i]; i++)
- {
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = (char *) xmalloc
- (4 + strlen (fb->filename) + strlen (fb->tags[i]->nodename));
- sprintf (entry->label, "(%s)%s",
- fb->filename, fb->tags[i]->nodename);
-
- add_pointer_to_array
- (entry, items_index, items, items_slots, 100, REFERENCE *);
- }
-
- if (this_is_the_current_fb)
- {
- for (i = 0; fb->tags[i]; i++)
- {
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = xstrdup (fb->tags[i]->nodename);
- add_pointer_to_array (entry, items_index, items,
- items_slots, 100, REFERENCE *);
- }
- }
- }
+ FILE_BUFFER *fb;
+ REFERENCE *entry;
+ int this_is_the_current_fb;
+
+ fb = info_loaded_files[fbi];
+ this_is_the_current_fb = (current == fb);
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = (char *)xmalloc (4 + strlen (fb->filename));
+ sprintf (entry->label, "(%s)*", fb->filename);
+
+ add_pointer_to_array
+ (entry, items_index, items, items_slots, 10, REFERENCE *);
+
+ if (fb->tags)
+ {
+ for (i = 0; fb->tags[i]; i++)
+ {
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = (char *) xmalloc
+ (4 + strlen (fb->filename) + strlen (fb->tags[i]->nodename));
+ sprintf (entry->label, "(%s)%s",
+ fb->filename, fb->tags[i]->nodename);
+
+ add_pointer_to_array
+ (entry, items_index, items, items_slots, 100, REFERENCE *);
+ }
+
+ if (this_is_the_current_fb)
+ {
+ for (i = 0; fb->tags[i]; i++)
+ {
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = strdup (fb->tags[i]->nodename);
+ add_pointer_to_array (entry, items_index, items,
+ items_slots, 100, REFERENCE *);
+ }
+ }
+ }
}
- line = info_read_maybe_completing (window, _("Goto Node: "), items);
+ line = info_read_maybe_completing (window, "Goto Node: ", items);
info_free_references (items);
}
#else /* !GOTO_COMPLETES */
- line = info_read_in_echo_area (window, _("Goto Node: "));
+ line = info_read_in_echo_area (window, "Goto Node: ");
#endif /* !GOTO_COMPLETES */
/* If the user aborted, quit now. */
@@ -2191,11 +2239,12 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
}
#if defined (HANDLE_MAN_PAGES)
-DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
+DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it")
{
char *line;
+ NODE *node;
- line = info_read_in_echo_area (window, _("Get Manpage: "));
+ line = info_read_in_echo_area (window, "Get Manpage: ");
if (!line)
{
@@ -2210,7 +2259,7 @@ DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
char *goto_command;
goto_command = (char *)xmalloc
- (4 + strlen (MANPAGE_FILE_BUFFER_NAME) + strlen (line));
+ (4 + strlen (MANPAGE_FILE_BUFFER_NAME) + strlen (line));
sprintf (goto_command, "(%s)%s", MANPAGE_FILE_BUFFER_NAME, line);
@@ -2225,70 +2274,61 @@ DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
#endif /* HANDLE_MAN_PAGES */
/* Move to the "Top" node in this file. */
-DECLARE_INFO_COMMAND (info_top_node, _("Select the node `Top' in this file"))
+DECLARE_INFO_COMMAND (info_top_node, "Select the node `Top' in this file")
{
- info_parse_and_select (_("Top"), window);
+ info_parse_and_select ("Top", window);
}
/* Move to the node "(dir)Top". */
-DECLARE_INFO_COMMAND (info_dir_node, _("Select the node `(dir)'"))
+DECLARE_INFO_COMMAND (info_dir_node, "Select the node `(dir)'")
{
info_parse_and_select ("(dir)Top", window);
}
-
-/* Read the name of a node to kill. The list of available nodes comes
- from the nodes appearing in the current window configuration. */
-static char *
-read_nodename_to_kill (window)
- WINDOW *window;
+/* Try to delete the current node appearing in this window, showing the most
+ recently selected node in this window. */
+DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
{
- int iw;
- char *nodename;
- INFO_WINDOW *info_win;
- REFERENCE **menu = NULL;
- int menu_index = 0, menu_slots = 0;
- char *default_nodename = xstrdup (active_window->node->nodename);
- char *prompt = xmalloc (40 + strlen (default_nodename));
+ register int iw, i;
+ register INFO_WINDOW *info_win;
+ char *nodename = (char *)NULL;
+ NODE *temp = (NODE *)NULL;
- sprintf (prompt, _("Kill node (%s): "), default_nodename);
+ /* Read the name of a node to kill. The list of available nodes comes
+ from the nodes appearing in the current window configuration. */
+ {
+ REFERENCE **menu = (REFERENCE **)NULL;
+ int menu_index = 0, menu_slots = 0;
+ char *default_nodename, *prompt;
- for (iw = 0; (info_win = info_windows[iw]); iw++)
- {
- REFERENCE *entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = xstrdup (info_win->window->node->nodename);
- entry->filename = entry->nodename = (char *)NULL;
+ for (iw = 0; info_win = info_windows[iw]; iw++)
+ {
+ REFERENCE *entry;
- add_pointer_to_array (entry, menu_index, menu, menu_slots, 10,
- REFERENCE *);
- }
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = strdup (info_win->window->node->nodename);
+ entry->filename = entry->nodename = (char *)NULL;
- nodename = info_read_completing_in_echo_area (window, prompt, menu);
- free (prompt);
- info_free_references (menu);
- if (nodename && !*nodename)
- {
- free (nodename);
- nodename = default_nodename;
- }
- else
- free (default_nodename);
+ add_pointer_to_array
+ (entry, menu_index, menu, menu_slots, 10, REFERENCE *);
+ }
- return nodename;
-}
+ default_nodename = strdup (active_window->node->nodename);
+ prompt = (char *)xmalloc (40 + strlen (default_nodename));
+ sprintf (prompt, "Kill node (%s): ", default_nodename);
+ nodename = info_read_completing_in_echo_area (window, prompt, menu);
+ free (prompt);
+ info_free_references (menu);
+ if (nodename && !*nodename)
+ {
+ free (nodename);
+ nodename = default_nodename;
+ }
+ else
+ free (default_nodename);
+ }
-/* Delete NODENAME from this window, showing the most
- recently selected node in this window. */
-static void
-kill_node (window, nodename)
- WINDOW *window;
- char *nodename;
-{
- int iw, i;
- INFO_WINDOW *info_win;
- NODE *temp;
-
/* If there is no nodename to kill, quit now. */
if (!nodename)
{
@@ -2297,16 +2337,16 @@ kill_node (window, nodename)
}
/* If there is a nodename, find it in our window list. */
- for (iw = 0; (info_win = info_windows[iw]); iw++)
+ for (iw = 0; info_win = info_windows[iw]; iw++)
if (strcmp (nodename, info_win->nodes[info_win->current]->nodename) == 0)
break;
if (!info_win)
{
if (*nodename)
- info_error (_("Cannot kill node `%s'"), nodename);
+ info_error ("Cannot kill the node `%s'", nodename);
else
- window_clear_echo_area ();
+ window_clear_echo_area ();
return;
}
@@ -2314,12 +2354,13 @@ kill_node (window, nodename)
/* If there are no more nodes left anywhere to view, complain and exit. */
if (info_windows_index == 1 && info_windows[0]->nodes_index == 1)
{
- info_error (_("Cannot kill the last node"));
+ info_error ("Cannot kill the last node");
return;
}
- /* INFO_WIN contains the node that the user wants to stop viewing. Delete
- this node from the list of nodes previously shown in this window. */
+ /* INFO_WIN contains the node that the user wants to stop viewing.
+ Delete this node from the list of nodes previously shown in this
+ window. */
for (i = info_win->current; i < info_win->nodes_index; i++)
info_win->nodes[i] = info_win->nodes[i++];
@@ -2338,40 +2379,41 @@ kill_node (window, nodename)
long point;
if (info_windows[iw + 1])
- stealer = info_windows[iw + 1];
+ stealer = info_windows[iw + 1];
else
- stealer = info_windows[0];
+ stealer = info_windows[0];
/* If the node being displayed in the next window is not the most
- recently loaded one, get the most recently loaded one. */
+ recently loaded one, get the most recently loaded one. */
if ((stealer->nodes_index - 1) != stealer->current)
- which = stealer->nodes_index - 1;
+ which = stealer->nodes_index - 1;
/* Else, if there is another node behind the stealers current node,
- use that one. */
+ use that one. */
else if (stealer->current > 0)
- which = stealer->current - 1;
+ which = stealer->current - 1;
/* Else, just use the node appearing in STEALER's window. */
else
- which = stealer->current;
+ which = stealer->current;
/* Copy this node. */
{
- NODE *copy = xmalloc (sizeof (NODE));
-
- temp = stealer->nodes[which];
- point = stealer->points[which];
- pagetop = stealer->pagetops[which];
-
- copy->filename = temp->filename;
- copy->parent = temp->parent;
- copy->nodename = temp->nodename;
- copy->contents = temp->contents;
- copy->nodelen = temp->nodelen;
- copy->flags = temp->flags;
-
- temp = copy;
+ NODE *copy;
+
+ temp = stealer->nodes[which];
+ point = stealer->points[which];
+ pagetop = stealer->pagetops[which];
+
+ copy = (NODE *)xmalloc (sizeof (NODE));
+ copy->filename = temp->filename;
+ copy->parent = temp->parent;
+ copy->nodename = temp->nodename;
+ copy->contents = temp->contents;
+ copy->nodelen = temp->nodelen;
+ copy->flags = temp->flags;
+
+ temp = copy;
}
window_set_node_of_window (info_win->window, temp);
@@ -2384,39 +2426,16 @@ kill_node (window, nodename)
temp = info_win->nodes[info_win->current];
window_set_node_of_window (info_win->window, temp);
}
-
if (!info_error_was_printed)
window_clear_echo_area ();
-
- if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
-}
-
-/* Kill current node, thus going back one in the node history. I (karl)
- do not think this is completely correct yet, because of the
- window-changing stuff in kill_node, but it's a lot better than the
- previous implementation, which did not account for nodes being
- visited twice at all. */
-DECLARE_INFO_COMMAND (info_history_node,
- _("Select the most recently selected node"))
-{
- kill_node (window, active_window->node->nodename);
-}
-
-/* Kill named node. */
-DECLARE_INFO_COMMAND (info_kill_node, _("Kill this node"))
-{
- char *nodename = read_nodename_to_kill (window);
- kill_node (window, nodename);
}
-
/* Read the name of a file and select the entire file. */
-DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it"))
+DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it")
{
char *line;
- line = info_read_in_echo_area (window, _("Find file: "));
+ line = info_read_in_echo_area (window, "Find file: ");
if (!line)
{
info_abort_key (active_window, 1, 0);
@@ -2429,17 +2448,17 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it")
node = info_get_node (line, "*");
if (!node)
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error (_("Cannot find \"%s\"."), line);
- }
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error ("Cannot find \"%s\".", line);
+ }
else
- {
- set_remembered_pagetop_and_point (active_window);
- info_set_node_of_window (window, node);
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ info_set_node_of_window (window, node);
+ }
free (line);
}
@@ -2448,9 +2467,9 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it")
}
/* **************************************************************** */
-/* */
-/* Dumping and Printing Nodes */
-/* */
+/* */
+/* Dumping and Printing Nodes */
+/* */
/* **************************************************************** */
#define VERBOSE_NODE_DUMPING
@@ -2480,7 +2499,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
if (!output_stream)
{
- info_error (_("Could not create output file \"%s\"."), output_filename);
+ info_error ("Could not create output file \"%s\".", output_filename);
return;
}
@@ -2493,7 +2512,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING)
- info_error (_("Done."));
+ info_error ("Done.");
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2525,15 +2544,15 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
if (!node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- {
- if (filename && *nodename != '(')
- info_error
- (CANT_FILE_NODE, filename_non_directory (filename), nodename);
- else
- info_error (CANT_FIND_NODE, nodename);
- }
+ {
+ if (filename && *nodename != '(')
+ info_error
+ (CANT_FILE_NODE, filename_non_directory (filename), nodename);
+ else
+ info_error (CANT_FIND_NODE, nodename);
+ }
return;
}
@@ -2541,19 +2560,19 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
for (i = 0; i < dumped_already_index; i++)
if (strcmp (node->nodename, dumped_already[i]) == 0)
{
- free (node);
- return;
+ free (node);
+ return;
}
add_pointer_to_array (node->nodename, dumped_already_index, dumped_already,
- dumped_already_slots, 50, char *);
+ dumped_already_slots, 50, char *);
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
if (node->filename)
- info_error (_("Writing node \"(%s)%s\"..."),
- filename_non_directory (node->filename), node->nodename);
+ info_error ("Writing node \"(%s)%s\"...",
+ filename_non_directory (node->filename), node->nodename);
else
- info_error (_("Writing node \"%s\"..."), node->nodename);
+ info_error ("Writing node \"%s\"...", node->nodename);
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, stream);
@@ -2566,20 +2585,20 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
/* If this node is an Index, do not dump the menu references. */
if (string_in_line ("Index", node->nodename) == -1)
- menu = info_menu_of_node (node);
+ menu = info_menu_of_node (node);
if (menu)
- {
- for (i = 0; menu[i]; i++)
- {
- /* We don't dump Info files which are different than the
- current one. */
- if (!menu[i]->filename)
- dump_node_to_stream
- (filename, menu[i]->nodename, stream, dump_subnodes);
- }
- info_free_references (menu);
- }
+ {
+ for (i = 0; menu[i]; i++)
+ {
+ /* We don't dump Info files which are different than the
+ current one. */
+ if (!menu[i]->filename)
+ dump_node_to_stream
+ (filename, menu[i]->nodename, stream, dump_subnodes);
+ }
+ info_free_references (menu);
+ }
}
free (node);
@@ -2605,7 +2624,7 @@ dump_node_to_file (node, filename, dump_subnodes)
if (!output_stream)
{
- info_error (_("Could not create output file \"%s\"."), filename);
+ info_error ("Could not create output file \"%s\".", filename);
return;
}
@@ -2622,7 +2641,7 @@ dump_node_to_file (node, filename, dump_subnodes)
fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING)
- info_error (_("Done."));
+ info_error ("Done.");
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2631,7 +2650,7 @@ dump_node_to_file (node, filename, dump_subnodes)
#endif /* !DEFAULT_INFO_PRINT_COMMAND */
DECLARE_INFO_COMMAND (info_print_node,
- _("Pipe the contents of this node through INFO_PRINT_COMMAND"))
+ "Pipe the contents of this node through INFO_PRINT_COMMAND")
{
print_node (window->node);
}
@@ -2641,8 +2660,10 @@ void
print_node (node)
NODE *node;
{
+ char *print_command, *getenv ();
FILE *printer_pipe;
- char *print_command = getenv ("INFO_PRINT_COMMAND");
+
+ print_command = getenv ("INFO_PRINT_COMMAND");
if (!print_command || !*print_command)
print_command = DEFAULT_INFO_PRINT_COMMAND;
@@ -2651,24 +2672,24 @@ print_node (node)
if (!printer_pipe)
{
- info_error (_("Cannot open pipe to \"%s\"."), print_command);
+ info_error ("Cannot open pipe to \"%s\".", print_command);
return;
}
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
if (node->filename)
- info_error (_("Printing node \"(%s)%s\"..."),
- filename_non_directory (node->filename), node->nodename);
+ info_error ("Printing node \"(%s)%s\"...",
+ filename_non_directory (node->filename), node->nodename);
else
- info_error (_("Printing node \"%s\"..."), node->nodename);
+ info_error ("Printing node \"%s\"...", node->nodename);
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, printer_pipe);
pclose (printer_pipe);
#if defined (VERBOSE_NODE_DUMPING)
- info_error (_("Done."));
+ info_error ("Done.");
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2681,9 +2702,9 @@ write_node_to_stream (node, stream)
}
/* **************************************************************** */
-/* */
-/* Info Searching Commands */
-/* */
+/* */
+/* Info Searching Commands */
+/* */
/* **************************************************************** */
/* Variable controlling the garbage collection of files briefly visited
@@ -2758,7 +2779,7 @@ info_search_in_node (string, node, start, window, dir)
{
set_remembered_pagetop_and_point (window);
if (window->node != node)
- window_set_node_of_window (window, node);
+ window_set_node_of_window (window, node);
window->point = offset;
window_adjust_pagetop (window);
}
@@ -2778,7 +2799,7 @@ info_target_search_node (node, string, start)
long offset;
char *target;
- target = xstrdup (string);
+ target = strdup (string);
i = strlen (target);
/* Try repeatedly searching for this string while removing words from
@@ -2789,7 +2810,7 @@ info_target_search_node (node, string, start)
offset = info_search_in_node (target, node, start, (WINDOW *)NULL, 1);
if (offset != -1)
- break;
+ break;
/* Delete the last word from TARGET. */
for (; i && (!whitespace (target[i]) && (target[i] != ',')); i--);
@@ -2823,22 +2844,22 @@ info_search_internal (string, window, dir)
(strcmp (last_searched_for_string, string) == 0))
{
ret = info_search_in_node
- (string, window->node, window->point + dir, window, dir);
+ (string, window->node, window->point + dir, window, dir);
}
else
{
ret = info_search_in_node
- (string, window->node, window->point, window, dir);
+ (string, window->node, window->point, window, dir);
}
maybe_free (last_searched_for_string);
- last_searched_for_string = xstrdup (string);
+ last_searched_for_string = strdup (string);
if (ret != -1)
{
/* We won! */
if (!echo_area_is_active && !isearch_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
return (0);
}
@@ -2859,91 +2880,91 @@ info_search_internal (string, window, dir)
/* Find number of tags and current tag. */
last_subfile = (char *)NULL;
for (i = 0; file_buffer->tags[i]; i++)
- if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
- {
- current_tag = i;
- last_subfile = file_buffer->tags[i]->filename;
- }
+ if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
+ {
+ current_tag = i;
+ last_subfile = file_buffer->tags[i]->filename;
+ }
number_of_tags = i;
/* If there is no last_subfile, our tag wasn't found. */
if (!last_subfile)
- return (-1);
+ return (-1);
/* Search through subsequent nodes, wrapping around to the top
- of the info file until we find the string or return to this
- window's node and point. */
+ of the info file until we find the string or return to this
+ window's node and point. */
while (1)
- {
- NODE *node;
-
- /* Allow C-g to quit the search, failing it if pressed. */
- return_if_control_g (-1);
-
- current_tag += dir;
-
- if (current_tag < 0)
- current_tag = number_of_tags - 1;
- else if (current_tag == number_of_tags)
- current_tag = 0;
-
- tag = file_buffer->tags[current_tag];
-
- if (!echo_area_is_active && (last_subfile != tag->filename))
- {
- window_message_in_echo_area
- (_("Searching subfile \"%s\"..."),
- filename_non_directory (tag->filename));
-
- last_subfile = tag->filename;
- }
-
- node = info_get_node (file_buffer->filename, tag->nodename);
-
- if (!node)
- {
- /* If not doing i-search... */
- if (!echo_area_is_active)
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error (CANT_FILE_NODE,
- filename_non_directory (file_buffer->filename),
- tag->nodename);
- }
- return (-1);
- }
-
- if (dir < 0)
- start = tag->nodelen;
-
- ret =
- info_search_in_node (string, node, start, window, dir);
-
- /* Did we find the string in this node? */
- if (ret != -1)
- {
- /* Yes! We win. */
- remember_window_and_node (window, node);
- if (!echo_area_is_active)
- window_clear_echo_area ();
- return (0);
- }
-
- /* No. Free this node, and make sure that we haven't passed
- our starting point. */
- free (node);
-
- if (strcmp (initial_nodename, tag->nodename) == 0)
- return (-1);
- }
+ {
+ NODE *node;
+
+ /* Allow C-g to quit the search, failing it if pressed. */
+ return_if_control_g (-1);
+
+ current_tag += dir;
+
+ if (current_tag < 0)
+ current_tag = number_of_tags - 1;
+ else if (current_tag == number_of_tags)
+ current_tag = 0;
+
+ tag = file_buffer->tags[current_tag];
+
+ if (!echo_area_is_active && (last_subfile != tag->filename))
+ {
+ window_message_in_echo_area
+ ("Searching subfile \"%s\"...",
+ filename_non_directory (tag->filename));
+
+ last_subfile = tag->filename;
+ }
+
+ node = info_get_node (file_buffer->filename, tag->nodename);
+
+ if (!node)
+ {
+ /* If not doing i-search... */
+ if (!echo_area_is_active)
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error (CANT_FILE_NODE,
+ filename_non_directory (file_buffer->filename),
+ tag->nodename);
+ }
+ return (-1);
+ }
+
+ if (dir < 0)
+ start = tag->nodelen;
+
+ ret =
+ info_search_in_node (string, node, start, window, dir);
+
+ /* Did we find the string in this node? */
+ if (ret != -1)
+ {
+ /* Yes! We win. */
+ remember_window_and_node (window, node);
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+ return (0);
+ }
+
+ /* No. Free this node, and make sure that we haven't passed
+ our starting point. */
+ free (node);
+
+ if (strcmp (initial_nodename, tag->nodename) == 0)
+ return (-1);
+ }
}
return (-1);
}
-DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
+DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
{
char *line, *prompt;
int result, old_pagetop;
@@ -2963,9 +2984,9 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
prompt = (char *)xmalloc (50 + strlen (search_string));
- sprintf (prompt, _("%s for string [%s]: "),
- direction < 0 ? _("Search backward") : _("Search"),
- search_string);
+ sprintf (prompt, "%s for string [%s]: ",
+ direction < 0 ? "Search backward" : "Search",
+ search_string);
line = info_read_in_echo_area (window, prompt);
free (prompt);
@@ -2979,8 +3000,8 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
if (*line)
{
if (strlen (line) + 1 > search_string_size)
- search_string = (char *)
- xrealloc (search_string, (search_string_size += 50 + strlen (line)));
+ search_string = (char *)
+ xrealloc (search_string, (search_string_size += 50 + strlen (line)));
strcpy (search_string, line);
search_string_index = strlen (line);
@@ -2991,7 +3012,7 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
result = info_search_internal (search_string, active_window, direction);
if (result != 0 && !info_error_was_printed)
- info_error (_("Search failed."));
+ info_error ("Search failed.");
else if (old_pagetop != active_window->pagetop)
{
int new_pagetop;
@@ -3000,7 +3021,7 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
active_window->pagetop = old_pagetop;
set_window_pagetop (active_window, new_pagetop);
if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
+ info_get_or_remove_footnotes (active_window);
}
/* Perhaps free the unreferenced file buffers that were searched, but
@@ -3009,21 +3030,21 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
}
/* **************************************************************** */
-/* */
-/* Incremental Searching */
-/* */
+/* */
+/* Incremental Searching */
+/* */
/* **************************************************************** */
static void incremental_search ();
DECLARE_INFO_COMMAND (isearch_forward,
- _("Search interactively for a string as you type it"))
+ "Search interactively for a string as you type it")
{
incremental_search (window, count, key);
}
DECLARE_INFO_COMMAND (isearch_backward,
- _("Search interactively for a string as you type it"))
+ "Search interactively for a string as you type it")
{
incremental_search (window, -count, key);
}
@@ -3040,10 +3061,10 @@ static unsigned char isearch_terminate_search_key = ESC;
/* Structure defining the current state of an incremental search. */
typedef struct {
- WINDOW_STATE_DECL; /* The node, pagetop and point. */
- int search_index; /* Offset of the last char in the search string. */
- int direction; /* The direction that this search is heading in. */
- int failing; /* Whether or not this search failed. */
+ WINDOW_STATE_DECL; /* The node, pagetop and point. */
+ int search_index; /* Offset of the last char in the search string. */
+ int direction; /* The direction that this search is heading in. */
+ int failing; /* Whether or not this search failed. */
} SEARCH_STATE;
/* Array of search states. */
@@ -3066,7 +3087,7 @@ push_isearch (window, search_index, direction, failing)
state->failing = failing;
add_pointer_to_array (state, isearch_states_index, isearch_states,
- isearch_states_slots, 20, SEARCH_STATE *);
+ isearch_states_slots, 20, SEARCH_STATE *);
}
/* Pop the state of this search to WINDOW, SEARCH_INDEX, and DIRECTION. */
@@ -3117,9 +3138,9 @@ show_isearch_prompt (dir, string, failing_p)
int prompt_len, p_rep_index, p_rep_size;
if (dir < 0)
- prefix = _("I-search backward: ");
+ prefix = "I-search backward: ";
else
- prefix = _("I-search: ");
+ prefix = "I-search: ";
p_rep_index = p_rep_size = 0;
p_rep = (char *)NULL;
@@ -3128,15 +3149,15 @@ show_isearch_prompt (dir, string, failing_p)
char *rep;
switch (string[i])
- {
- case ' ': rep = " "; break;
- case LFD: rep = "\\n"; break;
- case TAB: rep = "\\t"; break;
- default:
- rep = pretty_keyname (string[i]);
- }
+ {
+ case ' ': rep = " "; break;
+ case LFD: rep = "\\n"; break;
+ case TAB: rep = "\\t"; break;
+ default:
+ rep = pretty_keyname (string[i]);
+ }
if ((p_rep_index + strlen (rep) + 1) >= p_rep_size)
- p_rep = (char *)xrealloc (p_rep, p_rep_size += 100);
+ p_rep = (char *)xrealloc (p_rep, p_rep_size += 100);
strcpy (p_rep + p_rep_index, rep);
p_rep_index += strlen (rep);
@@ -3144,8 +3165,8 @@ show_isearch_prompt (dir, string, failing_p)
prompt_len = strlen (prefix) + p_rep_index + 20;
prompt = (char *)xmalloc (prompt_len);
- sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix,
- p_rep ? p_rep : "");
+ sprintf (prompt, "%s%s%s", failing_p ? "Failing " : "", prefix,
+ p_rep ? p_rep : "");
window_message_in_echo_area ("%s", prompt);
maybe_free (p_rep);
@@ -3188,202 +3209,202 @@ incremental_search (window, count, ignore)
int quoted = 0;
/* If a recent display was interrupted, then do the redisplay now if
- it is convenient. */
+ it is convenient. */
if (!info_any_buffered_input_p () && display_was_interrupted_p)
- {
- display_update_one_window (window);
- display_cursor_at_point (active_window);
- }
+ {
+ display_update_one_window (window);
+ display_cursor_at_point (active_window);
+ }
/* Read a character and dispatch on it. */
key = info_get_input_char ();
window_get_state (window, &mystate);
if (key == DEL)
- {
- /* User wants to delete one level of search? */
- if (!isearch_states_index)
- {
- terminal_ring_bell ();
- continue;
- }
- else
- {
- pop_isearch
- (window, &isearch_string_index, &dir, &search_result);
- isearch_string[isearch_string_index] = '\0';
- show_isearch_prompt (dir, isearch_string, search_result);
- goto after_search;
- }
- }
+ {
+ /* User wants to delete one level of search? */
+ if (!isearch_states_index)
+ {
+ terminal_ring_bell ();
+ continue;
+ }
+ else
+ {
+ pop_isearch
+ (window, &isearch_string_index, &dir, &search_result);
+ isearch_string[isearch_string_index] = '\0';
+ show_isearch_prompt (dir, isearch_string, search_result);
+ goto after_search;
+ }
+ }
else if (key == Control ('q'))
- {
- key = info_get_input_char ();
- quoted = 1;
- }
+ {
+ key = info_get_input_char ();
+ quoted = 1;
+ }
/* We are about to search again, or quit. Save the current search. */
push_isearch (window, isearch_string_index, dir, search_result);
if (quoted)
- goto insert_and_search;
+ goto insert_and_search;
if (!Meta_p (key) || (ISO_Latin_p && key < 160))
- {
- func = window->keymap[key].function;
-
- /* If this key invokes an incremental search, then this means that
- we will either search again in the same direction, search
- again in the reverse direction, or insert the last search
- string that was accepted through incremental searching. */
- if (func == isearch_forward || func == isearch_backward)
- {
- if ((func == isearch_forward && dir > 0) ||
- (func == isearch_backward && dir < 0))
- {
- /* If the user has typed no characters, then insert the
- last successful search into the current search string. */
- if (isearch_string_index == 0)
- {
- /* Of course, there must be something to insert. */
- if (last_isearch_accepted)
- {
- if (strlen (last_isearch_accepted) + 1 >=
- isearch_string_size)
- isearch_string = (char *)
- xrealloc (isearch_string,
- isearch_string_size += 10 +
- strlen (last_isearch_accepted));
- strcpy (isearch_string, last_isearch_accepted);
- isearch_string_index = strlen (isearch_string);
- goto search_now;
- }
- else
- continue;
- }
- else
- {
- /* Search again in the same direction. This means start
- from a new place if the last search was successful. */
- if (search_result == 0)
- window->point += dir;
- }
- }
- else
- {
- /* Reverse the direction of the search. */
- dir = -dir;
- }
- }
- else if (isprint (key) || func == (VFunction *)NULL)
- {
- insert_and_search:
-
- if (isearch_string_index + 2 >= isearch_string_size)
- isearch_string = (char *)xrealloc
- (isearch_string, isearch_string_size += 100);
-
- isearch_string[isearch_string_index++] = key;
- isearch_string[isearch_string_index] = '\0';
- goto search_now;
- }
- else if (func == info_abort_key)
- {
- /* If C-g pressed, and the search is failing, pop the search
- stack back to the last unfailed search. */
- if (isearch_states_index && (search_result != 0))
- {
- terminal_ring_bell ();
- while (isearch_states_index && (search_result != 0))
- pop_isearch
- (window, &isearch_string_index, &dir, &search_result);
- isearch_string[isearch_string_index] = '\0';
- show_isearch_prompt (dir, isearch_string, search_result);
- continue;
- }
- else
- goto exit_search;
- }
- else
- goto exit_search;
- }
+ {
+ func = window->keymap[key].function;
+
+ /* If this key invokes an incremental search, then this means that
+ we will either search again in the same direction, search
+ again in the reverse direction, or insert the last search
+ string that was accepted through incremental searching. */
+ if (func == isearch_forward || func == isearch_backward)
+ {
+ if ((func == isearch_forward && dir > 0) ||
+ (func == isearch_backward && dir < 0))
+ {
+ /* If the user has typed no characters, then insert the
+ last successful search into the current search string. */
+ if (isearch_string_index == 0)
+ {
+ /* Of course, there must be something to insert. */
+ if (last_isearch_accepted)
+ {
+ if (strlen (last_isearch_accepted) + 1 >=
+ isearch_string_size)
+ isearch_string = (char *)
+ xrealloc (isearch_string,
+ isearch_string_size += 10 +
+ strlen (last_isearch_accepted));
+ strcpy (isearch_string, last_isearch_accepted);
+ isearch_string_index = strlen (isearch_string);
+ goto search_now;
+ }
+ else
+ continue;
+ }
+ else
+ {
+ /* Search again in the same direction. This means start
+ from a new place if the last search was successful. */
+ if (search_result == 0)
+ window->point += dir;
+ }
+ }
+ else
+ {
+ /* Reverse the direction of the search. */
+ dir = -dir;
+ }
+ }
+ else if (isprint (key) || func == (VFunction *)NULL)
+ {
+ insert_and_search:
+
+ if (isearch_string_index + 2 >= isearch_string_size)
+ isearch_string = (char *)xrealloc
+ (isearch_string, isearch_string_size += 100);
+
+ isearch_string[isearch_string_index++] = key;
+ isearch_string[isearch_string_index] = '\0';
+ goto search_now;
+ }
+ else if (func == info_abort_key)
+ {
+ /* If C-g pressed, and the search is failing, pop the search
+ stack back to the last unfailed search. */
+ if (isearch_states_index && (search_result != 0))
+ {
+ terminal_ring_bell ();
+ while (isearch_states_index && (search_result != 0))
+ pop_isearch
+ (window, &isearch_string_index, &dir, &search_result);
+ isearch_string[isearch_string_index] = '\0';
+ show_isearch_prompt (dir, isearch_string, search_result);
+ continue;
+ }
+ else
+ goto exit_search;
+ }
+ else
+ goto exit_search;
+ }
else
- {
- exit_search:
- /* The character is not printable, or it has a function which is
- non-null. Exit the search, remembering the search string. If
- the key is not the same as the isearch_terminate_search_key,
- then push it into pending input. */
- if (isearch_string_index && func != info_abort_key)
- {
- maybe_free (last_isearch_accepted);
- last_isearch_accepted = xstrdup (isearch_string);
- }
-
- if (key != isearch_terminate_search_key)
- info_set_pending_input (key);
-
- if (func == info_abort_key)
- {
- if (isearch_states_index)
- window_set_state (window, &orig_state);
- }
-
- if (!echo_area_is_active)
- window_clear_echo_area ();
-
- if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
-
- isearch_is_active = 0;
- continue;
- }
+ {
+ exit_search:
+ /* The character is not printable, or it has a function which is
+ non-null. Exit the search, remembering the search string. If
+ the key is not the same as the isearch_terminate_search_key,
+ then push it into pending input. */
+ if (isearch_string_index && func != info_abort_key)
+ {
+ maybe_free (last_isearch_accepted);
+ last_isearch_accepted = strdup (isearch_string);
+ }
+
+ if (key != isearch_terminate_search_key)
+ info_set_pending_input (key);
+
+ if (func == info_abort_key)
+ {
+ if (isearch_states_index)
+ window_set_state (window, &orig_state);
+ }
+
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+
+ if (auto_footnotes_p)
+ info_get_or_remove_footnotes (active_window);
+
+ isearch_is_active = 0;
+ continue;
+ }
/* Search for the contents of isearch_string. */
search_now:
show_isearch_prompt (dir, isearch_string, search_result);
if (search_result == 0)
- {
- /* Check to see if the current search string is right here. If
- we are looking at it, then don't bother calling the search
- function. */
- if (((dir < 0) &&
- (strncasecmp (window->node->contents + window->point,
- isearch_string, isearch_string_index) == 0)) ||
- ((dir > 0) &&
- ((window->point - isearch_string_index) >= 0) &&
- (strncasecmp (window->node->contents +
- (window->point - (isearch_string_index - 1)),
- isearch_string, isearch_string_index) == 0)))
- {
- if (dir > 0)
- window->point++;
- }
- else
- search_result = info_search_internal (isearch_string, window, dir);
- }
+ {
+ /* Check to see if the current search string is right here. If
+ we are looking at it, then don't bother calling the search
+ function. */
+ if (((dir < 0) &&
+ (strncasecmp (window->node->contents + window->point,
+ isearch_string, isearch_string_index) == 0)) ||
+ ((dir > 0) &&
+ ((window->point - isearch_string_index) >= 0) &&
+ (strncasecmp (window->node->contents +
+ (window->point - (isearch_string_index - 1)),
+ isearch_string, isearch_string_index) == 0)))
+ {
+ if (dir > 0)
+ window->point++;
+ }
+ else
+ search_result = info_search_internal (isearch_string, window, dir);
+ }
/* If this search failed, and we didn't already have a failed search,
- then ring the terminal bell. */
+ then ring the terminal bell. */
if (search_result != 0 && last_search_result == 0)
- terminal_ring_bell ();
+ terminal_ring_bell ();
after_search:
show_isearch_prompt (dir, isearch_string, search_result);
if (search_result == 0)
- {
- if ((mystate.node == window->node) &&
- (mystate.pagetop != window->pagetop))
- {
- int newtop = window->pagetop;
- window->pagetop = mystate.pagetop;
- set_window_pagetop (window, newtop);
- }
- display_update_one_window (window);
- display_cursor_at_point (window);
- }
+ {
+ if ((mystate.node == window->node) &&
+ (mystate.pagetop != window->pagetop))
+ {
+ int newtop = window->pagetop;
+ window->pagetop = mystate.pagetop;
+ set_window_pagetop (window, newtop);
+ }
+ display_update_one_window (window);
+ display_cursor_at_point (window);
+ }
last_search_result = search_result;
}
@@ -3413,52 +3434,52 @@ info_gc_file_buffers ()
if (!info_loaded_files)
return;
- for (fb_index = 0; (fb = info_loaded_files[fb_index]); fb_index++)
+ for (fb_index = 0; fb = info_loaded_files[fb_index]; fb_index++)
{
int fb_referenced_p = 0;
/* If already gc-ed, do nothing. */
if (!fb->contents)
- continue;
+ continue;
/* If this file had to be uncompressed, check to see if we should
- gc it. This means that the user-variable "gc-compressed-files"
- is non-zero. */
+ gc it. This means that the user-variable "gc-compressed-files"
+ is non-zero. */
if ((fb->flags & N_IsCompressed) && !gc_compressed_files)
- continue;
+ continue;
/* If this file's contents are not gc-able, move on. */
if (fb->flags & N_CannotGC)
- continue;
+ continue;
/* Check each INFO_WINDOW to see if it has any nodes which reference
- this file. */
- for (iw_index = 0; (iw = info_windows[iw_index]); iw_index++)
- {
- for (i = 0; iw->nodes && iw->nodes[i]; i++)
- {
- if ((strcmp (fb->fullpath, iw->nodes[i]->filename) == 0) ||
- (strcmp (fb->filename, iw->nodes[i]->filename) == 0))
- {
- fb_referenced_p = 1;
- break;
- }
- }
- }
+ this file. */
+ for (iw_index = 0; iw = info_windows[iw_index]; iw_index++)
+ {
+ for (i = 0; iw->nodes && iw->nodes[i]; i++)
+ {
+ if ((strcmp (fb->fullpath, iw->nodes[i]->filename) == 0) ||
+ (strcmp (fb->filename, iw->nodes[i]->filename) == 0))
+ {
+ fb_referenced_p = 1;
+ break;
+ }
+ }
+ }
/* If this file buffer wasn't referenced, free its contents. */
if (!fb_referenced_p)
- {
- free (fb->contents);
- fb->contents = (char *)NULL;
- }
+ {
+ free (fb->contents);
+ fb->contents = (char *)NULL;
+ }
}
}
/* **************************************************************** */
-/* */
-/* Traversing and Selecting References */
-/* */
+/* */
+/* Traversing and Selecting References */
+/* */
/* **************************************************************** */
/* Move to the next or previous cross reference in this node. */
@@ -3493,8 +3514,8 @@ info_move_to_xref (window, count, key, dir)
char *text = node->contents + firstmenu;
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
- firstmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir);
+ firstmenu = info_search_in_node
+ (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir);
}
firstxref =
@@ -3509,7 +3530,7 @@ info_move_to_xref (window, count, key, dir)
if (firstmenu == -1 && firstxref == -1)
{
- info_error (_("No cross references in this node."));
+ info_error ("No cross references in this node.");
return;
}
@@ -3533,8 +3554,8 @@ info_move_to_xref (window, count, key, dir)
char *text = node->contents + nextmenu;
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
- nextmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir);
+ nextmenu = info_search_in_node
+ (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir);
}
/* If there is both a next menu entry, and a next xref entry, choose the
@@ -3543,10 +3564,10 @@ info_move_to_xref (window, count, key, dir)
if (nextmenu != -1 && nextxref != -1)
{
if (((dir == 1) && (nextmenu < nextxref)) ||
- ((dir == -1) && (nextmenu > nextxref)))
- placement = nextmenu + 1;
+ ((dir == -1) && (nextmenu > nextxref)))
+ placement = nextmenu + 1;
else
- placement = nextxref;
+ placement = nextxref;
}
else if (nextmenu != -1)
placement = nextmenu + 1;
@@ -3558,17 +3579,17 @@ info_move_to_xref (window, count, key, dir)
if (placement == -1)
{
if (firstmenu != -1 && firstxref != -1)
- {
- if (((dir == 1) && (firstmenu < firstxref)) ||
- ((dir == -1) && (firstmenu > firstxref)))
- placement = firstmenu + 1;
- else
- placement = firstxref;
- }
+ {
+ if (((dir == 1) && (firstmenu < firstxref)) ||
+ ((dir == -1) && (firstmenu > firstxref)))
+ placement = firstmenu + 1;
+ else
+ placement = firstxref;
+ }
else if (firstmenu != -1)
- placement = firstmenu + 1;
+ placement = firstmenu + 1;
else
- placement = firstxref;
+ placement = firstxref;
}
window->point = placement;
window_adjust_pagetop (window);
@@ -3576,7 +3597,7 @@ info_move_to_xref (window, count, key, dir)
}
DECLARE_INFO_COMMAND (info_move_to_prev_xref,
- _("Move to the previous cross reference"))
+ "Move to the previous cross reference")
{
if (count < 0)
info_move_to_prev_xref (window, -count, key);
@@ -3585,7 +3606,7 @@ DECLARE_INFO_COMMAND (info_move_to_prev_xref,
}
DECLARE_INFO_COMMAND (info_move_to_next_xref,
- _("Move to the next cross reference"))
+ "Move to the next cross reference")
{
if (count < 0)
info_move_to_next_xref (window, -count, key);
@@ -3595,7 +3616,7 @@ DECLARE_INFO_COMMAND (info_move_to_next_xref,
/* Select the menu item or reference that appears on this line. */
DECLARE_INFO_COMMAND (info_select_reference_this_line,
- _("Select reference or menu item appearing on this line"))
+ "Select reference or menu item appearing on this line")
{
char *line;
NODE *orig;
@@ -3611,20 +3632,20 @@ DECLARE_INFO_COMMAND (info_select_reference_this_line,
}
/* **************************************************************** */
-/* */
-/* Miscellaneous Info Commands */
-/* */
+/* */
+/* Miscellaneous Info Commands */
+/* */
/* **************************************************************** */
/* What to do when C-g is pressed in a window. */
-DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation"))
+DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation")
{
/* If error printing doesn't oridinarily ring the bell, do it now,
since C-g always rings the bell. Otherwise, let the error printer
do it. */
if (!info_error_rings_bell_p)
terminal_ring_bell ();
- info_error (_("Quit"));
+ info_error ("Quit");
info_initialize_numeric_arg ();
info_clear_pending_input ();
@@ -3633,7 +3654,7 @@ DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation"))
/* Move the cursor to the desired line of the window. */
DECLARE_INFO_COMMAND (info_move_to_window_line,
- _("Move to the cursor to a specific line of the window"))
+ "Move to the cursor to a specific line of the window")
{
int line;
@@ -3643,9 +3664,9 @@ DECLARE_INFO_COMMAND (info_move_to_window_line,
else
{
if (count < 0)
- line = (window->height + count) + window->pagetop;
+ line = (window->height + count) + window->pagetop;
else
- line = window->pagetop + count;
+ line = window->pagetop + count;
}
/* If the line doesn't appear in this window, make it do so. */
@@ -3665,7 +3686,7 @@ DECLARE_INFO_COMMAND (info_move_to_window_line,
/* Clear the screen and redraw its contents. Given a numeric argument,
move the line the cursor is on to the COUNT'th line of the window. */
-DECLARE_INFO_COMMAND (info_redraw_display, _("Redraw the display"))
+DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display")
{
if ((!info_explicit_arg && count == 1) || echo_area_is_active)
{
@@ -3682,18 +3703,18 @@ DECLARE_INFO_COMMAND (info_redraw_display, _("Redraw the display"))
point_line = window_line_of_point (window) - window->pagetop;
if (count < 0)
- desired_line = window->height + count;
+ desired_line = window->height + count;
else
- desired_line = count;
+ desired_line = count;
if (desired_line < 0)
- desired_line = 0;
+ desired_line = 0;
if (desired_line >= window->height)
- desired_line = window->height - 1;
+ desired_line = window->height - 1;
if (desired_line == point_line)
- return;
+ return;
new_pagetop = window->pagetop + (point_line - desired_line);
@@ -3702,14 +3723,14 @@ DECLARE_INFO_COMMAND (info_redraw_display, _("Redraw the display"))
}
/* This command does nothing. It is the fact that a key is bound to it
that has meaning. See the code at the top of info_session (). */
-DECLARE_INFO_COMMAND (info_quit, _("Quit using Info"))
+DECLARE_INFO_COMMAND (info_quit, "Quit using Info")
{}
/* **************************************************************** */
-/* */
-/* Reading Keys and Dispatching on Them */
-/* */
+/* */
+/* Reading Keys and Dispatching on Them */
+/* */
/* **************************************************************** */
/* Declaration only. Special cased in info_dispatch_on_key (). */
@@ -3725,14 +3746,14 @@ dispatch_error (keyseq)
rep = pretty_keyseq (keyseq);
if (!echo_area_is_active)
- info_error (_("Unknown command (%s)."), rep);
+ info_error ("Unknown command (%s).", rep);
else
{
char *temp;
- temp = (char *)xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid")));
+ temp = (char *)xmalloc (1 + strlen (rep) + strlen ("\"\" is invalid"));
- sprintf (temp, _("\"%s\" is invalid"), rep);
+ sprintf (temp, "\"%s\" is invalid", rep);
terminal_ring_bell ();
inform_in_echo_area (temp);
free (temp);
@@ -3778,8 +3799,8 @@ pretty_keyseq (keyseq)
for (i = 0; keyseq[i]; i++)
{
sprintf (keyseq_rep + strlen (keyseq_rep), "%s%s",
- strlen (keyseq_rep) ? " " : "",
- pretty_keyname (keyseq[i]));
+ strlen (keyseq_rep) ? " " : "",
+ pretty_keyname (keyseq[i]));
}
return (keyseq_rep);
@@ -3812,30 +3833,25 @@ display_info_keyseq (expecting_future_input)
unsigned char
info_get_another_input_char ()
{
- int ready = !info_keyseq_displayed_p; /* ready if new and pending key */
+ int ready = 0;
/* If there isn't any input currently available, then wait a
moment looking for input. If we don't get it fast enough,
prompt a little bit with the current key sequence. */
- if (!info_keyseq_displayed_p)
+ if (!info_keyseq_displayed_p &&
+ !info_any_buffered_input_p () &&
+ !info_input_pending_p ())
{
- ready = 1;
- if (!info_any_buffered_input_p () &&
- !info_input_pending_p ())
- {
#if defined (FD_SET)
- struct timeval timer;
- fd_set readfds;
-
- FD_ZERO (&readfds);
- FD_SET (fileno (info_input_stream), &readfds);
- timer.tv_sec = 1;
- timer.tv_usec = 750;
- ready = select (fileno(info_input_stream)+1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
-#else
- ready = 0;
+ struct timeval timer;
+ fd_set readfds;
+
+ FD_ZERO (&readfds);
+ FD_SET (fileno (info_input_stream), &readfds);
+ timer.tv_sec = 0;
+ timer.tv_usec = 0;
+ ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
#endif /* FD_SET */
- }
}
if (!ready)
@@ -3854,16 +3870,16 @@ info_dispatch_on_key (key, map)
if (Meta_p (key) && (!ISO_Latin_p || map[key].function != ea_insert))
{
if (map[ESC].type == ISKMAP)
- {
- map = (Keymap)map[ESC].function;
- add_char_to_keyseq (ESC);
- key = UnMeta (key);
- info_dispatch_on_key (key, map);
- }
+ {
+ map = (Keymap)map[ESC].function;
+ add_char_to_keyseq (ESC);
+ key = UnMeta (key);
+ info_dispatch_on_key (key, map);
+ }
else
- {
- dispatch_error (info_keyseq);
- }
+ {
+ dispatch_error (info_keyseq);
+ }
return;
}
@@ -3871,74 +3887,74 @@ info_dispatch_on_key (key, map)
{
case ISFUNC:
{
- VFunction *func;
-
- func = map[key].function;
- if (func != (VFunction *)NULL)
- {
- /* Special case info_do_lowercase_version (). */
- if (func == info_do_lowercase_version)
- {
- info_dispatch_on_key (tolower (key), map);
- return;
- }
-
- add_char_to_keyseq (key);
-
- if (info_keyseq_displayed_p)
- display_info_keyseq (0);
-
- {
- WINDOW *where;
-
- where = active_window;
- (*map[key].function)
- (active_window, info_numeric_arg * info_numeric_arg_sign, key);
-
- /* If we have input pending, then the last command was a prefix
- command. Don't change the value of the last function vars.
- Otherwise, remember the last command executed in the var
- appropriate to the window in which it was executed. */
- if (!info_input_pending_p ())
- {
- if (where == the_echo_area)
- ea_last_executed_command = map[key].function;
- else
- info_last_executed_command = map[key].function;
- }
- }
- }
- else
- {
- add_char_to_keyseq (key);
- dispatch_error (info_keyseq);
- return;
- }
+ VFunction *func;
+
+ func = map[key].function;
+ if (func != (VFunction *)NULL)
+ {
+ /* Special case info_do_lowercase_version (). */
+ if (func == info_do_lowercase_version)
+ {
+ info_dispatch_on_key (tolower (key), map);
+ return;
+ }
+
+ add_char_to_keyseq (key);
+
+ if (info_keyseq_displayed_p)
+ display_info_keyseq (0);
+
+ {
+ WINDOW *where;
+
+ where = active_window;
+ (*map[key].function)
+ (active_window, info_numeric_arg * info_numeric_arg_sign, key);
+
+ /* If we have input pending, then the last command was a prefix
+ command. Don't change the value of the last function vars.
+ Otherwise, remember the last command executed in the var
+ appropriate to the window in which it was executed. */
+ if (!info_input_pending_p ())
+ {
+ if (where == the_echo_area)
+ ea_last_executed_command = map[key].function;
+ else
+ info_last_executed_command = map[key].function;
+ }
+ }
+ }
+ else
+ {
+ add_char_to_keyseq (key);
+ dispatch_error (info_keyseq);
+ return;
+ }
}
break;
case ISKMAP:
add_char_to_keyseq (key);
if (map[key].function != (VFunction *)NULL)
- {
- unsigned char newkey;
+ {
+ unsigned char newkey;
- newkey = info_get_another_input_char ();
- info_dispatch_on_key (newkey, (Keymap)map[key].function);
- }
+ newkey = info_get_another_input_char ();
+ info_dispatch_on_key (newkey, (Keymap)map[key].function);
+ }
else
- {
- dispatch_error (info_keyseq);
- return;
- }
+ {
+ dispatch_error (info_keyseq);
+ return;
+ }
break;
}
}
/* **************************************************************** */
-/* */
-/* Numeric Arguments */
-/* */
+/* */
+/* Numeric Arguments */
+/* */
/* **************************************************************** */
/* Handle C-u style numeric args, as well as M--, and M-digits. */
@@ -3955,7 +3971,7 @@ int info_numeric_arg = 1;
/* Add the current digit to the argument in progress. */
DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
- _("Add this digit to the current numeric argument"))
+ "Add this digit to the current numeric argument")
{
info_numeric_arg_digit_loop (window, 0, key);
}
@@ -3964,7 +3980,7 @@ DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
Read a key. If the key has nothing to do with arguments, then
dispatch on it. If the key is the abort character then abort. */
DECLARE_INFO_COMMAND (info_universal_argument,
- _("Start (or multiply by 4) the current numeric argument"))
+ "Start (or multiply by 4) the current numeric argument")
{
info_numeric_arg *= 4;
info_numeric_arg_digit_loop (window, 0, 0);
@@ -3979,7 +3995,7 @@ info_initialize_numeric_arg ()
}
DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop,
- _("Internally used by \\[universal-argument]"))
+ "Internally used by \\[universal-argument]")
{
unsigned char pure_key;
Keymap keymap = window->keymap;
@@ -3987,64 +4003,64 @@ DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop,
while (1)
{
if (key)
- pure_key = key;
+ pure_key = key;
else
- {
- if (display_was_interrupted_p && !info_any_buffered_input_p ())
- display_update_display (windows);
+ {
+ if (display_was_interrupted_p && !info_any_buffered_input_p ())
+ display_update_display (windows);
- if (active_window != the_echo_area)
- display_cursor_at_point (active_window);
+ if (active_window != the_echo_area)
+ display_cursor_at_point (active_window);
- pure_key = key = info_get_another_input_char ();
+ pure_key = key = info_get_another_input_char ();
- if (Meta_p (key))
- add_char_to_keyseq (ESC);
+ if (Meta_p (key))
+ add_char_to_keyseq (ESC);
- add_char_to_keyseq (UnMeta (key));
- }
+ add_char_to_keyseq (UnMeta (key));
+ }
if (Meta_p (key))
- key = UnMeta (key);
+ key = UnMeta (key);
if (keymap[key].type == ISFUNC &&
- keymap[key].function == info_universal_argument)
- {
- info_numeric_arg *= 4;
- key = 0;
- continue;
- }
+ keymap[key].function == info_universal_argument)
+ {
+ info_numeric_arg *= 4;
+ key = 0;
+ continue;
+ }
if (isdigit (key))
- {
- if (info_explicit_arg)
- info_numeric_arg = (info_numeric_arg * 10) + (key - '0');
- else
- info_numeric_arg = (key - '0');
- info_explicit_arg = 1;
- }
+ {
+ if (info_explicit_arg)
+ info_numeric_arg = (info_numeric_arg * 10) + (key - '0');
+ else
+ info_numeric_arg = (key - '0');
+ info_explicit_arg = 1;
+ }
else
- {
- if (key == '-' && !info_explicit_arg)
- {
- info_numeric_arg_sign = -1;
- info_numeric_arg = 1;
- }
- else
- {
- info_keyseq_index--;
- info_dispatch_on_key (pure_key, keymap);
- return;
- }
- }
+ {
+ if (key == '-' && !info_explicit_arg)
+ {
+ info_numeric_arg_sign = -1;
+ info_numeric_arg = 1;
+ }
+ else
+ {
+ info_keyseq_index--;
+ info_dispatch_on_key (pure_key, keymap);
+ return;
+ }
+ }
key = 0;
}
}
/* **************************************************************** */
-/* */
-/* Input Character Buffering */
-/* */
+/* */
+/* Input Character Buffering */
+/* */
/* **************************************************************** */
/* Character waiting to be read next. */
@@ -4093,7 +4109,7 @@ info_push_typeahead (key)
{
info_input_buffer[push_index++] = key;
if (push_index >= sizeof (info_input_buffer))
- push_index = 0;
+ push_index = 0;
}
}
@@ -4132,6 +4148,23 @@ info_any_buffered_input_p ()
return (push_index != pop_index);
}
+/* Push KEY into the *front* of the input buffer. Returns non-zero if
+ successful, zero if there is no space left in the buffer. */
+static int
+info_replace_key_to_typeahead (key)
+ unsigned char key;
+{
+ if (info_input_buffer_space_available ())
+ {
+ pop_index--;
+ if (pop_index < 0)
+ pop_index = sizeof (info_input_buffer) - 1;
+ info_input_buffer[pop_index] = key;
+ return (1);
+ }
+ return (0);
+}
+
/* If characters are available to be read, then read them and stuff them into
info_input_buffer. Otherwise, do nothing. */
void
@@ -4156,7 +4189,7 @@ info_gather_typeahead ()
chars_avail = space_avail;
if (chars_avail)
- chars_avail = read (tty, &input[0], chars_avail);
+ read (tty, &input[0], chars_avail);
}
#else /* !FIONREAD */
# if defined (O_NDELAY)
@@ -4198,55 +4231,34 @@ info_get_input_char ()
else if (info_get_key_from_typeahead (&keystroke) == 0)
{
int rawkey;
- unsigned char c;
- int tty = fileno (info_input_stream);
-
- /* Using stream I/O causes FIONREAD etc to fail to work
- so unless someone can find a portable way of finding
- out how many characters are currently buffered, we
- should stay with away from stream I/O.
- --Egil Kvaleberg <egilk@sn.no>, January 1997. */
-#ifdef EINTR
- /* Keep reading if we got EINTR, so that we don't just exit.
- --Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>,
- 22 Dec 1997. */
- {
- int n;
- do
- n = read (tty, &c, 1);
- while (n == -1 && errno == EINTR);
- rawkey = n == 1 ? c : EOF;
- }
-#else
- rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
-#endif
+ rawkey = getc (info_input_stream);
keystroke = rawkey;
if (rawkey == EOF)
- {
- if (info_input_stream != stdin)
- {
- fclose (info_input_stream);
- info_input_stream = stdin;
- display_inhibited = 0;
- display_update_display (windows);
- display_cursor_at_point (active_window);
- rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
- keystroke = rawkey;
- }
-
- if (rawkey == EOF)
- {
- terminal_unprep_terminal ();
- close_dribble_file ();
- exit (0);
- }
- }
+ {
+ if (info_input_stream != stdin)
+ {
+ fclose (info_input_stream);
+ info_input_stream = stdin;
+ display_inhibited = 0;
+ display_update_display (windows);
+ display_cursor_at_point (active_window);
+ rawkey = getc (info_input_stream);
+ keystroke = rawkey;
+ }
+
+ if (rawkey == EOF)
+ {
+ terminal_unprep_terminal ();
+ close_dribble_file ();
+ exit (0);
+ }
+ }
}
if (info_dribble_file)
dribble (keystroke);
- return keystroke;
+ return (keystroke);
}
diff --git a/contrib/texinfo/info/session.h b/contrib/texinfo/info/session.h
index f1e5b23be8a0..98b8ccf695fd 100644
--- a/contrib/texinfo/info/session.h
+++ b/contrib/texinfo/info/session.h
@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (SESSION_H)
-#define SESSION_H
+#if !defined (_SESSION_H_)
+#define _SESSION_H_
-#include "info.h"
+#include "general.h"
#include "dribble.h"
/* All commands that can be invoked from within info_session () receive
@@ -55,11 +55,11 @@ extern int info_scroll_behaviour;
extern char *info_scroll_choices[];
/* Values for info_scroll_behaviour. */
-#define IS_Continuous 0 /* Try to get first menu item, or failing that, the
- "Next:" pointer, or failing that, the "Up:" and
- "Next:" of the up. */
+#define IS_Continuous 0 /* Try to get first menu item, or failing that, the
+ "Next:" pointer, or failing that, the "Up:" and
+ "Next:" of the up. */
#define IS_NextOnly 1 /* Try to get "Next:" menu item. */
-#define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
+#define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
/* Utility functions found in session.c */
extern void info_dispatch_on_key ();
@@ -143,4 +143,4 @@ extern void info_print_node ();
/* Miscellaneous commands. */
extern void info_abort_key (), info_quit (), info_do_lowercase_version ();
-#endif /* SESSION_H */
+#endif /* _SESSION_H_ */
diff --git a/contrib/texinfo/info/signals.c b/contrib/texinfo/info/signals.c
index b93a585f5677..4f48e89a661b 100644
--- a/contrib/texinfo/info/signals.c
+++ b/contrib/texinfo/info/signals.c
@@ -25,9 +25,9 @@
#include "signals.h"
/* **************************************************************** */
-/* */
-/* Pretending That We Have POSIX Signals */
-/* */
+/* */
+/* Pretending That We Have POSIX Signals */
+/* */
/* **************************************************************** */
#if !defined (HAVE_SIGPROCMASK) && defined (HAVE_SIGSETMASK)
@@ -57,32 +57,36 @@ sigprocmask (operation, newset, oldset)
#endif /* !HAVE_SIGPROCMASK && HAVE_SIGSETMASK */
/* **************************************************************** */
-/* */
-/* Signal Handling for Info */
-/* */
+/* */
+/* Signal Handling for Info */
+/* */
/* **************************************************************** */
-typedef RETSIGTYPE signal_handler ();
+typedef void SigHandlerType;
+typedef SigHandlerType SigHandler ();
-static RETSIGTYPE info_signal_handler ();
-static signal_handler *old_TSTP, *old_TTOU, *old_TTIN;
-static signal_handler *old_WINCH, *old_INT;
+static SigHandlerType info_signal_handler ();
+static SigHandler *old_TSTP, *old_TTOU, *old_TTIN;
+static SigHandler *old_WINCH, *old_INT, *old_CONT;
void
initialize_info_signal_handler ()
{
#if defined (SIGTSTP)
- old_TSTP = (signal_handler *) signal (SIGTSTP, info_signal_handler);
- old_TTOU = (signal_handler *) signal (SIGTTOU, info_signal_handler);
- old_TTIN = (signal_handler *) signal (SIGTTIN, info_signal_handler);
+ old_TSTP = (SigHandler *) signal (SIGTSTP, info_signal_handler);
+ old_TTOU = (SigHandler *) signal (SIGTTOU, info_signal_handler);
+ old_TTIN = (SigHandler *) signal (SIGTTIN, info_signal_handler);
#endif /* SIGTSTP */
#if defined (SIGWINCH)
- old_WINCH = (signal_handler *) signal (SIGWINCH, info_signal_handler);
-#endif
+ old_WINCH = (SigHandler *) signal (SIGWINCH, info_signal_handler);
+#if defined (SIGCONT)
+ old_CONT = (SigHandler *) signal (SIGCONT, info_signal_handler);
+#endif /* SIGCONT */
+#endif /* SIGWINCH */
#if defined (SIGINT)
- old_INT = (signal_handler *) signal (SIGINT, info_signal_handler);
+ old_INT = (SigHandler *) signal (SIGINT, info_signal_handler);
#endif
}
@@ -97,11 +101,11 @@ redisplay_after_signal ()
fflush (stdout);
}
-static RETSIGTYPE
+static SigHandlerType
info_signal_handler (sig)
int sig;
{
- signal_handler **old_signal_handler;
+ SigHandler **old_signal_handler;
switch (sig)
{
@@ -115,56 +119,65 @@ info_signal_handler (sig)
#endif
{
#if defined (SIGTSTP)
- if (sig == SIGTSTP)
- old_signal_handler = &old_TSTP;
- if (sig == SIGTTOU)
- old_signal_handler = &old_TTOU;
- if (sig == SIGTTIN)
- old_signal_handler = &old_TTIN;
+ if (sig == SIGTSTP)
+ old_signal_handler = &old_TSTP;
+ if (sig == SIGTTOU)
+ old_signal_handler = &old_TTOU;
+ if (sig == SIGTTIN)
+ old_signal_handler = &old_TTIN;
#endif /* SIGTSTP */
- if (sig == SIGINT)
- old_signal_handler = &old_INT;
-
- /* For stop signals, restore the terminal IO, leave the cursor
- at the bottom of the window, and stop us. */
- terminal_goto_xy (0, screenheight - 1);
- terminal_clear_to_eol ();
- fflush (stdout);
- terminal_unprep_terminal ();
- signal (sig, *old_signal_handler);
- UNBLOCK_SIGNAL (sig);
- kill (getpid (), sig);
-
- /* The program is returning now. Restore our signal handler,
- turn on terminal handling, redraw the screen, and place the
- cursor where it belongs. */
- terminal_prep_terminal ();
- *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
- redisplay_after_signal ();
- fflush (stdout);
+ if (sig == SIGINT)
+ old_signal_handler = &old_INT;
+
+ /* For stop signals, restore the terminal IO, leave the cursor
+ at the bottom of the window, and stop us. */
+ terminal_goto_xy (0, screenheight - 1);
+ terminal_clear_to_eol ();
+ fflush (stdout);
+ terminal_unprep_terminal ();
+ signal (sig, *old_signal_handler);
+ UNBLOCK_SIGNAL (sig);
+ kill (getpid (), sig);
+
+ /* The program is returning now. Restore our signal handler,
+ turn on terminal handling, redraw the screen, and place the
+ cursor where it belongs. */
+ terminal_prep_terminal ();
+ *old_signal_handler = (SigHandler *) signal (sig, info_signal_handler);
+ redisplay_after_signal ();
+ fflush (stdout);
}
break;
+#if defined (SIGWINCH) && defined(SIGCONT)
+ case SIGCONT:
+ if(old_CONT)
+ (void)(old_CONT)(sig);
+ /* pretend a SIGWINCH in case the terminal window size has changed
+ while we've been asleep */
+ /* FALLTROUGH */
+#endif /* defined (SIGWINCH) && defined(SIGCONT) */
+
#if defined (SIGWINCH)
case SIGWINCH:
{
- /* Turn off terminal IO, tell our parent that the window has changed,
- then reinitialize the terminal and rebuild our windows. */
- old_signal_handler = &old_WINCH;
- terminal_goto_xy (0, 0);
- fflush (stdout);
- terminal_unprep_terminal ();
- signal (sig, *old_signal_handler);
- UNBLOCK_SIGNAL (sig);
- kill (getpid (), sig);
-
- /* After our old signal handler returns... */
- terminal_get_screen_size ();
- terminal_prep_terminal ();
- display_initialize_display (screenwidth, screenheight);
- window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
- *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
- redisplay_after_signal ();
+ /* Turn off terminal IO, tell our parent that the window has changed,
+ then reinitialize the terminal and rebuild our windows. */
+ old_signal_handler = &old_WINCH;
+ terminal_goto_xy (0, 0);
+ fflush (stdout);
+ terminal_unprep_terminal ();
+ signal (sig, *old_signal_handler);
+ UNBLOCK_SIGNAL (sig);
+ kill (getpid (), sig);
+
+ /* After our old signal handler returns... */
+ terminal_get_screen_size ();
+ terminal_prep_terminal ();
+ display_initialize_display (screenwidth, screenheight);
+ window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
+ *old_signal_handler = (SigHandler *) signal (sig, info_signal_handler);
+ redisplay_after_signal ();
}
break;
#endif /* SIGWINCH */
diff --git a/contrib/texinfo/info/signals.h b/contrib/texinfo/info/signals.h
index 3a45925a1831..ab87a3b54958 100644
--- a/contrib/texinfo/info/signals.h
+++ b/contrib/texinfo/info/signals.h
@@ -1,10 +1,9 @@
-/* signals.h -- Header to include system dependent signal definitions.
- $Id: signals.h,v 1.3 1997/07/15 18:35:59 karl Exp $
+/* signals.h -- Header to include system dependent signal definitions. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 94, 95, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,17 +21,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_SIGNALS_H
-#define INFO_SIGNALS_H
+#if !defined (_SIGNALS_H_)
+#define _SIGNALS_H_
-#include <sys/types.h>
#include <signal.h>
-/* For sysV68 --phdm@info.ucl.ac.be. */
-#if !defined (SIGCHLD) && defined (SIGCLD)
-#define SIGCHLD SIGCLD
-#endif
-
#if !defined (HAVE_SIGPROCMASK) && !defined (sigmask)
# define sigmask(x) (1 << ((x)-1))
#endif /* !HAVE_SIGPROCMASK && !sigmask */
@@ -93,4 +86,4 @@
# define UNBLOCK_SIGNAL(sig)
#endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */
-#endif /* not INFO_SIGNALS_H */
+#endif /* !_SIGNALS_H_ */
diff --git a/contrib/texinfo/info/termdep.h b/contrib/texinfo/info/termdep.h
index fc0f99211d63..4f8ce9057ccb 100644
--- a/contrib/texinfo/info/termdep.h
+++ b/contrib/texinfo/info/termdep.h
@@ -1,10 +1,10 @@
/* termdep.h -- System things that terminal.c depends on.
- $Id: termdep.h,v 1.3 1997/07/05 21:17:14 karl Exp $
+ $Id: termdep.h,v 1.3 1996/10/02 22:23:52 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,16 +22,28 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_TERMDEP_H
-#define INFO_TERMDEP_H
+#if !defined (_TERMDEP_H_)
+# define _TERMDEP_H_
-/* NeXT supplies <termios.h> but it is broken. Probably Autoconf should
- have a separate test, but anyway ... */
-#ifdef NeXT
-#undef HAVE_TERMIOS_H
+#if defined (HAVE_SYS_FCNTL_H)
+# include <sys/fcntl.h>
+#else
+# include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+
+#if defined (HAVE_SYS_FILE_H)
+# include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+
+#if defined (HAVE_STRINGS_H)
+# include <strings.h>
+#else
+# if defined (HAVE_STRING_H)
+# include <string.h>
+# endif
#endif
-#ifdef HAVE_TERMIOS_H
+#if defined (HAVE_TERMIOS_H)
# include <termios.h>
#else
# if defined (HAVE_TERMIO_H)
@@ -50,8 +62,15 @@
# endif /* !HAVE_TERMIO_H */
#endif /* !HAVE_TERMIOS_H */
-#ifdef HAVE_SYS_TTOLD_H
+#if defined (HAVE_SYS_TTOLD_H)
# include <sys/ttold.h>
#endif /* HAVE_SYS_TTOLD_H */
-#endif /* not INFO_TERMDEP_H */
+#if !defined (HAVE_STRCHR)
+# undef strchr
+# undef strrchr
+# define strchr index
+# define strrchr rindex
+#endif /* !HAVE_STRCHR */
+
+#endif /* _TERMDEP_H_ */
diff --git a/contrib/texinfo/info/terminal.c b/contrib/texinfo/info/terminal.c
index f0e43bebfae7..fcf5137089d0 100644
--- a/contrib/texinfo/info/terminal.c
+++ b/contrib/texinfo/info/terminal.c
@@ -1,8 +1,12 @@
-/* terminal.c -- How to handle the physical terminal for Info.
- $Id: terminal.c,v 1.9 1998/02/22 00:05:15 karl Exp $
+/* terminal.c -- How to handle the physical terminal for Info. */
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98
- Free Software Foundation, Inc.
+/* This file is part of GNU Info, a program for reading online documentation
+ stored in Info format.
+
+ This file has appeared in prior works by the Free Software Foundation;
+ thus it carries copyright dates from 1988 through 1993.
+
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,33 +24,20 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
#include "terminal.h"
#include "termdep.h"
-#include <sys/types.h>
-#include <signal.h>
+extern void *xmalloc (), *xrealloc ();
/* The Unix termcap interface code. */
-#ifdef HAVE_NCURSES_TERMCAP_H
-#include <ncurses/termcap.h>
-#else
-#ifdef HAVE_TERMCAP_H
-#include <termcap.h>
-#else
-/* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
- Unfortunately, PC is a global variable used by the termcap library. */
-#undef PC
-/* Termcap requires these variables, whether we access them or not. */
-char *BC, *UP;
-char PC; /* Pad character */
-short ospeed; /* Terminal output baud rate */
extern int tgetnum (), tgetflag (), tgetent ();
extern char *tgetstr (), *tgoto ();
+extern char *getenv ();
extern void tputs ();
-#endif /* not HAVE_TERMCAP_H */
-#endif /* not HAVE_NCURSES_TERMCAP_H */
/* Function "hooks". If you make one of these point to a function, that
function is called when appropriate instead of its namesake. Your
@@ -70,11 +61,20 @@ VFunction *terminal_write_chars_hook = (VFunction *)NULL;
VFunction *terminal_scroll_terminal_hook = (VFunction *)NULL;
/* **************************************************************** */
-/* */
-/* Terminal and Termcap */
-/* */
+/* */
+/* Terminal and Termcap */
+/* */
/* **************************************************************** */
+/* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
+ Unfortunately, PC is a global variable used by the termcap library. */
+#undef PC
+
+/* TERMCAP requires these variables, whether we access them or not. */
+char PC;
+char *BC, *UP;
+short ospeed;
+
/* A buffer which holds onto the current terminal description, and a pointer
used to float within it. */
static char *term_buffer = (char *)NULL;
@@ -85,8 +85,6 @@ static char *term_goto, *term_clreol, *term_cr, *term_clrpag;
static char *term_begin_use, *term_end_use;
static char *term_AL, *term_DL, *term_al, *term_dl;
-static char *term_keypad_on, *term_keypad_off;
-
/* How to go up a line. */
static char *term_up;
@@ -111,15 +109,17 @@ static char *term_invbeg;
/* The string to turn off inverse mode, if this term has one. */
static char *term_invend;
-/* Although I can't find any documentation that says this is supposed to
- return its argument, all the code I've looked at (termutils, less)
- does so, so fine. */
-static int
+/* The string to turn on keypad transmit mode, if this term has one. */
+static char *term_ks;
+
+/* The string to turn off keypad transmit mode, if this term has one. */
+static char *term_ke;
+
+static void
output_character_function (c)
int c;
{
putc (c, stdout);
- return c;
}
/* Macro to send STRING to the terminal. */
@@ -129,65 +129,29 @@ output_character_function (c)
tputs (string, 1, output_character_function); \
} while (0)
-/* Tell the terminal that we will be doing cursor addressable motion. */
+/* Tell the terminal that we will be doing cursor addressable motion. */
static void
terminal_begin_using_terminal ()
{
- RETSIGTYPE (*sigsave) ();
-
- if (term_keypad_on)
- send_to_terminal (term_keypad_on);
-
- if (!term_begin_use || !*term_begin_use)
- return;
-
-#ifdef SIGWINCH
- sigsave = signal (SIGWINCH, SIG_IGN);
-#endif
-
send_to_terminal (term_begin_use);
- /* Without this fflush and sleep, running info in a shelltool or
- cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
- not restored properly.
- From: strube@physik3.gwdg.de (Hans Werner Strube). */
- fflush (stdout);
- sleep (1);
-
-#ifdef SIGWINCH
- signal (SIGWINCH, sigsave);
-#endif
+ if (term_ks)
+ send_to_terminal(term_ks);
}
-/* Tell the terminal that we will not be doing any more cursor
- addressable motion. */
+/* Tell the terminal that we will not be doing any more cursor addressable
+ motion. */
static void
terminal_end_using_terminal ()
{
- RETSIGTYPE (*sigsave) ();
-
- if (term_keypad_off)
- send_to_terminal (term_keypad_off);
-
- if (!term_end_use || !*term_end_use)
- return;
-
-#ifdef SIGWINCH
- sigsave = signal (SIGWINCH, SIG_IGN);
-#endif
-
+ if (term_ke)
+ send_to_terminal(term_ke);
send_to_terminal (term_end_use);
- fflush (stdout);
- sleep (1);
-
-#ifdef SIGWINCH
- signal (SIGWINCH, sigsave);
-#endif
}
/* **************************************************************** */
-/* */
-/* Necessary Terminal Functions */
-/* */
+/* */
+/* Necessary Terminal Functions */
+/* */
/* **************************************************************** */
/* The functions and variables on this page implement the user visible
@@ -216,8 +180,11 @@ char *term_ku = (char *)NULL;
char *term_kd = (char *)NULL;
char *term_kr = (char *)NULL;
char *term_kl = (char *)NULL;
-char *term_kP = (char *)NULL; /* page-up */
-char *term_kN = (char *)NULL; /* page-down */
+char *term_kP = (char *)NULL;
+char *term_kN = (char *)NULL;
+char *term_kh = (char *)NULL;
+char *term_kH = (char *)NULL;
+
/* Move the cursor to the terminal location of X and Y. */
void
@@ -229,7 +196,7 @@ terminal_goto_xy (x, y)
else
{
if (term_goto)
- tputs (tgoto (term_goto, x, y), 1, output_character_function);
+ tputs (tgoto (term_goto, x, y), 1, output_character_function);
}
}
@@ -257,7 +224,7 @@ terminal_write_chars (string, nchars)
else
{
if (nchars)
- fwrite (string, 1, nchars, stdout);
+ fwrite (string, 1, nchars, stdout);
}
}
@@ -343,9 +310,9 @@ terminal_ring_bell ()
else
{
if (terminal_has_visible_bell_p && terminal_use_visible_bell_p)
- send_to_terminal (visible_bell);
+ send_to_terminal (visible_bell);
else
- send_to_terminal (audible_bell);
+ send_to_terminal (audible_bell);
}
}
@@ -367,7 +334,7 @@ terminal_delete_lines (start, count)
else
{
while (count--)
- tputs (term_dl, lines, output_character_function);
+ tputs (term_dl, lines, output_character_function);
}
fflush (stdout);
@@ -392,7 +359,7 @@ terminal_insert_lines (start, count)
else
{
while (count--)
- tputs (term_al, lines, output_character_function);
+ tputs (term_al, lines, output_character_function);
}
fflush (stdout);
@@ -418,22 +385,22 @@ terminal_scroll_terminal (start, end, amount)
else
{
/* If we are scrolling down, delete AMOUNT lines at END. Then insert
- AMOUNT lines at START. */
+ AMOUNT lines at START. */
if (amount > 0)
- {
- terminal_delete_lines (end, amount);
- terminal_insert_lines (start, amount);
- }
+ {
+ terminal_delete_lines (end, amount);
+ terminal_insert_lines (start, amount);
+ }
/* If we are scrolling up, delete AMOUNT lines before START. This
- actually does the upwards scroll. Then, insert AMOUNT lines
- after the already scrolled region (i.e., END - AMOUNT). */
+ actually does the upwards scroll. Then, insert AMOUNT lines
+ after the already scrolled region (i.e., END - AMOUNT). */
if (amount < 0)
- {
- int abs_amount = -amount;
- terminal_delete_lines (start - abs_amount, abs_amount);
- terminal_insert_lines (end - abs_amount, abs_amount);
- }
+ {
+ int abs_amount = -amount;
+ terminal_delete_lines (start - abs_amount, abs_amount);
+ terminal_insert_lines (end - abs_amount, abs_amount);
+ }
}
}
@@ -463,55 +430,55 @@ terminal_get_screen_size ()
#if defined (TIOCGWINSZ)
{
- struct winsize window_size;
+ struct winsize window_size;
- if (ioctl (fileno (stdout), TIOCGWINSZ, &window_size) == 0)
- {
- screenwidth = (int) window_size.ws_col;
- screenheight = (int) window_size.ws_row;
- }
+ if (ioctl (fileno (stdout), TIOCGWINSZ, &window_size) == 0)
+ {
+ screenwidth = (int) window_size.ws_col;
+ screenheight = (int) window_size.ws_row;
+ }
}
-#endif /* TIOCGWINSZ */
+#endif /* TIOCGWINSZ */
/* Environment variable COLUMNS overrides setting of "co". */
if (screenwidth <= 0)
- {
- char *sw = getenv ("COLUMNS");
+ {
+ char *sw = getenv ("COLUMNS");
- if (sw)
- screenwidth = atoi (sw);
+ if (sw)
+ screenwidth = atoi (sw);
- if (screenwidth <= 0)
- screenwidth = tgetnum ("co");
- }
+ if (screenwidth <= 0)
+ screenwidth = tgetnum ("co");
+ }
/* Environment variable LINES overrides setting of "li". */
if (screenheight <= 0)
- {
- char *sh = getenv ("LINES");
+ {
+ char *sh = getenv ("LINES");
- if (sh)
- screenheight = atoi (sh);
+ if (sh)
+ screenheight = atoi (sh);
- if (screenheight <= 0)
- screenheight = tgetnum ("li");
- }
+ if (screenheight <= 0)
+ screenheight = tgetnum ("li");
+ }
/* If all else fails, default to 80x24 terminal. */
if (screenwidth <= 0)
- screenwidth = 80;
+ screenwidth = 80;
if (screenheight <= 0)
- screenheight = 24;
+ screenheight = 24;
}
}
-/* Initialize the terminal which is known as TERMINAL_NAME. If this
- terminal doesn't have cursor addressability, `terminal_is_dumb_p'
- becomes nonzero. The variables SCREENHEIGHT and SCREENWIDTH are set
- to the dimensions that this terminal actually has. The variable
- TERMINAL_HAS_META_P becomes nonzero if this terminal supports a Meta
- key. Finally, the terminal screen is cleared. */
+/* Initialize the terminal which is known as TERMINAL_NAME. If this terminal
+ doesn't have cursor addressability, TERMINAL_IS_DUMB_P becomes non-zero.
+ The variables SCREENHEIGHT and SCREENWIDTH are set to the dimensions that
+ this terminal actually has. The variable TERMINAL_HAS_META_P becomes non-
+ zero if this terminal supports a Meta key. Finally, the terminal screen is
+ cleared. */
void
terminal_initialize_terminal (terminal_name)
char *terminal_name;
@@ -549,7 +516,7 @@ terminal_initialize_terminal (terminal_name)
term_cr = "\r";
term_up = term_dn = audible_bell = visible_bell = (char *)NULL;
term_ku = term_kd = term_kl = term_kr = (char *)NULL;
- term_kP = term_kN = (char *)NULL;
+ term_kP = term_kN = term_kh = term_kH = (char *)NULL;
return;
}
@@ -567,7 +534,7 @@ terminal_initialize_terminal (terminal_name)
}
#else
ospeed = B9600;
-#endif /* !TIOCGETP */
+#endif /* !TIOCGETP */
term_cr = tgetstr ("cr", &buffer);
term_clreol = tgetstr ("ce", &buffer);
@@ -603,9 +570,6 @@ terminal_initialize_terminal (terminal_name)
term_begin_use = tgetstr ("ti", &buffer);
term_end_use = tgetstr ("te", &buffer);
- term_keypad_on = tgetstr ("ks", &buffer);
- term_keypad_off = tgetstr ("ke", &buffer);
-
/* Check to see if this terminal has a meta key. */
terminal_has_meta_p = (tgetflag ("km") || tgetflag ("MT"));
if (terminal_has_meta_p)
@@ -619,24 +583,31 @@ terminal_initialize_terminal (terminal_name)
term_mo = (char *)NULL;
}
- /* Attempt to find the arrow keys. */
+ /* Attempt to find the arrow keys. */
term_ku = tgetstr ("ku", &buffer);
term_kd = tgetstr ("kd", &buffer);
term_kr = tgetstr ("kr", &buffer);
term_kl = tgetstr ("kl", &buffer);
-
term_kP = tgetstr ("kP", &buffer);
term_kN = tgetstr ("kN", &buffer);
+ term_kh = tgetstr ("kh", &buffer);
+ term_kH = tgetstr ("kH", &buffer);
+
+ /* Enable keypad and cursor keys if ks defined */
+ term_ks = tgetstr ("ks", &buffer);
+ term_ke = tgetstr ("ke", &buffer);
/* If this terminal is not cursor addressable, then it is really dumb. */
if (!term_goto)
terminal_is_dumb_p = 1;
+
+ terminal_begin_using_terminal ();
}
/* **************************************************************** */
-/* */
-/* How to Read Characters From the Terminal */
-/* */
+/* */
+/* How to Read Characters From the Terminal */
+/* */
/* **************************************************************** */
#if defined (TIOCGETC)
@@ -677,8 +648,6 @@ terminal_prep_terminal ()
return;
}
- terminal_begin_using_terminal ();
-
tty = fileno (stdin);
#if defined (HAVE_TERMIOS_H)
@@ -693,14 +662,7 @@ terminal_prep_terminal ()
#if defined (HAVE_TERMIOS_H) || defined (HAVE_TERMIO_H)
ttybuff.c_iflag &= (~ISTRIP & ~INLCR & ~IGNCR & ~ICRNL & ~IXON);
-/* These output flags are not part of POSIX, so only use them if they
- are defined. */
-#ifdef ONLCR
- ttybuff.c_oflag &= ~ONLCR ;
-#endif
-#ifdef OCRNL
- ttybuff.c_oflag &= ~OCRNL;
-#endif
+ ttybuff.c_oflag &= (~ONLCR);
ttybuff.c_lflag &= (~ICANON & ~ECHO);
ttybuff.c_cc[VMIN] = 1;
@@ -711,12 +673,7 @@ terminal_prep_terminal ()
if (ttybuff.c_cc[VQUIT] == '\177')
ttybuff.c_cc[VQUIT] = -1;
-
-#ifdef VLNEXT
- if (ttybuff.c_cc[VLNEXT] == '\026')
- ttybuff.c_cc[VLNEXT] = -1;
-#endif /* VLNEXT */
-#endif /* TERMIOS or TERMIO */
+#endif
#if defined (HAVE_TERMIOS_H)
tcsetattr (tty, TCSANOW, &ttybuff);
@@ -780,9 +737,9 @@ terminal_prep_terminal ()
temp = original_ltchars;
/* Make the interrupt keys go away. Just enough to make people happy. */
- temp.t_lnextc = -1; /* C-v. */
- temp.t_dsuspc = -1; /* C-y. */
- temp.t_flushc = -1; /* C-o. */
+ temp.t_lnextc = -1; /* C-v. */
+ temp.t_dsuspc = -1; /* C-y. */
+ temp.t_flushc = -1; /* C-o. */
ioctl (tty, TIOCSLTC, &temp);
}
# endif /* TIOCGLTC */
@@ -834,4 +791,3 @@ terminal_unprep_terminal ()
#endif /* !HAVE_TERMIOS_H */
terminal_end_using_terminal ();
}
-
diff --git a/contrib/texinfo/info/terminal.h b/contrib/texinfo/info/terminal.h
index 2e27268ea7fb..7cb115835c68 100644
--- a/contrib/texinfo/info/terminal.h
+++ b/contrib/texinfo/info/terminal.h
@@ -3,7 +3,7 @@
/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,10 +21,15 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (TERMINAL_H)
-#define TERMINAL_H
+#if !defined (_TERMINAL_H_)
+#define _TERMINAL_H_
-#include "info.h"
+/* We use the following data type to talk about pointers to functions. */
+#if !defined (__FUNCTION_DEF)
+# define __FUNCTION_DEF
+typedef int Function ();
+typedef void VFunction ();
+#endif /* _FUNCTION_DEF */
/* For almost every function externally visible from terminal.c, there is
a corresponding "hook" function which can be bound in order to replace
@@ -120,6 +125,5 @@ extern VFunction *terminal_ring_bell_hook;
/* The key sequences output by the arrow keys, if this terminal has any. */
extern char *term_ku, *term_kd, *term_kr, *term_kl;
-extern char *term_kP, *term_kN;
-#endif /* !TERMINAL_H */
+#endif /* !_TERMINAL_H_ */
diff --git a/contrib/texinfo/info/tilde.c b/contrib/texinfo/info/tilde.c
index 401f7e10a670..191d222d923a 100644
--- a/contrib/texinfo/info/tilde.c
+++ b/contrib/texinfo/info/tilde.c
@@ -1,11 +1,10 @@
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo).
- $Id: tilde.c,v 1.9 1998/02/22 23:03:21 karl Exp $
+ $Id: tilde.c,v 1.3 1996/09/29 23:12:30 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98
- Free Software Foundation, Inc.
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,29 +22,39 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-/* Indent #pragma so that older Cpp's don't try to parse it. */
-#ifdef _AIX
+#if defined (__GNUC__)
+# define alloca __builtin_alloca
+#else /* !__GNUC__ */
+# if defined (_AIX)
#pragma alloca
-#endif /* _AIX */
+# else /* !_AIX */
+# if defined (HAVE_ALLOCA_H)
+# include <alloca.h>
+# endif /* HAVE_ALLOCA_H */
+# endif /* !AIX */
+#endif /* !__GNUC__ */
+
+#if defined (HAVE_STDLIB_H)
+#include <stdlib.h>
+#endif
-/* Include config.h before doing alloca. */
-#include "info.h"
+#include "tilde.h"
+#include <pwd.h>
-#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-char *alloca ();
-# endif
-# endif
+#if defined (HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#include "clib.h"
+
+#if !defined (NULL)
+# define NULL 0x0
#endif
#if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc ();
+#else
+extern void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */
/* The default value of tilde_additional_prefixes. This is set to
@@ -96,16 +105,16 @@ tilde_find_prefix (string, len)
if (prefixes)
{
for (i = 0; i < string_len; i++)
- {
- for (j = 0; prefixes[j]; j++)
- {
- if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
- {
- *len = strlen (prefixes[j]) - 1;
- return (i + *len);
- }
- }
- }
+ {
+ for (j = 0; prefixes[j]; j++)
+ {
+ if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
+ {
+ *len = strlen (prefixes[j]) - 1;
+ return (i + *len);
+ }
+ }
+ }
}
return (string_len);
}
@@ -124,13 +133,13 @@ tilde_find_suffix (string)
for (i = 0; i < string_len; i++)
{
if (string[i] == '/' || !string[i])
- break;
+ break;
for (j = 0; suffixes && suffixes[j]; j++)
- {
- if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
- return (i);
- }
+ {
+ if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
+ return (i);
+ }
}
return (i);
}
@@ -158,7 +167,7 @@ tilde_expand (string)
/* Copy the skipped text into the result. */
if ((result_index + start + 1) > result_size)
- result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));
+ result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));
strncpy (result + result_index, string, start);
result_index += start;
@@ -167,12 +176,12 @@ tilde_expand (string)
string += start;
/* Make END be the index of one after the last character of the
- username. */
+ username. */
end = tilde_find_suffix (string);
/* If both START and END are zero, we are all done. */
if (!start && !end)
- break;
+ break;
/* Expand the entire tilde word, and copy it into RESULT. */
tilde_word = (char *)xmalloc (1 + end);
@@ -185,7 +194,7 @@ tilde_expand (string)
len = strlen (expansion);
if ((result_index + len + 1) > result_size)
- result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));
+ result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));
strcpy (result + result_index, expansion);
result_index += len;
@@ -205,87 +214,88 @@ tilde_expand_word (filename)
{
char *dirname;
- dirname = filename ? xstrdup (filename) : (char *)NULL;
+ dirname = filename ? strdup (filename) : (char *)NULL;
if (dirname && *dirname == '~')
{
char *temp_name;
if (!dirname[1] || dirname[1] == '/')
- {
- /* Prepend $HOME to the rest of the string. */
- char *temp_home = getenv ("HOME");
-
- /* If there is no HOME variable, look up the directory in
- the password database. */
- if (!temp_home)
- {
- struct passwd *entry;
-
- entry = (struct passwd *) getpwuid (getuid ());
- if (entry)
- temp_home = entry->pw_dir;
- }
-
- temp_name = (char *)
- alloca (1 + strlen (&dirname[1])
- + (temp_home ? strlen (temp_home) : 0));
- temp_name[0] = '\0';
- if (temp_home)
- strcpy (temp_name, temp_home);
- strcat (temp_name, &dirname[1]);
- free (dirname);
- dirname = xstrdup (temp_name);
- }
+ {
+ /* Prepend $HOME to the rest of the string. */
+ extern char *getenv ();
+ char *temp_home = getenv ("HOME");
+
+ /* If there is no HOME variable, look up the directory in
+ the password database. */
+ if (!temp_home)
+ {
+ struct passwd *entry;
+
+ entry = (struct passwd *) getpwuid (getuid ());
+ if (entry)
+ temp_home = entry->pw_dir;
+ }
+
+ temp_name = (char *)
+ alloca (1 + strlen (&dirname[1])
+ + (temp_home ? strlen (temp_home) : 0));
+ temp_name[0] = '\0';
+ if (temp_home)
+ strcpy (temp_name, temp_home);
+ strcat (temp_name, &dirname[1]);
+ free (dirname);
+ dirname = strdup (temp_name);
+ }
else
- {
- struct passwd *user_entry;
- char *username = (char *)alloca (257);
- int i, c;
-
- for (i = 1; (c = dirname[i]); i++)
- {
- if (c == '/')
- break;
- else
- username[i - 1] = c;
- }
- username[i - 1] = '\0';
-
- if (!(user_entry = (struct passwd *) getpwnam (username)))
- {
- /* If the calling program has a special syntax for
- expanding tildes, and we couldn't find a standard
- expansion, then let them try. */
- if (tilde_expansion_failure_hook)
- {
- char *expansion;
-
- expansion = (*tilde_expansion_failure_hook) (username);
-
- if (expansion)
- {
- temp_name = (char *)alloca
- (1 + strlen (expansion) + strlen (&dirname[i]));
- strcpy (temp_name, expansion);
- strcat (temp_name, &dirname[i]);
- free (expansion);
- goto return_name;
- }
- }
- /* We shouldn't report errors. */
- }
- else
- {
- temp_name = (char *)alloca
- (1 + strlen (user_entry->pw_dir) + strlen (&dirname[i]));
- strcpy (temp_name, user_entry->pw_dir);
- strcat (temp_name, &dirname[i]);
- return_name:
- free (dirname);
- dirname = xstrdup (temp_name);
- }
- endpwent ();
- }
+ {
+ struct passwd *user_entry;
+ char *username = (char *)alloca (257);
+ int i, c;
+
+ for (i = 1; c = dirname[i]; i++)
+ {
+ if (c == '/')
+ break;
+ else
+ username[i - 1] = c;
+ }
+ username[i - 1] = '\0';
+
+ if (!(user_entry = (struct passwd *) getpwnam (username)))
+ {
+ /* If the calling program has a special syntax for
+ expanding tildes, and we couldn't find a standard
+ expansion, then let them try. */
+ if (tilde_expansion_failure_hook)
+ {
+ char *expansion;
+
+ expansion = (*tilde_expansion_failure_hook) (username);
+
+ if (expansion)
+ {
+ temp_name = (char *)alloca
+ (1 + strlen (expansion) + strlen (&dirname[i]));
+ strcpy (temp_name, expansion);
+ strcat (temp_name, &dirname[i]);
+ free (expansion);
+ goto return_name;
+ }
+ }
+ /* We shouldn't report errors. */
+ }
+ else
+ {
+ temp_name = (char *)alloca
+ (1 + strlen (user_entry->pw_dir) + strlen (&dirname[i]));
+ strcpy (temp_name, user_entry->pw_dir);
+ strcat (temp_name, &dirname[i]);
+ return_name:
+ free (dirname);
+ dirname = strdup (temp_name);
+ }
+ endpwent ();
+ }
}
return (dirname);
}
@@ -308,15 +318,15 @@ main (argc, argv)
fflush (stdout);
if (!gets (line))
- strcpy (line, "done");
+ strcpy (line, "done");
if ((strcmp (line, "done") == 0) ||
- (strcmp (line, "quit") == 0) ||
- (strcmp (line, "exit") == 0))
- {
- done = 1;
- break;
- }
+ (strcmp (line, "quit") == 0) ||
+ (strcmp (line, "exit") == 0))
+ {
+ done = 1;
+ break;
+ }
result = tilde_expand (line);
printf (" --> %s\n", result);
@@ -359,7 +369,7 @@ xrealloc (pointer, bytes)
static void
memory_error_and_abort ()
{
- fprintf (stderr, _("readline: Out of virtual memory!\n"));
+ fprintf (stderr, "readline: Out of virtual memory!\n");
abort ();
}
#endif /* TEST */
diff --git a/contrib/texinfo/info/tilde.h b/contrib/texinfo/info/tilde.h
index 83f534b2bac1..d66aee95015e 100644
--- a/contrib/texinfo/info/tilde.h
+++ b/contrib/texinfo/info/tilde.h
@@ -25,10 +25,13 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef TILDE_H
-#define TILDE_H
-
-#include "info.h"
+/* Function pointers can be declared as (Function *)foo. */
+#if !defined (__FUNCTION_DEF)
+# define __FUNCTION_DEF
+typedef int Function ();
+typedef void VFunction ();
+typedef char *CFunction ();
+#endif /* _FUNCTION_DEF */
/* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called
@@ -53,4 +56,3 @@ extern char *tilde_expand ();
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word ();
-#endif /* not TILDE_H */
diff --git a/contrib/texinfo/info/userdoc.texi b/contrib/texinfo/info/userdoc.texi
new file mode 100644
index 000000000000..f9349c65c508
--- /dev/null
+++ b/contrib/texinfo/info/userdoc.texi
@@ -0,0 +1,1270 @@
+@c This file is meant to be included in any arbitrary piece of
+@c documentation that wishes to describe the info program. Some day
+@c info-stnd.texi should probably use this file instead of duplicating
+@c its contents.
+@c
+@c This file documents the use of the standalone GNU Info program,
+@c versions 2.7 and later.
+
+@ifclear InfoProgVer
+@set InfoProgVer 2.11
+@end ifclear
+@synindex vr cp
+@synindex fn cp
+@synindex ky cp
+
+@heading What is Info?
+
+This text documents the use of the GNU Info program, version
+@value{InfoProgVer}.
+
+@dfn{Info} is a program which is used to view info files on an ASCII
+terminal. @dfn{info files} are the result of processing texinfo files
+with the program @code{makeinfo} or with the Emacs command @code{M-x
+texinfo-format-buffer}. Finally, @dfn{texinfo} is a documentation
+language which allows a printed manual and online documentation (an info
+file) to be produced from a single source file.
+
+@menu
+* Options:: Options you can pass on the command line.
+* Cursor Commands:: Commands which move the cursor within a node.
+* Scrolling Commands:: Commands for moving the node around in a window.
+* Node Commands:: Commands for selecting a new node.
+* Searching Commands:: Commands for searching an info file.
+* Xref Commands:: Commands for selecting cross references.
+* Window Commands:: Commands which manipulate multiple windows.
+* Printing Nodes:: How to print out the contents of a node.
+* Miscellaneous Commands:: A few commands that defy categories.
+* Variables:: How to change the default behaviour of Info.
+@ifset NOTSET
+* Info for Sys Admins:: How to setup Info. Using special options.
+@end ifset
+@ifset STANDALONE
+* GNU Info Global Index:: Global index containing keystrokes, command names,
+ variable names, and general concepts.
+@end ifset
+@end menu
+
+@node Options
+@chapter Command Line Options
+@cindex command line options
+@cindex arguments, command line
+
+GNU Info accepts several options to control the initial node being
+viewed, and to specify which directories to search for info files. Here
+is a template showing an invocation of GNU Info from the shell:
+
+@example
+info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
+@end example
+
+The following @var{option-names} are available when invoking Info from
+the shell:
+
+@table @code
+@cindex directory path
+@item --directory @var{directory-path}
+@itemx -d @var{directory-path}
+Adds @var{directory-path} to the list of directory paths searched when
+Info needs to find a file. You may issue @code{--directory} multiple
+times; once for each directory which contains info files.
+Alternatively, you may specify a value for the environment variable
+@code{INFOPATH}; if @code{--directory} is not given, the value of
+@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon
+separated list of directory names. If you do not supply
+@code{INFOPATH} or @code{--directory-path} a default path is used.
+
+@item --file @var{filename}
+@itemx -f @var{filename}
+@cindex info file, selecting
+Specifies a particular info file to visit. Instead of visiting the file
+@code{dir}, Info will start with @code{(@var{filename})Top} as the first
+file and node.
+
+@item --node @var{nodename}
+@itemx -n @var{nodename}
+@cindex node, selecting
+Specifies a particular node to visit in the initial file loaded. This
+is especially useful in conjunction with @code{--file}@footnote{Of
+course, you can specify both the file and node in a @code{--node}
+command; but don't forget to escape the open and close parentheses from
+the shell as in: @code{info --node '(emacs)Buffers'}}. You may specify
+@code{--node} multiple times; for an interactive Info, each
+@var{nodename} is visited in its own window, for a non-interactive Info
+(such as when @code{--output} is given) each @var{nodename} is processed
+sequentially.
+
+@item --output @var{filename}
+@itemx -o @var{filename}
+@cindex file, outputting to
+@cindex outputting to a file
+Specify @var{filename} as the name of a file to output to. Each node
+that Info visits will be output to @var{filename} instead of
+interactively viewed. A value of @code{-} for @var{filename} specifies
+the standard output.
+
+@item --subnodes
+@cindex @code{--subnodes}, command line option
+This option only has meaning when given in conjunction with
+@code{--output}. It means to recursively output the nodes appearing in
+the menus of each node being output. Menu items which resolve to
+external info files are not output, and neither are menu items which are
+members of an index. Each node is only output once.
+
+@item --help
+@itemx -h
+Produces a relatively brief description of the available Info options.
+
+@item --version
+@cindex version information
+Prints the version information of Info and exits.
+
+@item @var{menu-item}
+@cindex menu, following
+Remaining arguments to Info are treated as the names of menu items. The
+first argument would be a menu item in the initial node visited, while
+the second argument would be a menu item in the first argument's node.
+You can easily move to the node of your choice by specifying the menu
+names which describe the path to that node. For example,
+
+@example
+info emacs buffers
+@end example
+
+first selects the menu item @samp{Emacs} in the node @samp{(dir)Top},
+and then selects the menu item @samp{Buffers} in the node
+@samp{(emacs)Top}.
+
+@end table
+
+@node Cursor Commands
+@chapter Moving the Cursor
+@cindex cursor, moving
+Many people find that reading screens of text page by page is made
+easier when one is able to indicate particular pieces of text with some
+kind of pointing device. Since this is the case, GNU Info (both the
+Emacs and standalone versions) have several commands which allow you to
+move the cursor about the screen. The notation used in this manual to
+describe keystrokes is identical to the notation used within the Emacs
+manual, and the GNU Readline manual. @xref{Characters, , Character
+Conventions, emacs, the GNU Emacs Manual}, if you are unfamilar with the
+notation.
+
+The following table lists the basic cursor movement commands in Info.
+Each entry consists of the key sequence you should type to execute the
+cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it
+invokes @code{execute-extended-command}. @xref{M-x, , Executing an
+extended command, emacs, the GNU Emacs Manual}, for more detailed
+information.} command name (displayed in parentheses), and a short
+description of what the command does. All of the cursor motion commands
+can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
+@code{universal-argument}}), to find out how to supply them. With a
+numeric argument, the motion commands are simply executed that
+many times; for example, a numeric argument of 4 given to
+@code{next-line} causes the cursor to move down 4 lines. With a
+negative numeric argument, the motion is reversed; an argument of -4
+given to the @code{next-line} command would cause the cursor to move
+@emph{up} 4 lines.
+
+@table @asis
+@item @code{C-n} (@code{next-line})
+@kindex C-n
+@findex next-line
+Moves the cursor down to the next line.
+
+@item @code{C-p} (@code{prev-line})
+@kindex C-p
+@findex prev-line
+Move the cursor up to the previous line.
+
+@item @code{C-a} (@code{beginning-of-line})
+@kindex C-a, in Info windows
+@findex beginning-of-line
+Move the cursor to the start of the current line.
+
+@item @code{C-e} (@code{end-of-line})
+@kindex C-e, in Info windows
+@findex end-of-line
+Moves the cursor to the end of the current line.
+
+@item @code{C-f} (@code{forward-char})
+@kindex C-f, in Info windows
+@findex forward-char
+Move the cursor forward a character.
+
+@item @code{C-b} (@code{backward-char})
+@kindex C-b, in Info windows
+@findex backward-char
+Move the cursor backward a character.
+
+@item @code{M-f} (@code{forward-word})
+@kindex M-f, in Info windows
+@findex forward-word
+Moves the cursor forward a word.
+
+@item @code{M-b} (@code{backward-word})
+@kindex M-b, in Info winows
+@findex backward-word
+Moves the cursor backward a word.
+
+@item @code{M-<} (@code{beginning-of-node})
+@itemx @code{b}
+@kindex b, in Info winows
+@kindex M-<
+@findex beginning-of-node
+Moves the cursor to the start of the current node.
+
+@item @code{M->} (@code{end-of-node})
+@kindex M->
+@findex end-of-node
+Moves the cursor to the end of the current node.
+
+@item @code{M-r} (@code{move-to-window-line})
+@kindex M-r
+@findex move-to-window-line
+Moves the cursor to a specific line of the window. Without a numeric
+argument, @code{M-r} moves the cursor to the start of the line in the
+center of the window. With a numeric argument of @var{n}, @code{M-r}
+moves the cursor to the start of the @var{n}th line in the window.
+@end table
+
+@node Scrolling Commands
+@chapter Moving Text Within a Window
+@cindex scrolling
+
+Sometimes you are looking at a screenful of text, and only part of the
+current paragraph you are reading is visible on the screen. The
+commands detailed in this section are used to shift which part of the
+current node is visible on the screen.
+
+@table @asis
+@item @code{SPC} (@code{scroll-forward})
+@itemx @code{C-v}
+@kindex SPC, in Info windows
+@kindex C-v
+@findex scroll-forward
+Shift the text in this window up. That is, show more of the node which
+is currently below the bottom of the window. With a numeric argument,
+show that many more lines at the bottom of the window; a numeric
+argument of 4 would shift all of the text in the window up 4 lines
+(discarding the top 4 lines), and show you four new lines at the bottom
+of the window. Without a numeric argument, @key{SPC} takes the bottom
+two lines of the window and places them at the top of the window,
+redisplaying almost a completely new screenful of lines.
+
+@item @code{DEL} (@code{scroll-backward})
+@itemx @code{M-v}
+@kindex DEL, in Info windows
+@kindex M-v
+@findex scroll-backward
+Shift the text in this window down. The inverse of
+@code{scroll-forward}.
+
+@end table
+
+@cindex scrolling through node structure
+The @code{scroll-forward} and @code{scroll-backward} commands can also
+move forward and backward through the node structure of the file. If
+you press @key{SPC} while viewing the end of a node, or @key{DEL} while
+viewing the beginning of a node, what happens is controlled by the
+variable @code{scroll-behaviour}. @xref{Variables,
+@code{scroll-behaviour}}, for more information.
+
+@table @asis
+@item @code{C-l} (@code{redraw-display})
+@kindex C-l
+@findex redraw-display
+Redraw the display from scratch, or shift the line containing the cursor
+to a specified location. With no numeric argument, @samp{C-l} clears
+the screen, and then redraws its entire contents. Given a numeric
+argument of @var{n}, the line containing the cursor is shifted so that
+it is on the @var{n}th line of the window.
+
+@item @code{C-x w} (@code{toggle-wrap})
+@kindex C-w
+@findex toggle-wrap
+Toggles the state of line wrapping in the current window. Normally,
+lines which are longer than the screen width @dfn{wrap}, i.e., they are
+continued on the next line. Lines which wrap have a @samp{\} appearing
+in the rightmost column of the screen. You can cause such lines to be
+terminated at the rightmost column by changing the state of line
+wrapping in the window with @code{C-x w}. When a line which needs more
+space than one screen width to display is displayed, a @samp{$} appears
+in the rightmost column of the screen, and the remainder of the line is
+invisible.
+@end table
+
+@node Node Commands
+@chapter Selecting a New Node
+@cindex nodes, selection of
+
+This section details the numerous Info commands which select a new node
+to view in the current window.
+
+The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
+@samp{l}.
+
+When you are viewing a node, the top line of the node contains some Info
+@dfn{pointers} which describe where the next, previous, and up nodes
+are. Info uses this line to move about the node structure of the file
+when you use the following commands:
+
+@table @asis
+@item @code{n} (@code{next-node})
+@kindex n
+@findex next-node
+Selects the `Next' node.
+
+@item @code{p} (@code{prev-node})
+@kindex p
+@findex prev-node
+Selects the `Prev' node.
+
+@item @code{u} (@code{up-node})
+@kindex u
+@findex up-node
+Selects the `Up' node.
+@end table
+
+You can easily select a node that you have already viewed in this window
+by using the @samp{l} command -- this name stands for "last", and
+actually moves through the list of already visited nodes for this
+window. @samp{l} with a negative numeric argument moves forward through
+the history of nodes for this window, so you can quickly step between
+two adjacent (in viewing history) nodes.
+
+@table @asis
+@item @code{l} (@code{history-node})
+@kindex l
+@findex history-node
+Selects the most recently selected node in this window.
+@end table
+
+Two additional commands make it easy to select the most commonly
+selected nodes; they are @samp{t} and @samp{d}.
+
+@table @asis
+@item @code{t} (@code{top-node})
+@kindex t
+@findex top-node
+Selects the node @samp{Top} in the current info file.
+
+@item @code{d} (@code{dir-node})
+@kindex d
+@findex dir-node
+Selects the directory node (i.e., the node @samp{(dir)}).
+@end table
+
+Here are some other commands which immediately result in the selection
+of a different node in the current window:
+
+@table @asis
+@item @code{<} (@code{first-node})
+@kindex <
+@findex first-node
+Selects the first node which appears in this file. This node is most
+often @samp{Top}, but it doesn't have to be.
+
+@item @code{>} (@code{last-node})
+@kindex >
+@findex last-node
+Selects the last node which appears in this file.
+
+@item @code{]} (@code{global-next-node})
+@kindex ]
+@findex global-next-node
+Moves forward or down through node structure. If the node that you are
+currently viewing has a @samp{Next} pointer, that node is selected.
+Otherwise, if this node has a menu, the first menu item is selected. If
+there is no @samp{Next} and no menu, the same process is tried with the
+@samp{Up} node of this node.
+
+@item @code{[} (@code{global-prev-node})
+@kindex [
+@findex global-prev-node
+Moves backward or up through node structure. If the node that you are
+currently viewing has a @samp{Prev} pointer, that node is selected.
+Otherwise, if the node has an @samp{Up} pointer, that node is selected,
+and if it has a menu, the last item in the menu is selected.
+@end table
+
+You can get the same behaviour as @code{global-next-node} and
+@code{global-prev-node} while simply scrolling through the file with
+@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behaviour}}, for
+more information.
+
+@table @asis
+@item @code{g} (@code{goto-node})
+@kindex g
+@findex goto-node
+Reads the name of a node and selects it. No completion is done while
+reading the node name, since the desired node may reside in a separate
+file. The node must be typed exactly as it appears in the info file. A
+file name may be included as with any node specification, for example
+
+@example
+@code{g(emacs)Buffers}
+@end example
+
+finds the node @samp{Buffers} in the info file @file{emacs}.
+
+@item @code{C-x k} (@code{kill-node})
+@kindex C-x k
+@findex kill-node
+Kills a node. The node name is prompted for in the echo area, with a
+default of the current node. @dfn{Killing} a node means that Info tries
+hard to forget about it, removing it from the list of history nodes kept
+for the window where that node is found. Another node is selected in
+the window which contained the killed node.
+
+@item @code{C-x C-f} (@code{view-file})
+@kindex C-x C-f
+@findex view-file
+Reads the name of a file and selects the entire file. The command
+@example
+@code{C-x C-f @var{filename}}
+@end example
+is equivalent to typing
+@example
+@code{g(@var{filename})*}
+@end example
+
+@item @code{C-x C-b} (@code{list-visited-nodes})
+@kindex C-x C-b
+@findex list-visited-nodes
+Makes a window containing a menu of all of the currently visited nodes.
+This window becomes the selected window, and you may use the standard
+Info commands within it.
+
+@item @code{C-x b} (@code{select-visited-node})
+@kindex C-x b
+@findex select-visited-node
+Selects a node which has been previously visited in a visible window.
+This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
+created.
+@end table
+
+@node Searching Commands
+@chapter Searching an Info File
+@cindex searching
+
+GNU Info allows you to search for a sequence of characters throughout an
+entire info file, search through the indices of an info file, or find
+areas within an info file which discuss a particular topic.
+
+@table @asis
+@item @code{s} (@code{search})
+@kindex s
+@findex search
+Reads a string in the echo area and searches for it.
+
+@item @code{C-s} (@code{isearch-forward})
+@kindex C-s
+@findex isearch-forward
+Interactively searches forward through the info file for a string as you
+type it.
+
+@item @code{C-r} (@code{isearch-backward})
+@kindex C-r
+@findex isearch-backward
+Interactively searches backward through the info file for a string as
+you type it.
+
+@item @code{i} (@code{index-search})
+@kindex i
+@findex index-search
+Looks up a string in the indices for this info file, and selects a node
+where the found index entry points to.
+
+@item @code{,} (@code{next-index-match})
+@kindex ,
+@findex next-index-match
+Moves to the node containing the next matching index item from the last
+@samp{i} command.
+@end table
+
+The most basic searching command is @samp{s} (@code{search}). The
+@samp{s} command prompts you for a string in the echo area, and then
+searches the remainder of the info file for an ocurrence of that string.
+If the string is found, the node containing it is selected, and the
+cursor is left positioned at the start of the found string. Subsequent
+@samp{s} commands show you the default search string within @samp{[} and
+@samp{]}; pressing @key{RET} instead of typing a new string will use the
+default search string.
+
+@dfn{Incremental searching} is similar to basic searching, but the
+string is looked up while you are typing it, instead of waiting until
+the entire search string has been specified.
+
+@node Xref Commands
+@chapter Selecting Cross References
+
+We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
+pointers which appear at the top of a node. In addition to these
+pointers, a node may contain other pointers which refer you to a
+different node, perhaps in another info file. Such pointers are called
+@dfn{cross references}, or @dfn{xrefs} for short.
+
+@menu
+* Parts of an Xref:: What a cross reference is made of.
+* Selecting Xrefs:: Commands for selecting menu or note items.
+@end menu
+
+@node Parts of an Xref
+@section Parts of an Xref
+
+Cross references have two major parts: the first part is called the
+@dfn{label}; it is the name that you can use to refer to the cross
+reference, and the second is the @dfn{target}; it is the full name of
+the node that the cross reference points to.
+
+The target is separated from the label by a colon @samp{:}; first the
+label appears, and then the target. For example, in the sample menu
+cross reference below, the single colon separates the label from the
+target.
+
+@example
+* Foo Label: Foo Target. More information about Foo.
+@end example
+
+Note the @samp{.} which ends the name of the target. The @samp{.} is
+not part of the target; it serves only to let Info know where the target
+name ends.
+
+A shorthand way of specifying references allows two adjacent colons to
+stand for a target name which is the same as the label name:
+
+@example
+* Foo Commands:: Commands pertaining to Foo.
+@end example
+
+In the above example, the name of the target is the same as the name of
+the label, in this case @code{Foo Commands}.
+
+You will normally see two types of cross references while viewing nodes:
+@dfn{menu} references, and @dfn{note} references. Menu references
+appear within a node's menu; they begin with a @samp{*} at the beginning
+of a line, and continue with a label, a target, and a comment which
+describes what the contents of the node pointed to contains.
+
+Note references appear within the body of the node text; they begin with
+@code{*Note}, and continue with a label and a target.
+
+Like @samp{Next}, @samp{Prev} and @samp{Up} pointers, cross references
+can point to any valid node. They are used to refer you to a place
+where more detailed information can be found on a particular subject.
+Here is a cross reference which points to a node within the Texinfo
+documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo
+Manual}, for more information on creating your own texinfo cross
+references.
+
+@node Selecting Xrefs
+@section Selecting Xrefs
+
+The following table lists the Info commands which operate on menu items.
+
+@table @asis
+@item @code{1} (@code{menu-digit})
+@itemx @code{2} @dots{} @code{9}
+@cindex 1 @dots{} 9, in Info windows
+@kindex 1 @dots{} 9, in Info windows
+@findex menu-digit
+Within an Info window, pressing a single digit, (such as @samp{1}),
+selects that menu item, and places its node in the current window.
+For convenience, there is one exception; pressing @samp{0} selects the
+@emph{last} item in the node's menu.
+
+@item @code{0} (@code{last-menu-item})
+@kindex 0, in Info windows
+@findex last-menu-item
+Select the last item in the current node's menu.
+
+@item @code{m} (@code{menu-item})
+@kindex m
+@findex menu-item
+Reads the name of a menu item in the echo area and selects its node.
+Completion is available while reading the menu label.
+
+@item @code{M-x find-menu}
+@findex find-menu
+Moves the cursor to the start of this node's menu.
+@end table
+
+This table lists the Info commands which operate on note cross references.
+
+@table @asis
+@item @code{f} (@code{xref-item})
+@itemx @code{r}
+@kindex f
+@kindex r
+@findex xref-item
+Reads the name of a note cross reference in the echo area and selects
+its node. Completion is available while reading the cross reference
+label.
+@end table
+
+Finally, the next few commands operate on menu or note references alike:
+
+@table @asis
+@item @code{TAB} (@code{move-to-next-xref})
+@kindex TAB, in Info windows
+@findex move-to-next-xref
+Moves the cursor to the start of the next nearest menu item or note
+reference in this node. You can then use @key{RET}
+(@code{select-reference-this-line} to select the menu or note reference.
+
+@item @code{M-TAB} (@code{move-to-prev-xref})
+@kindex M-TAB, in Info windows
+@findex move-to-prev-xref
+Moves the cursor the start of the nearest previous menu item or note
+reference in this node.
+
+@item @code{RET} (@code{select-reference-this-line})
+@kindex RET, in Info windows
+@findex select-reference-this-line
+Selects the menu item or note reference appearing on this line.
+@end table
+
+@node Window Commands
+@chapter Manipulating Multiple Windows
+@cindex windows, manipulating
+
+A @dfn{window} is a place to show the text of a node. Windows have a
+view area where the text of the node is displayed, and an associated
+@dfn{mode line}, which briefly describes the node being viewed.
+
+GNU Info supports multiple windows appearing in a single screen; each
+window is separated from the next by its modeline. At any time, there
+is only one @dfn{active} window, that is, the window in which the cursor
+appears. There are commands available for creating windows, changing
+the size of windows, selecting which window is active, and for deleting
+windows.
+
+@menu
+* The Mode Line:: What appears in the mode line?
+* Basic Windows:: Manipulating windows in Info.
+* The Echo Area:: Used for displaying errors and reading input.
+@end menu
+
+@node The Mode Line
+@section The Mode Line
+
+A @dfn{mode line} is a line of inverse video which appears at the bottom
+of an info window. It describes the contents of the window just above
+it; this information includes the name of the file and node appearing in
+that window, the number of screen lines it takes to display the node,
+and the percentage of text that is above the top of the window. It can
+also tell you if the indirect tags table for this info file needs to be
+updated, and whether or not the info file was compressed when stored on
+disk.
+
+Here is a sample mode line for a window containing an uncompressed file
+named @file{dir}, showing the node @samp{Top}.
+
+@example
+-----Info: (dir)Top, 40 lines --Top---------------------------------------
+ ^^ ^ ^^^ ^^
+ (file)Node #lines where
+@end example
+
+When a node comes from a file which is compressed on disk, this is
+indicated in the mode line with two small @samp{z}'s. In addition, if
+the info file containing the node has been split into subfiles, the name
+of the subfile containing the node appears in the modeline as well:
+
+@example
+--zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
+@end example
+
+When Info makes a node internally, such that there is no corresponding
+info file on disk, the name of the node is surrounded by asterisks
+(@samp{*}). The name itself tells you what the contents of the window
+are; the sample mode line below shows an internally constructed node
+showing possible completions:
+
+@example
+-----Info: *Completions*, 7 lines --All-----------------------------------
+@end example
+
+@node Basic Windows
+@section Window Commands
+
+It can be convenient to view more than one node at a time. To allow
+this, Info can display more than one @dfn{window}. Each window has its
+own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
+window (@pxref{Node Commands, , @code{history-node}}).
+
+@table @asis
+@item @code{C-x o} (@code{next-window})
+@cindex windows, selecting
+@kindex C-x o
+@findex next-window
+Selects the next window on the screen. Note that the echo area can only be
+selected if it is already in use, and you have left it temporarily.
+Normally, @samp{C-x o} simply moves the cursor into the next window on
+the screen, or if you are already within the last window, into the first
+window on the screen. Given a numeric argument, @samp{C-x o} moves over
+that many windows. A negative argument causes @samp{C-x o} to select
+the previous window on the screen.
+
+@item @code{M-x prev-window}
+@findex prev-window
+Selects the previous window on the screen. This is identical to
+@samp{C-x o} with a negative argument.
+
+@item @code{C-x 2} (@code{split-window})
+@cindex windows, creating
+@kindex C-x 2
+@findex split-window
+Splits the current window into two windows, both showing the same node.
+Each window is one half the size of the original window, and the cursor
+remains in the original window. The variable @code{automatic-tiling}
+can cause all of the windows on the screen to be resized for you
+automatically, please @pxref{Variables, , automatic-tiling} for more
+information.
+
+@item @code{C-x 0} (@code{delete-window})
+@cindex windows, deleting
+@kindex C-x 0
+@findex delete-window
+Deletes the current window from the screen. If you have made too many
+windows and your screen appears cluttered, this is the way to get rid of
+some of them.
+
+@item @code{C-x 1} (@code{keep-one-window})
+@kindex C-x 1
+@findex keep-one-window
+Deletes all of the windows excepting the current one.
+
+@item @code{ESC C-v} (@code{scroll-other-window})
+@kindex ESC C-v, in Info windows
+@findex scroll-other-window
+Scrolls the other window, in the same fashion that @samp{C-v} might
+scroll the current window. Given a negative argument, the "other"
+window is scrolled backward.
+
+@item @code{C-x ^} (@code{grow-window})
+@kindex C-x ^
+@findex grow-window
+Grows (or shrinks) the current window. Given a numeric argument, grows
+the current window that many lines; with a negative numeric argument,
+the window is shrunk instead.
+
+@item @code{C-x t} (@code{tile-windows})
+@cindex tiling
+@kindex C-x t
+@findex tile-windows
+Divides the available screen space among all of the visible windows.
+Each window is given an equal portion of the screen in which to display
+its contents. The variable @code{automatic-tiling} can cause
+@code{tile-windows} to be called when a window is created or deleted.
+@xref{Variables, , @code{automatic-tiling}}.
+@end table
+
+@node The Echo Area
+@section The Echo Area
+@cindex echo area
+
+The @dfn{echo area} is a one line window which appears at the bottom of
+the screen. It is used to display informative or error messages, and to
+read lines of input from you when that is necessary. Almost all of the
+commands available in the echo area are identical to their Emacs
+counterparts, so please refer to that documentation for greater depth of
+discussion on the concepts of editing a line of text. The following
+table briefly lists the commands that are available while input is being
+read in the echo area:
+
+@table @asis
+@item @code{C-f} (@code{echo-area-forward})
+@kindex C-f, in the echo area
+@findex echo-area-forward
+Moves forward a character.
+
+@item @code{C-b} (@code{echo-area-backward})
+@kindex C-b, in the echo area
+@findex echo-area-backward
+Moves backward a character.
+
+@item @code{C-a} (@code{echo-area-beg-of-line})
+@kindex C-a, in the echo area
+@findex echo-area-beg-of-line
+Moves to the start of the input line.
+
+@item @code{C-e} (@code{echo-area-end-of-line})
+@kindex C-e, in the echo area
+@findex echo-area-end-of-line
+Moves to the end of the input line.
+
+@item @code{M-f} (@code{echo-area-forward-word})
+@kindex M-f, in the echo area
+@findex echo-area-forward-word
+Moves forward a word.
+
+@item @code{M-b} (@code{echo-area-backward-word})
+@kindex M-b, in the echo area
+@findex echo-area-backward-word
+Moves backward a word.
+
+@item @code{C-d} (@code{echo-area-delete})
+@kindex C-d, in the echo area
+@findex echo-area-delete
+Deletes the character under the cursor.
+
+@item @code{DEL} (@code{echo-area-rubout})
+@kindex DEL, in the echo area
+@findex echo-area-rubout
+Deletes the character behind the cursor.
+
+@item @code{C-g} (@code{echo-area-abort})
+@kindex C-g, in the echo area
+@findex echo-area-abort
+Cancels or quits the current operation. If completion is being read,
+@samp{C-g} discards the text of the input line which does not match any
+completion. If the input line is empty, @samp{C-g} aborts the calling
+function.
+
+@item @code{RET} (@code{echo-area-newline})
+@kindex RET, in the echo area
+@findex echo-area-newline
+Accepts (or forces completion of) the current input line.
+
+@item @code{C-q} (@code{echo-area-quoted-insert})
+@kindex C-q, in the echo area
+@findex echo-area-quoted-insert
+Inserts the next character verbatim. This is how you can insert control
+characters into a search string, for example.
+
+@item @var{printing character} (@code{echo-area-insert})
+@kindex printing characters, in the echo area
+@findex echo-area-insert
+Inserts the character.
+
+@item @code{M-TAB} (@code{echo-area-tab-insert})
+@kindex M-TAB, in the echo area
+@findex echo-area-tab-insert
+Inserts a TAB character.
+
+@item @code{C-t} (@code{echo-area-transpose-chars})
+@kindex C-t, in the echo area
+@findex echo-area-transpose-chars
+Transposes the characters at the cursor.
+@end table
+
+The next group of commands deal with @dfn{killing}, and @dfn{yanking}
+text. For an in depth discussion of killing and yanking,
+@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
+
+@table @asis
+@item @code{M-d} (@code{echo-area-kill-word})
+@kindex M-d, in the echo area
+@findex echo-area-kill-word
+Kills the word following the cursor.
+
+@item @code{M-DEL} (@code{echo-area-backward-kill-word})
+@kindex M-DEL, in the echo area
+@findex echo-area-backward-kill-word
+Kills the word preceding the cursor.
+
+@item @code{C-k} (@code{echo-area-kill-line})
+@kindex C-k, in the echo area
+@findex echo-area-kill-line
+Kills the text from the cursor to the end of the line.
+
+@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
+@kindex C-x DEL, in the echo area
+@findex echo-area-backward-kill-line
+Kills the text from the cursor to the beginning of the line.
+
+@item @code{C-y} (@code{echo-area-yank})
+@kindex C-y, in the echo area
+@findex echo-area-yank
+Yanks back the contents of the last kill.
+
+@item @code{M-y} (@code{echo-area-yank-pop})
+@kindex M-y, in the echo area
+@findex echo-area-yank-pop
+Yanks back a previous kill, removing the last yanked text first.
+@end table
+
+Sometimes when reading input in the echo area, the command that needed
+input will only accept one of a list of several choices. The choices
+represent the @dfn{possible completions}, and you must respond with one
+of them. Since there are a limited number of responses you can make,
+Info allows you to abbreviate what you type, only typing as much of the
+response as is necessary to uniquely identify it. In addition, you can
+request Info to fill in as much of the response as is possible; this
+is called @dfn{completion}.
+
+The following commands are available when completing in the echo area:
+
+@table @asis
+@item @code{TAB} (@code{echo-area-complete})
+@itemx @code{SPC}
+@kindex TAB, in the echo area
+@kindex SPC, in the echo area
+@findex echo-area-complete
+Inserts as much of a completion as is possible.
+
+@item @code{?} (@code{echo-area-possible-completions})
+@kindex ?, in the echo area
+@findex echo-area-possible-completions
+Displays a window containing a list of the possible completions of what
+you have typed so far. For example, if the available choices are:
+@example
+bar
+foliate
+food
+forget
+@end example
+and you have typed an @samp{f}, followed by @samp{?}, the possible
+completions would contain:
+@example
+foliate
+food
+forget
+@end example
+i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC}
+or @key{TAB} would result in @samp{fo} appearing in the echo area, since
+all of the choices which begin with @samp{f} continue with @samp{o}.
+Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
+appearing in the echo area, since that is the only choice which begins
+with @samp{fol}.
+
+@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
+@kindex ESC C-v, in the echo area
+@findex echo-area-scroll-completions-window
+Scrolls the completions window, if that is visible, or the "other"
+window if not.
+@end table
+
+@node Printing Nodes
+@chapter Printing Out Nodes
+@cindex printing
+
+You may wish to print out the contents of a node as a quick reference
+document for later use. Info provides you with a command for doing
+this. In general, we recommend that you use @TeX{} to format the
+document and print sections of it, by running @code{tex} on the texinfo
+source file.
+
+@table @asis
+@item @code{M-x print-node}
+@findex print-node
+@cindex INFO_PRINT_COMMAND, environment variable
+Pipes the contents of the current node through the command in the
+environment variable @code{INFO_PRINT_COMMAND}. If the variable doesn't
+exist, the node is simply piped to @code{lpr}.
+@end table
+
+@node Miscellaneous Commands
+@chapter Miscellaneous Commands
+
+GNU Info contains several commands which self-document GNU Info:
+
+@table @asis
+@item @code{M-x describe-command}
+@cindex functions, describing
+@cindex commands, describing
+@findex describe-command
+Reads the name of an Info command in the echo area and then displays a
+brief description of what that command does.
+
+@item @code{M-x describe-key}
+@cindex keys, describing
+@findex describe-key
+Reads a key sequence in the echo area, and then displays the name and
+documentation of the Info command that the key sequence invokes.
+
+@item @code{M-x describe-variable}
+Reads the name of a variable in the echo area and then displays a brief
+description of what the variable affects.
+
+@item @code{M-x where-is}
+@findex where-is
+Reads the name of an Info command in the echo area, and then displays
+a key sequence which can be typed in order to invoke that command.
+
+@item @code{C-h} (@code{get-help-window})
+@itemx @code{?}
+@kindex C-h
+@kindex ?, in Info windows
+@findex get-help-window
+Creates (or moves into) the window displaying @code{*Help*}, and places
+a node containing a quick reference card into it. This window displays
+the most concise information about GNU Info available.
+
+@item @code{h} (@code{get-info-help-node})
+@kindex h
+@findex get-info-help-node
+Tries hard to visit the node @code{(info)Help}. The info file
+@file{info.texi} distributed with GNU Info contains this node. Of
+course, the file must first be processed with @code{makeinfo}, and then
+placed into the location of your info directory.
+@end table
+
+Here are the commands for creating a numeric argument:
+
+@table @asis
+@item @code{C-u} (@code{universal-argument})
+@cindex numeric arguments
+@kindex C-u
+@findex universal-argument
+Starts (or multiplies by 4) the current numeric argument. @samp{C-u} is
+a good way to give a small numeric argument to cursor movement or
+scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
+@samp{C-u C-u C-n} moves the cursor down 16 lines.
+
+@item @code{M-1} (@code{add-digit-to-numeric-arg})
+@itemx @code{M-2} @dots{} @code{M-9}
+@kindex M-1 @dots{} M-9
+@findex add-digit-to-numeric-arg
+Adds the digit value of the invoking key to the current numeric
+argument. Once Info is reading a numeric argument, you may just type
+the digits of the argument, without the Meta prefix. For example, you
+might give @samp{C-l} a numeric argument of 32 by typing:
+
+@example
+@kbd{C-u 3 2 C-l}
+@end example
+or
+@example
+@kbd{M-3 2 C-l}
+@end example
+@end table
+
+@samp{C-g} is used to abort the reading of a multi-character key
+sequence, to cancel lengthy operations (such as multi-file searches) and
+to cancel reading input in the echo area.
+
+@table @asis
+@item @code{C-g} (@code{abort-key})
+@cindex cancelling typeahead
+@cindex cancelling the current operation
+@kindex C-g, in Info windows
+@findex abort-key
+Cancels current operation.
+@end table
+
+The @samp{q} command of Info simply quits running Info.
+
+@table @asis
+@item @code{q} (@code{quit})
+@cindex quitting
+@kindex q
+@findex quit
+Exits GNU Info.
+@end table
+
+If the operating system tells GNU Info that the screen is 60 lines tall,
+and it is actually only 40 lines tall, here is a way to tell Info that
+the operating system is correct.
+
+@table @asis
+@item @code{M-x set-screen-height}
+@findex set-screen-height
+@cindex screen, changing the height of
+Reads a height value in the echo area and sets the height of the
+displayed screen to that value.
+@end table
+
+Finally, Info provides a convenient way to display footnotes which might
+be associated with the current node that you are viewing:
+
+@table @asis
+@item @code{ESC C-f} (@code{show-footnotes})
+@kindex ESC C-f
+@findex show-footnotes
+@cindex footnotes, displaying
+Shows the footnotes (if any) associated with the current node in another
+window. You can have Info automatically display the footnotes
+associated with a node when the node is selected by setting the variable
+@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}.
+@end table
+
+@node Variables
+@chapter Manipulating Variables
+
+GNU Info contains several @dfn{variables} whose values are looked at by various
+Info commands. You can change the values of these variables, and thus
+change the behaviour of Info to more closely match your environment and
+info file reading manner.
+
+@table @asis
+@item @code{M-x set-variable}
+@cindex variables, setting
+@findex set-variable
+Reads the name of a variable, and the value for it, in the echo area and
+then sets the variable to that value. Completion is available when
+reading the variable name; often, completion is available when reading
+the value to give to the variable, but that depends on the variable
+itself. If a variable does @emph{not} supply multiple choices to
+complete over, it expects a numeric value.
+
+@item @code{M-x describe-variable}
+@cindex variables, describing
+@findex describe-variable
+Reads the name of a variable in the echo area and then displays a brief
+description of what the variable affects.
+@end table
+
+Here is a list of the variables that you can set in Info.
+
+@table @code
+@item automatic-footnotes
+@vindex automatic-footnotes
+When set to @code{On}, footnotes appear and disappear automatically.
+This variable is @code{On} by default. When a node is selected, a
+window containing the footnotes which appear in that node is created,
+and the footnotes are displayed within the new window. The window that
+Info creates to contain the footnotes is called @samp{*Footnotes*}. If
+a node is selected which contains no footnotes, and a @samp{*Footnotes*}
+window is on the screen, the @samp{*Footnotes*} window is deleted.
+Footnote windows created in this fashion are not automatically tiled so
+that they can use as little of the display as is possible.
+
+@item automatic-tiling
+@vindex automatic-tiling
+When set to @code{On}, creating or deleting a window resizes other
+windows. This variable is @code{Off} by default. Normally, typing
+@samp{C-x 2} divides the current window into two equal parts. When
+@code{automatic-tiling} is set to @code{On}, all of the windows are
+resized automatically, keeping an equal number of lines visible in each
+window. There are exceptions to the automatic tiling; specifically, the
+windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
+resized through automatic tiling; they remain their original size.
+
+@item visible-bell
+@vindex visible-bell
+When set to @code{On}, GNU Info attempts to flash the screen instead of
+ringing the bell. This variable is @code{Off} by default. Of course,
+Info can only flash the screen if the terminal allows it; in the case
+that the terminal does not allow it, the setting of this variable has no
+effect. However, you can make Info perform quietly by setting the
+@code{errors-ring-bell} variable to @code{Off}.
+
+@item errors-ring-bell
+@vindex errors-ring-bell
+When set to @code{On}, errors cause the bell to ring. The default
+setting of this variable is @code{On}.
+
+@item gc-compressed-files
+@vindex gc-compressed-files
+When set to @code{On}, Info garbage collects files which had to be
+uncompressed. The default value of this variable is @code{Off}.
+Whenever a node is visited in Info, the info file containing that node
+is read into core, and Info reads information about the tags and nodes
+contained in that file. Once the tags information is read by Info, it
+is never forgotten. However, the actual text of the nodes does not need
+to remain in core unless a particular info window needs it. For
+non-compressed files, the text of the nodes does not remain in core when
+it is no longer in use. But de-compressing a file can be a time
+consuming operation, and so Info tries hard not to do it twice.
+@code{gc-compressed-files} tells Info it is okay to garbage collect the
+text of the nodes of a file which was compressed on disk.
+
+@item show-index-match
+@vindex show-index-match
+When set to @code{On}, the portion of the matched search string is
+highlighted in the message which explains where the matched search
+string was found. The default value of this variable is @code{On}.
+When Info displays the location where an index match was found,
+(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
+string that you had typed is highlighted by displaying it in the inverse
+case from its surrounding characters.
+
+@item scroll-behaviour
+@vindex scroll-behaviour
+Controls what happens when forward scrolling is requested at the end of
+a node, or when backward scrolling is requested at the beginning of a
+node. The default value for this variable is @code{Continuous}. There
+are three possible values for this variable:
+
+@table @code
+@item Continuous
+Tries to get the first item in this node's menu, or failing that, the
+@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}.
+This behaviour is identical to using the @samp{]}
+(@code{global-next-node}) and @samp{[} (@code{global-prev-node})
+commands.
+
+@item Next Only
+Only tries to get the @samp{Next} node.
+
+@item Page Only
+Simply gives up, changing nothing. If @code{scroll-behaviour} is
+@code{Page Only}, no scrolling command can change the node that is being
+viewed.
+@end table
+
+@item scroll-step
+@vindex scroll-step
+The number of lines to scroll when the cursor moves out of the window.
+Scrolling happens automatically if the cursor has moved out of the
+visible portion of the node text when it is time to display. Usually
+the scrolling is done so as to put the cursor on the center line of the
+current window. However, if the variable @code{scroll-step} has a
+nonzero value, Info attempts to scroll the node text by that many lines;
+if that is enough to bring the cursor back into the window, that is what
+is done. The default value of this variable is 0, thus placing the
+cursor (and the text it is attached to) in the center of the window.
+Setting this variable to 1 causes a kind of "smooth scrolling" which
+some people prefer.
+
+@item ISO-Latin
+@cindex ISO Latin characters
+@vindex ISO-Latin
+When set to @code{On}, Info accepts and displays ISO Latin characters.
+By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
+Info that it is running in an environment where the European standard
+character set is in use, and allows you to input such characters to
+Info, as well as display them.
+@end table
+
+@c The following node and its children are currently unfinished. Please feel
+@c free to finish it!
+
+@ifset NOTSET
+@node Info for Sys Admins
+@chapter Info for System Administrators
+
+This text describes some common ways of setting up an Info heierarchy
+from scratch, and details the various options that are available when
+installing Info. This text is designed for the person who is installing
+GNU Info on the system; although users may find the information present
+in this section interesting, none of it is vital to understanding how to
+use GNU Info.
+
+@menu
+* Setting the INFOPATH:: Where are my Info files kept?
+* Editing the DIR node:: What goes in `DIR', and why?
+* Storing Info files:: Alternate formats allow flexibilty in setups.
+* Using `localdir':: Building DIR on the fly.
+* Example setups:: Some common ways to origanize Info files.
+@end menu
+
+@node Setting the INFOPATH
+@section Setting the INFOPATH
+Where are my Info files kept?
+
+@node Editing the DIR node
+@section Editing the DIR node
+What goes in `DIR', and why?
+
+@node Storing Info files
+@section Storing Info files
+Alternate formats allow flexibilty in setups.
+
+@node Using `localdir'
+@section Using `localdir'
+Building DIR on the fly.
+
+@node Example setups
+@section Example setups
+Some common ways to origanize Info files.
+@end ifset
+
+@ifset STANDALONE
+@node GNU Info Global Index
+@appendix Global Index
+@printindex cp
+@end ifset
diff --git a/contrib/texinfo/info/variables.c b/contrib/texinfo/info/variables.c
index 248c8af6488b..7798701c124e 100644
--- a/contrib/texinfo/info/variables.c
+++ b/contrib/texinfo/info/variables.c
@@ -1,10 +1,9 @@
-/* variables.c -- How to manipulate user visible variables in Info.
- $Id: variables.c,v 1.5 1997/07/18 14:34:23 karl Exp $
+/* variables.c -- How to manipulate user visible variables in Info. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,9 +25,9 @@
#include "variables.h"
/* **************************************************************** */
-/* */
-/* User Visible Variables in Info */
-/* */
+/* */
+/* User Visible Variables in Info */
+/* */
/* **************************************************************** */
/* Choices used by the completer when reading a zero/non-zero value for
@@ -37,75 +36,73 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL };
VARIABLE_ALIST info_variables[] = {
{ "automatic-footnotes",
- N_("When \"On\", footnotes appear and disappear automatically"),
+ "When \"On\", footnotes appear and disappear automatically",
&auto_footnotes_p, (char **)on_off_choices },
{ "automatic-tiling",
- N_("When \"On\", creating or deleting a window resizes other windows"),
+ "When \"On\", creating or deleting a window resizes other windows",
&auto_tiling_p, (char **)on_off_choices },
{ "visible-bell",
- N_("When \"On\", flash the screen instead of ringing the bell"),
+ "When \"On\", flash the screen instead of ringing the bell",
&terminal_use_visible_bell_p, (char **)on_off_choices },
{ "errors-ring-bell",
- N_("When \"On\", errors cause the bell to ring"),
+ "When \"On\", errors cause the bell to ring",
&info_error_rings_bell_p, (char **)on_off_choices },
{ "gc-compressed-files",
- N_("When \"On\", Info garbage collects files which had to be uncompressed"),
+ "When \"On\", Info garbage collects files which had to be uncompressed",
&gc_compressed_files, (char **)on_off_choices },
{ "show-index-match",
- N_("When \"On\", the portion of the matched search string is highlighted"),
+ "When \"On\", the portion of the matched search string is highlighted",
&show_index_match, (char **)on_off_choices },
{ "scroll-behaviour",
- N_("Controls what happens when scrolling is requested at the end of a node"),
+ "Controls what happens when scrolling is requested at the end of a node",
&info_scroll_behaviour, (char **)info_scroll_choices },
{ "scroll-step",
- N_("The number lines to scroll when the cursor moves out of the window"),
+ "The number lines to scroll when the cursor moves out of the window",
&window_scroll_step, (char **)NULL },
{ "ISO-Latin",
- N_("When \"On\", Info accepts and displays ISO Latin characters"),
+ "When \"On\", Info accepts and displays ISO Latin characters",
&ISO_Latin_p, (char **)on_off_choices },
{ (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL }
};
-DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable"))
+DECLARE_INFO_COMMAND (describe_variable, "Explain the use of a variable")
{
VARIABLE_ALIST *var;
char *description;
/* Get the variable's name. */
- var = read_variable_name (_("Describe variable: "), window);
+ var = read_variable_name ("Describe variable: ", window);
if (!var)
return;
- description = (char *)xmalloc (20 + strlen (var->name)
- + strlen (_(var->doc)));
+ description = (char *)xmalloc (20 + strlen (var->name) + strlen (var->doc));
if (var->choices)
sprintf (description, "%s (%s): %s.",
- var->name, var->choices[*(var->value)], _(var->doc));
+ var->name, var->choices[*(var->value)], var->doc);
else
- sprintf (description, "%s (%d): %s.",
- var->name, *(var->value), _(var->doc));
+ sprintf (description, "%s (%d): %s.", var->name, *(var->value), var->doc);
window_message_in_echo_area ("%s", description);
free (description);
}
-DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable"))
+DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
{
VARIABLE_ALIST *var;
char *line;
/* Get the variable's name and value. */
- var = read_variable_name (_("Set variable: "), window);
+ var = read_variable_name ("Set variable: ", window);
if (!var)
return;
@@ -116,86 +113,86 @@ DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable"))
if (!var->choices)
{
- int potential_value;
+ int potential_value;
- if (info_explicit_arg || count != 1)
- potential_value = count;
- else
- potential_value = *(var->value);
+ if (info_explicit_arg || count != 1)
+ potential_value = count;
+ else
+ potential_value = *(var->value);
- sprintf (prompt, _("Set %s to value (%d): "),
- var->name, potential_value);
- line = info_read_in_echo_area (active_window, prompt);
+ sprintf (prompt, "Set %s to value (%d): ",
+ var->name, potential_value);
+ line = info_read_in_echo_area (active_window, prompt);
- /* If no error was printed, clear the echo area. */
- if (!info_error_was_printed)
- window_clear_echo_area ();
+ /* If no error was printed, clear the echo area. */
+ if (!info_error_was_printed)
+ window_clear_echo_area ();
- /* User aborted? */
- if (!line)
- return;
+ /* User aborted? */
+ if (!line)
+ return;
- /* If the user specified a value, get that, otherwise, we are done. */
- canonicalize_whitespace (line);
- if (*line)
- *(var->value) = atoi (line);
- else
- *(var->value) = potential_value;
+ /* If the user specified a value, get that, otherwise, we are done. */
+ canonicalize_whitespace (line);
+ if (*line)
+ *(var->value) = atoi (line);
+ else
+ *(var->value) = potential_value;
- free (line);
+ free (line);
}
else
{
- register int i;
- REFERENCE **array = (REFERENCE **)NULL;
- int array_index = 0;
- int array_slots = 0;
-
- for (i = 0; var->choices[i]; i++)
- {
- REFERENCE *entry;
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = xstrdup (var->choices[i]);
- entry->nodename = (char *)NULL;
- entry->filename = (char *)NULL;
-
- add_pointer_to_array
- (entry, array_index, array, array_slots, 10, REFERENCE *);
- }
-
- sprintf (prompt, _("Set %s to value (%s): "),
- var->name, var->choices[*(var->value)]);
-
- /* Ask the completer to read a variable value for us. */
- line = info_read_completing_in_echo_area (window, prompt, array);
-
- info_free_references (array);
-
- if (!echo_area_is_active)
- window_clear_echo_area ();
-
- /* User aborted? */
- if (!line)
- {
- info_abort_key (active_window, 0, 0);
- return;
- }
-
- /* User accepted default choice? If so, no change. */
- if (!*line)
- {
- free (line);
- return;
- }
-
- /* Find the choice in our list of choices. */
- for (i = 0; var->choices[i]; i++)
- if (strcmp (var->choices[i], line) == 0)
- break;
-
- if (var->choices[i])
- *(var->value) = i;
+ register int i;
+ REFERENCE **array = (REFERENCE **)NULL;
+ int array_index = 0;
+ int array_slots = 0;
+
+ for (i = 0; var->choices[i]; i++)
+ {
+ REFERENCE *entry;
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = strdup (var->choices[i]);
+ entry->nodename = (char *)NULL;
+ entry->filename = (char *)NULL;
+
+ add_pointer_to_array
+ (entry, array_index, array, array_slots, 10, REFERENCE *);
+ }
+
+ sprintf (prompt, "Set %s to value (%s): ",
+ var->name, var->choices[*(var->value)]);
+
+ /* Ask the completer to read a variable value for us. */
+ line = info_read_completing_in_echo_area (window, prompt, array);
+
+ info_free_references (array);
+
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+
+ /* User aborted? */
+ if (!line)
+ {
+ info_abort_key (active_window, 0, 0);
+ return;
+ }
+
+ /* User accepted default choice? If so, no change. */
+ if (!*line)
+ {
+ free (line);
+ return;
+ }
+
+ /* Find the choice in our list of choices. */
+ for (i = 0; var->choices[i]; i++)
+ if (strcmp (var->choices[i], line) == 0)
+ break;
+
+ if (var->choices[i])
+ *(var->value) = i;
}
}
}
@@ -262,13 +259,13 @@ make_variable_completions_array ()
{
REFERENCE *entry;
- entry = (REFERENCE *) xmalloc (sizeof (REFERENCE));
- entry->label = xstrdup (info_variables[i].name);
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = strdup (info_variables[i].name);
entry->nodename = (char *)NULL;
entry->filename = (char *)NULL;
add_pointer_to_array
- (entry, array_index, array, array_slots, 200, REFERENCE *);
+ (entry, array_index, array, array_slots, 200, REFERENCE *);
}
return (array);
diff --git a/contrib/texinfo/info/variables.h b/contrib/texinfo/info/variables.h
index 1afcfb8d72dd..85bde27737b9 100644
--- a/contrib/texinfo/info/variables.h
+++ b/contrib/texinfo/info/variables.h
@@ -1,10 +1,9 @@
-/* variables.h -- Description of user visible variables in Info.
- $Id: variables.h,v 1.3 1997/07/15 18:44:23 karl Exp $
+/* variables.h -- Description of user visible variables in Info. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_VARIABLES_H
-#define INFO_VARIABLES_H
+#if !defined (_VARIABLES_H_)
+#define _VARIABLES_H_
/* A variable (in the Info sense) is an integer value with a user-visible
name. You may supply an array of strings to complete over when the
@@ -33,10 +32,10 @@
/* Structure describing a user visible variable. */
typedef struct {
- char *name; /* Polite name. */
- char *doc; /* Documentation string. */
- int *value; /* Address of value. */
- char **choices; /* Array of strings or NULL if numeric only. */
+ char *name; /* Polite name. */
+ char *doc; /* Documentation string. */
+ int *value; /* Address of value. */
+ char **choices; /* Array of strings or NULL if numeric only. */
} VARIABLE_ALIST;
/* Read the name of an Info variable in the echo area and return the
@@ -62,4 +61,4 @@ extern int info_scroll_behaviour;
extern int window_scroll_step;
extern int ISO_Latin_p;
-#endif /* not INFO_VARIABLES_H */
+#endif /* _VARIABLES_H_ */
diff --git a/contrib/texinfo/info/window.c b/contrib/texinfo/info/window.c
index dbe706ed5147..304e89c0c75a 100644
--- a/contrib/texinfo/info/window.c
+++ b/contrib/texinfo/info/window.c
@@ -1,10 +1,9 @@
-/* window.c -- Windows in Info.
- $Id: window.c,v 1.5 1998/02/23 22:43:38 karl Exp $
+/* window.c -- Windows in Info. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "info.h"
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include "nodes.h"
#include "window.h"
#include "display.h"
@@ -134,36 +136,36 @@ window_new_screen_size (width, height)
while ((height - echo_area_required) / numwins <= WINDOW_MIN_SIZE)
{
/* If only one window, make the size of it be zero, and return
- immediately. */
+ immediately. */
if (!windows->next)
- {
- windows->height = 0;
- maybe_free (windows->line_starts);
- windows->line_starts = (char **)NULL;
- windows->line_count = 0;
- break;
- }
+ {
+ windows->height = 0;
+ maybe_free (windows->line_starts);
+ windows->line_starts = (char **)NULL;
+ windows->line_count = 0;
+ break;
+ }
/* If we have some temporary windows, delete one of them. */
for (win = windows; win; win = win->next)
- if (win->flags & W_TempWindow)
- break;
+ if (win->flags & W_TempWindow)
+ break;
/* Otherwise, delete the first window, and try again. */
if (!win)
- win = windows;
+ win = windows;
if (window_deletion_notifier)
- (*window_deletion_notifier) (win);
+ (*window_deletion_notifier) (win);
window_delete_window (win);
numwins--;
}
/* The screen has changed height and width. */
- delta_height = height - the_screen->height; /* This is how much. */
- the_screen->height = height; /* This is the new height. */
- the_screen->width = width; /* This is the new width. */
+ delta_height = height - the_screen->height; /* This is how much. */
+ the_screen->height = height; /* This is the new height. */
+ the_screen->width = width; /* This is the new width. */
/* Set the start of the echo area. */
the_echo_area->first_row = height - the_echo_area->height;
@@ -184,34 +186,34 @@ window_new_screen_size (width, height)
for (win = windows; win; win = win->next)
{
if ((win->width != width) && ((win->flags & W_InhibitMode) == 0))
- {
- win->width = width;
- maybe_free (win->modeline);
- win->modeline = (char *)xmalloc (1 + width);
- }
+ {
+ win->width = width;
+ maybe_free (win->modeline);
+ win->modeline = (char *)xmalloc (1 + width);
+ }
win->height += delta_each;
/* If the previous height of this window was zero, it was the only
- window, and it was not visible. Thus we need to compensate for
- the echo_area. */
+ window, and it was not visible. Thus we need to compensate for
+ the echo_area. */
if (win->height == delta_each)
- win->height -= (1 + the_echo_area->height);
+ win->height -= (1 + the_echo_area->height);
/* If this is not the first window in the chain, then change the
- first row of it. We cannot just add delta_each to the first row,
- since this window's first row is the sum of the collective increases
- that have gone before it. So we just add one to the location of the
- previous window's modeline. */
+ first row of it. We cannot just add delta_each to the first row,
+ since this window's first row is the sum of the collective increases
+ that have gone before it. So we just add one to the location of the
+ previous window's modeline. */
if (win->prev)
- win->first_row = (win->prev->first_row + win->prev->height) + 1;
+ win->first_row = (win->prev->first_row + win->prev->height) + 1;
/* The last window in the chain gets the extra space (or shrinkage). */
if (!win->next)
- win->height += delta_leftover;
+ win->height += delta_leftover;
if (win->node)
- recalculate_line_starts (win);
+ recalculate_line_starts (win);
win->flags |= W_UpdateWindow;
}
@@ -230,32 +232,32 @@ window_new_screen_size (width, height)
win = windows;
while (win)
- {
- if ((win->height < WINDOW_MIN_HEIGHT) ||
- (win->height > avail))
- {
- WINDOW *lastwin;
-
- /* Split the space among the available windows. */
- delta_each = avail / numwins;
- delta_leftover = avail - (delta_each * numwins);
-
- for (win = windows; win; win = win->next)
- {
- lastwin = win;
- if (win->prev)
- win->first_row =
- (win->prev->first_row + win->prev->height) + 1;
- win->height = delta_each;
- }
-
- /* Give the leftover space (if any) to the last window. */
- lastwin->height += delta_leftover;
- break;
- }
- else
- win= win->next;
- }
+ {
+ if ((win->height < WINDOW_MIN_HEIGHT) ||
+ (win->height > avail))
+ {
+ WINDOW *lastwin;
+
+ /* Split the space among the available windows. */
+ delta_each = avail / numwins;
+ delta_leftover = avail - (delta_each * numwins);
+
+ for (win = windows; win; win = win->next)
+ {
+ lastwin = win;
+ if (win->prev)
+ win->first_row =
+ (win->prev->first_row + win->prev->height) + 1;
+ win->height = delta_each;
+ }
+
+ /* Give the leftover space (if any) to the last window. */
+ lastwin->height += delta_leftover;
+ break;
+ }
+ else
+ win= win->next;
+ }
}
}
@@ -410,25 +412,25 @@ window_change_window_height (window, amount)
/* WINDOW decreasing in size? */
if (amount < 0)
{
- int abs_amount = -amount; /* It is easier to deal with this way. */
+ int abs_amount = -amount; /* It is easier to deal with this way. */
/* If the resultant window would be too small, stop here. */
if ((window->height - abs_amount) < WINDOW_MIN_HEIGHT)
- return;
+ return;
/* If we have two neighboring windows, choose the smaller one to get
- larger. */
+ larger. */
if (next && prev)
- {
- if (prev->height < next->height)
- shrink_me_growing_prev (window, prev, abs_amount);
- else
- shrink_me_growing_next (window, next, abs_amount);
- }
+ {
+ if (prev->height < next->height)
+ shrink_me_growing_prev (window, prev, abs_amount);
+ else
+ shrink_me_growing_next (window, next, abs_amount);
+ }
else if (next)
- shrink_me_growing_next (window, next, abs_amount);
+ shrink_me_growing_next (window, next, abs_amount);
else
- shrink_me_growing_prev (window, prev, abs_amount);
+ shrink_me_growing_prev (window, prev, abs_amount);
}
/* WINDOW increasing in size? */
@@ -437,65 +439,65 @@ window_change_window_height (window, amount)
int total_avail, next_avail = 0, prev_avail = 0;
if (next)
- next_avail = next->height - WINDOW_MIN_SIZE;
+ next_avail = next->height - WINDOW_MIN_SIZE;
if (prev)
- prev_avail = prev->height - WINDOW_MIN_SIZE;
+ prev_avail = prev->height - WINDOW_MIN_SIZE;
total_avail = next_avail + prev_avail;
/* If there isn't enough space available to grow this window, give up. */
if (amount > total_avail)
- return;
+ return;
/* If there aren't two neighboring windows, or if one of the neighbors
- is larger than the other one by at least AMOUNT, grow that one. */
+ is larger than the other one by at least AMOUNT, grow that one. */
if ((next && !prev) || ((next_avail - amount) >= prev_avail))
- grow_me_shrinking_next (window, next, amount);
+ grow_me_shrinking_next (window, next, amount);
else if ((prev && !next) || ((prev_avail - amount) >= next_avail))
- grow_me_shrinking_prev (window, prev, amount);
+ grow_me_shrinking_prev (window, prev, amount);
else
- {
- int change;
-
- /* This window has two neighbors. They both must be shrunk in to
- make enough space for WINDOW to grow. Make them both the same
- size. */
- if (prev_avail > next_avail)
- {
- change = prev_avail - next_avail;
- grow_me_shrinking_prev (window, prev, change);
- amount -= change;
- }
- else
- {
- change = next_avail - prev_avail;
- grow_me_shrinking_next (window, next, change);
- amount -= change;
- }
-
- /* Both neighbors are the same size. Split the difference in
- AMOUNT between them. */
- while (amount)
- {
- window->height++;
- amount--;
-
- /* Odd numbers grow next, even grow prev. */
- if (amount & 1)
- {
- prev->height--;
- window->first_row--;
- }
- else
- {
- next->height--;
- next->first_row++;
- }
- }
- window_adjust_pagetop (prev);
- window_adjust_pagetop (next);
- }
+ {
+ int change;
+
+ /* This window has two neighbors. They both must be shrunk in to
+ make enough space for WINDOW to grow. Make them both the same
+ size. */
+ if (prev_avail > next_avail)
+ {
+ change = prev_avail - next_avail;
+ grow_me_shrinking_prev (window, prev, change);
+ amount -= change;
+ }
+ else
+ {
+ change = next_avail - prev_avail;
+ grow_me_shrinking_next (window, next, change);
+ amount -= change;
+ }
+
+ /* Both neighbors are the same size. Split the difference in
+ AMOUNT between them. */
+ while (amount)
+ {
+ window->height++;
+ amount--;
+
+ /* Odd numbers grow next, even grow prev. */
+ if (amount & 1)
+ {
+ prev->height--;
+ window->first_row--;
+ }
+ else
+ {
+ next->height--;
+ next->first_row++;
+ }
+ }
+ window_adjust_pagetop (prev);
+ window_adjust_pagetop (next);
+ }
}
if (prev)
prev->flags |= W_UpdateWindow;
@@ -524,10 +526,10 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
if (do_internals || !win->node ||
- (win->node->flags & N_IsInternal) == 0)
+ (win->node->flags & N_IsInternal) == 0)
{
- avail += win->height;
- numwins++;
+ avail += win->height;
+ numwins++;
}
if (numwins <= 1 || !the_screen->height)
@@ -542,11 +544,11 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
{
if (do_internals || !win->node ||
- (win->node->flags & N_IsInternal) == 0)
- {
- last_adjusted = win;
- win->height = per_win_height;
- }
+ (win->node->flags & N_IsInternal) == 0)
+ {
+ last_adjusted = win;
+ win->height = per_win_height;
+ }
}
if (last_adjusted)
@@ -556,7 +558,7 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
{
if (win->prev)
- win->first_row = win->prev->first_row + win->prev->height + 1;
+ win->first_row = win->prev->first_row + win->prev->height + 1;
window_adjust_pagetop (win);
win->flags |= W_UpdateWindow;
@@ -589,11 +591,11 @@ window_toggle_wrap (window)
window_adjust_pagetop (window);
/* If the pagetop hasn't changed maybe we can do some scrolling now
- to speed up the display. Many of the line starts will be the same,
- so scrolling here is a very good optimization.*/
+ to speed up the display. Many of the line starts will be the same,
+ so scrolling here is a very good optimization.*/
if (old_pagetop == window->pagetop)
- display_scroll_line_starts
- (window, old_pagetop, old_starts, old_lines);
+ display_scroll_line_starts
+ (window, old_pagetop, old_starts, old_lines);
maybe_free (old_starts);
}
window->flags |= W_UpdateWindow;
@@ -648,12 +650,12 @@ window_delete_window (window)
if (window == active_window)
{
/* If there isn't a next window, then there must be a previous one,
- since we cannot delete the last window. If there is a next window,
- prefer to use that as the active window. */
+ since we cannot delete the last window. If there is a next window,
+ prefer to use that as the active window. */
if (next)
- active_window = next;
+ active_window = next;
else
- active_window = prev;
+ active_window = prev;
}
if (next && active_window == next)
@@ -672,13 +674,13 @@ window_delete_window (window)
int diff;
/* Try to adjust the visible part of the node so that as little
- text as possible has to move. */
+ text as possible has to move. */
diff = window_to_fix->first_row - window->first_row;
window_to_fix->first_row = window->first_row;
window_to_fix->pagetop -= diff;
if (window_to_fix->pagetop < 0)
- window_to_fix->pagetop = 0;
+ window_to_fix->pagetop = 0;
}
/* The `+ 1' is to offset the difference between the first_row locations.
@@ -723,24 +725,24 @@ character_width (character, hpos)
int width = 1;
if (ISO_Latin_p)
- printable_limit = 255;
+ printable_limit = 160;
if (character > printable_limit)
width = 3;
else if (iscntrl (character))
{
switch (character)
- {
- case '\r':
- case '\n':
- width = the_screen->width - hpos;
- break;
- case '\t':
- width = ((hpos + 8) & 0xf8) - hpos;
- break;
- default:
- width = 2;
- }
+ {
+ case '\r':
+ case '\n':
+ width = the_screen->width - hpos;
+ break;
+ case '\t':
+ width = ((hpos + 8) & 0xf8) - hpos;
+ break;
+ default:
+ width = 2;
+ }
}
else if (character == DEL)
width = 2;
@@ -818,61 +820,61 @@ calculate_line_starts (window)
unsigned int cwidth, c;
add_pointer_to_array (line, line_starts_index, line_starts,
- line_starts_slots, 100, char *);
+ line_starts_slots, 100, char *);
if (bump_index)
- {
- i++;
- bump_index = 0;
- }
+ {
+ i++;
+ bump_index = 0;
+ }
while (1)
- {
- c = node->contents[i];
- cwidth = character_width (c, hpos);
-
- /* If this character fits within this line, just do the next one. */
- if ((hpos + cwidth) < window->width)
- {
- i++;
- hpos += cwidth;
- continue;
- }
- else
- {
- /* If this character would position the cursor at the start of
- the next printed screen line, then do the next line. */
- if (c == '\n' || c == '\r' || c == '\t')
- {
- i++;
- hpos = 0;
- break;
- }
- else
- {
- /* This character passes the window width border. Postion
- the cursor after the printed character, but remember this
- line start as where this character is. A bit tricky. */
-
- /* If this window doesn't wrap lines, proceed to the next
- physical line here. */
- if (window->flags & W_NoWrap)
- {
- hpos = 0;
- while (i < node->nodelen && node->contents[i] != '\n')
- i++;
-
- if (node->contents[i] == '\n')
- i++;
- }
- else
- {
- hpos = the_screen->width - hpos;
- bump_index++;
- }
- break;
- }
- }
- }
+ {
+ c = node->contents[i];
+ cwidth = character_width (c, hpos);
+
+ /* If this character fits within this line, just do the next one. */
+ if ((hpos + cwidth) < window->width)
+ {
+ i++;
+ hpos += cwidth;
+ continue;
+ }
+ else
+ {
+ /* If this character would position the cursor at the start of
+ the next printed screen line, then do the next line. */
+ if (c == '\n' || c == '\r' || c == '\t')
+ {
+ i++;
+ hpos = 0;
+ break;
+ }
+ else
+ {
+ /* This character passes the window width border. Postion
+ the cursor after the printed character, but remember this
+ line start as where this character is. A bit tricky. */
+
+ /* If this window doesn't wrap lines, proceed to the next
+ physical line here. */
+ if (window->flags & W_NoWrap)
+ {
+ hpos = 0;
+ while (i < node->nodelen && node->contents[i] != '\n')
+ i++;
+
+ if (node->contents[i] == '\n')
+ i++;
+ }
+ else
+ {
+ hpos = the_screen->width - hpos;
+ bump_index++;
+ }
+ break;
+ }
+ }
+ }
}
window->line_starts = line_starts;
window->line_count = line_starts_index;
@@ -914,7 +916,7 @@ window_adjust_pagetop (window)
line_start = window->line_starts[line];
if ((line_start - contents) > window->point)
- break;
+ break;
}
/* The line index preceding the line start which is past point is the
@@ -927,26 +929,26 @@ window_adjust_pagetop (window)
(line - window->pagetop > (window->height - 1)))
{
/* The user-settable variable "scroll-step" is used to attempt
- to make point visible, iff it is non-zero. If that variable
- is zero, then the line containing point is centered within
- the window. */
+ to make point visible, iff it is non-zero. If that variable
+ is zero, then the line containing point is centered within
+ the window. */
if (window_scroll_step < window->height)
- {
- if ((line < window->pagetop) &&
- ((window->pagetop - window_scroll_step) <= line))
- window->pagetop -= window_scroll_step;
- else if ((line - window->pagetop > (window->height - 1)) &&
- ((line - (window->pagetop + window_scroll_step)
- < window->height)))
- window->pagetop += window_scroll_step;
- else
- window->pagetop = line - ((window->height - 1) / 2);
- }
+ {
+ if ((line < window->pagetop) &&
+ ((window->pagetop - window_scroll_step) <= line))
+ window->pagetop -= window_scroll_step;
+ else if ((line - window->pagetop > (window->height - 1)) &&
+ ((line - (window->pagetop + window_scroll_step)
+ < window->height)))
+ window->pagetop += window_scroll_step;
+ else
+ window->pagetop = line - ((window->height - 1) / 2);
+ }
else
- window->pagetop = line - ((window->height - 1) / 2);
+ window->pagetop = line - ((window->height - 1) / 2);
if (window->pagetop < 0)
- window->pagetop = 0;
+ window->pagetop = 0;
window->flags |= W_UpdateWindow;
}
}
@@ -968,7 +970,7 @@ window_line_of_point (window)
for (i = start; i < window->line_count; i++)
{
if ((window->line_starts[i] - window->node->contents) > window->point)
- break;
+ break;
}
return (i - 1);
@@ -1027,7 +1029,7 @@ window_chars_to_goal (line, goal)
check = hpos + character_width (line[i], hpos);
if (check > goal)
- break;
+ break;
hpos = check;
}
@@ -1054,26 +1056,26 @@ window_make_modeline (window)
if (window->pagetop == 0)
{
if (lines_remaining <= window->height)
- strcpy (location_indicator, "All");
+ strcpy (location_indicator, "All");
else
- strcpy (location_indicator, "Top");
+ strcpy (location_indicator, "Top");
}
else
{
if (lines_remaining <= window->height)
- strcpy (location_indicator, "Bot");
+ strcpy (location_indicator, "Bot");
else
- {
- float pt, lc;
- int percentage;
+ {
+ float pt, lc;
+ int percentage;
- pt = (float)window->pagetop;
- lc = (float)window->line_count;
+ pt = (float)window->pagetop;
+ lc = (float)window->line_count;
- percentage = 100 * (pt / lc);
+ percentage = 100 * (pt / lc);
- sprintf (location_indicator, "%2d%%", percentage);
- }
+ sprintf (location_indicator, "%2d%%", percentage);
+ }
}
/* Calculate the maximum size of the information to stick in MODELINE. */
@@ -1086,49 +1088,49 @@ window_make_modeline (window)
if (node)
{
- if (node->nodename)
- nodename = node->nodename;
+ if (node->nodename)
+ nodename = node->nodename;
- if (node->parent)
- {
- parent = filename_non_directory (node->parent);
- modeline_len += strlen ("Subfile: ") + strlen (node->filename);
- }
+ if (node->parent)
+ {
+ parent = filename_non_directory (node->parent);
+ modeline_len += strlen ("Subfile: ") + strlen (node->filename);
+ }
- if (node->filename)
- filename = filename_non_directory (node->filename);
+ if (node->filename)
+ filename = filename_non_directory (node->filename);
- if (node->flags & N_UpdateTags)
- update_message = _("--*** Tags out of Date ***");
+ if (node->flags & N_UpdateTags)
+ update_message = "--*** Tags out of Date ***";
}
if (update_message)
modeline_len += strlen (update_message);
modeline_len += strlen (filename);
modeline_len += strlen (nodename);
- modeline_len += 4; /* strlen (location_indicator). */
+ modeline_len += 4; /* strlen (location_indicator). */
/* 10 for the decimal representation of the number of lines in this
node, and the remainder of the text that can appear in the line. */
- modeline_len += 10 + strlen (_("-----Info: (), lines ----, "));
+ modeline_len += 10 + strlen ("-----Info: (), lines ----, ");
modeline_len += window->width;
modeline = (char *)xmalloc (1 + modeline_len);
/* Special internal windows have no filename. */
if (!parent && !*filename)
- sprintf (modeline, _("-%s---Info: %s, %d lines --%s--"),
- (window->flags & W_NoWrap) ? "$" : "-",
- nodename, window->line_count, location_indicator);
+ sprintf (modeline, "-%s---Info: %s, %d lines --%s--",
+ (window->flags & W_NoWrap) ? "$" : "-",
+ nodename, window->line_count, location_indicator);
else
- sprintf (modeline, _("-%s%s-Info: (%s)%s, %d lines --%s--"),
- (window->flags & W_NoWrap) ? "$" : "-",
- (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
- parent ? parent : filename,
- nodename, window->line_count, location_indicator);
+ sprintf (modeline, "-%s%s-Info: (%s)%s, %d lines --%s--",
+ (window->flags & W_NoWrap) ? "$" : "-",
+ (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
+ parent ? parent : filename,
+ nodename, window->line_count, location_indicator);
if (parent)
- sprintf (modeline + strlen (modeline), _(" Subfile: %s"), filename);
+ sprintf (modeline + strlen (modeline), " Subfile: %s", filename);
if (update_message)
sprintf (modeline + strlen (modeline), "%s", update_message);
@@ -1139,9 +1141,9 @@ window_make_modeline (window)
modeline[window->width] = '\0';
else
{
- while (i < window->width)
- modeline[i++] = '-';
- modeline[i] = '\0';
+ while (i < window->width)
+ modeline[i++] = '-';
+ modeline[i] = '\0';
}
strcpy (window->modeline, modeline);
@@ -1195,9 +1197,9 @@ window_set_state (window, state)
/* **************************************************************** */
-/* */
-/* Manipulating Home-Made Nodes */
-/* */
+/* */
+/* Manipulating Home-Made Nodes */
+/* */
/* **************************************************************** */
/* A place to buffer echo area messages. */
@@ -1257,8 +1259,8 @@ message_in_echo_area (format, arg1, arg2)
if (echo_area_node)
{
add_pointer_to_array (echo_area_node, old_echo_area_nodes_index,
- old_echo_area_nodes, old_echo_area_nodes_slots,
- 4, NODE *);
+ old_echo_area_nodes, old_echo_area_nodes_slots,
+ 4, NODE *);
}
echo_area_node = (NODE *)NULL;
window_message_in_echo_area (format, arg1, arg2);
@@ -1297,7 +1299,7 @@ message_buffer_resize (length)
while (message_buffer_size <= message_buffer_index + length)
message_buffer = (char *)
xrealloc (message_buffer,
- message_buffer_size += 100 + (2 * length));
+ message_buffer_size += 100 + (2 * length));
}
/* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and
@@ -1321,70 +1323,70 @@ build_message_buffer (format, arg1, arg2)
for (i = 0; format[i]; i++)
{
if (format[i] != '%')
- {
- message_buffer[message_buffer_index++] = format[i];
- len--;
- }
+ {
+ message_buffer[message_buffer_index++] = format[i];
+ len--;
+ }
else
- {
- char c;
-
- c = format[++i];
-
- switch (c)
- {
- case '%': /* Insert a percent sign. */
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = '%';
- break;
-
- case 's': /* Insert the current arg as a string. */
- {
- char *string;
- int string_len;
-
- string = (char *)args[arg_index++];
- string_len = strlen (string);
-
- message_buffer_resize (len + string_len);
- sprintf
- (message_buffer + message_buffer_index, "%s", string);
- message_buffer_index += string_len;
- }
- break;
-
- case 'd': /* Insert the current arg as an integer. */
- {
- long long_val;
- int integer;
-
- long_val = (long)args[arg_index++];
- integer = (int)long_val;
-
- message_buffer_resize (len + 32);
- sprintf
- (message_buffer + message_buffer_index, "%d", integer);
- message_buffer_index = strlen (message_buffer);
- }
- break;
-
- case 'c': /* Insert the current arg as a character. */
- {
- long long_val;
- int character;
-
- long_val = (long)args[arg_index++];
- character = (int)long_val;
-
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = character;
- }
- break;
-
- default:
- abort ();
- }
- }
+ {
+ char c;
+
+ c = format[++i];
+
+ switch (c)
+ {
+ case '%': /* Insert a percent sign. */
+ message_buffer_resize (len + 1);
+ message_buffer[message_buffer_index++] = '%';
+ break;
+
+ case 's': /* Insert the current arg as a string. */
+ {
+ char *string;
+ int string_len;
+
+ string = (char *)args[arg_index++];
+ string_len = strlen (string);
+
+ message_buffer_resize (len + string_len);
+ sprintf
+ (message_buffer + message_buffer_index, "%s", string);
+ message_buffer_index += string_len;
+ }
+ break;
+
+ case 'd': /* Insert the current arg as an integer. */
+ {
+ long long_val;
+ int integer;
+
+ long_val = (long)args[arg_index++];
+ integer = (int)long_val;
+
+ message_buffer_resize (len + 32);
+ sprintf
+ (message_buffer + message_buffer_index, "%d", integer);
+ message_buffer_index = strlen (message_buffer);
+ }
+ break;
+
+ case 'c': /* Insert the current arg as a character. */
+ {
+ long long_val;
+ int character;
+
+ long_val = (long)args[arg_index++];
+ character = (int)long_val;
+
+ message_buffer_resize (len + 1);
+ message_buffer[message_buffer_index++] = character;
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
}
message_buffer[message_buffer_index] = '\0';
}
@@ -1472,7 +1474,7 @@ pad_to (count, string)
else
{
while (i < count)
- string[i++] = ' ';
+ string[i++] = ' ';
}
string[i] = '\0';
diff --git a/contrib/texinfo/info/window.h b/contrib/texinfo/info/window.h
index 17367cbd5a40..5bde64a10acc 100644
--- a/contrib/texinfo/info/window.h
+++ b/contrib/texinfo/info/window.h
@@ -1,10 +1,9 @@
-/* window.h -- Structure and flags used in manipulating Info windows.
- $Id: window.h,v 1.4 1997/07/15 18:45:47 karl Exp $
+/* window.h -- Structure and flags used in manipulating Info windows. */
- This file is part of GNU Info, a program for reading online documentation
+/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#ifndef INFO_WINDOW_H
-#define INFO_WINDOW_H
+#if !defined (_WINDOW_H_)
+#define _WINDOW_H_
#include "nodes.h"
#include "infomap.h"
@@ -45,9 +44,9 @@
if you need to change window state information, here is where you would
do it. NB> The last element does NOT end with a semi-colon. */
#define WINDOW_STATE_DECL \
- NODE *node; /* The node displayed in this window. */ \
- int pagetop; /* LINE_STARTS[PAGETOP] is first line in WINDOW. */ \
- long point /* Offset within NODE of the cursor position. */
+ NODE *node; /* The node displayed in this window. */ \
+ int pagetop; /* LINE_STARTS[PAGETOP] is first line in WINDOW. */ \
+ long point /* Offset within NODE of the cursor position. */
/* Structure which defines a window. Windows are doubly linked, next
and prev. The list of windows is kept on WINDOWS. The structure member
@@ -55,38 +54,37 @@
(0, window->height + window->first_row) is the first character of this
windows modeline. The number of lines that can be displayed in a window
is equal to window->height - 1. */
-typedef struct window_struct
-{
- struct window_struct *next; /* Next window in this chain. */
- struct window_struct *prev; /* Previous window in this chain. */
- int width; /* Width of this window. */
- int height; /* Height of this window. */
- int first_row; /* Offset of the first line in the_screen. */
- int goal_column; /* The column we would like the cursor to appear in. */
- Keymap keymap; /* Keymap used to read commands in this window. */
- WINDOW_STATE_DECL; /* Node, pagetop and point. */
- char *modeline; /* Calculated text of the modeline for this window. */
- char **line_starts; /* Array of printed line starts for this node. */
- int line_count; /* Number of lines appearing in LINE_STARTS. */
- int flags; /* See below for details. */
+typedef struct __window__ {
+ struct __window__ *next; /* Next window in this chain. */
+ struct __window__ *prev; /* Previous window in this chain. */
+ int width; /* Width of this window. */
+ int height; /* Height of this window. */
+ int first_row; /* Offset of the first line in the_screen. */
+ int goal_column; /* The column we would like the cursor to appear in. */
+ Keymap keymap; /* Keymap used to read commands in this window. */
+ WINDOW_STATE_DECL; /* Node, pagetop and point. */
+ char *modeline; /* Calculated text of the modeline for this window. */
+ char **line_starts; /* Array of printed line starts for this node. */
+ int line_count; /* Number of lines appearing in LINE_STARTS. */
+ int flags; /* See below for details. */
} WINDOW;
typedef struct {
- WINDOW_STATE_DECL; /* What gets saved. */
+ WINDOW_STATE_DECL; /* What gets saved. */
} WINDOW_STATE;
-#define W_UpdateWindow 0x01 /* WINDOW needs updating. */
-#define W_WindowIsPerm 0x02 /* This WINDOW is a permanent object. */
-#define W_WindowVisible 0x04 /* This WINDOW is currently visible. */
-#define W_InhibitMode 0x08 /* This WINDOW has no modeline. */
-#define W_NoWrap 0x10 /* Lines do not wrap in this window. */
-#define W_InputWindow 0x20 /* Window accepts input. */
-#define W_TempWindow 0x40 /* Window is less important. */
+#define W_UpdateWindow 0x01 /* WINDOW needs updating. */
+#define W_WindowIsPerm 0x02 /* This WINDOW is a permanent object. */
+#define W_WindowVisible 0x04 /* This WINDOW is currently visible. */
+#define W_InhibitMode 0x08 /* This WINDOW has no modeline. */
+#define W_NoWrap 0x10 /* Lines do not wrap in this window. */
+#define W_InputWindow 0x20 /* Window accepts input. */
+#define W_TempWindow 0x40 /* Window is less important. */
-extern WINDOW *windows; /* List of visible Info windows. */
-extern WINDOW *active_window; /* The currently active window. */
-extern WINDOW *the_screen; /* The Info screen is just another window. */
-extern WINDOW *the_echo_area; /* THE_ECHO_AREA is a window in THE_SCREEN. */
+extern WINDOW *windows; /* List of visible Info windows. */
+extern WINDOW *active_window; /* The currently active window. */
+extern WINDOW *the_screen; /* The Info screen is just another window. */
+extern WINDOW *the_echo_area; /* THE_ECHO_AREA is a window in THE_SCREEN. */
/* Global variable control redisplay of scrolled windows. If non-zero, it
is the desired number of lines to scroll the window in order to make
@@ -228,4 +226,4 @@ extern void window_get_state (), window_set_state ();
offset of GOAL. */
extern int window_chars_to_goal ();
-#endif /* not INFO_WINDOW_H */
+#endif /* !_WINDOW_H_ */
diff --git a/contrib/texinfo/lib/xmalloc.c b/contrib/texinfo/info/xmalloc.c
index 156989ed7118..156989ed7118 100644
--- a/contrib/texinfo/lib/xmalloc.c
+++ b/contrib/texinfo/info/xmalloc.c
diff --git a/contrib/texinfo/intl/ChangeLog b/contrib/texinfo/intl/ChangeLog
deleted file mode 100644
index ecff6f6b2cd7..000000000000
--- a/contrib/texinfo/intl/ChangeLog
+++ /dev/null
@@ -1,1022 +0,0 @@
-1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in: Reformat copyright.
-
-1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (DCGETTEXT): Remove wrong comment.
-
-1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install-data): Don't change directory to install.
-
-1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com>
-
- * cat-compat.c: Fix copyright.
-
- * localealias.c: Don't define strchr unless !HAVE_STRCHR.
-
- * loadmsgcat.c: Update copyright. Fix typos.
-
- * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
- (_nl_make_l10nflist): Handle sponsor and revision correctly.
-
- * gettext.c: Update copyright.
- * gettext.h: Likewise.
- * hash-string.h: Likewise.
-
- * finddomain.c: Remoave dead code. Define strchr only if
- !HAVE_STRCHR.
-
- * explodename.c: Include <sys/types.h>.
-
- * explodename.c: Reformat copyright text.
- (_nl_explode_name): Fix typo.
-
- * dcgettext.c: Define and use __set_errno.
- (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
- not defined.
-
- * bindtextdom.c: Pretty printing.
-
-1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (guess_category_value): Don't depend on
- HAVE_LC_MESSAGES. We don't need the macro here.
- Patch by Bruno Haible <haible@ilog.fr>.
-
- * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
- macro. Instead use HAVE_LOCALE_NULL and define it when using
- glibc, as in dcgettext.c.
- Patch by Bruno Haible <haible@ilog.fr>.
-
- * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois
- Pinard.
-
-Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in: Implement handling of libtool.
-
- * gettextP.h: Change data structures for use of generic lowlevel
- i18n file handling.
-
-Wed Dec 4 20:21:18 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * textdomain.c: Put parentheses around arguments of memcpy macro
- definition.
- * localealias.c: Likewise.
- * l10nflist.c: Likewise.
- * finddomain.c: Likewise.
- * bindtextdom.c: Likewise.
- Reported by Thomas Esken.
-
-Mon Nov 25 22:57:51 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * textdomain.c: Move definition of `memcpy` macro to right
- position.
-
-Fri Nov 22 04:01:58 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
- bcopy if not already defined. Reported by Thomas Esken.
- * bindtextdom.c: Likewise.
- * l10nflist.c: Likewise.
- * localealias.c: Likewise.
- * textdomain.c: Likewise.
-
-Tue Oct 29 11:10:27 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (libdir): Change to use exec_prefix instead of
- prefix. Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
-
-Sat Aug 31 03:07:09 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
- so don't prepend uppercase `ISO' for only numeric arg.
-
-Fri Jul 19 00:15:46 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
- definition of _GNU_SOURCE. Patch by Roland McGrath.
-
- * Makefile.in (uninstall): Fix another bug with `for' loop and
- empty arguments. Patch by Jim Meyering. Correct name os
- uninstalled files: no intl- prefix anymore.
-
- * Makefile.in (install-data): Again work around shells which
- cannot handle mpty for list. Reported by Jim Meyering.
-
-Sat Jul 13 18:11:35 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Split goal. Now depend on install-exec
- and install-data.
- (install-exec, install-data): New goals. Created from former
- install goal.
- Reported by Karl Berry.
-
-Sat Jun 22 04:58:14 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (MKINSTALLDIRS): New variable. Path to
- mkinstalldirs script.
- (install): use MKINSTALLDIRS variable or if the script is not present
- try to find it in the $top_scrdir).
-
-Wed Jun 19 02:56:56 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Linux libc *partly* includes the argz_* functions.
- Grr. Work around by renaming the static version and use macros
- for renaming.
-
-Tue Jun 18 20:11:17 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Correct presence test macros of __argz_* functions.
-
- * l10nflist.c: Include <argz.h> based on test of it instead when
- __argz_* functions are available.
- Reported by Andreas Schwab.
-
-Thu Jun 13 15:17:44 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * explodename.c, l10nflist.c: Define NULL for dumb systems.
-
-Tue Jun 11 17:05:13 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
- result to __result to prevent name clash.
-
- * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
- get prototype for stpcpy and strcasecmp.
-
- * intlh.inst.in, libgettext.h: Move declaration of
- `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
- from gcc's -Wnested-extern option.
-
-Fri Jun 7 01:58:00 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Remove comment.
-
-Thu Jun 6 17:28:17 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Work around for another Buglix stupidity.
- Always use an `else' close for `if's. Reported by Nelson Beebe.
-
- * Makefile.in (intlh.inst): Correct typo in phony rule.
- Reported by Nelson Beebe.
-
-Thu Jun 6 01:49:52 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (read_alias_file): Rename variable alloca_list to
- block_list as the macro calls assume.
- Patch by Eric Backus.
-
- * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
- malloc.
- (read_alias_file): Rename varriabe alloca_list to block_list as the
- macro calls assume.
- Patch by Eric Backus.
-
- * l10nflist.c: Correct conditional for <argz.h> inclusion.
- Reported by Roland McGrath.
-
- * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
- all-@USE_NLS@.
-
- * Makefile.in (install): intlh.inst comes from local dir, not
- $(srcdir).
-
- * Makefile.in (intlh.inst): Special handling of this goal. If
- used in gettext, this is really a rul to construct this file. If
- used in any other package it is defined as a .PHONY rule with
- empty body.
-
- * finddomain.c: Extract locale file information handling into
- l10nfile.c. Rename local stpcpy__ function to stpcpy.
-
- * dcgettext.c (stpcpy): Add local definition.
-
- * l10nflist.c: Solve some portability problems. Patches partly by
- Thomas Esken. Add local definition of stpcpy.
-
-Tue Jun 4 02:47:49 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in: Don't depend including <locale.h> on
- HAVE_LOCALE_H. Instead configure must rewrite this fiile
- depending on the result of the configure run.
-
- * Makefile.in (install): libintl.inst is now called intlh.inst.
- Add rules for updating intlh.inst from intlh.inst.in.
-
- * libintl.inst: Renamed to intlh.inst.in.
-
- * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
- because gcc has __buitlin_alloca.
- Reported by Roland McGrath.
-
-Mon Jun 3 00:32:16 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (installcheck): New goal to fulfill needs of
- automake's distcheck.
-
- * Makefile.in (install): Reorder commands so that VERSION is
- found.
-
- * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
- @datadir@/gettext.
- (COMSRCS): Add l10nfile.c.
- (OBJECTS): Add l10nfile.o.
- (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common).
- (DISTFILE.gettext): Remove $(DISTFILES.common).
- (all-gettext): Remove goal.
- (install): If $(PACKAGE) = gettext install, otherwose do nothing. No
- package but gettext itself should install libintl.h + headers.
- (dist): Extend goal to work for gettext, too.
- (dist-gettext): Remove goal.
-
- * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
-
-Sun Jun 2 17:33:06 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
- find_l10nfile.
-
-Sat Jun 1 02:23:03 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c (__argz_next): Add definition.
-
- * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
- code. Use new l10nfile handling.
-
- * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
- alloca code.
-
- * l10nflist.c: Initial revision.
-
-Tue Apr 2 18:51:18 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all-gettext): New goal. Same as all-yes.
-
-Thu Mar 28 23:01:22 1996 Karl Eichwalder <ke@ke.central.de>
-
- * Makefile.in (gettextsrcdir): Define using @datadir@.
-
-Tue Mar 26 12:39:14 1996 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Include <ctype.h>. Reported by Roland McGrath.
-
-Sat Mar 23 02:00:35 1996 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
- with external declaration.
-
-Sat Mar 2 00:47:09 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all-no): Rename from all_no.
-
-Sat Feb 17 00:25:59 1996 Ulrich Drepper <drepper@myware>
-
- * gettextP.h [loaded_domain]: Array `successor' must now contain up
- to 63 elements (because of codeset name normalization).
-
- * finddomain.c: Implement codeset name normalization.
-
-Thu Feb 15 04:39:09 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all): Define to `all-@USE_NLS@'.
- (all-yes, all_no): New goals. `all-no' is noop, `all-yes'
- is former all.
-
-Mon Jan 15 21:46:01 1996 Howard Gayle <howard@hal.com>
-
- * localealias.c (alias_compare): Increment string pointers in loop
- of strcasecmp replacement.
-
-Fri Dec 29 21:16:34 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src): Who commented this goal out ? :-)
-
-Fri Dec 29 15:08:16 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls
- should not effect it because a missing catalog is no error.
- Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
-
-Tue Dec 19 22:09:13 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (Makefile): Explicitly use $(SHELL) for running
- shell scripts.
-
-Fri Dec 15 17:34:59 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * Makefile.in (install-src): Only install library and header when
- we use the own implementation. Don't do it when using the
- system's gettext or catgets functions.
-
- * dcgettext.c (find_msg): Must not swap domain->hash_size here.
-
-Sat Dec 9 16:24:37 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c, libintl.inst, libgettext.h, hash-string.h,
- gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
- Use PARAMS instead of __P. Suggested by Roland McGrath.
-
-Tue Dec 5 11:39:14 1995 Larry Schwimmer <rosebud@cyclone.stanford.edu>
-
- * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
- !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
-
-Mon Dec 4 15:42:07 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src):
- Install libintl.inst instead of libintl.h.install.
-
-Sat Dec 2 22:51:38 1995 Marcus Daniels <marcus@sysc.pdx.edu>
-
- * cat-compat.c (textdomain):
- Reverse order in which files are tried you load. First
- try local file, when this failed absolute path.
-
-Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
-
- * cat-compat.c (bindtextdomain): Add missing { }.
-
-Sun Nov 26 18:21:41 1995 Ulrich Drepper <drepper@myware>
-
- * libintl.inst: Add missing __P definition. Reported by Nelson Beebe.
-
- * Makefile.in:
- Add dummy `all' and `dvi' goals. Reported by Tom Tromey.
-
-Sat Nov 25 16:12:01 1995 Franc,ois Pinard <pinard@iro.umontreal.ca>
-
- * hash-string.h: Capitalize arguments of macros.
-
-Sat Nov 25 12:01:36 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Prevent files names longer than 13
- characters. libintl.h.glibc->libintl.glibc,
- libintl.h.install->libintl.inst. Reported by Joshua R. Poulson.
-
-Sat Nov 25 11:31:12 1995 Eric Backus <ericb@lsid.hp.com>
-
- * dcgettext.c: Fix bug in preprocessor conditionals.
-
-Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
-
- * libgettext.h: Solaris cc does not understand
- #if !SYMBOL1 && !SYMBOL2. Sad but true.
-
-Thu Nov 23 16:22:14 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h (hash_string):
- Fix for machine with >32 bit `unsigned long's.
-
- * dcgettext.c (DCGETTEXT):
- Fix horrible bug in loop for alternative translation.
-
-Thu Nov 23 01:45:29 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
- Some further simplifications in message number generation.
-
-Mon Nov 20 21:08:43 1995 Ulrich Drepper <drepper@myware>
-
- * libintl.h.glibc: Use __const instead of const in prototypes.
-
- * Makefile.in (install-src):
- Install libintl.h.install instead of libintl.h. This
- is a stripped-down version. Suggested by Peter Miller.
-
- * libintl.h.install, libintl.h.glibc: Initial revision.
-
- * localealias.c (_nl_expand_alias, read_alias_file):
- Protect prototypes in type casts by __P.
-
-Tue Nov 14 16:43:58 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h: Correct prototype for hash_string.
-
-Sun Nov 12 12:42:30 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h (hash_string): Add prototype.
-
- * gettextP.h: Fix copyright.
- (SWAP): Add prototype.
-
-Wed Nov 8 22:56:33 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (read_alias_file): Forgot sizeof.
- Avoid calling *printf function. This introduces a big overhead.
- Patch by Roland McGrath.
-
-Tue Nov 7 14:21:08 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
-
- * finddomain.c (stpcpy):
- Define substitution function local. The macro was to flaky.
-
- * cat-compat.c: Fix typo.
-
- * xopen-msg.sed, linux-msg.sed:
- While bringing message number to right place only accept digits.
-
- * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
- leading 0s we don't need to remove them. Reported by Marcus
- Daniels.
-
- * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
- dependency. Reported by Marcus Daniels.
-
- * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
- Generally cleanup using #if instead of #ifndef.
-
- * Makefile.in: Correct typos in comment. By Franc,ois Pinard.
-
-Mon Nov 6 00:27:02 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src): Don't install libintl.h and libintl.a
- if we use an available gettext implementation.
-
-Sun Nov 5 22:02:08 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported
- by Franc,ois Pinard.
-
- * libgettext.h: Use #if instead of #ifdef/#ifndef.
-
- * finddomain.c:
- Comments describing what has to be done should start with FIXME.
-
-Sun Nov 5 19:38:01 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning.
- DISTFILES.common names the files common to both dist goals.
- DISTFILES.gettext are the files only distributed in GNU gettext.
-
-Sun Nov 5 17:32:54 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
- This was necessary since a change in _nl_find_msg several weeks
- ago. I really don't know this is still not fixed.
-
-Sun Nov 5 12:43:12 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This
- might mark a special condition.
-
- * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
-
- * Makefile.in (dist): Suppress error message when ln failed.
- Get files from $(srcdir) explicitly.
-
- * libgettext.h (gettext_const): Rename to gettext_noop.
-
-Fri Nov 3 07:36:50 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (make_entry_rec):
- Protect against wrong locale names by testing mask.
-
- * libgettext.h (gettext_const): Add macro definition.
- Capitalize macro arguments.
-
-Thu Nov 2 23:15:51 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Test for pointer != NULL before accessing value.
- Reported by Tom Tromey.
-
- * gettext.c (NULL):
- Define as (void*)0 instad of 0. Reported by Franc,ois Pinard.
-
-Mon Oct 30 21:28:52 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
-
-Sat Oct 28 23:20:47 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
-
- * localealias.c (alias_compare):
- Peter Miller reported that tolower in some systems is
- even dumber than I thought. Protect call by `isupper'.
-
-Fri Oct 27 22:22:51 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (libdir, includedir): New variables.
- (install-src): Install libintl.a and libintl.h in correct dirs.
-
-Fri Oct 27 22:07:29 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
-
- * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
-
- * localealias.c:
- Fix typo and superflous test. Reported by Christian von Roques.
-
-Fri Oct 6 11:52:05 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Correct some remainder from the pre-CEN syntax. Now
- we don't have a constant number of successors anymore.
-
-Wed Sep 27 21:41:13 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Add libintl.h.glibc.
-
- * Makefile.in (dist-libc): Add goal for packing sources for glibc.
- (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
-
- * loadmsgcat.c: Forget to continue #if line.
-
- * localealias.c:
- [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
- space clean.
-
- * dcgettext.c, finddomain.c: Better comment to last change.
-
- * loadmsgcat.c:
- [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
- __fstat, __open, __close, __read, __mmap, and __munmap resp
- to keep ANSI C name space clean.
-
- * finddomain.c:
- [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
-
- * dcgettext.c:
- [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
- keep ANSI C name space clean.
-
- * libgettext.h:
- Include sys/types.h for those old SysV systems out there.
- Reported by Francesco Potorti`.
-
- * loadmsgcat.c (use_mmap): Define if compiled for glibc.
-
- * bindtextdom.c: Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * finddomain.c: Fix 2 times defiend -> defined.
-
- * textdomain.c: Include libintl.h instead of libgettext.h when
- compiling for glibc. Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
-
- * gettext.c:
- Include libintl.h instead of libgettext.h when compiling for glibc.
- Get NULL from stddef.h if we compile for glibc.
-
- * finddomain.c: Include libintl.h instead of libgettext.h when
- compiling for glibc. Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * dcgettext.c: Include all those standard headers unconditionally
- if _LIBC is defined.
-
- * dgettext.c: If compiled in glibc include libintl.h instead of
- libgettext.h.
- (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
-
- * dcgettext.c: If compiled in glibc include libintl.h instead of
- libgettext.h.
- (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
-
- * bindtextdom.c:
- If compiled in glibc include libintl.h instead of libgettext.h.
-
-Mon Sep 25 22:23:06 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
- Reported by Marcus Daniels.
-
- * cat-compat.c (bindtextdomain):
- String used in putenv must not be recycled.
- Reported by Marcus Daniels.
-
- * libgettext.h (__USE_GNU_GETTEXT):
- Additional symbol to signal that we use GNU gettext
- library.
-
- * cat-compat.c (bindtextdomain):
- Fix bug with the strange stpcpy replacement.
- Reported by Nelson Beebe.
-
-Sat Sep 23 08:23:51 1995 Ulrich Drepper <drepper@myware>
-
- * cat-compat.c: Include <string.h> for stpcpy prototype.
-
- * localealias.c (read_alias_file):
- While expand strdup code temporary variable `cp' hided
- higher level variable with same name. Rename to `tp'.
-
- * textdomain.c (textdomain):
- Avoid warning by using temporary variable in strdup code.
-
- * finddomain.c (_nl_find_domain): Remove unused variable `application'.
-
-Thu Sep 21 15:51:44 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (alias_compare):
- Use strcasecmp() only if available. Else use
- implementation in place.
-
- * intl-compat.c:
- Wrapper functions now call *__ functions instead of __*.
-
- * libgettext.h: Declare prototypes for *__ functions instead for __*.
-
- * cat-compat.c, loadmsgcat.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
-
- * bindtextdom.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
- Rename to bindtextdomain__ if not used in GNU C Library.
-
- * dgettext.c:
- Rename function to dgettext__ if not used in GNU C Library.
-
- * gettext.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
- Functions now called gettext__ if not used in GNU C Library.
-
- * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
-
-Sun Sep 17 23:14:49 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Correct some bugs in handling of CEN standard
- locale definitions.
-
-Thu Sep 7 01:49:28 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Implement CEN syntax.
-
- * gettextP.h (loaded_domain): Extend number of successors to 31.
-
-Sat Aug 19 19:25:29 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (aliaspath): Remove path to X11 locale dir.
-
- * Makefile.in: Make install-src depend on install. This helps
- gettext to install the sources and other packages can use the
- install goal.
-
-Sat Aug 19 15:19:33 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (uninstall): Remove stuff installed by install-src.
-
-Tue Aug 15 13:13:53 1995 Ulrich Drepper <drepper@myware>
-
- * VERSION.in: Initial revision.
-
- * Makefile.in (DISTFILES):
- Add VERSION file. This is not necessary for gettext, but
- for other packages using this library.
-
-Tue Aug 15 06:16:44 1995 Ulrich Drepper <drepper@myware>
-
- * gettextP.h (_nl_find_domain):
- New prototype after changing search strategy.
-
- * finddomain.c (_nl_find_domain):
- We now try only to find a specified catalog. Fall back to other
- catalogs listed in the locale list is now done in __dcgettext.
-
- * dcgettext.c (__dcgettext):
- Now we provide message fall back even to different languages.
- I.e. if a message is not available in one language all the other
- in the locale list a tried. Formerly fall back was only possible
- within one language. Implemented by moving one loop from
- _nl_find_domain to here.
-
-Mon Aug 14 23:45:50 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (gettextsrcdir):
- Directory where source of GNU gettext library are made
- available.
- (INSTALL, INSTALL_DATA): Programs used for installing sources.
- (gettext-src): New. Rule to install GNU gettext sources for use in
- gettextize shell script.
-
-Sun Aug 13 14:40:48 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c (_nl_load_domain):
- Use mmap for loading only when munmap function is
- also available.
-
- * Makefile.in (install): Depend on `all' goal.
-
-Wed Aug 9 11:04:33 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (read_alias_file):
- Do not overwrite '\n' when terminating alias value string.
-
- * localealias.c (read_alias_file):
- Handle long lines. Ignore the rest not fitting in
- the buffer after the initial `fgets' call.
-
-Wed Aug 9 00:54:29 1995 Ulrich Drepper <drepper@myware>
-
- * gettextP.h (_nl_load_domain):
- Add prototype, replacing prototype for _nl_load_msg_cat.
-
- * finddomain.c (_nl_find_domain):
- Remove unneeded variable filename and filename_len.
- (expand_alias): Remove prototype because functions does not
- exist anymore.
-
- * localealias.c (read_alias_file):
- Change type of fname_len parameter to int.
- (xmalloc): Add prototype.
-
- * loadmsgcat.c: Better prototypes for xmalloc.
-
-Tue Aug 8 22:30:39 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Allow alias name to be constructed from the four components.
-
- * Makefile.in (aliaspath): New variable. Set to preliminary value.
- (SOURCES): Add localealias.c.
- (OBJECTS): Add localealias.o.
-
- * gettextP.h: Add prototype for _nl_expand_alias.
-
- * finddomain.c: Aliasing handled in intl/localealias.c.
-
- * localealias.c: Aliasing for locale names.
-
- * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
-
-Mon Aug 7 23:47:42 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
-
- * cat-compat.c (bindtextdomain):
- Correct implementation. dirname parameter was not used.
- Reported by Marcus Daniels.
-
- * gettextP.h (loaded_domain):
- New fields `successor' and `decided' for oo, lazy
- message handling implementation.
-
- * dcgettext.c:
- Adopt for oo, lazy message handliing.
- Now we can inherit translations from less specific locales.
- (find_msg): New function.
-
- * loadmsgcat.c, finddomain.c:
- Complete rewrite. Implement oo, lazy message handling :-).
- We now have an additional environment variable `LANGUAGE' with
- a higher priority than LC_ALL for the LC_MESSAGE locale.
- Here we can set a colon separated list of specifications each
- of the form `language[_territory[.codeset]][@modifier]'.
-
-Sat Aug 5 09:55:42 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (unistd.h):
- Include to get _PC_PATH_MAX defined on system having it.
-
-Fri Aug 4 22:42:00 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (stpcpy): Include prototype.
-
- * Makefile.in (dist): Remove `copying instead' message.
-
-Wed Aug 2 18:52:03 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (ID, TAGS): Do not use $^.
-
-Tue Aug 1 20:07:11 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (TAGS, ID): Use $^ as command argument.
- (TAGS): Give etags -o option t write to current directory,
- not $(srcdir).
- (ID): Use $(srcdir) instead os $(top_srcdir)/src.
- (distclean): Remove ID.
-
-Sun Jul 30 11:51:46 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (gnulocaledir):
- New variable, always using share/ for data directory.
- (DEFS): Add GNULOCALEDIR, used in finddomain.c.
-
- * finddomain.c (_nl_default_dirname):
- Set to GNULOCALEDIR, because it always has to point
- to the directory where GNU gettext Library writes it to.
-
- * intl-compat.c (textdomain, bindtextdomain):
- Undefine macros before function definition.
-
-Sat Jul 22 01:10:02 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h (_LIBINTL_H):
- Protect definition in case where this file is included as
- libgettext.h on Solaris machines. Add comment about this.
-
-Wed Jul 19 02:36:42 1995 Ulrich Drepper <drepper@myware>
-
- * intl-compat.c (textdomain): Correct typo.
-
-Wed Jul 19 01:51:35 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (dcgettext): Function now called __dcgettext.
-
- * dgettext.c (dgettext): Now called __dgettext and calls
- __dcgettext.
-
- * gettext.c (gettext):
- Function now called __gettext and calls __dgettext.
-
- * textdomain.c (textdomain): Function now called __textdomain.
-
- * bindtextdom.c (bindtextdomain): Function now called
- __bindtextdomain.
-
- * intl-compat.c: Initial revision.
-
- * Makefile.in (SOURCES): Add intl-compat.c.
- (OBJECTS): We always compile the GNU gettext library functions.
- OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
- and intl-compat.o.
- (GETTOBJS): Contains now only intl-compat.o.
-
- * libgettext.h:
- Re-include protection matches dualistic character of libgettext.h.
- For all functions in GNU gettext library define __ counter part.
-
- * finddomain.c (strchr): Define as index if not found in C library.
- (_nl_find_domain): For relative paths paste / in between.
-
-Tue Jul 18 16:37:45 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
-
- * xopen-msg.sed: Fix bug with `msgstr ""' lines.
- A little bit better comments.
-
-Tue Jul 18 01:18:27 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in:
- po-mode.el, makelinks, combine-sh are now found in ../misc.
-
- * po-mode.el, makelinks, combine-sh, elisp-comp:
- Moved to ../misc/.
-
- * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
-
-Sun Jul 16 22:33:02 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (INSTALL, INSTALL_DATA): New variables.
- (install-data, uninstall): Install/uninstall .elc file.
-
- * po-mode.el (Installation comment):
- Add .pox as possible extension of .po files.
-
-Sun Jul 16 13:23:27 1995 Ulrich Drepper <drepper@myware>
-
- * elisp-comp: Complete new version by Franc,ois: This does not
- fail when not compiling in the source directory.
-
-Sun Jul 16 00:12:17 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (../po/cat-id-tbl.o):
- Use $(MAKE) instead of make for recursive make.
-
- * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
- (install-exec): Add missing dummy goal.
- (install-data, uninstall): @ in multi-line shell command at
- beginning, not in front of echo. Reported by Eric Backus.
-
-Sat Jul 15 00:21:28 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES):
- Rename libgettext.perl to gettext.perl to fit in 14 chars
- file systems.
-
- * gettext.perl:
- Rename to gettext.perl to fit in 14 chars file systems.
-
-Thu Jul 13 23:17:20 1995 Ulrich Drepper <drepper@myware>
-
- * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
-
-Thu Jul 13 20:55:02 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in: Pretty printing.
-
- * linux-msg.sed, xopen-msg.sed:
- Correct bugs with handling substitute flags in branches.
-
- * hash-string.h (hash_string):
- Old K&R compilers don't under stand `unsigned char'.
-
- * gettext.h (nls_uint32):
- Some old K&R compilers (eg HP) don't understand `unsigned int'.
-
- * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
-
-Thu Jul 13 01:34:33 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (ELCFILES): New variable.
- (DISTFILES): Add elisp-comp.
- Add implicit rule for .el -> .elc compilation.
- (install-data): install $ELCFILES
- (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
-
- * elisp-comp: Initial revision
-
-Wed Jul 12 16:14:52 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in:
- cat-id-tbl.c is now found in po/. This enables us to use an identical
- intl/ directory in all packages.
-
- * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
-
- * textdomain.c: fix typo (#if def -> #if defined)
-
-Tue Jul 11 18:44:43 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (stamp-cat-id): use top_srcdir to address source files
- (DISTFILES,distclean): move tupdate.perl to src/
-
- * po-to-tbl.sed.in:
- add additional jump to clear change flag to recognize multiline strings
-
-Tue Jul 11 01:32:50 1995 Ulrich Drepper <drepper@myware>
-
- * textdomain.c: Protect inclusion of stdlib.h and string.h.
-
- * loadmsgcat.c: Protect inclusion of stdlib.h.
-
- * libgettext.h: Protect inclusion of locale.h.
- Allow use in C++ programs.
- Define NULL is not happened already.
-
- * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
- po-to-tbl.sed.
- (distclean): remove po-to-tbl.sed and tupdate.perl.
-
- * tupdate.perl.in: Substitute Perl path even in exec line.
- Don't include entries without translation from old .po file.
-
-Tue Jul 4 00:41:51 1995 Ulrich Drepper <drepper@myware>
-
- * tupdate.perl.in: use "Updated: " in msgid "".
-
- * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
- Define getenv if !__STDC__.
-
- * bindtextdom.c: Protect stdlib.h and string.h inclusion.
- Define free if !__STDC__.
-
- * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
- Define free if !__STDC__.
-
- * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
-
-Mon Jul 3 23:56:30 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
- Remove unneeded $(srcdir) from Makefile.in dependency.
-
- * makelinks: Add copyright and short description.
-
- * po-mode.el: Last version for 0.7.
-
- * tupdate.perl.in: Fix die message.
-
- * dcgettext.c: Protect include of string.h.
-
- * gettext.c: Protect include of stdlib.h and further tries to get NULL.
-
- * finddomain.c: Some corrections in includes.
-
- * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
-
- * po-to-tbl.sed: Adopt for new .po file format.
-
- * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
-
-Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware>
-
- * tupdate.perl.in: Complete rewrite for new .po file format.
-
-Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware>
-
- * First official release. This directory contains all the code
- needed to internationalize own packages. It provides functions
- which allow to use the X/Open catgets function with an interface
- like the Uniforum gettext function. For system which does not
- have neither of those a complete implementation is provided.
diff --git a/contrib/texinfo/intl/Makefile.in b/contrib/texinfo/intl/Makefile.in
deleted file mode 100644
index a41fb5796b04..000000000000
--- a/contrib/texinfo/intl/Makefile.in
+++ /dev/null
@@ -1,214 +0,0 @@
-# Makefile for directory with message catalog handling in GNU NLS Utilities.
-# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-transform = @program_transform_name@
-libdir = $(exec_prefix)/lib
-includedir = $(prefix)/include
-datadir = $(prefix)/@DATADIRNAME@
-localedir = $(datadir)/locale
-gnulocaledir = $(prefix)/share/locale
-gettextsrcdir = @datadir@/gettext/intl
-aliaspath = $(localedir):.
-subdir = intl
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-
-l = @l@
-
-AR = ar
-CC = @CC@
-LIBTOOL = @LIBTOOL@
-RANLIB = @RANLIB@
-
-DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
--DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
-CPPFLAGS = @CPPFLAGS@
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-HEADERS = $(COMHDRS) libgettext.h loadinfo.h
-COMHDRS = gettext.h gettextP.h hash-string.h
-SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
-COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
-finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
-explodename.c
-OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
-finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
-explodename.$lo
-CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
-GETTOBJS = intl-compat.$lo
-DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
-xopen-msg.sed $(HEADERS) $(SOURCES)
-DISTFILES.normal = VERSION
-DISTFILES.gettext = libintl.glibc intlh.inst.in
-
-.SUFFIXES:
-.SUFFIXES: .c .o .lo
-.c.o:
- $(COMPILE) $<
-.c.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) $<
-
-INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib
-
-all: all-@USE_INCLUDED_LIBINTL@
-
-all-yes: libintl.$la intlh.inst
-all-no:
-
-libintl.a: $(OBJECTS)
- rm -f $@
- $(AR) cru $@ $(OBJECTS)
- $(RANLIB) $@
-
-libintl.la: $(OBJECTS)
- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
- -version-info 1:0 -rpath $(libdir)
-
-../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
- cd ../po && $(MAKE) cat-id-tbl.$lo
-
-check: all
-
-# This installation goal is only used in GNU gettext. Packages which
-# only use the library should use install instead.
-
-# We must not install the libintl.h/libintl.a files if we are on a
-# system which has the gettext() function in its C library or in a
-# separate library or use the catgets interface. A special case is
-# where configure found a previously installed GNU gettext library.
-# If you want to use the one which comes with this version of the
-# package, you have to use `configure --with-included-gettext'.
-install: install-exec install-data
-install-exec: all
- if test "$(PACKAGE)" = "gettext" \
- && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(libdir) $(includedir); \
- else \
- $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
- fi; \
- $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
- $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
- else \
- : ; \
- fi
-install-data: all
- if test "$(PACKAGE)" = "gettext"; then \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(gettextsrcdir); \
- else \
- $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
- dists="$(DISTFILES.common)"; \
- for file in $$dists; do \
- $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
- done; \
- else \
- : ; \
- fi
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- dists="$(DISTFILES.common)"; \
- for file in $$dists; do \
- rm -f $(gettextsrcdir)/$$file; \
- done
-
-info dvi:
-
-$(OBJECTS): ../config.h libgettext.h
-bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
-dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
-
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES)
- here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
-
-id: ID
-
-ID: $(HEADERS) $(SOURCES)
- here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
-
-
-mostlyclean:
- rm -f *.a *.o *.lo core core.*
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-
-# GNU gettext needs not contain the file `VERSION' but contains some
-# other files which should not be distributed in other packages.
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: Makefile $(DISTFILES)
- if test "$(PACKAGE)" = gettext; then \
- additional="$(DISTFILES.gettext)"; \
- else \
- additional="$(DISTFILES.normal)"; \
- fi; \
- for file in $(DISTFILES.common) $$additional; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
- done
-
-dist-libc:
- tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
-
-Makefile: Makefile.in ../config.status
- cd .. \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-# The dependency for intlh.inst is different in gettext and all other
-# packages. Because we cannot you GNU make features we have to solve
-# the problem while rewriting Makefile.in.
-@GT_YES@intlh.inst: intlh.inst.in ../config.status
-@GT_YES@ cd .. \
-@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
-@GT_YES@ $(SHELL) ./config.status
-@GT_NO@.PHONY: intlh.inst
-@GT_NO@intlh.inst:
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/contrib/texinfo/intl/VERSION b/contrib/texinfo/intl/VERSION
deleted file mode 100644
index d31950a61d6c..000000000000
--- a/contrib/texinfo/intl/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-GNU gettext library from gettext-0.10.32
diff --git a/contrib/texinfo/intl/bindtextdom.c b/contrib/texinfo/intl/bindtextdom.c
deleted file mode 100644
index 9fcb8d9f29b1..000000000000
--- a/contrib/texinfo/intl/bindtextdom.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Implementation of the bindtextdomain(3) function
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-#include "gettext.h"
-#include "gettextP.h"
-
-/* @@ end of prolog @@ */
-
-/* Contains the default location of the message catalogs. */
-extern const char _nl_default_dirname[];
-
-/* List with bindings of specific domains. */
-extern struct binding *_nl_domain_bindings;
-
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define BINDTEXTDOMAIN __bindtextdomain
-# define strdup(str) __strdup (str)
-#else
-# define BINDTEXTDOMAIN bindtextdomain__
-#endif
-
-/* Specify that the DOMAINNAME message catalog will be found
- in DIRNAME rather than in the system locale data base. */
-char *
-BINDTEXTDOMAIN (domainname, dirname)
- const char *domainname;
- const char *dirname;
-{
- struct binding *binding;
-
- /* Some sanity checks. */
- if (domainname == NULL || domainname[0] == '\0')
- return NULL;
-
- for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
- {
- int compare = strcmp (domainname, binding->domainname);
- if (compare == 0)
- /* We found it! */
- break;
- if (compare < 0)
- {
- /* It is not in the list. */
- binding = NULL;
- break;
- }
- }
-
- if (dirname == NULL)
- /* The current binding has be to returned. */
- return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
-
- if (binding != NULL)
- {
- /* The domain is already bound. If the new value and the old
- one are equal we simply do nothing. Otherwise replace the
- old binding. */
- if (strcmp (dirname, binding->dirname) != 0)
- {
- char *new_dirname;
-
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_dirname = (char *) _nl_default_dirname;
- else
- {
-#if defined _LIBC || defined HAVE_STRDUP
- new_dirname = strdup (dirname);
- if (new_dirname == NULL)
- return NULL;
-#else
- size_t len = strlen (dirname) + 1;
- new_dirname = (char *) malloc (len);
- if (new_dirname == NULL)
- return NULL;
-
- memcpy (new_dirname, dirname, len);
-#endif
- }
-
- if (binding->dirname != _nl_default_dirname)
- free (binding->dirname);
-
- binding->dirname = new_dirname;
- }
- }
- else
- {
- /* We have to create a new binding. */
- size_t len;
- struct binding *new_binding =
- (struct binding *) malloc (sizeof (*new_binding));
-
- if (new_binding == NULL)
- return NULL;
-
-#if defined _LIBC || defined HAVE_STRDUP
- new_binding->domainname = strdup (domainname);
- if (new_binding->domainname == NULL)
- return NULL;
-#else
- len = strlen (domainname) + 1;
- new_binding->domainname = (char *) malloc (len);
- if (new_binding->domainname == NULL)
- return NULL;
- memcpy (new_binding->domainname, domainname, len);
-#endif
-
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_binding->dirname = (char *) _nl_default_dirname;
- else
- {
-#if defined _LIBC || defined HAVE_STRDUP
- new_binding->dirname = strdup (dirname);
- if (new_binding->dirname == NULL)
- return NULL;
-#else
- len = strlen (dirname) + 1;
- new_binding->dirname = (char *) malloc (len);
- if (new_binding->dirname == NULL)
- return NULL;
- memcpy (new_binding->dirname, dirname, len);
-#endif
- }
-
- /* Now enqueue it. */
- if (_nl_domain_bindings == NULL
- || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
- {
- new_binding->next = _nl_domain_bindings;
- _nl_domain_bindings = new_binding;
- }
- else
- {
- binding = _nl_domain_bindings;
- while (binding->next != NULL
- && strcmp (domainname, binding->next->domainname) > 0)
- binding = binding->next;
-
- new_binding->next = binding->next;
- binding->next = new_binding;
- }
-
- binding = new_binding;
- }
-
- return binding->dirname;
-}
-
-#ifdef _LIBC
-/* Alias for function name in GNU C Library. */
-weak_alias (__bindtextdomain, bindtextdomain);
-#endif
diff --git a/contrib/texinfo/intl/cat-compat.c b/contrib/texinfo/intl/cat-compat.c
deleted file mode 100644
index 867d901b8ffc..000000000000
--- a/contrib/texinfo/intl/cat-compat.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* Compatibility code for gettext-using-catgets interface.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# endif
-#endif
-
-#ifdef HAVE_NL_TYPES_H
-# include <nl_types.h>
-#endif
-
-#include "libgettext.h"
-
-/* @@ end of prolog @@ */
-
-/* XPG3 defines the result of `setlocale (category, NULL)' as:
- ``Directs `setlocale()' to query `category' and return the current
- setting of `local'.''
- However it does not specify the exact format. And even worse: POSIX
- defines this not at all. So we can use this feature only on selected
- system (e.g. those using GNU C Library). */
-#ifdef _LIBC
-# define HAVE_LOCALE_NULL
-#endif
-
-/* The catalog descriptor. */
-static nl_catd catalog = (nl_catd) -1;
-
-/* Name of the default catalog. */
-static const char default_catalog_name[] = "messages";
-
-/* Name of currently used catalog. */
-static const char *catalog_name = default_catalog_name;
-
-/* Get ID for given string. If not found return -1. */
-static int msg_to_cat_id PARAMS ((const char *msg));
-
-/* Substitution for systems lacking this function in their C library. */
-#if !_LIBC && !HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
-#endif
-
-
-/* Set currently used domain/catalog. */
-char *
-textdomain (domainname)
- const char *domainname;
-{
- nl_catd new_catalog;
- char *new_name;
- size_t new_name_len;
- char *lang;
-
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
- && defined HAVE_LOCALE_NULL
- lang = setlocale (LC_MESSAGES, NULL);
-#else
- lang = getenv ("LC_ALL");
- if (lang == NULL || lang[0] == '\0')
- {
- lang = getenv ("LC_MESSAGES");
- if (lang == NULL || lang[0] == '\0')
- lang = getenv ("LANG");
- }
-#endif
- if (lang == NULL || lang[0] == '\0')
- lang = "C";
-
- /* See whether name of currently used domain is asked. */
- if (domainname == NULL)
- return (char *) catalog_name;
-
- if (domainname[0] == '\0')
- domainname = default_catalog_name;
-
- /* Compute length of added path element. */
- new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
- + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
- + sizeof (".cat");
-
- new_name = (char *) malloc (new_name_len);
- if (new_name == NULL)
- return NULL;
-
- strcpy (new_name, PACKAGE);
- new_catalog = catopen (new_name, 0);
-
- if (new_catalog == (nl_catd) -1)
- {
- /* NLSPATH search didn't work, try absolute path */
- sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
- PACKAGE);
- new_catalog = catopen (new_name, 0);
-
- if (new_catalog == (nl_catd) -1)
- {
- free (new_name);
- return (char *) catalog_name;
- }
- }
-
- /* Close old catalog. */
- if (catalog != (nl_catd) -1)
- catclose (catalog);
- if (catalog_name != default_catalog_name)
- free ((char *) catalog_name);
-
- catalog = new_catalog;
- catalog_name = new_name;
-
- return (char *) catalog_name;
-}
-
-char *
-bindtextdomain (domainname, dirname)
- const char *domainname;
- const char *dirname;
-{
-#if HAVE_SETENV || HAVE_PUTENV
- char *old_val, *new_val, *cp;
- size_t new_val_len;
-
- /* This does not make much sense here but to be compatible do it. */
- if (domainname == NULL)
- return NULL;
-
- /* Compute length of added path element. If we use setenv we don't need
- the first byts for NLSPATH=, but why complicate the code for this
- peanuts. */
- new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
- + sizeof ("/%L/LC_MESSAGES/%N.cat");
-
- old_val = getenv ("NLSPATH");
- if (old_val == NULL || old_val[0] == '\0')
- {
- old_val = NULL;
- new_val_len += 1 + sizeof (LOCALEDIR) - 1
- + sizeof ("/%L/LC_MESSAGES/%N.cat");
- }
- else
- new_val_len += strlen (old_val);
-
- new_val = (char *) malloc (new_val_len);
- if (new_val == NULL)
- return NULL;
-
-# if HAVE_SETENV
- cp = new_val;
-# else
- cp = stpcpy (new_val, "NLSPATH=");
-# endif
-
- cp = stpcpy (cp, dirname);
- cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
-
- if (old_val == NULL)
- {
-# if __STDC__
- stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
-# else
-
- cp = stpcpy (cp, LOCALEDIR);
- stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
-# endif
- }
- else
- stpcpy (cp, old_val);
-
-# if HAVE_SETENV
- setenv ("NLSPATH", new_val, 1);
- free (new_val);
-# else
- putenv (new_val);
- /* Do *not* free the environment entry we just entered. It is used
- from now on. */
-# endif
-
-#endif
-
- return (char *) domainname;
-}
-
-#undef gettext
-char *
-gettext (msg)
- const char *msg;
-{
- int msgid;
-
- if (msg == NULL || catalog == (nl_catd) -1)
- return (char *) msg;
-
- /* Get the message from the catalog. We always use set number 1.
- The message ID is computed by the function `msg_to_cat_id'
- which works on the table generated by `po-to-tbl'. */
- msgid = msg_to_cat_id (msg);
- if (msgid == -1)
- return (char *) msg;
-
- return catgets (catalog, 1, msgid, (char *) msg);
-}
-
-/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
- for the one equal to msg. If it is found return the ID. In case when
- the string is not found return -1. */
-static int
-msg_to_cat_id (msg)
- const char *msg;
-{
- int cnt;
-
- for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
- if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
- return _msg_tbl[cnt]._msg_number;
-
- return -1;
-}
-
-
-/* @@ begin of epilog @@ */
-
-/* We don't want libintl.a to depend on any other library. So we
- avoid the non-standard function stpcpy. In GNU C Library this
- function is available, though. Also allow the symbol HAVE_STPCPY
- to be defined. */
-#if !_LIBC && !HAVE_STPCPY
-static char *
-stpcpy (dest, src)
- char *dest;
- const char *src;
-{
- while ((*dest++ = *src++) != '\0')
- /* Do nothing. */ ;
- return dest - 1;
-}
-#endif
diff --git a/contrib/texinfo/intl/dcgettext.c b/contrib/texinfo/intl/dcgettext.c
deleted file mode 100644
index a316bfd10863..000000000000
--- a/contrib/texinfo/intl/dcgettext.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/* Implementation of the dcgettext(3) function
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-# define HAVE_ALLOCA 1
-#else
-# if defined HAVE_ALLOCA_H || defined _LIBC
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-#ifndef __set_errno
-# define __set_errno(val) errno = (val)
-#endif
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-#endif
-
-#include "gettext.h"
-#include "gettextP.h"
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-#include "hash-string.h"
-
-/* @@ end of prolog @@ */
-
-#ifdef _LIBC
-/* Rename the non ANSI C functions. This is required by the standard
- because some ANSI C functions will require linking with this object
- file and the name space must not be polluted. */
-# define getcwd __getcwd
-# define stpcpy __stpcpy
-#else
-# if !defined HAVE_GETCWD
-char *getwd ();
-# define getcwd(buf, max) getwd (buf)
-# else
-char *getcwd ();
-# endif
-# ifndef HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
-# endif
-#endif
-
-/* Amount to increase buffer size by in each try. */
-#define PATH_INCR 32
-
-/* The following is from pathmax.h. */
-/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
- PATH_MAX but might cause redefinition warnings when sys/param.h is
- later included (as on MORE/BSD 4.3). */
-#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
-# include <limits.h>
-#endif
-
-#ifndef _POSIX_PATH_MAX
-# define _POSIX_PATH_MAX 255
-#endif
-
-#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
-# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
-#endif
-
-/* Don't include sys/param.h if it already has been. */
-#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
-# include <sys/param.h>
-#endif
-
-#if !defined(PATH_MAX) && defined(MAXPATHLEN)
-# define PATH_MAX MAXPATHLEN
-#endif
-
-#ifndef PATH_MAX
-# define PATH_MAX _POSIX_PATH_MAX
-#endif
-
-/* XPG3 defines the result of `setlocale (category, NULL)' as:
- ``Directs `setlocale()' to query `category' and return the current
- setting of `local'.''
- However it does not specify the exact format. And even worse: POSIX
- defines this not at all. So we can use this feature only on selected
- system (e.g. those using GNU C Library). */
-#ifdef _LIBC
-# define HAVE_LOCALE_NULL
-#endif
-
-/* Name of the default domain used for gettext(3) prior any call to
- textdomain(3). The default value for this is "messages". */
-const char _nl_default_default_domain[] = "messages";
-
-/* Value used as the default domain for gettext(3). */
-const char *_nl_current_default_domain = _nl_default_default_domain;
-
-/* Contains the default location of the message catalogs. */
-const char _nl_default_dirname[] = GNULOCALEDIR;
-
-/* List with bindings of specific domains created by bindtextdomain()
- calls. */
-struct binding *_nl_domain_bindings;
-
-/* Prototypes for local functions. */
-static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
- const char *msgid));
-static const char *category_to_name PARAMS ((int category));
-static const char *guess_category_value PARAMS ((int category,
- const char *categoryname));
-
-
-/* For those loosing systems which don't have `alloca' we have to add
- some additional code emulating it. */
-#ifdef HAVE_ALLOCA
-/* Nothing has to be done. */
-# define ADD_BLOCK(list, address) /* nothing */
-# define FREE_BLOCKS(list) /* nothing */
-#else
-struct block_list
-{
- void *address;
- struct block_list *next;
-};
-# define ADD_BLOCK(list, addr) \
- do { \
- struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
- /* If we cannot get a free block we cannot add the new element to \
- the list. */ \
- if (newp != NULL) { \
- newp->address = (addr); \
- newp->next = (list); \
- (list) = newp; \
- } \
- } while (0)
-# define FREE_BLOCKS(list) \
- do { \
- while (list != NULL) { \
- struct block_list *old = list; \
- list = list->next; \
- free (old); \
- } \
- } while (0)
-# undef alloca
-# define alloca(size) (malloc (size))
-#endif /* have alloca */
-
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define DCGETTEXT __dcgettext
-#else
-# define DCGETTEXT dcgettext__
-#endif
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
- locale. */
-char *
-DCGETTEXT (domainname, msgid, category)
- const char *domainname;
- const char *msgid;
- int category;
-{
-#ifndef HAVE_ALLOCA
- struct block_list *block_list = NULL;
-#endif
- struct loaded_l10nfile *domain;
- struct binding *binding;
- const char *categoryname;
- const char *categoryvalue;
- char *dirname, *xdomainname;
- char *single_locale;
- char *retval;
- int saved_errno = errno;
-
- /* If no real MSGID is given return NULL. */
- if (msgid == NULL)
- return NULL;
-
- /* If DOMAINNAME is NULL, we are interested in the default domain. If
- CATEGORY is not LC_MESSAGES this might not make much sense but the
- defintion left this undefined. */
- if (domainname == NULL)
- domainname = _nl_current_default_domain;
-
- /* First find matching binding. */
- for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
- {
- int compare = strcmp (domainname, binding->domainname);
- if (compare == 0)
- /* We found it! */
- break;
- if (compare < 0)
- {
- /* It is not in the list. */
- binding = NULL;
- break;
- }
- }
-
- if (binding == NULL)
- dirname = (char *) _nl_default_dirname;
- else if (binding->dirname[0] == '/')
- dirname = binding->dirname;
- else
- {
- /* We have a relative path. Make it absolute now. */
- size_t dirname_len = strlen (binding->dirname) + 1;
- size_t path_max;
- char *ret;
-
- path_max = (unsigned) PATH_MAX;
- path_max += 2; /* The getcwd docs say to do this. */
-
- dirname = (char *) alloca (path_max + dirname_len);
- ADD_BLOCK (block_list, dirname);
-
- __set_errno (0);
- while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
- {
- path_max += PATH_INCR;
- dirname = (char *) alloca (path_max + dirname_len);
- ADD_BLOCK (block_list, dirname);
- __set_errno (0);
- }
-
- if (ret == NULL)
- {
- /* We cannot get the current working directory. Don't signal an
- error but simply return the default string. */
- FREE_BLOCKS (block_list);
- __set_errno (saved_errno);
- return (char *) msgid;
- }
-
- stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
- }
-
- /* Now determine the symbolic name of CATEGORY and its value. */
- categoryname = category_to_name (category);
- categoryvalue = guess_category_value (category, categoryname);
-
- xdomainname = (char *) alloca (strlen (categoryname)
- + strlen (domainname) + 5);
- ADD_BLOCK (block_list, xdomainname);
-
- stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
- domainname),
- ".mo");
-
- /* Creating working area. */
- single_locale = (char *) alloca (strlen (categoryvalue) + 1);
- ADD_BLOCK (block_list, single_locale);
-
-
- /* Search for the given string. This is a loop because we perhaps
- got an ordered list of languages to consider for th translation. */
- while (1)
- {
- /* Make CATEGORYVALUE point to the next element of the list. */
- while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
- ++categoryvalue;
- if (categoryvalue[0] == '\0')
- {
- /* The whole contents of CATEGORYVALUE has been searched but
- no valid entry has been found. We solve this situation
- by implicitly appending a "C" entry, i.e. no translation
- will take place. */
- single_locale[0] = 'C';
- single_locale[1] = '\0';
- }
- else
- {
- char *cp = single_locale;
- while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
- *cp++ = *categoryvalue++;
- *cp = '\0';
- }
-
- /* If the current locale value is C (or POSIX) we don't load a
- domain. Return the MSGID. */
- if (strcmp (single_locale, "C") == 0
- || strcmp (single_locale, "POSIX") == 0)
- {
- FREE_BLOCKS (block_list);
- __set_errno (saved_errno);
- return (char *) msgid;
- }
-
-
- /* Find structure describing the message catalog matching the
- DOMAINNAME and CATEGORY. */
- domain = _nl_find_domain (dirname, single_locale, xdomainname);
-
- if (domain != NULL)
- {
- retval = find_msg (domain, msgid);
-
- if (retval == NULL)
- {
- int cnt;
-
- for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
- {
- retval = find_msg (domain->successor[cnt], msgid);
-
- if (retval != NULL)
- break;
- }
- }
-
- if (retval != NULL)
- {
- FREE_BLOCKS (block_list);
- __set_errno (saved_errno);
- return retval;
- }
- }
- }
- /* NOTREACHED */
-}
-
-#ifdef _LIBC
-/* Alias for function name in GNU C Library. */
-weak_alias (__dcgettext, dcgettext);
-#endif
-
-
-static char *
-find_msg (domain_file, msgid)
- struct loaded_l10nfile *domain_file;
- const char *msgid;
-{
- size_t top, act, bottom;
- struct loaded_domain *domain;
-
- if (domain_file->decided == 0)
- _nl_load_domain (domain_file);
-
- if (domain_file->data == NULL)
- return NULL;
-
- domain = (struct loaded_domain *) domain_file->data;
-
- /* Locate the MSGID and its translation. */
- if (domain->hash_size > 2 && domain->hash_tab != NULL)
- {
- /* Use the hashing table. */
- nls_uint32 len = strlen (msgid);
- nls_uint32 hash_val = hash_string (msgid);
- nls_uint32 idx = hash_val % domain->hash_size;
- nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
- nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
-
- if (nstr == 0)
- /* Hash table entry is empty. */
- return NULL;
-
- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
- && strcmp (msgid,
- domain->data + W (domain->must_swap,
- domain->orig_tab[nstr - 1].offset)) == 0)
- return (char *) domain->data + W (domain->must_swap,
- domain->trans_tab[nstr - 1].offset);
-
- while (1)
- {
- if (idx >= domain->hash_size - incr)
- idx -= domain->hash_size - incr;
- else
- idx += incr;
-
- nstr = W (domain->must_swap, domain->hash_tab[idx]);
- if (nstr == 0)
- /* Hash table entry is empty. */
- return NULL;
-
- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
- && strcmp (msgid,
- domain->data + W (domain->must_swap,
- domain->orig_tab[nstr - 1].offset))
- == 0)
- return (char *) domain->data
- + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
- }
- /* NOTREACHED */
- }
-
- /* Now we try the default method: binary search in the sorted
- array of messages. */
- bottom = 0;
- top = domain->nstrings;
- while (bottom < top)
- {
- int cmp_val;
-
- act = (bottom + top) / 2;
- cmp_val = strcmp (msgid, domain->data
- + W (domain->must_swap,
- domain->orig_tab[act].offset));
- if (cmp_val < 0)
- top = act;
- else if (cmp_val > 0)
- bottom = act + 1;
- else
- break;
- }
-
- /* If an translation is found return this. */
- return bottom >= top ? NULL : (char *) domain->data
- + W (domain->must_swap,
- domain->trans_tab[act].offset);
-}
-
-
-/* Return string representation of locale CATEGORY. */
-static const char *
-category_to_name (category)
- int category;
-{
- const char *retval;
-
- switch (category)
- {
-#ifdef LC_COLLATE
- case LC_COLLATE:
- retval = "LC_COLLATE";
- break;
-#endif
-#ifdef LC_CTYPE
- case LC_CTYPE:
- retval = "LC_CTYPE";
- break;
-#endif
-#ifdef LC_MONETARY
- case LC_MONETARY:
- retval = "LC_MONETARY";
- break;
-#endif
-#ifdef LC_NUMERIC
- case LC_NUMERIC:
- retval = "LC_NUMERIC";
- break;
-#endif
-#ifdef LC_TIME
- case LC_TIME:
- retval = "LC_TIME";
- break;
-#endif
-#ifdef LC_MESSAGES
- case LC_MESSAGES:
- retval = "LC_MESSAGES";
- break;
-#endif
-#ifdef LC_RESPONSE
- case LC_RESPONSE:
- retval = "LC_RESPONSE";
- break;
-#endif
-#ifdef LC_ALL
- case LC_ALL:
- /* This might not make sense but is perhaps better than any other
- value. */
- retval = "LC_ALL";
- break;
-#endif
- default:
- /* If you have a better idea for a default value let me know. */
- retval = "LC_XXX";
- }
-
- return retval;
-}
-
-/* Guess value of current locale from value of the environment variables. */
-static const char *
-guess_category_value (category, categoryname)
- int category;
- const char *categoryname;
-{
- const char *retval;
-
- /* The highest priority value is the `LANGUAGE' environment
- variable. This is a GNU extension. */
- retval = getenv ("LANGUAGE");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* `LANGUAGE' is not set. So we have to proceed with the POSIX
- methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some
- systems this can be done by the `setlocale' function itself. */
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
- return setlocale (category, NULL);
-#else
- /* Setting of LC_ALL overwrites all other. */
- retval = getenv ("LC_ALL");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* Next comes the name of the desired category. */
- retval = getenv (categoryname);
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* Last possibility is the LANG environment variable. */
- retval = getenv ("LANG");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* We use C as the default domain. POSIX says this is implementation
- defined. */
- return "C";
-#endif
-}
-
-/* @@ begin of epilog @@ */
-
-/* We don't want libintl.a to depend on any other library. So we
- avoid the non-standard function stpcpy. In GNU C Library this
- function is available, though. Also allow the symbol HAVE_STPCPY
- to be defined. */
-#if !_LIBC && !HAVE_STPCPY
-static char *
-stpcpy (dest, src)
- char *dest;
- const char *src;
-{
- while ((*dest++ = *src++) != '\0')
- /* Do nothing. */ ;
- return dest - 1;
-}
-#endif
diff --git a/contrib/texinfo/intl/dgettext.c b/contrib/texinfo/intl/dgettext.c
deleted file mode 100644
index 2fde6770f791..000000000000
--- a/contrib/texinfo/intl/dgettext.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* dgettext.c -- implementation of the dgettext(3) function
- Copyright (C) 1995 Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined HAVE_LOCALE_H || defined _LIBC
-# include <locale.h>
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-
-/* @@ end of prolog @@ */
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define DGETTEXT __dgettext
-# define DCGETTEXT __dcgettext
-#else
-# define DGETTEXT dgettext__
-# define DCGETTEXT dcgettext__
-#endif
-
-/* Look up MSGID in the DOMAINNAME message catalog of the current
- LC_MESSAGES locale. */
-char *
-DGETTEXT (domainname, msgid)
- const char *domainname;
- const char *msgid;
-{
- return DCGETTEXT (domainname, msgid, LC_MESSAGES);
-}
-
-#ifdef _LIBC
-/* Alias for function name in GNU C Library. */
-weak_alias (__dgettext, dgettext);
-#endif
diff --git a/contrib/texinfo/intl/explodename.c b/contrib/texinfo/intl/explodename.c
deleted file mode 100644
index 37c46e9d7b85..000000000000
--- a/contrib/texinfo/intl/explodename.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include "loadinfo.h"
-
-/* On some strange systems still no definition of NULL is found. Sigh! */
-#ifndef NULL
-# if defined __STDC__ && __STDC__
-# define NULL ((void *) 0)
-# else
-# define NULL 0
-# endif
-#endif
-
-/* @@ end of prolog @@ */
-
-int
-_nl_explode_name (name, language, modifier, territory, codeset,
- normalized_codeset, special, sponsor, revision)
- char *name;
- const char **language;
- const char **modifier;
- const char **territory;
- const char **codeset;
- const char **normalized_codeset;
- const char **special;
- const char **sponsor;
- const char **revision;
-{
- enum { undecided, xpg, cen } syntax;
- char *cp;
- int mask;
-
- *modifier = NULL;
- *territory = NULL;
- *codeset = NULL;
- *normalized_codeset = NULL;
- *special = NULL;
- *sponsor = NULL;
- *revision = NULL;
-
- /* Now we determine the single parts of the locale name. First
- look for the language. Termination symbols are `_' and `@' if
- we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
- mask = 0;
- syntax = undecided;
- *language = cp = name;
- while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
- && cp[0] != '+' && cp[0] != ',')
- ++cp;
-
- if (*language == cp)
- /* This does not make sense: language has to be specified. Use
- this entry as it is without exploding. Perhaps it is an alias. */
- cp = strchr (*language, '\0');
- else if (cp[0] == '_')
- {
- /* Next is the territory. */
- cp[0] = '\0';
- *territory = ++cp;
-
- while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
- && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
- ++cp;
-
- mask |= TERRITORY;
-
- if (cp[0] == '.')
- {
- /* Next is the codeset. */
- syntax = xpg;
- cp[0] = '\0';
- *codeset = ++cp;
-
- while (cp[0] != '\0' && cp[0] != '@')
- ++cp;
-
- mask |= XPG_CODESET;
-
- if (*codeset != cp && (*codeset)[0] != '\0')
- {
- *normalized_codeset = _nl_normalize_codeset (*codeset,
- cp - *codeset);
- if (strcmp (*codeset, *normalized_codeset) == 0)
- free ((char *) *normalized_codeset);
- else
- mask |= XPG_NORM_CODESET;
- }
- }
- }
-
- if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
- {
- /* Next is the modifier. */
- syntax = cp[0] == '@' ? xpg : cen;
- cp[0] = '\0';
- *modifier = ++cp;
-
- while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
- && cp[0] != ',' && cp[0] != '_')
- ++cp;
-
- mask |= XPG_MODIFIER | CEN_AUDIENCE;
- }
-
- if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
- {
- syntax = cen;
-
- if (cp[0] == '+')
- {
- /* Next is special application (CEN syntax). */
- cp[0] = '\0';
- *special = ++cp;
-
- while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
- ++cp;
-
- mask |= CEN_SPECIAL;
- }
-
- if (cp[0] == ',')
- {
- /* Next is sponsor (CEN syntax). */
- cp[0] = '\0';
- *sponsor = ++cp;
-
- while (cp[0] != '\0' && cp[0] != '_')
- ++cp;
-
- mask |= CEN_SPONSOR;
- }
-
- if (cp[0] == '_')
- {
- /* Next is revision (CEN syntax). */
- cp[0] = '\0';
- *revision = ++cp;
-
- mask |= CEN_REVISION;
- }
- }
-
- /* For CEN syntax values it might be important to have the
- separator character in the file name, not for XPG syntax. */
- if (syntax == xpg)
- {
- if (*territory != NULL && (*territory)[0] == '\0')
- mask &= ~TERRITORY;
-
- if (*codeset != NULL && (*codeset)[0] == '\0')
- mask &= ~XPG_CODESET;
-
- if (*modifier != NULL && (*modifier)[0] == '\0')
- mask &= ~XPG_MODIFIER;
- }
-
- return mask;
-}
diff --git a/contrib/texinfo/intl/finddomain.c b/contrib/texinfo/intl/finddomain.c
deleted file mode 100644
index ec85d4de4d12..000000000000
--- a/contrib/texinfo/intl/finddomain.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Handle list of needed message catalogs
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-#endif
-
-#include "gettext.h"
-#include "gettextP.h"
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-
-/* @@ end of prolog @@ */
-/* List of already loaded domains. */
-static struct loaded_l10nfile *_nl_loaded_domains;
-
-
-/* Return a data structure describing the message catalog described by
- the DOMAINNAME and CATEGORY parameters with respect to the currently
- established bindings. */
-struct loaded_l10nfile *
-_nl_find_domain (dirname, locale, domainname)
- const char *dirname;
- char *locale;
- const char *domainname;
-{
- struct loaded_l10nfile *retval;
- const char *language;
- const char *modifier;
- const char *territory;
- const char *codeset;
- const char *normalized_codeset;
- const char *special;
- const char *sponsor;
- const char *revision;
- const char *alias_value;
- int mask;
-
- /* LOCALE can consist of up to four recognized parts for the XPG syntax:
-
- language[_territory[.codeset]][@modifier]
-
- and six parts for the CEN syntax:
-
- language[_territory][+audience][+special][,[sponsor][_revision]]
-
- Beside the first all of them are allowed to be missing. If the
- full specified locale is not found, the less specific one are
- looked for. The various part will be stripped of according to
- the following order:
- (1) revision
- (2) sponsor
- (3) special
- (4) codeset
- (5) normalized codeset
- (6) territory
- (7) audience/modifier
- */
-
- /* If we have already tested for this locale entry there has to
- be one data set in the list of loaded domains. */
- retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
- strlen (dirname) + 1, 0, locale, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, domainname, 0);
- if (retval != NULL)
- {
- /* We know something about this locale. */
- int cnt;
-
- if (retval->decided == 0)
- _nl_load_domain (retval);
-
- if (retval->data != NULL)
- return retval;
-
- for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
- {
- if (retval->successor[cnt]->decided == 0)
- _nl_load_domain (retval->successor[cnt]);
-
- if (retval->successor[cnt]->data != NULL)
- break;
- }
- return cnt >= 0 ? retval : NULL;
- /* NOTREACHED */
- }
-
- /* See whether the locale value is an alias. If yes its value
- *overwrites* the alias name. No test for the original value is
- done. */
- alias_value = _nl_expand_alias (locale);
- if (alias_value != NULL)
- {
- size_t len = strlen (alias_value) + 1;
- locale = (char *) malloc (len);
- if (locale == NULL)
- return NULL;
-
- memcpy (locale, alias_value, len);
- }
-
- /* Now we determine the single parts of the locale name. First
- look for the language. Termination symbols are `_' and `@' if
- we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
- mask = _nl_explode_name (locale, &language, &modifier, &territory,
- &codeset, &normalized_codeset, &special,
- &sponsor, &revision);
-
- /* Create all possible locale entries which might be interested in
- generalization. */
- retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
- strlen (dirname) + 1, mask, language, territory,
- codeset, normalized_codeset, modifier, special,
- sponsor, revision, domainname, 1);
- if (retval == NULL)
- /* This means we are out of core. */
- return NULL;
-
- if (retval->decided == 0)
- _nl_load_domain (retval);
- if (retval->data == NULL)
- {
- int cnt;
- for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
- {
- if (retval->successor[cnt]->decided == 0)
- _nl_load_domain (retval->successor[cnt]);
- if (retval->successor[cnt]->data != NULL)
- break;
- }
- }
-
- /* The room for an alias was dynamically allocated. Free it now. */
- if (alias_value != NULL)
- free (locale);
-
- return retval;
-}
diff --git a/contrib/texinfo/intl/gettext.c b/contrib/texinfo/intl/gettext.c
deleted file mode 100644
index 1336d21e7c9b..000000000000
--- a/contrib/texinfo/intl/gettext.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Implementation of gettext(3) function
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# define __need_NULL
-# include <stddef.h>
-#else
-# ifdef STDC_HEADERS
-# include <stdlib.h> /* Just for NULL. */
-# else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# define NULL ((void *) 0)
-# endif
-# endif
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-
-/* @@ end of prolog @@ */
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define GETTEXT __gettext
-# define DGETTEXT __dgettext
-#else
-# define GETTEXT gettext__
-# define DGETTEXT dgettext__
-#endif
-
-/* Look up MSGID in the current default message catalog for the current
- LC_MESSAGES locale. If not found, returns MSGID itself (the default
- text). */
-char *
-GETTEXT (msgid)
- const char *msgid;
-{
- return DGETTEXT (NULL, msgid);
-}
-
-#ifdef _LIBC
-/* Alias for function name in GNU C Library. */
-weak_alias (__gettext, gettext);
-#endif
diff --git a/contrib/texinfo/intl/gettext.h b/contrib/texinfo/intl/gettext.h
deleted file mode 100644
index 6b4b9e3316cf..000000000000
--- a/contrib/texinfo/intl/gettext.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Internal header for GNU gettext internationalization functions
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _GETTEXT_H
-#define _GETTEXT_H 1
-
-#include <stdio.h>
-
-#if HAVE_LIMITS_H || _LIBC
-# include <limits.h>
-#endif
-
-/* @@ end of prolog @@ */
-
-/* The magic number of the GNU message catalog format. */
-#define _MAGIC 0x950412de
-#define _MAGIC_SWAPPED 0xde120495
-
-/* Revision number of the currently used .mo (binary) file format. */
-#define MO_REVISION_NUMBER 0
-
-/* The following contortions are an attempt to use the C preprocessor
- to determine an unsigned integral type that is 32 bits wide. An
- alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
- doing that would require that the configure script compile and *run*
- the resulting executable. Locally running cross-compiled executables
- is usually not possible. */
-
-#if __STDC__
-# define UINT_MAX_32_BITS 4294967295U
-#else
-# define UINT_MAX_32_BITS 0xFFFFFFFF
-#endif
-
-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
- This should be valid for all systems GNU cares about because
- that doesn't include 16-bit systems, and only modern systems
- (that certainly have <limits.h>) have 64+-bit integral types. */
-
-#ifndef UINT_MAX
-# define UINT_MAX UINT_MAX_32_BITS
-#endif
-
-#if UINT_MAX == UINT_MAX_32_BITS
-typedef unsigned nls_uint32;
-#else
-# if USHRT_MAX == UINT_MAX_32_BITS
-typedef unsigned short nls_uint32;
-# else
-# if ULONG_MAX == UINT_MAX_32_BITS
-typedef unsigned long nls_uint32;
-# else
- /* The following line is intended to throw an error. Using #error is
- not portable enough. */
- "Cannot determine unsigned 32-bit data type."
-# endif
-# endif
-#endif
-
-
-/* Header for binary .mo file format. */
-struct mo_file_header
-{
- /* The magic number. */
- nls_uint32 magic;
- /* The revision number of the file format. */
- nls_uint32 revision;
- /* The number of strings pairs. */
- nls_uint32 nstrings;
- /* Offset of table with start offsets of original strings. */
- nls_uint32 orig_tab_offset;
- /* Offset of table with start offsets of translation strings. */
- nls_uint32 trans_tab_offset;
- /* Size of hashing table. */
- nls_uint32 hash_tab_size;
- /* Offset of first hashing entry. */
- nls_uint32 hash_tab_offset;
-};
-
-struct string_desc
-{
- /* Length of addressed string. */
- nls_uint32 length;
- /* Offset of string in file. */
- nls_uint32 offset;
-};
-
-/* @@ begin of epilog @@ */
-
-#endif /* gettext.h */
diff --git a/contrib/texinfo/intl/gettextP.h b/contrib/texinfo/intl/gettextP.h
deleted file mode 100644
index bb8d55235adb..000000000000
--- a/contrib/texinfo/intl/gettextP.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Header describing internals of gettext library
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef _GETTEXTP_H
-#define _GETTEXTP_H
-
-#include "loadinfo.h"
-
-/* @@ end of prolog @@ */
-
-#ifndef PARAMS
-# if __STDC__
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-#ifndef W
-# define W(flag, data) ((flag) ? SWAP (data) : (data))
-#endif
-
-
-static nls_uint32 SWAP PARAMS ((nls_uint32 i));
-
-static inline nls_uint32
-SWAP (i)
- nls_uint32 i;
-{
- return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
-}
-
-
-struct loaded_domain
-{
- const char *data;
- int must_swap;
- nls_uint32 nstrings;
- struct string_desc *orig_tab;
- struct string_desc *trans_tab;
- nls_uint32 hash_size;
- nls_uint32 *hash_tab;
-};
-
-struct binding
-{
- struct binding *next;
- char *domainname;
- char *dirname;
-};
-
-struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
- char *__locale,
- const char *__domainname));
-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain));
-
-/* @@ begin of epilog @@ */
-
-#endif /* gettextP.h */
diff --git a/contrib/texinfo/intl/hash-string.h b/contrib/texinfo/intl/hash-string.h
deleted file mode 100644
index e66e8417a974..000000000000
--- a/contrib/texinfo/intl/hash-string.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Implements a string hashing function.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_VALUES_H
-# include <values.h>
-#endif
-
-/* @@ end of prolog @@ */
-
-#ifndef PARAMS
-# if __STDC__
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
-/* We assume to have `unsigned long int' value with at least 32 bits. */
-#define HASHWORDBITS 32
-
-
-/* Defines the so called `hashpjw' function by P.J. Weinberger
- [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
- 1986, 1987 Bell Telephone Laboratories, Inc.] */
-static unsigned long hash_string PARAMS ((const char *__str_param));
-
-static inline unsigned long
-hash_string (str_param)
- const char *str_param;
-{
- unsigned long int hval, g;
- const char *str = str_param;
-
- /* Compute the hash value for the given string. */
- hval = 0;
- while (*str != '\0')
- {
- hval <<= 4;
- hval += (unsigned long) *str++;
- g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
- if (g != 0)
- {
- hval ^= g >> (HASHWORDBITS - 8);
- hval ^= g;
- }
- }
- return hval;
-}
diff --git a/contrib/texinfo/intl/intl-compat.c b/contrib/texinfo/intl/intl-compat.c
deleted file mode 100644
index 503efa0fa9c5..000000000000
--- a/contrib/texinfo/intl/intl-compat.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
- Library.
- Copyright (C) 1995 Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "libgettext.h"
-
-/* @@ end of prolog @@ */
-
-
-#undef gettext
-#undef dgettext
-#undef dcgettext
-#undef textdomain
-#undef bindtextdomain
-
-
-char *
-bindtextdomain (domainname, dirname)
- const char *domainname;
- const char *dirname;
-{
- return bindtextdomain__ (domainname, dirname);
-}
-
-
-char *
-dcgettext (domainname, msgid, category)
- const char *domainname;
- const char *msgid;
- int category;
-{
- return dcgettext__ (domainname, msgid, category);
-}
-
-
-char *
-dgettext (domainname, msgid)
- const char *domainname;
- const char *msgid;
-{
- return dgettext__ (domainname, msgid);
-}
-
-
-char *
-gettext (msgid)
- const char *msgid;
-{
- return gettext__ (msgid);
-}
-
-
-char *
-textdomain (domainname)
- const char *domainname;
-{
- return textdomain__ (domainname);
-}
diff --git a/contrib/texinfo/intl/l10nflist.c b/contrib/texinfo/intl/l10nflist.c
deleted file mode 100644
index 4e2bc1309508..000000000000
--- a/contrib/texinfo/intl/l10nflist.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/* Handle list of needed message catalogs
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#if defined _LIBC || defined HAVE_ARGZ_H
-# include <argz.h>
-#endif
-#include <ctype.h>
-#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#include "loadinfo.h"
-
-/* On some strange systems still no definition of NULL is found. Sigh! */
-#ifndef NULL
-# if defined __STDC__ && __STDC__
-# define NULL ((void *) 0)
-# else
-# define NULL 0
-# endif
-#endif
-
-/* @@ end of prolog @@ */
-
-#ifdef _LIBC
-/* Rename the non ANSI C functions. This is required by the standard
- because some ANSI C functions will require linking with this object
- file and the name space must not be polluted. */
-# define stpcpy(dest, src) __stpcpy(dest, src)
-#else
-# ifndef HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
-# endif
-#endif
-
-/* Define function which are usually not available. */
-
-#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
-/* Returns the number of strings in ARGZ. */
-static size_t argz_count__ PARAMS ((const char *argz, size_t len));
-
-static size_t
-argz_count__ (argz, len)
- const char *argz;
- size_t len;
-{
- size_t count = 0;
- while (len > 0)
- {
- size_t part_len = strlen (argz);
- argz += part_len + 1;
- len -= part_len + 1;
- count++;
- }
- return count;
-}
-# undef __argz_count
-# define __argz_count(argz, len) argz_count__ (argz, len)
-#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
-
-#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
-/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
- except the last into the character SEP. */
-static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
-
-static void
-argz_stringify__ (argz, len, sep)
- char *argz;
- size_t len;
- int sep;
-{
- while (len > 0)
- {
- size_t part_len = strlen (argz);
- argz += part_len;
- len -= part_len + 1;
- if (len > 0)
- *argz++ = sep;
- }
-}
-# undef __argz_stringify
-# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
-#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
-
-#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
-static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
- const char *entry));
-
-static char *
-argz_next__ (argz, argz_len, entry)
- char *argz;
- size_t argz_len;
- const char *entry;
-{
- if (entry)
- {
- if (entry < argz + argz_len)
- entry = strchr (entry, '\0') + 1;
-
- return entry >= argz + argz_len ? NULL : (char *) entry;
- }
- else
- if (argz_len > 0)
- return argz;
- else
- return 0;
-}
-# undef __argz_next
-# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
-#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
-
-
-/* Return number of bits set in X. */
-static int pop PARAMS ((int x));
-
-static inline int
-pop (x)
- int x;
-{
- /* We assume that no more than 16 bits are used. */
- x = ((x & ~0x5555) >> 1) + (x & 0x5555);
- x = ((x & ~0x3333) >> 2) + (x & 0x3333);
- x = ((x >> 4) + x) & 0x0f0f;
- x = ((x >> 8) + x) & 0xff;
-
- return x;
-}
-
-
-struct loaded_l10nfile *
-_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
- territory, codeset, normalized_codeset, modifier, special,
- sponsor, revision, filename, do_allocate)
- struct loaded_l10nfile **l10nfile_list;
- const char *dirlist;
- size_t dirlist_len;
- int mask;
- const char *language;
- const char *territory;
- const char *codeset;
- const char *normalized_codeset;
- const char *modifier;
- const char *special;
- const char *sponsor;
- const char *revision;
- const char *filename;
- int do_allocate;
-{
- char *abs_filename;
- struct loaded_l10nfile *last = NULL;
- struct loaded_l10nfile *retval;
- char *cp;
- size_t entries;
- int cnt;
-
- /* Allocate room for the full file name. */
- abs_filename = (char *) malloc (dirlist_len
- + strlen (language)
- + ((mask & TERRITORY) != 0
- ? strlen (territory) + 1 : 0)
- + ((mask & XPG_CODESET) != 0
- ? strlen (codeset) + 1 : 0)
- + ((mask & XPG_NORM_CODESET) != 0
- ? strlen (normalized_codeset) + 1 : 0)
- + (((mask & XPG_MODIFIER) != 0
- || (mask & CEN_AUDIENCE) != 0)
- ? strlen (modifier) + 1 : 0)
- + ((mask & CEN_SPECIAL) != 0
- ? strlen (special) + 1 : 0)
- + (((mask & CEN_SPONSOR) != 0
- || (mask & CEN_REVISION) != 0)
- ? (1 + ((mask & CEN_SPONSOR) != 0
- ? strlen (sponsor) + 1 : 0)
- + ((mask & CEN_REVISION) != 0
- ? strlen (revision) + 1 : 0)) : 0)
- + 1 + strlen (filename) + 1);
-
- if (abs_filename == NULL)
- return NULL;
-
- retval = NULL;
- last = NULL;
-
- /* Construct file name. */
- memcpy (abs_filename, dirlist, dirlist_len);
- __argz_stringify (abs_filename, dirlist_len, ':');
- cp = abs_filename + (dirlist_len - 1);
- *cp++ = '/';
- cp = stpcpy (cp, language);
-
- if ((mask & TERRITORY) != 0)
- {
- *cp++ = '_';
- cp = stpcpy (cp, territory);
- }
- if ((mask & XPG_CODESET) != 0)
- {
- *cp++ = '.';
- cp = stpcpy (cp, codeset);
- }
- if ((mask & XPG_NORM_CODESET) != 0)
- {
- *cp++ = '.';
- cp = stpcpy (cp, normalized_codeset);
- }
- if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
- {
- /* This component can be part of both syntaces but has different
- leading characters. For CEN we use `+', else `@'. */
- *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
- cp = stpcpy (cp, modifier);
- }
- if ((mask & CEN_SPECIAL) != 0)
- {
- *cp++ = '+';
- cp = stpcpy (cp, special);
- }
- if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
- {
- *cp++ = ',';
- if ((mask & CEN_SPONSOR) != 0)
- cp = stpcpy (cp, sponsor);
- if ((mask & CEN_REVISION) != 0)
- {
- *cp++ = '_';
- cp = stpcpy (cp, revision);
- }
- }
-
- *cp++ = '/';
- stpcpy (cp, filename);
-
- /* Look in list of already loaded domains whether it is already
- available. */
- last = NULL;
- for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
- if (retval->filename != NULL)
- {
- int compare = strcmp (retval->filename, abs_filename);
- if (compare == 0)
- /* We found it! */
- break;
- if (compare < 0)
- {
- /* It's not in the list. */
- retval = NULL;
- break;
- }
-
- last = retval;
- }
-
- if (retval != NULL || do_allocate == 0)
- {
- free (abs_filename);
- return retval;
- }
-
- retval = (struct loaded_l10nfile *)
- malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
- * (1 << pop (mask))
- * sizeof (struct loaded_l10nfile *)));
- if (retval == NULL)
- return NULL;
-
- retval->filename = abs_filename;
- retval->decided = (__argz_count (dirlist, dirlist_len) != 1
- || ((mask & XPG_CODESET) != 0
- && (mask & XPG_NORM_CODESET) != 0));
- retval->data = NULL;
-
- if (last == NULL)
- {
- retval->next = *l10nfile_list;
- *l10nfile_list = retval;
- }
- else
- {
- retval->next = last->next;
- last->next = retval;
- }
-
- entries = 0;
- /* If the DIRLIST is a real list the RETVAL entry corresponds not to
- a real file. So we have to use the DIRLIST separation mechanism
- of the inner loop. */
- cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
- for (; cnt >= 0; --cnt)
- if ((cnt & ~mask) == 0
- && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
- && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
- {
- /* Iterate over all elements of the DIRLIST. */
- char *dir = NULL;
-
- while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
- != NULL)
- retval->successor[entries++]
- = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
- language, territory, codeset,
- normalized_codeset, modifier, special,
- sponsor, revision, filename, 1);
- }
- retval->successor[entries] = NULL;
-
- return retval;
-}
-
-/* Normalize codeset name. There is no standard for the codeset
- names. Normalization allows the user to use any of the common
- names. */
-const char *
-_nl_normalize_codeset (codeset, name_len)
- const char *codeset;
- size_t name_len;
-{
- int len = 0;
- int only_digit = 1;
- char *retval;
- char *wp;
- size_t cnt;
-
- for (cnt = 0; cnt < name_len; ++cnt)
- if (isalnum (codeset[cnt]))
- {
- ++len;
-
- if (isalpha (codeset[cnt]))
- only_digit = 0;
- }
-
- retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
-
- if (retval != NULL)
- {
- if (only_digit)
- wp = stpcpy (retval, "iso");
- else
- wp = retval;
-
- for (cnt = 0; cnt < name_len; ++cnt)
- if (isalpha (codeset[cnt]))
- *wp++ = tolower (codeset[cnt]);
- else if (isdigit (codeset[cnt]))
- *wp++ = codeset[cnt];
-
- *wp = '\0';
- }
-
- return (const char *) retval;
-}
-
-
-/* @@ begin of epilog @@ */
-
-/* We don't want libintl.a to depend on any other library. So we
- avoid the non-standard function stpcpy. In GNU C Library this
- function is available, though. Also allow the symbol HAVE_STPCPY
- to be defined. */
-#if !_LIBC && !HAVE_STPCPY
-static char *
-stpcpy (dest, src)
- char *dest;
- const char *src;
-{
- while ((*dest++ = *src++) != '\0')
- /* Do nothing. */ ;
- return dest - 1;
-}
-#endif
diff --git a/contrib/texinfo/intl/libgettext.h b/contrib/texinfo/intl/libgettext.h
deleted file mode 100644
index 0d4de4d0ee1e..000000000000
--- a/contrib/texinfo/intl/libgettext.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Message catalogs for internationalization.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Because on some systems (e.g. Solaris) we sometimes have to include
- the systems libintl.h as well as this file we have more complex
- include protection above. But the systems header might perhaps also
- define _LIBINTL_H and therefore we have to protect the definition here. */
-
-#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
-#if !defined (_LIBINTL_H)
-# define _LIBINTL_H 1
-#endif
-#define _LIBGETTEXT_H 1
-
-/* We define an additional symbol to signal that we use the GNU
- implementation of gettext. */
-#define __USE_GNU_GETTEXT 1
-
-#include <sys/types.h>
-
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* @@ end of prolog @@ */
-
-#ifndef PARAMS
-# if __STDC__
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-#ifndef NULL
-# if !defined __cplusplus || defined __GNUC__
-# define NULL ((void *) 0)
-# else
-# define NULL (0)
-# endif
-#endif
-
-#if !HAVE_LC_MESSAGES
-/* This value determines the behaviour of the gettext() and dgettext()
- function. But some system does not have this defined. Define it
- to a default value. */
-# define LC_MESSAGES (-1)
-#endif
-
-
-/* Declarations for gettext-using-catgets interface. Derived from
- Jim Meyering's libintl.h. */
-struct _msg_ent
-{
- const char *_msg;
- int _msg_number;
-};
-
-
-#if HAVE_CATGETS
-/* These two variables are defined in the automatically by po-to-tbl.sed
- generated file `cat-id-tbl.c'. */
-extern const struct _msg_ent _msg_tbl[];
-extern int _msg_tbl_length;
-#endif
-
-
-/* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result. */
-#define gettext_noop(Str) (Str)
-
-/* Look up MSGID in the current default message catalog for the current
- LC_MESSAGES locale. If not found, returns MSGID itself (the default
- text). */
-extern char *gettext PARAMS ((const char *__msgid));
-extern char *gettext__ PARAMS ((const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current
- LC_MESSAGES locale. */
-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
-extern char *dgettext__ PARAMS ((const char *__domainname,
- const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
- locale. */
-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
- int __category));
-extern char *dcgettext__ PARAMS ((const char *__domainname,
- const char *__msgid, int __category));
-
-
-/* Set the current default message catalog to DOMAINNAME.
- If DOMAINNAME is null, return the current default.
- If DOMAINNAME is "", reset to the default of "messages". */
-extern char *textdomain PARAMS ((const char *__domainname));
-extern char *textdomain__ PARAMS ((const char *__domainname));
-
-/* Specify that the DOMAINNAME message catalog will be found
- in DIRNAME rather than in the system locale data base. */
-extern char *bindtextdomain PARAMS ((const char *__domainname,
- const char *__dirname));
-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
- const char *__dirname));
-
-#if ENABLE_NLS
-
-/* Solaris 2.3 has the gettext function but dcgettext is missing.
- So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
- has dcgettext. */
-# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
-
-# define gettext(Msgid) \
- dgettext (NULL, Msgid)
-
-# define dgettext(Domainname, Msgid) \
- dcgettext (Domainname, Msgid, LC_MESSAGES)
-
-# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
-/* This global variable is defined in loadmsgcat.c. We need a sign,
- whether a new catalog was loaded, which can be associated with all
- translations. */
-extern int _nl_msg_cat_cntr;
-
-# define dcgettext(Domainname, Msgid, Category) \
- (__extension__ \
- ({ \
- char *__result; \
- if (__builtin_constant_p (Msgid)) \
- { \
- static char *__translation__; \
- static int __catalog_counter__; \
- if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
- { \
- __translation__ = \
- dcgettext__ (Domainname, Msgid, Category); \
- __catalog_counter__ = _nl_msg_cat_cntr; \
- } \
- __result = __translation__; \
- } \
- else \
- __result = dcgettext__ (Domainname, Msgid, Category); \
- __result; \
- }))
-# endif
-# endif
-
-#else
-
-# define gettext(Msgid) (Msgid)
-# define dgettext(Domainname, Msgid) (Msgid)
-# define dcgettext(Domainname, Msgid, Category) (Msgid)
-# define textdomain(Domainname) while (0) /* nothing */
-# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
-
-#endif
-
-/* @@ begin of epilog @@ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/contrib/texinfo/intl/linux-msg.sed b/contrib/texinfo/intl/linux-msg.sed
deleted file mode 100644
index 5918e720a9ad..000000000000
--- a/contrib/texinfo/intl/linux-msg.sed
+++ /dev/null
@@ -1,100 +0,0 @@
-# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# The first directive in the .msg should be the definition of the
-# message set number. We use always set number 1.
-#
-1 {
- i\
-$set 1 # Automatically created by po2msg.sed
- h
- s/.*/0/
- x
-}
-#
-# Mitch's old catalog format does not allow comments.
-#
-# We copy the original message as a comment into the .msg file.
-#
-/^msgid/ {
- s/msgid[ ]*"//
-#
-# This does not work now with the new format.
-# /"$/! {
-# s/\\$//
-# s/$/ ... (more lines following)"/
-# }
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
- G
- s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
-}
-#
-# The .msg file contains, other then the .po file, only the translations
-# but each given a unique ID. Starting from 1 and incrementing by 1 for
-# each message we assign them to the messages.
-# It is important that the .po file used to generate the cat-id-tbl.c file
-# (with po-to-tbl) is the same as the one used here. (At least the order
-# of declarations must not be changed.)
-#
-/^msgstr/ {
- s/msgstr[ ]*"\(.*\)"/# \1/
-# Clear substitution flag.
- tb
-# Append the next line.
- :b
- N
-# Look whether second part is continuation line.
- s/\(.*\n\)"\(.*\)"/\1\2/
-# Yes, then branch.
- ta
- P
- D
-# Note that D includes a jump to the start!!
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use D here.
- s/.*\n\(.*\)/\1/
- tb
-}
-d
diff --git a/contrib/texinfo/intl/loadinfo.h b/contrib/texinfo/intl/loadinfo.h
deleted file mode 100644
index c67c2eb2e8e3..000000000000
--- a/contrib/texinfo/intl/loadinfo.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PARAMS
-# if __STDC__
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-/* Encoding of locale name parts. */
-#define CEN_REVISION 1
-#define CEN_SPONSOR 2
-#define CEN_SPECIAL 4
-#define XPG_NORM_CODESET 8
-#define XPG_CODESET 16
-#define TERRITORY 32
-#define CEN_AUDIENCE 64
-#define XPG_MODIFIER 128
-
-#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
-#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
-
-
-struct loaded_l10nfile
-{
- const char *filename;
- int decided;
-
- const void *data;
-
- struct loaded_l10nfile *next;
- struct loaded_l10nfile *successor[1];
-};
-
-
-extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
- size_t name_len));
-
-extern struct loaded_l10nfile *
-_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
- const char *dirlist, size_t dirlist_len, int mask,
- const char *language, const char *territory,
- const char *codeset,
- const char *normalized_codeset,
- const char *modifier, const char *special,
- const char *sponsor, const char *revision,
- const char *filename, int do_allocate));
-
-
-extern const char *_nl_expand_alias PARAMS ((const char *name));
-
-extern int _nl_explode_name PARAMS ((char *name, const char **language,
- const char **modifier,
- const char **territory,
- const char **codeset,
- const char **normalized_codeset,
- const char **special,
- const char **sponsor,
- const char **revision));
diff --git a/contrib/texinfo/intl/loadmsgcat.c b/contrib/texinfo/intl/loadmsgcat.c
deleted file mode 100644
index 73e90a9190f7..000000000000
--- a/contrib/texinfo/intl/loadmsgcat.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Load needed message catalogs
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-#endif
-
-#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
-# include <sys/mman.h>
-#endif
-
-#include "gettext.h"
-#include "gettextP.h"
-
-/* @@ end of prolog @@ */
-
-#ifdef _LIBC
-/* Rename the non ISO C functions. This is required by the standard
- because some ISO C functions will require linking with this object
- file and the name space must not be polluted. */
-# define fstat __fstat
-# define open __open
-# define close __close
-# define read __read
-# define mmap __mmap
-# define munmap __munmap
-#endif
-
-/* We need a sign, whether a new catalog was loaded, which can be associated
- with all translations. This is important if the translations are
- cached by one of GCC's features. */
-int _nl_msg_cat_cntr = 0;
-
-
-/* Load the message catalogs specified by FILENAME. If it is no valid
- message catalog do nothing. */
-void
-_nl_load_domain (domain_file)
- struct loaded_l10nfile *domain_file;
-{
- int fd;
- struct stat st;
- struct mo_file_header *data = (struct mo_file_header *) -1;
-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
- || defined _LIBC
- int use_mmap = 0;
-#endif
- struct loaded_domain *domain;
-
- domain_file->decided = 1;
- domain_file->data = NULL;
-
- /* If the record does not represent a valid locale the FILENAME
- might be NULL. This can happen when according to the given
- specification the locale file name is different for XPG and CEN
- syntax. */
- if (domain_file->filename == NULL)
- return;
-
- /* Try to open the addressed file. */
- fd = open (domain_file->filename, O_RDONLY);
- if (fd == -1)
- return;
-
- /* We must know about the size of the file. */
- if (fstat (fd, &st) != 0
- && st.st_size < (off_t) sizeof (struct mo_file_header))
- {
- /* Something went wrong. */
- close (fd);
- return;
- }
-
-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
- || defined _LIBC
- /* Now we are ready to load the file. If mmap() is available we try
- this first. If not available or it failed we try to load it. */
- data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
- MAP_PRIVATE, fd, 0);
-
- if (data != (struct mo_file_header *) -1)
- {
- /* mmap() call was successful. */
- close (fd);
- use_mmap = 1;
- }
-#endif
-
- /* If the data is not yet available (i.e. mmap'ed) we try to load
- it manually. */
- if (data == (struct mo_file_header *) -1)
- {
- off_t to_read;
- char *read_ptr;
-
- data = (struct mo_file_header *) malloc (st.st_size);
- if (data == NULL)
- return;
-
- to_read = st.st_size;
- read_ptr = (char *) data;
- do
- {
- long int nb = (long int) read (fd, read_ptr, to_read);
- if (nb == -1)
- {
- close (fd);
- return;
- }
-
- read_ptr += nb;
- to_read -= nb;
- }
- while (to_read > 0);
-
- close (fd);
- }
-
- /* Using the magic number we can test whether it really is a message
- catalog file. */
- if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
- {
- /* The magic number is wrong: not a message catalog file. */
-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
- || defined _LIBC
- if (use_mmap)
- munmap ((caddr_t) data, st.st_size);
- else
-#endif
- free (data);
- return;
- }
-
- domain_file->data
- = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
- if (domain_file->data == NULL)
- return;
-
- domain = (struct loaded_domain *) domain_file->data;
- domain->data = (char *) data;
- domain->must_swap = data->magic != _MAGIC;
-
- /* Fill in the information about the available tables. */
- switch (W (domain->must_swap, data->revision))
- {
- case 0:
- domain->nstrings = W (domain->must_swap, data->nstrings);
- domain->orig_tab = (struct string_desc *)
- ((char *) data + W (domain->must_swap, data->orig_tab_offset));
- domain->trans_tab = (struct string_desc *)
- ((char *) data + W (domain->must_swap, data->trans_tab_offset));
- domain->hash_size = W (domain->must_swap, data->hash_tab_size);
- domain->hash_tab = (nls_uint32 *)
- ((char *) data + W (domain->must_swap, data->hash_tab_offset));
- break;
- default:
- /* This is an illegal revision. */
-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
- || defined _LIBC
- if (use_mmap)
- munmap ((caddr_t) data, st.st_size);
- else
-#endif
- free (data);
- free (domain);
- domain_file->data = NULL;
- return;
- }
-
- /* Show that one domain is changed. This might make some cached
- translations invalid. */
- ++_nl_msg_cat_cntr;
-}
diff --git a/contrib/texinfo/intl/localealias.c b/contrib/texinfo/intl/localealias.c
deleted file mode 100644
index 00d91941b9ba..000000000000
--- a/contrib/texinfo/intl/localealias.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/* Handle aliases for locale names
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-# define HAVE_ALLOCA 1
-#else
-# if defined HAVE_ALLOCA_H || defined _LIBC
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#include "gettext.h"
-#include "gettextP.h"
-
-/* @@ end of prolog @@ */
-
-#ifdef _LIBC
-/* Rename the non ANSI C functions. This is required by the standard
- because some ANSI C functions will require linking with this object
- file and the name space must not be polluted. */
-# define strcasecmp __strcasecmp
-#endif
-
-
-/* For those loosing systems which don't have `alloca' we have to add
- some additional code emulating it. */
-#ifdef HAVE_ALLOCA
-/* Nothing has to be done. */
-# define ADD_BLOCK(list, address) /* nothing */
-# define FREE_BLOCKS(list) /* nothing */
-#else
-struct block_list
-{
- void *address;
- struct block_list *next;
-};
-# define ADD_BLOCK(list, addr) \
- do { \
- struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
- /* If we cannot get a free block we cannot add the new element to \
- the list. */ \
- if (newp != NULL) { \
- newp->address = (addr); \
- newp->next = (list); \
- (list) = newp; \
- } \
- } while (0)
-# define FREE_BLOCKS(list) \
- do { \
- while (list != NULL) { \
- struct block_list *old = list; \
- list = list->next; \
- free (old); \
- } \
- } while (0)
-# undef alloca
-# define alloca(size) (malloc (size))
-#endif /* have alloca */
-
-
-struct alias_map
-{
- const char *alias;
- const char *value;
-};
-
-
-static struct alias_map *map;
-static size_t nmap = 0;
-static size_t maxmap = 0;
-
-
-/* Prototypes for local functions. */
-static size_t read_alias_file PARAMS ((const char *fname, int fname_len));
-static void extend_alias_table PARAMS ((void));
-static int alias_compare PARAMS ((const struct alias_map *map1,
- const struct alias_map *map2));
-
-
-const char *
-_nl_expand_alias (name)
- const char *name;
-{
- static const char *locale_alias_path = LOCALE_ALIAS_PATH;
- struct alias_map *retval;
- size_t added;
-
- do
- {
- struct alias_map item;
-
- item.alias = name;
-
- if (nmap > 0)
- retval = (struct alias_map *) bsearch (&item, map, nmap,
- sizeof (struct alias_map),
- (int (*) PARAMS ((const void *,
- const void *))
- ) alias_compare);
- else
- retval = NULL;
-
- /* We really found an alias. Return the value. */
- if (retval != NULL)
- return retval->value;
-
- /* Perhaps we can find another alias file. */
- added = 0;
- while (added == 0 && locale_alias_path[0] != '\0')
- {
- const char *start;
-
- while (locale_alias_path[0] == ':')
- ++locale_alias_path;
- start = locale_alias_path;
-
- while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
- ++locale_alias_path;
-
- if (start < locale_alias_path)
- added = read_alias_file (start, locale_alias_path - start);
- }
- }
- while (added != 0);
-
- return NULL;
-}
-
-
-static size_t
-read_alias_file (fname, fname_len)
- const char *fname;
- int fname_len;
-{
-#ifndef HAVE_ALLOCA
- struct block_list *block_list = NULL;
-#endif
- FILE *fp;
- char *full_fname;
- size_t added;
- static const char aliasfile[] = "/locale.alias";
-
- full_fname = (char *) alloca (fname_len + sizeof aliasfile);
- ADD_BLOCK (block_list, full_fname);
- memcpy (full_fname, fname, fname_len);
- memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
-
- fp = fopen (full_fname, "r");
- if (fp == NULL)
- {
- FREE_BLOCKS (block_list);
- return 0;
- }
-
- added = 0;
- while (!feof (fp))
- {
- /* It is a reasonable approach to use a fix buffer here because
- a) we are only interested in the first two fields
- b) these fields must be usable as file names and so must not
- be that long
- */
- char buf[BUFSIZ];
- char *alias;
- char *value;
- char *cp;
-
- if (fgets (buf, BUFSIZ, fp) == NULL)
- /* EOF reached. */
- break;
-
- cp = buf;
- /* Ignore leading white space. */
- while (isspace (cp[0]))
- ++cp;
-
- /* A leading '#' signals a comment line. */
- if (cp[0] != '\0' && cp[0] != '#')
- {
- alias = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
- ++cp;
- /* Terminate alias name. */
- if (cp[0] != '\0')
- *cp++ = '\0';
-
- /* Now look for the beginning of the value. */
- while (isspace (cp[0]))
- ++cp;
-
- if (cp[0] != '\0')
- {
- char *tp;
- size_t len;
-
- value = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
- ++cp;
- /* Terminate value. */
- if (cp[0] == '\n')
- {
- /* This has to be done to make the following test
- for the end of line possible. We are looking for
- the terminating '\n' which do not overwrite here. */
- *cp++ = '\0';
- *cp = '\n';
- }
- else if (cp[0] != '\0')
- *cp++ = '\0';
-
- if (nmap >= maxmap)
- extend_alias_table ();
-
- /* We cannot depend on strdup available in the libc. Sigh! */
- len = strlen (alias) + 1;
- tp = (char *) malloc (len);
- if (tp == NULL)
- {
- FREE_BLOCKS (block_list);
- return added;
- }
- memcpy (tp, alias, len);
- map[nmap].alias = tp;
-
- len = strlen (value) + 1;
- tp = (char *) malloc (len);
- if (tp == NULL)
- {
- FREE_BLOCKS (block_list);
- return added;
- }
- memcpy (tp, value, len);
- map[nmap].value = tp;
-
- ++nmap;
- ++added;
- }
- }
-
- /* Possibly not the whole line fits into the buffer. Ignore
- the rest of the line. */
- while (strchr (cp, '\n') == NULL)
- {
- cp = buf;
- if (fgets (buf, BUFSIZ, fp) == NULL)
- /* Make sure the inner loop will be left. The outer loop
- will exit at the `feof' test. */
- *cp = '\n';
- }
- }
-
- /* Should we test for ferror()? I think we have to silently ignore
- errors. --drepper */
- fclose (fp);
-
- if (added > 0)
- qsort (map, nmap, sizeof (struct alias_map),
- (int (*) PARAMS ((const void *, const void *))) alias_compare);
-
- FREE_BLOCKS (block_list);
- return added;
-}
-
-
-static void
-extend_alias_table ()
-{
- size_t new_size;
- struct alias_map *new_map;
-
- new_size = maxmap == 0 ? 100 : 2 * maxmap;
- new_map = (struct alias_map *) malloc (new_size
- * sizeof (struct alias_map));
- if (new_map == NULL)
- /* Simply don't extend: we don't have any more core. */
- return;
-
- memcpy (new_map, map, nmap * sizeof (struct alias_map));
-
- if (maxmap != 0)
- free (map);
-
- map = new_map;
- maxmap = new_size;
-}
-
-
-static int
-alias_compare (map1, map2)
- const struct alias_map *map1;
- const struct alias_map *map2;
-{
-#if defined _LIBC || defined HAVE_STRCASECMP
- return strcasecmp (map1->alias, map2->alias);
-#else
- const unsigned char *p1 = (const unsigned char *) map1->alias;
- const unsigned char *p2 = (const unsigned char *) map2->alias;
- unsigned char c1, c2;
-
- if (p1 == p2)
- return 0;
-
- do
- {
- /* I know this seems to be odd but the tolower() function in
- some systems libc cannot handle nonalpha characters. */
- c1 = isupper (*p1) ? tolower (*p1) : *p1;
- c2 = isupper (*p2) ? tolower (*p2) : *p2;
- if (c1 == '\0')
- break;
- ++p1;
- ++p2;
- }
- while (c1 == c2);
-
- return c1 - c2;
-#endif
-}
diff --git a/contrib/texinfo/intl/po2tbl.sed.in b/contrib/texinfo/intl/po2tbl.sed.in
deleted file mode 100644
index b3bcca4d7302..000000000000
--- a/contrib/texinfo/intl/po2tbl.sed.in
+++ /dev/null
@@ -1,102 +0,0 @@
-# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-1 {
- i\
-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
-\
-#if HAVE_CONFIG_H\
-# include <config.h>\
-#endif\
-\
-#include "libgettext.h"\
-\
-const struct _msg_ent _msg_tbl[] = {
- h
- s/.*/0/
- x
-}
-#
-# Write msgid entries in C array form.
-#
-/^msgid/ {
- s/msgid[ ]*\(".*"\)/ {\1/
- tb
-# Append the next line
- :b
- N
-# Look whether second part is continuation line.
- s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
-# Yes, then branch.
- ta
-# Because we assume that the input file correctly formed the line
-# just read cannot be again be a msgid line. So it's safe to ignore
-# it.
- s/\(.*\)\n.*/\1/
- bc
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use D here.
- s/.*\n\(.*\)/\1/
-# Some buggy seds do not clear the `successful substitution since last ``t'''
-# flag on `N', so we do a `t' here to clear it.
- tb
-# Not reached
- :c
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
- G
- s/\(.*\)\n\([0-9]*\)/\1, \2},/
- s/\(.*\)"$/\1/
- p
-}
-#
-# Last line.
-#
-$ {
- i\
-};\
-
- g
- s/0*\(.*\)/int _msg_tbl_length = \1;/p
-}
-d
diff --git a/contrib/texinfo/intl/textdomain.c b/contrib/texinfo/intl/textdomain.c
deleted file mode 100644
index 55d93406a8a0..000000000000
--- a/contrib/texinfo/intl/textdomain.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Implementation of the textdomain(3) function
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "libgettext.h"
-#endif
-
-/* @@ end of prolog @@ */
-
-/* Name of the default text domain. */
-extern const char _nl_default_default_domain[];
-
-/* Default text domain in which entries for gettext(3) are to be found. */
-extern const char *_nl_current_default_domain;
-
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define TEXTDOMAIN __textdomain
-# define strdup(str) __strdup (str)
-#else
-# define TEXTDOMAIN textdomain__
-#endif
-
-/* Set the current default message catalog to DOMAINNAME.
- If DOMAINNAME is null, return the current default.
- If DOMAINNAME is "", reset to the default of "messages". */
-char *
-TEXTDOMAIN (domainname)
- const char *domainname;
-{
- char *old;
-
- /* A NULL pointer requests the current setting. */
- if (domainname == NULL)
- return (char *) _nl_current_default_domain;
-
- old = (char *) _nl_current_default_domain;
-
- /* If domain name is the null string set to default domain "messages". */
- if (domainname[0] == '\0'
- || strcmp (domainname, _nl_default_default_domain) == 0)
- _nl_current_default_domain = _nl_default_default_domain;
- else
- {
- /* If the following malloc fails `_nl_current_default_domain'
- will be NULL. This value will be returned and so signals we
- are out of core. */
-#if defined _LIBC || defined HAVE_STRDUP
- _nl_current_default_domain = strdup (domainname);
-#else
- size_t len = strlen (domainname) + 1;
- char *cp = (char *) malloc (len);
- if (cp != NULL)
- memcpy (cp, domainname, len);
- _nl_current_default_domain = cp;
-#endif
- }
-
- if (old != _nl_default_default_domain)
- free (old);
-
- return (char *) _nl_current_default_domain;
-}
-
-#ifdef _LIBC
-/* Alias for function name in GNU C Library. */
-weak_alias (__textdomain, textdomain);
-#endif
diff --git a/contrib/texinfo/intl/xopen-msg.sed b/contrib/texinfo/intl/xopen-msg.sed
deleted file mode 100644
index b19c0bbd0ec1..000000000000
--- a/contrib/texinfo/intl/xopen-msg.sed
+++ /dev/null
@@ -1,104 +0,0 @@
-# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# The first directive in the .msg should be the definition of the
-# message set number. We use always set number 1.
-#
-1 {
- i\
-$set 1 # Automatically created by po2msg.sed
- h
- s/.*/0/
- x
-}
-#
-# We copy all comments into the .msg file. Perhaps they can help.
-#
-/^#/ s/^#[ ]*/$ /p
-#
-# We copy the original message as a comment into the .msg file.
-#
-/^msgid/ {
-# Does not work now
-# /"$/! {
-# s/\\$//
-# s/$/ ... (more lines following)"/
-# }
- s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
- p
-}
-#
-# The .msg file contains, other then the .po file, only the translations
-# but each given a unique ID. Starting from 1 and incrementing by 1 for
-# each message we assign them to the messages.
-# It is important that the .po file used to generate the cat-id-tbl.c file
-# (with po-to-tbl) is the same as the one used here. (At least the order
-# of declarations must not be changed.)
-#
-/^msgstr/ {
- s/msgstr[ ]*"\(.*\)"/\1/
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
-# Bring the line in the format `<number> <message>'
- G
- s/^[^\n]*$/& /
- s/\(.*\)\n\([0-9]*\)/\2 \1/
-# Clear flag from last substitution.
- tb
-# Append the next line.
- :b
- N
-# Look whether second part is a continuation line.
- s/\(.*\n\)"\(.*\)"/\1\2/
-# Yes, then branch.
- ta
- P
- D
-# Note that `D' includes a jump to the start!!
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use the sed command `D' here
- s/.*\n\(.*\)/\1/
- tb
-}
-d
diff --git a/contrib/texinfo/lib/Makefile.am b/contrib/texinfo/lib/Makefile.am
deleted file mode 100644
index e005d8d28f76..000000000000
--- a/contrib/texinfo/lib/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-## Makefile.am for texinfo/lib.
-## $Id: Makefile.am,v 1.4 1997/07/04 20:55:42 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-noinst_LIBRARIES = libtxi.a
-INCLUDES = -I../intl
-
-# Don't need to list alloca.c, etc., Automake includes them.
-libtxi_a_SOURCES = getopt.c getopt.h getopt1.c system.h xmalloc.c xstrdup.c
-libtxi_a_LIBADD = @LIBOBJS@ @ALLOCA@
-libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD)
-
-## xx configure for bzero?, clib, other common stuff
-
-EXTRA_DIST = README
diff --git a/contrib/texinfo/lib/Makefile.in b/contrib/texinfo/lib/Makefile.in
deleted file mode 100644
index 4612381824e1..000000000000
--- a/contrib/texinfo/lib/Makefile.in
+++ /dev/null
@@ -1,273 +0,0 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-noinst_LIBRARIES = libtxi.a
-INCLUDES = -I../intl
-
-# Don't need to list alloca.c, etc., Automake includes them.
-libtxi_a_SOURCES = getopt.c getopt.h getopt1.c system.h xmalloc.c xstrdup.c
-libtxi_a_LIBADD = @LIBOBJS@ @ALLOCA@
-libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD)
-
-EXTRA_DIST = README
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libtxi_a_OBJECTS = getopt.o getopt1.o xmalloc.o xstrdup.o
-AR = ar
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in alloca.c memcpy.c \
-memmove.c strdup.c strerror.c
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-SOURCES = $(libtxi_a_SOURCES)
-OBJECTS = $(libtxi_a_OBJECTS)
-
-default: all
-
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-noinstLIBRARIES:
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-
-distclean-noinstLIBRARIES:
-
-maintainer-clean-noinstLIBRARIES:
-
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-libtxi.a: $(libtxi_a_OBJECTS) $(libtxi_a_DEPENDENCIES)
- -rm -f libtxi.a
- $(AR) cru libtxi.a $(libtxi_a_OBJECTS) $(libtxi_a_LIBADD)
- $(RANLIB) libtxi.a
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = lib
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
-getopt.o: getopt.c ../config.h
-getopt1.o: getopt1.c ../config.h getopt.h
-xmalloc.o: xmalloc.c
-xstrdup.o: xstrdup.c ../config.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
-all: Makefile $(LIBRARIES)
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
-
-
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
-
-clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
- mostlyclean
-
-distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
- distclean-generic clean
- -rm -f config.status
-
-maintainer-clean: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
-clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info dvi installcheck \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-# 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/texinfo/lib/README b/contrib/texinfo/lib/README
deleted file mode 100644
index 6280ef53c9a1..000000000000
--- a/contrib/texinfo/lib/README
+++ /dev/null
@@ -1,4 +0,0 @@
-Common routines for the Texinfo package.
-
-Many are common to other GNU packages as well.
-(On the FSF machines, check /home/gd/gnu/lib for the latest.)
diff --git a/contrib/texinfo/lib/getopt.c b/contrib/texinfo/lib/getopt.c
deleted file mode 100644
index fc87ce67d69f..000000000000
--- a/contrib/texinfo/lib/getopt.c
+++ /dev/null
@@ -1,1044 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
- Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-#define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if !defined (__STDC__) || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-#include <stdlib.h>
-#include <unistd.h>
-#endif /* GNU C library. */
-
-#ifdef VMS
-#include <unixlib.h>
-#if HAVE_STRING_H - 0
-#include <string.h>
-#endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-#ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-#else
-# define _(msgid) (msgid)
-#endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg = NULL;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized = 0;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-#include <string.h>
-#define my_index strchr
-#else
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-char *getenv ();
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-#if !defined (__STDC__) || !__STDC__
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-#endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
- if (nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined (__STDC__) && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- nonoption_flags_len = nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- nonoption_flags_max_len),
- '\0', top + 1 - nonoption_flags_max_len);
- nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined (__STDC__) && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- if (nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = nonoption_flags_max_len = strlen (orig_str);
- if (nonoption_flags_max_len < argc)
- nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', nonoption_flags_max_len - len);
- }
- }
- nonoption_flags_len = nonoption_flags_max_len;
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- optarg = NULL;
-
- if (optind == 0 || !__getopt_initialized)
- {
- if (optind == 0)
- optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
-#else
-#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (opterr)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (opterr)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/texinfo/lib/getopt.h b/contrib/texinfo/lib/getopt.h
deleted file mode 100644
index c4adc30bbbac..000000000000
--- a/contrib/texinfo/lib/getopt.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _GETOPT_H
-#define _GETOPT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-#if defined (__STDC__) && __STDC__
- const char *name;
-#else
- char *name;
-#endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* getopt.h */
diff --git a/contrib/texinfo/lib/getopt1.c b/contrib/texinfo/lib/getopt1.c
deleted file mode 100644
index af8e68196574..000000000000
--- a/contrib/texinfo/lib/getopt1.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "getopt.h"
-
-#if !defined (__STDC__) || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/texinfo/lib/strerror.c b/contrib/texinfo/lib/strerror.c
deleted file mode 100644
index 661469173d94..000000000000
--- a/contrib/texinfo/lib/strerror.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * strerror.c --- ANSI C compatible system error routine
- */
-
-/*
- * Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
- * From gawk.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#if 0
-#include <stdio.h>
-#endif
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-char *
-strerror(n)
-int n;
-{
- static char mesg[30];
-
- if (n < 0 || n >= sys_nerr) {
- sprintf(mesg, "Unknown error (%d)", n);
- return mesg;
- } else
- return sys_errlist[n];
-}
diff --git a/contrib/texinfo/lib/system.h b/contrib/texinfo/lib/system.h
deleted file mode 100644
index 109e3933cb37..000000000000
--- a/contrib/texinfo/lib/system.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* system.h: System-dependent declarations. Include this first.
- $Id: system.h,v 1.5 1997/07/31 20:34:36 karl Exp $
-
- Copyright (C) 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef TEXINFO_SYSTEM_H
-#define TEXINFO_SYSTEM_H
-
-#define _GNU_SOURCE
-
-#include <config.h>
-
-/* <unistd.h> should be included before any preprocessor test
- of _POSIX_VERSION. */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <ctype.h>
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#include <libintl.h>
-
-/* Don't use bcopy! Use memmove if source and destination may overlap,
- memcpy otherwise. */
-#ifdef HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-char *memchr ();
-#endif
-
-#ifdef STDC_HEADERS
-#define getopt system_getopt
-#include <stdlib.h>
-#undef getopt
-#else
-extern char *getenv ();
-#endif
-
-#ifndef HAVE_STRERROR
-extern char *strerror ();
-#endif
-
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-#ifdef VMS
-#include <perror.h>
-#endif
-
-#include <sys/stat.h>
-
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h>
-#endif /* HAVE_SYS_FILE_H */
-
-#ifndef O_RDONLY
-/* Since <fcntl.h> is POSIX, prefer that to <sys/fcntl.h>.
- This also avoids some useless warnings on (at least) Linux. */
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#else /* not HAVE_FCNTL_H */
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif /* not HAVE_SYS_FCNTL_H */
-#endif /* not HAVE_FCNTL_H */
-#endif /* not O_RDONLY */
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-/* Some systems don't declare this function in pwd.h. */
-struct passwd *getpwnam ();
-
-/* Our library routines not included in any system library. */
-extern void *xmalloc (), *xrealloc ();
-extern char *xstrdup ();
-
-#endif /* TEXINFO_SYSTEM_H */
diff --git a/contrib/texinfo/lib/xstrdup.c b/contrib/texinfo/lib/xstrdup.c
deleted file mode 100644
index d5bcaf38091b..000000000000
--- a/contrib/texinfo/lib/xstrdup.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* xstrdup.c -- copy a string with out of memory checking
- Copyright (C) 1990, 1996 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#if defined (__STDC__) && __STDC__
-char *xmalloc (size_t);
-char *xstrdup (char *string);
-#else
-char *xmalloc ();
-#endif
-
-/* Return a newly allocated copy of STRING. */
-
-char *
-xstrdup (string)
- char *string;
-{
- return strcpy (xmalloc (strlen (string) + 1), string);
-}
diff --git a/contrib/texinfo/libtxi/Makefile.in b/contrib/texinfo/libtxi/Makefile.in
new file mode 100644
index 000000000000..58cb2a3f5e2b
--- /dev/null
+++ b/contrib/texinfo/libtxi/Makefile.in
@@ -0,0 +1,82 @@
+# Makefile for GNU texinfo/libtxi. -*- Indented-Text -*-
+# $Id: Makefile.in,v 1.3 1996/10/03 18:32:28 karl Exp $
+
+# Copyright (C) 1993, 96 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+SHELL = /bin/sh
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+AR = ar
+RANLIB = @RANLIB@
+
+DEFS = @DEFS@
+LIBS = @LIBS@
+LOADLIBES = $(LIBS)
+
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+
+# This is normally inherited from parent make, but if someone wants to
+# build libtxi.a alone, this variable will still be properly defined.
+ALLOCA = @ALLOCA@
+
+# Standard functions that may be missing.
+LIBOBJS = @LIBOBJS@
+
+SRCS = getopt.c getopt1.c bzero.c getopt.h
+OBJS = getopt.o getopt1.o bzero.o $(ALLOCA) $(LIBOBJS)
+
+PROGS = libtxi.a
+
+all: $(PROGS)
+sub-all: all
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) -I. -I$(srcdir) $(DEFS) $(CFLAGS) $<
+
+libtxi.a: $(OBJS)
+ rm -f $@
+ $(AR) cq $@ $(OBJS)
+ $(RANLIB) $@
+
+getopt.o: getopt.c getopt.h
+getopt1.o: getopt1.c getopt.h
+alloca.o: alloca.c
+
+install:
+uninstall:
+
+TAGS: $(SRCS)
+ etags $(SRCS)
+
+clean:
+ rm -f *.o a.out core core.* $(PROGS)
+
+mostlyclean: clean
+
+distclean: clean
+ rm -f Makefile config.status TAGS ID
+
+realclean: distclean
+
+Makefile: Makefile.in ../config.status
+ cd .. && sh config.status
+
+# Prevent GNU make v3 from overflowing arg limit on SysV.
+.NOEXPORT:
diff --git a/contrib/texinfo/lib/alloca.c b/contrib/texinfo/libtxi/alloca.c
index 8f98b73dbb90..8f98b73dbb90 100644
--- a/contrib/texinfo/lib/alloca.c
+++ b/contrib/texinfo/libtxi/alloca.c
diff --git a/contrib/texinfo/libtxi/bzero.c b/contrib/texinfo/libtxi/bzero.c
new file mode 100644
index 000000000000..e73738234fd1
--- /dev/null
+++ b/contrib/texinfo/libtxi/bzero.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 1993 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can either send email to this
+ * program's author (see below) or write to: The Free Software Foundation,
+ * Inc.; 59 Temple Place - Suite 330. Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (HAVE_MEMSET) && !defined (HAVE_BZERO)
+
+void
+bzero (b, length)
+ register char *b;
+ register int length;
+{
+#ifdef VMS /* but this is definitely VMS-specific */
+ short zero = 0;
+ long max_str = 65535;
+
+ while (length > max_str)
+ {
+ (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
+ length -= max_str;
+ b += max_str;
+ }
+ (void) LIB$MOVC5 (&zero, &zero, &zero, &length, b);
+#else
+ while (length-- > 0)
+ *b++ = 0;
+#endif /* not VMS */
+}
+
+#endif /* not HAVE_MEMSET && not HAVE_BZERO */
diff --git a/contrib/texinfo/libtxi/getopt.c b/contrib/texinfo/libtxi/getopt.c
new file mode 100644
index 000000000000..36ebf5c5b030
--- /dev/null
+++ b/contrib/texinfo/libtxi/getopt.c
@@ -0,0 +1,762 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+ Ditto for AIX 3.2 and <stdlib.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+#include <stdlib.h>
+#endif /* GNU C library. */
+
+/* This is for other GNU distributions with internationalized messages.
+ The GNU C Library itself does not yet support such messages. */
+#if HAVE_LIBINTL_H
+# include <libintl.h>
+#else
+# define gettext(msgid) (msgid)
+#endif
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* XXX 1003.2 says this must be 1 before any call. */
+int optind = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
+
+#ifdef __GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+#include <string.h>
+#define my_index strchr
+#else
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+ If not using GCC, it is ok not to declare it. */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+ That was relevant to code that was here before. */
+#if !defined (__STDC__) || !__STDC__
+/* gcc with -traditional declares the built-in strlen to return int,
+ and has done so at least since version 2.4.5. -- rms. */
+extern int strlen (const char *);
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (argv)
+ char **argv;
+{
+ int bottom = first_nonopt;
+ int middle = last_nonopt;
+ int top = optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (optind - last_nonopt);
+ last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+static const char *
+_getopt_initialize (optstring)
+ const char *optstring;
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns `EOF'.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+ const struct option *longopts;
+ int *longind;
+ int long_only;
+{
+ optarg = NULL;
+
+ if (optind == 0)
+ {
+ optstring = _getopt_initialize (optstring);
+ optind = 1; /* Don't scan ARGV[0], the program name. */
+ }
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc
+ && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* The special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return EOF;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ {
+ if (ordering == REQUIRE_ORDER)
+ return EOF;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[optind][1] == '-'
+ || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound;
+ int option_index;
+
+ for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if (nameend - nextchar == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ gettext ("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ gettext ("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ gettext ("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"),
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"),
+ argv[0], argv[optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ optind++;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, gettext ("%s: illegal option -- %c\n"),
+ argv[0], c);
+ else
+ fprintf (stderr, gettext ("%s: invalid option -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ return '?';
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = NULL;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr,
+ gettext ("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+getopt (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/contrib/texinfo/libtxi/getopt.h b/contrib/texinfo/libtxi/getopt.h
new file mode 100644
index 000000000000..952f4830d3dc
--- /dev/null
+++ b/contrib/texinfo/libtxi/getopt.h
@@ -0,0 +1,129 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/contrib/texinfo/libtxi/getopt1.c b/contrib/texinfo/libtxi/getopt1.c
new file mode 100644
index 000000000000..7cf0bfb01383
--- /dev/null
+++ b/contrib/texinfo/libtxi/getopt1.c
@@ -0,0 +1,180 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "getopt.h"
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#else
+char *getenv ();
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/contrib/texinfo/lib/memcpy.c b/contrib/texinfo/libtxi/memcpy.c
index 521625464cdd..521625464cdd 100644
--- a/contrib/texinfo/lib/memcpy.c
+++ b/contrib/texinfo/libtxi/memcpy.c
diff --git a/contrib/texinfo/lib/memmove.c b/contrib/texinfo/libtxi/memmove.c
index d7bdd7cd9950..d7bdd7cd9950 100644
--- a/contrib/texinfo/lib/memmove.c
+++ b/contrib/texinfo/libtxi/memmove.c
diff --git a/contrib/texinfo/lib/strdup.c b/contrib/texinfo/libtxi/strdup.c
index 1d60f13948a6..1d60f13948a6 100644
--- a/contrib/texinfo/lib/strdup.c
+++ b/contrib/texinfo/libtxi/strdup.c
diff --git a/contrib/texinfo/makeinfo/Makefile.am b/contrib/texinfo/makeinfo/Makefile.am
deleted file mode 100644
index f2137fa4b73d..000000000000
--- a/contrib/texinfo/makeinfo/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Makefile.am for texinfo/makeinfo.
-## $Id: Makefile.am,v 1.4 1997/07/04 20:58:00 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-bin_PROGRAMS = makeinfo
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
-
-makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
-
-EXTRA_DIST = README
diff --git a/contrib/texinfo/makeinfo/Makefile.in b/contrib/texinfo/makeinfo/Makefile.in
index d1d76aba3fea..d08ee3623d84 100644
--- a/contrib/texinfo/makeinfo/Makefile.in
+++ b/contrib/texinfo/makeinfo/Makefile.in
@@ -1,289 +1,112 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile for GNU makeinfo.
+# $Id: Makefile.in,v 1.9 1996/10/01 21:45:00 karl Exp $
+#
+# Copyright (C) 1993, 96 Free Software Foundation, Inc.
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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 free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
# 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.
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-SHELL = /bin/sh
+#### Start of system configuration section. ####
srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
+VPATH = $(srcdir):$(common)
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
+common = $(srcdir)/../libtxi
+CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-bin_PROGRAMS = makeinfo
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
-
-makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
-
-EXTRA_DIST = README
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-makeinfo_OBJECTS = makeinfo.o multi.o
-makeinfo_LDADD = $(LDADD)
-makeinfo_DEPENDENCIES = ../lib/libtxi.a
-makeinfo_LDFLAGS =
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-SOURCES = $(makeinfo_SOURCES)
-OBJECTS = $(makeinfo_OBJECTS)
+LN = ln
+RM = rm -f
+MKDIR = mkdir
-default: all
-
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps makeinfo/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+DEFS = @DEFS@
+LIBS = -L../libtxi -ltxi @LIBS@
+LOADLIBES = $(LIBS)
+SHELL = /bin/sh
-mostlyclean-binPROGRAMS:
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+# Prefix for each installed program, normally empty or `g'.
+binprefix =
+infodir = $(prefix)/info
-distclean-binPROGRAMS:
+#### End of system configuration section. ####
-maintainer-clean-binPROGRAMS:
+SRCS = makeinfo.c multi.c
+OBJS = makeinfo.o multi.o
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; \
- done
+PROGS = makeinfo
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
+all: $(PROGS) makeinfo.info
+sub-all: all
.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-makeinfo: $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
- @rm -f makeinfo
- $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = makeinfo
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
-makeinfo.o: makeinfo.c ../lib/system.h ../config.h ../lib/getopt.h \
- makeinfo.h
-multi.o: multi.c ../lib/system.h ../config.h makeinfo.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec: install-binPROGRAMS
- @$(NORMAL_INSTALL)
+ $(CC) -c $(CPPFLAGS) -I. -I$(srcdir) -I$(common) $(DEFS) $(CFLAGS) $<
-install-data:
- @$(NORMAL_INSTALL)
+makeinfo: $(OBJS) ../libtxi/libtxi.a
+ $(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES)
-install: install-exec install-data all
- @:
+../libtxi/libtxi.a:
+ (cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a)
-uninstall: uninstall-binPROGRAMS
+makeinfo.o: makeinfo.c $(common)/getopt.h
-all: Makefile $(PROGRAMS)
+$(OBJS): makeinfo.h
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
- $(mkinstalldirs) $(bindir)
+info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi
+ ./makeinfo --no-split -I$(srcdir) makeinfo.texi
+# makeinfo.texi: ./makeinfo makeinfo.mki
+# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi
+ $(srcdir)/../util/texi2dvi makeinfo.txi
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+install: all
+ $(INSTALL_PROGRAM) makeinfo $(bindir)/$(binprefix)makeinfo
+ -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
+ $(POST_INSTALL)
+ ../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info
+
+uninstall:
+ for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done
+ rm -f $(infodir)/makeinfo.info
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+TAGS: $(SRCS)
+ etags $(SRCS)
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+clean:
+ rm -f *.o a.out core core.* $(PROGS)
-clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean
+mostlyclean: clean
-distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean
- -rm -f config.status
+distclean: clean
+ rm -f TAGS Makefile config.status *.info */*.info
-maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
- maintainer-clean-tags maintainer-clean-generic \
- distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info dvi installcheck \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+realclean: distclean
+maintainer-clean: distclean
+Makefile: Makefile.in ../config.status
+ cd .. && sh config.status
-# 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.
+# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
diff --git a/contrib/texinfo/makeinfo/README b/contrib/texinfo/makeinfo/README
deleted file mode 100644
index 2bfe6e1cbebb..000000000000
--- a/contrib/texinfo/makeinfo/README
+++ /dev/null
@@ -1,8 +0,0 @@
-makeinfo is a standalone program to convert Texinfo source into Info
-files readable with standalone info or M-x info in Emacs.
-
-makeinfo can also output plain ASCII. Work to support HTML and Troff
-output is almost complete.
-
-The Emacs function M-x texinfo-format-buffer does more or less the same
-job, but makeinfo is faster and gives better error messages.
diff --git a/contrib/texinfo/doc/macro.texi b/contrib/texinfo/makeinfo/macro.texi
index 8a3fe802392e..8a3fe802392e 100644
--- a/contrib/texinfo/doc/macro.texi
+++ b/contrib/texinfo/makeinfo/macro.texi
diff --git a/contrib/texinfo/makeinfo/makeinfo.c b/contrib/texinfo/makeinfo/makeinfo.c
index bfd142e7dab3..f30d366cbd48 100644
--- a/contrib/texinfo/makeinfo/makeinfo.c
+++ b/contrib/texinfo/makeinfo/makeinfo.c
@@ -1,8 +1,7 @@
-/* Makeinfo -- convert Texinfo source files into Info files.
- $Id: makeinfo.c,v 1.60 1998/02/25 20:36:22 karl Exp $
+/* Makeinfo -- convert texinfo format files into info files.
+ $Id: makeinfo.c,v 1.37 1996/10/04 18:20:52 karl Exp $
- Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98
- Free Software Foundation, Inc.
+ Copyright (C) 1987, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,58 +17,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- Makeinfo was authored by Brian Fox (bfox@ai.mit.edu). */
-
-/* Indent #pragma so that older Cpp's don't try to parse it. */
-#ifdef _AIX
- #pragma alloca
-#endif /* _AIX */
+ Makeinfo is authored by Brian Fox (bfox@ai.mit.edu). */
int major_version = 1;
-int minor_version = 68;
-
-#include "system.h"
-#include "getopt.h"
-
-#ifdef TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* !TM_IN_SYS_TIME */
-
-#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-char *alloca ();
-# endif
-# endif
-#endif
-
-/* We'd like to take advantage of _doprnt if it's around, a la error.c,
- but then we'd have no VA_SPRINTF. */
-#if HAVE_VPRINTF
-# if __STDC__
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-# else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start(args)
-# endif
-# define VA_FPRINTF(file, fmt, ap) vfprintf (file, fmt, ap)
-# define VA_SPRINTF(str, fmt, ap) vsprintf (str, fmt, ap)
-#else /* not HAVE_VPRINTF */
-# define VA_START(args, lastarg)
-# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
-# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
-# define va_end(args)
-#endif
+int minor_version = 67;
-/* You can change some of the behavior of Makeinfo by changing the
+/* You can change some of the behaviour of Makeinfo by changing the
following defines: */
/* Define INDENT_PARAGRAPHS_IN_TABLE if you want the paragraphs which
@@ -97,48 +50,113 @@ char *alloca ();
#define DEFAULT_PARAGRAPH_SPACING 1
/* Define HAVE_MACROS to enable the macro facility of Texinfo. Using this
- facility, users can create their own command procedures with
- arguments. Must always be defined. */
+ facility, users can create their own command procedures with arguments. */
#define HAVE_MACROS
+/* Indent #pragma so that older Cpp's don't try to parse it. */
+#if defined (_AIX)
+ # pragma alloca
+#endif /* _AIX */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <pwd.h>
+#include <errno.h>
+
+#if defined (HAVE_VARARGS_H)
+#include <varargs.h>
+#endif /* HAVE_VARARGS_H */
+#include "getopt.h"
+
+#if defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined (VMS)
+#include <perror.h>
+#endif
+
+#if defined (HAVE_STRING_H)
+#include <string.h>
+#else
+#include <strings.h>
+#endif /* !HAVE_STRING_H */
+
+#if defined (TM_IN_SYS_TIME)
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif /* !TM_IN_SYS_TIME */
+
+#if defined (HAVE_SYS_FCNTL_H)
+#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+
+#if defined (HAVE_SYS_FILE_H)
+#include <sys/file.h>
+#endif /* HAVE_SYS_FILE_H */
+
+#if defined (__GNUC__)
+#define alloca __builtin_alloca
+#else
+#if defined(HAVE_ALLOCA_H)
+#include <alloca.h>
+#else /* !HAVE_ALLOCA_H */
+#if !defined (_AIX)
+extern char *alloca ();
+#endif /* !_AIX */
+#endif /* !HAVE_ALLOCA_H */
+#endif /* !__GNUC__ */
+
+void *xmalloc (), *xrealloc ();
+#if defined (__osf__)
+extern void *malloc (), *realloc ();
+#endif /* __osf__ */
+
+char **get_brace_args ();
+int array_len ();
+void free_array ();
+static void isolate_nodename ();
+
#define COMPILING_MAKEINFO
#include "makeinfo.h"
-/* Nonzero means that we are currently hacking the insides of an
+/* Non-zero means that we are currently hacking the insides of an
insertion which would use a fixed width font. */
static int in_fixed_width_font = 0;
-/* Nonzero means that start_paragraph () MUST be called before we pay
+/* Non-zero means that start_paragraph () MUST be called before we pay
any attention to close_paragraph () calls. */
int must_start_paragraph = 0;
-/* Nonzero means a string is in execution, as opposed to a file. */
+/* Non-zero means a string is in execution, as opposed to a file. */
static int executing_string = 0;
-/* Nonzero means a macro string is in execution, as opposed to a file. */
-static int me_executing_string = 0;
-
#if defined (HAVE_MACROS)
/* If non-NULL, this is an output stream to write the full macro expansion
- of the input text to. The result is another texinfo file, but
+ of the input text to. The resultant file is another texinfo file, but
missing @include, @infoinclude, @macro, and macro invocations. Instead,
all of the text is placed within the file. */
FILE *macro_expansion_output_stream = (FILE *)NULL;
-char *macro_expansion_filename;
/* Here is a structure used to remember input text strings and offsets
within them. */
typedef struct {
- char *pointer; /* Pointer to the input text. */
- int offset; /* Offset of the last character output. */
+ char *pointer; /* Pointer to the input text. */
+ int offset; /* Offset of the last character output. */
} ITEXT;
static ITEXT **itext_info = (ITEXT **)NULL;
static int itext_size = 0;
-/* Nonzero means to inhibit writing macro expansions to the output
- stream, because it has already been written. */
+/* Non-zero means to inhibit the writing of macro expansions to the output
+ stream. This is used in special cases where the output has already been
+ written. */
int me_inhibit_expansion = 0;
ITEXT *remember_itext ();
@@ -147,17 +165,19 @@ void append_to_expansion_output (), write_region_to_macro_output ();
void maybe_write_itext (), me_execute_string ();
#endif /* HAVE_MACROS */
+/* Some systems don't declare this function in pwd.h. */
+struct passwd *getpwnam ();
/* **************************************************************** */
-/* */
-/* Global Variables */
-/* */
+/* */
+/* Global Variables */
+/* */
/* **************************************************************** */
/* Global pointer to argv[0]. */
char *progname;
-/* Return nonzero if STRING is the text at input_text + input_text_offset,
+/* Return non-zero if STRING is the text at input_text + input_text_offset,
else zero. */
#define looking_at(string) \
(strncmp (input_text + input_text_offset, string, strlen (string)) == 0)
@@ -176,20 +196,24 @@ char *command_output_filename = (char *)NULL;
with @include. This can be controlled with the `-I' option to makeinfo. */
char *include_files_path = (char *)NULL;
+/* Current output stream. */
+FILE *output_stream;
+
/* Position in the output file. */
int output_position;
#define INITIAL_PARAGRAPH_SPACE 5000
int paragraph_buffer_len = INITIAL_PARAGRAPH_SPACE;
-/* Nonzero indicates that filling will take place on long lines. */
+/* Filling.. */
+/* Non-zero indicates that filling will take place on long lines. */
int filling_enabled = 1;
-/* Nonzero means that words are not to be split, even in long lines. This
+/* Non-zero means that words are not to be split, even in long lines. This
gets changed for cm_w (). */
int non_splitting_words = 0;
-/* Nonzero indicates that filling a line also indents the new line. */
+/* Non-zero indicates that filling a line also indents the new line. */
int indented_fill = 0;
/* The amount of indentation to add at the starts of paragraphs.
@@ -202,7 +226,7 @@ int indented_fill = 0;
this is 3. */
int paragraph_start_indent = PARAGRAPH_START_INDENT;
-/* Nonzero means that the use of paragraph_start_indent is inhibited.
+/* Non-zero means that the use of paragraph_start_indent is inhibited.
@example uses this to line up the left columns of the example text.
A negative value for this variable is incremented each time it is used.
@noindent uses this to inhibit indentation for a single paragraph. */
@@ -216,17 +240,17 @@ int pending_indent = 0;
/* The amount that indentation increases/decreases by. */
int default_indentation_increment = DEFAULT_INDENTATION_INCREMENT;
-/* Nonzero indicates that indentation is temporarily turned off. */
+/* Non-zero indicates that indentation is temporarily turned off. */
int no_indent = 1;
-/* Nonzero means forcing output text to be flushright. */
+/* Non-zero means forcing output text to be flushright. */
int force_flush_right = 0;
-/* Nonzero means that the footnote style for this document was set on
+/* Non-zero means that the footnote style for this document was set on
the command line, which overrides any other settings. */
int footnote_style_preset = 0;
-/* Nonzero means that we automatically number footnotes that have no
+/* Non-zero means that we automatically number footnotes that have no
specified marker. */
int number_footnotes = 1;
@@ -243,16 +267,16 @@ int command_index;
/* A search string which is used to find a line defining a node. */
char node_search_string[] =
- { '\n', COMMAND_PREFIX, 'n', 'o', 'd', 'e', ' ', 0 };
+ { '\n', COMMAND_PREFIX, 'n', 'o', 'd', 'e', ' ', '\0' };
/* A search string which is used to find a line defining a menu. */
char menu_search_string[] =
- { '\n', COMMAND_PREFIX, 'm', 'e', 'n', 'u', 0 };
+ { '\n', COMMAND_PREFIX, 'm', 'e', 'n', 'u', '\0' };
/* A search string which is used to find the first @setfilename. */
char setfilename_search[] =
{ COMMAND_PREFIX,
- 's', 'e', 't', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', 0 };
+ 's', 'e', 't', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\0' };
/* A stack of file information records. If a new file is read in with
"@input", we remember the old input file state on this stack. */
@@ -282,15 +306,15 @@ char *node_filename = (char *)NULL;
typedef struct tentry
{
struct tentry *next_ent;
- char *node; /* name of this node. */
- char *prev; /* name of "Prev:" for this node. */
- char *next; /* name of "Next:" for this node. */
- char *up; /* name of "Up:" for this node. */
- int position; /* output file position of this node. */
- int line_no; /* defining line in source file. */
- char *filename; /* The file that this node was found in. */
- int touched; /* Nonzero means this node has been referenced. */
- int flags; /* Room for growth. Right now, contains 1 bit. */
+ char *node; /* name of this node. */
+ char *prev; /* name of "Prev:" for this node. */
+ char *next; /* name of "Next:" for this node. */
+ char *up; /* name of "Up:" for this node. */
+ int position; /* output file position of this node. */
+ int line_no; /* defining line in source file. */
+ char *filename; /* The file that this node was found in. */
+ int touched; /* non-zero means this node has been referenced. */
+ int flags; /* Room for growth. Right now, contains 1 bit. */
} TAG_ENTRY;
/* If node-a has a "Next" for node-b, but node-b has no "Prev" for node-a,
@@ -300,30 +324,24 @@ typedef struct tentry
#define PREV_ERROR 0x1
#define NEXT_ERROR 0x2
#define UP_ERROR 0x4
-#define NO_WARN 0x8
-#define IS_TOP 0x10
+#define NO_WARN 0x8
+#define IS_TOP 0x10
TAG_ENTRY *tag_table = (TAG_ENTRY *) NULL;
-/* Values for calling handle_variable_internal (). */
-#define SET 1
-#define CLEAR 2
-#define IFSET 3
-#define IFCLEAR 4
-
#if defined (HAVE_MACROS)
-#define ME_RECURSE 0x01
-#define ME_QUOTE_ARG 0x02
+#define ME_RECURSE 0x01
+#define ME_QUOTE_ARG 0x02
/* Macro definitions for user-defined commands. */
typedef struct {
- char *name; /* Name of the macro. */
- char **arglist; /* Args to replace when executing. */
- char *body; /* Macro body. */
- char *source_file; /* File where this macro is defined. */
- int source_lineno; /* Line number within FILENAME. */
- int inhibited; /* Nonzero means make find_macro () fail. */
- int flags; /* ME_RECURSE, ME_QUOTE_ARG, etc. */
+ char *name; /* Name of the macro. */
+ char **arglist; /* Args to replace when executing. */
+ char *body; /* Macro body. */
+ char *source_file; /* File where this macro is defined. */
+ int source_lineno; /* Line number within FILENAME. */
+ int inhibited; /* Non-zero means make find_macro () fail. */
+ int flags; /* ME_RECURSE, ME_QUOTE_ARG, etc. */
} MACRO_DEF;
void add_macro (), execute_macro ();
@@ -343,12 +361,12 @@ enum reftype
typedef struct node_ref
{
struct node_ref *next;
- char *node; /* Name of node referred to. */
- char *containing_node; /* Name of node containing this reference. */
- int line_no; /* Line number where the reference occurs. */
- int section; /* Section level where the reference occurs. */
- char *filename; /* Name of file where the reference occurs. */
- enum reftype type; /* Type of reference, either menu or note. */
+ char *node; /* Name of node referred to. */
+ char *containing_node; /* Name of node containing this reference. */
+ int line_no; /* Line number where the reference occurs. */
+ int section; /* Section level where the reference occurs. */
+ char *filename; /* Name of file where the reference occurs. */
+ enum reftype type; /* Type of reference, either menu or note. */
} NODE_REF;
/* The linked list of such structures. */
@@ -360,24 +378,21 @@ int in_menu = 0;
/* Flag which tells us how to examine menu lines. */
int in_detailmenu = 0;
-/* Nonzero means that we have seen "@top" once already. */
+/* Non-zero means that we have seen "@top" once already. */
int top_node_seen = 0;
-/* Nonzero means that we have seen a non-"@top" node already. */
+/* Non-zero means that we have seen a non-"@top" node already. */
int non_top_node_seen = 0;
/* Flags controlling the operation of the program. */
-/* Default is to remove output if there were errors. */
-int force = 0;
-
/* Default is to notify users of bad choices. */
int print_warnings = 1;
/* Default is to check node references. */
int validating = 1;
-/* Nonzero means do not output "Node: Foo" for node separations. */
+/* Non-zero means do not output "Node: Foo" for node separations. */
int no_headers = 0;
/* Number of errors that we tolerate on a given fileset. */
@@ -386,11 +401,11 @@ int max_error_level = 100;
/* Maximum number of references to a single node before complaining. */
int reference_warning_limit = 1000;
-/* Nonzero means print out information about what is going on when it
+/* Non-zero means print out information about what is going on when it
is going on. */
int verbose_mode = 0;
-/* Nonzero means to be relaxed about the input file. This is useful when
+/* Non-zero means to be relaxed about the input file. This is useful when
we can successfully format the input, but it doesn't strictly match our
somewhat pedantic ideas of correctness. Right now, it affects what
@table and @itemize do without arguments. */
@@ -416,12 +431,17 @@ typedef struct brace_element
BRACE_ELEMENT *brace_stack = (BRACE_ELEMENT *) NULL;
+/* Forward declarations. */
+#if !defined (HAVE_STRDUP)
+extern char *strdup ();
+#endif /* HAVE_STRDUP */
+
extern void do_multitable ();
void print_version_info ();
void usage ();
void push_node_filename (), pop_node_filename ();
-void remember_error (), flush_file_stack ();
+void remember_error ();
void convert_from_stream (), convert_from_file (), convert_from_loaded_file ();
void init_internals (), init_paragraph (), init_brace_stack ();
void init_insertion_stack (), init_indices ();
@@ -429,34 +449,21 @@ void init_tag_table (), write_tag_table (), write_tag_table_internal ();
void validate_file (), validate_other_references (), split_file ();
void free_node_references (), do_enumeration (), handle_variable ();
void handle_variable_internal ();
+void execute_string ();
void normalize_node_name ();
void undefindex (), top_defindex (), gen_defindex ();
void define_user_command ();
void free_pending_notes (), output_pending_notes ();
-char **get_brace_args ();
-char *expansion ();
-int array_len ();
-void free_array ();
-static int end_of_sentence_p ();
-static void isolate_nodename ();
void reader_loop (), read_command ();
void remember_brace (), remember_brace_1 ();
void pop_and_call_brace (), discard_braces ();
-void add_word (), add_char (), insert (), flush_output ();
+void add_word_args (), add_word (), add_char (), insert (), flush_output ();
void insert_string ();
void close_paragraph_with_lines (), close_paragraph ();
void ignore_blank_line ();
-void do_flush_right_indentation (), discard_insertions ();
+void do_flush_right_indentation ();
void start_paragraph (), indent ();
-#if defined (VA_FPRINTF) && __STDC__
-/* Unfortunately we must use prototypes if we are to use <stdarg.h>. */
-void add_word_args (char *, ...);
-void execute_string (char *, ...);
-#else
-void add_word_args ();
-void execute_string ();
-#endif /* will not use prototypes */
void insert_self (), insert_space (), cm_ignore_line ();
@@ -464,8 +471,8 @@ void
cm_TeX (), cm_asterisk (), cm_bullet (), cm_cite (),
cm_code (), cm_copyright (), cm_ctrl (), cm_dfn (), cm_dircategory (),
cm_direntry (), cm_dots (), cm_emph (), cm_enddots (),
- cm_kbd (), cm_key (), cm_no_op (), cm_no_op_line_arg (),
- cm_not_fixed_width (), cm_strong (), cm_var_sc (), cm_w (), cm_image ();
+ cm_kbd (), cm_angle_brackets (), cm_no_op (), cm_not_fixed_width (),
+ cm_strong (), cm_var (), cm_w ();
/* Sectioning. */
void
@@ -476,22 +483,21 @@ void
cm_heading (), cm_chapheading (), cm_subheading (), cm_subsubheading (),
cm_majorheading (), cm_raisesections (), cm_lowersections ();
-/* All @def... commands map to cm_defun, most accent commands map to
+/* All @defxxx commands map to cm_defun, most accent commands map to
cm_accent, most non-English letters map to cm_special_char. */
void cm_defun (), cm_accent (), cm_special_char (), cm_dotless ();
void
cm_node (), cm_menu (), cm_xref (), cm_ftable (), cm_vtable (), cm_pxref (),
- cm_inforef (), cm_uref (), cm_email (), cm_quotation (),
- cm_display (), cm_itemize (),
+ cm_inforef (), cm_quotation (), cm_display (), cm_itemize (),
cm_enumerate (), cm_tab (), cm_table (), cm_itemx (), cm_noindent (),
cm_setfilename (), cm_br (), cm_sp (), cm_page (), cm_group (),
cm_center (), cm_include (), cm_bye (), cm_item (), cm_end (),
- cm_ifinfo (), cm_ifnothtml (), cm_ifnottex (), cm_kindex (), cm_cindex (),
+ cm_ifinfo (), cm_kindex (), cm_cindex (),
cm_findex (), cm_pindex (), cm_vindex (), cm_tindex (),
cm_synindex (), cm_printindex (), cm_minus (), cm_footnote (),
cm_example (), cm_smallexample (), cm_lisp (), cm_format (), cm_exdent (),
- cm_defindex (), cm_defcodeindex (), cm_result (), cm_expansion (),
+ cm_defindex (), cm_defcodeindex (), cm_sc (), cm_result (), cm_expansion (),
cm_equiv (), cm_print (), cm_error (), cm_point (), cm_today (),
cm_flushleft (), cm_flushright (), cm_smalllisp (), cm_finalout (),
cm_cartouche (), cm_detailmenu (), cm_multitable ();
@@ -526,7 +532,7 @@ int user_command_array_len = 0;
#define NO_BRACE_ARGS 0
#define BRACE_ARGS 1
-static COMMAND command_table[] = {
+static COMMAND CommandTable[] = {
{ "\t", insert_space, NO_BRACE_ARGS },
{ "\n", insert_space, NO_BRACE_ARGS },
{ " ", insert_self, NO_BRACE_ARGS },
@@ -626,7 +632,7 @@ static COMMAND command_table[] = {
{ "dotaccent", cm_accent, BRACE_ARGS },
{ "dotless", cm_dotless, BRACE_ARGS },
{ "dots", cm_dots, BRACE_ARGS },
- { "email", cm_email, BRACE_ARGS },
+ { "email", cm_angle_brackets, BRACE_ARGS },
{ "emph", cm_emph, BRACE_ARGS },
{ "end", cm_end, NO_BRACE_ARGS },
{ "enddots", cm_enddots, BRACE_ARGS },
@@ -649,33 +655,29 @@ static COMMAND command_table[] = {
{ "group", cm_group, NO_BRACE_ARGS },
{ "heading", cm_heading, NO_BRACE_ARGS },
{ "headings", cm_ignore_line, NO_BRACE_ARGS },
- { "html", command_name_condition, NO_BRACE_ARGS },
{ "hyphenation", cm_no_op, BRACE_ARGS },
{ "i", cm_not_fixed_width, BRACE_ARGS },
{ "ifclear", cm_ifclear, NO_BRACE_ARGS },
{ "ifeq", cm_ifeq, NO_BRACE_ARGS },
{ "ifhtml", command_name_condition, NO_BRACE_ARGS },
{ "ifinfo", cm_ifinfo, NO_BRACE_ARGS },
- { "ifnothtml", cm_ifnothtml, NO_BRACE_ARGS },
- { "ifnotinfo", command_name_condition, NO_BRACE_ARGS },
- { "ifnottex", cm_ifnottex, NO_BRACE_ARGS },
{ "ifset", cm_ifset, NO_BRACE_ARGS },
{ "iftex", command_name_condition, NO_BRACE_ARGS },
{ "ignore", command_name_condition, NO_BRACE_ARGS },
- { "image", cm_image, BRACE_ARGS },
{ "include", cm_include, NO_BRACE_ARGS },
{ "inforef", cm_inforef, BRACE_ARGS },
{ "item", cm_item, NO_BRACE_ARGS },
{ "itemize", cm_itemize, NO_BRACE_ARGS },
{ "itemx", cm_itemx, NO_BRACE_ARGS },
{ "kbd", cm_kbd, BRACE_ARGS },
- { "kbdinputstyle", cm_no_op_line_arg, NO_BRACE_ARGS },
- { "key", cm_key, BRACE_ARGS },
+ { "key", cm_angle_brackets, BRACE_ARGS },
{ "kindex", cm_kindex, NO_BRACE_ARGS },
{ "l", cm_special_char, BRACE_ARGS },
{ "lisp", cm_lisp, NO_BRACE_ARGS },
{ "lowersections", cm_lowersections, NO_BRACE_ARGS },
+#if defined (HAVE_MACROS)
{ "macro", cm_macro, NO_BRACE_ARGS },
+#endif
{ "majorheading", cm_majorheading, NO_BRACE_ARGS },
{ "math", cm_no_op, BRACE_ARGS },
{ "menu", cm_menu, NO_BRACE_ARGS },
@@ -704,7 +706,7 @@ static COMMAND command_table[] = {
{ "result", cm_result, BRACE_ARGS },
{ "ringaccent", cm_accent, BRACE_ARGS },
{ "samp", cm_code, BRACE_ARGS },
- { "sc", cm_var_sc, BRACE_ARGS },
+ { "sc", cm_sc, BRACE_ARGS },
{ "section", cm_section, NO_BRACE_ARGS },
{ "set", cm_set, NO_BRACE_ARGS },
{ "setchapternewpage", cm_ignore_line, NO_BRACE_ARGS },
@@ -746,11 +748,10 @@ static COMMAND command_table[] = {
{ "unnumberedsec", cm_unnumberedsec, NO_BRACE_ARGS },
{ "unnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS },
{ "unnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS },
- { "uref", cm_uref, BRACE_ARGS },
{ "url", cm_code, BRACE_ARGS },
{ "v", cm_accent, BRACE_ARGS },
{ "value", cm_value, BRACE_ARGS },
- { "var", cm_var_sc, BRACE_ARGS },
+ { "var", cm_var, BRACE_ARGS },
{ "vindex", cm_vindex, NO_BRACE_ARGS },
{ "vtable", cm_vtable, NO_BRACE_ARGS },
{ "w", cm_w, BRACE_ARGS },
@@ -771,159 +772,46 @@ static COMMAND command_table[] = {
{ "iunnumberedsubsec", cm_ideprecated, NO_BRACE_ARGS },
{ "iunnumberedsubsubsec", cm_ideprecated, NO_BRACE_ARGS },
- /* Now @include does what this was used to. */
+ /* Now @include does what this was supposed to. */
{ "infoinclude", cm_obsolete, NO_BRACE_ARGS },
{ "titlespec", cm_obsolete, NO_BRACE_ARGS },
- { NULL, NULL, NO_BRACE_ARGS }
-};
+ {(char *) NULL, (COMMAND_FUNCTION *) NULL}, NO_BRACE_ARGS};
struct option long_options[] =
{
- { "error-limit", 1, 0, 'e' }, /* formerly -el */
- { "fill-column", 1, 0, 'f' }, /* formerly -fc */
- { "footnote-style", 1, 0, 's' }, /* formerly -ft */
- { "force", 0, 0, 'F' }, /* do not remove output */
- { "no-headers", 0, &no_headers, 1 }, /* do not output Node: foo */
+ { "error-limit", 1, 0, 'e' }, /* formerly -el */
+ { "fill-column", 1, 0, 'f' }, /* formerly -fc */
+ { "footnote-style", 1, 0, 's' }, /* formerly -ft */
+ { "no-headers", 0, &no_headers, 1 }, /* Do not output Node: foo */
{ "no-pointer-validate", 0, &validating, 0 }, /* formerly -nv */
- { "no-validate", 0, &validating, 0 }, /* formerly -nv */
- { "no-split", 0, &splitting, 0 }, /* formerly -ns */
- { "no-warn", 0, &print_warnings, 0 }, /* formerly -nw */
+ { "no-validate", 0, &validating, 0 }, /* formerly -nv */
+ { "no-split", 0, &splitting, 0 }, /* formerly -ns */
+ { "no-warn", 0, &print_warnings, 0 }, /* formerly -nw */
+#if defined (HAVE_MACROS)
{ "macro-expand", 1, 0, 'E' },
+#endif /* HAVE_MACROS */
{ "number-footnotes", 0, &number_footnotes, 1 },
{ "no-number-footnotes", 0, &number_footnotes, 0 },
{ "output", 1, 0, 'o' },
- { "paragraph-indent", 1, 0, 'p' }, /* formerly -pi */
- { "reference-limit", 1, 0, 'r' }, /* formerly -rl */
- { "verbose", 0, &verbose_mode, 1 }, /* formerly -verbose */
+ { "paragraph-indent", 1, 0, 'p' }, /* formerly -pi */
+ { "reference-limit", 1, 0, 'r' }, /* formerly -rl */
+ { "verbose", 0, &verbose_mode, 1 }, /* formerly -verbose */
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'V' },
{NULL, 0, NULL, 0}
};
-/* **************************************************************** */
-/* */
-/* Error Handling */
-/* */
-/* **************************************************************** */
-
-/* Number of errors encountered. */
-int errors_printed = 0;
-
-/* Print the last error gotten from the file system. */
-int
-fs_error (filename)
- char *filename;
-{
- remember_error ();
- perror (filename);
- return (0);
-}
-
-/* Print an error message, and return false. */
-void
-#if defined (VA_FPRINTF) && __STDC__
-error (char *format, ...)
-#else
-error (format, va_alist)
- char *format;
- va_dcl
-#endif
-{
-#ifdef VA_FPRINTF
- va_list ap;
-#endif
-
- remember_error ();
-
- VA_START (ap, format);
-#ifdef VA_FPRINTF
- VA_FPRINTF (stderr, format, ap);
-#else
- fprintf (stderr, format, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif /* not VA_FPRINTF */
- va_end (ap);
-
- putc ('\n', stderr);
-}
-
-/* Just like error (), but print the line number as well. */
-void
-#if defined (VA_FPRINTF) && __STDC__
-line_error (char *format, ...)
-#else
-line_error (format, va_alist)
- char *format;
- va_dcl
-#endif
-{
-#ifdef VA_FPRINTF
- va_list ap;
-#endif
-
- remember_error ();
- fprintf (stderr, "%s:%d: ", input_filename, line_number);
-
- VA_START (ap, format);
-#ifdef VA_FPRINTF
- VA_FPRINTF (stderr, format, ap);
-#else
- fprintf (stderr, format, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif /* not VA_FPRINTF */
- va_end (ap);
-
- fprintf (stderr, ".\n");
-}
-
-void
-#if defined (VA_FPRINTF) && __STDC__
-warning (char *format, ...)
-#else
-warning (format, va_alist)
- char *format;
- va_dcl
-#endif
-{
-#ifdef VA_FPRINTF
- va_list ap;
-#endif
-
- if (print_warnings)
- {
- fprintf (stderr, _("%s:%d: warning: "), input_filename, line_number);
-
- VA_START (ap, format);
-#ifdef VA_FPRINTF
- VA_FPRINTF (stderr, format, ap);
-#else
- fprintf (stderr, format, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif /* not VA_FPRINTF */
- va_end (ap);
-
- fprintf (stderr, ".\n");
- }
-}
-
+/* Values for calling handle_variable_internal (). */
+#define SET 1
+#define CLEAR 2
+#define IFSET 3
+#define IFCLEAR 4
-/* Remember that an error has been printed. If more than
- max_error_level have been printed, then exit the program. */
-void
-remember_error ()
-{
- errors_printed++;
- if (max_error_level && (errors_printed > max_error_level))
- {
- fprintf (stderr, _("Too many errors! Gave up.\n"));
- flush_file_stack ();
- cm_bye ();
- exit (FATAL);
- }
-}
-
/* **************************************************************** */
-/* */
-/* Main () Start of code */
-/* */
+/* */
+/* Main () Start of code */
+/* */
/* **************************************************************** */
/* For each file mentioned in the command line, process it, turning
@@ -941,174 +829,144 @@ main (argc, argv)
/* The name of this program is the last filename in argv[0]. */
progname = filename_part (argv[0]);
-#ifdef HAVE_SETLOCALE
- /* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing
- of the argument to @multicolumn. */
- setlocale (LC_TIME, "");
- setlocale (LC_MESSAGES, "");
-#endif
-
- /* Set the text message domain. */
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
/* Parse argument flags from the input line. */
- while ((c = getopt_long (argc, argv, "D:e:E:f:I:o:p:P:r:s:U:V",
- long_options, &ind)) != EOF)
+ while ((c = getopt_long
+ (argc, argv,
+#if defined (HAVE_MACROS)
+ "D:E:U:I:f:o:p:e:r:s:V",
+#else
+ "D:U:I:f:o:p:e:r:s:V",
+#endif /* !HAVE_MACROS */
+ long_options, &ind))
+ != EOF)
{
if (c == 0 && long_options[ind].flag == 0)
- c = long_options[ind].val;
+ c = long_options[ind].val;
switch (c)
- {
- case 'D':
- case 'U':
- /* User specified variable to set or clear. */
- handle_variable_internal ((c == 'D') ? SET : CLEAR, optarg);
- break;
-
- case 'e':
- /* User specified error level. */
- if (sscanf (optarg, "%d", &max_error_level) != 1)
- {
- fprintf (stderr,
- _("%s: %s arg must be numeric, not `%s'.\n"),
- "--error-limit", progname, optarg);
- usage (stderr, FATAL);
- }
- break;
-
- case 'E':
- /* User specified a macro expansion output file. */
- if (!macro_expansion_output_stream)
- {
- macro_expansion_filename = optarg;
- macro_expansion_output_stream
- = strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w");
- if (!macro_expansion_output_stream)
- error (_("Couldn't open macro expansion output `%s'"), optarg);
- }
- else
- error (_("Cannot specify more than one macro expansion output"));
- break;
-
- case 'f':
- /* User specified fill_column. */
- if (sscanf (optarg, "%d", &fill_column) != 1)
- {
- fprintf (stderr,
- _("%s: %s arg must be numeric, not `%s'.\n"),
- "--fill-column", progname, optarg);
- usage (FATAL);
- }
- break;
-
- case 'F':
- force++; /* Do not remove erroneous output. */
- break;
-
- case 'h':
- usage (NO_ERROR);
- break;
-
- case 'I':
- /* Append user-specified dir to include file path. */
- if (!include_files_path)
- include_files_path = xstrdup (".");
-
- include_files_path = (char *)
- xrealloc (include_files_path,
- 2 + strlen (include_files_path) + strlen (optarg));
- strcat (include_files_path, ":");
- strcat (include_files_path, optarg);
- break;
-
- case 'o':
- /* User specified output file. */
- command_output_filename = xstrdup (optarg);
- break;
-
- case 'p':
- /* User specified paragraph indent (paragraph_start_index). */
- if (set_paragraph_indent (optarg) < 0)
- {
- fprintf (stderr,
- _("%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"),
+ {
+ /* User specified variable to set or clear? */
+ case 'D':
+ case 'U':
+ handle_variable_internal ((c == 'D') ? SET : CLEAR, optarg);
+ break;
+
+#if defined (HAVE_MACROS)
+ /* Use specified a macro expansion output file? */
+ case 'E':
+ if (!macro_expansion_output_stream)
+ {
+ macro_expansion_output_stream = fopen (optarg, "w");
+ if (!macro_expansion_output_stream)
+ error ("Couldn't open macro expansion output \"%s\"", optarg);
+ }
+ else
+ error ("Cannot specify more than one macro expansion output");
+ break;
+#endif /* HAVE_MACROS */
+
+ /* User specified include file path? */
+ case 'I':
+ if (!include_files_path)
+ include_files_path = strdup (".");
+
+ include_files_path = (char *)
+ xrealloc (include_files_path,
+ 2 + strlen (include_files_path) + strlen (optarg));
+ strcat (include_files_path, ":");
+ strcat (include_files_path, optarg);
+ break;
+
+ /* User specified fill_column? */
+ case 'f':
+ if (sscanf (optarg, "%d", &fill_column) != 1)
+ {
+ fprintf (stderr,
+ "%s: --fill-column arg must be numeric, not `%s'.\n",
progname, optarg);
- usage (FATAL);
- }
- break;
-
- case 'P':
- /* Prepend user-specified include dir to include path. */
- if (!include_files_path)
- {
- include_files_path = xstrdup (optarg);
- include_files_path = (char *) xrealloc (include_files_path,
- strlen (include_files_path) + 3); /* 3 for ":.\0" */
- strcat (include_files_path, ":.");
- }
- else
- {
- char *tmp = xstrdup (include_files_path);
- include_files_path = (char *) xrealloc (include_files_path,
- strlen (include_files_path) + strlen (optarg) + 2); /* 2 for ":\0" */
- strcpy (include_files_path, optarg);
- strcat (include_files_path, ":");
- strcat (include_files_path, tmp);
- free (tmp);
- }
- break;
-
- case 'r':
- /* User specified reference warning limit. */
- if (sscanf (optarg, "%d", &reference_warning_limit) != 1)
- {
- fprintf (stderr,
- _("%s: %s arg must be numeric, not `%s'.\n"),
- "--reference-limit", progname, optarg);
- usage (FATAL);
- }
- break;
-
- case 's':
- /* User specified footnote style. */
- if (set_footnote_style (optarg) < 0)
- {
- fprintf (stderr,
- _("%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"),
+ usage (FATAL);
+ }
+ break;
+
+ /* User specified output file? */
+ case 'o':
+ command_output_filename = strdup (optarg);
+ break;
+
+ /* User specified paragraph indent (paragraph_start_index)? */
+ case 'p':
+ if (set_paragraph_indent (optarg) < 0)
+ {
+ fprintf (stderr,
+ "%s: --paragraph-indent arg must be numeric/none/asis, not `%s'.\n",
progname, optarg);
- usage (FATAL);
- }
- footnote_style_preset = 1;
- break;
-
- case 'V':
- /* User requested version info. */
- print_version_info ();
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ usage (FATAL);
+ }
+ break;
+
+ /* User specified error level? */
+ case 'e':
+ if (sscanf (optarg, "%d", &max_error_level) != 1)
+ {
+ fprintf (stderr,
+ "%s: --error-limit arg must be numeric, not `%s'.\n",
+ progname, optarg);
+ }
+ usage (stderr, FATAL);
+ break;
+
+ /* User specified reference warning limit? */
+ case 'r':
+ if (sscanf (optarg, "%d", &reference_warning_limit) != 1)
+ {
+ fprintf (stderr,
+ "%s: --reference-limit arg must be numeric, not `%s'.\n",
+ progname, optarg);
+ usage (FATAL);
+ }
+ break;
+
+ /* User specified footnote style? */
+ case 's':
+ if (set_footnote_style (optarg) < 0)
+ {
+ fprintf (stderr,
+ "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n",
+ progname, optarg);
+ usage (FATAL);
+ }
+ footnote_style_preset = 1;
+ break;
+
+ case 'h':
+ usage (NO_ERROR);
+ break;
+
+ /* User requested version info? */
+ case 'V':
+ print_version_info ();
+ puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (NO_ERROR);
- break;
-
- case '?':
- usage (FATAL);
- break;
- }
+For more information about these matters, see the files named COPYING.");
+ exit (NO_ERROR);
+ break;
+
+ case '?':
+ usage (FATAL);
+ break;
+ }
}
if (optind == argc)
{
/* Check to see if input is a file. If so, process that. */
if (!isatty (fileno (stdin)))
- reading_from_stdin = 1;
+ reading_from_stdin = 1;
else
{
- fprintf (stderr, _("%s: missing file argument.\n"), progname);
- usage (FATAL);
+ fprintf (stderr, "%s: missing file argument.\n", progname);
+ usage (FATAL);
}
}
@@ -1120,9 +978,10 @@ For more information about these matters, see the files named COPYING.\n"),
{
splitting = 0;
- /* If the user has not specified an output file, use stdout. */
+ /* If the user has not specified an output file, then use stdout by
+ default. */
if (!command_output_filename)
- command_output_filename = xstrdup ("-");
+ command_output_filename = strdup ("-");
}
if (verbose_mode)
@@ -1133,7 +992,7 @@ For more information about these matters, see the files named COPYING.\n"),
if (!reading_from_stdin)
{
while (optind != argc)
- convert_from_file (argv[optind++]);
+ convert_from_file (argv[optind++]);
}
else
convert_from_stream (stdin, "stdin");
@@ -1148,8 +1007,60 @@ For more information about these matters, see the files named COPYING.\n"),
void
print_version_info ()
{
- printf ("makeinfo (GNU %s %s) %d.%d\n", PACKAGE, VERSION,
- major_version, minor_version);
+ printf ("GNU Makeinfo (Texinfo 3.9) %d.%d\n", major_version, minor_version);
+}
+
+/* **************************************************************** */
+/* */
+/* Generic Utilities */
+/* */
+/* **************************************************************** */
+
+static void
+memory_error (callers_name, bytes_wanted)
+ char *callers_name;
+ int bytes_wanted;
+{
+ char printable_string[80];
+
+ sprintf (printable_string,
+ "Virtual memory exhausted in %s ()! Needed %d bytes.",
+ callers_name, bytes_wanted);
+
+ error (printable_string);
+ abort ();
+}
+
+/* Just like malloc, but kills the program in case of fatal error. */
+void *
+xmalloc (nbytes)
+ unsigned int nbytes;
+{
+ void *temp = (void *) malloc (nbytes);
+
+ if (nbytes && temp == (void *)NULL)
+ memory_error ("xmalloc", nbytes);
+
+ return (temp);
+}
+
+/* Like realloc (), but barfs if there isn't enough memory. */
+void *
+xrealloc (pointer, nbytes)
+ void *pointer;
+ unsigned int nbytes;
+{
+ void *temp;
+
+ if (!pointer)
+ temp = (void *)xmalloc (nbytes);
+ else
+ temp = (void *)realloc (pointer, nbytes);
+
+ if (nbytes && !temp)
+ memory_error ("xrealloc", nbytes);
+
+ return (temp);
}
/* If EXIT_VALUE is zero, print the full usage message to stdout.
@@ -1160,18 +1071,17 @@ usage (exit_value)
int exit_value;
{
if (exit_value != 0)
- fprintf (stderr, _("Try `%s --help' for more information.\n"), progname);
+ fprintf (stderr, "Try `%s --help' for more information.\n", progname);
else
- printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n\
+ printf ("Usage: %s [OPTION]... TEXINFO-FILE...\n\
\n\
Translate Texinfo source documentation to a format suitable for reading\n\
with GNU Info.\n\
\n\
Options:\n\
-D VAR define a variable, as with @set.\n\
--E MACRO-OFILE process macros only, output texinfo source.\n\
--I DIR append DIR to the @include directory search path.\n\
--P DIR prepend DIR to the @include directory search path.\n\
+-E MACRO-OFILE process macros only, output texinfo source.\n\
+-I DIR add DIR to the directory search list for @include.\n\
-U VAR undefine a variable, as with @clear.\n\
--error-limit NUM quit after NUM errors (default %d).\n\
--fill-column NUM break lines at NUM characters (default %d).\n\
@@ -1179,24 +1089,21 @@ Options:\n\
`separate' to place footnotes in their own node,\n\
`end' to place the footnotes at the end of\n\
the node in which they are defined (the default).\n\
---force preserve output even if errors.\n\
--help display this help and exit.\n\
--no-validate suppress node cross-reference validation.\n\
--no-warn suppress warnings (but not errors).\n\
--no-split suppress splitting of large files.\n\
--no-headers suppress node separators and Node: Foo headers.\n\
--output FILE, -o FILE output to FILE, and ignore any @setfilename.\n\
---paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n\
- if VAL is `none', do not indent; if VAL is `asis',\n\
- preserve any existing indentation.\n\
+--paragraph-indent NUM indent paragraphs with NUM spaces (default %d).\n\
--reference-limit NUM complain about at most NUM references (default %d).\n\
--verbose report about what is being done.\n\
--version display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.\n\
-"),
- progname, max_error_level, fill_column,
- paragraph_start_indent, reference_warning_limit);
+Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
+",
+ progname, paragraph_start_indent,
+ fill_column, max_error_level, reference_warning_limit);
exit (exit_value);
}
@@ -1236,7 +1143,7 @@ find_and_load (filename)
{
struct stat fileinfo;
long file_size;
- int file = -1, count = 0;
+ int file = -1, n, i, count = 0;
char *fullpath, *result, *get_file_info_in_path ();
result = fullpath = (char *)NULL;
@@ -1253,35 +1160,31 @@ find_and_load (filename)
if (file < 0)
goto error_exit;
- /* Load the file, with enough room for a newline and a null. */
- result = xmalloc (file_size + 2);
+ /* Load the file. */
+ result = (char *)xmalloc (1 + file_size);
/* VMS stat lies about the st_size value. The actual number of
readable bytes is always less than this value. The arcane
mysteries of VMS/RMS are too much to probe, so this hack
suffices to make things work. */
-#if defined (VMS) || defined (WIN32)
-#ifdef VMS
+#if defined (VMS)
while ((n = read (file, result + count, file_size)) > 0)
-#else /* WIN32 */
- while ((n = read (file, result + count, 1)) > 0)
-#endif /* WIN32 */
count += n;
if (n == -1)
-#else /* !VMS && !WIN32 */
+#else /* !VMS */
count = file_size;
if (read (file, result, file_size) != file_size)
-#endif /* !VMS && !WIN32 */
+#endif /* !VMS */
error_exit:
{
if (result)
- free (result);
+ free (result);
if (fullpath)
- free (fullpath);
+ free (fullpath);
if (file != -1)
- close (file);
+ close (file);
return ((char *) NULL);
}
@@ -1291,15 +1194,13 @@ find_and_load (filename)
input_text = result;
size_of_input_text = count;
input_filename = fullpath;
- node_filename = xstrdup (fullpath);
+ node_filename = strdup (fullpath);
input_text_offset = 0;
line_number = 1;
/* Not strictly necessary. This magic prevents read_token () from doing
extra unnecessary work each time it is called (that is a lot of times).
- SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
+ The SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
input_text[size_of_input_text] = '\n';
- /* This, on the other hand, is always necessary. */
- input_text[size_of_input_text+1] = 0;
return (result);
}
@@ -1326,7 +1227,7 @@ popfile ()
FSTACK *tos = filestack;
if (!tos)
- abort (); /* My fault. I wonder what I did? */
+ abort (); /* My fault. I wonder what I did? */
#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
@@ -1340,7 +1241,7 @@ popfile ()
filestack = filestack->next;
/* Make sure that commands with braces have been satisfied. */
- if (!executing_string && !me_executing_string)
+ if (!executing_string)
discard_braces ();
/* Get the top of the stack into the globals. */
@@ -1405,7 +1306,7 @@ filename_part (filename)
else
basename++;
- basename = xstrdup (basename);
+ basename = strdup (basename);
#if defined (REMOVE_OUTPUT_EXTENSIONS)
/* See if there is an extension to remove. If so, remove it. */
@@ -1414,7 +1315,7 @@ filename_part (filename)
temp = strrchr (basename, '.');
if (temp)
- *temp = 0;
+ *temp = '\0';
}
#endif /* REMOVE_OUTPUT_EXTENSIONS */
return (basename);
@@ -1442,7 +1343,7 @@ pathname_part (filename)
{
result = (char *)xmalloc (1 + i);
strncpy (result, filename, i);
- result[i] = 0;
+ result[i] = '\0';
}
free (filename);
return (result);
@@ -1456,9 +1357,9 @@ filename_non_directory (name)
for (i = strlen (name) - 1; i; i--)
if (name[i] == '/')
- return (xstrdup (name + i + 1));
+ return (strdup (name + i + 1));
- return (xstrdup (name));
+ return (strdup (name));
}
/* Return the expansion of FILENAME. */
@@ -1476,24 +1377,24 @@ expand_filename (filename, input_name)
filename = filename_non_directory (input_name);
if (!*filename)
- {
- free (filename);
- filename = xstrdup ("noname.texi");
- }
+ {
+ free (filename);
+ filename = strdup ("noname.texi");
+ }
for (i = strlen (filename) - 1; i; i--)
- if (filename[i] == '.')
- break;
+ if (filename[i] == '.')
+ break;
if (!i)
- i = strlen (filename);
+ i = strlen (filename);
if (i + 6 > (strlen (filename)))
- filename = (char *)xrealloc (filename, i + 6);
+ filename = (char *)xrealloc (filename, i + 6);
strcpy (filename + i, ".info");
return (filename);
}
-
+
if (filename[0] == '.' || filename[0] == '/')
return (filename);
@@ -1508,10 +1409,10 @@ expand_filename (filename, input_name)
strcpy (result, input_name);
while (result[i] != '/' && i)
- i--;
+ i--;
if (result[i] == '/')
- i++;
+ i++;
strcpy (&result[i], filename);
free (filename);
@@ -1530,13 +1431,13 @@ full_pathname (filename)
/* No filename given? */
if (!filename || !(initial_character = *filename))
- return (xstrdup (""));
+ return (strdup (""));
/* Already absolute? */
if ((initial_character == '/') ||
((strncmp (filename, "./", 2) == 0) ||
(strncmp (filename, "../", 3) == 0)))
- return (xstrdup (filename));
+ return (strdup (filename));
if (initial_character != '~')
{
@@ -1546,68 +1447,66 @@ full_pathname (filename)
#if defined (HAVE_GETCWD)
if (!getcwd (localdir, 1024))
#else /* !HAVE_GETCWD */
- if (!getwd (localdir))
+ if (!getwd (localdir))
#endif /* !HAVE_GETCWD */
- {
- fprintf (stderr, _("%s: getwd: %s, %s\n"),
- progname, filename, localdir);
- exit (1);
- }
+ {
+ fprintf (stderr, "%s: getwd: %s, %s\n",
+ progname, filename, localdir);
+ exit (1);
+ }
strcat (localdir, "/");
strcat (localdir, filename);
- result = xstrdup (localdir);
+ result = strdup (localdir);
free (localdir);
}
else
{
-#ifndef WIN32
if (filename[1] == '/')
- {
- /* Return the concatenation of the environment variable HOME
- and the rest of the string. */
- char *temp_home;
-
- temp_home = (char *) getenv ("HOME");
- result = (char *)xmalloc (strlen (&filename[1])
- + 1
- + temp_home ? strlen (temp_home)
- : 0);
- *result = 0;
-
- if (temp_home)
- strcpy (result, temp_home);
-
- strcat (result, &filename[1]);
- }
+ {
+ /* Return the concatenation of the environment variable HOME
+ and the rest of the string. */
+ char *temp_home;
+
+ temp_home = (char *) getenv ("HOME");
+ result = (char *)xmalloc (strlen (&filename[1])
+ + 1
+ + temp_home ? strlen (temp_home)
+ : 0);
+ *result = '\0';
+
+ if (temp_home)
+ strcpy (result, temp_home);
+
+ strcat (result, &filename[1]);
+ }
else
- {
- struct passwd *user_entry;
- int i, c;
- char *username = (char *)xmalloc (257);
-
- for (i = 1; (c = filename[i]); i++)
- {
- if (c == '/')
- break;
- else
- username[i - 1] = c;
- }
- if (c)
- username[i - 1] = 0;
-
- user_entry = getpwnam (username);
-
- if (!user_entry)
- return (xstrdup (filename));
-
- result = (char *)xmalloc (1 + strlen (user_entry->pw_dir)
- + strlen (&filename[i]));
- strcpy (result, user_entry->pw_dir);
- strcat (result, &filename[i]);
- }
+ {
+ struct passwd *user_entry;
+ int i, c;
+ char *username = (char *)xmalloc (257);
+
+ for (i = 1; c = filename[i]; i++)
+ {
+ if (c == '/')
+ break;
+ else
+ username[i - 1] = c;
+ }
+ if (c)
+ username[i - 1] = '\0';
+
+ user_entry = getpwnam (username);
+
+ if (!user_entry)
+ return (strdup (filename));
+
+ result = (char *)xmalloc (1 + strlen (user_entry->pw_dir)
+ + strlen (&filename[i]));
+ strcpy (result, user_entry->pw_dir);
+ strcat (result, &filename[i]);
+ }
}
-#endif /* not WIN32 */
return (result);
}
@@ -1619,9 +1518,139 @@ output_name_from_input_name (name)
}
/* **************************************************************** */
-/* */
-/* Hacking Tokens and Strings */
-/* */
+/* */
+/* Error Handling */
+/* */
+/* **************************************************************** */
+
+/* Number of errors encountered. */
+int errors_printed = 0;
+
+/* Print the last error gotten from the file system. */
+int
+fs_error (filename)
+ char *filename;
+{
+ remember_error ();
+ perror (filename);
+ return (0);
+}
+
+/* Print an error message, and return false. */
+#if defined (HAVE_VARARGS_H) && defined (HAVE_VFPRINTF)
+
+int
+error (va_alist)
+ va_dcl
+{
+ char *format;
+ va_list args;
+
+ remember_error ();
+ va_start (args);
+ format = va_arg (args, char *);
+ vfprintf (stderr, format, args);
+ va_end (args);
+ putc ('\n', stderr);
+}
+
+/* Just like error (), but print the line number as well. */
+int
+line_error (va_alist)
+ va_dcl
+{
+ char *format;
+ va_list args;
+
+ remember_error ();
+ va_start (args);
+ format = va_arg (args, char *);
+ fprintf (stderr, "%s:%d: ", input_filename, line_number);
+ vfprintf (stderr, format, args);
+ fprintf (stderr, ".\n");
+ va_end (args);
+ return ((int) 0);
+}
+
+int
+warning (va_alist)
+ va_dcl
+{
+ char *format;
+ va_list args;
+
+ va_start (args);
+ format = va_arg (args, char *);
+ if (print_warnings)
+ {
+ fprintf (stderr, "%s:%d: Warning: ", input_filename, line_number);
+ vfprintf (stderr, format, args);
+ fprintf (stderr, ".\n");
+ }
+ va_end (args);
+ return ((int) 0);
+}
+
+#else /* !(HAVE_VARARGS_H && HAVE_VFPRINTF) */
+
+int
+error (format, arg1, arg2, arg3, arg4, arg5)
+ char *format;
+{
+ remember_error ();
+ fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5);
+ putc ('\n', stderr);
+ return ((int) 0);
+}
+
+/* Just like error (), but print the line number as well. */
+int
+line_error (format, arg1, arg2, arg3, arg4, arg5)
+ char *format;
+{
+ remember_error ();
+ fprintf (stderr, "%s:%d: ", input_filename, line_number);
+ fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5);
+ fprintf (stderr, ".\n");
+ return ((int) 0);
+}
+
+int
+warning (format, arg1, arg2, arg3, arg4, arg5)
+ char *format;
+{
+ if (print_warnings)
+ {
+ fprintf (stderr, "%s:%d: Warning: ", input_filename, line_number);
+ fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5);
+ fprintf (stderr, ".\n");
+ }
+ return ((int) 0);
+}
+
+#endif /* !(HAVE_VARARGS_H && HAVE_VFPRINTF) */
+
+/* Remember that an error has been printed. If this is the first
+ error printed, then tell them which program is printing them.
+ If more than max_error_level have been printed, then exit the
+ program. */
+void
+remember_error ()
+{
+ errors_printed++;
+ if (max_error_level && (errors_printed > max_error_level))
+ {
+ fprintf (stderr, "Too many errors! Gave up.\n");
+ flush_file_stack ();
+ cm_bye ();
+ exit (1);
+ }
+}
+
+/* **************************************************************** */
+/* */
+/* Hacking Tokens and Strings */
+/* */
/* **************************************************************** */
/* Return the next token as a string pointer. We cons the string. */
@@ -1639,24 +1668,24 @@ read_token ()
input_text_offset++;
if (character == '\n')
- line_number++;
+ line_number++;
- result = xstrdup (" ");
+ result = strdup (" ");
*result = character;
return (result);
}
for (i = 0; ((input_text_offset != size_of_input_text)
- && (character = curchar ())
- && command_char (character));
+ && (character = curchar ())
+ && command_char (character));
i++, input_text_offset++);
result = (char *)xmalloc (i + 1);
memcpy (result, &input_text[input_text_offset - i], i);
- result[i] = 0;
+ result[i] = '\0';
return (result);
}
-/* Return nonzero if CHARACTER is self-delimiting. */
+/* Return non-zero if CHARACTER is self-delimiting. */
int
self_delimiting (character)
int character;
@@ -1680,17 +1709,17 @@ canon_white (string)
for (x = 0; x < len; x++)
{
if (!cr_or_whitespace (string[x]))
- {
- strcpy (string, string + x);
- break;
- }
+ {
+ strcpy (string, string + x);
+ break;
+ }
}
len = strlen (string);
if (len)
len--;
while (len > -1 && cr_or_whitespace (string[len]))
len--;
- string[len + 1] = 0;
+ string[len + 1] = '\0';
}
/* Bash STRING, replacing all whitespace with just one space. */
@@ -1710,15 +1739,15 @@ fix_whitespace (string)
c = temp[temp_index++] = string[string_index++];
if (c == ' ' || c == '\n' || c == '\t')
- {
- temp[temp_index - 1] = ' ';
- while ((c = string[string_index]) && (c == ' ' ||
- c == '\t' ||
- c == '\n'))
- string_index++;
- }
- }
- temp[temp_index] = 0;
+ {
+ temp[temp_index - 1] = ' ';
+ while ((c = string[string_index]) && (c == ' ' ||
+ c == '\t' ||
+ c == '\n'))
+ string_index++;
+ }
+ }
+ temp[temp_index] = '\0';
strcpy (string, temp);
free (temp);
}
@@ -1744,10 +1773,10 @@ discard_until (string)
input_text_offset = size_of_input_text - strlen (string);
if (strcmp (string, "\n") != 0)
- {
- line_error (_("Expected `%s'"), string);
- return;
- }
+ {
+ line_error ("Expected `%s'", string);
+ return;
+ }
}
else
input_text_offset = temp;
@@ -1781,7 +1810,7 @@ get_until (match, string)
*string = (char *)xmalloc (len + 1);
memcpy (*string, &input_text[current_point], len);
- (*string)[len] = 0;
+ (*string)[len] = '\0';
/* Now leave input_text_offset in a consistent state. */
input_text_offset = tem;
@@ -1795,68 +1824,18 @@ get_until (match, string)
/* Read characters from the file until we are at MATCH or end of line.
Place the characters read into STRING. */
void
-get_until_in_line (expand, match, string)
- int expand;
+get_until_in_line (match, string)
char *match, **string;
{
- int real_bottom = size_of_input_text;
- int limit = search_forward ("\n", input_text_offset);
- if (limit < 0)
- limit = size_of_input_text;
-
- /* Replace input_text[input_text_offset .. limit-1] with its macro
- expansion (actually, we expand all commands). This allows the node
- names themselves to be constructed via a macro, as in:
- @macro foo{p, q}
- Together: \p\ & \q\.
- @end macro
-
- @node @foo{A,B}, next, prev, top
-
- Otherwise, the `,' separating the macro args A and B is taken as
- the node argument separator, so the node name is `@foo{A'. This
- expansion is only necessary on the first call, since we expand the
- whole line then.
-
- Furthermore, if we're executing a string, don't do it -- we'll end
- up shrinking the execution string which is currently aliased to
- `input_text', so it might get moved, and not updated in the
- `execution_strings' array. This happens when processing the
- (synthetic) Overview-Footnotes node in the Texinfo manual. */
-
- if (expand && !executing_string && !me_executing_string)
- {
- char *xp;
- unsigned xp_len, new_len;
-
- /* Get original string from input. */
- unsigned raw_len = limit - input_text_offset;
- char *str = xmalloc (raw_len + 1);
- strncpy (str, input_text + input_text_offset, raw_len);
- str[raw_len] = 0;
-
- /* Expand it. */
- xp = expansion (str, 0);
- xp_len = strlen (xp);
- free (str);
-
- /* Plunk the expansion into the middle of `input_text' --
- which is terminated by a newline, not a null. */
- str = xmalloc (real_bottom - limit + 1);
- strncpy (str, input_text + limit, real_bottom - limit + 1);
- new_len = input_text_offset + xp_len + real_bottom - limit + 1;
- input_text = xrealloc (input_text, new_len);
- strcpy (input_text + input_text_offset, xp);
- strncpy (input_text + input_text_offset + xp_len, str,
- real_bottom - limit + 1);
- free (str);
- free (xp);
-
- limit += xp_len - raw_len;
- real_bottom += xp_len - raw_len;
- }
+ int real_bottom, temp;
+
+ real_bottom = size_of_input_text;
+ temp = search_forward ("\n", input_text_offset);
- size_of_input_text = limit;
+ if (temp < 0)
+ temp = size_of_input_text;
+
+ size_of_input_text = temp;
get_until (match, string);
size_of_input_text = real_bottom;
}
@@ -1868,7 +1847,7 @@ get_rest_of_line (string)
get_until ("\n", string);
canon_white (*string);
- if (curchar () == '\n') /* as opposed to the end of the file... */
+ if (curchar () == '\n') /* as opposed to the end of the file... */
{
line_number++;
input_text_offset++;
@@ -1884,7 +1863,7 @@ backup_input_pointer ()
{
input_text_offset--;
if (curchar () == '\n')
- line_number--;
+ line_number--;
}
}
@@ -1894,36 +1873,36 @@ void
get_until_in_braces (match, string)
char *match, **string;
{
- char *temp;
int i, brace = 0;
int match_len = strlen (match);
+ char *temp;
for (i = input_text_offset; i < size_of_input_text; i++)
{
if (input_text[i] == '{')
- brace++;
+ brace++;
else if (input_text[i] == '}')
- brace--;
+ brace--;
else if (input_text[i] == '\n')
- line_number++;
+ line_number++;
if (brace < 0 ||
- (brace == 0 && strncmp (input_text + i, match, match_len) == 0))
- break;
+ (brace == 0 && strncmp (input_text + i, match, match_len) == 0))
+ break;
}
match_len = i - input_text_offset;
temp = (char *)xmalloc (2 + match_len);
strncpy (temp, input_text + input_text_offset, match_len);
- temp[match_len] = 0;
+ temp[match_len] = '\0';
input_text_offset = i;
*string = temp;
}
/* **************************************************************** */
-/* */
-/* Converting the File */
-/* */
+/* */
+/* Converting the File */
+/* */
/* **************************************************************** */
/* Convert the file named by NAME. The output is saved on the file
@@ -1955,7 +1934,7 @@ initialize_conversion ()
on unix systems. */
#define READ_BUFFER_GROWTH (4 * 4096)
-/* Convert the Texinfo file coming from the open stream STREAM. Assume the
+/* Convert the texinfo file coming from the open stream STREAM. Assume the
source of the stream is named NAME. */
void
convert_from_stream (stream, name)
@@ -1975,27 +1954,27 @@ convert_from_stream (stream, name)
int count;
if (buffer_offset + (READ_BUFFER_GROWTH + 1) >= buffer_size)
- buffer = (char *)
- xrealloc (buffer, (buffer_size += READ_BUFFER_GROWTH));
+ buffer = (char *)
+ xrealloc (buffer, (buffer_size += READ_BUFFER_GROWTH));
count = fread (buffer + buffer_offset, 1, READ_BUFFER_GROWTH, stream);
if (count < 0)
- {
- perror (name);
- exit (FATAL);
- }
+ {
+ perror (name);
+ exit (FATAL);
+ }
buffer_offset += count;
if (count == 0)
- break;
+ break;
}
/* Set the globals to the new file. */
input_text = buffer;
size_of_input_text = buffer_offset;
- input_filename = xstrdup (name);
- node_filename = xstrdup (name);
+ input_filename = strdup (name);
+ node_filename = strdup (name);
input_text_offset = 0;
line_number = 1;
@@ -2025,14 +2004,14 @@ convert_from_file (name)
strcat (filename, suffixes[i]);
if (find_and_load (filename))
- break;
+ break;
if (!suffixes[i][0] && strrchr (filename, '.'))
- {
- fs_error (filename);
- free (filename);
- return;
- }
+ {
+ fs_error (filename);
+ free (filename);
+ return;
+ }
}
if (!suffixes[i])
@@ -2064,47 +2043,47 @@ convert_from_loaded_file (name)
while (input_text_offset >= 0)
{
input_text_offset =
- search_forward (setfilename_search, input_text_offset);
+ search_forward (setfilename_search, input_text_offset);
if ((input_text_offset == 0) ||
- ((input_text_offset > 0) &&
- (input_text[input_text_offset -1] == '\n')))
- break;
+ ((input_text_offset > 0) &&
+ (input_text[input_text_offset -1] == '\n')))
+ break;
else if (input_text_offset > 0)
- input_text_offset++;
+ input_text_offset++;
}
if (input_text_offset < 0)
{
if (!command_output_filename)
- {
+ {
#if defined (REQUIRE_SETFILENAME)
- error (_("No `%s' found in `%s'"), setfilename_search, name);
- goto finished;
+ error ("No `%s' found in `%s'", setfilename_search, name);
+ goto finished;
#else
- register int i, end_of_first_line;
-
- /* Find the end of the first line in the file. */
- for (i = 0; i < size_of_input_text - 1; i++)
- if (input_text[i] == '\n')
- break;
-
- end_of_first_line = i + 1;
-
- input_text_offset = 0;
-
- for (i = 0; i < end_of_first_line; i++)
- {
- if ((input_text[i] == '\\') &&
- (strncmp (input_text + i + 1, "include", 7) == 0))
- {
- input_text_offset = end_of_first_line;
- break;
- }
- }
- command_output_filename = output_name_from_input_name (name);
+ register int i, end_of_first_line;
+
+ /* Find the end of the first line in the file. */
+ for (i = 0; i < size_of_input_text - 1; i++)
+ if (input_text[i] == '\n')
+ break;
+
+ end_of_first_line = i + 1;
+
+ input_text_offset = 0;
+
+ for (i = 0; i < end_of_first_line; i++)
+ {
+ if ((input_text[i] == '\\') &&
+ (strncmp (input_text + i + 1, "include", 7) == 0))
+ {
+ input_text_offset = end_of_first_line;
+ break;
+ }
+ }
+ command_output_filename = output_name_from_input_name (name);
#endif /* !REQUIRE_SETFILENAME */
- }
+ }
}
else
input_text_offset += strlen (setfilename_search);
@@ -2114,9 +2093,9 @@ convert_from_loaded_file (name)
else
{
if (input_text_offset != -1)
- discard_until ("\n");
+ discard_until ("\n");
else
- input_text_offset = 0;
+ input_text_offset = 0;
real_output_filename = output_filename = command_output_filename;
command_output_filename = (char *)NULL;
@@ -2124,31 +2103,25 @@ convert_from_loaded_file (name)
canon_white (output_filename);
- if (real_output_filename && strcmp (real_output_filename, "-") == 0)
+ if (real_output_filename &&
+ strcmp (real_output_filename, "-") == 0)
{
- if (macro_expansion_filename
- && strcmp (macro_expansion_filename, "-") == 0)
- {
- fprintf (stderr, _("%s: Skipping macro expansion to stdout as Info output is going there.\n"),
- progname);
- macro_expansion_output_stream = NULL;
- }
- real_output_filename = xstrdup (real_output_filename);
+ real_output_filename = strdup (real_output_filename);
output_stream = stdout;
- splitting = 0; /* Cannot split when writing to stdout. */
+ splitting = 0; /* Cannot split when writing to stdout. */
}
else
{
if (!real_output_filename)
- real_output_filename = expand_filename (output_filename, name);
+ real_output_filename = expand_filename (output_filename, name);
else
- real_output_filename = xstrdup (real_output_filename);
+ real_output_filename = strdup (real_output_filename);
output_stream = fopen (real_output_filename, "w");
}
- if (output_stream != stdout)
- printf (_("Making %s file `%s' from `%s'.\n"),
+ if (verbose_mode && output_stream != stdout)
+ printf ("Making %s file `%s' from `%s'.\n",
no_headers ? "text" : "info", output_filename, input_filename);
if (output_stream == NULL)
@@ -2162,7 +2135,7 @@ convert_from_loaded_file (name)
if (output_stream != stdout)
pretty_output_filename = filename_part (output_filename);
else
- pretty_output_filename = xstrdup ("stdout");
+ pretty_output_filename = strdup ("stdout");
/* For this file only, count the number of newlines from the top of
the file to here. This way, we keep track of line numbers for
@@ -2173,69 +2146,50 @@ convert_from_loaded_file (name)
line_number = 1;
while (temp != input_text_offset)
if (input_text[temp++] == '\n')
- line_number++;
+ line_number++;
}
if (!no_headers)
{
- add_word_args (_("This is Info file %s, produced by Makeinfo version %d.%d"),
- output_filename, major_version, minor_version);
- add_word_args (_(" from the input file %s.\n"), input_filename);
+ add_word_args ("This is Info file %s, produced by Makeinfo version %d.%d",
+ output_filename, major_version, minor_version);
+ add_word_args (" from the input file %s.\n", input_filename);
}
close_paragraph ();
reader_loop ();
finished:
- discard_insertions (0);
close_paragraph ();
flush_file_stack ();
#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
- {
- fclose (macro_expansion_output_stream);
- if (errors_printed && !force
- && strcmp (macro_expansion_filename, "-") != 0
- && strcmp (macro_expansion_filename, "/dev/null") != 0)
- {
- fprintf (stderr, _("%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"),
- progname, macro_expansion_filename);
- if (unlink (macro_expansion_filename) < 0)
- perror (macro_expansion_filename);
- }
- }
+ fclose (macro_expansion_output_stream);
#endif /* HAVE_MACROS */
- if (output_stream)
+ if (output_stream != NULL)
{
output_pending_notes ();
free_pending_notes ();
if (tag_table != NULL)
- {
- tag_table = (TAG_ENTRY *) reverse_list (tag_table);
- if (!no_headers)
- write_tag_table ();
- }
+ {
+ tag_table = (TAG_ENTRY *) reverse_list (tag_table);
+ if (!no_headers)
+ write_tag_table ();
+ }
if (output_stream != stdout)
- fclose (output_stream);
+ fclose (output_stream);
/* If validating, then validate the entire file right now. */
if (validating)
- validate_file (tag_table);
-
- if (splitting && (!errors_printed || force))
- split_file (real_output_filename, 0);
- else if (errors_printed && !force
- && strcmp (real_output_filename, "-") != 0
- && strcmp (real_output_filename, "/dev/null") != 0)
- { /* If there were errors, and no --force, remove the output. */
- fprintf (stderr, _("%s: Removing output file `%s' due to errors; use --force to preserve.\n"),
- progname, real_output_filename);
- if (unlink (real_output_filename) < 0)
- perror (real_output_filename);
- }
+ validate_file (tag_table);
+
+ /* This used to test && !errors_printed.
+ But some files might have legit warnings. So split anyway. */
+ if (splitting)
+ split_file (real_output_filename, 0);
}
free (real_output_filename);
}
@@ -2244,7 +2198,7 @@ void
free_and_clear (pointer)
char **pointer;
{
- if (*pointer)
+ if ((*pointer) != (char *) NULL)
{
free (*pointer);
*pointer = (char *) NULL;
@@ -2255,13 +2209,13 @@ free_and_clear (pointer)
void
init_internals ()
{
+ free_and_clear (&current_node);
free_and_clear (&output_filename);
free_and_clear (&command);
free_and_clear (&input_filename);
free_node_references ();
init_insertion_stack ();
init_brace_stack ();
- current_node = NULL; /* sometimes already freed */
command_index = 0;
in_menu = 0;
in_detailmenu = 0;
@@ -2274,7 +2228,7 @@ init_paragraph ()
{
free_and_clear (&output_paragraph);
output_paragraph = (unsigned char *)xmalloc (paragraph_buffer_len);
- output_paragraph[0] = 0;
+ output_paragraph[0] = '\0';
output_paragraph_offset = 0;
output_column = 0;
paragraph_is_open = 0;
@@ -2296,99 +2250,100 @@ reader_loop ()
while (!done)
{
if (input_text_offset >= size_of_input_text)
- break;
+ break;
character = curchar ();
if (!in_fixed_width_font &&
- (character == '\'' || character == '`') &&
- input_text[input_text_offset + 1] == character)
- {
- input_text_offset++;
- character = '"';
- }
+ (character == '\'' || character == '`') &&
+ input_text[input_text_offset + 1] == character)
+ {
+ input_text_offset++;
+ character = '"';
+ }
if (character == '-')
- {
- dash_count++;
- if (dash_count == 2 && !in_fixed_width_font)
- {
- input_text_offset++;
- continue;
- }
- }
+ {
+ dash_count++;
+ if (dash_count == 2 && !in_fixed_width_font)
+ {
+ input_text_offset++;
+ continue;
+ }
+ }
else
- {
- dash_count = 0;
- }
+ {
+ dash_count = 0;
+ }
/* If this is a whitespace character, then check to see if the line
- is blank. If so, advance to the carriage return. */
+ is blank. If so, advance to the carriage return. */
if (whitespace (character))
- {
- register int i = input_text_offset + 1;
+ {
+ register int i = input_text_offset + 1;
- while (i < size_of_input_text && whitespace (input_text[i]))
- i++;
+ while (i < size_of_input_text && whitespace (input_text[i]))
+ i++;
- if (i == size_of_input_text || input_text[i] == '\n')
- {
- if (i == size_of_input_text)
- i--;
+ if (i == size_of_input_text || input_text[i] == '\n')
+ {
+ if (i == size_of_input_text)
+ i--;
- input_text_offset = i;
- character = curchar ();
- }
- }
+ input_text_offset = i;
+ character = curchar ();
+ }
+ }
if (character == '\n')
- {
- line_number++;
-
- /* Check for a menu entry here, since the "escape sequence"
- that begins menu entries is "\n* ". */
- if (in_menu && input_text_offset + 1 < size_of_input_text)
- {
- char *glean_node_from_menu (), *tem;
-
- /* Note that the value of TEM is discarded, since it is
- gauranteed to be NULL when glean_node_from_menu () is
- called with a Nonzero argument. */
- if (!in_detailmenu)
- tem = glean_node_from_menu (1);
- }
- }
+ {
+ line_number++;
+
+ /* Check for a menu entry here, since the "escape sequence"
+ that begins menu entries is "\n* ". */
+ if (in_menu && input_text_offset + 1 < size_of_input_text)
+ {
+ char *glean_node_from_menu (), *tem;
+
+ /* Note that the value of TEM is discarded, since it is
+ gauranteed to be NULL when glean_node_from_menu () is
+ called with a non-zero argument. */
+ if (!in_detailmenu)
+ tem = glean_node_from_menu (1);
+ }
+ }
switch (character)
- {
- case COMMAND_PREFIX:
- read_command ();
- break;
-
- case '{':
- /* Special case. I'm not supposed to see this character by itself.
- If I do, it means there is a syntax error in the input text.
- Report the error here, but remember this brace on the stack so
- you can ignore its partner. */
-
- line_error (_("Misplaced %c"), '{');
- remember_brace (misplaced_brace);
-
- /* Don't advance input_text_offset since this happens in
- remember_brace ().
- input_text_offset++;
+ {
+ case COMMAND_PREFIX:
+ read_command ();
+ break;
+
+ case '{':
+
+ /* Special case. I'm not supposed to see this character by itself.
+ If I do, it means there is a syntax error in the input text.
+ Report the error here, but remember this brace on the stack so
+ you can ignore its partner. */
+
+ line_error ("Misplaced `{'");
+ remember_brace (misplaced_brace);
+
+ /* Don't advance input_text_offset since this happens in
+ remember_brace ().
+ input_text_offset++;
*/
- break;
+ break;
- case '}':
- pop_and_call_brace ();
- input_text_offset++;
- break;
+ case '}':
+ pop_and_call_brace ();
+ input_text_offset++;
+ break;
- default:
- add_char (character);
- input_text_offset++;
- }
+ default:
+ add_char (character);
+ input_text_offset++;
+ }
}
#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
@@ -2405,18 +2360,18 @@ get_command_entry (string)
{
register int i;
- for (i = 0; command_table[i].name; i++)
- if (strcmp (command_table[i].name, string) == 0)
- return (&command_table[i]);
+ for (i = 0; CommandTable[i].name; i++)
+ if (strcmp (CommandTable[i].name, string) == 0)
+ return (&CommandTable[i]);
/* This command is not in our predefined command table. Perhaps
it is a user defined command. */
for (i = 0; i < user_command_array_len; i++)
if (user_command_array[i] &&
- (strcmp (user_command_array[i]->name, string) == 0))
+ (strcmp (user_command_array[i]->name, string) == 0))
return (user_command_array[i]);
- /* We never heard of this command. */
+ /* Nope, we never heard of this command. */
return ((COMMAND *) -1);
}
@@ -2440,25 +2395,26 @@ read_command ()
if (def)
{
- /* We disallow recursive use of a macro call. Inhibit the expansion
- of this macro during the life of its execution. */
- if (!(def->flags & ME_RECURSE))
- def->inhibited = 1;
+ /* We disallow recursive use of a macro call. Inhibit the expansion
+ of this macro during the life of its execution. */
+ if (!(def->flags & ME_RECURSE))
+ def->inhibited = 1;
- execute_macro (def);
+ execute_macro (def);
- if (!(def->flags & ME_RECURSE))
- def->inhibited = 0;
+ if (!(def->flags & ME_RECURSE))
+ def->inhibited = 0;
- return;
+ return;
}
}
#endif /* HAVE_MACROS */
entry = get_command_entry (command);
+
if (entry == (COMMAND *)-1)
{
- line_error (_("Unknown command `%s'"), command);
+ line_error ("Unknown command `%s'", command);
return;
}
@@ -2475,10 +2431,10 @@ find_proc_name (proc)
{
register int i;
- for (i = 0; command_table[i].name; i++)
- if (proc == command_table[i].proc)
- return command_table[i].name;
- return _("NO_NAME!");
+ for (i = 0; CommandTable[i].name; i++)
+ if (proc == CommandTable[i].proc)
+ return (CommandTable[i].name);
+ return ("NO_NAME!");
}
void
@@ -2492,7 +2448,7 @@ remember_brace (proc)
COMMAND_FUNCTION *proc;
{
if (curchar () != '{')
- line_error (_("%c%s expected `{...}'"), COMMAND_PREFIX, command);
+ line_error ("%c%s expected `{..}'", COMMAND_PREFIX, command);
else
input_text_offset++;
remember_brace_1 (proc, output_paragraph_offset);
@@ -2525,7 +2481,7 @@ pop_and_call_brace ()
if (brace_stack == (BRACE_ELEMENT *) NULL)
{
- line_error (_("Unmatched }"));
+ line_error ("Unmatched }");
return;
}
@@ -2549,7 +2505,7 @@ adjust_braces_following (here, amount)
while (stack)
{
if (stack->pos >= here)
- stack->pos += amount;
+ stack->pos += amount;
stack = stack->next;
}
}
@@ -2567,23 +2523,23 @@ discard_braces ()
while (brace_stack)
{
if (brace_stack->proc != misplaced_brace)
- {
- char *proc_name;
- int temp_line_number = line_number;
-
- line_number = brace_stack->line;
- proc_name = find_proc_name (brace_stack->proc);
- line_error (_("%c%s missing close brace"), COMMAND_PREFIX, proc_name);
- line_number = temp_line_number;
- pop_and_call_brace ();
- }
+ {
+ char *proc_name;
+ int temp_line_number = line_number;
+
+ line_number = brace_stack->line;
+ proc_name = find_proc_name (brace_stack->proc);
+ line_error ("%c%s missing close brace", COMMAND_PREFIX, proc_name);
+ line_number = temp_line_number;
+ pop_and_call_brace ();
+ }
else
- {
- BRACE_ELEMENT *temp;
- temp = brace_stack->next;
- free (brace_stack);
- brace_stack = temp;
- }
+ {
+ BRACE_ELEMENT *temp;
+ temp = brace_stack->next;
+ free (brace_stack);
+ brace_stack = temp;
+ }
}
}
@@ -2599,9 +2555,9 @@ get_char_len (character)
case '\t':
len = (output_column + 8) & 0xf7;
if (len > fill_column)
- len = fill_column - output_column;
+ len = fill_column - output_column;
else
- len = len - output_column;
+ len = len - output_column;
break;
case '\n':
@@ -2609,42 +2565,44 @@ get_char_len (character)
break;
default:
- /* ASCII control characters appear as two characters in the output
- (e.g., ^A). But characters with the high bit set are just one
- on suitable terminals, so don't count them as two for line
- breaking purposes. */
- if (0 <= character && character < ' ')
- len = 2;
+ if (character < ' ')
+ len = 2;
else
- len = 1;
+ len = 1;
}
return (len);
}
+#if defined (HAVE_VARARGS_H) && defined (HAVE_VSPRINTF)
+
void
-#if defined (VA_FPRINTF) && __STDC__
-add_word_args (char *format, ...)
-#else
-add_word_args (format, va_alist)
- char *format;
- va_dcl
-#endif
+add_word_args (va_alist)
+ va_dcl
{
char buffer[1000];
-#ifdef VA_FPRINTF
- va_list ap;
-#endif
+ char *format;
+ va_list args;
- VA_START (ap, format);
-#ifdef VA_SPRINTF
- VA_SPRINTF (buffer, format, ap);
-#else
- sprintf (temp_string, format, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif /* not VA_SPRINTF */
- va_end (ap);
+ va_start (args);
+ format = va_arg (args, char *);
+ vsprintf (buffer, format, args);
+ va_end (args);
add_word (buffer);
}
+#else /* !(HAVE_VARARGS_H && HAVE_VSPRINTF) */
+
+void
+add_word_args (format, arg1, arg2, arg3, arg4, arg5)
+ char *format;
+{
+ char buffer[1000];
+ sprintf (buffer, format, arg1, arg2, arg3, arg4, arg5);
+ add_word (buffer);
+}
+
+#endif /* !(HAVE_VARARGS_H && HAVE_VSPRINTF) */
+
/* Add STRING to output_paragraph. */
void
add_word (string)
@@ -2654,26 +2612,26 @@ add_word (string)
add_char (*string++);
}
-/* Nonzero if the last character inserted has the syntax class of NEWLINE. */
+/* Non-zero if the last character inserted has the syntax class of NEWLINE. */
int last_char_was_newline = 1;
/* The actual last inserted character. Note that this may be something
other than NEWLINE even if last_char_was_newline is 1. */
int last_inserted_character = 0;
-/* Nonzero means that a newline character has already been
+/* Non-zero means that a newline character has already been
inserted, so close_paragraph () should insert one less. */
int line_already_broken = 0;
-/* When nonzero we have finished an insertion (see `end_insertion') and we
+/* When non-zero we have finished an insertion (see end_insertion ()) and we
want to ignore false continued paragraph closings. */
int insertion_paragraph_closed = 0;
-/* Nonzero means attempt to make all of the lines have fill_column width. */
+/* Non-zero means attempt to make all of the lines have fill_column width. */
int do_justification = 0;
/* Add the character to the current paragraph. If filling_enabled is
- nonzero, then do filling as well. */
+ non-zero, then do filling as well. */
void
add_char (character)
int character;
@@ -2688,12 +2646,12 @@ add_char (character)
if (must_start_paragraph && character != '\n')
{
must_start_paragraph = 0;
- line_already_broken = 0; /* The line is no longer broken. */
+ line_already_broken = 0; /* The line is no longer broken. */
if (current_indent > output_column)
- {
- indent (current_indent - output_column);
- output_column = current_indent;
- }
+ {
+ indent (current_indent - output_column);
+ output_column = current_indent;
+ }
}
if (non_splitting_words && member (character, " \t\n"))
@@ -2705,168 +2663,168 @@ add_char (character)
{
case '\n':
if (!filling_enabled)
- {
- insert ('\n');
-
- if (force_flush_right)
- {
- close_paragraph ();
- /* Hack to force single blank lines out in this mode. */
- flush_output ();
- }
-
- output_column = 0;
-
- if (!no_indent && paragraph_is_open)
- indent (output_column = current_indent);
- break;
- }
+ {
+ insert ('\n');
+
+ if (force_flush_right)
+ {
+ close_paragraph ();
+ /* Hack to force single blank lines out in this mode. */
+ flush_output ();
+ }
+
+ output_column = 0;
+
+ if (!no_indent && paragraph_is_open)
+ indent (output_column = current_indent);
+ break;
+ }
else /* CHARACTER is newline, and filling is enabled. */
- {
- if (end_of_sentence_p ())
- {
- insert (' ');
- output_column++;
- last_inserted_character = character;
- }
- }
+ {
+ if (sentence_ender (last_inserted_character))
+ {
+ insert (' ');
+ output_column++;
+ last_inserted_character = character;
+ }
+ }
if (last_char_was_newline)
- {
- close_paragraph ();
- pending_indent = 0;
- }
+ {
+ close_paragraph ();
+ pending_indent = 0;
+ }
else
- {
- last_char_was_newline = 1;
- insert (' ');
- output_column++;
- }
+ {
+ last_char_was_newline = 1;
+ insert (' ');
+ output_column++;
+ }
break;
default:
{
- int len = get_char_len (character);
- int suppress_insert = 0;
-
- if ((character == ' ') && (last_char_was_newline))
- {
- if (!paragraph_is_open)
- {
- pending_indent++;
- return;
- }
- }
-
- if (!paragraph_is_open)
- {
- start_paragraph ();
-
- /* If the paragraph is supposed to be indented a certain way,
- then discard all of the pending whitespace. Otherwise, we
- let the whitespace stay. */
- if (!paragraph_start_indent)
- indent (pending_indent);
- pending_indent = 0;
- }
-
- if ((output_column += len) > fill_column)
- {
- if (filling_enabled)
- {
- int temp = output_paragraph_offset;
- while (--temp > 0 && output_paragraph[temp] != '\n')
- {
- /* If we have found a space, we have the place to break
- the line. */
- if (output_paragraph[temp] == ' ')
- {
- /* Remove trailing whitespace from output. */
- while (temp && whitespace (output_paragraph[temp - 1]))
- temp--;
-
- output_paragraph[temp++] = '\n';
-
- /* We have correctly broken the line where we want
- to. What we don't want is spaces following where
- we have decided to break the line. We get rid of
- them. */
- {
- int t1 = temp;
-
- for (;; t1++)
- {
- if (t1 == output_paragraph_offset)
- {
- if (whitespace (character))
- suppress_insert = 1;
- break;
- }
- if (!whitespace (output_paragraph[t1]))
- break;
- }
-
- if (t1 != temp)
- {
- adjust_braces_following (temp, (- (t1 - temp)));
- strncpy ((char *) &output_paragraph[temp],
- (char *) &output_paragraph[t1],
- (output_paragraph_offset - t1));
- output_paragraph_offset -= (t1 - temp);
- }
- }
-
- /* Filled, but now indent if that is right. */
- if (indented_fill && current_indent)
- {
- int buffer_len = ((output_paragraph_offset - temp)
- + current_indent);
- char *temp_buffer = (char *)xmalloc (buffer_len);
- int indentation = 0;
-
- /* We have to shift any markers that are in
- front of the wrap point. */
- adjust_braces_following (temp, current_indent);
-
- while (current_indent > 0 &&
- indentation != current_indent)
- temp_buffer[indentation++] = ' ';
-
- strncpy ((char *) &temp_buffer[current_indent],
- (char *) &output_paragraph[temp],
- buffer_len - current_indent);
-
- if (output_paragraph_offset + buffer_len
- >= paragraph_buffer_len)
- {
- unsigned char *tt = xrealloc
- (output_paragraph,
- (paragraph_buffer_len += buffer_len));
- output_paragraph = tt;
- }
- strncpy ((char *) &output_paragraph[temp],
- temp_buffer, buffer_len);
- output_paragraph_offset += current_indent;
- free (temp_buffer);
- }
- output_column = 0;
- while (temp < output_paragraph_offset)
- output_column +=
- get_char_len (output_paragraph[temp++]);
- output_column += len;
- break;
- }
- }
- }
- }
-
- if (!suppress_insert)
- {
- insert (character);
- last_inserted_character = character;
- }
- last_char_was_newline = 0;
- line_already_broken = 0;
+ int len = get_char_len (character);
+ int suppress_insert = 0;
+
+ if ((character == ' ') && (last_char_was_newline))
+ {
+ if (!paragraph_is_open)
+ {
+ pending_indent++;
+ return;
+ }
+ }
+
+ if (!paragraph_is_open)
+ {
+ start_paragraph ();
+
+ /* If the paragraph is supposed to be indented a certain way,
+ then discard all of the pending whitespace. Otherwise, we
+ let the whitespace stay. */
+ if (!paragraph_start_indent)
+ indent (pending_indent);
+ pending_indent = 0;
+ }
+
+ if ((output_column += len) > fill_column)
+ {
+ if (filling_enabled)
+ {
+ int temp = output_paragraph_offset;
+ while (--temp > 0 && output_paragraph[temp] != '\n')
+ {
+ /* If we have found a space, we have the place to break
+ the line. */
+ if (output_paragraph[temp] == ' ')
+ {
+ /* Remove trailing whitespace from output. */
+ while (temp && whitespace (output_paragraph[temp - 1]))
+ temp--;
+
+ output_paragraph[temp++] = '\n';
+
+ /* We have correctly broken the line where we want
+ to. What we don't want is spaces following where
+ we have decided to break the line. We get rid of
+ them. */
+ {
+ int t1 = temp;
+
+ for (;; t1++)
+ {
+ if (t1 == output_paragraph_offset)
+ {
+ if (whitespace (character))
+ suppress_insert = 1;
+ break;
+ }
+ if (!whitespace (output_paragraph[t1]))
+ break;
+ }
+
+ if (t1 != temp)
+ {
+ adjust_braces_following (temp, (- (t1 - temp)));
+ strncpy ((char *) &output_paragraph[temp],
+ (char *) &output_paragraph[t1],
+ (output_paragraph_offset - t1));
+ output_paragraph_offset -= (t1 - temp);
+ }
+ }
+
+ /* Filled, but now indent if that is right. */
+ if (indented_fill && current_indent)
+ {
+ int buffer_len = ((output_paragraph_offset - temp)
+ + current_indent);
+ char *temp_buffer = (char *)xmalloc (buffer_len);
+ int indentation = 0;
+
+ /* We have to shift any markers that are in
+ front of the wrap point. */
+ adjust_braces_following (temp, current_indent);
+
+ while (current_indent > 0 &&
+ indentation != current_indent)
+ temp_buffer[indentation++] = ' ';
+
+ strncpy ((char *) &temp_buffer[current_indent],
+ (char *) &output_paragraph[temp],
+ buffer_len - current_indent);
+
+ if (output_paragraph_offset + buffer_len
+ >= paragraph_buffer_len)
+ {
+ unsigned char *tt = xrealloc
+ (output_paragraph,
+ (paragraph_buffer_len += buffer_len));
+ output_paragraph = tt;
+ }
+ strncpy ((char *) &output_paragraph[temp],
+ temp_buffer, buffer_len);
+ output_paragraph_offset += current_indent;
+ free (temp_buffer);
+ }
+ output_column = 0;
+ while (temp < output_paragraph_offset)
+ output_column +=
+ get_char_len (output_paragraph[temp++]);
+ output_column += len;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!suppress_insert)
+ {
+ insert (character);
+ last_inserted_character = character;
+ }
+ last_char_was_newline = 0;
+ line_already_broken = 0;
}
}
}
@@ -2880,7 +2838,7 @@ insert (character)
if (output_paragraph_offset == paragraph_buffer_len)
{
output_paragraph =
- xrealloc (output_paragraph, (paragraph_buffer_len += 100));
+ xrealloc (output_paragraph, (paragraph_buffer_len += 100));
}
}
@@ -2893,23 +2851,6 @@ insert_string (string)
insert (*string++);
}
-
-/* Sentences might have these characters after the period (or whatever). */
-#define post_sentence(c) ((c) == ')' || (c) == '\'' || (c) == '"' \
- || (c) == ']')
-
-/* Return true if at an end-of-sentence character, possibly followed by
- post-sentence punctuation to ignore. */
-static int
-end_of_sentence_p ()
-{
- int loc = output_paragraph_offset - 1;
- while (loc > 0 && post_sentence (output_paragraph[loc]))
- loc--;
- return sentence_ender (output_paragraph[loc]);
-}
-
-
/* Remove upto COUNT characters of whitespace from the
the current output line. If COUNT is less than zero,
then remove until none left. */
@@ -2922,24 +2863,24 @@ kill_self_indent (count)
{
output_column = 0;
while (output_paragraph_offset)
- {
- if (whitespace (output_paragraph[output_paragraph_offset - 1]))
- output_paragraph_offset--;
- else
- break;
- }
+ {
+ if (whitespace (output_paragraph[output_paragraph_offset - 1]))
+ output_paragraph_offset--;
+ else
+ break;
+ }
}
else
{
while (output_paragraph_offset && count--)
- if (whitespace (output_paragraph[output_paragraph_offset - 1]))
- output_paragraph_offset--;
- else
- break;
+ if (whitespace (output_paragraph[output_paragraph_offset - 1]))
+ output_paragraph_offset--;
+ else
+ break;
}
}
-/* Nonzero means do not honor calls to flush_output (). */
+/* Non-zero means do not honor calls to flush_output (). */
static int flushing_ignored = 0;
/* Prevent calls to flush_output () from having any effect. */
@@ -2972,7 +2913,7 @@ flush_output ()
{
int temp = UNMETA (output_paragraph[i]);
if (temp == ' ')
- output_paragraph[i] &= 0x7f;
+ output_paragraph[i] &= 0x7f;
}
}
@@ -3006,28 +2947,30 @@ close_insertion_paragraph ()
/* Close the current paragraph, breaking the line. */
close_single_paragraph ();
- /* Start a new paragraph, with the correct indentation for the now
- current insertion level (one above the one that we are ending). */
+ /* Start a new paragraph here, inserting whatever indention is correct
+ for the now current insertion level (one above the one that we are
+ ending). */
start_paragraph ();
- /* Tell `close_paragraph' that the previous line has already been
- broken, so it should insert one less newline. */
+ /* Tell close_paragraph () that the previous line has already been
+ broken, so it should insert one less newline. */
line_already_broken = 1;
- /* Tell functions such as `add_char' we've already found a newline. */
+ /* Let functions such as add_char () know that we have already found a
+ newline. */
ignore_blank_line ();
}
else
{
/* If the insertion paragraph is closed already, then we are seeing
- two `@end' commands in a row. Note that the first one we saw was
- handled in the first part of this if-then-else clause, and at that
- time `start_paragraph' was called, partially to handle the proper
- indentation of the current line. However, the indentation level
- may have just changed again, so we may have to outdent the current
- line to the new indentation level. */
+ two `@end' commands in a row. Note that the first one we saw was
+ handled in the first part of this if-then-else clause, and at that
+ time start_paragraph () was called, partially to handle the proper
+ indentation of the current line. However, the indentation level
+ may have just changed again, so we may have to outdent the current
+ line to the new indentation level. */
if (current_indent < output_column)
- kill_self_indent (output_column - current_indent);
+ kill_self_indent (output_column - current_indent);
}
insertion_paragraph_closed = 1;
@@ -3059,37 +3002,37 @@ close_paragraph ()
tindex = output_paragraph_offset;
/* Back up to last non-newline/space character, forcing all such
- subsequent characters to be newlines. This isn't strictly
- necessary, but a couple of functions use the presence of a newline
- to make decisions. */
+ subsequent characters to be newlines. This isn't strictly
+ necessary, but a couple of functions use the presence of a newline
+ to make decisions. */
for (tindex = output_paragraph_offset - 1; tindex >= 0; --tindex)
- {
- c = output_paragraph[tindex];
+ {
+ c = output_paragraph[tindex];
- if (c == ' '|| c == '\n')
- output_paragraph[tindex] = '\n';
- else
- break;
- }
+ if (c == ' '|| c == '\n')
+ output_paragraph[tindex] = '\n';
+ else
+ break;
+ }
/* All trailing whitespace is ignored. */
output_paragraph_offset = ++tindex;
/* Break the line if that is appropriate. */
if (paragraph_spacing >= 0)
- insert ('\n');
+ insert ('\n');
- /* Add as many blank lines as is specified in `paragraph_spacing'. */
+ /* Add as many blank lines as is specified in PARAGRAPH_SPACING. */
if (!force_flush_right)
- {
- for (i = 0; i < (paragraph_spacing - line_already_broken); i++)
- insert ('\n');
- }
+ {
+ for (i = 0; i < (paragraph_spacing - line_already_broken); i++)
+ insert ('\n');
+ }
/* If we are doing flush right indentation, then do it now
- on the paragraph (really a single line). */
+ on the paragraph (really a single line). */
if (force_flush_right)
- do_flush_right_indentation ();
+ do_flush_right_indentation ();
flush_output ();
paragraph_is_open = 0;
@@ -3118,28 +3061,28 @@ do_flush_right_indentation ()
if (output_paragraph[0] != '\n')
{
- output_paragraph[output_paragraph_offset] = 0;
+ output_paragraph[output_paragraph_offset] = '\0';
if (output_paragraph_offset < fill_column)
- {
- register int i;
+ {
+ register int i;
- if (fill_column >= paragraph_buffer_len)
- output_paragraph =
- xrealloc (output_paragraph,
- (paragraph_buffer_len += fill_column));
+ if (fill_column >= paragraph_buffer_len)
+ output_paragraph =
+ xrealloc (output_paragraph,
+ (paragraph_buffer_len += fill_column));
- temp_len = strlen ((char *)output_paragraph);
- temp = (char *)xmalloc (temp_len + 1);
- memcpy (temp, (char *)output_paragraph, temp_len);
+ temp_len = strlen ((char *)output_paragraph);
+ temp = (char *)xmalloc (temp_len + 1);
+ memcpy (temp, (char *)output_paragraph, temp_len);
- for (i = 0; i < fill_column - output_paragraph_offset; i++)
- output_paragraph[i] = ' ';
+ for (i = 0; i < fill_column - output_paragraph_offset; i++)
+ output_paragraph[i] = ' ';
- memcpy ((char *)output_paragraph + i, temp, temp_len);
- free (temp);
- output_paragraph_offset = fill_column;
- }
+ memcpy ((char *)output_paragraph + i, temp, temp_len);
+ free (temp);
+ output_paragraph_offset = fill_column;
+ }
}
}
@@ -3166,25 +3109,25 @@ start_paragraph ()
/* If doing indentation, then insert the appropriate amount. */
if (!no_indent)
- {
- if (inhibit_paragraph_indentation)
- {
- amount_to_indent = current_indent;
- if (inhibit_paragraph_indentation < 0)
- inhibit_paragraph_indentation++;
- }
- else if (paragraph_start_indent < 0)
- amount_to_indent = current_indent;
- else
- amount_to_indent = current_indent + paragraph_start_indent;
-
- if (amount_to_indent >= output_column)
- {
- amount_to_indent -= output_column;
- indent (amount_to_indent);
- output_column += amount_to_indent;
- }
- }
+ {
+ if (inhibit_paragraph_indentation)
+ {
+ amount_to_indent = current_indent;
+ if (inhibit_paragraph_indentation < 0)
+ inhibit_paragraph_indentation++;
+ }
+ else if (paragraph_start_indent < 0)
+ amount_to_indent = current_indent;
+ else
+ amount_to_indent = current_indent + paragraph_start_indent;
+
+ if (amount_to_indent >= output_column)
+ {
+ amount_to_indent -= output_column;
+ indent (amount_to_indent);
+ output_column += amount_to_indent;
+ }
+ }
}
else
must_start_paragraph = 0;
@@ -3202,7 +3145,7 @@ indent (amount)
while (elt)
{
if (elt->pos >= output_paragraph_offset)
- elt->pos += amount;
+ elt->pos += amount;
elt = elt->next;
}
@@ -3222,7 +3165,7 @@ search_forward (string, from)
while (from < size_of_input_text)
{
if (strncmp (input_text + from, string, len) == 0)
- return (from);
+ return (from);
from++;
}
return (-1);
@@ -3244,13 +3187,13 @@ strcasecmp (string1, string2)
ch2 = *string2++;
if (!(ch1 | ch2))
- return (0);
+ return (0);
ch1 = coerce_to_upper (ch1);
ch2 = coerce_to_upper (ch2);
if (ch1 != ch2)
- return (ch1 - ch2);
+ return (ch1 - ch2);
}
}
#endif /* !HAVE_STRCASECMP */
@@ -3287,20 +3230,18 @@ current_item_function ()
while (!done && (elt != NULL))
{
switch (elt->insertion)
- {
- case ifinfo:
- case ifnothtml:
- case ifnottex:
- case ifset:
- case ifclear:
- case cartouche:
- elt = elt->next;
- level--;
- break;
-
- default:
- done = 1;
- }
+ {
+ case ifinfo:
+ case ifset:
+ case ifclear:
+ case cartouche:
+ elt = elt->next;
+ level--;
+ break;
+
+ default:
+ done = 1;
+ }
}
if (!level)
@@ -3315,6 +3256,7 @@ get_item_function ()
char *item_function;
get_rest_of_line (&item_function);
backup_input_pointer ();
+ canon_white (item_function);
return (item_function);
}
@@ -3331,7 +3273,7 @@ push_insertion (type, item_function)
new->indented_fill = indented_fill;
new->insertion = type;
new->line_number = line_number;
- new->filename = xstrdup (input_filename);
+ new->filename = strdup (input_filename);
new->inhibited = inhibit_paragraph_indentation;
new->in_fixed_width_font = in_fixed_width_font;
new->next = insertion_stack;
@@ -3369,7 +3311,7 @@ insertion_type_pname (type)
if ((int) type < (int) bad_type)
return (insertion_type_names[(int) type]);
else
- return (_("Broken-Type in insertion_type_pname"));
+ return ("Broken-Type in insertion_type_pname");
}
/* Return the insertion_type associated with NAME.
@@ -3382,7 +3324,7 @@ find_type_from_name (name)
while (index < (int) bad_type)
{
if (strcmp (name, insertion_type_names[index]) == 0)
- return (enum insertion_type) index;
+ return (enum insertion_type) index;
index++;
}
return (bad_type);
@@ -3435,7 +3377,7 @@ start_enumerating (at, type)
{
if ((enumstack_offset + 1) == max_stack_depth)
{
- line_error (_("Enumeration stack overflow"));
+ line_error ("Enumeration stack overflow");
return;
}
enumstack[enumstack_offset].enumtype = current_enumtype;
@@ -3465,10 +3407,10 @@ enumerate_item ()
if (current_enumtype == ENUM_ALPHA)
{
if (current_enumval == ('z' + 1) || current_enumval == ('Z' + 1))
- {
- current_enumval = ((current_enumval - 1) == 'z' ? 'a' : 'A');
- warning (_("lettering overflow, restarting at %c"), current_enumval);
- }
+ {
+ current_enumval = ((current_enumval - 1) == 'z' ? 'a' : 'A');
+ warning ("Lettering overflow, restarting at %c", current_enumval);
+ }
sprintf (temp, "%c. ", current_enumval);
}
else
@@ -3490,7 +3432,7 @@ begin_insertion (type)
if (defun_insertion (type))
{
- push_insertion (type, xstrdup (""));
+ push_insertion (type, strdup (""));
no_discard++;
}
else
@@ -3500,29 +3442,30 @@ begin_insertion (type)
{
case menu:
if (!no_headers)
- close_paragraph ();
+ close_paragraph ();
filling_enabled = no_indent = 0;
inhibit_paragraph_indentation = 1;
if (!no_headers)
- add_word (_("* Menu:\n"));
+ add_word ("* Menu:\n");
in_menu++;
no_discard++;
break;
case detailmenu:
+
if (!in_menu)
- {
- if (!no_headers)
- close_paragraph ();
+ {
+ if (!no_headers)
+ close_paragraph ();
- filling_enabled = no_indent = 0;
- inhibit_paragraph_indentation = 1;
+ filling_enabled = no_indent = 0;
+ inhibit_paragraph_indentation = 1;
- no_discard++;
- }
+ no_discard++;
+ }
in_detailmenu++;
break;
@@ -3535,7 +3478,7 @@ begin_insertion (type)
break;
/* I think @quotation is meant to do filling.
- If you don't want filling, then use @display. */
+ If you don't want filling, then use @display. */
case quotation:
close_single_paragraph ();
last_char_was_newline = no_indent = 0;
@@ -3551,13 +3494,16 @@ begin_insertion (type)
case smalllisp:
/* Just like @example, but no indentation. */
case format:
+
close_single_paragraph ();
inhibit_paragraph_indentation = 1;
in_fixed_width_font++;
filling_enabled = 0;
last_char_was_newline = 0;
+
if (type != format)
- current_indent += default_indentation_increment;
+ current_indent += default_indentation_increment;
+
break;
case multitable:
@@ -3579,20 +3525,20 @@ begin_insertion (type)
/* Make things work for losers who forget the itemize syntax. */
if (allow_lax_format && (type == itemize))
- {
- if (!(*insertion_stack->item_function))
- {
- free (insertion_stack->item_function);
- insertion_stack->item_function = xstrdup ("@bullet");
- insertion_stack->item_function[0] = COMMAND_PREFIX;
- }
- }
+ {
+ if (!(*insertion_stack->item_function))
+ {
+ free (insertion_stack->item_function);
+ insertion_stack->item_function = strdup ("@bullet");
+ insertion_stack->item_function[0] = COMMAND_PREFIX;
+ }
+ }
if (!*insertion_stack->item_function)
- {
- line_error (_("%s requires an argument: the formatter for %citem"),
- insertion_type_pname (type), COMMAND_PREFIX);
- }
+ {
+ line_error ("%s requires an argument: the formatter for %citem",
+ insertion_type_pname (type), COMMAND_PREFIX);
+ }
break;
case enumerate:
@@ -3608,28 +3554,26 @@ begin_insertion (type)
filling_enabled = indented_fill = 1;
if (isdigit (*enumeration_arg))
- start_enumerating (atoi (enumeration_arg), ENUM_DIGITS);
+ start_enumerating (atoi (enumeration_arg), ENUM_DIGITS);
else
- start_enumerating (*enumeration_arg, ENUM_ALPHA);
+ start_enumerating (*enumeration_arg, ENUM_ALPHA);
break;
/* Does nothing special in makeinfo. */
case group:
/* Only close the paragraph if we are not inside of an @example. */
if (!insertion_stack->next ||
- insertion_stack->next->insertion != example)
- close_single_paragraph ();
+ insertion_stack->next->insertion != example)
+ close_single_paragraph ();
break;
/* Insertions that are no-ops in info, but do something in TeX. */
case ifinfo:
- case ifnothtml:
- case ifnottex:
case ifset:
case ifclear:
case cartouche:
if (in_menu)
- no_discard++;
+ no_discard++;
break;
case deffn:
@@ -3673,10 +3617,11 @@ begin_insertion (type)
discard_until ("\n");
}
-/* Try to end the insertion with the specified TYPE. With a value of
- `bad_type', TYPE gets translated to match the value currently on top
- of the stack. Otherwise, if TYPE doesn't match the top of the
- insertion stack, give error. */
+/* Try to end the insertion with the specified TYPE.
+ TYPE, with a value of bad_type, gets translated to match
+ the value currently on top of the stack.
+ Otherwise, if TYPE doesn't match the top of the insertion stack,
+ give error. */
void
end_insertion (type)
enum insertion_type type;
@@ -3694,8 +3639,8 @@ end_insertion (type)
if (type != temp_type)
{
line_error
- (_("`%cend' expected `%s', but saw `%s'"), COMMAND_PREFIX,
- insertion_type_pname (temp_type), insertion_type_pname (type));
+ ("`%cend' expected `%s', but saw `%s'", COMMAND_PREFIX,
+ insertion_type_pname (temp_type), insertion_type_pname (type));
return;
}
@@ -3704,8 +3649,6 @@ end_insertion (type)
switch (type)
{
/* Insertions which have no effect on paragraph formatting. */
- case ifnothtml:
- case ifnottex:
case ifinfo:
case ifset:
case ifclear:
@@ -3717,18 +3660,18 @@ end_insertion (type)
break;
case detailmenu:
- in_detailmenu--; /* No longer hacking menus. */
+ in_detailmenu--; /* No longer hacking menus. */
if (!in_menu)
- {
- if (!no_headers)
- close_insertion_paragraph ();
- }
+ {
+ if (!no_headers)
+ close_insertion_paragraph ();
+ }
break;
case menu:
- in_menu--; /* No longer hacking menus. */
+ in_menu--; /* No longer hacking menus. */
if (!no_headers)
- close_insertion_paragraph ();
+ close_insertion_paragraph ();
break;
case multitable:
@@ -3754,13 +3697,14 @@ end_insertion (type)
case lisp:
case smalllisp:
case quotation:
+
/* @format is the only fixed_width insertion without a change
- in indentation. */
+ in indentation. */
if (type != format)
- current_indent -= default_indentation_increment;
+ current_indent -= default_indentation_increment;
/* The ending of one of these insertions always marks the
- start of a new paragraph. */
+ start of a new paragraph. */
close_insertion_paragraph ();
break;
@@ -3785,32 +3729,33 @@ end_insertion (type)
}
/* Insertions cannot cross certain boundaries, such as node beginnings. In
- code that creates such boundaries, you should call `discard_insertions'
+ code that creates such boundaries, you should call discard_insertions ()
before doing anything else. It prints the errors for you, and cleans up
- the insertion stack. With nonzero SPECIALS_OK, allows unmatched
- ifinfo, ifset, ifclear, otherwise not. */
+ the insertion stack. */
void
-discard_insertions (specials_ok)
- int specials_ok;
+discard_insertions ()
{
int real_line_number = line_number;
while (insertion_stack)
{
- if (specials_ok && (insertion_stack->insertion == ifinfo
- || insertion_stack->insertion == ifset
- || insertion_stack->insertion == ifclear))
- break;
+ if (insertion_stack->insertion == ifinfo ||
+ insertion_stack->insertion == ifset ||
+ insertion_stack->insertion == ifclear)
+ break;
else
- {
- char *offender = insertion_type_pname (insertion_stack->insertion);
- char *current_filename = input_filename;
-
- input_filename = insertion_stack->filename;
- line_number = insertion_stack->line_number;
- line_error (_("No matching `%cend %s'"), COMMAND_PREFIX, offender);
- input_filename = current_filename;
- pop_insertion ();
- }
+ {
+ char *offender;
+ char *current_filename;
+
+ current_filename = input_filename;
+ offender = (char *)insertion_type_pname (insertion_stack->insertion);
+ input_filename = insertion_stack->filename;
+ line_number = insertion_stack->line_number;
+ line_error ("This `%s' doesn't have a matching `%cend %s'", offender,
+ COMMAND_PREFIX, offender);
+ input_filename = current_filename;
+ pop_insertion ();
+ }
}
line_number = real_line_number;
}
@@ -3839,7 +3784,9 @@ void
cm_asterisk ()
{
close_single_paragraph ();
+#if !defined (ASTERISK_NEW_PARAGRAPH)
cm_noindent ();
+#endif /* ASTERISK_NEW_PARAGRAPH */
}
/* Insert ellipsis. */
@@ -3946,7 +3893,7 @@ cm_special_char (arg)
else if (strcmp (command, "questiondown") == 0)
add_char ('?');
else
- fprintf (stderr, _("How did @%s end up in cm_special_char?\n"), command);
+ fprintf (stderr, "How did @%s end up in cm_special_char?\n", command);
}
}
@@ -3960,12 +3907,12 @@ cm_dotless (arg, start, end)
if (output_paragraph[start] != 'i' && output_paragraph[start] != 'j')
/* This error message isn't perfect if the argument is multiple
characters, but it doesn't seem worth getting right. */
- line_error (_("%c%s expects `i' or `j' as argument, not `%c'"),
+ line_error ("%c%s expects `i' or `j' as argument, not `%c'",
COMMAND_PREFIX, command, output_paragraph[start]);
else if (end - start != 1)
- line_error (_("%c%s expects a single character `i' or `j' as argument"),
- COMMAND_PREFIX, command);
+ line_error ("%c%s expects a single character `i' or `j' as argument",
+ COMMAND_PREFIX, command);
/* We've already inserted the `i' or `j', so nothing to do. */
}
@@ -3975,16 +3922,18 @@ void
cm_today (arg)
int arg;
{
- static char *months [12] =
- { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"),
- N_("June"), N_("July"), N_("August"), N_("September"), N_("October"),
- N_("November"), N_("December") };
+ static char * months [12] =
+ { "January", "February", "March", "April", "May", "June", "July",
+ "August", "September", "October", "November", "December" };
if (arg == START)
{
time_t timer = time (0);
struct tm *ts = localtime (&timer);
- add_word_args ("%d %s %d", ts->tm_mday, _(months[ts->tm_mon]),
- ts->tm_year + 1900);
+ add_word_args
+ ("%d %s %d",
+ (ts -> tm_mday),
+ (months [ts -> tm_mon]),
+ ((ts -> tm_year) + 1900));
}
}
@@ -3999,12 +3948,12 @@ cm_code (arg)
in_fixed_width_font++;
if (!printing_index)
- add_char ('`');
+ add_char ('`');
}
else
{
if (!printing_index)
- add_char ('\'');
+ add_char ('\'');
}
}
@@ -4019,7 +3968,7 @@ cm_kbd (arg)
}
void
-cm_key (arg)
+cm_angle_brackets (arg)
int arg;
{
add_char (arg == START ? '<' : '>');
@@ -4036,17 +3985,17 @@ cm_ctrl (arg, start, end)
register int i, character;
#if defined (NO_MULTIPLE_CTRL)
if ((end - start) != 1)
- line_error (_("%c%s expects a single character as an argument"),
- COMMAND_PREFIX, command);
+ line_error ("%c%s expects a single character as an argument",
+ COMMAND_PREFIX, command);
else
#endif
- for (i = start; i < end; i++)
- {
- character = output_paragraph[i];
+ for (i = start; i < end; i++)
+ {
+ character = output_paragraph[i];
- if (isletter (character))
- output_paragraph[i] = CTL (coerce_to_upper (character));
- }
+ if (isletter (character))
+ output_paragraph[i] = CTL (coerce_to_upper (character));
+ }
}
}
@@ -4059,9 +4008,9 @@ not_fixed_width (arg)
in_fixed_width_font = 0;
}
-/* Small caps and @var in makeinfo just uppercase the text. */
+/* Small caps in makeinfo has to do just all caps. */
void
-cm_var_sc (arg, start_pos, end_pos)
+cm_sc (arg, start_pos, end_pos)
int arg, start_pos, end_pos;
{
not_fixed_width (arg);
@@ -4069,11 +4018,29 @@ cm_var_sc (arg, start_pos, end_pos)
if (arg == END)
{
while (start_pos < end_pos)
- {
- output_paragraph[start_pos] =
- coerce_to_upper (output_paragraph[start_pos]);
- start_pos++;
- }
+ {
+ output_paragraph[start_pos] =
+ coerce_to_upper (output_paragraph[start_pos]);
+ start_pos++;
+ }
+ }
+}
+
+/* @var in makeinfo just uppercases the text. */
+void
+cm_var (arg, start_pos, end_pos)
+ int arg, start_pos, end_pos;
+{
+ not_fixed_width (arg);
+
+ if (arg == END)
+ {
+ while (start_pos < end_pos)
+ {
+ output_paragraph[start_pos] =
+ coerce_to_upper (output_paragraph[start_pos]);
+ start_pos++;
+ }
}
}
@@ -4116,21 +4083,12 @@ cm_not_fixed_width (arg, start, end)
not_fixed_width (arg);
}
-/* Various commands are no-op's. */
+/* Various commands are NOP's. */
void
cm_no_op ()
{
}
-/* No-op that eats its argument on same line. */
-void
-cm_no_op_line_arg ()
-{
- char *temp;
- get_rest_of_line (&temp);
- free (temp);
-}
-
/* Prevent the argument from being split across two lines. */
void
cm_w (arg, start, end)
@@ -4150,7 +4108,7 @@ cm_obsolete (arg, start, end)
int arg, start, end;
{
if (arg == START)
- warning (_("%c%s is obsolete"), COMMAND_PREFIX, command);
+ warning ("The command `%c%s' is obsolete", COMMAND_PREFIX, command);
}
/* Insert the text following input_text_offset up to the end of the line
@@ -4170,7 +4128,7 @@ insert_and_underscore (with_char)
no_indent = 1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
@@ -4178,9 +4136,11 @@ insert_and_underscore (with_char)
starting_pos = output_position + output_paragraph_offset;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
{
- char *temp1 = (char *) xmalloc (2 + strlen (temp));
+ char *temp1;
+
+ temp1 = (char *)xmalloc (2 + strlen (temp));
sprintf (temp1, "%s\n", temp);
remember_itext (input_text, input_text_offset);
me_execute_string (temp1);
@@ -4188,7 +4148,7 @@ insert_and_underscore (with_char)
}
else
#endif /* HAVE_MACROS */
- execute_string ("%s\n", temp);
+ execute_string ("%s\n", temp);
ending_pos = output_position + output_paragraph_offset;
free (temp);
@@ -4277,20 +4237,20 @@ what_section (text)
for (j = 0; text[j] && !cr_or_whitespace (text[j]); j++);
- for (i = 0; (t = section_alist[i].name); i++)
+ for (i = 0; t = section_alist[i].name; i++)
{
if (j == strlen (t) && strncmp (t, text, j) == 0)
- {
- int return_val;
+ {
+ int return_val;
- return_val = (section_alist[i].level + section_alist_offset);
+ return_val = (section_alist[i].level + section_alist_offset);
- if (return_val < 0)
- return_val = 0;
- else if (return_val > 5)
- return_val = 5;
- return (return_val);
- }
+ if (return_val < 0)
+ return_val = 0;
+ else if (return_val > 5)
+ return_val = 5;
+ return (return_val);
+ }
}
return (-1);
}
@@ -4305,9 +4265,9 @@ set_top_section_level (level)
for (i = 0; section_alist[i].name; i++)
if (strcmp (section_alist[i].name, "top") == 0)
{
- result = section_alist[i].level;
- section_alist[i].level = level;
- break;
+ result = section_alist[i].level;
+ section_alist[i].level = level;
+ break;
}
return (result);
}
@@ -4322,25 +4282,25 @@ cm_top ()
{
TAG_ENTRY *tag = tag_table;
- line_error (_("Node with %ctop as a section already exists"),
- COMMAND_PREFIX);
+ line_error ("There already is a node having %ctop as a section",
+ COMMAND_PREFIX);
while (tag != (TAG_ENTRY *)NULL)
- {
- if ((tag->flags & IS_TOP))
- {
- int old_line_number = line_number;
- char *old_input_filename = input_filename;
-
- line_number = tag->line_no;
- input_filename = tag->filename;
- line_error (_("Here is the %ctop node"), COMMAND_PREFIX);
- input_filename = old_input_filename;
- line_number = old_line_number;
- return;
- }
- tag = tag->next_ent;
- }
+ {
+ if ((tag->flags & IS_TOP))
+ {
+ int old_line_number = line_number;
+ char *old_input_filename = input_filename;
+
+ line_number = tag->line_no;
+ input_filename = tag->filename;
+ line_error ("Here is the %ctop node", COMMAND_PREFIX);
+ input_filename = old_input_filename;
+ line_number = old_line_number;
+ return;
+ }
+ tag = tag->next_ent;
+ }
}
else
{
@@ -4348,16 +4308,16 @@ cm_top ()
/* It is an error to use @top before you have used @node. */
if (!tag_table)
- {
- char *top_name;
-
- get_rest_of_line (&top_name);
- free (top_name);
- line_error (_("%ctop used before %cnode, defaulting to %s"),
- COMMAND_PREFIX, COMMAND_PREFIX, top_name);
- execute_string ("@node Top, , (dir), (dir)\n@top %s\n", top_name);
- return;
- }
+ {
+ char *top_name;
+
+ get_rest_of_line (&top_name);
+ free (top_name);
+ line_error ("%ctop used before %cnode, defaulting to %s",
+ COMMAND_PREFIX, COMMAND_PREFIX, top_name);
+ execute_string ("@node Top, , (dir), (dir)\n@top %s\n", top_name);
+ return;
+ }
cm_unnumbered ();
@@ -4366,33 +4326,33 @@ cm_top ()
/* Now set the logical hierarchical level of the Top node. */
{
- int orig_offset = input_text_offset;
+ int orig_offset = input_text_offset;
- input_text_offset = search_forward (node_search_string, orig_offset);
+ input_text_offset = search_forward (node_search_string, orig_offset);
- if (input_text_offset > 0)
- {
- int this_section;
+ if (input_text_offset > 0)
+ {
+ int this_section;
- /* We have encountered a non-top node, so mark that one exists. */
- non_top_node_seen = 1;
+ /* We have encountered a non-top node, so mark that one exists. */
+ non_top_node_seen = 1;
- /* Move to the end of this line, and find out what the
- sectioning command is here. */
- while (input_text[input_text_offset] != '\n')
- input_text_offset++;
+ /* Move to the end of this line, and find out what the
+ sectioning command is here. */
+ while (input_text[input_text_offset] != '\n')
+ input_text_offset++;
- if (input_text_offset < size_of_input_text)
- input_text_offset++;
+ if (input_text_offset < size_of_input_text)
+ input_text_offset++;
- this_section = what_section (input_text + input_text_offset);
+ this_section = what_section (input_text + input_text_offset);
- /* If we found a sectioning command, then give the top section
- a level of this section - 1. */
- if (this_section != -1)
- set_top_section_level (this_section - 1);
- }
- input_text_offset = orig_offset;
+ /* If we found a sectioning command, then give the top section
+ a level of this section - 1. */
+ if (this_section != -1)
+ set_top_section_level (this_section - 1);
+ }
+ input_text_offset = orig_offset;
}
}
}
@@ -4428,8 +4388,8 @@ void
cm_ideprecated (arg, start, end)
int arg, start, end;
{
- warning (_("%c%s is obsolete; use %c%s instead"),
- COMMAND_PREFIX, command, COMMAND_PREFIX, command + 1);
+ warning ("The command `%c%s' is obsolete; use `%c%s' instead",
+ COMMAND_PREFIX, command, COMMAND_PREFIX, command + 1);
sectioning_underscore (command + 1);
}
@@ -4552,9 +4512,9 @@ cm_subsubheading ()
}
/* **************************************************************** */
-/* */
-/* Adding nodes, and making tags */
-/* */
+/* */
+/* Adding nodes, and making tags */
+/* */
/* **************************************************************** */
/* Start a new tag table. */
@@ -4576,7 +4536,7 @@ init_tag_table ()
void
write_tag_table ()
{
- write_tag_table_internal (0); /* Not indirect. */
+ write_tag_table_internal (0); /* Not indirect. */
}
void
@@ -4620,12 +4580,11 @@ write_tag_table_internal (indirect_p)
}
char *
-get_node_token (expand)
- int expand;
+get_node_token ()
{
char *string;
- get_until_in_line (expand, ",", &string);
+ get_until_in_line (",", &string);
if (curchar () == ',')
input_text_offset++;
@@ -4658,7 +4617,7 @@ find_node (name)
while (tag != (TAG_ENTRY *) NULL)
{
if (strcmp (tag->node, name) == 0)
- return (tag);
+ return (tag);
tag = tag->next_ent;
}
return ((TAG_ENTRY *) NULL);
@@ -4675,12 +4634,11 @@ remember_node (node, prev, next, up, position, line_no, no_warn)
{
register TAG_ENTRY *tag = find_node (node);
if (tag)
- {
- line_error (
- _("Node `%s' multiply defined (line %d is first definition at)"),
- node, tag->line_no);
- return;
- }
+ {
+ line_error ("Node `%s' multiply defined (%d is first definition)",
+ node, tag->line_no);
+ return;
+ }
}
/* First, make this the current node. */
@@ -4696,7 +4654,7 @@ remember_node (node, prev, next, up, position, line_no, no_warn)
new->position = position;
new->line_no = line_no;
new->filename = node_filename;
- new->touched = 0; /* not yet referenced. */
+ new->touched = 0; /* not yet referenced. */
new->flags = 0;
if (no_warn)
new->flags |= NO_WARN;
@@ -4726,7 +4684,7 @@ cm_node ()
/* There also might be insertions left lying around that haven't been
ended yet. Do that also. */
- discard_insertions (1);
+ discard_insertions ();
if (!already_outputting_pending_notes)
{
@@ -4740,20 +4698,17 @@ cm_node ()
current_footnote_number = 1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
- node = get_node_token (1);
- next = get_node_token (0);
- prev = get_node_token (0);
- up = get_node_token (0);
+ node = get_node_token ();
+ next = get_node_token ();
+ prev = get_node_token ();
+ up = get_node_token ();
- if (verbose_mode)
- printf (_("Formatting node %s...\n"), node);
-
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
@@ -4763,16 +4718,18 @@ cm_node ()
add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename);
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- me_execute_string (node);
+ if (macro_expansion_output_stream)
+ me_execute_string (node);
else
#endif /* HAVE_MACROS */
- execute_string ("%s", node);
+ execute_string ("%s", node);
filling_enabled = indented_fill = 0;
}
/* Check for defaulting of this node's next, prev, and up fields. */
- defaulting = (*next == 0 && *prev == 0 && *up == 0);
+ defaulting = ((strlen (next) == 0) &&
+ (strlen (prev) == 0) &&
+ (strlen (up) == 0));
this_section = what_section (input_text + input_text_offset);
@@ -4787,164 +4744,164 @@ cm_node ()
NODE_REF *ref = node_references;
if ((this_section < 0) && (strcmp (node, "Top") != 0))
- {
- char *polite_section_name = "top";
- int i;
-
- for (i = 0; section_alist[i].name; i++)
- if (section_alist[i].level == current_section + 1)
- {
- polite_section_name = section_alist[i].name;
- break;
- }
-
- line_error
- (_("Node `%s' requires a sectioning command (e.g. %c%s)"),
- node, COMMAND_PREFIX, polite_section_name);
- }
+ {
+ char *polite_section_name = "top";
+ int i;
+
+ for (i = 0; section_alist[i].name; i++)
+ if (section_alist[i].level == current_section + 1)
+ {
+ polite_section_name = section_alist[i].name;
+ break;
+ }
+
+ line_error
+ ("Node `%s' requires a sectioning command (e.g. %c%s)",
+ node, COMMAND_PREFIX, polite_section_name);
+ }
else
- {
- if (strcmp (node, "Top") == 0)
- {
- /* Default the NEXT pointer to be the first menu item in
- this node, if there is a menu in this node. We have to
- try very hard to find the menu, as it may be obscured
- by execution_strings which are on the filestack. For
- every member of the filestack which has a FILENAME
- member which is identical to the current INPUT_FILENAME,
- search forward from that offset. */
- int saved_input_text_offset = input_text_offset;
- int saved_size_of_input_text = size_of_input_text;
- char *saved_input_text = input_text;
- FSTACK *next_file = filestack;
-
- int orig_offset, orig_size;
- char *glean_node_from_menu ();
-
- /* No matter what, make this file point back at `(dir)'. */
- free (up); up = xstrdup ("(dir)");
-
- while (1)
- {
- orig_offset = input_text_offset;
- orig_size =
- search_forward (node_search_string, orig_offset);
-
- if (orig_size < 0)
- orig_size = size_of_input_text;
-
- input_text_offset =
- search_forward (menu_search_string, orig_offset);
-
- if (input_text_offset > -1)
- {
- char *nodename_from_menu = (char *)NULL;
-
- input_text_offset =
- search_forward ("\n* ", input_text_offset);
-
- if (input_text_offset != -1)
- nodename_from_menu = glean_node_from_menu (0);
-
- if (nodename_from_menu)
- {
- free (next); next = nodename_from_menu;
- break;
- }
- }
-
- /* We got here, so it hasn't been found yet. Try
- the next file on the filestack if there is one. */
- if (next_file &&
- (strcmp (next_file->filename, input_filename) == 0))
- {
- input_text = next_file->text;
- input_text_offset = next_file->offset;
- size_of_input_text = next_file->size;
- next_file = next_file->next;
- }
- else
- {
- /* No more input files to check. */
- break;
- }
- }
-
- input_text = saved_input_text;
- input_text_offset = saved_input_text_offset;
- size_of_input_text = saved_size_of_input_text;
- }
- }
+ {
+ if (strcmp (node, "Top") == 0)
+ {
+ /* Default the NEXT pointer to be the first menu item in
+ this node, if there is a menu in this node. We have to
+ try very hard to find the menu, as it may be obscured
+ by execution_strings which are on the filestack. For
+ every member of the filestack which has a FILENAME
+ member which is identical to the current INPUT_FILENAME,
+ search forward from that offset. */
+ int saved_input_text_offset = input_text_offset;
+ int saved_size_of_input_text = size_of_input_text;
+ char *saved_input_text = input_text;
+ FSTACK *next_file = filestack;
+
+ int orig_offset, orig_size;
+ char *glean_node_from_menu ();
+
+ /* No matter what, make this file point back at `(dir)'. */
+ free (up); up = strdup ("(dir)");
+
+ while (1)
+ {
+ orig_offset = input_text_offset;
+ orig_size =
+ search_forward (node_search_string, orig_offset);
+
+ if (orig_size < 0)
+ orig_size = size_of_input_text;
+
+ input_text_offset =
+ search_forward (menu_search_string, orig_offset);
+
+ if (input_text_offset > -1)
+ {
+ char *nodename_from_menu = (char *)NULL;
+
+ input_text_offset =
+ search_forward ("\n* ", input_text_offset);
+
+ if (input_text_offset != -1)
+ nodename_from_menu = glean_node_from_menu (0);
+
+ if (nodename_from_menu)
+ {
+ free (next); next = nodename_from_menu;
+ break;
+ }
+ }
+
+ /* We got here, so it hasn't been found yet. Try
+ the next file on the filestack if there is one. */
+ if (next_file &&
+ (strcmp (next_file->filename, input_filename) == 0))
+ {
+ input_text = next_file->text;
+ input_text_offset = next_file->offset;
+ size_of_input_text = next_file->size;
+ next_file = next_file->next;
+ }
+ else
+ {
+ /* No more input files to check. */
+ break;
+ }
+ }
+
+ input_text = saved_input_text;
+ input_text_offset = saved_input_text_offset;
+ size_of_input_text = saved_size_of_input_text;
+ }
+ }
/* Fix the level of the menu references in the Top node, iff it
- was declared with @top, and no subsequent reference was found. */
+ was declared with @top, and no subsequent reference was found. */
if (top_node_seen && !non_top_node_seen)
- {
- /* Then this is the first non-@top node seen. */
- int level;
+ {
+ /* Then this is the first non-@top node seen. */
+ int level;
- level = set_top_section_level (this_section - 1);
- non_top_node_seen = 1;
+ level = set_top_section_level (this_section - 1);
+ non_top_node_seen = 1;
- while (ref)
- {
- if (ref->section == level)
- ref->section = this_section - 1;
- ref = ref->next;
- }
+ while (ref)
+ {
+ if (ref->section == level)
+ ref->section = this_section - 1;
+ ref = ref->next;
+ }
- ref = node_references;
- }
+ ref = node_references;
+ }
while (ref)
- {
- if (ref->section == (this_section - 1) &&
- ref->type == menu_reference &&
- strcmp (ref->node, node) == 0)
- {
- char *containing_node = ref->containing_node;
-
- free (up);
- up = xstrdup (containing_node);
-
- if (last_ref &&
- last_ref->type == menu_reference &&
- (strcmp (last_ref->containing_node,
- containing_node) == 0))
- {
- free (next);
- next = xstrdup (last_ref->node);
- }
-
- while ((ref->section == this_section - 1) &&
- (ref->next) &&
- (ref->next->type != menu_reference))
- ref = ref->next;
-
- if (ref->next && ref->type == menu_reference &&
- (strcmp (ref->next->containing_node,
- containing_node) == 0))
- {
- free (prev);
- prev = xstrdup (ref->next->node);
- }
- else if (!ref->next &&
- strcasecmp (ref->containing_node, "Top") == 0)
- {
- free (prev);
- prev = xstrdup (ref->containing_node);
- }
- break;
- }
- last_ref = ref;
- ref = ref->next;
- }
+ {
+ if (ref->section == (this_section - 1) &&
+ ref->type == menu_reference &&
+ strcmp (ref->node, node) == 0)
+ {
+ char *containing_node = ref->containing_node;
+
+ free (up);
+ up = strdup (containing_node);
+
+ if (last_ref &&
+ last_ref->type == menu_reference &&
+ (strcmp (last_ref->containing_node,
+ containing_node) == 0))
+ {
+ free (next);
+ next = strdup (last_ref->node);
+ }
+
+ while ((ref->section == this_section - 1) &&
+ (ref->next) &&
+ (ref->next->type != menu_reference))
+ ref = ref->next;
+
+ if (ref->next && ref->type == menu_reference &&
+ (strcmp (ref->next->containing_node,
+ containing_node) == 0))
+ {
+ free (prev);
+ prev = strdup (ref->next->node);
+ }
+ else if (!ref->next &&
+ strcasecmp (ref->containing_node, "Top") == 0)
+ {
+ free (prev);
+ prev = strdup (ref->containing_node);
+ }
+ break;
+ }
+ last_ref = ref;
+ ref = ref->next;
+ }
}
#if defined (HAVE_MACROS)
/* Insert the correct args if we are expanding macros, and the node's
pointers weren't defaulted. */
- if (macro_expansion_output_stream && !executing_string && !defaulting)
+ if (macro_expansion_output_stream && !defaulting)
{
char *temp;
int op_orig = output_paragraph_offset;
@@ -4972,29 +4929,29 @@ cm_node ()
{
#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
- me_inhibit_expansion++;
+ me_inhibit_expansion++;
#endif /* HAVE_MACROS */
if (*next)
- {
- execute_string (", Next: %s", next);
- filling_enabled = indented_fill = 0;
- }
+ {
+ execute_string (", Next: %s", next);
+ filling_enabled = indented_fill = 0;
+ }
if (*prev)
- {
- execute_string (", Prev: %s", prev);
- filling_enabled = indented_fill = 0;
- }
+ {
+ execute_string (", Prev: %s", prev);
+ filling_enabled = indented_fill = 0;
+ }
if (*up)
- {
- execute_string (", Up: %s", up);
- filling_enabled = indented_fill = 0;
- }
+ {
+ execute_string (", Up: %s", up);
+ filling_enabled = indented_fill = 0;
+ }
#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
- me_inhibit_expansion--;
+ me_inhibit_expansion--;
#endif /* HAVE_MACROS */
}
@@ -5004,7 +4961,7 @@ cm_node ()
if (!*node)
{
line_error ("No node name specified for `%c%s' command",
- COMMAND_PREFIX, command);
+ COMMAND_PREFIX, command);
free (node);
free (next);
free (prev);
@@ -5055,141 +5012,141 @@ validate_file (tag_table)
/* If this is a "no warn" node, don't validate it in any way. */
if (tags->flags & NO_WARN)
- {
- tags = tags->next_ent;
- continue;
- }
+ {
+ tags = tags->next_ent;
+ continue;
+ }
/* If this node has a Next, then make sure that the Next exists. */
if (tags->next)
- {
- validate (tags->next, tags->line_no, "Next");
-
- /* If the Next node exists, and there is no Up, then make
- sure that the Prev of the Next points back. */
- temp_tag = find_node (tags->next);
- if (temp_tag)
- {
- char *prev;
-
- if (temp_tag->flags & NO_WARN)
- {
- /* Do nothing if we aren't supposed to issue warnings
- about this node. */
- }
- else
- {
- prev = temp_tag->prev;
- if (!prev || (strcmp (prev, tags->node) != 0))
- {
- line_error (_("Node `%s''s Next field not pointed back to"),
- tags->node);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- line_error
- (_("This node (`%s') is the one with the bad `Prev'"),
- temp_tag->node);
- input_filename = tags->filename;
- line_number = tags->line_no;
- temp_tag->flags |= PREV_ERROR;
- }
- }
- }
- }
+ {
+ validate (tags->next, tags->line_no, "Next");
+
+ /* If the Next node exists, and there is no Up, then make
+ sure that the Prev of the Next points back. */
+ if (temp_tag = find_node (tags->next))
+ {
+ char *prev;
+
+ if (temp_tag->flags & NO_WARN)
+ {
+ /* Do nothing if we aren't supposed to issue warnings
+ about this node. */
+ }
+ else
+ {
+ prev = temp_tag->prev;
+ if (!prev || (strcmp (prev, tags->node) != 0))
+ {
+ line_error ("Node `%s''s Next field not pointed back to",
+ tags->node);
+ line_number = temp_tag->line_no;
+ input_filename = temp_tag->filename;
+ line_error
+ ("This node (`%s') is the one with the bad `Prev'",
+ temp_tag->node);
+ input_filename = tags->filename;
+ line_number = tags->line_no;
+ temp_tag->flags |= PREV_ERROR;
+ }
+ }
+ }
+ }
/* Validate the Prev field if there is one, and we haven't already
- complained about it in some way. You don't have to have a Prev
- field at this stage. */
+ complained about it in some way. You don't have to have a Prev
+ field at this stage. */
if (!(tags->flags & PREV_ERROR) && tags->prev)
- {
- int valid_p = validate (tags->prev, tags->line_no, "Prev");
-
- if (!valid_p)
- tags->flags |= PREV_ERROR;
- else
- {
- /* If the Prev field is not the same as the Up field,
- then the node pointed to by the Prev field must have
- a Next field which points to this node. */
- if (tags->up && (strcmp (tags->prev, tags->up) != 0))
- {
- temp_tag = find_node (tags->prev);
-
- /* If we aren't supposed to issue warnings about the
- target node, do nothing. */
- if (!temp_tag || (temp_tag->flags & NO_WARN))
- {
- /* Do nothing. */
- }
- else
- {
- if (!temp_tag->next ||
- (strcmp (temp_tag->next, tags->node) != 0))
- {
- line_error
- (_("Node `%s's Prev field not pointed back to"),
- tags->node);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- line_error (_("This node (`%s') has the bad Next"),
- temp_tag->node);
- input_filename = tags->filename;
- line_number = tags->line_no;
- temp_tag->flags |= NEXT_ERROR;
- }
- }
- }
- }
- }
-
- if (!tags->up && (strcasecmp (tags->node, _("Top")) != 0))
- line_error (_("Node `%s' missing Up field"), tags->node);
+ {
+ int valid = validate (tags->prev, tags->line_no, "Prev");
+
+ if (!valid)
+ tags->flags |= PREV_ERROR;
+ else
+ {
+ /* If the Prev field is not the same as the Up field,
+ then the node pointed to by the Prev field must have
+ a Next field which points to this node. */
+ if (tags->up && (strcmp (tags->prev, tags->up) != 0))
+ {
+ temp_tag = find_node (tags->prev);
+
+ /* If we aren't supposed to issue warnings about the
+ target node, do nothing. */
+ if (!temp_tag || (temp_tag->flags & NO_WARN))
+ {
+ /* Do nothing. */
+ }
+ else
+ {
+ if (!temp_tag->next ||
+ (strcmp (temp_tag->next, tags->node) != 0))
+ {
+ line_error
+ ("Node `%s''s Prev field not pointed back to",
+ tags->node);
+ line_number = temp_tag->line_no;
+ input_filename = temp_tag->filename;
+ line_error
+ ("This node (`%s') is the one with the bad `Next'",
+ temp_tag->node);
+ input_filename = tags->filename;
+ line_number = tags->line_no;
+ temp_tag->flags |= NEXT_ERROR;
+ }
+ }
+ }
+ }
+ }
+
+ if (!tags->up && (strcasecmp (tags->node, "Top") != 0))
+ line_error ("Node `%s' is missing an \"Up\" field", tags->node);
else if (tags->up)
- {
- int valid_p = validate (tags->up, tags->line_no, "Up");
-
- /* If node X has Up: Y, then warn if Y fails to have a menu item
- or note pointing at X, if Y isn't of the form "(Y)". */
- if (valid_p && *tags->up != '(')
- {
- NODE_REF *nref, *tref, *list;
- NODE_REF *find_node_reference ();
-
- tref = (NODE_REF *) NULL;
- list = node_references;
-
- for (;;)
- {
- if (!(nref = find_node_reference (tags->node, list)))
- break;
-
- if (strcmp (nref->containing_node, tags->up) == 0)
- {
- if (nref->type != menu_reference)
- {
- tref = nref;
- list = nref->next;
- }
- else
- break;
- }
- list = nref->next;
- }
-
- if (!nref)
- {
- temp_tag = find_node (tags->up);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- if (!tref)
- line_error (
-_("`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"),
- tags->node, tags->up, tags->up, tags->node);
- line_number = tags->line_no;
- input_filename = tags->filename;
- }
- }
- }
+ {
+ int valid = validate (tags->up, tags->line_no, "Up");
+
+ /* If node X has Up: Y, then warn if Y fails to have a menu item
+ or note pointing at X, if Y isn't of the form "(Y)". */
+ if (valid && *tags->up != '(')
+ {
+ NODE_REF *nref, *tref, *list;
+ NODE_REF *find_node_reference ();
+
+ tref = (NODE_REF *) NULL;
+ list = node_references;
+
+ for (;;)
+ {
+ if (!(nref = find_node_reference (tags->node, list)))
+ break;
+
+ if (strcmp (nref->containing_node, tags->up) == 0)
+ {
+ if (nref->type != menu_reference)
+ {
+ tref = nref;
+ list = nref->next;
+ }
+ else
+ break;
+ }
+ list = nref->next;
+ }
+
+ if (!nref)
+ {
+ temp_tag = find_node (tags->up);
+ line_number = temp_tag->line_no;
+ input_filename = temp_tag->filename;
+ if (!tref)
+ line_error (
+"`%s' has an Up field of `%s', but `%s' has no menu item for `%s'",
+ tags->node, tags->up, tags->up, tags->node);
+ line_number = tags->line_no;
+ input_filename = tags->filename;
+ }
+ }
+ }
tags = tags->next_ent;
}
@@ -5202,32 +5159,32 @@ _("`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"),
{
/* If this node is a "no warn" node, do nothing. */
if (tags->flags & NO_WARN)
- {
- tags = tags->next_ent;
- continue;
- }
+ {
+ tags = tags->next_ent;
+ continue;
+ }
/* Special hack. If the node in question appears to have
been referenced more than REFERENCE_WARNING_LIMIT times,
give a warning. */
if (tags->touched > reference_warning_limit)
- {
- input_filename = tags->filename;
- line_number = tags->line_no;
- warning (_("node `%s' has been referenced %d times"),
- tags->node, tags->touched);
- }
+ {
+ input_filename = tags->filename;
+ line_number = tags->line_no;
+ warning ("Node `%s' has been referenced %d times",
+ tags->node, tags->touched);
+ }
if (tags->touched == 0)
- {
- input_filename = tags->filename;
- line_number = tags->line_no;
-
- /* Notice that the node "Top" is special, and doesn't have to
- be referenced. */
- if (strcasecmp (tags->node, _("Top")) != 0)
- warning (_("unreferenced node `%s'"), tags->node);
- }
+ {
+ input_filename = tags->filename;
+ line_number = tags->line_no;
+
+ /* Notice that the node "Top" is special, and doesn't have to
+ be referenced. */
+ if (strcasecmp (tags->node, "Top") != 0)
+ warning ("Unreferenced node `%s'", tags->node);
+ }
tags = tags->next_ent;
}
input_filename = old_input_filename;
@@ -5253,7 +5210,9 @@ validate (tag, line, label)
if (!result)
{
line_number = line;
- line_error (_("%s reference to nonexistent node `%s'"), label, tag);
+ line_error (
+"Validation error. `%s' field points to node `%s', which doesn't exist",
+ label, tag);
return (0);
}
result->touched++;
@@ -5297,7 +5256,7 @@ split_file (filename, size)
root_pathname = pathname_part (filename);
if (!root_pathname)
- root_pathname = xstrdup ("");
+ root_pathname = strdup ("");
/* Start splitting the file. Walk along the tag table
outputting sections of the file. When we have written
@@ -5316,122 +5275,122 @@ split_file (filename, size)
while (tags)
{
- int file_top, file_bot, limit;
-
- /* Have to include the Control-_. */
- file_top = file_bot = tags->position;
- limit = file_top + size;
-
- /* If the rest of this file is only one node, then
- that is the entire subfile. */
- if (!tags->next_ent)
- {
- int i = tags->position + 1;
- char last_char = the_file[i];
-
- while (i < file_size)
- {
- if ((the_file[i] == '\037') &&
- ((last_char == '\n') ||
- (last_char == '\014')))
- break;
- else
- last_char = the_file[i];
- i++;
- }
- file_bot = i;
- tags = tags->next_ent;
- goto write_region;
- }
-
- /* Otherwise, find the largest number of nodes that can fit in
- this subfile. */
- for (; tags; tags = tags->next_ent)
- {
- if (!tags->next_ent)
- {
- /* This entry is the last node. Search forward for the end
- of this node, and that is the end of this file. */
- int i = tags->position + 1;
- char last_char = the_file[i];
-
- while (i < file_size)
- {
- if ((the_file[i] == '\037') &&
- ((last_char == '\n') ||
- (last_char == '\014')))
- break;
- else
- last_char = the_file[i];
- i++;
- }
- file_bot = i;
-
- if (file_bot < limit)
- {
- tags = tags->next_ent;
- goto write_region;
- }
- else
- {
- /* Here we want to write out everything before the last
- node, and then write the last node out in a file
- by itself. */
- file_bot = tags->position;
- goto write_region;
- }
- }
-
- if (tags->next_ent->position > limit)
- {
- if (tags->position == file_top)
- tags = tags->next_ent;
-
- file_bot = tags->position;
-
- write_region:
- {
- int fd;
- char *split_filename;
-
- split_filename = (char *) xmalloc
- (10 + strlen (root_pathname) + strlen (root_filename));
- sprintf
- (split_filename,
- "%s%s-%d", root_pathname, root_filename, which_file);
-
- fd = open
- (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
-
- if ((fd < 0) ||
- (write (fd, the_header, header_size) != header_size) ||
- (write (fd, the_file + file_top, file_bot - file_top)
- != (file_bot - file_top)) ||
- ((close (fd)) < 0))
- {
- perror (split_filename);
- if (fd != -1)
- close (fd);
- exit (FATAL);
- }
-
- if (!indirect_info)
- {
- indirect_info = the_file + file_top;
- sprintf (indirect_info, "\037\nIndirect:\n");
- indirect_info += strlen (indirect_info);
- }
-
- sprintf (indirect_info, "%s-%d: %d\n",
- root_filename, which_file, file_top);
-
- free (split_filename);
- indirect_info += strlen (indirect_info);
- which_file++;
- break;
- }
- }
- }
+ int file_top, file_bot, limit;
+
+ /* Have to include the Control-_. */
+ file_top = file_bot = tags->position;
+ limit = file_top + size;
+
+ /* If the rest of this file is only one node, then
+ that is the entire subfile. */
+ if (!tags->next_ent)
+ {
+ int i = tags->position + 1;
+ char last_char = the_file[i];
+
+ while (i < file_size)
+ {
+ if ((the_file[i] == '\037') &&
+ ((last_char == '\n') ||
+ (last_char == '\014')))
+ break;
+ else
+ last_char = the_file[i];
+ i++;
+ }
+ file_bot = i;
+ tags = tags->next_ent;
+ goto write_region;
+ }
+
+ /* Otherwise, find the largest number of nodes that can fit in
+ this subfile. */
+ for (; tags; tags = tags->next_ent)
+ {
+ if (!tags->next_ent)
+ {
+ /* This entry is the last node. Search forward for the end
+ of this node, and that is the end of this file. */
+ int i = tags->position + 1;
+ char last_char = the_file[i];
+
+ while (i < file_size)
+ {
+ if ((the_file[i] == '\037') &&
+ ((last_char == '\n') ||
+ (last_char == '\014')))
+ break;
+ else
+ last_char = the_file[i];
+ i++;
+ }
+ file_bot = i;
+
+ if (file_bot < limit)
+ {
+ tags = tags->next_ent;
+ goto write_region;
+ }
+ else
+ {
+ /* Here we want to write out everything before the last
+ node, and then write the last node out in a file
+ by itself. */
+ file_bot = tags->position;
+ goto write_region;
+ }
+ }
+
+ if (tags->next_ent->position > limit)
+ {
+ if (tags->position == file_top)
+ tags = tags->next_ent;
+
+ file_bot = tags->position;
+
+ write_region:
+ {
+ int fd;
+ char *split_filename;
+
+ split_filename = (char *) xmalloc
+ (10 + strlen (root_pathname) + strlen (root_filename));
+ sprintf
+ (split_filename,
+ "%s%s-%d", root_pathname, root_filename, which_file);
+
+ fd = open
+ (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
+
+ if ((fd < 0) ||
+ (write (fd, the_header, header_size) != header_size) ||
+ (write (fd, the_file + file_top, file_bot - file_top)
+ != (file_bot - file_top)) ||
+ ((close (fd)) < 0))
+ {
+ perror (split_filename);
+ if (fd != -1)
+ close (fd);
+ exit (FATAL);
+ }
+
+ if (!indirect_info)
+ {
+ indirect_info = the_file + file_top;
+ sprintf (indirect_info, "\037\nIndirect:\n");
+ indirect_info += strlen (indirect_info);
+ }
+
+ sprintf (indirect_info, "%s-%d: %d\n",
+ root_filename, which_file, file_top);
+
+ free (split_filename);
+ indirect_info += strlen (indirect_info);
+ which_file++;
+ break;
+ }
+ }
+ }
}
/* We have sucessfully created the subfiles. Now write out the
@@ -5440,8 +5399,8 @@ split_file (filename, size)
output_stream = fopen (filename, "w");
if (!output_stream)
{
- perror (filename);
- exit (FATAL);
+ perror (filename);
+ exit (FATAL);
}
{
@@ -5460,8 +5419,10 @@ split_file (filename, size)
}
}
-/* The strings here are followed in the message by `reference to...' in
- the `validate' routine. */
+/* Some menu hacking. This is used to remember menu references while
+ reading the input file. After the output file has been written, if
+ validation is on, then we use the contents of NODE_REFERENCES as a
+ list of nodes to validate. */
char *
reftype_type_string (type)
enum reftype type;
@@ -5471,16 +5432,13 @@ reftype_type_string (type)
case menu_reference:
return ("Menu");
case followed_reference:
- return ("Cross");
+ return ("Followed-Reference");
default:
return ("Internal-bad-reference-type");
}
}
-/* Remember this node name for later validation use. This is used to
- remember menu references while reading the input file. After the
- output file has been written, if validation is on, then we use the
- contents of `node_references' as a list of nodes to validate. */
+/* Remember this node name for later validation use. */
void
remember_node_reference (node, line, type)
char *node;
@@ -5490,11 +5448,11 @@ remember_node_reference (node, line, type)
NODE_REF *temp = (NODE_REF *) xmalloc (sizeof (NODE_REF));
temp->next = node_references;
- temp->node = xstrdup (node);
+ temp->node = strdup (node);
temp->line_no = line;
temp->section = current_section;
temp->type = type;
- temp->containing_node = xstrdup (current_node ? current_node : "");
+ temp->containing_node = strdup (current_node ? current_node : "");
temp->filename = node_filename;
node_references = temp;
@@ -5510,7 +5468,7 @@ validate_other_references (ref_list)
{
input_filename = ref_list->filename;
validate (ref_list->node, ref_list->line_no,
- reftype_type_string (ref_list->type));
+ reftype_type_string (ref_list->type));
ref_list = ref_list->next;
}
input_filename = old_input_filename;
@@ -5525,7 +5483,7 @@ find_node_reference (node, ref_list)
while (ref_list)
{
if (strcmp (node, ref_list->node) == 0)
- break;
+ break;
ref_list = ref_list->next;
}
return (ref_list);
@@ -5562,13 +5520,13 @@ glean_node_from_menu (remember_reference)
char *nodename;
if (strncmp (&input_text[input_text_offset + 1],
- menu_starter,
- strlen (menu_starter)) != 0)
+ menu_starter,
+ strlen (menu_starter)) != 0)
return ((char *)NULL);
else
input_text_offset += strlen (menu_starter) + 1;
- get_until_in_line (0, ":", &nodename);
+ get_until_in_line (":", &nodename);
if (curchar () == ':')
input_text_offset++;
canon_white (nodename);
@@ -5594,7 +5552,7 @@ save_node:
normalize_node_name (nodename);
i = strlen (nodename);
if (i && nodename[i - 1] == ':')
- nodename[i - 1] = 0;
+ nodename[i - 1] = '\0';
if (remember_reference)
{
@@ -5621,7 +5579,7 @@ isolate_nodename (nodename)
if (*nodename == '.' || !*nodename)
{
- *nodename = 0;
+ *nodename = '\0';
return;
}
@@ -5632,32 +5590,32 @@ isolate_nodename (nodename)
i++;
}
- for (; (c = nodename[i]); i++)
+ for (; c = nodename[i]; i++)
{
if (paren)
- {
- if (c == '(')
- paren++;
- else if (c == ')')
- paren--;
+ {
+ if (c == '(')
+ paren++;
+ else if (c == ')')
+ paren--;
- continue;
- }
+ continue;
+ }
/* If the character following the close paren is a space, then this
- node has no more characters associated with it. */
+ node has no more characters associated with it. */
if (c == '\t' ||
- c == '\n' ||
- c == ',' ||
- ((paren_seen && nodename[i - 1] == ')') &&
- (c == ' ' || c == '.')) ||
- (c == '.' &&
- ((!nodename[i + 1] ||
- (cr_or_whitespace (nodename[i + 1])) ||
- (nodename[i + 1] == ')')))))
- break;
+ c == '\n' ||
+ c == ',' ||
+ ((paren_seen && nodename[i - 1] == ')') &&
+ (c == ' ' || c == '.')) ||
+ (c == '.' &&
+ ((!nodename[i + 1] ||
+ (cr_or_whitespace (nodename[i + 1])) ||
+ (nodename[i + 1] == ')')))))
+ break;
}
- nodename[i] = 0;
+ nodename[i] = '\0';
}
void
@@ -5665,8 +5623,8 @@ cm_menu ()
{
if (current_node == (char *)NULL)
{
- warning (_("%cmenu seen before first node"), COMMAND_PREFIX);
- warning (_("creating `Top' node"));
+ warning ("%cmenu seen before a node has been defined", COMMAND_PREFIX);
+ warning ("Creating `TOP' node.");
execute_string ("@node Top");
}
begin_insertion (menu);
@@ -5677,21 +5635,19 @@ cm_detailmenu ()
{
if (current_node == (char *)NULL)
{
- warning (_("%cmenu seen before first node"), COMMAND_PREFIX);
- warning (_("creating `Top' node"));
+ warning ("%cmenu seen before a node has been defined", COMMAND_PREFIX);
+ warning ("Creating `TOP' node.");
execute_string ("@node Top");
}
begin_insertion (detailmenu);
}
/* **************************************************************** */
-/* */
-/* Cross Reference Hacking */
-/* */
+/* */
+/* Cross Reference Hacking */
+/* */
/* **************************************************************** */
-/* Return next comma-delimited argument, but do not cross a close-brace
- boundary. Clean up whitespace, too. */
char *
get_xref_token ()
{
@@ -5704,7 +5660,7 @@ get_xref_token ()
return (string);
}
-int px_ref_flag = 0; /* Controls initial output string. */
+int px_ref_flag = 0; /* Controls initial output string. */
/* Make a cross reference. */
void
@@ -5723,45 +5679,45 @@ cm_xref (arg)
add_word_args ("%s", px_ref_flag ? "*note " : "*Note ");
if (*arg5 || *arg4)
- {
- char *node_name;
-
- if (!*arg2)
- {
- if (*arg3)
- node_name = arg3;
- else
- node_name = arg1;
- }
- else
- node_name = arg2;
-
- execute_string ("%s: (%s)%s", node_name, arg4, arg1);
- /* Free all of the arguments found. */
- if (arg1) free (arg1);
- if (arg2) free (arg2);
- if (arg3) free (arg3);
- if (arg4) free (arg4);
- if (arg5) free (arg5);
- return;
- }
+ {
+ char *node_name;
+
+ if (!*arg2)
+ {
+ if (*arg3)
+ node_name = arg3;
+ else
+ node_name = arg1;
+ }
+ else
+ node_name = arg2;
+
+ execute_string ("%s: (%s)%s", node_name, arg4, arg1);
+ /* Free all of the arguments found. */
+ if (arg1) free (arg1);
+ if (arg2) free (arg2);
+ if (arg3) free (arg3);
+ if (arg4) free (arg4);
+ if (arg5) free (arg5);
+ return;
+ }
else
- remember_node_reference (arg1, line_number, followed_reference);
+ remember_node_reference (arg1, line_number, followed_reference);
if (*arg3)
- {
- if (!*arg2)
- execute_string ("%s: %s", arg3, arg1);
- else
- execute_string ("%s: %s", arg2, arg1);
- }
+ {
+ if (!*arg2)
+ execute_string ("%s: %s", arg3, arg1);
+ else
+ execute_string ("%s: %s", arg2, arg1);
+ }
else
- {
- if (*arg2)
- execute_string ("%s: %s", arg2, arg1);
- else
- execute_string ("%s::", arg1);
- }
+ {
+ if (*arg2)
+ execute_string ("%s: %s", arg2, arg1);
+ else
+ execute_string ("%s::", arg1);
+ }
/* Free all of the arguments found. */
if (arg1) free (arg1);
@@ -5778,25 +5734,26 @@ cm_xref (arg)
int temp = input_text_offset + 1;
if (output_paragraph[output_paragraph_offset - 2] == ':' &&
- output_paragraph[output_paragraph_offset - 1] == ':')
- return;
+ output_paragraph[output_paragraph_offset - 1] == ':')
+ return;
while (temp < size_of_input_text)
- {
- if (cr_or_whitespace (input_text[temp]))
- temp++;
- else
- {
- if (input_text[temp] != '.'
- && input_text[temp] != ','
- && input_text[temp] != '\t')
- {
- line_error (
- _("`.' or `,' must follow cross reference, not %c"),
- input_text[temp]);
- }
- break;
- }
- }
+ {
+ if (cr_or_whitespace (input_text[temp]))
+ temp++;
+ else
+ {
+ if (input_text[temp] == '.' ||
+ input_text[temp] == ',' ||
+ input_text[temp] == '\t')
+ return;
+ else
+ {
+ line_error (
+ "Cross-reference must be terminated with a period or a comma");
+ return;
+ }
+ }
+ }
}
}
@@ -5820,159 +5777,20 @@ cm_inforef (arg)
{
if (arg == START)
{
- char *node = get_xref_token ();
- char *pname = get_xref_token ();
- char *file = get_xref_token ();
+ char *node, *pname, *file;
- if (*pname)
- execute_string ("*note %s: (%s)%s", pname, file, node);
- else
- execute_string ("*note (%s)%s::", file, node);
+ node = get_xref_token ();
+ pname = get_xref_token ();
+ file = get_xref_token ();
- free (node);
- free (pname);
- free (file);
- }
-}
-
-/* A URL reference. */
-void
-cm_uref (arg, start_pos, end_pos)
- int arg, start_pos, end_pos;
-{
- if (arg == END)
- {
- char *comma;
- char *arg = (char *) &output_paragraph[start_pos];
-
- output_paragraph[end_pos] = 0;
- output_column -= end_pos - start_pos;
- output_paragraph_offset = start_pos;
-
- arg = xstrdup (arg);
- comma = strchr (arg, ','); /* let's hope for no commas in the url */
- if (comma)
- {
- *comma = 0;
- /* Ignore spaces at beginning of second arg. */
- for (comma++; isspace (*comma); comma++)
- ;
- add_word (comma);
- add_char (' ');
- add_char ('(');
- add_word (arg);
- add_char (')');
- }
- else
- {
- extern int printing_index;
-
- if (!printing_index)
- add_char ('`');
-
- add_word (arg);
-
- if (!printing_index)
- add_char ('\'');
- }
- free (arg);
- }
-}
-
-/* An email reference. */
-void
-cm_email (arg, start_pos, end_pos)
- int arg, start_pos, end_pos;
-{
- if (arg == END)
- {
- char *comma;
- char *arg = (char *) &output_paragraph[start_pos];
-
- output_paragraph[end_pos] = 0;
- output_column -= end_pos - start_pos;
- output_paragraph_offset = start_pos;
-
- arg = xstrdup (arg);
- comma = strchr (arg, ',');
- if (comma)
- {
- *comma = 0;
- for (comma++; isspace (*comma); comma++)
- ;
- add_word (comma);
- add_char (' ');
- }
- add_char ('<');
- add_word (arg);
- add_char ('>');
- free (arg);
- }
-}
-
-/* An external image is a reference, kind of. The parsing is (not
- coincidentally) similar, anyway. */
-void
-cm_image (arg)
- int arg;
-{
- if (arg == START)
- {
- char *name_arg = get_xref_token ();
- /* We don't yet care about any other args, but read them so they
- don't end up in the text. */
- char *arg = get_xref_token ();
- if (arg) free (arg);
- arg = get_xref_token ();
- if (arg) free (arg);
-
- if (*name_arg)
- {
- /* Try to open foo.txt. */
- FILE *image_file;
- char *name = xmalloc (strlen (name_arg) + 4);
- strcpy (name, name_arg);
- strcat (name, ".txt");
- image_file = fopen (name, "r");
- if (image_file)
- {
- int ch;
- int save_inhibit_indentation = inhibit_paragraph_indentation;
- int save_filling_enabled = filling_enabled;
-
- inhibit_paragraph_indentation = 1;
- filling_enabled = 0;
- last_char_was_newline = 0;
-
- /* Maybe we need to remove the final newline if the image
- file is only one line to allow in-line images. On the
- other hand, they could just make the file without a
- final newline. */
- while ((ch = getc (image_file)) != EOF)
- add_char (ch);
-
- inhibit_paragraph_indentation = save_inhibit_indentation;
- filling_enabled = save_filling_enabled;
-
- if (fclose (image_file) != 0) {
- perror (name);
- }
- }
- else
- warning (_("@image file `%s' unreadable: %s"), name,
- strerror (errno));
- }
- else
- line_error (_("@image missing filename argument"));
-
- if (name_arg) free (name_arg);
+ execute_string ("*note %s: (%s)%s", pname, file, node);
}
}
/* **************************************************************** */
-/* */
-/* Insertion Command Stubs */
-/* */
+/* */
+/* Insertion Command Stubs */
+/* */
/* **************************************************************** */
void
@@ -6006,7 +5824,7 @@ cm_smalllisp ()
}
/* @cartouche/@end cartouche draws box with rounded corners in
- TeX output. Right now, just a no-op insertion. */
+ TeX output. Right now, just a NOP insertion. */
void
cm_cartouche ()
{
@@ -6053,26 +5871,26 @@ do_enumeration (type, default_string)
int type;
char *default_string;
{
- get_until_in_line (0, ".", &enumeration_arg);
+ get_until_in_line (".", &enumeration_arg);
canon_white (enumeration_arg);
if (!*enumeration_arg)
{
free (enumeration_arg);
- enumeration_arg = xstrdup (default_string);
+ enumeration_arg = strdup (default_string);
}
if (!isdigit (*enumeration_arg) && !isletter (*enumeration_arg))
{
- warning (_("%s requires letter or digit"), insertion_type_pname (type));
+ warning ("%s requires a letter or a digit", insertion_type_pname (type));
switch (type)
- {
- case enumerate:
- default_string = "1";
- break;
- }
- enumeration_arg = xstrdup (default_string);
+ {
+ case enumerate:
+ default_string = "1";
+ break;
+ }
+ enumeration_arg = strdup (default_string);
}
begin_insertion (type);
}
@@ -6086,7 +5904,7 @@ cm_table ()
void
cm_multitable ()
{
- begin_insertion (multitable); /* @@ */
+ begin_insertion (multitable); /* @@ */
}
void
@@ -6113,18 +5931,6 @@ cm_ifinfo ()
begin_insertion (ifinfo);
}
-void
-cm_ifnothtml ()
-{
- begin_insertion (ifnothtml);
-}
-
-void
-cm_ifnottex ()
-{
- begin_insertion (ifnottex);
-}
-
/* Begin an insertion where the lines are not filled or indented. */
void
cm_flushleft ()
@@ -6139,40 +5945,11 @@ cm_flushright ()
{
begin_insertion (flushright);
}
-
-/* End existing insertion block. */
-void
-cm_end ()
-{
- char *temp;
- enum insertion_type type;
-
- if (!insertion_level)
- {
- line_error (_("Unmatched `%c%s'"), COMMAND_PREFIX, command);
- return;
- }
-
- get_rest_of_line (&temp);
-
- if (temp[0] == 0)
- line_error (_("`%c%s' needs something after it"), COMMAND_PREFIX, command);
-
- type = find_type_from_name (temp);
-
- if (type == bad_type)
- {
- line_error (_("Bad argument to `%s', `%s', using `%s'"),
- command, temp, insertion_type_pname (current_insertion_type ()));
- }
- end_insertion (type);
- free (temp);
-}
/* **************************************************************** */
-/* */
-/* Conditional Handling */
-/* */
+/* */
+/* Conditional Handling */
+/* */
/* **************************************************************** */
/* A structure which contains `defined' variables. */
@@ -6196,15 +5973,15 @@ set (name, value)
for (temp = defines; temp; temp = temp->next)
if (strcmp (name, temp->name) == 0)
{
- free (temp->value);
- temp->value = xstrdup (value);
- return;
+ free (temp->value);
+ temp->value = strdup (value);
+ return;
}
temp = (DEFINE *)xmalloc (sizeof (DEFINE));
temp->next = defines;
- temp->name = xstrdup (name);
- temp->value = xstrdup (value);
+ temp->name = strdup (name);
+ temp->value = strdup (value);
defines = temp;
}
@@ -6221,17 +5998,17 @@ clear (name)
while (temp)
{
if (strcmp (temp->name, name) == 0)
- {
- if (last)
- last->next = temp->next;
- else
- defines = temp->next;
-
- free (temp->name);
- free (temp->value);
- free (temp);
- break;
- }
+ {
+ if (last)
+ last->next = temp->next;
+ else
+ defines = temp->next;
+
+ free (temp->name);
+ free (temp->value);
+ free (temp);
+ break;
+ }
last = temp;
temp = temp->next;
}
@@ -6301,6 +6078,7 @@ cm_ifclear ()
void
cm_ifeq ()
{
+ register int i;
char **arglist;
arglist = get_brace_args (0);
@@ -6308,11 +6086,11 @@ cm_ifeq ()
if (arglist)
{
if (array_len (arglist) > 1)
- {
- if ((strcasecmp (arglist[0], arglist[1]) == 0) &&
- (arglist[2] != (char *)NULL))
- execute_string ("%s\n", arglist[2]);
- }
+ {
+ if ((strcasecmp (arglist[0], arglist[1]) == 0) &&
+ (arglist[2] != (char *)NULL))
+ execute_string ("%s\n", arglist[2]);
+ }
free_array (arglist);
}
@@ -6324,10 +6102,10 @@ cm_value (arg, start_pos, end_pos)
{
if (arg == END)
{
- char *name = (char *) &output_paragraph[start_pos];
- char *value;
- output_paragraph[end_pos] = 0;
- name = xstrdup (name);
+ char *name, *value;
+ name = (char *)&output_paragraph[start_pos];
+ output_paragraph[end_pos] = '\0';
+ name = strdup (name);
value = set_p (name);
output_column -= end_pos - start_pos;
output_paragraph_offset = start_pos;
@@ -6335,7 +6113,7 @@ cm_value (arg, start_pos, end_pos)
if (value)
execute_string ("%s", value);
else
- add_word_args (_("{No Value For \"%s\"}"), name);
+ add_word_args ("{No Value For \"%s\"}", name);
free (name);
}
@@ -6350,6 +6128,7 @@ handle_variable (action)
get_rest_of_line (&name);
backup_input_pointer ();
+ canon_white (name);
handle_variable_internal (action, name);
free (name);
}
@@ -6369,12 +6148,12 @@ handle_variable_internal (action, name)
{
/* #if defined (SET_WITH_EQUAL) */
if (*temp == '"' || *temp == '\'')
- {
- if (*temp == delimiter)
- delimiter = 0;
- else
- delimiter = *temp;
- }
+ {
+ if (*temp == delimiter)
+ delimiter = 0;
+ else
+ delimiter = *temp;
+ }
/* #endif SET_WITH_EQUAL */
temp++;
}
@@ -6382,146 +6161,135 @@ handle_variable_internal (action, name)
if (*temp)
additional_text_present++;
- *temp = 0;
+ *temp = '\0';
if (!*name)
- line_error (_("%c%s requires a name"), COMMAND_PREFIX, command);
+ line_error ("%c%s requires a name", COMMAND_PREFIX, command);
else
{
switch (action)
- {
- case SET:
- {
- char *value;
+ {
+ case SET:
+ {
+ char *value;
#if defined (SET_WITH_EQUAL)
- /* Allow a value to be saved along with a variable. The value is
- the text following an `=' sign in NAME, if any is present. */
+ /* Allow a value to be saved along with a variable. The value is
+ the text following an `=' sign in NAME, if any is present. */
- for (value = name; *value && *value != '='; value++);
+ for (value = name; *value && *value != '='; value++);
- if (*value)
- *value++ = 0;
+ if (*value)
+ *value++ = '\0';
- if (*value == '"' || *value == '\'')
- {
- value++;
- value[strlen (value) - 1] = 0;
- }
+ if (*value == '"' || *value == '\'')
+ {
+ value++;
+ value[strlen (value) - 1] = '\0';
+ }
#else /* !SET_WITH_EQUAL */
- /* The VALUE of NAME is the remainder of the line sans
- whitespace. */
- if (additional_text_present)
- {
- value = temp + 1;
- canon_white (value);
- }
- else
- value = "";
+ /* The VALUE of NAME is the remainder of the line sans
+ whitespace. */
+ if (additional_text_present)
+ {
+ value = temp + 1;
+ canon_white (value);
+ }
+ else
+ value = "";
#endif /* !SET_WITH_VALUE */
- set (name, value);
- }
- break;
-
- case CLEAR:
- clear (name);
- break;
-
- case IFSET:
- case IFCLEAR:
- /* If IFSET and NAME is not set, or if IFCLEAR and NAME is set,
- read lines from the the file until we reach a matching
- "@end CONDITION". This means that we only take note of
- "@ifset/clear" and "@end" commands. */
- {
- char condition[8];
- int condition_len;
- int orig_line_number = line_number;
-
- if (action == IFSET)
- strcpy (condition, "ifset");
- else
- strcpy (condition, "ifclear");
-
- condition_len = strlen (condition);
-
- if ((action == IFSET && !set_p (name))
- || (action == IFCLEAR && set_p (name)))
- {
- int level = 0, done = 0;
-
- while (!done && input_text_offset < size_of_input_text)
- {
- char *freeable_line, *line;
-
- get_rest_of_line (&freeable_line);
-
- for (line = freeable_line; whitespace (*line); line++);
-
- if (*line == COMMAND_PREFIX &&
- (strncmp (line + 1, condition, condition_len) == 0))
- level++;
- else if (strncmp (line, "@end", 4) == 0)
- {
- char *cname = line + 4;
- char *temp;
-
- while (*cname && whitespace (*cname))
- cname++;
- temp = cname;
-
- while (*temp && !whitespace (*temp))
- temp++;
- *temp = 0;
-
- if (strcmp (cname, condition) == 0)
- {
- if (!level)
- {
- done = 1;
- }
- else
- level--;
- }
- }
- free (freeable_line);
- }
-
- if (!done)
- {
- int save = line_number;
- line_number = orig_line_number;
- line_error (_("Reached eof before matching @end %s"),
- condition);
- line_number = save;
- }
-
- /* We found the end of a false @ifset/ifclear. If we are
- in a menu, back up over the newline that ends the ifset,
- since that newline may also begin the next menu entry. */
- break;
- }
- else
- {
- if (action == IFSET)
- begin_insertion (ifset);
- else
- begin_insertion (ifclear);
- }
- }
- break;
- }
+ set (name, value);
+ }
+ break;
+
+ case CLEAR:
+ clear (name);
+ break;
+
+ case IFSET:
+ case IFCLEAR:
+ /* If IFSET and NAME is not set, or if IFCLEAR and NAME is set,
+ read lines from the the file until we reach a matching
+ "@end CONDITION". This means that we only take note of
+ "@ifset/clear" and "@end" commands. */
+ {
+ char condition[8];
+ int condition_len;
+
+ if (action == IFSET)
+ strcpy (condition, "ifset");
+ else
+ strcpy (condition, "ifclear");
+
+ condition_len = strlen (condition);
+
+ if ((action == IFSET && !set_p (name)) ||
+ (action == IFCLEAR && set_p (name)))
+ {
+ int level = 0, done = 0;
+
+ while (!done)
+ {
+ char *freeable_line, *line;
+
+ get_rest_of_line (&freeable_line);
+
+ for (line = freeable_line; whitespace (*line); line++);
+
+ if (*line == COMMAND_PREFIX &&
+ (strncmp (line + 1, condition, condition_len) == 0))
+ level++;
+ else if (strncmp (line, "@end", 4) == 0)
+ {
+ char *cname = line + 4;
+ char *temp;
+
+ while (*cname && whitespace (*cname))
+ cname++;
+ temp = cname;
+
+ while (*temp && !whitespace (*temp))
+ temp++;
+ *temp = '\0';
+
+ if (strcmp (cname, condition) == 0)
+ {
+ if (!level)
+ {
+ done = 1;
+ }
+ else
+ level--;
+ }
+ }
+ free (freeable_line);
+ }
+ /* We found the end of a false @ifset/ifclear. If we are
+ in a menu, back up over the newline that ends the ifset,
+ since that newline may also begin the next menu entry. */
+ break;
+ }
+ else
+ {
+ if (action == IFSET)
+ begin_insertion (ifset);
+ else
+ begin_insertion (ifclear);
+ }
+ }
+ break;
+ }
}
}
/* Execution of random text not in file. */
typedef struct {
- char *string; /* The string buffer. */
- int size; /* The size of the buffer. */
- int in_use; /* Nonzero means string currently in use. */
+ char *string; /* The string buffer. */
+ int size; /* The size of the buffer. */
+ int in_use; /* Non-zero means string currently in use. */
} EXECUTION_STRING;
static EXECUTION_STRING **execution_strings = (EXECUTION_STRING **)NULL;
@@ -6538,26 +6306,26 @@ get_execution_string (initial_size)
if (execution_strings)
{
for (i = 0; i < execution_strings_index; i++)
- if (execution_strings[i] && (execution_strings[i]->in_use == 0))
- {
- es = execution_strings[i];
- break;
- }
+ if (execution_strings[i] && (execution_strings[i]->in_use == 0))
+ {
+ es = execution_strings[i];
+ break;
+ }
}
if (!es)
{
if (execution_strings_index + 1 >= execution_strings_slots)
- {
- execution_strings = (EXECUTION_STRING **)xrealloc
- (execution_strings,
- (execution_strings_slots += 3) * sizeof (EXECUTION_STRING *));
- for (; i < execution_strings_slots; i++)
- execution_strings[i] = (EXECUTION_STRING *)NULL;
- }
+ {
+ execution_strings = (EXECUTION_STRING **)xrealloc
+ (execution_strings,
+ (execution_strings_slots += 3) * sizeof (EXECUTION_STRING *));
+ for (; i < execution_strings_slots; i++)
+ execution_strings[i] = (EXECUTION_STRING *)NULL;
+ }
execution_strings[execution_strings_index] =
- (EXECUTION_STRING *)xmalloc (sizeof (EXECUTION_STRING));
+ (EXECUTION_STRING *)xmalloc (sizeof (EXECUTION_STRING));
es = execution_strings[execution_strings_index];
execution_strings_index++;
@@ -6576,37 +6344,46 @@ get_execution_string (initial_size)
/* Execute the string produced by formatting the ARGs with FORMAT. This
is like submitting a new file with @include. */
+#if defined (HAVE_VARARGS_H) && defined (HAVE_VSPRINTF)
void
-#if defined (VA_FPRINTF) && __STDC__
-execute_string (char *format, ...)
-#else
-execute_string (format, va_alist)
- char *format;
- va_dcl
-#endif
+execute_string (va_alist)
+ va_dcl
{
EXECUTION_STRING *es;
char *temp_string;
-#ifdef VA_FPRINTF
- va_list ap;
-#endif
+ char *format;
+ va_list args;
es = get_execution_string (4000);
temp_string = es->string;
es->in_use = 1;
- VA_START (ap, format);
-#ifdef VA_SPRINTF
- VA_SPRINTF (temp_string, format, ap);
-#else
- sprintf (temp_string, format, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif /* not VA_SPRINTF */
- va_end (ap);
+ va_start (args);
+ format = va_arg (args, char *);
+ vsprintf (temp_string, format, args);
+ va_end (args);
+
+#else /* !(HAVE_VARARGS_H && HAVE_VSPRINTF) */
+
+void
+execute_string (format, arg1, arg2, arg3, arg4, arg5)
+ char *format;
+{
+ EXECUTION_STRING *es;
+ char *temp_string;
+
+ es = get_execution_string (4000);
+ temp_string = es->string;
+ es->in_use = 1;
+
+ sprintf (temp_string, format, arg1, arg2, arg3, arg4, arg5);
+
+#endif /* !(HAVE_VARARGS_H && HAVE_VSPRINTF) */
pushfile ();
input_text_offset = 0;
input_text = temp_string;
- input_filename = xstrdup (input_filename);
+ input_filename = strdup (input_filename);
size_of_input_text = strlen (temp_string);
executing_string++;
@@ -6635,7 +6412,6 @@ expansion (str, implicit_code)
int saved_paragraph_is_open = paragraph_is_open;
inhibit_output_flushing ();
- paragraph_is_open = 1;
execute_string (implicit_code ? "@code{%s}" : "%s", str);
uninhibit_output_flushing ();
@@ -6679,183 +6455,179 @@ cm_item ()
original_input_text_offset = input_text_offset;
get_rest_of_line (&rest_of_line);
+ canon_white (rest_of_line);
item_func = current_item_function ();
/* Okay, do the right thing depending on which insertion function
- is active. */
+ is active. */
switch_top:
switch (stack->insertion)
- {
- case multitable:
- multitable_item ();
- /* Ultra special hack. It appears that some people incorrectly
- place text directly after the @item, instead of on a new line
- by itself. This happens to work in TeX, so I make it work
- here. */
- if (*rest_of_line)
- {
- line_number--;
- input_text_offset = original_input_text_offset;
- }
- break;
-
- case ifinfo:
- case ifset:
- case ifclear:
- case cartouche:
- stack = stack->next;
- if (!stack)
- goto no_insertion;
- else
- goto switch_top;
- break;
-
- case menu:
- case quotation:
- case example:
- case smallexample:
- case lisp:
- case format:
- case display:
- case group:
- line_error (_("The `%c%s' command is meaningless within a `@%s' block"),
- COMMAND_PREFIX, command,
- insertion_type_pname (current_insertion_type ()));
- break;
-
- case itemize:
- case enumerate:
- if (itemx_flag)
- {
- line_error (_("%citemx is not meaningful inside of a `%s' block"),
- COMMAND_PREFIX,
- insertion_type_pname (current_insertion_type ()));
- }
- else
- {
- start_paragraph ();
- kill_self_indent (-1);
- filling_enabled = indented_fill = 1;
-
- if (current_insertion_type () == itemize)
- {
- indent (output_column = current_indent - 2);
-
- /* I need some way to determine whether this command
- takes braces or not. I believe the user can type
- either "@bullet" or "@bullet{}". Of course, they
- can also type "o" or "#" or whatever else they want. */
- if (item_func && *item_func)
- {
- if (*item_func == COMMAND_PREFIX)
- if (item_func[strlen (item_func) - 1] != '}')
- execute_string ("%s{}", item_func);
- else
- execute_string ("%s", item_func);
- else
- execute_string ("%s", item_func);
- }
- insert (' ');
- output_column++;
- }
- else
- enumerate_item ();
-
- /* Special hack. This makes `close_paragraph' a no-op until
- `start_paragraph' has been called. */
- must_start_paragraph = 1;
-
- /* Handle text directly after the @item. */
- if (*rest_of_line)
- {
- line_number--;
- input_text_offset = original_input_text_offset;
- }
- }
- break;
-
- case table:
- case ftable:
- case vtable:
- {
- /* We need this to determine if we have two @item's in a row
- (see test just below). */
- static int last_item_output_position = 0;
-
- /* Get rid of extra characters. */
- kill_self_indent (-1);
-
- /* If we have one @item followed directly by another @item,
- we need to insert a blank line. This is not true for
- @itemx, though. */
- if (!itemx_flag && last_item_output_position == output_position)
- insert ('\n');
-
- /* `close_paragraph' almost does what we want. The problem
- is when paragraph_is_open, and last_char_was_newline, and
- the last newline has been turned into a space, because
- filling_enabled. I handle it here. */
- if (last_char_was_newline && filling_enabled && paragraph_is_open)
- insert ('\n');
- close_paragraph ();
+ {
+ case multitable:
+ multitable_item ();
+ /* Ultra special hack. It appears that some people incorrectly
+ place text directly after the @item, instead of on a new line
+ by itself. This happens to work in TeX, so I make it work
+ here. */
+ if (*rest_of_line)
+ {
+ line_number--;
+ input_text_offset = original_input_text_offset;
+ }
+ break;
+
+ case ifinfo:
+ case ifset:
+ case ifclear:
+ case cartouche:
+ stack = stack->next;
+ if (!stack)
+ goto no_insertion;
+ else
+ goto switch_top;
+ break;
+
+ case menu:
+ case quotation:
+ case example:
+ case smallexample:
+ case lisp:
+ case format:
+ case display:
+ case group:
+ line_error ("The `%c%s' command is meaningless within a `@%s' block",
+ COMMAND_PREFIX, command,
+ insertion_type_pname (current_insertion_type ()));
+ break;
+
+ case itemize:
+ case enumerate:
+ if (itemx_flag)
+ {
+ line_error ("%citemx is not meaningful inside of a `%s' block",
+ COMMAND_PREFIX,
+ insertion_type_pname (current_insertion_type ()));
+ }
+ else
+ {
+ start_paragraph ();
+ kill_self_indent (-1);
+ filling_enabled = indented_fill = 1;
+
+ if (current_insertion_type () == itemize)
+ {
+ indent (output_column = current_indent - 2);
+
+ /* I need some way to determine whether this command
+ takes braces or not. I believe the user can type
+ either "@bullet" or "@bullet{}". Of course, they
+ can also type "o" or "#" or whatever else they want. */
+ if (item_func && *item_func)
+ {
+ if (*item_func == COMMAND_PREFIX)
+ if (item_func[strlen (item_func) - 1] != '}')
+ execute_string ("%s{}", item_func);
+ else
+ execute_string ("%s", item_func);
+ else
+ execute_string ("%s", item_func);
+ }
+ insert (' ');
+ output_column++;
+ }
+ else
+ enumerate_item ();
+
+ /* Special hack. This makes close paragraph ignore you until
+ the start_paragraph () function has been called. */
+ must_start_paragraph = 1;
+
+ /* Ultra special hack. It appears that some people incorrectly
+ place text directly after the @item, instead of on a new line
+ by itself. This happens to work in TeX, so I make it work
+ here. */
+ if (*rest_of_line)
+ {
+ line_number--;
+ input_text_offset = original_input_text_offset;
+ }
+ }
+ break;
+
+ case table:
+ case ftable:
+ case vtable:
+ {
+ /* Get rid of extra characters. */
+ kill_self_indent (-1);
+
+ /* close_paragraph () almost does what we want. The problem
+ is when paragraph_is_open, and last_char_was_newline, and
+ the last newline has been turned into a space, because
+ filling_enabled. I handle it here. */
+ if (last_char_was_newline && filling_enabled && paragraph_is_open)
+ insert ('\n');
+ close_paragraph ();
#if defined (INDENT_PARAGRAPHS_IN_TABLE)
- /* Indent on a new line, but back up one indentation level. */
- {
- int save = inhibit_paragraph_indentation;
- inhibit_paragraph_indentation = 1;
- /* At this point, inserting any non-whitespace character will
- force the existing indentation to be output. */
- add_char ('i');
- inhibit_paragraph_indentation = save;
- }
+ /* Indent on a new line, but back up one indentation level. */
+ {
+ int t;
+
+ t = inhibit_paragraph_indentation;
+ inhibit_paragraph_indentation = 1;
+ /* At this point, inserting any non-whitespace character will
+ force the existing indentation to be output. */
+ add_char ('i');
+ inhibit_paragraph_indentation = t;
+ }
#else /* !INDENT_PARAGRAPHS_IN_TABLE */
- add_char ('i');
+ add_char ('i');
#endif /* !INDENT_PARAGRAPHS_IN_TABLE */
- output_paragraph_offset--;
- kill_self_indent (default_indentation_increment + 1);
-
- /* Add item's argument to the line. */
- filling_enabled = 0;
- if (item_func && *item_func)
- execute_string ("%s{%s}", item_func, rest_of_line);
- else
- execute_string ("%s", rest_of_line);
-
- if (current_insertion_type () == ftable)
- execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line);
- else if (current_insertion_type () == vtable)
- execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line);
-
- /* Start a new line, and let start_paragraph ()
- do the indenting of it for you. */
- close_single_paragraph ();
- indented_fill = filling_enabled = 1;
- last_item_output_position = output_position;
- }
- }
+ output_paragraph_offset--;
+ kill_self_indent (default_indentation_increment + 1);
+
+ /* Add item's argument to the line. */
+ filling_enabled = 0;
+ if (item_func && *item_func)
+ execute_string ("%s{%s}", item_func, rest_of_line);
+ else
+ execute_string ("%s", rest_of_line);
+
+ if (current_insertion_type () == ftable)
+ execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line);
+
+ if (current_insertion_type () == vtable)
+ execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line);
+
+ /* Start a new line, and let start_paragraph ()
+ do the indenting of it for you. */
+ close_single_paragraph ();
+ indented_fill = filling_enabled = 1;
+ }
+ }
free (rest_of_line);
}
else
{
no_insertion:
- line_error (_("%c%s found outside of an insertion block"),
- COMMAND_PREFIX, command);
+ line_error ("%c%s found outside of an insertion block",
+ COMMAND_PREFIX, command);
}
}
/* **************************************************************** */
-/* */
-/* Defun and Friends */
-/* */
+/* */
+/* Defun and Friends */
+/* */
/* **************************************************************** */
-#define DEFUN_SELF_DELIMITING(c) \
- (((c) == '(') \
- || ((c) == ')') \
- || ((c) == '[') \
+#define DEFUN_SELF_DELIMITING(c) \
+ (((c) == '(') \
+ || ((c) == ')') \
+ || ((c) == '[') \
|| ((c) == ']'))
struct token_accumulator
@@ -6883,7 +6655,7 @@ accumulate_token (accumulator, token)
{
(accumulator->length) += 10;
(accumulator->tokens) = (char **) xrealloc
- (accumulator->tokens, (accumulator->length * sizeof (char *)));
+ (accumulator->tokens, (accumulator->length * sizeof (char *)));
}
accumulator->tokens[accumulator->index] = token;
accumulator->index += 1;
@@ -6903,7 +6675,7 @@ copy_substring (start, end)
while (scan < end)
*scan_result++ = *scan++;
- *scan_result = 0;
+ *scan_result = '\0';
return (result);
}
@@ -6922,25 +6694,25 @@ scan_group_in_string (string_pointer)
while (1)
{
if (level == 0)
- {
- (*string_pointer) = scan_string;
- return (1);
- }
+ {
+ (*string_pointer) = scan_string;
+ return (1);
+ }
c = (*scan_string++);
- if (c == 0)
- {
- /* Tweak line_number to compensate for fact that
- we gobbled the whole line before coming here. */
- line_number -= 1;
- line_error (_("Missing `}' in %cdef arg"), COMMAND_PREFIX);
- line_number += 1;
- (*string_pointer) = (scan_string - 1);
- return (0);
- }
+ if (c == '\0')
+ {
+ /* Tweak line_number to compensate for fact that
+ we gobbled the whole line before coming here. */
+ line_number -= 1;
+ line_error ("Missing `}' in %cdef arg", COMMAND_PREFIX);
+ line_number += 1;
+ (*string_pointer) = (scan_string - 1);
+ return (0);
+ }
if (c == '{')
- level += 1;
+ level += 1;
if (c == '}')
- level -= 1;
+ level -= 1;
}
}
@@ -6958,103 +6730,103 @@ args_from_string (string)
initialize_token_accumulator (&accumulator);
- while ((*scan_string) != 0)
+ while ((*scan_string) != '\0')
{
/* Replace arbitrary whitespace by a single space. */
if (whitespace (*scan_string))
- {
- scan_string += 1;
- while (whitespace (*scan_string))
- scan_string += 1;
- accumulate_token ((&accumulator), (xstrdup (" ")));
- continue;
- }
+ {
+ scan_string += 1;
+ while (whitespace (*scan_string))
+ scan_string += 1;
+ accumulate_token ((&accumulator), (strdup (" ")));
+ continue;
+ }
/* Commands count as single tokens. */
if ((*scan_string) == COMMAND_PREFIX)
- {
- token_start = scan_string;
- scan_string += 1;
- if (self_delimiting (*scan_string))
- scan_string += 1;
- else
- {
- register int c;
- while (1)
- {
- c = *scan_string++;
-
- if ((c == 0) || (c == '{') || (whitespace (c)))
- {
- scan_string -= 1;
- break;
- }
- }
-
- if (*scan_string == '{')
- {
- char *s = scan_string;
- (void) scan_group_in_string (&s);
- scan_string = s;
- }
- }
- token_end = scan_string;
- }
+ {
+ token_start = scan_string;
+ scan_string += 1;
+ if (self_delimiting (*scan_string))
+ scan_string += 1;
+ else
+ {
+ register int c;
+ while (1)
+ {
+ c = *scan_string++;
+
+ if ((c == '\0') || (c == '{') || (whitespace (c)))
+ {
+ scan_string -= 1;
+ break;
+ }
+ }
+
+ if (*scan_string == '{')
+ {
+ char *s = scan_string;
+ (void) scan_group_in_string (&s);
+ scan_string = s;
+ }
+ }
+ token_end = scan_string;
+ }
/* Parentheses and brackets are self-delimiting. */
else if (DEFUN_SELF_DELIMITING (*scan_string))
- {
- token_start = scan_string;
- scan_string += 1;
- token_end = scan_string;
- }
+ {
+ token_start = scan_string;
+ scan_string += 1;
+ token_end = scan_string;
+ }
/* Open brace introduces a group that is a single token. */
else if (*scan_string == '{')
- {
- char *s = scan_string;
- int balanced = scan_group_in_string (&s);
+ {
+ char *s = scan_string;
+ int balanced = scan_group_in_string (&s);
- token_start = scan_string + 1;
- scan_string = s;
- token_end = balanced ? (scan_string - 1) : scan_string;
- }
+ token_start = scan_string + 1;
+ scan_string = s;
+ token_end = balanced ? (scan_string - 1) : scan_string;
+ }
/* Otherwise a token is delimited by whitespace, parentheses,
- brackets, or braces. A token is also ended by a command. */
+ brackets, or braces. A token is also ended by a command. */
else
- {
- token_start = scan_string;
+ {
+ token_start = scan_string;
- while (1)
- {
- register int c;
+ while (1)
+ {
+ register int c;
- c = *scan_string++;
+ c = *scan_string++;
/* Do not back up if we're looking at a }; since the only
valid }'s are those matched with {'s, we want to give
an error. If we back up, we go into an infinite loop. */
- if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c)
- || c == '{')
- {
- scan_string--;
- break;
- }
-
- /* If we encounter a command embedded within a token,
- then end the token. */
- if (c == COMMAND_PREFIX)
- {
- scan_string--;
- break;
- }
- }
- token_end = scan_string;
- }
+ if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c)
+ || c == '{')
+ {
+ scan_string--;
+ break;
+ }
+
+ /* If we encounter a command embedded within a token,
+ then end the token. */
+ if (c == COMMAND_PREFIX)
+ {
+ scan_string--;
+ break;
+ }
+ }
+ token_end = scan_string;
+ }
accumulate_token
- (&accumulator, copy_substring (token_start, token_end));
+ (&accumulator, copy_substring (token_start, token_end));
}
accumulate_token (&accumulator, NULL);
return (accumulator.tokens);
@@ -7072,30 +6844,30 @@ process_defun_args (defun_args, auto_var_p)
char *defun_arg = *defun_args++;
if (defun_arg == NULL)
- break;
+ break;
if (defun_arg[0] == ' ')
- {
- pending_space = 1;
- continue;
- }
+ {
+ pending_space = 1;
+ continue;
+ }
if (pending_space)
- {
- add_char (' ');
- pending_space = 0;
- }
+ {
+ add_char (' ');
+ pending_space = 0;
+ }
if (DEFUN_SELF_DELIMITING (defun_arg[0]))
- add_char (defun_arg[0]);
+ add_char (defun_arg[0]);
else if (defun_arg[0] == '&')
- add_word (defun_arg);
+ add_word (defun_arg);
else if (defun_arg[0] == COMMAND_PREFIX)
- execute_string ("%s", defun_arg);
+ execute_string ("%s", defun_arg);
else if (auto_var_p)
- execute_string ("%cvar{%s}", COMMAND_PREFIX, defun_arg);
+ execute_string ("%cvar{%s}", COMMAND_PREFIX, defun_arg);
else
- add_word (defun_arg);
+ add_word (defun_arg);
}
}
@@ -7119,7 +6891,7 @@ next_nonwhite_defun_arg (arg_pointer)
/* Make the defun type insertion.
TYPE says which insertion this is.
- X_P, if nonzero, says not to start a new insertion. */
+ X_P says not to start a new insertion if non-zero. */
void
defun_internal (type, x_p)
enum insertion_type type;
@@ -7141,43 +6913,43 @@ defun_internal (type, x_p)
switch (type)
{
case defun:
- category = _("Function");
+ category = "Function";
base_type = deffn;
break;
case defmac:
- category = _("Macro");
+ category = "Macro";
base_type = deffn;
break;
case defspec:
- category = _("Special Form");
+ category = "Special Form";
base_type = deffn;
break;
case defvar:
- category = _("Variable");
+ category = "Variable";
base_type = defvr;
break;
case defopt:
- category = _("User Option");
+ category = "User Option";
base_type = defvr;
break;
case deftypefun:
- category = _("Function");
+ category = "Function";
base_type = deftypefn;
break;
case deftypevar:
- category = _("Variable");
+ category = "Variable";
base_type = deftypevr;
break;
case defivar:
- category = _("Instance Variable");
+ category = "Instance Variable";
base_type = defcv;
break;
case defmethod:
- category = _("Method");
+ category = "Method";
base_type = defop;
break;
case deftypemethod:
- category = _("Method");
+ category = "Method";
base_type = deftypemethod;
break;
default:
@@ -7243,7 +7015,7 @@ defun_internal (type, x_p)
break;
case deftypemethod:
execute_string (" -- %s on %s: %s %s", category, type_name, type_name2,
- defined_name);
+ defined_name);
break;
}
current_indent += default_indentation_increment;
@@ -7260,42 +7032,38 @@ defun_internal (type, x_p)
case defop:
process_defun_args (scan_args, 1);
break;
-
- /* Through Makeinfo 1.67 we processed remaining args only for deftp,
- deftypefn, and deftypemethod. But the libc manual, for example,
- needs to say:
- @deftypevar {char *} tzname[2]
- And simply allowing the extra text seems far simpler than trying
- to invent yet more defn commands. In any case, we should either
- output it or give an error, not silently ignore it. */
- default:
+ case deftp:
+ case deftypefn:
+ case deftypemethod:
process_defun_args (scan_args, 0);
break;
}
current_indent -= default_indentation_increment;
close_single_paragraph ();
- /* Make an entry in the appropriate index. */
- switch (base_type)
- {
- case deffn:
- case deftypefn:
- execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defvr:
- case deftypevr:
- case defcv:
- execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defop:
- case deftypemethod:
- execute_string ("%cfindex %s on %s\n",
- COMMAND_PREFIX, defined_name, type_name);
- break;
- case deftp:
- execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- }
+ if (!macro_expansion_output_stream)
+ /* Make an entry in the appropriate index unless we are just
+ expanding macros. */
+ switch (base_type)
+ {
+ case deffn:
+ case deftypefn:
+ execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ case defvr:
+ case deftypevr:
+ case defcv:
+ execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ case defop:
+ case deftypemethod:
+ execute_string ("%cfindex %s on %s\n",
+ COMMAND_PREFIX, defined_name, type_name);
+ break;
+ case deftp:
+ execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ }
/* Deallocate the token list. */
scan_args = defun_args;
@@ -7303,7 +7071,7 @@ defun_internal (type, x_p)
{
char * arg = (*scan_args++);
if (arg == NULL)
- break;
+ break;
free (arg);
}
free (defun_args);
@@ -7317,12 +7085,12 @@ cm_defun ()
{
int x_p;
enum insertion_type type;
- char *temp = xstrdup (command);
+ char *temp = strdup (command);
x_p = (command[strlen (command) - 1] == 'x');
if (x_p)
- temp[strlen (temp) - 1] = 0;
+ temp[strlen (temp) - 1] = '\0';
type = find_type_from_name (temp);
free (temp);
@@ -7332,8 +7100,8 @@ cm_defun ()
if (x_p &&
(!insertion_level || insertion_stack->insertion != type))
{
- line_error (_("Must be in a `%s' insertion in order to use `%s'x"),
- command, command);
+ line_error ("Must be in a `%s' insertion in order to use `%s'x",
+ command, command);
discard_until ("\n");
return;
}
@@ -7341,10 +7109,40 @@ cm_defun ()
defun_internal (type, x_p);
}
+/* End existing insertion block. */
+void
+cm_end ()
+{
+ char *temp;
+ enum insertion_type type;
+
+ if (!insertion_level)
+ {
+ line_error ("Unmatched `%c%s'", COMMAND_PREFIX, command);
+ return;
+ }
+
+ get_rest_of_line (&temp);
+ canon_white (temp);
+
+ if (strlen (temp) == 0)
+ line_error ("`%c%s' needs something after it", COMMAND_PREFIX, command);
+
+ type = find_type_from_name (temp);
+
+ if (type == bad_type)
+ {
+ line_error ("Bad argument to `%s', `%s', using `%s'",
+ command, temp, insertion_type_pname (current_insertion_type ()));
+ }
+ end_insertion (type);
+ free (temp);
+}
+
/* **************************************************************** */
-/* */
-/* Other Random Commands */
-/* */
+/* */
+/* Other Random Commands */
+/* */
/* **************************************************************** */
/* This says to inhibit the indentation of the next paragraph, but
@@ -7404,15 +7202,15 @@ cm_sp ()
if (sscanf (line, "%d", &lines) != 1)
{
- line_error (_("%csp requires a positive numeric argument"), COMMAND_PREFIX);
+ line_error ("%csp requires a positive numeric argument", COMMAND_PREFIX);
}
else
{
if (lines < 0)
- lines = 0;
+ lines = 0;
while (lines--)
- add_char ('\n');
+ add_char ('\n');
}
free (line);
}
@@ -7423,11 +7221,11 @@ cm_sp ()
void
cm_dircategory ()
{
- char *line;
+ char *line, *p;
get_rest_of_line (&line);;
- if (!no_headers)
+ if (! no_headers)
{
insert_string ("INFO-DIR-SECTION ");
insert_string (line);
@@ -7459,7 +7257,7 @@ cm_center ()
i = output_paragraph_offset - 1;
while (i > (start - 1) && output_paragraph[i] == '\n')
- i--;
+ i--;
output_paragraph_offset = ++i;
length = output_paragraph_offset - start;
@@ -7473,10 +7271,10 @@ cm_center ()
output_paragraph_offset = start;
while (i--)
- insert (' ');
+ insert (' ');
for (i = 0; i < length; i++)
- insert (line[i]);
+ insert (line[i]);
free (line);
}
@@ -7559,6 +7357,20 @@ cm_exdent ()
close_single_paragraph ();
}
+#if !defined (HAVE_STRERROR)
+extern char *sys_errlist[];
+extern int sys_nerr;
+
+char *
+strerror (num)
+ int num;
+{
+ if (num >= sys_nerr)
+ return ("Unknown file system error");
+ else
+ return (sys_errlist[num]);
+}
+#endif /* !HAVE_STRERROR */
/* Remember this file, and move onto the next. */
void
@@ -7567,7 +7379,7 @@ cm_include ()
char *filename;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
me_append_before_this_command ();
#endif /* HAVE_MACROS */
@@ -7575,7 +7387,7 @@ cm_include ()
get_rest_of_line (&filename);
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
@@ -7604,8 +7416,8 @@ cm_include ()
line_number--;
/* Cannot "@include foo", in line 5 of "/wh/bar". */
- line_error ("%c%s %s: %s", COMMAND_PREFIX, command, filename,
- strerror (errno));
+ line_error ("`%c%s %s': %s", COMMAND_PREFIX, command, filename,
+ strerror (errno));
free (filename);
return;
@@ -7613,8 +7425,8 @@ cm_include ()
else
{
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
+ if (macro_expansion_output_stream)
+ remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
reader_loop ();
}
@@ -7626,7 +7438,7 @@ cm_include ()
void
misplaced_brace ()
{
- line_error (_("Misplaced %c"), '}');
+ line_error ("Misplaced `}'");
}
/* Signals end of processing. Easy to make this happen. */
@@ -7635,51 +7447,11 @@ cm_bye ()
{
input_text_offset = size_of_input_text;
}
-
-/* Set the paragraph indentation variable to the value specified in STRING.
- Values can be:
- `asis': Don't change existing indentation.
- `none': Remove existing indentation.
- NUM: Indent NUM spaces at the starts of paragraphs.
- If NUM is zero, we assume `none'.
- Returns 0 if successful, or nonzero if STRING isn't one of the above. */
-int
-set_paragraph_indent (string)
- char *string;
-{
- if (strcmp (string, "asis") == 0 || strcmp (string, _("asis")) == 0)
- paragraph_start_indent = 0;
- else if (strcmp (string, "none") == 0 || strcmp (string, _("none")) == 0)
- paragraph_start_indent = -1;
- else
- {
- if (sscanf (string, "%d", &paragraph_start_indent) != 1)
- return (-1);
- else
- {
- if (paragraph_start_indent == 0)
- paragraph_start_indent = -1;
- }
- }
- return (0);
-}
-
-void
-cm_paragraphindent ()
-{
- char *arg;
-
- get_rest_of_line (&arg);
- if (set_paragraph_indent (arg) != 0)
- line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command);
-
- free (arg);
-}
/* **************************************************************** */
-/* */
-/* Indexing Stuff */
-/* */
+/* */
+/* Indexing Stuff */
+/* */
/* **************************************************************** */
@@ -7687,48 +7459,21 @@ cm_paragraphindent ()
typedef struct index_elt
{
struct index_elt *next;
- char *entry; /* The index entry itself. */
- char *node; /* The node from whence it came. */
- int code; /* Nonzero means add `@code{...}' when
- printing this element. */
- int defining_line; /* Line number where this entry was written. */
- char *defining_file; /* Source file for defining_line. */
+ char *entry; /* The index entry itself. */
+ char *node; /* The node from whence it came. */
+ int code; /* Non-zero means add `@code{...}' when
+ printing this element. */
+ int defining_line; /* Line number where this entry was written. */
} INDEX_ELT;
-/* A list of short-names for each index.
-
- There are two indices into the the_indices array.
-
- * read_index is the index that points to the list of index
- entries that we will find if we ask for the list of entries for
- this name.
-
- * write_index is the index that points to the list of index entries
- that we will add new entries to.
-
- Initially, read_index and write index are the same, but the
- @syncodeindex and @synindex commands can change the list we add
- entries to.
-
- For example, after the commands
-
- @cindex foo
- @defindex ii
- @synindex cp ii
- @cindex bar
-
- the cp index will contain the entry `foo', and the new ii
- index will contain the entry `bar'. This is consistent with the
- way texinfo.tex handles the same situation.
-
- In addition, for each index, it is remembered whether that index is
- a code index or not. Code indices have @code{} inserted around the
- first word when they are printed with printindex. */
+/* A list of short-names for each index, and the index to that index in our
+ index array, the_indices. In addition, for each index, it is remembered
+ whether that index is a code index or not. Code indices have @code{}
+ inserted around the first word when they are printed with printindex. */
typedef struct
{
char *name;
- int read_index; /* index entries for `name' */
- int write_index; /* store index entries here, @synindex can change it */
+ int index;
int code;
} INDEX_ALIST;
@@ -7742,6 +7487,14 @@ INDEX_ELT **the_indices = (INDEX_ELT **) NULL;
/* The number of defined indices. */
int defined_indices = 0;
+/* We predefine these. */
+#define program_index 0
+#define function_index 1
+#define concept_index 2
+#define variable_index 3
+#define datatype_index 4
+#define key_index 5
+
void
init_indices ()
{
@@ -7753,38 +7506,26 @@ init_indices ()
if (!the_indices)
{
the_indices = (INDEX_ELT **) xmalloc ((1 + defined_indices) *
- sizeof (INDEX_ELT *));
+ sizeof (INDEX_ELT *));
the_indices[defined_indices] = (INDEX_ELT *) NULL;
name_index_alist = (INDEX_ALIST **) xmalloc ((1 + defined_indices) *
- sizeof (INDEX_ALIST *));
+ sizeof (INDEX_ALIST *));
name_index_alist[defined_indices] = (INDEX_ALIST *) NULL;
}
/* If there were existing indices, get rid of them now. */
for (i = 0; i < defined_indices; i++)
- {
- undefindex (name_index_alist[i]->name);
- if (name_index_alist[i])
- { /* Suppose we're called with two input files, and the first
- does a @synindex pg cp. Then, when we get here to start
- the second file, the "pg" element won't get freed by
- undefindex (because it's pointing to "cp"). So free it
- here; otherwise, when we try to define the pg index again
- just below, it will still point to cp. */
- free (name_index_alist[i]->name);
- free (name_index_alist[i]);
- name_index_alist[i] = (INDEX_ALIST *) NULL;
- }
- }
+ undefindex (name_index_alist[i]->name);
/* Add the default indices. */
- top_defindex ("cp", 0); /* cp is the only non-code index. */
- top_defindex ("fn", 1);
- top_defindex ("ky", 1);
- top_defindex ("pg", 1);
- top_defindex ("tp", 1);
- top_defindex ("vr", 1);
+ top_defindex ("pg", 0);
+ top_defindex ("fn", 1); /* "fn" is a code index. */
+ top_defindex ("cp", 0);
+ top_defindex ("vr", 0);
+ top_defindex ("tp", 0);
+ top_defindex ("ky", 0);
+
}
/* Find which element in the known list of indices has this name.
@@ -7796,8 +7537,8 @@ find_index_offset (name)
register int i;
for (i = 0; i < defined_indices; i++)
if (name_index_alist[i] &&
- strcmp (name, name_index_alist[i]->name) == 0)
- return (i);
+ strcmp (name, name_index_alist[i]->name) == 0)
+ return (name_index_alist[i]->index);
return (-1);
}
@@ -7823,7 +7564,7 @@ translate_index (name)
INDEX_ALIST *which = find_index (name);
if (which)
- return (which->read_index);
+ return (which->index);
else
return (-1);
}
@@ -7850,16 +7591,13 @@ free_index (index)
while ((temp = index) != (INDEX_ELT *) NULL)
{
free (temp->entry);
- /* Do not free the node, because we already freed the tag table,
- which freed all the node names. */
- /* free (temp->node); */
+ free (temp->node);
index = index->next;
free (temp);
}
}
-/* Flush an index by name. This will delete the list of entries that
- would be written by a @printindex command for this index. */
+/* Flush an index by name. */
void
undefindex (name)
char *name;
@@ -7867,12 +7605,10 @@ undefindex (name)
int i;
int which = find_index_offset (name);
- /* The index might have already been freed if this was the target of
- an @synindex. */
- if (which < 0 || !name_index_alist[which])
+ if (which < 0)
return;
- i = name_index_alist[which]->read_index;
+ i = name_index_alist[which]->index;
free_index (the_indices[i]);
the_indices[i] = (INDEX_ELT *) NULL;
@@ -7883,7 +7619,7 @@ undefindex (name)
}
/* Define an index known as NAME. We assign the slot number.
- CODE if Nonzero says to make this a code index. */
+ CODE if non-zero says to make this a code index. */
void
defindex (name, code)
char *name;
@@ -7899,8 +7635,8 @@ defindex (name, code)
for (i = 0; i < defined_indices; i++)
if (!name_index_alist[i])
{
- slot = i;
- break;
+ slot = i;
+ break;
}
if (slot < 0)
@@ -7910,18 +7646,17 @@ defindex (name, code)
defined_indices++;
name_index_alist = (INDEX_ALIST **)
- xrealloc ((char *)name_index_alist,
- (1 + defined_indices) * sizeof (INDEX_ALIST *));
+ xrealloc ((char *)name_index_alist,
+ (1 + defined_indices) * sizeof (INDEX_ALIST *));
the_indices = (INDEX_ELT **)
- xrealloc ((char *)the_indices,
- (1 + defined_indices) * sizeof (INDEX_ELT *));
+ xrealloc ((char *)the_indices,
+ (1 + defined_indices) * sizeof (INDEX_ELT *));
}
/* We have a slot. Start assigning. */
name_index_alist[slot] = (INDEX_ALIST *) xmalloc (sizeof (INDEX_ALIST));
- name_index_alist[slot]->name = xstrdup (name);
- name_index_alist[slot]->read_index = slot;
- name_index_alist[slot]->write_index = slot;
+ name_index_alist[slot]->name = strdup (name);
+ name_index_alist[slot]->index = slot;
name_index_alist[slot]->code = code;
the_indices[slot] = (INDEX_ELT *) NULL;
@@ -7938,10 +7673,10 @@ index_add_arg (name)
tem = find_index (name);
- which = tem ? tem->write_index : -1;
+ which = tem ? tem->index : -1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
@@ -7949,7 +7684,7 @@ index_add_arg (name)
ignore_blank_line ();
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
{
int op_orig;
@@ -7963,7 +7698,7 @@ index_add_arg (name)
if (which < 0)
{
- line_error (_("Unknown index `%s'"), name);
+ line_error ("Unknown index reference `%s'", name);
free (index_entry);
}
else
@@ -7974,7 +7709,6 @@ index_add_arg (name)
new->node = current_node;
new->code = tem->code;
new->defining_line = line_number - 1;
- new->defining_file = input_filename;
the_indices[which] = new;
}
}
@@ -7985,9 +7719,9 @@ index_add_arg (name)
void
gen_index ()
{
- char *name = xstrdup (command);
+ char *name = strdup (command);
if (strlen (name) >= strlen ("index"))
- name[strlen (name) - strlen ("index")] = 0;
+ name[strlen (name) - strlen ("index")] = '\0';
index_add_arg (name);
free (name);
}
@@ -8028,7 +7762,7 @@ gen_defindex (code)
if (find_index (name))
{
- line_error (_("Index `%s' already exists"), name);
+ line_error ("Index `%s' already exists", name);
free (name);
return;
}
@@ -8042,68 +7776,96 @@ gen_defindex (code)
}
}
+/* Append LIST2 to LIST1. Return the head of the list. */
+INDEX_ELT *
+index_append (head, tail)
+ INDEX_ELT *head, *tail;
+{
+ register INDEX_ELT *t_head = head;
+
+ if (!t_head)
+ return (tail);
+
+ while (t_head->next)
+ t_head = t_head->next;
+ t_head->next = tail;
+ return (head);
+}
+
/* Expects 2 args, on the same line. Both are index abbreviations.
Make the first one be a synonym for the second one, i.e. make the
first one have the same index as the second one. */
void
cm_synindex ()
{
- int source, target;
- char *abbrev1, *abbrev2;
+ int redirector, redirectee;
+ char *temp;
skip_whitespace ();
- get_until_in_line (0, " ", &abbrev1);
- target = find_index_offset (abbrev1);
+ get_until_in_line (" ", &temp);
+ redirectee = find_index_offset (temp);
skip_whitespace ();
- get_until_in_line (0, " ", &abbrev2);
- source = find_index_offset (abbrev2);
- if (source < 0 || target < 0)
+ free_and_clear (&temp);
+ get_until_in_line (" ", &temp);
+ redirector = find_index_offset (temp);
+ free (temp);
+ if (redirector < 0 || redirectee < 0)
{
- line_error (_("Unknown index `%s' and/or `%s' in @synindex"),
- abbrev1, abbrev2);
+ line_error ("Unknown index reference");
}
else
{
- name_index_alist[target]->write_index
- = name_index_alist[source]->write_index;
+ /* I think that we should let the user make indices synonymous to
+ each other without any lossage of info. This means that one can
+ say @synindex cp dt anywhere in the file, and things that used to
+ be in cp will go into dt. */
+ INDEX_ELT *i1 = the_indices[redirectee], *i2 = the_indices[redirector];
+
+ if (i1 || i2)
+ {
+ if (i1)
+ the_indices[redirectee] = index_append (i1, i2);
+ else
+ the_indices[redirectee] = index_append (i2, i1);
+ }
+
+ name_index_alist[redirectee]->index =
+ name_index_alist[redirector]->index;
}
-
- free (abbrev1);
- free (abbrev2);
}
void
-cm_pindex () /* Pinhead index. */
+cm_pindex () /* Pinhead index. */
{
index_add_arg ("pg");
}
void
-cm_vindex () /* Variable index. */
+cm_vindex () /* Variable index. */
{
index_add_arg ("vr");
}
void
-cm_kindex () /* Key index. */
+cm_kindex () /* Key index. */
{
index_add_arg ("ky");
}
void
-cm_cindex () /* Concept index. */
+cm_cindex () /* Concept index. */
{
index_add_arg ("cp");
}
void
-cm_findex () /* Function index. */
+cm_findex () /* Function index. */
{
index_add_arg ("fn");
}
void
-cm_tindex () /* Data Type index. */
+cm_tindex () /* Data Type index. */
{
index_add_arg ("tp");
}
@@ -8131,14 +7893,14 @@ make_index_entries_unique (array, count)
for (i = 0, j = 0; i < count; i++)
{
if ((i == (count - 1)) ||
- (array[i]->node != array[i + 1]->node) ||
- (strcmp (array[i]->entry, array[i + 1]->entry) != 0))
- copy[j++] = array[i];
+ (array[i]->node != array[i + 1]->node) ||
+ (strcmp (array[i]->entry, array[i + 1]->entry) != 0))
+ copy[j++] = array[i];
else
- {
- free (array[i]->entry);
- free (array[i]);
- }
+ {
+ free (array[i]->entry);
+ free (array[i]);
+ }
}
copy[j] = (INDEX_ELT *)NULL;
@@ -8151,20 +7913,20 @@ make_index_entries_unique (array, count)
copy[i]->next = copy[i + 1];
/* Fix entry names which are the same. They point to different nodes,
- so we make the entry name unique. */
+ so we make the entry name unique. */
if ((copy[i + 1] != (INDEX_ELT *)NULL) &&
- (strcmp (copy[i]->entry, copy[i + 1]->entry) == 0))
- {
- char *new_entry_name;
-
- new_entry_name = (char *)xmalloc (10 + strlen (copy[i]->entry));
- sprintf (new_entry_name, "%s <%d>", copy[i]->entry, counter);
- free (copy[i]->entry);
- copy[i]->entry = new_entry_name;
- counter++;
- }
+ (strcmp (copy[i]->entry, copy[i + 1]->entry) == 0))
+ {
+ char *new_entry_name;
+
+ new_entry_name = (char *)xmalloc (10 + strlen (copy[i]->entry));
+ sprintf (new_entry_name, "%s <%d>", copy[i]->entry, counter);
+ free (copy[i]->entry);
+ copy[i]->entry = new_entry_name;
+ counter++;
+ }
else
- counter = 1;
+ counter = 1;
array[i] = copy[i];
}
@@ -8182,11 +7944,9 @@ INDEX_ELT **
sort_index (index)
INDEX_ELT *index;
{
- INDEX_ELT **array;
INDEX_ELT *temp = index;
+ INDEX_ELT **array;
int count = 0;
- int save_line_number = line_number;
- char *save_input_filename = input_filename;
while (temp != (INDEX_ELT *) NULL)
{
@@ -8204,20 +7964,16 @@ sort_index (index)
{
array[count++] = temp;
- /* Set line number and input filename to the source line for this
- index entry, as this expansion finds any errors. */
- line_number = array[count - 1]->defining_line;
- input_filename = array[count - 1]->defining_file;
+ /* Maybe should set line number to the defining_line? Any errors
+ have already been given, though, I think. */
/* If this particular entry should be printed as a "code" index,
- then wrap the entry with "@code{...}". */
+ then wrap the entry with "@code{...}". */
array[count - 1]->entry = expansion (temp->entry, index->code);
temp = temp->next;
}
- array[count] = (INDEX_ELT *) NULL; /* terminate the array. */
- line_number = save_line_number;
- input_filename = save_input_filename;
+ array[count] = (INDEX_ELT *) NULL; /* terminate the array. */
/* Sort the array. */
qsort (array, count, sizeof (INDEX_ELT *), index_element_compare);
@@ -8225,7 +7981,7 @@ sort_index (index)
return (array);
}
-/* Nonzero means that we are in the middle of printing an index. */
+/* Non-zero means that we are in the middle of printing an index. */
int printing_index = 0;
/* Takes one arg, a short name of an index to print.
@@ -8248,7 +8004,7 @@ cm_printindex ()
index = index_list (index_name);
if (index == (INDEX_ELT *)-1)
{
- line_error (_("Unknown index `%s' in @printindex"), index_name);
+ line_error ("Unknown index name `%s'", index_name);
free (index_name);
return;
}
@@ -8263,7 +8019,7 @@ cm_printindex ()
array = sort_index (index);
close_paragraph ();
- add_word (_("* Menu:\n\n"));
+ add_word ("* Menu:\n\n");
#if defined (HAVE_MACROS)
me_inhibit_expansion++;
@@ -8278,15 +8034,11 @@ cm_printindex ()
/* A pathological document might have an index entry outside of any
node. Don't crash. Perhaps should warn. */
char *index_node = index->node ? index->node : "(none)";
- unsigned new_length = strlen (index->entry);
-
- if (new_length < 37) /* minimum length used below */
- new_length = 37;
- new_length += strlen (index_node) + 7; /* * : .\n\0 */
+ unsigned new_length = strlen (index->entry) + strlen (index_node);
if (new_length > line_length)
{
- line_length = new_length;
+ line_length = new_length + 6; /* * : .\0 */
line = xrealloc (line, line_length);
}
@@ -8314,8 +8066,8 @@ cm_printindex ()
filling_enabled = saved_filling_enabled;
inhibit_paragraph_indentation = saved_inhibit_paragraph_indentation;
}
-
-/* User-defined commands, which happens only from user-defined indexes. */
+
+/* User-defined commands. */
void
define_user_command (name, proc, needs_braces_p)
@@ -8330,27 +8082,68 @@ define_user_command (name, proc, needs_braces_p)
user_command_array = (COMMAND **) xmalloc (1 * sizeof (COMMAND *));
user_command_array = (COMMAND **) xrealloc (user_command_array,
- (1 + user_command_array_len) *
- sizeof (COMMAND *));
+ (1 + user_command_array_len) *
+ sizeof (COMMAND *));
user_command_array[slot] = (COMMAND *) xmalloc (sizeof (COMMAND));
- user_command_array[slot]->name = xstrdup (name);
+ user_command_array[slot]->name = strdup (name);
user_command_array[slot]->proc = proc;
user_command_array[slot]->argument_in_braces = needs_braces_p;
}
-
+
+/* Set the paragraph indentation variable to the value specified in STRING.
+ Values can be:
+ `asis': Don't change existing indentation.
+ `none': Remove existing indentation.
+ NUM: Indent NUM spaces at the starts of paragraphs.
+ Note that if NUM is zero, we assume `none'.
+
+ Returns 0 if successful, or non-zero if STRING isn't one of the above. */
+int
+set_paragraph_indent (string)
+ char *string;
+{
+ if (strcmp (string, "asis") == 0)
+ paragraph_start_indent = 0;
+ else if (strcmp (string, "none") == 0)
+ paragraph_start_indent = -1;
+ else
+ {
+ if (sscanf (string, "%d", &paragraph_start_indent) != 1)
+ return (-1);
+ else
+ {
+ if (paragraph_start_indent == 0)
+ paragraph_start_indent = -1;
+ }
+ }
+ return (0);
+}
+
+void
+cm_paragraphindent ()
+{
+ char *arg;
+
+ get_rest_of_line (&arg);
+ if (set_paragraph_indent (arg) != 0)
+ line_error ("Bad argument to %c%s", COMMAND_PREFIX, command);
+
+ free (arg);
+}
+
/* Some support for footnotes. */
/* Footnotes are a new construct in Info. We don't know the best method
of implementing them for sure, so we present two possiblities.
SeparateNode:
- Make them look like followed references, with the reference
- destinations in a makeinfo manufactured node or,
+ Make them look like followed references, with the reference
+ destinations in a makeinfo manufactured node or,
EndNode:
- Make them appear at the bottom of the node that they originally
- appeared in. */
+ Make them appear at the bottom of the node that they originally
+ appeared in. */
#define SeparateNode 0
#define EndNode 1
@@ -8367,7 +8160,7 @@ set_footnote_style (string)
(strcasecmp (string, "MN") == 0))
footnote_style = SeparateNode;
else if ((strcasecmp (string, "end") == 0) ||
- (strcasecmp (string, "EN") == 0))
+ (strcasecmp (string, "EN") == 0))
footnote_style = EndNode;
else
return (-1);
@@ -8406,8 +8199,8 @@ remember_note (marker, note)
{
FN *temp = (FN *) xmalloc (sizeof (FN));
- temp->marker = xstrdup (marker);
- temp->note = xstrdup (note);
+ temp->marker = strdup (marker);
+ temp->note = strdup (note);
temp->next = pending_notes;
pending_notes = temp;
footnote_count++;
@@ -8434,7 +8227,7 @@ free_pending_notes ()
/* Handle a "footnote".
footnote *{this is a footnote}
- where "*" is the (optional) marker character for this note. */
+ where "*" is the marker character for this note. */
void
cm_footnote ()
{
@@ -8444,67 +8237,48 @@ cm_footnote ()
get_until ("{", &marker);
canon_white (marker);
- if (macro_expansion_output_stream && !executing_string)
- append_to_expansion_output (input_text_offset + 1); /* include the { */
-
/* Read the argument in braces. */
if (curchar () != '{')
{
- line_error (_("`%c%s' needs an argument `{...}', not just `%s'"),
- COMMAND_PREFIX, command, marker);
+ line_error ("`%c%s' expected more than just `%s'. It needs something in `{...}'",
+ COMMAND_PREFIX, command, marker);
free (marker);
return;
}
else
{
- int len;
int braces = 1;
- int loc = ++input_text_offset;
+ int temp = ++input_text_offset;
+ int len;
while (braces)
- {
- if (loc == size_of_input_text)
- {
- line_error (_("No closing brace for footnote `%s'"), marker);
- return;
- }
-
- if (input_text[loc] == '{')
- braces++;
- else if (input_text[loc] == '}')
- braces--;
- else if (input_text[loc] == '\n')
- line_number++;
-
- loc++;
- }
-
- len = (loc - input_text_offset) - 1;
+ {
+ if (temp == size_of_input_text)
+ {
+ line_error ("No closing brace for footnote `%s'", marker);
+ return;
+ }
+
+ if (input_text[temp] == '{')
+ braces++;
+ else if (input_text[temp] == '}')
+ braces--;
+ else if (input_text[temp] == '\n')
+ line_number ++;
+
+ temp++;
+ }
+
+ len = (temp - input_text_offset) - 1;
note = (char *)xmalloc (len + 1);
strncpy (note, &input_text[input_text_offset], len);
- note[len] = 0;
- input_text_offset = loc;
- }
-
- /* Must write the macro-expanded argument to the macro expansion
- output stream. This is like the case in index_add_arg. */
- if (macro_expansion_output_stream && !executing_string)
- {
- int op_orig;
-
- remember_itext (input_text, input_text_offset);
- op_orig = output_paragraph_offset;
- me_execute_string (note);
- /* Calling me_execute_string on a lone } provokes an error, since
- as far as the reader knows there is no matching {. We wrote
- the { above in the call to append_to_expansion_output. */
- write_region_to_macro_output ("}", 0, 1);
- output_paragraph_offset = op_orig;
+ note[len] = '\0';
+ input_text_offset = temp;
}
if (!current_node || !*current_node)
{
- line_error (_("Footnote defined without parent node"));
+ line_error ("Footnote defined without parent node");
free (marker);
free (note);
return;
@@ -8515,13 +8289,13 @@ cm_footnote ()
free (marker);
if (number_footnotes)
- {
- marker = (char *)xmalloc (10);
- sprintf (marker, "%d", current_footnote_number);
- current_footnote_number++;
- }
+ {
+ marker = (char *)xmalloc (10);
+ sprintf (marker, "%d", current_footnote_number);
+ current_footnote_number++;
+ }
else
- marker = xstrdup ("*");
+ marker = strdup ("*");
}
remember_note (marker, note);
@@ -8532,19 +8306,19 @@ cm_footnote ()
case SeparateNode:
add_word_args ("(%s)", marker);
if (first_footnote_this_node)
- {
- char *temp_string;
-
- temp_string = (char *)
- xmalloc ((strlen (current_node)) + (strlen (_("-Footnotes"))) + 1);
-
- add_word_args (" (*note %s-Footnotes::)", current_node);
- strcpy (temp_string, current_node);
- strcat (temp_string, "-Footnotes");
- remember_node_reference (temp_string, line_number, followed_reference);
- free (temp_string);
- first_footnote_this_node = 0;
- }
+ {
+ char *temp_string;
+
+ temp_string = (char *)
+ xmalloc ((strlen (current_node)) + (strlen ("-Footnotes")) + 1);
+
+ add_word_args (" (*note %s-Footnotes::)", current_node);
+ strcpy (temp_string, current_node);
+ strcat (temp_string, "-Footnotes");
+ remember_node_reference (temp_string, line_number, followed_reference);
+ free (temp_string);
+ first_footnote_this_node = 0;
+ }
break;
case EndNode:
@@ -8558,7 +8332,7 @@ cm_footnote ()
free (note);
}
-/* Nonzero means that we are currently in the process of outputting
+/* Non-zero means that we are currently in the process of outputting
footnotes. */
int already_outputting_pending_notes = 0;
@@ -8575,23 +8349,23 @@ output_pending_notes ()
{
case SeparateNode:
{
- char *old_current_node = current_node;
- char *old_command = xstrdup (command);
-
- already_outputting_pending_notes++;
- execute_string ("%cnode %s-Footnotes,,,%s\n",
- COMMAND_PREFIX, current_node, current_node);
- already_outputting_pending_notes--;
- current_node = old_current_node;
- free (command);
- command = old_command;
+ char *old_current_node = current_node;
+ char *old_command = strdup (command);
+
+ already_outputting_pending_notes++;
+ execute_string ("%cnode %s-Footnotes,,,%s\n",
+ COMMAND_PREFIX, current_node, current_node);
+ already_outputting_pending_notes--;
+ current_node = old_current_node;
+ free (command);
+ command = old_command;
}
break;
case EndNode:
close_paragraph ();
in_fixed_width_font++;
- execute_string (_("---------- Footnotes ----------\n\n"));
+ execute_string ("---------- Footnotes ----------\n\n");
in_fixed_width_font--;
break;
}
@@ -8604,17 +8378,24 @@ output_pending_notes ()
while (--footnote_count > -1)
{
- array[footnote_count] = footnote;
- footnote = footnote->next;
+ array[footnote_count] = footnote;
+ footnote = footnote->next;
}
filling_enabled = 1;
indented_fill = 1;
- while ((footnote = array[++footnote_count]))
+ while (footnote = array[++footnote_count])
{
- execute_string ("(%s) %s", footnote->marker, footnote->note);
- close_paragraph ();
+
+ switch (footnote_style)
+ {
+ case SeparateNode:
+ case EndNode:
+ execute_string ("(%s) %s", footnote->marker, footnote->note);
+ close_paragraph ();
+ break;
+ }
}
close_paragraph ();
free (array);
@@ -8623,7 +8404,7 @@ output_pending_notes ()
/* **************************************************************** */
/* */
-/* User definable Macros (text substitution) */
+/* User definable Macros (text substitution) */
/* */
/* **************************************************************** */
@@ -8632,8 +8413,8 @@ output_pending_notes ()
/* Array of macros and definitions. */
MACRO_DEF **macro_list = (MACRO_DEF **)NULL;
-int macro_list_len = 0; /* Number of elements. */
-int macro_list_size = 0; /* Number of slots in total. */
+int macro_list_len = 0; /* Number of elements. */
+int macro_list_size = 0; /* Number of slots in total. */
/* Return the macro definition of NAME or NULL if NAME is not defined. */
MACRO_DEF *
@@ -8647,7 +8428,7 @@ find_macro (name)
for (i = 0; macro_list && (def = macro_list[i]); i++)
{
if ((!def->inhibited) && (strcmp (def->name, name) == 0))
- break;
+ break;
}
return (def);
}
@@ -8672,8 +8453,8 @@ add_macro (name, arglist, body, source_file, source_lineno, flags)
if (!def)
{
if (macro_list_len + 2 >= macro_list_size)
- macro_list = (MACRO_DEF **)xrealloc
- (macro_list, ((macro_list_size += 10) * sizeof (MACRO_DEF *)));
+ macro_list = (MACRO_DEF **)xrealloc
+ (macro_list, ((macro_list_size += 10) * sizeof (MACRO_DEF *)));
macro_list[macro_list_len] = (MACRO_DEF *)xmalloc (sizeof (MACRO_DEF));
macro_list[macro_list_len + 1] = (MACRO_DEF *)NULL;
@@ -8687,29 +8468,30 @@ add_macro (name, arglist, body, source_file, source_lineno, flags)
char *temp_filename = input_filename;
int temp_line = line_number;
- warning (_("macro `%s' previously defined"), name);
+ warning ("The macro `%s' is previously defined", name);
input_filename = def->source_file;
line_number = def->source_lineno;
- warning (_("here is the previous definition of `%s'"), name);
+
+ warning ("Here is the previous definition of `%s'", name);
input_filename = temp_filename;
line_number = temp_line;
if (def->arglist)
- {
- register int i;
+ {
+ register int i;
- for (i = 0; def->arglist[i]; i++)
- free (def->arglist[i]);
+ for (i = 0; def->arglist[i]; i++)
+ free (def->arglist[i]);
- free (def->arglist);
- }
+ free (def->arglist);
+ }
free (def->source_file);
free (def->body);
}
- def->source_file = xstrdup (source_file);
+ def->source_file = strdup (source_file);
def->source_lineno = source_lineno;
def->body = body;
def->arglist = arglist;
@@ -8732,10 +8514,9 @@ delete_macro (name)
for (i = 0; macro_list && (def = macro_list[i]); i++)
if (strcmp (def->name, name) == 0)
{
- memmove (macro_list + i, macro_list + i + 1,
- ((macro_list_len + 1) - i) * sizeof (MACRO_DEF *));
- macro_list_len--;
- break;
+ memmove (macro_list + i, macro_list + i + 1,
+ ((macro_list_len + 1) - i) * sizeof (MACRO_DEF *));
+ break;
}
return (def);
}
@@ -8746,7 +8527,7 @@ int braces_required_for_macro_args = 0;
char **
get_macro_args (def)
- MACRO_DEF *def;
+ MACRO_DEF *def;
{
register int i;
char *word;
@@ -8760,38 +8541,35 @@ get_macro_args (def)
if (input_text[i] != '{')
{
if (braces_required_for_macro_args)
- {
- return ((char **)NULL);
- }
+ {
+ return ((char **)NULL);
+ }
else
- {
- /* Braces are not required to fill out the macro arguments. If
- this macro takes one argument, it is considered to be the
- remainder of the line, sans whitespace. */
- if (def->arglist && def->arglist[0] && !def->arglist[1])
- {
- char **arglist;
-
- get_rest_of_line (&word);
- if (input_text[input_text_offset - 1] == '\n')
- {
- input_text_offset--;
- line_number--;
- }
- /* canon_white (word); */
- arglist = (char **)xmalloc (2 * sizeof (char *));
- arglist[0] = word;
- arglist[1] = (char *)NULL;
- return (arglist);
- }
- else
- {
- /* The macro either took no arguments, or took more than
- one argument. In that case, it must be invoked with
- arguments surrounded by braces. */
- return ((char **)NULL);
- }
- }
+ {
+ /* Braces are not required to fill out the macro arguments. If
+ this macro takes one argument, it is considered to be the
+ remainder of the line, sans whitespace. */
+ if (def->arglist && def->arglist[0] && !def->arglist[1])
+ {
+ char **arglist;
+
+ get_rest_of_line (&word);
+ if (input_text[input_text_offset - 1] == '\n')
+ input_text_offset--;
+ /* canon_white (word); */
+ arglist = (char **)xmalloc (2 * sizeof (char *));
+ arglist[0] = word;
+ arglist[1] = (char *)NULL;
+ return (arglist);
+ }
+ else
+ {
+ /* The macro either took no arguments, or took more than
+ one argument. In that case, it must be invoked with
+ arguments surrounded by braces. */
+ return ((char **)NULL);
+ }
+ }
}
return (get_brace_args (def->flags & ME_QUOTE_ARG));
}
@@ -8818,69 +8596,66 @@ apply (named, actuals, body)
while (1)
{
if (!body[i])
- break;
+ break;
if (body[i] != '\\')
- new_body[new_body_index++] = body[i++];
+ new_body[new_body_index++] = body[i++];
else
- {
- /* Snarf parameter name, check against named parameters. */
- char *param;
- int param_start, which, len;
-
- param_start = ++i;
- while ((body[i]) && (body[i] != '\\'))
- i++;
-
- len = i - param_start;
- param = (char *)xmalloc (1 + len);
- memcpy (param, body + param_start, len);
- param[len] = 0;
-
- if (body[i]) /* move past \ */
- i++;
-
- /* Now check against named parameters. */
- for (which = 0; named && named[which]; which++)
- if (strcmp (named[which], param) == 0)
- break;
-
- if (named && named[which])
- {
- if (which < length_of_actuals)
- text = actuals[which];
- else
- text = (char *)NULL;
-
- if (!text)
- text = "";
-
- len = strlen (text);
- }
- else
- { /* not a parameter, restore \'s */
- i = body[i] ? (i - 1) : i;
- len++;
- text = xmalloc (1 + len);
- sprintf (text, "\\%s", param);
- }
-
- if ((2 + strlen (param)) < len)
- {
- new_body_size += len + 1;
- new_body = xrealloc (new_body, new_body_size);
- }
-
- free (param);
-
- strcpy (new_body + new_body_index, text);
- new_body_index += len;
-
- if (!named || !named[which])
- free (text);
- }
- }
- new_body[new_body_index] = 0;
+ {
+ /* Snarf parameter name, check against named parameters. */
+ char *param;
+ int param_start, which, len;
+
+ param_start = ++i;
+ while ((body[i]) && (body[i] != '\\'))
+ i++;
+
+ len = i - param_start;
+ param = (char *)xmalloc (1 + len);
+ memcpy (param, body + param_start, len);
+ param[len] = '\0';
+
+ if (body[i])
+ i++;
+
+ /* Now check against named parameters. */
+ for (which = 0; named && named[which]; which++)
+ if (strcmp (named[which], param) == 0)
+ break;
+
+ if (named[which])
+ {
+ if (which < length_of_actuals)
+ text = actuals[which];
+ else
+ text = (char *)NULL;
+
+ if (!text)
+ text = "";
+
+ len = strlen (text);
+ }
+ else
+ {
+ len += 2;
+ text = (char *)xmalloc (1 + len);
+ sprintf (text, "\\%s\\", param);
+ }
+
+ if ((2 + strlen (param)) < len)
+ new_body = (char *)xrealloc
+ (new_body, new_body_size += (1 + len));
+
+ free (param);
+
+ strcpy (new_body + new_body_index, text);
+ new_body_index += len;
+
+ if (!named[which])
+ free (text);
+ }
+ }
+ new_body[new_body_index] = '\0';
return (new_body);
}
@@ -8889,11 +8664,12 @@ void
execute_macro (def)
MACRO_DEF *def;
{
+ register int i;
char **arglist;
int num_args;
char *execution_string = (char *)NULL;
- if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
+ if (macro_expansion_output_stream && !me_inhibit_expansion)
me_append_before_this_command ();
/* Find out how many arguments this macro definition takes. */
@@ -8905,7 +8681,7 @@ execute_macro (def)
if (num_args < array_len (arglist))
{
free_array (arglist);
- line_error (_("Macro `%s' called with too many args"), def->name);
+ line_error ("Macro `%s' called with too many args", def->name);
return;
}
@@ -8916,13 +8692,13 @@ execute_macro (def)
if (def->body)
{
- if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
- {
- remember_itext (input_text, input_text_offset);
- me_execute_string (execution_string);
- }
+ if (macro_expansion_output_stream && !me_inhibit_expansion)
+ {
+ remember_itext (input_text, input_text_offset);
+ me_execute_string (execution_string);
+ }
else
- execute_string ("%s", execution_string);
+ execute_string ("%s", execution_string);
free (execution_string);
}
@@ -8944,7 +8720,7 @@ cm_macro ()
body_size = 0;
body_index = 0;
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
me_append_before_this_command ();
skip_whitespace ();
@@ -8956,15 +8732,15 @@ cm_macro ()
int len;
for (i = start;
- (i < size_of_input_text) &&
- (input_text[i] != '{') &&
- (!cr_or_whitespace (input_text[i]));
- i++);
+ (i < size_of_input_text) &&
+ (input_text[i] != '{') &&
+ (!cr_or_whitespace (input_text[i]));
+ i++);
len = i - start;
name = (char *)xmalloc (1 + len);
strncpy (name, input_text + start, len);
- name[len] = 0;
+ name[len] = '\0';
input_text_offset = i;
}
@@ -8980,71 +8756,71 @@ cm_macro ()
int character;
/* Read the words inside of the braces which determine the arglist.
- These words will be replaced within the body of the macro at
- execution time. */
+ These words will be replaced within the body of the macro at
+ execution time. */
input_text_offset++;
skip_whitespace_and_newlines ();
while (gathering_words)
- {
- int len;
-
- for (i = input_text_offset;
- (character = input_text[i]);
- i++)
- {
- switch (character)
- {
- case '\n':
- line_number++;
- case ' ':
- case '\t':
- case ',':
- case '}':
- /* Found the end of the current arglist word. Save it. */
- len = i - input_text_offset;
- word = (char *)xmalloc (1 + len);
- strncpy (word, input_text + input_text_offset, len);
- word[len] = 0;
- input_text_offset = i;
-
- /* Advance to the comma or close-brace that signified
- the end of the argument. */
- while ((character = curchar ())
- && character != ','
- && character != '}')
- {
- input_text_offset++;
- if (character == '\n')
- line_number++;
- }
-
- /* Add the word to our list of words. */
- if ((arglist_index + 2) >= arglist_size)
- arglist = (char **)xrealloc
- (arglist, (arglist_size += 10) * sizeof (char *));
-
- arglist[arglist_index++] = word;
- arglist[arglist_index] = (char *)NULL;
- break;
- }
-
- if (character == '}')
- {
- input_text_offset++;
- gathering_words = 0;
- break;
- }
-
- if (character == ',')
- {
- input_text_offset++;
- skip_whitespace_and_newlines ();
- i = input_text_offset - 1;
- }
- }
- }
+ {
+ int len;
+
+ for (i = input_text_offset;
+ character = input_text[i];
+ i++)
+ {
+ switch (character)
+ {
+ case '\n':
+ line_number++;
+ case ' ':
+ case '\t':
+ case ',':
+ case '}':
+ /* Found the end of the current arglist word. Save it. */
+ len = i - input_text_offset;
+ word = (char *)xmalloc (1 + len);
+ strncpy (word, input_text + input_text_offset, len);
+ word[len] = '\0';
+ input_text_offset = i;
+
+ /* Advance to the comma or close-brace that signified
+ the end of the argument. */
+ while ((character = curchar ())
+ && character != ','
+ && character != '}')
+ {
+ input_text_offset++;
+ if (character == '\n')
+ line_number++;
+ }
+
+ /* Add the word to our list of words. */
+ if ((arglist_index + 2) >= arglist_size)
+ arglist = (char **)xrealloc
+ (arglist, (arglist_size += 10) * sizeof (char *));
+
+ arglist[arglist_index++] = word;
+ arglist[arglist_index] = (char *)NULL;
+ break;
+ }
+
+ if (character == '}')
+ {
+ input_text_offset++;
+ gathering_words = 0;
+ break;
+ }
+
+ if (character == ',')
+ {
+ input_text_offset++;
+ skip_whitespace_and_newlines ();
+ i = input_text_offset - 1;
+ }
+ }
+ }
}
/* Read the text carefully until we find an "@end macro" which
@@ -9054,94 +8830,84 @@ cm_macro ()
while (depth)
{
if ((input_text_offset + 9) > size_of_input_text)
- {
- int temp_line = line_number;
- line_number = defining_line;
- line_error (_("%cend macro not found"), COMMAND_PREFIX);
- line_number = temp_line;
- return;
- }
+ {
+ int temp_line = line_number;
+ line_number = defining_line;
+ line_error ("%cend macro not found", COMMAND_PREFIX);
+ line_number = temp_line;
+ return;
+ }
get_rest_of_line (&line);
/* Handle commands only meaningful within a macro. */
if ((*line == COMMAND_PREFIX) && (depth == 1) &&
- (strncmp (line + 1, "allow-recursion", 15) == 0) &&
- (line[16] == 0 || whitespace (line[16])))
- {
- for (i = 16; whitespace (line[i]); i++);
- strcpy (line, line + i);
- flags |= ME_RECURSE;
- if (!*line)
- {
- free (line);
- continue;
- }
- }
+ (strncmp (line + 1, "allow-recursion", 15) == 0) &&
+ (line[16] == '\0' || whitespace (line[16])))
+ {
+ for (i = 16; whitespace (line[i]); i++);
+ strcpy (line, line + i);
+ flags |= ME_RECURSE;
+ if (!*line)
+ {
+ free (line);
+ continue;
+ }
+ }
if ((*line == COMMAND_PREFIX) && (depth == 1) &&
- (strncmp (line + 1, "quote-arg", 9) == 0) &&
- (line[10] == 0 || whitespace (line[10])))
- {
- for (i = 10; whitespace (line[i]); i++);
- strcpy (line, line + i);
-
- if (arglist && arglist[0] && !arglist[1])
- {
- flags |= ME_QUOTE_ARG;
- if (!*line)
- {
- free (line);
- continue;
- }
- }
- else
- {
- line_error (_("%cquote-arg only useful when the macro takes a single argument"),
- COMMAND_PREFIX);
- }
- }
+ (strncmp (line + 1, "quote-arg", 9) == 0) &&
+ (line[10] == '\0' || whitespace (line[10])))
+ {
+ for (i = 10; whitespace (line[i]); i++);
+ strcpy (line, line + i);
+
+ if (arglist && arglist[0] && !arglist[1])
+ {
+ flags |= ME_QUOTE_ARG;
+ if (!*line)
+ {
+ free (line);
+ continue;
+ }
+ }
+ else
+ {
+ line_error ("%cquote-arg only useful when the macro takes a single argument",
+ COMMAND_PREFIX);
+ }
+ }
if ((*line == COMMAND_PREFIX) &&
- (strncmp (line + 1, "macro ", 6) == 0))
- depth++;
+ (strncmp (line + 1, "macro ", 6) == 0))
+ depth++;
if ((*line == COMMAND_PREFIX) &&
- (strncmp (line + 1, "end macro", 9) == 0))
- depth--;
+ (strncmp (line + 1, "end macro", 9) == 0))
+ depth--;
if (depth)
- {
- if ((body_index + strlen (line) + 3) >= body_size)
- body = (char *)xrealloc
- (body, body_size += 3 + strlen (line));
- strcpy (body + body_index, line);
- body_index += strlen (line);
- body[body_index++] = '\n';
- body[body_index] = 0;
- }
+ {
+ if ((body_index + strlen (line) + 3) >= body_size)
+ body = (char *)xrealloc
+ (body, body_size += 3 + strlen (line));
+ strcpy (body + body_index, line);
+ body_index += strlen (line);
+ body[body_index++] = '\n';
+ body[body_index] = '\0';
+ }
free (line);
}
- /* If it was an empty macro like
- @macro foo
- @end macro
- create an empty body. (Otherwise, the macro is not expanded.) */
- if (!body)
- {
- body = (char *)malloc(1);
- *body = 0;
- }
-
/* We now have the name, the arglist, and the body. However, BODY
includes the final newline which preceded the `@end macro' text.
Delete it. */
if (body && strlen (body))
- body[strlen (body) - 1] = 0;
+ body[strlen (body) - 1] = '\0';
add_macro (name, arglist, body, input_filename, defining_line, flags);
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
remember_itext (input_text, input_text_offset);
}
@@ -9152,15 +8918,16 @@ cm_unmacro ()
char *line, *name;
MACRO_DEF *def;
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
me_append_before_this_command ();
get_rest_of_line (&line);
+ canon_white (line);
for (i = 0; line[i] && !whitespace (line[i]); i++);
- name = (char *)xmalloc (i + 1);
+ name = (char *)xmalloc (i);
strncpy (name, line, i);
- name[i] = 0;
+ name[i] = '\0';
def = delete_macro (name);
@@ -9171,14 +8938,14 @@ cm_unmacro ()
free (def->body);
if (def->arglist)
- {
- register int i;
+ {
+ register int i;
- for (i = 0; def->arglist[i]; i++)
- free (def->arglist[i]);
+ for (i = 0; def->arglist[i]; i++)
+ free (def->arglist[i]);
- free (def->arglist);
- }
+ free (def->arglist);
+ }
free (def);
}
@@ -9186,7 +8953,7 @@ cm_unmacro ()
free (line);
free (name);
- if (macro_expansion_output_stream && !executing_string)
+ if (macro_expansion_output_stream)
remember_itext (input_text, input_text_offset);
}
@@ -9206,38 +8973,38 @@ remember_itext (pointer, offset)
{
itext_info = (ITEXT **)xmalloc ((itext_size = 10) * sizeof (ITEXT *));
for (i = 0; i < itext_size; i++)
- itext_info[i] = (ITEXT *)NULL;
+ itext_info[i] = (ITEXT *)NULL;
}
/* If the pointer is already present in the list, then set the offset. */
for (i = 0; i < itext_size; i++)
if ((itext_info[i] != (ITEXT *)NULL) &&
- (itext_info[i]->pointer == pointer))
+ (itext_info[i]->pointer == pointer))
{
- itext = itext_info[i];
- itext_info[i]->offset = offset;
- break;
+ itext = itext_info[i];
+ itext_info[i]->offset = offset;
+ break;
}
if (i == itext_size)
{
- /* Find a blank slot (or create a new one), and remember the
- pointer and offset. */
+ /* Find a blank slot, (or create a new one), and remember the
+ pointer and offset. */
for (i = 0; i < itext_size; i++)
- if (itext_info[i] == (ITEXT *)NULL)
- break;
+ if (itext_info[i] == (ITEXT *)NULL)
+ break;
/* If not found, then add some slots. */
if (i == itext_size)
- {
- register int j;
+ {
+ register int j;
- itext_info = (ITEXT **)xrealloc
- (itext_info, (itext_size += 10) * sizeof (ITEXT *));
+ itext_info = (ITEXT **)xrealloc
+ (itext_info, (itext_size += 10) * sizeof (ITEXT *));
- for (j = i; j < itext_size; j++)
- itext_info[j] = (ITEXT *)NULL;
- }
+ for (j = i; j < itext_size; j++)
+ itext_info[j] = (ITEXT *)NULL;
+ }
/* Now add the pointer and the offset. */
itext_info[i] = (ITEXT *)xmalloc (sizeof (ITEXT));
@@ -9258,9 +9025,9 @@ forget_itext (pointer)
for (i = 0; i < itext_size; i++)
if (itext_info[i] && (itext_info[i]->pointer == pointer))
{
- free (itext_info[i]);
- itext_info[i] = (ITEXT *)NULL;
- break;
+ free (itext_info[i]);
+ itext_info[i] = (ITEXT *)NULL;
+ break;
}
}
@@ -9284,15 +9051,15 @@ me_execute_string (execution_string)
pushfile ();
input_text_offset = 0;
input_text = execution_string;
- input_filename = xstrdup (input_filename);
+ input_filename = strdup (input_filename);
size_of_input_text = strlen (execution_string);
remember_itext (execution_string, 0);
- me_executing_string++;
+ executing_string++;
reader_loop ();
popfile ();
- me_executing_string--;
+ executing_string--;
}
/* Append the text which appears in input_text from the last offset to
@@ -9307,17 +9074,17 @@ append_to_expansion_output (offset)
for (i = 0; i < itext_size; i++)
if (itext_info[i] && itext_info[i]->pointer == input_text)
{
- itext = itext_info[i];
- break;
+ itext = itext_info[i];
+ break;
}
if (!itext)
- return;
+ itext = remember_itext (input_text, 0);
if (offset > itext->offset)
{
write_region_to_macro_output
- (input_text, itext->offset, offset);
+ (input_text, itext->offset, offset);
remember_itext (input_text, offset);
}
}
@@ -9334,8 +9101,8 @@ maybe_write_itext (pointer, offset)
for (i = 0; i < itext_size; i++)
if (itext_info[i] && (itext_info[i]->pointer == pointer))
{
- itext = itext_info[i];
- break;
+ itext = itext_info[i];
+ break;
}
if (itext && (itext->offset < offset))
@@ -9378,7 +9145,7 @@ free_array (array)
register int i;
for (i = 0; array[i] != (char *)NULL; i++)
- free (array[i]);
+ free (array[i]);
free (array);
}
@@ -9407,64 +9174,64 @@ get_brace_args (quote_single)
start = input_text_offset;
escape_seen = 0;
- while ((character = curchar ()))
+ while (character = curchar ())
{
if (character == '\\')
- {
- input_text_offset += 2;
- escape_seen = 1;
- }
+ {
+ input_text_offset += 2;
+ escape_seen = 1;
+ }
else if (character == '{')
- {
- depth++;
- input_text_offset++;
- }
+ {
+ depth++;
+ input_text_offset++;
+ }
else if ((character == ',' && !quote_single) ||
- ((character == '}') && depth == 1))
- {
- int len = input_text_offset - start;
-
- if (len || (character != '}'))
- {
- word = (char *)xmalloc (1 + len);
- strncpy (word, input_text + start, len);
- word[len] = 0;
-
- /* Clean up escaped characters. */
- if (escape_seen)
- {
- register int i;
-
- for (i = 0; word[i]; i++)
- if (word[i] == '\\')
- memmove (word + i, word + i + 1,
- 1 + strlen (word + i + 1));
- }
-
- if (arglist_index + 2 >= arglist_size)
- arglist = (char **)xrealloc
- (arglist, (arglist_size += 10) * sizeof (char *));
-
- arglist[arglist_index++] = word;
- arglist[arglist_index] = (char *)NULL;
- }
-
- input_text_offset++;
- if (character == '}')
- break;
- else
- goto get_arg;
- }
+ ((character == '}') && depth == 1))
+ {
+ int len = input_text_offset - start;
+
+ if (len || (character != '}'))
+ {
+ word = (char *)xmalloc (1 + len);
+ strncpy (word, input_text + start, len);
+ word[len] = '\0';
+
+ /* Clean up escaped characters. */
+ if (escape_seen)
+ {
+ register int i;
+
+ for (i = 0; word[i]; i++)
+ if (word[i] == '\\')
+ memmove (word + i, word + i + 1,
+ 1 + strlen (word + i + 1));
+ }
+
+ if (arglist_index + 2 >= arglist_size)
+ arglist = (char **)xrealloc
+ (arglist, (arglist_size += 10) * sizeof (char *));
+
+ arglist[arglist_index++] = word;
+ arglist[arglist_index] = (char *)NULL;
+ }
+
+ input_text_offset++;
+ if (character == '}')
+ break;
+ else
+ goto get_arg;
+ }
else if (character == '}')
- {
- depth--;
- input_text_offset++;
- }
+ {
+ depth--;
+ input_text_offset++;
+ }
else
- {
- input_text_offset++;
- if (character == '\n') line_number++;
- }
+ {
+ input_text_offset++;
+ if (character == '\n') line_number++;
+ }
}
return (arglist);
}
@@ -9507,10 +9274,10 @@ extract_colon_unit (string, index)
if (i == start)
{
if (string[i])
- (*index)++;
+ (*index)++;
/* Return "" in the case of a trailing `:'. */
- return (xstrdup (""));
+ return (strdup (""));
}
else
{
@@ -9518,7 +9285,7 @@ extract_colon_unit (string, index)
value = (char *)xmalloc (1 + (i - start));
strncpy (value, &string[start], (i - start));
- value [i - start] = 0;
+ value [i - start] = '\0';
return (value);
}
@@ -9543,29 +9310,23 @@ get_file_info_in_path (filename, path, finfo)
if (*filename == '/' ||
(*filename == '.' &&
(filename[1] == '/' ||
- (filename[1] == '.' && filename[2] == '/')))
-#ifdef WIN32
- /* Handle names that look like "d:/foo/bar" */
- || (isalpha (*filename) && filename [1] == ':'
- && (filename [2] == '/' || filename [2] == '\\'))
-#endif
- )
+ (filename[1] == '.' && filename[2] == '/'))))
{
if (stat (filename, finfo) == 0)
- return (xstrdup (filename));
+ return (strdup (filename));
else
- return ((char *)NULL);
+ return ((char *)NULL);
}
- while ((dir = extract_colon_unit (path, &index)))
+ while (dir = extract_colon_unit (path, &index))
{
char *fullpath;
if (!*dir)
- {
- free (dir);
- dir = xstrdup (".");
- }
+ {
+ free (dir);
+ dir = strdup (".");
+ }
fullpath = (char *)xmalloc (2 + strlen (dir) + strlen (filename));
sprintf (fullpath, "%s/%s", dir, filename);
@@ -9574,9 +9335,9 @@ get_file_info_in_path (filename, path, finfo)
result = stat (fullpath, finfo);
if (result == 0)
- return (fullpath);
+ return (fullpath);
else
- free (fullpath);
+ free (fullpath);
}
- return NULL;
+ return ((char *)NULL);
}
diff --git a/contrib/texinfo/makeinfo/makeinfo.h b/contrib/texinfo/makeinfo/makeinfo.h
index 205a3bdf0415..610d39bf6aec 100644
--- a/contrib/texinfo/makeinfo/makeinfo.h
+++ b/contrib/texinfo/makeinfo/makeinfo.h
@@ -1,7 +1,7 @@
/* makeinfo.h -- Declarations for Makeinfo.
- $Id: makeinfo.h,v 1.3 1997/07/15 18:28:38 karl Exp $
+ $Id: makeinfo.h,v 1.2 1996/07/21 11:21:45 karl Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,14 +35,12 @@
enum insertion_type
{
- cartouche, defcv, deffn, defivar, defmac, defmethod,
- defop, defopt, defspec, deftp, deftypefn, deftypefun,
- deftypemethod, deftypevar, deftypevr, defun, defvar,
- defvr, detailmenu, direntry, display, enumerate, example,
- flushleft, flushright, format, ftable, group, ifclear,
- ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
- multitable, quotation, smallexample, smalllisp, table, vtable,
- bad_type
+ menu, detailmenu, quotation, lisp, smalllisp, example, smallexample,
+ display, itemize, format, enumerate, cartouche, multitable, table,
+ ftable, vtable, group, ifinfo, flushleft, flushright, ifset,
+ ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt,
+ deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop,
+ defmethod, deftypemethod, deftp, direntry, bad_type
};
DECLARE (int, insertion_level, 0);
@@ -50,13 +48,13 @@ DECLARE (int, insertion_level, 0);
#if defined (COMPILING_MAKEINFO)
char *insertion_type_names[] =
{
- "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
- "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
- "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
- "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
- "flushleft", "flushright", "format", "ftable", "group", "ifclear",
- "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
- "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
+ "menu", "detailmenu", "quotation", "lisp", "smalllisp", "example",
+ "smallexample", "display", "itemize", "format", "enumerate",
+ "cartouche", "multitable", "table", "ftable", "vtable", "group",
+ "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn",
+ "defun", "defmac", "defspec", "defvr", "defvar", "defopt",
+ "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv",
+ "defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry",
"bad_type"
};
#endif
@@ -109,15 +107,15 @@ DECLARE (int, line_number, 0);
#define curchar() input_text[input_text_offset]
/* **************************************************************** */
-/* */
-/* Global Defines */
-/* */
+/* */
+/* Global Defines */
+/* */
/* **************************************************************** */
/* Error levels */
#define NO_ERROR 0
-#define SYNTAX 2
-#define FATAL 4
+#define SYNTAX 2
+#define FATAL 4
/* C's standard macros don't check to make sure that the characters being
changed are within range. So I have to check explicitly. */
@@ -166,29 +164,29 @@ DECLARE (int, line_number, 0);
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
-DECLARE (int, splitting, 1); /* Defaults to true for now. */
+DECLARE (int, splitting, 1); /* Defaults to true for now. */
typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */
#define command_char(c) ((!whitespace(c)) && \
- ((c) != '\n') && \
- ((c) != '{') && \
- ((c) != '}') && \
- ((c) != '='))
+ ((c) != '\n') && \
+ ((c) != '{') && \
+ ((c) != '}') && \
+ ((c) != '='))
#define skip_whitespace() \
while ((input_text_offset != size_of_input_text) && \
- whitespace (curchar())) \
+ whitespace (curchar())) \
input_text_offset++
#define skip_whitespace_and_newlines() \
do { \
while ((input_text_offset != size_of_input_text) && \
- (whitespace (curchar ()) || (curchar () == '\n'))) \
+ (whitespace (curchar ()) || (curchar () == '\n'))) \
{ \
- if (curchar () == '\n') \
- line_number++; \
- input_text_offset++; \
+ if (curchar () == '\n') \
+ line_number++; \
+ input_text_offset++; \
} \
} while (0)
diff --git a/contrib/texinfo/makeinfo/makeinfo.texi b/contrib/texinfo/makeinfo/makeinfo.texi
new file mode 100644
index 000000000000..f379ae07f6c5
--- /dev/null
+++ b/contrib/texinfo/makeinfo/makeinfo.texi
@@ -0,0 +1,303 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename makeinfo.info
+@set VERSION 1.61
+@paragraphindent none
+@comment %**start of header
+@comment $Id: makeinfo.texi,v 1.2 1996/09/28 21:49:18 karl Exp $
+
+@dircategory Texinfo documentation system
+@direntry
+* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
+@end direntry
+
+@ifinfo
+This file is an extract from the @cite{Texinfo} manual.@*
+It documents Makeinfo, a program that converts Texinfo
+files into Info files.
+
+Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end ifinfo
+
+@titlepage
+@title GNU Makeinfo
+@author Brian J. Fox and Robert J. Chassell
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end titlepage
+
+@node Top
+@chapter What is @code{makeinfo}?
+
+@iftex
+This file documents the use of the @code{makeinfo} program, versions
+@value{VERSION} and later. It is an extract from the @cite{Texinfo} manual.
+@end iftex
+
+@code{makeinfo} is a program for converting @dfn{Texinfo} files into @dfn{Info}
+files. Texinfo is a documentation system that uses a single source file to
+produce both on-line information and printed output.
+
+You can read the on-line information using Info; type @code{info} to
+learn about Info.
+@ifinfo
+@xref{Top, Texinfo, Overview of Texinfo, Texinfo, Texinfo},
+@end ifinfo
+@iftex
+See the @cite{Texinfo} manual,
+@end iftex
+to learn about the Texinfo documentation system.
+
+@menu
+* Formatting Control:: Controlling the width of lines, paragraph
+ indentation, and other similar formatting.
+
+* Options:: Command line options which control the
+ behaviour of Makeinfo.
+
+* Pointer Validation:: How Makeinfo can help you to track node
+ references through complex Texinfo files.
+
+* Index:: Index of Concepts.
+@end menu
+
+@c Removed this for 3.8 until it's time to rewrite it.
+@c * The Macro Facility:: Makeinfo allows the use of @dfn{macros}.
+
+@node Formatting Control
+@section Controlling Paragraph Formats
+
+Without any special options, @code{makeinfo} @dfn{fills} the paragraphs that
+it outputs to an Info file. Filling is the process of breaking and connecting
+lines so that lines are the same length as or shorter than the number
+specified as the fill column. Lines are broken between words. With
+@code{makeinfo}, you can control:
+
+@itemize @bullet
+@item
+The width of each paragraph (the @dfn{fill-column}).
+@item
+The amount of indentation that the first line of
+each paragraph receives (the @dfn{paragraph-indentation}).
+@end itemize
+
+@node Options
+@section Command Line Options
+
+The following command line options are available for @code{makeinfo}.
+
+@need 100
+@table @code
+@item -D @var{var}
+Cause @var{var} to be defined. This is equivalent to
+@code{@@set @var{var}} in the Texinfo file.
+
+@need 150
+@item --error-limit @var{limit}
+Set the maximum number of errors that @code{makeinfo} will report
+before exiting (on the assumption that continuing would be useless).
+The default number of errors that can be reported before
+@code{makeinfo} gives up is 100.@refill
+
+@need 150
+@item --fill-column @var{width}
+Specify the maximum number of columns in a line; this is the right-hand
+edge of a line. Paragraphs that are filled will be filled to this
+width. The default value for @code{fill-column} is 72.
+@refill
+
+@item --footnote-style @var{style}
+Set the footnote style to @var{style}, either @samp{end} for the end
+node style or @samp{separate} for the separate node style. The value
+set by this option overrides the value set in a Texinfo file by an
+@code{@@footnotestyle} command. When the footnote style is
+@samp{separate}, @code{makeinfo} makes a new node containing the
+footnotes found in the current node. When the footnote style is
+@samp{end}, @code{makeinfo} places the footnote references at the end
+of the current node.@refill
+
+@need 150
+@item -I @var{dir}
+Add @code{dir} to the directory search list for finding files that are
+included using the @code{@@include} command. By default,
+@code{makeinfo} searches only the current directory.
+
+@need 150
+@item --no-headers
+Do not include menus or node lines in the output. This results in an
+@sc{ascii} file that you cannot read in Info since it does not contain
+the requisite nodes or menus; but you can print such a file in a
+single, typewriter-like font and produce acceptable output.
+
+@need 150
+@item --no-split
+Suppress the splitting stage of @code{makeinfo}. Normally, large
+output files (where the size is greater than 70k bytes) are split into
+smaller subfiles, each one approximately 50k bytes. If you specify
+@samp{--no-split}, @code{makeinfo} will not split up the output
+file.@refill
+
+@need 100
+@item --no-pointer-validate
+@item --no-validate
+Suppress the pointer-validation phase of @code{makeinfo}. Normally,
+after a Texinfo file is processed, some consistency checks are made to
+ensure that cross references can be resolved, etc.
+@xref{Pointer Validation}.@refill
+
+@need 150
+@item --no-warn
+Suppress the output of warning messages. This does @emph{not}
+suppress the output of error messages, only warnings. You might
+want this if the file you are creating has examples of Texinfo cross
+references within it, and the nodes that are referenced do not actually
+exist.@refill
+
+@item --no-number-footnotes
+Supress automatic footnote numbering. By default, @code{makeinfo}
+numbers each footnote sequentially in a single node, resetting the
+current footnote number to 1 at the start of each node.
+
+@need 150
+@item --output @var{file}
+@itemx -o @var{file}
+Specify that the output should be directed to @var{file} and not to the
+file name specified in the @code{@@setfilename} command found in the Texinfo
+source. @var{file} can be the special token @samp{-}, which specifies
+standard output.
+
+@need 150
+@item --paragraph-indent @var{indent}
+Set the paragraph indentation style to @var{indent}. The value set by
+this option overrides the value set in a Texinfo file by an
+@code{@@paragraphindent} command. The value of @var{indent} is
+interpreted as follows:@refill
+
+@itemize @bullet
+@item
+If the value of @var{indent} is @samp{asis}, do not change the
+existing indentation at the starts of paragraphs.@refill
+
+@item
+If the value of @var{indent} is zero, delete any existing
+indentation.@refill
+
+@item
+If the value of @var{indent} is greater than zero, indent each
+paragraph by that number of spaces.@refill
+@end itemize
+
+@need 100
+@item --reference-limit @var{limit}
+Set the value of the number of references to a node that
+@code{makeinfo} will make without reporting a warning. If a node has more
+than this number of references in it, @code{makeinfo} will make the
+references but also report a warning.@refill
+
+@need 150
+@item -U @var{var}
+Cause @var{var} to be undefined. This is equivalent to
+@code{@@clear @var{var}} in the Texinfo file.
+
+@need 100
+@item --verbose
+Cause @code{makeinfo} to display messages saying what it is doing.
+Normally, @code{makeinfo} only outputs messages if there are errors or
+warnings.@refill
+
+@need 100
+@item --version
+Report the version number of this copy of @code{makeinfo}.@refill
+
+@item --help
+Show a summary of the commend line arguments to @code{makeinfo}.
+@end table
+
+@node Pointer Validation
+@section Pointer Validation
+@cindex Pointer validation with @code{makeinfo}
+@cindex Validation of pointers
+
+If you do not suppress pointer-validation (by using the
+@samp{--no-pointer-validation} option), @code{makeinfo}
+will check the validity of the final Info file. Mostly,
+this means ensuring that nodes you have referenced
+really exist. Here is a complete list of what is
+checked:@refill
+
+@enumerate
+@item
+If a `Next', `Previous', or `Up' node reference is a reference to a
+node in the current file and is not an external reference such as to
+@file{(dir)}, then the referenced node must exist.@refill
+
+@item
+In every node, if the `Previous' node is different from the `Up' node,
+then the `Previous' node must also be pointed to by a `Next' node.@refill
+
+@item
+Every node except the `Top' node must have an `Up' pointer.@refill
+
+@item
+The node referenced by an `Up' pointer must contain a reference to the
+current node in some manner other than through a `Next' reference.
+This includes menu entries and cross references.@refill
+
+@item
+If the `Next' reference of a node is not the same as the `Next' reference
+of the `Up' reference, then the node referenced by the `Next' pointer
+must have a `Previous' pointer that points back to the current node.
+This rule allows the last node in a section to point to the first node
+of the next chapter.@refill
+@end enumerate
+
+@c We don't want to advertise redefining commands.
+@c lowersections
+@c include macro.texi
+@c raisesections
+
+@lowersections
+@node Index
+@appendix Index
+@printindex cp
+@raisesections
+
+@contents
+@bye
diff --git a/contrib/texinfo/makeinfo/multi.c b/contrib/texinfo/makeinfo/multi.c
index 99c380d3dd95..0276ddc8ae84 100644
--- a/contrib/texinfo/makeinfo/multi.c
+++ b/contrib/texinfo/makeinfo/multi.c
@@ -1,7 +1,7 @@
-/* multi.c -- multitable stuff for makeinfo.
- $Id: multi.c,v 1.9 1997/07/24 22:01:00 karl Exp $
+/* multi.c -- Multitable stuff for makeinfo.
+ $Id: multi.c,v 1.7 1996/10/01 21:42:20 karl Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,10 +17,10 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "system.h"
+#include <stdio.h>
#include "makeinfo.h"
-#define MAXCOLS 100 /* remove this limit later @@ */
+#define MAXCOLS 100 /* remove this limit later @@ */
/*
@@ -38,7 +38,7 @@
* `select_output_environment' function switches from one output
* environment to another.
*
- * Environment #0 (i.e., element #0 of the table) is the regular
+ * Environment #0 (i.e. element #0 of the table) is the regular
* environment that is used when we're not formatting a multitable.
*
* Environment #N (where N = 1,2,3,...) is the env. for column #N of
@@ -55,7 +55,7 @@ struct env
int paragraph_is_open;
int current_indent;
int fill_column;
-} envs[MAXCOLS]; /* the environment table */
+} envs[MAXCOLS]; /* the environment table */
/* index in environment table of currently selected environment */
static int current_env_no;
@@ -67,40 +67,6 @@ static int last_column;
to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep;
-/* Output a row. Have to keep `output_position' up-to-date for each
- character we output, or the tags table will be off, leading to
- chopped-off output files and undefined nodes (because they're in the
- wrong file, etc.). Perhaps it would be better to accumulate this
- value somewhere and add it once at the end of the table, or return it
- as the value, but this seems simplest. */
-static void
-out_char (ch)
- int ch;
-{
- extern int output_position;
- putc (ch, output_stream);
- output_position++;
-}
-
-
-void
-draw_horizontal_separator ()
-{
- int i, j, s;
-
- for (s = 0; s < envs[0].current_indent; s++)
- out_char (' ');
- if (vsep)
- out_char ('+');
- for (i = 1; i <= last_column; i++) {
- for (j = 0; j <= envs[i].fill_column; j++)
- out_char ('-');
- if (vsep)
- out_char ('+');
- }
- out_char ('\n');
-}
-
void
do_multitable ()
{
@@ -150,7 +116,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function;
int nchars;
float columnfrac;
- char command[200]; /* naughty, should be no fixed limits */
+ char command[200];
int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't.
@@ -163,32 +129,22 @@ setup_multitable_parameters ()
params++;
if (*params == '@') {
- sscanf (params, "%200s", command);
- nchars = strlen (command);
+ sscanf (params, "%s%n", command, &nchars);
params += nchars;
if (strcmp (command, "@hsep") == 0)
- hsep++;
+ hsep++;
else if (strcmp (command, "@vsep") == 0)
- vsep++;
+ vsep++;
else if (strcmp (command, "@columnfractions") == 0) {
- /* Clobber old environments and create new ones, starting at #1.
- Environment #0 is the normal output, so don't mess with it. */
- for ( ; i <= MAXCOLS; i++) {
- if (sscanf (params, "%f", &columnfrac) < 1)
- goto done;
- /* Unfortunately, can't use %n since some m68k-hp-bsd libc
- doesn't support it. So skip whitespace (preceding the
- number) and then non-whitespace (the number). */
- while (*params && (*params == ' ' || *params == '\t'))
- params++;
- /* Hmm, but what what @columnfractions 3foo. Well, I suppose
- it's invalid input anyway. */
- while (*params && *params != ' ' && *params != '\t'
- && *params != '\n' && *params != '@')
- params++;
- setup_output_environment (i,
- (int) (columnfrac * (fill_column - current_indent) + .5));
- }
+ /* Clobber old environments and create new ones,
+ starting at #1. Environment #0 is the normal standard output,
+ so we don't mess with it. */
+ for ( ; i <= MAXCOLS; i++) {
+ if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1)
+ goto done;
+ params += nchars;
+ setup_output_environment (i, (int) (columnfrac * fill_column + .5));
+ }
}
} else if (*params == '{') {
@@ -198,17 +154,18 @@ setup_multitable_parameters ()
}
/* This gives us two spaces between columns. Seems reasonable.
Really should expand the text, though, so a template of
- `@code{foo}' has a width of five, not ten. Also have to match
- braces, then. How to take into account current_indent here? */
+ `@code{foo}' has a width of three, not ten. Also have to match
+ braces, then. */
setup_output_environment (i++, params++ - start);
} else {
- warning (_("ignoring stray text `%s' after @multitable"), params);
+ warning ("ignoring stray text `%s' after @multitable", params);
break;
}
}
done:
+
flush_output ();
inhibit_output_flushing ();
@@ -270,12 +227,12 @@ select_output_environment (n)
}
/* advance to the next environment number */
-void
+int
nselect_next_environment ()
{
if (current_env_no >= last_column) {
- line_error (_("Too many columns in multitable item (max %d)"), last_column);
- return;
+ line_error ("Too many columns in multitable item (max %d)", last_column);
+ return 1;
}
select_output_environment (current_env_no + 1);
}
@@ -283,25 +240,12 @@ nselect_next_environment ()
static void output_multitable_row ();
-/* do anything needed at the beginning of processing a
- multitable column. */
-void
-init_column ()
-{
- /* don't indent 1st paragraph in the item */
- cm_noindent ();
-
- /* throw away possible whitespace after @item or @tab command */
- skip_whitespace ();
-}
-
/* start a new item (row) of a multitable */
-int
multitable_item ()
{
if (!multitable_active) {
/* impossible, I think. */
- error (_("multitable item not in active multitable"));
+ error ("multitable item not in active multitable");
exit (1);
}
if (current_env_no > 0) {
@@ -310,7 +254,7 @@ multitable_item ()
/* start at column 1 */
select_output_environment (1);
if (!output_paragraph) {
- line_error (_("Cannot select column #%d in multitable"), current_env_no);
+ line_error ("Cannot select column #%d in multitable", current_env_no);
exit (FATAL);
}
@@ -319,10 +263,38 @@ multitable_item ()
return 0;
}
+/* do anything needed at the beginning of processing a
+ multitable column. */
+init_column ()
+{
+ /* don't indent 1st paragraph in the item */
+ cm_noindent ();
+
+ /* throw away possible whitespace after @item or @tab command */
+ skip_whitespace ();
+}
+
+/* Output a row. Have to keep `output_position' up-to-date for each
+ character we output, or the tags table will be off, leading to
+ chopped-off output files and undefined nodes (because they're in the
+ wrong file, etc.). Perhaps it would be better to accumulate this
+ value somewhere and add it once at the end of the table, or return it
+ as the value, but this seems simplest. */
+
+static void
+out_char (ch)
+ int ch;
+{
+ extern int output_position;
+ putc (ch, output_stream);
+ output_position++;
+}
+
+
static void
output_multitable_row ()
{
- int i, j, s, remaining;
+ int i, j, remaining;
/* offset in the output paragraph of the next char needing
to be output for that column. */
@@ -353,34 +325,29 @@ output_multitable_row ()
/* first, see if there is any work to do */
for (i = 1; i <= last_column; i++) {
if (CHAR_ADDR (0) < envs[i].output_paragraph_offset) {
- remaining = 1;
- break;
+ remaining = 1;
+ break;
}
}
if (!remaining)
break;
-
- for (s = 0; s < envs[0].current_indent; s++)
- out_char (' ');
-
+
if (vsep)
out_char ('|');
for (i = 1; i <= last_column; i++) {
- for (s = 0; i < envs[i].current_indent; s++)
- out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
- if (CHAR_AT (j) == '\n')
- break;
- out_char (CHAR_AT (j));
+ if (CHAR_AT (j) == '\n')
+ break;
+ out_char (CHAR_AT (j));
}
- offset[i] += j + 1; /* skip last text plus skip the newline */
+ offset[i] += j + 1; /* skip last text plus skip the newline */
for (; j <= envs[i].fill_column; j++)
- out_char (' ');
+ out_char (' ');
if (vsep)
- out_char ('|'); /* draw column separator */
+ out_char ('|'); /* draw column separator */
}
- out_char ('\n'); /* end of line */
+ out_char ('\n'); /* end of line */
}
if (hsep)
@@ -396,12 +363,27 @@ output_multitable_row ()
#undef CHAR_AT
#undef CHAR_ADDR
+int
+draw_horizontal_separator ()
+{
+ int i, j;
+ if (vsep)
+ out_char ('+');
+ for (i = 1; i <= last_column; i++) {
+ for (j = 0; j <= envs[i].fill_column; j++)
+ out_char ('-');
+ if (vsep)
+ out_char ('+');
+ }
+ out_char ('\n');
+}
+
/* select a new column in current row of multitable */
void
cm_tab ()
{
if (!multitable_active)
- error (_("ignoring @tab outside of multitable"));
+ error ("ignoring @tab outside of multitable");
nselect_next_environment ();
init_column ();
@@ -412,6 +394,8 @@ cm_tab ()
void
end_multitable ()
{
+ int i;
+
output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the
@@ -425,10 +409,10 @@ end_multitable ()
uninhibit_output_flushing ();
#if 0
- printf (_("** Multicolumn output from last row:\n"));
+ printf ("** Multicolumn output from last row:\n");
for (i = 1; i <= last_column; i++) {
select_output_environment (i);
- printf (_("* column #%d: output = %s\n"), i, output_paragraph);
+ printf ("* column #%d: output = %s\n", i, output_paragraph);
}
#endif
}
diff --git a/contrib/texinfo/missing b/contrib/texinfo/missing
deleted file mode 100755
index 79a3e4ed66ba..000000000000
--- a/contrib/texinfo/missing
+++ /dev/null
@@ -1,142 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-case "$1" in
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- automake touch all \`Makefile.in' files
- bison touch file \`y.tab.c'
- makeinfo touch the output file
- yacc touch file \`y.tab.c'"
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing - GNU libit 0.0"
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
- aclocal)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in`
- if test -z "$files"; then
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in`
- test -z "$files" || files="$files.in"
- else
- files=`echo "$files" | sed -e 's/:/ /g'`
- fi
- test -z "$files" && files="config.h.in"
- touch $files
- ;;
-
- automake)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print \
- | sed 's/^\(.*\).am$/touch \1.in/' \
- | sh
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- touch y.tab.c
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
- touch $file
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/contrib/texinfo/po/ChangeLog b/contrib/texinfo/po/ChangeLog
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/texinfo/po/ChangeLog
+++ /dev/null
diff --git a/contrib/texinfo/po/Makefile.in.in b/contrib/texinfo/po/Makefile.in.in
deleted file mode 100644
index c25fea49b01c..000000000000
--- a/contrib/texinfo/po/Makefile.in.in
+++ /dev/null
@@ -1,247 +0,0 @@
-# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = $(prefix)/@DATADIRNAME@
-localedir = $(datadir)/locale
-gnulocaledir = $(prefix)/share/locale
-gettextsrcdir = $(prefix)/share/gettext/po
-subdir = po
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
-
-CC = @CC@
-GENCAT = @GENCAT@
-GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
-MSGMERGE = PATH=../src:$$PATH msgmerge
-
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = cat-id-tbl.c
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
-stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
-
-.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
- $(COMPILE) $<
-
-.po.pox:
- $(MAKE) $(PACKAGE).pot
- $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
-
-.po.mo:
- $(MSGFMT) -o $@ $<
-
-.po.gmo:
- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) -o $$file $<
-
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && $(GENCAT) $@ $*.msg
-
-
-all: all-@USE_NLS@
-
-all-yes: cat-id-tbl.c $(CATALOGS)
-all-no:
-
-$(srcdir)/$(PACKAGE).pot: $(POTFILES)
- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
- --add-comments --keyword=_ --keyword=N_ \
- --files-from=$(srcdir)/POTFILES.in
- rm -f $(srcdir)/$(PACKAGE).pot
- mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
-
-$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
-$(srcdir)/stamp-cat-id: $(PACKAGE).pot
- rm -f cat-id-tbl.tmp
- sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
- | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
- if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
- rm cat-id-tbl.tmp; \
- else \
- echo cat-id-tbl.c changed; \
- rm -f $(srcdir)/cat-id-tbl.c; \
- mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
- fi
- cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
-
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
-install-data-no: all
-install-data-yes: all
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(datadir); \
- else \
- $(top_srcdir)/mkinstalldirs $(datadir); \
- fi
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- case "$$cat" in \
- *.gmo) destdir=$(gnulocaledir);; \
- *) destdir=$(localedir);; \
- esac; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- dir=$$destdir/$$lang/LC_MESSAGES; \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $$dir; \
- else \
- $(top_srcdir)/mkinstalldirs $$dir; \
- fi; \
- if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
- echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
- fi; \
- if test -r $$cat.m; then \
- $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- if test -r $(srcdir)/$$cat.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$cat.m \
- $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- true; \
- fi; \
- fi; \
- done
- if test "$(PACKAGE)" = "gettext"; then \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(gettextsrcdir); \
- else \
- $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
- rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
- done
- rm -f $(gettextsrcdir)/po-Makefile.in.in
-
-check: all
-
-cat-id-tbl.o: ../intl/libgettext.h
-
-dvi info tags TAGS ID:
-
-mostlyclean:
- rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
- rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
-
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: update-po $(DISTFILES)
- dists="$(DISTFILES)"; \
- for file in $$dists; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
- done
-
-update-po: Makefile
- $(MAKE) $(PACKAGE).pot
- PATH=`pwd`/../src:$$PATH; \
- cd $(srcdir); \
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- mv $$lang.po $$lang.old.po; \
- echo "$$lang:"; \
- if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
- rm -f $$lang.old.po; \
- else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$lang.po; \
- mv $$lang.old.po $$lang.po; \
- fi; \
- done
-
-POTFILES: POTFILES.in
- ( if test 'x$(srcdir)' != 'x.'; then \
- posrcprefix='$(top_srcdir)/'; \
- else \
- posrcprefix="../"; \
- fi; \
- rm -f $@-t $@ \
- && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
- | sed -e '$$s/\\$$//') > $@-t \
- && chmod a-w $@-t \
- && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
- cd .. \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/contrib/texinfo/po/POTFILES.in b/contrib/texinfo/po/POTFILES.in
deleted file mode 100644
index 8debb07e9318..000000000000
--- a/contrib/texinfo/po/POTFILES.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# List of source files containing translatable strings.
-# The last line must not be a comment.
-
-info/echo-area.c
-info/footnotes.c
-info/footnotes.h
-info/indices.c
-info/info.c
-info/info.h
-info/infodoc.c
-info/m-x.c
-info/makedoc.c
-info/nodemenu.c
-info/session.c
-info/tilde.c
-info/variables.c
-info/window.c
-lib/getopt.c
-makeinfo/makeinfo.c
-makeinfo/multi.c
-util/install-info.c
-util/texindex.c
diff --git a/contrib/texinfo/po/cat-id-tbl.c b/contrib/texinfo/po/cat-id-tbl.c
deleted file mode 100644
index 5639d50704ad..000000000000
--- a/contrib/texinfo/po/cat-id-tbl.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/* Automatically generated by po2tbl.sed from texinfo.pot. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "libgettext.h"
-
-const struct _msg_ent _msg_tbl[] = {
- {"", 1},
- {"Move forward a character", 2},
- {"Move backward a character", 3},
- {"Move to the start of this line", 4},
- {"Move to the end of this line", 5},
- {"Move forward a word", 6},
- {"Move backward a word", 7},
- {"Delete the character under the cursor", 8},
- {"Delete the character behind the cursor", 9},
- {"Cancel or quit operation", 10},
- {"Accept (or force completion of) this line", 11},
- {"Insert next character verbatim", 12},
- {"Insert this character", 13},
- {"Insert a TAB character", 14},
- {"Transpose characters at point", 15},
- {"Yank back the contents of the last kill", 16},
- {"Kill ring is empty", 17},
- {"Yank back a previous kill", 18},
- {"Kill to the end of the line", 19},
- {"Kill to the beginning of the line", 20},
- {"Kill the word following the cursor", 21},
- {"Kill the word preceding the cursor", 22},
- {"Not complete", 23},
- {"List possible completions", 24},
- {"No completions", 25},
- {"Sole completion", 26},
- {"One completion:\n", 27},
- {"%d completions:\n", 28},
- {"Insert completion", 29},
- {"Building completions...", 30},
- {"Scroll the completions window", 31},
- {"Footnotes could not be displayed", 32},
- {"Show the footnotes associated with this node in another window", 33},
- {"Look up a string in the index for this file", 34},
- {"Finding index entries...", 35},
- {"No indices found.", 36},
- {"Index entry: ", 37},
- {"\
-Go to the next matching index item from the last `\\[index-search]' command", 38},
- {"No previous index search string.", 39},
- {"No index entries.", 40},
- {"No %sindex entries containing \"%s\".", 41},
- {"more ", 42},
- {"CAN'T SEE THIS", 43},
- {"Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)", 44},
- {"Scanning indices of \"%s\"...", 45},
- {"Grovel all known info file's indices for a string and build a menu", 46},
- {"Index apropos: ", 47},
- {"\
-\n\
-* Menu: Nodes whoses indices contain \"%s\":\n", 48},
- {"Try --help for more information.", 49},
- {"\
-Copyright (C) %s Free Software Foundation, Inc.\n\
-There is NO warranty. You may redistribute this software\n\
-under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.\n", 50},
- {"no entries found\n", 51},
- {"There is no menu in this node.", 52},
- {"There is no menu item \"%s\" in this node.", 53},
- {"Unable to find the node referenced by \"%s\".", 54},
- {"\
-Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
-\n\
-Read documentation in Info format.\n\
-For more complete documentation on how to use Info, run `info info \
-options'.\n\
-\n\
-Options:\n\
---directory DIR add DIR to INFOPATH.\n\
---dribble FILENAME remember user keystrokes in FILENAME.\n\
---file FILENAME specify Info file to visit.\n\
---node NODENAME specify nodes in first visited Info file.\n\
---output FILENAME output selected nodes to FILENAME.\n\
---restore FILENAME read initial keystrokes from FILENAME.\n\
---subnodes recursively output menu items.\n\
---help display this help and exit.\n\
---version display version information and exit.\n\
-\n\
-The first argument, if present, is the name of the Info file to read.\n\
-Any remaining arguments are treated as the names of menu\n\
-items in the initial node visited. For example, `info emacs buffers'\n\
-moves to the node `buffers' in the info file `emacs'.\n\
-\n\
-Email bug reports to bug-texinfo@gnu.org.", 55},
- {"Basic Commands in Info Windows", 56},
- {"\
-The following commands can only be invoked via M-x:\n\
-\n", 57},
- {"--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n", 58},
- {"Display help message", 59},
- {"Visit Info node `(info)Help'", 60},
- {"Print documentation for KEY", 61},
- {"Describe key: %s", 62},
- {"ESC %s is undefined.", 63},
- {"%s is undefined.", 64},
- {"%s is defined to %s.", 65},
- {"Where is command: ", 66},
- {"`%s' is not on any keys", 67},
- {"%s can only be invoked via %s.", 68},
- {"%s can be invoked via %s.", 69},
- {"There is no function named `%s'", 70},
- {"Read the name of an Info command and describe it", 71},
- {"Describe command: ", 72},
- {"Read a command name in the echo area and execute it", 73},
- {"Cannot execute an `echo-area' command here.", 74},
- {"Set the height of the displayed window", 75},
- {"Set screen height to (%d): ", 76},
- {"\
- Source files groveled to make this file include:\n\
-\n", 77},
- {"Couldn't manipulate the file %s.\n", 78},
- {"\
-\n\
-* Menu:\n\
- (File)Node Lines Size Containing File\n\
- ---------- ----- ---- ---------------", 79},
- {"\
-Here is the menu of nodes you have recently visited.\n\
-Select one from this menu, or use `\\[history-node]' in another window.\n", 80},
- {"Make a window containing a menu of all of the currently visited nodes", 81},
- {"Select a node which has been previously visited in a visible window", 82},
- {"Select visited node: ", 83},
- {"The reference disappeared! (%s).", 84},
- {"\
-Welcome to Info version %s. \"\\[get-help-window]\" for help, \
-\"\\[menu-item]\" for menu item.", 85},
- {"Move down to the next line", 86},
- {"Move up to the previous line", 87},
- {"Move to the end of the line", 88},
- {"Move to the start of the line", 89},
- {" times", 90},
- {"%d times", 91},
- {"No \"Next\" pointer for this node.", 92},
- {"Following \"Next\" node...", 93},
- {"Next", 94},
- {"Selecting first menu item...", 95},
- {"Selecting \"Next\" node...", 96},
- {"Up", 97},
- {"No more nodes.", 98},
- {"No \"Prev\" for this node.", 99},
- {"Moving \"Prev\" in this window.", 100},
- {"Prev", 101},
- {"No \"Prev\" or \"Up\" for this node.", 102},
- {"Moving \"Up\" in this window.", 103},
- {"Moving to \"Prev\"'s last menu item.", 104},
- {"Move forwards or down through node structure", 105},
- {"Move backwards or up through node structure", 106},
- {"Scroll forward in this window", 107},
- {"Scroll backward in this window", 108},
- {"Move to the start of this node", 109},
- {"Move to the end of this node", 110},
- {"Select the next window", 111},
- {"Select the previous window", 112},
- {"Split the current window", 113},
- {"Delete the current window", 114},
- {"Cannot delete a permanent window", 115},
- {"Delete all other windows", 116},
- {"Scroll the other window", 117},
- {"Grow (or shrink) this window", 118},
- {"Divide the available screen space among the visible windows", 119},
- {"Toggle the state of line wrapping in the current window", 120},
- {"Select the `Next' node", 121},
- {"Select the `Prev' node", 122},
- {"Select the `Up' node", 123},
- {"Select the last node in this file", 124},
- {"This window has no additional nodes", 125},
- {"Select the first node in this file", 126},
- {"Select the last item in this node's menu", 127},
- {"Select this menu item", 128},
- {"There aren't %d items in this menu.", 129},
- {"Menu item (%s): ", 130},
- {"Menu item: ", 131},
- {"Follow xref (%s): ", 132},
- {"Follow xref: ", 133},
- {"Read a menu item and select its node", 134},
- {"Read a footnote or cross reference and select its node", 135},
- {"Move to the start of this node's menu", 136},
- {"Visit as many menu items at once as possible", 137},
- {"Read a node name and select it", 138},
- {"Goto Node: ", 139},
- {"Read a manpage reference and select it", 140},
- {"Get Manpage: ", 141},
- {"Select the node `Top' in this file", 142},
- {"Top", 143},
- {"Select the node `(dir)'", 144},
- {"Kill node (%s): ", 145},
- {"Cannot kill node `%s'", 146},
- {"Cannot kill the last node", 147},
- {"Select the most recently selected node", 148},
- {"Kill this node", 149},
- {"Read the name of a file and select it", 150},
- {"Find file: ", 151},
- {"Cannot find \"%s\".", 152},
- {"Could not create output file \"%s\".", 153},
- {"Done.", 154},
- {"Writing node \"(%s)%s\"...", 155},
- {"Writing node \"%s\"...", 156},
- {"Pipe the contents of this node through INFO_PRINT_COMMAND", 157},
- {"Cannot open pipe to \"%s\".", 158},
- {"Printing node \"(%s)%s\"...", 159},
- {"Printing node \"%s\"...", 160},
- {"Searching subfile \"%s\"...", 161},
- {"Read a string and search for it", 162},
- {"%s for string [%s]: ", 163},
- {"Search backward", 164},
- {"Search", 165},
- {"Search failed.", 166},
- {"Search interactively for a string as you type it", 167},
- {"I-search backward: ", 168},
- {"I-search: ", 169},
- {"Failing ", 170},
- {"No cross references in this node.", 171},
- {"Move to the previous cross reference", 172},
- {"Move to the next cross reference", 173},
- {"Select reference or menu item appearing on this line", 174},
- {"Cancel current operation", 175},
- {"Quit", 176},
- {"Move to the cursor to a specific line of the window", 177},
- {"Redraw the display", 178},
- {"Quit using Info", 179},
- {"Unknown command (%s).", 180},
- {"\"\" is invalid", 181},
- {"\"%s\" is invalid", 182},
- {"Add this digit to the current numeric argument", 183},
- {"Start (or multiply by 4) the current numeric argument", 184},
- {"Internally used by \\[universal-argument]", 185},
- {"readline: Out of virtual memory!\n", 186},
- {"When \"On\", footnotes appear and disappear automatically", 187},
- {"When \"On\", creating or deleting a window resizes other windows", 188},
- {"When \"On\", flash the screen instead of ringing the bell", 189},
- {"When \"On\", errors cause the bell to ring", 190},
- {"When \"On\", Info garbage collects files which had to be uncompressed", 191},
- {"When \"On\", the portion of the matched search string is highlighted", 192},
- {"Controls what happens when scrolling is requested at the end of a node", 193},
- {"The number lines to scroll when the cursor moves out of the window", 194},
- {"When \"On\", Info accepts and displays ISO Latin characters", 195},
- {"Explain the use of a variable", 196},
- {"Describe variable: ", 197},
- {"Set the value of an Info variable", 198},
- {"Set variable: ", 199},
- {"Set %s to value (%d): ", 200},
- {"Set %s to value (%s): ", 201},
- {"--*** Tags out of Date ***", 202},
- {"-----Info: (), lines ----, ", 203},
- {"-%s---Info: %s, %d lines --%s--", 204},
- {"-%s%s-Info: (%s)%s, %d lines --%s--", 205},
- {" Subfile: %s", 206},
- {"%s: option `%s' is ambiguous\n", 207},
- {"%s: option `--%s' doesn't allow an argument\n", 208},
- {"%s: option `%c%s' doesn't allow an argument\n", 209},
- {"%s: option `%s' requires an argument\n", 210},
- {"%s: unrecognized option `--%s'\n", 211},
- {"%s: unrecognized option `%c%s'\n", 212},
- {"%s: illegal option -- %c\n", 213},
- {"%s: invalid option -- %c\n", 214},
- {"%s: option requires an argument -- %c\n", 215},
- {"%s: option `-W %s' is ambiguous\n", 216},
- {"%s: option `-W %s' doesn't allow an argument\n", 217},
- {"%s:%d: warning: ", 218},
- {"Too many errors! Gave up.\n", 219},
- {"%s: %s arg must be numeric, not `%s'.\n", 220},
- {"Couldn't open macro expansion output `%s'", 221},
- {"Cannot specify more than one macro expansion output", 222},
- {"%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n", 223},
- {"%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", 224},
- {"%s: missing file argument.\n", 225},
- {"Try `%s --help' for more information.\n", 226},
- {"\
-Usage: %s [OPTION]... TEXINFO-FILE...\n\
-\n\
-Translate Texinfo source documentation to a format suitable for reading\n\
-with GNU Info.\n\
-\n\
-Options:\n\
--D VAR define a variable, as with @set.\n\
--E MACRO-OFILE process macros only, output texinfo source.\n\
--I DIR append DIR to the @include directory search path.\n\
--P DIR prepend DIR to the @include directory search path.\n\
--U VAR undefine a variable, as with @clear.\n\
---error-limit NUM quit after NUM errors (default %d).\n\
---fill-column NUM break lines at NUM characters (default %d).\n\
---footnote-style STYLE output footnotes according to STYLE:\n\
- `separate' to place footnotes in their own node,\n\
- `end' to place the footnotes at the end of\n\
- the node in which they are defined (the default).\n\
---force preserve output even if errors.\n\
---help display this help and exit.\n\
---no-validate suppress node cross-reference validation.\n\
---no-warn suppress warnings (but not errors).\n\
---no-split suppress splitting of large files.\n\
---no-headers suppress node separators and Node: Foo headers.\n\
---output FILE, -o FILE output to FILE, and ignore any @setfilename.\n\
---paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n\
- if VAL is `none', do not indent; if VAL is `asis',\n\
- preserve any existing indentation.\n\
---reference-limit NUM complain about at most NUM references (default %d).\n\
---verbose report about what is being done.\n\
---version display version information and exit.\n\
-\n\
-Email bug reports to bug-texinfo@gnu.org.\n", 227},
- {"%s: getwd: %s, %s\n", 228},
- {"Expected `%s'", 229},
- {"No `%s' found in `%s'", 230},
- {"%s: Skipping macro expansion to stdout as Info output is going there.\n", 231},
- {"Making %s file `%s' from `%s'.\n", 232},
- {"This is Info file %s, produced by Makeinfo version %d.%d", 233},
- {" from the input file %s.\n", 234},
- {"\
-%s: Removing macro output file `%s' due to errors; use --force to preserve.\n", 235},
- {"%s: Removing output file `%s' due to errors; use --force to preserve.\n", 236},
- {"Misplaced %c", 237},
- {"Unknown command `%s'", 238},
- {"NO_NAME!", 239},
- {"%c%s expected `{...}'", 240},
- {"Unmatched }", 241},
- {"%c%s missing close brace", 242},
- {"Broken-Type in insertion_type_pname", 243},
- {"Enumeration stack overflow", 244},
- {"lettering overflow, restarting at %c", 245},
- {"* Menu:\n", 246},
- {"%s requires an argument: the formatter for %citem", 247},
- {"`%cend' expected `%s', but saw `%s'", 248},
- {"No matching `%cend %s'", 249},
- {"How did @%s end up in cm_special_char?\n", 250},
- {"%c%s expects `i' or `j' as argument, not `%c'", 251},
- {"%c%s expects a single character `i' or `j' as argument", 252},
- {"January", 253},
- {"February", 254},
- {"March", 255},
- {"April", 256},
- {"May", 257},
- {"June", 258},
- {"July", 259},
- {"August", 260},
- {"September", 261},
- {"October", 262},
- {"November", 263},
- {"December", 264},
- {"%c%s expects a single character as an argument", 265},
- {"%c%s is obsolete", 266},
- {"Node with %ctop as a section already exists", 267},
- {"Here is the %ctop node", 268},
- {"%ctop used before %cnode, defaulting to %s", 269},
- {"%c%s is obsolete; use %c%s instead", 270},
- {"Node `%s' multiply defined (line %d is first definition at)", 271},
- {"Formatting node %s...\n", 272},
- {"Node `%s' requires a sectioning command (e.g. %c%s)", 273},
- {"Node `%s''s Next field not pointed back to", 274},
- {"This node (`%s') is the one with the bad `Prev'", 275},
- {"Node `%s's Prev field not pointed back to", 276},
- {"This node (`%s') has the bad Next", 277},
- {"Node `%s' missing Up field", 278},
- {"`%s' has an Up field of `%s', but `%s' has no menu item for `%s'", 279},
- {"node `%s' has been referenced %d times", 280},
- {"unreferenced node `%s'", 281},
- {"%s reference to nonexistent node `%s'", 282},
- {"%cmenu seen before first node", 283},
- {"creating `Top' node", 284},
- {"`.' or `,' must follow cross reference, not %c", 285},
- {"@image file `%s' unreadable: %s", 286},
- {"@image missing filename argument", 287},
- {"%s requires letter or digit", 288},
- {"Unmatched `%c%s'", 289},
- {"`%c%s' needs something after it", 290},
- {"Bad argument to `%s', `%s', using `%s'", 291},
- {"{No Value For \"%s\"}", 292},
- {"%c%s requires a name", 293},
- {"Reached eof before matching @end %s", 294},
- {"The `%c%s' command is meaningless within a `@%s' block", 295},
- {"%citemx is not meaningful inside of a `%s' block", 296},
- {"%c%s found outside of an insertion block", 297},
- {"Missing `}' in %cdef arg", 298},
- {"Function", 299},
- {"Macro", 300},
- {"Special Form", 301},
- {"Variable", 302},
- {"User Option", 303},
- {"Instance Variable", 304},
- {"Method", 305},
- {"Must be in a `%s' insertion in order to use `%s'x", 306},
- {"%csp requires a positive numeric argument", 307},
- {"asis", 308},
- {"none", 309},
- {"Bad argument to %c%s", 310},
- {"Unknown index `%s'", 311},
- {"Index `%s' already exists", 312},
- {"Unknown index `%s' and/or `%s' in @synindex", 313},
- {"Unknown index `%s' in @printindex", 314},
- {"\
-* Menu:\n\
-\n", 315},
- {"`%c%s' needs an argument `{...}', not just `%s'", 316},
- {"No closing brace for footnote `%s'", 317},
- {"Footnote defined without parent node", 318},
- {"-Footnotes", 319},
- {"\
----------- Footnotes ----------\n\
-\n", 320},
- {"macro `%s' previously defined", 321},
- {"here is the previous definition of `%s'", 322},
- {"Macro `%s' called with too many args", 323},
- {"%cend macro not found", 324},
- {"%cquote-arg only useful when the macro takes a single argument", 325},
- {"ignoring stray text `%s' after @multitable", 326},
- {"Too many columns in multitable item (max %d)", 327},
- {"multitable item not in active multitable", 328},
- {"Cannot select column #%d in multitable", 329},
- {"ignoring @tab outside of multitable", 330},
- {"** Multicolumn output from last row:\n", 331},
- {"* column #%d: output = %s\n", 332},
- {"virtual memory exhausted", 333},
- {"%s: warning: ", 334},
- {" for %s", 335},
- {"\tTry `%s --help' for a complete list of options.\n", 336},
- {"\
-Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
-\n\
-Install INFO-FILE in the Info directory file DIR-FILE.\n\
-\n\
-Options:\n\
---delete Delete existing entries in INFO-FILE;\n\
- don't insert any new entries.\n\
---dir-file=NAME Specify file name of Info directory file.\n\
- This is equivalent to using the DIR-FILE argument.\n\
---entry=TEXT Insert TEXT as an Info directory entry.\n\
- TEXT should have the form of an Info menu item line\n\
- plus zero or more extra lines starting with whitespace.\n\
- If you specify more than one entry, they are all added.\n\
- If you don't specify any entries, they are determined\n\
- from information in the Info file itself.\n\
---help Display this help and exit.\n\
---info-file=FILE Specify Info file to install in the directory.\n\
- This is equivalent to using the INFO-FILE argument.\n\
---info-dir=DIR Same as --dir-file=DIR/dir.\n\
---item=TEXT Same as --entry TEXT.\n\
- An Info directory entry is actually a menu item.\n\
---quiet Suppress warnings.\n\
---remove Same as --delete.\n\
---section=SEC Put this file's entries in section SEC of the directory.\n\
- If you specify more than one section, all the entries\n\
- are added in each of the sections.\n\
- If you don't specify any sections, they are determined\n\
- from information in the Info file itself.\n\
---version Display version information and exit.\n\
-\n\
-Email bug reports to bug-texinfo@gnu.org.\n", 337},
- {"\
-This is the file .../info/dir, which contains the\n\
-topmost node of the Info hierarchy, called (dir)Top.\n\
-The first time you invoke Info you start off looking at this node.\n\
-\n\
-File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
-\n\
- This (the Directory node) gives a menu of major topics.\n\
- Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
- \"h\" gives a primer for first-timers,\n\
- \"mEmacs<Return>\" visits the Emacs manual, etc.\n\
-\n\
- In Emacs, you can click mouse button 2 on a menu item or cross reference\n\
- to select it.\n\
-\n\
-* Menu:\n", 338},
- {"%s: could not read (%s) and could not create (%s)\n", 339},
- {"%s: Specify the Info directory only once.\n", 340},
- {"%s: Specify the Info file only once.\n", 341},
- {"excess command line argument `%s'", 342},
- {"No input file specified; try --help for more information.", 343},
- {"No dir file specified; try --help for more information.", 344},
- {"START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY", 345},
- {"END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY", 346},
- {"no info dir entry in `%s'", 347},
- {"menu item `%s' already exists, for file `%s'", 348},
- {"no entries found for `%s'; nothing deleted", 349},
- {"keep temporary files around after processing", 350},
- {"do not keep temporary files around after processing (default)", 351},
- {"send output to FILE", 352},
- {"display version information and exit", 353},
- {"display this help and exit", 354},
- {"Usage: %s [OPTION]... FILE...\n", 355},
- {"Generate a sorted index for each TeX output FILE.\n", 356},
- {"Usually FILE... is `foo.??' for a document `foo.texi'.\n", 357},
- {"\
-\n\
-Options:\n", 358},
- {"\
-\n\
-Email bug reports to bug-texinfo@gnu.org.", 359},
- {"%s: not a texinfo index file", 360},
- {"failure reopening %s", 361},
- {"entry %s follows an entry with a secondary name", 362},
- {"%s; for file `%s'.\n", 363},
- {"Virtual memory exhausted in %s ()! Needed %d bytes.", 364},
-};
-
-int _msg_tbl_length = 364;
diff --git a/contrib/texinfo/po/de.gmo b/contrib/texinfo/po/de.gmo
deleted file mode 100644
index 5636eb828b2e..000000000000
--- a/contrib/texinfo/po/de.gmo
+++ /dev/null
Binary files differ
diff --git a/contrib/texinfo/po/de.po b/contrib/texinfo/po/de.po
deleted file mode 100644
index 081cce67a6a0..000000000000
--- a/contrib/texinfo/po/de.po
+++ /dev/null
@@ -1,2089 +0,0 @@
-# German messages for GNU Texinfo
-# Copyright © 1996, 1997, 1998 Free Software Foundation, Inc.
-# Karl Eichwalder <ke@ke.Central.DE>, 1996.
-# Karl Eichwalder <ke@SuSE.DE>, 1997,1998.
-#
-# 1998-02-28 14:29:49 MET
-# Revised for 3.11b
-# I refuse to translate getopt.c strings
-# -ke-
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: texinfo 3.11\n"
-"POT-Creation-Date: 1998-03-03 13:32-0500\n"
-"PO-Revision-Date: 1998-02-28 14:32+01:00\n"
-"Last-Translator: Karl Eichwalder <ke@SuSE.DE>\n"
-"Language-Team: German <de@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8-bit\n"
-
-#. ****************************************************************
-#.
-#. Echo Area Movement Commands
-#.
-#. ****************************************************************
-#: info/echo-area.c:283 info/session.c:698
-msgid "Move forward a character"
-msgstr "Ein Zeichen vorwärts bewegen"
-
-#. Move point backward in the node.
-#: info/echo-area.c:295 info/session.c:714
-msgid "Move backward a character"
-msgstr "Ein Zeichen rückwärts bewegen"
-
-#: info/echo-area.c:307
-msgid "Move to the start of this line"
-msgstr "Zum Anfang dieser Zeile bewegen"
-
-#: info/echo-area.c:312
-msgid "Move to the end of this line"
-msgstr "Zum Ende dieser Zeile bewegen"
-
-#. Move forward a word in the input line.
-#: info/echo-area.c:320 info/session.c:732
-msgid "Move forward a word"
-msgstr "Ein Wort vorwärts bewegen"
-
-#: info/echo-area.c:360 info/session.c:781
-msgid "Move backward a word"
-msgstr "Ein Wort rückwärts bewegen"
-
-#: info/echo-area.c:400
-msgid "Delete the character under the cursor"
-msgstr "Das Zeichen unter dem Cursor löschen"
-
-# checkit
-#: info/echo-area.c:430
-msgid "Delete the character behind the cursor"
-msgstr "Das Zeichen hinter dem Cursor löschen"
-
-#: info/echo-area.c:451
-msgid "Cancel or quit operation"
-msgstr "Operation abbrechen oder beenden"
-
-#: info/echo-area.c:466
-msgid "Accept (or force completion of) this line"
-msgstr "Akzeptiere diese Zeile (oder erzwinge ihre Vervollständigung)"
-
-#: info/echo-area.c:471
-msgid "Insert next character verbatim"
-msgstr "Das nächste Zeichen wörtlich eingeben"
-
-#: info/echo-area.c:479
-msgid "Insert this character"
-msgstr "Dieses Zeichen eingeben"
-
-# checkit
-#: info/echo-area.c:497
-msgid "Insert a TAB character"
-msgstr "Ein TAB-Zeichen eingeben"
-
-#. Transpose the characters at point. If point is at the end of the line,
-#. then transpose the characters before point.
-#: info/echo-area.c:504
-msgid "Transpose characters at point"
-msgstr "Zeichen am Point umstellen"
-
-#: info/echo-area.c:555
-msgid "Yank back the contents of the last kill"
-msgstr "Füge den Inhalt des letzten Killens ein"
-
-# IMO muss "kill" auch im Folgenden wörtlich üs werden -ke-
-#: info/echo-area.c:562
-msgid "Kill ring is empty"
-msgstr "Der Kill-Ring ist leer"
-
-#. If the last command was yank, or yank_pop, and the text just before
-#. point is identical to the current kill item, then delete that text
-#. from the line, rotate the index down, and yank back some other text.
-#: info/echo-area.c:575
-msgid "Yank back a previous kill"
-msgstr "Füge ein vorangehendes Killen ein"
-
-#. Delete the text from point to end of line.
-#: info/echo-area.c:608
-msgid "Kill to the end of the line"
-msgstr "Bis zum Ende der Zeile killen"
-
-#: info/echo-area.c:621
-msgid "Kill to the beginning of the line"
-msgstr "Bis zum Anfang der Zeile killen"
-
-#. Delete from point to the end of the current word.
-#: info/echo-area.c:633
-msgid "Kill the word following the cursor"
-msgstr "Das dem Cursor folgende Wort killen"
-
-#: info/echo-area.c:652
-msgid "Kill the word preceding the cursor"
-msgstr "Das dem Cursor vorangehende Wort killen"
-
-# checkit
-#: info/echo-area.c:871
-msgid "Not complete"
-msgstr "Nicht vollständig"
-
-#: info/echo-area.c:916
-msgid "List possible completions"
-msgstr "Mögliche Vervollständigungen listen"
-
-#: info/echo-area.c:929
-msgid "No completions"
-msgstr "Keine Vervollständigungen"
-
-#: info/echo-area.c:933
-msgid "Sole completion"
-msgstr "Einzige Vervollständigung"
-
-#: info/echo-area.c:942
-msgid "One completion:\n"
-msgstr "Eine Vervollständigung:\n"
-
-#: info/echo-area.c:943
-#, c-format
-msgid "%d completions:\n"
-msgstr "%d Vervollständigungen:\n"
-
-#: info/echo-area.c:1088
-msgid "Insert completion"
-msgstr "Vervollständigung einfügen"
-
-#: info/echo-area.c:1221
-msgid "Building completions..."
-msgstr "Bilde Vervollständigungen..."
-
-# checkit
-#. Scroll the "other" window. If there is a window showing completions, scroll
-#. that one, otherwise scroll the window which was active on entering the read
-#. function.
-#: info/echo-area.c:1319
-msgid "Scroll the completions window"
-msgstr "Vervollständigungs-Fenster »scrollen«"
-
-#: info/footnotes.c:206
-msgid "Footnotes could not be displayed"
-msgstr "Fußnoten können nicht angezeigt werden"
-
-#: info/footnotes.c:232
-msgid "Show the footnotes associated with this node in another window"
-msgstr "Zeige die mit diesem Node verbundenen Fußnoten im anderen Fenster"
-
-#: info/indices.c:175
-msgid "Look up a string in the index for this file"
-msgstr "Sieh eine Zeichenkette im Index dieser Datei nach"
-
-#: info/indices.c:205
-msgid "Finding index entries..."
-msgstr "Suche Index-Einträge..."
-
-# checkit
-# oder sind "Einträge" gemeint? -ke-
-#: info/indices.c:212
-msgid "No indices found."
-msgstr "Keine Indices gefunden."
-
-#: info/indices.c:222
-msgid "Index entry: "
-msgstr "Index-Eintrag: "
-
-#: info/indices.c:332
-msgid ""
-"Go to the next matching index item from the last `\\[index-search]' command"
-msgstr ""
-"Geh zum nächsten übereinstimmenden Index-Eintrag vom letzten "
-"»\\[index-search]«-Befehl"
-
-#: info/indices.c:342
-msgid "No previous index search string."
-msgstr "Keine vorangehende zu suchende Index-Zeichenkette."
-
-#: info/indices.c:349
-msgid "No index entries."
-msgstr "Keine Index-Einträge."
-
-# checkit
-# kann im Deutschen nachgebildet werden, aber... -ke-
-#: info/indices.c:382
-#, c-format
-msgid "No %sindex entries containing \"%s\"."
-msgstr "Keine %sIndex-Einträge beinhalten »%s«."
-
-#: info/indices.c:383
-msgid "more "
-msgstr "weiteren "
-
-#: info/indices.c:393
-msgid "CAN'T SEE THIS"
-msgstr "DIES IST NICHT ZU SEHEN"
-
-#: info/indices.c:429
-#, c-format
-msgid "Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"
-msgstr ""
-"»%s« in %s gefunden. (»\\[next-index-match]« versucht nächsten Eintrag zu "
-"finden.)"
-
-#: info/indices.c:533
-#, c-format
-msgid "Scanning indices of \"%s\"..."
-msgstr "Index von »%s« wird durchsucht..."
-
-#: info/indices.c:616
-msgid "Grovel all known info file's indices for a string and build a menu"
-msgstr ""
-"Durchsuche durch alle bekannten Info-Datei-Indices nach einer Zeichenkette "
-"und bilde ein Menü"
-
-#: info/indices.c:620
-msgid "Index apropos: "
-msgstr "Index apropos: "
-
-#: info/indices.c:650
-#, c-format
-msgid ""
-"\n"
-"* Menu: Nodes whoses indices contain \"%s\":\n"
-msgstr ""
-"\n"
-"* Menü: Nodes, deren Indices »%s« beinhalten:\n"
-
-#: info/info.c:212
-msgid "Try --help for more information."
-msgstr "»--help« gibt weitere Informationen."
-
-# Hier de-Standard-Formulierung einsetzen!
-#: info/info.c:231 makeinfo/makeinfo.c:1089 util/install-info.c:530
-#: util/texindex.c:338
-#, c-format
-msgid ""
-"Copyright (C) %s Free Software Foundation, Inc.\n"
-"There is NO warranty. You may redistribute this software\n"
-"under the terms of the GNU General Public License.\n"
-"For more information about these matters, see the files named COPYING.\n"
-msgstr ""
-"Copyright © %s Free Software Foundation, Inc.\n"
-"Dies ist freie Software; in den Quellen befindet sich die Lizenz- und\n"
-"Kopierbedingung. Es gibt KEINERLEI Garantie, nicht einmal für die\n"
-"TAUGLICHKEIT oder die VERWENDBARKEIT ZU EINEM ANGEGEBENEN ZWECK.\n"
-
-#: info/info.c:363
-msgid "no entries found\n"
-msgstr "Keine Einträge gefunden\n"
-
-#: info/info.c:406
-msgid "There is no menu in this node."
-msgstr "Es gibt kein Menü in diesem Node."
-
-#: info/info.c:437
-#, c-format
-msgid "There is no menu item \"%s\" in this node."
-msgstr "Es gibt keinen Menüpunkt »%s« in diesem Node."
-
-#: info/info.c:501
-#, c-format
-msgid "Unable to find the node referenced by \"%s\"."
-msgstr "Kann keinen von »%s« referenzierten Node finden."
-
-#: info/info.c:602
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n"
-"\n"
-"Read documentation in Info format.\n"
-"For more complete documentation on how to use Info, run `info info "
-"options'.\n"
-"\n"
-"Options:\n"
-"--directory DIR add DIR to INFOPATH.\n"
-"--dribble FILENAME remember user keystrokes in FILENAME.\n"
-"--file FILENAME specify Info file to visit.\n"
-"--node NODENAME specify nodes in first visited Info file.\n"
-"--output FILENAME output selected nodes to FILENAME.\n"
-"--restore FILENAME read initial keystrokes from FILENAME.\n"
-"--subnodes recursively output menu items.\n"
-"--help display this help and exit.\n"
-"--version display version information and exit.\n"
-"\n"
-"The first argument, if present, is the name of the Info file to read.\n"
-"Any remaining arguments are treated as the names of menu\n"
-"items in the initial node visited. For example, `info emacs buffers'\n"
-"moves to the node `buffers' in the info file `emacs'.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-"Syntax: %s [OPTION]... [INFO-DATEI [MENU-EINTRAG...]]\n"
-"\n"
-"Um Dokumentation zu lesen, die im Info-Format vorliegt.\n"
-"Für eine ausführlichere Anleitung, wie Info zu benutzen ist, »info info\n"
-"options« eingeben.\n"
-"\n"
-"Optionen:\n"
-" --directory VERZ VERZ zu INFOPATH hinzufügen\n"
-" --dribble DATEI Tasteneingaben des Benutzers in DATEI merken\n"
-" --file DATEI zu besuchende Info-DATEI angeben\n"
-" --node KNOTEN Knoten in der ersten zu besuchenden Info-Datei "
-"angeben\n"
-" --output DATEI ausgewählte Knoten nach DATEI ausgeben\n"
-" --restore DATEI die beginnenden Tasteneingaben von DATEI lesen\n"
-" --subnodes Menüpunkte rekursiv ausgeben\n"
-" --help diese Hilfe anzeigen\n"
-" --version Programmversion anzeigen\n"
-"\n"
-"Verbleibende Parameter werden als Namen von Menüpunkten des zuerst "
-"besuchten\n"
-"Knotens angesehen. Man kann sich einfach zum gewünschten Knoten bewegen,\n"
-"indem man die Namen der Menüpunkte angibt, die den Weg dorthin bezeichnen;\n"
-"z. B. »info emacs buffers«.\n"
-"\n"
-"Fehler (\"bugs\") bitte an <bug-texinfo@gnu.org> melden.<\n"
-"\n"
-"Für die deutsche Übersetzung ist die Mailingliste <de@li.org> zuständig."
-
-#: info/infodoc.c:50
-msgid "Basic Commands in Info Windows"
-msgstr "Grundbefehle in Info-Fenstern"
-
-#: info/infodoc.c:211
-msgid ""
-"The following commands can only be invoked via M-x:\n"
-"\n"
-msgstr "Die folgenden Befehle können nur via M-x aufgerufen werden:\n"
-
-#: info/infodoc.c:228
-msgid "--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"
-msgstr ""
-"--- »\\[history-node]« oder »\\[kill-node]« benutzen, um zu beenden ---\n"
-
-#. Create or move to the help window.
-#: info/infodoc.c:328
-msgid "Display help message"
-msgstr "Diesen Hilfe-Text anzeigen"
-
-#. Show the Info help node. This means that the "info" file is installed
-#. where it can easily be found on your system.
-#: info/infodoc.c:346
-msgid "Visit Info node `(info)Help'"
-msgstr "Info-Node »(info)Help« besuchen"
-
-#: info/infodoc.c:470
-msgid "Print documentation for KEY"
-msgstr "Dokumentation für KEY ausgeben"
-
-#: info/infodoc.c:483
-#, c-format
-msgid "Describe key: %s"
-msgstr "Beschreibe Taste: %s"
-
-#: info/infodoc.c:492
-#, c-format
-msgid "ESC %s is undefined."
-msgstr "ESC %s ist nicht definiert."
-
-#: info/infodoc.c:509
-#, c-format
-msgid "%s is undefined."
-msgstr "%s ist nicht definiert."
-
-#: info/infodoc.c:535
-#, c-format
-msgid "%s is defined to %s."
-msgstr "%s ist definiert als %s."
-
-#: info/infodoc.c:731
-msgid "Where is command: "
-msgstr "Wo ist der Befehl: "
-
-#: info/infodoc.c:753
-#, c-format
-msgid "`%s' is not on any keys"
-msgstr "»%s« liegt auf keiner Taste"
-
-#: info/infodoc.c:759
-#, c-format
-msgid "%s can only be invoked via %s."
-msgstr "%s kann nur via %s aufgerufen werden."
-
-#: info/infodoc.c:762
-#, c-format
-msgid "%s can be invoked via %s."
-msgstr "%s kann via %s aufgerufen werden."
-
-#: info/infodoc.c:766
-#, c-format
-msgid "There is no function named `%s'"
-msgstr "Es gibt keine Funktion mit Namen »%s«"
-
-#: info/m-x.c:69
-msgid "Read the name of an Info command and describe it"
-msgstr "Lese den Namen eines Info-Befehls und beschreibe ihn"
-
-#: info/m-x.c:73
-msgid "Describe command: "
-msgstr "Beschreibe den Befehl: "
-
-#: info/m-x.c:96
-msgid "Read a command name in the echo area and execute it"
-msgstr "Lies einen Befehlsnamen in der »Echo-Area« und führe ihn aus"
-
-#: info/m-x.c:134
-msgid "Cannot execute an `echo-area' command here."
-msgstr "Kann hier keinen »echo-area«-Befehl ausführen."
-
-#: info/m-x.c:150
-msgid "Set the height of the displayed window"
-msgstr "Setze die Höhe des angezeigten Fensters"
-
-# checkit
-#: info/m-x.c:163
-#, c-format
-msgid "Set screen height to (%d): "
-msgstr "Bildschirm-Höhe auf (%d) setzen: "
-
-# checkit
-#: info/makedoc.c:126
-msgid ""
-" Source files groveled to make this file include:\n"
-"\n"
-msgstr ""
-" Quelldatei \"groveled\", damit diese Datei enthält:\n"
-"\n"
-
-#: info/makedoc.c:450
-#, c-format
-msgid "Couldn't manipulate the file %s.\n"
-msgstr "Datei »%s« ist nicht zu verändern.\n"
-
-#: info/nodemenu.c:28
-msgid ""
-"\n"
-"* Menu:\n"
-" (File)Node Lines Size Containing File\n"
-" ---------- ----- ---- ---------------"
-msgstr ""
-"\n"
-"* Menü:\n"
-" (Datei)Knoten Zeilen Größe Beinhaltet Datei\n"
-" ------------- ------ ----- ----------------"
-
-#: info/nodemenu.c:197
-msgid ""
-"Here is the menu of nodes you have recently visited.\n"
-"Select one from this menu, or use `\\[history-node]' in another window.\n"
-msgstr ""
-"Hier ist das Menü der Knoten, die zuetzt besucht wurden.\n"
-"Einen von diesem Menü auswählen oder »\\[history-node]« im anderen Fenster\n"
-"benutzen.\n"
-
-#: info/nodemenu.c:217
-msgid "Make a window containing a menu of all of the currently visited nodes"
-msgstr ""
-"Veranlassen, dass ein Fenster ein Menü aller aktuell besuchten Knoten enthält"
-
-#: info/nodemenu.c:297
-msgid "Select a node which has been previously visited in a visible window"
-msgstr ""
-"Einen Knoten auswählen, der zuvor in einem sichtbaren Fenster besucht wurde"
-
-#: info/nodemenu.c:309
-msgid "Select visited node: "
-msgstr "Besuchten Knoten auswählen: "
-
-#: info/nodemenu.c:329 info/session.c:1996
-#, c-format
-msgid "The reference disappeared! (%s)."
-msgstr "Der Verweispunkt ist verschwunden! (%s)."
-
-#: info/session.c:162
-#, c-format
-msgid ""
-"Welcome to Info version %s. \"\\[get-help-window]\" for help, "
-"\"\\[menu-item]\" for menu item."
-msgstr ""
-"Willkommen bei Info Version %s. \"\\[get-help-window]\" um Hilfe zu "
-"bekommen,\n"
-"mit \"\\[menu-item]\" Menüpunkt anzeigen."
-
-#. Move WINDOW's point down to the next line if possible.
-#: info/session.c:629
-msgid "Move down to the next line"
-msgstr "Eine Zeile nach unten bewegen"
-
-#. Move WINDOW's point up to the previous line if possible.
-#: info/session.c:644
-msgid "Move up to the previous line"
-msgstr "Eine Zeile nach oben bewegen"
-
-#. Move WINDOW's point to the end of the true line.
-#: info/session.c:659
-msgid "Move to the end of the line"
-msgstr "Zum Ende dieser Zeile bewegen"
-
-#. Move WINDOW's point to the beginning of the true line.
-#: info/session.c:679
-msgid "Move to the start of the line"
-msgstr "Zum Anfang der Zeile bewegen"
-
-#: info/session.c:855
-msgid " times"
-msgstr "mal"
-
-#: info/session.c:857
-#, c-format
-msgid "%d times"
-msgstr "%d mal"
-
-#: info/session.c:895
-msgid "No \"Next\" pointer for this node."
-msgstr "Kein »Next«-Verweis bei diesem Knoten."
-
-#: info/session.c:898
-msgid "Following \"Next\" node..."
-msgstr "»Next«-Knoten folgend..."
-
-# checkit
-# üs? -ke-
-#: info/session.c:899 info/session.c:927 info/session.c:999
-#: info/session.c:1717
-msgid "Next"
-msgstr ""
-
-#: info/session.c:915
-msgid "Selecting first menu item..."
-msgstr "Ersten Menüpunkt auswählen..."
-
-# checkit
-#: info/session.c:926
-msgid "Selecting \"Next\" node..."
-msgstr "Den Knoten \"Next\" auswählen..."
-
-# checkit
-# üs? -ke-
-#: info/session.c:950 info/session.c:1063 info/session.c:1733
-msgid "Up"
-msgstr ""
-
-#: info/session.c:1020
-msgid "No more nodes."
-msgstr "Keine \"Nodes\" mehr"
-
-#: info/session.c:1044
-msgid "No \"Prev\" for this node."
-msgstr "Kein »Prev« bei diesem Knoten."
-
-# checkit
-#. Move to the previous node. If this node now contains a menu,
-#. and we have not inhibited movement to it, move to the node
-#. corresponding to the last menu item.
-#: info/session.c:1047 info/session.c:1100
-msgid "Moving \"Prev\" in this window."
-msgstr "Nach »Prev« in diesem Fenster bewegen."
-
-# checkit
-# üs? -ke-
-#: info/session.c:1048 info/session.c:1101 info/session.c:1725
-msgid "Prev"
-msgstr ""
-
-#: info/session.c:1059
-msgid "No \"Prev\" or \"Up\" for this node."
-msgstr "Kein »Prev« oder »Up« bei diesem Knoten."
-
-#: info/session.c:1062
-msgid "Moving \"Up\" in this window."
-msgstr "Nach »Up« in diesem Fenster bewegen."
-
-#: info/session.c:1110
-msgid "Moving to \"Prev\"'s last menu item."
-msgstr "Nach dem letzten Menüpunkt von »Prev« bewegen."
-
-#: info/session.c:1121
-msgid "Move forwards or down through node structure"
-msgstr "Vorwärts oder abwärts durch die Knotenstruktur bewegen"
-
-#: info/session.c:1137
-msgid "Move backwards or up through node structure"
-msgstr "Zurück oder aufwärts durch die Knotenstruktur bewegen"
-
-#. Show the next screen of WINDOW's node.
-#: info/session.c:1152
-msgid "Scroll forward in this window"
-msgstr "In diesem Fenster vorwärts »scrollen«"
-
-#. Show the previous screen of WINDOW's node.
-#: info/session.c:1197
-msgid "Scroll backward in this window"
-msgstr "In diesem Fenster rückwärts »scrollen«"
-
-#. Move to the beginning of the node.
-#: info/session.c:1237
-msgid "Move to the start of this node"
-msgstr "Zum Anfang dieses Knotens bewegen"
-
-#. Move to the end of the node.
-#: info/session.c:1244
-msgid "Move to the end of this node"
-msgstr "Zum Ende dieses Knotens bewegen"
-
-#. ****************************************************************
-#.
-#. Commands for Manipulating Windows
-#.
-#. ****************************************************************
-#. Make the next window in the chain be the active window.
-#: info/session.c:1257
-msgid "Select the next window"
-msgstr "Das nächste Fenster auswählen"
-
-#. Make the previous window in the chain be the active window.
-#: info/session.c:1296
-msgid "Select the previous window"
-msgstr "Das vorige Fenster auswählen"
-
-#. Split WINDOW into two windows, both showing the same node. If we
-#. are automatically tiling windows, re-tile after the split.
-#: info/session.c:1347
-msgid "Split the current window"
-msgstr "Aktuelles Fenster unterteilen"
-
-#. Delete WINDOW, forgetting the list of last visited nodes. If we are
-#. automatically displaying footnotes, show or remove the footnotes
-#. window. If we are automatically tiling windows, re-tile after the
-#. deletion.
-#: info/session.c:1428
-msgid "Delete the current window"
-msgstr "Aktuelles Fenster löschen"
-
-#: info/session.c:1436
-msgid "Cannot delete a permanent window"
-msgstr "Ein permanentes Fenster kann nicht gelöscht werden"
-
-#. Just keep WINDOW, deleting all others.
-#: info/session.c:1469
-msgid "Delete all other windows"
-msgstr "Alle anderen Fenster löschen"
-
-#. Scroll the "other" window of WINDOW.
-#: info/session.c:1515
-msgid "Scroll the other window"
-msgstr "Das andere Fenster »scrollen«"
-
-#. Change the size of WINDOW by AMOUNT.
-#: info/session.c:1535
-msgid "Grow (or shrink) this window"
-msgstr "Aktuelles Fenster vergrößern (oder verkleinern)"
-
-#: info/session.c:1546
-msgid "Divide the available screen space among the visible windows"
-msgstr ""
-"Den vorhandenen Bildschirmplatz unter allen sichtbaren Fenstern aufteilen"
-
-#: info/session.c:1553
-msgid "Toggle the state of line wrapping in the current window"
-msgstr "Den Status des Zeilenumbruchs im aktuellen Fenster umschalten"
-
-#. Make WINDOW display the "Next:" node of the node currently being
-#. displayed.
-#: info/session.c:1714
-msgid "Select the `Next' node"
-msgstr "Den »Next«-Knoten auswählen"
-
-#. Make WINDOW display the "Prev:" node of the node currently being
-#. displayed.
-#: info/session.c:1722
-msgid "Select the `Prev' node"
-msgstr "Den »Prev«-Knoten auswählen"
-
-#. Make WINDOW display the "Up:" node of the node currently being
-#. displayed.
-#: info/session.c:1730
-msgid "Select the `Up' node"
-msgstr "Den »Up«-Knoten auswählen"
-
-#. Make WINDOW display the last node of this info file.
-#: info/session.c:1737
-msgid "Select the last node in this file"
-msgstr "Den letzten Knoten dieser Datei auswählen"
-
-# checkit
-#: info/session.c:1750 info/session.c:1768
-msgid "This window has no additional nodes"
-msgstr "Dies Fenster hat keine weiteren Knoten"
-
-#. Make WINDOW display the first node of this info file.
-#: info/session.c:1759
-msgid "Select the first node in this file"
-msgstr "Den ersten Knoten dieser Datei auswählen"
-
-#: info/session.c:1778
-msgid "Select the last item in this node's menu"
-msgstr "Den letzten Punkt des Menüs dieses Knotens auswählen"
-
-#. Use KEY (a digit) to select the Nth menu item in WINDOW->node.
-#: info/session.c:1784
-msgid "Select this menu item"
-msgstr "Diesen Menüpunkt auswählen"
-
-#: info/session.c:1813
-#, c-format
-msgid "There aren't %d items in this menu."
-msgstr "Es sind keine %d Punkte in diesem Menü."
-
-#: info/session.c:1944
-#, c-format
-msgid "Menu item (%s): "
-msgstr "Menüpunkt (%s): "
-
-#: info/session.c:1946
-msgid "Menu item: "
-msgstr "Menüpunkt: "
-
-#: info/session.c:1951
-#, c-format
-msgid "Follow xref (%s): "
-msgstr "Folge xref (%s): "
-
-#: info/session.c:1953
-msgid "Follow xref: "
-msgstr "Folge xref: "
-
-#. Read a line (with completion) which is the name of a menu item,
-#. and select that item.
-#: info/session.c:2042
-msgid "Read a menu item and select its node"
-msgstr "Einen Menüpunkt lesen und seinen Knoten auswählen"
-
-#: info/session.c:2050
-msgid "Read a footnote or cross reference and select its node"
-msgstr "Fußnote oder Querverweis lesen und den Konote auswählen"
-
-#. Position the cursor at the start of this node's menu.
-#: info/session.c:2056
-msgid "Move to the start of this node's menu"
-msgstr "Zum Anfang des Menüs dieses Knotens bewegen"
-
-#: info/session.c:2080
-msgid "Visit as many menu items at once as possible"
-msgstr "So viele Menüpunkte wie möglich auf einmal besuchen"
-
-#. Read a line of input which is a node name, and go to that node.
-#: info/session.c:2108
-msgid "Read a node name and select it"
-msgstr "Den Namen eines Knotens lesen und diesen auswählen"
-
-#: info/session.c:2169 info/session.c:2173
-msgid "Goto Node: "
-msgstr "Gehe nach Knoten: "
-
-#: info/session.c:2194
-msgid "Read a manpage reference and select it"
-msgstr "Einen Verweis auf eine Manpage lesen und diese auswählen"
-
-#: info/session.c:2198
-msgid "Get Manpage: "
-msgstr "Hole Manpage: "
-
-#. Move to the "Top" node in this file.
-#: info/session.c:2228
-msgid "Select the node `Top' in this file"
-msgstr "Den Knoten »Top« dieser Datei auswählen"
-
-#. Notice that the node "Top" is special, and doesn't have to
-#. be referenced.
-#: info/session.c:2230 makeinfo/makeinfo.c:5145 makeinfo/makeinfo.c:5228
-msgid "Top"
-msgstr "Top"
-
-#. Move to the node "(dir)Top".
-#: info/session.c:2234
-msgid "Select the node `(dir)'"
-msgstr "Den Knoten »(dir)« auswählen"
-
-#: info/session.c:2254
-#, c-format
-msgid "Kill node (%s): "
-msgstr "Kille Knoten (%s): "
-
-#: info/session.c:2307
-#, c-format
-msgid "Cannot kill node `%s'"
-msgstr "Kann Knoten »%s« nicht killen"
-
-#: info/session.c:2317
-msgid "Cannot kill the last node"
-msgstr "Der letzte Knoten kann nicht gekillt werden"
-
-#: info/session.c:2401
-msgid "Select the most recently selected node"
-msgstr "Den zuletzt gewählten Knoten auswählen"
-
-#. Kill named node.
-#: info/session.c:2407
-msgid "Kill this node"
-msgstr "Diesen Knoten killen"
-
-#. Read the name of a file and select the entire file.
-#: info/session.c:2415
-msgid "Read the name of a file and select it"
-msgstr "Den Namen einer Datei lesen und diese auswählen"
-
-#: info/session.c:2419
-msgid "Find file: "
-msgstr "Datei finden: "
-
-#: info/session.c:2436
-#, c-format
-msgid "Cannot find \"%s\"."
-msgstr "Kann »%s« nicht finden."
-
-#: info/session.c:2483 info/session.c:2608
-#, c-format
-msgid "Could not create output file \"%s\"."
-msgstr "Ausgabe-Datei »%s« kann nicht angelegt werden."
-
-#: info/session.c:2496 info/session.c:2625 info/session.c:2671
-msgid "Done."
-msgstr "Fertig."
-
-#: info/session.c:2553
-#, c-format
-msgid "Writing node \"(%s)%s\"..."
-msgstr "Schreibe Knoten (%s)%s"
-
-#: info/session.c:2556
-#, c-format
-msgid "Writing node \"%s\"..."
-msgstr "Knoten »%s« schreiben..."
-
-#: info/session.c:2634
-msgid "Pipe the contents of this node through INFO_PRINT_COMMAND"
-msgstr "Den Inhalt dieses Knotens durch INFO_PRINT_COMMAND pipen"
-
-#: info/session.c:2654
-#, c-format
-msgid "Cannot open pipe to \"%s\"."
-msgstr "Kann nicht nach »%s« pipen."
-
-#: info/session.c:2661
-#, c-format
-msgid "Printing node \"(%s)%s\"..."
-msgstr "Drucke Knoten »(%s)%s«..."
-
-#: info/session.c:2664
-#, c-format
-msgid "Printing node \"%s\"..."
-msgstr "Drucke Knoten »%s«..."
-
-#: info/session.c:2896
-#, c-format
-msgid "Searching subfile \"%s\"..."
-msgstr "Unterdatei »%s« wird durchsucht..."
-
-#: info/session.c:2946
-msgid "Read a string and search for it"
-msgstr "Eine Zeichenkette einlesen und danach suchen"
-
-# checkit
-#: info/session.c:2966
-#, c-format
-msgid "%s for string [%s]: "
-msgstr "%s nach Zeichenkette [%s]: "
-
-#: info/session.c:2967
-msgid "Search backward"
-msgstr "Suche rückwärts"
-
-#: info/session.c:2967
-msgid "Search"
-msgstr "Suche"
-
-#: info/session.c:2994
-msgid "Search failed."
-msgstr "Suche fehlgeschlagen."
-
-#: info/session.c:3020 info/session.c:3026
-msgid "Search interactively for a string as you type it"
-msgstr "Interaktiv nach einer Zeichenkette während der Eingabe suchen"
-
-#: info/session.c:3120
-msgid "I-search backward: "
-msgstr "Interactive Suche rückwarts: "
-
-#: info/session.c:3122
-msgid "I-search: "
-msgstr "Interactive Suche"
-
-# checkit
-#: info/session.c:3147
-msgid "Failing "
-msgstr "Fehlgeschlagen "
-
-#: info/session.c:3512
-msgid "No cross references in this node."
-msgstr "Keine Querverweise in diesem Knoten."
-
-#: info/session.c:3579
-msgid "Move to the previous cross reference"
-msgstr "Zum vorigen Querverweis bewegen"
-
-#: info/session.c:3588
-msgid "Move to the next cross reference"
-msgstr "Zum nächsten Querverweis bewegen"
-
-#: info/session.c:3598
-msgid "Select reference or menu item appearing on this line"
-msgstr "Verweis oder Menüpunkt auswählen, der auf dieser Zeile erscheint"
-
-# checkit
-#. ****************************************************************
-#.
-#. Miscellaneous Info Commands
-#.
-#. ****************************************************************
-#. What to do when C-g is pressed in a window.
-#: info/session.c:3620
-msgid "Cancel current operation"
-msgstr "Momentane Operation abbrechen"
-
-#: info/session.c:3627
-msgid "Quit"
-msgstr "Ende"
-
-#: info/session.c:3636
-msgid "Move to the cursor to a specific line of the window"
-msgstr "Den Cursor nach einer bestimmten Zeile des Fensters bewegen"
-
-#. Clear the screen and redraw its contents. Given a numeric argument,
-#. move the line the cursor is on to the COUNT'th line of the window.
-#: info/session.c:3668
-msgid "Redraw the display"
-msgstr "Anzeige erneut darstellen"
-
-#. This command does nothing. It is the fact that a key is bound to it
-#. that has meaning. See the code at the top of info_session ().
-#: info/session.c:3705
-msgid "Quit using Info"
-msgstr "Info beenden"
-
-#: info/session.c:3728
-#, c-format
-msgid "Unknown command (%s)."
-msgstr "Unbekannter Befehl (%s)."
-
-#: info/session.c:3733
-msgid "\"\" is invalid"
-msgstr "\"\" ist ungültig"
-
-#: info/session.c:3735
-#, c-format
-msgid "\"%s\" is invalid"
-msgstr "\"%s\" ist ungültig"
-
-#: info/session.c:3958
-msgid "Add this digit to the current numeric argument"
-msgstr "Diese Zahl dem aktuellen numerischen Argument hinzufügen"
-
-#: info/session.c:3967
-msgid "Start (or multiply by 4) the current numeric argument"
-msgstr "Beginne (oder multipliziere mit 4) das aktuelle nummerische Argument"
-
-#: info/session.c:3982
-msgid "Internally used by \\[universal-argument]"
-msgstr "Intern gebraucht von \\[universal-argument]"
-
-#: info/tilde.c:362
-msgid "readline: Out of virtual memory!\n"
-msgstr "readline: Kein Speicher mehr!\n"
-
-#: info/variables.c:40
-msgid "When \"On\", footnotes appear and disappear automatically"
-msgstr "Wenn »On«, dann erscheinen und verschwinden Fußnoten automatisch"
-
-#: info/variables.c:44
-msgid "When \"On\", creating or deleting a window resizes other windows"
-msgstr ""
-"Wenn »On«, dann werden beim Anlegen oder Löschen eines Fensters die anderen "
-"Fenster angepasst"
-
-#: info/variables.c:48
-msgid "When \"On\", flash the screen instead of ringing the bell"
-msgstr "Wenn »On«, dann den Bildschirm blinken lassen, kein akustisches Signal"
-
-#: info/variables.c:52
-msgid "When \"On\", errors cause the bell to ring"
-msgstr "Wenn »On«, dann lassen Fehler ein akustisches Signal ertönen"
-
-# checkit
-#: info/variables.c:56
-msgid "When \"On\", Info garbage collects files which had to be uncompressed"
-msgstr ""
-"Wenn »On«, Info \"garbage collectet\" Dateien, die ausgepackt werden müssen"
-
-#: info/variables.c:59
-msgid "When \"On\", the portion of the matched search string is highlighted"
-msgstr ""
-"Wenn »On«, die übereinstimmende gefundene Zeichenkette wird gekennzeichnet"
-
-#: info/variables.c:63
-msgid "Controls what happens when scrolling is requested at the end of a node"
-msgstr ""
-"Kontrolliert, was passiert, wenn »scrollen« am Ende eines Knotens veranlasst "
-"wird"
-
-#: info/variables.c:67
-msgid "The number lines to scroll when the cursor moves out of the window"
-msgstr ""
-"Anzahl der Zeilen zu »scrollen«, wenn der Cursor aus dem Fenster bewegt wird"
-
-#: info/variables.c:71
-msgid "When \"On\", Info accepts and displays ISO Latin characters"
-msgstr "Wenn »On«, dann akzeptiert Info ISO-Latin-Zeichen und zeigt diese an"
-
-#: info/variables.c:77
-msgid "Explain the use of a variable"
-msgstr "Den Zweck einer Variablen erklären"
-
-#. Get the variable's name.
-#: info/variables.c:83
-msgid "Describe variable: "
-msgstr "Beschreibe Variable: "
-
-#: info/variables.c:102
-msgid "Set the value of an Info variable"
-msgstr "Den Wert einer Info-Variablen setzen"
-
-#. Get the variable's name and value.
-#: info/variables.c:108
-msgid "Set variable: "
-msgstr "Setze Variable: "
-
-#: info/variables.c:126
-#, c-format
-msgid "Set %s to value (%d): "
-msgstr "Setze %s auf den Wert (%d): "
-
-#: info/variables.c:167
-#, c-format
-msgid "Set %s to value (%s): "
-msgstr "Setze %s auf den Wert (%s): "
-
-#: info/window.c:1102
-msgid "--*** Tags out of Date ***"
-msgstr "--*** Tags veraltet ***"
-
-#. strlen (location_indicator).
-#. 10 for the decimal representation of the number of lines in this
-#. node, and the remainder of the text that can appear in the line.
-#: info/window.c:1113
-msgid "-----Info: (), lines ----, "
-msgstr "-----Info: (), Zeilen ----, "
-
-#: info/window.c:1120
-#, c-format
-msgid "-%s---Info: %s, %d lines --%s--"
-msgstr "-%s---Info: %s, %d Zeilen --%s--"
-
-#: info/window.c:1124
-#, c-format
-msgid "-%s%s-Info: (%s)%s, %d lines --%s--"
-msgstr "-%s%s-Info: (%s)%s, %d Zeilen --%s--"
-
-#: info/window.c:1131
-#, c-format
-msgid " Subfile: %s"
-msgstr " Unterdatei: %s"
-
-#: lib/getopt.c:672
-#, c-format
-msgid "%s: option `%s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:696
-#, c-format
-msgid "%s: option `--%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:701
-#, c-format
-msgid "%s: option `%c%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:718 lib/getopt.c:891
-#, c-format
-msgid "%s: option `%s' requires an argument\n"
-msgstr ""
-
-#. --option
-#: lib/getopt.c:747
-#, c-format
-msgid "%s: unrecognized option `--%s'\n"
-msgstr ""
-
-#. +option or -option
-#: lib/getopt.c:751
-#, c-format
-msgid "%s: unrecognized option `%c%s'\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:777
-#, c-format
-msgid "%s: illegal option -- %c\n"
-msgstr ""
-
-#: lib/getopt.c:780
-#, c-format
-msgid "%s: invalid option -- %c\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:810 lib/getopt.c:940
-#, c-format
-msgid "%s: option requires an argument -- %c\n"
-msgstr ""
-
-#: lib/getopt.c:857
-#, c-format
-msgid "%s: option `-W %s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:875
-#, c-format
-msgid "%s: option `-W %s' doesn't allow an argument\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:893
-#, c-format
-msgid "%s:%d: warning: "
-msgstr "%s:%d: Warnung: "
-
-#: makeinfo/makeinfo.c:916
-msgid "Too many errors! Gave up.\n"
-msgstr "Zu viele Fehler! Abbruch.\n"
-
-#: makeinfo/makeinfo.c:975 makeinfo/makeinfo.c:1000 makeinfo/makeinfo.c:1068
-#, c-format
-msgid "%s: %s arg must be numeric, not `%s'.\n"
-msgstr "%s: %s Argument muss numerisch sein, nicht »%s«.\n"
-
-# checkit
-#: makeinfo/makeinfo.c:989
-#, c-format
-msgid "Couldn't open macro expansion output `%s'"
-msgstr "Die Macro-Auflösung für »%s« kann nicht geöffnet werden"
-
-#: makeinfo/makeinfo.c:992
-msgid "Cannot specify more than one macro expansion output"
-msgstr "Mehr als eine Ausgabedatei darf nicht angegeben werden"
-
-#: makeinfo/makeinfo.c:1036
-#, c-format
-msgid "%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"
-msgstr ""
-"%s: Arg für --paragraph-indent muss numerisch/»none«/»asis« sein, nicht "
-"»%s«.\n"
-
-#: makeinfo/makeinfo.c:1079
-#, c-format
-msgid "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"
-msgstr ""
-"%s: Argument für --footnote-style muss »separate« oder »end« sein, nicht "
-"»%s«.\n"
-
-#: makeinfo/makeinfo.c:1110
-#, c-format
-msgid "%s: missing file argument.\n"
-msgstr "%s: Datei-Angabe fehlt.\n"
-
-#: makeinfo/makeinfo.c:1163
-#, c-format
-msgid "Try `%s --help' for more information.\n"
-msgstr "»%s --help« gibt weitere Informationen.\n"
-
-# Die "." am Zeilenende habe ich entfernt. -ke-
-#: makeinfo/makeinfo.c:1165
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... TEXINFO-FILE...\n"
-"\n"
-"Translate Texinfo source documentation to a format suitable for reading\n"
-"with GNU Info.\n"
-"\n"
-"Options:\n"
-"-D VAR define a variable, as with @set.\n"
-"-E MACRO-OFILE process macros only, output texinfo source.\n"
-"-I DIR append DIR to the @include directory search path.\n"
-"-P DIR prepend DIR to the @include directory search path.\n"
-"-U VAR undefine a variable, as with @clear.\n"
-"--error-limit NUM quit after NUM errors (default %d).\n"
-"--fill-column NUM break lines at NUM characters (default %d).\n"
-"--footnote-style STYLE output footnotes according to STYLE:\n"
-" `separate' to place footnotes in their own node,\n"
-" `end' to place the footnotes at the end of\n"
-" the node in which they are defined (the default).\n"
-"--force preserve output even if errors.\n"
-"--help display this help and exit.\n"
-"--no-validate suppress node cross-reference validation.\n"
-"--no-warn suppress warnings (but not errors).\n"
-"--no-split suppress splitting of large files.\n"
-"--no-headers suppress node separators and Node: Foo headers.\n"
-"--output FILE, -o FILE output to FILE, and ignore any @setfilename.\n"
-"--paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n"
-" if VAL is `none', do not indent; if VAL is `asis',\n"
-" preserve any existing indentation.\n"
-"--reference-limit NUM complain about at most NUM references (default %d).\n"
-"--verbose report about what is being done.\n"
-"--version display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-"Aufruf: %s [OPTION]... TEXINFO-DATEI...\n"
-"\n"
-"Texinfo-Quelltext in ein Format übersetzen, das mit GNU Info gelesen werden\n"
-"kann.\n"
-"\n"
-"Optionen:\n"
-"-D VAR eine Variable definieren, wie mit @set\n"
-"-E MACRO-AUSGABEDATEI nur die Macros auflösen, Texinfo-Quelltext ausgeben\n"
-"-I VERZ VERZ in die Verzeichnis-Suchliste für @include "
-"aufnehmen\n"
-"-P DIR VERZ dem @include Verzeichnis-Suchpfad voranstellen\n"
-"-U VAR eine Variable aufheben, wie mit @clear\n"
-"--error-limit ZAHL nach ZAHL Fehlern beenden (Standard %d)\n"
-"--fill-column ZAHL Zeilen nach ZAHL Zeichen umbrechen (Standard %d)\n"
-"--footnote-style STYLE Fußnoten gemäß STYLE ausgeben:\n"
-" »separate«: Fußnoten in einen eigenen Knoten "
-"plazieren;\n"
-" »end«: Fußnoten an das Ende des Knoten setzen, "
-"in\n"
-" dem sie definiert sind (Standard)\n"
-"--force Ausgabe auch bei Fehlern aufbewahren\n"
-"--help diese Hilfe zeigen\n"
-"--no-validate Überprüfen der \"node\"-Querverweise unterdrücken\n"
-"--no-warn Warnungen unterdrücken (aber keine Fehler)\n"
-"--no-split Aufteilen langer Dateien unterdrücken\n"
-"--no-headers Knoten-Unterteiler und \"Node: Foo\" Kopfzeilen\n"
-" unterdrücken\n"
-"--output DATEI, -o DATEI\n"
-" Ausgabe nach DATEI und @setfilename ignorieren\n"
-"--paragraph-indent ZAHL/»none«/»asis«\n"
-" Absätze mit ZAHL Leerräumen einziehen (Standard %d);\n"
-" »none«: keine Leerräume\n"
-" »asis«: keine Veränderung hinsichtlich der Leerräume\n"
-"--reference-limit ZAHL bei wenigstens ZAHL Verweise melden (Standard %d)\n"
-"--verbose ausführlich die Bearbeitungschritte anzeigen\n"
-"--version Programmversion anzeigen\n"
-"\n"
-"Fehlerberichte (\"bugs\") bitte an <bug-texinfo@gnu.org> schicken.\n"
-"\n"
-"Für die deutsche Übersetzung ist die Mailingliste <de@li.org> zuständig.\n"
-
-#: makeinfo/makeinfo.c:1552
-#, c-format
-msgid "%s: getwd: %s, %s\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1748
-#, c-format
-msgid "Expected `%s'"
-msgstr "Erwartet »%s«"
-
-#: makeinfo/makeinfo.c:2082
-#, c-format
-msgid "No `%s' found in `%s'"
-msgstr "Kein »%s« in »%s« gefunden"
-
-#: makeinfo/makeinfo.c:2132
-#, c-format
-msgid "%s: Skipping macro expansion to stdout as Info output is going there.\n"
-msgstr ""
-"%s: Macro-Auflösung nach der Standard-Ausgabe, da auch die Info-Ausgabe nach "
-"dort geht.\n"
-
-#: makeinfo/makeinfo.c:2151
-#, c-format
-msgid "Making %s file `%s' from `%s'.\n"
-msgstr "Erzeuge %s Datei »%s« von »%s«.\n"
-
-#: makeinfo/makeinfo.c:2181
-#, c-format
-msgid "This is Info file %s, produced by Makeinfo version %d.%d"
-msgstr "Dies ist die Info-Datei %s, hergestellt von Makeinfo Version %d.%d"
-
-#: makeinfo/makeinfo.c:2183
-#, c-format
-msgid " from the input file %s.\n"
-msgstr " aus der Eingabe-Datei %s.\n"
-
-#: makeinfo/makeinfo.c:2202
-#, c-format
-msgid ""
-"%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-"%s: Entferne Macro-Ausgabe-Datei »%s« wegen der Fehler; --force benutzen, um "
-"diese beizubehalten.\n"
-
-#. If there were errors, and no --force, remove the output.
-#: makeinfo/makeinfo.c:2234
-#, c-format
-msgid "%s: Removing output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-"%s: Entferne Ausgabe-Datei »%s« wegen der Fehler; --force benutzen, um diese "
-"beizubehalten.\n"
-
-#. Special case. I'm not supposed to see this character by itself.
-#. If I do, it means there is a syntax error in the input text.
-#. Report the error here, but remember this brace on the stack so
-#. you can ignore its partner.
-#: makeinfo/makeinfo.c:2374 makeinfo/makeinfo.c:7629
-#, c-format
-msgid "Misplaced %c"
-msgstr "Fehlplazierte %c"
-
-#: makeinfo/makeinfo.c:2461
-#, c-format
-msgid "Unknown command `%s'"
-msgstr "Unbekannter Befehl »%s«"
-
-#: makeinfo/makeinfo.c:2481
-msgid "NO_NAME!"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2495
-#, c-format
-msgid "%c%s expected `{...}'"
-msgstr "%c%s erwartete »{...}«"
-
-#: makeinfo/makeinfo.c:2528
-msgid "Unmatched }"
-msgstr "Nicht übereinstimmende }"
-
-#: makeinfo/makeinfo.c:2576
-#, c-format
-msgid "%c%s missing close brace"
-msgstr "%c%s fehlende schließende Klammer"
-
-# checkit
-# üs? -ke-
-#: makeinfo/makeinfo.c:3372
-msgid "Broken-Type in insertion_type_pname"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3438
-msgid "Enumeration stack overflow"
-msgstr "Nummerierungsstack-Überlauf"
-
-#: makeinfo/makeinfo.c:3470
-#, c-format
-msgid "lettering overflow, restarting at %c"
-msgstr "Buchstaben-Zählungs-Überlauf, beginne wieder bei %c"
-
-# checkit
-# übersetzen? -ke-
-#: makeinfo/makeinfo.c:3509
-msgid "* Menu:\n"
-msgstr "* Menü:\n"
-
-# checkit
-#: makeinfo/makeinfo.c:3593
-#, c-format
-msgid "%s requires an argument: the formatter for %citem"
-msgstr "%s erfordert ein Argument: der Formatierer für %citem"
-
-#: makeinfo/makeinfo.c:3697
-#, c-format
-msgid "`%cend' expected `%s', but saw `%s'"
-msgstr "»%cend« erwartete »%s«, aber bekam »%s«"
-
-# checkit
-#: makeinfo/makeinfo.c:3810
-#, c-format
-msgid "No matching `%cend %s'"
-msgstr "Nicht übereinstimmende »%cend %s«"
-
-#: makeinfo/makeinfo.c:3949
-#, c-format
-msgid "How did @%s end up in cm_special_char?\n"
-msgstr "Zu was führt @%s in cm_special_char?\n"
-
-#. This error message isn't perfect if the argument is multiple
-#. characters, but it doesn't seem worth getting right.
-#: makeinfo/makeinfo.c:3963
-#, c-format
-msgid "%c%s expects `i' or `j' as argument, not `%c'"
-msgstr "%c%s erwartet »i« oder »j« als Argument, nicht »%c«"
-
-#: makeinfo/makeinfo.c:3967
-#, c-format
-msgid "%c%s expects a single character `i' or `j' as argument"
-msgstr "%c%s erwartet einen einzigen Buchstaben »i« oder »j« als Argument"
-
-#: makeinfo/makeinfo.c:3979
-msgid "January"
-msgstr "Januar"
-
-#: makeinfo/makeinfo.c:3979
-msgid "February"
-msgstr "Februar"
-
-#: makeinfo/makeinfo.c:3979
-msgid "March"
-msgstr "März"
-
-#: makeinfo/makeinfo.c:3979
-msgid "April"
-msgstr "April"
-
-#: makeinfo/makeinfo.c:3979
-msgid "May"
-msgstr "Mai"
-
-#: makeinfo/makeinfo.c:3980
-msgid "June"
-msgstr "Juni"
-
-#: makeinfo/makeinfo.c:3980
-msgid "July"
-msgstr "Juli"
-
-#: makeinfo/makeinfo.c:3980
-msgid "August"
-msgstr "August"
-
-#: makeinfo/makeinfo.c:3980
-msgid "September"
-msgstr "September"
-
-#: makeinfo/makeinfo.c:3980
-msgid "October"
-msgstr "Oktober"
-
-#: makeinfo/makeinfo.c:3981
-msgid "November"
-msgstr "November"
-
-#: makeinfo/makeinfo.c:3981
-msgid "December"
-msgstr "Dezember"
-
-#: makeinfo/makeinfo.c:4039
-#, c-format
-msgid "%c%s expects a single character as an argument"
-msgstr "%c%s erwartet einen einzigen Buchstaben als Argument"
-
-#: makeinfo/makeinfo.c:4153
-#, c-format
-msgid "%c%s is obsolete"
-msgstr "%c%s ist obsolet"
-
-#: makeinfo/makeinfo.c:4325
-#, c-format
-msgid "Node with %ctop as a section already exists"
-msgstr "Konoten mit %ctop als Abschnitt existiert bereits"
-
-#: makeinfo/makeinfo.c:4337
-#, c-format
-msgid "Here is the %ctop node"
-msgstr "Hier ist der Knoten %ctop"
-
-#: makeinfo/makeinfo.c:4356
-#, c-format
-msgid "%ctop used before %cnode, defaulting to %s"
-msgstr "%ctop vor %cnode gebraucht, als Standard %s genommen"
-
-#: makeinfo/makeinfo.c:4431
-#, c-format
-msgid "%c%s is obsolete; use %c%s instead"
-msgstr "%c%s ist obsolet; stattdessen %c%s benutzen"
-
-#: makeinfo/makeinfo.c:4680
-#, c-format
-msgid "Node `%s' multiply defined (line %d is first definition at)"
-msgstr "Knoten »%s« mehrfach definiert (in Zeile %d ist erste Definition)"
-
-#: makeinfo/makeinfo.c:4753
-#, c-format
-msgid "Formatting node %s...\n"
-msgstr "Formatiere Knoten %s...\n"
-
-#: makeinfo/makeinfo.c:4802
-#, c-format
-msgid "Node `%s' requires a sectioning command (e.g. %c%s)"
-msgstr "Knoten »%s« erfordert eine Abschnitt-Angabe (z.B. %c%s)"
-
-#: makeinfo/makeinfo.c:5085
-#, c-format
-msgid "Node `%s''s Next field not pointed back to"
-msgstr "\"Next field\" des Knotens »%s« verweist nicht zurück nach"
-
-# checkit
-#: makeinfo/makeinfo.c:5090
-#, c-format
-msgid "This node (`%s') is the one with the bad `Prev'"
-msgstr "Dieser Knoten (»%s«) hat schlechten(?) \"Prev\"-Eintrag"
-
-#: makeinfo/makeinfo.c:5130
-#, c-format
-msgid "Node `%s's Prev field not pointed back to"
-msgstr "Das \"Prev field\" des Knotens »%s« verweist nicht zurück nach"
-
-# checkit
-#: makeinfo/makeinfo.c:5134
-#, c-format
-msgid "This node (`%s') has the bad Next"
-msgstr "Dieser Knoten (»%s«) hat schlechten(?) \"Next\"-Eintrag"
-
-#: makeinfo/makeinfo.c:5146
-#, c-format
-msgid "Node `%s' missing Up field"
-msgstr "Dem Knoten »%s« fehlt ein \"Up field\""
-
-#: makeinfo/makeinfo.c:5186
-#, c-format
-msgid "`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"
-msgstr ""
-"»%s« hat ein \"Up field\" von »%s«, aber »%s« hat keinen Menü-Eintrag für "
-"»%s«"
-
-#: makeinfo/makeinfo.c:5217
-#, c-format
-msgid "node `%s' has been referenced %d times"
-msgstr "auf Knoten »%s« wird %d mal verwiesen"
-
-#: makeinfo/makeinfo.c:5229
-#, c-format
-msgid "unreferenced node `%s'"
-msgstr "auf Knoten »%s« wird nicht verwiesen"
-
-# checkit
-#: makeinfo/makeinfo.c:5256
-#, c-format
-msgid "%s reference to nonexistent node `%s'"
-msgstr "Verweis %s auf den nicht existierenden Knoten »%s«"
-
-#: makeinfo/makeinfo.c:5668 makeinfo/makeinfo.c:5680
-#, c-format
-msgid "%cmenu seen before first node"
-msgstr "%cmenu festgestellt, bevor der erste Knoten definiert wurde"
-
-#: makeinfo/makeinfo.c:5669 makeinfo/makeinfo.c:5681
-msgid "creating `Top' node"
-msgstr "»Top«-Knoten wird angelegt"
-
-# checkit
-#: makeinfo/makeinfo.c:5794
-#, c-format
-msgid "`.' or `,' must follow cross reference, not %c"
-msgstr "».« or »,« muss einem Querverweis folgen, nicht %c"
-
-#: makeinfo/makeinfo.c:5962
-#, c-format
-msgid "@image file `%s' unreadable: %s"
-msgstr "@image-Datei »%s« nicht lesbar: %s"
-
-#: makeinfo/makeinfo.c:5966
-msgid "@image missing filename argument"
-msgstr "@image fehlt als Argument ein Dateiname"
-
-#: makeinfo/makeinfo.c:6067
-#, c-format
-msgid "%s requires letter or digit"
-msgstr "%s erfordert einen Buchstaben oder eine Zahl"
-
-#: makeinfo/makeinfo.c:6152
-#, c-format
-msgid "Unmatched `%c%s'"
-msgstr "Nicht übereinstimmende »%c%s«"
-
-#: makeinfo/makeinfo.c:6159
-#, c-format
-msgid "`%c%s' needs something after it"
-msgstr "»%c%s« braucht etwas Nachfolgendes"
-
-# checkit
-#: makeinfo/makeinfo.c:6165
-#, c-format
-msgid "Bad argument to `%s', `%s', using `%s'"
-msgstr "Falsches Argument für »%s«, »%s«, wenn »%s« benutzt wird"
-
-# checkit
-#: makeinfo/makeinfo.c:6338
-#, c-format
-msgid "{No Value For \"%s\"}"
-msgstr "{Kein Wert Für »%s«}"
-
-#: makeinfo/makeinfo.c:6388
-#, c-format
-msgid "%c%s requires a name"
-msgstr "%c%s erfordert einen Namen"
-
-#: makeinfo/makeinfo.c:6496
-#, c-format
-msgid "Reached eof before matching @end %s"
-msgstr "Das Ende der Datei vor dem erforderlichen @end %s erreicht"
-
-#: makeinfo/makeinfo.c:6722
-#, c-format
-msgid "The `%c%s' command is meaningless within a `@%s' block"
-msgstr "Der »%c%s«-Befehl ist sinnlos innerhalb eines »@%s«-Blocks"
-
-#: makeinfo/makeinfo.c:6731
-#, c-format
-msgid "%citemx is not meaningful inside of a `%s' block"
-msgstr "%citemx ist nicht sinnvoll innerhalb eines »@%s«-Blocks"
-
-# checkit
-#: makeinfo/makeinfo.c:6844
-#, c-format
-msgid "%c%s found outside of an insertion block"
-msgstr "%c%s außerhalb eines Einfügungsblocks gefunden"
-
-# checkit
-#: makeinfo/makeinfo.c:6935
-#, c-format
-msgid "Missing `}' in %cdef arg"
-msgstr "Fehlende »}« in »%cdef«-Argument"
-
-#: makeinfo/makeinfo.c:7144 makeinfo/makeinfo.c:7164
-msgid "Function"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7148
-msgid "Macro"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7152
-msgid "Special Form"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7156 makeinfo/makeinfo.c:7168
-msgid "Variable"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7160
-msgid "User Option"
-msgstr "Benutzer-Option"
-
-#: makeinfo/makeinfo.c:7172
-msgid "Instance Variable"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7176 makeinfo/makeinfo.c:7180
-msgid "Method"
-msgstr ""
-
-# checkit
-#: makeinfo/makeinfo.c:7335
-#, c-format
-msgid "Must be in a `%s' insertion in order to use `%s'x"
-msgstr "Muss in einer »%s«-Einfügung sein, wenn »%s«x benutzt werden soll"
-
-# checkit
-#: makeinfo/makeinfo.c:7407
-#, c-format
-msgid "%csp requires a positive numeric argument"
-msgstr "»%csp« erfordert ein positives numerisches Argument"
-
-#: makeinfo/makeinfo.c:7650
-msgid "asis"
-msgstr "genau"
-
-#: makeinfo/makeinfo.c:7652
-msgid "none"
-msgstr "kein"
-
-#: makeinfo/makeinfo.c:7674
-#, c-format
-msgid "Bad argument to %c%s"
-msgstr "Falsches Argument für »%c%s«"
-
-#: makeinfo/makeinfo.c:7966
-#, c-format
-msgid "Unknown index `%s'"
-msgstr "Unbekannter Index »%s«"
-
-#: makeinfo/makeinfo.c:8031
-#, c-format
-msgid "Index `%s' already exists"
-msgstr "Index »%s« ist schon vorhanden"
-
-#: makeinfo/makeinfo.c:8062
-#, c-format
-msgid "Unknown index `%s' and/or `%s' in @synindex"
-msgstr "Unbekannter Index »%s« und /oder unbekannter »%s« in @synindex"
-
-#: makeinfo/makeinfo.c:8251
-#, c-format
-msgid "Unknown index `%s' in @printindex"
-msgstr "Unbekannter Index »%s« in @printindex"
-
-# übersetzen? -ke-
-#: makeinfo/makeinfo.c:8266
-msgid ""
-"* Menu:\n"
-"\n"
-msgstr ""
-"* Menü:\n"
-"\n"
-
-#: makeinfo/makeinfo.c:8453
-#, c-format
-msgid "`%c%s' needs an argument `{...}', not just `%s'"
-msgstr "»%c%s« braucht das Argument in der Form »{...}«, nicht nur »%s«"
-
-#: makeinfo/makeinfo.c:8468
-#, c-format
-msgid "No closing brace for footnote `%s'"
-msgstr "Keine schließende Klammer für Fußnote »%s«"
-
-# checkit
-#: makeinfo/makeinfo.c:8507
-msgid "Footnote defined without parent node"
-msgstr "Fußnote definiert ohne einen Eltern-\"node\""
-
-#: makeinfo/makeinfo.c:8539
-msgid "-Footnotes"
-msgstr "-Fußnoten"
-
-#: makeinfo/makeinfo.c:8594
-msgid ""
-"---------- Footnotes ----------\n"
-"\n"
-msgstr ""
-"----------- Fußnoten -----------\n"
-"\n"
-
-#: makeinfo/makeinfo.c:8690
-#, c-format
-msgid "macro `%s' previously defined"
-msgstr "Macro »%s« ist bereits definiert"
-
-#: makeinfo/makeinfo.c:8694
-#, c-format
-msgid "here is the previous definition of `%s'"
-msgstr "Hier ist die vorangehende Definition von »%s«"
-
-#: makeinfo/makeinfo.c:8908
-#, c-format
-msgid "Macro `%s' called with too many args"
-msgstr "Macro »%s« mit zu vielen Argumenten aufgerufen"
-
-#: makeinfo/makeinfo.c:9060
-#, c-format
-msgid "%cend macro not found"
-msgstr "»%cend«-Macro nicht gefunden"
-
-# checkit
-#: makeinfo/makeinfo.c:9100
-#, c-format
-msgid "%cquote-arg only useful when the macro takes a single argument"
-msgstr ""
-"»%cquote«-Argument ist nur sinnvoll, wenn das Macro ein einziges Argument hat"
-
-#: makeinfo/multi.c:206
-#, c-format
-msgid "ignoring stray text `%s' after @multitable"
-msgstr "irriger Text »%s« nach @multitable wird ignoriert"
-
-#: makeinfo/multi.c:277
-#, c-format
-msgid "Too many columns in multitable item (max %d)"
-msgstr "zu viele Spalten im \"multitable\"-Eintrag (maximal %d)"
-
-# checkit
-#. impossible, I think.
-#: makeinfo/multi.c:304
-msgid "multitable item not in active multitable"
-msgstr "\"multitable\"-Eintrag nicht in der aktiven \"multitable\""
-
-#: makeinfo/multi.c:313
-#, c-format
-msgid "Cannot select column #%d in multitable"
-msgstr "Spalte #%d kann in der \"multitable\" nicht ausgewählt werden"
-
-#: makeinfo/multi.c:404
-msgid "ignoring @tab outside of multitable"
-msgstr "@tab außerhalb der \"multitable\" wird übergangen"
-
-# checkit
-#: makeinfo/multi.c:428
-msgid "** Multicolumn output from last row:\n"
-msgstr "** Mehrspalten-Ausgabe von der letzten Zeile:\n"
-
-# checkit
-#: makeinfo/multi.c:431
-#, c-format
-msgid "* column #%d: output = %s\n"
-msgstr "* Spalte #%d: Ausgabe = %s\n"
-
-# checkit
-#: util/install-info.c:123 util/install-info.c:136
-msgid "virtual memory exhausted"
-msgstr "virtual memory exhausted"
-
-#: util/install-info.c:192
-#, c-format
-msgid "%s: warning: "
-msgstr "%s: Warnung: "
-
-#: util/install-info.c:213
-#, c-format
-msgid " for %s"
-msgstr " für %s"
-
-#: util/install-info.c:282
-#, c-format
-msgid "\tTry `%s --help' for a complete list of options.\n"
-msgstr "»%s --help« gibt weitere Informationen.\n"
-
-#: util/install-info.c:290
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n"
-"\n"
-"Install INFO-FILE in the Info directory file DIR-FILE.\n"
-"\n"
-"Options:\n"
-"--delete Delete existing entries in INFO-FILE;\n"
-" don't insert any new entries.\n"
-"--dir-file=NAME Specify file name of Info directory file.\n"
-" This is equivalent to using the DIR-FILE argument.\n"
-"--entry=TEXT Insert TEXT as an Info directory entry.\n"
-" TEXT should have the form of an Info menu item line\n"
-" plus zero or more extra lines starting with whitespace.\n"
-" If you specify more than one entry, they are all added.\n"
-" If you don't specify any entries, they are determined\n"
-" from information in the Info file itself.\n"
-"--help Display this help and exit.\n"
-"--info-file=FILE Specify Info file to install in the directory.\n"
-" This is equivalent to using the INFO-FILE argument.\n"
-"--info-dir=DIR Same as --dir-file=DIR/dir.\n"
-"--item=TEXT Same as --entry TEXT.\n"
-" An Info directory entry is actually a menu item.\n"
-"--quiet Suppress warnings.\n"
-"--remove Same as --delete.\n"
-"--section=SEC Put this file's entries in section SEC of the directory.\n"
-" If you specify more than one section, all the entries\n"
-" are added in each of the sections.\n"
-" If you don't specify any sections, they are determined\n"
-" from information in the Info file itself.\n"
-"--version Display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-"Syntax: %s [OPTION]... [INFO-DATEI [VERZ-DATEI]]\n"
-"\n"
-"Installiere die INFO-DATEI in dem Info-Verzeichnis VERZ-DATEI.\n"
-"\n"
-"Optionen:\n"
-"--delete entferne vorhandene Einträge aus INFO-DATEI; keine neuen\n"
-" Einträge einfügen\n"
-"--dir-file=NAME Namen der Info-Verzeichnis-Datei angeben. "
-"Gleichbedeutend\n"
-" mit dem VERZ-DATEI-Argument\n"
-"--entry=TEXT TEXT als einen Info-Verzeichnis-Eintrag einfügen. TEXT "
-"soll\n"
-" die Form einer Zeile eines Info-Menüpunkts haben,\n"
-" zuzüglich Null oder mehrerer Extra-Zeilen, die mit "
-"Leerraum\n"
-" (\"whitespace\") beginnen. Wenn mehr als ein Eintrag "
-"angegeben\n"
-" wird, werden alle hinzugefügt. Wenn gar kein Eintrag\n"
-" angegeben wird, wird der Eintragstext der Info-Datei "
-"selbst\n"
-" entnommen.\n"
-"--help diese Hilfe zeigen\n"
-"--info-file=DATEI Info-Datei angeben, die im Verzeichnis zu installieren "
-"ist.\n"
-" Gleichbedeutend mit dem INFO-DATEI-Argument\n"
-"--info-dir=VERZ wie --dir-file=VERZ/dir.\n"
-"--item=TEXT wie --entry TEXT. Ein Info-Verzeichnis-Eintrag ist "
-"nämlich\n"
-" ein Menüpunkt\n"
-"--quiet Warnungen unterdrücken\n"
-"--remove wie --delete\n"
-"--section=ABSCHN stelle die Einträge dieser Datei in den Abschnitt ABSCHN\n"
-" des Verzeichnisses. Wenn mehr als ein --section "
-"angegeben\n"
-" wird, werden alle Einträge in jedem der Abschnitte\n"
-" hinzugefügt. Wenn gar kein --section angegeben wird, "
-"wird\n"
-" der Eintragstext der Info-Datei selbst entnommen.\n"
-"--version Programmversion anzeigen\n"
-"\n"
-"Fehlerberichte (\"bugs\") bitte an <bug-texinfo@gnu.org> schicken.\n"
-"\n"
-"Für die deutsche Übersetzung ist die Mailingliste <de@li.org> zuständig.\n"
-
-#: util/install-info.c:341
-msgid ""
-"This is the file .../info/dir, which contains the\n"
-"topmost node of the Info hierarchy, called (dir)Top.\n"
-"The first time you invoke Info you start off looking at this node.\n"
-"\n"
-"File: dir,\tNode: Top,\tThis is the top of the INFO tree\n"
-"\n"
-" This (the Directory node) gives a menu of major topics.\n"
-" Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n"
-" \"h\" gives a primer for first-timers,\n"
-" \"mEmacs<Return>\" visits the Emacs manual, etc.\n"
-"\n"
-" In Emacs, you can click mouse button 2 on a menu item or cross reference\n"
-" to select it.\n"
-"\n"
-"* Menu:\n"
-msgstr ""
-"Dies ist die Datei .../info/dir, die den obersten Knoten der\n"
-"Info-Hierarchie enthält, genannt (dir)Top.\n"
-"Beim ersten Aufruf von Info geht es bei diesem Knoten los.\n"
-"\n"
-"Date: dir Knoten: Top Dies ist »top« des INFO-Baums\n"
-"\n"
-" Dieser Verzeichnis-Knoten zeigt ein Menü aller Hauptpunkte an.\n"
-" Beenden mit \"q\", \"?\" listet alle Info-Befehle auf, \"d\" kehrt nach "
-"hierher\n"
-" zurück, \"h\" gibt eine Einsteiger-Hilfe,\n"
-" \"mEmacs<Return>\" besucht das Emacs-Manual, etc.\n"
-"\n"
-" Im Emacs kann man mit mouse-button-2 auf einen Menüpunkt oder einen\n"
-" Querverweis klicken, um einen solchen auswählen.\n"
-"\n"
-"* Menü:\n"
-
-#: util/install-info.c:364
-#, c-format
-msgid "%s: could not read (%s) and could not create (%s)\n"
-msgstr "%s: kann nicht gelesen (%s) und kann nicht angelegt werden (%s)\n"
-
-#: util/install-info.c:464 util/install-info.c:474
-#, c-format
-msgid "%s: Specify the Info directory only once.\n"
-msgstr "%s: Info-Verzeichnis nur einmal angeben.\n"
-
-#: util/install-info.c:502
-#, c-format
-msgid "%s: Specify the Info file only once.\n"
-msgstr "%s: Info-Datei nur einmal angeben.\n"
-
-# checkit
-#: util/install-info.c:550
-#, c-format
-msgid "excess command line argument `%s'"
-msgstr "Kommandozeilen-Argument »%s« wird übergangen"
-
-#: util/install-info.c:554
-msgid "No input file specified; try --help for more information."
-msgstr "Keine Eingabe-Datei angegeben; »--help« gibt weitere Informationen."
-
-#: util/install-info.c:556
-msgid "No dir file specified; try --help for more information."
-msgstr "Keine dir-Datei angegeben; »--help« gibt weitere Informationen."
-
-#: util/install-info.c:608 util/install-info.c:631
-msgid "START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"
-msgstr "START-INFO-DIR-ENTRY ohne END-INFO-DIR-ENTRY"
-
-#: util/install-info.c:627
-msgid "END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"
-msgstr "END-INFO-DIR-ENTRY ohne START-INFO-DIR-ENTRY"
-
-#. No need to abort here, the original info file may not have
-#. the requisite Texinfo commands. This is not something an
-#. installer should have to correct (it's a problem for the
-#. maintainer), and there's no need to cause subsequent parts of
-#. `make install' to fail.
-#: util/install-info.c:641
-#, c-format
-msgid "no info dir entry in `%s'"
-msgstr "Kein Info-Verzeichnis-Eintrag in »%s«"
-
-#: util/install-info.c:852
-#, c-format
-msgid "menu item `%s' already exists, for file `%s'"
-msgstr "Menüpunkt »%s« bereits vorhanden, für Datei »%s«"
-
-#: util/install-info.c:875
-#, c-format
-msgid "no entries found for `%s'; nothing deleted"
-msgstr "keine Einträge für »%s« gefunden; nichts entfernt"
-
-#: util/texindex.c:253
-msgid "keep temporary files around after processing"
-msgstr "temporäre Dateien bis nach der Verarbeitung aufheben"
-
-#: util/texindex.c:255
-msgid "do not keep temporary files around after processing (default)"
-msgstr "keine temporäre Dateien bis nach der Verarbeitung aufheben (Standard)"
-
-#: util/texindex.c:257
-msgid "send output to FILE"
-msgstr "Ausgabe nach DATEI schicken"
-
-#: util/texindex.c:259
-msgid "display version information and exit"
-msgstr "Programmversion anzeigen"
-
-#: util/texindex.c:261
-msgid "display this help and exit"
-msgstr "diese Hilfe anzeigen"
-
-#: util/texindex.c:272
-#, c-format
-msgid "Usage: %s [OPTION]... FILE...\n"
-msgstr "Aufruf: %s [OPTION]... DATEI...\n"
-
-#: util/texindex.c:273
-msgid "Generate a sorted index for each TeX output FILE.\n"
-msgstr "Erzeuge einen sortierten Index für jede TeX-Ausgabedatei.\n"
-
-#. Avoid trigraph nonsense.
-#: util/texindex.c:275
-msgid "Usually FILE... is `foo.??' for a document `foo.texi'.\n"
-msgstr "DATEI... ist normalerweise »foo.??« für ein Dokument »foo.texi«.\n"
-
-#: util/texindex.c:276
-msgid ""
-"\n"
-"Options:\n"
-msgstr ""
-"\n"
-"Optionen:\n"
-
-#: util/texindex.c:290
-msgid ""
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-"\n"
-"Fehler (\"bugs\") bitte an <bug-texinfo@gnu.org> melden.\n"
-"\n"
-"Für die deutsche Übersetzung ist die Mailingliste <de@li.org> zuständig."
-
-#: util/texindex.c:917 util/texindex.c:951 util/texindex.c:1027
-#: util/texindex.c:1055
-#, c-format
-msgid "%s: not a texinfo index file"
-msgstr "%s: keine Texinfo-Indexdatei"
-
-#: util/texindex.c:1012
-#, c-format
-msgid "failure reopening %s"
-msgstr "Fehler beim Wiederöffnen von »%s«"
-
-# checkit
-#: util/texindex.c:1325
-#, c-format
-msgid "entry %s follows an entry with a secondary name"
-msgstr "Eintrag »%s« folgt einem Eintrag mit einem Zweitnamen"
-
-#: util/texindex.c:1663
-#, c-format
-msgid "%s; for file `%s'.\n"
-msgstr "%s; für Datei »%s«.\n"
-
-# checkit
-#: util/texindex.c:1724
-#, c-format
-msgid "Virtual memory exhausted in %s ()! Needed %d bytes."
-msgstr "Virtual memory exhausted in %s ()! Needed %d bytes."
diff --git a/contrib/texinfo/po/fr.gmo b/contrib/texinfo/po/fr.gmo
deleted file mode 100644
index bc0f11cb69b3..000000000000
--- a/contrib/texinfo/po/fr.gmo
+++ /dev/null
Binary files differ
diff --git a/contrib/texinfo/po/fr.po b/contrib/texinfo/po/fr.po
deleted file mode 100644
index a1a2abc7a222..000000000000
--- a/contrib/texinfo/po/fr.po
+++ /dev/null
@@ -1,2091 +0,0 @@
-# Version française du progiciel Texinfo-3.11.
-# Copyright © 1996, 1997 Free Software Foundation, Inc.
-# Laurent Bourbeau <bourbeau@progiciels-bpi.ca>, 1997.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: texinfo 3.11\n"
-"POT-Creation-Date: 1998-03-03 13:32-0500\n"
-"PO-Revision-Date: 1997-09-16 12:28-04:00\n"
-"Last-Translator: Laurent Bourbeau <bourbeau@progiciels-bpi.ca>\n"
-"Language-Team: French <fr@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=8859-1\n"
-"Content-Transfer-Encoding: 8-bit\n"
-
-#. ****************************************************************
-#.
-#. Echo Area Movement Commands
-#.
-#. ****************************************************************
-#: info/echo-area.c:283 info/session.c:698
-msgid "Move forward a character"
-msgstr "Avancer d'un caractère"
-
-#. Move point backward in the node.
-#: info/echo-area.c:295 info/session.c:714
-msgid "Move backward a character"
-msgstr "Reculer d'un caractère"
-
-#: info/echo-area.c:307
-msgid "Move to the start of this line"
-msgstr "Se déplacer au début de cette ligne"
-
-#: info/echo-area.c:312
-msgid "Move to the end of this line"
-msgstr "Se déplacer à la fin de cette ligne"
-
-#. Move forward a word in the input line.
-#: info/echo-area.c:320 info/session.c:732
-msgid "Move forward a word"
-msgstr "Avancer d'un mot"
-
-#: info/echo-area.c:360 info/session.c:781
-msgid "Move backward a word"
-msgstr "Reculer d'un mot"
-
-#: info/echo-area.c:400
-msgid "Delete the character under the cursor"
-msgstr "Éliminer le caractère sous le curseur"
-
-#: info/echo-area.c:430
-msgid "Delete the character behind the cursor"
-msgstr "Éliminer le caractère précédent le curseur"
-
-#: info/echo-area.c:451
-msgid "Cancel or quit operation"
-msgstr "Annuler ou opération de quitter"
-
-#: info/echo-area.c:466
-msgid "Accept (or force completion of) this line"
-msgstr "Accepter cette ligne (ou en forcer la complétion)"
-
-#: info/echo-area.c:471
-msgid "Insert next character verbatim"
-msgstr "Insérer le prochain caractère textuellement"
-
-#: info/echo-area.c:479
-msgid "Insert this character"
-msgstr "Insérer ce caractère"
-
-#: info/echo-area.c:497
-msgid "Insert a TAB character"
-msgstr "Insérer un caractère de tabulation"
-
-#. Transpose the characters at point. If point is at the end of the line,
-#. then transpose the characters before point.
-#: info/echo-area.c:504
-msgid "Transpose characters at point"
-msgstr "Transposer les caractères en position du point courant"
-
-#: info/echo-area.c:555
-msgid "Yank back the contents of the last kill"
-msgstr "Recoller le contenu du dernier effacement"
-
-#: info/echo-area.c:562
-msgid "Kill ring is empty"
-msgstr "L'anneau des effacements temporaires est vide"
-
-#. If the last command was yank, or yank_pop, and the text just before
-#. point is identical to the current kill item, then delete that text
-#. from the line, rotate the index down, and yank back some other text.
-#: info/echo-area.c:575
-msgid "Yank back a previous kill"
-msgstr "Recoller un effacement antérieur"
-
-#. Delete the text from point to end of line.
-#: info/echo-area.c:608
-msgid "Kill to the end of the line"
-msgstr "Effacer du point courant jusqu'à la fin de la ligne"
-
-#: info/echo-area.c:621
-msgid "Kill to the beginning of the line"
-msgstr "Effacer du point courant jusqu'au début de la ligne"
-
-#. Delete from point to the end of the current word.
-#: info/echo-area.c:633
-msgid "Kill the word following the cursor"
-msgstr "Effacer le mot suivant le curseur"
-
-#: info/echo-area.c:652
-msgid "Kill the word preceding the cursor"
-msgstr "Effacer le mot précédent le curseur"
-
-#: info/echo-area.c:871
-msgid "Not complete"
-msgstr "Non complet"
-
-#: info/echo-area.c:916
-msgid "List possible completions"
-msgstr "Énumérer les complétions possibles"
-
-#: info/echo-area.c:929
-msgid "No completions"
-msgstr "Aucune complétion"
-
-#: info/echo-area.c:933
-msgid "Sole completion"
-msgstr "Une seule complétion"
-
-#: info/echo-area.c:942
-#, fuzzy
-msgid "One completion:\n"
-msgstr "la complétion %s:\n"
-
-#: info/echo-area.c:943
-#, fuzzy, c-format
-msgid "%d completions:\n"
-msgstr "la complétion %s:\n"
-
-#: info/echo-area.c:1088
-msgid "Insert completion"
-msgstr "Insérer la complétion"
-
-#: info/echo-area.c:1221
-msgid "Building completions..."
-msgstr "Construction des complétions..."
-
-#. Scroll the "other" window. If there is a window showing completions, scroll
-#. that one, otherwise scroll the window which was active on entering the read
-#. function.
-#: info/echo-area.c:1319
-msgid "Scroll the completions window"
-msgstr "Dérouler la fenêtre des complétions"
-
-#: info/footnotes.c:206
-msgid "Footnotes could not be displayed"
-msgstr "Les notes en bas de page ne peuvent pas être affichées"
-
-#: info/footnotes.c:232
-msgid "Show the footnotes associated with this node in another window"
-msgstr ""
-"Montrer les notes en bas de page associées à ce noeud dans une autre fenêtre"
-
-#: info/indices.c:175
-msgid "Look up a string in the index for this file"
-msgstr "Rechercher une chaîne dans l'index pour ce fichier"
-
-#: info/indices.c:205
-msgid "Finding index entries..."
-msgstr "Recherche des entrées d'index..."
-
-#: info/indices.c:212
-msgid "No indices found."
-msgstr "Aucun indice retrouvé."
-
-#: info/indices.c:222
-msgid "Index entry: "
-msgstr "Entrée d'index: "
-
-#: info/indices.c:332
-msgid ""
-"Go to the next matching index item from the last `\\[index-search]' command"
-msgstr ""
-"Passer à la référence suivante de la dernière commande «\\[index-search]»"
-
-#: info/indices.c:342
-msgid "No previous index search string."
-msgstr "Aucune autre chaîne de fouille d'index."
-
-#: info/indices.c:349
-msgid "No index entries."
-msgstr "Aucune entrée d'index."
-
-#: info/indices.c:382
-#, c-format
-msgid "No %sindex entries containing \"%s\"."
-msgstr "Aucune entrée %sindex contenant «%s»."
-
-#: info/indices.c:383
-msgid "more "
-msgstr "plus "
-
-#: info/indices.c:393
-msgid "CAN'T SEE THIS"
-msgstr "NE PEUT PAS VOIR CECI"
-
-#: info/indices.c:429
-#, c-format
-msgid "Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"
-msgstr "Trouver «%s» dans %s. («\\[next-index-match]» cherchera le prochain.)"
-
-#: info/indices.c:533
-#, c-format
-msgid "Scanning indices of \"%s\"..."
-msgstr "Fouille des indices de «%s»..."
-
-#: info/indices.c:616
-msgid "Grovel all known info file's indices for a string and build a menu"
-msgstr ""
-"Aplatir tous les indices de fichier info connus pour une chaîne et "
-"construire un menu"
-
-#: info/indices.c:620
-msgid "Index apropos: "
-msgstr "Index à-propos: "
-
-#: info/indices.c:650
-#, c-format
-msgid ""
-"\n"
-"* Menu: Nodes whoses indices contain \"%s\":\n"
-msgstr ""
-"\n"
-"* Menu: Noeuds dont les indices contiennent «%s»:\n"
-
-#: info/info.c:212
-#, fuzzy
-msgid "Try --help for more information."
-msgstr "Pour en savoir davantage, faites: «%s --help».\n"
-
-#: info/info.c:231 makeinfo/makeinfo.c:1089 util/install-info.c:530
-#: util/texindex.c:338
-#, fuzzy, c-format
-msgid ""
-"Copyright (C) %s Free Software Foundation, Inc.\n"
-"There is NO warranty. You may redistribute this software\n"
-"under the terms of the GNU General Public License.\n"
-"For more information about these matters, see the files named COPYING.\n"
-msgstr ""
-"Copyright © 1996 Free Software Foundation, Inc.\n"
-"AUCUNE garantie n'est donnée; tant pour des raisons COMMERCIALES que\n"
-"pour RÉPONDRE À UN BESOIN PARTICULIER. Vous pouvez redistribuer des copies\n"
-"de ce logiciel selon les termes de la licence GNU General Public License.\n"
-"Pour plus d'informations, consultez le fichier COPYING."
-
-#: info/info.c:363
-msgid "no entries found\n"
-msgstr "aucune entrée retrouvée\n"
-
-#: info/info.c:406
-msgid "There is no menu in this node."
-msgstr "Il n'y a pas de menu dans ce noeud."
-
-#: info/info.c:437
-#, c-format
-msgid "There is no menu item \"%s\" in this node."
-msgstr "Il n'y a pas d'item menu «%s» dans ce noeud."
-
-#: info/info.c:501
-#, c-format
-msgid "Unable to find the node referenced by \"%s\"."
-msgstr "Incappable de trouver le noeud référencé par «%s»."
-
-#: info/info.c:602
-#, fuzzy, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n"
-"\n"
-"Read documentation in Info format.\n"
-"For more complete documentation on how to use Info, run `info info "
-"options'.\n"
-"\n"
-"Options:\n"
-"--directory DIR add DIR to INFOPATH.\n"
-"--dribble FILENAME remember user keystrokes in FILENAME.\n"
-"--file FILENAME specify Info file to visit.\n"
-"--node NODENAME specify nodes in first visited Info file.\n"
-"--output FILENAME output selected nodes to FILENAME.\n"
-"--restore FILENAME read initial keystrokes from FILENAME.\n"
-"--subnodes recursively output menu items.\n"
-"--help display this help and exit.\n"
-"--version display version information and exit.\n"
-"\n"
-"The first argument, if present, is the name of the Info file to read.\n"
-"Any remaining arguments are treated as the names of menu\n"
-"items in the initial node visited. For example, `info emacs buffers'\n"
-"moves to the node `buffers' in the info file `emacs'.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-"Voici une brève description des options en mode Info.\n"
-"Pour une description plus détaillée sur le comment utiliser le mode Info,\n"
-"tapper «info info options».\n"
-"\n"
-" --directory RÉP Ajouter le RÉPertoire à INFOPATH.\n"
-" --dribble FICHIER Mémoriser les touches de l'usager dans FICHIER.\n"
-" --file FICHIER Spécifier le FICHIER Info à visiter.\n"
-" --node NOEUD Spécifier les noms de NOEUD à visiter en premier.\n"
-" --output FICHIER Sortir les noeuds sélectionnés dans FICHIER.\n"
-" --restore FICHIER Lire les touches initiales à partir de FICHIER.\n"
-" --subnodes Sortir récursivement les items menu.\n"
-" --help Afficher cet aide-mémoire.\n"
-" --version Afficher le nom et la version du logiciel.\n"
-"\n"
-"Les arguments résiduels à Info sont traités comme étant les noms des items\n"
-"menu dans le noeud initial visité. Vous pouvez aisément rejoindre le\n"
-"noeud de votre choix en spécifiant les noms de menu lesquels décrivent\n"
-"le chemin de ce noeud. Par exemple, «info emacs buffers».\n"
-"\n"
-"Rapporter toute anomalie à bug-texinfo@prep.ai.mit.edu."
-
-#: info/infodoc.c:50
-msgid "Basic Commands in Info Windows"
-msgstr "Commandes de base en Info Windows"
-
-#: info/infodoc.c:211
-msgid ""
-"The following commands can only be invoked via M-x:\n"
-"\n"
-msgstr ""
-"Les commandes suivantes peuvent être invoquées seulement via M-x:\n"
-"\n"
-
-#: info/infodoc.c:228
-msgid "--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"
-msgstr "--- Utiliser «\\[history-node]» ou «\\[kill-node]» pour sortir ---\n"
-
-#. Create or move to the help window.
-#: info/infodoc.c:328
-msgid "Display help message"
-msgstr "Afficher le message d'aide"
-
-#. Show the Info help node. This means that the "info" file is installed
-#. where it can easily be found on your system.
-#: info/infodoc.c:346
-msgid "Visit Info node `(info)Help'"
-msgstr "Visiter le noeud Info «(info)Aide»"
-
-#: info/infodoc.c:470
-msgid "Print documentation for KEY"
-msgstr "Imprimer la documentation relative à KEY"
-
-#: info/infodoc.c:483
-#, c-format
-msgid "Describe key: %s"
-msgstr "Décrire la clé: %s"
-
-#: info/infodoc.c:492
-#, c-format
-msgid "ESC %s is undefined."
-msgstr "ESC %s est non défini."
-
-#: info/infodoc.c:509
-#, c-format
-msgid "%s is undefined."
-msgstr "%s est non défini."
-
-#: info/infodoc.c:535
-#, c-format
-msgid "%s is defined to %s."
-msgstr "%s est défini à %s."
-
-#: info/infodoc.c:731
-msgid "Where is command: "
-msgstr "Où se trouve la commande: "
-
-#: info/infodoc.c:753
-#, c-format
-msgid "`%s' is not on any keys"
-msgstr "«%s» ne se trouve pas sur une quelconque clé"
-
-#: info/infodoc.c:759
-#, c-format
-msgid "%s can only be invoked via %s."
-msgstr "%s peut être invoqué seulement via %s."
-
-#: info/infodoc.c:762
-#, c-format
-msgid "%s can be invoked via %s."
-msgstr "%s peut être invoqué via %s."
-
-#: info/infodoc.c:766
-#, c-format
-msgid "There is no function named `%s'"
-msgstr "Il n'y a pas de fonction nommée «%s»"
-
-#: info/m-x.c:69
-msgid "Read the name of an Info command and describe it"
-msgstr "Lire le nom d'une commande Info et la décrire"
-
-#: info/m-x.c:73
-msgid "Describe command: "
-msgstr "Décrire la commande: "
-
-#: info/m-x.c:96
-msgid "Read a command name in the echo area and execute it"
-msgstr "Lire le nom d'une commande dans la zone écho et l'exécuter"
-
-#: info/m-x.c:134
-msgid "Cannot execute an `echo-area' command here."
-msgstr "Ne peut pas exécuter une commande «echo-area» en cet endroit."
-
-#: info/m-x.c:150
-msgid "Set the height of the displayed window"
-msgstr "Ajuster la hauteur de la fenêtre affichée"
-
-#: info/m-x.c:163
-#, c-format
-msgid "Set screen height to (%d): "
-msgstr "Ajuster la hauteur de l'écran à (%d): "
-
-#: info/makedoc.c:126
-msgid ""
-" Source files groveled to make this file include:\n"
-"\n"
-msgstr ""
-" Les fichiers sources aplatis pour faire ce fichier incluent:\n"
-"\n"
-
-#: info/makedoc.c:450
-#, c-format
-msgid "Couldn't manipulate the file %s.\n"
-msgstr "Ne peut pas manipuler le fichier %s.\n"
-
-#: info/nodemenu.c:28
-msgid ""
-"\n"
-"* Menu:\n"
-" (File)Node Lines Size Containing File\n"
-" ---------- ----- ---- ---------------"
-msgstr ""
-"\n"
-"* Menu:\n"
-" (Fichier)Noeud Lignes Taille Contenant Fichier(s)\n"
-" -------------- ------ ------ --------------------"
-
-#: info/nodemenu.c:197
-msgid ""
-"Here is the menu of nodes you have recently visited.\n"
-"Select one from this menu, or use `\\[history-node]' in another window.\n"
-msgstr ""
-"Voici le menu de noeuds que vous avez visité récemment.\n"
-"Sélectionner un noeud de ce menu, ou utiliser «\\[history-node]» dans une\n"
-"autre fenêtre.\n"
-
-#: info/nodemenu.c:217
-msgid "Make a window containing a menu of all of the currently visited nodes"
-msgstr ""
-"Faire une fenêtre contenant un menu de tous les noeuds actuellement visités"
-
-#: info/nodemenu.c:297
-msgid "Select a node which has been previously visited in a visible window"
-msgstr "Sélectionner un noeud qui a déjà été visité dans une fenêtre visible"
-
-#: info/nodemenu.c:309
-msgid "Select visited node: "
-msgstr "Sélectionner un noeud visité: "
-
-#: info/nodemenu.c:329 info/session.c:1996
-#, c-format
-msgid "The reference disappeared! (%s)."
-msgstr "La référence est disparue! (%s)."
-
-#: info/session.c:162
-#, c-format
-msgid ""
-"Welcome to Info version %s. \"\\[get-help-window]\" for help, "
-"\"\\[menu-item]\" for menu item."
-msgstr ""
-"Bienvenue au mode Info version %s.\n"
-" «\\[get-help-window]» pour obtenir de l'aide,\n"
-" «\\[menu-item]» pour obtenir l'item menu."
-
-#. Move WINDOW's point down to the next line if possible.
-#: info/session.c:629
-msgid "Move down to the next line"
-msgstr "Descendre à la ligne suivante"
-
-#. Move WINDOW's point up to the previous line if possible.
-#: info/session.c:644
-msgid "Move up to the previous line"
-msgstr "Monter à la ligne précédente"
-
-#. Move WINDOW's point to the end of the true line.
-#: info/session.c:659
-msgid "Move to the end of the line"
-msgstr "Aller à la fin de la ligne"
-
-#. Move WINDOW's point to the beginning of the true line.
-#: info/session.c:679
-msgid "Move to the start of the line"
-msgstr "Aller au début de la ligne"
-
-#: info/session.c:855
-msgid " times"
-msgstr " fois"
-
-#: info/session.c:857
-#, c-format
-msgid "%d times"
-msgstr "%d fois"
-
-#: info/session.c:895
-msgid "No \"Next\" pointer for this node."
-msgstr "Aucun pointeur «Next» pour ce noeud."
-
-#: info/session.c:898
-msgid "Following \"Next\" node..."
-msgstr "En suivant le noeud «Next»..."
-
-#: info/session.c:899 info/session.c:927 info/session.c:999
-#: info/session.c:1717
-msgid "Next"
-msgstr "Noeud «Next»"
-
-#: info/session.c:915
-msgid "Selecting first menu item..."
-msgstr "Sélection du premier item menu..."
-
-#: info/session.c:926
-msgid "Selecting \"Next\" node..."
-msgstr "Sélection du noeud «Next»..."
-
-# Est-ce vraiment un message à traduire?
-#: info/session.c:950 info/session.c:1063 info/session.c:1733
-msgid "Up"
-msgstr "Noeud «Up»"
-
-#: info/session.c:1020
-msgid "No more nodes."
-msgstr "Aucun autre noeud."
-
-#: info/session.c:1044
-msgid "No \"Prev\" for this node."
-msgstr "Aucun noeud «Prev» pour ce noeud."
-
-#. Move to the previous node. If this node now contains a menu,
-#. and we have not inhibited movement to it, move to the node
-#. corresponding to the last menu item.
-#: info/session.c:1047 info/session.c:1100
-msgid "Moving \"Prev\" in this window."
-msgstr "Monter au noeud «Prev» dans cette fenêtre."
-
-# Est-ce vraiment un message à traduire?
-#: info/session.c:1048 info/session.c:1101 info/session.c:1725
-msgid "Prev"
-msgstr "Noeud «Prev»"
-
-#: info/session.c:1059
-msgid "No \"Prev\" or \"Up\" for this node."
-msgstr "Aucun noeud «Prev» ou «Up» pour ce noeud."
-
-#: info/session.c:1062
-msgid "Moving \"Up\" in this window."
-msgstr "Aller au noeud «Up» dans cette fenêtre."
-
-#: info/session.c:1110
-msgid "Moving to \"Prev\"'s last menu item."
-msgstr "Aller au dernier item menu du noeud «Prev»."
-
-#: info/session.c:1121
-msgid "Move forwards or down through node structure"
-msgstr "Avancer ou descendre à travers la structure de noeuds"
-
-#: info/session.c:1137
-msgid "Move backwards or up through node structure"
-msgstr "Reculer ou monter à travers la structure de noeuds"
-
-#. Show the next screen of WINDOW's node.
-#: info/session.c:1152
-msgid "Scroll forward in this window"
-msgstr "Défiler vers l'avant dans cette fenêtre"
-
-#. Show the previous screen of WINDOW's node.
-#: info/session.c:1197
-msgid "Scroll backward in this window"
-msgstr "Défiler vers l'arrière dans cette fenêtre"
-
-#. Move to the beginning of the node.
-#: info/session.c:1237
-msgid "Move to the start of this node"
-msgstr "Aller au point de départ de ce noeud"
-
-#. Move to the end of the node.
-#: info/session.c:1244
-msgid "Move to the end of this node"
-msgstr "Aller au point terminal de ce noeud"
-
-#. ****************************************************************
-#.
-#. Commands for Manipulating Windows
-#.
-#. ****************************************************************
-#. Make the next window in the chain be the active window.
-#: info/session.c:1257
-msgid "Select the next window"
-msgstr "Sélectionner la fenêtre suivante"
-
-#. Make the previous window in the chain be the active window.
-#: info/session.c:1296
-msgid "Select the previous window"
-msgstr "Sélectionner la fenêtre précédente"
-
-#. Split WINDOW into two windows, both showing the same node. If we
-#. are automatically tiling windows, re-tile after the split.
-#: info/session.c:1347
-msgid "Split the current window"
-msgstr "Diviser en deux la fenêtre courante"
-
-#. Delete WINDOW, forgetting the list of last visited nodes. If we are
-#. automatically displaying footnotes, show or remove the footnotes
-#. window. If we are automatically tiling windows, re-tile after the
-#. deletion.
-#: info/session.c:1428
-msgid "Delete the current window"
-msgstr "Éliminer la fenêtre courante"
-
-#: info/session.c:1436
-msgid "Cannot delete a permanent window"
-msgstr "Ne peut pas éliminer une fenêtre permanente"
-
-#. Just keep WINDOW, deleting all others.
-#: info/session.c:1469
-msgid "Delete all other windows"
-msgstr "Éliminer toutes les autres fenêtres"
-
-#. Scroll the "other" window of WINDOW.
-#: info/session.c:1515
-msgid "Scroll the other window"
-msgstr "Défiler l'autre fenêtre"
-
-#. Change the size of WINDOW by AMOUNT.
-#: info/session.c:1535
-msgid "Grow (or shrink) this window"
-msgstr "Agrandir (ou réduire) cette fenêtre"
-
-#: info/session.c:1546
-msgid "Divide the available screen space among the visible windows"
-msgstr "Répartir l'espace écran disponible parmi les fenêtres visibles"
-
-#: info/session.c:1553
-msgid "Toggle the state of line wrapping in the current window"
-msgstr "Basculer l'état du remplissage de ligne dans la fenêtre courante"
-
-#. Make WINDOW display the "Next:" node of the node currently being
-#. displayed.
-#: info/session.c:1714
-msgid "Select the `Next' node"
-msgstr "Sélectionner le noeud «Next»"
-
-#. Make WINDOW display the "Prev:" node of the node currently being
-#. displayed.
-#: info/session.c:1722
-msgid "Select the `Prev' node"
-msgstr "Sélectionner le noeud «Prev»"
-
-#. Make WINDOW display the "Up:" node of the node currently being
-#. displayed.
-#: info/session.c:1730
-msgid "Select the `Up' node"
-msgstr "Sélectionner le noeud «Up»"
-
-#. Make WINDOW display the last node of this info file.
-#: info/session.c:1737
-msgid "Select the last node in this file"
-msgstr "Sélectionner le dernier noeud dans ce fichier"
-
-#: info/session.c:1750 info/session.c:1768
-msgid "This window has no additional nodes"
-msgstr "Cette fenêtre a aucun noeud additionnel"
-
-#. Make WINDOW display the first node of this info file.
-#: info/session.c:1759
-msgid "Select the first node in this file"
-msgstr "Sélectionner le premier noeud dans ce fichier"
-
-#: info/session.c:1778
-msgid "Select the last item in this node's menu"
-msgstr "Sélectionner le dernier item dans ce menu de noeuds"
-
-#. Use KEY (a digit) to select the Nth menu item in WINDOW->node.
-#: info/session.c:1784
-msgid "Select this menu item"
-msgstr "Sélectionner cet item menu"
-
-#: info/session.c:1813
-#, c-format
-msgid "There aren't %d items in this menu."
-msgstr "Il n'y a pas %d items dans ce menu."
-
-#: info/session.c:1944
-#, c-format
-msgid "Menu item (%s): "
-msgstr "Item menu (%s): "
-
-#: info/session.c:1946
-msgid "Menu item: "
-msgstr "Item menu: "
-
-#: info/session.c:1951
-#, c-format
-msgid "Follow xref (%s): "
-msgstr "Suivre xref (%s): "
-
-#: info/session.c:1953
-msgid "Follow xref: "
-msgstr "Suivre xref: "
-
-#. Read a line (with completion) which is the name of a menu item,
-#. and select that item.
-#: info/session.c:2042
-msgid "Read a menu item and select its node"
-msgstr "Lire un item menu et sélectionner son noeud"
-
-#: info/session.c:2050
-msgid "Read a footnote or cross reference and select its node"
-msgstr ""
-"Lire une note en bas de page ou une référence croisée et sélectionner son "
-"noeud"
-
-#. Position the cursor at the start of this node's menu.
-#: info/session.c:2056
-msgid "Move to the start of this node's menu"
-msgstr "Aller au point de départ de ce menu de noeud"
-
-#: info/session.c:2080
-msgid "Visit as many menu items at once as possible"
-msgstr "Visiter d'un seul coup autant d'items menu que possible"
-
-#. Read a line of input which is a node name, and go to that node.
-#: info/session.c:2108
-msgid "Read a node name and select it"
-msgstr "Lire un nom de noeud et sélectionner ce noeud"
-
-#: info/session.c:2169 info/session.c:2173
-msgid "Goto Node: "
-msgstr "Aller au Noeud: "
-
-#: info/session.c:2194
-msgid "Read a manpage reference and select it"
-msgstr "Lire une référence de page-manuel et la sélectionner"
-
-#: info/session.c:2198
-msgid "Get Manpage: "
-msgstr "Obtenir la Page-manuel: "
-
-#. Move to the "Top" node in this file.
-#: info/session.c:2228
-msgid "Select the node `Top' in this file"
-msgstr "Sélectionner le noeud «Top» dans ce fichier"
-
-#. Notice that the node "Top" is special, and doesn't have to
-#. be referenced.
-#: info/session.c:2230 makeinfo/makeinfo.c:5145 makeinfo/makeinfo.c:5228
-msgid "Top"
-msgstr "Noeud «Top»"
-
-#. Move to the node "(dir)Top".
-#: info/session.c:2234
-msgid "Select the node `(dir)'"
-msgstr "Sélectionner le noeud «(dir)»"
-
-#: info/session.c:2254
-#, c-format
-msgid "Kill node (%s): "
-msgstr "Effacer le noeud (%s): "
-
-#: info/session.c:2307
-#, c-format
-msgid "Cannot kill node `%s'"
-msgstr "Ne peut pas effacer le noeud «%s»"
-
-#: info/session.c:2317
-msgid "Cannot kill the last node"
-msgstr "Ne peut pas effacer le dernier noeud"
-
-#: info/session.c:2401
-msgid "Select the most recently selected node"
-msgstr "Choisir le noeud qui a été le plus récemment sélectionné"
-
-#. Kill named node.
-#: info/session.c:2407
-msgid "Kill this node"
-msgstr "Effacer ce noeud"
-
-#. Read the name of a file and select the entire file.
-#: info/session.c:2415
-msgid "Read the name of a file and select it"
-msgstr "Lire le nom d'un fichier et le sélectionner"
-
-#: info/session.c:2419
-msgid "Find file: "
-msgstr "Trouver le fichier: "
-
-#: info/session.c:2436
-#, c-format
-msgid "Cannot find \"%s\"."
-msgstr "Ne peut pas trouver «%s»."
-
-#: info/session.c:2483 info/session.c:2608
-#, c-format
-msgid "Could not create output file \"%s\"."
-msgstr "Ne peut pas créer le fichier de sortie «%s»."
-
-#: info/session.c:2496 info/session.c:2625 info/session.c:2671
-msgid "Done."
-msgstr "Terminé."
-
-#: info/session.c:2553
-#, c-format
-msgid "Writing node \"(%s)%s\"..."
-msgstr "Écriture du noeud «(%s)%s»..."
-
-#: info/session.c:2556
-#, c-format
-msgid "Writing node \"%s\"..."
-msgstr "Écriture du noeud «%s»..."
-
-#: info/session.c:2634
-msgid "Pipe the contents of this node through INFO_PRINT_COMMAND"
-msgstr "Acheminer les contenus de ce noeud à travers INFO_PRINT_COMMAND"
-
-#: info/session.c:2654
-#, c-format
-msgid "Cannot open pipe to \"%s\"."
-msgstr "Ne peut pas ouvrir un tube de communication à «%s»."
-
-#: info/session.c:2661
-#, c-format
-msgid "Printing node \"(%s)%s\"..."
-msgstr "Impression du noeud «(%s)%s»..."
-
-#: info/session.c:2664
-#, c-format
-msgid "Printing node \"%s\"..."
-msgstr "Impression du noeud «%s»..."
-
-#: info/session.c:2896
-#, c-format
-msgid "Searching subfile \"%s\"..."
-msgstr "Fouille du sous-fichier «%s»..."
-
-#: info/session.c:2946
-msgid "Read a string and search for it"
-msgstr "Lire une chaîne et en faire la fouille"
-
-#: info/session.c:2966
-#, c-format
-msgid "%s for string [%s]: "
-msgstr "%s pour la chaîne [%s]: "
-
-#: info/session.c:2967
-msgid "Search backward"
-msgstr "Fouiller vers l'arrière"
-
-#: info/session.c:2967
-msgid "Search"
-msgstr "Fouiller"
-
-#: info/session.c:2994
-msgid "Search failed."
-msgstr "Fouille infructueuse."
-
-#: info/session.c:3020 info/session.c:3026
-msgid "Search interactively for a string as you type it"
-msgstr "Fouiller interactivement pour une chaîne telle que vous la tapez"
-
-#: info/session.c:3120
-msgid "I-search backward: "
-msgstr "Fouille I-search vers l'arrière: "
-
-#: info/session.c:3122
-msgid "I-search: "
-msgstr "Fouille I-search: "
-
-#: info/session.c:3147
-msgid "Failing "
-msgstr "Échec "
-
-#: info/session.c:3512
-msgid "No cross references in this node."
-msgstr "Aucune référence croisée dans ce noeud."
-
-#: info/session.c:3579
-msgid "Move to the previous cross reference"
-msgstr "Aller à la référence croisée précédente"
-
-#: info/session.c:3588
-msgid "Move to the next cross reference"
-msgstr "Aller à la prochaine référence croisée"
-
-#: info/session.c:3598
-msgid "Select reference or menu item appearing on this line"
-msgstr "Sélectionner la référence ou l'item menu apparaissant sur cette ligne"
-
-#. ****************************************************************
-#.
-#. Miscellaneous Info Commands
-#.
-#. ****************************************************************
-#. What to do when C-g is pressed in a window.
-#: info/session.c:3620
-msgid "Cancel current operation"
-msgstr "Annuler l'opération courante"
-
-#: info/session.c:3627
-msgid "Quit"
-msgstr "Quitter"
-
-#: info/session.c:3636
-msgid "Move to the cursor to a specific line of the window"
-msgstr "Déplacer le curseur sur une ligne spécifique de la fenêtre"
-
-#. Clear the screen and redraw its contents. Given a numeric argument,
-#. move the line the cursor is on to the COUNT'th line of the window.
-#: info/session.c:3668
-msgid "Redraw the display"
-msgstr "Redessiner l'affichage écran"
-
-#. This command does nothing. It is the fact that a key is bound to it
-#. that has meaning. See the code at the top of info_session ().
-#: info/session.c:3705
-msgid "Quit using Info"
-msgstr "Quitter en utilisant Info"
-
-#: info/session.c:3728
-#, c-format
-msgid "Unknown command (%s)."
-msgstr "Commande inconnue (%s)."
-
-# Est-ce que c'est " " ou « » comme caractères?
-#: info/session.c:3733
-msgid "\"\" is invalid"
-msgstr "\"\" est invalide"
-
-#: info/session.c:3735
-#, c-format
-msgid "\"%s\" is invalid"
-msgstr "«%s» est invalide"
-
-#: info/session.c:3958
-msgid "Add this digit to the current numeric argument"
-msgstr "Ajouter ce chiffre à l'argument numérique courant"
-
-#: info/session.c:3967
-msgid "Start (or multiply by 4) the current numeric argument"
-msgstr "Enclencher (ou multipler par 4) l'argument numérique courant"
-
-#: info/session.c:3982
-msgid "Internally used by \\[universal-argument]"
-msgstr "Utilisé internement par \\[universal-argument]"
-
-#: info/tilde.c:362
-msgid "readline: Out of virtual memory!\n"
-msgstr ""
-
-#: info/variables.c:40
-msgid "When \"On\", footnotes appear and disappear automatically"
-msgstr ""
-"Lorsque «On» est en fonction, les notes en bas de page apparaissent\n"
-"et disparaissent automatiquement"
-
-#: info/variables.c:44
-msgid "When \"On\", creating or deleting a window resizes other windows"
-msgstr ""
-"Lorsque «On» est en fonction, la création ou l'effacement d'une fenêtre\n"
-"réajuste la dimension des autres fenêtres"
-
-#: info/variables.c:48
-msgid "When \"On\", flash the screen instead of ringing the bell"
-msgstr ""
-"Lorsque «On» est en fonction, un clignotement d'écran est utilisé plutôt\n"
-"qu'un bruit de cloche"
-
-#: info/variables.c:52
-msgid "When \"On\", errors cause the bell to ring"
-msgstr ""
-"Lorsque «On» est en fonction, les erreurs sont signalées par un\n"
-"bruit de cloche"
-
-#: info/variables.c:56
-msgid "When \"On\", Info garbage collects files which had to be uncompressed"
-msgstr ""
-"Lorsque «On» est en fonction, le ramasse-miette Info récolte les fichiers\n"
-"qui devaient être décomprimés"
-
-#: info/variables.c:59
-msgid "When \"On\", the portion of the matched search string is highlighted"
-msgstr ""
-"Lorsque «On» est en fonction, la portion de la chaîne de fouille appariée\n"
-"est mise en surbrillance"
-
-#: info/variables.c:63
-msgid "Controls what happens when scrolling is requested at the end of a node"
-msgstr ""
-"Contrôler ce qui arrive lorsqu'un défilement est requis à la fin d'un noeud"
-
-#: info/variables.c:67
-msgid "The number lines to scroll when the cursor moves out of the window"
-msgstr "Le nombre de lignes à défiler quand le curseur va hors de la fenêtre"
-
-#: info/variables.c:71
-msgid "When \"On\", Info accepts and displays ISO Latin characters"
-msgstr ""
-"Lorsque «On» est en fonction, Info accepte et affiche les caractères ISO "
-"Latin"
-
-#: info/variables.c:77
-msgid "Explain the use of a variable"
-msgstr "Expliquer l'usage d'une variable"
-
-#. Get the variable's name.
-#: info/variables.c:83
-msgid "Describe variable: "
-msgstr "Décrire la variable: "
-
-#: info/variables.c:102
-msgid "Set the value of an Info variable"
-msgstr "Fixer la valeur d'une variable Info"
-
-#. Get the variable's name and value.
-#: info/variables.c:108
-msgid "Set variable: "
-msgstr "Fixer la variable: "
-
-#: info/variables.c:126
-#, c-format
-msgid "Set %s to value (%d): "
-msgstr "Fixer %s à la valeur (%d): "
-
-#: info/variables.c:167
-#, c-format
-msgid "Set %s to value (%s): "
-msgstr "Fixer %s à la valeur (%s): "
-
-# Est-ce vraiment un message à traduire?
-#: info/window.c:1102
-msgid "--*** Tags out of Date ***"
-msgstr "--*** Étiquettes passées Date ***"
-
-#. strlen (location_indicator).
-#. 10 for the decimal representation of the number of lines in this
-#. node, and the remainder of the text that can appear in the line.
-#: info/window.c:1113
-msgid "-----Info: (), lines ----, "
-msgstr "-----Info: (), lignes ----, "
-
-#: info/window.c:1120
-#, c-format
-msgid "-%s---Info: %s, %d lines --%s--"
-msgstr "-%s---Info: %s, %d lignes --%s--"
-
-#: info/window.c:1124
-#, c-format
-msgid "-%s%s-Info: (%s)%s, %d lines --%s--"
-msgstr "-%s%s-Info: (%s)%s, %d lignes --%s--"
-
-#: info/window.c:1131
-#, c-format
-msgid " Subfile: %s"
-msgstr " Sous-fichier: %s"
-
-#: lib/getopt.c:672
-#, c-format
-msgid "%s: option `%s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:696
-#, c-format
-msgid "%s: option `--%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:701
-#, c-format
-msgid "%s: option `%c%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:718 lib/getopt.c:891
-#, fuzzy, c-format
-msgid "%s: option `%s' requires an argument\n"
-msgstr "%c%s nécessite un nom"
-
-#. --option
-#: lib/getopt.c:747
-#, c-format
-msgid "%s: unrecognized option `--%s'\n"
-msgstr ""
-
-#. +option or -option
-#: lib/getopt.c:751
-#, c-format
-msgid "%s: unrecognized option `%c%s'\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:777
-#, c-format
-msgid "%s: illegal option -- %c\n"
-msgstr ""
-
-#: lib/getopt.c:780
-#, c-format
-msgid "%s: invalid option -- %c\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:810 lib/getopt.c:940
-#, fuzzy, c-format
-msgid "%s: option requires an argument -- %c\n"
-msgstr "%s exige un argument: le formateur pour %citem"
-
-#: lib/getopt.c:857
-#, c-format
-msgid "%s: option `-W %s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:875
-#, c-format
-msgid "%s: option `-W %s' doesn't allow an argument\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:893
-#, c-format
-msgid "%s:%d: warning: "
-msgstr "%s:%d: AVERTISSEMENT: "
-
-#: makeinfo/makeinfo.c:916
-msgid "Too many errors! Gave up.\n"
-msgstr "Beaucoup trop d'erreurs! Abandon.\n"
-
-#: makeinfo/makeinfo.c:975 makeinfo/makeinfo.c:1000 makeinfo/makeinfo.c:1068
-#, c-format
-msgid "%s: %s arg must be numeric, not `%s'.\n"
-msgstr "%s: l'argument %s doit être numérique, non pas «%s».\n"
-
-#: makeinfo/makeinfo.c:989
-#, c-format
-msgid "Couldn't open macro expansion output `%s'"
-msgstr "Ne peut ouvrir la sortie d'expansion de macro «%s»"
-
-#: makeinfo/makeinfo.c:992
-msgid "Cannot specify more than one macro expansion output"
-msgstr "Ne peut spécifier plus d'une sortie d'expansion de macro"
-
-#: makeinfo/makeinfo.c:1036
-#, c-format
-msgid "%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"
-msgstr ""
-"%s: l'argument de l'option --paragraph-indent doit être numérique, «none» "
-"ou\n"
-"«asis», non pas «%s».\n"
-
-#: makeinfo/makeinfo.c:1079
-#, c-format
-msgid "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"
-msgstr ""
-"%s: l'argument de l'option --footnote-style doit être «separate» ou\n"
-"«end», non pas «%s».\n"
-
-#: makeinfo/makeinfo.c:1110
-#, c-format
-msgid "%s: missing file argument.\n"
-msgstr "%s: absence d'un argument fichier.\n"
-
-#: makeinfo/makeinfo.c:1163
-#, c-format
-msgid "Try `%s --help' for more information.\n"
-msgstr "Pour en savoir davantage, faites: «%s --help».\n"
-
-#: makeinfo/makeinfo.c:1165
-#, fuzzy, c-format
-msgid ""
-"Usage: %s [OPTION]... TEXINFO-FILE...\n"
-"\n"
-"Translate Texinfo source documentation to a format suitable for reading\n"
-"with GNU Info.\n"
-"\n"
-"Options:\n"
-"-D VAR define a variable, as with @set.\n"
-"-E MACRO-OFILE process macros only, output texinfo source.\n"
-"-I DIR append DIR to the @include directory search path.\n"
-"-P DIR prepend DIR to the @include directory search path.\n"
-"-U VAR undefine a variable, as with @clear.\n"
-"--error-limit NUM quit after NUM errors (default %d).\n"
-"--fill-column NUM break lines at NUM characters (default %d).\n"
-"--footnote-style STYLE output footnotes according to STYLE:\n"
-" `separate' to place footnotes in their own node,\n"
-" `end' to place the footnotes at the end of\n"
-" the node in which they are defined (the default).\n"
-"--force preserve output even if errors.\n"
-"--help display this help and exit.\n"
-"--no-validate suppress node cross-reference validation.\n"
-"--no-warn suppress warnings (but not errors).\n"
-"--no-split suppress splitting of large files.\n"
-"--no-headers suppress node separators and Node: Foo headers.\n"
-"--output FILE, -o FILE output to FILE, and ignore any @setfilename.\n"
-"--paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n"
-" if VAL is `none', do not indent; if VAL is `asis',\n"
-" preserve any existing indentation.\n"
-"--reference-limit NUM complain about at most NUM references (default %d).\n"
-"--verbose report about what is being done.\n"
-"--version display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-"Usage: %s [OPTION]... FICHIER-TEXINFO...\n"
-"\n"
-"Traduire une documentation source en format Texinfo vers un format "
-"approprié\n"
-"pour une lecture avec GNU Info.\n"
-"\n"
-"Options:\n"
-"-D VAR Définir une variable, comme avec @set.\n"
-"-E MACRO-OFILE Exécuter les macros seulement, sortir un source "
-"texinfo.\n"
-"-I DIR Ajouter à la fin DIR dans la fouille de répertoires\n"
-" pour @include.\n"
-"-P DIR Ajouter au début DIR dans la fouille de répertoires\n"
-" pour @include.\n"
-"-U VAR Rendre indéfinie une variable, comme avec @clear.\n"
-"--error-limit NUM Quitter après NUM erreurs (par défaut %d).\n"
-"--fill-column NUM Tronquer les lignes à NUM caractères (par défaut "
-"%d).\n"
-"--footnote-style STYLE Sortir les notes en bas de page selon l'option "
-"STYLE:\n"
-" «separate» pour placer les notes dans leur propre "
-"noeud,\n"
-" «end» pour les placer à la fin du noeud dans lequel\n"
-" elles ont été définies (valeur par défaut).\n"
-"--force Conserver la sortie même s'il y a des erreurs.\n"
-"--help Afficher l'aide-mémoire.\n"
-"--no-validate Supprimer la validation de la table de référence\n"
-" des noeuds.\n"
-"--no-warn Supprimer les avertissements (mais pas les erreurs).\n"
-"--no-split Supprimer la troncation de fichiers volumineux.\n"
-"--no-headers Supprimer les séparateurs de noeud et Node: Foo "
-"headers.\n"
-"--output FICHIER, -o FICHIER Écrire dans le FICHIER, et ignorer tous\n"
-" les @setfilename.\n"
-"--paragraph-indent VAL Indenter les paragraphes de VAL espaces (%d par "
-"défaut).\n"
-" Si VAL est «none», ne pas indenter; si VAL est "
-"«asis»,\n"
-" conserver toute valeur d'indentation existante.\n"
-"--reference-limit NUM Avertir après plus de NUM références (%d par "
-"défaut).\n"
-"--verbose Utiliser le mode bavard et indiquer ce qui a été "
-"fait.\n"
-"--version Afficher le nom et la version du logiciel.\n"
-"\n"
-"Rapporter toute anomalie à bug-texinfo@prep.ai.mit.edu.\n"
-
-#: makeinfo/makeinfo.c:1552
-#, c-format
-msgid "%s: getwd: %s, %s\n"
-msgstr "%s: getwd: %s, %s\n"
-
-#: makeinfo/makeinfo.c:1748
-#, c-format
-msgid "Expected `%s'"
-msgstr "«%s» attendue"
-
-#: makeinfo/makeinfo.c:2082
-#, c-format
-msgid "No `%s' found in `%s'"
-msgstr "Aucun «%s» trouvé dans «%s»"
-
-#: makeinfo/makeinfo.c:2132
-#, c-format
-msgid "%s: Skipping macro expansion to stdout as Info output is going there.\n"
-msgstr ""
-"%s: Sauter l'expansion de macro qui irait sur stdout comme la sortie Info.\n"
-
-#: makeinfo/makeinfo.c:2151
-#, c-format
-msgid "Making %s file `%s' from `%s'.\n"
-msgstr "Fabrication du fichier %s «%s» à partir de «%s».\n"
-
-#: makeinfo/makeinfo.c:2181
-#, c-format
-msgid "This is Info file %s, produced by Makeinfo version %d.%d"
-msgstr "Ceci est le fichier Info %s, produit par Makeinfo version %d.%d"
-
-#: makeinfo/makeinfo.c:2183
-#, c-format
-msgid " from the input file %s.\n"
-msgstr "à partir du fichier d'entrée «%s».\n"
-
-#: makeinfo/makeinfo.c:2202
-#, c-format
-msgid ""
-"%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-"%s: Enlèvement du fichier de sortie de macro «%s» à cause d'erreurs;\n"
-"utiliser l'option --force pour préserver.\n"
-
-#. If there were errors, and no --force, remove the output.
-#: makeinfo/makeinfo.c:2234
-#, c-format
-msgid "%s: Removing output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-"%s: Enlèvement du fichier de sortie «%s» à cause d'erreurs;\n"
-"utiliser l'option --force pour préserver.\n"
-
-#. Special case. I'm not supposed to see this character by itself.
-#. If I do, it means there is a syntax error in the input text.
-#. Report the error here, but remember this brace on the stack so
-#. you can ignore its partner.
-#: makeinfo/makeinfo.c:2374 makeinfo/makeinfo.c:7629
-#, c-format
-msgid "Misplaced %c"
-msgstr "%c égarée ou mal placée"
-
-#: makeinfo/makeinfo.c:2461
-#, c-format
-msgid "Unknown command `%s'"
-msgstr "Commande inconnue «%s»."
-
-#: makeinfo/makeinfo.c:2481
-msgid "NO_NAME!"
-msgstr "NOM_INCONNU!"
-
-#: makeinfo/makeinfo.c:2495
-#, c-format
-msgid "%c%s expected `{...}'"
-msgstr "%c%s exigeant des accolades «{...}»"
-
-#: makeinfo/makeinfo.c:2528
-msgid "Unmatched }"
-msgstr "Accolade «}» non appariée"
-
-#: makeinfo/makeinfo.c:2576
-#, c-format
-msgid "%c%s missing close brace"
-msgstr "%c%s sans accolade fermante"
-
-#: makeinfo/makeinfo.c:3372
-msgid "Broken-Type in insertion_type_pname"
-msgstr "Type impossible dans la fonction insertion_type_pname"
-
-#: makeinfo/makeinfo.c:3438
-msgid "Enumeration stack overflow"
-msgstr "Débordement de la pile d'énumérations"
-
-#: makeinfo/makeinfo.c:3470
-#, c-format
-msgid "lettering overflow, restarting at %c"
-msgstr "débordement du lettrage, reprise à partir de %c"
-
-#: makeinfo/makeinfo.c:3509
-msgid "* Menu:\n"
-msgstr "* Menu:\n"
-
-#: makeinfo/makeinfo.c:3593
-#, c-format
-msgid "%s requires an argument: the formatter for %citem"
-msgstr "%s exige un argument: le formateur pour %citem"
-
-#: makeinfo/makeinfo.c:3697
-#, c-format
-msgid "`%cend' expected `%s', but saw `%s'"
-msgstr "«%cend» attendait «%s», mais a vu «%s»"
-
-#: makeinfo/makeinfo.c:3810
-#, c-format
-msgid "No matching `%cend %s'"
-msgstr "«%cend %s» non apparié"
-
-#: makeinfo/makeinfo.c:3949
-#, c-format
-msgid "How did @%s end up in cm_special_char?\n"
-msgstr "Comment le caractère @%s a-t-il pu aboutir dans cm_special_char?\n"
-
-#. This error message isn't perfect if the argument is multiple
-#. characters, but it doesn't seem worth getting right.
-#: makeinfo/makeinfo.c:3963
-#, c-format
-msgid "%c%s expects `i' or `j' as argument, not `%c'"
-msgstr "%c%s s'attend à argument «i» ou «j», non pas «%c»"
-
-#: makeinfo/makeinfo.c:3967
-#, c-format
-msgid "%c%s expects a single character `i' or `j' as argument"
-msgstr "%c%s attend un argument d'un seul caractère «i» ou «j»"
-
-#: makeinfo/makeinfo.c:3979
-msgid "January"
-msgstr "janvier"
-
-#: makeinfo/makeinfo.c:3979
-msgid "February"
-msgstr "février"
-
-#: makeinfo/makeinfo.c:3979
-msgid "March"
-msgstr "mars"
-
-#: makeinfo/makeinfo.c:3979
-msgid "April"
-msgstr "avril"
-
-#: makeinfo/makeinfo.c:3979
-msgid "May"
-msgstr "mai"
-
-#: makeinfo/makeinfo.c:3980
-msgid "June"
-msgstr "juin"
-
-#: makeinfo/makeinfo.c:3980
-msgid "July"
-msgstr "juillet"
-
-#: makeinfo/makeinfo.c:3980
-msgid "August"
-msgstr "août"
-
-#: makeinfo/makeinfo.c:3980
-msgid "September"
-msgstr "septembre"
-
-#: makeinfo/makeinfo.c:3980
-msgid "October"
-msgstr "octobre"
-
-#: makeinfo/makeinfo.c:3981
-msgid "November"
-msgstr "novembre"
-
-#: makeinfo/makeinfo.c:3981
-msgid "December"
-msgstr "décembre"
-
-#: makeinfo/makeinfo.c:4039
-#, c-format
-msgid "%c%s expects a single character as an argument"
-msgstr "%c%s s'attend à un seul caractère comme argument"
-
-#: makeinfo/makeinfo.c:4153
-#, c-format
-msgid "%c%s is obsolete"
-msgstr "%c%s est périmé"
-
-#: makeinfo/makeinfo.c:4325
-#, c-format
-msgid "Node with %ctop as a section already exists"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4337
-#, c-format
-msgid "Here is the %ctop node"
-msgstr "Le noeud %ctop se trouve ici"
-
-#: makeinfo/makeinfo.c:4356
-#, c-format
-msgid "%ctop used before %cnode, defaulting to %s"
-msgstr "noeud %ctop utilisé avant %cnode, %s implicitement"
-
-#: makeinfo/makeinfo.c:4431
-#, c-format
-msgid "%c%s is obsolete; use %c%s instead"
-msgstr "%c%s est périmé; utiliser %c%s à la place"
-
-#: makeinfo/makeinfo.c:4680
-#, c-format
-msgid "Node `%s' multiply defined (line %d is first definition at)"
-msgstr "Noeud «%s» ayant plusieurs définitions (ligne %d étant la première)"
-
-#: makeinfo/makeinfo.c:4753
-#, c-format
-msgid "Formatting node %s...\n"
-msgstr "Écriture du noeud «%s»...\n"
-
-#: makeinfo/makeinfo.c:4802
-#, c-format
-msgid "Node `%s' requires a sectioning command (e.g. %c%s)"
-msgstr "Le noeud «%s» exige une commande de subdivision (e.g. %c%s)"
-
-#: makeinfo/makeinfo.c:5085
-#, c-format
-msgid "Node `%s''s Next field not pointed back to"
-msgstr "Le champ Next du noeud «%s» n'a pas de pointeur de retour en amont"
-
-#: makeinfo/makeinfo.c:5090
-#, c-format
-msgid "This node (`%s') is the one with the bad `Prev'"
-msgstr "Ce noeud («%s») est celui dont le champ «Prev» est erroné"
-
-#: makeinfo/makeinfo.c:5130
-#, c-format
-msgid "Node `%s's Prev field not pointed back to"
-msgstr "Le champ Prev du noeud «%s» n'a pas de pointeur de retour en amont"
-
-#: makeinfo/makeinfo.c:5134
-#, c-format
-msgid "This node (`%s') has the bad Next"
-msgstr "Ce noeud («%s») est celui dont le champ «Next» est erroné"
-
-#: makeinfo/makeinfo.c:5146
-#, c-format
-msgid "Node `%s' missing Up field"
-msgstr "Le noeud «%s» a un champ «Up» manquant"
-
-#: makeinfo/makeinfo.c:5186
-#, c-format
-msgid "`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"
-msgstr ""
-"Le noeud «%s» a un champ Up de «%s», mais «%s» n'a aucun item menu pour «%s»"
-
-#: makeinfo/makeinfo.c:5217
-#, c-format
-msgid "node `%s' has been referenced %d times"
-msgstr "Le noeud «%s» a été référencé %d fois"
-
-#: makeinfo/makeinfo.c:5229
-#, c-format
-msgid "unreferenced node `%s'"
-msgstr "noeud «%s» non référencé"
-
-#: makeinfo/makeinfo.c:5256
-#, c-format
-msgid "%s reference to nonexistent node `%s'"
-msgstr "%s réfère au noeud «%s» non existant"
-
-#: makeinfo/makeinfo.c:5668 makeinfo/makeinfo.c:5680
-#, c-format
-msgid "%cmenu seen before first node"
-msgstr "%cmenu avant même le premier noeud"
-
-#: makeinfo/makeinfo.c:5669 makeinfo/makeinfo.c:5681
-msgid "creating `Top' node"
-msgstr "création du noeud «TOP»"
-
-#: makeinfo/makeinfo.c:5794
-#, c-format
-msgid "`.' or `,' must follow cross reference, not %c"
-msgstr "«.» ou «,» doit suivre une référence croisée, non pas %c"
-
-#: makeinfo/makeinfo.c:5962
-#, c-format
-msgid "@image file `%s' unreadable: %s"
-msgstr "fichier «%s» dans la commande @image est illisible: %s"
-
-#: makeinfo/makeinfo.c:5966
-msgid "@image missing filename argument"
-msgstr "absence d'un argument fichier dans la commande @image"
-
-#: makeinfo/makeinfo.c:6067
-#, c-format
-msgid "%s requires letter or digit"
-msgstr "%s exige une lettre ou un chiffre"
-
-#: makeinfo/makeinfo.c:6152
-#, c-format
-msgid "Unmatched `%c%s'"
-msgstr "«%c%s» non apparié"
-
-#: makeinfo/makeinfo.c:6159
-#, c-format
-msgid "`%c%s' needs something after it"
-msgstr "«%c%s» a besoin de quelque chose après lui"
-
-#: makeinfo/makeinfo.c:6165
-#, c-format
-msgid "Bad argument to `%s', `%s', using `%s'"
-msgstr "Mauvais argument à «%s», «%s», utilisant «%s»"
-
-#: makeinfo/makeinfo.c:6338
-#, c-format
-msgid "{No Value For \"%s\"}"
-msgstr "{Aucune Valeur Pour «%s»}"
-
-#: makeinfo/makeinfo.c:6388
-#, c-format
-msgid "%c%s requires a name"
-msgstr "%c%s nécessite un nom"
-
-#: makeinfo/makeinfo.c:6496
-#, c-format
-msgid "Reached eof before matching @end %s"
-msgstr "Fin de fichier rencontré avant l'appariement de @end %s"
-
-#: makeinfo/makeinfo.c:6722
-#, c-format
-msgid "The `%c%s' command is meaningless within a `@%s' block"
-msgstr "La commande «%c%s» est inactive dans un bloc «@%s»"
-
-#: makeinfo/makeinfo.c:6731
-#, c-format
-msgid "%citemx is not meaningful inside of a `%s' block"
-msgstr "%citemx est inactif à l'intérieur d'un bloc «%s»"
-
-#: makeinfo/makeinfo.c:6844
-#, c-format
-msgid "%c%s found outside of an insertion block"
-msgstr "%c%s est trouvé à l'extérieur d'un bloc d'insertion"
-
-#: makeinfo/makeinfo.c:6935
-#, c-format
-msgid "Missing `}' in %cdef arg"
-msgstr "Accolade «}» manquante dans le paramètre %cdef"
-
-#: makeinfo/makeinfo.c:7144 makeinfo/makeinfo.c:7164
-msgid "Function"
-msgstr "Fonction"
-
-#: makeinfo/makeinfo.c:7148
-msgid "Macro"
-msgstr "Macro"
-
-#: makeinfo/makeinfo.c:7152
-msgid "Special Form"
-msgstr "Forme Spéciale"
-
-#: makeinfo/makeinfo.c:7156 makeinfo/makeinfo.c:7168
-msgid "Variable"
-msgstr "Variable"
-
-#: makeinfo/makeinfo.c:7160
-msgid "User Option"
-msgstr "Option de l'Usager"
-
-#: makeinfo/makeinfo.c:7172
-msgid "Instance Variable"
-msgstr "Variable d'Instance"
-
-#: makeinfo/makeinfo.c:7176 makeinfo/makeinfo.c:7180
-msgid "Method"
-msgstr "Méthode"
-
-#: makeinfo/makeinfo.c:7335
-#, c-format
-msgid "Must be in a `%s' insertion in order to use `%s'x"
-msgstr "Doit être dans une insertion «%s» afin d'utiliser «%s»x."
-
-#: makeinfo/makeinfo.c:7407
-#, c-format
-msgid "%csp requires a positive numeric argument"
-msgstr "%csp exige un argument numérique positif"
-
-#: makeinfo/makeinfo.c:7650
-msgid "asis"
-msgstr "«asis»"
-
-#: makeinfo/makeinfo.c:7652
-msgid "none"
-msgstr "«none»"
-
-#: makeinfo/makeinfo.c:7674
-#, c-format
-msgid "Bad argument to %c%s"
-msgstr "Mauvais argument à %c%s"
-
-#: makeinfo/makeinfo.c:7966
-#, c-format
-msgid "Unknown index `%s'"
-msgstr "Nom d'index inconnu «%s»"
-
-#: makeinfo/makeinfo.c:8031
-#, c-format
-msgid "Index `%s' already exists"
-msgstr "L'index «%s» existe toujours"
-
-#: makeinfo/makeinfo.c:8062
-#, c-format
-msgid "Unknown index `%s' and/or `%s' in @synindex"
-msgstr "Nom d'index «%s» inconnu et/ou «%s» dans @synindex"
-
-#: makeinfo/makeinfo.c:8251
-#, c-format
-msgid "Unknown index `%s' in @printindex"
-msgstr "Nom d'index «%s» inconnu dans @printindex"
-
-#: makeinfo/makeinfo.c:8266
-msgid ""
-"* Menu:\n"
-"\n"
-msgstr ""
-"* Menu:\n"
-"\n"
-
-#: makeinfo/makeinfo.c:8453
-#, c-format
-msgid "`%c%s' needs an argument `{...}', not just `%s'"
-msgstr "«%c%s» nécessite un argument «{...}», non pas «%s» seulement"
-
-#: makeinfo/makeinfo.c:8468
-#, c-format
-msgid "No closing brace for footnote `%s'"
-msgstr "Accolade fermante «}» manquante pour la note en bas de page «%s»"
-
-#: makeinfo/makeinfo.c:8507
-msgid "Footnote defined without parent node"
-msgstr "La note en bas de page est définie sans noeud parent"
-
-# Est-ce vraiement un message à traduire?
-#: makeinfo/makeinfo.c:8539
-msgid "-Footnotes"
-msgstr "-Footnotes"
-
-# Est-ce vraiment un message à traduire? NON.
-#: makeinfo/makeinfo.c:8594
-msgid ""
-"---------- Footnotes ----------\n"
-"\n"
-msgstr ""
-"--------- Notes en bas de page ---------\n"
-"\n"
-
-#: makeinfo/makeinfo.c:8690
-#, c-format
-msgid "macro `%s' previously defined"
-msgstr "macro «%s» déjà définie précédemment"
-
-#: makeinfo/makeinfo.c:8694
-#, c-format
-msgid "here is the previous definition of `%s'"
-msgstr "ici se trouve la définition précédente de «%s»"
-
-#: makeinfo/makeinfo.c:8908
-#, c-format
-msgid "Macro `%s' called with too many args"
-msgstr "Macro «%s» appelée avec trop d'arguments"
-
-#: makeinfo/makeinfo.c:9060
-#, c-format
-msgid "%cend macro not found"
-msgstr "macro %cend non trouvée"
-
-#: makeinfo/makeinfo.c:9100
-#, c-format
-msgid "%cquote-arg only useful when the macro takes a single argument"
-msgstr "%cquote-arg utile seulement lorsque la macro prend un seul argument"
-
-#: makeinfo/multi.c:206
-#, c-format
-msgid "ignoring stray text `%s' after @multitable"
-msgstr "abandon du texte orphelin «%s» après la commande @multitable"
-
-#: makeinfo/multi.c:277
-#, c-format
-msgid "Too many columns in multitable item (max %d)"
-msgstr "Trop de colonnes dans un item de multitable (%d max)"
-
-#. impossible, I think.
-#: makeinfo/multi.c:304
-msgid "multitable item not in active multitable"
-msgstr "item de multitable qui n'est pas dans une multitable active"
-
-#: makeinfo/multi.c:313
-#, c-format
-msgid "Cannot select column #%d in multitable"
-msgstr "Ne peut pas sélectionner la colonne #%d dans une multitable."
-
-#: makeinfo/multi.c:404
-msgid "ignoring @tab outside of multitable"
-msgstr "inhibition d'une commande @tab à l'extérieur d'une multitable"
-
-#: makeinfo/multi.c:428
-msgid "** Multicolumn output from last row:\n"
-msgstr "** Sortie en multicolonnes à partir de la dernière rangée:\n"
-
-#: makeinfo/multi.c:431
-#, c-format
-msgid "* column #%d: output = %s\n"
-msgstr "* colonne #%d: sortie = %s\n"
-
-#: util/install-info.c:123 util/install-info.c:136
-msgid "virtual memory exhausted"
-msgstr "mémoire virtuelle épuisée"
-
-#: util/install-info.c:192
-#, c-format
-msgid "%s: warning: "
-msgstr "%s: AVERTISSEMENT: "
-
-#: util/install-info.c:213
-#, c-format
-msgid " for %s"
-msgstr " pour %s"
-
-#: util/install-info.c:282
-#, c-format
-msgid "\tTry `%s --help' for a complete list of options.\n"
-msgstr "Pour avoir la liste complète des options, faites «%s --help».\n"
-
-#: util/install-info.c:290
-#, fuzzy, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n"
-"\n"
-"Install INFO-FILE in the Info directory file DIR-FILE.\n"
-"\n"
-"Options:\n"
-"--delete Delete existing entries in INFO-FILE;\n"
-" don't insert any new entries.\n"
-"--dir-file=NAME Specify file name of Info directory file.\n"
-" This is equivalent to using the DIR-FILE argument.\n"
-"--entry=TEXT Insert TEXT as an Info directory entry.\n"
-" TEXT should have the form of an Info menu item line\n"
-" plus zero or more extra lines starting with whitespace.\n"
-" If you specify more than one entry, they are all added.\n"
-" If you don't specify any entries, they are determined\n"
-" from information in the Info file itself.\n"
-"--help Display this help and exit.\n"
-"--info-file=FILE Specify Info file to install in the directory.\n"
-" This is equivalent to using the INFO-FILE argument.\n"
-"--info-dir=DIR Same as --dir-file=DIR/dir.\n"
-"--item=TEXT Same as --entry TEXT.\n"
-" An Info directory entry is actually a menu item.\n"
-"--quiet Suppress warnings.\n"
-"--remove Same as --delete.\n"
-"--section=SEC Put this file's entries in section SEC of the directory.\n"
-" If you specify more than one section, all the entries\n"
-" are added in each of the sections.\n"
-" If you don't specify any sections, they are determined\n"
-" from information in the Info file itself.\n"
-"--version Display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-"%s [OPTION]... [INFO-FICHIER [DIR-FICHIER]]\n"
-" Installer INFO-FICHIER dans le répertoire DIR-FICHIER de fichiers Info.\n"
-"\n"
-"Options:\n"
-"--delete Éliminer les entrées existantes dans INFO-FICHIER;\n"
-" ne pas insérer une quelconque nouvelle entrée.\n"
-"--dir-file=NOM Spécifier le NOM du répertoire de fichiers Info.\n"
-" Ceci équivaut à utiliser l'argument DIR-FICHIER.\n"
-"--entry=TEXTE Insérer TEXTE comme une entrée du répertoire Info.\n"
-" TEXTE doit avoir la forme d'une ligne d'item de menu\n"
-" Info avec zéro ou plusieurs lignes en extra commençant\n"
-" par un blanc. Si plus d'une entrée est spécifiée,\n"
-" elles seront toutes ajoutées. Si aucune entrée n'est\n"
-" spécifiée, elles seront déterminées à partir de\n"
-" l'information dans le fichier Info lui-même.\n"
-"--help Afficher l'aide-mémoire.\n"
-"--info-file=FICHIER Spécifier le FICHIER Info à installer dans le\n"
-" répertoire de fichiers Info. Ceci équivaut à utiliser\n"
-" l'argument INFO-FICHIER.\n"
-"--info-dir=RÉP Identique à l'option --dir-file=RÉP/dir.\n"
-"--item=TEXTE Identique à l'option --entry=TEXTE\n"
-" Une entrée de répertoire Info est en fait un item menu.\n"
-"--quiet Supprimer les avertissements.\n"
-"--remove Identique à l'option --delete.\n"
-"--section=SEC Mettre cette entrée de fichier dans la section SEC du\n"
-" répertoire. Si plus d'une section est spécifiée,\n"
-" toutes les entrées sont ajoutées dans chacune des\n"
-" sections. Si aucune section n'est spécifiée, elles\n"
-" seront déterminées à partir de l'information dans\n"
-" le fichier Info lui-même.\n"
-"--version Afficher le nom et la version du logiciel.\n"
-"\n"
-"Rapporter toute anomalie à bug-texinfo@prep.ai.mit.edu.\n"
-
-#: util/install-info.c:341
-#, fuzzy
-msgid ""
-"This is the file .../info/dir, which contains the\n"
-"topmost node of the Info hierarchy, called (dir)Top.\n"
-"The first time you invoke Info you start off looking at this node.\n"
-"\n"
-"File: dir,\tNode: Top,\tThis is the top of the INFO tree\n"
-"\n"
-" This (the Directory node) gives a menu of major topics.\n"
-" Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n"
-" \"h\" gives a primer for first-timers,\n"
-" \"mEmacs<Return>\" visits the Emacs manual, etc.\n"
-"\n"
-" In Emacs, you can click mouse button 2 on a menu item or cross reference\n"
-" to select it.\n"
-"\n"
-"* Menu:\n"
-msgstr ""
-"Ceci est le fichier .../info/dir, lequel contient le noeud \n"
-"le plus haut dans la hiérarchie Info, noeud appelé (dir)Top.\n"
-"La première fois que Info est invoqué, vous démarrez la recherche \n"
-"à partir de ce noeud.\n"
-"\n"
-"Fichier: dir Noeud: Top Ceci est le haut de l'arborescence INFO\n"
-"\n"
-" Ceci (le noeud Répertoire) fournit un menu des sujets majeurs.\n"
-" Taper «q» pour quitter, «?» pour lister toutes les commandes Info,\n"
-" «d» pour revenir à cet endroit,\n"
-" «h» fournit un guide d'initiation pour les nouveaux venus,\n"
-" «mEmacs<Return>» démarre une consultation du manuel Emacs, etc.\n"
-"\n"
-" En Emacs, vous pouvez cliquer le bouton 2 de la souris sur un item menu "
-"ou\n"
-" sur une référence croisée pour le sélectionner.\n"
-"\n"
-"* Menu:\n"
-
-#: util/install-info.c:364
-#, c-format
-msgid "%s: could not read (%s) and could not create (%s)\n"
-msgstr "%s: ne peut pas lire (%s) et ne peut pas créer (%s)\n"
-
-#: util/install-info.c:464 util/install-info.c:474
-#, c-format
-msgid "%s: Specify the Info directory only once.\n"
-msgstr "%s: Spécifier le répertoire Info une seule fois seulement.\n"
-
-#: util/install-info.c:502
-#, c-format
-msgid "%s: Specify the Info file only once.\n"
-msgstr "%s: Spécifier le fichier Info une seule fois seulement.\n"
-
-#: util/install-info.c:550
-#, c-format
-msgid "excess command line argument `%s'"
-msgstr "excédent d'argument de ligne de commande `%s'"
-
-#: util/install-info.c:554
-msgid "No input file specified; try --help for more information."
-msgstr ""
-"Aucun fichier d'entrée spécifié; essayer --help pour plus d'informations."
-
-#: util/install-info.c:556
-msgid "No dir file specified; try --help for more information."
-msgstr "Aucun fichier dir spécifié; essayer --help pour plus d'informations."
-
-#: util/install-info.c:608 util/install-info.c:631
-msgid "START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"
-msgstr "START-INFO-DIR-ENTRY non apparié avec END-INFO-DIR-ENTRY"
-
-#: util/install-info.c:627
-msgid "END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"
-msgstr "END-INFO-DIR-ENTRY non apparié avec START-INFO-DIR-ENTRY"
-
-#. No need to abort here, the original info file may not have
-#. the requisite Texinfo commands. This is not something an
-#. installer should have to correct (it's a problem for the
-#. maintainer), and there's no need to cause subsequent parts of
-#. `make install' to fail.
-#: util/install-info.c:641
-#, c-format
-msgid "no info dir entry in `%s'"
-msgstr "aucune entrée répertoire Info dans «%s»"
-
-#: util/install-info.c:852
-#, c-format
-msgid "menu item `%s' already exists, for file `%s'"
-msgstr "item menu «%s» déjà existant, pour le fichier «%s»"
-
-#: util/install-info.c:875
-#, c-format
-msgid "no entries found for `%s'; nothing deleted"
-msgstr "aucune entrée trouvée pour «%s»; rien n'a été éliminé"
-
-#: util/texindex.c:253
-msgid "keep temporary files around after processing"
-msgstr "conserver les fichiers temporaires après le traitement"
-
-#: util/texindex.c:255
-msgid "do not keep temporary files around after processing (default)"
-msgstr "ne pas conserver les fichiers temporaires après le traitement (défaut)"
-
-#: util/texindex.c:257
-msgid "send output to FILE"
-msgstr "envoyer la sortie dans FICHIER"
-
-#: util/texindex.c:259
-msgid "display version information and exit"
-msgstr "afficher la version en usage et quitter"
-
-#: util/texindex.c:261
-msgid "display this help and exit"
-msgstr "afficher cet aide-mémoire et quitter"
-
-#: util/texindex.c:272
-#, c-format
-msgid "Usage: %s [OPTION]... FILE...\n"
-msgstr "Usage: %s [OPTION]... FICHIER...\n"
-
-#: util/texindex.c:273
-msgid "Generate a sorted index for each TeX output FILE.\n"
-msgstr "Générer un index trié pour chaque FICHIER de sortie TeX.\n"
-
-#. Avoid trigraph nonsense.
-#: util/texindex.c:275
-msgid "Usually FILE... is `foo.??' for a document `foo.texi'.\n"
-msgstr "Habituellement FICHIER... est «foo.??» pour un document «foo.texi».\n"
-
-#: util/texindex.c:276
-msgid ""
-"\n"
-"Options:\n"
-msgstr ""
-"\n"
-"Options:\n"
-
-#: util/texindex.c:290
-#, fuzzy
-msgid ""
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-"\n"
-"Rapporter toute anomalie à bug-texinfo@prep.ai.mit.edu."
-
-#: util/texindex.c:917 util/texindex.c:951 util/texindex.c:1027
-#: util/texindex.c:1055
-#, c-format
-msgid "%s: not a texinfo index file"
-msgstr "%s: pas un fichier index en format Texinfo"
-
-#: util/texindex.c:1012
-#, c-format
-msgid "failure reopening %s"
-msgstr "échec lors de la réouverture de %s"
-
-#: util/texindex.c:1325
-#, c-format
-msgid "entry %s follows an entry with a secondary name"
-msgstr "l'entrée %s suit une entrée ayant un nom secondaire"
-
-#: util/texindex.c:1663
-#, c-format
-msgid "%s; for file `%s'.\n"
-msgstr "%s; pour le fichier «%s».\n"
-
-#: util/texindex.c:1724
-#, c-format
-msgid "Virtual memory exhausted in %s ()! Needed %d bytes."
-msgstr "Mémoire virtuelle épuisée dans %s ()! Besoin de %d octets."
-
-#~ msgid "install-info (GNU %s) %s\n"
-#~ msgstr "install-info (GNU %s) %s\n"
-
-#~ msgid "universal-argument"
-#~ msgstr "universal-argument"
-
-#~ msgid "Show what to type to execute a given command"
-#~ msgstr "Montrer quoi écrire afin d'exécuter une commande donnée"
-
-#~ msgid "There %s %d "
-#~ msgstr "Comme complétion(s) %s %d "
-
-#~ msgid "is"
-#~ msgstr "il y a"
-
-#~ msgid "are"
-#~ msgstr "il y a"
-
-# Est-ce vraiment un message à traduire? NON.
-#~ msgid ""
-#~ "Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]..."
-#~ msgstr ""
-#~ "Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]..."
-
-# Est-ce vraiment un message à traduire? NON.
-#~ msgid ""
-#~ " [--directory dir-path] [--file info-file] [--node node-name]..."
-#~ msgstr ""
-#~ " [--directory dir-path] [--file info-file] [--node node-name]..."
-
-# Est-ce vraiment un message à traduire? NON.
-#~ msgid " [--help] [--output output-file] [--subnodes] [--version]"
-#~ msgstr ""
-#~ " [--help] [--output output-file] [--subnodes] [--version]"
-
-# Est-ce vraiment un message à traduire? NON.
-#~ msgid " [--dribble dribble-file] [--restore from-file]"
-#~ msgstr " [--dribble dribble-file] [--restore from-file]"
-
-# Est-ce vraiment un message à traduire? NON.
-#~ msgid " [menu-selection ...]"
-#~ msgstr " [menu-selection ...]"
-
-#~ msgid "makeinfo (GNU %s %s) %d.%d\n"
-#~ msgstr "makeinfo (GNU %s %s) %d.%d\n"
-
-#~ msgid "%d %s %d"
-#~ msgstr "%d %s %d"
-
-#~ msgid "There already is a node having %ctop as a section"
-#~ msgstr "Il y a déjà un noeud ayant %ctop en tant que section"
-
-#~ msgid "texindex (GNU %s %s) 2.1\n"
-#~ msgstr "texindex (GNU %s %s) 2.1\n"
diff --git a/contrib/texinfo/po/stamp-cat-id b/contrib/texinfo/po/stamp-cat-id
deleted file mode 100644
index 9788f70238c9..000000000000
--- a/contrib/texinfo/po/stamp-cat-id
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/contrib/texinfo/po/texinfo.pot b/contrib/texinfo/po/texinfo.pot
deleted file mode 100644
index f6e1ce472b4c..000000000000
--- a/contrib/texinfo/po/texinfo.pot
+++ /dev/null
@@ -1,1847 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Free Software Foundation, Inc.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1998-03-03 13:32-0500\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: ENCODING\n"
-
-#. ****************************************************************
-#.
-#. Echo Area Movement Commands
-#.
-#. ****************************************************************
-#: info/echo-area.c:283 info/session.c:698
-msgid "Move forward a character"
-msgstr ""
-
-#. Move point backward in the node.
-#: info/echo-area.c:295 info/session.c:714
-msgid "Move backward a character"
-msgstr ""
-
-#: info/echo-area.c:307
-msgid "Move to the start of this line"
-msgstr ""
-
-#: info/echo-area.c:312
-msgid "Move to the end of this line"
-msgstr ""
-
-#. Move forward a word in the input line.
-#: info/echo-area.c:320 info/session.c:732
-msgid "Move forward a word"
-msgstr ""
-
-#: info/echo-area.c:360 info/session.c:781
-msgid "Move backward a word"
-msgstr ""
-
-#: info/echo-area.c:400
-msgid "Delete the character under the cursor"
-msgstr ""
-
-#: info/echo-area.c:430
-msgid "Delete the character behind the cursor"
-msgstr ""
-
-#: info/echo-area.c:451
-msgid "Cancel or quit operation"
-msgstr ""
-
-#: info/echo-area.c:466
-msgid "Accept (or force completion of) this line"
-msgstr ""
-
-#: info/echo-area.c:471
-msgid "Insert next character verbatim"
-msgstr ""
-
-#: info/echo-area.c:479
-msgid "Insert this character"
-msgstr ""
-
-#: info/echo-area.c:497
-msgid "Insert a TAB character"
-msgstr ""
-
-#. Transpose the characters at point. If point is at the end of the line,
-#. then transpose the characters before point.
-#: info/echo-area.c:504
-msgid "Transpose characters at point"
-msgstr ""
-
-#: info/echo-area.c:555
-msgid "Yank back the contents of the last kill"
-msgstr ""
-
-#: info/echo-area.c:562
-msgid "Kill ring is empty"
-msgstr ""
-
-#. If the last command was yank, or yank_pop, and the text just before
-#. point is identical to the current kill item, then delete that text
-#. from the line, rotate the index down, and yank back some other text.
-#: info/echo-area.c:575
-msgid "Yank back a previous kill"
-msgstr ""
-
-#. Delete the text from point to end of line.
-#: info/echo-area.c:608
-msgid "Kill to the end of the line"
-msgstr ""
-
-#: info/echo-area.c:621
-msgid "Kill to the beginning of the line"
-msgstr ""
-
-#. Delete from point to the end of the current word.
-#: info/echo-area.c:633
-msgid "Kill the word following the cursor"
-msgstr ""
-
-#: info/echo-area.c:652
-msgid "Kill the word preceding the cursor"
-msgstr ""
-
-#: info/echo-area.c:871
-msgid "Not complete"
-msgstr ""
-
-#: info/echo-area.c:916
-msgid "List possible completions"
-msgstr ""
-
-#: info/echo-area.c:929
-msgid "No completions"
-msgstr ""
-
-#: info/echo-area.c:933
-msgid "Sole completion"
-msgstr ""
-
-#: info/echo-area.c:942
-msgid "One completion:\n"
-msgstr ""
-
-#: info/echo-area.c:943
-#, c-format
-msgid "%d completions:\n"
-msgstr ""
-
-#: info/echo-area.c:1088
-msgid "Insert completion"
-msgstr ""
-
-#: info/echo-area.c:1221
-msgid "Building completions..."
-msgstr ""
-
-#. Scroll the "other" window. If there is a window showing completions, scroll
-#. that one, otherwise scroll the window which was active on entering the read
-#. function.
-#: info/echo-area.c:1319
-msgid "Scroll the completions window"
-msgstr ""
-
-#: info/footnotes.c:206
-msgid "Footnotes could not be displayed"
-msgstr ""
-
-#: info/footnotes.c:232
-msgid "Show the footnotes associated with this node in another window"
-msgstr ""
-
-#: info/indices.c:175
-msgid "Look up a string in the index for this file"
-msgstr ""
-
-#: info/indices.c:205
-msgid "Finding index entries..."
-msgstr ""
-
-#: info/indices.c:212
-msgid "No indices found."
-msgstr ""
-
-#: info/indices.c:222
-msgid "Index entry: "
-msgstr ""
-
-#: info/indices.c:332
-msgid ""
-"Go to the next matching index item from the last `\\[index-search]' command"
-msgstr ""
-
-#: info/indices.c:342
-msgid "No previous index search string."
-msgstr ""
-
-#: info/indices.c:349
-msgid "No index entries."
-msgstr ""
-
-#: info/indices.c:382
-#, c-format
-msgid "No %sindex entries containing \"%s\"."
-msgstr ""
-
-#: info/indices.c:383
-msgid "more "
-msgstr ""
-
-#: info/indices.c:393
-msgid "CAN'T SEE THIS"
-msgstr ""
-
-#: info/indices.c:429
-#, c-format
-msgid "Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"
-msgstr ""
-
-#: info/indices.c:533
-#, c-format
-msgid "Scanning indices of \"%s\"..."
-msgstr ""
-
-#: info/indices.c:616
-msgid "Grovel all known info file's indices for a string and build a menu"
-msgstr ""
-
-#: info/indices.c:620
-msgid "Index apropos: "
-msgstr ""
-
-#: info/indices.c:650
-#, c-format
-msgid ""
-"\n"
-"* Menu: Nodes whoses indices contain \"%s\":\n"
-msgstr ""
-
-#: info/info.c:212
-msgid "Try --help for more information."
-msgstr ""
-
-#: info/info.c:231 makeinfo/makeinfo.c:1089 util/install-info.c:530
-#: util/texindex.c:338
-#, c-format
-msgid ""
-"Copyright (C) %s Free Software Foundation, Inc.\n"
-"There is NO warranty. You may redistribute this software\n"
-"under the terms of the GNU General Public License.\n"
-"For more information about these matters, see the files named COPYING.\n"
-msgstr ""
-
-#: info/info.c:363
-msgid "no entries found\n"
-msgstr ""
-
-#: info/info.c:406
-msgid "There is no menu in this node."
-msgstr ""
-
-#: info/info.c:437
-#, c-format
-msgid "There is no menu item \"%s\" in this node."
-msgstr ""
-
-#: info/info.c:501
-#, c-format
-msgid "Unable to find the node referenced by \"%s\"."
-msgstr ""
-
-#: info/info.c:602
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n"
-"\n"
-"Read documentation in Info format.\n"
-"For more complete documentation on how to use Info, run `info info "
-"options'.\n"
-"\n"
-"Options:\n"
-"--directory DIR add DIR to INFOPATH.\n"
-"--dribble FILENAME remember user keystrokes in FILENAME.\n"
-"--file FILENAME specify Info file to visit.\n"
-"--node NODENAME specify nodes in first visited Info file.\n"
-"--output FILENAME output selected nodes to FILENAME.\n"
-"--restore FILENAME read initial keystrokes from FILENAME.\n"
-"--subnodes recursively output menu items.\n"
-"--help display this help and exit.\n"
-"--version display version information and exit.\n"
-"\n"
-"The first argument, if present, is the name of the Info file to read.\n"
-"Any remaining arguments are treated as the names of menu\n"
-"items in the initial node visited. For example, `info emacs buffers'\n"
-"moves to the node `buffers' in the info file `emacs'.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-
-#: info/infodoc.c:50
-msgid "Basic Commands in Info Windows"
-msgstr ""
-
-#: info/infodoc.c:211
-msgid ""
-"The following commands can only be invoked via M-x:\n"
-"\n"
-msgstr ""
-
-#: info/infodoc.c:228
-msgid "--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"
-msgstr ""
-
-#. Create or move to the help window.
-#: info/infodoc.c:328
-msgid "Display help message"
-msgstr ""
-
-#. Show the Info help node. This means that the "info" file is installed
-#. where it can easily be found on your system.
-#: info/infodoc.c:346
-msgid "Visit Info node `(info)Help'"
-msgstr ""
-
-#: info/infodoc.c:470
-msgid "Print documentation for KEY"
-msgstr ""
-
-#: info/infodoc.c:483
-#, c-format
-msgid "Describe key: %s"
-msgstr ""
-
-#: info/infodoc.c:492
-#, c-format
-msgid "ESC %s is undefined."
-msgstr ""
-
-#: info/infodoc.c:509
-#, c-format
-msgid "%s is undefined."
-msgstr ""
-
-#: info/infodoc.c:535
-#, c-format
-msgid "%s is defined to %s."
-msgstr ""
-
-#: info/infodoc.c:731
-msgid "Where is command: "
-msgstr ""
-
-#: info/infodoc.c:753
-#, c-format
-msgid "`%s' is not on any keys"
-msgstr ""
-
-#: info/infodoc.c:759
-#, c-format
-msgid "%s can only be invoked via %s."
-msgstr ""
-
-#: info/infodoc.c:762
-#, c-format
-msgid "%s can be invoked via %s."
-msgstr ""
-
-#: info/infodoc.c:766
-#, c-format
-msgid "There is no function named `%s'"
-msgstr ""
-
-#: info/m-x.c:69
-msgid "Read the name of an Info command and describe it"
-msgstr ""
-
-#: info/m-x.c:73
-msgid "Describe command: "
-msgstr ""
-
-#: info/m-x.c:96
-msgid "Read a command name in the echo area and execute it"
-msgstr ""
-
-#: info/m-x.c:134
-msgid "Cannot execute an `echo-area' command here."
-msgstr ""
-
-#: info/m-x.c:150
-msgid "Set the height of the displayed window"
-msgstr ""
-
-#: info/m-x.c:163
-#, c-format
-msgid "Set screen height to (%d): "
-msgstr ""
-
-#: info/makedoc.c:126
-msgid ""
-" Source files groveled to make this file include:\n"
-"\n"
-msgstr ""
-
-#: info/makedoc.c:450
-#, c-format
-msgid "Couldn't manipulate the file %s.\n"
-msgstr ""
-
-#: info/nodemenu.c:28
-msgid ""
-"\n"
-"* Menu:\n"
-" (File)Node Lines Size Containing File\n"
-" ---------- ----- ---- ---------------"
-msgstr ""
-
-#: info/nodemenu.c:197
-msgid ""
-"Here is the menu of nodes you have recently visited.\n"
-"Select one from this menu, or use `\\[history-node]' in another window.\n"
-msgstr ""
-
-#: info/nodemenu.c:217
-msgid "Make a window containing a menu of all of the currently visited nodes"
-msgstr ""
-
-#: info/nodemenu.c:297
-msgid "Select a node which has been previously visited in a visible window"
-msgstr ""
-
-#: info/nodemenu.c:309
-msgid "Select visited node: "
-msgstr ""
-
-#: info/nodemenu.c:329 info/session.c:1996
-#, c-format
-msgid "The reference disappeared! (%s)."
-msgstr ""
-
-#: info/session.c:162
-#, c-format
-msgid ""
-"Welcome to Info version %s. \"\\[get-help-window]\" for help, "
-"\"\\[menu-item]\" for menu item."
-msgstr ""
-
-#. Move WINDOW's point down to the next line if possible.
-#: info/session.c:629
-msgid "Move down to the next line"
-msgstr ""
-
-#. Move WINDOW's point up to the previous line if possible.
-#: info/session.c:644
-msgid "Move up to the previous line"
-msgstr ""
-
-#. Move WINDOW's point to the end of the true line.
-#: info/session.c:659
-msgid "Move to the end of the line"
-msgstr ""
-
-#. Move WINDOW's point to the beginning of the true line.
-#: info/session.c:679
-msgid "Move to the start of the line"
-msgstr ""
-
-#: info/session.c:855
-msgid " times"
-msgstr ""
-
-#: info/session.c:857
-#, c-format
-msgid "%d times"
-msgstr ""
-
-#: info/session.c:895
-msgid "No \"Next\" pointer for this node."
-msgstr ""
-
-#: info/session.c:898
-msgid "Following \"Next\" node..."
-msgstr ""
-
-#: info/session.c:899 info/session.c:927 info/session.c:999
-#: info/session.c:1717
-msgid "Next"
-msgstr ""
-
-#: info/session.c:915
-msgid "Selecting first menu item..."
-msgstr ""
-
-#: info/session.c:926
-msgid "Selecting \"Next\" node..."
-msgstr ""
-
-#: info/session.c:950 info/session.c:1063 info/session.c:1733
-msgid "Up"
-msgstr ""
-
-#: info/session.c:1020
-msgid "No more nodes."
-msgstr ""
-
-#: info/session.c:1044
-msgid "No \"Prev\" for this node."
-msgstr ""
-
-#. Move to the previous node. If this node now contains a menu,
-#. and we have not inhibited movement to it, move to the node
-#. corresponding to the last menu item.
-#: info/session.c:1047 info/session.c:1100
-msgid "Moving \"Prev\" in this window."
-msgstr ""
-
-#: info/session.c:1048 info/session.c:1101 info/session.c:1725
-msgid "Prev"
-msgstr ""
-
-#: info/session.c:1059
-msgid "No \"Prev\" or \"Up\" for this node."
-msgstr ""
-
-#: info/session.c:1062
-msgid "Moving \"Up\" in this window."
-msgstr ""
-
-#: info/session.c:1110
-msgid "Moving to \"Prev\"'s last menu item."
-msgstr ""
-
-#: info/session.c:1121
-msgid "Move forwards or down through node structure"
-msgstr ""
-
-#: info/session.c:1137
-msgid "Move backwards or up through node structure"
-msgstr ""
-
-#. Show the next screen of WINDOW's node.
-#: info/session.c:1152
-msgid "Scroll forward in this window"
-msgstr ""
-
-#. Show the previous screen of WINDOW's node.
-#: info/session.c:1197
-msgid "Scroll backward in this window"
-msgstr ""
-
-#. Move to the beginning of the node.
-#: info/session.c:1237
-msgid "Move to the start of this node"
-msgstr ""
-
-#. Move to the end of the node.
-#: info/session.c:1244
-msgid "Move to the end of this node"
-msgstr ""
-
-#. ****************************************************************
-#.
-#. Commands for Manipulating Windows
-#.
-#. ****************************************************************
-#. Make the next window in the chain be the active window.
-#: info/session.c:1257
-msgid "Select the next window"
-msgstr ""
-
-#. Make the previous window in the chain be the active window.
-#: info/session.c:1296
-msgid "Select the previous window"
-msgstr ""
-
-#. Split WINDOW into two windows, both showing the same node. If we
-#. are automatically tiling windows, re-tile after the split.
-#: info/session.c:1347
-msgid "Split the current window"
-msgstr ""
-
-#. Delete WINDOW, forgetting the list of last visited nodes. If we are
-#. automatically displaying footnotes, show or remove the footnotes
-#. window. If we are automatically tiling windows, re-tile after the
-#. deletion.
-#: info/session.c:1428
-msgid "Delete the current window"
-msgstr ""
-
-#: info/session.c:1436
-msgid "Cannot delete a permanent window"
-msgstr ""
-
-#. Just keep WINDOW, deleting all others.
-#: info/session.c:1469
-msgid "Delete all other windows"
-msgstr ""
-
-#. Scroll the "other" window of WINDOW.
-#: info/session.c:1515
-msgid "Scroll the other window"
-msgstr ""
-
-#. Change the size of WINDOW by AMOUNT.
-#: info/session.c:1535
-msgid "Grow (or shrink) this window"
-msgstr ""
-
-#: info/session.c:1546
-msgid "Divide the available screen space among the visible windows"
-msgstr ""
-
-#: info/session.c:1553
-msgid "Toggle the state of line wrapping in the current window"
-msgstr ""
-
-#. Make WINDOW display the "Next:" node of the node currently being
-#. displayed.
-#: info/session.c:1714
-msgid "Select the `Next' node"
-msgstr ""
-
-#. Make WINDOW display the "Prev:" node of the node currently being
-#. displayed.
-#: info/session.c:1722
-msgid "Select the `Prev' node"
-msgstr ""
-
-#. Make WINDOW display the "Up:" node of the node currently being
-#. displayed.
-#: info/session.c:1730
-msgid "Select the `Up' node"
-msgstr ""
-
-#. Make WINDOW display the last node of this info file.
-#: info/session.c:1737
-msgid "Select the last node in this file"
-msgstr ""
-
-#: info/session.c:1750 info/session.c:1768
-msgid "This window has no additional nodes"
-msgstr ""
-
-#. Make WINDOW display the first node of this info file.
-#: info/session.c:1759
-msgid "Select the first node in this file"
-msgstr ""
-
-#: info/session.c:1778
-msgid "Select the last item in this node's menu"
-msgstr ""
-
-#. Use KEY (a digit) to select the Nth menu item in WINDOW->node.
-#: info/session.c:1784
-msgid "Select this menu item"
-msgstr ""
-
-#: info/session.c:1813
-#, c-format
-msgid "There aren't %d items in this menu."
-msgstr ""
-
-#: info/session.c:1944
-#, c-format
-msgid "Menu item (%s): "
-msgstr ""
-
-#: info/session.c:1946
-msgid "Menu item: "
-msgstr ""
-
-#: info/session.c:1951
-#, c-format
-msgid "Follow xref (%s): "
-msgstr ""
-
-#: info/session.c:1953
-msgid "Follow xref: "
-msgstr ""
-
-#. Read a line (with completion) which is the name of a menu item,
-#. and select that item.
-#: info/session.c:2042
-msgid "Read a menu item and select its node"
-msgstr ""
-
-#: info/session.c:2050
-msgid "Read a footnote or cross reference and select its node"
-msgstr ""
-
-#. Position the cursor at the start of this node's menu.
-#: info/session.c:2056
-msgid "Move to the start of this node's menu"
-msgstr ""
-
-#: info/session.c:2080
-msgid "Visit as many menu items at once as possible"
-msgstr ""
-
-#. Read a line of input which is a node name, and go to that node.
-#: info/session.c:2108
-msgid "Read a node name and select it"
-msgstr ""
-
-#: info/session.c:2169 info/session.c:2173
-msgid "Goto Node: "
-msgstr ""
-
-#: info/session.c:2194
-msgid "Read a manpage reference and select it"
-msgstr ""
-
-#: info/session.c:2198
-msgid "Get Manpage: "
-msgstr ""
-
-#. Move to the "Top" node in this file.
-#: info/session.c:2228
-msgid "Select the node `Top' in this file"
-msgstr ""
-
-#. Notice that the node "Top" is special, and doesn't have to
-#. be referenced.
-#: info/session.c:2230 makeinfo/makeinfo.c:5145 makeinfo/makeinfo.c:5228
-msgid "Top"
-msgstr ""
-
-#. Move to the node "(dir)Top".
-#: info/session.c:2234
-msgid "Select the node `(dir)'"
-msgstr ""
-
-#: info/session.c:2254
-#, c-format
-msgid "Kill node (%s): "
-msgstr ""
-
-#: info/session.c:2307
-#, c-format
-msgid "Cannot kill node `%s'"
-msgstr ""
-
-#: info/session.c:2317
-msgid "Cannot kill the last node"
-msgstr ""
-
-#: info/session.c:2401
-msgid "Select the most recently selected node"
-msgstr ""
-
-#. Kill named node.
-#: info/session.c:2407
-msgid "Kill this node"
-msgstr ""
-
-#. Read the name of a file and select the entire file.
-#: info/session.c:2415
-msgid "Read the name of a file and select it"
-msgstr ""
-
-#: info/session.c:2419
-msgid "Find file: "
-msgstr ""
-
-#: info/session.c:2436
-#, c-format
-msgid "Cannot find \"%s\"."
-msgstr ""
-
-#: info/session.c:2483 info/session.c:2608
-#, c-format
-msgid "Could not create output file \"%s\"."
-msgstr ""
-
-#: info/session.c:2496 info/session.c:2625 info/session.c:2671
-msgid "Done."
-msgstr ""
-
-#: info/session.c:2553
-#, c-format
-msgid "Writing node \"(%s)%s\"..."
-msgstr ""
-
-#: info/session.c:2556
-#, c-format
-msgid "Writing node \"%s\"..."
-msgstr ""
-
-#: info/session.c:2634
-msgid "Pipe the contents of this node through INFO_PRINT_COMMAND"
-msgstr ""
-
-#: info/session.c:2654
-#, c-format
-msgid "Cannot open pipe to \"%s\"."
-msgstr ""
-
-#: info/session.c:2661
-#, c-format
-msgid "Printing node \"(%s)%s\"..."
-msgstr ""
-
-#: info/session.c:2664
-#, c-format
-msgid "Printing node \"%s\"..."
-msgstr ""
-
-#: info/session.c:2896
-#, c-format
-msgid "Searching subfile \"%s\"..."
-msgstr ""
-
-#: info/session.c:2946
-msgid "Read a string and search for it"
-msgstr ""
-
-#: info/session.c:2966
-#, c-format
-msgid "%s for string [%s]: "
-msgstr ""
-
-#: info/session.c:2967
-msgid "Search backward"
-msgstr ""
-
-#: info/session.c:2967
-msgid "Search"
-msgstr ""
-
-#: info/session.c:2994
-msgid "Search failed."
-msgstr ""
-
-#: info/session.c:3020 info/session.c:3026
-msgid "Search interactively for a string as you type it"
-msgstr ""
-
-#: info/session.c:3120
-msgid "I-search backward: "
-msgstr ""
-
-#: info/session.c:3122
-msgid "I-search: "
-msgstr ""
-
-#: info/session.c:3147
-msgid "Failing "
-msgstr ""
-
-#: info/session.c:3512
-msgid "No cross references in this node."
-msgstr ""
-
-#: info/session.c:3579
-msgid "Move to the previous cross reference"
-msgstr ""
-
-#: info/session.c:3588
-msgid "Move to the next cross reference"
-msgstr ""
-
-#: info/session.c:3598
-msgid "Select reference or menu item appearing on this line"
-msgstr ""
-
-#. ****************************************************************
-#.
-#. Miscellaneous Info Commands
-#.
-#. ****************************************************************
-#. What to do when C-g is pressed in a window.
-#: info/session.c:3620
-msgid "Cancel current operation"
-msgstr ""
-
-#: info/session.c:3627
-msgid "Quit"
-msgstr ""
-
-#: info/session.c:3636
-msgid "Move to the cursor to a specific line of the window"
-msgstr ""
-
-#. Clear the screen and redraw its contents. Given a numeric argument,
-#. move the line the cursor is on to the COUNT'th line of the window.
-#: info/session.c:3668
-msgid "Redraw the display"
-msgstr ""
-
-#. This command does nothing. It is the fact that a key is bound to it
-#. that has meaning. See the code at the top of info_session ().
-#: info/session.c:3705
-msgid "Quit using Info"
-msgstr ""
-
-#: info/session.c:3728
-#, c-format
-msgid "Unknown command (%s)."
-msgstr ""
-
-#: info/session.c:3733
-msgid "\"\" is invalid"
-msgstr ""
-
-#: info/session.c:3735
-#, c-format
-msgid "\"%s\" is invalid"
-msgstr ""
-
-#: info/session.c:3958
-msgid "Add this digit to the current numeric argument"
-msgstr ""
-
-#: info/session.c:3967
-msgid "Start (or multiply by 4) the current numeric argument"
-msgstr ""
-
-#: info/session.c:3982
-msgid "Internally used by \\[universal-argument]"
-msgstr ""
-
-#: info/tilde.c:362
-msgid "readline: Out of virtual memory!\n"
-msgstr ""
-
-#: info/variables.c:40
-msgid "When \"On\", footnotes appear and disappear automatically"
-msgstr ""
-
-#: info/variables.c:44
-msgid "When \"On\", creating or deleting a window resizes other windows"
-msgstr ""
-
-#: info/variables.c:48
-msgid "When \"On\", flash the screen instead of ringing the bell"
-msgstr ""
-
-#: info/variables.c:52
-msgid "When \"On\", errors cause the bell to ring"
-msgstr ""
-
-#: info/variables.c:56
-msgid "When \"On\", Info garbage collects files which had to be uncompressed"
-msgstr ""
-
-#: info/variables.c:59
-msgid "When \"On\", the portion of the matched search string is highlighted"
-msgstr ""
-
-#: info/variables.c:63
-msgid "Controls what happens when scrolling is requested at the end of a node"
-msgstr ""
-
-#: info/variables.c:67
-msgid "The number lines to scroll when the cursor moves out of the window"
-msgstr ""
-
-#: info/variables.c:71
-msgid "When \"On\", Info accepts and displays ISO Latin characters"
-msgstr ""
-
-#: info/variables.c:77
-msgid "Explain the use of a variable"
-msgstr ""
-
-#. Get the variable's name.
-#: info/variables.c:83
-msgid "Describe variable: "
-msgstr ""
-
-#: info/variables.c:102
-msgid "Set the value of an Info variable"
-msgstr ""
-
-#. Get the variable's name and value.
-#: info/variables.c:108
-msgid "Set variable: "
-msgstr ""
-
-#: info/variables.c:126
-#, c-format
-msgid "Set %s to value (%d): "
-msgstr ""
-
-#: info/variables.c:167
-#, c-format
-msgid "Set %s to value (%s): "
-msgstr ""
-
-#: info/window.c:1102
-msgid "--*** Tags out of Date ***"
-msgstr ""
-
-#. strlen (location_indicator).
-#. 10 for the decimal representation of the number of lines in this
-#. node, and the remainder of the text that can appear in the line.
-#: info/window.c:1113
-msgid "-----Info: (), lines ----, "
-msgstr ""
-
-#: info/window.c:1120
-#, c-format
-msgid "-%s---Info: %s, %d lines --%s--"
-msgstr ""
-
-#: info/window.c:1124
-#, c-format
-msgid "-%s%s-Info: (%s)%s, %d lines --%s--"
-msgstr ""
-
-#: info/window.c:1131
-#, c-format
-msgid " Subfile: %s"
-msgstr ""
-
-#: lib/getopt.c:672
-#, c-format
-msgid "%s: option `%s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:696
-#, c-format
-msgid "%s: option `--%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:701
-#, c-format
-msgid "%s: option `%c%s' doesn't allow an argument\n"
-msgstr ""
-
-#: lib/getopt.c:718 lib/getopt.c:891
-#, c-format
-msgid "%s: option `%s' requires an argument\n"
-msgstr ""
-
-#. --option
-#: lib/getopt.c:747
-#, c-format
-msgid "%s: unrecognized option `--%s'\n"
-msgstr ""
-
-#. +option or -option
-#: lib/getopt.c:751
-#, c-format
-msgid "%s: unrecognized option `%c%s'\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:777
-#, c-format
-msgid "%s: illegal option -- %c\n"
-msgstr ""
-
-#: lib/getopt.c:780
-#, c-format
-msgid "%s: invalid option -- %c\n"
-msgstr ""
-
-#. 1003.2 specifies the format of this message.
-#: lib/getopt.c:810 lib/getopt.c:940
-#, c-format
-msgid "%s: option requires an argument -- %c\n"
-msgstr ""
-
-#: lib/getopt.c:857
-#, c-format
-msgid "%s: option `-W %s' is ambiguous\n"
-msgstr ""
-
-#: lib/getopt.c:875
-#, c-format
-msgid "%s: option `-W %s' doesn't allow an argument\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:893
-#, c-format
-msgid "%s:%d: warning: "
-msgstr ""
-
-#: makeinfo/makeinfo.c:916
-msgid "Too many errors! Gave up.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:975 makeinfo/makeinfo.c:1000 makeinfo/makeinfo.c:1068
-#, c-format
-msgid "%s: %s arg must be numeric, not `%s'.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:989
-#, c-format
-msgid "Couldn't open macro expansion output `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:992
-msgid "Cannot specify more than one macro expansion output"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1036
-#, c-format
-msgid "%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1079
-#, c-format
-msgid "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1110
-#, c-format
-msgid "%s: missing file argument.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1163
-#, c-format
-msgid "Try `%s --help' for more information.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1165
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... TEXINFO-FILE...\n"
-"\n"
-"Translate Texinfo source documentation to a format suitable for reading\n"
-"with GNU Info.\n"
-"\n"
-"Options:\n"
-"-D VAR define a variable, as with @set.\n"
-"-E MACRO-OFILE process macros only, output texinfo source.\n"
-"-I DIR append DIR to the @include directory search path.\n"
-"-P DIR prepend DIR to the @include directory search path.\n"
-"-U VAR undefine a variable, as with @clear.\n"
-"--error-limit NUM quit after NUM errors (default %d).\n"
-"--fill-column NUM break lines at NUM characters (default %d).\n"
-"--footnote-style STYLE output footnotes according to STYLE:\n"
-" `separate' to place footnotes in their own node,\n"
-" `end' to place the footnotes at the end of\n"
-" the node in which they are defined (the default).\n"
-"--force preserve output even if errors.\n"
-"--help display this help and exit.\n"
-"--no-validate suppress node cross-reference validation.\n"
-"--no-warn suppress warnings (but not errors).\n"
-"--no-split suppress splitting of large files.\n"
-"--no-headers suppress node separators and Node: Foo headers.\n"
-"--output FILE, -o FILE output to FILE, and ignore any @setfilename.\n"
-"--paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n"
-" if VAL is `none', do not indent; if VAL is `asis',\n"
-" preserve any existing indentation.\n"
-"--reference-limit NUM complain about at most NUM references (default %d).\n"
-"--verbose report about what is being done.\n"
-"--version display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1552
-#, c-format
-msgid "%s: getwd: %s, %s\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:1748
-#, c-format
-msgid "Expected `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2082
-#, c-format
-msgid "No `%s' found in `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2132
-#, c-format
-msgid "%s: Skipping macro expansion to stdout as Info output is going there.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2151
-#, c-format
-msgid "Making %s file `%s' from `%s'.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2181
-#, c-format
-msgid "This is Info file %s, produced by Makeinfo version %d.%d"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2183
-#, c-format
-msgid " from the input file %s.\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2202
-#, c-format
-msgid ""
-"%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-
-#. If there were errors, and no --force, remove the output.
-#: makeinfo/makeinfo.c:2234
-#, c-format
-msgid "%s: Removing output file `%s' due to errors; use --force to preserve.\n"
-msgstr ""
-
-#. Special case. I'm not supposed to see this character by itself.
-#. If I do, it means there is a syntax error in the input text.
-#. Report the error here, but remember this brace on the stack so
-#. you can ignore its partner.
-#: makeinfo/makeinfo.c:2374 makeinfo/makeinfo.c:7629
-#, c-format
-msgid "Misplaced %c"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2461
-#, c-format
-msgid "Unknown command `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2481
-msgid "NO_NAME!"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2495
-#, c-format
-msgid "%c%s expected `{...}'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2528
-msgid "Unmatched }"
-msgstr ""
-
-#: makeinfo/makeinfo.c:2576
-#, c-format
-msgid "%c%s missing close brace"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3372
-msgid "Broken-Type in insertion_type_pname"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3438
-msgid "Enumeration stack overflow"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3470
-#, c-format
-msgid "lettering overflow, restarting at %c"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3509
-msgid "* Menu:\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3593
-#, c-format
-msgid "%s requires an argument: the formatter for %citem"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3697
-#, c-format
-msgid "`%cend' expected `%s', but saw `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3810
-#, c-format
-msgid "No matching `%cend %s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3949
-#, c-format
-msgid "How did @%s end up in cm_special_char?\n"
-msgstr ""
-
-#. This error message isn't perfect if the argument is multiple
-#. characters, but it doesn't seem worth getting right.
-#: makeinfo/makeinfo.c:3963
-#, c-format
-msgid "%c%s expects `i' or `j' as argument, not `%c'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3967
-#, c-format
-msgid "%c%s expects a single character `i' or `j' as argument"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3979
-msgid "January"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3979
-msgid "February"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3979
-msgid "March"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3979
-msgid "April"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3979
-msgid "May"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3980
-msgid "June"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3980
-msgid "July"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3980
-msgid "August"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3980
-msgid "September"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3980
-msgid "October"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3981
-msgid "November"
-msgstr ""
-
-#: makeinfo/makeinfo.c:3981
-msgid "December"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4039
-#, c-format
-msgid "%c%s expects a single character as an argument"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4153
-#, c-format
-msgid "%c%s is obsolete"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4325
-#, c-format
-msgid "Node with %ctop as a section already exists"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4337
-#, c-format
-msgid "Here is the %ctop node"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4356
-#, c-format
-msgid "%ctop used before %cnode, defaulting to %s"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4431
-#, c-format
-msgid "%c%s is obsolete; use %c%s instead"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4680
-#, c-format
-msgid "Node `%s' multiply defined (line %d is first definition at)"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4753
-#, c-format
-msgid "Formatting node %s...\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:4802
-#, c-format
-msgid "Node `%s' requires a sectioning command (e.g. %c%s)"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5085
-#, c-format
-msgid "Node `%s''s Next field not pointed back to"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5090
-#, c-format
-msgid "This node (`%s') is the one with the bad `Prev'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5130
-#, c-format
-msgid "Node `%s's Prev field not pointed back to"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5134
-#, c-format
-msgid "This node (`%s') has the bad Next"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5146
-#, c-format
-msgid "Node `%s' missing Up field"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5186
-#, c-format
-msgid "`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5217
-#, c-format
-msgid "node `%s' has been referenced %d times"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5229
-#, c-format
-msgid "unreferenced node `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5256
-#, c-format
-msgid "%s reference to nonexistent node `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5668 makeinfo/makeinfo.c:5680
-#, c-format
-msgid "%cmenu seen before first node"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5669 makeinfo/makeinfo.c:5681
-msgid "creating `Top' node"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5794
-#, c-format
-msgid "`.' or `,' must follow cross reference, not %c"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5962
-#, c-format
-msgid "@image file `%s' unreadable: %s"
-msgstr ""
-
-#: makeinfo/makeinfo.c:5966
-msgid "@image missing filename argument"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6067
-#, c-format
-msgid "%s requires letter or digit"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6152
-#, c-format
-msgid "Unmatched `%c%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6159
-#, c-format
-msgid "`%c%s' needs something after it"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6165
-#, c-format
-msgid "Bad argument to `%s', `%s', using `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6338
-#, c-format
-msgid "{No Value For \"%s\"}"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6388
-#, c-format
-msgid "%c%s requires a name"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6496
-#, c-format
-msgid "Reached eof before matching @end %s"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6722
-#, c-format
-msgid "The `%c%s' command is meaningless within a `@%s' block"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6731
-#, c-format
-msgid "%citemx is not meaningful inside of a `%s' block"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6844
-#, c-format
-msgid "%c%s found outside of an insertion block"
-msgstr ""
-
-#: makeinfo/makeinfo.c:6935
-#, c-format
-msgid "Missing `}' in %cdef arg"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7144 makeinfo/makeinfo.c:7164
-msgid "Function"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7148
-msgid "Macro"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7152
-msgid "Special Form"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7156 makeinfo/makeinfo.c:7168
-msgid "Variable"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7160
-msgid "User Option"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7172
-msgid "Instance Variable"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7176 makeinfo/makeinfo.c:7180
-msgid "Method"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7335
-#, c-format
-msgid "Must be in a `%s' insertion in order to use `%s'x"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7407
-#, c-format
-msgid "%csp requires a positive numeric argument"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7650
-msgid "asis"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7652
-msgid "none"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7674
-#, c-format
-msgid "Bad argument to %c%s"
-msgstr ""
-
-#: makeinfo/makeinfo.c:7966
-#, c-format
-msgid "Unknown index `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8031
-#, c-format
-msgid "Index `%s' already exists"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8062
-#, c-format
-msgid "Unknown index `%s' and/or `%s' in @synindex"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8251
-#, c-format
-msgid "Unknown index `%s' in @printindex"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8266
-msgid ""
-"* Menu:\n"
-"\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8453
-#, c-format
-msgid "`%c%s' needs an argument `{...}', not just `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8468
-#, c-format
-msgid "No closing brace for footnote `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8507
-msgid "Footnote defined without parent node"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8539
-msgid "-Footnotes"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8594
-msgid ""
-"---------- Footnotes ----------\n"
-"\n"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8690
-#, c-format
-msgid "macro `%s' previously defined"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8694
-#, c-format
-msgid "here is the previous definition of `%s'"
-msgstr ""
-
-#: makeinfo/makeinfo.c:8908
-#, c-format
-msgid "Macro `%s' called with too many args"
-msgstr ""
-
-#: makeinfo/makeinfo.c:9060
-#, c-format
-msgid "%cend macro not found"
-msgstr ""
-
-#: makeinfo/makeinfo.c:9100
-#, c-format
-msgid "%cquote-arg only useful when the macro takes a single argument"
-msgstr ""
-
-#: makeinfo/multi.c:206
-#, c-format
-msgid "ignoring stray text `%s' after @multitable"
-msgstr ""
-
-#: makeinfo/multi.c:277
-#, c-format
-msgid "Too many columns in multitable item (max %d)"
-msgstr ""
-
-#. impossible, I think.
-#: makeinfo/multi.c:304
-msgid "multitable item not in active multitable"
-msgstr ""
-
-#: makeinfo/multi.c:313
-#, c-format
-msgid "Cannot select column #%d in multitable"
-msgstr ""
-
-#: makeinfo/multi.c:404
-msgid "ignoring @tab outside of multitable"
-msgstr ""
-
-#: makeinfo/multi.c:428
-msgid "** Multicolumn output from last row:\n"
-msgstr ""
-
-#: makeinfo/multi.c:431
-#, c-format
-msgid "* column #%d: output = %s\n"
-msgstr ""
-
-#: util/install-info.c:123 util/install-info.c:136
-msgid "virtual memory exhausted"
-msgstr ""
-
-#: util/install-info.c:192
-#, c-format
-msgid "%s: warning: "
-msgstr ""
-
-#: util/install-info.c:213
-#, c-format
-msgid " for %s"
-msgstr ""
-
-#: util/install-info.c:282
-#, c-format
-msgid "\tTry `%s --help' for a complete list of options.\n"
-msgstr ""
-
-#: util/install-info.c:290
-#, c-format
-msgid ""
-"Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n"
-"\n"
-"Install INFO-FILE in the Info directory file DIR-FILE.\n"
-"\n"
-"Options:\n"
-"--delete Delete existing entries in INFO-FILE;\n"
-" don't insert any new entries.\n"
-"--dir-file=NAME Specify file name of Info directory file.\n"
-" This is equivalent to using the DIR-FILE argument.\n"
-"--entry=TEXT Insert TEXT as an Info directory entry.\n"
-" TEXT should have the form of an Info menu item line\n"
-" plus zero or more extra lines starting with whitespace.\n"
-" If you specify more than one entry, they are all added.\n"
-" If you don't specify any entries, they are determined\n"
-" from information in the Info file itself.\n"
-"--help Display this help and exit.\n"
-"--info-file=FILE Specify Info file to install in the directory.\n"
-" This is equivalent to using the INFO-FILE argument.\n"
-"--info-dir=DIR Same as --dir-file=DIR/dir.\n"
-"--item=TEXT Same as --entry TEXT.\n"
-" An Info directory entry is actually a menu item.\n"
-"--quiet Suppress warnings.\n"
-"--remove Same as --delete.\n"
-"--section=SEC Put this file's entries in section SEC of the directory.\n"
-" If you specify more than one section, all the entries\n"
-" are added in each of the sections.\n"
-" If you don't specify any sections, they are determined\n"
-" from information in the Info file itself.\n"
-"--version Display version information and exit.\n"
-"\n"
-"Email bug reports to bug-texinfo@gnu.org.\n"
-msgstr ""
-
-#: util/install-info.c:341
-msgid ""
-"This is the file .../info/dir, which contains the\n"
-"topmost node of the Info hierarchy, called (dir)Top.\n"
-"The first time you invoke Info you start off looking at this node.\n"
-"\n"
-"File: dir,\tNode: Top,\tThis is the top of the INFO tree\n"
-"\n"
-" This (the Directory node) gives a menu of major topics.\n"
-" Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n"
-" \"h\" gives a primer for first-timers,\n"
-" \"mEmacs<Return>\" visits the Emacs manual, etc.\n"
-"\n"
-" In Emacs, you can click mouse button 2 on a menu item or cross reference\n"
-" to select it.\n"
-"\n"
-"* Menu:\n"
-msgstr ""
-
-#: util/install-info.c:364
-#, c-format
-msgid "%s: could not read (%s) and could not create (%s)\n"
-msgstr ""
-
-#: util/install-info.c:464 util/install-info.c:474
-#, c-format
-msgid "%s: Specify the Info directory only once.\n"
-msgstr ""
-
-#: util/install-info.c:502
-#, c-format
-msgid "%s: Specify the Info file only once.\n"
-msgstr ""
-
-#: util/install-info.c:550
-#, c-format
-msgid "excess command line argument `%s'"
-msgstr ""
-
-#: util/install-info.c:554
-msgid "No input file specified; try --help for more information."
-msgstr ""
-
-#: util/install-info.c:556
-msgid "No dir file specified; try --help for more information."
-msgstr ""
-
-#: util/install-info.c:608 util/install-info.c:631
-msgid "START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"
-msgstr ""
-
-#: util/install-info.c:627
-msgid "END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"
-msgstr ""
-
-#. No need to abort here, the original info file may not have
-#. the requisite Texinfo commands. This is not something an
-#. installer should have to correct (it's a problem for the
-#. maintainer), and there's no need to cause subsequent parts of
-#. `make install' to fail.
-#: util/install-info.c:641
-#, c-format
-msgid "no info dir entry in `%s'"
-msgstr ""
-
-#: util/install-info.c:852
-#, c-format
-msgid "menu item `%s' already exists, for file `%s'"
-msgstr ""
-
-#: util/install-info.c:875
-#, c-format
-msgid "no entries found for `%s'; nothing deleted"
-msgstr ""
-
-#: util/texindex.c:253
-msgid "keep temporary files around after processing"
-msgstr ""
-
-#: util/texindex.c:255
-msgid "do not keep temporary files around after processing (default)"
-msgstr ""
-
-#: util/texindex.c:257
-msgid "send output to FILE"
-msgstr ""
-
-#: util/texindex.c:259
-msgid "display version information and exit"
-msgstr ""
-
-#: util/texindex.c:261
-msgid "display this help and exit"
-msgstr ""
-
-#: util/texindex.c:272
-#, c-format
-msgid "Usage: %s [OPTION]... FILE...\n"
-msgstr ""
-
-#: util/texindex.c:273
-msgid "Generate a sorted index for each TeX output FILE.\n"
-msgstr ""
-
-#. Avoid trigraph nonsense.
-#: util/texindex.c:275
-msgid "Usually FILE... is `foo.??' for a document `foo.texi'.\n"
-msgstr ""
-
-#: util/texindex.c:276
-msgid ""
-"\n"
-"Options:\n"
-msgstr ""
-
-#: util/texindex.c:290
-msgid ""
-"\n"
-"Email bug reports to bug-texinfo@gnu.org."
-msgstr ""
-
-#: util/texindex.c:917 util/texindex.c:951 util/texindex.c:1027
-#: util/texindex.c:1055
-#, c-format
-msgid "%s: not a texinfo index file"
-msgstr ""
-
-#: util/texindex.c:1012
-#, c-format
-msgid "failure reopening %s"
-msgstr ""
-
-#: util/texindex.c:1325
-#, c-format
-msgid "entry %s follows an entry with a secondary name"
-msgstr ""
-
-#: util/texindex.c:1663
-#, c-format
-msgid "%s; for file `%s'.\n"
-msgstr ""
-
-#: util/texindex.c:1724
-#, c-format
-msgid "Virtual memory exhausted in %s ()! Needed %d bytes."
-msgstr ""
diff --git a/contrib/texinfo/stamp-h.in b/contrib/texinfo/stamp-h.in
deleted file mode 100644
index 9788f70238c9..000000000000
--- a/contrib/texinfo/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/contrib/texinfo/texinfo.tex b/contrib/texinfo/texinfo.tex
new file mode 100644
index 000000000000..e8375a310ac8
--- /dev/null
+++ b/contrib/texinfo/texinfo.tex
@@ -0,0 +1,4692 @@
+%% TeX macros to handle texinfo files
+
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
+% 94, 95, 1996 Free Software Foundation, Inc.
+
+%This texinfo.tex file is free software; you can redistribute it and/or
+%modify it under the terms of the GNU General Public License as
+%published by the Free Software Foundation; either version 2, or (at
+%your option) any later version.
+
+%This texinfo.tex file is distributed in the hope that it will be
+%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%General Public License for more details.
+
+%You should have received a copy of the GNU General Public License
+%along with this texinfo.tex file; see the file COPYING. If not, write
+%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+%Boston, MA 02111-1307, USA.
+
+
+%In other words, you are welcome to use, share and improve this program.
+%You are forbidden to forbid anyone else to use, share and improve
+%what you give them. Help stamp out software-hoarding!
+
+
+% Send bug reports to bug-texinfo@prep.ai.mit.edu.
+% Please include a *precise* test case in each bug report.
+
+
+% Make it possible to create a .fmt file just by loading this file:
+% if the underlying format is not loaded, start by loading it now.
+% Added by gildea November 1993.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+
+% This automatically updates the version number based on RCS.
+\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
+\deftexinfoversion$Revision: 2.185 $
+\message{Loading texinfo package [Version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+ \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv = \equiv
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+\let\ptextilde=\~
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+\let\~ = \tie % And make it available as @~.
+
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English.
+\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
+\def\putwordInfo{Info}%
+\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
+\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
+\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
+\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
+\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
+\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
+\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
+\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
+\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{\tracingcommands2 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+
+%---------------------Begin change-----------------------
+%
+%%%% For @cropmarks command.
+% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\cornerlong \newdimen\cornerthick
+\newdimen \topandbottommargin
+\newdimen \outerhsize \newdimen \outervsize
+\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
+\outerhsize=7in
+%\outervsize=9.5in
+% Alternative @smallbook page size is 9.25in
+\outervsize=9.25in
+\topandbottommargin=.75in
+%
+%---------------------End change-----------------------
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
+\def\onepageout#1{%
+ \hoffset=\normaloffset
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ {%
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies
+ \shipout\vbox{%
+ {\let\hsize=\pagewidth \makeheadline}%
+ \pagebody{#1}%
+ {\let\hsize=\pagewidth \makefootline}%
+ }%
+ }%
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+%%%% For @cropmarks command %%%%
+
+% Here is a modification of the main output routine for Near East Publications
+% This provides right-angle cropmarks at all four corners.
+% The contents of the page are centerlined into the cropmarks,
+% and any desired binding offset is added as an \hskip on either
+% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
+%
+\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
+{\escapechar=`\\\relax % makes sure backslash is used in output files.
+ \shipout
+ \vbox to \outervsize{\hsize=\outerhsize
+ \vbox{\line{\ewtop\hfill\ewtop}}
+ \nointerlineskip
+ \line{\vbox{\moveleft\cornerthick\nstop}
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}}
+ \vskip \topandbottommargin
+ \centerline{\ifodd\pageno\hskip\bindingoffset\fi
+ \vbox{
+ {\let\hsize=\pagewidth \makeheadline}
+ \pagebody{#1}
+ {\let\hsize=\pagewidth \makefootline}}
+ \ifodd\pageno\else\hskip\bindingoffset\fi}
+ \vskip \topandbottommargin plus1fill minus1fill
+ \boxmaxdepth\cornerthick
+ \line{\vbox{\moveleft\cornerthick\nsbot}
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}}
+ \nointerlineskip
+ \vbox{\line{\ewbot\hfill\ewbot}}
+ }}
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
+%
+% Do @cropmarks to get crop marks
+\def\cropmarks{\let\onepageout=\croppageout }
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+%
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+ \let\next = #1%
+ \begingroup
+ \obeylines
+ \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse. Otherwise, we're done.
+\def\parseargx{%
+ % \obeyedspace is defined far below, after the definition of \sepspaces.
+ \ifx\obeyedspace\temp
+ \expandafter\parseargdiscardspace
+ \else
+ \expandafter\parseargline
+ \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ %
+ % First remove any @c comment, then any @comment.
+ % Result of each macro is put in \toks0.
+ \argremovec #1\c\relax %
+ \expandafter\argremovecomment \the\toks0 \comment\relax %
+ %
+ % Call the caller's macro, saved as \next in \parsearg.
+ \expandafter\next\expandafter{\the\toks0}%
+ }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us. The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% @end itemize @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'. Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands. (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.) But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+ \begingroup
+ \ignoreactivespaces
+ \edef\temp{#1}%
+ \global\toks0 = \expandafter{\temp}%
+ \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+ \obeyspaces
+ \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment. Type Return to continue.}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo is the same as @foo, for now.
+\newhelp\EMsimple{Type <Return> to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+ \removeactivespaces{#1}%
+ \edef\endthing{\the\toks0}%
+ %
+ \expandafter\ifx\csname E\endthing\endcsname\relax
+ \expandafter\ifx\csname \endthing\endcsname\relax
+ % There's no \foo, i.e., no ``environment'' foo.
+ \errhelp = \EMsimple
+ \errmessage{Undefined command `@end \endthing'}%
+ \else
+ \unmatchedenderror\endthing
+ \fi
+ \else
+ % Everything's ok; the right environment has been started.
+ \csname E\endthing\endcsname
+ \fi
+}
+
+% There is an environment #1, but it hasn't been started. Give an error.
+%
+\def\unmatchedenderror#1{%
+ \errhelp = \EMsimple
+ \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+ \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+ % Why was this kern here? It messes up equalizing space above and below
+ % environments. --karl, 6may93
+ %{\advance \baselineskip by -\singlespaceskip
+ %\kern \baselineskip}%
+ \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt \char '100}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt \char '173}}
+\def\myrbrace {{\tt \char '175}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce actual \{ & \} command in an index.
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\@ = 0 \catcode`\\ = 12
+ @gdef@lbracecmd[\{]%
+ @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @enddots{} is an end-of-sentence ellipsis.
+\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
+
+% @! is an end-of-sentence bang.
+\gdef\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\gdef\?{?\spacefactor=3000 }
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+ \ifnum\catcode13=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ %
+ % The \vtop we start below produces a box with normal height and large
+ % depth; thus, TeX puts \baselineskip glue before it, and (when the
+ % next line of text is done) \lineskip glue after it. (See p.82 of
+ % the TeXbook.) Thus, space below is not quite equal to space
+ % above. But it's pretty close.
+ \def\Egroup{%
+ \egroup % End the \vtop.
+ \endgroup % End the \group.
+ }%
+ %
+ \vtop\bgroup
+ % We have to put a strut on the last line in case the @group is in
+ % the midst of an example, rather than completely enclosing it.
+ % Otherwise, the interline space between the last line of the group
+ % and the first line afterwards is too small. But we can't put the
+ % strut in \Egroup, since there it would be on a line by itself.
+ % Hence this just inserts a strut at the beginning of each line.
+ \everypar = {\strut}%
+ %
+ % Since we have a strut on every line, we don't need any of TeX's
+ % normal interline spacing.
+ \offinterlineskip
+ %
+ % OK, but now we have to do something about blank
+ % lines in the input in @example-like environments, which normally
+ % just turn into \lisppar, which will insert no space now that we've
+ % turned off the interline space. Simplest is to make them be an
+ % empty paragraph.
+ \ifx\par\lisppar
+ \edef\par{\leavevmode \par}%
+ %
+ % Reset ^^M's definition to new definition of \par.
+ \obeylines
+ \fi
+ %
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+ % Go into vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % Don't add any leading before our big empty box, but allow a page
+ % break, since the best break might be right here.
+ \allowbreak
+ \nointerlineskip
+ \vtop to #1\mil{\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+}
+
+% @br forces paragraph break
+
+\let\br = \par
+
+% @dots{} output some dots
+
+\def\dots{$\ldots$}
+
+% @page forces the start of a new page
+
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
+
+\def\inmargin#1{%
+\strut\vadjust{\nobreak\kern-\strutdepth
+ \vtop to \strutdepth{\baselineskip\strutdepth\vss
+ \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+
+%\hbox{{\rm#1}}\hfil\break}}
+
+% @include file insert text of that file as input.
+% Allow normal characters that we make active in the argument (a file name).
+\def\include{\begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+ % Read the included file in a group so nested @include's work.
+ \def\thisfile{#1}%
+ \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
+\parsearg \commentxxx}
+
+\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
+
+\let\c=\comment
+
+% @paragraphindent is defined for the Info formatting commands only.
+\let\paragraphindent=\comment
+
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+\let\chapter=\relax
+\let\unnumbered=\relax
+\let\top=\relax
+\let\unnumberedsec=\relax
+\let\unnumberedsection=\relax
+\let\unnumberedsubsec=\relax
+\let\unnumberedsubsection=\relax
+\let\unnumberedsubsubsec=\relax
+\let\unnumberedsubsubsection=\relax
+\let\section=\relax
+\let\subsec=\relax
+\let\subsubsec=\relax
+\let\subsection=\relax
+\let\subsubsection=\relax
+\let\appendix=\relax
+\let\appendixsec=\relax
+\let\appendixsection=\relax
+\let\appendixsubsec=\relax
+\let\appendixsubsection=\relax
+\let\appendixsubsubsec=\relax
+\let\appendixsubsubsection=\relax
+\let\contents=\relax
+\let\smallbook=\relax
+\let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% Also ignore @macro ... @end macro. The user must run texi2dvi,
+% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
+\def\macro{\doignore{macro}}
+\let\unmacro = \comment
+
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ \long\def\doignoretext##1\end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
+ \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
+ \let\tensf = \nullfont
+ % Similarly for index fonts (mostly for their use in
+ % smallexample)
+ \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
+ \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
+ \let\indsf = \nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10 \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+%
+\def\value#1{\expandafter
+ \ifx\csname SET#1\endcsname\relax
+ {\{No value for ``#1''\}}
+ \else \csname SET#1\endcsname \fi}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex always succeeds; we read the text following, through @end
+% iftex). But `@end iftex' should be valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\defineunmatchedend{iftex}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written. Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo). So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+\def\donoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\setref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
+\def\unnumbnoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
+\def\appendixnoderef{\ifx\lastnode\relax\else
+\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
+\global\let\lastnode=\relax}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \readauxfile
+ \opencontents
+ \openindices
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ \comment % Ignore the actual filename.
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
+% \def\macroxxx#1#2 \end macro{%
+% \expandafter\gdef\macrotemp#1{#2}%
+% \endgroup}
+
+%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
+%\def\linemacroxxx#1#2 \end linemacro{%
+%\let\parsearg=\relax
+%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
+%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
+%\expandafter\gdef\macrotempx#1{#2}%
+%\endgroup}
+
+%\def\butfirst#1{}
+
+
+\message{fonts,}
+
+% Font-change commands.
+
+% Texinfo supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+%% Try out Computer Modern fonts at \magstephalf
+\let\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices and small examples (9pt).
+% We actually use the slanted font rather than the italic,
+% because texinfo normally uses the slanted fonts for that.
+% Do not make many font distinctions in general in the index, since they
+% aren't very useful.
+\setfont\ninett\ttshape{9}{1000}
+\setfont\indrm\rmshape{9}{1000}
+\setfont\indit\slshape{9}{1000}
+\let\indsl=\indit
+\let\indtt=\ninett
+\let\indttsl=\ninett
+\let\indsf=\indrm
+\let\indbf=\indrm
+\setfont\indsc\scshape{10}{900}
+\font\indi=cmmi9
+\font\indsy=cmsy9
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{12}{\magstep2}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{\magstep1}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled \magstep1
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\let\authorrm = \secrm
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+ \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+ \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example. By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \resetmathfonts}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\indexfonts{%
+ \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
+ \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
+ \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
+ \resetmathfonts \setleading{12pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartitalic
+\let\dfn=\smartitalic
+\let\emph=\smartitalic
+\let\cite=\smartitalic
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+ {\tt \rawbackslash \frenchspacing #1}%
+ \null
+}
+\let\ttfont=\t
+\def\samp #1{`\tclose{#1}'\null}
+\setfont\smallrm\rmshape{8}{1000}
+\font\smallsy=cmsy9
+\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
+ \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+\let\file=\samp
+\let\url=\samp % perhaps include a hypertex \special eventually
+\def\email#1{$\langle${\tt #1}$\rangle$}
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \frenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+\catcode`\-=\active
+\catcode`\_=\active
+\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
+% The following is used by \doprintindex to insure that long function names
+% wrap around. It is necessary for - and _ to be active before the index is
+% read from the file, as \entry parses the arguments long before \code is
+% ever called. -- mycroft
+\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
+}
+
+\def\realdash{-}
+\def\realunder{_}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\normalunderscore\discretionary{}{}{}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+%
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\ttsl\look}}\fi
+\else{\tclose{\ttsl\look}}\fi}
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of
+% @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+\def\r#1{{\rm #1}} % roman font
+% Use of \lowercase was suggested.
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\def\titlefont#1{{\titlerm #1}}
+
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+ \let\subtitlerm=\tenrm
+% I deinstalled the following change because \cmr12 is undefined.
+% This change was not in the ChangeLog anyway. --rms.
+% \let\subtitlerm=\cmr12
+ \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+ %
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ %
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ %
+ % Now you can print the title using @title.
+ \def\title{\parsearg\titlezzz}%
+ \def\titlezzz##1{\leftline{\titlefont{##1}}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Now you can put text using @subtitle.
+ \def\subtitle{\parsearg\subtitlezzz}%
+ \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+ %
+ % @author should come last, but may come many times.
+ \def\author{\parsearg\authorzzz}%
+ \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+ {\authorfont \leftline{##1}}}%
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \oldpage
+ \let\page = \oldpage
+ \hbox{}}%
+% \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks \evenheadline % Token sequence for heading line of even pages
+\newtoks \oddheadline % Token sequence for heading line of odd pages
+\newtoks \evenfootline % Token sequence for footing line of even pages
+\newtoks \oddfootline % Token sequence for footing line of odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
+\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
+\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
+\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+%
+}% unbind the catcode of @.
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% Produces Day Month Year style of output.
+\def\today{\number\day\space
+\ifcase\month\or
+January\or February\or March\or April\or May\or June\or
+July\or August\or September\or October\or November\or December\fi
+\space\number\year}
+
+% Use this if you want the Month Day, Year style of output.
+%\def\today{\ifcase\month\or
+%January\or February\or March\or April\or May\or June\or
+%July\or August\or September\or October\or November\or December\fi
+%\space\number\day, \number\year}
+
+% @settitle line... specifies the title of the document, for headings
+% It generates no output of its own
+
+\def\thistitle{No Title}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+
+% @tabs -- simple alignment
+
+% These don't work. For one thing, \+ is defined as outer.
+% So these macros cannot even be defined.
+
+%\def\tabs{\parsearg\tabszzz}
+%\def\tabszzz #1{\settabs\+#1\cr}
+%\def\tabline{\parsearg\tablinezzz}
+%\def\tablinezzz #1{\+#1\cr}
+%\def\&{&}
+
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+ \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+ \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemfont{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % Be sure we are not still in the middle of a paragraph.
+ %{\parskip = 0in
+ %\par
+ %}%
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. Unfortunately
+ % we can't prevent a possible page break at the following
+ % \baselineskip glue.
+ \nobreak
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line. Since that
+ % text will be indented by \tableindent, we make the item text be in
+ % a zero-width box.
+ \noindent
+ \rlap{\hskip -\tableindent\box0}\ignorespaces%
+ \endgroup%
+ \itemxneedsnegativevskiptrue%
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+%% Contains a kludge to get @end[description] to work
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1 \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1 \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1 \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+ \begingroup % ended by the @end itemsize
+ \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+ \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ \begingroup % ended by the @end enumerate
+ %
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{\in hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+% @multitable {Column 1 template} {Column 2 template} {Column 3
+% template}
+% Not:
+% @multitable {Column 1 template} {Column 2 template}
+% {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+
+%%%%
+% Dimensions
+
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+%%%%
+% Macros used to set up halign preamble:
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+%% 2/1/96, to allow fractions to be given with more than one digit.
+\def\pickupwholefraction#1 {\global\advance\colcount by1 %
+\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
+\setuptable}
+
+\newcount\colcount
+\def\setuptable#1{\def\firstarg{#1}%
+\ifx\firstarg\xendsetuptable\let\go\relax%
+\else
+ \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction % In this case arg of setuptable
+ % is the decimal point before the
+ % number given in percent of hsize.
+ % We don't need this so we don't use it.
+ \else
+ \global\advance\colcount by1
+ \setbox0=\hbox{#1 }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi%
+ \fi%
+\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
+\fi\go}
+
+%%%%
+% multitable syntax
+\def\tab{&\hskip1sp\relax} % 2/2/96
+ % tiny skip here makes sure this column space is
+ % maintained, even if it is never used.
+
+
+%%%%
+% @multitable ... @end multitable definitions:
+
+\def\multitable{\parsearg\dotable}
+
+\def\dotable#1{\bgroup
+\let\item\cr
+\tolerance=9500
+\hbadness=9500
+\setmultitablespacing
+\parskip=\multitableparskip
+\parindent=\multitableparindent
+\overfullrule=0pt
+\global\colcount=0\relax%
+\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
+ % To parse everything between @multitable and @item :
+\setuptable#1 \endsetuptable
+ % Need to reset this to 0 after \setuptable.
+\global\colcount=0\relax%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+\halign\bgroup&\global\advance\colcount by 1\relax%
+\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ % If user has set preamble in terms of percent of \hsize
+ % we will use that dimension as the width of the column, and
+ % the \leftskip will keep entries from bumping into each other.
+ % Table will start at left margin and final column will justify at
+ % right margin.
+\ifnum\colcount=1
+\else
+ \ifsetpercent
+ \else
+ % If user has <not> set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+\leftskip=\multitablecolspace
+\fi
+\noindent##\multistrut}\cr%
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+\global\everycr{\noalign{%
+\filbreak%% keeps underfull box messages off when table breaks over pages.
+\global\colcount=0\relax}}
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\else
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+
+\def\newindex #1{
+\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
+\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\doindex {#1}}
+}
+
+% @defindex foo == \newindex{foo}
+
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+
+\def\newcodeindex #1{
+\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
+\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\docodeindex {#1}}
+}
+
+\def\defcodeindex{\parsearg\newcodeindex}
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+\def\synindex #1 #2 {%
+\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+\expandafter\let\csname#1indfile\endcsname=\synindexfoo
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\doindex {#2}}%
+}
+
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+\def\syncodeindex #1 #2 {%
+\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+\expandafter\let\csname#1indfile\endcsname=\synindexfoo
+\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
+\noexpand\docodeindex {#2}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+%\let\{ = \lbracecmd
+%\let\} = \rbracecmd
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+%\def\char{\realbackslash char}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\copyright{\realbackslash copyright }%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+\unsepspaces
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+@gdef@realbackslash{\}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+
+\let\SETmarginindex=\relax %initialize!
+% workhorse for all \fooindexes
+% #1 is name of index, #2 is stuff to put there
+\def\doind #1#2{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \fi
+ {%
+ \count255=\lastpenalty
+ {%
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ {%
+ \let\folio=0 % We will expand all macros now EXCEPT \folio.
+ \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % First process the index-string with all font commands turned off
+ % to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2}}%
+ %
+ % Now produce the complete index entry, with both the sort key and the
+ % original text, including any font commands.
+ \toks0 = {#2}%
+ \edef\temp{%
+ \write\csname#1indfile\endcsname{%
+ \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+ }%
+ \temp
+ }%
+ }%
+ \penalty\count255
+ }%
+}
+
+\def\dosubind #1#2#3{%
+{\count10=\lastpenalty %
+{\indexdummies % Must do this here, since \bf, etc expand at this stage
+\escapechar=`\\%
+{\let\folio=0%
+\def\rawbackslashxx{\indexbackslash}%
+%
+% Now process the index-string once, with all font commands turned off,
+% to get the string to sort the index by.
+{\indexnofonts
+\xdef\temp1{#2 #3}%
+}%
+% Now produce the complete index entry. We process the index-string again,
+% this time with font commands expanded, to get what to print in the index.
+\edef\temp{%
+\write \csname#1indfile\endcsname{%
+\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
+\temp }%
+}\penalty\count10}}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% This is what you call to cause a particular index to get printed.
+% Write
+% @unnumbered Function Index
+% @printindex fn
+
+\def\printindex{\parsearg\doprintindex}
+
+\def\doprintindex#1{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \indexfonts \rm
+ \tolerance = 9500
+ \indexbreaks
+ \def\indexbackslash{\rawbackslashxx}%
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \catcode`\\ = 0
+ \catcode`\@ = 11
+ \escapechar = `\\
+ \begindoublecolumns
+ %
+ % See if the index file exists and is nonempty.
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ (Index is nonexistent)
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ (Index is empty)
+ \else
+ \input \jobname.#1s
+ \fi
+ \fi
+ \closein 1
+ \enddoublecolumns
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+% Same as \bigskipamount except no shrink.
+% \balancecolumns gets confused if there is any shrink.
+\newskip\initialskipamount \initialskipamount 12pt plus4pt
+
+\def\initial #1{%
+{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+\ifdim\lastskip<\initialskipamount
+\removelastskip \penalty-200 \vskip \initialskipamount\fi
+\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin. It is used for index and table of contents
+% entries. The paragraph is indented by \leftskip.
+%
+\def\entry #1#2{\begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent=2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % Start a ``paragraph'' for the index entry so the line breaking
+ % parameters we've set above will have an effect.
+ \noindent
+ %
+ % Insert the text of the index entry. TeX will do line-breaking on it.
+ #1%
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#2}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd\ \else%
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ #2% The page number ends the paragraph.
+ \fi%
+ \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {\global\setbox\partialpage
+ =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
+ \eject
+ %
+ % Now switch to the double-column output routine.
+ \output={\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it once.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +- <
+ % 1pt) as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
+ % box0 will be the left-hand column, box1 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255 \penalty\outputpenalty
+}
+\def\pagesofar{%
+ % The contents of the output page -- any previous material,
+ % followed by the two boxes we just split.
+ \unvbox\partialpage
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
+}
+\def\enddoublecolumns{%
+ \output={\balancecolumns}\eject % split what we have
+ \endgroup
+ % Back to normal single-column typesetting, but take account of the
+ % fact that we just accumulated some stuff on the output page.
+ \pagegoal=\vsize
+}
+\def\balancecolumns{%
+ % Called on the last page of the double column material.
+ \setbox0=\vbox{\unvbox255}%
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {\vbadness=10000 \loop \global\setbox3=\copy0
+ \global\setbox1=\vsplit3 to\dimen@
+ \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ \pagesofar
+}
+\catcode `\@=\other
+
+
+\message{sectioning,}
+% Define chapters, sections, etc.
+
+\newcount \chapno
+\newcount \secno \secno=0
+\newcount \subsecno \subsecno=0
+\newcount \subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount \appendixno \appendixno = `\@
+\def\appendixletter{\char\the\appendixno}
+
+\newwrite \contentsfile
+% This is called from \setfilename.
+\def\opencontents{\openout \contentsfile = \jobname.toc}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise
+
+\def\thischapter{} \def\thissection{}
+\def\seccheck#1{\if \pageno<0 %
+\errmessage{@#1 not allowed after generating table of contents}\fi
+%
+}
+
+\def\chapternofonts{%
+\let\rawbackslash=\relax%
+\let\frenchspacing=\relax%
+\def\result{\realbackslash result}
+\def\equiv{\realbackslash equiv}
+\def\expansion{\realbackslash expansion}
+\def\print{\realbackslash print}
+\def\TeX{\realbackslash TeX}
+\def\dots{\realbackslash dots}
+\def\copyright{\realbackslash copyright}
+\def\tt{\realbackslash tt}
+\def\bf{\realbackslash bf }
+\def\w{\realbackslash w}
+\def\less{\realbackslash less}
+\def\gtr{\realbackslash gtr}
+\def\hat{\realbackslash hat}
+\def\char{\realbackslash char}
+\def\tclose##1{\realbackslash tclose {##1}}
+\def\code##1{\realbackslash code {##1}}
+\def\samp##1{\realbackslash samp {##1}}
+\def\r##1{\realbackslash r {##1}}
+\def\b##1{\realbackslash b {##1}}
+\def\key##1{\realbackslash key {##1}}
+\def\file##1{\realbackslash file {##1}}
+\def\kbd##1{\realbackslash kbd {##1}}
+% These are redefined because @smartitalic wouldn't work inside xdef.
+\def\i##1{\realbackslash i {##1}}
+\def\cite##1{\realbackslash cite {##1}}
+\def\var##1{\realbackslash var {##1}}
+\def\emph##1{\realbackslash emph {##1}}
+\def\dfn##1{\realbackslash dfn {##1}}
+}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \chapterzzz{#2}
+\or
+ \seczzz{#2}
+\or
+ \numberedsubseczzz{#2}
+\or
+ \numberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \chapterzzz{#2}
+ \else
+ \numberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \appendixzzz{#2}
+\or
+ \appendixsectionzzz{#2}
+\or
+ \appendixsubseczzz{#2}
+\or
+ \appendixsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \appendixzzz{#2}
+ \else
+ \appendixsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \unnumberedzzz{#2}
+\or
+ \unnumberedseczzz{#2}
+\or
+ \unnumberedsubseczzz{#2}
+\or
+ \unnumberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \unnumberedzzz{#2}
+ \else
+ \unnumberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{\seccheck{chapter}%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+{\chapternofonts%
+\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{\seccheck{appendix}%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+{\chapternofonts%
+\edef\temp{{\realbackslash chapentry
+ {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+\outer\def\top{\parsearg\unnumberedyyy}
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{\seccheck{unnumbered}%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message. Therefore, if #1 contained @-commands, TeX
+% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself. We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of the <toks register>.
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+{\chapternofonts%
+\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}}
+
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{\seccheck{section}%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash secentry %
+{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{\seccheck{appendixsection}%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash secentry %
+{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
+\plainsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
+\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
+
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{\seccheck{subsection}%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash subsecentry %
+{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash subsecentry %
+{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
+\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
+
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash subsubsecentry %
+ {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
+ {\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\donoderef %
+\penalty 10000 %
+}}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+{\chapternofonts%
+\edef\temp{{\realbackslash subsubsecentry{#1}%
+ {\appendixletter}
+ {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\appendixnoderef %
+\penalty 10000 %
+}}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+{\chapternofonts%
+\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
+\escapechar=`\\%
+\write \contentsfile \temp %
+\unnumbnoderef %
+\penalty 10000 %
+}}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and
+% such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ \def\chapnum{#2}%
+ \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+ \def\centerparametersmaybe{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+ }%
+ \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 10000 %
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+ {%
+ \expandafter\advance\csname #1headingskip\endcsname by \parskip
+ \csname #1headingbreak\endcsname
+ }%
+ {%
+ % Switch to the right set of fonts.
+ \csname #1fonts\endcsname \rm
+ %
+ % Only insert the separating space if we have a section number.
+ \def\secnum{#2}%
+ \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ %
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 % zero if no section number
+ \unhbox0 #3}%
+ }%
+ \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc printing,}
+% Finish up the main text and prepare to read what we've written
+% to \contentsfile.
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout \contentsfile
+ \ifnum \pageno>0
+ \pageno = -1 % Request roman numbered pages.
+ \fi
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \unnumbchapmacro{#1}\def\thischapter{}%
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+}
+
+
+% Normal (long) toc.
+\outer\def\contents{%
+ \startcontents{\putwordTableofContents}%
+ \input \jobname.toc
+ \endgroup
+ \vfill \eject
+}
+
+% And just the chapters.
+\outer\def\summarycontents{%
+ \startcontents{\putwordShortContents}%
+ %
+ \let\chapentry = \shortchapentry
+ \let\unnumbchapentry = \shortunnumberedentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\secentry ##1##2##3##4{}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \endgroup
+ \vfill \eject
+}
+\let\shortcontents = \summarycontents
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+\setbox0 = \hbox{\shortcontrm \putwordAppendix }
+\newdimen\shortappendixwidth \shortappendixwidth = \wd0
+
+\def\shortchaplabel#1{%
+ % We typeset #1 in a box of constant width, regardless of the text of
+ % #1, so the chapter titles will come out aligned.
+ \setbox0 = \hbox{#1}%
+ \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+ %
+ % This space should be plenty, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ \advance\dimen0 by 1.1em
+ \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno{#2}}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno{#2}}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here. (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+%
+% \turnoffactive is for the sake of @" used for umlauts.
+\def\tocentry#1#2{\begingroup
+ \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+ \entry{\turnoffactive #1}{\turnoffactive #2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox \newbox\longdblarrowbox
+\newbox\pushcharbox \newbox\bullbox
+\newbox\equivbox \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+% depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+\catcode `\%=14
+\catcode 43=12 % plus
+\catcode`\"=12
+\catcode`\==12
+\catcode`\|=12
+\catcode`\<=12
+\catcode`\>=12
+\escapechar=`\\
+%
+\let\,=\ptexcomma
+\let\~=\ptextilde
+\let\{=\ptexlbrace
+\let\}=\ptexrbrace
+\let\.=\ptexdot
+\let\*=\ptexstar
+\let\dots=\ptexdots
+\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
+\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
+\def\@{@}%
+\let\bullet=\ptexbullet
+\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
+%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output. Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is. This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \cartouche: draw rectangle w/rounded corners around argument
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt %we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18pt % allow for 3pt kerns on either
+% side, and for 6pt waste from
+% each corner char
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \kern3pt
+ \begingroup
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+\def\Ecartouche{%
+ \endgroup
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \inENV % This group ends at the end of the body
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \singlespace
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ % @cartouche defines \nonarrowing to inhibit narrowing
+ % at next level down.
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \let\exdent=\nofillexdent
+ \let\nonarrowing=\relax
+ \fi
+}
+
+% To ending an @example-like environment, we first end the paragraph
+% (via \afterenvbreak's vertical glue), and then the group. That way we
+% keep the zero \parskip that the environments set -- \parskip glue
+% will be inserted at the beginning of the next paragraph in the
+% document, after the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}%
+
+% This macro is
+\def\lisp{\begingroup
+ \nonfillstart
+ \let\Elisp = \nonfillfinish
+ \tt
+ \rawbackslash % have \ input char produce \ char from current font
+ \gobble
+}
+
+% Define the \E... control sequence only if we are inside the
+% environment, so the error checking in \end will work.
+%
+% We must call \lisp last in the definition, since it reads the
+% return following the @example (or whatever) command.
+%
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% @smallexample and @smalllisp. This is not used unless the @smallbook
+% command is given. Originally contributed by Pavel@xerox.
+%
+\def\smalllispx{\begingroup
+ \nonfillstart
+ \let\Esmalllisp = \nonfillfinish
+ \let\Esmallexample = \nonfillfinish
+ %
+ % Smaller fonts for small examples.
+ \indexfonts \tt
+ \rawbackslash % make \ output the \ character from the current font (tt)
+ \gobble
+}
+
+% This is @display; same as @lisp except use roman font.
+%
+\def\display{\begingroup
+ \nonfillstart
+ \let\Edisplay = \nonfillfinish
+ \gobble
+}
+
+% This is @format; same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eformat = \nonfillfinish
+ \gobble
+}
+
+% @flushleft (same as @format) and @flushright.
+%
+\def\flushleft{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushleft = \nonfillfinish
+ \gobble
+}
+\def\flushright{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushright = \nonfillfinish
+ \advance\leftskip by 0pt plus 1fill
+ \gobble}
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+ \begingroup\inENV %This group ends at the end of the @quotation body
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \singlespace
+ \parindent=0pt
+ % We have retained a nonzero parskip for the environment, since we're
+ % doing normal filling. So to avoid extra space below the environment...
+ \def\Equotation{\parskip = 0pt \nonfillfinish}%
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \let\nonarrowing = \relax
+ \fi
+}
+
+\message{defuns,}
+% Define formatter for defuns
+% First, allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
+\global\advance\parencount by 1 }
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+% also in that case restore the outer-level definition of (.
+\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+\global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text. This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
+\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\dimen3=\rightskip
+\advance\dimen3 by -\defbodyindent
+\noindent %
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+% such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody. It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+ \begingroup\inENV %
+ \medbreak %
+ % Define the end token that this defining construct specifies
+ % so that it will exit this group.
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument. Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name. That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any). That's what this does, putting the result in \tptemp.
+%
+\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+ \removeemptybraces#2\relax
+ #1{\tptemp}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+% the first is all of #2 before the space token,
+% the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs #1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+\hyphenchar\tensl=0
+#1%
+\hyphenchar\tensl=45
+\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Function}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type. #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification. #2 is the data type. #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+% at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Macro}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{Special Form}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% This definition is run if you use @defunx
+% anywhere other than immediately after a @defun or @defunx.
+
+\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
+\def\defunx #1 {\errmessage{@defunx in invalid context}}
+\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
+\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
+\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
+
+% @defmethod, and so on
+
+% @defop {Funny Method} foo-class frobnicate argument
+
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+
+\def\defopheader #1#2#3{%
+\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype{} on #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @defmethod == @defop Method
+
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+
+\def\defmethodheader #1#2#3{%
+\dosubind {fn}{\code{#2}}{on #1}% entry in function index
+\begingroup\defname {#2}{Method on #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype{} of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar == @defcv {Instance Variable}
+
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+
+\def\defivarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
+\begingroup\defname {#2}{Instance Variable of #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% These definitions are run if you use @defmethodx, etc.,
+% anywhere other than immediately after a @defmethod, etc.
+
+\def\defopx #1 {\errmessage{@defopx in invalid context}}
+\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
+\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
+\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
+
+% Now @defvar
+
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{Variable}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{User Option}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type. #2 is the name.
+\def\deftypevarheader #1#2{%
+\doind {vr}{\code{#2}}% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
+\interlinepenalty=10000
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgroup}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgroup}
+
+% This definition is run if you use @defvarx
+% anywhere other than immediately after a @defvar or @defvarx.
+
+\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
+\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% This definition is run if you use @deftpx, etc
+% anywhere other than immediately after a @deftp, etc.
+
+\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+
+
+\message{cross reference,}
+% Define cross-reference macros
+\newwrite \auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% \setref{foo} defines a cross-reference point named foo.
+
+\def\setref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Ysectionnumberandtype}}
+
+\def\unnumbsetref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Ynothing}}
+
+\def\appendixsetref#1{%
+\dosetq{#1-title}{Ytitle}%
+\dosetq{#1-pg}{Ypagenumber}%
+\dosetq{#1-snt}{Yappendixletterandtype}}
+
+% \xref, \pxref, and \ref generate cross-references to specified points.
+% For \xrefX, #1 is the node name, #2 the name of the Info
+% cross-reference, #3 the printed node name, #4 the name of the Info
+% file, #5 the name of the printed manual. All but the node name can be
+% omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printednodename{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual}%
+ \setbox0=\hbox{\printednodename}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1>0pt%
+ % It is in another manual, so we don't have it.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printednodename{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printednodename{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive \refx{#1-snt}{}}%
+ \space [\printednodename],\space
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \turnoffactive so that punctuation chars such as underscore
+% work in node names.
+\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat%
+\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
+\next}}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Non-3.0.
+\else
+ \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+ \expandafter\ifx\csname X#1\endcsname\relax
+ % If not defined, say something at least.
+ $\langle$un\-de\-fined$\rangle$%
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \csname X#1\endcsname
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+
+% This is the macro invoked by entries in the aux file.
+\def\xrdef #1#2{
+{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
+
+\def\readauxfile{%
+\begingroup
+\catcode `\^^@=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\^^C=\other
+\catcode `\^^D=\other
+\catcode `\^^E=\other
+\catcode `\^^F=\other
+\catcode `\^^G=\other
+\catcode `\^^H=\other
+\catcode `\ =\other
+\catcode `\^^L=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode `\=\other
+\catcode 26=\other
+\catcode `\^^[=\other
+\catcode `\^^\=\other
+\catcode `\^^]=\other
+\catcode `\^^^=\other
+\catcode `\^^_=\other
+\catcode `\@=\other
+\catcode `\^=\other
+\catcode `\~=\other
+\catcode `\[=\other
+\catcode `\]=\other
+\catcode`\"=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode `\$=\other
+\catcode `\#=\other
+\catcode `\&=\other
+% `\+ does not work, so use 43.
+\catcode 43=\other
+% Make the characters 128-255 be printing characters
+{%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
+}%
+% the aux file uses ' as the escape.
+% Turn off \ as an escape so we do not lose on
+% entries which were dumped with control sequences in their names.
+% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+% Reference to such entries still does not work the way one would wish,
+% but at least they do not bomb out when the aux file is read in.
+\catcode `\{=1 \catcode `\}=2
+\catcode `\%=\other
+\catcode `\'=0
+\catcode`\^=7 % to make ^^e4 etc usable in xref tags
+\catcode `\\=\other
+\openin 1 \jobname.aux
+\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
+\global\warnedobstrue
+\fi
+% Open the new aux file. Tex will close it automatically at exit.
+\openout \auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only..
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+\long\gdef\footnotezzz#1{\insert\footins{%
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ % Hang the footnote text off the number.
+ \hang
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ #1\strut}%
+}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+
+% End of control word definitions.
+
+\message{and turning on texinfo input format.}
+
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% Set some numeric style parameters, for 8.5 x 11 format.
+
+\hsize = 6in
+\hoffset = .25in
+\newdimen\defaultparindent \defaultparindent = 15pt
+\parindent = \defaultparindent
+\parskip 3pt plus 2pt minus 1pt
+\setleading{13.2pt}
+\advance\topskip by 1.2cm
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness=10000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. This makes it come to about 9pt for the 8.5x11 format.
+%
+\ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+\else
+ \emergencystretch = \hsize
+ \divide\emergencystretch by 45
+\fi
+
+% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
+\def\smallbook{
+ \global\chapheadingskip = 15pt plus 4pt minus 2pt
+ \global\secheadingskip = 12pt plus 3pt minus 2pt
+ \global\subsecheadingskip = 9pt plus 2pt minus 2pt
+ %
+ \global\lispnarrowing = 0.3in
+ \setleading{12pt}
+ \advance\topskip by -1cm
+ \global\parskip 2pt plus 1pt
+ \global\hsize = 5in
+ \global\vsize=7.5in
+ \global\tolerance=700
+ \global\hfuzz=1pt
+ \global\contentsrightmargin=0pt
+ \global\deftypemargin=0pt
+ \global\defbodyindent=.5cm
+ %
+ \global\pagewidth=\hsize
+ \global\pageheight=\vsize
+ %
+ \global\let\smalllisp=\smalllispx
+ \global\let\smallexample=\smalllispx
+ \global\def\Esmallexample{\Esmalllisp}
+}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{
+\global\tolerance=700
+\global\hfuzz=1pt
+\setleading{12pt}
+\global\parskip 15pt plus 1pt
+
+\global\vsize= 53\baselineskip
+\advance\vsize by \topskip
+%\global\hsize= 5.85in % A4 wide 10pt
+\global\hsize= 6.5in
+\global\outerhsize=\hsize
+\global\advance\outerhsize by 0.5in
+\global\outervsize=\vsize
+\global\advance\outervsize by 0.6in
+
+\global\pagewidth=\hsize
+\global\pageheight=\vsize
+}
+
+\bindingoffset=0pt
+\normaloffset=\hoffset
+\pagewidth=\hsize
+\pageheight=\vsize
+
+% Allow control of the text dimensions. Parameters in order: textheight;
+% textwidth; voffset; hoffset; binding offset; topskip.
+% All require a dimension;
+% header is additional; added length extends the bottom of the page.
+
+\def\changepagesizes#1#2#3#4#5#6{
+ \global\vsize= #1
+ \global\topskip= #6
+ \advance\vsize by \topskip
+ \global\voffset= #3
+ \global\hsize= #2
+ \global\outerhsize=\hsize
+ \global\advance\outerhsize by 0.5in
+ \global\outervsize=\vsize
+ \global\advance\outervsize by 0.6in
+ \global\pagewidth=\hsize
+ \global\pageheight=\vsize
+ \global\normaloffset= #4
+ \global\bindingoffset= #5}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex
+ {\global\tolerance=700
+ \global\hfuzz=1pt
+ \setleading{12pt}
+ \global\parskip 15pt plus 1pt
+ \advance\baselineskip by 1.6pt
+ \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
+ }
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{\afourpaper
+\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt \char '042}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt \char '176}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def\auxhat{\def^{'hat}}
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt \char '174}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% Say @foo, not \foo, in error messages.
+\escapechar=`\@
+
+% \catcode 17=0 % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active @catcode`@_=@active}
+
+%% These look ok in all fonts, so just make them not special. The @rm below
+%% makes sure that the current font starts out as the newly loaded cmr10
+@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+
+@textfonts
+@rm
+
+@c Local variables:
+@c page-delimiter: "^\\\\message"
+@c End:
diff --git a/contrib/texinfo/texinfo.texi b/contrib/texinfo/texinfo.texi
new file mode 100644
index 000000000000..8d67d8607f59
--- /dev/null
+++ b/contrib/texinfo/texinfo.texi
@@ -0,0 +1,16886 @@
+\input texinfo.tex @c -*-texinfo-*-
+@comment %**start of header
+@setfilename texinfo
+@settitle Texinfo @value{edition}
+@c Define a new index for options.
+@defcodeindex op
+@c Put everything except function (command, in this case) names in one
+index (arbitrarily chosen to be the concept index).
+@syncodeindex op cp
+@syncodeindex vr cp
+@syncodeindex pg cp
+@footnotestyle separate
+@paragraphindent 2
+@finalout
+@comment %**end of header
+@comment $Id: texinfo.texi,v 1.22 1996/10/03 23:24:24 karl Exp $
+
+@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
+@c prefix arg). This updates the node pointers, which texinfmt.el needs.
+
+@dircategory Texinfo documentation system
+@direntry
+* Texinfo: (texinfo). The GNU documentation format.
+* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
+* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
+* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
+@end direntry
+
+@c Set smallbook if printing in smallbook format so the example of the
+@c smallbook font is actually written using smallbook; in bigbook, a kludge
+@c is used for TeX output.
+@smallbook
+@set smallbook
+@c @@clear smallbook
+
+@set edition 2.23
+@set update-month October 1996
+@set update-date 1 @value{update-month}
+
+@c Currently undocumented command, 5 December 1993:
+@c
+@c nwnode (Same as node, but no warnings; for `makeinfo'.)
+
+@ifinfo
+This file documents Texinfo, a documentation system that can produce
+both on-line information and a printed manual from a single source file.
+
+Copyright (C) 1988, 90, 91, 92, 93, 95, 1996 Free Software Foundation, Inc.
+
+This is the second edition of the Texinfo documentation,@*
+and is consistent with version 2 of @file{texinfo.tex}.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end ifinfo
+
+@setchapternewpage odd
+
+@shorttitlepage Texinfo
+
+@titlepage
+@c use the new format for titles
+@title Texinfo
+@subtitle The GNU Documentation Format
+@subtitle Edition @value{edition}, for Texinfo Version Three
+@subtitle @value{update-month}
+
+@author Robert J.@: Chassell
+@author Richard M.@: Stallman
+
+@c Include the Distribution inside the titlepage so
+@c that headings are turned off.
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
+
+@sp 2
+This is the second edition of the Texinfo documentation,@*
+and is consistent with version 2 of @file{texinfo.tex}.
+@sp 2
+
+Published by the Free Software Foundation @*
+59 Temple Place Suite 330, @*
+Boston, MA 02111-1307 USA @*
+Printed copies are available for $15 each.@*
+ISBN 1-882114-64-7
+@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995
+@c ISBN 1-882114-64-7 is for edition 2.23 of 1 October 1996.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@sp 2
+Cover art by Etienne Suvasa.
+@end titlepage
+
+@ifinfo
+@node Top, Copying, (dir), (dir)
+@top Texinfo
+
+Texinfo is a documentation system that uses a single source file to
+produce both on-line information and printed output.@refill
+
+The first part of this master menu lists the major nodes in this Info
+document, including the @@-command and concept indices. The rest of
+the menu lists all the lower level nodes in the document.@refill
+
+This is Edition @value{edition} of the Texinfo documentation,
+@w{@value{update-date},} for Texinfo Version Three.
+@end ifinfo
+
+@c Here is a spare copy of the chapter menu entry descriptions,
+@c in case they are accidently deleted
+@ignore
+Your rights.
+Texinfo in brief.
+How to use Texinfo mode.
+What is at the beginning of a Texinfo file?
+What is at the end of a Texinfo file?
+How to create chapters, sections, subsections,
+ appendices, and other parts.
+How to provide structure for a document.
+How to write nodes.
+How to write menus.
+How to write cross references.
+How to mark words and phrases as code,
+ keyboard input, meta-syntactic
+ variables, and the like.
+How to write quotations, examples, etc.
+How to write lists and tables.
+How to create indices.
+How to insert @@-signs, braces, etc.
+How to indicate results of evaluation,
+ expansion of macros, errors, etc.
+How to force and prevent line and page breaks.
+How to describe functions and the like in a uniform manner.
+How to write footnotes.
+How to specify text for either @TeX{} or Info.
+How to print hardcopy.
+How to create an Info file.
+How to install an Info file
+A list of all the Texinfo @@-commands.
+Hints on how to write a Texinfo document.
+A sample Texinfo file to look at.
+Tell readers they have the right to copy
+ and distribute.
+How to incorporate other Texinfo files.
+How to write page headings and footings.
+How to find formatting mistakes.
+All about paragraph refilling.
+A description of @@-Command syntax.
+Texinfo second edition features.
+A menu containing commands and variables.
+A menu covering many topics.
+@end ignore
+
+@menu
+* Copying:: Your rights.
+* Overview:: Texinfo in brief.
+* Texinfo Mode:: How to use Texinfo mode.
+* Beginning a File:: What is at the beginning of a Texinfo file?
+* Ending a File:: What is at the end of a Texinfo file?
+* Structuring:: How to create chapters, sections, subsections,
+ appendices, and other parts.
+* Nodes:: How to write nodes.
+* Menus:: How to write menus.
+* Cross References:: How to write cross references.
+* Marking Text:: How to mark words and phrases as code,
+ keyboard input, meta-syntactic
+ variables, and the like.
+* Quotations and Examples:: How to write quotations, examples, etc.
+* Lists and Tables:: How to write lists and tables.
+* Indices:: How to create indices.
+* Insertions:: How to insert @@-signs, braces, etc.
+* Glyphs:: How to indicate results of evaluation,
+ expansion of macros, errors, etc.
+* Breaks:: How to force and prevent line and page breaks.
+* Definition Commands:: How to describe functions and the like
+ in a uniform manner.
+* Footnotes:: How to write footnotes.
+* Conditionals:: How to specify text for either @TeX{} or Info.
+* Macros:: Defining new Texinfo commands.
+* Format/Print Hardcopy:: How to convert a Texinfo file to a file
+ for printing and how to print that file.
+* Create an Info File:: Convert a Texinfo file into an Info file.
+* Install an Info File:: Make an Info file accessible to users.
+* Command List:: All the Texinfo @@-commands.
+* Tips:: Hints on how to write a Texinfo document.
+* Sample Texinfo File:: A sample Texinfo file to look at.
+* Sample Permissions:: Tell readers they have the right to copy
+ and distribute.
+* Include Files:: How to incorporate other Texinfo files.
+* Headings:: How to write page headings and footings.
+* Catching Mistakes:: How to find formatting mistakes.
+* Refilling Paragraphs:: All about paragraph refilling.
+* Command Syntax:: A description of @@-Command syntax.
+* Obtaining TeX:: How to Obtain @TeX{}.
+* New Features:: Texinfo second edition features.
+* Command and Variable Index:: A menu containing commands and variables.
+* Concept Index:: A menu covering many topics.
+
+@detailmenu
+
+ --- The Detailed Node Listing ---
+
+Overview of Texinfo
+
+* Using Texinfo:: Create a conventional printed book
+ or an Info file.
+* Info Files:: What is an Info file?
+* Printed Books:: Characteristics of a printed book or manual.
+* Formatting Commands:: @@-commands are used for formatting.
+* Conventions:: General rules for writing a Texinfo file.
+* Comments:: How to write comments and mark regions that
+ the formatting commands will ignore.
+* Minimum:: What a Texinfo file must have.
+* Six Parts:: Usually, a Texinfo file has six parts.
+* Short Sample:: A short sample Texinfo file.
+* Acknowledgements::
+
+Using Texinfo Mode
+
+* Texinfo Mode Overview:: How Texinfo mode can help you.
+* Emacs Editing:: Texinfo mode adds to GNU Emacs' general
+ purpose editing features.
+* Inserting:: How to insert frequently used @@-commands.
+* Showing the Structure:: How to show the structure of a file.
+* Updating Nodes and Menus:: How to update or create new nodes and menus.
+* Info Formatting:: How to format for Info.
+* Printing:: How to format and print part or all of a file.
+* Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
+
+Updating Nodes and Menus
+
+* Updating Commands:: Five major updating commands.
+* Updating Requirements:: How to structure a Texinfo file for
+ using the updating command.
+* Other Updating Commands:: How to indent descriptions, insert
+ missing nodes lines, and update
+ nodes in sequence.
+
+Beginning a Texinfo File
+
+* Four Parts:: Four parts begin a Texinfo file.
+* Sample Beginning:: Here is a sample beginning for a Texinfo file.
+* Header:: The very beginning of a Texinfo file.
+* Info Summary and Permissions:: Summary and copying permissions for Info.
+* Titlepage & Copyright Page:: Creating the title and copyright pages.
+* The Top Node:: Creating the `Top' node and master menu.
+* Software Copying Permissions:: Ensure that you and others continue to
+ have the right to use and share software.
+
+The Texinfo File Header
+
+* First Line:: The first line of a Texinfo file.
+* Start of Header:: Formatting a region requires this.
+* setfilename:: Tell Info the name of the Info file.
+* settitle:: Create a title for the printed work.
+* setchapternewpage:: Start chapters on right-hand pages.
+* paragraphindent:: An option to specify paragraph indentation.
+* End of Header:: Formatting a region requires this.
+
+The Title and Copyright Pages
+
+* titlepage:: Create a title for the printed document.
+* titlefont center sp:: The @code{@@titlefont}, @code{@@center},
+ and @code{@@sp} commands.
+* title subtitle author:: The @code{@@title}, @code{@@subtitle},
+ and @code{@@author} commands.
+* Copyright & Permissions:: How to write the copyright notice and
+ include copying permissions.
+* end titlepage:: Turn on page headings after the title and
+ copyright pages.
+* headings on off:: An option for turning headings on and off
+ and double or single sided printing.
+
+The `Top' Node and Master Menu
+
+* Title of Top Node:: Sketch what the file is about.
+* Master Menu Parts:: A master menu has three or more parts.
+
+Ending a Texinfo File
+
+* Printing Indices & Menus:: How to print an index in hardcopy and
+ generate index menus in Info.
+* Contents:: How to create a table of contents.
+* File End:: How to mark the end of a file.
+
+Chapter Structuring
+
+* Tree Structuring:: A manual is like an upside down tree @dots{}
+* Structuring Command Types:: How to divide a manual into parts.
+* makeinfo top:: The @code{@@top} command, part of the `Top' node.
+* chapter::
+* unnumbered & appendix::
+* majorheading & chapheading::
+* section::
+* unnumberedsec appendixsec heading::
+* subsection::
+* unnumberedsubsec appendixsubsec subheading::
+* subsubsection:: Commands for the lowest level sections.
+* Raise/lower sections:: How to change commands' hierarchical level.
+
+Nodes
+
+* Two Paths:: Different commands to structure
+ Info output and printed output.
+* Node Menu Illustration:: A diagram, and sample nodes and menus.
+* node:: How to write a node, in detail.
+* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
+
+The @code{@@node} Command
+
+* Node Names:: How to choose node and pointer names.
+* Writing a Node:: How to write an @code{@@node} line.
+* Node Line Tips:: Keep names short.
+* Node Line Requirements:: Keep names unique, without @@-commands.
+* First Node:: How to write a `Top' node.
+* makeinfo top command:: How to use the @code{@@top} command.
+* Top Node Summary:: Write a brief description for readers.
+
+Menus
+
+* Menu Location:: Put a menu in a short node.
+* Writing a Menu:: What is a menu?
+* Menu Parts:: A menu entry has three parts.
+* Less Cluttered Menu Entry:: Two part menu entry.
+* Menu Example:: Two and three part menu entries.
+* Other Info Files:: How to refer to a different Info file.
+
+Cross References
+
+* References:: What cross references are for.
+* Cross Reference Commands:: A summary of the different commands.
+* Cross Reference Parts:: A cross reference has several parts.
+* xref:: Begin a reference with `See' @dots{}
+* Top Node Naming:: How to refer to the beginning of another file.
+* ref:: A reference for the last part of a sentence.
+* pxref:: How to write a parenthetical cross reference.
+* inforef:: How to refer to an Info-only file.
+
+@code{@@xref}
+
+* Reference Syntax:: What a reference looks like and requires.
+* One Argument:: @code{@@xref} with one argument.
+* Two Arguments:: @code{@@xref} with two arguments.
+* Three Arguments:: @code{@@xref} with three arguments.
+* Four and Five Arguments:: @code{@@xref} with four and five arguments.
+
+Marking Words and Phrases
+
+* Indicating:: How to indicate definitions, files, etc.
+* Emphasis:: How to emphasize text.
+
+Indicating Definitions, Commands, etc.
+
+* Useful Highlighting:: Highlighting provides useful information.
+* code:: How to indicate code.
+* kbd:: How to show keyboard input.
+* key:: How to specify keys.
+* samp:: How to show a literal sequence of characters.
+* var:: How to indicate a metasyntactic variable.
+* file:: How to indicate the name of a file.
+* dfn:: How to specify a definition.
+* cite:: How to refer to a book that is not in Info.
+* url:: How to indicate a world wide web reference.
+* email:: How to indicate an electronic mail address.
+
+Emphasizing Text
+
+* emph & strong:: How to emphasize text in Texinfo.
+* Smallcaps:: How to use the small caps font.
+* Fonts:: Various font commands for printed output.
+* Customized Highlighting:: How to define highlighting commands.
+
+Quotations and Examples
+
+* Block Enclosing Commands:: Use different constructs for
+ different purposes.
+* quotation:: How to write a quotation.
+* example:: How to write an example in a fixed-width font.
+* noindent:: How to prevent paragraph indentation.
+* Lisp Example:: How to illustrate Lisp code.
+* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
+* display:: How to write an example in the current font.
+* format:: How to write an example that does not narrow
+ the margins.
+* exdent:: How to undo the indentation of a line.
+* flushleft & flushright:: How to push text flushleft or flushright.
+* cartouche:: How to draw cartouches around examples.
+
+Making Lists and Tables
+
+* Introducing Lists:: Texinfo formats lists for you.
+* itemize:: How to construct a simple list.
+* enumerate:: How to construct a numbered list.
+* Two-column Tables:: How to construct a two-column table.
+* Multi-column Tables:: How to construct generalized tables.
+
+Making a Two-column Table
+
+* table:: How to construct a two-column table.
+* ftable vtable:: How to construct a two-column table
+ with automatic indexing.
+* itemx:: How to put more entries in the first column.
+
+Multi-column Tables
+
+* Multitable Column Widths:: Defining multitable column widths.
+* Multitable Rows:: Defining multitable rows, with examples.
+
+Creating Indices
+
+* Index Entries:: Choose different words for index entries.
+* Predefined Indices:: Use different indices for different kinds
+ of entry.
+* Indexing Commands:: How to make an index entry.
+* Combining Indices:: How to combine indices.
+* New Indices:: How to define your own indices.
+
+Combining Indices
+
+* syncodeindex:: How to merge two indices, using @code{@@code}
+ font for the merged-from index.
+* synindex:: How to merge two indices, using the
+ default font of the merged-to index.
+
+Special Insertions
+
+* Braces Atsigns:: How to insert braces, @samp{@@}.
+* Inserting Space:: How to insert the right amount of space
+ within a sentence.
+* Inserting Accents:: How to insert accents and special characters.
+* Dots Bullets:: How to insert dots and bullets.
+* TeX and copyright:: How to insert the @TeX{} logo
+ and the copyright symbol.
+* pounds:: How to insert the pounds currency symbol.
+* minus:: How to insert a minus sign.
+* math:: How to format a mathematical expression.
+
+Inserting @@ and Braces
+
+* Inserting An Atsign:: How to insert @samp{@@}.
+* Inserting Braces:: How to insert @samp{@{} and @samp{@}}.
+
+Inserting Space
+
+* Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
+* Ending a Sentence:: Sometimes it does.
+* Multiple Spaces:: Inserting multiple spaces.
+* dmn:: How to format a dimension.
+
+Inserting Ellipsis, Dots, and Bullets
+
+* dots:: How to insert dots @dots{}
+* bullet:: How to insert a bullet.
+
+Inserting @TeX{} and the Copyright Symbol
+
+* tex:: How to insert the @TeX{} logo.
+* copyright symbol:: How to use @code{@@copyright}@{@}.
+
+Glyphs for Examples
+
+* Glyphs Summary::
+* result:: How to show the result of expression.
+* expansion:: How to indicate an expansion.
+* Print Glyph:: How to indicate printed output.
+* Error Glyph:: How to indicate an error message.
+* Equivalence:: How to indicate equivalence.
+* Point Glyph:: How to indicate the location of point.
+
+Making and Preventing Breaks
+
+* Break Commands:: Cause and prevent splits.
+* Line Breaks:: How to force a single line to use two lines.
+* - and hyphenation:: How to tell TeX about hyphenation points.
+* w:: How to prevent unwanted line breaks.
+* sp:: How to insert blank lines.
+* page:: How to force the start of a new page.
+* group:: How to prevent unwanted page breaks.
+* need:: Another way to prevent unwanted page breaks.
+
+Definition Commands
+
+* Def Cmd Template:: How to structure a description using a
+ definition command.
+* Optional Arguments:: How to handle optional and repeated arguments.
+* deffnx:: How to group two or more `first' lines.
+* Def Cmds in Detail:: All the definition commands.
+* Def Cmd Conventions:: Conventions for writing definitions.
+* Sample Function Definition::
+
+The Definition Commands
+
+* Functions Commands:: Commands for functions and similar entities.
+* Variables Commands:: Commands for variables and similar entities.
+* Typed Functions:: Commands for functions in typed languages.
+* Typed Variables:: Commands for variables in typed languages.
+* Abstract Objects:: Commands for object-oriented programming.
+* Data Types:: The definition command for data types.
+
+Footnotes
+
+* Footnote Commands:: How to write a footnote in Texinfo.
+* Footnote Styles:: Controlling how footnotes appear in Info.
+
+Conditionally Visible Text
+
+* Conditional Commands:: How to specify text for HTML, Info, or @TeX{}.
+* Using Ordinary TeX Commands:: You can use any and all @TeX{} commands.
+* set clear value:: How to designate which text to format (for
+ both Info and @TeX{}); and how to set a
+ flag to a string that you can insert.
+
+@code{@@set}, @code{@@clear}, and @code{@@value}
+
+* ifset ifclear:: Format a region if a flag is set.
+* value:: Replace a flag with a string.
+* value Example:: An easy way to update edition information.
+
+Macros: Defining New Texinfo Commands
+
+* Defining Macros:: Both defining and undefining new commands.
+* Invoking Macros:: Using a macro, once you've defined it.
+
+Format and Print Hardcopy
+
+* Use TeX:: Use @TeX{} to format for hardcopy.
+* Format with tex/texindex:: How to format in a shell.
+* Format with texi2dvi:: A simpler way to use the shell.
+* Print with lpr:: How to print.
+* Within Emacs:: How to format and print from an Emacs shell.
+* Texinfo Mode Printing:: How to format and print in Texinfo mode.
+* Compile-Command:: How to print using Emacs's compile command.
+* Requirements Summary:: @TeX{} formatting requirements summary.
+* Preparing for TeX:: What you need to do to use @TeX{}.
+* Overfull hboxes:: What are and what to do with overfull hboxes.
+* smallbook:: How to print small format books and manuals.
+* A4 Paper:: How to print on European A4 paper.
+* Cropmarks and Magnification:: How to print marks to indicate the size
+ of pages and how to print scaled up output.
+
+Creating an Info File
+
+* makeinfo advantages:: @code{makeinfo} provides better error checking.
+* Invoking makeinfo:: How to run @code{makeinfo} from a shell.
+* makeinfo options:: Specify fill-column and other options.
+* Pointer Validation:: How to check that pointers point somewhere.
+* makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
+* texinfo-format commands:: Two Info formatting commands written
+ in Emacs Lisp are an alternative
+ to @code{makeinfo}.
+* Batch Formatting:: How to format for Info in Emacs Batch mode.
+* Tag and Split Files:: How tagged and split files help Info
+ to run better.
+
+Installing an Info File
+
+* Directory file:: The top level menu for all Info files.
+* New Info File:: Listing a new info file.
+* Other Info Directories:: How to specify Info files that are
+ located in other directories.
+* Installing Dir Entries:: How to specify what menu entry to add
+ to the Info directory.
+* Invoking install-info:: @code{install-info} options.
+
+Sample Permissions
+
+* Inserting Permissions:: How to put permissions in your document.
+* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
+* Titlepage Permissions:: Sample Titlepage copying permissions.
+
+Include Files
+
+* Using Include Files:: How to use the @code{@@include} command.
+* texinfo-multiple-files-update:: How to create and update nodes and
+ menus when using included files.
+* Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
+* Sample Include File:: A sample outer file with included files
+ within it; and a sample included file.
+* Include Files Evolution:: How use of the @code{@@include} command
+ has changed over time.
+
+Page Headings
+
+* Headings Introduced:: Conventions for using page headings.
+* Heading Format:: Standard page heading formats.
+* Heading Choice:: How to specify the type of page heading.
+* Custom Headings:: How to create your own headings and footings.
+
+Formatting Mistakes
+
+* makeinfo preferred:: @code{makeinfo} finds errors.
+* Debugging with Info:: How to catch errors with Info formatting.
+* Debugging with TeX:: How to catch errors with @TeX{} formatting.
+* Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
+* Using occur:: How to list all lines containing a pattern.
+* Running Info-Validate:: How to find badly referenced nodes.
+
+Finding Badly Referenced Nodes
+
+* Using Info-validate:: How to run @code{Info-validate}.
+* Unsplit:: How to create an unsplit file.
+* Tagifying:: How to tagify a file.
+* Splitting:: How to split a file manually.
+
+Second Edition Features
+
+* New Texinfo Mode Commands:: The updating commands are especially useful.
+* New Commands:: Many newly described @@-commands.
+@end detailmenu
+@end menu
+
+@node Copying, Overview, Top, Top
+@comment node-name, next, previous, up
+@unnumbered Texinfo Copying Conditions
+@cindex Copying conditions
+@cindex Conditions for copying Texinfo
+
+The programs currently being distributed that relate to Texinfo include
+portions of GNU Emacs, plus other separate programs (including
+@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}).
+These programs are @dfn{free}; this means that everyone is free to use
+them and free to redistribute them on a free basis. The Texinfo-related
+programs are not in the public domain; they are copyrighted and there
+are restrictions on their distribution, but these restrictions are
+designed to permit everything that a good cooperating citizen would want
+to do. What is not allowed is to try to prevent others from further
+sharing any version of these programs that they might get from
+you.@refill
+
+ Specifically, we want to make sure that you have the right to give
+away copies of the programs that relate to Texinfo, that you receive
+source code or else can get it if you want it, that you can change these
+programs or use pieces of them in new free programs, and that you know
+you can do these things.@refill
+
+ To make sure that everyone has such rights, we have to forbid you to
+deprive anyone else of these rights. For example, if you distribute
+copies of the Texinfo related programs, you must give the recipients all
+the rights that you have. You must make sure that they, too, receive or
+can get the source code. And you must tell them their rights.@refill
+
+ Also, for our own protection, we must make certain that everyone finds
+out that there is no warranty for the programs that relate to Texinfo.
+If these programs are modified by someone else and passed on, we want
+their recipients to know that what they have is not what we distributed,
+so that any problems introduced by others will not reflect on our
+reputation.@refill
+
+ The precise conditions of the licenses for the programs currently
+being distributed that relate to Texinfo are found in the General Public
+Licenses that accompany them.@refill
+
+@node Overview, Texinfo Mode, Copying, Top
+@comment node-name, next, previous, up
+@chapter Overview of Texinfo
+@cindex Overview of Texinfo
+@cindex Texinfo overview
+
+@dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' is
+pronounced like ``speck'', not ``hex''. This odd pronunciation is
+derived from, but is not the same as, the pronunciation of @TeX{}. In
+the word @TeX{}, the @samp{X} is actually the Greek letter ``chi''
+rather than the English letter ``ex''. Pronounce @TeX{} as if the
+@samp{X} were the last sound in the name `Bach'; but pronounce Texinfo
+as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T''
+and write the other letters in lower case.}
+is a documentation system that uses a single source file to produce both
+on-line information and printed output. This means that instead of
+writing two different documents, one for the on-line help or other on-line
+information and the other for a typeset manual or other printed work, you
+need write only one document. When the work is revised, you need revise
+only one document. (You can read the on-line information, known as an
+@dfn{Info file}, with an Info documentation-reading program.)@refill
+
+@menu
+* Using Texinfo:: Create a conventional printed book
+ or an Info file.
+* Info Files:: What is an Info file?
+* Printed Books:: Characteristics of a printed book or manual.
+* Formatting Commands:: @@-commands are used for formatting.
+* Conventions:: General rules for writing a Texinfo file.
+* Comments:: How to write comments and mark regions that
+ the formatting commands will ignore.
+* Minimum:: What a Texinfo file must have.
+* Six Parts:: Usually, a Texinfo file has six parts.
+* Short Sample:: A short sample Texinfo file.
+* Acknowledgements::
+@end menu
+
+@node Using Texinfo, Info Files, Overview, Overview
+@ifinfo
+@heading Using Texinfo
+@end ifinfo
+
+Using Texinfo, you can create a printed document with the normal
+features of a book, including chapters, sections, cross references,
+and indices. From the same Texinfo source file, you can create a
+menu-driven, on-line Info file with nodes, menus, cross references,
+and indices. You can, if you wish, make the chapters and sections of
+the printed document correspond to the nodes of the on-line
+information; and you use the same cross references and indices for
+both the Info file and the printed work. @cite{The GNU
+Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill
+
+To make a printed document, you process a Texinfo source file with the
+@TeX{} typesetting program. This creates a @sc{dvi} file that you can
+typeset and print as a book or report. (Note that the Texinfo language
+is completely different from @TeX{}'s usual language, plain @TeX{}.) If
+you do not have @TeX{}, but do have @code{troff} or @code{nroff}, you
+can use the @code{texi2roff} program instead.@refill
+
+To make an Info file, you process a Texinfo source file with the
+@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;
+this creates an Info file that you can install on-line.@refill
+
+@TeX{} and @code{texi2roff} work with many types of printer; similarly,
+Info works with almost every type of computer terminal. This power
+makes Texinfo a general purpose system, but brings with it a constraint,
+which is that a Texinfo file may contain only the customary
+``typewriter'' characters (letters, numbers, spaces, and punctuation
+marks) but no special graphics.@refill
+
+A Texinfo file is a plain @sc{ascii} file containing text and
+@dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
+typesetting and formatting programs what to do. You may edit a
+Texinfo file with any text editor; but it is especially convenient to
+use GNU Emacs since that editor has a special mode, called Texinfo
+mode, that provides various Texinfo-related features. (@xref{Texinfo
+Mode}.)@refill
+
+Before writing a Texinfo source file, you should become familiar with
+the Info documentation reading program and learn about nodes,
+menus, cross references, and the rest. (@inforef{Top, info, info},
+for more information.)@refill
+
+You can use Texinfo to create both on-line help and printed manuals;
+moreover, Texinfo is freely redistributable. For these reasons, Texinfo
+is the format in which documentation for GNU utilities and libraries is
+written.@refill
+
+@node Info Files, Printed Books, Using Texinfo, Overview
+@comment node-name, next, previous, up
+@section Info files
+@cindex Info files
+
+An Info file is a Texinfo file formatted so that the Info documentation
+reading program can operate on it. (@code{makeinfo}
+and @code{texinfo-format-buffer} are two commands that convert a Texinfo file
+into an Info file.)@refill
+
+Info files are divided into pieces called @dfn{nodes}, each of which
+contains the discussion of one topic. Each node has a name, and
+contains both text for the user to read and pointers to other nodes,
+which are identified by their names. The Info program displays one node
+at a time, and provides commands with which the user can move to other
+related nodes.@refill
+
+@ifinfo
+@inforef{Top, info, info}, for more information about using Info.@refill
+@end ifinfo
+
+Each node of an Info file may have any number of child nodes that
+describe subtopics of the node's topic. The names of child
+nodes are listed in a @dfn{menu} within the parent node; this
+allows you to use certain Info commands to move to one of the child
+nodes. Generally, an Info file is organized like a book. If a node
+is at the logical level of a chapter, its child nodes are at the level
+of sections; likewise, the child nodes of sections are at the level
+of subsections.@refill
+
+All the children of any one parent are linked together in a
+bidirectional chain of `Next' and `Previous' pointers. The `Next'
+pointer provides a link to the next section, and the `Previous' pointer
+provides a link to the previous section. This means that all the nodes
+that are at the level of sections within a chapter are linked together.
+Normally the order in this chain is the same as the order of the
+children in the parent's menu. Each child node records the parent node
+name as its `Up' pointer. The last child has no `Next' pointer, and the
+first child has the parent both as its `Previous' and as its `Up'
+pointer.@footnote{In some documents, the first child has no `Previous'
+pointer. Occasionally, the last child has the node name of the next
+following higher level node as its `Next' pointer.}@refill
+
+The book-like structuring of an Info file into nodes that correspond
+to chapters, sections, and the like is a matter of convention, not a
+requirement. The `Up', `Previous', and `Next' pointers of a node can
+point to any other nodes, and a menu can contain any other nodes.
+Thus, the node structure can be any directed graph. But it is usually
+more comprehensible to follow a structure that corresponds to the
+structure of chapters and sections in a printed book or report.@refill
+
+In addition to menus and to `Next', `Previous', and `Up' pointers, Info
+provides pointers of another kind, called references, that can be
+sprinkled throughout the text. This is usually the best way to
+represent links that do not fit a hierarchical structure.@refill
+
+Usually, you will design a document so that its nodes match the
+structure of chapters and sections in the printed output. But there
+are times when this is not right for the material being discussed.
+Therefore, Texinfo uses separate commands to specify the node
+structure for the Info file and the section structure for the printed
+output.@refill
+
+Generally, you enter an Info file through a node that by convention is
+called @samp{Top}. This node normally contains just a brief summary
+of the file's purpose, and a large menu through which the rest of the
+file is reached. From this node, you can either traverse the file
+systematically by going from node to node, or you can go to a specific
+node listed in the main menu, or you can search the index menus and
+then go directly to the node that has the information you want.@refill
+@c !!! With the standalone Info system you may go to specific nodes
+@c directly..
+
+If you want to read through an Info file in sequence, as if it were a
+printed manual, you can get the whole file with the advanced Info
+command @kbd{g* @key{RET}}. (@inforef{Expert, Advanced Info commands,
+info}.)@refill
+
+@c !!! dir file may be located in one of many places:
+@c /usr/local/emacs/info mentioned in info.c DEFAULT_INFOPATH
+@c /usr/local/lib/emacs/info mentioned in info.c DEFAULT_INFOPATH
+@c /usr/gnu/info mentioned in info.c DEFAULT_INFOPATH
+@c /usr/local/info
+@c /usr/local/lib/info
+The @file{dir} file in the @file{info} directory serves as the
+departure point for the whole Info system. From it, you can reach the
+`Top' nodes of each of the documents in a complete Info system.@refill
+
+@node Printed Books, Formatting Commands, Info Files, Overview
+@comment node-name, next, previous, up
+@section Printed Books
+@cindex Printed book and manual characteristics
+@cindex Manual characteristics, printed
+@cindex Book characteristics, printed
+@cindex Texinfo printed book characteristics
+@cindex Characteristics, printed books or manuals
+
+@cindex Knuth, Donald
+A Texinfo file can be formatted and typeset as a printed book or manual.
+To do this, you need @TeX{}, a powerful, sophisticated typesetting
+program written by Donald Knuth.@footnote{You can also use the
+@code{texi2roff} program if you do not have @TeX{}; since Texinfo is
+designed for use with @TeX{}, @code{texi2roff} is not described here.
+@code{texi2roff} is part of the standard GNU distribution.}@refill
+
+A Texinfo-based book is similar to any other typeset, printed work: it
+can have a title page, copyright page, table of contents, and preface,
+as well as chapters, numbered or unnumbered sections and subsections,
+page headers, cross references, footnotes, and indices.@refill
+
+You can use Texinfo to write a book without ever having the intention
+of converting it into on-line information. You can use Texinfo for
+writing a printed novel, and even to write a printed memo, although
+this latter application is not recommended since electronic mail is so
+much easier.@refill
+
+@TeX{} is a general purpose typesetting program. Texinfo provides a
+file called @file{texinfo.tex} that contains information (definitions or
+@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
+(@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
+to @TeX{} commands, which @TeX{} can then process to create the typeset
+document.) @file{texinfo.tex} contains the specifications for printing
+a document.@refill
+
+Most often, documents are printed on 8.5 inch by 11 inch
+pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you
+can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
+235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper
+(@code{@@afourpaper}). (@xref{smallbook, , Printing ``Small'' Books}.
+Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@refill
+
+By changing the parameters in @file{texinfo.tex}, you can change the
+size of the printed document. In addition, you can change the style in
+which the printed document is formatted; for example, you can change the
+sizes and fonts used, the amount of indentation for each paragraph, the
+degree to which words are hyphenated, and the like. By changing the
+specifications, you can make a book look dignified, old and serious, or
+light-hearted, young and cheery.@refill
+
+@TeX{} is freely distributable. It is written in a dialect of Pascal
+called WEB and can be compiled either in Pascal or (by using a
+conversion program that comes with the @TeX{} distribution) in C.
+(@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information
+about @TeX{}.)@refill
+
+@TeX{} is very powerful and has a great many features. Because a
+Texinfo file must be able to present information both on a
+character-only terminal in Info form and in a typeset book, the
+formatting commands that Texinfo supports are necessarily
+limited.@refill
+
+@xref{Obtaining TeX, , How to Obtain @TeX{}}.
+
+
+@node Formatting Commands, Conventions, Printed Books, Overview
+@comment node-name, next, previous, up
+@section @@-commands
+@cindex @@-commands
+@cindex Formatting commands
+
+In a Texinfo file, the commands that tell @TeX{} how to typeset the
+printed manual and tell @code{makeinfo} and
+@code{texinfo-format-buffer} how to create an Info file are preceded
+by @samp{@@}; they are called @dfn{@@-commands}. For example,
+@code{@@node} is the command to indicate a node and @code{@@chapter}
+is the command to indicate the start of a chapter.@refill
+
+@quotation
+@strong{Please note:} All the @@-commands, with the exception of the
+@code{@@TeX@{@}} command, must be written entirely in lower
+case.@refill
+@end quotation
+
+The Texinfo @@-commands are a strictly limited set of constructs. The
+strict limits make it possible for Texinfo files to be understood both
+by @TeX{} and by the code that converts them into Info files. You can
+display Info files on any terminal that displays alphabetic and
+numeric characters. Similarly, you can print the output generated by
+@TeX{} on a wide variety of printers.@refill
+
+Depending on what they do or what arguments@footnote{The word
+@dfn{argument} comes from the way it is used in mathematics and does
+not refer to a disputation between two people; it refers to the
+information presented to the command. According to the @cite{Oxford
+English Dictionary}, the word derives from the Latin for @dfn{to make
+clear, prove}; thus it came to mean `the evidence offered as proof',
+which is to say, `the information offered', which led to its
+mathematical meaning. In its other thread of derivation, the word
+came to mean `to assert in a manner against which others may make
+counter assertions', which led to the meaning of `argument' as a
+disputation.} they take, you need to write @@-commands on lines of
+their own or as part of sentences:@refill
+
+@itemize @bullet
+@item
+Write a command such as @code{@@noindent} at the beginning of a line as
+the only text on the line. (@code{@@noindent} prevents the beginning of
+the next line from being indented as the beginning of a
+paragraph.)@refill
+
+@item
+Write a command such as @code{@@chapter} at the beginning of a line
+followed by the command's arguments, in this case the chapter title, on
+the rest of the line. (@code{@@chapter} creates chapter titles.)@refill
+
+@item
+Write a command such as @code{@@dots@{@}} wherever you wish but usually
+within a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill
+
+@item
+Write a command such as @code{@@code@{@var{sample-code}@}} wherever you
+wish (but usually within a sentence) with its argument,
+@var{sample-code} in this example, between the braces. (@code{@@code}
+marks text as being code.)@refill
+
+@item
+Write a command such as @code{@@example} at the beginning of a line of
+its own; write the body-text on following lines; and write the matching
+@code{@@end} command, @code{@@end example} in this case, at the
+beginning of a line of its own after the body-text. (@code{@@example}
+@dots{} @code{@@end example} indents and typesets body-text as an
+example.)@refill
+@end itemize
+
+@noindent
+@cindex Braces, when to use
+As a general rule, a command requires braces if it mingles among other
+text; but it does not need braces if it starts a line of its own. The
+non-alphabetic commands, such as @code{@@:}, are exceptions to the rule;
+they do not need braces.@refill
+
+As you gain experience with Texinfo, you will rapidly learn how to
+write the different commands: the different ways to write commands
+make it easier to write and read Texinfo files than if all commands
+followed exactly the same syntax. (For details about @@-command
+syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill
+
+@node Conventions, Comments, Formatting Commands, Overview
+@comment node-name, next, previous, up
+@section General Syntactic Conventions
+@cindex General syntactic conventions
+@cindex Syntactic conventions
+@cindex Conventions, syntactic
+
+All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and
+@samp{@}} can appear in a Texinfo file and stand for themselves.
+@samp{@@} is the escape character which introduces commands.
+@samp{@{} and @samp{@}} should be used only to surround arguments to
+certain commands. To put one of these special characters into the
+document, put an @samp{@@} character in front of it, like this:
+@samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill
+
+@ifinfo
+It is customary in @TeX{} to use doubled single-quote characters to
+begin and end quotations: ` ` and ' ' (but without a space between the
+two single-quote characters). This convention should be followed in
+Texinfo files. @TeX{} converts doubled single-quote characters to
+left- and right-hand doubled quotation marks and Info converts doubled
+single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill
+@end ifinfo
+@iftex
+It is customary in @TeX{} to use doubled single-quote characters to
+begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}. This
+convention should be followed in Texinfo files. @TeX{} converts
+doubled single-quote characters to left- and right-hand doubled
+quotation marks, ``like this'', and Info converts doubled single-quote
+characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and
+@w{@tt{ '' }} to @w{@tt{ " }}.@refill
+@end iftex
+
+Use three hyphens in a row, @samp{---}, for a dash---like this. In
+@TeX{}, a single or even a double hyphen produces a printed dash that
+is shorter than the usual typeset dash. Info reduces three hyphens to two for
+display on the screen.@refill
+
+To prevent a paragraph from being indented in the printed manual, put
+the command @code{@@noindent} on a line by itself before the
+paragraph.@refill
+
+If you mark off a region of the Texinfo file with the @code{@@iftex}
+and @w{@code{@@end iftex}} commands, that region will appear only in
+the printed copy; in that region, you can use certain commands
+borrowed from plain @TeX{} that you cannot use in Info. Likewise, if
+you mark off a region with the @code{@@ifinfo} and @code{@@end ifinfo}
+commands, that region will appear only in the Info file; in that
+region, you can use Info commands that you cannot use in @TeX{}.
+Similarly for @code{@@ifhtml} and @code{@@end ifhtml}.
+@xref{Conditionals}.
+
+@cindex Tabs; don't use!
+@quotation
+@strong{Caution:} Do not use tabs in a Texinfo file! @TeX{} uses
+variable-width fonts, which means that it cannot predefine a tab to work
+in all circumstances. Consequently, @TeX{} treats tabs like single
+spaces, and that is not what they look like.@refill
+
+@noindent
+To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple
+spaces when you press the @key{TAB} key.@refill
+
+@noindent
+Also, you can run @code{untabify} in Emacs to convert tabs in a region
+to multiple spaces.@refill
+@end quotation
+
+@node Comments, Minimum, Conventions, Overview
+@comment node-name, next, previous, up
+@section Comments
+
+You can write comments in a Texinfo file that will not appear in
+either the Info file or the printed manual by using the
+@code{@@comment} command (which may be abbreviated to @code{@@c}).
+Such comments are for the person who reads the Texinfo file. All the
+text on a line that follows either @code{@@comment} or @code{@@c} is a
+comment; the rest of the line does not appear in either the Info file
+or the printed manual. (Often, you can write the @code{@@comment} or
+@code{@@c} in the middle of a line, and only the text that follows after
+the @code{@@comment} or @code{@@c} command does not appear; but some
+commands, such as @code{@@settitle} and @code{@@setfilename}, work on a
+whole line. You cannot use @code{@@comment} or @code{@@c} in a line
+beginning with such a command.)@refill
+@cindex Comments
+@findex comment
+@findex c @r{(comment)}
+
+You can write long stretches of text that will not appear in either
+the Info file or the printed manual by using the @code{@@ignore} and
+@code{@@end ignore} commands. Write each of these commands on a line
+of its own, starting each command at the beginning of the line. Text
+between these two commands does not appear in the processed output.
+You can use @code{@@ignore} and @code{@@end ignore} for writing
+comments. Often, @code{@@ignore} and @code{@@end ignore} is used
+to enclose a part of the copying permissions that applies to the
+Texinfo source file of a document, but not to the Info or printed
+version of the document.@refill
+@cindex Ignored text
+@cindex Unprocessed text
+@findex ignore
+@c !!! Perhaps include this comment about ignore and ifset:
+@ignore
+Text enclosed by @code{@@ignore} or by failing @code{@@ifset} or
+@code{@@ifclear} conditions is ignored in the sense that it will not
+contribute to the formatted output. However, TeX and makeinfo must
+still parse the ignored text, in order to understand when to
+@emph{stop} ignoring text from the source file; that means that you
+will still get error messages if you have invalid Texinfo markup
+within ignored text.
+@end ignore
+
+@node Minimum, Six Parts, Comments, Overview
+@comment node-name, next, previous, up
+@section What a Texinfo File Must Have
+@cindex Minimal Texinfo file (requirements)
+@cindex Must have in Texinfo file
+@cindex Required in Texinfo file
+@cindex Texinfo file minimum
+
+By convention, the names of Texinfo files end with one of the
+extensions @file{.texinfo}, @file{.texi}, or @file{.tex}. The longer
+extension is preferred since it describes more clearly to a human
+reader the nature of the file. The shorter extensions are for
+operating systems that cannot handle long file names.@refill
+
+In order to be made into a printed manual and an Info file, a Texinfo
+file @strong{must} begin with lines like this:@refill
+
+@example
+@group
+\input texinfo
+@@setfilename @var{info-file-name}
+@@settitle @var{name-of-manual}
+@end group
+@end example
+
+@noindent
+The contents of the file follow this beginning, and then you @strong{must} end
+a Texinfo file with a line like this:@refill
+
+@example
+@@bye
+@end example
+
+@findex input @r{(@TeX{} command)}
+@noindent
+The @samp{\input texinfo} line tells @TeX{} to use the
+@file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
+@@-commands into @TeX{} typesetting commands. (Note the use of the
+backslash, @samp{\}; this is correct for @TeX{}.) The
+@samp{@@setfilename} line provides a name for the Info file and tells
+@TeX{} to open auxiliary files. The @samp{@@settitle} line specifies a
+title for the page headers (or footers) of the printed manual.@refill
+
+The @code{@@bye} line at the end of the file on a line of its own tells
+the formatters that the file is ended and to stop formatting.@refill
+
+Usually, you will not use quite such a spare format, but will include
+mode setting and start-of-header and end-of-header lines at the
+beginning of a Texinfo file, like this:@refill
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename @var{info-file-name}
+@@settitle @var{name-of-manual}
+@@c %**end of header
+@end group
+@end example
+
+@noindent
+In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into
+Texinfo mode when you edit the file.
+
+The @code{@@c} lines which surround the @samp{@@setfilename} and
+@samp{@@settitle} lines are optional, but you need them in order to
+run @TeX{} or Info on just part of the file. (@xref{Start of Header},
+for more information.)@refill
+
+Furthermore, you will usually provide a Texinfo file with a title
+page, indices, and the like. But the minimum, which can be useful
+for short documents, is just the three lines at the beginning and the
+one line at the end.@refill
+
+@node Six Parts, Short Sample, Minimum, Overview
+@comment node-name, next, previous, up
+@section Six Parts of a Texinfo File
+
+Generally, a Texinfo file contains more than the minimal
+beginning and end---it usually contains six parts:@refill
+
+@table @r
+@item 1. Header
+The @dfn{Header} names the file, tells @TeX{} which definitions' file to
+use, and performs other ``housekeeping'' tasks.@refill
+
+@item 2. Summary Description and Copyright
+The @dfn{Summary Description and Copyright} segment describes the document
+and contains the copyright notice and copying permissions for the Info
+file. The segment must be enclosed between @code{@@ifinfo} and
+@code{@@end ifinfo} commands so that the formatters place it only in the Info
+file.@refill
+
+@item 3. Title and Copyright
+The @dfn{Title and Copyright} segment contains the title and copyright pages
+and copying permissions for the printed manual. The segment must be
+enclosed between @code{@@titlepage} and @code{@@end titlepage} commands.
+The title and copyright page appear only in the printed @w{manual}.@refill
+
+@item 4. `Top' Node and Master Menu
+The @dfn{Master Menu} contains a complete menu of all the nodes in the whole
+Info file. It appears only in the Info file, in the `Top' node.@refill
+
+@item 5. Body
+The @dfn{Body} of the document may be structured like a traditional book or
+encyclopedia or it may be free form.@refill
+
+@item 6. End
+The @dfn{End} contains commands for printing indices and generating
+the table of contents, and the @code{@@bye} command on a line of its
+own.@refill
+@end table
+
+@node Short Sample, Acknowledgements, Six Parts, Overview
+@comment node-name, next, previous, up
+@section A Short Sample Texinfo File
+@cindex Sample Texinfo file
+
+Here is a complete but very short Texinfo file, in 6 parts. The first
+three parts of the file, from @samp{\input texinfo} through to
+@samp{@@end titlepage}, look more intimidating than they are. Most of
+the material is standard boilerplate; when you write a manual, simply
+insert the names for your own manual in this segment. (@xref{Beginning a
+File}.)@refill
+
+@noindent
+In the following, the sample text is @emph{indented}; comments on it are
+not. The complete file, without any comments, is shown in
+@ref{Sample Texinfo File}.
+
+@subheading Part 1: Header
+
+@noindent
+The header does not appear in either the Info file or the@*
+printed output. It sets various parameters, including the@*
+name of the Info file and the title used in the header.
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename sample.info
+@@settitle Sample Document
+@@c %**end of header
+
+@@setchapternewpage odd
+@end group
+@end example
+
+@subheading Part 2: Summary Description and Copyright
+
+@noindent
+The summary description and copyright segment does not@*
+appear in the printed document.
+
+@example
+@group
+@@ifinfo
+This is a short example of a complete Texinfo file.
+
+Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
+@@end ifinfo
+@end group
+@end example
+
+@subheading Part 3: Titlepage and Copyright
+
+@noindent
+The titlepage segment does not appear in the Info file.
+
+@example
+@group
+@@titlepage
+@@sp 10
+@@comment The title is printed in a large font.
+@@center @@titlefont@{Sample Title@}
+@end group
+
+@group
+@@c The following two commands start the copyright page.
+@@page
+@@vskip 0pt plus 1filll
+Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
+@@end titlepage
+@end group
+@end example
+
+@subheading Part 4: `Top' Node and Master Menu
+
+@noindent
+The `Top' node contains the master menu for the Info file.@*
+Since a printed manual uses a table of contents rather than@*
+a menu, the master menu appears only in the Info file.
+
+@example
+@group
+@@node Top, First Chapter, (dir), (dir)
+@@comment node-name, next, previous, up
+@end group
+@end example
+
+@example
+@group
+@@menu
+* First Chapter:: The first chapter is the
+ only chapter in this sample.
+* Concept Index:: This index has two entries.
+@@end menu
+@end group
+@end example
+
+@subheading Part 5: The Body of the Document
+
+@noindent
+The body segment contains all the text of the document, but not the
+indices or table of contents. This example illustrates a node and a
+chapter containing an enumerated list.@refill
+
+@example
+@group
+@@node First Chapter, Concept Index, Top, Top
+@@comment node-name, next, previous, up
+@@chapter First Chapter
+@@cindex Sample index entry
+@end group
+
+@group
+This is the contents of the first chapter.
+@@cindex Another sample index entry
+@end group
+
+@group
+Here is a numbered list.
+
+@@enumerate
+@@item
+This is the first item.
+
+@@item
+This is the second item.
+@@end enumerate
+@end group
+
+@group
+The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
+commands transform a Texinfo file such as this into
+an Info file; and @@TeX@{@} typesets it for a printed
+manual.
+@end group
+@end example
+
+@subheading Part 6: The End of the Document
+
+@noindent
+The end segment contains commands both for generating an index in a node
+and unnumbered chapter of its own and for generating the table of
+contents; and it contains the @code{@@bye} command that marks the end of
+the document.@refill
+
+@example
+@group
+@@node Concept Index, , First Chapter, Top
+@@comment node-name, next, previous, up
+@@unnumbered Concept Index
+@end group
+
+@group
+@@printindex cp
+
+@@contents
+@@bye
+@end group
+@end example
+
+@subheading The Results
+
+Here is what the contents of the first chapter of the sample look like:
+
+@sp 1
+@need 700
+@quotation
+This is the contents of the first chapter.
+
+Here is a numbered list.
+
+@enumerate
+@item
+This is the first item.
+
+@item
+This is the second item.
+@end enumerate
+
+The @code{makeinfo} and @code{texinfo-format-buffer}
+commands transform a Texinfo file such as this into
+an Info file; and @TeX{} typesets it for a printed
+manual.
+@end quotation
+
+@node Acknowledgements, , Short Sample, Overview
+@comment node-name, next, previous, up
+@section Acknowledgements
+
+@cindex Stallman, Richard M.
+@cindex Chassell, Robert J.
+@cindex Berry, Karl
+Richard M.@: Stallman wrote Edition 1.0 of this manual. @w{Robert J.@:
+Chassell} revised and extended it, starting with Edition 1.1. Karl
+Berry made updates for the Texinfo 3.8 and subsequent releases, starting
+with Edition 2.22.
+
+@cindex Pinard, Fran@,{c}ois
+@cindex Zuhn, David D.
+@cindex Weisshaus, Melissa
+Our thanks go out to all who helped improve this work, particularly to
+Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and
+reported mistakes and obscurities; our special thanks go to Melissa
+Weisshaus for her frequent and often tedious reviews of nearly similar
+editions. Our mistakes are our own.
+
+Please send suggestions and corrections to:
+
+@example
+@group
+@r{Internet address:}
+ bug-texinfo@@prep.ai.mit.edu
+@end group
+@end example
+
+@noindent
+Please include the manual's edition number and update date in your messages.
+
+@node Texinfo Mode, Beginning a File, Overview, Top
+@comment node-name, next, previous, up
+@chapter Using Texinfo Mode
+@cindex Texinfo mode
+@cindex Mode, using Texinfo
+@cindex GNU Emacs
+@cindex Emacs
+
+You may edit a Texinfo file with any text editor you choose. A Texinfo
+file is no different from any other @sc{ascii} file. However, GNU Emacs
+comes with a special mode, called Texinfo
+mode, that provides Emacs commands and tools to help ease your work.@refill
+
+This chapter describes features of GNU Emacs' Texinfo mode but not any
+features of the Texinfo formatting language. If you are reading this
+manual straight through from the beginning, you may want to skim through
+this chapter briefly and come back to it after reading succeeding
+chapters which describe the Texinfo formatting language in
+detail.@refill
+
+@menu
+* Texinfo Mode Overview:: How Texinfo mode can help you.
+* Emacs Editing:: Texinfo mode adds to GNU Emacs' general
+ purpose editing features.
+* Inserting:: How to insert frequently used @@-commands.
+* Showing the Structure:: How to show the structure of a file.
+* Updating Nodes and Menus:: How to update or create new nodes and menus.
+* Info Formatting:: How to format for Info.
+* Printing:: How to format and print part or all of a file.
+* Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
+@end menu
+
+@node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode
+@ifinfo
+@heading Texinfo Mode Overview
+@end ifinfo
+
+Texinfo mode provides special features for working with Texinfo
+files:@refill
+
+@itemize @bullet
+@item
+Insert frequently used @@-commands. @refill
+
+@item
+Automatically create @code{@@node} lines.
+
+@item
+Show the structure of a Texinfo source file.@refill
+
+@item
+Automatically create or update the `Next',@*
+`Previous', and `Up' pointers of a node.
+
+@item
+Automatically create or update menus.@refill
+
+@item
+Automatically create a master menu.@refill
+
+@item
+Format a part or all of a file for Info.@refill
+
+@item
+Typeset and print part or all of a file.@refill
+@end itemize
+
+Perhaps the two most helpful features are those for inserting frequently
+used @@-commands and for creating node pointers and menus.@refill
+
+@node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode
+@section The Usual GNU Emacs Editing Commands
+
+In most cases, the usual Text mode commands work the same in Texinfo
+mode as they do in Text mode. Texinfo mode adds new editing commands
+and tools to GNU Emacs' general purpose editing features. The major
+difference concerns filling. In Texinfo mode, the paragraph
+separation variable and syntax table are redefined so that Texinfo
+commands that should be on lines of their own are not inadvertently
+included in paragraphs. Thus, the @kbd{M-q} (@code{fill-paragraph})
+command will refill a paragraph but not mix an indexing command on a
+line adjacent to it into the paragraph.@refill
+
+In addition, Texinfo mode sets the @code{page-delimiter} variable to
+the value of @code{texinfo-chapter-level-regexp}; by default, this is
+a regular expression matching the commands for chapters and their
+equivalents, such as appendices. With this value for the page
+delimiter, you can jump from chapter title to chapter title with the
+@kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
+(@code{backward-page}) commands and narrow to a chapter with the
+@kbd{C-x p} (@code{narrow-to-page}) command. (@xref{Pages, , ,emacs,
+The GNU Emacs Manual}, for details about the page commands.)@refill
+
+You may name a Texinfo file however you wish, but the convention is to
+end a Texinfo file name with one of the three extensions
+@file{.texinfo}, @file{.texi}, or @file{.tex}. A longer extension is
+preferred, since it is explicit, but a shorter extension may be
+necessary for operating systems that limit the length of file names.
+GNU Emacs automatically enters Texinfo mode when you visit a file with
+a @file{.texinfo} or @file{.texi}
+extension. Also, Emacs switches to Texinfo mode
+when you visit a
+file that has @samp{-*-texinfo-*-} in its first line. If ever you are
+in another mode and wish to switch to Texinfo mode, type @code{M-x
+texinfo-mode}.@refill
+
+Like all other Emacs features, you can customize or enhance Texinfo
+mode as you wish. In particular, the keybindings are very easy to
+change. The keybindings described here are the default or standard
+ones.@refill
+
+@node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode
+@comment node-name, next, previous, up
+@section Inserting Frequently Used Commands
+@cindex Inserting frequently used commands
+@cindex Frequently used commands, inserting
+@cindex Commands, inserting them
+
+Texinfo mode provides commands to insert various frequently used
+@@-commands into the buffer. You can use these commands to save
+keystrokes.@refill
+
+The insert commands are invoked by typing @kbd{C-c} twice and then the
+first letter of the @@-command:@refill
+
+@table @kbd
+@item C-c C-c c
+@itemx M-x texinfo-insert-@@code
+@findex texinfo-insert-@@code
+Insert @code{@@code@{@}} and put the
+cursor between the braces.@refill
+
+@item C-c C-c d
+@itemx M-x texinfo-insert-@@dfn
+@findex texinfo-insert-@@dfn
+Insert @code{@@dfn@{@}} and put the
+cursor between the braces.@refill
+
+@item C-c C-c e
+@itemx M-x texinfo-insert-@@end
+@findex texinfo-insert-@@end
+Insert @code{@@end} and attempt to insert the correct following word,
+such as @samp{example} or @samp{table}. (This command does not handle
+nested lists correctly, but inserts the word appropriate to the
+immediately preceding list.)@refill
+
+@item C-c C-c i
+@itemx M-x texinfo-insert-@@item
+@findex texinfo-insert-@@item
+Insert @code{@@item} and put the
+cursor at the beginning of the next line.@refill
+
+@item C-c C-c k
+@itemx M-x texinfo-insert-@@kbd
+@findex texinfo-insert-@@kbd
+Insert @code{@@kbd@{@}} and put the
+cursor between the braces.@refill
+
+@item C-c C-c n
+@itemx M-x texinfo-insert-@@node
+@findex texinfo-insert-@@node
+Insert @code{@@node} and a comment line
+listing the sequence for the `Next',
+`Previous', and `Up' nodes.
+Leave point after the @code{@@node}.@refill
+
+@item C-c C-c o
+@itemx M-x texinfo-insert-@@noindent
+@findex texinfo-insert-@@noindent
+Insert @code{@@noindent} and put the
+cursor at the beginning of the next line.@refill
+
+@item C-c C-c s
+@itemx M-x texinfo-insert-@@samp
+@findex texinfo-insert-@@samp
+Insert @code{@@samp@{@}} and put the
+cursor between the braces.@refill
+
+@item C-c C-c t
+@itemx M-x texinfo-insert-@@table
+@findex texinfo-insert-@@table
+Insert @code{@@table} followed by a @key{SPC}
+and leave the cursor after the @key{SPC}.@refill
+
+@item C-c C-c v
+@itemx M-x texinfo-insert-@@var
+@findex texinfo-insert-@@var
+Insert @code{@@var@{@}} and put the
+cursor between the braces.@refill
+
+@item C-c C-c x
+@itemx M-x texinfo-insert-@@example
+@findex texinfo-insert-@@example
+Insert @code{@@example} and put the
+cursor at the beginning of the next line.@refill
+
+@c M-@{ was the binding for texinfo-insert-braces;
+@c in Emacs 19, backward-paragraph will take this binding.
+@item C-c C-c @{
+@itemx M-x texinfo-insert-braces
+@findex texinfo-insert-braces
+Insert @code{@{@}} and put the cursor between the braces.@refill
+
+@item C-c C-c @}
+@itemx C-c C-c ]
+@itemx M-x up-list
+@findex up-list
+Move from between a pair of braces forward past the closing brace.
+Typing @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which
+is, however, more mnemonic; hence the two keybindings. (Also, you can
+move out from between braces by typing @kbd{C-f}.)@refill
+@end table
+
+To put a command such as @w{@code{@@code@{@dots{}@}}} around an
+@emph{existing} word, position the cursor in front of the word and type
+@kbd{C-u 1 C-c C-c c}. This makes it easy to edit existing plain text.
+The value of the prefix argument tells Emacs how many words following
+point to include between braces---1 for one word, 2 for two words, and
+so on. Use a negative argument to enclose the previous word or words.
+If you do not specify a prefix argument, Emacs inserts the @@-command
+string and positions the cursor between the braces. This feature works
+only for those @@-commands that operate on a word or words within one
+line, such as @code{@@kbd} and @code{@@var}.@refill
+
+This set of insert commands was created after analyzing the frequency
+with which different @@-commands are used in the @cite{GNU Emacs
+Manual} and the @cite{GDB Manual}. If you wish to add your own insert
+commands, you can bind a keyboard macro to a key, use abbreviations,
+or extend the code in @file{texinfo.el}.@refill
+
+@findex texinfo-start-menu-description
+@cindex Menu description, start
+@cindex Description for menu, start
+@kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
+command that works differently from the other insert commands. It
+inserts a node's section or chapter title in the space for the
+description in a menu entry line. (A menu entry has three parts, the
+entry name, the node name, and the description. Only the node name is
+required, but a description helps explain what the node is about.
+@xref{Menu Parts, , The Parts of a Menu}.)@refill
+
+To use @code{texinfo-start-menu-description}, position point in a menu
+entry line and type @kbd{C-c C-c C-d}. The command looks for and copies
+the title that goes with the node name, and inserts the title as a
+description; it positions point at beginning of the inserted text so you
+can edit it. The function does not insert the title if the menu entry
+line already contains a description.@refill
+
+This command is only an aid to writing descriptions; it does not do the
+whole job. You must edit the inserted text since a title tends to use
+the same words as a node name but a useful description uses different
+words.@refill
+
+@node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode
+@comment node-name, next, previous, up
+@section Showing the Section Structure of a File
+@cindex Showing the section structure of a file
+@cindex Section structure of a file, showing it
+@cindex Structure of a file, showing it
+@cindex Outline of file structure, showing it
+@cindex Contents-like outline of file structure
+@cindex File section structure, showing it
+@cindex Texinfo file section structure, showing it
+
+You can show the section structure of a Texinfo file by using the
+@kbd{C-c C-s} command (@code{texinfo-show-structure}). This command
+shows the section structure of a Texinfo file by listing the lines
+that begin with the @@-commands for @code{@@chapter},
+@code{@@section}, and the like. It constructs what amounts
+to a table of contents. These lines are displayed in another buffer
+called the @samp{*Occur*} buffer. In that buffer, you can position
+the cursor over one of the lines and use the @kbd{C-c C-c} command
+(@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
+in the Texinfo file.@refill
+
+@table @kbd
+@item C-c C-s
+@itemx M-x texinfo-show-structure
+@findex texinfo-show-structure
+Show the @code{@@chapter}, @code{@@section}, and such lines of a
+Texinfo file.@refill
+
+@item C-c C-c
+@itemx M-x occur-mode-goto-occurrence
+@findex occur-mode-goto-occurrence
+Go to the line in the Texinfo file corresponding to the line under the
+cursor in the @file{*Occur*} buffer.@refill
+@end table
+
+If you call @code{texinfo-show-structure} with a prefix argument by
+typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
+@@-commands for @code{@@chapter}, @code{@@section}, and the like,
+but also the @code{@@node} lines. (This is how the
+@code{texinfo-show-structure} command worked without an argument in
+the first version of Texinfo. It was changed because @code{@@node}
+lines clutter up the @samp{*Occur*} buffer and are usually not
+needed.) You can use @code{texinfo-show-structure} with a prefix
+argument to check whether the `Next', `Previous', and `Up' pointers of
+an @code{@@node} line are correct.@refill
+
+Often, when you are working on a manual, you will be interested only
+in the structure of the current chapter. In this case, you can mark
+off the region of the buffer that you are interested in by using the
+@kbd{C-x n n} (@code{narrow-to-region}) command and
+@code{texinfo-show-structure} will work on only that region. To see
+the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
+(@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
+information about the narrowing commands.)@refill
+
+@vindex page-delimiter
+@cindex Page delimiter in Texinfo mode
+In addition to providing the @code{texinfo-show-structure} command,
+Texinfo mode sets the value of the page delimiter variable to match
+the chapter-level @@-commands. This enables you to use the @kbd{C-x
+]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
+commands to move forward and backward by chapter, and to use the
+@kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter.
+@xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
+about the page commands.@refill
+
+@node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode
+@comment node-name, next, previous, up
+@section Updating Nodes and Menus
+@cindex Updating nodes and menus
+@cindex Create nodes, menus automatically
+@cindex Insert nodes, menus automatically
+@cindex Automatically insert nodes, menus
+
+Texinfo mode provides commands for automatically creating or updating
+menus and node pointers. The commands are called ``update'' commands
+because their most frequent use is for updating a Texinfo file after
+you have worked on it; but you can use them to insert the `Next',
+`Previous', and `Up' pointers into an @code{@@node} line that has none and to
+create menus in a file that has none.@refill
+
+If you do not use the updating commands, you need to write menus and
+node pointers by hand, which is a tedious task.@refill
+
+@menu
+* Updating Commands:: Five major updating commands.
+* Updating Requirements:: How to structure a Texinfo file for
+ using the updating command.
+* Other Updating Commands:: How to indent descriptions, insert
+ missing nodes lines, and update
+ nodes in sequence.
+@end menu
+
+@node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus
+@ifinfo
+@subheading The Updating Commands
+@end ifinfo
+
+You can use the updating commands@refill
+
+@itemize @bullet
+@item
+to insert or update the `Next', `Previous', and `Up' pointers of a
+node,@refill
+
+@item
+to insert or update the menu for a section, and@refill
+
+@item
+to create a master menu for a Texinfo source file.@refill
+@end itemize
+
+You can also use the commands to update all the nodes and menus in a
+region or in a whole Texinfo file.@refill
+
+The updating commands work only with conventional Texinfo files, which
+are structured hierarchically like books. In such files, a structuring
+command line must follow closely after each @code{@@node} line, except
+for the `Top' @code{@@node} line. (A @dfn{structuring command line} is
+a line beginning with @code{@@chapter}, @code{@@section}, or other
+similar command.)
+
+You can write the structuring command line on the line that follows
+immediately after an @code{@@node} line or else on the line that
+follows after a single @code{@@comment} line or a single
+@code{@@ifinfo} line. You cannot interpose more than one line between
+the @code{@@node} line and the structuring command line; and you may
+interpose only an @code{@@comment} line or an @code{@@ifinfo} line.
+
+Commands which work on a whole buffer require that the `Top' node be
+followed by a node with an @code{@@chapter} or equivalent-level command.
+Note that the menu updating commands will not create a main or master
+menu for a Texinfo file that has only @code{@@chapter}-level nodes! The
+menu updating commands only create menus @emph{within} nodes for lower level
+nodes. To create a menu of chapters, you must provide a `Top'
+node.@refill
+
+The menu updating commands remove menu entries that refer to other Info
+files since they do not refer to nodes within the current buffer. This
+is a deficiency. Rather than use menu entries, you can use cross
+references to refer to other Info files. None of the updating commands
+affect cross references.@refill
+
+Texinfo mode has five updating commands that are used most often: two
+are for updating the node pointers or menu of a single node (or a
+region); two are for updating every node pointer and menu in a file;
+and one, the @code{texinfo-master-menu} command, is for creating a
+master menu for a complete file, and optionally, for updating every
+node and menu in the whole Texinfo file.@refill
+
+The @code{texinfo-master-menu} command is the primary command:@refill
+
+@table @kbd
+@item C-c C-u m
+@itemx M-x texinfo-master-menu
+@findex texinfo-master-menu
+Create or update a master menu that includes all the other menus
+(incorporating the descriptions from pre-existing menus, if
+any).@refill
+
+With an argument (prefix argument, @kbd{C-u,} if interactive), first create or
+update all the nodes and all the regular menus in the buffer before
+constructing the master menu. (@xref{The Top Node, , The Top Node and
+Master Menu}, for more about a master menu.)@refill
+
+For @code{texinfo-master-menu} to work, the Texinfo file must have a
+`Top' node and at least one subsequent node.@refill
+
+After extensively editing a Texinfo file, you can type the following:
+
+@example
+C-u M-x texinfo-master-menu
+@exdent or
+C-u C-c C-u m
+@end example
+
+@noindent
+This updates all the nodes and menus completely and all at once.@refill
+@end table
+
+The other major updating commands do smaller jobs and are designed for
+the person who updates nodes and menus as he or she writes a Texinfo
+file.@refill
+
+@need 1000
+The commands are:@refill
+
+@table @kbd
+@item C-c C-u C-n
+@itemx M-x texinfo-update-node
+@findex texinfo-update-node
+Insert the `Next', `Previous', and `Up' pointers for the node that point is
+within (i.e., for the @code{@@node} line preceding point). If the
+@code{@@node} line has pre-existing `Next', `Previous', or `Up'
+pointers in it, the old pointers are removed and new ones inserted.
+With an argument (prefix argument, @kbd{C-u}, if interactive), this command
+updates all @code{@@node} lines in the region (which is the text
+between point and mark).@refill
+
+@item C-c C-u C-m
+@itemx M-x texinfo-make-menu
+@findex texinfo-make-menu
+Create or update the menu in the node that point is within.
+With an argument (@kbd{C-u} as prefix argument, if
+interactive), the command makes or updates menus for the
+nodes which are either within or a part of the
+region.@refill
+
+Whenever @code{texinfo-make-menu} updates an existing menu, the
+descriptions from that menu are incorporated into the new menu. This
+is done by copying descriptions from the existing menu to the entries
+in the new menu that have the same node names. If the node names are
+different, the descriptions are not copied to the new menu.@refill
+
+@item C-c C-u C-e
+@itemx M-x texinfo-every-node-update
+@findex texinfo-every-node-update
+Insert or update the `Next', `Previous', and `Up' pointers for every
+node in the buffer.@refill
+
+@item C-c C-u C-a
+@itemx M-x texinfo-all-menus-update
+@findex texinfo-all-menus-update
+Create or update all the menus in the buffer. With an argument
+(@kbd{C-u} as prefix argument, if interactive), first insert
+or update all the node
+pointers before working on the menus.@refill
+
+If a master menu exists, the @code{texinfo-all-menus-update} command
+updates it; but the command does not create a new master menu if none
+already exists. (Use the @code{texinfo-master-menu} command for
+that.)@refill
+
+When working on a document that does not merit a master menu, you can
+type the following:
+
+@example
+C-u C-c C-u C-a
+@exdent or
+C-u M-x texinfo-all-menus-update
+@end example
+
+@noindent
+This updates all the nodes and menus.@refill
+@end table
+
+The @code{texinfo-column-for-description} variable specifies the
+column to which menu descriptions are indented. By default, the value
+is 32 although it is often useful to reduce it to as low as 24. You
+can set the variable with the @kbd{M-x edit-options} command
+(@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs
+Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining,
+, Examining and Setting Variables, emacs, The GNU Emacs
+Manual}).@refill
+
+Also, the @code{texinfo-indent-menu-description} command may be used to
+indent existing menu descriptions to a specified column. Finally, if
+you wish, you can use the @code{texinfo-insert-node-lines} command to
+insert missing @code{@@node} lines into a file. (@xref{Other Updating
+Commands}, for more information.)@refill
+
+@node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus
+@comment node-name, next, previous, up
+@subsection Updating Requirements
+@cindex Updating requirements
+@cindex Requirements for updating commands
+
+To use the updating commands, you must organize the Texinfo file
+hierarchically with chapters, sections, subsections, and the like.
+When you construct the hierarchy of the manual, do not `jump down'
+more than one level at a time: you can follow the `Top' node with a
+chapter, but not with a section; you can follow a chapter with a
+section, but not with a subsection. However, you may `jump up' any
+number of levels at one time---for example, from a subsection to a
+chapter.@refill
+
+Each @code{@@node} line, with the exception of the line for the `Top'
+node, must be followed by a line with a structuring command such as
+@code{@@chapter}, @code{@@section}, or
+@code{@@unnumberedsubsec}.@refill
+
+Each @code{@@node} line/structuring-command line combination
+must look either like this:@refill
+
+@example
+@group
+@@node Comments, Minimum, Conventions, Overview
+@@comment node-name, next, previous, up
+@@section Comments
+@end group
+@end example
+
+or like this (without the @code{@@comment} line):
+
+@example
+@group
+@@node Comments, Minimum, Conventions, Overview
+@@section Comments
+@end group
+@end example
+
+@noindent
+In this example, `Comments' is the name of both the node and the
+section. The next node is called `Minimum' and the previous node is
+called `Conventions'. The `Comments' section is within the `Overview'
+node, which is specified by the `Up' pointer. (Instead of an
+@code{@@comment} line, you can write an @code{@@ifinfo} line.)@refill
+
+If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
+and be the first node in the file.@refill
+
+The menu updating commands create a menu of sections within a chapter,
+a menu of subsections within a section, and so on. This means that
+you must have a `Top' node if you want a menu of chapters.@refill
+
+Incidentally, the @code{makeinfo} command will create an Info file for
+a hierarchically organized Texinfo file that lacks `Next', `Previous'
+and `Up' pointers. Thus, if you can be sure that your Texinfo file
+will be formatted with @code{makeinfo}, you have no need for the
+`update node' commands. (@xref{Create an Info File, , Creating an
+Info File}, for more information about @code{makeinfo}.) However,
+both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands
+require that you insert menus in the file.@refill
+
+@node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus
+@comment node-name, next, previous, up
+@subsection Other Updating Commands
+
+In addition to the five major updating commands, Texinfo mode
+possesses several less frequently used updating commands:@refill
+
+@table @kbd
+@item M-x texinfo-insert-node-lines
+@findex texinfo-insert-node-lines
+Insert @code{@@node} lines before the @code{@@chapter},
+@code{@@section}, and other sectioning commands wherever they are
+missing throughout a region in a Texinfo file.@refill
+
+With an argument (@kbd{C-u} as prefix argument, if interactive), the
+@code{texinfo-insert-node-lines} command not only inserts
+@code{@@node} lines but also inserts the chapter or section titles as
+the names of the corresponding nodes. In addition, it inserts the
+titles as node names in pre-existing @code{@@node} lines that lack
+names. Since node names should be more concise than section or
+chapter titles, you must manually edit node names so inserted.@refill
+
+For example, the following marks a whole buffer as a region and inserts
+@code{@@node} lines and titles throughout:@refill
+
+@example
+C-x h C-u M-x texinfo-insert-node-lines
+@end example
+
+(Note that this command inserts titles as node names in @code{@@node}
+lines; the @code{texinfo-start-menu-description} command
+(@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles
+as descriptions in menu entries, a different action. However, in both
+cases, you need to edit the inserted text.)@refill
+
+@item M-x texinfo-multiple-files-update
+@findex texinfo-multiple-files-update @r{(in brief)}
+Update nodes and menus in a document built from several separate files.
+With @kbd{C-u} as a prefix argument, create and insert a master menu in
+the outer file. With a numeric prefix argument, such as @kbd{C-u 2}, first
+update all the menus and all the `Next', `Previous', and `Up' pointers
+of all the included files before creating and inserting a master menu in
+the outer file. The @code{texinfo-multiple-files-update} command is
+described in the appendix on @code{@@include} files.
+@ifinfo
+@xref{texinfo-multiple-files-update}.@refill
+@end ifinfo
+@iftex
+@xref{texinfo-multiple-files-update, ,
+@code{texinfo-multiple-files-update}}.@refill
+@end iftex
+
+@item M-x texinfo-indent-menu-description
+@findex texinfo-indent-menu-description
+Indent every description in the menu following point to the specified
+column. You can use this command to give yourself more space for
+descriptions. With an argument (@kbd{C-u} as prefix argument, if
+interactive), the @code{texinfo-indent-menu-description} command indents
+every description in every menu in the region. However, this command
+does not indent the second and subsequent lines of a multi-line
+description.@refill
+
+@item M-x texinfo-sequential-node-update
+@findex texinfo-sequential-node-update
+Insert the names of the nodes immediately following and preceding the
+current node as the `Next' or `Previous' pointers regardless of those
+nodes' hierarchical level. This means that the `Next' node of a
+subsection may well be the next chapter. Sequentially ordered nodes are
+useful for novels and other documents that you read through
+sequentially. (However, in Info, the @code{g* @key{RET}} command lets
+you look through the file sequentially, so sequentially ordered nodes
+are not strictly necessary.) With an argument (prefix argument, if
+interactive), the @code{texinfo-sequential-node-update} command
+sequentially updates all the nodes in the region.@refill
+@end table
+
+@node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode
+@comment node-name, next, previous, up
+@section Formatting for Info
+@cindex Formatting for Info
+@cindex Running an Info formatter
+@cindex Info formatting
+
+Texinfo mode provides several commands for formatting part or all of a
+Texinfo file for Info. Often, when you are writing a document, you
+want to format only part of a file---that is, a region.@refill
+
+You can use either the @code{texinfo-format-region} or the
+@code{makeinfo-region} command to format a region:@refill
+
+@table @kbd
+@findex texinfo-format-region
+@item C-c C-e C-r
+@itemx M-x texinfo-format-region
+@itemx C-c C-m C-r
+@itemx M-x makeinfo-region
+Format the current region for Info.@refill
+@end table
+
+You can use either the @code{texinfo-format-buffer} or the
+@code{makeinfo-buffer} command to format a whole buffer:@refill
+
+@table @kbd
+@findex texinfo-format-buffer
+@item C-c C-e C-b
+@itemx M-x texinfo-format-buffer
+@itemx C-c C-m C-b
+@itemx M-x makeinfo-buffer
+Format the current buffer for Info.@refill
+@end table
+
+@need 1000
+For example, after writing a Texinfo file, you can type the following:
+
+@example
+C-u C-c C-u m
+@exdent or
+C-u M-x texinfo-master-menu
+@end example
+
+@noindent
+This updates all the nodes and menus. Then type the following to create
+an Info file:
+
+@example
+C-c C-m C-b
+@exdent or
+M-x makeinfo-buffer
+@end example
+
+For @TeX{} or the Info formatting commands to work, the file @emph{must}
+include a line that has @code{@@setfilename} in its header.@refill
+
+@xref{Create an Info File}, for details about Info formatting.@refill
+
+@node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode
+@comment node-name, next, previous, up
+@section Formatting and Printing
+@cindex Formatting for printing
+@cindex Printing a region or buffer
+@cindex Region formatting and printing
+@cindex Buffer formatting and printing
+@cindex Part of file formatting and printing
+
+Typesetting and printing a Texinfo file is a multi-step process in which
+you first create a file for printing (called a @sc{dvi} file), and then
+print the file. Optionally, you may also create indices. To do this,
+you must run the @code{texindex} command after first running the
+@code{tex} typesetting command; and then you must run the @code{tex}
+command again. Or else run the @code{texi2dvi} command which
+automatically creates indices as needed.@refill
+
+Often, when you are writing a document, you want to typeset and print
+only part of a file to see what it will look like. You can use the
+@code{texinfo-tex-region} and related commands for this purpose. Use
+the @code{texinfo-tex-buffer} command to format all of a
+buffer.@refill
+
+@table @kbd
+@item C-c C-t C-b
+@itemx M-x texinfo-tex-buffer
+@findex texinfo-tex-buffer
+Run @code{texi2dvi} on the buffer. In addition to running @TeX{} on the
+buffer, this command automatically creates or updates indices as
+needed.@refill
+
+@item C-c C-t C-r
+@itemx M-x texinfo-tex-region
+@findex texinfo-tex-region
+Run @TeX{} on the region.@refill
+
+@item C-c C-t C-i
+@itemx M-x texinfo-texindex
+Run @code{texindex} to sort the indices of a Texinfo file formatted with
+@code{texinfo-tex-region}. The @code{texinfo-tex-region} command does
+not run @code{texindex} automatically; it only runs the @code{tex}
+typesetting command. You must run the @code{texinfo-tex-region} command
+a second time after sorting the raw index files with the @code{texindex}
+command. (Usually, you do not format an index when you format a region,
+only when you format a buffer. Now that the @code{texi2dvi} command
+exists, there is no little need for this command.)@refill
+
+@item C-c C-t C-p
+@itemx M-x texinfo-tex-print
+@findex texinfo-tex-print
+Print the file (or the part of the file) previously formatted with
+@code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill
+@end table
+
+For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
+file @emph{must} start with a @samp{\input texinfo} line and must
+include an @code{@@settitle} line. The file must end with @code{@@bye}
+on a line by itself. (When you use @code{texinfo-tex-region}, you must
+surround the @code{@@settitle} line with start-of-header and
+end-of-header lines.)@refill
+
+@xref{Format/Print Hardcopy}, for a description of the other @TeX{} related
+commands, such as @code{tex-show-print-queue}.@refill
+
+@node Texinfo Mode Summary, , Printing, Texinfo Mode
+@comment node-name, next, previous, up
+@section Texinfo Mode Summary
+
+In Texinfo mode, each set of commands has default keybindings that
+begin with the same keys. All the commands that are custom-created
+for Texinfo mode begin with @kbd{C-c}. The keys are somewhat
+mnemonic.@refill
+
+@subheading Insert Commands
+
+The insert commands are invoked by typing @kbd{C-c} twice and then the
+first letter of the @@-command to be inserted. (It might make more
+sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
+@kbd{C-c C-c} is quick to type.)@refill
+
+@example
+C-c C-c c @r{Insert} @samp{@@code}.
+C-c C-c d @r{Insert} @samp{@@dfn}.
+C-c C-c e @r{Insert} @samp{@@end}.
+C-c C-c i @r{Insert} @samp{@@item}.
+C-c C-c n @r{Insert} @samp{@@node}.
+C-c C-c s @r{Insert} @samp{@@samp}.
+C-c C-c v @r{Insert} @samp{@@var}.
+C-c C-c @{ @r{Insert braces.}
+C-c C-c ]
+C-c C-c @} @r{Move out of enclosing braces.}
+
+@group
+C-c C-c C-d @r{Insert a node's section title}
+ @r{in the space for the description}
+ @r{in a menu entry line.}
+@end group
+@end example
+
+@subheading Show Structure
+
+The @code{texinfo-show-structure} command is often used within a
+narrowed region.@refill
+
+@example
+C-c C-s @r{List all the headings.}
+@end example
+
+@subheading The Master Update Command
+
+The @code{texinfo-master-menu} command creates a master menu; and can
+be used to update every node and menu in a file as well.@refill
+
+@example
+@group
+C-c C-u m
+M-x texinfo-master-menu
+ @r{Create or update a master menu.}
+@end group
+
+@group
+C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first}
+ @r{create or update all nodes and regular}
+ @r{menus, and then create a master menu.}
+@end group
+@end example
+
+@subheading Update Pointers
+
+The update pointer commands are invoked by typing @kbd{C-c C-u} and
+then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
+@code{texinfo-every-node-update}.@refill
+
+@example
+C-c C-u C-n @r{Update a node.}
+C-c C-u C-e @r{Update every node in the buffer.}
+@end example
+
+@subheading Update Menus
+
+Invoke the update menu commands by typing @kbd{C-c C-u}
+and then either @kbd{C-m} for @code{texinfo-make-menu} or
+@kbd{C-a} for @code{texinfo-all-menus-update}. To update
+both nodes and menus at the same time, precede @kbd{C-c C-u
+C-a} with @kbd{C-u}.@refill
+
+@example
+C-c C-u C-m @r{Make or update a menu.}
+
+@group
+C-c C-u C-a @r{Make or update all}
+ @r{menus in a buffer.}
+@end group
+
+@group
+C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
+ @r{first create or update all nodes and}
+ @r{then create or update all menus.}
+@end group
+@end example
+
+@subheading Format for Info
+
+The Info formatting commands that are written in Emacs Lisp are
+invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
+or @kbd{C-b} for the whole buffer.@refill
+
+The Info formatting commands that are written in C and based on the
+@code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
+either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill
+
+@need 800
+@noindent
+Use the @code{texinfo-format@dots{}} commands:
+
+@example
+@group
+C-c C-e C-r @r{Format the region.}
+C-c C-e C-b @r{Format the buffer.}
+@end group
+@end example
+
+@need 750
+@noindent
+Use @code{makeinfo}:
+
+@example
+C-c C-m C-r @r{Format the region.}
+C-c C-m C-b @r{Format the buffer.}
+C-c C-m C-l @r{Recenter the @code{makeinfo} output buffer.}
+C-c C-m C-k @r{Kill the @code{makeinfo} formatting job.}
+@end example
+
+@subheading Typeset and Print
+
+The @TeX{} typesetting and printing commands are invoked by typing
+@kbd{C-c C-t} and then another control command: @kbd{C-r} for
+@code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
+and so on.@refill
+
+@example
+C-c C-t C-r @r{Run @TeX{} on the region.}
+C-c C-t C-b @r{Run} @code{texi2dvi} @r{on the buffer.}
+C-c C-t C-i @r{Run} @code{texindex}.
+C-c C-t C-p @r{Print the @sc{dvi} file.}
+C-c C-t C-q @r{Show the print queue.}
+C-c C-t C-d @r{Delete a job from the print queue.}
+C-c C-t C-k @r{Kill the current @TeX{} formatting job.}
+C-c C-t C-x @r{Quit a currently stopped @TeX{} formatting job.}
+C-c C-t C-l @r{Recenter the output buffer.}
+@end example
+
+@subheading Other Updating Commands
+
+The `other updating commands' do not have standard keybindings because
+they are rarely used.
+
+@example
+@group
+M-x texinfo-insert-node-lines
+ @r{Insert missing @code{@@node} lines in region.}
+ @r{With @kbd{C-u} as a prefix argument,}
+ @r{use section titles as node names.}
+@end group
+
+@group
+M-x texinfo-multiple-files-update
+ @r{Update a multi-file document.}
+ @r{With @kbd{C-u 2} as a prefix argument,}
+ @r{create or update all nodes and menus}
+ @r{in all included files first.}
+@end group
+
+@group
+M-x texinfo-indent-menu-description
+ @r{Indent descriptions.}
+@end group
+
+@group
+M-x texinfo-sequential-node-update
+ @r{Insert node pointers in strict sequence.}
+@end group
+@end example
+
+@node Beginning a File, Ending a File, Texinfo Mode, Top
+@comment node-name, next, previous, up
+@chapter Beginning a Texinfo File
+@cindex Beginning a Texinfo file
+@cindex Texinfo file beginning
+@cindex File beginning
+
+Certain pieces of information must be provided at the beginning of a
+Texinfo file, such as the name of the file and the title of the
+document.@refill
+
+@menu
+* Four Parts:: Four parts begin a Texinfo file.
+* Sample Beginning:: Here is a sample beginning for a Texinfo file.
+* Header:: The very beginning of a Texinfo file.
+* Info Summary and Permissions:: Summary and copying permissions for Info.
+* Titlepage & Copyright Page:: Creating the title and copyright pages.
+* The Top Node:: Creating the `Top' node and master menu.
+* Software Copying Permissions:: Ensure that you and others continue to
+ have the right to use and share software.
+@end menu
+
+@node Four Parts, Sample Beginning, Beginning a File, Beginning a File
+@ifinfo
+@heading Four Parts Begin a File
+@end ifinfo
+
+Generally, the beginning of a Texinfo file has four parts:@refill
+
+@enumerate
+@item
+The header, delimited by special comment lines, that includes the
+commands for naming the Texinfo file and telling @TeX{} what
+definitions' file to use when processing the Texinfo file.@refill
+
+@item
+A short statement of what the file is about, with a copyright notice
+and copying permissions. This is enclosed in @code{@@ifinfo} and
+@code{@@end ifinfo} commands so that the formatters place it only
+in the Info file.@refill
+
+@item
+A title page and copyright page, with a copyright notice and copying
+permissions. This is enclosed between @code{@@titlepage} and
+@code{@@end titlepage} commands. The title and copyright page appear
+only in the printed @w{manual}.@refill
+
+@item
+The `Top' node that contains a menu for the whole Info file. The
+contents of this node appear only in the Info file.@refill
+@end enumerate
+
+Also, optionally, you may include the copying conditions for a program
+and a warranty disclaimer. The copying section will be followed by an
+introduction or else by the first chapter of the manual.@refill
+
+Since the copyright notice and copying permissions for the Texinfo
+document (in contrast to the copying permissions for a program) are in
+parts that appear only in the Info file or only in the printed manual,
+this information must be given twice.@refill
+
+@node Sample Beginning, Header, Four Parts, Beginning a File
+@comment node-name, next, previous, up
+@section Sample Texinfo File Beginning
+
+The following sample shows what is needed.@refill
+
+@example
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename @var{name-of-info-file}
+@@settitle @var{name-of-manual}
+@@setchapternewpage odd
+@@c %**end of header
+
+@@ifinfo
+This file documents @dots{}
+
+Copyright @var{year} @var{copyright-owner}
+
+@group
+Permission is granted to @dots{}
+@@end ifinfo
+@end group
+
+@group
+@@c This title page illustrates only one of the
+@@c two methods of forming a title page.
+@end group
+
+@group
+@@titlepage
+@@title @var{name-of-manual-when-printed}
+@@subtitle @var{subtitle-if-any}
+@@subtitle @var{second-subtitle}
+@@author @var{author}
+@end group
+
+@group
+@@c The following two commands
+@@c start the copyright page.
+@@page
+@@vskip 0pt plus 1filll
+Copyright @@copyright@{@} @var{year} @var{copyright-owner}
+@end group
+
+Published by @dots{}
+
+Permission is granted to @dots{}
+@@end titlepage
+
+@@node Top, Overview, (dir), (dir)
+
+@@ifinfo
+This document describes @dots{}
+
+This document applies to version @dots{}
+of the program named @dots{}
+@@end ifinfo
+
+@group
+@@menu
+* Copying:: Your rights and freedoms.
+* First Chapter:: Getting started @dots{}
+* Second Chapter:: @dots{}
+ @dots{}
+ @dots{}
+@@end menu
+@end group
+
+@group
+@@node First Chapter, Second Chapter, top, top
+@@comment node-name, next, previous, up
+@@chapter First Chapter
+@@cindex Index entry for First Chapter
+@end group
+@end example
+
+@node Header, Info Summary and Permissions, Sample Beginning, Beginning a File
+@comment node-name, next, previous, up
+@section The Texinfo File Header
+@cindex Header for Texinfo files
+@cindex Texinfo file header
+
+Texinfo files start with at least three lines that provide Info and
+@TeX{} with necessary information. These are the @code{\input
+texinfo} line, the @code{@@settitle} line, and the
+@code{@@setfilename} line. If you want to run @TeX{} on just a part
+of the Texinfo File, you must write the @code{@@settitle}
+and @code{@@setfilename} lines between start-of-header and end-of-header
+lines.@refill
+
+Thus, the beginning of a Texinfo file looks like this:
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@@setfilename sample.info
+@@settitle Sample Document
+@end group
+@end example
+
+@noindent
+or else like this:
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename sample.info
+@@settitle Sample Document
+@@c %**end of header
+@end group
+@end example
+
+@menu
+* First Line:: The first line of a Texinfo file.
+* Start of Header:: Formatting a region requires this.
+* setfilename:: Tell Info the name of the Info file.
+* settitle:: Create a title for the printed work.
+* setchapternewpage:: Start chapters on right-hand pages.
+* paragraphindent:: An option to specify paragraph indentation.
+* End of Header:: Formatting a region requires this.
+@end menu
+
+@node First Line, Start of Header, Header, Header
+@comment node-name, next, previous, up
+@subsection The First Line of a Texinfo File
+@cindex First line of a Texinfo file
+@cindex Beginning line of a Texinfo file
+@cindex Header of a Texinfo file
+
+Every Texinfo file that is to be the top-level input to @TeX{} must begin
+with a line that looks like this:@refill
+
+@example
+\input texinfo @@c -*-texinfo-*-
+@end example
+
+@noindent
+This line serves two functions:
+
+@enumerate
+@item
+When the file is processed by @TeX{}, the @code{\input texinfo} command
+tells @TeX{} to load the macros needed for processing a Texinfo file.
+These are in a file called @file{texinfo.tex}, which is usually located
+in the @file{/usr/lib/tex/macros} directory. @TeX{} uses the backslash,
+@samp{\}, to mark the beginning of a command, just as Texinfo uses
+@code{@@}. The @file{texinfo.tex} file causes the switch from @samp{\}
+to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which
+is why it appears at the beginning of the file.@refill
+
+@item
+When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode
+specification tells Emacs to use Texinfo mode.@refill
+@end enumerate
+
+@node Start of Header, setfilename, First Line, Header
+@comment node-name, next, previous, up
+@subsection Start of Header
+@cindex Start of header line
+
+Write a start-of-header line on the second line of a Texinfo file.
+Follow the start-of-header line with @code{@@setfilename} and
+@code{@@settitle} lines and, optionally, with other command lines, such
+as @code{@@smallbook} or @code{@@footnotestyle}; and then by an
+end-of-header line (@pxref{End of Header}).@refill
+
+With these lines, you can format part of a Texinfo file for Info or
+typeset part for printing.@refill
+
+A start-of-header line looks like this:@refill
+
+@example
+@@c %**start of header
+@end example
+
+The odd string of characters, @samp{%**}, is to ensure that no other
+comment is accidentally taken for a start-of-header line.@refill
+
+@node setfilename, settitle, Start of Header, Header
+@comment node-name, next, previous, up
+@subsection @code{@@setfilename}
+@cindex Info file requires @code{@@setfilename}
+@findex setfilename
+
+In order to serve as the primary input file for either @code{makeinfo}
+or @TeX{}, a Texinfo file must contain a line that looks like this:
+
+@example
+@@setfilename @var{info-file-name}
+@end example
+
+Write the @code{@@setfilename} command at the beginning of a line and
+follow it on the same line by the Info file name. Do not write
+anything else on the line; anything on the line after the command is
+considered part of the file name, including a comment.@refill
+
+The @code{@@setfilename} line specifies the name of the Info file to be
+generated. This name should be different from the name of the Texinfo
+file. There are two conventions for choosing the name: you can either
+remove the @samp{.tex} extension from the input file name, or replace it
+with the @samp{.info} extension.
+
+Some operating systems cannot handle long file names. You can run into
+a problem even when the file name you specify is itself short enough.
+This occurs because the Info formatters split a long Info file into
+short indirect subfiles, and name them by appending `-1', `-2', @dots{},
+`-10', `-11', and so on, to the original file name. (@xref{Tag and
+Split Files, , Tag Files and Split Files}.) The subfile name
+@file{texinfo.info-10}, for example, is too long for some systems; so
+the Info file name for this document is @file{texinfo} rather than
+@file{texinfo.info}.@refill
+
+The Info formatting commands ignore everything written before the
+@code{@@setfilename} line, which is why the very first line of
+the file (the @code{\input} line) does not need to be commented out.
+
+The @code{@@setfilename} line produces no output when you typeset a
+printed manual, but is does an essential job: it opens the index,
+cross-reference, and other auxiliary files used by Texinfo.
+
+@node settitle, setchapternewpage, setfilename, Header
+@comment node-name, next, previous, up
+@subsection @code{@@settitle}
+@findex settitle
+
+In order to be made into a printed manual, a Texinfo file must contain
+a line that looks like this:@refill
+
+@example
+@@settitle @var{title}
+@end example
+
+Write the @code{@@settitle} command at the beginning of a line and
+follow it on the same line by the title. This tells @TeX{} the title
+to use in a header or footer. Do not write anything else on the line;
+anything on the line after the command is considered part of the
+title, including a comment.@refill
+
+Conventionally, when @TeX{} formats a Texinfo file for double-sided
+output, the title is printed in the left-hand (even-numbered) page
+headings and the current chapter title is printed in the right-hand
+(odd-numbered) page headings. (@TeX{} learns the title of each chapter
+from each @code{@@chapter} command.) Page footers are not
+printed.@refill
+
+Even if you are printing in a single-sided style, @TeX{} looks for an
+@code{@@settitle} command line, in case you include the manual title
+in the heading. @refill
+
+The @code{@@settitle} command should precede everything that generates
+actual output in @TeX{}.@refill
+
+Although the title in the @code{@@settitle} command is usually the
+same as the title on the title page, it does not affect the title as
+it appears on the title page. Thus, the two do not need not match
+exactly; and the title in the @code{@@settitle} command can be a
+shortened or expanded version of the title as it appears on the title
+page. (@xref{titlepage, , @code{@@titlepage}}.)@refill
+
+@TeX{} prints page headings only for that text that comes after the
+@code{@@end titlepage} command in the Texinfo file, or that comes
+after an @code{@@headings} command that turns on headings.
+(@xref{headings on off, , The @code{@@headings} Command}, for more
+information.)@refill
+
+You may, if you wish, create your own, customized headings and
+footings. @xref{Headings, , Page Headings}, for a detailed discussion
+of this process.@refill
+
+@node setchapternewpage, paragraphindent, settitle, Header
+@comment node-name, next, previous, up
+@subsection @code{@@setchapternewpage}
+@cindex Starting chapters
+@cindex Pages, starting odd
+@findex setchapternewpage
+
+In a book or a manual, text is usually printed on both sides of the
+paper, chapters start on right-hand pages, and right-hand pages have
+odd numbers. But in short reports, text often is printed only on one
+side of the paper. Also in short reports, chapters sometimes do not
+start on new pages, but are printed on the same page as the end of the
+preceding chapter, after a small amount of vertical whitespace.@refill
+
+You can use the @code{@@setchapternewpage} command with various
+arguments to specify how @TeX{} should start chapters and whether it
+should typeset pages for printing on one or both sides of the paper
+(single-sided or double-sided printing).@refill
+
+Write the @code{@@setchapternewpage} command at the beginning of a
+line followed by its argument.@refill
+
+For example, you would write the following to cause each chapter to
+start on a fresh odd-numbered page:@refill
+
+@example
+@@setchapternewpage odd
+@end example
+
+You can specify one of three alternatives with the
+@code{@@setchapternewpage} command:@refill
+
+@table @asis
+@ignore
+@item No @code{@@setchapternewpage} command
+If the Texinfo file does not contain an @code{@@setchapternewpage}
+command before the @code{@@titlepage} command, @TeX{} automatically
+begins chapters on new pages and prints headings in the standard
+format for single-sided printing. This is the conventional format for
+single-sided printing.@refill
+
+The result is exactly the same as when you write
+@code{@@setchapternewpage on}.@refill
+@end ignore
+@item @code{@@setchapternewpage off}
+Cause @TeX{} to typeset a new chapter on the same page as the last
+chapter, after skipping some vertical whitespace. Also, cause @TeX{} to
+format page headers for single-sided printing. (You can override the
+headers format with the @code{@@headings double} command; see
+@ref{headings on off, , The @code{@@headings} Command}.)@refill
+
+@item @code{@@setchapternewpage on}
+Cause @TeX{} to start new chapters on new pages and to typeset page
+headers for single-sided printing. This is the form most often
+used for short reports.@refill
+
+This alternative is the default.@refill
+
+@item @code{@@setchapternewpage odd}
+Cause @TeX{} to start new chapters on new, odd-numbered pages
+(right-handed pages) and to typeset for double-sided printing. This is
+the form most often used for books and manuals.@refill
+@end table
+
+@noindent
+Texinfo does not have an @code{@@setchapternewpage even} command.@refill
+
+@noindent
+(You can countermand or modify an @code{@@setchapternewpage} command
+with an @code{@@headings} command. @xref{headings on off, , The
+@code{@@headings} Command}.)@refill
+
+At the beginning of a manual or book, pages are not numbered---for
+example, the title and copyright pages of a book are not numbered.
+By convention, table of contents pages are numbered with roman
+numerals and not in sequence with the rest of the document.@refill
+
+Since an Info file does not have pages, the @code{@@setchapternewpage}
+command has no effect on it.@refill
+
+Usually, you do not write an @code{@@setchapternewpage} command for
+single-sided printing, but accept the default which is to typeset for
+single-sided printing and to start new chapters on new pages. Usually,
+you write an @code{@@setchapternewpage odd} command for double-sided
+printing.@refill
+
+@node paragraphindent, End of Header, setchapternewpage, Header
+@comment node-name, next, previous, up
+@subsection Paragraph Indenting
+@cindex Indenting paragraphs
+@cindex Paragraph indentation
+@findex paragraphindent
+
+The Info formatting commands may insert spaces at the beginning of the
+first line of each paragraph, thereby indenting that paragraph. You
+can use the @code{@@paragraphindent} command to specify the
+indentation. Write an @code{@@paragraphindent} command at the
+beginning of a line followed by either @samp{asis} or a number. The
+template is:@refill
+
+@example
+@@paragraphindent @var{indent}
+@end example
+
+The Info formatting commands indent according to the value of
+@var{indent}:@refill
+
+@itemize @bullet
+@item
+If the value of @var{indent} is @samp{asis}, the Info formatting
+commands do not change the existing indentation.@refill
+
+@item
+If the value of @var{indent} is 0, the Info formatting commands delete
+existing indentation.@refill
+
+@item
+If the value of @var{indent} is greater than 0, the Info formatting
+commands indent the paragraph by that number of spaces.@refill
+@end itemize
+
+The default value of @var{indent} is @samp{asis}.@refill
+
+Write the @code{@@paragraphindent} command before or shortly after the
+end-of-header line at the beginning of a Texinfo file. (If you write
+the command between the start-of-header and end-of-header lines, the
+region formatting commands indent paragraphs as specified.)@refill
+
+A peculiarity of the @code{texinfo-format-buffer} and
+@code{texinfo-format-region} commands is that they do not indent (nor
+fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
+@xref{Refilling Paragraphs}, for a detailed description of what goes
+on.@refill
+
+@node End of Header, , paragraphindent, Header
+@comment node-name, next, previous, up
+@subsection End of Header
+@cindex End of header line
+
+Follow the header lines with an @w{end-of-header} line.
+An end-of-header line looks like this:@refill
+
+@example
+@@c %**end of header
+@end example
+
+If you include the @code{@@setchapternewpage} command between the
+start-of-header and end-of-header lines, @TeX{} will typeset a region as
+that command specifies. Similarly, if you include an @code{@@smallbook}
+command between the start-of-header and end-of-header lines, @TeX{} will
+typeset a region in the ``small'' book format.@refill
+
+@ifinfo
+The reason for the odd string of characters (@samp{%**}) is so that the
+@code{texinfo-tex-region} command does not accidentally find
+something that it should not when it is looking for the header.@refill
+
+The start-of-header line and the end-of-header line are Texinfo mode
+variables that you can change.@refill
+@end ifinfo
+
+@iftex
+@xref{Start of Header}.
+@end iftex
+
+@node Info Summary and Permissions, Titlepage & Copyright Page, Header, Beginning a File
+@comment node-name, next, previous, up
+@section Summary and Copying Permissions for Info
+
+The title page and the copyright page appear only in the printed copy of
+the manual; therefore, the same information must be inserted in a
+section that appears only in the Info file. This section usually
+contains a brief description of the contents of the Info file, a
+copyright notice, and copying permissions.@refill
+
+The copyright notice should read:@refill
+
+@example
+Copyright @var{year} @var{copyright-owner}
+@end example
+
+@noindent
+and be put on a line by itself.@refill
+
+Standard text for the copyright permissions is contained in an appendix
+to this manual; see @ref{ifinfo Permissions, , @samp{ifinfo} Copying
+Permissions}, for the complete text.@refill
+
+The permissions text appears in an Info file @emph{before} the first
+node. This mean that a reader does @emph{not} see this text when
+reading the file using Info, except when using the advanced Info command
+@kbd{g *}.
+
+@node Titlepage & Copyright Page, The Top Node, Info Summary and Permissions, Beginning a File
+@comment node-name, next, previous, up
+@section The Title and Copyright Pages
+
+A manual's name and author are usually printed on a title page.
+Sometimes copyright information is printed on the title page as well;
+more often, copyright information is printed on the back of the title
+page.
+
+The title and copyright pages appear in the printed manual, but not in the
+Info file. Because of this, it is possible to use several slightly
+obscure @TeX{} typesetting commands that cannot be used in an Info file.
+In addition, this part of the beginning of a Texinfo file contains the text
+of the copying permissions that will appear in the printed manual.@refill
+
+@xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the
+standard text for the copyright permissions.@refill
+
+@menu
+* titlepage:: Create a title for the printed document.
+* titlefont center sp:: The @code{@@titlefont}, @code{@@center},
+ and @code{@@sp} commands.
+* title subtitle author:: The @code{@@title}, @code{@@subtitle},
+ and @code{@@author} commands.
+* Copyright & Permissions:: How to write the copyright notice and
+ include copying permissions.
+* end titlepage:: Turn on page headings after the title and
+ copyright pages.
+* headings on off:: An option for turning headings on and off
+ and double or single sided printing.
+@end menu
+
+@node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection @code{@@titlepage}
+@cindex Title page
+@findex titlepage
+
+Start the material for the title page and following copyright page
+with @code{@@titlepage} on a line by itself and end it with
+@code{@@end titlepage} on a line by itself.@refill
+
+The @code{@@end titlepage} command starts a new page and turns on page
+numbering. (@xref{Headings, , Page Headings}, for details about how to
+generate page headings.) All the material that you want to
+appear on unnumbered pages should be put between the
+@code{@@titlepage} and @code{@@end titlepage} commands. By using the
+@code{@@page} command you can force a page break within the region
+delineated by the @code{@@titlepage} and @code{@@end titlepage}
+commands and thereby create more than one unnumbered page. This is
+how the copyright page is produced. (The @code{@@titlepage} command
+might perhaps have been better named the
+@code{@@titleandadditionalpages} command, but that would have been
+rather long!)@refill
+
+@c !!! append refill to footnote when makeinfo can handle it.
+When you write a manual about a computer program, you should write the
+version of the program to which the manual applies on the title
+page. If the manual changes more frequently than the program or is
+independent of it, you should also include an edition
+number@footnote{We have found that it is helpful to refer to versions
+of manuals as `editions' and versions of programs as `versions';
+otherwise, we find we are liable to confuse each other in conversation
+by referring to both the documentation and the software with the same
+words.} for the manual. This helps readers keep track of which manual
+is for which version of the program. (The `Top' node
+should also contain this information; see @ref{makeinfo top, ,
+@code{@@top}}.)@refill
+
+Texinfo provides two main methods for creating a title page. One method
+uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
+to generate a title page in which the words on the page are
+centered.@refill
+
+The second method uses the @code{@@title}, @code{@@subtitle}, and
+@code{@@author} commands to create a title page with black rules under
+the title and author lines and the subtitle text set flush to the
+right hand side of the page. With this method, you do not specify any
+of the actual formatting of the title page. You specify the text
+you want, and Texinfo does the formatting. You may use either
+method.@refill
+
+@findex shorttitlepage
+For extremely simple applications, Texinfo also provides a command
+@code{@@shorttitlepage} which takes a single argument as the title.
+The argument is typeset on a page by itself and followed by a blank
+page.
+
+
+@node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
+@findex titlefont
+@findex center
+@findex sp @r{(titlepage line spacing)}
+
+You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
+commands to create a title page for a printed document. (This is the
+first of the two methods for creating a title page in Texinfo.)@refill
+
+Use the @code{@@titlefont} command to select a large font suitable for
+the title itself.@refill
+
+@need 700
+For example:
+
+@example
+@@titlefont@{Texinfo@}
+@end example
+
+Use the @code{@@center} command at the beginning of a line to center
+the remaining text on that line. Thus,@refill
+
+@example
+@@center @@titlefont@{Texinfo@}
+@end example
+
+@noindent
+centers the title, which in this example is ``Texinfo'' printed
+in the title font.@refill
+
+Use the @code{@@sp} command to insert vertical space. For example:@refill
+
+@example
+@@sp 2
+@end example
+
+@noindent
+This inserts two blank lines on the printed page. (@xref{sp, ,
+@code{@@sp}}, for more information about the @code{@@sp}
+command.)@refill
+
+A template for this method looks like this:@refill
+
+@example
+@group
+@@titlepage
+@@sp 10
+@@center @@titlefont@{@var{name-of-manual-when-printed}@}
+@@sp 2
+@@center @var{subtitle-if-any}
+@@sp 2
+@@center @var{author}
+@dots{}
+@@end titlepage
+@end group
+@end example
+
+The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
+
+@node title subtitle author, Copyright & Permissions, titlefont center sp, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
+@findex title
+@findex subtitle
+@findex author
+
+You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
+commands to create a title page in which the vertical and horizontal
+spacing is done for you automatically. This contrasts with the method
+described in
+the previous section, in which the @code{@@sp} command is needed to
+adjust vertical spacing.@refill
+
+Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
+commands at the beginning of a line followed by the title, subtitle,
+or author.@refill
+
+The @code{@@title} command produces a line in which the title is set
+flush to the left-hand side of the page in a larger than normal font.
+The title is underlined with a black rule.@refill
+
+The @code{@@subtitle} command sets subtitles in a normal-sized font
+flush to the right-hand side of the page.@refill
+
+The @code{@@author} command sets the names of the author or authors in
+a middle-sized font flush to the left-hand side of the page on a line
+near the bottom of the title page. The names are underlined with a
+black rule that is thinner than the rule that underlines the title.
+(The black rule only occurs if the @code{@@author} command line is
+followed by an @code{@@page} command line.)@refill
+
+There are two ways to use the @code{@@author} command: you can write
+the name or names on the remaining part of the line that starts with
+an @code{@@author} command:@refill
+
+@example
+@@author by Jane Smith and John Doe
+@end example
+
+@noindent
+or you can write the names one above each other by using two (or more)
+@code{@@author} commands:@refill
+
+@example
+@group
+@@author Jane Smith
+@@author John Doe
+@end group
+@end example
+
+@noindent
+(Only the bottom name is underlined with a black rule.)@refill
+
+@need 950
+A template for this method looks like this:@refill
+
+@example
+@group
+@@titlepage
+@@title @var{name-of-manual-when-printed}
+@@subtitle @var{subtitle-if-any}
+@@subtitle @var{second-subtitle}
+@@author @var{author}
+@@page
+@dots{}
+@@end titlepage
+@end group
+@end example
+
+@ifinfo
+@noindent
+Contrast this form with the form of a title page written using the
+@code{@@sp}, @code{@@center}, and @code{@@titlefont} commands:@refill
+
+@example
+@@titlepage
+@@sp 10
+@@center @@titlefont@{Name of Manual When Printed@}
+@@sp 2
+@@center Subtitle, If Any
+@@sp 1
+@@center Second subtitle
+@@sp 2
+@@center Author
+@@page
+@dots{}
+@@end titlepage
+@end example
+@end ifinfo
+
+@node Copyright & Permissions, end titlepage, title subtitle author, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection Copyright Page and Permissions
+@cindex Copyright page
+@cindex Printed permissions
+@cindex Permissions, printed
+
+By international treaty, the copyright notice for a book should be
+either on the title page or on the back of the title page. The
+copyright notice should include the year followed by the name of the
+organization or person who owns the copyright.@refill
+
+When the copyright notice is on the back of the title page, that page
+is customarily not numbered. Therefore, in Texinfo, the information
+on the copyright page should be within @code{@@titlepage} and
+@code{@@end titlepage} commands.@refill
+
+@findex vskip
+@findex filll
+@cindex Vertical whitespace (@samp{vskip})
+Use the @code{@@page} command to cause a page break. To push the
+copyright notice and the other text on the copyright page towards the
+bottom of the page, you can write a somewhat mysterious line after the
+@code{@@page} command that reads like this:@refill
+
+@example
+@@vskip 0pt plus 1filll
+@end example
+
+@noindent
+This is a @TeX{} command that is not supported by the Info formatting
+commands. The @code{@@vskip} command inserts whitespace. The
+@samp{0pt plus 1filll} means to put in zero points of mandatory whitespace,
+and as much optional whitespace as needed to push the
+following text to the bottom of the page. Note the use of three
+@samp{l}s in the word @samp{filll}; this is the correct usage in
+@TeX{}.@refill
+
+@findex copyright
+In a printed manual, the @code{@@copyright@{@}} command generates a
+@samp{c} inside a circle. (In Info, it generates @samp{(C)}.) The
+copyright notice itself has the following legally defined sequence:@refill
+
+@example
+Copyright @copyright{} @var{year} @var{copyright-owner}
+@end example
+
+It is customary to put information on how to get a manual after the
+copyright notice, followed by the copying permissions for the
+manual.@refill
+
+Note that permissions must be given here as well as in the summary
+segment within @code{@@ifinfo} and @code{@@end ifinfo} that
+immediately follows the header since this text appears only in the
+printed manual and the @samp{ifinfo} text appears only in the Info
+file.@refill
+
+@xref{Sample Permissions}, for the standard text.@refill
+
+@node end titlepage, headings on off, Copyright & Permissions, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection Heading Generation
+@findex end titlepage
+@cindex Headings, page, begin to appear
+@cindex Titlepage end starts headings
+@cindex End titlepage starts headings
+
+An @code{@@end titlepage} command on a line by itself not only marks
+the end of the title and copyright pages, but also causes @TeX{} to start
+generating page headings and page numbers.
+
+To repeat what is said elsewhere, Texinfo has two standard page heading
+formats, one for documents which are printed on one side of each sheet of paper
+(single-sided printing), and the other for documents which are printed on both
+sides of each sheet (double-sided printing).
+(@xref{setchapternewpage, ,@code{@@setchapternewpage}}.)
+You can specify these formats in different ways:@refill
+
+@itemize @bullet
+@item
+The conventional way is to write an @code{@@setchapternewpage} command
+before the title page commands, and then have the @code{@@end
+titlepage} command start generating page headings in the manner desired.
+(@xref{setchapternewpage, , @code{@@setchapternewpage}}.)@refill
+
+@item
+Alternatively, you can use the @code{@@headings} command to prevent page
+headings from being generated or to start them for either single or
+double-sided printing. (Write an @code{@@headings} command immediately
+after the @code{@@end titlepage} command. @xref{headings on off, , The
+@code{@@headings} Command}, for more information.)@refill
+
+@item
+Or, you may specify your own page heading and footing format.
+@xref{Headings, , Page Headings}, for detailed
+information about page headings and footings.@refill
+@end itemize
+
+Most documents are formatted with the standard single-sided or
+double-sided format, using @code{@@setchapternewpage odd} for
+double-sided printing and no @code{@@setchapternewpage} command for
+single-sided printing.@refill
+
+@node headings on off, , end titlepage, Titlepage & Copyright Page
+@comment node-name, next, previous, up
+@subsection The @code{@@headings} Command
+@findex headings
+
+The @code{@@headings} command is rarely used. It specifies what kind of
+page headings and footings to print on each page. Usually, this is
+controlled by the @code{@@setchapternewpage} command. You need the
+@code{@@headings} command only if the @code{@@setchapternewpage} command
+does not do what you want, or if you want to turn off pre-defined page
+headings prior to defining your own. Write an @code{@@headings} command
+immediately after the @code{@@end titlepage} command.@refill
+
+You can use @code{@@headings} as follows:@refill
+
+@table @code
+@item @@headings off
+Turn off printing of page headings.@refill
+
+@item @@headings single
+Turn on page headings appropriate for single-sided printing.
+@refill
+
+@item @@headings double
+Turn on page headings appropriate for double-sided printing. The two
+commands, @code{@@headings on} and @code{@@headings double}, are
+synonymous.@refill
+
+@item @@headings singleafter
+@itemx @@headings doubleafter
+Turn on @code{single} or @code{double} headings, respectively, after the
+current page is output.
+
+@item @@headings on
+Turn on page headings: @code{single} if @samp{@@setchapternewpage
+on}, @code{double} otherwise.
+@end table
+
+For example, suppose you write @code{@@setchapternewpage off} before the
+@code{@@titlepage} command to tell @TeX{} to start a new chapter on the
+same page as the end of the last chapter. This command also causes
+@TeX{} to typeset page headers for single-sided printing. To cause
+@TeX{} to typeset for double sided printing, write @code{@@headings
+double} after the @code{@@end titlepage} command.
+
+You can stop @TeX{} from generating any page headings at all by
+writing @code{@@headings off} on a line of its own immediately after the
+line containing the @code{@@end titlepage} command, like this:@refill
+
+@example
+@@end titlepage
+@@headings off
+@end example
+
+@noindent
+The @code{@@headings off} command overrides the @code{@@end titlepage}
+command, which would otherwise cause @TeX{} to print page
+headings.@refill
+
+You can also specify your own style of page heading and footing.
+@xref{Headings, , Page Headings}, for more information.@refill
+
+@node The Top Node, Software Copying Permissions, Titlepage & Copyright Page, Beginning a File
+@comment node-name, next, previous, up
+@section The `Top' Node and Master Menu
+@cindex @samp{@r{Top}} node
+@cindex Master menu
+@cindex Node, `Top'
+
+The `Top' node is the node from which you enter an Info file.@refill
+
+A `Top' node should contain a brief description of the Info file and an
+extensive, master menu for the whole Info file.
+This helps the reader understand what the Info file is
+about. Also, you should write the version number of the program to
+which the Info file applies; or, at least, the edition number.@refill
+
+The contents of the `Top' node should appear only in the Info file; none
+of it should appear in printed output, so enclose it between
+@code{@@ifinfo} and @code{@@end ifinfo} commands. (@TeX{} does not
+print either an @code{@@node} line or a menu; they appear only in Info;
+strictly speaking, you are not required to enclose these parts between
+@code{@@ifinfo} and @code{@@end ifinfo}, but it is simplest to do so.
+@xref{Conditionals, , Conditionally Visible Text}.)@refill
+
+@menu
+* Title of Top Node:: Sketch what the file is about.
+* Master Menu Parts:: A master menu has three or more parts.
+@end menu
+
+@node Title of Top Node, Master Menu Parts, The Top Node, The Top Node
+@ifinfo
+@subheading `Top' Node Title
+@end ifinfo
+
+Sometimes, you will want to place an @code{@@top} sectioning command
+line containing the title of the document immediately after the
+@code{@@node Top} line (@pxref{makeinfo top command, , The @code{@@top}
+Sectioning Command}, for more information).@refill
+
+For example, the beginning of the Top node of this manual contains an
+@code{@@top} sectioning command, a short description, and edition and
+version information. It looks like this:@refill
+
+@example
+@group
+@dots{}
+@@end titlepage
+
+@@ifinfo
+@@node Top, Copying, (dir), (dir)
+@@top Texinfo
+
+Texinfo is a documentation system@dots{}
+@end group
+
+@group
+This is edition@dots{}
+@dots{}
+@@end ifinfo
+@end group
+
+@group
+@@menu
+* Copying:: Texinfo is freely
+ redistributable.
+* Overview:: What is Texinfo?
+@dots{}
+@end group
+@@end menu
+@end example
+
+In a `Top' node, the `Previous', and `Up' nodes usually refer to the top
+level directory of the whole Info system, which is called @samp{(dir)}.
+The `Next' node refers to the first node that follows the main or master
+menu, which is usually the copying permissions, introduction, or first
+chapter.@refill
+
+@node Master Menu Parts, , Title of Top Node, The Top Node
+@subsection Parts of a Master Menu
+@cindex Master menu parts
+@cindex Parts of a master menu
+
+A @dfn{master menu} is a detailed main menu listing all the nodes in a
+file.
+
+A master menu is enclosed in @code{@@menu} and @code{@@end menu}
+commands and does not appear in the printed document.@refill
+
+Generally, a master menu is divided into parts.@refill
+
+@itemize @bullet
+@item
+The first part contains the major nodes in the Texinfo file: the nodes
+for the chapters, chapter-like sections, and the appendices.@refill
+
+@item
+The second part contains nodes for the indices.@refill
+
+@item
+The third and subsequent parts contain a listing of the other, lower
+level nodes, often ordered by chapter. This way, rather than go
+through an intermediary menu, an inquirer can go directly to a
+particular node when searching for specific information. These menu
+items are not required; add them if you think they are a
+convenience. If you do use them, put @code{@@detailmenu} before the
+first one, and @code{@@end detailmenu} after the last; otherwise,
+@code{makeinfo} will get confused.
+@end itemize
+
+Each section in the menu can be introduced by a descriptive line. So
+long as the line does not begin with an asterisk, it will not be
+treated as a menu entry. (@xref{Writing a Menu}, for more
+information.)@refill
+
+For example, the master menu for this manual looks like the following
+(but has many more entries):@refill
+
+@example
+@group
+@@menu
+* Copying:: Texinfo is freely
+ redistributable.
+* Overview:: What is Texinfo?
+* Texinfo Mode:: Special features in GNU Emacs.
+@dots{}
+@dots{}
+@end group
+@group
+* Command and Variable Index::
+ An entry for each @@-command.
+* Concept Index:: An entry for each concept.
+@end group
+
+@group
+@@detailmenu
+ --- The Detailed Node Listing ---
+
+Overview of Texinfo
+
+* Info Files:: What is an Info file?
+* Printed Manuals:: Characteristics of
+ a printed manual.
+@dots{}
+@dots{}
+@end group
+
+@group
+Using Texinfo Mode
+
+* Info on a Region:: Formatting part of a file
+ for Info.
+@dots{}
+@dots{}
+@@end detailmenu
+@@end menu
+@end group
+@end example
+
+@node Software Copying Permissions, , The Top Node, Beginning a File
+@comment node-name, next, previous, up
+@section Software Copying Permissions
+@cindex Software copying permissions
+@cindex Copying software
+@cindex Distribution
+@cindex License agreement
+
+If the Texinfo file has a section containing the ``General Public
+License'' and the distribution information and a warranty disclaimer
+for the software that is documented, this section usually follows the
+`Top' node. The General Public License is very important to Project
+GNU software. It ensures that you and others will continue to have a
+right to use and share the software.@refill
+
+The copying and distribution information and the disclaimer are
+followed by an introduction or else by the first chapter of the
+manual.@refill
+
+@cindex Introduction, as part of file
+Although an introduction is not a required part of a Texinfo file, it
+is very helpful. Ideally, it should state clearly and concisely what
+the file is about and who would be interested in reading it. In
+general, an introduction would follow the licensing and distribution
+information, although sometimes people put it earlier in the document.
+Usually, an introduction is put in an @code{@@unnumbered} section.
+(@xref{unnumbered & appendix, , The @code{@@unnumbered} and
+@code{@@appendix} Commands}.)@refill
+
+@node Ending a File, Structuring, Beginning a File, Top
+@comment node-name, next, previous, up
+@chapter Ending a Texinfo File
+@cindex Ending a Texinfo file
+@cindex Texinfo file ending
+@cindex File ending
+@findex bye
+
+The end of a Texinfo file should include the commands that create
+indices and generate detailed and summary tables of contents.
+And it must include the @code{@@bye} command that marks the last line
+processed by @TeX{}.@refill
+
+@need 700
+For example:
+
+@example
+@@node Concept Index, , Variables Index, Top
+@@c node-name, next, previous, up
+@@unnumbered Concept Index
+
+@@printindex cp
+
+@@contents
+@@bye
+@end example
+
+@menu
+* Printing Indices & Menus:: How to print an index in hardcopy and
+ generate index menus in Info.
+* Contents:: How to create a table of contents.
+* File End:: How to mark the end of a file.
+@end menu
+
+@node Printing Indices & Menus, Contents, Ending a File, Ending a File
+@comment node-name, next, previous, up
+@section Index Menus and Printing an Index
+@findex printindex
+@cindex Printing an index
+@cindex Indices, printing and menus
+@cindex Generating menus with indices
+@cindex Menus generated with indices
+
+To print an index means to include it as part of a manual or Info
+file. This does not happen automatically just because you use
+@code{@@cindex} or other index-entry generating commands in the
+Texinfo file; those just cause the raw data for the index to be
+accumulated. To generate an index, you must include the
+@code{@@printindex} command at the place in the document where you
+want the index to appear. Also, as part of the process of creating a
+printed manual, you must run a program called @code{texindex}
+(@pxref{Format/Print Hardcopy}) to sort the raw data to produce a sorted
+index file. The sorted index file is what is actually used to
+print the index.@refill
+
+Texinfo offers six different types of predefined index: the concept
+index, the function index, the variables index, the keystroke index, the
+program index, and the data type index (@pxref{Predefined Indices}). Each
+index type has a two-letter name: @samp{cp}, @samp{fn}, @samp{vr},
+@samp{ky}, @samp{pg}, and @samp{tp}. You may merge indices, or put them
+into separate sections (@pxref{Combining Indices}); or you may define
+your own indices (@pxref{New Indices, , Defining New Indices}).@refill
+
+The @code{@@printindex} command takes a two-letter index name, reads
+the corresponding sorted index file and formats it appropriately into
+an index.@refill
+
+@ignore
+The two-letter index names are:
+
+@table @samp
+@item cp
+concept index
+@item fn
+function index
+@item vr
+variable index
+@item ky
+key index
+@item pg
+program index
+@item tp
+data type index
+@end table
+@end ignore
+The @code{@@printindex} command does not generate a chapter heading
+for the index. Consequently, you should precede the
+@code{@@printindex} command with a suitable section or chapter command
+(usually @code{@@unnumbered}) to supply the chapter heading and put
+the index into the table of contents. Precede the @code{@@unnumbered}
+command with an @code{@@node} line.@refill
+
+@need 1200
+For example:
+
+@smallexample
+@group
+@@node Variable Index, Concept Index, Function Index, Top
+@@comment node-name, next, previous, up
+@@unnumbered Variable Index
+
+@@printindex vr
+@end group
+
+@group
+@@node Concept Index, , Variable Index, Top
+@@comment node-name, next, previous, up
+@@unnumbered Concept Index
+
+@@printindex cp
+@end group
+
+@group
+@@summarycontents
+@@contents
+@@bye
+@end group
+@end smallexample
+
+@noindent
+(Readers often prefer that the concept index come last in a book,
+since that makes it easiest to find.)@refill
+
+@ignore
+In @TeX{}, the @code{@@printindex} command needs a sorted index file
+to work from. @TeX{} does not know how to do sorting; this is a
+deficiency. @TeX{} writes output files of raw index data; use the
+@code{texindex} program to convert these files to sorted index files.
+(@xref{Format/Print Hardcopy}, for more information.)@refill
+@end ignore
+@node Contents, File End, Printing Indices & Menus, Ending a File
+@comment node-name, next, previous, up
+@section Generating a Table of Contents
+@cindex Table of contents
+@cindex Contents, Table of
+@findex contents
+@findex summarycontents
+@findex shortcontents
+
+The @code{@@chapter}, @code{@@section}, and other structuring commands
+supply the information to make up a table of contents, but they do not
+cause an actual table to appear in the manual. To do this, you must
+use the @code{@@contents} and @code{@@summarycontents}
+commands:@refill
+
+@table @code
+@item @@contents
+Generate a table of contents in a printed manual, including all
+chapters, sections, subsections, etc., as well as appendices and
+unnumbered chapters. (Headings generated by the @code{@@heading}
+series of commands do not appear in the table of contents.) The
+@code{@@contents} command should be written on a line by
+itself.@refill
+
+@item @@shortcontents
+@itemx @@summarycontents
+(@code{@@summarycontents} is a synonym for @code{@@shortcontents}; the
+two commands are exactly the same.)@refill
+
+Generate a short or summary table of contents that lists only the
+chapters (and appendices and unnumbered chapters). Omit sections, subsections
+and subsubsections. Only a long manual needs a short table
+of contents in addition to the full table of contents.@refill
+
+Write the @code{@@shortcontents} command on a line by itself right
+@emph{before} the @code{@@contents} command.@refill
+@end table
+
+The table of contents commands automatically generate a chapter-like
+heading at the top of the first table of contents page. Write the table
+of contents commands at the very end of a Texinfo file, just before the
+@code{@@bye} command, following any index sections---anything in the
+Texinfo file after the table of contents commands will be omitted from
+the table of contents.@refill
+
+When you print a manual with a table of contents, the table of
+contents are printed last and numbered with roman numerals. You need
+to place those pages in their proper place, after the title page,
+yourself. (This is the only collating you need to do for a printed
+manual. The table of contents is printed last because it is generated
+after the rest of the manual is typeset.)@refill
+
+@need 700
+Here is an example of where to write table of contents commands:@refill
+
+@example
+@group
+@var{indices}@dots{}
+@@shortcontents
+@@contents
+@@bye
+@end group
+@end example
+
+Since an Info file uses menus instead of tables of contents, the Info
+formatting commands ignore the @code{@@contents} and
+@code{@@shortcontents} commands.@refill
+
+@node File End, , Contents, Ending a File
+@comment node-name, next, previous, up
+@section @code{@@bye} File Ending
+@findex bye
+
+An @code{@@bye} command terminates @TeX{} or Info formatting. None of
+the formatting commands see any of the file following @code{@@bye}.
+The @code{@@bye} command should be on a line by itself.@refill
+
+If you wish, you may follow the @code{@@bye} line with notes. These notes
+will not be formatted and will not appear in either Info or a printed
+manual; it is as if text after @code{@@bye} were within @code{@@ignore}
+@dots{} @code{@@end ignore}. Also, you may follow the @code{@@bye} line
+with a local variables list. @xref{Compile-Command, , Using Local
+Variables and the Compile Command}, for more information.@refill
+
+@node Structuring, Nodes, Ending a File, Top
+@comment node-name, next, previous, up
+@chapter Chapter Structuring
+@cindex Chapter structuring
+@cindex Structuring of chapters
+
+The @dfn{chapter structuring} commands divide a document into a hierarchy of
+chapters, sections, subsections, and subsubsections. These commands
+generate large headings; they also provide information for the table
+of contents of a printed manual (@pxref{Contents, , Generating a Table
+of Contents}).@refill
+
+The chapter structuring commands do not create an Info node structure,
+so normally you should put an @code{@@node} command immediately before
+each chapter structuring command (@pxref{Nodes}). The only time you
+are likely to use the chapter structuring commands without using the
+node structuring commands is if you are writing a document that
+contains no cross references and will never be transformed into Info
+format.@refill
+
+It is unlikely that you will ever write a Texinfo file that is
+intended only as an Info file and not as a printable document. If you
+do, you might still use chapter structuring commands to create a
+heading at the top of each node---but you don't need to.@refill
+
+@menu
+* Tree Structuring:: A manual is like an upside down tree @dots{}
+* Structuring Command Types:: How to divide a manual into parts.
+* makeinfo top:: The @code{@@top} command, part of the `Top' node.
+* chapter::
+* unnumbered & appendix::
+* majorheading & chapheading::
+* section::
+* unnumberedsec appendixsec heading::
+* subsection::
+* unnumberedsubsec appendixsubsec subheading::
+* subsubsection:: Commands for the lowest level sections.
+* Raise/lower sections:: How to change commands' hierarchical level.
+@end menu
+
+@node Tree Structuring, Structuring Command Types, Structuring, Structuring
+@comment node-name, next, previous, up
+@section Tree Structure of Sections
+@cindex Tree structuring
+
+A Texinfo file is usually structured like a book with chapters,
+sections, subsections, and the like. This structure can be visualized
+as a tree (or rather as an upside-down tree) with the root at the top
+and the levels corresponding to chapters, sections, subsection, and
+subsubsections.@refill
+
+Here is a diagram that shows a Texinfo file with three chapters,
+each of which has two sections.@refill
+
+@example
+@group
+ Top
+ |
+ -------------------------------------
+ | | |
+ Chapter 1 Chapter 2 Chapter 3
+ | | |
+ -------- -------- --------
+ | | | | | |
+ Section Section Section Section Section Section
+ 1.1 1.2 2.1 2.2 3.1 3.2
+
+@end group
+@end example
+
+In a Texinfo file that has this structure, the beginning of Chapter 2
+looks like this:@refill
+
+@example
+@group
+@@node Chapter 2, Chapter 3, Chapter 1, top
+@@chapter Chapter 2
+@end group
+@end example
+
+The chapter structuring commands are described in the sections that
+follow; the @code{@@node} and @code{@@menu} commands are described in
+following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
+
+@node Structuring Command Types, makeinfo top, Tree Structuring, Structuring
+@comment node-name, next, previous, up
+@section Types of Structuring Command
+
+The chapter structuring commands fall into four groups or series, each
+of which contains structuring commands corresponding to the
+hierarchical levels of chapters, sections, subsections, and
+subsubsections.@refill
+
+The four groups are the @code{@@chapter} series, the
+@code{@@unnumbered} series, the @code{@@appendix} series, and the
+@code{@@heading} series.@refill
+
+Each command produces titles that have a different appearance on the
+printed page or Info file; only some of the commands produce
+titles that are listed in the table of contents of a printed book or
+manual.@refill
+
+@itemize @bullet
+@item
+The @code{@@chapter} and @code{@@appendix} series of commands produce
+numbered or lettered entries both in the body of a printed work and in
+its table of contents.@refill
+
+@item
+The @code{@@unnumbered} series of commands produce unnumbered entries
+both in the body of a printed work and in its table of contents. The
+@code{@@top} command, which has a special use, is a member of this
+series (@pxref{makeinfo top, , @code{@@top}}).@refill
+
+@item
+The @code{@@heading} series of commands produce unnumbered headings
+that do not appear in a table of contents. The heading commands never
+start a new page.@refill
+
+@item
+The @code{@@majorheading} command produces results similar to using
+the @code{@@chapheading} command but generates a larger vertical
+whitespace before the heading.@refill
+
+@item
+When an @code{@@setchapternewpage} command says to do so, the
+@code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
+start new pages in the printed manual; the @code{@@heading} commands
+do not.@refill
+@end itemize
+
+@need 1000
+Here are the four groups of chapter structuring commands:@refill
+
+@c Slightly different formatting for regular sized books and smallbooks.
+@ifset smallbook
+@sp 1
+@tex
+{\let\rm=\indrm \let\tt=\indtt
+\halign{\hskip\itemindent#\hfil& \hskip.5em#\hfil& \hskip.5em#\hfil&
+\hskip.5em#\hfil\cr
+
+& & & \rm No new pages\cr
+\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
+\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
+
+& & & \cr
+ & \tt @@top& & \tt @@majorheading\cr
+\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
+\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
+\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
+\tt @@subheading\cr
+\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
+\tt @@subsubheading\cr}}
+@end tex
+@end ifset
+@ifclear smallbook
+@sp 1
+@tex
+\vbox{
+\halign{\hskip\itemindent\hskip.5em#\hfil& \hskip.5em#\hfil&
+\hskip.5em#\hfil& \hskip.5em #\hfil\cr
+
+& & & \cr
+& & & \rm No new pages\cr
+\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
+\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
+
+& & & \cr
+ & \tt @@top& & \tt @@majorheading\cr
+\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
+\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
+\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
+\tt @@subheading\cr
+\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
+\tt @@subsubheading\cr}}
+@end tex
+@end ifclear
+@ifinfo
+@example
+@group
+ @r{No new pages}
+@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
+@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
+
+ @@top @@majorheading
+@@chapter @@unnumbered @@appendix @@chapheading
+@@section @@unnumberedsec @@appendixsec @@heading
+@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
+@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
+@end group
+@end example
+@end ifinfo
+
+@c Cannot line up columns properly inside of an example because of roman
+@c proportional fonts.
+@ignore
+@ifset smallbook
+@iftex
+@smallexample
+@group
+ @r{No new pages}
+@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
+@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
+
+ @@top @@majorheading
+@@chapter @@unnumbered @@appendix @@chapheading
+@@section @@unnumberedsec @@appendixsec @@heading
+@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
+@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
+@end group
+@end smallexample
+@end iftex
+@end ifset
+@ifclear smallbook
+@iftex
+@smallexample
+@group
+ @r{No new pages}
+@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
+@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
+
+ @@top @@majorheading
+@@chapter @@unnumbered @@appendix @@chapheading
+@@section @@unnumberedsec @@appendixsec @@heading
+@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
+@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
+@end group
+@end smallexample
+@end iftex
+@end ignore
+
+@node makeinfo top, chapter, Structuring Command Types, Structuring
+@comment node-name, next, previous, up
+@section @code{@@top}
+
+The @code{@@top} command is a special sectioning command that you use
+only after an @code{@@node Top} line at the beginning of a Texinfo file.
+The @code{@@top} command tells the @code{makeinfo} formatter
+which node is the `Top'
+node. It has the same typesetting effect as @code{@@unnumbered}
+(@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}).
+For detailed information, see
+@ref{makeinfo top command, , The @code{@@top} Command}.@refill
+
+@node chapter, unnumbered & appendix, makeinfo top, Structuring
+@comment node-name, next, previous, up
+@section @code{@@chapter}
+@findex chapter
+
+@code{@@chapter} identifies a chapter in the document. Write the
+command at the beginning of a line and follow it on the same line by
+the title of the chapter.@refill
+
+For example, this chapter in this manual is entitled ``Chapter
+Structuring''; the @code{@@chapter} line looks like this:@refill
+
+@example
+@@chapter Chapter Structuring
+@end example
+
+In @TeX{}, the @code{@@chapter} command creates a chapter in the
+document, specifying the chapter title. The chapter is numbered
+automatically.@refill
+
+In Info, the @code{@@chapter} command causes the title to appear on a
+line by itself, with a line of asterisks inserted underneath. Thus,
+in Info, the above example produces the following output:@refill
+
+@example
+Chapter Structuring
+*******************
+@end example
+
+@findex centerchap
+Texinfo also provides a command @code{@@centerchap}, which is analogous
+to @code{@@unnumbered}, but centers its argument in the printed output.
+This kind of stylistic choice is not usually offered by Texinfo.
+@c but the Hacker's Dictionary wanted it ...
+
+
+@node unnumbered & appendix, majorheading & chapheading, chapter, Structuring
+@comment node-name, next, previous, up
+@section @code{@@unnumbered}, @code{@@appendix}
+@findex unnumbered
+@findex appendix
+
+Use the @code{@@unnumbered} command to create a chapter that appears
+in a printed manual without chapter numbers of any kind. Use the
+@code{@@appendix} command to create an appendix in a printed manual
+that is labelled by letter instead of by number.@refill
+
+For Info file output, the @code{@@unnumbered} and @code{@@appendix}
+commands are equivalent to @code{@@chapter}: the title is printed on a
+line by itself with a line of asterisks underneath. (@xref{chapter, ,
+@code{@@chapter}}.)@refill
+
+To create an appendix or an unnumbered chapter, write an
+@code{@@appendix} or @code{@@unnumbered} command at the beginning of a
+line and follow it on the same line by the title, as you would if you
+were creating a chapter.@refill
+
+
+@node majorheading & chapheading, section, unnumbered & appendix, Structuring
+@section @code{@@majorheading}, @code{@@chapheading}
+@findex majorheading
+@findex chapheading
+
+The @code{@@majorheading} and @code{@@chapheading} commands put
+chapter-like headings in the body of a document.@refill
+
+However, neither command causes @TeX{} to produce a numbered heading
+or an entry in the table of contents; and neither command causes
+@TeX{} to start a new page in a printed manual.@refill
+
+In @TeX{}, an @code{@@majorheading} command generates a larger vertical
+whitespace before the heading than an @code{@@chapheading} command but
+is otherwise the same.@refill
+
+In Info,
+the @code{@@majorheading} and
+@code{@@chapheading} commands are equivalent to
+@code{@@chapter}: the title is printed on a line by itself with a line
+of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill
+
+@node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring
+@comment node-name, next, previous, up
+@section @code{@@section}
+@findex section
+
+In a printed manual, an @code{@@section} command identifies a
+numbered section within a chapter. The section title appears in the
+table of contents. In Info, an @code{@@section} command provides a
+title for a segment of text, underlined with @samp{=}.@refill
+
+This section is headed with an @code{@@section} command and looks like
+this in the Texinfo file:@refill
+
+@example
+@@section @@code@{@@@@section@}
+@end example
+
+To create a section, write the @code{@@section} command at the
+beginning of a line and follow it on the same line by the section
+title.@refill
+
+Thus,
+
+@example
+@@section This is a section
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This is a section
+=================
+@end group
+@end example
+
+@noindent
+in Info.
+
+@node unnumberedsec appendixsec heading, subsection, section, Structuring
+@comment node-name, next, previous, up
+@section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
+@findex unnumberedsec
+@findex appendixsec
+@findex heading
+
+The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
+commands are, respectively, the unnumbered, appendix-like, and
+heading-like equivalents of the @code{@@section} command.
+(@xref{section, , @code{@@section}}.)@refill
+
+@table @code
+@item @@unnumberedsec
+The @code{@@unnumberedsec} command may be used within an
+unnumbered chapter or within a regular chapter or appendix to
+provide an unnumbered section.@refill
+
+@item @@appendixsec
+@itemx @@appendixsection
+@code{@@appendixsection} is a longer spelling of the
+@code{@@appendixsec} command; the two are synonymous.@refill
+@findex appendixsection
+
+Conventionally, the @code{@@appendixsec} or @code{@@appendixsection}
+command is used only within appendices.@refill
+
+@item @@heading
+You may use the @code{@@heading} command anywhere you wish for a
+section-style heading that will not appear in the table of contents.@refill
+@end table
+
+@node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring
+@comment node-name, next, previous, up
+@section The @code{@@subsection} Command
+@findex subsection
+
+Subsections are to sections as sections are to chapters.
+(@xref{section, , @code{@@section}}.) In Info, subsection titles are
+underlined with @samp{-}. For example,@refill
+
+@example
+@@subsection This is a subsection
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This is a subsection
+--------------------
+@end group
+@end example
+
+In a printed manual, subsections are listed in the table of contents
+and are numbered three levels deep.@refill
+
+@node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring
+@comment node-name, next, previous, up
+@section The @code{@@subsection}-like Commands
+@cindex Subsection-like commands
+@findex unnumberedsubsec
+@findex appendixsubsec
+@findex subheading
+
+The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
+@code{@@subheading} commands are, respectively, the unnumbered,
+appendix-like, and heading-like equivalents of the @code{@@subsection}
+command. (@xref{subsection, , @code{@@subsection}}.)@refill
+
+In Info, the @code{@@subsection}-like commands generate a title
+underlined with hyphens. In a printed manual, an @code{@@subheading}
+command produces a heading like that of a subsection except that it is
+not numbered and does not appear in the table of contents. Similarly,
+an @code{@@unnumberedsubsec} command produces an unnumbered heading like
+that of a subsection and an @code{@@appendixsubsec} command produces a
+subsection-like heading labelled with a letter and numbers; both of
+these commands produce headings that appear in the table of
+contents.@refill
+
+@node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring
+@comment node-name, next, previous, up
+@section The `subsub' Commands
+@cindex Subsub commands
+@findex subsubsection
+@findex unnumberedsubsubsec
+@findex appendixsubsubsec
+@findex subsubheading
+
+The fourth and lowest level sectioning commands in Texinfo are the
+`subsub' commands. They are:@refill
+
+@table @code
+@item @@subsubsection
+Subsubsections are to subsections as subsections are to sections.
+(@xref{subsection, , @code{@@subsection}}.) In a printed manual,
+subsubsection titles appear in the table of contents and are numbered
+four levels deep.@refill
+
+@item @@unnumberedsubsubsec
+Unnumbered subsubsection titles appear in the table of contents of a
+printed manual, but lack numbers. Otherwise, unnumbered
+subsubsections are the same as subsubsections. In Info, unnumbered
+subsubsections look exactly like ordinary subsubsections.@refill
+
+@item @@appendixsubsubsec
+Conventionally, appendix commands are used only for appendices and are
+lettered and numbered appropriately in a printed manual. They also
+appear in the table of contents. In Info, appendix subsubsections look
+exactly like ordinary subsubsections.@refill
+
+@item @@subsubheading
+The @code{@@subsubheading} command may be used anywhere that you need
+a small heading that will not appear in the table of contents. In
+Info, subsubheadings look exactly like ordinary subsubsection
+headings.@refill
+@end table
+
+In Info, `subsub' titles are underlined with periods.
+For example,@refill
+
+@example
+@@subsubsection This is a subsubsection
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This is a subsubsection
+.......................
+@end group
+@end example
+
+@node Raise/lower sections, , subsubsection, Structuring
+@comment node-name, next, previous, up
+@section @code{@@raisesections} and @code{@@lowersections}
+@findex raisesections
+@findex lowersections
+@cindex Raising and lowering sections
+@cindex Sections, raising and lowering
+
+The @code{@@raisesections} and @code{@@lowersections} commands raise and
+lower the hierarchical level of chapters, sections, subsections and the
+like. The @code{@@raisesections} command changes sections to chapters,
+subsections to sections, and so on. The @code{@@lowersections} command
+changes chapters to sections, sections to subsections, and so on.
+
+An @code{@@lowersections} command is useful if you wish to include text
+that is written as an outer or standalone Texinfo file in another
+Texinfo file as an inner, included file. If you write the command at
+the beginning of the file, all your @code{@@chapter} commands are
+formatted as if they were @code{@@section} commands, all your
+@code{@@section} command are formatted as if they were
+@code{@@subsection} commands, and so on.
+
+@need 1000
+@code{@@raisesections} raises a command one level in the chapter
+structuring hierarchy:@refill
+
+@example
+@group
+ @r{Change} @r{To}
+
+@@subsection @@section,
+@@section @@chapter,
+@@heading @@chapheading,
+ @r{etc.}
+@end group
+@end example
+
+@need 1000
+@code{@@lowersections} lowers a command one level in the chapter
+structuring hierarchy:@refill
+
+@example
+@group
+ @r{Change} @r{To}
+
+@@chapter @@section,
+@@subsection @@subsubsection,
+@@heading @@subheading,
+ @r{etc.}
+@end group
+@end example
+
+An @code{@@raisesections} or @code{@@lowersections} command changes only
+those structuring commands that follow the command in the Texinfo file.
+Write an @code{@@raisesections} or @code{@@lowersections} command on a
+line of its own.
+
+An @code{@@lowersections} command cancels an @code{@@raisesections}
+command, and vice versa.
+
+Repeated use of the commands continue to raise or lower the hierarchical
+level a step at a time.
+
+An attempt to raise above `chapters' reproduces chapter commands; an
+attempt to lower below `subsubsections' reproduces subsubsection
+commands.
+
+@node Nodes, Menus, Structuring, Top
+@comment node-name, next, previous, up
+@chapter Nodes
+
+@dfn{Nodes} are the primary segments of a Texinfo file. They do not
+themselves impose a hierarchic or any other kind of structure on a file.
+Nodes contain @dfn{node pointers} that name other nodes, and can contain
+@dfn{menus} which are lists of nodes. In Info, the movement commands
+can carry you to a pointed-to node or to a node listed in a menu. Node
+pointers and menus provide structure for Info files just as chapters,
+sections, subsections, and the like, provide structure for printed
+books.@refill
+
+@menu
+* Two Paths:: Different commands to structure
+ Info output and printed output.
+* Node Menu Illustration:: A diagram, and sample nodes and menus.
+* node:: How to write a node, in detail.
+* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
+@end menu
+
+@node Two Paths, Node Menu Illustration, Nodes, Nodes
+@ifinfo
+@heading Two Paths
+@end ifinfo
+
+The node and menu commands and the chapter structuring commands are
+independent of each other:
+
+@itemize @bullet
+@item
+In Info, node and menu commands provide structure. The chapter
+structuring commands generate headings with different kinds of
+underlining---asterisks for chapters, hyphens for sections, and so on;
+they do nothing else.@refill
+
+@item
+In @TeX{}, the chapter structuring commands generate chapter and section
+numbers and tables of contents. The node and menu commands provide
+information for cross references; they do nothing else.@refill
+@end itemize
+
+You can use node pointers and menus to structure an Info file any way
+you want; and you can write a Texinfo file so that its Info output has a
+different structure than its printed output. However, most Texinfo
+files are written such that the structure for the Info output
+corresponds to the structure for the printed output. It is not
+convenient to do otherwise.@refill
+
+Generally, printed output is structured in a tree-like hierarchy in
+which the chapters are the major limbs from which the sections branch
+out. Similarly, node pointers and menus are organized to create a
+matching structure in the Info output.@refill
+
+@node Node Menu Illustration, node, Two Paths, Nodes
+@comment node-name, next, previous, up
+@section Node and Menu Illustration
+
+Here is a copy of the diagram shown earlier that illustrates a Texinfo
+file with three chapters, each of which contains two sections.@refill
+
+Note that the ``root'' is at the top of the diagram and the ``leaves''
+are at the bottom. This is how such a diagram is drawn conventionally;
+it illustrates an upside-down tree. For this reason, the root node is
+called the `Top' node, and `Up' node pointers carry you closer to the
+root.@refill
+
+@example
+@group
+ Top
+ |
+ -------------------------------------
+ | | |
+ Chapter 1 Chapter 2 Chapter 3
+ | | |
+ -------- -------- --------
+ | | | | | |
+ Section Section Section Section Section Section
+ 1.1 1.2 2.1 2.2 3.1 3.2
+
+@end group
+@end example
+
+Write the beginning of the node for Chapter 2 like this:@refill
+
+@example
+@group
+@@node Chapter 2, Chapter 3, Chapter 1, top
+@@comment node-name, next, previous, up
+@end group
+@end example
+
+@noindent
+This @code{@@node} line says that the name of this node is ``Chapter 2'', the
+name of the `Next' node is ``Chapter 3'', the name of the `Previous'
+node is ``Chapter 1'', and the name of the `Up' node is ``Top''.
+
+@quotation
+@strong{Please Note:} `Next' refers to the next node at the same
+hierarchical level in the manual, not necessarily to the next node
+within the Texinfo file. In the Texinfo file, the subsequent node may
+be at a lower level---a section-level node may follow a chapter-level
+node, and a subsection-level node may follow a section-level node.
+`Next' and `Previous' refer to nodes at the @emph{same} hierarchical
+level. (The `Top' node contains the exception to this rule. Since the
+`Top' node is the only node at that level, `Next' refers to the first
+following node, which is almost always a chapter or chapter-level
+node.)@refill
+@end quotation
+
+To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
+2. (@xref{Menus}.) You would write the menu just
+before the beginning of Section 2.1, like this:@refill
+
+@example
+@group
+ @@menu
+ * Sect. 2.1:: Description of this section.
+ * Sect. 2.2::
+ @@end menu
+@end group
+@end example
+
+Write the node for Sect. 2.1 like this:@refill
+
+@example
+@group
+ @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
+ @@comment node-name, next, previous, up
+@end group
+@end example
+
+In Info format, the `Next' and `Previous' pointers of a node usually
+lead to other nodes at the same level---from chapter to chapter or from
+section to section (sometimes, as shown, the `Previous' pointer points
+up); an `Up' pointer usually leads to a node at the level above (closer
+to the `Top' node); and a `Menu' leads to nodes at a level below (closer
+to `leaves'). (A cross reference can point to a node at any level;
+see @ref{Cross References}.)@refill
+
+Usually, an @code{@@node} command and a chapter structuring command are
+used in sequence, along with indexing commands. (You may follow the
+@code{@@node} line with a comment line that reminds you which pointer is
+which.)@refill
+
+Here is the beginning of the chapter in this manual called ``Ending a
+Texinfo File''. This shows an @code{@@node} line followed by a comment
+line, an @code{@@chapter} line, and then by indexing lines.@refill
+
+@example
+@group
+@@node Ending a File, Structuring, Beginning a File, Top
+@@comment node-name, next, previous, up
+@@chapter Ending a Texinfo File
+@@cindex Ending a Texinfo file
+@@cindex Texinfo file ending
+@@cindex File ending
+@end group
+@end example
+
+@node node, makeinfo Pointer Creation, Node Menu Illustration, Nodes
+@comment node-name, next, previous, up
+@section The @code{@@node} Command
+
+@cindex Node, defined
+A @dfn{node} is a segment of text that begins at an @code{@@node}
+command and continues until the next @code{@@node} command. The
+definition of node is different from that for chapter or section. A
+chapter may contain sections and a section may contain subsections;
+but a node cannot contain subnodes; the text of a node continues only
+until the next @code{@@node} command in the file. A node usually
+contains only one chapter structuring command, the one that follows
+the @code{@@node} line. On the other hand, in printed output nodes
+are used only for cross references, so a chapter or section may
+contain any number of nodes. Indeed, a chapter usually contains
+several nodes, one for each section, subsection, and
+subsubsection.@refill
+
+To create a node, write an @code{@@node} command at the beginning of a
+line, and follow it with four arguments, separated by commas, on the
+rest of the same line. These arguments are the name of the node, and
+the names of the `Next', `Previous', and `Up' pointers, in that order.
+You may insert spaces before each pointer if you wish; the spaces are
+ignored. You must write the name of the node, and the names of the
+`Next', `Previous', and `Up' pointers, all on the same line. Otherwise,
+the formatters fail. (@inforef{Top, info, info}, for more information
+about nodes in Info.)@refill
+
+Usually, you write one of the chapter-structuring command lines
+immediately after an @code{@@node} line---for example, an
+@code{@@section} or @code{@@subsection} line. (@xref{Structuring
+Command Types, , Types of Structuring Command}.)@refill
+
+@quotation
+@strong{Please note:} The GNU Emacs Texinfo mode updating commands work
+only with Texinfo files in which @code{@@node} lines are followed by chapter
+structuring lines. @xref{Updating Requirements}.@refill
+@end quotation
+
+@TeX{} uses @code{@@node} lines to identify the names to use for cross
+references. For this reason, you must write @code{@@node} lines in a
+Texinfo file that you intend to format for printing, even if you do not
+intend to format it for Info. (Cross references, such as the one at the
+end of this sentence, are made with @code{@@xref} and its related
+commands; see @ref{Cross References}.)@refill
+
+@menu
+* Node Names:: How to choose node and pointer names.
+* Writing a Node:: How to write an @code{@@node} line.
+* Node Line Tips:: Keep names short.
+* Node Line Requirements:: Keep names unique, without @@-commands.
+* First Node:: How to write a `Top' node.
+* makeinfo top command:: How to use the @code{@@top} command.
+* Top Node Summary:: Write a brief description for readers.
+@end menu
+
+@node Node Names, Writing a Node, node, node
+@ifinfo
+@subheading Choosing Node and Pointer Names
+@end ifinfo
+
+The name of a node identifies the node. The pointers enable
+you to reach other nodes and consist of the names of those nodes.@refill
+
+Normally, a node's `Up' pointer contains the name of the node whose menu
+mentions that node. The node's `Next' pointer contains the name of the
+node that follows that node in that menu and its `Previous' pointer
+contains the name of the node that precedes it in that menu. When a
+node's `Previous' node is the same as its `Up' node, both node pointers
+name the same node.@refill
+
+Usually, the first node of a Texinfo file is the `Top' node, and its
+`Up' and `Previous' pointers point to the @file{dir} file, which
+contains the main menu for all of Info.@refill
+
+The `Top' node itself contains the main or master menu for the manual.
+Also, it is helpful to include a brief description of the manual in the
+`Top' node. @xref{First Node}, for information on how to write the
+first node of a Texinfo file.@refill
+
+@node Writing a Node, Node Line Tips, Node Names, node
+@comment node-name, next, previous, up
+@subsection How to Write an @code{@@node} Line
+@cindex Writing an @code{@@node} line
+@cindex @code{@@node} line writing
+@cindex Node line writing
+
+The easiest way to write an @code{@@node} line is to write @code{@@node}
+at the beginning of a line and then the name of the node, like
+this:@refill
+
+@example
+@@node @var{node-name}
+@end example
+
+If you are using GNU Emacs, you can use the update node commands
+provided by Texinfo mode to insert the names of the pointers; or you
+can leave the pointers out of the Texinfo file and let @code{makeinfo}
+insert node pointers into the Info file it creates. (@xref{Texinfo
+Mode}, and @ref{makeinfo Pointer Creation}.)@refill
+
+Alternatively, you can insert the `Next', `Previous', and `Up'
+pointers yourself. If you do this, you may find it helpful to use the
+Texinfo mode keyboard command @kbd{C-c C-c n}. This command inserts
+@samp{@@node} and a comment line listing the names of the pointers in
+their proper order. The comment line helps you keep track of which
+arguments are for which pointers. This comment line is especially useful
+if you are not familiar with Texinfo.@refill
+
+The template for a node line with `Next', `Previous', and `Up' pointers
+looks like this:@refill
+
+@example
+@@node @var{node-name}, @var{next}, @var{previous}, @var{up}
+@end example
+
+If you wish, you can ignore @code{@@node} lines altogether in your first
+draft and then use the @code{texinfo-insert-node-lines} command to
+create @code{@@node} lines for you. However, we do not
+recommend this practice. It is better to name the node itself
+at the same time that you
+write a segment so you can easily make cross references. A large number
+of cross references are an especially important feature of a good Info
+file.@refill
+
+After you have inserted an @code{@@node} line, you should immediately
+write an @@-command for the chapter or section and insert its name.
+Next (and this is important!), put in several index entries. Usually,
+you will find at least two and often as many as four or five ways of
+referring to the node in the index. Use them all. This will make it
+much easier for people to find the node.@refill
+
+@node Node Line Tips, Node Line Requirements, Writing a Node, node
+@comment node-name, next, previous, up
+@subsection @code{@@node} Line Tips
+
+Here are three suggestions:
+
+@itemize @bullet
+@item
+Try to pick node names that are informative but short.@refill
+
+In the Info file, the file name, node name, and pointer names are all
+inserted on one line, which may run into the right edge of the window.
+(This does not cause a problem with Info, but is ugly.)@refill
+
+@item
+Try to pick node names that differ from each other near the beginnings
+of their names. This way, it is easy to use automatic name completion in
+Info.@refill
+
+@item
+By convention, node names are capitalized just as they would be for
+section or chapter titles---initial and significant words are
+capitalized; others are not.@refill
+@end itemize
+
+@node Node Line Requirements, First Node, Node Line Tips, node
+@comment node-name, next, previous, up
+@subsection @code{@@node} Line Requirements
+
+@cindex Node line requirements
+Here are several requirements for @code{@@node} lines:
+
+@itemize @bullet
+@cindex Unique nodename requirement
+@cindex Nodename must be unique
+@item
+All the node names for a single Info file must be unique.@refill
+
+Duplicates confuse the Info movement commands. This means, for
+example, that if you end every chapter with a summary, you must name
+each summary node differently. You cannot just call each one
+``Summary''. You may, however, duplicate the titles of chapters, sections,
+and the like. Thus you can end each chapter in a book with a section
+called ``Summary'', so long as the node names for those sections are all
+different.@refill
+
+@item
+A pointer name must be the name of a node.@refill
+
+The node to which a pointer points may come before or after the
+node containing the pointer.@refill
+
+@cindex @@-command in nodename
+@cindex Nodename, cannot contain
+@item
+You cannot use any of the Texinfo @@-commands in a node name;
+@w{@@-commands} confuse Info.@refill
+
+@need 750
+Thus, the beginning of the section called @code{@@chapter} looks like
+this:@refill
+
+@smallexample
+@group
+@@node chapter, unnumbered & appendix, makeinfo top, Structuring
+@@comment node-name, next, previous, up
+@@section @@code@{@@@@chapter@}
+@@findex chapter
+@end group
+@end smallexample
+
+@cindex Comma in nodename
+@cindex Colon in nodename
+@cindex Apostrophe in nodename
+@item
+You cannot use commas, colons, or apostrophes within a node name; these
+confuse @TeX{} or the Info formatters.@refill
+
+@need 700
+For example, the following is a section title:
+
+@smallexample
+@@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@}
+@end smallexample
+
+@noindent
+The corresponding node name is:
+
+@smallexample
+unnumberedsec appendixsec heading
+@end smallexample
+
+@cindex Case in nodename
+@item
+Case is significant.
+@end itemize
+
+@node First Node, makeinfo top command, Node Line Requirements, node
+@comment node-name, next, previous, up
+@subsection The First Node
+@cindex @samp{@r{Top}} node is first
+@cindex First node
+
+The first node of a Texinfo file is the `Top' node, except in an
+included file (@pxref{Include Files}).
+
+The `Top' node (which must be named @samp{top} or @samp{Top}) should
+have as its `Up' and `Previous' nodes the name of a node in another
+file, where there is a menu that leads to this file. Specify the file
+name in parentheses. If the file is to be installed directly in the
+Info directory file, use @samp{(dir)} as the parent of the `Top' node;
+this is short for @samp{(dir)top}, and specifies the `Top' node in the
+@file{dir} file, which contains the main menu for Info. For example,
+the @code{@@node Top} line of this manual looks like this:@refill
+
+@example
+@@node Top, Overview, (dir), (dir)
+@end example
+
+@noindent
+(You may use the Texinfo updating commands or the @code{makeinfo}
+utility to insert these `Next' and @samp{(dir)} pointers
+automatically.)@refill
+
+@xref{Install an Info File}, for more information about installing
+an Info file in the @file{info} directory.@refill
+
+The `Top' node contains the main or master menu for the document.
+
+@node makeinfo top command, Top Node Summary, First Node, node
+@comment node-name, next, previous, up
+@subsection The @code{@@top} Sectioning Command
+@findex top @r{(@@-command)}
+
+A special sectioning command, @code{@@top}, has been created for use
+with the @code{@@node Top} line. The @code{@@top} sectioning command tells
+@code{makeinfo} that it marks the `Top' node in the file. It provides
+the information that @code{makeinfo} needs to insert node
+pointers automatically. Write the @code{@@top} command at the
+beginning of the line immediately following the @code{@@node Top}
+line. Write the title on the remaining part of the same line as the
+@code{@@top} command.@refill
+
+In Info, the @code{@@top} sectioning command causes the title to appear on a
+line by itself, with a line of asterisks inserted underneath.@refill
+
+In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
+sectioning command is merely a synonym for @code{@@unnumbered}.
+Neither of these formatters require an @code{@@top} command, and do
+nothing special with it. You can use @code{@@chapter} or
+@code{@@unnumbered} after the @code{@@node Top} line when you use
+these formatters. Also, you can use @code{@@chapter} or
+@code{@@unnumbered} when you use the Texinfo updating commands to
+create or update pointers and menus.@refill
+
+@node Top Node Summary, , makeinfo top command, node
+@subsection The `Top' Node Summary
+@cindex @samp{@r{Top}} node summary
+
+You can help readers by writing a summary in the `Top' node, after the
+@code{@@top} line, before the main or master menu. The summary should
+briefly describe the document. In Info, this summary will appear just
+before the master menu. In a printed manual, this summary will appear
+on a page of its own.@refill
+
+If you do not want the summary to appear on a page of its own in a
+printed manual, you can enclose the whole of the `Top' node, including
+the @code{@@node Top} line and the @code{@@top} sectioning command line
+or other sectioning command line between @code{@@ifinfo} and @code{@@end
+ifinfo}. This prevents any of the text from appearing in the printed
+output. (@pxref{Conditionals, , Conditionally Visible Text}). You can
+repeat the brief description from the `Top' node within @code{@@iftex}
+@dots{} @code{@@end iftex} at the beginning of the first chapter, for
+those who read the printed manual. This saves paper and may look
+neater.@refill
+
+You should write the version number of the program to which the manual
+applies in the summary. This helps the reader keep track of which
+manual is for which version of the program. If the manual changes more
+frequently than the program or is independent of it, you should also
+include an edition number for the manual. (The title page should also
+contain this information: see @ref{titlepage, ,
+@code{@@titlepage}}.)@refill
+
+@node makeinfo Pointer Creation, , node, Nodes
+@section Creating Pointers with @code{makeinfo}
+@cindex Creating pointers with @code{makeinfo}
+@cindex Pointer creation with @code{makeinfo}
+@cindex Automatic pointer creation with @code{makeinfo}
+
+The @code{makeinfo} program has a feature for automatically creating
+node pointers for a hierarchically organized file that lacks
+them.@refill
+
+When you take advantage of this feature, you do not need to write the
+`Next', `Previous', and `Up' pointers after the name of a node.
+However, you must write a sectioning command, such as @code{@@chapter}
+or @code{@@section}, on the line immediately following each truncated
+@code{@@node} line. You cannot write a comment line after a node
+line; the section line must follow it immediately.@refill
+
+In addition, you must follow the `Top' @code{@@node} line with a line beginning
+with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo
+top, , @code{@@top}}.
+
+Finally, you must write the name of each node (except for the `Top'
+node) in a menu that is one or more hierarchical levels above the
+node's hierarchical level.@refill
+
+This node pointer insertion feature in @code{makeinfo} is an
+alternative to the menu and pointer creation and update commands in
+Texinfo mode. (@xref{Updating Nodes and Menus}.) It is especially
+helpful to people who do not use GNU Emacs for writing Texinfo
+documents.@refill
+
+@node Menus, Cross References, Nodes, Top
+@comment node-name, next, previous, up
+@chapter Menus
+@cindex Menus
+@findex menu
+
+@dfn{Menus} contain pointers to subordinate
+nodes.@footnote{Menus can carry you to any node, regardless
+of the hierarchical structure; even to nodes in a different
+Info file. However, the GNU Emacs Texinfo mode updating
+commands work only to create menus of subordinate nodes.
+Conventionally, cross references are used to refer to other
+nodes.} In Info, you use menus to go to such nodes. Menus
+have no effect in printed manuals and do not appear in
+them.@refill
+
+By convention, a menu is put at the end of a node since a reader who
+uses the menu may not see text that follows it.@refill
+
+@ifinfo
+A node that has a menu should @emph{not} contain much text. If you
+have a lot of text and a menu, move most of the text into a new
+subnode---all but a few lines.@refill
+@end ifinfo
+@iftex
+@emph{A node that has a menu should not contain much text.} If you
+have a lot of text and a menu, move most of the text into a new
+subnode---all but a few lines. Otherwise, a reader with a terminal
+that displays only a few lines may miss the menu and its associated
+text. As a practical matter, you should locate a menu within 20 lines
+of the beginning of the node.@refill
+@end iftex
+
+@menu
+* Menu Location:: Put a menu in a short node.
+* Writing a Menu:: What is a menu?
+* Menu Parts:: A menu entry has three parts.
+* Less Cluttered Menu Entry:: Two part menu entry.
+* Menu Example:: Two and three part menu entries.
+* Other Info Files:: How to refer to a different Info file.
+@end menu
+
+@node Menu Location, Writing a Menu, Menus, Menus
+@ifinfo
+@heading Menus Need Short Nodes
+@end ifinfo
+@cindex Menu location
+@cindex Location of menus
+@cindex Nodes for menus are short
+@cindex Short nodes for menus
+
+@ifinfo
+A reader can easily see a menu that is close to the beginning of the
+node. The node should be short. As a practical matter, you should
+locate a menu within 20 lines of the beginning of the node.
+Otherwise, a reader with a terminal that displays only a few lines may
+miss the menu and its associated text.@refill
+@end ifinfo
+
+The short text before a menu may look awkward in a printed manual. To
+avoid this, you can write a menu near the beginning of its node and
+follow the menu by an @code{@@node} line, and then an @code{@@heading}
+line located within @code{@@ifinfo} and @code{@@end ifinfo}. This way,
+the menu, @code{@@node} line, and title appear only in the Info file,
+not the printed document.@refill
+
+For example, the preceding two paragraphs follow an Info-only menu,
+@code{@@node} line, and heading, and look like this:@refill
+
+@example
+@group
+@@menu
+* Menu Location:: Put a menu in a short node.
+* Writing a Menu:: What is a menu?
+* Menu Parts:: A menu entry has three parts.
+* Less Cluttered Menu Entry:: Two part menu entry.
+* Menu Example:: Two and three part entries.
+* Other Info Files:: How to refer to a different
+ Info file.
+@@end menu
+
+@@node Menu Location, Writing a Menu, , Menus
+@@ifinfo
+@@heading Menus Need Short Nodes
+@@end ifinfo
+@end group
+@end example
+
+The Texinfo file for this document contains more than a dozen
+examples of this procedure. One is at the beginning of this chapter;
+another is at the beginning of the ``Cross References'' chapter.@refill
+
+@node Writing a Menu, Menu Parts, Menu Location, Menus
+@section Writing a Menu
+@cindex Writing a menu
+@cindex Menu writing
+
+A menu consists of an @code{@@menu} command on a line by
+itself followed by menu entry lines or menu comment lines
+and then by an @code{@@end menu} command on a line by
+itself.@refill
+
+A menu looks like this:@refill
+
+@example
+@group
+@@menu
+Larger Units of Text
+
+* Files:: All about handling files.
+* Multiples: Buffers. Multiple buffers; editing
+ several files at once.
+@@end menu
+@end group
+@end example
+
+In a menu, every line that begins with an @w{@samp{* }} is a
+@dfn{menu entry}. (Note the space after the asterisk.) A
+line that does not start with an @w{@samp{* }} may also
+appear in a menu. Such a line is not a menu entry but is a
+menu comment line that appears in the Info file. In
+the example above, the line @samp{Larger Units of Text} is a
+menu comment line; the two lines starting with @w{@samp{* }}
+are menu entries.
+
+@node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus
+@section The Parts of a Menu
+@cindex Parts of a menu
+@cindex Menu parts
+@cindex @code{@@menu} parts
+
+A menu entry has three parts, only the second of which is
+required:@refill
+
+@enumerate
+@item
+The menu entry name.
+
+@item
+The name of the node (required).
+
+@item
+A description of the item.
+@end enumerate
+
+The template for a menu entry looks like this:@refill
+
+@example
+* @var{menu-entry-name}: @var{node-name}. @var{description}
+@end example
+
+Follow the menu entry name with a single colon and follow the node name
+with tab, comma, period, or newline.@refill
+
+In Info, a user selects a node with the @kbd{m} (@code{Info-menu})
+command. The menu entry name is what the user types after the @kbd{m}
+command.@refill
+
+The third part of a menu entry is a descriptive phrase or
+sentence. Menu entry names and node names are often short; the
+description explains to the reader what the node is about. The
+description, which is optional, can spread over two or more lines. A
+useful description complements the node name rather than repeats
+it.@refill
+
+@node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus
+@comment node-name, next, previous, up
+@section Less Cluttered Menu Entry
+@cindex Two part menu entry
+@cindex Double-colon menu entries
+@cindex Menu entries with two colons
+@cindex Less cluttered menu entry
+@cindex Uncluttered menu entry
+
+When the menu entry name and node name are the same, you can write
+the name immediately after the asterisk and space at the beginning of
+the line and follow the name with two colons.@refill
+
+@need 800
+For example, write
+
+@example
+* Name:: @var{description}
+@end example
+
+@need 800
+@noindent
+instead of
+
+@example
+* Name: Name. @var{description}
+@end example
+
+You should use the node name for the menu entry name whenever possible,
+since it reduces visual clutter in the menu.@refill
+
+@node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus
+@comment node-name, next, previous, up
+@section A Menu Example
+@cindex Menu example
+@cindex Example menu
+
+A menu looks like this in Texinfo:@refill
+
+@example
+@group
+@@menu
+* menu entry name: Node name. A short description.
+* Node name:: This form is preferred.
+@@end menu
+@end group
+@end example
+
+@need 800
+@noindent
+This produces:
+
+@example
+@group
+* menu:
+
+* menu entry name: Node name. A short description.
+* Node name:: This form is preferred.
+@end group
+@end example
+
+@need 700
+Here is an example as you might see it in a Texinfo file:@refill
+
+@example
+@group
+@@menu
+Larger Units of Text
+
+* Files:: All about handling files.
+* Multiples: Buffers. Multiple buffers; editing
+ several files at once.
+@@end menu
+@end group
+@end example
+
+@need 800
+@noindent
+This produces:
+
+@example
+@group
+* menu:
+Larger Units of Text
+
+* Files:: All about handling files.
+* Multiples: Buffers. Multiple buffers; editing
+ several files at once.
+@end group
+@end example
+
+In this example, the menu has two entries. @samp{Files} is both a menu
+entry name and the name of the node referred to by that name.
+@samp{Multiples} is the menu entry name; it refers to the node named
+@samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
+appears in the menu, but is not an entry.@refill
+
+Since no file name is specified with either @samp{Files} or
+@samp{Buffers}, they must be the names of nodes in the same Info file
+(@pxref{Other Info Files, , Referring to Other Info Files}).@refill
+
+@node Other Info Files, , Menu Example, Menus
+@comment node-name, next, previous, up
+@section Referring to Other Info Files
+@cindex Referring to other Info files
+@cindex Nodes in other Info files
+@cindex Other Info files' nodes
+@cindex Going to other Info files' nodes
+@cindex Info; other files' nodes
+
+You can create a menu entry that enables a reader in Info to go to a
+node in another Info file by writing the file name in parentheses just
+before the node name. In this case, you should use the three-part menu
+entry format, which saves the reader from having to type the file
+name.@refill
+
+@need 800
+The format looks like this:@refill
+
+@example
+@group
+@@menu
+* @var{first-entry-name}:(@var{filename})@var{nodename}. @var{description}
+* @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description}
+@@end menu
+@end group
+@end example
+
+For example, to refer directly to the @samp{Outlining} and
+@samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a
+menu like this:@refill
+
+@example
+@group
+@@menu
+* Outlining: (emacs)Outline Mode. The major mode for
+ editing outlines.
+* Rebinding: (emacs)Rebinding. How to redefine the
+ meaning of a key.
+@@end menu
+@end group
+@end example
+
+If you do not list the node name, but only name the file, then Info
+presumes that you are referring to the `Top' node.@refill
+
+The @file{dir} file that contains the main menu for Info has menu
+entries that list only file names. These take you directly to the `Top'
+nodes of each Info document. (@xref{Install an Info File}.)@refill
+
+@need 700
+For example:
+
+@example
+@group
+* Info: (info). Documentation browsing system.
+* Emacs: (emacs). The extensible, self-documenting
+ text editor.
+@end group
+@end example
+
+@noindent
+(The @file{dir} top level directory for the Info system is an Info file,
+not a Texinfo file, but a menu entry looks the same in both types of
+file.)@refill
+
+Note that the GNU Emacs Texinfo mode menu updating commands only work
+with nodes within the current buffer, so you cannot use them to create
+menus that refer to other files. You must write such menus by hand.@refill
+
+@node Cross References, Marking Text, Menus, Top
+@comment node-name, next, previous, up
+@chapter Cross References
+@cindex Making cross references
+@cindex Cross references
+@cindex References
+
+@dfn{Cross references} are used to refer the reader to other parts of the
+same or different Texinfo files. In Texinfo, nodes are the
+places to which cross references can refer.@refill
+
+@menu
+* References:: What cross references are for.
+* Cross Reference Commands:: A summary of the different commands.
+* Cross Reference Parts:: A cross reference has several parts.
+* xref:: Begin a reference with `See' @dots{}
+* Top Node Naming:: How to refer to the beginning of another file.
+* ref:: A reference for the last part of a sentence.
+* pxref:: How to write a parenthetical cross reference.
+* inforef:: How to refer to an Info-only file.
+@end menu
+
+@node References, Cross Reference Commands, Cross References, Cross References
+@ifinfo
+@heading What References Are For
+@end ifinfo
+
+Often, but not always, a printed document should be designed so that
+it can be read sequentially. People tire of flipping back and forth
+to find information that should be presented to them as they need
+it.@refill
+
+However, in any document, some information will be too detailed for
+the current context, or incidental to it; use cross references to
+provide access to such information. Also, an on-line help system or a
+reference manual is not like a novel; few read such documents in
+sequence from beginning to end. Instead, people look up what they
+need. For this reason, such creations should contain many cross
+references to help readers find other information that they may not
+have read.@refill
+
+In a printed manual, a cross reference results in a page reference,
+unless it is to another manual altogether, in which case the cross
+reference names that manual.@refill
+
+In Info, a cross reference results in an entry that you can follow using
+the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info
+commands, info}.)@refill
+
+The various cross reference commands use nodes to define cross
+reference locations. This is evident in Info, in which a cross
+reference takes you to the specified node. @TeX{} also uses nodes to
+define cross reference locations, but the action is less obvious. When
+@TeX{} generates a @sc{dvi} file, it records nodes' page numbers and
+uses the page numbers in making references. Thus, if you are writing
+a manual that will only be printed, and will not be used on-line, you
+must nonetheless write @code{@@node} lines to name the places to which
+you make cross references.@refill
+
+@need 800
+@node Cross Reference Commands, Cross Reference Parts, References, Cross References
+@comment node-name, next, previous, up
+@section Different Cross Reference Commands
+@cindex Different cross reference commands
+
+There are four different cross reference commands:@refill
+
+@table @code
+@item @@xref
+Used to start a sentence in the printed manual saying @w{`See @dots{}'}
+or an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}.
+
+@item @@ref
+Used within or, more often, at the end of a sentence; same as
+@code{@@xref} for Info; produces just the reference in the printed
+manual without a preceding `See'.@refill
+
+@item @@pxref
+Used within parentheses to make a reference that suits both an Info
+file and a printed book. Starts with a lower case `see' within the
+printed manual. (@samp{p} is for `parenthesis'.)@refill
+
+@item @@inforef
+Used to make a reference to an Info file for which there is no printed
+manual.@refill
+@end table
+
+@noindent
+(The @code{@@cite} command is used to make references to books and
+manuals for which there is no corresponding Info file and, therefore,
+no node to which to point. @xref{cite, , @code{@@cite}}.)@refill
+
+@node Cross Reference Parts, xref, Cross Reference Commands, Cross References
+@comment node-name, next, previous, up
+@section Parts of a Cross Reference
+@cindex Cross reference parts
+@cindex Parts of a cross reference
+
+A cross reference command requires only one argument, which is the
+name of the node to which it refers. But a cross reference command
+may contain up to four additional arguments. By using these
+arguments, you can provide a cross reference name for Info, a topic
+description or section title for the printed output, the name of a
+different Info file, and the name of a different printed
+manual.@refill
+
+Here is a simple cross reference example:@refill
+
+@example
+@@xref@{Node name@}.
+@end example
+
+@noindent
+which produces
+
+@example
+*Note Node name::.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section @var{nnn} [Node name], page @var{ppp}.
+@end quotation
+
+@need 700
+Here is an example of a full five-part cross reference:@refill
+
+@example
+@group
+@@xref@{Node name, Cross Reference Name, Particular Topic,
+info-file-name, A Printed Manual@}, for details.
+@end group
+@end example
+
+@noindent
+which produces
+
+@example
+*Note Cross Reference Name: (info-file-name)Node name,
+for details.
+@end example
+
+@noindent
+in Info and
+
+@quotation
+See section ``Particular Topic'' in @i{A Printed Manual}, for details.
+@end quotation
+
+@noindent
+in a printed book.
+
+The five possible arguments for a cross reference are:@refill
+
+@enumerate
+@item
+The node name (required). This is the node to which the
+cross reference takes you. In a printed document, the location of the
+node provides the page reference only for references within the same
+document.@refill
+
+@item
+The cross reference name for the Info reference, if it is to be different
+from the node name. If you include this argument, it argument becomes
+the first part of the cross reference. It is usually omitted.@refill
+
+@item
+A topic description or section name. Often, this is the title of the
+section. This is used as the name of the reference in the printed
+manual. If omitted, the node name is used.@refill
+
+@item
+The name of the Info file in which the reference is located, if it is
+different from the current file.@refill
+
+@item
+The name of a printed manual from a different Texinfo file.@refill
+@end enumerate
+
+The template for a full five argument cross reference looks like
+this:@refill
+
+@example
+@group
+@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
+@var{info-file-name}, @var{printed-manual-title}@}.
+@end group
+@end example
+
+Cross references with one, two, three, four, and five arguments are
+described separately following the description of @code{@@xref}.@refill
+
+Write a node name in a cross reference in exactly the same way as in
+the @code{@@node} line, including the same capitalization; otherwise, the
+formatters may not find the reference.@refill
+
+You can write cross reference commands within a paragraph, but note
+how Info and @TeX{} format the output of each of the various commands:
+write @code{@@xref} at the beginning of a sentence; write
+@code{@@pxref} only within parentheses, and so on.@refill
+
+@node xref, Top Node Naming, Cross Reference Parts, Cross References
+@comment node-name, next, previous, up
+@section @code{@@xref}
+@findex xref
+@cindex Cross references using @code{@@xref}
+@cindex References using @code{@@xref}
+
+The @code{@@xref} command generates a cross reference for the
+beginning of a sentence. The Info formatting commands convert it into
+an Info cross reference, which the Info @samp{f} command can use to
+bring you directly to another node. The @TeX{} typesetting commands
+convert it into a page reference, or a reference to another book or
+manual.@refill
+
+@menu
+* Reference Syntax:: What a reference looks like and requires.
+* One Argument:: @code{@@xref} with one argument.
+* Two Arguments:: @code{@@xref} with two arguments.
+* Three Arguments:: @code{@@xref} with three arguments.
+* Four and Five Arguments:: @code{@@xref} with four and five arguments.
+@end menu
+
+@node Reference Syntax, One Argument, xref, xref
+@ifinfo
+@subheading What a Reference Looks Like and Requires
+@end ifinfo
+
+Most often, an Info cross reference looks like this:@refill
+
+@example
+*Note @var{node-name}::.
+@end example
+
+@noindent
+or like this
+
+@example
+*Note @var{cross-reference-name}: @var{node-name}.
+@end example
+
+@noindent
+In @TeX{}, a cross reference looks like this:
+
+@example
+See Section @var{section-number} [@var{node-name}], page @var{page}.
+@end example
+
+@noindent
+or like this
+
+@example
+See Section @var{section-number} [@var{title-or-topic}], page @var{page}.
+@end example
+
+The @code{@@xref} command does not generate a period or comma to end
+the cross reference in either the Info file or the printed output.
+You must write that period or comma yourself; otherwise, Info will not
+recognize the end of the reference. (The @code{@@pxref} command works
+differently. @xref{pxref, , @code{@@pxref}}.)@refill
+
+@quotation
+@strong{Please note:} A period or comma @strong{must} follow the closing
+brace of an @code{@@xref}. It is required to terminate the cross
+reference. This period or comma will appear in the output, both in
+the Info file and in the printed manual.@refill
+@end quotation
+
+@code{@@xref} must refer to an Info node by name. Use @code{@@node}
+to define the node (@pxref{Writing a Node}).@refill
+
+@code{@@xref} is followed by several arguments inside braces, separated by
+commas. Whitespace before and after these commas is ignored.@refill
+
+A cross reference requires only the name of a node; but it may contain
+up to four additional arguments. Each of these variations produces a
+cross reference that looks somewhat different.@refill
+
+@quotation
+@strong{Please note:} Commas separate arguments in a cross reference;
+avoid including them in the title or other part lest the formatters
+mistake them for separators.@refill
+@end quotation
+
+@node One Argument, Two Arguments, Reference Syntax, xref
+@subsection @code{@@xref} with One Argument
+
+The simplest form of @code{@@xref} takes one argument, the name of
+another node in the same Info file. The Info formatters produce
+output that the Info readers can use to jump to the reference; @TeX{}
+produces output that specifies the page and section number for you.@refill
+
+@need 700
+@noindent
+For example,
+
+@example
+@@xref@{Tropical Storms@}.
+@end example
+
+@noindent
+produces
+
+@example
+*Note Tropical Storms::.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section 3.1 [Tropical Storms], page 24.
+@end quotation
+
+@noindent
+(Note that in the preceding example the closing brace is followed by a
+period.)@refill
+
+You can write a clause after the cross reference, like this:@refill
+
+@example
+@@xref@{Tropical Storms@}, for more info.
+@end example
+
+@noindent
+which produces
+
+@example
+*Note Tropical Storms::, for more info.
+@end example
+
+@quotation
+See Section 3.1 [Tropical Storms], page 24, for more info.
+@end quotation
+
+@noindent
+(Note that in the preceding example the closing brace is followed by a
+comma, and then by the clause, which is followed by a period.)@refill
+
+@node Two Arguments, Three Arguments, One Argument, xref
+@subsection @code{@@xref} with Two Arguments
+
+With two arguments, the second is used as the name of the Info cross
+reference, while the first is still the name of the node to which the
+cross reference points.@refill
+
+@need 750
+@noindent
+The template is like this:
+
+@example
+@@xref@{@var{node-name}, @var{cross-reference-name}@}.
+@end example
+
+@need 700
+@noindent
+For example,
+
+@example
+@@xref@{Electrical Effects, Lightning@}.
+@end example
+
+@noindent
+produces:
+
+@example
+*Note Lightning: Electrical Effects.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section 5.2 [Electrical Effects], page 57.
+@end quotation
+
+@noindent
+(Note that in the preceding example the closing brace is followed by a
+period; and that the node name is printed, not the cross reference name.)@refill
+
+You can write a clause after the cross reference, like this:@refill
+
+@example
+@@xref@{Electrical Effects, Lightning@}, for more info.
+@end example
+
+@noindent
+which produces
+@example
+*Note Lightning: Electrical Effects, for more info.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section 5.2 [Electrical Effects], page 57, for more info.
+@end quotation
+
+@noindent
+(Note that in the preceding example the closing brace is followed by a
+comma, and then by the clause, which is followed by a period.)@refill
+
+@node Three Arguments, Four and Five Arguments, Two Arguments, xref
+@subsection @code{@@xref} with Three Arguments
+
+A third argument replaces the node name in the @TeX{} output. The third
+argument should be the name of the section in the printed output, or
+else state the topic discussed by that section. Often, you will want to
+use initial upper case letters so it will be easier to read when the
+reference is printed. Use a third argument when the node name is
+unsuitable because of syntax or meaning.@refill
+
+Remember to avoid placing a comma within the title or topic section of
+a cross reference, or within any other section. The formatters divide
+cross references into arguments according to the commas; a comma
+within a title or other section will divide it into two arguments. In
+a reference, you need to write a title such as ``Clouds, Mist, and
+Fog'' without the commas.@refill
+
+Also, remember to write a comma or period after the closing brace of a
+@code{@@xref} to terminate the cross reference. In the following
+examples, a clause follows a terminating comma.@refill
+
+
+@need 750
+@noindent
+The template is like this:
+
+@example
+@group
+@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}.
+@end group
+@end example
+
+@need 700
+@noindent
+For example,
+
+@example
+@group
+@@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
+for details.
+@end group
+@end example
+
+@noindent
+produces
+
+@example
+*Note Lightning: Electrical Effects, for details.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section 5.2 [Thunder and Lightning], page 57, for details.
+@end quotation
+
+If a third argument is given and the second one is empty, then the
+third argument serves both. (Note how two commas, side by side, mark
+the empty second argument.)@refill
+
+@example
+@group
+@@xref@{Electrical Effects, , Thunder and Lightning@},
+for details.
+@end group
+@end example
+
+@noindent
+produces
+
+@example
+*Note Thunder and Lightning: Electrical Effects, for details.
+@end example
+
+@noindent
+and
+
+@quotation
+See Section 5.2 [Thunder and Lightning], page 57, for details.
+@end quotation
+
+As a practical matter, it is often best to write cross references with
+just the first argument if the node name and the section title are the
+same, and with the first and third arguments if the node name and title
+are different.@refill
+
+Here are several examples from @cite{The GAWK Manual}:@refill
+
+@smallexample
+@@xref@{Sample Program@}.
+@@xref@{Glossary@}.
+@@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}.
+@@xref@{Close Output, , Closing Output Files and Pipes@},
+ for more information.
+@@xref@{Regexp, , Regular Expressions as Patterns@}.
+@end smallexample
+
+@node Four and Five Arguments, , Three Arguments, xref
+@subsection @code{@@xref} with Four and Five Arguments
+
+In a cross reference, a fourth argument specifies the name of another
+Info file, different from the file in which the reference appears, and
+a fifth argument specifies its title as a printed manual.@refill
+
+Remember that a comma or period must follow the closing brace of an
+@code{@@xref} command to terminate the cross reference. In the
+following examples, a clause follows a terminating comma.@refill
+
+@need 800
+@noindent
+The template is:
+
+@example
+@group
+@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
+@var{info-file-name}, @var{printed-manual-title}@}.
+@end group
+@end example
+
+@need 700
+@noindent
+For example,
+
+@example
+@@xref@{Electrical Effects, Lightning, Thunder and Lightning,
+weather, An Introduction to Meteorology@}, for details.
+@end example
+
+@noindent
+produces
+
+@example
+*Note Lightning: (weather)Electrical Effects, for details.
+@end example
+
+@noindent
+The name of the Info file is enclosed in parentheses and precedes
+the name of the node.
+
+@noindent
+In a printed manual, the reference looks like this:@refill
+
+@quotation
+See section ``Thunder and Lightning'' in @i{An Introduction to
+Meteorology}, for details.
+@end quotation
+
+@noindent
+The title of the printed manual is typeset in italics; and the
+reference lacks a page number since @TeX{} cannot know to which page a
+reference refers when that reference is to another manual.@refill
+
+Often, you will leave out the second argument when you use the long
+version of @code{@@xref}. In this case, the third argument, the topic
+description, will be used as the cross reference name in Info.@refill
+
+@noindent
+The template looks like this:
+
+@example
+@@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name},
+@var{printed-manual-title}@}, for details.
+@end example
+
+@noindent
+which produces
+
+@example
+*Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details.
+@end example
+
+@noindent
+and
+
+@quotation
+See section @var{title-or-topic} in @var{printed-manual-title}, for details.
+@end quotation
+
+@need 700
+@noindent
+For example,
+
+@example
+@@xref@{Electrical Effects, , Thunder and Lightning,
+weather, An Introduction to Meteorology@}, for details.
+@end example
+
+@noindent
+produces
+
+@example
+@group
+*Note Thunder and Lightning: (weather)Electrical Effects,
+for details.
+@end group
+@end example
+
+@noindent
+and
+
+@quotation
+See section ``Thunder and Lightning'' in @i{An Introduction to
+Meteorology}, for details.
+@end quotation
+
+On rare occasions, you may want to refer to another Info file that
+is within a single printed manual---when multiple Texinfo files are
+incorporated into the same @TeX{} run but make separate Info files.
+In this case, you need to specify only the fourth argument, and not
+the fifth.@refill
+
+@node Top Node Naming, ref, xref, Cross References
+@section Naming a `Top' Node
+@cindex Naming a `Top' Node in references
+@cindex @samp{@r{Top}} node naming for references
+
+In a cross reference, you must always name a node. This means that in
+order to refer to a whole manual, you must identify the `Top' node by
+writing it as the first argument to the @code{@@xref} command. (This
+is different from the way you write a menu entry; see @ref{Other Info
+Files, , Referring to Other Info Files}.) At the same time, to
+provide a meaningful section topic or title in the printed cross
+reference (instead of the word `Top'), you must write an appropriate
+entry for the third argument to the @code{@@xref} command.
+@refill
+
+@noindent
+Thus, to make a cross reference to @cite{The GNU Make Manual},
+write:@refill
+
+@example
+@@xref@{Top, , Overview, make, The GNU Make Manual@}.
+@end example
+
+@noindent
+which produces
+
+@example
+*Note Overview: (make)Top.
+@end example
+
+@noindent
+and
+
+@quotation
+See section ``Overview'' in @i{The GNU Make Manual}.
+@end quotation
+
+@noindent
+In this example, @samp{Top} is the name of the first node, and
+@samp{Overview} is the name of the first section of the manual.@refill
+@node ref, pxref, Top Node Naming, Cross References
+@comment node-name, next, previous, up
+@section @code{@@ref}
+@cindex Cross references using @code{@@ref}
+@cindex References using @code{@@ref}
+@findex ref
+
+@code{@@ref} is nearly the same as @code{@@xref} except that it does
+not generate a `See' in the printed output, just the reference itself.
+This makes it useful as the last part of a sentence.@refill
+
+@need 700
+@noindent
+For example,
+
+@example
+For more information, see @@ref@{Hurricanes@}.
+@end example
+
+@noindent
+produces
+
+@example
+For more information, see *Note Hurricanes.
+@end example
+
+@noindent
+and
+
+@quotation
+For more information, see Section 8.2 [Hurricanes], page 123.
+@end quotation
+
+The @code{@@ref} command sometimes leads writers to express themselves
+in a manner that is suitable for a printed manual but looks awkward
+in the Info format. Bear in mind that your audience will be using
+both the printed and the Info format.@refill
+
+@need 800
+@noindent
+For example,
+
+@example
+@group
+Sea surges are described in @@ref@{Hurricanes@}.
+@end group
+@end example
+
+@need 800
+@noindent
+produces
+
+@quotation
+Sea surges are described in Section 6.7 [Hurricanes], page 72.
+@end quotation
+
+@need 800
+@noindent
+in a printed document, and the following in Info:
+
+@example
+Sea surges are described in *Note Hurricanes::.
+@end example
+
+@quotation
+@strong{Caution:} You @emph{must} write a period or comma immediately
+after an @code{@@ref} command with two or more arguments. Otherwise,
+Info will not find the end of the cross reference entry and its
+attempt to follow the cross reference will fail. As a general rule,
+you should write a period or comma after every @code{@@ref} command.
+This looks best in both the printed and the Info output.@refill
+@end quotation
+
+@node pxref, inforef, ref, Cross References
+@comment node-name, next, previous, up
+@section @code{@@pxref}
+@cindex Cross references using @code{@@pxref}
+@cindex References using @code{@@pxref}
+@findex pxref
+
+The parenthetical reference command, @code{@@pxref}, is nearly the
+same as @code{@@xref}, but you use it @emph{only} inside parentheses
+and you do @emph{not} type a comma or period after the command's
+closing brace. The command differs from @code{@@xref} in two
+ways:@refill
+
+@enumerate
+@item
+@TeX{} typesets the reference for the printed manual with a lower case
+`see' rather than an upper case `See'.@refill
+
+@item
+The Info formatting commands automatically end the reference with a
+closing colon or period.@refill
+@end enumerate
+
+Because one type of formatting automatically inserts closing
+punctuation and the other does not, you should use @code{@@pxref}
+@emph{only} inside parentheses as part of another sentence. Also, you
+yourself should not insert punctuation after the reference, as you do
+with @code{@@xref}.@refill
+
+@code{@@pxref} is designed so that the output looks right and works
+right between parentheses both in printed output and in an Info file.
+In a printed manual, a closing comma or period should not follow a
+cross reference within parentheses; such punctuation is wrong. But in
+an Info file, suitable closing punctuation must follow the cross
+reference so Info can recognize its end. @code{@@pxref} spares you
+the need to use complicated methods to put a terminator into one form
+of the output and not the other.@refill
+
+@noindent
+With one argument, a parenthetical cross reference looks like
+this:@refill
+
+@example
+@dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
+@end example
+
+@need 800
+@noindent
+which produces
+
+@example
+@group
+@dots{} storms cause flooding (*Note Hurricanes::) @dots{}
+@end group
+@end example
+
+@noindent
+and
+
+@quotation
+@dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
+@end quotation
+
+With two arguments, a parenthetical cross reference has this
+template:@refill
+
+@example
+@dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
+@end example
+
+@noindent
+which produces
+
+@example
+@dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{}
+@end example
+
+@noindent
+and
+
+@need 1500
+@quotation
+@dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
+@end quotation
+
+@code{@@pxref} can be used with up to five arguments just like
+@code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill
+
+@quotation
+@strong{Please note:} Use @code{@@pxref} only as a parenthetical
+reference. Do not try to use @code{@@pxref} as a clause in a sentence.
+It will look bad in either the Info file, the printed output, or
+both.@refill
+
+Also, parenthetical cross references look best at the ends of sentences.
+Although you may write them in the middle of a sentence, that location
+breaks up the flow of text.@refill
+@end quotation
+
+@node inforef, , pxref, Cross References
+@comment node-name, next, previous, up
+@section @code{@@inforef}
+@cindex Cross references using @code{@@inforef}
+@cindex References using @code{@@inforef}
+@findex inforef
+
+@code{@@inforef} is used for cross references to Info files for which
+there are no printed manuals. Even in a printed manual,
+@code{@@inforef} generates a reference directing the user to look in
+an Info file.@refill
+
+The command takes either two or three arguments, in the following
+order:@refill
+
+@enumerate
+@item
+The node name.
+
+@item
+The cross reference name (optional).
+
+@item
+The Info file name.
+@end enumerate
+
+@noindent
+Separate the arguments with commas, as with @code{@@xref}. Also, you
+must terminate the reference with a comma or period after the
+@samp{@}}, as you do with @code{@@xref}.@refill
+
+@noindent
+The template is:
+
+@example
+@@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@},
+@end example
+
+@need 800
+@noindent
+Thus,
+
+@example
+@group
+@@inforef@{Expert, Advanced Info commands, info@},
+for more information.
+@end group
+@end example
+
+@need 800
+@noindent
+produces
+
+@example
+@group
+*Note Advanced Info commands: (info)Expert,
+for more information.
+@end group
+@end example
+
+@need 800
+@noindent
+and
+
+@quotation
+See Info file @file{info}, node @samp{Expert}, for more information.
+@end quotation
+
+@need 800
+@noindent
+Similarly,
+
+@example
+@group
+@@inforef@{Expert, , info@}, for more information.
+@end group
+@end example
+
+@need 800
+@noindent
+produces
+
+@example
+*Note (info)Expert::, for more information.
+@end example
+
+@need 800
+@noindent
+and
+
+@quotation
+See Info file @file{info}, node @samp{Expert}, for more information.
+@end quotation
+
+The converse of @code{@@inforef} is @code{@@cite}, which is used to
+refer to printed works for which no Info form exists. @xref{cite, ,
+@code{@@cite}}.@refill
+
+@node Marking Text, Quotations and Examples, Cross References, Top
+@comment node-name, next, previous, up
+@chapter Marking Words and Phrases
+@cindex Paragraph, marking text within
+@cindex Marking words and phrases
+@cindex Words and phrases, marking them
+@cindex Marking text within a paragraph
+
+In Texinfo, you can mark words and phrases in a variety of ways.
+The Texinfo formatters use this information to determine how to
+highlight the text.
+You can specify, for example, whether a word or phrase is a
+defining occurrence, a metasyntactic variable, or a symbol used in a
+program. Also, you can emphasize text.@refill
+
+@menu
+* Indicating:: How to indicate definitions, files, etc.
+* Emphasis:: How to emphasize text.
+@end menu
+
+@node Indicating, Emphasis, Marking Text, Marking Text
+@comment node-name, next, previous, up
+@section Indicating Definitions, Commands, etc.
+@cindex Highlighting text
+@cindex Indicating commands, definitions, etc.
+
+Texinfo has commands for indicating just what kind of object a piece of
+text refers to. For example, metasyntactic variables are marked by
+@code{@@var}, and code by @code{@@code}. Since the pieces of text are
+labelled by commands that tell what kind of object they are, it is easy
+to change the way the Texinfo formatters prepare such text. (Texinfo is
+an @emph{intentional} formatting language rather than a @emph{typesetting}
+formatting language.)@refill
+
+For example, in a printed manual,
+code is usually illustrated in a typewriter font;
+@code{@@code} tells @TeX{} to typeset this text in this font. But it
+would be easy to change the way @TeX{} highlights code to use another
+font, and this change would not effect how keystroke examples are
+highlighted. If straight typesetting commands were used in the body
+of the file and you wanted to make a change, you would need to check
+every single occurrence to make sure that you were changing code and
+not something else that should not be changed.@refill
+
+@menu
+* Useful Highlighting:: Highlighting provides useful information.
+* code:: How to indicate code.
+* kbd:: How to show keyboard input.
+* key:: How to specify keys.
+* samp:: How to show a literal sequence of characters.
+* var:: How to indicate a metasyntactic variable.
+* file:: How to indicate the name of a file.
+* dfn:: How to specify a definition.
+* cite:: How to refer to a book that is not in Info.
+* url:: How to indicate a world wide web reference.
+* email:: How to indicate an electronic mail address.
+@end menu
+
+@node Useful Highlighting, code, Indicating, Indicating
+@ifinfo
+@subheading Highlighting Commands are Useful
+@end ifinfo
+
+The highlighting commands can be used to generate useful information
+from the file, such as lists of functions or file names. It is
+possible, for example, to write a program in Emacs Lisp (or a keyboard
+macro) to insert an index entry after every paragraph that contains
+words or phrases marked by a specified command. You could do this to
+construct an index of functions if you had not already made the
+entries.@refill
+
+The commands serve a variety of purposes:@refill
+
+@table @code
+@item @@code@{@var{sample-code}@}
+Indicate text that is a literal example of a piece of a program.@refill
+
+@item @@kbd@{@var{keyboard-characters}@}
+Indicate keyboard input.@refill
+
+@item @@key@{@var{key-name}@}
+Indicate the conventional name for a key on a keyboard.@refill
+
+@item @@samp@{@var{text}@}
+Indicate text that is a literal example of a sequence of characters.@refill
+
+@item @@var@{@var{metasyntactic-variable}@}
+Indicate a metasyntactic variable.@refill
+
+@item @@url@{@var{uniform-resource-locator}@}
+Indicate a uniform resource locator for the World Wide Web.
+
+@item @@file@{@var{file-name}@}
+Indicate the name of a file.@refill
+
+@item @@email@{@var{email-address}@}
+Indicate an electronic mail address.
+
+@item @@dfn@{@var{term}@}
+Indicate the introductory or defining use of a term.@refill
+
+@item @@cite@{@var{reference}@}
+Indicate the name of a book.@refill
+
+@ignore
+@item @@ctrl@{@var{ctrl-char}@}
+Use for an @sc{ascii} control character.@refill
+@end ignore
+@end table
+
+@node code, kbd, Useful Highlighting, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@code}@{@var{sample-code}@}
+@findex code
+
+Use the @code{@@code} command to indicate text that is a piece of a
+program and which consists of entire syntactic tokens. Enclose the
+text in braces.@refill
+
+Thus, you should use @code{@@code} for an expression in a program, for
+the name of a variable or function used in a program, or for a
+keyword. Also, you should use @code{@@code} for the name of a
+program, such as @code{diff}, that is a name used in the machine. (You
+should write the name of a program in the ordinary text font if you
+regard it as a new English word, such as `Emacs' or `Bison'.)@refill
+
+Use @code{@@code} for environment variables such as @code{TEXINPUTS},
+and other variables.@refill
+
+Use @code{@@code} for command names in command languages that
+resemble programming languages, such as Texinfo or the shell.
+For example, @code{@@code} and @code{@@samp} are produced by writing
+@samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo
+source, respectively.@refill
+
+Note, however, that you should not use @code{@@code} for shell options
+such as @samp{-c} when such options stand alone. (Use @code{@@samp}.)
+Also, an entire shell command often looks better if written using
+@code{@@samp} rather than @code{@@code}. In this case, the rule is to
+choose the more pleasing format.@refill
+
+It is incorrect to alter the case of a word inside an @code{@@code}
+command when it appears at the beginning of a sentence. Most computer
+languages are case sensitive. In C, for example, @code{Printf} is
+different from the identifier @code{printf}, and most likely is a
+misspelling of it. Even in languages which are not case sensitive, it
+is confusing to a human reader to see identifiers spelled in different
+ways. Pick one spelling and always use that. If you do not want to
+start a sentence with a command written all in lower case, you should
+rearrange the sentence.@refill
+
+Do not use the @code{@@code} command for a string of characters shorter
+than a syntactic token. If you are writing about @samp{TEXINPU}, which
+is just a part of the name for the @code{TEXINPUTS} environment
+variable, you should use @code{@@samp}.@refill
+
+In particular, you should not use the @code{@@code} command when writing
+about the characters used in a token; do not, for example, use
+@code{@@code} when you are explaining what letters or printable symbols
+can be used in the names of functions. (Use @code{@@samp}.) Also, you
+should not use @code{@@code} to mark text that is considered input to
+programs unless the input is written in a language that is like a
+programming language. For example, you should not use @code{@@code} for
+the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although
+you may use @code{@@code} for the names of the Emacs Lisp functions that
+the keystroke commands invoke.@refill
+
+In the printed manual, @code{@@code} causes @TeX{} to typeset the
+argument in a typewriter face. In the Info file, it causes the Info
+formatting commands to use single quotation marks around the text.
+
+@need 700
+For example,
+
+@example
+Use @@code@{diff@} to compare two files.
+@end example
+
+@noindent
+produces this in the printed manual:@refill
+
+@quotation
+Use @code{diff} to compare two files.
+@end quotation
+@iftex
+
+@noindent
+and this in the Info file:@refill
+
+@example
+Use `diff' to compare two files.
+@end example
+@end iftex
+
+@node kbd, key, code, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@kbd}@{@var{keyboard-characters}@}
+@findex kbd
+
+Use the @code{@@kbd} command for characters of input to be typed by
+users. For example, to refer to the characters @kbd{M-a},
+write@refill
+
+@example
+@@kbd@{M-a@}
+@end example
+
+@noindent
+and to refer to the characters @kbd{M-x shell}, write@refill
+
+@example
+@@kbd@{M-x shell@}
+@end example
+
+The @code{@@kbd} command has the same effect as @code{@@code} in Info,
+but may produce a different font in a printed manual.@refill
+
+You can embed another @@-command inside the braces of an @code{@@kbd}
+command. Here, for example, is the way to describe a command that
+would be described more verbosely as ``press an @samp{r} and then
+press the @key{RET} key'':@refill
+
+@example
+@@kbd@{r @@key@{RET@}@}
+@end example
+
+@noindent
+This produces: @kbd{r @key{RET}}
+
+You also use the @code{@@kbd} command if you are spelling out the letters
+you type; for example:@refill
+
+@example
+To give the @@code@{logout@} command,
+type the characters @@kbd@{l o g o u t @@key@{RET@}@}.
+@end example
+
+@noindent
+This produces:
+
+@quotation
+To give the @code{logout} command,
+type the characters @kbd{l o g o u t @key{RET}}.
+@end quotation
+
+(Also, this example shows that you can add spaces for clarity. If you
+really want to mention a space character as one of the characters of
+input, write @kbd{@@key@{SPC@}} for it.)@refill
+
+@node key, samp, kbd, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@key}@{@var{key-name}@}
+@findex key
+
+Use the @code{@@key} command for the conventional name for a key on a
+keyboard, as in:@refill
+
+@example
+@@key@{RET@}
+@end example
+
+You can use the @code{@@key} command within the argument of an
+@code{@@kbd} command when the sequence of characters to be typed
+includes one or more keys that are described by name.@refill
+
+@need 700
+For example, to produce @kbd{C-x @key{ESC}} you would type:@refill
+
+@example
+@@kbd@{C-x @@key@{ESC@}@}
+@end example
+
+Here is a list of the recommended names for keys:
+@cindex Recommended names for keys
+@cindex Keys, recommended names
+@cindex Names recommended for keys
+@cindex Abbreviations for keys
+
+@quotation
+@table @t
+@item SPC
+Space
+@item RET
+Return
+@item LFD
+Linefeed (however, since most keyboards nowadays do not have a Linefeed key,
+it might be better to call this character @kbd{C-j}.
+@item TAB
+Tab
+@item BS
+Backspace
+@item ESC
+Escape
+@item DEL
+Delete
+@item SHIFT
+Shift
+@item CTRL
+Control
+@item META
+Meta
+@end table
+@end quotation
+
+@cindex META key
+There are subtleties to handling words like `meta' or `ctrl' that are
+names of shift keys. When mentioning a character in which the shift key
+is used, such as @kbd{Meta-a}, use the @code{@@kbd} command alone; do
+not use the @code{@@key} command; but when you are referring to the
+shift key in isolation, use the @code{@@key} command. For example,
+write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
+@samp{@@key@{META@}} to produce @key{META}.
+
+@c I don't think this is a good explanation.
+@c I think it will puzzle readers more than it clarifies matters. -- rms.
+@c In other words, use @code{@@kbd} for what you do, and use @code{@@key}
+@c for what you talk about: ``Press @code{@@kbd@{M-a@}} to move point to
+@c the beginning of the sentence. The @code{@@key@{META@}} key is often in
+@c the lower left of the keyboard.''@refill
+
+@node samp, var, key, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@samp}@{@var{text}@}
+@findex samp
+
+Use the @code{@@samp} command to indicate text that is a literal example
+or `sample' of a sequence of characters in a file, string, pattern, etc.
+Enclose the text in braces. The argument appears within single
+quotation marks in both the Info file and the printed manual; in
+addition, it is printed in a fixed-width font.@refill
+
+@example
+To match @@samp@{foo@} at the end of the line,
+use the regexp @@samp@{foo$@}.
+@end example
+
+@noindent
+produces
+
+@quotation
+To match @samp{foo} at the end of the line, use the regexp
+@samp{foo$}.@refill
+@end quotation
+
+Any time you are referring to single characters, you should use
+@code{@@samp} unless @code{@@kbd} is more appropriate. Use
+@code{@@samp} for the names of command-line options. Also, you may use
+@code{@@samp} for entire statements in C and for entire shell
+commands---in this case, @code{@@samp} often looks better than
+@code{@@code}. Basically, @code{@@samp} is a catchall for whatever is
+not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
+
+Only include punctuation marks within braces if they are part of the
+string you are specifying. Write punctuation marks outside the braces
+if those punctuation marks are part of the English text that surrounds
+the string. In the following sentence, for example, the commas and
+period are outside of the braces:@refill
+
+@example
+@group
+In English, the vowels are @@samp@{a@}, @@samp@{e@},
+@@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
+@@samp@{y@}.
+@end group
+@end example
+
+@noindent
+This produces:
+
+@quotation
+In English, the vowels are @samp{a}, @samp{e},
+@samp{i}, @samp{o}, @samp{u}, and sometimes
+@samp{y}.
+@end quotation
+
+@node var, file, samp, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@var}@{@var{metasyntactic-variable}@}
+@findex var
+
+Use the @code{@@var} command to indicate metasyntactic variables. A
+@dfn{metasyntactic variable} is something that stands for another piece of
+text. For example, you should use a metasyntactic variable in the
+documentation of a function to describe the arguments that are passed
+to that function.@refill
+
+Do not use @code{@@var} for the names of particular variables in
+programming languages. These are specific names from a program, so
+@code{@@code} is correct for them. For example, the Lisp variable
+@code{texinfo-tex-command} is not a metasyntactic variable; it is
+properly formatted using @code{@@code}.@refill
+
+The effect of @code{@@var} in the Info file is to change the case of
+the argument to all upper case; in the printed manual, to italicize it.
+
+@need 700
+For example,
+
+@example
+To delete file @@var@{filename@},
+type @@code@{rm @@var@{filename@}@}.
+@end example
+
+@noindent
+produces
+
+@quotation
+To delete file @var{filename}, type @code{rm @var{filename}}.
+@end quotation
+
+@noindent
+(Note that @code{@@var} may appear inside @code{@@code},
+@code{@@samp}, @code{@@file}, etc.)@refill
+
+Write a metasyntactic variable all in lower case without spaces, and
+use hyphens to make it more readable. Thus, the Texinfo source for
+the illustration of how to begin a Texinfo manual looks like
+this:@refill
+
+@example
+@group
+\input texinfo
+@@@@setfilename @@var@{info-file-name@}
+@@@@settitle @@var@{name-of-manual@}
+@end group
+@end example
+
+@noindent
+This produces:
+
+@example
+@group
+\input texinfo
+@@setfilename @var{info-file-name}
+@@settitle @var{name-of-manual}
+@end group
+@end example
+
+In some documentation styles, metasyntactic variables are shown with
+angle brackets, for example:@refill
+
+@example
+@dots{}, type rm <filename>
+@end example
+
+@noindent
+However, that is not the style that Texinfo uses. (You can, of
+course, modify the sources to @TeX{} and the Info formatting commands
+to output the @code{<@dots{}>} format if you wish.)@refill
+
+@node file, dfn, var, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@file}@{@var{file-name}@}
+@findex file
+
+Use the @code{@@file} command to indicate text that is the name of a
+file, buffer, or directory, or is the name of a node in Info. You can
+also use the command for file name suffixes. Do not use @code{@@file}
+for symbols in a programming language; use @code{@@code}.
+
+Currently, @code{@@file} is equivalent to @code{@@samp} in its effects.
+For example,@refill
+
+@example
+The @@file@{.el@} files are in
+the @@file@{/usr/local/emacs/lisp@} directory.
+@end example
+
+@noindent
+produces
+
+@quotation
+The @file{.el} files are in
+the @file{/usr/local/emacs/lisp} directory.
+@end quotation
+
+@node dfn, cite, file, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@dfn}@{@var{term}@}
+@findex dfn
+
+Use the @code{@@dfn} command to identify the introductory or defining
+use of a technical term. Use the command only in passages whose
+purpose is to introduce a term which will be used again or which the
+reader ought to know. Mere passing mention of a term for the first
+time does not deserve @code{@@dfn}. The command generates italics in
+the printed manual, and double quotation marks in the Info file. For
+example:@refill
+
+@example
+Getting rid of a file is called @@dfn@{deleting@} it.
+@end example
+
+@noindent
+produces
+
+@quotation
+Getting rid of a file is called @dfn{deleting} it.
+@end quotation
+
+As a general rule, a sentence containing the defining occurrence of a
+term should be a definition of the term. The sentence does not need
+to say explicitly that it is a definition, but it should contain the
+information of a definition---it should make the meaning clear.
+
+@node cite, url, dfn, Indicating
+@comment node-name, next, previous, up
+@subsection @code{@@cite}@{@var{reference}@}
+@findex cite
+
+Use the @code{@@cite} command for the name of a book that lacks a
+companion Info file. The command produces italics in the printed
+manual, and quotation marks in the Info file.@refill
+
+(If a book is written in Texinfo, it is better to use a cross reference
+command since a reader can easily follow such a reference in Info.
+@xref{xref, , @code{@@xref}}.)@refill
+
+@ignore
+@c node ctrl, , cite, Indicating
+@comment node-name, next, previous, up
+@c subsection @code{@@ctrl}@{@var{ctrl-char}@}
+@findex ctrl
+
+The @code{@@ctrl} command is seldom used. It describes an @sc{ascii}
+control character by inserting the actual character into the Info
+file.
+
+Usually, in Texinfo, you talk what you type as keyboard entry by
+describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for
+@kbd{C-a}. Use @code{@@kbd} in this way when talking about a control
+character that is typed on the keyboard by the user. When talking
+about a control character appearing in a file or a string, do not use
+@code{@@kbd} since the control character is not typed. Also, do not
+use @samp{C-} but spell out @code{control-}, as in @samp{control-a},
+to make it easier for a reader to understand.@refill
+
+@code{@@ctrl} is an idea from the beginnings of Texinfo which may not
+really fit in to the scheme of things. But there may be times when
+you want to use the command. The pattern is
+@code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character
+whose control-equivalent is wanted. For example, to specify
+@samp{control-f}, you would enter@refill
+
+@example
+@@ctrl@{f@}
+@end example
+
+@noindent
+produces
+
+@quotation
+@ctrl{f}
+@end quotation
+
+In the Info file, this generates the specified control character, output
+literally into the file. This is done so a user can copy the specified
+control character (along with whatever else he or she wants) into another
+Emacs buffer and use it. Since the `control-h',`control-i', and
+`control-j' characters are formatting characters, they should not be
+indicated with @code{@@ctrl}.@refill
+
+In a printed manual, @code{@@ctrl} generates text to describe or
+identify that control character: an uparrow followed by the character
+@var{ch}.@refill
+@end ignore
+
+@node url, email, cite, Indicating
+@subsection @code{@@url}@{@var{uniform-resource-locator}@}
+@findex url
+
+Use the @code{@@url} command to indicate a uniform resource locator on
+the World Wide Web. For example:
+
+@c Two lines because one is too long for smallbook format.
+@example
+The official GNU ftp site is
+@@url@{ftp://ftp.gnu.ai.mit.edu/pub/gnu@}.
+@end example
+
+In Info and @TeX{}, this acts like @code{@@samp}. When
+Texinfo is converted to HTML, this produces a link you can follow.
+
+@node email, , url, Indicating
+@subsection @code{@@email}@{@var{email-address}@}
+@findex email
+
+Use the @code{@@email} command to indicate an electronic mail address.
+For example:
+
+@example
+Send bug reports to @email{bug-texinfo@@prep.ai.mit.edu}.
+@end example
+
+In Info and @TeX{}, this acts like @code{@@samp}. When we have support
+for conversion of Texinfo to HTML, this will produce a link you can
+follow to bring up a mail composition window initialized with
+@var{email-address}.
+
+@node Emphasis, , Indicating, Marking Text
+@comment node-name, next, previous, up
+@section Emphasizing Text
+@cindex Emphasizing text
+
+Usually, Texinfo changes the font to mark words in the text according to
+what category the words belong to; an example is the @code{@@code} command.
+Most often, this is the best way to mark words.
+However, sometimes you will want to emphasize text without indicating a
+category. Texinfo has two commands to do this. Also, Texinfo has
+several commands that specify the font in which @TeX{} will typeset
+text. These commands have no affect on Info and only one of them,
+the @code{@@r} command, has any regular use.@refill
+
+@menu
+* emph & strong:: How to emphasize text in Texinfo.
+* Smallcaps:: How to use the small caps font.
+* Fonts:: Various font commands for printed output.
+* Customized Highlighting:: How to define highlighting commands.
+@end menu
+
+@node emph & strong, Smallcaps, Emphasis, Emphasis
+@comment node-name, next, previous, up
+@subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
+@cindex Emphasizing text, font for
+@findex emph
+@findex strong
+
+The @code{@@emph} and @code{@@strong} commands are for emphasis;
+@code{@@strong} is stronger. In printed output, @code{@@emph}
+produces @emph{italics} and @code{@@strong} produces
+@strong{bold}.@refill
+
+@need 800
+For example,
+
+@example
+@group
+@@quotation
+@@strong@{Caution:@} @@code@{rm * .[^.]*@} removes @@emph@{all@}
+files in the directory.
+@@end quotation
+@end group
+@end example
+
+@iftex
+@noindent
+produces the following in printed output:
+
+@quotation
+@strong{Caution}: @code{rm * .[^.]*} removes @emph{all}
+files in the directory.
+@end quotation
+
+@noindent
+and the following in Info:
+@end iftex
+@ifinfo
+@noindent
+produces:
+@end ifinfo
+
+@example
+ *Caution*: `rm * .[^.]*' removes *all*
+ files in the directory.
+@end example
+
+The @code{@@strong} command is seldom used except to mark what is, in
+effect, a typographical element, such as the word `Caution' in the
+preceding example.
+
+In the Info file, both @code{@@emph} and @code{@@strong} put asterisks
+around the text.@refill
+
+@quotation
+@strong{Caution:} Do not use @code{@@emph} or @code{@@strong} with the
+word @samp{Note}; Info will mistake the combination for a cross
+reference. Use a phrase such as @strong{Please note} or
+@strong{Caution} instead.@refill
+@end quotation
+
+@node Smallcaps, Fonts, emph & strong, Emphasis
+@subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
+@cindex Small caps font
+@findex sc @r{(small caps font)}
+
+@iftex
+Use the @samp{@@sc} command to set text in the printed output in @sc{a
+small caps font} and set text in the Info file in upper case letters.@refill
+@end iftex
+@ifinfo
+Use the @samp{@@sc} command to set text in the printed output in a
+small caps font and set text in the Info file in upper case letters.@refill
+@end ifinfo
+
+Write the text between braces in lower case, like this:@refill
+
+@example
+The @@sc@{acm@} and @@sc@{ieee@} are technical societies.
+@end example
+
+@noindent
+This produces:
+
+@display
+The @sc{acm} and @sc{ieee} are technical societies.
+@end display
+
+@TeX{} typesets the small caps font in a manner that prevents the
+letters from `jumping out at you on the page'. This makes small caps
+text easier to read than text in all upper case. The Info formatting
+commands set all small caps text in upper case.@refill
+
+@ifinfo
+If the text between the braces of an @code{@@sc} command is upper case,
+@TeX{} typesets in full-size capitals. Use full-size capitals
+sparingly.@refill
+@end ifinfo
+@iftex
+If the text between the braces of an @code{@@sc} command is upper case,
+@TeX{} typesets in @sc{FULL-SIZE CAPITALS}. Use full-size capitals
+sparingly.@refill
+@end iftex
+
+You may also use the small caps font for a jargon word such as
+@sc{ato} (a @sc{nasa} word meaning `abort to orbit').@refill
+
+There are subtleties to using the small caps font with a jargon word
+such as @sc{cdr}, a word used in Lisp programming. In this case, you
+should use the small caps font when the word refers to the second and
+subsequent elements of a list (the @sc{cdr} of the list), but you
+should use @samp{@@code} when the word refers to the Lisp function of
+the same spelling.@refill
+
+@node Fonts, Customized Highlighting, Smallcaps, Emphasis
+@comment node-name, next, previous, up
+@subsection Fonts for Printing, Not Info
+@cindex Fonts for printing, not for Info
+@findex i @r{(italic font)}
+@findex b @r{(bold font)}
+@findex t @r{(typewriter font)}
+@findex r @r{(Roman font)}
+
+Texinfo provides four font commands that specify font changes in the
+printed manual but have no effect in the Info file. @code{@@i}
+requests @i{italic} font (in some versions of @TeX{}, a slanted font
+is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the
+@t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a
+@r{roman} font, which is the usual font in which text is printed. All
+four commands apply to an argument that follows, surrounded by
+braces.@refill
+
+Only the @code{@@r} command has much use: in example programs, you
+can use the @code{@@r} command to convert code comments from the
+fixed-width font to a roman font. This looks better in printed
+output.@refill
+
+@need 700
+For example,
+
+@example
+@group
+@@lisp
+(+ 2 2) ; @@r@{Add two plus two.@}
+@@end lisp
+@end group
+@end example
+
+@noindent
+produces
+
+@lisp
+(+ 2 2) ; @r{Add two plus two.}
+@end lisp
+
+If possible, you should avoid using the other three font commands. If
+you need to use one, it probably indicates a gap in the Texinfo
+language.@refill
+
+@node Customized Highlighting, , Fonts, Emphasis
+@comment node-name, next, previous, up
+@subsection Customized Highlighting
+@cindex Highlighting, customized
+@cindex Customized highlighting
+
+@c I think this whole section is obsolete with the advent of macros
+@c --karl, 15sep96.
+You can use regular @TeX{} commands inside of @code{@@iftex} @dots{}
+@code{@@end iftex} to create your own customized highlighting commands
+for Texinfo. The easiest way to do this is to equate your customized
+commands with pre-existing commands, such as those for italics. Such
+new commands work only with @TeX{}.@refill
+
+@findex definfoenclose
+@cindex Enclosure command for Info
+You can use the @code{@@definfoenclose} command inside of
+@code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info
+with the same names as new commands for @TeX{}.
+@code{@@definfoenclose} creates new commands for Info that mark text by
+enclosing it in strings that precede and follow the text.
+@footnote{Currently, @code{@@definfoenclose} works only with
+@code{texinfo-format-buffer} and @code{texinfo-format-region}, not with
+@code{makeinfo}.}@refill
+
+Here is how to create a new @@-command called @code{@@phoo} that causes
+@TeX{} to typeset its argument in italics and causes Info to display the
+argument between @samp{//} and @samp{\\}.@refill
+
+@need 1300
+For @TeX{}, write the following to equate the @code{@@phoo} command with
+the existing @code{@@i} italics command:@refill
+
+@example
+@group
+@@iftex
+@@global@@let@@phoo=@@i
+@@end iftex
+@end group
+@end example
+
+@noindent
+This defines @code{@@phoo} as a command that causes @TeX{} to typeset
+the argument to @code{@@phoo} in italics. @code{@@global@@let} tells
+@TeX{} to equate the next argument with the argument that follows the
+equals sign.
+
+@need 1300
+For Info, write the following to tell the Info formatters to enclose the
+argument between @samp{//} and @samp{\\}:
+
+@example
+@group
+@@ifinfo
+@@definfoenclose phoo, //, \\
+@@end ifinfo
+@end group
+@end example
+
+@noindent
+Write the @code{@@definfoenclose} command on a line and follow it with
+three arguments separated by commas (commas are used as separators in an
+@code{@@node} line in the same way).@refill
+
+@itemize @bullet
+@item
+The first argument to @code{@@definfoenclose} is the @@-command name
+@strong{without} the @samp{@@};
+
+@item
+the second argument is the Info start delimiter string; and,
+
+@item
+the third argument is the Info end delimiter string.
+@end itemize
+
+@noindent
+The latter two arguments enclose the highlighted text in the Info file.
+A delimiter string may contain spaces. Neither the start nor end
+delimiter is required. However, if you do not provide a start
+delimiter, you must follow the command name with two commas in a row;
+otherwise, the Info formatting commands will misinterpret the end
+delimiter string as a start delimiter string.@refill
+
+After you have defined @code{@@phoo} both for @TeX{} and for Info, you
+can then write @code{@@phoo@{bar@}} to see @samp{//bar\\}
+in Info and see
+@ifinfo
+@samp{bar} in italics in printed output.
+@end ifinfo
+@iftex
+@i{bar} in italics in printed output.
+@end iftex
+
+Note that each definition applies to its own formatter: one for @TeX{},
+the other for Info.
+
+@need 1200
+Here is another example:
+
+@example
+@group
+@@ifinfo
+@@definfoenclose headword, , :
+@@end ifinfo
+@@iftex
+@@global@@let@@headword=@@b
+@@end iftex
+@end group
+@end example
+
+@noindent
+This defines @code{@@headword} as an Info formatting command that
+inserts nothing before and a colon after the argument and as a @TeX{}
+formatting command to typeset its argument in bold.
+
+@node Quotations and Examples, Lists and Tables, Marking Text, Top
+@comment node-name, next, previous, up
+@chapter Quotations and Examples
+
+Quotations and examples are blocks of text consisting of one or more
+whole paragraphs that are set off from the bulk of the text and
+treated differently. They are usually indented.@refill
+
+In Texinfo, you always begin a quotation or example by writing an
+@@-command at the beginning of a line by itself, and end it by writing
+an @code{@@end} command that is also at the beginning of a line by
+itself. For instance, you begin an example by writing @code{@@example}
+by itself at the beginning of a line and end the example by writing
+@code{@@end example} on a line by itself, at the beginning of that
+line.@refill
+@findex end
+
+@menu
+* Block Enclosing Commands:: Use different constructs for
+ different purposes.
+* quotation:: How to write a quotation.
+* example:: How to write an example in a fixed-width font.
+* noindent:: How to prevent paragraph indentation.
+* Lisp Example:: How to illustrate Lisp code.
+* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
+* display:: How to write an example in the current font.
+* format:: How to write an example that does not narrow
+ the margins.
+* exdent:: How to undo the indentation of a line.
+* flushleft & flushright:: How to push text flushleft or flushright.
+* cartouche:: How to draw cartouches around examples.
+@end menu
+
+@node Block Enclosing Commands, quotation, Quotations and Examples, Quotations and Examples
+@section The Block Enclosing Commands
+
+Here are commands for quotations and examples:@refill
+
+@table @code
+@item @@quotation
+Indicate text that is quoted. The text is filled, indented, and
+printed in a roman font by default.@refill
+
+@item @@example
+Illustrate code, commands, and the like. The text is printed
+in a fixed-width font, and indented but not filled.@refill
+
+@item @@lisp
+Illustrate Lisp code. The text is printed in a fixed-width font,
+and indented but not filled.@refill
+
+@item @@smallexample
+Illustrate code, commands, and the like. Similar to
+@code{@@example}, except that in @TeX{} this command typesets text in
+a smaller font for the smaller @code{@@smallbook} format than for the
+8.5 by 11 inch format.@refill
+
+@item @@smalllisp
+Illustrate Lisp code. Similar to @code{@@lisp}, except that
+in @TeX{} this command typesets text in a smaller font for the smaller
+@code{@@smallbook} format than for the 8.5 by 11 inch format.@refill
+
+@item @@display
+Display illustrative text. The text is indented but not filled, and
+no font is specified (so, by default, the font is roman).@refill
+
+@item @@format
+Print illustrative text. The text is not indented and not filled
+and no font is specified (so, by default, the font is roman).@refill
+@end table
+
+The @code{@@exdent} command is used within the above constructs to
+undo the indentation of a line.
+
+The @code{@@flushleft} and @code{@@flushright} commands are used to line
+up the left or right margins of unfilled text.@refill
+
+The @code{@@noindent} command may be used after one of the above
+constructs to prevent the following text from being indented as a new
+paragraph.@refill
+
+You can use the @code{@@cartouche} command within one of the above
+constructs to highlight the example or quotation by drawing a box with
+rounded corners around it. (The @code{@@cartouche} command affects
+only the printed manual; it has no effect in the Info file; see
+@ref{cartouche, , Drawing Cartouches Around Examples}.)@refill
+
+@node quotation, example, Block Enclosing Commands, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@quotation}
+@cindex Quotations
+@findex quotation
+
+The text of a quotation is
+processed normally except that:@refill
+
+@itemize @bullet
+@item
+the margins are closer to the center of the page, so the whole of the
+quotation is indented;@refill
+
+@item
+the first lines of paragraphs are indented no more than other
+lines;@refill
+
+@item
+in the printed output, interparagraph spacing is reduced.@refill
+@end itemize
+
+@quotation
+This is an example of text written between an @code{@@quotation}
+command and an @code{@@end quotation} command. An @code{@@quotation}
+command is most often used to indicate text that is excerpted from
+another (real or hypothetical) printed work.@refill
+@end quotation
+
+Write an @code{@@quotation} command as text on a line by itself. This
+line will disappear from the output. Mark the end of the quotation
+with a line beginning with and containing only @code{@@end quotation}.
+The @code{@@end quotation} line will likewise disappear from the
+output. Thus, the following,@refill
+
+@example
+@@quotation
+This is
+a foo.
+@@end quotation
+@end example
+
+@noindent
+produces
+
+@quotation
+This is a foo.
+@end quotation
+
+@node example, noindent, quotation, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@example}
+@cindex Examples, formatting them
+@cindex Formatting examples
+@findex example
+
+The @code{@@example} command is used to indicate an example that is
+not part of the running text, such as computer input or output.@refill
+
+@example
+@group
+This is an example of text written between an
+@code{@@example} command
+and an @code{@@end example} command.
+The text is indented but not filled.
+@end group
+
+@group
+In the printed manual, the text is typeset in a
+fixed-width font, and extra spaces and blank lines are
+significant. In the Info file, an analogous result is
+obtained by indenting each line with five spaces.
+@end group
+@end example
+
+Write an @code{@@example} command at the beginning of a line by itself.
+This line will disappear from the output. Mark the end of the example
+with an @code{@@end example} command, also written at the beginning of a
+line by itself. The @code{@@end example} will disappear from the
+output.@refill
+
+@need 700
+For example,
+
+@example
+@@example
+mv foo bar
+@@end example
+@end example
+
+@noindent
+produces
+
+@example
+mv foo bar
+@end example
+
+Since the lines containing @code{@@example} and @code{@@end example}
+will disappear, you should put a blank line before the
+@code{@@example} and another blank line after the @code{@@end
+example}. (Remember that blank lines between the beginning
+@code{@@example} and the ending @code{@@end example} will appear in
+the output.)@refill
+
+@quotation
+@strong{Caution:} Do not use tabs in the lines of an example (or anywhere
+else in Texinfo, for that matter)! @TeX{} treats tabs as single
+spaces, and that is not what they look like. This is a problem with
+@TeX{}. (If necessary, in Emacs, you can use @kbd{M-x untabify} to
+convert tabs in a region to multiple spaces.)@refill
+@end quotation
+
+Examples are often, logically speaking, ``in the middle'' of a
+paragraph, and the text continues after an example should not be
+indented. The @code{@@noindent} command prevents a piece of text from
+being indented as if it were a new paragraph.
+@ifinfo
+(@xref{noindent}.)
+@end ifinfo
+
+(The @code{@@code} command is used for examples of code that are
+embedded within sentences, not set off from preceding and following
+text. @xref{code, , @code{@@code}}.)
+
+@node noindent, Lisp Example, example, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@noindent}
+@findex noindent
+
+An example or other inclusion can break a paragraph into segments.
+Ordinarily, the formatters indent text that follows an example as a new
+paragraph. However, you can prevent this by writing @code{@@noindent}
+at the beginning of a line by itself preceding the continuation
+text.@refill
+
+@need 1500
+For example:
+
+@example
+@group
+@@example
+This is an example
+@@end example
+
+@@noindent
+This line is not indented. As you can see, the
+beginning of the line is fully flush left with the line
+that follows after it. (This whole example is between
+@@code@{@@@@display@} and @@code@{@@@@end display@}.)
+@end group
+@end example
+
+@noindent
+produces
+
+@display
+@example
+This is an example
+@end example
+@tex
+% Remove extra vskip; this is a kludge to counter the effect of display
+\vskip-3.5\baselineskip
+@end tex
+
+@noindent
+This line is not indented. As you can see, the
+beginning of the line is fully flush left with the line
+that follows after it. (This whole example is between
+@code{@@display} and @code{@@end display}.)
+@end display
+
+To adjust the number of blank lines properly in the Info file output,
+remember that the line containing @code{@@noindent} does not generate a
+blank line, and neither does the @code{@@end example} line.@refill
+
+In the Texinfo source file for this manual, each line that says
+`produces' is preceded by a line containing @code{@@noindent}.@refill
+
+Do not put braces after an @code{@@noindent} command; they are not
+necessary, since @code{@@noindent} is a command used outside of
+paragraphs (@pxref{Command Syntax}).@refill
+
+@node Lisp Example, smallexample & smalllisp, noindent, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@lisp}
+@cindex Lisp example
+@findex lisp
+
+The @code{@@lisp} command is used for Lisp code. It is synonymous
+with the @code{@@example} command.
+
+@lisp
+This is an example of text written between an
+@code{@@lisp} command and an @code{@@end lisp} command.
+@end lisp
+
+Use @code{@@lisp} instead of @code{@@example} so as to preserve
+information regarding the nature of the example. This is useful, for
+example, if you write a function that evaluates only and all the Lisp
+code in a Texinfo file. Then you can use the Texinfo file as a Lisp
+library.@footnote{It would be straightforward to extend Texinfo to
+work in a similar fashion for C, @sc{fortran}, or other languages.}@refill
+
+Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by
+itself.@refill
+
+@node smallexample & smalllisp, display, Lisp Example, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@smallexample} and @code{@@smalllisp}
+@cindex Small book example
+@cindex Example for a small book
+@cindex Lisp example for a small book
+@findex smallexample
+@findex smalllisp
+
+In addition to the regular @code{@@example} and @code{@@lisp} commands,
+Texinfo has two other ``example-style'' commands. These are the
+@code{@@smallexample} and @code{@@smalllisp} commands. Both these
+commands are designed for use with the @code{@@smallbook} command that
+causes @TeX{} to produce a printed manual in a 7 by 9.25 inch format
+rather than the regular 8.5 by 11 inch format.@refill
+
+In @TeX{}, the @code{@@smallexample} and @code{@@smalllisp} commands
+typeset text in a smaller font for the smaller @code{@@smallbook}
+format than for the 8.5 by 11 inch format. Consequently, many examples
+containing long lines fit in a narrower, @code{@@smallbook} page
+without needing to be shortened. Both commands typeset in the normal
+font size when you format for the 8.5 by 11 inch size; indeed,
+in this situation, the @code{@@smallexample} and @code{@@smalllisp}
+commands are defined to be the @code{@@example} and @code{@@lisp}
+commands.@refill
+
+In Info, the @code{@@smallexample} and @code{@@smalllisp} commands are
+equivalent to the @code{@@example} and @code{@@lisp} commands, and work
+exactly the same.@refill
+
+Mark the end of @code{@@smallexample} or @code{@@smalllisp} with
+@code{@@end smallexample} or @code{@@end smalllisp},
+respectively.@refill
+
+@iftex
+Here is an example written in the small font used by the
+@code{@@smallexample} and @code{@@smalllisp} commands:
+
+@ifclear smallbook
+@display
+@tex
+% Remove extra vskip; this is a kludge to counter the effect of display
+\vskip-3\baselineskip
+{\ninett
+\dots{} to make sure that you have the freedom to
+distribute copies of free software (and charge for
+this service if you wish), that you receive source
+code or can get it if you want it, that you can
+change the software or use pieces of it in new free
+programs; and that you know you can do these things.}
+@end tex
+@end display
+@end ifclear
+@end iftex
+@ifset smallbook
+@iftex
+@smallexample
+This is an example of text written between @code{@@smallexample} and
+@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
+this text appears in its normal size; but in a 7 by 9.25 inch manual,
+this text appears in a smaller font.
+@end smallexample
+@end iftex
+@end ifset
+@ifinfo
+@smallexample
+This is an example of text written between @code{@@smallexample} and
+@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
+this text appears in its normal size; but in a 7 by 9.25 inch manual,
+this text appears in a smaller font.
+@end smallexample
+@end ifinfo
+
+The @code{@@smallexample} and @code{@@smalllisp} commands make it
+easier to prepare smaller format manuals without forcing you to edit
+examples by hand to fit them onto narrower pages.@refill
+
+As a general rule, a printed document looks better if you write all the
+examples in a chapter consistently in @code{@@example} or in
+@code{@@smallexample}. Only occasionally should you mix the two
+formats.@refill
+
+@xref{smallbook, , Printing ``Small'' Books}, for more information
+about the @code{@@smallbook} command.@refill
+
+@node display, format, smallexample & smalllisp, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@display}
+@cindex Display formatting
+@findex display
+
+The @code{@@display} command begins a kind of example. It is like the
+@code{@@example} command
+except that, in
+a printed manual, @code{@@display} does not select the fixed-width
+font. In fact, it does not specify the font at all, so that the text
+appears in the same font it would have appeared in without the
+@code{@@display} command.@refill
+
+@display
+This is an example of text written between an @code{@@display} command
+and an @code{@@end display} command. The @code{@@display} command
+indents the text, but does not fill it.
+@end display
+
+@node format, exdent, display, Quotations and Examples
+@comment node-name, next, previous, up
+@section @code{@@format}
+@findex format
+
+The @code{@@format} command is similar to @code{@@example} except
+that, in the printed manual, @code{@@format} does not select the
+fixed-width font and does not narrow the margins.@refill
+
+@format
+This is an example of text written between an @code{@@format} command
+and an @code{@@end format} command. As you can see
+from this example,
+the @code{@@format} command does not fill the text.
+@end format
+
+@node exdent, flushleft & flushright, format, Quotations and Examples
+@section @code{@@exdent}: Undoing a Line's Indentation
+@cindex Indentation undoing
+@findex exdent
+
+The @code{@@exdent} command removes any indentation a line might have.
+The command is written at the beginning of a line and applies only to
+the text that follows the command that is on the same line. Do not use
+braces around the text. In a printed manual, the text on an
+@code{@@exdent} line is printed in the roman font.@refill
+
+@code{@@exdent} is usually used within examples. Thus,@refill
+
+@example
+@group
+@@example
+This line follows an @@@@example command.
+@@exdent This line is exdented.
+This line follows the exdented line.
+The @@@@end example comes on the next line.
+@@end group
+@end group
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This line follows an @@example command.
+@exdent This line is exdented.
+This line follows the exdented line.
+The @@end example comes on the next line.
+@end group
+@end example
+
+In practice, the @code{@@exdent} command is rarely used.
+Usually, you un-indent text by ending the example and
+returning the page to its normal width.@refill
+
+@node flushleft & flushright, cartouche, exdent, Quotations and Examples
+@section @code{@@flushleft} and @code{@@flushright}
+@findex flushleft
+@findex flushright
+
+The @code{@@flushleft} and @code{@@flushright} commands line up the
+ends of lines on the left and right margins of a page,
+but do not fill the text. The commands are written on lines of their
+own, without braces. The @code{@@flushleft} and @code{@@flushright}
+commands are ended by @code{@@end flushleft} and @code{@@end
+flushright} commands on lines of their own.@refill
+
+@need 1500
+For example,
+
+@example
+@group
+@@flushleft
+This text is
+written flushleft.
+@@end flushleft
+@end group
+@end example
+
+@noindent
+produces
+
+@quotation
+@flushleft
+This text is
+written flushleft.
+@end flushleft
+@end quotation
+
+
+Flushright produces the type of indentation often used in the return
+address of letters.@refill
+
+@need 1500
+@noindent
+For example,
+
+@example
+@group
+@@flushright
+Here is an example of text written
+flushright. The @@code@{@@flushright@} command
+right justifies every line but leaves the
+left end ragged.
+@@end flushright
+@end group
+@end example
+
+@noindent
+produces
+
+@flushright
+Here is an example of text written
+flushright. The @code{@@flushright} command
+right justifies every line but leaves the
+left end ragged.
+@end flushright
+
+@node cartouche, , flushleft & flushright, Quotations and Examples
+@section Drawing Cartouches Around Examples
+@findex cartouche
+@cindex Box with rounded corners
+
+In a printed manual, the @code{@@cartouche} command draws a box with
+rounded corners around its contents. You can use this command to
+further highlight an example or quotation. For instance, you could
+write a manual in which one type of example is surrounded by a cartouche
+for emphasis.@refill
+
+The @code{@@cartouche} command affects only the printed manual; it has
+no effect in the Info file.@refill
+
+@need 1500
+For example,
+
+@example
+@group
+@@example
+@@cartouche
+% pwd
+/usr/local/lib/emacs/info
+@@end cartouche
+@@end example
+@end group
+@end example
+
+@noindent
+surrounds the two-line example with a box with rounded corners, in the
+printed manual.
+
+@iftex
+In a printed manual, the example looks like this:@refill
+
+@example
+@group
+@cartouche
+% pwd
+/usr/local/lib/emacs/info
+@end cartouche
+@end group
+@end example
+@end iftex
+
+@node Lists and Tables, Indices, Quotations and Examples, Top
+@comment node-name, next, previous, up
+@chapter Making Lists and Tables
+@cindex Making lists and tables
+@cindex Lists and tables, making them
+@cindex Tables and lists, making them
+
+Texinfo has several ways of making lists and two-column tables. Lists can
+be bulleted or numbered, while two-column tables can highlight the items in
+the first column.@refill
+
+@menu
+* Introducing Lists:: Texinfo formats lists for you.
+* itemize:: How to construct a simple list.
+* enumerate:: How to construct a numbered list.
+* Two-column Tables:: How to construct a two-column table.
+* Multi-column Tables:: How to construct generalized tables.
+@end menu
+
+@ifinfo
+@node Introducing Lists, itemize, Lists and Tables, Lists and Tables
+@heading Introducing Lists
+@end ifinfo
+
+Texinfo automatically indents the text in lists or tables, and numbers
+an enumerated list. This last feature is useful if you modify the
+list, since you do not need to renumber it yourself.@refill
+
+Numbered lists and tables begin with the appropriate @@-command at the
+beginning of a line, and end with the corresponding @code{@@end}
+command on a line by itself. The table and itemized-list commands
+also require that you write formatting information on the same line as
+the beginning @@-command.@refill
+
+Begin an enumerated list, for example, with an @code{@@enumerate}
+command and end the list with an @code{@@end enumerate} command.
+Begin an itemized list with an @code{@@itemize} command, followed on
+the same line by a formatting command such as @code{@@bullet}, and end
+the list with an @code{@@end itemize} command.@refill
+@findex end
+
+Precede each element of a list with an @code{@@item} or @code{@@itemx}
+command.@refill
+
+@sp 1
+@noindent
+Here is an itemized list of the different kinds of table and lists:@refill
+
+@itemize @bullet
+@item
+Itemized lists with and without bullets.
+
+@item
+Enumerated lists, using numbers or letters.
+
+@item
+Two-column tables with highlighting.
+@end itemize
+
+@sp 1
+@noindent
+Here is an enumerated list with the same items:@refill
+
+@enumerate
+@item
+Itemized lists with and without bullets.
+
+@item
+Enumerated lists, using numbers or letters.
+
+@item
+Two-column tables with highlighting.
+@end enumerate
+
+@sp 1
+@noindent
+And here is a two-column table with the same items and their
+@w{@@-commands}:@refill
+
+@table @code
+@item @@itemize
+Itemized lists with and without bullets.
+
+@item @@enumerate
+Enumerated lists, using numbers or letters.
+
+@item @@table
+@itemx @@ftable
+@itemx @@vtable
+Two-column tables with indexing.
+@end table
+
+@node itemize, enumerate, Introducing Lists, Lists and Tables
+@comment node-name, next, previous, up
+@section Making an Itemized List
+@cindex Itemization
+@findex itemize
+
+The @code{@@itemize} command produces sequences of indented
+paragraphs, with a bullet or other mark inside the left margin
+at the beginning of each paragraph for which such a mark is desired.@refill
+
+Begin an itemized list by writing @code{@@itemize} at the beginning of
+a line. Follow the command, on the same line, with a character or a
+Texinfo command that generates a mark. Usually, you will write
+@code{@@bullet} after @code{@@itemize}, but you can use
+@code{@@minus}, or any character or any special symbol that results in
+a single character in the Info file. (When you write @code{@@bullet}
+or @code{@@minus} after an @code{@@itemize} command, you may omit the
+@samp{@{@}}.)@refill
+
+Write the text of the indented paragraphs themselves after the
+@code{@@itemize}, up to another line that says @code{@@end
+itemize}.@refill
+
+Before each paragraph for which a mark in the margin is desired, write
+a line that says just @code{@@item}. Do not write any other text on this
+line.@refill
+@findex item
+
+Usually, you should put a blank line before an @code{@@item}. This
+puts a blank line in the Info file. (@TeX{} inserts the proper
+interline whitespace in either case.) Except when the entries are
+very brief, these blank lines make the list look better.@refill
+
+Here is an example of the use of @code{@@itemize}, followed by the
+output it produces. Note that @code{@@bullet} produces an @samp{*} in
+Info and a round dot in @TeX{}.@refill
+
+@example
+@group
+@@itemize @@bullet
+@@item
+Some text for foo.
+
+@@item
+Some text
+for bar.
+@@end itemize
+@end group
+@end example
+
+@noindent
+This produces:
+
+@quotation
+@itemize @bullet
+@item
+Some text for foo.
+
+@item
+Some text
+for bar.
+@end itemize
+@end quotation
+
+Itemized lists may be embedded within other itemized lists. Here is a
+list marked with dashes embedded in a list marked with bullets:@refill
+
+@example
+@group
+@@itemize @@bullet
+@@item
+First item.
+
+@@itemize @@minus
+@@item
+Inner item.
+
+@@item
+Second inner item.
+@@end itemize
+
+@@item
+Second outer item.
+@@end itemize
+@end group
+@end example
+
+@noindent
+This produces:
+
+@quotation
+@itemize @bullet
+@item
+First item.
+
+@itemize @minus
+@item
+Inner item.
+
+@item
+Second inner item.
+@end itemize
+
+@item
+Second outer item.
+@end itemize
+@end quotation
+
+@node enumerate, Two-column Tables, itemize, Lists and Tables
+@comment node-name, next, previous, up
+@section Making a Numbered or Lettered List
+@cindex Enumeration
+@findex enumerate
+
+@code{@@enumerate} is like @code{@@itemize} except that the marks in
+the left margin contain successive integers or letters.
+(@xref{itemize, , @code{@@itemize}}.)@refill
+
+Write the @code{@@enumerate} command at the beginning of a line.
+The command does not require an argument, but accepts either a number or
+a letter as an option.
+Without an argument, @code{@@enumerate} starts the list
+with the number 1. With a numeric argument, such as 3,
+the command starts the list with that number.
+With an upper or lower case letter, such as @kbd{a} or @kbd{A},
+the command starts the list with that letter.@refill
+
+Write the text of the enumerated list in the same way you write an
+itemized list: put @code{@@item} on a line of its own before the start of
+each paragraph that you want enumerated. Do not write any other text on
+the line beginning with @code{@@item}.@refill
+
+You should put a blank line between entries in the list.
+This generally makes it easier to read the Info file.@refill
+
+@need 1500
+Here is an example of @code{@@enumerate} without an argument:@refill
+
+@example
+@group
+@@enumerate
+@@item
+Underlying causes.
+
+@@item
+Proximate causes.
+@@end enumerate
+@end group
+@end example
+
+@noindent
+This produces:
+
+@enumerate
+@item
+Underlying causes.
+
+@item
+Proximate causes.
+@end enumerate
+@sp 1
+Here is an example with an argument of @kbd{3}:@refill
+@sp 1
+@example
+@group
+@@enumerate 3
+@@item
+Predisposing causes.
+
+@@item
+Precipitating causes.
+
+@@item
+Perpetuating causes.
+@@end enumerate
+@end group
+@end example
+
+@noindent
+This produces:
+
+@enumerate 3
+@item
+Predisposing causes.
+
+@item
+Precipitating causes.
+
+@item
+Perpetuating causes.
+@end enumerate
+@sp 1
+Here is a brief summary of the alternatives. The summary is constructed
+using @code{@@enumerate} with an argument of @kbd{a}.@refill
+@sp 1
+@enumerate a
+@item
+@code{@@enumerate}
+
+Without an argument, produce a numbered list, starting with the number
+1.@refill
+
+@item
+@code{@@enumerate @var{positive-integer}}
+
+With a (positive) numeric argument, start a numbered list with that
+number. You can use this to continue a list that you interrupted with
+other text.@refill
+
+@item
+@code{@@enumerate @var{upper-case-letter}}
+
+With an upper case letter as argument, start a list
+in which each item is marked
+by a letter, beginning with that upper case letter.@refill
+
+@item
+@code{@@enumerate @var{lower-case-letter}}
+
+With a lower case letter as argument, start a list
+in which each item is marked by
+a letter, beginning with that lower case letter.@refill
+@end enumerate
+
+You can also nest enumerated lists, as in an outline.@refill
+
+@node Two-column Tables, Multi-column Tables, enumerate, Lists and Tables
+@section Making a Two-column Table
+@cindex Tables, making two-column
+@findex table
+
+@code{@@table} is similar to @code{@@itemize}, but the command allows
+you to specify a name or heading line for each item. (@xref{itemize,
+, @code{@@itemize}}.) The @code{@@table} command is used to produce
+two-column tables, and is especially useful for glossaries and
+explanatory exhibits.@refill
+
+@menu
+* table:: How to construct a two-column table.
+* ftable vtable:: How to construct a two-column table
+ with automatic indexing.
+* itemx:: How to put more entries in the first column.
+@end menu
+
+@ifinfo
+@node table, ftable vtable, Two-column Tables, Two-column Tables
+@subheading Using the @code{@@table} Command
+
+Use the @code{@@table} command to produce two-column tables.@refill
+@end ifinfo
+
+Write the @code{@@table} command at the beginning of a line and follow
+it on the same line with an argument that is a Texinfo command such as
+@code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd}.
+Although these commands are usually followed by arguments in braces,
+in this case you use the command name without an argument because
+@code{@@item} will supply the argument. This command will be applied
+to the text that goes into the first column of each item and
+determines how it will be highlighted. For example, @code{@@samp}
+will cause the text in the first column to be highlighted with an
+@code{@@samp} command.@refill
+
+You may also choose to use the @code{@@asis} command as an argument to
+@code{@@table}. @code{@@asis} is a command that does nothing; if you use this
+command after @code{@@table}, @TeX{} and the Info formatting commands
+output the first column entries without added highlighting (`as
+is').@refill
+
+(The @code{@@table} command may work with other commands besides those
+listed here. However, you can only use commands
+that normally take arguments in braces.)@refill
+
+Begin each table entry with an @code{@@item} command at the beginning
+of a line. Write the first column text on the same line as the
+@code{@@item} command. Write the second column text on the line
+following the @code{@@item} line and on subsequent lines. (You do not
+need to type anything for an empty second column entry.) You may
+write as many lines of supporting text as you wish, even several
+paragraphs. But only text on the same line as the @code{@@item} will
+be placed in the first column.@refill
+@findex item
+
+Normally, you should put a blank line before an @code{@@item} line.
+This puts a blank like in the Info file. Except when the entries are
+very brief, a blank line looks better.@refill
+
+@need 1500
+The following table, for example, highlights the text in the first
+column with an @code{@@samp} command:@refill
+
+@example
+@group
+@@table @@samp
+@@item foo
+This is the text for
+@@samp@{foo@}.
+
+@@item bar
+Text for @@samp@{bar@}.
+@@end table
+@end group
+@end example
+
+@noindent
+This produces:
+
+@table @samp
+@item foo
+This is the text for
+@samp{foo}.
+@item bar
+Text for @samp{bar}.
+@end table
+
+If you want to list two or more named items with a single block of
+text, use the @code{@@itemx} command. (@xref{itemx, ,
+@code{@@itemx}}.)@refill
+
+@node ftable vtable, itemx, table, Two-column Tables
+@comment node-name, next, previous, up
+@subsection @code{@@ftable} and @code{@@vtable}
+@cindex Tables with indexes
+@cindex Indexing table entries automatically
+@findex ftable
+@findex vtable
+
+The @code{@@ftable} and @code{@@vtable} commands are the same as the
+@code{@@table} command except that @code{@@ftable} automatically enters
+each of the items in the first column of the table into the index of
+functions and @code{@@vtable} automatically enters each of the items in
+the first column of the table into the index of variables. This
+simplifies the task of creating indices. Only the items on the same
+line as the @code{@@item} commands are indexed, and they are indexed in
+exactly the form that they appear on that line. @xref{Indices, ,
+Creating Indices}, for more information about indices.@refill
+
+Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
+writing the @@-command at the beginning of a line, followed on the same
+line by an argument that is a Texinfo command such as @code{@@code},
+exactly as you would for an @code{@@table} command; and end the table
+with an @code{@@end ftable} or @code{@@end vtable} command on a line by
+itself.
+
+See the example for @code{@@table} in the previous section.
+
+@node itemx, , ftable vtable, Two-column Tables
+@comment node-name, next, previous, up
+@subsection @code{@@itemx}
+@cindex Two named items for @code{@@table}
+@findex itemx
+
+Use the @code{@@itemx} command inside a table when you have two or
+more first column entries for the same item, each of which should
+appear on a line of its own. Use @code{@@itemx} for all but the first
+entry. The @code{@@itemx} command works exactly like @code{@@item}
+except that it does not generate extra vertical space above the first
+column text.@refill
+
+@need 1000
+For example,
+
+@example
+@group
+@@table @@code
+@@item upcase
+@@itemx downcase
+These two functions accept a character or a string as
+argument, and return the corresponding upper case (lower
+case) character or string.
+@@end table
+@end group
+@end example
+
+@noindent
+This produces:
+
+@table @code
+@item upcase
+@itemx downcase
+These two functions accept a character or a string as
+argument, and return the corresponding upper case (lower
+case) character or string.@refill
+@end table
+
+@noindent
+(Note also that this example illustrates multi-line supporting text in
+a two-column table.)@refill
+
+
+@node Multi-column Tables, , Two-column Tables, Lists and Tables
+@section Multi-column Tables
+@cindex Tables, making multi-column
+@findex multitable
+
+@code{@@multitable} allows you to construct tables with any number of
+columns, with each column having any width you like.
+
+You define the column widths on the @code{@@multitable} line itself, and
+write each row of the actual table following an @code{@@item} command,
+with columns separated by an @code{@@tab} command. Finally, @code{@@end
+multitable} completes the table. Details in the sections below.
+
+@menu
+* Multitable Column Widths:: Defining multitable column widths.
+* Multitable Rows:: Defining multitable rows, with examples.
+@end menu
+
+@node Multitable Column Widths, Multitable Rows, Multi-column Tables, Multi-column Tables
+@subsection Multitable Column Widths
+@cindex Multitable column widths
+@cindex Column widths, defining for multitables
+@cindex Widths, defining multitable column
+
+You can define the column widths for a multitable in two ways: as
+fractions of the line length; or with a prototype row. Mixing the two
+methods is not supported. In either case, the widths are defined
+entirely on the same line as the @code{@@multitable} command.
+
+@enumerate
+@item
+@findex columnfractions
+@cindex Line length, column widths as fraction of
+To specify column widths as fractions of the line length, write
+@code{@@columnfractions} and the decimal numbers (presumably less than
+1) after the @code{@@multitable} command, as in:
+
+@example
+@@multitable @@columnfractions .33 .33 .33
+@end example
+
+@noindent The fractions need not add up exactly to 1.0, as these do
+not. This allows you to produce tables that do not need the full line
+length.
+
+@item
+@cindex Prototype row, column widths defined by
+To specify a prototype row, write the longest entry for each column
+enclosed in braces after the @code{@@multitable} command. For example:
+
+@example
+@@multitable @{some text for column one@} @{for column two@}
+@end example
+
+@noindent
+The first column will then have the width of the typeset `some text for
+column one', and the second column the width of `for column two'.
+
+The prototype entries need not appear in the table itself.
+
+Although we used simple text in this example, the prototype entries can
+contain Texinfo commands; markup commands such as @code{@@code} are
+particularly likely to be useful.
+
+@end enumerate
+
+
+@node Multitable Rows, , Multitable Column Widths, Multi-column Tables
+@subsection Multitable Rows
+@cindex Multitable rows
+@cindex Rows, of a multitable
+
+@findex item
+@cindex tab
+After the @code{@@multitable} command defining the column widths (see
+the previous section), you begin each row in the body of a multitable
+with @code{@@item}, and separate the column entries with @code{@@tab}.
+Line breaks are not special within the table body, and you may break
+input lines in your source file as necessary.
+
+Here is a complete example of a multi-column table (the text is from
+the GNU Emacs manual):
+
+@example
+@@multitable @@columnfractions .15 .45 .4
+@@item Key @@tab Command @@tab Description
+@@item C-x 2
+@@tab @@code@{split-window-vertically@}
+@@tab Split the selected window into two windows,
+with one above the other.
+@@item C-x 3
+@@tab @@code@{split-window-horizontally@}
+@@tab Split the selected window into two windows
+positioned side by side.
+@@item C-Mouse-2
+@@tab
+@@tab In the mode line or scroll bar of a window,
+split that window.
+@@end multitable
+@end example
+
+@noindent produces:
+
+@multitable @columnfractions .15 .45 .4
+@item Key @tab Command @tab Description
+@item C-x 2
+@tab @code{split-window-vertically}
+@tab Split the selected window into two windows,
+with one above the other.
+@item C-x 3
+@tab @code{split-window-horizontally}
+@tab Split the selected window into two windows
+positioned side by side.
+@item C-Mouse-2
+@tab
+@tab In the mode line or scroll bar of a window,
+split that window.
+@end multitable
+
+
+@node Indices, Insertions, Lists and Tables, Top
+@comment node-name, next, previous, up
+@chapter Creating Indices
+@cindex Indices
+@cindex Creating indices
+
+Using Texinfo, you can generate indices without having to sort and
+collate entries manually. In an index, the entries are listed in
+alphabetical order, together with information on how to find the
+discussion of each entry. In a printed manual, this information
+consists of page numbers. In an Info file, this information is a menu
+entry leading to the first node referenced.@refill
+
+Texinfo provides several predefined kinds of index: an index
+for functions, an index for variables, an index for concepts, and so
+on. You can combine indices or use them for other than their
+canonical purpose. If you wish, you can define your own indices.@refill
+
+@menu
+* Index Entries:: Choose different words for index entries.
+* Predefined Indices:: Use different indices for different kinds
+ of entry.
+* Indexing Commands:: How to make an index entry.
+* Combining Indices:: How to combine indices.
+* New Indices:: How to define your own indices.
+@end menu
+
+@node Index Entries, Predefined Indices, Indices, Indices
+@comment node-name, next, previous, up
+@section Making Index Entries
+@cindex Index entries, making
+@cindex Entries, making index
+
+When you are making index entries, it is good practice to think of the
+different ways people may look for something. Different people
+@emph{do not} think of the same words when they look something up. A
+helpful index will have items indexed under all the different words
+that people may use. For example, one reader may think it obvious that
+the two-letter names for indices should be listed under ``Indices,
+two-letter names'', since the word ``Index'' is the general concept.
+But another reader may remember the specific concept of two-letter
+names and search for the entry listed as ``Two letter names for
+indices''. A good index will have both entries and will help both
+readers.@refill
+
+Like typesetting, the construction of an index is a highly skilled,
+professional art, the subtleties of which are not appreciated until you
+need to do it yourself.@refill
+
+@xref{Printing Indices & Menus}, for information about printing an index
+at the end of a book or creating an index menu in an Info file.@refill
+
+@node Predefined Indices, Indexing Commands, Index Entries, Indices
+@comment node-name, next, previous, up
+@section Predefined Indices
+
+Texinfo provides six predefined indices:@refill
+
+@itemize @bullet
+@item
+A @dfn{concept index} listing concepts that are discussed.@refill
+
+@item
+A @dfn{function index} listing functions (such as entry points of
+libraries).@refill
+
+@item
+A @dfn{variables index} listing variables (such as global variables
+of libraries).@refill
+
+@item
+A @dfn{keystroke index} listing keyboard commands.@refill
+
+@item
+A @dfn{program index} listing names of programs.@refill
+
+@item
+A @dfn{data type index} listing data types (such as structures defined in
+header files).@refill
+@end itemize
+
+@noindent
+Not every manual needs all of these, and most manuals use two or three
+of them. This manual has two indices: a
+concept index and an @@-command index (that is actually the function
+index but is called a command index in the chapter heading). Two or
+more indices can be combined into one using the @code{@@synindex} or
+@code{@@syncodeindex} commands. @xref{Combining Indices}.@refill
+
+@node Indexing Commands, Combining Indices, Predefined Indices, Indices
+@comment node-name, next, previous, up
+@section Defining the Entries of an Index
+@cindex Defining indexing entries
+@cindex Index entries
+@cindex Entries for an index
+@cindex Specifying index entries
+@cindex Creating index entries
+
+The data to make an index come from many individual indexing commands
+scattered throughout the Texinfo source file. Each command says to add
+one entry to a particular index; after formatting, the index will give
+the current page number or node name as the reference.@refill
+
+An index entry consists of an indexing command at the beginning of a
+line followed, on the rest of the line, by the entry.@refill
+
+For example, this section begins with the following five entries for
+the concept index:@refill
+
+@example
+@@cindex Defining indexing entries
+@@cindex Index entries
+@@cindex Entries for an index
+@@cindex Specifying index entries
+@@cindex Creating index entries
+@end example
+
+Each predefined index has its own indexing command---@code{@@cindex}
+for the concept index, @code{@@findex} for the function index, and so
+on.@refill
+
+@cindex Writing index entries
+@cindex Index entry writing
+Concept index entries consist of text. The best way to write an index
+is to choose entries that are terse yet clear. If you can do this,
+the index often looks better if the entries are not capitalized, but
+written just as they would appear in the middle of a sentence.
+(Capitalize proper names and acronyms that always call for upper case
+letters.) This is the case convention we use in most GNU manuals'
+indices.
+
+If you don't see how to make an entry terse yet clear, make it longer
+and clear---not terse and confusing. If many of the entries are several
+words long, the index may look better if you use a different convention:
+to capitalize the first word of each entry. But do not capitalize a
+case-sensitive name such as a C or Lisp function name or a shell
+command; that would be a spelling error.
+
+Whichever case convention you use, please use it consistently!
+
+@ignore
+Concept index entries consist of English text. The usual convention
+is to capitalize the first word of each such index entry, unless that
+word is the name of a function, variable, or other such entity that
+should not be capitalized. However, if your concept index entries are
+consistently short (one or two words each) it may look better for each
+regular entry to start with a lower case letter, aside from proper
+names and acronyms that always call for upper case letters. Whichever
+convention you adapt, please be consistent!
+@end ignore
+
+Entries in indices other than the concept index are symbol names in
+programming languages, or program names; these names are usually
+case-sensitive, so use upper and lower case as required for them.
+
+By default, entries for a concept index are printed in a small roman
+font and entries for the other indices are printed in a small
+@code{@@code} font. You may change the way part of an entry is
+printed with the usual Texinfo commands, such as @code{@@file} for
+file names and @code{@@emph} for emphasis (@pxref{Marking
+Text}).@refill
+@cindex Index font types
+
+@cindex Predefined indexing commands
+@cindex Indexing commands, predefined
+The six indexing commands for predefined indices are:
+
+@table @code
+@item @@cindex @var{concept}
+@findex cindex
+Make an entry in the concept index for @var{concept}.@refill
+
+@item @@findex @var{function}
+@findex findex
+Make an entry in the function index for @var{function}.@refill
+
+@item @@vindex @var{variable}
+@findex vindex
+Make an entry in the variable index for @var{variable}.@refill
+
+@item @@kindex @var{keystroke}
+@findex kindex
+Make an entry in the key index for @var{keystroke}.@refill
+
+@item @@pindex @var{program}
+@findex pindex
+Make an entry in the program index for @var{program}.@refill
+
+@item @@tindex @var{data type}
+@findex tindex
+Make an entry in the data type index for @var{data type}.@refill
+@end table
+
+@quotation
+@strong{Caution:} Do not use a colon in an index entry. In Info, a
+colon separates the menu entry name from the node name. An extra
+colon confuses Info.
+@xref{Menu Parts, , The Parts of a Menu},
+for more information about the structure of a menu entry.@refill
+@end quotation
+
+If you write several identical index entries in different places in a
+Texinfo file, the index in the printed manual will list all the pages to
+which those entries refer. However, the index in the Info file will
+list @strong{only} the node that references the @strong{first} of those
+index entries. Therefore, it is best to write indices in which each
+entry refers to only one place in the Texinfo file. Fortunately, this
+constraint is a feature rather than a loss since it means that the index
+will be easy to use. Otherwise, you could create an index that lists
+several pages for one entry and your reader would not know to which page
+to turn. If you have two identical entries for one topic, change the
+topics slightly, or qualify them to indicate the difference.@refill
+
+You are not actually required to use the predefined indices for their
+canonical purposes. For example, suppose you wish to index some C
+preprocessor macros. You could put them in the function index along
+with actual functions, just by writing @code{@@findex} commands for
+them; then, when you print the ``Function Index'' as an unnumbered
+chapter, you could give it the title `Function and Macro Index' and
+all will be consistent for the reader. Or you could put the macros in
+with the data types by writing @code{@@tindex} commands for them, and
+give that index a suitable title so the reader will understand.
+(@xref{Printing Indices & Menus}.)@refill
+
+@node Combining Indices, New Indices, Indexing Commands, Indices
+@comment node-name, next, previous, up
+@section Combining Indices
+@cindex Combining indices
+@cindex Indices, combining them
+
+Sometimes you will want to combine two disparate indices such as functions
+and concepts, perhaps because you have few enough of one of them that
+a separate index for them would look silly.@refill
+
+You could put functions into the concept index by writing
+@code{@@cindex} commands for them instead of @code{@@findex} commands,
+and produce a consistent manual by printing the concept index with the
+title `Function and Concept Index' and not printing the `Function
+Index' at all; but this is not a robust procedure. It works only if
+your document is never included as part of another
+document that is designed to have a separate function index; if your
+document were to be included with such a document, the functions from
+your document and those from the other would not end up together.
+Also, to make your function names appear in the right font in the
+concept index, you would need to enclose every one of them between
+the braces of @code{@@code}.@refill
+
+@menu
+* syncodeindex:: How to merge two indices, using @code{@@code}
+ font for the merged-from index.
+* synindex:: How to merge two indices, using the
+ default font of the merged-to index.
+@end menu
+
+@node syncodeindex, synindex, Combining Indices, Combining Indices
+@subsection @code{@@syncodeindex}
+@findex syncodeindex
+
+When you want to combine functions and concepts into one index, you
+should index the functions with @code{@@findex} and index the concepts
+with @code{@@cindex}, and use the @code{@@syncodeindex} command to
+redirect the function index entries into the concept index.@refill
+@findex syncodeindex
+
+The @code{@@syncodeindex} command takes two arguments; they are the name
+of the index to redirect, and the name of the index to redirect it to.
+The template looks like this:@refill
+
+@example
+@@syncodeindex @var{from} @var{to}
+@end example
+
+@cindex Predefined names for indices
+@cindex Two letter names for indices
+@cindex Indices, two letter names
+@cindex Names for indices
+For this purpose, the indices are given two-letter names:@refill
+
+@table @samp
+@item cp
+concept index
+@item fn
+function index
+@item vr
+variable index
+@item ky
+key index
+@item pg
+program index
+@item tp
+data type index
+@end table
+
+Write an @code{@@syncodeindex} command before or shortly after the
+end-of-header line at the beginning of a Texinfo file. For example,
+to merge a function index with a concept index, write the
+following:@refill
+
+@example
+@@syncodeindex fn cp
+@end example
+
+@noindent
+This will cause all entries designated for the function index to merge
+in with the concept index instead.@refill
+
+To merge both a variables index and a function index into a concept
+index, write the following:@refill
+
+@example
+@group
+@@syncodeindex vr cp
+@@syncodeindex fn cp
+@end group
+@end example
+
+@cindex Fonts for indices
+The @code{@@syncodeindex} command puts all the entries from the `from'
+index (the redirected index) into the @code{@@code} font, overriding
+whatever default font is used by the index to which the entries are
+now directed. This way, if you direct function names from a function
+index into a concept index, all the function names are printed in the
+@code{@@code} font as you would expect.@refill
+
+@node synindex, , syncodeindex, Combining Indices
+@subsection @code{@@synindex}
+@findex synindex
+
+The @code{@@synindex} command is nearly the same as the
+@code{@@syncodeindex} command, except that it does not put the
+`from' index entries into the @code{@@code} font; rather it puts
+them in the roman font. Thus, you use @code{@@synindex} when you
+merge a concept index into a function index.@refill
+
+@xref{Printing Indices & Menus}, for information about printing an index
+at the end of a book or creating an index menu in an Info file.@refill
+
+@node New Indices, , Combining Indices, Indices
+@section Defining New Indices
+@cindex Defining new indices
+@cindex Indices, defining new
+@cindex New index defining
+@findex defindex
+@findex defcodeindex
+
+In addition to the predefined indices, you may use the
+@code{@@defindex} and @code{@@defcodeindex} commands to define new
+indices. These commands create new indexing @@-commands with which
+you mark index entries. The @code{@@defindex }command is used like
+this:@refill
+
+@example
+@@defindex @var{name}
+@end example
+
+The name of an index should be a two letter word, such as @samp{au}.
+For example:@refill
+
+@example
+@@defindex au
+@end example
+
+This defines a new index, called the @samp{au} index. At the same
+time, it creates a new indexing command, @code{@@auindex}, that you
+can use to make index entries. Use the new indexing command just as
+you would use a predefined indexing command.@refill
+
+For example, here is a section heading followed by a concept index
+entry and two @samp{au} index entries.@refill
+
+@example
+@@section Cognitive Semantics
+@@cindex kinesthetic image schemas
+@@auindex Johnson, Mark
+@@auindex Lakoff, George
+@end example
+
+@noindent
+(Evidently, @samp{au} serves here as an abbreviation for ``author''.)
+Texinfo constructs the new indexing command by concatenating the name
+of the index with @samp{index}; thus, defining an @samp{au} index
+leads to the automatic creation of an @code{@@auindex} command.@refill
+
+Use the @code{@@printindex} command to print the index, as you do with
+the predefined indices. For example:@refill
+
+@example
+@group
+@@node Author Index, Subject Index, , Top
+@@unnumbered Author Index
+
+@@printindex au
+@end group
+@end example
+
+The @code{@@defcodeindex} is like the @code{@@defindex} command, except
+that, in the printed output, it prints entries in an @code{@@code} font
+instead of a roman font. Thus, it parallels the @code{@@findex} command
+rather than the @code{@@cindex} command.@refill
+
+You should define new indices within or right after the end-of-header
+line of a Texinfo file, before any @code{@@synindex} or
+@code{@@syncodeindex} commands (@pxref{Header}).@refill
+
+@node Insertions, Glyphs, Indices, Top
+@comment node-name, next, previous, up
+@chapter Special Insertions
+@cindex Inserting special characters and symbols
+@cindex Special insertions
+
+Texinfo provides several commands for formatting dimensions, for
+inserting single characters that have special meaning in Texinfo, such
+as braces, and for inserting special graphic symbols that do not
+correspond to characters, such as dots and bullets.@refill
+
+@iftex
+These are:
+
+@itemize @bullet
+@item
+Braces, @samp{@@} and periods.
+
+@item
+Format a dimension, such as @samp{12@dmn{pt}}.
+
+@item
+Dots and bullets.
+
+@item
+The @TeX{} logo and the copyright symbol.
+
+@item
+A minus sign.
+@end itemize
+@end iftex
+
+@menu
+* Braces Atsigns:: How to insert braces, @samp{@@}.
+* Inserting Space:: How to insert the right amount of space
+ within a sentence.
+* Inserting Accents:: How to insert accents and special characters.
+* Dots Bullets:: How to insert dots and bullets.
+* TeX and copyright:: How to insert the @TeX{} logo
+ and the copyright symbol.
+* pounds:: How to insert the pounds currency symbol.
+* minus:: How to insert a minus sign.
+* math:: How to format a mathematical expression.
+@end menu
+
+
+@node Braces Atsigns, Inserting Space, Insertions, Insertions
+@section Inserting @@ and Braces
+@cindex Inserting @@, braces
+@cindex Braces, inserting
+@cindex Special characters, commands to insert
+@cindex Commands to insert special characters
+
+@samp{@@} and curly braces are special characters in Texinfo. To insert
+these characters so they appear in text, you must put an @samp{@@} in
+front of these characters to prevent Texinfo from misinterpreting
+them.
+
+Do not put braces after any of these commands; they are not
+necessary.
+
+@menu
+* Inserting An Atsign:: How to insert @samp{@@}.
+* Inserting Braces:: How to insert @samp{@{} and @samp{@}}.
+@end menu
+
+@node Inserting An Atsign, Inserting Braces, Braces Atsigns, Braces Atsigns
+@subsection Inserting @samp{@@} with @@@@
+@findex @@ @r{(single @samp{@@})}
+
+@code{@@@@} stands for a single @samp{@@} in either printed or Info
+output.
+
+Do not put braces after an @code{@@@@} command.
+
+@node Inserting Braces, , Inserting An Atsign, Braces Atsigns
+@subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@}
+@findex @{ @r{(single @samp{@{})}
+@findex @} @r{(single @samp{@}})}
+
+@code{@@@{} stands for a single @samp{@{} in either printed or Info
+output.
+
+@code{@@@}} stands for a single @samp{@}} in either printed or Info
+output.
+
+Do not put braces after either an @code{@@@{} or an @code{@@@}}
+command.
+
+
+@node Inserting Space, Inserting Accents, Braces Atsigns, Insertions
+@section Inserting Space
+
+@cindex Inserting space
+@cindex Spacing, inserting
+@cindex Whitespace, inserting
+The following sections describe commands that control spacing of various
+kinds within and after sentences.
+
+@menu
+* Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
+* Ending a Sentence:: Sometimes it does.
+* Multiple Spaces:: Inserting multiple spaces.
+* dmn:: How to format a dimension.
+@end menu
+
+@node Not Ending a Sentence, Ending a Sentence, Inserting Space, Inserting Space
+@subsection Not Ending a Sentence
+
+@cindex Not ending a sentence
+@cindex Sentence non-ending punctuation
+@cindex Periods, inserting
+Depending on whether a period or exclamation point or question mark is
+inside or at the end of a sentence, less or more space is inserted after
+a period in a typeset manual. Since it is not always possible for
+Texinfo to determine when a period ends a sentence and when it is used
+in an abbreviation, special commands are needed in some circumstances.
+(Usually, Texinfo can guess how to handle periods, so you do not need to
+use the special commands; you just enter a period as you would if you
+were using a typewriter, which means you put two spaces after the
+period, question mark, or exclamation mark that ends a sentence.)
+
+@findex : @r{(suppress widening)}
+Use the @code{@@:}@: command after a period, question mark,
+exclamation mark, or colon that should not be followed by extra space.
+For example, use @code{@@:}@: after periods that end abbreviations
+which are not at the ends of sentences. @code{@@:}@: has no effect on
+the Info file output.
+
+@need 700
+For example,
+
+@example
+The s.o.p.@@: has three parts @dots{}
+The s.o.p. has three parts @dots{}
+@end example
+
+@noindent
+@ifinfo
+produces
+@end ifinfo
+@iftex
+produces the following. If you look carefully at this printed output,
+you will see a little more whitespace after @samp{s.o.p.} in the second
+line.@refill
+@end iftex
+
+@quotation
+The s.o.p.@: has three parts @dots{}@*
+The s.o.p. has three parts @dots{}
+@end quotation
+
+@noindent
+@kbd{@@:} has no effect on the Info output. (@samp{s.o.p.} is an
+abbreviation for ``Standard Operating Procedure''.)
+
+Do not put braces after @code{@@:}.
+
+
+@node Ending a Sentence, Multiple Spaces, Not Ending a Sentence, Inserting Space
+@subsection Ending a Sentence
+
+@cindex Ending a Sentence
+@cindex Sentence ending punctuation
+
+@findex . @r{(end of sentence)}
+@findex ! @r{(end of sentence)}
+@findex ? @r{(end of sentence)}
+Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an
+exclamation point, and @code{@@?}@: instead of a question mark at the end
+of a sentence that ends with a single capital letter. Otherwise, @TeX{}
+will think the letter is an abbreviation and will not insert the correct
+end-of-sentence spacing. Here is an example:
+
+@example
+Give it to M.I.B. and to M.E.W@@. Also, give it to R.J.C@@.
+Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
+@end example
+
+@noindent
+@ifinfo
+produces
+@end ifinfo
+@iftex
+produces the following. If you look carefully at this printed output,
+you will see a little more whitespace after the @samp{W} in the first
+line.
+@end iftex
+
+@quotation
+Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@.@*
+Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
+@end quotation
+
+In the Info file output, @code{@@.}@: is equivalent to a simple
+@samp{.}; likewise for @code{@@!}@: and @code{@@?}@:.
+
+The meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to
+work well with the Emacs sentence motion commands (@pxref{Sentences,,,
+emacs, GNU Emacs}). This made it necessary for them to be incompatible
+with some other formatting systems that use @@-commands.
+
+Do not put braces after any of these commands.
+
+
+@node Multiple Spaces, dmn, Ending a Sentence, Inserting Space
+@subsection Multiple Spaces
+
+@cindex Multiple spaces
+@cindex Whitespace, inserting
+@findex (space)
+@findex (tab)
+@findex (newline)
+
+Ordinarily, @TeX{} collapses multiple whitespace characters (space, tab,
+and newline) into a single space. (Info output, on the other hand,
+preserves whitespace as you type it, except for changing a newline into
+a space; this is why it is important to put two spaces at the end of
+sentences in Texinfo documents.)
+
+Occasionally, you may want to actually insert several consecutive
+spaces, either for purposes of example (what your program does with
+multiple spaces as input), or merely for purposes of appearance in
+headings or lists. Texinfo supports three commands: @code{@@ },
+@code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of which insert a single
+space into the output. (Here, @kbd{TAB} and @kbd{NL} represent the tab
+character and end-of-line, i.e., when @samp{@@} is the last character on
+a line.)
+
+For example,
+@example
+Spacey@@ @@ @@ @@
+example.
+@end example
+
+@noindent produces
+
+@example
+Spacey@ @ @ @
+example.
+@end example
+
+Other possible uses of @code{@@ } have been subsumed by @code{@@multitable}
+(@pxref{Multi-column Tables}).
+
+Do not follow any of these commands with braces.
+
+
+@node dmn, , Multiple Spaces, Inserting Space
+@subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
+@cindex Thin space between number, dimension
+@cindex Dimension formatting
+@cindex Format a dimension
+@findex dmn
+
+At times, you may want to write @samp{12@dmn{pt}} or
+@samp{8.5@dmn{in}} with little or no space between the number and the
+abbreviation for the dimension. You can use the @code{@@dmn} command
+to do this. On seeing the command, @TeX{} inserts just enough space
+for proper typesetting; the Info formatting commands insert no space
+at all, since the Info file does not require it.@refill
+
+To use the @code{@@dmn} command, write the number and then follow it
+immediately, with no intervening space, by @code{@@dmn}, and then by
+the dimension within braces.@refill
+
+@need 700
+@noindent
+For example,
+
+@example
+A4 paper is 8.27@@dmn@{in@} wide.
+@end example
+
+@noindent
+produces
+
+@quotation
+A4 paper is 8.27@dmn{in} wide.
+@end quotation
+
+Not everyone uses this style. Instead of writing
+@w{@samp{8.27@@dmn@{in@}}} in the Texinfo file, you may write
+@w{@samp{8.27 in.}} or @w{@samp{8.27 inches}}. (In these cases, the
+formatters may insert a line break between the number and the
+dimension. Also, if you write a period after an abbreviation within a
+sentence, you should write @samp{@@:} after the period to prevent
+@TeX{} from inserting extra whitespace. @xref{Inserting Space}.
+
+
+@node Inserting Accents, Dots Bullets, Inserting Space, Insertions
+@section Inserting Accents
+
+@cindex Inserting accents
+@cindex Accents, inserting
+@cindex Floating accents, inserting
+
+Here is a table with the commands Texinfo provides for inserting
+floating accents. The commands with non-alphabetic names do not take
+braces around their argument (which is taken to be the next character).
+(Exception: @code{@@,} @emph{does} take braces around its argument.)
+This is so as to make the source as convenient to type and read as
+possible, since accented characters are very common in some languages.
+
+@findex "
+@cindex Umlaut accent
+@findex '
+@cindex Acute accent
+@findex =
+@cindex Macron accent
+@findex ^
+@cindex Circumflex accent
+@findex `
+@cindex Grave accent
+@findex ~
+@cindex Tilde accent
+@findex ,
+@cindex Cedilla accent
+@findex dotaccent
+@cindex Dot accent
+@findex H
+@cindex Hungariam umlaut accent
+@findex ringaccent
+@cindex Ring accent
+@findex tieaccent
+@cindex Tie-after accent
+@findex u
+@cindex Breve accent
+@findex ubaraccent
+@cindex Underbar accent
+@findex udotaccent
+@cindex Underdot accent
+@findex v
+@cindex Check accent
+@multitable {@@questiondown@{@}} {Output} {macron/overbar accent}
+@item Command @tab Output @tab What
+@item @t{@@"o} @tab @"o @tab umlaut accent
+@item @t{@@'o} @tab @'o @tab acute accent
+@item @t{@@,@{c@}} @tab @,{c} @tab cedilla accent
+@item @t{@@=o} @tab @=o @tab macron/overbar accent
+@item @t{@@^o} @tab @^o @tab circumflex accent
+@item @t{@@`o} @tab @`o @tab grave accent
+@item @t{@@~o} @tab @~o @tab tilde accent
+@item @t{@@dotaccent@{o@}} @tab @dotaccent{o} @tab overdot accent
+@item @t{@@H@{o@}} @tab @H{o} @tab long Hungarian umlaut
+@item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent
+@item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent
+@item @t{@@u@{o@}} @tab @u{o} @tab breve accent
+@item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent
+@item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent
+@item @t{@@v@{o@}} @tab @v{o} @tab hacek or check accent
+@end multitable
+
+This table lists the Texinfo commands for inserting other characters
+commonly used in languages other than English.
+
+@findex questiondown
+@cindex @questiondown{}
+@findex exclamdown
+@cindex @exclamdown{}
+@findex aa
+@cindex @aa{}
+@findex AA
+@cindex @AA{}
+@findex ae
+@cindex @ae{}
+@findex AE
+@cindex @AE{}
+@findex dotless
+@cindex @dotless{i}
+@cindex @dotless{j}
+@cindex Dotless i, j
+@findex l
+@cindex @l{}
+@findex L
+@cindex @L{}
+@findex o
+@cindex @o{}
+@findex O
+@cindex @O{}
+@findex oe
+@cindex @oe{}
+@findex OE
+@cindex @OE{}
+@findex ss
+@cindex @ss{}
+@cindex Es-zet
+@cindex Sharp S
+@cindex German S
+@multitable {@@questiondown@{@}} {oe,OE} {es-zet or sharp S}
+@item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down !
+@item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
+@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab A,a with circle
+@item @t{@@ae@{@},@@AE@{@}} @tab @ae{},@AE{} @tab ae,AE ligatures
+@item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i
+@item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j
+@item @t{@@l@{@},@@L@{@}} @tab @l{},@L{} @tab suppressed-L,l
+@item @t{@@o@{@},@@O@{@}} @tab @o{},@O{} @tab O,o with slash
+@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab OE,oe ligatures
+@item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S
+@end multitable
+
+
+@node Dots Bullets, TeX and copyright, Inserting Accents, Insertions
+@section Inserting Ellipsis, Dots, and Bullets
+@cindex Dots, inserting
+@cindex Bullets, inserting
+@cindex Ellipsis, inserting
+@cindex Inserting ellipsis
+@cindex Inserting dots
+@cindex Special typesetting commands
+@cindex Typesetting commands for dots, etc.
+
+An @dfn{ellipsis} (a line of dots) is not typeset as a string of
+periods, so a special command is used for ellipsis in Texinfo. The
+@code{@@bullet} command is special, too. Each of these commands is
+followed by a pair of braces, @samp{@{@}}, without any whitespace
+between the name of the command and the braces. (You need to use braces
+with these commands because you can use them next to other text; without
+the braces, the formatters would be confused. @xref{Command Syntax, ,
+@@-Command Syntax}, for further information.)@refill
+
+@menu
+* dots:: How to insert dots @dots{}
+* bullet:: How to insert a bullet.
+@end menu
+
+@node dots, bullet, Dots Bullets, Dots Bullets
+@comment node-name, next, previous, up
+@subsection @code{@@dots}@{@}
+@findex dots
+@cindex Inserting dots
+@cindex Dots, inserting
+
+Use the @code{@@dots@{@}} command to generate an ellipsis, which is
+three dots in a row, appropriately spaced, like this: `@dots{}'. Do
+not simply write three periods in the input file; that would work for
+the Info file output, but would produce the wrong amount of space
+between the periods in the printed manual.
+
+Similarly, the @code{@@enddots@{@}} command generates an
+end-of-sentence ellipsis (four dots) @enddots{}
+
+@iftex
+Here is an ellipsis: @dots{}
+Here are three periods in a row: ...
+
+In printed output, the three periods in a row are closer together than
+the dots in the ellipsis.
+@end iftex
+
+@node bullet, , dots, Dots Bullets
+@comment node-name, next, previous, up
+@subsection @code{@@bullet}@{@}
+@findex bullet
+
+Use the @code{@@bullet@{@}} command to generate a large round dot, or
+the closest possible thing to one. In Info, an asterisk is used.@refill
+
+Here is a bullet: @bullet{}
+
+When you use @code{@@bullet} in @code{@@itemize}, you do not need to
+type the braces, because @code{@@itemize} supplies them.
+(@xref{itemize, , @code{@@itemize}}.)@refill
+
+@node TeX and copyright, pounds, Dots Bullets, Insertions
+@comment node-name, next, previous, up
+@section Inserting @TeX{} and the Copyright Symbol
+
+The logo `@TeX{}' is typeset in a special fashion and it needs an
+@@-command. The copyright symbol, `@copyright{}', is also special.
+Each of these commands is followed by a pair of braces, @samp{@{@}},
+without any whitespace between the name of the command and the
+braces.@refill
+
+@menu
+* tex:: How to insert the @TeX{} logo.
+* copyright symbol:: How to use @code{@@copyright}@{@}.
+@end menu
+
+@node tex, copyright symbol, TeX and copyright, TeX and copyright
+@comment node-name, next, previous, up
+@subsection @code{@@TeX}@{@}
+@findex tex (command)
+
+Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed
+manual, this is a special logo that is different from three ordinary
+letters. In Info, it just looks like @samp{TeX}. The
+@code{@@TeX@{@}} command is unique among Texinfo commands in that the
+@kbd{T} and the @kbd{X} are in upper case.@refill
+
+@node copyright symbol, , tex, TeX and copyright
+@comment node-name, next, previous, up
+@subsection @code{@@copyright}@{@}
+@findex copyright
+
+Use the @code{@@copyright@{@}} command to generate `@copyright{}'. In
+a printed manual, this is a @samp{c} inside a circle, and in Info,
+this is @samp{(C)}.@refill
+
+@node pounds, minus, TeX and copyright, Insertions
+@section @code{@@pounds}@{@}
+@findex pounds
+
+Use the @code{@@pounds@{@}} command to generate `@pounds{}'. In a
+printed manual, this is the symbol for the currency pounds sterling.
+In Info, it is a @samp{#}. Other currency symbols are unfortunately not
+available.
+
+@node minus, math, pounds, Insertions
+@section @code{@@minus}@{@}: Inserting a Minus Sign
+@findex minus
+
+Use the @code{@@minus@{@}} command to generate a minus sign. In a
+fixed-width font, this is a single hyphen, but in a proportional font,
+the symbol is the customary length for a minus sign---a little longer
+than a hyphen.@refill
+
+You can compare the two forms:
+
+@display
+@samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
+
+`-' is a hyphen generated with the character @samp{-}.
+@end display
+
+@noindent
+In the fixed-width font used by Info, @code{@@minus@{@}} is the same
+as a hyphen.@refill
+
+You should not use @code{@@minus@{@}} inside @code{@@code} or
+@code{@@example} because the width distinction is not made in the
+fixed-width font they use.@refill
+
+When you use @code{@@minus} to specify the mark beginning each entry in
+an itemized list, you do not need to type the braces
+(@pxref{itemize, , @code{@@itemize}}.)@refill
+
+@node math, , minus, Insertions
+@comment node-name, next, previous, up
+@section @code{@@math}: Inserting Mathematical Expressions
+@findex math
+@cindex Mathematical expressions
+
+You can write a short mathematical expression with the @code{@@math}
+command. Write the mathematical expression between braces, like this:
+
+@example
+@@math@{(a + b)(a + b) = a^2 + 2ab + b^2@}
+@end example
+
+@iftex
+@need 1000
+@noindent
+This produces the following in @TeX{}:
+
+@display
+@math{(a + b)(a + b) = a^2 + 2ab + b^2}
+@end display
+
+@noindent
+and the following in Info:
+@end iftex
+@ifinfo
+@noindent
+This produces the following in Info:
+@end ifinfo
+
+@example
+(a + b)(a + b) = a^2 + 2ab + b^2
+@end example
+
+The @code{@@math} command has no effect on the Info output. Currently,
+it has limited effect on typeset output. However, this may change since
+@TeX{} itself is designed for mathematical typesetting and does a
+splendid job.
+
+Certainly, for complex mathematical expressions, you could use @TeX{}
+directly. @xref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
+Commands}. When you use @TeX{} directly, remember to write the
+mathematical expression between one or two @samp{$} (dollar-signs) as
+appropriate.
+
+@node Glyphs, Breaks, Insertions, Top
+@comment node-name, next, previous, up
+@chapter Glyphs for Examples
+@cindex Glyphs
+
+In Texinfo, code is often illustrated in examples that are delimited
+by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
+@code{@@end lisp}. In such examples, you can indicate the results of
+evaluation or an expansion using @samp{@result{}} or
+@samp{@expansion{}}. Likewise, there are commands to insert glyphs
+to indicate
+printed output, error messages, equivalence of expressions, and the
+location of point.@refill
+
+The glyph-insertion commands do not need to be used within an example, but
+most often they are. Every glyph-insertion command is followed by a pair of
+left- and right-hand braces.@refill
+
+@menu
+* Glyphs Summary::
+* result:: How to show the result of expression.
+* expansion:: How to indicate an expansion.
+* Print Glyph:: How to indicate printed output.
+* Error Glyph:: How to indicate an error message.
+* Equivalence:: How to indicate equivalence.
+* Point Glyph:: How to indicate the location of point.
+@end menu
+
+@node Glyphs Summary, result, Glyphs, Glyphs
+@ifinfo
+@heading Glyphs Summary
+
+Here are the different glyph commands:@refill
+@end ifinfo
+
+@table @asis
+@item @result{}
+@code{@@result@{@}} points to the result of an expression.@refill
+
+@item @expansion{}
+@code{@@expansion@{@}} shows the results of a macro expansion.@refill
+
+@item @print{}
+@code{@@print@{@}} indicates printed output.@refill
+
+@item @error{}
+@code{@@error@{@}} indicates that the following text is an error
+message.@refill
+
+@item @equiv{}
+@code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill
+
+@item @point{}
+@code{@@point@{@}} shows the location of point.@refill
+@end table
+
+@node result, expansion, Glyphs Summary, Glyphs
+@section @result{}: Indicating Evaluation
+@cindex Result of an expression
+@cindex Indicating evaluation
+@cindex Evaluation glyph
+@cindex Value of an expression, indicating
+
+Use the @code{@@result@{@}} command to indicate the result of
+evaluating an expression.@refill
+
+@iftex
+The @code{@@result@{@}} command is displayed as @samp{=>} in Info and
+as @samp{@result{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info
+and as a double stemmed arrow in the printed output.@refill
+@end ifinfo
+
+Thus, the following,
+
+@lisp
+(cdr '(1 2 3))
+ @result{} (2 3)
+@end lisp
+
+@noindent
+may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
+
+@node expansion, Print Glyph, result, Glyphs
+@section @expansion{}: Indicating an Expansion
+@cindex Expansion, indicating it
+
+When an expression is a macro call, it expands into a new expression.
+You can indicate the result of the expansion with the
+@code{@@expansion@{@}} command.@refill
+
+@iftex
+The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and
+as @samp{@expansion{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
+in Info and as a long arrow with a flat base in the printed output.@refill
+@end ifinfo
+
+@need 700
+For example, the following
+
+@example
+@group
+@@lisp
+(third '(a b c))
+ @@expansion@{@} (car (cdr (cdr '(a b c))))
+ @@result@{@} c
+@@end lisp
+@end group
+@end example
+
+@noindent
+produces
+
+@lisp
+@group
+(third '(a b c))
+ @expansion{} (car (cdr (cdr '(a b c))))
+ @result{} c
+@end group
+@end lisp
+
+@noindent
+which may be read as:
+
+@quotation
+@code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
+the result of evaluating the expression is @code{c}.
+@end quotation
+
+@noindent
+Often, as in this case, an example looks better if the
+@code{@@expansion@{@}} and @code{@@result@{@}} commands are indented
+five spaces.@refill
+
+@node Print Glyph, Error Glyph, expansion, Glyphs
+@section @print{}: Indicating Printed Output
+@cindex Printed output, indicating it
+
+Sometimes an expression will print output during its execution. You
+can indicate the printed output with the @code{@@print@{@}} command.@refill
+
+@iftex
+The @code{@@print@{@}} command is displayed as @samp{-|} in Info and
+as @samp{@print{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info
+and similarly, as a horizontal dash butting against a vertical bar, in
+the printed output.@refill
+@end ifinfo
+
+In the following example, the printed text is indicated with
+@samp{@print{}}, and the value of the expression follows on the
+last line.@refill
+
+@lisp
+@group
+(progn (print 'foo) (print 'bar))
+ @print{} foo
+ @print{} bar
+ @result{} bar
+@end group
+@end lisp
+
+@noindent
+In a Texinfo source file, this example is written as follows:
+
+@lisp
+@group
+@@lisp
+(progn (print 'foo) (print 'bar))
+ @@print@{@} foo
+ @@print@{@} bar
+ @@result@{@} bar
+@@end lisp
+@end group
+@end lisp
+
+@node Error Glyph, Equivalence, Print Glyph, Glyphs
+@section @error{}: Indicating an Error Message
+@cindex Error message, indicating it
+
+A piece of code may cause an error when you evaluate it. You can
+designate the error message with the @code{@@error@{@}} command.@refill
+
+@iftex
+The @code{@@error@{@}} command is displayed as @samp{error-->} in Info
+and as @samp{@error{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info
+and as the word `error' in a box in the printed output.@refill
+@end ifinfo
+
+@need 700
+Thus,
+
+@example
+@@lisp
+(+ 23 'x)
+@@error@{@} Wrong type argument: integer-or-marker-p, x
+@@end lisp
+@end example
+
+@noindent
+produces
+
+@lisp
+(+ 23 'x)
+@error{} Wrong type argument: integer-or-marker-p, x
+@end lisp
+
+@noindent
+This indicates that the following error message is printed
+when you evaluate the expression:
+
+@lisp
+Wrong type argument: integer-or-marker-p, x
+@end lisp
+
+Note that @samp{@error{}} itself is not part of the error
+message.
+
+@node Equivalence, Point Glyph, Error Glyph, Glyphs
+@section @equiv{}: Indicating Equivalence
+@cindex Equivalence, indicating it
+
+Sometimes two expressions produce identical results. You can indicate the
+exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
+
+@iftex
+The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and
+as @samp{@equiv{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info
+and as a three parallel horizontal lines in the printed output.@refill
+@end ifinfo
+
+Thus,
+
+@example
+@@lisp
+(make-sparse-keymap) @@equiv@{@} (list 'keymap)
+@@end lisp
+@end example
+
+@noindent
+produces
+
+@lisp
+(make-sparse-keymap) @equiv{} (list 'keymap)
+@end lisp
+
+@noindent
+This indicates that evaluating @code{(make-sparse-keymap)} produces
+identical results to evaluating @code{(list 'keymap)}.
+
+@c Cannot write point command here because it causes trouble with TOC.
+@node Point Glyph, , Equivalence, Glyphs
+@section Indicating Point in a Buffer
+@cindex Point, indicating it in a buffer
+
+Sometimes you need to show an example of text in an Emacs buffer. In
+such examples, the convention is to include the entire contents of the
+buffer in question between two lines of dashes containing the buffer
+name.@refill
+
+You can use the @samp{@@point@{@}} command to show the location of point
+in the text in the buffer. (The symbol for point, of course, is not
+part of the text in the buffer; it indicates the place @emph{between}
+two characters where point is located.)@refill
+
+@iftex
+The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and
+as @samp{@point{}} in the printed output.
+@end iftex
+@ifinfo
+The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info
+and as a small five pointed star in the printed output.@refill
+@end ifinfo
+
+The following example shows the contents of buffer @file{foo} before
+and after evaluating a Lisp command to insert the word @code{changed}.@refill
+
+@example
+@group
+---------- Buffer: foo ----------
+This is the @point{}contents of foo.
+---------- Buffer: foo ----------
+
+@end group
+@end example
+
+@example
+@group
+(insert "changed ")
+ @result{} nil
+---------- Buffer: foo ----------
+This is the changed @point{}contents of foo.
+---------- Buffer: foo ----------
+
+@end group
+@end example
+
+In a Texinfo source file, the example is written like this:@refill
+
+@example
+@@example
+---------- Buffer: foo ----------
+This is the @@point@{@}contents of foo.
+---------- Buffer: foo ----------
+
+(insert "changed ")
+ @@result@{@} nil
+---------- Buffer: foo ----------
+This is the changed @@point@{@}contents of foo.
+---------- Buffer: foo ----------
+@@end example
+@end example
+
+@node Breaks, Definition Commands, Glyphs, Top
+@comment node-name, next, previous, up
+@chapter Making and Preventing Breaks
+@cindex Making line and page breaks
+@cindex Preventing line and page breaks
+
+Usually, a Texinfo file is processed both by @TeX{} and by one of the
+Info formatting commands. Line, paragraph, or page breaks sometimes
+occur in the `wrong' place in one or other form of output. You must
+ensure that text looks right both in the printed manual and in the
+Info file.@refill
+
+For example, in a printed manual, page breaks may occur awkwardly in
+the middle of an example; to prevent this, you can hold text together
+using a grouping command that keeps the text from being split across
+two pages. Conversely, you may want to force a page break where none
+would occur normally. Fortunately, problems like these do not often
+arise. When they do, use the break, break prevention, or pagination
+commands.@refill
+
+@menu
+* Break Commands:: Cause and prevent splits.
+* Line Breaks:: How to force a single line to use two lines.
+* - and hyphenation:: How to tell TeX about hyphenation points.
+* w:: How to prevent unwanted line breaks.
+* sp:: How to insert blank lines.
+* page:: How to force the start of a new page.
+* group:: How to prevent unwanted page breaks.
+* need:: Another way to prevent unwanted page breaks.
+@end menu
+
+@ifinfo
+@node Break Commands, Line Breaks, Breaks, Breaks
+@heading The Break Commands
+@end ifinfo
+@iftex
+@sp 1
+@end iftex
+
+The break commands create or allow line and paragraph breaks:@refill
+
+@table @code
+@item @@*
+Force a line break.
+
+@item @@sp @var{n}
+Skip @var{n} blank lines.@refill
+
+@item @@-
+Insert a discretionary hyphen.
+
+@item @@hyphenation@{@var{hy-phen-a-ted words}@}
+Define hyphen points in @var{hy-phen-a-ted words}.
+@end table
+
+The line-break-prevention command holds text together all on one
+line:@refill
+
+@table @code
+@item @@w@{@var{text}@}
+Prevent @var{text} from being split and hyphenated across two lines.@refill
+@end table
+@iftex
+@sp 1
+@end iftex
+
+The pagination commands apply only to printed output, since Info
+files do not have pages.@refill
+
+@table @code
+@item @@page
+Start a new page in the printed manual.@refill
+
+@item @@group
+Hold text together that must appear on one printed page.@refill
+
+@item @@need @var{mils}
+Start a new printed page if not enough space on this one.@refill
+@end table
+
+@node Line Breaks, - and hyphenation, Break Commands, Breaks
+@comment node-name, next, previous, up
+@section @code{@@*}: Generate Line Breaks
+@findex * @r{(force line break)}
+@cindex Line breaks
+@cindex Breaks in a line
+
+The @code{@@*} command forces a line break in both the printed manual and
+in Info.@refill
+
+@need 700
+For example,
+
+@example
+This line @@* is broken @@*in two places.
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This line
+ is broken
+in two places.
+@end group
+@end example
+
+@noindent
+(Note that the space after the first @code{@@*} command is faithfully
+carried down to the next line.)@refill
+
+@need 800
+The @code{@@*} command is often used in a file's copyright page:@refill
+
+@example
+@group
+This is edition 2.0 of the Texinfo documentation,@@*
+and is for @dots{}
+@end group
+@end example
+
+@noindent
+In this case, the @code{@@*} command keeps @TeX{} from stretching the
+line across the whole page in an ugly manner.@refill
+
+@quotation
+@strong{Please note:} Do not write braces after an @code{@@*} command;
+they are not needed.@refill
+
+Do not write an @code{@@refill} command at the end of a paragraph
+containing an @code{@@*} command; it will cause the paragraph to be
+refilled after the line break occurs, negating the effect of the line
+break.@refill
+@end quotation
+
+@node - and hyphenation, w, Line Breaks, Breaks
+@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} hyphenate
+
+@findex -
+@findex hyphenation
+@cindex Hyphenation, helping @TeX{} do
+@cindex Fine-tuning, and hyphenation
+
+Although @TeX{}'s hyphenation algorithm is generally pretty good, it
+does miss useful hyphenation points from time to time. (Or, far more
+rarely, insert an incorrect hyphenation.) So, for documents with an
+unusual vocabulary or when fine-tuning for a printed edition, you may
+wish to help @TeX{} out. Texinfo supports two commands for this:
+
+@table @code
+@item @@-
+Insert a discretionary hyphen, i.e., a place where @TeX{} can (but does
+not have to) hyphenate. This is especially useful when you notice
+an overfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull
+hboxes}). @TeX{} will not insert any hyphenation points in a word
+containing @code{@@-}.
+
+@item @@hyphenation@{@var{hy-phen-a-ted words}@}
+Tell @TeX{} how to hyphenate @var{hy-phen-a-ted words}. As shown, you
+put a @samp{-} at each hyphenation point. For example:
+@example
+@@hyphenation@{man-u-script man-u-scripts@}
+@end example
+@noindent @TeX{} only uses the specified hyphenation points when the
+words match exactly, so give all necessary variants.
+@end table
+
+Info output is not hyphenated, so these commands have no effect there.
+
+@node w, sp, - and hyphenation, Breaks
+@comment node-name, next, previous, up
+@section @code{@@w}@{@var{text}@}: Prevent Line Breaks
+@findex w @r{(prevent line break)}
+@cindex Line breaks, preventing
+@cindex Hyphenation, preventing
+
+@code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks
+within @var{text}.@refill
+
+You can use the @code{@@w} command to prevent @TeX{} from automatically
+hyphenating a long name or phrase that accidentally falls near the end
+of a line.@refill
+
+@example
+You can copy GNU software from @@w@{@@file@{prep.ai.mit.edu@}@}.
+@end example
+
+@noindent
+produces
+
+@quotation
+You can copy GNU software from @w{@file{prep.ai.mit.edu}}.
+@end quotation
+
+@quotation
+@strong{Caution:} Do not write an @code{@@refill} command at the end
+of a paragraph containing an @code{@@w} command; it will cause the
+paragraph to be refilled and may thereby negate the effect of the
+@code{@@w} command.@refill
+@end quotation
+
+@node sp, page, w, Breaks
+@comment node-name, next, previous, up
+@section @code{@@sp} @var{n}: Insert Blank Lines
+@findex sp @r{(line spacing)}
+@cindex Spaces (blank lines)
+@cindex Blank lines
+@cindex Line spacing
+
+A line beginning with and containing only @code{@@sp @var{n}}
+generates @var{n} blank lines of space in both the printed manual and
+the Info file. @code{@@sp} also forces a paragraph break. For
+example,@refill
+
+@example
+@@sp 2
+@end example
+
+@noindent
+generates two blank lines.
+
+The @code{@@sp} command is most often used in the title page.@refill
+
+@ignore
+@c node br, page, sp, Breaks
+@comment node-name, next, previous, up
+@c section @code{@@br}: Generate Paragraph Breaks
+@findex br @r{(paragraph breaks)}
+@cindex Paragraph breaks
+@cindex Breaks in a paragraph
+
+The @code{@@br} command forces a paragraph break. It inserts a blank
+line. You can use the command within or at the end of a line. If
+used within a line, the @code{@@br@{@}} command must be followed by
+left and right braces (as shown here) to mark the end of the
+command.@refill
+
+@need 700
+For example,
+
+@example
+@group
+This line @@br@{@}contains and is ended by paragraph breaks@@br
+and is followed by another line.
+@end group
+@end example
+
+@noindent
+produces
+
+@example
+@group
+This line
+
+contains and is ended by paragraph breaks
+
+and is followed by another line.
+@end group
+@end example
+
+The @code{@@br} command is seldom used.
+@end ignore
+
+@node page, group, sp, Breaks
+@comment node-name, next, previous, up
+@section @code{@@page}: Start a New Page
+@cindex Page breaks
+@findex page
+
+A line containing only @code{@@page} starts a new page in a printed
+manual. The command has no effect on Info files since they are not
+paginated. An @code{@@page} command is often used in the @code{@@titlepage}
+section of a Texinfo file to start the copyright page.@refill
+
+@node group, need, page, Breaks
+@comment node-name, next, previous, up
+@section @code{@@group}: Prevent Page Breaks
+@cindex Group (hold text together vertically)
+@cindex Holding text together vertically
+@cindex Vertically holding text together
+@findex group
+
+The @code{@@group} command (on a line by itself) is used inside an
+@code{@@example} or similar construct to begin an unsplittable vertical
+group, which will appear entirely on one page in the printed output.
+The group is terminated by a line containing only @code{@@end group}.
+These two lines produce no output of their own, and in the Info file
+output they have no effect at all.@refill
+
+@c Once said that these environments
+@c turn off vertical spacing between ``paragraphs''.
+@c Also, quotation used to work, but doesn't in texinfo-2.72
+Although @code{@@group} would make sense conceptually in a wide
+variety of contexts, its current implementation works reliably only
+within @code{@@example} and variants, and within @code{@@display},
+@code{@@format}, @code{@@flushleft} and @code{@@flushright}.
+@xref{Quotations and Examples}. (What all these commands have in
+common is that each line of input produces a line of output.) In
+other contexts, @code{@@group} can cause anomalous vertical
+spacing.@refill
+
+@need 750
+This formatting requirement means that you should write:
+
+@example
+@group
+@@example
+@@group
+@dots{}
+@@end group
+@@end example
+@end group
+@end example
+
+@noindent
+with the @code{@@group} and @code{@@end group} commands inside the
+@code{@@example} and @code{@@end example} commands.
+
+The @code{@@group} command is most often used to hold an example
+together on one page. In this Texinfo manual, more than 100 examples
+contain text that is enclosed between @code{@@group} and @code{@@end
+group}.
+
+If you forget to end a group, you may get strange and unfathomable
+error messages when you run @TeX{}. This is because @TeX{} keeps
+trying to put the rest of the Texinfo file onto the one page and does
+not start to generate error messages until it has processed
+considerable text. It is a good rule of thumb to look for a missing
+@code{@@end group} if you get incomprehensible error messages in
+@TeX{}.@refill
+
+@node need, , group, Breaks
+@comment node-name, next, previous, up
+@section @code{@@need @var{mils}}: Prevent Page Breaks
+@cindex Need space at page bottom
+@findex need
+
+A line containing only @code{@@need @var{n}} starts
+a new page in a printed manual if fewer than @var{n} mils (thousandths
+of an inch) remain on the current page. Do not use
+braces around the argument @var{n}. The @code{@@need} command has no
+effect on Info files since they are not paginated.@refill
+
+@need 800
+This paragraph is preceded by an @code{@@need} command that tells
+@TeX{} to start a new page if fewer than 800 mils (eight-tenths
+inch) remain on the page. It looks like this:@refill
+
+@example
+@group
+@@need 800
+This paragraph is preceded by @dots{}
+@end group
+@end example
+
+The @code{@@need} command is useful for preventing orphans (single
+lines at the bottoms of printed pages).@refill
+
+@node Definition Commands, Footnotes, Breaks, Top
+@chapter Definition Commands
+@cindex Definition commands
+
+The @code{@@deffn} command and the other @dfn{definition commands}
+enable you to describe functions, variables, macros, commands, user
+options, special forms and other such artifacts in a uniform
+format.@refill
+
+In the Info file, a definition causes the entity
+category---`Function', `Variable', or whatever---to appear at the
+beginning of the first line of the definition, followed by the
+entity's name and arguments. In the printed manual, the command
+causes @TeX{} to print the entity's name and its arguments on the left
+margin and print the category next to the right margin. In both
+output formats, the body of the definition is indented. Also, the
+name of the entity is entered into the appropriate index:
+@code{@@deffn} enters the name into the index of functions,
+@code{@@defvr} enters it into the index of variables, and so
+on.@refill
+
+A manual need not and should not contain more than one definition for
+a given name. An appendix containing a summary should use
+@code{@@table} rather than the definition commands.@refill
+
+@menu
+* Def Cmd Template:: How to structure a description using a
+ definition command.
+* Optional Arguments:: How to handle optional and repeated arguments.
+* deffnx:: How to group two or more `first' lines.
+* Def Cmds in Detail:: All the definition commands.
+* Def Cmd Conventions:: Conventions for writing definitions.
+* Sample Function Definition::
+@end menu
+
+@node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands
+@section The Template for a Definition
+@cindex Definition template
+@cindex Template for a definition
+
+The @code{@@deffn} command is used for definitions of entities that
+resemble functions. To write a definition using the @code{@@deffn}
+command, write the @code{@@deffn} command at the beginning of a line
+and follow it on the same line by the category of the entity, the name
+of the entity itself, and its arguments (if any). Then write the body
+of the definition on succeeding lines. (You may embed examples in the
+body.) Finally, end the definition with an @code{@@end deffn} command
+written on a line of its own. (The other definition commands follow
+the same format.)@refill
+
+The template for a definition looks like this:
+
+@example
+@group
+@@deffn @var{category} @var{name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end deffn
+@end group
+@end example
+
+@need 700
+@noindent
+For example,
+
+@example
+@group
+@@deffn Command forward-word count
+This command moves point forward @@var@{count@} words
+(or backward if @@var@{count@} is negative). @dots{}
+@@end deffn
+@end group
+@end example
+
+@noindent
+produces
+
+@quotation
+@deffn Command forward-word count
+This function moves point forward @var{count} words
+(or backward if @var{count} is negative). @dots{}
+@end deffn
+@end quotation
+
+Capitalize the category name like a title. If the name of the
+category contains spaces, as in the phrase `Interactive Command',
+write braces around it. For example:@refill
+
+@example
+@group
+@@deffn @{Interactive Command@} isearch-forward
+@dots{}
+@@end deffn
+@end group
+@end example
+
+@noindent
+Otherwise, the second word will be mistaken for the name of the
+entity.@refill
+
+Some of the definition commands are more general than others. The
+@code{@@deffn} command, for example, is the general definition command
+for functions and the like---for entities that may take arguments. When
+you use this command, you specify the category to which the entity
+belongs. The @code{@@deffn} command possesses three predefined,
+specialized variations, @code{@@defun}, @code{@@defmac}, and
+@code{@@defspec}, that specify the category for you: ``Function'',
+``Macro'', and ``Special Form'' respectively. The @code{@@defvr}
+command also is accompanied by several predefined, specialized
+variations for describing particular kinds of variables.@refill
+
+The template for a specialized definition, such as @code{@@defun}, is
+similar to the template for a generalized definition, except that you
+do not need to specify the category:@refill
+
+@example
+@group
+@@defun @var{name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end defun
+@end group
+@end example
+
+@noindent
+Thus,
+
+@example
+@group
+@@defun buffer-end flag
+This function returns @@code@{(point-min)@} if @@var@{flag@}
+is less than 1, @@code@{(point-max)@} otherwise.
+@dots{}
+@@end defun
+@end group
+@end example
+
+@noindent
+produces
+
+@quotation
+@defun buffer-end flag
+This function returns @code{(point-min)} if @var{flag} is less than 1,
+@code{(point-max)} otherwise. @dots{}
+@end defun
+@end quotation
+
+@noindent
+@xref{Sample Function Definition, Sample Function Definition, A Sample
+Function Definition}, for a more detailed example of a function
+definition, including the use of @code{@@example} inside the
+definition.@refill
+
+The other specialized commands work like @code{@@defun}.@refill
+
+@node Optional Arguments, deffnx, Def Cmd Template, Definition Commands
+@section Optional and Repeated Arguments
+@cindex Optional and repeated arguments
+@cindex Repeated and optional arguments
+@cindex Arguments, repeated and optional
+@cindex Syntax, optional & repeated arguments
+@cindex Meta-syntactic chars for arguments
+
+Some entities take optional or repeated arguments, which may be
+specified by a distinctive glyph that uses square brackets and
+ellipses. For @w{example}, a special form often breaks its argument list
+into separate arguments in more complicated ways than a
+straightforward function.@refill
+
+@iftex
+An argument enclosed within square brackets is optional.
+Thus, the phrase
+@samp{@code{@r{[}@var{optional-arg}@r{]}}} means that
+@var{optional-arg} is optional.
+An argument followed by an ellipsis is optional
+and may be repeated more than once.
+@c This is consistent with Emacs Lisp Reference manual
+Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments.
+Parentheses are used when several arguments are grouped
+into additional levels of list structure in Lisp.
+@end iftex
+@c The following looks better in Info (no `r', `samp' and `code'):
+@ifinfo
+An argument enclosed within square brackets is optional.
+Thus, [@var{optional-arg}] means that @var{optional-arg} is optional.
+An argument followed by an ellipsis is optional
+and may be repeated more than once.
+@c This is consistent with Emacs Lisp Reference manual
+Thus, @var{repeated-args}@dots{} stands for zero or more arguments.
+Parentheses are used when several arguments are grouped
+into additional levels of list structure in Lisp.
+@end ifinfo
+
+Here is the @code{@@defspec} line of an example of an imaginary
+special form:@refill
+
+@quotation
+@defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
+@end defspec
+@tex
+\vskip \parskip
+@end tex
+@end quotation
+
+@noindent
+In this example, the arguments @var{from} and @var{to} are optional,
+but must both be present or both absent. If they are present,
+@var{inc} may optionally be specified as well. These arguments are
+grouped with the argument @var{var} into a list, to distinguish them
+from @var{body}, which includes all remaining elements of the
+form.@refill
+
+In a Texinfo source file, this @code{@@defspec} line is written like
+this (except it would not be split over two lines, as it is in this
+example).@refill
+
+@example
+@group
+@@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@}
+ [@@var@{inc@}]]) @@var@{body@}@@dots@{@}
+@end group
+@end example
+
+@noindent
+The function is listed in the Command and Variable Index under
+@samp{foobar}.@refill
+
+@node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands
+@section Two or More `First' Lines
+@cindex Two `First' Lines for @code{@@deffn}
+@cindex Grouping two definitions together
+@cindex Definitions grouped together
+@findex deffnx
+
+To create two or more `first' or header lines for a definition, follow
+the first @code{@@deffn} line by a line beginning with @code{@@deffnx}.
+The @code{@@deffnx} command works exactly like @code{@@deffn}
+except that it does not generate extra vertical white space between it
+and the preceding line.@refill
+
+@need 1000
+For example,
+
+@example
+@group
+@@deffn @{Interactive Command@} isearch-forward
+@@deffnx @{Interactive Command@} isearch-backward
+These two search commands are similar except @dots{}
+@@end deffn
+@end group
+@end example
+
+@noindent
+produces
+
+@deffn {Interactive Command} isearch-forward
+@deffnx {Interactive Command} isearch-backward
+These two search commands are similar except @dots{}
+@end deffn
+
+Each of the other definition commands has an `x' form: @code{@@defunx},
+@code{@@defvrx}, @code{@@deftypefunx}, etc.
+
+The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}.
+
+@node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands
+@section The Definition Commands
+
+Texinfo provides more than a dozen definition commands, all of which
+are described in this section.@refill
+
+The definition commands automatically enter the name of the entity in
+the appropriate index: for example, @code{@@deffn}, @code{@@defun},
+and @code{@@defmac} enter function names in the index of functions;
+@code{@@defvr} and @code{@@defvar} enter variable names in the index
+of variables.@refill
+
+Although the examples that follow mostly illustrate Lisp, the commands
+can be used for other programming languages.@refill
+
+@menu
+* Functions Commands:: Commands for functions and similar entities.
+* Variables Commands:: Commands for variables and similar entities.
+* Typed Functions:: Commands for functions in typed languages.
+* Typed Variables:: Commands for variables in typed languages.
+* Abstract Objects:: Commands for object-oriented programming.
+* Data Types:: The definition command for data types.
+@end menu
+
+@node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail
+@subsection Functions and Similar Entities
+
+This section describes the commands for describing functions and similar
+entities:@refill
+
+@table @code
+@findex deffn
+@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
+The @code{@@deffn} command is the general definition command for
+functions, interactive commands, and similar entities that may take
+arguments. You must choose a term to describe the category of entity
+being defined; for example, ``Function'' could be used if the entity is
+a function. The @code{@@deffn} command is written at the beginning of a
+line and is followed on the same line by the category of entity being
+described, the name of this particular entity, and its arguments, if
+any. Terminate the definition with @code{@@end deffn} on a line of its
+own.@refill
+
+@need 750
+For example, here is a definition:
+
+@example
+@group
+@@deffn Command forward-char nchars
+Move point forward @@var@{nchars@} characters.
+@@end deffn
+@end group
+@end example
+
+@noindent
+This shows a rather terse definition for a ``command'' named
+@code{forward-char} with one argument, @var{nchars}.
+
+@code{@@deffn} prints argument names such as @var{nchars} in italics or
+upper case, as if @code{@@var} had been used, because we think of these
+names as metasyntactic variables---they stand for the actual argument
+values. Within the text of the description, write an argument name
+explicitly with @code{@@var} to refer to the value of the argument. In
+the example above, we used @samp{@@var@{nchars@}} in this way.
+
+The template for @code{@@deffn} is:
+
+@example
+@group
+@@deffn @var{category} @var{name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end deffn
+@end group
+@end example
+
+@findex defun
+@item @@defun @var{name} @var{arguments}@dots{}
+The @code{@@defun} command is the definition command for functions.
+@code{@@defun} is equivalent to @samp{@@deffn Function
+@dots{}}.@refill
+
+@need 800
+@noindent
+For example,
+
+@example
+@group
+@@defun set symbol new-value
+Change the value of the symbol @@var@{symbol@}
+to @@var@{new-value@}.
+@@end defun
+@end group
+@end example
+
+@noindent
+shows a rather terse definition for a function @code{set} whose
+arguments are @var{symbol} and @var{new-value}. The argument names on
+the @code{@@defun} line automatically appear in italics or upper case as
+if they were enclosed in @code{@@var}. Terminate the definition with
+@code{@@end defun} on a line of its own.@refill
+
+The template is:
+
+@example
+@group
+@@defun @var{function-name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end defun
+@end group
+@end example
+
+@code{@@defun} creates an entry in the index of functions.
+
+@findex defmac
+@item @@defmac @var{name} @var{arguments}@dots{}
+The @code{@@defmac} command is the definition command for macros.
+@code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
+works like @code{@@defun}.@refill
+
+@findex defspec
+@item @@defspec @var{name} @var{arguments}@dots{}
+The @code{@@defspec} command is the definition command for special
+forms. (In Lisp, a special form is an entity much like a function.)
+@code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
+@dots{}} and works like @code{@@defun}.@refill
+@end table
+
+@node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail
+@subsection Variables and Similar Entities
+
+Here are the commands for defining variables and similar
+entities:@refill
+
+@table @code
+@findex defvr
+@item @@defvr @var{category} @var{name}
+The @code{@@defvr} command is a general definition command for
+something like a variable---an entity that records a value. You must
+choose a term to describe the category of entity being defined; for
+example, ``Variable'' could be used if the entity is a variable.
+Write the @code{@@defvr} command at the beginning of a line and
+followed it on the same line by the category of the entity and the
+name of the entity.@refill
+
+Capitalize the category name like a title. If the name of the
+category contains spaces, as in the name `User Option', write braces
+around it. Otherwise, the second word will be mistaken for the name
+of the entity, for example:
+
+@example
+@group
+@@defvr @{User Option@} fill-column
+This buffer-local variable specifies
+the maximum width of filled lines.
+@dots{}
+@@end defvr
+@end group
+@end example
+
+Terminate the definition with @code{@@end defvr} on a line of its
+own.@refill
+
+The template is:
+
+@example
+@group
+@@defvr @var{category} @var{name}
+@var{body-of-definition}
+@@end defvr
+@end group
+@end example
+
+@code{@@defvr} creates an entry in the index of variables for @var{name}.
+
+@findex defvar
+@item @@defvar @var{name}
+The @code{@@defvar} command is the definition command for variables.
+@code{@@defvar} is equivalent to @samp{@@defvr Variable
+@dots{}}.@refill
+
+@need 750
+For example:
+
+@example
+@group
+@@defvar kill-ring
+@dots{}
+@@end defvar
+@end group
+@end example
+
+The template is:
+
+@example
+@group
+@@defvar @var{name}
+@var{body-of-definition}
+@@end defvar
+@end group
+@end example
+
+@code{@@defvar} creates an entry in the index of variables for
+@var{name}.@refill
+
+@findex defopt
+@item @@defopt @var{name}
+The @code{@@defopt} command is the definition command for user
+options. @code{@@defopt} is equivalent to @samp{@@defvr @{User
+Option@} @dots{}} and works like @code{@@defvar}.@refill
+@end table
+
+@node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail
+@subsection Functions in Typed Languages
+
+The @code{@@deftypefn} command and its variations are for describing
+functions in C or any other language in which you must declare types
+of variables and functions.@refill
+
+@table @code
+@findex deftypefn
+@item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
+The @code{@@deftypefn} command is the general definition command for
+functions and similar entities that may take arguments and that are
+typed. The @code{@@deftypefn} command is written at the beginning of
+a line and is followed on the same line by the category of entity
+being described, the type of the returned value, the name of this
+particular entity, and its arguments, if any.@refill
+
+@need 800
+@noindent
+For example,
+
+@example
+@group
+@@deftypefn @{Library Function@} int foobar
+ (int @@var@{foo@}, float @@var@{bar@})
+@dots{}
+@@end deftypefn
+@end group
+@end example
+
+@need 1000
+@noindent
+(where the text before the ``@dots{}'', shown above as two lines, would
+actually be a single line in a real Texinfo file) produces the following
+in Info:
+
+@smallexample
+@group
+-- Library Function: int foobar (int FOO, float BAR)
+@dots{}
+@end group
+@end smallexample
+@iftex
+
+In a printed manual, it produces:
+
+@quotation
+@deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+@dots{}
+@end deftypefn
+@end quotation
+@end iftex
+
+This means that @code{foobar} is a ``library function'' that returns an
+@code{int}, and its arguments are @var{foo} (an @code{int}) and
+@var{bar} (a @code{float}).@refill
+
+The argument names that you write in @code{@@deftypefn} are not subject
+to an implicit @code{@@var}---since the actual names of the arguments in
+@code{@@deftypefn} are typically scattered among data type names and
+keywords, Texinfo cannot find them without help. Instead, you must write
+@code{@@var} explicitly around the argument names. In the example
+above, the argument names are @samp{foo} and @samp{bar}.@refill
+
+The template for @code{@@deftypefn} is:@refill
+
+@example
+@group
+@@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
+@var{body-of-description}
+@@end deftypefn
+@end group
+@end example
+
+@noindent
+Note that if the @var{category} or @var{data type} is more than one
+word then it must be enclosed in braces to make it a single argument.@refill
+
+If you are describing a procedure in a language that has packages,
+such as Ada, you might consider using @code{@@deftypefn} in a manner
+somewhat contrary to the convention described in the preceding
+paragraphs.@refill
+
+@need 800
+@noindent
+For example:
+
+@example
+@group
+@@deftypefn stacks private push
+ (@@var@{s@}:in out stack;
+ @@var@{n@}:in integer)
+@dots{}
+@@end deftypefn
+@end group
+@end example
+
+@noindent
+(The @code{@@deftypefn} arguments are shown split into three lines, but
+would be a single line in a real Texinfo file.)
+
+In this instance, the procedure is classified as belonging to the
+package @code{stacks} rather than classified as a `procedure' and its
+data type is described as @code{private}. (The name of the procedure
+is @code{push}, and its arguments are @var{s} and @var{n}.)@refill
+
+@code{@@deftypefn} creates an entry in the index of functions for
+@var{name}.@refill
+
+@findex deftypefun
+@item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
+The @code{@@deftypefun} command is the specialized definition command
+for functions in typed languages. The command is equivalent to
+@samp{@@deftypefn Function @dots{}}.@refill
+
+@need 800
+@noindent
+Thus,
+
+@smallexample
+@group
+@@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@})
+@dots{}
+@@end deftypefun
+@end group
+@end smallexample
+
+@noindent
+produces the following in Info:
+
+@example
+@group
+-- Function: int foobar (int FOO, float BAR)
+@dots{}
+@end group
+@end example
+@iftex
+
+@need 800
+@noindent
+and the following in a printed manual:
+
+@quotation
+@deftypefun int foobar (int @var{foo}, float @var{bar})
+@dots{}
+@end deftypefun
+@end quotation
+@end iftex
+
+@need 800
+The template is:
+
+@example
+@group
+@@deftypefun @var{type} @var{name} @var{arguments}@dots{}
+@var{body-of-description}
+@@end deftypefun
+@end group
+@end example
+
+@code{@@deftypefun} creates an entry in the index of functions for
+@var{name}.@refill
+@end table
+
+@node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail
+@subsection Variables in Typed Languages
+
+Variables in typed languages are handled in a manner similar to
+functions in typed languages. @xref{Typed Functions}. The general
+definition command @code{@@deftypevr} corresponds to
+@code{@@deftypefn} and the specialized definition command
+@code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill
+
+@table @code
+@findex deftypevr
+@item @@deftypevr @var{category} @var{data-type} @var{name}
+The @code{@@deftypevr} command is the general definition command for
+something like a variable in a typed language---an entity that records
+a value. You must choose a term to describe the category of the
+entity being defined; for example, ``Variable'' could be used if the
+entity is a variable.@refill
+
+The @code{@@deftypevr} command is written at the beginning of a line
+and is followed on the same line by the category of the entity
+being described, the data type, and the name of this particular
+entity.@refill
+
+@need 800
+@noindent
+For example:
+
+@example
+@group
+@@deftypevr @{Global Flag@} int enable
+@dots{}
+@@end deftypevr
+@end group
+@end example
+
+@noindent
+produces the following in Info:
+
+@example
+@group
+-- Global Flag: int enable
+@dots{}
+@end group
+@end example
+@iftex
+
+@noindent
+and the following in a printed manual:
+
+@quotation
+@deftypevr {Global Flag} int enable
+@dots{}
+@end deftypevr
+@end quotation
+@end iftex
+
+@need 800
+The template is:
+
+@example
+@@deftypevr @var{category} @var{data-type} @var{name}
+@var{body-of-description}
+@@end deftypevr
+@end example
+
+@code{@@deftypevr} creates an entry in the index of variables for
+@var{name}.@refill
+
+@findex deftypevar
+@item @@deftypevar @var{data-type} @var{name}
+The @code{@@deftypevar} command is the specialized definition command
+for variables in typed languages. @code{@@deftypevar} is equivalent
+to @samp{@@deftypevr Variable @dots{}}.@refill
+
+@need 800
+@noindent
+For example:
+
+@example
+@group
+@@deftypevar int fubar
+@dots{}
+@@end deftypevar
+@end group
+@end example
+
+@noindent
+produces the following in Info:
+
+@example
+@group
+-- Variable: int fubar
+@dots{}
+@end group
+@end example
+@iftex
+
+@need 800
+@noindent
+and the following in a printed manual:
+
+@quotation
+@deftypevar int fubar
+@dots{}
+@end deftypevar
+@end quotation
+@end iftex
+
+@need 800
+@noindent
+The template is:
+
+@example
+@group
+@@deftypevar @var{data-type} @var{name}
+@var{body-of-description}
+@@end deftypevar
+@end group
+@end example
+
+@code{@@deftypevar} creates an entry in the index of variables for
+@var{name}.@refill
+@end table
+
+@node Abstract Objects, Data Types, Typed Variables, Def Cmds in Detail
+@subsection Object-Oriented Programming
+
+Here are the commands for formatting descriptions about abstract
+objects, such as are used in object-oriented programming. A class is
+a defined type of abstract object. An instance of a class is a
+particular object that has the type of the class. An instance
+variable is a variable that belongs to the class but for which each
+instance has its own value.@refill
+
+In a definition, if the name of a class is truly a name defined in the
+programming system for a class, then you should write an @code{@@code}
+around it. Otherwise, it is printed in the usual text font.@refill
+
+@table @code
+@findex defcv
+@item @@defcv @var{category} @var{class} @var{name}
+The @code{@@defcv} command is the general definition command for
+variables associated with classes in object-oriented programming. The
+@code{@@defcv} command is followed by three arguments: the category of
+thing being defined, the class to which it belongs, and its
+name. Thus,@refill
+
+@example
+@group
+@@defcv @{Class Option@} Window border-pattern
+@dots{}
+@@end defcv
+@end group
+@end example
+
+@noindent
+illustrates how you would write the first line of a definition of the
+@code{border-pattern} class option of the class @code{Window}.@refill
+
+The template is
+
+@example
+@group
+@@defcv @var{category} @var{class} @var{name}
+@dots{}
+@@end defcv
+@end group
+@end example
+
+@code{@@defcv} creates an entry in the index of variables.
+
+@findex defivar
+@item @@defivar @var{class} @var{name}
+The @code{@@defivar} command is the definition command for instance
+variables in object-oriented programming. @code{@@defivar} is
+equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill
+
+The template is:
+
+@example
+@group
+@@defivar @var{class} @var{instance-variable-name}
+@var{body-of-definition}
+@@end defivar
+@end group
+@end example
+
+@code{@@defivar} creates an entry in the index of variables.
+
+@findex defop
+@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
+The @code{@@defop} command is the general definition command for
+entities that may resemble methods in object-oriented programming.
+These entities take arguments, as functions do, but are associated
+with particular classes of objects.@refill
+
+For example, some systems have constructs called @dfn{wrappers} that
+are associated with classes as methods are, but that act more like
+macros than like functions. You could use @code{@@defop Wrapper} to
+describe one of these.@refill
+
+Sometimes it is useful to distinguish methods and @dfn{operations}.
+You can think of an operation as the specification for a method.
+Thus, a window system might specify that all window classes have a
+method named @code{expose}; we would say that this window system
+defines an @code{expose} operation on windows in general. Typically,
+the operation has a name and also specifies the pattern of arguments;
+all methods that implement the operation must accept the same
+arguments, since applications that use the operation do so without
+knowing which method will implement it.@refill
+
+Often it makes more sense to document operations than methods. For
+example, window application developers need to know about the
+@code{expose} operation, but need not be concerned with whether a
+given class of windows has its own method to implement this operation.
+To describe this operation, you would write:@refill
+
+@example
+@@defop Operation windows expose
+@end example
+
+The @code{@@defop} command is written at the beginning of a line and
+is followed on the same line by the overall name of the category of
+operation, the name of the class of the operation, the name of the
+operation, and its arguments, if any.@refill
+
+@need 800
+@noindent
+The template is:
+
+@example
+@group
+@@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end defop
+@end group
+@end example
+
+@code{@@defop} creates an entry, such as `@code{expose} on
+@code{windows}', in the index of functions.@refill
+
+@findex defmethod
+@item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
+The @code{@@defmethod} command is the definition command for methods
+in object-oriented programming. A method is a kind of function that
+implements an operation for a particular class of objects and its
+subclasses. In the Lisp Machine, methods actually were functions, but
+they were usually defined with @code{defmethod}.
+
+@code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
+The command is written at the beginning of a line and is followed by
+the name of the class of the method, the name of the method, and its
+arguments, if any.@refill
+
+@need 800
+@noindent
+For example,
+
+@example
+@group
+@@defmethod @code{bar-class} bar-method argument
+@dots{}
+@@end defmethod
+@end group
+@end example
+
+@noindent
+illustrates the definition for a method called @code{bar-method} of
+the class @code{bar-class}. The method takes an argument.@refill
+
+The template is:
+
+@example
+@group
+@@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
+@var{body-of-definition}
+@@end defmethod
+@end group
+@end example
+
+@code{@@defmethod} creates an entry, such as `@code{bar-method} on
+@code{bar-class}', in the index of functions.@refill
+@end table
+
+@node Data Types, , Abstract Objects, Def Cmds in Detail
+@subsection Data Types
+
+Here is the command for data types:@refill
+
+@table @code
+@findex deftp
+@item @@deftp @var{category} @var{name} @var{attributes}@dots{}
+The @code{@@deftp} command is the generic definition command for data
+types. The command is written at the beginning of a line and is
+followed on the same line by the category, by the name of the type
+(which is a word like @code{int} or @code{float}), and then by names of
+attributes of objects of that type. Thus, you could use this command
+for describing @code{int} or @code{float}, in which case you could use
+@code{data type} as the category. (A data type is a category of
+certain objects for purposes of deciding which operations can be
+performed on them.)@refill
+
+In Lisp, for example, @dfn{pair} names a particular data
+type, and an object of that type has two slots called the
+@sc{car} and the @sc{cdr}. Here is how you would write the first line
+of a definition of @code{pair}.@refill
+
+@example
+@group
+@@deftp @{Data type@} pair car cdr
+@dots{}
+@@end deftp
+@end group
+@end example
+
+@need 950
+The template is:
+
+@example
+@group
+@@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
+@var{body-of-definition}
+@@end deftp
+@end group
+@end example
+
+@code{@@deftp} creates an entry in the index of data types.
+@end table
+
+@node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands
+@section Conventions for Writing Definitions
+@cindex Definition conventions
+@cindex Conventions for writing definitions
+
+When you write a definition using @code{@@deffn}, @code{@@defun}, or
+one of the other definition commands, please take care to use
+arguments that indicate the meaning, as with the @var{count} argument
+to the @code{forward-word} function. Also, if the name of an argument
+contains the name of a type, such as @var{integer}, take care that the
+argument actually is of that type.@refill
+
+@node Sample Function Definition, , Def Cmd Conventions, Definition Commands
+@section A Sample Function Definition
+@cindex Function definitions
+@cindex Command definitions
+@cindex Macro definitions
+@cindex Sample function definition
+
+A function definition uses the @code{@@defun} and @code{@@end defun}
+commands. The name of the function follows immediately after the
+@code{@@defun} command and it is followed, on the same line, by the
+parameter list.@refill
+
+Here is a definition from @cite{The GNU Emacs Lisp Reference Manual}.
+(@xref{Calling Functions, , Calling Functions, elisp, The GNU Emacs
+Lisp Reference Manual}.)
+
+@quotation
+@defun apply function &rest arguments
+@code{apply} calls @var{function} with @var{arguments}, just
+like @code{funcall} but with one difference: the last of
+@var{arguments} is a list of arguments to give to
+@var{function}, rather than a single argument. We also say
+that this list is @dfn{appended} to the other arguments.
+
+@code{apply} returns the result of calling @var{function}.
+As with @code{funcall}, @var{function} must either be a Lisp
+function or a primitive function; special forms and macros
+do not make sense in @code{apply}.
+
+@example
+(setq f 'list)
+ @result{} list
+(apply f 'x 'y 'z)
+@error{} Wrong type argument: listp, z
+(apply '+ 1 2 '(3 4))
+ @result{} 10
+(apply '+ '(1 2 3 4))
+ @result{} 10
+
+(apply 'append '((a b c) nil (x y z) nil))
+ @result{} (a b c x y z)
+@end example
+
+An interesting example of using @code{apply} is found in the description
+of @code{mapcar}.@refill
+@end defun
+@end quotation
+
+@need 1200
+In the Texinfo source file, this example looks like this:
+
+@example
+@group
+@@defun apply function &rest arguments
+
+@@code@{apply@} calls @@var@{function@} with
+@@var@{arguments@}, just like @@code@{funcall@} but with one
+difference: the last of @@var@{arguments@} is a list of
+arguments to give to @@var@{function@}, rather than a single
+argument. We also say that this list is @@dfn@{appended@}
+to the other arguments.
+@end group
+
+@group
+@@code@{apply@} returns the result of calling
+@@var@{function@}. As with @@code@{funcall@},
+@@var@{function@} must either be a Lisp function or a
+primitive function; special forms and macros do not make
+sense in @@code@{apply@}.
+@end group
+
+@group
+@@example
+(setq f 'list)
+ @@result@{@} list
+(apply f 'x 'y 'z)
+@@error@{@} Wrong type argument: listp, z
+(apply '+ 1 2 '(3 4))
+ @@result@{@} 10
+(apply '+ '(1 2 3 4))
+ @@result@{@} 10
+
+(apply 'append '((a b c) nil (x y z) nil))
+ @@result@{@} (a b c x y z)
+@@end example
+@end group
+
+@group
+An interesting example of using @@code@{apply@} is found
+in the description of @@code@{mapcar@}.@@refill
+@@end defun
+@end group
+@end example
+
+@noindent
+In this manual, this function is listed in the Command and Variable
+Index under @code{apply}.@refill
+
+Ordinary variables and user options are described using a format like
+that for functions except that variables do not take arguments.
+
+@node Footnotes, Conditionals, Definition Commands, Top
+@comment node-name, next, previous, up
+@chapter Footnotes
+@cindex Footnotes
+@findex footnote
+
+A @dfn{footnote} is for a reference that documents or elucidates the
+primary text.@footnote{A footnote should complement or expand upon
+the primary text, but a reader should not need to read a footnote to
+understand the primary text. For a thorough discussion of footnotes,
+see @cite{The Chicago Manual of Style}, which is published by the
+University of Chicago Press.}@refill
+
+@menu
+* Footnote Commands:: How to write a footnote in Texinfo.
+* Footnote Styles:: Controlling how footnotes appear in Info.
+@end menu
+
+@node Footnote Commands, Footnote Styles, Footnotes, Footnotes
+@section Footnote Commands
+
+In Texinfo, footnotes are created with the @code{@@footnote} command.
+This command is followed immediately by a left brace, then by the text
+of the footnote, and then by a terminating right brace. The template
+is:
+
+@example
+@@footnote@{@var{text}@}
+@end example
+
+Footnotes may be of any length, but are usually short.@refill
+
+For example, this clause is followed by a sample
+footnote@footnote{Here is the sample footnote.}; in the Texinfo
+source, it looks like this:@refill
+
+@example
+@dots{}a sample footnote @@footnote@{Here is the sample
+footnote.@}; in the Texinfo source@dots{}
+@end example
+
+@strong{Warning:} Don't use footnotes in the argument of the
+@code{@@item} command for a @code{@@table} table. This doesn't work;
+because of limitations of @TeX{}, there is no way to fix it. To avoid
+the problem, move the footnote into the body text of the table.
+
+In a printed manual or book, the reference mark for a footnote is a
+small, superscripted number; the text of the footnote appears at the
+bottom of the page, below a horizontal line.@refill
+
+In Info, the reference mark for a footnote is a pair of parentheses
+with the footnote number between them, like this: @samp{(1)}.@refill
+
+@node Footnote Styles, , Footnote Commands, Footnotes
+@section Footnote Styles
+
+Info has two footnote styles, which determine where the text of the
+footnote is located:@refill
+
+@itemize @bullet
+@cindex @samp{@r{End}} node footnote style
+@item
+In the `End' node style, all the footnotes for a single node
+are placed at the end of that node. The footnotes are separated from
+the rest of the node by a line of dashes with the word
+@samp{Footnotes} within it. Each footnote begins with an
+@samp{(@var{n})} reference mark.@refill
+
+@need 700
+@noindent
+Here is an example of a single footnote in the end of node style:@refill
+
+@example
+@group
+ --------- Footnotes ---------
+
+(1) Here is a sample footnote.
+@end group
+@end example
+
+@cindex @samp{@r{Separate}} footnote style
+@item
+In the `Separate' node style, all the footnotes for a single
+node are placed in an automatically constructed node of
+their own. In this style, a ``footnote reference'' follows
+each @samp{(@var{n})} reference mark in the body of the
+node. The footnote reference is actually a cross reference
+which you use to reach the footnote node.@refill
+
+The name of the node containing the footnotes is constructed
+by appending @w{@samp{-Footnotes}} to the name of the node
+that contains the footnotes. (Consequently, the footnotes'
+node for the @file{Footnotes} node is
+@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
+`Up' node pointer that leads back to its parent node.@refill
+
+@noindent
+Here is how the first footnote in this manual looks after being
+formatted for Info in the separate node style:@refill
+
+@smallexample
+@group
+File: texinfo.info Node: Overview-Footnotes, Up: Overview
+
+(1) Note that the first syllable of "Texinfo" is
+pronounced like "speck", not "hex". @dots{}
+@end group
+@end smallexample
+@end itemize
+
+A Texinfo file may be formatted into an Info file with either footnote
+style.@refill
+
+@findex footnotestyle
+Use the @code{@@footnotestyle} command to specify an Info file's
+footnote style. Write this command at the beginning of a line followed
+by an argument, either @samp{end} for the end node style or
+@samp{separate} for the separate node style.
+
+@need 700
+For example,
+
+@example
+@@footnotestyle end
+@end example
+@noindent
+or
+@example
+@@footnotestyle separate
+@end example
+
+Write an @code{@@footnotestyle} command before or shortly after the
+end-of-header line at the beginning of a Texinfo file. (If you
+include the @code{@@footnotestyle} command between the start-of-header
+and end-of-header lines, the region formatting commands will format
+footnotes as specified.)@refill
+
+If you do not specify a footnote style, the formatting commands use
+their default style. Currently, @code{texinfo-format-buffer} and
+@code{texinfo-format-region} use the `separate' style and
+@code{makeinfo} uses the `end' style.@refill
+
+@c !!! note: makeinfo's --footnote-style option overrides footnotestyle
+@ignore
+If you use @code{makeinfo} to create the Info file, the
+@samp{--footnote-style} option determines which style is used,
+@samp{end} for the end of node style or @samp{separate} for the
+separate node style. Thus, to format the Texinfo manual in the
+separate node style, you would use the following shell command:@refill
+
+@example
+makeinfo --footnote-style=separate texinfo.texi
+@end example
+
+@noindent
+To format the Texinfo manual in the end of node style, you would
+type:@refill
+
+@example
+makeinfo --footnote-style=end texinfo.texi
+@end example
+@end ignore
+@ignore
+If you use @code{texinfo-format-buffer} or
+@code{texinfo-format-region} to create the Info file, the value of the
+@code{texinfo-footnote-style} variable controls the footnote style.
+It can be either @samp{"separate"} for the separate node style or
+@samp{"end"} for the end of node style. (You can change the value of
+this variable with the @kbd{M-x edit-options} command (@pxref{Edit
+Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
+with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
+and Setting Variables, emacs, The GNU Emacs Manual}).@refill
+
+The @code{texinfo-footnote-style} variable also controls the style if
+you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
+command in Emacs.@refill
+@end ignore
+This chapter contains two footnotes.@refill
+
+@node Conditionals, Macros, Footnotes, Top
+@comment node-name, next, previous, up
+@chapter Conditionally Visible Text
+@cindex Conditionally visible text
+@cindex Text, conditionally visible
+@cindex Visibility of conditional text
+@cindex If text conditionally visible
+@findex ifhtml
+@findex ifinfo
+@findex iftex
+
+Sometimes it is good to use different text for a printed manual and
+its corresponding Info file. In this case, you can use the
+@dfn{conditional commands} to specify which text is for the printed manual
+and which is for the Info file.@refill
+
+@menu
+* Conditional Commands:: How to specify text for HTML, Info, or @TeX{}.
+* Using Ordinary TeX Commands:: You can use any and all @TeX{} commands.
+* set clear value:: How to designate which text to format (for
+ both Info and @TeX{}); and how to set a
+ flag to a string that you can insert.
+@end menu
+
+@node Conditional Commands, Using Ordinary TeX Commands, Conditionals, Conditionals
+@ifinfo
+@heading Using @code{@@ifinfo} and @code{@@iftex}
+@end ifinfo
+
+@code{@@ifinfo} begins segments of text that should be ignored
+by @TeX{} when it
+typesets the printed manual. The segment of text appears only
+in the Info file.
+The @code{@@ifinfo} command should appear on a line by itself; end
+the Info-only text with a line containing @code{@@end ifinfo} by
+itself. At the beginning of a Texinfo file, the Info permissions are
+contained within a region marked by @code{@@ifinfo} and @code{@@end
+ifinfo}. (@xref{Info Summary and Permissions}.)@refill
+
+The @code{@@iftex} and @code{@@end iftex} commands are similar to the
+@code{@@ifinfo} and @code{@@end ifinfo} commands, except that they
+specify text that will appear in the printed manual but not in the Info
+file. Likewise for @code{@@ifhtml} and @code{@@end ifhtml}, which
+specify text to appear only in HTML output.@refill
+
+@need 700
+For example,
+
+@example
+@@iftex
+This text will appear only in the printed manual.
+@@end iftex
+
+@@ifinfo
+However, this text will appear only in Info.
+@@end ifinfo
+@end example
+
+@noindent
+The preceding example produces the following line:
+
+@iftex
+This text will appear only in the printed manual.
+@end iftex
+
+@ifinfo
+However, this text will appear only in Info.
+@end ifinfo
+
+@noindent
+Note how you only see one of the two lines, depending on whether you
+are reading the Info version or the printed version of this
+manual.@refill
+
+The @code{@@titlepage} command is a special variant of @code{@@iftex} that
+is used for making the title and copyright pages of the printed
+manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill
+
+@node Using Ordinary TeX Commands, set clear value, Conditional Commands, Conditionals
+@comment node-name, next, previous, up
+@section Using Ordinary @TeX{} Commands
+@cindex @TeX{} commands, using ordinary
+@cindex Ordinary @TeX{} commands, using
+@cindex Commands using ordinary @TeX{}
+@cindex plain @TeX{}
+
+Inside a region delineated by @code{@@iftex} and @code{@@end iftex},
+you can embed some plain @TeX{} commands. Info will ignore these
+commands since they are only in that part of the file which is seen by
+@TeX{}. You can write the @TeX{} commands as you would write them in
+a normal @TeX{} file, except that you must replace the @samp{\} used
+by @TeX{} with an @samp{@@}. For example, in the @code{@@titlepage}
+section of a Texinfo file, you can use the @TeX{} command
+@code{@@vskip} to format the copyright page. (The @code{@@titlepage}
+command causes Info to ignore the region automatically, as it does
+with the @code{@@iftex} command.)@refill
+
+However, many features of plain @TeX{} will not work, as they are
+overridden by features of Texinfo.
+
+@findex tex
+You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{}
+commands, by delineating a region with the @code{@@tex} and @code{@@end
+tex} commands. (The @code{@@tex} command also causes Info to ignore the
+region, like the @code{@@iftex}
+command.)@refill
+
+@cindex Mathematical expressions
+For example, here is a mathematical expression written in
+plain @TeX{}:@refill
+
+@example
+@@tex
+$$ \chi^2 = \sum_@{i=1@}^N
+ \left (y_i - (a + b x_i)
+ \over \sigma_i\right)^2 $$
+@@end tex
+@end example
+
+@noindent
+The output of this example will appear only in a printed manual. If
+you are reading this in Info, you will not see anything after this
+paragraph.
+@iftex
+In a printed manual, the above expression looks like
+this:
+@end iftex
+
+@tex
+$$ \chi^2 = \sum_{i=1}^N
+ \left(y_i - (a + b x_i)
+ \over \sigma_i\right)^2 $$
+@end tex
+
+@node set clear value, , Using Ordinary TeX Commands, Conditionals
+@comment node-name, next, previous, up
+@section @code{@@set}, @code{@@clear}, and @code{@@value}
+
+You can direct the Texinfo formatting commands to format or ignore parts
+of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
+and @code{@@ifclear} commands.@refill
+
+In addition, you can use the @code{@@set @var{flag}} command to set the
+value of @var{flag} to a string of characters; and use
+@code{@@value@{@var{flag}@}} to insert that string. You can use
+@code{@@set}, for example, to set a date and use @code{@@value} to
+insert the date in several places in the Texinfo file.@refill
+
+@menu
+* ifset ifclear:: Format a region if a flag is set.
+* value:: Replace a flag with a string.
+* value Example:: An easy way to update edition information.
+@end menu
+
+@node ifset ifclear, value, set clear value, set clear value
+@subsection @code{@@ifset} and @code{@@ifclear}
+
+@findex ifset
+When a @var{flag} is set, the Texinfo formatting commands format text
+between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
+ifset} commands. When the @var{flag} is cleared, the Texinfo formatting
+commands do @emph{not} format the text.
+
+Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a
+@var{flag}; a @dfn{flag} can be any single word. The format for the
+command looks like this:@refill
+@findex set
+
+@example
+@@set @var{flag}
+@end example
+
+Write the conditionally formatted text between @code{@@ifset @var{flag}}
+and @code{@@end ifset} commands, like this:@refill
+
+@example
+@group
+@@ifset @var{flag}
+@var{conditional-text}
+@@end ifset
+@end group
+@end example
+
+For example, you can create one document that has two variants, such as
+a manual for a `large' and `small' model:@refill
+
+@example
+You can use this machine to dig up shrubs
+without hurting them.
+
+@@set large
+
+@@ifset large
+It can also dig up fully grown trees.
+@@end ifset
+
+Remember to replant promptly @dots{}
+@end example
+
+@noindent
+In the example, the formatting commands will format the text between
+@code{@@ifset large} and @code{@@end ifset} because the @code{large}
+flag is set.@refill
+
+@findex clear
+Use the @code{@@clear @var{flag}} command to turn off, or @dfn{clear},
+a flag. Clearing a flag is the opposite of setting a flag. The
+command looks like this:@refill
+
+@example
+@@clear @var{flag}
+@end example
+
+@noindent
+Write the command on a line of its own.
+
+When @var{flag} is cleared, the Texinfo formatting commands do
+@emph{not} format the text between @code{@@ifset @var{flag}} and
+@code{@@end ifset}; that text is ignored and does not appear in either
+printed or Info output.@refill
+
+For example, if you clear the flag of the preceding example by writing
+an @code{@@clear large} command after the @code{@@set large} command
+(but before the conditional text), then the Texinfo formatting commands
+ignore the text between the @code{@@ifset large} and @code{@@end ifset}
+commands. In the formatted output, that text does not appear; in both
+printed and Info output, you see only the lines that say, ``You can use
+this machine to dig up shrubs without hurting them. Remember to replant
+promptly @dots{}''.
+
+@findex ifclear
+If a flag is cleared with an @code{@@clear @var{flag}} command, then
+the formatting commands format text between subsequent pairs of
+@code{@@ifclear} and @code{@@end ifclear} commands. But if the flag
+is set with @code{@@set @var{flag}}, then the formatting commands do
+@emph{not} format text between an @code{@@ifclear} and an @code{@@end
+ifclear} command; rather, they ignore that text. An @code{@@ifclear}
+command looks like this:@refill
+
+@example
+@@ifclear @var{flag}
+@end example
+
+@need 700
+In brief, the commands are:@refill
+
+@table @code
+@item @@set @var{flag}
+Tell the Texinfo formatting commands that @var{flag} is set.@refill
+
+@item @@clear @var{flag}
+Tell the Texinfo formatting commands that @var{flag} is cleared.@refill
+
+@item @@ifset @var{flag}
+If @var{flag} is set, tell the Texinfo formatting commands to format
+the text up to the following @code{@@end ifset} command.@refill
+
+If @var{flag} is cleared, tell the Texinfo formatting commands to
+ignore text up to the following @code{@@end ifset} command.@refill
+
+@item @@ifclear @var{flag}
+If @var{flag} is set, tell the Texinfo formatting commands to ignore
+the text up to the following @code{@@end ifclear} command.@refill
+
+If @var{flag} is cleared, tell the Texinfo formatting commands to
+format the text up to the following @code{@@end ifclear}
+command.@refill
+@end table
+
+@node value, value Example, ifset ifclear, set clear value
+@subsection @code{@@value}
+@findex value
+
+You can use the @code{@@set} command to specify a value for a flag,
+which is expanded by the @code{@@value} command. The value is a string
+a characters.
+
+Write the @code{@@set} command like this:
+
+@example
+@@set foo This is a string.
+@end example
+
+@noindent
+This sets the value of @code{foo} to ``This is a string.''
+
+The Texinfo formatters replace an @code{@@value@{@var{flag}@}} command with
+the string to which @var{flag} is set.@refill
+
+Thus, when @code{foo} is set as shown above, the Texinfo formatters convert
+
+@example
+@group
+@@value@{foo@}
+@exdent @r{to}
+This is a string.
+@end group
+@end example
+
+You can write an @code{@@value} command within a paragraph; but you
+must write an @code{@@set} command on a line of its own.
+
+If you write the @code{@@set} command like this:
+
+@example
+@@set foo
+@end example
+
+@noindent
+without specifying a string, the value of @code{foo} is an empty string.
+
+If you clear a previously set flag with an @code{@@clear @var{flag}}
+command, a subsequent @code{@@value@{flag@}} command is invalid and the
+string is replaced with an error message that says @samp{@{No value for
+"@var{flag}"@}}.
+
+For example, if you set @code{foo} as follows:@refill
+
+@example
+@@set how-much very, very, very
+@end example
+
+@noindent
+then the formatters transform
+
+@example
+@group
+It is a @@value@{how-much@} wet day.
+@exdent @r{into}
+It is a very, very, very wet day.
+@end group
+@end example
+
+If you write
+
+@example
+@@clear how-much
+@end example
+
+@noindent
+then the formatters transform
+
+@example
+@group
+It is a @@value@{how-much@} wet day.
+@exdent @r{into}
+It is a @{No value for "how-much"@} wet day.
+@end group
+@end example
+
+@node value Example, , value, set clear value
+@subsection @code{@@value} Example
+
+You can use the @code{@@value} command to limit the number of places you
+need to change when you record an update to a manual.
+Here is how it is done in @cite{The GNU Make Manual}:
+
+@need 1000
+@noindent
+Set the flags:
+
+@example
+@group
+@@set EDITION 0.35 Beta
+@@set VERSION 3.63 Beta
+@@set UPDATED 14 August 1992
+@@set UPDATE-MONTH August 1992
+@end group
+@end example
+
+@need 750
+@noindent
+Write text for the first @code{@@ifinfo} section, for people reading the
+Texinfo file:
+
+@example
+@group
+This is Edition @@value@{EDITION@},
+last updated @@value@{UPDATED@},
+of @@cite@{The GNU Make Manual@},
+for @@code@{make@}, Version @@value@{VERSION@}.
+@end group
+@end example
+
+@need 1000
+@noindent
+Write text for the title page, for people reading the printed manual:
+@c List only the month and the year since that looks less fussy on a
+@c printed cover than a date that lists the day as well.
+
+@example
+@group
+@@title GNU Make
+@@subtitle A Program for Directing Recompilation
+@@subtitle Edition @@value@{EDITION@}, @dots{}
+@@subtitle @@value@{UPDATE-MONTH@}
+@end group
+@end example
+
+@noindent
+(On a printed cover, a date listing the month and the year looks less
+fussy than a date listing the day as well as the month and year.)
+
+@need 750
+@noindent
+Write text for the Top node, for people reading the Info file:
+
+@example
+@group
+This is Edition @@value@{EDITION@}
+of the @@cite@{GNU Make Manual@},
+last updated @@value@{UPDATED@}
+for @@code@{make@} Version @@value@{VERSION@}.
+@end group
+@end example
+
+@need 950
+After you format the manual, the text in the first @code{@@ifinfo}
+section looks like this:
+
+@example
+@group
+This is Edition 0.35 Beta, last updated 14 August 1992,
+of `The GNU Make Manual', for `make', Version 3.63 Beta.
+@end group
+@end example
+
+When you update the manual, change only the values of the flags; you do
+not need to rewrite the three sections.
+
+
+@node Macros, Format/Print Hardcopy, Conditionals, Top
+@chapter Macros: Defining New Texinfo Commands
+@cindex Macros
+@cindex Defining new Texinfo commands
+@cindex New Texinfo commands, defining
+@cindex Texinfo commands, defining new
+@cindex User-defined Texinfo commands
+
+A Texinfo @dfn{macro} allows you to define a new Texinfo command as any
+sequence of text and/or existing commands (including other macros). The
+macro can have any number of @dfn{parameters}---text you supply each
+time you use the macro. (This has nothing to do with the
+@code{@@defmac} command, which is for documenting macros in the subject
+of the manual; @pxref{Def Cmd Template}.)
+
+@menu
+* Defining Macros:: Both defining and undefining new commands.
+* Invoking Macros:: Using a macro, once you've defined it.
+@end menu
+
+
+@node Defining Macros, Invoking Macros, Macros, Macros
+@section Defining Macros
+@cindex Defining macros
+@cindex Macro definitions
+
+@findex macro
+You use the Texinfo @code{@@macro} command to define a macro. For example:
+
+@example
+@@macro @var{macro-name}@{@var{param1}, @var{param2}, @dots{}@}
+@var{text} @dots{} \@var{param1}\ @dots{}
+@@end macro
+@end example
+
+The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
+arguments supplied when the macro is subsequently used in the document
+(see the next section).
+
+If a macro needs no parameters, you can define it either with an empty
+list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
+foo}).
+
+@cindex Body of a macro
+@cindex Mutually recursive macros
+@cindex Recursion, mutual
+The definition or @dfn{body} of the macro can contain any Texinfo
+commands, including previously-defined macros. (It is not possible to
+have mutually recursive Texinfo macros.) In the body, instances of a
+parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in
+the example above, are replaced by the corresponding argument from the
+macro invocation.
+
+@findex unmacro
+@cindex Macros, undefining
+@cindex Undefining macros
+You can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}.
+It is not an error to undefine a macro that is already undefined.
+For example:
+
+@example
+@@unmacro foo
+@end example
+
+
+@node Invoking Macros, , Defining Macros, Macros
+@section Invoking Macros
+@cindex Invoking macros
+@cindex Macro invocation
+
+After a macro is defined (see the previous section), you can use
+(@dfn{invoke}) it in your document like this:
+
+@example
+@@@var{macro-name} @{@var{arg1}, @var{arg2}, @dots{}@}
+@end example
+
+@noindent and the result will be just as if you typed the body of
+@var{macro-name} at that spot. For example:
+
+@example
+@@macro foo @{p, q@}
+Together: \p\ & \q\.
+@@end macro
+@@foo@{a, b@}
+@end example
+
+@noindent produces:
+
+@display
+Together: a & b.
+@end display
+
+@cindex Backslash, and macros
+Thus, the arguments and parameters are separated by commas and delimited
+by braces; any whitespace after (but not before) a comma is ignored. To
+insert a comma, brace, or backslash in an argument, prepend a backslash,
+as in
+
+@example
+@@@var{macro-name} @{\\\@{\@}\,@}
+@end example
+
+@noindent
+which will pass the (almost certainly error-producing) argument
+@samp{\@{@},} to @var{macro-name}.
+
+If the macro is defined to take a single argument, and is invoked
+without any braces, the entire rest of the line after the macro name is
+supplied as the argument. For example:
+
+@example
+@@macro bar @{p@}
+Twice: \p\, \p\.
+@@end macro
+@@bar aah
+@end example
+
+@noindent produces:
+
+@display
+Twice: aah, aah.
+@end display
+
+
+@node Format/Print Hardcopy, Create an Info File, Macros, Top
+@comment node-name, next, previous, up
+@chapter Format and Print Hardcopy
+@cindex Format and print hardcopy
+@cindex Hardcopy, printing it
+@cindex Making a printed manual
+@cindex Sorting indices
+@cindex Indices, sorting
+@cindex @TeX{} index sorting
+@pindex texindex
+
+There are three major shell commands for making a printed manual from a
+Texinfo file: one for converting the Texinfo file into a file that will be
+printed, a second for sorting indices, and a third for printing the
+formatted document. When you use the shell commands, you can either
+work directly in the operating system shell or work within a shell
+inside GNU Emacs.@refill
+
+If you are using GNU Emacs, you can use commands provided by Texinfo
+mode instead of shell commands. In addition to the three commands to
+format a file, sort the indices, and print the result, Texinfo mode
+offers key bindings for commands to recenter the output buffer, show the
+print queue, and delete a job from the print queue.@refill
+
+@menu
+* Use TeX:: Use @TeX{} to format for hardcopy.
+* Format with tex/texindex:: How to format in a shell.
+* Format with texi2dvi:: A simpler way to use the shell.
+* Print with lpr:: How to print.
+* Within Emacs:: How to format and print from an Emacs shell.
+* Texinfo Mode Printing:: How to format and print in Texinfo mode.
+* Compile-Command:: How to print using Emacs's compile command.
+* Requirements Summary:: @TeX{} formatting requirements summary.
+* Preparing for TeX:: What you need to do to use @TeX{}.
+* Overfull hboxes:: What are and what to do with overfull hboxes.
+* smallbook:: How to print small format books and manuals.
+* A4 Paper:: How to print on European A4 paper.
+* Cropmarks and Magnification:: How to print marks to indicate the size
+ of pages and how to print scaled up output.
+@end menu
+
+@node Use TeX, Format with tex/texindex, Format/Print Hardcopy, Format/Print Hardcopy
+@ifinfo
+@heading Use @TeX{}
+@end ifinfo
+
+The typesetting program called @TeX{} is used for formatting a Texinfo
+file. @TeX{} is a very powerful typesetting program and, if used right,
+does an exceptionally good job. @xref{Obtaining TeX, , How to Obtain
+@TeX{}}, for information on how to obtain @TeX{}.@refill
+
+The @code{makeinfo}, @code{texinfo-format-region}, and
+@code{texinfo-format-buffer} commands read the very same @@-commands
+in the Texinfo file as does @TeX{}, but process them differently to
+make an Info file; see @ref{Create an Info File}.@refill
+
+@node Format with tex/texindex, Format with texi2dvi, Use TeX, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Format using @code{tex} and @code{texindex}
+@cindex Shell formatting with @code{tex} and @code{texindex}
+@cindex Formatting with @code{tex} and @code{texindex}
+@cindex DVI file
+
+Format the Texinfo file with the shell command @code{tex} followed by
+the name of the Texinfo file. This command produces a formatted
+@sc{dvi} file as well as several auxiliary files containing indices,
+cross references, etc. The @sc{dvi} file (for @dfn{DeVice Independent}
+file) can be printed on a wide variety of printers.@refill
+
+The @code{tex} formatting command itself does not sort the indices; it
+writes an output file of unsorted index data. This is a misfeature of
+@TeX{}. (The @code{texi2dvi} command automatically generates indices;
+see @ref{Format with texi2dvi, , Format using @code{texi2dvi}}.) To
+generate a printed index after running the @code{tex} command, you first
+need a sorted index to work from. The @code{texindex} command sorts
+indices. (The source file @file{texindex.c} comes as part of the
+standard GNU distribution and is usually installed when Emacs is
+installed.)@refill
+@pindex texindex
+@ignore
+Usage: texindex [-k] [-T tempdir] infile [-o outfile] ...
+
+Each infile arg can optionally be followed by a `-o outfile' arg;
+for each infile that is not followed by a -o arg, the infile name with
+`s' (for `sorted') appended is used for the outfile.
+
+-T dir is the directory to put temp files in, instead of /tmp.
+-k means `keep tempfiles', for debugging.
+@end ignore
+
+The @code{tex} formatting command outputs unsorted index files under
+names that obey a standard convention. These names are the name of
+your main input file to the @code{tex} formatting command, with
+everything after the first period thrown away, and the two letter
+names of indices added at the end. For example, the raw index output
+files for the input file @file{foo.texinfo} would be @file{foo.cp},
+@file{foo.vr}, @file{foo.fn}, @file{foo.tp}, @file{foo.pg} and
+@file{foo.ky}. Those are exactly the arguments to give to
+@code{texindex}.@refill
+
+@need 1000
+Or else, you can use @samp{??} as ``wild-cards'' and give the command in
+this form:@refill
+
+@example
+texindex foo.??
+@end example
+
+@noindent
+This command will run @code{texindex} on all the unsorted index files,
+including any that you have defined yourself using @code{@@defindex}
+or @code{@@defcodeindex}. (You may execute @samp{texindex foo.??}
+even if there are similarly named files with two letter extensions
+that are not index files, such as @samp{foo.el}. The @code{texindex}
+command reports but otherwise ignores such files.)@refill
+
+For each file specified, @code{texindex} generates a sorted index file
+whose name is made by appending @samp{s} to the input file name. The
+@code{@@printindex} command knows to look for a file of that name.
+@code{texindex} does not alter the raw index output file.@refill
+
+After you have sorted the indices, you need to rerun the @code{tex}
+formatting command on the Texinfo file. This regenerates a formatted
+@sc{dvi} file with up-to-date index entries.@footnote{If you use more
+than one index and have cross references to an index other than the
+first, you must run @code{tex} @emph{three times} to get correct output:
+once to generate raw index data; again (after @code{texindex}) to output
+the text of the indices and determine their true page numbers; and a
+third time to output correct page numbers in cross references to them.
+However, cross references to indices are rare.}@refill
+
+To summarize, this is a three step process:
+
+@enumerate
+@item
+Run the @code{tex} formatting command on the Texinfo file. This
+generates the formatted @sc{dvi} file as well as the raw index files
+with two letter extensions.@refill
+
+@item
+Run the shell command @code{texindex} on the raw index files to sort
+them. This creates the corresponding sorted index files.@refill
+
+@item
+Rerun the @code{tex} formatting command on the Texinfo file. This
+regenerates a formatted @sc{dvi} file with the index entries in the
+correct order. This second run also corrects the page numbers for
+the cross references. (The tables of contents are always correct.)@refill
+@end enumerate
+
+You need not run @code{texindex} each time after you run the
+@code{tex} formatting. If you do not, on the next run, the @code{tex}
+formatting command will use whatever sorted index files happen to
+exist from the previous use of @code{texindex}. This is usually
+@sc{ok} while you are debugging.@refill
+
+@node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Format using @code{texi2dvi}
+@pindex texi2dvi @r{(shell script)}
+
+The @code{texi2dvi} command is a shell script that automatically runs
+both @code{tex} and @code{texindex} as many times as necessary to
+produce a @sc{dvi} file with up-to-date, sorted indices. It simplifies
+the @code{tex}---@code{texindex}---@code{tex} sequence described in the
+previous section.
+
+@need 1000
+The syntax for @code{texi2dvi} is like this (where @samp{prompt$} is the
+shell prompt):@refill
+
+@example
+prompt$ @kbd{texi2dvi @var{filename}@dots{}}
+@end example
+
+@node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Shell Print Using @code{lpr -d}
+@pindex lpr @r{(@sc{dvi} print command)}
+
+You can print a @sc{dvi} file with the @sc{dvi} print command. The
+precise printing command to use depends on your system; @samp{lpr -d} is
+common. The @sc{dvi} print command may require a file name without any
+extension or with a @samp{.dvi} extension.@refill
+
+@need 1200
+The following commands, for example, sort the indices, format, and
+print the @cite{Bison Manual} (where @samp{%} is the shell
+prompt):@refill
+
+@example
+@group
+% tex bison.texinfo
+% texindex bison.??
+% tex bison.texinfo
+% lpr -d bison.dvi
+@end group
+@end example
+
+@noindent
+(Remember that the shell commands may be different at your site; but
+these are commonly used versions.)@refill
+
+@need 1000
+Using the @code{texi2dvi} shell script, you simply need type:@refill
+
+@example
+@group
+% texi2dvi bison.texinfo
+% lpr -d bison.dvi
+@end group
+@end example
+
+@node Within Emacs, Texinfo Mode Printing, Print with lpr, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section From an Emacs Shell @dots{}
+@cindex Print, format from Emacs shell
+@cindex Format, print from Emacs shell
+@cindex Shell, format, print from
+@cindex Emacs shell, format, print from
+@cindex GNU Emacs shell, format, print from
+
+You can give formatting and printing commands from a shell within GNU
+Emacs. To create a shell within Emacs, type @kbd{M-x shell}. In this
+shell, you can format and print the document. @xref{Format/Print
+Hardcopy, , Format and Print Hardcopy}, for details.@refill
+
+You can switch to and from the shell buffer while @code{tex} is
+running and do other editing. If you are formatting a long document
+on a slow machine, this can be very convenient.@refill
+
+You can also use @code{texi2dvi} from an Emacs shell. For example,
+here is how to use @code{texi2dvi} to format and print @cite{Using and
+Porting GNU CC} from a shell within Emacs (where @samp{%} is the shell
+prompt):@refill
+
+@example
+@group
+% texi2dvi gcc.texinfo
+% lpr -d gcc.dvi
+@end group
+@end example
+@ifinfo
+
+@xref{Texinfo Mode Printing}, for more information about formatting
+and printing in Texinfo mode.@refill
+@end ifinfo
+
+@node Texinfo Mode Printing, Compile-Command, Within Emacs, Format/Print Hardcopy
+@section Formatting and Printing in Texinfo Mode
+@cindex Region printing in Texinfo mode
+@cindex Format and print in Texinfo mode
+@cindex Print and format in Texinfo mode
+
+Texinfo mode provides several predefined key commands for @TeX{}
+formatting and printing. These include commands for sorting indices,
+looking at the printer queue, killing the formatting job, and
+recentering the display of the buffer in which the operations
+occur.@refill
+
+@table @kbd
+@item C-c C-t C-b
+@itemx M-x texinfo-tex-buffer
+Run @code{texi2dvi} on the current buffer.@refill
+
+@item C-c C-t C-r
+@itemx M-x texinfo-tex-region
+Run @TeX{} on the current region.@refill
+
+@item C-c C-t C-i
+@itemx M-x texinfo-texindex
+Sort the indices of a Texinfo file formatted with
+@code{texinfo-tex-region}.@refill
+
+@item C-c C-t C-p
+@itemx M-x texinfo-tex-print
+Print a @sc{dvi} file that was made with @code{texinfo-tex-region} or
+@code{texinfo-tex-buffer}.@refill
+
+@item C-c C-t C-q
+@itemx M-x tex-show-print-queue
+Show the print queue.@refill
+
+@item C-c C-t C-d
+@itemx M-x texinfo-delete-from-print-queue
+Delete a job from the print queue; you will be prompted for the job
+number shown by a preceding @kbd{C-c C-t C-q} command
+(@code{texinfo-show-tex-print-queue}).@refill
+
+@item C-c C-t C-k
+@itemx M-x tex-kill-job
+Kill the currently running @TeX{} job started by
+@code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
+process running in the Texinfo shell buffer.@refill
+
+@item C-c C-t C-x
+@itemx M-x texinfo-quit-job
+Quit a @TeX{} formatting job that has stopped because of an error by
+sending an @key{x} to it. When you do this, @TeX{} preserves a record
+of what it did in a @file{.log} file.@refill
+
+@item C-c C-t C-l
+@itemx M-x tex-recenter-output-buffer
+Redisplay the shell buffer in which the @TeX{} printing and formatting
+commands are run to show its most recent output.@refill
+@end table
+
+@need 1000
+Thus, the usual sequence of commands for formatting a buffer is as
+follows (with comments to the right):@refill
+
+@example
+@group
+C-c C-t C-b @r{Run @code{texi2dvi} on the buffer.}
+C-c C-t C-p @r{Print the @sc{dvi} file.}
+C-c C-t C-q @r{Display the printer queue.}
+@end group
+@end example
+
+The Texinfo mode @TeX{} formatting commands start a subshell in Emacs
+called the @file{*tex-shell*}. The @code{texinfo-tex-command},
+@code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
+commands are all run in this shell.
+
+You can watch the commands operate in the @samp{*tex-shell*} buffer,
+and you can switch to and from and use the @samp{*tex-shell*} buffer
+as you would any other shell buffer.@refill
+
+@need 1500
+The formatting and print commands depend on the values of several variables.
+The default values are:@refill
+
+@example
+@group
+ @r{Variable} @r{Default value}
+
+texinfo-texi2dvi-command "texi2dvi"
+texinfo-tex-command "tex"
+texinfo-texindex-command "texindex"
+texinfo-delete-from-print-queue-command "lprm"
+texinfo-tex-trailer "@@bye"
+tex-start-of-header "%**start"
+tex-end-of-header "%**end"
+tex-dvi-print-command "lpr -d"
+tex-show-queue-command "lpq"
+@end group
+@end example
+
+You can change the values of these variables with the @kbd{M-x
+edit-options} command (@pxref{Edit Options, , Editing Variable Values,
+emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command
+(@pxref{Examining, , Examining and Setting Variables, emacs, The GNU
+Emacs Manual}), or with your @file{.emacs} initialization file
+(@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill
+
+@node Compile-Command, Requirements Summary, Texinfo Mode Printing, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Using the Local Variables List
+@cindex Local variables
+@cindex Compile command for formatting
+@cindex Format with the compile command
+
+Yet another way to apply the @TeX{} formatting command to a Texinfo file
+is to put that command in a @dfn{local variables list} at the end of the
+Texinfo file. You can then specify the @code{tex} or @code{texi2dvi}
+commands as a @code{compile-command} and have Emacs run it by typing
+@kbd{M-x compile}. This creates a special shell called the
+@file{*compilation*} buffer in which Emacs runs the compile command.
+For example, at the end of the @file{gdb.texinfo} file, after the
+@code{@@bye}, you could put the following:@refill
+
+@example
+@group
+@@c Local Variables:
+@@c compile-command: "texi2dvi gdb.texinfo"
+@@c End:
+@end group
+@end example
+
+@noindent
+This technique is most often used by programmers who also compile programs
+this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
+
+@node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section @TeX{} Formatting Requirements Summary
+@cindex Requirements for formatting
+@cindex Formatting requirements
+
+Every Texinfo file that is to be input to @TeX{} must begin with a
+@code{\input} command and must contain an @code{@@setfilename} command and
+an @code{@@settitle} command:@refill
+
+@example
+\input texinfo
+@@setfilename @var{arg-not-used-by-@TeX{}}
+@@settitle @var{name-of-manual}
+@end example
+
+@noindent
+The first command instructs @TeX{} to load the macros it needs to
+process a Texinfo file, the second command opens auxiliary files, and
+the third specifies the title of printed manual.
+
+@need 1000
+Every Texinfo file must end with a line that terminates @TeX{}
+processing and forces out unfinished pages:@refill
+
+@example
+@@bye
+@end example
+
+Strictly speaking, these four lines are all a Texinfo file needs for
+@TeX{}, besides the body. (The @code{@@setfilename} line is the only
+line that a Texinfo file needs for Info formatting.)@refill
+
+Usually, the file's first line contains an @samp{@@c -*-texinfo-*-}
+comment that causes Emacs to switch to Texinfo mode when you edit the
+file. In addition, the beginning usually includes an
+@code{@@setchapternewpage} command, a title page, a copyright page, and
+permissions. Besides an @code{@@bye}, the end of a file usually
+includes indices and a table of contents.@refill
+
+@iftex
+For more information, see
+@ref{setchapternewpage, , @code{@@setchapternewpage}},
+@ref{Headings, ,Page Headings},
+@ref{Titlepage & Copyright Page},
+@ref{Printing Indices & Menus}, and
+@ref{Contents}.
+@end iftex
+@noindent
+@ifinfo
+For more information, see@*
+@ref{setchapternewpage, , @code{@@setchapternewpage}},@*
+@ref{Headings, ,Page Headings},@*
+@ref{Titlepage & Copyright Page},@*
+@ref{Printing Indices & Menus}, and@*
+@ref{Contents}.
+@end ifinfo
+
+@node Preparing for TeX, Overfull hboxes, Requirements Summary, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Preparing to Use @TeX{}
+@cindex Preparing to use @TeX{}
+@cindex @TeX{} input initialization
+@cindex @code{TEXINPUTS} environment variable
+@vindex TEXINPUTS
+@cindex @b{.profile} initialization file
+@cindex @b{.cshrc} initialization file
+@cindex Initialization file for @TeX{} input
+
+@TeX{} needs to know where to find the @file{texinfo.tex} file
+that you have told it to input with the @samp{\input texinfo} command
+at the beginning of the first line. The @file{texinfo.tex} file tells
+@TeX{} how to handle @@-commands. (@file{texinfo.tex} is
+included in the standard GNU distributions.)@refill
+
+Usually, the @file{texinfo.tex} file is put in the default directory
+that contains @TeX{} macros (the @file{/usr/lib/tex/macros}
+directory) when GNU Emacs or other GNU software is installed.
+In this case, @TeX{} will
+find the file and you do not need to do anything special.
+Alternatively, you can put @file{texinfo.tex} in the directory in
+which the Texinfo source file is located, and @TeX{} will find it
+there.@refill
+
+However, you may want to specify the location of the @code{\input} file
+yourself. One way to do this is to write the complete path for the file
+after the @code{\input} command. Another way is to set the
+@code{TEXINPUTS} environment variable in your @file{.cshrc} or
+@file{.profile} file. The @code{TEXINPUTS} environment variable will tell
+@TeX{} where to find the @file{texinfo.tex} file and any other file that
+you might want @TeX{} to use.@refill
+
+Whether you use a @file{.cshrc} or @file{.profile} file depends on
+whether you use @code{csh}, @code{sh}, or @code{bash} for your shell
+command interpreter. When you use @code{csh}, it looks to the
+@file{.cshrc} file for initialization information, and when you use
+@code{sh} or @code{bash}, it looks to the @file{.profile} file.@refill
+
+@need 1000
+In a @file{.cshrc} file, you could use the following @code{csh} command
+sequence:@refill
+
+@example
+setenv TEXINPUTS .:/usr/me/mylib:/usr/lib/tex/macros
+@end example
+
+@need 1000
+In a @file{.profile} file, you could use the following @code{sh} command
+sequence:
+
+@example
+@group
+TEXINPUTS=.:/usr/me/mylib:/usr/lib/tex/macros
+export TEXINPUTS
+@end group
+@end example
+
+@noindent
+This would cause @TeX{} to look for @file{\input} file first in the current
+directory, indicated by the @samp{.}, then in a hypothetical user's
+@file{me/mylib} directory, and finally in the system library.@refill
+
+@node Overfull hboxes, smallbook, Preparing for TeX, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Overfull ``hboxes''
+@cindex Overfull @samp{hboxes}
+@cindex @samp{hboxes}, overfull
+@cindex Final output
+
+@TeX{} is sometimes unable to typeset a line without extending it into
+the right margin. This can occur when @TeX{} comes upon what it
+interprets as a long word that it cannot hyphenate, such as an
+electronic mail network address or a very long title. When this
+happens, @TeX{} prints an error message like this:@refill
+
+@example
+Overfull \hbox (20.76302pt too wide)
+@end example
+
+@noindent
+(In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
+The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill
+
+@TeX{} also provides the line number in the Texinfo source file and
+the text of the offending line, which is marked at all the places that
+@TeX{} knows how to hyphenate words.
+@xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
+for more information about typesetting errors.@refill
+
+If the Texinfo file has an overfull hbox, you can rewrite the sentence
+so the overfull hbox does not occur, or you can decide to leave it. A
+small excursion into the right margin often does not matter and may not
+even be noticeable.@refill
+
+@cindex Black rectangle in hardcopy
+@cindex Rectangle, ugly, black in hardcopy
+However, unless told otherwise, @TeX{} will print a large, ugly, black
+rectangle beside the line that contains the overfull hbox. This is so
+you will notice the location of the problem if you are correcting a
+draft.@refill
+
+@need 1000
+@findex finalout
+To prevent such a monstrosity from marring your final printout, write
+the following in the beginning of the Texinfo file on a line of its own,
+before the @code{@@titlepage} command:@refill
+
+@example
+@@finalout
+@end example
+
+@node smallbook, A4 Paper, Overfull hboxes, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Printing ``Small'' Books
+@findex smallbook
+@cindex Small book size
+@cindex Book, printing small
+@cindex Page sizes for books
+@cindex Size of printed book
+
+By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
+format. However, you can direct @TeX{} to typeset a document in a 7 by
+9.25 inch format that is suitable for bound books by inserting the
+following command on a line by itself at the beginning of the Texinfo
+file, before the title page:@refill
+
+@example
+@@smallbook
+@end example
+
+@noindent
+(Since regular sized books are often about 7 by 9.25 inches, this
+command might better have been called the @code{@@regularbooksize}
+command, but it came to be called the @code{@@smallbook} command by
+comparison to the 8.5 by 11 inch format.)@refill
+
+If you write the @code{@@smallbook} command between the
+start-of-header and end-of-header lines, the Texinfo mode @TeX{}
+region formatting command, @code{texinfo-tex-region}, will format the
+region in ``small'' book size (@pxref{Start of Header}).@refill
+
+The Free Software Foundation distributes printed copies of @cite{The GNU
+Emacs Manual} and other manuals in the ``small'' book size.
+@xref{smallexample & smalllisp, , @code{@@smallexample} and
+@code{@@smalllisp}}, for information about commands that make it easier
+to produce examples for a smaller manual.@refill
+
+@node A4 Paper, Cropmarks and Magnification, smallbook, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Printing on A4 Paper
+@cindex A4 paper, printing on
+@cindex Paper size, European A4
+@cindex European A4 paper
+@findex afourpaper
+
+You can tell @TeX{} to typeset a document for printing on European size
+A4 paper with the @code{@@afourpaper} command. Write the command on a
+line by itself between @code{@@iftex} and @code{@@end iftex} lines near
+the beginning of the Texinfo file, before the title page:@refill
+
+For example, this is how you would write the header for this manual:@refill
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename texinfo
+@@settitle Texinfo
+@@syncodeindex vr fn
+@@iftex
+@@afourpaper
+@@end iftex
+@@c %**end of header
+@end group
+@end example
+
+@node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy
+@comment node-name, next, previous, up
+@section Cropmarks and Magnification
+
+@findex cropmarks
+@cindex Cropmarks for printing
+@cindex Printing cropmarks
+You can attempt to direct @TeX{} to print cropmarks at the corners of
+pages with the @code{@@cropmarks} command. Write the @code{@@cropmarks}
+command on a line by itself between @code{@@iftex} and @code{@@end
+iftex} lines near the beginning of the Texinfo file, before the title
+page, like this:@refill
+
+@example
+@group
+@@iftex
+@@cropmarks
+@@end iftex
+@end group
+@end example
+
+This command is mainly for printers that typeset several pages on one
+sheet of film; but you can attempt to use it to mark the corners of a
+book set to 7 by 9.25 inches with the @code{@@smallbook} command.
+(Printers will not produce cropmarks for regular sized output that is
+printed on regular sized paper.) Since different printing machines work
+in different ways, you should explore the use of this command with a
+spirit of adventure. You may have to redefine the command in the
+@file{texinfo.tex} definitions file.@refill
+
+@findex mag @r{(@TeX{} command)}
+@cindex Magnified printing
+@cindex Larger or smaller pages
+You can attempt to direct @TeX{} to typeset pages larger or smaller than
+usual with the @code{\mag} @TeX{} command. Everything that is typeset
+is scaled proportionally larger or smaller. (@code{\mag} stands for
+``magnification''.) This is @emph{not} a Texinfo @@-command, but is a
+plain @TeX{} command that is prefixed with a backslash. You have to
+write this command between @code{@@tex} and @code{@@end tex}
+(@pxref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
+Commands}).@refill
+
+Follow the @code{\mag} command with an @samp{=} and then a number that
+is 1000 times the magnification you desire. For example, to print pages
+at 1.2 normal size, write the following near the beginning of the
+Texinfo file, before the title page:@refill
+
+@example
+@group
+@@tex
+\mag=1200
+@@end tex
+@end group
+@end example
+
+With some printing technologies, you can print normal-sized copies that
+look better than usual by using a larger-than-normal master.@refill
+
+Depending on your system, @code{\mag} may not work or may work only at
+certain magnifications. Be prepared to experiment.@refill
+
+@node Create an Info File, Install an Info File, Format/Print Hardcopy, Top
+@comment node-name, next, previous, up
+@chapter Creating an Info File
+@cindex Creating an Info file
+@cindex Info, creating an on-line file
+@cindex Formatting a file for Info
+
+@code{makeinfo} is a utility that converts a Texinfo file into an Info
+file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
+GNU Emacs functions that do the same.@refill
+
+A Texinfo file must possess an @code{@@setfilename} line near its
+beginning, otherwise the Info formatting commands will fail.@refill
+
+For information on installing the Info file in the Info system, see
+@ref{Install an Info File}.@refill
+
+@menu
+* makeinfo advantages:: @code{makeinfo} provides better error checking.
+* Invoking makeinfo:: How to run @code{makeinfo} from a shell.
+* makeinfo options:: Specify fill-column and other options.
+* Pointer Validation:: How to check that pointers point somewhere.
+* makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
+* texinfo-format commands:: Two Info formatting commands written
+ in Emacs Lisp are an alternative
+ to @code{makeinfo}.
+* Batch Formatting:: How to format for Info in Emacs Batch mode.
+* Tag and Split Files:: How tagged and split files help Info
+ to run better.
+@end menu
+
+@node makeinfo advantages, Invoking makeinfo, Create an Info File, Create an Info File
+@ifinfo
+@heading @code{makeinfo} Preferred
+@end ifinfo
+
+The @code{makeinfo} utility creates an Info file from a Texinfo source
+file more quickly than either of the Emacs formatting commands and
+provides better error messages. We recommend it. @code{makeinfo} is a
+C program that is independent of Emacs. You do not need to run Emacs to
+use @code{makeinfo}, which means you can use @code{makeinfo} on machines
+that are too small to run Emacs. You can run @code{makeinfo} in
+any one of three ways: from an operating system shell, from a shell
+inside Emacs, or by typing a key command in Texinfo mode in Emacs.
+@refill
+
+The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
+commands are useful if you cannot run @code{makeinfo}. Also, in some
+circumstances, they format short regions or buffers more quickly than
+@code{makeinfo}.@refill
+
+@node Invoking makeinfo, makeinfo options, makeinfo advantages, Create an Info File
+@section Running @code{makeinfo} from a Shell
+
+To create an Info file from a Texinfo file, type @code{makeinfo}
+followed by the name of the Texinfo file. Thus, to create the Info
+file for Bison, type the following at the shell prompt (where @samp{%}
+is the prompt):@refill
+
+@example
+% makeinfo bison.texinfo
+@end example
+
+(You can run a shell inside Emacs by typing @kbd{M-x
+shell}.)@refill
+
+@ifinfo
+Sometimes you will want to specify options. For example, if you wish
+to discover which version of @code{makeinfo} you are using,
+type:@refill
+
+@example
+% makeinfo --version
+@end example
+
+@xref{makeinfo options}, for more information.
+@end ifinfo
+
+@node makeinfo options, Pointer Validation, Invoking makeinfo, Create an Info File
+@comment node-name, next, previous, up
+@section Options for @code{makeinfo}
+@cindex @code{makeinfo} options
+@cindex Options for @code{makeinfo}
+
+The @code{makeinfo} command takes a number of options. Most often,
+options are used to set the value of the fill column and specify the
+footnote style. Each command line option is a word preceded by
+@samp{--}@footnote{@samp{--} has replaced @samp{+}, the old introductory
+character, to maintain POSIX.2 compatibility without losing long-named
+options.} or a letter preceded by @samp{-}. You can use abbreviations
+for the option names as long as they are unique.@refill
+
+For example, you could use the following command to create an Info
+file for @file{bison.texinfo} in which each line is filled to only 68
+columns (where @samp{%} is the prompt):@refill
+
+@example
+% makeinfo --fill-column=68 bison.texinfo
+@end example
+
+You can write two or more options in sequence, like this:@refill
+
+@example
+% makeinfo --no-split --fill-column=70 @dots{}
+@end example
+
+@noindent
+This would keep the Info file together as one possibly very long
+file and would also set the fill column to 70.@refill
+
+@iftex
+If you wish to discover which version of @code{makeinfo}
+you are using, type:@refill
+
+@example
+% makeinfo --version
+@end example
+@end iftex
+
+The options are:@refill
+
+@need 100
+@table @code
+@item -D @var{var}
+Cause @var{var} to be defined. This is equivalent to
+@code{@@set @var{var}} in the Texinfo file.
+
+@need 150
+@item --error-limit @var{limit}
+Set the maximum number of errors that @code{makeinfo} will report
+before exiting (on the assumption that continuing would be useless).
+The default number of errors that can be reported before
+@code{makeinfo} gives up is 100.@refill
+
+@need 150
+@item --fill-column @var{width}
+Specify the maximum number of columns in a line; this is the right-hand
+edge of a line. Paragraphs that are filled will be filled to this
+width. (Filling is the process of breaking up and connecting lines so
+that lines are the same length as or shorter than the number specified
+as the fill column. Lines are broken between words.) The default value
+for @code{fill-column} is 72.
+@refill
+
+@item --footnote-style @var{style}
+Set the footnote style to @var{style}, either @samp{end} for the end
+node style or @samp{separate} for the separate node style. The value
+set by this option overrides the value set in a Texinfo file by an
+@code{@@footnotestyle} command. When the footnote style is
+@samp{separate}, @code{makeinfo} makes a new node containing the
+footnotes found in the current node. When the footnote style is
+@samp{end}, @code{makeinfo} places the footnote references at the end
+of the current node.@refill
+
+@need 150
+@item -I @var{dir}
+Add @code{dir} to the directory search list for finding files that are
+included using the @code{@@include} command. By default,
+@code{makeinfo} searches only the current directory.
+
+@need 150
+@item --no-headers
+Do not include menus or node lines in the output. This results in an
+@sc{ascii} file that you cannot read in Info since it does not contain
+the requisite nodes or menus; but you can print such a file in a
+single, typewriter-like font and produce acceptable output.
+
+@need 150
+@item --no-split
+Suppress the splitting stage of @code{makeinfo}. Normally, large
+output files (where the size is greater than 70k bytes) are split into
+smaller subfiles, each one approximately 50k bytes. If you specify
+@samp{--no-split}, @code{makeinfo} will not split up the output
+file.@refill
+
+@need 100
+@item --no-pointer-validate
+@item --no-validate
+Suppress the pointer-validation phase of @code{makeinfo}. Normally,
+after a Texinfo file is processed, some consistency checks are made to
+ensure that cross references can be resolved, etc.
+@xref{Pointer Validation}.@refill
+
+@need 150
+@item --no-warn
+Suppress the output of warning messages. This does @emph{not}
+suppress the output of error messages, only warnings. You might
+want this if the file you are creating has examples of Texinfo cross
+references within it, and the nodes that are referenced do not actually
+exist.@refill
+
+@item --no-number-footnotes
+Suppress automatic footnote numbering. By default, @code{makeinfo}
+numbers each footnote sequentially in a single node, resetting the
+current footnote number to 1 at the start of each node.
+
+@need 150
+@item --output @var{file}
+@itemx -o @var{file}
+Specify that the output should be directed to @var{file} and not to the
+file name specified in the @code{@@setfilename} command found in the Texinfo
+source. @var{file} can be the special token @samp{-}, which specifies
+standard output.
+
+@need 150
+@item --paragraph-indent @var{indent}
+Set the paragraph indentation style to @var{indent}. The value set by
+this option overrides the value set in a Texinfo file by an
+@code{@@paragraphindent} command. The value of @var{indent} is
+interpreted as follows:@refill
+
+@itemize @bullet
+@item
+If the value of @var{indent} is @samp{asis}, do not change the
+existing indentation at the starts of paragraphs.@refill
+
+@item
+If the value of @var{indent} is zero, delete any existing
+indentation.@refill
+
+@item
+If the value of @var{indent} is greater than zero, indent each
+paragraph by that number of spaces.@refill
+@end itemize
+
+@need 100
+@item --reference-limit @var{limit}
+Set the value of the number of references to a node that
+@code{makeinfo} will make without reporting a warning. If a node has more
+than this number of references in it, @code{makeinfo} will make the
+references but also report a warning.@refill
+
+@need 150
+@item -U @var{var}
+Cause @var{var} to be undefined. This is equivalent to
+@code{@@clear @var{var}} in the Texinfo file.
+
+@need 100
+@item --verbose
+Cause @code{makeinfo} to display messages saying what it is doing.
+Normally, @code{makeinfo} only outputs messages if there are errors or
+warnings.@refill
+
+@need 100
+@item --version
+Report the version number of this copy of @code{makeinfo}.@refill
+@end table
+
+@node Pointer Validation, makeinfo in Emacs, makeinfo options, Create an Info File
+@section Pointer Validation
+@cindex Pointer validation with @code{makeinfo}
+@cindex Validation of pointers
+
+If you do not suppress pointer-validation, @code{makeinfo} will check
+the validity of the final Info file. Mostly, this means ensuring that
+nodes you have referenced really exist. Here is a complete list of what
+is checked:@refill
+
+@enumerate
+@item
+If a `Next', `Previous', or `Up' node reference is a reference to a
+node in the current file and is not an external reference such as to
+@file{(dir)}, then the referenced node must exist.@refill
+
+@item
+In every node, if the `Previous' node is different from the `Up' node,
+then the `Previous' node must also be pointed to by a `Next' node.@refill
+
+@item
+Every node except the `Top' node must have an `Up' pointer.@refill
+
+@item
+The node referenced by an `Up' pointer must contain a reference to the
+current node in some manner other than through a `Next' reference.
+This includes menu entries and cross references.@refill
+
+@item
+If the `Next' reference of a node is not the same as the `Next' reference
+of the `Up' reference, then the node referenced by the `Next' pointer
+must have a `Previous' pointer that points back to the current node.
+This rule allows the last node in a section to point to the first node
+of the next chapter.@refill
+@end enumerate
+
+@node makeinfo in Emacs, texinfo-format commands, Pointer Validation, Create an Info File
+@section Running @code{makeinfo} inside Emacs
+@cindex Running @code{makeinfo} in Emacs
+@cindex @code{makeinfo} inside Emacs
+@cindex Shell, running @code{makeinfo} in
+
+You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
+@code{makeinfo-region} or the @code{makeinfo-buffer} commands. In
+Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
+C-m C-b} by default.@refill
+
+@table @kbd
+@item C-c C-m C-r
+@itemx M-x makeinfo-region
+Format the current region for Info.@refill
+@findex makeinfo-region
+
+@item C-c C-m C-b
+@itemx M-x makeinfo-buffer
+Format the current buffer for Info.@refill
+@findex makeinfo-buffer
+@end table
+
+When you invoke either @code{makeinfo-region} or
+@code{makeinfo-buffer}, Emacs prompts for a file name, offering the
+name of the visited file as the default. You can edit the default
+file name in the minibuffer if you wish, before typing @key{RET} to
+start the @code{makeinfo} process.@refill
+
+The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
+run the @code{makeinfo} program in a temporary shell buffer. If
+@code{makeinfo} finds any errors, Emacs displays the error messages in
+the temporary buffer.@refill
+
+@cindex Errors, parsing
+@cindex Parsing errors
+@findex next-error
+You can parse the error messages by typing @kbd{C-x `}
+(@code{next-error}). This causes Emacs to go to and position the
+cursor on the line in the Texinfo source that @code{makeinfo} thinks
+caused the error. @xref{Compilation, , Running @code{make} or
+Compilers Generally, emacs, The GNU Emacs Manual}, for more
+information about using the @code{next-error} command.@refill
+
+In addition, you can kill the shell in which the @code{makeinfo}
+command is running or make the shell buffer display its most recent
+output.@refill
+
+@table @kbd
+@item C-c C-m C-k
+@itemx M-x makeinfo-kill-job
+@findex makeinfo-kill-job
+Kill the current running @code{makeinfo} job created by
+@code{makeinfo-region} or @code{makeinfo-buffer}.@refill
+
+@item C-c C-m C-l
+@itemx M-x makeinfo-recenter-output-buffer
+@findex makeinfo-recenter-output-buffer
+Redisplay the @code{makeinfo} shell buffer to display its most recent
+output.@refill
+@end table
+
+@noindent
+(Note that the parallel commands for killing and recentering a @TeX{}
+job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}. @xref{Texinfo Mode
+Printing}.)@refill
+
+You can specify options for @code{makeinfo} by setting the
+@code{makeinfo-options} variable with either the @kbd{M-x
+edit-options} or the @kbd{M-x set-variable} command, or by setting the
+variable in your @file{.emacs} initialization file.@refill
+
+For example, you could write the following in your @file{.emacs} file:@refill
+
+@example
+@group
+(setq makeinfo-options
+ "--paragraph-indent=0 --no-split
+ --fill-column=70 --verbose")
+@end group
+@end example
+
+@c If you write these three cross references using xref, you see
+@c three references to the same named manual, which looks strange.
+@iftex
+For more information, see @ref{makeinfo options, , Options for
+@code{makeinfo}}, as well as ``Editing Variable Values,''``Examining and
+Setting Variables,'' and ``Init File'' in the @cite{The GNU Emacs
+Manual}.
+@end iftex
+@noindent
+@ifinfo
+For more information, see@*
+@ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@*
+@ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
+@ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
+@ref{makeinfo options, , Options for @code{makeinfo}}.
+@end ifinfo
+
+@node texinfo-format commands, Batch Formatting, makeinfo in Emacs, Create an Info File
+@comment node-name, next, previous, up
+@section The @code{texinfo-format@dots{}} Commands
+@findex texinfo-format-region
+@findex texinfo-format-buffer
+
+In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
+file with the @code{texinfo-format-region} command. This formats the
+current region and displays the formatted text in a temporary buffer
+called @samp{*Info Region*}.@refill
+
+Similarly, you can format a buffer with the
+@code{texinfo-format-buffer} command. This command creates a new
+buffer and generates the Info file in it. Typing @kbd{C-x C-s} will
+save the Info file under the name specified by the
+@code{@@setfilename} line which must be near the beginning of the
+Texinfo file.@refill
+
+@table @kbd
+@item C-c C-e C-r
+@itemx @code{texinfo-format-region}
+Format the current region for Info.
+@findex texinfo-format-region
+
+@item C-c C-e C-b
+@itemx @code{texinfo-format-buffer}
+Format the current buffer for Info.
+@findex texinfo-format-buffer
+@end table
+
+The @code{texinfo-format-region} and @code{texinfo-format-buffer}
+commands provide you with some error checking, and other functions can
+provide you with further help in finding formatting errors. These
+procedures are described in an appendix; see @ref{Catching Mistakes}.
+However, the @code{makeinfo} program is often faster and
+provides better error checking (@pxref{makeinfo in Emacs}).@refill
+
+@node Batch Formatting, Tag and Split Files, texinfo-format commands, Create an Info File
+@comment node-name, next, previous, up
+@section Batch Formatting
+@cindex Batch formatting for Info
+@cindex Info batch formatting
+
+You can format Texinfo files for Info using @code{batch-texinfo-format}
+and Emacs Batch mode. You can run Emacs in Batch mode from any shell,
+including a shell inside of Emacs. (@xref{Command Switches, , Command
+Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill
+
+Here is the command to format all the files that end in @file{.texinfo}
+in the current directory (where @samp{%} is the shell prompt):@refill
+
+@example
+% emacs -batch -funcall batch-texinfo-format *.texinfo
+@end example
+
+@noindent
+Emacs processes all the files listed on the command line, even if an
+error occurs while attempting to format some of them.@refill
+
+Run @code{batch-texinfo-format} only with Emacs in Batch mode as shown;
+it is not interactive. It kills the Batch mode Emacs on completion.@refill
+
+@code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
+and want to format several Texinfo files at once. When you use Batch
+mode, you create a new Emacs process. This frees your current Emacs, so
+you can continue working in it. (When you run
+@code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
+use that Emacs for anything else until the command finishes.)@refill
+
+@node Tag and Split Files, , Batch Formatting, Create an Info File
+@comment node-name, next, previous, up
+@section Tag Files and Split Files
+@cindex Making a tag table automatically
+@cindex Tag table, making automatically
+
+If a Texinfo file has more than 30,000 bytes,
+@code{texinfo-format-buffer} automatically creates a tag table
+for its Info file; @code{makeinfo} always creates a tag table. With
+a @dfn{tag table}, Info can jump to new nodes more quickly than it can
+otherwise.@refill
+
+@cindex Indirect subfiles
+In addition, if the Texinfo file contains more than about 70,000
+bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
+large Info file into shorter @dfn{indirect} subfiles of about 50,000
+bytes each. Big files are split into smaller files so that Emacs does
+not need to make a large buffer to hold the whole of a large Info
+file; instead, Emacs allocates just enough memory for the small, split
+off file that is needed at the time. This way, Emacs avoids wasting
+memory when you run Info. (Before splitting was implemented, Info
+files were always kept short and @dfn{include files} were designed as
+a way to create a single, large printed manual out of the smaller Info
+files. @xref{Include Files}, for more information. Include files are
+still used for very large documents, such as @cite{The Emacs Lisp
+Reference Manual}, in which each chapter is a separate file.)@refill
+
+When a file is split, Info itself makes use of a shortened version of
+the original file that contains just the tag table and references to
+the files that were split off. The split off files are called
+@dfn{indirect} files.@refill
+
+The split off files have names that are created by appending @w{@samp{-1}},
+@w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
+@code{@@setfilename} command. The shortened version of the original file
+continues to have the name specified by @code{@@setfilename}.@refill
+
+At one stage in writing this document, for example, the Info file was saved
+as @file{test-texinfo} and that file looked like this:@refill
+
+@example
+@group
+Info file: test-texinfo, -*-Text-*-
+produced by texinfo-format-buffer
+from file: new-texinfo-manual.texinfo
+
+^_
+Indirect:
+test-texinfo-1: 102
+test-texinfo-2: 50422
+@end group
+@group
+test-texinfo-3: 101300
+^_^L
+Tag table:
+(Indirect)
+Node: overview^?104
+Node: info file^?1271
+@end group
+@group
+Node: printed manual^?4853
+Node: conventions^?6855
+@dots{}
+@end group
+@end example
+
+@noindent
+(But @file{test-texinfo} had far more nodes than are shown here.) Each of
+the split off, indirect files, @file{test-texinfo-1},
+@file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
+after the line that says @samp{Indirect:}. The tag table is listed after
+the line that says @samp{Tag table:}. @refill
+
+In the list of indirect files, the number following the file name
+records the cumulative number of bytes in the preceding indirect files,
+not counting the file list itself, the tag table, or the permissions
+text in each file. In the tag table, the number following the node name
+records the location of the beginning of the node, in bytes from the
+beginning.@refill
+
+If you are using @code{texinfo-format-buffer} to create Info files,
+you may want to run the @code{Info-validate} command. (The
+@code{makeinfo} command does such a good job on its own, you do not
+need @code{Info-validate}.) However, you cannot run the @kbd{M-x
+Info-validate} node-checking command on indirect files. For
+information on how to prevent files from being split and how to
+validate the structure of the nodes, see @ref{Using
+Info-validate}.@refill
+
+
+@node Install an Info File, Command List, Create an Info File, Top
+@comment node-name, next, previous, up
+@chapter Installing an Info File
+@cindex Installing an Info file
+@cindex Info file installation
+@cindex @file{dir} directory for Info installation
+
+Info files are usually kept in the @file{info} directory. You can read
+Info files using the standalone Info program or the Info reader built
+into Emacs. (@inforef{Top, info, info}, for an introduction to Info.)
+
+@menu
+* Directory file:: The top level menu for all Info files.
+* New Info File:: Listing a new info file.
+* Other Info Directories:: How to specify Info files that are
+ located in other directories.
+* Installing Dir Entries:: How to specify what menu entry to add
+ to the Info directory.
+* Invoking install-info:: @code{install-info} options.
+@end menu
+
+@node Directory file, New Info File, Install an Info File, Install an Info File
+@ifinfo
+@heading The @file{dir} File
+@end ifinfo
+
+For Info to work, the @file{info} directory must contain a file that
+serves as a top level directory for the Info system. By convention,
+this file is called @file{dir}. (You can find the location of this file
+within Emacs by typing @kbd{C-h i} to enter Info and then typing
+@kbd{C-x C-f} to see the pathname to the @file{info} directory.)
+
+The @file{dir} file is itself an Info file. It contains the top level
+menu for all the Info files in the system. The menu looks like
+this:@refill
+
+@example
+@group
+* Menu:
+
+* Info: (info). Documentation browsing system.
+* Emacs: (emacs). The extensible, self-documenting
+ text editor.
+* Texinfo: (texinfo). With one source file, make
+ either a printed manual using
+ TeX or an Info file.
+@dots{}
+@end group
+@end example
+
+Each of these menu entries points to the `Top' node of the Info file
+that is named in parentheses. (The menu entry does not need to
+specify the `Top' node, since Info goes to the `Top' node if no node
+name is mentioned. @xref{Other Info Files, , Nodes in Other Info
+Files}.)@refill
+
+Thus, the @samp{Info} entry points to the `Top' node of the
+@file{info} file and the @samp{Emacs} entry points to the `Top' node
+of the @file{emacs} file.@refill
+
+In each of the Info files, the `Up' pointer of the `Top' node refers
+back to the @code{dir} file. For example, the line for the `Top'
+node of the Emacs manual looks like this in Info:@refill
+
+@example
+File: emacs Node: Top, Up: (DIR), Next: Distrib
+@end example
+
+@noindent
+(Note that in this case, the @file{dir} file name is written in upper
+case letters---it can be written in either upper or lower case. Info
+has a feature that it will change the case of the file name to lower
+case if it cannot find the name as written.)@refill
+@c !!! Can any file name be written in upper or lower case,
+@c or is dir a special case?
+@c Yes, apparently so, at least with Gillespie's Info. --rjc 24mar92
+
+
+@node New Info File, Other Info Directories, Directory file, Install an Info File
+@section Listing a New Info File
+@cindex Adding a new info file
+@cindex Listing a new info file
+@cindex New info file, listing it in @file{dir} file
+@cindex Info file, listing new one
+@cindex @file{dir} file listing
+
+To add a new Info file to your system, you must write a menu entry to
+add to the menu in the @file{dir} file in the @file{info} directory.
+For example, if you were adding documentation for GDB, you would write
+the following new entry:@refill
+
+@example
+* GDB: (gdb). The source-level C debugger.
+@end example
+
+@noindent
+The first part of the menu entry is the menu entry name, followed by a
+colon. The second part is the name of the Info file, in parentheses,
+followed by a period. The third part is the description.
+
+The name of an Info file often has a @file{.info} extension. Thus, the
+Info file for GDB might be called either @file{gdb} or @file{gdb.info}.
+The Info reader programs automatically try the file name both with and
+without @file{.info}; so it is better to avoid clutter and not to write
+@samp{.info} explicitly in the menu entry. For example, the GDB menu
+entry should use just @samp{gdb} for the file name, not @samp{gdb.info}.
+
+
+@node Other Info Directories, Installing Dir Entries, New Info File, Install an Info File
+@comment node-name, next, previous, up
+@section Info Files in Other Directories
+@cindex Installing Info in another directory
+@cindex Info installed in another directory
+@cindex Another Info directory
+
+If an Info file is not in the @file{info} directory, there are three
+ways to specify its location:@refill
+
+@itemize @bullet
+@item
+Write the pathname in the @file{dir} file as the second part of the
+menu.@refill
+
+@item
+If you are using Emacs, list the name of the file in a second @file{dir}
+file, in its directory; and then add the name of that directory to the
+@code{Info-directory-list} variable in your personal or site
+initialization file.
+
+This tells Emacs's Info reader where to look for @file{dir}
+files. Emacs merges the files named @file{dir} from each of the listed
+directories. (In Emacs Version 18, you can set the
+@code{Info-directory} variable to the name of only one
+directory.)@refill
+
+@item
+Specify the @file{info} directory name in the @code{INFOPATH}
+environment variable in your @file{.profile} or @file{.cshrc}
+initialization file. (Only you and others who set this environment
+variable will be able to find Info files whose location is specified
+this way.)@refill
+@end itemize
+
+For example, to reach a test file in the @file{~bob/manuals}
+directory, you could add an entry like this to the menu in the
+@file{dir} file:@refill
+
+@example
+* Test: (/home/bob/manuals/info-test). Bob's own test file.
+@end example
+
+@noindent
+In this case, the absolute file name of the @file{info-test} file is
+written as the second part of the menu entry.@refill
+
+@vindex Info-directory-list
+Alternatively, you could write the following in your @file{.emacs}
+file:@refill
+
+@example
+@group
+(setq Info-directory-list
+ '("/home/bob/manuals"
+ "/usr/local/emacs/info"))
+@end group
+@end example
+
+@c reworded to avoid overfill hbox
+This tells Emacs to merge the @file{dir} file from the
+@file{/home/bob/manuals} directory with the @file{dir} file from the
+@file{"/usr/local/emacs/info}" directory. Info will list the
+@file{/home/bob/manuals/info-test} file as a menu entry in the
+@file{/home/bob/manuals/dir} file.@refill
+
+@vindex INFOPATH
+Finally, you can tell Info where to look by setting the
+@code{INFOPATH} environment variable in your @file{.cshrc} or
+@file{.profile} file.@refill
+
+If you use @code{sh} or @code{bash} for your shell command interpreter,
+you must set the @code{INFOPATH} environment variable in the
+@file{.profile} initialization file; but if you use @code{csh}, you must
+set the variable in the @file{.cshrc} initialization file. The two
+files use slightly different command formats.@refill
+
+@itemize @bullet
+@item
+In a @file{.cshrc} file, you could set the @code{INFOPATH}
+variable as follows:@refill
+
+@smallexample
+setenv INFOPATH .:~bob/manuals:/usr/local/emacs/info
+@end smallexample
+
+@item
+In a @file{.profile} file, you would achieve the same effect by
+writing:@refill
+
+@smallexample
+INFOPATH=.:~bob/manuals:/usr/local/emacs/info
+export INFOPATH
+@end smallexample
+@end itemize
+
+@noindent
+The @samp{.} indicates the current directory. Emacs uses the
+@code{INFOPATH} environment variable to initialize the value of Emacs's
+own @code{Info-directory-list} variable.
+
+
+@node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File
+@section Installing Info Directory Files
+
+When you install an Info file onto your system, you can use the program
+@code{install-info} to update the Info directory file @file{dir}.
+Normally the makefile for the package runs @code{install-info}, just
+after copying the Info file into its proper installed location.
+
+@findex dircategory
+@findex direntry
+In order for the Info file to work with @code{install-info}, you should
+use the commands @code{@@dircategory} and @code{@@direntry} in the
+Texinfo source file. Use @code{@@direntry} to specify the menu entry to
+add to the Info directory file, and use @code{@@dircategory} to specify
+which part of the Info directory to put it in. Here is how these
+commands are used in this manual:
+
+@smallexample
+@@dircategory Texinfo documentation system
+@@direntry
+* Texinfo: (texinfo). The GNU documentation format.
+* install-info: (texinfo)Invoking install-info. @dots{}
+@dots{}
+@@end direntry
+@end smallexample
+
+Here's what this produces in the Info file:
+
+@smallexample
+INFO-DIR-SECTION Texinfo documentation system
+START-INFO-DIR-ENTRY
+* Texinfo: (texinfo). The GNU documentation format.
+* install-info: (texinfo)Invoking install-info. @dots{}
+@dots{}
+END-INFO-DIR-ENTRY
+@end smallexample
+
+@noindent
+The @code{install-info} program sees these lines in the Info file, and
+that is how it knows what to do.
+
+Always use the @code{@@direntry} and @code{@@dircategory} commands near
+the beginning of the Texinfo input, before the first @code{@@node}
+command. If you use them later on in the input, @code{install-info}
+will not notice them.
+
+If you use @code{@@dircategory} more than once in the Texinfo source,
+each usage specifies one category; the new menu entry is added to the
+Info directory file in each of the categories you specify. If you use
+@code{@@direntry} more than once, each usage specifies one menu entry;
+each of these menu entries is added to the directory in each of the
+specified categories.
+
+
+@node Invoking install-info, , Installing Dir Entries, Install an Info File
+@section Invoking install-info
+
+@pindex install-info
+
+@code{install-info} inserts menu entries from an Info file into the
+top-level @file{dir} file in the Info system (see the previous sections
+for an explanation of how the @file{dir} file works). It's most often
+run as part of software installation, or when constructing a dir file
+for all manuals on a system. Synopsis:
+
+@example
+install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]]
+@end example
+
+If @var{info-file} or @var{dir-file} are not specified, the various
+options (described below) that define them must be. There are no
+compile-time defaults, and standard input is never used.
+@code{install-info} can read only one info file and write only one dir
+file per invocation.
+
+Options:
+
+@table @samp
+@item --delete
+@opindex --delete
+Only delete existing entries in @var{info-file}; don't insert any new
+entries.
+
+@item --dir-file=@var{name}
+@opindex --dir-file=@var{name}
+Specify file name of the Info directory file. This is equivalent to
+using the @var{dir-file} argument.
+
+@item --entry=@var{text}
+@opindex --entry=@var{text}
+Insert @var{text} as an Info directory entry; @var{text} should have the
+form of an Info menu item line plus zero or more extra lines starting
+with whitespace. If you specify more than one entry, they are all
+added. If you don't specify any entries, they are determined from
+information in the Info file itself.
+
+@item --help
+@opindex --help
+Display a usage message listing basic usage and all available options,
+then exit successfully.
+
+@item --info-file=@var{file}
+@opindex --info-file=@var{file}
+Specify Info file to install in the directory.
+This is equivalent to using the @var{info-file} argument.
+
+@item --info-dir=@var{dir}
+@opindex --info-dir=@var{dir}
+Equivalent to @samp{--dir-file=@var{dir}/dir}.
+
+@item --item=@var{text}
+@opindex --item=@var{text}
+Same as --entry=@var{text}. An Info directory entry is actually a menu
+item.
+
+@item --quiet
+@opindex --quiet
+Suppress warnings.
+
+@item --remove
+@opindex --remove
+Same as --delete.
+
+@item --section=@var{sec}
+@opindex --section=@var{sec}
+Put this file's entries in section @var{sec} of the directory. If you
+specify more than one section, all the entries are added in each of the
+sections. If you don't specify any sections, they are determined from
+information in the Info file itself.
+
+@item --version
+@opindex --version
+@cindex version number, finding
+Display version information and exit successfully.
+
+@end table
+
+
+@c ================ Appendix starts here ================
+
+@node Command List, Tips, Install an Info File, Top
+@appendix @@-Command List
+@cindex Alphabetical @@-command list
+@cindex List of @@-commands
+@cindex @@-command list
+
+Here is an alphabetical list of the @@-commands in Texinfo. Square
+brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
+@samp{@dots{}}, indicates repeated text.@refill
+
+@sp 1
+@table @code
+@item @@@var{whitespace}
+An @code{@@} followed by a space, tab, or newline produces a normal,
+stretchable, interword space. @xref{Multiple Spaces}.
+
+@item @@!
+Generate an exclamation point that really does end a sentence (usually
+after an end-of-sentence capital letter). @xref{Ending a Sentence}.
+
+@item @@"
+@itemx @@'
+Generate an umlaut or acute accent, respectively, over the next
+character, as in @"o and @'o. @xref{Inserting Accents}.
+
+@item @@*
+Force a line break. Do not end a paragraph that uses @code{@@*} with
+an @code{@@refill} command. @xref{Line Breaks}.@refill
+
+@item @@,@{@var{c}@}
+Generate a cedilla accent under @var{c}, as in @,{c}. @xref{Inserting
+Accents}.
+
+@item @@-
+Insert a discretionary hyphenation point. @xref{- and hyphenation}.
+
+@item @@.
+Produce a period that really does end a sentence (usually after an
+end-of-sentence capital letter). @xref{Ending a Sentence}.
+
+@item @@:
+Indicate to @TeX{} that an immediately preceding period, question
+mark, exclamation mark, or colon does not end a sentence. Prevent
+@TeX{} from inserting extra whitespace as it does at the end of a
+sentence. The command has no effect on the Info file output.
+@xref{Not Ending a Sentence}.@refill
+
+@item @@=
+Generate a macro (bar) accent over the next character, as in @=o.
+@xref{Inserting Accents}.
+
+@item @@?
+Generate a question mark that really does end a sentence (usually after
+an end-of-sentence capital letter). @xref{Ending a Sentence}.
+
+@item @@@@
+Stands for an at sign, @samp{@@}.@*
+@xref{Braces Atsigns, , Inserting @@ and braces}.
+
+@item @@^
+@itemx @@`
+Generate a circumflex (hat) or grave accent, respectively, over the next
+character, as in @^o.
+@xref{Inserting Accents}.
+
+@item @@@{
+Stands for a left brace, @samp{@{}.@*
+@xref{Braces Atsigns, , Inserting @@ and braces}.
+
+@item @@@}
+Stands for a right-hand brace, @samp{@}}.@*
+@xref{Braces Atsigns, , Inserting @@ and braces}.
+
+@item @@=
+Generate a tilde accent over the next character, as in @~N.
+@xref{Inserting Accents}.
+
+@item @@AA@{@}
+@itemx @@aa@{@}
+Generate the uppercase and lowercase Scandinavian A-ring letters,
+respectively: @AA{}, @aa{}. @xref{Inserting Accents}.
+
+@item @@AE@{@}
+@itemx @@ae@{@}
+Generate the uppercase and lowercase AE ligatures, respectively:
+@AE{}, @ae{}. @xref{Inserting Accents}.
+
+@item @@appendix @var{title}
+Begin an appendix. The title appears in the table
+of contents of a printed manual. In Info, the title is
+underlined with asterisks. @xref{unnumbered & appendix, , The
+@code{@@unnumbered} and @code{@@appendix} Commands}.@refill
+
+@item @@appendixsec @var{title}
+@itemx @@appendixsection @var{title}
+Begin an appendix section within an appendix. The section title appears
+in the table of contents of a printed manual. In Info, the title is
+underlined with equal signs. @code{@@appendixsection} is a longer
+spelling of the @code{@@appendixsec} command. @xref{unnumberedsec
+appendixsec heading, , Section Commands}.@refill
+
+@item @@appendixsubsec @var{title}
+Begin an appendix subsection within an appendix. The title appears
+in the table of contents of a printed manual. In Info, the title is
+underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
+subheading, , Subsection Commands}.@refill
+
+@item @@appendixsubsubsec @var{title}
+Begin an appendix subsubsection within a subappendix. The title
+appears in the table of contents of a printed manual. In Info, the
+title is underlined with periods. @xref{subsubsection,, The `subsub'
+Commands}.@refill
+
+@item @@asis
+Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
+print the table's first column without highlighting (``as is'').
+@xref{Two-column Tables, , Making a Two-column Table}.@refill
+
+@item @@author @var{author}
+Typeset @var{author} flushleft and underline it. @xref{title
+subtitle author, , The @code{@@title} and @code{@@author}
+Commands}.@refill
+
+@item @@b@{@var{text}@}
+Print @var{text} in @b{bold} font. No effect in Info. @xref{Fonts}.@refill
+
+@ignore
+@item @@br
+Force a paragraph break. If used within a line, follow @code{@@br}
+with braces. @xref{br, , @code{@@br}}.@refill
+@end ignore
+
+@item @@bullet@{@}
+Generate a large round dot, or the closest possible
+thing to one. @xref{bullet, , @code{@@bullet}}.@refill
+
+@item @@bye
+Stop formatting a file. The formatters do not see the contents of a
+file following an @code{@@bye} command. @xref{Ending a File}.@refill
+
+@item @@c @var{comment}
+Begin a comment in Texinfo. The rest of the line does not appear in
+either the Info file or the printed manual. A synonym for
+@code{@@comment}. @xref{Comments, , Comments}.@refill
+
+@item @@cartouche
+Highlight an example or quotation by drawing a box with rounded
+corners around it. Pair with @code{@@end cartouche}. No effect in
+Info. @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill
+
+@item @@center @var{line-of-text}
+Center the line of text following the command.
+@xref{titlefont center sp, , @code{@@center}}.@refill
+
+@item @@centerchap @var{line-of-text}
+Like @code{@@chapter}, but centers the chapter title. @xref{chapter,,
+@code{@@chapter}}.
+
+@item @@chapheading @var{title}
+Print a chapter-like heading in the text, but not in the table of
+contents of a printed manual. In Info, the title is underlined with
+asterisks. @xref{majorheading & chapheading, , @code{@@majorheading}
+and @code{@@chapheading}}.@refill
+
+@item @@chapter @var{title}
+Begin a chapter. The chapter title appears in the table of
+contents of a printed manual. In Info, the title is underlined with
+asterisks. @xref{chapter, , @code{@@chapter}}.@refill
+
+@item @@cindex @var{entry}
+Add @var{entry} to the index of concepts. @xref{Index Entries, ,
+Defining the Entries of an Index}.@refill
+
+@item @@cite@{@var{reference}@}
+Highlight the name of a book or other reference that lacks a
+companion Info file. @xref{cite, , @code{@@cite}}.@refill
+
+@item @@clear @var{flag}
+Unset @var{flag}, preventing the Texinfo formatting commands from
+formatting text between subsequent pairs of @code{@@ifset @var{flag}}
+and @code{@@end ifset} commands, and preventing
+@code{@@value@{@var{flag}@}} from expanding to the value to which
+@var{flag} is set.
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@item @@code@{@var{sample-code}@}
+Highlight text that is an expression, a syntactically complete token
+of a program, or a program name. @xref{code, , @code{@@code}}.@refill
+
+@item @@comment @var{comment}
+Begin a comment in Texinfo. The rest of the line does not appear in
+either the Info file or the printed manual. A synonym for @code{@@c}.
+@xref{Comments, , Comments}.@refill
+
+@item @@contents
+Print a complete table of contents. Has no effect in Info, which uses
+menus instead. @xref{Contents, , Generating a Table of
+Contents}.@refill
+
+@item @@copyright@{@}
+Generate a copyright symbol. @xref{copyright symbol, ,
+@code{@@copyright}}.@refill
+
+@ignore
+@item @@ctrl@{@var{ctrl-char}@}
+Describe an @sc{ascii} control character. Insert actual control character
+into Info file. @xref{ctrl, , @code{@@ctrl}}.@refill
+@end ignore
+
+@item @@defcodeindex @var{index-name}
+Define a new index and its indexing command. Print entries in an
+@code{@@code} font. @xref{New Indices, , Defining New
+Indices}.@refill
+
+@item @@defcv @var{category} @var{class} @var{name}
+@itemx @@defcvx @var{category} @var{class} @var{name}
+Format a description for a variable associated with a class in
+object-oriented programming. Takes three arguments: the category of
+thing being defined, the class to which it belongs, and its name.
+@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
+@itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{}
+Format a description for a function, interactive command, or similar
+entity that may take arguments. @code{@@deffn} takes as arguments the
+category of entity being described, the name of this particular
+entity, and its arguments, if any. @xref{Definition Commands}.@refill
+
+@item @@defindex @var{index-name}
+Define a new index and its indexing command. Print entries in a roman
+font. @xref{New Indices, , Defining New Indices}.@refill
+
+@c Unused so far as I can see and unsupported by makeinfo -- karl, 15sep96.
+@item @@definfoenclose @var{new-command}, @var{before}, @var{after},
+Create new @@-command for Info that marks text by enclosing it in
+strings that precede and follow the text. Write definition inside of
+@code{@@ifinfo} @dots{} @code{@@end ifinfo}. @xref{Customized
+Highlighting}.@refill
+
+@item @@defivar @var{class} @var{instance-variable-name}
+@itemx @@defivarx @var{class} @var{instance-variable-name}
+This command formats a description for an instance variable in
+object-oriented programming. The command is equivalent to @samp{@@defcv
+@{Instance Variable@} @dots{}}. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defmac @var{macro-name} @var{arguments}@dots{}
+@itemx @@defmacx @var{macro-name} @var{arguments}@dots{}
+Format a description for a macro. The command is equivalent to
+@samp{@@deffn Macro @dots{}}. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
+@itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{}
+Format a description for a method in object-oriented programming. The
+command is equivalent to @samp{@@defop Method @dots{}}. Takes as
+arguments the name of the class of the method, the name of the
+method, and its arguments, if any. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
+@itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{}
+Format a description for an operation in object-oriented programming.
+@code{@@defop} takes as arguments the overall name of the category of
+operation, the name of the class of the operation, the name of the
+operation, and its arguments, if any. @xref{Definition
+Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defopt @var{option-name}
+@itemx @@defoptx @var{option-name}
+Format a description for a user option. The command is equivalent to
+@samp{@@defvr @{User Option@} @dots{}}. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defspec @var{special-form-name} @var{arguments}@dots{}
+@itemx @@defspecx @var{special-form-name} @var{arguments}@dots{}
+Format a description for a special form. The command is equivalent to
+@samp{@@deffn @{Special Form@} @dots{}}. @xref{Definition Commands},
+and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
+@itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{}
+Format a description for a data type. @code{@@deftp} takes as arguments
+the category, the name of the type (which is a word like @samp{int} or
+@samp{float}), and then the names of attributes of objects of that type.
+@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
+@itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
+Format a description for a function or similar entity that may take
+arguments and that is typed. @code{@@deftypefn} takes as arguments the
+classification of entity being described, the type, the name of the
+entity, and its arguments, if any. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
+@itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
+Format a description for a function in a typed language.
+The command is equivalent to @samp{@@deftypefn Function @dots{}}.
+@xref{Definition Commands},
+and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deftypevr @var{classification} @var{data-type} @var{name}
+@itemx @@deftypevrx @var{classification} @var{data-type} @var{name}
+Format a description for something like a variable in a typed
+language---an entity that records a value. Takes as arguments the
+classification of entity being described, the type, and the name of the
+entity. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in
+Detail}.
+
+@item @@deftypevar @var{data-type} @var{variable-name}
+@itemx @@deftypevarx @var{data-type} @var{variable-name}
+Format a description for a variable in a typed language. The command is
+equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
+Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defun @var{function-name} @var{arguments}@dots{}
+@itemx @@defunx @var{function-name} @var{arguments}@dots{}
+Format a description for functions. The command is equivalent to
+@samp{@@deffn Function @dots{}}. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defvar @var{variable-name}
+@itemx @@defvarx @var{variable-name}
+Format a description for variables. The command is equivalent to
+@samp{@@defvr Variable @dots{}}. @xref{Definition Commands}, and
+@ref{deffnx,, Def Cmds in Detail}.
+
+@item @@defvr @var{category} @var{name}
+@itemx @@defvrx @var{category} @var{name}
+Format a description for any kind of variable. @code{@@defvr} takes
+as arguments the category of the entity and the name of the entity.
+@xref{Definition Commands},
+and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@detailmenu@{@}
+Use to avoid Makeinfo confusion stemming from the detailed node listing
+in a master menu. @xref{Master Menu Parts}.
+
+@item @@dfn@{@var{term}@}
+Highlight the introductory or defining use of a term.
+@xref{dfn, , @code{@@dfn}}.@refill
+
+@item @@dircategory @var{dirpart}
+Specify a part of the Info directory menu where this file's entry should
+go. @xref{Installing Dir Entries}.
+
+@item @@direntry
+Begin the Info directory menu entry for this file.
+@xref{Installing Dir Entries}.
+
+@need 100
+@item @@display
+Begin a kind of example. Indent text, do not fill, do not select a
+new font. Pair with @code{@@end display}. @xref{display, ,
+@code{@@display}}.@refill
+
+@item @@dmn@{@var{dimension}@}
+Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a
+thin space before @var{dimension}. No effect in Info.
+@xref{dmn, , @code{@@dmn}}.@refill
+
+@need 100
+@item @@dots@{@}
+Insert an ellipsis: @samp{@dots{}}.
+@xref{dots, , @code{@@dots}}.@refill
+
+@item @@email@{@var{address}@}
+Indicate an electronic mail address.
+@xref{email, , @code{@@email}}.@refill
+
+@need 100
+@item @@emph@{@var{text}@}
+Highlight @var{text}; text is displayed in @emph{italics} in printed
+output, and surrounded by asterisks in Info. @xref{Emphasis, , Emphasizing Text}.@refill
+
+@item @@end @var{environment}
+Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting
+Commands,,@@-commands}.
+
+@item @@enddots@{@}
+Generate an end-of-sentence of ellipsis, like this @enddots{}
+@xref{dots,,@code{@@dots@{@}}}.
+
+@need 100
+@item @@enumerate [@var{number-or-letter}]
+Begin a numbered list, using @code{@@item} for each entry.
+Optionally, start list with @var{number-or-letter}. Pair with
+@code{@@end enumerate}. @xref{enumerate, ,
+@code{@@enumerate}}.@refill
+
+@need 100
+@item @@equiv@{@}
+Indicate to the reader the exact equivalence of two forms with a
+glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill
+
+@item @@error@{@}
+Indicate to the reader with a glyph that the following text is
+an error message: @samp{@error{}}. @xref{Error Glyph}.@refill
+
+@item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
+Specify page footings for even-numbered (left-hand) pages. Not relevant to
+Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
+
+@item @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
+Specify page headings for even-numbered (left-hand) pages. Only
+supported within @code{@@iftex}. @xref{Custom Headings, , How to Make
+Your Own Headings}.@refill
+
+@item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
+@itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
+Specify page footings resp.@: headings for every page. Not relevant to
+Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
+
+@item @@example
+Begin an example. Indent text, do not fill, and select fixed-width font.
+Pair with @code{@@end example}. @xref{example, ,
+@code{@@example}}.@refill
+
+@item @@exclamdown@{@}
+Generate an upside-down exclamation point. @xref{Inserting Accents}.
+
+@item @@exdent @var{line-of-text}
+Remove any indentation a line might have. @xref{exdent, ,
+Undoing the Indentation of a Line}.@refill
+
+@item @@expansion@{@}
+Indicate the result of a macro expansion to the reader with a special
+glyph: @samp{@expansion{}}.
+@xref{expansion, , @expansion{} Indicating an Expansion}.@refill
+
+@item @@file@{@var{filename}@}
+Highlight the name of a file, buffer, node, or directory. @xref{file, ,
+@code{@@file}}.@refill
+
+@item @@finalout
+Prevent @TeX{} from printing large black warning rectangles beside
+over-wide lines. @xref{Overfull hboxes}.@refill
+
+@need 100
+@item @@findex @var{entry}
+Add @var{entry} to the index of functions. @xref{Index Entries, ,
+Defining the Entries of an Index}.@refill
+
+@need 200
+@item @@flushleft
+@itemx @@flushright
+Left justify every line but leave the right end ragged.
+Leave font as is. Pair with @code{@@end flushleft}.
+@code{@@flushright} analogous.
+@xref{flushleft & flushright, , @code{@@flushleft} and
+@code{@@flushright}}.@refill
+
+@need 200
+@item @@footnote@{@var{text-of-footnote}@}
+Enter a footnote. Footnote text is printed at the bottom of the page
+by @TeX{}; Info may format in either `End' node or `Separate' node style.
+@xref{Footnotes}.@refill
+
+@item @@footnotestyle @var{style}
+Specify an Info file's footnote style, either @samp{end} for the end
+node style or @samp{separate} for the separate node style.
+@xref{Footnotes}.@refill
+
+@item @@format
+Begin a kind of example. Like @code{@@example} or @code{@@display},
+but do not narrow the margins and do not select the fixed-width font.
+Pair with @code{@@end format}. @xref{example, ,
+@code{@@example}}.@refill
+
+@item @@ftable @var{formatting-command}
+Begin a two-column table, using @code{@@item} for each entry.
+Automatically enter each of the items in the first column into the
+index of functions. Pair with @code{@@end ftable}. The same as
+@code{@@table}, except for indexing. @xref{ftable vtable, ,
+@code{@@ftable} and @code{@@vtable}}.@refill
+
+@item @@group
+Hold text together that must appear on one printed page. Pair with
+@code{@@end group}. Not relevant to Info. @xref{group, ,
+@code{@@group}}.@refill
+
+@item @@H@{@var{c}@}
+Generate the long Hungarian umlaut accent over @var{c}, as in @H{o}.
+
+@item @@heading @var{title}
+Print an unnumbered section-like heading in the text, but not in the
+table of contents of a printed manual. In Info, the title is
+underlined with equal signs. @xref{unnumberedsec appendixsec heading,
+, Section Commands}.@refill
+
+@item @@headings @var{on-off-single-double}
+Turn page headings on or off, and/or specify single-sided or double-sided
+page headings for printing. @xref{headings on off, , The
+@code{@@headings} Command}.
+
+@item @@i@{@var{text}@}
+Print @var{text} in @i{italic} font. No effect in Info.
+@xref{Fonts}.@refill
+
+@item @@ifclear @var{flag}
+If @var{flag} is cleared, the Texinfo formatting commands format text
+between @code{@@ifclear @var{flag}} and the following @code{@@end
+ifclear} command.
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@item @@ifhtml
+@itemx @@ifinfo
+Begin a stretch of text that will be ignored by @TeX{} when it typesets
+the printed manual. The text appears only in the HTML resp.@: Info
+file. Pair with @code{@@end ifhtml} resp.@: @code{@@end ifinfo}.
+@xref{Conditionals, , Conditionally Visible Text}.@refill
+
+@item @@ifset @var{flag}
+If @var{flag} is set, the Texinfo formatting commands format text
+between @code{@@ifset @var{flag}} and the following @code{@@end ifset}
+command.
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@item @@iftex
+Begin a stretch of text that will not appear in the Info file, but
+will be processed only by @TeX{}. Pair with @code{@@end iftex}.
+@xref{Conditionals, , Conditionally Visible Text}.@refill
+
+@item @@ignore
+Begin a stretch of text that will not appear in either the Info file
+or the printed output. Pair with @code{@@end ignore}.
+@xref{Comments, , Comments and Ignored Text}.@refill
+
+@item @@include @var{filename}
+Incorporate the contents of the file @var{filename} into the Info file
+or printed document. @xref{Include Files}.@refill
+
+@item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
+Make a cross reference to an Info file for which there is no printed
+manual. @xref{inforef, , Cross references using
+@code{@@inforef}}.@refill
+
+@item \input @var{macro-definitions-file}
+Use the specified macro definitions file. This command is used only
+in the first line of a Texinfo file to cause @TeX{} to make use of the
+@file{texinfo} macro definitions file. The backslash in @code{\input}
+is used instead of an @code{@@} because @TeX{} does not
+recognize @code{@@} until after it has read the definitions file.
+@xref{Header, , The Texinfo File Header}.@refill
+
+@item @@item
+Indicate the beginning of a marked paragraph for @code{@@itemize} and
+@code{@@enumerate}; indicate the beginning of the text of a first column
+entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
+@xref{Lists and Tables}.@refill
+
+@item @@itemize @var{mark-generating-character-or-command}
+Produce a sequence of indented paragraphs, with a mark inside the left
+margin at the beginning of each paragraph. Pair with @code{@@end
+itemize}. @xref{itemize, , @code{@@itemize}}.@refill
+
+@item @@itemx
+Like @code{@@item} but do not generate extra vertical space above the
+item text. @xref{itemx, , @code{@@itemx}}.@refill
+
+@item @@kbd@{@var{keyboard-characters}@}
+Indicate text that is characters of input to be typed by
+users. @xref{kbd, , @code{@@kbd}}.@refill
+
+@item @@key@{@var{key-name}@}
+Highlight @var{key-name}, a name for a key on a keyboard.
+@xref{key, , @code{@@key}}.@refill
+
+@item @@kindex @var{entry}
+Add @var{entry} to the index of keys. @xref{Index Entries, , Defining the
+Entries of an Index}.@refill
+
+@item @@L@{@}
+@itemx @@l@{@}
+Generate the uppercase and lowercase Polish suppressed-L letters,
+respectively: @L{}, @l{}.
+
+@c Possibly this can be tossed now that we have macros. --karl, 16sep96.
+@item @@global@@let@var{new-command}=@var{existing-command}
+Equate a new highlighting command with an existing one. Only for
+@TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end
+iftex}. @xref{Customized Highlighting}.@refill
+
+@item @@lisp
+Begin an example of Lisp code. Indent text, do not fill, and select
+fixed-width font. Pair with @code{@@end lisp}. @xref{Lisp Example, ,
+@code{@@lisp}}.@refill
+
+@item @@lowersections
+Change subsequent chapters to sections, sections to subsections, and so
+on. @xref{Raise/lower sections, , @code{@@raisesections} and
+@code{@@lowersections}}.@refill
+
+@item @@macro @var{macro-name} @{@var{params}@}
+Define a new Texinfo command @code{@@@var{macro-name}@{@var{params}@}}.
+Only supported by Makeinfo and Texi2dvi. @xref{Defining Macros}.
+
+@item @@majorheading @var{title}
+Print a chapter-like heading in the text, but not in the table of
+contents of a printed manual. Generate more vertical whitespace before
+the heading than the @code{@@chapheading} command. In Info, the chapter
+heading line is underlined with asterisks. @xref{majorheading &
+chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill
+
+@item @@math@{@var{mathematical-expression}@}
+Format a mathematical expression.
+@xref{math, , @code{@@math}: Inserting Mathematical Expressions}.
+
+@item @@menu
+Mark the beginning of a menu of nodes in Info. No effect in a printed
+manual. Pair with @code{@@end menu}. @xref{Menus}.@refill
+
+@item @@minus@{@}
+Generate a minus sign, `@minus{}'. @xref{minus, , @code{@@minus}}.@refill
+
+@item @@multitable @var{column-width-spec}
+Begin a multi-column table. Pair with @code{@@end multitable}.
+@xref{Multitable Column Widths}.
+
+@item @@need @var{n}
+Start a new page in a printed manual if fewer than @var{n} mils
+(thousandths of an inch) remain on the current page. @xref{need, ,
+@code{@@need}}.@refill
+
+@item @@node @var{name, next, previous, up}
+Define the beginning of a new node in Info, and serve as a locator for
+references for @TeX{}. @xref{node, , @code{@@node}}.@refill
+
+@item @@noindent
+Prevent text from being indented as if it were a new paragraph.
+@xref{noindent, , @code{@@noindent}}.@refill
+
+@item @@O@{@}
+@itemx @@o@{@}
+Generate the uppercase and lowercase Owith-slash letters, respectively:
+@O{}, @o{}.
+
+@item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
+@itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
+Specify page footings resp.@: headings for odd-numbered (right-hand)
+pages. Only allowed inside @code{@@iftex}. @xref{Custom Headings, ,
+How to Make Your Own Headings}.@refill
+
+@item @@OE@{@}
+@itemx @@oe@{@}
+Generate the uppercase and lowercase OE ligatures, respectively:
+@OE{}, @oe{}. @xref{Inserting Accents}.
+
+@item @@page
+Start a new page in a printed manual. No effect in Info.
+@xref{page, , @code{@@page}}.@refill
+
+@item @@paragraphindent @var{indent}
+Indent paragraphs by @var{indent} number of spaces; delete indentation
+if the value of @var{indent} is 0; and do not change indentation if
+@var{indent} is @code{asis}. @xref{paragraphindent, , Paragraph
+Indenting}.@refill
+
+@item @@pindex @var{entry}
+Add @var{entry} to the index of programs. @xref{Index Entries, , Defining
+the Entries of an Index}.@refill
+
+@item @@point@{@}
+Indicate the position of point in a buffer to the reader with a
+glyph: @samp{@point{}}. @xref{Point Glyph, , Indicating
+Point in a Buffer}.@refill
+
+@item @@pounds@{@}
+Generate the pounds sterling currency sign.
+@xref{pounds,,@code{@@pounds@{@}}}.
+
+@item @@print@{@}
+Indicate printed output to the reader with a glyph:
+@samp{@print{}}. @xref{Print Glyph}.@refill
+
+@item @@printindex @var{index-name}
+Print an alphabetized two-column index in a printed manual or generate
+an alphabetized menu of index entries for Info. @xref{Printing
+Indices & Menus}.@refill
+
+@item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
+Make a reference that starts with a lower case `see' in a printed
+manual. Use within parentheses only. Do not follow command with a
+punctuation mark---the Info formatting commands automatically insert
+terminating punctuation as needed. Only the first argument is mandatory.
+@xref{pxref, , @code{@@pxref}}.@refill
+
+@item @@questiondown@{@}
+Generate an upside-down question mark. @xref{Inserting Accents}.
+
+@item @@quotation
+Narrow the margins to indicate text that is quoted from another real
+or imaginary work. Write command on a line of its own. Pair with
+@code{@@end quotation}. @xref{quotation, ,
+@code{@@quotation}}.@refill
+
+@need 100
+@item @@r@{@var{text}@}
+Print @var{text} in @r{roman} font. No effect in Info.
+@xref{Fonts}.@refill
+
+@item @@raisesections
+Change subsequent sections to chapters, subsections to sections, and so
+on. @xref{Raise/lower sections, , @code{@@raisesections} and
+@code{@@lowersections}}.@refill
+
+@need 300
+@item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
+Make a reference. In a printed manual, the reference does not start
+with a `See'. Follow command with a punctuation mark. Only the first
+argument is mandatory. @xref{ref, , @code{@@ref}}.@refill
+
+@need 300
+@item @@refill
+In Info, refill and indent the paragraph after all the other processing
+has been done. No effect on @TeX{}, which always refills. This command
+is no longer needed, since all formatters now automatically refill.
+@xref{Refilling Paragraphs}.@refill
+
+@need 300
+@item @@result@{@}
+Indicate the result of an expression to the reader with a special
+glyph: @samp{@result{}}. @xref{result, , @code{@@result}}.@refill
+
+@item @@ringaccent@{@var{c}@}
+Generate a ring accent over the next character, as in @ringaccent{o}.
+@xref{Inserting Accents}.
+
+@item @@samp@{@var{text}@}
+Highlight @var{text} that is a literal example of a sequence of
+characters. Used for single characters, for statements, and often for
+entire shell commands. @xref{samp, , @code{@@samp}}.@refill
+
+@item @@sc@{@var{text}@}
+Set @var{text} in a printed output in @sc{the small caps font} and
+set text in the Info file in uppercase letters.
+@xref{Smallcaps}.@refill
+
+@item @@section @var{title}
+Begin a section within a chapter. In a printed manual, the section
+title is numbered and appears in the table of contents. In Info, the
+title is underlined with equal signs. @xref{section, ,
+@code{@@section}}.@refill
+
+@item @@set @var{flag} [@var{string}]
+Make @var{flag} active, causing the Texinfo formatting commands to
+format text between subsequent pairs of @code{@@ifset @var{flag}} and
+@code{@@end ifset} commands. Optionally, set value of @var{flag} to
+@var{string}.
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@item @@setchapternewpage @var{on-off-odd}
+Specify whether chapters start on new pages, and if so, whether on
+odd-numbered (right-hand) new pages. @xref{setchapternewpage, ,
+@code{@@setchapternewpage}}.@refill
+
+@item @@setfilename @var{info-file-name}
+Provide a name to be used by the Info file. This command is essential
+for @TeX{} formatting as well, even though it produces no output.
+@xref{setfilename, , @code{@@setfilename}}.@refill
+
+@item @@settitle @var{title}
+Provide a title for page headers in a printed manual.
+@xref{settitle, , @code{@@settitle}}.@refill
+
+@item @@shortcontents
+Print a short table of contents. Not relevant to Info, which uses
+menus rather than tables of contents. A synonym for
+@code{@@summarycontents}. @xref{Contents, , Generating a Table of
+Contents}.@refill
+
+@item @@shorttitlepage@{@var{title}@}
+Generate a minimal title page. @xref{titlepage,,@code{@@titlepage}}.
+
+@need 400
+@item @@smallbook
+Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
+rather than the regular 8.5 by 11 inch format. @xref{smallbook, ,
+Printing Small Books}. Also, see @ref{smallexample & smalllisp, ,
+@code{@@smallexample} and @code{@@smalllisp}}.@refill
+
+@need 400
+@item @@smallexample
+Indent text to indicate an example. Do not fill, select fixed-width
+font. In @code{@@smallbook} format, print text in a smaller font than
+with @code{@@example}. Pair with @code{@@end smallexample}.
+@xref{smallexample & smalllisp, , @code{@@smallexample} and
+@code{@@smalllisp}}.@refill
+
+@need 400
+@item @@smalllisp
+Begin an example of Lisp code. Indent text, do not fill, select
+fixed-width font. In @code{@@smallbook} format, print text in a
+smaller font. Pair with @code{@@end smalllisp}. @xref{smallexample &
+smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill
+
+@need 700
+@item @@sp @var{n}
+Skip @var{n} blank lines. @xref{sp, , @code{@@sp}}.@refill
+
+@item @@ss@{@}
+Generate the German sharp-S es-zet letter, @ss{}. @xref{Inserting Accents}.
+
+@need 700
+@item @@strong @var{text}
+Emphasize @var{text} by typesetting it in a @strong{bold} font for the
+printed manual and by surrounding it with asterisks for Info.
+@xref{emph & strong, , Emphasizing Text}.@refill
+
+@item @@subheading @var{title}
+Print an unnumbered subsection-like heading in the text, but not in
+the table of contents of a printed manual. In Info, the title is
+underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
+subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec}
+@code{@@subheading}}.@refill
+
+@item @@subsection @var{title}
+Begin a subsection within a section. In a printed manual, the
+subsection title is numbered and appears in the table of contents. In
+Info, the title is underlined with hyphens. @xref{subsection, ,
+@code{@@subsection}}.@refill
+
+@item @@subsubheading @var{title}
+Print an unnumbered subsubsection-like heading in the text, but not in
+the table of contents of a printed manual. In Info, the title is
+underlined with periods. @xref{subsubsection, , The `subsub'
+Commands}.@refill
+
+@item @@subsubsection @var{title}
+Begin a subsubsection within a subsection. In a printed manual,
+the subsubsection title is numbered and appears in the table of
+contents. In Info, the title is underlined with periods.
+@xref{subsubsection, , The `subsub' Commands}.@refill
+
+@item @@subtitle @var{title}
+In a printed manual, set a subtitle in a normal sized font flush to
+the right-hand side of the page. Not relevant to Info, which does not
+have title pages. @xref{title subtitle author, , @code{@@title}
+@code{@@subtitle} and @code{@@author} Commands}.@refill
+
+@item @@summarycontents
+Print a short table of contents. Not relevant to Info, which uses
+menus rather than tables of contents. A synonym for
+@code{@@shortcontents}. @xref{Contents, , Generating a Table of
+Contents}.@refill
+
+@need 300
+@item @@syncodeindex @var{from-index} @var{into-index}
+Merge the index named in the first argument into the index named in
+the second argument, printing the entries from the first index in
+@code{@@code} font. @xref{Combining Indices}.@refill
+
+@need 300
+@item @@synindex @var{from-index} @var{into-index}
+Merge the index named in the first argument into the index named in
+the second argument. Do not change the font of @var{from-index}
+entries. @xref{Combining Indices}.@refill
+
+@need 100
+@item @@t@{@var{text}@}
+Print @var{text} in a @t{fixed-width}, typewriter-like font.
+No effect in Info. @xref{Fonts}.@refill
+
+@item @@tab
+Separate columns in a multitable. @xref{Multitable Rows}.
+
+@need 400
+@item @@table @var{formatting-command}
+Begin a two-column table, using @code{@@item} for each entry. Write
+each first column entry on the same line as @code{@@item}. First
+column entries are printed in the font resulting from
+@var{formatting-command}. Pair with @code{@@end table}.
+@xref{Two-column Tables, , Making a Two-column Table}.
+Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}},
+and @ref{itemx, , @code{@@itemx}}.@refill
+
+@item @@TeX@{@}
+Insert the logo @TeX{}. @xref{TeX and copyright, , Inserting @TeX{}
+and @copyright{}}.@refill
+
+@item @@tex
+Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Using
+Ordinary TeX Commands, , Using Ordinary @TeX{} Commands}.@refill
+
+@item @@thischapter
+@itemx @@thischaptername
+@itemx @@thisfile
+@itemx @@thispage
+@itemx @@thistitle
+Only allowed in a heading or footing. Stands for the number and name of
+the current chapter (in the format `Chapter 1: Title'), the chapter name
+only, the filename, the current page number, and the title of the
+document, respectively. @xref{Custom Headings, , How to Make Your Own
+Headings}.@refill
+
+@item @@tindex @var{entry}
+Add @var{entry} to the index of data types. @xref{Index Entries, ,
+Defining the Entries of an Index}.@refill
+
+@item @@title @var{title}
+In a printed manual, set a title flush to the left-hand side of the
+page in a larger than normal font and underline it with a black rule.
+Not relevant to Info, which does not have title pages. @xref{title
+subtitle author, , The @code{@@title} @code{@@subtitle} and
+@code{@@author} Commands}.@refill
+
+@need 400
+@item @@titlefont@{@var{text}@}
+In a printed manual, print @var{text} in a larger than normal font.
+Not relevant to Info, which does not have title pages.
+@xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
+and @code{@@sp} Commands}.@refill
+
+@need 300
+@item @@titlepage
+Indicate to Texinfo the beginning of the title page. Write command on
+a line of its own. Pair with @code{@@end titlepage}. Nothing between
+@code{@@titlepage} and @code{@@end titlepage} appears in Info.
+@xref{titlepage, , @code{@@titlepage}}.@refill
+
+@need 150
+@item @@today@{@}
+Insert the current date, in `1 Jan 1900' style. @xref{Custom
+Headings, , How to Make Your Own Headings}.@refill
+
+@item @@top @var{title}
+In a Texinfo file to be formatted with @code{makeinfo}, identify the
+topmost @code{@@node} line in the file, which must be written on the line
+immediately preceding the @code{@@top} command. Used for
+@code{makeinfo}'s node pointer insertion feature. The title is
+underlined with asterisks. Both the @code{@@node} line and the @code{@@top}
+line normally should be enclosed by @code{@@ifinfo} and @code{@@end
+ifinfo}. In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
+command is merely a synonym for @code{@@unnumbered}. @xref{makeinfo
+Pointer Creation, , Creating Pointers with @code{makeinfo}}.
+
+@item @@u@var{c}
+@itemx @@ubaraccent@var{c}
+@itemx @@udotaccent@var{c}
+Generate a breve, underbar, or underdot accent, respectively, over or
+under the character @var{c}, as in @u{o}, @ubaraccent{o},
+@udotaccent{o}. @xref{Inserting Accents}.
+
+@item @@unnumbered @var{title}
+In a printed manual, begin a chapter that appears without chapter
+numbers of any kind. The title appears in the table of contents of a
+printed manual. In Info, the title is underlined with asterisks.
+@xref{unnumbered & appendix, , @code{@@unnumbered} and
+@code{@@appendix}}.@refill
+
+@item @@unnumberedsec @var{title}
+In a printed manual, begin a section that appears without section
+numbers of any kind. The title appears in the table of contents of a
+printed manual. In Info, the title is underlined with equal signs.
+@xref{unnumberedsec appendixsec heading, , Section Commands}.@refill
+
+@item @@unnumberedsubsec @var{title}
+In a printed manual, begin an unnumbered subsection within a
+chapter. The title appears in the table of contents of a printed
+manual. In Info, the title is underlined with hyphens.
+@xref{unnumberedsubsec appendixsubsec subheading, ,
+@code{@@unnumberedsubsec} @code{@@appendixsubsec}
+@code{@@subheading}}.@refill
+
+@item @@unnumberedsubsubsec @var{title}
+In a printed manual, begin an unnumbered subsubsection within a
+chapter. The title appears in the table of contents of a printed
+manual. In Info, the title is underlined with periods.
+@xref{subsubsection, , The `subsub' Commands}.@refill
+
+@item @@url@{@var{url}@}
+Highlight text that is a uniform resource locator for the World Wide
+Web. @xref{url, , @code{@@url}}.@refill
+
+@item @@v@var{c}
+Generate check accent over the character @var{c}, as in @v{o}.
+@xref{Inserting Accents}.
+
+@item @@value@{@var{flag}@}
+Replace @var{flag} with the value to which it is set by @code{@@set
+@var{flag}}.
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@item @@var@{@var{metasyntactic-variable}@}
+Highlight a metasyntactic variable, which is something that stands for
+another piece of text. @xref{var, , Indicating Metasyntactic
+Variables}.@refill
+
+@need 400
+@item @@vindex @var{entry}
+Add @var{entry} to the index of variables. @xref{Index Entries, ,
+Defining the Entries of an Index}.@refill
+
+@need 400
+@item @@vskip @var{amount}
+In a printed manual, insert whitespace so as to push text on the
+remainder of the page towards the bottom of the page. Used in
+formatting the copyright page with the argument @samp{0pt plus
+1filll}. (Note spelling of @samp{filll}.) @code{@@vskip} may be used
+only in contexts ignored for Info. @xref{Copyright & Permissions, ,
+The Copyright Page and Printed Permissions}.@refill
+
+@need 400
+@item @@vtable @var{formatting-command}
+Begin a two-column table, using @code{@@item} for each entry.
+Automatically enter each of the items in the first column into the
+index of variables. Pair with @code{@@end vtable}. The same as
+@code{@@table}, except for indexing. @xref{ftable vtable, ,
+@code{@@ftable} and @code{@@vtable}}.@refill
+
+@need 400
+@item @@w@{@var{text}@}
+Prevent @var{text} from being split across two lines. Do not end a
+paragraph that uses @code{@@w} with an @code{@@refill} command.
+@xref{w, , @code{@@w}}.@refill
+
+@need 400
+@item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
+Make a reference that starts with `See' in a printed manual. Follow
+command with a punctuation mark. Only the first argument is
+mandatory. @xref{xref, , @code{@@xref}}.@refill
+@end table
+
+@node Tips, Sample Texinfo File, Command List, Top
+@comment node-name, next, previous, up
+@appendix Tips and Hints
+
+Here are some tips for writing Texinfo documentation:@refill
+
+@cindex Tips
+@cindex Usage tips
+@cindex Hints
+@itemize @bullet
+@item
+Write in the present tense, not in the past or the future.
+
+@item
+Write actively! For example, write ``We recommend that @dots{}'' rather
+than ``It is recommended that @dots{}''.
+
+@item
+Use 70 or 72 as your fill column. Longer lines are hard to read.
+
+@item
+Include a copyright notice and copying permissions.
+@end itemize
+
+@subsubheading Index, index, index!
+
+Write many index entries, in different ways.
+Readers like indices; they are helpful and convenient.
+
+Although it is easiest to write index entries as you write the body of
+the text, some people prefer to write entries afterwards. In either
+case, write an entry before the paragraph to which it applies. This
+way, an index entry points to the first page of a paragraph that is
+split across pages.
+
+Here are more hints we have found valuable:
+
+@itemize @bullet
+@item
+Write each index entry differently, so each entry refers to a different
+place in the document.
+
+@item
+Write index entries only where a topic is discussed significantly. For
+example, it is not useful to index ``debugging information'' in a
+chapter on reporting bugs. Someone who wants to know about debugging
+information will certainly not find it in that chapter.
+
+@item
+Consistently capitalize the first word of every concept index entry,
+or else consistently use lower case. Terse entries often call for
+lower case; longer entries for capitalization. Whichever case
+convention you use, please use one or the other consistently! Mixing
+the two styles looks bad.
+
+@item
+Always capitalize or use upper case for those words in an index for
+which this is proper, such as names of countries or acronyms. Always
+use the appropriate case for case-sensitive names, such as those in C or
+Lisp.
+
+@item
+Write the indexing commands that refer to a whole section immediately
+after the section command, and write the indexing commands that refer to
+the paragraph before the paragraph.
+
+@need 1000
+In the example that follows, a blank line comes after the index
+entry for ``Leaping'':
+
+@example
+@group
+@@section The Dog and the Fox
+@@cindex Jumping, in general
+@@cindex Leaping
+
+@@cindex Dog, lazy, jumped over
+@@cindex Lazy dog jumped over
+@@cindex Fox, jumps over dog
+@@cindex Quick fox jumps over dog
+The quick brown fox jumps over the lazy dog.
+@end group
+@end example
+
+@noindent
+(Note that the example shows entries for the same concept that are
+written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
+readers can look up the concept in different ways.)
+@end itemize
+
+@subsubheading Blank lines
+
+@itemize @bullet
+@item
+Insert a blank line between a sectioning command and the first following
+sentence or paragraph, or between the indexing commands associated with
+the sectioning command and the first following sentence or paragraph, as
+shown in the tip on indexing. Otherwise, a formatter may fold title and
+paragraph together.
+
+@item
+Always insert a blank line before an @code{@@table} command and after an
+@code{@@end table} command; but never insert a blank line after an
+@code{@@table} command or before an @code{@@end table} command.
+
+@need 1000
+For example,
+
+@example
+@group
+Types of fox:
+
+@@table @@samp
+@@item Quick
+Jump over lazy dogs.
+@end group
+
+@group
+@@item Brown
+Also jump over lazy dogs.
+@@end table
+
+@end group
+@group
+@@noindent
+On the other hand, @dots{}
+@end group
+@end example
+
+Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end
+itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
+same way.
+@end itemize
+
+@subsubheading Complete phrases
+
+Complete phrases are easier to read than @dots{}
+
+@itemize @bullet
+@item
+Write entries in an itemized list as complete sentences; or at least, as
+complete phrases. Incomplete expressions @dots{} awkward @dots{} like
+this.
+
+@item
+Write the prefatory sentence or phrase for a multi-item list or table as
+a complete expression. Do not write ``You can set:''; instead, write
+``You can set these variables:''. The former expression sounds cut off.
+@end itemize
+
+@subsubheading Editions, dates and versions
+
+Write the edition and version numbers and date in three places in every
+manual:
+
+@enumerate
+@item
+In the first @code{@@ifinfo} section, for people reading the Texinfo file.
+
+@item
+In the @code{@@titlepage} section, for people reading the printed manual.
+
+@item
+In the `Top' node, for people reading the Info file.
+@end enumerate
+
+@noindent
+Also, it helps to write a note before the first @code{@@ifinfo}
+section to explain what you are doing.
+
+@need 800
+@noindent
+For example:
+
+@example
+@group
+@@c ===> NOTE! <==
+@@c Specify the edition and version numbers and date
+@@c in *three* places:
+@@c 1. First ifinfo section 2. title page 3. top node
+@@c To find the locations, search for !!set
+@end group
+
+@group
+@@ifinfo
+@@c !!set edition, date, version
+This is Edition 4.03, January 1992,
+of the @@cite@{GDB Manual@} for GDB Version 4.3.
+@dots{}
+@end group
+@end example
+
+@noindent
+---or use @code{@@set} and @code{@@value}
+(@pxref{value Example, , @code{@@value} Example}).
+
+@subsubheading Definition Commands
+
+Definition commands are @code{@@deffn}, @code{@@defun},
+@code{@@defmac}, and the like, and enable you to write descriptions in
+a uniform format.@refill
+
+@itemize @bullet
+@item
+Write just one definition command for each entity you define with a
+definition command. The automatic indexing feature creates an index
+entry that leads the reader to the definition.
+
+@item
+Use @code{@@table} @dots{} @code{@@end table} in an appendix that
+contains a summary of functions, not @code{@@deffn} or other definition
+commands.
+@end itemize
+
+@subsubheading Capitalization
+
+@itemize @bullet
+@item
+Capitalize @samp{Texinfo}; it is a name. Do not write the @samp{x} or
+@samp{i} in upper case.
+
+@item
+Capitalize @samp{Info}; it is a name.
+
+@item
+Write @TeX{} using the @code{@@TeX@{@}} command. Note the uppercase
+@samp{T} and @samp{X}. This command causes the formatters to
+typeset the name according to the wishes of Donald Knuth, who wrote
+@TeX{}.
+@end itemize
+
+@subsubheading Spaces
+
+Do not use spaces to format a Texinfo file, except inside of
+@code{@@example} @dots{} @code{@@end example} and similar commands.
+
+@need 700
+For example, @TeX{} fills the following:
+
+@example
+@group
+ @@kbd@{C-x v@}
+ @@kbd@{M-x vc-next-action@}
+ Perform the next logical operation
+ on the version-controlled file
+ corresponding to the current buffer.
+@end group
+@end example
+
+@need 950
+@noindent
+so it looks like this:
+
+@iftex
+@quotation
+ @kbd{C-x v}
+ @kbd{M-x vc-next-action}
+ Perform the next logical operation on the version-controlled file
+ corresponding to the current buffer.
+@end quotation
+@end iftex
+@ifinfo
+@quotation
+`C-x v' `M-x vc-next-action' Perform the next logical operation on the
+version-controlled file corresponding to the current buffer.
+@end quotation
+@end ifinfo
+
+@noindent
+In this case, the text should be formatted with
+@code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
+
+@subsubheading @@code, @@samp, @@var, and @samp{---}
+
+@itemize @bullet
+@item
+Use @code{@@code} around Lisp symbols, including command names.
+For example,
+
+@example
+The main function is @@code@{vc-next-action@}, @dots{}
+@end example
+
+@item
+Avoid putting letters such as @samp{s} immediately after an
+@samp{@@code}. Such letters look bad.
+
+@item
+Use @code{@@var} around meta-variables. Do not write angle brackets
+around them.
+
+@item
+Use three hyphens in a row, @samp{---}, to indicate a long dash. @TeX{}
+typesets these as a long dash and the Info formatters reduce three
+hyphens to two.
+@end itemize
+
+@subsubheading Periods Outside of Quotes
+
+Place periods and other punctuation marks @emph{outside} of quotations,
+unless the punctuation is part of the quotation. This practice goes
+against publishing conventions in the United States, but enables the
+reader to distinguish between the contents of the quotation and the
+whole passage.
+
+For example, you should write the following sentence with the period
+outside the end quotation marks:
+
+@example
+Evidently, @samp{au} is an abbreviation for ``author''.
+@end example
+
+@noindent
+since @samp{au} does @emph{not} serve as an abbreviation for
+@samp{author.} (with a period following the word).
+
+@subsubheading Introducing New Terms
+
+@itemize @bullet
+@item
+Introduce new terms so that a reader who does not know them can
+understand them from context; or write a definition for the term.
+
+For example, in the following, the terms ``check in'', ``register'' and
+``delta'' are all appearing for the first time; the example sentence should be
+rewritten so they are understandable.
+
+@quotation
+The major function assists you in checking in a file to your
+version control system and registering successive sets of changes to
+it as deltas.
+@end quotation
+
+@item
+Use the @code{@@dfn} command around a word being introduced, to indicate
+that the reader should not expect to know the meaning already, and
+should expect to learn the meaning from this passage.
+@end itemize
+
+@subsubheading @@pxref
+
+@c !!! maybe include this in the tips on pxref
+@ignore
+By the way, it is okay to use pxref with something else in front of
+it within the parens, as long as the pxref is followed by the close
+paren, and the material inside the parens is not part of a larger
+sentence. Also, you can use xref inside parens as part of a complete
+sentence so long as you terminate the cross reference with punctuation.
+@end ignore
+Absolutely never use @code{@@pxref} except in the special context for
+which it is designed: inside parentheses, with the closing parenthesis
+following immediately after the closing brace. One formatter
+automatically inserts closing punctuation and the other does not. This
+means that the output looks right both in printed output and in an Info
+file, but only when the command is used inside parentheses.
+
+@subsubheading Invoking from a Shell
+
+You can invoke programs such as Emacs, GCC, and GAWK from a shell.
+The documentation for each program should contain a section that
+describes this. Unfortunately, if the node names and titles for these
+sections are all different, readers find it hard to search for the
+section.@refill
+
+Name such sections with a phrase beginning with the word
+@w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way
+users can find the section easily.
+
+@subsubheading @sc{ansi c} Syntax
+
+When you use @code{@@example} to describe a C function's calling
+conventions, use the @sc{ansi c} syntax, like this:@refill
+
+@example
+void dld_init (char *@@var@{path@});
+@end example
+
+@noindent
+And in the subsequent discussion, refer to the argument values by
+writing the same argument names, again highlighted with
+@code{@@var}.@refill
+
+@need 800
+Avoid the obsolete style that looks like this:@refill
+
+@example
+#include <dld.h>
+
+dld_init (path)
+char *path;
+@end example
+
+Also, it is best to avoid writing @code{#include} above the
+declaration just to indicate that the function is declared in a
+header file. The practice may give the misimpression that the
+@code{#include} belongs near the declaration of the function. Either
+state explicitly which header file holds the declaration or, better
+yet, name the header file used for a group of functions at the
+beginning of the section that describes the functions.@refill
+
+@subsubheading Bad Examples
+
+Here are several examples of bad writing to avoid:
+
+In this example, say, `` @dots{} you must @code{@@dfn}@{check
+in@} the new version.'' That flows better.
+
+@quotation
+When you are done editing the file, you must perform a
+@code{@@dfn}@{check in@}.
+@end quotation
+
+In the following example, say, ``@dots{} makes a unified interface such as VC
+mode possible.''
+
+@quotation
+SCCS, RCS and other version-control systems all perform similar
+functions in broadly similar ways (it is this resemblance which makes
+a unified control mode like this possible).
+@end quotation
+
+And in this example, you should specify what `it' refers to:
+
+@quotation
+If you are working with other people, it assists in coordinating
+everyone's changes so they do not step on each other.
+@end quotation
+
+@subsubheading And Finally @dots{}
+
+@itemize @bullet
+@item
+Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
+sound in the name `Bach'. But pronounce Texinfo as in `speck':
+@samp{teckinfo}.
+
+@item
+Write notes for yourself at the very end of a Texinfo file after the
+@code{@@bye}. None of the formatters process text after the
+@code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
+@code{@@end ignore}.
+@end itemize
+
+@node Sample Texinfo File, Sample Permissions, Tips, Top
+@comment node-name, next, previous, up
+@appendix A Sample Texinfo File
+@cindex Sample Texinfo file, no comments
+
+Here is a complete, short sample Texinfo file, without any commentary.
+You can see this file, with comments, in the first chapter.
+@xref{Short Sample, , A Short Sample Texinfo File}.
+
+@sp 1
+@example
+\input texinfo @@c -*-texinfo-*-
+@@c %**start of header
+@@setfilename sample.info
+@@settitle Sample Document
+@@c %**end of header
+
+@@setchapternewpage odd
+
+@@ifinfo
+This is a short example of a complete Texinfo file.
+
+Copyright 1990 Free Software Foundation, Inc.
+@@end ifinfo
+
+@@titlepage
+@@sp 10
+@@comment The title is printed in a large font.
+@@center @@titlefont@{Sample Title@}
+
+@@c The following two commands start the copyright page.
+@@page
+@@vskip 0pt plus 1filll
+Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
+@@end titlepage
+
+@@node Top, First Chapter, (dir), (dir)
+@@comment node-name, next, previous, up
+
+@@menu
+* First Chapter:: The first chapter is the
+ only chapter in this sample.
+* Concept Index:: This index has two entries.
+@@end menu
+
+@@node First Chapter, Concept Index, Top, Top
+@@comment node-name, next, previous, up
+@@chapter First Chapter
+@@cindex Sample index entry
+
+This is the contents of the first chapter.
+@@cindex Another sample index entry
+
+Here is a numbered list.
+
+@@enumerate
+@@item
+This is the first item.
+
+@@item
+This is the second item.
+@@end enumerate
+
+The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
+commands transform a Texinfo file such as this into
+an Info file; and @@TeX@{@} typesets it for a printed
+manual.
+
+@@node Concept Index, , First Chapter, Top
+@@comment node-name, next, previous, up
+@@unnumbered Concept Index
+
+@@printindex cp
+
+@@contents
+@@bye
+@end example
+
+@node Sample Permissions, Include Files, Sample Texinfo File, Top
+@appendix Sample Permissions
+@cindex Permissions
+@cindex Copying permissions
+
+Texinfo files should contain sections that tell the readers that they
+have the right to copy and distribute the Texinfo file, the Info file,
+and the printed manual.@refill
+
+Also, if you are writing a manual about software, you should explain
+that the software is free and either include the GNU General Public
+License (GPL) or provide a reference to it. @xref{Distrib, ,
+Distribution, emacs, The GNU Emacs Manual}, for an example of the text
+that could be used in the software ``Distribution'', ``General Public
+License'', and ``NO WARRANTY'' sections of a document. @xref{Copying,
+, Texinfo Copying Conditions}, for an example of a brief explanation
+of how the copying conditions provide you with rights. @refill
+
+@menu
+* Inserting Permissions:: How to put permissions in your document.
+* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
+* Titlepage Permissions:: Sample Titlepage copying permissions.
+@end menu
+
+@node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions
+@ifinfo
+@appendixsec Inserting Permissions
+@end ifinfo
+
+In a Texinfo file, the first @code{@@ifinfo} section usually begins
+with a line that says what the file documents. This is what a person
+reading the unprocessed Texinfo file or using the advanced Info
+command @kbd{g *} sees first. @inforef{Expert, Advanced Info
+commands, info}, for more information. (A reader using the regular
+Info commands usually starts reading at the first node and skips
+this first section, which is not in a node.)@refill
+
+In the @code{@@ifinfo} section, the summary sentence is followed by a
+copyright notice and then by the copying permission notice. One of
+the copying permission paragraphs is enclosed in @code{@@ignore} and
+@code{@@end ignore} commands. This paragraph states that the Texinfo
+file can be processed through @TeX{} and printed, provided the printed
+manual carries the proper copying permission notice. This paragraph
+is not made part of the Info file since it is not relevant to the Info
+file; but it is a mandatory part of the Texinfo file since it permits
+people to process the Texinfo file in @TeX{} and print the
+results.@refill
+
+In the printed manual, the Free Software Foundation copying permission
+notice follows the copyright notice and publishing information and is
+located within the region delineated by the @code{@@titlepage} and
+@code{@@end titlepage} commands. The copying permission notice is exactly
+the same as the notice in the @code{@@ifinfo} section except that the
+paragraph enclosed in @code{@@ignore} and @code{@@end ignore} commands is
+not part of the notice.@refill
+
+To make it simple to insert a permission notice into each section of
+the Texinfo file, sample permission notices for each section are
+reproduced in full below.@refill
+
+Note that you may need to specify the correct name of a section
+mentioned in the permission notice. For example, in @cite{The GDB
+Manual}, the name of the section referring to the General Public
+License is called the ``GDB General Public License'', but in the
+sample shown below, that section is referred to generically as the
+``GNU General Public License''. If the Texinfo file does not carry a
+copy of the General Public License, leave out the reference to it, but
+be sure to include the rest of the sentence.@refill
+
+@node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions
+@comment node-name, next, previous, up
+@appendixsec @samp{ifinfo} Copying Permissions
+@cindex @samp{ifinfo} permissions
+
+In the @code{@@ifinfo} section of a Texinfo file, the standard Free
+Software Foundation permission notice reads as follows:@refill
+
+@example
+This file documents @dots{}
+
+Copyright 1992 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+
+@@ignore
+Permission is granted to process this file through TeX
+and print the results, provided the printed document
+carries a copying permission notice identical to this
+one except for the removal of this paragraph (this
+paragraph not being relevant to the printed manual).
+
+@@end ignore
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided also that the sections
+entitled ``Copying'' and ``GNU General Public License''
+are included exactly as in the original, and provided
+that the entire resulting derived work is distributed
+under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+@end example
+
+@node Titlepage Permissions, , ifinfo Permissions, Sample Permissions
+@comment node-name, next, previous, up
+@appendixsec Titlepage Copying Permissions
+@cindex Titlepage permissions
+
+In the @code{@@titlepage} section of a Texinfo file, the standard Free
+Software Foundation copying permission notice follows the copyright
+notice and publishing information. The standard phrasing is as
+follows:@refill
+
+@example
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided also that the sections
+entitled ``Copying'' and ``GNU General Public License''
+are included exactly as in the original, and provided
+that the entire resulting derived work is distributed
+under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+@end example
+
+@node Include Files, Headings, Sample Permissions, Top
+@comment node-name, next, previous, up
+@appendix Include Files
+@cindex Include files
+
+When @TeX{} or an Info formatting command sees an @code{@@include}
+command in a Texinfo file, it processes the contents of the file named
+by the command and incorporates them into the @sc{dvi} or Info file being
+created. Index entries from the included file are incorporated into
+the indices of the output file.@refill
+
+Include files let you keep a single large document as a collection of
+conveniently small parts.@refill
+
+@menu
+* Using Include Files:: How to use the @code{@@include} command.
+* texinfo-multiple-files-update:: How to create and update nodes and
+ menus when using included files.
+* Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
+* Sample Include File:: A sample outer file with included files
+ within it; and a sample included file.
+* Include Files Evolution:: How use of the @code{@@include} command
+ has changed over time.
+@end menu
+
+@node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files
+@appendixsec How to Use Include Files
+@findex include
+
+To include another file within a Texinfo file, write the
+@code{@@include} command at the beginning of a line and follow it on
+the same line by the name of a file to be included. For
+example:@refill
+
+@example
+@@include buffers.texi
+@end example
+
+An included file should simply be a segment of text that you expect to
+be included as is into the overall or @dfn{outer} Texinfo file; it
+should not contain the standard beginning and end parts of a Texinfo
+file. In particular, you should not start an included file with a
+line saying @samp{\input texinfo}; if you do, that phrase is inserted
+into the output file as is. Likewise, you should not end an included
+file with an @code{@@bye} command; nothing after @code{@@bye} is
+formatted.@refill
+
+In the past, you were required to write an @code{@@setfilename} line at the
+beginning of an included file, but no longer. Now, it does not matter
+whether you write such a line. If an @code{@@setfilename} line exists
+in an included file, it is ignored.@refill
+
+Conventionally, an included file begins with an @code{@@node} line that
+is followed by an @code{@@chapter} line. Each included file is one
+chapter. This makes it easy to use the regular node and menu creating
+and updating commands to create the node pointers and menus within the
+included file. However, the simple Emacs node and menu creating and
+updating commands do not work with multiple Texinfo files. Thus you
+cannot use these commands to fill in the `Next', `Previous', and `Up'
+pointers of the @code{@@node} line that begins the included file. Also,
+you cannot use the regular commands to create a master menu for the
+whole file. Either you must insert the menus and the `Next',
+`Previous', and `Up' pointers by hand, or you must use the GNU Emacs
+Texinfo mode command, @code{texinfo-multiple-files-update}, that is
+designed for @code{@@include} files.@refill
+
+@node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files
+@appendixsec @code{texinfo-multiple-files-update}
+@findex texinfo-multiple-files-update
+
+GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
+command. This command creates or updates `Next', `Previous', and `Up'
+pointers of included files as well as those in the outer or overall
+Texinfo file, and it creates or updates a main menu in the outer file.
+Depending whether you call it with optional arguments, the command
+updates only the pointers in the first @code{@@node} line of the
+included files or all of them:@refill
+
+@table @kbd
+@item M-x texinfo-multiple-files-update
+Called without any arguments:@refill
+
+@itemize @minus
+@item
+Create or update the `Next', `Previous', and `Up' pointers of the
+first @code{@@node} line in each file included in an outer or overall
+Texinfo file.@refill
+
+@item
+Create or update the `Top' level node pointers of the outer or
+overall file.@refill
+
+@item
+Create or update a main menu in the outer file.@refill
+@end itemize
+
+@item C-u M-x texinfo-multiple-files-update
+Called with @kbd{C-u} as a prefix argument:
+
+@itemize @minus{}
+@item
+Create or update pointers in the first @code{@@node} line in each
+included file.
+
+@item
+Create or update the `Top' level node pointers of the outer file.
+
+@item
+Create and insert a master menu in the outer file. The master menu
+is made from all the menus in all the included files.@refill
+@end itemize
+
+@item C-u 8 M-x texinfo-multiple-files-update
+Called with a numeric prefix argument, such as @kbd{C-u 8}:
+
+@itemize @minus
+@item
+Create or update @strong{all} the `Next', `Previous', and `Up' pointers
+of all the included files.@refill
+
+@item
+Create or update @strong{all} the menus of all the included
+files.@refill
+
+@item
+Create or update the `Top' level node pointers of the outer or
+overall file.@refill
+
+@item
+And then create a master menu in the outer file. This is similar to
+invoking @code{texinfo-master-menu} with an argument when you are
+working with just one file.@refill
+@end itemize
+@end table
+
+Note the use of the prefix argument in interactive use: with a regular
+prefix argument, just @w{@kbd{C-u}}, the
+@code{texinfo-multiple-files-update} command inserts a master menu;
+with a numeric prefix argument, such as @kbd{C-u 8}, the command
+updates @strong{every} pointer and menu in @strong{all} the files and then inserts a
+master menu.@refill
+
+@node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files
+@appendixsec Include File Requirements
+@cindex Include file requirements
+@cindex Requirements for include files
+
+If you plan to use the @code{texinfo-multiple-files-update} command,
+the outer Texinfo file that lists included files within it should
+contain nothing but the beginning and end parts of a Texinfo file, and
+a number of @code{@@include} commands listing the included files. It
+should not even include indices, which should be listed in an included
+file of their own.@refill
+
+Moreover, each of the included files must contain exactly one highest
+level node (conventionally, @code{@@chapter} or equivalent),
+and this node must be the first node in the included file.
+Furthermore, each of these highest level nodes in each included file
+must be at the same hierarchical level in the file structure.
+Usually, each is an @code{@@chapter}, an @code{@@appendix}, or an
+@code{@@unnumbered} node. Thus, normally, each included file contains
+one, and only one, chapter or equivalent-level node.@refill
+
+The outer file should contain only @emph{one} node, the `Top' node. It
+should @emph{not} contain any nodes besides the single `Top' node. The
+@code{texinfo-multiple-files-update} command will not process
+them.@refill
+
+@node Sample Include File, Include Files Evolution, Include File Requirements, Include Files
+@appendixsec Sample File with @code{@@include}
+@cindex Sample @code{@@include} file
+@cindex Include file sample
+@cindex @code{@@include} file sample
+
+Here is an example of a complete outer Texinfo file with @code{@@include} files
+within it before running @code{texinfo-multiple-files-update}, which
+would insert a main or master menu:@refill
+
+@example
+@group
+\input texinfo @@c -*-texinfo-*-
+@c %**start of header
+@@setfilename include-example.info
+@@settitle Include Example
+@c %**end of header
+@end group
+
+@group
+@@setchapternewpage odd
+@@titlepage
+@@sp 12
+@@center @@titlefont@{Include Example@}
+@@sp 2
+@@center by Whom Ever
+@end group
+
+@group
+@@page
+@@vskip 0pt plus 1filll
+Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
+@@end titlepage
+@end group
+
+@group
+@@ifinfo
+@@node Top, First, (dir), (dir)
+@@top Master Menu
+@@end ifinfo
+@end group
+
+@group
+@@include foo.texinfo
+@@include bar.texinfo
+@@include concept-index.texinfo
+@end group
+
+@group
+@@summarycontents
+@@contents
+
+@@bye
+@end group
+@end example
+
+An included file, such as @file{foo.texinfo}, might look like
+this:@refill
+
+@example
+@group
+@@node First, Second, , Top
+@@chapter First Chapter
+
+Contents of first chapter @dots{}
+@end group
+@end example
+
+The full contents of @file{concept-index.texinfo} might be as simple as this:
+
+@example
+@group
+@@node Concept Index, , Second, Top
+@@unnumbered Concept Index
+
+@@printindex cp
+@end group
+@end example
+
+The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
+Manual} is named @file{elisp.texi}. This outer file contains a master
+menu with 417 entries and a list of 41 @code{@@include}
+files.@refill
+
+@node Include Files Evolution, , Sample Include File, Include Files
+@comment node-name, next, previous, up
+@appendixsec Evolution of Include Files
+
+When Info was first created, it was customary to create many small
+Info files on one subject. Each Info file was formatted from its own
+Texinfo source file. This custom meant that Emacs did not need to
+make a large buffer to hold the whole of a large Info file when
+someone wanted information; instead, Emacs allocated just enough
+memory for the small Info file that contained the particular
+information sought. This way, Emacs could avoid wasting memory.@refill
+
+References from one file to another were made by referring to the file
+name as well as the node name. (@xref{Other Info Files, , Referring to
+Other Info Files}. Also, see @ref{Four and Five Arguments, ,
+@code{@@xref} with Four and Five Arguments}.)@refill
+
+Include files were designed primarily as a way to create a single,
+large printed manual out of several smaller Info files. In a printed
+manual, all the references were within the same document, so @TeX{}
+could automatically determine the references' page numbers. The Info
+formatting commands used include files only for creating joint
+indices; each of the individual Texinfo files had to be formatted for
+Info individually. (Each, therefore, required its own
+@code{@@setfilename} line.)@refill
+
+However, because large Info files are now split automatically, it is
+no longer necessary to keep them small.@refill
+
+Nowadays, multiple Texinfo files are used mostly for large documents,
+such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
+in which several different people write different sections of a
+document simultaneously.@refill
+
+In addition, the Info formatting commands have been extended to work
+with the @code{@@include} command so as to create a single large Info
+file that is split into smaller files if necessary. This means that
+you can write menus and cross references without naming the different
+Texinfo files.@refill
+
+@node Headings, Catching Mistakes, Include Files, Top
+@comment node-name, next, previous, up
+@appendix Page Headings
+@cindex Headings
+@cindex Footings
+@cindex Page numbering
+@cindex Page headings
+@cindex Formatting headings and footings
+
+Most printed manuals contain headings along the top of every page
+except the title and copyright pages. Some manuals also contain
+footings. (Headings and footings have no meaning to Info, which is
+not paginated.)@refill
+
+@menu
+* Headings Introduced:: Conventions for using page headings.
+* Heading Format:: Standard page heading formats.
+* Heading Choice:: How to specify the type of page heading.
+* Custom Headings:: How to create your own headings and footings.
+@end menu
+
+@node Headings Introduced, Heading Format, Headings, Headings
+@ifinfo
+@heading Headings Introduced
+@end ifinfo
+
+Texinfo provides standard page heading formats for manuals that are printed
+on one side of each sheet of paper and for manuals that are printed on
+both sides of the paper. Usually, you will use one or other of these
+formats, but you can specify your own format, if you wish.@refill
+
+In addition, you can specify whether chapters should begin on a new
+page, or merely continue the same page as the previous chapter; and if
+chapters begin on new pages, you can specify whether they must be
+odd-numbered pages.@refill
+
+By convention, a book is printed on both sides of each sheet of paper.
+When you open a book, the right-hand page is odd-numbered, and
+chapters begin on right-hand pages---a preceding left-hand page is
+left blank if necessary. Reports, however, are often printed on just
+one side of paper, and chapters begin on a fresh page immediately
+following the end of the preceding chapter. In short or informal
+reports, chapters often do not begin on a new page at all, but are
+separated from the preceding text by a small amount of whitespace.@refill
+
+The @code{@@setchapternewpage} command controls whether chapters begin
+on new pages, and whether one of the standard heading formats is used.
+In addition, Texinfo has several heading and footing commands that you
+can use to generate your own heading and footing formats.@refill
+
+In Texinfo, headings and footings are single lines at the tops and
+bottoms of pages; you cannot create multiline headings or footings.
+Each header or footer line is divided into three parts: a left part, a
+middle part, and a right part. Any part, or a whole line, may be left
+blank. Text for the left part of a header or footer line is set
+flushleft; text for the middle part is centered; and, text for the
+right part is set flushright.@refill
+
+@node Heading Format, Heading Choice, Headings Introduced, Headings
+@comment node-name, next, previous, up
+@appendixsec Standard Heading Formats
+
+Texinfo provides two standard heading formats, one for manuals printed
+on one side of each sheet of paper, and the other for manuals printed
+on both sides of the paper.
+
+By default, nothing is specified for the footing of a Texinfo file,
+so the footing remains blank.@refill
+
+The standard format for single-sided printing consists of a header
+line in which the left-hand part contains the name of the chapter, the
+central part is blank, and the right-hand part contains the page
+number.@refill
+
+@need 950
+A single-sided page looks like this:
+
+@example
+@group
+ _______________________
+ | |
+ | chapter page number |
+ | |
+ | Start of text ... |
+ | ... |
+ | |
+
+@end group
+@end example
+
+The standard format for two-sided printing depends on whether the page
+number is even or odd. By convention, even-numbered pages are on the
+left- and odd-numbered pages are on the right. (@TeX{} will adjust the
+widths of the left- and right-hand margins. Usually, widths are
+correct, but during double-sided printing, it is wise to check that
+pages will bind properly---sometimes a printer will produce output in
+which the even-numbered pages have a larger right-hand margin than the
+odd-numbered pages.)@refill
+
+In the standard double-sided format, the left part of the left-hand
+(even-numbered) page contains the page number, the central part is
+blank, and the right part contains the title (specified by the
+@code{@@settitle} command). The left part of the right-hand
+(odd-numbered) page contains the name of the chapter, the central part
+is blank, and the right part contains the page number.@refill
+
+@need 750
+Two pages, side by side as in an open book, look like this:@refill
+
+@example
+@group
+ _______________________ _______________________
+ | | | |
+ | page number title | | chapter page number |
+ | | | |
+ | Start of text ... | | More text ... |
+ | ... | | ... |
+ | | | |
+
+@end group
+@end example
+
+@noindent
+The chapter name is preceded by the word @samp{Chapter}, the chapter
+number and a colon. This makes it easier to keep track of where you
+are in the manual.@refill
+
+@node Heading Choice, Custom Headings, Heading Format, Headings
+@comment node-name, next, previous, up
+@appendixsec Specifying the Type of Heading
+
+@TeX{} does not begin to generate page headings for a standard Texinfo
+file until it reaches the @code{@@end titlepage} command. Thus, the
+title and copyright pages are not numbered. The @code{@@end
+titlepage} command causes @TeX{} to begin to generate page headings
+according to a standard format specified by the
+@code{@@setchapternewpage} command that precedes the
+@code{@@titlepage} section.@refill
+
+@need 1000
+There are four possibilities:@refill
+
+@table @asis
+@item No @code{@@setchapternewpage} command
+Cause @TeX{} to specify the single-sided heading format, with chapters
+on new pages. This is the same as @code{@@setchapternewpage on}.@refill
+
+@item @code{@@setchapternewpage on}
+Specify the single-sided heading format, with chapters on new pages.@refill
+
+@item @code{@@setchapternewpage off}
+Cause @TeX{} to start a new chapter on the same page as the last page of
+the preceding chapter, after skipping some vertical whitespace. Also
+cause @TeX{} to typeset for single-sided printing. (You can override
+the headers format with the @code{@@headings double} command; see
+@ref{headings on off, , The @code{@@headings} Command}.)@refill
+
+@item @code{@@setchapternewpage odd}
+Specify the double-sided heading format, with chapters on new pages.@refill
+@end table
+
+@noindent
+Texinfo lacks an @code{@@setchapternewpage even} command.@refill
+
+@node Custom Headings, , Heading Choice, Headings
+@comment node-name, next, previous, up
+@appendixsec How to Make Your Own Headings
+
+You can use the standard headings provided with Texinfo or specify
+your own.@refill
+
+@c Following paragraph is verbose to prevent overfull hboxes.
+Texinfo provides six commands for specifying headings and
+footings. The @code{@@everyheading} command and
+@code{@@everyfooting} command generate page headers and footers
+that are the same for both even- and odd-numbered pages.
+The @code{@@evenheading} command and @code{@@evenfooting}
+command generate headers and footers for even-numbered
+(left-hand) pages; and the @code{@@oddheading} command and
+@code{@@oddfooting} command generate headers and footers for
+odd-numbered (right-hand) pages.@refill
+
+Write custom heading specifications in the Texinfo file immediately
+after the @code{@@end titlepage} command. Enclose your specifications
+between @code{@@iftex} and @code{@@end iftex} commands since the
+@code{texinfo-format-buffer} command may not recognize them. Also,
+you must cancel the predefined heading commands with the
+@code{@@headings off} command before defining your own
+specifications.@refill
+
+@need 1000
+Here is how to tell @TeX{} to place the chapter name at the left, the
+page number in the center, and the date at the right of every header
+for both even- and odd-numbered pages:@refill
+
+@example
+@group
+@@iftex
+@@headings off
+@@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
+@@end iftex
+@end group
+@end example
+
+@noindent
+You need to divide the left part from the central part and the central
+part from the right had part by inserting @samp{@@|} between parts.
+Otherwise, the specification command will not be able to tell where
+the text for one part ends and the next part begins.@refill
+
+Each part can contain text or @@-commands. The text
+is printed as if the part were within an ordinary paragraph in the
+body of the page. The @@-commands replace
+themselves with the page number, date, chapter name, or
+whatever.@refill
+
+@need 950
+Here are the six heading and footing commands:@refill
+
+@findex everyheading
+@findex everyfooting
+@table @code
+@item @@everyheading @var{left} @@| @var{center} @@| @var{right}
+@itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
+
+The `every' commands specify the format for both even- and odd-numbered
+pages. These commands are for documents that are printed on one side
+of each sheet of paper, or for documents in which you want symmetrical
+headers or footers.@refill
+
+@findex evenheading
+@findex evenfooting
+@findex oddheading
+@findex oddfooting
+@item @@evenheading @var{left} @@| @var{center} @@| @var{right}
+@itemx @@oddheading @var{left} @@| @var{center} @@| @var{right}
+
+@itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
+@itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right}
+
+The `even' and `odd' commands specify the format for even-numbered
+pages and odd-numbered pages. These commands are for books and
+manuals that are printed on both sides of each sheet of paper.@refill
+@end table
+
+Use the @samp{@@this@dots{}} series of @@-commands to
+provide the names of chapters
+and sections and the page number. You can use the
+@samp{@@this@dots{}} commands in the left, center, or right portions
+of headers and footers, or anywhere else in a Texinfo file so long as
+they are between @code{@@iftex} and @code{@@end iftex} commands.@refill
+
+@need 1000
+Here are the @samp{@@this@dots{}} commands:@refill
+
+@table @code
+@findex thispage
+@item @@thispage
+Expands to the current page number.@refill
+@c !!! Karl Berry says that `thissection' fails on page breaks.
+@ignore
+@item @@thissection
+Expands to the name of the current section.@refill
+@end ignore
+
+@findex thischaptername
+@item @@thischaptername
+Expands to the name of the current chapter.@refill
+
+@findex thischapter
+@item @@thischapter
+Expands to the number and name of the current
+chapter, in the format `Chapter 1: Title'.@refill
+
+@findex thistitle
+@item @@thistitle
+Expands to the name of the document, as specified by the
+@code{@@settitle} command.@refill
+
+@findex thisfile
+@item @@thisfile
+For @code{@@include} files only: expands to the name of the current
+@code{@@include} file. If the current Texinfo source file is not an
+@code{@@include} file, this command has no effect. This command does
+@emph{not} provide the name of the current Texinfo source file unless
+it is an @code{@@include} file. (@xref{Include Files}, for more
+information about @code{@@include} files.)@refill
+@end table
+
+@noindent
+You can also use the @code{@@today@{@}} command, which expands to the
+current date, in `1 Jan 1900' format.@refill
+@findex today
+
+Other @@-commands and text are printed in a header or footer just as
+if they were in the body of a page. It is useful to incorporate text,
+particularly when you are writing drafts:@refill
+
+@example
+@group
+@@iftex
+@@headings off
+@@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
+@@everyfooting @@| @@| Version: 0.27: @@today@{@}
+@@end iftex
+@end group
+@end example
+
+Beware of overlong titles: they may overlap another part of the
+header or footer and blot it out.@refill
+
+@node Catching Mistakes, Refilling Paragraphs, Headings, Top
+@comment node-name, next, previous, up
+@appendix Formatting Mistakes
+@cindex Structure, catching mistakes in
+@cindex Nodes, catching mistakes
+@cindex Catching mistakes
+@cindex Correcting mistakes
+@cindex Mistakes, catching
+@cindex Problems, catching
+@cindex Debugging the Texinfo structure
+
+Besides mistakes in the content of your documentation, there
+are two kinds of mistake you can make with Texinfo: you can make mistakes
+with @@-commands, and you can make mistakes with the structure of the
+nodes and chapters.@refill
+
+Emacs has two tools for catching the @@-command mistakes and two for
+catching structuring mistakes.@refill
+
+For finding problems with @@-commands, you can run @TeX{} or a region
+formatting command on the region that has a problem; indeed, you can
+run these commands on each region as you write it.@refill
+
+For finding problems with the structure of nodes and chapters, you can use
+@kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
+command and you can use the @kbd{M-x Info-validate} command.@refill
+
+@menu
+* makeinfo preferred:: @code{makeinfo} finds errors.
+* Debugging with Info:: How to catch errors with Info formatting.
+* Debugging with TeX:: How to catch errors with @TeX{} formatting.
+* Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
+* Using occur:: How to list all lines containing a pattern.
+* Running Info-Validate:: How to find badly referenced nodes.
+@end menu
+
+@node makeinfo preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
+@ifinfo
+@heading @code{makeinfo} Find Errors
+@end ifinfo
+
+The @code{makeinfo} program does an excellent job of catching errors
+and reporting them---far better than @code{texinfo-format-region} or
+@code{texinfo-format-buffer}. In addition, the various functions for
+automatically creating and updating node pointers and menus remove
+many opportunities for human error.@refill
+
+If you can, use the updating commands to create and insert pointers
+and menus. These prevent many errors. Then use @code{makeinfo} (or
+its Texinfo mode manifestations, @code{makeinfo-region} and
+@code{makeinfo-buffer}) to format your file and check for other
+errors. This is the best way to work with Texinfo. But if you
+cannot use @code{makeinfo}, or your problem is very puzzling, then you
+may want to use the tools described in this appendix.@refill
+
+@node Debugging with Info, Debugging with TeX, makeinfo preferred, Catching Mistakes
+@comment node-name, next, previous, up
+@appendixsec Catching Errors with Info Formatting
+@cindex Catching errors with Info formatting
+@cindex Debugging with Info formatting
+
+After you have written part of a Texinfo file, you can use the
+@code{texinfo-format-region} or the @code{makeinfo-region} command to
+see whether the region formats properly.@refill
+
+Most likely, however, you are reading this section because for some
+reason you cannot use the @code{makeinfo-region} command; therefore, the
+rest of this section presumes that you are using
+@code{texinfo-format-region}.@refill
+
+If you have made a mistake with an @@-command,
+@code{texinfo-format-region} will stop processing at or after the
+error and display an error message. To see where in the buffer the
+error occurred, switch to the @samp{*Info Region*} buffer; the cursor
+will be in a position that is after the location of the error. Also,
+the text will not be formatted after the place where the error
+occurred (or more precisely, where it was detected).@refill
+
+For example, if you accidentally end a menu with the command @code{@@end
+menus} with an `s' on the end, instead of with @code{@@end menu}, you
+will see an error message that says:@refill
+
+@example
+@@end menus is not handled by texinfo
+@end example
+
+@noindent
+The cursor will stop at the point in the buffer where the error
+occurs, or not long after it. The buffer will look like this:@refill
+
+@example
+@group
+---------- Buffer: *Info Region* ----------
+* Menu:
+
+* Using texinfo-show-structure:: How to use
+ `texinfo-show-structure'
+ to catch mistakes.
+* Running Info-Validate:: How to check for
+ unreferenced nodes.
+@@end menus
+@point{}
+---------- Buffer: *Info Region* ----------
+@end group
+@end example
+
+The @code{texinfo-format-region} command sometimes provides slightly
+odd error messages. For example, the following cross reference fails to format:@refill
+
+@example
+(@@xref@{Catching Mistakes, for more info.)
+@end example
+
+@noindent
+In this case, @code{texinfo-format-region} detects the missing closing
+brace but displays a message that says @samp{Unbalanced parentheses}
+rather than @samp{Unbalanced braces}. This is because the formatting
+command looks for mismatches between braces as if they were
+parentheses.@refill
+
+Sometimes @code{texinfo-format-region} fails to detect mistakes. For
+example, in the following, the closing brace is swapped with the
+closing parenthesis:@refill
+
+@example
+(@@xref@{Catching Mistakes), for more info.@}
+@end example
+
+@noindent
+Formatting produces:
+@example
+(*Note for more info.: Catching Mistakes)
+@end example
+
+The only way for you to detect this error is to realize that the
+reference should have looked like this:@refill
+
+@example
+(*Note Catching Mistakes::, for more info.)
+@end example
+
+Incidentally, if you are reading this node in Info and type @kbd{f
+@key{RET}} (@code{Info-follow-reference}), you will generate an error
+message that says:
+
+@example
+No such node: "Catching Mistakes) The only way @dots{}
+@end example
+
+@noindent
+This is because Info perceives the example of the error as the first
+cross reference in this node and if you type a @key{RET} immediately
+after typing the Info @kbd{f} command, Info will attempt to go to the
+referenced node. If you type @kbd{f catch @key{TAB} @key{RET}}, Info
+will complete the node name of the correctly written example and take
+you to the `Catching Mistakes' node. (If you try this, you can return
+from the `Catching Mistakes' node by typing @kbd{l}
+(@code{Info-last}).)
+
+@c !!! section on using Elisp debugger ignored.
+@ignore
+Sometimes @code{texinfo-format-region} will stop long after the
+original error; this is because it does not discover the problem until
+then. In this case, you will need to backtrack.@refill
+
+@c menu
+@c * Using the Emacs Lisp Debugger:: How to use the Emacs Lisp debugger.
+@c end menu
+
+@c node Using the Emacs Lisp Debugger
+@c appendixsubsec Using the Emacs Lisp Debugger
+@c index Using the Emacs Lisp debugger
+@c index Emacs Lisp debugger
+@c index Debugger, using the Emacs Lisp
+
+If an error is especially elusive, you can turn on the Emacs Lisp
+debugger and look at the backtrace; this tells you where in the
+@code{texinfo-format-region} function the problem occurred. You can
+turn on the debugger with the command:@refill
+
+@example
+M-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET}
+@end example
+
+@noindent
+and turn it off with
+
+@example
+M-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET}
+@end example
+
+Often, when you are using the debugger, it is easier to follow what is
+going on if you use the Emacs Lisp files that are not byte-compiled.
+The byte-compiled sources send octal numbers to the debugger that may
+look mysterious. To use the uncompiled source files, load
+@file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file}
+command.@refill
+
+The debugger will not catch an error if @code{texinfo-format-region}
+does not detect one. In the example shown above,
+@code{texinfo-format-region} did not find the error when the whole
+list was formatted, but only when part of the list was formatted.
+When @code{texinfo-format-region} did not find an error, the debugger
+did not find one either. @refill
+
+However, when @code{texinfo-format-region} did report an error, it
+invoked the debugger. This is the backtrace it produced:@refill
+
+@example
+---------- Buffer: *Backtrace* ----------
+Signalling: (search-failed "[@},]")
+ re-search-forward("[@},]")
+ (while ...)
+ (let ...)
+ texinfo-format-parse-args()
+ (let ...)
+ texinfo-format-xref()
+ funcall(texinfo-format-xref)
+ (if ...)
+ (let ...)
+ (if ...)
+ (while ...)
+ texinfo-format-scan()
+ (save-excursion ...)
+ (let ...)
+ texinfo-format-region(103370 103631)
+* call-interactively(texinfo-format-region)
+---------- Buffer: *Backtrace* ----------
+@end example
+
+The backtrace is read from the bottom up.
+@code{texinfo-format-region} was called interactively; and it, in
+turn, called various functions, including @code{texinfo-format-scan},
+@code{texinfo-format-xref} and @code{texinfo-format-parse-args}.
+Inside the function @code{texinfo-format-parse-args}, the function
+@code{re-search-forward} was called; it was this function that could
+not find the missing right-hand brace.@refill
+
+@xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs
+Manual}, for more information.@refill
+@end ignore
+
+@node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes
+@comment node-name, next, previous, up
+@appendixsec Catching Errors with @TeX{} Formatting
+@cindex Catching errors with @TeX{} formatting
+@cindex Debugging with @TeX{} formatting
+
+You can also catch mistakes when you format a file with @TeX{}.@refill
+
+Usually, you will want to do this after you have run
+@code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
+the same file, because @code{texinfo-format-buffer} sometimes displays
+error messages that make more sense than @TeX{}. (@xref{Debugging
+with Info}, for more information.)@refill
+
+For example, @TeX{} was run on a Texinfo file, part of which is shown
+here:@refill
+
+@example
+---------- Buffer: texinfo.texi ----------
+name of the Texinfo file as an extension. The
+@@samp@{??@} are `wildcards' that cause the shell to
+substitute all the raw index files. (@@xref@{sorting
+indices, for more information about sorting
+indices.)@@refill
+---------- Buffer: texinfo.texi ----------
+@end example
+
+@noindent
+(The cross reference lacks a closing brace.)
+@TeX{} produced the following output, after which it stopped:@refill
+
+@example
+---------- Buffer: *tex-shell* ----------
+Runaway argument?
+@{sorting indices, for more information about sorting
+indices.) @@refill @@ETC.
+! Paragraph ended before @@xref was complete.
+<to be read again>
+ @@par
+l.27
+
+?
+---------- Buffer: *tex-shell* ----------
+@end example
+
+In this case, @TeX{} produced an accurate and
+understandable error message:
+
+@example
+Paragraph ended before @@xref was complete.
+@end example
+
+@noindent
+@samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
+@samp{l.27} means that @TeX{} detected the problem on line 27 of the
+Texinfo file. The @samp{?} is the prompt @TeX{} uses in this
+circumstance.@refill
+
+Unfortunately, @TeX{} is not always so helpful, and sometimes you must
+truly be a Sherlock Holmes to discover what went wrong.@refill
+
+In any case, if you run into a problem like this, you can do one of three
+things.@refill
+
+@enumerate
+@item
+You can tell @TeX{} to continue running and ignore just this error by
+typing @key{RET} at the @samp{?} prompt.@refill
+
+@item
+You can tell @TeX{} to continue running and to ignore all errors as best
+it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill
+
+This is often the best thing to do. However, beware: the one error
+may produce a cascade of additional error messages as its consequences
+are felt through the rest of the file. (To stop @TeX{} when it is
+producing such an avalanche of error messages, type @kbd{C-d} (or
+@kbd{C-c C-d}, if you are running a shell inside Emacs.))@refill
+
+@item
+You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
+at the @samp{?} prompt.@refill
+@end enumerate
+
+Please note that if you are running @TeX{} inside Emacs, you need to
+switch to the shell buffer and line at which @TeX{} offers the @samp{?}
+prompt.@refill
+
+Sometimes @TeX{} will format a file without producing error messages even
+though there is a problem. This usually occurs if a command is not ended
+but @TeX{} is able to continue processing anyhow. For example, if you fail
+to end an itemized list with the @code{@@end itemize} command, @TeX{} will
+write a @sc{dvi} file that you can print out. The only error message that
+@TeX{} will give you is the somewhat mysterious comment that@refill
+
+@example
+(@@end occurred inside a group at level 1)
+@end example
+
+@noindent
+However, if you print the @sc{dvi} file, you will find that the text
+of the file that follows the itemized list is entirely indented as if
+it were part of the last item in the itemized list. The error message
+is the way @TeX{} says that it expected to find an @code{@@end}
+command somewhere in the file; but that it could not determine where
+it was needed.@refill
+
+Another source of notoriously hard-to-find errors is a missing
+@code{@@end group} command. If you ever are stumped by
+incomprehensible errors, look for a missing @code{@@end group} command
+first.@refill
+
+If the Texinfo file lacks header lines,
+@TeX{} may stop in the
+beginning of its run and display output that looks like the following.
+The @samp{*} indicates that @TeX{} is waiting for input.@refill
+
+@example
+This is TeX, Version 3.14159 (Web2c 7.0)
+(test.texinfo [1])
+*
+@end example
+
+@noindent
+In this case, simply type @kbd{\end @key{RET}} after the asterisk. Then
+write the header lines in the Texinfo file and run the @TeX{} command
+again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\}
+instead of @samp{@@}; and in this circumstance, you are working
+directly with @TeX{}, not with Texinfo.)@refill
+
+@node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes
+@comment node-name, next, previous, up
+@appendixsec Using @code{texinfo-show-structure}
+@cindex Showing the structure of a file
+@findex texinfo-show-structure
+
+It is not always easy to keep track of the nodes, chapters, sections, and
+subsections of a Texinfo file. This is especially true if you are revising
+or adding to a Texinfo file that someone else has written.@refill
+
+In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
+command lists all the lines that begin with the @@-commands that
+specify the structure: @code{@@chapter}, @code{@@section},
+@code{@@appendix}, and so on. With an argument (@w{@kbd{C-u}}
+as prefix argument, if interactive),
+the command also shows the @code{@@node} lines. The
+@code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
+Texinfo mode, by default.@refill
+
+The lines are displayed in a buffer called the @samp{*Occur*} buffer,
+indented by hierarchical level. For example, here is a part of what was
+produced by running @code{texinfo-show-structure} on this manual:@refill
+
+@example
+@group
+ Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
+ unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
+ in buffer texinfo.texi.
+ @dots{}
+ 4177:@@chapter Nodes
+ 4198: @@heading Two Paths
+ 4231: @@section Node and Menu Illustration
+ 4337: @@section The @@code@{@@@@node@} Command
+ 4393: @@subheading Choosing Node and Pointer Names
+ 4417: @@subsection How to Write an @@code@{@@@@node@} Line
+ 4469: @@subsection @@code@{@@@@node@} Line Tips
+ @dots{}
+@end group
+@end example
+
+This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
+with the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
+commands respectively. If you move your cursor into the @samp{*Occur*}
+window, you can position the cursor over one of the lines and use the
+@kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
+the corresponding spot in the Texinfo file. @xref{Other Repeating
+Search, , Using Occur, emacs, The GNU Emacs Manual}, for more
+information about @code{occur-mode-goto-occurrence}.@refill
+
+The first line in the @samp{*Occur*} window describes the @dfn{regular
+expression} specified by @var{texinfo-heading-pattern}. This regular
+expression is the pattern that @code{texinfo-show-structure} looks for.
+@xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
+for more information.@refill
+
+When you invoke the @code{texinfo-show-structure} command, Emacs will
+display the structure of the whole buffer. If you want to see the
+structure of just a part of the buffer, of one chapter, for example,
+use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
+region. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.) This is
+how the example used above was generated. (To see the whole buffer
+again, use @kbd{C-x n w} (@code{widen}).)@refill
+
+If you call @code{texinfo-show-structure} with a prefix argument by
+typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
+@code{@@node} as well as the lines beginning with the @@-sign commands
+for @code{@@chapter}, @code{@@section}, and the like.@refill
+
+You can remind yourself of the structure of a Texinfo file by looking at
+the list in the @samp{*Occur*} window; and if you have mis-named a node
+or left out a section, you can correct the mistake.@refill
+
+@node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes
+@comment node-name, next, previous, up
+@appendixsec Using @code{occur}
+@cindex Occurrences, listing with @code{@@occur}
+@findex occur
+
+Sometimes the @code{texinfo-show-structure} command produces too much
+information. Perhaps you want to remind yourself of the overall structure
+of a Texinfo file, and are overwhelmed by the detailed list produced by
+@code{texinfo-show-structure}. In this case, you can use the @code{occur}
+command directly. To do this, type@refill
+
+@example
+@kbd{M-x occur}
+@end example
+
+@noindent
+and then, when prompted, type a @dfn{regexp}, a regular expression for
+the pattern you want to match. (@xref{Regexps, , Regular Expressions,
+emacs, The GNU Emacs Manual}.) The @code{occur} command works from
+the current location of the cursor in the buffer to the end of the
+buffer. If you want to run @code{occur} on the whole buffer, place
+the cursor at the beginning of the buffer.@refill
+
+For example, to see all the lines that contain the word
+@samp{@@chapter} in them, just type @samp{@@chapter}. This will
+produce a list of the chapters. It will also list all the sentences
+with @samp{@@chapter} in the middle of the line.@refill
+
+If you want to see only those lines that start with the word
+@samp{@@chapter}, type @samp{^@@chapter} when prompted by
+@code{occur}. If you want to see all the lines that end with a word
+or phrase, end the last word with a @samp{$}; for example,
+@samp{catching mistakes$}. This can be helpful when you want to see
+all the nodes that are part of the same chapter or section and
+therefore have the same `Up' pointer.@refill
+
+@xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
+for more information.@refill
+
+@node Running Info-Validate, , Using occur, Catching Mistakes
+@comment node-name, next, previous, up
+@appendixsec Finding Badly Referenced Nodes
+@findex Info-validate
+@cindex Nodes, checking for badly referenced
+@cindex Checking for badly referenced nodes
+@cindex Looking for badly referenced nodes
+@cindex Finding badly referenced nodes
+@cindex Badly referenced nodes
+
+You can use the @code{Info-validate} command to check whether any of
+the `Next', `Previous', `Up' or other node pointers fail to point to a
+node. This command checks that every node pointer points to an
+existing node. The @code{Info-validate} command works only on Info
+files, not on Texinfo files.@refill
+
+The @code{makeinfo} program validates pointers automatically, so you
+do not need to use the @code{Info-validate} command if you are using
+@code{makeinfo}. You only may need to use @code{Info-validate} if you
+are unable to run @code{makeinfo} and instead must create an Info file
+using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
+if you write an Info file from scratch.@refill
+
+@menu
+* Using Info-validate:: How to run @code{Info-validate}.
+* Unsplit:: How to create an unsplit file.
+* Tagifying:: How to tagify a file.
+* Splitting:: How to split a file manually.
+@end menu
+
+@node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate
+@appendixsubsec Running @code{Info-validate}
+@cindex Running @code{Info-validate}
+@cindex Info validating a large file
+@cindex Validating a large file
+
+To use @code{Info-validate}, visit the Info file you wish to check and
+type:@refill
+
+@example
+M-x Info-validate
+@end example
+
+@noindent
+(Note that the @code{Info-validate} command requires an upper case
+`I'. You may also need to create a tag table before running
+@code{Info-validate}. @xref{Tagifying}.)@refill
+
+If your file is valid, you will receive a message that says ``File appears
+valid''. However, if you have a pointer that does not point to a node,
+error messages will be displayed in a buffer called @samp{*problems in
+info file*}.@refill
+
+For example, @code{Info-validate} was run on a test file that contained
+only the first node of this manual. One of the messages said:@refill
+
+@example
+In node "Overview", invalid Next: Texinfo Mode
+@end example
+
+@noindent
+This meant that the node called @samp{Overview} had a `Next' pointer that
+did not point to anything (which was true in this case, since the test file
+had only one node in it).@refill
+
+Now suppose we add a node named @samp{Texinfo Mode} to our test case
+but we do not specify a `Previous' for this node. Then we will get
+the following error message:@refill
+
+@example
+In node "Texinfo Mode", should have Previous: Overview
+@end example
+
+@noindent
+This is because every `Next' pointer should be matched by a
+`Previous' (in the node where the `Next' points) which points back.@refill
+
+@code{Info-validate} also checks that all menu entries and cross references
+point to actual nodes.@refill
+
+Note that @code{Info-validate} requires a tag table and does not work
+with files that have been split. (The @code{texinfo-format-buffer}
+command automatically splits large files.) In order to use
+@code{Info-validate} on a large file, you must run
+@code{texinfo-format-buffer} with an argument so that it does not split
+the Info file; and you must create a tag table for the unsplit
+file.@refill
+
+@node Unsplit, Tagifying, Using Info-validate, Running Info-Validate
+@comment node-name, next, previous, up
+@appendixsubsec Creating an Unsplit File
+@cindex Creating an unsplit file
+@cindex Unsplit file creation
+
+You can run @code{Info-validate} only on a single Info file that has a
+tag table. The command will not work on the indirect subfiles that
+are generated when a master file is split. If you have a large file
+(longer than 70,000 bytes or so), you need to run the
+@code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
+a way that it does not create indirect subfiles. You will also need
+to create a tag table for the Info file. After you have done this,
+you can run @code{Info-validate} and look for badly referenced
+nodes.@refill
+
+The first step is to create an unsplit Info file. To prevent
+@code{texinfo-format-buffer} from splitting a Texinfo file into
+smaller Info files, give a prefix to the @kbd{M-x
+texinfo-format-buffer} command:@refill
+
+@example
+C-u M-x texinfo-format-buffer
+@end example
+
+@noindent
+or else
+
+@example
+C-u C-c C-e C-b
+@end example
+
+@noindent
+When you do this, Texinfo will not split the file and will not create
+a tag table for it. @refill
+@cindex Making a tag table manually
+@cindex Tag table, making manually
+
+@node Tagifying, Splitting, Unsplit, Running Info-Validate
+@appendixsubsec Tagifying a File
+
+After creating an unsplit Info file, you must create a tag table for
+it. Visit the Info file you wish to tagify and type:@refill
+
+@example
+M-x Info-tagify
+@end example
+
+@noindent
+(Note the upper case @samp{I} in @code{Info-tagify}.) This creates an
+Info file with a tag table that you can validate.@refill
+
+The third step is to validate the Info file:@refill
+
+@example
+M-x Info-validate
+@end example
+
+@noindent
+(Note the upper case @samp{I} in @code{Info-validate}.)
+In brief, the steps are:@refill
+
+@example
+@group
+C-u M-x texinfo-format-buffer
+M-x Info-tagify
+M-x Info-validate
+@end group
+@end example
+
+After you have validated the node structure, you can rerun
+@code{texinfo-format-buffer} in the normal way so it will construct a
+tag table and split the file automatically, or you can make the tag
+table and split the file manually.@refill
+
+@node Splitting, , Tagifying, Running Info-Validate
+@comment node-name, next, previous, up
+@appendixsubsec Splitting a File Manually
+@cindex Splitting an Info file manually
+@cindex Info file, splitting manually
+
+You should split a large file or else let the
+@code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
+for you automatically. (Generally you will let one of the formatting
+commands do this job for you. @xref{Create an Info File}.)@refill
+
+The split-off files are called the indirect subfiles.@refill
+
+Info files are split to save memory. With smaller files, Emacs does not
+have make such a large buffer to hold the information.@refill
+
+If an Info file has more than 30 nodes, you should also make a tag
+table for it. @xref{Using Info-validate}, for information
+about creating a tag table. (Again, tag tables are usually created
+automatically by the formatting command; you only need to create a tag
+table yourself if you are doing the job manually. Most likely, you
+will do this for a large, unsplit file on which you have run
+@code{Info-validate}.)@refill
+
+@c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51
+@ignore
+Before running @code{Info-split}, you need to load the @code{info} library
+into Emacs by giving the command @kbd{M-x load-library @key{RET} info
+@key{RET}}.
+@end ignore
+
+Visit the Info file you wish to tagify and split and type the two
+commands:@refill
+
+@example
+M-x Info-tagify
+M-x Info-split
+@end example
+
+@noindent
+(Note that the @samp{I} in @samp{Info} is upper case.)@refill
+
+When you use the @code{Info-split} command, the buffer is modified into a
+(small) Info file which lists the indirect subfiles. This file should be
+saved in place of the original visited file. The indirect subfiles are
+written in the same directory the original file is in, with names generated
+by appending @samp{-} and a number to the original file name.@refill
+
+The primary file still functions as an Info file, but it contains just
+the tag table and a directory of subfiles.@refill
+
+@node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top
+@comment node-name, next, previous, up
+@appendix Refilling Paragraphs
+@cindex Refilling paragraphs
+@cindex Filling paragraphs
+@findex refill
+
+The @code{@@refill} command refills and, optionally, indents the first
+line of a paragraph.@footnote{Perhaps the command should have been
+called the @code{@@refillandindent} command, but @code{@@refill} is
+shorter and the name was chosen before indenting was possible.} The
+@code{@@refill} command is no longer important, but we describe it here
+because you once needed it. You will see it in many old Texinfo
+files.@refill
+
+Without refilling, paragraphs containing long @@-constructs may look
+bad after formatting because the formatter removes @@-commands and
+shortens some lines more than others. In the past, neither the
+@code{texinfo-format-region} command nor the
+@code{texinfo-format-buffer} command refilled paragraphs
+automatically. The @code{@@refill} command had to be written at the
+end of every paragraph to cause these formatters to fill them. (Both
+@TeX{} and @code{makeinfo} have always refilled paragraphs
+automatically.) Now, all the Info formatters automatically fill and
+indent those paragraphs that need to be filled and indented.@refill
+
+The @code{@@refill} command causes @code{texinfo-format-region} and
+@code{texinfo-format-buffer} to refill a paragraph in the Info file
+@emph{after} all the other processing has been done. For this reason,
+you can not use @code{@@refill} with a paragraph containing either
+@code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will
+override those two commands.@refill
+
+The @code{texinfo-format-region} and @code{texinfo-format-buffer}
+commands now automatically append @code{@@refill} to the end of each
+paragraph that should be filled. They do not append @code{@@refill} to
+the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
+and therefore do not refill or indent them.@refill
+
+@node Command Syntax, Obtaining TeX, Refilling Paragraphs, Top
+@comment node-name, next, previous, up
+@appendix @@-Command Syntax
+@cindex @@-command syntax
+
+The character @samp{@@} is used to start special Texinfo commands.
+(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo
+has four types of @@-command:@refill
+
+@table @asis
+@item 1. Non-alphabetic commands.
+These commands consist of an @@ followed by a punctuation mark or other
+character that is not part of the alphabet. Non-alphabetic commands
+are almost always part of the text within a paragraph, and never take
+any argument. The two characters (@@ and the other one) are complete
+in themselves; none is followed by braces. The non-alphabetic
+commands are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@@},
+@code{@@@{}, and @code{@@@}}.@refill
+
+@item 2. Alphabetic commands that do not require arguments.
+These commands start with @@ followed by a word followed by left- and
+right-hand braces. These commands insert special symbols in the
+document; they do not require arguments. For example,
+@code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
+@result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}',
+and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill
+
+@item 3. Alphabetic commands that require arguments within braces.
+These commands start with @@ followed by a letter or a word, followed by an
+argument within braces. For example, the command @code{@@dfn} indicates
+the introductory or defining use of a term; it is used as follows: @samp{In
+Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill
+
+@item 4. Alphabetic commands that occupy an entire line.
+These commands occupy an entire line. The line starts with @@,
+followed by the name of the command (a word); for example, @code{@@center}
+or @code{@@cindex}. If no argument is needed, the word is followed by
+the end of the line. If there is an argument, it is separated from
+the command name by a space. Braces are not used.@refill
+@end table
+
+@cindex Braces and argument syntax
+Thus, the alphabetic commands fall into classes that have
+different argument syntaxes. You cannot tell to which class a command
+belongs by the appearance of its name, but you can tell by the
+command's meaning: if the command stands for a glyph, it is in
+class 2 and does not require an argument; if it makes sense to use the
+command together with other text as part of a paragraph, the command
+is in class 3 and must be followed by an argument in braces;
+otherwise, it is in class 4 and uses the rest of the line as its
+argument.@refill
+
+The purpose of having a different syntax for commands of classes 3 and
+4 is to make Texinfo files easier to read, and also to help the GNU
+Emacs paragraph and filling commands work properly. There is only one
+exception to this rule: the command @code{@@refill}, which is always
+used at the end of a paragraph immediately following the final period
+or other punctuation character. @code{@@refill} takes no argument and
+does @emph{not} require braces. @code{@@refill} never confuses the
+Emacs paragraph commands because it cannot appear at the beginning of
+a line.@refill
+
+@node Obtaining TeX, New Features, Command Syntax, Top
+@appendix How to Obtain @TeX{}
+@cindex Obtaining @TeX{}
+@cindex @TeX{}, how to obtain
+
+@c !!! Here is information about obtaining TeX. Update it whenever.
+@c !!! Also consider updating TeX.README on prep.
+@c Updated by RJC on 1 March 1995, conversation with MacKay.
+@c Updated by kb@cs.umb.edu on 29 July 1996.
+@TeX{} is freely redistributable. You can obtain @TeX{} for Unix
+systems via anonymous ftp or on tape or CD-ROM. The core material
+consists of Karl Berry's Web2c @TeX{} distribution.
+
+On-line retrieval instructions are available from either:
+@example
+@url{ftp://ftp.tug.org/tex/unixtex.ftp}
+@url{http://www.tug.org/unixtex.ftp}
+@end example
+
+The Free Software Foundation provides a core distribution on its Source
+Code CD-ROM suitable for printing Texinfo manuals; the University of
+Washington maintains and supports a tape distribution; the @TeX{} Users
+Group co-sponsors a complete CD-ROM @TeX{} distribution.
+
+For the FSF Source Code CD-ROM, please contact:
+
+@iftex
+@display
+@group
+Free Software Foundation, Inc.
+59 Temple Place Suite 330
+Boston, MA w{ } 02111-1307
+USA
+
+Telephone: @w{@t{+}1--617--542--5942}
+Fax: (including Japan) @w{@t{+}1--617--542--2652}
+Free Dial Fax (in Japan):
+@w{ } @w{ } @w{ } 0031--13--2473 (KDD)
+@w{ } @w{ } @w{ } 0066--3382--0158 (IDC)
+Electronic mail: @code{gnu@@prep.ai.mit.edu}
+@end group
+@end display
+@end iftex
+@ifinfo
+@display
+@group
+Free Software Foundation, Inc.
+59 Temple Place Suite 330
+Boston, MA @w{ } 02111-1307
+USA
+
+Telephone: @w{@t{+}1-617-542-5942}
+Fax: (including Japan) @w{@t{+}1-617-542-2652}
+Free Dial Fax (in Japan):
+@w{ } @w{ } @w{ } 0031-13-2473 (KDD)
+@w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
+Electronic mail: @code{gnu@@prep.ai.mit.edu}
+@end group
+@end display
+@end ifinfo
+
+To order a full distribution on CD-ROM, please see:
+@display
+@url{http://www.tug.org/tex-live.html}
+@end display
+
+@noindent
+(The distribution is also available by FTP; see the URL's above.)
+
+To order a full distribution from the University of Washington on either a
+1/4@dmn{in} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge, send
+$210 to:
+
+@display
+@group
+Pierre A. MacKay
+Denny Hall, Mail Stop DH-10
+University of Washington
+Seattle, WA @w{ } 98195
+USA
+
+Telephone: @t{+}1--206--543--2268
+Electronic mail: @code{mackay@@cs.washington.edu}
+@end group
+@end display
+
+Please make checks payable to the University of Washington.
+Checks must be in U.S.@: dollars, drawn on a U.S.@: bank.
+
+Prepaid orders are the only orders that can now be handled. Overseas
+sites: please add to the base cost, if desired, $20.00 for shipment
+via air parcel post, or $30.00 for shipment via courier.
+
+Please check with the above for current prices and formats.
+
+
+@node New Features, Command and Variable Index, Obtaining TeX, Top
+@appendix Second Edition Features
+
+@tex
+% Widen the space for the first column so three control-character
+% strings fit in the first column. Switched back to default .8in
+% value at end of chapter.
+\global\tableindent=1.0in
+@end tex
+
+The second edition of the Texinfo manual describes more than 20 new
+Texinfo mode commands and more than 50 previously undocumented Texinfo
+@@-commands. This edition is more than twice the length of the first
+edition.@refill
+
+Here is a brief description of the new commands.@refill
+
+@menu
+* New Texinfo Mode Commands:: The updating commands are especially useful.
+* New Commands:: Many newly described @@-commands.
+@end menu
+
+@node New Texinfo Mode Commands, New Commands, New Features, New Features
+@appendixsec New Texinfo Mode Commands
+
+Texinfo mode provides commands and features especially designed for
+working with Texinfo files. More than 20 new commands have been
+added, including commands for automatically creating and updating
+both nodes and menus. This is a tedious task when done by hand.@refill
+
+The keybindings are intended to be somewhat mnemonic.@refill
+
+@subheading Update all nodes and menus
+
+The @code{texinfo-master-menu} command is the primary command:
+
+@table @kbd
+@item C-c C-u m
+@itemx M-x texinfo-master-menu
+Create or update a master menu.
+With @kbd{C-u} as a prefix argument,
+first create or update all nodes
+and regular menus.
+@end table
+
+@subheading Update Pointers
+
+@noindent
+Create or update `Next', `Previous', and `Up' node pointers.@refill
+
+@noindent
+@xref{Updating Nodes and Menus}.
+
+@table @kbd
+@item C-c C-u C-n
+@itemx M-x texinfo-update-node
+Update a node.
+
+@item C-c C-u C-e
+@itemx M-x texinfo-every-node-update
+Update every node in the buffer.
+@end table
+
+@subheading Update Menus
+
+@noindent
+Create or update menus.@refill
+
+@noindent
+@xref{Updating Nodes and Menus}.
+
+@table @kbd
+@item C-c C-u C-m
+@itemx M-x texinfo-make-menu
+Make or update a menu.
+
+@item C-c C-u C-a
+@itemx M-x texinfo-all-menus-update
+Make or update all the menus in a buffer.
+With @kbd{C-u} as a prefix argument,
+first update all the nodes.
+@end table
+
+@subheading Insert Title as Description
+
+@noindent
+Insert a node's chapter or section title in the space for the
+description in a menu entry line; position point so you can edit the
+insert. (This command works somewhat differently than the other
+insertion commands, which insert only a predefined string.)@refill
+
+@noindent
+@xref{Inserting, Inserting Frequently Used Commands}.
+
+@table @kbd
+@item C-c C-c C-d
+Insert title.
+@end table
+
+@subheading Format for Info
+
+@noindent
+Provide keybindings both for the Info formatting commands that are
+written in Emacs Lisp and for @code{makeinfo} that is written in
+C.@refill
+
+@noindent
+@xref{Info Formatting}.
+
+@noindent
+Use the Emacs lisp @code{texinfo-format@dots{}} commands:
+
+@table @kbd
+@item C-c C-e C-r
+Format the region.
+
+@item C-c C-e C-b
+Format the buffer.
+@end table
+
+@noindent
+Use @code{makeinfo}:
+
+@table @kbd
+@item C-c C-m C-r
+Format the region.
+
+@item C-c C-m C-b
+Format the buffer.
+
+@item C-c C-m C-l
+Recenter the @code{makeinfo} output buffer.
+
+@item C-c C-m C-k
+Kill the @code{makeinfo} formatting job.
+@end table
+
+@subheading Typeset and Print
+
+@noindent
+Typeset and print Texinfo documents from within Emacs.@refill
+
+@ifinfo
+@noindent
+@xref{Printing}.
+@end ifinfo
+@iftex
+@noindent
+@xref{Printing, , Formatting and Printing}.
+@end iftex
+
+@table @kbd
+@item C-c C-t C-b
+Run @code{texi2dvi} on the buffer.
+
+@item C-c C-t C-r
+Run @TeX{} on the region.
+
+@item C-c C-t C-i
+Run @code{texindex}.
+
+@item C-c C-t C-p
+Print the @sc{dvi} file.
+
+@item C-c C-t C-q
+Show the print queue.
+
+@item C-c C-t C-d
+Delete a job from the print queue.
+
+@item C-c C-t C-k
+Kill the current @TeX{} formatting job.
+
+@item C-c C-t C-x
+Quit a currently stopped @TeX{} formatting job.
+
+@item C-c C-t C-l
+Recenter the output buffer.
+@end table
+
+@subheading Other Updating Commands
+
+@noindent
+The ``other updating commands'' do not have standard keybindings because
+they are used less frequently.@refill
+
+@noindent
+@xref{Other Updating Commands}.
+
+@table @kbd
+@item M-x texinfo-insert-node-lines
+Insert missing @code{@@node} lines using
+section titles as node names.
+
+@item M-x texinfo-multiple-files-update
+Update a multi-file document.
+With a numeric prefix, such as @kbd{C-u 8},
+update @strong{every} pointer and
+menu in @strong{all} the files and
+then insert a master menu.
+
+@item M-x texinfo-indent-menu-description
+Indent descriptions in menus.
+
+@item M-x texinfo-sequential-node-update
+Insert node pointers in strict sequence.
+@end table
+
+@node New Commands, , New Texinfo Mode Commands, New Features
+@appendixsec New Texinfo @@-Commands
+
+The second edition of the Texinfo manual describes more than 50
+commands that were not described in the first edition. A third or so
+of these commands existed in Texinfo but were not documented in the
+manual; the others are new. Here is a listing, with brief
+descriptions of them:@refill
+
+@subheading Indexing
+
+@noindent
+Create your own index, and merge indices.@refill
+
+@noindent
+@xref{Indices}.
+
+@table @kbd
+@item @@defindex @var{index-name}
+Define a new index and its indexing command.
+See also the @code{@@defcodeindex} command.
+
+@c written verbosely to avoid overfull hbox
+@item @@synindex @var{from-index} @var{into-index}
+Merge the @var{from-index} index into the @var{into-index} index.
+See also the @code{@@syncodeindex} command.
+@end table
+
+@subheading Definitions
+
+@noindent
+Describe functions, variables, macros,
+commands, user options, special forms, and other such artifacts in a
+uniform format.@refill
+
+@noindent
+@xref{Definition Commands}.
+
+@table @kbd
+@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
+Format a description for functions, interactive
+commands, and similar entities.
+
+@item @@defvr, @@defop, @dots{}
+15 other related commands.
+@end table
+
+@subheading Glyphs
+
+@noindent
+Indicate the results of evaluation, expansion,
+printed output, an error message, equivalence of expressions, and the
+location of point.@refill
+
+@noindent
+@xref{Glyphs}.
+
+@table @kbd
+@item @@equiv@{@}
+@itemx @equiv{}
+Equivalence:
+
+@item @@error@{@}
+@itemx @error{}
+Error message
+
+@item @@expansion@{@}
+@itemx @expansion{}
+Macro expansion
+
+@item @@point@{@}
+@itemx @point{}
+Position of point
+
+@item @@print@{@}
+@itemx @print{}
+Printed output
+
+@item @@result@{@}
+@itemx @result{}
+Result of an expression
+@end table
+
+@subheading Page Headings
+
+@noindent
+Customize page headings.
+
+@noindent
+@xref{Headings}.
+
+@table @kbd
+@item @@headings @var{on-off-single-double}
+Headings on or off, single, or double-sided.
+
+@item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
+Footings for even-numbered (left-hand) pages.
+
+@item @@evenheading, @@everyheading, @@oddheading, @dots{}
+Five other related commands.
+
+@item @@thischapter
+Insert name of chapter and chapter number.
+
+@item @@thischaptername, @@thisfile, @@thistitle, @@thispage
+Related commands.
+@end table
+
+@subheading Formatting
+
+@noindent
+Format blocks of text.
+
+@noindent
+@xref{Quotations and Examples}, and@*
+@ref{Lists and Tables, , Making Lists and Tables}.
+
+@table @kbd
+@item @@cartouche
+Draw rounded box surrounding text (not in Info).
+
+@item @@enumerate @var{optional-arg}
+Enumerate a list with letters or numbers.
+
+@item @@exdent @var{line-of-text}
+Remove indentation.
+
+@item @@flushleft
+Left justify.
+
+@item @@flushright
+Right justify.
+
+@item @@format
+Do not narrow nor change font.
+
+@item @@ftable @var{formatting-command}
+@itemx @@vtable @var{formatting-command}
+Two-column table with indexing.
+
+@item @@lisp
+For an example of Lisp code.
+
+@item @@smallexample
+@itemx @@smalllisp
+Like @@table and @@lisp @r{but for} @@smallbook.
+@end table
+
+@subheading Conditionals
+
+@noindent
+Conditionally format text.
+
+@noindent
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+
+@table @kbd
+@item @@set @var{flag} [@var{string}]
+Set a flag. Optionally, set value
+of @var{flag} to @var{string}.
+
+@item @@clear @var{flag}
+Clear a flag.
+
+@item @@value@{@var{flag}@}
+Replace with value to which @var{flag} is set.
+
+@item @@ifset @var{flag}
+Format, if @var{flag} is set.
+
+@item @@ifclear @var{flag}
+Ignore, if @var{flag} is set.
+@end table
+
+@subheading @@heading series for Titles
+
+@noindent
+Produce unnumbered headings that do not appear in a table of contents.
+
+@noindent
+@xref{Structuring}.
+
+@table @kbd
+@item @@heading @var{title}
+Unnumbered section-like heading not listed
+in the table of contents of a printed manual.
+
+@item @@chapheading, @@majorheading, @@subheading, @@subsubheading
+Related commands.
+@end table
+
+@need 1000
+@subheading Font commands
+
+@need 1000
+@noindent
+@xref{Smallcaps}, and @*
+@ref{Fonts}.
+
+@table @kbd
+@item @@r@{@var{text}@}
+Print in roman font.
+
+@item @@sc@{@var{text}@}
+Print in @sc{small caps} font.
+@end table
+
+@subheading Miscellaneous
+
+@noindent
+See @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@*
+see @ref{Customized Highlighting},@*
+see @ref{Overfull hboxes},@*
+see @ref{Footnotes},@*
+see @ref{dmn, , Format a Dimension},@*
+see @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@*
+see @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@*
+see @ref{minus, , Inserting a Minus Sign},@*
+see @ref{paragraphindent, , Paragraph Indenting},@*
+see @ref{Cross Reference Commands},@*
+see @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@*
+see @ref{Custom Headings, , How to Make Your Own Headings}.
+
+@table @kbd
+@item @@author @var{author}
+Typeset author's name.
+
+@ignore
+@item @@definfoenclose @var{new-command}, @var{before}, @var{after},
+Define a highlighting command for Info. (Info only.)
+@end ignore
+
+@item @@finalout
+Produce cleaner printed output.
+
+@item @@footnotestyle @var{end-or-separate}
+Specify footnote style.
+
+@item @@dmn@{@var{dimension}@}
+Format a dimension.
+
+@item @@global@@let@var{new-cmd}=@var{existing-cmd}
+Define a highlighting command for @TeX{}. (@TeX{} only.)
+
+@item @@lowersections
+Reduce hierarchical level of sectioning commands.
+
+@item @@math@{@var{mathematical-expression}@}
+Format a mathematical expression.
+
+@item @@minus@{@}
+Generate a minus sign.
+
+@item @@paragraphindent @var{asis-or-number}
+Specify paragraph indentation.
+
+@item @@raisesections
+Raise hierarchical level of sectioning commands.
+
+@item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@}
+Make a reference. In the printed manual, the
+reference does not start with the word `see'.
+
+@item @@title @var{title}
+Typeset @var{title} in the alternative
+title page format.
+
+@item @@subtitle @var{subtitle}
+Typeset @var{subtitle} in the alternative
+title page format.
+
+@item @@today@{@}
+Insert the current date.
+@end table
+@tex
+% Switch width of first column of tables back to default value
+\global\tableindent=.8in
+@end tex
+
+
+@node Command and Variable Index, Concept Index, New Features, Top
+@comment node-name, next, previous, up
+@unnumbered Command and Variable Index
+
+This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
+functions, and several variables. To make the list easier to use, the
+commands are listed without their preceding @samp{@@}.@refill
+
+@printindex fn
+
+
+@node Concept Index, , Command and Variable Index, Top
+@unnumbered Concept Index
+
+@printindex cp
+
+
+@summarycontents
+@contents
+@bye
diff --git a/contrib/texinfo/util/Makefile.am b/contrib/texinfo/util/Makefile.am
deleted file mode 100644
index f16dd034da85..000000000000
--- a/contrib/texinfo/util/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.6 1997/07/15 19:15:05 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-bin_PROGRAMS = install-info texindex
-bin_SCRIPTS = texi2dvi
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
-
-EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
- update-info
diff --git a/contrib/texinfo/util/Makefile.in b/contrib/texinfo/util/Makefile.in
index 7b04741a6c60..aa3b85a8bd68 100644
--- a/contrib/texinfo/util/Makefile.in
+++ b/contrib/texinfo/util/Makefile.in
@@ -1,321 +1,101 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile for GNU Texindex and other utilities.
+# $Id: Makefile.in,v 1.5 1996/09/29 20:07:06 karl Exp $
+#
+# Copyright (C) 1990, 91, 92, 96 Free Software Foundation, Inc.
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 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 free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
# 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.
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-SHELL = /bin/sh
+#### Start of system configuration section. ####
srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
+VPATH = $(srcdir):$(common)
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
+common = $(srcdir)/../libtxi
+CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-bin_PROGRAMS = install-info texindex
-bin_SCRIPTS = texi2dvi
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
+LN = ln
+RM = rm -f
+MKDIR = mkdir
-EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
- update-info
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
+DEFS = @DEFS@
+LIBS = -L../libtxi -ltxi @LIBS@
+LOADLIBES = $(LIBS)
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-install_info_SOURCES = install-info.c
-install_info_OBJECTS = install-info.o
-install_info_LDADD = $(LDADD)
-install_info_DEPENDENCIES = ../lib/libtxi.a
-install_info_LDFLAGS =
-texindex_SOURCES = texindex.c
-texindex_OBJECTS = texindex.o
-texindex_LDADD = $(LDADD)
-texindex_DEPENDENCIES = ../lib/libtxi.a
-texindex_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
+SHELL = /bin/sh
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-SOURCES = install-info.c texindex.c
-OBJECTS = install-info.o texindex.o
-
-default: all
-
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps util/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
+LDFLAGS = @LDFLAGS@
-maintainer-clean-binPROGRAMS:
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+# Prefix for each installed program, normally empty or `g'.
+binprefix =
+# Prefix for each installed man page, normally empty or `g'.
+manprefix =
+mandir = $(prefix)/man/man1
+manext = 1
+infodir = $(prefix)/info
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; \
- done
+#### End of system configuration section. ####
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
+all: texindex install-info
+sub-all: all
.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-install-info: $(install_info_OBJECTS) $(install_info_DEPENDENCIES)
- @rm -f install-info
- $(LINK) $(install_info_LDFLAGS) $(install_info_OBJECTS) $(install_info_LDADD) $(LIBS)
-
-texindex: $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
- @rm -f texindex
- $(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
-
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; fi; \
- done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_SCRIPTS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = util
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
-install-info.o: install-info.c ../lib/system.h ../config.h \
- ../lib/getopt.h
-texindex.o: texindex.c ../lib/system.h ../config.h ../lib/getopt.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec: install-binPROGRAMS install-binSCRIPTS
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
+ $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $<
-uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
-all: Makefile $(PROGRAMS) $(SCRIPTS)
+install: all
+ $(INSTALL_PROGRAM) texindex $(bindir)/texindex
+ $(INSTALL_PROGRAM) $(srcdir)/texi2dvi $(bindir)/texi2dvi
+ $(INSTALL_PROGRAM) install-info $(bindir)/install-info
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
- $(mkinstalldirs) $(bindir) $(bindir)
+uninstall:
+ rm -f $(bindir)/texindex $(bindir)/texi2dvi $(bindir)/install-info
+Makefile: Makefile.in ../config.status
+ cd ..; sh config.status
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+TAGS:
+ etags *.c *.h $(common)/getopt*.c $(common)/getopt.h
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+clean:
+ rm -f *.o a.out core core.* texindex install-info
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+mostlyclean: clean
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+distclean: clean
+ rm -f Makefile config.status
-clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean
+realclean: distclean
+ rm -f TAGS
-distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean
- -rm -f config.status
+texindex: texindex.o ../libtxi/libtxi.a
+ $(CC) $(LDFLAGS) -o texindex texindex.o $(LOADLIBES)
-maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
- maintainer-clean-tags maintainer-clean-generic \
- distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+texindex.o: texindex.c $(common)/getopt.h
-.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS tags \
-mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info dvi installcheck install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+install-info: install-info.o
+ $(CC) $(LDFLAGS) -o install-info install-info.o $(LOADLIBES)
+install-info.o: install-info.c $(common)/getopt.h
-# 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.
+# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
diff --git a/contrib/texinfo/util/README b/contrib/texinfo/util/README
deleted file mode 100644
index 5385522543b7..000000000000
--- a/contrib/texinfo/util/README
+++ /dev/null
@@ -1,4 +0,0 @@
-Assorted Texinfo-related programs and scripts.
-
-texindex, texi2dvi, and install-info get installed.
-The other items here are for your amusement and/or hacking pleasure.
diff --git a/contrib/texinfo/util/gen-dir-node b/contrib/texinfo/util/gen-dir-node
index c7ef670c5393..8f13088f920d 100755
--- a/contrib/texinfo/util/gen-dir-node
+++ b/contrib/texinfo/util/gen-dir-node
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: gen-dir-node,v 1.1 1997/05/22 22:02:43 karl Exp $
+# $Id: gen-dir-node,v 1.2 1996/10/03 18:49:48 karl Exp $
# Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a
# top-level dir file. The skeleton file contains info topic names in the
@@ -164,14 +164,9 @@ else
fi
for file in ${infofiles}; do
- case $file in
- *.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
- *) zcat=cat; gz=;;
- esac
infoname=`echo $file | sed 's/\.info$//'`
- entry=`$zcat ${INFODIR}/${file}$gz \
- |sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d'`
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
if [ ! -z "${entry}" ] ; then
echo "${entry}"
diff --git a/contrib/texinfo/util/install-info.c b/contrib/texinfo/util/install-info.c
index 03f6937d1d7f..b6a7a919e6c7 100644
--- a/contrib/texinfo/util/install-info.c
+++ b/contrib/texinfo/util/install-info.c
@@ -1,27 +1,37 @@
/* install-info -- create Info directory entry(ies) for an Info file.
- $Id: install-info.c,v 1.21 1998/03/01 15:38:45 karl Exp $
+ Copyright (C) 1996 Free Software Foundation, Inc.
- Copyright (C) 1996, 97, 98 Free Software Foundation, Inc.
+$Id: install-info.c,v 1.12 1996/10/03 23:13:36 karl Exp $
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*/
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "system.h"
-#include <getopt.h>
+#define INSTALL_INFO_VERSION_STRING "GNU install-info (Texinfo 3.9) 1.2"
-#ifdef HAVE_LIBZ
-#include <zlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <getopt.h>
+#include <sys/types.h>
+
+/* Get O_RDONLY. */
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
+#endif /* !HAVE_SYS_FCNTL_H */
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
#endif
/* Name this program was invoked with. */
@@ -37,8 +47,9 @@ struct spec_entry;
/* Data structures. */
+/* Record info about a single line from a file
+ as read into core. */
-/* Record info about a single line from a file as read into core. */
struct line_data
{
/* The start of the line. */
@@ -55,9 +66,9 @@ struct line_data
int delete;
};
-
/* This is used for a list of the specified menu section names
in which entries should be added. */
+
struct spec_section
{
struct spec_section *next;
@@ -67,16 +78,16 @@ struct spec_section
int missing;
};
-
/* This is used for a list of the entries specified to be added. */
+
struct spec_entry
{
struct spec_entry *next;
char *text;
};
-
-
+
/* This is used for a list of nodes found by parsing the dir file. */
+
struct node
{
struct node *next;
@@ -97,9 +108,9 @@ struct node
struct menu_section *last_section;
};
-
/* This is used for a list of sections found in a node's menu.
Each struct node has such a list in the sections field. */
+
struct menu_section
{
struct menu_section *next;
@@ -113,6 +124,7 @@ struct menu_section
/* Memory allocation and string operations. */
/* Like malloc but get fatal error if memory is exhausted. */
+
void *
xmalloc (size)
unsigned int size;
@@ -120,11 +132,12 @@ xmalloc (size)
extern void *malloc ();
void *result = malloc (size);
if (result == NULL)
- fatal (_("virtual memory exhausted"), 0);
+ fatal ("virtual memory exhausted", 0);
return result;
}
-/* Like realloc but get fatal error if memory is exhausted. */
+/* Like malloc but get fatal error if memory is exhausted. */
+
void *
xrealloc (obj, size)
void *obj;
@@ -133,12 +146,12 @@ xrealloc (obj, size)
extern void *realloc ();
void *result = realloc (obj, size);
if (result == NULL)
- fatal (_("virtual memory exhausted"), 0);
+ fatal ("virtual memory exhausted", 0);
return result;
}
-/* Return a newly-allocated string
- whose contents concatenate those of S1, S2, S3. */
+/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
+
char *
concat (s1, s2, s3)
char *s1, *s2, *s3;
@@ -172,7 +185,7 @@ copy_string (string, size)
/* Error message functions. */
-/* Print error message. S1 is printf control string, S2 and S3 args for it. */
+/* Print error message. `s1' is printf control string, `s2' is arg for it. */
/* VARARGS1 */
void
@@ -181,7 +194,7 @@ error (s1, s2, s3)
{
fprintf (stderr, "%s: ", progname);
fprintf (stderr, s1, s2, s3);
- putc ('\n', stderr);
+ fprintf (stderr, "\n");
}
/* VARARGS1 */
@@ -189,9 +202,9 @@ void
warning (s1, s2, s3)
char *s1, *s2, *s3;
{
- fprintf (stderr, _("%s: warning: "), progname);
+ fprintf (stderr, "%s: Warning: ", progname);
fprintf (stderr, s1, s2, s3);
- putc ('\n', stderr);
+ fprintf (stderr, "\n");
}
/* Print error message and exit. */
@@ -210,7 +223,7 @@ void
pfatal_with_name (name)
char *name;
{
- char *s = concat ("", strerror (errno), _(" for %s"));
+ char *s = concat ("", strerror (errno), " for %s");
fatal (s, name);
}
@@ -279,7 +292,7 @@ extract_menu_file_name (item_text)
void
suggest_asking_for_help ()
{
- fprintf (stderr, _("\tTry `%s --help' for a complete list of options.\n"),
+ fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n",
progname);
exit (1);
}
@@ -287,13 +300,16 @@ suggest_asking_for_help ()
void
print_help ()
{
- printf (_("Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
-\n\
-Install INFO-FILE in the Info directory file DIR-FILE.\n\
+ printf ("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
+ Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
Options:\n\
--delete Delete existing entries in INFO-FILE;\n\
don't insert any new entries.\n\
+--defentry=TEXT Like --entry, but only use TEXT if an entry\n\
+ is not present in INFO-FILE.\n\
+--defsection=TEXT Like --section, but only use TEXT if a section\n\
+ is not present in INFO-FILE.\n\
--dir-file=NAME Specify file name of Info directory file.\n\
This is equivalent to using the DIR-FILE argument.\n\
--entry=TEXT Insert TEXT as an Info directory entry.\n\
@@ -302,6 +318,7 @@ Options:\n\
If you specify more than one entry, they are all added.\n\
If you don't specify any entries, they are determined\n\
from information in the Info file itself.\n\
+--forceentry=TEXT Like --entry, but ignore any entry in INFO-FILE.\n\
--help Display this help and exit.\n\
--info-file=FILE Specify Info file to install in the directory.\n\
This is equivalent to using the INFO-FILE argument.\n\
@@ -317,80 +334,33 @@ Options:\n\
from information in the Info file itself.\n\
--version Display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.\n\
-"), progname);
+Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
+", progname);
}
-/* If DIRFILE does not exist, create a minimal one (or abort). If it
- already exists, do nothing. */
-
-void
-ensure_dirfile_exists (dirfile)
- char *dirfile;
-{
- int desc = open (dirfile, O_RDONLY);
- if (desc < 0 && errno == ENOENT)
- {
- FILE *f;
- char *readerr = strerror (errno);
- close (desc);
- f = fopen (dirfile, "w");
- if (f)
- {
- fputs (_("This is the file .../info/dir, which contains the\n\
-topmost node of the Info hierarchy, called (dir)Top.\n\
-The first time you invoke Info you start off looking at this node.\n\
-\n\
-File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
-\n\
- This (the Directory node) gives a menu of major topics.\n\
- Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
- \"h\" gives a primer for first-timers,\n\
- \"mEmacs<Return>\" visits the Emacs manual, etc.\n\
-\n\
- In Emacs, you can click mouse button 2 on a menu item or cross reference\n\
- to select it.\n\
-\n\
-* Menu:\n\
-"), f);
- if (fclose (f) < 0)
- pfatal_with_name (dirfile);
- }
- else
- {
- /* Didn't exist, but couldn't open for writing. */
- fprintf (stderr,
- _("%s: could not read (%s) and could not create (%s)\n"),
- dirfile, readerr, strerror (errno));
- exit (1);
- }
- }
- else
- close (desc); /* It already existed, so fine. */
-}
-
/* This table defines all the long-named options, says whether they
use an argument, and maps them into equivalent single-letter options. */
struct option longopts[] =
{
- { "delete", no_argument, NULL, 'r' },
- { "dir-file", required_argument, NULL, 'd' },
- { "entry", required_argument, NULL, 'e' },
- { "help", no_argument, NULL, 'h' },
- { "info-dir", required_argument, NULL, 'D' },
- { "info-file", required_argument, NULL, 'i' },
- { "item", required_argument, NULL, 'e' },
- { "quiet", no_argument, NULL, 'q' },
- { "remove", no_argument, NULL, 'r' },
- { "section", required_argument, NULL, 's' },
- { "version", no_argument, NULL, 'V' },
+ { "delete", no_argument, NULL, 'r' },
+ { "defentry", required_argument, NULL, 'E' },
+ { "defsection", required_argument, NULL, 'S' },
+ { "dir-file", required_argument, NULL, 'd' },
+ { "entry", required_argument, NULL, 'e' },
+ { "forceentry", required_argument, NULL, 'f' },
+ { "help", no_argument, NULL, 'h' },
+ { "info-dir", required_argument, NULL, 'D' },
+ { "info-file", required_argument, NULL, 'i' },
+ { "item", required_argument, NULL, 'e' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "remove", no_argument, NULL, 'r' },
+ { "section", required_argument, NULL, 's' },
+ { "version", no_argument, NULL, 'V' },
{ 0 }
};
-
-int
main (argc, argv)
int argc;
char **argv;
@@ -430,16 +400,12 @@ main (argc, argv)
int prefix_length;
int i;
- progname = argv[0];
+ /* Nonzero means only use if not present in info file. */
+ int entry_default = 0;
+ int entry_force = 0;
+ int section_default = 0;
-#ifdef HAVE_SETLOCALE
- /* Set locale via LC_ALL. */
- setlocale (LC_ALL, "");
-#endif
-
- /* Set the text message domain. */
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
+ progname = argv[0];
while (1)
{
@@ -461,7 +427,7 @@ main (argc, argv)
case 'd':
if (dirfile)
{
- fprintf (stderr, _("%s: Specify the Info directory only once.\n"),
+ fprintf (stderr, "%s: Specify the Info directory only once.\n",
progname);
suggest_asking_for_help ();
}
@@ -471,13 +437,24 @@ main (argc, argv)
case 'D':
if (dirfile)
{
- fprintf (stderr, _("%s: Specify the Info directory only once.\n"),
+ fprintf (stderr, "%s: Specify the Info directory only once.\n",
progname);
suggest_asking_for_help ();
}
dirfile = concat (optarg, "", "/dir");
break;
+ case 'f':
+ entry_force = 1;
+ if (!optarg[0])
+ {
+ fprintf (stderr, "%s: Must provide entry name.\n", progname);
+ suggest_asking_for_help ();
+ }
+ case 'E':
+ entry_default = 1;
+ if (!optarg[0])
+ break;
case 'e':
{
struct spec_entry *next
@@ -499,7 +476,7 @@ main (argc, argv)
case 'i':
if (infile)
{
- fprintf (stderr, _("%s: Specify the Info file only once.\n"),
+ fprintf (stderr, "%s: Specify the Info file only once.\n",
progname);
suggest_asking_for_help ();
}
@@ -514,6 +491,10 @@ main (argc, argv)
delete_flag = 1;
break;
+ case 'S':
+ section_default = 1;
+ if (!optarg[0])
+ break;
case 's':
{
struct spec_section *next
@@ -526,19 +507,21 @@ main (argc, argv)
break;
case 'V':
- printf ("install-info (GNU %s) %s\n", PACKAGE, VERSION);
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ puts (INSTALL_INFO_VERSION_STRING);
+puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (0);
+For more information about these matters, see the files named COPYING.");
+ exit (0);
default:
suggest_asking_for_help ();
}
}
+ if (entry_force)
+ entry_default = 0;
+
/* Interpret the non-option arguments as file names. */
for (; optind < argc; ++optind)
{
@@ -547,13 +530,13 @@ For more information about these matters, see the files named COPYING.\n"),
else if (dirfile == 0)
dirfile = argv[optind];
else
- error (_("excess command line argument `%s'"), argv[optind]);
+ error ("excess command line argument `%s'", argv[optind]);
}
if (!infile)
- fatal (_("No input file specified; try --help for more information."));
+ fatal ("No input file specified");
if (!dirfile)
- fatal (_("No dir file specified; try --help for more information."));
+ fatal ("No dir file specified");
/* Read the Info file and parse it into lines. */
@@ -562,7 +545,7 @@ For more information about these matters, see the files named COPYING.\n"),
/* Parse the input file to find the section names it specifies. */
- if (input_sections == 0)
+ if (input_sections == 0 || section_default)
{
prefix_length = strlen ("INFO-DIR-SECTION ");
for (i = 0; i < input_nlines; i++)
@@ -572,6 +555,13 @@ For more information about these matters, see the files named COPYING.\n"),
{
struct spec_section *next
= (struct spec_section *) xmalloc (sizeof (struct spec_section));
+
+ if (section_default)
+ {
+ input_sections = NULL; /* This leaks. */
+ section_default = 0;
+ }
+
next->name = copy_string (input_lines[i].start + prefix_length,
input_lines[i].size - prefix_length);
next->next = input_sections;
@@ -595,7 +585,7 @@ For more information about these matters, see the files named COPYING.\n"),
and put them on entries_to_add. But not if entries
were specified explicitly with command options. */
- if (entries_to_add == 0)
+ if ( !entry_force && (entries_to_add == 0 || entry_default) )
{
char *start_of_this_entry = 0;
for (i = 0; i < input_nlines; i++)
@@ -605,7 +595,7 @@ For more information about these matters, see the files named COPYING.\n"),
&& sizeof ("START-INFO-DIR-ENTRY") - 1 == input_lines[i].size)
{
if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+ fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY");
start_of_this_entry = input_lines[i + 1].start;
}
if (!strncmp ("END-INFO-DIR-ENTRY", input_lines[i].start,
@@ -616,6 +606,13 @@ For more information about these matters, see the files named COPYING.\n"),
{
struct spec_entry *next
= (struct spec_entry *) xmalloc (sizeof (struct spec_entry));
+
+ if (entry_default)
+ {
+ entries_to_add = NULL;
+ entry_default = 0;
+ }
+
next->text = copy_string (start_of_this_entry,
input_lines[i].start - start_of_this_entry);
next->next = entries_to_add;
@@ -624,26 +621,18 @@ For more information about these matters, see the files named COPYING.\n"),
start_of_this_entry = 0;
}
else
- fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"));
+ fatal ("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY");
}
}
if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+ fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY");
}
if (!delete_flag)
if (entries_to_add == 0)
- { /* No need to abort here, the original info file may not have
- the requisite Texinfo commands. This is not something an
- installer should have to correct (it's a problem for the
- maintainer), and there's no need to cause subsequent parts of
- `make install' to fail. */
- warning (_("no info dir entry in `%s'"), infile);
- exit (0);
- }
+ fatal ("no info dir entry in `%s'", infile);
/* Now read in the Info dir file. */
- ensure_dirfile_exists (dirfile);
dir_data = readfile (dirfile, &dir_size);
dir_lines = findlines (dir_data, dir_size, &dir_nlines);
@@ -652,12 +641,13 @@ For more information about these matters, see the files named COPYING.\n"),
.info suffix. */
{
unsigned basename_len;
+ extern char *strrchr ();
char *infile_basename = strrchr (infile, '/');
if (infile_basename)
infile_basename++;
else
infile_basename = infile;
-
+
basename_len = strlen (infile_basename);
infile_sans_info
= (strlen (infile_basename) > 5
@@ -667,7 +657,7 @@ For more information about these matters, see the files named COPYING.\n"),
infilelen_sans_info = strlen (infile_sans_info);
}
-
+
/* Parse the dir file. Find all the nodes, and their menus,
and the sections of their menus. */
@@ -771,13 +761,10 @@ For more information about these matters, see the files named COPYING.\n"),
p++;
if ((dir_lines[i].size
> (p - dir_lines[i].start + infilelen_sans_info))
- && !strncmp (p, infile_sans_info, infilelen_sans_info)
- && (p[infilelen_sans_info] == ')'
- || !strncmp (p + infilelen_sans_info, ".info)", 6)))
- {
- dir_lines[i].delete = 1;
- something_deleted = 1;
- }
+ && !strncmp(p, infile_sans_info, infilelen_sans_info)
+ && ( p[infilelen_sans_info] == ')' ||
+ strncmp (p + infilelen_sans_info, ".info)", 6) == 0))
+ dir_lines[i].delete = 1;
}
}
/* Treat lines that start with whitespace
@@ -849,7 +836,7 @@ For more information about these matters, see the files named COPYING.\n"),
dir_lines[i].start,
dir_lines[i].size)
&& !dir_lines[i].delete)
- fatal (_("menu item `%s' already exists, for file `%s'"),
+ fatal ("menu item `%s' already exists, for file `%s'",
extract_menu_item_name (entry->text),
extract_menu_file_name (dir_lines[i].start));
if (dir_lines[i].start[0] == '*'
@@ -872,7 +859,7 @@ For more information about these matters, see the files named COPYING.\n"),
}
if (delete_flag && !something_deleted && !quiet_flag)
- warning (_("no entries found for `%s'; nothing deleted"), infile);
+ warning ("no entries found for `%s'; nothing deleted", infile);
/* Output the old dir file, interpolating the new sections
and/or new entries where appropriate. */
@@ -964,49 +951,19 @@ readfile (filename, sizep)
char *filename;
int *sizep;
{
- int desc;
int data_size = 1024;
char *data = (char *) xmalloc (data_size);
int filled = 0;
int nread = 0;
-#ifdef HAVE_LIBZ
- int isGZ = 0;
- gzFile zdesc;
-#endif
- desc = open (filename, O_RDONLY);
- if (desc < 0)
- pfatal_with_name (filename);
+ int desc = open (filename, O_RDONLY);
-#ifdef HAVE_LIBZ
- /* The file should always be two bytes long. */
- if (read (desc, data, 2) != 2)
+ if (desc < 0)
pfatal_with_name (filename);
- /* Undo that read. */
- lseek (desc, 0, SEEK_SET);
-
- /* If we see gzip magic, use gzdopen. */
- if (data[0] == '\x1f' && data[1] == '\x8b')
- {
- isGZ = 1;
- zdesc = gzdopen (desc, "r");
- if (zdesc == NULL) {
- close (desc);
- pfatal_with_name (filename);
- }
- }
-#endif /* HAVE_LIBZ */
-
while (1)
{
-#ifdef HAVE_LIBZ
- if (isGZ)
- nread = gzread (zdesc, data + filled, data_size - filled);
- else
-#endif
- nread = read (desc, data + filled, data_size - filled);
-
+ nread = read (desc, data + filled, data_size - filled);
if (nread < 0)
pfatal_with_name (filename);
if (nread == 0)
@@ -1021,14 +978,6 @@ readfile (filename, sizep)
}
*sizep = filled;
-
-#ifdef HAVE_LIBZ
- if (isGZ)
- gzclose (zdesc);
- else
-#endif
- close(desc);
-
return data;
}
@@ -1098,7 +1047,7 @@ menu_line_lessp (line1, len1, line2, len2)
{
int minlen = (len1 < len2 ? len1 : len2);
int i;
-
+
for (i = 0; i < minlen; i++)
{
/* If one item name is a prefix of the other,
@@ -1131,7 +1080,7 @@ menu_line_equal (line1, len1, line2, len2)
{
int minlen = (len1 < len2 ? len1 : len2);
int i;
-
+
for (i = 0; i < minlen; i++)
{
/* If both item names end here, they are equal. */
diff --git a/contrib/texinfo/mkinstalldirs b/contrib/texinfo/util/mkinstalldirs
index a01481be4367..a01481be4367 100755
--- a/contrib/texinfo/mkinstalldirs
+++ b/contrib/texinfo/util/mkinstalldirs
diff --git a/contrib/texinfo/util/texi2dvi b/contrib/texinfo/util/texi2dvi
index 43f652d00f19..9b2e48eefcc4 100755
--- a/contrib/texinfo/util/texi2dvi
+++ b/contrib/texinfo/util/texi2dvi
@@ -1,9 +1,10 @@
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
-# $Id: texi2dvi,v 0.8 1998/02/26 21:13:13 karl Exp $
-#
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-#
+
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+
+# $Id: texi2dvi,v 1.10 1996/10/04 18:21:55 karl Exp $
+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
@@ -18,34 +19,35 @@
# along with this program; if not, you can either send email to this
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-#
+
# Commentary:
-#
-# Author: Noah Friedman <friedman@gnu.org>
-#
-# Please send bug reports, etc. to bug-texinfo@gnu.org.
+
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+
+# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
-#
+
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations. I've tried to make this program as
# portable as possible. Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
#
-# Among the more interesting lossages I noticed among Bourne shells:
+# Among the more interesting lossages I noticed with some bourne shells
+# are:
# * No shell functions.
# * No `unset' builtin.
# * `shift' cannot take a numeric argument, and signals an error if
# there are no arguments to shift.
-#
+
# Code:
# Name by which this script was invoked.
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 0.8 $'
+rcs_revision='$Revision: 1.10 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
@@ -56,8 +58,6 @@ usage="Usage: $0 [OPTION]... FILE...
Run a Texinfo document through TeX.
Options:
--b, --batch No interaction (\nonstopmode in TeX).
--c, --clean Remove all auxiliary files.
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
-t, --texinfo CMD Insert CMD after @setfilename before running TeX.
--verbose Report on what is done.
@@ -67,15 +67,14 @@ Options:
The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
used to run those commands, if they are set.
-Email bug reports to bug-texinfo@gnu.org."
+Email bug reports to bug-texinfo@prep.ai.mit.edu.
+"
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
backup_extension=.bak # these files get deleted if all goes well.
-batch=
-clean=
debug=
orig_pwd="`pwd`"
textra=
@@ -93,19 +92,16 @@ export TEXINPUTS
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
-while :; do
- test $# -eq 0 && break
-
+while : ; do
+ case $# in 0) break ;; esac
case "$1" in
- -b | --batch | --b* ) batch=t; shift ;;
- -c | --clean | --c* ) clean=t; shift ;;
-D | --debug | --d* ) debug=t; shift ;;
-h | --help | --h* ) echo "$usage"; exit 0 ;;
# OK, we should do real option parsing here, but be lazy for now.
-t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
-v | --vers* )
- echo "$progname (GNU Texinfo 3.12) $version"
- echo "Copyright (C) 1998 Free Software Foundation, Inc.
+ echo "$progname (Texinfo 3.9) $version"
+ echo "Copyright (C) 1996 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@@ -113,7 +109,8 @@ For more information about these matters, see the files named COPYING."
--verb* ) verbose=echo; shift ;;
-- ) # Stop option processing
shift
- break ;;
+ break
+ ;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
@@ -122,8 +119,11 @@ For more information about these matters, see the files named COPYING."
exec 1>&2
echo "$progname: Unknown or ambiguous option $bq$arg$eq."
echo "$progname: Try $bq--help$eq for more information."
- exit 1 ;;
- * ) break ;;
+ exit 1
+ ;;
+ * )
+ break
+ ;;
esac
done
@@ -139,14 +139,14 @@ fi
test "$debug" = t && set -x
# Texify files
-for command_line_filename in ${1+"$@"}; do
+for command_line_filename in ${1+"$@"} ; do
$verbose "Processing $command_line_filename ..."
# See if file exists. If it doesn't we're in trouble since, even
# though the user may be able to reenter a valid filename at the tex
# prompt (assuming they're attending the terminal), this script won't
# be able to find the right index files and so forth.
- if test ! -r "${command_line_filename}"; then
+ if test ! -r "${command_line_filename}" ; then
echo "$0: Could not read ${command_line_filename}." >&2
continue
fi
@@ -161,22 +161,17 @@ for command_line_filename in ${1+"$@"}; do
# basename as the manual. Use extension .texi for the temp file so
# that TeX will ignore it. Thus, we must use a subdirectory.
#
- # Output the macro-expanded file to here. The vastly abbreviated
- # temporary directory name is so we don't have collisions on 8.3 or
- # 14-character filesystems.
- tmp_dir=${TMPDIR-/tmp}/txi2d.$$
+ # Output the macro-expanded file to here.
+ tmp_dir=${TMPDIR-/tmp}/$$
filename_tmp=$tmp_dir/$filename_noext.texi
# Output the file with the user's extra commands to here.
- tmp_dir2=${tmp_dir}.2
- filename_tmp2=$tmp_dir2/$filename_noext.texi
- mkdir $tmp_dir $tmp_dir2
- # Always remove the temporary directories.
- trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
+ filename_tmp2=$tmp_dir.2/$filename_noext.texi
+ mkdir $tmp_dir $tmp_dir.2
# If directory and file are the same, then it's probably because there's
# no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}"; then
- directory=.
+ if test "z${directory}" = "z${command_line_filename}" ; then
+ directory=.
fi
# Source file might @include additional texinfo sources. Put `.' and
@@ -200,10 +195,10 @@ for command_line_filename in ${1+"$@"}; do
# let's be safe.)
if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
$verbose "Reverting to $command_line_filename ..."
- cp -p $command_line_filename $filename_tmp
+ filename_input=$command_line_filename
+ else
+ filename_input=$filename_tmp
fi
- filename_input=$filename_tmp
- dirname_input=$tmp_dir
# Used most commonly for @finalout, @smallbook, etc.
if test -n "$textra"; then
@@ -211,14 +206,6 @@ for command_line_filename in ${1+"$@"}; do
sed '/^@setfilename/a\
'"$textra" $filename_input >$filename_tmp2
filename_input=$filename_tmp2
- dirname_input=$tmp_dir2
- fi
-
- # If clean mode was specified, then move to the temporary directory.
- if test "$clean" = t; then
- $verbose "cd $dirname_input"
- cd $dirname_input || exit 1
- filename_input=`basename $filename_input`
fi
while true; do # will break out of loop below
@@ -231,17 +218,17 @@ for command_line_filename in ${1+"$@"}; do
# is actually the cross-references file, but we need to keep track of
# that too.
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
- # If file is empty, forget it.
- test -s "${this_file}" || continue
-
- # Examine first character of file. If it's not suitable to be an
- # index or xref file, don't process it.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "x${first_character}" = "x\\" \
- || test "x${first_character}" = "x'"; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
+ for this_file in ${possible_index_files} ; do
+ # If file is empty, forget it.
+ test -s "${this_file}" || continue
+
+ # Examine first character of file. If it's not suitable to be an
+ # index or xref file, don't process it.
+ first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
+ fi
done
orig_index_files="${definite_index_files}"
orig_index_files_sans_aux="`echo ${definite_index_files} \
@@ -251,7 +238,7 @@ for command_line_filename in ${1+"$@"}; do
# Now save copies of original index files so we have some means of
# comparison later.
$verbose "Backing up current index files: $orig_index_files ..."
- for index_file_to_save in ${orig_index_files}; do
+ for index_file_to_save in ${orig_index_files} ; do
cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
done
@@ -259,27 +246,21 @@ for command_line_filename in ${1+"$@"}; do
# after running TeX a first time the index files don't change, then
# there's no reason to run TeX again. But we won't know that if the
# index files are out of date or nonexistent.
- if test -n "${orig_index_files_sans_aux}"; then
- $verbose "Running $texindex $orig_index_files_sans_aux ..."
- ${texindex} ${orig_index_files_sans_aux}
+ if test -n "${orig_index_files_sans_aux}" ; then
+ $verbose "Running $texindex $orig_index_files_sans_aux ..."
+ ${texindex} ${orig_index_files_sans_aux}
fi
# Finally, run TeX.
- if test "$batch" = t; then
- tex_mode='\nonstopmode'
- else
- tex_mode=
- fi
$verbose "Running $tex $filename_input ..."
- cmd="$tex $tex_mode \\input $filename_input"
- $cmd
+ ${tex} "$filename_input"
# Check if index files changed.
#
definite_index_files=
# Get list of new index files.
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
+ for this_file in ${possible_index_files} ; do
# If file is empty, forget it.
test -s "${this_file}" || continue
@@ -302,17 +283,17 @@ for command_line_filename in ${1+"$@"}; do
# file or another has definitely changed.
$verbose "Original index files =$orig_index_files"
$verbose "New index files =$new_index_files"
- if test "z${orig_index_files}" != "z${new_index_files}"; then
+ if test "z${orig_index_files}" != "z${new_index_files}" ; then
index_files_changed_p=t
else
# File list is the same. We must compare each file until we find a
# difference.
index_files_changed_p=
- for this_file in ${new_index_files}; do
+ for this_file in ${new_index_files} ; do
$verbose "Comparing index file $this_file ..."
# cmp -s will return nonzero exit status if files differ.
cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0; then
+ if test $? -ne 0 ; then
# We only need to keep comparing until we find *one* that
# differs, because we'll have to run texindex & tex no
# matter what.
@@ -327,36 +308,57 @@ for command_line_filename in ${1+"$@"}; do
# If index files have changed since TeX has been run, or if the aux
# file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}"; then :; else
+ if test "${index_files_changed_p}" ; then :; else
# Nothing changed. We're done with TeX.
break
fi
done
- # If we were in clean mode, compilation was in a tmp directory.
- # Copy the DVI file into the directory where the compilation
- # has been done. (The temp dir is about to get removed anyway.)
- # We also return to the original directory so that
- # - the next file is processed in correct conditions
- # - the temporary file can be removed
- if test -n "$clean"; then
- $verbose "Copying DVI file from `pwd` to $orig_pwd"
- cp -p $filename_noext.dvi $orig_pwd
- cd $orig_pwd || exit 1
- fi
-
# Generate list of files to delete, then call rm once with the entire
# list. This is significantly faster than multiple executions of rm.
file_list=
- for file in ${orig_index_files}; do
+ for file in ${orig_index_files} ; do
file_list="${file_list} ${file}${backup_extension}"
done
- if test -n "${file_list}"; then
- $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
+ if test -n "${file_list}" ; then
+ $verbose "Removing $file_list $tmp_dir $tmp_dir.2 ..."
rm -f ${file_list}
- rm -rf $tmp_dir $tmp_dir2
+ rm -rf $tmp_dir $tmp_dir.2
fi
done
$verbose "$0 done."
true # exit successfully.
+
+# texi2dvi ends here
+# $Log: texi2dvi,v $
+# Revision 1.10 1996/10/04 18:21:55 karl
+# Include only the current year in the copyright message.
+#
+# Revision 1.9 1996/10/04 11:49:48 karl
+# Exit successfully. From arnold.
+#
+# Revision 1.8 1996/10/03 23:14:26 karl
+# Only show diff if verbose.
+# Update version number.
+#
+# Revision 1.7 1996/09/29 22:56:08 karl
+# Use $progname instead of $0 for --version.
+#
+# Revision 1.6 1996/09/28 21:01:23 karl
+# Recompute original index files each time through loop.
+# Make indentation uniform.
+# Use same basename for the temp input files.
+# Standardize --version output.
+#
+# Revision 1.5 1996/09/26 14:46:34 karl
+# (texi2dvi): Run TeX until the aux/index files stabilize, instead of just
+# twice. From: David Shaw <daves@gsms01.alcatel.com.au>.
+#
+# Revision 1.4 1996/08/27 18:59:26 karl
+# Include bug reporting address.
+#
+# Revision 1.3 1996/07/26 18:20:56 karl
+# Do macro expansion with makeinfo before running TeX.
+# Various expansion safety measures added for test; avoid use of -o.
+#
diff --git a/contrib/texinfo/util/texindex.c b/contrib/texinfo/util/texindex.c
index 7ae607c16948..47a56791611f 100644
--- a/contrib/texinfo/util/texindex.c
+++ b/contrib/texinfo/util/texindex.c
@@ -1,7 +1,7 @@
/* Prepare TeX index dribble output into an actual index.
- $Id: texindex.c,v 1.22 1998/02/22 23:00:09 karl Exp $
+ $Id: texindex.c,v 1.6 1996/10/04 18:21:30 karl Exp $
- Copyright (C) 1987, 91, 92, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,8 +17,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */
-#include "system.h"
-#include <getopt.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include "getopt.h"
+
+#define TEXINDEX_VERSION_STRING "GNU Texindex (Texinfo 3.9) 2.1"
#if defined (emacs)
# include "../src/config.h"
@@ -29,6 +33,26 @@
# undef open
#endif
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#endif /* HAVE_STRING_H */
+
+#if !defined (HAVE_STRCHR)
+char *strrchr ();
+#endif /* !HAVE_STRCHR */
+
+#if defined (STDC_HEADERS)
+# include <stdlib.h>
+#else /* !STDC_HEADERS */
+char *getenv (), *malloc (), *realloc ();
+#endif /* !STDC_HEADERS */
+
+#if defined (HAVE_UNISTD_H)
+# include <unistd.h>
+#else /* !HAVE_UNISTD_H */
+off_t lseek ();
+#endif /* !HAVE_UNISTD_H */
+
#if !defined (HAVE_MEMSET)
#undef memset
#define memset(ptr, ignore, count) bzero (ptr, count)
@@ -43,6 +67,18 @@ char *mktemp ();
# define TI_FATAL_ERROR ((1 << 28) | 4)
# define unlink delete
#else /* !VMS */
+# if defined (HAVE_SYS_FCNTL_H)
+# include <sys/types.h>
+# include <sys/fcntl.h>
+# endif /* HAVE_SYS_FCNTL_H */
+
+# if defined (_AIX) || !defined (_POSIX_VERSION)
+# include <sys/file.h>
+# else /* !AIX && _POSIX_VERSION */
+# if !defined (HAVE_SYS_FCNTL_H)
+# include <fcntl.h>
+# endif /* !HAVE_FCNTL_H */
+# endif /* !_AIX && _POSIX_VERSION */
# define TI_NO_ERROR 0
# define TI_FATAL_ERROR 1
#endif /* !VMS */
@@ -53,31 +89,38 @@ char *mktemp ();
# define SEEK_END 2
#endif /* !SEEK_SET */
+#ifndef errno
+extern int errno;
+#endif
+#ifndef strerror
+extern char *strerror ();
+#endif
+
/* When sorting in core, this structure describes one line
and the position and length of its first keyfield. */
struct lineinfo
{
- char *text; /* The actual text of the line. */
+ char *text; /* The actual text of the line. */
union {
- char *text; /* The start of the key (for textual comparison). */
- long number; /* The numeric value (for numeric comparison). */
+ char *text; /* The start of the key (for textual comparison). */
+ long number; /* The numeric value (for numeric comparison). */
} key;
- long keylen; /* Length of KEY field. */
+ long keylen; /* Length of KEY field. */
};
/* This structure describes a field to use as a sort key. */
struct keyfield
{
- int startwords; /* Number of words to skip. */
- int startchars; /* Number of additional chars to skip. */
- int endwords; /* Number of words to ignore at end. */
- int endchars; /* Ditto for characters of last word. */
- char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
- char fold_case; /* Non-zero means case doesn't matter. */
- char reverse; /* Non-zero means compare in reverse order. */
- char numeric; /* Non-zeros means field is ASCII numeric. */
- char positional; /* Sort according to file position. */
- char braced; /* Count balanced-braced groupings as fields. */
+ int startwords; /* Number of words to skip. */
+ int startchars; /* Number of additional chars to skip. */
+ int endwords; /* Number of words to ignore at end. */
+ int endchars; /* Ditto for characters of last word. */
+ char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
+ char fold_case; /* Non-zero means case doesn't matter. */
+ char reverse; /* Non-zero means compare in reverse order. */
+ char numeric; /* Non-zeros means field is ASCII numeric. */
+ char positional; /* Sort according to file position. */
+ char braced; /* Count balanced-braced groupings as fields. */
};
/* Vector of keyfields to use. */
@@ -155,7 +198,7 @@ char *tempcopy ();
#define MAX_IN_CORE_SORT 500000
-int
+void
main (argc, argv)
int argc;
char **argv;
@@ -171,15 +214,6 @@ main (argc, argv)
else
program_name = argv[0];
-#ifdef HAVE_SETLOCALE
- /* Set locale via LC_ALL. */
- setlocale (LC_ALL, "");
-#endif
-
- /* Set the text message domain. */
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
/* Describe the kind of sorting to do. */
/* The first keyfield uses the first braced field and folds case. */
keyfields[0].braced = 1;
@@ -213,7 +247,7 @@ main (argc, argv)
desc = open (infiles[i], O_RDONLY, 0);
if (desc < 0)
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
lseek (desc, (off_t) 0, SEEK_END);
ptr = (long) lseek (desc, (off_t) 0, SEEK_CUR);
@@ -221,21 +255,19 @@ main (argc, argv)
outfile = outfiles[i];
if (!outfile)
- {
- outfile = concat (infiles[i], "s", "");
- }
+ {
+ outfile = concat (infiles[i], "s", "");
+ }
if (ptr < MAX_IN_CORE_SORT)
- /* Sort a small amount of data. */
- sort_in_core (infiles[i], ptr, outfile);
+ /* Sort a small amount of data. */
+ sort_in_core (infiles[i], ptr, outfile);
else
- sort_offline (infiles[i], ptr, outfile);
+ sort_offline (infiles[i], ptr, outfile);
}
flush_tempfiles (tempcount);
exit (TI_NO_ERROR);
-
- return 0; /* Avoid bogus warnings. */
}
typedef struct
@@ -250,15 +282,15 @@ typedef struct
TEXINDEX_OPTION texindex_options[] = {
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
- N_("keep temporary files around after processing") },
+ "keep temporary files around after processing" },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
- N_("do not keep temporary files around after processing (default)") },
+ "do not keep temporary files around after processing (default)" },
{ "--output", "-o", (int *)NULL, 0, "FILE",
- N_("send output to FILE") },
+ "send output to FILE" },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
- N_("display version information and exit") },
+ "display version information and exit" },
{ "--help", "-h", (int *)NULL, 0, (char *)NULL,
- N_("display this help and exit") },
+ "display this help and exit" },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
};
@@ -269,25 +301,25 @@ usage (result_value)
register int i;
FILE *f = result_value ? stderr : stdout;
- fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
- fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
+ fprintf (f, "Usage: %s [OPTION]... FILE...\n", program_name);
+ fprintf (f, "Generate a sorted index for each TeX output FILE.\n");
/* Avoid trigraph nonsense. */
- fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
- fprintf (f, _("\nOptions:\n"));
+ fprintf (f, "Usually FILE... is `foo.??\' for a document `foo.texi'.\n");
+ fprintf (f, "\nOptions:\n");
for (i = 0; texindex_options[i].long_name; i++)
{
if (texindex_options[i].short_name)
- fprintf (f, "%s, ", texindex_options[i].short_name);
+ fprintf (f, "%s, ", texindex_options[i].short_name);
fprintf (f, "%s %s",
- texindex_options[i].long_name,
- texindex_options[i].arg_name
+ texindex_options[i].long_name,
+ texindex_options[i].arg_name
? texindex_options[i].arg_name : "");
- fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
+ fprintf (f, "\t%s\n", texindex_options[i].doc_string);
}
- puts (_("\nEmail bug reports to bug-texinfo@gnu.org."));
+ puts ("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu.");
exit (result_value);
}
@@ -301,6 +333,7 @@ decode_command (argc, argv)
char **argv;
{
int arg_index = 1;
+ int optc;
char **ip;
char **op;
@@ -331,47 +364,46 @@ decode_command (argc, argv)
char *arg = argv[arg_index++];
if (*arg == '-')
- {
- if (strcmp (arg, "--version") == 0)
- {
- printf ("texindex (GNU %s) %s\n", PACKAGE, VERSION);
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ {
+ if (strcmp (arg, "--version") == 0)
+ {
+ puts (TEXINDEX_VERSION_STRING);
+puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (0);
- }
- else if ((strcmp (arg, "--keep") == 0) ||
- (strcmp (arg, "-k") == 0))
- {
- keep_tempfiles = 1;
- }
- else if ((strcmp (arg, "--help") == 0) ||
- (strcmp (arg, "-h") == 0))
- {
- usage (0);
- }
- else if ((strcmp (arg, "--output") == 0) ||
- (strcmp (arg, "-o") == 0))
- {
- if (argv[arg_index] != (char *)NULL)
- {
- arg_index++;
- if (op > outfiles)
- *(op - 1) = argv[arg_index];
- }
- else
- usage (1);
- }
- else
- usage (1);
- }
+For more information about these matters, see the files named COPYING.");
+ exit (0);
+ }
+ else if ((strcmp (arg, "--keep") == 0) ||
+ (strcmp (arg, "-k") == 0))
+ {
+ keep_tempfiles = 1;
+ }
+ else if ((strcmp (arg, "--help") == 0) ||
+ (strcmp (arg, "-h") == 0))
+ {
+ usage (0);
+ }
+ else if ((strcmp (arg, "--output") == 0) ||
+ (strcmp (arg, "-o") == 0))
+ {
+ if (argv[arg_index] != (char *)NULL)
+ {
+ arg_index++;
+ if (op > outfiles)
+ *(op - 1) = argv[arg_index];
+ }
+ else
+ usage (1);
+ }
+ else
+ usage (1);
+ }
else
- {
- *ip++ = arg;
- *op++ = (char *)NULL;
- }
+ {
+ *ip++ = arg;
+ *op++ = (char *)NULL;
+ }
}
/* Record number of keyfields and terminate list of filenames. */
@@ -427,7 +459,7 @@ tempcopy (idesc)
int nread = read (idesc, buffer, BUFSIZE);
write (odesc, buffer, nread);
if (!nread)
- break;
+ break;
}
close (odesc);
@@ -453,16 +485,16 @@ compare_full (line1, line2)
char *start1 = find_field (&keyfields[i], *line1, &length1);
char *start2 = find_field (&keyfields[i], *line2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, *line1 - text_base,
- start2, length2, *line2 - text_base);
+ start2, length2, *line2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Compare LINE1 and LINE2, described by structures
@@ -482,19 +514,19 @@ compare_prepared (line1, line2)
if (keyfields->positional)
{
if (line1->text - text_base > line2->text - text_base)
- tem = 1;
+ tem = 1;
else
- tem = -1;
+ tem = -1;
}
else if (keyfields->numeric)
tem = line1->key.number - line2->key.number;
else
tem = compare_field (keyfields, line1->key.text, line1->keylen, 0,
- line2->key.text, line2->keylen, 0);
+ line2->key.text, line2->keylen, 0);
if (tem)
{
if (keyfields->reverse)
- return -tem;
+ return -tem;
return tem;
}
@@ -511,16 +543,16 @@ compare_prepared (line1, line2)
char *start1 = find_field (&keyfields[i], text1, &length1);
char *start2 = find_field (&keyfields[i], text2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, text1 - text_base,
- start2, length2, text2 - text_base);
+ start2, length2, text2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Like compare_full but more general.
@@ -546,16 +578,16 @@ compare_general (str1, str2, pos1, pos2, use_keyfields)
char *start1 = find_field (&keyfields[i], str1, &length1);
char *start2 = find_field (&keyfields[i], str2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, pos1,
- start2, length2, pos2);
+ start2, length2, pos2);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Find the start and length of a field in STR according to KEYFIELD.
@@ -578,23 +610,23 @@ find_field (keyfield, str, lengthptr)
fun = find_pos;
start = (*fun) (str, keyfield->startwords, keyfield->startchars,
- keyfield->ignore_blanks);
+ keyfield->ignore_blanks);
if (keyfield->endwords < 0)
{
if (keyfield->braced)
- end = find_braced_end (start);
+ end = find_braced_end (start);
else
- {
- end = start;
- while (*end && *end != '\n')
- end++;
- }
+ {
+ end = start;
+ while (*end && *end != '\n')
+ end++;
+ }
}
else
{
end = (*fun) (str, keyfield->endwords, keyfield->endchars, 0);
if (end - str < start - str)
- end = start;
+ end = start;
}
*lengthptr = end - start;
return start;
@@ -619,11 +651,11 @@ find_pos (str, words, chars, ignore_blanks)
char c;
/* Find next bunch of nonblanks and skip them. */
while ((c = *p) == ' ' || c == '\t')
- p++;
+ p++;
while ((c = *p) && c != '\n' && !(c == ' ' || c == '\t'))
- p++;
+ p++;
if (!*p || *p == '\n')
- return p;
+ return p;
}
while (*p == ' ' || *p == '\t')
@@ -632,7 +664,7 @@ find_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -656,19 +688,19 @@ find_braced_pos (str, words, chars, ignore_blanks)
{
bracelevel = 1;
while ((c = *p++) != '{' && c != '\n' && c)
- /* Do nothing. */ ;
+ /* Do nothing. */ ;
if (c != '{')
- return p - 1;
+ return p - 1;
while (bracelevel)
- {
- c = *p++;
- if (c == '{')
- bracelevel++;
- if (c == '}')
- bracelevel--;
- if (c == 0 || c == '\n')
- return p - 1;
- }
+ {
+ c = *p++;
+ if (c == '{')
+ bracelevel++;
+ if (c == '}')
+ bracelevel--;
+ if (c == 0 || c == '\n')
+ return p - 1;
+ }
}
while ((c = *p++) != '{' && c != '\n' && c)
@@ -684,7 +716,7 @@ find_braced_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -706,11 +738,11 @@ find_braced_end (str)
{
c = *p++;
if (c == '{')
- bracelevel++;
+ bracelevel++;
if (c == '}')
- bracelevel--;
+ bracelevel--;
if (c == 0 || c == '\n')
- return p - 1;
+ return p - 1;
}
return p - 1;
}
@@ -723,7 +755,7 @@ find_value (start, length)
while (length != 0L)
{
if (isdigit (*start))
- return atol (start);
+ return atol (start);
length--;
start++;
}
@@ -769,17 +801,17 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
if (keyfields->positional)
{
if (pos1 > pos2)
- return 1;
+ return 1;
else
- return -1;
+ return -1;
}
if (keyfield->numeric)
{
long value = find_value (start1, length1) - find_value (start2, length2);
if (value > 0)
- return 1;
+ return 1;
if (value < 0)
- return -1;
+ return -1;
return 0;
}
else
@@ -790,46 +822,46 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
char *e2 = start2 + length2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (char_order[c1] != char_order[c2])
- return char_order[c1] - char_order[c2];
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (char_order[c1] != char_order[c2])
+ return char_order[c1] - char_order[c2];
+ if (!c1)
+ break;
+ }
/* Strings are equal except possibly for case. */
p1 = start1;
p2 = start2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (c1 != c2)
- /* Reverse sign here so upper case comes out last. */
- return c2 - c1;
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (c1 != c2)
+ /* Reverse sign here so upper case comes out last. */
+ return c2 - c1;
+ if (!c1)
+ break;
+ }
return 0;
}
@@ -871,17 +903,17 @@ readline (linebuffer, stream)
{
int c = getc (stream);
if (p == end)
- {
- buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
- p += buffer - linebuffer->buffer;
- end += buffer - linebuffer->buffer;
- linebuffer->buffer = buffer;
- }
+ {
+ buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
+ p += buffer - linebuffer->buffer;
+ end += buffer - linebuffer->buffer;
+ linebuffer->buffer = buffer;
+ }
if (c < 0 || c == '\n')
- {
- *p = 0;
- break;
- }
+ {
+ *p = 0;
+ break;
+ }
*p++ = c;
}
@@ -914,7 +946,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{
- error (_("%s: not a texinfo index file"), infile);
+ error ("%s: not a texinfo index file", infile);
return;
}
@@ -928,34 +960,34 @@ sort_offline (infile, nfiles, total, outfile)
long tempsize = 0;
if (!ostream)
- pfatal_with_name (outname);
+ pfatal_with_name (outname);
tempfiles[i] = outname;
/* Copy lines into this temp file as long as it does not make file
- "too big" or until there are no more lines. */
+ "too big" or until there are no more lines. */
while (tempsize + linelength + 1 <= MAX_IN_CORE_SORT)
- {
- tempsize += linelength + 1;
- fputs (lb.buffer, ostream);
- putc ('\n', ostream);
-
- /* Read another line of input data. */
-
- linelength = readline (&lb, istream);
- if (!linelength && feof (istream))
- break;
-
- if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
- {
- error (_("%s: not a texinfo index file"), infile);
- failure = 1;
- goto fail;
- }
- }
+ {
+ tempsize += linelength + 1;
+ fputs (lb.buffer, ostream);
+ putc ('\n', ostream);
+
+ /* Read another line of input data. */
+
+ linelength = readline (&lb, istream);
+ if (!linelength && feof (istream))
+ break;
+
+ if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
+ {
+ error ("%s: not a texinfo index file", infile);
+ failure = 1;
+ goto fail;
+ }
+ }
fclose (ostream);
if (feof (istream))
- break;
+ break;
}
free (lb.buffer);
@@ -974,7 +1006,7 @@ fail:
char *newtemp = maketempname (++tempcount);
sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
- unlink (tempfiles[i]);
+ unlink (tempfiles[i]);
tempfiles[i] = newtemp;
}
@@ -1009,12 +1041,12 @@ sort_in_core (infile, total, outfile)
int desc = open (infile, O_RDONLY, 0);
if (desc < 0)
- fatal (_("failure reopening %s"), infile);
+ fatal ("failure reopening %s", infile);
for (file_size = 0;;)
{
i = read (desc, data + file_size, total - file_size);
if (i <= 0)
- break;
+ break;
file_size += i;
}
file_data = data;
@@ -1024,7 +1056,7 @@ sort_in_core (infile, total, outfile)
if (file_size > 0 && data[0] != '\\' && data[0] != '@')
{
- error (_("%s: not a texinfo index file"), infile);
+ error ("%s: not a texinfo index file", infile);
return;
}
@@ -1052,7 +1084,7 @@ sort_in_core (infile, total, outfile)
nextline = parsefile (infile, nextline, file_data, file_size);
if (nextline == 0)
{
- error (_("%s: not a texinfo index file"), infile);
+ error ("%s: not a texinfo index file", infile);
return;
}
@@ -1070,18 +1102,18 @@ sort_in_core (infile, total, outfile)
char **p;
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- {
- lp->text = *p;
- lp->key.text = find_field (keyfields, *p, &lp->keylen);
- if (keyfields->numeric)
- lp->key.number = find_value (lp->key.text, lp->keylen);
- }
+ {
+ lp->text = *p;
+ lp->key.text = find_field (keyfields, *p, &lp->keylen);
+ if (keyfields->numeric)
+ lp->key.number = find_value (lp->key.text, lp->keylen);
+ }
qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo),
compare_prepared);
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- *p = lp->text;
+ *p = lp->text;
free (lineinfo);
}
@@ -1094,7 +1126,7 @@ sort_in_core (infile, total, outfile)
{
ostream = fopen (outfile, "w");
if (!ostream)
- pfatal_with_name (outfile);
+ pfatal_with_name (outfile);
}
writelines (linearray, nextline - linearray, ostream);
@@ -1128,21 +1160,21 @@ parsefile (filename, nextline, data, size)
while (p != end)
{
if (p[0] != '\\' && p[0] != '@')
- return 0;
+ return 0;
*line = p;
while (*p && *p != '\n')
- p++;
+ p++;
if (p != end)
- p++;
+ p++;
line++;
if (line == linearray + nlines)
- {
- char **old = linearray;
- linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
- line += linearray - old;
- }
+ {
+ char **old = linearray;
+ linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
+ line += linearray - old;
+ }
}
return line;
@@ -1234,7 +1266,7 @@ indexify (line, ostream)
{
initial = p;
/* Get length of inner pair of braces starting at `p',
- including that inner pair of braces. */
+ including that inner pair of braces. */
initiallength = find_braced_end (p + 1) + 1 - p;
}
else
@@ -1245,7 +1277,7 @@ indexify (line, ostream)
initiallength = 1;
if (initial1[0] >= 'a' && initial1[0] <= 'z')
- initial1[0] -= 040;
+ initial1[0] -= 040;
}
pagenumber = find_braced_pos (line, 1, 0, 0);
@@ -1266,52 +1298,52 @@ indexify (line, ostream)
{
/* Close off current secondary entry first, if one is open. */
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* If this primary has a different initial, include an entry for
- the initial. */
+ the initial. */
if (initiallength != lastinitiallength ||
- strncmp (initial, lastinitial, initiallength))
- {
- fprintf (ostream, "\\initial {");
- fwrite (initial, 1, initiallength, ostream);
- fputs ("}\n", ostream);
- if (initial == initial1)
- {
- lastinitial = lastinitial1;
- *lastinitial1 = *initial1;
- }
- else
- {
- lastinitial = initial;
- }
- lastinitiallength = initiallength;
- }
+ strncmp (initial, lastinitial, initiallength))
+ {
+ fprintf (ostream, "\\initial {");
+ fwrite (initial, 1, initiallength, ostream);
+ fprintf (ostream, "}\n", initial);
+ if (initial == initial1)
+ {
+ lastinitial = lastinitial1;
+ *lastinitial1 = *initial1;
+ }
+ else
+ {
+ lastinitial = initial;
+ }
+ lastinitiallength = initiallength;
+ }
/* Make the entry for the primary. */
if (nosecondary)
- fputs ("\\entry {", ostream);
+ fputs ("\\entry {", ostream);
else
- fputs ("\\primary {", ostream);
+ fputs ("\\primary {", ostream);
fwrite (primary, primarylength, 1, ostream);
if (nosecondary)
- {
- fputs ("}{", ostream);
- pending = 1;
- }
+ {
+ fputs ("}{", ostream);
+ pending = 1;
+ }
else
- fputs ("}\n", ostream);
+ fputs ("}\n", ostream);
/* Record name of most recent primary. */
if (lastprimarylength < primarylength)
- {
- lastprimarylength = primarylength + 100;
- lastprimary = (char *) xrealloc (lastprimary,
- 1 + lastprimarylength);
- }
+ {
+ lastprimarylength = primarylength + 100;
+ lastprimary = (char *) xrealloc (lastprimary,
+ 1 + lastprimarylength);
+ }
strncpy (lastprimary, primary, primarylength);
lastprimary[primarylength] = 0;
@@ -1322,16 +1354,16 @@ indexify (line, ostream)
/* Should not have an entry with no subtopic following one with a subtopic. */
if (nosecondary && *lastsecondary)
- error (_("entry %s follows an entry with a secondary name"), line);
+ error ("entry %s follows an entry with a secondary name", line);
/* Start a new secondary entry if necessary. */
if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength))
{
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* Write the entry for the secondary. */
fputs ("\\secondary {", ostream);
@@ -1341,18 +1373,18 @@ indexify (line, ostream)
/* Record name of most recent secondary. */
if (lastsecondarylength < secondarylength)
- {
- lastsecondarylength = secondarylength + 100;
- lastsecondary = (char *) xrealloc (lastsecondary,
- 1 + lastsecondarylength);
- }
+ {
+ lastsecondarylength = secondarylength + 100;
+ lastsecondary = (char *) xrealloc (lastsecondary,
+ 1 + lastsecondarylength);
+ }
strncpy (lastsecondary, secondary, secondarylength);
lastsecondary[secondarylength] = 0;
}
/* Here to add one more page number to the current entry. */
if (pending++ != 1)
- fputs (", ", ostream); /* Punctuate first, if this is not the first. */
+ fputs (", ", ostream); /* Punctuate first, if this is not the first. */
fwrite (pagenumber, pagelength, 1, ostream);
}
@@ -1390,16 +1422,16 @@ writelines (linearray, nlines, ostream)
if (next_line == linearray
/* Compare previous line with this one, using only the
explicitly specd keyfields. */
- || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
- {
- char *p = *next_line;
- char c;
-
- while ((c = *p++) && c != '\n')
- /* Do nothing. */ ;
- *(p - 1) = 0;
- indexify (*next_line, ostream);
- }
+ || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
+ {
+ char *p = *next_line;
+ char c;
+
+ while ((c = *p++) && c != '\n')
+ /* Do nothing. */ ;
+ *(p - 1) = 0;
+ indexify (*next_line, ostream);
+ }
}
finish_index (ostream);
@@ -1438,7 +1470,7 @@ merge_files (infiles, nfiles, outfile)
{
int nf = MAX_DIRECT_MERGE;
if (i + 1 == ntemps)
- nf = nfiles - i * MAX_DIRECT_MERGE;
+ nf = nfiles - i * MAX_DIRECT_MERGE;
tempfiles[i] = maketempname (++tempcount);
value |= merge_direct (&infiles[i * MAX_DIRECT_MERGE], nf, tempfiles[i]);
}
@@ -1493,7 +1525,7 @@ merge_direct (infiles, nfiles, outfile)
if (nfiles == 0)
{
if (outfile)
- fclose (ostream);
+ fclose (ostream);
return 0;
}
@@ -1535,7 +1567,7 @@ merge_direct (infiles, nfiles, outfile)
file_lossage[i] = 0;
streams[i] = fopen (infiles[i], "r");
if (!streams[i])
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
readline (thisline[i], streams[i]);
}
@@ -1553,48 +1585,48 @@ merge_direct (infiles, nfiles, outfile)
/* Look at the next avail line of each file; choose the least one. */
for (i = 0; i < nfiles; i++)
- {
- if (thisline[i] &&
- (!best ||
- 0 < compare_general (best->buffer, thisline[i]->buffer,
- (long) bestfile, (long) i, num_keyfields)))
- {
- best = thisline[i];
- bestfile = i;
- }
- }
+ {
+ if (thisline[i] &&
+ (!best ||
+ 0 < compare_general (best->buffer, thisline[i]->buffer,
+ (long) bestfile, (long) i, num_keyfields)))
+ {
+ best = thisline[i];
+ bestfile = i;
+ }
+ }
/* Output that line, unless it matches the previous one and we
- don't want duplicates. */
+ don't want duplicates. */
if (!(prev_out &&
- !compare_general (prev_out->buffer,
- best->buffer, 0L, 1L, num_keyfields - 1)))
- indexify (best->buffer, ostream);
+ !compare_general (prev_out->buffer,
+ best->buffer, 0L, 1L, num_keyfields - 1)))
+ indexify (best->buffer, ostream);
prev_out = best;
/* Now make the line the previous of its file, and fetch a new
- line from that file. */
+ line from that file. */
exch = prevline[bestfile];
prevline[bestfile] = thisline[bestfile];
thisline[bestfile] = exch;
while (1)
- {
- /* If the file has no more, mark it empty. */
-
- if (feof (streams[bestfile]))
- {
- thisline[bestfile] = 0;
- /* Update the number of files still not empty. */
- nleft--;
- break;
- }
- readline (thisline[bestfile], streams[bestfile]);
- if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
- break;
- }
+ {
+ /* If the file has no more, mark it empty. */
+
+ if (feof (streams[bestfile]))
+ {
+ thisline[bestfile] = 0;
+ /* Update the number of files still not empty. */
+ nleft--;
+ break;
+ }
+ readline (thisline[bestfile], streams[bestfile]);
+ if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
+ break;
+ }
}
finish_index (ostream);
@@ -1660,7 +1692,7 @@ pfatal_with_name (name)
s = strerror (errno);
printf ("%s: ", program_name);
- printf (_("%s; for file `%s'.\n"), s, name);
+ printf ("%s; for file `%s'.\n", s, name);
exit (TI_FATAL_ERROR);
}
@@ -1713,21 +1745,6 @@ strrchr (string, character)
}
#endif /* HAVE_STRCHR */
-void
-memory_error (callers_name, bytes_wanted)
- char *callers_name;
- int bytes_wanted;
-{
- char printable_string[80];
-
- sprintf (printable_string,
- _("Virtual memory exhausted in %s ()! Needed %d bytes."),
- callers_name, bytes_wanted);
-
- error (printable_string);
- abort ();
-}
-
/* Just like malloc, but kills the program in case of fatal error. */
void *
xmalloc (nbytes)
@@ -1759,3 +1776,18 @@ xrealloc (pointer, nbytes)
return (temp);
}
+
+memory_error (callers_name, bytes_wanted)
+ char *callers_name;
+ int bytes_wanted;
+{
+ char printable_string[80];
+
+ sprintf (printable_string,
+ "Virtual memory exhausted in %s ()! Needed %d bytes.",
+ callers_name, bytes_wanted);
+
+ error (printable_string);
+ abort ();
+}
+
diff --git a/contrib/texinfo/util/update-info b/contrib/texinfo/util/update-info
deleted file mode 100755
index 0d31fde4d27b..000000000000
--- a/contrib/texinfo/util/update-info
+++ /dev/null
@@ -1,875 +0,0 @@
-#!/bin/sh
-# update-info -- update dir file from all extant info pages.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can either send email to this
-# program's maintainer or write to: The Free Software Foundation,
-# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-#
-# Author: rhawes@dmapub.dma.org. Please report bugs to him.
-#
-# run this program to install update-info
-# ###SECTION 0### install script
-# These constants set the version numbers for both files:
-PROGRAM_VERSION="1.4"
-PACKAGE_VERSION="4.0"
-
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-
-TMP_SED="$TMPDIR/uss$$.info"
-TMP_F_ADD_SECTION="$TMPDIR/ufa$$.info"
-TMP_F_DELETE_INVALID="$TMPDIR/ufd$$.info"
-TMP_F_INSERT_MISSING="$TMPDIR/ufi$$.info"
-TMP_FILES="$TMP_SED $TMP_F_ADD_SECTION $TMP_F_DELETE_INVALID\
- $TMP_F_INSERT_MISSING"
-
-trap 'rm -f $TMP_FILES' 0
-
-# file boundaries
-UPDATE_INFO="/^# _file: 'update-info'_/"
-UPDATE_INFO_F="/^# _file: 'update-info.f'_/"
-
-# @F_ADD_SECTION@
-echo 'Item_Num=`expr "$Item_Num" + "1"`
-echo "$1">>"$TMP_SECTIONS"
-if test "$Item_Status"; then
- Item_Status=`echo "${Item_Status}
-X"`
-else
- Item_Status="X"
-fi '>$TMP_F_ADD_SECTION
-
-# @F_INSERT_MISSING@
-echo 'if test -z "$Create_Node"; then
- rm -f ${Info_Node}.old
- cp $Info_Node ${Info_Node}.old
- echo "$BACKUP_MSG"
-fi
-echo "/$MENU_BEGIN/
-+,$ d
-r $TMP_MENU
-w
-q"|ed -s $Info_Node>/dev/null'>$TMP_F_INSERT_MISSING
-
-# @F_DELETE_INVALID@
-echo '
-rm -f ${Info_Node}.old
-cp $Info_Node ${Info_Node}.old
-echo "$BACKUP_MSG"
-echo "/$MENU_BEGIN/
-+,$ d
-w
-q"|ed -s $Info_Node>/dev/null
-sed -f "$TMP_SED" "$TMP_MENU">>"$Info_Node"'>$TMP_F_DELETE_INVALID
-
-cat<<Sed_Script_EOF>$TMP_SED
-s/@UPDATE_INFO_VERSION@/$PROGRAM_VERSION/g
-s/@TEXINFO_VERSION@/$PACKAGE_VERSION/g
-s/@SET_ITEM@/Item_Status=\`echo "\$Item_Status"|sed -e "\${1}s%^.*%\${2}%"\`/
-/@F_ADD_SECTION@/r $TMP_F_ADD_SECTION
-/@F_ADD_SECTION@/d
-/@F_DELETE_INVALID@/r $TMP_F_DELETE_INVALID
-/@F_DELETE_INVALID@/d
-/@F_INSERT_MISSING@/r $TMP_F_INSERT_MISSING
-/@F_INSERT_MISSING@/d
-Sed_Script_EOF
-
-sed -e "1,${UPDATE_INFO}d" -e "$UPDATE_INFO_F,\$d" -f $TMP_SED $0>update-info
-sed -e "1,${UPDATE_INFO_F}d" -f $TMP_SED $0>update-info.f
-chmod +x update-info update-info.f
-echo "installed update-info, and update-info.f into `pwd`"
-rm -f $TMP_FILES
-exit
-
-# _file: 'update-info'_
-#!/bin/sh
-#update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# ###SECTION 1### Constants
-set -h 2>/dev/null
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-if test -z "$LINES"; then
- LINES=24
-fi
-if test -z "$COLUMNS"; then
- COLUMNS=80
-fi
-if test -z "$EDITOR"; then
- EDITOR=vi
-fi
-if test -z "$LINENO"; then
- LINENO="0"
-fi
-# constants redefined by update-info.f
-PROMPT1="(y=yes, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS=""
-#
-ARGUMENTS="$*"
-DISPLAY_NUM=`expr "$LINES" - 4`
-CONTROL_D="{Ctrl-D}"
-DIR_SECTION="^INFO-DIR-SECTION"
-ENTRY_END="^END-INFO-DIR-ENTRY"
-ENTRY_START="^START-INFO-DIR-ENTRY"
-MENU_BEGIN='^\*\([ ]\)\{1,\}Menu:'
-MENU_ITEM='^\* ([^ ]).*:([ ])+\('
-SECTION_TITLE="^[A-Za-z0-9]"
-MENU_FILTER1='s/^\*\([ ]\)\{1,\}/* /'
-MENU_FILTER2='s/\([ ]\)\{1,\}$//g'
-TMP_ITEM="${TMPDIR}/ui${$}.info"
-TMP_LIST="${TMPDIR}/ul${$}.info"
-TMP_MENU="${TMPDIR}/um${$}.info"
-TMP_SECTIONS="${TMPDIR}/us${$}.info" # used only in Detect_Missing
-TMP_SED="$TMP_SECTIONS" # used only in Detect_Invalid routines
-TMP_FILE1="${TMPDIR}/ux${$}.info"
-TMP_FILE2="${TMPDIR}/uy${$}.info"
-TMP_COUNT="$TMP_FILE2"
-TMP_FILE_LIST="$TMP_LIST $TMP_MENU $TMP_SECTIONS $TMP_FILE1 $TMP_FILE2\
- $TMP_ITEM"
-TRY_HELP_MSG="Try --help for more information"
-if zcat --version 2>/dev/null>/dev/null; then
- CAT_COMMAND="zcat -f"
-else
- echo "$0:$LINENO: GNU zcat not found">&2
- CAT_COMMAND="cat"
-fi
-
-# ###SECTION 100### main program
-#variables set by options
-Create_Node=""
-Debug=":"
-Interactive=""
-Load_Functions="y"
-Mode=""
-#
-Inserts="0"
-Inserts_Total="0"
-Invalid="0"
-Invalid_Total="0"
-Changed=""
-
-while test "$*"
- do
- case "$1" in
- -c) Create_Node="y";;
- -ci|-ic) Create_Node="y"; Interactive="y";;
- -cif|-cfi|-ifc|-icf|-fci|-fic) Create_Node="y"
- Interactive="y"; Load_Functions="";;
- --debug) set -eux; Debug="set>&2";;
- -d|--delete) Mode="Detect_Invalid";;
- -f) Load_Functions="";;
- -i|--interactive) Interactive="y";;
- -fi|-if) Load_Functions=""; Interactive="y";;
- -id|-di) Mode="Detect_Invalid"; Interactive="y";;
- +i|+d|+f);;
- --version)
-cat<<VersionEOF
-update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-Copyright (C) 1997 Free Software Foundation, Inc.
-update-info comes with NO WARRANTY, to the extent permitted by law.
-You may redistribute copies of update-info
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING.
-Author: Richard L. Hawes
-VersionEOF
- exit;;
-
- --help)
-cat<<HelpEndOfFile
-Usage: update-info [OPTION]... INFO_PATH/INFO_DIR_FILE
-
-It detects and inserts missing menu items into the info node file.
-
-Options:
--c create a new info node
- --debug print debug information to standard error path
--d, --delete delete invalid menu items (ignore missing menu items)
--f do not load functions (file update-info.f)
- --help print this help message and exit
--i, --interactive interactive mode prompts before inserting or removing
- menu items
- --version print current version and exit
-Backup of the info node has a '.old' suffix added. This is a shell script.
-Files: update-info.f -- contains functions (optional).
-Environment Variables: COLUMNS, EDITOR, LINES, TMPDIR
-Email bug reports to bug-texinfo@gnu.org.
-HelpEndOfFile
- exit;;
-
- [-+]*) echo "$0:$LINENO: \"$1\" is not a valid option">&2
- echo "$TRY_HELP_MSG">&2
- exit 2;;
- *) break;;
- esac
- shift
- done
-
-if test "$#" -lt "1"; then
- echo "$0:$LINENO: Too few parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-elif test "$#" -gt "1"; then
- echo "$0:$LINENO: Too many parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-fi
-Info_Path="$1"
-Info_Node=`basename "$Info_Path"`
-if echo "$Info_Node"|grep ".*dir$">/dev/null; then
- :
-else
- echo "$0:$LINENO: $Info_Node is not a valid info node name">&2
- exit 2
-fi
-Info_Pathname=`dirname "$Info_Path"`
-cd "$Info_Pathname"||exit
-
-BACKUP_MSG="Backed up $Info_Node to ${Info_Node}.old."
-HANGUP_MSG="Hang up on \"update-info $ARGUMENTS\""
-INSERT_MSG="menu item(s) were inserted (not counting duplicates)."
-INSERT_MSG2="total menu item(s) were inserted into `pwd`/$Info_Node"
-DELETE_MSG="invalid menu item(s) were removed (not counting duplicates)."
-DELETE_MSG2="total invalid menu item(s) were removed from `pwd`/$Info_Node"
-
-if test "$Create_Node"; then
- if test "$Mode"; then
- echo "$0:$LINENO: ERROR: Illogical option combination: -d -c">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
- fi
- if test -f "$Info_Node"; then
- rm -f ${Info_Node}.old
- mv "$Info_Node" "${Info_Node}.old"
- echo "$BACKUP_MSG"
- fi
- echo "Creating new Info Node: `pwd`/$Info_Node"
-cat>$Info_Node<<NodeEndOfFile||exit
-
-This is the file .../info/dir, which contains the topmost node of the
-Info hierarchy. The first time you invoke Info you start off
-looking at that node, which is (dir)Top.
-
-File: dir Node: Top This is the top of the INFO tree
- This (the Directory node) gives a menu of major topics.
- Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
- gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
- etc.
- Or click mouse button 2 on a menu item or cross reference to select it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
-
-* Menu: The list of major topics begins on the next line.
-
-NodeEndOfFile
-else
- if test ! -f "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is irregular or nonexistant">&2
- exit 2
- elif test ! -r "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not readable">&2
- exit 2
- elif test ! -w "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not writeable">&2
- exit 2
- fi
-fi
-
-if test "$Load_Functions" -a "$Interactive" -a -z "$Mode"; then
- if FUNCTIONS_VERSION=`( update-info.f )`; then
- if test `echo "$FUNCTIONS_VERSION"\
- |cut -d' ' -f5` = "@UPDATE_INFO_VERSION@"; then
- echo "Loading functions..."
- . update-info.f
- else
- echo "$0:$LINENO: wrong version of update-info.f">&2
- echo "(functions were not loaded)">&2
- fi
- else
- echo "(functions were not loaded)">&2
- fi
-fi
-
-
-trap ' eval "$Debug"; rm -f $TMP_FILE_LIST; exit ' 0
-if test "$Interactive"; then
- if test ! -t "1"; then
- echo "$0:$LINENO: Cannot run in interactive mode "\
- "standard out is redirected">&2
- exit 2
- fi
- trap ' ' 2 3
-else
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received INT signal. All edits are canceled.">&2
- exit ' 2
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received QUIT signal. All edits are canceled.">&2
- exit ' 3
-fi
-if test -z "$Mode"; then
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"`
- echo $Inserts_Total $INSERT_MSG2
- }|mail "$LOGNAME"
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-else
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_DELETE_INVALID@
- Invalid_Total=`wc -l<"$TMP_SED"`
- echo $Invalid_Total $DELETE_MSG2
- }|mail $LOGNAME
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-fi
-
-sed -e "1,/$MENU_BEGIN/d" -e "$MENU_FILTER1" -e "$MENU_FILTER2"<$Info_Node\
-|tee $TMP_MENU\
-|sed -n -e '/\* /{
-s/).*$//g
-s/\.gz$//
-s/\.info$//
-s/^.*(//p
-}'|sort -u>$TMP_FILE1
-ls -F|sed -e '/\/$/d' -e '/[-.][0-9]/d'\
- -e '/:$/d' -e '/^$/d' -e "/^${Info_Node}~\$/d"\
- -e "/^${Info_Node}\$/d" -e "/^${Info_Node}.old\$/d"\
- -e 's/\.gz$//' -e 's/\.info$//'|sort>$TMP_FILE2
-
-if test -z "$Mode"; then
- #Detect Missing
- comm -13 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- cat</dev/null>$TMP_COUNT
- #get sections, initialize variables
- sed -n -e "/$SECTION_TITLE/p" "$TMP_MENU">"$TMP_SECTIONS"
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- Item_Status=`echo\
- |awk "BEGIN{for(i=1;i<=${Item_Num};i++)printf(\"_\n\")}"`
- Item_Dir="$Item_Num"
- for Info_Name in `cat $TMP_LIST`
- do
- if test -r "$Info_Name"; then
- Info_File="$Info_Name"
- elif test -r "${Info_Name}.info"; then
- Info_File="${Info_Name}.info"
- elif test -r "${Info_Name}.gz"; then
- Info_File="${Info_Name}.gz"
- elif test -r "${Info_Name}.info.gz"; then
- Info_File="${Info_Name}.info.gz"
- else
- echo "$0:$LINENO: can't find info file for ${Info_Name}?">&2
- fi
- #generate menu item
- echo|tr -d '\012'>$TMP_FILE1
- eval $CAT_COMMAND "$Info_File"\
- |sed -n -e "/$DIR_SECTION/w $TMP_FILE1"\
- -e "/$ENTRY_START/,/$ENTRY_END/{
- $MENU_FILTER1
- p
- }"|awk "BEGIN{Mode=0}
- /^$/{if(Mode==1)exit}
- /^([ ])+([^ ])+/{if(Mode==1)print}
- /^[^ ]/{if(Mode==1)exit}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==0){Mode++
- print}
- else
- exit}">"$TMP_ITEM"
- if test ! -s "$TMP_ITEM"; then
- echo "* $Info_Name: ($Info_Name).">"$TMP_ITEM"
- fi
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- if test -s "$TMP_FILE1"; then
- Item_Section=`sed -e "s/$DIR_SECTION[ ]*//"\
- <$TMP_FILE1`
- else
- Item_Section=`echo "Miscellaneous"`
- fi
- Size=`echo "$Item_Section"|wc -l|tr -d ' '`
- # initialize variables, check for new sections
- Num1=1
- while test "$Num1" -le "$Size"
- do
- Item=`echo "$Item_Section"|sed -n -e "${Num1}p"`
- if Num=`grep -in "^$Item$" "$TMP_SECTIONS"`; then
- Num=`echo "$Num"|sed -e 's/:.*$//g'`
- ##F#Set_Item
- set "$Num" "X"
- @SET_ITEM@
- else
- set "$Item"
- @F_ADD_SECTION@
- fi
- Num1=`expr "$Num1" + "1"`
- done
- if test "$Interactive"; then
- echo "$Item_Section"
- cat "$TMP_ITEM"
- echo "add menu item for $Info_File? "
- while true
- do
- echo "$PROMPT1"|tr -d '\012'
- read Answer
- case $Answer in
- y) break;;
- e)
- if test "$FUNCTIONS"; then
- Select_Sections
- break
- else
- echo "Can't edit. "\
- "Functions are not loaded.">&2
- fi;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid response">&2;;
- esac
- done
- fi
- if echo "$Item_Status"|grep '^X'>/dev/null; then
- # edit $TMP_MENU
-
- Changed="y"
- (
- trap ' ' 1 2 3
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- Key=`awk -F':' ' FNR==1{ print $1}' $TMP_ITEM`
- # add new sections to 'dir' file
- if test "$Item_Num" -gt "$Item_Dir"; then
- if test "$Item_Dir" -ne "0"; then
- sed -e "1,${Item_Dir}d" -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- else
- sed -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- fi
- fi
- # awk determines the insertion points for each section
- awk -F":" "function Insert(Line){
- if(Mode==2){
- Mode=1;if(substr(\"$Tmp_Var\",Item++,1)==\"X\")
- print Line
- }
- }
- BEGIN{Mode=1;Item=1}
- /$SECTION_TITLE/{Insert(FNR-1);if(Mode>=1)Mode=2}
- /${MENU_ITEM}.*\)\./{if(\$1>Item_Name)Insert(FNR-1)}
- /^$/{Insert(FNR-1)}
- END{Insert(FNR)}" Item_Name="$Key" "$TMP_MENU"\
- |sort -nr|sed -e "s%\$% r $TMP_ITEM%"|sed -e '$a\
-w
-' -e '$a\
-q
-'|ed -s "$TMP_MENU"
- echo "$Item_Status"|tr -cd "X">>$TMP_COUNT
- )
-
- Inserts=`expr "$Inserts" + "1"`
- echo "$Info_File installed into section(s):"\
- |tr -d '\012'
- echo "$Item_Status"|awk '/X/{printf(" %d", FNR)}'
- echo
- Item_Dir="$Item_Num"
- else
- echo "$Info_File not installed (no section selected)"
- fi
- done
- # print summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"|tr -d " "`
- if test "$Inserts" -ne "$Inserts_Total"; then
- echo "$Inserts $INSERT_MSG"
- fi
- echo "$Inserts_Total $INSERT_MSG2"
- fi
-else
- # Detect Invalid
- cat</dev/null>"$TMP_SED"
- comm -23 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- for Info_Name in `cat $TMP_LIST`
- do
- if test "$Interactive"; then
- # display invalid menu item(s)
- awk "BEGIN{Mode=1}
- /^([ ])+([^ ])+/{if(Mode==2)print}
- /^$/{if(Mode==2)Mode=1}
- /$SECTION_TITLE/{Section=\$0}
- /^[^ ]/{if(Mode==2)Mode=1}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){Mode++
- print Section
- print}}" $TMP_MENU
- echo "delete menu item for $Info_Name? "
- while true
- do
- echo\
- "(y=yes, n=no, Y=yes to all, N=No to all):"\
- |tr -d '\012'
- read Answer
- case "$Answer" in
- y) break;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid reponse">&2;;
- esac
- done
- fi
- # remove menu item from $TMP_MENU
- Invalid=`expr "$Invalid" + "1"`
- Changed="y"
- (
- trap ' ' 1 2 3
- echo\
- "invalid menu item for $Info_Name removed from section(s):"\
- |tr -d '\012'
- awk "function Delete(Last){
- printf(\"%d,%dd\n\",First,Last-1)>>\"$TMP_SED\"}
- BEGIN{Mode=1;Section=0}
- /^$/{if(Mode==2){Delete(FNR);Mode=1}}
- /$SECTION_TITLE/{Section++}
- /^[^ ]/{if(Mode==2){Delete(FNR);Mode=1}}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){
- First=FNR;printf(\" %d\",Section);Mode=2}}
- END{if(Mode==2)Delete(FNR+1)}" $TMP_MENU
- echo
- )
- done
-
- # display a summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- Invalid_Total=`wc -l<"$TMP_SED"|tr -d ' '`
- @F_DELETE_INVALID@
- if test "$Invalid" -ne "$Invalid_Total"; then
- echo "$Invalid $DELETE_MSG"
- fi
- echo "$Invalid_Total $DELETE_MSG2"
- fi
-fi
-if test -z "$Changed"; then
- echo "Nothing to do"
-fi
-rm -f $TMP_FILE_LIST
-eval "$Debug"
-exit 0
-# _file: 'update-info.f'_
-#update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# update-info.f functions for update-info
-
-# ###SECTION 1### functions used to insert missing menu items
-
-Set_Item (){
-# set item status
-@SET_ITEM@
-}
-
-Add_Section (){
-# add a section
-@F_ADD_SECTION@
-}
-
-# ###SECTION 2### functions for menu selection of sections
-
-Print (){
-# print a line without a linefeed
-echo "$*"|tr -d '\012'
-}
-
-Get_Answer (){
-# get an answer to question
-_gs_Valid="$1"
-_gs_Prompt="$2"
-set -f
-Answer=""
-while test -z "$Answer"
- do
- Print "$_gs_Prompt"
- if read Answer; then
- :
- else
- Answer="$CONTROL_D"
- echo
- fi
- if expr "$Answer" : "[$_gs_Valid]$">/dev/null; then
- :
- else
- Print "\"$Answer\" is not a valid response! --">&2
- Answer=""
- fi
- done
-set +f
-}
-
-Do_Previous (){
-# go to previous screen
-if test "$Previous"; then
- Next="$Top_Item"
- Top_Item="$Previous"
- if Previous=`expr "$Top_Item" - "$DISPLAY_NUM"`; then
- if test "$Previous" -le "0"; then
- Previous=""
- fi
- else
- Previous=""
- fi
-elif test "$Next"; then
- Last_Page
-else
- Print "There is no previous page. ">&2
-fi
-}
-
-Do_Next (){
-# process go to next
-if test "$Next"; then
- Previous="$Top_Item"
- Top_Item="$Next"
- Set_Next
-elif test "$Previous"; then
- Top_Item="1"
- Previous=""
- Set_Next
-else
- Print "There is no next page. ">&2
-fi
-}
-
-Do_Add_Section (){
-# process add section command
-echo
-echo "Please enter the name of the new section:"
-if read Answer; then
- Answer=`echo "$Answer"\
- |sed -e 's/^\([ ]\)\{1,\}//g' -e "$MENU_FILTER2"`
- if test "$Answer"; then
- Add_Section "$Answer"
- Last_Page
- clear
- fi
-else
- Answer=""
-fi
-if test -z "$Answer"; then
- clear
- Print "no section added. "
-fi
-}
-
-Do_Edit (){
-# process edit item command
-if test -t "2"; then
- _de_Done=""
- cp "$TMP_ITEM" "$TMP_FILE1"
- while test -z "$_de_Done"
- do
- eval $EDITOR "$TMP_FILE1"
- clear
- _de_Done="t"
- if sed -n -e "$MENU_FILTER1" -e '1p' "$TMP_FILE1"\
- |egrep "${MENU_ITEM}${Info_Name}\)\.">/dev/null; then
- :
- else
- sed -n -e '1p' "$TMP_FILE1"
- echo "Pattern mismatch: `echo\
- "/${MENU_ITEM}${Info_Name}\)\./"\
- |tr -d "\011"`">&2
- echo
- _de_Done=""
- fi
- if sed -n -e '2,$p' "$TMP_FILE1"|grep '^[^ ]'>&2; then
- echo "These lines must have leading spaces">&2
- echo
- _de_Done=""
- fi
- if test -z "$_de_Done"; then
- Get_Answer "yn" "Invalid entry, cancel edits? (y or n):"
- if test "y" = "$Answer"; then
- clear
- Print "Canceling edits -- invalid entry ">&2
- _de_Done="t"
- fi
- else
- sed -e "$MENU_FILTER1" -e "$MENU_FILTER2" -e '/^$/d'\
- <"$TMP_FILE1">"$TMP_ITEM"
- fi
- done
-else
- Print "editor cannot run with error path redirected "
-fi
-}
-
-Do_Number (){
-# process number
-_dn_Num="$1"
-if test "$_dn_Num" -ge 1 -a "$_dn_Num" -le "$Item_Num"; then
- if test `echo "$Item_Status"|sed -n -e "${_dn_Num}p"` = "_"; then
- Set_Item "$_dn_Num" "X"
- else
- Set_Item "$_dn_Num" "_"
- fi
-else
- Print "\"$_dn_Num\" is an invalid section number. ">&2
-fi
-}
-
-Do_Help (){
-# process menu help
-echo
-echo "\
-Enter the following commands seperated
-by spaces and terminated by<ENTER>:
-# : (section number) toggle section
-a : add a new section
-e : edit item -- changes will not be
- accepted if you change the
- '(info_file_name).' or delete
- the key parts: '*' 'Menu Name' ':'
-h : get this help screen
-n : next page
-p : previous page
-q : quit and do not put into menu
-s : save and put into menu"
-Print "Press enter to continue:"
-read junk
-clear
-}
-
-Set_Next (){
-# determine value of Next
-Next=`expr "$DISPLAY_NUM" + "$Top_Item"`
-if test "$Next" -gt "$Item_Num"; then
- Next=""
-fi
-}
-
-Last_Page (){
-# go to last page of menu
-Top_Item=`echo|awk "BEGIN{printf(\"%d\",
-int((${Item_Num}-1)/${DISPLAY_NUM})*${DISPLAY_NUM}+1)}"`
-if test "$Top_Item" -gt "$DISPLAY_NUM"; then
- Previous=`expr "$Top_Item" '-' "$DISPLAY_NUM"`
-else
- Previous=""
-fi
-Set_Next
-}
-
-Select_Sections (){
-# prompt user for which sections
-set -f
-Top_Item="1"
-Previous=""
-Set_Next
-clear
-echo "Default sections are selected."
-Done=""
-while test -z "$Done"
- do
- awk "FNR==1{printf(\"%s\n\", substr(\$0,1,${COLUMNS}))}" $TMP_ITEM
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- awk "BEGIN{Max=$Top_Item+$DISPLAY_NUM}
- FNR>=$Top_Item{if(FNR>=Max)exit
- printf(\"%2d:%s %s\n\",FNR,substr(\"$Tmp_Var\",FNR,1),
- substr(\$0,1,${COLUMNS}-5))}" "$TMP_SECTIONS"
- echo "Enter 1-${Item_Num}, add, edit, help,"
- if test "$Previous" -o "$Next"; then
- Print "next, previous, "
- fi
- Print "quit, save :"
- read Command_List||Command_List="$CONTROL_D"
- Command_List=`echo "$Command_List"\
- |tr '\011' ' '|tr ' ' '\012'|sed -e "/^$/d"`
- clear
- if test -z "$Command_List"; then
- Help="y"
- else
- Help=""
- fi
- while test "$Command_List"
- do
- Command=`echo "$Command_List"|sed -n -e '1p'`
- Command_List=`echo "$Command_List"|sed -e '1d'`
- case "$Command" in
- [0-9]|[0-9][0-9]) Do_Number "$Command";;
- n*) Do_Next;;
- p*) Do_Previous;;
- a*) Do_Add_Section;;
- e*) Do_Edit; break;;
- h*) Help="y";;
- s*) Done="s"; break;;
- q*) Done="q"
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- break;;
- *) Print "$Command is not a valid command. ">&2
- Help="y";;
- esac
- done
- if test "$Help"; then
- Do_Help
- fi
- echo
- done
-set +f
-# if new sections added, remove unused ones
-if test "$Item_Num" -gt "$Item_Dir"; then
- Tmp_Var=`echo "$Item_Status"|awk "FNR>$Item_Dir{
- if(\\$0==\"_\")printf(\"%d\n\", FNR)}"`
- if test "$Tmp_Var"; then
- Tmp_Var1=`echo "$Tmp_Var"|sed -e 's/$/d/'`
- sed -e "$Tmp_Var1" "$TMP_SECTIONS">$TMP_FILE1
- cp $TMP_FILE1 "$TMP_SECTIONS"
- Item_Status=`echo "$Item_Status"|sed -e "$Tmp_Var1"`
- Tmp_Var=""
- Tmp_Var1=""
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- fi
-fi
-}
-
-# ###SECTION 100### Constants that redefine
-PROMPT1="(y=yes, e=edit, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS="y"
-#
-echo "update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@"
diff --git a/contrib/top/display.c b/contrib/top/display.c
index 09c5d643227e..6b3a5f488bc8 100644
--- a/contrib/top/display.c
+++ b/contrib/top/display.c
@@ -29,7 +29,6 @@
#include "os.h"
#include <ctype.h>
#include <time.h>
-#include <sys/time.h>
#include "screen.h" /* interface to screen package */
#include "layout.h" /* defines for screen position layout */
@@ -1169,38 +1168,3 @@ char *str;
}
return(str);
}
-
-i_uptime(bt, tod)
-
-struct timeval* bt;
-time_t *tod;
-
-{
- time_t uptime;
- int days, hrs, mins, secs;
-
- if (bt->tv_sec != -1) {
- uptime = *tod - bt->tv_sec;
- uptime += 30;
- days = uptime / 86400;
- uptime %= 86400;
- hrs = uptime / 3600;
- uptime %= 3600;
- mins = uptime / 60;
- secs = uptime % 60;
-
- /*
- * Display the uptime.
- */
-
- if (smart_terminal)
- {
- Move_to((screen_width - 24) - (days > 9 ? 1 : 0), 0);
- }
- else
- {
- fputs(" ", stdout);
- }
- printf(" up %d+%02d:%02d:%02d", days, hrs, mins, secs);
- }
-}
diff --git a/contrib/top/loadavg.h b/contrib/top/loadavg.h
index e3c156cc12b7..f49541e7d907 100644
--- a/contrib/top/loadavg.h
+++ b/contrib/top/loadavg.h
@@ -47,7 +47,7 @@ typedef double pctcpu;
#endif
#ifdef FIXED_LOADAVG
- typedef fixpt_t load_avg;
+ typedef long load_avg;
# define loaddouble(la) ((double)(la) / FIXED_LOADAVG)
# define intload(i) ((int)((i) * FIXED_LOADAVG))
#else
diff --git a/contrib/top/machine.h b/contrib/top/machine.h
index 0f14bf386563..0a9953f2beec 100644
--- a/contrib/top/machine.h
+++ b/contrib/top/machine.h
@@ -32,7 +32,6 @@ struct system_info
int *cpustates;
int *memory;
int *swap;
- struct timeval boottime;
};
/* cpu_states is an array of percentages * 10. For example,
diff --git a/contrib/top/top.c b/contrib/top/top.c
index 51cd3f04c48c..ef4b96373bba 100644
--- a/contrib/top/top.c
+++ b/contrib/top/top.c
@@ -549,7 +549,6 @@ Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n",
/* display the current time */
/* this method of getting the time SHOULD be fairly portable */
time(&curr_time);
- i_uptime(&system_info.boottime, &curr_time);
i_timeofday(&curr_time);
/* display process state breakdown */
diff --git a/crypto/telnet/libtelnet/getent.c b/crypto/telnet/libtelnet/getent.c
index 5aa1049a3c8d..05626f11d413 100644
--- a/crypto/telnet/libtelnet/getent.c
+++ b/crypto/telnet/libtelnet/getent.c
@@ -55,7 +55,7 @@ char *cp, *name;
#ifndef SOLARIS
/*ARGSUSED*/
char *
-Getstr(id, cpp)
+getstr(id, cpp)
char *id, **cpp;
{
# ifdef HAS_CGETENT
diff --git a/crypto/telnet/telnetd/telnetd.c b/crypto/telnet/telnetd/telnetd.c
index acbf3a840dd2..f6eb9fb0fdb7 100644
--- a/crypto/telnet/telnetd/telnetd.c
+++ b/crypto/telnet/telnetd/telnetd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
#endif
static const char rcsid[] =
- "$Id: telnetd.c,v 1.4 1998/02/16 12:09:27 markm Exp $";
+ "$Id$";
#endif /* not lint */
#include "telnetd.h"
@@ -1135,12 +1135,12 @@ telnet(f, p, host)
#endif
if (getent(defent, "default") == 1) {
- char *Getstr();
+ char *getstr();
char *cp=defstrs;
- HE = Getstr("he", &cp);
- HN = Getstr("hn", &cp);
- IM = Getstr("im", &cp);
+ HE = getstr("he", &cp);
+ HN = getstr("hn", &cp);
+ IM = getstr("im", &cp);
if (HN && *HN)
(void) strcpy(host_name, HN);
if (IM == 0)
diff --git a/crypto/telnet/telnetd/utility.c b/crypto/telnet/telnetd/utility.c
index 08ad0bbe776c..4c9dec1c118e 100644
--- a/crypto/telnet/telnetd/utility.c
+++ b/crypto/telnet/telnetd/utility.c
@@ -36,12 +36,11 @@
static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#endif
static const char rcsid[] =
- "$Id: utility.c,v 1.3 1998/02/16 12:09:28 markm Exp $";
+ "$Id$";
#endif /* not lint */
#ifdef __FreeBSD__
#include <locale.h>
-#include <sys/utsname.h>
#endif
#define PRINTOPTIONS
#include "telnetd.h"
@@ -472,21 +471,11 @@ putf(cp, where)
#else
extern char *strrchr();
#endif
-#ifdef __FreeBSD__
- static struct utsname kerninfo;
-
- if (!*kerninfo.sysname)
- uname(&kerninfo);
-#endif
putlocation = where;
while (*cp) {
- if (*cp =='\n') {
- putstr("\r\n");
- cp++;
- continue;
- } else if (*cp != '%') {
+ if (*cp != '%') {
putchr(*cp++);
continue;
}
@@ -518,24 +507,6 @@ putf(cp, where)
putstr(db);
break;
-#ifdef __FreeBSD__
- case 's':
- putstr(kerninfo.sysname);
- break;
-
- case 'm':
- putstr(kerninfo.machine);
- break;
-
- case 'r':
- putstr(kerninfo.release);
- break;
-
- case 'v':
- putstr(kerninfo.version);
- break;
-#endif
-
case '%':
putchr('%');
break;
diff --git a/etc/Makefile b/etc/Makefile
index aa155b3618ca..9f38a4bd5052 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -1,14 +1,13 @@
# from: @(#)Makefile 5.11 (Berkeley) 5/21/91
-# $Id: Makefile,v 1.186 1999/01/10 21:08:26 rnordier Exp $
+# $Id: Makefile,v 1.178 1998/10/06 19:24:14 phk Exp $
SUBDIR= sendmail
BIN1= aliases amd.map crontab csh.cshrc csh.login csh.logout dm.conf \
fbtab ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
inetd.conf auth.conf login.conf login.access motd modems networks \
- newsyslog.conf pam.conf phones pccard.conf.sample \
- printcap profile protocols \
- rc rc.atm rc.conf rc.devfs rc.firewall rc.isdn rc.network rc.pccard \
+ newsyslog.conf phones pccard.conf.sample printcap profile protocols \
+ rc rc.atm rc.conf rc.devfs rc.firewall rc.local rc.network rc.pccard \
rc.serial rc.shutdown etc.${MACHINE_ARCH}/rc.${MACHINE_ARCH} \
remote security services shells syslog.conf \
etc.${MACHINE_ARCH}/ttys etc.${MACHINE_ARCH}/disktab rpc make.conf \
@@ -61,7 +60,7 @@ distribution:
( cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap ); \
( cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt ); \
( cd ${.CURDIR}/sendmail; ${MAKE} etc-sendmail.cf ); \
- ( cd ${.CURDIR}/isdn; ${MAKE} install );\
+ ( cd ${.CURDIR}/../sys/i386/boot/biosboot; ${MAKE} install-boothelp ); \
pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd; \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
MAKEDEV.local etc.${MACHINE_ARCH}/MAKEDEV ${DESTDIR}/dev )
diff --git a/etc/aliases b/etc/aliases
index 6df2b6136de8..4088a30e79aa 100644
--- a/etc/aliases
+++ b/etc/aliases
@@ -1,4 +1,4 @@
-# $Id: aliases,v 1.7 1998/11/03 08:14:38 phk Exp $
+# $Id: aliases,v 1.4 1997/06/29 23:09:07 wosch Exp $
# @(#)aliases 5.3 (Berkeley) 5/24/90
#
# Aliases in this file will NOT be expanded in the header from
@@ -12,11 +12,6 @@
# See also RFC 2142, `MAILBOX NAMES FOR COMMON SERVICES, ROLES
# AND FUNCTIONS', May 1997
-# Pretty much everything else in this file points to "root", so
-# you would do well in either reading roots mailbox or forwarding
-# roots email from here.
-
-# root: me@my.domain
# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
@@ -37,6 +32,7 @@ uucp: root
xten: root
# Well-known aliases -- these should be filled in!
+# root:
# manager:
# dumper:
diff --git a/etc/amd.map b/etc/amd.map
index 3898f8badf54..44aacc4908fd 100644
--- a/etc/amd.map
+++ b/etc/amd.map
@@ -1,2 +1,2 @@
-/defaults type:=host;fs:=${autodir}/${rhost}/host;rhost:=${key}
+/defaults type:=host;fs:=${autodir}/${rhost};rhost:=${key}
* opts:=rw,grpid,resvport,vers=3,proto=tcp,nosuid,nodev
diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV
index 3cbb27c3a49a..362cf46a7e62 100644
--- a/etc/etc.i386/MAKEDEV
+++ b/etc/etc.i386/MAKEDEV
@@ -74,13 +74,8 @@
# pty* set of 32 master and slave pseudo terminals
# vty* virtual terminals using syscons/pcvt/codrv console
#
-# Parallel port:
-# lpt* Printer
-# ppi* Parallel port i/o
-#
-# I2C and SMBus:
-# iic* I2C devices
-# smb* SMBUS devices
+# Printers:
+# lpt* stock lp
#
# SCSI devices (other than CD-ROM, tape and disk):
# ssc The ``super scsi'' device
@@ -91,13 +86,6 @@
# PC-CARD (previously called PCMCIA) support
# card* PC-CARD slots
#
-# ISDN devices:
-# i4b isdnd call control device
-# i4bctl debugging control device
-# i4btrc* trace data interface(s), one per passive card
-# i4btel* telephony interface(s)
-# i4brbch* raw b channel access device(s)
-#
# Special purpose devices:
# apm Advanced Power Management BIOS
# bpf* packet filter
@@ -119,9 +107,8 @@
# perfmon CPU performance-monitoring counters
# pci PCI configuration-space access from user mode
# ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
-# kbd keyboard devices
#
-# $Id: MAKEDEV,v 1.182 1999/01/11 00:03:58 n_hibma Exp $
+# $Id: MAKEDEV,v 1.172 1998/09/16 00:10:26 ken Exp $
#
PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH
@@ -212,21 +199,14 @@ all)
sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
sh MAKEDEV pty0 # cdev, pseudo tty
sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
- sh MAKEDEV kbd0 # cdev, keyboard
sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
sh MAKEDEV pcaudio speaker # cdev, noise
sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
- sh MAKEDEV ppi0 ppi1 ppi2 # cdev, parallel port
- sh MAKEDEV iic0 iic1 # cdev, I2C device
- sh MAKEDEV smb0 smb1 # cdev, SMBus device
sh MAKEDEV bpf0 ipl tun0 # cdev, network
sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
sh MAKEDEV apm card0 card1 # cdev, laptop
sh MAKEDEV pass4 xpt2 # cdev, CAM
- sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
- sh MAKEDEV i4brbch0 i4brbch1 i4btel0 i4btel1 # cdev, ISDN
;;
-
std)
mknod console c 0 0; chmod 600 console
mknod drum c 4 0; chmod 640 drum; chgrp kmem drum
@@ -750,41 +730,6 @@ wst*)
umask 77
;;
-iic*)
- unit=`expr $i : 'iic\(.*\)'`
- mknod iic$unit c 105 $unit
- ;;
-
-smb*)
- unit=`expr $i : 'smb\(.*\)'`
- mknod smb$unit c 106 $unit
- ;;
-
-ppi*)
- unit=`expr $i : 'ppi\(.*\)'`
- mknod ppi$unit c 82 $unit
- ;;
-
-usb*)
- unit=`expr $i : 'usb\(.*\)'`
- mknod usb$unit c 108 $unit
- ;;
-
-ums*)
- unit=`expr $i : 'ums\(.*\)'`
- mknod ums$unit c 111 $unit
- ;;
-
-ulpt*)
- unit=`expr $i : 'ulpt\(.*\)'`
- mknod ulpt$unit c 113 $unit
- ;;
-
-ugen*)
- unit=`expr $i : 'ugen\(.*\)'`
- mknod ugen$unit c 114 $unit
- ;;
-
lpt*)
unit=`expr $i : 'lpt\(.*\)'`
mknod lpt$unit c 16 $unit
@@ -810,12 +755,8 @@ vty*)
;;
bpf*)
- nbpf=`expr $i : 'bpf\(.*\)$'`
- unit=0
- while [ $unit -le $nbpf ]; do
- mknod bpf$unit c 23 $unit
- unit=`expr $unit + 1`
- done
+ unit=`expr $i : 'bpf\(.*\)'`
+ mknod bpf$unit c 23 $unit
;;
speaker)
@@ -1296,45 +1237,6 @@ ipl)
mknod ipauth c 79 3
;;
-kbd*)
- unit=`expr $i : 'kbd\(.*\)'`
- chr=112
- mknod kbd$unit c $chr $unit
- ;;
-
-i4b)
- mknod i4b c 60 0
- chown root:wheel i4b
- chmod 600 i4b
- ;;
-
-i4bctl)
- mknod i4bctl c 55 0
- chown root:wheel i4bctl
- chmod 600 i4bctl
- ;;
-
-i4brbch*)
- unit=`expr $i : 'i4brbch\(.*\)'`
- mknod i4brbch$unit c 57 $unit
- chown root:wheel i4brbch$unit
- chmod 600 i4brbch$unit
- ;;
-
-i4btel*)
- unit=`expr $i : 'i4btel\(.*\)'`
- mknod i4btel$unit c 56 $unit
- chown root:wheel i4btel$unit
- chmod 600 i4btel$unit
- ;;
-
-i4btrc*)
- unit=`expr $i : 'i4btrc\(.*\)'`
- mknod i4btrc$unit c 59 $unit
- chown root:wheel i4btrc$unit
- chmod 600 i4btrc$unit
- ;;
-
local)
umask 0 # XXX should be elsewhere
sh MAKEDEV.local
diff --git a/etc/etc.i386/disktab b/etc/etc.i386/disktab
index 0b1bdd2e0f0b..6d4539192159 100644
--- a/etc/etc.i386/disktab
+++ b/etc/etc.i386/disktab
@@ -1,4 +1,4 @@
-# $Id: disktab,v 1.17 1998/10/06 12:42:55 dfr Exp $
+# $Id: disktab,v 1.16 1998/10/06 12:06:43 dfr Exp $
#
# Disk geometry and partition layout tables.
# Key:
@@ -206,11 +206,6 @@ minimum:ty=mfs:se#512:nt#1:rm#300:\
:pa#2880:oa#0:ba#4096:fa#512:\
:pc#2880:oc#0:bc#4096:fc#512:
-minimum2:ty=mfs:se#512:nt#1:rm#300:\
- :ns#5760:nc#1:\
- :pa#5760:oa#0:ba#4096:fa#512:\
- :pc#5760:oc#0:bc#4096:fc#512:
-
zip100|zip 100:\
:ty=removable:se#512:nc#96:nt#64:ns#32:\
:pa#196608:oa#0:ba#4096:fa#512:\
diff --git a/etc/etc.i386/rc.i386 b/etc/etc.i386/rc.i386
index e38be7cc5cf5..13f7281d5a2a 100644
--- a/etc/etc.i386/rc.i386
+++ b/etc/etc.i386/rc.i386
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.i386,v 1.36 1998/11/01 13:04:15 wosch Exp $
+# $Id: rc.i386,v 1.34 1998/04/02 15:33:49 ache Exp $
# Do i386 specific processing
#
@@ -94,7 +94,8 @@ fi
# screen saver
if [ "X${saver}" != X"NO" ] ; then
echo -n ' screensaver'
- kldstat -v | grep -q _saver || kldload ${saver}_saver
+ modstat | grep -q _saver || \
+ modload -u -o /tmp/saver_mod -q /lkm/${saver}_saver_mod.o
fi
# mouse daemon
diff --git a/etc/group b/etc/group
index 6de3a75fb475..f0cc540f217b 100644
--- a/etc/group
+++ b/etc/group
@@ -1,4 +1,4 @@
-# $Id: group,v 1.17 1998/09/13 23:05:46 brian Exp $
+# $Id:$
#
wheel:*:0:root
daemon:*:1:daemon
@@ -13,7 +13,6 @@ man:*:9:
games:*:13:
staff:*:20:root
guest:*:31:root
-bind:*:53:
uucp:*:66:
xten:*:67:xten
dialer:*:68:
diff --git a/etc/host.conf b/etc/host.conf
index 06c5d71903a8..10f4c6575936 100644
--- a/etc/host.conf
+++ b/etc/host.conf
@@ -1,7 +1,7 @@
-# $Id: host.conf,v 1.4 1997/02/23 09:20:40 peter Exp $
-# First try the /etc/hosts file
-hosts
-# Now try the nameserver next.
+# $Id$
+# Default is to use the nameserver first
bind
+# If that doesn't work, then try the /etc/hosts file
+hosts
# If you have YP/NIS configured, uncomment the next line
# nis
diff --git a/etc/inetd.conf b/etc/inetd.conf
index c9accd720cf7..1583762f1a8b 100644
--- a/etc/inetd.conf
+++ b/etc/inetd.conf
@@ -1,4 +1,4 @@
-# $Id: inetd.conf,v 1.32 1998/12/01 21:19:49 dillon Exp $
+# $Id: inetd.conf,v 1.29 1998/09/02 01:34:56 brian Exp $
#
# Internet server configuration database
#
@@ -12,10 +12,8 @@ finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -s
#exec stream tcp nowait root /usr/libexec/rexecd rexecd
#uucpd stream tcp nowait root /usr/libexec/uucpd uucpd
#nntp stream tcp nowait usenet /usr/libexec/nntpd nntpd
-# run comsat as root to be able to print partial mailbox contents w/ biff,
-# or use the safer tty:tty to just print that new mail has been received.
-comsat dgram udp wait tty:tty /usr/libexec/comsat comsat
-ntalk dgram udp wait tty:tty /usr/libexec/ntalkd ntalkd
+comsat dgram udp wait root /usr/libexec/comsat comsat
+ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd
#tftp dgram udp wait nobody /usr/libexec/tftpd tftpd /tftpboot
#bootps dgram udp wait root /usr/libexec/bootpd bootpd
#
@@ -63,13 +61,9 @@ ntalk dgram udp wait tty:tty /usr/libexec/ntalkd ntalkd
#
#imap4 stream tcp nowait root /usr/local/libexec/imapd imapd
#
-# Return error for all "ident" requests
-#
-#ident stream tcp nowait root internal
-#
# example entry for the optional ident server
#
-#ident stream tcp wait kmem:kmem /usr/local/sbin/identd identd -w -t120
+#ident stream tcp wait root /usr/local/sbin/identd identd -w -t120
#
# example entry for the optional qmail MTA
#
diff --git a/etc/isdn/Makefile b/etc/isdn/Makefile
deleted file mode 100644
index c24ffba55961..000000000000
--- a/etc/isdn/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# $Id: Makefile,v 1.1 1999/01/10 14:30:44 hm Exp $
-
-I4BETCPROG= answer \
- isdntel.sh \
- record \
- tell \
- tell-record
-
-I4BETCFILE= isdnd.rates.D \
- isdnd.rates.F \
- isdnd.rc.sample \
- isdntel.alias.sample
-
-install:
- for i in ${I4BETCPROG} ; do \
- ${INSTALL} -c -o root -g wheel -m 700 $$i ${DESTDIR}/etc/isdn ; \
- done ; \
- for i in ${I4BETCFILE} ; do \
- ${INSTALL} -c -o root -g wheel -m 600 $$i ${DESTDIR}/etc/isdn ; \
- done
-
diff --git a/etc/isdn/answer b/etc/isdn/answer
deleted file mode 100755
index b785fc0e2c4f..000000000000
--- a/etc/isdn/answer
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# answer script for i4b isdnd
-# ---------------------------
-#
-# $Id: answer,v 1.3 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:20 1998]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-LIBDIR=/usr/local/lib/isdn
-LOGFILE=/tmp/answer.log
-NCALLFILE=$VARDIR/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-set -- `getopt D:d:s: $*`
-
-if test $? != 0
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i
-do
- case "$i"
- in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>$LOGFILE
-
-if [ $DF -eq 0 -o $dF -eq 0 -o $sF -eq 0 ]
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
-
-if [ -f $NCALLFILE ]
-then
- NCALL=`cat $NCALLFILE`
-else
- NCALL=0
-fi
-
-NCALL=`printf "%.4d" $NCALL`
-
-echo Date: `date` >> $VARDIR/I.$NCALL.$DATE
-
-if [ "$SRC" != "" ]
-then
- echo "From: $SRC" >> $VARDIR/I.$NCALL.$DATE
-fi
-
-if [ "$DEST" != "" ]
-then
- echo "To: $DEST" >> $VARDIR/I.$NCALL.$DATE
-fi
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k # >/dev/null 2>&1
-fi
-
-if [ -f $LIBDIR/msg.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/msg.g711a bs=2k # >/dev/null 2>&1
- if [ -f $LIBDIR/beep.g711a ]
- then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k # >/dev/null 2>&1
- fi
-fi
-
-echo `expr $NCALL + 1` >$NCALLFILE
diff --git a/etc/isdn/isdnd.rates.D b/etc/isdn/isdnd.rates.D
deleted file mode 100644
index 63fb84e991db..000000000000
--- a/etc/isdn/isdnd.rates.D
+++ /dev/null
@@ -1,63 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - Deutsche Telekom charging rates config file
-# -------------------------------------------------
-#
-# $Id: isdnd.rates.D,v 1.4 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:48 1998]
-#
-# -hm updated to reflect last Telekom changes as of 1.7.97
-# -hm updated to reflect last Telekom changes as of 1.3.98
-#
-#---------------------------------------------------------------------------
-#
-# reference: http://www.telekom.de/aktuell/tarife98
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = CityCall, ra1 = RegioCall, ra2 = GermanCall
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------------
-#
-#=================== CityCall =========================================================================
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5
-#--------- --- --------------- --------------- --------------- --------------- ----------------
-ra0 0 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-ra0 1 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 2 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 3 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 4 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 5 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 6 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-#
-#=================== RegioCall ======================================================================================================
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5 rate6 rate7
-#--------- --- --------------- --------------- --------------- --------------- --------------- --------------- --------------
-ra1 0 00.00-05.00:60 05.00-21.00:45 21.00-24.00:60
-ra1 1 00.00-02.00:60 02.00-05.00:120 05.00-09.00:45 09.00-12.00:26 12.00-18.00:30 18.00-21.00:45 21.00-24.00:60
-ra1 2 00.00-02.00:60 02.00-05.00:120 05.00-09.00:45 09.00-12.00:26 12.00-18.00:30 18.00-21.00:45 21.00-24.00:60
-ra1 3 00.00-02.00:60 02.00-05.00:120 05.00-09.00:45 09.00-12.00:26 12.00-18.00:30 18.00-21.00:45 21.00-24.00:60
-ra1 4 00.00-02.00:60 02.00-05.00:120 05.00-09.00:45 09.00-12.00:26 12.00-18.00:30 18.00-21.00:45 21.00-24.00:60
-ra1 5 00.00-02.00:60 02.00-05.00:120 05.00-09.00:45 09.00-12.00:26 12.00-18.00:30 18.00-21.00:45 21.00-24.00:60
-ra1 6 00.00-05.00:60 05.00-21.00:45 21.00-24.00:60
-#
-#================== GermanCall ======================================================================================================
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5 rate 6 rate7
-#--------- --- --------------- --------------- -------------- --------------- -------------- --------------- ----------------
-ra2 0 00.00-05.00:36 05.00-21.00:30 21.00-24.00:36
-ra2 1 00.00-02.00:36 02.00-05.00:120 05.00-09.00:22 09.00-12.00:13 12.00-18.00:14 18.00-21.00:22 21.00-24.00:36
-ra2 2 00.00-02.00:36 02.00-05.00:120 05.00-09.00:22 09.00-12.00:13 12.00-18.00:14 18.00-21.00:22 21.00-24.00:36
-ra2 3 00.00-02.00:36 02.00-05.00:120 05.00-09.00:22 09.00-12.00:13 12.00-18.00:14 18.00-21.00:22 21.00-24.00:36
-ra2 4 00.00-02.00:36 02.00-05.00:120 05.00-09.00:22 09.00-12.00:13 12.00-18.00:14 18.00-21.00:22 21.00-24.00:36
-ra2 5 00.00-02.00:36 02.00-05.00:120 05.00-09.00:22 09.00-12.00:13 12.00-18.00:14 18.00-21.00:22 21.00-24.00:36
-ra2 6 00.00-05.00:36 05.00-21.00:30 21.00-24.00:36
-#
-#================== EOF ============================================================================================================
diff --git a/etc/isdn/isdnd.rates.F b/etc/isdn/isdnd.rates.F
deleted file mode 100644
index 6dc32f5fc0f3..000000000000
--- a/etc/isdn/isdnd.rates.F
+++ /dev/null
@@ -1,152 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - Tarifs France Telecom
-# ---------------------------
-#
-# $Id: isdnd.rates.F,v 1.1 1998/03/19 19:09:28 hm Exp $
-#
-# last edit-date: [Thu Mar 19 20:05:18 1998]
-#
-# -hm got from Aurelien Bargy <dj@dial.oleane.com>
-#
-#---------------------------------------------------------------------------
-#
-# a jour au 1.10.97
-# Aurelien Bargy - 18.03.97
-#
-# I wrote a rates file for France. It is rather approximative
-# because some time ago France Telecom decided to abandon the charging
-# units system. The problem is, on ISDN lines charging units are still
-# used for the aocd system, even as it gives a completely false price
-# for a communication, so "abandoning" the msg_charging_unit system for
-# French users of i4b is not a good idea :))
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = local ; ra1 = zone 1 ; ra2 = zone 2...
-# plus quelques tarifs internationaux
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------
-#
-#========================== Communications locales ======================
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra0 0 00.00-24.00:317
-ra0 1 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 2 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 3 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 4 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 5 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 6 00.00-08.00:317 08.00-12.00:158 12.00-24.00:317
-#
-#
-#
-#================== Zone 1 : < 25 km ==================================
-#
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra1 0 00.00-24.00:222
-ra1 1 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 2 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 3 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 4 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 5 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 6 00.00-08.00:222 08.00-12.00:111 12.00-24.00:222
-#
-#
-#
-#================== Zone 2 : 25-30 km =================================
-#
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- --------------
-ra2 0 00.00-24.00:148
-ra2 1 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 2 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 3 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 4 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 5 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 6 00.00-08.00:148 08.00-12.00:74 12.00-24.00:148
-#
-#=================== Zone 3 : 30-52 km ================================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra3 0 00.00-24.00:94
-ra3 1 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 2 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 3 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 4 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 5 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 6 00.00-08.00:94 08.00-12.00:47 12.00-24.00:94
-#
-#
-#=================== Zone 4 : > 52 km =================================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra4 0 00.00-24.00:78
-ra4 1 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 2 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 3 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 4 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 5 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 6 00.00-08.00:78 08.00-12.00:39 12.00-24.00:78
-#
-#
-#=================== INTERNATIONAL : Allemagne ========================
-# (pour appeler Hellmuth)
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra5 0 00.00-24.00:27
-ra5 1 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 2 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 3 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 4 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 5 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 6 00.00-08.00:27 08.00-12.00:21 12.00-24.00:27
-#
-#
-#=================== INTERNATIONAL : Pays-Bas ==========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra6 0 00.00-24.00:25
-ra6 1 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 2 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 3 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 4 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 5 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 6 00.00-08.00:25 08.00-12.00:20 12.00-24.00:25
-#
-#
-#=================== INTERNATIONAL : Portugal ===========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra7 0 00.00-24.00:22
-ra7 1 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 2 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 3 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 4 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 5 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 6 00.00-08.00:22 08.00-12.00:18 12.00-24.00:22
-#
-#
-#=================== INTERNATIONAL : USA/Canada ========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra8 0 00.00-24.00:25
-ra8 1 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 2 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 3 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 4 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 5 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 6 00.00-24.00:25
-#
-#================== EOF ==============================================
diff --git a/etc/isdn/isdnd.rc.sample b/etc/isdn/isdnd.rc.sample
deleted file mode 100644
index 17987be350d5..000000000000
--- a/etc/isdn/isdnd.rc.sample
+++ /dev/null
@@ -1,257 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# example of a configuration file for the isdn daemon
-# ---------------------------------------------------
-#
-# $Id: isdnd.rc,v 1.1 1999/01/10 14:30:47 hm Exp $
-#
-# last edit-date: [Tue Jan 19 16:30:12 1999]
-#
-# NOTICE:
-# =======
-# This configuration file is an EXAMPLE only and MUST be edited
-# carefully to get the desired results!
-#
-# Please read the "isdnd.rc" manual page (execute "man isdnd.rc")
-# for reference !
-#
-#------------------------------------------------------------------------------
-
-#==============================================================================
-# SYSTEM section: isdnd global configuration parameters
-#==============================================================================
-system
-
-# accounting
-# ----------
-
-acctall = on # generate info for everything
-acctfile = /var/log/isdnd.acct # name & location of accounting file
-useacctfile = yes # generate accouting info to file
-
-# monitor
-# -------
-
-monitor-allowed = no # global switch: monitor on/off
-monitor-port = 451 # default monitor TCP port
-
-# Monitor rights are granted due to the most specific host/net spec, i.e. in
-# the example below host 192.168.1.2 will have the rights specified on that
-# line, even so it belongs to net 192.168.1.0/24 as well.
-#
-# A monitor specification may either be:
-#
-# - the name of a local (UNIX-domain) socket; this MUST start with a "/"
-monitor = "/var/run/isdn-monitor"
-monitor-access = fullcmd
-monitor-access = channelstate, logevents
-monitor-access = callin, callout
-#
-# - a dotted-quad host spec
-monitor = "192.168.1.2"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a dotted-quad net spec with "/len" (CIDR-style) netmask spec
-monitor = "192.168.1.0/24"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a resolveable host name
-monitor = "rumolt"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a resolveable net name with "/len" netmask (s.a.) appended
-monitor = "up-vision-net/24"
-monitor-access = restrictedcmd, channelstate, callin, callout
-
-# ratesfile
-# ---------
-
-ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
-
-# regular expression pattern matching
-# -----------------------------------
-
-#regexpr = "connected.*XXX" # look for matches in log messages
-#regprog = connectXXX # execute program when match is found
-
-# realtime priority section
-# -------------------------
-
-rtprio = 25 # modify isdnd's process priority
-
-#==============================================================================
-# entry section: IP over ISDN example - i call back the remote end
-#==============================================================================
-entry
-
-name = I4BIP # name for reference. This name will
- # be used in the logfile to identfy
- # this entry.
-
- # the network or telephone device
- # the data traffic should be routed to:
-usrdevicename = ipr # ipr, isp, tel, rbch
-usrdeviceunit = 0 # unit number
-
- # the ISDN controller number to be
- # used for this entry:
-isdncontroller = 0 # contoller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # incoming only, outgoing only or both:
-direction = inout # in, out, inout
-
- # numbers used to verify a DIAL IN:
-local-phone-incoming = 321 # this is my number
-remote-phone-incoming = 0123456789 # this one can call in
-
- # numbers used at DIAL OUT time:
-local-phone-dialout = 321 # this is my number
-remote-phone-dialout = 00123456789 # i call this remote number
-
- # in case i have several remote
- # telephone numbers specified, this
- # is used to specify which one is
- # used next on dial fail or retry:
-remdial-handling = first # first, last or next
-
- # what happenes if someone dials in:
-dialin-reaction = callback # accept, reject, ignore, answer, callback
-
- # normal dialout or do i call back:
-dialout-type = normal # normal / calledback
-
-callbackwait = 1 # no of secs to wait before calling back
-
- # type of protocol on the B-channel:
- # hdlc must be specified for IP (the
- # ipr and isp drivers), raw must be
- # specified for telephone answering
-b1protocol = hdlc # hdlc, raw
-
- # shorthold mode and idle time
- # configuration:
-ratetype = 0 # ratesfile entry to use
-unitlength = 90 # unitlength to assume
-unitlengthsrc = rate # none, rate, cmdl, conf, aocd
-idletime-incoming = 120 # incoming call idle timeout
-idletime-outgoing = 60 # outgoing call idle timeout
-earlyhangup = 5 # time to hangup before an expected
- # next charging unit will occur
-
- # retry and recovery parameters
-dialretries = 3 # # of dial retries
-dialrandincr = off # random dial increment time
-recoverytime = 5 # time to wait between 2 dial tries
-usedown = off # set i/f down
-downtries = 5 # retry cycles before set down
-downtime = 30 # time to be in down before going up
-
-#connectprog = "ip-up" # run /etc/isdn/ip-up when an interface
- # has established its network connection.
- # example parameters are:
- # /etc/isdn/ip-up -d isp0 -f up -a 192.110.12.14
-#disconnectprog = "ip-down" # like connectprog, but run after the connection
- # is closed (ISDN layer down). The actual
- # interface address might not be known
- # any more. example parameters are:
- # /etc/isdn/ip-up -d isp0 -f down -a 0.0.0.0
-
-#==============================================================================
-# entry section: IP over ISDN example - i am called back by the remote end
-#==============================================================================
-entry
-
-name = I4BIP1 # name for reference
-
-usrdevicename = ipr # ipr, tel, rbch
-usrdeviceunit = 1 # unit number
-
-isdncontroller = 0 # contoller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to DIAL OUT
-remote-phone-dialout = 00401234567 # remote number to dial
-local-phone-dialout = 38 # our number to tell remote
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 38 # we take calls for this local number
-remote-phone-incoming = 00401234567 # we take calls from this remote machine
-
-b1protocol = hdlc # hdlc, raw
-
-ratetype = 0 # city
-unitlength = 90 # default unit length
-earlyhangup = 5 # safety zone
-unitlengthsrc = aocd # none, rate, cmdl, conf, aocd
-
-dialin-reaction = accept # accept, reject, ignore, anwer, callback
-
-dialout-type = calledback # normal or calledback
-
-dialretries = 3
-recoverytime = 3
-calledbackwait = 20
-dialrandincr = off
-
-usedown = off
-downtries = 2
-downtime = 30
-
-idletime-incoming = 300
-idletime-outgoing = 30
-
-#==============================================================================
-# entry section: answering machine example
-#==============================================================================
-entry
-
-name = I4BTEL # name for reference
-usrdevicename = tel # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 0 # contoller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 456 # this is my number
-remote-phone-incoming = * # anyone can call in
-
-dialin-reaction = answer # accept, reject, ignore, answer
-
-answerprog = answer # program to run
-
-b1protocol = raw # hdlc, raw
-
-idletime-incoming = 5 # 5 seconds idle timeout
-
-#=======================================================================
-# entry section: PPP example
-#======================================================================
-entry
-name = I4BPPP
-usrdevicename = isp
-usrdeviceunit = 0
-isdncontroller = 0
-isdnchannel = -1
-local-phone-incoming = 1234
-remote-phone-incoming = 5678
-local-phone-dialout = 1234
-remote-phone-dialout = 5678
-remdial-handling = first
-dialin-reaction = accept
-dialout-type = normal
-b1protocol = hdlc
-idletime-incoming = 240
-idletime-outgoing = 30
-ratetype = 0
-unitlength = 90
-unitlengthsrc = rate
-dialretries = 3
-dialrandincr = on
-recoverytime = 25
-usedown = off
-downtries = 2
-downtime = 30
-
-# EOF #########################################################################
diff --git a/etc/isdn/isdntel.alias.sample b/etc/isdn/isdntel.alias.sample
deleted file mode 100644
index a6e42e4fd019..000000000000
--- a/etc/isdn/isdntel.alias.sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# alias file for the isdntel(1) application
-# -----------------------------------------
-#
-# $Id: isdntel.alias,v 1.1 1999/01/10 14:30:48 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:06:03 1998]
-#
-# -hm cleanup for release
-#
-#
-# the format is simple: the number beginning in column one followed
-# by one or more spaces or tabs. The rest of the line is taken as
-# and alias string for the number. Comment lines start with a "#".
-#
-#---------------------------------------------------------------------------
-123 alias for 123
-456 alias for 456
-789 alias for 789
-
diff --git a/etc/isdn/isdntel.sh b/etc/isdn/isdntel.sh
deleted file mode 100755
index 6179908af7b8..000000000000
--- a/etc/isdn/isdntel.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# isdn telephone answering
-# -------------------------
-#
-# $Id: isdntel.sh,v 1.7 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:26 1998]
-#
-# -hm answering script
-# -hm curses interface
-# -hm update for release
-#
-#---------------------------------------------------------------------------
-LIBDIR=/usr/local/lib/isdn
-VARDIR=/var/isdn
-DEVICE=/dev/i4btel0
-
-# sounds
-MESSAGE=$LIBDIR/msg.g711a
-BEEP=$LIBDIR/beep.g711a
-
-# dd options
-SKIP=25
-
-# max message size
-MAXMSIZ=100
-
-# src and dst telephone numbers
-src=
-dst=
-
-# current date
-DATE=`date`
-
-# check if directory exists
-if [ ! -d $VARDIR ]
-then
- mkdir $VARDIR
-fi
-
-# get options
-set -- `/usr/bin/getopt D:d:s: $*`
-
-if [ $? != 0 ]
-then
- echo "usage2: play -D device -d <dest-telno> -s <src-telno>"
- exit 1
-fi
-
-# process options
-for i
-do
- case $i in
- -D)
- DEVICE=$2; shift; shift;
- ;;
- -d)
- dst=$2; shift; shift;
- ;;
- -s)
- src=$2; shift; shift;
- ;;
- --)
- shift; break;
- ;;
- esac
-done
-
-# this is a __MUST__ in order to use the fullscreen inteface !!!
-
-FILEDATE=`date \+%y%m%d%H%M%S`
-
-# echo message to phone
-if [ -f $MESSAGE ]
-then
- /bin/dd of=$DEVICE if=$MESSAGE bs=2k >/dev/null 2>&1
-fi
-
-# echo beep to phone
-if [ -f $BEEP ]
-then
- /bin/dd of=$DEVICE if=$BEEP bs=2k >/dev/null 2>&1
-fi
-
-# start time
-START=`date \+%s`
-
-# get message from caller
-/bin/dd if=$DEVICE of=$VARDIR/$FILEDATE-$dst-$src skip=$SKIP bs=2k count=$MAXMSIZ >/dev/null 2>&1
-
-# end time
-END=`date \+%s`
-
-# duration
-TIME=`expr $END - $START`
-
-# save recorded message
-if [ -f $VARDIR/$FILEDATE-$dst-$src ]
-then
- mv $VARDIR/$FILEDATE-$dst-$src $VARDIR/$FILEDATE-$dst-$src-$TIME
-fi
-
-exit 0
diff --git a/etc/isdn/record b/etc/isdn/record
deleted file mode 100755
index 782f0f5d096b..000000000000
--- a/etc/isdn/record
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# answer and record message script for i4b isdnd
-# ----------------------------------------------
-#
-# $Id: record,v 1.3 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:31 1998]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-LIBDIR=/usr/local/lib/isdn
-LOGFILE=/tmp/answer.log
-NCALLFILE=$VARDIR/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-set -- `getopt D:d:s: $*`
-
-if test $? != 0
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i
-do
- case "$i"
- in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>$LOGFILE
-
-if [ $DF -eq 0 -o $dF -eq 0 -o $sF -eq 0 ]
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
-
-if [ -f $NCALLFILE ]
-then
- NCALL=`cat $NCALLFILE`
-else
- NCALL=0
-fi
-
-NCALL=`printf "%.4d" $NCALL`
-
-echo Date: `date` >> $VARDIR/I.$NCALL.$DATE
-
-if [ "$SRC" != "" ]
-then
- echo "From: $SRC" >> $VARDIR/I.$NCALL.$DATE
-fi
-
-if [ "$DEST" != "" ]
-then
- echo "To: $DEST" >> $VARDIR/I.$NCALL.$DATE
-fi
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
-
-if [ -f $LIBDIR/msg.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/msg.g711a bs=2k >/dev/null 2>&1
-fi
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
-
-dd if=$DEVICE of=$VARDIR/R.$NCALL.$DATE bs=2k >/dev/null 2>&1
-
-echo `expr $NCALL + 1` >$NCALLFILE
diff --git a/etc/isdn/tell b/etc/isdn/tell
deleted file mode 100755
index 4b29c22084bd..000000000000
--- a/etc/isdn/tell
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# tell called and calling numbers answer script for i4b isdnd
-# -----------------------------------------------------------
-#
-# $Id: tell,v 1.3 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:36 1998]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-LIBDIR=/usr/local/lib/isdn
-LOGFILE=/tmp/answer.log
-NCALLFILE=$VARDIR/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-set -- `getopt D:d:s: $*`
-
-if test $? != 0
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i
-do
- case "$i"
- in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>$LOGFILE
-
-if [ $DF -eq 0 -o $dF -eq 0 -o $sF -eq 0 ]
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
-
-# tell the caller the number he is calling from
-
-POS=1
-LENGTH=`expr $SRC : '.*'`
-
-while :
-do
- DIGIT=`echo $SRC | cut -c $POS`
- /bin/dd of=$DEVICE if=$LIBDIR/$DIGIT.g711a bs=2k >/dev/null 2>&1
- POS=`expr $POS + 1`
- if [ $POS -gt $LENGTH ]
- then
- break
- fi
-done
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
diff --git a/etc/isdn/tell-record b/etc/isdn/tell-record
deleted file mode 100755
index 9c66c706ab06..000000000000
--- a/etc/isdn/tell-record
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# tell called and calling numbers answer script for i4b isdnd
-# -----------------------------------------------------------
-#
-# $Id: tell-record,v 1.3 1998/12/18 17:17:57 hm Exp $
-#
-# last edit-date: [Fri Dec 18 18:05:41 1998]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-LIBDIR=/usr/local/lib/isdn
-LOGFILE=/tmp/answer.log
-NCALLFILE=$VARDIR/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-set -- `getopt D:d:s: $*`
-
-if test $? != 0
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i
-do
- case "$i"
- in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>$LOGFILE
-
-if [ $DF -eq 0 -o $dF -eq 0 -o $sF -eq 0 ]
-then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
-
-# tell the caller the number he is calling from
-
-POS=1
-LENGTH=`expr $SRC : '.*'`
-
-while :
-do
- DIGIT=`echo $SRC | cut -c $POS`
- /bin/dd of=$DEVICE if=$LIBDIR/$DIGIT.g711a bs=2k >/dev/null 2>&1
- POS=`expr $POS + 1`
- if [ $POS -gt $LENGTH ]
- then
- break
- fi
-done
-
-if [ -f $LIBDIR/beep.g711a ]
-then
- dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
-fi
-
-dd if=$DEVICE of=$VARDIR/recorded.msg bs=2k
diff --git a/etc/login.conf b/etc/login.conf
index 27365efbb35b..743f9d9114b5 100644
--- a/etc/login.conf
+++ b/etc/login.conf
@@ -9,13 +9,13 @@
# This file controls resource limits, accounting limits and
# default user environment settings.
#
-# $Id: login.conf,v 1.25 1999/01/11 09:07:38 asami Exp $
+# $Id: login.conf,v 1.21 1998/09/16 19:18:36 msmith Exp $
#
# Default settings effectively disable resource limits, see the
# examples below for a starting point to enable them.
-# defaults
+# Example defaults
# These settings are used by login(1) by default for classless users
# Note that entries like "cputime" set both "cputime-cur" and "cputime-max"
@@ -24,7 +24,8 @@ default:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
:path=~/bin /bin /usr/bin /usr/local/bin:\
- :nologin=/var/run/nologin:\
+ :manpath=/usr/share/man /usr/local/man:\
+ :nologin=/etc/nologin:\
:cputime=unlimited:\
:datasize=unlimited:\
:stacksize=unlimited:\
@@ -125,7 +126,7 @@ russian:Russian Users Accounts:\
# :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
# :path=~/bin /bin /usr/bin /usr/local/bin:\
# :manpath=/usr/share/man /usr/local/man:\
-# :nologin=/var/run/nologin:\
+# :nologin=/etc/nologin:\
# :cputime=1h30m:\
# :datasize=8M:\
# :stacksize=2M:\
@@ -324,4 +325,4 @@ russian:Russian Users Accounts:\
#russian:Russian Users Accounts:\
# :charset=KOI8-R:\
# :lang=ru_RU.KOI8-R:\
-# :tc=default:
+# :tc=default: \ No newline at end of file
diff --git a/etc/make.conf b/etc/make.conf
index 38c1953dd2c0..796e0a44dc9a 100644
--- a/etc/make.conf
+++ b/etc/make.conf
@@ -1,4 +1,4 @@
-# $Id: make.conf,v 1.72 1999/01/11 15:06:57 peter Exp $
+# $Id: make.conf,v 1.69 1998/08/29 01:24:21 dillon Exp $
#
# This file, if present, will be read by make (see /usr/share/mk/sys.mk).
# It allows you to override macro definitions to make without changing
@@ -13,12 +13,13 @@
#
#CFLAGS= -O -pipe
#
+# Another useful entry is
#
-# Avoid compiling profiled libraries
#NOPROFILE= true
+# Avoid compiling profiled libraries
#
-# Compare before install
#INSTALL=install -C
+# Compare before install
#
# To avoid building the default system perl
#NOPERL= true
@@ -37,6 +38,14 @@
#
#COPTFLAGS= -O -pipe
#
+# To use an ELF kernel, you can set this flag. MAKE SURE that you have a
+# working /boot/loader installed. /boot.config should specify "/boot/loader"
+# as the kernel. The bootblocks load the third stage loader, then it loads
+# the kernel proper and any other modules you want. Its startup script
+# file is /boot/loader.conf:
+#
+#KERNFORMAT= elf
+#
# To compile and install the 4.4 lite libm instead of the default use:
#
#WANT_CSRG_LIBM= yes
@@ -134,7 +143,7 @@
# remove the "/${DIST_SUBDIR}/" part.)
#
#MASTER_SITE_BACKUP?= \
-# ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
+# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
#
# If you want your port fetches to check the above site first (before
# the MASTER_SITES specified in the port Makefiles), uncomment the
@@ -157,9 +166,6 @@
#MASTER_SITE_PERL_CPAN= ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/%SUBDIR%/
#MASTER_SITE_TEX_CTAN= ftp://ftp.tex.ac.uk/tex-archive/%SUBDIR%/
#MASTER_SITE_SUNSITE= ftp://sunsite.unc.edu/pub/Linux/%SUBDIR%/
-#MASTER_SITE_KDE= ftp://ftp.kde.org/pub/kde/%SUBDIR%/
-#MASTER_SITE_COMP_SOURCES= ftp://gatekeeper.dec.com/pub/usenet/comp.sources.%SUBDIR%/
-#MASTER_SITE_GNOME= ftp://ftp.gnome.org/pub/GNOME/sources/%SUBDIR%/
#
#
# Kerberos IV
@@ -186,6 +192,7 @@
#SUPFILE= /usr/share/examples/cvsup/standard-supfile
#SUPFILE1= /usr/share/examples/cvsup/secure-supfile
#SUPFILE2= /usr/share/examples/cvsup/ports-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
@@ -193,3 +200,5 @@
# /etc/passwd. The default number is 20011.
#
#TOP_TABLE_SIZE= 101
+
+
diff --git a/etc/master.passwd b/etc/master.passwd
index 3dfc4ab46b61..fed210d5a117 100644
--- a/etc/master.passwd
+++ b/etc/master.passwd
@@ -1,14 +1,11 @@
root::0:0::0:0:Charlie &:/root:/bin/csh
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system processes:/root:/sbin/nologin
-operator:*:2:5::0:0:System &:/:/sbin/nologin
+operator:*:2:5::0:0:System &:/usr/guest/operator:/bin/csh
bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/sbin/nologin
-tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
-kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/usr/games:/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/sbin/nologin
-bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist
index c5133e37f998..42b6784942f6 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -1,4 +1,4 @@
-# $Id: BSD.include.dist,v 1.23 1998/12/13 04:31:15 dillon Exp $
+# $Id: BSD.include.dist,v 1.20 1998/09/15 11:44:39 phk Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -51,8 +51,6 @@
..
rpcsvc
..
- security
- ..
ss
..
sys
diff --git a/etc/mtree/BSD.local.dist b/etc/mtree/BSD.local.dist
index 0ff160db7ec7..ef4383a3d81e 100644
--- a/etc/mtree/BSD.local.dist
+++ b/etc/mtree/BSD.local.dist
@@ -1,4 +1,4 @@
-# $Id: BSD.local.dist,v 1.43 1998/12/14 07:44:46 dillon Exp $
+# $Id: BSD.local.dist,v 1.41 1998/09/19 18:50:27 obrien Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -168,10 +168,6 @@
..
doc
..
- emacs
- site-lisp
- ..
- ..
examples
..
misc
@@ -229,8 +225,6 @@
..
lt_LN.ISO_8859-2
..
- lt_LN.DIS_8859-15
- ..
nl_BE.ISO_8859-1
..
nl_NL.ISO_8859-1
diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist
index 909ad26aa142..ae323b865f84 100644
--- a/etc/mtree/BSD.root.dist
+++ b/etc/mtree/BSD.root.dist
@@ -1,4 +1,4 @@
-# $Id: BSD.root.dist,v 1.36 1999/01/10 14:30:53 hm Exp $
+# $Id: BSD.root.dist,v 1.30 1998/09/19 18:50:27 obrien Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -24,8 +24,6 @@
..
gnats
..
- isdn mode=0700
- ..
kerberosIV
..
mail
@@ -33,10 +31,6 @@
mtree
..
namedb
-# leave commented out until buildworld/installworld can
-# handle new user ids
-# s uname=bind gname=bind mode=0750
-# ..
..
ppp
..
@@ -49,15 +43,13 @@
..
mnt
..
- modules
- ..
proc mode=0555
..
root
..
sbin
..
- tmp mode=01777
+ tmp uname=root gname=wheel mode=01777
..
usr
..
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 6788be23886e..a8ad19f01f22 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -1,4 +1,4 @@
-# $Id: BSD.usr.dist,v 1.145 1999/01/09 21:47:01 jdp Exp $
+# $Id: BSD.usr.dist,v 1.134 1998/10/07 02:55:59 jkh Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -215,10 +215,6 @@
28.cvs
..
..
- ru
- FAQ
- ..
- ..
smm
01.setup
..
@@ -301,8 +297,6 @@
..
atm
..
- bootforth
- ..
cvs
contrib
..
@@ -321,22 +315,6 @@
..
ibcs2
..
- isdn
- ..
- kld
- cdev
- module
- ..
- test
- ..
- ..
- syscall
- module
- ..
- test
- ..
- ..
- ..
libvgl
..
lkm
@@ -359,8 +337,6 @@
..
perfmon
..
- portal
- ..
ppi
..
printing
@@ -425,76 +401,42 @@
locale
da_DK.ISO_8859-1
..
- da_DK.DIS_8859-15
- ..
de_AT.ISO_8859-1
..
- de_AT.DIS_8859-15
- ..
de_CH.ISO_8859-1
..
- de_CH.DIS_8859-15
- ..
de_DE.ISO_8859-1
..
- de_DE.DIS_8859-15
- ..
en_AU.ISO_8859-1
..
- en_AU.DIS_8859-15
- ..
en_CA.ISO_8859-1
..
- en_CA.DIS_8859-15
- ..
en_GB.ISO_8859-1
..
- en_GB.DIS_8859-15
- ..
en_US.ISO_8859-1
..
- en_US.DIS_8859-15
- ..
es_ES.ISO_8859-1
..
- es_ES.DIS_8859-15
- ..
fi_FI.ISO_8859-1
..
- fi_FI.DIS_8859-15
- ..
fr_BE.ISO_8859-1
..
- fr_BE.DIS_8859-15
- ..
fr_CA.ISO_8859-1
..
- fr_CA.DIS_8859-15
- ..
fr_CH.ISO_8859-1
..
- fr_CH.DIS_8859-15
- ..
fr_FR.ISO_8859-1
..
- fr_FR.DIS_8859-15
- ..
hr_HR.ISO_8859-2
..
hu_HU.ISO_8859-2
..
is_IS.ISO_8859-1
..
- is_IS.DIS_8859-15
- ..
it_CH.ISO_8859-1
..
- it_CH.DIS_8859-15
- ..
it_IT.ISO_8859-1
..
- it_IT.DIS_8859-15
- ..
ja_JP.EUC
..
ja_JP.SJIS
@@ -507,26 +449,16 @@
..
lt_LN.ISO_8859-2
..
- lt_LN.DIS_8859-15
- ..
nl_BE.ISO_8859-1
..
- nl_BE.DIS_8859-15
- ..
nl_NL.ISO_8859-1
..
- nl_NL.DIS_8859-15
- ..
no_NO.ISO_8859-1
..
- no_NO.DIS_8859-15
- ..
pl_PL.ISO_8859-2
..
pt_PT.ISO_8859-1
..
- pt_PT.DIS_8859-15
- ..
ru_SU.CP866
..
ru_SU.KOI8-R
@@ -535,8 +467,6 @@
..
sv_SE.ISO_8859-1
..
- sv_SE.DIS_8859-15
- ..
zh_CN.EUC
..
zh_TW.BIG5
@@ -572,7 +502,7 @@
..
catn
..
- ja uname=root
+ ja uname=root gname=wheel
cat1
..
cat2
@@ -709,8 +639,6 @@
..
lt_LN.ISO_8859-2
..
- lt_LN.DIS_8859-15
- ..
nl_BE.ISO_8859-1
..
nl_NL.ISO_8859-1
diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist
index 4fe7dc5794af..3bf3141e3137 100644
--- a/etc/mtree/BSD.var.dist
+++ b/etc/mtree/BSD.var.dist
@@ -1,4 +1,4 @@
-# $Id: BSD.var.dist,v 1.37 1998/09/19 18:50:27 obrien Exp $
+# $Id: BSD.var.dist,v 1.36 1998/09/14 08:34:45 obrien Exp $
#
/set type=dir uname=root gname=wheel mode=0755
@@ -21,7 +21,7 @@
tabs
..
..
- db mode=0755
+ db uname=root gname=wheel mode=0755
..
/set type=dir uname=root gname=wheel mode=0755
games gname=games mode=0775
@@ -34,10 +34,9 @@
phantasia gname=games mode=0775
..
..
-/set type=dir uname=root gname=wheel mode=0755
log
..
- mail gname=mail mode=0775
+ mail uname=root gname=mail mode=0775
..
msgs uname=daemon
..
@@ -45,20 +44,20 @@
..
run
..
-/set type=dir uname=root gname=daemon mode=0755
- rwho gname=daemon mode=0775
+ rwho uname=root gname=daemon mode=0775
..
- spool gname=wheel
- lock uname=uucp gname=dialer mode=0775
+/set type=dir uname=uucp gname=daemon mode=0755
+ spool uname=root gname=wheel
+ lock gname=dialer mode=0775
..
- lpd
+ lpd uname=root
..
- mqueue
+ mqueue uname=root
..
- opielocks mode=0700
+ opielocks uname=root mode=0700
..
- output
- lpd
+ output uname=root
+ lpd uname=root gname=daemon
..
..
/set type=dir uname=uucp gname=uucp mode=0775
@@ -82,7 +81,6 @@
vi.recover
..
..
-/set type=dir uname=root gname=wheel mode=0755
- yp
+ yp mode=0755
..
..
diff --git a/etc/namedb/named.conf b/etc/namedb/named.conf
index ee22c00eca40..31bb0753a87e 100644
--- a/etc/namedb/named.conf
+++ b/etc/namedb/named.conf
@@ -1,4 +1,4 @@
-// $Id: named.conf,v 1.4 1998/12/02 19:59:24 dillon Exp $
+// $Id: named.conf,v 1.1 1998/05/07 23:42:33 ache Exp $
//
// Refer to the named(8) man page for details. If you are ever going
// to setup a primary server, make sure you've understood the hairy
@@ -31,12 +31,6 @@ options {
* port by default.
*/
// query-source address * port 53;
-
- /*
- * If running in a sandbox, you may have to specify a different
- * location for the dumpfile.
- */
- // dump-file "s/named_dump.db";
};
// Note: the following will be supported in a future release.
@@ -83,19 +77,11 @@ zone "0.0.127.IN-ADDR.ARPA" {
//
// NB: Don't blindly enable the examples below. :-) Use actual names
// and addresses instead.
-//
-// NOTE!!! FreeBSD runs bind in a sandbox (see named_flags in rc.conf).
-// The directory containing the secondary zones must be write accessible
-// to bind. The following sequence is suggested:
-//
-// mkdir /etc/namedb/s
-// chown bind.bind /etc/namedb/s
-// chmod 750 /etc/namedb/s
/*
zone "domain.com" {
type slave;
- file "s/domain.com.bak";
+ file "domain.com.bak";
masters {
192.168.1.1;
};
@@ -103,7 +89,7 @@ zone "domain.com" {
zone "0.168.192.in-addr.arpa" {
type slave;
- file "s/0.168.192.in-addr.arpa.bak";
+ file "0.168.192.in-addr.arpa.bak";
masters {
192.168.1.1;
};
diff --git a/etc/pam.conf b/etc/pam.conf
deleted file mode 100644
index 3f66affcbcb5..000000000000
--- a/etc/pam.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-# Configuration file for Pluggable Authentication Modules (PAM).
-#
-# This file controls the authentication methods that login and other
-# utilities use. See pam(8) for a description of its format.
-#
-# Note: the final entry must say "required" -- otherwise, things don't
-# work quite right. If you delete the final entry, be sure to change
-# "sufficient" to "required" in the entry before it.
-#
-# $FreeBSD$
-
-# If the user can authenticate with S/Key, that's sufficient.
-login auth sufficient pam_skey.so
-
-# Check skey.access to make sure it is OK to let the user type in
-# a cleartext password. If not, then fail right here.
-login auth requisite pam_cleartext_pass_ok.so
-
-# If you want KerberosIV authentication, uncomment the next line:
-#login auth sufficient pam_kerberosIV.so try_first_pass
-
-# Traditional getpwnam() authentication.
-login auth required pam_unix.so try_first_pass
diff --git a/etc/pccard.conf.sample b/etc/pccard.conf.sample
index ba2547974ab6..c41f6f49affb 100644
--- a/etc/pccard.conf.sample
+++ b/etc/pccard.conf.sample
@@ -8,7 +8,7 @@
# IRQ == 0 means "allocate free IRQ from IRQ pool"
# IRQ == 16 means "do not use IRQ (e.g. PIO mode)"
#
-# $Id: pccard.conf.sample,v 1.23 1998/09/25 22:08:53 brian Exp $
+# $Id: pccard.conf.sample,v 1.22 1998/09/12 18:53:49 msmith Exp $
# Generally available IO ports
io 0x240-0x360
@@ -340,12 +340,6 @@ card "NTT DoCoMo" "PCMCIA DATA/FAX ADA"
insert echo NTT DoCoMo DATA/FAX Adapter inserted
remove echo NTT DoCoMo DATA/FAX Adapter removed
-# Random modem bundled with Dell systems
-card "Psion Dacom" "Gold Card Global 56K+Fax"
- config 0x23 "sio2" 10
- insert echo "Psion Dacom modem card inserted"
- remove echo "Psion Dacom modem card removed"
-
# Panasonic FM-RADIO card
#card "Panasonic" "CF-JVR101"
# config 0x22 "sio3" 16
diff --git a/etc/periodic/daily/340.uucp b/etc/periodic/daily/340.uucp
index e83e2b0aa265..0fc51fcc02d2 100755
--- a/etc/periodic/daily/340.uucp
+++ b/etc/periodic/daily/340.uucp
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: 340.uucp,v 1.2 1997/08/17 17:55:32 pst Exp $
+# $Id: 340.uucp,v 1.1.1.1 1997/08/16 17:04:01 pst Exp $
#
# Local cleanup of UUCP files. This is for backwards compatibility,
# /etc/uuclean.daily doesn't exist by default.
@@ -9,6 +9,6 @@ if [ -d /var/spool/uucp -a -f /etc/uuclean.daily ]; then
echo ""
echo "Cleaning up UUCP:"
- echo /etc/uuclean.daily | su -m uucp
+ echo /etc/uuclean.daily | su daemon
fi
diff --git a/etc/ppp/ppp.linkdown.sample b/etc/ppp/ppp.linkdown.sample
index c0fa63882cfe..7c2ca36eb9fd 100644
--- a/etc/ppp/ppp.linkdown.sample
+++ b/etc/ppp/ppp.linkdown.sample
@@ -12,7 +12,7 @@
# 3) If no label has been found, use MYADDR if it exists.
#
#
-# $Id: ppp.linkdown.sample,v 1.1 1997/11/08 20:58:40 brian Exp $
+# $Id$
#
#########################################################################
@@ -24,11 +24,3 @@
#
MYADDR:
!bg /usr/X11R6/bin/auplay /etc/ppp/linkdown.au
-
-# If you're running ``ppp -auto -alias dynamic-alias-auto'', and are
-# assigned a dynamic IP number by the peer, this may be worth while
-# to keep the interface aliases to a minimum (see ``enable iface-alias''
-# in the man page):
-#
-dynamic-alias-auto:
- iface clear
diff --git a/etc/rc b/etc/rc
index 8a61f90f850d..120354680624 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc,v 1.168 1999/01/18 03:25:10 grog Exp $
+# $Id: rc,v 1.159 1998/10/08 18:47:29 des Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@@ -27,15 +27,6 @@ if [ -f /etc/ccd.conf ]; then
ccdconfig -C
fi
-if [ -n "$vinum_slices" ]; then
- if [ -r /modules/vinum.ko ]; then # jkh paranoia
- kldload vinum
- vinum read $vinum_slices
- else
- echo "Can't find /modules/vinum.ko"
- fi
-fi
-
swapon -a
if [ $1x = autobootx ]; then
@@ -75,7 +66,8 @@ fi
trap "echo 'Reboot interrupted'; exit 1" 3
-# root must be read/write for NFS diskless before proceeding any further.
+# root must be read/write both for NFS diskless and for VFS LKMs before
+# proceeding any further.
mount -u -o rw /
if [ $? != 0 ]; then
echo "Filesystem mount failed, startup aborted"
@@ -153,6 +145,8 @@ echo .
chmod 666 /dev/tty[pqrsPQRS]*
# clean up left-over files
+rm -f /etc/nologin
+
clean_var # If it hasn't already been done
rm /var/run/clean_var
@@ -178,8 +172,9 @@ fi
# after a system crash.
rm -f /tmp/.X*-lock /tmp/.X11-unix/*
-# snapshot any kernel -c changes back to disk here <someday>
-# this has changed with ELF and /kernel.config.
+# snapshot any kernel -c changes back to disk
+echo 'recording kernel -c changes'
+dset -q
echo -n 'additional daemons:'
# start system logging and name service (named needs to start before syslogd
@@ -257,20 +252,17 @@ if [ -x /sbin/ldconfig ]; then
ldconfig -elf ${_LDC}
fi
- # Legacy aout support for i386 only
- if [ X"`sysctl -n hw.machine`" = X"i386" ]; then
- # Default the a.out ldconfig path, in case the system's
- # /etc/rc.conf hasn't been updated.
- : ${ldconfig_paths_aout=${ldconfig_paths}}
- _LDC=/usr/lib/aout
- for i in $ldconfig_paths_aout; do
- if test -d $i; then
- _LDC="${_LDC} $i"
- fi
- done
- echo 'setting a.out ldconfig path:' ${_LDC}
- ldconfig -aout ${_LDC}
- fi
+ # Default the a.out ldconfig path, in case the system's
+ # /etc/rc.conf hasn't been updated.
+ : ${ldconfig_paths_aout=${ldconfig_paths}}
+ _LDC=/usr/lib/aout
+ for i in $ldconfig_paths_aout; do
+ if test -d $i; then
+ _LDC="${_LDC} $i"
+ fi
+ done
+ echo 'setting a.out ldconfig path:' ${_LDC}
+ ldconfig -aout ${_LDC}
fi
# Now start up miscellaneous daemons that don't belong anywhere else
@@ -292,10 +284,6 @@ if [ "X${sendmail_enable}" = X"YES" -a -r /etc/sendmail.cf ]; then
echo -n ' sendmail'; /usr/sbin/sendmail ${sendmail_flags}
fi
-if [ "X${usbd_enable}" = X"YES" ]; then
- echo -n ' usbd'; /usr/sbin/usbd ${usbd_flags}
-fi
-
echo '.'
# configure implementation specific stuff
@@ -361,39 +349,11 @@ if [ "X${local_startup}" != X"NO" ]; then
echo .
fi
-if [ "X${update_motd}" != X"NO" ]; then
- T=/tmp/_motd
- rm -f $T
- uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T
- awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T
- cp $T /etc/motd
- chmod 644 /etc/motd
- rm -f $T
-fi
-
# Run rc.devfs if present to customify devfs
[ -f /etc/rc.devfs ] && sh /etc/rc.devfs
-# Do traditional (but rather obsolete) rc.local file if it exists. If you
-# use this file and want to make it programmatic, source /etc/rc.conf in
-# /etc/rc.local and add your custom variables to /etc/rc.conf.local, as
-# shown below. Please do not put local extensions into /etc/rc itself.
-# Use /etc/rc.local
-#
-# ---- rc.local ----
-# if [ -f /etc/rc.conf ]; then
-# . /etc/rc.conf
-# fi
-#
-# ... additional startup conditionals ...
-# ---- rc.local ----
-#
-
-if [ -f /etc/rc.local ]; then
- echo -n 'starting local daemons:'
- sh /etc/rc.local
- echo '.'
-fi
+# Do traditional (but rather obsolete) rc.local file if it exists.
+[ -f /etc/rc.local ] && sh /etc/rc.local
# Raise kernel security level. This should be done only after `fsck' has
# repaired local file systems if you want the securelevel to be greater than 1.
diff --git a/etc/rc.conf b/etc/rc.conf
index 7a3d5ea067b7..e3050654beda 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -6,7 +6,7 @@
#
# All arguments must be in double or single quotes.
#
-# $Id: rc.conf,v 1.75 1999/01/13 17:32:37 joerg Exp $
+# $Id: rc.conf,v 1.60 1998/10/06 19:24:14 phk Exp $
##############################################################
### Important initial Boot-time options #####################
@@ -38,39 +38,26 @@ tcp_extensions="NO" # Disallow RFC1323 extensions (or YES).
network_interfaces="lo0" # List of network interfaces (lo0 is loopback).
ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
-#
-# If you have any sppp(4) interfaces above, you might also want to set
-# the following parameters. Refer to spppcontrol(8) for their meaning.
-sppp_interfaces="" # List of sppp interfaces.
-#sppp_interfaces="isp0" # example: sppp over ISDN
-#spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'"
### Network daemon (miscellaneous) & NFS options: ###
syslogd_enable="YES" # Run syslog daemon (or NO).
syslogd_flags="" # Flags to syslogd (if enabled).
inetd_enable="YES" # Run the network daemon dispatcher (or NO).
inetd_flags="" # Optional flags to inetd.
-#
-# named. It may be possible to run named in a sandbox, man security for
-# details.
-#
named_enable="NO" # Run named, the DNS server (or NO).
named_program="named" # path to named, if you want a different one.
-named_flags="" # Flags for named
-#named_flags="-u bind -g bind" # Flags for named
-
+named_flags="" # Flags for named (/etc/namedb/named.conf is
+ # the default now).
kerberos_server_enable="NO" # Run a kerberos master server (or NO).
kadmind_server_enable="NO" # Run kadmind (or NO) -- do not run on
# a slave kerberos server
kerberos_stash="" # Is the kerberos master key stashed?
rwhod_enable="NO" # Run the rwho daemon (or NO).
-rwhod_flags="" # Flags for rwhod
amd_enable="NO" # Run amd service with $amd_flags (or NO).
amd_flags="-a /net -c 1800 -k i386 -d my.domain -l syslog /host /etc/amd.map"
amd_map_program="NO" # Can be set to "ypcat -k amd.master"
nfs_client_enable="NO" # This host is an NFS client (or NO).
nfs_client_flags="-n 4" # Flags to nfsiod (if enabled).
-nfs_access_cache="2" # Client cache timeout in seconds
nfs_server_enable="NO" # This host is an NFS server (or NO).
nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled).
mountd_flags="-r" # Flags to mountd (if NFS server enabled).
@@ -136,13 +123,6 @@ atm_enable="NO" # Configure ATM interfaces (or NO).
atm_pvcs="" # Set to PVC list (or leave empty).
atm_arps="" # Set to permanent ARP list (or leave empty).
-### ISDN interface options: ###
-isdn_enable="NO" # Enable the ISDN subsystem (or NO).
-isdn_fsdev="/dev/ttyv4" # Output device for fullscreen mode (or NO for daemon mode).
-isdn_flags="-dn -d0x1f9" # Flags for isdnd
-isdn_trace="NO" # Enable the ISDN trace subsystem (or NO).
-isdn_traceflags="-f /var/tmp/isdntrace0" # Flags for isdntrace
-
### Miscellaneous network options: ###
icmp_bmcastecho="NO" # respond to broadcast ping packets
@@ -161,7 +141,7 @@ font8x16="NO" # font 8x16 from /usr/share/syscons/fonts/* (or NO).
font8x14="NO" # font 8x14 from /usr/share/syscons/fonts/* (or NO).
font8x8="NO" # font 8x8 from /usr/share/syscons/fonts/* (or NO).
blanktime="300" # blank time (in seconds) or "NO" to turn it off.
-saver="NO" # screen saver: Uses /modules/${saver}_saver.ko
+saver="NO" # screen saver: blank/daemon/green/snake/star/NO.
moused_enable="NO" # Run the mouse daemon.
moused_type="auto" # See man page for rc.conf(5) for available settings.
moused_port="/dev/cuaa0" # Set to your mouse port.
@@ -176,8 +156,6 @@ allscreens_flags="" # Set this vidcontrol mode for all virtual screens
cron_enable="YES" # Run the periodic job daemon.
lpd_enable="NO" # Run the line printer daemon.
lpd_flags="" # Flags to lpd (if enabled).
-usbd_enable="NO" # Run the usbd daemon.
-usbd_flags="" # Flags to usbd (if enabled).
sendmail_enable="YES" # Run the sendmail daemon (or NO).
sendmail_flags="-bd -q30m" # -bd is pretty mandatory.
dumpdev="NO" # Device name to crashdump to (if enabled).
@@ -187,14 +165,10 @@ ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO).
linux_enable="NO" # Linux emulation loaded at startup (or NO).
rand_irqs="NO" # Stir the entropy pool (like "5 11" or NO).
clear_tmp_enable="NO" # Clear /tmp at startup.
-ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib"
- # shared library search paths
-ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout"
- # a.out shared library search paths
+ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib" # shared library search paths
+ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout" # a.out shared library search paths
kern_securelevel_enable="NO" # kernel security level (see init(8)),
-kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
-update_motd="YES" # update version info in /etc/motd (or NO)
-vinum_slices="" # put in names of vinum slices to enable vinum
+kern_securelevel="-1" # range: -1..2 ; `-1' is the most insecure
##############################################################
### Allow local configuration override at the very end here ##
diff --git a/etc/rc.isdn b/etc/rc.isdn
deleted file mode 100644
index ec159ccfd509..000000000000
--- a/etc/rc.isdn
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# /etc/rc.isdn - isdn4bsd startup script
-# --------------------------------------
-#
-# last edit-date: [Tue Jan 12 15:35:36 1999]
-#
-# $Id:$
-#
-#---------------------------------------------------------------------------
-
-if [ "X${isdn_enable}" = X"YES" ] ; then
-
- # terminal type for fullscreen mode, default to syscons driver
- isdn_ttype=cons25
-
- # check for pcvt driver (VT100/VT220 emulator)
- if [ -x /usr/sbin/ispcvt ] ; then
- if /usr/sbin/ispcvt ; then
- isdn_ttype=pcvt25
- fi
- fi
-
- if [ "X${isdn_flags}" = X"NO" ] ; then
- isdn_flags=""
- fi
-
- # start the isdn daemon
- if [ -x /usr/sbin/isdnd ] ; then
- echo -n ' isdnd'
- if [ "X${isdn_fsdev}" = X"NO" ] ; then
- /usr/sbin/isdnd ${isdn_flags}
- else
- /usr/sbin/isdnd ${isdn_flags} -f -r ${isdn_fsdev} -t ${isdn_ttype}
- fi
- fi
-
- # start isdntrace
- if [ "X${isdn_trace}" = X"YES" -a -x /usr/sbin/isdntrace ] ; then
- echo -n ' isdntrace'
- nohup /usr/sbin/isdntrace ${isdn_traceflags} >/dev/null 2>&1 &
- fi
-fi
diff --git a/etc/rc.local b/etc/rc.local
new file mode 100644
index 000000000000..5e6584402803
--- /dev/null
+++ b/etc/rc.local
@@ -0,0 +1,24 @@
+#
+# site-specific startup actions, daemons
+#
+# $Id: rc.local,v 1.24 1997/06/25 12:17:17 ache Exp $
+#
+
+# If there is a global system configuration file, suck it in.
+#if [ -f /etc/rc.conf ]; then
+# . /etc/rc.conf
+#fi
+
+T=/tmp/_motd
+rm -f $T
+uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T
+awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T
+cp $T /etc/motd
+chmod 644 /etc/motd
+rm -f $T
+
+echo -n 'starting local daemons:'
+
+# put your local stuff here
+
+echo '.'
diff --git a/etc/rc.network b/etc/rc.network
index 49e936a900c8..cf9ff66d6619 100644
--- a/etc/rc.network
+++ b/etc/rc.network
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: rc.network,v 1.38 1999/01/13 08:20:55 hm Exp $
+# $Id: rc.network,v 1.32 1998/09/16 20:38:23 cracauer Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@@ -31,25 +31,6 @@ network_pass1() {
atm_pass1
fi
- # ISDN subsystem startup
- if [ "X${isdn_enable}" = X"YES" -a -f /etc/rc.isdn ]; then
- . /etc/rc.isdn
- fi
-
- # Special options for sppp(4) interfaces go here. These need
- # to go _before_ the general ifconfig section, since in the case
- # of hardwired (no link1 flag) but required authentication, you
- # cannot pass auth parameters down to the already running interface.
- for ifn in ${sppp_interfaces}; do
- eval spppcontrol_args=\$spppconfig_${ifn}
- if [ -n "${spppcontrol_args}" ] ; then
- # The auth secrets might contain spaces; in order
- # to retain the quotation, we need to eval them
- # here.
- eval spppcontrol ${ifn} ${spppcontrol_args}
- fi
- done
-
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
if [ -e /etc/start_if.${ifn} ]; then
@@ -90,7 +71,7 @@ network_pass1() {
fi
if [ $firewall_in_kernel = 0 -a "x$firewall_enable" = "xYES" ] ; then
- if kldload ipfw; then
+ if modload /lkm/ipfw_mod.o; then
firewall_in_kernel=1 # module loaded successfully
echo "Kernel firewall module loaded."
else
@@ -277,10 +258,6 @@ network_pass3() {
if [ "X${nfs_client_enable}" = X"YES" ]; then
echo -n ' nfsiod'; nfsiod ${nfs_client_flags}
- if [ "X${nfs_access_cache}" != X ]; then
- sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
- >/dev/null 2>&1
- fi
fi
if [ "X${amd_enable}" = X"YES" ]; then
@@ -292,7 +269,7 @@ network_pass3() {
fi
if [ "X${rwhod_enable}" = X"YES" ]; then
- echo -n ' rwhod'; rwhod ${rwhod_flags}
+ echo -n ' rwhod'; rwhod
fi
# Kerberos runs ONLY on the Kerberos server machine
diff --git a/etc/security b/etc/security
index 41c3e1d09cf2..bf0094e6bf38 100644
--- a/etc/security
+++ b/etc/security
@@ -1,7 +1,7 @@
#!/bin/sh -
#
# @(#)security 5.3 (Berkeley) 5/28/91
-# $Id: security,v 1.28 1999/01/01 17:37:33 billf Exp $
+# $Id: security,v 1.26 1998/08/11 08:48:54 des Exp $
#
PATH=/sbin:/bin:/usr/bin
LC_ALL=C; export LC_ALL
@@ -11,7 +11,7 @@ separator () {
echo ""
}
-host=`hostname`
+host=`hostname -s`
echo "Subject: $host security check output"
LOG=/var/log
@@ -103,7 +103,7 @@ fi
# show login failures
separator
echo "$host login failures:"
-grep -i "login failure" $LOG/messages
+grep -i "login failures" $LOG/messages
# show tcp_wrapper warning messages
separator
diff --git a/etc/sendmail/freebsd.mc b/etc/sendmail/freebsd.mc
index beb16cc45521..c1bbe0745ef5 100644
--- a/etc/sendmail/freebsd.mc
+++ b/etc/sendmail/freebsd.mc
@@ -34,29 +34,21 @@ divert(-1)
#
#
-# This is a generic configuration file for 4.4 BSD-based systems.
-# If you want to customize it, copy it to a name appropriate for your
-# environment and do the modifications there.
-#
-# The best documentation for this .mc file is:
-# /usr/src/contrib/sendmail/cf/README
+# This is a generic configuration file for 4.4 BSD-based systems,
+# including 4.4-Lite, BSDi, NetBSD, and FreeBSD.
+# It has support for local and SMTP mail only. If you want to
+# customize it, copy it to a name appropriate for your environment
+# and do the modifications there.
#
divert(0)dnl
-VERSIONID(`@(#)freebsd.mc $Revision: 1.3 $')
+VERSIONID(`@(#)freebsd.mc $Revision: 1.2 $')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
-FEATURE(relay_based_on_MX)dnl
-FEATURE(mailertable, `hash -o /etc/mail/mailertable')dnl
-FEATURE(access_db, hash -o /etc/mail/access')dnl
-FEATURE(blacklist_recipients)dnl
-FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')dnl
-dnl Uncomment to activate Realtime Blackhole List (recommended!)
-dnl FEATURE(rbl)dnl
-FEATURE(local_lmtp)dnl
-define(`LOCAL_MAILER_FLAGS', LOCAL_MAILER_FLAGS`'P)dnl
-define(`confCW_FILE', `-o /etc/mail/sendmail.cw')dnl
-define(`confNO_RCPT_ACTION', `add-to-undisclosed')dnl
-define(`confMAX_MIME_HEADER_LENGTH', `256/128')dnl
MAILER(local)dnl
MAILER(smtp)dnl
+FEATURE(mailertable, `hash -o /etc/mailertable')dnl
+define(`UUCP_RELAY', ucbvax.Berkeley.EDU)dnl
+define(`BITNET_RELAY', mailhost.Berkeley.EDU)dnl
+define(`CSNET_RELAY', mailhost.Berkeley.EDU)dnl
+define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
diff --git a/games/Makefile.inc b/games/Makefile.inc
index 40a87cb917fd..acf28b792e43 100644
--- a/games/Makefile.inc
+++ b/games/Makefile.inc
@@ -1,10 +1,9 @@
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
BINGRP= games
-BINDIR?= /usr/games
-
.if defined(HIDEGAME)
-GBINDIR:= ${BINDIR}
-BINDIR:= ${BINDIR}/hide
+BINDIR?= /usr/games/hide
BINMODE= 550
+.else
+BINDIR= /usr/games
.endif
diff --git a/games/adventure/Makefile b/games/adventure/Makefile
index 52c3649b363e..07de907d661e 100644
--- a/games/adventure/Makefile
+++ b/games/adventure/Makefile
@@ -5,7 +5,7 @@ SRCS= main.c init.c done.c save.c subr.c vocab.c wizard.c io.c data.c crc.c
MAN6= adventure.6
CFLAGS+=-traditional-cpp
HIDEGAME=hidegame
-CLEANFILES=data.c setup setup.o
+CLEANFILES+=setup data.c
build-tools: setup
diff --git a/games/factor/factor.6 b/games/factor/factor.6
index 1dda93d60bfe..7a9ea12c1bb4 100644
--- a/games/factor/factor.6
+++ b/games/factor/factor.6
@@ -34,27 +34,25 @@
.\"
.\" @(#)factor.6 8.1 (Berkeley) 5/31/93
.\"
-.\" $Id:$
.\"
.\" By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
.\"
.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
.\"
-.TH FACTOR 6 "Jan 7, 1999"
+.TH FACTOR 6 "May 31, 1993"
.UC 7
.SH NAME
factor, primes \- factor a number, generate primes
.SH SYNOPSIS
.B factor
--[h] [ number ] ...
+[ number ] ...
.PP
.B primes
--[h] [ start [ stop ]]
+[ start [ stop ]]
.SH DESCRIPTION
The
.I factor
-utility will factor integers between 0 and ULONG_MAX (4294967295 on 32
-bit architectures, 18446744073709551615 on 64 bit ones), inclusive.
+utility will factor integers between -2147483648 and 2147483647 inclusive.
When a number is factored, it is printed, followed by a ``:'',
and the list of factors on a single line.
Factors are listed in ascending order, and are preceded by a space.
@@ -108,11 +106,6 @@ The
.B start
value is terminated by a non-digit character (such as a newline).
The input line must not be longer than 255 characters.
-.SH OPTIONS
-.LP
-.TP 8
-.B \-h
-Print the results in hexadecimal rather than decimal.
.SH DIAGNOSTICS
Out of range or invalid input results in `ouch' being
written to standard error.
diff --git a/games/factor/factor.c b/games/factor/factor.c
index aa64dd50686d..157cecbdd6fd 100644
--- a/games/factor/factor.c
+++ b/games/factor/factor.c
@@ -82,8 +82,6 @@ static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95";
extern ubig prime[];
extern ubig *pr_limit; /* largest prime in the prime array */
-int hflag;
-
void pr_fact __P((ubig)); /* print factors of a value */
void usage __P((void));
@@ -96,11 +94,8 @@ main(argc, argv)
int ch;
char *p, buf[100]; /* > max number of digits. */
- while ((ch = getopt(argc, argv, "h")) != -1)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
- case 'h':
- hflag++;
- break;
case '?':
default:
usage();
@@ -122,7 +117,7 @@ main(argc, argv)
if (*p == '-')
errx(1, "negative numbers aren't permitted.");
errno = 0;
- val = strtoul(buf, &p, 0);
+ val = strtoul(buf, &p, 10);
if (errno)
err(1, "%s", buf);
if (*p != '\n')
@@ -135,7 +130,7 @@ main(argc, argv)
if (argv[0][0] == '-')
errx(1, "negative numbers aren't permitted.");
errno = 0;
- val = strtoul(argv[0], &p, 0);
+ val = strtoul(argv[0], &p, 10);
if (errno)
err(1, "%s", argv[0]);
if (*p != '\0')
@@ -173,7 +168,7 @@ pr_fact(val)
}
/* Factor value. */
- (void)printf(hflag ? "0x%lx:" : "%lu:", val);
+ (void)printf("%lu:", val);
for (fact = &prime[0]; val > 1; ++fact) {
/* Look for the smallest factor. */
do {
@@ -183,15 +178,15 @@ pr_fact(val)
/* Watch for primes larger than the table. */
if (fact > pr_limit) {
- (void)printf(hflag ? " 0x%lx" : " %lu", val);
+ (void)printf(" %lu", val);
break;
}
/* Divide factor out until none are left. */
do {
- (void)printf(hflag ? " 0x%lx" : " %lu", *fact);
- val /= *fact;
- } while ((val % *fact) == 0);
+ (void)printf(" %lu", *fact);
+ val /= (long)*fact;
+ } while ((val % (long)*fact) == 0);
/* Let the user know we're doing something. */
(void)fflush(stdout);
@@ -202,6 +197,6 @@ pr_fact(val)
void
usage()
{
- (void)fprintf(stderr, "usage: factor -h [value ...]\n");
+ (void)fprintf(stderr, "usage: factor [value ...]\n");
exit (0);
}
diff --git a/games/fortune/Makefile.inc b/games/fortune/Makefile.inc
deleted file mode 100644
index 63751fb0bf14..000000000000
--- a/games/fortune/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-.if exists(${.CURDIR}/../../Makefile.inc)
-.include "${.CURDIR}/../../Makefile.inc"
-.endif
diff --git a/games/fortune/datfiles/Makefile b/games/fortune/datfiles/Makefile
index 802c24e34bc8..daeaeb10e888 100644
--- a/games/fortune/datfiles/Makefile
+++ b/games/fortune/datfiles/Makefile
@@ -4,39 +4,34 @@ FILES= fortunes fortunes2 startrek zippy
BLDS= fortunes.dat fortunes2.dat startrek.dat zippy.dat \
fortunes-o fortunes-o.dat
-# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE
-# THREE LINES AND UNCOMMENT THE FOURTH LINE.
+# TO INSTALL THE POTENTIALLY OFFENSIVE FORTUNES, UNCOMMENT THE THREE
+# LINES AND COMMENT OUT THE FOURTH LINE.
-# THE THREE LINES:
+# THE THREE LINES
FILES+= fortunes2-o limerick
BLDS+= fortunes2-o.dat limerick.dat
TYPE= real
-# THE FOURTH LINE:
+# THE FOURTH LINE
#TYPE= fake
CLEANFILES+=${BLDS}
-all: ${BLDS}
+all: ${FILES} ${BLDS}
-beforeinstall:
+install:
(cd ${.CURDIR} && ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} \
- -m ${NOBINMODE} ${FILES} ${DESTDIR}${SHAREDIR}/games/fortune)
+ -m ${NOBINMODE} ${FILES} ${DESTDIR}${SHAREDIR}/games/fortune)
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${BLDS} \
${DESTDIR}${SHAREDIR}/games/fortune
-.for f in fortunes fortunes2 fortunes2-o limerick startrek zippy
-$f.dat: $f
- PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
- strfile -rs ${.ALLSRC} ${.TARGET}
-.endfor
+fortunes.dat fortunes2.dat fortunes2-o.dat limerick.dat startrek.dat zippy.dat:
+ strfile -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
fortunes-o.dat: fortunes-o
- PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
- strfile -rsx ${.ALLSRC} ${.TARGET}
+ strfile -rsx fortunes-o ${.TARGET}
fortunes-o: fortunes-o.${TYPE}
- PATH=$$PATH:/usr/games:${.OBJDIR}/../../caesar \
- caesar 13 < ${.ALLSRC} > ${.TARGET}
+ caesar 13 < ${.ALLSRC} > ${.TARGET}
.include <bsd.prog.mk>
diff --git a/games/fortune/datfiles/fortunes b/games/fortune/datfiles/fortunes
index c00e1041f1bb..c82fd51f9d5e 100644
--- a/games/fortune/datfiles/fortunes
+++ b/games/fortune/datfiles/fortunes
@@ -15380,7 +15380,7 @@ except our fingertips will have been singed.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982
%
When you are about to do an objective and scientific piece of
-investigation of a topic, it is well to have the answer firmly in hand,
+investigation of a topic, it is well to gave the answer firmly in hand,
so that you can proceed forthrightly, without being deflected or
swayed, directly to the goal.
-- Amrom Katz
diff --git a/games/fortune/datfiles/fortunes2 b/games/fortune/datfiles/fortunes2
index 38f469d7991d..024d3cc7692e 100644
--- a/games/fortune/datfiles/fortunes2
+++ b/games/fortune/datfiles/fortunes2
@@ -52318,7 +52318,7 @@ When you are about to die, a wombat is better than no company at all.
-- Roger Zelazny, "Doorways in the Sand"
%
When you are about to do an objective and scientific piece of investigation
-of a topic, it is well to have the answer firmly in hand, so that you can
+of a topic, it is well to gave the answer firmly in hand, so that you can
proceed forthrightly, without being deflected or swayed, directly to the
goal.
-- Amrom Katz
diff --git a/games/hack/Makefile b/games/hack/Makefile
index e85125c90800..3c308f048070 100644
--- a/games/hack/Makefile
+++ b/games/hack/Makefile
@@ -18,7 +18,7 @@ DPADD= ${LIBTERMCAP} ${LIBCOMPAT}
LDADD= -ltermcap -lcompat
CFLAGS+= -fwritable-strings -I${.CURDIR} -I.
HIDEGAME=hidegame
-CLEANFILES=hack.onames.h makedefs makedefs.o
+CLEANFILES+= hack.onames.h makedefs
build-tools: makedefs
diff --git a/games/primes/primes.c b/games/primes/primes.c
index 7211de5bccfd..e928885d6211 100644
--- a/games/primes/primes.c
+++ b/games/primes/primes.c
@@ -101,8 +101,6 @@ extern ubig *pr_limit; /* largest prime in the prime array */
extern char pattern[];
extern int pattern_size; /* length of pattern array */
-int hflag;
-
void primes __P((ubig, ubig));
ubig read_num_buf __P((void));
void usage __P((void));
@@ -117,11 +115,8 @@ main(argc, argv)
int ch;
char *p;
- while ((ch = getopt(argc, argv, "h")) != -1)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
- case 'h':
- hflag++;
- break;
case '?':
default:
usage();
@@ -145,14 +140,14 @@ main(argc, argv)
errx(1, "negative numbers aren't permitted.");
errno = 0;
- start = strtoul(argv[0], &p, 0);
+ start = strtoul(argv[0], &p, 10);
if (errno)
err(1, "%s", argv[0]);
if (*p != '\0')
errx(1, "%s: illegal numeric format.", argv[0]);
errno = 0;
- stop = strtoul(argv[1], &p, 0);
+ stop = strtoul(argv[1], &p, 10);
if (errno)
err(1, "%s", argv[1]);
if (*p != '\0')
@@ -164,7 +159,7 @@ main(argc, argv)
errx(1, "negative numbers aren't permitted.");
errno = 0;
- start = strtoul(argv[0], &p, 0);
+ start = strtoul(argv[0], &p, 10);
if (errno)
err(1, "%s", argv[0]);
if (*p != '\0')
@@ -205,7 +200,7 @@ read_num_buf()
if (*p == '-')
errx(1, "negative numbers aren't permitted.");
errno = 0;
- val = strtoul(buf, &p, 0);
+ val = strtoul(buf, &p, 10);
if (errno)
err(1, "%s", buf);
if (*p != '\n')
@@ -261,7 +256,7 @@ primes(start, stop)
for (p = &prime[0], factor = prime[0];
factor < stop && p <= pr_limit; factor = *(++p)) {
if (factor >= start) {
- printf(hflag ? "0x%lx\n" : "%lu\n", factor);
+ printf("%lu\n", factor);
}
}
/* return early if we are done */
@@ -324,7 +319,7 @@ primes(start, stop)
*/
for (q = table; q < tab_lim; ++q, start+=2) {
if (*q) {
- printf(hflag ? "0x%lx\n" : "%lu\n", start);
+ printf("%lu\n", start);
}
}
}
@@ -333,6 +328,6 @@ primes(start, stop)
void
usage()
{
- (void)fprintf(stderr, "usage: primes [-h] [start [stop]]\n");
+ (void)fprintf(stderr, "usage: primes [start [stop]]\n");
exit(1);
}
diff --git a/gnu/lib/libgmp/Makefile b/gnu/lib/libgmp/Makefile
index 37e390f392c3..4621b00710b2 100644
--- a/gnu/lib/libgmp/Makefile
+++ b/gnu/lib/libgmp/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.20 1998/12/16 04:59:53 imp Exp $
+# $Id: Makefile,v 1.18 1998/05/24 21:51:50 eivind Exp $
#
LIB= gmp
@@ -23,13 +23,6 @@ CFLAGS+= -I${GMPDIR}/mpn/x86
MPN_SRC_ASM= add_n.S addmul_1.S lshift.S mul_1.S rshift.S sub_n.S submul_1.S
-.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
-.PATH: ${GMPDIR}/mpn/mips3 ${GMPDIR}/mpn/generic
-
-CFLAGS+= -I${GMPDIR}/mpn/mips3
-
-MPN_SRC_ASM= add_n.s addmul_1.s lshift.s mul_1.s rshift.s sub_n.s submul_1.s
-
.elif ${MACHINE_ARCH} == "m68k"
.PATH: ${GMPDIR}/mpn/m68k ${GMPDIR}/mpn/generic
@@ -143,5 +136,18 @@ beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${GMPDIR}/gmp.h ${DESTDIR}/usr/include
+.S.o:
+ ${CC} ${SFLAGS} ${CFLAGS:M-[ID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+
+.s.o:
+ ${AS} ${SFLAGS} ${CFLAGS:M-[ID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+
+.S.po:
+ ${CC} -DPROF ${SFLAGS} ${CFLAGS:M-[ID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+
+.S.so:
+ ${CC} -fpic -DPIC ${SFLAGS} ${CFLAGS:M-[ID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
+
.include "Makefile.inc"
.include <bsd.lib.mk>
diff --git a/gnu/lib/libmp/Makefile b/gnu/lib/libmp/Makefile
index 5f922d26d9a4..f0c1eece40ce 100644
--- a/gnu/lib/libmp/Makefile
+++ b/gnu/lib/libmp/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.16 1998/08/30 01:57:55 jb Exp $
+# $Id: Makefile,v 1.15 1998/05/15 06:42:37 jb Exp $
#
LIB= mp
@@ -22,13 +22,6 @@ CFLAGS+= -I${GMPDIR}/mpn/x86 -I${GMPDIR}/mpz -DBERKELEY_MP
MPN_SRC_ASM= add_n.S addmul_1.S lshift.S mul_1.S rshift.S sub_n.S submul_1.S
-.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
-.PATH: ${GMPDIR} ${GMPDIR}/mpn ${GMPDIR}/mpn/mips3 ${GMPDIR}/mpn/generic \
- ${GMPDIR}/mpbsd
-
-CFLAGS+= -I${GMPDIR}/mpn/mips3 -I${GMPDIR}/mpz -DBERKELEY_MP
-
-MPN_SRC_ASM= add_n.s addmul_1.s lshift.s mul_1.s rshift.s sub_n.s submul_1.s
.elif ${MACHINE_ARCH} == "m68k"
.PATH: ${GMPDIR} ${GMPDIR}/mpn ${GMPDIR}/mpn/m68k ${GMPDIR}/mpn/generic \
${GMPDIR}/mpbsd
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index b8059d4231fa..891dfa3d7e3d 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.11 1998/12/27 17:25:27 bde Exp $
+# $Id: Makefile,v 1.9 1998/03/20 15:10:59 bde Exp $
#
GPPDIR= ${.CURDIR}/../../../contrib/libg++
@@ -93,40 +93,32 @@ beforeinstall:
# ======== typeinfoi.o, stdexcepti.o ========
.for file in typeinfoi stdexcepti
-CLEANFILES+= ${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
${file}.o: ${file}.cc
${CXX} ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
-${file}.So: ${file}.cc
+${file}.so: ${file}.cc
${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
${file}.po: ${file}.cc
${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -X -r ${.TARGET}
.endfor
# ======== exceptioni.o ========
.for file in exceptioni
-CLEANFILES+= ${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
${file}.o: ${file}.cc
${CXX} ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
-${file}.So: ${file}.cc
+${file}.so: ${file}.cc
${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
${file}.po: ${file}.cc
${CXX} -p ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -X -r ${.TARGET}
.endfor
# ======== cstrmain.o ========
diff --git a/gnu/usr.bin/binutils/doc/inc-hist.diff b/gnu/usr.bin/binutils/doc/inc-hist.diff
deleted file mode 100644
index fdd212081cd3..000000000000
--- a/gnu/usr.bin/binutils/doc/inc-hist.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-*** hsuser.texinfo Fri May 1 23:48:48 1998
---- inc-hist.texi Mon Jun 30 22:57:58 1997
-***************
-*** 34,42 ****
- @end ifset
- @ifclear BashFeatures
- This chapter describes how to use the GNU History Library interactively,
-! from a user's standpoint. It should be considered a user's guide. For
-! information on using the GNU History Library in your own programs,
-! @pxref{Programming with GNU History}.
- @end ifclear
-
- @ifset BashFeatures
---- 34,43 ----
- @end ifset
- @ifclear BashFeatures
- This chapter describes how to use the GNU History Library interactively,
-! from a user's standpoint.
-! @c It should be considered a user's guide. For
-! @c information on using the GNU History Library in your own programs,
-! @c @pxref{Programming with GNU History}.
- @end ifclear
-
- @ifset BashFeatures
diff --git a/gnu/usr.bin/binutils/gdb/gdb.1 b/gnu/usr.bin/binutils/gdb/gdb.1
deleted file mode 100644
index f07c89135b1d..000000000000
--- a/gnu/usr.bin/binutils/gdb/gdb.1
+++ /dev/null
@@ -1,385 +0,0 @@
-.\" Copyright (c) 1991 Free Software Foundation
-.\" See section COPYING for conditions for redistribution
-.\" $Id: gdb.1,v 1.3 1991/12/13 22:22:58 pesch Exp $
-.TH gdb 1 "4nov1991" "GNU Tools" "GNU Tools"
-.SH NAME
-gdb \- The GNU Debugger
-.SH SYNOPSIS
-.na
-.TP
-.B gdb
-.RB "[\|" \-help "\|]"
-.RB "[\|" \-nx "\|]"
-.RB "[\|" \-q "\|]"
-.RB "[\|" \-batch "\|]"
-.RB "[\|" \-cd=\c
-.I dir\c
-\|]
-.RB "[\|" \-f "\|]"
-.RB "[\|" \-k "\|]"
-.RB "[\|" \-wcore "\|]"
-.RB "[\|" "\-b\ "\c
-.IR bps "\|]"
-.RB "[\|" "\-tty="\c
-.IR dev "\|]"
-.RB "[\|" "\-s "\c
-.I symfile\c
-\&\|]
-.RB "[\|" "\-e "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-se "\c
-.I prog\c
-\&\|]
-.RB "[\|" "\-c "\c
-.I core\c
-\&\|]
-.RB "[\|" "\-x "\c
-.I cmds\c
-\&\|]
-.RB "[\|" "\-d "\c
-.I dir\c
-\&\|]
-.RB "[\|" \c
-.I prog\c
-.RB "[\|" \c
-.IR core \||\| procID\c
-\&\|]\&\|]
-.ad b
-.SH DESCRIPTION
-The purpose of a debugger such as GDB is to allow you to see what is
-going on ``inside'' another program while it executes\(em\&or what another
-program was doing at the moment it crashed.
-
-GDB can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-.TP
-\ \ \ \(bu
-Start your program, specifying anything that might affect its behavior.
-
-.TP
-\ \ \ \(bu
-Make your program stop on specified conditions.
-
-.TP
-\ \ \ \(bu
-Examine what has happened, when your program has stopped.
-
-.TP
-\ \ \ \(bu
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-.PP
-
-You can use GDB to debug programs written in C, C++, and Modula-2.
-Fortran support will be added when a GNU Fortran compiler is ready.
-
-GDB is invoked with the shell command \c
-.B gdb\c
-\&. Once started, it reads
-commands from the terminal until you tell it to exit with the GDB
-command \c
-.B quit\c
-\&. You can get online help from \c
-.B gdb\c
-\& itself
-by using the command \c
-.B help\c
-\&.
-
-You can run \c
-.B gdb\c
-\& with no arguments or options; but the most
-usual way to start GDB is with one argument or two, specifying an
-executable program as the argument:
-.sp
-.br
-gdb\ program
-.br
-.sp
-
-You can also start with both an executable program and a core file specified:
-.sp
-.br
-gdb\ program\ core
-.br
-.sp
-
-You can, instead, specify a process ID as a second argument, if you want
-to debug a running process:
-.sp
-.br
-gdb\ program\ 1234
-.br
-.sp
-
-would attach GDB to process \c
-.B 1234\c
-\& (unless you also have a file
-named `\|\c
-.B 1234\c
-\&\|'; GDB does check for a core file first).
-
-Here are some of the most frequently needed GDB commands:
-.TP
-.B break \fR[\|\fIfile\fB:\fR\|]\fIfunction
-\&
-Set a breakpoint at \c
-.I function\c
-\& (in \c
-.I file\c
-\&).
-.TP
-.B run \fR[\|\fIarglist\fR\|]
-Start your program (with \c
-.I arglist\c
-\&, if specified).
-.TP
-.B bt
-Backtrace: display the program stack.
-.TP
-.BI print " expr"\c
-\&
-Display the value of an expression.
-.TP
-.B c
-Continue running your program (after stopping, e.g. at a breakpoint).
-.TP
-.B next
-Execute next program line (after stopping); step \c
-.I over\c
-\& any
-function calls in the line.
-.TP
-.B step
-Execute next program line (after stopping); step \c
-.I into\c
-\& any
-function calls in the line.
-.TP
-.B help \fR[\|\fIname\fR\|]
-Show information about GDB command \c
-.I name\c
-\&, or general information
-about using GDB.
-.TP
-.B quit
-Exit from GDB.
-.PP
-For full details on GDB, see \c
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-\&, by Richard M. Stallman and Roland H. Pesch. The same text is available online
-as the \c
-.B gdb\c
-\& entry in the \c
-.B info\c
-\& program.
-.SH OPTIONS
-Any arguments other than options specify an executable
-file and core file (or process ID); that is, the first argument
-encountered with no
-associated option flag is equivalent to a `\|\c
-.B \-se\c
-\&\|' option, and the
-second, if any, is equivalent to a `\|\c
-.B \-c\c
-\&\|' option if it's the name of a file. Many options have
-both long and short forms; both are shown here. The long forms are also
-recognized if you truncate them, so long as enough of the option is
-present to be unambiguous. (If you prefer, you can flag option
-arguments with `\|\c
-.B +\c
-\&\|' rather than `\|\c
-.B \-\c
-\&\|', though we illustrate the
-more usual convention.)
-
-All the options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-`\|\c
-.B \-x\c
-\&\|' option is used.
-
-.TP
-.B \-help
-.TP
-.B \-h
-List all options, with brief explanations.
-
-.TP
-.BI "\-symbols=" "file"\c
-.TP
-.BI "\-s " "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-exec=" "file"\c
-.TP
-.BI "\-e " "file"\c
-\&
-Use file \c
-.I file\c
-\& as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-.TP
-.BI "\-se=" "file"\c
-\&
-Read symbol table from file \c
-.I file\c
-\& and use it as the executable
-file.
-
-.TP
-.BI "\-core=" "file"\c
-.TP
-.BI "\-c " "file"\c
-\&
-Use file \c
-.I file\c
-\& as a core dump to examine.
-
-.TP
-.BI "\-command=" "file"\c
-.TP
-.BI "\-x " "file"\c
-\&
-Execute GDB commands from file \c
-.I file\c
-\&.
-
-.TP
-.BI "\-directory=" "directory"\c
-.TP
-.BI "\-d " "directory"\c
-\&
-Add \c
-.I directory\c
-\& to the path to search for source files.
-.PP
-
-.TP
-.B \-nx
-.TP
-.B \-n
-Do not execute commands from any `\|\c
-.B .gdbinit\c
-\&\|' initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed.
-
-
-.TP
-.B \-quiet
-.TP
-.B \-q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode.
-
-.TP
-.B \-batch
-Run in batch mode. Exit with status \c
-.B 0\c
-\& after processing all the command
-files specified with `\|\c
-.B \-x\c
-\&\|' (and `\|\c
-.B .gdbinit\c
-\&\|', if not inhibited).
-Exit with nonzero status if an error occurs in executing the GDB
-commands in the command files.
-
-Batch mode may be useful for running GDB as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-.sp
-.br
-Program\ exited\ normally.
-.br
-.sp
-
-(which is ordinarily issued whenever a program running under GDB control
-terminates) is not issued when running in batch mode.
-
-.TP
-.BI "\-cd=" "directory"\c
-\&
-Run GDB using \c
-.I directory\c
-\& as its working directory,
-instead of the current directory.
-
-.TP
-.B \-fullname
-.TP
-.B \-f
-Emacs sets this option when it runs GDB as a subprocess. It tells GDB
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two `\|\c
-.B \032\c
-\&\|' characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-GDB interface program uses the two `\|\c
-.B \032\c
-\&\|' characters as
-a signal to display the source code for the frame.
-
-.TP
-.B \-kernel
-.TP
-.B \-k
-Use gdb in kernel debugging mode. The prompt is set to ``(kgdb)''.
-
-.TP
-.B \-wcore
-This option may only be used in kernel debugging mode while
-debugging a ``live'' kernel and makes the corefile (/dev/mem)
-writable.
-
-.TP
-.BI "\-b " "bps"\c
-\&
-Set the line speed (baud rate or bits per second) of any serial
-interface used by GDB for remote debugging.
-
-.TP
-.BI "\-tty=" "device"\c
-\&
-Run using \c
-.I device\c
-\& for your program's standard input and output.
-.PP
-
-.SH "SEE ALSO"
-.RB "`\|" gdb "\|'"
-entry in
-.B info\c
-\&;
-.I
-Using GDB: A Guide to the GNU Source-Level Debugger\c
-, Richard M. Stallman and Roland H. Pesch, July 1991.
-.SH COPYING
-Copyright (c) 1991 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
diff --git a/gnu/usr.bin/binutils/gdb/i386/xm.h b/gnu/usr.bin/binutils/gdb/i386/xm.h
deleted file mode 100644
index 8a852a29787c..000000000000
--- a/gnu/usr.bin/binutils/gdb/i386/xm.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Host-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-#include <machine/limits.h> /* for INT_MIN, to avoid "INT_MIN
- redefined" warnings from defs.h */
diff --git a/gnu/usr.bin/binutils/strip/Makefile b/gnu/usr.bin/binutils/strip/Makefile
index 13cc895720fd..455de6d6a0d7 100644
--- a/gnu/usr.bin/binutils/strip/Makefile
+++ b/gnu/usr.bin/binutils/strip/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.4 1998/06/03 18:01:04 peter Exp $
+# $Id: Makefile,v 1.3 1998/03/12 02:55:43 jdp Exp $
#
.include "../Makefile.inc0"
@@ -24,7 +24,7 @@ maybe_stripped: strip
cp strip maybe_stripped
.if defined(STRIP)
.if ${STRIP:M-s} != ""
- -strip maybe_stripped
+ strip maybe_stripped
.endif
.endif
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index 105c18384422..f5c9c2b66fb0 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.inc,v 1.24 1998/10/26 18:27:32 imp Exp $
+# $Id: Makefile.inc,v 1.22 1998/01/25 09:49:00 jb Exp $
#
# Sometimes this is .include'd several times...
@@ -15,6 +15,22 @@ OUT_FILE= ${MACHINE_ARCH}.c
OUT_OBJ= ${MACHINE_ARCH}
.PATH: ${GCCDIR}/config/${MACHINE_ARCH}
+.if ${MACHINE} == "alpha"
+BINFORMAT= elf
+.else
+# Pick aout for now. the elf config is not binary compatable.
+BINFORMAT?= aout
+#BINFORMAT?= elf
+.endif
+
+# same backend, just change compiled-in default.
+.if ${BINFORMAT} == aout
+CFLAGS+= -DFREEBSD_AOUT
+.endif
+.if ${BINFORMAT} == elf
+CFLAGS+= -DFREEBSD_ELF
+.endif
+
target= ${MACHINE_ARCH}-unknown-freebsd
version!= sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${GCCDIR}/version.c
diff --git a/gnu/usr.bin/cc/cc_int/Makefile b/gnu/usr.bin/cc/cc_int/Makefile
index 3c0f2e8f2b82..3b085c6eb3b9 100644
--- a/gnu/usr.bin/cc/cc_int/Makefile
+++ b/gnu/usr.bin/cc/cc_int/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.14 1997/02/22 15:44:57 peter Exp $
+# $Id$
#
.include "../Makefile.inc"
@@ -24,6 +24,6 @@ NOPIC= YES
install:
@true
-${OUT_OBJ}.o ${OUT_OBJ}.So: ${OUT_FILE}
+${OUT_OBJ}.o ${OUT_OBJ}.so: ${OUT_FILE}
.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index 72e563c16d80..42a13c8c6a3e 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.13 1998/08/20 21:45:46 jb Exp $
+# $Id: Makefile,v 1.12 1998/07/07 01:46:41 bde Exp $
#
#
@@ -124,18 +124,18 @@ CLEANFILES+= objc-parse.y # insurance
#-----------------------------------------------------------------------
# the host/target compiler config.
-COMMONHDRS= config.h hconfig.h options.h specs.h tconfig.h tm.h
-GENSRCS+= ${COMMONHDRS}
+COMMONHDRS= config.h hconfig.h tconfig.h tm.h options.h specs.h
+
+${COMMONHDRS}:
+ echo '#include "${MACHINE_ARCH}/freebsd.h"' > tm.h
+ echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > config.h
+ echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > hconfig.h
+ echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > tconfig.h
+ echo '#include "cp/lang-options.h"' > options.h
+ echo '#include "cp/lang-specs.h"' > specs.h
+ echo '#include "f2c-specs.h"' >> specs.h
-config.h hconfig.h tconfig.h:
- echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > ${.TARGET}
-options.h:
- echo '#include "cp/lang-options.h"' > ${.TARGET}
-specs.h:
- echo '#include "cp/lang-specs.h"'> ${.TARGET}
- echo '#include "f2c-specs.h"' >> ${.TARGET}
-tm.h:
- echo '#include "${MACHINE_ARCH}/freebsd.h"' > ${.TARGET}
+GENSRCS+= ${COMMONHDRS}
#-----------------------------------------------------------------------
# General things.
diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile
index 260001aaab49..cbae22a28c54 100644
--- a/gnu/usr.bin/cc/libgcc/Makefile
+++ b/gnu/usr.bin/cc/libgcc/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.18 1998/10/06 11:28:29 peter Exp $
+# $Id: Makefile,v 1.17 1998/07/08 00:45:50 bde Exp $
#
LIB= gcc
@@ -50,8 +50,8 @@ CLEANFILES+= ${COMMONHDRS}
LIB1OBJS= ${LIB1FUNCS:S/$/.o/}
LIB2OBJS= ${LIB2FUNCS:S/$/.o/}
-LIB1SOBJS= ${LIB1FUNCS:S/$/.So/}
-LIB2SOBJS= ${LIB2FUNCS:S/$/.So/}
+LIB1SOBJS= ${LIB1FUNCS:S/$/.so/}
+LIB2SOBJS= ${LIB2FUNCS:S/$/.so/}
LIB1POBJS= ${LIB1FUNCS:S/$/.po/}
LIB2POBJS= ${LIB2FUNCS:S/$/.po/}
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile
index 3657b36769c5..a758287a093d 100644
--- a/gnu/usr.bin/grep/Makefile
+++ b/gnu/usr.bin/grep/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.13 1998/10/02 07:14:32 obrien Exp $
+# $Id: Makefile,v 1.12 1998/03/07 16:13:57 wosch Exp $
GREP_LIBZ= YES
GREP_FTS= YES
@@ -7,7 +7,7 @@ PROG= grep
SRCS= dfa.c grep.c getopt.c kwset.c obstack.c search.c
CFLAGS+=-DGREP -DHAVE_STRING_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_UNISTD_H=1 \
-DHAVE_GETPAGESIZE=1 -DHAVE_MEMCHR=1 -DHAVE_STRERROR=1 \
- -DHAVE_VALLOC=1 -DHAVE_WORKING_MMAP=1
+ -DHAVE_VALLOC=1
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
${BINDIR}/grep ${BINDIR}/fgrep
diff --git a/gnu/usr.bin/man/man/man.man b/gnu/usr.bin/man/man/man.man
index b597929ecdb8..d16a59a45fc5 100644
--- a/gnu/usr.bin/man/man/man.man
+++ b/gnu/usr.bin/man/man/man.man
@@ -132,10 +132,7 @@ is used.
.Xr whatis 1 ,
.Xr manpath 1 ,
.Xr more 1 ,
-.Xr groff 1 ,
-.Xr man 7 ,
-.Xr mdoc 7 ,
-.Xr mdoc.samples 7
+.Xr groff 1
.Sh BUGS
The
.Fl t
diff --git a/gnu/usr.bin/perl/libperl/Makefile b/gnu/usr.bin/perl/libperl/Makefile
index 2d92a903186c..100d3dd2e590 100644
--- a/gnu/usr.bin/perl/libperl/Makefile
+++ b/gnu/usr.bin/perl/libperl/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.4 1998/09/16 17:25:51 markm Exp $
+# $Id: Makefile,v 1.3 1998/09/12 19:16:32 markm Exp $
#
LIB= perl
@@ -21,7 +21,7 @@ CLEANFILES+= config.h config.sh config_h.sh
.SUFFIXES:
-.SUFFIXES: .o .po .So .s .S .c
+.SUFFIXES: .o .po .so .s .S .c
.PATH: ${PERL5SRC}
diff --git a/gnu/usr.bin/perl/libperl/config.SH-aout.i386 b/gnu/usr.bin/perl/libperl/config.SH-aout.i386
index aa510e3221a7..60b24d7e9673 100644
--- a/gnu/usr.bin/perl/libperl/config.SH-aout.i386
+++ b/gnu/usr.bin/perl/libperl/config.SH-aout.i386
@@ -5,12 +5,12 @@
# do not forget to propagate your changes by running "Configure -der". You may
# instead choose to run each of the .SH files by yourself, or "Configure -S".
#
-# $Id: config.SH-aout.i386,v 1.9 1999/01/15 04:14:52 ache Exp $
+# $Id: config.SH-aout.i386,v 1.5 1998/09/26 16:17:04 markm Exp $
#
# Package name : perl5
# Source directory : .
-# Configuration time: $Date: 1999/01/15 04:14:52 $
+# Configuration time: $Date: 1998/09/26 16:17:04 $
# Configured by : markm
# Target system : freebsd 3.0-current #0:
@@ -55,7 +55,7 @@ ccdlflags=' '
ccflags=''
cf_by='markm'
cf_email='markm@freebsd.org'
-cf_time='$Date: 1999/01/15 04:14:52 $'
+cf_time='$Date: 1998/09/26 16:17:04 $'
chgrp=''
chmod=''
chown=''
@@ -322,7 +322,7 @@ full_csh='/bin/csh'
full_sed='sed'
gccversion='2.7.2.1'
gidtype='gid_t'
-glibpth='/usr/lib/aout'
+glibpth='/usr/lib /usr/lib/elf /usr/lib/aout'
grep='grep'
groupcat='cat /etc/group'
groupstype='gid_t'
@@ -389,11 +389,11 @@ i_vfork='undef'
incpath=''
inews=''
installarchlib='/usr/libdata/perl/5.00502/mach'
-installbin='/usr/local/bin'
-installman1dir='/usr/local/man/man1'
+installbin='/usr/bin'
+installman1dir='/usr/share/man/man1'
installman3dir='/usr/local/lib/perl5/5.00502/man/man3'
installprivlib='/usr/libdata/perl/5.00502'
-installscript='/usr/local/bin'
+installscript='/usr/bin'
installsitearch='/usr/local/lib/perl5/site_perl/5.005/i386-freebsd'
installsitelib='/usr/local/lib/perl5/site_perl/5.005'
intsize='4'
@@ -407,7 +407,7 @@ less='less'
lib_ext='.a'
libc='undef'
libperl='libperl.so.3.0'
-libpth='/usr/lib/aout'
+libpth='/usr/lib /usr/lib/elf /usr/lib/aout'
libs='-lm -lc -lcrypt'
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
@@ -431,8 +431,8 @@ make_set_make='#'
mallocobj=''
mallocsrc=''
malloctype='void *'
-man1dir='/usr/local/man/man1'
-man1direxp='/usr/local/man/man1'
+man1dir='/usr/share/man/man1'
+man1direxp='/usr/share/man/man1'
man1ext='1'
man3dir='/usr/share/perl/man/man3'
man3direxp='/usr/share/perl/man/man3'
@@ -536,7 +536,7 @@ stdio_ptr='((fp)->_ptr)'
strings='/usr/include/string.h'
submit=''
subversion='2'
-sysman='/usr/local/man/man1'
+sysman='/usr/share/man/man1'
tail=''
tar=''
tbl=''
@@ -566,19 +566,19 @@ uuname=''
version='5.00502'
vi=''
voidflags='15'
-xlibpth=''
+xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
# Configure command line arguments.
config_arg0='Configure'
-config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/local/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
+config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
config_argc=11
config_arg1='-Dprefix=/usr'
config_arg2='-Darchlib=/usr/libdata/perl/5.00502/mach'
config_arg3='-Dprivlib=/usr/libdata/perl/5.00502'
config_arg4='-Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd'
config_arg5='-Dsitelib=/usr/local/lib/perl5/site_perl/5.005'
-config_arg6='-Dman1dir=/usr/local/man/man1'
+config_arg6='-Dman1dir=/usr/share/man/man1'
config_arg7='-Dman3dir=/usr/share/perl/man/man3'
config_arg8='-des'
config_arg9='-Ulocincpth='
diff --git a/gnu/usr.bin/perl/libperl/config.SH-elf.alpha b/gnu/usr.bin/perl/libperl/config.SH-elf.alpha
index 9d41d8b9afab..fa114ab30f8e 100644
--- a/gnu/usr.bin/perl/libperl/config.SH-elf.alpha
+++ b/gnu/usr.bin/perl/libperl/config.SH-elf.alpha
@@ -5,12 +5,12 @@
# do not forget to propagate your changes by running "Configure -der". You may
# instead choose to run each of the .SH files by yourself, or "Configure -S".
#
-# $Id: config.SH-elf.alpha,v 1.10 1999/01/15 04:14:52 ache Exp $
+# $Id: config.SH-elf.alpha,v 1.6 1998/09/26 16:17:05 markm Exp $
#
# Package name : perl5
# Source directory : .
-# Configuration time: $Date: 1999/01/15 04:14:52 $
+# Configuration time: $Date: 1998/09/26 16:17:05 $
# Configured by : markm
# Target system : freebsd 3.0-current #0:
@@ -55,7 +55,7 @@ ccdlflags=' '
ccflags=''
cf_by='markm'
cf_email='markm@freebsd.org'
-cf_time='$Date: 1999/01/15 04:14:52 $'
+cf_time='$Date: 1998/09/26 16:17:05 $'
chgrp=''
chmod=''
chown=''
@@ -322,7 +322,7 @@ full_csh='/bin/csh'
full_sed='sed'
gccversion='2.7.2.1'
gidtype='gid_t'
-glibpth="/usr/lib"
+glibpth="/usr/lib /usr/local/lib"
grep='grep'
groupcat='cat /etc/group'
groupstype='gid_t'
@@ -389,11 +389,11 @@ i_vfork='undef'
incpath=''
inews=''
installarchlib='/usr/libdata/perl/5.00502/mach'
-installbin='/usr/local/bin'
-installman1dir='/usr/local/man/man1'
+installbin='/usr/bin'
+installman1dir='/usr/share/man/man1'
installman3dir='/usr/local/lib/perl5/5.00502/man/man3'
installprivlib='/usr/libdata/perl/5.00502'
-installscript='/usr/local/bin'
+installscript='/usr/bin'
installsitearch='/usr/local/lib/perl5/site_perl/5.005/alpha-freebsd'
installsitelib='/usr/local/lib/perl5/site_perl/5.005'
intsize='4'
@@ -407,7 +407,7 @@ less='less'
lib_ext='.a'
libc='undef'
libperl='libperl.so.3'
-libpth="/usr/lib"
+libpth="/usr/lib /usr/local/lib"
libs='-lm -lc -lcrypt'
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
@@ -431,8 +431,8 @@ make_set_make='#'
mallocobj=''
mallocsrc=''
malloctype='void *'
-man1dir='/usr/local/man/man1'
-man1direxp='/usr/local/man/man1'
+man1dir='/usr/share/man/man1'
+man1direxp='/usr/share/man/man1'
man1ext='1'
man3dir='/usr/share/perl/man/man3'
man3direxp='/usr/share/perl/man/man3'
@@ -536,7 +536,7 @@ stdio_ptr='((fp)->_ptr)'
strings='/usr/include/string.h'
submit=''
subversion='2'
-sysman='/usr/local/man/man1'
+sysman='/usr/share/man/man1'
tail=''
tar=''
tbl=''
@@ -566,19 +566,19 @@ uuname=''
version='5.00502'
vi=''
voidflags='15'
-xlibpth=''
+xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
# Configure command line arguments.
config_arg0='Configure'
-config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/alpha-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/local/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
+config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/alpha-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
config_argc=11
config_arg1='-Dprefix=/usr'
config_arg2='-Darchlib=/usr/libdata/perl/5.00502/mach'
config_arg3='-Dprivlib=/usr/libdata/perl/5.00502'
config_arg4='-Dsitearch=/usr/local/lib/perl5/site_perl/5.005/alpha-freebsd'
config_arg5='-Dsitelib=/usr/local/lib/perl5/site_perl/5.005'
-config_arg6='-Dman1dir=/usr/local/man/man1'
+config_arg6='-Dman1dir=/usr/share/man/man1'
config_arg7='-Dman3dir=/usr/share/perl/man/man3'
config_arg8='-des'
config_arg9='-Ulocincpth='
diff --git a/gnu/usr.bin/perl/libperl/config.SH-elf.i386 b/gnu/usr.bin/perl/libperl/config.SH-elf.i386
index 026bf5b4733b..948577a3075b 100644
--- a/gnu/usr.bin/perl/libperl/config.SH-elf.i386
+++ b/gnu/usr.bin/perl/libperl/config.SH-elf.i386
@@ -5,12 +5,12 @@
# do not forget to propagate your changes by running "Configure -der". You may
# instead choose to run each of the .SH files by yourself, or "Configure -S".
#
-# $Id: config.SH-elf.i386,v 1.9 1999/01/15 04:14:52 ache Exp $
+# $Id: config.SH-elf.i386,v 1.5 1998/09/26 16:17:05 markm Exp $
#
# Package name : perl5
# Source directory : .
-# Configuration time: $Date: 1999/01/15 04:14:52 $
+# Configuration time: $Date: 1998/09/26 16:17:05 $
# Configured by : markm
# Target system : freebsd 3.0-current #0:
@@ -55,7 +55,7 @@ ccdlflags=' '
ccflags=''
cf_by='markm'
cf_email='markm@freebsd.org'
-cf_time='$Date: 1999/01/15 04:14:52 $'
+cf_time='$Date: 1998/09/26 16:17:05 $'
chgrp=''
chmod=''
chown=''
@@ -322,7 +322,7 @@ full_csh='/bin/csh'
full_sed='sed'
gccversion='2.7.2.1'
gidtype='gid_t'
-glibpth="/usr/lib"
+glibpth="/usr/lib /usr/local/lib"
grep='grep'
groupcat='cat /etc/group'
groupstype='gid_t'
@@ -389,11 +389,11 @@ i_vfork='undef'
incpath=''
inews=''
installarchlib='/usr/libdata/perl/5.00502/mach'
-installbin='/usr/local/bin'
-installman1dir='/usr/local/man/man1'
+installbin='/usr/bin'
+installman1dir='/usr/share/man/man1'
installman3dir='/usr/local/lib/perl5/5.00502/man/man3'
installprivlib='/usr/libdata/perl/5.00502'
-installscript='/usr/local/bin'
+installscript='/usr/bin'
installsitearch='/usr/local/lib/perl5/site_perl/5.005/i386-freebsd'
installsitelib='/usr/local/lib/perl5/site_perl/5.005'
intsize='4'
@@ -407,7 +407,7 @@ less='less'
lib_ext='.a'
libc='undef'
libperl='libperl.so.3'
-libpth="/usr/lib"
+libpth="/usr/lib /usr/local/lib"
libs='-lm -lc -lcrypt'
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
@@ -431,8 +431,8 @@ make_set_make='#'
mallocobj=''
mallocsrc=''
malloctype='void *'
-man1dir='/usr/local/man/man1'
-man1direxp='/usr/local/man/man1'
+man1dir='/usr/share/man/man1'
+man1direxp='/usr/share/man/man1'
man1ext='1'
man3dir='/usr/share/perl/man/man3'
man3direxp='/usr/share/perl/man/man3'
@@ -536,7 +536,7 @@ stdio_ptr='((fp)->_ptr)'
strings='/usr/include/string.h'
submit=''
subversion='2'
-sysman='/usr/local/man/man1'
+sysman='/usr/share/man/man1'
tail=''
tar=''
tbl=''
@@ -566,19 +566,19 @@ uuname=''
version='5.00502'
vi=''
voidflags='15'
-xlibpth=''
+xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
# Configure command line arguments.
config_arg0='Configure'
-config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/local/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
+config_args='-Dprefix=/usr -Darchlib=/usr/libdata/perl/5.00502/mach -Dprivlib=/usr/libdata/perl/5.00502 -Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd -Dsitelib=/usr/local/lib/perl5/site_perl/5.005 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/perl/man/man3 -des -Ulocincpth= -Uloclibpth= -Dpager=more'
config_argc=11
config_arg1='-Dprefix=/usr'
config_arg2='-Darchlib=/usr/libdata/perl/5.00502/mach'
config_arg3='-Dprivlib=/usr/libdata/perl/5.00502'
config_arg4='-Dsitearch=/usr/local/lib/perl5/site_perl/5.005/i386-freebsd'
config_arg5='-Dsitelib=/usr/local/lib/perl5/site_perl/5.005'
-config_arg6='-Dman1dir=/usr/local/man/man1'
+config_arg6='-Dman1dir=/usr/share/man/man1'
config_arg7='-Dman3dir=/usr/share/perl/man/man3'
config_arg8='-des'
config_arg9='-Ulocincpth='
diff --git a/gnu/usr.bin/perl/suidperl/Makefile b/gnu/usr.bin/perl/suidperl/Makefile
index 0bf9af5e796a..5194251fb65e 100644
--- a/gnu/usr.bin/perl/suidperl/Makefile
+++ b/gnu/usr.bin/perl/suidperl/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.5 1998/10/11 18:13:42 markm Exp $
+# $Id: Makefile,v 1.4 1998/09/22 12:00:58 markm Exp $
#
PROG= suidperl
@@ -11,8 +11,6 @@ DPADD= lib/auto/DynaLoader/DynaLoader.a ${LIBPERL} ${LIBM} ${LIBCRYPT}
LDADD= lib/auto/DynaLoader/DynaLoader.a -lperl -lm -lcrypt
BINOWN= root
BINMODE=4511
-LINKS= ${BINDIR}/${PROG} ${BINDIR}/sperl5.00502
-
CLEANFILES= config.h config.sh config_h.sh writemain writemain.sh \
Config.pm cflags cflags.sh myconfig perlmain.c miniperlmain.c \
diff --git a/gnu/usr.bin/tar/getdate.y b/gnu/usr.bin/tar/getdate.y
index 63ac7f7c942b..cc415776917d 100644
--- a/gnu/usr.bin/tar/getdate.y
+++ b/gnu/usr.bin/tar/getdate.y
@@ -1,5 +1,5 @@
%{
-/* $Revision: 1.2.8.3 $
+/* $Revision: 1.2 $
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
@@ -98,7 +98,7 @@ extern struct tm *localtime();
#if !defined(lint) && !defined(SABER)
static char RCS[] =
- "$Header: /home/ncvs/src/gnu/usr.bin/tar/getdate.y,v 1.2.8.3 1999/01/13 06:27:34 danny Exp $";
+ "$Header: /home/ncvs/src/gnu/usr.bin/tar/getdate.y,v 1.2 1994/11/04 02:12:22 jkh Exp $";
#endif /* !defined(lint) && !defined(SABER) */
@@ -613,18 +613,11 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
if (Year < 0)
Year = -Year;
-
- /* Might as well allow up to 2069, as the code below has
- * never worked for dates prior to 1970.
- */
- if (Year > 69 && Year < 100)
+ if (Year < 100)
Year += 1900;
- else if (Year < 70)
- Year += 2000;
-
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
? 29 : 28;
- if (Year < EPOCH || Year > 2069 /* Code not valid past 2069 */
+ if (Year < EPOCH || Year > 1999
|| Month < 1 || Month > 12
/* Lint fluff: "conversion from long may lose accuracy" */
|| Day < 1 || Day > DaysInMonth[(int)--Month])
@@ -633,7 +626,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
for (Julian = Day - 1, i = 0; i < Month; i++)
Julian += DaysInMonth[i];
for (i = EPOCH; i < Year; i++)
- Julian += 365 + (i % 4 == 0); /* Not valid in 2100 - Not leap year */
+ Julian += 365 + (i % 4 == 0);
Julian *= SECSPERDAY;
Julian += yyTimezone * 60L;
if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0)
diff --git a/gnu/usr.bin/texinfo/Makefile b/gnu/usr.bin/texinfo/Makefile
index bd696f27ef04..f1539d5a2903 100644
--- a/gnu/usr.bin/texinfo/Makefile
+++ b/gnu/usr.bin/texinfo/Makefile
@@ -2,6 +2,6 @@
# $Id$
#
-SUBDIR= libtxi libintl makeinfo info install-info doc
+SUBDIR= libtxi makeinfo info install-info doc
.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/texinfo/Makefile.inc b/gnu/usr.bin/texinfo/Makefile.inc
index 08a475c92413..5ee8874939a6 100644
--- a/gnu/usr.bin/texinfo/Makefile.inc
+++ b/gnu/usr.bin/texinfo/Makefile.inc
@@ -1,17 +1,11 @@
-# $Id: Makefile.inc,v 1.8 1999/01/14 20:00:26 markm Exp $
+# $Id$
-TXIDIR= ${.CURDIR}/../../../../contrib/texinfo
-
-.if exists(${.OBJDIR}/../libintl)
-LIBINTL= ${.OBJDIR}/../libintl/libintl.a
-.else
-LIBINTL= ${.CURDIR}/../libintl/libintl.a
-.endif
+TXIDIR= ${.CURDIR}/../../../../contrib/texinfo
.if exists(${.OBJDIR}/../libtxi)
-LIBTXI= ${.OBJDIR}/../libtxi/libtxi.a
+LIBTXI= ${.OBJDIR}/../libtxi/libtxi.a
.else
-LIBTXI= ${.CURDIR}/../libtxi/libtxi.a
+LIBTXI= ${.CURDIR}/../libtxi/libtxi.a
.endif
-.include "../Makefile.inc"
+.include "../../Makefile.inc"
diff --git a/gnu/usr.bin/texinfo/doc/Makefile b/gnu/usr.bin/texinfo/doc/Makefile
index 65e8fa6a621a..3416ad3bcb64 100644
--- a/gnu/usr.bin/texinfo/doc/Makefile
+++ b/gnu/usr.bin/texinfo/doc/Makefile
@@ -1,12 +1,7 @@
-# $Id: Makefile,v 1.9 1999/01/14 20:00:43 markm Exp $
+# $Id$
-INFO= info info-stnd texinfo
-
-CLEANFILES= texinfo.texi
-
-texinfo.texi: texinfo.txi
- ln -fs ${.ALLSRC} ${.TARGET}
+INFO= texinfo info info-stnd makeinfo
.include <bsd.info.mk>
-.PATH: ${TXIDIR}/doc
+.PATH: ${TXIDIR} ${TXIDIR}/info ${TXIDIR}/makeinfo
diff --git a/gnu/usr.bin/texinfo/info/Makefile b/gnu/usr.bin/texinfo/info/Makefile
index 2e291d6a2c7f..2ba6f067c55e 100644
--- a/gnu/usr.bin/texinfo/info/Makefile
+++ b/gnu/usr.bin/texinfo/info/Makefile
@@ -1,23 +1,21 @@
# $Id$
PROG= info
-NOMAN= yes
-SRCS= dir.c display.c display.h doc.c doc.h dribble.c dribble.h
-SRCS+= echo-area.c echo-area.h filesys.c filesys.h footnotes.c
-SRCS+= footnotes.h funs.h gc.c gc.h indices.c indices.h
-SRCS+= info-utils.c info-utils.h info.c info.h infodoc.c
-SRCS+= infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c
-SRCS+= nodes.h search.c search.h session.c session.h signals.c
-SRCS+= signals.h termdep.h terminal.c terminal.h tilde.c tilde.h
-SRCS+= variables.c variables.h window.c window.h
+SRCS= dir.c display.c doc.c echo_area.c filesys.c info-utils.c info.c infodoc.c infomap.c
+SRCS+= m-x.c nodes.c search.c session.c signals.c terminal.c tilde.c window.c indices.c
+SRCS+= xmalloc.c nodemenu.c footnotes.c dribble.c variables.c gc.c man.c clib.c
-CFLAGS+= -DINFODIR=\"${INFODIR}:/usr/local/info:.\"
-CFLAGS+= -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H
-CFLAGS+= -I${TXIDIR} -I${TXIDIR}/lib -I../libintl
+CFLAGS+= -DHANDLE_MAN_PAGES -DNAMED_FUNCTIONS=1
+CFLAGS+= -DDEFAULT_INFOPATH=\"${INFODIR}:/usr/local/info:.\"
+CFLAGS+= -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1
+CFLAGS+= -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1
+CFLAGS+= -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1
+CFLAGS+= -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1
+CFLAGS+= -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -I${TXIDIR}/libtxi
-DPADD= ${LIBTERMCAP} ${LIBTXI} ${LIBINTL}
-LDADD= -ltermcap ${LIBTXI} ${LIBINTL}
+DPADD= ${LIBTERMCAP} ${LIBTXI}
+LDADD= -ltermcap ${LIBTXI}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/texinfo/install-info/Makefile b/gnu/usr.bin/texinfo/install-info/Makefile
index 114baaab228f..e233f5db190f 100644
--- a/gnu/usr.bin/texinfo/install-info/Makefile
+++ b/gnu/usr.bin/texinfo/install-info/Makefile
@@ -1,12 +1,15 @@
-# $Id$
+# $Id: Makefile,v 1.6 1997/04/07 16:52:45 bde Exp $
PROG= install-info
-CFLAGS+= -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/share/locale\"
-CFLAGS+= -I${TXIDIR} -I${TXIDIR}/lib -I../libintl
+CFLAGS+= -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1
+CFLAGS+= -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA=1
+CFLAGS+= -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1
+CFLAGS+= -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1
+CFLAGS+= -DHAVE_SIGSETMASK=1 -I${TXIDIR}/libtxi
-DPADD= ${LIBTXI} ${LIBINTL} -lz
-LDADD= ${LIBTXI} ${LIBINTL} -lz
+DPADD= ${LIBTXI}
+LDADD= ${LIBTXI}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/texinfo/libintl/Makefile b/gnu/usr.bin/texinfo/libintl/Makefile
deleted file mode 100644
index 0bce892fccdd..000000000000
--- a/gnu/usr.bin/texinfo/libintl/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# $Id$
-
-LIB= intl
-INTERNALLIB= true
-INTERNALSTATICLIB= true
-
-CFLAGS+= -DHAVE_CONFIG_H
-CFLAGS+= -DLOCALEDIR=\"/usr/share/locale\"
-CFLAGS+= -DGNULOCALEDIR=\"/usr/share/locale\"
-CFLAGS+= -DLOCALE_ALIAS_PATH=\"/usr/share/locale:.\"
-CFLAGS+= -I${TXIDIR} -I${TXIDIR}/lib -I${TXIDIR}/intl -I.
-
-SRCS= bindtextdom.c dcgettext.c dgettext.c gettext.c
-SRCS+= finddomain.c loadmsgcat.c localealias.c textdomain.c
-SRCS+= l10nflist.c explodename.c intl-compat.c libintl.h
-
-CLEANFILES+= libintl.h
-
-libintl.h: libgettext.h
- @ln -sf ${.OODATE} ${.TARGET}
-
-.include <bsd.lib.mk>
-
-.PATH: ${TXIDIR}/intl
diff --git a/gnu/usr.bin/texinfo/libtxi/Makefile b/gnu/usr.bin/texinfo/libtxi/Makefile
index 5e83853a11b1..73a371356129 100644
--- a/gnu/usr.bin/texinfo/libtxi/Makefile
+++ b/gnu/usr.bin/texinfo/libtxi/Makefile
@@ -4,8 +4,8 @@ LIB= txi
INTERNALLIB= true
INTERNALSTATICLIB= true
-SRCS= getopt.c getopt1.c xmalloc.c xstrdup.c
+SRCS= getopt.c getopt1.c
.include <bsd.lib.mk>
-.PATH: ${TXIDIR}/lib
+.PATH: ${TXIDIR}/libtxi
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile b/gnu/usr.bin/texinfo/makeinfo/Makefile
index 2037f4c09011..a5398940a71f 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile
@@ -1,15 +1,17 @@
-# $Id: Makefile,v 1.8 1999/01/14 20:00:46 markm Exp $
+# $Id$
PROG= makeinfo
NOMAN= yes
SRCS= makeinfo.c multi.c
-CFLAGS+= -DHAVE_CONFIG_H
-CFLAGS+= -DLOCALEDIR=\"/usr/share/locale\"
-CFLAGS+= -I${TXIDIR}/makeinfo -I${TXIDIR} -I${TXIDIR}/lib -I../libintl
+CFLAGS+= -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1
+CFLAGS+= -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA=1
+CFLAGS+= -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1
+CFLAGS+= -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1
+CFLAGS+= -DHAVE_SIGSETMASK=1 -I${TXIDIR}/libtxi
-DPADD= ${LIBTXI} ${LIBINTL}
-LDADD= ${LIBTXI} ${LIBINTL}
+DPADD= ${LIBTXI}
+LDADD= ${LIBTXI}
.include <bsd.prog.mk>
diff --git a/include/Makefile b/include/Makefile
index 8e7c317d4a2b..b72614b24397 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,16 +1,18 @@
-# @(#)Makefile 8.2 (Berkeley) 1/4/94
-# $Id: Makefile,v 1.91 1999/01/14 19:52:38 jdp Exp $
+# From: @(#)Makefile 8.2 (Berkeley) 1/4/94
+# $Id: Makefile,v 1.85 1998/10/02 00:49:43 ache Exp $
#
# Doing a make install builds /usr/include
#
# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
# links.
+#
+depend lint tags:
CLEANFILES= osreldate.h version vers.c
SUBDIR= rpcsvc
FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
dlfcn.h elf.h err.h fnmatch.h fstab.h \
- fts.h glob.h grp.h strhash.h histedit.h ieeefp.h iso646.h \
+ fts.h glob.h grp.h strhash.h histedit.h iso646.h \
kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h \
ndbm.h netdb.h nl_types.h nlist.h objformat.h \
paths.h pthread.h pthread_np.h pwd.h \
@@ -36,10 +38,11 @@ MFILES= float.h floatingpoint.h stdarg.h varargs.h
PFILES= mqueue.h sched.h semaphore.h \
# aio.h
-LFILES= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h termios.h
+LFILES= errno.h fcntl.h poll.h syslog.h termios.h
-LDIRS= cam msdosfs net netatalk netatm netinet netipx netkey netns nfs \
- pccard posix4 sys vm
+LDIRS= msdosfs net netns netatalk netatm netinet netipx netkey nfs \
+ pccard posix4 sys vm cam \
+ # netccitt netiso
LNOHEADERDIRS= isofs ufs
LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi
@@ -51,6 +54,8 @@ LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs cam/scsi
#SHARED= symlinks
SHARED?= copies
+
+.if exists (${.CURDIR}/../sys/conf/newvers.sh)
all: osreldate.h
osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
@@ -61,6 +66,13 @@ osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
echo "$$COPYRIGHT" > osreldate.h; \
echo \#'undef __FreeBSD_version' >> osreldate.h; \
echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h
+.else
+all:
+ @${ECHO} creating osreldate.h from sysctl info
+ echo \#'undef __FreeBSD_version' > osreldate.h
+ echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
+ >> osreldate.h
+.endif
beforeinstall: ${SHARED}
cd ${.CURDIR}; \
@@ -88,6 +100,7 @@ beforeinstall: ${SHARED}
ln -sf posix4/$i ${DESTDIR}/usr/include/$i
.endfor
+
copies:
.for i in ${LDIRS} ${LNOHEADERDIRS} machine
if [ -h ${DESTDIR}/usr/include/$i ]; then \
diff --git a/include/err.h b/include/err.h
index 96cb9de756d2..a3464af86a8d 100644
--- a/include/err.h
+++ b/include/err.h
@@ -30,8 +30,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)err.h 8.1 (Berkeley) 6/2/93
- * $Id: err.h,v 1.6 1998/10/29 22:18:47 jdp Exp $
+ * From: @(#)err.h 8.1 (Berkeley) 6/2/93
+ * $Id$
*/
#ifndef _ERR_H_
@@ -48,21 +48,18 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
-void err __P((int, const char *, ...)) __dead2 __printf0like(2, 3);
-void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2
- __printf0like(2, 0);
-void errc __P((int, int, const char *, ...)) __dead2 __printf0like(3, 4);
-void verrc __P((int, int, const char *, _BSD_VA_LIST_)) __dead2
- __printf0like(3, 0);
-void errx __P((int, const char *, ...)) __dead2 __printf0like(2, 3);
-void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2
- __printf0like(2, 0);
-void warn __P((const char *, ...)) __printf0like(1, 2);
-void vwarn __P((const char *, _BSD_VA_LIST_)) __printf0like(1, 0);
-void warnc __P((int, const char *, ...)) __printf0like(2, 3);
-void vwarnc __P((int, const char *, _BSD_VA_LIST_)) __printf0like(2, 0);
-void warnx __P((const char *, ...)) __printflike(1, 2);
-void vwarnx __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0);
+void err __P((int, const char *, ...)) __dead2;
+void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2;
+void errc __P((int, int, const char *, ...)) __dead2;
+void verrc __P((int, int, const char *, _BSD_VA_LIST_)) __dead2;
+void errx __P((int, const char *, ...)) __dead2;
+void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2;
+void warn __P((const char *, ...));
+void vwarn __P((const char *, _BSD_VA_LIST_));
+void warnc __P((int, const char *, ...));
+void vwarnc __P((int, const char *, _BSD_VA_LIST_));
+void warnx __P((const char *, ...));
+void vwarnx __P((const char *, _BSD_VA_LIST_));
void err_set_file __P((void *));
void err_set_exit __P((void (*)(int)));
__END_DECLS
diff --git a/include/ieeefp.h b/include/ieeefp.h
deleted file mode 100644
index 83db9a5574fe..000000000000
--- a/include/ieeefp.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 6, 1995
- * Public domain.
- */
-
-#ifndef _IEEEFP_H_
-#define _IEEEFP_H_
-
-#include <sys/cdefs.h>
-#include <machine/ieeefp.h>
-
-#ifdef i386
-#include <machine/floatingpoint.h>
-#else
-extern fp_rnd fpgetround __P((void));
-extern fp_rnd fpsetround __P((fp_rnd));
-extern fp_except fpgetmask __P((void));
-extern fp_except fpsetmask __P((fp_except));
-extern fp_except fpgetsticky __P((void));
-extern fp_except fpsetsticky __P((fp_except));
-#endif /* i386 */
-
-#endif /* _IEEEFP_H_ */
diff --git a/include/kvm.h b/include/kvm.h
index 9e0d9212a444..fb2d22435fee 100644
--- a/include/kvm.h
+++ b/include/kvm.h
@@ -31,7 +31,6 @@
* SUCH DAMAGE.
*
* @(#)kvm.h 8.1 (Berkeley) 6/2/93
- * $Id$
*/
#ifndef _KVM_H_
@@ -44,22 +43,11 @@
#include <nlist.h>
#include <sys/cdefs.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_SSIZE_T_
-typedef _BSD_SSIZE_T_ ssize_t;
-#undef _BSD_SSIZE_T_
-#endif
+__BEGIN_DECLS
typedef struct __kvm kvm_t;
struct kinfo_proc;
-struct proc;
-
-__BEGIN_DECLS
int kvm_close __P((kvm_t *));
char **kvm_getargv __P((kvm_t *, const struct kinfo_proc *, int));
char **kvm_getenvv __P((kvm_t *, const struct kinfo_proc *, int));
@@ -74,9 +62,12 @@ kvm_t *kvm_open
kvm_t *kvm_openfiles
__P((const char *, const char *, const char *, int, char *));
ssize_t kvm_read __P((kvm_t *, unsigned long, void *, size_t));
-ssize_t kvm_uread
- __P((kvm_t *, const struct proc *, unsigned long, char *, size_t));
ssize_t kvm_write __P((kvm_t *, unsigned long, const void *, size_t));
+/* Comment this out until it can be fixed correctly.
+ssize_t kvm_uread
+ __P((kvm_t *, struct proc *, unsigned long, char *, size_t));
+*/
+
__END_DECLS
#endif /* !_KVM_H_ */
diff --git a/include/paths.h b/include/paths.h
index ea721201da44..06110d90584a 100644
--- a/include/paths.h
+++ b/include/paths.h
@@ -56,7 +56,7 @@
#define _PATH_MAILDIR "/var/mail"
#define _PATH_MAN "/usr/share/man"
#define _PATH_MEM "/dev/mem"
-#define _PATH_NOLOGIN "/var/run/nologin"
+#define _PATH_NOLOGIN "/etc/nologin"
#define _PATH_SENDMAIL "/usr/sbin/sendmail"
#define _PATH_SHELLS "/etc/shells"
#define _PATH_TTY "/dev/tty"
diff --git a/include/protocols/dumprestore.h b/include/protocols/dumprestore.h
index 9721082a900f..72eddcd0f2da 100644
--- a/include/protocols/dumprestore.h
+++ b/include/protocols/dumprestore.h
@@ -67,25 +67,25 @@
union u_spcl {
char dummy[TP_BSIZE];
struct s_spcl {
- int32_t c_type; /* record type (see below) */
+ long c_type; /* record type (see below) */
time_t c_date; /* date of this dump */
time_t c_ddate; /* date of previous dump */
- int32_t c_volume; /* dump volume number */
+ long c_volume; /* dump volume number */
daddr_t c_tapea; /* logical block of this record */
ino_t c_inumber; /* number of inode */
- int32_t c_magic; /* magic number (see above) */
- int32_t c_checksum; /* record checksum */
+ long c_magic; /* magic number (see above) */
+ long c_checksum; /* record checksum */
struct dinode c_dinode; /* ownership and mode of inode */
- int32_t c_count; /* number of valid c_addr entries */
+ long c_count; /* number of valid c_addr entries */
char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
char c_label[LBLSIZE]; /* dump label */
- int32_t c_level; /* level of this dump */
+ long c_level; /* level of this dump */
char c_filesys[NAMELEN]; /* name of dumpped file system */
char c_dev[NAMELEN]; /* name of dumpped device */
char c_host[NAMELEN]; /* name of dumpped host */
- int32_t c_flags; /* additional information */
- int32_t c_firstrec; /* first record on volume */
- int32_t c_spare[32]; /* reserved for future uses */
+ long c_flags; /* additional information */
+ long c_firstrec; /* first record on volume */
+ long c_spare[32]; /* reserved for future uses */
} s_spcl;
} u_spcl;
#define spcl u_spcl.s_spcl
diff --git a/include/protocols/rwhod.h b/include/protocols/rwhod.h
index fbfe2ed7cb04..df61d3ca2d27 100644
--- a/include/protocols/rwhod.h
+++ b/include/protocols/rwhod.h
@@ -42,7 +42,7 @@
struct outmp {
char out_line[8]; /* tty name */
char out_name[8]; /* user id */
- int32_t out_time; /* time on */
+ long out_time; /* time on */
};
struct whod {
diff --git a/include/protocols/talkd.h b/include/protocols/talkd.h
index 962e47be7e0d..34b5da2e567e 100644
--- a/include/protocols/talkd.h
+++ b/include/protocols/talkd.h
@@ -62,10 +62,10 @@ typedef struct {
u_char type; /* request type, see below */
u_char answer; /* not used */
u_char pad;
- u_int32_t id_num; /* message id */
+ u_long id_num; /* message id */
struct osockaddr addr; /* old (4.3) style */
struct osockaddr ctl_addr; /* old (4.3) style */
- int32_t pid; /* caller's process id */
+ long pid; /* caller's process id */
#define NAME_SIZE 12
char l_name[NAME_SIZE];/* caller's name */
char r_name[NAME_SIZE];/* callee's name */
@@ -81,7 +81,7 @@ typedef struct {
u_char type; /* type of request message, see below */
u_char answer; /* respose to request message, see below */
u_char pad;
- u_int32_t id_num; /* message id */
+ u_long id_num; /* message id */
struct osockaddr addr; /* address for establishing conversation */
} CTL_RESPONSE;
diff --git a/include/pthread.h b/include/pthread.h
index dc8ebf08b172..0c382710cf13 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -164,16 +164,11 @@ struct pthread_once {
#endif
enum pthread_mutextype {
- PTHREAD_MUTEX_DEFAULT = 1,
- PTHREAD_MUTEX_RECURSIVE = 2,
- PTHREAD_MUTEX_NORMAL = 3,
- PTHREAD_MUTEX_ERRORCHECK = 4,
+ MUTEX_TYPE_FAST = 1,
+ MUTEX_TYPE_COUNTING_FAST = 2, /* Recursive */
MUTEX_TYPE_MAX
};
-#define MUTEX_TYPE_FAST PTHREAD_MUTEX_DEFAULT
-#define MUTEX_TYPE_COUNTING_FAST PTHREAD_MUTEX_RECURSIVE
-
/*
* Thread function prototype definitions:
*/
@@ -238,7 +233,6 @@ int pthread_mutexattr_setprotocol __P((pthread_mutexattr_t *,
int protocol));
int pthread_mutexattr_setpshared __P((pthread_mutexattr_t *,
int pshared));
-int pthread_mutexattr_settype __P((pthread_mutexattr_t *, int));
int pthread_mutex_destroy __P((pthread_mutex_t *));
int pthread_mutex_getprioceiling __P((pthread_mutex_t *));
int pthread_mutex_init __P((pthread_mutex_t *,
diff --git a/include/pwd.h b/include/pwd.h
index 88d705d89621..895ced304efb 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -71,8 +71,8 @@
struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* encrypted password */
- uid_t pw_uid; /* user uid */
- gid_t pw_gid; /* user gid */
+ int pw_uid; /* user uid */
+ int pw_gid; /* user gid */
time_t pw_change; /* password change time */
char *pw_class; /* user access class */
char *pw_gecos; /* Honeywell login info */
diff --git a/include/rpcsvc/bootparam_prot.x b/include/rpcsvc/bootparam_prot.x
index 5b0b27b2fa1e..249ed8ab90af 100644
--- a/include/rpcsvc/bootparam_prot.x
+++ b/include/rpcsvc/bootparam_prot.x
@@ -48,7 +48,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "bootparam_prot.x,v 1.1 1994/08/04 19:01:44 wollman Exp";
+%static char rcsid[] = "bootparam_prot.x,v 1.1 1994/08/04 19:01:44 wollman Exp";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/klm_prot.x b/include/rpcsvc/klm_prot.x
index c514a9086181..c84b9b2d98d9 100644
--- a/include/rpcsvc/klm_prot.x
+++ b/include/rpcsvc/klm_prot.x
@@ -40,7 +40,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)klm_prot.x 1.7 87/07/08 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)klm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: klm_prot.x,v 1.4 1997/05/28 04:38:14 wpaul Exp $";
+%static char rcsid[] = "$Id: klm_prot.x,v 1.1 1994/08/04 19:01:45 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/mount.x b/include/rpcsvc/mount.x
index c15164782ea3..d7ee70cf1380 100644
--- a/include/rpcsvc/mount.x
+++ b/include/rpcsvc/mount.x
@@ -35,7 +35,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)mount.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: mount.x,v 1.4 1997/04/18 12:31:26 dfr Exp $";
+%static char rcsid[] = "$Id: mount.x,v 1.3 1997/02/23 09:17:29 peter Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/nfs_prot.x b/include/rpcsvc/nfs_prot.x
index c255a104646b..863efe1b9e77 100644
--- a/include/rpcsvc/nfs_prot.x
+++ b/include/rpcsvc/nfs_prot.x
@@ -31,7 +31,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)nfs_prot.x 1.2 87/10/12 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)nfs_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: nfs_prot.x,v 1.5 1998/09/06 09:21:35 obrien Exp $";
+%static char rcsid[] = "$Id: nfs_prot.x,v 1.4 1997/04/18 12:31:27 dfr Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/rex.x b/include/rpcsvc/rex.x
index 1be8b48ab94f..f027d28eef90 100644
--- a/include/rpcsvc/rex.x
+++ b/include/rpcsvc/rex.x
@@ -35,7 +35,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rex.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: rex.x,v 1.4 1997/05/28 04:38:19 wpaul Exp $";
+%static char rcsid[] = "$Id: rex.x,v 1.1 1994/08/04 19:01:49 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/rnusers.x b/include/rpcsvc/rnusers.x
index 22986d8cc375..0ba524872bcc 100644
--- a/include/rpcsvc/rnusers.x
+++ b/include/rpcsvc/rnusers.x
@@ -35,7 +35,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: rnusers.x,v 1.4 1997/05/28 04:38:19 wpaul Exp $";
+%static char rcsid[] = "$Id: rnusers.x,v 1.1 1994/08/04 19:01:50 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/rquota.x b/include/rpcsvc/rquota.x
index 2209339bb795..476d76bd2be1 100644
--- a/include/rpcsvc/rquota.x
+++ b/include/rpcsvc/rquota.x
@@ -7,7 +7,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: rquota.x,v 1.4 1997/05/28 04:38:20 wpaul Exp $";
+%static char rcsid[] = "$Id: rquota.x,v 1.1 1994/08/04 19:01:50 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/rstat.x b/include/rpcsvc/rstat.x
index a46388afda18..0c55005cca17 100644
--- a/include/rpcsvc/rstat.x
+++ b/include/rpcsvc/rstat.x
@@ -47,7 +47,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: rstat.x,v 1.4 1997/05/28 04:38:20 wpaul Exp $";
+%static char rcsid[] = "$Id: rstat.x,v 1.1 1994/08/04 19:01:51 wollman Exp $";
%#endif /* not lint */
#endif /* def RPC_HDR */
diff --git a/include/rpcsvc/spray.x b/include/rpcsvc/spray.x
index a2227fd6dd08..5ae7a4d1780d 100644
--- a/include/rpcsvc/spray.x
+++ b/include/rpcsvc/spray.x
@@ -36,7 +36,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)spray.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: spray.x,v 1.4 1997/05/28 04:38:22 wpaul Exp $";
+%static char rcsid[] = "$Id: spray.x,v 1.1 1994/08/04 19:01:54 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/rpcsvc/yppasswd.x b/include/rpcsvc/yppasswd.x
index 26a9e4a25477..c1505b31a19f 100644
--- a/include/rpcsvc/yppasswd.x
+++ b/include/rpcsvc/yppasswd.x
@@ -36,7 +36,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)yppasswd.x 1.1 87/04/13 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)yppasswd.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static const char rcsid[] = "$Id: yppasswd.x,v 1.4 1997/05/28 04:38:27 wpaul Exp $";
+%static char rcsid[] = "$Id: yppasswd.x,v 1.1 1994/08/04 19:01:57 wollman Exp $";
%#endif /* not lint */
#endif
diff --git a/include/stdio.h b/include/stdio.h
index b2f6957c7a16..c7db2dd91d97 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
- * $Id: stdio.h,v 1.20 1998/07/13 06:45:20 bde Exp $
+ * $Id: stdio.h,v 1.19 1998/07/08 00:52:40 peter Exp $
*/
#ifndef _STDIO_H_
@@ -279,7 +279,7 @@ _BSD_OFF_T_ lseek __P((int, _BSD_OFF_T_, int));
#endif
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
-void *mmap __P((void *, size_t, int, int, int, _BSD_OFF_T_));
+char *mmap __P((void *, size_t, int, int, int, _BSD_OFF_T_));
#endif
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
diff --git a/include/stdlib.h b/include/stdlib.h
index db30a5abc900..a78dafa5dbf3 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -41,6 +41,8 @@
#include <machine/ansi.h>
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+#include <machine/types.h>
+
#ifdef _BSD_RUNE_T_
typedef _BSD_RUNE_T_ rune_t;
#undef _BSD_RUNE_T_
@@ -130,7 +132,7 @@ void srand48 __P((long));
void *alloca __P((size_t)); /* built-in for gcc */
/* getcap(3) functions */
-__uint32_t
+u_int32_t
arc4random __P((void));
void arc4random_addrandom __P((unsigned char *dat, int datlen));
void arc4random_stir __P((void));
@@ -168,8 +170,8 @@ void srandom __P((unsigned long));
void srandomdev __P((void));
char *user_from_uid __P((unsigned long, int));
#ifndef __STRICT_ANSI__
-__int64_t strtoq __P((const char *, char **, int));
-__uint64_t
+int64_t strtoq __P((const char *, char **, int));
+u_int64_t
strtouq __P((const char *, char **, int));
#endif
void unsetenv __P((const char *));
diff --git a/include/string.h b/include/string.h
index acfebfc7141a..81c868ab98f5 100644
--- a/include/string.h
+++ b/include/string.h
@@ -86,7 +86,6 @@ char *strdup __P((const char *));
void strmode __P((int, char *));
int strncasecmp __P((const char *, const char *, size_t));
char *strsep __P((char **, const char *));
-char *strtok_r __P((char *, const char *, char **));
void swab __P((const void *, void *, size_t));
#endif
__END_DECLS
diff --git a/include/time.h b/include/time.h
index a9baa50ff1fd..58409776ff18 100644
--- a/include/time.h
+++ b/include/time.h
@@ -131,15 +131,18 @@ time_t mktime __P((struct tm *));
size_t strftime __P((char *, size_t, const char *, const struct tm *));
time_t time __P((time_t *));
+#ifdef _THREAD_SAFE
+char *asctime_r __P((const struct tm *, char *));
+char *ctime_r __P((const time_t *, char *));
+struct tm *gmtime_r __P((const time_t *, struct tm *));
+struct tm *localtime_r __P((const time_t *, struct tm *));
+#endif
+
#ifndef _ANSI_SOURCE
void tzset __P((void));
#endif /* not ANSI */
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-char *asctime_r __P((const struct tm *, char *));
-char *ctime_r __P((const time_t *, char *));
-struct tm *gmtime_r __P((const time_t *, struct tm *));
-struct tm *localtime_r __P((const time_t *, struct tm *));
char *strptime __P((const char *, const char *, struct tm *));
char *timezone __P((int, int));
void tzsetwall __P((void));
diff --git a/include/unistd.h b/include/unistd.h
index 13afc190e8b5..e88da1713814 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -202,7 +202,6 @@ pid_t vfork __P((void));
extern char *suboptarg; /* getsubopt(3) external variable */
int getsubopt __P((char **, char * const *, char **));
#endif /* !_POSIX_SOURCE */
-extern int optreset; /* getopt(3) external variable */
__END_DECLS
#endif /* !_UNISTD_H_ */
diff --git a/kerberosIV/include/config.h b/kerberosIV/include/config.h
index 86f36145ef46..6d0b8bcf18d3 100644
--- a/kerberosIV/include/config.h
+++ b/kerberosIV/include/config.h
@@ -131,7 +131,7 @@
/* #undef NEED_CRYPT_PROTO */
/* define if the system is missing a prototype for strtok_r() */
-/* #undef NEED_STRTOK_R_PROTO */
+#define NEED_STRTOK_R_PROTO 1
/* define if /bin/ls takes -A */
#define HAVE_LS_A 1
@@ -428,7 +428,7 @@
/* #undef HAVE_STRNLEN */
/* Define if you have the strtok_r function. */
-#define HAVE_STRTOK_R 1
+/* #undef HAVE_STRTOK_R */
/* Define if you have the strupr function. */
/* #undef HAVE_STRUPR */
diff --git a/kerberosIV/lib/libkrb/Makefile b/kerberosIV/lib/libkrb/Makefile
index 1063b31cccc5..6034f5cdf734 100644
--- a/kerberosIV/lib/libkrb/Makefile
+++ b/kerberosIV/lib/libkrb/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 1998/11/18 00:40:07 jdp Exp $
+# $Id$
LIB= krb
CFLAGS+= -I${KRB4DIR}/include \
@@ -6,8 +6,6 @@ CFLAGS+= -I${KRB4DIR}/include \
-I${KRB4DIR}/lib/roken \
-I${KRB4DIR}/lib/krb \
-I${KRBOBJDIR}
-DPADD+= ${LIBCRYPT}
-LDADD+= -lcrypt
SRCS= cr_err_reply.c create_auth_reply.c create_ciph.c \
create_death_packet.c create_ticket.c dest_tkt.c get_in_tkt.c \
get_svc_in_tkt.c getrealm.c k_localtime.c krb_err_txt.c \
@@ -25,7 +23,7 @@ SRCS= cr_err_reply.c create_auth_reply.c create_ciph.c \
rw.c kdc_reply.c encrypt_ktext.c swab.c gettimeofday.c \
check_time.c krb_err.c et_list.c resolve.c unparse_name.c \
logging.c k_concat.c \
- snprintf.c strdup.c strcasecmp.c \
+ snprintf.c strdup.c strtok_r.c strcasecmp.c \
${KRBOBJDIR}/krb_err.h
MAN3= ${KRB4DIR}/man/kerberos.3 \
${KRB4DIR}/man/krb_realmofhost.3 \
diff --git a/kerberosIV/lib/libroken/Makefile b/kerberosIV/lib/libroken/Makefile
index e709329ee39c..cf5f42039427 100644
--- a/kerberosIV/lib/libroken/Makefile
+++ b/kerberosIV/lib/libroken/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1.1.1 1997/09/24 20:37:12 markm Exp $
+# $Id$
LIB= roken
CFLAGS+= -I${KRB4DIR}/include \
@@ -6,7 +6,7 @@ CFLAGS+= -I${KRB4DIR}/include \
-I${KRB4DIR}/lib/roken
SRCS= k_getpwuid.c k_getpwnam.c signal.c tm2time.c \
verify.c inaddr2str.c mini_inetd.c get_window_size.c \
- warnerr.c snprintf.c strlwr.c strnlen.c strupr.c
+ warnerr.c snprintf.c strlwr.c strnlen.c strtok_r.c strupr.c
NOPIC= yes
install:
diff --git a/lib/Makefile b/lib/Makefile
index 26a65e1605c9..2e34bc40a0c2 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
-# $Id: Makefile,v 1.86 1998/11/29 02:47:52 bde Exp $
+# $Id: Makefile,v 1.81 1998/10/01 14:49:57 jkh Exp $
# To satisfy shared library or ELF linkage when only the libraries being
# built are visible:
@@ -8,23 +8,19 @@
# libcom_err must be built before libss.
# libcrypt must be built before libskey.
# libm must be built before libf2c, libg++ and libstdc++.
-# libmd must be built before libatm, libopie, libradius, libskey,
-# and libtacplus.
+# libmd must be built before libatm, libopie and libskey.
# libmytinfo must be built before libdialog and libncurses.
# libncurses must be built before libdialog.
-# libradius must be built before libpam.
-# libskey must be built before libpam.
-# libtacplus must be built before libpam.
# libtermcap must be built before libcurses, libedit and libreadline.
#
# Otherwise, the SUBDIR list should be in alphabetical order.
SUBDIR= ${_csu} libcom_err ${_libcrypt} ${_libm} libmd libmytinfo \
- libncurses libradius libskey libtacplus libtermcap \
+ libncurses libtermcap \
${_compat} libalias libatm libbind libc ${_libc_r} libcalendar libcam \
libcompat libcurses libdevstat libdisk libedit libf2c libfetch \
- libftpio libgnumalloc ${_libio} libipx libkvm libopie libpam \
- libpcap libresolv librpcsvc libss libstand \
+ libftpio libgnumalloc libipx libkvm libopie \
+ libpcap libresolv librpcsvc libskey libss libstand \
${_libtelnet} libutil ${_libvgl} libxpg4 liby libz
.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-${OBJFORMAT})
@@ -56,10 +52,6 @@ _libm= libm
_libm= msun
.endif
-.if ${MACHINE_ARCH} == "alpha"
-_libio= libio
-.endif
-
.if defined(RELEASEDIR) || !exists(${.CURDIR}/../kerberosIV) || \
defined(NOCRYPT) || !defined(MAKE_KERBEROS4)
_libtelnet= libtelnet
diff --git a/lib/csu/alpha/Makefile b/lib/csu/alpha/Makefile
index 473dc99e201a..219f923702c1 100644
--- a/lib/csu/alpha/Makefile
+++ b/lib/csu/alpha/Makefile
@@ -1,10 +1,10 @@
#
-# $Id: Makefile,v 1.6 1998/08/20 21:37:22 jb Exp $
+# $Id: Makefile,v 1.5 1998/05/04 02:06:09 jb Exp $
#
SRCS= crt1.c crtbegin.c crtend.c
OBJS= crt1.o crtbegin.o crtend.o
-SOBJS= crtbegin.So crtend.So
+SOBJS= crtbegin.so crtend.so
CFLAGS+= -Wall -Wno-unused -I${.CURDIR}/../../../libexec/rtld-elf
NOMAN= true
NOPIC= true
@@ -16,7 +16,7 @@ all: ${OBJS} ${SOBJS}
realinstall:
.for file in ${OBJS} ${SOBJS}
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
+ ${file} ${DESTDIR}${LIBDIR}/${file:S/.so$/S.o/}
.endfor
.include <bsd.lib.mk>
diff --git a/lib/csu/alpha/crt1.c b/lib/csu/alpha/crt1.c
index ac87526ca9af..2f7fd95a91b8 100644
--- a/lib/csu/alpha/crt1.c
+++ b/lib/csu/alpha/crt1.c
@@ -30,7 +30,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: crt1.c,v 1.3 1999/01/07 20:18:18 steve Exp $
+ * $Id: crt1.c,v 1.1.1.2 1998/03/11 20:36:09 jb Exp $
*/
#ifndef __GNUC__
@@ -80,13 +80,8 @@ _start(char **ap,
argv = ap + 1;
env = ap + 2 + argc;
environ = env;
- if(argc > 0 && argv[0] != NULL) {
- char *s;
+ if(argc > 0)
__progname = argv[0];
- for (s = __progname; *s != '\0'; s++)
- if (*s == '/')
- __progname = s + 1;
- }
if (&_DYNAMIC != NULL) {
if ((obj == NULL) || (obj->magic != RTLD_MAGIC))
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile
index ae195e85dfc3..6432efe1d939 100644
--- a/lib/csu/i386-elf/Makefile
+++ b/lib/csu/i386-elf/Makefile
@@ -1,11 +1,11 @@
#
-# $Id: Makefile,v 1.2 1998/09/07 23:31:59 jdp Exp $
+# $Id: Makefile,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $
#
SRCS= crt1.c crtbegin.c crtend.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o
-SOBJS= crtbegin.So crtend.So
+SOBJS= crtbegin.so crtend.so
CFLAGS+= -elf
CFLAGS+= -Wall -Wno-unused
LDFLAGS+= -elf
@@ -22,7 +22,7 @@ gcrt1.o: crt1.c
realinstall:
.for file in ${OBJS} ${SOBJS}
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
+ ${file} ${DESTDIR}${LIBDIR}/${file:S/.so$/S.o/}
.endfor
.include <bsd.lib.mk>
diff --git a/lib/csu/i386-elf/crt1.c b/lib/csu/i386-elf/crt1.c
index d1dd43d0c361..a30399725f80 100644
--- a/lib/csu/i386-elf/crt1.c
+++ b/lib/csu/i386-elf/crt1.c
@@ -22,14 +22,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: crt1.c,v 1.2 1998/09/07 23:31:59 jdp Exp $
+ * $Id: crt1.c,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $
*/
#ifndef __GNUC__
#error "GCC is needed to compile this file"
#endif
-#include <stddef.h>
#include <stdlib.h>
typedef void (*fptr)(void);
@@ -73,15 +72,10 @@ _start(char *arguments, ...)
argc = * (int *) (argv - 1);
env = argv + argc + 1;
environ = env;
- if(argc > 0 && argv[0] != NULL) {
- char *s;
+ if(argc > 0)
__progname = argv[0];
- for (s = __progname; *s != '\0'; s++)
- if (*s == '/')
- __progname = s + 1;
- }
- if(&_DYNAMIC != NULL)
+ if(&_DYNAMIC != 0)
atexit(rtld_cleanup);
#ifdef GCRT
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index d58be684afce..9cd822c207bc 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -1,22 +1,19 @@
# from: @(#)Makefile 5.6 (Berkeley) 5/22/91
-# $Id: Makefile,v 1.38 1998/05/31 11:32:37 bde Exp $
+# $Id: Makefile,v 1.37 1998/05/26 20:12:52 sos Exp $
CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
OBJS= crt0.o c++rt0.o gcrt0.o scrt0.o sgcrt0.o
-CLEANFILES= a.out crt0.o.tmp c++rt0.o.tmp gcrt0.o.tmp scrt0.o.tmp \
- sgcrt0.o.tmp
+CLEANFILES+= a.out
all: ${OBJS}
crt0.o: crt0.c
${CC} ${CFLAGS} -c -DCRT0 -DDYNAMIC ${.CURDIR}/crt0.c -o ${.TARGET}
- ${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ ${LD} -O ${.TARGET} -x -r ${.TARGET}
c++rt0.o: c++rt0.c
${CC} ${CFLAGS} -fpic -c ${.CURDIR}/c++rt0.c
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ @${LD} -O ${.TARGET} -x -r ${.TARGET}
#
# gcrt0.o doesn't really depend on crt0.o, but this is the easiest way
@@ -24,20 +21,17 @@ c++rt0.o: c++rt0.c
#
gcrt0.o: crt0.o
${CC} ${CFLAGS} -c -DMCRT0 -DDYNAMIC ${.CURDIR}/crt0.c -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ ${LD} -O ${.TARGET} -x -r ${.TARGET}
# dependencies fudged as for gcrt0.o
scrt0.o: crt0.o
${CC} ${CFLAGS} -c -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ ${LD} -O ${.TARGET} -x -r ${.TARGET}
# dependencies fudged as for gcrt0.o
sgcrt0.o: scrt0.o
${CC} ${CFLAGS} -c -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
- @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
- @mv ${.TARGET}.tmp ${.TARGET}
+ ${LD} -O ${.TARGET} -x -r ${.TARGET}
realinstall:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
@@ -50,9 +44,6 @@ depend: .depend
mkdep ${CFLAGS} -DCRT0 -DDYNAMIC ${.CURDIR}/crt0.c
mkdep -a ${CFLAGS} ${.CURDIR}/c++rt0.c
-cleandepend:
- rm -f .depend
-
lint tags:
.include <bsd.prog.mk>
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c
index 4989c5c55a44..8286e74057ac 100644
--- a/lib/csu/i386/crt0.c
+++ b/lib/csu/i386/crt0.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: crt0.c,v 1.34 1998/02/11 04:57:12 jdp Exp $
+ * $Id: crt0.c,v 1.33 1998/02/09 06:05:09 jdp Exp $
*/
#include <sys/param.h>
@@ -115,14 +115,14 @@ void monstartup(void *low, void *high);
#define _exit(v) \
__syscall(SYS_exit, (int)(v))
#define _open(name, f, m) \
- __syscall(SYS_open, (const char *)(name), (int)(f), (int)(m))
+ __syscall(SYS_open, (char *)(name), (int)(f), (int)(m))
#define _read(fd, s, n) \
__syscall(SYS_read, (int)(fd), (void *)(s), (size_t)(n))
#define _write(fd, s, n) \
- __syscall(SYS_write, (int)(fd), (const void *)(s), (size_t)(n))
+ __syscall(SYS_write, (int)(fd), (void *)(s), (size_t)(n))
#define _mmap(addr, len, prot, flags, fd, off) \
- (void *) __syscall(SYS_mmap, (void *)(addr), (size_t)(len), \
- (int)(prot), (int)(flags), (int)(fd), 0, (off_t)(off))
+ (caddr_t) __syscall(SYS_mmap, (caddr_t)(addr), (size_t)(len), \
+ (int)(prot), (int)(flags), (int)(fd), (long)0L, (off_t)(off))
#define _PUTNMSG(str, len) _write(2, (str), (len))
#define _PUTMSG(str) _PUTNMSG((str), sizeof (str) - 1)
diff --git a/lib/libF77/MAIN.c b/lib/libF77/MAIN.c
deleted file mode 100644
index 99b7114b958a..000000000000
--- a/lib/libF77/MAIN.c
+++ /dev/null
@@ -1 +0,0 @@
-MAIN__(){}
diff --git a/lib/libalias/alias.c b/lib/libalias/alias.c
index 50e597f4364a..48a852a250f4 100644
--- a/lib/libalias/alias.c
+++ b/lib/libalias/alias.c
@@ -73,9 +73,6 @@
- Eliminated PacketAliasIn2() and
PacketAliasOut2() as poorly conceived.
- Version 2.3 Dec 1998 (dillon)
- - Major bounds checking additions, see FreeBSD/CVS
-
See HISTORY file for additional revisions.
*/
@@ -606,7 +603,6 @@ UdpAliasIn(struct ip *pip)
u_short alias_port;
int accumulate;
u_short *sptr;
- int r = 0;
alias_address = GetAliasAddress(link);
original_address = GetOriginalAddress(link);
@@ -617,11 +613,11 @@ UdpAliasIn(struct ip *pip)
if (ntohs(ud->uh_dport) == NETBIOS_DGM_PORT_NUMBER
|| ntohs(ud->uh_sport) == NETBIOS_DGM_PORT_NUMBER )
{
- r = AliasHandleUdpNbt(pip, link, &original_address, ud->uh_dport);
+ AliasHandleUdpNbt(pip, link, &original_address, ud->uh_dport);
} else if (ntohs(ud->uh_dport) == NETBIOS_NS_PORT_NUMBER
|| ntohs(ud->uh_sport) == NETBIOS_NS_PORT_NUMBER )
{
- r = AliasHandleUdpNbtNS(pip, link,
+ AliasHandleUdpNbtNS(pip, link,
&alias_address,
&alias_port,
&original_address,
@@ -652,14 +648,7 @@ UdpAliasIn(struct ip *pip)
(u_short *) &pip->ip_dst,
2);
pip->ip_dst = original_address;
-
- /*
- * If we cannot figure out the packet, ignore it.
- */
- if (r < 0)
- return(PKT_ALIAS_IGNORED);
- else
- return(PKT_ALIAS_OK);
+ return(PKT_ALIAS_OK);
}
return(PKT_ALIAS_IGNORED);
}
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c
index dc9d020bd858..7bbb19122bed 100644
--- a/lib/libalias/alias_db.c
+++ b/lib/libalias/alias_db.c
@@ -437,7 +437,7 @@ ShowAliasStats(void)
{
/* Used for debugging */
- if (monitorFile)
+ if (packetAliasMode & PKT_ALIAS_LOG)
{
fprintf(monitorFile, "icmp=%d, udp=%d, tcp=%d, frag_id=%d frag_ptr=%d",
icmpLinkCount,
@@ -1837,10 +1837,8 @@ InitPacketAliasLog(void)
static void
UninitPacketAliasLog(void)
{
- if (monitorFile) {
+ if( monitorFile )
fclose(monitorFile);
- monitorFile = NULL;
- }
packetAliasMode &= ~PKT_ALIAS_LOG;
}
diff --git a/lib/libalias/alias_local.h b/lib/libalias/alias_local.h
index 38462810733a..0e94a64b2814 100644
--- a/lib/libalias/alias_local.h
+++ b/lib/libalias/alias_local.h
@@ -90,8 +90,8 @@ void HouseKeeping(void);
/*lint -save -library Suppress flexelint warnings */
void AliasHandleFtpOut(struct ip *, struct alias_link *, int);
void AliasHandleIrcOut(struct ip *pip, struct alias_link *link, int maxsize );
-int AliasHandleUdpNbt(struct ip *, struct alias_link *, struct in_addr *, u_short);
-int AliasHandleUdpNbtNS(struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *);
+void AliasHandleUdpNbt(struct ip *, struct alias_link *, struct in_addr *, u_short);
+void AliasHandleUdpNbtNS(struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *);
void AliasHandleCUSeeMeOut(struct ip *, struct alias_link *);
void AliasHandleCUSeeMeIn(struct ip *, struct in_addr);
diff --git a/lib/libalias/alias_nbt.c b/lib/libalias/alias_nbt.c
index cd07431f5cbf..f3581a72d5ff 100644
--- a/lib/libalias/alias_nbt.c
+++ b/lib/libalias/alias_nbt.c
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: alias_nbt.c,v 1.1 1998/05/24 03:03:10 amurai Exp $
+ * $Id:$
*
* TODO:
* oClean up.
@@ -132,21 +132,15 @@ void PrintRcode( u_char rcode ) {
/* Handling Name field */
-u_char *AliasHandleName ( u_char *p, char *pmax ) {
+u_char *AliasHandleName ( u_char *p ) {
u_char *s;
u_char c;
int compress;
/* Following length field */
-
- if (p == NULL || (char *)p >= pmax)
- return(NULL);
-
if (*p & 0xc0 ) {
p = p + 2;
- if ((char *)p > pmax)
- return(NULL);
return ((u_char *)p);
}
while ( ( *p & 0x3f) != 0x00 ) {
@@ -158,10 +152,6 @@ u_char *AliasHandleName ( u_char *p, char *pmax ) {
/* Get next length field */
p = (u_char *)(p + (*p & 0x3f) + 1);
- if ((char *)p > pmax) {
- p = NULL;
- break;
- }
#ifdef DEBUG
printf(":");
#endif
@@ -189,10 +179,7 @@ u_char *AliasHandleName ( u_char *p, char *pmax ) {
}
/* Set up to out of Name field */
- if (p == NULL || (char *)p >= pmax)
- p = NULL;
- else
- p++;
+ p++;
return ((u_char *)p);
}
@@ -207,24 +194,19 @@ u_char *AliasHandleName ( u_char *p, char *pmax ) {
#define DGM_POSITIVE_RES 0x15
#define DGM_NEGATIVE_RES 0x16
-int AliasHandleUdpNbt(
+void AliasHandleUdpNbt(
struct ip *pip, /* IP packet to examine/patch */
struct alias_link *link,
struct in_addr *alias_address,
- u_short alias_port
-) {
+ u_short alias_port )
+{
struct udphdr * uh;
NbtDataHeader *ndh;
- u_char *p = NULL;
- char *pmax;
+ u_char *p;
/* Calculate data length of UDP packet */
uh = (struct udphdr *) ((char *) pip + (pip->ip_hl << 2));
- pmax = (char *)uh + ntohs( uh->uh_ulen );
-
ndh = (NbtDataHeader *)((char *)uh + (sizeof (struct udphdr)));
- if ((char *)(ndh + 1) > pmax)
- return(-1);
#ifdef DEBUG
printf("\nType=%02x,", ndh->type );
#endif
@@ -233,8 +215,8 @@ int AliasHandleUdpNbt(
case DGM_DIRECT_GROUP:
case DGM_BROADCAST:
p = (u_char *)ndh + 14;
- p = AliasHandleName ( p, pmax ); /* Source Name */
- p = AliasHandleName ( p, pmax ); /* Destination Name */
+ p = AliasHandleName ( p ); /* Source Name */
+ p = AliasHandleName ( p ); /* Destination Name */
break;
case DGM_ERROR:
p = (u_char *)ndh + 11;
@@ -243,11 +225,9 @@ int AliasHandleUdpNbt(
case DGM_POSITIVE_RES:
case DGM_NEGATIVE_RES:
p = (u_char *)ndh + 10;
- p = AliasHandleName ( p, pmax ); /* Destination Name */
+ p = AliasHandleName ( p ); /* Destination Name */
break;
}
- if (p == NULL || (char *)p > pmax)
- p = NULL;
#ifdef DEBUG
printf("%s:%d-->", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
#endif
@@ -271,7 +251,6 @@ int AliasHandleUdpNbt(
printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
fflush(stdout);
#endif
- return((p == NULL) ? -1 : 0);
}
/* Question Section */
#define QS_TYPE_NB 0x0020
@@ -282,22 +261,14 @@ typedef struct {
u_short class; /* The class of Request */
} NBTNsQuestion;
-u_char *
-AliasHandleQuestion(
- u_short count,
+u_char *AliasHandleQuestion(u_short count,
NBTNsQuestion *q,
- char *pmax,
NBTArguments *nbtarg)
{
while ( count != 0 ) {
/* Name Filed */
- q = (NBTNsQuestion *)AliasHandleName((u_char *)q, pmax);
-
- if (q == NULL || (char *)(q + 1) > pmax) {
- q = NULL;
- break;
- }
+ q = (NBTNsQuestion *)AliasHandleName((u_char *)q );
/* Type and Class filed */
switch ( ntohs(q->type) ) {
@@ -337,17 +308,12 @@ typedef struct {
struct in_addr addr;
} NBTNsRNB;
-u_char *
-AliasHandleResourceNB(
- NBTNsResource *q,
- char *pmax,
+u_char *AliasHandleResourceNB( NBTNsResource *q,
NBTArguments *nbtarg)
{
NBTNsRNB *nb;
u_short bcount;
- if (q == NULL || (char *)(q + 1) > pmax)
- return(NULL);
/* Check out a length */
bcount = ntohs(q->rdlen);
@@ -359,11 +325,7 @@ AliasHandleResourceNB(
printf("NB rec[%s", inet_ntoa(nbtarg->oldaddr));
printf("->%s, %dbytes] ",inet_ntoa(nbtarg->newaddr ), bcount);
#endif
- while ( nb != NULL && bcount != 0 ) {
- if ((char *)(nb + 1) > pmax) {
- nb = NULL;
- break;
- }
+ while ( bcount != 0 ) {
#ifdef DEBUG
printf("<%s>", inet_ntoa(nb->addr) );
#endif
@@ -394,9 +356,6 @@ AliasHandleResourceNB(
nb=(NBTNsRNB *)((u_char *)nb + SizeOfNsRNB);
bcount -= SizeOfNsRNB;
}
- if (nb == NULL || (char *)(nb + 1) > pmax) {
- nb = NULL;
- }
return ((u_char *)nb);
}
@@ -406,18 +365,12 @@ typedef struct {
struct in_addr addr;
} NBTNsResourceA;
-u_char *
-AliasHandleResourceA(
- NBTNsResource *q,
- char *pmax,
+u_char *AliasHandleResourceA( NBTNsResource *q,
NBTArguments *nbtarg)
{
NBTNsResourceA *a;
u_short bcount;
- if (q == NULL || (char *)(q + 1) > pmax)
- return(NULL);
-
/* Forward to Resource A position */
a = (NBTNsResourceA *)( (u_char *)q + sizeof(NBTNsResource) );
@@ -430,8 +383,6 @@ AliasHandleResourceA(
printf("->%s]",inet_ntoa(nbtarg->newaddr ));
#endif
while ( bcount != 0 ) {
- if (a == NULL || (char *)(a + 1) > pmax)
- return(NULL);
#ifdef DEBUG
printf("..%s", inet_ntoa(a->addr) );
#endif
@@ -454,8 +405,6 @@ AliasHandleResourceA(
a++; /*XXXX*/
bcount -= SizeOfResourceA;
}
- if (a == NULL || (char *)(a + 1) > pmax)
- a = NULL;
return ((u_char *)a);
}
@@ -463,18 +412,12 @@ typedef struct {
u_short opcode:4, flags:8, resv:4;
} NBTNsResourceNULL;
-u_char *
-AliasHandleResourceNULL(
- NBTNsResource *q,
- char *pmax,
+u_char *AliasHandleResourceNULL( NBTNsResource *q,
NBTArguments *nbtarg)
{
NBTNsResourceNULL *n;
u_short bcount;
- if (q == NULL || (char *)(q + 1) > pmax)
- return(NULL);
-
/* Forward to Resource NULL position */
n = (NBTNsResourceNULL *)( (u_char *)q + sizeof(NBTNsResource) );
@@ -483,31 +426,19 @@ AliasHandleResourceNULL(
/* Processing all in_addr array */
while ( bcount != 0 ) {
- if ((char *)(n + 1) > pmax) {
- n = NULL;
- break;
- }
n++;
bcount -= sizeof(NBTNsResourceNULL);
}
- if ((char *)(n + 1) > pmax)
- n = NULL;
return ((u_char *)n);
}
-u_char *
-AliasHandleResourceNS(
- NBTNsResource *q,
- char *pmax,
+u_char *AliasHandleResourceNS( NBTNsResource *q,
NBTArguments *nbtarg)
{
NBTNsResourceNULL *n;
u_short bcount;
- if (q == NULL || (char *)(q + 1) > pmax)
- return(NULL);
-
/* Forward to Resource NULL position */
n = (NBTNsResourceNULL *)( (u_char *)q + sizeof(NBTNsResource) );
@@ -515,11 +446,8 @@ AliasHandleResourceNS(
bcount = ntohs(q->rdlen);
/* Resource Record Name Filed */
- q = (NBTNsResource *)AliasHandleName( (u_char *)n, pmax ); /* XXX */
+ q = (NBTNsResource *)AliasHandleName( (u_char *)n ); /* XXX */
- if (q == NULL || (char *)((u_char *)n + bcount) > pmax)
- return(NULL);
- else
return ((u_char *)n + bcount);
}
@@ -527,44 +455,28 @@ typedef struct {
u_short numnames;
} NBTNsResourceNBSTAT;
-u_char *
-AliasHandleResourceNBSTAT(
- NBTNsResource *q,
- char *pmax,
+u_char *AliasHandleResourceNBSTAT( NBTNsResource *q,
NBTArguments *nbtarg)
{
NBTNsResourceNBSTAT *n;
u_short bcount;
- if (q == NULL || (char *)(q + 1) > pmax)
- return(NULL);
-
/* Forward to Resource NBSTAT position */
n = (NBTNsResourceNBSTAT *)( (u_char *)q + sizeof(NBTNsResource) );
/* Check out of length */
bcount = ntohs(q->rdlen);
- if (q == NULL || (char *)((u_char *)n + bcount) > pmax)
- return(NULL);
- else
return ((u_char *)n + bcount);
}
-u_char *
-AliasHandleResource(
- u_short count,
+u_char *AliasHandleResource(u_short count,
NBTNsResource *q,
- char *pmax,
- NBTArguments
- *nbtarg)
+ NBTArguments *nbtarg)
{
while ( count != 0 ) {
/* Resource Record Name Filed */
- q = (NBTNsResource *)AliasHandleName( (u_char *)q, pmax );
-
- if (q == NULL || (char *)(q + 1) > pmax)
- break;
+ q = (NBTNsResource *)AliasHandleName( (u_char *)q );
#ifdef DEBUG
printf("type=%02x, count=%d\n", ntohs(q->type), count );
#endif
@@ -572,45 +484,22 @@ AliasHandleResource(
/* Type and Class filed */
switch ( ntohs(q->type) ) {
case RR_TYPE_NB:
- q = (NBTNsResource *)AliasHandleResourceNB(
- q,
- pmax,
- nbtarg
- );
+ q = (NBTNsResource *)AliasHandleResourceNB( q, nbtarg );
break;
case RR_TYPE_A:
- q = (NBTNsResource *)AliasHandleResourceA(
- q,
- pmax,
- nbtarg
- );
+ q = (NBTNsResource *)AliasHandleResourceA( q, nbtarg );
break;
case RR_TYPE_NS:
- q = (NBTNsResource *)AliasHandleResourceNS(
- q,
- pmax,
- nbtarg
- );
+ q = (NBTNsResource *)AliasHandleResourceNS( q, nbtarg );
break;
case RR_TYPE_NULL:
- q = (NBTNsResource *)AliasHandleResourceNULL(
- q,
- pmax,
- nbtarg
- );
+ q = (NBTNsResource *)AliasHandleResourceNULL( q, nbtarg );
break;
case RR_TYPE_NBSTAT:
- q = (NBTNsResource *)AliasHandleResourceNBSTAT(
- q,
- pmax,
- nbtarg
- );
+ q = (NBTNsResource *)AliasHandleResourceNBSTAT( q, nbtarg );
break;
- default:
- printf(
- "\nUnknown Type of Resource %0x\n",
- ntohs(q->type)
- );
+ default: printf("\nUnknown Type of Resource %0x\n",
+ ntohs(q->type) );
break;
}
count--;
@@ -619,7 +508,7 @@ AliasHandleResource(
return ((u_char *)q);
}
-int AliasHandleUdpNbtNS(
+void AliasHandleUdpNbtNS(
struct ip *pip, /* IP packet to examine/patch */
struct alias_link *link,
struct in_addr *alias_address,
@@ -629,8 +518,8 @@ int AliasHandleUdpNbtNS(
{
struct udphdr * uh;
NbtNSHeader * nsh;
+ u_short dlen;
u_char * p;
- char *pmax;
NBTArguments nbtarg;
/* Set up Common Parameter */
@@ -642,16 +531,12 @@ int AliasHandleUdpNbtNS(
/* Calculate data length of UDP packet */
uh = (struct udphdr *) ((char *) pip + (pip->ip_hl << 2));
nbtarg.uh_sum = &(uh->uh_sum);
+ dlen = ntohs( uh->uh_ulen );
nsh = (NbtNSHeader *)((char *)uh + (sizeof(struct udphdr)));
p = (u_char *)(nsh + 1);
- pmax = (char *)uh + ntohs( uh->uh_ulen );
-
- if ((char *)(nsh + 1) > pmax)
- return(-1);
#ifdef DEBUG
- printf(" [%s] ID=%02x, op=%01x, flag=%02x, rcode=%01x, qd=%04x"
- ", an=%04x, ns=%04x, ar=%04x, [%d]-->",
+ printf(" [%s] ID=%02x, op=%01x, flag=%02x, rcode=%01x, qd=%04x, an=%04x, ns=%04x, ar=%04x, [%d]-->",
nsh->dir ? "Response": "Request",
nsh->nametrid,
nsh->opcode,
@@ -661,53 +546,31 @@ int AliasHandleUdpNbtNS(
ntohs(nsh->ancount),
ntohs(nsh->nscount),
ntohs(nsh->arcount),
- (u_char *)p -(u_char *)nsh
- );
+ (u_char *)p -(u_char *)nsh);
#endif
/* Question Entries */
if (ntohs(nsh->qdcount) !=0 ) {
- p = AliasHandleQuestion(
- ntohs(nsh->qdcount),
- (NBTNsQuestion *)p,
- pmax,
- &nbtarg
- );
+ p = AliasHandleQuestion(ntohs(nsh->qdcount), (NBTNsQuestion *)p, &nbtarg );
}
/* Answer Resource Records */
if (ntohs(nsh->ancount) !=0 ) {
- p = AliasHandleResource(
- ntohs(nsh->ancount),
- (NBTNsResource *)p,
- pmax,
- &nbtarg
- );
+ p = AliasHandleResource(ntohs(nsh->ancount), (NBTNsResource *)p, &nbtarg );
}
/* Authority Resource Recodrs */
if (ntohs(nsh->nscount) !=0 ) {
- p = AliasHandleResource(
- ntohs(nsh->nscount),
- (NBTNsResource *)p,
- pmax,
- &nbtarg
- );
+ p = AliasHandleResource(ntohs(nsh->nscount), (NBTNsResource *)p, &nbtarg );
}
/* Additional Resource Recodrs */
if (ntohs(nsh->arcount) !=0 ) {
- p = AliasHandleResource(
- ntohs(nsh->arcount),
- (NBTNsResource *)p,
- pmax,
- &nbtarg
- );
+ p = AliasHandleResource(ntohs(nsh->arcount), (NBTNsResource *)p, &nbtarg );
}
#ifdef DEBUG
PrintRcode(nsh->rcode);
#endif
- return ((p == NULL) ? -1 : 0);
+ return;
}
-
diff --git a/lib/libalias/libalias.3 b/lib/libalias/libalias.3
index f9b36e6c6d71..b3fcc9129451 100644
--- a/lib/libalias/libalias.3
+++ b/lib/libalias/libalias.3
@@ -26,8 +26,8 @@ of the text.
2.4 PacketAliasSetMode()
2.5 PacketAliasSetFWBase()
3. Packet Handling
- 3.1 PacketAliasIn()
- 3.2 PacketAliasOut()
+ 3.1 PacketAliasOut()
+ 3.2 PacketAliasIn()
4. Port and Address Redirection
4.1 PacketAliasRedirectPort()
4.2 PacketAliasRedirectAddr()
@@ -325,7 +325,7 @@ them with PacketAliasFragmentIn().
.Ss 3.2 PacketAliasOut()
.Ft int
-.Fn PacketAliasOut "char *buffer" "int maxpacketsize"
+.Fn PacketAliasIn "char *buffer" "int maxpacketsize"
An outgoing packet coming from the local network
to a remote machine is aliased by this function.
diff --git a/lib/libc/alpha/SYS.h b/lib/libc/alpha/SYS.h
index 01d114d2903a..cfc0909d8d32 100644
--- a/lib/libc/alpha/SYS.h
+++ b/lib/libc/alpha/SYS.h
@@ -1,4 +1,4 @@
-/* $Id: SYS.h,v 1.4 1998/12/23 11:50:51 dfr Exp $ */
+/* $Id: SYS.h,v 1.2 1998/06/09 22:43:34 jb Exp $ */
/* From: NetBSD: SYS.h,v 1.5 1997/05/02 18:15:15 kleink Exp */
/*
@@ -41,7 +41,7 @@
LLABEL(name,0): \
LDGP(gp); \
beq a3, LLABEL(name,1); \
- jmp zero, .cerror; \
+ jmp zero, cerror; \
LLABEL(name,1):
diff --git a/lib/libc/alpha/gen/Makefile.inc b/lib/libc/alpha/gen/Makefile.inc
index cc7a87c10cff..3ff99f001439 100644
--- a/lib/libc/alpha/gen/Makefile.inc
+++ b/lib/libc/alpha/gen/Makefile.inc
@@ -1,8 +1,10 @@
-# $Id: Makefile.inc,v 1.4 1998/08/17 03:38:54 jb Exp $
+# $Id: Makefile.inc,v 1.3 1998/08/08 02:18:07 jb Exp $
SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.c ldexp.c modf.c setjmp.S
-SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
- fpsetround.c fpsetsticky.c
+SRCS+= flt_rounds.c
+
+#SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
+# fpsetround.c fpsetsticky.c
SRCS+= sigsetjmp.S
SRCS+= __divqu.S __divq.S __divlu.S __divl.S
diff --git a/lib/libc/alpha/gen/fpgetmask.c b/lib/libc/alpha/gen/fpgetmask.c
index 516ae981d55c..c52a7ef07112 100644
--- a/lib/libc/alpha/gen/fpgetmask.c
+++ b/lib/libc/alpha/gen/fpgetmask.c
@@ -31,19 +31,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/sysarch.h>
-
-struct params {
- u_int64_t mask;
-};
fp_except
fpgetmask()
{
- struct params p;
- sysarch(ALPHA_GET_FPMASK, (char *) &p);
- return((fp_except) p.mask);
+ /* XXX */
+ abort();
}
diff --git a/lib/libc/alpha/gen/fpgetround.c b/lib/libc/alpha/gen/fpgetround.c
index 46976c2e4c11..39b9b4744a6b 100644
--- a/lib/libc/alpha/gen/fpgetround.c
+++ b/lib/libc/alpha/gen/fpgetround.c
@@ -33,7 +33,6 @@
#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/fpu.h>
fp_rnd
fpgetround()
@@ -41,8 +40,10 @@ fpgetround()
double fpcrval;
u_int64_t old;
- GET_FPCR(fpcrval);
+ __asm__("trapb");
+ __asm__("mf_fpcr %0" : "=f" (fpcrval));
+ __asm__("trapb");
old = *(u_int64_t *)&fpcrval;
- return ((old & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT);
+ return ((old >> 58) & 0x3);
}
diff --git a/lib/libc/alpha/gen/fpgetsticky.c b/lib/libc/alpha/gen/fpgetsticky.c
index c0ff4d75c88a..c36db3913d5f 100644
--- a/lib/libc/alpha/gen/fpgetsticky.c
+++ b/lib/libc/alpha/gen/fpgetsticky.c
@@ -31,18 +31,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/fpu.h>
fp_except
fpgetsticky()
{
- double fpcrval;
- u_int64_t old;
- GET_FPCR(fpcrval);
- old = *(u_int64_t *)&fpcrval;
- return (((old >> IEEE_STATUS_TO_FPCR_SHIFT) & IEEE_STATUS_MASK)
- >> IEEE_STATUS_TO_EXCSUM_SHIFT);
+ /* XXX */
+ abort();
}
diff --git a/lib/libc/alpha/gen/fpsetmask.c b/lib/libc/alpha/gen/fpsetmask.c
index 05201ce81d40..87fc5a2f4b4c 100644
--- a/lib/libc/alpha/gen/fpsetmask.c
+++ b/lib/libc/alpha/gen/fpsetmask.c
@@ -31,21 +31,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/sysarch.h>
-
-struct params {
- u_int64_t mask;
-};
fp_except
fpsetmask(mask)
fp_except mask;
{
- struct params p;
- p.mask = (u_int64_t) mask;
- sysarch(ALPHA_SET_FPMASK, (char *) &p);
- return ((fp_except) p.mask);
+ /* XXX */
+ abort();
}
diff --git a/lib/libc/alpha/gen/fpsetround.c b/lib/libc/alpha/gen/fpsetround.c
index 0d8f40af6d65..c28093cad87c 100644
--- a/lib/libc/alpha/gen/fpsetround.c
+++ b/lib/libc/alpha/gen/fpsetround.c
@@ -33,7 +33,6 @@
#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/fpu.h>
fp_rnd
fpsetround(rnd_dir)
@@ -42,14 +41,18 @@ fpsetround(rnd_dir)
double fpcrval;
u_int64_t old, new;
- GET_FPCR(fpcrval);
+ __asm__("trapb");
+ __asm__("mf_fpcr %0" : "=f" (fpcrval));
+ __asm__("trapb");
old = *(u_int64_t *)&fpcrval;
- new = old & (~FPCR_DYN_MASK);
- new |= ((long) rnd_dir << FPCR_DYN_SHIFT) & FPCR_DYN_MASK;
-
+ new = old & ~(long)0x0c00000000000000;
+ new = (long)rnd_dir << 58;
*(u_int64_t *)&fpcrval = new;
- SET_FPCR(fpcrval);
- return ((old & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT);
+ __asm__("trapb");
+ __asm__("mt_fpcr %0" : : "f" (fpcrval));
+ __asm__("trapb");
+
+ return ((old >> 58) & 0x3);
}
diff --git a/lib/libc/alpha/gen/fpsetsticky.c b/lib/libc/alpha/gen/fpsetsticky.c
index ae0d742f79f0..90a993ee642a 100644
--- a/lib/libc/alpha/gen/fpsetsticky.c
+++ b/lib/libc/alpha/gen/fpsetsticky.c
@@ -31,25 +31,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/fpu.h>
fp_except
fpsetsticky(sticky)
fp_except sticky;
{
- double fpcrval;
- u_int64_t old,new ;
- GET_FPCR(fpcrval);
- old = *(u_int64_t *)&fpcrval;
- new = old & ~ (IEEE_STATUS_MASK << IEEE_STATUS_TO_FPCR_SHIFT);
- new |= ((sticky << IEEE_STATUS_TO_EXCSUM_SHIFT) & IEEE_STATUS_MASK)
- << IEEE_STATUS_TO_FPCR_SHIFT;
- *(u_int64_t *)&fpcrval = new;
- SET_FPCR(fpcrval);
-
- return (((old >> IEEE_STATUS_TO_FPCR_SHIFT) & IEEE_STATUS_MASK)
- >> IEEE_STATUS_TO_EXCSUM_SHIFT);
+ /* XXX */
+ abort();
}
diff --git a/lib/libc/alpha/gen/setjmp.S b/lib/libc/alpha/gen/setjmp.S
index a6d10836ae95..86dbb38f1b90 100644
--- a/lib/libc/alpha/gen/setjmp.S
+++ b/lib/libc/alpha/gen/setjmp.S
@@ -68,7 +68,7 @@ LEAF(setjmp, 1)
lda sp, -24(sp) /* sizeof struct sigaltstack */
mov zero, a0
mov sp, a1
- PCALL(sigaltstack)
+ CALL(sigaltstack)
ldl t0, 16(sp) /* offset of ss_flags */
lda sp, 24(sp) /* sizeof struct sigaltstack */
ldq ra, ((26 + 4) * 8)(s0) /* restore return address */
diff --git a/lib/libc/alpha/sys/cerror.S b/lib/libc/alpha/sys/cerror.S
index 63771c0ffa08..cce30068de6c 100644
--- a/lib/libc/alpha/sys/cerror.S
+++ b/lib/libc/alpha/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $Id: cerror.S,v 1.3 1998/12/23 11:50:51 dfr Exp $ */
+/* $Id$ */
/* From: NetBSD: cerror.S,v 1.4 1996/11/08 00:52:46 cgd Exp */
/*
@@ -34,7 +34,7 @@
#define FRAME_RA_OFFSET 0
#define FRAME_V0_OFFSET 8
-NESTED(.cerror, 0, FRAME_SIZE, ra, IM_RA|IM_V0, 0)
+NESTED(cerror, 0, FRAME_SIZE, ra, IM_RA|IM_V0, 0)
br t0, L1
L1: LDGP(t0)
@@ -51,4 +51,4 @@ L1: LDGP(t0)
ldq ra, FRAME_RA_OFFSET(sp)
lda sp, FRAME_SIZE(sp)
RET
-END(.cerror)
+END(cerror)
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 65b02c190665..a5260687149a 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -35,13 +35,8 @@
static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-
#include <errno.h>
#include <fstab.h>
-#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -52,30 +47,8 @@ static struct fstab _fs_fstab;
static int LineNo = 0;
static void error __P((int));
-static void fixfsfile __P((void));
static int fstabscan __P((void));
-static void
-fixfsfile()
-{
- static char buf[sizeof(_PATH_DEV) + MNAMELEN];
- struct stat sb;
- struct statfs sf;
-
- if (strcmp(_fs_fstab.fs_file, "/") != 0)
- return;
- if (statfs("/", &sf) != 0)
- return;
- if (sf.f_mntfromname[0] == '/')
- buf[0] = '\0';
- else
- strcpy(buf, _PATH_DEV);
- strcat(buf, sf.f_mntfromname);
- if (stat(buf, &sb) != 0 || !S_ISBLK(sb.st_mode))
- return;
- _fs_fstab.fs_spec = buf;
-}
-
static int
fstabscan()
{
@@ -96,7 +69,6 @@ fstabscan()
if (!strpbrk(p, " \t")) {
_fs_fstab.fs_spec = strsep(&p, ":\n");
_fs_fstab.fs_file = strsep(&p, ":\n");
- fixfsfile();
_fs_fstab.fs_type = strsep(&p, ":\n");
if (_fs_fstab.fs_type) {
if (!strcmp(_fs_fstab.fs_type, FSTAB_XX))
@@ -124,7 +96,6 @@ fstabscan()
while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0')
;
_fs_fstab.fs_file = cp;
- fixfsfile();
while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0')
;
_fs_fstab.fs_vfstype = cp;
diff --git a/lib/libc/gen/getloadavg.3 b/lib/libc/gen/getloadavg.3
index 8d8facf4b8b4..fa5b5715a5ff 100644
--- a/lib/libc/gen/getloadavg.3
+++ b/lib/libc/gen/getloadavg.3
@@ -38,7 +38,6 @@
.Nm getloadavg
.Nd get system load averages
.Sh SYNOPSIS
-.Fd #include <stdlib.h>
.Ft int
.Fn getloadavg "double loadavg[]" "int nelem"
.Sh DESCRIPTION
diff --git a/lib/libc/gen/getobjformat.3 b/lib/libc/gen/getobjformat.3
index ad7ff438b234..228bb5f44883 100644
--- a/lib/libc/gen/getobjformat.3
+++ b/lib/libc/gen/getobjformat.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: getobjformat.3,v 1.1 1998/09/09 01:21:24 jdp Exp $
+.\" $Id$
.\"
.Dd September 7, 1998
.Dt GETOBJFORMAT 3
@@ -103,22 +103,12 @@ and its null terminator,
returns -1. In that case, the contents of the buffer and argument
vector supplied by the caller are indeterminate.
.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMAT
-.It Ev OBJFORMAT
-If the environment variable
.Ev OBJFORMAT
-is set, it overrides the default object file format.
-.Ev OBJFORMAT takes precedence over
-.Pa /etc/objformat .
.Sh FILES
-.Bl -tag -width /etc/objformat -compact
-.It Pa /etc/objformat
-If present, specifies the object file format to use. Syntax is
-.Ql OBJFORMAT=xxx .
+.Pa /etc/objformat
.Sh SEE ALSO
.Xr objformat 1
.Sh HISTORY
The
.Fn getobjformat
-function first appeared in
-.Fx 3.0 .
+function first appeared in FreeBSD 3.0.
diff --git a/lib/libc/gen/getpwent.3 b/lib/libc/gen/getpwent.3
index 94fc4063f30b..8772a429e7e4 100644
--- a/lib/libc/gen/getpwent.3
+++ b/lib/libc/gen/getpwent.3
@@ -72,8 +72,8 @@ file
struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* encrypted password */
- uid_t pw_uid; /* user uid */
- gid_t pw_gid; /* user gid */
+ int pw_uid; /* user uid */
+ int pw_gid; /* user gid */
time_t pw_change; /* password change time */
char *pw_class; /* user access class */
char *pw_gecos; /* Honeywell login info */
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 2ee0e32aabc7..02ec190519fe 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -154,9 +154,7 @@ getpwnam(name)
bf[0] = _PW_KEYBYNAME;
len = strlen(name);
- if (len > UT_NAMESIZE)
- return(NULL);
- bcopy(name, bf + 1, len);
+ bcopy(name, bf + 1, MIN(len, UT_NAMESIZE));
key.data = (u_char *)bf;
key.size = len + 1;
rval = __hashpw(&key);
diff --git a/lib/libc/gen/getvfsbyname.c b/lib/libc/gen/getvfsbyname.c
index 7f8a9703710a..57d1db4e7744 100644
--- a/lib/libc/gen/getvfsbyname.c
+++ b/lib/libc/gen/getvfsbyname.c
@@ -36,13 +36,15 @@
static char sccsid[] = "@(#)kvm_getvfsbyname.c 8.1 (Berkeley) 4/3/95";
#endif
static const char rcsid[] =
- "$Id: getvfsbyname.c,v 1.3 1998/03/09 04:36:07 jb Exp $";
+ "$Id: getvfsbyname.c,v 1.2 1997/03/03 13:08:33 bde Exp $";
#endif /* not lint */
+#define _NEW_VFSCONF
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <errno.h>
+#include <kvm.h>
/*
* Given a filesystem name, determine if it is resident in the kernel,
diff --git a/lib/libc/gen/getvfsent.c b/lib/libc/gen/getvfsent.c
index 8aa147db76ab..469ef975c1e9 100644
--- a/lib/libc/gen/getvfsent.c
+++ b/lib/libc/gen/getvfsent.c
@@ -193,7 +193,6 @@ vfspath(const char *name)
int
vfsisloadable(const char *name)
{
-#if 0
int fd;
fd = open("/dev/lkm", O_RDWR, 0);
@@ -203,24 +202,16 @@ vfsisloadable(const char *name)
close(fd);
return !!vfspath(name);
-#else
- return 1;
-#endif
}
int
vfsload(const char *name)
{
- const char *path;
+ const char *path = vfspath(name);
char name_mod[sizeof("_mod") + strlen(name)];
pid_t pid;
int status;
- status = kldload(name);
- if (status != -1)
- return 0;
-
- path = vfspath(name);
if(!path) {
errno = ENOENT;
return -1;
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 55f4f3978bb0..ebd4234c9c2a 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -29,8 +29,6 @@
* 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$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -199,7 +197,18 @@ __aout_fdnlist(fd, list)
#endif
#ifdef _NLIST_DO_ELF
-static void elf_sym_to_nlist __P((struct nlist *, Elf_Sym *, Elf_Shdr *, int));
+
+#if ELF_TARG_CLASS == ELFCLASS32
+
+#define Elf(x) Elf32_##x
+#define ELF(x) ELF32_##x
+
+#else
+
+#define Elf(x) Elf64_##x
+#define ELF(x) ELF64_##x
+
+#endif
/*
* __elf_is_okay__ - Determine if ehdr really
@@ -210,13 +219,13 @@ static void elf_sym_to_nlist __P((struct nlist *, Elf_Sym *, Elf_Shdr *, int));
*/
int
__elf_is_okay__(ehdr)
- register Elf_Ehdr *ehdr;
+ register Elf(Ehdr) *ehdr;
{
register int retval = 0;
/*
* We need to check magic, class size, endianess,
* and version before we look at the rest of the
- * Elf_Ehdr structure. These few elements are
+ * Elf(Ehdr) structure. These few elements are
* represented in a machine independant fashion.
*/
if (IS_ELF(*ehdr) &&
@@ -238,19 +247,15 @@ __elf_fdnlist(fd, list)
register struct nlist *list;
{
register struct nlist *p;
+ register caddr_t strtab;
register Elf_Off symoff = 0, symstroff = 0;
register Elf_Word symsize = 0, symstrsize = 0;
- register Elf_Sword cc, i;
- int nent = -1;
- int errsave;
+ register Elf_Sword nent, cc, i;
Elf_Sym sbuf[1024];
Elf_Sym *s;
Elf_Ehdr ehdr;
- char *strtab = NULL;
Elf_Shdr *shdr = NULL;
- Elf_Shdr *sh;
Elf_Word shdr_size;
- void *base;
struct stat st;
/* Make sure obj is OK */
@@ -270,11 +275,10 @@ __elf_fdnlist(fd, list)
}
/* mmap section header table */
- base = mmap(NULL, (size_t)shdr_size, PROT_READ, 0, fd,
- (off_t)ehdr.e_shoff);
- if (base == MAP_FAILED)
+ shdr = (Elf_Shdr *)mmap(NULL, (size_t)shdr_size,
+ PROT_READ, 0, fd, (off_t) ehdr.e_shoff);
+ if (shdr == (Elf_Shdr *)-1)
return (-1);
- shdr = (Elf_Shdr *)base;
/*
* Find the symbol table entry and it's corresponding
@@ -292,10 +296,13 @@ __elf_fdnlist(fd, list)
}
}
+ /* Flush the section header table */
+ munmap((caddr_t)shdr, shdr_size);
+
/* Check for files too large to mmap. */
if (symstrsize > SIZE_T_MAX) {
errno = EFBIG;
- goto done;
+ return (-1);
}
/*
* Map string table into our address space. This gives us
@@ -303,11 +310,10 @@ __elf_fdnlist(fd, list)
* making the memory allocation permanent as with malloc/free
* (i.e., munmap will return it to the system).
*/
- base = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd,
- (off_t)symstroff);
- if (base == MAP_FAILED)
- goto done;
- strtab = (char *)base;
+ strtab = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd,
+ (off_t) symstroff);
+ if (strtab == (char *)-1)
+ return (-1);
/*
* clean out any left-over information for all valid entries.
@@ -329,6 +335,7 @@ __elf_fdnlist(fd, list)
}
/* Don't process any further if object is stripped. */
+ /* ELFism - dunno if stripped by looking at header */
if (symoff == 0)
goto done;
@@ -337,24 +344,43 @@ __elf_fdnlist(fd, list)
goto done;
}
- while (symsize > 0 && nent > 0) {
+ while (symsize > 0) {
cc = MIN(symsize, sizeof(sbuf));
if (read(fd, sbuf, cc) != cc)
break;
symsize -= cc;
- for (s = sbuf; cc > 0 && nent > 0; ++s, cc -= sizeof(*s)) {
- char *name;
- struct nlist *p;
+ for (s = sbuf; cc > 0; ++s, cc -= sizeof(*s)) {
+ register int soff = s->st_name;
- name = strtab + s->st_name;
- if (name[0] == '\0')
+ if (soff == 0)
continue;
for (p = list; !ISLAST(p); p++) {
if ((p->n_un.n_name[0] == '_' &&
- strcmp(name, p->n_un.n_name+1) == 0)
- || strcmp(name, p->n_un.n_name) == 0) {
- elf_sym_to_nlist(p, s, shdr,
- ehdr.e_shnum);
+ !strcmp(&strtab[soff], p->n_un.n_name+1))
+ || !strcmp(&strtab[soff], p->n_un.n_name)) {
+ p->n_value = s->st_value;
+
+ /* XXX - type conversion */
+ /* is pretty rude. */
+ switch(ELF(ST_TYPE)(s->st_info)) {
+ case STT_NOTYPE:
+ p->n_type = N_UNDF;
+ break;
+ case STT_OBJECT:
+ p->n_type = N_DATA;
+ break;
+ case STT_FUNC:
+ p->n_type = N_TEXT;
+ break;
+ case STT_FILE:
+ p->n_type = N_FN;
+ break;
+ }
+ if (ELF(ST_BIND)(s->st_info) ==
+ STB_LOCAL)
+ p->n_type = N_EXT;
+ p->n_desc = 0;
+ p->n_other = 0;
if (--nent <= 0)
break;
}
@@ -362,52 +388,8 @@ __elf_fdnlist(fd, list)
}
}
done:
- errsave = errno;
- if (strtab != NULL)
- munmap(strtab, symstrsize);
- if (shdr != NULL)
- munmap(shdr, shdr_size);
- errno = errsave;
- return (nent);
-}
+ munmap(strtab, symstrsize);
-/*
- * Convert an Elf_Sym into an nlist structure. This fills in only the
- * n_value and n_type members.
- */
-static void
-elf_sym_to_nlist(nl, s, shdr, shnum)
- struct nlist *nl;
- Elf_Sym *s;
- Elf_Shdr *shdr;
- int shnum;
-{
- nl->n_value = s->st_value;
-
- switch (s->st_shndx) {
- case SHN_UNDEF:
- case SHN_COMMON:
- nl->n_type = N_UNDF;
- break;
- case SHN_ABS:
- nl->n_type = ELF_ST_TYPE(s->st_info) == STT_FILE ?
- N_FN : N_ABS;
- break;
- default:
- if (s->st_shndx >= shnum)
- nl->n_type = N_UNDF;
- else {
- Elf_Shdr *sh = shdr + s->st_shndx;
-
- nl->n_type = sh->sh_type == SHT_PROGBITS ?
- (sh->sh_flags & SHF_WRITE ? N_DATA : N_TEXT) :
- (sh->sh_type == SHT_NOBITS ? N_BSS : N_UNDF);
- }
- break;
- }
-
- if (ELF_ST_BIND(s->st_info) == STB_GLOBAL ||
- ELF_ST_BIND(s->st_info) == STB_WEAK)
- nl->n_type |= N_EXT;
+ return (nent);
}
#endif /* _NLIST_DO_ELF */
diff --git a/lib/libc/gen/popen.3 b/lib/libc/gen/popen.3
index 600f5d085aad..c4278e5f3e38 100644
--- a/lib/libc/gen/popen.3
+++ b/lib/libc/gen/popen.3
@@ -53,19 +53,16 @@ function
a process by creating a bidirectional pipe
forking,
and invoking the shell.
-Any streams opened by previous
-.Fn popen
-calls in the parent process are closed in the new child process.
Historically,
-.Fn popen
+.Nm popen
was implemented with a unidirectional pipe;
hence many implementations of
-.Fn popen
+.Nm popen
only allow the
.Fa type
argument to specify reading or writing, not both.
Since
-.Fn popen
+.Nm popen
is now implemented using a bidirectional pipe, the
.Fa type
argument may request a bidirectional data flow.
diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3
index aa78732d55ae..773759c1d89c 100644
--- a/lib/libc/gen/psignal.3
+++ b/lib/libc/gen/psignal.3
@@ -57,9 +57,7 @@ If the argument
.Fa s
is
.Pf non- Dv NULL
-and does not point to the null character,
-.Fa s
-is written to the standard error file descriptor
+it is written to the standard error file descriptor
prior to the message string,
immediately followed by a colon and a space.
If the signal number is not recognized
diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c
index 96eab9d45d14..b7e7ab66761a 100644
--- a/lib/libc/gen/psignal.c
+++ b/lib/libc/gen/psignal.c
@@ -49,13 +49,15 @@ psignal(sig, s)
const char *s;
{
register const char *c;
+ register int n;
if (sig < NSIG)
c = sys_siglist[sig];
else
c = "Unknown signal";
- if (s != NULL && *s != '\0') {
- (void)write(STDERR_FILENO, s, strlen(s));
+ n = strlen(s);
+ if (n) {
+ (void)write(STDERR_FILENO, s, n);
(void)write(STDERR_FILENO, ": ", 2);
}
(void)write(STDERR_FILENO, c, strlen(c));
diff --git a/lib/libc/gen/setmode.3 b/lib/libc/gen/setmode.3
index bc38fd3e1193..4c85b30e2a38 100644
--- a/lib/libc/gen/setmode.3
+++ b/lib/libc/gen/setmode.3
@@ -81,19 +81,10 @@ is to modify future file modes correctly.
.Pp
If the mode passed to
.Fn setmode
-is invalid or if memory cannot be allocated for the return value,
+is invalid,
.Fn setmode
returns
.Dv NULL .
-.Pp
-The value returned from
-.Fn setmode
-is obtained from
-.Fn malloc
-and should be returned to the system with
-.Fn free
-when the program is done with it, generally after a call to
-.Fn getmode .
.Sh ERRORS
The
.Fn setmode
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index 02a185ca848a..30e8e83eb879 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -667,10 +667,9 @@ If the amount of free and cache memory falls below this value, the
pageout daemon will enter "memory conserving mode" to avoid deadlock.
.El
.Sh RETURN VALUES
+If the call to
.Fn sysctl
-and
-.Fn sysctlbyname
-return 0 when successful.
+is successful, the number of bytes copied out is returned.
Otherwise \-1 is returned and
.Va errno
is set appropriately.
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index 19709d5932e9..cb7448af3243 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -66,20 +66,16 @@ sysctl(name, namelen, oldp, oldlenp, newp, newlen)
switch (name[1]) {
case USER_CS_PATH:
- if (oldp && *oldlenp < sizeof(_PATH_STDPATH)) {
- errno = ENOMEM;
- return -1;
- }
+ if (oldp && *oldlenp < sizeof(_PATH_STDPATH))
+ return (ENOMEM);
*oldlenp = sizeof(_PATH_STDPATH);
if (oldp != NULL)
memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH));
return (0);
}
- if (oldp && *oldlenp < sizeof(int)) {
- errno = ENOMEM;
- return (-1);
- }
+ if (oldp && *oldlenp < sizeof(int))
+ return (ENOMEM);
*oldlenp = sizeof(int);
if (oldp == NULL)
return (0);
diff --git a/lib/libc/gen/tzset.3 b/lib/libc/gen/tzset.3
index 5d83f335f525..3c5b27650bae 100644
--- a/lib/libc/gen/tzset.3
+++ b/lib/libc/gen/tzset.3
@@ -137,7 +137,7 @@ is required; if
is missing, then summer time does not apply in this locale.
Upper and lowercase letters are explicitly allowed. Any characters
except a leading colon
-.Pq Ql \: ,
+.Pq Ql : ,
digits, comma
.Pq Ql \&, ,
minus
@@ -284,7 +284,7 @@ values in
.El
.Pp
For compatibility with System V Release 3.1, a semicolon
-.Pq Ql \;
+.Pq Ql ;
may be used to separate the
.Em rule
from the rest of the specification.
diff --git a/lib/libc/i386/sys/sigsuspend.S b/lib/libc/i386/sys/sigsuspend.S
index f85b2e1929f1..660eabf85411 100644
--- a/lib/libc/i386/sys/sigsuspend.S
+++ b/lib/libc/i386/sys/sigsuspend.S
@@ -33,12 +33,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sigsuspend.S,v 1.6 1997/02/22 14:59:40 peter Exp $
+ * $Id$
*/
#if defined(SYSLIBC_RCS) && !defined(lint)
.text
- .asciz "$Id: sigsuspend.S,v 1.6 1997/02/22 14:59:40 peter Exp $"
+ .asciz "$Id$"
#endif /* SYSLIBC_RCS and not lint */
#include "SYS.h"
@@ -50,9 +50,7 @@ err:
#ifdef _THREAD_SAFE
ENTRY(_thread_sys_sigsuspend)
#else
-ENTRY(_sigsuspend)
- .weak CNAME(sigsuspend) ;
- .set CNAME(sigsuspend), CNAME(_sigsuspend) ;
+ENTRY(sigsuspend)
#endif
movl 4(%esp),%eax # fetch mask arg
movl (%eax),%eax # indirect to mask arg
diff --git a/lib/libc/locale/ansi.c b/lib/libc/locale/ansi.c
index c0871fea6dac..a5a3362d8adf 100644
--- a/lib/libc/locale/ansi.c
+++ b/lib/libc/locale/ansi.c
@@ -127,24 +127,22 @@ wcstombs(s, pwcs, n)
size_t n;
{
char *e;
- int cnt, nb;
+ int cnt = 0;
- if (!pwcs || !s || n > INT_MAX)
+ if (!pwcs || !s)
return (-1);
- nb = n;
- cnt = 0;
- while (nb > 0) {
+ while (n > 0) {
if (*pwcs == 0) {
*s = 0;
break;
}
- if (!sputrune(*pwcs++, s, nb, &e))
+ if (!sputrune(*pwcs++, s, n, &e))
return (-1); /* encoding error */
if (!e) /* too long */
return (cnt);
cnt += e - s;
- nb -= e - s;
+ n -= e - s;
s = e;
}
return (cnt);
diff --git a/lib/libc/quad/moddi3.c b/lib/libc/quad/moddi3.c
index fa76ea3838e3..f31c6e84f2ba 100644
--- a/lib/libc/quad/moddi3.c
+++ b/lib/libc/quad/moddi3.c
@@ -59,7 +59,7 @@ __moddi3(a, b)
else
ua = a, neg = 0;
if (b < 0)
- ub = -(u_quad_t)b;
+ ub = -(u_quad_t)b, neg ^= 1;
else
ub = b;
(void)__qdivrem(ua, ub, &ur);
diff --git a/lib/libc/stdio/fclose.3 b/lib/libc/stdio/fclose.3
index 81f260fc3498..61822e5d7604 100644
--- a/lib/libc/stdio/fclose.3
+++ b/lib/libc/stdio/fclose.3
@@ -63,7 +63,7 @@ is returned and the global variable
.Va errno
is set to indicate the error.
In either case no further access to the stream is possible.
-.Sh ERRORS
+.Pp
The
.Fn fclose
function
@@ -75,12 +75,10 @@ or
.Xr fflush 3 .
.Sh NOTES
.Fn fclose
-does not handle NULL arguments; they will result in a segmentation
-violation.
-This is intentional - it makes it easier to make sure programs written
-under FreeBSD are bug free.
-This behaviour is an implementation detail, and programs should not
-rely upon it.
+does not handle NULL arguments; they will result in a segment
+violation. This is intentional - it makes it easier to make sure
+programs written under FreeBSD are bug free. This behaviour is an
+implementation detail, and programs should not rely upon it.
.Sh SEE ALSO
.Xr close 2 ,
.Xr fflush 3 ,
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index c2da533af8a0..ca3fa5bdac3d 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: mktemp.c,v 1.11 1998/10/20 12:36:36 peter Exp $";
+ "$Id: mktemp.c,v 1.9 1998/03/03 14:38:36 bde Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c
index bb618247e96f..91a7dee8b262 100644
--- a/lib/libc/stdio/perror.c
+++ b/lib/libc/stdio/perror.c
@@ -50,7 +50,7 @@ perror(s)
struct iovec iov[4];
v = iov;
- if (s != NULL && *s != '\0') {
+ if (s != NULL) {
v->iov_base = (char *)s;
v->iov_len = strlen(s);
v++;
diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c
index 083a9642502e..a47e3007290e 100644
--- a/lib/libc/stdlib/merge.c
+++ b/lib/libc/stdlib/merge.c
@@ -111,9 +111,6 @@ mergesort(base, nmemb, size, cmp)
return (-1);
}
- if (nmemb == 0)
- return (0);
-
/*
* XXX
* Stupid subtraction for the Cray.
@@ -150,7 +147,7 @@ mergesort(base, nmemb, size, cmp)
sense = 0;
}
if (!big) { /* here i = 0 */
- while ((b += size) < t && cmp(q, b) >sense)
+LINEAR: while ((b += size) < t && cmp(q, b) >sense)
if (++i == 6) {
big = 1;
goto EXPONENTIAL;
@@ -171,7 +168,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1)
goto FASTCASE;
} else
b = p;
- while (t > b+size) {
+SLOWCASE: while (t > b+size) {
i = (((t - b) / size) >> 1) * size;
if ((*cmp)(q, p = b + i) <= sense)
t = p;
diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index aa2609c7efb0..4f449c752917 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -162,9 +162,7 @@ is set to indicate the error.
.Sh ERRORS
The
.Fn heapsort
-and
-.Fn mergesort
-functions succeed unless:
+function succeeds unless:
.Bl -tag -width Er
.It Bq Er EINVAL
The
diff --git a/lib/libc/stdtime/asctime.c b/lib/libc/stdtime/asctime.c
index 832f18592ff3..b9da143029eb 100644
--- a/lib/libc/stdtime/asctime.c
+++ b/lib/libc/stdtime/asctime.c
@@ -14,6 +14,10 @@ static char elsieid[] = "@(#)asctime.c 7.7";
#include "private.h"
#include "tzfile.h"
+#ifndef _THREAD_SAFE
+static char *asctime_r __P((const struct tm *, char *));
+#endif
+
/*
** A la X3J11, with core dump avoidance.
*/
@@ -28,6 +32,9 @@ const struct tm * timeptr;
return(asctime_r(timeptr, result));
}
+#ifndef _THREAD_SAFE
+static
+#endif
char *
asctime_r(timeptr, result)
const struct tm * timeptr;
diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3
index 2b8ca3e45adc..b14a92c47bf9 100644
--- a/lib/libc/stdtime/ctime.3
+++ b/lib/libc/stdtime/ctime.3
@@ -31,22 +31,17 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93
-.\" $Id$
+.\" @(#)ctime.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd January 2, 1999
+.Dd June 4, 1993
.Dt CTIME 3
.Os BSD 4.3
.Sh NAME
.Nm asctime ,
-.Nm asctime_r ,
.Nm ctime ,
-.Nm ctime_r ,
.Nm difftime ,
.Nm gmtime ,
-.Nm gmtime_r ,
.Nm localtime ,
-.Nm localtime_r ,
.Nm mktime ,
.Nm timegm
.Nd transform binary date and time values
@@ -67,14 +62,6 @@
.Fn mktime "struct tm *tm"
.Ft time_t
.Fn timegm "struct tm *tm"
-.Ft char *
-.Fn ctime_r "const time_t *clock" "char *buf"
-.Ft struct tm *
-.Fn localtime_r "const time_t *clock" "struct tm *result"
-.Ft struct tm *
-.Fn gmtime_r "const time_t *clock" "struct tm *result"
-.Ft char *
-.Fn asctime_r "const struct tm *tm" "char *buf"
.Sh DESCRIPTION
The functions
.Fn ctime ,
@@ -138,22 +125,6 @@ Thu Nov 24 18:22:48 1986\en\e0
.Pp
All the fields have constant width.
.Pp
-.Fn ctime_r
-provides the same functionality as
-.Fn ctime
-except the caller must provide the output buffer
-.Fa buf
-to store the result, which must be at least 26 characters long.
-.Fn localtime_r
-and
-.Fn gmtime_r
-provide the same functionality as
-.Fn localtime
-and
-.Fn gmtime
-respectively, except the caller must provide the output buffer
-.Fa result .
-.Pp
The
.Fn asctime
function
@@ -164,30 +135,14 @@ pointed at by
to the form
shown in the example above.
.Pp
-.Fn asctime_r
-provides the same functionality as
-.Fn asctime
-except the caller provide the output buffer
-.Fa buf
-to store the result, which must be at least 26 characters long.
-.Pp
-The functions
+The function
.Fn mktime
-and
-.Fn timegm
-converts the broken-down time in the structure
+converts the broken-down time, expressed as local time, in the structure
pointed to by tm into a time value with the same encoding as that of the
values returned by the
.Xr time 3
-function (that is, seconds from the Epoch,
-.Tn UTC ) .
-.Fn mktime
-interprets the input structure according to the current timezone setting
-(see
-.Xr tzset 3 ) .
-.Fn timegm
-interprets the input structure as representing Universal Coordinated Time
-.Pq Tn UTC .
+function, that is, seconds from the Epoch,
+.Tn UTC .
.Pp
The original values of the
.Fa tm_wday
@@ -206,13 +161,7 @@ A negative value for
causes the
.Fn mktime
function to attempt to divine whether summer time is in effect for the
-specified time.
-The
-.Fa tm_isdst
-and
-.Fa tm_gmtoff
-members are forced to zero by
-.Fn timegm . )
+specified time.)
.Pp
On successful completion, the values of the
.Fa tm_wday
@@ -231,6 +180,15 @@ are determined.
returns the specified calendar time; if the calendar time cannot be
represented, it returns \-1;
.Pp
+The function
+.Fn timegm
+is
+.Fn mktime
+analog, but assume that broke-down time expressed as UTC (not local) time.
+This function also set
+.Fa tm_isdst
+field to 0.
+.Pp
The
.Fn difftime
function
@@ -276,33 +234,6 @@ values indicating east of the Prime Meridian.
.Xr time 3 ,
.Xr tzset 3 ,
.Xr tzfile 5
-.Sh STANDARDS
-The
-.Fn asctime ,
-.Fn ctime ,
-.Fn difftime ,
-.Fn gmtime ,
-.Fn localtime ,
-and
-.Fn mktime
-functions conform to
-.St -isoC ,
-and conform to
-.St -p1003.1
-provided the selected local timezone does not contain a leap-second table
-(see
-.Xr zic 8 ) .
-.Pp
-The
-.Fn asctime_r ,
-.Fn ctime_r ,
-.Fn gmtime_r ,
-and
-.Fn localtime_r
-functions are expected to conform to
-.St -iso9945-1
-(again provided the selected local timezone does not contain a leap-second
-table).
.Sh HISTORY
This manual page is derived from
the time package contributed to Berkeley by
@@ -310,23 +241,13 @@ Arthur Olsen and which appeared in
.Bx 4.3 .
.Sh BUGS
Except for
-.Fn difftime ,
+.Fn difftime
+and
.Fn mktime ,
-and the
-.Fn \&_r
-variants of the other functions,
these functions leaves their result in an internal static object and return
a pointer to that object. Subsequent calls to these
function will modify the same object.
.Pp
-The C Standard provides no mechanism for a program to modify its current
-local timezone setting, and the
-.Tn POSIX Ns No \&-standard
-method is not reentrant. (However, thread-safe implementations are provided
-in the
-.Tn POSIX
-threaded environment.)
-.Pp
The
.Fa tm_zone
field of a returned tm structure points to a static array of characters,
@@ -341,3 +262,7 @@ Use of the external variable
is discouraged; the
.Fa tm_zone
entry in the tm structure is preferred.
+.Pp
+Avoid using out-of-range values with
+.Fn mktime
+when setting up lunch with promptness sticklers in Riyadh.
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index 9e130bd560e2..ad227cf32029 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -1082,21 +1082,19 @@ struct tm * const tmp;
#endif /* defined TM_ZONE */
}
+#ifdef _THREAD_SAFE
struct tm *
localtime_r(timep, p_tm)
const time_t * const timep;
struct tm *p_tm;
{
-#ifdef _THREAD_SAFE
pthread_mutex_lock(&lcl_mutex);
-#endif
tzset();
localsub(timep, 0L, p_tm);
-#ifdef _THREAD_SAFE
pthread_mutex_unlock(&lcl_mutex);
-#endif
return(p_tm);
}
+#endif
struct tm *
localtime(timep)
@@ -1216,12 +1214,14 @@ const time_t * const timep;
#endif
}
+#ifdef _THREAD_SAFE
struct tm *
gmtime_r(const time_t * timep, struct tm * tm)
{
gmtsub(timep, 0L, tm);
return(tm);
}
+#endif
#ifdef STD_INSPIRED
@@ -1350,6 +1350,7 @@ const time_t * const timep;
return asctime(localtime(timep));
}
+#ifdef _THREAD_SAFE
char *
ctime_r(timep, buf)
const time_t * const timep;
@@ -1358,6 +1359,7 @@ char *buf;
struct tm tm;
return asctime_r(localtime_r(timep, &tm), buf);
}
+#endif
/*
** Adapted from code provided by Robert Elz, who writes:
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index 42c8c39944c1..587da37b5855 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -1,5 +1,5 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
-# $Id: Makefile.inc,v 1.14 1998/02/20 08:23:55 jb Exp $
+# $Id: Makefile.inc,v 1.13 1997/10/21 08:41:15 bde Exp $
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/string ${.CURDIR}/../libc/string
@@ -27,5 +27,4 @@ MLINKS+=strcat.3 strncat.3
MLINKS+=strcmp.3 strncmp.3
MLINKS+=strcpy.3 strncpy.3
MLINKS+=strerror.3 perror.3 strerror.3 sys_errlist.3 strerror.3 sys_nerr.3
-MLINKS+=strtok.3 strtok_r.3
.endif
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3
index ecb827841a86..67c22db97f80 100644
--- a/lib/libc/string/strerror.3
+++ b/lib/libc/string/strerror.3
@@ -80,13 +80,16 @@ standard error file descriptor.
If the argument
.Fa string
is
-.Pf non- Dv NULL
-and does not point to the null character,
-this string is prepended to the message
+.Pf non- Dv NULL ,
+it is prepended to the message
string and separated from it by
a colon and space
-.Pq Ql \&:\ \& ;
-otherwise, only the error message string is printed.
+.Pq Ql \&:\ \& .
+If
+.Fa string
+is
+.Dv NULL ,
+only the error message string is printed.
.Pp
If
.Fa errnum
diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3
index 92d32ce0f59f..56db2b03c7e3 100644
--- a/lib/libc/string/strtok.3
+++ b/lib/libc/string/strtok.3
@@ -1,8 +1,3 @@
-.\" Copyright (c) 1998 Softweyr LLC. All rights reserved.
-.\"
-.\" strtok_r, from Berkeley strtok
-.\" Oct 13, 1998 by Wes Peters <wes@softweyr.com>
-.\"
.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -13,54 +8,43 @@
.\" 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
-.\" notices, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above
-.\" copyright notices, 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 Softweyr LLC, the
-.\" University of California, Berkeley, and its contributors.
-.\"
-.\" 4. Neither the name of Softweyr LLC, the University nor the names
-.\" of its contributors may be used to endorse or promote products
-.\" derived from this software without specific prior written
-.\" permission.
+.\" 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 University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University 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 SOFTWEYR LLC, THE REGENTS 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 SOFTWEYR LLC, THE REGENTS, 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
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
.\"
.\" @(#)strtok.3 8.2 (Berkeley) 2/3/94
.\"
-.Dd November 27, 1998
+.Dd February 3, 1994
.Dt STRTOK 3
-.Os FreeBSD 3.0
+.Os BSD 3
.Sh NAME
-.Nm strtok, strtok_r
+.Nm strtok
.Nd string tokens
.Sh SYNOPSIS
.Fd #include <string.h>
.Ft char *
.Fn strtok "char *str" "const char *sep"
-.Ft char *
-.Fn strtok_r "char *str" "const char *sep" "char **last"
.Sh DESCRIPTION
.Bf -symbolic
This interface is obsoleted by strsep(3).
@@ -85,51 +69,13 @@ The separator string,
must be supplied each time, and may change between calls.
.Pp
The
-.Fn strtok_r
-function is a reentrant version of
-.Fn strtok .
-The context pointer
-.Fa last
-must be provided on each call.
-.Fn strtok_r
-may also be used to nest two parsing loops within one another, as
-long as separate context pointers are used.
-.Pp
-The
.Fn strtok
-and
-.Fn strtok_r
-functions
-return a pointer to the beginning of each subsequent token in the string,
+function
+returns a pointer to the beginning of each subsequent token in the string,
after replacing the token itself with a
.Dv NUL
character.
When no more tokens remain, a null pointer is returned.
-.Sh EXAMPLE
-The following uses
-.Fn strtok_r ()
-to parse two strings using separate contexts:
-.Bd -literal
-char test[80], blah[80];
-char *sep = "\\/:;=-";
-char *word, *phrase, *brkt, *brkb;
-
-strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function.");
-
-for (word = strtok_r(test, sep, &brkt);
- word;
- word = strtok_r(NULL, sep, &brkt))
-{
- strcpy(blah, "blah:blat:blab:blag");
-
- for (phrase = strtok_r(blah, sep, &brkb);
- phrase;
- phrase = strtok_r(NULL, sep, &brkb))
- {
- printf("So far we're at %s:%s\n", word, phrase);
- }
-}
-.Ed
.Sh SEE ALSO
.Xr index 3 ,
.Xr memchr 3 ,
@@ -148,6 +94,8 @@ function
conforms to
.St -ansiC .
.Sh BUGS
+There is no way to get tokens from multiple strings simultaneously.
+.Pp
The System V
.Fn strtok ,
if handed a string containing only delimiter characters,
@@ -160,8 +108,3 @@ value.
Since this implementation always alters the next starting point,
such a sequence of calls would always return
.Dv NULL .
-.Sh AUTHOR
-Wes Peters, Softweyr LLC:
-.Xr <wes@softweyr.com>
-.br
-Based on the FreeBSD 3.0 implementation.
diff --git a/lib/libc/string/strtok.c b/lib/libc/string/strtok.c
index 1140bfc73eba..9151cf257aab 100644
--- a/lib/libc/string/strtok.c
+++ b/lib/libc/string/strtok.c
@@ -1,163 +1,90 @@
/*
- * Copyright (c) 1998 Softweyr LLC. All rights reserved.
- *
- * strtok_r, from Berkeley strtok
- * Oct 13, 1998 by Wes Peters <wes@softweyr.com>
- *
* Copyright (c) 1988, 1993
* The Regents of the University of California. 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
- * notices, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
- * notices, this list of conditions and the following disclaimer in the
+ * 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 Softweyr LLC, the
- * University of California, Berkeley, and its contributors.
- *
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University 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 SOFTWEYR LLC, THE REGENTS 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 SOFTWEYR LLC, THE
- * REGENTS, 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 SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtok.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
#include <stddef.h>
#include <string.h>
char *
-strtok_r(char *s, const char *delim, char **last)
+strtok(s, delim)
+ register char *s;
+ register const char *delim;
{
- char *spanp;
- int c, sc;
- char *tok;
+ register char *spanp;
+ register int c, sc;
+ char *tok;
+ static char *last;
- if (s == NULL && (s = *last) == NULL)
- {
- return NULL;
- }
-
- /*
- * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
- */
-cont:
- c = *s++;
- for (spanp = (char *)delim; (sc = *spanp++) != 0; )
- {
- if (c == sc)
- {
- goto cont;
- }
- }
- if (c == 0) /* no non-delimiter characters */
- {
- *last = NULL;
- return NULL;
- }
- tok = s - 1;
+ if (s == NULL && (s = last) == NULL)
+ return (NULL);
- /*
- * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
- * Note that delim must have one NUL; we stop if we see that, too.
- */
- for (;;)
- {
+ /*
+ * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
+ */
+cont:
c = *s++;
- spanp = (char *)delim;
- do
- {
- if ((sc = *spanp++) == c)
- {
- if (c == 0)
- {
- s = NULL;
- }
- else
- {
- char *w = s - 1;
- *w = '\0';
- }
- *last = s;
- return tok;
- }
+ for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
+ if (c == sc)
+ goto cont;
}
- while (sc != 0);
- }
- /* NOTREACHED */
-}
-
-
-char *
-strtok(char *s, const char *delim)
-{
- static char *last;
-
- return strtok_r(s, delim, &last);
-}
-
-
-#if defined(DEBUG_STRTOK)
-
-/*
- * Test the tokenizer.
- */
-int
-main()
-{
- char test[80], blah[80];
- char *sep = "\\/:;=-";
- char *word, *phrase, *brkt, *brkb;
-
- printf("String tokenizer test:\n");
- strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function.");
-
- for (word = strtok(test, sep);
- word;
- word = strtok(NULL, sep))
- {
- printf("Next word is \"%s\".\n", word);
- }
-
- phrase = "foo";
-
- strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function.");
-
- for (word = strtok_r(test, sep, &brkt);
- word;
- word = strtok_r(NULL, sep, &brkt))
- {
- strcpy(blah, "blah:blat:blab:blag");
-
- for (phrase = strtok_r(blah, sep, &brkb);
- phrase;
- phrase = strtok_r(NULL, sep, &brkb))
- {
- printf("So far we're at %s:%s\n", word, phrase);
+ if (c == 0) { /* no non-delimiter characters */
+ last = NULL;
+ return (NULL);
}
- }
-
- return 0;
+ tok = s - 1;
+
+ /*
+ * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+ * Note that delim must have one NUL; we stop if we see that, too.
+ */
+ for (;;) {
+ c = *s++;
+ spanp = (char *)delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == 0)
+ s = NULL;
+ else
+ s[-1] = 0;
+ last = s;
+ return (tok);
+ }
+ } while (sc != 0);
+ }
+ /* NOTREACHED */
}
-
-#endif /* DEBUG_STRTOK */
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 517c4ba5f292..6882621dd5a9 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,5 +1,5 @@
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
-# $Id: Makefile.inc,v 1.56 1998/11/05 14:43:29 dg Exp $
+# $Id: Makefile.inc,v 1.54 1998/07/28 03:33:25 jlemon Exp $
# sys sources
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys
@@ -73,7 +73,7 @@ ${SPSEUDOR}:
> ${.TARGET}
.if ${LIB} == "c"
-MAN2+= _exit.2 accept.2 access.2 acct.2 adjtime.2 aio_read.2 \
+MAN2+= _exit.2 accept.2 access.2 acct.2 adjtime.2 \
bind.2 brk.2 chdir.2 chflags.2 \
chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \
connect.2 dup.2 execve.2 \
@@ -87,7 +87,7 @@ MAN2+= _exit.2 accept.2 access.2 acct.2 adjtime.2 aio_read.2 \
mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \
nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 ptrace.2 quotactl.2 \
read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
- rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 sendfile.2 \
+ rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 \
setgroups.2 setpgid.2 setregid.2 setreuid.2 setsid.2 setuid.2 \
shmat.2 shmctl.2 shmget.2 shutdown.2 \
sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigreturn.2 \
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index 041ea5a774ae..8a14cc6aa2e5 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)accept.2 8.2 (Berkeley) 12/11/93
-.\" $Id: accept.2,v 1.5 1998/01/11 17:07:20 alex Exp $
+.\" $Id$
.\"
.Dd December 11, 1993
.Dt ACCEPT 2
@@ -171,9 +171,9 @@ The per-process descriptor table is full.
The system file table is full.
.It Bq Er ENOTSOCK
The descriptor references a file, not a socket.
-.It Bq Er EINVAL
-.Xr listen 2
-has not been called on the socket descriptor.
+.It Bq Er EOPNOTSUPP
+The referenced socket is not of type
+.Dv SOCK_STREAM .
.It Bq Er EFAULT
The
.Fa addr
diff --git a/lib/libc/sys/aio_read.2 b/lib/libc/sys/aio_read.2
deleted file mode 100644
index 16dab679519a..000000000000
--- a/lib/libc/sys/aio_read.2
+++ /dev/null
@@ -1,189 +0,0 @@
-.\" Copyright (c) 1998 Terry Lambert
-.\" 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.
-.\"
-.\" $Id$
-.\"
-.Dd November 17, 1998
-.Dt AIO_READ 2
-.Os
-.Sh NAME
-.Nm aio_read
-.Nd asynchronus read from a file (REALTIME)
-.Sh SYNOPSIS
-.Fd #include <aio.h>
-.Ft int
-.Fn aio_read "struct aiocb *iocb"
-.Sh DESCRIPTION
-The
-.Fn aio_read
-function allows the calling process to read
-.Ar iocb->aio_nbytes
-from the descriptor
-.Ar iocb->aio_fildes
-beginning at the offset
-.Ar iocb->aio_offset
-into the buffer pointed to by
-.Ar iocb->aio_buf .
-The call returns immediately after the read request has
-been enqueued to the descriptor; the read may or may not have
-completed at the time the call returns.
-.Pp
-If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it,
-then the enqueued operation is submitted at a priority equal to that
-of the calling process minus
-.Ar iocb->aio_reqprio .
-.Pp
-The
-.Ar iocb->aio_lio_opcode
-is ignored by the
-.Fn aio_read
-call.
-.Pp
-The
-.Ar iocb
-pointer may be subsequently used as an argument to
-.Fn aio_return
-and
-.Fn aio_error
-in order to determine return or error status for the enqueued operation
-while it is in progress.
-.Pp
-If the request could not be enqueued (generally due to invalid arguments),
-then the call returns without having enqueued the request.
-.Pp
-If the request is successfully enqueued, the value of
-.Ar iocb->aio_offset
-can be modified during the request as context, so this value must
-not be referenced after the request is enqueued.
-.Sh RESTRICTIONS
-The Asynchronous I/O Control Block structure pointed to by
-.Ar iocb
-and the buffer that the
-.Ar iocb->aio_buf
-member of that structure references must remain valid until the
-operation has completed. For this reason, use of auto (stack) variables
-for these objects is discouraged.
-.Pp
-Modifications of the Asynchronous I/O Control Block structure or the
-buffer contents after the request has been enqueued, but before the
-request has completed, are not allowed.
-.Pp
-If the file offset in
-.Ar iocb->aio_offset
-is past the offset maximum for
-.Ar iocb->aio_fildes ,
-no I/O will occur.
-.Sh RETURN VALUES
-.Rv -std aio_read
-.Sh STANDARDS
-The
-.Fn aio_read
-call conforms to the
-.St -p1003.2
-standard.
-.Sh DIAGNOSTICS
-None.
-.Sh ERRORS
-The
-.Fn aio_read
-function will fail if:
-.Bl -tag -width Er
-.It Bq Er EAGAIN
-The request was not queued because of system resource limitations.
-.It Bq Er ENOSYS
-The
-.Fn aio_read
-call is not supported.
-.El
-.Pp
-The following conditions may be synchronously detected when the
-.Fn aio_read
-call is made, or asynchronously, at any time thereafter. If they
-are detected at call time,
-.Fn aio_read
-returns -1 and sets
-.Ar errno
-appropriately; otherwise the
-.Fn aio_return
-function must be called, and will return -1, and
-Fn aio_error
-must be called to determine the actual calue that would have been
-returned in
-.Ar errno .
-.Pp
-.Bl -tag -width Er
-.It Bq Er EBADF
-.Ar iocb->aio_fildes
-is invalid.
-.It Bq Er EINVAL
-The offset
-.Ar iocb->aio_offset
-is not valid, the priority specified by
-.Ar iocb->aio_reqprio
-is not a valid priority, or the number of bytes specified by
-.Ar iocb->aio_nbytes
-is not valid.
-.It Bq Er EOVERFLOW
-The file is a regular file,
-.Ar iocb->aio_nbytes
-is greater than zero, the starting offset in
-.Ar iocb->aio_offset
-is before the end of the file, but is at or beyond the
-.Ar iocb->aio_fildes
-offset maximum.
-.El
-.Pp
-If the request is successfully enqueued, but subsequently cancelled
-or an error occurs, the value returned by the
-.Fn aio_return
-function is per the
-.Xr read 2
-call, and the value returned by the
-.Fn aio_error
-function is either one of the error returns from the
-.Xr read 2
-call, or one of:
-.Bl -tag -width Er
-.It Bq Er EBADF
-.Ar iocb->aio_fildes
-is invalid for reading.
-.It Bq Er ECANCELED
-The request was explicitly cancelled via a call to
-.Fn aio_cancel .
-.It Bq Er EINVAL
-The offset
-.Ar iocb->aio_offset
-would be invalid.
-.El
-.Sh HISTORY
-The
-.Nm
-Function first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Terry Lambert Aq terry@whistle.com .
-.Sh BUGS
-The value of iocb->aio_offset is ignored.
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index 51f0ef519007..fdf1941d3cb1 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -483,13 +483,6 @@ or
.Dv F_SETLKW ,
and satisfying the lock or unlock request would result in the
number of locked regions in the system exceeding a system-imposed limit.
-.It Bq Er EPERM
-.Fa Cmd
-is
-.Dv F_SETOWN
-and
-the process ID or process group given as an argument is in a
-different session than the caller.
.It Bq Er ESRCH
.Fa Cmd
is
diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2
index 329b6502b3a7..abc680e7b9b3 100644
--- a/lib/libc/sys/getdirentries.2
+++ b/lib/libc/sys/getdirentries.2
@@ -69,7 +69,7 @@ structures each containing the following entries:
u_int32_t d_fileno;
u_int16_t d_reclen;
u_int8_t d_type;
-u_int8_t d_namlen;
+u_int8_t d_namelen;
char d_name[MAXNAMELEN + 1]; /* see below */
.Ed
.Pp
diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2
index 9c5102655c5a..d9e1b8351f0a 100644
--- a/lib/libc/sys/rename.2
+++ b/lib/libc/sys/rename.2
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rename.2 8.1 (Berkeley) 6/4/93
-.\" $Id: rename.2,v 1.6 1997/02/22 15:04:16 peter Exp $
+.\" $Id$
.\"
.Dd June 4, 1993
.Dt RENAME 2
@@ -69,32 +69,32 @@ If the final component of
is a symbolic link,
the symbolic link is renamed,
not the file or directory to which it points.
-.\".Sh CAVEAT
-.\"The system can deadlock if a loop in the file system graph is present.
-.\"This loop takes the form of an entry in directory
-.\".Ql Pa a ,
-.\"say
-.\".Ql Pa a/foo ,
-.\"being a hard link to directory
-.\".Ql Pa b ,
-.\"and an entry in
-.\"directory
-.\".Ql Pa b ,
-.\"say
-.\".Ql Pa b/bar ,
-.\"being a hard link
-.\"to directory
-.\".Ql Pa a .
-.\"When such a loop exists and two separate processes attempt to
-.\"perform
-.\".Ql rename a/foo b/bar
-.\"and
-.\".Ql rename b/bar a/foo ,
-.\"respectively,
-.\"the system may deadlock attempting to lock
-.\"both directories for modification.
-.\"Hard links to directories should be
-.\"replaced by symbolic links by the system administrator.
+.Sh CAVEAT
+The system can deadlock if a loop in the file system graph is present.
+This loop takes the form of an entry in directory
+.Ql Pa a ,
+say
+.Ql Pa a/foo ,
+being a hard link to directory
+.Ql Pa b ,
+and an entry in
+directory
+.Ql Pa b ,
+say
+.Ql Pa b/bar ,
+being a hard link
+to directory
+.Ql Pa a .
+When such a loop exists and two separate processes attempt to
+perform
+.Ql rename a/foo b/bar
+and
+.Ql rename b/bar a/foo ,
+respectively,
+the system may deadlock attempting to lock
+both directories for modification.
+Hard links to directories should be
+replaced by symbolic links by the system administrator.
.Sh RETURN VALUES
A 0 value is returned if the operation succeeds, otherwise
.Fn rename
diff --git a/lib/libc/sys/revoke.2 b/lib/libc/sys/revoke.2
index 8787597f8206..b64c9dc5fc88 100644
--- a/lib/libc/sys/revoke.2
+++ b/lib/libc/sys/revoke.2
@@ -65,8 +65,10 @@ is called as if all open references to the file had been closed.
Access to a file may be revoked only by its owner or the super user.
The
.Fn revoke
-function is normally used to prepare a terminal device for a new
-login session, preventing any access by a previous user of the terminal.
+function is currently supported only for block and character special
+device files.
+It is normally used to prepare a terminal device for a new login session,
+preventing any access by a previous user of the terminal.
.Sh RETURN VALUES
A 0 value indicated that the call succeeded. A \-1 return value
indicates an error occurred and
@@ -90,9 +92,8 @@ Too many symbolic links were encountered in translating the pathname.
.Fa Path
points outside the process's allocated address space.
.It Bq Er EINVAL
-The named file does not support the
-.Fn revoke
-operation.
+The named file is neither a character special or block
+special file.
.It Bq Er EPERM
The caller is neither the owner of the file nor the super user.
.El
diff --git a/lib/libc/sys/sendfile.2 b/lib/libc/sys/sendfile.2
deleted file mode 100644
index 58d61571a661..000000000000
--- a/lib/libc/sys/sendfile.2
+++ /dev/null
@@ -1,151 +0,0 @@
-.\" Copyright (c) 1998, David Greenman
-.\" 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 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.
-.\"
-.\" $Id: sendfile.2,v 1.1 1998/11/05 14:43:29 dg Exp $
-.\"
-.Dd November 5, 1998
-.Dt SENDFILE 2
-.Os
-.Sh NAME
-.Nm sendfile
-.Nd send a file to a socket
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
-.Fd #include <sys/uio.h>
-.Ft int
-.Fn sendfile "int fd" "int s" "off_t offset" "size_t nbytes" "struct sf_hdtr *hdtr" "off_t *sbytes" "int flags"
-.Sh DESCRIPTION
-.Fn Sendfile
-sends a regular file specified by descriptor
-.Fa fd
-out a stream socket specified by descriptor
-.Fa s .
-.Pp
-The
-.Fa offset
-argument specifies where to begin in the file. The
-.Fa nbytes
-argument specifies how many bytes of the file should be sent, with 0 having the special
-meaning of send until the end of file has been reached.
-.Pp
-An optional header and/or trailer can be sent before and after the file data by specifying
-a pointer to a struct sf_hdtr, which has the following structure:
-.Pp
-.Bd -literal -offset indent -compact
-struct sf_hdtr {
- struct iovec *headers; /* pointer to header iovecs */
- int hdr_cnt; /* number of header iovecs */
- struct iovec *trailers; /* pointer to trailer iovecs */
- int trl_cnt; /* number of trailer iovecs */
-};
-.Ed
-.Pp
-The
-.Fa headers
-and
-.Fa tailers
-pointers, if non-NULL, point to arrays of struct iovec structures. See the
-.Fn writev
-system call for information on the iovec structure. The number of iovecs in these
-arrays is specified by
-.Fa hdr_cnt
-and
-.Fa trl_cnt .
-.Pp
-If non-NULL, the system will write the total number of bytes sent on the socket to the
-variable pointed to by
-.Fa sbytes .
-.Pp
-The
-.Fa flags
-argument is currently undefined and should be specified as 0.
-.Pp
-When using a socket marked for non-blocking I/O,
-.Fn sendfile
-may send fewer bytes than requested. In this case, the number of bytes successfully
-written is returned in
-.Fa *sbytes
-(if specified),
-and the error
-.Er EAGAIN
-is returned.
-.Sh IMPLEMENTATION NOTES
-.Pp
-The FreeBSD implementation of
-.Fn sendfile
-is "zero-copy", meaning that it has been optimized so that copying of the file data is avoided.
-.Sh RETURN VALUES
-Upon successful completion,
-.Fn sendfile
-returns 0. Otherwise a -1 is returned and the global variable
-.Va errno
-is set to indicate the error.
-.Sh ERRORS
-.Bl -tag -width Er
-.It Bq Er EBADF
-.Fa fd
-is not a valid file descriptor.
-.It Bq Er EBADF
-.Fa s
-is not a valid socket descriptor.
-.It Bq Er ENOTSOCK
-.Fa s
-is not a socket.
-.It Bq Er EINVAL
-.Fa fd
-is not a regular file.
-.It Bq Er EINVAL
-.Fa s
-is not a SOCK_STREAM type socket.
-.It Bq Er EINVAL
-.Fa offset
-is negative or out of range.
-.It Bq Er ENOTCONN
-.Fa s
-points to an unconnected socket.
-.It Bq Er EPIPE
-The socket peer has closed the connection.
-.It Bq Er EIO
-An error occurred while reading from
-.Fa fd .
-.It Bq Er EFAULT
-An invalid address was specified for a parameter.
-.It Bq Er EAGAIN
-The socket is marked for non-blocking I/O and not all data was sent due to the socket buffer being filled.
-If specified, the number of bytes successfully sent will be returned in
-.Fa *sbytes .
-.El
-.Sh SEE ALSO
-.Xr open 2 ,
-.Xr socket 2 ,
-.Xr send 2 ,
-.Xr writev 2
-.Sh HISTORY
-.Fn sendfile
-first appeared in FreeBSD 3.0.1.
-.Sh AUTHORS
-.Fn sendfile
-and this manual page were written by David Greenman <dg@root.com>.
diff --git a/lib/libc/sys/sigaltstack.2 b/lib/libc/sys/sigaltstack.2
index 9d77c8525a20..7ea6113a4d53 100644
--- a/lib/libc/sys/sigaltstack.2
+++ b/lib/libc/sys/sigaltstack.2
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)sigaltstack.2 8.2 (Berkeley) 5/1/95
-.\" $Id: sigaltstack.2,v 1.8 1997/03/12 17:16:22 bde Exp $
+.\" $Id: sigaltstack.2,v 1.7 1997/03/12 16:23:36 mpp Exp $
.\"
.Dd May 1, 1995
.Dt SIGALTSTACK 2
@@ -39,11 +39,12 @@
.Nm sigaltstack
.Nd set and/or get signal stack context
.Sh SYNOPSIS
+.Fd #include <sys/types.h>
.Fd #include <signal.h>
.Bd -literal
struct sigaltstack {
char *ss_sp;
- size_t ss_size;
+ long ss_size;
int ss_flags;
};
.Ed
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2
index 6e5ffeeab0ca..50d489a75e83 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95
-.\" $Id: stat.2,v 1.13 1998/01/02 19:22:49 alex Exp $
+.\" $Id: stat.2,v 1.12 1997/03/11 11:35:55 peter Exp $
.\"
.Dd May 1, 1995
.Dt STAT 2
@@ -94,30 +94,30 @@ as defined by
and into which information is placed concerning the file.
.Bd -literal
struct stat {
- dev_t st_dev; /* inode's device */
- ino_t st_ino; /* inode's number */
- mode_t st_mode; /* inode protection mode */
- nlink_t st_nlink; /* number of hard links */
- uid_t st_uid; /* user ID of the file's owner */
- gid_t st_gid; /* group ID of the file's group */
- dev_t st_rdev; /* device type */
+ dev_t st_dev; /* inode's device */
+ ino_t st_ino; /* inode's number */
+ mode_t st_mode; /* inode protection mode */
+ nlink_t st_nlink; /* number of hard links */
+ uid_t st_uid; /* user ID of the file's owner */
+ gid_t st_gid; /* group ID of the file's group */
+ dev_t st_rdev; /* device type */
#ifndef _POSIX_SOURCE
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */
#else
- time_t st_atime; /* time of last access */
- long st_atimensec; /* nsec of last access */
- time_t st_mtime; /* time of last data modification */
- long st_mtimensec; /* nsec of last data modification */
- time_t st_ctime; /* time of last file status change */
- long st_ctimensec; /* nsec of last file status change */
+ time_t st_atime; /* time of last access */
+ long st_atimensec; /* nsec of last access */
+ time_t st_mtime; /* time of last data modification */
+ long st_mtimensec; /* nsec of last data modification */
+ time_t st_ctime; /* time of last file status change */
+ long st_ctimensec; /* nsec of last file status change */
#endif
- off_t st_size; /* file size, in bytes */
- int64_t st_blocks; /* blocks allocated for file */
- u_int32_t st_blksize; /* optimal blocksize for I/O */
- u_int32_t st_flags; /* user defined flags for file */
- u_int32_t st_gen; /* file generation number */
+ off_t st_size; /* file size, in bytes */
+ quad_t st_blocks; /* blocks allocated for file */
+ u_long st_blksize; /* optimal blocksize for I/O */
+ u_long st_flags; /* user defined flags for file */
+ u_long st_gen; /* file generation number */
};
.Ed
.Pp
diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2
index 2c97af94ca40..5fff122a90bd 100644
--- a/lib/libc/sys/vfork.2
+++ b/lib/libc/sys/vfork.2
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)vfork.2 8.1 (Berkeley) 6/4/93
-.\" $Id: vfork.2,v 1.10 1998/01/02 19:22:49 alex Exp $
+.\" $Id: vfork.2,v 1.9 1997/11/18 03:59:30 jdp Exp $
.\"
.Dd June 4, 1993
.Dt VFORK 2
@@ -57,7 +57,7 @@ in that the child borrows the parent's memory and thread of
control until a call to
.Xr execve 2
or an exit (either by a call to
-.Xr _exit 2
+.Xr exit 3
or abnormally).
The parent process is suspended while the child is using its resources.
.Pp
diff --git a/lib/libc_r/Makefile b/lib/libc_r/Makefile
index 806cd10b5fa5..84497f23658b 100644
--- a/lib/libc_r/Makefile
+++ b/lib/libc_r/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.13 1998/06/14 11:25:44 peter Exp $
+# $Id: Makefile,v 1.12 1998/06/12 02:21:27 jb Exp $
#
# All library objects contain rcsid strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
@@ -26,7 +26,7 @@ HIDDEN_SYSCALLS= accept.o bind.o close.o connect.o dup.o dup2.o \
execve.o fchflags.o fchmod.o fchown.o fcntl.o \
flock.o fpathconf.o fstat.o fstatfs.o fsync.o getdirentries.o \
getpeername.o getsockname.o getsockopt.o ioctl.o listen.o \
- nanosleep.o nfssvc.o open.o poll.o read.o readv.o recvfrom.o \
+ mknod.o nanosleep.o nfssvc.o open.o poll.o read.o readv.o recvfrom.o \
recvmsg.o sched_yield.o select.o sendmsg.o sendto.o \
setsockopt.o shutdown.o sigaction.o sigaltstack.o \
signanosleep.o socket.o socketpair.o wait4.o write.o writev.o
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 2d7e723bbfa1..04600cfbb3be 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -447,7 +447,7 @@ struct pthread {
int signo;
/* Miscellaneous data. */
- int flags;
+ char flags;
#define PTHREAD_EXITING 0x0100
char pthread_priority;
void *ret;
@@ -654,8 +654,6 @@ void _thread_dump_info(void);
void _thread_init(void);
void _thread_kern_sched(struct sigcontext *);
void _thread_kern_sched_state(enum pthread_state,char *fname,int lineno);
-void _thread_kern_sched_state_unlock(enum pthread_state state,
- spinlock_t *lock, char *fname, int lineno);
void _thread_kern_set_timeout(struct timespec *);
void _thread_sig_handler(int, int, struct sigcontext *);
void _thread_start(void);
diff --git a/lib/libc_r/uthread/uthread_cond.c b/lib/libc_r/uthread/uthread_cond.c
index a085ea60fa89..fae12ebb68b5 100644
--- a/lib/libc_r/uthread/uthread_cond.c
+++ b/lib/libc_r/uthread/uthread_cond.c
@@ -144,9 +144,6 @@ pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex)
switch ((*cond)->c_type) {
/* Fast condition variable: */
case COND_TYPE_FAST:
- /* Wait forever: */
- _thread_run->wakeup_time.tv_sec = -1;
-
/*
* Queue the running thread for the condition
* variable:
@@ -154,36 +151,34 @@ pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex)
_thread_queue_enq(&(*cond)->c_queue, _thread_run);
/* Unlock the mutex: */
- if ((rval = pthread_mutex_unlock(mutex)) != 0) {
- /*
- * Cannot unlock the mutex, so remove the
- * running thread from the condition
- * variable queue:
- */
- _thread_queue_deq(&(*cond)->c_queue);
+ pthread_mutex_unlock(mutex);
- /* Unlock the condition variable structure: */
- _SPINUNLOCK(&(*cond)->lock);
- } else {
- /* Schedule the next thread: */
- _thread_kern_sched_state_unlock(PS_COND_WAIT,
- &(*cond)->lock, __FILE__, __LINE__);
+ /* Wait forever: */
+ _thread_run->wakeup_time.tv_sec = -1;
- /* Lock the mutex: */
- rval = pthread_mutex_lock(mutex);
- }
+ /* Unlock the condition variable structure: */
+ _SPINUNLOCK(&(*cond)->lock);
+
+ /* Schedule the next thread: */
+ _thread_kern_sched_state(PS_COND_WAIT,
+ __FILE__, __LINE__);
+
+ /* Lock the condition variable structure: */
+ _SPINLOCK(&(*cond)->lock);
+
+ /* Lock the mutex: */
+ rval = pthread_mutex_lock(mutex);
break;
/* Trap invalid condition variable types: */
default:
- /* Unlock the condition variable structure: */
- _SPINUNLOCK(&(*cond)->lock);
-
/* Return an invalid argument error: */
rval = EINVAL;
break;
}
+ /* Unlock the condition variable structure: */
+ _SPINUNLOCK(&(*cond)->lock);
}
/* Return the completion status: */
@@ -234,13 +229,16 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
* variable queue:
*/
_thread_queue_deq(&(*cond)->c_queue);
-
+ } else {
/* Unlock the condition variable structure: */
_SPINUNLOCK(&(*cond)->lock);
- } else {
+
/* Schedule the next thread: */
- _thread_kern_sched_state_unlock(PS_COND_WAIT,
- &(*cond)->lock, __FILE__, __LINE__);
+ _thread_kern_sched_state(PS_COND_WAIT,
+ __FILE__, __LINE__);
+
+ /* Lock the condition variable structure: */
+ _SPINLOCK(&(*cond)->lock);
/* Lock the mutex: */
if ((rval = pthread_mutex_lock(mutex)) != 0) {
@@ -255,14 +253,13 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
/* Trap invalid condition variable types: */
default:
- /* Unlock the condition variable structure: */
- _SPINUNLOCK(&(*cond)->lock);
-
/* Return an invalid argument error: */
rval = EINVAL;
break;
}
+ /* Unlock the condition variable structure: */
+ _SPINUNLOCK(&(*cond)->lock);
}
/* Return the completion status: */
diff --git a/lib/libc_r/uthread/uthread_info.c b/lib/libc_r/uthread/uthread_info.c
index f66dd2d6ddcf..07877d167e33 100644
--- a/lib/libc_r/uthread/uthread_info.c
+++ b/lib/libc_r/uthread/uthread_info.c
@@ -36,7 +36,6 @@
#include <unistd.h>
#ifdef _THREAD_SAFE
#include <pthread.h>
-#include <errno.h>
#include "pthread_private.h"
struct s_thread_info {
@@ -74,31 +73,11 @@ _thread_dump_info(void)
int i;
int j;
pthread_t pthread;
- char tmpfile[128];
- for (i = 0; i < 100000; i++) {
- snprintf(tmpfile, sizeof(tmpfile), "/tmp/uthread.dump.%u.%i",
- getpid(), i);
- /* Open the dump file for append and create it if necessary: */
- if ((fd = _thread_sys_open(tmpfile, O_RDWR | O_CREAT | O_EXCL,
- 0666)) < 0) {
- /* Can't open the dump file. */
- if (errno == EEXIST)
- continue;
- /*
- * We only need to continue in case of
- * EEXIT error. Most other error
- * codes means that we will fail all
- * the times.
- */
- return;
- } else {
- break;
- }
- }
- if (i==100000) {
- /* all 100000 possibilities are in use :( */
- return;
+ /* Open the dump file for append and create it if necessary: */
+ if ((fd = _thread_sys_open("/tmp/uthread.dump",
+ O_RDWR | O_CREAT | O_APPEND, 0666)) < 0) {
+ /* Can't open the dump file. */
} else {
/* Output a header for active threads: */
strcpy(s, "\n\n=============\nACTIVE THREADS\n\n");
diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c
index 3a6966bad5bf..22746c7d211e 100644
--- a/lib/libc_r/uthread/uthread_kern.c
+++ b/lib/libc_r/uthread/uthread_kern.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_kern.c,v 1.14 1998/10/09 19:01:30 dt Exp $
+ * $Id: uthread_kern.c,v 1.13 1998/09/30 06:36:56 jb Exp $
*
*/
#include <errno.h>
@@ -616,22 +616,6 @@ _thread_kern_sched_state(enum pthread_state state, char *fname, int lineno)
return;
}
-void
-_thread_kern_sched_state_unlock(enum pthread_state state,
- spinlock_t *lock, char *fname, int lineno)
-{
- /* Change the state of the current thread: */
- _thread_run->state = state;
- _thread_run->fname = fname;
- _thread_run->lineno = lineno;
-
- _SPINUNLOCK(lock);
-
- /* Schedule the next thread that is ready: */
- _thread_kern_sched(NULL);
- return;
-}
-
static void
_thread_kern_select(int wait_reqd)
{
diff --git a/lib/libc_r/uthread/uthread_kill.c b/lib/libc_r/uthread/uthread_kill.c
index 7572c05faff7..292ba5caf8f2 100644
--- a/lib/libc_r/uthread/uthread_kill.c
+++ b/lib/libc_r/uthread/uthread_kill.c
@@ -83,26 +83,6 @@ pthread_kill(pthread_t pthread, int sig)
sigaddset(&pthread->sigpend,sig);
break;
- case PS_SELECT_WAIT:
- case PS_FDR_WAIT:
- case PS_FDW_WAIT:
- case PS_SLEEP_WAIT:
- if (!sigismember(&pthread->sigmask, sig) &&
- (_thread_sigact[sig - 1].sa_handler != SIG_IGN)) {
- /* Flag the operation as interrupted: */
- pthread->interrupted = 1;
-
- /* Change the state of the thread to run: */
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
-
- /* Return the signal number: */
- pthread->signo = sig;
- } else {
- /* Increment the pending signal count: */
- sigaddset(&pthread->sigpend,sig);
- }
- break;
-
default:
/* Increment the pending signal count: */
sigaddset(&pthread->sigpend,sig);
diff --git a/lib/libc_r/uthread/uthread_mattr_kind_np.c b/lib/libc_r/uthread/uthread_mattr_kind_np.c
index c145a1f89927..3eeabff038a7 100644
--- a/lib/libc_r/uthread/uthread_mattr_kind_np.c
+++ b/lib/libc_r/uthread/uthread_mattr_kind_np.c
@@ -61,18 +61,4 @@ pthread_mutexattr_getkind_np(pthread_mutexattr_t attr)
}
return(ret);
}
-
-int
-pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
-{
- int ret;
- if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
- errno = EINVAL;
- ret = -1;
- } else {
- (*attr)->m_type = type;
- ret = 0;
- }
- return(ret);
-}
#endif
diff --git a/lib/libc_r/uthread/uthread_mutex.c b/lib/libc_r/uthread/uthread_mutex.c
index d3801f1750c0..4f4aa8af041e 100644
--- a/lib/libc_r/uthread/uthread_mutex.c
+++ b/lib/libc_r/uthread/uthread_mutex.c
@@ -53,7 +53,7 @@ pthread_mutex_init(pthread_mutex_t * mutex,
/* Check if default mutex attributes: */
if (mutex_attr == NULL || *mutex_attr == NULL)
/* Default to a fast mutex: */
- type = PTHREAD_MUTEX_DEFAULT;
+ type = MUTEX_TYPE_FAST;
else if ((*mutex_attr)->m_type >= MUTEX_TYPE_MAX)
/* Return an invalid argument error: */
@@ -74,14 +74,12 @@ pthread_mutex_init(pthread_mutex_t * mutex,
/* Process according to mutex type: */
switch (type) {
/* Fast mutex: */
- case PTHREAD_MUTEX_DEFAULT:
- case PTHREAD_MUTEX_NORMAL:
- case PTHREAD_MUTEX_ERRORCHECK:
+ case MUTEX_TYPE_FAST:
/* Nothing to do here. */
break;
/* Counting mutex: */
- case PTHREAD_MUTEX_RECURSIVE:
+ case MUTEX_TYPE_COUNTING_FAST:
/* Reset the mutex count: */
pmutex->m_data.m_count = 0;
break;
@@ -176,9 +174,7 @@ pthread_mutex_trylock(pthread_mutex_t * mutex)
/* Process according to mutex type: */
switch ((*mutex)->m_type) {
/* Fast mutex: */
- case PTHREAD_MUTEX_NORMAL:
- case PTHREAD_MUTEX_DEFAULT:
- case PTHREAD_MUTEX_ERRORCHECK:
+ case MUTEX_TYPE_FAST:
/* Check if this mutex is not locked: */
if ((*mutex)->m_owner == NULL) {
/* Lock the mutex for the running thread: */
@@ -190,7 +186,7 @@ pthread_mutex_trylock(pthread_mutex_t * mutex)
break;
/* Counting mutex: */
- case PTHREAD_MUTEX_RECURSIVE:
+ case MUTEX_TYPE_COUNTING_FAST:
/* Check if this mutex is locked: */
if ((*mutex)->m_owner != NULL) {
/*
@@ -243,26 +239,8 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
/* Process according to mutex type: */
switch ((*mutex)->m_type) {
- /* What SS2 define as a 'normal' mutex. This has to deadlock
- on attempts to get a lock you already own. */
- case PTHREAD_MUTEX_NORMAL:
- if ((*mutex)->m_owner == _thread_run) {
- /* Intetionally deadlock */
- for (;;)
- _thread_kern_sched_state(PS_MUTEX_WAIT, __FILE__, __LINE__);
- }
- goto COMMON_LOCK;
-
- /* Return error (not OK) on attempting to re-lock */
- case PTHREAD_MUTEX_ERRORCHECK:
- if ((*mutex)->m_owner == _thread_run) {
- ret = EDEADLK;
- break;
- }
-
/* Fast mutexes do not check for any error conditions: */
- case PTHREAD_MUTEX_DEFAULT:
- COMMON_LOCK:
+ case MUTEX_TYPE_FAST:
/*
* Enter a loop to wait for the mutex to be locked by the
* current thread:
@@ -279,10 +257,11 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
*/
_thread_queue_enq(&(*mutex)->m_queue, _thread_run);
- /* Wait for the mutex: */
- _thread_kern_sched_state_unlock(
- PS_MUTEX_WAIT, &(*mutex)->lock,
- __FILE__, __LINE__);
+ /* Unlock the mutex structure: */
+ _SPINUNLOCK(&(*mutex)->lock);
+
+ /* Block signals: */
+ _thread_kern_sched_state(PS_MUTEX_WAIT, __FILE__, __LINE__);
/* Lock the mutex again: */
_SPINLOCK(&(*mutex)->lock);
@@ -291,7 +270,7 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
break;
/* Counting mutex: */
- case PTHREAD_MUTEX_RECURSIVE:
+ case MUTEX_TYPE_COUNTING_FAST:
/*
* Enter a loop to wait for the mutex to be locked by the
* current thread:
@@ -311,10 +290,11 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
*/
_thread_queue_enq(&(*mutex)->m_queue, _thread_run);
- /* Wait for the mutex: */
- _thread_kern_sched_state_unlock(
- PS_MUTEX_WAIT, &(*mutex)->lock,
- __FILE__, __LINE__);
+ /* Unlock the mutex structure: */
+ _SPINUNLOCK(&(*mutex)->lock);
+
+ /* Block signals: */
+ _thread_kern_sched_state(PS_MUTEX_WAIT, __FILE__, __LINE__);
/* Lock the mutex again: */
_SPINLOCK(&(*mutex)->lock);
@@ -353,15 +333,12 @@ pthread_mutex_unlock(pthread_mutex_t * mutex)
/* Process according to mutex type: */
switch ((*mutex)->m_type) {
- /* Default & normal mutexes do not really need to check for
- any error conditions: */
- case PTHREAD_MUTEX_NORMAL:
- case PTHREAD_MUTEX_DEFAULT:
- case PTHREAD_MUTEX_ERRORCHECK:
+ /* Fast mutexes do not check for any error conditions: */
+ case MUTEX_TYPE_FAST:
/* Check if the running thread is not the owner of the mutex: */
if ((*mutex)->m_owner != _thread_run) {
/* Return an invalid argument error: */
- ret = (*mutex)->m_owner ? EPERM : EINVAL;
+ ret = EINVAL;
}
/*
* Get the next thread from the queue of threads waiting on
@@ -374,26 +351,24 @@ pthread_mutex_unlock(pthread_mutex_t * mutex)
break;
/* Counting mutex: */
- case PTHREAD_MUTEX_RECURSIVE:
+ case MUTEX_TYPE_COUNTING_FAST:
/* Check if the running thread is not the owner of the mutex: */
if ((*mutex)->m_owner != _thread_run) {
/* Return an invalid argument error: */
ret = EINVAL;
}
/* Check if there are still counts: */
- else if ((*mutex)->m_data.m_count > 1) {
+ else if ((*mutex)->m_data.m_count) {
/* Decrement the count: */
(*mutex)->m_data.m_count--;
- } else {
- (*mutex)->m_data.m_count = 0;
- /*
- * Get the next thread from the queue of threads waiting on
- * the mutex:
- */
- if (((*mutex)->m_owner = _thread_queue_deq(&(*mutex)->m_queue)) != NULL) {
- /* Allow the new owner of the mutex to run: */
- PTHREAD_NEW_STATE((*mutex)->m_owner,PS_RUNNING);
- }
+ }
+ /*
+ * Get the next thread from the queue of threads waiting on
+ * the mutex:
+ */
+ else if (((*mutex)->m_owner = _thread_queue_deq(&(*mutex)->m_queue)) != NULL) {
+ /* Allow the new owner of the mutex to run: */
+ PTHREAD_NEW_STATE((*mutex)->m_owner,PS_RUNNING);
}
break;
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
index 394f63596cc1..d4ba57e3c6a6 100644
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: camlib.c,v 1.3 1998/11/15 23:12:42 ken Exp $
+ * $Id: camlib.c,v 1.1 1998/09/15 06:16:46 gibbs Exp $
*/
#include <sys/types.h>
@@ -585,10 +585,9 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device,
device->given_unit_number = given_unit_number;
if ((fd = open(path, flags)) < 0) {
- snprintf(cam_errbuf, CAM_ERRBUF_SIZE,
- "%s: couldn't open passthrough device %s\n"
- "%s: %s", func_name, path, func_name,
- strerror(errno));
+ sprintf(cam_errbuf, "%s: couldn't open passthrough device %s\n"
+ "%s: %s", func_name, newpath, func_name,
+ strerror(errno));
goto crod_bailout;
}
diff --git a/lib/libcompat/Makefile b/lib/libcompat/Makefile
index f57107ee6f0d..c9ba0ec1563b 100644
--- a/lib/libcompat/Makefile
+++ b/lib/libcompat/Makefile
@@ -14,6 +14,10 @@ NOPIC=
# XXX MISSING: tell.c vlimit.c vtimes.c
SRCS+= ascftime.c cftime.c ftime.c getpw.c gtty.c stty.c
+.if (${MACHINE_ARCH} == "vax")
+SRCS+= reset.s
+.endif
+
MAN3+= 4.1/ftime.3 4.1/getpw.3 4.1/stty.3 4.1/vlimit.3 4.1/vtimes.3
MAN3+= 4.1/cftime.3
@@ -23,7 +27,20 @@ MLINKS+=cftime.3 ascftime.3
# compat 4.3 sources
# XXX MISSING: ecvt.c gcvt.c sibuf.c sobuf.c strout.c
SRCS+= cfree.c lsearch.c regex.c rexec.c
+
+.if (${MACHINE_ARCH} == "hp300" || ${MACHINE_ARCH} == "luna68k")
+SRCS+= insque.s remque.s
+.elif (${MACHINE_ARCH} == "i386")
+SRCS+= insque.c remque.c
+.elif (${MACHINE_ARCH} == "mips")
+SRCS+= insque.c remque.c
+.elif (${MACHINE_ARCH} == "sparc")
SRCS+= insque.c remque.c
+.elif (${MACHINE_ARCH} == "tahoe")
+SRCS+= nargs.s insque.s remque.s
+.elif (${MACHINE_ARCH} == "vax")
+SRCS+= nargs.s insque.s remque.s
+.endif
# XXX MISSING: ecvt.0
MAN3+= 4.3/cfree.3 4.3/insque.3 4.3/lsearch.3 4.3/re_comp.3 4.3/rexec.3
diff --git a/lib/libdevstat/Makefile b/lib/libdevstat/Makefile
index 063354425d65..ce3f9c2bdf68 100644
--- a/lib/libdevstat/Makefile
+++ b/lib/libdevstat/Makefile
@@ -4,16 +4,6 @@ SRCS= devstat.c
MAN3= devstat.3
-MLINKS+=devstat.3 getnumdevs.3
-MLINKS+=devstat.3 getgeneration.3
-MLINKS+=devstat.3 getversion.3
-MLINKS+=devstat.3 checkversion.3
-MLINKS+=devstat.3 getdevs.3
-MLINKS+=devstat.3 selectdevs.3
-MLINKS+=devstat.3 buildmatch.3
-MLINKS+=devstat.3 compute_stats.3
-MLINKS+=devstat.3 compute_etime.3
-
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/devstat.h \
${DESTDIR}/usr/include
diff --git a/lib/libdevstat/devstat.3 b/lib/libdevstat/devstat.3
index f189abfd3070..6da22aa8c32a 100644
--- a/lib/libdevstat/devstat.3
+++ b/lib/libdevstat/devstat.3
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: devstat.3,v 1.2 1998/09/20 00:11:09 ken Exp $
+.\" $Id: devstat.3,v 1.1 1998/09/15 06:23:21 gibbs Exp $
.\"
.Dd May 21, 1998
.Dt DEVSTAT 3
@@ -221,7 +221,7 @@ this may be done for him in a
library routine.
If no devices have been selected by name or by pattern, the performance
tracking code will select every device in the system, and sort them by
-performance. If devices have been selected by name or pattern, the
+perforcmance. If devices have been selected by name or pattern, the
performance tracking code will honor those selections and will only sort
among the selected devices.
.It order in the devstat list
@@ -258,7 +258,7 @@ In remove mode,
will remove devices specified by name or by matching pattern. It will not
select any additional devices.
.It DS_SELECT_ADDONLY
-In add only mode,
+In addonly mode,
.Fn selectdevs
will select any unselected devices specified by name or matching pattern.
In this respect it is identical to add mode. It will not, however, select
@@ -433,7 +433,7 @@ This is average blocks per second. If the device blocksize is
.Sq 0 ,
a default blocksize of 512 bytes will be used instead.
.It ms_per_transaction
-The average number of milliseconds per transaction.
+The average number of miliseconds per transaction.
.El
.Pp
.Fn compute_etime
diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile
index 1a3809931453..1b1200dedbad 100644
--- a/lib/libdisk/Makefile
+++ b/lib/libdisk/Makefile
@@ -1,11 +1,11 @@
-# $Id: Makefile,v 1.24 1998/12/30 13:29:11 jkh Exp $
+# $Id: Makefile,v 1.20 1997/02/22 15:06:25 peter Exp $
LIB= disk
SRCS= blocks.c disklabel.c dkcksum.c chunk.c disk.c change.c \
- create_chunk.c rules.c write_disk.c
+ create_chunk.c rules.c write_disk.c data.c
CFLAGS+= -Wall
-CLEANFILES+= tmp.c tst01 tst01.o
+CLEANFILES+= tmp.c tst01 tst01.o data.c
VPATH= ${.CURDIR}/../../sbin/disklabel
NOPROFILE= yes
NOSHARED= yes
@@ -42,6 +42,22 @@ MLINKS+= libdisk.3 Open_Disk.3 \
.include <bsd.lib.mk>
+BOOTS=/usr/mdec
+
+.if ${MACHINE_ARCH} == "i386"
+data.c: ${.CURDIR}/libdisk.h ${BOOTS}/boot1 ${BOOTS}/boot2
+ file2c 'const unsigned char boot1[] = {' '};' \
+ < ${BOOTS}/boot1 > tmp.c
+ file2c 'const unsigned char boot2[] = {' '};' \
+ < ${BOOTS}/boot2 >> tmp.c
+ mv -f tmp.c data.c
+.elif ${MACHINE_ARCH} == "alpha"
+data.c: ${.CURDIR}/libdisk.h ${BOOTS}/boot1
+ file2c 'const unsigned char boot1[] = {' '};' \
+ < ${BOOTS}/boot1 > tmp.c
+ mv -f tmp.c data.c
+.endif
+
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/libdisk.h \
${DESTDIR}/usr/include/libdisk.h
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 9bb8dd51f9da..86e18f87319a 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.33 1999/01/08 00:32:19 jkh Exp $
+ * $Id: create_chunk.c,v 1.30 1998/03/20 23:43:03 jkh Exp $
*
*/
@@ -151,7 +151,6 @@ Fixup_Names(struct disk *d)
continue;
if (strcmp(c2->name,"X"))
continue;
-#ifndef __alpha__
c2->oname = malloc(12);
if(!c2->oname) err(1,"malloc failed");
for(j=1;j<=NDOSPART;j++) {
@@ -168,10 +167,6 @@ Fixup_Names(struct disk *d)
}
if (c2->oname)
free(c2->oname);
-#else
- free(c2->name);
- c2->name = strdup(c1->name);
-#endif
}
for(c2 = c1->part; c2 ; c2 = c2->next) {
if (c2->type == freebsd) {
@@ -259,19 +254,18 @@ MakeDev(struct chunk *c1, const char *path)
return 0;
if (!strncmp(p, "wd", 2))
- bmaj = 0, cmaj = 3, p += 2;
+ bmaj = 0, cmaj = 3;
else if (!strncmp(p, "sd", 2))
- bmaj = 4, cmaj = 13, p += 2;
+ bmaj = 4, cmaj = 13;
else if (!strncmp(p, "wfd", 3))
- bmaj = 1, cmaj = 87, p += 3;
- else if (!strncmp(p, "fla", 3))
- bmaj = 28, cmaj = 101, p += 3;
+ bmaj = 1, cmaj = 87;
else if (!strncmp(p, "da", 2)) /* CAM support */
- bmaj = 4, cmaj = 13, p += 2;
+ bmaj = 4, cmaj = 13;
else {
msgDebug("MakeDev: Unknown major/minor for devtype %s\n", p);
return 0;
}
+ p += 2;
if (!isdigit(*p)) {
msgDebug("MakeDev: Invalid disk unit passed: %s\n", p);
return 0;
@@ -288,7 +282,6 @@ MakeDev(struct chunk *c1, const char *path)
unit += (*p - '0');
p++;
}
-#ifndef __alpha__
if (*p != 's') {
msgDebug("MakeDev: `%s' is not a valid slice delimiter\n", p);
return 0;
@@ -306,9 +299,6 @@ MakeDev(struct chunk *c1, const char *path)
p++;
}
slice = slice + 1;
-#else
- slice = 0;
-#endif
if (!*p) {
part = 2;
if(c1->type == freebsd)
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c
index 4d6deafc65fd..f5c19994b4a8 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: disk.c,v 1.38 1998/10/06 11:57:08 dfr Exp $
+ * $Id: disk.c,v 1.37 1998/09/30 21:40:51 jkh Exp $
*
*/
@@ -323,7 +323,7 @@ Collapse_Disk(struct disk *d)
}
#endif
-static char * device_list[] = {"wd", "sd", "da", "wfd", "fla", 0};
+static char * device_list[] = {"wd","sd","da","wfd",0};
char **
Disk_Names()
diff --git a/lib/libdisk/libdisk.3 b/lib/libdisk/libdisk.3
index 5657fd32e430..6b56cf7de249 100644
--- a/lib/libdisk/libdisk.3
+++ b/lib/libdisk/libdisk.3
@@ -25,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: libdisk.3,v 1.7 1998/06/06 05:50:52 jkoshy Exp $
+.\" $Id: libdisk.3,v 1.6 1998/03/19 07:34:03 charnier Exp $
.\" "
.Dd March 15, 1996
.Dt LIBDISK 3
@@ -63,6 +63,7 @@
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <libdisk.h>
+.Dv extern const u_char *boot1, boot2;
.\" What is the correct way to cause a single line break ???
.Bd -literal
.Dv extern const char *chunk_n[];
@@ -262,7 +263,11 @@ is called.
.Fn Set_Boot_Blocks
sets the boot-blocks for use on this disk. Gets written when
.Fn Write_Disk
-is called.
+is called. The external variables
+.Dv boot1
+and
+.Dv boot2
+contain suitable data to be passed to this function.
.Pp
.Fn Write_Disk
writes all the MBRs, disklabels, bootblocks and boot managers.
diff --git a/lib/libdisk/libdisk.h b/lib/libdisk/libdisk.h
index 91b1817b6ddd..3ae62cab12f3 100644
--- a/lib/libdisk/libdisk.h
+++ b/lib/libdisk/libdisk.h
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
-* $Id: libdisk.h,v 1.29 1998/10/06 11:57:08 dfr Exp $
+* $Id: libdisk.h,v 1.28 1998/01/20 11:03:15 bde Exp $
*
*/
@@ -86,6 +86,7 @@ struct chunk {
};
extern const char *chunk_n[];
+extern const u_char boot1[], boot2[];
const char *
slice_type_name( int type, int subtype );
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index b27d17b2c79e..6d3b2a7d1d1c 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: write_disk.c,v 1.24 1998/10/27 21:14:03 msmith Exp $
+ * $Id: write_disk.c,v 1.22 1998/09/30 21:40:51 jkh Exp $
*
*/
@@ -64,10 +64,10 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
for(c2=c1->part;c2;c2=c2->next) {
if (c2->type == unused) continue;
if (!strcmp(c2->name,"X")) continue;
- j = c2->name[strlen(new->name) + 2] - 'a';
+ j = c2->name[5] - 'a';
if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
#ifdef DEBUG
- warn("Weird parititon letter %c",c2->name[strlen(new->name) + 2]);
+ warn("Weird parititon letter %c",c2->name[5]);
#endif
continue;
}
@@ -110,14 +110,6 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
#ifdef __alpha__
/*
- * Tell SRM where the bootstrap is.
- */
- lp = (u_long *)buf;
- lp[60] = 15;
- lp[61] = 1;
- lp[62] = 0;
-
- /*
* Generate the bootblock checksum for the SRM console.
*/
for (lp = (u_long *)buf, i = 0, sum = 0; i < 63; i++)
@@ -181,7 +173,6 @@ Write_Disk(struct disk *d1)
if (c1->type == unused) continue;
if (!strcmp(c1->name,"X")) continue;
j = c1->name[4] - '1';
- j = c1->name[strlen(d1->name) + 1] - '1';
if (j < 0 || j > 3)
continue;
s[j]++;
@@ -250,7 +241,6 @@ Write_Disk(struct disk *d1)
if (dp[i].dp_typ == 0xa5)
dp[i].dp_flag = 0x80;
-#ifndef __alpha__
mbr = read_block(fd,WHERE(0,d1));
if (d1->bootmgr)
memcpy(mbr,d1->bootmgr,DOSPARTOFF);
@@ -258,7 +248,6 @@ Write_Disk(struct disk *d1)
mbr[512-2] = 0x55;
mbr[512-1] = 0xaa;
write_block(fd,WHERE(0,d1),mbr);
-#endif
i = 1;
i = ioctl(fd,DIOCSYNCSLICEINFO,&i);
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index 12d5cb4f1e95..db3057ff2c7c 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -58,7 +58,7 @@ help.h: ${ASRC} makelist
editline.c:
sh ${.CURDIR}/makelist -e ${OSRCS} > ${.TARGET}
-beforedepend editline.o editline.po editline.So: \
+beforedepend editline.o editline.po editline.so: \
vi.h emacs.h common.h fcns.h fcns.c help.h help.c
test: test.o libedit.a ${DPADD} ${LIBTERMCAP}
diff --git a/lib/libedit/term.c b/lib/libedit/term.c
index 90ebf9522c93..442583b09462 100644
--- a/lib/libedit/term.c
+++ b/lib/libedit/term.c
@@ -240,7 +240,7 @@ term_init(el)
el->el_term.t_str = (char **) el_malloc(T_str * sizeof(char*));
(void) memset(el->el_term.t_str, 0, T_str * sizeof(char*));
el->el_term.t_val = (int *) el_malloc(T_val * sizeof(int));
- (void) memset(el->el_term.t_val, 0, T_val * sizeof(int));
+ (void) memset(el->el_term.t_val, 0, T_val * sizeof(char*));
term_outfile = el->el_outfile;
(void) term_set(el, NULL);
term_init_arrow(el);
diff --git a/lib/libf2c/Makefile b/lib/libf2c/Makefile
index fd17e2ae91c3..6183d5880868 100644
--- a/lib/libf2c/Makefile
+++ b/lib/libf2c/Makefile
@@ -5,7 +5,7 @@ CFLAGS+= -DIEEE_drem -DNON_ANSI_RW_MODES -DNON_UNIX_STDIO -DPedantic -I${.CURDIR
MISC = Version.c main.c s_rnge.c abort_.c getarg_.c iargc_.c getenv_.c\
signal_.c s_stop.c s_paus.c system_.c cabs.c\
- derf_.c derfc_.c erf_.c erfc_.c sig_die.c F77_aloc.c exit.c MAIN.c
+ derf_.c derfc_.c erf_.c erfc_.c sig_die.c F77_aloc.c exit.c
POW = pow_ci.c pow_dd.c pow_di.c pow_hh.c pow_ii.c pow_ri.c pow_zi.c pow_zz.c
CX = c_abs.c c_cos.c c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c
DCX = z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 0be36ffbfd15..2afd8bbb623d 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -1,50 +1,53 @@
-# $Id: Makefile,v 1.10 1998/12/16 10:24:52 des Exp $
+# $Id$
LIB= fetch
-CFLAGS+= -I. -Wall -pedantic
-.if !defined(DEBUG)
-CFLAGS+= -DNDEBUG
-.endif
-SRCS= fetch.c common.c ftp.c http.c file.c fetch_err.c \
- fetch_err.h ftperr.h httperr.h
+CFLAGS+= -I. -Wall -pedantic -DNDEBUG
+SRCS= fetch.c ftp.c http.c file.c
+DPSRCS= ftperr.c httperr.c
MAN3= fetch.3
-CLEANFILES= fetch_err.c fetch_err.h ftperr.h httperr.h
+CLEANFILES= ${DPSRCS}
SHLIB_MAJOR= 1
SHLIB_MINOR= 0
+beforedepend: ${DPSRCS}
+
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fetch.h \
${DESTDIR}/usr/include
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 fetch_err.h \
- ${DESTDIR}/usr/include
-ftperr.h: ftp.errors
- @echo "static struct fetcherr _ftp_errlist[] = {" > ${.TARGET}
+ftperr.c: ftp.errors
+ @echo "struct ftperr {" \ > ${.TARGET}
+ @echo " const int num;" \ >> ${.TARGET}
+ @echo " const char *string;" \ >> ${.TARGET}
+ @echo "};" \ >> ${.TARGET}
+ @echo "static struct ftperr _ftp_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
- | while read NUM CAT STRING; do \
- echo " { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
+ | while read NUM STRING; do \
+ echo " { $${NUM}, \"$${STRING}\" },"; \
done >> ${.TARGET}
- @echo " { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
+ @echo " { -1, \"Unknown FTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
-httperr.h: http.errors
- @echo "static struct fetcherr _http_errlist[] = {" > ${.TARGET}
+httperr.c: http.errors
+ @echo "struct httperr {" \ > ${.TARGET}
+ @echo " const int num;" \ >> ${.TARGET}
+ @echo " const char *string;" \ >> ${.TARGET}
+ @echo "};" \ >> ${.TARGET}
+ @echo "static struct httperr _http_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
- | while read NUM CAT STRING; do \
- echo " { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
+ | while read NUM STRING; do \
+ echo " { $${NUM}, \"$${STRING}\" },"; \
done >> ${.TARGET}
- @echo " { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
+ @echo " { -1, \"Unknown HTTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
-hdrs: fetch_err.h
-
-.ORDER: fetch_err.c fetch_err.h
-fetch_err.c fetch_err.h: fetch_err.et
- compile_et ${.ALLSRC}
-
.include <bsd.lib.mk>
+
+.if !exists(${DEPENDFILE})
+${OBJS} ${POBJS} ${SOBJS}: ${DPSRCS}
+.endif
diff --git a/lib/libfetch/README b/lib/libfetch/README
index 7b8537618cca..ce50f569c294 100644
--- a/lib/libfetch/README
+++ b/lib/libfetch/README
@@ -3,8 +3,19 @@ library and provide a new, unified backend for all fetch(1),
pkg_add(1) and sysinstall(8).
Note that this is very much work in progress. It compiles (with a few
-warnings), but there is much left to be implemented. Comments, patches
-etc. of all kinds are welcome, but please don't commit anything
-without talking to me first.
+warnings), but there is much left to be implemented. Amongst other
+items:
+
+ * The man page needs work. Really. I mean it. Now.
+
+ * HTTP authentication doesn't work. I'm not sure if I bungled http.c
+ or fubared base64.c (which was ripped from MIT fetch(1)).
+
+ * The library needs a decent interface for reporting errors. I've
+ started on something (sending back an error code in the url_t that
+ was sent in) but we're Not There (tm) yet.
+
+Comments, patches etc. of all kinds are welcome, but please don't
+commit anything without talking to me first.
-- Dag-Erling C. Smørgrav (des@FreeBSD.org)
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
deleted file mode 100644
index e3dab8dfc28a..000000000000
--- a/lib/libfetch/common.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * 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
- * in this position and unchanged.
- * 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
- *
- * 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.
- *
- * $Id: common.c,v 1.4 1998/12/18 14:32:48 des Exp $
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <com_err.h>
-#include <errno.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "fetch.h"
-#include "common.h"
-
-
-/*** Local data **************************************************************/
-
-/*
- * Error messages for resolver errors
- */
-static struct fetcherr _netdb_errlist[] = {
- { HOST_NOT_FOUND, FETCH_RESOLV, "Host not found" },
- { TRY_AGAIN, FETCH_TEMP, "Transient resolver failure" },
- { NO_RECOVERY, FETCH_RESOLV, "Non-recoverable resolver failure" },
- { NO_DATA, FETCH_RESOLV, "No address record" },
- { -1, FETCH_UNKNOWN, "Unknown resolver error" }
-};
-
-static int com_err_initialized;
-
-/*** Error-reporting functions ***********************************************/
-
-/*
- * Initialize the common error library
- */
-static void
-_fetch_init_com_err(void)
-{
- initialize_ftch_error_table();
- com_err_initialized = 1;
-}
-
-/*
- * Map error code to string
- */
-static int
-_fetch_finderr(struct fetcherr *p, int e)
-{
- int i;
- for (i = 0; p[i].num != -1; i++)
- if (p[i].num == e)
- break;
- return i;
-}
-
-/*
- * Set error code
- */
-void
-_fetch_seterr(struct fetcherr *p, int e)
-{
- int n;
-
- if (!com_err_initialized)
- _fetch_init_com_err();
-
- n = _fetch_finderr(p, e);
- fetchLastErrCode = p[n].cat;
- com_err("libfetch", fetchLastErrCode, "(%03d %s)", e, p[n].string);
-}
-
-/*
- * Set error code according to errno
- */
-void
-_fetch_syserr(void)
-{
- int e;
- e = errno;
-
- if (!com_err_initialized)
- _fetch_init_com_err();
-
- switch (errno) {
- case 0:
- fetchLastErrCode = FETCH_OK;
- break;
- case EPERM:
- case EACCES:
- case EROFS:
- case EAUTH:
- case ENEEDAUTH:
- fetchLastErrCode = FETCH_AUTH;
- break;
- case ENOENT:
- case EISDIR: /* XXX */
- fetchLastErrCode = FETCH_UNAVAIL;
- break;
- case ENOMEM:
- fetchLastErrCode = FETCH_MEMORY;
- break;
- case EBUSY:
- case EAGAIN:
- fetchLastErrCode = FETCH_TEMP;
- break;
- case EEXIST:
- fetchLastErrCode = FETCH_EXISTS;
- break;
- case ENOSPC:
- fetchLastErrCode = FETCH_FULL;
- break;
- case EADDRINUSE:
- case EADDRNOTAVAIL:
- case ENETDOWN:
- case ENETUNREACH:
- case ENETRESET:
- case EHOSTUNREACH:
- fetchLastErrCode = FETCH_NETWORK;
- break;
- case ECONNABORTED:
- case ECONNRESET:
- fetchLastErrCode = FETCH_ABORT;
- break;
- case ETIMEDOUT:
- fetchLastErrCode = FETCH_TIMEOUT;
- break;
- case ECONNREFUSED:
- case EHOSTDOWN:
- fetchLastErrCode = FETCH_DOWN;
- break;
- default:
- fetchLastErrCode = FETCH_UNKNOWN;
- }
- com_err("libfetch", fetchLastErrCode, "(%03d %s)", e, strerror(e));
-}
-
-
-/*
- * Emit status message
- */
-int
-_fetch_info(char *fmt, ...)
-{
- va_list ap;
- char *s;
-
- if (!com_err_initialized)
- _fetch_init_com_err();
-
- va_start(ap, fmt);
- vasprintf(&s, fmt, ap);
- va_end(ap);
-
- if (s == NULL) {
- com_err("libfetch", FETCH_MEMORY, "");
- return -1;
- } else {
- com_err("libfetch", FETCH_VERBOSE, "%s", s);
- free(s);
- return 0;
- }
-}
-
-
-/*** Network-related utility functions ***************************************/
-
-/*
- * Establish a TCP connection to the specified port on the specified host.
- */
-int
-_fetch_connect(char *host, int port, int verbose)
-{
- struct sockaddr_in sin;
- struct hostent *he;
- int sd;
-
-#ifndef NDEBUG
- fprintf(stderr, "\033[1m---> %s:%d\033[m\n", host, port);
-#endif
-
- if (verbose)
- _fetch_info("looking up %s", host);
-
- /* look up host name */
- if ((he = gethostbyname(host)) == NULL) {
- _netdb_seterr(h_errno);
- return -1;
- }
-
- if (verbose)
- _fetch_info("connecting to %s:%d", host, port);
-
- /* set up socket address structure */
- bzero(&sin, sizeof(sin));
- bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length);
- sin.sin_family = he->h_addrtype;
- sin.sin_port = htons(port);
-
- /* try to connect */
- if ((sd = socket(sin.sin_family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- _fetch_syserr();
- return -1;
- }
- if (connect(sd, (struct sockaddr *)&sin, sizeof sin) == -1) {
- _fetch_syserr();
- close(sd);
- return -1;
- }
-
- return sd;
-}
-
-
-/*** Directory-related utility functions *************************************/
-
-int
-_fetch_add_entry(struct url_ent **p, int *size, int *len,
- char *name, struct url_stat *stat)
-{
- struct url_ent *tmp;
-
- if (*p == NULL) {
-#define INITIAL_SIZE 8
- if ((*p = malloc(INITIAL_SIZE * sizeof **p)) == NULL) {
- errno = ENOMEM;
- _fetch_syserr();
- return -1;
- }
- *size = INITIAL_SIZE;
- *len = 0;
-#undef INITIAL_SIZE
- }
-
- if (*len >= *size - 1) {
- tmp = realloc(*p, *size * 2 * sizeof **p);
- if (tmp == NULL) {
- errno = ENOMEM;
- _fetch_syserr();
- return -1;
- }
- *size *= 2;
- *p = tmp;
- }
-
- tmp = *p + *len;
- snprintf(tmp->name, MAXPATHLEN, "%s", name);
- bcopy(stat, &tmp->stat, sizeof *stat);
-
- (*len)++;
- (++tmp)->name[0] = 0;
-
- return 0;
-}
diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
deleted file mode 100644
index 0a1154885b78..000000000000
--- a/lib/libfetch/common.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * 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
- * in this position and unchanged.
- * 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
- *
- * 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.
- *
- * $Id: common.h,v 1.4 1998/12/18 14:32:48 des Exp $
- */
-
-#ifndef _COMMON_H_INCLUDED
-#define _COMMON_H_INCLUDED
-
-/* Structure used for error message lists */
-#define ERRCAT_
-struct fetcherr {
- const int num, cat;
- const char *string;
-};
-
-void _fetch_seterr(struct fetcherr *, int);
-void _fetch_syserr(void);
-int _fetch_info(char *fmt, ...);
-int _fetch_connect(char *, int, int);
-int _fetch_add_entry(struct url_ent **p, int *size, int *len,
- char *name, struct url_stat *stat);
-
-#define _ftp_seterr(n) _fetch_seterr(_ftp_errlist, n)
-#define _http_seterr(n) _fetch_seterr(_http_errlist, n)
-#define _netdb_seterr(n) _fetch_seterr(_netdb_errlist, n)
-#define _url_seterr(n) _fetch_seterr(_url_errlist, n)
-
-#ifndef NDEBUG
-#define DEBUG(x) do x; while (0)
-#else
-#define DEBUG(x) do { } while (0)
-#endif
-
-#endif
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 16dec553ecfc..c23d0677b827 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: fetch.3,v 1.6 1998/12/16 15:29:03 des Exp $
+.\" $Id: fetch.3,v 1.1.1.1 1998/07/09 16:52:43 des Exp $
.\"
.Dd July 1, 1998
.Dt FETCH 3
@@ -30,74 +30,44 @@
.Sh NAME
.Nm fetchGetURL ,
.Nm fetchPutURL ,
-.Nm fetchStatURL ,
-.Nm fetchListURL ,
.Nm fetchParseURL ,
+.Nm fetchFreeURL ,
.Nm fetchGet ,
.Nm fetchPut ,
-.Nm fetchStat ,
-.Nm fetchList ,
.Nm fetchGetFile ,
.Nm fetchPutFile ,
-.Nm fetchStatFile ,
-.Nm fetchListFile ,
.Nm fetchGetHTTP ,
.Nm fetchPutHTTP ,
-.Nm fetchStatHTTP ,
-.Nm fetchListHTTP ,
.Nm fetchGetFTP ,
.Nm fetchPutFTP
-.Nm fetchStatFTP
-.Nm fetchListFTP ,
.Nd file transfer library
.Sh SYNOPSIS
-.Fd #include <sys/param.h>
-.Fd #include <stdio.h>
.Fd #include <fetch.h>
.Ft FILE *
.Fn fetchGetURL "char *URL" "char *flags"
.Ft FILE *
.Fn fetchPutURL "char *URL" "char *flags"
-.Ft int
-.Fn fetchStatURL "char *URL" "struct url_stat *us" "char *flags"
-.Ft struct url_ent *
-.Fn fetchListURL "char *URL" "char *flags"
-.Ft struct url *
+.Ft url_t *
.Fn fetchParseURL "char *URL" "char *flags"
+.Ft void
+.Fn fetchFreeURL "url_t *u"
.Ft FILE *
-.Fn fetchGet "struct url *URL" "char *flags"
+.Fn fetchGet "url_t *URL" "char *flags"
.Ft FILE *
-.Fn fetchPut "struct url *URL" "char *flags"
-.Ft int
-.Fn fetchStat "struct url *URL" "struct url_stat *us" "char *flags"
-.Ft struct url_ent *
-.Fn fetchList "struct url *" "char *flags"
+.Fn fetchPut "url_t *URL" "char *flags"
.Ft FILE *
-.Fn fetchGetFile "struct url *u" "char *flags"
+.Fn fetchGetFile "url_t *u" "char *flags"
.Ft FILE *
-.Fn fetchPutFile "struct url *u" "char *flags"
-.Ft int
-.Fn fetchStatFile "struct url *URL" "struct url_stat *us" "char *flags"
-.Ft struct url_ent *
-.Fn fetchListFile "struct url *" "char *flags"
+.Fn fetchPutFile "url_t *u" "char *flags"
.Ft FILE *
-.Fn fetchGetHTTP "struct url *u" "char *flags"
+.Fn fetchGetHTTP "url_t *u" "char *flags"
.Ft FILE *
-.Fn fetchPutHTTP "struct url *u" "char *flags"
-.Ft int
-.Fn fetchStatHTTP "struct url *URL" "struct url_stat *us" "char *flags"
-.Ft struct url_ent *
-.Fn fetchListHTTP "struct url *" "char *flags"
+.Fn fetchPutHTTP "url_t *u" "char *flags"
.Ft FILE *
-.Fn fetchGetFTP "struct url *u" "char *flags"
+.Fn fetchGetFTP "url_t *u" "char *flags"
.Ft FILE *
-.Fn fetchPutFTP "struct url *u" "char *flags"
-.Ft int
-.Fn fetchStatFTP "struct url *URL" "struct url_stat *us" "char *flags"
-.Ft struct url_ent *
-.Fn fetchListFTP "struct url *" "char *flags"
+.Fn fetchPutFTP "url_t *u" "char *flags"
.Sh DESCRIPTION
-.Pp
These functions implement a high-level library for retrieving and
uploading files using Uniform Resource Locators (URLs).
.Pp
@@ -114,42 +84,6 @@ argument is a string of characters which specify transfer options. The
meaning of the individual flags is scheme-dependent, and is detailed
in the appropriate section below.
.Pp
-.Fn fetchStatURL
-attempts to obtain the requested document's metadata and fill in the
-structure pointed to by it's second argument. The
-.Fa url_stat
-structure is defined as follows in
-.Aq Pa fetch.h :
-.Bd -literal
-struct url_stat {
- off_t size;
- time_t atime;
- time_t mtime;
-};
-.Ed
-.Pp
-.Fn fetchListURL
-attempts to list the contents of the directory pointed to by the URL
-provided. If successful, it returns a malloced array of
-.Fa url_ent
-structures. The
-.Fa url_ent
-structure is defined as follows in
-.Aq Pa fetch.h :
-.Bd -literal
-struct url_ent {
- char name[MAXPATHLEN];
- struct url_stat stat;
-};
-.Ed
-.Pp
-The list is terminated by an entry with an empty name.
-.Pp
-The pointer returned by
-.Fn fetchListURL
-should be freed using
-.Fn free .
-.Pp
.Fn fetchParseURL
takes a URL in the form of a null-terminated string and splits it into
its components function according to the Common Internet Scheme Syntax
@@ -166,21 +100,19 @@ and <document> components.
The pointer returned by
.Fn fetchParseURL
should be freed using
-.Fn free .
+.Fn fetchFreeURL .
.Pp
-.Fn fetchGet ,
-.Fn fetchPut
+.Fn fetchGet
and
-.Fn fetchStat
+.Fn fetchPut
are similar to
-.Fn fetchGetURL ,
-.Fn fetchPutURL
+.Fn fetchGetURL
and
-.Fn fetchStatURL ,
+.Fn fetchPutURL ,
except that they expect a pre-parsed URL in the form of a pointer to
-a
-.Fa struct url
-rather than a string.
+an
+.Fa url_t
+structure rather than a string.
.Pp
All of the
.Fn fetchGetXXX
@@ -244,66 +176,18 @@ is currently unimplemented.
.Sh RETURN VALUES
.Fn fetchParseURL
returns a pointer to a
-.Fa struct url
-containing the individual components of the URL. If it is
+.Fa url_t
+structure containing the individual components of the URL. If it is
unable to allocate memory, or the URL is syntactically incorrect,
.Fn fetchParseURL
returns a NULL pointer.
.Pp
-The
-.Fn fetchStat
-functions return 0 on success and -1 on failure.
+.Fn fetchFreeURL
+does not return any value.
.Pp
All other functions return a stream pointer which may be used to
-access the requested document, or NULL if an error occurred.
-.Pp
-.Nm Libfetch
-uses the Common Error Library
-.Nm ( libcom_err )
-to report errors. The error code passed to
-.Fn com_err
-is one of:
-.Bl -tag -width Er
-.It Bq Er FETCH_ABORT
-Operation aborted
-.It Bq Er FETCH_AUTH
-Authentication failed
-.It Bq Er FETCH_DOWN
-Service unavailable
-.It Bq Er FETCH_EXISTS
-File exists
-.It Bq Er FETCH_FULL
-File system full
-.It Bq Er FETCH_INFO
-Informational response
-.It Bq Er FETCH_MEMORY
-Insufficient memory
-.It Bq Er FETCH_MOVED
-File has moved
-.It Bq Er FETCH_NETWORK
-Network error
-.It Bq Er FETCH_OK
-No error
-.It Bq Er FETCH_PROTO
-Protocol error
-.It Bq Er FETCH_RESOLV
-Resolver error
-.It Bq Er FETCH_SERVER
-Server error
-.It Bq Er FETCH_TEMP
-Temporary error
-.It Bq Er FETCH_TIMEOUT
-Operation timed out
-.It Bq Er FETCH_UNAVAIL
-File is not available
-.It Bq Er FETCH_UNKNOWN
-Unknown error
-.It Bq Er FETCH_URL
-Invalid URL
-.El
-.Pp
-The accompanying error message includes a protocol-specific error code
-and message, e.g. "File is not available (404 Not Found)"
+access the requested document. Upon failure of any kind, they return a
+NULL pointer.
.Sh ENVIRONMENT
The FTP and HTTP related functions use the
.Ev HTTP_PROXY
@@ -312,7 +196,6 @@ and
environment variables, respectively, as the address of a proxy server
to use for transferring files.
.Sh SEE ALSO
-.Xr com_err 3 ,
.Xr fetch 1 ,
.Xr ftpio 3
.Rs
@@ -333,14 +216,13 @@ to use for transferring files.
.%B File Transfer Protocol
.%O RFC959
.Re
+.Sh DIAGNOSTICS
+Add later.
.Sh NOTES
-The
-.Nm fetch
-library uses the Common Error library, and applications which link
-with
-.Nm libfetch
-must therefore also link with
-.Nm libcom_err .
+Some parts of the library are not yet implemented. The most notable
+examples of this are
+.Fn fetchPutHTTP
+and proxy support for the FTP access method.
.Sh HISTORY
The
.Nm fetch
@@ -352,27 +234,18 @@ The
library was mostly written by
.An Dag-Erling Coïdan Smørgrav Aq des@FreeBSD.org
with numerous suggestions from
-.An Jordan K. Hubbard Aq jkh@FreeBSD.org ,
-.An Eugene Skepner Aq eu@qub.com
+.An Jordan K. Hubbard Aq jkh@FreeBSD.org
and other FreeBSD developers.
-It replaces the older
+It incorporates the older
.Nm ftpio
-library written by
-.An Poul-Henning Kamp Aq pkh@FreeBSD.org
-and
+library, which was originally written by
+.Nm Poul-Henning Kamp Aq pkh@FreeBSD.org
+and later turned inside out by
.An Jordan K. Hubbard Aq jkh@FreeBSD.org .
.Pp
This manual page was written by
.An Dag-Erling Coïdan Smørgrav Aq des@FreeBSD.org
.Sh BUGS
-Some parts of the library are not yet implemented. The most notable
-examples of this are
-.Fn fetchPutHTTP ,
-.Fn fetchStatHTTP ,
-.Fn fetchListHTTP ,
-.Fn fetchListFTP ,
-and FTP proxy support.
-.Pp
There's no way to select a proxy at run-time other than setting the
.Ev HTTP_PROXY
or
@@ -386,21 +259,6 @@ code; as far as I can determine,
.Nm libfetch
handles HTTP/1.1 basic authentication correctly as outlined in
RFC2068, but I haven't been able to find an HTTP server that honors
-the Authentication: header field. Also,
-.Nm libfetch
-does not attempt to interpret and respond to authentication requests
-from the HTTP server.
-.Pp
-No attempt is made to encode spaces etc. within URLs. Spaces in the
-document part of an URLshould be replaced with "%20" in HTTP URLs and
-"\\ " in FTP URLs.
-.Pp
-Error numbers are unique only within a certain context; the error
-codes used for FTP and HTTP overlap, as do those used for resolver and
-system errors. For instance, error code 202 means "Command not
-implemented, superfluous at this site" in an FTP context and
-"Accepted" in an HTTP context.
-.Pp
-The man page is poorly written and produces badly formatted text.
+the Authentication: header field.
.Pp
Tons of other stuff.
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index d8d2443787ce..54421a25b1ef 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -25,48 +25,34 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: fetch.c,v 1.7 1998/12/16 10:24:54 des Exp $
+ * $Id: fetch.c,v 1.3 1998/07/11 21:29:07 des Exp $
*/
#include <sys/param.h>
-#include <sys/errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <ctype.h>
+#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "fetch.h"
-#include "common.h"
+#ifndef NDEBUG
+#define DEBUG(x) do x; while (0)
+#else
+#define DEBUG(x) do { } while (0)
+#endif
int fetchLastErrCode;
+const char *fetchLastErrText;
-
-/*** Local data **************************************************************/
-
-/*
- * Error messages for parser errors
- */
-#define URL_MALFORMED 1
-#define URL_BAD_SCHEME 2
-#define URL_BAD_PORT 3
-static struct fetcherr _url_errlist[] = {
- { URL_MALFORMED, FETCH_URL, "Malformed URL" },
- { URL_BAD_SCHEME, FETCH_URL, "Invalid URL scheme" },
- { URL_BAD_PORT, FETCH_URL, "Invalid server port" },
- { -1, FETCH_UNKNOWN, "Unknown parser error" }
-};
-
-
-/*** Public API **************************************************************/
-
-/*
- * Select the appropriate protocol for the URL scheme, and return a
- * read-only stream connected to the document referenced by the URL.
- */
FILE *
-fetchGet(struct url *URL, char *flags)
+fetchGet(url_t *URL, char *flags)
{
if (strcasecmp(URL->scheme, "file") == 0)
return fetchGetFile(URL, flags);
@@ -74,18 +60,12 @@ fetchGet(struct url *URL, char *flags)
return fetchGetHTTP(URL, flags);
else if (strcasecmp(URL->scheme, "ftp") == 0)
return fetchGetFTP(URL, flags);
- else {
- _url_seterr(URL_BAD_SCHEME);
- return NULL;
- }
+ else return NULL;
+
}
-/*
- * Select the appropriate protocol for the URL scheme, and return a
- * write-only stream connected to the document referenced by the URL.
- */
FILE *
-fetchPut(struct url *URL, char *flags)
+fetchPut(url_t *URL, char *flags)
{
if (strcasecmp(URL->scheme, "file") == 0)
return fetchPutFile(URL, flags);
@@ -93,57 +73,14 @@ fetchPut(struct url *URL, char *flags)
return fetchPutHTTP(URL, flags);
else if (strcasecmp(URL->scheme, "ftp") == 0)
return fetchPutFTP(URL, flags);
- else {
- _url_seterr(URL_BAD_SCHEME);
- return NULL;
- }
-}
-
-/*
- * Select the appropriate protocol for the URL scheme, and return the
- * size of the document referenced by the URL if it exists.
- */
-int
-fetchStat(struct url *URL, struct url_stat *us, char *flags)
-{
- if (strcasecmp(URL->scheme, "file") == 0)
- return fetchStatFile(URL, us, flags);
- else if (strcasecmp(URL->scheme, "http") == 0)
- return fetchStatHTTP(URL, us, flags);
- else if (strcasecmp(URL->scheme, "ftp") == 0)
- return fetchStatFTP(URL, us, flags);
- else {
- _url_seterr(URL_BAD_SCHEME);
- return -1;
- }
-}
-
-/*
- * Select the appropriate protocol for the URL scheme, and return a
- * list of files in the directory pointed to by the URL.
- */
-struct url_ent *
-fetchList(struct url *URL, char *flags)
-{
- if (strcasecmp(URL->scheme, "file") == 0)
- return fetchListFile(URL, flags);
- else if (strcasecmp(URL->scheme, "http") == 0)
- return fetchListHTTP(URL, flags);
- else if (strcasecmp(URL->scheme, "ftp") == 0)
- return fetchListFTP(URL, flags);
- else {
- _url_seterr(URL_BAD_SCHEME);
- return NULL;
- }
+ else return NULL;
}
-/*
- * Attempt to parse the given URL; if successful, call fetchGet().
- */
+/* get URL */
FILE *
fetchGetURL(char *URL, char *flags)
{
- struct url *u;
+ url_t *u;
FILE *f;
if ((u = fetchParseURL(URL)) == NULL)
@@ -151,18 +88,16 @@ fetchGetURL(char *URL, char *flags)
f = fetchGet(u, flags);
- free(u);
+ fetchFreeURL(u);
return f;
}
-/*
- * Attempt to parse the given URL; if successful, call fetchPut().
- */
+/* put URL */
FILE *
fetchPutURL(char *URL, char *flags)
{
- struct url *u;
+ url_t *u;
FILE *f;
if ((u = fetchParseURL(URL)) == NULL)
@@ -170,73 +105,32 @@ fetchPutURL(char *URL, char *flags)
f = fetchPut(u, flags);
- free(u);
+ fetchFreeURL(u);
return f;
}
/*
- * Attempt to parse the given URL; if successful, call fetchStat().
- */
-int
-fetchStatURL(char *URL, struct url_stat *us, char *flags)
-{
- struct url *u;
- int s;
-
- if ((u = fetchParseURL(URL)) == NULL)
- return -1;
-
- s = fetchStat(u, us, flags);
-
- free(u);
- return s;
-}
-
-/*
- * Attempt to parse the given URL; if successful, call fetchList().
- */
-struct url_ent *
-fetchListURL(char *URL, char *flags)
-{
- struct url *u;
- struct url_ent *ue;
-
- if ((u = fetchParseURL(URL)) == NULL)
- return NULL;
-
- ue = fetchList(u, flags);
-
- free(u);
- return ue;
-}
-
-/*
* Split an URL into components. URL syntax is:
* method:[//[user[:pwd]@]host[:port]]/[document]
* This almost, but not quite, RFC1738 URL syntax.
*/
-struct url *
+url_t *
fetchParseURL(char *URL)
{
char *p, *q;
- struct url *u;
+ url_t *u;
int i;
- /* allocate struct url */
- if ((u = calloc(1, sizeof(struct url))) == NULL) {
- errno = ENOMEM;
- _fetch_syserr();
+ /* allocate url_t */
+ if ((u = calloc(1, sizeof(url_t))) == NULL)
return NULL;
- }
/* scheme name */
for (i = 0; *URL && (*URL != ':'); URL++)
if (i < URL_SCHEMELEN)
u->scheme[i++] = *URL;
- if (!URL[0] || (URL[1] != '/')) {
- _url_seterr(URL_BAD_SCHEME);
+ if (!URL[0] || (URL[1] != '/'))
goto ouch;
- }
else URL++;
if (URL[1] != '/') {
p = URL;
@@ -245,7 +139,7 @@ fetchParseURL(char *URL)
else URL += 2;
p = strpbrk(URL, "/@");
- if (p && *p == '@') {
+ if (*p == '@') {
/* username */
for (q = URL, i = 0; (*q != ':') && (*q != '@'); q++)
if (i < URL_USERLEN)
@@ -270,31 +164,18 @@ fetchParseURL(char *URL)
for (q = ++p; *q && (*q != '/'); q++)
if (isdigit(*q))
u->port = u->port * 10 + (*q - '0');
- else {
- /* invalid port */
- _url_seterr(URL_BAD_PORT);
- goto ouch;
- }
+ else return 0; /* invalid port */
while (*p && (*p != '/'))
p++;
}
nohost:
/* document */
- if (*p) {
- struct url *t;
- t = realloc(u, sizeof(*u)+strlen(p)-1);
- if (t == NULL) {
- errno = ENOMEM;
- _fetch_syserr();
- goto ouch;
- }
- u = t;
- strcpy(u->doc, p);
- } else {
- u->doc[0] = '/';
- u->doc[1] = 0;
- }
+ if (*p)
+ u->doc = strdup(p);
+ u->doc = strdup(*p ? p : "/");
+ if (!u->doc)
+ goto ouch;
DEBUG(fprintf(stderr,
"scheme: [\033[1m%s\033[m]\n"
@@ -312,3 +193,45 @@ ouch:
free(u);
return NULL;
}
+
+void
+fetchFreeURL(url_t *u)
+{
+ if (u) {
+ if (u->doc)
+ free(u->doc);
+ free(u);
+ }
+}
+
+int
+fetchConnect(char *host, int port)
+{
+ struct sockaddr_in sin;
+ struct hostent *he;
+ int sd;
+
+#ifndef NDEBUG
+ fprintf(stderr, "\033[1m---> %s:%d\033[m\n", host, port);
+#endif
+
+ /* look up host name */
+ if ((he = gethostbyname(host)) == NULL)
+ return -1;
+
+ /* set up socket address structure */
+ bzero(&sin, sizeof(sin));
+ bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length);
+ sin.sin_family = he->h_addrtype;
+ sin.sin_port = htons(port);
+
+ /* try to connect */
+ if ((sd = socket(sin.sin_family, SOCK_STREAM, IPPROTO_TCP)) == -1)
+ return -1;
+ if (connect(sd, (struct sockaddr *)&sin, sizeof sin) == -1) {
+ close(sd);
+ return -1;
+ }
+
+ return sd;
+}
diff --git a/lib/libfetch/fetch.h b/lib/libfetch/fetch.h
index 2e33245503cc..377edad2acc8 100644
--- a/lib/libfetch/fetch.h
+++ b/lib/libfetch/fetch.h
@@ -25,13 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: fetch.h,v 1.7 1998/12/16 10:24:55 des Exp $
+ * $Id: fetch.h,v 1.3 1998/07/11 21:29:08 des Exp $
*/
#ifndef _FETCH_H_INCLUDED
#define _FETCH_H_INCLUDED
-#include <fetch_err.h>
+#include <sys/param.h>
+#include <stdio.h>
#define _LIBFETCH_VER "libfetch/1.0"
@@ -39,57 +40,41 @@
#define URL_USERLEN 256
#define URL_PWDLEN 256
-struct url {
- char scheme[URL_SCHEMELEN+1];
- char user[URL_USERLEN+1];
- char pwd[URL_PWDLEN+1];
- char host[MAXHOSTNAMELEN+1];
- int port;
- char doc[2];
+struct url_s {
+ char scheme[URL_SCHEMELEN+1];
+ char user[URL_USERLEN+1];
+ char pwd[URL_PWDLEN+1];
+ char host[MAXHOSTNAMELEN+1];
+ char *doc;
+ int port;
};
-struct url_stat {
- off_t size;
- time_t atime;
- time_t mtime;
-};
-
-struct url_ent {
- char name[MAXPATHLEN];
- struct url_stat stat;
-};
+typedef struct url_s url_t;
/* FILE-specific functions */
-FILE *fetchGetFile(struct url *, char *);
-FILE *fetchPutFile(struct url *, char *);
-int fetchStatFile(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListFile(struct url *, char *);
+FILE *fetchGetFile(url_t *, char *);
+FILE *fetchPutFile(url_t *, char *);
/* HTTP-specific functions */
-char *fetchContentType(FILE *);
-FILE *fetchGetHTTP(struct url *, char *);
-FILE *fetchPutHTTP(struct url *, char *);
-int fetchStatHTTP(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListHTTP(struct url *, char *);
+char *fetchContentType(FILE *);
+FILE *fetchGetHTTP(url_t *, char *);
+FILE *fetchPutHTTP(url_t *, char *);
/* FTP-specific functions */
-FILE *fetchGetFTP(struct url *, char *);
-FILE *fetchPutFTP(struct url *, char *);
-int fetchStatFTP(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListFTP(struct url *, char *);
+FILE *fetchGetFTP(url_t *, char *);
+FILE *fetchPutFTP(url_t *, char *);
/* Generic functions */
-struct url *fetchParseURL(char *);
-FILE *fetchGetURL(char *, char *);
-FILE *fetchPutURL(char *, char *);
-int fetchStatURL(char *, struct url_stat *, char *);
-struct url_ent *fetchListURL(char *, char *);
-FILE *fetchGet(struct url *, char *);
-FILE *fetchPut(struct url *, char *);
-int fetchStat(struct url *, struct url_stat *, char *);
-struct url_ent *fetchList(struct url *, char *);
+int fetchConnect(char *, int);
+url_t *fetchParseURL(char *);
+void fetchFreeURL(url_t *);
+FILE *fetchGetURL(char *, char *);
+FILE *fetchPutURL(char *, char *);
+FILE *fetchGet(url_t *, char *);
+FILE *fetchPut(url_t *, char *);
-/* Last error code */
-extern int fetchLastErrCode;
+/* Error code and string */
+extern int fetchLastErrCode;
+extern const char *fetchLastErrText;
#endif
diff --git a/lib/libfetch/fetch_err.et b/lib/libfetch/fetch_err.et
deleted file mode 100644
index 2e247a6006aa..000000000000
--- a/lib/libfetch/fetch_err.et
+++ /dev/null
@@ -1,50 +0,0 @@
-#-
-# Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
-# 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
-# in this position and unchanged.
-# 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
-#
-# 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.
-#
-# $Id: fetch_err.et,v 1.1 1998/11/06 22:14:08 des Exp $
-#
-et ftch
- ec FETCH_ABORT, "Operation aborted"
- ec FETCH_AUTH, "Authentication failed"
- ec FETCH_DOWN, "Service unavailable"
- ec FETCH_EXISTS, "File exists"
- ec FETCH_FULL, "File system full"
- ec FETCH_INFO, "Informational response"
- ec FETCH_MEMORY, "Insufficient memory"
- ec FETCH_MOVED, "File has moved"
- ec FETCH_NETWORK, "Network error"
- ec FETCH_OK, "No error"
- ec FETCH_PROTO, "Protocol error"
- ec FETCH_RESOLV, "Resolver error"
- ec FETCH_SERVER, "Server error"
- ec FETCH_TEMP, "Temporary error"
- ec FETCH_TIMEOUT, "Operation timed out"
- ec FETCH_UNAVAIL, "File is not available"
- ec FETCH_UNKNOWN, "Unknown error"
- ec FETCH_URL, "Invalid URL"
- ec FETCH_VERBOSE, ""
-end
diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c
index 15cb043f52b1..0c685ef34f81 100644
--- a/lib/libfetch/file.c
+++ b/lib/libfetch/file.c
@@ -25,98 +25,25 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: file.c,v 1.3 1998/12/16 10:24:55 des Exp $
+ * $Id$
*/
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include "fetch.h"
-#include "common.h"
FILE *
-fetchGetFile(struct url *u, char *flags)
+fetchGetFile(url_t *u, char *flags)
{
- FILE *f;
-
- f = fopen(u->doc, "r");
-
- if (f == NULL)
- _fetch_syserr();
- return f;
+ flags = flags; /* unused */
+ return fopen(u->doc, "r");
}
FILE *
-fetchPutFile(struct url *u, char *flags)
+fetchPutFile(url_t *u, char *flags)
{
- FILE *f;
-
if (strchr(flags, 'a'))
- f = fopen(u->doc, "a");
- else
- f = fopen(u->doc, "w");
-
- if (f == NULL)
- _fetch_syserr();
- return f;
-}
-
-static int
-_fetch_stat_file(char *fn, struct url_stat *us)
-{
- struct stat sb;
-
- if (stat(fn, &sb) == -1) {
- _fetch_syserr();
- return -1;
- }
- us->size = sb.st_size;
- us->atime = sb.st_atime;
- us->mtime = sb.st_mtime;
- return 0;
-}
-
-int
-fetchStatFile(struct url *u, struct url_stat *us, char *flags)
-{
- return _fetch_stat_file(u->doc, us);
-}
-
-struct url_ent *
-fetchListFile(struct url *u, char *flags)
-{
- DIR *dir;
- struct dirent *de;
- struct url_stat us;
- struct url_ent *ue;
- int size, len;
- char fn[MAXPATHLEN], *p;
- int l;
-
- if ((dir = opendir(u->doc)) == NULL) {
- _fetch_syserr();
- return NULL;
- }
-
- ue = NULL;
- strncpy(fn, u->doc, sizeof fn - 2);
- fn[sizeof fn - 2] = 0;
- strcat(fn, "/");
- p = strchr(fn, 0);
- l = sizeof fn - strlen(fn) - 1;
-
- while ((de = readdir(dir)) != NULL) {
- strncpy(p, de->d_name, l - 1);
- p[l - 1] = 0;
- if (_fetch_stat_file(fn, &us) == -1)
- /* should I return a partial result, or abort? */
- break;
- _fetch_add_entry(&ue, &size, &len, de->d_name, &us);
- }
-
- return ue;
+ return fopen(u->doc, "a");
+ else return fopen(u->doc, "w");
}
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 10e27b45ae93..d66b7c3f7494 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ftp.c,v 1.11 1998/12/18 14:32:48 des Exp $
+ * $Id: ftp.c,v 1.4 1998/07/12 22:34:39 des Exp $
*/
/*
@@ -55,30 +55,30 @@
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <sys/errno.h>
#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "fetch.h"
-#include "common.h"
-#include "ftperr.h"
+#include "ftperr.c"
+#define FTP_DEFAULT_TO_ANONYMOUS
#define FTP_ANONYMOUS_USER "ftp"
#define FTP_ANONYMOUS_PASSWORD "ftp"
#define FTP_DEFAULT_PORT 21
#define FTP_OPEN_DATA_CONNECTION 150
#define FTP_OK 200
-#define FTP_FILE_STATUS 213
-#define FTP_SERVICE_READY 220
#define FTP_PASSIVE_MODE 227
#define FTP_LOGGED_IN 230
#define FTP_FILE_ACTION_OK 250
@@ -87,44 +87,84 @@
#define ENDL "\r\n"
-static struct url cached_host;
+static url_t cached_host;
static FILE *cached_socket;
-static char _ftp_last_reply[1024];
+static char *_ftp_last_reply;
+
+/*
+ * Map error code to string
+ */
+static const char *
+_ftp_errstring(int e)
+{
+ struct ftperr *p = _ftp_errlist;
+
+ while ((p->num != -1) && (p->num != e))
+ p++;
+
+ return p->string;
+}
+
+/*
+ * Set error code
+ */
+static void
+_ftp_seterr(int e)
+{
+ fetchLastErrCode = e;
+ fetchLastErrText = _ftp_errstring(e);
+}
+
+/*
+ * Set error code according to errno
+ */
+static void
+_ftp_syserr(void)
+{
+ fetchLastErrCode = errno;
+ fetchLastErrText = strerror(errno);
+}
/*
* Get server response, check that first digit is a '2'
*/
static int
-_ftp_chkerr(FILE *s)
+_ftp_chkerr(FILE *s, int *e)
{
char *line;
size_t len;
+ if (e)
+ *e = 0;
+
do {
if (((line = fgetln(s, &len)) == NULL) || (len < 4)) {
- _fetch_syserr();
+ _ftp_syserr();
return -1;
}
- } while (len >= 4 && line[3] == '-');
+ } while (line[3] == '-');
- while (len && isspace(line[len-1]))
- len--;
- snprintf(_ftp_last_reply, sizeof(_ftp_last_reply),
- "%*.*s", (int)len, (int)len, line);
+ _ftp_last_reply = line;
#ifndef NDEBUG
fprintf(stderr, "\033[1m<<< ");
- fprintf(stderr, "%*.*s\n", (int)len, (int)len, line);
+ fprintf(stderr, "%*.*s", (int)len, (int)len, line);
fprintf(stderr, "\033[m");
#endif
- if (len < 4 || !isdigit(line[1]) || !isdigit(line[1])
+ if (!isdigit(line[1]) || !isdigit(line[1])
|| !isdigit(line[2]) || (line[3] != ' ')) {
+ _ftp_seterr(-1);
return -1;
}
- return (line[0] - '0') * 100 + (line[1] - '0') * 10 + (line[2] - '0');
+ _ftp_seterr((line[0] - '0') * 100 + (line[1] - '0') * 10 + (line[2] - '0'));
+
+ if (e)
+ *e = fetchLastErrCode;
+
+ return (line[0] == '2') - 1;
}
/*
@@ -134,6 +174,7 @@ static int
_ftp_cmd(FILE *f, char *fmt, ...)
{
va_list ap;
+ int e;
va_start(ap, fmt);
vfprintf(f, fmt, ap);
@@ -144,7 +185,8 @@ _ftp_cmd(FILE *f, char *fmt, ...)
#endif
va_end(ap);
- return _ftp_chkerr(f);
+ _ftp_chkerr(f, &e);
+ return e;
}
/*
@@ -154,31 +196,28 @@ static FILE *
_ftp_transfer(FILE *cf, char *oper, char *file, char *mode, int pasv)
{
struct sockaddr_in sin;
- int e, sd = -1, l;
+ int sd = -1, l;
char *s;
FILE *df;
/* change directory */
if (((s = strrchr(file, '/')) != NULL) && (s != file)) {
*s = 0;
- if ((e = _ftp_cmd(cf, "CWD %s" ENDL, file)) != FTP_FILE_ACTION_OK) {
+ if (_ftp_cmd(cf, "CWD %s" ENDL, file) != FTP_FILE_ACTION_OK) {
*s = '/';
- _ftp_seterr(e);
return NULL;
}
*s++ = '/';
} else {
- if ((e = _ftp_cmd(cf, "CWD /" ENDL)) != FTP_FILE_ACTION_OK) {
- _ftp_seterr(e);
+ if (_ftp_cmd(cf, "CWD /" ENDL) != FTP_FILE_ACTION_OK)
return NULL;
- }
}
/* s now points to file name */
/* open data socket */
if ((sd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- _fetch_syserr();
+ _ftp_syserr();
return NULL;
}
@@ -188,7 +227,7 @@ _ftp_transfer(FILE *cf, char *oper, char *file, char *mode, int pasv)
int i;
/* send PASV command */
- if ((e = _ftp_cmd(cf, "PASV" ENDL)) != FTP_PASSIVE_MODE)
+ if (_ftp_cmd(cf, "PASV" ENDL) != FTP_PASSIVE_MODE)
goto ouch;
/* find address and port number. The reply to the PASV command
@@ -213,8 +252,7 @@ _ftp_transfer(FILE *cf, char *oper, char *file, char *mode, int pasv)
goto sysouch;
/* make the server initiate the transfer */
- e = _ftp_cmd(cf, "%s %s" ENDL, oper, s);
- if (e != FTP_OPEN_DATA_CONNECTION)
+ if (_ftp_cmd(cf, "%s %s" ENDL, oper, s) != FTP_OPEN_DATA_CONNECTION)
goto ouch;
} else {
@@ -237,16 +275,13 @@ _ftp_transfer(FILE *cf, char *oper, char *file, char *mode, int pasv)
goto sysouch;
a = ntohl(sin.sin_addr.s_addr);
p = ntohs(sin.sin_port);
- e = _ftp_cmd(cf, "PORT %d,%d,%d,%d,%d,%d" ENDL,
- (a >> 24) & 0xff, (a >> 16) & 0xff,
- (a >> 8) & 0xff, a & 0xff,
- (p >> 8) & 0xff, p & 0xff);
- if (e != FTP_OK)
+ if (_ftp_cmd(cf, "PORT %d,%d,%d,%d,%d,%d" ENDL,
+ (a >> 24) & 0xff, (a >> 16) & 0xff, (a >> 8) & 0xff, a & 0xff,
+ (p >> 8) & 0xff, p & 0xff) != FTP_OK)
goto ouch;
/* make the server initiate the transfer */
- e = _ftp_cmd(cf, "%s %s" ENDL, oper, s);
- if (e != FTP_OPEN_DATA_CONNECTION)
+ if (_ftp_cmd(cf, "%s %s" ENDL, oper, s) != FTP_OPEN_DATA_CONNECTION)
goto ouch;
/* accept the incoming connection and go to town */
@@ -261,12 +296,8 @@ _ftp_transfer(FILE *cf, char *oper, char *file, char *mode, int pasv)
return df;
sysouch:
- _fetch_syserr();
- close(sd);
- return NULL;
-
+ _ftp_syserr();
ouch:
- _ftp_seterr(e);
close(sd);
return NULL;
}
@@ -275,7 +306,7 @@ ouch:
* Log on to FTP server
*/
static FILE *
-_ftp_connect(char *host, int port, char *user, char *pwd, int verbose)
+_ftp_connect(char *host, int port, char *user, char *pwd)
{
int sd, e, pp = FTP_DEFAULT_PORT;
char *p, *q;
@@ -289,29 +320,28 @@ _ftp_connect(char *host, int port, char *user, char *pwd, int verbose)
}
if (q)
*q = 0;
- sd = _fetch_connect(p, pp, verbose);
+ sd = fetchConnect(p, pp);
if (q)
*q = ':';
} else {
/* no proxy, go straight to target */
- sd = _fetch_connect(host, port, verbose);
+ sd = fetchConnect(host, port);
}
/* check connection */
if (sd == -1) {
- _fetch_syserr();
+ _ftp_syserr();
return NULL;
}
/* streams make life easier */
if ((f = fdopen(sd, "r+")) == NULL) {
- _fetch_syserr();
- close(sd);
- return NULL;
+ _ftp_syserr();
+ goto ouch;
}
/* expect welcome message */
- if ((e = _ftp_chkerr(f)) != FTP_SERVICE_READY)
+ if (_ftp_chkerr(f, NULL) == -1)
goto fouch;
/* send user name and password */
@@ -329,7 +359,7 @@ _ftp_connect(char *host, int port, char *user, char *pwd, int verbose)
/* did the server request an account? */
if (e == FTP_NEED_ACCOUNT)
- goto fouch;
+ /* help! */ ;
/* we should be done by now */
if (e != FTP_LOGGED_IN)
@@ -337,17 +367,19 @@ _ftp_connect(char *host, int port, char *user, char *pwd, int verbose)
/* might as well select mode and type at once */
#ifdef FTP_FORCE_STREAM_MODE
- if ((e = _ftp_cmd(f, "MODE S" ENDL)) != FTP_OK) /* default is S */
- goto fouch;
+ if (_ftp_cmd(f, "MODE S" ENDL) != FTP_OK) /* default is S */
+ goto ouch;
#endif
- if ((e = _ftp_cmd(f, "TYPE I" ENDL)) != FTP_OK) /* default is A */
- goto fouch;
+ if (_ftp_cmd(f, "TYPE I" ENDL) != FTP_OK) /* default is A */
+ goto ouch;
/* done */
return f;
+ouch:
+ close(sd);
+ return NULL;
fouch:
- _ftp_seterr(e);
fclose(f);
return NULL;
}
@@ -358,7 +390,7 @@ fouch:
static void
_ftp_disconnect(FILE *f)
{
- (void)_ftp_cmd(f, "QUIT" ENDL);
+ _ftp_cmd(f, "QUIT" ENDL);
fclose(f);
}
@@ -366,7 +398,7 @@ _ftp_disconnect(FILE *f)
* Check if we're already connected
*/
static int
-_ftp_isconnected(struct url *url)
+_ftp_isconnected(url_t *url)
{
return (cached_socket
&& (strcmp(url->host, cached_host.host) == 0)
@@ -376,145 +408,53 @@ _ftp_isconnected(struct url *url)
}
/*
- * Check the cache, reconnect if no luck
+ * FTP session
*/
static FILE *
-_ftp_cached_connect(struct url *url, char *flags)
+fetchXxxFTP(url_t *url, char *oper, char *mode, char *flags)
{
- FILE *cf;
+ FILE *cf = NULL;
+ int e;
- cf = NULL;
-
/* set default port */
if (!url->port)
url->port = FTP_DEFAULT_PORT;
- /* try to use previously cached connection */
- if (_ftp_isconnected(url))
- if (_ftp_cmd(cached_socket, "NOOP" ENDL) != -1)
+ /* try to use previously cached connection; there should be a 226 waiting */
+ if (_ftp_isconnected(url)) {
+ _ftp_chkerr(cached_socket, &e);
+ if (e > 0)
cf = cached_socket;
+ }
/* connect to server */
if (!cf) {
- cf = _ftp_connect(url->host, url->port, url->user, url->pwd,
- (strchr(flags, 'v') != NULL));
+ cf = _ftp_connect(url->host, url->port, url->user, url->pwd);
if (!cf)
return NULL;
if (cached_socket)
_ftp_disconnect(cached_socket);
cached_socket = cf;
- memcpy(&cached_host, url, sizeof(struct url));
+ memcpy(&cached_host, url, sizeof(url_t));
}
- return cf;
-}
-
-/*
- * Get file
- */
-FILE *
-fetchGetFTP(struct url *url, char *flags)
-{
- FILE *cf;
-
- /* connect to server */
- if ((cf = _ftp_cached_connect(url, flags)) == NULL)
- return NULL;
-
/* initiate the transfer */
- return _ftp_transfer(cf, "RETR", url->doc, "r",
- (flags && strchr(flags, 'p')));
+ return _ftp_transfer(cf, oper, url->doc, mode, (flags && strchr(flags, 'p')));
}
/*
- * Put file
+ * Itsy bitsy teeny weenie
*/
FILE *
-fetchPutFTP(struct url *url, char *flags)
-{
- FILE *cf;
-
- /* connect to server */
- if ((cf = _ftp_cached_connect(url, flags)) == NULL)
- return NULL;
-
- /* initiate the transfer */
- return _ftp_transfer(cf, (flags && strchr(flags, 'a')) ? "APPE" : "STOR",
- url->doc, "w", (flags && strchr(flags, 'p')));
-}
-
-/*
- * Get file stats
- */
-int
-fetchStatFTP(struct url *url, struct url_stat *us, char *flags)
+fetchGetFTP(url_t *url, char *flags)
{
- FILE *cf;
- char *ln, *s;
- struct tm tm;
- time_t t;
- int e;
-
- /* connect to server */
- if ((cf = _ftp_cached_connect(url, flags)) == NULL)
- return -1;
-
- /* change directory */
- if (((s = strrchr(url->doc, '/')) != NULL) && (s != url->doc)) {
- *s = 0;
- if ((e = _ftp_cmd(cf, "CWD %s" ENDL, url->doc)) != FTP_FILE_ACTION_OK) {
- *s = '/';
- goto ouch;
- }
- *s++ = '/';
- } else {
- if ((e = _ftp_cmd(cf, "CWD /" ENDL)) != FTP_FILE_ACTION_OK)
- goto ouch;
- }
-
- /* s now points to file name */
-
- if (_ftp_cmd(cf, "SIZE %s" ENDL, s) != FTP_FILE_STATUS)
- goto ouch;
- for (ln = _ftp_last_reply + 4; *ln && isspace(*ln); ln++)
- /* nothing */ ;
- for (us->size = 0; *ln && isdigit(*ln); ln++)
- us->size = us->size * 10 + *ln - '0';
- if (*ln && !isspace(*ln)) {
- _ftp_seterr(999); /* XXX should signal a FETCH_PROTO error */
- return -1;
- }
-
- if ((e = _ftp_cmd(cf, "MDTM %s" ENDL, s)) != FTP_FILE_STATUS)
- goto ouch;
- for (ln = _ftp_last_reply + 4; *ln && isspace(*ln); ln++)
- /* nothing */ ;
- t = time(NULL);
- us->mtime = localtime(&t)->tm_gmtoff;
- sscanf(ln, "%04d%02d%02d%02d%02d%02d",
- &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
- &tm.tm_hour, &tm.tm_min, &tm.tm_sec);
- /* XXX should check the return value from sscanf */
- tm.tm_mon--;
- tm.tm_year -= 1900;
- tm.tm_isdst = -1;
- tm.tm_gmtoff = 0;
- us->mtime += mktime(&tm);
- us->atime = us->mtime;
- return 0;
-
-ouch:
- _ftp_seterr(e);
- return -1;
+ return fetchXxxFTP(url, "RETR", "r", flags);
}
-/*
- * List a directory
- */
-extern void warnx(char *, ...);
-struct url_ent *
-fetchListFTP(struct url *url, char *flags)
+FILE *
+fetchPutFTP(url_t *url, char *flags)
{
- warnx("fetchListFTP(): not implemented");
- return NULL;
+ if (flags && strchr(flags, 'a'))
+ return fetchXxxFTP(url, "APPE", "w", flags);
+ else return fetchXxxFTP(url, "STOR", "w", flags);
}
diff --git a/lib/libfetch/ftp.errors b/lib/libfetch/ftp.errors
index d7816d28deda..53a87f04d7b2 100644
--- a/lib/libfetch/ftp.errors
+++ b/lib/libfetch/ftp.errors
@@ -1,44 +1,44 @@
-# $Id: ftp.errors,v 1.1.1.1 1998/07/09 16:52:43 des Exp $
+# $Id: ftp.errors,v 1.3 1997/02/22 15:06:47 peter Exp $
#
# This list is taken from RFC 959.
# It probably needs a going over.
#
-110 OK Restart marker reply
-120 TEMP Service ready in a few minutes
-125 OK Data connection already open; transfer starting
-150 OK File status okay; about to open data connection
-200 OK Command okay
-202 PROTO Command not implemented, superfluous at this site
-211 INFO System status, or system help reply
-212 INFO Directory status
-213 INFO File status
-214 INFO Help message
-215 INFO Set system type
-220 OK Service ready for new user
-221 OK Service closing control connection
-225 OK Data connection open; no transfer in progress
-226 OK Requested file action successful
-227 OK Entering Passive Mode
-230 OK User logged in, proceed
-250 OK Requested file action okay, completed
-257 OK File/directory created
-331 AUTH User name okay, need password
-332 AUTH Need account for login
-350 OK Requested file action pending further information
-421 DOWN Service not available, closing control connection
-425 NETWORK Can't open data connection
-426 ABORT Connection closed; transfer aborted
-450 UNAVAIL File unavailable (e.g., file busy)
-451 SERVER Requested action aborted: local error in processing
-452 FULL Insufficient storage space in system
-500 PROTO Syntax error, command unrecognized
-501 PROTO Syntax error in parameters or arguments
-502 PROTO Command not implemented
-503 PROTO Bad sequence of commands
-504 PROTO Command not implemented for that parameter
-530 AUTH Not logged in
-532 AUTH Need account for storing files
-550 UNAVAIL File unavailable (e.g., file not found, no access)
-551 PROTO Requested action aborted. Page type unknown
-552 FULL Exceeded storage allocation
-553 EXISTS File name not allowed
+110 Restart marker reply
+120 Service ready in a few minutes
+125 Data connection already open; transfer starting
+150 File status okay; about to open data connection
+200 Command okay
+202 Command not implemented, superfluous at this site
+211 System status, or system help reply
+212 Directory status
+213 File status
+214 Help message
+215 Set system type
+220 Service ready for new user
+221 Service closing control connection
+225 Data connection open; no transfer in progress
+226 Requested file action successful
+227 Entering Passive Mode
+230 User logged in, proceed
+250 Requested file action okay, completed
+257 File/directory created
+331 User name okay, need password
+332 Need account for login
+350 Requested file action pending further information
+421 Service not available, closing control connection
+425 Can't open data connection
+426 Connection closed; transfer aborted
+450 File unavailable (e.g., file busy)
+451 Requested action aborted: local error in processing
+452 Insufficient storage space in system
+500 Syntax error, command unrecognized
+501 Syntax error in parameters or arguments
+502 Command not implemented
+503 Bad sequence of commands
+504 Command not implemented for that parameter
+530 Not logged in
+532 Need account for storing files
+550 File unavailable (e.g., file not found, no access)
+551 Requested action aborted. Page type unknown
+552 Exceeded storage allocation
+553 File name not allowed
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 0d5804a885c4..9ce86a9c8f0f 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: http.c,v 1.10 1998/12/18 14:32:48 des Exp $
+ * $Id: http.c,v 1.4 1998/07/12 22:34:40 des Exp $
*/
/*
@@ -61,9 +61,15 @@
* SUCH DAMAGE. */
#include <sys/param.h>
+#include <sys/errno.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
#include <err.h>
#include <ctype.h>
+#include <netdb.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -71,8 +77,13 @@
#include <unistd.h>
#include "fetch.h"
-#include "common.h"
-#include "httperr.h"
+#include "httperr.c"
+
+#ifndef NDEBUG
+#define DEBUG(x) do x; while (0)
+#else
+#define DEBUG(x) do { } while (0)
+#endif
extern char *__progname;
@@ -92,6 +103,20 @@ struct cookie
};
/*
+ * Look up error code
+ */
+static const char *
+_http_errstring(int e)
+{
+ struct httperr *p = _http_errlist;
+
+ while ((p->num != -1) && (p->num != e))
+ p++;
+
+ return p->string;
+}
+
+/*
* Send a formatted line; optionally echo to terminal
*/
static int
@@ -288,19 +313,17 @@ _http_auth(char *usr, char *pwd)
}
/*
- * Retrieve a file by HTTP
+ * retrieve a file by HTTP
*/
FILE *
-fetchGetHTTP(struct url *URL, char *flags)
+fetchGetHTTP(url_t *URL, char *flags)
{
- int sd = -1, e, i, enc = ENC_NONE, verbose;
+ int sd = -1, err, i, enc = ENC_NONE;
struct cookie *c;
- char *ln, *p, *px, *q;
+ char *ln, *p, *q;
FILE *f, *cf;
size_t len;
- verbose = (strchr(flags, 'v') != NULL);
-
/* allocate cookie */
if ((c = calloc(1, sizeof(struct cookie))) == NULL)
return NULL;
@@ -310,11 +333,13 @@ fetchGetHTTP(struct url *URL, char *flags)
URL->port = 80; /* default HTTP port */
/* attempt to connect to proxy server */
- if ((px = getenv("HTTP_PROXY")) != NULL) {
- char host[MAXHOSTNAMELEN];
+ if (getenv("HTTP_PROXY")) {
+ char *px, host[MAXHOSTNAMELEN];
int port = 3128; /* XXX I think 3128 is default... check? */
+ size_t len;
/* measure length */
+ px = getenv("HTTP_PROXY");
len = strcspn(px, ":");
/* get port (atoi is a little too tolerant perhaps?) */
@@ -328,12 +353,12 @@ fetchGetHTTP(struct url *URL, char *flags)
host[len] = 0;
/* connect */
- sd = _fetch_connect(host, port, verbose);
+ sd = fetchConnect(host, port);
}
/* if no proxy is configured or could be contacted, try direct */
if (sd == -1) {
- if ((sd = _fetch_connect(URL->host, URL->port, verbose)) == -1)
+ if ((sd = fetchConnect(URL->host, URL->port)) == -1)
goto ouch;
}
@@ -343,9 +368,6 @@ fetchGetHTTP(struct url *URL, char *flags)
c->real_f = f;
/* send request (proxies require absolute form, so use that) */
- if (verbose)
- _fetch_info("requesting http://%s:%d%s",
- URL->host, URL->port, URL->doc);
_http_cmd(f, "GET http://%s:%d%s HTTP/1.1" ENDL,
URL->host, URL->port, URL->doc);
@@ -375,12 +397,13 @@ fetchGetHTTP(struct url *URL, char *flags)
p++;
if (!isdigit(*p))
goto fouch;
- e = atoi(p);
- DEBUG(fprintf(stderr, "code: [\033[1m%d\033[m]\n", e));
+ err = atoi(p);
+ DEBUG(fprintf(stderr, "code: [\033[1m%d\033[m]\n", err));
/* add code to handle redirects later */
- if (e != 200) {
- _http_seterr(e);
+ if (err != 200) {
+ fetchLastErrCode = err;
+ fetchLastErrText = _http_errstring(err);
goto fouch;
}
@@ -434,38 +457,16 @@ ouch:
if (sd >= 0)
close(sd);
free(c);
- _http_seterr(999); /* XXX do this properly RSN */
return NULL;
fouch:
fclose(f);
free(c);
- _http_seterr(999); /* XXX do this properly RSN */
return NULL;
}
FILE *
-fetchPutHTTP(struct url *URL, char *flags)
+fetchPutHTTP(url_t *URL, char *flags)
{
warnx("fetchPutHTTP(): not implemented");
return NULL;
}
-
-/*
- * Get an HTTP document's metadata
- */
-int
-fetchStatHTTP(struct url *url, struct url_stat *us, char *flags)
-{
- warnx("fetchStatHTTP(): not implemented");
- return -1;
-}
-
-/*
- * List a directory
- */
-struct url_ent *
-fetchListHTTP(struct url *url, char *flags)
-{
- warnx("fetchListHTTP(): not implemented");
- return NULL;
-}
diff --git a/lib/libfetch/http.errors b/lib/libfetch/http.errors
index 26907d538adc..c0e35391d18e 100644
--- a/lib/libfetch/http.errors
+++ b/lib/libfetch/http.errors
@@ -1,41 +1,41 @@
-# $Id: http.errors,v 1.1.1.1 1998/07/09 16:52:44 des Exp $
+# $Id$
#
# This list is taken from RFC 2068.
#
-100 OK Continue
-101 OK Switching Protocols
-200 OK OK
-201 OK Created
-202 OK Accepted
-203 INFO Non-Authoritative Information
-204 OK No Content
-205 OK Reset Content
-206 OK Partial Content
-300 MOVED Multiple Choices
-301 MOVED Moved Permanently
-302 MOVED Moved Temporarily
-303 MOVED See Other
-304 OK Not Modified
-305 INFO Use Proxy
-400 PROTO Bad Request
-401 AUTH Unauthorized
-402 AUTH Payment Required
-403 AUTH Forbidden
-404 UNAVAIL Not Found
-405 PROTO Method Not Allowed
-406 PROTO Not Acceptable
-407 AUTH Proxy Authentication Required
-408 TIMEOUT Request Time-out
-409 EXISTS Conflict
-410 UNAVAIL Gone
-411 PROTO Length Required
-412 SERVER Precondition Failed
-413 PROTO Request Entity Too Large
-414 PROTO Request-URI Too Large
-415 PROTO Unsupported Media Type
-500 SERVER Internal Server Error
-501 PROTO Not Implemented
-502 SERVER Bad Gateway
-503 TEMP Service Unavailable
-504 TIMEOUT Gateway Time-out
-505 PROTO HTTP Version not supported
+100 Continue
+101 Switching Protocols
+200 OK
+201 Created
+202 Accepted
+203 Non-Authoritative Information
+204 No Content
+205 Reset Content
+206 Partial Content
+300 Multiple Choices
+301 Moved Permanently
+302 Moved Temporarily
+303 See Other
+304 Not Modified
+305 Use Proxy
+400 Bad Request
+401 Unauthorized
+402 Payment Required
+403 Forbidden
+404 Not Found
+405 Method Not Allowed
+406 Not Acceptable
+407 Proxy Authentication Required
+408 Request Time-out
+409 Conflict
+410 Gone
+411 Length Required
+412 Precondition Failed
+413 Request Entity Too Large
+414 Request-URI Too Large
+415 Unsupported Media Type
+500 Internal Server Error
+501 Not Implemented
+502 Bad Gateway
+503 Service Unavailable
+504 Gateway Time-out
+505 HTTP Version not supported
diff --git a/lib/libio/Makefile b/lib/libio/Makefile
deleted file mode 100644
index b9aeebdcaa79..000000000000
--- a/lib/libio/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id$
-
-LIB= io
-SHLIB_MAJOR= 1
-SRCS= io.c swiz.c bwx.c alpha_sethae.c
-
-CFLAGS+= -Wall -Wa,-mev56
-
-NOMAN=1
-
-.include <bsd.lib.mk>
diff --git a/lib/libio/alpha_sethae.c b/lib/libio/alpha_sethae.c
deleted file mode 100644
index 365b0514965a..000000000000
--- a/lib/libio/alpha_sethae.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#if defined(LIBC_RCS) && !defined(lint)
-static const char rcsid[] = "$Id$";
-#endif /* LIBC_RCS and not lint */
-
-#include <sys/types.h>
-#include <machine/sysarch.h>
-
-extern int sysarch(int, char *);
-
-struct parms {
- u_int64_t hae;
-};
-
-int
-alpha_sethae(u_int64_t hae)
-{
- struct parms p;
-
- p.hae = hae;
-
- return (sysarch(ALPHA_SETHAE, (char *)&p));
-}
diff --git a/lib/libio/bwx.c b/lib/libio/bwx.c
deleted file mode 100644
index 5a9e778a1734..000000000000
--- a/lib/libio/bwx.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/mman.h>
-#include <sys/fcntl.h>
-#include <sys/sysctl.h>
-#include <err.h>
-#include <machine/bwx.h>
-#include <machine/sysarch.h>
-#include <stdlib.h>
-#include "io.h"
-
-#define mb() __asm__ __volatile__("mb" : : : "memory")
-#define wmb() __asm__ __volatile__("wmb" : : : "memory")
-
-static int mem_fd; /* file descriptor to /dev/mem */
-static void *bwx_int1_ports; /* mapped int1 io ports */
-static void *bwx_int2_ports; /* mapped int2 io ports */
-static void *bwx_int4_ports; /* mapped int4 io ports */
-static u_int64_t bwx_io_base; /* physical address of ports */
-static u_int64_t bwx_mem_base; /* physical address of bwx mem */
-
-static void
-bwx_init()
-{
- size_t len = sizeof(u_int64_t);
- int error;
-
- mem_fd = open("/dev/mem", O_RDWR);
- if (mem_fd < 0)
- err(1, "/dev/mem");
- bwx_int1_ports = mmap(0, 1L<<32, PROT_READ, MAP_ANON, -1, 0);
- bwx_int2_ports = mmap(0, 1L<<32, PROT_READ, MAP_ANON, -1, 0);
- bwx_int4_ports = mmap(0, 1L<<32, PROT_READ, MAP_ANON, -1, 0);
-
- if ((error = sysctlbyname("hw.chipset.ports", &bwx_io_base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.ports");
- if ((error = sysctlbyname("hw.chipset.memory", &bwx_mem_base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.memory");
-}
-
-static int
-bwx_ioperm(u_int32_t from, u_int32_t num, int on)
-{
- if (!bwx_int1_ports)
- bwx_init();
-
- if (!on)
- return -1; /* XXX can't unmap yet */
-
- munmap(bwx_int1_ports + from, num);
- munmap(bwx_int2_ports + from, num);
- munmap(bwx_int4_ports + from, num);
- mmap(bwx_int1_ports + from, num, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_io_base + BWX_EV56_INT1 + from);
- mmap(bwx_int2_ports + from, num, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_io_base + BWX_EV56_INT2 + from);
- mmap(bwx_int4_ports + from, num, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_io_base + BWX_EV56_INT4 + from);
- return 0;
-}
-
-static u_int8_t
-bwx_inb(u_int32_t port)
-{
- mb();
- return ldbu((vm_offset_t)bwx_int1_ports + port);
-}
-
-static u_int16_t
-bwx_inw(u_int32_t port)
-{
- mb();
- return ldwu((vm_offset_t)bwx_int2_ports + port);
-}
-
-static u_int32_t
-bwx_inl(u_int32_t port)
-{
- mb();
- return ldl((vm_offset_t)bwx_int4_ports + port);
-}
-
-static void
-bwx_outb(u_int32_t port, u_int8_t val)
-{
- stb((vm_offset_t)bwx_int1_ports + port, val);
- wmb();
-}
-
-static void
-bwx_outw(u_int32_t port, u_int16_t val)
-{
- stw((vm_offset_t)bwx_int2_ports + port, val);
- wmb();
-}
-
-static void
-bwx_outl(u_int32_t port, u_int32_t val)
-{
- stl((vm_offset_t)bwx_int4_ports + port, val);
- wmb();
-}
-
-struct bwx_mem_handle {
- void *virt1; /* int1 address in user address-space */
- void *virt2; /* int2 address in user address-space */
- void *virt4; /* int4 address in user address-space */
-};
-
-static void *
-bwx_map_memory(u_int32_t address, u_int32_t size)
-{
- struct bwx_mem_handle *h;
- h = malloc(sizeof(struct bwx_mem_handle));
- if (!h) return 0;
- h->virt1 = mmap(0, size << 5, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_mem_base + BWX_EV56_INT1 + address);
- if ((long) h->virt1 == -1) {
- free(h);
- return 0;
- }
- h->virt2 = mmap(0, size << 5, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_mem_base + BWX_EV56_INT2 + address);
- if ((long) h->virt2 == -1) {
- munmap(h->virt1, size);
- free(h);
- return 0;
- }
- h->virt4 = mmap(0, size << 5, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, bwx_mem_base + BWX_EV56_INT4 + address);
- if ((long) h->virt4 == -1) {
- munmap(h->virt1, size);
- munmap(h->virt2, size);
- free(h);
- return 0;
- }
- return h;
-}
-
-static void
-bwx_unmap_memory(void *handle, u_int32_t size)
-{
- struct bwx_mem_handle *h = handle;
- munmap(h->virt1, size);
- munmap(h->virt2, size);
- munmap(h->virt4, size);
- free(h);
-}
-
-static u_int8_t
-bwx_readb(void *handle, u_int32_t offset)
-{
- struct bwx_mem_handle *h = handle;
- return ldbu((vm_offset_t)h->virt1 + offset);
-}
-
-static u_int16_t
-bwx_readw(void *handle, u_int32_t offset)
-{
- struct bwx_mem_handle *h = handle;
- return ldwu((vm_offset_t)h->virt2 + offset);
-}
-
-static u_int32_t
-bwx_readl(void *handle, u_int32_t offset)
-{
- struct bwx_mem_handle *h = handle;
- return ldl((vm_offset_t)h->virt4 + offset);
-}
-
-static void
-bwx_writeb(void *handle, u_int32_t offset, u_int8_t val)
-{
- struct bwx_mem_handle *h = handle;
- stb((vm_offset_t)h->virt1 + offset, val);
-}
-
-static void
-bwx_writew(void *handle, u_int32_t offset, u_int16_t val)
-{
- struct bwx_mem_handle *h = handle;
- stw((vm_offset_t)h->virt2 + offset, val);
-}
-
-static void
-bwx_writel(void *handle, u_int32_t offset, u_int32_t val)
-{
- struct bwx_mem_handle *h = handle;
- stl((vm_offset_t)h->virt4 + offset, val);
-}
-
-struct io_ops bwx_io_ops = {
- bwx_ioperm,
- bwx_inb,
- bwx_inw,
- bwx_inl,
- bwx_outb,
- bwx_outw,
- bwx_outl,
- bwx_map_memory,
- bwx_unmap_memory,
- bwx_readb,
- bwx_readw,
- bwx_readl,
- bwx_writeb,
- bwx_writew,
- bwx_writel,
-};
diff --git a/lib/libio/io.c b/lib/libio/io.c
deleted file mode 100644
index f847755a5793..000000000000
--- a/lib/libio/io.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#include <err.h>
-#include "io.h"
-
-static struct io_ops *ops;
-
-int
-ioperm(unsigned long from, unsigned long num, int on)
-{
- int error;
- int bwx;
- size_t len = sizeof(bwx);
-
- if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
- return error;
- if (bwx)
- ops = &bwx_io_ops;
- else
- ops = &swiz_io_ops;
-
- return ops->ioperm(from, num, on);
-}
-
-u_int8_t
-inb(u_int32_t port)
-{
- return ops->inb(port);
-}
-
-u_int16_t
-inw(u_int32_t port)
-{
- return ops->inw(port);
-}
-
-u_int32_t
-inl(u_int32_t port)
-{
- return ops->inl(port);
-}
-
-void
-outb(u_int32_t port, u_int8_t val)
-{
- ops->outb(port, val);
-}
-
-void
-outw(u_int32_t port, u_int16_t val)
-{
- ops->outw(port, val);
-}
-
-void
-outl(u_int32_t port, u_int32_t val)
-{
- ops->outl(port, val);
-}
-
-void *
-map_memory(u_int32_t address, u_int32_t size)
-{
- return ops->map_memory(address, size);
-}
-
-void
-unmap_memory(void *handle, u_int32_t size)
-{
- ops->unmap_memory(handle, size);
-}
-
-u_int8_t
-readb(void *handle, u_int32_t offset)
-{
- return ops->readb(handle, offset);
-}
-
-u_int16_t
-readw(void *handle, u_int32_t offset)
-{
- return ops->readw(handle, offset);
-}
-
-u_int32_t
-readl(void *handle, u_int32_t offset)
-{
- return ops->readl(handle, offset);
-}
-
-void
-writeb(void *handle, u_int32_t offset, u_int8_t val)
-{
- return ops->writeb(handle, offset, val);
-}
-
-void
-writew(void *handle, u_int32_t offset, u_int16_t val)
-{
- return ops->writew(handle, offset, val);
-}
-
-void
-writel(void *handle, u_int32_t offset, u_int32_t val)
-{
- return ops->writel(handle, offset, val);
-}
-
-u_int64_t
-dense_base(void)
-{
- static u_int64_t base = 0;
-
- if (base == 0) {
- size_t len = sizeof(base);
- int error;
- if ((error = sysctlbyname("hw.chipset.dense", &base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.dense");
- }
-
- return base;
-}
diff --git a/lib/libio/io.h b/lib/libio/io.h
deleted file mode 100644
index a166355612ea..000000000000
--- a/lib/libio/io.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-struct io_ops {
- int (*ioperm)(u_int32_t, u_int32_t, int);
- u_int8_t (*inb)(u_int32_t);
- u_int16_t (*inw)(u_int32_t);
- u_int32_t (*inl)(u_int32_t);
- void (*outb)(u_int32_t, u_int8_t);
- void (*outw)(u_int32_t, u_int16_t);
- void (*outl)(u_int32_t, u_int32_t);
- void * (*map_memory)(u_int32_t, u_int32_t);
- void (*unmap_memory)(void *, u_int32_t);
- u_int8_t (*readb)(void *, u_int32_t);
- u_int16_t (*readw)(void *, u_int32_t);
- u_int32_t (*readl)(void *, u_int32_t);
- void (*writeb)(void *, u_int32_t, u_int8_t);
- void (*writew)(void *, u_int32_t, u_int16_t);
- void (*writel)(void *, u_int32_t, u_int32_t);
-};
-
-extern struct io_ops swiz_io_ops;
-extern struct io_ops bwx_io_ops;
diff --git a/lib/libio/swiz.c b/lib/libio/swiz.c
deleted file mode 100644
index d8bb7b5c287e..000000000000
--- a/lib/libio/swiz.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#include <sys/param.h>
-#include <sys/mman.h>
-#include <sys/fcntl.h>
-#include <sys/sysctl.h>
-#include <err.h>
-#include <machine/swiz.h>
-#include <machine/sysarch.h>
-#include <stdlib.h>
-#include "io.h"
-
-#define mb() __asm__ __volatile__("mb" : : : "memory")
-#define wmb() __asm__ __volatile__("wmb" : : : "memory")
-
-static int mem_fd; /* file descriptor to /dev/mem */
-static void *swiz_ports; /* mapped io ports */
-static u_int64_t swiz_io_base; /* physical address of ports */
-static u_int64_t swiz_mem_base; /* physical address of sparse mem */
-static u_int64_t swiz_dense_base; /* physical address of dense mem */
-static u_int64_t swiz_hae_mask; /* mask address bits for hae */
-static u_int32_t swiz_hae; /* cache of current hae */
-
-static void
-swiz_init()
-{
-
- size_t len = sizeof(u_int64_t);
- int error;
-
- mem_fd = open("/dev/mem", O_RDWR);
- if (mem_fd < 0)
- err(1, "/dev/mem");
- swiz_ports = mmap(0, 1L<<32, PROT_READ, MAP_ANON, -1, 0);
-
- if ((error = sysctlbyname("hw.chipset.ports", &swiz_io_base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.ports");
- if ((error = sysctlbyname("hw.chipset.memory", &swiz_mem_base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.memory");
- if ((error = sysctlbyname("hw.chipset.dense", &swiz_dense_base, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.memory");
- if ((error = sysctlbyname("hw.chipset.hae_mask", &swiz_hae_mask, &len,
- 0, 0)) < 0)
- err(1, "hw.chipset.memory");
-
-}
-
-static int
-swiz_ioperm(u_int32_t from, u_int32_t num, int on)
-{
- u_int64_t start, end;
- void *addr;
-
- if (!swiz_ports)
- swiz_init();
-
- if (!on)
- return -1; /* XXX can't unmap yet */
-
- start = from << 5;
- end = (from + num) << 5;
- addr = swiz_ports + start;
- munmap(addr, end - start);
- mmap(addr, end - start, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd, swiz_io_base + start);
- return 0;
-}
-
-static u_int8_t
-swiz_inb(u_int32_t port)
-{
- mb();
- return SPARSE_READ_BYTE(swiz_ports, port);
-}
-
-static u_int16_t
-swiz_inw(u_int32_t port)
-{
- mb();
- return SPARSE_READ_WORD(swiz_ports, port);
-}
-
-static u_int32_t
-swiz_inl(u_int32_t port)
-{
- mb();
- return SPARSE_READ_LONG(swiz_ports, port);
-}
-
-static void
-swiz_outb(u_int32_t port, u_int8_t val)
-{
- SPARSE_WRITE_BYTE(swiz_ports, port, val);
- wmb();
-}
-
-static void
-swiz_outw(u_int32_t port, u_int16_t val)
-{
- SPARSE_WRITE_WORD(swiz_ports, port, val);
- wmb();
-}
-
-static void
-swiz_outl(u_int32_t port, u_int32_t val)
-{
- SPARSE_WRITE_LONG(swiz_ports, port, val);
- wmb();
-}
-
-struct swiz_mem_handle {
- u_int32_t phys; /* address in PCI address-space */
- void *virt; /* address in user address-space */
- u_int32_t size; /* size of mapped region */
-};
-
-static void *
-swiz_map_memory(u_int32_t address, u_int32_t size)
-{
- struct swiz_mem_handle *h;
- h = malloc(sizeof(struct swiz_mem_handle));
- if (!h) return 0;
- h->phys = address;
- h->virt = mmap(0, size << 5, PROT_READ|PROT_WRITE, MAP_SHARED,
- mem_fd,
- swiz_mem_base + ((address & ~swiz_hae_mask) << 5));
- if ((long) h->virt == -1) {
- free(h);
- return 0;
- }
- h->size = size << 5;
- return h;
-}
-
-static void
-swiz_unmap_memory(void *handle, u_int32_t size)
-{
- struct swiz_mem_handle *h = handle;
- munmap(h->virt, h->size);
- free(h);
-}
-
-static void
-swiz_sethae(vm_offset_t phys)
-{
- u_int32_t hae = phys & swiz_hae_mask;
- if (hae != swiz_hae) {
- alpha_sethae(hae);
- swiz_hae = hae;
- }
-}
-
-static u_int8_t
-swiz_readb(void *handle, u_int32_t offset)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- return SPARSE_READ_BYTE(h->virt, offset);
-}
-
-static u_int16_t
-swiz_readw(void *handle, u_int32_t offset)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- return SPARSE_READ_WORD(h->virt, offset);
-}
-
-static u_int32_t
-swiz_readl(void *handle, u_int32_t offset)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- return SPARSE_READ_LONG(h->virt, offset);
-}
-
-static void
-swiz_writeb(void *handle, u_int32_t offset, u_int8_t val)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- SPARSE_WRITE_BYTE(h->virt, offset, val);
-}
-
-static void
-swiz_writew(void *handle, u_int32_t offset, u_int16_t val)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- SPARSE_WRITE_WORD(h->virt, offset, val);
-}
-
-static void
-swiz_writel(void *handle, u_int32_t offset, u_int32_t val)
-{
- struct swiz_mem_handle *h = handle;
- swiz_sethae(h->phys + offset);
- SPARSE_WRITE_LONG(h->virt, offset, val);
-}
-
-struct io_ops swiz_io_ops = {
- swiz_ioperm,
- swiz_inb,
- swiz_inw,
- swiz_inl,
- swiz_outb,
- swiz_outw,
- swiz_outl,
- swiz_map_memory,
- swiz_unmap_memory,
- swiz_readb,
- swiz_readw,
- swiz_readl,
- swiz_writeb,
- swiz_writew,
- swiz_writel,
-};
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 9543feee4de6..c91786113a21 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -302,14 +302,15 @@ kvm_getprocs(kd, op, arg, cnt)
_kvm_syserr(kd, kd->program, "kvm_getprocs");
return (0);
}
+ kd->procbase = 0;
do {
size += size / 10;
kd->procbase = (struct kinfo_proc *)
- _kvm_realloc(kd, kd->procbase, size);
+ _kvm_realloc(kd, kd->procbase, size);
if (kd->procbase == 0)
return (0);
st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4,
- kd->procbase, &size, NULL, 0);
+ kd->procbase, &size, NULL, 0);
} while (st == -1 && errno == ENOMEM);
if (st == -1) {
_kvm_syserr(kd, kd->program, "kvm_getprocs");
@@ -600,18 +601,21 @@ proc_verify(kd, kernp, p)
const struct proc *p;
{
struct kinfo_proc kp;
- int mib[4];
+ int mib[4], st;
size_t len;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = p->p_pid;
- len = sizeof(kp);
- if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1)
- return (0);
+
+ len = sizeof kp;
+
+ st = sysctl(mib, 4, &kp, &len, NULL, 0);
+ if (st < 0)
+ return(0);
return (p->p_pid == kp.kp_proc.p_pid &&
- (kp.kp_proc.p_stat != SZOMB || p->p_stat == SZOMB));
+ (kp.kp_proc.p_stat != SZOMB || p->p_stat == SZOMB));
}
static char **
@@ -625,14 +629,15 @@ kvm_doargv(kd, kp, nchr, info)
register char **ap;
u_long addr;
int cnt;
- static struct ps_strings arginfo;
- static u_long ps_strings;
+ static struct ps_strings arginfo, *ps_strings;
size_t len;
+ int i;
if (ps_strings == NULL) {
- len = sizeof(ps_strings);
- if (sysctlbyname("kern.ps_strings", &ps_strings, &len, NULL,
- 0) == -1)
+ len = sizeof ps_strings;
+ i = sysctlbyname("kern.ps_strings",
+ &ps_strings, &len, 0, 0);
+ if (i < 0 || ps_strings == NULL)
ps_strings = PS_STRINGS;
}
diff --git a/lib/libkvm/kvm_read.3 b/lib/libkvm/kvm_read.3
index b5609599f6ab..1e8e3ad4288f 100644
--- a/lib/libkvm/kvm_read.3
+++ b/lib/libkvm/kvm_read.3
@@ -43,6 +43,7 @@
.Nm kvm_write
.Nd read or write kernel virtual memory
.Sh SYNOPSIS
+.Fd #include <sys/types.h>
.Fd #include <kvm.h>
.Ft ssize_t
.Fn kvm_read "kvm_t *kd" "u_long addr" "void *buf" "size_t nbytes"
diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index d2cb2d5e8440..842f801b8ea0 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -1,6 +1,9 @@
-# $Id: Makefile,v 1.27 1998/09/11 05:41:29 imp Exp $
+# $Id: Makefile,v 1.26 1998/08/30 01:50:04 jb Exp $
LIB= md
+.if ${OBJFORMAT} != elf
+NOPIC= true
+.endif
SRCS= md2c.c md4c.c md5c.c md2hl.c md4hl.c md5hl.c
MAN3+= md2.3 md4.3 md5.3
MLINKS+=md2.3 MD2Init.3 md2.3 MD2Update.3 md2.3 MD2Final.3
diff --git a/lib/libmytinfo/Makefile b/lib/libmytinfo/Makefile
index 700a8827cde9..8b7c637bb084 100644
--- a/lib/libmytinfo/Makefile
+++ b/lib/libmytinfo/Makefile
@@ -1,14 +1,14 @@
# Makefile for libmytinfo
# Use 'make update_term_h' manually after changing internal
# mytinfo structures
-# $Id: Makefile,v 1.15 1998/09/02 15:22:11 bde Exp $
+# $Id: Makefile,v 1.14 1998/08/15 07:15:51 jb Exp $
LIB= mytinfo
SRCS= addstr.c binorder.c buildpath.c caplist.c capsort.c compar.c\
fillterm.c findcap.c findterm.c getother.c gettbin.c\
gettcap.c gettinfo.c tcapconv.c tcapvars.c termcap.c\
terminfo.c tgoto.c tiget.c tmatch.c tparm.c tputs.c tty.c version.c
-CLEANFILES=binorder.c caplist.c capsort.c mkbinorder mkcaplist \
+CLEANFILES+= binorder.c caplist.c capsort.c mkbinorder mkcaplist \
mkcapsort mktermhead mkversion readcaps.o version.c
CFLAGS+=-Wall -I${.CURDIR}
@@ -30,7 +30,7 @@ capsort.c: mkcapsort
./mkcapsort > capsort.c
.for f in caplist capsort compar findcap
-CLEANFILES+=cross-$f.o
+CLANFILES+= cross-$f.o
cross-$f.o: $f.c
${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC}
.endfor
diff --git a/lib/libncurses/curs_addstr.3 b/lib/libncurses/curs_addstr.3
index 74ac9c754bca..c55c2f57ede9 100644
--- a/lib/libncurses/curs_addstr.3
+++ b/lib/libncurses/curs_addstr.3
@@ -14,9 +14,9 @@
.br
\fBint waddnstr(WINDOW *win, char *str, int n);\fR
.br
-\fBint mvaddstr(int y, int x, char *str);\fR
+\fBint mvaddstr(y, int x, char *str);\fR
.br
-\fBint mvaddnstr(int y, int x, char *str, int n);\fR
+\fBint mvaddnstr(y, int x, char *str, int n);\fR
.br
\fBint mvwaddstr(WINDOW *win, int y, int x, char *str);\fR
.br
diff --git a/lib/libpam/Makefile b/lib/libpam/Makefile
deleted file mode 100644
index 8e99888bd7bf..000000000000
--- a/lib/libpam/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-# The modules must be built first, because they are built into the
-# static version of libpam.
-SUBDIR+= modules libpam
-
-.include <bsd.subdir.mk>
diff --git a/lib/libpam/Makefile.inc b/lib/libpam/Makefile.inc
deleted file mode 100644
index 2558a61faa10..000000000000
--- a/lib/libpam/Makefile.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-SHLIB_MAJOR= 1
-SHLIB_MINOR= 0
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
deleted file mode 100644
index 9b6cd7e2ec44..000000000000
--- a/lib/libpam/libpam/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../contrib/libpam
-MODOBJDIR= ../modules
-
-.PATH: ${PAMDIR}/libpam ${PAMDIR}/libpam_misc ${PAMDIR}/doc/man
-
-LIB= pam
-CFLAGS+= -I${PAMDIR}/libpam/include -I.
-CFLAGS+= -DDEFAULT_MODULE_PATH=\"${SHLIBDIR}/\"
-NOPROFILE= true
-CLEANFILES+= security
-
-# Files from ${PAMDIR}/libpam:
-SRCS= pam_account.c pam_auth.c pam_data.c pam_delay.c \
- pam_dispatch.c pam_end.c pam_env.c pam_handlers.c \
- pam_item.c pam_log.c pam_misc.c pam_password.c \
- pam_second.c pam_session.c pam_start.c pam_static.c \
- pam_strerror.c
-HDRS1= _pam_compat.h _pam_macros.h _pam_types.h \
- pam_appl.h pam_malloc.h pam_modules.h
-MAN3+= pam_authenticate.3 pam_chauthtok.3 pam_fail_delay.3 \
- pam_open_session.3 pam_setcred.3 pam_start.3 \
- pam_strerror.3
-MLINKS+= pam_open_session.3 pam_close_session.3 \
- pam_start.3 pam_end.3
-MAN8+= pam.8
-MLINKS+= pam.8 pam.conf.5 pam.8 pam.d.5
-
-# Files from ${PAMDIR}/libpam_misc:
-SRCS+= help_env.c misc_conv.c xstrdup.c
-HDRS2= pam_misc.h
-
-# Files from ${.CURDIR}:
-SRCS+= pam_get_pass.c pam_prompt.c pam_std_option.c
-HDRS3= pam_mod_misc.h
-
-# Static PAM modules:
-STATIC_MODULES+= ${MODOBJDIR}/pam_cleartext_pass_ok/libpam_cleartext_pass_ok.a
-.if defined(MAKE_KERBEROS4)
-STATIC_MODULES+= ${MODOBJDIR}/pam_kerberosIV/libpam_kerberosIV.a
-.endif
-STATIC_MODULES+= ${MODOBJDIR}/pam_radius/libpam_radius.a
-STATIC_MODULES+= ${MODOBJDIR}/pam_skey/libpam_skey.a
-STATIC_MODULES+= ${MODOBJDIR}/pam_tacplus/libpam_tacplus.a
-STATIC_MODULES+= ${MODOBJDIR}/pam_unix/libpam_unix.a
-
-STATICOBJS+= pam_static_modules.o
-
-.if ${OBJFORMAT} == elf
-CLEANFILES+= setdef0.o _pam_static_modules.o setdef1.o \
- setdef0.c setdef1.c setdefs.h
-
-pam_static_modules.o: setdef0.o _pam_static_modules.o setdef1.o
- ${LD} -o ${.TARGET} -r ${.ALLSRC}
-
-setdef0.o: setdef0.c setdefs.h
-setdef1.o: setdef1.c setdefs.h
-
-setdef0.c setdef1.c setdefs.h: _pam_static_modules.o
- gensetdefs ${.ALLSRC}
-
-_pam_static_modules.o: ${STATIC_MODULES}
- ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
-.else
-pam_static_modules.o: ${STATIC_MODULES}
- ${LD} -o ${.TARGET} -r -Bforcearchive ${.ALLSRC}
-.endif
-
-all: security
-
-beforedepend: security
-
-beforeinstall:
- cd ${PAMDIR}/libpam/include/security; \
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${HDRS1} ${DESTDIR}/usr/include/security
- cd ${PAMDIR}/libpam_misc; \
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${HDRS2} ${DESTDIR}/usr/include/security
- cd ${.CURDIR}; \
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${HDRS3} ${DESTDIR}/usr/include/security
-
-security:
- ln -sf ${PAMDIR}/libpam_misc security
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/libpam/pam_get_pass.c b/lib/libpam/libpam/pam_get_pass.c
deleted file mode 100644
index 78ef75abdb8f..000000000000
--- a/lib/libpam/libpam/pam_get_pass.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <security/pam_modules.h>
-#include "pam_mod_misc.h"
-
-static int pam_conv_pass(pam_handle_t *, const char *, int);
-
-static int
-pam_conv_pass(pam_handle_t *pamh, const char *prompt, int options)
-{
- int retval;
- const void *item;
- const struct pam_conv *conv;
- struct pam_message msg;
- const struct pam_message *msgs[1];
- struct pam_response *resp;
-
- if ((retval = pam_get_item(pamh, PAM_CONV, &item)) !=
- PAM_SUCCESS)
- return retval;
- conv = (const struct pam_conv *)item;
- msg.msg_style = options & PAM_OPT_ECHO_PASS ?
- PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF;
- msg.msg = prompt;
- msgs[0] = &msg;
- if ((retval = conv->conv(1, msgs, &resp, conv->appdata_ptr)) !=
- PAM_SUCCESS)
- return retval;
- if ((retval = pam_set_item(pamh, PAM_AUTHTOK, resp[0].resp)) !=
- PAM_SUCCESS)
- return retval;
- memset(resp[0].resp, 0, strlen(resp[0].resp));
- free(resp[0].resp);
- free(resp);
- return PAM_SUCCESS;
-}
-
-int
-pam_get_pass(pam_handle_t *pamh, const char **passp, const char *prompt,
- int options)
-{
- int retval;
- const void *item = NULL;
-
- /*
- * Grab the already-entered password if we might want to use it.
- */
- if (options & (PAM_OPT_TRY_FIRST_PASS | PAM_OPT_USE_FIRST_PASS)) {
- if ((retval = pam_get_item(pamh, PAM_AUTHTOK, &item)) !=
- PAM_SUCCESS)
- return retval;
- }
-
- if (item == NULL) {
- /* The user hasn't entered a password yet. */
- if (options & PAM_OPT_USE_FIRST_PASS)
- return PAM_AUTH_ERR;
- /* Use the conversation function to get a password. */
- if ((retval = pam_conv_pass(pamh, prompt, options)) !=
- PAM_SUCCESS ||
- (retval = pam_get_item(pamh, PAM_AUTHTOK, &item)) !=
- PAM_SUCCESS)
- return retval;
- }
- *passp = (const char *)item;
- return PAM_SUCCESS;
-}
diff --git a/lib/libpam/libpam/pam_mod_misc.h b/lib/libpam/libpam/pam_mod_misc.h
deleted file mode 100644
index 06f474d293a2..000000000000
--- a/lib/libpam/libpam/pam_mod_misc.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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 PAM_MOD_MISC_H
-#define PAM_MOD_MISC_H
-
-#include <sys/cdefs.h>
-
-/* Options */
-#define PAM_OPT_DEBUG 0x01
-#define PAM_OPT_NO_WARN 0x02
-#define PAM_OPT_USE_FIRST_PASS 0x04
-#define PAM_OPT_TRY_FIRST_PASS 0x08
-#define PAM_OPT_USE_MAPPED_PASS 0x10
-#define PAM_OPT_ECHO_PASS 0x20
-
-__BEGIN_DECLS
-int pam_get_pass(pam_handle_t *, const char **, const char *, int);
-int pam_prompt(pam_handle_t *, int, const char *, char **);
-int pam_std_option(int *, const char *);
-__END_DECLS
-
-#endif
diff --git a/lib/libpam/libpam/pam_prompt.c b/lib/libpam/libpam/pam_prompt.c
deleted file mode 100644
index 220616ee2aaa..000000000000
--- a/lib/libpam/libpam/pam_prompt.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <security/pam_modules.h>
-#include "pam_mod_misc.h"
-
-/*
- * Do a simple conversation which can consist of a message and/or a user
- * response.
- */
-int
-pam_prompt(pam_handle_t *pamh, int style, const char *prompt, char **user_msg)
-{
- int retval;
- const void *item;
- const struct pam_conv *conv;
- struct pam_message msg;
- const struct pam_message *msgs[1];
- struct pam_response *resp;
-
- if ((retval = pam_get_item(pamh, PAM_CONV, &item)) !=
- PAM_SUCCESS)
- return retval;
- conv = (const struct pam_conv *)item;
- msg.msg_style = style;
- msg.msg = prompt != NULL ? prompt : "";
- msgs[0] = &msg;
- if ((retval = conv->conv(1, msgs, &resp, conv->appdata_ptr)) !=
- PAM_SUCCESS)
- return retval;
- if (user_msg != NULL)
- *user_msg = resp[0].resp;
- else if (resp[0].resp != NULL)
- free(resp[0].resp);
- free(resp);
- return PAM_SUCCESS;
-}
diff --git a/lib/libpam/libpam/pam_std_option.c b/lib/libpam/libpam/pam_std_option.c
deleted file mode 100644
index 0c00908b37f2..000000000000
--- a/lib/libpam/libpam/pam_std_option.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <security/pam_modules.h>
-#include <string.h>
-#include "pam_mod_misc.h"
-
-/*
- * If the given name is a standard option, set the corresponding flag in
- * the options word and return 0. Else return -1.
- */
-int
-pam_std_option(int *options, const char *name)
-{
- struct opttab {
- const char *name;
- int value;
- };
- static struct opttab std_options[] = {
- { "debug", PAM_OPT_DEBUG },
- { "no_warn", PAM_OPT_NO_WARN },
- { "use_first_pass", PAM_OPT_USE_FIRST_PASS },
- { "try_first_pass", PAM_OPT_TRY_FIRST_PASS },
- { "use_mapped_pass", PAM_OPT_USE_MAPPED_PASS },
- { "echo_pass", PAM_OPT_ECHO_PASS },
- { NULL, 0 }
- };
- struct opttab *p;
-
- for (p = std_options; p->name != NULL; p++) {
- if (strcmp(name, p->name) == 0) {
- *options |= p->value;
- return 0;
- }
- }
- return -1;
-}
diff --git a/lib/libpam/modules/Makefile b/lib/libpam/modules/Makefile
deleted file mode 100644
index 5a3e3c120c3a..000000000000
--- a/lib/libpam/modules/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-SUBDIR+= pam_cleartext_pass_ok
-.if defined(MAKE_KERBEROS4)
-SUBDIR+= pam_kerberosIV
-.endif
-SUBDIR+= pam_radius
-SUBDIR+= pam_skey
-SUBDIR+= pam_tacplus
-SUBDIR+= pam_unix
-
-.include <bsd.subdir.mk>
diff --git a/lib/libpam/modules/pam_cleartext_pass_ok/Makefile b/lib/libpam/modules/pam_cleartext_pass_ok/Makefile
deleted file mode 100644
index 2336ea3e4615..000000000000
--- a/lib/libpam/modules/pam_cleartext_pass_ok/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_cleartext_pass_ok
-SHLIB_NAME= pam_cleartext_pass_ok.so
-SRCS= pam_cleartext_pass_ok.c
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -Wall
-DPADD+= ${LIBSKEY}
-LDADD+= -lskey -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_cleartext_pass_ok/pam_cleartext_pass_ok.c b/lib/libpam/modules/pam_cleartext_pass_ok/pam_cleartext_pass_ok.c
deleted file mode 100644
index 437225c30450..000000000000
--- a/lib/libpam/modules/pam_cleartext_pass_ok/pam_cleartext_pass_ok.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <stdio.h>
-#include <skey.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- int retval;
- const void *item;
- const char *user;
- const char *tty;
- const char *rhost;
-
- if ((retval = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
- return retval;
- if ((retval = pam_get_item(pamh, PAM_TTY, &item)) != PAM_SUCCESS)
- return retval;
- tty = (const char *)item;
- if ((retval = pam_get_item(pamh, PAM_RHOST, &item)) != PAM_SUCCESS)
- return retval;
- rhost = (const char *)item;
- /*
- * The cast in the next statement is necessary only because the
- * declaration of skeyaccess is wrong.
- */
- return skeyaccess((char *)user, tty, rhost, NULL) ?
- PAM_SUCCESS : PAM_AUTH_ERR;
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_cleartext_pass_ok");
diff --git a/lib/libpam/modules/pam_kerberosIV/Makefile b/lib/libpam/modules/pam_kerberosIV/Makefile
deleted file mode 100644
index 8ab1e6e349b4..000000000000
--- a/lib/libpam/modules/pam_kerberosIV/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_kerberosIV
-SHLIB_NAME= pam_kerberosIV.so
-SRCS= pam_kerberosIV.c klogin.c
-CFLAGS+= -Wall
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -I${.CURDIR}/../../libpam
-CFLAGS+= -DKERBEROS
-DPADD+= ${LIBKRB} ${LIBDES} ${LIBGCC_PIC}
-LDADD+= -lkrb -ldes -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_kerberosIV/klogin.c b/lib/libpam/modules/pam_kerberosIV/klogin.c
deleted file mode 100644
index d2c2d0691683..000000000000
--- a/lib/libpam/modules/pam_kerberosIV/klogin.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993, 1994
- * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint
-static const char sccsid[] = "@(#)klogin.c 8.3 (Berkeley) 4/2/94";
-#endif /* not lint */
-
-#ifdef KERBEROS
-#include <sys/param.h>
-#include <sys/syslog.h>
-#include <des.h>
-#include <krb.h>
-
-#include <err.h>
-#include <netdb.h>
-#include <pwd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define INITIAL_TICKET "krbtgt"
-#define VERIFY_SERVICE "rcmd"
-
-extern int _pam_notickets;
-extern char *_pam_krbtkfile_env;
-extern int _pam_noticketsdontcomplain;
-
-/*
- * Attempt to log the user in using Kerberos authentication
- *
- * return 0 on success (will be logged in)
- * 1 if Kerberos failed (try local password in login)
- */
-int
-_pam_klogin(pw, instance, localhost, password)
- struct passwd *pw;
- char *instance, *localhost, *password;
-{
- int kerror;
- char realm[REALM_SZ], savehost[MAXHOSTNAMELEN];
- char tkt_location[MAXPATHLEN];
- char *krb_get_phost();
-
-#ifdef KLOGIN_PARANOID
- AUTH_DAT authdata;
- KTEXT_ST ticket;
- struct hostent *hp;
- unsigned long faddr;
-
- _pam_noticketsdontcomplain = 0; /* enable warning message */
-#endif
-
- /*
- * Root logins don't use Kerberos.
- * If we have a realm, try getting a ticket-granting ticket
- * and using it to authenticate. Otherwise, return
- * failure so that we can try the normal passwd file
- * for a password. If that's ok, log the user in
- * without issuing any tickets.
- */
- if (strcmp(pw->pw_name, "root") == 0 ||
- krb_get_lrealm(realm, 0) != KSUCCESS)
- return (1);
-
- _pam_noticketsdontcomplain = 0; /* enable warning message */
-
- /*
- * get TGT for local realm
- * tickets are stored in a file named TKT_ROOT plus uid
- * except for user.root tickets.
- */
-
- if (strcmp(instance, "root") != 0)
- (void)sprintf(tkt_location, "%s%d", TKT_ROOT, pw->pw_uid);
- else {
- (void)sprintf(tkt_location, "%s_root_%d", TKT_ROOT, pw->pw_uid);
- _pam_krbtkfile_env = tkt_location;
- }
- (void)krb_set_tkt_string(tkt_location);
-
- /*
- * Set real as well as effective ID to 0 for the moment,
- * to make the kerberos library do the right thing.
- */
- if (setuid(0) < 0) {
- warnx("setuid");
- return (1);
- }
- kerror = krb_get_pw_in_tkt(pw->pw_name, instance,
- realm, INITIAL_TICKET, realm, DEFAULT_TKT_LIFE, password);
-
- /*
- * If we got a TGT, get a local "rcmd" ticket and check it so as to
- * ensure that we are not talking to a bogus Kerberos server.
- *
- * There are 2 cases where we still allow a login:
- * 1: the VERIFY_SERVICE doesn't exist in the KDC
- * 2: local host has no srvtab, as (hopefully) indicated by a
- * return value of RD_AP_UNDEC from krb_rd_req().
- */
- if (kerror != INTK_OK) {
- if (kerror != INTK_BADPW && kerror != KDC_PR_UNKNOWN) {
- syslog(LOG_ERR, "Kerberos intkt error: %s",
- krb_err_txt[kerror]);
- dest_tkt();
- }
- return (1);
- }
-
- if (chown(TKT_FILE, pw->pw_uid, pw->pw_gid) < 0)
- syslog(LOG_ERR, "chown tkfile (%s): %m", TKT_FILE);
-
- (void)strncpy(savehost, krb_get_phost(localhost), sizeof(savehost));
- savehost[sizeof(savehost)-1] = NULL;
-
-#ifdef KLOGIN_PARANOID
- /*
- * if the "VERIFY_SERVICE" doesn't exist in the KDC for this host,
- * still allow login with tickets, but log the error condition.
- */
-
- kerror = krb_mk_req(&ticket, VERIFY_SERVICE, savehost, realm, 33);
- if (kerror == KDC_PR_UNKNOWN) {
- syslog(LOG_NOTICE,
- "warning: TGT not verified (%s); %s.%s not registered, or srvtab is wrong?",
- krb_err_txt[kerror], VERIFY_SERVICE, savehost);
- _pam_notickets = 0;
- return (0);
- }
-
- if (kerror != KSUCCESS) {
- warnx("unable to use TGT: (%s)", krb_err_txt[kerror]);
- syslog(LOG_NOTICE, "unable to use TGT: (%s)",
- krb_err_txt[kerror]);
- dest_tkt();
- return (1);
- }
-
- if (!(hp = gethostbyname(localhost))) {
- syslog(LOG_ERR, "couldn't get local host address");
- dest_tkt();
- return (1);
- }
-
- memmove((void *)&faddr, (void *)hp->h_addr, sizeof(faddr));
-
- kerror = krb_rd_req(&ticket, VERIFY_SERVICE, savehost, faddr,
- &authdata, "");
-
- if (kerror == KSUCCESS) {
- _pam_notickets = 0;
- return (0);
- }
-
- /* undecipherable: probably didn't have a srvtab on the local host */
- if (kerror == RD_AP_UNDEC) {
- syslog(LOG_NOTICE, "krb_rd_req: (%s)\n", krb_err_txt[kerror]);
- dest_tkt();
- return (1);
- }
- /* failed for some other reason */
- warnx("unable to verify %s ticket: (%s)", VERIFY_SERVICE,
- krb_err_txt[kerror]);
- syslog(LOG_NOTICE, "couldn't verify %s ticket: %s", VERIFY_SERVICE,
- krb_err_txt[kerror]);
- dest_tkt();
- return (1);
-#else
- _pam_notickets = 0;
- return (0);
-#endif
-}
-#endif
diff --git a/lib/libpam/modules/pam_kerberosIV/pam_kerberosIV.c b/lib/libpam/modules/pam_kerberosIV/pam_kerberosIV.c
deleted file mode 100644
index a4e3226749e6..000000000000
--- a/lib/libpam/modules/pam_kerberosIV/pam_kerberosIV.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/param.h>
-#include <pwd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-#include "pam_mod_misc.h"
-
-#define PASSWORD_PROMPT "Password:"
-
-extern int _pam_klogin(struct passwd *, char *, char *, char *);
-
-/* Globals used by _pam_klogin.c */
-int _pam_notickets = 1;
-int _pam_noticketsdontcomplain = 1;
-char *_pam_krbtkfile_env;
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- int retval;
- const char *user;
- char *principal;
- char *instance;
- const char *password;
- char localhost[MAXHOSTNAMELEN + 1];
- struct passwd *pwd;
- int options;
- int i;
-
- options = 0;
- for (i = 0; i < argc; i++)
- pam_std_option(&options, argv[i]);
- if ((retval = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
- return retval;
- if ((retval = pam_get_pass(pamh, &password, PASSWORD_PROMPT,
- options)) != PAM_SUCCESS)
- return retval;
- if (gethostname(localhost, sizeof localhost - 1) == -1)
- return PAM_SYSTEM_ERR;
- if ((principal = strdup(user)) == NULL)
- return PAM_BUF_ERR;
- if ((instance = strchr(principal, '.')) != NULL)
- *instance++ = '\0';
- else
- instance = "";
- if ((pwd = getpwnam(user)) != NULL &&
- _pam_klogin(pwd, instance, localhost, (char *)password) == 0) {
- if (!(flags & PAM_SILENT) && _pam_notickets &&
- !_pam_noticketsdontcomplain)
- pam_prompt(pamh, PAM_ERROR_MSG,
- "Warning: no Kerberos tickets issued", NULL);
- /*
- * XXX - I think the ticket file really isn't supposed to
- * be even created until pam_sm_setcred() is called.
- */
- if (_pam_krbtkfile_env != NULL)
- setenv("KRBTKFILE", _pam_krbtkfile_env, 1);
- retval = PAM_SUCCESS;
- } else
- retval = PAM_AUTH_ERR;
- /*
- * The PAM infrastructure will obliterate the cleartext
- * password before returning to the application.
- */
- free(principal);
- return retval;
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_kerberosIV");
diff --git a/lib/libpam/modules/pam_radius/Makefile b/lib/libpam/modules/pam_radius/Makefile
deleted file mode 100644
index 23f62ec9531e..000000000000
--- a/lib/libpam/modules/pam_radius/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_radius
-SHLIB_NAME= pam_radius.so
-SRCS= pam_radius.c
-CFLAGS+= -Wall
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -I${.CURDIR}/../../libpam
-DPADD+= ${LIBRADIUS} ${LIBGCC_PIC}
-LDADD+= -lradius -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_radius/pam_radius.c b/lib/libpam/modules/pam_radius/pam_radius.c
deleted file mode 100644
index c04d8f288315..000000000000
--- a/lib/libpam/modules/pam_radius/pam_radius.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/param.h>
-#include <pwd.h>
-#include <radlib.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <unistd.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-#include "pam_mod_misc.h"
-
-#define MAX_CHALLENGE_MSGS 10
-#define PASSWORD_PROMPT "RADIUS password:"
-
-/* Option names, including the "=" sign. */
-#define OPT_CONF "conf="
-#define OPT_TMPL "template_user="
-
-static int build_access_request(struct rad_handle *, const char *,
- const char *, const void *, size_t);
-static int do_accept(pam_handle_t *, struct rad_handle *);
-static int do_challenge(pam_handle_t *, struct rad_handle *,
- const char *);
-
-/*
- * Construct an access request, but don't send it. Returns 0 on success,
- * -1 on failure.
- */
-static int
-build_access_request(struct rad_handle *radh, const char *user,
- const char *pass, const void *state, size_t state_len)
-{
- char host[MAXHOSTNAMELEN];
-
- if (rad_create_request(radh, RAD_ACCESS_REQUEST) == -1) {
- syslog(LOG_CRIT, "rad_create_request: %s", rad_strerror(radh));
- return -1;
- }
- if ((user != NULL &&
- rad_put_string(radh, RAD_USER_NAME, user) == -1) ||
- (pass != NULL &&
- rad_put_string(radh, RAD_USER_PASSWORD, pass) == -1) ||
- (gethostname(host, sizeof host) != -1 &&
- rad_put_string(radh, RAD_NAS_IDENTIFIER, host) == -1)) {
- syslog(LOG_CRIT, "rad_put_string: %s", rad_strerror(radh));
- return -1;
- }
- if (state != NULL && rad_put_attr(radh, RAD_STATE, state,
- state_len) == -1) {
- syslog(LOG_CRIT, "rad_put_attr: %s", rad_strerror(radh));
- return -1;
- }
- if (rad_put_int(radh, RAD_SERVICE_TYPE, RAD_AUTHENTICATE_ONLY) == -1) {
- syslog(LOG_CRIT, "rad_put_int: %s", rad_strerror(radh));
- return -1;
- }
- return 0;
-}
-
-static int
-do_accept(pam_handle_t *pamh, struct rad_handle *radh)
-{
- int attrtype;
- const void *attrval;
- size_t attrlen;
- char *s;
-
- while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) {
- if (attrtype == RAD_USER_NAME) {
- s = rad_cvt_string(attrval, attrlen);
- if (s == NULL) {
- syslog(LOG_CRIT,
- "rad_cvt_string: out of memory");
- return -1;
- }
- pam_set_item(pamh, PAM_USER, s);
- free(s);
- }
- }
- if (attrtype == -1) {
- syslog(LOG_CRIT, "rad_get_attr: %s", rad_strerror(radh));
- return -1;
- }
- return 0;
-}
-
-static int
-do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user)
-{
- int retval;
- int attrtype;
- const void *attrval;
- size_t attrlen;
- const void *state;
- size_t statelen;
- struct pam_message msgs[MAX_CHALLENGE_MSGS];
- const struct pam_message *msg_ptrs[MAX_CHALLENGE_MSGS];
- struct pam_response *resp;
- int num_msgs;
- const void *item;
- const struct pam_conv *conv;
-
- state = NULL;
- statelen = 0;
- num_msgs = 0;
- while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) {
- switch (attrtype) {
-
- case RAD_STATE:
- state = attrval;
- statelen = attrlen;
- break;
-
- case RAD_REPLY_MESSAGE:
- if (num_msgs >= MAX_CHALLENGE_MSGS) {
- syslog(LOG_CRIT,
- "Too many RADIUS challenge messages");
- return PAM_SERVICE_ERR;
- }
- msgs[num_msgs].msg = rad_cvt_string(attrval, attrlen);
- if (msgs[num_msgs].msg == NULL) {
- syslog(LOG_CRIT,
- "rad_cvt_string: out of memory");
- return PAM_SERVICE_ERR;
- }
- msgs[num_msgs].msg_style = PAM_TEXT_INFO;
- msg_ptrs[num_msgs] = &msgs[num_msgs];
- num_msgs++;
- break;
- }
- }
- if (attrtype == -1) {
- syslog(LOG_CRIT, "rad_get_attr: %s", rad_strerror(radh));
- return PAM_SERVICE_ERR;
- }
- if (num_msgs == 0) {
- msgs[num_msgs].msg = strdup("(null RADIUS challenge): ");
- if (msgs[num_msgs].msg == NULL) {
- syslog(LOG_CRIT, "Out of memory");
- return PAM_SERVICE_ERR;
- }
- msgs[num_msgs].msg_style = PAM_TEXT_INFO;
- msg_ptrs[num_msgs] = &msgs[num_msgs];
- num_msgs++;
- }
- msgs[num_msgs-1].msg_style = PAM_PROMPT_ECHO_ON;
- if ((retval = pam_get_item(pamh, PAM_CONV, &item)) != PAM_SUCCESS) {
- syslog(LOG_CRIT, "do_challenge: cannot get PAM_CONV");
- return retval;
- }
- conv = (const struct pam_conv *)item;
- if ((retval = conv->conv(num_msgs, msg_ptrs, &resp,
- conv->appdata_ptr)) != PAM_SUCCESS)
- return retval;
- if (build_access_request(radh, user, resp[num_msgs-1].resp, state,
- statelen) == -1)
- return PAM_SERVICE_ERR;
- memset(resp[num_msgs-1].resp, 0, strlen(resp[num_msgs-1].resp));
- free(resp[num_msgs-1].resp);
- free(resp);
- while (num_msgs > 0)
- free((void *)msgs[--num_msgs].msg);
- return PAM_SUCCESS;
-}
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- struct rad_handle *radh;
- const char *user;
- const char *pass;
- const char *conf_file = NULL;
- const char *template_user = NULL;
- int options = 0;
- int retval;
- int i;
- int e;
-
- for (i = 0; i < argc; i++) {
- size_t len;
-
- pam_std_option(&options, argv[i]);
- if (strncmp(argv[i], OPT_CONF, (len = strlen(OPT_CONF))) == 0)
- conf_file = argv[i] + len;
- else if (strncmp(argv[i], OPT_TMPL,
- (len = strlen(OPT_TMPL))) == 0)
- template_user = argv[i] + len;
- }
- if ((retval = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
- return retval;
- if ((retval = pam_get_pass(pamh, &pass, PASSWORD_PROMPT,
- options)) != PAM_SUCCESS)
- return retval;
-
- if ((radh = rad_open()) == NULL) {
- syslog(LOG_CRIT, "rad_open failed");
- return PAM_SERVICE_ERR;
- }
- if (rad_config(radh, conf_file) == -1) {
- syslog(LOG_ALERT, "rad_config: %s", rad_strerror(radh));
- rad_close(radh);
- return PAM_SERVICE_ERR;
- }
- if (build_access_request(radh, user, pass, NULL, 0) == -1) {
- rad_close(radh);
- return PAM_SERVICE_ERR;
- }
- for ( ; ; ) {
- switch (rad_send_request(radh)) {
-
- case RAD_ACCESS_ACCEPT:
- e = do_accept(pamh, radh);
- rad_close(radh);
- if (e == -1)
- return PAM_SERVICE_ERR;
- if (template_user != NULL) {
- const void *item;
- const char *user;
-
- /*
- * If the given user name doesn't exist in
- * the local password database, change it
- * to the value given in the "template_user"
- * option.
- */
- retval = pam_get_item(pamh, PAM_USER, &item);
- if (retval != PAM_SUCCESS)
- return retval;
- user = (const char *)item;
- if (getpwnam(user) == NULL)
- pam_set_item(pamh, PAM_USER,
- template_user);
- }
- return PAM_SUCCESS;
-
- case RAD_ACCESS_REJECT:
- rad_close(radh);
- return PAM_AUTH_ERR;
-
- case RAD_ACCESS_CHALLENGE:
- if ((retval = do_challenge(pamh, radh, user)) !=
- PAM_SUCCESS) {
- rad_close(radh);
- return retval;
- }
- break;
-
- case -1:
- syslog(LOG_CRIT, "rad_send_request: %s",
- rad_strerror(radh));
- rad_close(radh);
- return PAM_AUTHINFO_UNAVAIL;
-
- default:
- syslog(LOG_CRIT,
- "rad_send_request: unexpected return value");
- rad_close(radh);
- return PAM_SERVICE_ERR;
- }
- }
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_radius");
diff --git a/lib/libpam/modules/pam_skey/Makefile b/lib/libpam/modules/pam_skey/Makefile
deleted file mode 100644
index bf6af9edd2b4..000000000000
--- a/lib/libpam/modules/pam_skey/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_skey
-SHLIB_NAME= pam_skey.so
-SRCS= pam_skey.c
-CFLAGS+= -Wall
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -I${.CURDIR}/../../libpam
-DPADD+= ${LIBSKEY} ${LIBGCC_PIC}
-LDADD+= -lskey -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_skey/pam_skey.c b/lib/libpam/modules/pam_skey/pam_skey.c
deleted file mode 100644
index 439591e24015..000000000000
--- a/lib/libpam/modules/pam_skey/pam_skey.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <syslog.h> /* XXX */
-
-#include <stdio.h>
-#include <string.h>
-#include <skey.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-#include "pam_mod_misc.h"
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- int retval;
- const char *user;
- const char *response;
- struct skey skey;
- char challenge[128];
- char prompt[128];
- char resp_buf[128];
- int options;
- int i;
- int e;
-
- options = 0;
- for (i = 0; i < argc; i++)
- pam_std_option(&options, argv[i]);
- /*
- * It doesn't make sense to use a password that has already been
- * typed in, since we haven't presented the challenge to the user
- * yet.
- */
- options &= ~(PAM_OPT_USE_FIRST_PASS | PAM_OPT_TRY_FIRST_PASS);
- if ((retval = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
- return retval;
- if (skeyinfo(&skey, user, challenge) != 0)
- return PAM_AUTH_ERR;
- snprintf(prompt, sizeof prompt, "%s\nPassword: ", challenge);
- if ((retval = pam_get_pass(pamh, &response, prompt, options)) !=
- PAM_SUCCESS)
- return retval;
- if (response[0] == '\0' && !(options & PAM_OPT_ECHO_PASS)) {
- options |= PAM_OPT_ECHO_PASS;
- snprintf(prompt, sizeof prompt,
- "%s\nPassword [echo on]: ", challenge);
- if ((retval = pam_get_pass(pamh, &response, prompt,
- options)) != PAM_SUCCESS)
- return retval;
- }
- /*
- * Skeyinfo closed the database file, so we have to call skeylookup
- * to open it again.
- */
- if ((e = skeylookup(&skey, user)) != 0) {
- if (e == -1) {
- syslog(LOG_ERR, "Error opening S/Key database");
- return PAM_SERVICE_ERR;
- } else
- return PAM_AUTH_ERR;
- }
- /* We have to copy the response, because skeyverify mucks with it. */
- snprintf(resp_buf, sizeof resp_buf, "%s", response);
- /*
- * Skeyverify is supposed to return -1 only if an error occurs.
- * But it returns -1 even if the response string isn't in the form
- * it expects. Thus we can't log an error and can only check for
- * success or lack thereof.
- */
- return skeyverify(&skey, resp_buf) == 0 ? PAM_SUCCESS : PAM_AUTH_ERR;
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_skey");
diff --git a/lib/libpam/modules/pam_tacplus/Makefile b/lib/libpam/modules/pam_tacplus/Makefile
deleted file mode 100644
index 6430ca8a66fe..000000000000
--- a/lib/libpam/modules/pam_tacplus/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_tacplus
-SHLIB_NAME= pam_tacplus.so
-SRCS= pam_tacplus.c
-CFLAGS+= -Wall
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -I${.CURDIR}/../../libpam
-DPADD+= ${LIBTACPLUS} ${LIBGCC_PIC}
-LDADD+= -ltacplus -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_tacplus/pam_tacplus.c b/lib/libpam/modules/pam_tacplus/pam_tacplus.c
deleted file mode 100644
index 0820071529b4..000000000000
--- a/lib/libpam/modules/pam_tacplus/pam_tacplus.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/param.h>
-
-#include <pwd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <taclib.h>
-#include <unistd.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-#include "pam_mod_misc.h"
-
-/* Option names, including the "=" sign. */
-#define OPT_CONF "conf="
-#define OPT_TMPL "template_user="
-
-typedef int (*set_func)(struct tac_handle *, const char *);
-
-static int do_item(pam_handle_t *, struct tac_handle *, int,
- set_func, const char *);
-static char *get_msg(struct tac_handle *);
-static int set_msg(struct tac_handle *, const char *);
-
-static int
-do_item(pam_handle_t *pamh, struct tac_handle *tach, int item,
- set_func func, const char *funcname)
-{
- int retval;
- const void *value;
-
- if ((retval = pam_get_item(pamh, item, &value)) != PAM_SUCCESS)
- return retval;
- if (value != NULL && (*func)(tach, (const char *)value) == -1) {
- syslog(LOG_CRIT, "%s: %s", funcname, tac_strerror(tach));
- tac_close(tach);
- return PAM_SERVICE_ERR;
- }
- return PAM_SUCCESS;
-}
-
-static char *
-get_msg(struct tac_handle *tach)
-{
- char *msg;
-
- if ((msg = tac_get_msg(tach)) == NULL) {
- syslog(LOG_CRIT, "tac_get_msg: %s", tac_strerror(tach));
- tac_close(tach);
- return NULL;
- }
- return msg;
-}
-
-static int
-set_msg(struct tac_handle *tach, const char *msg)
-{
- if (tac_set_msg(tach, msg) == -1) {
- syslog(LOG_CRIT, "tac_set_msg: %s", tac_strerror(tach));
- tac_close(tach);
- return -1;
- }
- return 0;
-}
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- int retval;
- struct tac_handle *tach;
- const char *conf_file = NULL;
- const char *template_user = NULL;
- int options = 0;
- int i;
-
- for (i = 0; i < argc; i++) {
- size_t len;
-
- pam_std_option(&options, argv[i]);
- if (strncmp(argv[i], OPT_CONF, (len = strlen(OPT_CONF))) == 0)
- conf_file = argv[i] + len;
- else if (strncmp(argv[i], OPT_TMPL,
- (len = strlen(OPT_TMPL))) == 0)
- template_user = argv[i] + len;
- }
-
- if ((tach = tac_open()) == NULL) {
- syslog(LOG_CRIT, "tac_open failed");
- return PAM_SERVICE_ERR;
- }
- if (tac_config(tach, conf_file) == -1) {
- syslog(LOG_ALERT, "tac_config: %s", tac_strerror(tach));
- tac_close(tach);
- return PAM_SERVICE_ERR;
- }
- if (tac_create_authen(tach, TAC_AUTHEN_LOGIN, TAC_AUTHEN_TYPE_ASCII,
- TAC_AUTHEN_SVC_LOGIN) == -1) {
- syslog(LOG_CRIT, "tac_create_authen: %s", tac_strerror(tach));
- tac_close(tach);
- return PAM_SERVICE_ERR;
- }
- if ((retval = do_item(pamh, tach, PAM_USER,
- tac_set_user, "tac_set_user")) != PAM_SUCCESS)
- return retval;
- if ((retval = do_item(pamh, tach, PAM_TTY,
- tac_set_port, "tac_set_port")) != PAM_SUCCESS)
- return retval;
- if ((retval = do_item(pamh, tach, PAM_RHOST,
- tac_set_rem_addr, "tac_set_rem_addr")) != PAM_SUCCESS)
- return retval;
- for ( ; ; ) {
- char *srvr_msg;
- size_t msg_len;
- const char *user_msg;
- char *data_msg;
- int sflags;
- int status;
- int echo;
-
- if ((sflags = tac_send_authen(tach)) == -1) {
- syslog(LOG_CRIT, "tac_send_authen: %s",
- tac_strerror(tach));
- tac_close(tach);
- return PAM_AUTHINFO_UNAVAIL;
- }
- status = TAC_AUTHEN_STATUS(sflags);
- echo = TAC_AUTHEN_NOECHO(sflags) ? 0 : PAM_OPT_ECHO_PASS;
- switch (status) {
-
- case TAC_AUTHEN_STATUS_PASS:
- tac_close(tach);
- if (template_user != NULL) {
- const void *item;
- const char *user;
-
- /*
- * If the given user name doesn't exist in
- * the local password database, change it
- * to the value given in the "template_user"
- * option.
- */
- retval = pam_get_item(pamh, PAM_USER, &item);
- if (retval != PAM_SUCCESS)
- return retval;
- user = (const char *)item;
- if (getpwnam(user) == NULL)
- pam_set_item(pamh, PAM_USER,
- template_user);
- }
- return PAM_SUCCESS;
-
- case TAC_AUTHEN_STATUS_FAIL:
- tac_close(tach);
- return PAM_AUTH_ERR;
-
- case TAC_AUTHEN_STATUS_GETUSER:
- case TAC_AUTHEN_STATUS_GETPASS:
- if ((srvr_msg = get_msg(tach)) == NULL)
- return PAM_SERVICE_ERR;
- if (status == TAC_AUTHEN_STATUS_GETUSER)
- retval = pam_get_user(pamh, &user_msg,
- srvr_msg[0] != '\0' ? srvr_msg : NULL);
- else if (status == TAC_AUTHEN_STATUS_GETPASS)
- retval = pam_get_pass(pamh, &user_msg,
- srvr_msg[0] != '\0' ? srvr_msg :
- "Password:", options | echo);
- free(srvr_msg);
- if (retval != PAM_SUCCESS) {
- /* XXX - send a TACACS+ abort packet */
- tac_close(tach);
- return retval;
- }
- if (set_msg(tach, user_msg) == -1)
- return PAM_SERVICE_ERR;
- break;
-
- case TAC_AUTHEN_STATUS_GETDATA:
- if ((srvr_msg = get_msg(tach)) == NULL)
- return PAM_SERVICE_ERR;
- retval = pam_prompt(pamh,
- (options|echo) & PAM_OPT_ECHO_PASS ?
- PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF,
- srvr_msg[0] != '\0' ? srvr_msg : "Data:",
- &data_msg);
- free(srvr_msg);
- if (retval != PAM_SUCCESS) {
- /* XXX - send a TACACS+ abort packet */
- tac_close(tach);
- return retval;
- }
- retval = set_msg(tach, data_msg);
- memset(data_msg, 0, strlen(data_msg));
- free(data_msg);
- if (retval == -1)
- return PAM_SERVICE_ERR;
- break;
-
- case TAC_AUTHEN_STATUS_ERROR:
- srvr_msg = (char *)tac_get_data(tach, &msg_len);
- if (srvr_msg != NULL && msg_len != 0) {
- syslog(LOG_CRIT, "tac_send_authen:"
- " server detected error: %s", srvr_msg);
- free(srvr_msg);
- } else
- syslog(LOG_CRIT,
- "tac_send_authen: server detected error");
- tac_close(tach);
- return PAM_AUTHINFO_UNAVAIL;
- break;
-
- case TAC_AUTHEN_STATUS_RESTART:
- case TAC_AUTHEN_STATUS_FOLLOW:
- default:
- syslog(LOG_CRIT,
- "tac_send_authen: unexpected status %#x", status);
- tac_close(tach);
- return PAM_AUTHINFO_UNAVAIL;
- }
- }
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_tacplus");
diff --git a/lib/libpam/modules/pam_unix/Makefile b/lib/libpam/modules/pam_unix/Makefile
deleted file mode 100644
index d3bb68921de7..000000000000
--- a/lib/libpam/modules/pam_unix/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-PAMDIR= ${.CURDIR}/../../../../contrib/libpam
-
-LIB= pam_unix
-SHLIB_NAME= pam_unix.so
-SRCS= pam_unix.c
-CFLAGS+= -Wall
-CFLAGS+= -I${PAMDIR}/libpam/include
-CFLAGS+= -I${.CURDIR}/../../libpam
-DPADD+= ${LIBGCC_PIC}
-LDADD+= -lgcc_pic
-INTERNALLIB= yes
-INTERNALSTATICLIB=yes
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c
deleted file mode 100644
index f47ea555a271..000000000000
--- a/lib/libpam/modules/pam_unix/pam_unix.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/types.h>
-#include <pwd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define PAM_SM_AUTH
-#include <security/pam_modules.h>
-
-#include "pam_mod_misc.h"
-
-#define PASSWORD_PROMPT "Password:"
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
- const char **argv)
-{
- int retval;
- const char *user;
- const char *password;
- struct passwd *pwd;
- char *encrypted;
- int options;
- int i;
-
- options = 0;
- for (i = 0; i < argc; i++)
- pam_std_option(&options, argv[i]);
- if ((retval = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
- return retval;
- if ((retval = pam_get_pass(pamh, &password, PASSWORD_PROMPT,
- options)) != PAM_SUCCESS)
- return retval;
- if ((pwd = getpwnam(user)) != NULL) {
- encrypted = crypt(password, pwd->pw_passwd);
- if (password[0] == '\0' && pwd->pw_passwd != '\0')
- encrypted = ":";
-
- retval = strcmp(encrypted, pwd->pw_passwd) == 0 ?
- PAM_SUCCESS : PAM_AUTH_ERR;
- } else {
- /*
- * User unknown. Encrypt anyway so that it takes the
- * same amount of time.
- */
- crypt(password, "xx");
- retval = PAM_AUTH_ERR;
- }
- /*
- * The PAM infrastructure will obliterate the cleartext
- * password before returning to the application.
- */
- return retval;
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-PAM_MODULE_ENTRY("pam_unix");
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index 36e565087816..81f32068bf82 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -1,5 +1,5 @@
# Makefile for libpcap
-# $Id: Makefile,v 1.21 1998/09/15 19:34:01 fenner Exp $
+# $Id: Makefile,v 1.20 1998/08/18 10:29:37 ache Exp $
LIB= pcap
SRCS= grammar.y tokdefs.h pcap-bpf.c \
@@ -7,7 +7,7 @@ SRCS= grammar.y tokdefs.h pcap-bpf.c \
etherent.c savefile.c bpf_filter.c bpf_image.c \
scanner.l version.c
MAN3= pcap.3
-CLEANFILES=tokdefs.h version.c
+CLEANFILES+= tokdefs.h
DEFS= -DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_SOCKIO_H=1 \
-DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 \
diff --git a/lib/libradius/Makefile b/lib/libradius/Makefile
deleted file mode 100644
index acc3fa3e3220..000000000000
--- a/lib/libradius/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-LIB= radius
-SRCS= radlib.c
-CFLAGS+= -Wall
-DPADD+= ${LIBMD}
-LDADD+= -lmd
-SHLIB_MAJOR= 1
-SHLIB_MINOR= 0
-MAN3+= libradius.3
-MAN5+= radius.conf.5
-
-beforeinstall:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/radlib.h ${DESTDIR}/usr/include
-
-.include <bsd.lib.mk>
diff --git a/lib/libradius/libradius.3 b/lib/libradius/libradius.3
deleted file mode 100644
index 25ccdc09d816..000000000000
--- a/lib/libradius/libradius.3
+++ /dev/null
@@ -1,317 +0,0 @@
-.\" Copyright 1998 Juniper Networks, 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$
-.\"
-.Dd July 29, 1998
-.Dt LIBRADIUS 3
-.Os FreeBSD
-.Sh NAME
-.Nm libradius
-.Nd RADIUS client library
-.Sh SYNOPSIS
-.Fd #include <radlib.h>
-.Ft int
-.Fn rad_add_server "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries"
-.Ft void
-.Fn rad_close "struct rad_handle *h"
-.Ft int
-.Fn rad_config "struct rad_handle *h" "const char *file"
-.Ft int
-.Fn rad_create_request "struct rad_handle *h" "int code"
-.Ft struct in_addr
-.Fn rad_cvt_addr "const void *data"
-.Ft u_int32_t
-.Fn rad_cvt_int "const void *data"
-.Ft char *
-.Fn rad_cvt_string "const void *data" "size_t len"
-.Ft int
-.Fn rad_get_attr "struct rad_handle *h" "const void **data" "size_t *len"
-.Ft struct rad_handle *
-.Fn rad_open "void"
-.Ft int
-.Fn rad_put_addr "struct rad_handle *h" "int type" "struct in_addr addr"
-.Ft int
-.Fn rad_put_attr "struct rad_handle *h" "int type" "const void *data" "size_t len"
-.Ft int
-.Fn rad_put_int "struct rad_handle *h" "int type" "u_int32_t value"
-.Ft int
-.Fn rad_put_string "struct rad_handle *h" "int type" "const char *str"
-.Ft int
-.Fn rad_send_request "struct rad_handle *h"
-.Ft const char *
-.Fn rad_strerror "struct rad_handle *h"
-.Sh DESCRIPTION
-The
-.Nm
-library implements the client side of the Remote Authentication
-Dial In User Service (RADIUS). RADIUS, defined in RFC 2138, allows
-clients to perform authentication by means of network requests to
-remote authentication servers.
-.Sh INITIALIZATION
-To use the library, an application must first call
-.Fn rad_open
-to obtain a
-.Va struct rad_handle * ,
-which provides the context for subsequent operations.
-Calls to
-.Fn rad_open
-always succeed unless insufficient virtual memory is available. If
-the necessary memory cannot be allocated,
-.Fn rad_open
-returns
-.Dv NULL .
-.Pp
-Before issuing any RADIUS requests, the library must be made aware
-of the servers it can contact. The easiest way to configure the
-library is to call
-.Fn rad_config .
-.Fn rad_config
-causes the library to read a configuration file whose format is
-described in
-.Xr radius.conf 5 .
-The pathname of the configuration file is passed as the
-.Va file
-argument to
-.Fn rad_config .
-This argument may also be given as
-.Dv NULL ,
-in which case the standard configuration file
-.Pa /etc/radius.conf
-is used.
-.Fn rad_config
-returns 0 on success, or -1 if an error occurs.
-.Pp
-The library can also be configured programmatically by calls to
-.Fn rad_add_server .
-The
-.Va host
-parameter specifies the server host, either as a fully qualified
-domain name or as a dotted-quad IP address in text form.
-The
-.Va port
-parameter specifies the UDP port to contact on the server. If
-.Va port
-is given as 0, the library looks up the
-.Ql radius/udp
-service in the network services database, and uses the port found
-there. If no entry is found, the library uses port 1812, the standard
-RADIUS port. The shared secret for the server host is passed to the
-.Va secret
-parameter.
-It may be any NUL-terminated string of bytes. The RADIUS protocol
-ignores all but the leading 128 bytes of the shared secret.
-The timeout for receiving replies from the server is passed to the
-.Va timeout
-parameter, in units of seconds. The maximum number of repeated
-requests to make before giving up is passed into the
-.Va max_tries
-parameter.
-.Fn rad_add_server
-returns 0 on success, or -1 if an error occurs.
-.Pp
-.Fn rad_add_server
-may be called multiple times, and it may be used together with
-.Fn rad_config .
-At most 10 servers may be specified.
-When multiple servers are given, they are tried in round-robin
-fashion until a valid response is received, or until each server's
-.Va max_tries
-limit has been reached.
-.Sh CREATING A RADIUS REQUEST
-A RADIUS request consists of a code specifying the kind of request,
-and zero or more attributes which provide additional information. To
-begin constructing a new request, call
-.Fn rad_create_request .
-In addition to the usual
-.Va struct rad_handle * ,
-this function takes a
-.Va code
-parameter which specifies the type of the request. Most often this
-will be
-.Dv RAD_ACCESS_REQUEST .
-.Fn rad_create_request
-returns 0 on success, or -1 on if an error occurs.
-.Pp
-After the request has been created with
-.Fn rad_create request ,
-attributes can be attached to it. This is done through calls to
-.Fn rad_put_addr ,
-.Fn rad_put_int ,
-and
-.Fn rad_put_string .
-Each accepts a
-.Va type
-parameter identifying the attribute, and a value which may be
-an Internet address, an integer, or a NUL-terminated string,
-respectively.
-.Pp
-The library also provides a function
-.Fn rad_put_attr
-which can be used to supply a raw, uninterpreted attribute. The
-.Va data
-argument points to an array of bytes, and the
-.Va len
-argument specifies its length.
-.Pp
-The
-.Fn rad_put_X
-functions return 0 on success, or -1 if an error occurs.
-.Sh SENDING THE REQUEST AND RECEIVING THE RESPONSE
-After the RADIUS request has been constructed, it is sent by means
-of
-.Fn rad_send_request .
-This function sends the request and waits for a valid reply,
-retrying the defined servers in round-robin fashion as necessary.
-If a valid response is received,
-.Fn rad_send_request
-returns the RADIUS code which specifies the type of the response.
-This will typically be
-.Dv RAD_ACCESS_ACCEPT ,
-.Dv RAD_ACCESS_REJECT ,
-or
-.Dv RAD_ACCESS_CHALLENGE .
-If no valid response is received,
-.Fn rad_send_request
-returns -1.
-.Pp
-Like RADIUS requests, each response may contain zero or more
-attributes. After a response has been received successfully by
-.Fn rad_send_request ,
-its attributes can be extracted one by one using
-.Fn rad_get_attr .
-Each time
-.Fn rad_get_attr
-is called, it gets the next attribute from the current response, and
-stores a pointer to the data and the length of the data via the
-reference parameters
-.Va data
-and
-.Va len ,
-respectively. Note that the data resides in the response itself,
-and must not be modified.
-A successful call to
-.Fn rad_get_attr
-returns the RADIUS attribute type.
-If no more attributes remain in the current response,
-.Fn rad_get_attr
-returns 0.
-If an error such as a malformed attribute is detected, -1 is
-returned.
-.Pp
-The common types of attributes can be decoded using
-.Fn rad_cvt_addr ,
-.Fn rad_cvt_int ,
-and
-.Fn rad_cvt_string .
-These functions accept a pointer to the attribute data, which should
-have been obtained using
-.Fn rad_get_attr .
-In the case of
-.Fn rad_cvt_string ,
-the length
-.Va len
-must also be given. These functions interpret the attribute as an
-Internet address, an integer, or a string, respectively, and return
-its value.
-.Fn rad_cvt_string
-returns its value as a NUL-terminated string in dynamically
-allocated memory. The application should free the string using
-.Xr free 3
-when it is no longer needed.
-.Pp
-If insufficient virtual memory is available,
-.Fn rad_cvt_string
-returns
-.Dv NULL .
-.Fn rad_cvt_addr
-and
-.Fn rad_cvt_int
-cannot fail.
-.Sh OBTAINING ERROR MESSAGES
-Those functions which accept a
-.Va struct rad_handle *
-argument record an error message if they fail. The error message
-can be retrieved by calling
-.Fn rad_strerror .
-The message text is overwritten on each new error for the given
-.Va struct rad_handle * .
-Thus the message must be copied if it is to be preserved through
-subsequent library calls using the same handle.
-.Sh CLEANUP
-To free the resources used by the RADIUS library, call
-.Fn rad_close .
-.Sh RETURN VALUES
-The following functions return a non-negative value on success. If
-they detect an error, they return -1 and record an error message
-which can be retrieved using
-.Fn rad_strerror .
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Fn rad_add_server
-.It
-.Fn rad_config
-.It
-.Fn rad_create_request
-.It
-.Fn rad_get_attr
-.It
-.Fn rad_put_addr
-.It
-.Fn rad_put_attr
-.It
-.Fn rad_put_int
-.It
-.Fn rad_put_string
-.It
-.Fn rad_send_request
-.El
-.Pp
-The following functions return a
-.No non- Ns Dv NULL
-pointer on success. If they are unable to allocate sufficient
-virtual memory, they return
-.Dv NULL ,
-without recording an error message.
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Fn rad_cvt_string
-.It
-.Fn rad_open
-.El
-.Sh FILES
-.Pa /etc/radius.conf
-.Sh SEE ALSO
-.Xr radius.conf 5
-.Rs
-.%A C. Rigney, et al
-.%T Remote Authentication Dial In User Service (RADIUS)
-.%O RFC 2138
-.Re
-.Sh AUTHORS
-This software was written by
-.An John Polstra ,
-and donated to the FreeBSD project by Juniper Networks, Inc.
diff --git a/lib/libradius/radius.conf.5 b/lib/libradius/radius.conf.5
deleted file mode 100644
index 2cd72c2952ba..000000000000
--- a/lib/libradius/radius.conf.5
+++ /dev/null
@@ -1,123 +0,0 @@
-.\" Copyright 1998 Juniper Networks, 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$
-.\"
-.Dd July 29, 1998
-.Dt RADIUS.CONF 5
-.Os FreeBSD
-.Sh NAME
-.Nm radius.conf
-.Nd RADIUS client configuration file
-.Sh SYNOPSIS
-.Pa /etc/radius.conf
-.Sh DESCRIPTION
-.Nm
-contains the information necessary to configure the RADIUS client
-library. It is parsed by
-.Xr rad_config 3 .
-The file contains one or more lines of text, each describing a
-single RADIUS server which will be used by the library. Leading
-white space is ignored, as are empty lines and lines containing
-only comments.
-.Pp
-A RADIUS server is described by two to four fields on a line. The
-fields are separated by white space. The
-.Ql #
-character at the beginning of a field begins a comment, which extends
-to the end of the line. A field may be enclosed in double quotes,
-in which case it may contain white space and/or begin with the
-.Ql #
-character. Within a quoted string, the double quote character can
-be represented by
-.Ql \e\&" ,
-and the backslash can be represented by
-.Ql \e\e .
-No other escape sequences are supported.
-.Pp
-The first field specifies
-the server host, either as a fully qualified domain name or as a
-dotted-quad IP address. The host may optionally be followed by a
-.Ql \&:
-and a numeric port number, without intervening white space. If the
-port specification is omitted, it defaults to the
-.Ql radius
-service in the
-.Pa /etc/services
-file, or to the standard RADIUS port 1812 if there is no such entry in
-.Pa /etc/services .
-.Pp
-The second field contains the shared secret, which should be known
-only to the client and server hosts. It is an arbitrary string of
-characters, though it must be enclosed in double quotes if it
-contains white space. The shared secret may be
-any length, but the RADIUS protocol uses only the first 128
-characters. N.B., some popular RADIUS servers have bugs which
-prevent them from working properly with secrets longer than 16
-characters.
-.Pp
-The third field contains a decimal integer specifying the timeout in
-seconds for receiving a valid reply from the server. If this field
-is omitted, it defaults to 3 seconds.
-.Pp
-The fourth field contains a decimal integer specifying the maximum
-number of attempts that will be made to authenticate with the server
-before giving up. If omitted, it defaults to 3 attempts. Note,
-this is the total number of attempts and not the number of retries.
-.Pp
-Up to 10 RADIUS servers may be specified. The servers are tried in
-round-robin fashion, until a valid response is received or the
-maximum number of tries has been reached for all servers.
-.Pp
-The standard location for this file is
-.Pa /etc/radius.conf .
-But an alternate pathname may be specified in the call to
-.Xr rad_config 3 .
-Since the file contains sensitive information in the form of the
-shared secrets, it should not be readable except by root.
-.Sh FILES
-.Pa /etc/radius.conf
-.Sh EXAMPLES
-.Bd -literal
-# A simple entry using all the defaults:
-radius1.domain.com OurLittleSecret
-
-# A server still using the obsolete RADIUS port, with increased
-# timeout and maximum tries:
-auth.domain.com:1645 "I can't see you, but I know you're there" 5 4
-
-# A server specified by its IP address:
-192.168.27.81 $X*#..38947ax-+=
-.Ed
-.Sh SEE ALSO
-.Xr libradius 3
-.Rs
-.%A C. Rigney, et al
-.%T Remote Authentication Dial In User Service (RADIUS)
-.%O RFC 2138
-.Re
-.Sh AUTHORS
-This documentation was written by
-.An John Polstra ,
-and donated to the FreeBSD project by Juniper Networks, Inc.
diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c
deleted file mode 100644
index 2825c3dae786..000000000000
--- a/lib/libradius/radlib.c
+++ /dev/null
@@ -1,737 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <md5.h>
-#include <netdb.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "radlib_private.h"
-
-static void clear_password(struct rad_handle *);
-static void generr(struct rad_handle *, const char *, ...)
- __printflike(2, 3);
-static void insert_scrambled_password(struct rad_handle *, int);
-static int is_valid_response(struct rad_handle *, int,
- const struct sockaddr_in *);
-static int put_password_attr(struct rad_handle *, int,
- const void *, size_t);
-static int put_raw_attr(struct rad_handle *, int,
- const void *, size_t);
-static int split(char *, char *[], int, char *, size_t);
-
-static void
-clear_password(struct rad_handle *h)
-{
- if (h->pass_len != 0) {
- memset(h->pass, 0, h->pass_len);
- h->pass_len = 0;
- h->pass_pos = 0;
- }
-}
-
-static void
-generr(struct rad_handle *h, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- vsnprintf(h->errmsg, ERRSIZE, format, ap);
- va_end(ap);
-}
-
-static void
-insert_scrambled_password(struct rad_handle *h, int srv)
-{
- MD5_CTX ctx;
- unsigned char md5[16];
- const struct rad_server *srvp;
- int padded_len;
- int pos;
-
- srvp = &h->servers[srv];
- padded_len = h->pass_len == 0 ? 16 : (h->pass_len+15) & ~0xf;
-
- memcpy(md5, &h->request[POS_AUTH], LEN_AUTH);
- for (pos = 0; pos < padded_len; pos += 16) {
- int i;
-
- /* Calculate the new scrambler */
- MD5Init(&ctx);
- MD5Update(&ctx, srvp->secret, strlen(srvp->secret));
- MD5Update(&ctx, md5, 16);
- MD5Final(md5, &ctx);
-
- /*
- * Mix in the current chunk of the password, and copy
- * the result into the right place in the request. Also
- * modify the scrambler in place, since we will use this
- * in calculating the scrambler for next time.
- */
- for (i = 0; i < 16; i++)
- h->request[h->pass_pos + pos + i] =
- md5[i] ^= h->pass[pos + i];
- }
-}
-
-/*
- * Return true if the current response is valid for a request to the
- * specified server.
- */
-static int
-is_valid_response(struct rad_handle *h, int srv,
- const struct sockaddr_in *from)
-{
- MD5_CTX ctx;
- unsigned char md5[16];
- const struct rad_server *srvp;
- int len;
-
- srvp = &h->servers[srv];
-
- /* Check the source address */
- if (from->sin_family != srvp->addr.sin_family ||
- from->sin_addr.s_addr != srvp->addr.sin_addr.s_addr ||
- from->sin_port != srvp->addr.sin_port)
- return 0;
-
- /* Check the message length */
- if (h->resp_len < POS_ATTRS)
- return 0;
- len = h->response[POS_LENGTH] << 8 | h->response[POS_LENGTH+1];
- if (len > h->resp_len)
- return 0;
-
- /* Check the response authenticator */
- MD5Init(&ctx);
- MD5Update(&ctx, &h->response[POS_CODE], POS_AUTH - POS_CODE);
- MD5Update(&ctx, &h->request[POS_AUTH], LEN_AUTH);
- MD5Update(&ctx, &h->response[POS_ATTRS], len - POS_ATTRS);
- MD5Update(&ctx, srvp->secret, strlen(srvp->secret));
- MD5Final(md5, &ctx);
- if (memcmp(&h->response[POS_AUTH], md5, sizeof md5) != 0)
- return 0;
-
- return 1;
-}
-
-static int
-put_password_attr(struct rad_handle *h, int type, const void *value, size_t len)
-{
- int padded_len;
- int pad_len;
-
- if (h->pass_pos != 0) {
- generr(h, "Multiple User-Password attributes specified");
- return -1;
- }
- if (len > PASSSIZE)
- len = PASSSIZE;
- padded_len = len == 0 ? 16 : (len+15) & ~0xf;
- pad_len = padded_len - len;
-
- /*
- * Put in a place-holder attribute containing all zeros, and
- * remember where it is so we can fill it in later.
- */
- clear_password(h);
- put_raw_attr(h, type, h->pass, padded_len);
- h->pass_pos = h->req_len - padded_len;
-
- /* Save the cleartext password, padded as necessary */
- memcpy(h->pass, value, len);
- h->pass_len = len;
- memset(h->pass + len, 0, pad_len);
- return 0;
-}
-
-static int
-put_raw_attr(struct rad_handle *h, int type, const void *value, size_t len)
-{
- if (len > 253) {
- generr(h, "Attribute too long");
- return -1;
- }
- if (h->req_len + 2 + len > MSGSIZE) {
- generr(h, "Maximum message length exceeded");
- return -1;
- }
- h->request[h->req_len++] = type;
- h->request[h->req_len++] = len + 2;
- memcpy(&h->request[h->req_len], value, len);
- h->req_len += len;
- return 0;
-}
-
-int
-rad_add_server(struct rad_handle *h, const char *host, int port,
- const char *secret, int timeout, int tries)
-{
- struct rad_server *srvp;
-
- if (h->num_servers >= MAXSERVERS) {
- generr(h, "Too many RADIUS servers specified");
- return -1;
- }
- srvp = &h->servers[h->num_servers];
-
- memset(&srvp->addr, 0, sizeof srvp->addr);
- srvp->addr.sin_len = sizeof srvp->addr;
- srvp->addr.sin_family = AF_INET;
- if (!inet_aton(host, &srvp->addr.sin_addr)) {
- struct hostent *hent;
-
- if ((hent = gethostbyname(host)) == NULL) {
- generr(h, "%s: host not found", host);
- return -1;
- }
- memcpy(&srvp->addr.sin_addr, hent->h_addr,
- sizeof srvp->addr.sin_addr);
- }
- if (port != 0)
- srvp->addr.sin_port = htons(port);
- else {
- struct servent *sent;
-
- srvp->addr.sin_port =
- (sent = getservbyname("radius", "udp")) != NULL ?
- sent->s_port : htons(RADIUS_PORT);
- }
- if ((srvp->secret = strdup(secret)) == NULL) {
- generr(h, "Out of memory");
- return -1;
- }
- srvp->timeout = timeout;
- srvp->max_tries = tries;
- srvp->num_tries = 0;
- h->num_servers++;
- return 0;
-}
-
-void
-rad_close(struct rad_handle *h)
-{
- int srv;
-
- if (h->fd != -1)
- close(h->fd);
- for (srv = 0; srv < h->num_servers; srv++) {
- memset(h->servers[srv].secret, 0,
- strlen(h->servers[srv].secret));
- free(h->servers[srv].secret);
- }
- clear_password(h);
- free(h);
-}
-
-int
-rad_config(struct rad_handle *h, const char *path)
-{
- FILE *fp;
- char buf[MAXCONFLINE];
- int linenum;
- int retval;
-
- if (path == NULL)
- path = PATH_RADIUS_CONF;
- if ((fp = fopen(path, "r")) == NULL) {
- generr(h, "Cannot open \"%s\": %s", path, strerror(errno));
- return -1;
- }
- retval = 0;
- linenum = 0;
- while (fgets(buf, sizeof buf, fp) != NULL) {
- int len;
- char *fields[4];
- int nfields;
- char msg[ERRSIZE];
- char *host;
- char *port_str;
- char *secret;
- char *timeout_str;
- char *maxtries_str;
- char *end;
- unsigned long timeout;
- unsigned long maxtries;
- int port;
-
- linenum++;
- len = strlen(buf);
- /* We know len > 0, else fgets would have returned NULL. */
- if (buf[len - 1] != '\n') {
- if (len == sizeof buf - 1)
- generr(h, "%s:%d: line too long", path,
- linenum);
- else
- generr(h, "%s:%d: missing newline", path,
- linenum);
- retval = -1;
- break;
- }
- buf[len - 1] = '\0';
-
- /* Extract the fields from the line. */
- nfields = split(buf, fields, 4, msg, sizeof msg);
- if (nfields == -1) {
- generr(h, "%s:%d: %s", path, linenum, msg);
- retval = -1;
- break;
- }
- if (nfields == 0)
- continue;
- if (nfields < 2) {
- generr(h, "%s:%d: missing shared secret", path,
- linenum);
- retval = -1;
- break;
- }
- host = fields[0];
- secret = fields[1];
- timeout_str = fields[2];
- maxtries_str = fields[3];
-
- /* Parse and validate the fields. */
- host = strtok(host, ":");
- port_str = strtok(NULL, ":");
- if (port_str != NULL) {
- port = strtoul(port_str, &end, 10);
- if (*end != '\0') {
- generr(h, "%s:%d: invalid port", path,
- linenum);
- retval = -1;
- break;
- }
- } else
- port = 0;
- if (timeout_str != NULL) {
- timeout = strtoul(timeout_str, &end, 10);
- if (*end != '\0') {
- generr(h, "%s:%d: invalid timeout", path,
- linenum);
- retval = -1;
- break;
- }
- } else
- timeout = TIMEOUT;
- if (maxtries_str != NULL) {
- maxtries = strtoul(maxtries_str, &end, 10);
- if (*end != '\0') {
- generr(h, "%s:%d: invalid maxtries", path,
- linenum);
- retval = -1;
- break;
- }
- } else
- maxtries = MAXTRIES;
-
- if (rad_add_server(h, host, port, secret, timeout, maxtries) ==
- -1) {
- char msg[ERRSIZE];
-
- strcpy(msg, h->errmsg);
- generr(h, "%s:%d: %s", path, linenum, msg);
- retval = -1;
- break;
- }
- }
- /* Clear out the buffer to wipe a possible copy of a shared secret */
- memset(buf, 0, sizeof buf);
- fclose(fp);
- return retval;
-}
-
-int
-rad_create_request(struct rad_handle *h, int code)
-{
- int i;
-
- h->request[POS_CODE] = code;
- h->request[POS_IDENT] = ++h->ident;
- /* Create a random authenticator */
- for (i = 0; i < LEN_AUTH; i += 2) {
- long r;
- r = random();
- h->request[POS_AUTH+i] = r;
- h->request[POS_AUTH+i+1] = r >> 8;
- }
- h->req_len = POS_ATTRS;
- clear_password(h);
- return 0;
-}
-
-struct in_addr
-rad_cvt_addr(const void *data)
-{
- struct in_addr value;
-
- memcpy(&value.s_addr, data, sizeof value.s_addr);
- return value;
-}
-
-u_int32_t
-rad_cvt_int(const void *data)
-{
- u_int32_t value;
-
- memcpy(&value, data, sizeof value);
- return ntohl(value);
-}
-
-char *
-rad_cvt_string(const void *data, size_t len)
-{
- char *s;
-
- s = malloc(len + 1);
- if (s != NULL) {
- memcpy(s, data, len);
- s[len] = '\0';
- }
- return s;
-}
-
-/*
- * Returns the attribute type. If none are left, returns 0. On failure,
- * returns -1.
- */
-int
-rad_get_attr(struct rad_handle *h, const void **value, size_t *len)
-{
- int type;
-
- if (h->resp_pos >= h->resp_len)
- return 0;
- if (h->resp_pos + 2 > h->resp_len) {
- generr(h, "Malformed attribute in response");
- return -1;
- }
- type = h->response[h->resp_pos++];
- *len = h->response[h->resp_pos++] - 2;
- if (h->resp_pos + *len > h->resp_len) {
- generr(h, "Malformed attribute in response");
- return -1;
- }
- *value = &h->response[h->resp_pos];
- h->resp_pos += *len;
- return type;
-}
-
-/*
- * Create and initialize a rad_handle structure, and return it to the
- * caller. Can fail only if the necessary memory cannot be allocated.
- * In that case, it returns NULL.
- */
-struct rad_handle *
-rad_open(void)
-{
- struct rad_handle *h;
-
- h = (struct rad_handle *)malloc(sizeof(struct rad_handle));
- if (h != NULL) {
- srandomdev();
- h->fd = -1;
- h->num_servers = 0;
- h->ident = random();
- h->errmsg[0] = '\0';
- memset(h->pass, 0, sizeof h->pass);
- h->pass_len = 0;
- h->pass_pos = 0;
- }
- return h;
-}
-
-int
-rad_put_addr(struct rad_handle *h, int type, struct in_addr addr)
-{
- return rad_put_attr(h, type, &addr.s_addr, sizeof addr.s_addr);
-}
-
-int
-rad_put_attr(struct rad_handle *h, int type, const void *value, size_t len)
-{
- return type == RAD_USER_PASSWORD ?
- put_password_attr(h, type, value, len) :
- put_raw_attr(h, type, value, len);
-}
-
-int
-rad_put_int(struct rad_handle *h, int type, u_int32_t value)
-{
- u_int32_t nvalue;
-
- nvalue = htonl(value);
- return rad_put_attr(h, type, &nvalue, sizeof nvalue);
-}
-
-int
-rad_put_string(struct rad_handle *h, int type, const char *str)
-{
- return rad_put_attr(h, type, str, strlen(str));
-}
-
-/*
- * Returns the response type code on success, or -1 on failure.
- */
-int
-rad_send_request(struct rad_handle *h)
-{
- int total_tries;
- int try;
- int srv;
- int n;
- int got_valid_response;
-
- /* Make sure we have a socket to use */
- if (h->fd == -1) {
- struct sockaddr_in sin;
-
- if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
- generr(h, "Cannot create socket: %s", strerror(errno));
- return -1;
- }
- memset(&sin, 0, sizeof sin);
- sin.sin_len = sizeof sin;
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- sin.sin_port = htons(0);
- if (bind(h->fd, (const struct sockaddr *)&sin,
- sizeof sin) == -1) {
- generr(h, "bind: %s", strerror(errno));
- close(h->fd);
- h->fd = -1;
- return -1;
- }
- }
-
- /* Make sure the user gave us a password */
- if (h->pass_pos == 0) {
- generr(h, "No User-Password attribute given");
- return -1;
- }
-
- /* Fill in the length field in the message */
- h->request[POS_LENGTH] = h->req_len >> 8;
- h->request[POS_LENGTH+1] = h->req_len;
-
- /*
- * Count the total number of tries we will make, and zero the
- * counter for each server.
- */
- total_tries = 0;
- for (srv = 0; srv < h->num_servers; srv++) {
- total_tries += h->servers[srv].max_tries;
- h->servers[srv].num_tries = 0;
- }
- if (total_tries == 0) {
- generr(h, "No RADIUS servers specified");
- return -1;
- }
-
- srv = 0;
- got_valid_response = 0;
- for (try = 0; try < total_tries; try++) {
- struct timeval timelimit;
- struct timeval tv;
-
- /*
- * Scan round-robin to the next server that has some
- * tries left. There is guaranteed to be one, or we
- * would have exited this loop by now.
- */
- while (h->servers[srv].num_tries >=
- h->servers[srv].max_tries)
- if (++srv >= h->num_servers)
- srv = 0;
-
- /* Insert the scrambled password into the request */
- insert_scrambled_password(h, srv);
-
- /* Send the request */
- n = sendto(h->fd, h->request, h->req_len, 0,
- (const struct sockaddr *)&h->servers[srv].addr,
- sizeof h->servers[srv].addr);
- if (n != h->req_len) {
- if (n == -1)
- generr(h, "sendto: %s", strerror(errno));
- else
- generr(h, "sendto: short write");
- return -1;
- }
- h->servers[srv].num_tries++;
-
- /* Wait for a valid response */
- gettimeofday(&timelimit, NULL);
- timelimit.tv_sec += h->servers[srv].timeout;
-
- tv.tv_sec = h->servers[srv].timeout;
- tv.tv_usec = 0;
- for ( ; ; ) {
- fd_set readfds;
-
- FD_ZERO(&readfds);
- FD_SET(h->fd, &readfds);
- n = select(h->fd + 1, &readfds, NULL, NULL, &tv);
- if (n == -1) {
- generr(h, "select: %s", strerror(errno));
- return -1;
- }
- if (n == 0) /* Timed out */
- break;
- if (FD_ISSET(h->fd, &readfds)) {
- struct sockaddr_in from;
- int fromlen;
-
- fromlen = sizeof from;
- h->resp_len = recvfrom(h->fd, h->response,
- MSGSIZE, MSG_WAITALL,
- (struct sockaddr *)&from, &fromlen);
- if (h->resp_len == -1) {
- generr(h, "recvfrom: %s",
- strerror(errno));
- return -1;
- }
- if (is_valid_response(h, srv, &from)) {
- got_valid_response = 1;
- break;
- }
- }
- /* Compute a new timeout */
- gettimeofday(&tv, NULL);
- timersub(&timelimit, &tv, &tv);
- if (tv.tv_sec < 0) /* Still poll once more */
- timerclear(&tv);
- }
- if (got_valid_response)
- break;
- /* Advance to the next server */
- if (++srv >= h->num_servers)
- srv = 0;
- }
- if (!got_valid_response) {
- generr(h, "No valid RADIUS responses received");
- return -1;
- }
- h->resp_len = h->response[POS_LENGTH] << 8 | h->response[POS_LENGTH+1];
- h->resp_pos = POS_ATTRS;
- return h->response[POS_CODE];
-}
-
-const char *
-rad_strerror(struct rad_handle *h)
-{
- return h->errmsg;
-}
-
-/*
- * Destructively split a string into fields separated by white space.
- * `#' at the beginning of a field begins a comment that extends to the
- * end of the string. Fields may be quoted with `"'. Inside quoted
- * strings, the backslash escapes `\"' and `\\' are honored.
- *
- * Pointers to up to the first maxfields fields are stored in the fields
- * array. Missing fields get NULL pointers.
- *
- * The return value is the actual number of fields parsed, and is always
- * <= maxfields.
- *
- * On a syntax error, places a message in the msg string, and returns -1.
- */
-static int
-split(char *str, char *fields[], int maxfields, char *msg, size_t msglen)
-{
- char *p;
- int i;
- static const char ws[] = " \t";
-
- for (i = 0; i < maxfields; i++)
- fields[i] = NULL;
- p = str;
- i = 0;
- while (*p != '\0') {
- p += strspn(p, ws);
- if (*p == '#' || *p == '\0')
- break;
- if (i >= maxfields) {
- snprintf(msg, msglen, "line has too many fields");
- return -1;
- }
- if (*p == '"') {
- char *dst;
-
- dst = ++p;
- fields[i] = dst;
- while (*p != '"') {
- if (*p == '\\') {
- p++;
- if (*p != '"' && *p != '\\' &&
- *p != '\0') {
- snprintf(msg, msglen,
- "invalid `\\' escape");
- return -1;
- }
- }
- if (*p == '\0') {
- snprintf(msg, msglen,
- "unterminated quoted string");
- return -1;
- }
- *dst++ = *p++;
- }
- *dst = '\0';
- p++;
- if (*fields[i] == '\0') {
- snprintf(msg, msglen,
- "empty quoted string not permitted");
- return -1;
- }
- if (*p != '\0' && strspn(p, ws) == 0) {
- snprintf(msg, msglen, "quoted string not"
- " followed by white space");
- return -1;
- }
- } else {
- fields[i] = p;
- p += strcspn(p, ws);
- if (*p != '\0')
- *p++ = '\0';
- }
- i++;
- }
- return i;
-}
diff --git a/lib/libradius/radlib.h b/lib/libradius/radlib.h
deleted file mode 100644
index 146bcd51b29a..000000000000
--- a/lib/libradius/radlib.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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 _RADLIB_H_
-#define _RADLIB_H_
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-/* Message types */
-#define RAD_ACCESS_REQUEST 1
-#define RAD_ACCESS_ACCEPT 2
-#define RAD_ACCESS_REJECT 3
-#define RAD_ACCESS_CHALLENGE 11
-
-/* Attribute types and values */
-#define RAD_USER_NAME 1 /* String */
-#define RAD_USER_PASSWORD 2 /* String */
-#define RAD_CHAP_PASSWORD 3 /* String */
-#define RAD_NAS_IP_ADDRESS 4 /* IP address */
-#define RAD_NAS_PORT 5 /* Integer */
-#define RAD_SERVICE_TYPE 6 /* Integer */
- #define RAD_LOGIN 1
- #define RAD_FRAMED 2
- #define RAD_CALLBACK_LOGIN 3
- #define RAD_CALLBACK_FRAMED 4
- #define RAD_OUTBOUND 5
- #define RAD_ADMINISTRATIVE 6
- #define RAD_NAS_PROMPT 7
- #define RAD_AUTHENTICATE_ONLY 8
- #define RAD_CALLBACK_NAS_PROMPT 9
-#define RAD_FRAMED_PROTOCOL 7 /* Integer */
- #define RAD_PPP 1
- #define RAD_SLIP 2
- #define RAD_ARAP 3 /* Appletalk */
- #define RAD_GANDALF 4
- #define RAD_XYLOGICS 5
-#define RAD_FRAMED_IP_ADDRESS 8 /* IP address */
-#define RAD_FRAMED_IP_NETMASK 9 /* IP address */
-#define RAD_FRAMED_ROUTING 10 /* Integer */
-#define RAD_FILTER_ID 11 /* String */
-#define RAD_FRAMED_MTU 12 /* Integer */
-#define RAD_FRAMED_COMPRESSION 13 /* Integer */
-#define RAD_LOGIN_IP_HOST 14 /* IP address */
-#define RAD_LOGIN_SERVICE 15 /* Integer */
-#define RAD_LOGIN_TCP_PORT 16 /* Integer */
- /* unassiged 17 */
-#define RAD_REPLY_MESSAGE 18 /* String */
-#define RAD_CALLBACK_NUMBER 19 /* String */
-#define RAD_CALLBACK_ID 20 /* String */
- /* unassiged 21 */
-#define RAD_FRAMED_ROUTE 22 /* String */
-#define RAD_FRAMED_IPX_NETWORK 23 /* IP address */
-#define RAD_STATE 24 /* String */
-#define RAD_CLASS 25 /* Integer */
-#define RAD_VENDOR_SPECIFIC 26 /* Integer */
-#define RAD_SESSION_TIMEOUT 27 /* Integer */
-#define RAD_IDLE_TIMEOUT 28 /* Integer */
-#define RAD_TERMINATION_ACTION 29 /* Integer */
-#define RAD_CALLED_STATION_ID 30 /* String */
-#define RAD_CALLING_STATION_ID 31 /* String */
-#define RAD_NAS_IDENTIFIER 32 /* Integer */
-#define RAD_PROXY_STATE 33 /* Integer */
-#define RAD_LOGIN_LAT_SERVICE 34 /* Integer */
-#define RAD_LOGIN_LAT_NODE 35 /* Integer */
-#define RAD_LOGIN_LAT_GROUP 36 /* Integer */
-#define RAD_FRAMED_APPLETALK_LINK 37 /* Integer */
-#define RAD_FRAMED_APPLETALK_NETWORK 38 /* Integer */
-#define RAD_FRAMED_APPLETALK_ZONE 39 /* Integer */
- /* reserved for accounting 40-59 */
-#define RAD_CHAP_CHALLENGE 60 /* String */
-#define RAD_NAS_PORT_TYPE 61 /* Integer */
-#define RAD_PORT_LIMIT 62 /* Integer */
-#define RAD_LOGIN_LAT_PORT 63 /* Integer */
-
-struct rad_handle;
-
-__BEGIN_DECLS
-int rad_add_server(struct rad_handle *,
- const char *, int, const char *, int, int);
-void rad_close(struct rad_handle *);
-int rad_config(struct rad_handle *, const char *);
-int rad_create_request(struct rad_handle *, int);
-struct in_addr rad_cvt_addr(const void *);
-u_int32_t rad_cvt_int(const void *);
-char *rad_cvt_string(const void *, size_t);
-int rad_get_attr(struct rad_handle *, const void **,
- size_t *);
-struct rad_handle *rad_open(void);
-int rad_put_addr(struct rad_handle *, int, struct in_addr);
-int rad_put_attr(struct rad_handle *, int,
- const void *, size_t);
-int rad_put_int(struct rad_handle *, int, u_int32_t);
-int rad_put_string(struct rad_handle *, int,
- const char *);
-int rad_send_request(struct rad_handle *);
-const char *rad_strerror(struct rad_handle *);
-__END_DECLS
-
-#endif /* _RADLIB_H_ */
diff --git a/lib/libradius/radlib_private.h b/lib/libradius/radlib_private.h
deleted file mode 100644
index d3301e326192..000000000000
--- a/lib/libradius/radlib_private.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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 RADLIB_PRIVATE_H
-#define RADLIB_PRIVATE_H
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#include "radlib.h"
-
-/* Defaults */
-#define MAXTRIES 3
-#define PATH_RADIUS_CONF "/etc/radius.conf"
-#define RADIUS_PORT 1812
-#define TIMEOUT 3 /* In seconds */
-
-/* Limits */
-#define ERRSIZE 128 /* Maximum error message length */
-#define MAXCONFLINE 1024 /* Maximum config file line length */
-#define MAXSERVERS 10 /* Maximum number of servers to try */
-#define MSGSIZE 4096 /* Maximum RADIUS message */
-#define PASSSIZE 128 /* Maximum significant password chars */
-
-/* Positions of fields in RADIUS messages */
-#define POS_CODE 0 /* Message code */
-#define POS_IDENT 1 /* Identifier */
-#define POS_LENGTH 2 /* Message length */
-#define POS_AUTH 4 /* Authenticator */
-#define LEN_AUTH 16 /* Length of authenticator */
-#define POS_ATTRS 20 /* Start of attributes */
-
-struct rad_server {
- struct sockaddr_in addr; /* Address of server */
- char *secret; /* Shared secret */
- int timeout; /* Timeout in seconds */
- int max_tries; /* Number of tries before giving up */
- int num_tries; /* Number of tries so far */
-};
-
-struct rad_handle {
- int fd; /* Socket file descriptor */
- struct rad_server servers[MAXSERVERS]; /* Servers to contact */
- int num_servers; /* Number of valid server entries */
- int ident; /* Current identifier value */
- char errmsg[ERRSIZE]; /* Most recent error message */
- unsigned char request[MSGSIZE]; /* Request to send */
- int req_len; /* Length of request */
- char pass[PASSSIZE]; /* Cleartext password */
- int pass_len; /* Length of cleartext password */
- int pass_pos; /* Position of scrambled password */
- unsigned char response[MSGSIZE]; /* Response received */
- int resp_len; /* Length of response */
- int resp_pos; /* Current position scanning attrs */
-};
-
-#endif
diff --git a/lib/libskey/Makefile b/lib/libskey/Makefile
index 4ad0fe344735..25f99fe8bc19 100644
--- a/lib/libskey/Makefile
+++ b/lib/libskey/Makefile
@@ -15,8 +15,10 @@ CFLAGS+=-W -Wall
CFLAGS+=-Werror
.endif
+.if ${OBJFORMAT} == elf
DPADD+= ${LIBCRYPT} ${LIBMD}
LDADD+= -lcrypt -lmd
+.endif
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/skey.h \
diff --git a/lib/libskey/put.c b/lib/libskey/put.c
index e57d9ca9ce4c..fd262a4d3db7 100644
--- a/lib/libskey/put.c
+++ b/lib/libskey/put.c
@@ -2137,7 +2137,7 @@ char *e;
standard(word);
if( (v = wsrch(word,low,high)) < 0 )
return 0;
- insert(b,v,(int)p,11);
+ insert(b,v,p,11);
}
/* now check the parity of what we got */
diff --git a/lib/libskey/skey.h b/lib/libskey/skey.h
index e62d507e0c8e..6dc564bd4e40 100644
--- a/lib/libskey/skey.h
+++ b/lib/libskey/skey.h
@@ -55,6 +55,6 @@ int skeychallenge __P((struct skey *mp, const char *name, char *challenge));
int skeyinfo __P((struct skey *mp, const char* name, char *ss));
int skeyaccess __P((char *user, const char *port, const char *host, const char *addr));
char *skey_getpass __P((const char *prompt, struct passwd * pwd, int pwok));
-const char *skey_crypt __P((char *pp, char *salt, struct passwd *pwd, int pwok));
+char *skey_crypt __P((char *pp, char *salt, struct passwd *pwd, int pwok));
#endif /* _SKEY_H_ */
diff --git a/lib/libskey/skey_crypt.c b/lib/libskey/skey_crypt.c
index 4e3a141333a5..6ed6bdb154ae 100644
--- a/lib/libskey/skey_crypt.c
+++ b/lib/libskey/skey_crypt.c
@@ -3,13 +3,12 @@
#include <string.h>
#include <stdio.h>
#include <pwd.h>
-#include <unistd.h>
#include "skey.h"
/* skey_crypt - return encrypted UNIX passwd if s/key or regular password ok */
-const char *skey_crypt(pp, salt, pwd, pwok)
+char *skey_crypt(pp, salt, pwd, pwok)
char *pp;
char *salt;
struct passwd *pwd;
@@ -17,6 +16,7 @@ int pwok;
{
struct skey skey;
char *p;
+ char *crypt();
/* Try s/key authentication even when the UNIX password is permitted. */
diff --git a/lib/libskey/skeyaccess.c b/lib/libskey/skeyaccess.c
index b5796abe0b0b..5a6e2d3a2963 100644
--- a/lib/libskey/skeyaccess.c
+++ b/lib/libskey/skeyaccess.c
@@ -45,12 +45,12 @@
*/
static char *prev_token = 0; /* push-back buffer */
static char *line_pointer = NULL;
-static char *first_token __P((char *, int, FILE *));
+static char *first_token();
static int line_number;
-static void unget_token __P((char *));
-static char *get_token __P((void));
-static char *need_token __P((void));
-static char *need_internet_addr __P((void));
+static void unget_token();
+static char *get_token();
+static char *need_token();
+static char *need_internet_addr();
/*
* Various forms of token matching.
@@ -58,13 +58,12 @@ static char *need_internet_addr __P((void));
#define match_host_name(l) match_token((l)->host_name)
#define match_port(l) match_token((l)->port)
#define match_user(l) match_token((l)->user)
-struct login_info;
-static int match_internet_addr __P((struct login_info *));
-static int match_group __P((struct login_info *));
-static int match_token __P((char *));
-static int is_internet_addr __P((char *));
-static struct in_addr *convert_internet_addr __P((char *));
-static struct in_addr *lookup_internet_addr __P((char *));
+static int match_internet_addr();
+static int match_group();
+static int match_token();
+static int is_internet_addr();
+static struct in_addr *convert_internet_addr();
+static struct in_addr *lookup_internet_addr();
#define MAX_ADDR 32
#define PERMIT 1
@@ -84,8 +83,7 @@ struct login_info {
char *port; /* login port */
};
-static int _skeyaccess __P((FILE *, struct login_info *));
-int skeyaccess __P((char *, char *, char *, char *));
+static int _skeyaccess __P(( FILE *, struct login_info * ));
/* skeyaccess - find out if UNIX passwords are permitted */
@@ -410,7 +408,7 @@ char *host;
for (i = 0; i < MAX_ADDR && hp->h_addr_list[i]; i++)
memcpy((char *) &list[i],
- hp->h_addr_list[i], (size_t)hp->h_length);
+ hp->h_addr_list[i], hp->h_length);
list[i].s_addr = 0;
strncpy(buf, hp->h_name, MAXHOSTNAMELEN);
@@ -429,12 +427,12 @@ char *host;
if ((hp = gethostbyaddr((char *) &list[i], length, AF_INET)) == 0) {
syslog(LOG_ERR, "address %s not registered for host %s",
inet_ntoa(list[i]), buf);
- list[i].s_addr = (u_int32_t) -1;
+ list[i].s_addr = -1;
}
if (NEQ(buf, hp->h_name) && NEQ3(buf, "localhost.", 10)) {
syslog(LOG_ERR, "address %s registered for host %s and %s",
inet_ntoa(list[i]), hp->h_name, buf);
- list[i].s_addr = (u_int32_t) -1;
+ list[i].s_addr = -1;
}
}
return (list);
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index 75e62458bc3a..96de96feacb5 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -22,11 +22,11 @@
#include "skey.h"
#include "pathnames.h"
-static char *skipspace __P((char *));
+static char *skipspace();
#define setpriority(x,y,z) /* nothing */
-static const char *month[12] = {
+static char *month[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c
index 81284443e7a7..ba88d8c8370b 100644
--- a/lib/libskey/skeysubr.c
+++ b/lib/libskey/skeysubr.c
@@ -73,8 +73,6 @@ char *buf;
static struct termios saved_ttymode;
-static void interrupt __P((int));
-
static void interrupt(sig)
int sig;
{
@@ -88,7 +86,7 @@ char *buf;
int n;
{
struct termios noecho_ttymode;
- void (*oldsig) __P((int));
+ void (*oldsig)();
/* Save normal line editing modes */
tcgetattr(0, &saved_ttymode);
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 5c207be2159a..84e031d89e03 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/11/04 07:39:53 msmith Exp $
+# $Id: Makefile,v 1.5 1998/10/04 08:10:29 msmith Exp $
#
# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
#
@@ -13,16 +13,16 @@ NOPIC= YES
MAN3= libstand.3
# Mostly OK, some of the libc imports are a bit noisy
-CFLAGS+= -Wall -g
+CFLAGS+= -Wall #-g
.if ${MACHINE_ARCH} == "alpha"
CFLAGS+= -mno-fp-regs
.endif
# standalone components and stuff we have modified locally
-SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
- globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
- sbrk.c twiddle.c zalloc.c zalloc_malloc.c
+SRCS+= __main.c bcd.c bswap.c environment.c getopt.c gets.c globals.c \
+ pager.c printf.c strdup.c strerror.c strtol.c random.c sbrk.c \
+ twiddle.c zalloc.c zalloc_malloc.c
# private (pruned) versions of libc string functions
SRCS+= strcasecmp.c
@@ -31,7 +31,7 @@ SRCS+= strcasecmp.c
.PATH: ${.CURDIR}/../libc/string
.if ${MACHINE_ARCH} == "i386"
SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
- memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
+ memcpy.c memmove.c memset.c rindex.c strcat.c strchr.c \
strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.endif
@@ -90,12 +90,6 @@ __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
.PATH: ${.CURDIR}/../libc/net
SRCS+= inet_ntoa.c inet_addr.c
-# _setjmp/_longjmp
-.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/gen
-SRCS+= _setjmp.S
-# really only required for i386
-CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
-
# decompression functionality from libz
.PATH: ${.CURDIR}/../libz
CFLAGS+=-DHAVE_MEMCPY
diff --git a/lib/libstand/assert.c b/lib/libstand/assert.c
deleted file mode 100644
index 1ca15f86be95..000000000000
--- a/lib/libstand/assert.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith.
- * 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.
- *
- * $Id$
- */
-
-#include <stand.h>
-#include <assert.h>
-
-void
-__assert(const char *file, int line, const char *expression)
-{
- printf("assertion \"%s\" failed: file \"%s\", line %d\n", expression, file, line);
- exit();
-}
diff --git a/lib/libstand/dev_net.c b/lib/libstand/dev_net.c
index cfa9fbff8a94..8d09e4f7c084 100644
--- a/lib/libstand/dev_net.c
+++ b/lib/libstand/dev_net.c
@@ -73,8 +73,6 @@ static int netdev_opens;
static int net_getparams(int sock);
-static void net_print(int verbose);
-
struct devsw netdev = {
"net",
DEVT_NET,
@@ -83,20 +81,9 @@ struct devsw netdev = {
net_open,
net_close,
noioctl
- net_print,
};
/*
- * Print stuff about our net 'device'.
- */
-static void
-net_print(int verbose)
-{
- pager_output(" net: network interface");
- /* XXX much more verbose stuff here */
-}
-
-/*
* Called by devopen after it sets f->f_dev to our devsw entry.
* This opens the low-level device and sets f->f_devdata.
* This is declared with variable arguments...
diff --git a/lib/libstand/gets.c b/lib/libstand/gets.c
index dc26a998b325..3fbe9b4047a3 100644
--- a/lib/libstand/gets.c
+++ b/lib/libstand/gets.c
@@ -95,11 +95,8 @@ fgetstr(char *buf, int size, int fd)
err = read(fd, &c, sizeof(c));
if (err < 0) /* read error */
return(-1);
- if (err == 0) { /* EOF */
- if (len == 0)
- return(-1); /* nothing to read */
+ if (err == 0) /* EOF */
break;
- }
if ((c == '\r') || /* line terminators */
(c == '\n'))
break;
diff --git a/lib/libstand/libstand.3 b/lib/libstand/libstand.3
index aa5365ed43d7..4d4b287b3583 100644
--- a/lib/libstand/libstand.3
+++ b/lib/libstand/libstand.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: libstand.3,v 1.2 1998/11/01 09:31:08 msmith Exp $
+.\" $Id$
.\"
.Dd June 22, 1998
.Dt LIBSTAND 3
@@ -124,19 +124,6 @@ may be used to prevent a variable being unset.
.Pp
Returns error messages for the subset of errno values supported by
.Nm No .
-.It Fn "assert" "expression"
-.Pp
-Requires
-.Fd #include <assert.h>
-.It Fn "int setjmp" "jmp_buf env"
-.It Fn "void longjmp" "jmp_buf env" "int val"
-.Pp
-Defined as
-.Fn _setjmp
-and
-.Fn _lonjmp
-respectively as there is no signal state to manipulate. Requires
-.Fd #include <setjmp.h>
.El
.Sh CHARACTER I/O
.Bl -hang -width 10n
@@ -168,7 +155,6 @@ if successful, or -1 if a read error occurs.
.It Fn "int printf" "const char *fmt" "..."
.It Fn "void vprintf" "const char *fmt" "va_list ap"
.It Fn "int sprintf" "char *buf" "const char *fmt" "..."
-.It Fn "void vsprintf" "char *buf" "const char *fmt" "va_list ap"
.Pp
The *printf functions implement a subset of the standard
.Fn printf
@@ -462,10 +448,6 @@ and
.Nm libkern
from
.Fx 3.0 .
-.It
-.Nm zalloc
-from
-.An Matthew Dillon Aq dillon@backplane.com
.El
.Pp
The reorganisation and port to
diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c
index 5135e10183a9..8c7b38477a7e 100644
--- a/lib/libstand/printf.c
+++ b/lib/libstand/printf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- * $Id: printf.c,v 1.1.1.1 1998/08/20 08:19:55 msmith Exp $
+ * $Id: subr_prf.c,v 1.46 1998/05/28 09:30:20 phk Exp $
*/
/*
@@ -74,6 +74,9 @@ vprintf(const char *fmt, va_list ap)
kvprintf(fmt, putchar, NULL, 10, ap);
}
+/*
+ * Scaled down version of sprintf(3).
+ */
int
sprintf(char *buf, const char *cfmt, ...)
{
@@ -87,15 +90,6 @@ sprintf(char *buf, const char *cfmt, ...)
return retval;
}
-void
-vsprintf(char *buf, const char *cfmt, va_list ap)
-{
- int retval;
-
- retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap);
- buf[retval] = '\0';
-}
-
/*
* Put a number (base <= 16) in a buffer in reverse order; return an
* optional length and a pointer to the NULL terminated (preceded?)
diff --git a/lib/libstand/qdivrem.c b/lib/libstand/qdivrem.c
deleted file mode 100644
index d42b9f507021..000000000000
--- a/lib/libstand/qdivrem.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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 University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * $Id$
- * From: Id: qdivrem.c,v 1.7 1997/11/07 09:20:40 phk Exp
- */
-
-/*
- * Multiprecision divide. This algorithm is from Knuth vol. 2 (2nd ed),
- * section 4.3.1, pp. 257--259.
- */
-
-#include "quad.h"
-
-#define B (1 << HALF_BITS) /* digit base */
-
-/* Combine two `digits' to make a single two-digit number. */
-#define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b))
-
-/* select a type for digits in base B: use unsigned short if they fit */
-#if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff
-typedef unsigned short digit;
-#else
-typedef u_long digit;
-#endif
-
-/*
- * Shift p[0]..p[len] left `sh' bits, ignoring any bits that
- * `fall out' the left (there never will be any such anyway).
- * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS.
- */
-static void
-shl(register digit *p, register int len, register int sh)
-{
- register int i;
-
- for (i = 0; i < len; i++)
- p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh));
- p[i] = LHALF(p[i] << sh);
-}
-
-/*
- * __qdivrem(u, v, rem) returns u/v and, optionally, sets *rem to u%v.
- *
- * We do this in base 2-sup-HALF_BITS, so that all intermediate products
- * fit within u_long. As a consequence, the maximum length dividend and
- * divisor are 4 `digits' in this base (they are shorter if they have
- * leading zeros).
- */
-u_quad_t
-__qdivrem(uq, vq, arq)
- u_quad_t uq, vq, *arq;
-{
- union uu tmp;
- digit *u, *v, *q;
- register digit v1, v2;
- u_long qhat, rhat, t;
- int m, n, d, j, i;
- digit uspace[5], vspace[5], qspace[5];
-
- /*
- * Take care of special cases: divide by zero, and u < v.
- */
- if (vq == 0) {
- /* divide by zero. */
- static volatile const unsigned int zero = 0;
-
- tmp.ul[H] = tmp.ul[L] = 1 / zero;
- if (arq)
- *arq = uq;
- return (tmp.q);
- }
- if (uq < vq) {
- if (arq)
- *arq = uq;
- return (0);
- }
- u = &uspace[0];
- v = &vspace[0];
- q = &qspace[0];
-
- /*
- * Break dividend and divisor into digits in base B, then
- * count leading zeros to determine m and n. When done, we
- * will have:
- * u = (u[1]u[2]...u[m+n]) sub B
- * v = (v[1]v[2]...v[n]) sub B
- * v[1] != 0
- * 1 < n <= 4 (if n = 1, we use a different division algorithm)
- * m >= 0 (otherwise u < v, which we already checked)
- * m + n = 4
- * and thus
- * m = 4 - n <= 2
- */
- tmp.uq = uq;
- u[0] = 0;
- u[1] = HHALF(tmp.ul[H]);
- u[2] = LHALF(tmp.ul[H]);
- u[3] = HHALF(tmp.ul[L]);
- u[4] = LHALF(tmp.ul[L]);
- tmp.uq = vq;
- v[1] = HHALF(tmp.ul[H]);
- v[2] = LHALF(tmp.ul[H]);
- v[3] = HHALF(tmp.ul[L]);
- v[4] = LHALF(tmp.ul[L]);
- for (n = 4; v[1] == 0; v++) {
- if (--n == 1) {
- u_long rbj; /* r*B+u[j] (not root boy jim) */
- digit q1, q2, q3, q4;
-
- /*
- * Change of plan, per exercise 16.
- * r = 0;
- * for j = 1..4:
- * q[j] = floor((r*B + u[j]) / v),
- * r = (r*B + u[j]) % v;
- * We unroll this completely here.
- */
- t = v[2]; /* nonzero, by definition */
- q1 = u[1] / t;
- rbj = COMBINE(u[1] % t, u[2]);
- q2 = rbj / t;
- rbj = COMBINE(rbj % t, u[3]);
- q3 = rbj / t;
- rbj = COMBINE(rbj % t, u[4]);
- q4 = rbj / t;
- if (arq)
- *arq = rbj % t;
- tmp.ul[H] = COMBINE(q1, q2);
- tmp.ul[L] = COMBINE(q3, q4);
- return (tmp.q);
- }
- }
-
- /*
- * By adjusting q once we determine m, we can guarantee that
- * there is a complete four-digit quotient at &qspace[1] when
- * we finally stop.
- */
- for (m = 4 - n; u[1] == 0; u++)
- m--;
- for (i = 4 - m; --i >= 0;)
- q[i] = 0;
- q += 4 - m;
-
- /*
- * Here we run Program D, translated from MIX to C and acquiring
- * a few minor changes.
- *
- * D1: choose multiplier 1 << d to ensure v[1] >= B/2.
- */
- d = 0;
- for (t = v[1]; t < B / 2; t <<= 1)
- d++;
- if (d > 0) {
- shl(&u[0], m + n, d); /* u <<= d */
- shl(&v[1], n - 1, d); /* v <<= d */
- }
- /*
- * D2: j = 0.
- */
- j = 0;
- v1 = v[1]; /* for D3 -- note that v[1..n] are constant */
- v2 = v[2]; /* for D3 */
- do {
- register digit uj0, uj1, uj2;
-
- /*
- * D3: Calculate qhat (\^q, in TeX notation).
- * Let qhat = min((u[j]*B + u[j+1])/v[1], B-1), and
- * let rhat = (u[j]*B + u[j+1]) mod v[1].
- * While rhat < B and v[2]*qhat > rhat*B+u[j+2],
- * decrement qhat and increase rhat correspondingly.
- * Note that if rhat >= B, v[2]*qhat < rhat*B.
- */
- uj0 = u[j + 0]; /* for D3 only -- note that u[j+...] change */
- uj1 = u[j + 1]; /* for D3 only */
- uj2 = u[j + 2]; /* for D3 only */
- if (uj0 == v1) {
- qhat = B;
- rhat = uj1;
- goto qhat_too_big;
- } else {
- u_long nn = COMBINE(uj0, uj1);
- qhat = nn / v1;
- rhat = nn % v1;
- }
- while (v2 * qhat > COMBINE(rhat, uj2)) {
- qhat_too_big:
- qhat--;
- if ((rhat += v1) >= B)
- break;
- }
- /*
- * D4: Multiply and subtract.
- * The variable `t' holds any borrows across the loop.
- * We split this up so that we do not require v[0] = 0,
- * and to eliminate a final special case.
- */
- for (t = 0, i = n; i > 0; i--) {
- t = u[i + j] - v[i] * qhat - t;
- u[i + j] = LHALF(t);
- t = (B - HHALF(t)) & (B - 1);
- }
- t = u[j] - t;
- u[j] = LHALF(t);
- /*
- * D5: test remainder.
- * There is a borrow if and only if HHALF(t) is nonzero;
- * in that (rare) case, qhat was too large (by exactly 1).
- * Fix it by adding v[1..n] to u[j..j+n].
- */
- if (HHALF(t)) {
- qhat--;
- for (t = 0, i = n; i > 0; i--) { /* D6: add back. */
- t += u[i + j] + v[i];
- u[i + j] = LHALF(t);
- t = HHALF(t);
- }
- u[j] = LHALF(u[j] + t);
- }
- q[j] = qhat;
- } while (++j <= m); /* D7: loop on j. */
-
- /*
- * If caller wants the remainder, we have to calculate it as
- * u[m..m+n] >> d (this is at most n digits and thus fits in
- * u[m+1..m+n], but we may need more source digits).
- */
- if (arq) {
- if (d) {
- for (i = m + n; i > m; --i)
- u[i] = (u[i] >> d) |
- LHALF(u[i - 1] << (HALF_BITS - d));
- u[i] = 0;
- }
- tmp.ul[H] = COMBINE(uspace[1], uspace[2]);
- tmp.ul[L] = COMBINE(uspace[3], uspace[4]);
- *arq = tmp.q;
- }
-
- tmp.ul[H] = COMBINE(qspace[1], qspace[2]);
- tmp.ul[L] = COMBINE(qspace[3], qspace[4]);
- return (tmp.q);
-}
-
-/*
- * Divide two unsigned quads.
- */
-
-u_quad_t
-__udivdi3(a, b)
- u_quad_t a, b;
-{
-
- return (__qdivrem(a, b, (u_quad_t *)0));
-}
-
-/*
- * Return remainder after dividing two unsigned quads.
- */
-u_quad_t
-__umoddi3(a, b)
- u_quad_t a, b;
-{
- u_quad_t r;
-
- (void)__qdivrem(a, b, &r);
- return (r);
-}
diff --git a/lib/libstand/quad.h b/lib/libstand/quad.h
deleted file mode 100644
index bddca839a504..000000000000
--- a/lib/libstand/quad.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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 University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * @(#)quad.h 8.1 (Berkeley) 6/4/93
- * $Id: quad.h,v 1.6 1997/02/22 09:39:58 peter Exp $
- */
-
-/*
- * Quad arithmetic.
- *
- * This library makes the following assumptions:
- *
- * - The type long long (aka quad_t) exists.
- *
- * - A quad variable is exactly twice as long as `long'.
- *
- * - The machine's arithmetic is two's complement.
- *
- * This library can provide 128-bit arithmetic on a machine with 128-bit
- * quads and 64-bit longs, for instance, or 96-bit arithmetic on machines
- * with 48-bit longs.
- */
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <limits.h>
-
-/*
- * Depending on the desired operation, we view a `long long' (aka quad_t) in
- * one or more of the following formats.
- */
-union uu {
- quad_t q; /* as a (signed) quad */
- quad_t uq; /* as an unsigned quad */
- long sl[2]; /* as two signed longs */
- u_long ul[2]; /* as two unsigned longs */
-};
-
-/*
- * Define high and low longwords.
- */
-#define H _QUAD_HIGHWORD
-#define L _QUAD_LOWWORD
-
-/*
- * Total number of bits in a quad_t and in the pieces that make it up.
- * These are used for shifting, and also below for halfword extraction
- * and assembly.
- */
-#define QUAD_BITS (sizeof(quad_t) * CHAR_BIT)
-#define LONG_BITS (sizeof(long) * CHAR_BIT)
-#define HALF_BITS (sizeof(long) * CHAR_BIT / 2)
-
-/*
- * Extract high and low shortwords from longword, and move low shortword of
- * longword to upper half of long, i.e., produce the upper longword of
- * ((quad_t)(x) << (number_of_bits_in_long/2)). (`x' must actually be u_long.)
- *
- * These are used in the multiply code, to split a longword into upper
- * and lower halves, and to reassemble a product as a quad_t, shifted left
- * (sizeof(long)*CHAR_BIT/2).
- */
-#define HHALF(x) ((x) >> HALF_BITS)
-#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1))
-#define LHUP(x) ((x) << HALF_BITS)
-
-quad_t __divdi3 __P((quad_t a, quad_t b));
-quad_t __moddi3 __P((quad_t a, quad_t b));
-u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem));
-u_quad_t __udivdi3 __P((u_quad_t a, u_quad_t b));
-u_quad_t __umoddi3 __P((u_quad_t a, u_quad_t b));
-
-/*
- * XXX
- * Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument
- * as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use
- * both compilers.
- */
-#if __GNUC__ >= 2
-typedef unsigned int qshift_t;
-#else
-typedef u_quad_t qshift_t;
-#endif
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index 74abcd7660b3..4199fd672e46 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: stand.h,v 1.12 1998/11/04 07:39:53 msmith Exp $
+ * $Id: stand.h,v 1.6 1998/09/26 10:48:50 dfr Exp $
* From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $
*/
@@ -137,7 +137,6 @@ struct devsw {
int (*dv_open)(struct open_file *f, ...);
int (*dv_close)(struct open_file *f);
int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data);
- void (*dv_print)(int verbose); /* print device information */
};
extern int errno;
@@ -162,7 +161,7 @@ extern struct open_file files[];
#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#define isspace(c) ((c) == ' ' || ((c) >= 0x9 && (c) <= 0xd))
+#define isspace(c) ((c) == ' ' || (c) == '\t')
#define isdigit(c) ((c) >= '0' && (c) <= '9')
#define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
#define isascii(c) ((c) >= 0 || (c <= 0x7f))
@@ -182,9 +181,6 @@ extern void *calloc(size_t n1, size_t n2);
extern void *realloc(void *ptr, size_t size);
extern void *reallocf(void *ptr, size_t size);
extern void mallocstats(void);
-#ifdef __alpha__
-extern void free_region(void *start, void *end);
-#endif
/* disklabel support (undocumented, may be junk) */
struct disklabel;
@@ -194,7 +190,6 @@ extern int dkcksum(struct disklabel *);
extern int printf(const char *fmt, ...);
extern void vprintf(const char *fmt, _BSD_VA_LIST_);
extern int sprintf(char *buf, const char *cfmt, ...);
-extern void vsprintf(char *buf, const char *cfmt, _BSD_VA_LIST_);
extern void twiddle(void);
@@ -220,7 +215,7 @@ extern u_long random(void);
extern long strtol(const char *, char **, int);
extern char * strerror(int err);
extern char *optarg; /* getopt(3) external variables */
-extern int optind, opterr, optopt, optreset;
+extern int optind, opterr, optopt;
extern int getopt(int, char * const [], const char *);
/* pager.c */
@@ -229,10 +224,6 @@ extern void pager_close(void);
extern int pager_output(const char *lines);
extern int pager_file(const char *fname);
-/* No signal state to preserve */
-#define setjmp _setjmp
-#define longjmp _longjmp
-
/* environment.c */
#define EV_DYNAMIC (1<<0) /* value was dynamically allocated, free if changed/unset */
#define EV_VOLATILE (1<<1) /* value is volatile, make a copy of it */
diff --git a/lib/libstand/zalloc_defs.h b/lib/libstand/zalloc_defs.h
index 051c53fffb12..d3f46da410aa 100644
--- a/lib/libstand/zalloc_defs.h
+++ b/lib/libstand/zalloc_defs.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: zalloc_defs.h,v 1.4 1998/10/16 19:23:37 msmith Exp $
+ * $Id: zalloc_defs.h,v 1.2 1998/09/26 10:48:50 dfr Exp $
*/
/*
@@ -63,7 +63,7 @@ typedef long saddr_t; /* signed int same size as pointer */
* block extension for sbrk()
*/
-#define BLKEXTEND (4 * 1024)
+#define BLKEXTEND (64 * 1024)
#define BLKEXTENDMASK (BLKEXTEND - 1)
/*
diff --git a/lib/libstand/zalloc_malloc.c b/lib/libstand/zalloc_malloc.c
index d70a8f7577c0..6cb4953ef312 100644
--- a/lib/libstand/zalloc_malloc.c
+++ b/lib/libstand/zalloc_malloc.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: zalloc_malloc.c,v 1.3 1998/10/01 17:35:08 msmith Exp $
+ * $Id: zalloc_malloc.c,v 1.2 1998/09/26 10:48:50 dfr Exp $
*/
/*
@@ -49,15 +49,6 @@ void mallocstats(void);
#undef free
#endif
-#ifdef __alpha__
-void
-free_region(void *start, void *end)
-{
- zextendPool(&MallocPool, start, (caddr_t)end - (caddr_t)start);
- zfree(&MallocPool, start, (caddr_t)end - (caddr_t)start);
-}
-#endif
-
void *
malloc(size_t bytes)
{
diff --git a/lib/libtacplus/Makefile b/lib/libtacplus/Makefile
deleted file mode 100644
index 798a8e08f306..000000000000
--- a/lib/libtacplus/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1998 Juniper Networks, 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$
-
-LIB= tacplus
-SRCS= taclib.c
-CFLAGS+= -Wall
-DPADD+= ${LIBMD}
-LDADD+= -lmd
-SHLIB_MAJOR= 1
-SHLIB_MINOR= 0
-MAN3+= libtacplus.3
-MAN5+= tacplus.conf.5
-
-beforeinstall:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/taclib.h ${DESTDIR}/usr/include
-
-.include <bsd.lib.mk>
diff --git a/lib/libtacplus/libtacplus.3 b/lib/libtacplus/libtacplus.3
deleted file mode 100644
index bfbfa352a7d3..000000000000
--- a/lib/libtacplus/libtacplus.3
+++ /dev/null
@@ -1,347 +0,0 @@
-.\" Copyright 1998 Juniper Networks, 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$
-.\"
-.Dd September 2, 1998
-.Dt LIBTACPLUS 3
-.Os FreeBSD
-.Sh NAME
-.Nm libtacplus
-.Nd TACACS+ client library
-.Sh SYNOPSIS
-.Fd #include <taclib.h>
-.Ft int
-.Fn tac_add_server "struct tac_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int flags"
-.Ft void
-.Fn tac_close "struct tac_handle *h"
-.Ft int
-.Fn tac_config "struct tac_handle *h" "const char *path"
-.Ft int
-.Fn tac_create_authen "struct tac_handle *h" "int action" "int type" "int service"
-.Ft void *
-.Fn tac_get_data "struct tac_handle *h" "size_t *len"
-.Ft char *
-.Fn tac_get_msg "struct tac_handle *h"
-.Ft struct tac_handle *
-.Fn tac_open "void"
-.Ft int
-.Fn tac_send_authen "struct tac_handle *h"
-.Ft int
-.Fn tac_set_data "struct tac_handle *h" "const void *data" "size_t data_len"
-.Ft int
-.Fn tac_set_msg "struct tac_handle *h" "const char *msg"
-.Ft int
-.Fn tac_set_port "struct tac_handle *h" "const char *port"
-.Ft int
-.Fn tac_set_priv "struct tac_handle *h" "int priv"
-.Ft int
-.Fn tac_set_rem_addr "struct tac_handle *h" "const char *addr"
-.Ft int
-.Fn tac_set_user "struct tac_handle *h" "const char *user"
-.Ft const char *
-.Fn tac_strerror "struct tac_handle *h"
-.Sh DESCRIPTION
-The
-.Nm
-library implements the client side of the TACACS+ network access
-control protocol. TACACS+ allows clients to perform authentication,
-authorization, and accounting by means of network requests to remote
-servers. This library currently supports only the authentication
-portion of the protocol.
-.Sh INITIALIZATION
-To use the library, an application must first call
-.Fn tac_open
-to obtain a
-.Va struct tac_handle * ,
-which provides context for subsequent operations.
-Calls to
-.Fn tac_open
-always succeed unless insufficient virtual memory is available. If
-the necessary memory cannot be allocated,
-.Fn tac_open
-returns
-.Dv NULL .
-.Pp
-Before issuing any TACACS+ requests, the library must be made aware
-of the servers it can contact. The easiest way to configure the
-library is to call
-.Fn tac_config .
-.Fn tac_config
-causes the library to read a configuration file whose format is
-described in
-.Xr tacplus.conf 5 .
-The pathname of the configuration file is passed as the
-.Va file
-argument to
-.Fn tac_config .
-This argument may also be given as
-.Dv NULL ,
-in which case the standard configuration file
-.Pa /etc/tacplus.conf
-is used.
-.Fn tac_config
-returns 0 on success, or -1 if an error occurs.
-.Pp
-The library can also be configured programmatically by calls to
-.Fn tac_add_server .
-The
-.Va host
-parameter specifies the server host, either as a fully qualified
-domain name or as a dotted-quad IP address in text form.
-The
-.Va port
-parameter specifies the TCP port to contact on the server. If
-.Va port
-is given as 0, the library uses port 49, the standard TACACS+ port.
-The shared secret for the server host is passed to the
-.Va secret
-parameter. It may be any null-terminated string of bytes.
-The timeout for receiving replies from the server is passed to the
-.Va timeout
-parameter, in units of seconds.
-The
-.Va flags
-parameter is a bit mask of flags to specify various characteristics of
-the server. It may contain:
-.Pp
-.Bl -tag -width Fl
-.It Dv TAC_SRVR_SINGLE_CONNECT
-Causes the library to attempt to negotiate single connection mode
-when communicating with the server. In single connection mode, the
-original TCP connection is held open for multiple TACACS+ sessions.
-Older servers do not support this mode, and some of them become
-confused if the client attempts to negotiate it.
-.El
-.Pp
-.Fn tac_add_server
-returns 0 on success, or -1 if an error occurs.
-.Pp
-.Fn tac_add_server
-may be called multiple times, and it may be used together with
-.Fn tac_config .
-At most 10 servers may be specified.
-When multiple servers are given, they are tried in round-robin
-fashion until a working, accessible server is found. Once the
-library finds such a server, it continues to use it as long as it
-works.
-.Sh CREATING A TACACS+ AUTHENTICATION REQUEST
-To begin constructing a new authentication request, call
-.Fn tac_create_authen .
-The
-.Va action ,
-.Va type ,
-and
-.Va service
-arguments must be be set to appropriate values as defined in the
-TACACS+ protocol specification. The
-.Aq taclib.h
-header file contains symbolic constants for these values.
-.Pp
-After creating a request with
-.Fn tac_create_authen ,
-various optional parameters may be attached to it through calls to
-.Fn tac_set_data ,
-.Fn tac_set_port ,
-.Fn tac_set_priv ,
-.Fn tac_set_rem_addr ,
-and
-.Fn tac_set_user .
-The library creates its own copies of any strings provided to these
-functions, so that it is not necessary for the caller to preserve
-them. By default, each of these parameters is empty except for the
-privilege level, which defaults to
-.Ql USER
-privilege.
-.Sh SENDING THE AUTHENTICATION REQUEST AND RECEIVING THE RESPONSE
-After the TACACS+ request has been constructed, it is sent by means
-of
-.Fn tac_send_authen .
-This function connects to a server if not already connected, sends
-the request, and waits for a reply. On failure,
-.Fn tac_send_authen
-returns -1. Otherwise, it returns the TACACS+ status code and flags,
-packed into an integer value. The status can be extracted using the
-macro
-.Fn TAC_AUTHEN_STATUS .
-Possible status codes, defined in
-.Aq taclib.h ,
-include:
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Dv TAC_AUTHEN_STATUS_PASS
-.It
-.Dv TAC_AUTHEN_STATUS_FAIL
-.It
-.Dv TAC_AUTHEN_STATUS_GETDATA
-.It
-.Dv TAC_AUTHEN_STATUS_GETUSER
-.It
-.Dv TAC_AUTHEN_STATUS_GETPASS
-.It
-.Dv TAC_AUTHEN_STATUS_RESTART
-.It
-.Dv TAC_AUTHEN_STATUS_ERROR
-.It
-.Dv TAC_AUTHEN_STATUS_FOLLOW
-.El
-.Pp
-The only flag is the no-echo flag, which can be tested using the
-macro
-.Fn TAC_AUTHEN_NOECHO .
-.Sh EXTRACTING INFORMATION FROM THE SERVER'S RESPONSE
-An authentication response packet from the server may contain a
-server message, a data string, or both. After a successful call to
-.Fn tac_send_authen ,
-this information may be retrieved from the response by calling
-.Fn tac_get_msg
-and
-.Fn tac_get_data .
-These functions return dynamically-allocated copies of the
-information from the packet. The caller is responsible for freeing
-the copies when it no longer needs them. The data returned from
-these functions is guaranteed to be terminated by a null byte.
-.Pp
-In the case of
-.Fn tac_get_data ,
-the
-.Va len
-argument points to a location into which the library will store the
-actual length of the received data, not including the null
-terminator. This argument may be given as
-.Dv NULL
-if the caller is not interested in the length.
-.Sh SENDING AUTHENTICATION CONTINUE PACKETS
-If
-.Fn tac_send_authen
-returns a value containing one of the status codes
-.Dv TAC_AUTHEN_STATUS_GETDATA ,
-.Dv TAC_AUTHEN_STATUS_GETUSER ,
-or
-.Dv TAC_AUTHEN_STATUS_GETPASS ,
-then the client must provide additional information to the server by
-means of a TACACS+ CONTINUE packet. To do so, the application must
-first set the packet's user message and/or data fields using
-.Fn tac_set_msg
-and
-.Fn tac_set_data .
-The client then sends the CONTINUE packet with
-.Fn tac_send_authen .
-N.B.,
-.Fn tac_create_authen
-should
-.Em not
-be called to construct a CONTINUE packet; it is used only for the
-initial authentication request.
-.Pp
-When it receives the CONTINUE packet, the server may again request
-more information by returning
-.Dv TAC_AUTHEN_STATUS_GETDATA ,
-.Dv TAC_AUTHEN_STATUS_GETUSER ,
-or
-.Dv TAC_AUTHEN_STATUS_GETPASS .
-The application should send further CONTINUEs until some other
-status is received from the server.
-.Sh OBTAINING ERROR MESSAGES
-Those functions which accept a
-.Va struct tac_handle *
-argument record an error message if they fail. The error message
-can be retrieved by calling
-.Fn tac_strerror .
-The message text is overwritten on each new error for the given
-.Va struct tac_handle * .
-Thus the message must be copied if it is to be preserved through
-subsequent library calls using the same handle.
-.Sh CLEANUP
-To free the resources used by the TACACS+ library, call
-.Fn tac_close .
-.Sh RETURN VALUES
-The following functions return a non-negative value on success. If
-they detect an error, they return -1 and record an error message
-which can be retrieved using
-.Fn tac_strerror .
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Fn tac_add_server
-.It
-.Fn tac_config
-.It
-.Fn tac_create_authen
-.It
-.Fn tac_send_authen
-.It
-.Fn tac_set_data
-.It
-.Fn tac_set_msg
-.It
-.Fn tac_set_port
-.It
-.Fn tac_set_priv
-.It
-.Fn tac_set_rem_addr
-.It
-.Fn tac_set_user
-.El
-.Pp
-The following functions return a
-.No non- Ns Dv NULL
-pointer on success. If they are unable to allocate sufficient
-virtual memory, they return
-.Dv NULL
-and record an error message which can be retrieved using
-.Fn tac_strerror .
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Fn tac_get_data
-.It
-.Fn tac_get_msg
-.El
-.Pp
-The following functions return a
-.No non- Ns Dv NULL
-pointer on success. If they are unable to allocate sufficient
-virtual memory, they return
-.Dv NULL ,
-without recording an error message.
-.Pp
-.Bl -item -offset indent -compact
-.It
-.Fn tac_open
-.El
-.Sh FILES
-.Pa /etc/tacplus.conf
-.Sh SEE ALSO
-.Xr tacplus.conf 5
-.Rs
-.%A D. Carrel and Lol Grant
-.%T The TACACS+ Protocol, Version 1.78
-.%O draft-grant-tacacs-02.txt (Internet Draft)
-.Re
-.Sh AUTHORS
-This software was written by
-.An John Polstra ,
-and donated to the FreeBSD project by Juniper Networks, Inc.
diff --git a/lib/libtacplus/taclib.c b/lib/libtacplus/taclib.c
deleted file mode 100644
index bd2e663b32c8..000000000000
--- a/lib/libtacplus/taclib.c
+++ /dev/null
@@ -1,1053 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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$
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <md5.h>
-#include <netdb.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "taclib_private.h"
-
-static int add_str_8(struct tac_handle *, u_int8_t *,
- struct clnt_str *);
-static int add_str_16(struct tac_handle *, u_int16_t *,
- struct clnt_str *);
-static int authen_version(int, int);
-static void close_connection(struct tac_handle *);
-static int conn_server(struct tac_handle *);
-static void crypt_msg(struct tac_handle *, struct tac_msg *);
-static void *dup_str(struct tac_handle *, const struct srvr_str *,
- size_t *);
-static int establish_connection(struct tac_handle *);
-static void free_str(struct clnt_str *);
-static void generr(struct tac_handle *, const char *, ...)
- __printflike(2, 3);
-static void gen_session_id(struct tac_msg *);
-static int get_srvr_end(struct tac_handle *);
-static int get_srvr_str(struct tac_handle *, struct srvr_str *,
- size_t);
-static void init_clnt_str(struct clnt_str *);
-static void init_srvr_str(struct srvr_str *);
-static int read_timed(struct tac_handle *, void *, size_t,
- const struct timeval *);
-static int recv_msg(struct tac_handle *);
-static int save_str(struct tac_handle *, struct clnt_str *,
- const void *, size_t);
-static int send_msg(struct tac_handle *);
-static int split(char *, char *[], int, char *, size_t);
-static void *xmalloc(struct tac_handle *, size_t);
-static char *xstrdup(struct tac_handle *, const char *);
-
-/*
- * Append some optional data to the current request, and store its
- * length into the 8-bit field referenced by "fld". Returns 0 on
- * success, or -1 on failure.
- *
- * This function also frees the "cs" string data and initializes it
- * for the next time.
- */
-static int
-add_str_8(struct tac_handle *h, u_int8_t *fld, struct clnt_str *cs)
-{
- u_int16_t len;
-
- if (add_str_16(h, &len, cs) == -1)
- return -1;
- len = ntohs(len);
- if (len > 0xff) {
- generr(h, "Field too long");
- return -1;
- }
- *fld = len;
- return 0;
-}
-
-/*
- * Append some optional data to the current request, and store its
- * length into the 16-bit field (network byte order) referenced by
- * "fld". Returns 0 on success, or -1 on failure.
- *
- * This function also frees the "cs" string data and initializes it
- * for the next time.
- */
-static int
-add_str_16(struct tac_handle *h, u_int16_t *fld, struct clnt_str *cs)
-{
- size_t len;
-
- len = cs->len;
- if (cs->data == NULL)
- len = 0;
- if (len != 0) {
- int offset;
-
- if (len > 0xffff) {
- generr(h, "Field too long");
- return -1;
- }
- offset = ntohl(h->request.length);
- if (offset + len > BODYSIZE) {
- generr(h, "Message too long");
- return -1;
- }
- memcpy(h->request.u.body + offset, cs->data, len);
- h->request.length = htonl(offset + len);
- }
- *fld = htons(len);
- free_str(cs);
- return 0;
-}
-
-static int
-authen_version(int action, int type)
-{
- int minor;
-
- switch (action) {
-
- case TAC_AUTHEN_LOGIN:
- switch (type) {
-
- case TAC_AUTHEN_TYPE_PAP:
- case TAC_AUTHEN_TYPE_CHAP:
- case TAC_AUTHEN_TYPE_MSCHAP:
- case TAC_AUTHEN_TYPE_ARAP:
- minor = 1;
- break;
-
- default:
- minor = 0;
- break;
- }
- break;
-
- case TAC_AUTHEN_SENDAUTH:
- minor = 1;
- break;
-
- default:
- minor = 0;
- break;
- };
-
- return TAC_VER_MAJOR << 4 | minor;
-}
-
-static void
-close_connection(struct tac_handle *h)
-{
- if (h->fd != -1) {
- close(h->fd);
- h->fd = -1;
- }
-}
-
-static int
-conn_server(struct tac_handle *h)
-{
- const struct tac_server *srvp = &h->servers[h->cur_server];
- int flags;
-
- if ((h->fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- generr(h, "Cannot create socket: %s", strerror(errno));
- return -1;
- }
- if ((flags = fcntl(h->fd, F_GETFL, 0)) == -1 ||
- fcntl(h->fd, F_SETFL, flags | O_NONBLOCK) == -1) {
- generr(h, "Cannot set non-blocking mode on socket: %s",
- strerror(errno));
- close(h->fd);
- h->fd = -1;
- return -1;
- }
- if (connect(h->fd, (struct sockaddr *)&srvp->addr,
- sizeof srvp->addr) == 0)
- return 0;
-
- if (errno == EINPROGRESS) {
- fd_set wfds;
- struct timeval tv;
- int nfds;
- struct sockaddr peer;
- int peerlen;
- int err;
- int errlen;
-
- /* Wait for the connection to complete. */
- FD_ZERO(&wfds);
- FD_SET(h->fd, &wfds);
- tv.tv_sec = srvp->timeout;
- tv.tv_usec = 0;
- nfds = select(h->fd + 1, NULL, &wfds, NULL, &tv);
- if (nfds == -1) {
- generr(h, "select: %s", strerror(errno));
- close(h->fd);
- h->fd = -1;
- return -1;
- }
- if (nfds == 0) {
- generr(h, "connect: timed out");
- close(h->fd);
- h->fd = -1;
- return -1;
- }
-
- /* See whether we are connected now. */
- peerlen = sizeof peer;
- if (getpeername(h->fd, &peer, &peerlen) == 0)
- return 0;
-
- if (errno != ENOTCONN) {
- generr(h, "getpeername: %s", strerror(errno));
- close(h->fd);
- h->fd = -1;
- return -1;
- }
-
- /* Find out why the connect failed. */
- errlen = sizeof err;
- getsockopt(h->fd, SOL_SOCKET, SO_ERROR, &err, &errlen);
- errno = err;
- }
- generr(h, "connect: %s", strerror(errno));
- close(h->fd);
- h->fd = -1;
- return -1;
-}
-
-/*
- * Encrypt or decrypt a message. The operations are symmetrical.
- */
-static void
-crypt_msg(struct tac_handle *h, struct tac_msg *msg)
-{
- const char *secret;
- MD5_CTX base_ctx;
- MD5_CTX ctx;
- unsigned char md5[16];
- int chunk;
- int msg_len;
-
- secret = h->servers[h->cur_server].secret;
- if (secret[0] == '\0')
- msg->flags |= TAC_UNENCRYPTED;
- if (msg->flags & TAC_UNENCRYPTED)
- return;
-
- msg_len = ntohl(msg->length);
-
- MD5Init(&base_ctx);
- MD5Update(&base_ctx, msg->session_id, sizeof msg->session_id);
- MD5Update(&base_ctx, secret, strlen(secret));
- MD5Update(&base_ctx, &msg->version, sizeof msg->version);
- MD5Update(&base_ctx, &msg->seq_no, sizeof msg->seq_no);
-
- ctx = base_ctx;
- for (chunk = 0; chunk < msg_len; chunk += sizeof md5) {
- int chunk_len;
- int i;
-
- MD5Final(md5, &ctx);
-
- if ((chunk_len = msg_len - chunk) > sizeof md5)
- chunk_len = sizeof md5;
- for (i = 0; i < chunk_len; i++)
- msg->u.body[chunk + i] ^= md5[i];
-
- ctx = base_ctx;
- MD5Update(&ctx, md5, sizeof md5);
- }
-}
-
-/*
- * Return a dynamically allocated copy of the given server string.
- * The copy is null-terminated. If "len" is non-NULL, the length of
- * the string (excluding the terminating null byte) is stored via it.
- * Returns NULL on failure. Empty strings are still allocated even
- * though they have no content.
- */
-static void *
-dup_str(struct tac_handle *h, const struct srvr_str *ss, size_t *len)
-{
- unsigned char *p;
-
- if ((p = (unsigned char *)xmalloc(h, ss->len + 1)) == NULL)
- return NULL;
- if (ss->data != NULL && ss->len != 0)
- memcpy(p, ss->data, ss->len);
- p[ss->len] = '\0';
- if (len != NULL)
- *len = ss->len;
- return p;
-}
-
-static int
-establish_connection(struct tac_handle *h)
-{
- int i;
-
- if (h->fd >= 0) /* Already connected. */
- return 0;
- if (h->num_servers == 0) {
- generr(h, "No TACACS+ servers specified");
- return -1;
- }
- /*
- * Try the servers round-robin. We begin with the one that
- * worked for us the last time. That way, once we find a good
- * server, we won't waste any more time trying the bad ones.
- */
- for (i = 0; i < h->num_servers; i++) {
- if (conn_server(h) == 0) {
- h->single_connect = (h->servers[h->cur_server].flags &
- TAC_SRVR_SINGLE_CONNECT) != 0;
- return 0;
- }
- if (++h->cur_server >= h->num_servers) /* Wrap around */
- h->cur_server = 0;
- }
- /* Just return whatever error was last reported by conn_server(). */
- return -1;
-}
-
-/*
- * Free a client string, obliterating its contents first for security.
- */
-static void
-free_str(struct clnt_str *cs)
-{
- if (cs->data != NULL) {
- memset(cs->data, 0, cs->len);
- free(cs->data);
- cs->data = NULL;
- cs->len = 0;
- }
-}
-
-static void
-generr(struct tac_handle *h, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- vsnprintf(h->errmsg, ERRSIZE, format, ap);
- va_end(ap);
-}
-
-static void
-gen_session_id(struct tac_msg *msg)
-{
- int r;
-
- r = random();
- msg->session_id[0] = r >> 8;
- msg->session_id[1] = r;
- r = random();
- msg->session_id[2] = r >> 8;
- msg->session_id[3] = r;
-}
-
-/*
- * Verify that we are exactly at the end of the response message.
- * Returns 0 on success, -1 on failure.
- */
-static int
-get_srvr_end(struct tac_handle *h)
-{
- if (h->srvr_pos != ntohl(h->response.length)) {
- generr(h, "Invalid length field in response from server");
- return -1;
- }
- return 0;
-}
-
-static int
-get_srvr_str(struct tac_handle *h, struct srvr_str *ss, size_t len)
-{
- if (h->srvr_pos + len > ntohl(h->response.length)) {
- generr(h, "Invalid length field in response from server");
- return -1;
- }
- ss->data = len != 0 ? h->response.u.body + h->srvr_pos : NULL;
- ss->len = len;
- h->srvr_pos += len;
- return 0;
-}
-
-static void
-init_clnt_str(struct clnt_str *cs)
-{
- cs->data = NULL;
- cs->len = 0;
-}
-
-static void
-init_srvr_str(struct srvr_str *ss)
-{
- ss->data = NULL;
- ss->len = 0;
-}
-
-static int
-read_timed(struct tac_handle *h, void *buf, size_t len,
- const struct timeval *deadline)
-{
- char *ptr;
-
- ptr = (char *)buf;
- while (len > 0) {
- int n;
-
- n = read(h->fd, ptr, len);
- if (n == -1) {
- struct timeval tv;
- int nfds;
-
- if (errno != EAGAIN) {
- generr(h, "Network read error: %s",
- strerror(errno));
- return -1;
- }
-
- /* Wait until we can read more data. */
- gettimeofday(&tv, NULL);
- timersub(deadline, &tv, &tv);
- if (tv.tv_sec >= 0) {
- fd_set rfds;
-
- FD_ZERO(&rfds);
- FD_SET(h->fd, &rfds);
- nfds =
- select(h->fd + 1, &rfds, NULL, NULL, &tv);
- if (nfds == -1) {
- generr(h, "select: %s",
- strerror(errno));
- return -1;
- }
- } else
- nfds = 0;
- if (nfds == 0) {
- generr(h, "Network read timed out");
- return -1;
- }
- } else if (n == 0) {
- generr(h, "unexpected EOF from server");
- return -1;
- } else {
- ptr += n;
- len -= n;
- }
- }
- return 0;
-}
-
-/*
- * Receive a response from the server and decrypt it. Returns 0 on
- * success, or -1 on failure.
- */
-static int
-recv_msg(struct tac_handle *h)
-{
- struct timeval deadline;
- struct tac_msg *msg;
- size_t len;
-
- msg = &h->response;
- gettimeofday(&deadline, NULL);
- deadline.tv_sec += h->servers[h->cur_server].timeout;
-
- /* Read the message header and make sure it is reasonable. */
- if (read_timed(h, msg, HDRSIZE, &deadline) == -1)
- return -1;
- if (memcmp(msg->session_id, h->request.session_id,
- sizeof msg->session_id) != 0) {
- generr(h, "Invalid session ID in received message");
- return -1;
- }
- if (msg->type != h->request.type) {
- generr(h, "Invalid type in received message");
- return -1;
- }
- len = ntohl(msg->length);
- if (len > BODYSIZE) {
- generr(h, "Received message too large");
- return -1;
- }
- if (msg->seq_no != ++h->last_seq_no) {
- generr(h, "Invalid sequence number in received message");
- return -1;
- }
-
- /* Read the message body. */
- if (read_timed(h, msg->u.body, len, &deadline) == -1)
- return -1;
-
- /* Decrypt it. */
- crypt_msg(h, msg);
-
- /*
- * Turn off single-connection mode if the server isn't amenable
- * to it.
- */
- if (!(msg->flags & TAC_SINGLE_CONNECT))
- h->single_connect = 0;
- return 0;
-}
-
-static int
-save_str(struct tac_handle *h, struct clnt_str *cs, const void *data,
- size_t len)
-{
- free_str(cs);
- if (data != NULL && len != 0) {
- if ((cs->data = xmalloc(h, len)) == NULL)
- return -1;
- cs->len = len;
- memcpy(cs->data, data, len);
- }
- return 0;
-}
-
-/*
- * Send the current request, after encrypting it. Returns 0 on success,
- * or -1 on failure.
- */
-static int
-send_msg(struct tac_handle *h)
-{
- struct timeval deadline;
- struct tac_msg *msg;
- char *ptr;
- int len;
-
- if (h->last_seq_no & 1) {
- generr(h, "Attempt to send message out of sequence");
- return -1;
- }
-
- msg = &h->request;
- msg->seq_no = ++h->last_seq_no;
- if (msg->seq_no == 1)
- gen_session_id(msg);
- crypt_msg(h, msg);
-
- if (establish_connection(h) == -1)
- return -1;
-
- if (h->single_connect)
- msg->flags |= TAC_SINGLE_CONNECT;
- else
- msg->flags &= ~TAC_SINGLE_CONNECT;
- gettimeofday(&deadline, NULL);
- deadline.tv_sec += h->servers[h->cur_server].timeout;
- len = HDRSIZE + ntohl(msg->length);
- ptr = (char *)msg;
- while (len > 0) {
- int n;
-
- n = write(h->fd, ptr, len);
- if (n == -1) {
- struct timeval tv;
- int nfds;
-
- if (errno != EAGAIN) {
- generr(h, "Network write error: %s",
- strerror(errno));
- return -1;
- }
-
- /* Wait until we can write more data. */
- gettimeofday(&tv, NULL);
- timersub(&deadline, &tv, &tv);
- if (tv.tv_sec >= 0) {
- fd_set wfds;
-
- FD_ZERO(&wfds);
- FD_SET(h->fd, &wfds);
- nfds =
- select(h->fd + 1, NULL, &wfds, NULL, &tv);
- if (nfds == -1) {
- generr(h, "select: %s",
- strerror(errno));
- return -1;
- }
- } else
- nfds = 0;
- if (nfds == 0) {
- generr(h, "Network write timed out");
- return -1;
- }
- } else {
- ptr += n;
- len -= n;
- }
- }
- return 0;
-}
-
-/*
- * Destructively split a string into fields separated by white space.
- * `#' at the beginning of a field begins a comment that extends to the
- * end of the string. Fields may be quoted with `"'. Inside quoted
- * strings, the backslash escapes `\"' and `\\' are honored.
- *
- * Pointers to up to the first maxfields fields are stored in the fields
- * array. Missing fields get NULL pointers.
- *
- * The return value is the actual number of fields parsed, and is always
- * <= maxfields.
- *
- * On a syntax error, places a message in the msg string, and returns -1.
- */
-static int
-split(char *str, char *fields[], int maxfields, char *msg, size_t msglen)
-{
- char *p;
- int i;
- static const char ws[] = " \t";
-
- for (i = 0; i < maxfields; i++)
- fields[i] = NULL;
- p = str;
- i = 0;
- while (*p != '\0') {
- p += strspn(p, ws);
- if (*p == '#' || *p == '\0')
- break;
- if (i >= maxfields) {
- snprintf(msg, msglen, "line has too many fields");
- return -1;
- }
- if (*p == '"') {
- char *dst;
-
- dst = ++p;
- fields[i] = dst;
- while (*p != '"') {
- if (*p == '\\') {
- p++;
- if (*p != '"' && *p != '\\' &&
- *p != '\0') {
- snprintf(msg, msglen,
- "invalid `\\' escape");
- return -1;
- }
- }
- if (*p == '\0') {
- snprintf(msg, msglen,
- "unterminated quoted string");
- return -1;
- }
- *dst++ = *p++;
- }
- *dst = '\0';
- p++;
- if (*p != '\0' && strspn(p, ws) == 0) {
- snprintf(msg, msglen, "quoted string not"
- " followed by white space");
- return -1;
- }
- } else {
- fields[i] = p;
- p += strcspn(p, ws);
- if (*p != '\0')
- *p++ = '\0';
- }
- i++;
- }
- return i;
-}
-
-int
-tac_add_server(struct tac_handle *h, const char *host, int port,
- const char *secret, int timeout, int flags)
-{
- struct tac_server *srvp;
-
- if (h->num_servers >= MAXSERVERS) {
- generr(h, "Too many RADIUS servers specified");
- return -1;
- }
- srvp = &h->servers[h->num_servers];
-
- memset(&srvp->addr, 0, sizeof srvp->addr);
- srvp->addr.sin_len = sizeof srvp->addr;
- srvp->addr.sin_family = AF_INET;
- if (!inet_aton(host, &srvp->addr.sin_addr)) {
- struct hostent *hent;
-
- if ((hent = gethostbyname(host)) == NULL) {
- generr(h, "%s: host not found", host);
- return -1;
- }
- memcpy(&srvp->addr.sin_addr, hent->h_addr,
- sizeof srvp->addr.sin_addr);
- }
- srvp->addr.sin_port = htons(port != 0 ? port : TACPLUS_PORT);
- if ((srvp->secret = xstrdup(h, secret)) == NULL)
- return -1;
- srvp->timeout = timeout;
- srvp->flags = flags;
- h->num_servers++;
- return 0;
-}
-
-void
-tac_close(struct tac_handle *h)
-{
- int srv;
-
- if (h->fd != -1)
- close(h->fd);
- for (srv = 0; srv < h->num_servers; srv++) {
- memset(h->servers[srv].secret, 0,
- strlen(h->servers[srv].secret));
- free(h->servers[srv].secret);
- }
- free_str(&h->user);
- free_str(&h->port);
- free_str(&h->rem_addr);
- free_str(&h->data);
- free_str(&h->user_msg);
- free(h);
-}
-
-int
-tac_config(struct tac_handle *h, const char *path)
-{
- FILE *fp;
- char buf[MAXCONFLINE];
- int linenum;
- int retval;
-
- if (path == NULL)
- path = PATH_TACPLUS_CONF;
- if ((fp = fopen(path, "r")) == NULL) {
- generr(h, "Cannot open \"%s\": %s", path, strerror(errno));
- return -1;
- }
- retval = 0;
- linenum = 0;
- while (fgets(buf, sizeof buf, fp) != NULL) {
- int len;
- char *fields[4];
- int nfields;
- char msg[ERRSIZE];
- char *host;
- char *port_str;
- char *secret;
- char *timeout_str;
- char *options_str;
- char *end;
- unsigned long timeout;
- int port;
- int options;
-
- linenum++;
- len = strlen(buf);
- /* We know len > 0, else fgets would have returned NULL. */
- if (buf[len - 1] != '\n') {
- if (len == sizeof buf - 1)
- generr(h, "%s:%d: line too long", path,
- linenum);
- else
- generr(h, "%s:%d: missing newline", path,
- linenum);
- retval = -1;
- break;
- }
- buf[len - 1] = '\0';
-
- /* Extract the fields from the line. */
- nfields = split(buf, fields, 4, msg, sizeof msg);
- if (nfields == -1) {
- generr(h, "%s:%d: %s", path, linenum, msg);
- retval = -1;
- break;
- }
- if (nfields == 0)
- continue;
- if (nfields < 2) {
- generr(h, "%s:%d: missing shared secret", path,
- linenum);
- retval = -1;
- break;
- }
- host = fields[0];
- secret = fields[1];
- timeout_str = fields[2];
- options_str = fields[3];
-
- /* Parse and validate the fields. */
- host = strtok(host, ":");
- port_str = strtok(NULL, ":");
- if (port_str != NULL) {
- port = strtoul(port_str, &end, 10);
- if (port_str[0] == '\0' || *end != '\0') {
- generr(h, "%s:%d: invalid port", path,
- linenum);
- retval = -1;
- break;
- }
- } else
- port = 0;
- if (timeout_str != NULL) {
- timeout = strtoul(timeout_str, &end, 10);
- if (timeout_str[0] == '\0' || *end != '\0') {
- generr(h, "%s:%d: invalid timeout", path,
- linenum);
- retval = -1;
- break;
- }
- } else
- timeout = TIMEOUT;
- options = 0;
- if (options_str != NULL) {
- if (strcmp(options_str, "single-connection") == 0)
- options |= TAC_SRVR_SINGLE_CONNECT;
- else {
- generr(h, "%s:%d: invalid option \"%s\"",
- path, linenum, options_str);
- retval = -1;
- break;
- }
- };
-
- if (tac_add_server(h, host, port, secret, timeout,
- options) == -1) {
- char msg[ERRSIZE];
-
- strcpy(msg, h->errmsg);
- generr(h, "%s:%d: %s", path, linenum, msg);
- retval = -1;
- break;
- }
- }
- /* Clear out the buffer to wipe a possible copy of a shared secret */
- memset(buf, 0, sizeof buf);
- fclose(fp);
- return retval;
-}
-
-int
-tac_create_authen(struct tac_handle *h, int action, int type, int service)
-{
- struct tac_msg *msg;
- struct tac_authen_start *as;
-
- h->last_seq_no = 0;
-
- msg = &h->request;
- msg->type = TAC_AUTHEN;
- msg->version = authen_version(action, type);
- msg->flags = 0;
-
- as = &msg->u.authen_start;
- as->action = action;
- as->priv_lvl = TAC_PRIV_LVL_USER;
- as->authen_type = type;
- as->service = service;
-
- free_str(&h->user);
- free_str(&h->port);
- free_str(&h->rem_addr);
- free_str(&h->data);
- free_str(&h->user_msg);
-
- /* XXX - more to do */
- return 0;
-}
-
-void *
-tac_get_data(struct tac_handle *h, size_t *len)
-{
- return dup_str(h, &h->srvr_data, len);
-}
-
-char *
-tac_get_msg(struct tac_handle *h)
-{
- return (char *)dup_str(h, &h->srvr_msg, NULL);
-}
-
-/*
- * Create and initialize a tac_handle structure, and return it to the
- * caller. Can fail only if the necessary memory cannot be allocated.
- * In that case, it returns NULL.
- */
-struct tac_handle *
-tac_open(void)
-{
- struct tac_handle *h;
-
- h = (struct tac_handle *)malloc(sizeof(struct tac_handle));
- if (h != NULL) {
- h->fd = -1;
- h->num_servers = 0;
- h->cur_server = 0;
- h->errmsg[0] = '\0';
- init_clnt_str(&h->user);
- init_clnt_str(&h->port);
- init_clnt_str(&h->rem_addr);
- init_clnt_str(&h->data);
- init_clnt_str(&h->user_msg);
- init_srvr_str(&h->srvr_msg);
- init_srvr_str(&h->srvr_data);
- srandomdev();
- }
- return h;
-}
-
-int
-tac_send_authen(struct tac_handle *h)
-{
- struct tac_authen_reply *ar;
-
- if (h->last_seq_no == 0) { /* Authentication START packet */
- struct tac_authen_start *as;
-
- as = &h->request.u.authen_start;
- h->request.length =
- htonl(offsetof(struct tac_authen_start, rest[0]));
- if (add_str_8(h, &as->user_len, &h->user) == -1 ||
- add_str_8(h, &as->port_len, &h->port) == -1 ||
- add_str_8(h, &as->rem_addr_len, &h->rem_addr) == -1 ||
- add_str_8(h, &as->data_len, &h->data) == -1)
- return -1;
- } else { /* Authentication CONTINUE packet */
- struct tac_authen_cont *ac;
-
- ac = &h->request.u.authen_cont;
- ac->flags = 0;
- h->request.length =
- htonl(offsetof(struct tac_authen_cont, rest[0]));
- if (add_str_16(h, &ac->user_msg_len, &h->user_msg) == -1 ||
- add_str_16(h, &ac->data_len, &h->data) == -1)
- return -1;
- }
-
- /* Send the message and retrieve the reply. */
- if (send_msg(h) == -1 || recv_msg(h) == -1)
- return -1;
-
- /* Scan the optional fields in the reply. */
- ar = &h->response.u.authen_reply;
- h->srvr_pos = offsetof(struct tac_authen_reply, rest[0]);
- if (get_srvr_str(h, &h->srvr_msg, ntohs(ar->msg_len)) == -1 ||
- get_srvr_str(h, &h->srvr_data, ntohs(ar->data_len)) == -1 ||
- get_srvr_end(h) == -1)
- return -1;
-
- if (!h->single_connect &&
- ar->status != TAC_AUTHEN_STATUS_GETDATA &&
- ar->status != TAC_AUTHEN_STATUS_GETUSER &&
- ar->status != TAC_AUTHEN_STATUS_GETPASS)
- close_connection(h);
-
- return ar->flags << 8 | ar->status;
-}
-
-int
-tac_set_rem_addr(struct tac_handle *h, const char *addr)
-{
- return save_str(h, &h->rem_addr, addr, addr != NULL ? strlen(addr) : 0);
-}
-
-int
-tac_set_data(struct tac_handle *h, const void *data, size_t data_len)
-{
- return save_str(h, &h->data, data, data_len);
-}
-
-int
-tac_set_msg(struct tac_handle *h, const char *msg)
-{
- return save_str(h, &h->user_msg, msg, msg != NULL ? strlen(msg) : 0);
-}
-
-int
-tac_set_port(struct tac_handle *h, const char *port)
-{
- return save_str(h, &h->port, port, port != NULL ? strlen(port) : 0);
-}
-
-int
-tac_set_priv(struct tac_handle *h, int priv)
-{
- if (!(TAC_PRIV_LVL_MIN <= priv && priv <= TAC_PRIV_LVL_MAX)) {
- generr(h, "Attempt to set invalid privilege level");
- return -1;
- }
- h->request.u.authen_start.priv_lvl = priv;
- return 0;
-}
-
-int
-tac_set_user(struct tac_handle *h, const char *user)
-{
- return save_str(h, &h->user, user, user != NULL ? strlen(user) : 0);
-}
-
-const char *
-tac_strerror(struct tac_handle *h)
-{
- return h->errmsg;
-}
-
-static void *
-xmalloc(struct tac_handle *h, size_t size)
-{
- void *r;
-
- if ((r = malloc(size)) == NULL)
- generr(h, "Out of memory");
- return r;
-}
-
-static char *
-xstrdup(struct tac_handle *h, const char *s)
-{
- char *r;
-
- if ((r = strdup(s)) == NULL)
- generr(h, "Out of memory");
- return r;
-}
diff --git a/lib/libtacplus/taclib.h b/lib/libtacplus/taclib.h
deleted file mode 100644
index 0da1b0889ab3..000000000000
--- a/lib/libtacplus/taclib.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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 _TACLIB_H_
-#define _TACLIB_H_
-
-#include <sys/types.h>
-
-struct tac_handle;
-
-/* Flags for tac_add_server(). */
-#define TAC_SRVR_SINGLE_CONNECT 0x04 /* Keep connection open for multiple
- sessions. */
-
-/* Disassembly of tac_send_authen() return value. */
-#define TAC_AUTHEN_STATUS(s) ((s) & 0xff)
-#define TAC_AUTHEN_NOECHO(s) ((s) & (1<<8))
-
-/* Privilege levels */
-#define TAC_PRIV_LVL_MIN 0x00
-#define TAC_PRIV_LVL_USER 0x01
-#define TAC_PRIV_LVL_ROOT 0x0f
-#define TAC_PRIV_LVL_MAX 0x0f
-
-/* Authentication actions */
-#define TAC_AUTHEN_LOGIN 0x01
-#define TAC_AUTHEN_CHPASS 0x02
-#define TAC_AUTHEN_SENDPASS 0x03
-#define TAC_AUTHEN_SENDAUTH 0x04
-
-/* Authentication types */
-#define TAC_AUTHEN_TYPE_ASCII 0x01
-#define TAC_AUTHEN_TYPE_PAP 0x02
-#define TAC_AUTHEN_TYPE_CHAP 0x03
-#define TAC_AUTHEN_TYPE_ARAP 0x04
-#define TAC_AUTHEN_TYPE_MSCHAP 0x05
-
-/* Authentication services */
-#define TAC_AUTHEN_SVC_NONE 0x00
-#define TAC_AUTHEN_SVC_LOGIN 0x01
-#define TAC_AUTHEN_SVC_ENABLE 0x02
-#define TAC_AUTHEN_SVC_PPP 0x03
-#define TAC_AUTHEN_SVC_ARAP 0x04
-#define TAC_AUTHEN_SVC_PT 0x05
-#define TAC_AUTHEN_SVC_RCMD 0x06
-#define TAC_AUTHEN_SVC_X25 0x07
-#define TAC_AUTHEN_SVC_NASI 0x08
-#define TAC_AUTHEN_SVC_FWPROXY 0x09
-
-/* Authentication reply status codes */
-#define TAC_AUTHEN_STATUS_PASS 0x01
-#define TAC_AUTHEN_STATUS_FAIL 0x02
-#define TAC_AUTHEN_STATUS_GETDATA 0x03
-#define TAC_AUTHEN_STATUS_GETUSER 0x04
-#define TAC_AUTHEN_STATUS_GETPASS 0x05
-#define TAC_AUTHEN_STATUS_RESTART 0x06
-#define TAC_AUTHEN_STATUS_ERROR 0x07
-#define TAC_AUTHEN_STATUS_FOLLOW 0x21
-
-__BEGIN_DECLS
-int tac_add_server(struct tac_handle *,
- const char *, int, const char *, int, int);
-void tac_close(struct tac_handle *);
-int tac_config(struct tac_handle *, const char *);
-int tac_create_authen(struct tac_handle *, int, int, int);
-void *tac_get_data(struct tac_handle *, size_t *);
-char *tac_get_msg(struct tac_handle *);
-struct tac_handle *tac_open(void);
-int tac_send_authen(struct tac_handle *);
-int tac_set_data(struct tac_handle *,
- const void *, size_t);
-int tac_set_msg(struct tac_handle *, const char *);
-int tac_set_port(struct tac_handle *, const char *);
-int tac_set_priv(struct tac_handle *, int);
-int tac_set_rem_addr(struct tac_handle *, const char *);
-int tac_set_user(struct tac_handle *, const char *);
-const char *tac_strerror(struct tac_handle *);
-__END_DECLS
-
-#endif /* _TACLIB_H_ */
diff --git a/lib/libtacplus/taclib_private.h b/lib/libtacplus/taclib_private.h
deleted file mode 100644
index 830fc921fbf3..000000000000
--- a/lib/libtacplus/taclib_private.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*-
- * Copyright 1998 Juniper Networks, 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 TACLIB_PRIVATE_H
-#define TACLIB_PRIVATE_H
-
-#include "taclib.h"
-
-/* Defaults */
-#define PATH_TACPLUS_CONF "/etc/tacplus.conf"
-#define TACPLUS_PORT 49
-#define TIMEOUT 3 /* In seconds */
-
-/* Limits */
-#define BODYSIZE 8150 /* Maximum message body size */
-#define ERRSIZE 128 /* Maximum error message length */
-#define MAXCONFLINE 1024 /* Maximum config file line length */
-#define MAXSERVERS 10 /* Maximum number of servers to try */
-
-/* Protocol constants. */
-#define HDRSIZE 12 /* Size of message header */
-
-/* Protocol version number */
-#define TAC_VER_MAJOR 0xc /* Major version number */
-
-/* Protocol packet types */
-#define TAC_AUTHEN 0x01 /* Authentication */
-#define TAC_AUTHOR 0x02 /* Authorization */
-#define TAC_ACCT 0x03 /* Accouting */
-
-/* Protocol header flags */
-#define TAC_UNENCRYPTED 0x01
-#define TAC_SINGLE_CONNECT 0x04
-
-struct tac_server {
- struct sockaddr_in addr; /* Address of server */
- char *secret; /* Shared secret */
- int timeout; /* Timeout in seconds */
- int flags;
-};
-
-/*
- * An optional string of bytes specified by the client for inclusion in
- * a request. The data is always a dynamically allocated copy that
- * belongs to the library. It is copied into the request packet just
- * before sending the request.
- */
-struct clnt_str {
- void *data;
- size_t len;
-};
-
-/*
- * An optional string of bytes from a server response. The data resides
- * in the response packet itself, and must not be freed.
- */
-struct srvr_str {
- const void *data;
- size_t len;
-};
-
-struct tac_authen_start {
- u_int8_t action;
- u_int8_t priv_lvl;
- u_int8_t authen_type;
- u_int8_t service;
- u_int8_t user_len;
- u_int8_t port_len;
- u_int8_t rem_addr_len;
- u_int8_t data_len;
- unsigned char rest[1];
-};
-
-struct tac_authen_reply {
- u_int8_t status;
- u_int8_t flags;
- u_int16_t msg_len;
- u_int16_t data_len;
- unsigned char rest[1];
-};
-
-struct tac_authen_cont {
- u_int16_t user_msg_len;
- u_int16_t data_len;
- u_int8_t flags;
- unsigned char rest[1];
-};
-
-struct tac_msg {
- u_int8_t version;
- u_int8_t type;
- u_int8_t seq_no;
- u_int8_t flags;
- u_int8_t session_id[4];
- u_int32_t length;
- union {
- struct tac_authen_start authen_start;
- struct tac_authen_reply authen_reply;
- struct tac_authen_cont authen_cont;
- unsigned char body[BODYSIZE];
- } u;
-};
-
-struct tac_handle {
- int fd; /* Socket file descriptor */
- struct tac_server servers[MAXSERVERS]; /* Servers to contact */
- int num_servers; /* Number of valid server entries */
- int cur_server; /* Server we are currently using */
- int single_connect; /* Use a single connection */
- int last_seq_no;
- char errmsg[ERRSIZE]; /* Most recent error message */
-
- struct clnt_str user;
- struct clnt_str port;
- struct clnt_str rem_addr;
- struct clnt_str data;
- struct clnt_str user_msg;
-
- struct tac_msg request;
- struct tac_msg response;
-
- int srvr_pos; /* Scan position in response body */
- struct srvr_str srvr_msg;
- struct srvr_str srvr_data;
-};
-
-#endif
diff --git a/lib/libtacplus/tacplus.conf.5 b/lib/libtacplus/tacplus.conf.5
deleted file mode 100644
index a61da844848b..000000000000
--- a/lib/libtacplus/tacplus.conf.5
+++ /dev/null
@@ -1,114 +0,0 @@
-.\" Copyright 1998 Juniper Networks, 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$
-.\"
-.Dd July 29, 1998
-.Dt TACPLUS.CONF 5
-.Os FreeBSD
-.Sh NAME
-.Nm tacplus.conf
-.Nd TACACS+ client configuration file
-.Sh SYNOPSIS
-.Pa /etc/tacplus.conf
-.Sh DESCRIPTION
-.Nm
-contains the information necessary to configure the TACACS+ client
-library. It is parsed by
-.Xr tac_config 3 .
-The file contains one or more lines of text, each describing a
-single TACACS+ server which is to be used by the library. Leading
-white space is ignored, as are empty lines and lines containing
-only comments.
-.Pp
-A TACACS+ server is described by two to four fields on a line. The
-fields are separated by white space. The
-.Ql #
-character at the beginning of a field begins a comment, which extends
-to the end of the line. A field may be enclosed in double quotes,
-in which case it may contain white space and/or begin with the
-.Ql #
-character. Within a quoted string, the double quote character can
-be represented by
-.Ql \e\&" ,
-and the backslash can be represented by
-.Ql \e\e .
-No other escape sequences are supported.
-.Pp
-The first field specifies
-the server host, either as a fully qualified domain name or as a
-dotted-quad IP address. The host may optionally be followed by a
-.Ql \&:
-and a numeric port number, without intervening white space. If the
-port specification is omitted, it defaults to 49, the standard TACACS+
-port.
-.Pp
-The second field contains the shared secret, which should be known
-only to the client and server hosts. It is an arbitrary string
-of characters, though it must be enclosed in double quotes if it
-contains white space or is empty. An empty secret disables the
-normal encryption mechanism, causing all data to cross the network in
-cleartext.
-.Pp
-The third field contains a decimal integer specifying the timeout
-in seconds for communicating with the server. The timeout applies
-separately to each connect, write, and read operation. If this field
-is omitted, it defaults to 3 seconds.
-.Pp
-The optional fourth field may contain the string
-.Ql single-connection .
-If this option is included, the library will attempt to negotiate
-with the server to keep the TCP connection open for multiple
-sessions. Some older TACACS+ servers become confused if this option
-is specified.
-.Pp
-Up to 10 TACACS+ servers may be specified. The servers are tried in
-order, until a valid response is received or the list is exhausted.
-.Pp
-The standard location for this file is
-.Pa /etc/tacplus.conf .
-An alternate pathname may be specified in the call to
-.Xr tac_config 3 .
-Since the file contains sensitive information in the form of the
-shared secrets, it should not be readable except by root.
-.Sh FILES
-.Pa /etc/tacplus.conf
-.Sh EXAMPLES
-.Bd -literal
-# A simple entry using all the defaults:
-tacserver.domain.com OurLittleSecret
-
-# A server using a non-standard port, with an increased timeout and
-# the "single-connection" option.
-auth.domain.com:4333 "Don't tell!!" 15 single-connection
-
-# A server specified by its IP address:
-192.168.27.81 $X*#..38947ax-+=
-.Ed
-.Sh SEE ALSO
-.Xr libtacplus 3
-.Sh AUTHORS
-This documentation was written by
-.An John Polstra ,
-and donated to the FreeBSD project by Juniper Networks, Inc.
diff --git a/lib/libtelnet/getent.c b/lib/libtelnet/getent.c
index 0956a2abd381..e87bf667cec9 100644
--- a/lib/libtelnet/getent.c
+++ b/lib/libtelnet/getent.c
@@ -58,7 +58,7 @@ char *cp, *name;
#ifndef SOLARIS
/*ARGSUSED*/
char *
-Getstr(id, cpp)
+getstr(id, cpp)
char *id, **cpp;
{
# ifdef HAS_CGETENT
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index dda01c17ad96..2aa2ad030a61 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file providing the above
* conditions are met.
*
- * $Id: libutil.h,v 1.20 1998/10/09 07:32:38 jkh Exp $
+ * $Id: libutil.h,v 1.19 1998/10/09 07:28:14 jkh Exp $
*/
#ifndef _LIBUTIL_H_
@@ -39,7 +39,7 @@ struct winsize;
struct utmp;
__BEGIN_DECLS
-void setproctitle __P((const char *_fmt, ...)) __printf0like(1, 2);
+void setproctitle __P((const char *_fmt, ...));
void login __P((struct utmp *_ut));
int login_tty __P((int _fd));
int logout __P((char *_line));
diff --git a/lib/libutil/property.3 b/lib/libutil/property.3
index eebdde66cca0..bcd3556116e2 100644
--- a/lib/libutil/property.3
+++ b/lib/libutil/property.3
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: property.3,v 1.3 1998/10/14 11:04:36 jkh Exp $
+.\" $Id: property.3,v 1.2 1998/10/09 07:33:58 jkh Exp $
.\" "
.Dd October 7, 1998
.Os
@@ -65,7 +65,9 @@ pairs from the file descriptor passed in
.Fa fd
and returns the head of a new property list, assuming that the
file's contents have been parsed properly, or NULL in case
-of error.
+of error. The property list pointer should be passed to
+.Fn properties_free
+when no longer needed.
.Pp
.Fn property_find
Returns the associated value string for the property named
@@ -76,22 +78,7 @@ if found, otherwise NULL.
is used to free the structure returned by
.Fn properties_read
when it is no longer needed.
-.Pp
-.Sh FILE FORMAT
-Each property in the file is assumed to have the format of
-.Fa name = value
-where
-.Fa name
-is an alphanumeric string (and any punctuation not including the `=' character)
-and
-.Fa value
-is an arbitary string of text terminated by a newline character. If newlines
-are desired, the entire value should be enclosed in { } (curly-bracket)
-characters. Any line beginning with a # or ; character is assumed to
-be a comment and will be ignored.
.Sh SEE ALSO
.Xr auth_getval 3
.Sh BUGS
Simplistic.
-.Sh AUTHOR
-Jordan Hubbard
diff --git a/lib/libutil/property.c b/lib/libutil/property.c
index 23714a0c3daf..211450c80464 100644
--- a/lib/libutil/property.c
+++ b/lib/libutil/property.c
@@ -35,7 +35,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <err.h>
#include <sys/types.h>
#include <libutil.h>
@@ -63,7 +62,7 @@ properties_read(int fd)
char buf[BUFSIZ * 4];
int bp, n, v, max;
enum { LOOK, COMMENT, NAME, VALUE, MVALUE, COMMIT, FILL, STOP } state;
- int ch = 0, blevel = 0;
+ int ch = 0;
n = v = bp = max = 0;
head = ptr = NULL;
@@ -136,10 +135,8 @@ properties_read(int fd)
case VALUE:
if (v == 0 && isspace(ch))
continue;
- else if (ch == '{') {
+ else if (ch == '{')
state = MVALUE;
- ++blevel;
- }
else if (ch == '\n' || !ch) {
hold_v[v] = '\0';
v = n = 0;
@@ -159,20 +156,16 @@ properties_read(int fd)
case MVALUE:
/* multiline value */
if (v >= MAX_VALUE) {
- warn("properties_read: value exceeds max length");
state = COMMENT;
n = v = 0;
}
- else if (ch == '}' && !--blevel) {
+ else if (ch == '}') {
hold_v[v] = '\0';
v = n = 0;
state = COMMIT;
}
- else {
+ else
hold_v[v++] = ch;
- if (ch == '{')
- ++blevel;
- }
break;
case COMMIT:
diff --git a/lib/libutil/setproctitle.c b/lib/libutil/setproctitle.c
index 3bce42074da8..217df06ac8c0 100644
--- a/lib/libutil/setproctitle.c
+++ b/lib/libutil/setproctitle.c
@@ -14,7 +14,7 @@
* 3. Absolutely no warranty of function or purpose is made by the author
* Peter Wemm.
*
- * $Id: setproctitle.c,v 1.7 1998/04/28 07:02:33 dg Exp $
+ * $Id: setproctitle.c,v 1.6 1998/04/28 06:59:14 dg Exp $
*/
#include <sys/types.h>
@@ -72,8 +72,8 @@ setproctitle(fmt, va_alist)
static char buf[SPT_BUFSIZE];
static char *ps_argv[2];
va_list ap;
+ int mib[2];
size_t len;
- unsigned long ul_ps_strings;
#if defined(__STDC__)
va_start(ap, fmt);
@@ -104,11 +104,12 @@ setproctitle(fmt, va_alist)
va_end(ap);
if (ps_strings == NULL) {
- len = sizeof(ul_ps_strings);
- if (sysctlbyname("kern.ps_strings", &ul_ps_strings, &len, NULL,
- 0) == -1)
- ul_ps_strings = PS_STRINGS;
- ps_strings = (struct ps_strings *)ul_ps_strings;
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PS_STRINGS;
+ len = sizeof(ps_strings);
+ if (sysctl(mib, 2, &ps_strings, &len, NULL, 0) < 0 ||
+ ps_strings == NULL)
+ ps_strings = PS_STRINGS;
}
/* PS_STRINGS points to zeroed memory on a style #2 kernel */
diff --git a/lib/libz/ChangeLog b/lib/libz/ChangeLog
index 57386a26f485..95d3c3b8b2e0 100644
--- a/lib/libz/ChangeLog
+++ b/lib/libz/ChangeLog
@@ -1,73 +1,6 @@
ChangeLog file for zlib
-Changes in 1.1.3 (9 July 1998)
-- fix "an inflate input buffer bug that shows up on rare but persistent
- occasions" (Mark)
-- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
-- fix gzseek(..., SEEK_SET) in write mode
-- fix crc check after a gzeek (Frank Faubert)
-- fix miniunzip when the last entry in a zip file is itself a zip file
- (J Lillge)
-- add contrib/asm586 and contrib/asm686 (Brian Raiter)
- See http://www.muppetlabs.com/~breadbox/software/assembly.html
-- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
-- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
-- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
-- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
-- added a FAQ file
-
-- Support gzdopen on Mac with Metrowerks (Jason Linhart)
-- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
-- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
-- avoid some warnings with Borland C (Tom Tanner)
-- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
-- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
-- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
-- use libdir and includedir in Makefile.in (Tim Mooney)
-- support shared libraries on OSF1 V4 (Tim Mooney)
-- remove so_locations in "make clean" (Tim Mooney)
-- fix maketree.c compilation error (Glenn, Mark)
-- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
-- new Makefile.riscos (Rich Walker)
-- initialize static descriptors in trees.c for embedded targets (Nick Smith)
-- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
-- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
-- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
-- fix maketree.c to allow clean compilation of inffixed.h (Mark)
-- fix parameter check in deflateCopy (Gunther Nikl)
-- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
-- Many portability patches by Christian Spieler:
- . zutil.c, zutil.h: added "const" for zmem*
- . Make_vms.com: fixed some typos
- . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
- . msdos/Makefile.msc: remove "default rtl link library" info from obj files
- . msdos/Makefile.*: use model-dependent name for the built zlib library
- . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
- new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
-- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
-- replace __far with _far for better portability (Christian Spieler, Tom Lane)
-- fix test for errno.h in configure (Tim Newsham)
-
-Changes in 1.1.2 (19 March 98)
-- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
- See http://www.winimage.com/zLibDll/unzip.html
-- preinitialize the inflate tables for fixed codes, to make the code
- completely thread safe (Mark)
-- some simplifications and slight speed-up to the inflate code (Mark)
-- fix gzeof on non-compressed files (Allan Schrum)
-- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
-- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
-- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
-- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
-- do not wrap extern "C" around system includes (Tom Lane)
-- mention zlib binding for TCL in README (Andreas Kupries)
-- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
-- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
-- allow "configure --prefix $HOME" (Tim Mooney)
-- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
-- move Makefile.sas to amiga/Makefile.sas
-
Changes in 1.1.1 (27 Feb 98)
- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
- remove block truncation heuristic which had very marginal effect for zlib
@@ -205,7 +138,7 @@ Changes in 1.0.6 (19 Jan 1998)
- allow compilation with ANSI keywords only enabled for TurboC in large model
- avoid "versionString"[0] (Borland bug)
- add NEED_DUMMY_RETURN for Borland
-- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
+- use variable z_verbose for tracing in debug mode (Peter Deutsch).
- allow compilation with CC
- defined STDC for OS/2 (David Charlap)
- limit external names to 8 chars for MVS (Thomas Lund)
diff --git a/lib/libz/FAQ b/lib/libz/FAQ
deleted file mode 100644
index 0feb6d3e9bbb..000000000000
--- a/lib/libz/FAQ
+++ /dev/null
@@ -1,72 +0,0 @@
-
- Frequently Asked Questions about zlib
-
-
-If your question is not there, please check the zlib home page
-http://www.cdrom.com/pub/infozip/zlib/ which may have more recent information.
-
-
-1) I need a Windows DLL
-2) I need a Visual Basic interface to zlib
-3) compress() returns Z_BUF_ERROR
-4) deflate or inflate returns Z_BUF_ERROR
-5) Where is the zlib documentation (man pages, etc...)?
-6) Why don't you use GNU autoconf, libtool, etc...?
-7) There is a bug in zlib.
-8) I get "undefined reference to gzputc"
-
-
-
-1) I need a Windows DLL
-
- The zlib sources can be compiled without change to produce a DLL.
- If you want a precompiled DLL, see http://www.winimage.com/zLibDll
-
-
-2) I need a Visual Basic interface to zlib
-
- See http://www.tcfb.com/dowseware/cmp-z-it.zip
- http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
- and contrib/visual-basic.txt
-
-3) compress() returns Z_BUF_ERROR
-
- Make sure that before the call of compress, the length of the
- compressed buffer is equal to the total size of the compressed buffer
- and not zero. For Visual Basic, check that this parameter is passed
- by reference ("as any"), not by value ("as long").
-
-
-4) deflate or inflate returns Z_BUF_ERROR
-
- Make sure that before the call avail_in and avail_out are not zero.
-
-
-5) Where is the zlib documentation (man pages, etc...)?
-
- It's in zlib.h for the moment. Volunteers to transform this
- to man pages, please contact jloup@gzip.org. Examples of zlib usage
- are in the files example.c and minigzip.c.
-
-
-6) Why don't you use GNU autoconf, libtool, etc...?
-
- Because we would like to keep zlib as a very small and simple package.
- zlib is rather portable and doesn't need much configuration.
-
-
-7) There is a bug in zlib.
-
- Most of the time, such problems are due to an incorrect usage
- of zlib. Please try to reproduce the problem with a small
- program and send us the corresponding source at zlib@quest.jpl.nasa.gov
- Do not send multi-megabyte data files without prior agreement.
-
-
-8) I get "undefined reference to gzputc"
-
- If "make test" produces something like
- example.o(.text+0x174):
- check that you don't have old files libz.* in /usr/lib, /usr/local/lib
- or /usr/X11R6/lib. Remove old versions then do "make install".
-
diff --git a/lib/libz/README b/lib/libz/README
index 8ff458799b95..acaea4fc8eae 100644
--- a/lib/libz/README
+++ b/lib/libz/README
@@ -1,4 +1,4 @@
-zlib 1.1.3 is a general purpose data compression library. All the code
+zlib 1.1.1 is a general purpose data compression library. All the code
is thread safe. The data format used by the zlib library
is described by RFCs (Request for Comments) 1950 to 1952 in the files
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
@@ -14,41 +14,26 @@ except example.c and minigzip.c.
To compile all files and run the test program, follow the instructions
given at the top of Makefile. In short "make test; make install"
-should work for most machines. For Unix: "configure; make test; make install"
-For MSDOS, use one of the special makefiles such as Makefile.msc.
-For VMS, use Make_vms.com or descrip.mms.
+should work for most machines. For MSDOS, use one of the special
+makefiles such as Makefile.msc; for VMS, use Make_vms.com or descrip.mms.
-Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
-Gilles Vollant <info@winimage.com> for the Windows DLL version.
+Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov> or,
+if this fails, to the addresses given below in the Copyright section.
The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
-Before reporting a problem, please check those sites to verify that
-you have the latest version of zlib; otherwise get the latest version and
-check whether the problem still exists or not.
-
-Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
-issue of Dr. Dobb's Journal; a copy of the article is available in
+Mark Nelson wrote an article about zlib for the Jan. 1997 issue of
+Dr. Dobb's Journal; a copy of the article is available in
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
-The changes made in version 1.1.3 are documented in the file ChangeLog.
-The main changes since 1.1.2 are:
-
-- fix "an inflate input buffer bug that shows up on rare but persistent
- occasions" (Mark)
-- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
-- fix gzseek(..., SEEK_SET) in write mode
-- fix crc check after a gzeek (Frank Faubert)
-- fix miniunzip when the last entry in a zip file is itself a zip file
- (J Lillge)
-- add contrib/asm586 and contrib/asm686 (Brian Raiter)
- See http://www.muppetlabs.com/~breadbox/software/assembly.html
-- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
-- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
-- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
-- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
-- added a FAQ file
-
-plus many changes for portability.
+The changes made in version 1.1.1 are documented in the file ChangeLog.
+The main changes since 1.1.0 are:
+
+- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+ (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+ compression ratio on some files. This also allows inlining _tr_tally for
+ matches in deflate_slow.
+
Unsupported third party contributions are provided in directory "contrib".
@@ -61,16 +46,12 @@ is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
-is available in Python 1.5 and later versions, see
-http://www.python.org/doc/lib/module-zlib.html
-
-A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
-is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
+is available from the Python Software Association sites, such as:
+ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz
-An experimental package to read and write files in .zip format,
-written on top of zlib by Gilles Vollant <info@winimage.com>, is
-available at http://www.winimage.com/zLibDll/unzip.html
-and also in the contrib/minizip directory of zlib.
+An experimental package to read files in .zip format, written on top of
+zlib by Gilles Vollant <info@winimage.com>, is available at
+http://www.winimage.com/zLibDll/unzip.html
Notes for some targets:
@@ -83,8 +64,8 @@ Notes for some targets:
From Visual Basic, you can call the DLL functions which do not take
a structure as argument: compress, uncompress and all gz* functions.
- See contrib/visual-basic.txt for more information, or get
- http://www.tcfb.com/dowseware/cmp-z-it.zip
+ See contrib/visual-basic.txt for more information.
+ I don't know how to handle structures in Visual Basic, sorry.
- For 64-bit Irix, deflate.c must be compiled without any optimization.
With -O, one libpng test fails. The test works in 32 bit mode (with
@@ -93,25 +74,23 @@ Notes for some targets:
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
it works when compiled with cc.
-- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
- is necessary to get gzprintf working correctly. This is done by configure.
-
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
with other compilers. Use "make test" to check your compiler.
+- For shared memory multiprocessors, the decompression code assumes that
+ writes to pointers are atomic. Also the functions zalloc and zfree passed
+ to deflateInit must be multi-threaded in this case.
+
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
- For Turbo C the small model is supported only with reduced performance to
avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
- Per Harald Myrvang <perm@stud.cs.uit.no>
-
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate
- and zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ and zlib specifications were written by Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib;
they are too numerous to cite here.
diff --git a/lib/libz/adler32.c b/lib/libz/adler32.c
index 16cf9a703f7c..b1f71ce05fe6 100644
--- a/lib/libz/adler32.c
+++ b/lib/libz/adler32.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id$ */
+/* $FreeBSD$ */
#include "zlib.h"
diff --git a/lib/libz/compress.c b/lib/libz/compress.c
index 1cee470913d7..31c51e611659 100644
--- a/lib/libz/compress.c
+++ b/lib/libz/compress.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id$ */
+/* $FreeBSD$ */
#include "zlib.h"
diff --git a/lib/libz/crc32.c b/lib/libz/crc32.c
index a91101a81c6a..2e98580b0b95 100644
--- a/lib/libz/crc32.c
+++ b/lib/libz/crc32.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id$ */
+/* $FreeBSD$ */
#include "zlib.h"
diff --git a/lib/libz/deflate.c b/lib/libz/deflate.c
index cfa05059d3ff..dc8c76c51372 100644
--- a/lib/libz/deflate.c
+++ b/lib/libz/deflate.c
@@ -47,12 +47,12 @@
*
*/
-/* @(#) $Id: deflate.c,v 1.1.1.3 1999/01/10 09:46:53 peter Exp $ */
+/* $FreeBSD$ */
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";
+ " deflate 1.1.1 Copyright 1995-1998 Jean-loup Gailly ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -608,13 +608,11 @@ int ZEXPORT deflateCopy (dest, source)
deflate_state *ss;
ushf *overlay;
+ ss = source->state;
- if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+ if (source == Z_NULL || dest == Z_NULL || ss == Z_NULL) {
return Z_STREAM_ERROR;
}
-
- ss = source->state;
-
*dest = *source;
ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
diff --git a/lib/libz/deflate.h b/lib/libz/deflate.h
index 112a15e0f443..5cf65ec89f1e 100644
--- a/lib/libz/deflate.h
+++ b/lib/libz/deflate.h
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* @(#) $Id: deflate.h,v 1.1.1.3 1999/01/10 09:46:53 peter Exp $ */
+/* $FreeBSD$ */
#ifndef _DEFLATE_H
#define _DEFLATE_H
@@ -230,12 +230,12 @@ typedef struct internal_state {
ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */
+ ulg compressed_len; /* total bit length of compressed file */
uInt matches; /* number of string matches in current block */
int last_eob_len; /* bit length of EOB code for last block */
#ifdef DEBUG
- ulg compressed_len; /* total bit length of compressed file mod 2^32 */
- ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
+ ulg bits_sent; /* bit length of the compressed data */
#endif
ush bi_buf;
@@ -268,7 +268,7 @@ typedef struct internal_state {
/* in trees.c */
void _tr_init OF((deflate_state *s));
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
int eof));
void _tr_align OF((deflate_state *s));
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
diff --git a/lib/libz/example.c b/lib/libz/example.c
index ed718cbe5f5b..e313c552d581 100644
--- a/lib/libz/example.c
+++ b/lib/libz/example.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: example.c,v 1.1.1.3 1999/01/10 09:46:54 peter Exp $ */
+/* $FreeBSD$ */
#include <stdio.h>
#include "zlib.h"
@@ -15,12 +15,6 @@
extern void exit OF((int));
#endif
-#if defined(VMS) || defined(RISCOS)
-# define TESTFILE "foo-gz"
-#else
-# define TESTFILE "foo.gz"
-#endif
-
#define CHECK_ERR(err, msg) { \
if (err != Z_OK) { \
fprintf(stderr, "%s error: %d\n", msg, err); \
@@ -77,7 +71,7 @@ void test_compress(compr, comprLen, uncompr, uncomprLen)
fprintf(stderr, "bad uncompress\n");
exit(1);
} else {
- printf("uncompress(): %s\n", (char *)uncompr);
+ printf("uncompress(): %s\n", uncompr);
}
}
@@ -85,8 +79,8 @@ void test_compress(compr, comprLen, uncompr, uncomprLen)
* Test read/write of .gz files
*/
void test_gzio(out, in, uncompr, uncomprLen)
- const char *out; /* compressed output file */
- const char *in; /* compressed input file */
+ const char *out; /* output file */
+ const char *in; /* input file */
Byte *uncompr;
int uncomprLen;
{
@@ -127,13 +121,13 @@ void test_gzio(out, in, uncompr, uncomprLen)
fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
exit(1);
} else {
- printf("gzread(): %s\n", (char *)uncompr);
+ printf("gzread(): %s\n", uncompr);
}
pos = gzseek(file, -8L, SEEK_CUR);
if (pos != 6 || gztell(file) != pos) {
fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
- (long)pos, (long)gztell(file));
+ pos, gztell(file));
exit(1);
}
@@ -152,7 +146,7 @@ void test_gzio(out, in, uncompr, uncomprLen)
fprintf(stderr, "bad gzgets after gzseek\n");
exit(1);
} else {
- printf("gzgets() after gzseek: %s\n", (char *)uncompr);
+ printf("gzgets() after gzseek: %s\n", uncompr);
}
gzclose(file);
@@ -233,7 +227,7 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen)
fprintf(stderr, "bad inflate\n");
exit(1);
} else {
- printf("inflate(): %s\n", (char *)uncompr);
+ printf("inflate(): %s\n", uncompr);
}
}
@@ -412,7 +406,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
err = inflateEnd(&d_stream);
CHECK_ERR(err, "inflateEnd");
- printf("after inflateSync(): hel%s\n", (char *)uncompr);
+ printf("after inflateSync(): hel%s\n", uncompr);
}
/* ===========================================================================
@@ -498,7 +492,7 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
fprintf(stderr, "bad inflate with dict\n");
exit(1);
} else {
- printf("inflate with dictionary: %s\n", (char *)uncompr);
+ printf("inflate with dictionary: %s\n", uncompr);
}
}
@@ -534,8 +528,8 @@ int main(argc, argv)
}
test_compress(compr, comprLen, uncompr, uncomprLen);
- test_gzio((argc > 1 ? argv[1] : TESTFILE),
- (argc > 2 ? argv[2] : TESTFILE),
+ test_gzio((argc > 1 ? argv[1] : "foo.gz"),
+ (argc > 2 ? argv[2] : "foo.gz"),
uncompr, (int)uncomprLen);
test_deflate(compr, comprLen);
diff --git a/lib/libz/gzio.c b/lib/libz/gzio.c
index b2090b809480..e3782d582712 100644
--- a/lib/libz/gzio.c
+++ b/lib/libz/gzio.c
@@ -5,7 +5,7 @@
* Compile this file with -DNO_DEFLATE to avoid the compression code.
*/
-/* @(#) $Id: gzio.c,v 1.1.1.3 1999/01/10 09:46:54 peter Exp $ */
+/* $FreeBSD$ */
#include <stdio.h>
@@ -13,16 +13,8 @@
struct internal_state {int dummy;}; /* for buggy compilers */
-#ifndef Z_BUFSIZE
-# ifdef MAXSEG_64K
-# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
-# else
-# define Z_BUFSIZE 16384
-# endif
-#endif
-#ifndef Z_PRINTF_BUFSIZE
-# define Z_PRINTF_BUFSIZE 4096
-#endif
+#define Z_BUFSIZE 16384
+#define Z_PRINTF_BUFSIZE 4096
#define ALLOC(size) malloc(size)
#define TRYFREE(p) {if (p) free(p);}
@@ -140,12 +132,8 @@ local gzFile gz_open (path, mode, fd)
s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
err = inflateInit2(&(s->stream), -MAX_WBITS);
- /* windowBits is passed < 0 to tell that there is no zlib header.
- * Note that in this case inflate *requires* an extra "dummy" byte
- * after the compressed stream in order to complete decompression and
- * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
- * present after the compressed stream.
- */
+ /* windowBits is passed < 0 to tell that there is no zlib header */
+
if (err != Z_OK || s->inbuf == Z_NULL) {
return destroy(s), (gzFile)Z_NULL;
}
@@ -391,7 +379,6 @@ int ZEXPORT gzread (file, buf, len)
len -= s->stream.avail_out;
s->stream.total_in += (uLong)len;
s->stream.total_out += (uLong)len;
- if (len == 0) s->z_eof = 1;
return (int)len;
}
if (s->stream.avail_in == 0 && !s->z_eof) {
@@ -414,14 +401,10 @@ int ZEXPORT gzread (file, buf, len)
s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
start = s->stream.next_out;
- if (getLong(s) != s->crc) {
+ if (getLong(s) != s->crc || getLong(s) != s->stream.total_out) {
s->z_err = Z_DATA_ERROR;
} else {
- (void)getLong(s);
- /* The uncompressed length returned by above getlong() may
- * be different from s->stream.total_out) in case of
- * concatenated .gz files. Check for such files:
- */
+ /* Check for concatenated .gz files: */
check_header(s);
if (s->z_err == Z_OK) {
uLong total_in = s->stream.total_in;
@@ -589,7 +572,7 @@ int ZEXPORT gzputs(file, s)
gzFile file;
const char *s;
{
- return gzwrite(file, (char*)s, (unsigned)strlen(s));
+ return gzwrite(file, (const voidp)s, (unsigned)strlen(s));
}
@@ -674,7 +657,7 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
return -1L;
#else
if (whence == SEEK_SET) {
- offset -= s->stream.total_in;
+ offset -= s->stream.total_out;
}
if (offset < 0) return -1L;
@@ -749,7 +732,6 @@ int ZEXPORT gzrewind (file)
s->z_eof = 0;
s->stream.avail_in = 0;
s->stream.next_in = s->inbuf;
- s->crc = crc32(0L, Z_NULL, 0);
if (s->startpos == 0) { /* not a compressed file */
rewind(s->file);
@@ -798,8 +780,7 @@ local void putLong (file, x)
}
/* ===========================================================================
- Reads a long in LSB order from the given gz_stream. Sets z_err in case
- of error.
+ Reads a long in LSB order from the given gz_stream. Sets
*/
local uLong getLong (s)
gz_stream *s;
diff --git a/lib/libz/infblock.c b/lib/libz/infblock.c
index f4920faa5ea0..17943ab7939b 100644
--- a/lib/libz/infblock.c
+++ b/lib/libz/infblock.c
@@ -11,10 +11,6 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
/* Table for deflate from PKZIP's appnote.txt. */
local const uInt border[] = { /* Order of the bit length code lengths */
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
@@ -268,8 +264,8 @@ int r;
t = s->sub.trees.bb;
NEEDBITS(t)
h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
- t = h->bits;
- c = h->base;
+ t = h->word.what.Bits;
+ c = h->more.Base;
if (c < 16)
{
DUMPBITS(t)
@@ -345,6 +341,13 @@ int r;
s->mode = TYPE;
break;
}
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
s->mode = DRY;
case DRY:
FLUSH
diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c
index d4e5ee9a5543..181aa5389639 100644
--- a/lib/libz/infcodes.c
+++ b/lib/libz/infcodes.c
@@ -11,6 +11,8 @@
#include "inffast.h"
/* simplify the use of the inflate_huft type with some defines */
+#define base more.Base
+#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
@@ -143,7 +145,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
+ c->sub.code.tree = t->next;
break;
}
if (e & 32) /* end of block */
@@ -181,7 +183,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
+ c->sub.code.tree = t->next;
break;
}
c->mode = BADCODE; /* invalid code */
@@ -221,13 +223,6 @@ int r;
c->mode = START;
break;
case WASH: /* o: got eob, possibly more output */
- if (k > 7) /* return unused byte, if any */
- {
- Assert(k < 16, "inflate_codes grabbed too many bytes")
- k -= 8;
- n++;
- p--; /* can always return one */
- }
FLUSH
if (s->read != s->write)
LEAVE
diff --git a/lib/libz/inffast.c b/lib/libz/inffast.c
index 61a78ee933fc..3c6ff06f6c25 100644
--- a/lib/libz/inffast.c
+++ b/lib/libz/inffast.c
@@ -13,12 +13,14 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
/* simplify the use of the inflate_huft type with some defines */
+#define base more.Base
+#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
/* macros for bit input with no checking and for returning unused bytes */
#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}
/* Called with number of bytes left to write in window at least 258
(the maximum string length) and number of input bytes available
@@ -118,10 +120,7 @@ z_streamp z;
break;
}
else if ((e & 64) == 0)
- {
- t += t->base;
- e = (t += ((uInt)b & inflate_mask[e]))->exop;
- }
+ e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;
else
{
z->msg = (char*)"invalid distance code";
@@ -134,8 +133,7 @@ z_streamp z;
}
if ((e & 64) == 0)
{
- t += t->base;
- if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
+ if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
{
DUMPBITS(t->bits)
Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
diff --git a/lib/libz/inffixed.h b/lib/libz/inffixed.h
deleted file mode 100644
index 77f7e7631452..000000000000
--- a/lib/libz/inffixed.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* inffixed.h -- table for decoding fixed codes
- * Generated automatically by the maketree.c program
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-local uInt fixed_bl = 9;
-local uInt fixed_bd = 5;
-local inflate_huft fixed_tl[] = {
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
- };
-local inflate_huft fixed_td[] = {
- {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
- {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
- {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
- {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
- {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
- {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
- {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
- {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
- };
diff --git a/lib/libz/inftrees.c b/lib/libz/inftrees.c
index ef1e0b6b8732..9f85187f0af2 100644
--- a/lib/libz/inftrees.c
+++ b/lib/libz/inftrees.c
@@ -6,12 +6,8 @@
#include "zutil.h"
#include "inftrees.h"
-#if !defined(BUILDFIXED) && !defined(STDC)
-# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
-#endif
-
const char inflate_copyright[] =
- " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+ " inflate 1.1.1 Copyright 1995-1998 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -21,6 +17,8 @@ const char inflate_copyright[] =
struct internal_state {int dummy;}; /* for buggy compilers */
/* simplify the use of the inflate_huft type with some defines */
+#define base more.Base
+#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
@@ -234,6 +232,11 @@ uIntf *v; /* working area: values in order of bit length */
return Z_MEM_ERROR; /* not enough memory */
u[h] = q = hp + *hn;
*hn += z;
+ if (t != Z_NULL) /* first table is returned result */
+ {
+ *t = q;
+ t = Z_NULL;
+ }
/* connect to last table, if there is one */
if (h)
@@ -241,12 +244,10 @@ uIntf *v; /* working area: values in order of bit length */
x[h] = i; /* save pattern for backing up */
r.bits = (Byte)l; /* bits to dump before this table */
r.exop = (Byte)j; /* bits in this table */
- j = i >> (w - l);
- r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ r.next = q; /* pointer to this table */
+ j = i >> (w - l); /* (get around Turbo C bug) */
u[h-1][j] = r; /* connect to last table */
}
- else
- *t = q; /* first table is returned result */
}
/* set up table entry in r */
@@ -383,17 +384,13 @@ z_streamp z; /* for messages */
/* build fixed tables only once--keep them here */
-#ifdef BUILDFIXED
local int fixed_built = 0;
-#define FIXEDH 544 /* number of hufts used by fixed tables */
+#define FIXEDH 424 /* number of hufts used by fixed tables */
local inflate_huft fixed_mem[FIXEDH];
local uInt fixed_bl;
local uInt fixed_bd;
local inflate_huft *fixed_tl;
local inflate_huft *fixed_td;
-#else
-#include "inffixed.h"
-#endif
int inflate_trees_fixed(bl, bd, tl, td, z)
@@ -403,8 +400,7 @@ inflate_huft * FAR *tl; /* literal/length tree result */
inflate_huft * FAR *td; /* distance tree result */
z_streamp z; /* for memory allocation */
{
-#ifdef BUILDFIXED
- /* build fixed tables if not already */
+ /* build fixed tables if not already (multiple overlapped executions ok) */
if (!fixed_built)
{
int k; /* temporary variable */
@@ -430,7 +426,7 @@ z_streamp z; /* for memory allocation */
c[k] = 7;
for (; k < 288; k++)
c[k] = 8;
- fixed_bl = 9;
+ fixed_bl = 7;
huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
fixed_mem, &f, v);
@@ -446,7 +442,6 @@ z_streamp z; /* for memory allocation */
ZFREE(z, c);
fixed_built = 1;
}
-#endif
*bl = fixed_bl;
*bd = fixed_bd;
*tl = fixed_tl;
diff --git a/lib/libz/inftrees.h b/lib/libz/inftrees.h
index 85853e097b37..c2513d194927 100644
--- a/lib/libz/inftrees.h
+++ b/lib/libz/inftrees.h
@@ -19,15 +19,17 @@ struct inflate_huft_s {
Byte Exop; /* number of extra bits or operation */
Byte Bits; /* number of bits in this code or subcode */
} what;
- uInt pad; /* pad structure to a power of 2 (4 bytes for */
- } word; /* 16-bit, 8 bytes for 32-bit int's) */
- uInt base; /* literal, length base, distance base,
- or table offset */
+ Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit machines) */
+ union {
+ uInt Base; /* literal, length base, or distance base */
+ inflate_huft *Next; /* pointer to next level of table */
+ } more;
};
/* Maximum size of dynamic tree. The maximum found in a long but non-
- exhaustive search was 1004 huft structures (850 for length/literals
- and 154 for distances, the latter actually the result of an
+ exhaustive search was 1041 huft structures (875 for length/literals
+ and 166 for distances, the latter actually the result of an
exhaustive search). The actual maximum is not known, but the
value below is more than safe. */
#define MANY 1440
diff --git a/lib/libz/maketree.c b/lib/libz/maketree.c
deleted file mode 100644
index 949d78641851..000000000000
--- a/lib/libz/maketree.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* maketree.c -- make inffixed.h table for decoding fixed codes
- * Copyright (C) 1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* This program is included in the distribution for completeness.
- You do not need to compile or run this program since inffixed.h
- is already included in the distribution. To use this program
- you need to compile zlib with BUILDFIXED defined and then compile
- and link this program with the zlib library. Then the output of
- this program can be piped to inffixed.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "zutil.h"
-#include "inftrees.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* generate initialization table for an inflate_huft structure array */
-void maketree(uInt b, inflate_huft *t)
-{
- int i, e;
-
- i = 0;
- while (1)
- {
- e = t[i].exop;
- if (e && (e & (16+64)) == 0) /* table pointer */
- {
- fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
- exit(1);
- }
- if (i % 4 == 0)
- printf("\n ");
- printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
- if (++i == (1<<b))
- break;
- putchar(',');
- }
- puts("");
-}
-
-/* create the fixed tables in C initialization syntax */
-void main(void)
-{
- int r;
- uInt bl, bd;
- inflate_huft *tl, *td;
- z_stream z;
-
- z.zalloc = zcalloc;
- z.opaque = (voidpf)0;
- z.zfree = zcfree;
- r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
- if (r)
- {
- fprintf(stderr, "inflate_trees_fixed error %d\n", r);
- return;
- }
- puts("/* inffixed.h -- table for decoding fixed codes");
- puts(" * Generated automatically by the maketree.c program");
- puts(" */");
- puts("");
- puts("/* WARNING: this file should *not* be used by applications. It is");
- puts(" part of the implementation of the compression library and is");
- puts(" subject to change. Applications should only use zlib.h.");
- puts(" */");
- puts("");
- printf("local uInt fixed_bl = %d;\n", bl);
- printf("local uInt fixed_bd = %d;\n", bd);
- printf("local inflate_huft fixed_tl[] = {");
- maketree(bl, tl);
- puts(" };");
- printf("local inflate_huft fixed_td[] = {");
- maketree(bd, td);
- puts(" };");
-}
diff --git a/lib/libz/minigzip.c b/lib/libz/minigzip.c
index 180b39d2ce24..487632e7f1d2 100644
--- a/lib/libz/minigzip.c
+++ b/lib/libz/minigzip.c
@@ -13,7 +13,7 @@
* or in pipe mode.
*/
-/* @(#) $Id: minigzip.c,v 1.1.1.3 1999/01/10 09:46:57 peter Exp $ */
+/* $FreeBSD$ */
#include <stdio.h>
#include "zlib.h"
@@ -48,9 +48,6 @@
# define GZ_SUFFIX "-gz"
# define fileno(file) file->__file
#endif
-#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fileno */
-#endif
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
extern int unlink OF((const char *));
diff --git a/lib/libz/trees.c b/lib/libz/trees.c
index b02b5277f48a..2497001742d3 100644
--- a/lib/libz/trees.c
+++ b/lib/libz/trees.c
@@ -29,7 +29,7 @@
* Addison-Wesley, 1983. ISBN 0-201-06672-6.
*/
-/* @(#) $Id: trees.c,v 1.1.1.3 1999/01/10 09:46:57 peter Exp $ */
+/* $FreeBSD$ */
/* #define GEN_TREES_H */
@@ -250,13 +250,6 @@ local void tr_static_init()
if (static_init_done) return;
- /* For some embedded targets, global variables are not initialized: */
- static_l_desc.static_tree = static_ltree;
- static_l_desc.extra_bits = extra_lbits;
- static_d_desc.static_tree = static_dtree;
- static_d_desc.extra_bits = extra_dbits;
- static_bl_desc.extra_bits = extra_blbits;
-
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
for (code = 0; code < LENGTH_CODES-1; code++) {
@@ -385,6 +378,8 @@ void _tr_init(s)
{
tr_static_init();
+ s->compressed_len = 0L;
+
s->l_desc.dyn_tree = s->dyn_ltree;
s->l_desc.stat_desc = &static_l_desc;
@@ -398,7 +393,6 @@ void _tr_init(s)
s->bi_valid = 0;
s->last_eob_len = 8; /* enough lookahead for inflate */
#ifdef DEBUG
- s->compressed_len = 0L;
s->bits_sent = 0L;
#endif
@@ -871,10 +865,9 @@ void _tr_stored_block(s, buf, stored_len, eof)
int eof; /* true if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
-#ifdef DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
-#endif
+
copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
}
@@ -894,9 +887,7 @@ void _tr_align(s)
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
-#endif
bi_flush(s);
/* Of the 10 bits for the empty block, we have already sent
* (10 - bi_valid) bits. The lookahead for the last real code (before
@@ -906,9 +897,7 @@ void _tr_align(s)
if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
s->compressed_len += 10L;
-#endif
bi_flush(s);
}
s->last_eob_len = 7;
@@ -916,9 +905,10 @@ void _tr_align(s)
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
+ * trees or store, and output the encoded block to the zip file. This function
+ * returns the total compressed length for the file so far.
*/
-void _tr_flush_block(s, buf, stored_len, eof)
+ulg _tr_flush_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
@@ -965,6 +955,25 @@ void _tr_flush_block(s, buf, stored_len, eof)
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
}
+ /* If compression failed and this is the first and last block,
+ * and if the .zip file can be seeked (to rewrite the local header),
+ * the whole file is transformed into a stored file:
+ */
+#ifdef STORED_FILE_OK
+# ifdef FORCE_STORED_FILE
+ if (eof && s->compressed_len == 0L) { /* force stored file */
+# else
+ if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {
+# endif
+ /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
+ if (buf == (charf*)0) error ("block vanished");
+
+ copy_block(buf, (unsigned)stored_len, 0); /* without header */
+ s->compressed_len = stored_len << 3;
+ s->method = STORED;
+ } else
+#endif /* STORED_FILE_OK */
+
#ifdef FORCE_STORED
if (buf != (char*)0) { /* force stored block */
#else
@@ -986,32 +995,25 @@ void _tr_flush_block(s, buf, stored_len, eof)
#endif
send_bits(s, (STATIC_TREES<<1)+eof, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
-#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
-#endif
} else {
send_bits(s, (DYN_TREES<<1)+eof, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
-#ifdef DEBUG
s->compressed_len += 3 + s->opt_len;
-#endif
}
Assert (s->compressed_len == s->bits_sent, "bad compressed size");
- /* The above check is made mod 2^32, for files larger than 512 MB
- * and uLong implemented on 32 bits.
- */
init_block(s);
if (eof) {
bi_windup(s);
-#ifdef DEBUG
s->compressed_len += 7; /* align on byte boundary */
-#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
s->compressed_len-7*eof));
+
+ return s->compressed_len >> 3;
}
/* ===========================================================================
diff --git a/lib/libz/uncompr.c b/lib/libz/uncompr.c
index d1033213781e..b1bd9fc41b0f 100644
--- a/lib/libz/uncompr.c
+++ b/lib/libz/uncompr.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id$ */
+/* $FreeBSD$ */
#include "zlib.h"
diff --git a/lib/libz/zconf.h b/lib/libz/zconf.h
index f06124f81b7f..5b71e4b0ad42 100644
--- a/lib/libz/zconf.h
+++ b/lib/libz/zconf.h
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: zconf.h,v 1.1.1.3 1999/01/10 09:46:58 peter Exp $ */
+/* $FreeBSD$ */
#ifndef _ZCONF_H
#define _ZCONF_H
@@ -91,8 +91,8 @@
# define NO_DUMMY_DECL
#endif
-/* Old Borland C incorrectly complains about missing returns: */
-#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+/* Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__)
# define NEED_DUMMY_RETURN
#endif
@@ -148,7 +148,7 @@
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
-# define FAR _far
+# define FAR __far
# else
# define FAR far
# endif
@@ -156,68 +156,42 @@
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
# ifndef __32BIT__
# define SMALL_MEDIUM
-# define FAR _far
+# define FAR __far
# endif
#endif
/* Compile with -DZLIB_DLL for Windows DLL support */
-#if defined(ZLIB_DLL)
-# if defined(_WINDOWS) || defined(WINDOWS)
-# ifdef FAR
-# undef FAR
-# endif
-# include <windows.h>
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR _cdecl _export
-# endif
+#if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
+# ifdef FAR
+# undef FAR
# endif
-# if defined (__BORLANDC__)
-# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
-# include <windows.h>
-# define ZEXPORT __declspec(dllexport) WINAPI
-# define ZEXPORTRVA __declspec(dllexport) WINAPIV
-# else
-# if defined (_Windows) && defined (__DLL__)
-# define ZEXPORT _export
-# define ZEXPORTVA _export
-# endif
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# if defined (ZLIB_DLL)
-# define ZEXTERN extern __declspec(dllexport)
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
# else
-# define ZEXTERN extern __declspec(dllimport)
+# define ZEXPORTVA FAR _cdecl _export
# endif
-#endif
-
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-#ifndef ZEXTERN
-# define ZEXTERN extern
+#else
+# if defined (__BORLANDC__) && defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# else
+# define ZEXPORT
+# define ZEXPORTVA
+# endif
#endif
#ifndef FAR
# define FAR
#endif
-#if !defined(MACOS) && !defined(TARGET_OS_MAC)
typedef unsigned char Byte; /* 8 bits */
-#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
+ /* Borland C/C++ ignores FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
@@ -243,7 +217,6 @@ typedef uLong FAR uLongf;
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
diff --git a/lib/libz/zlib.3 b/lib/libz/zlib.3
index 25c8495d25f1..8519184d4fb8 100644
--- a/lib/libz/zlib.3
+++ b/lib/libz/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "9 July 1998"
+.TH ZLIB 3 "27 February 1998"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
@@ -81,7 +81,7 @@ These documents are also available in other formats from:
.IP
ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
.SH AUTHORS
-Version 1.1.3
+Version 1.1.1
Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org)
and Mark Adler (madler@alumni.caltech.edu).
.LP
@@ -96,7 +96,7 @@ The deflate format used by
was defined by Phil Katz.
The deflate and
.I zlib
-specifications were written by L. Peter Deutsch.
+specifications were written by Peter Deutsch.
Thanks to all the people who reported problems and suggested various
improvements in
.IR zlib ;
diff --git a/lib/libz/zlib.h b/lib/libz/zlib.h
index 49f56b43bc6c..06f988c1f058 100644
--- a/lib/libz/zlib.h
+++ b/lib/libz/zlib.h
@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.3, July 9th, 1998
+ version 1.1.1, Feb 27th, 1998
Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
@@ -31,13 +31,13 @@
#ifndef _ZLIB_H
#define _ZLIB_H
-#include "zconf.h"
-
#ifdef __cplusplus
extern "C" {
#endif
-#define ZLIB_VERSION "1.1.3"
+#include "zconf.h"
+
+#define ZLIB_VERSION "1.1.1"
/*
The 'zlib' compression library provides in-memory compression and
@@ -168,7 +168,7 @@ typedef z_stream FAR *z_streamp;
/* basic functions */
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+extern const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
@@ -176,7 +176,7 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void));
*/
/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+extern int ZEXPORT deflateInit OF((z_streamp strm, int level));
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller.
@@ -198,7 +198,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
*/
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+extern int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce some
@@ -271,12 +271,11 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero).
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible.
*/
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+extern int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
@@ -291,7 +290,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+extern int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
@@ -311,7 +310,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
*/
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+extern int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may some
@@ -380,7 +379,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
*/
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+extern int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
@@ -398,12 +397,12 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
*/
/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
+extern int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by
@@ -441,14 +440,14 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
not perform any compression: this will be done by deflate().
*/
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+extern int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
+ immediately after deflateInit or deflateInit2, before any call of
+ deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
@@ -477,8 +476,8 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
perform any compression: this will be done by deflate().
*/
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
+extern int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
@@ -495,7 +494,7 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
destination.
*/
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+extern int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state.
@@ -506,9 +505,7 @@ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
stream state was inconsistent (such as zalloc or state being NULL).
*/
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
+extern int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
@@ -528,8 +525,8 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
*/
/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
+extern int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
@@ -550,9 +547,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
modified, but next_out and avail_out are unchanged.)
*/
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+extern int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate
@@ -569,7 +566,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
inflate().
*/
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+extern int ZEXPORT inflateSync OF((z_streamp strm));
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
@@ -584,7 +581,7 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
until success or end of the input data.
*/
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+extern int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
@@ -605,8 +602,8 @@ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
utility functions can easily be modified if you need special options.
*/
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+extern int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
@@ -620,9 +617,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
buffer.
*/
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
+extern int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
@@ -635,8 +632,8 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
Z_STREAM_ERROR if the level parameter is invalid.
*/
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+extern int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
@@ -656,7 +653,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
typedef voidp gzFile;
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+extern gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
@@ -672,7 +669,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+extern gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
gzdopen() associates a gzFile with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
@@ -685,7 +682,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
the (de)compression state.
*/
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+extern int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
@@ -693,7 +690,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
opened for writing.
*/
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+extern int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
@@ -701,29 +698,28 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- const voidp buf, unsigned len));
+extern int ZEXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+extern int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written (0 in case of error).
*/
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+extern int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+extern char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
@@ -732,19 +728,19 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
gzgets returns buf, or Z_NULL in case of error.
*/
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+extern int ZEXPORT gzputc OF((gzFile file, int c));
/*
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+extern int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+extern int ZEXPORT gzflush OF((gzFile file, int flush));
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
@@ -754,11 +750,10 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
degrade compression.
*/
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
+extern z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence));
/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
If the file is opened for reading, this function is emulated but can be
@@ -772,14 +767,14 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
would be before the current position.
*/
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+extern int ZEXPORT gzrewind OF((gzFile file));
/*
Rewinds the given file. This function is supported only for reading.
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+extern z_off_t ZEXPORT gztell OF((gzFile file));
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
@@ -788,20 +783,20 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+extern int ZEXPORT gzeof OF((gzFile file));
/*
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+extern int ZEXPORT gzclose OF((gzFile file));
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+extern const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
@@ -818,7 +813,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
compression library.
*/
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+extern uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
@@ -835,7 +830,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+extern uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
@@ -857,16 +852,16 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+extern int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+extern int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+extern int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+extern int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
@@ -882,9 +877,9 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
-ZEXTERN const char * ZEXPORT zError OF((int err));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+extern const char * ZEXPORT zError OF((int err));
+extern int ZEXPORT inflateSyncPoint OF((z_streamp z));
+extern const uLongf * ZEXPORT get_crc_table OF((void));
#ifdef __cplusplus
}
diff --git a/lib/libz/zutil.c b/lib/libz/zutil.c
index 60340c838cb9..0d12b55d28b2 100644
--- a/lib/libz/zutil.c
+++ b/lib/libz/zutil.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: zutil.c,v 1.1.1.3 1999/01/10 09:46:59 peter Exp $ */
+/* $FreeBSD$ */
#include "zutil.h"
@@ -60,7 +60,7 @@ const char * ZEXPORT zError(err)
void zmemcpy(dest, source, len)
Bytef* dest;
- const Bytef* source;
+ Bytef* source;
uInt len;
{
if (len == 0) return;
@@ -70,8 +70,8 @@ void zmemcpy(dest, source, len)
}
int zmemcmp(s1, s2, len)
- const Bytef* s1;
- const Bytef* s2;
+ Bytef* s1;
+ Bytef* s2;
uInt len;
{
uInt j;
@@ -178,7 +178,7 @@ void zcfree (voidpf opaque, voidpf ptr)
# define MY_ZCALLOC
-#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+#if (!defined(_MSC_VER) || (_MSC_VER < 600))
# define _halloc halloc
# define _hfree hfree
#endif
diff --git a/lib/libz/zutil.h b/lib/libz/zutil.h
index 429339ff9846..3843e0de9f2f 100644
--- a/lib/libz/zutil.h
+++ b/lib/libz/zutil.h
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* @(#) $Id: zutil.h,v 1.1.1.3 1999/01/10 09:46:59 peter Exp $ */
+/* $FreeBSD$ */
#ifndef _Z_UTIL_H
#define _Z_UTIL_H
@@ -75,7 +75,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef MSDOS
# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
+# ifdef __TURBOC__
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block );
@@ -112,12 +112,13 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+#endif
+#if defined(__MWERKS__) && !defined(fdopen)
+# if __dest_os != __be_os && __dest_os != __win32_os
+# define fdopen(fd,mode) NULL
# endif
#endif
@@ -133,7 +134,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
+#if (defined(_MSC_VER) && (_MSC_VER >= 600))
# define fdopen(fd,type) _fdopen(fd,type)
#endif
@@ -181,8 +182,8 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
- extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ extern void zmemcpy OF((Bytef* dest, Bytef* source, uInt len));
+ extern int zmemcmp OF((Bytef* s1, Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 0507810348f8..a0ca7405fbd7 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -1,5 +1,5 @@
# @(#)Makefile 5.1beta 93/09/24
-# $Id: Makefile,v 1.21 1998/12/23 11:50:51 dfr Exp $
+# $Id: Makefile,v 1.19 1997/04/15 14:05:28 bde Exp $
#
# ====================================================
# Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -48,8 +48,6 @@ ARCH_SRCS = s_copysign.S s_copysignf.S
# XXX Comment from NetBSD/Alpha:
# XXX LINT SIGFPEs in e_exp.c's strtod(). FP underflow/denorm software
# handling is broken (doesn't exist!) on the Alpha port.
-# Stock gcc 2.7.2.1 doesn't understand these options.
-#CFLAGS += -mtrap-precision=i -mfp-trap-mode=su
.elif ${MACHINE_ARCH} == "i386"
ARCH= i387
ARCH_PREFIX= ${ARCH}_
diff --git a/libexec/Makefile b/libexec/Makefile
index 991501ac4f08..92a9f13d4fc2 100644
--- a/libexec/Makefile
+++ b/libexec/Makefile
@@ -1,19 +1,22 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
-# $Id: Makefile,v 1.36 1998/09/05 08:33:10 jb Exp $
+# $Id: Makefile,v 1.35 1998/09/04 22:55:17 jb Exp $
-# Present but disabled: kpasswdd
SUBDIR= atrun bootpd comsat fingerd ftpd getNAME getty \
- makekey mknetid named-xfer rbootd revnetgroup rexecd \
- rlogind rpc.rquotad rpc.rstatd rpc.rusersd rpc.rwalld \
- rpc.sprayd rshd talkd tftpd uucpd xtend ypxfr
+ makekey mknetid revnetgroup rexecd rlogind \
+ rpc.rquotad rpc.rstatd \
+ rpc.rusersd rpc.rwalld rpc.sprayd rshd talkd tftpd uucpd \
+ xtend ypxfr
.if !defined(NO_SENDMAIL)
SUBDIR+=mail.local smrsh
.endif
+.if ${MACHINE_ARCH} == i386
+SUBDIR+=named-xfer
.if ${OBJFORMAT} == aout
SUBDIR+=rtld-aout
.endif
+.endif
.if ${OBJFORMAT} == elf
SUBDIR+=rtld-elf
@@ -24,4 +27,10 @@ SUBDIR+=rtld-elf
SUBDIR+=telnetd
.endif
+# Present but disabled: kpasswdd
+
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR+=rbootd
+.endif
+
.include <bsd.subdir.mk>
diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c
index 6d6a74fed6c6..68e35d50223a 100644
--- a/libexec/bootpd/bootpd.c
+++ b/libexec/bootpd/bootpd.c
@@ -19,7 +19,7 @@ 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.
- $Id: bootpd.c,v 1.9 1998/12/12 20:56:53 dillon Exp $
+ $Id: bootpd.c,v 1.7 1997/05/11 14:27:03 phk Exp $
************************************************************************/
@@ -635,8 +635,6 @@ handle_request()
char *homedir, *bootfile;
int n;
- bp->bp_file[sizeof(bp->bp_file)-1] = '\0';
-
/* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */
/*
@@ -835,7 +833,7 @@ HW addr type is IEEE 802. convert to %s and check again\n",
* daemon chroot directory (i.e. /tftpboot).
*/
if (hp->flags.tftpdir) {
- snprintf(realpath, sizeof(realpath), "%s", hp->tftpdir->string);
+ strcpy(realpath, hp->tftpdir->string);
clntpath = &realpath[strlen(realpath)];
} else {
realpath[0] = '\0';
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index 79956125c51d..59cd2de010ab 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -1,5 +1,5 @@
# @(#)Makefile 8.2 (Berkeley) 4/4/94
-# $Id: Makefile,v 1.24 1998/05/04 18:20:18 bde Exp $
+# $Id: Makefile,v 1.23 1997/10/05 09:39:27 jkh Exp $
PROG= ftpd
MAN8= ftpd.8
@@ -20,7 +20,7 @@ CFLAGS+=-DINTERNAL_LS -Dmain=ls_main -I${.CURDIR}/${LSDIR}
.endif
.if exists(${DESTDIR}/usr/lib/libkrb.a) && defined(MAKE_KERBEROS4)
-.PATH: ${.CURDIR}/../../lib/libpam/modules/pam_kerberosIV
+.PATH: ${.CURDIR}/../../usr.bin/login
SRCS+= klogin.c
LDADD+= -lkrb -ldes
DPADD+= ${LIBKRB} ${LIBDES}
diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8
index df639327564d..2f52338073a2 100644
--- a/libexec/ftpd/ftpd.8
+++ b/libexec/ftpd/ftpd.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94
-.\" $Id: ftpd.8,v 1.24 1998/12/02 22:11:02 billf Exp $
+.\" $Id: ftpd.8,v 1.22 1998/07/09 11:38:21 jkoshy Exp $
.\"
.Dd April 19, 1994
.Dt FTPD 8
@@ -109,7 +109,7 @@ In previous versions of
.Nm Ns ,
when a passive mode client requested a data connection to the server,
the server would use data ports in the range 1024..4999. Now, by default,
-the server will use data ports in the range 49152..65535. Specifying this
+the server will use data ports in the range 40000..44999. Specifying this
option will revert to the old behavior.
.It Fl T
A client may also request a different timeout period;
@@ -138,7 +138,7 @@ Allow only anonymous ftp access.
.El
.Pp
The file
-.Pa /var/run/nologin
+.Pa /etc/nologin
can be used to disable ftp access.
If the file exists,
.Nm
@@ -436,7 +436,7 @@ Virtual hosting configuration file.
Welcome notice.
.It Pa /etc/ftpmotd
Welcome notice after login.
-.It Pa /var/run/nologin
+.It Pa /etc/nologin
Displayed and access refused.
.It Pa /var/log/ftpd
Log file for anonymous transfers.
diff --git a/libexec/rlogind/rlogind.8 b/libexec/rlogind/rlogind.8
index 4f8ae93e0cb6..e3f359392318 100644
--- a/libexec/rlogind/rlogind.8
+++ b/libexec/rlogind/rlogind.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rlogind.8 8.1 (Berkeley) 6/4/93
-.\" $Id: rlogind.8,v 1.9 1997/11/25 07:17:13 charnier Exp $
+.\" $Id: rlogind.8,v 1.8 1997/02/22 14:22:07 peter Exp $
.\"
.Dd June 4, 1993
.Dt RLOGIND 8
@@ -177,7 +177,7 @@ by the server failed.
.It Pa /etc/hosts
.It Pa /etc/hosts.equiv
.It Pa $HOME/.rhosts
-.It Pa /var/run/nologin
+.It Pa /etc/nologin
.El
.Sh BUGS
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index 64cf70fa68c7..b0227e6db13b 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: rlogind.c,v 1.19 1997/11/25 07:17:15 charnier Exp $";
+ "$Id$";
#endif /* not lint */
/*
@@ -122,6 +122,8 @@ void getstr __P((char *, int, char *));
void setup_term __P((int));
int do_krb_login __P((struct sockaddr_in *));
void usage __P((void));
+int local_domain __P((char *));
+char *topdomain __P((char *));
int
main(argc, argv)
@@ -230,27 +232,9 @@ doit(f, fromp)
hp = gethostbyaddr((char *)&fromp->sin_addr, sizeof(struct in_addr),
fromp->sin_family);
if (hp) {
- strncpy(hostname, hp->h_name, sizeof(hostname) - 1);
- hostname[sizeof(hostname) - 1] = '\0';
- hp = gethostbyname(hostname);
- if (hp == NULL) {
- strncpy(hostname, inet_ntoa(fromp->sin_addr),
- sizeof(hostname) - 1);
- } else for (; ; hp->h_addr_list++) {
- if (hp->h_addr_list[0] == NULL) {
- /* End of list - ditch it */
- strncpy(hostname, inet_ntoa(fromp->sin_addr),
- sizeof(hostname) - 1);
- break;
- }
- if (!bcmp(hp->h_addr_list[0],
- (caddr_t)&fromp->sin_addr,
- sizeof(fromp->sin_addr)))
- break; /* OK! */
- }
+ (void)strncpy(hostname, hp->h_name, sizeof(hostname));
} else {
- strncpy(hostname, inet_ntoa(fromp->sin_addr),
- sizeof(hostname) - 1);
+ (void)strncpy(hostname, inet_ntoa(fromp->sin_addr), sizeof(hostname));
}
hostname[sizeof(hostname) - 1] = '\0';
@@ -758,3 +742,45 @@ usage()
syslog(LOG_ERR, "usage: rlogind [-Daln]");
#endif
}
+
+/*
+ * Check whether host h is in our local domain,
+ * defined as sharing the last two components of the domain part,
+ * or the entire domain part if the local domain has only one component.
+ * If either name is unqualified (contains no '.'),
+ * assume that the host is local, as it will be
+ * interpreted as such.
+ */
+int
+local_domain(h)
+ char *h;
+{
+ char localhost[MAXHOSTNAMELEN];
+ char *p1, *p2;
+
+ localhost[0] = 0;
+ (void) gethostname(localhost, sizeof(localhost));
+ p1 = topdomain(localhost);
+ p2 = topdomain(h);
+ if (p1 == NULL || p2 == NULL || !strcasecmp(p1, p2))
+ return (1);
+ return (0);
+}
+
+char *
+topdomain(h)
+ char *h;
+{
+ register char *p;
+ char *maybe = NULL;
+ int dots = 0;
+
+ for (p = h + strlen(h); p >= h; p--) {
+ if (*p == '.') {
+ if (++dots == 2)
+ return (p);
+ maybe = p;
+ }
+ }
+ return (maybe);
+}
diff --git a/libexec/rshd/rshd.8 b/libexec/rshd/rshd.8
index 7af12ecccb2f..86041e040d90 100644
--- a/libexec/rshd/rshd.8
+++ b/libexec/rshd/rshd.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rshd.8 8.1 (Berkeley) 6/4/93
-.\" $Id: rshd.8,v 1.14 1998/12/16 07:20:44 peter Exp $
+.\" $Id: rshd.8,v 1.10 1997/12/02 12:29:56 charnier Exp $
.\"
.Dd June 4, 1993
.Dt RSHD 8
@@ -40,7 +40,7 @@
.Nd remote shell server
.Sh SYNOPSIS
.Nm rshd
-.Op Fl alnDL
+.Op Fl alnL
.Sh DESCRIPTION
The
.Nm
@@ -88,9 +88,17 @@ and requests the corresponding host name (see
.Xr hosts 5
and
.Xr named 8 ).
-If the hostname cannot be determined or the hostname and address do
-not match after verification,
+If the hostname cannot be determined,
the dot-notation representation of the host address is used.
+If the hostname is in the same domain as the server (according to
+the last two components of the domain name),
+or if the
+.Fl a
+option is given,
+the addresses for the hostname are requested,
+verifying that the name and address correspond.
+If address verification fails, the connection is aborted
+with the message: ``Host address mismatch.''.
.It
A null terminated user name of at most 16 characters
is retrieved on the initial socket. This user name
@@ -126,7 +134,7 @@ file,
unless the user is the superuser.
.It
If the file
-.Pa /var/run/nologin
+.Pa /etc/nologin
exists and the user is not the superuser,
the connection is closed.
The name of the nologin file may be overridden
@@ -156,12 +164,6 @@ The use of keepalive messages allows sessions to be timed out
if the client crashes or becomes unreachable.
.Pp
The
-.Fl D
-option sets the TCP_NODELAY socket option which improves
-performance of small back-to-back
-writes at the expense of additional network traffic.
-.Pp
-The
.Fl L
option causes all successful accesses to be logged to
.Xr syslogd 8
@@ -231,7 +233,7 @@ and is not preceded by a flag byte.
.It Pa /etc/hosts.equiv
.It Pa /etc/login.conf
.It Pa $HOME/.rhosts
-.It Pa /var/run/nologin
+.It Pa /etc/nologin
.El
.Sh BUGS
The authentication procedure used here assumes the integrity
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index cd2f57c36a1f..da0318935797 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94";
#endif
static const char rcsid[] =
- "$Id: rshd.c,v 1.22 1998/12/01 23:27:24 dg Exp $";
+ "$Id: rshd.c,v 1.20 1997/12/02 12:30:04 charnier Exp $";
#endif /* not lint */
/*
@@ -61,7 +61,6 @@ static const char rcsid[] =
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
-#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -80,9 +79,9 @@ static const char rcsid[] =
#endif
int keepalive = 1;
+int check_all;
int log_success; /* If TRUE, log all successful accesses */
int sent_null;
-int no_delay;
void doit __P((struct sockaddr_in *));
void error __P((const char *, ...));
@@ -96,13 +95,13 @@ void usage __P((void));
#include <krb.h>
#define VERSION_SIZE 9
#define SECURE_MESSAGE "This rsh session is using DES encryption for all transmissions.\r\n"
-#define OPTIONS "alnkvxDL"
+#define OPTIONS "alnkvxL"
char authbuf[sizeof(AUTH_DAT)];
char tickbuf[sizeof(KTEXT_ST)];
int doencrypt, use_kerberos, vacuous;
Key_schedule schedule;
#else
-#define OPTIONS "alnDL"
+#define OPTIONS "alnL"
#endif
int
@@ -121,7 +120,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
switch (ch) {
case 'a':
- /* ignored for compatability */
+ check_all = 1;
break;
case 'l':
__check_rhosts_file = 0;
@@ -144,9 +143,6 @@ main(argc, argv)
break;
#endif
#endif
- case 'D':
- no_delay = 1;
- break;
case 'L':
log_success = 1;
break;
@@ -186,9 +182,6 @@ main(argc, argv)
if (setsockopt(0, SOL_SOCKET, SO_LINGER, (char *)&linger,
sizeof (linger)) < 0)
syslog(LOG_WARNING, "setsockopt (SO_LINGER): %m");
- if (no_delay &&
- setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
- syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m");
doit(&from);
/* NOTREACHED */
return(0);
@@ -213,9 +206,10 @@ doit(fromp)
fd_set ready, readfrom;
int cc, nfd, pv[2], pid, s;
int one = 1;
- char *hostname, *errorstr;
+ char *hostname, *errorstr, *errorhost;
char *cp, sig, buf[BUFSIZ];
char cmdbuf[NCARGS+1], locuser[16], remuser[16];
+ char remotehost[2 * MAXHOSTNAMELEN + 1];
char fromhost[2 * MAXHOSTNAMELEN + 1];
#ifdef LOGIN_CAP
login_cap_t *lc;
@@ -294,7 +288,6 @@ doit(fromp)
(void) alarm(60);
port = 0;
- s = 0; /* not set or used if port == 0 */
for (;;) {
char c;
if ((cc = read(STDIN_FILENO, &c, 1)) != 1) {
@@ -303,7 +296,7 @@ doit(fromp)
shutdown(0, 1+1);
exit(1);
}
- if (c == 0)
+ if (c== 0)
break;
port = port * 10 + c - '0';
}
@@ -348,38 +341,64 @@ doit(fromp)
dup2(f, 2);
#endif
errorstr = NULL;
- strncpy(fromhost, inet_ntoa(fromp->sin_addr),
- sizeof(fromhost) - 1);
- hostname = fromhost;
hp = gethostbyaddr((char *)&fromp->sin_addr, sizeof (struct in_addr),
fromp->sin_family);
if (hp) {
/*
- * OK, it looks like a DNS name is attached.. Lets see if
- * it looks like we can use it. If it doesn't check out,
- * ditch it and use the IP address for logging instead.
- * Note that iruserok() does it's own hostname checking!!
+ * If name returned by gethostbyaddr is in our domain,
+ * attempt to verify that we haven't been fooled by someone
+ * in a remote net; look up the name and check that this
+ * address corresponds to the name.
*/
strncpy(fromhost, hp->h_name, sizeof(fromhost) - 1);
fromhost[sizeof(fromhost) - 1] = 0;
- hp = gethostbyname(fromhost);
- if (hp == NULL) {
- strncpy(fromhost, inet_ntoa(fromp->sin_addr),
- sizeof(fromhost) - 1);
- } else for (; ; hp->h_addr_list++) {
- if (hp->h_addr_list[0] == NULL) {
- /* End of list - ditch it */
+ hostname = fromhost;
+#ifdef KERBEROS
+ if (!use_kerberos)
+#endif
+ if (check_all || local_domain(hp->h_name)) {
+ strncpy(remotehost, hp->h_name, sizeof(remotehost) - 1);
+ remotehost[sizeof(remotehost) - 1] = 0;
+ errorhost = remotehost;
+ hp = gethostbyname(remotehost);
+ if (hp == NULL) {
+ syslog(LOG_INFO,
+ "couldn't look up address for %s",
+ remotehost);
+ errorstr =
+ "Couldn't look up address for your host (%s)\n";
strncpy(fromhost, inet_ntoa(fromp->sin_addr),
sizeof(fromhost) - 1);
- break;
+ fromhost[sizeof(fromhost) - 1] = 0;
+ hostname = fromhost;
+ } else for (; ; hp->h_addr_list++) {
+ if (hp->h_addr_list[0] == NULL) {
+ syslog(LOG_NOTICE,
+ "host addr %s not listed for host %s",
+ inet_ntoa(fromp->sin_addr),
+ hp->h_name);
+ errorstr =
+ "Host address mismatch for %s\n";
+ strncpy(fromhost, inet_ntoa(fromp->sin_addr),
+ sizeof(fromhost) - 1);
+ fromhost[sizeof(fromhost) - 1] = 0;
+ hostname = fromhost;
+ break;
+ }
+ if (!bcmp(hp->h_addr_list[0],
+ (caddr_t)&fromp->sin_addr,
+ sizeof(fromp->sin_addr))) {
+ hostname = remotehost;
+ break;
+ }
}
- if (!bcmp(hp->h_addr_list[0],
- (caddr_t)&fromp->sin_addr,
- sizeof(fromp->sin_addr)))
- break; /* OK! */
}
+ } else {
+ strncpy(fromhost, inet_ntoa(fromp->sin_addr),
+ sizeof(fromhost) - 1);
+ fromhost[sizeof(fromhost) - 1] = 0;
+ errorhost = hostname = fromhost;
}
- fromhost[sizeof(fromhost) - 1] = 0;
#ifdef KERBEROS
if (use_kerberos) {
@@ -488,7 +507,7 @@ doit(fromp)
fail:
if (errorstr == NULL)
errorstr = "Login incorrect.\n";
- error(errorstr, hostname);
+ error(errorstr, errorhost);
exit(1);
}
diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c
index eff59b6a2a20..5e7843ef3868 100644
--- a/libexec/rtld-aout/rtld.c
+++ b/libexec/rtld-aout/rtld.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.56 1998/08/22 15:51:41 mckay Exp $
+ * $Id: rtld.c,v 1.55 1998/06/21 14:22:29 mckay Exp $
*/
#include <sys/param.h>
@@ -241,7 +241,7 @@ static void init_internal_malloc __P((void));
static void init_external_malloc __P((void));
static int call_map __P((struct so_map *, char *));
static char *findhint __P((char *, int, int *));
-static char *rtfindlib __P((char *, int, int, int));
+static char *rtfindlib __P((char *, int, int));
static char *rtfindfile __P((const char *));
void binder_entry __P((void));
long binder __P((jmpslot_t *));
@@ -890,21 +890,8 @@ map_sods(parent)
struct so_map *smp = NULL;
if(sodp->sod_library) {
- /*
- * First try for a match with an adequate minor
- * number.
- */
path = rtfindlib(name, sodp->sod_major,
- sodp->sod_minor, 1);
- /*
- * If none was found, try for just a major version
- * match. A warning is issued by rtfindlib in
- * this case, since the minor version number isn't
- * really high enough.
- */
- if (path == NULL)
- path = rtfindlib(name, sodp->sod_major,
- sodp->sod_minor, 0);
+ sodp->sod_minor);
if(path == NULL && !ld_tracing) {
generror ("Can't find shared library"
" \"lib%s.so.%d.%d\"", name,
@@ -1840,11 +1827,8 @@ hinthash(cp, vmajor)
* returns the full pathname of the matching library. This string is
* always dynamically allocated on the heap.
*
- * MINORP is an in/out parameter. If the incoming value of *MINORP is
- * >= 0, then no library will be considered a match unless its minor
- * version number is at least that large. Otherwise, only the major
- * version number is checked. In any case, the minor number of the
- * matching library is stored into *MINORP.
+ * Returns the minor number of the matching library via the pointer
+ * argument MINORP.
*
* Returns NULL if the library cannot be found.
*/
@@ -1867,23 +1851,20 @@ findhint(name, major, minorp)
warnx("Bad path index: %#x\n", bp->hi_pathx);
break;
}
+
/*
- * For a given major number, the hints file has only one
- * entry -- namely, the one with the highest minor number.
- * If we find an entry with a matching major number, we
- * know it is the best one.
+ * We accept the current hints entry if its name matches
+ * and its major number matches. We don't have to search
+ * for the best minor number, because that was already
+ * done by "ldconfig" when it built the hints file.
*/
if (strcmp(name, hstrtab + bp->hi_namex) == 0 &&
bp->hi_major == major) {
struct stat s;
- int realminor;
- realminor = bp->hi_ndewey >= 2 ? bp->hi_minor : 0;
- if (realminor < *minorp) /* Not good enough */
- return NULL;
if (stat(hstrtab + bp->hi_pathx, &s) == -1)
return NULL; /* Doesn't actually exist */
- *minorp = realminor;
+ *minorp = bp->hi_ndewey >= 2 ? bp->hi_minor : -1;
return strdup(hstrtab + bp->hi_pathx);
}
@@ -1906,16 +1887,14 @@ findhint(name, major, minorp)
* Returns NULL if the library cannot be found.
*/
static char *
-rtfindlib(name, major, minor, strictminor)
+rtfindlib(name, major, minor)
char *name;
int major, minor;
- int strictminor;
{
char *ld_path = ld_library_path;
char *path = NULL;
- int realminor;
+ int realminor = -1;
- realminor = strictminor ? minor : -1;
if (ld_path != NULL) { /* First, search the directories in ld_path */
/*
* There is no point in trying to use the hints file for this.
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 9b4a9cf9b67a..1698ed02860c 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.12 1998/10/13 03:31:59 jdp Exp $
+ * $Id: rtld.c,v 1.11 1998/09/22 02:09:56 jdp Exp $
*/
/*
@@ -1182,7 +1182,7 @@ dlopen(const char *name, int mode)
if (name == NULL)
obj = obj_main;
else {
- char *path = find_library(name, obj_main);
+ char *path = find_library(name, NULL);
if (path != NULL)
obj = load_object(path);
}
diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c
index bb61f7e50402..dcb262483d5c 100644
--- a/libexec/talkd/talkd.c
+++ b/libexec/talkd/talkd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)talkd.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: talkd.c,v 1.8 1997/12/02 12:33:42 charnier Exp $";
+ "$Id$";
#endif /* not lint */
/*
@@ -89,13 +89,8 @@ main(argc, argv)
register CTL_MSG *mp = &request;
int cc;
-#ifdef NOTDEF
- /*
- * removed so ntalkd can run in tty sandbox
- */
if (getuid())
errx(1, "getuid: not super-user");
-#endif
openlog("talkd", LOG_PID, LOG_DAEMON);
if (gethostname(hostname, sizeof (hostname) - 1) < 0) {
syslog(LOG_ERR, "gethostname: %m");
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index 37564e343518..7018fdc12dae 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.2 (Berkeley) 12/15/93";
#endif
static const char rcsid[] =
- "$Id: telnetd.c,v 1.14 1998/04/26 06:51:36 phk Exp $";
+ "$Id: telnetd.c,v 1.13 1997/12/03 07:16:05 charnier Exp $";
#endif /* not lint */
#include "telnetd.h"
@@ -1091,13 +1091,13 @@ telnet(f, p, host)
#endif
if (getent(defent, "default") == 1) {
- char *Getstr();
+ char *getstr();
char *cp=defstrs;
- HE = Getstr("he", &cp);
- HN = Getstr("hn", &cp);
- IM = Getstr("im", &cp);
- IF = Getstr("if", &cp);
+ HE = getstr("he", &cp);
+ HN = getstr("hn", &cp);
+ IM = getstr("im", &cp);
+ IF = getstr("if", &cp);
if (HN && *HN)
(void) strcpy(host_name, HN);
if (IF && (if_fd = open(IF, O_RDONLY, 000)) != -1)
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index d0499c9b19ce..63496a738f82 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: tftpd.c,v 1.11 1998/04/12 11:15:54 phk Exp $";
+ "$Id: tftpd.c,v 1.10 1997/12/03 07:19:58 charnier Exp $";
#endif /* not lint */
/*
@@ -266,7 +266,7 @@ main(argc, argv)
struct formats;
int validate_access __P((char **, int));
-void xmitfile __P((struct formats *));
+void sendfile __P((struct formats *));
void recvfile __P((struct formats *));
struct formats {
@@ -276,8 +276,8 @@ struct formats {
void (*f_recv) __P((struct formats *));
int f_convert;
} formats[] = {
- { "netascii", validate_access, xmitfile, recvfile, 1 },
- { "octet", validate_access, xmitfile, recvfile, 0 },
+ { "netascii", validate_access, sendfile, recvfile, 1 },
+ { "octet", validate_access, sendfile, recvfile, 0 },
#ifdef notdef
{ "mail", validate_user, sendmail, recvmail, 1 },
#endif
@@ -465,7 +465,7 @@ timer()
* Send the requested file.
*/
void
-xmitfile(pf)
+sendfile(pf)
struct formats *pf;
{
struct tftphdr *dp, *r_init();
diff --git a/lkm/Makefile b/lkm/Makefile
new file mode 100644
index 000000000000..992f872e361b
--- /dev/null
+++ b/lkm/Makefile
@@ -0,0 +1,13 @@
+# $Id: Makefile,v 1.32 1998/09/25 17:51:44 rvb Exp $
+
+# XXX present but broken: ip_mroute_mod mfs
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR= atapi coda ccd cd9660 coff fdesc ibcs2 if_disc if_ppp if_sl if_tun \
+ ipfw joy kernfs linux msdos nfs nullfs \
+ pcic portal procfs syscons umapfs vesa vinum wcd
+.endif
+
+# XXX builds, but not useable with present design
+# fpu gnufpu union
+
+.include <bsd.subdir.mk>
diff --git a/lkm/atapi/Makefile b/lkm/atapi/Makefile
new file mode 100644
index 000000000000..fce2cd1ff6f9
--- /dev/null
+++ b/lkm/atapi/Makefile
@@ -0,0 +1,30 @@
+# $Id: Makefile,v 1.10 1998/02/01 17:53:53 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/isa
+KMOD = atapi_mod
+SRCS = atapi.c wdc.h opt_atapi.h #wcd.h
+NOMAN =
+CFLAGS += -DATAPI_MODULE
+CLEANFILES += wdc.h wcd.h opt_atapi.h
+EXPORT_SYMS = _atapi_mod _atapi_debug_ptr _atapi_intr_ptr \
+ _atapi_request_callback_ptr _atapi_request_immediate_ptr \
+ _atapi_request_wait_ptr _atapi_start_ptr
+
+load: ${PROG}
+ ${MODLOAD} -u -e atapi_mod $(PROG)
+
+unload: ${PROG}
+ ${MODUNLOAD} -n atapi
+
+wdc.h:
+ echo "#define NWDC 2" > wdc.h
+
+# echo "#define NWD 4" >> wdc.h
+
+wcd.h:
+ echo "#define NWCD 1" > wcd.h
+
+opt_atapi.h:
+ echo "#define ATAPI 1"> opt_atapi.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/ccd/Makefile b/lkm/ccd/Makefile
new file mode 100644
index 000000000000..b5b989beeebc
--- /dev/null
+++ b/lkm/ccd/Makefile
@@ -0,0 +1,15 @@
+# $Id: Makefile,v 1.5 1997/02/22 12:47:41 peter Exp $
+
+.PATH: ${.CURDIR}/../../sys/dev/ccd
+KMOD= ccd_mod
+SRCS= ccd.c ccd.h vnode_if.h
+NOMAN=
+PSEUDO_LKM=
+
+NCCD?= 4
+CLEANFILES+= ccd.h vnode_if.h vnode_if.c
+
+ccd.h:
+ echo "#define NCCD ${NCCD}" > ccd.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/cd9660/Makefile b/lkm/cd9660/Makefile
new file mode 100644
index 000000000000..bcf4cbc2e028
--- /dev/null
+++ b/lkm/cd9660/Makefile
@@ -0,0 +1,11 @@
+# $Id: Makefile,v 1.4 1998/02/04 21:56:34 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/isofs/cd9660
+KMOD= cd9660_mod
+SRCS= cd9660_bmap.c cd9660_lookup.c cd9660_node.c cd9660_rrip.c \
+ cd9660_util.c cd9660_vfsops.c cd9660_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DCD9660
+
+.include <bsd.kmod.mk>
diff --git a/lkm/coda/Makefile b/lkm/coda/Makefile
new file mode 100644
index 000000000000..c014608cdfe1
--- /dev/null
+++ b/lkm/coda/Makefile
@@ -0,0 +1,10 @@
+# $Id: Makefile,v 1.1.1.1 1998/09/25 17:47:48 rvb Exp $
+
+.PATH: ${.CURDIR}/../../sys/coda
+KMOD= coda_mod
+SRCS= coda_fbsd.c coda_namecache.c coda_psdev.c coda_subr.c \
+ coda_venus.c coda_vfsops.c coda_vnops.c
+NOMAN=
+VFS_LKM=
+
+.include <bsd.kmod.mk>
diff --git a/lkm/coff/Makefile b/lkm/coff/Makefile
new file mode 100644
index 000000000000..e9f291067f1a
--- /dev/null
+++ b/lkm/coff/Makefile
@@ -0,0 +1,11 @@
+# $Id: Makefile,v 1.5 1998/02/01 18:12:12 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/ibcs2
+KMOD= ibcs2_coff_mod
+SRCS= coff.c imgact_coff.c vnode_if.h
+NOMAN=
+CLEANFILES+= vnode_if.h vnode_if.c
+CFLAGS+= -DLKM -DCOMPAT_IBCS2
+DEPLKMS=${.OBJDIR}/../ibcs2/ibcs2_mod.o
+
+.include <bsd.kmod.mk>
diff --git a/lkm/coff/coff.c b/lkm/coff/coff.c
new file mode 100644
index 000000000000..cc12cdfc6593
--- /dev/null
+++ b/lkm/coff/coff.c
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 1994 Søren Schmidt
+ * 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
+ * in this position and unchanged.
+ * 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 withough 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.
+ *
+ * $Id: coff.c,v 1.9 1997/04/06 10:47:39 dufault Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/conf.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/errno.h>
+
+extern const struct execsw coff_execsw;
+
+MOD_EXEC(ibcs2_coff, -1, &coff_execsw);
+
+static int
+ibcs2_coff_load(struct lkm_table *lkmtp, int cmd)
+{
+ /* uprintf("coff loader installed\n"); XXX shut up, you! */
+ return 0;
+}
+
+static int
+ibcs2_coff_unload(struct lkm_table *lkmtp, int cmd)
+{
+ uprintf("coff loader removed\n");
+ return 0;
+}
+
+int
+ibcs2_coff_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(ibcs2_coff, lkmtp, cmd, ver,
+ ibcs2_coff_load, ibcs2_coff_unload, lkm_nullcmd);
+}
diff --git a/lkm/fdesc/Makefile b/lkm/fdesc/Makefile
new file mode 100644
index 000000000000..908206892237
--- /dev/null
+++ b/lkm/fdesc/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/miscfs/fdesc
+KMOD= fdesc_mod
+SRCS= fdesc_vfsops.c fdesc_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DFDESC
+
+.include <bsd.kmod.mk>
diff --git a/lkm/fpu/Makefile b/lkm/fpu/Makefile
new file mode 100644
index 000000000000..5a16be56fb25
--- /dev/null
+++ b/lkm/fpu/Makefile
@@ -0,0 +1,10 @@
+# $Id: Makefile,v 1.3 1997/02/22 12:47:51 peter Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/i386
+KMOD= fpu_mod
+SRCS= math_emulate.c
+NOMAN=
+PSEUDO_LKM=
+CFLAGS+= -DLKM
+
+.include <bsd.kmod.mk>
diff --git a/lkm/gnufpu/Makefile b/lkm/gnufpu/Makefile
new file mode 100644
index 000000000000..85610c2e9027
--- /dev/null
+++ b/lkm/gnufpu/Makefile
@@ -0,0 +1,18 @@
+# $Id: Makefile,v 1.4 1997/07/20 08:46:30 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/gnu/i386/fpemul
+KMOD= gnufpu_mod
+SRCS= div_small.s errors.c fpu_arith.c fpu_aux.c fpu_entry.c fpu_etc.c \
+ fpu_trig.c get_address.c load_store.c poly_2xm1.c poly_atan.c \
+ poly_div.s poly_l2.c poly_mul64.s poly_sin.c poly_tan.c \
+ polynomial.s reg_add_sub.c reg_compare.c reg_constant.c reg_div.s \
+ reg_ld_str.c reg_u_mul.s reg_u_sub.s wm_shrx.s wm_sqrt.s
+NOMAN=
+PSEUDO_LKM=
+CFLAGS+= -DLKM
+
+.s.o:
+ ${CC} -x assembler-with-cpp -DLOCORE ${CFLAGS} -c \
+ ${.IMPSRC} -o ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/lkm/ibcs2/Makefile b/lkm/ibcs2/Makefile
new file mode 100644
index 000000000000..9136c6316106
--- /dev/null
+++ b/lkm/ibcs2/Makefile
@@ -0,0 +1,24 @@
+# $Id: Makefile,v 1.16 1998/02/04 21:56:35 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/ibcs2
+KMOD= ibcs2_mod
+SRCS= ibcs2.c ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
+ ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \
+ ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \
+ ibcs2_isc.c ibcs2_isc_sysent.c \
+ ibcs2_msg.c ibcs2_other.c ibcs2_sysi86.c ibcs2_sysvec.c \
+ vnode_if.h opt_spx_hack.h
+MAN8= ibcs2.8
+
+CFLAGS+= -DLKM -DCOMPAT_IBCS2
+CLEANFILES+= vnode_if.h vnode_if.c opt_spx_hack.h
+EXPORT_SYMS= _ibcs2_mod _ibcs2_emul_path _ibcs2_svr3_sysvec
+
+opt_spx_hack.h:
+ touch opt_spx_hack.h
+
+afterinstall:
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/ibcs2 ${DESTDIR}/usr/bin
+
+.include <bsd.kmod.mk>
diff --git a/lkm/ibcs2/ibcs2 b/lkm/ibcs2/ibcs2
new file mode 100755
index 000000000000..a649885512ea
--- /dev/null
+++ b/lkm/ibcs2/ibcs2
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Copyright (C) 1994-1997
+# FreeBSD 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 FreeBSD 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 FreeBSD Inc. 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.
+#
+# $Id$
+
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH
+
+if [ $# -le 1 ]; then
+ LOADERS="coff" # elf
+fi
+
+set -e
+
+kernelfile=`sysctl -n kern.bootfile`
+kernelfile=`basename $kernelfile`
+newkernelfile="/tmp/_${kernelfile}+ibcs2$$"
+
+trap 'rm -f $newkernelfile; exit 1' 1 2 3 13 15
+
+rm -f $newkernelfile
+modload -e ibcs2_mod -o $newkernelfile -q /lkm/ibcs2_mod.o
+
+for loader in $LOADERS; do
+ modload -e ibcs2_${loader}_mod -o/tmp/ibcs2_${loader} -q -u \
+ -A${newkernelfile} /lkm/ibcs2_${loader}_mod.o
+done
+rm -f ${newkernelfile}
+set +e
diff --git a/lkm/ibcs2/ibcs2.8 b/lkm/ibcs2/ibcs2.8
new file mode 100644
index 000000000000..38b586e2b88d
--- /dev/null
+++ b/lkm/ibcs2/ibcs2.8
@@ -0,0 +1,63 @@
+.\"
+.\" Copyright (c) 1995 Lyndon Nerenberg
+.\"
+.\" All rights reserved.
+.\"
+.\" This program is free software.
+.\"
+.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
+.\"
+.\" $Id: ibcs2.8,v 1.5 1998/05/19 03:31:34 jkoshy Exp $
+.\"
+.Dd November 27, 1995
+.Dt IBCS2 8
+.Os FreeBSD-Experimental
+.Sh NAME
+.Nm ibcs2
+.Nd load iBCS2 runtime support for SCO and ISC binaries
+.Sh SYNOPSIS
+.Nm ibcs2
+.Sh DESCRIPTION
+The
+.Nm
+utility loads kernel runtime support for iBCS2 compliant programs.
+This runtime support is limited to emulation of the iBCS2
+system call interface, and is far from complete. COFF binaries
+and shared libraries are supported, however no shared libraries
+are provided with the FreeBSD distribution.
+.Sh FILES
+.Bl -tag -width /usr/share/examples/ibcs2/* -compact
+.It Pa /lkm/ibcs2_mod.o
+.It Pa /lkm/ibcs2_coff_mod.o
+iBCS2 loadable kernel modules.
+.Pp
+.It Pa /usr/share/examples/ibcs2/*
+Sample object files with which to test the emulator.
+.Sh "SEE ALSO"
+.Xr lkm 4 ,
+.Xr modload 8
+.Sh BUGS
+The emulation is very incomplete.
+.Pp
+Running dynamically linked binaries requires access to an existing
+SCO system from which you can grab the shared libraries.
+.Pp
+You can't really use this without reading the source code.
diff --git a/lkm/ibcs2/ibcs2.c b/lkm/ibcs2/ibcs2.c
new file mode 100644
index 000000000000..edc712e2d3d0
--- /dev/null
+++ b/lkm/ibcs2/ibcs2.c
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 1994 Søren Schmidt
+ * 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
+ * in this position and unchanged.
+ * 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 withough 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.
+ *
+ * $Id: ibcs2.c,v 1.10 1997/04/06 10:47:52 dufault Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+MOD_MISC(ibcs2);
+
+static int
+ibcs2_load(struct lkm_table *lkmtp, int cmd)
+{
+ /* uprintf("ibcs2 emulator installed\n"); XXX - shut up, you! */
+ return 0;
+}
+
+static int
+ibcs2_unload(struct lkm_table *lkmtp, int cmd)
+{
+ uprintf("ibcs2 emulator removed\n");
+ return 0;
+}
+
+int
+ibcs2_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(ibcs2, lkmtp, cmd, ver,
+ ibcs2_load, ibcs2_unload, lkm_nullcmd);
+}
diff --git a/lkm/if_disc/Makefile b/lkm/if_disc/Makefile
new file mode 100644
index 000000000000..747f94285d6b
--- /dev/null
+++ b/lkm/if_disc/Makefile
@@ -0,0 +1,20 @@
+# $Id: Makefile,v 1.4 1998/01/08 23:50:13 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/net
+KMOD= if_disc_mod
+SRCS= if_disc.c bpfilter.h opt_inet.h
+NOMAN=
+PSEUDO_LKM=
+
+NBPFILTER?= 0
+
+CFLAGS+= ${PROTOS}
+CLEANFILES+= bpfilter.h opt_inet.h
+
+bpfilter.h:
+ echo "#define NBPFILTER ${NBPFILTER}" > bpfilter.h
+
+opt_inet.h:
+ echo "#define INET 1" > opt_inet.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/if_ppp/Makefile b/lkm/if_ppp/Makefile
new file mode 100644
index 000000000000..e2721a0341d6
--- /dev/null
+++ b/lkm/if_ppp/Makefile
@@ -0,0 +1,58 @@
+# $Id: Makefile,v 1.13 1998/02/01 18:12:13 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/net
+KMOD= if_ppp_mod
+SRCS= if_ppp.c ppp_tty.c slcompress.c \
+ bpfilter.h ppp.h opt_inet.h opt_ipx.h opt_ppp.h
+NOMAN=
+PSEUDO_LKM=
+
+NPPP?= 2
+PPP_BSDCOMP?= 1 # 0/1
+PPP_DEFLATE?= 1 # 0/1
+PPP_FILTER?= 0 # 0/1 - requires bpf to be configured in kernel
+PPP_INET?= 1 # 0/1 - requires INET to be configured in kernel
+PPP_IPX?= 0 # 0/1 - requires IPX to be configured in kernel
+
+CFLAGS+= ${PROTOS}
+
+.if ${PPP_BSDCOMP} > 0
+SRCS+= bsd_comp.c
+.endif
+.if ${PPP_DEFLATE} > 0
+SRCS+= ppp_deflate.c zlib.c
+.endif
+
+CLEANFILES+= bpfilter.h opt_inet.h opt_ipx.h opt_ppp.h ppp.h
+
+bpfilter.h:
+ echo "#define NBPFILTER ${PPP_FILTER}" > bpfilter.h
+
+ppp.h:
+ echo "#define NPPP ${NPPP}" > ppp.h
+
+opt_inet.h:
+ touch opt_inet.h
+.if ${PPP_INET} > 0
+ echo "#define INET 1" > opt_inet.h
+.endif
+
+opt_ipx.h:
+ touch opt_ipx.h
+.if ${PPP_IPX} > 0
+ echo "#define IPX ${PPP_IPX}" > opt_ipx.h
+.endif
+
+opt_ppp.h:
+ touch opt_ppp.h
+.if ${PPP_BSDCOMP} > 0
+ echo "#define PPP_BSDCOMP ${PPP_BSDCOMP}" > opt_ppp.h
+.endif
+.if ${PPP_DEFLATE} > 0
+ echo "#define PPP_DEFLATE ${PPP_DEFLATE}" >> opt_ppp.h
+.endif
+.if ${PPP_FILTER} > 0
+ echo "#define PPP_FILTER ${PPP_FILTER}" >> opt_ppp.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/lkm/if_sl/Makefile b/lkm/if_sl/Makefile
new file mode 100644
index 000000000000..582595124aeb
--- /dev/null
+++ b/lkm/if_sl/Makefile
@@ -0,0 +1,25 @@
+# $Id: Makefile,v 1.5 1998/01/08 23:50:23 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/net
+KMOD= if_sl_mod
+SRCS= if_sl.c slcompress.c bpfilter.h opt_inet.h sl.h
+NOMAN=
+PSEUDO_LKM=
+
+NBPFILTER?= 0
+NSL?= 2
+PROTOS?= -DINET
+
+CFLAGS+= ${PROTOS}
+CLEANFILES+= bpfilter.h opt_inet.h sl.h
+
+bpfilter.h:
+ echo "#define NBPFILTER ${NBPFILTER}" > bpfilter.h
+
+opt_inet.h:
+ echo "#define INET 1" > opt_inet.h
+
+sl.h:
+ echo "#define NSL ${NSL}" > sl.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/if_tun/Makefile b/lkm/if_tun/Makefile
new file mode 100644
index 000000000000..33e9c2e1a5d3
--- /dev/null
+++ b/lkm/if_tun/Makefile
@@ -0,0 +1,27 @@
+# $Id: Makefile,v 1.5 1998/01/24 02:21:49 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/net
+KMOD= if_tun_mod
+SRCS= if_tun.c bpfilter.h opt_devfs.h opt_inet.h tun.h
+NOMAN=
+PSEUDO_LKM=
+
+NBPFILTER?= 0
+NTUN?= 2
+
+CFLAGS+= ${PROTOS}
+CLEANFILES+= bpfilter.h opt_devfs.h opt_inet.h tun.h
+
+bpfilter.h:
+ echo "#define NBPFILTER ${NBPFILTER}" > bpfilter.h
+
+opt_devfs.h:
+ touch opt_devfs.h
+
+opt_inet.h:
+ echo "#define INET 1" > opt_inet.h
+
+tun.h:
+ echo "#define NTUN ${NTUN}" > tun.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/ip_mroute_mod/Makefile b/lkm/ip_mroute_mod/Makefile
new file mode 100644
index 000000000000..7e78283c74bb
--- /dev/null
+++ b/lkm/ip_mroute_mod/Makefile
@@ -0,0 +1,9 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/netinet
+KMOD= ip_mroute_mod
+SRCS= ip_mroute.c
+NOMAN=
+CFLAGS+= -DMROUTE_LKM -DMROUTING
+
+.include <bsd.kmod.mk>
diff --git a/lkm/ipfw/Makefile b/lkm/ipfw/Makefile
new file mode 100644
index 000000000000..2afebe8d0402
--- /dev/null
+++ b/lkm/ipfw/Makefile
@@ -0,0 +1,17 @@
+# $Id: Makefile,v 1.7 1997/02/22 12:48:14 peter Exp $
+
+.PATH: ${.CURDIR}/../../sys/netinet
+KMOD= ipfw_mod
+SRCS= ip_fw.c
+NOMAN=
+CFLAGS+= -DIPFIREWALL -DIPFIREWALL_MODULE
+#
+#If you want it verbose
+#CFLAGS+= -DIPFIREWALL_VERBOSE
+#CFLAGS+= -DIPFIREWALL_VERBOSE_LIMIT=100
+#
+#If you want it to pass all packets by default
+#CFLAGS+= -DIPFIREWALL_DEFAULT_TO_ACCEPT
+#
+
+.include <bsd.kmod.mk>
diff --git a/lkm/joy/Makefile b/lkm/joy/Makefile
new file mode 100644
index 000000000000..e3b880fdad69
--- /dev/null
+++ b/lkm/joy/Makefile
@@ -0,0 +1,22 @@
+# $Id: Makefile,v 1.6 1998/01/24 02:21:51 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/isa
+KMOD = joy_mod
+SRCS = joy.c joy.h opt_devfs.h
+MAN8 = joy.8
+
+CFLAGS += -DJOY_MODULE
+CLEANFILES += joy.h opt_devfs.h
+
+joy.h:
+ echo "#define NJOY 1" > joy.h
+
+opt_devfs.h:
+ touch opt_devfs.h
+
+
+afterinstall:
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/joy ${DESTDIR}/usr/bin
+
+.include <bsd.kmod.mk>
diff --git a/lkm/joy/joy b/lkm/joy/joy
new file mode 100644
index 000000000000..3f5bbb96ab09
--- /dev/null
+++ b/lkm/joy/joy
@@ -0,0 +1,4 @@
+#!/bin/sh
+# $Id$
+
+modload -q -u -A `sysctl -n kern.bootfile` /lkm/joy_mod.o
diff --git a/lkm/joy/joy.8 b/lkm/joy/joy.8
new file mode 100644
index 000000000000..aa6255b6f6ba
--- /dev/null
+++ b/lkm/joy/joy.8
@@ -0,0 +1,46 @@
+.\"
+.\" Copyright (c) 1996 Jean-Marc Zucconi <jmz@cabri.obs-besancon.fr>
+.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
+.\"
+.\" $Id$
+.\"
+.Dd March 16, 1996
+.Dt JOY 8
+.Os FreeBSD
+.Sh NAME
+.Nm joy
+.Nd load the joystick driver kernel module
+.Sh SYNOPSIS
+.Nm joy
+.Sh DESCRIPTION
+The
+.Nm
+utility loads the joystick driver kernel module.
+.Sh FILES
+.Bl -tag -width /lkm/joy_mod.o
+.It Pa /lkm/joy_mod.o
+joystick loadable kernel module.
+.Sh "SEE ALSO"
+.Xr joy 4 ,
+.Xr lkm 4 ,
+.Xr modload 8
diff --git a/lkm/kernfs/Makefile b/lkm/kernfs/Makefile
new file mode 100644
index 000000000000..8139d94ce754
--- /dev/null
+++ b/lkm/kernfs/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/miscfs/kernfs
+KMOD= kernfs_mod
+SRCS= kernfs_vfsops.c kernfs_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DKERNFS
+
+.include <bsd.kmod.mk>
diff --git a/lkm/linux/Makefile b/lkm/linux/Makefile
new file mode 100644
index 000000000000..d4a14f4756c3
--- /dev/null
+++ b/lkm/linux/Makefile
@@ -0,0 +1,42 @@
+# $Id: Makefile,v 1.17 1998/07/01 17:10:00 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/linux
+KMOD= linux_mod
+SRCS= linux.c linux_file.c linux_ioctl.c linux_misc.c linux_signal.c \
+ linux_ipc.c linux_socket.c linux_stats.c \
+ linux_dummy.c linux_sysent.c linux_sysvec.c linux_util.c \
+ imgact_linux.c opt_compat.h opt_linux.h opt_vmpage.h vnode_if.h
+OBJS= linux_locore.o
+MAN8= linux.8
+
+CFLAGS+= -DLKM -DCOMPAT_LINUX #-DDEBUG
+EXPORT_SYMS=_linux_mod
+CLEANFILES+= vnode_if.h vnode_if.c linux_genassym.o linux_genassym \
+ linux_assym.h opt_compat.h opt_linux.h opt_vmpage.h
+
+build-tools: linux_genassym
+
+linux_assym.h: linux_genassym
+ ./linux_genassym > linux_assym.h
+
+linux_locore.o: linux_locore.s linux_assym.h
+ ${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux_genassym.o: linux_genassym.c linux.h @ machine
+ ${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC}
+
+linux_genassym: linux_genassym.o
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
+
+opt_compat.h:
+ echo "#define COMPAT_43 1" > opt_compat.h
+
+opt_linux.h opt_vmpage.h:
+ touch ${.TARGET}
+
+afterinstall:
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/linux ${DESTDIR}/usr/bin
+
+.include <bsd.kmod.mk>
diff --git a/lkm/linux/linux b/lkm/linux/linux
new file mode 100644
index 000000000000..9945a9908c5c
--- /dev/null
+++ b/lkm/linux/linux
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# $Id: linux,v 1.4 1997/02/22 12:48:25 peter Exp $
+
+if modstat -n linux_mod > /dev/null ; then
+ echo Linux lkm already loaded
+ exit 1
+else
+ modload -e linux_mod -u -q -o /tmp/linux_mod /lkm/linux_mod.o
+fi
diff --git a/lkm/linux/linux.8 b/lkm/linux/linux.8
new file mode 100644
index 000000000000..6cde622c0a89
--- /dev/null
+++ b/lkm/linux/linux.8
@@ -0,0 +1,45 @@
+.\"
+.\" Copyright (c) 1997
+.\" The FreeBSD 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:
+.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
+.\"
+.\" $Id$
+.\"
+.Dd January 9, 1997
+.Dt LINUX 8
+.Os FreeBSD
+.Sh NAME
+.Nm linux
+.Nd load the Linux emulator kernel module
+.Sh SYNOPSIS
+.Nm linux
+.Sh DESCRIPTION
+The
+.Nm
+utility loads the Linux emulator kernel module.
+.Sh FILES
+.Bl -tag -width /lkm/linux_mod.o
+.It Pa /lkm/linux_mod.o
+Linux emulator loadable kernel module.
+.Sh SEE ALSO
+.Xr lkm 4 ,
+.Xr modload 8
diff --git a/lkm/linux/linux.c b/lkm/linux/linux.c
new file mode 100644
index 000000000000..b3da352d26d3
--- /dev/null
+++ b/lkm/linux/linux.c
@@ -0,0 +1,87 @@
+/*-
+ * Copyright (c) 1994 Søren Schmidt
+ * 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
+ * in this position and unchanged.
+ * 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 withough 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.
+ *
+ * $Id: linux.c,v 1.13 1998/09/17 22:08:34 msmith Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/conf.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/imgact_elf.h>
+#include "i386/linux/linux.h"
+
+extern const struct execsw linux_execsw;
+
+MOD_EXEC(linux, -1, &linux_execsw);
+
+extern Elf32_Brandinfo *linux_brandlist[];
+
+static int
+linux_load(struct lkm_table *lkmtp, int cmd)
+{
+ Elf32_Brandinfo **brandinfo;
+ int error;
+
+ error = 0;
+
+ for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo)
+ if (elf_insert_brand_entry(*brandinfo) < 0)
+ error = 1;
+
+ if (error)
+ printf("Could not install ELF interpreter entry\n");
+ /* uprintf("Linux emulator installed\n"); XXX - shut up, you! */
+ return 0;
+}
+
+static int
+linux_unload(struct lkm_table *lkmtp, int cmd)
+{
+ Elf32_Brandinfo **brandinfo;
+ int error;
+
+ error = 0;
+
+ for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo)
+ if (elf_remove_brand_entry(*brandinfo) < 0)
+ error = 1;
+
+ if (error)
+ uprintf("Could not deinstall ELF interpreter entry\n");
+ uprintf("Linux emulator removed\n");
+ return 0;
+}
+
+int
+linux_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(linux,lkmtp, cmd, ver,
+ linux_load, linux_unload, lkm_nullcmd);
+}
diff --git a/lkm/mfs/Makefile b/lkm/mfs/Makefile
new file mode 100644
index 000000000000..ee0afa8efe58
--- /dev/null
+++ b/lkm/mfs/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/ufs/mfs
+KMOD= mfs_mod
+SRCS= mfs_vfsops.c mfs_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DFFS -DMFS
+
+.include <bsd.kmod.mk>
diff --git a/lkm/msdos/Makefile b/lkm/msdos/Makefile
new file mode 100644
index 000000000000..40aa777abdad
--- /dev/null
+++ b/lkm/msdos/Makefile
@@ -0,0 +1,11 @@
+# $Id: Makefile,v 1.5 1998/02/04 21:56:36 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/msdosfs
+KMOD= msdos_mod
+SRCS= msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c \
+ msdosfs_vfsops.c msdosfs_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DMSDOSFS
+
+.include <bsd.kmod.mk>
diff --git a/lkm/nfs/Makefile b/lkm/nfs/Makefile
new file mode 100644
index 000000000000..71b19a99db53
--- /dev/null
+++ b/lkm/nfs/Makefile
@@ -0,0 +1,23 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/nfs
+KMOD= nfs_mod
+SRCS= nfs_bio.c nfs_node.c nfs_nqlease.c nfs_serv.c nfs_socket.c \
+ nfs_srvcache.c nfs_subs.c nfs_syscalls.c nfs_vfsops.c \
+ nfs_vnops.c opt_inet.h opt_nfs.h opt_vmpage.h
+NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DNFS
+CLEANFILES= opt_inet.h opt_nfs.h opt_vmpage.h
+
+opt_inet.h:
+ touch ${.TARGET}
+.if ${NFS_INET} > 0
+ echo "#define INET 1" > ${.TARGET}
+.endif
+
+opt_nfs.h opt_vmpage.h:
+ touch ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/lkm/nullfs/Makefile b/lkm/nullfs/Makefile
new file mode 100644
index 000000000000..e4e684a30c72
--- /dev/null
+++ b/lkm/nullfs/Makefile
@@ -0,0 +1,14 @@
+# $Id: Makefile,v 1.5 1998/02/04 21:56:37 eivind Exp $
+
+.PATH: ${.CURDIR}/../../sys/miscfs/nullfs
+KMOD= null_mod
+SRCS= null_subr.c null_vfsops.c null_vnops.c opt_debug_nullfs.h
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DNULLFS
+CLEANFILES= opt_debug_nullfs.h
+
+opt_debug_nullfs.h:
+ touch ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/lkm/pcic/Makefile b/lkm/pcic/Makefile
new file mode 100644
index 000000000000..60f7f9031113
--- /dev/null
+++ b/lkm/pcic/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/pccard
+KMOD= pcic_mod
+SRCS= pcic.c
+NOMAN=
+PSEUDO_LKM=
+CFLAGS+= -DLKM
+
+.include <bsd.kmod.mk>
diff --git a/lkm/portal/Makefile b/lkm/portal/Makefile
new file mode 100644
index 000000000000..4d503f7e50d5
--- /dev/null
+++ b/lkm/portal/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/miscfs/portal
+KMOD= portal_mod
+SRCS= portal_vfsops.c portal_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DPORTAL
+
+.include <bsd.kmod.mk>
diff --git a/lkm/procfs/Makefile b/lkm/procfs/Makefile
new file mode 100644
index 000000000000..59089e526e37
--- /dev/null
+++ b/lkm/procfs/Makefile
@@ -0,0 +1,15 @@
+# $Id: Makefile,v 1.11 1998/07/25 15:52:43 alex Exp $
+
+.PATH: ${.CURDIR}/../../sys/miscfs/procfs
+KMOD= procfs_mod
+SRCS= opt_vmpage.h procfs_ctl.c procfs_map.c procfs_note.c procfs_status.c \
+ procfs_subr.c procfs_type.c procfs_vfsops.c procfs_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DPROCFS
+CLEANFILES+= opt_vmpage.h
+
+opt_vmpage.h:
+ touch ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/Makefile b/lkm/syscons/Makefile
new file mode 100644
index 000000000000..195fd0381e66
--- /dev/null
+++ b/lkm/syscons/Makefile
@@ -0,0 +1,5 @@
+# $Id: Makefile,v 1.3 1997/02/22 12:48:58 peter Exp $
+
+SUBDIR= blank daemon fade green snake star
+
+.include <bsd.subdir.mk>
diff --git a/lkm/syscons/blank/Makefile b/lkm/syscons/blank/Makefile
new file mode 100644
index 000000000000..7289b03427b6
--- /dev/null
+++ b/lkm/syscons/blank/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.6 1997/07/15 14:49:08 yokota Exp $
+
+KMOD= blank_saver_mod
+SRCS= blank_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/blank/blank_saver.c b/lkm/syscons/blank/blank_saver.c
new file mode 100644
index 000000000000..1bb73233e790
--- /dev/null
+++ b/lkm/syscons/blank/blank_saver.c
@@ -0,0 +1,121 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: blank_saver.c,v 1.12 1998/09/15 18:16:38 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+#include <i386/isa/isa.h>
+
+#include <saver.h>
+
+MOD_MISC(blank_saver);
+
+static void
+blank_saver(int blank)
+{
+ u_char val;
+ if (blank) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x25);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x21);
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x2d);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x29);
+ break;
+ default:
+ break;
+ }
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
+ }
+}
+
+static int
+blank_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ switch (crtc_type) {
+ case KD_MONO:
+ case KD_HERCULES:
+ case KD_CGA:
+ case KD_VGA:
+ break;
+ case KD_EGA:
+ /* EGA is yet to be supported */
+ default:
+ return ENODEV;
+ }
+ return add_scrn_saver(blank_saver);
+}
+
+static int
+blank_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ return remove_scrn_saver(blank_saver);
+}
+
+int
+blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
+ blank_saver_load, blank_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/syscons/daemon/Makefile b/lkm/syscons/daemon/Makefile
new file mode 100644
index 000000000000..d823bfdfc8ff
--- /dev/null
+++ b/lkm/syscons/daemon/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.3 1997/07/15 14:49:13 yokota Exp $
+
+KMOD= daemon_saver_mod
+SRCS= daemon_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/daemon/daemon_saver.c b/lkm/syscons/daemon/daemon_saver.c
new file mode 100644
index 000000000000..59e99f0fe328
--- /dev/null
+++ b/lkm/syscons/daemon/daemon_saver.c
@@ -0,0 +1,369 @@
+/*-
+ * Copyright (c) 1997 Sandro Sigala, Brescia, Italy.
+ * Copyright (c) 1997 Chris Shenton
+ * Copyright (c) 1995 S ren Schmidt
+ * 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
+ * in this position and unchanged.
+ * 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.
+ *
+ * $Id: daemon_saver.c,v 1.10 1998/09/15 18:16:38 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+
+#include <machine/md_var.h>
+#include <machine/pc/display.h>
+
+#include <saver.h>
+
+#define CONSOLE_VECT(x, y) \
+ (window + (y)*cur_console->xsize + (x))
+
+#define DAEMON_MAX_WIDTH 32
+#define DAEMON_MAX_HEIGHT 19
+
+MOD_MISC(daemon_saver);
+
+static char *message;
+static int messagelen;
+static u_short *window;
+
+/* Who is the author of this ASCII pic? */
+
+static char *daemon_pic[] = {
+ " , ,",
+ " /( )`",
+ " \\ \\___ / |",
+ " /- _ `-/ '",
+ " (/\\/ \\ \\ /\\",
+ " / / | ` \\",
+ " O O ) / |",
+ " `-^--'`< '",
+ " (_.) _ ) /",
+ " `.___/` /",
+ " `-----' /",
+ "<----. __ / __ \\",
+ "<----|====O)))==) \\) /====",
+ "<----' `--' `.__,' \\",
+ " | |",
+ " \\ / /\\",
+ " ______( (_ / \\______/",
+ " ,' ,-----' |",
+ " `--{__________)",
+ NULL
+};
+
+static char *daemon_attr[] = {
+ " R R",
+ " RR RR",
+ " R RRRR R R",
+ " RR W RRR R",
+ " RWWW W R RR",
+ " W W W R R",
+ " B B W R R",
+ " WWWWWWRR R",
+ " RRRR R R R",
+ " RRRRRRR R",
+ " RRRRRRR R",
+ "YYYYYY RR R RR R",
+ "YYYYYYYYYYRRRRYYR RR RYYYY",
+ "YYYYYY RRRR RRRRRR R",
+ " R R",
+ " R R RR",
+ " CCCCCCR RR R RRRRRRRR",
+ " CC CCCCCCC C",
+ " CCCCCCCCCCCCCCC",
+ NULL
+};
+
+/*
+ * Reverse a graphics character, or return unaltered if no mirror;
+ * should do alphanumerics too, but I'm too lazy. <cshenton@it.hq.nasa.gov>
+ */
+
+static char
+xflip_symbol(char symbol)
+{
+ static const char lchars[] = "`'(){}[]\\/<>";
+ static const char rchars[] = "'`)(}{][/\\><";
+ int pos;
+
+ for (pos = 0; lchars[pos] != '\0'; pos++)
+ if (lchars[pos] == symbol)
+ return rchars[pos];
+
+ return symbol;
+}
+
+static void
+clear_daemon(int xpos, int ypos, int dxdir, int xoff, int yoff,
+ int xlen, int ylen)
+{
+ int y;
+
+ if (xlen <= 0)
+ return;
+ for (y = yoff; y < ylen; y++)
+ fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
+ CONSOLE_VECT(xpos + xoff, ypos + y), xlen - xoff);
+}
+
+static void
+draw_daemon(int xpos, int ypos, int dxdir, int xoff, int yoff,
+ int xlen, int ylen)
+{
+ int x, y;
+ int px;
+ int attr;
+
+ for (y = yoff; y < ylen; y++) {
+ if (dxdir < 0)
+ px = xoff;
+ else
+ px = DAEMON_MAX_WIDTH - xlen;
+ if (px >= strlen(daemon_pic[y]))
+ continue;
+ for (x = xoff; (x < xlen) && (daemon_pic[y][px] != '\0'); x++, px++) {
+ switch (daemon_attr[y][px]) {
+ case 'R': attr = (FG_LIGHTRED|BG_BLACK)<<8; break;
+ case 'Y': attr = (FG_YELLOW|BG_BLACK)<<8; break;
+ case 'B': attr = (FG_LIGHTBLUE|BG_BLACK)<<8; break;
+ case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break;
+ case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break;
+ default: attr = (FG_WHITE|BG_BLACK)<<8; break;
+ }
+ if (dxdir < 0) { /* Moving left */
+ *CONSOLE_VECT(xpos + x, ypos + y) =
+ scr_map[daemon_pic[y][px]]|attr;
+ } else { /* Moving right */
+ *CONSOLE_VECT(xpos + DAEMON_MAX_WIDTH - px - 1, ypos + y) =
+ scr_map[xflip_symbol(daemon_pic[y][px])]|attr;
+ }
+ }
+ }
+}
+
+static void
+clear_string(int xpos, int ypos, int xoff, char *s, int len)
+{
+ if (len <= 0)
+ return;
+ fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
+ CONSOLE_VECT(xpos + xoff, ypos), len - xoff);
+}
+
+static void
+draw_string(int xpos, int ypos, int xoff, char *s, int len)
+{
+ int x;
+
+ for (x = xoff; x < len; x++)
+ *CONSOLE_VECT(xpos + x, ypos) =
+ scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
+}
+
+static void
+daemon_saver(int blank)
+{
+ static int txpos = 10, typos = 10;
+ static int txdir = -1, tydir = -1;
+ static int dxpos = 0, dypos = 0;
+ static int dxdir = 1, dydir = 1;
+ static int moved_daemon = 0;
+ static int xoff, yoff, toff;
+ static int xlen, ylen, tlen;
+ scr_stat *scp = cur_console;
+ int min, max;
+
+ if (blank) {
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked == 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ /* clear the screen and set the border color */
+ fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
+ window, scp->xsize * scp->ysize);
+ set_border(scp, 0);
+ xlen = ylen = tlen = 0;
+ }
+ if (scrn_blanked++ < 2)
+ return;
+ scrn_blanked = 1;
+
+ clear_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
+ clear_string(txpos, typos, toff, (char *)message, tlen);
+
+ if (++moved_daemon) {
+ /*
+ * The daemon picture may be off the screen, if
+ * screen size is chagened while the screen
+ * saver is inactive. Make sure the origin of
+ * the picture is between min and max.
+ */
+ if (scp->xsize <= DAEMON_MAX_WIDTH) {
+ /*
+ * If the screen width is too narrow, we
+ * allow part of the picture go off
+ * the screen so that the daemon won't
+ * flip too often.
+ */
+ min = scp->xsize - DAEMON_MAX_WIDTH - 10;
+ max = 10;
+ } else {
+ min = 0;
+ max = scp->xsize - DAEMON_MAX_WIDTH;
+ }
+ if (dxpos <= min) {
+ dxpos = min;
+ dxdir = 1;
+ } else if (dxpos >= max) {
+ dxpos = max;
+ dxdir = -1;
+ }
+
+ if (scp->ysize <= DAEMON_MAX_HEIGHT) {
+ min = scp->ysize - DAEMON_MAX_HEIGHT - 10;
+ max = 10;
+ } else {
+ min = 0;
+ max = scp->ysize - DAEMON_MAX_HEIGHT;
+ }
+ if (dypos <= min) {
+ dypos = min;
+ dydir = 1;
+ } else if (dypos >= max) {
+ dypos = max;
+ dydir = -1;
+ }
+
+ moved_daemon = -1;
+ dxpos += dxdir; dypos += dydir;
+
+ /* clip the picture */
+ xoff = 0;
+ xlen = DAEMON_MAX_WIDTH;
+ if (dxpos + xlen <= 0)
+ xlen = 0;
+ else if (dxpos < 0)
+ xoff = -dxpos;
+ if (dxpos >= scp->xsize)
+ xlen = 0;
+ else if (dxpos + xlen > scp->xsize)
+ xlen = scp->xsize - dxpos;
+ yoff = 0;
+ ylen = DAEMON_MAX_HEIGHT;
+ if (dypos + ylen <= 0)
+ ylen = 0;
+ else if (dypos < 0)
+ yoff = -dypos;
+ if (dypos >= scp->ysize)
+ ylen = 0;
+ else if (dypos + ylen > scp->ysize)
+ ylen = scp->ysize - dypos;
+ }
+
+ if (scp->xsize <= messagelen) {
+ min = scp->xsize - messagelen - 10;
+ max = 10;
+ } else {
+ min = 0;
+ max = scp->xsize - messagelen;
+ }
+ if (txpos <= min) {
+ txpos = min;
+ txdir = 1;
+ } else if (txpos >= max) {
+ txpos = max;
+ txdir = -1;
+ }
+ if (typos <= 0) {
+ typos = 0;
+ tydir = 1;
+ } else if (typos >= scp->ysize - 1) {
+ typos = scp->ysize - 1;
+ tydir = -1;
+ }
+ txpos += txdir; typos += tydir;
+
+ toff = 0;
+ tlen = messagelen;
+ if (txpos + tlen <= 0)
+ tlen = 0;
+ else if (txpos < 0)
+ toff = -txpos;
+ if (txpos >= scp->xsize)
+ tlen = 0;
+ else if (txpos + tlen > scp->xsize)
+ tlen = scp->xsize - txpos;
+
+ draw_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
+ draw_string(txpos, typos, toff, (char *)message, tlen);
+ } else {
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
+ }
+}
+
+static int
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ int err;
+
+ messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 +
+ strlen(osrelease);
+ message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
+ sprintf(message, "%s - %s %s", hostname, ostype, osrelease);
+
+ err = add_scrn_saver(daemon_saver);
+ if (err != 0)
+ free(message, M_DEVBUF);
+ return err;
+}
+
+static int
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ int err;
+
+ err = remove_scrn_saver(daemon_saver);
+ if (err == 0)
+ free(message, M_DEVBUF);
+ return err;
+}
+
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/syscons/fade/Makefile b/lkm/syscons/fade/Makefile
new file mode 100644
index 000000000000..f9b803078c30
--- /dev/null
+++ b/lkm/syscons/fade/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.6 1997/07/15 14:49:23 yokota Exp $
+
+KMOD= fade_saver_mod
+SRCS= fade_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/fade/fade_saver.c b/lkm/syscons/fade/fade_saver.c
new file mode 100644
index 000000000000..0d31bd6de526
--- /dev/null
+++ b/lkm/syscons/fade/fade_saver.c
@@ -0,0 +1,137 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: fade_saver.c,v 1.13 1998/09/15 18:16:39 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+#include <i386/isa/isa.h>
+
+#include <saver.h>
+
+MOD_MISC(fade_saver);
+
+static void
+fade_saver(int blank)
+{
+ static int count = 0;
+ u_char pal[256*3];
+ int i;
+
+ if (blank) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
+ case KD_VGA:
+ if (count < 64) {
+ pal[0] = pal[1] = pal[2] = 0;
+ for (i = 3; i < 256*3; i++) {
+ if (palette[i] - count > 60)
+ pal[i] = palette[i] - count;
+ else
+ pal[i] = 60;
+ }
+ load_palette(cur_console, pal);
+ count++;
+ }
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x25);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x21);
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ switch (crtc_type) {
+ case KD_VGA:
+ load_palette(cur_console, palette);
+ count = 0;
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x2d);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x29);
+ break;
+ default:
+ break;
+ }
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
+ }
+}
+
+static int
+fade_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ switch (crtc_type) {
+ case KD_MONO:
+ case KD_HERCULES:
+ case KD_CGA:
+ /*
+ * `fade' saver is not fully implemented for MDA and CGA.
+ * It simply blanks the display instead.
+ */
+ case KD_VGA:
+ break;
+ case KD_EGA:
+ /* EGA is yet to be supported */
+ default:
+ return ENODEV;
+ }
+ return add_scrn_saver(fade_saver);
+}
+
+static int
+fade_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ return remove_scrn_saver(fade_saver);
+}
+
+int
+fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
+ fade_saver_load, fade_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/syscons/green/Makefile b/lkm/syscons/green/Makefile
new file mode 100644
index 000000000000..2ffe190a6b2c
--- /dev/null
+++ b/lkm/syscons/green/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.6 1997/07/15 14:49:27 yokota Exp $
+
+KMOD= green_saver_mod
+SRCS= green_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/green/green_saver.c b/lkm/syscons/green/green_saver.c
new file mode 100644
index 000000000000..0e61c2e2102b
--- /dev/null
+++ b/lkm/syscons/green/green_saver.c
@@ -0,0 +1,129 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: green_saver.c,v 1.12 1998/09/15 18:16:39 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+#include <i386/isa/isa.h>
+
+#include <saver.h>
+
+MOD_MISC(green_saver);
+
+static void
+green_saver(int blank)
+{
+ u_char val;
+ if (blank) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
+ outb(crtc_addr + 1, val & ~0x80);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x25);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x21);
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ switch (crtc_type) {
+ case KD_VGA:
+ outb(TSIDX, 0x01); val = inb(TSREG);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
+ outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
+ outb(crtc_addr + 1, val | 0x80);
+ break;
+ case KD_EGA:
+ /* not yet done XXX */
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 4, 0x2d);
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ outb(crtc_addr + 4, 0x29);
+ break;
+ default:
+ break;
+ }
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
+ }
+}
+
+static int
+green_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ switch (crtc_type) {
+ case KD_MONO:
+ case KD_HERCULES:
+ case KD_CGA:
+ /*
+ * `green' saver is not fully implemented for MDA and CGA.
+ * It simply blanks the display instead.
+ */
+ case KD_VGA:
+ break;
+ case KD_EGA:
+ /* EGA is yet to be supported */
+ default:
+ return ENODEV;
+ }
+ return add_scrn_saver(green_saver);
+}
+
+static int
+green_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ return remove_scrn_saver(green_saver);
+}
+
+int
+green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
+ green_saver_load, green_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/syscons/saver.h b/lkm/syscons/saver.h
new file mode 100644
index 000000000000..9eb19956327f
--- /dev/null
+++ b/lkm/syscons/saver.h
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: saver.h,v 1.11 1998/09/15 18:16:38 sos Exp $
+ */
+#include <machine/apm_bios.h>
+#include <machine/console.h>
+
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
+
+extern scr_stat *cur_console;
+extern u_short *Crtat;
+extern u_int crtc_addr;
+extern char crtc_type;
+extern char scr_map[];
+extern int scrn_blanked;
+extern int fonts_loaded;
+extern char font_8[], font_14[], font_16[];
+extern char palette[];
diff --git a/lkm/syscons/snake/Makefile b/lkm/syscons/snake/Makefile
new file mode 100644
index 000000000000..16006a79a9f7
--- /dev/null
+++ b/lkm/syscons/snake/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.6 1997/07/15 14:49:33 yokota Exp $
+
+KMOD= snake_saver_mod
+SRCS= snake_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/snake/snake_saver.c b/lkm/syscons/snake/snake_saver.c
new file mode 100644
index 000000000000..efb76d505df7
--- /dev/null
+++ b/lkm/syscons/snake/snake_saver.c
@@ -0,0 +1,150 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: snake_saver.c,v 1.18 1998/09/15 18:16:39 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+
+#include <machine/md_var.h>
+#include <machine/pc/display.h>
+
+#include <saver.h>
+
+MOD_MISC(snake_saver);
+
+static char *message;
+static u_char **messagep;
+static int messagelen;
+static u_short *window;
+
+static void
+snake_saver(int blank)
+{
+ static int dirx, diry;
+ int f;
+ scr_stat *scp = cur_console;
+
+/* XXX hack for minimal changes. */
+#define save message
+#define savs messagep
+
+ if (blank) {
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8 | scr_map[0x20],
+ window, scp->xsize * scp->ysize);
+ set_border(scp, 0);
+ dirx = (scp->xpos ? 1 : -1);
+ diry = (scp->ypos ?
+ scp->xsize : -scp->xsize);
+ for (f=0; f< messagelen; f++)
+ savs[f] = (u_char *)window + 2 *
+ (scp->xpos+scp->ypos*scp->xsize);
+ *(savs[0]) = scr_map[*save];
+ f = scp->ysize * scp->xsize + 5;
+ outb(crtc_addr, 14);
+ outb(crtc_addr+1, f >> 8);
+ outb(crtc_addr, 15);
+ outb(crtc_addr+1, f & 0xff);
+ scrn_blanked = 1;
+ }
+ if (scrn_blanked++ < 4)
+ return;
+ scrn_blanked = 1;
+ *(savs[messagelen-1]) = scr_map[0x20];
+ for (f=messagelen-1; f > 0; f--)
+ savs[f] = savs[f-1];
+ f = (savs[0] - (u_char *)window) / 2;
+ if ((f % scp->xsize) == 0 ||
+ (f % scp->xsize) == scp->xsize - 1 ||
+ (random() % 50) == 0)
+ dirx = -dirx;
+ if ((f / scp->xsize) == 0 ||
+ (f / scp->xsize) == scp->ysize - 1 ||
+ (random() % 20) == 0)
+ diry = -diry;
+ savs[0] += 2*dirx + 2*diry;
+ for (f=messagelen-1; f>=0; f--)
+ *(savs[f]) = scr_map[save[f]];
+ }
+ else {
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
+ }
+}
+
+static int
+snake_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ int err;
+
+ messagelen = strlen(ostype) + 1 + strlen(osrelease);
+ message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
+ sprintf(message, "%s %s", ostype, osrelease);
+ messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK);
+
+ err = add_scrn_saver(snake_saver);
+ if (err != 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
+}
+
+static int
+snake_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ int err;
+
+ err = remove_scrn_saver(snake_saver);
+ if (err == 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
+}
+
+int
+snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
+ snake_saver_load, snake_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/syscons/star/Makefile b/lkm/syscons/star/Makefile
new file mode 100644
index 000000000000..f8f8522835e7
--- /dev/null
+++ b/lkm/syscons/star/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.6 1997/07/15 14:49:38 yokota Exp $
+
+KMOD= star_saver_mod
+SRCS= star_saver.c
+
+NOMAN=
+CFLAGS+= -I${.CURDIR}/..
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/star/star_saver.c b/lkm/syscons/star/star_saver.c
new file mode 100644
index 000000000000..2e56a3c96fbd
--- /dev/null
+++ b/lkm/syscons/star/star_saver.c
@@ -0,0 +1,113 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: star_saver.c,v 1.15 1998/09/15 18:16:39 sos Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+#include <machine/md_var.h>
+#include <machine/pc/display.h>
+
+#include <saver.h>
+
+MOD_MISC(star_saver);
+
+#define NUM_STARS 50
+
+static u_short *window;
+
+/*
+ * Alternate saver that got its inspiration from a well known utility
+ * package for an inferior^H^H^H^H^H^Hfamous OS.
+ */
+static void
+star_saver(int blank)
+{
+ scr_stat *scp = cur_console;
+ int cell, i;
+ char pattern[] = {"...........++++*** "};
+ char colors[] = {FG_DARKGREY, FG_LIGHTGREY,
+ FG_WHITE, FG_LIGHTCYAN};
+ static u_short stars[NUM_STARS][2];
+
+ if (blank) {
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ scrn_blanked = 1;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], window,
+ scp->xsize * scp->ysize);
+ set_border(scp, 0);
+ for(i=0; i<NUM_STARS; i++) {
+ stars[i][0] =
+ random() % (scp->xsize*scp->ysize);
+ stars[i][1] = 0;
+ }
+ }
+ cell = random() % NUM_STARS;
+ *((u_short*)(window + stars[cell][0])) =
+ scr_map[pattern[stars[cell][1]]] |
+ colors[random()%sizeof(colors)] << 8;
+ if ((stars[cell][1]+=(random()%4)) >= sizeof(pattern)-1) {
+ stars[cell][0] = random() % (scp->xsize*scp->ysize);
+ stars[cell][1] = 0;
+ }
+ }
+ else {
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
+ }
+}
+
+static int
+star_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ return add_scrn_saver(star_saver);
+}
+
+static int
+star_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ return remove_scrn_saver(star_saver);
+}
+
+int
+star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(star_saver, lkmtp, cmd, ver,
+ star_saver_load, star_saver_unload, lkm_nullcmd);
+}
diff --git a/lkm/umapfs/Makefile b/lkm/umapfs/Makefile
new file mode 100644
index 000000000000..eb333da688bb
--- /dev/null
+++ b/lkm/umapfs/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/miscfs/umapfs
+KMOD= umap_mod
+SRCS= umap_subr.c umap_vfsops.c umap_vnops.c
+NOMAN=
+VFS_LKM= yes
+CFLAGS+= -DUMAPFS
+
+.include <bsd.kmod.mk>
diff --git a/lkm/union/Makefile b/lkm/union/Makefile
new file mode 100644
index 000000000000..56366598f9d4
--- /dev/null
+++ b/lkm/union/Makefile
@@ -0,0 +1,10 @@
+# $Id$
+
+.PATH: ${.CURDIR}/../../sys/miscfs/union
+KMOD= union_mod
+SRCS= union_subr.c union_vfsops.c union_vnops.c
+NOMAN=
+VFS_LKM=
+CFLAGS+= -DUNION
+
+.include <bsd.kmod.mk>
diff --git a/lkm/vesa/Makefile b/lkm/vesa/Makefile
new file mode 100644
index 000000000000..ae9662f40aaa
--- /dev/null
+++ b/lkm/vesa/Makefile
@@ -0,0 +1,19 @@
+# $Id: Makefile,v 1.1 1998/09/15 20:09:18 sos Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/isa
+KMOD = vesa_mod
+SRCS = vesa.c scvesactl.c sc.h opt_vesa.h opt_vm86.h
+NOMAN =
+CFLAGS += -DVESA_MODULE
+CLEANFILES += sc.h opt_vesa.h opt_vm86.h
+
+sc.h:
+ echo "#define NSC 1" > sc.h
+
+opt_vesa.h:
+ echo "#define VESA 1" > opt_vesa.h
+
+opt_vm86.h:
+ echo "#define VM86 1" > opt_vm86.h
+
+.include <bsd.kmod.mk>
diff --git a/lkm/vinum/COPYRIGHT b/lkm/vinum/COPYRIGHT
new file mode 100644
index 000000000000..4ee95f20ce5c
--- /dev/null
+++ b/lkm/vinum/COPYRIGHT
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
+ */
diff --git a/lkm/vinum/Makefile b/lkm/vinum/Makefile
new file mode 100644
index 000000000000..f1f4bb76117a
--- /dev/null
+++ b/lkm/vinum/Makefile
@@ -0,0 +1,26 @@
+# $Id: Makefile,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+
+.PATH: ${.CURDIR}/../../sys/dev/ccd
+KMOD= vinum_mod
+SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
+ state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
+ vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
+NOMAN=
+PSEUDO_LKM=
+CFLAGS = -I${.CURDIR} -O -g -I/usr/include/machine -DDEBUG -Wall -Wno-unused -Wno-parentheses
+
+CLEANFILES+= vinum.h vnode_if.h vnode_if.c
+
+all:
+
+# We don't need this, but the Makefile wants it
+vinum.h:
+ touch $@
+
+state.h: maketabs vinumstate.h
+ ./maketabs >state.h
+
+maketabs: maketabs.c
+ ${CC} -g -o maketabs maketabs.c
+
+.include <bsd.kmod.mk>
diff --git a/lkm/vinum/config.c b/lkm/vinum/config.c
new file mode 100644
index 000000000000..fd31c5e07c46
--- /dev/null
+++ b/lkm/vinum/config.c
@@ -0,0 +1,1712 @@
+/* To do:
+
+ * Don't store drive configuration on the config DB: read each drive's header
+ * to decide where it is.
+ *
+ * Accept any old crap in the config_<foo> functions, and complain when
+ * we try to bring it up.
+ *
+ * When trying to bring volumes up, check that the complete address range
+ * is covered.
+ */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: config.c,v 1.17 1998/08/14 04:49:26 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+
+extern jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+void longjmp(jmp_buf, int);
+#endif
+
+#define MAXTOKEN 64 /* maximum number of tokens in a line */
+
+/* We can afford the luxury of global variables here,
+ * since start_config ensures that these functions
+ * are single-threaded. */
+
+/* These are indices in vinum_conf of the last-mentioned of each kind of object */
+static int current_drive = -1; /* note the last drive we mention, for
+ * some defaults */
+static int current_plex = -1; /* and the same for the last plex */
+static int current_volume = -1; /* and the last volme */
+static struct _ioctl_reply *ioctl_reply; /* struct to return via ioctl */
+
+
+/* These values are used by most of these routines, so set them as globals */
+static char *token[MAXTOKEN]; /* pointers to individual tokens */
+static int tokens; /* number of tokens */
+
+#define TOCONS 0x01
+#define TOTTY 0x02
+#define TOLOG 0x04
+
+struct putchar_arg {
+ int flags;
+ struct tty *tty;
+};
+
+#define MSG_MAX 1024 /* maximum length of a formatted message */
+/* Format an error message and return to the user in the reply.
+ * CARE: This routine is designed to be called only from the
+ * configuration routines, so it assumes it's the owner of
+ * the configuration lock, and unlocks it on exit */
+void
+throw_rude_remark(int error, char *msg,...)
+{
+ BROKEN_GDB;
+ int retval;
+ va_list ap;
+ char *text;
+ static int finishing; /* don't recurse */
+ int was_finishing;
+
+ va_start(ap, msg);
+ if ((ioctl_reply != NULL) /* we're called from the user */
+ &&(!(vinum_conf.flags & VF_KERNELOP))) { /* and we're not doing kernel things: return msg */
+ /* XXX We can't just format to ioctl_reply, since it
+ * may contain our input parameters */
+ text = Malloc(MSG_MAX);
+ if (text == NULL) {
+ printf("vinum: can't allocate error message buffer");
+ printf("vinum: ");
+ vprintf(msg, ap); /* print to the console */
+ printf("\n");
+ } else {
+ retval = kvprintf(msg, NULL, (void *) text, 10, ap);
+ text[retval] = '\0'; /* delimit */
+ strcpy(ioctl_reply->msg, text);
+ ioctl_reply->error = error; /* first byte is the error number */
+ Free(text);
+ }
+ } else {
+ printf("vinum: ");
+ vprintf(msg, ap); /* print to the console */
+ printf("\n");
+ }
+ va_end(ap);
+
+ if (vinum_conf.flags & VF_READING_CONFIG) /* go through to the bitter end, */
+ return;
+ /* We have a problem here: we want to unlock the
+ * configuration, which implies tidying up, but
+ * if we find an error while tidying up, we could
+ * recurse for ever. Use this kludge to only try
+ * once */
+ was_finishing = finishing;
+ finishing = 1;
+ finish_config(was_finishing); /* unlock anything we may be holding */
+ finishing = was_finishing;
+ longjmp(command_fail, error);
+}
+
+/* Function declarations */
+int atoi(char *); /* no atoi in the kernel */
+
+/* Minimal version of atoi */
+int
+atoi(char *s)
+{ /* no atoi in the kernel */
+ BROKEN_GDB;
+ int r = 0;
+ int sign = 1;
+
+ while (((*s >= '0') && (*s <= '9')) || (*s == '-')) {
+ if (*s == '-')
+ sign = -sign;
+ else
+ r = r * 10 + (*s - '0');
+ }
+ return r;
+}
+
+/* Find index of volume in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+volume_index(struct volume *vol)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.volumes_used; i++)
+ if (&VOL[i] == vol)
+ return i;
+ return -1;
+}
+
+/* Find index of plex in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+plex_index(struct plex *plex)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.plexes_used; i++)
+ if (&PLEX[i] == plex)
+ return i;
+ return -1;
+}
+
+/* Find index of subdisk in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+sd_index(struct sd *sd)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.subdisks_used; i++)
+ if (&SD[i] == sd)
+ return i;
+ return -1;
+}
+
+/* Find index of drive in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+drive_index(struct drive *drive)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ if (&DRIVE[i] == drive)
+ return i;
+ return -1;
+}
+
+/* Check a volume to see if the plex is already assigned to it.
+ * Return index in volume->plex, or -1 if not assigned */
+int
+my_plex(int volno, int plexno)
+{
+ BROKEN_GDB;
+ int i;
+ struct volume *vol;
+
+ vol = &VOL[volno]; /* point to volno */
+ for (i = 0; i < vol->plexes; i++)
+ if (vol->plex[i] == plexno)
+ return i;
+ return -1; /* not found */
+}
+
+/* Check a plex to see if the subdisk is already assigned to it.
+ * Return index in plex->sd, or -1 if not assigned */
+int
+my_sd(int plexno, int sdno)
+{
+ BROKEN_GDB;
+ int i;
+ struct plex *plex;
+
+ plex = &PLEX[plexno];
+ for (i = 0; i < plex->subdisks; i++)
+ if (plex->sdnos[i] == sdno)
+ return i;
+ return -1; /* not found */
+}
+
+/* Check that this operation is being done in the kernel.
+ * longjmp out if not. op the name of the operation. */
+void
+checkkernel(char *op)
+{
+ BROKEN_GDB;
+ if (vinum_conf.flags & VF_KERNELOP == 0)
+ throw_rude_remark(EPERM, "Can't perform '%s' from user space", op);
+}
+
+/* Add plex to the volume if possible */
+int
+give_plex_to_volume(int volno, int plexno)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+
+ /* XXX It's not an error for the plex to already
+ * belong to the volume, but we need to check a
+ * number of things to make sure it's done right.
+ * Some day. */
+ if (my_plex(volno, plexno) >= 0)
+ return plexno; /* that's it */
+
+ vol = &VOL[volno]; /* point to volume */
+ if (vol->plexes == MAXPLEX) /* all plexes allocated */
+ throw_rude_remark(ENOSPC,
+ "Too many plexes for volume %s",
+ vol->name);
+ vol->plex[vol->plexes] = plexno; /* this one */
+ vol->plexes++; /* add another plex */
+ PLEX[plexno].volno = volno; /* note the number of our volume */
+
+ return vol->plexes - 1; /* and return its index */
+}
+
+/* Add subdisk to a plex if possible */
+int
+give_sd_to_plex(int plexno, int sdno)
+{
+ BROKEN_GDB;
+ int i;
+ struct plex *plex;
+ struct sd *sd;
+
+ /* XXX It's not an error for the sd to already
+ * belong to the plex, but we need to check a
+ * number of things to make sure it's done right.
+ * Some day. */
+ i = my_sd(plexno, sdno);
+ if (i >= 0) /* does it already belong to us? */
+ return i; /* that's it */
+
+ plex = &PLEX[plexno]; /* point to the plex */
+ sd = &SD[sdno]; /* and the subdisk */
+
+ /* Do we have an offset? Otherwise put it after the last one */
+ if (sd->plexoffset < 0) { /* no offset specified */
+ if (plex->subdisks > 0) {
+ struct sd *lastsd = &SD[plex->sdnos[plex->subdisks - 1]]; /* last subdisk */
+ sd->plexoffset = lastsd->sectors + lastsd->plexoffset; /* take it */
+ } else /* first subdisk */
+ sd->plexoffset = 0; /* start at the beginning */
+ }
+ plex->subdisks++; /* another entry */
+ if (plex->subdisks >= plex->subdisks_allocated) /* need more space */
+ EXPAND(plex->sdnos, int, plex->subdisks_allocated, INITIAL_SUBDISKS_IN_PLEX);
+
+ /* XXX I'm not sure this makes any sense
+ * for anything except concatenated plexes,
+ * and it comes up with the wrong answer for
+ * RAID-5 plexes, but it's currently needed
+ * for the calculations. We'll adjust for
+ * RAID-5 in config_plex */
+ if ((sd->sectors + sd->plexoffset) > plex->length) { /* gone beyond the end of the plex */
+ plex->length = sd->sectors + sd->plexoffset; /* adjust the length */
+
+ if ((plex->volno >= 0) /* we have a volume */
+ &&(plex->length > VOL[plex->volno].size)) /* and we're now the longest plex */
+ VOL[plex->volno].size = plex->length; /* increase the size of the volume */
+ }
+ /* We need to check that the subdisks don't overlap,
+ * but we can't do that until a point where we *must*
+ * know the size of all the subdisks. That's not
+ * here. But we need to sort them by offset */
+ for (i = 0; i < plex->subdisks - 1; i++) {
+ if (sd->plexoffset < SD[plex->sdnos[i]].plexoffset) { /* it fits before this one */
+ /* First move any remaining subdisks by one */
+ int j;
+
+ for (j = plex->subdisks - 1; j > i; j--) /* move up one at a time */
+ plex->sdnos[j] = plex->sdnos[j - 1];
+ plex->sdnos[i] = sdno;
+ return i;
+ }
+ }
+
+ /* The plex doesn't have any subdisk with a larger
+ * offset. Insert it */
+ plex->sdnos[i] = sdno;
+ return i;
+}
+
+/* Add a subdisk to drive if possible. The pointer to the drive
+ * must already be stored in the sd structure, but the drive
+ * doesn't know about the subdisk yet. */
+static void
+give_sd_to_drive(int sdno)
+{
+ BROKEN_GDB;
+ struct sd *sd; /* pointer to subdisk */
+ struct drive *drive; /* and drive */
+ int fe; /* index in free list */
+
+ sd = &SD[sdno]; /* point to sd */
+ drive = &DRIVE[sd->driveno]; /* and drive */
+
+ if (drive->state != drive_up) /* not up */
+ throw_rude_remark(EIO, "Drive %s is not accessible", drive->label.name);
+ else if (sd->sectors > drive->sectors_available) { /* too big, */
+ sd->driveoffset = -1; /* don't be confusing */
+ throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
+ }
+ drive->subdisks_used++; /* one more subdisk */
+
+ /* no offset specified, find one */
+ if (sd->driveoffset < 0) {
+ for (fe = 0; fe < drive->freelist_entries; fe++) {
+ if (drive->freelist[fe].sectors >= sd->sectors) { /* it'll fit here */
+ sd->driveoffset = drive->freelist[fe].offset;
+ if (sd->sectors == drive->freelist[fe].sectors) { /* used up the entire entry */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one, */
+ bcopy(&drive->freelist[fe + 1],
+ &drive->freelist[fe],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry */
+ } else {
+ drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
+ drive->freelist[fe].offset += sd->sectors; /* this much further on */
+ }
+ drive->sectors_available -= sd->sectors; /* and note how much less space we have */
+ break;
+ }
+ }
+ if (fe == drive->freelist_entries)
+ /* Didn't find anything. Although the drive has
+ * enough space, it's too fragmented */
+ {
+ sd->driveoffset = -1; /* don't be confusing */
+ throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
+ }
+ } else { /* specific offset */
+ /* For a specific offset to work, the space must be
+ * entirely in a single freelist entry. Look for it. */
+ u_int64_t sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
+ for (fe = 0; fe < drive->freelist_entries; fe++) {
+ u_int64_t dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of entry */
+ if (dend >= sdend) { /* fits before here */
+ if (drive->freelist[fe].offset > sd->driveoffset) /* starts after the beginning of sd area */
+ throw_rude_remark(ENOSPC,
+ "No space for subdisk %s on drive %s at offset %qd\n",
+ sd->name,
+ drive->label.name);
+
+ /* We've found the space, and we can allocate it.
+ * We don't need to say that to the subdisk, which
+ * already knows about it. We need to tell it to
+ * the free list, though. We have four possibilities:
+ *
+ * 1. The subdisk exactly eats up the entry. That's the
+ * same as above.
+ * 2. The subdisk starts at the beginning and leaves space
+ * at the end.
+ * 3. The subdisk starts after the beginning and leaves
+ * space at the end as well: we end up with another
+ * fragment.
+ * 4. The subdisk leaves space at the beginning and finishes
+ * at the end.
+ */
+ drive->sectors_available -= sd->sectors; /* note how much less space we have */
+ if (sd->driveoffset == drive->freelist[fe].offset) { /* 1 or 2 */
+ if (sd->sectors == drive->freelist[fe].sectors) { /* 1: used up the entire entry */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one, */
+ bcopy(&drive->freelist[fe + 1],
+ &drive->freelist[fe],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry */
+ } else { /* 2: space at the end */
+ drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
+ drive->freelist[fe].offset += sd->sectors; /* this much further on */
+ }
+ } else { /* 3 or 4 */
+ drive->freelist[fe].sectors = sd->driveoffset - drive->freelist[fe].offset;
+ if (dend > sdend) { /* 3: space at the end as well */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one */
+ bcopy(&drive->freelist[fe], /* move the rest down */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries++; /* one less entry */
+ drive->freelist[fe + 1].offset = sdend; /* second entry starts after sd */
+ drive->freelist[fe + 1].sectors = dend - sdend; /* and is this long */
+ }
+ }
+ break;
+ }
+ }
+ }
+ drive->opencount++; /* one more subdisk attached */
+}
+
+/* Get an empty drive entry from the drive table */
+int
+get_empty_drive(void)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ /* first see if we have one which has been deallocated */
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ if (DRIVE[driveno].state == drive_unallocated) /* bingo */
+ break;
+ }
+
+ if (driveno >= vinum_conf.drives_used)
+ /* Couldn't find a deallocated drive. Allocate a new one */
+ {
+ vinum_conf.drives_used++;
+ if (vinum_conf.drives_used > vinum_conf.drives_allocated) /* we've used all our allocation */
+ EXPAND(DRIVE, struct drive, vinum_conf.drives_allocated, INITIAL_DRIVES);
+ }
+ /* got a drive entry. Make it pretty */
+ drive = &DRIVE[driveno];
+ bzero(drive, sizeof(struct drive));
+ drive->driveno = driveno; /* put number in structure */
+ return driveno; /* return the index */
+}
+
+/* Find the named drive in vinum_conf.drive, return a pointer
+ * return the index in vinum_conf.drive.
+ * Don't mark the drive as allocated (XXX MP)
+ * If create != 0, create an entry if it doesn't exist
+ */
+/* XXX check if we have it open from attach */
+int
+find_drive(const char *name, int create)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ if (name != NULL) {
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &DRIVE[driveno]; /* point to drive */
+ if ((drive->label.name[0] != '\0') /* it has a name */
+ &&(strcmp(drive->label.name, name) == 0)) /* and it's this one: found */
+ return driveno;
+ }
+ }
+ /* the drive isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ driveno = get_empty_drive();
+ drive = &DRIVE[driveno];
+ if (name != NULL)
+ bcopy(name, /* put in its name */
+ drive->label.name,
+ min(sizeof(drive->label.name),
+ strlen(name)));
+ drive->state = drive_uninit; /* in use, nothing worthwhile there */
+ return driveno; /* return the index */
+}
+
+/* Find a drive given its device name.
+ * devname must be valid.
+ * Otherwise the same as find_drive above */
+int
+find_drive_by_dev(const char *devname, int create)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &DRIVE[driveno]; /* point to drive */
+ if ((drive->label.name[0] != '\0') /* it has a name */
+ &&(strcmp(drive->label.name, devname) == 0)) /* and it's this one: found */
+ return driveno;
+ }
+
+ /* the drive isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ driveno = get_empty_drive();
+ drive = &DRIVE[driveno];
+ bcopy(devname, /* put in its name */
+ drive->devicename,
+ min(sizeof(drive->devicename),
+ strlen(devname)));
+ drive->state = drive_uninit; /* in use, nothing worthwhile there */
+ return driveno; /* return the index */
+}
+
+/* Find an empty subdisk in the subdisk table */
+int
+get_empty_sd(void)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+
+ /* first see if we have one which has been deallocated */
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
+ if (SD[sdno].state == sd_unallocated) /* bingo */
+ break;
+ }
+
+ if (sdno >= vinum_conf.subdisks_used) { /* No unused sd found. Allocate a new one */
+ vinum_conf.subdisks_used++;
+ if (vinum_conf.subdisks_used > vinum_conf.subdisks_allocated)
+ EXPAND(SD, struct sd, vinum_conf.subdisks_allocated, INITIAL_SUBDISKS);
+ }
+ /* initialize some things */
+ sd = &SD[sdno]; /* point to it */
+ bzero(sd, sizeof(struct sd)); /* initialize */
+ sd->plexno = -1; /* no plex */
+ sd->driveno = -1; /* and no drive */
+ sd->plexoffset = -1; /* and no offsets */
+ sd->driveoffset = -1;
+ return sdno; /* return the index */
+}
+
+/* return a drive to the free pool */
+void
+free_drive(struct drive *drive)
+{
+ BROKEN_GDB;
+ if (drive->vp != NULL) /* device open */
+ vn_close(drive->vp, FREAD | FWRITE, FSCRED, drive->p);
+ bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
+}
+
+/* Find the named subdisk in vinum_conf.sd.
+
+ * If create != 0, create an entry if it doesn't exist
+ *
+ * Return index in vinum_conf.sd
+ */
+int
+find_subdisk(const char *name, int create)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_allocated; sdno++) {
+ if (strcmp(SD[sdno].name, name) == 0) /* found it */
+ return sdno;
+ }
+
+ /* the subdisk isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ sdno = get_empty_sd();
+ sd = &SD[sdno];
+ bcopy(name, sd->name, min(sizeof(sd->name), strlen(name))); /* put in its name */
+ return sdno; /* return the pointer */
+}
+
+/* Free an allocated sd entry
+ * This performs memory management only. remove()
+ * is responsible for checking relationships.
+ */
+void
+free_sd(int sdno)
+{
+ BROKEN_GDB;
+ struct sd *sd;
+ struct drive *drive;
+ int fe; /* free list entry */
+ u_int64_t sdend; /* end of our subdisk */
+ u_int64_t dend; /* end of our freelist entry */
+
+ sd = &SD[sdno];
+ if ((sd->driveno >= 0) /* we have a drive, */
+ &&(sd->sectors > 0)) { /* and some space on it */
+ drive = &DRIVE[sd->driveno];
+ sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
+
+ /* Look for where to return the sd address space */
+ for (fe = 0;
+ (fe < drive->freelist_entries) && (drive->freelist[fe].offset < sd->driveoffset);
+ fe++);
+ /* Now we are pointing to the last entry, the first
+ * with a higher offset than the subdisk, or both. */
+ if ((fe > 1) /* not the first entry */
+ &&((fe == drive->freelist_entries) /* gone past the end */
+ ||(drive->freelist[fe].offset > sd->driveoffset))) /* or past the block were looking for */
+ fe--; /* point to the block before */
+ dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of the entry */
+
+ /* At this point, we are pointing to the correct
+ * place in the free list. A number of possibilities
+ * exist:
+ *
+ * 1. The block to be freed immediately follows
+ * the block to which we are pointing. Just
+ * enlarge it.
+ * 2. The block to be freed starts at the end of
+ * the current block and ends at the beginning
+ * of the following block. Merge the three
+ * areas into a single block.
+ * 3. The block to be freed starts after the end
+ * of the block and ends before the start of
+ * the following block. Create a new free block.
+ * 4. The block to be freed starts after the end
+ * of the block, but ends at the start of the
+ * following block. Enlarge the following block
+ * downwards.
+ *
+ */
+ if (sd->driveoffset == dend) { /* it starts after the end of this block */
+ if ((fe < drive->freelist_entries - 1) /* we're not the last block in the free list */
+ &&(sdend == drive->freelist[fe + 1].offset)) { /* and the subdisk ends at the start of the
+ * next block */
+ drive->freelist[fe].sectors = drive->freelist[fe + 1].sectors; /* 2: merge all three blocks */
+ if (fe < drive->freelist_entries - 2) /* still more blocks after next */
+ bcopy(&drive->freelist[fe + 2], /* move down one */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - 2 - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry in the free list */
+ } else /* 1: just enlarge this block */
+ drive->freelist[fe].sectors += sd->sectors;
+ } else {
+ if (sd->driveoffset > dend) /* it starts after this block */
+ fe++; /* so look at the next block */
+ if ((fe < drive->freelist_entries) /* we're not the last block in the free list */
+ &&(sdend == drive->freelist[fe].offset)) { /* and the subdisk ends at the start of
+ * this block: case 4 */
+ drive->freelist[fe].offset = sd->driveoffset; /* it starts where the sd was */
+ drive->freelist[fe].sectors += sd->sectors; /* and it's this much bigger */
+ } else { /* case 3: non-contiguous */
+ if (fe < drive->freelist_entries) /* not after the last block, */
+ bcopy(&drive->freelist[fe], /* move the rest up one entry */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries++; /* one less entry */
+ drive->freelist[fe].offset = sd->driveoffset; /* this entry represents the sd */
+ drive->freelist[fe].sectors = sd->sectors;
+ }
+ }
+ drive->opencount--; /* one less subdisk attached */
+ }
+ bzero(sd, sizeof(struct sd)); /* and clear it out */
+ sd->state = sd_unallocated;
+}
+
+/* Find an empty plex in the plex table */
+int
+get_empty_plex(void)
+{
+ BROKEN_GDB;
+ int plexno;
+ struct plex *plex; /* if we allocate one */
+
+ /* first see if we have one which has been deallocated */
+ for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++) {
+ if (PLEX[plexno].state == plex_unallocated) /* bingo */
+ break; /* and get out of here */
+ }
+
+ if (plexno >= vinum_conf.plexes_used) {
+ /* Couldn't find a deallocated plex. Allocate a new one */
+ vinum_conf.plexes_used++;
+ if (vinum_conf.plexes_used > vinum_conf.plexes_allocated)
+ EXPAND(PLEX, struct plex, vinum_conf.plexes_allocated, INITIAL_PLEXES);
+ }
+ /* Found a plex. Give it an sd structure */
+ plex = &PLEX[plexno]; /* this one is ours */
+ bzero(plex, sizeof(struct plex)); /* polish it up */
+ plex->sdnos = (int *) Malloc(sizeof(int) * INITIAL_SUBDISKS_IN_PLEX); /* allocate sd table */
+ CHECKALLOC(plex->sdnos, "vinum: Can't allocate plex subdisk table");
+ bzero(plex->sdnos, (sizeof(int) * INITIAL_SUBDISKS_IN_PLEX)); /* do we need this? */
+ plex->subdisks = 0; /* no subdisks in use */
+ plex->subdisks_allocated = INITIAL_SUBDISKS_IN_PLEX; /* and we have space for this many */
+ plex->organization = plex_disorg; /* and it's not organized */
+ plex->volno = -1; /* no volume yet */
+ return plexno; /* return the index */
+}
+
+/* Find the named plex in vinum_conf.plex
+
+ * If create != 0, create an entry if it doesn't exist
+ * return index in vinum_conf.plex
+ */
+int
+find_plex(const char *name, int create)
+{
+ BROKEN_GDB;
+ int plexno;
+ struct plex *plex;
+
+ for (plexno = 0; plexno < vinum_conf.plexes_allocated; plexno++) {
+ if (strcmp(PLEX[plexno].name, name) == 0) /* found it */
+ return plexno;
+ }
+
+ /* the plex isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ plexno = get_empty_plex();
+ plex = &PLEX[plexno]; /* point to it */
+ bcopy(name, plex->name, min(sizeof(plex->name), strlen(name))); /* put in its name */
+ return plexno; /* return the pointer */
+}
+
+/* Free an allocated plex entry
+ * and its associated memory areas */
+void
+free_plex(int plexno)
+{
+ BROKEN_GDB;
+ struct plex *plex;
+
+ plex = &PLEX[plexno];
+ if (plex->sdnos)
+ Free(plex->sdnos);
+ if (plex->lock)
+ Free(plex->lock);
+ if (plex->defective_region)
+ Free(plex->defective_region);
+ if (plex->unmapped_region)
+ Free(plex->unmapped_region);
+ bzero(plex, sizeof(struct plex)); /* and clear it out */
+ plex->state = plex_unallocated;
+}
+
+/* Find an empty volume in the volume table */
+int
+get_empty_volume(void)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol;
+
+ /* first see if we have one which has been deallocated */
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
+ if (VOL[volno].state == volume_unallocated) /* bingo */
+ break;
+ }
+
+ if (volno >= vinum_conf.volumes_used)
+ /* Couldn't find a deallocated volume. Allocate a new one */
+ {
+ vinum_conf.volumes_used++;
+ if (vinum_conf.volumes_used > vinum_conf.volumes_allocated)
+ EXPAND(VOL, struct volume, vinum_conf.volumes_allocated, INITIAL_VOLUMES);
+ }
+ /* Now initialize fields */
+ vol = &VOL[volno];
+ bzero(vol, sizeof(struct volume));
+ vol->preferred_plex = -1; /* default to round robin */
+ vol->preferred_plex = ROUND_ROBIN_READPOL; /* round robin */
+
+ return volno; /* return the index */
+}
+
+/* Find the named volume in vinum_conf.volume.
+
+ * If create != 0, create an entry if it doesn't exist
+ * return the index in vinum_conf
+ */
+int
+find_volume(const char *name, int create)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol;
+
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
+ if (strcmp(VOL[volno].name, name) == 0) /* found it */
+ return volno;
+ }
+
+ /* the volume isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ volno = get_empty_volume();
+ vol = &VOL[volno];
+ bcopy(name, vol->name, min(sizeof(vol->name), strlen(name))); /* put in its name */
+ vol->blocksize = DEV_BSIZE; /* block size of this volume */
+ return volno; /* return the pointer */
+}
+
+/* Free an allocated volume entry
+ * and its associated memory areas */
+void
+free_volume(int volno)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+
+ vol = &VOL[volno];
+ bzero(vol, sizeof(struct volume)); /* and clear it out */
+ vol->state = volume_unallocated;
+}
+
+/* Handle a drive definition. We store the information in the global variable
+ * drive, so we don't need to allocate.
+ *
+ * If we find an error, print a message and return
+ */
+void
+config_drive(void)
+{
+ BROKEN_GDB;
+ enum drive_label_info partition_status; /* info about the partition */
+ int parameter;
+ int driveno; /* index of drive in vinum_conf */
+ struct drive *drive; /* and pointer to it */
+
+ if (tokens < 2) /* not enough tokens */
+ throw_rude_remark(EINVAL, "Drive has no name");
+ driveno = find_drive(token[1], 1); /* allocate a drive to initialize */
+ drive = &DRIVE[driveno]; /* and get a pointer */
+
+ if (drive->state != drive_uninit) { /* we already know this drive */
+ /* XXX Check which definition is more up-to-date. Give
+ * preference for the definition on its own drive */
+ return; /* XXX */
+ }
+ for (parameter = 2; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_device:
+ parameter++;
+ if (drive->devicename[0] != '\0') { /* we know this drive... */
+ if (strcmp(drive->devicename, token[parameter])) /* different name */
+ close_drive(drive); /* close it if it's open */
+ else /* no change */
+ break;
+ }
+ bcopy(token[parameter], /* insert device information */
+ drive->devicename,
+ min(sizeof(drive->devicename),
+ strlen(token[parameter])));
+ /* open the device and get the configuration */
+ partition_status = read_drive_label(drive);
+ if (partition_status == DL_CANT_OPEN) { /* not our kind */
+ close_drive(drive);
+ if (drive->lasterror == EFTYPE) /* wrong kind of partition */
+ throw_rude_remark(drive->lasterror,
+ "Drive %s has invalid partition type",
+ drive->label.name);
+ else /* I/O error of some kind */
+ throw_rude_remark(drive->lasterror,
+ "Can't initialize drive %s",
+ drive->label.name);
+ } else if (partition_status == DL_WRONG_DRIVE) { /* valid drive, not ours */
+ close_drive(drive);
+ throw_rude_remark(drive->lasterror,
+ "Incorrect drive name %s specified for drive %s",
+ token[1],
+ drive->label.name);
+ }
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ drive->state = DriveState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ close_drive(drive);
+ throw_rude_remark(EINVAL,
+ "Drive %s, invalid keyword: %s",
+ token[1],
+ token[parameter]);
+ }
+ }
+
+ if (drive->devicename[0] == '\0')
+ throw_rude_remark(EINVAL, "No device name for %s", drive->label.name);
+
+}
+
+/* Handle a subdisk definition. We store the information in the global variable
+ * sd, so we don't need to allocate.
+ *
+ * If we find an error, print a message and return
+ */
+void
+config_subdisk(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int sdno; /* index of sd in vinum_conf */
+ struct sd *sd; /* and pointer to it */
+ u_int64_t size;
+ int sectors; /* sector offset value */
+ int detached = 0; /* set to 1 if this is a detached subdisk */
+ int sdindex = -1; /* index in plexes subdisk table */
+
+ sdno = get_empty_sd(); /* allocate an SD to initialize */
+ sd = &SD[sdno]; /* and get a pointer */
+ for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_detached:
+ detached = 1;
+ break;
+
+ case kw_plexoffset:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, bad plex offset alignment: %qd", sd->name, size);
+ else
+ sd->plexoffset = size / DEV_BSIZE;
+ break;
+
+ case kw_driveoffset:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, bad drive offset alignment: %qd", sd->name, size);
+ else
+ sd->driveoffset = size / DEV_BSIZE;
+ break;
+
+ case kw_name:
+ ++parameter;
+ bcopy(token[parameter],
+ sd->name,
+ min(sizeof(sd->name), strlen(token[parameter])));
+ break;
+
+ case kw_len:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, length %d not multiple of sector size", sd->name, size);
+ else
+ sd->sectors = size / DEV_BSIZE;
+ break;
+
+ case kw_drive:
+ sd->driveno = find_drive(token[++parameter], 1); /* insert drive information */
+ break;
+
+ case kw_plex:
+ sd->plexno = find_plex(token[++parameter], 1); /* insert plex information */
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ sd->state = SdState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "sd %s, invalid keyword: %s", sd->name, token[parameter]);
+ }
+ }
+
+ /* Check we have a drive name */
+ if (sd->driveno < 0) { /* didn't specify a drive */
+ sd->driveno = current_drive; /* set to the current drive */
+ if (sd->driveno < 0) /* no current drive? */
+ throw_rude_remark(EINVAL, "Subdisk %s is not associated with a drive", sd->name);
+ }
+ /* Check for a plex name */
+ if ((sd->plexno < 0) /* didn't specify a plex */
+ &&(!detached)) /* and didn't say not to, */
+ sd->plexno = current_plex; /* set to the current plex */
+
+ if (sd->plexno >= 0)
+ sdindex = give_sd_to_plex(sd->plexno, sdno); /* now tell the plex that it has this sd */
+
+ sd->sdno = sdno; /* point to our entry in the table */
+
+ /* Does the subdisk have a name? If not, give it one */
+ if (sd->name[0] == '\0') { /* no name */
+ char sdsuffix[8]; /* form sd name suffix here */
+
+ /* Do we have a plex name? */
+ if (sdindex >= 0) /* we have a plex */
+ strcpy(sd->name, PLEX[sd->plexno].name); /* take it from there */
+ else /* no way */
+ throw_rude_remark(EINVAL, "Unnamed sd is not associated with a plex");
+ sprintf(sdsuffix, ".s%d", sdindex); /* form the suffix */
+ strcat(sd->name, sdsuffix); /* and add it to the name */
+ }
+ /* do we have complete info for this subdisk? */
+ if (sd->sectors == 0)
+ throw_rude_remark(EINVAL, "sd %s has no length spec", sd->name);
+
+ if (sd->state == sd_unallocated) /* no state decided, */
+ sd->state = sd_init; /* at least we're in the game */
+
+ /* register the subdisk with the drive. This action
+ * will have the side effect of setting the offset if
+ * we haven't specified one, and causing an error
+ * message if it overlaps with another subdisk. */
+ give_sd_to_drive(sdno);
+}
+
+/* Handle a plex definition.
+ * If we find an error, print a message, deallocate the nascent plex, and return
+ */
+void
+config_plex(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int plexno; /* index of plex in vinum_conf */
+ struct plex *plex; /* and pointer to it */
+ int pindex = MAXPLEX; /* index in volume's plex list */
+ int detached = 0; /* don't give it to a volume */
+
+ current_plex = -1; /* forget the previous plex */
+ plexno = get_empty_plex(); /* allocate a plex */
+ plex = &PLEX[plexno]; /* and point to it */
+ plex->plexno = plexno; /* and back to the config */
+ for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_detached:
+ detached = 1;
+ break;
+
+ case kw_name:
+ {
+ int namedplexno;
+
+ namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */
+ if (namedplexno >= 0)
+ throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]);
+ }
+ bcopy(token[parameter], /* put in the name */
+ plex->name,
+ min(MAXPLEXNAME, strlen(token[parameter])));
+ break;
+
+ case kw_org: /* plex organization */
+ switch (get_keyword(token[++parameter], &keyword_set)) {
+ case kw_concat:
+ plex->organization = plex_concat;
+ break;
+
+ case kw_striped:
+ {
+ int stripesize = sizespec(token[++parameter]);
+
+ plex->organization = plex_striped;
+ if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */
+ throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size",
+ plex->name,
+ stripesize);
+ else
+ plex->stripesize = stripesize / DEV_BSIZE;
+ break;
+ }
+
+
+ default:
+ throw_rude_remark(EINVAL, "Invalid plex organization");
+ }
+ if (((plex->organization == plex_striped)
+ )
+ && (plex->stripesize == 0)) /* didn't specify a valid stripe size */
+ throw_rude_remark(EINVAL, "Need a stripe size parameter");
+ break;
+
+ case kw_volume:
+ plex->volno = find_volume(token[++parameter], 1); /* insert a pointer to the volume */
+ break;
+
+ case kw_sd: /* add a subdisk */
+ {
+ int sdno;
+
+ sdno = find_subdisk(token[++parameter], 1); /* find a subdisk */
+ SD[sdno].plexoffset = sizespec(token[++parameter]); /* get the offset */
+ give_sd_to_plex(plexno, sdno); /* and insert it there */
+ break;
+ }
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* only for kernel use */
+ plex->state = PlexState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "plex %s, invalid keyword: %s",
+ plex->name,
+ token[parameter]);
+ }
+ }
+
+ if ((plex->volno < 0) /* we don't have a volume */
+ &&(!detached)) /* and we wouldn't object */
+ plex->volno = current_volume;
+
+ if (plex->volno >= 0)
+ pindex = give_plex_to_volume(plex->volno, plexno); /* Now tell the volume that it has this plex */
+
+ /* Does the plex have a name? If not, give it one */
+ if (plex->name[0] == '\0') { /* no name */
+ char plexsuffix[8]; /* form plex name suffix here */
+ /* Do we have a volume name? */
+ if (plex->volno >= 0) /* we have a volume */
+ strcpy(plex->name, /* take it from there */
+ VOL[plex->volno].name);
+ else /* no way */
+ throw_rude_remark(EINVAL, "Unnamed plex is not associated with a volume");
+ sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */
+ strcat(plex->name, plexsuffix); /* and add it to the name */
+ }
+ /* Note the last plex we configured */
+ current_plex = plexno;
+ if (plex->state == plex_unallocated) /* we haven't changed the state, */
+ plex->state = plex_init; /* we're initialized now */
+}
+
+/* Handle a volume definition.
+ * If we find an error, print a message, deallocate the nascent volume, and return
+ */
+void
+config_volume(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int volno;
+ struct volume *vol; /* collect volume info here */
+ int i;
+
+ if (tokens < 2) /* not enough tokens */
+ throw_rude_remark(EINVAL, "Volume has no name");
+ current_volume = -1; /* forget the previous volume */
+ volno = find_volume(token[1], 1); /* allocate a volume to initialize */
+ vol = &VOL[volno]; /* and get a pointer */
+
+ for (parameter = 2; parameter < tokens; parameter++) { /* look at all tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_plex:
+ {
+ int plexno; /* index of this plex */
+
+ plexno = find_plex(token[++parameter], 1); /* find a plex */
+ if (plexno < 0) /* couldn't */
+ break; /* we've already had an error message */
+ plexno = my_plex(volno, plexno); /* does it already belong to us? */
+ if (plexno > 0) /* yes, shouldn't get it again */
+ throw_rude_remark(EINVAL,
+ "Plex %s already belongs to volume %s",
+ token[parameter],
+ vol->name);
+ else if (++vol->plexes > 8) /* another entry */
+ throw_rude_remark(EINVAL,
+ "Too many plexes for volume %s",
+ vol->name);
+ vol->plex[vol->plexes - 1] = plexno;
+ }
+ break;
+
+ case kw_readpol:
+ switch (get_keyword(token[++parameter], &keyword_set)) { /* decide what to do */
+ case kw_round:
+ vol->preferred_plex = ROUND_ROBIN_READPOL; /* default */
+ break;
+
+ case kw_prefer:
+ {
+ int myplexno; /* index of this plex */
+
+ myplexno = find_plex(token[++parameter], 1); /* find a plex */
+ if (myplexno < 0) /* couldn't */
+ break; /* we've already had an error message */
+ myplexno = my_plex(volno, myplexno); /* does it already belong to us? */
+ if (myplexno > 0) /* yes */
+ vol->preferred_plex = myplexno; /* just note the index */
+ else if (++vol->plexes > 8) /* another entry */
+ throw_rude_remark(EINVAL, "Too many plexes");
+ else { /* space for the new plex */
+ vol->plex[vol->plexes - 1] = myplexno; /* add it to our list */
+ vol->preferred_plex = vol->plexes - 1; /* and note the index */
+ }
+ }
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "Invalid read policy");
+ }
+
+ case kw_setupstate:
+ vol->flags |= VF_CONFIG_SETUPSTATE; /* set the volume up later on */
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ vol->state = VolState(token[parameter]); /* set the state */
+ break;
+
+ /* XXX experimental ideas. These are not
+ * documented, and will not be until I
+ * decide they're worth keeping */
+ case kw_writethrough: /* set writethrough mode */
+ vol->flags |= VF_WRITETHROUGH;
+ break;
+
+ case kw_writeback: /* set writeback mode */
+ vol->flags &= ~VF_WRITETHROUGH;
+ break;
+
+ case kw_raw:
+ vol->flags |= VF_RAW; /* raw volume (no label) */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "volume %s, invalid keyword: %s",
+ vol->name,
+ token[parameter]);
+ }
+ }
+
+ current_volume = volno; /* note last referred volume */
+ vol->devno = VINUMBDEV(volno, 0, 0, VINUM_VOLUME_TYPE); /* also note device number */
+
+ /* Before we can actually use the volume, we need
+ * a volume label. We could start to fake one here,
+ * but it will be a lot easier when we have some
+ * to copy from the drives, so defer it until we
+ * set up the configuration. XXX */
+ if (vol->state == volume_unallocated)
+ vol->state = volume_down; /* now ready to bring up at the end */
+
+ /* Find out how big our volume is */
+ for (i = 0; i < vol->plexes; i++)
+ vol->size = max(vol->size, PLEX[vol->plex[i]].length);
+}
+
+/* Parse a config entry. CARE! This destroys the original contents of the
+ * config entry, which we don't really need after this. More specifically, it
+ * places \0 characters at the end of each token.
+ *
+ * Return 0 if all is well, otherwise EINVAL */
+int
+parse_config(char *cptr, struct keywordset *keyset)
+{
+ BROKEN_GDB;
+ int status;
+
+ status = 0; /* until proven otherwise */
+ tokens = tokenize(cptr, token); /* chop up into tokens */
+
+ if (tokens <= 0) /* screwed up or empty line */
+ return tokens; /* give up */
+
+ if (token[0][0] == '#') /* comment line */
+ return 0;
+
+ switch (get_keyword(token[0], keyset)) { /* decide what to do */
+ case kw_read: /* read config from a specified drive */
+ vinum_conf.flags |= VF_KERNELOP | VF_READING_CONFIG; /* kernel operation: reading config */
+ status = check_drive(token[1]); /* check the drive info */
+ vinum_conf.flags &= ~(VF_KERNELOP | VF_READING_CONFIG);
+ if (status != 0) {
+ char *msg = "Can't read configuration from %s";
+ if (status == ENODEV)
+ msg = "No vinum configuration on %s";
+ throw_rude_remark(status, msg, token[1]);
+ }
+ updateconfig(VF_KERNELOP); /* update from kernel space */
+ break;
+
+ case kw_drive:
+ config_drive();
+ break;
+
+ case kw_subdisk:
+ config_subdisk();
+ break;
+
+ case kw_plex:
+ config_plex();
+ break;
+
+ case kw_volume:
+ config_volume();
+ break;
+
+ /* Anything else is invalid in this context */
+ default:
+ throw_rude_remark(EINVAL, /* should we die? */
+ "Invalid configuration information: %s",
+ token[0]);
+ }
+ return status;
+}
+
+/* parse a line handed in from userland via ioctl.
+ * This differs only by the error reporting mechanism:
+ * we return the error indication in the reply to the
+ * ioctl, so we need to set a global static pointer in
+ * this file. This technique works because we have
+ * ensured that configuration is performed in a single-
+ * threaded manner */
+int
+parse_user_config(char *cptr, struct keywordset *keyset)
+{
+ BROKEN_GDB;
+ int status;
+
+ ioctl_reply = (struct _ioctl_reply *) cptr;
+ status = parse_config(cptr, keyset);
+ ioctl_reply = NULL; /* don't do this again */
+ return status;
+}
+
+/* Remove an object */
+void
+remove(struct vinum_ioctl_msg *msg)
+{
+ struct vinum_ioctl_msg message = *msg; /* make a copy to hand on */
+
+ ioctl_reply = (struct _ioctl_reply *) msg; /* reinstate the address to reply to */
+ ioctl_reply->error = 0; /* no error, */
+ ioctl_reply->msg[0] = '\0'; /* no message */
+
+ switch (message.type) {
+ case drive_object:
+ remove_drive_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case sd_object:
+ remove_sd_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case plex_object:
+ remove_plex_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case volume_object:
+ remove_volume_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ }
+}
+
+/* Remove a drive. */
+void
+remove_drive_entry(int driveno, int force, int recurse)
+{
+ struct drive *drive = &DRIVE[driveno];
+
+ if ((driveno > vinum_conf.drives_used) /* not a valid drive */
+ ||(drive->state == drive_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such drive");
+ } else if (drive->opencount > 0) { /* we have subdisks */
+ if (force) { /* do it at any cost */
+ int sdno;
+ struct vinum_ioctl_msg sdmsg;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
+ if ((SD[sdno].state != sd_unallocated) /* subdisk is allocated */
+ &&(SD[sdno].driveno == driveno)) { /* and it belongs to this drive */
+ sdmsg.type = sd_object;
+ sdmsg.recurse = 1;
+ sdmsg.force = force;
+ remove(&sdmsg); /* remove the subdisk by force */
+ }
+ }
+ remove_drive(driveno); /* now remove it */
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ remove_drive(driveno); /* just remove it */
+}
+
+/* remove a subdisk */
+void
+remove_sd_entry(int sdno, int force, int recurse)
+{
+ struct sd *sd = &SD[sdno];
+
+ if ((sdno > vinum_conf.subdisks_used) /* not a valid sd */
+ ||(sd->state == sd_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such subdisk");
+ } else if (sd->plexno >= 0) { /* we have a plex */
+ if (force) { /* do it at any cost */
+ struct plex *plex = &PLEX[sd->plexno]; /* point to our plex */
+ int mysdno;
+
+ for (mysdno = 0; /* look for ourselves */
+ mysdno < plex->subdisks && &SD[plex->sdnos[mysdno]] != sd;
+ mysdno++);
+ if (mysdno == plex->subdisks) /* didn't find it */
+ throw_rude_remark(ENOENT, "plex %s does not contain subdisk %s", plex->name, sd->name);
+ if (mysdno < (plex->subdisks - 1)) /* not the last subdisk */
+ bcopy(&plex->sdnos[mysdno + 1],
+ &plex->sdnos[mysdno],
+ (plex->subdisks - 1 - mysdno) * sizeof(int));
+ plex->subdisks--;
+ /* removing a subdisk from a striped or
+ * RAID-5 plex really tears the hell out
+ * of the structure, and it needs to be
+ * reinitialized */
+ if (plex->organization != plex_concat) /* not concatenated, */
+ set_plex_state(plex->plexno, plex_faulty, setstate_force); /* need to reinitialize */
+ rebuild_plex_unmappedlist(plex); /* and see what remains */
+ free_sd(sdno);
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ free_sd(sdno);
+}
+
+/* remove a plex */
+void
+remove_plex_entry(int plexno, int force, int recurse)
+{
+ struct plex *plex = &PLEX[plexno];
+ int sdno;
+
+ if ((plexno > vinum_conf.plexes_used) /* not a valid plex */
+ ||(plex->state == plex_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such plex");
+ } else if (plex->pid) { /* we're open */
+ ioctl_reply->error = EBUSY; /* no getting around that */
+ return;
+ }
+ if (plex->subdisks) {
+ if (force) { /* do it anyway */
+ if (recurse) { /* remove all below */
+ for (sdno = 0; sdno < plex->subdisks; sdno++)
+ free_sd(plex->sdnos[sdno]); /* free all subdisks */
+ } else { /* just tear them out */
+ for (sdno = 0; sdno < plex->subdisks; sdno++)
+ SD[plex->sdnos[sdno]].plexno = -1; /* no plex any more */
+ }
+ } else { /* can't do it without force */
+ ioctl_reply->error = EBUSY; /* can't do that */
+ return;
+ }
+ }
+ if (plex->volno >= 0) { /* we are part of a volume */
+ /* XXX This should be more intelligent. We should
+ * be able to remove a plex as long as the volume
+ * does not lose any data, which is normally the
+ * case when it has more than one plex. To do it
+ * right we must compare the completeness of the
+ * mapping of all the plexes in the volume */
+ if (force) { /* do it at any cost */
+ struct volume *vol = &VOL[plex->volno];
+ int myplexno;
+
+ for (myplexno = 0; myplexno < vol->plexes; myplexno++)
+ if (vol->plex[myplexno] == plexno) /* found it */
+ break;
+ if (myplexno == vol->plexes) /* didn't find it. Huh? */
+ throw_rude_remark(ENOENT, "volume %s does not contain plex %s", vol->name, plex->name);
+ if (myplexno < (vol->plexes - 1)) /* not the last plex in the list */
+ bcopy(&vol->plex[myplexno + 1], &vol->plex[myplexno], vol->plexes - 1 - myplexno);
+ vol->plexes--;
+ } else {
+ ioctl_reply->error = EBUSY; /* can't do that */
+ return;
+ }
+ }
+ free_plex(plexno);
+}
+
+/* remove a volume */
+void
+remove_volume_entry(int volno, int force, int recurse)
+{
+ struct volume *vol = &VOL[volno];
+ int plexno;
+
+ if ((volno > vinum_conf.volumes_used) /* not a valid volume */
+ ||(vol->state == volume_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such volume");
+ } else if (vol->opencount) /* we're open */
+ ioctl_reply->error = EBUSY; /* no getting around that */
+ else if (vol->plexes) {
+ if (recurse && force) { /* remove all below */
+ struct vinum_ioctl_msg plexmsg;
+
+ plexmsg.type = plex_object;
+ plexmsg.recurse = 1;
+ plexmsg.force = force;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ plexmsg.index = vol->plex[plexno]; /* plex number */
+ remove(&plexmsg);
+ }
+ free_volume(volno);
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ free_volume(volno);
+}
+
+void
+update_sd_config(int sdno, int kernelstate)
+{
+ if (!kernelstate)
+ set_sd_state(sdno, sd_up, setstate_configuring | setstate_norecurse);
+}
+
+void
+update_plex_config(int plexno, int kernelstate)
+{
+ int error = 0;
+ int size;
+ int sdno;
+ struct plex *plex = &PLEX[plexno];
+ enum plexstate state = plex_up; /* state we want the plex in */
+
+ /* XXX Insert checks here for sparse plexes and volumes */
+
+ /* Check that our subdisks make sense. For
+ * striped and RAID5 plexes, we need at least
+ * two subdisks, and they must all be the same
+ * size */
+ if (((plex->organization == plex_striped)
+ )
+ && (plex->subdisks < 2)) {
+ error = 1;
+ printf("vinum: plex %s does not have at least 2 subdisks\n", plex->name);
+ if (!kernelstate)
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
+ }
+ size = 0;
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ if (((plex->organization == plex_striped)
+ )
+ && (sdno > 0)
+ && (SD[plex->sdnos[sdno]].sectors != SD[plex->sdnos[sdno - 1]].sectors)) {
+ error = 1;
+ printf("vinum: plex %s must have equal sized subdisks\n", plex->name);
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
+ }
+ size += SD[plex->sdnos[sdno]].sectors;
+ }
+
+ if (plex->subdisks) { /* plex has subdisks, calculate size */
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list first */
+
+ plex->length = size;
+ } else { /* no subdisks, */
+ plex->length = 0; /* no size */
+ state = plex_down; /* take it down */
+ }
+ if (!(kernelstate || error))
+ set_plex_state(plexno, state, setstate_none | setstate_configuring | setstate_norecurse);
+}
+
+void
+update_volume_config(int volno, int kernelstate)
+{
+ struct volume *vol = &VOL[volno];
+ struct plex *plex;
+ int plexno;
+
+ if (vol->state != volume_unallocated)
+ /* Recalculate the size of the volume */
+ {
+ vol->size = 0;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ plex = &PLEX[vol->plex[plexno]];
+ vol->size = max(plex->length, vol->size); /* maximum size */
+ plex->volplexno = plexno; /* note it in the plex */
+ }
+ }
+ if (!kernelstate) /* try to bring it up */
+ set_volume_state(volno, volume_up, setstate_configuring | setstate_norecurse);
+}
+
+/* Update the global configuration.
+ * kernelstate is != 0 if we're reading in a config
+ * from disk. In this case, we don't try to
+ * bring the devices up, though we will bring
+ * them down if there's some error which got
+ * missed when writing to disk.
+ */
+void
+updateconfig(int kernelstate)
+{
+ BROKEN_GDB;
+ int sdno;
+ int plexno;
+ int volno;
+ struct volume *vol;
+ struct plex *plex;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++)
+ update_sd_config(sdno, kernelstate);
+
+ for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++)
+ update_plex_config(plexno, kernelstate);
+
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++)
+ update_volume_config(volno, kernelstate);
+ save_config();
+}
+
+/* Start manual changes to the configuration and lock out
+ * others who may wish to do so.
+ * XXX why do we need this and lock_config too? */
+int
+start_config(void)
+{
+ int error;
+
+ while ((vinum_conf.flags & VF_CONFIGURING) != 0) {
+ vinum_conf.flags |= VF_WILL_CONFIGURE;
+ if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
+ return error;
+ }
+ /* We need two flags here: VF_CONFIGURING
+ * tells other processes to hold off (this
+ * function), and VF_CONFIG_INCOMPLETE
+ * tells the state change routines not to
+ * propagate incrememntal state changes */
+ vinum_conf.flags |= VF_CONFIGURING | VF_CONFIG_INCOMPLETE;
+ current_drive = -1; /* reset the defaults */
+ current_plex = -1; /* and the same for the last plex */
+ current_volume = -1; /* and the last volme */
+ return 0;
+}
+
+/* Update the config if update is 1, and unlock
+ * it. We won't update the configuration if we
+ * are called in a recursive loop via throw_rude_remark.
+ */
+void
+finish_config(int update)
+{
+ vinum_conf.flags &= ~VF_CONFIG_INCOMPLETE; /* we've finished our config */
+ if (update)
+ updateconfig(0); /* so update things */
+ else
+ updateconfig(1); /* do some updates only */
+ vinum_conf.flags &= ~VF_CONFIGURING; /* and now other people can take a turn */
+ if ((vinum_conf.flags & VF_WILL_CONFIGURE) != 0) {
+ vinum_conf.flags &= ~VF_WILL_CONFIGURE;
+ wakeup(&vinum_conf);
+ }
+}
diff --git a/lkm/vinum/interrupt.c b/lkm/vinum/interrupt.c
new file mode 100644
index 000000000000..e7eb034faf4b
--- /dev/null
+++ b/lkm/vinum/interrupt.c
@@ -0,0 +1,190 @@
+/* interrupt.c: bottom half of the driver */
+
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: interrupt.c,v 1.1 1998/08/13 06:12:27 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+#include <miscfs/specfs/specdev.h>
+#include <sys/resourcevar.h>
+
+void complete_raid5_write(struct rqelement *);
+void freerq(struct request *rq);
+void free_rqg(struct rqgroup *rqg);
+void complete_rqe(struct buf *bp);
+void sdio_done(struct buf *bp);
+
+/* Take a completed buffer, transfer the data back if
+ * it's a read, and complete the high-level request
+ * if this is the last subrequest.
+ *
+ * The bp parameter is in fact a struct rqelement, which
+ * includes a couple of extras at the end.
+ */
+void
+complete_rqe(struct buf *bp)
+{
+ BROKEN_GDB;
+ struct rqelement *rqe;
+ struct request *rq;
+ struct rqgroup *rqg;
+ struct buf *ubp; /* user buffer */
+
+ rqe = (struct rqelement *) bp; /* point to the element element that completed */
+ rqg = rqe->rqg; /* and the request group */
+ rq = rqg->rq; /* and the complete request */
+
+ if ((bp->b_flags & B_ERROR) != 0) { /* transfer in error */
+ if (bp->b_error != 0) /* did it return a number? */
+ rq->error = bp->b_error; /* yes, put it in. */
+ else if (rq->error == 0) /* no: do we have one already? */
+ rq->error = EIO; /* no: catchall "I/O error" */
+ if (rq->error == EIO) /* I/O error, */
+ set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* take the subdisk down */
+ }
+ /* Now update the statistics */
+ if (bp->b_flags & B_READ) { /* read operation */
+ DRIVE[rqe->driveno].reads++;
+ DRIVE[rqe->driveno].bytes_read += bp->b_bcount;
+ SD[rqe->sdno].reads++;
+ SD[rqe->sdno].bytes_read += bp->b_bcount;
+ PLEX[rqe->rqg->plexno].reads++;
+ PLEX[rqe->rqg->plexno].bytes_read += bp->b_bcount;
+ } else { /* write operation */
+ DRIVE[rqe->driveno].writes++;
+ DRIVE[rqe->driveno].bytes_written += bp->b_bcount;
+ SD[rqe->sdno].writes++;
+ SD[rqe->sdno].bytes_written += bp->b_bcount;
+ PLEX[rqe->rqg->plexno].writes++;
+ PLEX[rqe->rqg->plexno].bytes_written += bp->b_bcount;
+ }
+ ubp = rq->bp; /* user buffer */
+ rqg->active--; /* one less request active */
+ if (rqg->active == 0) /* request group finished, */
+ rq->active--; /* one less */
+ if (rq->active == 0) { /* request finished, */
+#if DEBUG
+ if (debug & 4) {
+ if (ubp->b_resid != 0) /* still something to transfer? */
+ Debugger("resid");
+
+ {
+ int i;
+ for (i = 0; i < ubp->b_bcount; i += 512) /* XXX debug */
+ if (((char *) ubp->b_data)[i] != '<') { /* and not what we expected */
+ printf("At 0x%x (offset 0x%x): '%c' (0x%x)\n",
+ (int) (&((char *) ubp->b_data)[i]),
+ i,
+ ((char *) ubp->b_data)[i],
+ ((char *) ubp->b_data)[i]);
+ Debugger("complete_request checksum");
+ }
+ }
+ }
+#endif
+
+ if (rq->error) { /* did we have an error? */
+ ubp->b_flags |= B_ERROR; /* yes, propagate to user */
+ ubp->b_error = rq->error;
+ } else
+ ubp->b_resid = 0; /* completed our transfer */
+ if (rq->isplex == 0) /* volume request, */
+ VOL[rq->volplex.volno].active--; /* another request finished */
+ biodone(ubp); /* top level buffer completed */
+ freerq(rq); /* return the request storage */
+ }
+}
+
+
+/* Free a request block and anything hanging off it */
+void
+freerq(struct request *rq)
+{
+ BROKEN_GDB;
+ struct rqgroup *rqg;
+ struct rqgroup *nrqg; /* next in chain */
+ int rqno;
+
+ for (rqg = rq->rqg; rqg != NULL; rqg = nrqg) { /* through the whole request chain */
+ for (rqno = 0; rqno < rqg->count; rqno++)
+ if ((rqg->rqe[rqno].flags & XFR_MALLOCED) /* data buffer was malloced, */
+ &&rqg->rqe[rqno].b.b_data) /* and the allocation succeeded */
+ Free(rqg->rqe[rqno].b.b_data); /* free it */
+ nrqg = rqg->next; /* note the next one */
+ Free(rqg); /* and free this one */
+ }
+ Free(rq); /* free the request itself */
+}
+
+void
+free_rqg(struct rqgroup *rqg)
+{
+ if ((rqg->flags & XFR_GROUPOP) /* RAID 5 request */
+ &&(rqg->rqe) /* got a buffer structure */
+ &&(rqg->rqe->b.b_data)) /* and it has a buffer allocated */
+ Free(rqg->rqe->b.b_data); /* free it */
+}
+
+/* I/O on subdisk completed */
+void
+sdio_done(struct buf *bp)
+{
+ struct sdbuf *sbp;
+
+ sbp = (struct sdbuf *) bp;
+ if (sbp->b.b_flags & B_ERROR) { /* had an error */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = sbp->b.b_error;
+ }
+ bp->b_resid = sbp->b.b_resid;
+ biodone(sbp->bp); /* complete the caller's I/O */
+ /* Now update the statistics */
+ if (bp->b_flags & B_READ) { /* read operation */
+ DRIVE[sbp->driveno].reads++;
+ DRIVE[sbp->driveno].bytes_read += bp->b_bcount;
+ SD[sbp->sdno].reads++;
+ SD[sbp->sdno].bytes_read += bp->b_bcount;
+ } else { /* write operation */
+ DRIVE[sbp->driveno].writes++;
+ DRIVE[sbp->driveno].bytes_written += bp->b_bcount;
+ SD[sbp->sdno].writes++;
+ SD[sbp->sdno].bytes_written += bp->b_bcount;
+ }
+ Free(sbp);
+}
diff --git a/lkm/vinum/io.c b/lkm/vinum/io.c
new file mode 100644
index 000000000000..a16a33a9e8bc
--- /dev/null
+++ b/lkm/vinum/io.c
@@ -0,0 +1,886 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: io.c,v 1.16 1998/08/10 23:47:21 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#if __FreeBSD__ < 3 /* this is in sys/disklabel.h in 3.0 and on */
+#define DTYPE_VINUM 12 /* vinum volume */
+#endif
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include <miscfs/specfs/specdev.h>
+
+extern jmp_buf command_fail; /* return on a failed command */
+struct _ioctl_reply *ioctl_reply; /* data pointer, for returning error messages */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
+
+/* Open the device associated with the drive, and set drive's vp */
+int
+open_drive(struct drive *drive, struct proc *p)
+{
+ BROKEN_GDB;
+ struct nameidata nd;
+ struct vattr va;
+ int error;
+
+ if (drive->devicename[0] == '\0') /* no device name */
+ sprintf(drive->devicename, "/dev/%s", drive->label.name); /* get it from the drive name */
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, drive->devicename, p);
+ error = vn_open(&nd, FREAD | FWRITE, 0); /* open the device */
+ if (error != 0) { /* can't open? */
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = error;
+ printf("vinum open_drive %s: failed with error %d\n", drive->devicename, error); /* XXX */
+ return error;
+ }
+ drive->vp = nd.ni_vp;
+ drive->p = p;
+
+ if (drive->vp->v_usecount > 1) { /* already in use? */
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = EBUSY;
+ printf("vinum open_drive %s: Drive in use\n", drive->devicename); /* XXX */
+ return EBUSY;
+ }
+ error = VOP_GETATTR(drive->vp, &va, NOCRED, p);
+ if (error) {
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = error;
+ printf("vinum open_drive %s: GETAATTR returns error %d\n", drive->devicename, error); /* XXX */
+ return error;
+ }
+ drive->dev = va.va_rdev; /* device */
+
+ if (va.va_type != VBLK) { /* only consider block devices */
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1); /* this also closes the drive */
+ drive->lasterror = ENOTBLK;
+ printf("vinum open_drive %s: Not a block device\n", drive->devicename); /* XXX */
+ return ENOTBLK;
+ }
+ drive->vp->v_numoutput = 0;
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ return 0;
+}
+
+/* Set some variables in the drive struct
+ * in more convenient form. Return error indication */
+int
+set_drive_parms(struct drive *drive)
+{
+ drive->blocksize = BLKDEV_IOSIZE; /* XXX do we need this? */
+ drive->secsperblock = drive->blocksize /* number of sectors per block */
+ / drive->partinfo.disklab->d_secsize;
+
+ /* Now update the label part */
+ bcopy(hostname, drive->label.sysname, VINUMHOSTNAMELEN); /* put in host name */
+#if __FreeBSD__ >= 3
+ getmicrotime(&drive->label.date_of_birth); /* and current time */
+#else
+ drive->label.date_of_birth = time; /* and current time */
+#endif
+ drive->label.drive_size = ((u_int64_t) drive->partinfo.part->p_size) /* size of the drive in bytes */
+ *((u_int64_t) drive->partinfo.disklab->d_secsize);
+
+ /* number of sectors available for subdisks */
+ drive->sectors_available = drive->label.drive_size / DEV_BSIZE - DATASTART;
+
+ /* XXX Bug in 3.0 as of January 1998: you can open
+ * non-existent slices. They have a length of 0 */
+ if (drive->label.drive_size < MINVINUMSLICE) { /* too small to worry about */
+ set_drive_state(drive->driveno, drive_down, 1);
+ printf("vinum open_drive %s: Drive too small\n", drive->devicename); /* XXX */
+ drive->lasterror = ENOSPC;
+ return ENOSPC;
+ }
+ drive->freelist_size = INITIAL_DRIVE_FREELIST; /* initial number of entries */
+ drive->freelist = (struct drive_freelist *)
+ Malloc(INITIAL_DRIVE_FREELIST * sizeof(struct drive_freelist));
+ if (drive->freelist == NULL) /* can't malloc, dammit */
+ return ENOSPC;
+ drive->freelist_entries = 1; /* just (almost) the complete drive */
+ drive->freelist[0].offset = DATASTART; /* starts here */
+ drive->freelist[0].sectors = (drive->label.drive_size >> DEV_BSHIFT) - DATASTART; /* and it's this long */
+ set_drive_state(drive->driveno, drive_up, 1); /* our drive is accessible */
+ return 0;
+}
+
+/* Initialize a drive: open the device and add device
+ * information */
+int
+init_drive(struct drive *drive)
+{
+ BROKEN_GDB;
+ int error;
+
+ if (drive->devicename[0] == '\0') { /* no device name yet, default to drive name */
+ drive->lasterror = EINVAL;
+ printf("vinum: Can't open drive without drive name\n"); /* XXX */
+ return EINVAL;
+ }
+ error = open_drive(drive, myproc); /* open the drive */
+ if (error)
+ return error;
+
+ error = VOP_IOCTL(drive->vp, /* get the partition information */
+ DIOCGPART,
+ (caddr_t) & drive->partinfo,
+ FREAD,
+ NOCRED,
+ myproc);
+ if (error) {
+ printf("vinum open_drive %s: Can't get partition information, error %d\n",
+ drive->devicename,
+ error); /* XXX */
+ close_drive(drive);
+ drive->lasterror = error;
+ set_drive_state(drive->driveno, drive_down, 1);
+ return error;
+ }
+ if (drive->partinfo.part->p_fstype != 0) { /* not plain */
+ drive->lasterror = EFTYPE;
+ printf("vinum open_drive %s: Wrong partition type for vinum\n", drive->devicename); /* XXX */
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ return EFTYPE;
+ }
+ return set_drive_parms(drive); /* set various odds and ends */
+}
+
+/* Close a drive if it's open. No errors */
+void
+close_drive(struct drive *drive)
+{
+ if (drive->vp) {
+ vn_close(drive->vp, FREAD | FWRITE, NOCRED, drive->p);
+ drive->vp = NULL;
+ }
+}
+
+/* Remove drive from the configuration.
+ * Caller must ensure that it isn't active
+ */
+void
+remove_drive(int driveno)
+{
+ BROKEN_GDB;
+ struct drive *drive = &vinum_conf.drive[driveno];
+ long long int nomagic = VINUM_NOMAGIC; /* no magic number */
+
+ write_drive(drive, /* obliterate the magic, but leave a hint */
+ (char *) &nomagic,
+ 8,
+ VINUM_LABEL_OFFSET);
+ close_drive(drive); /* and close it */
+ drive->state = drive_unallocated; /* and forget everything we knew about it */
+ save_config(); /* and save the updated configuration */
+}
+
+/* Transfer drive data. Usually called from one of these defines;
+
+ * #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
+ * #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE)
+ *
+ * Return error number
+ */
+int
+driveio(struct drive *drive, void *buf, size_t length, off_t offset, int flag)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ int spl;
+
+ error = 0;
+
+ /* Get a buffer */
+ bp = (struct buf *) Malloc(sizeof(struct buf)); /* get a buffer */
+ CHECKALLOC(bp, "Can't allocate memory");
+
+ bzero(&buf, sizeof(buf));
+ bp->b_flags = B_BUSY | flag; /* tell us when it's done */
+ bp->b_iodone = drive_io_done; /* here */
+ bp->b_proc = myproc; /* process */
+ bp->b_dev = drive->vp->v_un.vu_specinfo->si_rdev; /* device */
+ if (offset & (drive->partinfo.disklab->d_secsize - 1)) /* not on a block boundary */
+ bp->b_blkno = offset / drive->partinfo.disklab->d_secsize; /* block number */
+ bp->b_data = buf;
+ bp->b_vp = drive->vp; /* vnode */
+ bp->b_bcount = length;
+ bp->b_bufsize = length;
+
+ (*bdevsw[major(bp->b_dev)]->d_strategy) (bp); /* initiate the transfer */
+
+ spl = splbio();
+ while ((bp->b_flags & B_DONE) == 0) {
+ bp->b_flags |= B_CALL; /* wake me again */
+ tsleep((caddr_t) bp, PRIBIO, "driveio", 0); /* and wait for it to complete */
+ }
+ splx(spl);
+ if (bp->b_flags & B_ERROR) /* didn't work */
+ error = bp->b_error; /* get the error return */
+ Free(bp); /* then return the buffer */
+ return error;
+}
+
+/* Read data from a drive
+
+ * Return error number
+ */
+int
+read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ daddr_t nextbn;
+ long bscale;
+
+ struct uio uio;
+ struct iovec iov;
+ daddr_t blocknum; /* block number */
+ int blockoff; /* offset in block */
+ int count; /* amount to transfer */
+
+ iov.iov_base = buf;
+ iov.iov_len = length;
+
+ uio.uio_iov = &iov;
+ uio.uio_iovcnt = length;
+ uio.uio_offset = offset;
+ uio.uio_resid = length;
+ uio.uio_segflg = UIO_SYSSPACE;
+ uio.uio_rw = UIO_READ;
+ uio.uio_procp = myproc;
+
+ bscale = btodb(drive->blocksize); /* mask off offset from block number */
+ do {
+ blocknum = btodb(uio.uio_offset) & ~(bscale - 1); /* get the block number */
+ blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
+ count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
+ uio.uio_resid);
+
+ /* XXX Check this. I think the test is wrong */
+ if (drive->vp->v_lastr + bscale == blocknum) { /* did our last read finish in this block? */
+ nextbn = blocknum + bscale; /* note the end of the transfer */
+ error = breadn(drive->vp, /* and read with read-ahead */
+ blocknum,
+ (int) drive->blocksize,
+ &nextbn,
+ (int *) &drive->blocksize,
+ 1,
+ NOCRED,
+ &bp);
+ } else /* random read: just read this block */
+ error = bread(drive->vp, blocknum, (int) drive->blocksize, NOCRED, &bp);
+ drive->vp->v_lastr = blocknum; /* note the last block we read */
+ count = min(count, drive->blocksize - bp->b_resid);
+ if (error) {
+ brelse(bp);
+ return error;
+ }
+ error = uiomove((char *) bp->b_data + blockoff, count, &uio); /* move the data */
+ brelse(bp);
+ }
+ while (error == 0 && uio.uio_resid > 0 && count != 0);
+ return error;
+}
+
+/* Write data to a drive
+
+ * Return error number
+ */
+int
+write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ struct uio uio;
+ struct iovec iov;
+ daddr_t blocknum; /* block number */
+ int blockoff; /* offset in block */
+ int count; /* amount to transfer */
+ int blockshift;
+
+ if (drive->state == drive_down) /* currently down */
+ return 0; /* ignore */
+ if (drive->vp == NULL) {
+ drive->lasterror = ENODEV;
+ return ENODEV; /* not configured yet */
+ }
+ iov.iov_base = buf;
+ iov.iov_len = length;
+
+ uio.uio_iov = &iov;
+ uio.uio_iovcnt = length;
+ uio.uio_offset = offset;
+ uio.uio_resid = length;
+ uio.uio_segflg = UIO_SYSSPACE;
+ uio.uio_rw = UIO_WRITE;
+ uio.uio_procp = myproc;
+
+ error = 0;
+ blockshift = btodb(drive->blocksize) - 1; /* amount to shift block number
+ * to get sector number */
+ do {
+ blocknum = btodb(uio.uio_offset) & ~blockshift; /* get the block number */
+ blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
+ count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
+ uio.uio_resid);
+ if (count == drive->blocksize) /* the whole block */
+ bp = getblk(drive->vp, blocknum, drive->blocksize, 0, 0); /* just get it */
+ else /* partial block: */
+ error = bread(drive->vp, /* read it first */
+ blocknum,
+ drive->blocksize,
+ NOCRED,
+ &bp);
+ count = min(count, drive->blocksize - bp->b_resid); /* how much will we transfer now? */
+ if (error == 0)
+ error = uiomove((char *) bp->b_data + blockoff, /* move the data to the block */
+ count,
+ &uio);
+ if (error) {
+ brelse(bp);
+ drive->lasterror = error;
+ switch (error) {
+ case EIO:
+ set_drive_state(drive->driveno, drive_down, 1);
+ break;
+
+ /* XXX Add other possibilities here */
+ default:
+ }
+ return error;
+ }
+ if (count + blockoff == drive->blocksize)
+ /* The transfer goes to the end of the block. There's
+ * no need to wait for any more data to arrive. */
+ bawrite(bp); /* start the write now */
+ else
+ bdwrite(bp); /* do a delayed write */
+ }
+ while (error == 0 && uio.uio_resid > 0 && count != 0);
+ if (error)
+ drive->lasterror = error;
+ return error; /* OK */
+}
+
+/* Wake up on completion */
+void
+drive_io_done(struct buf *bp)
+{
+ BROKEN_GDB;
+ wakeup((caddr_t) bp); /* Wachet auf! */
+ bp->b_flags &= ~B_CALL; /* don't do this again */
+}
+
+/* Check a drive for a vinum header. If found,
+ * update the drive information. We come here
+ * with a partially populated drive structure
+ * which includes the device name.
+ *
+ * Return information on what we found
+ */
+enum drive_label_info
+read_drive_label(struct drive *drive)
+{
+ BROKEN_GDB;
+ int error;
+ int result; /* result of our search */
+ struct vinum_hdr *vhdr; /* and as header */
+
+ error = init_drive(drive); /* find the drive */
+ if (error) /* find the drive */
+ return DL_CANT_OPEN; /* not ours */
+
+ vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* allocate buffers */
+ CHECKALLOC(vhdr, "Can't allocate memory");
+
+ error = read_drive(drive, (void *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
+ if (vhdr->magic == VINUM_MAGIC) { /* ours! */
+ if (drive->label.name[0] /* we have a name for this drive */
+ &&(strcmp(drive->label.name, vhdr->label.name))) { /* but it doesn't match the real name */
+ drive->lasterror = EINVAL;
+ result = DL_WRONG_DRIVE; /* it's the wrong drive */
+ } else {
+ set_drive_parms(drive); /* and set other parameters */
+ result = DL_OURS;
+ }
+ /* We copy the drive anyway so that we have
+ * the correct name in the drive info. This
+ * may not be the name specified */
+ drive->label = vhdr->label; /* put in the label information */
+ } else if (vhdr->magic == VINUM_NOMAGIC) /* was ours, but we gave it away */
+ result = DL_DELETED_LABEL;
+ else
+ result = DL_NOT_OURS; /* we could have it, but we don't yet */
+ Free(vhdr); /* that's all. */
+ return result;
+}
+
+/* Check a drive for a vinum header. If found,
+ * read configuration information from the drive and
+ * incorporate the data into the configuration.
+ *
+ * Return error number
+ */
+int
+check_drive(char *drivename)
+{
+ BROKEN_GDB;
+ int error;
+ struct nameidata nd; /* mount point credentials */
+ char *config_text; /* read the config info from disk into here */
+ volatile char *cptr; /* pointer into config information */
+ char *eptr; /* end pointer into config information */
+ int driveno;
+ struct drive *drive;
+ char *config_line; /* copy the config line to */
+
+ driveno = find_drive_by_dev(drivename, 1); /* doesn't exist, create it */
+ drive = &vinum_conf.drive[driveno]; /* and get a pointer */
+ strcpy(drive->devicename, drivename); /* put in device name */
+
+ if (read_drive_label(drive) == DL_OURS) { /* ours! */
+ config_text = (char *) Malloc(MAXCONFIG * 2); /* allocate buffers */
+ CHECKALLOC(config_text, "Can't allocate memory");
+ config_line = (char *) Malloc(MAXCONFIGLINE * 2); /* allocate buffers */
+ CHECKALLOC(config_line, "Can't allocate memory");
+
+ /* Read in both copies of the configuration information */
+ error = read_drive(drive, config_text, MAXCONFIG * 2, VINUM_CONFIG_OFFSET);
+
+ if (error != 0) {
+ printf("vinum: Can't read device %s, error %d\n", drive->devicename, error);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return error;
+ }
+ /* XXX At this point, check that the two copies are the same, and do something useful if not.
+ * In particular, consider which is newer, and what this means for the integrity of the
+ * data on the drive */
+
+ /* Parse the configuration, and add it to the global configuration */
+ for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */
+ volatile int parse_status; /* return value from parse_config */
+
+ for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */
+ *eptr++ = *cptr++;
+ *eptr = '\0'; /* and delimit */
+ if (setjmp(command_fail) == 0) { /* come back here on error and continue */
+ parse_status = parse_config(config_line, &keyword_set); /* parse the config line */
+ if (parse_status < 0) { /* error in config */
+ /* This config should have been parsed in user
+ * space. If we run into problems here, something
+ * serious is afoot. Complain and let the user
+ * snarf the config to see what's wrong */
+ printf("vinum: Config error on drive %s, aborting integration\n", nd.ni_dirp);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return EINVAL;
+ }
+ }
+ while (*cptr == '\n')
+ cptr++; /* skip to next line */
+ }
+ Free(config_text);
+ if ((vinum_conf.flags & VF_READING_CONFIG) == 0) /* not reading config */
+ updateconfig(0); /* update object states */
+ printf("vinum: read configuration from %s\n", drivename);
+ return 0; /* it all worked */
+ } else { /* no vinum label found */
+ if (drive->lasterror) {
+ set_drive_state(drive->driveno, drive_down, 1);
+ return drive->lasterror;
+ } else
+ return ENODEV; /* not our device */
+ }
+}
+
+/* Kludge: kernel printf doesn't handle longs correctly XXX */
+static char *lltoa(long long l, char *s);
+static char *sappend(char *txt, char *s);
+
+static char *
+lltoa(long long l, char *s)
+{
+ if (l < 0) {
+ *s++ = '-';
+ l = -l;
+ }
+ if (l > 9) {
+ s = lltoa(l / 10, s);
+ l %= 10;
+ }
+ *s++ = l + '0';
+ return s;
+}
+
+static char *
+sappend(char *txt, char *s)
+{
+ while (*s++ = *txt++);
+ return s - 1;
+}
+
+/* Format the configuration in text form into the buffer
+ * at config. Don't go beyond len bytes
+ * XXX this stinks. Fix soon. */
+void
+format_config(char *config, int len)
+{
+ BROKEN_GDB;
+ int i;
+ int j;
+ char *s = config;
+
+ bzero(config, len);
+
+ /* First write the drive configuration */
+ for (i = 0; i < vinum_conf.drives_used; i++) {
+ struct drive *drive;
+
+ drive = &vinum_conf.drive[i];
+ if (drive->state != drive_unallocated) {
+ sprintf(s,
+ "drive %s state %s device %s\n",
+ drive->label.name,
+ drive_state(drive->state),
+ drive->devicename);
+ while (*s)
+ s++; /* find the end */
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* Then the volume configuration */
+ for (i = 0; i < vinum_conf.volumes_used; i++) {
+ struct volume *vol;
+
+ vol = &vinum_conf.volume[i];
+ if (vol->state != volume_unallocated) {
+ if (vol->preferred_plex >= 0) /* preferences, */
+ sprintf(s,
+ "volume %s state %s readpol prefer %s",
+ vol->name,
+ volume_state(vol->state),
+ vinum_conf.plex[vol->preferred_plex].name);
+ else /* default round-robin */
+ sprintf(s,
+ "volume %s state %s",
+ vol->name,
+ volume_state(vol->state));
+ while (*s)
+ s++; /* find the end */
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* Then the plex configuration */
+ for (i = 0; i < vinum_conf.plexes_used; i++) {
+ struct plex *plex;
+
+ plex = &vinum_conf.plex[i];
+ if (plex->state != plex_unallocated) {
+ sprintf(s, "plex name %s state %s org %s ",
+ plex->name,
+ plex_state(plex->state),
+ plex_org(plex->organization));
+ while (*s)
+ s++; /* find the end */
+ if ((plex->organization == plex_striped)
+ ) {
+ sprintf(s, "%db ", (int) plex->stripesize);
+ while (*s)
+ s++; /* find the end */
+ }
+ if (plex->volno >= 0) /* we have a volume */
+ sprintf(s, "vol %s ", vinum_conf.volume[plex->volno].name);
+ while (*s)
+ s++; /* find the end */
+ for (j = 0; j < plex->subdisks; j++) {
+ sprintf(s, " sd %s", vinum_conf.sd[plex->sdnos[j]].name);
+ }
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* And finally the subdisk configuration */
+ for (i = 0; i < vinum_conf.subdisks_used; i++) {
+ struct sd *sd = &vinum_conf.sd[i]; /* XXX */
+ if (vinum_conf.sd[i].state != sd_unallocated) {
+ sprintf(s,
+ "sd name %s drive %s plex %s state %s len ",
+ sd->name,
+ vinum_conf.drive[sd->driveno].label.name,
+ vinum_conf.plex[sd->plexno].name,
+ sd_state(sd->state));
+ while (*s)
+ s++; /* find the end */
+ s = lltoa(sd->sectors, s);
+ s = sappend("b driveoffset ", s);
+ s = lltoa(sd->driveoffset, s);
+ s = sappend("b plexoffset ", s);
+ s = lltoa(sd->plexoffset, s);
+ s = sappend("b\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+}
+
+/* Write the configuration to all vinum slices */
+int
+save_config(void)
+{
+ BROKEN_GDB;
+ int error;
+ int written_config; /* set when we firstnwrite the config to disk */
+ int driveno;
+ struct drive *drive; /* point to current drive info */
+ struct vinum_hdr *vhdr; /* and as header */
+ char *config; /* point to config data */
+ int wlabel_on; /* to set writing label on/off */
+
+ /* don't save the configuration while we're still working on it */
+ if (vinum_conf.flags & VF_CONFIGURING)
+ return 0;
+ written_config = 0; /* no config written yet */
+ /* Build a volume header */
+ vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* get space for the config data */
+ CHECKALLOC(vhdr, "Can't allocate config data");
+ vhdr->magic = VINUM_MAGIC; /* magic number */
+ vhdr->config_length = MAXCONFIG; /* length of following config info */
+
+ config = Malloc(MAXCONFIG); /* get space for the config data */
+ CHECKALLOC(config, "Can't allocate config data");
+
+ format_config(config, MAXCONFIG);
+ error = 0; /* no errors yet */
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &vinum_conf.drive[driveno]; /* point to drive */
+
+ if (drive->state != drive_down) {
+#if (__FreeBSD__ >= 3)
+ getmicrotime(&drive->label.last_update); /* time of last update is now */
+#else
+ drive->label.last_update = time; /* time of last update is now */
+#endif
+ bcopy((char *) &drive->label, /* and the label info from the drive structure */
+ (char *) &vhdr->label,
+ sizeof(vhdr->label));
+ if ((drive->state != drive_unallocated)
+ && (drive->state != drive_uninit)) {
+ wlabel_on = 1; /* enable writing the label */
+ error = VOP_IOCTL(drive->vp, /* make the label writeable */
+ DIOCWLABEL,
+ (caddr_t) & wlabel_on,
+ FWRITE,
+ NOCRED,
+ myproc);
+ if (error == 0)
+ error = write_drive(drive, vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
+ if (error == 0)
+ error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET);
+ wlabel_on = 0; /* enable writing the label */
+ VOP_IOCTL(drive->vp, /* make the label non-writeable again */
+ DIOCWLABEL,
+ (caddr_t) & wlabel_on,
+ FWRITE,
+ NOCRED,
+ myproc);
+ if (error) {
+ printf("vinum: Can't write config to %s, error %d\n", drive->devicename, error);
+ set_drive_state(drive->driveno, drive_down, 1);
+ } else
+ written_config = 1; /* we've written it on at least one drive */
+ }
+ }
+ }
+ Free(vhdr);
+ Free(config);
+ return written_config == 0; /* return 1 if we failed to write config */
+}
+
+/* Disk labels are a mess. The correct way to access them
+ * is with the DIOC[GSW]DINFO ioctls, but some programs, such
+ * as newfs, access the disk directly, so we have to write
+ * things there. We do this only on request. If a user
+ * request tries to read it directly, we fake up one on the fly.
+ */
+
+/* get_volume_label returns a label structure to lp, which
+ * is allocated by the caller */
+void
+get_volume_label(struct volume *vol, struct disklabel *lp)
+{
+ bzero(lp, sizeof(struct disklabel));
+
+ strncpy(lp->d_typename, "vinum", sizeof(lp->d_typename));
+ lp->d_type = DTYPE_VINUM;
+ strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
+ lp->d_rpm = 14400 * vol->plexes; /* to keep them guessing */
+ lp->d_interleave = 1;
+ lp->d_flags = 0;
+
+ /* Fitting unto the vine, a vinum has a single
+ * track with all its sectors */
+ lp->d_secsize = DEV_BSIZE; /* bytes per sector */
+ lp->d_nsectors = vol->size; /* data sectors per track */
+ lp->d_ntracks = 1; /* tracks per cylinder */
+ lp->d_ncylinders = 1; /* data cylinders per unit */
+ lp->d_secpercyl = vol->size; /* data sectors per cylinder */
+ lp->d_secperunit = vol->size; /* data sectors per unit */
+
+ lp->d_bbsize = BBSIZE;
+ lp->d_sbsize = SBSIZE;
+
+ lp->d_magic = DISKMAGIC;
+ lp->d_magic2 = DISKMAGIC;
+
+ /* Set up partitions a, b and c to be identical
+ * and the size of the volume. a is UFS, b is
+ * swap, c is nothing */
+ lp->d_partitions[0].p_size = vol->size;
+ lp->d_partitions[0].p_fsize = 1024;
+ lp->d_partitions[0].p_fstype = FS_BSDFFS; /* FreeBSD File System :-) */
+ lp->d_partitions[0].p_fsize = 1024; /* FS fragment size */
+ lp->d_partitions[0].p_frag = 8; /* and fragments per block */
+ lp->d_partitions[SWAP_PART].p_size = vol->size;
+ lp->d_partitions[SWAP_PART].p_fstype = FS_SWAP; /* swap partition */
+ lp->d_partitions[LABEL_PART].p_size = vol->size;
+ lp->d_npartitions = LABEL_PART + 1;
+ strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
+ lp->d_checksum = dkcksum(lp);
+}
+
+int
+write_volume_label(int volno)
+{
+ struct disklabel *lp;
+ struct buf *bp;
+ struct disklabel *dlp;
+ struct volume *vol;
+ int error;
+
+ lp = (struct disklabel *) Malloc((sizeof(struct disklabel) + (DEV_BSIZE - 1)) & (DEV_BSIZE - 1));
+ if (lp == 0)
+ return ENOMEM;
+
+ if ((unsigned) (volno) >= (unsigned) vinum_conf.volumes_used) /* invalid volume */
+ return ENOENT;
+
+ vol = &VOL[volno]; /* volume in question */
+ if (vol->state == volume_unallocated) /* nothing there */
+ return ENOENT;
+
+ get_volume_label(vol, lp); /* get the label */
+
+ /* Now write to disk. This code is derived from the
+ * system writedisklabel (), which does silly things
+ * like reading the label and refusing to write
+ * unless it's already there. */
+ bp = geteblk((int) lp->d_secsize); /* get a buffer */
+ bp->b_dev = minor(vol->devno) | (CDEV_MAJOR << MAJORDEV_SHIFT); /* our own raw volume */
+ bp->b_blkno = LABELSECTOR * ((int) lp->d_secsize / DEV_BSIZE);
+ bp->b_bcount = lp->d_secsize;
+ bzero(bp->b_data, lp->d_secsize);
+ dlp = (struct disklabel *) bp->b_data;
+ *dlp = *lp;
+ bp->b_flags &= ~B_INVAL;
+ bp->b_flags |= B_BUSY | B_WRITE;
+ vinumstrategy(bp); /* write it out */
+ error = biowait(bp);
+ bp->b_flags |= B_INVAL | B_AGE;
+ brelse(bp);
+ return error;
+}
+
+/* Initialize a subdisk */
+int
+initsd(int sdno)
+{
+ return 0;
+}
diff --git a/lkm/vinum/lock.c b/lkm/vinum/lock.c
new file mode 100644
index 000000000000..ed69649fccdc
--- /dev/null
+++ b/lkm/vinum/lock.c
@@ -0,0 +1,137 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: lock.c,v 1.6 1998/07/28 06:32:57 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+
+/* Lock routines. Currently, we lock either an individual volume
+ * or the global configuration. I don't think tsleep and
+ * wakeup are SMP safe. FIXME XXX */
+
+/* Lock a volume, wait if it's in use */
+int
+lockvol(struct volume *vol)
+{
+ int error;
+
+ while ((vol->flags & VF_LOCKED) != 0) {
+ vol->flags |= VF_LOCKING;
+ /* It would seem to make more sense to sleep on
+ * the address 'vol'. Unfortuntaly we can't
+ * guarantee that this address won't change due to
+ * table expansion. The address we choose won't change. */
+ if ((error = tsleep(&vinum_conf.volume + vol->devno,
+ PRIBIO | PCATCH,
+ "volock",
+ 0)) != 0)
+ return error;
+ }
+ vol->flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock a volume and let the next one at it */
+void
+unlockvol(struct volume *vol)
+{
+ vol->flags &= ~VF_LOCKED;
+ if ((vol->flags & VF_LOCKING) != 0) {
+ vol->flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf.volume + vol->devno);
+ }
+}
+
+/* Lock a plex, wait if it's in use */
+int
+lockplex(struct plex *plex)
+{
+ int error;
+
+ while ((plex->flags & VF_LOCKED) != 0) {
+ plex->flags |= VF_LOCKING;
+ /* It would seem to make more sense to sleep on
+ * the address 'plex'. Unfortuntaly we can't
+ * guarantee that this address won't change due to
+ * table expansion. The address we choose won't change. */
+ if ((error = tsleep(&vinum_conf.plex + plex->sdnos[0],
+ PRIBIO | PCATCH,
+ "plexlk",
+ 0)) != 0)
+ return error;
+ }
+ plex->flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock a plex and let the next one at it */
+void
+unlockplex(struct plex *plex)
+{
+ plex->flags &= ~VF_LOCKED;
+ if ((plex->flags & VF_LOCKING) != 0) {
+ plex->flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf.plex + plex->plexno);
+ }
+}
+
+
+/* Get a lock for the global config, wait if it's not available */
+int
+lock_config(void)
+{
+ int error;
+
+ while ((vinum_conf.flags & VF_LOCKED) != 0) {
+ vinum_conf.flags |= VF_LOCKING;
+ if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
+ return error;
+ }
+ vinum_conf.flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock and wake up any waiters */
+void
+unlock_config(void)
+{
+ vinum_conf.flags &= ~VF_LOCKED;
+ if ((vinum_conf.flags & VF_LOCKING) != 0) {
+ vinum_conf.flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf);
+ }
+}
diff --git a/lkm/vinum/makestatetext b/lkm/vinum/makestatetext
new file mode 100755
index 000000000000..ca5eb2dc3c3d
--- /dev/null
+++ b/lkm/vinum/makestatetext
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Make statetexts.h from vinumstate.h
+# $Id: makestatetext,v 1.4 1998/03/13 05:36:16 grog Exp grog $
+infile=vinumstate.h
+ofile=statetexts.h
+cat <COPYRIGHT > $ofile
+
+echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
+echo >>$ofile
+echo >>$ofile "/* Drive state texts */"
+echo >>$ofile "char *drivestatetext [] =
+ { "
+egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Subdisk state texts */
+char *sdstatetext [] =
+ {
+FOO
+egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Plex state texts */
+char *plexstatetext [] =
+ {
+FOO
+egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Volume state texts */
+char *volstatetext [] =
+ {
+FOO
+egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+FOO
diff --git a/lkm/vinum/memory.c b/lkm/vinum/memory.c
new file mode 100644
index 000000000000..5dee671167b0
--- /dev/null
+++ b/lkm/vinum/memory.c
@@ -0,0 +1,186 @@
+
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: memory.c,v 1.16 1998/08/08 04:43:22 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#define USES_VM
+#include "vinumhdr.h"
+
+extern jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+void freedatabuf(struct mc *me);
+caddr_t allocdatabuf(struct mc *me);
+
+void
+expand_table(void **table, int oldsize, int newsize)
+{
+ if (newsize > oldsize) {
+ int *temp;
+
+ temp = (int *) Malloc(newsize); /* allocate a new table */
+ CHECKALLOC(temp, "vinum: Can't expand table\n");
+ if (*table != NULL) { /* already something there, */
+ bcopy((char *) *table, (char *) temp, oldsize); /* copy it to the old table */
+ Free(*table);
+ }
+ *table = temp;
+ }
+}
+
+#ifndef DEBUG
+/* increase the size of a request block */
+void
+expandrq(struct plexrq *prq)
+{
+ expand_table((void **) &prq->rqe,
+ prq->requests * sizeof(struct rqelement),
+ (prq->requests + RQELTS) * sizeof(struct rqelement));
+ bzero(&prq->rqe[prq->requests], RQELTS * sizeof(struct rqelement)); /* clear the new part */
+ prq->rqcount += RQELTS;
+}
+
+#endif
+
+#if DEBUG /* XXX debug */
+#define MALLOCENTRIES 16384
+int malloccount = 0;
+int highwater = 0; /* highest index ever allocated */
+static struct mc malloced[MALLOCENTRIES];
+
+static total_malloced;
+
+caddr_t
+MMalloc(int size, char *file, int line)
+{
+ caddr_t result;
+ int i;
+ static int seq = 0;
+ int s;
+ struct mc me; /* information to pass to allocdatabuf */
+
+ if (malloccount >= MALLOCENTRIES) { /* too many */
+ printf("vinum: can't allocate table space to trace memory allocation");
+ return 0; /* can't continue */
+ }
+ result = malloc(size, M_DEVBUF, M_WAITOK); /* use malloc for smaller and irregular stuff */
+ if (result == NULL)
+ printf("vinum: can't allocate %d bytes from %s:%d\n", size, file, line);
+ else {
+ me.flags = 0; /* allocation via malloc */
+ s = splhigh();
+ for (i = 0; i < malloccount; i++) {
+ if (((result + size) > malloced[i].address)
+ && (result < malloced[i].address + malloced[i].size)) /* overlap */
+ Debugger("Malloc overlap");
+ }
+ if (result) {
+ i = malloccount++;
+ total_malloced += size;
+ malloced[i].address = result;
+ malloced[i].size = size;
+ malloced[i].line = line;
+ malloced[i].seq = seq++;
+ malloced[i].flags = me.flags;
+ malloced[i].databuf = me.databuf; /* only used with kva alloc */
+ bcopy(file, malloced[i].file, min(strlen(file) + 1, 16));
+ }
+ if (malloccount > highwater)
+ highwater = malloccount;
+ splx(s);
+ }
+ return result;
+}
+
+void
+FFree(void *mem, char *file, int line)
+{
+ int i;
+ int s;
+
+ s = splhigh();
+ for (i = 0; i < malloccount; i++) {
+ if ((caddr_t) mem == malloced[i].address) { /* found it */
+ bzero(mem, malloced[i].size); /* XXX */
+ free(mem, M_DEVBUF);
+ malloccount--;
+ total_malloced -= malloced[i].size;
+ if (i < malloccount) /* more coming after */
+ bcopy(&malloced[i + 1], &malloced[i], (malloccount - i) * sizeof(struct mc));
+ splx(s);
+ return;
+ }
+ }
+ splx(s);
+ printf("Freeing unallocated data at 0x%08x from %s, line %d\n", (int) mem, file, line);
+ Debugger("Free");
+}
+
+void
+vinum_meminfo(caddr_t data)
+{
+ struct meminfo *m = (struct meminfo *) data;
+
+ m->mallocs = malloccount;
+ m->total_malloced = total_malloced;
+ m->malloced = malloced;
+ m->highwater = highwater;
+}
+
+int
+vinum_mallocinfo(caddr_t data)
+{
+ struct mc *m = (struct mc *) data;
+ unsigned int ent = *(int *) data; /* 1st word is index */
+
+ if (ent >= malloccount)
+ return ENOENT;
+ m->address = malloced[ent].address;
+ m->size = malloced[ent].size;
+ m->line = malloced[ent].line;
+ m->seq = malloced[ent].seq;
+ bcopy(malloced[ent].file, m->file, 16);
+ return 0;
+}
+
+#endif
diff --git a/lkm/vinum/parser.c b/lkm/vinum/parser.c
new file mode 100644
index 000000000000..9e7f791a7d14
--- /dev/null
+++ b/lkm/vinum/parser.c
@@ -0,0 +1,206 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: parser.c,v 1.11 1998/08/10 08:50:42 grog Exp grog $
+ */
+
+/* This file contains the parser for the configuration routines. It's used
+ * both in the kernel and in the user interface program, thus the separate file. */
+
+/* Go through a text and split up into text tokens. These are either non-blank
+ * sequences, or any sequence (except \0) enclosed in ' or ". Embedded ' or
+ * " characters may be escaped by \, which otherwise has no special meaning.
+ *
+ * Delimit by following with a \0, and return pointers to the starts at token [].
+ * Return the number of tokens found as the return value.
+ *
+ * This method has the restriction that a closing " or ' must be followed by
+ * grey space.
+ *
+ * Error conditions are end of line before end of quote, or no space after
+ * a closing quote. In this case, tokenize() returns -1. */
+
+#include <sys/param.h>
+#ifdef KERNEL
+#undef KERNEL /* XXX */
+#define REALLYKERNEL
+#else
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#endif
+/* All this mess for a single struct definition */
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/disklabel.h>
+#include <sys/mount.h>
+#include <sys/device.h>
+#include <sys/disk.h>
+#include "sys/buf.h"
+
+#include <vinumvar.h>
+#include "vinumkw.h"
+#include "vinumio.h"
+#include "vinumext.h"
+
+#ifdef REALLYKERNEL
+#define isspace(c) ((c == ' ') || (c == '\t')) /* check for white space */
+#else /* get it from the headers */
+#include <ctype.h>
+#endif
+
+/* enum keyword is defined in vinumvar.h */
+
+#define keypair(x) { #x, kw_##x } /* create pair "foo", kw_foo */
+#define flagkeypair(x) { "-"#x, kw_##x } /* create pair "-foo", kw_foo */
+#define KEYWORDSET(x) {sizeof (x) / sizeof (struct _keywords), x}
+
+/* Normal keywords. These are all the words that vinum knows. */
+struct _keywords keywords[] =
+{keypair(drive),
+ keypair(sd),
+ keypair(subdisk),
+ keypair(plex),
+ keypair(volume),
+ keypair(vol),
+ keypair(setupstate),
+ keypair(readpol),
+ keypair(org),
+ keypair(name),
+ keypair(writethrough),
+ keypair(writeback),
+ keypair(raw),
+ keypair(device),
+ keypair(concat),
+ keypair(raid5),
+ keypair(striped),
+ keypair(plexoffset),
+ keypair(driveoffset),
+ keypair(length),
+ keypair(len),
+ keypair(state),
+ keypair(round),
+ keypair(prefer),
+ keypair(rename),
+ keypair(detached),
+#ifndef KERNEL /* for vinum(8) only */
+#ifdef DEBUG
+ keypair(debug),
+#endif
+ keypair(attach),
+ keypair(detach),
+ keypair(printconfig),
+ keypair(replace),
+ keypair(create),
+ keypair(read),
+ keypair(modify),
+ keypair(list),
+ keypair(l),
+ keypair(ld),
+ keypair(ls),
+ keypair(lp),
+ keypair(lv),
+ keypair(info),
+ keypair(set),
+ keypair(rm),
+ keypair(init),
+ keypair(label),
+ keypair(resetconfig),
+ keypair(start),
+ keypair(stop),
+ keypair(resetstats)
+#endif
+};
+struct keywordset keyword_set = KEYWORDSET(keywords);
+
+#ifndef KERNEL
+struct _keywords flag_keywords[] =
+{flagkeypair(f),
+ flagkeypair(d),
+ flagkeypair(v),
+ flagkeypair(s),
+ flagkeypair(r)
+};
+struct keywordset flag_set = KEYWORDSET(flag_keywords);
+
+#endif
+
+int
+tokenize(char *cptr, char *token[])
+{
+ char delim; /* delimiter for searching for the partner */
+ int tokennr; /* index of this token */
+ tokennr = 0; /* none found yet */
+
+ for (;;) {
+ while (isspace(*cptr))
+ cptr++; /* skip initial white space */
+ if ((*cptr == '\0') || (*cptr == '\n') || (*cptr == '#')) /* end of line */
+ return tokennr; /* return number of tokens found */
+ delim = *cptr;
+ token[tokennr] = cptr; /* point to it */
+ tokennr++; /* one more */
+ /* XXX this is broken. It leaves superfluous \\ characters in the text */
+ if ((delim == '\'') || (delim == '"')) { /* delimitered */
+ for (;;) {
+ cptr++;
+ if ((*cptr == delim) && (cptr[-1] != '\\')) { /* found the partner */
+ cptr++; /* move on past */
+ if (!isspace(*cptr)) /* error, no space after closing quote */
+ return -1;
+ *cptr++ = '\0'; /* delimit */
+ } else if ((*cptr == '\0') || (*cptr == '\n')) /* end of line */
+ return -1;
+ }
+ } else { /* not quoted */
+ while ((*cptr != '\0') && (!isspace(*cptr)) && (*cptr != '\n'))
+ cptr++;
+ if (*cptr != '\0') /* not end of the line, */
+ *cptr++ = '\0'; /* delimit and move to the next */
+ }
+ }
+}
+
+/* Find a keyword and return an index */
+enum keyword
+get_keyword(char *name, struct keywordset *keywordset)
+{
+ int i;
+ struct _keywords *keywords = keywordset->k; /* point to the keywords */
+ for (i = 0; i < keywordset->size; i++)
+ if (!strcmp(name, keywords[i].name))
+ return (enum keyword) keywords[i].keyword;
+ return kw_invalid_keyword;
+}
diff --git a/lkm/vinum/request.c b/lkm/vinum/request.c
new file mode 100644
index 000000000000..589eb3fac0ba
--- /dev/null
+++ b/lkm/vinum/request.c
@@ -0,0 +1,882 @@
+/* XXX to do:
+
+ * Decide where we need splbio ()
+ */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: request.c,v 1.17 1998/08/13 06:04:47 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+#include <miscfs/specfs/specdev.h>
+#include <sys/resourcevar.h>
+
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
+
+enum requeststatus bre(struct request *rq,
+ int plexno,
+ daddr_t * diskstart,
+ daddr_t diskend);
+enum requeststatus bre5(struct request *rq,
+ int plexno,
+ daddr_t * diskstart,
+ daddr_t diskend);
+enum requeststatus build_read_request(struct request *rq, int volplexno);
+enum requeststatus build_write_request(struct request *rq);
+enum requeststatus build_rq_buffer(struct rqelement *rqe, struct plex *plex);
+void freerq(struct request *rq);
+void free_rqg(struct rqgroup *rqg);
+int find_alternate_sd(struct request *rq);
+int check_range_covered(struct request *);
+void complete_rqe(struct buf *bp);
+void complete_raid5_write(struct rqelement *);
+int abortrequest(struct request *rq, int error);
+void sdio(struct buf *bp);
+void sdio_done(struct buf *bp);
+int vinum_bounds_check(struct buf *bp, struct volume *vol);
+caddr_t allocdatabuf(struct rqelement *rqe);
+void freedatabuf(struct rqelement *rqe);
+
+void
+vinumstrategy(struct buf *bp)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol = NULL;
+ int s;
+ struct devcode *device = (struct devcode *) &bp->b_dev; /* decode device number */
+ enum requeststatus status;
+
+ switch (device->type) {
+ case VINUM_SD_TYPE:
+ sdio(bp);
+ return;
+
+ /* In fact, vinum doesn't handle drives: they're
+ * handled directly by the disk drivers */
+ case VINUM_DRIVE_TYPE:
+ default:
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+
+ case VINUM_VOLUME_TYPE: /* volume I/O */
+ volno = VOLNO(bp->b_dev);
+ vol = &VOL[volno];
+ if (vol->state != volume_up) { /* can't access this volume */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+ }
+ if (vinum_bounds_check(bp, vol) <= 0) { /* don't like them bounds */
+ biodone(bp); /* have nothing to do with this */
+ return;
+ }
+ /* FALLTHROUGH */
+ /* Plex I/O is pretty much the same as volume I/O
+ * for a single plex. Indicate this by passing a NULL
+ * pointer (set above) for the volume */
+ case VINUM_PLEX_TYPE:
+ bp->b_resid = bp->b_bcount; /* transfer everything */
+ vinumstart(bp, 0);
+ return;
+ }
+}
+
+/* Start a transfer. Return -1 on error,
+ * 0 if OK, 1 if we need to retry.
+ * Parameter reviveok is set when doing
+ * transfers for revives: it allows transfers to
+ * be started immediately when a revive is in
+ * progress. During revive, normal transfers
+ * are queued if they share address space with
+ * a currently active revive operation. */
+int
+vinumstart(struct buf *bp, int reviveok)
+{
+ BROKEN_GDB;
+ int plexno;
+ int maxplex; /* maximum number of plexes to handle */
+ struct volume *vol;
+ struct rqgroup *rqg; /* current plex's requests */
+ struct rqelement *rqe; /* individual element */
+ struct request *rq; /* build up our request here */
+ int rqno; /* index in request list */
+ enum requeststatus status;
+
+ /* XXX In these routines, we're assuming that
+ * we will always be called with bp->b_bcount
+ * which is a multiple of the sector size. This
+ * is a reasonable assumption, since we are only
+ * called from system routines. Should we check
+ * anyway? */
+
+ if ((bp->b_bcount % DEV_BSIZE) != 0) { /* bad length */
+ bp->b_error = EINVAL; /* invalid size */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return -1;
+ }
+ rq = (struct request *) Malloc(sizeof(struct request)); /* allocate a request struct */
+ if (rq == NULL) { /* can't do it */
+ bp->b_error = ENOMEM; /* can't get memory */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return -1;
+ }
+ bzero(rq, sizeof(struct request));
+
+ /* Note the volume ID. This can be NULL, which
+ * the request building functions use as an
+ * indication for single plex I/O */
+ rq->bp = bp; /* and the user buffer struct */
+
+ if (DEVTYPE(bp->b_dev) == VINUM_VOLUME_TYPE) { /* it's a volume, */
+ rq->volplex.volno = VOLNO(bp->b_dev); /* get the volume number */
+ vol = &VOL[rq->volplex.volno]; /* and point to it */
+ vol->active++; /* one more active request */
+ maxplex = vol->plexes; /* consider all its plexes */
+ } else {
+ vol = NULL; /* no volume */
+ rq->volplex.plexno = PLEXNO(bp->b_dev); /* point to the plex */
+ rq->isplex = 1; /* note that it's a plex */
+ maxplex = 1; /* just the one plex */
+ }
+
+ if (bp->b_flags & B_READ) {
+ /* This is a read request. Decide
+ * which plex to read from.
+ *
+ * There's a potential race condition here,
+ * since we're not locked, and we could end
+ * up multiply incrementing the round-robin
+ * counter. This doesn't have any serious
+ * effects, however. */
+ if (vol != NULL) {
+ vol->reads++;
+ vol->bytes_read += bp->b_bcount;
+ plexno = vol->preferred_plex; /* get the plex to use */
+ if (plexno < 0) { /* round robin */
+ plexno = vol->last_plex_read;
+ vol->last_plex_read++;
+ if (vol->last_plex_read == vol->plexes) /* got the the end? */
+ vol->last_plex_read = 0; /* wrap around */
+ }
+ status = build_read_request(rq, plexno); /* build a request */
+ } else {
+ daddr_t diskaddr = bp->b_blkno; /* start offset of transfer */
+ status = bre(rq, /* build a request list */
+ rq->volplex.plexno,
+ &diskaddr,
+ diskaddr + (bp->b_bcount / DEV_BSIZE));
+ }
+
+ if ((status > REQUEST_RECOVERED) /* can't satisfy it */
+ ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
+ if (status == REQUEST_DOWN) { /* not enough subdisks */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ }
+ biodone(bp);
+ freerq(rq);
+ return -1;
+ }
+ return launch_requests(rq, reviveok); /* now start the requests if we can */
+ } else
+ /* This is a write operation. We write to all
+ * plexes. If this is a RAID 5 plex, we must also
+ * update the parity stripe. */
+ {
+ if (vol != NULL) {
+ vol->writes++;
+ vol->bytes_written += bp->b_bcount;
+ status = build_write_request(rq); /* Not all the subdisks are up */
+ } else { /* plex I/O */
+ daddr_t diskstart;
+
+ diskstart = bp->b_blkno; /* start offset of transfer */
+ status = bre(rq,
+ PLEXNO(bp->b_dev),
+ &diskstart,
+ bp->b_blkno + (bp->b_bcount / DEV_BSIZE)); /* build requests for the plex */
+ }
+ if ((status > REQUEST_RECOVERED) /* can't satisfy it */
+ ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
+ if (status == REQUEST_DOWN) { /* not enough subdisks */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ }
+ if ((bp->b_flags & B_DONE) == 0)
+ biodone(bp);
+ freerq(rq);
+ return -1;
+ }
+ return launch_requests(rq, reviveok); /* start the requests */
+ }
+}
+
+/* Call the low-level strategy routines to
+ * perform the requests in a struct request */
+int
+launch_requests(struct request *rq, int reviveok)
+{
+ struct rqgroup *rqg;
+ int rqno; /* loop index */
+ struct rqelement *rqe; /* current element */
+ int s;
+
+ /* First find out whether we're reviving, and the
+ * request contains a conflict. If so, we hang
+ * the request off plex->waitlist of the first
+ * plex we find which is reviving */
+ if ((rq->flags & XFR_REVIVECONFLICT) /* possible revive conflict */
+ &&(!reviveok)) { /* and we don't want to do it now, */
+ struct volume *vol = &VOL[VOLNO(rq->bp->b_dev)];
+ struct plex *plex;
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) { /* find the reviving plex */
+ plex = &PLEX[vol->plex[plexno]];
+ if (plex->state == plex_reviving) /* found it */
+ break;
+ }
+ if (plexno < vol->plexes) { /* found it? */
+ struct request *waitlist = plex->waitlist; /* point to the waiting list */
+
+ while (waitlist->next != NULL) /* find the end */
+ waitlist = waitlist->next;
+ waitlist->next = rq; /* hook our request there */
+ return 0; /* and get out of here */
+ } else /* bad vinum, bad */
+ printf("vinum: can't find reviving plex for volume %s\n", vol->name);
+ }
+ rq->active = 0; /* nothing yet */
+ /* XXX This is probably due to a bug */
+ if (rq->rqg == NULL) { /* no request */
+ abortrequest(rq, EINVAL);
+ return -1;
+ }
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf("Request: %x\nWrite dev 0x%x, offset 0x%x, length %ld\n",
+ (u_int) rq,
+ rq->bp->b_dev,
+ rq->bp->b_blkno,
+ rq->bp->b_bcount); /* XXX */
+ vinum_conf.lastrq = (int) rq;
+ vinum_conf.lastbuf = rq->bp;
+#endif
+ for (rqg = rq->rqg; rqg != NULL; rqg = rqg->next) { /* through the whole request chain */
+ rqg->active = rqg->count; /* they're all active */
+ rq->active++; /* one more active request group */
+ for (rqno = 0; rqno < rqg->count; rqno++) {
+ rqe = &rqg->rqe[rqno];
+ if (rqe->flags & XFR_BAD_SUBDISK) /* this subdisk is bad, */
+ rqg->active--; /* one less active request */
+ else {
+ struct drive *drive = &DRIVE[rqe->driveno]; /* drive to access */
+ if ((rqe->b.b_flags & B_READ) == 0)
+ rqe->b.b_vp->v_numoutput++; /* one more output going */
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
+ rqe->b.b_flags & B_READ ? "Read" : "Write",
+ rqe->b.b_dev,
+ rqe->sdno,
+ (u_int) (rqe->b.b_blkno - SD[rqe->sdno].driveoffset),
+ rqe->b.b_blkno,
+ rqe->b.b_bcount); /* XXX */
+ if (debug & DEBUG_NUMOUTPUT)
+ printf(" vinumstart sd %d numoutput %ld\n",
+ rqe->sdno,
+ rqe->b.b_vp->v_numoutput);
+#endif
+ /* fire off the request */
+ s = splbio();
+ (*bdevsw[major(rqe->b.b_dev)]->d_strategy) (&rqe->b);
+ splx(s);
+ }
+ /* XXX Do we need caching? Think about this more */
+ }
+ }
+ return 0;
+}
+
+/* define the low-level requests needed to perform a
+ * high-level I/O operation for a specific plex 'plexno'.
+ *
+ * Return 0 if all subdisks involved in the request are up, 1 if some
+ * subdisks are not up, and -1 if the request is at least partially
+ * outside the bounds of the subdisks.
+ *
+ * Modify the pointer *diskstart to point to the end address. On
+ * read, return on the first bad subdisk, so that the caller
+ * (build_read_request) can try alternatives.
+ *
+ * On entry to this routine, the rqg structures are not assigned. The
+ * assignment is performed by expandrq(). Strictly speaking, the
+ * elements rqe->sdno of all entries should be set to -1, since 0
+ * (from bzero) is a valid subdisk number. We avoid this problem by
+ * initializing the ones we use, and not looking at the others (index
+ * >= rqg->requests).
+ */
+enum requeststatus
+bre(struct request *rq,
+ int plexno,
+ daddr_t * diskaddr,
+ daddr_t diskend)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+ struct rqgroup *rqg;
+ struct buf *bp; /* user's bp */
+ struct plex *plex;
+ enum requeststatus status; /* return value */
+ daddr_t plexoffset; /* offset of transfer in plex */
+ daddr_t stripebase; /* base address of stripe (1st subdisk) */
+ daddr_t stripeoffset; /* offset in stripe */
+ daddr_t blockoffset; /* offset in stripe on subdisk */
+ struct rqelement *rqe; /* point to this request information */
+ daddr_t diskstart = *diskaddr; /* remember where this transfer starts */
+
+ bp = rq->bp; /* buffer pointer */
+ status = REQUEST_OK; /* return value: OK until proven otherwise */
+ plex = &PLEX[plexno]; /* point to the plex */
+
+ switch (plex->organization) {
+ case plex_concat:
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ if ((*diskaddr < (sd->plexoffset + sd->sectors)) /* The request starts before the end of this */
+ &&(diskend > sd->plexoffset)) { /* subdisk and ends after the start of this sd */
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
+ enum requeststatus s;
+
+ s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
+ if (s) /* give up? */
+ return s; /* yup */
+ }
+ rqg = allocrqg(rq, 1); /* space for the request */
+ if (rqg == NULL) { /* malloc failed */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM;
+ }
+ rqg->plexno = plexno;
+
+ rqe = &rqg->rqe[0]; /* point to the element */
+ rqe->rqg = rqg; /* group */
+ rqe->sdno = sd->sdno; /* put in the subdisk number */
+ plexoffset = max(sd->plexoffset, *diskaddr); /* start offset in plex */
+ rqe->sdoffset = plexoffset - sd->plexoffset; /* start offset in subdisk */
+ rqe->useroffset = plexoffset - diskstart; /* start offset in user buffer */
+ rqe->dataoffset = 0;
+ rqe->datalen = min(diskend - *diskaddr, /* number of sectors to transfer in this sd */
+ sd->sectors - rqe->sdoffset);
+ rqe->groupoffset = 0; /* no groups for concatenated plexes */
+ rqe->grouplen = 0;
+ rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
+ rqe->flags = 0;
+ rqe->driveno = sd->driveno;
+ *diskaddr += rqe->datalen; /* bump the address */
+ if (build_rq_buffer(rqe, plex)) { /* build the buffer */
+ deallocrqg(rqg);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM; /* can't do it */
+ }
+ }
+ if (*diskaddr > diskend) /* we're finished, */
+ break; /* get out of here */
+ }
+ break;
+
+ case plex_striped:
+ {
+ while (*diskaddr < diskend) { /* until we get it all sorted out */
+ /* The offset of the start address from
+ * the start of the stripe */
+ stripeoffset = *diskaddr % (plex->stripesize * plex->subdisks);
+
+ /* The plex-relative address of the
+ * start of the stripe */
+ stripebase = *diskaddr - stripeoffset;
+
+ /* The number of the subdisk in which
+ * the start is located */
+ sdno = stripeoffset / plex->stripesize;
+
+ /* The offset from the beginning of the stripe
+ * on this subdisk */
+ blockoffset = stripeoffset % plex->stripesize;
+
+ sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
+ enum requeststatus s;
+
+ s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
+ if (s) /* give up? */
+ return s; /* yup */
+ }
+ rqg = allocrqg(rq, 1); /* space for the request */
+ if (rqg == NULL) { /* malloc failed */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM;
+ }
+ rqg->plexno = plexno;
+
+ rqe = &rqg->rqe[0]; /* point to the element */
+ rqe->rqg = rqg;
+ rqe->sdoffset = stripebase / plex->subdisks + blockoffset; /* start offset in this subdisk */
+ rqe->useroffset = *diskaddr - diskstart; /* The offset of the start in the user buffer */
+ rqe->dataoffset = 0;
+ rqe->datalen = min(diskend - *diskaddr, /* the amount remaining to transfer */
+ plex->stripesize - blockoffset); /* and the amount left in this stripe */
+ rqe->groupoffset = 0; /* no groups for striped plexes */
+ rqe->grouplen = 0;
+ rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
+ rqe->flags = 0;
+ rqe->sdno = sd->sdno; /* put in the subdisk number */
+ rqe->driveno = sd->driveno;
+
+ if (rqe->sdoffset >= sd->sectors) { /* starts beyond the end of the subdisk? */
+ deallocrqg(rqg);
+ return REQUEST_EOF;
+ } else if (rqe->sdoffset + rqe->datalen > sd->sectors) /* ends beyond the end of the subdisk? */
+ rqe->datalen = sd->sectors - rqe->sdoffset; /* yes, truncate */
+
+ if (build_rq_buffer(rqe, plex)) { /* build the buffer */
+ deallocrqg(rqg);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM; /* can't do it */
+ }
+ *diskaddr += rqe->datalen; /* look at the remainder */
+ if (*diskaddr < diskend) { /* didn't finish the request on this stripe */
+ plex->multiblock++; /* count another one */
+ if (sdno == plex->subdisks - 1) /* last subdisk, */
+ plex->multistripe++; /* another stripe as well */
+ }
+ }
+ }
+ break;
+
+
+ default:
+ printf("vinum: invalid plex type in bre");
+ }
+
+ return status;
+}
+
+/* Build up a request structure for reading volumes.
+ * This function is not needed for plex reads, since there's
+ * no recovery if a plex read can't be satisified. */
+enum requeststatus
+build_read_request(struct request *rq, /* request */
+ int plexindex)
+{ /* index in the volume's plex table */
+ BROKEN_GDB;
+ struct buf *bp;
+ daddr_t startaddr; /* offset of previous part of transfer */
+ daddr_t diskaddr; /* offset of current part of transfer */
+ daddr_t diskend; /* and end offset of transfer */
+ int plexno; /* plex index in vinum_conf */
+ struct rqgroup *rqg; /* point to the request we're working on */
+ struct volume *vol; /* volume in question */
+ off_t oldstart; /* note where we started */
+ int recovered = 0; /* set if we recover a read */
+ enum requeststatus status = REQUEST_OK;
+
+ bp = rq->bp; /* buffer pointer */
+ diskaddr = bp->b_blkno; /* start offset of transfer */
+ diskend = diskaddr + (bp->b_bcount / DEV_BSIZE); /* and end offset of transfer */
+ rqg = &rq->rqg[plexindex]; /* plex request */
+ vol = &VOL[rq->volplex.volno]; /* point to volume */
+
+ while (diskaddr < diskend) { /* build up request components */
+ startaddr = diskaddr;
+ status = bre(rq, vol->plex[plexindex], &diskaddr, diskend); /* build up a request */
+ switch (status) {
+ case REQUEST_OK:
+ continue;
+
+ case REQUEST_RECOVERED:
+ recovered = 1;
+ break;
+
+ case REQUEST_EOF:
+ case REQUEST_ENOMEM:
+ return status;
+
+ /* if we get here, we have either had a failure or
+ * a RAID 5 recovery. We don't want to use the
+ * recovery, because it's expensive, so first we
+ * check if we have alternatives */
+ case REQUEST_DOWN: /* can't access the plex */
+ if (vol != NULL) { /* and this is volume I/O */
+ /* Try to satisfy the request
+ * from another plex */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ diskaddr = startaddr; /* start at the beginning again */
+ oldstart = startaddr; /* and note where that was */
+ if (plexno != plexindex) { /* don't try this plex again */
+ bre(rq, vol->plex[plexno], &diskaddr, diskend); /* try a request */
+ if (diskaddr > oldstart) { /* we satisfied another part */
+ recovered = 1; /* we recovered from the problem */
+ status = REQUEST_OK; /* don't complain about it */
+ break;
+ }
+ }
+ if (plexno == (vol->plexes - 1)) /* couldn't satisfy the request */
+ return REQUEST_DOWN; /* failed */
+ }
+ } else
+ return REQUEST_DOWN; /* bad luck */
+ }
+ if (recovered)
+ vol->recovered_reads += recovered; /* adjust our recovery count */
+ }
+ return status;
+}
+
+/* Build up a request structure for writes.
+ * Return 0 if all subdisks involved in the request are up, 1 if some
+ * subdisks are not up, and -1 if the request is at least partially
+ * outside the bounds of the subdisks. */
+enum requeststatus
+build_write_request(struct request *rq)
+{ /* request */
+ BROKEN_GDB;
+ struct buf *bp;
+ daddr_t diskstart; /* offset of current part of transfer */
+ daddr_t diskend; /* and end offset of transfer */
+ int plexno; /* plex index in vinum_conf */
+ struct volume *vol; /* volume in question */
+ enum requeststatus status;
+
+ bp = rq->bp; /* buffer pointer */
+ vol = &VOL[rq->volplex.volno]; /* point to volume */
+ diskend = bp->b_blkno + (bp->b_bcount / DEV_BSIZE); /* end offset of transfer */
+ status = REQUEST_OK;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ diskstart = bp->b_blkno; /* start offset of transfer */
+ status = min(status, bre(rq, /* build requests for the plex */
+ vol->plex[plexno],
+ &diskstart,
+ diskend));
+ }
+ return status;
+}
+
+/* Fill in the struct buf part of a request element. */
+enum requeststatus
+build_rq_buffer(struct rqelement *rqe, struct plex *plex)
+{
+ BROKEN_GDB;
+ struct sd *sd; /* point to subdisk */
+ struct volume *vol;
+ struct buf *bp;
+ struct buf *ubp; /* user (high level) buffer header */
+
+ vol = &VOL[rqe->rqg->rq->volplex.volno];
+ sd = &SD[rqe->sdno]; /* point to subdisk */
+ bp = &rqe->b;
+ ubp = rqe->rqg->rq->bp; /* pointer to user buffer header */
+
+ /* Initialize the buf struct */
+ bzero(&rqe->b, sizeof(struct buf));
+ bp->b_proc = ubp->b_proc; /* process pointer */
+ bp->b_flags = ubp->b_flags & (B_NOCACHE | B_READ | B_ASYNC); /* copy these flags from user bp */
+ bp->b_flags |= B_CALL | B_BUSY; /* inform us when it's done */
+ if (plex->state == plex_reviving)
+ bp->b_flags |= B_ORDERED; /* keep request order if we're reviving */
+ bp->b_iodone = complete_rqe; /* by calling us here */
+ bp->b_dev = DRIVE[rqe->driveno].dev; /* drive device */
+ bp->b_blkno = rqe->sdoffset + sd->driveoffset; /* start address */
+ bp->b_bcount = rqe->buflen << DEV_BSHIFT; /* number of bytes to transfer */
+ bp->b_resid = bp->b_bcount; /* and it's still all waiting */
+ bp->b_bufsize = bp->b_bcount; /* and buffer size */
+ bp->b_vp = DRIVE[rqe->driveno].vp; /* drive vnode */
+ bp->b_rcred = FSCRED; /* we have the file system credentials */
+ bp->b_wcred = FSCRED; /* we have the file system credentials */
+
+ if (rqe->flags & XFR_MALLOCED) { /* this operation requires a malloced buffer */
+ bp->b_data = Malloc(bp->b_bcount); /* get a buffer to put it in */
+ if (bp->b_data == NULL) { /* failed */
+ Debugger("XXX");
+ abortrequest(rqe->rqg->rq, ENOMEM);
+ return REQUEST_ENOMEM; /* no memory */
+ }
+ } else
+ /* Point directly to user buffer data. This means
+ * that we don't need to do anything when we have
+ * finished the transfer */
+ bp->b_data = ubp->b_data + rqe->useroffset * DEV_BSIZE;
+ return 0;
+}
+/* Abort a request: free resources and complete the
+ * user request with the specified error */
+int
+abortrequest(struct request *rq, int error)
+{
+ struct buf *bp = rq->bp; /* user buffer */
+
+ bp->b_flags |= B_ERROR;
+ bp->b_error = error;
+ freerq(rq); /* free everything we're doing */
+ biodone(bp);
+ return error; /* and give up */
+}
+
+/* Check that our transfer will cover the
+ * complete address space of the user request.
+ *
+ * Return 1 if it can, otherwise 0 */
+int
+check_range_covered(struct request *rq)
+{
+ /* XXX */
+ return 1;
+}
+
+/* Perform I/O on a subdisk */
+void
+sdio(struct buf *bp)
+{
+ int s; /* spl */
+ struct sd *sd;
+ struct sdbuf *sbp;
+ daddr_t endoffset;
+ struct drive *drive;
+
+ sd = &SD[SDNO(bp->b_dev)]; /* point to the subdisk */
+ drive = &DRIVE[sd->driveno];
+
+ if (drive->state != drive_up) { /* XXX until we get the states fixed */
+ set_sd_state(SDNO(bp->b_dev), sd_obsolete, setstate_force);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = EIO;
+ biodone(bp);
+ return;
+ }
+ /* XXX decide which states we will really accept here. up
+ * implies it could be involved with a plex, in which
+ * case we don't want to dick with it */
+ if ((sd->state != sd_up)
+ && (sd->state != sd_initializing)
+ && (sd->state != sd_reborn)) { /* we can't access it */
+ bp->b_flags |= B_ERROR;
+ bp->b_flags = EIO;
+ if (bp->b_flags & B_BUSY) /* XXX why isn't this always the case? */
+ biodone(bp);
+ return;
+ }
+ /* Get a buffer */
+ sbp = (struct sdbuf *) Malloc(sizeof(struct sdbuf));
+ if (sbp == NULL) {
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return;
+ }
+ bcopy(bp, &sbp->b, sizeof(struct buf)); /* start with the user's buffer */
+ sbp->b.b_flags |= B_CALL; /* tell us when it's done */
+ sbp->b.b_iodone = sdio_done; /* here */
+ sbp->b.b_dev = DRIVE[sd->driveno].dev; /* device */
+ sbp->b.b_vp = DRIVE[sd->driveno].vp; /* vnode */
+ sbp->b.b_blkno += sd->driveoffset;
+ sbp->bp = bp; /* note the address of the original header */
+ sbp->sdno = sd->sdno; /* note for statistics */
+ sbp->driveno = sd->driveno;
+ endoffset = bp->b_blkno + sbp->b.b_bcount / DEV_BSIZE; /* final sector offset */
+ if (endoffset > sd->sectors) { /* beyond the end */
+ sbp->b.b_bcount -= (endoffset - sd->sectors) * DEV_BSIZE; /* trim */
+ if (sbp->b.b_bcount <= 0) { /* nothing to transfer */
+ bp->b_resid = bp->b_bcount; /* nothing transferred */
+ /* XXX Grrr. This doesn't seem to work. Return
+ * an error after all */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOSPC;
+ biodone(bp);
+ Free(sbp);
+ return;
+ }
+ }
+ if ((sbp->b.b_flags & B_READ) == 0) /* write */
+ sbp->b.b_vp->v_numoutput++; /* one more output going */
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
+ sbp->b.b_flags & B_READ ? "Read" : "Write",
+ sbp->b.b_dev,
+ sbp->sdno,
+ (u_int) (sbp->b.b_blkno - SD[sbp->sdno].driveoffset),
+ (int) sbp->b.b_blkno,
+ sbp->b.b_bcount); /* XXX */
+ if (debug & DEBUG_NUMOUTPUT)
+ printf(" vinumstart sd %d numoutput %ld\n",
+ sbp->sdno,
+ sbp->b.b_vp->v_numoutput);
+#endif
+ s = splbio();
+ (*bdevsw[major(sbp->b.b_dev)]->d_strategy) (&sbp->b);
+ splx(s);
+}
+
+/* Simplified version of bounds_check_with_label
+ * Determine the size of the transfer, and make sure it is
+ * within the boundaries of the partition. Adjust transfer
+ * if needed, and signal errors or early completion.
+ *
+ * Volumes are simpler than disk slices: they only contain
+ * one component (though we call them a, b and c to make
+ * system utilities happy), and they always take up the
+ * complete space of the "partition".
+ *
+ * I'm still not happy with this: why should the label be
+ * protected? If it weren't so damned difficult to write
+ * one in the first pleace (because it's protected), it wouldn't
+ * be a problem.
+ */
+int
+vinum_bounds_check(struct buf *bp, struct volume *vol)
+{
+ int maxsize = vol->size; /* size of the partition (sectors) */
+ int size = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; /* size of this request (sectors) */
+
+ /* Would this transfer overwrite the disk label? */
+ if (bp->b_blkno <= LABELSECTOR /* starts before or at the label */
+#if LABELSECTOR != 0
+ && bp->b_blkno + size > LABELSECTOR /* and finishes after */
+#endif
+ && (!(vol->flags & VF_RAW)) /* and it's not raw */
+ &&major(bp->b_dev) == BDEV_MAJOR /* and it's the block device */
+ && (bp->b_flags & B_READ) == 0 /* and it's a write */
+ && (!vol->flags & (VF_WLABEL | VF_LABELLING))) { /* and we're not allowed to write the label */
+ bp->b_error = EROFS; /* read-only */
+ bp->b_flags |= B_ERROR;
+ return -1;
+ }
+ if (size == 0) /* no transfer specified, */
+ return 0; /* treat as EOF */
+ /* beyond partition? */
+ if (bp->b_blkno < 0 /* negative start */
+ || bp->b_blkno + size > maxsize) { /* or goes beyond the end of the partition */
+ /* if exactly at end of disk, return an EOF */
+ if (bp->b_blkno == maxsize) {
+ bp->b_resid = bp->b_bcount;
+ return 0;
+ }
+ /* or truncate if part of it fits */
+ size = maxsize - bp->b_blkno;
+ if (size <= 0) { /* nothing to transfer */
+ bp->b_error = EINVAL;
+ bp->b_flags |= B_ERROR;
+ return -1;
+ }
+ bp->b_bcount = size << DEV_BSHIFT;
+ }
+ bp->b_pblkno = bp->b_blkno;
+ return 1;
+}
+
+/* Allocate a request group and hook
+ * it in in the list for rq */
+struct rqgroup *
+allocrqg(struct request *rq, int elements)
+{
+ struct rqgroup *rqg; /* the one we're going to allocate */
+ int size = sizeof(struct rqgroup) + elements * sizeof(struct rqelement);
+
+ rqg = (struct rqgroup *) Malloc(size);
+ if (rqg != NULL) { /* malloc OK, */
+ if (rq->rqg) /* we already have requests */
+ rq->lrqg->next = rqg; /* hang it off the end */
+ else /* first request */
+ rq->rqg = rqg; /* at the start */
+ rq->lrqg = rqg; /* this one is the last in the list */
+
+ bzero(rqg, size); /* no old junk */
+ rqg->rq = rq; /* point back to the parent request */
+ rqg->count = elements; /* number of requests in the group */
+ } else
+ Debugger("XXX");
+ return rqg;
+}
+
+/* Deallocate a request group out of a chain. We do
+ * this by linear search: the chain is short, this
+ * almost never happens, and currently it can only
+ * happen to the first member of the chain. */
+void
+deallocrqg(struct rqgroup *rqg)
+{
+ struct rqgroup *rqgc = rqg->rq->rqg; /* point to the request chain */
+
+ if (rqg->rq->rqg == rqg) /* we're first in line */
+ rqg->rq->rqg = rqg->next; /* unhook ourselves */
+ else {
+ while (rqgc->next != rqg) /* find the group */
+ rqgc = rqgc->next;
+ rqgc->next = rqg->next;
+ }
+ Free(rqgc);
+}
+
+/* Character device interface */
+int
+vinumread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(vinumstrategy, NULL, dev, 1, minphys, uio));
+}
+
+int
+vinumwrite(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(vinumstrategy, NULL, dev, 0, minphys, uio));
+}
diff --git a/lkm/vinum/request.h b/lkm/vinum/request.h
new file mode 100644
index 000000000000..b4beccca9b42
--- /dev/null
+++ b/lkm/vinum/request.h
@@ -0,0 +1,159 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: request.h,v 1.10 1998/08/03 07:15:26 grog Exp grog $
+ */
+
+/* Information needed to set up a transfer */
+
+/* struct buf is surprisingly big (about 300
+ * bytes), and it's part of the request, so this
+ * value is really important. Most requests
+ * don't need more than 2 subrequests per
+ * plex. The table is automatically extended if
+ * this value is too small. */
+#define RQELTS 2 /* default of 2 requests per transfer */
+
+enum xferinfo {
+ XFR_NORMAL_READ = 1,
+ XFR_NORMAL_WRITE = 2, /* write request in normal mode */
+ XFR_RECOVERY_READ = 4,
+ XFR_DEGRADED_WRITE = 8,
+ XFR_PARITYLESS_WRITE = 0x10,
+ XFR_NO_PARITY_STRIPE = 0x20, /* parity stripe is not available */
+ XFR_DATA_BLOCK = 0x40, /* data block in request */
+ XFR_PARITY_BLOCK = 0x80, /* parity block in request */
+ XFR_BAD_SUBDISK = 0x100, /* this subdisk is dead */
+ XFR_MALLOCED = 0x200, /* this buffer is malloced */
+#if DEBUG
+ XFR_PHASE2 = 0x800, /* documentation only: 2nd phase write */
+#endif
+ XFR_REVIVECONFLICT = 0x1000, /* possible conflict with a revive operation */
+ /* operations that need a parity block */
+ XFR_PARITYOP = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE),
+ /* operations that use the group parameters */
+ XFR_GROUPOP = (XFR_DEGRADED_WRITE | XFR_RECOVERY_READ),
+ /* operations that that use the data parameters */
+ XFR_DATAOP = (XFR_NORMAL_READ | XFR_NORMAL_WRITE | XFR_PARITYLESS_WRITE),
+ /* operations requiring read before write */
+ XFR_RBW = (XFR_NORMAL_WRITE | XFR_DEGRADED_WRITE),
+ /* operations that need a malloced buffer */
+ XFR_NEEDS_MALLOC = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE)
+};
+
+/* Describe one low-level request, part
+ * of a high-level request. This is an
+ * extended struct buf buffer, and the first
+ * element *must* be a struct buf. We pass this structure
+ * to the I/O routines instead of a struct buf in oder
+ * to be able to locate the high-level request when it
+ * completes.
+ *
+ * All offsets and lengths are in "blocks", i.e. sectors */
+struct rqelement {
+ struct buf b; /* buf structure */
+ struct rqgroup *rqg; /* pointer to our group */
+ /* Information about the transfer */
+ daddr_t sdoffset; /* offset in subdisk */
+ int useroffset; /* offset in user buffer of normal data */
+ /* dataoffset and datalen refer to "individual"
+ * data transfers (normal read, parityless write)
+ * and also degraded write.
+ *
+ * groupoffset and grouplen refer to the other
+ * "group" operations (normal write, recovery read)
+ * Both the offsets are relative to the start of the
+ * local buffer */
+ int dataoffset; /* offset in buffer of the normal data */
+ int groupoffset; /* offset in buffer of group data */
+ short datalen; /* length of normal data (sectors) */
+ short grouplen; /* length of group data (sectors) */
+ short buflen; /* total buffer length to allocate */
+ short flags; /* really enum xferinfo (see above) */
+ /* Ways to find other components */
+ short sdno; /* subdisk number */
+ short driveno; /* drive number */
+};
+
+/* A group of requests built to satisfy a certain
+ * component of a user request */
+struct rqgroup {
+ struct rqgroup *next; /* pointer to next group */
+ struct request *rq; /* pointer to the request */
+ short count; /* number of requests in this group */
+ short active; /* and number active */
+ short plexno; /* index of plex */
+ int badsdno; /* index of bad subdisk or -1 */
+ enum xferinfo flags; /* description of transfer */
+ struct rqelement rqe[0]; /* and the elements of this request */
+};
+
+/* Describe one high-level request and the
+ * work we have to do to satisfy it */
+struct request {
+ struct buf *bp; /* pointer to the high-level request */
+ int flags;
+ union {
+ int volno; /* volume index */
+ int plexno; /* or plex index */
+ } volplex;
+ int error; /* current error indication */
+ short isplex; /* set if this is a plex request */
+ short active; /* number of subrequests still active */
+ struct rqgroup *rqg; /* pointer to the first group of requests */
+ struct rqgroup *lrqg; /* and to the first group of requests */
+ struct request *next; /* link of waiting requests */
+};
+
+/* Extended buffer header for subdisk I/O. Includes
+ * a pointer to the user I/O request. */
+struct sdbuf {
+ struct buf b; /* our buffer */
+ struct buf *bp; /* and pointer to parent */
+ short driveno; /* drive index */
+ short sdno; /* and subdisk index */
+};
+
+/* Values returned by rqe and friends.
+ * Be careful with these: they are in order of increasing
+ * seriousness. Some routines check for > REQUEST_RECOVERED
+ * to indicate a completely failed request. */
+enum requeststatus {
+ REQUEST_OK, /* request built OK */
+ REQUEST_RECOVERED, /* request OK, but involves RAID5 recovery */
+ REQUEST_EOF, /* request failed: outside plex */
+ REQUEST_DOWN, /* request failed: subdisk down */
+ REQUEST_ENOMEM /* ran out of memory */
+};
diff --git a/lkm/vinum/revive.c b/lkm/vinum/revive.c
new file mode 100644
index 000000000000..216dc4887d41
--- /dev/null
+++ b/lkm/vinum/revive.c
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: revive.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* revive a block of a plex. Return an error
+ * indication. EAGAIN means successful copy, but
+ * that more blocks remain to be copied.
+ * XXX We should specify a block size here. At the moment,
+ * just take a default value. FIXME */
+int
+revive_block(int plexno)
+{
+ struct plex *plex = &PLEX[plexno];
+ struct buf *bp;
+ int error = EAGAIN;
+ int size;
+ int s; /* priority level */
+
+ if (plex->revive_blocksize == 0) {
+ if (plex->stripesize != 0) /* we're striped, don't revive more than */
+ plex->revive_blocksize = min(DEFAULT_REVIVE_BLOCKSIZE, plex->stripesize); /* one block at a time */
+ else
+ plex->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
+ }
+ size = min(plex->revive_blocksize, (plex->length - plex->revived) << DEV_BSHIFT);
+
+ s = splbio();
+ /* Get a buffer */
+ bp = geteblk(size);
+ if (bp == NULL) {
+ splx(s);
+ return ENOMEM;
+ }
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+
+ /* Amount to transfer: block size, unless it
+ * would overlap the end */
+ bp->b_bufsize = size;
+ bp->b_bcount = bp->b_bufsize;
+ bp->b_resid = 0x0;
+ bp->b_blkno = plex->revived; /* we've got this far */
+
+ /* XXX what about reviving anonymous plexes? */
+
+ /* First, read the data from the volume. We don't
+ * care which plex, that's bre's job */
+ bp->b_dev = VINUMBDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
+ bp->b_flags = B_BUSY | B_READ;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else
+ /* Now write to the plex */
+ {
+ s = splbio();
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+ bp->b_dev = VINUMBDEV(plex->volno, plex->volplexno, 0, VINUM_PLEX_TYPE); /* create the device number */
+
+ bp->b_flags = B_BUSY; /* make this a write */
+ bp->b_resid = 0x0;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else {
+ plex->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */
+ if (plex->revived >= plex->length) { /* finished */
+ plex->revived = 0;
+ plex->state = plex_up; /* do we need to do more? */
+ if (plex->volno >= 0) /* we have a volume, */
+ set_volume_state(plex->volno, volume_up, 0);
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ save_config(); /* and save the updated configuration */
+ error = 0; /* we're done */
+ }
+ }
+ while (plex->waitlist) { /* we have waiting requests */
+ launch_requests(plex->waitlist, 1); /* do them now */
+ plex->waitlist = plex->waitlist->next; /* and move on to the next */
+ }
+ }
+ if (bp->b_qindex == 0) /* not on a queue, */
+ brelse(bp); /* is this kosher? */
+ return error;
+}
diff --git a/lkm/vinum/state.c b/lkm/vinum/state.c
new file mode 100644
index 000000000000..2ce2ed0c29e5
--- /dev/null
+++ b/lkm/vinum/state.c
@@ -0,0 +1,755 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: state.c,v 2.6 1998/08/19 08:04:47 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* Update drive state */
+/* Return 1 if the state changes, otherwise 0 */
+int
+set_drive_state(int driveno, enum drivestate state, int flags)
+{
+ struct drive *drive = &DRIVE[driveno];
+ int oldstate = drive->state;
+ int sdno;
+
+ if (drive->state == drive_unallocated) /* no drive to do anything with, */
+ return 0;
+
+ if (state != oldstate) { /* don't change it if it's not different */
+ if (state == drive_down) { /* the drive's going down */
+ if (flags || (drive->opencount == 0)) { /* we can do it */
+ close_drive(drive);
+ drive->state = state;
+ printf("vinum: drive %s is %s\n", drive->label.name, drive_state(drive->state));
+ } else
+ return 0; /* don't do it */
+ }
+ drive->state = state; /* set the state */
+ if (((drive->state == drive_up)
+ || ((drive->state == drive_coming_up)))
+ && (drive->vp == NULL)) /* should be open, but we're not */
+ init_drive(drive); /* which changes the state again */
+ if ((state != oldstate) /* state has changed */
+ &&((flags & setstate_norecurse) == 0)) { /* and we want to recurse, */
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) { /* find this drive's subdisks */
+ if (SD[sdno].driveno == driveno) /* belongs to this drive */
+ set_sd_state(sdno, sd_down, setstate_force | setstate_recursing); /* take it down */
+ }
+ save_config(); /* and save the updated configuration */
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* Try to set the subdisk state. Return 1 if state changed to
+ * what we wanted, -1 if it changed to something else, and 0
+ * if no change.
+ *
+ * This routine is called both from the user (up, down states
+ * only) and internally.
+ */
+int
+set_sd_state(int sdno, enum sdstate state, enum setstateflags flags)
+{
+ struct sd *sd = &SD[sdno];
+ int oldstate = sd->state;
+ int status = 1; /* status to return */
+
+ if (state == oldstate)
+ return 0; /* no change */
+
+ if (sd->state == sd_unallocated) /* no subdisk to do anything with, */
+ return 0;
+
+ if (sd->driveoffset < 0) { /* not allocated space */
+ sd->state = sd_down;
+ if (state != sd_down)
+ return -1;
+ } else { /* space allocated */
+ switch (state) {
+ case sd_down:
+ if ((!flags & setstate_force) /* but gently */
+ &&(sd->plexno >= 0)) /* and we're attached to a plex, */
+ return 0; /* don't do it */
+ break;
+
+ case sd_up:
+ if (DRIVE[sd->driveno].state != drive_up) /* can't bring the sd up if the drive isn't, */
+ return 0; /* not even by force */
+ switch (sd->state) {
+ case sd_obsolete:
+ case sd_down: /* been down, no data lost */
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ /* XXX Get this right: make sure that other plexes in
+ * the volume cover this address space, otherwise
+ * we make this one sd_up */
+ sd->state = sd_reborn; /* here it is again */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_init: /* brand new */
+ if (flags & setstate_configuring) /* we're doing this while configuring */
+ break;
+ sd->state = sd_empty; /* nothing in it */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_initializing:
+ break; /* go on and do it */
+
+ case sd_empty:
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ return 0; /* can't do it */
+
+ default: /* can't do it */
+ /* There's no way to bring subdisks up directly from
+ * other states. First they need to be initialized
+ * or revived */
+ return 0;
+ }
+ break;
+
+ default: /* other ones, only internal with force */
+ if (flags & setstate_force == 0) /* no force? What's this? */
+ return 0; /* don't do it */
+ }
+ }
+ sd->state = state;
+ printf("vinum: subdisk %s is %s\n", sd->name, sd_state(sd->state));
+ if ((flags & setstate_norecurse) == 0)
+ set_plex_state(sd->plexno, plex_up, setstate_recursing); /* update plex state */
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return status;
+}
+
+/* Called from request routines when they find
+ * a subdisk which is not kosher. Decide whether
+ * it warrants changing the state. Return
+ * REQUEST_DOWN if we can't use the subdisk,
+ * REQUEST_OK if we can. */
+enum requeststatus
+checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend)
+{
+ struct plex *plex = &PLEX[sd->plexno];
+ int writeop = (rq->bp->b_flags & B_READ) == 0; /* note if we're writing */
+
+ /* first, see if the plex wants to be accessed */
+ switch (plex->state) {
+ case plex_reviving:
+ /* When writing, we'll write anything that starts
+ * up to the current revive pointer, but we'll
+ * only accept a read which finishes before the
+ * current revive pointer.
+ */
+ if ((writeop && (diskaddr > plex->revived)) /* write starts after current revive pointer */
+ ||((!writeop) && (diskend >= plex->revived))) { /* or read ends after current revive pointer */
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* that part of the plex is still down */
+ } else if (diskend >= plex->revived) /* write finishes beyond revive pointer */
+ rq->flags |= XFR_REVIVECONFLICT; /* note a potential conflict */
+ /* FALLTHROUGH */
+
+ case plex_up:
+ case plex_degraded:
+ case plex_flaky:
+ /* We can access the plex: let's see
+ * how the subdisk feels */
+ switch (sd->state) {
+ case sd_up:
+ return REQUEST_OK;
+
+ case sd_reborn:
+ if (writeop)
+ return REQUEST_OK; /* always write to a reborn disk */
+ /* Handle the mapping. We don't want to reject
+ * a read request to a reborn subdisk if that's
+ * all we have. XXX */
+ return REQUEST_DOWN;
+
+ case sd_down:
+ case sd_crashed:
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* and it's down one way or another */
+
+ default:
+ return REQUEST_DOWN;
+ }
+
+ default:
+ return REQUEST_DOWN;
+ }
+}
+
+void
+add_defective_region(struct plex *plex, off_t offset, size_t length)
+{
+/* XXX get this ordered, and coalesce regions if necessary */
+ if (++plex->defective_regions > plex->defective_region_count)
+ EXPAND(plex->defective_region,
+ struct plexregion,
+ plex->defective_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->defective_region[plex->defective_regions - 1].offset = offset;
+ plex->defective_region[plex->defective_regions - 1].length = length;
+}
+
+void
+add_unmapped_region(struct plex *plex, off_t offset, size_t length)
+{
+ if (++plex->unmapped_regions > plex->unmapped_region_count)
+ EXPAND(plex->unmapped_region,
+ struct plexregion,
+ plex->unmapped_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->unmapped_region[plex->unmapped_regions - 1].offset = offset;
+ plex->unmapped_region[plex->unmapped_regions - 1].length = length;
+}
+
+/* Rebuild a plex free list and set state if
+ * we have a configuration error */
+void
+rebuild_plex_unmappedlist(struct plex *plex)
+{
+ int sdno;
+ struct sd *sd;
+ int lastsdend = 0; /* end offset of last subdisk */
+
+ if (plex->unmapped_region != NULL) { /* we're going to rebuild it */
+ Free(plex->unmapped_region);
+ plex->unmapped_region = NULL;
+ plex->unmapped_regions = 0;
+ plex->unmapped_region_count = 0;
+ }
+ if (plex->defective_region != NULL) {
+ Free(plex->defective_region);
+ plex->defective_region = NULL;
+ plex->defective_regions = 0;
+ plex->defective_region_count = 0;
+ }
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ if (sd->plexoffset < lastsdend) { /* overlap */
+ printf("vinum: Plex %s, subdisk %s overlaps previous\n", plex->name, sd->name);
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* don't allow that */
+ } else if (sd->plexoffset > lastsdend) /* gap */
+ add_unmapped_region(plex, lastsdend, sd->plexoffset - lastsdend);
+ else if (sd->state < sd_reborn) /* this part defective */
+ add_defective_region(plex, sd->plexoffset, sd->sectors);
+ lastsdend = sd->plexoffset + sd->sectors;
+ }
+}
+
+/* return a state map for the subdisks of a plex */
+enum sdstates
+sdstatemap(struct plex *plex, int *sddowncount)
+{
+ int sdno;
+ enum sdstates statemap = 0; /* note the states we find */
+
+ *sddowncount = 0; /* no subdisks down yet */
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
+
+ switch (sd->state) {
+ case sd_empty:
+ statemap |= sd_emptystate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_init:
+ statemap |= sd_initstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_down:
+ statemap |= sd_downstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_crashed:
+ statemap |= sd_crashedstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_obsolete:
+ statemap |= sd_obsolete;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_stale:
+ statemap |= sd_stalestate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_reborn:
+ statemap |= sd_rebornstate;
+ break;
+
+ case sd_up:
+ statemap |= sd_upstate;
+ break;
+
+ default:
+ statemap |= sd_otherstate;
+ break;
+ }
+ }
+ return statemap;
+}
+
+/* determine the state of the volume relative to this plex */
+enum volplexstate
+vpstate(struct plex *plex)
+{
+ struct volume *vol;
+ enum volplexstate state = volplex_onlyusdown; /* state to return */
+ int plexno;
+
+ if (plex->volno < 0) /* not associated with a volume */
+ return volplex_onlyusdown; /* assume the worst */
+
+ vol = &VOL[plex->volno]; /* point to our volume */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ if (&PLEX[vol->plex[plexno]] == plex) { /* us */
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* are we up? */
+ state |= volplex_onlyus; /* yes */
+ } else {
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* not us */
+ state |= volplex_otherup; /* and when they were up, they were up */
+ else
+ state |= volplex_alldown; /* and when they were down, they were down */
+ }
+ }
+ return state; /* and when they were only halfway up */
+} /* they were neither up nor down */
+
+/* Check if all bits b are set in a */
+int allset(int a, int b);
+
+int
+allset(int a, int b)
+{
+ return (a & b) == b;
+}
+
+/* Update the state of a plex dependent on its subdisks.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_plex_state(int plexno, enum plexstate state, enum setstateflags flags)
+{
+ int sddowncount = 0; /* number of down subdisks */
+ struct plex *plex = &PLEX[plexno]; /* point to our plex */
+ enum plexstate oldstate = plex->state;
+ enum volplexstate vps = vpstate(plex); /* how do we compare with the other plexes? */
+ enum sdstates statemap = sdstatemap(plex, &sddowncount); /* get a map of the subdisk states */
+
+ if ((flags & setstate_force) && (oldstate == state)) /* we're there already, */
+ return 0; /* no change */
+
+ if (plex->state == plex_unallocated) /* no plex to do anything with, */
+ return 0;
+
+ switch (state) {
+ case plex_up:
+ if ((plex->state == plex_initializing) /* we're initializing */
+ &&(statemap != sd_upstate)) /* but SDs aren't up yet */
+ return 0; /* do nothing */
+
+ /* We don't really care what our state was before
+ * if we want to come up. We rely entirely on the
+ * state of our subdisks and our volume */
+ switch (vps) {
+ case volplex_onlyusdown:
+ case volplex_alldown: /* another plex is down, and so are we */
+ if (statemap == sd_upstate) { /* all subdisks ready for action */
+ if ((plex->state == plex_init) /* we're brand spanking new */
+ &&(VOL[plex->volno].flags & VF_CONFIG_SETUPSTATE)) { /* and we consider that up */
+ /* Conceptually, an empty plex does not contain valid data,
+ * but normally we'll see this state when we have just
+ * created a plex, and it's either consistent from earlier,
+ * or we don't care about the previous contents (we're going
+ * to create a file system or use it for swap).
+ *
+ * We need to do this in one swell foop: on the next call
+ * we will no longer be just empty.
+ *
+ * We'll still come back to this function for the remaining
+ * plexes in the volume. They'll be up already, so that
+ * doesn't change anything, but it's not worth the additional
+ * code to stop doing it. */
+ struct volume *vol = &VOL[plex->volno];
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++)
+ PLEX[vol->plex[plexno]].state = plex_up;
+ }
+ plex->state = plex_up; /* bring up up, anyway */
+ } else
+ plex->state = plex_down;
+ break;
+
+ case volplex_onlyusup: /* only we are up: others are down */
+ case volplex_onlyus: /* we're up and alone */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate)) /* or all empty */
+ plex->state = plex_up; /* go for it */
+ else if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ plex->state = plex_flaky;
+ else if (statemap & (sd_upstate | sd_reborn)) /* some up or reborn, */
+ plex->state = plex_degraded; /* so far no corruption */
+ else
+ plex->state = plex_faulty;
+ break;
+
+ case volplex_otherup: /* another plex is up */
+ case volplex_otherupdown: /* other plexes are up and down */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate) /* or all empty */
+ ) {
+ /* Is the data in all subdisks valid? */
+ if (statemap == statemap & (sd_downstate | sd_rebornstate | sd_upstate))
+ break; /* yes, we can bring the plex up */
+ plex->state = plex_reviving; /* we need reviving */
+ return EAGAIN;
+ } else
+ plex->state = plex_faulty; /* still in error */
+ break;
+
+ case volplex_allup: /* all plexes are up */
+ case volplex_someup:
+ if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ break; /* no change */
+ else
+ plex->state = plex_degraded; /* we're not all there */
+ }
+
+ if (plex->state != oldstate)
+ break;
+ return 0; /* no change */
+
+ case plex_down: /* want to take it down */
+ if (((vps == volplex_onlyus) /* we're the only one up */
+ ||(vps == volplex_onlyusup)) /* we're the only one up */
+ &&(!(flags & setstate_force))) /* and we don't want to use force */
+ return 0; /* can't do it */
+ plex->state = state; /* do it */
+ break;
+
+ /* This is only requested by the driver.
+ * Trust ourselves */
+ case plex_faulty:
+ plex->state = state; /* do it */
+ break;
+
+ case plex_initializing:
+ /* XXX consider what safeguards we need here */
+ if ((flags & setstate_force) == 0)
+ return 0;
+ plex->state = state; /* do it */
+ break;
+
+ /* What's this? */
+ default:
+ return 0;
+ }
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ /* Now see what we have left, and whether
+ * we're taking the volume down */
+ if (plex->volno >= 0) { /* we have a volume */
+ struct volume *vol = &VOL[plex->volno];
+
+ vps = vpstate(plex); /* get our combined state again */
+ if ((flags & setstate_norecurse) == 0) { /* we can recurse */
+ if ((vol->state == volume_up)
+ && (vps == volplex_alldown)) /* and we're all down */
+ set_volume_state(plex->volno, volume_down, setstate_recursing); /* take our volume down */
+ else if ((vol->state == volume_down)
+ && (vps & (volplex_otherup | volplex_onlyusup))) /* and at least one is up */
+ set_volume_state(plex->volno, volume_up, setstate_recursing); /* bring our volume up */
+ }
+ }
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+}
+
+/* Update the state of a plex dependent on its plexes.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_volume_state(int volno, enum volumestate state, enum setstateflags flags)
+{
+ int plexno;
+ enum plexstates {
+ plex_downstate = 1, /* found a plex which is down */
+ plex_degradedstate = 2, /* found a plex which is halfway up */
+ plex_upstate = 4 /* found a plex which is completely up */
+ };
+
+ int plexstatemap = 0; /* note the states we find */
+ struct volume *vol = &VOL[volno]; /* point to our volume */
+
+ if (vol->state == state) /* we're there already */
+ return 0; /* no change */
+ if (vol->state == volume_unallocated) /* no volume to do anything with, */
+ return 0;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ struct plex *plex = &PLEX[vol->plex[plexno]]; /* point to the plex */
+ switch (plex->state) {
+ case plex_degraded:
+ case plex_flaky:
+ case plex_reviving:
+ plexstatemap |= plex_degradedstate;
+ break;
+
+ case plex_up:
+ plexstatemap |= plex_upstate;
+ break;
+
+ default:
+ plexstatemap |= plex_downstate;
+ break;
+ }
+ }
+
+ if (state == volume_up) { /* want to come up */
+ if (plexstatemap & plex_upstate) { /* we have a plex which is completely up */
+ vol->state = volume_up; /* did it */
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ /* Here we should check whether we have enough
+ * coverage for the complete volume. Writeme XXX */
+ } else if (state == volume_down) { /* want to go down */
+ if ((vol->opencount == 0) /* not open */
+ ||(flags & setstate_force != 0)) { /* or we're forcing */
+ vol->state = volume_down;
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ }
+ return 0; /* no change */
+}
+
+/* Start an object, in other words do what we can to get it up.
+ * This is called from vinumioctl (VINUMSTART).
+ * Return error indications via ioctl_reply
+ */
+void
+start_object(struct vinum_ioctl_msg *data)
+{
+ int status;
+ int realstatus; /* what we really have */
+ int objindex = data->index; /* data gets overwritten */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_up, setstate_none);
+ realstatus = DRIVE[objindex].state == drive_up; /* set status on whether we really did it */
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_up, setstate_none); /* set state */
+ realstatus = SD[objindex].state == sd_up; /* set status on whether we really did it */
+ break;
+
+ case plex_object:
+ if (PLEX[objindex].state == plex_reviving) { /* reviving, */
+ ioctl_reply->error = revive_block(objindex); /* revive another block */
+ ioctl_reply->msg[0] = '\0'; /* no comment */
+ return;
+ }
+ status = set_plex_state(objindex, plex_up, setstate_none);
+ realstatus = PLEX[objindex].state == plex_up; /* set status on whether we really did it */
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_up, setstate_none);
+ realstatus = VOL[objindex].state == volume_up; /* set status on whether we really did it */
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ /* There's no point in saying anything here:
+ * the userland program does it better */
+ ioctl_reply->msg[0] = '\0';
+ if (realstatus == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* Stop an object, in other words do what we can to get it down
+ * This is called from vinumioctl (VINUMSTOP).
+ * Return error indications via ioctl_reply.
+ */
+void
+stop_object(struct vinum_ioctl_msg *data)
+{
+ int status = 1;
+ int objindex = data->index; /* save the number from change */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_down, data->force);
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_down, data->force);
+ break;
+
+ case plex_object:
+ status = set_plex_state(objindex, plex_down, data->force);
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_down, data->force);
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ ioctl_reply->msg[0] = '\0';
+ if (status == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* VINUM_SETSTATE ioctl: set an object state
+ * msg is the message passed by the user */
+void
+setstate(struct vinum_ioctl_msg *msg)
+{
+ int sdno;
+ struct sd *sd;
+ struct plex *plex;
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) msg; /* format for returning replies */
+
+ switch (msg->state) {
+ case object_down:
+ stop_object(msg);
+ break;
+
+ case object_initializing:
+ switch (msg->type) {
+ case sd_object:
+ sd = &SD[msg->index];
+ if ((msg->index >= vinum_conf.subdisks_used)
+ || (sd->state == sd_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_sd_state(msg->index, sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else
+ ioctl_reply->error = 0;
+ break;
+
+ case plex_object:
+ plex = &PLEX[msg->index];
+ if ((msg->index >= vinum_conf.plexes_used)
+ || (plex->state == plex_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_plex_state(msg->index, plex_initializing, msg->force);
+ if (plex->state != plex_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else {
+ ioctl_reply->error = 0;
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ set_sd_state(plex->sdnos[sdno], sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ break;
+ }
+ }
+ }
+ break;
+
+ default:
+ strcpy(ioctl_reply->msg, "Invalid object");
+ ioctl_reply->error = EINVAL;
+ }
+ break;
+
+ case object_up:
+ start_object(msg);
+ }
+}
diff --git a/lkm/vinum/statetexts.h b/lkm/vinum/statetexts.h
new file mode 100644
index 000000000000..b7ce4eb54bef
--- /dev/null
+++ b/lkm/vinum/statetexts.h
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
+ */
+/* Created by ./makestatetext on Tue 4 Aug 15:53:16 CST 1998. Do not edit */
+
+/* Drive state texts */
+char *drivestatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "down",
+ "coming_up",
+ "up",
+};
+
+/* Subdisk state texts */
+char *sdstatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "init",
+ "initializing",
+ "empty",
+ "obsolete",
+ "stale",
+ "crashed",
+ "down",
+ "reborn",
+ "up",
+};
+
+/* Plex state texts */
+char *plexstatetext[] =
+{
+ "unallocated",
+ "init",
+ "faulty",
+ "down",
+ "reviving",
+ "initializing",
+ "corrupt",
+ "degraded",
+ "flaky",
+ "up",
+};
+
+/* Volume state texts */
+char *volstatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "down",
+ "up",
+};
diff --git a/lkm/vinum/util.c b/lkm/vinum/util.c
new file mode 100644
index 000000000000..512140438fc9
--- /dev/null
+++ b/lkm/vinum/util.c
@@ -0,0 +1,211 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: util.c,v 1.7 1998/08/07 09:23:10 grog Exp grog $
+ */
+
+/* This file contains utility routines used both in kernel and user context */
+
+#include "vinumhdr.h"
+#include "statetexts.h"
+#ifndef REALLYKERNEL
+#include <stdio.h>
+extern jmp_buf command_fail; /* return on a failed command */
+#endif
+
+static char numeric_state[32]; /* temporary buffer for ASCII conversions */
+#define STATECOUNT(x) (sizeof (x##statetext) / sizeof (char *))
+/* Return drive state as a string */
+char *
+drive_state(enum drivestate state)
+{
+ if (((unsigned) state) >= STATECOUNT(drive)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return drivestatetext[state];
+}
+
+/* Return volume state as a string */
+char *
+volume_state(enum volumestate state)
+{
+ if (((unsigned) state) >= STATECOUNT(vol)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return volstatetext[state];
+}
+
+/* Return plex state as a string */
+char *
+plex_state(enum plexstate state)
+{
+ if (((unsigned) state) >= STATECOUNT(plex)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return plexstatetext[state];
+}
+
+/* Return plex organization as a string */
+char *
+plex_org(enum plexorg org)
+{
+ switch (org) {
+ case plex_disorg: /* disorganized */
+ return "disorg";
+ break;
+
+ case plex_concat: /* concatenated plex */
+ return "concat";
+ break;
+
+ case plex_striped: /* striped plex */
+ return "striped";
+ break;
+
+
+ default:
+ sprintf(numeric_state, "Invalid org %d", (int) org);
+ return numeric_state;
+ }
+}
+
+/* Return sd state as a string */
+char *
+sd_state(enum sdstate state)
+{
+ if (((unsigned) state) >= STATECOUNT(sd)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return sdstatetext[state];
+}
+
+/* Now convert in the other direction */
+/* These are currently used only internally,
+ * so we don't do too much error checking */
+enum drivestate
+DriveState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(drive); i++)
+ if (strcmp(text, drivestatetext[i]) == 0) /* found it */
+ return (enum drivestate) i;
+ return -1;
+}
+
+enum sdstate
+SdState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(sd); i++)
+ if (strcmp(text, sdstatetext[i]) == 0) /* found it */
+ return (enum sdstate) i;
+ return -1;
+}
+
+enum plexstate
+PlexState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(plex); i++)
+ if (strcmp(text, plexstatetext[i]) == 0) /* found it */
+ return (enum plexstate) i;
+ return -1;
+}
+
+enum volumestate
+VolState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(vol); i++)
+ if (strcmp(text, volstatetext[i]) == 0) /* found it */
+ return (enum volstate) i;
+ return -1;
+}
+
+/* Take a number with an optional scale factor and convert
+ * it to a number of bytes.
+ *
+ * The scale factors are:
+ *
+ * b blocks (of 512 bytes)
+ * k kilobytes (1024 bytes)
+ * m megabytes (of 1024 * 1024 bytes)
+ * g gigabytes (of 1024 * 1024 * 1024 bytes)
+ */
+u_int64_t
+sizespec(char *spec)
+{
+ u_int64_t size;
+ char *s;
+
+ size = 0;
+ s = spec;
+ if ((*s >= '0') && (*s <= '9')) { /* it's numeric */
+ while ((*s >= '0') && (*s <= '9')) /* it's numeric */
+ size = size * 10 + *s++ - '0'; /* convert it */
+ switch (*s) {
+ case '\0':
+ return size;
+
+ case 'B':
+ case 'b':
+ return size * 512;
+
+ case 'K':
+ case 'k':
+ return size * 1024;
+
+ case 'M':
+ case 'm':
+ return size * 1024 * 1024;
+
+ case 'G':
+ case 'g':
+ return size * 1024 * 1024 * 1024;
+ }
+ }
+#ifdef REALLYKERNEL
+ throw_rude_remark(EINVAL, "Invalid length specification: %s", spec);
+#else
+ fprintf(stderr, "Invalid length specification: %s", spec);
+ longjmp(command_fail, -1);
+#endif
+ /* NOTREACHED */
+ return -1;
+}
diff --git a/lkm/vinum/vinum.c b/lkm/vinum/vinum.c
new file mode 100644
index 000000000000..bffdf6d435d6
--- /dev/null
+++ b/lkm/vinum/vinum.c
@@ -0,0 +1,512 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinum.c,v 1.19 1998/08/13 05:24:02 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
+#include <sys/reboot.h>
+int debug = 0;
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
+
+#if __FreeBSD__ < 3
+STATIC struct cdevsw vinum_cdevsw;
+STATIC struct bdevsw vinum_bdevsw =
+{
+ vinumopen, vinumclose, vinumstrategy, vinumioctl,
+ vinumdump, vinumsize, 0,
+ "vinum", &vinum_cdevsw, -1
+};
+#else /* goodbye, bdevsw */
+STATIC struct cdevsw vinum_cdevsw =
+{
+ vinumopen, vinumclose, vinumread, vinumwrite,
+ vinumioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, vinumstrategy, "vinum",
+ NULL, -1, vinumdump, vinumsize,
+ D_DISK, 0, -1
+};
+#endif
+
+/* Called by main() during pseudo-device attachment. */
+STATIC void vinumattach(void *);
+
+STATIC void vinumgetdisklabel(dev_t);
+void vinum_scandisk(void);
+int vinum_inactive(void);
+void free_vinum(int);
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+extern jmp_buf command_fail; /* return here if config fails */
+
+struct _vinum_conf vinum_conf; /* configuration information */
+
+STATIC int vinum_devsw_installed = 0;
+
+/*
+ * Called by main() during pseudo-device attachment. All we need
+ * to do is allocate enough space for devices to be configured later, and
+ * add devsw entries.
+ */
+void
+vinumattach(void *dummy)
+{
+ BROKEN_GDB;
+ char *buf; /* pointer to temporary buffer */
+ struct _ioctl_reply *ioctl_reply; /* struct to return */
+ struct uio uio;
+ struct iovec iovec;
+
+ /* modload should prevent multiple loads, so this is worth a panic */
+ if ((vinum_conf.flags & VF_LOADED) != NULL)
+ panic("vinum: already loaded");
+
+ printf("vinum: loaded\n");
+ vinum_conf.flags |= VF_LOADED; /* we're loaded now */
+
+ /* We don't have a p pointer here, so take it from curproc */
+ myproc = curproc;
+#if __FreeBSD__ < 3
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_bdevsw);
+#else
+ cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_cdevsw);
+#endif
+#ifdef DEVFS
+#error DEVFS not finished yet
+#endif
+
+ uio.uio_iov = &iovec;
+ uio.uio_iovcnt = 1; /* just one buffer */
+ uio.uio_offset = 0; /* start at the beginning */
+ uio.uio_resid = 512; /* one sector */
+ uio.uio_segflg = UIO_SYSSPACE; /* we're in system space */
+ uio.uio_rw = UIO_READ; /* do we need this? */
+ uio.uio_procp = curproc; /* do it for our own process */
+
+ iovec.iov_len = 512;
+ buf = (char *) Malloc(iovec.iov_len); /* get a buffer */
+ CHECKALLOC(buf, "vinum: no memory\n"); /* can't get 512 bytes? */
+ iovec.iov_base = buf; /* read into buf */
+
+ /* allocate space: drives... */
+ DRIVE = (struct drive *) Malloc(sizeof(struct drive) * INITIAL_DRIVES);
+ CHECKALLOC(DRIVE, "vinum: no memory\n");
+ vinum_conf.drives_allocated = INITIAL_DRIVES; /* number of drive slots allocated */
+ vinum_conf.drives_used = 0; /* and number in use */
+
+ /* volumes, ... */
+ VOL = (struct volume *) Malloc(sizeof(struct volume) * INITIAL_VOLUMES);
+ CHECKALLOC(VOL, "vinum: no memory\n");
+ vinum_conf.volumes_allocated = INITIAL_VOLUMES; /* number of volume slots allocated */
+ vinum_conf.volumes_used = 0; /* and number in use */
+
+ /* plexes, ... */
+ PLEX = (struct plex *) Malloc(sizeof(struct plex) * INITIAL_PLEXES);
+ CHECKALLOC(PLEX, "vinum: no memory\n");
+ vinum_conf.plexes_allocated = INITIAL_PLEXES; /* number of plex slots allocated */
+ vinum_conf.plexes_used = 0; /* and number in use */
+
+ /* and subdisks */
+ SD = (struct sd *) Malloc(sizeof(struct sd) * INITIAL_SUBDISKS);
+ CHECKALLOC(SD, "vinum: no memory\n");
+ vinum_conf.subdisks_allocated = INITIAL_SUBDISKS; /* number of sd slots allocated */
+ vinum_conf.subdisks_used = 0; /* and number in use */
+
+ ioctl_reply = NULL; /* no reply on longjmp */
+}
+
+
+#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
+
+/* Check if we have anything open. If so, return 0 (not inactive),
+ * otherwise 1 (inactive) */
+int
+vinum_inactive(void)
+{
+ BROKEN_GDB;
+ int i;
+ int can_do = 1; /* assume we can do it */
+
+ lock_config();
+ for (i = 0; i < vinum_conf.volumes_used; i++) {
+ if (VOL[i].pid != NULL) { /* volume is open */
+ can_do = 0;
+ break;
+ }
+ }
+ unlock_config();
+ return can_do;
+}
+
+/* Free all structures.
+ * If cleardrive is 0, save the configuration; otherwise
+ * remove the configuration from the drive.
+ *
+ * Before coming here, ensure that no volumes are open.
+ */
+void
+free_vinum(int cleardrive)
+{
+ BROKEN_GDB;
+ int i;
+
+ if (cleardrive) {
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ remove_drive(i); /* remove the drive */
+ } else { /* keep the config */
+ save_config();
+ if (DRIVE != NULL) {
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ free_drive(&DRIVE[i]); /* close files and things */
+ Free(DRIVE);
+ }
+ }
+ if (SD != NULL)
+ Free(SD);
+ if (PLEX != NULL) {
+ for (i = 0; i < vinum_conf.plexes_used; i++) {
+ struct plex *plex = &vinum_conf.plex[i];
+
+ if (plex->state != plex_unallocated) { /* we have real data there */
+ if (plex->sdnos)
+ Free(plex->sdnos);
+ if (plex->unmapped_regions)
+ Free(plex->unmapped_region);
+ if (plex->defective_regions)
+ Free(plex->defective_region);
+ }
+ }
+ Free(PLEX);
+ }
+ if (VOL != NULL)
+ Free(VOL);
+ bzero(&vinum_conf, sizeof(vinum_conf));
+}
+
+MOD_MISC(vinum);
+
+/*
+ * Function called when loading the driver.
+ */
+STATIC int
+vinum_load(struct lkm_table *lkmtp, int cmd)
+{
+ BROKEN_GDB;
+/* Debugger ("vinum_load"); */
+ vinumattach(NULL);
+ return 0; /* OK */
+}
+
+/*
+ * Function called when unloading the driver.
+ */
+STATIC int
+vinum_unload(struct lkm_table *lkmtp, int cmd)
+{
+ BROKEN_GDB;
+ if (vinum_inactive()) { /* is anything open? */
+ struct sync_args dummyarg =
+ {0};
+#if __FreeBSD__ < 3
+ int retval;
+#endif
+
+ printf("vinum: unloaded\n");
+#if __FreeBSD__ < 3
+ sync(curproc, &dummyarg, &retval); /* write out buffers */
+#else
+ sync(curproc, &dummyarg); /* write out buffers */
+#endif
+ free_vinum(0); /* no: clean up */
+#if __FreeBSD__ < 3
+ bdevsw[BDEV_MAJOR] = NULL; /* clear bdevsw */
+#endif
+ cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
+ return 0;
+ } else
+ return EBUSY;
+}
+
+/*
+ * Dispatcher function for the module (load/unload/stat).
+ */
+int
+vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ BROKEN_GDB;
+ MOD_DISPATCH(vinum, /* module name */
+ lkmtp, /* LKM table */
+ cmd, /* command */
+ ver,
+ vinum_load, /* load with this function */
+ vinum_unload, /* and unload with this */
+ lkm_nullcmd);
+}
+
+#else /* not LKM */
+#error "This driver must be compiled as a loadable kernel module"
+#endif /* LKM */
+
+/* ARGSUSED */
+/* Open a vinum object
+ * At the moment, we only open volumes and the
+ * super device. It's a nice concept to be
+ * able to open drives, subdisks and plexes, but
+ * I can't think what good it could be */
+int
+vinumopen(dev_t dev,
+ int flags,
+ int fmt,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ int s; /* spl */
+ int error;
+ unsigned int index;
+ struct volume *vol;
+ struct plex *plex;
+ struct sd *sd;
+ struct devcode *device;
+
+ device = (struct devcode *) &dev;
+
+ error = 0;
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_VOLUME_TYPE:
+ index = VOLNO(dev);
+ if (index >= vinum_conf.volumes_used)
+ return ENXIO; /* no such device */
+ vol = &VOL[index];
+
+ switch (vol->state) {
+ case volume_unallocated:
+ case volume_uninit:
+ return ENXIO;
+
+ case volume_up:
+ s = splhigh(); /* quick lock */
+ if (error)
+ return error;
+ if (vol->opencount == 0)
+ vol->openflags = flags; /* set our flags */
+ vol->opencount++;
+ vol->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+
+ case volume_down:
+ return EIO;
+
+ default:
+ return EINVAL;
+ }
+
+ case VINUM_PLEX_TYPE:
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
+ return ENXIO;
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
+ if (index >= vinum_conf.plexes_used)
+ return ENXIO; /* no such device */
+ plex = &PLEX[index];
+
+ switch (plex->state) {
+ case plex_unallocated:
+ return EINVAL;
+
+ default:
+ s = splhigh();
+ if (plex->pid /* it's open already */
+ && (plex->pid != p->p_pid)) { /* and not by us, */
+ splx(s);
+ return EBUSY; /* one at a time, please */
+ }
+ plex->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+ }
+
+ case VINUM_SD_TYPE:
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ return ENXIO; /* no such device */
+ index = SDNO(dev); /* get the subdisk number */
+ if (index >= vinum_conf.subdisks_used)
+ return ENXIO; /* no such device */
+ sd = &SD[index];
+
+ /* Opening a subdisk is always a special operation, so we
+ * ignore the state as long as it represents a real subdisk */
+ switch (sd->state) {
+ case sd_unallocated:
+ case sd_uninit:
+ return EINVAL;
+
+ default:
+ s = splhigh();
+ if (sd->pid /* it's open already */
+ && (sd->pid != p->p_pid)) { /* and not by us, */
+ splx(s);
+ return EBUSY; /* one at a time, please */
+ }
+ sd->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+ }
+
+ case VINUM_DRIVE_TYPE:
+ default:
+ return ENODEV; /* don't know what to do with these */
+
+ case VINUM_SUPERDEV_TYPE:
+ if (p->p_ucred->cr_uid == 0) { /* root calling, */
+ vinum_conf.opencount++; /* one more opener */
+ return 0; /* no worries opening super dev */
+ } else
+ return EPERM; /* you can't do that! */
+ }
+}
+
+/* ARGSUSED */
+int
+vinumclose(dev_t dev,
+ int flags,
+ int fmt,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ unsigned int index;
+ struct volume *vol;
+ struct plex *plex;
+ struct sd *sd;
+ struct devcode *device = (struct devcode *) &dev;
+
+ index = VOLNO(dev);
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_VOLUME_TYPE:
+ if (index >= vinum_conf.volumes_used)
+ return ENXIO; /* no such device */
+ vol = &VOL[index];
+
+ switch (vol->state) {
+ case volume_unallocated:
+ case volume_uninit:
+ return ENXIO;
+
+ case volume_up:
+ vol->opencount = 0; /* reset our flags */
+ vol->pid = NULL; /* and forget who owned us */
+ return 0;
+
+ case volume_down:
+ return EIO;
+
+ default:
+ return EINVAL;
+ }
+
+ case VINUM_PLEX_TYPE:
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
+ return ENXIO;
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
+ if (index >= vinum_conf.plexes_used)
+ return ENXIO; /* no such device */
+ plex = &PLEX[index];
+ plex->pid = 0;
+ return 0;
+
+ case VINUM_SD_TYPE:
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ return ENXIO; /* no such device */
+ index = SDNO(dev); /* get the subdisk number */
+ if (index >= vinum_conf.subdisks_used)
+ return ENXIO; /* no such device */
+ sd = &SD[index];
+ sd->pid = 0;
+ return 0;
+
+ case VINUM_SUPERDEV_TYPE:
+ if (p->p_ucred->cr_uid == 0) /* root calling, */
+ vinum_conf.opencount--; /* one less opener */
+ return 0; /* no worries closing super dev */
+
+ case VINUM_DRIVE_TYPE:
+ default:
+ return ENODEV; /* don't know what to do with these */
+ }
+}
+
+/* size routine */
+int
+vinumsize(dev_t dev)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+ int size;
+
+/* XXX This is bogus. We don't need to open
+ * a device to find its size */
+ vol = &VOL[VOLNO(dev)];
+
+ if (vol->state == volume_up)
+ size = vol->size;
+ else
+ return 0; /* err on the size of conservatism */
+
+
+ return size;
+}
+
+int
+vinumdump(dev_t dev)
+{
+ /* Not implemented. */
+ return ENXIO;
+}
diff --git a/lkm/vinum/vinumext.h b/lkm/vinum/vinumext.h
new file mode 100644
index 000000000000..4b7d5a01d642
--- /dev/null
+++ b/lkm/vinum/vinumext.h
@@ -0,0 +1,214 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumext.h,v 1.14 1998/08/11 00:03:57 grog Exp grog $
+ */
+
+/* vinumext.h: external definitions */
+
+extern struct _vinum_conf vinum_conf; /* configuration information */
+
+#ifdef DEBUG
+extern debug; /* debug flags */
+#endif
+
+#define CHECKALLOC(ptr, msg) \
+ if (ptr == NULL) \
+ { \
+ printf (msg); \
+ longjmp (command_fail, -1); \
+ }
+#ifndef KERNEL
+struct vnode;
+struct proc;
+#endif
+
+#ifdef KERNEL
+int give_sd_to_plex(int plexno, int sdno);
+int give_plex_to_volume(int volno, int plexno);
+int check_drive(char *);
+enum drive_label_info read_drive_label(struct drive *drive);
+int parse_config(char *, struct keywordset *);
+int parse_user_config(char *cptr, struct keywordset *keyset);
+u_int64_t sizespec(char *spec);
+int volume_index(struct volume *volume);
+int plex_index(struct plex *plex);
+int sd_index(struct sd *sd);
+int drive_index(struct drive *drive);
+int my_plex(int volno, int plexno);
+int my_sd(int plexno, int sdno);
+int get_empty_drive(void);
+int find_drive(const char *name, int create);
+int find_drive_by_dev(const char *devname, int create);
+int get_empty_sd(void);
+int find_subdisk(const char *name, int create);
+void free_sd(int sdno);
+void free_volume(int volno);
+int get_empty_plex(void);
+int find_plex(const char *name, int create);
+void free_plex(int plexno);
+int get_empty_volume(void);
+int find_volume(const char *name, int create);
+void config_subdisk(void);
+void config_plex(void);
+void config_volume(void);
+void config_drive(void);
+void updateconfig(int);
+void update_sd_config(int sdno, int kernelstate);
+void update_plex_config(int plexno, int kernelstate);
+void update_volume_config(int volno, int kernelstate);
+void update_config(void);
+void drive_io_done(struct buf *);
+int save_config(void);
+void write_config(char *, int);
+int start_config(void);
+void finish_config(int);
+void remove(struct vinum_ioctl_msg *msg);
+void remove_drive_entry(int driveno, int force, int recurse);
+void remove_sd_entry(int sdno, int force, int recurse);
+void remove_plex_entry(int plexno, int force, int recurse);
+void remove_volume_entry(int volno, int force, int recurse);
+
+void checkernel(char *);
+int open_drive(struct drive *, struct proc *);
+void close_drive(struct drive *drive);
+int driveio(struct drive *, void *, size_t, off_t, int);
+/* #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
+ #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE) */
+int set_drive_parms(struct drive *drive);
+int init_drive(struct drive *);
+/* void throw_rude_remark (int, struct _ioctl_reply *, char *, ...); XXX */
+void throw_rude_remark(int, char *,...);
+
+int read_drive(struct drive *drive, void *buf, size_t length, off_t offset);
+int write_drive(struct drive *drive, void *buf, size_t length, off_t offset);
+void format_config(char *config, int len);
+void checkkernel(char *op);
+void free_drive(struct drive *drive);
+void down_drive(struct drive *drive);
+void remove_drive(int driveno);
+
+/* I/O */
+d_open_t vinumopen;
+d_close_t vinumclose;
+d_strategy_t vinumstrategy;
+d_ioctl_t vinumioctl;
+d_dump_t vinumdump;
+d_psize_t vinumsize;
+d_read_t vinumread;
+d_write_t vinumwrite;
+
+int vinumstart(struct buf *bp, int reviveok);
+int launch_requests(struct request *rq, int reviveok);
+
+/* XXX Do we need this? */
+int vinumpart(dev_t);
+
+/* Memory allocation */
+void vinum_meminfo(caddr_t data);
+int vinum_mallocinfo(caddr_t data);
+
+void expand_table(void **, int, int);
+
+void add_defective_region(struct plex *plex, off_t offset, size_t length);
+void add_unmapped_region(struct plex *plex, off_t offset, size_t length);
+void rebuild_plex_unmappedlist(struct plex *plex);
+struct request;
+struct rqgroup *allocrqg(struct request *rq, int elements);
+void deallocrqg(struct rqgroup *rqg);
+
+/* State transitions */
+int set_drive_state(int driveno, enum drivestate state, int force);
+int set_sd_state(int sdno, enum sdstate state, enum setstateflags flags);
+enum requeststatus checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend);
+int set_plex_state(int plexno, enum plexstate state, enum setstateflags flags);
+int set_volume_state(int volumeno, enum volumestate state, enum setstateflags flags);
+void get_volume_label(struct volume *vol, struct disklabel *lp);
+int write_volume_label(int);
+void start_object(struct vinum_ioctl_msg *);
+void stop_object(struct vinum_ioctl_msg *);
+void setstate(struct vinum_ioctl_msg *msg);
+void vinum_label(int);
+int vinum_writedisklabel(struct volume *, struct disklabel *);
+int initsd(int);
+
+int restart_plex(int plexno);
+int revive_block(int plexno);
+
+/* Auxiliary functions */
+enum sdstates sdstatemap(struct plex *plex, int *sddowncount);
+enum volplexstate vpstate(struct plex *plex);
+#endif
+
+enum keyword get_keyword(char *, struct keywordset *);
+void listconfig(void);
+char *drive_state(enum drivestate);
+char *volume_state(enum volumestate);
+char *plex_state(enum plexstate);
+char *plex_org(enum plexorg);
+char *sd_state(enum sdstate);
+enum drivestate DriveState(char *text);
+enum sdstate SdState(char *text);
+enum plexstate PlexState(char *text);
+enum volumestate VolState(char *text);
+struct drive *validdrive(int driveno, struct _ioctl_reply *);
+struct sd *validsd(int sdno, struct _ioctl_reply *);
+struct plex *validplex(int plexno, struct _ioctl_reply *);
+struct volume *validvol(int volno, struct _ioctl_reply *);
+int tokenize(char *, char *[]);
+void resetstats(struct vinum_ioctl_msg *msg);
+
+/* Locking */
+int lockvol(struct volume *vol);
+void unlockvol(struct volume *vol);
+int lockplex(struct plex *plex);
+void unlockplex(struct plex *plex);
+int lockrange(struct plex *plex, off_t first, off_t last);
+void unlockrange(struct plex *plex, off_t first, off_t last);
+int lock_config(void);
+void unlock_config(void);
+
+#ifdef DEBUG
+#define expandrq(prq) \
+{ \
+ expand_table ((void **) &prq->rqe, \
+ prq->requests * sizeof (struct rqelement), \
+ (prq->requests + RQELTS) * sizeof (struct rqelement) ); \
+ bzero (&prq->rqe [prq->requests], RQELTS * sizeof (struct rqelement)); \
+ prq->rqcount += RQELTS; \
+ }
+#else
+void expandrq(struct plexrq *);
+#endif
diff --git a/lkm/vinum/vinumhdr.h b/lkm/vinum/vinumhdr.h
new file mode 100644
index 000000000000..22a856182396
--- /dev/null
+++ b/lkm/vinum/vinumhdr.h
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ */
+
+/* Header files used by all modules */
+/* $Id: vinumhdr.h,v 1.7 1998/08/07 04:41:18 grog Exp grog $ */
+
+#ifdef KERNEL
+#define REALLYKERNEL
+#endif
+#include <sys/param.h>
+#ifdef REALLYKERNEL
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#endif
+#ifdef DEVFS
+#error "DEVFS code not complete yet"
+#include <sys/devfsext.h>
+#endif /*DEVFS */
+#include <sys/proc.h>
+#include <sys/errno.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/malloc.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/conf.h>
+#include <sys/stat.h>
+#include <sys/disklabel.h>
+#include <ufs/ffs/fs.h>
+#include <sys/mount.h>
+#include <sys/device.h>
+#undef KERNEL /* XXX */
+#include <sys/disk.h>
+#ifdef REALLYKERNEL
+#define KERNEL
+#endif
+#include <sys/syslog.h>
+#include <sys/fcntl.h>
+#include <sys/vnode.h>
+#include <sys/dkbad.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <vm/vm.h>
+#ifdef USES_VM
+/* XXX Do we need this? */
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_object.h>
+#include <vm/vm_prot.h>
+/* #include <vm/vm_page.h> */
+#include <sys/vmmeter.h>
+/* #include <machine/pmap.h> */
+#include <machine/cputypes.h>
+#endif /* USES_VM */
+#include <vinumvar.h>
+#include <vinumio.h>
+#include "vinumkw.h"
+#include "vinumext.h"
+
+#undef Free /* defined in some funny net stuff */
+#ifdef REALLYKERNEL
+#define Malloc(x) MMalloc ((x), __FILE__, __LINE__) /* show where we came from */
+#define Free(x) FFree ((x), __FILE__, __LINE__) /* show where we came from */
+caddr_t MMalloc (int size, char *, int);
+void FFree (void *mem, char *, int);
+#else
+#define Malloc(x) malloc ((x)) /* just the size */
+#define Free(x) free ((x)) /* just the address */
+#endif
+
diff --git a/lkm/vinum/vinumio.h b/lkm/vinum/vinumio.h
new file mode 100644
index 000000000000..be79528a6db8
--- /dev/null
+++ b/lkm/vinum/vinumio.h
@@ -0,0 +1,132 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumio.h,v 1.10 1998/08/10 05:46:19 grog Exp grog $
+ */
+
+#define MAX_IOCTL_REPLY 256
+#define L 'F' /* ID letter of our ioctls */
+/* VINUM_CREATE returns a buffer of this kind */
+struct _ioctl_reply {
+ int error;
+ char msg[MAX_IOCTL_REPLY];
+};
+
+/* ioctl requests */
+#define BUFSIZE 1024 /* size of buffer, including continuations */
+#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
+#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
+#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
+#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
+#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
+#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
+#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
+#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
+#define VINUM_SAVECONFIG _IOC(0, L, 72, 0) /* release locks, update, write config to disk */
+#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
+#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
+#ifdef DEBUG
+
+struct debuginfo {
+ int changeit;
+ int param;
+};
+
+#define VINUM_DEBUG _IOWR(L, 75, struct debuginfo) /* call the debugger from ioctl () */
+#endif
+
+enum objecttype {
+ drive_object,
+ sd_object,
+ plex_object,
+ volume_object,
+ invalid_object
+};
+
+/* Start an object. Pass two integers:
+ * msg [0] index in vinum_conf.<object>
+ * msg [1] type of object (see below)
+ *
+ * Return ioctl_reply
+ */
+#define VINUM_SETSTATE _IOC(IOC_IN | IOC_OUT, L, 76, MAX_IOCTL_REPLY) /* start an object */
+
+/* The state to set with VINUM_SETSTATE. Since
+ * each object has a different set of states, we
+ * need to translate later */
+enum objectstate {
+ object_down,
+ object_initializing,
+ object_up
+};
+
+/* This structure is used for modifying objects
+ * (VINUM_SETSTATE, VINUM_REMOVE, VINUM_RESETSTATS, VINUM_ATTACH,
+ * VINUM_DETACH, VINUM_REPLACE
+ */
+struct vinum_ioctl_msg {
+ int index;
+ enum objecttype type;
+ enum objectstate state; /* state to set (VINUM_SETSTATE) */
+ int force; /* do it even if it doesn't make sense */
+ int recurse; /* recurse (VINUM_REMOVE) */
+ int otherobject; /* superordinate object (attach),
+ * replacement object (replace) */
+ int rename; /* rename object (attach) */
+ int64_t offset; /* offset of subdisk (for attach) */
+};
+
+#define VINUM_RELEASECONFIG _IOC(0, L, 77, 0) /* release locks and write config to disk */
+#define VINUM_STARTCONFIG _IOC(0, L, 78, 0) /* start a configuration operation */
+#define VINUM_MEMINFO _IOR(L, 79, struct meminfo) /* get memory usage summary */
+#define VINUM_MALLOCINFO _IOWR(L, 80, struct mc) /* get specific malloc information [i] */
+#define VINUM_LABEL _IOC(IOC_IN | IOC_OUT, L, 81, MAX_IOCTL_REPLY) /* label a volume */
+#define VINUM_INITSD _IOW(L, 82, int) /* initialize a subdisk */
+#define VINUM_REMOVE _IOC(IOC_IN | IOC_OUT, L, 83, MAX_IOCTL_REPLY) /* remove an object */
+#define VINUM_GETUNMAPPED _IOWR(L, 84, struct plexregion) /* get unmapped element (plex, re) */
+#define VINUM_GETDEFECTIVE _IOWR(L, 85, struct plexregion) /* get defective element (plex, re) */
+#define VINUM_RESETSTATS _IOC(IOC_IN | IOC_OUT, L, 86, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_ATTACH _IOC(IOC_IN | IOC_OUT, L, 87, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_DETACH _IOC(IOC_IN | IOC_OUT, L, 88, MAX_IOCTL_REPLY) /* reset object stats */
+
+struct vinum_rename_msg {
+ int index;
+ int recurse; /* rename subordinate objects too */
+ enum objecttype type;
+ char newname[MAXNAME]; /* new name to give to object */
+};
+
+#define VINUM_RENAME _IOC(IOC_IN | IOC_OUT, L, 89, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_REPLACE _IOC(IOC_IN | IOC_OUT, L, 90, MAX_IOCTL_REPLY) /* reset object stats */
diff --git a/lkm/vinum/vinumioctl.c b/lkm/vinum/vinumioctl.c
new file mode 100644
index 000000000000..6dbe3c6bf4d6
--- /dev/null
+++ b/lkm/vinum/vinumioctl.c
@@ -0,0 +1,787 @@
+/* XXX replace all the checks on object validity with
+ * calls to valid<object> */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumioctl.c,v 1.1 1998/08/14 08:46:10 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
+#include <sys/reboot.h>
+#endif
+
+jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
+
+int vinum_inactive(void);
+void free_vinum(int);
+void attachobject(struct vinum_ioctl_msg *);
+void detachobject(struct vinum_ioctl_msg *);
+void renameobject(struct vinum_rename_msg *);
+void replaceobject(struct vinum_ioctl_msg *);
+
+/* ioctl routine */
+int
+vinumioctl(dev_t dev,
+#if __FreeBSD__ >= 3
+ u_long cmd,
+#else
+ int cmd,
+#endif
+ caddr_t data,
+ int flag,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ unsigned int objno;
+ int error = 0;
+ struct volume *vol;
+ unsigned int index; /* for transferring config info */
+ unsigned int sdno; /* for transferring config info */
+ int fe; /* free list element number */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* struct to return */
+
+ struct devcode *device = (struct devcode *) &dev;
+
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_SUPERDEV_TYPE:
+ myproc = p; /* save pointer to process */
+ ioctl_reply = (struct _ioctl_reply *) data; /* save the address to reply to */
+ error = setjmp(command_fail); /* come back here on error */
+ if (error) /* bombed out */
+ return 0; /* the reply will contain meaningful info */
+ switch (cmd) {
+ /* XXX #ifdef DEBUG */
+ case VINUM_DEBUG:
+ boothowto |= RB_GDB; /* serial debug line */
+ if (((struct debuginfo *) data)->changeit) /* change debug settings */
+ debug = (((struct debuginfo *) data)->param);
+ else
+ Debugger("vinum debug");
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+ /* XXX #endif */
+
+ case VINUM_CREATE: /* create a vinum object */
+ error = lock_config(); /* get the config for us alone */
+ if (error) /* can't do it, */
+ return error; /* give up */
+ error = setjmp(command_fail); /* come back here on error */
+ if (error == 0) { /* first time, */
+ parse_user_config((char *) data, &keyword_set); /* update the config */
+ ioctl_reply->error = 0; /* no error if we make it here */
+ } else if (ioctl_reply->error == 0) { /* longjmp, but no error status */
+ ioctl_reply->error = EINVAL; /* note that something's up */
+ ioctl_reply->msg[0] = '\0'; /* no message? */
+ }
+ unlock_config();
+ return 0; /* must be 0 to return the real error info */
+
+ case VINUM_GETCONFIG: /* get the configuration information */
+ bcopy(&vinum_conf, data, sizeof(vinum_conf));
+ return 0;
+
+ /* start configuring the subsystem */
+ case VINUM_STARTCONFIG:
+ return start_config(); /* just lock it */
+
+ /* Move the individual parts of the config to user space.
+
+ * Specify the index of the object in the first word of data,
+ * and return the object there
+ */
+ case VINUM_DRIVECONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.drives_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&DRIVE[index], data, sizeof(struct drive)); /* copy the config item out */
+ return 0;
+
+ case VINUM_SDCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.subdisks_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&SD[index], data, sizeof(struct sd)); /* copy the config item out */
+ return 0;
+
+ case VINUM_PLEXCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.plexes_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&PLEX[index], data, sizeof(struct plex)); /* copy the config item out */
+ return 0;
+
+ case VINUM_VOLCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.volumes_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&VOL[index], data, sizeof(struct volume)); /* copy the config item out */
+ return 0;
+
+ case VINUM_PLEXSDCONFIG:
+ index = *(int *) data; /* get the plex index */
+ sdno = ((int *) data)[1]; /* and the sd index */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(sdno >= PLEX[index].subdisks)) /* or it doesn't have this many subdisks */
+ return EFAULT; /* bang */
+ bcopy(&SD[PLEX[index].sdnos[sdno]], /* copy the config item out */
+ data,
+ sizeof(struct sd));
+ return 0;
+
+ case VINUM_SAVECONFIG:
+ if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
+ finish_config(1); /* finish the configuration and update it */
+ error = save_config(); /* save configuration to disk */
+ } else
+ error = EINVAL; /* queue up for this one, please */
+ return error;
+
+ case VINUM_RELEASECONFIG: /* release the config */
+ if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
+ finish_config(0); /* finish the configuration, don't change it */
+ error = save_config(); /* save configuration to disk */
+ } else
+ error = EINVAL; /* release what config? */
+ return error;
+
+ case VINUM_INIT:
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+
+ case VINUM_RESETCONFIG:
+ if (vinum_inactive() && (vinum_conf.opencount < 2)) { /* if we're not active */
+ /* Note the open count. We may be called from v, so we'll be open.
+ * Keep the count so we don't underflow */
+ int oc = vinum_conf.opencount;
+ free_vinum(1); /* clean up everything */
+ printf("vinum: CONFIGURATION OBLITERATED\n");
+ vinum_conf.opencount = oc;
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+ }
+ return EBUSY;
+
+ case VINUM_SETSTATE:
+ setstate((struct vinum_ioctl_msg *) data); /* set an object state */
+ return 0;
+
+ case VINUM_MEMINFO:
+ vinum_meminfo(data);
+ return 0;
+
+ case VINUM_MALLOCINFO:
+ return vinum_mallocinfo(data);
+
+ case VINUM_LABEL: /* label a volume */
+ ioctl_reply->error = write_volume_label(*(int *) data); /* index of the volume to label */
+ ioctl_reply->msg[0] = '\0'; /* no message */
+ return 0;
+
+ case VINUM_REMOVE:
+ remove((struct vinum_ioctl_msg *) data); /* remove an object */
+ return 0;
+
+ case VINUM_GETFREELIST: /* get a drive free list element */
+ index = *(int *) data; /* get the drive index */
+ fe = ((int *) data)[1]; /* and the free list element */
+ if ((index >= (unsigned) vinum_conf.drives_used) /* plex doesn't exist */
+ ||(DRIVE[index].state == drive_unallocated))
+ return ENODEV;
+ if (fe >= DRIVE[index].freelist_entries) /* no such entry */
+ return ENOENT;
+ bcopy(&DRIVE[index].freelist[fe],
+ data,
+ sizeof(struct drive_freelist));
+ return 0;
+
+ case VINUM_GETDEFECTIVE: /* get a plex defective area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].defective_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].defective_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
+ case VINUM_GETUNMAPPED: /* get a plex unmapped area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].unmapped_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].unmapped_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
+ case VINUM_RESETSTATS:
+ resetstats((struct vinum_ioctl_msg *) data); /* reset object stats */
+ return 0;
+
+ /* attach an object to a superordinate object */
+ case VINUM_ATTACH:
+ attachobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ /* detach an object from a superordinate object */
+ case VINUM_DETACH:
+ detachobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ /* rename an object */
+ case VINUM_RENAME:
+ renameobject((struct vinum_rename_msg *) data);
+ return 0;
+
+ /* replace an object */
+ case VINUM_REPLACE:
+ replaceobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ default:
+ /* FALLTHROUGH */
+ }
+
+ default:
+#if __FreeBSD__>=3
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %lx\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
+ cmd); /* XXX */
+
+#else
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %x\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
+ cmd); /* XXX */
+
+#endif
+ return EINVAL;
+
+ case VINUM_DRIVE_TYPE:
+ case VINUM_PLEX_TYPE:
+ return EAGAIN; /* try again next week */
+
+ case VINUM_SD_TYPE:
+ objno = SDNO(dev);
+
+ switch (cmd) {
+ case VINUM_INITSD: /* initialize subdisk */
+ return initsd(objno);
+
+ default:
+ return EINVAL;
+ }
+ break;
+
+ case VINUM_VOLUME_TYPE:
+ objno = VOLNO(dev);
+
+ if ((unsigned) objno >= (unsigned) vinum_conf.volumes_used) /* not a valid volume */
+ return ENXIO;
+ vol = &VOL[objno];
+ if (vol->state != volume_up) /* not up, */
+ return EIO; /* I/O error */
+
+ switch (cmd) {
+ case DIOCGDINFO: /* get disk label */
+ get_volume_label(vol, (struct disklabel *) data);
+ break;
+
+ /* Care! DIOCGPART returns *pointers* to
+ * the caller, so we need to store this crap as well.
+ * And yes, we need it. */
+ case DIOCGPART: /* get partition information */
+ get_volume_label(vol, &vol->label);
+ ((struct partinfo *) data)->disklab = &vol->label;
+ ((struct partinfo *) data)->part = &vol->label.d_partitions[0];
+ break;
+
+ /* We don't have this stuff on hardware,
+ * so just pretend to do it so that
+ * utilities don't get upset. */
+ case DIOCWDINFO: /* write partition info */
+ case DIOCSDINFO: /* set partition info */
+ return 0; /* not a titty */
+
+ case DIOCWLABEL: /* set or reset label writeable */
+ if ((flag & FWRITE) == 0) /* not writeable? */
+ return EACCES; /* no, die */
+ if (*(int *) data != 0) /* set it? */
+ vol->flags |= VF_WLABEL; /* yes */
+ else
+ vol->flags &= ~VF_WLABEL; /* no, reset */
+ break;
+
+ default:
+ return ENOTTY; /* not my kind of ioctl */
+ }
+ break;
+ }
+ return 0; /* XXX */
+}
+
+/* The following four functions check the supplied
+ * object index and return a pointer to the object
+ * if it exists. Otherwise they longjump out via
+ * throw_rude_remark */
+struct drive *
+validdrive(int driveno, struct _ioctl_reply *reply)
+{
+ if ((driveno < vinum_conf.drives_used)
+ && (DRIVE[driveno].state != drive_unallocated))
+ return &DRIVE[driveno];
+ strcpy(reply->msg, "No such drive");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct sd *
+validsd(int sdno, struct _ioctl_reply *reply)
+{
+ if ((sdno < vinum_conf.subdisks_used)
+ && (SD[sdno].state != sd_unallocated))
+ return &SD[sdno];
+ strcpy(reply->msg, "No such subdisk");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct plex *
+validplex(int plexno, struct _ioctl_reply *reply)
+{
+ if ((plexno < vinum_conf.plexes_used)
+ && (PLEX[plexno].state != plex_unallocated))
+ return &PLEX[plexno];
+ strcpy(reply->msg, "No such plex");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct volume *
+validvol(int volno, struct _ioctl_reply *reply)
+{
+ if ((volno < vinum_conf.volumes_used)
+ && (VOL[volno].state != volume_unallocated))
+ return &VOL[volno];
+ strcpy(reply->msg, "No such volume");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+/* reset an object's stats */
+void
+resetstats(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+
+ switch (msg->type) {
+ case drive_object:
+ if (msg->index < vinum_conf.drives_used) {
+ struct drive *drive = &DRIVE[msg->index];
+ if (drive->state != drive_unallocated) {
+ drive->reads = 0; /* number of reads on this drive */
+ drive->writes = 0; /* number of writes on this drive */
+ drive->bytes_read = 0; /* number of bytes read */
+ drive->bytes_written = 0; /* number of bytes written */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ case sd_object:
+ if (msg->index < vinum_conf.subdisks_used) {
+ struct sd *sd = &SD[msg->index];
+ if (sd->state != sd_unallocated) {
+ sd->reads = 0; /* number of reads on this subdisk */
+ sd->writes = 0; /* number of writes on this subdisk */
+ sd->bytes_read = 0; /* number of bytes read */
+ sd->bytes_written = 0; /* number of bytes written */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ break;
+
+ case plex_object:
+ if (msg->index < vinum_conf.plexes_used) {
+ struct plex *plex = &PLEX[msg->index];
+ if (plex->state != plex_unallocated) {
+ plex->reads = 0;
+ plex->writes = 0; /* number of writes on this plex */
+ plex->bytes_read = 0; /* number of bytes read */
+ plex->bytes_written = 0; /* number of bytes written */
+ plex->multiblock = 0; /* requests that needed more than one block */
+ plex->multistripe = 0; /* requests that needed more than one stripe */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ break;
+
+ case volume_object:
+ if (msg->index < vinum_conf.volumes_used) {
+ struct volume *vol = &VOL[msg->index];
+ if (vol->state != volume_unallocated) {
+ vol->bytes_read = 0; /* number of bytes read */
+ vol->bytes_written = 0; /* number of bytes written */
+ vol->reads = 0; /* number of reads on this volume */
+ vol->writes = 0; /* number of writes on this volume */
+ vol->recovered_reads = 0; /* reads recovered from another plex */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ case invalid_object: /* can't get this */
+ reply->error = EINVAL;
+ return;
+ }
+}
+
+/* attach an object to a superior object */
+void
+attachobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ case volume_object: /* nor a volume */
+ case invalid_object: /* "this can't happen" */
+ reply->error = EINVAL;
+ reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
+ return;
+
+ case sd_object:
+ sd = validsd(msg->index, reply);
+ if (sd == NULL) /* not a valid subdisk */
+ return;
+ plex = validplex(msg->otherobject, reply);
+ if (plex) {
+ if (sd->plexno >= 0) { /* already belong to a plex */
+ reply->error = EBUSY; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd->plexoffset = msg->offset; /* this is where we want it */
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* make sure it's stale */
+ give_sd_to_plex(plex->plexno, sd->sdno); /* and give it to the plex */
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ break;
+
+ case plex_object:
+ plex = validplex(msg->index, reply); /* get plex */
+ if (plex == NULL)
+ return;
+ if (plex->organization != plex_concat) { /* can't attach to striped and raid-5 */
+ reply->error = EINVAL; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ vol = validvol(msg->otherobject, reply); /* and volume information */
+ if (vol) {
+ if ((vol->plexes == MAXPLEX) /* we have too many already */
+ ||(plex->volno >= 0)) { /* or the plex has an owner */
+ reply->error = EINVAL; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* make sure it's down */
+ give_plex_to_volume(msg->otherobject, msg->index); /* and give it to the volume */
+ update_plex_config(plex->plexno, 0);
+ save_config();
+ if (plex->state == plex_reviving)
+ reply->error = EAGAIN; /* need to revive it */
+ else
+ reply->error = 0;
+ }
+ }
+}
+
+/* detach an object from a superior object */
+void
+detachobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+ int sdno;
+ int plexno;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ case volume_object: /* nor a volume */
+ case invalid_object: /* "this can't happen" */
+ reply->error = EINVAL;
+ reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
+ return;
+
+ case sd_object:
+ sd = validsd(msg->index, reply);
+ if (sd == NULL)
+ return;
+ if (sd->plexno < 0) { /* doesn't belong to a plex */
+ reply->error = ENOENT;
+ strcpy(reply->msg, "Subdisk is not attached");
+ return;
+ } else { /* valid plex number */
+ plex = &PLEX[sd->plexno];
+ if ((!msg->force) /* don't force things */
+ &&((plex->state == plex_up) /* and the plex is up */
+ ||((plex->state == plex_flaky) && sd->state == sd_up))) { /* or flaky with this sd up */
+ reply->error = EBUSY; /* we need this sd */
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd->plexno = -1; /* anonymous sd */
+ if (plex->subdisks == 1) { /* this was the only subdisk */
+ Free(plex->sdnos); /* free the subdisk array */
+ plex->sdnos = NULL; /* and note the fact */
+ plex->subdisks_allocated = 0; /* no subdisk space */
+ } else {
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ if (plex->sdnos[sdno] == msg->index) /* found our subdisk */
+ break;
+ }
+ if (sdno < (plex->subdisks - 1)) /* not the last one, compact */
+ bcopy(&plex->sdnos[sdno + 1],
+ &plex->sdnos[sdno],
+ (plex->subdisks - 1 - sdno) * sizeof(int));
+ }
+ plex->subdisks--;
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list */
+ if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* this subdisk is named after the plex */
+ bcopy(sd->name,
+ &sd->name[3],
+ min(strlen(sd->name), MAXSDNAME - 3));
+ bcopy("ex-", sd->name, 3);
+ sd->name[MAXSDNAME - 1] = '\0';
+ }
+ update_plex_config(plex->plexno, 0);
+ if ((plex->organization == plex_striped) /* we've just mutilated our plex, */
+ ||(plex->organization == plex_striped)) /* the data no longer matches */
+ set_plex_state(plex->plexno,
+ plex_down,
+ setstate_force | setstate_configuring);
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case plex_object:
+ plex = validplex(msg->index, reply); /* get plex */
+ if (plex == NULL)
+ return;
+ if (plex->volno >= 0) {
+ int volno = plex->volno;
+
+ vol = &VOL[volno];
+ if ((!msg->force) /* don't force things */
+ &&((vol->state == volume_up) /* and the volume is up */
+ &&(vol->plexes == 1))) { /* and this is the last plex */
+ /* XXX As elsewhere, check whether we will lose
+ * mapping by removing this plex */
+ reply->error = EBUSY; /* we need this plex */
+ reply->msg[0] = '\0';
+ return;
+ }
+ plex->volno = -1; /* anonymous plex */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ if (vol->plex[plexno] == msg->index) /* found our plex */
+ break;
+ }
+ if (plexno < (vol->plexes - 1)) /* not the last one, compact */
+ bcopy(&vol[plexno + 1], &vol[plexno], (vol->plexes - 1 - plexno) * sizeof(int));
+ vol->plexes--;
+ if (!bcmp(vol->name, plex->name, strlen(vol->name))) { /* this plex is named after the volume */
+ /* First, check if the subdisks are the same */
+ if (msg->recurse) {
+ int sdno;
+
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ struct sd *sd = &SD[plex->sdnos[sdno]];
+
+ if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* subdisk is named after the plex */
+ bcopy(sd->name, &sd->name[3], min(strlen(sd->name), MAXSDNAME - 3));
+ bcopy("ex-", sd->name, 3);
+ sd->name[MAXSDNAME - 1] = '\0';
+ }
+ }
+ }
+ bcopy(plex->name, &plex->name[3], min(strlen(plex->name), MAXPLEXNAME - 3));
+ bcopy("ex-", plex->name, 3);
+ plex->name[MAXPLEXNAME - 1] = '\0';
+ }
+ update_plex_config(plex->plexno, 0);
+ update_volume_config(volno, 0);
+ save_config();
+ reply->error = 0;
+ } else {
+ reply->error = ENOENT;
+ strcpy(reply->msg, "Plex is not attached");
+ }
+ }
+}
+
+void
+renameobject(struct vinum_rename_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct drive *drive;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ if (find_drive(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ drive = validdrive(msg->index, reply);
+ if (drive) {
+ bcopy(msg->newname, drive->label.name, MAXDRIVENAME);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case sd_object: /* you can't attach a subdisk to anything */
+ if (find_subdisk(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd = validsd(msg->index, reply);
+ if (sd) {
+ bcopy(msg->newname, sd->name, MAXSDNAME);
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case plex_object: /* you can't attach a plex to anything */
+ if (find_plex(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ plex = validplex(msg->index, reply);
+ if (plex) {
+ bcopy(msg->newname, plex->name, MAXPLEXNAME);
+ update_plex_config(plex->plexno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case volume_object: /* you can't attach a volume to anything */
+ if (find_volume(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ vol = validvol(msg->index, reply);
+ if (vol) {
+ bcopy(msg->newname, vol->name, MAXVOLNAME);
+ update_volume_config(msg->index, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case invalid_object:
+ reply->error = EINVAL;
+ reply->msg[0] = '\0';
+ }
+}
+
+/* Replace one object with another */
+void
+replaceobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+
+ reply->error = ENODEV; /* until I know how to do this */
+ strcpy(reply->msg, "replace not implemented yet");
+/* save_config (); */
+}
diff --git a/lkm/vinum/vinumkw.h b/lkm/vinum/vinumkw.h
new file mode 100644
index 000000000000..1a81f37656f4
--- /dev/null
+++ b/lkm/vinum/vinumkw.h
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumkw.h,v 1.7 1998/08/07 02:35:51 grog Exp grog $
+ */
+
+/* Command keywords that vinum knows. These include both user-level
+ * and kernel-level stuff */
+
+/* Our complete vocabulary. The names of the commands are
+ * the same as the identifier without the kw_ at the beginning
+ * (i.e. kw_create defines the "create" keyword). Preprocessor
+ * magic in parser.c does the rest. */
+enum keyword {
+ kw_create,
+ kw_modify,
+ kw_list,
+ kw_l = kw_list,
+ kw_ld, /* list drive */
+ kw_ls, /* list subdisk */
+ kw_lp, /* list plex */
+ kw_lv, /* list volume */
+ kw_set,
+ kw_rm,
+ kw_start,
+ kw_stop,
+ kw_drive,
+ kw_sd,
+ kw_subdisk = kw_sd,
+ kw_plex,
+ kw_volume,
+ kw_vol = kw_volume,
+ kw_read,
+ kw_readpol,
+ kw_org,
+ kw_name,
+ kw_concat,
+ kw_striped,
+ kw_raid5,
+ kw_driveoffset,
+ kw_plexoffset,
+ kw_len,
+ kw_length = kw_len,
+ kw_state,
+ kw_setupstate,
+ kw_d, /* flag names */
+ kw_f,
+ kw_r,
+ kw_s,
+ kw_v,
+ kw_round, /* round robin */
+ kw_prefer, /* prefer plex */
+ kw_device,
+ kw_init,
+ kw_label,
+ kw_resetconfig,
+ kw_writethrough,
+ kw_writeback,
+ kw_raw,
+ kw_resetstats,
+ kw_attach,
+ kw_detach,
+ kw_rename,
+ kw_printconfig,
+ kw_replace,
+ kw_detached,
+#ifdef DEBUG
+ kw_debug, /* go into debugger */
+ kw_info,
+#endif
+ kw_invalid_keyword = -1
+};
+
+struct _keywords {
+ char *name;
+ enum keyword keyword;
+};
+
+struct keywordset {
+ int size;
+ struct _keywords *k;
+};
+
+extern struct _keywords keywords[];
+extern struct _keywords flag_keywords[];
+
+extern struct keywordset keyword_set;
+extern struct keywordset flag_set;
diff --git a/lkm/vinum/vinumstate.h b/lkm/vinum/vinumstate.h
new file mode 100644
index 000000000000..0b07590b2cf6
--- /dev/null
+++ b/lkm/vinum/vinumstate.h
@@ -0,0 +1,213 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumstate.h,v 1.11 1998/08/04 06:22:49 grog Exp grog $
+ */
+
+/* This file gets read by makestatetext to create text files
+ * with the names of the states, so don't change the file
+ * format */
+
+enum volumestate {
+ volume_unallocated,
+ /* present but unused. Must be 0 */
+
+ volume_uninit,
+ /* mentioned elsewhere but not defined */
+
+ volume_down,
+
+ /* The volume is up and functional, but not all plexes may be available */
+ volume_up,
+ volume_laststate = volume_up /* last value, for table dimensions */
+};
+
+enum plexstate {
+ /* An empty entry, not a plex at all. */
+ plex_unallocated,
+
+ /* The plex has been allocated, but there configuration
+ * is not complete */
+ plex_init,
+
+ /* A plex which has gone completely down because of
+ * I/O errors. */
+ plex_faulty,
+
+ /* A plex which has been taken down by the
+ * administrator. */
+ plex_down,
+
+ /* A plex which is currently being brought up after
+ * being not up. This involves copying data from
+ * another plex */
+ plex_reviving,
+
+ /* A plex which is being initialized */
+ plex_initializing,
+
+ /* *** The remaining states represent plexes which are
+ * at least partially up. Keep these separate so that
+ * they can be checked more easily. */
+
+ /* A plex entry which is at least partially up. Not
+ * all subdisks are available, and an inconsistency
+ * has occurred. If no other plex is uncorrupted,
+ * the volume is no longer consistent. */
+ plex_corrupt,
+
+ plex_firstup = plex_corrupt, /* first "up" state */
+
+ /* A plex entry which is at least partially up. Not
+ * all subdisks are available, but so far no
+ * inconsistency has occurred (this will change with
+ * the first write to the address space occupied by
+ * a defective subdisk). A RAID 5 plex with one subdisk
+ * down will remain degraded even after a write */
+ plex_degraded,
+
+ /* A plex which is really up, but which has a reborn
+ * subdisk which we don't completely trust, and
+ * which we don't want to read if we can avoid it */
+ plex_flaky,
+
+ /* A plex entry which is completely up. All subdisks
+ * are up. */
+ plex_up,
+
+ plex_laststate = plex_up /* last value, for table dimensions */
+};
+
+/* subdisk states */
+enum sdstate {
+ /* An empty entry, not a subdisk at all. */
+ sd_unallocated,
+
+ /* A subdisk entry which has not been created
+ * completely. Some fields may be empty.
+ */
+ sd_uninit,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, but the disk hasn't
+ * been updated.
+ */
+ sd_init,
+
+ /* A subdisk entry which has been created completely and
+ * which is currently being initialized */
+ sd_initializing,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, and the disk has been
+ * updated, but there is no data on the disk.
+ */
+ sd_empty,
+
+ /* *** The following states represent invalid data */
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down, and as a result updates have been
+ * missed.
+ */
+ sd_obsolete,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down, updates have been lost, and then
+ * the drive came up again.
+ */
+ sd_stale,
+
+ /* *** The following states represent valid, inaccessible data */
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down. No attempt has been made to write
+ * to the subdisk since the crash.
+ */
+ sd_crashed,
+
+ /* A subdisk entry which was up, which contained
+ * valid data, and which was taken down by the
+ * administrator. The data is valid. */
+ sd_down,
+
+ /* *** The following states represent accessible subdisks
+ * with valid data */
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down and up again. No updates were lost,
+ * but it is possible that the subdisk has been
+ * damaged. We won't read from this subdisk if we
+ * have a choice. If this is the only subdisk which
+ * covers this address space in the plex, we set its
+ * state to sd_up under these circumstances, so this
+ * status implies that there is another subdisk to
+ * fulfil the request.
+ */
+ sd_reborn,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data is valid.
+ */
+ sd_up,
+
+ sd_laststate = sd_up /* last value, for table dimensions */
+};
+
+enum drivestate {
+ drive_unallocated,
+ /* present but unused. Must be 0 */
+
+ drive_uninit,
+ /* just mentioned in some other config entry */
+
+ drive_down,
+ /* not accessible */
+
+ drive_coming_up,
+ /* in the process of being brought up */
+
+ drive_up,
+ /* up and running */
+
+ drive_laststate = drive_up /* last value, for table dimensions */
+};
diff --git a/lkm/vinum/vinumvar.h b/lkm/vinum/vinumvar.h
new file mode 100644
index 000000000000..ca54f76aad02
--- /dev/null
+++ b/lkm/vinum/vinumvar.h
@@ -0,0 +1,510 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumvar.h,v 1.15 1998/08/14 06:36:41 grog Exp grog $
+ */
+
+/* XXX gdb can't find our global pointers, so use this kludge to
+ * point to them locally. Remove after testing */
+#define BROKEN_GDB struct _vinum_conf *VC = &vinum_conf
+
+#include <sys/time.h>
+#include "vinumstate.h"
+/* Some configuration maxima. They're an enum because
+ * we can't define global constants. Sorry about that.
+ *
+ * These aren't as bad as they look: most of them
+ * are soft limits. Only the MAXCONFIG parameter is set in stone
+ */
+
+enum constants {
+ VINUM_HEADER = 512, /* size of header on disk */
+ MAXCONFIGLINE = 1024, /* maximum size of a single config line */
+ /* XXX Do we still need this? */
+ MINVINUMSLICE = 1048576, /* minimum size of a slice */
+
+ CDEV_MAJOR = 91, /* major number for character device */
+ BDEV_MAJOR = 25, /* and block device */
+
+ ROUND_ROBIN_READPOL = -1, /* round robin read policy */
+
+ /* type field in minor number */
+ VINUM_VOLUME_TYPE = 0,
+ VINUM_PLEX_TYPE = 1,
+ VINUM_SD_TYPE = 2,
+ VINUM_DRIVE_TYPE = 3,
+ VINUM_SUPERDEV_TYPE = 4, /* super device. */
+
+ /* Shifts for the individual fields in the device */
+ VINUM_TYPE_SHIFT = 28,
+ VINUM_VOL_SHIFT = 0,
+ VINUM_PLEX_SHIFT = 16,
+ VINUM_SD_SHIFT = 20,
+ VINUM_VOL_WIDTH = 8,
+ VINUM_PLEX_WIDTH = 3,
+ VINUM_SD_WIDTH = 8,
+ MAJORDEV_SHIFT = 8,
+
+
+/* Create a block device number */
+#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
+ | (v << VINUM_VOL_SHIFT) \
+ | (p << VINUM_PLEX_SHIFT) \
+ | (s << VINUM_SD_SHIFT) \
+ | (t << VINUM_TYPE_SHIFT) )
+
+/* And a character device number */
+#define VINUMCDEV(v,p,s,t) ((CDEV_MAJOR << MAJORDEV_SHIFT) \
+ | (v << VINUM_VOL_SHIFT) \
+ | (p << VINUM_PLEX_SHIFT) \
+ | (s << VINUM_SD_SHIFT) \
+ | (t << VINUM_TYPE_SHIFT) )
+
+/* extract device type */
+#define DEVTYPE(x) ((x >> VINUM_TYPE_SHIFT) & 7)
+
+/* extract volume number */
+#define VOLNO(x) (x & ((1 << VINUM_VOL_WIDTH) - 1))
+
+/* extract plex number */
+#define PLEXNO(x) (VOL [VOLNO (x)].plex [(x >> VINUM_PLEX_SHIFT) & ((1 << VINUM_PLEX_WIDTH) - 1)])
+
+/* extract subdisk number */
+#define SDNO(x) (PLEX [PLEXNO (x)].sdnos [(x >> VINUM_SD_SHIFT) & ((1 << VINUM_SD_WIDTH) - 1)])
+
+/* extract drive number */
+#define DRIVENO(x) (SD [SDNO (x)].driveno)
+
+ VINUM_SUPERDEV = VINUMBDEV(0, 0, 0, VINUM_SUPERDEV_TYPE), /* superdevice number */
+
+/* the number of object entries to cater for initially, and also the
+ * value by which they are incremented. It doesn't take long
+ * to extend them, so theoretically we could start with 1 of each, but
+ * it's untidy to allocate such small areas. These values are
+ * probably too small.
+ */
+
+ INITIAL_DRIVES = 4,
+ INITIAL_VOLUMES = 4,
+ INITIAL_PLEXES = 8,
+ INITIAL_SUBDISKS = 16,
+ INITIAL_SUBDISKS_IN_PLEX = 4, /* number of subdisks to allocate to a plex */
+ INITIAL_SUBDISKS_IN_DRIVE = 4, /* number of subdisks to allocate to a drive */
+ INITIAL_DRIVE_FREELIST = 16, /* number of entries in drive freelist */
+ PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
+ INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
+ DEFAULT_REVIVE_BLOCKSIZE = 32768, /* size of block to transfer in one op */
+};
+
+/* device numbers */
+
+/*
+ * 31 30 28 27 20 19 18 16 15 8 7 0
+ * |-----------------------------------------------------------------------------------------------|
+ * |X | Type | Subdisk number | X| Plex | Major number | volume number |
+ * |-----------------------------------------------------------------------------------------------|
+ *
+ * 0x2 03 1 19 06
+ */
+struct devcode {
+/* CARE. These fields assume a big-endian word. On a
+ * little-endian system, they're the wrong way around */
+ unsigned volume:8; /* up to 256 volumes */
+ unsigned major:8; /* this is where the major number fits */
+ unsigned plex:3; /* up to 8 plexes per volume */
+ unsigned unused:1; /* up for grabs */
+ unsigned sd:8; /* up to 256 subdisks per plex */
+ unsigned type:3; /* type of object */
+ /* type field
+ VINUM_VOLUME = 0,
+ VINUM_PLEX = 1,
+ VINUM_SUBDISK = 2,
+ VINUM_DRIVE = 3,
+ VINUM_SUPERDEV = 4, */
+ unsigned signbit:1; /* to make 32 bits */
+};
+
+#define VINUM_DIR "/dev/vinum"
+#define VINUM_RDIR "/dev/rvinum"
+#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
+#define MAXDRIVENAME 32 /* maximum length of a device name */
+#define MAXSDNAME 64 /* maximum length of a subdisk name */
+#define MAXPLEXNAME 64 /* maximum length of a plex name */
+#define MAXVOLNAME 64 /* maximum length of a volume name */
+#define MAXNAME 64 /* maximum length of any name */
+#define MAXVOLPLEX 8 /* maximum number of plexes in a volume */
+
+/* Flags for all objects. Most of them only apply to
+ * specific objects, but we have space for all in any
+ * 32 bit flags word. */
+enum objflags {
+ VF_LOCKED = 1, /* somebody has locked access to this object */
+ VF_LOCKING = 2, /* we want access to this object */
+ VF_WRITETHROUGH = 8, /* volume: write through */
+ VF_INITED = 0x10, /* unit has been initialized */
+ VF_WLABEL = 0x20, /* label area is writable */
+ VF_LABELLING = 0x40, /* unit is currently being labelled */
+ VF_WANTED = 0x80, /* someone is waiting to obtain a lock */
+ VF_RAW = 0x100, /* raw volume (no file system) */
+ VF_LOADED = 0x200, /* module is loaded */
+ VF_CONFIGURING = 0x400, /* somebody is changing the config */
+ VF_WILL_CONFIGURE = 0x800, /* somebody wants to change the config */
+ VF_CONFIG_INCOMPLETE = 0x1000, /* haven't finished changing the config */
+ VF_CONFIG_SETUPSTATE = 0x2000, /* set a volume up if all plexes are empty */
+ VF_READING_CONFIG = 0x4000, /* we're reading config database from disk */
+ VF_KERNELOP = 0x8000, /* we're performing ops from kernel space */
+};
+
+/* Global configuration information for the vinum subsystem */
+struct _vinum_conf {
+ /* Pointers to vinum structures */
+ struct drive *drive;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *volume;
+
+ /* the number allocated */
+ int drives_allocated;
+ int subdisks_allocated;
+ int plexes_allocated;
+ int volumes_allocated;
+
+ /* and the number currently in use */
+ int drives_used;
+ int subdisks_used;
+ int plexes_used;
+ int volumes_used;
+
+ int flags;
+ int opencount; /* number of times we've been opened */
+#if DEBUG
+ int lastrq;
+ struct buf *lastbuf;
+#endif
+};
+
+/* Use these defines to simplify code */
+#define DRIVE vinum_conf.drive
+#define SD vinum_conf.sd
+#define PLEX vinum_conf.plex
+#define VOL vinum_conf.volume
+#define VFLAGS vinum_conf.flags
+
+/* Slice header
+
+ * Vinum drives start with this structure:
+ *
+ * Sector
+ * |--------------------------------------|
+ * | PDP-11 memorial boot block | 0
+ * |--------------------------------------|
+ * | Disk label, maybe | 1
+ * |--------------------------------------|
+ * | Slice definition (vinum_hdr) | 2
+ * |--------------------------------------|
+ * | |
+ * | Configuration info, first copy | 3
+ * | |
+ * |--------------------------------------|
+ * | |
+ * | Configuration info, second copy | 3 + size of config
+ * | |
+ * |--------------------------------------|
+ */
+
+/* Sizes and offsets of our information */
+enum {
+ VINUM_LABEL_OFFSET = 4096, /* offset of vinum label */
+ VINUMHEADERLEN = 512, /* size of vinum label */
+ VINUM_CONFIG_OFFSET = 4608, /* offset of first config copy */
+ MAXCONFIG = 65536, /* and size of config copy */
+ DATASTART = (MAXCONFIG * 2 + VINUM_CONFIG_OFFSET) / DEV_BSIZE /* this is where the data starts */
+};
+
+/* hostname is 256 bytes long, but we don't need to shlep
+ * multiple copies in vinum. We use the host name just
+ * to identify this system, and 32 bytes should be ample
+ * for that purpose */
+#define VINUMHOSTNAMELEN 32
+
+struct vinum_label {
+ char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
+ char name[MAXDRIVENAME]; /* our name of the drive */
+ struct timeval date_of_birth; /* the time it was created */
+ struct timeval last_update; /* and the time of last update */
+ off_t drive_size; /* total size in bytes of the drive.
+ * This value includes the headers */
+};
+
+struct vinum_hdr {
+ long long magic; /* we're long on magic numbers */
+ /* XXX Get these right for big-endian */
+#define VINUM_MAGIC 22322600044678729LL /* should be this */
+#define VINUM_NOMAGIC 22322600044678990LL /* becomes this after obliteration */
+ int config_length; /* size in bytes of each copy of the
+ * configuration info.
+ * This must be a multiple of the sector size. */
+
+ struct vinum_label label; /* unique label */
+};
+
+/* Information returned from read_drive_label */
+enum drive_label_info {
+ DL_CANT_OPEN, /* invalid partition */
+ DL_NOT_OURS, /* valid partition, but no vinum label */
+ DL_DELETED_LABEL, /* valid partition, deleted label found */
+ DL_WRONG_DRIVE, /* drive name doesn't match */
+ DL_OURS /* valid partition and label found */
+};
+
+/*** Drive definitions ***/
+/* A drive corresponds to a disk slice. We use a different term to show
+ * the difference in usage: it doesn't have to be a slice, and could
+ * theroretically be a complete, unpartitioned disk */
+
+struct drive {
+ enum drivestate state; /* current state */
+ int subdisks_allocated; /* number of entries in sd */
+ int subdisks_used; /* and the number used */
+ int blocksize; /* size of fs blocks */
+ u_int64_t sectors_available; /* number of sectors still available */
+ int secsperblock;
+ int lasterror; /* last error on drive */
+ int driveno; /* index of drive in vinum_conf */
+ int opencount; /* number of up subdisks */
+ u_int64_t reads; /* number of reads on this drive */
+ u_int64_t writes; /* number of writes on this drive */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ dev_t dev; /* and device number */
+ char devicename[MAXDRIVENAME]; /* name of the slice it's on */
+ struct vnode *vp; /* vnode pointer */
+ struct proc *p;
+ struct vinum_label label; /* and the label information */
+ struct partinfo partinfo; /* partition information */
+ int freelist_size; /* number of entries alloced in free list */
+ int freelist_entries; /* number of entries used in free list */
+ struct drive_freelist { /* sorted list of free space on drive */
+ u_int64_t offset;
+ long sectors;
+ } *freelist;
+};
+
+/*** Subdisk definitions ***/
+
+struct sd {
+ enum sdstate state; /* state */
+ /* offsets in blocks */
+ int64_t driveoffset; /* offset on drive */
+ int64_t plexoffset; /* offset in plex */
+ u_int64_t sectors; /* and length in sectors */
+ int plexno; /* index of plex, if it belongs */
+ int driveno; /* index of the drive on which it is located */
+ int sdno; /* our index in vinum_conf */
+ int pid; /* pid of process which opened us */
+ u_int64_t reads; /* number of reads on this subdisk */
+ u_int64_t writes; /* number of writes on this subdisk */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ char name[MAXSDNAME]; /* name of subdisk */
+};
+
+/*** Plex definitions ***/
+
+/* kinds of plex organization */
+enum plexorg {
+ plex_disorg, /* disorganized */
+ plex_concat, /* concatenated plex */
+ plex_striped, /* striped plex */
+ plex_raid5 /* RAID5 plex */
+};
+
+/* Region in plex (either defective or unmapped) */
+struct plexregion {
+ u_int64_t offset; /* start of region */
+ u_int64_t length; /* length */
+};
+
+struct plex {
+ enum plexorg organization; /* Plex organization */
+ enum plexstate state; /* and current state */
+ u_int64_t length; /* total length of plex (max offset) */
+ int flags;
+ int stripesize; /* size of stripe or raid band, in sectors */
+ int subdisks; /* number of associated subdisks */
+ int subdisks_allocated; /* number of subdisks allocated space for */
+ int *sdnos; /* list of component subdisks */
+ int plexno; /* index of plex in vinum_conf */
+ int volno; /* index of volume */
+ int volplexno; /* number of plex in volume */
+ int pid; /* pid of process which opened us */
+ /* Lock information */
+ int locks; /* number of locks used */
+ int alloclocks; /* number of locks allocated */
+ struct rangelock *lock; /* ranges of locked addresses */
+ /* Statistics */
+ u_int64_t reads; /* number of reads on this plex */
+ u_int64_t writes; /* number of writes on this plex */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ u_int64_t multiblock; /* requests that needed more than one block */
+ u_int64_t multistripe; /* requests that needed more than one stripe */
+ /* revive parameters */
+ u_int64_t revived; /* block number of current revive request */
+ int revive_blocksize; /* revive block size (bytes) */
+ int revive_interval; /* and time to wait between transfers */
+ struct request *waitlist; /* list of requests waiting on revive op */
+ /* geometry control */
+ int defective_regions; /* number of regions which are defective */
+ int defective_region_count; /* number of entries in defective_region */
+ struct plexregion *defective_region; /* list of offset/length pairs: defective sds */
+ int unmapped_regions; /* number of regions which are missing */
+ int unmapped_region_count; /* number of entries in unmapped_region */
+ struct plexregion *unmapped_region; /* list of offset/length pairs: missing sds */
+ char name[MAXPLEXNAME]; /* name of plex */
+};
+
+/*** Volume definitions ***/
+
+#define MAXPLEX 8 /* maximum number of plexes */
+
+
+struct volume {
+ enum volumestate state; /* current state */
+ int plexes; /* number of plexes */
+ int preferred_plex; /* plex to read from, -1 for round-robin */
+ int last_plex_read; /* index of plex used for last read,
+ * for round-robin */
+ dev_t devno; /* device number */
+ int flags; /* status and configuration flags */
+ int opencount; /* number of opens (all the same process) */
+ int openflags; /* flags supplied to last open(2) */
+ u_int64_t size; /* size of volume */
+ int disk; /* disk index */
+ int blocksize; /* logical block size */
+ int active; /* number of outstanding requests active */
+ int subops; /* and the number of suboperations */
+ pid_t pid; /* pid of locker */
+ /* Statistics */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ u_int64_t reads; /* number of reads on this volume */
+ u_int64_t writes; /* number of writes on this volume */
+ u_int64_t recovered_reads; /* reads recovered from another plex */
+ /* Unlike subdisks in the plex, space for the plex pointers is static */
+ int plex[MAXPLEX]; /* index of plexes */
+ char name[MAXVOLNAME]; /* name of volume */
+ struct disklabel label; /* for DIOCGPART */
+};
+
+/* Table expansion. Expand table, which contains oldcount
+ * entries of type element, by increment entries, and change
+ * oldcount accordingly */
+#define EXPAND(table, element, oldcount, increment) \
+{ \
+ expand_table ((void **) &table, \
+ oldcount * sizeof (element), \
+ (oldcount + increment) * sizeof (element) ); \
+ oldcount += increment; \
+ }
+
+/* Information on vinum's memory usage */
+struct meminfo {
+ int mallocs; /* number of malloced blocks */
+ int total_malloced; /* total amount malloced */
+ int highwater; /* maximum number of mallocs */
+ struct mc *malloced; /* pointer to kernel table */
+};
+
+struct mc {
+ int seq;
+ int size;
+ short line;
+ short flags;
+#define ALLOC_KVA 1 /* allocated via kva calls */
+ int *databuf; /* really vm_object_t */
+ caddr_t address;
+ char file[16];
+};
+
+/* These enums are used by the state transition
+ * routines. They're in bit map format:
+ *
+ * Bit 0: Other plexes in the volume are down
+ * Bit 1: Other plexes in the volume are up
+ * Bit 2: The current plex is up
+ * Maybe they should be local to
+ * state.c */
+enum volplexstate {
+ volplex_onlyusdown = 0, /* we're the only plex, and we're down */
+ volplex_alldown, /* 1: another plex is down, and so are we */
+ volplex_otherup, /* 2: another plex is up */
+ volplex_otherupdown, /* other plexes are up and down */
+ volplex_onlyus, /* 4: we're up and alone */
+ volplex_onlyusup, /* only we are up, others are down */
+ volplex_allup, /* all plexes are up */
+ volplex_someup /* some plexes are up, including us */
+};
+
+/* state map for plex */
+enum sdstates {
+ sd_emptystate = 1,
+ sd_downstate = 2, /* found an SD which is down */
+ sd_crashedstate = 4, /* found an SD which is crashed */
+ sd_obsoletestate = 8, /* found an SD which is obsolete */
+ sd_stalestate = 16, /* found an SD which is stale */
+ sd_rebornstate = 32, /* found an SD which is reborn */
+ sd_upstate = 64, /* found an SD which is up */
+ sd_initstate = 128, /* found an SD which is init */
+ sd_otherstate = 256 /* found an SD in some other state */
+};
+
+/* This is really just a parameter to pass to
+ * set_<foo>_state, but since it needs to be known
+ * in the external definitions, we need to define
+ * it here */
+enum setstateflags {
+ setstate_none = 0, /* no flags */
+ setstate_force = 1, /* force the state change */
+ setstate_configuring = 2, /* we're currently configuring, don't save */
+ setstate_recursing = 4, /* we're called from another setstate function */
+ setstate_norecurse = 8 /* don't call other setstate functions */
+};
+
+#ifdef DEBUG
+/* Debugging stuff */
+#define DEBUG_ADDRESSES 1
+#define DEBUG_NUMOUTPUT 2
+#endif
diff --git a/lkm/wcd/Makefile b/lkm/wcd/Makefile
new file mode 100644
index 000000000000..0d8342901bd5
--- /dev/null
+++ b/lkm/wcd/Makefile
@@ -0,0 +1,29 @@
+# $Id: Makefile,v 1.10 1998/02/01 17:53:56 bde Exp $
+
+.PATH: ${.CURDIR}/../../sys/i386/isa
+KMOD = wcd_mod
+SRCS = wcd.c wdc.h wcd.h opt_atapi.h opt_devfs.h
+NOMAN =
+CFLAGS += -DWCD_MODULE
+CLEANFILES += wdc.h wcd.h opt_atapi.h opt_devfs.h
+
+load: ${PROG}
+ ${MODLOAD} -u -e wcd $(PROG)
+
+unload: ${PROG}
+ ${MODUNLOAD} -n wcd
+
+wdc.h:
+ echo "#define NWDC 2" > wdc.h
+ echo "#define NWD 4" >> wdc.h
+
+wcd.h:
+ echo "#define NWCD 1" > wcd.h
+
+opt_atapi.h:
+ echo "#define ATAPI 1"> opt_atapi.h
+
+opt_devfs.h:
+ touch opt_devfs.h
+
+.include <bsd.kmod.mk>
diff --git a/release/texts/ABOUT.TXT b/release/ABOUT.TXT
index 008a60c722bb..008a60c722bb 100644
--- a/release/texts/ABOUT.TXT
+++ b/release/ABOUT.TXT
diff --git a/release/texts/ERRATA.TXT b/release/ERRATA.TXT
index 239787f16873..239787f16873 100644
--- a/release/texts/ERRATA.TXT
+++ b/release/ERRATA.TXT
diff --git a/release/texts/LAYOUT.TXT b/release/LAYOUT.TXT
index ece4acb786ae..ece4acb786ae 100644
--- a/release/texts/LAYOUT.TXT
+++ b/release/LAYOUT.TXT
diff --git a/release/Makefile b/release/Makefile
index 77f7d68ee23f..631458da6c39 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.459 1999/01/16 22:42:24 jkh Exp $
+# $Id: Makefile,v 1.420 1998/10/15 11:12:40 jkh Exp $
#
# make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ]
#
@@ -41,13 +41,9 @@ OBJFORMAT?= elf
#NOPORTS= YES
# Comment the following if you want the release documentation to be
# in English only.
-ALLLANG= yes
-DOCPORTS= textproc/docproj
-# Set this to wherever the distfiles required by ${DOCPORTS} live.
-DISTFILES?= ${.CURDIR}/../../ports/distfiles
-
-DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \
- INSTALL.TXT RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT
+ALLLANG= yes
+DOCPORTS= archivers/unzip textproc/jade textproc/iso8879 \
+ textproc/linuxdoc textproc/docbook textproc/sgmlformat
# Things which without too much trouble can be considered variables
# BIN_DISTS are special in that they get full /etc installation sets.
@@ -71,6 +67,8 @@ MNT= /mnt
# Various floppy image parameters.
#
+# These are adjusted down to the minimum needed by doFS.sh.
+.if ${MACHINE_ARCH} == "i386"
BOOTSIZE= 1440
BOOTMFSSIZE= 1440
FIXITSIZE= 1440
@@ -78,12 +76,17 @@ BOOTINODE= 80000
MFSINODE= 8000
FIXITINODE= 2000
BOOTLABEL= fd1440
-BOOTMFSLABEL= minimum2
+BOOTMFSLABEL= minimum
FIXITLABEL= fd1440
-
-# overrides.
-.if ${MACHINE_ARCH} == "alpha"
+.else
+BOOTSIZE= 1440
+BOOTMFSSIZE= 2880
FIXITSIZE= 2880
+BOOTINODE= 80000
+MFSINODE= 40000
+FIXITINODE= 2000
+BOOTLABEL= fd1440
+BOOTMFSLABEL= minimum2
FIXITLABEL= minimum2
.endif
@@ -128,6 +131,16 @@ EXTRAS= cdrom.1 ftp.1
DOCREL= doc.1
.endif
+REDO?= sysinstall
+REDOSED= sed -e 's/dirs/release.1/' -e 's/trees/release.2/' \
+ -e 's/kerns/release.3/' -e 's/sysinstall/release.4/' \
+ -e 's/fixup/release.5/' -e 's/tarbin/release.6/' \
+ -e 's/tarsrc/release.7/' -e 's/boot\.flp/release.8/' \
+ -e 's/fixit\.flp/release.9/' -e 's/ftp/ftp.1/' \
+ -e 's/cdrom/cdrom.1/' -e 's/doc/doc.1/'
+
+REDOREDO!= echo ${REDO} | ${REDOSED}
+
rerelease release:
.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
@echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
@@ -143,7 +156,6 @@ rerelease release:
-mkdir -p ${CHROOTDIR}
cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
- [ -f /etc/resolv.conf ] && cp -p /etc/resolv.conf ${CHROOTDIR}/etc
cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
for i in ${BOOTSTRAPUTILS} ; do \
@@ -167,7 +179,10 @@ rerelease release:
.endif
.if !defined(NODOC)
cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
- [ -d ${DISTFILES}/ ] && cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles
+ cd ${CHROOTDIR}/usr/ports && for i in ${DOCPORTS}; do \
+ (cd $$i; make fetch MASTER_SITE_OVERRIDE=file:/usr/ports/distfiles/ \
+ DISTDIR=${CHROOTDIR}/usr/ports/distfiles ); \
+ done
.endif
.endif
.if make(rerelease)
@@ -188,7 +203,11 @@ rerelease release:
# Add version information to those things that need it.
( cd ${CHROOTDIR}/usr/src/sys/conf && \
mv newvers.sh foo && \
- sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo )
+ sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo )
+ ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \
+ sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \
+ mv version.h.new version.h && \
+ echo XXXX )
echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat
-test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
echo "#!/bin/sh" > ${CHROOTDIR}/mk
@@ -223,21 +242,19 @@ rerelease release:
# Don't remove this, or the build will fall over!
echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
- echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
- echo " cd /usr/src" >> ${CHROOTDIR}/mk
+ echo "cd /usr/src" >> ${CHROOTDIR}/mk
.if make(release)
- echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
- echo " make world" >> ${CHROOTDIR}/mk
+ echo "(cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk
+ echo "make world" >> ${CHROOTDIR}/mk
.endif
.if make(rerelease)
- echo " make all install" >> ${CHROOTDIR}/mk
+ echo "make all install" >> ${CHROOTDIR}/mk
.endif
- echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk
- echo "fi" >> ${CHROOTDIR}/mk
echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk
echo "make obj" >> ${CHROOTDIR}/mk
echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
echo "make objlink" >> ${CHROOTDIR}/mk
+ echo "(cd obj; rm -f ${REDOREDO})" >> ${CHROOTDIR}/mk
echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk
chmod 755 ${CHROOTDIR}/mk
@@ -249,7 +266,7 @@ clean:
# Clean out /R and make the directory structure.
release.1:
-mkdir /R
- -chflags -R noschg /R/.
+ chflags -R noschg /R/.
rm -rf /R/*
mkdir ${RD}
mkdir ${RD}/floppies
@@ -281,7 +298,13 @@ release.2:
make kprog \
)
.endif
- -chflags -R noschg ${RD}/trees
+ # XXX until lkm and mdec gets populated again by some other means
+.if ${MACHINE_ARCH} == "i386"
+ cd ${.CURDIR}/.. && OBJFORMAT=aout MAKEOBJDIRPREFIX=/usr/obj/aout \
+ NOTOOLS=1 NOSECURE=1 NOCRYPT=1 \
+ make -f Makefile.inc1 legacy-install DESTDIR=${RD}/trees/bin
+.endif
+ chflags -R noschg ${RD}/trees
touch release.2
# Make and install the generic kernel(s).
@@ -423,6 +446,9 @@ release.8: write_mfs_in_kernel dumpnlist
mkdir ${RD}/mfsfd
cd ${RD}/mfsfd && \
mkdir -p etc dev mnt stand/help
+.if ${MACHINE_ARCH} == "i386"
+ @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/mfsfd/stand
+.endif
@cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
DIR=${RD}/mfsfd/stand ZIP=false
( cd ${RD}/trees/bin/dev && \
@@ -436,24 +462,21 @@ release.8: write_mfs_in_kernel dumpnlist
echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services
echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services
gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz
- for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \
- gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; done
-test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
- @mkdir -p ${RD}/mfsfd/boot
- @cp /boot/boot* ${RD}/mfsfd/boot
@echo "Making the regular boot floppy."
- @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
- tar xf - -C ${RD}/mfsfd/stand
+ tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
+ tar xvf - -C ${RD}/mfsfd/stand
@echo "Compressing doc files..."
@gzip -9 ${RD}/mfsfd/stand/help/*.hlp
- @sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \
- ${BOOTMFSSIZE} ${RD}/mfsfd ${MFSINODE} ${BOOTMFSLABEL}
- @gzip -vc mfsroot > mfsroot.gz
- @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \
- ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
- @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
- @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot _MFSKERN=YES
- @rm mfsroot mfsroot.gz mfsroot.size
+ sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
+ ${RD}/mfsfd ${MFSINODE} ${BOOTMFSLABEL}
+ mv fs-image fs-image.std
+ mv fs-image.size fs-image.std.size
+ gzip -c fs-image.std > ${RD}/floppies/mfsroot.gz
+ cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std
+ mv ${RD}/floppies/bootstd.flp ${RD}/floppies/kern.flp
+ cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std _MFSKERN=YES
+ mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp
@echo "Regular and MFS boot floppies made."
touch release.8
@@ -461,30 +484,35 @@ release.8: write_mfs_in_kernel dumpnlist
# --==## Create a fixit floppy ##==--
#
release.9:
- @echo "Making fixit floppy."
- @rm -rf ${RD}/fixitfd
- @mkdir ${RD}/fixitfd
- @cd ${RD}/fixitfd && \
+ rm -rf ${RD}/fixitfd
+ mkdir ${RD}/fixitfd
+ cd ${RD}/fixitfd && \
mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
- usr/share/misc
+ usr/share/misc usr/mdec
@cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \
DIR=${RD}/fixitfd/stand ZIP=false
- @( cd ${RD}/fixitfd/dev && \
+ ( cd ${RD}/fixitfd/dev && \
sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \
chmod 755 MAKEDEV && \
sh MAKEDEV all )
- @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
+ cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \
${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc
- @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
+ cp ${RD}/trees/bin/usr/share/misc/scsi_modes \
${RD}/fixitfd/usr/share/misc
- @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
- @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
- @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
- @chmod 555 ${RD}/fixitfd/stand/tar
- @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \
- ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
+ cp ${RD}/trees/bin/usr/mdec/boot[12] ${RD}/fixitfd/usr/mdec
+ for type in fd od sd wd ; do \
+ ( cd ${RD}/fixitfd/usr/mdec && ln -s boot1 $${type}boot && \
+ ln -s boot2 boot$${type} ) ; \
+ done
+ cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
+ cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
+ cp ${.CURDIR}/tar.sh ${RD}/fixitfd/stand/tar
+ chmod 555 ${RD}/fixitfd/stand/tar
+ sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FIXITSIZE} \
+ ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
+ mv fs-image ${RD}/floppies/fixit.flp
# Do our last minute floppies directory setup in a convenient place.
- @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT
+ cp ${.CURDIR}/README.TXT ${RD}/floppies/README.TXT
@(cd ${RD}/floppies; md5 * > CHECKSUM.MD5)
touch release.9
@@ -492,26 +520,36 @@ release.9:
# --==## Setup a suitable ftp-area ##==--
#
ftp.1:
- @echo "Setting up FTP distribution area"
- @mkdir -p ${FD}
- @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
- @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
- @for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${FD}; done
- @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
+ mkdir -p ${FD}
+ cd ${RD} && find floppies -print | cpio -dumpl ${FD}
+ cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
+ cp ${.CURDIR}/ABOUT.TXT ${FD}/ABOUT.TXT
+ cp ${.CURDIR}/ERRATA.TXT ${FD}/ERRATA.TXT
+ cp ${.CURDIR}/LAYOUT.TXT ${FD}/LAYOUT.TXT
+ cp ${.CURDIR}/sysinstall/help/readme.hlp ${FD}/README.TXT
+ cp ${.CURDIR}/sysinstall/help/hardware.hlp ${FD}/HARDWARE.TXT
+ cp ${.CURDIR}/sysinstall/help/install.hlp ${FD}/INSTALL.TXT
+ cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${FD}/RELNOTES.TXT
+ cp ${.CURDIR}/sysinstall/help/trouble.hlp ${FD}/TROUBLE.TXT
+ cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${FD}/UPGRADE.TXT
+
+ echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
.if !defined(NOPORTS)
- @tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
+ tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD}
.endif
#
# --==## Setup a suitable cdrom-area ##==--
#
cdrom.1:
- @echo "Setting up CDROM distribution area"
- @mkdir -p ${CD_DISC1} ${CD_DISC2}
- @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
- @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
- @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel
- @for i in ${DISTRIBUTIONS} ; \
+ mkdir -p ${CD_DISC1} ${CD_DISC2}
+ cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
+ cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
+ ln -f ${RD}/kernels/MFSKERNEL.std ${CD_DISC1}/kernel
+.if ${MACHINE_ARCH} != "alpha"
+ ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD_DISC1}
+.endif
+ for i in ${DISTRIBUTIONS} ; \
do \
if [ -d ${RD}/trees/$${i} ] ; then \
chflags -R noschg ${RD}/trees/$${i} ; \
@@ -519,25 +557,35 @@ cdrom.1:
find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
fi \
done
- @rm -f ${CD_DISC2}/.profile
- @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
- @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
- @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
- @for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; done
+ rm -f ${CD_DISC2}/.profile
+ cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
+ echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
+ echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
+ cp ${.CURDIR}/ABOUT.TXT ${CD_DISC1}/ABOUT.TXT
+ cp ${.CURDIR}/ERRATA.TXT ${CD_DISC1}/ERRATA.TXT
+ cp ${.CURDIR}/LAYOUT.TXT ${CD_DISC1}/LAYOUT.TXT
+ cp ${.CURDIR}/sysinstall/help/readme.hlp ${CD_DISC1}/README.TXT
+ cp ${.CURDIR}/sysinstall/help/hardware.hlp ${CD_DISC1}/HARDWARE.TXT
+ cp ${.CURDIR}/sysinstall/help/install.hlp ${CD_DISC1}/INSTALL.TXT
+ cp ${.CURDIR}/sysinstall/help/relnotes.hlp ${CD_DISC1}/RELNOTES.TXT
+ cp ${.CURDIR}/sysinstall/help/trouble.hlp ${CD_DISC1}/TROUBLE.TXT
+ cp ${.CURDIR}/sysinstall/help/upgrade.hlp ${CD_DISC1}/UPGRADE.TXT
+
.if !defined(NOPORTS)
- @-rm -rf /usr/ports/distfiles/*
- @mkdir -p ${CD_DISC1}/ports && \
+ -rm -rf /usr/ports/distfiles/*
+ tar -cBf - -C /usr ports | tar xBpf - -C ${CD_DISC2} && \
+ mkdir -p ${CD_DISC1}/ports && \
tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \
- cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \
- && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
+ cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh && \
+ (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5)
+ ln -s ../ports ${CD_DISC2}/usr/ports
.endif
doc.1:
- @echo "Making docs..."
- @for i in ${DOCPORTS}; do \
- cd /usr/ports/$$i && make all install clean JADETEX=no FORCE_PKG_REGISTER=yes; \
+ for i in ${DOCPORTS}; do \
+ cd /usr/ports/$$i && make all install clean FORCE_PKG_REGISTER=yes; \
done
- @cd /usr/doc && make all distribute DISTDIR=${RD}/trees
+ cd /usr/doc && make all distribute DISTDIR=${RD}/trees
touch doc.1
# Various "subroutine" and other supporting targets.
@@ -552,14 +600,14 @@ doTARBALL:
.if !defined(ARG)
@echo "ARG undefined in doTARBALL" && exit 1
.endif
- @rm -rf ${RD}/dists/${TD}/${TN}*
- @mkdir -p ${RD}/dists/${TD}
- @( cd ${SD} && \
+ rm -rf ${RD}/dists/${TD}/${TN}*
+ mkdir -p ${RD}/dists/${TD}
+ ( cd ${SD} && \
tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
echo rolling ${TD}/$$tn tarball &&\
tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
- sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
+ sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > \
${RD}/dists/${TD}/$$tn.inf && \
if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
@@ -578,21 +626,21 @@ doTARBALL:
doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \
release.6 release.7 release.8 release.9
- @cd ${.CURDIR} && ${MAKE} ${EXTRAS}
+ cd ${.CURDIR} && ${MAKE} ${EXTRAS}
@echo "Release done"
floppies:
- @cd ${.CURDIR} && ${MAKE} boot.flp
- @cd ${.CURDIR} && ${MAKE} fixit.flp
- @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
+ cd ${.CURDIR} && ${MAKE} boot.flp
+ cd ${.CURDIR} && ${MAKE} fixit.flp
+ cd ${RD} && find floppies -print | cpio -dumpl ${FD}
boot.flp:
- @rm -f release.4 release.8
- @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
+ rm -f release.4 release.8
+ cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot
fixit.flp:
- @rm -f release.4 release.9
- @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
+ rm -f release.4 release.9
+ cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit
write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
@@ -611,13 +659,13 @@ installCRUNCH:
.if !defined(ZIP)
@echo "ZIP undefined in installCRUNCH" && exit 1
.endif
- @if ${ZIP} ; then \
+ if ${ZIP} ; then \
gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
else \
ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
fi
- @chmod 555 ${DIR}/${CRUNCH}_crunch
- @for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
+ chmod 555 ${DIR}/${CRUNCH}_crunch
+ for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
done
@@ -628,9 +676,9 @@ installCRUNCH:
# may want to reuse it (release.8 presently)
#
doKERNEL:
- @rm -f ${RD}/kernels/${KERNEL}
- @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
- @cd ${.CURDIR}/../sys/compile/${KERNEL} && \
+ rm -f ${RD}/kernels/${KERNEL}
+ cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL}
+ cd ${.CURDIR}/../sys/compile/${KERNEL} && \
make depend && \
make kernel && \
cp kernel ${RD}/kernels/${KERNEL}
@@ -639,60 +687,84 @@ doKERNEL:
# --==## Put a filesystem into a BOOTMFS kernel ##==--
#
doMFSKERN:
- @echo "Running doMFSKERN for ${FSIMAGE}"
@rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE}
+ @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o
@cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \
- sh ${.CURDIR}/scripts/dokern.sh ${_MFSKERN} < GENERIC > BOOTMFS
+ sed -e '/pty/d' \
+ -e '/pass0/d' \
+ -e '/apm0/d' \
+ -e '/ft0/d' \
+ -e '/ppp/d' \
+ -e '/gzip/d' \
+ -e '/PROCFS/d' \
+ -e '/SYSVSHM/d' \
+ -e '/KTRACE/d' \
+ -e '/MATH_EMULATE/d' \
+ -e 's/GENERIC/BOOTMFS/g' \
+ -e '/maxusers/s/32/4/' < GENERIC > BOOTMFS && \
+ echo "options NFS_NOSERVER" >> BOOTMFS && \
+ echo 'options "MAXCONS=4"' >> BOOTMFS && \
+ echo "options SCSI_NO_OP_STRINGS" >> BOOTMFS && \
+ echo "options SCSI_NO_SENSE_STRINGS" >> BOOTMFS
.if ${MACHINE_ARCH} == "i386"
- @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
+ @echo "options USERCONFIG_BOOT" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS
.endif
.if defined(_MFSKERN)
- @echo "options \"MFS_ROOT_SIZE=`cat mfsroot.size`\"" >> \
+ @echo "options \"MFS_ROOT_SIZE=`cat fs-image.${FSIMAGE}.size`\"" >> \
${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS
.endif
- @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
- @rm -rf ${RD}/image.${FSIMAGE}
- @mkdir ${RD}/image.${FSIMAGE}
- @cp ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
- mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
+ cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
+ @rm -rf ${RD}/boot.${FSIMAGE}
+ @mkdir ${RD}/boot.${FSIMAGE}
+ @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
+ @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel
.if !defined(_MFSKERN) || ${MACHINE_ARCH} == "alpha"
- @echo "Setting up /boot directory for ${FSIMAGE} floppy"
- @mkdir -p ${RD}/image.${FSIMAGE}/boot
- @cp /boot/* ${RD}/image.${FSIMAGE}/boot
- @rm -f ${RD}/image.${FSIMAGE}/boot/netboot
-
- @echo "@load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc
- @echo "@echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
- @echo "@read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
- @echo "@load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
- @echo "@boot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
- @touch ${RD}/image.${FSIMAGE}/boot/loader.config
+ @mkdir -p ${RD}/boot.${FSIMAGE}/boot
+.if ${MACHINE_ARCH} == "alpha"
+ @cp /usr/mdec/boot2 ${RD}/boot.${FSIMAGE}/boot
+.else
+ @cp /boot/* ${RD}/boot.${FSIMAGE}/boot
.endif
-.if defined(_MFSKERN)
- @echo "Getting symbols from ${RD}/image.${FSIMAGE}/kernel for mfsroot"
- @vnconfig /dev/${VNDEVICE} mfsroot
+ @echo "@load /kernel" > ${RD}/boot.${FSIMAGE}/boot/boot.conf
+ @echo "@echo Please insert MFS root floppy and press enter:" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
+ @echo "@read" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
+ @echo "@load -t mfs_root /mfsroot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
+ @echo "@boot" >> ${RD}/boot.${FSIMAGE}/boot/boot.conf
+ @echo "/boot/loader" >${RD}/boot.${FSIMAGE}/boot.config
+ @touch ${RD}/boot.${FSIMAGE}/boot/loader.config
+.endif
+ @vnconfig /dev/${VNDEVICE} fs-image.${FSIMAGE}
@mkdir -p /tmp/mnt_xx
@mount /dev/${VNDEVICE} /tmp/mnt_xx
- @./dumpnlist ${RD}/image.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
+ ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols
@umount /tmp/mnt_xx
@vnconfig -u /dev/${VNDEVICE}
@rmdir /tmp/mnt_xx
- @echo "Writing MFS image into kernel for ${FSIMAGE} floppy"
- @./write_mfs_in_kernel ${RD}/image.${FSIMAGE}/kernel mfsroot
- @cp ${RD}/image.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
+.if defined(_MFSKERN)
+ ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \
+ fs-image.${FSIMAGE}
.endif
- @gzip -v ${RD}/image.${FSIMAGE}/kernel
- @touch ${RD}/image.${FSIMAGE}/kernel.config
- @rm -f ${RD}/floppies/${FSIMAGE}.flp
+.if ${MACHINE_ARCH} == "i386"
+ kzip -v ${RD}/boot.${FSIMAGE}/kernel
+ @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
+ @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel
+ @cp ${.CURDIR}/../sys/i386/boot/biosboot/boot.help ${RD}/boot.${FSIMAGE}
+.else
+ @cp ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE}
+ gzip -v ${RD}/boot.${FSIMAGE}/kernel
+ @mv ${RD}/boot.${FSIMAGE}/kernel.gz ${RD}/boot.${FSIMAGE}/kernel.gz
+.endif
+ @printf \\a\\a\\a >> ${RD}/boot.${FSIMAGE}/boot.help
+ @touch ${RD}/boot.${FSIMAGE}/boot.config
+ @touch ${RD}/boot.${FSIMAGE}/kernel.config
+ @rm -f ${RD}/floppies/boot${FSIMAGE}.flp
.if defined(_MFSKERN)
- @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
- ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/image.${FSIMAGE} \
- ${BOOTINODE} ${BOOTMFSLABEL}
+ sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} \
+ ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTMFSLABEL}
.else
- @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \
- ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
- ${BOOTINODE} ${BOOTLABEL}
+ sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTSIZE} \
+ ${RD}/boot.${FSIMAGE} ${BOOTINODE} ${BOOTLABEL}
.endif
- @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
+ mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp
.include <bsd.prog.mk>
diff --git a/release/README.TXT b/release/README.TXT
new file mode 100644
index 000000000000..2d3e9a48d5b6
--- /dev/null
+++ b/release/README.TXT
@@ -0,0 +1,60 @@
+For a normal CDROM or network installation, all you need to copy onto an
+actual floppy from this directory is the boot.flp image (for 1.44MB floppies).
+
+If you're on the ALPHA then the boot.flp image is probably larger
+than any kind of floppy you have available and you will need to
+either netboot it, load it from some other type of media (such
+as a jaz drive) or use the kern.flp image described below.
+
+This release still uses only one installation floppy, the boot.flp
+image. For convenience (and for the DEC ALPHA architecture, on which
+binaries are quite a bit larger), however, we also provide the
+functionality of boot.flp now "decoupled" into a kern.flp image,
+which contains just the boot kernel, and mfsroot.gz, which contains
+the compressed MFS root image that is normally stored as part of
+the kernel itself on the boot.flp image. This allows you to boot
+from kern.flp, which will fit on a 1.44MB floppy even on the alpha,
+and then load mfsroot.gz from a 2nd floppy. This also allows you
+to easily make your own boot or MFS floppies should you need to customize
+some aspect of the installation process. As long as the kernel is compiled
+with ``options MFS'' and ``options MFS_ROOT'', it will properly
+boot an mfsroot.gz image when run. The mfsroot.gz image is simply
+a gzip'd filesystem image, something which can be made rather
+easily using vnconfig(8). If none of this makes any sense to you,
+don't worry about it - just use the boot.flp image as always; nothing
+has changed there.
+
+
+NOTE: The *.flp images are NOT DOS files! You cannot simply copy them
+to a DOS or UFS floppy as regular files, you need to *image* copy them
+to the floppy with fdimage.exe under DOS or `dd' under UNIX.
+
+For example:
+
+To create the boot floppy image from DOS, you'd do something like
+this:
+
+C> fdimage boot.flp a:
+
+Assuming that you'd copied fdimage.exe and boot.flp into a directory
+somewhere. If you were doing this from the base of a CD distribution,
+then the *exact* command would be:
+
+E> tools\fdimage floppies\boot.flp a:
+
+
+If you're creating the boot floppy from a UNIX machine, you may find
+that:
+
+ dd if=floppies/boot.flp of=/dev/rfd0
+
+or
+
+ dd if=floppies/boot.flp of=/dev/floppy
+
+work well, depending on your hardware and operating system environment
+(different versions of UNIX have totally different names for the
+floppy drive - neat, huh? :-).
+
+The only image which is copied onto a floppy as an ordinary file is
+mfsroot.gz, should you actually be using that image for something.
diff --git a/release/doFS.sh b/release/doFS.sh
new file mode 100644
index 000000000000..74bab0969b52
--- /dev/null
+++ b/release/doFS.sh
@@ -0,0 +1,74 @@
+:
+#set -ex
+
+if [ "x$VNDEVICE" = "x" ] ; then
+ VNDEVICE=vn0
+fi
+export BLOCKSIZE=512
+
+RD=$1 ; shift
+MNT=$1 ; shift
+FSSIZE=$1 ; shift
+FSPROTO=$1 ; shift
+FSINODE=$1 ; shift
+FSLABEL=$1 ; shift
+
+deadlock=20
+
+while true
+do
+ rm -f fs-image
+
+ if [ ! -b /dev/${VNDEVICE} -o ! -c /dev/r${VNDEVICE} ] ; then
+ ( cd /dev && sh MAKEDEV ${VNDEVICE} )
+ fi
+
+ umount /dev/${VNDEVICE} 2>/dev/null || true
+
+ umount ${MNT} 2>/dev/null || true
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ dd of=fs-image if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
+ # this suppresses the `invalid primary partition table: no magic'
+ awk 'BEGIN {printf "%c%c", 85, 170}' |\
+ dd of=fs-image obs=1 seek=510 conv=notrunc 2>/dev/null
+
+ vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
+
+ if [ "`uname -m`" = "alpha" ]; then
+ disklabel -Brw -b ${RD}/trees/bin/usr/mdec/boot1 \
+ /dev/r${VNDEVICE} ${FSLABEL}
+ else
+ disklabel -Brw \
+ -b ${RD}/trees/bin/usr/mdec/fdboot \
+ -s ${RD}/trees/bin/usr/mdec/bootfd \
+ /dev/r${VNDEVICE} ${FSLABEL}
+ fi
+ newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T ${FSLABEL} -o space /dev/r${VNDEVICE}c
+
+ mount /dev/${VNDEVICE}c ${MNT}
+
+ ( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} )
+
+ df -ki /mnt
+
+ set `df -ki /mnt | tail -1`
+
+ umount ${MNT}
+
+ fsck -p /dev/r${VNDEVICE}c < /dev/null
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ if ! echo $FSLABEL | grep -q minimum; then
+ echo ${FSSIZE} > fs-image.size
+ break
+ fi
+
+ echo ">>> Filesystem is ${FSSIZE} K, $4 left"
+ echo ">>> ${FSINODE} bytes/inode, $7 left"
+ echo ">>> `expr ${FSSIZE} \* 1024 / ${FSINODE}`"
+ echo ${FSSIZE} > fs-image.size
+ break;
+done
diff --git a/release/floppies/Makefile b/release/floppies/Makefile
new file mode 100644
index 000000000000..01629be243ca
--- /dev/null
+++ b/release/floppies/Makefile
@@ -0,0 +1,7 @@
+# $Id: Makefile,v 1.6 1997/07/16 12:24:13 julian Exp $
+#
+SUBDIR= bin boot fixit
+
+.include <bsd.subdir.mk>
+
+
diff --git a/release/floppies/bin/Makefile b/release/floppies/bin/Makefile
new file mode 100644
index 000000000000..15f5ebff4c19
--- /dev/null
+++ b/release/floppies/bin/Makefile
@@ -0,0 +1,7 @@
+# $Id: Makefile,v 1.1 1997/07/16 12:24:18 julian Exp $
+#
+SUBDIR= write_mfs_in_kernel dumpnlist
+
+.include <bsd.subdir.mk>
+
+
diff --git a/release/floppies/bin/doFS.sh b/release/floppies/bin/doFS.sh
new file mode 100644
index 000000000000..f0c2f2b189a3
--- /dev/null
+++ b/release/floppies/bin/doFS.sh
@@ -0,0 +1,71 @@
+:
+#set -ex
+
+VNDEVICE=vn0
+export BLOCKSIZE=512
+
+BOOTBLKDIR=$1 ; shift
+MNT=$1 ; shift
+FSSIZE=$1 ; shift
+FSPROTO=$1 ; shift
+FSINODE=$1 ; shift
+FSLABEL=$1 ; shift
+
+deadlock=20
+
+while true
+do
+ rm -f fs-image
+
+ if [ ! -b /dev/${VNDEVICE} -o ! -c /dev/r${VNDEVICE} ] ; then
+ ( cd /dev && sh MAKEDEV ${VNDEVICE} )
+ fi
+
+ umount /dev/${VNDEVICE} 2>/dev/null || true
+
+ umount ${MNT} 2>/dev/null || true
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ dd of=fs-image if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
+ # this suppresses the `invalid primary partition table: no magic'
+ awk 'BEGIN {printf "%c%c", 85, 170}' |\
+ dd of=fs-image obs=1 seek=510 conv=notrunc 2>/dev/null
+
+ vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
+
+ disklabel -Brw \
+ -b ${BOOTBLKDIR}/boot1 \
+ -s ${BOOTBLKDIR}/boot2 \
+ /dev/r${VNDEVICE} minimum
+
+ TPC=1
+ CPD=1
+ SPT=$(( 2 * $FSSIZE / 2))
+ newfs -u ${SPT} -t ${TPC} -s $(( ${FSSIZE} * 2 )) -i ${FSINODE} -m 0 -o space /dev/r${VNDEVICE}c
+
+ mount /dev/${VNDEVICE}c ${MNT}
+
+ ( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} )
+
+ df -ki /mnt
+
+ set `df -ki /mnt | tail -1`
+
+ umount ${MNT}
+
+ fsck -p /dev/r${VNDEVICE}c < /dev/null
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ if [ $FSLABEL != "minimum" ] ; then
+ echo ${FSSIZE} > fs-image.size
+ break
+ fi
+
+ echo ">>> Filesystem is ${FSSIZE} K, $4 left"
+ echo ">>> ${FSINODE} bytes/inode, $7 left"
+ echo ">>> `expr ${FSSIZE} \* 1024 / ${FSINODE}`"
+ echo ${FSSIZE} > fs-image.size
+ break;
+done
diff --git a/release/floppies/bin/dumpnlist/Makefile b/release/floppies/bin/dumpnlist/Makefile
new file mode 100644
index 000000000000..7cf75b881d33
--- /dev/null
+++ b/release/floppies/bin/dumpnlist/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.1 1997/07/22 02:50:58 julian Exp $
+#
+PROG=dumpnlist
+NOMAN=yes
+.PATH: ${.CURDIR}/../../..
+
+.include <bsd.prog.mk>
+
+
diff --git a/release/floppies/bin/write_mfs_in_kernel/Makefile b/release/floppies/bin/write_mfs_in_kernel/Makefile
new file mode 100644
index 000000000000..f77efb5aa990
--- /dev/null
+++ b/release/floppies/bin/write_mfs_in_kernel/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.1 1997/07/22 02:50:59 julian Exp $
+#
+PROG=write_mfs_in_kernel
+NOMAN=yes
+.PATH: ${.CURDIR}/../../..
+
+.include <bsd.prog.mk>
+
+
diff --git a/release/floppies/boot/Makefile b/release/floppies/boot/Makefile
new file mode 100644
index 000000000000..6200afe5b6fc
--- /dev/null
+++ b/release/floppies/boot/Makefile
@@ -0,0 +1,4 @@
+# $Id$
+SUBDIR= crunch mfs floppy
+
+.include <bsd.subdir.mk>
diff --git a/release/floppies/boot/crunch/Makefile b/release/floppies/boot/crunch/Makefile
new file mode 100644
index 000000000000..90ee8bcdef60
--- /dev/null
+++ b/release/floppies/boot/crunch/Makefile
@@ -0,0 +1,15 @@
+OBJTOP=../../../..
+SYSINSTALL= ${OBJTOP}/release/sysinstall/sysinstall
+
+all: ${SYSINSTALL}
+
+${SYSINSTALL}:
+ cd ${.CURDIR}/../../../../release/sysinstall ; make
+ @if ! test -f ${SYSINSTALL} ; then \
+ ${ECHO} "sysinstall not made" ; \
+ ${ECHO} "Possibly need to 'make obj' for floppies and sysinstall" ; \
+ exit 1; \
+ fi
+
+.include "../../mk/makecrunch.mk"
+
diff --git a/release/floppies/boot/crunch/crunch.conf b/release/floppies/boot/crunch/crunch.conf
new file mode 100644
index 000000000000..e1297385219a
--- /dev/null
+++ b/release/floppies/boot/crunch/crunch.conf
@@ -0,0 +1,21 @@
+# $Id: crunch.conf,v 1.4 1997/07/22 02:51:00 julian Exp $
+
+srcdirs /usr/src/bin
+srcdirs /usr/src/release
+srcdirs /usr/src/sbin/i386
+srcdirs /usr/src/sbin
+srcdirs /usr/src/usr.bin
+srcdirs /usr/src/gnu/usr.bin
+srcdirs /usr/src/usr.sbin
+
+progs sh find
+progs pwd ft ppp
+progs sysinstall newfs gzip cpio bad144 fsck ifconfig route slattach
+progs mount_nfs
+ln gzip gunzip
+ln gzip zcat
+ln sh -sh
+
+libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz
+libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx
+
diff --git a/release/floppies/boot/floppy/Makefile b/release/floppies/boot/floppy/Makefile
new file mode 100644
index 000000000000..b42c8203c448
--- /dev/null
+++ b/release/floppies/boot/floppy/Makefile
@@ -0,0 +1,112 @@
+
+# $Id: Makefile,v 1.6 1997/07/22 02:51:00 julian Exp $
+# If this is a RELEASE, then set
+
+# Things which without too much trouble can be considered variables
+
+# mountpoint for filesystems.
+TOP=${.CURDIR}/../../../..
+OBJTOP=${.OBJDIR}/../../../..
+FS_BIN=../../bin
+SCRIPTDIR=${.CURDIR}/../../bin
+
+MNT= /mnt
+
+# other floppy parameters.
+FSSIZE= 1440
+FSLABEL= fd1440
+FSINODE= 4300
+
+NEWFSARGS= -c 80 -b 4096 -f 512 -i 4000 -m 0 -t 0 -u 0 \
+ -o space -T ${FSLABEL}
+
+
+# Upper size for the mfs in the boot.flp kernel.
+# These are adjusted down to the minimum needed by doFS.sh.
+BOOTMFSSIZE= 1200
+MFSINODE= 40000
+
+# Things which will get you into trouble if you change them
+MTREEFILES= ${.CURDIR}/../etc/mtree
+
+
+# Complete the bootfd
+#
+# Now, just to get this picture down once and for all:
+#
+# +------------------------------------------------------------------------+
+# |boot.flp |
+# +-----+-----+------------------------------------------------------------+
+# |boot1|boot2|floppy filesystem "bootfd" |
+# +-----+-----+-+--------------------------------------------------------+-+
+# |kernel |
+# +------------+-----------------------------------------+-+
+# |mfs filesystem "mfsfd" |
+# +-----------------------------------------+
+#
+
+all: ${FS_BIN}/write_mfs_in_kernel
+ cd ${.CURDIR} && ${MAKE} doMFSKERN
+
+
+
+#
+# --==## Compile a kernel by name ${KERNEL} ##==--
+#
+# We don't erase the sys/compile/${KERNEL} directory, since somebody
+# may want to reuse it (release.8 presently)
+#
+CONF=${TOP}/sys/i386/conf
+COMPILE=${TOP}/sys/compile
+doKERNEL:
+ cd ${CONF} && config ${KERNEL}
+ cd ${COMPILE}/${KERNEL} && \
+ make depend && \
+ make kernel && \
+
+#
+# --==## Put a filesystem into a BOOTMFS kernel ##==--
+#
+LABELDIR=${OBJTOP}/sys/i386/boot/biosboot
+
+${COMPILE}/BOOTMFS/kernel:
+ rm -f ${COMPILE}/BOOTMFS/mfs_vfsops.o
+ cd ${CONF} && \
+ sed -e '/SYSV/d' \
+ -e '/pty/d' \
+ -e '/PROCFS/d' \
+ -e '/KTRACE/d' \
+ -e 's/GENERIC/BOOTMFS/g' \
+ -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
+ echo "options MFS" >> BOOTMFS && \
+ echo "options NFS_NOSERVER" >> BOOTMFS && \
+ echo 'options "MAXCONS=4"' >> BOOTMFS && \
+ echo "options USERCONFIG_BOOT" >> BOOTMFS
+ echo "options \"MFS_ROOT=`cat ../mfs/fs-image.size`\"" >> \
+ ${CONF}/BOOTMFS
+ cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
+
+doMFSKERN: ${COMPILE}/BOOTMFS/kernel
+ -mkdir tree
+ cp ${COMPILE}/BOOTMFS/kernel tree
+ ${FS_BIN}/write_mfs_in_kernel/write_mfs_in_kernel tree/kernel ../mfs/fs-image
+ kzip -v tree/kernel
+ mv tree/kernel.kz tree/kernel
+ cp ${COMPILE}/../i386/boot/biosboot/boot.help tree
+ touch tree/boot.config
+ @vnconfig /dev/vn0 ../mfs/fs-image
+ @mkdir -p /tmp/mnt_xx
+ @mount /dev/vn0 /tmp/mnt_xx
+ ${FS_BIN}/dumpnlist/dumpnlist ${COMPILE}/BOOTMFS/kernel > /tmp/mnt_xx/stand/symbols
+ @umount /tmp/mnt_xx
+ @vnconfig -u /dev/vn0
+ @rmdir /tmp/mnt_xx
+
+ sh -e ${SCRIPTDIR}/doFS.sh ${LABELDIR} ${MNT} ${FSSIZE} tree \
+ 10000 ${FSLABEL}
+
+clean:
+ rm -rf tree fs-image fs-image.size
+
+.include <bsd.prog.mk>
+
diff --git a/release/floppies/boot/mfs/Makefile b/release/floppies/boot/mfs/Makefile
new file mode 100644
index 000000000000..6a2032dd1459
--- /dev/null
+++ b/release/floppies/boot/mfs/Makefile
@@ -0,0 +1,25 @@
+###
+# $Id: Makefile,v 1.5 1997/07/16 12:24:24 julian Exp $
+#
+# What are we if we weren't told..
+CRUNCHDIRS= ../crunch
+OBJTOP=../../../..
+TOP=${.CURDIR}/../../../..
+SCRIPTDIR=${.CURDIR}/../../bin
+FSLABEL=minimum
+ZIP=false
+
+# the directories you want on the fs
+STANDLINKS= bin sbin
+FS_DIRS= dev stand etc mnt mnt1 mnt2 tmp
+FS_DEVICES= std wd0 wd1 wd2 sd0 sd1 sd2 cuaa0 cuaa1 cuaa2 cuaa3 \
+ fd0 fd1 cd0 mcd0 scd0 matcd0 wcd0 st0 ft0 wt0 vty4
+# a subdir that contains a verbatim image to be copied to the fs
+VERBATIM= ../verbatim
+
+.include "../../mk/crunch_fs.mk"
+all: fs_image
+
+# tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
+# tar xvf - -C ${RD}/mfsfd/stand
+
diff --git a/release/floppies/boot/verbatim/etc/services b/release/floppies/boot/verbatim/etc/services
new file mode 100644
index 000000000000..bd1beff4d9a7
--- /dev/null
+++ b/release/floppies/boot/verbatim/etc/services
@@ -0,0 +1,4 @@
+nameserver 42/tcp name
+ftp 21/tcp
+domain 53/tcp nameserver
+domain 53/udp nameserver
diff --git a/release/floppies/fixit/Makefile b/release/floppies/fixit/Makefile
new file mode 100644
index 000000000000..0e63f8144524
--- /dev/null
+++ b/release/floppies/fixit/Makefile
@@ -0,0 +1,6 @@
+###
+# $Id$
+#
+SUBDIR= crunch image
+
+.include <bsd.subdir.mk>
diff --git a/release/floppies/fixit/crunch/Makefile b/release/floppies/fixit/crunch/Makefile
new file mode 100644
index 000000000000..a1bf7cfb65d7
--- /dev/null
+++ b/release/floppies/fixit/crunch/Makefile
@@ -0,0 +1,3 @@
+OBJTOP=../../../..
+.include "../../mk/makecrunch.mk"
+
diff --git a/release/floppies/fixit/crunch/crunch.conf b/release/floppies/fixit/crunch/crunch.conf
new file mode 100644
index 000000000000..a2365474b025
--- /dev/null
+++ b/release/floppies/fixit/crunch/crunch.conf
@@ -0,0 +1,43 @@
+# $Id: fixit_crunch.conf,v 1.14 1997/12/25 23:08:44 jkh Exp $
+
+# first, we list the source dirs that our programs reside in. These are
+# searched in order listed to find the dir containing each program.
+
+srcdirs /usr/src/bin /usr/src/sbin /usr/src/usr.bin /usr/src/usr.sbin
+srcdirs /usr/src/gnu/usr.bin /usr/src/usr.bin/vi
+srcdirs /usr/src/sbin/i386
+
+# second, we list all the programs we want to include in our crunched binary.
+# The order doesn't matter. Any program that needs hard links to it gets an
+# `ln' directive.
+
+# /bin stuff
+
+progs cat chmod chroot cp date dd df echo ed expr hostname kill ln ls mkdir
+progs mt mv pwd rcp rm rmdir sleep stty sync test
+
+ln test [
+
+# /sbin stuff
+
+progs badsect chown clri disklabel dump dmesg fdisk ft
+progs mknod mount newfs ping reboot restore scsi swapon umount
+
+progs mount_msdos mount_cd9660 mount_nfs
+
+ln dump rdump
+ln restore rrestore
+ln newfs mount_mfs
+ln chown chgrp
+
+# /usr/bin stuff
+
+progs ftp more rsh sed telnet rlogin vi find grep
+ln vi view
+ln vi ex
+
+# finally, we specify the libraries to link in with our binary
+
+libs -lcrypt -ltelnet -lutil -ll -lm
+libs -lcurses -ltermcap -ledit -lgnuregex -lkvm -lscsi -lz
+
diff --git a/release/floppies/fixit/image/Makefile b/release/floppies/fixit/image/Makefile
new file mode 100644
index 000000000000..571ecc5d3c0f
--- /dev/null
+++ b/release/floppies/fixit/image/Makefile
@@ -0,0 +1,20 @@
+###
+# $Id: Makefile,v 1.4 1997/07/16 12:24:27 julian Exp $
+#
+# What are we if we weren't told..
+CRUNCH?= fixit
+CRUNCHDIRS= ../crunch
+TOP=${.CURDIR}/../../../..
+OBJTOP=${.OBJDIR}/../../../..
+SCRIPTDIR=${.CURDIR}/../../bin
+#FSLABEL=minimum
+FSINODE=2000
+
+
+# the directories you want on the fs
+FS_DIRS= dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp
+# a subdir that contains a verbatim image to be copied to the fs
+VERBATIM= ../verbatim
+
+.include "../../mk/crunch_fs.mk"
+all: fs_image
diff --git a/release/floppies/fixit/verbatim/.profile b/release/floppies/fixit/verbatim/.profile
new file mode 100644
index 000000000000..38bdf8b94fe1
--- /dev/null
+++ b/release/floppies/fixit/verbatim/.profile
@@ -0,0 +1,15 @@
+:
+# $Id$
+PATH=/stand
+BLOCKSIZE=K
+PS1="Fixit# "
+
+echo '+---------------------------------------------------+'
+echo '| You are now running from a FreeBSD "fixit" floppy |'
+echo '+---------------------------------------------------+'
+echo
+echo 'Good Luck!'
+echo
+
+export PATH BLOCKSIZE PS1
+
diff --git a/release/floppies/mk/crunch_fs.mk b/release/floppies/mk/crunch_fs.mk
new file mode 100644
index 000000000000..c6d51d19bf8e
--- /dev/null
+++ b/release/floppies/mk/crunch_fs.mk
@@ -0,0 +1,108 @@
+###
+# $Id: crunch_fs.mk,v 1.1 1997/07/16 12:24:29 julian Exp $
+#
+# This is included to make a floppy that includes a crunch file
+#
+# Variables that control this mk include file.
+# TOP specifies where the top of the FreeBSD source tree is.. (*)
+# FS_DIRS directories to make on the fs (*)
+# STANDLINKS added symlinks to /stand on the fs
+# VERBATIM a directory that contains tree to be copied to the fs
+# FSSIZE defaults to 1440
+# FSLABEL defaults to fd1440
+# FSINODE defaults to 4000
+# FS_DEVICES devices to make on the fs (using MAKEDEV) (default = all)
+# ZIP decides if the installed cruch will also be gzip'd(def=true)
+# (*) = Mandatory
+###
+
+# If we weren't told, default to nothing
+.if ! defined( TOP )
+# define TOP!
+xxx
+.endif
+
+# mountpoint for filesystems.
+MNT= /mnt
+
+# other floppy parameters.
+FSSIZE?= 1440
+FSLABEL?= fd1440
+FSINODE?= 2000
+FS_DEVICES?= all
+ZIP?=true
+
+# Things which will get you into trouble if you change them
+TREE= tree
+LABELDIR= ${OBJTOP}/sys/i386/boot/biosboot
+
+clean:
+ rm -rf tree fs-image fs-image.size step[0-9]
+
+.include <bsd.prog.mk>
+
+
+#
+# --==## Create a filesystem image ##==--
+#
+
+fs_image: ${TREE} step2 step3 step4 fs-image
+
+${TREE}: ${.CURDIR}/Makefile
+ rm -rf ${TREE}
+ mkdir -p ${TREE}
+ cd ${TREE} && mkdir ${FS_DIRS}
+ cd ${TREE} ; for i in ${STANDLINKS} ; \
+ do \
+ ln -s /stand $${i} ; \
+ done
+
+step2: ${.CURDIR}/${CRUNCHDIRS} ${.CURDIR}/Makefile
+.if defined(CRUNCHDIRS)
+ @cd ${.CURDIR} && $(MAKE) installCRUNCH DIR=${TREE}/stand ZIP=${ZIP}
+.endif
+ touch step2
+
+step3: step2
+.if defined (FS_DEVICES)
+ ( cd tree/dev && \
+ cp ${TOP}/etc/etc.i386/MAKEDEV . && sh MAKEDEV ${FS_DEVICES} )
+.endif
+ touch step3
+
+step4: step3
+.if defined(VERBATIM)
+ A=`pwd`;cd ${.CURDIR}/${VERBATIM}; \
+ find . \! \( -name CVS -and -prune \) -print |cpio -pdmuv $$A/tree
+.endif
+ true || cp ${TOP}/etc/spwd.db tree/etc
+ touch step4
+
+fs-image: step4
+ sh -e ${SCRIPTDIR}/doFS.sh ${LABELDIR} ${MNT} ${FSSIZE} tree \
+ ${FSINODE} ${FSLABEL}
+ cp fs-image.size ${.CURDIR}
+
+
+.if defined(CRUNCHDIRS)
+installCRUNCH:
+.if !defined(DIR)
+ @echo "DIR undefined in installCRUNCH" && exit 1
+.endif
+.if !defined(ZIP)
+ @echo "ZIP undefined in installCRUNCH" && exit 1
+.endif
+.for CRUNCHDIR in ${CRUNCHDIRS}
+ if ${ZIP} ; then \
+ gzip -9 < ${CRUNCHDIR}/crunch > ${DIR}/.crunch ; \
+ else \
+ ln -f ${CRUNCHDIR}/crunch ${DIR}/.crunch ; \
+ fi
+ chmod 555 ${DIR}/.crunch
+ for i in `crunchgen -l ${.CURDIR}/${CRUNCHDIR}/crunch.conf` ; do \
+ ln -f ${DIR}/.crunch ${DIR}/$$i ; \
+ done
+ rm -f ${DIR}/.crunch
+.endfor
+.endif
+
diff --git a/release/floppies/mk/makecrunch.mk b/release/floppies/mk/makecrunch.mk
new file mode 100644
index 000000000000..8f2d3e70afe1
--- /dev/null
+++ b/release/floppies/mk/makecrunch.mk
@@ -0,0 +1,25 @@
+
+
+SYSINSTALL= ${OBJTOP}/release/sysinstall/sysinstall
+
+NOCRYPT?= yes
+
+all: crunch
+
+crunch:
+ -crunchgen ${.CURDIR}/crunch.conf
+ ${MAKE} -f crunch.mk all NOCRYP=${NOCRYPT} \
+ "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY"
+
+clean:
+ rm -f *.o *.stub *.lo *_stub.c *.mk \
+ crunch.cache \
+ crunch.mk \
+ crunch.c \
+ crunch \
+ .tmp_*
+
+install:
+ @echo " No idea what to do to install yet"
+
+.include <bsd.prog.mk>
diff --git a/release/scripts/info.sh b/release/info.sh
index b1c8c5356ccf..b1c8c5356ccf 100644
--- a/release/scripts/info.sh
+++ b/release/info.sh
diff --git a/release/picobsd/Version b/release/picobsd/Version
index c9e1c0cbd01a..b9153dca573b 100644
--- a/release/picobsd/Version
+++ b/release/picobsd/Version
@@ -1 +1 @@
-VER=0.43
+VER=0.42
diff --git a/release/picobsd/build/build b/release/picobsd/build/build
index 58d347c94201..786ee283f35d 100755
--- a/release/picobsd/build/build
+++ b/release/picobsd/build/build
@@ -1,22 +1,26 @@
#!/bin/sh -
#
-# $Id: build,v 1.11 1999/01/14 23:14:45 abial Exp $
+# $Id: build,v 1.9 1998/09/22 15:40:00 abial Exp $
#
# You can set the SRC variable which points to your source tree. It's
# /usr/src by default (most people shouldn't change it).
SRC=/usr/src
+
+# Set this if your crunchgen and kzip don't support ELF.
+#OBJFORMAT=aout; export OBJFORMAT
+
# Default MFS sizes for different types of the floppy. Again, most people
# shouldn't change them unless they know what they are doing.
DIAL_DFLT_SIZE=1600
ROUTER_DFLT_SIZE=820
-NET_DFLT_SIZE=1700
-ISP_DFLT_SIZE=1700
+NET_DFLT_SIZE=2200
+ISP_DFLT_SIZE=2200
-# DEVFS is currently broken. Always set this.
+# SET THIS if you're not using DEVFS
#
NO_DEVFS=yes
diff --git a/release/picobsd/build/populate b/release/picobsd/build/populate
index 06abaae29bb1..82f3646c1722 100755
--- a/release/picobsd/build/populate
+++ b/release/picobsd/build/populate
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: populate,v 1.7 1999/01/14 23:14:46 abial Exp $
+# $Id: populate,v 1.5 1998/09/19 21:44:42 abial Exp $
#
. ../Version
@@ -53,8 +53,8 @@ then
cp help.a /mnt/help.a)
elif [ "${TYPE}" != "router" ]
then
- #cp ../../build/kvm_kernel.db /mnt/var/db/kvm_kernel.db
- #rm ../../build/kvm_kernel.db
+ cp ../../build/kvm_kernel.db /mnt/var/db/kvm_kernel.db
+ rm ../../build/kvm_kernel.db
fi
echo "-> Making and installing crunch1..."
@@ -74,4 +74,12 @@ if [ ! -f ../tools/dumpnlist/dumpnlist ]
then
(cd ../tools/dumpnlist; make)
fi
+../tools/dumpnlist/dumpnlist ./kernel >/mnt/stand/symbols
+
+echo "-> Preparing kernel config list..."
+if [ ! -f ../tinyware/kget/kget ]
+then
+ (cd ../tinyware/kget; make)
+fi
+../tinyware/kget/kget ./kernel /mnt/stand/vanilla
(echo "-> Fixing permissions"; cd /mnt; chown -R root *)
diff --git a/release/picobsd/build/stage1 b/release/picobsd/build/stage1
index c4159eb0dfea..9846dd0ee22b 100755
--- a/release/picobsd/build/stage1
+++ b/release/picobsd/build/stage1
@@ -1,7 +1,7 @@
#! /bin/sh -
#
-# $Id: stage1,v 1.6 1999/01/14 23:14:46 abial Exp $
+# $Id: stage1,v 1.3 1998/09/11 13:14:25 abial Exp $
#
set -e
@@ -13,14 +13,14 @@ fi
echo "-> Preparing kernel..."
cp -p ${SRC}/sys/compile/PICOBSD${suffix}.${SIZE}/kernel kernel
-#if [ "${TYPE}" != "dial" ]
-#then
-# echo "-> Preparing kvm database..."
-# mv /var/db/kvm_kernel.db /var/db/old.db
-# kvm_mkdb kernel
-# cp /var/db/kvm_kernel.db kvm_kernel.db
-# mv /var/db/old.db /var/db/kvm_kernel.db
-#fi
+if [ "${TYPE}" != "dial" ]
+then
+ echo "-> Preparing kvm database..."
+ mv /var/db/kvm_kernel.db /var/db/old.db
+ kvm_mkdb kernel
+ cp /var/db/kvm_kernel.db kvm_kernel.db
+ mv /var/db/old.db /var/db/kvm_kernel.db
+fi
echo "-> Preparing MFS filesystem..."
umount /dev/vn0 2> /dev/null || true
@@ -50,12 +50,7 @@ if [ "${TYPE}" != "router" ]
then
disklabel -rw vn0 auto
else
- if [ ${SIZE} -lt 1024 ]
- then
- disklabel -rw /dev/rvn0 fd${SIZE}
- else
- disklabel -rw vn0 auto
- fi
+ disklabel -rw /dev/rvn0 fd820
fi
if [ "X$?" != "X0" ]
then
@@ -65,7 +60,7 @@ then
fi
# Default setting for other (custom) setups.
-INODES=4096
+INODES=16000
# You can save some space on MFS if you don't want so many inodes...
if [ "${TYPE}" = "dial" ]
then
diff --git a/release/picobsd/build/stage2 b/release/picobsd/build/stage2
index 9354aadb1e83..d5f70a7aa33f 100755
--- a/release/picobsd/build/stage2
+++ b/release/picobsd/build/stage2
@@ -1,7 +1,7 @@
#! /bin/sh -
#
-# $Id: stage2,v 1.2 1998/09/07 06:46:25 abial Exp $
+# $Id: stage2,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
#
set -e
@@ -21,7 +21,6 @@ if [ ! -f ../tools/write_mfs_in_kernel/wmik ]; then
fi
../tools/write_mfs_in_kernel/wmik kernel fs.PICOBSD
-strip kernel
-strip --remove-section=.note --remove-section=.comment kernel
-gzip -9 -n kernel
+kzip -v kernel
rm fs.PICOBSD
+rm kernel
diff --git a/release/picobsd/build/stage3 b/release/picobsd/build/stage3
index 34b729dc95fd..04b1db384f31 100755
--- a/release/picobsd/build/stage3
+++ b/release/picobsd/build/stage3
@@ -1,14 +1,14 @@
#! /bin/sh -
#
-# $Id: stage3,v 1.3 1998/09/26 17:27:18 abial Exp $
+# $Id: stage3,v 1.2 1998/08/31 13:35:06 abial Exp $
#
set -e
. ../Version
-if [ ! -f kernel.gz ]; then
- echo "-> ERROR: you must build kernel.gz first"
+if [ ! -f kernel.kz ]; then
+ echo "-> ERROR: you must build kernel.kz first"
exit 1
fi
@@ -86,23 +86,15 @@ then
fi
cd ${pwd}
-cp kernel.gz /mnt/kernel.gz
+cp kernel.kz /mnt/kernel
if [ "X$?" != "X0" ]
then
- echo "-> ERROR while transferring kernel.gz to /mnt..."
+ echo "-> ERROR while transferring kernel.kz to /mnt..."
echo "-> Aborting $0"
exit 10
fi
-mkdir /mnt/boot
-cp /boot/loader .
-kzip -v loader
-mv loader.kz /mnt/boot/loader
-rm -f loader loader.o
-echo "/boot/loader" >/mnt/boot.config
-echo "load /kernel">/mnt/boot/loader.rc
-echo "load -t userconfig_script /kernel.config">>/mnt/boot/loader.rc
(echo "-> Fixing permissions"; cd /mnt; chown -R root *)
-rm kernel.gz
+rm kernel.kz
df -ik /mnt
diff --git a/release/picobsd/dial/conf/Makefile b/release/picobsd/dial/conf/Makefile
index 4be01f8f414e..7fd4743f647f 100644
--- a/release/picobsd/dial/conf/Makefile
+++ b/release/picobsd/dial/conf/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 1998/10/15 21:39:58 abial Exp $
+# $Id: Makefile,v 1.2 1998/09/29 12:12:31 abial Exp $
#
SRC?=/usr/src
@@ -17,5 +17,5 @@ $(KERNFILE): PICOBSD
(cd ${CONF}; \
config ${CONFFILE}; \
cd ${COMPILE}; \
- make depend all)
+ make depend && make)
diff --git a/release/picobsd/dial/conf/PICOBSD b/release/picobsd/dial/conf/PICOBSD
index 4be43f626c36..5886e30bfe1a 100644
--- a/release/picobsd/dial/conf/PICOBSD
+++ b/release/picobsd/dial/conf/PICOBSD
@@ -1,5 +1,5 @@
#
-# $Id: PICOBSD,v 1.4 1998/11/14 20:10:15 abial Exp $
+# $Id: PICOBSD,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
#
machine "i386"
cpu "I386_CPU"
@@ -12,7 +12,6 @@ maxusers 3
options MATH_EMULATE #Support for x87 emulation
options INET #InterNETworking
options FFS #Berkeley Fast Filesystem
-options FFS_ROOT
options MFS
options MSDOSFS #MSDOS Filesystem
options "CD9660" #ISO 9660 Filesystem
@@ -20,7 +19,7 @@ options "EXT2FS"
options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
options USERCONFIG #boot -c editor
options VISUAL_USERCONFIG #visual boot -c editor
-options INTRO_USERCONFIG #imply -c and parse info area
+options USERCONFIG_BOOT #imply -c and parse info area
#options DEVFS
options PCI_QUIET
options NO_SWAPPING
@@ -31,16 +30,16 @@ config kernel root on fd0
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
@@ -49,20 +48,16 @@ options ATAPI_STATIC #Don't do it as an LKM
device wcd0 #IDE CD-ROM
# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device psm0 at isa? tty irq 12
-device vga0 at isa? port ? conflicts
-device sc0 at isa? tty
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
-device npx0 at isa? port IO_NPX irq 13
-
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
-device sio1 at isa? port "IO_COM2" tty irq 3
-device sio2 at isa? disable port "IO_COM3" tty irq 5
-device sio3 at isa? disable port "IO_COM4" tty irq 9
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
@@ -72,11 +67,16 @@ device de0
#device de1
device fxp0
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device ep0 at isa? port 0x300 net irq 10
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x300 net irq 10
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+#device ed1 at isa? port 0x300 net irq 5 iomem 0xd0000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+#device ex0 at isa? port? net irq? vector exintr
+#device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+#device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
pseudo-device loop
pseudo-device ether
diff --git a/release/picobsd/dial/crunch1/Makefile b/release/picobsd/dial/crunch1/Makefile
index c47bae8d5327..93b6d78b373e 100644
--- a/release/picobsd/dial/crunch1/Makefile
+++ b/release/picobsd/dial/crunch1/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.2 1998/10/15 21:39:59 abial Exp $
+# $Id: Makefile,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
#
NOCRYPT?= yes
SRC?=/usr/src
@@ -15,7 +15,7 @@ crunch:
fi;
@cat crunch.conf|sed -e "s@/usr/src@${SRC}@" >>crunch1.conf
@crunchgen ${.CURDIR}/crunch1.conf
- @${MAKE} -f crunch1.mk all -DRELEASE_CRUNCH NOCRYPT=${NOCRYPT} \
+ @${MAKE} -f crunch1.mk all NOCRYPT=${NOCRYPT} \
"CFLAGS=${CFLAGS} -DCRUNCHED_BINARY" #2>&1 >/dev/null
clean:
diff --git a/release/picobsd/dial/crunch1/crunch.conf b/release/picobsd/dial/crunch1/crunch.conf
index 3558ddd0a761..f516b752531c 100644
--- a/release/picobsd/dial/crunch1/crunch.conf
+++ b/release/picobsd/dial/crunch1/crunch.conf
@@ -1,4 +1,4 @@
-# $Id: crunch.conf,v 1.4 1998/11/15 23:30:26 abial Exp $
+# $Id: crunch.conf,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
#
# NOTE1: the string "/usr/src" will be automatically replaced with the
# correct value set in 'build' script - you should change it there
@@ -11,9 +11,9 @@
# * You have to configure and build the port
# * Then you have to make a symlink:
# cd /usr/ports/security/ssh/work/
-# ln -s ssh-1.2.26 ssh
+# ln -s ssh-1.2.21 ssh
# * Then you have to add OBJS=${SSH_OBJS} in the Makefile (somewhere around
-# line 327)
+# line 290)
srcdirs /usr/ports/security/ssh/work/
# ash, kget etc...
@@ -33,7 +33,7 @@ ln gzip gunzip
ln gzip zcat
ln gzip gzcat
-progs ash test kget echo pwd msg stty
+progs ash test kget echo pwd
progs hostname cat kill sps vm ns
progs chmod chown help
progs cp df fsck ping mv ln traceroute
@@ -45,7 +45,6 @@ ln ash sh
ln ash -sh
ln test [
ln sps ps
-ln msg dmesg
ln ns netstat
ln mount_msdos msdos
ln mount_cd9660 cd9660
diff --git a/release/picobsd/dial/floppy.tree/etc/login.conf b/release/picobsd/dial/floppy.tree/etc/login.conf
index 9361a33c2f9e..97ea6e8b700f 100644
--- a/release/picobsd/dial/floppy.tree/etc/login.conf
+++ b/release/picobsd/dial/floppy.tree/etc/login.conf
@@ -1,7 +1,7 @@
# This file controls resource limits, accounting limits and
# default user environment settings.
#
-# $Id: login.conf,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: login.conf,v 1.1.1.1 1998/07/14 07:30:41 abial Exp $
#
@@ -45,7 +45,7 @@ standard:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
:path=~/bin /bin /usr/bin:\
- :nologin=/var/run/nologin:\
+ :nologin=/etc/nologin:\
:cputime=1h30m:\
:datasize=8M:\
:stacksize=2M:\
diff --git a/release/picobsd/dial/floppy.tree/etc/rc.network b/release/picobsd/dial/floppy.tree/etc/rc.network
new file mode 100644
index 000000000000..690f32a5387f
--- /dev/null
+++ b/release/picobsd/dial/floppy.tree/etc/rc.network
@@ -0,0 +1,70 @@
+#!/bin/sh -
+# $Id: rc.network.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+network_pass1() {
+ echo -n 'Wstepna konfiguracja sieci:'
+ # Set the host name if it is not already set
+ if [ -z "`hostname -s`" ] ; then
+ hostname $hostname
+ echo ' hostname'
+ fi
+ # Set up all the network interfaces, calling startup scripts if needed
+ for ifn in ${network_interfaces}; do
+ if [ -e /etc/start_if.${ifn} ]; then
+ . /etc/start_if.${ifn}
+ fi
+ # Do the primary ifconfig if specified
+ eval ifconfig_args=\$ifconfig_${ifn}
+ if [ -n "${ifconfig_args}" ] ; then
+ ifconfig ${ifn} ${ifconfig_args}
+ fi
+ # Check to see if aliases need to be added
+ alias=0
+ while :
+ do
+ eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
+ if [ -n "${ifconfig_args}" ]; then
+ ifconfig ${ifn} ${ifconfig_args} alias
+ alias=`expr ${alias} + 1`
+ else
+ break;
+ fi
+ done
+ ifconfig ${ifn}
+ done
+ # Configure routing
+ if [ "x$defaultrouter" != "xNO" ] ; then
+ static_routes="default ${static_routes}"
+ route_default="default ${defaultrouter}"
+ fi
+ # Set up any static routes. This should be done before router discovery.
+ if [ "x${static_routes}" != "x" ]; then
+ for i in ${static_routes}; do
+ eval route_args=\$route_${i}
+ route add ${route_args}
+ done
+ fi
+ echo -n 'Dodatkowe opcje routingu:'
+ if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then
+ echo -n ' tcp_extensions=NO'
+ sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 2>&1
+ sysctl -w net.inet.tcp.rfc1644=0 >/dev/null 2>&1
+ fi
+ if [ "X$gateway_enable" = X"YES" ]; then
+ echo -n ' IP_gateway=YES'
+ sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
+ fi
+ if [ "X$arpproxy_all" = X"YES" ]; then
+ echo -n ' wlaczam ARP_PROXY_ALL: '
+ sysctl -w net.link.ether.inet.proxyall=1 2>&1
+ fi
+ echo '.'
+ network_pass1_done=YES # Let future generations know we made it.
+}
+
+network_pass2() {
+ network_pass2_done=YES
+}
+
+network_pass3() {
+ network_pass3_done=YES
+}
diff --git a/release/picobsd/dial/floppy.tree/etc/resolv.conf b/release/picobsd/dial/floppy.tree/etc/resolv.conf
new file mode 100644
index 000000000000..d273c3bcec6f
--- /dev/null
+++ b/release/picobsd/dial/floppy.tree/etc/resolv.conf
@@ -0,0 +1,3 @@
+# $Id: resolv.conf.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+domain mydomain.org.pl
+nameserver 194.204.159.1
diff --git a/release/picobsd/dial/floppy.tree/etc/services b/release/picobsd/dial/floppy.tree/etc/services
index eec499fafec7..817b6d315272 100644
--- a/release/picobsd/dial/floppy.tree/etc/services
+++ b/release/picobsd/dial/floppy.tree/etc/services
@@ -91,4 +91,3 @@ uucp 540/tcp
uucp 540/udp
uucp-rlogin 541/tcp
uucp-rlogin 541/udp
-natd 8668/divert # Network Address Translation
diff --git a/release/picobsd/dial/lang/LICENCE.ssh b/release/picobsd/dial/lang/LICENCE.ssh
index d5a0361e20f2..eb9023627723 100644
--- a/release/picobsd/dial/lang/LICENCE.ssh
+++ b/release/picobsd/dial/lang/LICENCE.ssh
@@ -3,6 +3,6 @@ http://www.cs.hut.fi/ssh for details. In short, it permits non-commercial
use only. Your usage may be further restricted by applicable local laws on
using strong encryption methods.
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: LICENCE.ssh,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+$Id: LICENCE.ssh,v 1.1.1.1 1998/07/14 07:30:41 abial Exp $
diff --git a/release/picobsd/dial/lang/README.en b/release/picobsd/dial/lang/README.en
index 299c9406fb40..4b2ffad4fbd1 100644
--- a/release/picobsd/dial/lang/README.en
+++ b/release/picobsd/dial/lang/README.en
@@ -101,6 +101,6 @@ I'll be glad hearing from you about your experiences with PicoBSD. Thanks.
Have fun!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
-$Id: README.en,v 1.3 1998/10/15 21:40:00 abial Exp $
+$Id: README.en,v 1.2 1998/09/26 17:27:19 abial Exp $
diff --git a/release/picobsd/dial/lang/README.pl b/release/picobsd/dial/lang/README.pl
index bc31940c79b6..974ac81f81f7 100644
--- a/release/picobsd/dial/lang/README.pl
+++ b/release/picobsd/dial/lang/README.pl
@@ -102,6 +102,6 @@ Mo¿na tam znale¼æ trochê wiêcej informacji, oraz poprawki i nowe wersje.
Mi³ej zabawy!
-Andrzej Bia³ecki <abial@freebsd.org>
+Andrzej Bia³ecki <abial@nask.pl>
-$Id: README.pl,v 1.3 1998/10/15 21:40:00 abial Exp $
+$Id: README.pl,v 1.2 1998/09/26 17:27:19 abial Exp $
diff --git a/release/picobsd/dial/lang/boot.help.en b/release/picobsd/dial/lang/boot.help.en
index 382222b61887..ecc3fa4653dd 100644
--- a/release/picobsd/dial/lang/boot.help.en
+++ b/release/picobsd/dial/lang/boot.help.en
@@ -18,6 +18,6 @@
I hope you'll enjoy it.
- abial@freebsd.org
+ abial@nask.pl
+--------------------------------------------------------------------------+
diff --git a/release/picobsd/dial/lang/boot.help.pl b/release/picobsd/dial/lang/boot.help.pl
index c52eb1191496..0edf7ceeda59 100644
--- a/release/picobsd/dial/lang/boot.help.pl
+++ b/release/picobsd/dial/lang/boot.help.pl
@@ -18,6 +18,6 @@
Milego uzywania.
- abial@freebsd.org
+ abial@nask.pl
+----------------------------------------------------------------------+
diff --git a/release/picobsd/dial/lang/dialup.en b/release/picobsd/dial/lang/dialup.en
index 23b5d8ee8d98..918c6703ce96 100755
--- a/release/picobsd/dial/lang/dialup.en
+++ b/release/picobsd/dial/lang/dialup.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: dialup.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: dialup.en,v 1.3 1998/08/07 19:29:57 abial Exp $
set_resolv() {
echo ""
echo " Default Domain Name"
@@ -163,19 +163,7 @@ do
echo "floppy!!! If you don't like it... well, you must dial in manually."
echo "In that case abort this script (Ctrl-C). Otherwise, continue."
echo ""
- stty -echo
read -p "Please enter your password: " pass
- echo ""
- read -p "Enter again your password: " pass1
- stty echo
- echo ""
- if [ "X${pass}" != "X${pass1}" ]
- then
- echo "Passwords didn't match! Press Enter to continue..."
- read junk
- pass=""
- set_password
- fi
done
}
@@ -190,21 +178,22 @@ do
echo "1) ......login: ${user}"
echo " ...password: ********"
echo " (terminal server starts PPP here)"
+ echo ""
echo "2) ......login: ${user}"
echo " ...password: ********"
echo " ...protocol: ppp"
echo " (terminal server starts PPP here)"
+ echo ""
echo "3) ......username: ${user}"
echo " ......password: ********"
echo " (terminal server starts PPP here)"
+ echo ""
echo "4) ......username: ${user}"
echo " ......password: ********"
echo " portX/..xxx...: ppp"
echo " (terminal server starts PPP here)"
- echo "5) Use CHAP to log in."
- echo "6) Use PAP to log in."
echo ""
- read -p "Choose 1,2,3,4,5 or 6: " chat
+ read -p "Choose 1,2,3 or 4: " chat
case ${chat} in
1)
chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P"
@@ -222,12 +211,6 @@ do
chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp"
chat2="username/password/port"
;;
- 5) chat1="-"
- chat2="CHAP"
- ;;
- 6) chat1="-"
- chat2="PAP"
- ;;
*) echo "Bad value! Please choose 1,2,3 or 4."
echo ""
unset chat
@@ -338,12 +321,7 @@ echo " set speed ${speed}" >>/etc/ppp/ppp.conf
echo " set phone ${phone}" >>/etc/ppp/ppp.conf
echo " set authkey ${pass}" >>/etc/ppp/ppp.conf
echo " set timeout ${timo}" >>/etc/ppp/ppp.conf
-if [ "X${chat1}" = "-" ]
-then
- echo " set authname ${user}" >>/etc/ppp/ppp.conf
-else
- echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
-fi
+echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
echo " set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0" >>/etc/ppp/ppp.conf
echo " Done."
@@ -366,30 +344,12 @@ echo ""
echo "Now, if you're sure that your /etc/ppp/ppp.conf file is ok (which is"
echo -n "probable :-) would you like to start the dialup connection now? (y/n) "
read ans
-opts=""
while [ "X${ans}" = "Xy" ]
do
echo ""
- if [ "X${opts}" = "X" ]
- then
- echo "We'll use the following arguments to 'ppp':"
- echo ""
- echo " ppp -background dialup"
- echo "
- echo -n "Would you like to change them? (y/n) "
- read oo
- if [ "X${oo}" = "Xy" ]
- then
- read -p "Enter ppp arguments here: " opts
- else
- opts="-background dialup"
- fi
- echo ""
- echo ""
- fi
echo "Starting dialup connection. Wait until you see a 'PPP Enabled' message..."
echo ""
- ppp ${opts}
+ ppp -background dialup
if [ "X$?" != "X0" ]
then
echo ""
diff --git a/release/picobsd/dial/lang/dialup.pl b/release/picobsd/dial/lang/dialup.pl
index 2d65e8441d93..3d7dcf508570 100755
--- a/release/picobsd/dial/lang/dialup.pl
+++ b/release/picobsd/dial/lang/dialup.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: dialup.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: dialup.pl,v 1.4 1998/08/10 19:07:52 abial Exp $
set_resolv() {
echo ""
echo " Domy¶lna Nazwa Domeny"
@@ -162,19 +162,7 @@ do
echo "rêcznie, tak jak dotychczas. W tym przypadku przerwij ten skrypt"
echo "przez Ctrl-C."
echo ""
- stty -echo
read -p "Podaj swoje has³o: " pass
- echo ""
- read -p "Podaj powtórnie swoje has³o: " pass1
- stty echo
- echo ""
- if [ "X${pass}" != "X${pass1}" ]
- then
- echo "Has³a nie pasuj± do siebie. Naci¶nij Enter..."
- pass=""
- read junk
- set_pass
- fi
done
}
@@ -200,11 +188,7 @@ do
echo " portX/..xxx...: ppp"
echo " (tutaj startuje PPP)"
echo ""
- echo "4) Zastosuj CHAP"
- echo ""
- echo "5) Zastosuj PAP"
- echo ""
- read -p "Wybierz 1,2,3,4 lub 5: " chat
+ read -p "Wybierz 1,2 lub 3: " chat
case ${chat} in
1)
chat1="TIMEOUT 10 ogin:--ogin: ${user} word: \\\\P"
@@ -218,12 +202,6 @@ do
chat1="TIMEOUT 10 ername:--ername: ${user} word: \\\\P port ppp"
chat2="NASK - username/password/port"
;;
- 4) chat1="-"
- chat2="CHAP"
- ;;
- 5) chat1="-"
- chat2="PAP"
- ;;
*) echo "Z³a warto¶æ! Musisz wybraæ 1,2 lub 3."
echo ""
unset chat
@@ -337,12 +315,7 @@ echo " set line /dev/cuaa${dev}" >>/etc/ppp/ppp.conf
echo " set phone ${phone}" >>/etc/ppp/ppp.conf
echo " set authkey ${pass}" >>/etc/ppp/ppp.conf
echo " set timeout ${timo}" >>/etc/ppp/ppp.conf
-if [ "X${chat1}" = "-" ]
-then
- echo "set authname ${user}" >>/etc/ppp/ppp.conf
-else
- echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
-fi
+echo " set login \"${chat1}\"" >>/etc/ppp/ppp.conf
echo " set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0" >>/etc/ppp/ppp.conf
echo " Zrobione."
@@ -366,27 +339,9 @@ echo ""
echo "Ok. Je¶li Twój plik /etc/ppp/ppp.conf jest prawid³owy (co jest dosyæ"
echo -n "prawdopodobne :-), czy chcesz teraz uruchomiæ po³±czenie dialup? (t/n) "
read ans
-opts=""
while [ "X${ans}" = "Xt" ]
do
echo ""
- if [ "X${opts}" = "X" ]
- then
- echo "Wystartujemy 'ppp' z poni¿szymi opcjami:"
- echo ""
- echo " ppp -background dialup"
- echo "
- echo -n "Czy chcesz je zmienic?? (t/n) "
- read oo
- if [ "X${oo}" = "Xt" ]
- then
- read -p "Podaj opcje ppp: " opts
- else
- opts="-background dialup"
- fi
- echo ""
- echo ""
- fi
echo "Uruchamiam po³±czenie dialup. Proszê czekaæ dopóki nie pojawi siê"
echo "komunikat 'PPP Enabled'..."
echo ""
diff --git a/release/picobsd/dial/lang/rc.en b/release/picobsd/dial/lang/rc.en
index 8a0e806c1e02..c64b446e9e3a 100644
--- a/release/picobsd/dial/lang/rc.en
+++ b/release/picobsd/dial/lang/rc.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.en,v 1.2 1998/09/26 17:27:19 abial Exp $
+# $Id: rc.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
@@ -97,7 +97,7 @@ echo '| BSD license (except for SSH). For more |'
echo '| details see http://www.freebsd.org/~picobsd, |'
echo '| or contact the author. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/dial/lang/rc.pl b/release/picobsd/dial/lang/rc.pl
index 61dfd2f76b33..8042a1c68243 100644
--- a/release/picobsd/dial/lang/rc.pl
+++ b/release/picobsd/dial/lang/rc.pl
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: rc.pl,v 1.2 1998/09/26 17:27:19 abial Exp $
+# $Id: rc.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
#
############################################
### Special setup for one floppy PICOBSD ###
@@ -101,7 +101,7 @@ echo '| SSH). Po wiecej szczegolow zajrzyj na |'
echo '| http://www.freebsd.org/~picobsd, lub |'
echo '| skontaktuj sie z autorem. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/dial/lang/update.en b/release/picobsd/dial/lang/update.en
index 8fff72917e4c..006e0ed4b292 100755
--- a/release/picobsd/dial/lang/update.en
+++ b/release/picobsd/dial/lang/update.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: update.en,v 1.4 1998/08/10 19:07:53 abial Exp $
pwd=`pwd`
echo -n "Updating /etc contents on startup floppy... "
mount /dev/fd0a /start_floppy
@@ -14,7 +14,7 @@ cd /etc
cp -Rp . /start_floppy/etc/
echo " Done."
echo -n "Updating kernel parameters... "
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd ${pwd}
echo " Done."
diff --git a/release/picobsd/dial/lang/update.pl b/release/picobsd/dial/lang/update.pl
index d462b9f84089..97105d229aaf 100755
--- a/release/picobsd/dial/lang/update.pl
+++ b/release/picobsd/dial/lang/update.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: update.pl,v 1.4 1998/08/10 19:07:53 abial Exp $
pwd=`pwd`
echo -n "Uaktualniam katalog /etc na dyskietce... "
mount /dev/fd0a /start_floppy
@@ -14,7 +14,7 @@ cd /etc
cp -Rp . /start_floppy/etc/
echo " Zrobione."
echo -n "Uaktualniam parametry j±dra..."
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd /etc
cd ${pwd}
diff --git a/release/picobsd/dial/mfs.tree/Makefile b/release/picobsd/dial/mfs.tree/Makefile
index 44f3b75de1b9..9c9ca2e361a0 100644
--- a/release/picobsd/dial/mfs.tree/Makefile
+++ b/release/picobsd/dial/mfs.tree/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.4 1998/09/22 15:41:05 abial Exp $
+# $Id: Makefile,v 1.3 1998/09/20 00:46:24 abial Exp $
#
DESTDIR?=/mnt
@@ -63,7 +63,6 @@ links: tree
devnodes: tree
(cd ${DESTDIR}/dev; \
/dev/MAKEDEV std sysmouse tun2 cuaa0 cuaa1 cuaa2 vty10 fd0 pty0; \
- /dev/MAKEDEV psm0; \
/dev/MAKEDEV wd0s1h wd0s2 wd0s3 wd0s4 wd1s1h wd1s2 wd1s3 wd1s4)
clean:
diff --git a/release/picobsd/doc/src/Makefile b/release/picobsd/doc/src/Makefile
index cbd065c8c21e..6478cbfdc518 100644
--- a/release/picobsd/doc/src/Makefile
+++ b/release/picobsd/doc/src/Makefile
@@ -1,17 +1,14 @@
#
-# $Id: Makefile,v 1.1 1998/09/26 17:23:01 abial Exp $
+# $Id$
#
.include "../../Version"
-DATE!="date"
-
DOCS= bugs.html faq.html hardware.html how2build.html \
- intrinsics.html intro.html TODO.html
+ intrinsics.html intro.html
all: ../../Version
- for i in ${DOCS}; \
+ for i in `ls *.html`; \
do \
- cat $${i}|sed -e 's/@VER@/${VER}/g' \
- -e 's/@DATE@/${DATE}/g' >../$${i}; \
+ cat $${i}|sed -e 's/@VER@/${VER}/g' >../$${i}; \
done
diff --git a/release/picobsd/doc/src/TODO.html b/release/picobsd/doc/src/TODO.html
deleted file mode 100644
index 8192f02a0cb2..000000000000
--- a/release/picobsd/doc/src/TODO.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<html>
-<! $Id: TODO.html,v 1.2 1998/12/22 21:40:56 abial Exp $ >
-<body>
-<h1><center> Small FreeBSD ToDo List.
-</center></h1>
-
-<p>This list represents various tasks which are being collected from
-discussions on freebsd-small, and which represent the general
-direction and needs of using FreeBSD for small installations.</p>
-
-<p>The tasks are arranged by how important they are to the overall
-idea and goals of the project. If you are interested in doing some
-part of the work, please contact the coordinator of PicoBSD project
-(<A HREF="mailto:abial@freebsd.org">Andrzej Bialecki</a>).</p>
-
-<hr>
-
-<h2>Short term tasks:</h2>
-
-<ul>
-<li>
-Eliminate need for patching FreeBSD source tree - either by
-keeping our own version of Makefiles, or by adding (many) knobs to
-the standard ones. (NOTE: this will be resolved in v. 0.44).
-</li>
-<li>
-Provide options for building separate kernel and FS images of
-various sizes.
-</li>
-<li>
-Add some "wizards" to help people new to Unix configure "dialup"
-and "net" for most common tasks.
-</li>
-<li>
-Replace most of currently used scripts with Makefiles.
-(NOTE: this will be resolved in v. 0.44).
-</li>
-<li>
-Add simple authentication module to oinit.
-</li>
-<li>
-Fix kzip to be able to produce kzip'ped ELF kernels.
-(NOTE: currently we work around it by using kzipped /boot/loader).
-</li>
-<li>
-Write better documentation. This is very important - the most
-common configurations should be described in detail, step by step.
-</li>
-<li>
-Collect our experiences with using FreeBSD with SBCs, flash disks
-etc, and write a short practical guide to embedding FreeBSD.
-</li>
-</ul>
-<hr>
-
-<h2>Medium term tasks:</h2>
-
-<ul>
-<li>
-Change the building process so that it allows to easily choose
-(with finer granularity) needed components of the target system.
-</li>
-<li>
-Make use of recently added KLD to allow for easy adding and
-removing drivers when running stripped kernels.
-</li>
-<li>
-Investigate pros and cons of using the new boot/loader together
-with ELF kernels.
-(NOTE for v.0.43: it was simply mandatory to use it :-)
-</li>
-<li>
-Change currently used crunched binaries to something more flexible
-- as it is now, even small change in set of programs requires
-rebuilding of the whole image.
-</li>
-<li>
-Provide options for building systems which operate from
-(basically) read-only media, such as CD-ROM or flash disk. Such
-system doesn't need to keep all root FS in memory, but only small
-fraction of it for /tmp and /var.
-</li>
-<li>
-Integrate DHCP into "dialup" version.
-</li>
-<li>
-Rework oinit to be more modular, and write additional modules
-(remote access, SNMP (?), authentication, shell(), configuration
-editor).
-</li>
-<li>
-Provide a remote access (telnetd/login/shell) module for the
-"router" version. Make the shell() module more predictable and
-compatible with common sense :-)
-</li>
-<li>
-At last prepare usable version of ISP floppy, and test it (some
-basic tests with server PPP). This involves among others a version
-of PPP which supports Radius.
-</li>
-</ul>
-
-<hr>
-
-<h2>Long term tasks:</h2>
-
-<ul>
-<li>
-Either port ROMfs from Linux, or write our own replacement for it.
-</li>
-<li>
-Describe the configuration tasks and parameters of PicoBSD systems
-in terms of hierarchy of categories - this is needed to start
-working on the next two points.
-</li>
-<li>
-Design a flexible and efficient scheme (not necessarily compatible
-with currently used set of shell scripts) for storing and editing
-system configuration in some form of hierarchical DB.
-</li>
-<li>
-Design a user interface for configuration of system parameters
-and services, meeting the following requirements: hierachical,
-logical, helpful (hinting), providing ability to automate certain
-tasks.
-</li>
-<li>
-Reduce memory footprint.
-</li>
-<li>
-Add other language versions.
-</li>
-<li>
-Throw some more effort in porting the newer version of W (graphical
-UI), so that it uses VESA color modes. IMHO it's worth it.
-</li>
-</ul>
-
-<hr>
-
-<h2>Other half-baked ideas...</h2>
-
-<p>(fill this in :-)</p>
-
-<hr>
-Last modified:
-@DATE@
-
-
-<p><i>Send your comments, ideas, and most importantly the code itself, to
-<A HREF="mailto:abial@freebsd.org">abial@freebsd.org</a>.</i></p>
-
-</body>
-</html>
diff --git a/release/picobsd/doc/src/UCI.html b/release/picobsd/doc/src/UCI.html
deleted file mode 100644
index ae74b8489f82..000000000000
--- a/release/picobsd/doc/src/UCI.html
+++ /dev/null
@@ -1,960 +0,0 @@
-<html>
-<! $Id: UCI.html,v 1.2 1998/11/25 11:08:54 abial Exp $ >
-<body>
-<h1><center> Unified Configuration Interface Project
-</center></h1>
-
-<p>The idea behind this project is to completely replace currently
-used configuration approach, which is based on several shell scripts, and to
-provide ability to change system behaviour basing on set of well-defined
-parameters' hierarchy. One of the goals is also to provide an object
-oriented model of the OS management and structure, instead of currently
-used (inconsistent) procedural model of system/service startup/shutdown.</p>
-
-<p>This project involves such issues as:
-<ul>
-<li>
-providing consistent view of the system and its functional subsystems as
-a set of interrelated objects equipped with certain properties.
-</li>
-<li>
-providing global approach to user interface, either command-line or with GUI
-front-ends.
-</li>
-<li>
-managing system resources and subsystems. This includes managing
-static and dynamic interdependencies between subsystems, ability to
-upgrade/downgrade specific subsystems on-the-fly.
-</li>
-</ul>
-</p>
-
-<p><i><b>This is work in progress</b> - I'm aware that many pieces
-are either completely missing or misplaced. Please send any comments and
-changes you seem appropriate either directly to me, or better to
-freebsd-small@freebsd.org. I'll gladly welcome anyone who can help with
-design and/or implementation.</i></p>
-
-
-<hr>
-
-<h1><center> Unified Configuration Interface
-</center></h1>
-
-<ul>
-<li>
-<p>Let's first introduce the following terms:
-<ul>
-<li>
-<b>management base</b> - the actual structure holding configuration and
-information data according to defined structure. This structure will most
-probably have a form of tree (possibly with cross-branch links or some other
-mechanism representing mutual dependencies) - the way it's stored is
-something which needs to be discussed.
-</li>
-<li>
-<b>user interface</b> - a method (and agent) for presenting data stored in
-management base in such a way that it can be viewed and modified by
-legitimate users.
-</li>
-<li>
-<b>system monitor</b> - an entity performing actual configuration and monitoring
-tasks, from one side dealing with management base, and from the other
-dealing with the system resources and subsystems, and from yet another dealing
-either directly with the user (thus acting as a user interface),
-or passing requests to other entity which acts as user interface.
-</li>
-<li>
-<b>subsystem</b> - a package containing programs, configuration data, as well
-as installing/deinstalling/start/stop stubs, which form together one logical
-entity performing specific services on behalf of the system. Each subsystem
-is viewed as an object with specific properties, dependencies, which is able
-to generate events, service general requests common to all such subsystems,
-and provide specific services to other subsystems.
-</li>
-</ul>
-</li>
-<li>
-<p>One possible approach to storing the management data is to use already
-existing framework known as MIB, as defined in applicable RFCs.</p>
-
-<p>This approach has several advantages: it represents well thought-out work
-of many experienced individuals and teams, it has already proven to be
-useful, it's widely used and accepted, it's easily extensible, it's able to
-represent quite complicated objects, etc.</p>
-
-<p>It has some drawbacks, as well: e.g. there is no standard mechanism for
-representing events and indirectly related objects, it tends to create
-deep and narrow trees which require to descent several levels to change some
-commonly used parameters, it doesn't say anything about the mutual
-dependencies between objects and parameters (except parent-child-sibling),
-and about required sequence to properly set their parameters, etc.</p>
-
-<p>These issues are not directly addressed in standards, and real
-implementations (known to me) have to implement these additional mechanisms
-"behind the scenes", so that their workings are not obvious nor easily
-accessible (let alone changeable).</p>
-
-<p>So, if we decide to use it, we need to address these issues somehow.
-The next point presents one possible approach to this dilemma.</p>
-</li>
-<li>
-<p>The term "object" used in the following discussion represents a functional
-subsystem, such as system service, usually performed by some specific
-process (or, a set of global system parameters, in which case the system
-monitor agent is the service itself). </p>
-
-<p>Each object represented in management base can be characterized by
-following properties:
-<ul>
-<li>
-its internal state, possibly consisting of several parameters and currently
-performed functions, but represented to the rest of the system as a symbolic
-state, one of set of states common to all objects.
-</li>
-<li>
-a temporary space for new sets of parameters, which are being supplied by
-other subsystems, prior to their actual application,
-</li>
-<li>
-FSM definition, describing state transitions in reaction to received events,
-</li>
-<li>
-list of events it can generate and accept,
-</li>
-<li>
-list of dependencies on other objects' states and services,
-</li>
-<li>
-list of requests it can handle,
-</li>
-<li>
-list of parameters it can accept and/or provide, with their valid ranges.
-</li>
-</ul>
-</p>
-
-<p>A few words on system startup: the system startup routines should ensure
-that dependencies can be unwound into linear, ordered list. If it's not
-possible, they should detect possible deadlocks at runtime, and act as an
-arbiter between conflicting parties (or signal an error). In case of
-unsatisfied dependency on some missing subsystem, the system monitor will
-act appropriately as described below (in paragraph on request handling).</p>
-
-<p>The <b>set of symbolic states</b> may consist of the following states,
-depicting object's current internal state (as described by its FSM):
-
-<center><table border>
-<tr><th>Name</th><th>Meaning</th></tr>
-<tr>
-<td>INIT</td><td>the subsystem is initializing itself, possibly loading
-necessary data and binaries from permanent storage.</td>
-</tr>
-<tr>
-<td>CHECK</td><td>performing consistency check on newly supplied parameter values</td>
-</tr>
-<tr>
-<td>READY</td><td>ready to start performing its primary function, but not started</td>
-</tr>
-<tr>
-<td>START</td><td>start-up tasks (related to its primary function, as opposed
-to INIT which is related to its own initialization)</td>
-</tr>
-<tr>
-<td>STOP</td><td>stop (shutdown) tasks (when the object intends to stop
-performing its function). This can involve unloading data and binaries from
-main memory.</td>
-</tr>
-<tr>
-<td>RUN</td><td>primary (work) phase</td>
-</tr>
-<tr>
-<td>IDLE</td><td>waiting for some external event to happen</td>
-</tr>
-<tr>
-<td>BUSY</td><td>the subsystem is busy (either with performing some
-high-priority task, or just simply hung), and cannot be interrupted without
-complete restart,</td>
-</tr>
-<tr>
-<td>ERROR</td><td>this object is either improperly configured, or
-malfunctioning</td>
-</tr>
-<tr>
-<td>(other...)</td><td>(other...)</td>
-</tr>
-</table></center>
-</p>
-
-<p>The <b>set of possible actions</b> may include the following actions:</p>
-
-<center><table border>
-<tr><th>Name</th><th>Meaning</th></tr>
-<tr>
-<td>LIST_EV_REQ</td><td>get list of events the subsystem can generate</td>
-</tr>
-<tr>
-<td>LIST_ACT_REQ</td><td>get list of actions the subsystem can respond to</td>
-</tr>
-<tr>
-<td>GET_DEF_REQ</td><td>get definition of given parameter (the arguments, and
-valid ranges)</td>
-</tr>
-<tr>
-<td>SET_REQ</td><td>set given parameter to given value (this value will
-be used only after COMMIT_REQ)</td>
-</tr>
-<tr>
-<td>GET_REQ</td><td>get currently used value of given parameter</td>
-</tr>
-<tr>
-<td>COMMIT_REQ</td><td>commit changes supplied in last transaction to currently
-used set of parameters</td>
-</tr>
-<tr>
-<td>ROLLBACK_REQ</td><td>revert last commit</td>
-</tr>
-<tr>
-<td>INIT_REQ</td><td>perform initialization tasks</td>
-</tr>
-<tr>
-<td>START_REQ</td><td>start performing primary function</td>
-</tr>
-<tr>
-<td>STOP_REQ</td><td>stop performing primary function</td>
-</tr>
-<tr>
-<td>RESTART_REQ</td><td>restart operation, possibly forcefully</td>
-</tr>
-<tr>
-<td>NOTIFY_REQ</td><td>notify me of any changes in your state</td>
-</tr>
-<tr>
-<td>CHECK_REQ</td><td>perform self-consistency check</td>
-</tr>
-<tr>
-<td>UPGRADE_REQ</td><td>upgrade the subsystem - this possibly involves
-downloading necessary pieces via network to permanent storage area. The
-upgrade process should be transactional, and should save the older version
-of the subsystem in case the DOWNGRADE_REQ should be issued.</td>
-</tr>
-<tr>
-<td>DOWNGRADE_REQ</td><td>downgrade the subsystem - restore the previous
-version of the subsystem from the copy on permanent storage.</td>
-</tr>
-<tr>
-<td>UNINSTALL_REQ</td><td>uninstall the subsystem completely - possibly
-freeing the space on permanent storage.</td>
-</tr>
-<tr>
-<td>(other...)</td><td>(other...)</td>
-</tr>
-</table></center>
-<p><i>(Each request includes source service identifier and credentials of
-the sender)</i></p>
-
-<p>The <b>set of events</b> which can be generated by subsystems may include
-the following:</p>
-
-<center><table border>
-<tr><th>Name</th><th>Meaning</th></tr>
-<tr>
-<td>EV_ACK</td><td>positive acknowledge of the last operation</td>
-</tr>
-<tr>
-<td>EV_NACK</td><td>negative acknowledge of the last operation</td>
-</tr>
-<tr>
-<td>EV_CHANGE</td><td>change notification (includes the name of changed
-parameter, and/or FSM state change)</td>
-</tr>
-<tr>
-<td>EV_DEP</td><td>signal the dependency on another subsystem - ask for
-existence of the service. Probably there should be two types of the dependency:
-a soft one (where the subsystem can still function even if the dependency is
-unresolved) and a hard one (when the existence and proper functioning of the
-other subsystem is mandatory for its function).</td>
-</tr>
-<tr>
-<td>(other...)</td><td>(other...)</td>
-</tr>
-</table></center>
-
-<p>One of event attributes can be a flag which says that this particular event
-is a directed, or broadcast message. In case of directed message, it should
-be forwarded only to interested parties. Broadcast message is sent to all
-subsystems.</p>
-
-<p>System monitor agent will process these events and route them to
-appropriate subsystems which are registered with it. Generally, if some
-subsystem is dependent on some other, it will want to also receive all events
-generated by the other subsystem.</p>
-
-<p>In case the subsystem
-is missing, and the system monitor received events signalling that some other
-subsystem is depending on it, the system monitor should arrange either for
-installing necessary pieces from some media (be it permanent storage, or the
-network), or to send an EV_NACK to the requesting subsystem. It's the
-responsibility of the requesting subsystem to deal with such case
-appropriately to the type of dependency (i.e. either "hard" or "soft").
-
-<p>Ideally, the system monitor agent will be equipped with routines to
-serialize the management data into human-readable form, so that it's easily
-stored, backed up, and repaired in case of inconsistencies.</p>
-</li>
-<li>
-<p>Actual user interface is still quite another story: I've seen UIs which
-merely followed the standard MIBs, and menus were composed of actual OID
-numbers plus DESCRIPTION field. In my experience, they are (barely)
-acceptable, though due to the usual width and depth of MIB trees you had to
-traverse several levels down and up in order to change some (protocol-wise)
-related parameters.</p>
-
-<p>More acceptable UI would collect interrelated items under common menu
-entries, irrespectibly of their actual position in the MIB tree.</p>
-
-<p>A worthwhile goal to pursue is to create such an UI which could guide
-you through the most common configuration tasks, while at the same time
-allowing for unrestricted and quick use by power users. This can be done
-either as a set of configuration "wizards" or extensive hinting, command
-completion, etc.</p>
-</li>
-<li>
-<p>The management database should be easily exportable via standard
-protocols, such as SNMP or LDAP.</p>
-
-<p>Most known to me (if not all) implementations of agents for these
-protocols are (contrary to their name) quite heavy-weight - so their use
-should be either optional, or replaced with some other light-weight
-protocol and a proxy agent running on other machine. One example of
-such proxy agent is existing UCD-SNMP implementation which in
-significant part follows the sysctl(3) tree, merely exporting it as
-a part of the MIB trees.</p>
-
-<p>It's worthwhile to consider also use of other protocols such as
-DHCP (and BOOTP), Service Location Protocol (SLP - RFC2165) for easy
-integration with LAN resources, easy initial configuration, and peer
-discovery.</p>
-</li>
-<li>
-<p>All operations performed by system monitor agent should be transactional,
-i.e. it should be possible to commit a set of changes as one logical entity,
-and be sure that either it's applied in whole, or not at all. This includes
-also ability to abort processing in the middle.</p>
-
-<p>This probably means that each object (subsystem) should be able to store
-not only its current configuration data, but also the newly supplied config
-data that are to be applied after the transaction ends successfuly.</p>
-
-<p>Operations should be verified against allowed values, as well as against
-allowed credentials, and basing on this either committed or aborted.</p>
-</li>
-<li>
-<p>A few notes on possible implementation of system monitor:</p>
-<ul>
-<li>
-let's assume that all configuration information is read on startup
-by some specialized daemon (this can be part of init(8) as well),
-which then performs role of communication agent through which passes
-all configuration information, be it request for change, request
-for info, request for start / shutdown, or notification about the change.
-</li>
-<li>
-configuration information itself is stored either in binary database, or as
-a filesystem hierachy mimicking configuration items hierarchy.
-</li>
-<li>
-each user-level program performing some task (such as routing daemon, inetd
-etc) is either equipped with the ability to communicate with config agent, or
-is relinked with special stub which fakes to the program necessary config
-files and events (such as signals to reread configuration).
-<p>This probably means also that some libc routines would have to be replaced,
-because they assume reading configuration from certain disk files.</p>
-
-<p>Since each such subsystem needs to implement some common actions such as
-installing, deinstalling, start/stop etc, we could use already present
-system of packages (with some minor modifications) to easily achieve
-part of the goals (i.e. install/deinstall/upgrade/downgrade/stop/start).</p>
-</li>
-<li>
-each subsystem performing some task requests its initial config data
-from system monitor, at the same time registering with it to receive
-configuration events, such as request to re-read data, to provide currently
-used config data, return status, react for signals, restarts, etc...
-</li>
-<li>
-system monitor acts as a meeting point for all producers and consumers
-of events and config data. It needs to maintain a table of registered
-subsystems, set of events they provide, set of events they want to receive,
-etc.. Basing on this table, it routes appropriate information to
-appropriate parties.
-</li>
-<li>
-user interface is then just one of clients of system monitor, albeit possessing
-special privileges.
-</li>
-<li>
-one of important tasks of system monitor, in case given
-object (subsystem) registers with it to be notified about certain events, is
-to ensure that such type of event can be possibly generated. This is to
-prevent subsystems from waiting for events coming from other non-existent
-subsystems. See the discussion above on satisfying dependencies.
-</li>
-</ul>
-<i><p>NOTE: this is one possible approach - a centralized one. It's worth to
-consider other approach, distributed, in which case each object (subsystem)
-sends and listens to the data at a meeting point specific to each other
-object. This eliminates (or drastically minimizes) the role of system
-monitor which is a single point of failure in centralized case.</p></i>
-</li>
-</ul>
-
-<hr>
-
-<p>Here is my initial proposal for the User Interface hierarchy:</p>
-
-<ul>
-<li>
-System configuration.
- <ol>
- <li>
- Boot device and file <br>
- <small>Name of the boot device (possibly networked) and boot
- image.</small>
- <ol>
- <li>
- (Enumeration of available devices)
- <ol>
- <li>
- (Enumeration of available files)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Config file <br>
- <small>Configuration file management - loading and saving, either
- local or remote (if applicable). </small>
- <ol>
- <li>
- Load / Save
- <ol>
- <li>
- Source / Destination <br>
- (Enumeration of available storage places, possibly
- networked)
- </li>
- </ol>
- </li>
- <li>
- Edit directly (geek mode)
- </li>
- </ol>
- </li>
- <li>
- Subsystems <br>
- <ol>
- <li>
- Module management <br>
- <small>Optional hardware drivers and protocol modules
- management.</small>
- <ol>
- <li>
- (Enumeration of available loadable modules)
- <ol>
- <li>
- Load / unload / status
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Package management<br>
- <small>Management of basic and optional system services.</small>
- <ol>
- <li>
- (Enumeration of locally available packages)
- <ol>
- <li>
- Start / Stop / Status / Configure
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Default source of service packages<br>
- <small>Where to automatically get the missing packages from.
- </small>
- <ol>
- <li>
- (Enumeration of available media) <br>
- (local and remote disks, ftp, http)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Resource management
- <ol>
- <li>
- Memory consumption <br>
- <small>This is entry point to a subtree, which allows to set
- up various resource limits for subsystems, services and
- processes.</small>
- </li>
- <li>
- Space consumption<br>
- <small>(Things like minimal free space on permanent storage..)
- </small>
- </li>
- <li>
- Task priorities
- <small>This includes not only currently running tasks, but all
- which can possibly be started.</small>
- <ol>
- <li>
- List / Modify
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- System console
- </li>
- <li>
- Virtual consoles (if applicable)
- </li>
- <li>
- System Date / Time Zone
- </li>
- <li>
- Banner
- </li>
- <li>
- Logging
- <ol>
- <li>
- Local logging
- </li>
- <li>
- Remote logging
- </li>
- </ol>
- </li>
- </ol>
-</li>
-<li>
-Network configuration.
- <ol>
- <li>
- Hostname and Domain
- </li>
- <li>
- Interfaces
- <ol>
- <li>
- (Enumeration of physical interfaces) <br>
- (Enumeration of virtual interfaces, if applicable) <br>
- (Options for creating virtual interfaces, if applicable)
- <ol>
- <li>
- Interface options (speed, media, encapsulation,
- description, etc.)
- </li>
- <li>
- ARP
- </li>
- <li>
- Bridging
- </li>
- <li>
- IP
- <ol>
- <li>
- Adress / netmask / alias
- </li>
- </ol>
- </li>
- <li>
- IPX
- </li>
- <li>
- AppleTalk
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Protocol Options
- <ol>
- <li>
- IP, UDP, TCP, ARP, IPX, ATM ... <br>
- (Enumeration of available protocols)
- <ol>
- <li>
- (Enumeration of protocol specific options, such as
- buffer sizes, algorithms, ARP tables etc)
- <ol>
- <li>
- List / Add / Delete / Modify / Set (where
- applicable)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Routes
- <ol>
- <li>
- List
- </li>
- <li>
- Static
- <ol>
- <li>
- Add / Delete / List
- <ol>
- <li>
- (route expression)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Dynamic
- <ol>
- <li>
- (Enumeration of available routing protocols)
- <ol>
- <li>
- Add / Delete / List
- <ol>
- <li>
- (route expression)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Network services
- <ol>
- <li>
- DNS
- <ol>
- <li>
- Hosts
- <ol>
- <li>
- Add / Delete / List
- <ol>
- <li>
- (hosts definitions)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Resolvers
- <ol>
- <li>
- Add / Delete / List
- <ol>
- <li>
- (hosts addresses)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- Local DNS server config
- </li>
- </ol>
- </li>
- <li>
- PPP
- <ol>
- <li>
- Server
- </li>
- <li>
- Client
- </li>
- </ol>
- </li>
- <li>
- NFS
- <ol>
- <li>
- Server
- </li>
- <li>
- Client
- </li>
- </ol>
- </li>
- <li>
- NIS
- </li>
- <li>
- DHCP
- <ol>
- <li>
- Add / Delete / Reserve / List
- <ol>
- <li>
- (IP address expressions)
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- SNMP
- <ol>
- <li>
- Protocol version
- </li>
- <li>
- Send traps to...
- </li>
- <li>
- Access Control Lists <br>
- <small>(This is either full-blown ACL system in case
- of SNMPv2, or a community string for SNMPv1.)</small>
- </li>
- </ol>
- </li>
- <li>
- Printing
- <ol>
- <li>
- Local / Remote
- <ol>
- <li>
- Printers
- <ol>
- <li>
- Add / Modify / Delete / List
- </li>
- </ol>
- </li>
- <li>
- Queues
- <ol>
- <li>
- Priority / Delete / List
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- SMB services
- </li>
- <li>
- Network Address Translation
- </li>
- <li>
- Packet filters
- </li>
- <li>
- Bandwidth Manager
- </li>
- <li>
- NTP
- </li>
- <li>
- Remote Access
- </li>
- </ol>
- </li>
- </ol>
-<li>
-User management.
- <ol>
- <li>
- User accounts
- <ol>
- <li>
- Add / Delete / Modify / List
- <ol>
- <li>
- Name / Password / ACL
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- User profiles
- <ol>
- <li>
- Access Control Lists.
- <ol>
- <li>
- Add / Delete / Modify / List
- <ol>
- <li>
- Name / Template / Definition
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- ACL Templates
- <ol>
- <li>
- Add / Delete / Modify / List
- <ol>
- <li>
- Name
- <ol>
- <li>
- Command restrictions list
- </li>
- <li>
- Location restrictions list
- </li>
- <li>
- Resources restrictions list
- </li>
- <li>
- Time restrictions list
- </li>
- <li>
- Authentication methods
- <ol>
- <li>
- Unix passwd
- </li>
- <li>
- S/Key
- </li>
- <li>
- Kerberos
- </li>
- <li>
- Radius
- </li>
- <li>
- TACACS
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
-</li>
-<li>
-Other services
- <ol>
- <li>
- Cron tasks
- </li>
- </ol>
-</li>
-<li>
-Filesystems.
- <ol>
- <li>
- Local / Remote
- <ol>
- <li>
- (Enumeration of available FS-s)
- <ol>
- <li>
- FS / Mounting point / Options
- </li>
- </ol>
- </li>
- <li>
- Swap Partition / Swap File
- <ol>
- <li>
- Create / Turn on
- </li>
- </ol>
- </ol>
- </li>
- </ol>
-</li>
-<li>
-Environment
- <ol>
- <li>
- Set / Unset / List
- </li>
- </ol>
-</li>
-<li>
-System status
- <ol>
- <li>
- (Enumeration of available status items)
- </li>
- </ol>
-</li>
-<li>
-Diagnostics
- <ol>
- <li>
- Debug
- <ol>
- <li>
- (Enumeration of subsystems hierarchy, those of which can
- provide debugging data)
- <ol>
- <li>
- Set / Clear / Level
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <li>
- System messages
- </li>
- <li>
- Ping / traceroute / rtquery
- </li>
- </ol>
-</li>
-</ul>
-
-<hr>
-<i>
-<p>Please send your comments to <A HREF="mailto:abial@freebsd.org">
-Andrzej Bialecki</a></p>
-<p>Last modified:
-@DATE@
-</p>
-</i>
-
-</body>
-</html>
diff --git a/release/picobsd/doc/src/bugs.html b/release/picobsd/doc/src/bugs.html
index 2eb29cee525d..c878d0096831 100644
--- a/release/picobsd/doc/src/bugs.html
+++ b/release/picobsd/doc/src/bugs.html
@@ -1,5 +1,5 @@
<HTML>
-<! $Id: bugs.html,v 1.6 1998/11/01 20:01:40 abial Exp $ >
+<! $Id: bugs.html,v 1.3 1998/10/12 07:52:34 abial Exp $ >
<HEAD>
<TITLE>History and Bug fixes</TITLE>
</HEAD>
@@ -14,25 +14,9 @@ the list before reporting a new one.</p>
<p>We tried to make this software bug-free, but life is life... Sorry for the
inconvenience.</p>
-<h3>PicoBSD 0.43</h3>
-<ul>
-<li>
- 1999.01.19: A lot of fixes related to architectural changes in
- 3.0-current code. Most importantly, we run now ELF kernel and we use
- the new bootloader. This is most probably the last release of PicoBSD in
- its present shape - the next version will (hopefully) become a part of
- normal release building process.
-</li>
-</ul>
-
<h3>PicoBSD 0.42</h3>
<ul>
<li>
- 1999.01.15: Well, it seems that this version was for developers
- only... ;-) It was abandoned when recent massive changes in -current
- demanded more serious measures...
-</li>
-<li>
1998.10.15: Small fixes and updates to match the 3.0-RELEASE
source tree. The binary snapshot built from 3.0-R sources will
soon follow...
@@ -134,12 +118,12 @@ the list before reporting a new one.</p>
</ul>
<h5>Last modified:
-@DATE@
+Mon Oct 12 00:51:45 PDT 1998
</h5>
<HR align="center" width="100%">
<CENTER><h5>Any comments? Send them to
-<A HREF="mailto:abial@freebsd.org">the author</A> </h5></CENTER>
+<A HREF="mailto:abial@nask.pl">the author</A> </h5></CENTER>
</BODY>
</HTML>
diff --git a/release/picobsd/doc/src/faq.html b/release/picobsd/doc/src/faq.html
index 1a86d587f67c..c45b56e78477 100644
--- a/release/picobsd/doc/src/faq.html
+++ b/release/picobsd/doc/src/faq.html
@@ -1,5 +1,5 @@
<HTML>
-<! $Id: faq.html,v 1.3 1998/10/28 16:16:31 abial Exp $ >
+<! $Id: faq.html,v 1.1 1998/09/26 17:23:01 abial Exp $ >
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Dinesh Nair">
@@ -39,7 +39,7 @@ fully grown daemons, and PicoBSD as a system infested with
<P>PicoBSD has versions based on FreeBSD 3.0-RELEASE, 3.0-current and
FreeBSD 2.2.5-RELEASE.
-<A HREF="mailto:abial@freebsd.org">Andrzej Bialecki</A> maintains the <A HREF="http://www.freebsd.org/~picobsd/picobsd.html">FreeBSD
+<A HREF="mailto:abial@nask.pl">Andrzej Bialecki</A> maintains the <A HREF="http://www.freebsd.org/~picobsd/picobsd.html">FreeBSD
3.0-RELEASE and -current versions</A> and
<A HREF="mailto:dinesh@alphaque.com">Dinesh Nair</A>
maintains the <A HREF="http://info.net-gw.com/picoBSD/">FreeBSD
@@ -101,7 +101,7 @@ maintained by Dinesh Nair</LI>
Additional mirror sites will be brought online as demand increases. If
you're interested in mirroring the PicoBSD distribution, please get in
touch with <A HREF="mailto:dinesh@alphaque.com">Dinesh Nair</A> or
-<A HREF="mailto:abial@freebsd.org">Andrzej Bialecki</A>.
+<A HREF="mailto:abial@nask.pl">Andrzej Bialecki</A>.
<P><B>How do I copy it to the floppy?</B></p>
@@ -241,7 +241,7 @@ Handbook</A> or the <A HREF="http://www.freebsd.org/">FreeBSD Home</A>.
PicoBSD user community comes in. And big thanks to all of you who already
sent us some suggestions!</FONT></CENTER>
<P><B><FONT SIZE=-1>Last Modified:
-@DATE@
+Thu Oct 15 23:31:28 CEST 1998
</FONT></B></P>
</BODY>
</HTML>
diff --git a/release/picobsd/doc/src/hardware.html b/release/picobsd/doc/src/hardware.html
index 2954695f6481..207508123e11 100644
--- a/release/picobsd/doc/src/hardware.html
+++ b/release/picobsd/doc/src/hardware.html
@@ -1,5 +1,5 @@
<html>
-<! $Id: hardware.html,v 1.1 1998/09/26 17:23:01 abial Exp $ >
+<! $Id: hardware.html,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $ >
<body>
<h1><center>Lists of supported hardware configurations.</center></h1>
@@ -103,10 +103,5 @@ you'll find it as a cheap yet reliable alternative to commercial communication
servers :-)) This work is still in progress, and
<A HREF="beta.html">I need some people to test</a> the early
dial-in server version.</p>
-
-<hr>
-<i>Last modified:
-@DATE@
-</i>
</body>
</html>
diff --git a/release/picobsd/doc/src/how2build.html b/release/picobsd/doc/src/how2build.html
index 7225603a5039..9a29f28bfcd1 100644
--- a/release/picobsd/doc/src/how2build.html
+++ b/release/picobsd/doc/src/how2build.html
@@ -1,5 +1,5 @@
<html>
-<! $Id: how2build.html,v 1.3 1998/10/28 16:16:31 abial Exp $ >
+<! $Id: how2build.html,v 1.1 1998/09/26 17:23:01 abial Exp $ >
<head>
<title><center>PicoBSD Development Kit</center></title>
</head>
@@ -184,10 +184,6 @@
<p>If, for some reason, the scripts don't work for you at all, also let me
know.</p>
-<hr>
-<i>Last modified:
-@DATE@
-
-<p><A HREF="mailto:abial@freebsd.org">&lt;abial@freebsd.org&gt;</a></i></p>
+<A HREF="mailto:abial@nask.pl">&lt;abial@nask.pl&gt;</a>
</body>
</html>
diff --git a/release/picobsd/doc/src/intrinsics.html b/release/picobsd/doc/src/intrinsics.html
index dc4ca55aba3c..cac4703cbcbe 100644
--- a/release/picobsd/doc/src/intrinsics.html
+++ b/release/picobsd/doc/src/intrinsics.html
@@ -1,5 +1,5 @@
<html>
-<! $Id: intrinsics.html,v 1.1 1998/09/26 17:23:01 abial Exp $ >
+<! $Id: intrinsics.html,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $ >
<head>
<title><center>Details of building process</center></title>
</head>
@@ -122,5 +122,5 @@ the build process:</p>
<h6>
Last modified:
-@DATE@
+Wed Aug 19 18:49:08 CEST 1998
</h6>
diff --git a/release/picobsd/doc/src/intro.html b/release/picobsd/doc/src/intro.html
index 0b69b6b7b663..c69622be2d9a 100644
--- a/release/picobsd/doc/src/intro.html
+++ b/release/picobsd/doc/src/intro.html
@@ -1,5 +1,5 @@
<HTML>
-<! $Id: intro.html,v 1.5 1998/11/01 19:52:47 abial Exp $ >
+<! $Id: intro.html,v 1.2 1998/09/26 17:39:21 abial Exp $ >
<HEAD>
<TITLE>PicoBSD</TITLE>
</HEAD>
@@ -9,6 +9,7 @@
<HR shade align="center" size="8" width="25%"></CENTER>
+<IMG SRC="../../icons/daemon.gif" ALIGN="right">
<p><b>Contents:</b></p>
<ul>
<li>
@@ -156,7 +157,7 @@ version 0.4 it's a part of official FreeBSD CVS and lives in
<code>src/release/picobsd</code>. I also create the snapshots of this source
tree - keep in mind that they are not so up-to-date as the tree
in FreeBSD CVS. You can get the snapshot I made on
-Sun Nov 1 11:48:32 PST 1998
+Mon Oct 12 00:53:02 PDT 1998
<A HREF="http://www.freebsd.org/~picobsd/picobsd/picobsd.tgz">here</a>.</p>
<p> Now, if you don't like the setup of PicoBSD, or you miss
@@ -215,15 +216,14 @@ imagination and coding skills:</p>
<ul>
<li>
To write a command line tool patterned after Cisco IOS, which could configure
-various aspects of router-like version of PicoBSD.
-<p>Well, currently you can read very preliminary draft of proposed
-architecture, called the <A HREF="UCI.html">Unified Configuration Interface.</a></p>
+various aspects of router-like version of PicoBSD. I'm nowhere near with this
+goal - I even don't have any good idea how to do it cleanly (I do have some
+ideas, but I classify them as dirty hacks).
</li>
<li>
To put an XWindow-like GUI on the 'dialup' floppy. (Update: you can look at
<A HREF="http://www.freebsd.org/~picobsd/preview/preview2.tgz">preview
-version</a> and send me your comments. <b>I need some help in porting newer
-version of W</b>).
+version</a> and send me your comments).
</li>
<li>
To gain some experience with solid state disks, and prepare standard images
@@ -247,23 +247,23 @@ to be able to run truely effortlessly on 4MB machines... This would
probably include rewriting oinit(8) to run multithreaded.
</li>
<li>
-And many others... You can find a complete list
-<A HREF="TODO.html">here</a>.
+And many others, too vague to put them here. <b>You</b> can also suggest me
+some others applications/solutions you're dreaming of...
</li>
</ul>
<A NAME="credits"><h3>Credits</h3>
<p>The following people are either responsible for the very existence of this
-project, or significantly eased my pains in gaining necessary knowledge:</p>
+project, or significantly eased my pains of gaining necessary knowledge:</p>
<ul>
<li>
the whole FreeBSD team for this magnificent OS, and their hard work of
continuous development,
</li>
<li>
-Dinesh Nair, for co-development and preparing of the version which compiled
-on 2.2.5-RELEASE,
+Dinesh Nair, for co-development and preparing of the version which compiles
+on -RELEASE,
</li>
<li>
Joe Greco, for his encouraging example of XKERNEL (some parts of the scripts
@@ -292,15 +292,15 @@ guys!
which allows you to use it in various ways, including commercial
applications. So grab it and enjoy! And if you feel that you want to help
with this project, either by donating some time to write code, or by
-some other donation, just <A HREF="mailto:abial@freebsd.org">contact me</a>.</p>
+some other donation, just <A HREF="mailto:abial@nask.pl">contact me</a>.</p>
<h5>Last modified:
-@DATE@
+Fri Sep 4 01:17:44 PDT 1998
</h5>
<HR shade align="left" size="2" width="100%">
<CENTER><h5>Any comments? Send them to
-<A HREF="mailto:abial@freebsd.org">the author</A> </h5></CENTER>
+<A HREF="mailto:abial@nask.pl">the author</A> </h5></CENTER>
</BODY>
</HTML>
diff --git a/release/picobsd/help/dmesg.hlp.en b/release/picobsd/help/dmesg.hlp.en
deleted file mode 100644
index b55e690b2b5b..000000000000
--- a/release/picobsd/help/dmesg.hlp.en
+++ /dev/null
@@ -1,5 +0,0 @@
-dmesg display kernel message buffer contents
-
- Usage:
-
- dmesg | more
diff --git a/release/picobsd/help/dmesg.hlp.pl b/release/picobsd/help/dmesg.hlp.pl
deleted file mode 100644
index 544c6ca49da3..000000000000
--- a/release/picobsd/help/dmesg.hlp.pl
+++ /dev/null
@@ -1,5 +0,0 @@
-dmesg wy¶wietl zawarto¶æ bufora komunikatów
-
- Sposób u¿ycia:
-
- dmesg | more
diff --git a/release/picobsd/help/help.hlp.en b/release/picobsd/help/help.hlp.en
index b38db3d6c552..dc35a4154edd 100644
--- a/release/picobsd/help/help.hlp.en
+++ b/release/picobsd/help/help.hlp.en
@@ -3,5 +3,5 @@
This command displays short description of the commands included
on PicoBSD floppy. When invoked with no argument, it displays this
text :-). Any other argument is treated as a name of file located in
- /help.a archive on the floppy, and this file is displayed page by
+ /help directory on the floppy, and this file is displayed page by
page.
diff --git a/release/picobsd/help/help.hlp.pl b/release/picobsd/help/help.hlp.pl
index 47e039d0c847..fa219d50185c 100644
--- a/release/picobsd/help/help.hlp.pl
+++ b/release/picobsd/help/help.hlp.pl
@@ -3,5 +3,5 @@
To polecenie wyswietla krotka instrukcje obslugi programow na
dyskietce. Uruchomione bez zadnego argumentu, wyswietla ten tekst. :-)
Kazdy inny argument traktowany jest jak nazwa pliku znajdujacego sie
- w archiwum /help.a, po czym zostaje wyswietlona zawartosc tego pliku
+ w katalogu /help, po czym zostaje wyswietlona zawartosc tego pliku
strona po stronie.
diff --git a/release/picobsd/help/vm.hlp.en b/release/picobsd/help/vm.hlp.en
index 6a391c1b1956..c707ca5cd9a3 100644
--- a/release/picobsd/help/vm.hlp.en
+++ b/release/picobsd/help/vm.hlp.en
@@ -3,8 +3,8 @@
This program repeatedly displays current memory usage, showing the
following numbers:
- * procs: number of processes; r - running, w - waiting for I/O,
- l - sleeping, s - swapping
+ * procs: number of processes; r - running, d - waiting for I/O,
+ p - paging, s - sleeping,
* virt mem: virtual memory amounts (total and active), in kB
* real mem: real memory amounts (total and active), in kB
* shared vm: amount of shared virtual memory (total and active), in kB
diff --git a/release/picobsd/help/vm.hlp.pl b/release/picobsd/help/vm.hlp.pl
index 00b8509a92d3..b95d838ea02b 100644
--- a/release/picobsd/help/vm.hlp.pl
+++ b/release/picobsd/help/vm.hlp.pl
@@ -4,9 +4,9 @@
wyswietlajac nastepujace wartosci:
* procs: liczba procesow: r - running (dzialajace),
- w - czekajace na I/O,
- l - sleeping,
- s - swapping,
+ d - czekajace na I/O,
+ p - paging,
+ s - sleeping,
* virt mem: ilosc pamieci witrualnej (total i active), w kB
* real mem: ilosc pamieci rzeczywistej (total i active) w kB
* shared vm: ilosc dzielonej pamieci wirtualnej, w kB
diff --git a/release/picobsd/isp/conf/Makefile b/release/picobsd/isp/conf/Makefile
index af4b903f642e..52a6b75c6e3b 100644
--- a/release/picobsd/isp/conf/Makefile
+++ b/release/picobsd/isp/conf/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 1998/10/15 21:40:01 abial Exp $
+# $Id: Makefile,v 1.2 1998/09/29 12:12:47 abial Exp $
#
SRC?=/usr/src
@@ -17,5 +17,5 @@ $(KERNFILE): PICOBSD
(cd ${CONF}; \
config ${CONFFILE}; \
cd ${COMPILE}; \
- make depend all)
+ make depend && make)
diff --git a/release/picobsd/isp/conf/PICOBSD b/release/picobsd/isp/conf/PICOBSD
index 9f9c5dc12adc..e1994e4e5522 100644
--- a/release/picobsd/isp/conf/PICOBSD
+++ b/release/picobsd/isp/conf/PICOBSD
@@ -1,5 +1,5 @@
#
-# $Id: PICOBSD,v 1.7 1999/01/14 23:20:09 abial Exp $
+# $Id: PICOBSD,v 1.3 1998/09/19 21:44:57 abial Exp $
#
machine "i386"
@@ -13,7 +13,6 @@ maxusers 20
options MATH_EMULATE #Support for x87 emulation
options INET #InterNETworking
options FFS #Berkeley Fast Filesystem
-options FFS_ROOT
options NFS #Network Filesystem
#options BOOTP
options MFS
@@ -22,7 +21,7 @@ options "CD9660" #ISO 9660 Filesystem
options PROCFS #Process filesystem
options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
options USERCONFIG #boot -c editor
-options INTRO_USERCONFIG #imply -c and parse info area
+options USERCONFIG_BOOT #imply -c and parse info area
options VISUAL_USERCONFIG #visual boot -c editor
options IPFIREWALL
options IPFIREWALL_DEFAULT_TO_ACCEPT
@@ -39,16 +38,16 @@ config kernel root on fd0a
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
#disk fd1 at fdc0 drive 1
options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
@@ -57,40 +56,36 @@ options ATAPI_STATIC #Don't do it as an LKM
device wcd0 #IDE CD-ROM
# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device vga0 at isa? port ? conflicts
-device sc0 at isa? tty
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
-device npx0 at isa? port IO_NPX irq 13
-
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
-device sio1 at isa? port "IO_COM2" tty irq 3
-device sio2 at isa? port "IO_COM3" tty irq 5
-device sio3 at isa? port "IO_COM4" tty irq 9
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? port "IO_COM4" tty irq 9 vector siointr
# Support for multiport serial cards
-options COM_MULTIPORT
+options "COM_MULTIPORT"
# AST
device sio4 at isa? port 0x2a0 tty flags 0x701
device sio5 at isa? port 0x2a8 tty flags 0x701
device sio6 at isa? port 0x2b0 tty flags 0x701
-device sio7 at isa? port 0x2b8 tty flags 0x701 irq 12
+device sio7 at isa? port 0x2b8 tty flags 0x701 irq 12 vector siointr
# Boca Board. You must configure the ports above with -c to change the flags.
device sio8 at isa? port 0x120 tty flags 0xb05
device sio9 at isa? port 0x128 tty flags 0xb05
device sio10 at isa? port 0x130 tty flags 0xb05
-device sio11 at isa? port 0x138 tty flags 0xb05 irq 12
+device sio11 at isa? port 0x138 tty flags 0xb05 irq 12 vector siointr
# Hayes ESP boards
-options COM_ESP
+options "COM_ESP"
# Comtrol Rocketport
# The PCI versions
@@ -101,24 +96,30 @@ device rp0 at isa? port 0x100 tty
device rp1 at isa? port 0x180 tty
# Cyclades Cyclom-Y serial driver
-device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
-device cy1 at isa? tty irq 11 iomem 0xd6000 iosiz 0x2000
+device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000 vector cyintr
+device cy1 at isa? tty irq 11 iomem 0xd6000 iosiz 0x2000 vector cyintr
-device lpt0 at isa? port? tty irq 7
+device lpt0 at isa? port? tty irq 7 vector lptintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
device de0
+device de1
device fxp0
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device ed1 at isa? port 0x300 net irq 5 iomem 0xd0000
-device ep0 at isa? port 0x300 net irq 10
-device ep1 at isa? port 0x280 net irq 5
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x300 net irq 10 drq 0
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ed1 at isa? port 0x300 net irq 5 iomem 0xd0000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ep1 at isa? port 0x280 net irq 5 vector epintr
+#device ex0 at isa? port? net irq? vector exintr
+#device fe0 at isa? port 0x300 net irq ? vector feintr
+#device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+#device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
pseudo-device loop
pseudo-device ether
diff --git a/release/picobsd/isp/crunch1/Makefile b/release/picobsd/isp/crunch1/Makefile
index eeb626fad359..a5c69e8af06d 100644
--- a/release/picobsd/isp/crunch1/Makefile
+++ b/release/picobsd/isp/crunch1/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.3 1998/10/15 21:40:01 abial Exp $
+# $Id: Makefile,v 1.2 1998/08/28 08:57:16 abial Exp $
#
SRC?=/usr/src
@@ -7,17 +7,21 @@ all: crunch
crunch:
@if [ ! -f .patched ]; then \
+ cat login.diff|(cd /usr/src/usr.bin/login; patch -p0); \
cat passwd.diff|(cd /usr/src/usr.bin/passwd; patch -p0); \
+ cat ppp.diff|(cd /usr/src/usr.sbin/ppp; patch -p0); \
touch .patched; \
fi
@cat crunch.conf|sed -e "s@/usr/src@${SRC}@" >crunch1.conf
@crunchgen ./crunch1.conf
- @${MAKE} -f crunch1.mk -DNOPAM all \
+ @${MAKE} -f crunch1.mk all \
"CFLAGS=${CFLAGS} -DCRUNCHED_BINARY -DNOSECURE -DNOCRYPT" #2>&1 >/dev/null
clean:
@if [ -f .patched ]; then \
+ cat login.diff|(cd /usr/src/usr.bin/login; patch -R -p0); \
cat passwd.diff|(cd /usr/src/usr.bin/passwd; patch -R -p0); \
+ cat ppp.diff|(cd /usr/src/usr.sbin/ppp; patch -R -p0); \
rm .patched; \
fi
rm -f *.o *.stub *.lo *_stub.c *.mk \
@@ -38,8 +42,8 @@ install:
done
rm /mnt/stand/crunch
# Install the MIB files
- #mkdir -p /mnt/usr/local/share/snmp/mibs
- #cp ../../net/crunch1/mibs/*.txt /mnt/usr/local/share/snmp/mibs/
+ mkdir -p /mnt/usr/local/share/snmp/mibs
+ cp ../../net/crunch1/mibs/*.txt /mnt/usr/local/share/snmp/mibs/
.include <bsd.prog.mk>
diff --git a/release/picobsd/isp/crunch1/crunch.conf b/release/picobsd/isp/crunch1/crunch.conf
index 2c8e1035d1b8..7418d0b5d23a 100644
--- a/release/picobsd/isp/crunch1/crunch.conf
+++ b/release/picobsd/isp/crunch1/crunch.conf
@@ -1,5 +1,5 @@
#
-# $Id: crunch.conf,v 1.4 1998/09/15 11:12:18 abial Exp $
+# $Id: crunch.conf,v 1.3 1998/09/15 07:35:31 abial Exp $
#
# NOTE: the string "/usr/src" will be automatically replaced with the
# correct value set in 'build' script - you should change it there
@@ -16,7 +16,7 @@ srcdirs ../../tinyware
# OBJS=${MIBOBJS} ${AGENTOBJS}
# * we install a special version of MIB files - stripped of comments and
# descriptions. These MIBs are included here to save you the stripping.
-#srcdirs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5
+srcdirs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5
# other sources
srcdirs /usr/src/bin
srcdirs /usr/src/sbin/i386
@@ -27,13 +27,12 @@ srcdirs /usr/src/usr.sbin
srcdirs /usr/src/libexec
progs ash test echo hostname ln login getty
-progs inetd telnetd stty w msg kget natd
+progs inetd telnetd stty w msg kget snmpd natd
progs init fsck ifconfig df ps ns vm cat
progs cp rm mkdir ls chmod chown
progs sysctl route swapon pwd_mkdb dev_mkdb
progs mount mount_msdos umount comcontrol
progs kill mount_std natd
-#progs snmpd
progs pwd pppd telnet more
progs passwd date
@@ -55,7 +54,7 @@ ln msg dmesg
ln ns netstat
# For snmpd
-#libs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5/snmplib/libsnmp.a
+libs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5/snmplib/libsnmp.a
libs -ledit -lutil -lmd -lcrypt -lmp -lgmp -lm -lkvm
libs -lmytinfo -lipx -lz -lpcap -lalias
libs -ltermcap -lgnuregex -ltelnet -lcurses
diff --git a/release/picobsd/isp/floppy.tree/etc/hosts b/release/picobsd/isp/floppy.tree/etc/hosts
new file mode 100644
index 000000000000..5b9108cabc1d
--- /dev/null
+++ b/release/picobsd/isp/floppy.tree/etc/hosts
@@ -0,0 +1,5 @@
+# $Id: hosts.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# This file should contain the addresses and aliases
+# for local hosts that share this file.
+127.0.0.1 localhost localhost.mydomain.org.pl
+127.0.0.1 pico.mydomain.org.pl
diff --git a/release/picobsd/isp/floppy.tree/etc/login.conf b/release/picobsd/isp/floppy.tree/etc/login.conf
index 9361a33c2f9e..3bfdd8ae6fa9 100644
--- a/release/picobsd/isp/floppy.tree/etc/login.conf
+++ b/release/picobsd/isp/floppy.tree/etc/login.conf
@@ -1,7 +1,7 @@
# This file controls resource limits, accounting limits and
# default user environment settings.
#
-# $Id: login.conf,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: login.conf,v 1.1.1.1 1998/07/14 07:30:45 abial Exp $
#
@@ -45,7 +45,7 @@ standard:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
:path=~/bin /bin /usr/bin:\
- :nologin=/var/run/nologin:\
+ :nologin=/etc/nologin:\
:cputime=1h30m:\
:datasize=8M:\
:stacksize=2M:\
diff --git a/release/picobsd/isp/floppy.tree/etc/motd b/release/picobsd/isp/floppy.tree/etc/motd
new file mode 100644
index 000000000000..8efbc7f97a5a
--- /dev/null
+++ b/release/picobsd/isp/floppy.tree/etc/motd
@@ -0,0 +1,12 @@
+=======================================================
+ )\_)\
+PicoBSD 0.42 (ISP-alpha) (o,o)
+ __ \~/
+Witamy w PicoBSD! -->====\
+ ~~ d d
+W glownym katalogu w pliku README znajdziesz pico
+krotki opis systemu. Mozesz go obejrzec przy pomocy
+"more /README".
+
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
+
diff --git a/release/picobsd/isp/floppy.tree/etc/rc b/release/picobsd/isp/floppy.tree/etc/rc
new file mode 100644
index 000000000000..bcb8c2bd02fe
--- /dev/null
+++ b/release/picobsd/isp/floppy.tree/etc/rc
@@ -0,0 +1,62 @@
+#!/bin/sh
+# $Id: rc.pl,v 1.2 1998/09/26 17:27:22 abial Exp $
+############################################
+### Special setup for one floppy PICOBSD ###
+### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
+############################################
+mount -a -t nonfs
+if [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+rm -f /var/run/*
+if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
+ echo "Dodaje $swapfile jako dodatkowy swap."
+ vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
+fi
+# configure serial devices
+if [ -f /etc/rc.serial ]; then
+ . /etc/rc.serial
+fi
+# start up the initial network configuration.
+if [ -f /etc/rc.network ]; then
+ . /etc/rc.network
+ network_pass1
+fi
+mount -a -t nfs
+# clean up left-over files
+(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
+if [ -n "$network_pass1_done" ]; then
+ network_pass2
+fi
+if [ -n "$network_pass2_done" ]; then
+ network_pass3
+fi
+if [ "X${inetd_enable}" = X"YES" ]; then
+ echo "Uruchamiam inetd."; inetd ${inetd_flags}
+fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Uruchamiam snmpd."; snmpd ${snmpd_flags}
+fi
+
+dev_mkdb
+
+echo ''
+if [ "x$swapfile" = "xNO" ]; then
+ echo "UWAGA: brak swapu!"
+ echo "Nie uruchamiaj zbyt wielu programow na raz..."
+fi
+echo ''
+echo ''
+echo '+------------ PicoBSD 0.42 (ISP) --------------+'
+echo '| |'
+echo '| Zaloguj sie jako "root" (haslo "setup"). |'
+echo '| |'
+echo '| Ta wersja PicoBSD w pelni podlega |'
+echo '| licencji BSD. Po wiecej szczegolow zajrzyj |'
+echo '| na http://www.freebsd.org/~picobsd, lub |'
+echo '| skontaktuj sie z autorem. |'
+echo '| |'
+echo '| abial@nask.pl |'
+echo '| |'
+echo '+----------------------------------------------+'
+exit 0
diff --git a/release/picobsd/isp/floppy.tree/etc/rc.conf b/release/picobsd/isp/floppy.tree/etc/rc.conf
new file mode 100644
index 000000000000..aa1ae8c92765
--- /dev/null
+++ b/release/picobsd/isp/floppy.tree/etc/rc.conf
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $Id: rc.conf.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+swapfile="NO" # Set to name of swapfile if aux swapfile desired.
+### Network configuration sub-section ######################
+### Basic network options: ###
+hostname="pico.mydomain.org.pl" # Set this!
+firewall="NO" # firewall type (see /etc/rc.firewall) or NO
+tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO).
+network_interfaces="lo0" # List of network interfaces (lo0 is loopback).
+ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
+#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
+### Network daemons options: ###
+inetd_enable="YES" # Run the network daemon dispatcher (or NO)
+inetd_flags="" # Optional flags to inetd
+snmpd_enable="YES" # Run the SNMP daemon (or NO)
+snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd
+### Network routing options: ###
+defaultrouter="NO" # Set to default gateway (or NO).
+static_routes="" # Set to static route list (or leave empty).
+gateway_enable="NO" # Set to YES if this host will be a gateway.
+arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL.
+### Allow local configuration override at the very end here ##
+if [ -f /etc/rc.conf.local ]; then
+ . /etc/rc.conf.local
+fi
diff --git a/release/picobsd/isp/floppy.tree/etc/resolv.conf b/release/picobsd/isp/floppy.tree/etc/resolv.conf
new file mode 100644
index 000000000000..4a006565d54a
--- /dev/null
+++ b/release/picobsd/isp/floppy.tree/etc/resolv.conf
@@ -0,0 +1,3 @@
+# $Id: resolv.conf.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+domain mydomain.org.pl
+nameserver 148.81.16.51
diff --git a/release/picobsd/isp/floppy.tree/etc/services b/release/picobsd/isp/floppy.tree/etc/services
index eec499fafec7..817b6d315272 100644
--- a/release/picobsd/isp/floppy.tree/etc/services
+++ b/release/picobsd/isp/floppy.tree/etc/services
@@ -91,4 +91,3 @@ uucp 540/tcp
uucp 540/udp
uucp-rlogin 541/tcp
uucp-rlogin 541/udp
-natd 8668/divert # Network Address Translation
diff --git a/release/picobsd/isp/lang/README.en b/release/picobsd/isp/lang/README.en
index d1dc2dc05725..18e0cbf5b98c 100644
--- a/release/picobsd/isp/lang/README.en
+++ b/release/picobsd/isp/lang/README.en
@@ -30,4 +30,4 @@ I'll be glad hearing from you about your experiences with PicoBSD. Thanks.
Have fun!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/isp/lang/README.pl b/release/picobsd/isp/lang/README.pl
index a680e20c3f4a..18ea380788d4 100644
--- a/release/picobsd/isp/lang/README.pl
+++ b/release/picobsd/isp/lang/README.pl
@@ -30,4 +30,4 @@ Jakie sa minimalne wymagania?
Milej zabawy!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/isp/lang/m.en b/release/picobsd/isp/lang/m.en
new file mode 100644
index 000000000000..077a3b596caf
--- /dev/null
+++ b/release/picobsd/isp/lang/m.en
@@ -0,0 +1,11 @@
+
+PicoBSD 0.32 (ISP-alpha)
+
+Welcome to PicoBSD!
+
+You can find a short description of the
+system in file /README. You can view it using
+"more /README".
+
+For more info contact the author (abial@nask.pl).
+
diff --git a/release/picobsd/isp/lang/m.pl b/release/picobsd/isp/lang/m.pl
new file mode 100644
index 000000000000..8870e1e51dd9
--- /dev/null
+++ b/release/picobsd/isp/lang/m.pl
@@ -0,0 +1,11 @@
+
+PicoBSD 0.32 (ISP-alpha)
+
+Witamy w PicoBSD!
+
+W glownym katalogu w pliku README znajdziesz
+krotki opis systemu. Mozesz go obejrzec przy pomocy
+"more /README".
+
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
+
diff --git a/release/picobsd/isp/lang/motd.en b/release/picobsd/isp/lang/motd.en
index 77a1949f998e..4acae898e74a 100644
--- a/release/picobsd/isp/lang/motd.en
+++ b/release/picobsd/isp/lang/motd.en
@@ -8,5 +8,5 @@ You can find a short description of the pico
system in file /README. You can view it using
"more /README".
-For more info contact the author (abial@freebsd.org).
+For more info contact the author (abial@nask.pl).
diff --git a/release/picobsd/isp/lang/motd.pl b/release/picobsd/isp/lang/motd.pl
index 1ceed3813fb2..8ee14d36dbcb 100644
--- a/release/picobsd/isp/lang/motd.pl
+++ b/release/picobsd/isp/lang/motd.pl
@@ -8,5 +8,5 @@ W glownym katalogu w pliku README znajdziesz pico
krotki opis systemu. Mozesz go obejrzec przy pomocy
"more /README".
-Wiecej informacji znajdziesz u autora (abial@freebsd.org).
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
diff --git a/release/picobsd/isp/lang/rc.en b/release/picobsd/isp/lang/rc.en
index ad135e31ab19..e49427ba4205 100644
--- a/release/picobsd/isp/lang/rc.en
+++ b/release/picobsd/isp/lang/rc.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.en,v 1.4 1999/01/12 14:09:20 asami Exp $
+# $Id: rc.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
@@ -25,6 +25,7 @@ fi
mount -a -t nfs
chmod 666 /dev/tty[pqrsPQRS]*
# clean up left-over files
+rm -f /etc/nologin
(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
if [ -n "$network_pass1_done" ]; then
network_pass2
@@ -35,6 +36,9 @@ fi
if [ "X${inetd_enable}" = X"YES" ]; then
echo "Starting inetd."; inetd ${inetd_flags}
fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Starting snmpd."; snmpd ${snmpd_flags}
+fi
dev_mkdb
@@ -54,7 +58,7 @@ echo '| BSD license. For more details see |'
echo '| http://www.freebsd.org/~picobsd, or contact |'
echo '| the author. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/isp/lang/rc.pl b/release/picobsd/isp/lang/rc.pl
index 38e0e3156e1d..33e896b49c64 100644
--- a/release/picobsd/isp/lang/rc.pl
+++ b/release/picobsd/isp/lang/rc.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.pl,v 1.3 1998/11/01 20:19:19 abial Exp $
+# $Id: rc.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
@@ -34,6 +34,9 @@ fi
if [ "X${inetd_enable}" = X"YES" ]; then
echo "Uruchamiam inetd."; inetd ${inetd_flags}
fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Uruchamiam snmpd."; snmpd ${snmpd_flags}
+fi
dev_mkdb
@@ -53,7 +56,7 @@ echo '| licencji BSD. Po wiecej szczegolow zajrzyj |'
echo '| na http://www.freebsd.org/~picobsd, lub |'
echo '| skontaktuj sie z autorem. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/isp/lang/update.en b/release/picobsd/isp/lang/update.en
index a821d4c9df56..acbd0dea8ca7 100755
--- a/release/picobsd/isp/lang/update.en
+++ b/release/picobsd/isp/lang/update.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.en,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: update.en,v 1.3 1998/08/10 19:16:43 abial Exp $
pwd=`pwd`
echo -n "Updating /etc contents on startup floppy... "
mount /dev/fd0a /start_floppy
@@ -17,7 +17,7 @@ cp -Rp . /start_floppy/etc/
pwd_mkdb master.passwd
echo " Done."
echo -n "Updating kernel parameters... "
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd ${pwd}
echo " Done."
diff --git a/release/picobsd/isp/lang/update.pl b/release/picobsd/isp/lang/update.pl
index 1b2c52358c91..3a95e0002bf9 100755
--- a/release/picobsd/isp/lang/update.pl
+++ b/release/picobsd/isp/lang/update.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.pl,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $
+# $Id: update.pl,v 1.3 1998/08/10 19:16:43 abial Exp $
pwd=`pwd`
echo -n "Uaktualniam katalog /etc na dyskietce... "
mount /dev/fd0a /start_floppy
@@ -17,7 +17,7 @@ cp -Rp . /start_floppy/etc/
pwd_mkdb master.passwd
echo " Zrobione."
echo -n "Uaktualniam parametry jadra..."
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd ${pwd}
echo " Zrobione."
diff --git a/release/picobsd/net/conf/Makefile b/release/picobsd/net/conf/Makefile
index 06f74873e7a8..52a6b75c6e3b 100644
--- a/release/picobsd/net/conf/Makefile
+++ b/release/picobsd/net/conf/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 1998/10/15 21:40:02 abial Exp $
+# $Id: Makefile,v 1.2 1998/09/29 12:12:47 abial Exp $
#
SRC?=/usr/src
@@ -17,5 +17,5 @@ $(KERNFILE): PICOBSD
(cd ${CONF}; \
config ${CONFFILE}; \
cd ${COMPILE}; \
- make depend all)
+ make depend && make)
diff --git a/release/picobsd/net/conf/PICOBSD b/release/picobsd/net/conf/PICOBSD
index 89cf63b10632..24ebe4e08356 100644
--- a/release/picobsd/net/conf/PICOBSD
+++ b/release/picobsd/net/conf/PICOBSD
@@ -1,5 +1,5 @@
#
-# $Id: PICOBSD,v 1.7 1999/01/18 10:17:33 abial Exp $
+# $Id: PICOBSD,v 1.2 1998/09/02 14:16:03 abial Exp $
#
machine "i386"
@@ -13,14 +13,14 @@ maxusers 10
options MATH_EMULATE #Support for x87 emulation
options INET #InterNETworking
options FFS #Berkeley Fast Filesystem
-options FFS_ROOT
options NFS #Network Filesystem
options MFS
options MSDOSFS #MSDOS Filesystem
options "CD9660" #ISO 9660 Filesystem
+options PROCFS #Process filesystem
options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
options USERCONFIG #boot -c editor
-options INTRO_USERCONFIG #imply -c and parse info area
+options USERCONFIG_BOOT #imply -c and parse info area
options VISUAL_USERCONFIG #visual boot -c editor
options IPFIREWALL
options IPFIREWALL_DEFAULT_TO_ACCEPT
@@ -32,21 +32,21 @@ options NO_LKM
#options DUMMYNET
#options BRIDGE
-config kernel root on fd0a
+config kernel root on fd0
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
#disk fd1 at fdc0 drive 1
options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
@@ -55,34 +55,39 @@ options ATAPI_STATIC #Don't do it as an LKM
device wcd0 #IDE CD-ROM
# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device vga0 at isa? port ? conflicts
-device sc0 at isa? tty
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
-device npx0 at isa? port IO_NPX irq 13
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
-device sio1 at isa? port "IO_COM2" tty irq 3
-device sio2 at isa? disable port "IO_COM3" tty irq 5
-device sio3 at isa? disable port "IO_COM4" tty irq 9
-
-device lpt0 at isa? port? tty irq 7
+device lpt0 at isa? port? tty irq 7 vector lptintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
device de0
+device de1
device fxp0
-
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device ed1 at isa? port 0x300 net irq 10 iomem 0xd0000
-device ep0 at isa? port 0x300 net irq 10
-device ep1 at isa? port 0x280 net irq 5
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000
+device fxp1
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ed1 at isa? port 0x300 net irq 5 iomem 0xd0000 vector edintr
+device ie0 at isa? port 0x280 net irq 10 iomem 0xd0000 vector ieintr
+device ie1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ep1 at isa? port 0x280 net irq 5 vector epintr
+#device ex0 at isa? port? net irq? vector exintr
+#device fe0 at isa? port 0x300 net irq ? vector feintr
+#device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+#device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+#device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
pseudo-device loop
pseudo-device ether
diff --git a/release/picobsd/net/crunch1/Makefile b/release/picobsd/net/crunch1/Makefile
index 8ee9026bb125..0966f3830be6 100644
--- a/release/picobsd/net/crunch1/Makefile
+++ b/release/picobsd/net/crunch1/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.2 1998/10/15 21:40:03 abial Exp $
+# $Id: Makefile,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
#
SRC?=/usr/src
@@ -7,17 +7,21 @@ all: crunch
crunch:
@if [ ! -f .patched ]; then \
+ cat login.diff|(cd /usr/src/usr.bin/login; patch -p0); \
cat passwd.diff|(cd /usr/src/usr.bin/passwd; patch -p0); \
+ cat ppp.diff|(cd /usr/src/usr.sbin/ppp; patch -p0); \
touch .patched; \
fi
@cat crunch.conf|sed -e "s@/usr/src@${SRC}@" >crunch1.conf
@crunchgen ./crunch1.conf
- @${MAKE} -f crunch1.mk -DNOPAM all \
+ @${MAKE} -f crunch1.mk all \
"CFLAGS=${CFLAGS} -DCRUNCHED_BINARY -DNOSECURE -DNOCRYPT" #2>&1 >/dev/null
clean:
@if [ -f .patched ]; then \
+ cat login.diff|(cd /usr/src/usr.bin/login; patch -R -p0); \
cat passwd.diff|(cd /usr/src/usr.bin/passwd; patch -R -p0); \
+ cat ppp.diff|(cd /usr/src/usr.sbin/ppp; patch -R -p0); \
rm .patched; \
fi
rm -f *.o *.stub *.lo *_stub.c *.mk \
@@ -38,7 +42,7 @@ install:
done
rm /mnt/stand/crunch
# Install the MIB files
- #cp mibs/*.txt /mnt/usr/local/share/snmp/mibs/
+ cp mibs/*.txt /mnt/usr/local/share/snmp/mibs/
.include <bsd.prog.mk>
diff --git a/release/picobsd/net/crunch1/crunch.conf b/release/picobsd/net/crunch1/crunch.conf
index 1114f069002d..7aa5e1d1e593 100644
--- a/release/picobsd/net/crunch1/crunch.conf
+++ b/release/picobsd/net/crunch1/crunch.conf
@@ -1,5 +1,5 @@
#
-# $Id: crunch.conf,v 1.4 1998/09/15 11:12:25 abial Exp $
+# $Id: crunch.conf,v 1.3 1998/09/15 07:35:38 abial Exp $
#
# NOTE: the string "/usr/src" will be automatically replaced with the
# correct value set in 'build' script - you should change it there
@@ -16,7 +16,7 @@ srcdirs ../../tinyware
# OBJS=${MIBOBJS} ${AGENTOBJS}
# * we install a special version of MIB files - stripped of comments and
# descriptions. These MIBs are included here to save you the stripping.
-#srcdirs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5.3
+srcdirs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5
# other sources
srcdirs /usr/src/bin
srcdirs /usr/src/sbin/i386
@@ -27,13 +27,12 @@ srcdirs /usr/src/usr.sbin
srcdirs /usr/src/libexec
progs ash test echo hostname ln login getty stty
-progs inetd telnetd w msg kget
+progs inetd telnetd w msg kget snmpd
progs init ifconfig df sps ns vm cat
progs cp rm mknod chmod chown mkdir ls syslogd
progs sysctl route pwd_mkdb dev_mkdb
progs mount mount_msdos umount
progs kill mount_std natd
-#progs snmpd
progs pwd ppp telnet more
progs passwd date
@@ -55,7 +54,7 @@ ln ns netstat
ln chown chgrp
# For snmpd
-#libs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5.3/snmplib/libsnmp.a
+libs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.5/snmplib/libsnmp.a
libs -lncurses -lmytinfo -lipx -lz -lpcap -lalias
libs -ledit -lutil -lmd -lcrypt -lmp -lgmp -lm -lkvm
libs -lgnuregex -ltelnet
diff --git a/release/picobsd/net/floppy.tree/etc/hosts b/release/picobsd/net/floppy.tree/etc/hosts
new file mode 100644
index 000000000000..c3563eae8767
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/hosts
@@ -0,0 +1,5 @@
+# $Id: hosts.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+# This file should contain the addresses and aliases
+# for local hosts that share this file.
+127.0.0.1 localhost localhost.mydomain.org.pl
+127.0.0.1 pico.mydomain.org.pl
diff --git a/release/picobsd/net/floppy.tree/etc/login.conf b/release/picobsd/net/floppy.tree/etc/login.conf
index 8e0451e1d2d7..bde61214b21c 100644
--- a/release/picobsd/net/floppy.tree/etc/login.conf
+++ b/release/picobsd/net/floppy.tree/etc/login.conf
@@ -1,7 +1,7 @@
# This file controls resource limits, accounting limits and
# default user environment settings.
#
-# $Id: login.conf,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+# $Id: login.conf,v 1.1.1.1 1998/07/14 07:30:49 abial Exp $
#
@@ -45,7 +45,7 @@ standard:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
:path=~/bin /bin /usr/bin:\
- :nologin=/var/run/nologin:\
+ :nologin=/etc/nologin:\
:cputime=1h30m:\
:datasize=8M:\
:stacksize=2M:\
diff --git a/release/picobsd/net/floppy.tree/etc/motd b/release/picobsd/net/floppy.tree/etc/motd
new file mode 100644
index 000000000000..547a0684b95b
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/motd
@@ -0,0 +1,12 @@
+=======================================================
+ )\_)\
+PicoBSD 0.42 (NET) (o,o)
+ __ \~/
+Witamy w PicoBSD! -->====\
+ ~~ d d
+W glownym katalogu w pliku README znajdziesz pico
+krotki opis systemu. Mozesz go obejrzec przy pomocy
+"more /README".
+
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
+
diff --git a/release/picobsd/net/floppy.tree/etc/rc b/release/picobsd/net/floppy.tree/etc/rc
new file mode 100644
index 000000000000..05c5f4f5b6f0
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/rc
@@ -0,0 +1,62 @@
+#!/bin/sh
+# $Id: rc.pl,v 1.2 1998/09/26 17:27:24 abial Exp $
+############################################
+### Special setup for one floppy PICOBSD ###
+### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
+############################################
+mount -a -t nonfs
+if [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+rm -f /var/run/*
+if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
+ echo "Dodaje $swapfile jako dodatkowy swap."
+ vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
+fi
+# configure serial devices
+if [ -f /etc/rc.serial ]; then
+ . /etc/rc.serial
+fi
+# start up the initial network configuration.
+if [ -f /etc/rc.network ]; then
+ . /etc/rc.network
+ network_pass1
+fi
+mount -a -t nfs
+# clean up left-over files
+(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
+if [ -n "$network_pass1_done" ]; then
+ network_pass2
+fi
+if [ -n "$network_pass2_done" ]; then
+ network_pass3
+fi
+if [ "X${inetd_enable}" = X"YES" ]; then
+ echo "Uruchamiam inetd."; inetd ${inetd_flags}
+fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Uruchamiam snmpd."; snmpd ${snmpd_flags}
+fi
+
+dev_mkdb
+
+echo ''
+if [ "x$swapfile" = "xNO" ]; then
+ echo "UWAGA: brak swapu!"
+ echo "Nie uruchamiaj zbyt wielu programow na raz..."
+fi
+echo ''
+echo ''
+echo '+------------ PicoBSD 0.42 (NET) --------------+'
+echo '| |'
+echo '| Zaloguj sie jako "root" (haslo "setup"). |'
+echo '| |'
+echo '| Ta wersja PicoBSD w pelni podlega |'
+echo '| licencji BSD. Po wiecej szczegolow zajrzyj |'
+echo '| na http://www.freebsd.org/~picobsd, lub |'
+echo '| skontaktuj sie z autorem. |'
+echo '| |'
+echo '| abial@nask.pl |'
+echo '| |'
+echo '+----------------------------------------------+'
+exit 0
diff --git a/release/picobsd/net/floppy.tree/etc/rc.conf b/release/picobsd/net/floppy.tree/etc/rc.conf
new file mode 100644
index 000000000000..c4cdac8b9000
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/rc.conf
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $Id: rc.conf.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+swapfile="NO" # Set to name of swapfile if aux swapfile desired.
+### Network configuration sub-section ######################
+### Basic network options: ###
+hostname="pico.mydomain.org.pl" # Set this!
+firewall="NO" # firewall type (see /etc/rc.firewall) or NO
+tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO).
+network_interfaces="lo0" # List of network interfaces (lo0 is loopback).
+ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
+#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
+### Network daemons options: ###
+inetd_enable="YES" # Run the network daemon dispatcher (or NO)
+inetd_flags="" # Optional flags to inetd
+snmpd_enable="YES" # Run the SNMP daemon (or NO)
+snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd
+### Network routing options: ###
+defaultrouter="NO" # Set to default gateway (or NO).
+static_routes="" # Set to static route list (or leave empty).
+gateway_enable="NO" # Set to YES if this host will be a gateway.
+arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL.
+### Allow local configuration override at the very end here ##
+if [ -f /etc/rc.conf.local ]; then
+ . /etc/rc.conf.local
+fi
diff --git a/release/picobsd/net/floppy.tree/etc/rc.network b/release/picobsd/net/floppy.tree/etc/rc.network
new file mode 100644
index 000000000000..3079c94d9604
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/rc.network
@@ -0,0 +1,80 @@
+#!/bin/sh -
+# $Id: rc.network.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+network_pass1() {
+ echo -n 'Wstepna konfiguracja sieci:'
+ # Set the host name if it is not already set
+ if [ -z "`hostname -s`" ] ; then
+ hostname $hostname
+ echo ' hostname'
+ fi
+ # Set up all the network interfaces, calling startup scripts if needed
+ for ifn in ${network_interfaces}; do
+ if [ -e /etc/start_if.${ifn} ]; then
+ . /etc/start_if.${ifn}
+ fi
+ # Do the primary ifconfig if specified
+ eval ifconfig_args=\$ifconfig_${ifn}
+ if [ -n "${ifconfig_args}" ] ; then
+ ifconfig ${ifn} ${ifconfig_args}
+ fi
+ # Check to see if aliases need to be added
+ alias=0
+ while :
+ do
+ eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
+ if [ -n "${ifconfig_args}" ]; then
+ ifconfig ${ifn} ${ifconfig_args} alias
+ alias=`expr ${alias} + 1`
+ else
+ break;
+ fi
+ done
+ ifconfig ${ifn}
+ done
+ # Load the filters if required
+ if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \
+ "x$firewall_enable" = "xYES" ] ; then
+ . /etc/rc.firewall
+ echo "Zaladowano reguly filtrujace do firewalla."
+ else
+ echo "UWAGA: system posiada wbudowany modul firewalla, ale zadne reguly"
+ echo " filtrujace nie zostaly zaladowane."
+ echo " Wszystkie rodzaje ruchu IP sa dozwolone."
+ fi
+ # Configure routing
+ if [ "x$defaultrouter" != "xNO" ] ; then
+ static_routes="default ${static_routes}"
+ route_default="default ${defaultrouter}"
+ fi
+ # Set up any static routes. This should be done before router discovery.
+ if [ "x${static_routes}" != "x" ]; then
+ for i in ${static_routes}; do
+ eval route_args=\$route_${i}
+ route add ${route_args}
+ done
+ fi
+ echo -n 'Dodatkowe opcje routingu:'
+ if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then
+ echo -n ' tcp_extensions=NO'
+ sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 2>&1
+ sysctl -w net.inet.tcp.rfc1644=0 >/dev/null 2>&1
+ fi
+ if [ "X$gateway_enable" = X"YES" ]; then
+ echo -n ' IP_gateway=YES'
+ sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
+ fi
+ if [ "X$arpproxy_all" = X"YES" ]; then
+ echo -n ' wlaczam ARP_PROXY_ALL: '
+ sysctl -w net.link.ether.inet.proxyall=1 2>&1
+ fi
+ echo '.'
+ network_pass1_done=YES # Let future generations know we made it.
+}
+
+network_pass2() {
+ network_pass2_done=YES
+}
+
+network_pass3() {
+ network_pass3_done=YES
+}
diff --git a/release/picobsd/net/floppy.tree/etc/resolv.conf b/release/picobsd/net/floppy.tree/etc/resolv.conf
new file mode 100644
index 000000000000..fe9223b69f87
--- /dev/null
+++ b/release/picobsd/net/floppy.tree/etc/resolv.conf
@@ -0,0 +1,3 @@
+# $Id: resolv.conf.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+domain mydomain.org.pl
+nameserver 148.81.16.51
diff --git a/release/picobsd/net/floppy.tree/etc/services b/release/picobsd/net/floppy.tree/etc/services
index eec499fafec7..817b6d315272 100644
--- a/release/picobsd/net/floppy.tree/etc/services
+++ b/release/picobsd/net/floppy.tree/etc/services
@@ -91,4 +91,3 @@ uucp 540/tcp
uucp 540/udp
uucp-rlogin 541/tcp
uucp-rlogin 541/udp
-natd 8668/divert # Network Address Translation
diff --git a/release/picobsd/net/lang/README.en b/release/picobsd/net/lang/README.en
index 2d358de0a937..ad398f76a24d 100644
--- a/release/picobsd/net/lang/README.en
+++ b/release/picobsd/net/lang/README.en
@@ -38,4 +38,4 @@ I'll be glad hearing from you about your experiences with PicoBSD. Thanks.
Have fun!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/net/lang/README.pl b/release/picobsd/net/lang/README.pl
index d7e3f6755ceb..3ac412c3fa57 100644
--- a/release/picobsd/net/lang/README.pl
+++ b/release/picobsd/net/lang/README.pl
@@ -53,4 +53,4 @@ Jakie sa roznice w stosunku do poprzedniej wersji?
Milej zabawy!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/net/lang/m.en b/release/picobsd/net/lang/m.en
new file mode 100644
index 000000000000..f6df2234bf01
--- /dev/null
+++ b/release/picobsd/net/lang/m.en
@@ -0,0 +1,11 @@
+
+PicoBSD 0.35 (NET)
+
+Welcome to PicoBSD!
+
+You can find a short description of the
+system in file /README. You can view it using
+"more /README".
+
+For more info contact the author (abial@nask.pl).
+
diff --git a/release/picobsd/net/lang/m.pl b/release/picobsd/net/lang/m.pl
new file mode 100644
index 000000000000..ff39857afb1f
--- /dev/null
+++ b/release/picobsd/net/lang/m.pl
@@ -0,0 +1,11 @@
+
+PicoBSD 0.35 (NET)
+
+Witamy w PicoBSD!
+
+W glownym katalogu w pliku README znajdziesz
+krotki opis systemu. Mozesz go obejrzec przy pomocy
+"more /README".
+
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
+
diff --git a/release/picobsd/net/lang/motd.en b/release/picobsd/net/lang/motd.en
index f3f774471f11..c498edc1aa6f 100644
--- a/release/picobsd/net/lang/motd.en
+++ b/release/picobsd/net/lang/motd.en
@@ -8,5 +8,5 @@ You can find a short description of the pico
system in file /README. You can view it using
"more /README".
-For more info contact the author (abial@freebsd.org).
+For more info contact the author (abial@nask.pl).
diff --git a/release/picobsd/net/lang/motd.pl b/release/picobsd/net/lang/motd.pl
index 9f8cedfe797c..12acd4e2a66f 100644
--- a/release/picobsd/net/lang/motd.pl
+++ b/release/picobsd/net/lang/motd.pl
@@ -8,5 +8,5 @@ W glownym katalogu w pliku README znajdziesz pico
krotki opis systemu. Mozesz go obejrzec przy pomocy
"more /README".
-Wiecej informacji znajdziesz u autora (abial@freebsd.org).
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
diff --git a/release/picobsd/net/lang/rc.en b/release/picobsd/net/lang/rc.en
index 295a882dfc7a..7658846b7144 100644
--- a/release/picobsd/net/lang/rc.en
+++ b/release/picobsd/net/lang/rc.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.en,v 1.4 1999/01/12 14:09:21 asami Exp $
+# $Id: rc.en,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
@@ -25,6 +25,7 @@ fi
mount -a -t nfs
chmod 666 /dev/tty[pqrsPQRS]*
# clean up left-over files
+rm -f /etc/nologin
(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
if [ -n "$network_pass1_done" ]; then
network_pass2
@@ -35,6 +36,9 @@ fi
if [ "X${inetd_enable}" = X"YES" ]; then
echo "Starting inetd."; inetd ${inetd_flags}
fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Starting snmpd."; snmpd ${snmpd_flags}
+fi
dev_mkdb
@@ -54,7 +58,7 @@ echo '| BSD license. For more details see |'
echo '| http://www.freebsd.org/~picobsd, or contact |'
echo '| the author. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/net/lang/rc.pl b/release/picobsd/net/lang/rc.pl
index d19f3367a6f2..130ec42fe546 100644
--- a/release/picobsd/net/lang/rc.pl
+++ b/release/picobsd/net/lang/rc.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.pl,v 1.3 1998/11/01 20:19:23 abial Exp $
+# $Id: rc.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
@@ -34,6 +34,9 @@ fi
if [ "X${inetd_enable}" = X"YES" ]; then
echo "Uruchamiam inetd."; inetd ${inetd_flags}
fi
+if [ "X${snmpd_enable}" = X"YES" ]; then
+ echo "Uruchamiam snmpd."; snmpd ${snmpd_flags}
+fi
dev_mkdb
@@ -53,7 +56,7 @@ echo '| licencji BSD. Po wiecej szczegolow zajrzyj |'
echo '| na http://www.freebsd.org/~picobsd, lub |'
echo '| skontaktuj sie z autorem. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
exit 0
diff --git a/release/picobsd/net/lang/update.en b/release/picobsd/net/lang/update.en
index cf6e1b131b42..012cbaacd698 100755
--- a/release/picobsd/net/lang/update.en
+++ b/release/picobsd/net/lang/update.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.en,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+# $Id: update.en,v 1.3 1998/08/10 19:17:11 abial Exp $
pwd=`pwd`
echo -n "Updating /etc contents on startup floppy... "
mount /dev/fd0a /start_floppy
@@ -17,7 +17,7 @@ cp -Rp . /start_floppy/etc/
pwd_mkdb master.passwd
echo " Done."
echo -n "Updating kernel parameters... "
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd ${pwd}
echo " Done."
diff --git a/release/picobsd/net/lang/update.pl b/release/picobsd/net/lang/update.pl
index 3055d05356f6..c1bf95b7f2cb 100755
--- a/release/picobsd/net/lang/update.pl
+++ b/release/picobsd/net/lang/update.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: update.pl,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $
+# $Id: update.pl,v 1.3 1998/08/10 19:17:11 abial Exp $
pwd=`pwd`
echo -n "Uaktualniam katalog /etc na dyskietce... "
mount /dev/fd0a /start_floppy
@@ -17,7 +17,7 @@ cp -Rp . /start_floppy/etc/
pwd_mkdb master.passwd
echo " Zrobione."
echo -n "Uaktualniam parametry jadra..."
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
cd ${pwd}
echo " Zrobione."
diff --git a/release/picobsd/router/conf/Makefile b/release/picobsd/router/conf/Makefile
index bd33b5e9d02d..52a6b75c6e3b 100644
--- a/release/picobsd/router/conf/Makefile
+++ b/release/picobsd/router/conf/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 1998/10/15 21:40:05 abial Exp $
+# $Id: Makefile,v 1.2 1998/09/29 12:12:47 abial Exp $
#
SRC?=/usr/src
@@ -17,5 +17,5 @@ $(KERNFILE): PICOBSD
(cd ${CONF}; \
config ${CONFFILE}; \
cd ${COMPILE}; \
- make depend all)
+ make depend && make)
diff --git a/release/picobsd/router/conf/PICOBSD b/release/picobsd/router/conf/PICOBSD
index 4a277e8ec2fc..0a8d652c1d9f 100644
--- a/release/picobsd/router/conf/PICOBSD
+++ b/release/picobsd/router/conf/PICOBSD
@@ -1,5 +1,5 @@
#
-# $Id: PICOBSD,v 1.10 1999/01/14 23:22:51 abial Exp $
+# $Id: PICOBSD,v 1.5 1998/09/23 15:20:55 abial Exp $
#
machine "i386"
@@ -13,7 +13,6 @@ maxusers 10
#options MATH_EMULATE #Support for x87 emulation
options INET #InterNETworking
options FFS #Berkeley Fast Filesystem
-options FFS_ROOT
#options NFS #Network Filesystem
options MFS
#options MSDOSFS #MSDOS Filesystem
@@ -34,21 +33,21 @@ options NO_SWAPPING
#options DUMMYNET
#options BRIDGE
-config kernel root on fd0a
+config kernel root on fd0
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
#disk fd1 at fdc0 drive 1
#options "CMD640" # work around CMD640 chip deficiency
-#controller wdc0 at isa? port "IO_WD1" bio irq 14
+#controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
#disk wd0 at wdc0 drive 0
#disk wd1 at wdc0 drive 1
-#controller wdc1 at isa? port "IO_WD2" bio irq 15
+#controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
#disk wd2 at wdc1 drive 0
#disk wd3 at wdc1 drive 1
@@ -57,20 +56,16 @@ disk fd0 at fdc0 drive 0
#device wcd0 #IDE CD-ROM
# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device vga0 at isa? port ? conflicts
-device sc0 at isa? tty
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
-device npx0 at isa? port IO_NPX irq 13
-
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
-device sio2 at isa? disable port "IO_COM3" tty irq 5
-device sio3 at isa? disable port "IO_COM4" tty irq 9
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
-#device lpt0 at isa? port? tty irq 7
+#device lpt0 at isa? port? tty irq 7 vector lptintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
@@ -79,16 +74,23 @@ device sio3 at isa? disable port "IO_COM4" tty irq 9
device de0
device fxp0
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device ed1 at isa? port 0x300 net irq 10 iomem 0xd0000
-device ep0 at isa? port 0x300 net irq 10
-device ep1 at isa? port 0x280 net irq 5
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ed1 at isa? port 0x300 net irq 5 iomem 0xd0000 vector edintr
+device ie0 at isa? port 0x280 net irq 10 iomem 0xd0000 vector ieintr
+device ie1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ep1 at isa? port 0x280 net irq 5 vector epintr
+#device ex0 at isa? port? net irq? vector exintr
+#device fe0 at isa? port 0x300 net irq ? vector feintr
+#device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+#device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+#device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+#device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
pseudo-device loop
pseudo-device ether
-#pseudo-device tun 2
+#pseudo-device tun 4
#pseudo-device vn
#pseudo-device bpfilter 4
pseudo-device ppp 4
diff --git a/release/picobsd/router/floppy.tree/etc/hosts b/release/picobsd/router/floppy.tree/etc/hosts
new file mode 100644
index 000000000000..d74ecbad93f0
--- /dev/null
+++ b/release/picobsd/router/floppy.tree/etc/hosts
@@ -0,0 +1,5 @@
+# $Id: hosts.pl,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+# This file should contain the addresses and aliases
+# for local hosts that share this file.
+127.0.0.1 localhost localhost.mydomain.org.pl
+127.0.0.1 pico.mydomain.org.pl
diff --git a/release/picobsd/router/floppy.tree/etc/login.conf b/release/picobsd/router/floppy.tree/etc/login.conf
index caa56994130b..d6a8d955949d 100644
--- a/release/picobsd/router/floppy.tree/etc/login.conf
+++ b/release/picobsd/router/floppy.tree/etc/login.conf
@@ -1,7 +1,7 @@
# This file controls resource limits, accounting limits and
# default user environment settings.
#
-# $Id: login.conf,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+# $Id: login.conf,v 1.1 1998/08/02 13:03:30 abial Exp $
#
@@ -45,7 +45,7 @@ standard:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,EDITOR=/usr/bin/ee:\
:path=~/bin /bin /usr/bin:\
- :nologin=/var/run/nologin:\
+ :nologin=/etc/nologin:\
:cputime=1h30m:\
:datasize=8M:\
:stacksize=2M:\
diff --git a/release/picobsd/router/floppy.tree/etc/motd b/release/picobsd/router/floppy.tree/etc/motd
new file mode 100644
index 000000000000..41b2fb6a7706
--- /dev/null
+++ b/release/picobsd/router/floppy.tree/etc/motd
@@ -0,0 +1,11 @@
+=======================================================
+ )\_)\
+PicoBSD 0.42 (ROUTER) (o,o)
+ __ \~/
+Witamy w PicoBSD! -->====\
+ ~~ d d
+Dokumentacja systemu znajduje sie na pico
+http://www.freebsd.org/~picobsd/.
+
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
+
diff --git a/release/picobsd/router/floppy.tree/etc/rc b/release/picobsd/router/floppy.tree/etc/rc
new file mode 100644
index 000000000000..13716d4d8745
--- /dev/null
+++ b/release/picobsd/router/floppy.tree/etc/rc
@@ -0,0 +1,18 @@
+#!/bin/sh
+# $Id: rc.pl,v 1.2 1998/09/26 17:27:26 abial Exp $
+### Special setup for one floppy PICOBSD ###
+ifconfig lo0 inet 127.0.0.1 netmask 0xffffff00
+hostname pico
+echo ""
+echo ""
+echo '+----------- PicoBSD 0.42 (ROUTER) ------------+'
+echo '| |'
+echo '| Ta wersja PicoBSD podlega w pelni licencji |'
+echo '| BSD. Wiecej informacji mozna znalezc na |'
+echo '| http://www.freebsd.org/~picobsd, lub u |'
+echo '| autora. |'
+echo '| |'
+echo '| abial@nask.pl |'
+echo '| |'
+echo '+----------------------------------------------+'
+echo ""
diff --git a/release/picobsd/router/floppy.tree/etc/rc.conf b/release/picobsd/router/floppy.tree/etc/rc.conf
new file mode 100644
index 000000000000..84e6fc9c4ddf
--- /dev/null
+++ b/release/picobsd/router/floppy.tree/etc/rc.conf
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $Id: rc.conf,v 1.2 1998/08/10 19:17:49 abial Exp $
+swapfile="NO" # Set to name of swapfile if aux swapfile desired.
+### Network configuration sub-section ######################
+### Basic network options: ###
+hostname="pico.mydomain.org.pl" # Set this!
+firewall="NO" # firewall type (see /etc/rc.firewall) or NO
+tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO).
+network_interfaces="lo0" # List of network interfaces (lo0 is loopback).
+ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
+#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
+### Network daemons options: ###
+inetd_enable="YES" # Run the network daemon dispatcher (or NO)
+inetd_flags="" # Optional flags to inetd
+snmpd_enable="YES" # Run the SNMP daemon (or NO)
+snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd
+### Network routing options: ###
+defaultrouter="NO" # Set to default gateway (or NO).
+static_routes="" # Set to static route list (or leave empty).
+gateway_enable="NO" # Set to YES if this host will be a gateway.
+arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL.
+### Allow local configuration override at the very end here ##
+if [ -f /etc/rc.conf.local ]; then
+ . /etc/rc.conf.local
+fi
diff --git a/release/picobsd/router/floppy.tree/etc/resolv.conf b/release/picobsd/router/floppy.tree/etc/resolv.conf
new file mode 100644
index 000000000000..d24da1e19f13
--- /dev/null
+++ b/release/picobsd/router/floppy.tree/etc/resolv.conf
@@ -0,0 +1,3 @@
+# $Id: resolv.conf.pl,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+domain mydomain.org.pl
+nameserver 148.81.16.51
diff --git a/release/picobsd/router/floppy.tree/etc/services b/release/picobsd/router/floppy.tree/etc/services
index eec499fafec7..817b6d315272 100644
--- a/release/picobsd/router/floppy.tree/etc/services
+++ b/release/picobsd/router/floppy.tree/etc/services
@@ -91,4 +91,3 @@ uucp 540/tcp
uucp 540/udp
uucp-rlogin 541/tcp
uucp-rlogin 541/udp
-natd 8668/divert # Network Address Translation
diff --git a/release/picobsd/router/lang/README.en b/release/picobsd/router/lang/README.en
index 71e9dd267f46..bd289fecafdc 100644
--- a/release/picobsd/router/lang/README.en
+++ b/release/picobsd/router/lang/README.en
@@ -37,4 +37,4 @@ I'll be glad hearing from you about your experiences with PicoBSD. Thanks.
Have fun!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/router/lang/README.pl b/release/picobsd/router/lang/README.pl
index 269348b20c5c..ed440c1d03a9 100644
--- a/release/picobsd/router/lang/README.pl
+++ b/release/picobsd/router/lang/README.pl
@@ -36,4 +36,4 @@ Po dalsze szczegoly zajrzyj do oryginalnej dokumentacji.
Milej zabawy!
-Andrzej Bialecki <abial@freebsd.org>
+Andrzej Bialecki <abial@nask.pl>
diff --git a/release/picobsd/router/lang/motd.pl b/release/picobsd/router/lang/motd.pl
index cfdbba9e18aa..0bb381886289 100644
--- a/release/picobsd/router/lang/motd.pl
+++ b/release/picobsd/router/lang/motd.pl
@@ -7,5 +7,5 @@ Witamy w PicoBSD! -->====\
Dokumentacja systemu znajduje sie na pico
http://www.freebsd.org/~picobsd/.
-Wiecej informacji znajdziesz u autora (abial@freebsd.org).
+Wiecej informacji znajdziesz u autora (abial@nask.pl).
diff --git a/release/picobsd/router/lang/rc.en b/release/picobsd/router/lang/rc.en
index ee7614ddbced..21a0e4b09f2f 100644
--- a/release/picobsd/router/lang/rc.en
+++ b/release/picobsd/router/lang/rc.en
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.en,v 1.2 1998/09/26 17:27:26 abial Exp $
+# $Id: rc.en,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
### Special setup for one floppy PICOBSD ###
ifconfig lo0 inet 127.0.0.1 netmask 0xffffff00
hostname pico
@@ -12,7 +12,7 @@ echo '| BSD license. For more details see |'
echo '| http://www.freebsd.org/~picobsd, or contact |'
echo '| the author. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
echo ""
diff --git a/release/picobsd/router/lang/rc.pl b/release/picobsd/router/lang/rc.pl
index 686eec6aa1a2..167a145b4f95 100644
--- a/release/picobsd/router/lang/rc.pl
+++ b/release/picobsd/router/lang/rc.pl
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc.pl,v 1.2 1998/09/26 17:27:26 abial Exp $
+# $Id: rc.pl,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
### Special setup for one floppy PICOBSD ###
ifconfig lo0 inet 127.0.0.1 netmask 0xffffff00
hostname pico
@@ -12,7 +12,7 @@ echo '| BSD. Wiecej informacji mozna znalezc na |'
echo '| http://www.freebsd.org/~picobsd, lub u |'
echo '| autora. |'
echo '| |'
-echo '| abial@freebsd.org |'
+echo '| abial@nask.pl |'
echo '| |'
echo '+----------------------------------------------+'
echo ""
diff --git a/release/picobsd/router/lang/update.en b/release/picobsd/router/lang/update.en
index 894f70b257a2..552840c151ae 100755
--- a/release/picobsd/router/lang/update.en
+++ b/release/picobsd/router/lang/update.en
@@ -1,10 +1,10 @@
-# $Id: update.en,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+# $Id: update.en,v 1.2 1998/08/10 19:17:55 abial Exp $
echo -n "Updating /etc contents on startup floppy... "
mount /dev/fd0a /start_floppy
cd /etc
cp -Rp . /start_floppy/etc/
echo " Done."
echo -n "Updating kernel parameters... "
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
echo " Done."
diff --git a/release/picobsd/router/lang/update.pl b/release/picobsd/router/lang/update.pl
index c4ad1c69932e..5790eb61bd84 100755
--- a/release/picobsd/router/lang/update.pl
+++ b/release/picobsd/router/lang/update.pl
@@ -1,11 +1,11 @@
#!/bin/sh
-# $Id: update.pl,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+# $Id: update.pl,v 1.2 1998/08/10 19:17:55 abial Exp $
echo -n "Uaktualniam katalog /etc na dyskietce... "
mount /dev/fd0a /start_floppy
cd /etc
cp -Rp . /start_floppy/etc/
echo " Zrobione."
echo -n "Uaktualniam parametry jadra..."
-kget /start_floppy/kernel.config
+kget -incore /start_floppy/kernel.config /stand/vanilla
umount /dev/fd0a
echo " Zrobione."
diff --git a/release/picobsd/tinyware/aps/README b/release/picobsd/tinyware/aps/README
index 760af8b53ce7..2664c449bbaf 100644
--- a/release/picobsd/tinyware/aps/README
+++ b/release/picobsd/tinyware/aps/README
@@ -11,9 +11,9 @@ When I have some time, I'll add usual switches and other functions that normal
Also, what I'm now inclined to think is that it should be reworked to use
more general (and less complicated) sysctl(3).
-<abial@freebsd.org>
+<abial@nask.pl>
(As of 1998.07.31 this program is no longer used in PicoBSD. See sps(1) in
TinyWare collection).
-$Id: README,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $
+$Id: README,v 1.2 1998/07/31 20:57:42 abial Exp $
diff --git a/release/picobsd/tinyware/help/README b/release/picobsd/tinyware/help/README
index ededf1f29db4..8b86ba137576 100644
--- a/release/picobsd/tinyware/help/README
+++ b/release/picobsd/tinyware/help/README
@@ -3,6 +3,6 @@
This is work in progress. Eventually I'll prepare the help system for newbies,
and these files are just the beginning of it...
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.1.1.1 1998/07/14 07:30:53 abial Exp $
diff --git a/release/picobsd/tinyware/help/help.c b/release/picobsd/tinyware/help/help.c
index 5c49a04c6d39..0e0c9cc54354 100644
--- a/release/picobsd/tinyware/help/help.c
+++ b/release/picobsd/tinyware/help/help.c
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 1998 Eric P. Scott <eps@sirius.com>
- * Copyright (c) 1998 Andrzej Bialecki <abial@freebsd.org>
+ * Copyright (c) 1998 Andrzej Bialecki <abial@nask.pl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: help.c,v 1.3 1998/09/23 14:51:34 abial Exp $
+ * $Id: help.c,v 1.2 1998/09/07 19:00:34 abial Exp $
*/
diff --git a/release/picobsd/tinyware/kget/Makefile b/release/picobsd/tinyware/kget/Makefile
index ba9fe16aa7b0..d55e863b19f6 100644
--- a/release/picobsd/tinyware/kget/Makefile
+++ b/release/picobsd/tinyware/kget/Makefile
@@ -1,9 +1,9 @@
-# $Id: Makefile,v 1.3 1998/10/25 03:16:02 abial Exp $
+# $Id: Makefile,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
#
-SRC?=/usr/src
PROG=kget
-CFLAGS+= -I${SRC}/sys
-SRCS= kget.c
+CFLAGS+= -I/usr/src/sys -DUC_PRIVATE -DKERN_NO_SYMBOLS
+SRCS= uc_isa.c uc_kmem.c uc_list.c uc_main.c uc_main.h \
+ uc_eisa.c uc_pci.c
NOMAN=yes
.include <bsd.prog.mk>
diff --git a/release/picobsd/tinyware/kget/README b/release/picobsd/tinyware/kget/README
index 9490dd747969..2acc5ea552d3 100644
--- a/release/picobsd/tinyware/kget/README
+++ b/release/picobsd/tinyware/kget/README
@@ -1,15 +1,12 @@
-1999.01.06
+1998.06.29
What is it?
-----------
-This utility allows to gather device configuration which possibly
-was changed in userconfig (-c) session, and to save it to /kernel.config
-file on startup floppy, so that when user boots next time, the
-settings will automatically be changed.
-
-This program uses sysctl(3) interface to retrieve data from the kernel -
-the machdep.uc_devlist sysctl was added Jan 5 1999 to 3.0-current.
+This utility is taken almost in its entirety from /stand/sysinstall. It allows
+to gather device configuration which possibly was changed in userconfig (-c)
+session, and to save it to /kernel.config file on startup floppy, so that when
+user boots next time, the settings will automatically be changed.
How can I use it?
-----------------
@@ -17,25 +14,34 @@ How can I use it?
The best way is to call it from /etc/rc in such phase when the startup floppy
is mounted, and redirect its output to /kernel.config on the floppy.
-Usage is straightforward:
+NOTE: You need first to create symbols' list, using 'dumpnlist' utility, and
+place it in /stand/symbols.
- kget output_filename
+Usage is straightforward:
-where output_filename is either regular file (then it's created or
-overwritten), or a "-" meaning standard output.
+ kget -incore|kernel_name output_filename [vanilla]
In simplest form you can do
- kget -
+ kget -incore -
+
+to list current in core parameters, or
+
+ kget kernel_file -
+
+to see settings of another kernel.
+
+or
-to list current in-core parameters, or
+ kget -incore - /stand/vanilla
- kget /kernel.config
+to produce list of changes from 'vanilla' configuration. You can redirect this
+list to /kernel.config file with no changes - it already contains required
+keywords.
-to produce list of changes from 'vanilla' configuration and write
-it to /kernel.config file - it already contains required keywords.
+Credits go to Jordan K. Hubbard for 95% of this code. The rest is mine :-)
Andrzej Bialecki
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.3 1998/11/01 20:19:40 abial Exp $
+$Id: README,v 1.2 1998/08/11 06:53:21 abial Exp $
diff --git a/release/picobsd/tinyware/kget/kget.c b/release/picobsd/tinyware/kget/kget.c
deleted file mode 100644
index b8426e4fdc86..000000000000
--- a/release/picobsd/tinyware/kget/kget.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * Copyright (c) 1999 Andrzej Bialecki <abial@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.
- *
- * $Id: kget.c,v 1.1 1999/01/08 21:09:42 abial Exp $
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#include "i386/isa/isa_device.h"
-
-struct isa_device *id;
-char *p;
-
-int
-main(int argc, char *argv[])
-{
- int len,i;
- char *buf;
- char *mib="machdep.uc_devlist";
- char name[9];
- FILE *fout;
-
- if(argc<2) {
- fout=stdout;
- } else {
- if(strcmp(argv[1],"-")==0) {
- fout=stdout;
- } else {
- fout=fopen(argv[1],"w");
- if(fout==NULL) {
- perror("opening output file");
- exit(1);
- }
- }
- }
-
- /* We use sysctlbyname, because the oid is unknown (OID_AUTO) */
-
- /* get the buffer size */
- i=sysctlbyname(mib,NULL,&len,NULL,NULL);
- if(i) {
- perror("buffer sizing");
- exit(-1);
- }
- buf=(char *)malloc(len*sizeof(char));
- i=sysctlbyname(mib,buf,&len,NULL,NULL);
- if(i) {
- perror("retrieving data");
- exit(-1);
- }
- i=0;
- while(i<len) {
- id=(struct isa_device *)(buf+i);
- p=(buf+i+sizeof(struct isa_device));
- strncpy(name,p,8);
- if(!id->id_enabled) {
- fprintf(fout,"di %s%d\n",name,id->id_unit);
- } else {
- fprintf(fout,"en %s%d\n",name,id->id_unit);
- if(id->id_iobase>0) {
- fprintf(fout,"po %s%d %#x\n",name,id->id_unit,
- id->id_iobase);
- }
- if(id->id_irq>0) {
- fprintf(fout,"ir %s%d %d\n",name,id->id_unit,
- ffs(id->id_irq)-1);
- }
- if(id->id_drq>0) {
- fprintf(fout,"dr %s%d %d\n",name,id->id_unit,
- id->id_drq);
- }
- if(id->id_maddr>0) {
- fprintf(fout,"iom %s%d %#x\n",name,id->id_unit,
- id->id_maddr);
- }
- if(id->id_msize>0) {
- fprintf(fout,"ios %s%d %d\n",name,id->id_unit,
- id->id_msize);
- }
- fprintf(fout,"f %s%d %#x\n",name,id->id_unit,
- id->id_flags);
- }
- i+=sizeof(struct isa_device)+8;
- }
- fprintf(fout,"q\n");
- fclose(fout);
- free(buf);
- exit(0);
-}
diff --git a/release/picobsd/tinyware/kget/kget.h b/release/picobsd/tinyware/kget/kget.h
new file mode 100644
index 000000000000..fc88782379f7
--- /dev/null
+++ b/release/picobsd/tinyware/kget/kget.h
@@ -0,0 +1,2 @@
+#define SAFE_STRCPY strcpy
+#define msgDebug printf
diff --git a/release/picobsd/tinyware/kget/uc_eisa.c b/release/picobsd/tinyware/kget/uc_eisa.c
new file mode 100644
index 000000000000..c0483fc8d3a2
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_eisa.c
@@ -0,0 +1,166 @@
+/***************************************************
+ * file: userconfig/uc_eisa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_eisa.c,v 1.5 1998/09/14 19:14:11 jkh Exp $
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <nlist.h>
+#include <i386/eisa/eisaconf.h>
+
+#include "uc_main.h"
+
+struct eisa_device_node {
+ struct eisa_device dev;
+ struct eisa_device_node *next;
+};
+
+/* module prototypes */
+static void eisa_fill_in(struct kernel *, struct uc_eisa *, struct eisa_device_node *);
+
+void
+get_eisa_info(struct kernel *kp){
+ int i, total;
+ u_int *ls;
+ struct eisa_driver *ed;
+ struct uc_eisa *ep, *epc;
+ char *name;
+
+ if(kp->nl[EISA_SET].n_value || kp->nl[EISA_LIST].n_value) {
+ ep=epc=(struct uc_eisa *)malloc(sizeof(struct uc_eisa));
+ if(!kp->incore) {
+ if(kp->nl[EISA_SET].n_value) {
+ u_int ndev;
+ ls=(u_int *)kv_to_u(kp, kp->nl[EISA_SET].n_value, sizeof(u_int)*10); /* XXX, size? */
+ ndev=ls[0];
+ for(i=1;i<(ndev+1);i++){
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*i);
+ epc = ep+(i-1);
+ ed=(struct eisa_driver *)kv_to_u(kp, ls[i], sizeof(struct eisa_driver));
+ name=(char *)kv_to_u(kp, (u_int)ed->name, 10); /* XXX, size? */
+ asprintf(&epc->device, "%s", name);
+ asprintf(&epc->full_name, "?");
+ }
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*i);
+ epc = ep+(i-1);
+ bzero(epc, sizeof(struct uc_eisa));
+ kp->eisa_devp=ep;
+ } else { /* not incore and no symbol, we have no EISA devs... */
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+ } else {
+ /* if we're incore, we can get data from _eisa_dev_list, */
+ /* which should be much more useful, but I'll need a machine */
+ /* to test :( */
+ if(kp->nl[EISA_LIST].n_value) {
+ u_int t;
+ struct eisa_device_node *edn;
+
+ t=kv_dref_p(kp, kp->nl[EISA_LIST].n_value);
+ total=0;
+ while(t) {
+ edn=(struct eisa_device_node *)
+ kv_to_u(kp, t,sizeof(struct eisa_device_node));
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*(total+1));
+ epc=ep+total;
+ eisa_fill_in(kp, epc, edn);
+ t=(u_int)edn->next;
+ free(edn);
+ total++;
+ }
+
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*(total+1));
+ epc=ep+total;
+ bzero(epc, sizeof(struct uc_eisa));
+ kp->eisa_devp=ep;
+ } else {
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+ }
+ } else {
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+}
+
+struct list *
+get_eisa_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_eisa *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->eisa_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_eisa_device(struct uc_eisa *ep){
+ struct list *list;
+ list=list_new();
+
+ list_append(list, ep->device);
+ list_append(list, ep->full_name);
+
+ return(list);
+}
+
+
+static void
+eisa_fill_in(struct kernel *kp, struct uc_eisa *epc, struct eisa_device_node *edn){
+ struct eisa_driver *edrv;
+ char *n;
+
+ edrv=(struct eisa_driver *)kv_to_u(kp, (u_int)edn->dev.driver,
+ sizeof(struct eisa_driver));
+
+ n=(char *)kv_to_u(kp, (u_int)edrv->name, 20);
+ asprintf(&epc->device, "%s%lu", n, edn->dev.unit);
+ free(n);
+
+ n=(char *)kv_to_u(kp, (u_int)edn->dev.full_name, 40); /*XXX*/
+ asprintf(&epc->full_name, "%s", n);
+ free(n);
+ free(edrv);
+}
+
+void
+eisa_free(struct kernel *kp, int writeback){
+ struct uc_eisa *ep;
+
+ for(ep=kp->eisa_devp;ep->device;ep++){
+ free(ep->device);
+ free(ep->full_name);
+ }
+ free(kp->eisa_devp);
+ kp->eisa_devp=0;
+}
+
+/* end of userconfig/uc_eisa.c */
diff --git a/release/picobsd/tinyware/kget/uc_isa.c b/release/picobsd/tinyware/kget/uc_isa.c
new file mode 100644
index 000000000000..6a5d750e49d9
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_isa.c
@@ -0,0 +1,211 @@
+/***************************************************
+ * file: userconfig/uc_isa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_isa.c,v 1.5 1998/10/06 07:41:48 msmith Exp $
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <nlist.h>
+#include <i386/isa/isa_device.h>
+
+#include "uc_main.h"
+
+void
+get_isa_info(struct kernel *kp){
+ int total, i, j;
+ struct uc_isa *idp;
+ struct isa_device *p, *isa_dp;
+ struct isa_driver *drv;
+ char *name;
+
+ if(kp->nl[ISA_BIOTAB].n_value || kp->nl[ISA_TTYTAB].n_value || kp->nl[ISA_NETTAB].n_value ||
+ kp->nl[ISA_CAMTAB].n_value || kp->nl[ISA_NULLTAB].n_value ||
+ kp->nl[ISA_WDCTAB].n_value || kp->nl[ISA_FDCTAB].n_value) {
+
+ idp = kp->isa_devp = (struct uc_isa *)malloc(sizeof(struct uc_isa));
+ total=0; /* a running total of the number of isa devices */
+
+ for (i=0; i<6; i++) { /* the isa devices */
+ if(kp->nl[i].n_value) {
+ p = isa_dp = (struct isa_device *)kv_to_u(kp, kp->nl[i].n_value, /* XXX size? */
+ sizeof(struct isa_device)*30);
+ /* build the device list */
+ /* `total' keeps a running total of all the devices found */
+ for (j=0; p->id_id; j++, p++, total++) {
+ kp->isa_devp = (struct uc_isa *)realloc(kp->isa_devp,
+ sizeof(struct uc_isa)*(total+1));
+ idp=kp->isa_devp+total;
+
+ drv=(struct isa_driver *)kv_to_u(kp, (u_int)p->id_driver, sizeof(struct isa_driver));
+ name=(char *)kv_to_u(kp, (u_int)drv->name, 64);
+
+ if (i==ISA_WDCTAB || i==ISA_FDCTAB) { /* special case the disk devices */
+ char n[10];
+ strncpy(n, name, 10);
+ n[strlen(n)-1]=0; /* chop off the trailing 'c' */
+ asprintf(&idp->device, "%s%d", n, j);
+ } else {
+ asprintf(&idp->device, "%s%d", name, p->id_unit);
+ }
+ idp->port=p->id_iobase;
+ idp->irq=p->id_irq;
+ idp->drq=p->id_drq;
+ idp->iomem=(u_int)p->id_maddr & 0xFFFFFF; /* kludge to get pa from kva */
+ idp->iosize=p->id_msize;
+ idp->flags=p->id_flags;
+ idp->alive=p->id_alive;
+ idp->enabled=p->id_enabled;
+ idp->modified=0;
+ if(!kp->incore){
+ idp->idp=p;
+ } else {
+ free(name);
+ free(drv);
+ }
+ }
+ if(kp->incore){
+ free(isa_dp);
+ }
+ }
+ }
+
+ idp=kp->isa_devp+total;
+ bzero(idp, sizeof(struct uc_isa));
+ } else {
+ kp->isa_devp=0;
+ }
+}
+
+
+struct list *
+get_isa_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_isa *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->isa_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_isa_device(struct uc_isa *ip){
+ struct list *list;
+ char *tmp;
+
+ list=list_new();
+
+ asprintf(&tmp, "%s", ip->device );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%04x", ip->port );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->irq>0 ? ffs(ip->irq)-1 : ip->irq);
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->drq );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%08x", ip->iomem );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%x", ip->iosize );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%x", ip->flags );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->alive );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->enabled );
+ list_append(list, tmp);
+ free(tmp);
+
+ return(list);
+}
+
+int
+isa_setdev(struct kernel *kp, struct list *list){
+ int r=1, irq;
+ struct uc_isa *ip;
+
+ if(kp->isa_devp)
+ for(ip=kp->isa_devp;ip->device;ip++){
+ if(strcmp(list->av[0], ip->device)==0){
+ ip->modified=1;
+ ip->port = strtol(list->av[1], (char **)NULL, 0);
+ irq=strtol(list->av[2], (char **)NULL, 0);
+ ip->irq= irq > 0 ? 1 << (irq) : irq;
+ ip->drq = strtol(list->av[3], (char **)NULL, 0);
+ ip->iomem = strtol(list->av[4], (char **)NULL, 0);
+ ip->iosize = strtol(list->av[5], (char **)NULL, 0);
+ ip->flags = strtol(list->av[6], (char **)NULL, 0);
+ ip->enabled = strtol(list->av[8], (char **)NULL, 0);
+ r=0;
+ break;
+ }
+ }
+ return(r);
+}
+
+void
+isa_free(struct kernel *kp, int writeback){
+ struct uc_isa *ip;
+ for(ip=kp->isa_devp; ip->device; ip++){
+ if((!kp->incore) && ip->modified && writeback) {
+ /* save any changes */
+ ip->idp->id_iobase=ip->port;
+ ip->idp->id_irq = ip->irq;
+ ip->idp->id_drq = ip->drq;
+ ip->idp->id_maddr = (caddr_t)ip->iomem;
+ ip->idp->id_msize = ip->iosize;
+ ip->idp->id_flags = ip->flags;
+ ip->idp->id_enabled = ip->enabled;
+ }
+ /* and, be free... */
+ free(ip->device);
+ }
+ /* and free the whole ball of wax */
+ free(kp->isa_devp);
+ kp->isa_devp=0;
+}
+
+/* end of userconfig/uc_isa.c */
diff --git a/release/picobsd/tinyware/kget/uc_kmem.c b/release/picobsd/tinyware/kget/uc_kmem.c
new file mode 100644
index 000000000000..159fb150a5d4
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_kmem.c
@@ -0,0 +1,87 @@
+/***************************************************
+ * file: userconfig/uc_kmem.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_kmem.c,v 1.3 1997/02/22 14:12:28 peter Exp $
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <a.out.h>
+
+#include <stdio.h>
+
+#include "uc_main.h"
+
+/* translate a kv pointer to user space */
+/* malloc()-ing if we aren't mmaped */
+u_int
+kv_to_u(struct kernel *kp, u_int adr, u_int size){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=(u_int)((adr - ep->a_entry + (N_DATOFF(*ep) - ep->a_text))+kp->core);
+ } else {
+ caddr_t ptr;
+ ptr = malloc(size);
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, ptr, size);
+ tadr=(u_int)ptr;
+ }
+ return(tadr);
+}
+
+/* dereference a pointer to kernel space */
+u_int
+kv_dref_p(struct kernel *kp, u_int adr){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=*(u_int*)((adr - ep->a_entry + (N_DATOFF(*ep) - ep->a_text))+kp->core);
+ } else {
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, &tadr, sizeof(tadr));
+ }
+ return(tadr);
+}
+
+/* deref a pointer to kernel text */
+u_int
+kv_dref_t(struct kernel *kp, u_int adr){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=*(u_int*)((adr - ep->a_entry) + N_TXTOFF(*ep) + (u_int)kp->core);
+ } else {
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, &tadr, sizeof(tadr));
+ }
+ return(tadr);
+}
+
+/* end of userconfig/uc_kmem.c */
diff --git a/release/picobsd/tinyware/kget/uc_list.c b/release/picobsd/tinyware/kget/uc_list.c
new file mode 100644
index 000000000000..e2b6bd5cb584
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_list.c
@@ -0,0 +1,76 @@
+/***************************************************
+ * file: userconfig/uc_isa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_list.c,v 1.3 1997/02/22 14:12:29 peter Exp $
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <nlist.h>
+#include "uc_main.h"
+
+struct list *
+list_new(void){
+ struct list *rv;
+ rv=(struct list *)malloc(sizeof(struct list));
+ rv->ac=0;
+ rv->av=(char **)0;
+ return(rv);
+}
+
+void
+list_append(struct list *list , char *item){
+
+ if(list->ac==0) {
+ list->av=(char **)malloc(sizeof(char *)*(list->ac+1));
+ } else {
+ list->av=(char **)realloc(list->av, sizeof(char *)*(list->ac+1));
+ }
+ asprintf(list->av+list->ac, "%s", item);
+ list->ac++;
+}
+
+void
+list_print(struct list *list, char *separator){
+ int i;
+ for(i=0; i<list->ac; i++)
+ printf("%s%s", list->av[i], separator);
+}
+
+void
+list_destroy(struct list *list){
+ int i;
+ for(i=0;i<list->ac;i++){
+ free(list->av[i]);
+ list->av[i]=0;
+ }
+ free(list->av);
+ list->av=0;
+ free(list);
+}
+
+/* end of userconfig/uc_list.c */
diff --git a/release/picobsd/tinyware/kget/uc_main.c b/release/picobsd/tinyware/kget/uc_main.c
new file mode 100644
index 000000000000..2f39a11a1a96
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_main.c
@@ -0,0 +1,475 @@
+/***************************************************
+ * file: userconfig/uc_main.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ * library functions for userconfig library
+ *
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+#include <paths.h>
+#include <sys/mman.h>
+#include <nlist.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "uc_main.h"
+#include "kget.h"
+
+FILE *f_out;
+
+static struct nlist _nl[] = {
+ {"_isa_devtab_bio"},
+ {"_isa_devtab_tty"},
+ {"_isa_devtab_cam"},
+ {"_isa_devtab_net"},
+ {"_isa_devtab_null"},
+ {"_isa_biotab_wdc"},
+ {"_isa_biotab_fdc"},
+ {"_eisadriver_set"},
+ {"_eisa_dev_list"},
+ {"_pcidevice_set"},
+ {"_device_list"},
+ {"_scbusses"},
+#ifdef USE_SCSI
+ {"_scsi_cinit"},
+ {"_scsi_dinit"},
+ {"_scsi_tinit"},
+#endif
+ {""},
+};
+
+int
+isDebug() {
+ return(0);
+}
+
+struct list *
+vc_getdev(char *vanilla)
+{
+ FILE *fd;
+ struct list *dl;
+ char buf[100];
+
+ fd=fopen(vanilla,"r");
+ if(fd==NULL) {
+ printf("no such file: %s\n",vanilla);
+ exit(2);
+ }
+ dl=list_new();
+ while(!feof(fd)) {
+ buf[0]='\0';
+ if(fgets(buf,99,fd)==NULL) continue;
+ buf[strlen(buf)-1]='\0';
+ list_append(dl,buf);
+ }
+ fclose(fd);
+ return(dl);
+}
+
+void
+process(struct list *d, struct list *v, int flag)
+{
+ int i,idx,found;
+ int len;
+ char *tok,*sep=" ";
+ char *parm[]= {"<devname>",
+ "port",
+ "irq",
+ "drq",
+ "iomem",
+ "iosize",
+ "flags",
+ "<alive>",
+ "<enabled>",
+ "<modified>"};
+
+ if(!flag) {
+ fprintf(f_out,"%s",d->av[0]);
+ for(i=1;i<d->ac;i++) {
+ fprintf(f_out," %s",d->av[i]);
+ }
+ fprintf(f_out,"\n");
+ return;
+ }
+ found=0;
+ for(i=0;i<v->ac;i++) {
+ if(strncmp(d->av[0],v->av[i],strlen(d->av[0]))!=0) continue;
+ found++;
+ break;
+ }
+ if(!found) {
+ printf("\nWhoa!\n");
+ printf("Couldn't find device %s in 'vanilla' list!\n",
+ d->av[0]);
+ printf("It seems that kernel image and 'vanilla' list are out of sync...\n");
+ exit(2);
+ }
+ idx=i;
+ if(strcmp(d->av[8],"0")==0) { /* disable and return */
+ fprintf(f_out,"disable %s\n",d->av[0]);
+ return;
+ }
+ tok=strtok(v->av[idx],sep); /* discard <name> */
+ for(i=1;i<d->ac;i++) {
+ tok=strtok(NULL,sep); /* get next param from string */
+ if(tok==NULL) {
+ fprintf(stderr,"Hmmm... strange error, please report!\n");
+ fprintf(stderr,"Include the 'kget -incore' output and the device name (%s)\n",d->av[0]);
+ exit(10);
+ }
+ if(strcmp(d->av[i],tok)!=0) { /* changed */
+ switch(i) {
+ case 7: /* alive */
+ break;
+ case 8: /* enable/disable */
+ if(strcmp(d->av[i],"0")==0) { /* disable */
+ fprintf(f_out,"disable %s\n",d->av[0]);
+ return;
+ } else {
+ fprintf(f_out,"enable %s\n",d->av[0]);
+ }
+ break;
+ case 2: /* special case for npx */
+ if(strcmp(d->av[0],"npx0")==0) continue;
+ /* FALLTHROUGH */
+ default:
+ fprintf(f_out,"%s %s %s\n",parm[i],d->av[0],d->av[i]);
+ break;
+ }
+ }
+ }
+ return;
+}
+
+int main(int argc, char *argv[])
+{
+ struct kernel *core;
+ struct list *c_isa, *c_dev,*v_isa;
+ int d,j,cnt=0;
+ int diff=0;
+ char buf[100];
+
+ if(argc<3) {
+ printf("Usage: %s name|-incore -|filename [vanilla]\n",argv[0]);
+ exit(1);
+ }
+ if(argc>3) {
+ v_isa=vc_getdev(argv[3]);
+ diff++;
+ }
+ core=uc_open(argv[1]);
+ c_isa=uc_getdev(core,"-isa");
+ if(c_isa==NULL) {
+ printf("no symbols in kernel?\n");
+ exit(2);
+ }
+ if(strcmp(argv[2],"-")==NULL) {
+ f_out=stdout;
+ } else {
+ f_out=fopen(argv[2],"w");
+ if(f_out==NULL) f_out=stdout;
+ }
+ if(diff) fprintf(f_out,"USERCONFIG\n");
+ for(d=0;d<c_isa->ac;d++) {
+ c_dev=uc_getdev(core,c_isa->av[d]);
+ process(c_dev,v_isa,diff);
+ }
+ if(diff) fprintf(f_out,"quit\n");
+ uc_close(core,0);
+ exit(0);
+}
+
+struct kernel *
+uc_open(char *name){
+ int kd, flags, incore;
+ struct kernel *kern;
+ struct stat sb;
+ char kname[80];
+ int size, i = 0;
+ struct nlist *nl = _nl;
+
+ if (strcmp(name, "-incore") == 0)
+ incore = 1;
+ else
+ incore = 0;
+
+ if (incore || (strcmp(name,"-bootfile") == 0))
+ SAFE_STRCPY(kname, getbootfile());
+ else
+ SAFE_STRCPY(kname, name);
+
+ if (isDebug())
+ msgDebug("uc_open: kernel name is %s, incore = %d\n", kname, incore);
+ kern = (struct kernel *)malloc(sizeof(struct kernel));
+
+#ifdef KERN_NO_SYMBOLS
+ if (incore) {
+ FILE *fp;
+
+ fp = fopen("/stand/symbols", "r");
+ if (!fp) {
+ msgDebug("Couldn't open /stand/symbols file! Punting.\n");
+ free(kern);
+ return NULL;
+ }
+ if (fscanf(fp, "%d\n", &size) != 1) {
+ msgDebug("Unable to get # of name list entries from symbol file.\n");
+ free(kern);
+ return NULL;
+ }
+ else if (isDebug())
+ msgDebug("uc_open: opened /stand/symbols file, reading %d entries.\n", size);
+
+
+ kern->nl = nl = (struct nlist *)malloc((size + 1) * sizeof(struct nlist));
+ bzero(nl, (size + 1) * sizeof(struct nlist));
+ for (i = 0; i < size; i++) {
+ char *cp, name[255];
+ int c1;
+ unsigned int uc1;
+ short d1;
+ unsigned long v1;
+
+ if (fgets(name, 255, fp) == NULL) {
+ msgDebug("Can't get name field for entry %d\n", i);
+ free(kern);
+ return NULL;
+ }
+ if ((cp = index(name, '\n')) != NULL)
+ *cp = '\0';
+ nl[i].n_name = strdup(name);
+ if (fscanf(fp, "%u %d %hd %ld\n", &uc1, &c1, &d1, &v1) == 4) {
+ nl[i].n_type = (unsigned char)uc1;
+ nl[i].n_other = (char)c1;
+ nl[i].n_desc = d1;
+ nl[i].n_value = v1;
+ if (isDebug())
+ msgDebug("uc_open: for entry %d, decoded: \"%s\", %u %d %hd %ld\n", i, nl[i].n_name, nl[i].n_type, nl[i].n_other, nl[i].n_desc, nl[i].n_value);
+ }
+ }
+ nl[i].n_name = "";
+ fclose(fp);
+ i = 0;
+ }
+ else
+#endif
+ i = nlist(kname, nl);
+ if (i == -1) {
+ msgDebug("uc_open: kernel %s does not contain symbols.\n", kname);
+ free(kern);
+ return NULL;
+ }
+#ifdef KERN_NO_SYMBOLS
+ if (!incore) {
+#else
+ {
+#endif
+ kern->nl=(struct nlist *)malloc(sizeof(_nl));
+ bcopy(_nl, kern->nl, sizeof(_nl));
+ }
+
+ if (incore) {
+ if (isDebug())
+ msgDebug("uc_open: attempting to open /dev/kmem for incore.\n");
+ if ((kd = open("/dev/kmem", O_RDONLY)) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to open /dev/kmem.\n");
+ return NULL;
+ }
+ kern->core = (caddr_t)NULL;
+ kern->incore = 1;
+ kern->size = 0;
+ }
+ else {
+ if (stat(kname, &sb) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to stat %s.\n", kname);
+ return NULL;
+ }
+ kern->size = sb.st_size;
+ flags = sb.st_flags;
+
+ if (chflags(kname, 0) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to chflags %s.\n", kname);
+ return NULL;
+ }
+
+ if (isDebug())
+ msgDebug("uc_open: attempting to open %s\n", kname);
+ if ((kd = open(kname, O_RDWR, 0644)) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to open %s.\n", kname);
+ return NULL;
+ }
+
+ fchflags(kd, flags);
+
+ if (isDebug())
+ msgDebug("uc_open: attempting to mmap %d bytes\n", sb.st_size);
+ kern->core = mmap((caddr_t)0, sb.st_size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, kd, 0);
+ kern->incore = 0;
+ if (kern->core == MAP_FAILED) {
+ free(kern);
+ msgDebug("uc_open: Unable to mmap from %s.\n", kname);
+ return NULL;
+ }
+ }
+
+ kern->fd = kd;
+ get_isa_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got isa information\n");
+
+ get_pci_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got pci information\n");
+
+ get_eisa_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got eisa information\n");
+#ifdef USE_SCSI
+ get_scsi_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got scsi information\n");
+#else
+ kern->scsi_devp=(struct uc_scsi*)NULL;
+ kern->scsibus_devp=(struct uc_scsibus*)NULL;
+#endif
+ return kern;
+}
+
+int
+uc_close(struct kernel *kern, int writeback)
+{
+ if (kern->isa_devp)
+ isa_free(kern, writeback);
+
+ if (kern->eisa_devp)
+ eisa_free(kern, writeback); /* `writeback' isn't really useful here */
+
+ if (kern->pci_devp)
+ pci_free(kern, writeback); /* or here */
+
+#ifdef USE_SCSI
+ if (kern->scsi_devp)
+ scsi_free(kern, writeback);
+#endif
+
+ if (!kern->incore)
+ munmap(kern->core, kern->size);
+
+ close(kern->fd);
+ free(kern->nl);
+ free(kern);
+
+ return 0;
+}
+
+struct list *
+uc_getdev(struct kernel *kern, char *dev)
+{
+ struct list *list = (struct list *)0;
+
+ if (*dev == '-') { /* asked for -isa, -eisa, -pci, -scsi, -all */
+ if (strcmp(dev, "-all") == 0) {
+ list = list_new();
+ if (kern->isa_devp)
+ list_append(list, "isa");
+
+ if (kern->eisa_devp)
+ list_append(list, "eisa");
+
+ if (kern->pci_devp)
+ list_append(list, "pci");
+
+ if (kern->scsi_devp)
+ list_append(list, "scsi");
+
+ }
+ else if (strcmp(dev, "-isa") == 0)
+ list = get_isa_devlist(kern);
+ else if (strcmp(dev, "-eisa") == 0)
+ list = get_eisa_devlist(kern);
+ else if (strcmp(dev, "-pci") == 0)
+ list = get_pci_devlist(kern);
+#ifdef USE_SCSI
+ else if (strcmp(dev, "-scsi") == 0)
+ list = get_scsi_devlist(kern);
+#endif
+ }
+ else {
+ /* we gotta figure out which real device to report */
+ struct uc_isa *ip;
+ struct uc_scsi *sp;
+ struct uc_pci *pp;
+ struct uc_eisa *ep;
+
+ if (kern->isa_devp) {
+ for (ip = kern->isa_devp; ip->device; ip++) {
+ if (strcmp(dev, ip->device) == 0) {
+ list = get_isa_device(ip);
+ goto end;
+ }
+ }
+ }
+
+#ifdef USE_SCSI
+ if (kern->scsi_devp) {
+ for (sp = kern->scsi_devp; sp->device; sp++) {
+ if (strcmp(dev, sp->device) == 0) {
+ list = get_scsi_device(sp);
+ goto end;
+ }
+ }
+ }
+#endif
+
+ if (kern->pci_devp) {
+ for(pp = kern->pci_devp; pp->device; pp++) {
+ if (strcmp(dev, pp->device) == 0) {
+ list = get_pci_device(pp);
+ goto end;
+ }
+ }
+ }
+
+ if (kern->eisa_devp) {
+ for (ep = kern->eisa_devp; ep->device; ep++) {
+ if (strcmp(dev, ep->device) == 0) {
+ list = get_eisa_device(ep);
+ goto end;
+ }
+ }
+ }
+ }
+end:
+ return(list);
+}
diff --git a/release/picobsd/tinyware/kget/uc_main.h b/release/picobsd/tinyware/kget/uc_main.h
new file mode 100644
index 000000000000..326b80622023
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_main.h
@@ -0,0 +1,168 @@
+/***************************************************
+ * file: userconfig/uc_main.h
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_main.h,v 1.5 1998/10/06 07:41:49 msmith Exp $
+ */
+
+#define ISA_BIOTAB 0
+#define ISA_TTYTAB 1
+#define ISA_NETTAB 2
+#define ISA_CAMTAB 3
+#define ISA_NULLTAB 4
+#define ISA_WDCTAB 5
+#define ISA_FDCTAB 6
+#define EISA_SET 7
+#define EISA_LIST 8
+#define PCI_SET 9
+#define SCSI_LIST 10
+#define SCSI_BUSSES 11
+#define SCSI_CINIT 12
+#define SCSI_DINIT 13
+#define SCSI_TINIT 14
+/* symbols + the null terminator */
+#define NSYMBOLS 16
+
+struct kernel {
+ int fd; /* file descriptor for the kernel image, either a binary or /dev/kmem */
+ caddr_t core; /* either the mmap()ed kernel image, or a scratch area */
+ u_int size; /* size of the object at ->core */
+ int incore; /* true if the kernel is running */
+#ifdef UC_PRIVATE
+ struct nlist *nl; /* the symbol table */
+#else
+ void *nl;
+#endif
+ struct uc_isa *isa_devp; /* pointer to the isa devices (if any) */
+ struct uc_eisa *eisa_devp; /* pointer to the eisa devices (if any) */
+ struct uc_pci *pci_devp; /* pointer to the pci devices (if any) */
+ struct uc_scsi *scsi_devp; /* pointer to the scsi devices (if any) */
+ struct uc_scsibus *scsibus_devp; /* internal pointer to scsibus wirings */
+};
+
+struct uc_isa {
+ char *device;
+ u_short port;
+ u_short irq;
+ short drq;
+ u_int iomem;
+ int iosize;
+ int flags;
+ int alive;
+ int enabled;
+#ifdef UC_PRIVATE
+ struct isa_device *idp;
+#else
+ void *idp;
+#endif
+ int modified;
+};
+
+struct uc_pci {
+ char *device;
+};
+
+struct uc_eisa {
+ char *device;
+ char *full_name;
+};
+
+struct uc_scsibus {
+ int bus_no;
+ int unit;
+ char *driver;
+#ifdef UC_PRIVATE
+ struct scsi_ctlr_config *config;
+#else
+ void *config;
+#endif
+};
+
+struct uc_scsi {
+ char *device;
+ char *adapter;
+ u_short target;
+ u_short lun;
+ char *desc;
+#ifdef UC_PRIVATE
+ struct scsi_device_config *config;
+#else
+ void *config;
+#endif
+ int modified;
+};
+
+/* nearly everything useful returns a list */
+
+struct list {
+ int ac;
+ char **av;
+};
+
+/* prototypes */
+
+/* uc_main.c */
+/* these are really the only public ones */
+struct kernel *uc_open(char *name);
+int uc_close(struct kernel *kern, int writeback);
+struct list *uc_getdev(struct kernel *kern, char *dev);
+
+/* uc_isa.c */
+void get_isa_info(struct kernel *kp);
+struct list *get_isa_devlist(struct kernel *kp);
+struct list *get_isa_device(struct uc_isa *ip);
+int isa_setdev(struct kernel *kp, struct list *list);
+void isa_free(struct kernel *kp, int writeback);
+
+/* uc_eisa.c */
+void get_eisa_info(struct kernel *kp);
+struct list *get_eisa_devlist(struct kernel *kp);
+struct list *get_eisa_device(struct uc_eisa *ep);
+void eisa_free(struct kernel *kp, int writeback);
+
+/* uc_pci.c */
+void get_pci_info(struct kernel *kp);
+struct list *get_pci_devlist(struct kernel *kp);
+struct list *get_pci_device(struct uc_pci *pp);
+void pci_free(struct kernel *kp, int writeback);
+
+/* uc_scsi.c */
+void get_scsi_info(struct kernel *kp);
+struct list *get_scsi_devlist(struct kernel *kp);
+struct list *get_scsi_device(struct uc_scsi *sp);
+int scsi_setdev(struct kernel *kp, struct list *list);
+void scsi_free(struct kernel *kp, int writeback);
+
+/* uc_kmem.c */
+u_int kv_to_u(struct kernel *kp, u_int adr, u_int size);
+u_int kv_dref_p(struct kernel *kp, u_int adr);
+u_int kv_dref_t(struct kernel *kp, u_int adr);
+
+/* uc_list.c */
+struct list *list_new(void);
+void list_append(struct list *list, char *item);
+void list_print(struct list *list, char *separator);
+void list_destroy(struct list *list);
+
+/* end of userconfig/uc_main.h */
diff --git a/release/picobsd/tinyware/kget/uc_pci.c b/release/picobsd/tinyware/kget/uc_pci.c
new file mode 100644
index 000000000000..0d8e601c8b40
--- /dev/null
+++ b/release/picobsd/tinyware/kget/uc_pci.c
@@ -0,0 +1,122 @@
+/***************************************************
+ * file: userconfig/uc_pci.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_pci.c,v 1.4 1997/02/22 14:12:33 peter Exp $
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <nlist.h>
+#include <pci/pcivar.h>
+
+#include "uc_main.h"
+
+void
+get_pci_info(struct kernel *kp){
+ int i, total;
+ u_int *ls, ndev;
+ struct pci_device *pd;
+ struct uc_pci *pp,*ppc;
+ char *name;
+
+ if(kp->nl[PCI_SET].n_value){
+ pp = ppc = (struct uc_pci *)malloc(sizeof(struct uc_pci));
+ ls=(u_int *)kv_to_u(kp, kp->nl[PCI_SET].n_value, sizeof(u_int)*30); /* XXX, size? */
+ ndev=ls[0];
+ total=0;
+ for(i=1;i<(ndev+1);i++){
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ pd=(struct pci_device *)kv_to_u(kp, ls[i], sizeof(struct pci_device));
+ /* don't try to dereference a null pointer */
+ name=pd->pd_name ? (char *)kv_to_u(kp, (u_int)pd->pd_name, 10) :
+ pd->pd_name; /* XXX, size? */
+ if(kp->incore){
+ int u, k;
+ /* incore, we can get unit numbers */
+
+ u=kv_dref_p(kp, (u_int)pd->pd_count);
+ for(k=0;k<u;k++,total++){
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ asprintf(&ppc->device, "%s%d", name, k);
+ }
+ free(pd);
+ if(name)
+ free(name);
+ } else {
+ asprintf(&ppc->device, "%s?", name);
+ total++;
+ }
+ }
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ bzero(ppc, sizeof(struct uc_pci));
+ kp->pci_devp=pp;
+ } else {
+ kp->pci_devp=(struct uc_pci *)0;
+ }
+}
+
+
+struct list *
+get_pci_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_pci *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->pci_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_pci_device(struct uc_pci *pp){
+ struct list *list;
+ list=list_new();
+
+ list_append(list, pp->device);
+
+ return(list);
+}
+
+void
+pci_free(struct kernel *kp, int writeback){
+ struct uc_pci *pp;
+
+ for(pp=kp->pci_devp;pp->device;pp++){
+ free(pp->device);
+ }
+ free(kp->pci_devp);
+ kp->pci_devp=0;
+
+}
+
+/* end of userconfig/uc_pci.c */
diff --git a/release/picobsd/tinyware/msg/README b/release/picobsd/tinyware/msg/README
index 37bac7d92988..a38101bde5fc 100644
--- a/release/picobsd/tinyware/msg/README
+++ b/release/picobsd/tinyware/msg/README
@@ -10,6 +10,6 @@ recently added to the kernel sources, so if you don't mind patching your
kernel tree, contact me directly - the patches are very small and simple.
Andrzej Bialecki
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1 1998/09/15 07:35:58 abial Exp $
+$Id$
diff --git a/release/picobsd/tinyware/ns/README b/release/picobsd/tinyware/ns/README
index 07cb5bd43c03..9d68b0b26d94 100644
--- a/release/picobsd/tinyware/ns/README
+++ b/release/picobsd/tinyware/ns/README
@@ -38,6 +38,6 @@ Bugs
to be small, right? :-)
Andrzej Bialecki
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.2 1998/09/07 06:41:14 abial Exp $
+$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
diff --git a/release/picobsd/tinyware/oinit/README b/release/picobsd/tinyware/oinit/README
index a295f499d6c4..e14b0af068b9 100644
--- a/release/picobsd/tinyware/oinit/README
+++ b/release/picobsd/tinyware/oinit/README
@@ -118,6 +118,6 @@ Credits
The overall framework was taken from FreeBSD /sbin/init.
Andrzej Bialecki
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.5 1998/08/11 06:53:47 abial Exp $
diff --git a/release/picobsd/tinyware/oinit/oinit.c b/release/picobsd/tinyware/oinit/oinit.c
index 1bf70bdaf343..01f8b9741e5b 100644
--- a/release/picobsd/tinyware/oinit/oinit.c
+++ b/release/picobsd/tinyware/oinit/oinit.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: oinit.c,v 1.2 1998/10/15 21:40:07 abial Exp $
+ * $Id: oinit.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
*/
/*
@@ -83,7 +83,7 @@ extern char **environ;
/* Struct for holding session state */
struct sess {
- char tty[16]; /* vty device path */
+ char tty[11]; /* vty device path */
pid_t pid; /* pid of process running on it */
int (*func)(int argc, char **argv);
/* internal function to run on it (after forking) */
@@ -646,16 +646,6 @@ runcom()
void
runcom(char *fname)
{
- int fd;
-
- close(0);
- close(1);
- close(2);
- fd=open(_PATH_CONSOLE,O_RDWR);
- dup2(fd,0);
- dup2(fd,1);
- dup2(fd,2);
- if(fd>2) close(fd);
sourcer(fname);
}
#endif
@@ -912,13 +902,9 @@ main(int argc, char **argv)
mount("devfs","/dev",MNT_NOEXEC|MNT_RDONLY,0);
/* Fill in the sess structures. */
- /* XXX Really, should be filled based upon config file. */
+ /* XXX Really, should be filled basing on config file. */
for(i=0;i<MAX_CONS;i++) {
- if(i==0) {
- sprintf(ttys[i].tty,"/dev/console");
- } else {
- sprintf(ttys[i].tty,"/dev/ttyv%c",vty[i]);
- }
+ sprintf(ttys[i].tty,"/dev/ttyv%c",vty[i]);
ttys[i].pid=0;
ttys[i].func=shell;
}
diff --git a/release/picobsd/tinyware/simple_httpd/Makefile b/release/picobsd/tinyware/simple_httpd/Makefile
index 10ea6df7be54..20b9ed4c3ee2 100644
--- a/release/picobsd/tinyware/simple_httpd/Makefile
+++ b/release/picobsd/tinyware/simple_httpd/Makefile
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.1 1998/08/31 13:10:25 abial Exp $
+# $Id$
#
-PROG=simple_httpd
-SRCS= simple_httpd.c
+PROG=simple_httpd.
+SRCS= simple_httpd..c
NOMAN=yes
.include <bsd.prog.mk>
diff --git a/release/picobsd/tinyware/simple_httpd/simple_httpd.c b/release/picobsd/tinyware/simple_httpd/simple_httpd.c
index 5b02244e4de9..0a83f6737815 100644
--- a/release/picobsd/tinyware/simple_httpd/simple_httpd.c
+++ b/release/picobsd/tinyware/simple_httpd/simple_httpd.c
@@ -13,7 +13,7 @@
*/
/*
- * $Id: simple_httpd.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+ * $Id: simple_httpd.c,v 1.1 1998/08/19 16:24:06 abial Exp $
*/
#include <stdio.h>
@@ -31,7 +31,6 @@
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
-#define LOGDIR "/var/log"
int http_sock, con_sock;
int http_port = 80;
@@ -130,7 +129,7 @@ traite_req()
strcat(logfile,"/");
strcat(logfile,"jhttp.log");
}
- else strcpy(logfile, LOGDIR "/jhttpd.log");
+ else strcpy(logfile,"/usr/adm/jhttpd.log");
if ( access(logfile,W_OK))
{
@@ -350,9 +349,8 @@ char *adate()
struct tm *t;
time(&now);
t = localtime(&now);
-
- sprintf(out, "%4d/%02d/%02d %02d:%02d:%02d",
- t->tm_year+1900, t->tm_mon+1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec );
+ sprintf(out, "%02d:%02d:%02d %02d/%02d/%02d",
+ t->tm_hour, t->tm_min, t->tm_sec,
+ t->tm_mday, t->tm_mon+1, t->tm_year );
return out;
}
diff --git a/release/picobsd/tinyware/sps/README b/release/picobsd/tinyware/sps/README
index 771ddaaf88df..94098e7e3f2e 100644
--- a/release/picobsd/tinyware/sps/README
+++ b/release/picobsd/tinyware/sps/README
@@ -12,6 +12,6 @@ The most serious limitation of 'sps' is that it's unable to retrieve the whole
command line.
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.1 1998/07/16 23:21:59 abial Exp $
diff --git a/release/picobsd/tinyware/view/README b/release/picobsd/tinyware/view/README
index 1a2c611b6727..53ec9a017c3a 100644
--- a/release/picobsd/tinyware/view/README
+++ b/release/picobsd/tinyware/view/README
@@ -81,6 +81,6 @@ Have fun!
Andrzej Bialecki
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.2 1998/08/19 06:19:44 abial Exp $
diff --git a/release/picobsd/tinyware/view/view.c b/release/picobsd/tinyware/view/view.c
index 0255a6b5bec1..0c2ad2645914 100644
--- a/release/picobsd/tinyware/view/view.c
+++ b/release/picobsd/tinyware/view/view.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: view.c,v 1.2 1998/10/09 12:42:56 abial Exp $
+ * $Id: view.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
*/
/*
@@ -88,7 +88,6 @@ int max_screen_colors=15;
int quit,changed;
char **pres;
int nimg=0;
-int auto_chg=0;
int cur_img=0;
char act;
FILE *log;
@@ -402,7 +401,6 @@ int
kbd_action(int x, int y, char key)
{
changed=0;
- if(key!='n') auto_chg=0;
switch(key) {
case 'q':
quit=1;
@@ -442,23 +440,15 @@ kbd_action(int x, int y, char key)
break;
case '\n':
case 'n':
- if(nimg>0) {
- if(cur_img<nimg-1) {
- cur_img++;
- } else {
- cur_img=0;
- }
+ if((nimg>0) && (cur_img<nimg-1)) {
+ cur_img++;
png_load(pres[cur_img]);
changed++;
}
break;
case 'p':
- if(nimg>0) {
- if(cur_img>0) {
- cur_img--;
- } else {
- cur_img=nimg-1;
- }
+ if((nimg>0) && (cur_img>0)) {
+ cur_img--;
png_load(pres[cur_img]);
changed++;
}
@@ -519,6 +509,7 @@ main(int argc, char *argv[])
fprintf(log,"VGL initialised\n");
#endif
VGLSavePalette();
+ VGLMouseInit(VGL_MOUSEHIDE);
if(argc>optind) {
res=png_load(argv[optind]);
} else {
@@ -533,14 +524,10 @@ main(int argc, char *argv[])
fprintf(log,"Trying script %s\n",argv[optind]);
#endif
fgets(buf,99,fsc);
- buf[strlen(buf)-1]='\0';
- if(strncmp("VIEW SCRIPT",buf,11)!=NULL) {
+ if(strcmp("VIEW SCRIPT\n",buf)!=NULL) {
VGLEnd();
usage();
}
- if(strlen(buf)>12) {
- auto_chg=atoi(buf+12);
- }
fgets(buf,99,fsc);
buf[strlen(buf)-1]='\0';
nimg=atoi(buf);
@@ -561,7 +548,6 @@ main(int argc, char *argv[])
#endif
png_load(pres[cur_img]);
}
- VGLMouseInit(VGL_MOUSEHIDE);
/* Prepare the keyboard */
tcgetattr(0,&t_old);
memcpy(&t_new,&t_old,sizeof(struct termios));
@@ -596,12 +582,7 @@ main(int argc, char *argv[])
display(&pic,pal_red,pal_green,pal_blue,&a);
changed=0;
}
- if(auto_chg) {
- sleep(auto_chg);
- kbd_action(x,y,'n');
- } else {
- pause();
- }
+ pause();
VGLMouseStatus(&x,&y,&buttons);
if(buttons & MOUSE_BUTTON3DOWN) {
#ifdef DEBUG
diff --git a/release/picobsd/tinyware/vm/README b/release/picobsd/tinyware/vm/README
index e4d72c1a17d0..ec70bc2cfd1d 100644
--- a/release/picobsd/tinyware/vm/README
+++ b/release/picobsd/tinyware/vm/README
@@ -5,6 +5,6 @@ current memory utilisation. The same info is available via sysctl(8) program,
but unfortunately this particular variable doesn't have its handler, and
consequently it is not displayed in stock version of sysctl(8).
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.1.1.1 1998/07/14 07:30:54 abial Exp $
diff --git a/release/picobsd/tinyware/vm/vm.c b/release/picobsd/tinyware/vm/vm.c
index cd744952f76f..710cfb971532 100644
--- a/release/picobsd/tinyware/vm/vm.c
+++ b/release/picobsd/tinyware/vm/vm.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+ * $Id: vm.c,v 1.1.1.1 1998/07/14 07:30:54 abial Exp $
*/
#include <stdio.h>
@@ -32,8 +32,6 @@
#include <sys/vmmeter.h>
#include <vm/vm_param.h>
-#define pgtok(a) ((a) * (u_int) DEFAULT_PAGE_SIZE >> 10)
-
int
main(int argc, char *argv[])
{
@@ -46,17 +44,14 @@ main(int argc, char *argv[])
for(;;) {
sysctl(mib,2,&v,&len,NULL,0);
if(i==0) {
- printf(" procs kB virt mem real mem shared vm shared real free\n");
- printf(" r w l s tot act tot act tot act tot act\n");
+ printf(" procs kB virt mem real mem shared vm shared real free\n");
+ printf(" r d p s tot act tot act tot act tot act\n");
}
- printf("%2hu%2hu%2hu%2hu",v.t_rq-1,v.t_dw+v.t_pw,v.t_sl,v.t_sw);
- printf("%7ld %7ld %7ld%7ld",
- (long)pgtok(v.t_vm),(long)pgtok(v.t_avm),
- (long)pgtok(v.t_rm),(long)pgtok(v.t_arm));
- printf("%7ld%7ld%7ld%7ld%7ld\n",
- (long)pgtok(v.t_vmshr),(long)pgtok(v.t_avmshr),
- (long)pgtok(v.t_rmshr),(long)pgtok(v.t_armshr),
- (long)pgtok(v.t_free));
+ printf("%2hu%2hu%2hu%2hu",v.t_rq,v.t_dw,v.t_pw,v.t_sl);
+ printf("%7u%7u%7u%7u",
+ v.t_vm<<2,v.t_avm<<2,v.t_rm<<2,v.t_arm<<2);
+ printf("%7u%7u%7u%7u%7u\n",
+ v.t_vmshr<<2,v.t_avmshr<<2,v.t_rmshr<<2,v.t_armshr<<2,v.t_free<<2);
sleep(5);
i++;
if(i>22) i=0;
diff --git a/release/picobsd/tools/daemon/README b/release/picobsd/tools/daemon/README
index 5de11b962eba..596e6cafdb0c 100644
--- a/release/picobsd/tools/daemon/README
+++ b/release/picobsd/tools/daemon/README
@@ -2,6 +2,6 @@ This is a little toy, which implants a color logo of PicoBSD into a file.
Documentation: UTSL.
-<abial@freebsd.org>
+<abial@nask.pl>
-$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+$Id: README,v 1.1.1.1 1998/07/14 07:30:40 abial Exp $
diff --git a/release/picobsd/tools/dumpnlist/Makefile b/release/picobsd/tools/dumpnlist/Makefile
new file mode 100644
index 000000000000..fe5706e1610a
--- /dev/null
+++ b/release/picobsd/tools/dumpnlist/Makefile
@@ -0,0 +1,9 @@
+# $Id: Makefile,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
+#
+PROG=dumpnlist
+NOMAN=yes
+.PATH: ${.CURDIR}/../../..
+
+.include <bsd.prog.mk>
+
+
diff --git a/release/scripts/doFS.sh b/release/scripts/doFS.sh
deleted file mode 100644
index 0a63deee3a94..000000000000
--- a/release/scripts/doFS.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-:
-#set -ex
-
-if [ "x$VNDEVICE" = "x" ] ; then
- VNDEVICE=vn0
-fi
-export BLOCKSIZE=512
-
-if [ "$1" = "-s" ]; then
- do_size="yes"; shift
-else
- do_size=""
-fi
-
-FSIMG=$1; shift
-RD=$1 ; shift
-MNT=$1 ; shift
-FSSIZE=$1 ; shift
-FSPROTO=$1 ; shift
-FSINODE=$1 ; shift
-FSLABEL=$1 ; shift
-
-deadlock=20
-
-while true
-do
- rm -f ${FSIMG}
-
- if [ ! -b /dev/${VNDEVICE} -o ! -c /dev/r${VNDEVICE} ] ; then
- ( cd /dev && sh MAKEDEV ${VNDEVICE} )
- fi
-
- umount /dev/${VNDEVICE} 2>/dev/null || true
-
- umount ${MNT} 2>/dev/null || true
-
- vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
-
- dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
- # this suppresses the `invalid primary partition table: no magic'
- awk 'BEGIN {printf "%c%c", 85, 170}' |\
- dd of=${FSIMG} obs=1 seek=510 conv=notrunc 2>/dev/null
-
- vnconfig -s labels -c /dev/r${VNDEVICE} ${FSIMG}
- disklabel -Brw /dev/r${VNDEVICE} ${FSLABEL}
- newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T ${FSLABEL} -o space /dev/r${VNDEVICE}c
-
- mount /dev/${VNDEVICE}c ${MNT}
-
- if [ -d ${FSPROTO} ]; then
- (set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT})
- else
- cp -p ${FSPROTO} ${MNT}
- fi
-
- df -ki ${MNT}
-
- set `df -ki ${MNT} | tail -1`
-
- umount ${MNT}
- vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
-
- echo ">>> Filesystem is ${FSSIZE} K, $4 left"
- echo ">>> ${FSINODE} bytes/inode, $7 left"
- if [ "${do_size}" ]; then
- echo ${FSSIZE} > ${FSIMG}.size
- fi
- break;
-done
diff --git a/release/scripts/dokern.sh b/release/scripts/dokern.sh
deleted file mode 100755
index ac20226d1249..000000000000
--- a/release/scripts/dokern.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-# From the kernel config file on stdin (usually GENERIC), pare out items as
-# determined by whether or not the kernel is being prepared to contain
-# an MFS ($1 = YES) or will have the floppy image all to itself ($1 = NO or
-# not specified).
-
-if [ $# -lt 1 ]; then
- MFS=NO
-else
- MFS=$1
-fi
-
-if [ "$MFS" = "YES" ]; then
- sed -e '/pty/d' \
- -e '/wfd0/d' \
- -e '/mcd0/d' \
- -e '/matcd0/d' \
- -e '/scd0/d' \
- -e '/wt0/d' \
- -e '/pass0/d' \
- -e '/apm0/d' \
- -e '/ft0/d' \
- -e '/ppp/d' \
- -e '/gzip/d' \
- -e '/isp0/d' \
- -e '/NFS/d' \
- -e '/PROCFS/d' \
- -e '/SYSVSHM/d' \
- -e '/KTRACE/d' \
- -e '/MATH_EMULATE/d' \
- -e 's/GENERIC/BOOTMFS/g' \
- -e '/maxusers/s/32/4/'
-else
- sed -e '/pty/d' \
- -e '/pass0/d' \
- -e '/apm0/d' \
- -e '/ppp/d' \
- -e '/gzip/d' \
- -e '/PROCFS/d' \
- -e '/KTRACE/d' \
- -e 's/GENERIC/BOOTMFS/g'
-fi
-echo "options NFS_NOSERVER"
-echo 'options "MAXCONS=4"'
-echo "options SCSI_NO_OP_STRINGS"
-echo "options SCSI_NO_SENSE_STRINGS"
-echo "options NO_LKM"
-echo "options NO_SWAPPING"
diff --git a/release/scripts/src-install.sh b/release/scripts/src-install.sh
index 2ed098fc52e0..f31b68cc1424 100755
--- a/release/scripts/src-install.sh
+++ b/release/scripts/src-install.sh
@@ -8,15 +8,15 @@ if [ $# -lt 1 ]; then
echo "You must specify which components of src to extract"
echo "possible subcomponents are:"
echo
- echo "base bin contrib etc games gnu include lib libexec"
- echo "release sbin share sys ubin usbin"
+ echo "base bin contrib etc games gnu include lib libexec lkm"
+ echo "release sbin share smailcf sys ubin usbin"
echo
echo "You may also specify all to extract all subcomponents."
exit 1
fi
if [ "$1" = "all" ]; then
- dists="base bin contrib etc games gnu include lib libexec release sbin share sys ubin usbin"
+ dists="base bin contrib etc games gnu include lib libexec lkm release sbin share smailcf sys ubin usbin"
else
dists="$*"
fi
diff --git a/release/scripts/tar.sh b/release/scripts/tar.sh
deleted file mode 100644
index 45b96e97bf57..000000000000
--- a/release/scripts/tar.sh
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/sh -p
-#
-# Simple replacement for tar(1), using cpio(1).
-#
-# Copyright (c) 1996 Joerg Wunsch
-# 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 DEVELOPERS ``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 DEVELOPERS 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.
-#
-
-#
-# For use on the fixit floppy. External programs required:
-# cpio(1), find(1), test(1)
-#
-
-#
-# $Id: tar.sh,v 1.3 1997/02/22 14:10:30 peter Exp $
-#
-
-archive=${TAPE:-/dev/rst0}
-blocksize="20"
-device=""
-mode="none"
-verbose=""
-
-usage()
-{
- echo "usage: tar -{c|t|x} [-v] [-b blocksize] [-f archive] [files...]" 1>&2
- exit 64 # EX_USAGE
-}
-
-#
-# Prepend a hyphen to the first arg if necessary, so the traditional form
-# ``tar xvf /dev/foobar'' will work, too. More kludgy legacy forms are not
-# supported however.
-#
-
-if [ $# -lt 1 ] ; then
- usage
-fi
-
-case "$1" in
- -*) break
- ;;
- *) tmp="$1"
- shift
- set -- -$tmp "$@"
- ;;
-esac
-
-while getopts "ctxvb:f:" option
-do
- case $option in
- [ctx])
- if [ $mode = "none" ] ; then
- mode=$option
- else
- usage
- fi
- ;;
- v)
- verbose="-v"
- ;;
- b)
- blocksize="${OPTARG}"
- ;;
- f)
- archive="${OPTARG## }"
- ;;
- *)
- usage
- ;;
- esac
-done
-
-shift $(($OPTIND - 1))
-
-if [ "X${archive}" != "X-" ] ; then
- device="-F ${archive}"
-# else: use stdin or stdout, which is the default for cpio
-fi
-
-case $mode in
- none)
- usage
- ;;
- t)
- exec cpio -it $verbose $device --block-size="$blocksize" "$@"
- ;;
- x)
- exec cpio -idmu $verbose $device --block-size="$blocksize" "$@"
- ;;
- c)
- if [ $# -eq 0 ] ; then
- # use current dir -- slightly bogus
- set -- "."
- fi
- find "$@" -print |\
- cpio -o -H ustar $verbose $device --block-size="$blocksize"
- exit $?
- ;;
-esac
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile
index 10e0d6aab066..a252c166d07c 100644
--- a/release/sysinstall/Makefile
+++ b/release/sysinstall/Makefile
@@ -9,17 +9,18 @@ CLEANFILES+= keymap.tmp keymap.h
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
-SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \
+SRCS= anonFTP.c cdrom.c command.c config.c devices.c \
disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \
ftp.c globals.c index.c install.c installUpgrade.c keymap.c \
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
msg.c network.c nfs.c options.c package.c register.c system.c \
tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
+ uc_eisa.c uc_isa.c uc_kmem.c uc_list.c uc_main.c uc_pci.c \
keymap.h
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
CFLAGS+= -I${.CURDIR}/../../sys
-CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS
+CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG # -DDO_SCSI
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO}
LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -lftpio
diff --git a/release/sysinstall/cdrom.c b/release/sysinstall/cdrom.c
index 011520211dbf..1fd1380bc11b 100644
--- a/release/sysinstall/cdrom.c
+++ b/release/sysinstall/cdrom.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: cdrom.c,v 1.44 1998/12/22 12:31:24 jkh Exp $
+ * $Id: cdrom.c,v 1.42 1998/08/27 00:50:14 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,7 +54,6 @@
#undef CD9660
static Boolean cdromMounted;
-static char mountpoint[] = "/dist";
static properties
read_props(char *name)
@@ -75,7 +74,7 @@ mediaInitCDROM(Device *dev)
{
struct iso_args args;
properties cd_attr = NULL;
- char *cp = NULL;
+ char *cp = NULL, *mountpoint = "/dist";
Boolean readInfo = TRUE;
static Boolean bogusCDOK = FALSE;
@@ -83,6 +82,7 @@ mediaInitCDROM(Device *dev)
return TRUE;
Mkdir(mountpoint);
+
bzero(&args, sizeof(args));
args.fspec = dev->devname;
args.flags = 0;
@@ -95,8 +95,10 @@ mediaInitCDROM(Device *dev)
msgConfirm("Error mounting %s on %s: %s (%u)", dev->devname, mountpoint, strerror(errno), errno);
return FALSE;
}
+ cdromMounted = TRUE;
}
- cdromMounted = TRUE;
+ else
+ cdromMounted = TRUE;
if (!file_readable(string_concat(mountpoint, "/cdrom.inf")) && !bogusCDOK) {
if (msgYesNo("Warning: The CD currently in the drive is either not a FreeBSD\n"
@@ -141,6 +143,7 @@ mediaInitCDROM(Device *dev)
bogusCDOK = TRUE;
}
}
+ msgDebug("Mounted FreeBSD CDROM from device %s\n", dev->devname);
properties_free(cd_attr);
return TRUE;
}
@@ -148,17 +151,35 @@ mediaInitCDROM(Device *dev)
FILE *
mediaGetCDROM(Device *dev, char *file, Boolean probe)
{
- return mediaGenericGet(mountpoint, file);
+ char buf[PATH_MAX];
+
+ if (isDebug())
+ msgDebug("Request for %s from CDROM\n", file);
+ snprintf(buf, PATH_MAX, "/dist/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/dists/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/%s", variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/dists/%s", variable_get(VAR_RELNAME), file);
+ return fopen(buf, "r");
}
void
mediaShutdownCDROM(Device *dev)
{
+ char *mountpoint = "/dist";
+
if (!cdromMounted)
return;
-
+ msgDebug("Unmounting %s from %s\n", dev->devname, mountpoint);
if (unmount(mountpoint, MNT_FORCE) != 0)
msgConfirm("Could not unmount the CDROM from %s: %s", mountpoint, strerror(errno));
- else
+ else {
+ msgDebug("Unmount of CDROM successful\n");
cdromMounted = FALSE;
+ }
}
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c
index 878a2324b2a7..9c9ca8c0eb02 100644
--- a/release/sysinstall/config.c
+++ b/release/sysinstall/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: config.c,v 1.114 1998/10/14 01:04:44 jkh Exp $
+ * $Id: config.c,v 1.113 1998/09/30 12:33:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -168,7 +168,7 @@ seq_num(Chunk *c1)
}
int
-configFstab(dialogMenuItem *self)
+configFstab(void)
{
Device **devs;
Disk *disk;
@@ -213,42 +213,49 @@ configFstab(dialogMenuItem *self)
}
chunk_list[nchunks] = 0;
chunk_sort();
-
+
fstab = fopen("/etc/fstab", "w");
if (!fstab) {
msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n"
"will be required.");
return DITEM_FAILURE;
}
-
+
check_rootdev(chunk_list, nchunks);
-
+
/* Go for the burn */
msgDebug("Generating /etc/fstab file\n");
fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n");
for (i = 0; i < nchunks; i++)
fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i]));
-
+ Mkdir("/proc");
+ fprintf(fstab, "proc\t\t\t/proc\t\tprocfs\trw\t\t0\t0\n");
+
/* Now look for the CDROMs */
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
cnt = deviceCount(devs);
-
- /* Write out the CDROM entries */
- for (i = 0; i < cnt; i++) {
+
+ /* Write the first one out as /cdrom */
+ if (cnt) {
+ if (Mkdir("/cdrom")) {
+ msgConfirm("Unable to make mount point for: /cdrom");
+ }
+ else
+ fprintf(fstab, "/dev/%s\t\t/cdrom\t\tcd9660\tro,noauto\t0\t0\n", devs[0]->name);
+ }
+
+ /* Write the others out as /cdrom<n> */
+ for (i = 1; i < cnt; i++) {
char cdname[10];
-
- sprintf(cdname, "/cdrom%s", i ? itoa(i) : "");
- if (Mkdir(cdname))
+
+ sprintf(cdname, "/cdrom%d", i);
+ if (Mkdir(cdname)) {
msgConfirm("Unable to make mount point for: %s", cdname);
+ }
else
fprintf(fstab, "/dev/%s\t\t%s\tcd9660\tro,noauto\t0\t0\n", devs[i]->name, cdname);
}
-
- /* And finally, a /proc. */
- fprintf(fstab, "proc\t\t\t/proc\t\tprocfs\trw\t\t0\t0\n");
- Mkdir("/proc");
-
fclose(fstab);
if (isDebug())
msgDebug("Wrote out /etc/fstab file\n");
@@ -257,7 +264,7 @@ configFstab(dialogMenuItem *self)
/* Do the work of sucking in a config file.
* config is the filename to read in.
- * lines is a fixed (max) sized array of char*
+ * lines is a fixed (max) sized array of char *.
* returns number of lines read. line contents
* are malloc'd and must be freed by the caller.
*/
@@ -499,7 +506,6 @@ configXEnvironment(dialogMenuItem *self)
char *config, *execfile;
char *moused;
-tryagain:
dialog_clear_norefresh();
if (!dmenuOpenSimple(&MenuXF86Config, FALSE))
return DITEM_FAILURE | DITEM_RESTORE;
@@ -532,8 +538,6 @@ tryagain:
"utility.");
dialog_clear();
systemExecute(execfile);
- if (!file_readable("/etc/XF86Config") && !msgYesNo("The XFree86 configuration process seems to have\nfailed. Would you like to try again?"))
- goto tryagain;
return DITEM_SUCCESS | DITEM_RESTORE;
}
else {
@@ -544,8 +548,8 @@ tryagain:
}
}
-int
-configResolv(dialogMenuItem *ditem)
+void
+configResolv(void)
{
FILE *fp;
char *cp, *dp, *hp;
@@ -556,7 +560,7 @@ configResolv(dialogMenuItem *ditem)
Mkdir("/etc");
fp = fopen("/etc/resolv.conf", "w");
if (!fp)
- return DITEM_FAILURE;
+ return;
if (variable_get(VAR_DOMAINNAME))
fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", cp);
@@ -571,7 +575,7 @@ skip:
/* Tack ourselves into /etc/hosts */
fp = fopen("/etc/hosts", "w");
if (!fp)
- return DITEM_FAILURE;
+ return;
/* Add an entry for localhost */
if (dp)
fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp);
@@ -593,7 +597,6 @@ skip:
fclose(fp);
if (isDebug())
msgDebug("Wrote out /etc/hosts\n");
- return DITEM_SUCCESS;
}
int
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c
index 7b7261d23b43..d687a20eb398 100644
--- a/release/sysinstall/devices.c
+++ b/release/sysinstall/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.87 1998/12/04 18:01:10 wpaul Exp $
+ * $Id: devices.c,v 1.83 1998/09/26 17:05:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -73,14 +73,11 @@ static struct _devname {
{ DEVICE_TYPE_DISK, "rda%d", "SCSI disk device", 13, 65538, 8, 16, 'c' },
{ DEVICE_TYPE_DISK, "wd%d", "IDE/ESDI/MFM/ST506 disk device", 0, 65538, 8, 16, 'b' },
{ DEVICE_TYPE_DISK, "rwd%d", "IDE/ESDI/MFM/ST506 disk device", 3, 65538, 8, 16, 'c' },
- { DEVICE_TYPE_DISK, "fla%d", "DiskOnChip2000 Flash device", 28, 65538, 8, 16, 'b' },
- { DEVICE_TYPE_DISK, "rfla%d", "DiskOnChip2000 Flash devicee", 101, 65538, 8, 16, 'c' },
{ DEVICE_TYPE_DISK, "wfd%d", "ATAPI floppy device", 1, 65538, 8, 4, 'b' },
{ DEVICE_TYPE_DISK, "rwfd%d", "ATAPI floppy device", 87, 65538, 8, 4, 'c' },
{ DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 2, 0, 64, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "wfd%d", "ATAPI floppy drive unit A", 1, 0, 8, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "worm%d", "SCSI optical disk / CDR", 23, 0, 1, 4, 'b' },
- { DEVICE_TYPE_NETWORK, "ax", "ASIX AX88140A PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" },
{ DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" },
{ DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" },
@@ -96,14 +93,9 @@ static struct _devname {
{ DEVICE_TYPE_NETWORK, "ix", "Intel Etherexpress ethernet card" },
{ DEVICE_TYPE_NETWORK, "le", "DEC EtherWorks 2 or 3 ethernet card" },
{ DEVICE_TYPE_NETWORK, "lnc", "Lance/PCnet (Isolan/Novell NE2100/NE32-VL) ethernet" },
- { DEVICE_TYPE_NETWORK, "mx", "Macronix 98713/98715/98725 PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "pn", "Lite-On 82168/82169 PNIC PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "rl", "RealTek 8129/8139 PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "tx", "SMC 9432TX ethernet card" },
{ DEVICE_TYPE_NETWORK, "tl", "Texas Instruments ThunderLAN PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "vr", "VIA VT3043/VT86C100A Rhine PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "vx", "3COM 3c590 / 3c595 ethernet card" },
- { DEVICE_TYPE_NETWORK, "wb", "Winbond W89C840F PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "xl", "3COM 3c90x / 3c90xB PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "ze", "IBM/National Semiconductor PCMCIA ethernet card" },
{ DEVICE_TYPE_NETWORK, "zp", "3Com Etherlink III PCMCIA ethernet card" },
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c
index 6c6b5019a9c7..fd2bed49b1c8 100644
--- a/release/sysinstall/disks.c
+++ b/release/sysinstall/disks.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.107 1999/01/02 07:23:37 jkh Exp $
+ * $Id: disks.c,v 1.105 1998/10/13 09:45:59 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -36,8 +36,6 @@
#include "sysinstall.h"
#include <ctype.h>
-#include <fcntl.h>
-#include <sys/stat.h>
#include <sys/disklabel.h>
/* Where we start displaying chunk information on the screen */
@@ -533,37 +531,6 @@ diskPartition(Device *dev)
restorescr(w);
}
-static u_char *
-bootalloc(char *name)
-{
- char buf[FILENAME_MAX];
- struct stat sb;
-
- snprintf(buf, sizeof buf, "/boot/%s", name);
- if (stat(buf, &sb) != -1) {
- int fd;
-
- fd = open(buf, O_RDONLY);
- if (fd != -1) {
- u_char *cp;
-
- cp = malloc(sb.st_size);
- if (read(fd, cp, sb.st_size) != sb.st_size) {
- free(cp);
- close(fd);
- msgDebug("bootalloc: couldn't read %d bytes from %s\n", sb.st_size, buf);
- return NULL;
- }
- close(fd);
- return cp;
- }
- msgDebug("bootalloc: couldn't open %s\n", buf);
- }
- else
- msgDebug("bootalloc: can't stat %s\n", buf);
- return NULL;
-}
-
static int
partitionHook(dialogMenuItem *selected)
{
@@ -672,23 +639,15 @@ diskPartitionWrite(dialogMenuItem *self)
for (i = 0; devs[i]; i++) {
Chunk *c1;
Disk *d = (Disk *)devs[i]->private;
- static u_char *boot1;
-#ifndef __alpha__
- static u_char *boot2;
-#endif
if (!devs[i]->enabled)
continue;
#ifdef __alpha__
- if (!boot1) boot1 = bootalloc("boot1");
Set_Boot_Blocks(d, boot1, NULL);
#else
- if (!boot1) boot1 = bootalloc("boot1");
- if (!boot2) boot2 = bootalloc("boot2");
Set_Boot_Blocks(d, boot1, boot2);
#endif
-
msgNotify("Writing partition information to drive %s", d->name);
if (!Fake && Write_Disk(d)) {
msgConfirm("ERROR: Unable to write data to disk %s!", d->name);
diff --git a/release/sysinstall/dispatch.c b/release/sysinstall/dispatch.c
index 5e1668a3da78..9bac849de70c 100644
--- a/release/sysinstall/dispatch.c
+++ b/release/sysinstall/dispatch.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dispatch.c,v 1.25 1998/07/18 09:41:58 jkh Exp $
+ * $Id: dispatch.c,v 1.24 1997/09/17 16:18:13 pst Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -82,8 +82,7 @@ static struct _word {
{ "installExpress", installExpress },
{ "installNovice", installNovice },
{ "installUpgrade", installUpgrade },
- { "installFixupBin", installFixupBin },
- { "installFixupXFree", installFixupXFree },
+ { "installFixup", installFixup },
{ "installFixitHoloShell", installFixitHoloShell },
{ "installFixitCDROM", installFixitCDROM },
{ "installFixitFloppy", installFixitFloppy },
diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c
index d84c6ef5331a..5c1ead205695 100644
--- a/release/sysinstall/dist.c
+++ b/release/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.131 1998/11/27 00:30:10 jkh Exp $
+ * $Id: dist.c,v 1.128 1998/10/14 11:23:48 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -77,7 +77,7 @@ static Distribution DistTable[] = {
{ "compat20", "/", &Dists, DIST_COMPAT20, NULL },
{ "compat21", "/", &Dists, DIST_COMPAT21, NULL },
{ "ports", "/usr", &Dists, DIST_PORTS, NULL },
-{ "XF86333", "/usr", &Dists, DIST_XF86, XF86DistTable },
+{ "XF86332", "/usr", &Dists, DIST_XF86, XF86DistTable },
{ NULL },
};
@@ -101,6 +101,7 @@ static Distribution SrcDistTable[] = {
{ "sinclude", "/usr/src", &SrcDists, DIST_SRC_INCLUDE, NULL },
{ "slib", "/usr/src", &SrcDists, DIST_SRC_LIB, NULL },
{ "slibexec", "/usr/src", &SrcDists, DIST_SRC_LIBEXEC, NULL },
+{ "slkm", "/usr/src", &SrcDists, DIST_SRC_LKM, NULL },
{ "srelease", "/usr/src", &SrcDists, DIST_SRC_RELEASE, NULL },
{ "sbin", "/usr/src", &SrcDists, DIST_SRC_BIN, NULL },
{ "ssbin", "/usr/src", &SrcDists, DIST_SRC_SBIN, NULL },
@@ -114,8 +115,8 @@ static Distribution SrcDistTable[] = {
/* The XFree86 distribution */
static Distribution XF86DistTable[] = {
-{ "XF86333", "/usr/X11R6", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
-{ "XF86333", "/usr/X11R6", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
+{ "XF86332", "/usr/X11R6", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
+{ "XF86332", "/usr/X11R6", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
{ "Xsrc1", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL },
{ "Xsrcctrb", "/usr/X11R6/src", &XF86Dists, DIST_XF86_CSRC, NULL },
{ "Xbin", "/usr/X11R6", &XF86Dists, DIST_XF86_BIN, NULL },
@@ -763,7 +764,7 @@ printSelected(char *buf, int selected, Distribution *me, int *col)
int
distExtractAll(dialogMenuItem *self)
{
- int old_dists, retries = 0, status = DITEM_SUCCESS;
+ int retries = 0;
char buf[512];
/* paranoia */
@@ -775,22 +776,13 @@ distExtractAll(dialogMenuItem *self)
if (!mediaVerify() || !mediaDevice->init(mediaDevice))
return DITEM_FAILURE;
- old_dists = Dists;
distVerifyFlags();
-
dialog_clear_norefresh();
msgNotify("Attempting to install all selected distributions..");
-
/* Try for 3 times around the loop, then give up. */
while (Dists && ++retries < 3)
distExtract(NULL, DistTable);
- /* Only do bin fixup if bin dist was successfully extracted */
- if ((old_dists & DIST_BIN) && !(Dists & DIST_BIN))
- status |= installFixupBin(self);
- if (old_dists & DIST_XF86)
- status |= installFixupXFree(self);
-
if (Dists) {
int col = 0;
@@ -800,7 +792,7 @@ distExtractAll(dialogMenuItem *self)
msgConfirm("Couldn't extract the following distributions. This may\n"
"be because they were not available on the installation\n"
"media you've chosen:\n\n\t%s", buf);
- status |= DITEM_RESTORE;
+ return DITEM_SUCCESS | DITEM_RESTORE;
}
- return status;
+ return DITEM_SUCCESS;
}
diff --git a/release/sysinstall/dist.h b/release/sysinstall/dist.h
index 19efb223faec..9418a5cdd013 100644
--- a/release/sysinstall/dist.h
+++ b/release/sysinstall/dist.h
@@ -43,7 +43,7 @@
#define DIST_SRC_INCLUDE 0x00020
#define DIST_SRC_LIB 0x00040
#define DIST_SRC_LIBEXEC 0x00080
-/* 0x00100 */
+#define DIST_SRC_LKM 0x00100
#define DIST_SRC_RELEASE 0x00200
#define DIST_SRC_SBIN 0x00400
#define DIST_SRC_SHARE 0x00800
diff --git a/release/sysinstall/dos.c b/release/sysinstall/dos.c
index a11122ab811d..ac021bb929f8 100644
--- a/release/sysinstall/dos.c
+++ b/release/sysinstall/dos.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: dos.c,v 1.21 1998/10/28 02:18:08 jkh Exp $
+ * $Id: dos.c,v 1.19 1998/09/08 11:44:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,26 +50,29 @@
#undef MSDOSFS
static Boolean DOSMounted;
-static char mountpoint[] = "/dist";
Boolean
mediaInitDOS(Device *dev)
{
struct msdosfs_args args;
- if (DOSMounted)
+ if (!RunningAsInit || DOSMounted)
return TRUE;
- Mkdir(mountpoint);
+ if (DITEM_STATUS(Mkdir("/dist")) != DITEM_SUCCESS)
+ return FALSE;
+
memset(&args, 0, sizeof(args));
args.fspec = dev->devname;
args.uid = args.gid = 0;
args.mask = 0777;
- if (mount("msdos", mountpoint, MNT_RDONLY, (caddr_t)&args) == -1) {
- msgConfirm("Error mounting %s on %s: %s (%u)", args.fspec, mountpoint, strerror(errno), errno);
+ if (mount("msdos", "/dist", MNT_RDONLY, (caddr_t)&args) == -1) {
+ msgConfirm("Error mounting %s on /dist: %s (%u)", args.fspec, strerror(errno), errno);
return FALSE;
}
+ else
+ msgDebug("Mounted DOS device (%s) on /dist.\n", args.fspec);
DOSMounted = TRUE;
return TRUE;
}
@@ -77,18 +80,33 @@ mediaInitDOS(Device *dev)
FILE *
mediaGetDOS(Device *dev, char *file, Boolean probe)
{
- return mediaGenericGet(mountpoint, file);
+ char buf[PATH_MAX];
+
+ if (isDebug())
+ msgDebug("Request for %s from DOS\n", file);
+ snprintf(buf, PATH_MAX, "/dist/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/dists/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/%s", variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/dists/%s", variable_get(VAR_RELNAME), file);
+ return fopen(buf, "r");
}
void
mediaShutdownDOS(Device *dev)
{
- if (!DOSMounted)
+ if (!RunningAsInit || !DOSMounted)
return;
- if (unmount(mountpoint, MNT_FORCE) != 0)
- msgConfirm("Could not unmount the DOS partition from %s: %s",
- mountpoint, strerror(errno));
- else
- DOSMounted = FALSE;
+ msgDebug("Unmounting %s from /dist\n", dev->name);
+ if (unmount("/dist", MNT_FORCE) != 0)
+ msgConfirm("Could not unmount the DOS partition: %s", strerror(errno));
+ if (isDebug())
+ msgDebug("Unmount successful\n");
+ DOSMounted = FALSE;
return;
}
diff --git a/release/sysinstall/floppy.c b/release/sysinstall/floppy.c
index 6c1ab402abe4..87974dd24404 100644
--- a/release/sysinstall/floppy.c
+++ b/release/sysinstall/floppy.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: floppy.c,v 1.30 1998/10/12 23:45:06 jkh Exp $
+ * $Id: floppy.c,v 1.29 1998/07/18 09:42:00 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -56,17 +56,18 @@
static Boolean floppyMounted;
char *distWanted;
-static char mountpoint[] = "/dist";
Boolean
mediaInitFloppy(Device *dev)
{
struct msdosfs_args dosargs;
struct ufs_args u_args;
+ char *mountpoint;
if (floppyMounted)
return TRUE;
+ mountpoint = (char *)dev->private;
if (Mkdir(mountpoint)) {
msgConfirm("Unable to make %s directory mountpoint for %s!", mountpoint, dev->devname);
return FALSE;
@@ -92,11 +93,12 @@ mediaInitFloppy(Device *dev)
if (mount("msdos", mountpoint, MNT_RDONLY, (caddr_t)&dosargs) == -1) {
if (mount("ufs", mountpoint, MNT_RDONLY, (caddr_t)&u_args) == -1) {
- msgConfirm("Error mounting floppy %s (%s) on %s : %s",
- dev->name, dev->devname, mountpoint, strerror(errno));
+ msgConfirm("Error mounting floppy %s (%s) on %s : %s", dev->name, dev->devname, mountpoint,
+ strerror(errno));
return FALSE;
}
}
+ msgDebug("initFloppy: mounted floppy %s successfully on %s\n", dev->devname, mountpoint);
floppyMounted = TRUE;
distWanted = NULL;
return TRUE;
@@ -109,12 +111,10 @@ mediaGetFloppy(Device *dev, char *file, Boolean probe)
FILE *fp;
int nretries = 5;
- /*
- * floppies don't use mediaGenericGet() because it's too expensive
- * to speculatively open files on a floppy disk. Make user get it
- * right or give up with floppies.
- */
- snprintf(buf, PATH_MAX, "%s/%s", mountpoint, file);
+ snprintf(buf, PATH_MAX, "%s/%s", (char *)dev->private, file);
+
+ if (isDebug())
+ msgDebug("Request for %s from floppy on %s, probe is %d.\n", buf, (char *)dev->private, probe);
if (!file_readable(buf)) {
if (probe)
return NULL;
@@ -138,13 +138,17 @@ mediaGetFloppy(Device *dev, char *file, Boolean probe)
void
mediaShutdownFloppy(Device *dev)
{
+ char *mountpoint = (char *)dev->private;
+
if (floppyMounted) {
if (unmount(mountpoint, MNT_FORCE) != 0)
msgDebug("Umount of floppy on %s failed: %s (%d)\n", mountpoint, strerror(errno), errno);
else {
floppyMounted = FALSE;
+ msgDebug("Floppy unmounted successfully.\n");
if (!variable_get(VAR_NONINTERACTIVE))
- msgConfirm("You may remove the floppy from %s", dev->description);
+ msgConfirm("You may remove the floppy from %s",
+ dev->description);
}
}
}
diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c
index 4f1e542e86b1..f6d6bc7fd8a2 100644
--- a/release/sysinstall/ftp.c
+++ b/release/sysinstall/ftp.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: ftp.c,v 1.35 1998/01/28 04:42:38 jkh Exp $
+ * $Id: ftp.c,v 1.34 1997/10/03 14:00:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -80,6 +80,9 @@ mediaInitFTP(Device *dev)
if (ftpInitted)
return TRUE;
+ if (isDebug())
+ msgDebug("Init routine for FTP called.\n");
+
if (OpenConn) {
fclose(OpenConn);
OpenConn = NULL;
@@ -164,6 +167,8 @@ try:
else
goto punt;
}
+ if (isDebug())
+ msgDebug("mediaInitFTP was successful (logged in and chdir'd)\n");
ftpInitted = TRUE;
return TRUE;
@@ -216,7 +221,7 @@ mediaGetFTP(Device *dev, char *file, Boolean probe)
/* Try some alternatives */
switch (nretries++) {
case 1:
- sprintf(buf, "releases/%s", file);
+ sprintf(buf, "dists/%s", file);
try = buf;
break;
@@ -226,7 +231,7 @@ mediaGetFTP(Device *dev, char *file, Boolean probe)
break;
case 3:
- sprintf(buf, "%s/releases/%s", variable_get(VAR_RELNAME), file);
+ sprintf(buf, "%s/dists/%s", variable_get(VAR_RELNAME), file);
try = buf;
break;
@@ -245,6 +250,7 @@ mediaShutdownFTP(Device *dev)
if (!ftpInitted)
return;
+ msgDebug("FTP shutdown called. OpenConn = %x\n", OpenConn);
if (OpenConn != NULL) {
fclose(OpenConn);
OpenConn = NULL;
diff --git a/release/texts/XFREE86.TXT b/release/sysinstall/help/XF86.hlp
index 4757fb079c26..4757fb079c26 100644
--- a/release/texts/XFREE86.TXT
+++ b/release/sysinstall/help/XF86.hlp
diff --git a/release/sysinstall/help/hardware.hlp b/release/sysinstall/help/hardware.hlp
new file mode 100644
index 000000000000..690a5f18bf62
--- /dev/null
+++ b/release/sysinstall/help/hardware.hlp
@@ -0,0 +1,513 @@
+Table of Contents
+-----------------
+0. Document Conventions
+1. Default Configuration (GENERIC kernel)
+2. Using UserConfig to change FreeBSD kernel settings
+3. LINT - other possible configurations
+4. Supported Hardware
+
+See TROUBLE.TXT for Q&A on known hardware problems.
+
+=========================================================================
+
+0. Document Conventions
+-- --------------------
+
+We have `underlined' text which represents user input with `-' symbols
+throughout this document to differentiate it from the machine output.
+
+1. Default (GENERIC) Configuration
+-- -------------------------------
+
+The following table contains a list of all of the devices that are
+present in the GENERIC kernel. This is the essential part of the
+operating system that is placed in your root partition during the
+installation process. A compressed version of the GENERIC kernel is
+also used on the installation floppy diskette and DOS boot image.
+
+The table describes the various parameters used by the driver to
+communicate with the hardware in your system. There are four
+parameters in the table, though not all are used by each and every
+device:
+
+ Port The starting I/O port used by the device, shown in hexadecimal.
+
+ IOMem The lowest (or starting) memory address used by the device,
+ also shown in hexadecimal.
+
+ IRQ The interrupt the device uses to alert the driver to an event,
+ given in decimal.
+
+ DRQ The DMA (direct memory access) channel the device uses to move
+ data to and from main memory, also given in decimal.
+
+If an entry in the table has `n/a' for a value then it means that the
+parameter in question does not apply to that device. A value of `dyn'
+means that the correct value should be determined automatically by the
+kernel when the system boots and that you don't need to worry about
+it.
+
+If an entry is marked with an *, it means that support is currently
+not available for it but should be back as soon as someone converts
+the driver to work within the new 3.0 framework.
+
+FreeBSD GENERIC kernel:
+
+ Port IRQ DRQ IOMem Description
+ ---- --- --- ----- ---------------------------------
+fdc0 3f0 6 2 n/a Floppy disk controller
+wdc0 1f0 14 n/a n/a IDE/MFM/RLL disk controller
+wdc1 170 15 n/a n/a IDE/MFM/RLL disk controller
+
+adv0 n/a n/a n/a n/a AdvanSys ADP-9xx SCSI controller
+ncr0 n/a n/a n/a n/a NCR PCI SCSI controller
+bt0 330 dyn dyn dyn Buslogic SCSI controller
+uha0 330 dyn 6 dyn Ultrastore 14f
+aha0 330 dyn 5 dyn Adaptec 154x/1535 SCSI controller
+ahb0 dyn dyn dyn dyn Adaptec 174x SCSI controller
+ahc0 dyn dyn dyn dyn Adaptec 274x/284x/294x SCSI controller
+aic0* 340 11 dyn dyn Adaptec 152x/AIC-6360 SCSI
+ controller
+amd0 n/a n/a n/a n/a Tekram DC-390(T) / AMD 53c974 PCI SCSI
+dpt n/a n/a n/a n/a DPT RAID SCSI controllers.
+nca0* 1f88 10 dyn dyn ProAudioSpectrum cards
+sea0* dyn 5 dyn c8000 Seagate ST01/02 8 bit controller
+
+wt0 300 5 1 dyn Wangtek and Archive QIC-02/QIC-36
+
+psm0 60 12 n/a n/a PS/2 Mouse
+
+mcd0 300 10 n/a n/a Mitsumi CD-ROM
+matcd0 230 n/a n/a n/a Matsushita/Panasonic CD-ROM
+scd0 230 n/a n/a n/a Sony CD-ROM
+
+sio0 3f8 4 n/a n/a Serial Port 0 (COM1)
+sio1 2f8 3 n/a n/a Serial Port 1 (COM2)
+
+lpt0 dyn 7 n/a n/a Printer Port 0
+lpt1 dyn dyn n/a n/a Printer Port 1
+
+de0 n/a n/a n/a n/a DEC DC21x40 PCI based cards
+ (including 21140 100bT cards)
+ed0 280 10 dyn d8000 WD & SMC 80xx; Novell NE1000 &
+ NE2000; 3Com 3C503; HP PC Lan+
+eg0 310 5 dyn dyn 3Com 3C505
+ep0 300 10 dyn dyn 3Com 3C509
+ex0 dyn dyn dyn n/a Intel EtherExpress Pro/10 cards
+fe0 300 dyn n/a n/a Allied-Telesis AT1700, RE2000 and
+ Fujitsu FMV-180 series cards.
+fxp0 dyn dyn n/a dyn Intel EtherExpress Pro/100B
+tl0 dyn dyn n/a dyn TI TNET100 'ThunderLAN' cards.
+ie0 300 10 dyn d0000 AT&T StarLAN 10 and EN100;
+ 3Com 3C507; NI5210
+ix0 300 10 dyn d0000 Intel EtherExpress cards
+ex0 dyn dyn dyn dyn Intel EtherExpress Pro/10 cards
+le0 300 5 dyn d0000 Digital Equipment EtherWorks
+ 2 and EtherWorks 3
+lnc0 280 10 n/a dyn Lance/PCnet cards
+ (Isolan, Novell NE2100, NE32-VL,
+ some PCnet-PCI cards)
+vx0 dyn dyn n/a dyn 3Com 3c59x ((Fast) Etherlink III)
+xl0 dyn dyn n/a dyn 3Com 3c900, 3c905 and 3c905B
+ ((Fast) Etherlink XL)
+cs0 0x300 dyn n/a n/a Crystal Semiconductor CS89x0-based
+ cards.
+ze0 300 5 n/a d8000 IBM/National Semiconductor
+ PCMCIA Ethernet Controller
+zp0 300 10 n/a d8000 3Com 3c589 Etherlink III
+ PCMCIA Ethernet Controller
+--- End of table ---
+
+
+If the hardware in your computer is not set to the same settings as
+those shown in the table and the item in conflict is not marked 'dyn',
+you will have to either reconfigure your hardware or use UserConfig
+to reconfigure the kernel to match the way your hardware is currently set
+(see the next section).
+
+If the settings do not match, the kernel may be unable to locate
+or reliably access the devices in your system.
+
+
+2. Using UserConfig to change FreeBSD kernel settings
+-- --------------------------------------------------
+
+The FreeBSD kernel on the install floppy contains drivers for every
+piece of hardware that could conceivably be used to install the rest
+of the system with. Unfortunately, PC hardware being what it is, some
+of these devices can be difficult to detect accurately, and for some,
+the process of detecting another can cause irreversible confusion.
+
+To make this process easier, FreeBSD provides UserConfig. With this
+UserConfig, the user can configure and disable device drivers before
+the kernel is loaded, avoiding potential conflicts, and eliminating
+the need to reconfigure hardware to suit the default driver settings.
+
+Once FreeBSD is installed, it will remember the changes made using
+UserConfig, so that they only need be made once.
+
+It is important to disable drivers that are not relevant to a system
+in order to minimize the possibility of interference, which can cause
+problems that are difficult to track down.
+
+UserConfig features a command line interface for users with serial
+consoles or a need to type commands, and a full screen 'visual'
+interface, which provides point-and-shoot configuration functionality.
+
+Here is a sample UserConfig screen shot in 'visual' mode:
+
+---Active Drivers---------------------------10 Conflicts------Dev---IRQ--Port--
+ Storage : (Collapsed)
+ Network :
+ NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters CONF ed0 5 0x280
+ NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters CONF ed1 5 0x300
+ Communications : (Collapsed)
+ Input : (Collapsed)
+ Multimedia :
+---Inactive Drivers-------------------------------------------Dev--------------
+ Storage :
+ Network : (Collapsed)
+ Communications :
+ Input :
+ Multimedia :
+ PCI :
+
+---Parameters-for-device-ed0---------------------------------------------------
+ Port address : 0x280 Memory address : 0xd8000
+ IRQ number : 5 Memory size : 0x2000
+ Flags : 0x0000
+-------------------------------------------------------------------------------
+ IO Port address (Hexadecimal, 0x1-0x2000)
+ [TAB] Change fields [Q] Save device parameters
+
+
+ The screen is divided into four sections :
+
+ - Active Drivers. Listed here are the device drivers that are currently
+ enabled, and their basic parameters.
+ - Inactive Drivers. These drivers are present, but are disabled.
+ - Parameter edit field. This area is used for editing driver parameters.
+ - Help area. Keystroke help is displayed here.
+
+One of the Active and Inactive lists is always in use, and the current
+entry in the list will be shown with a highlight bar. If there are
+more entries in a list than can be shown, it will scroll. The bar can
+be moved up and down using the cursor keys, and moved between lists
+with the TAB key.
+
+Drivers in the Active list may be marked "CONF". This indicates that
+one or more of their parameters conflicts with another device, and
+indicates a potential for problems. The total number of conflicts is
+displayed at the top of the screen.
+
+As a general rule, conflicts should be avoided, either by disabling
+conflicting devices that are not present in the system, or by altering
+their configuration so that they match the installed hardware.
+
+In the list areas, drivers are grouped by their basic function.
+Groups can be 'Collapsed' to simplify the display (this is the default
+state for all groups). If a group is collapsed, it will be shown with
+'(Collapsed)' in the list, as above. To Expand a Collapsed group,
+position the highlight bar over the group heading and press Enter. To
+Collapse it again, repeat the process.
+
+When a device driver in the Active list is highlighted, its full
+parameters are displayed in the Parameter edit area. Note that not
+all drivers use all possible parameters, and some hardware supported
+by drivers may not use all the parameters the driver supports.
+
+To disable a driver, go to the Active list, Expand the group it is in,
+highlight the driver and press Del. The driver will move to its group
+in the Inactive list. (If the group is collapsed or off the screen,
+you may not see the driver in its new location.)
+
+To enable a driver, go to the Inactive list, Expand the group it is
+in, highlight the driver and press Enter. The highlight will move to
+the Active list, and the driver you have just enabled will be
+highlighted, ready to be configured.
+
+To configure a driver, go to the Active list, Expand the group it is
+in, highlight the driver and press Enter. The cursor will move to the
+Parameter edit area, and the device's parameters may be edited.
+
+While editing parameters, the TAB and cursor keys can be used to move
+between fields. Most numeric values (except IRQ) are entered in
+hexadecimal, as indicated by the '0x' at the beginning of the field.
+The allowable values for a given field are show in the Key Help area
+when the field is active.
+
+To finish configuring a driver, press 'Q'.
+
+Note that PCI and EISA devices can be probed reliably, therefore they
+are not shown in the table above nor can their settings be changed
+using UserConfig. PCI drivers may be seen in the "PCI Devices" section
+in the Active Devices list, if you wish to check for their presence.
+
+
+3. LINT - other possible configurations
+-- ------------------------------------
+
+The following drivers are not in the GENERIC kernel but remain
+available to those who do not mind compiling a custom kernel (see
+section 6 of FreeBSD.FAQ). The LINT configuration file
+(/sys/i386/conf/LINT) also contains prototype entries for just about
+every device supported by FreeBSD and is a good general reference.
+
+The device names and a short description of each are listed below. The port
+numbers, etc, are not meaningful here since you will need to compile a
+custom kernel to gain access to these devices anyway and can thus
+adjust the addresses to match the hardware in your computer in the process.
+The LINT file contains prototype entries for all of the below which you
+can easily cut-and-paste into your own file (or simply copy LINT and edit
+it to taste):
+
+ctx: Cortex-I frame grabber
+cx: Cronyx/Sigma multiport sync/async
+cy: Cyclades high-speed serial driver
+el: 3Com 3C501
+fea: DEV DEFEA EISA FDDI adapter
+fpa: DEC DEFPA PCI FDDI adapter
+gp: National Instruments AT-GPIB and AT-GPIB/TNT board
+gsc: Genius GS-4500 hand scanner
+gus: Gravis Ultrasound - Ultrasound, Ultrasound 16, Ultrasound MAX
+gusxvi: Gravis Ultrasound 16-bit PCM
+hea: Efficient ENI-155p ATM PCI adapter
+hfa: FORE PCA-200E ATM PCI adapter
+joy: Joystick
+labpc: National Instrument's Lab-PC and Lab-PC+
+meteor: Matrox Meteor frame-grabber card
+bktr: Brooktree Bt848 based frame-grabber cards.
+mpu: Roland MPU-401 stand-alone card
+mse: Microsoft, Logitech, ATI bus mouse ports
+mss: Microsoft Sound System
+nic: Dr Neuhaus NICCY 3008, 3009 & 5000 ISDN cards
+opl: Yamaha OPL-2 and OPL-3 FM - SB, SB Pro, SB 16, ProAudioSpectrum
+pas: ProAudioSpectrum PCM and MIDI
+pca: PCM audio ("/dev/audio") through your PC speaker
+pcm: PCM audio on most modern ISA audio codecs
+psm: PS/2 mouse port
+rc: RISCom/8 multiport card
+sb: SoundBlaster PCM - SoundBlaster, SB Pro, SB16, ProAudioSpectrum
+sbmidi: SoundBlaster 16 MIDI interface
+sbxvi: SoundBlaster 16
+si: Specialix SI/XIO/SX (old and enhanced ISA, PCI, EISA) serial
+spigot: Creative Labs Video Spigot video-acquisition board
+uart: Stand-alone 6850 UART for MIDI
+wds: Western Digital WD7000 IDE
+
+--- end of list ---
+
+
+4. Supported Hardware
+-- ------------------
+
+FreeBSD currently runs on a wide variety of ISA, VLB, EISA and PCI bus
+based PC's, ranging from 386sx to Pentium class machines (though the
+386sx is not recommended). Support for generic IDE or ESDI drive
+configurations, various SCSI controller, network and serial cards is
+also provided.
+
+What follows is a list of all peripherals currently known to work with
+FreeBSD. Other configurations may also work, we have simply not as yet
+received confirmation of this.
+
+
+4.1. Disk Controllers
+---- ----------------
+
+WD1003 (any generic MFM/RLL)
+WD1007 (any generic IDE/ESDI)
+IDE
+ATA
+
+Adaptec 1535 ISA SCSI controllers
+Adaptec 154x series ISA SCSI controllers
+Adaptec 174x series EISA SCSI controller in standard and enhanced mode.
+Adaptec 274X/284X/2940/3940 (Narrow/Wide/Twin) series ISA/EISA/PCI SCSI
+controllers.
+Adaptec AIC7850/AIC7895 on-board SCSI controllers.
+
+Support for the following controllers is rather weak:
+Adaptec 1510 series ISA SCSI controllers (not for bootable devices)
+Adaptec 152x series ISA SCSI controllers
+Adaptec AIC-6260 and AIC-6360 based boards, which includes the AHA-152x
+and SoundBlaster SCSI cards.
+
+** Note: You cannot boot from the SoundBlaster cards as they have no
+ on-board BIOS, such being necessary for mapping the boot device into the
+ system BIOS I/O vectors. They're perfectly usable for external tapes,
+ CDROMs, etc, however. The same goes for any other AIC-6x60 based card
+ without a boot ROM. Some systems DO have a boot ROM, which is generally
+ indicated by some sort of message when the system is first powered up
+ or reset, and in such cases you *will* also be able to boot from them.
+ Check your system/board documentation for more details.
+
+
+AdvanSys (Advanced Systems) ABP510/542/5150 ISA and ABP5140/5142 ISA PnP
+cards, ABP842/852 VLB cards, and ABP920/930/930U/930UA/950/960/960U/970/970U
+PCI cards.
+
+** Note: The ADP510/5140/5150 boards were shipped by HP with the 4020i
+ CD-R drive but with NO BIOS, so these models cannot control boot devices
+ though they can be used for any secondary SCSI device. Also note that the
+ ABP5140/5142 boards were rebadged by SIIG as the "SpeedMaster i540/i542"
+
+
+Buslogic 545S & 545c
+Buslogic 445S/445c VLB SCSI controller
+Buslogic 742A, 747S, 747c EISA SCSI controller.
+Buslogic 946c PCI SCSI controller
+Buslogic 956c PCI SCSI controller
+
+SymBios (formerly NCR) 53C810, 53C825, 53c860 and 53c875 PCI SCSI
+controllers:
+ ASUS SC-200
+ Data Technology DTC3130 (all variants)
+ NCR cards (all)
+ Symbios cards (all)
+ Tekram DC390W, 390U and 390F
+ Tyan S1365
+
+Tekram DC390 and DC390T controllers (maybe other cards based on the
+AMD 53c974 as well).
+
+NCR5380/NCR53400 ("ProAudio Spectrum") SCSI controller.
+
+DTC 3290 EISA SCSI controller in 1542 emulation mode.
+
+UltraStor 14F, 24F and 34F SCSI controllers.
+
+Seagate ST01/02 SCSI controllers.
+
+Future Domain 8xx/950 series SCSI controllers.
+
+WD7000 SCSI controller.
+
+With all supported SCSI controllers, full support is provided for
+SCSI-I & SCSI-II peripherals, including Disks, tape drives (including
+DAT and 8mm Exabyte) and CD ROM drives.
+
+The following CD-ROM type systems are supported at this time:
+(cd) SCSI interface (also includes ProAudio Spectrum and
+ SoundBlaster SCSI)
+(mcd) Mitsumi proprietary interface (all models, driver is rather stale)
+(matcd) Matsushita/Panasonic (Creative SoundBlaster) proprietary
+ interface (562/563 models)
+(scd) Sony proprietary interface (all models)
+(wcd) ATAPI IDE interface.
+
+
+4.2. Network cards
+---- -------------
+
+Allied-Telesis AT1700 and RE2000 cards
+
+AMD PCnet/PCI (79c970 & 53c974 or 79c974)
+
+SMC Elite 16 WD8013 ethernet interface, and most other WD8003E,
+WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and WD8013EBT
+based clones. SMC Elite Ultra is also supported.
+
+Texas Instruments ThunderLAN PCI NICs, including the following:
+ Compaq Netelligent 10, 10/100, 10/100 Proliant, 10/100 Dual-Port
+ Compaq Netelligent 10/100 TX Embedded UTP, 10 T PCI UTP/Coax, 10/100 TX UTP
+ Compaq NetFlex 3P, 3P Integrated, 3P w/ BNC
+ Olicom OC-2135/2138, OC-2325, OC-2326 10/100 TX UTP
+
+DEC EtherWORKS III NICs (DE203, DE204, and DE205)
+DEC EtherWORKS II NICs (DE200, DE201, DE202, and DE422)
+DEC DC21040, DC21041, or DC21140 based NICs (SMC Etherpower 8432T, DE245, etc)
+DEC FDDI (DEFPA/DEFEA) NICs
+
+Efficient ENI-155p ATM PCI
+
+FORE PCA-200E ATM PCI
+
+Fujitsu MB86960A/MB86965A
+
+HP PC Lan+ cards (model numbers: 27247B and 27252A).
+
+Intel EtherExpress (not recommended due to driver instability)
+Intel EtherExpress Pro/10
+Intel EtherExpress Pro/100B PCI Fast Ethernet
+
+Isolan AT 4141-0 (16 bit)
+Isolink 4110 (8 bit)
+
+Novell NE1000, NE2000, and NE2100 ethernet interface.
+
+3Com 3C501 cards
+
+3Com 3C503 Etherlink II
+
+3Com 3c505 Etherlink/+
+
+3Com 3C507 Etherlink 16/TP
+
+3Com 3C509, 3C579, 3C589 (PCMCIA), 3C590/592/595/900/905/905B PCI and EISA
+(Fast) Etherlink III / (Fast) Etherlink XL
+
+Toshiba ethernet cards
+
+PCMCIA ethernet cards from IBM and National Semiconductor are also
+supported.
+
+Note that NO token ring cards are supported at this time as we're
+still waiting for someone to donate a driver for one of them. Any
+takers?
+
+
+4.3. Misc
+---- ----
+
+AST 4 port serial card using shared IRQ.
+
+ARNET 8 port serial card using shared IRQ.
+ARNET (now Digiboard) Sync 570/i high-speed serial.
+
+Boca BB1004 4-Port serial card (Modems NOT supported)
+Boca IOAT66 6-Port serial card (Modems supported)
+Boca BB1008 8-Port serial card (Modems NOT supported)
+Boca BB2016 16-Port serial card (Modems supported)
+
+Cyclades Cyclom-y Serial Board.
+
+STB 4 port card using shared IRQ.
+
+SDL Communications Riscom/8 Serial Board.
+SDL Communications RISCom/N2 and N2pci high-speed sync serial boards.
+
+Specialix SI/XIO/SX multiport serial cards, with both the older
+SIHOST2.x and the new "enhanced" (transputer based, aka JET) host cards.
+ISA, EISA and PCI are supported.
+
+Stallion multiport serial boards: EasyIO, EasyConnection 8/32 & 8/64,
+ONboard 4/16 and Brumby.
+
+Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound
+and Roland MPU-401 sound cards.
+
+Connectix QuickCam
+Matrox Meteor Video frame grabber
+Creative Labs Video Spigot frame grabber
+Cortex1 frame grabber
+Various Frame grabbers based on Brooktree Bt848 chip.
+
+HP4020, HP6020, Philips CDD2000/CDD2660 and Plasmon CD-R drives.
+
+Bus mice
+
+PS/2 mice
+
+Standard PC Joystick
+
+X-10 power controllers
+
+GPIB and Transputer drivers.
+
+Genius and Mustek hand scanners.
+
+Floppy tape drives (some rather old models only, driver rather stale)
+
+
+FreeBSD currently does NOT support IBM's microchannel (MCA) bus.
diff --git a/release/sysinstall/help/install.hlp b/release/sysinstall/help/install.hlp
new file mode 100644
index 000000000000..dfc1697d56b0
--- /dev/null
+++ b/release/sysinstall/help/install.hlp
@@ -0,0 +1,513 @@
++===================== Installing FreeBSD ==========================+
+| |
+| Table of Contents: |
+| |
+| 0.0 Quick Start: |
+| 0.1 Installing FreeBSD from CDROM or the Internet. |
+| |
+| 1.0 Detail on various installation types: |
+| 1.1 Installing from a network CDROM |
+| 1.2 Installing from Floppies |
+| 1.3 Installing from a DOS partition |
+| 1.4 Installing from QIC/SCSI tape |
+| 1.5 Installing over a network using NFS or FTP |
+| 1.5.1 NFS Installation tips |
+| 1.5.2 FTP Installation tips |
+| |
+| 2.0 DOS User's Q&A section. |
+| 2.1 How do I make space for FreeBSD? |
+| 2.2 Can I use compressed DOS filesystems from FreeBSD? |
+| 2.3 Can I use DOS extended partitions? |
+| 2.4 Can I run DOS executables under FreeBSD? |
+| |
++=====================================================================+
+
+Author: Jordan K. Hubbard
+Last updated: Tue Mar 24 00:56:14 PST 1998
+
+0.0 Quick Start
+--- -----------
+
+This manual documents the process of making a new installation of
+FreeBSD on your machine. If you are upgrading from a previous
+release of FreeBSD, please see the file UPGRADE.TXT for important
+information on upgrading. If you are not familiar with configuring
+PC hardware for FreeBSD, you should also read the HARDWARE.TXT file -
+it contains important information which may save you a lot of grief.
+
+If you're new to FreeBSD then you should also read EVERYTHING listed
+in the Documentation menu on the boot floppy. It may seem like a lot
+to read, but the time you spend now reading the documents will be made
+up many times over because you were adequately prepared. Also, you will
+know the types of information available should you get stuck later.
+Once the system is installed, you can also revisit this menu and use a
+WEB browser to read the installed FAQ (Frequently Asked Questions) and
+Handbook HTML documentation sets for FreeBSD. You can also use the
+browser to visit other WEB sites on the net (like http://www.freebsd.org)
+if you have an Internet connection. See ABOUT.TXT for more information
+on the resources available to you.
+
+The best laid plans sometimes go awry, so if you run into trouble take a
+look at TROUBLE.TXT which contains valuable troubleshooting information.
+
+DISCLAIMER: While FreeBSD does its best to safeguard against
+accidental loss of data, it's still more than possible to WIPE OUT
+YOUR ENTIRE DISK with this installation! Please do not proceed to the
+final FreeBSD installation menu unless you've adequately backed up any
+important data first! We really mean it!
+
+FreeBSD requires a 386 or better processor to run (sorry, there is no
+support for '286 processors), 5 megs of RAM to install and 4 megs of
+ram to run. You will need at least 80 megs of free hard drive space.
+See below for ways of shrinking existing DOS partitions in order to
+install FreeBSD.
+
+
+0.1 Installing FreeBSD from CDROM or the Internet
+--- ---------------------------------------------
+
+The easiest type of installation is from CD. If you have a supported
+CDROM drive and a FreeBSD installation CD from Walnut Creek CDROM,
+there are 3 ways of starting the installation from it:
+
+ 1. If your system supports bootable CDROM media (usually an option
+ which can be selectively enabled in the controller's setup menu
+ or in the PC BIOS for some systems) and you have it enabled,
+ FreeBSD 2.2.1 and later CDs support the "El Torrito" bootable
+ CD standard. Simply put the installation CD in your CDROM drive
+ and boot the system to begin installation.
+
+ 2. If you have drivers which allow you to see your CDROM drive
+ from from DOS, first disable any fancy memory managers you may
+ have configured, change directory to the CDROM (E:\ in the example
+ below) and then type this:
+
+ E> install
+
+ and you should boot directly into the FreeBSD installation.
+
+ If either steps fail, please go on to step 3.
+
+ 3. Build a FreeBSD boot floppy from the floppies/boot.flp
+ file in a FreeBSD distribution. Either simply use the
+ ``makeflp.bat'' script from DOS or read floppies/README.TXT
+ for more information on creating bootable floppies under
+ different operating systems. Then you simply boot
+ from the floppy and you should go into the FreeBSD
+ installation.
+
+If you don't have a CDROM and would like to simply install over the
+net using PPP, slip or a dedicated connection, simply fetch the
+<FreeBSD-release>/floppies/boot.flp file from:
+
+ ftp://ftp.freebsd.org/pub/FreeBSD
+
+or one of its many mirrors (http://www.freebsd.org/handbook/mirrors.html)
+and follow step 3 above. You should also read the floppies/README.TXT
+file as it contains important information for downloaders.
+
+Once you have a boot floppy made, please go to section 1.5 of this
+document for additional tips on installing via FTP or NFS.
+
+
+1.0 Detail on various installation types
+--- ------------------------------------
+
+Once you've gotten yourself to the initial installation screen
+somehow, you should be able to follow the various menu prompts and go
+from there. If you've never used the FreeBSD installation before, you
+are also encouraged to read some of the documentation in the the
+Documentation submenu as well as the general "Usage" instructions on
+the first menu.
+
+ REMEMBER: If you get stuck at a screen, hit F1 for the online
+ documentation for that section.
+
+If you've never installed FreeBSD before, or even if you have, the
+"Novice" installation mode is the most recommended since it makes sure
+that you'll visit all the various important checklist items along the
+way. If you're much more comfortable with the FreeBSD installation
+process and know _exactly_ what you want to do, use the Express or
+Custom installation options. If you're upgrading an existing system,
+use the Upgrade option.
+
+The FreeBSD installer supports the direct use of floppy, DOS, tape,
+CDROM, FTP, NFS and UFS partitions as installation media, further tips
+on installing from each type of media listed below.
+
+
+1.1 Installing from a network CDROM
+--- -------------------------------
+
+If you simply wish to install from a local CDROM drive then see the
+Quick Start section. If you don't have a CDROM drive on your system
+and wish to use a FreeBSD distribution CD in the CDROM drive of
+another system to which you have network connectivity, there are
+several ways of going about it:
+
+1. If you would be able to FTP install FreeBSD directly from the CDROM
+ drive in some FreeBSD machine, it's quite easy: You simply add the
+ following line to the password file (using the vipw command):
+
+ ftp:*:99:99::0:0:FTP:/cdrom:/sbin/nologin
+
+And anyone else on your network will now be able to chose a Media type
+of FTP and type in: ``ftp://<machine with CDROM drive>'' after picking
+"Other" in the ftp sites menu.
+
+2. If you would rather use NFS to export the CDROM directly to the
+ machine(s) you'll be installing from, you need to first add an
+ entry to the /etc/exports file (on the machine with the CDROM drive)
+ which looks something like this:
+
+ /cdrom -ro ziggy.foo.com
+
+ To allow the machine "ziggy.foo.com" to mount the CDROM directly
+ via NFS during installation. The machine with the CDROM must also
+ be configured as an NFS server, of course, and if you're not sure how
+ to do that then an NFS installation is probably not the best choice
+ for you unless you're willing to read up on rc.conf(5) and configure
+ things appropriately. Assuming that this part goes smoothly, you
+ should be able to enter: <cdrom-host>:/cdrom as the path for an NFS
+ installation when the target machine is installed.
+
+
+1.2 Installing from Floppies
+--- ------------------------
+
+If you must install from floppy disks, either due to unsupported
+hardware or just because you enjoy doing things the hard way, you must
+first prepare some floppies for the install.
+
+First, make a boot floppy as described in floppies/README.TXT
+
+Second, read the file LAYOUT.TXT and pay special attention to the
+"Distribution format" section since it describes which files you're
+going to need to put onto floppy and which you can safely skip.
+
+Next you will need, at minimum, as many 1.44MB floppies as it takes to
+hold all files in the bin (binary distribution) directory. If you're
+preparing these floppies under DOS, then THESE floppies *must* be
+formatted using the MS-DOS FORMAT command. If you're using Windows,
+use the Windows File Manager format command.
+
+Don't trust Factory Preformatted floppies! Format them again
+yourself, just to make sure. Many problems reported by our users in
+the past have resulted from the use of improperly formatted media,
+which is why I'm taking such special care to mention it here!
+
+If you're creating the floppies from another FreeBSD machine, a format
+is still not a bad idea though you don't need to put a DOS filesystem
+on each floppy. You can use the `disklabel' and `newfs' commands to
+put a UFS filesystem on a floppy, as the following sequence of
+commands illustrates:
+
+ fdformat -f 1440 fd0.1440
+ disklabel -w -r fd0.1440 floppy3
+ newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0
+
+After you've formatted the floppies for DOS or UFS, you'll need to
+copy the files onto them. The distribution files are split into
+chunks conveniently sized so that 5 of them will fit on a conventional
+1.44MB floppy. Go through all your floppies, packing as many files as
+will fit on each one, until you've got all the distributions you want
+packed up in this fashion. Each distribution should go into its own
+subdirectory on the floppy, e.g.: a:\bin\bin.inf, a:\bin\bin.aa,
+a:\bin\bin.ab, ...
+
+IMPORTANT NOTE: The bin.inf file also needs to go on the first floppy
+of the bin set since it is read by the installation program in order
+to figure out how many additional pieces to look for when fetching and
+concatenating the distribution. When putting distributions onto
+floppies, the <distname>.inf file MUST occupy the first floppy of each
+distribution set!
+
+Once you come to the Media screen of the install, select "Floppy" and
+you'll be prompted for the rest.
+
+
+1.3 Installing from a DOS partition
+--- -------------------------------
+
+To prepare for installation from an MS-DOS partition you should simply
+copy the files from the distribution into a directory called
+"FREEBSD" on the Primary DOS partition ("Drive C:"). For example, to do
+a minimal installation of FreeBSD from DOS using files copied from the
+CDROM, you might do something like this:
+
+ C:\> MD C:\FREEBSD
+ C:\> XCOPY /S E:\BIN C:\FREEBSD\BIN
+
+Assuming that `E:' was where your CD was mounted.
+
+For as many `DISTS' as you wish to install from DOS (and you have free
+space for), install each one in a directory under `C:\FREEBSD' - the
+BIN dist is only the minimal requirement.
+
+IMPORTANT NOTE: Though you can do all of the above by hand if you
+really want to, all of it is much more easily accomplished now by
+Robert Nordier's "setup.exe" program. It will give you a menu of
+distribution choices, verify that you have enough free space and do
+all the copying to C:\FREEBSD for you automatically.
+
+Once you've copied the directories or run setup.exe and let it do all
+the work for you, you can simply launch the installation from DOS by
+running the install.bat script (NOTE: Some memory managers don't like
+this - disable QEMM or EMM386 if they're running before trying this)
+or making a boot floppy as described in section 0.1.
+
+
+1.4 Installing from QIC/SCSI Tape
+--- -----------------------------
+
+When installing from tape, the installation program expects the files
+to be simply tar'ed onto it, so after fetching all of the files for
+the distributions you're interested in, simply tar them onto the tape
+with a command something like this:
+
+ cd /where/you/have/your/dists
+ tar cvf /dev/rwt0 (or /dev/rst0) dist1 .. dist2
+
+When you go to do the installation, you should also make sure that you
+leave enough room in some temporary directory (which you'll be allowed
+to choose) to accommodate the FULL contents of the tape you've
+created. Due to the non-random access nature of tapes, this method of
+installation requires quite a bit of temporary storage! You should
+expect to require as much temporary storage as you have stuff written
+on tape.
+
+SPECIAL NOTE: When going to do the installation, the tape must be in
+the drive *before* booting from the boot floppy. The installation
+"probe" may otherwise fail to find it.
+
+Now create a boot floppy as described in section 0.1 and proceed with
+the installation.
+
+
+1.5 Installing over a network using FTP or NFS
+--- ------------------------------------------
+
+After making a boot floppy as described in the first section, you can
+load the rest of the installation over a network using one of 3 types
+of connections:
+
+ Serial port: SLIP / PPP
+ Parallel port: PLIP (using ``laplink'' style cable)
+ Ethernet: A standard Ethernet controller (including
+ certain PCCARD devices).
+
+Serial Port
+-----------
+
+SLIP support is rather primitive, and is limited primarily to
+hard-wired links, such as a serial cable running between two
+computers. The link must be hard-wired because the SLIP installation
+doesn't currently offer a dialing capability. If you need to dial out
+with a modem or otherwise dialog with the link before connecting to
+it, then I recommend that the PPP utility be used instead.
+
+If you're using PPP, make sure that you have your Internet Service
+Provider's IP address and DNS information handy as you'll need to know
+it fairly early in the installation process. You may also need to
+know your own IP address, though PPP supports dynamic address
+negotiation and may be able to pick up this information directly from
+your ISP if they support it.
+
+You will also need to know how to use the various "AT commands" for
+dialing out with your particular brand of modem as the PPP dialer
+provides only a very simple terminal emulator.
+
+
+Parallel Port
+-------------
+
+If a hard-wired connection to another FreeBSD (2.0R or later) or Linux
+machine is available, you might also consider installing over a
+"laplink" style parallel port cable. The data rate over the parallel
+port is much higher than what is typically possible over a serial line
+(up to 50k/sec), thus resulting in a quicker installation. It's not
+typically necessary to use "real" IP addresses when using a
+point-to-point parallel cable in this way and you can generally just
+use RFC 1918 style addresses for the ends of the link (e.g. 10.0.0.1,
+10.0.0.2, etc).
+
+IMPORTANT NOTE: If you use a Linux machine rather than a FreeBSD
+machine as your PLIP peer, you will also have to specify "link0" in
+the TCP/IP setup screen's ``extra options for ifconfig'' field.
+
+
+Ethernet
+--------
+
+FreeBSD supports most common PC Ethernet cards, a table of supported
+cards (and their required settings) being provided as part of the
+FreeBSD Hardware Guide (see the Documentation menu on the boot floppy
+or the top level directory of the CDROM). If you are using one of the
+supported PCMCIA Ethernet cards, also be sure that it's plugged in
+_before_ the laptop is powered on! FreeBSD does not, unfortunately,
+currently support "hot insertion" of PCMCIA cards during installation.
+
+You will also need to know your IP address on the network, the
+"netmask" value for your address class and the name of your machine.
+Your system administrator can tell you which values are appropriate to
+your particular network setup. If you will be referring to other
+hosts by name rather than IP address, you'll also need a name server
+and possibly the address of a gateway (if you're using PPP, it's your
+provider's IP address) to use in talking to it.
+
+If you do not know the answers to these questions then you should
+really probably talk to your system administrator _first_ before
+trying this type of installation! Using a randomly chosen IP address
+or netmask on a live network will almost certainly get you shot at
+dawn.
+
+Once you have a network connection of some sort working, the
+installation can continue over NFS or FTP.
+
+
+1.5.1 NFS installation tips
+----- ---------------------
+
+ NFS installation is fairly straight-forward: Simply copy the
+ FreeBSD distribution files you want onto a server somewhere
+ and then point the NFS media selection at it.
+
+ If this server supports only "privileged port" access (as is
+ generally the default for Sun and Linux workstations), you
+ will need to set this option in the Options menu before
+ installation can proceed.
+
+ If you have a poor quality Ethernet card which suffers from very
+ slow transfer rates, you may also wish to toggle the appropriate
+ Options flag.
+
+ In order for NFS installation to work, the server must also support
+ "subdir mounts", e.g. if your FreeBSD 2.2 distribution directory
+ lives on: ziggy:/usr/archive/stuff/FreeBSD
+ Then ziggy will have to allow the direct mounting of
+ /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff.
+
+ In FreeBSD's /etc/exports file this is controlled by the
+ ``-alldirs'' option. Other NFS servers may have different
+ conventions. If you are getting `Permission Denied' messages
+ from the server then it's likely that you don't have this
+ properly enabled!
+
+
+1.5.2 FTP Installation tips
+----- ---------------------
+
+ FTP installation may be done from any mirror site containing a
+ reasonably up-to-date version of FreeBSD. A full menu of
+ reasonable choices for almost any location in the world is
+ provided in the FTP site menu during installation.
+
+ If you are installing from some other FTP site not listed in
+ this menu, or you are having troubles getting your name server
+ configured properly, you can also specify your own URL by
+ selecting the ``Other'' choice in that menu. A URL can
+ contain a hostname or an IP address, so the following would
+ work in the absence of a name server:
+
+ ftp://192.216.191.11/pub/FreeBSD/2.2-RELEASE
+
+ There are two FTP installation modes you can use:
+
+ o FTP:
+
+ For all FTP transfers, use the standard "Active" mode for
+ transfers. This will not work through most firewalls but
+ will often work best with older ftp servers that do not
+ support passive mode. If your connection hangs with
+ passive mode, try this one!
+
+ o FTP Passive:
+
+ For all FTP transfers, use "Passive" mode. This allows
+ the user to pass through firewalls that do not allow
+ incoming connections on random port addresses.
+
+ NOTE: ACTIVE AND PASSIVE MODES ARE NOT THE SAME AS A `PROXY'
+ CONNECTIONS, WHERE A PROXY FTP SERVER IS LISTENING ON A
+ DIFFERENT PORT!
+
+ In such instances, you should specify the URL as something like:
+
+ ftp://foo.bar.com:1234/pub/FreeBSD
+
+ Where "1234" is the port number of the proxy ftp server.
+
+
+2.0 DOS user's Question and Answer section
+--- --------------------------------------
+
+2.1 Help! I have no space! Do I need to delete everything first?
+--- --------------------------------------------------------------
+
+If your machine is already running DOS and has little or no free space
+available for FreeBSD's installation, all is not lost! You may find
+the "FIPS" utility, provided in the tools/ subdirectory on the FreeBSD
+CDROM or on the various FreeBSD ftp sites, to be quite useful.
+
+FIPS allows you to split an existing DOS partition into two pieces,
+preserving the original partition and allowing you to install onto the
+second free piece. You first "defrag" your DOS partition, using the
+DOS 6.xx "DEFRAG" utility or the Norton Disk tools, then run FIPS. It
+will prompt you for the rest of the information it needs. Afterwards,
+you can reboot and install FreeBSD on the new partition. Also note
+that FIPS will create the second partition as a "clone" of the first,
+so you'll actually see that you now have two DOS Primary partitions
+where you formerly had one. Don't be alarmed! You can simply delete
+the extra DOS Primary partition (making sure it's the right one by
+examining its size! :)
+
+NOTE: FIPS does NOT currently work with FAT32 or VFAT style partitions
+as used by newer versions of Windows 95. To split up such a
+partition, you will need a commercial product such as Partition Magic
+3.0. Sorry, but this is just the breaks if you've got a Windows
+partition hogging your whole disk and you don't want to reinstall from
+scratch.
+
+2.2 Can I use compressed DOS filesystems from FreeBSD?
+--- --------------------------------------------------
+
+No. If you are using a utility such as Stacker(tm) or
+DoubleSpace(tm), FreeBSD will only be able to use whatever portion of
+the filesystem you leave uncompressed. The rest of the filesystem
+will show up as one large file (the stacked/dblspaced file!). DO NOT
+REMOVE THAT FILE as you will probably regret it greatly!
+
+It is probably better to create another uncompressed DOS extended
+partition and use this for communications between DOS and FreeBSD if
+such is your desire.
+
+
+2.3 Can I mount my DOS extended partitions?
+--- ---------------------------------------
+
+Yes. DOS extended partitions are mapped in at the end of the other
+``slices'' in FreeBSD, e.g. your D: drive might be /dev/sd0s5, your E:
+drive /dev/sd0s6, and so on. This example assumes, of course, that
+your extended partition is on SCSI drive 0. For IDE drives, substitute
+``wd'' for ``sd'' appropriately. You otherwise mount extended
+partitions exactly like you would mount any other DOS drive, e.g.:
+
+mount -t msdos /dev/sd0s5 /dos_d
+
+
+2.4 Can I run DOS binaries under FreeBSD?
+--- -------------------------------------
+
+Ongoing work with BSDI's doscmd utility is bringing this much closer to
+being a reality in FreeBSD 3.0, though it still has some rough edges.
+If you're interested in working on this, please send mail to
+emulation@FreeBSD.org and indicate that you're interested in joining
+this ongoing effort!
+
+There is also a neat utility called "pcemu" in the ports collection
+which emulates an 8088 and enough BIOS services to run DOS text mode
+applications. It requires the X Window System (provided as XFree86
+3.2) to operate.
+
+
+---- End of Installation Guide ---
diff --git a/release/sysinstall/help/partition.hlp b/release/sysinstall/help/partition.hlp
index 37520bfbaefe..8e07d3dc79bb 100644
--- a/release/sysinstall/help/partition.hlp
+++ b/release/sysinstall/help/partition.hlp
@@ -72,16 +72,16 @@ looking at disk storage works:
In FreeBSD's new system, a device name can be broken up into up to 3
-parts. Take a typical name like ``/dev/da0s1a'':
+parts. Take a typical name like ``/dev/sd0s1a'':
The first three characters represent the drive name. If we had
- a system with two SCSI drives on it then we'd see /dev/da0 and
- /dev/da1 as the device entries representing the entire drives.
+ a system with two SCSI drives on it then we'd see /dev/sd0 and
+ /dev/sd1 as the device entries representing the entire drives.
Next you have the "slice" (or "FDISK Partition") number,
- as seen in the Partition Editor. Assuming that our da0
+ as seen in the Partition Editor. Assuming that our sd0
contained two slices, a FreeBSD slice and a DOS slice, that
- would give us /dev/da0s1 and /dev/da0s2 as device entries pointing
+ would give us /dev/sd0s1 and /dev/sd0s2 as device entries pointing
to the entire slices.
Next, if a slice is a FreeBSD slice, you can have a number of
@@ -89,13 +89,13 @@ parts. Take a typical name like ``/dev/da0s1a'':
These partitions are where various filesystems or swap areas live,
and using our hypothetical two-SCSI-disk machine again, we might
- have something like the following layout on da0:
+ have something like the following layout on sd0:
Name Mountpoint
---- ----------
- da0s1a /
- da0s1b <swap space>
- da0s1e /usr
+ sd0s1a /
+ sd0s1b <swap space>
+ sd0s1e /usr
Because of historical convention, there is also a short-cut,
or "compatibility slice", that is maintained for easy access
@@ -108,13 +108,13 @@ parts. Take a typical name like ``/dev/da0s1a'':
Name Mountpoint
---- ----------
- da0a /
- da0b <swap space>
- da0e /usr
+ sd0a /
+ sd0b <swap space>
+ sd0e /usr
Again, let it be noted: FreeBSD automatically maps the
compatibility slice to the first FreeBSD slice it finds
- (in this case, da0s1). You may have multiple FreeBSD slices on a
+ (in this case, sd0s1). You may have multiple FreeBSD slices on a
drive, but only the first one will be mapped to the compatibility
slice!
diff --git a/release/sysinstall/help/readme.hlp b/release/sysinstall/help/readme.hlp
new file mode 100644
index 000000000000..ec53eb85aacd
--- /dev/null
+++ b/release/sysinstall/help/readme.hlp
@@ -0,0 +1,115 @@
+ -----------------------------------------
+ FreeBSD 3.0 --- RELEASE Version , ,
+ ----------------------------------------- /( )`
+ \ \___ / |
+This is FreeBSD 3.0-RELEASE, the first official /- _ `-/ '
+release on the 3.0-current branch. This release (/\/ \ \ /\
+contains a lot of new technology as well as our / / | ` \
+first non-x86 architecture port (to the ALPHA) O O ) / |
+and promises to be an exciting start to what will `-^--'`< '
+hopefully be many follow-on releases. (_.) _ ) /
+ `.___/` /
+ `-----' /
+Feedback or offers to help with anything <----. __ / __ \
+you see in this release are most welcome <----|====O)))==) \) /====
+and should be sent to one of the approp- <----' `--' `.__,' \
+riate mailing lists - please see the | |
+ABOUT.TXT file for more information. \ / /\
+ ______( (_ / \______/
+ ,' ,-----' |
+ `--{__________)
+
+TARGET AUDIENCE:
+----------------
+This release is aimed primarily at early-adopters and the various
+other folks who want to get on board with 3.0 and are willing to deal
+with the various down-sides of a "dot-zero" release. We have naturally
+done our best to ensure that 3.0 performs as advertised but, as the
+first release on a branch which has seen some very radical changes
+from 2.2.x (SMP, ELF, new boot blocks, many kernel changes, etc), it's
+also very new technology and will require at least one more release
+along the 3.0 branch before it's ready for "production" purposes.
+This is one of the reasons why the 2.2.x branch will be continuing
+into November, with the scheduled release of 2.2.8, and possibly a bit
+beyond.
+
+If you're both technically proficient and know exactly what you're
+getting into here (e.g. you've been following -current) then 3.0 is
+probably for you. If you're more interested in doing business with
+FreeBSD than in playing with the cutting edge of technology, however,
+then 2.2.x is almost certainly your best bet.
+
+
+ROAD MAP:
+ Most files here are also in the Documentation
+ Menu of the boot floppy
+
+ README.TXT This file
+
+ ABOUT.TXT All about FreeBSD, including contact information
+
+ RELNOTES.TXT Release Notes - what's new & different in this
+ release
+
+ LAYOUT.TXT Information about the layout of the release
+ directory. If you are installing from floppies,
+ it is especially important that you
+ *read this section!*
+
+ ERRATA.TXT Any late-breaking errata information for this
+ release. On FTP sites, this file may be frequently
+ updated so it's a good idea to check it first
+ (the master copy is always on ftp.freebsd.org)
+ before reporting problems
+
+ HARDWARE.TXT Information about the configuration of the
+ GENERIC kernel and supported hardware
+
+ INSTALL.TXT How to make a new installation of FreeBSD
+ on your PC using the data you see here
+
+ UPGRADE.TXT How to upgrade an existing FreeBSD
+ installation
+
+ TROUBLE.TXT Troubleshooting information
+
+
+o For new installation instructions, see the INSTALL.TXT
+ and HARDWARE.TXT files.
+
+o If you are upgrading from a previous FreeBSD version,
+ please take a look at UPGRADE.TXT.
+
+o It is also important to check the ERRATA.TXT file for any
+ late-breaking issues with this release. This file contains
+ the latest information on upgrade, security or other problems
+ which an administrator should be aware of.
+
+o Information regarding problems which arise after the CD
+ is printed can be found at:
+ ftp://ftp.freebsd.org/pub/FreeBSD/3.0-RELEASE/ERRATA.TXT
+
+For the most up-to-date software along the RELENG_2_2 branch
+(also known as -Stable) which is now proceeding onwards toward
+the release of FreeBSD 2.2.8, please install from:
+
+ ftp://releng22.freebsd.org/pub/FreeBSD/
+
+Or for the latest 3.0-Current (HEAD branch) snapshot releases,
+please install from:
+
+ ftp://current.freebsd.org/pub/FreeBSD
+
+If you plan to run either -Stable or -Current you MUST be
+subscribed to the appropriate mailing list, either
+freebsd-stable or freebsd-current. For information on
+subscribing to either list (or both), send an e-mail to
+majordomo@freebsd.org with the following in the body, not
+the subject of the letter as appropriate:
+
+subscribe freebsd-stable
+subscribe freebsd-current
+end
+
+We hope you enjoy using FreeBSD as much as we enjoyed
+creating it!
diff --git a/release/sysinstall/help/relnotes.hlp b/release/sysinstall/help/relnotes.hlp
new file mode 100644
index 000000000000..cc8ebcfb220c
--- /dev/null
+++ b/release/sysinstall/help/relnotes.hlp
@@ -0,0 +1,834 @@
+ RELEASE NOTES
+ FreeBSD Release 3.0-RELEASE
+
+This is our first release of 3.0-CURRENT and is aimed primarily at
+early adopters and developers. Some parts of the documentation may
+not be updated yet and should be reported if and when seen.
+Naturally, any installation failures or crashes should also be
+reported ASAP by sending mail to freebsd-bugs@FreeBSD.org or using the
+send-pr command (those preferring a WEB based interface can also see
+http://www.freebsd.org/send-pr.html).
+
+For information about FreeBSD and the layout of the 3.0-RELEASE
+directory (especially if you're installing from floppies!), see
+ABOUT.TXT. For installation instructions, see the INSTALL.TXT and
+HARDWARE.TXT files.
+
+This is also hardly the last release on the 3.0-current (HEAD) branch
+and daily snapshot releases will continue as normal following this
+release. Please install them from:
+
+ ftp://current.freebsd.org/pub/FreeBSD
+
+If you wish to get the latest post-3.0-RELEASE technology.
+
+Table of contents:
+------------------
+1. What's new since 2.2.X-RELEASE
+ 1.1 KERNEL CHANGES
+ 1.2 SECURITY FIXES
+ 1.3 USERLAND CHANGES
+
+2. Supported Configurations
+ 2.1 Disk Controllers
+ 2.2 Ethernet cards
+ 2.3 ATM
+ 2.4 Misc
+
+3. Obtaining FreeBSD
+ 3.1 FTP/Mail
+ 3.2 CDROM
+
+4. Upgrading from previous releases of FreeBSD
+
+5. Reporting problems, making suggestions, submitting code
+6. Acknowledgements
+
+
+1. What's new since 2.2.X-RELEASE
+---------------------------------
+All changes described here are unique to the 3.0 branch unless
+specifically marked as [MERGED] features.
+
+1.1. KERNEL CHANGES
+-------------------
+o The 2.2.x SCSI subsystem has been almost entirely replaced with
+ a new "CAM" (Common Access Method) SCSI system which offers
+ improved performance, better error recovery and support for more
+ SCSI controllers.
+
+o The Host ATM Research Platform ("HARP") software by Network
+ Computing Services, Inc. has been integrated into the system.
+ See /usr/src/share/examples/atm for more info.
+
+o The SMP (Symmetric MultiProcessing) branch has been merged.
+ The kernel is mostly non-reentrant as yet, but work is under way.
+
+o The code from 4.4BSD-Lite2 has been (finally) merged.
+
+o Secure RPC is now supported (and usable with NFS et al).
+
+o Sun's WEBNFS standard is now supported.
+
+o The MSDOS filesystem code now handles VFAT and FAT32 partitions.
+ [MERGED: Also in 2.2.7 and later releases on 2.2-STABLE branch]
+
+o ATAPI/IDE CD burner support (BETA).
+
+o ATAPI/IDE tape drive support (BETA).
+
+o Support for using VESA video modes. It is now possible to select and
+ use the modes provided by the BIOS on modern videocards. This enables
+ fx. 132x60 sized consoles and highres graphics in a generic manner on
+ hardware that supports it. There is also support for running the
+ console in rastermode, which allows XFree86 to run a simple 16color
+ server in 800x600 on otherwise unsupported video hardware.
+
+o Support for AdvanSys SCSI controllers
+
+o Support for QLogic SCSI and Fibre Channel controllers.
+
+o Support for Adaptec 7890, 7891, 7895, 7896 and 7897 based controllers
+ (new 2940/2950/3940/3950 et al).
+
+o The ed0 (wd8xxxx, 3c503, NE2000, HP Lan+) Ethernet device's default IRQ
+ has changed from IRQ 5 to IRQ 10.
+ The ed1 Ethernet device has been removed. Use the Userconfig utility
+ to change ed0's values to match your network card's settings.
+ [MERGED: Both changes are in 2.2.6 and later releases on 2.2-STABLE branch]
+
+o The code responsible for maintaining time of day has been
+ rewritten. New features are: true support for nanoseconds in
+ both kernel and userland, continuous rather than stepwise adjustment
+ by NTPD and support for synchronizing to high precision external time
+ signals.
+
+o Support for the PPS API described in draft-mogul-pps-api-02.txt for
+ TTL rising edge inputs via the parallel printer port has been added
+ to the printer driver.
+
+o Use the new if_multiaddrs list for multicast addresses rather than the
+ previous hackery involving struct in_ifaddr and arpcom. Get rid of the
+ abominable multi_kludge.
+
+o The new if_media selection method for ethernet drivers has been brought
+ in, obtained from Jason Thorpe's implementation for NetBSD.
+ [MERGED: Also in 2.2.5 and later releases on 2.2-STABLE branch]
+
+o Multi-session ISO-9660 CD-ROMs are now fully supported. By default, the
+ last session will be mounted (including for root mounts). For non-root
+ mounts, mount_cd9660(8) can take an argument to mount a particular
+ session instead of the default one.
+
+o The UPAGES are gone from the per-process address space which allows
+ complete address space and page table sharing by reference count.
+
+o Newly forked child processes return directly to user mode rather than
+ return up through the fork() syscall tree. This eliminates the kernel
+ stack copy at fork time and simplifies certain other internal operations.
+ It is also needed to support the removal of the UPAGES. (The idea for
+ this originally came from NetBSD, but we did it for different reasons.)
+
+o vfork() is now fully functional by taking advantage of the new sharing
+ semantics and a significant speedup has been measured. This can be
+ disabled via the kern.fast_vfork sysctl variable in case of problems.
+ Statically linked binaries from older releases and other BSD platforms
+ are a problem since there was a bug in the 4.4BSD (net2, Lite and Lite2)
+ popen() implementation. rfork() also has access to these facilities,
+ intended for supporting kernel assisted threads.
+
+o With the contribution of Berkeley Software Design, Inc., Jonathan Lemmon,
+ Mike Smith, Sean Eric Fagan, and John Dyson, VM86 support has been added
+ to the kernel, and BSD/OS's contributed dosemu has been ported.
+
+o The SA_NOCLDWAIT flags has been implemented, featuring the System V
+ option where a process can express its wish to never get zombies or
+ SIGCHLD for dead children.
+
+o An implementation of poll(2) is in place, the core of which is derived
+ from the NetBSD implementation. Both the select() and poll() syscalls
+ use the poll device, file and vnode ops routines.
+
+o An implementation of issetugid(2) that is similar to the OpenBSD call
+ of the same name. We set the flag in more cases than OpenBSD - our
+ implementation is slightly more paranoid.
+
+o Async IO is implemented (under non-SMP at this stage) with additional
+ support for kernel assisted threads.
+
+o Some other misc syscalls for compatability with other systems: getsid(2),
+ setpgid(2), nanosleep(2).
+
+o A new syscall signanosleep(2) which is like nanosleep(2), but a specific
+ signal mask is used to determine which signals will wake the sleep. In
+ a nutshell this is 'wait for a given set of signals for up to a certain
+ amount of time'.
+
+o sleep(3) and usleep(3) are now implemented in terms of signanosleep(2)
+ and now have correct SIGALRM interaction semantics and sleep(3) correctly
+ returns the time remaining. Some programs (notably apache httpd) bogusly
+ depend on a sleep() "absorbing" a SIGALRM from a timer that expires during
+ the life of the sleep.
+
+o An in-kernel linker is implemented and intended to replace the lkm system
+ with the bogosity that goes with it.
+
+o All supported network protocols have been updated to avoid the ``big
+ switch'' pr_usrreq(), and to pass a process pointer down to each user
+ request that might need process credentials or want to sleep,
+ replacing the previous hodgepodge of inspecting curproc (which only
+ occasionally did the right thing) and the SS_PRIV socket state flag.
+ The latter has now been eliminated, along with the SO_PRIVSTATE socket
+ option which cleared it. Protocols are now also given the opportunity
+ to override the generic send, receive, and poll routines, which will
+ make it possible for a more efficient, protocol-specific
+ implementation of these entry points in later releases. Finally, many
+ parts of the network code have been modified to cease storing socket
+ addresses and other metainformation in mbufs, in preparation for the
+ eventual elimination thereof. The mechanism by which socket addresses
+ are now returned is still highly subject to change as we experiment to
+ discover the most efficient method.
+
+o Responses to multicast ICMP ECHO REQUEST (``ping'') and ADDRESS MASK
+ REQUEST packets can now be disabled via sysctl. The netstat program
+ will print out statistics on how many times this happens.
+
+o A subtle and seldom encountered bug in ffs has been fixed.
+
+o The VFS name cache has been reworked to be more accountable and efficient.
+
+o The generic part of VOP_LOOKUP() has been put it in system-wide function
+ which filesystems can rely on for the canonical stuff.
+
+o Vnode freelist handling has been hauled over. Vnodes are only on the
+ freelist if nobody cares about them.
+
+o The kernel provides assistance to getcwd() from data stored in the name
+ cache if possible.
+
+o An interrupt driven configuration hook mechanism has been implemented.
+ This allows drivers to postpone part of their configuration until after
+ interrupts are fully enabled. This speeds booting because busy-waiting
+ is avoided for things like sub device probing (eg: SCSI bus probes).
+
+o The timeout(9) system in the kernel has been overhauled. This gives
+ O(1) insertion and removal of callouts and an O(hash chain length)
+ amount of work to be performed in softclock. The original paper is at:
+ http://www.cs.berkeley.edu/~amc/research/timer/
+
+o Changes in driver buffer queuing to deal with ordered transactions. This
+ is intended for sequencing data and metadata writes in the filesystem code
+ once fully supported.
+
+o EISA Shared interrupts are now supported, working with the framework
+ originally for supporting PCI shared interrupts.
+
+o Support for the Comtrol Rocketport card.
+
+o IPFW's packet and byte counters have been expanded from 32 to 64 bits,
+ a `FWD' operation has been added to ipfw to support transparent
+ proxying and the divert operation has changed slightly - see the man
+ pages for natd(8) and ipfw(8) for more information.
+
+o New Plug and Play (PnP) support that allows you to (re)configure PnP
+ devices. Also support modems being detected by the PnP part and
+ automatically attached.
+ [MERGED: Also in 2.2.6 and later releases on 2.2-STABLE branch]
+
+o Import of new sound code from Luigi Rizzo. This code is still being
+ developed, but has support for a number of different cards.
+ [MERGED: Also in 2.2.6 and later releases on 2.2-STABLE branch]
+
+o The psm, mse and sysmouse drivers are improved to provide better mouse
+ support. In particular, the psm driver now supports various ``wheeled''
+ mice.
+ [MERGED: Also in 2.2.6 and later releases on 2.2-STABLE branch]
+
+o Added support for SMC EtherPower II 10/100 Fast Ethernet card
+ (aka SMC9432TX based on SMC83c170 EPIC chip).
+ [MERGED: Also in 2.2.7 and later releases on 2.2-STABLE branch]
+
+o Added support for ATAPI floppy drives (LS-120).
+ [MERGED: Also in 2.2.7 and later releases on 2.2-STABLE branch]
+
+o Added support for IBM Etherjet and other Crystal Semiconductor
+ CS89x0-based NICs.
+ [MERGED: Also in 2.2.7 and later releases on 2.2-STABLE branch]
+
+o Added support for Texas Instruments TNET100 'ThunderLAN' PCI NIC.
+ [MERGED: Also in 2.2.8 and later releases on 2.2-STABLE branch]
+
+o Added full bus master DMA support for 3c900 and 3c905 adapters and
+ added support for the 3c905B.
+ [MERGED: Also in 2.2.8 and later releases on 2.2-STABLE branch]
+
+
+1.2. SECURITY FIXES
+-------------------
+[MERGED: all changes soon after specified date in 2.2-STABLE branch]
+
+97/7/29 Lots of lpr/lpd security fixes merged from OpenBSD.
+97/8/22 buffer overflows in tip corrected (benign since tip isn't
+ set[ug]id)
+97/8/26 buffer overflow in glob fixed, no know exploits
+97/8/27 vacation security problem with sendmail corrected (SNI)
+97/8/29 inetd sleeps less when children exit, making DoS attacks much
+ harder.
+97/8/29 fts now race-proof and find -execdir added (-current only)
+97/8/31 games setuid -> setgid. Makes any games exploits benign (only
+ score files vulnerable). Please report any problems to
+ eivind@FreeBSD.org (score-file ownership problems are known)
+97/12/3 Add Intel's suggested fix for the F00F bug. If you don't have
+ a Pentium, the NO_F00F_HACK kernel option will disable it.
+98/1/20 More robust protection against LAND attacks now incorporated.
+
+The suidperl vulnerability mentioned in the CERT advisory CA-97.17 is
+also believed to be fixed.
+
+KerberosIV is now merged.
+
+
+1.3. USERLAND CHANGES
+---------------------
+The default binary type (and compiler toolchain) has been
+switched from a.out to ELF. This gives us access to much
+newer compiler technology (much of which didn't support a.out),
+allows for smaller executables and provides much better
+support for languages like C++, among many other advantages.
+Older a.out libraries and binaries will, of course, continue to work
+and provisions have been made for having both varieties installed if
+and as necessary for transitional purposes.
+
+Perl4 has now been replaced by Perl5 as a standard part of the
+system.
+
+The default username length has increased to 16 characters.
+Caution: Old utmp/wtmp files will NOT work with this change since
+the data records will be of the old size. For a conversion utility
+to aid with this, see /usr/src/tools/3.0-upgrade.
+
+/etc/sysconfig now replaced by more compact /etc/rc.conf file
+[MERGED: Also in 2.2.1 and later releases on 2.2-STABLE branch]
+
+fdisk(8) now numbers disk slices from 1 to 4 rather than from 0 to 3.
+This brings it in line with the numbers used in the device names
+in /dev.
+
+The Amd automounter has been updated from the 1993 4.4BSD version to
+the latest current version of am-utils. Map options have changed
+somewhat, and a new configuration file, /etc/amd.conf, is supported.
+See ``man 5 amd.conf''.
+
+The ``picobsd'' package for creating custom FreeBSD boot floppies
+and "mini systems" has been brought into /usr/src/release/picobsd.
+See file:/usr/src/release/picobsd/README.html for further information.
+
+When operating over the network, finger(1) no longer closes the socket
+immediately after sending its request, but instead waits for the
+remote end to close first. (The specification is ambiguous, so we are
+following the behavior which interoperates with the most servers.)
+This means that it is now possible to use the MIT directory and finger
+people at certain broken Linux machines.
+
+There is a new flag to fetch(1) which allows it to talk to certain
+broken HTTP implementations which react badly to a request message
+immediately followed by a close of the connection.
+
+netstat(1) now uses sysctl(3) to retrieve more statistics groups and
+uses the correct, unsigned format for printing most of them out.
+
+A new VGA library (/usr/src/lib/libvgl) now exists for doing simple
+VGA graphics to syscons ttys (sort of like Linux's libSVGA).
+[MERGED: Also in 2.2.5 and later releases on 2.2-STABLE branch]
+
+Xntpd's syslogging has been moved out into a facility of its own
+(LOG_NTP, userland name "ntp").
+
+A new pair of ioctl's has been added: SIOC[SG]IFGENERIC. The intent
+is to provide for a hook to pass arbitrary ioctl subcommands down to a
+network interface driver. This is for example necesseray for PPP
+drivers to communicate things like CHAP names and secrets, or variable
+options between the driver and a userland utility.
+
+sppp(4) has been improved a fair bit since FreeBSD 2.2.X. It now
+employs a full-fledged PPP state machine, offers a lot more of LCP and
+IPCP negotiation, making it ready for dial-on-demand connections (like
+those that are often running over ISDN). It also offers PAP or CHAP
+authentication. The userland counterpart spppcontrol(8) is also the
+first program that utilizes the abovementioned SIOC[SG]IFGENERIC ioctl
+commands.
+
+moused(8) has been modified to support various mice with a ``wheel''.
+It also automatically recognizes mice which support the PnP COM device
+standard, so that the user is no longer required to supply a mouse
+protocol type on the command line.
+[MERGED: Also in 2.2.6 and later releases on 2.2-STABLE branch]
+
+ppp(8) supports many additional features including the PPP Multilink
+Protocol (rfc1990), PPP Callback (with CBCP extensions) and client
+side DNS negotiation. Refer to the README.changes file in the source
+directory for details of possible configuration conflicts.
+
+Pthread read/write locks as defined by the Single UNIX Specification,
+Version 2, have been added to the POSIX threads library, libc_r.
+
+System files are now owned by user `root', group `wheel'. UID 0 is far
+more protected than `bin'. Especially over NFS.
+
+/bin/sh signal and trap handling reworked. Among other things, this
+makes tty-mode emacs work when called from system(2), i.e. by a mail
+agent. Several syntax bugs have been fixed.
+[MERGED: Also in 2.2.8 and later releases on 2.2-STABLE branch]
+
+systat(1), iostat(8), rpc.rstatd(8), and vmstat(8) have been
+overhauled to use the new devstat(3) library and devstat(9) statistics
+subsystem. Among other enhancements, these utilities (well, with the
+exception of rpc.rstatd(8)) now print out more useful statistics, and can
+see statistics for all devices in the system, not just the first 8.
+
+2. Supported Configurations
+---------------------------
+FreeBSD currently runs on a wide variety of ISA, VLB, EISA and PCI bus
+based PC's, ranging from 386sx to Pentium class machines (though the
+386sx is not recommended). Support for generic IDE or ESDI drive
+configurations, various SCSI controller, network and serial cards is
+also provided.
+
+What follows is a list of all peripherals currently known to work with
+FreeBSD. Other configurations may also work, we have simply not as yet
+received confirmation of this.
+
+
+2.1. Disk Controllers
+---------------------
+WD1003 (any generic MFM/RLL)
+WD1007 (any generic IDE/ESDI)
+IDE
+ATA
+
+Adaptec 1535 ISA SCSI controllers
+Adaptec 154x series ISA SCSI controllers
+Adaptec 174x series EISA SCSI controller in standard and enhanced mode.
+Adaptec 274X/284X/2920/2940/2950/3940/3950 (Narrow/Wide/Twin) series
+EISA/VLB/PCI SCSI controllers.
+Adaptec AIC7850, AIC7880, AIC789x, on-board SCSI controllers.
+
+AdvanSys SCSI controllers (all models).
+
+Buslogic 545S & 545c
+Buslogic 445S/445c VLB SCSI controller
+Buslogic 742A, 747S, 747c EISA SCSI controller.
+Buslogic 946c PCI SCSI controller
+Buslogic 956c PCI SCSI controller
+
+DPT SCSI/RAID controllers (most variants).
+
+SymBios (formerly NCR) 53C810, 53C825, 53c860 and 53c875 PCI SCSI
+controllers:
+ ASUS SC-200
+ Data Technology DTC3130 (all variants)
+ NCR cards (all)
+ Symbios cards (all)
+ Tekram DC390W, 390U and 390F
+ Tyan S1365
+
+
+QLogic SCSI and Fibre Channel controllers.
+
+DTC 3290 EISA SCSI controller in 1542 emulation mode.
+
+With all supported SCSI controllers, full support is provided for
+SCSI-I & SCSI-II peripherals, including hard disks, optical disks,
+tape drives (including DAT and 8mm Exabyte), medium changers, processor
+target devices and CDROM drives. WORM devices that support CDROM commands
+are supported for read-only access by the CDROM driver. WORM/CD-R/CD-RW
+writing support is provided by cdrecord, which is in the ports tree.
+
+The following CD-ROM type systems are supported at this time:
+(cd) SCSI interface (also includes ProAudio Spectrum and
+ SoundBlaster SCSI)
+(matcd) Matsushita/Panasonic (Creative SoundBlaster) proprietary
+ interface (562/563 models)
+(scd) Sony proprietary interface (all models)
+(wcd) ATAPI IDE interface
+
+SCSI TAPE SUPPORT:
+
+ The CAM SCSI tape driver doesn't yet handle older (and many times broken)
+ tape drives very well. If you've got an older SCSI-1 tape drive, like an
+ Exabyte 8200 or older QIC-type tape drive, it may not work properly with
+ the CAM tape driver. This is obviously a known problem, and we're
+ working on it.
+
+ Newer tape drives that are mostly SCSI-2 compliant should work fine.
+ e.g., DAT (DDS-1, 2 and 3), DLT, and newer Exabyte 8mm drives should
+ work fine.
+
+ If you want to find out if your particular tape drive is supported, the
+ best way to find out is to try it!
+
+The following drivers were supported under the old SCSI subsystem, but are
+NOT YET supported under the new CAM SCSI subsystem:
+
+ Tekram DC390 and DC390T controllers (maybe other cards based on the
+ AMD 53c974 as well).
+
+ NCR5380/NCR53400 ("ProAudio Spectrum") SCSI controller.
+
+ UltraStor 14F, 24F and 34F SCSI controllers.
+
+ Seagate ST01/02 SCSI controllers.
+
+ Future Domain 8xx/950 series SCSI controllers.
+
+ WD7000 SCSI controller.
+
+ Adaptec 1510 series ISA SCSI controllers (not for bootable devices)
+ Adaptec 152x series ISA SCSI controllers
+ Adaptec AIC-6260 and AIC-6360 based boards, which includes the AHA-152x
+ and SoundBlaster SCSI cards.
+
+ [ Note: There is work-in-progress to port the AIC-6260/6360 and
+ UltraStor drivers to the new CAM SCSI framework, but no estimates on
+ when or if they will be completed. ]
+
+Unmaintained drivers, they might or might not work for your hardware:
+
+ Floppy tape interface (Colorado/Mountain/Insight)
+
+ (mcd) Mitsumi proprietary CD-ROM interface (all models)
+
+2.2. Ethernet cards
+-------------------
+Allied-Telesis AT1700 and RE2000 cards
+
+AMD PCnet/PCI (79c970 & 53c974 or 79c974)
+
+SMC Elite 16 WD8013 ethernet interface, and most other WD8003E,
+WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and WD8013EBT
+based clones. SMC Elite Ultra. SMC Etherpower II.
+
+Texas Instruments ThunderLAN PCI NICs, including the following:
+ Compaq Netelligent 10, 10/100, 10/100 Proliant, 10/100 Dual-Port
+ Compaq Netelligent 10/100 TX Embedded UTP, 10 T PCI UTP/Coax, 10/100 TX UTP
+ Compaq NetFlex 3P, 3P Integrated, 3P w/ BNC
+ Olicom OC-2135/2138, OC-2325, OC-2326 10/100 TX UTP
+
+DEC EtherWORKS III NICs (DE203, DE204, and DE205)
+DEC EtherWORKS II NICs (DE200, DE201, DE202, and DE422)
+DEC DC21040, DC21041, or DC21140 based NICs (SMC Etherpower 8432T, DE245, etc)
+DEC FDDI (DEFPA/DEFEA) NICs
+
+Fujitsu MB86960A/MB86965A
+
+HP PC Lan+ cards (model numbers: 27247B and 27252A).
+
+Intel EtherExpress 16
+Intel EtherExpress Pro/10
+Intel EtherExpress Pro/100B PCI Fast Ethernet
+
+Isolan AT 4141-0 (16 bit)
+Isolink 4110 (8 bit)
+
+Novell NE1000, NE2000, and NE2100 ethernet interface.
+
+3Com 3C501 cards
+
+3Com 3C503 Etherlink II
+
+3Com 3c505 Etherlink/+
+
+3Com 3C507 Etherlink 16/TP
+
+3Com 3C509, 3C579, 3C589 (PCMCIA), 3C590/592/595/900/905/905B PCI and EISA
+(Fast) Etherlink III / (Fast) Etherlink XL
+
+Toshiba ethernet cards
+
+Crystal Semiconductor CS89x0-based NICs, including:
+ IBM Etherjet ISA
+
+PCMCIA ethernet cards from IBM and National Semiconductor are also
+supported.
+
+Note that NO token ring cards are supported at this time as we're
+still waiting for someone to donate a driver for one of them. Any
+takers?
+
+2.3 ATM
+-------
+
+ o ATM Host Interfaces
+ - FORE Systems, Inc. PCA-200E ATM PCI Adapters
+ - Efficient Networks, Inc. ENI-155p ATM PCI Adapters
+
+ o ATM Signalling Protocols
+ - The ATM Forum UNI 3.1 signalling protocol
+ - The ATM Forum UNI 3.0 signalling protocol
+ - The ATM Forum ILMI address registration
+ - FORE Systems's proprietary SPANS signalling protocol
+ - Permanent Virtual Channels (PVCs)
+
+ o IETF "Classical IP and ARP over ATM" model
+ - RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
+ - RFC 1577, "Classical IP and ARP over ATM"
+ - RFC 1626, "Default IP MTU for use over ATM AAL5"
+ - RFC 1755, "ATM Signaling Support for IP over ATM"
+ - RFC 2225, "Classical IP and ARP over ATM"
+ - RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
+ - Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
+ "A Distributed ATMARP Service Using SCSP"
+
+ o ATM Sockets interface
+
+2.4. Misc
+---------
+
+AST 4 port serial card using shared IRQ.
+
+ARNET 8 port serial card using shared IRQ.
+ARNET (now Digiboard) Sync 570/i high-speed serial.
+
+Boca BB1004 4-Port serial card (Modems NOT supported)
+Boca IOAT66 6-Port serial card (Modems supported)
+Boca BB1008 8-Port serial card (Modems NOT supported)
+Boca BB2016 16-Port serial card (Modems supported)
+
+Comtrol Rocketport card.
+
+Cyclades Cyclom-y Serial Board.
+
+STB 4 port card using shared IRQ.
+
+SDL Communications Riscom/8 Serial Board.
+SDL Communications RISCom/N2 and N2pci high-speed sync serial boards.
+
+Stallion multiport serial boards: EasyIO, EasyConnection 8/32 & 8/64,
+ONboard 4/16 and Brumby.
+
+Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound
+and Roland MPU-401 sound cards. (snd driver)
+
+Most ISA audio codecs manufactured by Crystal Semiconductors, OPTi, Creative
+Labs, Avance, Yamaha and ENSONIQ. (pcm driver)
+
+Connectix QuickCam
+Matrox Meteor Video frame grabber
+Creative Labs Video Spigot frame grabber
+Cortex1 frame grabber
+Hauppauge Wincast/TV boards (PCI)
+STB TV PCI
+Intel Smart Video Recorder III
+Various Frame grabbers based on Brooktree Bt848 chip.
+
+HP4020, HP6020, Philips CDD2000/CDD2660 and Plasmon CD-R drives.
+
+PS/2 mice
+
+Standard PC Joystick
+
+X-10 power controllers
+
+GPIB and Transputer drivers.
+
+Genius and Mustek hand scanners.
+
+Xilinx XC6200 based reconfigurable hardware cards compatible with
+the HOT1 from Virtual Computers (www.vcc.com)
+
+Support for Dave Mills experimental Loran-C receiver.
+
+FreeBSD currently does NOT support IBM's microchannel (MCA) bus.
+
+3. Obtaining FreeBSD
+--------------------
+
+You may obtain FreeBSD in a variety of ways:
+
+3.1. FTP/Mail
+-------------
+
+You can ftp FreeBSD and any or all of its optional packages from
+`ftp.freebsd.org' - the official FreeBSD release site.
+
+For other locations that mirror the FreeBSD software see the file
+MIRROR.SITES. Please ftp the distribution from the site closest (in
+networking terms) to you. Additional mirror sites are always welcome!
+Contact freebsd-admin@FreeBSD.org for more details if you'd like to
+become an official mirror site.
+
+If you do not have access to the Internet and electronic mail is your
+only recourse, then you may still fetch the files by sending mail to
+`ftpmail@ftpmail.vix.com' - putting the keyword "help" in your message
+to get more information on how to fetch files using this mechanism.
+Please do note, however, that this will end up sending many *tens of
+megabytes* through the mail and should only be employed as an absolute
+LAST resort!
+
+
+3.2. CDROM
+----------
+
+FreeBSD 3.0-RELEASE and 2.2.x-RELEASE CDs may be ordered on CDROM from:
+
+ Walnut Creek CDROM
+ 4041 Pike Lane, Suite D
+ Concord CA 94520
+ 1-800-786-9907, +1-925-674-0783, +1-925-674-0821 (FAX)
+
+Or via the Internet from orders@cdrom.com or http://www.cdrom.com.
+Their current catalog can be obtained via ftp from:
+
+ ftp://ftp.cdrom.com/cdrom/catalog
+
+Cost per -RELEASE CD is $39.95 or $24.95 with a FreeBSD subscription.
+FreeBSD SNAPshot CDs, when available, are $39.95 or $14.95 with a
+FreeBSD-SNAP subscription (-RELEASE and -SNAP subscriptions are entirely
+separate). With a subscription, you will automatically receive updates as
+they are released. Your credit card will be billed when each disk is
+shipped and you may cancel your subscription at any time without further
+obligation.
+
+Shipping (per order not per disc) is $5 in the US, Canada or Mexico
+and $9.00 overseas. They accept Visa, Mastercard, Discover, American
+Express or checks in U.S. Dollars and ship COD within the United
+States. California residents please add 8.25% sales tax.
+
+Should you be dissatisfied for any reason, the CD comes with an
+unconditional return policy.
+
+
+4. Upgrading from previous releases of FreeBSD
+----------------------------------------------
+
+If you're upgrading from a previous release of FreeBSD, most likely
+it's 2.2.x or 2.1.x (in some lesser number of cases) and some of the
+following issues may affect you, depending of course on your chosen
+method of upgrading. There are two popular ways of upgrading
+FreeBSD distributions:
+
+ o Using sources, via /usr/src
+ o Using sysinstall's (binary) upgrade option.
+
+In the case of using sources, there are simply two targets you need to
+be aware of: The standard ``world'' target, which will upgrade a 2.x
+system to 3.0, or the ``aout-to-elf'' target, which will both upgrade
+and convert the system to ELF binary format.
+In the case of using the binary upgrade option, the system will go
+straight to 3.0/ELF but also populate the /<basepath>/lib/aout
+directories for backwards compatibility with older binaries.
+
+In either case, going to ELF will mean that you'll have somewhat
+smaller binaries and access to a lot more compiler goodies which have
+been already been ported to other ELF environments (our older and
+somewhat crufty a.out format being largely unsupported by most other
+software projects), but on the downside you'll also have access to far
+fewer ports and packages since many of those have not been adapted to
+ELF yet. This will occur in time, but those who wish to retain access
+to the greatest number of packages and 3rd-party binaries should
+probably stick with a.out.
+
+The kernel is also still in a.out format at this time so that older
+LKMs and library interfaces can continue to work, but a full
+transition to ELF will occur at some point after 3.0-RELEASE. Those
+wishing to generate dynamic kernel components should therefore use the
+newer KLD mechanism rather than the older LKM format - the LKM format
+is not long for this world and will soon be unsupported!
+
+[ other important upgrading notes should go here]
+
+
+5. Reporting problems, making suggestions, submitting code.
+-----------------------------------------------------------
+Your suggestions, bug reports and contributions of code are always
+valued - please do not hesitate to report any problems you may find
+(preferably with a fix attached, if you can!).
+
+The preferred method to submit bug reports from a machine with
+Internet mail connectivity is to use the send-pr command or use the CGI
+script at http://www.freebsd.org/send-pr.html. Bug reports
+will be dutifully filed by our faithful bugfiler program and you can
+be sure that we'll do our best to respond to all reported bugs as soon
+as possible. Bugs filed in this way are also visible on our WEB site
+in the support section and are therefore valuable both as bug reports
+and as "signposts" for other users concerning potential problems to
+watch out for.
+
+If, for some reason, you are unable to use the send-pr command to
+submit a bug report, you can try to send it to:
+
+ freebsd-bugs@FreeBSD.org
+
+Note that send-pr itself is a shell script that should be easy to move
+even onto a totally different system. We much prefer if you could use
+this interface, since it make it easier to keep track of the problem
+reports. However, before submitting, please try to make sure whether
+the problem might have already been fixed since.
+
+
+Otherwise, for any questions or tech support issues, please send mail to:
+
+ freebsd-questions@FreeBSD.org
+
+
+Additionally, being a volunteer effort, we are always happy to have
+extra hands willing to help - there are already far more desired
+enhancements than we'll ever be able to manage by ourselves! To
+contact us on technical matters, or with offers of help, please send
+mail to:
+
+ freebsd-hackers@FreeBSD.org
+
+
+Please note that these mailing lists can experience *significant*
+amounts of traffic and if you have slow or expensive mail access and
+are only interested in keeping up with significant FreeBSD events, you
+may find it preferable to subscribe instead to:
+
+ freebsd-announce@FreeBSD.org
+
+
+All of the mailing lists can be freely joined by anyone wishing
+to do so. Send mail to MajorDomo@FreeBSD.org and include the keyword
+`help' on a line by itself somewhere in the body of the message. This
+will give you more information on joining the various lists, accessing
+archives, etc. There are a number of mailing lists targeted at
+special interest groups not mentioned here, so send mail to majordomo
+and ask about them!
+
+
+6. Acknowledgements
+-------------------
+
+FreeBSD represents the cumulative work of many dozens, if not
+hundreds, of individuals from around the world who have worked very
+hard to bring you this release. For a complete list of FreeBSD
+project staffers, please see:
+
+ http://www.freebsd.org/handbook/staff.html
+
+or, if you've loaded the doc distribution:
+
+ file:/usr/share/doc/handbook/staff.html
+
+
+Special mention to:
+
+ The donors listed at http://www.freebsd.org/handbook/donors.html
+
+ Justin M. Seger <jseger@freebsd.org> for almost single-handedly
+ converting the ports collection to ELF.
+
+ Doug Rabson <dfr@freebsd.org> and John Birrell <jb@freebsd.org>
+ for making FreeBSD/alpha happen and to the NetBSD project for
+ substantial indirect aid.
+
+ Peter Wemm <peter@freebsd.org> for the new kernel module system
+ (with substantial aid from Doug Rabson).
+
+ And to the many thousands of FreeBSD users and testers all over the
+ world, without whom this release simply would not have been possible.
+
+We sincerely hope you enjoy this release of FreeBSD!
+
+ The FreeBSD Project
diff --git a/release/sysinstall/help/shortcuts.hlp b/release/sysinstall/help/shortcuts.hlp
index 503a2a770cbc..40cd1a40a69e 100644
--- a/release/sysinstall/help/shortcuts.hlp
+++ b/release/sysinstall/help/shortcuts.hlp
@@ -15,7 +15,7 @@ browserBinary Which doc browser to use (default: lynx)
browserPackage Which package to get browser from (default: lynx)
cpioVerbose How verbose to be with cpio: high, medium or low
debug Extra debugging?
-disk Which disk to operate on (wd0, da0, etc).
+disk Which disk to operate on (wd0, sd0, etc).
domainname Domain name
editor Which screen editor to use
ifconfig_<iface> For each <iface> in network_devices
@@ -106,9 +106,9 @@ Examples:
Selects an FTP site and then goes to the package configuration menu.
-/stand/sysinstall disk=da0 diskPartitionEditor
+/stand/sysinstall disk=sd0 diskPartitionEditor
-Invokes the disk partition editor on disk da0.
+Invokes the disk partition editor on disk sd0.
If /stand/sysinstall is linked to another filename, say
diff --git a/release/sysinstall/help/trouble.hlp b/release/sysinstall/help/trouble.hlp
new file mode 100644
index 000000000000..ca374caa4d0a
--- /dev/null
+++ b/release/sysinstall/help/trouble.hlp
@@ -0,0 +1,374 @@
+===============
+Troubleshooting
+===============
+
+ Table of Contents:
+
+ Repairing an Existing FreeBSD Installation
+
+ Common Installation Problems, Q&A
+
+ Common Hardware Problems, Q&A
+
+Repairing an Existing FreeBSD Installation
+------------------------------------------
+
+FreeBSD releases 2.2.1 and later feature a "Fixit" option in the top
+menu of the boot floppy. To use it, you will also need either a
+fixit.flp image floppy, generated in the same fashion as the boot
+floppy, or the 2nd CDROM from Walnut Creek CDROM's FreeBSD
+distribution.
+
+To invoke fixit, simply boot the boot floppy, chose the "Fixit" item
+and insert the fixit floppy or CDROM when asked. You will then be
+placed into a shell with a wide variety of commands available (in the
+/stand and /mnt2/stand directories) for checking, repairing and
+examining file systems and their contents. Some UNIX administration
+experience *is* required to use the fixit option!
+
+Common Installation Problems, Q&A
+---------------------------------
+
+Q: I go to boot from the hard disk for the first time after installing
+ FreeBSD, the kernel loads and probes my hardware, but stops with
+ messages like:
+
+ changing root device to wd1s1a
+ panic: cannot mount root
+
+ What is wrong? What can I do?
+
+Q: What is this 'bios_drive:interface(unit,partition)kernel_name' thing
+ that is displayed with the boot help?
+
+A: There is a longstanding problem in the case where the boot disk is
+ not the first disk in the system. The BIOS uses a different numbering
+ scheme to FreeBSD, and working out which numbers correspond to which
+ is difficult to get right.
+
+ In the case where the boot disk is not the first disk in the system,
+ FreeBSD can need some help finding it. There are two common situations
+ here, and in both of these cases, you need to tell FreeBSD where the
+ root filesystem is. You do this by specifying the BIOS disk number,
+ the disk type and the FreeBSD disk number for that type.
+
+ The first situation is where you have two IDE disks, each configured as
+ the master on their respective IDE busses, and wish to boot FreeBSD from
+ the second disk. The BIOS sees these as disk 0 and disk 1, while
+ FreeBSD sees them as wd0 and wd2.
+
+ FreeBSD is on BIOS disk 1, of type 'wd' and the FreeBSD disk number
+ is 2, so you would say:
+
+ 1:wd(2,a)kernel
+
+ Note that if you have a slave on the primary bus, the above is not
+ necessary (and is effectively wrong).
+
+ The second situation involves booting from a SCSI disk when you have
+ one or more IDE disks in the system. In this case, the FreeBSD disk
+ number is lower than the BIOS disk number. If you have two IDE disks
+ as well as the SCSI disk, the SCSI disk is BIOS disk 2, type 'da' and
+ FreeBSD disk number 0, so you would say:
+
+ 2:da(0,a)kernel
+
+ To tell FreeBSD that you want to boot from BIOS disk 2, which is
+ the first SCSI disk in the system. If you only had one IDE disk,
+ you would use '1:' instead.
+
+ Once you have determined the correct values to use, you can put the
+ command exactly as you would have typed it in the /boot.config file
+ using a standard text editor.
+ Unless instructed otherwise, FreeBSD will use the contents of this
+ file as the default response to the 'boot:' prompt.
+
+Q: I go to boot from the hard disk for the first time after installing
+ FreeBSD, but the Boot Manager prompt just prints `F?' at the boot menu
+ each time but the boot won't go any further.
+
+A: The hard disk geometry was set incorrectly in the Partition editor when
+ you installed FreeBSD. Go back into the partition editor and specify
+ the actual geometry of your hard disk. You must reinstall FreeBSD
+ again from the beginning with the correct geometry.
+
+ If you are failing entirely in figuring out the correct geometry for
+ your machine, here's a tip: Install a small DOS partition at the
+ beginning of the disk and install FreeBSD after that. The install
+ program will see the DOS partition and try to infer the correct
+ geometry from it, which usually works.
+
+ The following tip is no longer recommended, but is left here
+ for reference:
+
+ If you are setting up a truly dedicated FreeBSD server or work-
+ station where you don't care for (future) compatibility with DOS,
+ Linux or another operating system, you've also got the option to use
+ the entire disk (`A' in the partition editor), selecting the
+ non-standard option where FreeBSD occupies the entire disk from
+ the very first to the very last sector. This will leave all geometry
+ considerations aside, but is somewhat limiting unless you're never
+ going to run anything other than FreeBSD on a disk.
+
+
+Known Hardware Problems, Q & A
+------------------------------
+
+Q: mcd0 keeps thinking that it has found a device and this stops my Intel
+ EtherExpress card from working.
+
+A: Use the UserConfig utility (see HARDWARE.TXT) and disable the probing of
+ the mcd0 and mcd1 devices. Generally speaking, you should only leave
+ the devices that you will be using enabled in your kernel.
+
+
+Q: FreeBSD claims to support the 3Com PCMCIA card, but my card isn't
+ recognized when it's plugged into my laptop.
+
+A: There are a couple of possible problems. First of all, FreeBSD does
+ not support multi-function cards, so if you have a combo
+ ethernet/modem card (such as the 3C562), it won't work. The
+ default driver for the 3C589 card was written just like all of the
+ other drivers in FreeBSD, and depend on the card's own configuration
+ data stored in NVRAM to work. You must correctly configure FreeBSD's
+ driver to match the IRQ, port, and IOMEM stored in NVRAM.
+ Unfortunately, the only program capable of reading them is the
+ 3COM supplied DOS program. This program must be run on a absolutely
+ clean system (no other drivers must be running), and the program will
+ whine about CARD-Services not being found, but it will continue.
+ This is necessary to read the NVRAM values. You want to know the
+ IRQ, port, and IOMEM values (the latter is called the CIS tuple by
+ 3COM). The first two can be set in the program, the third is
+ un-settable, and can only be read. Once you have these values, set
+ them in UserConfig and your card will be recognized.
+
+
+Q: FreeBSD finds my PCMCIA network card, but no packets appear to
+ be sent even though it claims to be working.
+
+A: Many PCMCIA cards have the ability to use either the 10-Base2 (BNC)
+ or 10-BaseT connectors for connecting to the network. The driver is
+ unable to 'auto-select' the correct connector, so you must tell it
+ which connector to use. In order to switch between the two
+ connectors, the link flags must be set. Depending on the model of
+ the card, '-link0 link1' or 'link0 -link1' will choose the correct
+ network connector. You can set these in sysinstall by using the
+ 'Extra options to ifconfig:' field in the network setup screen.
+
+
+Q: The system finds my ed network card, but I keep getting device
+ timeout errors.
+
+A: Your card is probably on a different IRQ from what is specified in the
+ kernel configuration. The ed driver does not use the `soft' configuration
+ by default (values entered using EZSETUP in DOS), but it will use the
+ software configuration if you specify `?' in the IRQ field of your kernel
+ config file.
+
+ Either move the jumper on the card to a hard configuration setting
+ (altering the kernel settings if necessary), or specify the IRQ as
+ `-1' in UserConfig or `?' in your kernel config file. This will
+ tell the kernel to use the soft configuration.
+
+ Another possibility is that your card is at IRQ 9, which is shared
+ by IRQ 2 and frequently a cause of problems (especially when you
+ have a VGA card using IRQ 2! :). You should not use IRQ 2 or 9 if at
+ all possible.
+
+
+Q: I have a Matsushita/Panasonic drive but it isn't recognized by the
+ system.
+
+A: Make certain that the I/O port that the matcd driver is set to is
+ correct for the host interface card you have. (Some SoundBlaster DOS
+ drivers report a hardware I/O port address for the CD-ROM interface
+ that is 0x10 lower than it really is.)
+
+ If you are unable to determine the settings for the card by examining
+ the board or documentation, you can use UserConfig to change the 'port'
+ address (I/O port) to -1 and start the system. This setting causes the
+ driver to look at a number of I/O ports that various manufacturers
+ use for their Matsushita/Panasonic/Creative CD-ROM interfaces.
+ Once the driver locates the address, you should run UserConfig again
+ and specify the correct address. Leaving the 'port' parameter set to -1
+ increases the amount of time that it takes the system to boot, and
+ this could interfere with other devices.
+
+ The double-speed Matsushita CR-562 and CR-563 are the only drives
+ that are supported.
+
+
+Q: I booted the install floppy on my IBM ThinkPad (tm) laptop, and the
+ keyboard is all messed up.
+
+A: Older IBM laptops use a non-standard keyboard controller, so you must
+ tell the console driver (sc0) to go into a special mode which works
+ on the ThinkPads. Change the sc0 'Flags' to 0x10 in UserConfig and
+ it should work fine. (Look in the Input Menu for 'Syscons Console
+ Driver'.)
+
+
+Q: I have a Matsushita/Panasonic CR-522, a Matsushita/Panasonic CR-523 or
+ a TEAC CD55a drive, but it is not recognized even when the correct I/O
+ port is set.
+
+A: These CD-ROM drives are currently not supported by FreeBSD. The command
+ sets for these drives are not compatible with the double-speed CR-562
+ and CR-563 drives.
+
+ The single-speed CR-522 and CR-523 drives can be identified by their
+ use of a CD-caddy.
+
+
+Q: I'm trying to install from a tape drive but all I get is something like:
+ st0(aha0:1:0) NOT READY csi 40,0,0,0
+ on the screen. Help!
+
+A: There's a limitation in the current sysinstall that the tape MUST
+ be in the drive while sysinstall is started or it won't be detected.
+ Try again with the tape in the drive the whole time.
+
+
+Q: I've installed FreeBSD onto my system, but it hangs when booting from
+ the hard drive with the message: ``Changing root to /dev/sd0a''.
+
+A: This problem may occur in a system with a 3com 3c509 Ethernet adaptor.
+ The ep0 device driver appears to be sensitive to probes for other
+ devices that also use address 0x300. Boot your FreeBSD system by power
+ cycling the machine (turn off and on). At the ``Boot:'' prompt specify
+ the ``-c''. This will invoke UserConfig (see Section 1. above). Use
+ the ``disable'' command to disable the device probes for all devices
+ at address 0x300 except the ep0 driver. On exit, your machine should
+ successfully boot FreeBSD.
+
+
+Q: My system hangs during boot, right after the "fd0: [my floppy drive]"
+ line.
+
+A: This is not actually a hang, simply a very LONG "wdc0" probe that
+ often takes a long time to complete on certain systems (where there
+ usually _isn't_ a WD controller). Be patient, your system will boot!
+ To eliminate the problem, boot with the -c flag and eliminate the wdc0
+ device, or compile a custom kernel.
+
+
+Q: My system can not find my Intel EtherExpress 16 card.
+
+A: You must set your Intel EtherExpress 16 card to be memory mapped at
+ address 0xD0000, and set the amount of mapped memory to 32K using
+ the Intel supplied softset.exe program.
+
+
+Q: When installing on an EISA HP Netserver, my on-board AIC-7xxx
+ SCSI controller isn't detected.
+
+A: This is a known problem, and will hopefully be fixed in the future.
+ In order to get your system installed at all, boot with the -c
+ option into UserConfig, but _don't_ use the pretty visual mode but
+ the plain old CLI mode. Type
+
+ eisa 12
+ quit
+
+ there at the prompt. (Instead of `quit', you might also type
+ `visual', and continue the rest of the configuration session in
+ visual mode.) While it's recommended to compile a custom kernel,
+ dset(8) now also understands to save this value.
+
+ Refer to the FAQ topic 3.16 for an explanation of the problem, and
+ for how to continue. Remember that you can find the FAQ on your
+ local system in /usr/share/doc/FAQ, provided you have installed the
+ `doc' distribution.
+
+
+Q: I have a Panasonic AL-N1 or Rios Chandler Pentium machine and I find
+ that the system hangs before ever getting into the installation
+ now.
+
+A: Your machine doesn't like the new i586_copyout and i586_copyin code
+ for some reason. To disable this, boot the installation boot floppy
+ and when it comes to the very first menu (the choice to drop into
+ kernel UserConfig mode or not) choose the command-line interface
+ ("expert mode") version and type the following at it:
+
+ flags npx0 1
+
+ Then proceed normally to boot. This will be saved into your kernel,
+ so you only need to do it once.
+
+
+Q: I have this CMD640 IDE controller that is said to be broken.
+
+A: Yes, it is. There's a workaround available now and it is enabled
+ automatically if this chip is used on your system.
+ For the details refer to the manual page of the disk driver (man 4 wd).
+
+
+Q: On a Compaq Aero notebook, I get the message "No floppy devices found!
+ Please check ..." when trying to install from floppy.
+
+A: With Compaq being always a little different from other systems, they
+ do not announce their floppy drive in the CMOS RAM of an Aero notebook.
+ Therefore, the floppy disk driver assumes there is no drive configured.
+ Go to the UserConfig screen, and set the Flags value of the fdc0 device
+ to 0x1. This pretends the existence of the first floppy drive (as a
+ 1.44 MB drive) to the driver without asking the CMOS at all.
+
+
+Q: When I go to boot my Intel AL440LX ("Atlanta") -based system from the
+ hard disk the first time, it stops with a "Read Error" message.
+
+A: There appears to be a bug in the BIOS on at least some of these boards,
+ this bug results in the FreeBSD bootloader thinking that it is booting
+ from a floppy disk.
+ This is only a problem if you are not using the BootEasy boot manager.
+ Slice the disk in 'compatible' mode and install BootEasy during the
+ FreeBSD installation to avoid the bug, or upgrade the BIOS (see Intel's
+ website for details).
+
+Q: When installing on an Dell Poweredge XE, Dell proprietary RAID controller
+ DSA (Dell SCSI Array) isn't recognized.
+
+A: Configure DSA to use AHA-1540 emulation using EISA configuration utility.
+ After that FreeBSD detects DSA as Adaptec AHA-1540 SCSI controller, with
+ irq 11 and port 340. Under emulation mode system will use DSA RAID disks,
+ but you cannot use DSA specific features such as watching RAID health.
+
+
+Q: My Ethernet adapter is detected as an AMD PCnet-FAST (or similar) but
+ it doesn't work. (Eg. onboard Ethernet on IBM Netfinity 5xxx or 7xxx)
+
+A: The 'lnc' driver is currently faulty, and will often not work correctly
+ with the PCnet-FAST and PCnet-FAST+. You need to install a different
+ Ethernet adapter.
+
+
+Q: I have an IBM EtherJet PCI card, it is detected by the 'fxp' driver
+ correctly, but the lights on the card don't come on and it doesn't
+ connect to the network.
+
+A: We don't understand why this happens. Neither do IBM (we asked them).
+ The card is a standard Intel EtherExpress Pro/100 with an IBM label
+ on it, and these cards normally work just fine. You may see these
+ symptoms only in some IBM Netfinity servers. The only solution is to
+ install a different Ethernet adapter.
+
+
+Q: When I configure the network during installation on an IBM Netfinity
+ 3500, the system freezes.
+
+A: There is a problem with the onboard Ethernet in the Netfinity 3500
+ which we have not been able to identify at this time. It may be
+ related to the SMP features of the system being misconfigured. You
+ will have to install another Ethernet adapter, and avoid attempting
+ to configure the onboard adapter at any time.
+
+
+Q: Why does my CD-220E (rev 1.0D) IDE CD-ROM lock up the system when
+ I use it?
+
+A: There are apparently firmware problems with this drive and,
+ though a fix may soon be forthcoming, it should probably be avoided
+ for now.
+
+[ Please send hardware tips for this Q&A section to jkh@freebsd.org ]
diff --git a/release/texts/UPGRADE.TXT b/release/sysinstall/help/upgrade.hlp
index 8b7b893e2316..8b7b893e2316 100644
--- a/release/texts/UPGRADE.TXT
+++ b/release/sysinstall/help/upgrade.hlp
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c
index 5ff2ceb7b348..5d44d651ac11 100644
--- a/release/sysinstall/index.c
+++ b/release/sysinstall/index.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: index.c,v 1.59 1998/12/22 12:31:25 jkh Exp $
+ * $Id: index.c,v 1.56 1998/10/13 07:31:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -65,24 +65,24 @@ static char *descrs[] = {
"If you're sure of these choices, select OK.\n"
"If not, select Cancel to go back to the package selection menu.\n",
"All", "All available packages in all categories.",
- "afterstep", "Ports to support the AfterStep window manager.",
"applications", "User application software.",
"astro", "Applications related to astronomy.",
"archivers", "Utilities for archiving and unarchiving data.",
"audio", "Audio utilities - most require a supported sound card.",
- "biology", "Software related to biology.",
+ "biology", "Software related to Biology.",
"benchmarks", "Utilities for measuring system performance.",
+ "benchmarking", "Utilities for measuring system performance.",
"cad", "Computer Aided Design utilities.",
"chinese", "Ported software for the Chinese market.",
"comms", "Communications utilities.",
- "converters", "Format conversion utilities.",
+ "converters", "Format conversion utilities..",
"databases", "Database software.",
"devel", "Software development utilities and libraries.",
+ "development", "Software development utilities and libraries.",
"deskutils", "Various Desktop utilities.",
"documentation", "Document preparation utilities.",
"editors", "Common text editors.",
- "elisp", "Things related to Emacs Lisp.",
- "elisp", "Emacs lisp ports.",
+ "emulation", "Utilities for emulating other OS types.",
"emulators", "Utilities for emulating other OS types.",
"games", "Various and sundry amusements.",
"german", "Ported software for Germanic countries.",
@@ -95,43 +95,45 @@ static char *descrs[] = {
"libraries", "Software development libraries.",
"mail", "Electronic mail packages and utilities.",
"math", "Mathematical computation software.",
- "mbone", "Applications and utilities for the MBONE.",
+ "mbone", "Applications and utilities for the mbone.",
"misc", "Miscellaneous utilities.",
"net", "Networking utilities.",
+ "networking", "Networking utilities.",
"news", "USENET News support software.",
"numeric", "Mathematical computation software.",
"offix", "An office automation suite of sorts.",
"orphans", "Packages without a home elsewhere.",
- "palm", "Software support for the 3Com Palm(tm) series.",
- "perl5", "Utilities/modules for the PERL5 language.",
- "plan9", "Software from the Plan9 operating system.",
+ "perl5", "Utilities/modules for the PERL5 language..",
+ "pilot", "Software support for the USR Palm Pilot(tm).",
+ "plan9", "Software from the plan9 Operating System.",
"print", "Utilities for dealing with printing.",
"printing", "Utilities for dealing with printing.",
"programming", "Software development utilities and libraries.",
- "python", "Software related to the Python language.",
+ "python", "Software related to the python language.",
"russian", "Ported software for the Russian market.",
"security", "System security software.",
"shells", "Various shells (tcsh, bash, etc).",
"sysutils", "Various system utilities.",
"textproc", "Text processing/search utilities.",
- "tcl75", "TCL v7.5 and packages that depend on it.",
- "tcl76", "TCL v7.6 and packages that depend on it.",
- "tcl80", "TCL v8.0 and packages that depend on it.",
- "tcl81", "TCL v8.1 and packages that depend on it.",
- "tk41", "Tk4.1 and packages that depend on it.",
- "tk42", "Tk4.2 and packages that depend on it.",
- "tk80", "Tk8.0 and packages that depend on it.",
- "tk81", "Tk8.1 and packages that depend on it.",
- "troff", "TROFF text formatting utilities.",
+ "tcl75", "TCL v7.5 and packages which depend on it.",
+ "tcl76", "TCL v7.6 and packages which depend on it.",
+ "tcl80", "TCL v8.0 and packages which depend on it.",
+ "tcl81", "TCL v8.1 and packages which depend on it.",
+ "tk41", "Tk4.1 and packages which depend on it.",
+ "tk42", "Tk4.2 and packages which depend on it.",
+ "tk80", "Tk8.0 and packages which depend on it.",
+ "tk81", "Tk8.1 and packages which depend on it.",
+ "troff", "TROFF Text formatting utilities.",
+ "utils", "Various user utilities.",
+ "utilities", "Various user utilities.",
"vietnamese", "Ported software for the Vietnamese market.",
- "windowmaker", "Ports to support the WindowMaker window manager.",
"www", "WEB utilities (browers, HTTP servers, etc).",
"x11", "X Window System based utilities.",
"x11-clocks", "X Window System based clocks.",
"x11-fm", "X Window System based file managers.",
- "x11-fonts", "X Window System fonts and font utilities.",
+ "x11-fonts", "X Window System fonts.",
"x11-toolkits", "X Window System based development toolkits.",
- "x11-wm", "X Window System window managers.",
+ "x11-wm", "X Window System Window Managers.",
NULL, NULL,
};
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index fc1f42ede8f4..c2709b14354a 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.222 1999/01/20 11:56:39 jkh Exp $
+ * $Id: install.c,v 1.215 1998/10/12 23:47:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -35,6 +35,7 @@
*/
#include "sysinstall.h"
+#include "uc_main.h"
#include <ctype.h>
#include <sys/disklabel.h>
#include <sys/errno.h>
@@ -48,11 +49,13 @@
#include <msdosfs/msdosfsmount.h>
#undef MSDOSFS
#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <unistd.h>
static void create_termcap(void);
static void fixit_common(void);
+#ifdef SAVE_USERCONFIG
+static void save_userconfig_to_kernel(char *);
+#endif
#define TERMCAP_FILE "/usr/share/misc/termcap"
@@ -194,7 +197,6 @@ static int
installInitial(void)
{
static Boolean alreadyDone = FALSE;
- int status = DITEM_SUCCESS;
if (alreadyDone)
return DITEM_SUCCESS;
@@ -238,18 +240,13 @@ installInitial(void)
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
-
- /* Configure various files in /etc */
- if (DITEM_STATUS(configResolv(NULL)) == DITEM_FAILURE)
- status = DITEM_FAILURE;
- if (DITEM_STATUS(configFstab(NULL)) == DITEM_FAILURE)
- status = DITEM_FAILURE;
+ configResolv();
/* stick a helpful shell over on the 4th VTY */
systemCreateHoloshell();
alreadyDone = TRUE;
- return status;
+ return DITEM_SUCCESS;
}
int
@@ -362,8 +359,6 @@ installFixitFloppy(dialogMenuItem *self)
"or unclean filesystem. Do you want to try again?"))
return DITEM_FAILURE;
}
- else
- break;
}
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
@@ -451,10 +446,8 @@ installExpress(dialogMenuItem *self)
int i;
variable_set2(SYSTEM_STATE, "express");
-#ifndef __alpha__
if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE)
return i;
-#endif
if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE)
return i;
@@ -476,7 +469,6 @@ installNovice(dialogMenuItem *self)
Device **devs;
variable_set2(SYSTEM_STATE, "novice");
-#ifndef __alpha__
dialog_clear_norefresh();
msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n"
"scheme for your hard disk. If you simply wish to devote all disk space\n"
@@ -495,24 +487,14 @@ nodisks:
++tries;
goto nodisks;
}
-#endif
dialog_clear_norefresh();
-#ifdef __alpha__
- msgConfirm("First, you need to create BSD partitions on the disk which you are\n"
- "installing to. If you have a reasonable amount of disk space (200MB or more)\n"
- "and don't have any special requirements, simply use the (A)uto command to\n"
- "allocate space automatically. If you have more specific needs or just don't\n"
- "care for the layout chosen by (A)uto, press F1 for more information on\n"
- "manual layout.");
-#else
- msgConfirm("First, you need to create BSD partitions inside of the fdisk partition(s)\n"
+ msgConfirm("Next, you need to create BSD partitions inside of the fdisk partition(s)\n"
"just created. If you have a reasonable amount of disk space (200MB or more)\n"
"and don't have any special requirements, simply use the (A)uto command to\n"
"allocate space automatically. If you have more specific needs or just don't\n"
"care for the layout chosen by (A)uto, press F1 for more information on\n"
"manual layout.");
-#endif
if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
@@ -683,6 +665,7 @@ installCommit(dialogMenuItem *self)
{
int i;
char *str;
+ Boolean need_bin;
if (!Dists)
distConfig(NULL);
@@ -698,9 +681,13 @@ installCommit(dialogMenuItem *self)
if (isDebug())
msgDebug("installCommit: System state is `%s'\n", str);
- /* Installation stuff we wouldn't do to a running system */
- if (RunningAsInit && DITEM_STATUS((i = installInitial())) == DITEM_FAILURE)
- return i;
+ if (RunningAsInit) {
+ /* Do things we wouldn't do to a multi-user system */
+ if (DITEM_STATUS((i = installInitial())) == DITEM_FAILURE)
+ return i;
+ if (DITEM_STATUS((i = configFstab())) == DITEM_FAILURE)
+ return i;
+ }
try_media:
if (!mediaDevice->init(mediaDevice)) {
@@ -716,9 +703,11 @@ try_media:
return DITEM_FAILURE | DITEM_RESTORE;
}
- /* Now go get it all */
+ need_bin = Dists & DIST_BIN;
i = distExtractAll(self);
-
+ /* Only do fixup if bin dist was successfully extracted */
+ if (need_bin && !(Dists & DIST_BIN))
+ i |= installFixup(self);
/* When running as init, *now* it's safe to grab the rc.foo vars */
installEnvironment();
@@ -744,35 +733,33 @@ installConfigure(void)
}
int
-installFixupBin(dialogMenuItem *self)
+installFixup(dialogMenuItem *self)
{
Device **devs;
int i;
- /* All of this is done only as init, just to be safe */
- if (RunningAsInit) {
- /* Fix up kernel first */
- if (!file_readable("/kernel")) {
- if (file_readable("/kernel.GENERIC")) {
- if (vsystem("cp -p /kernel.GENERIC /kernel")) {
- msgConfirm("Unable to copy /kernel into place!");
- return DITEM_FAILURE;
- }
- /* Snapshot any boot -c changes back to the new kernel */
- if (kget("/kernel.config")) {
- msgConfirm("Kernel copied OK, but unable to save boot -c changes\n"
- "to it. See the debug screen (ALT-F2) for details.");
- }
- }
- else {
- msgConfirm("Can't find a kernel image to link to on the root file system!\n"
- "You're going to have a hard time getting this system to\n"
- "boot from the hard disk, I'm afraid!");
+ if (!file_readable("/kernel")) {
+ if (file_readable("/kernel.GENERIC")) {
+ if (vsystem("cp -p /kernel.GENERIC /kernel")) {
+ msgConfirm("Unable to link /kernel into place!");
return DITEM_FAILURE;
}
+#ifdef SAVE_USERCONFIG
+ /* Snapshot any boot -c changes back to the new kernel */
+ if (!variable_cmp(VAR_RELNAME, RELEASE_NAME))
+ save_userconfig_to_kernel("/kernel");
+#endif
}
-
- /* BOGON #1: Resurrect /dev after bin distribution screws it up */
+ else {
+ msgConfirm("Can't find a kernel image to link to on the root file system!\n"
+ "You're going to have a hard time getting this system to\n"
+ "boot from the hard disk, I'm afraid!");
+ return DITEM_FAILURE;
+ }
+ }
+
+ /* Resurrect /dev after bin distribution screws it up */
+ if (RunningAsInit) {
msgNotify("Remaking all devices.. Please wait!");
if (vsystem("cd /dev; sh MAKEDEV all")) {
msgConfirm("MAKEDEV returned non-zero status");
@@ -788,7 +775,7 @@ installFixupBin(dialogMenuItem *self)
for (i = 0; devs[i]; i++) {
Disk *disk = (Disk *)devs[i]->private;
Chunk *c1;
-
+
if (!devs[i]->enabled)
continue;
if (!disk->chunks)
@@ -803,18 +790,30 @@ installFixupBin(dialogMenuItem *self)
}
}
}
-
+
+ /* Do all the last ugly work-arounds here */
+ msgNotify("Fixing permissions..");
+ /* BOGON #1: XFree86 requires various specialized fixups */
+ if (directory_exists("/usr/X11R6")) {
+ vsystem("chmod -R a+r /usr/X11R6");
+ vsystem("find /usr/X11R6 -type d | xargs chmod a+x");
+
+ /* Also do bogus minimal package registration so ports don't whine */
+ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz"))
+ vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz");
+ }
+
/* BOGON #2: We leave /etc in a bad state */
chmod("/etc", 0755);
-
+
/* BOGON #3: No /var/db/mountdtab complains */
Mkdir("/var/db");
creat("/var/db/mountdtab", 0644);
-
+
/* BOGON #4: /compat created by default in root fs */
Mkdir("/usr/compat");
vsystem("ln -s /usr/compat /compat");
-
+
/* BOGON #5: aliases database not build for bin */
vsystem("newaliases");
@@ -828,27 +827,6 @@ installFixupBin(dialogMenuItem *self)
vsystem("mtree -deU -f /etc/mtree/BSD.root.dist -p /");
vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var");
vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr");
-
- /* Do all the last ugly work-arounds here */
- }
- return DITEM_SUCCESS;
-}
-
-/* Fix side-effects from the the XFree86 installation */
-int
-installFixupXFree(dialogMenuItem *self)
-{
- /* BOGON #1: XFree86 requires various specialized fixups */
- if (directory_exists("/usr/X11R6")) {
- msgNotify("Fixing permissions in XFree86 tree..");
- vsystem("chmod -R a+r /usr/X11R6");
- vsystem("find /usr/X11R6 -type d | xargs chmod a+x");
-
- /* Also do bogus minimal package registration so ports don't whine */
- if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) {
- msgNotify("Installing package metainfo..");
- vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz");
- }
}
return DITEM_SUCCESS;
}
@@ -970,7 +948,7 @@ installFilesystems(dialogMenuItem *self)
if (c2 == rootdev)
continue;
- if (tmp->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name)))
+ if (tmp->newfs && (!upgrade || !msgYesNo("You are upgradding - are you SURE you want to newfs /dev/%s?", c2->name)))
command_shell_add(tmp->mountpoint, "%s %s/dev/r%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name);
else
command_shell_add(tmp->mountpoint, "fsck -y %s/dev/r%s", RunningAsInit ? "/mnt" : "", c2->name);
@@ -1014,20 +992,6 @@ installFilesystems(dialogMenuItem *self)
return DITEM_SUCCESS;
}
-static char *
-getRelname(void)
-{
- static char buf[64];
- int sz = (sizeof buf) - 1;
-
- if (sysctlbyname("kern.osrelease", buf, &sz, NULL, 0) != -1) {
- buf[sz] = '\0';
- return buf;
- }
- else
- return "<unknown>";
-}
-
/* Initialize various user-settable values to their defaults */
int
installVarDefaults(dialogMenuItem *self)
@@ -1035,7 +999,7 @@ installVarDefaults(dialogMenuItem *self)
char *cp;
/* Set default startup options */
- variable_set2(VAR_RELNAME, getRelname());
+ variable_set2(VAR_RELNAME, RELEASE_NAME);
variable_set2(VAR_CPIO_VERBOSITY, "high");
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE);
variable_set2(VAR_INSTALL_ROOT, "/");
@@ -1045,13 +1009,13 @@ installVarDefaults(dialogMenuItem *self)
cp = "/usr/bin/ee";
variable_set2(VAR_EDITOR, cp);
variable_set2(VAR_FTP_USER, "ftp");
- variable_set2(VAR_BROWSER_PACKAGE, "lynx");
+ variable_set2(VAR_BROWSER_PACKAGE, PACKAGE_LYNX);
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
variable_set2(VAR_FTP_STATE, "passive");
variable_set2(VAR_NFS_SECURE, "YES");
variable_set2(VAR_PKG_TMPDIR, "/usr/tmp");
- variable_set2(VAR_GATED_PKG, "gated");
- variable_set2(VAR_PCNFSD_PKG, "pcnfsd");
+ variable_set2(VAR_GATED_PKG, PACKAGE_GATED);
+ variable_set2(VAR_PCNFSD_PKG, PACKAGE_PCNFSD);
variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT));
if (getpid() != 1)
variable_set2(SYSTEM_STATE, "update");
@@ -1117,3 +1081,62 @@ create_termcap(void)
fclose(fp);
}
}
+
+#ifdef SAVE_USERCONFIG
+static void
+save_userconfig_to_kernel(char *kern)
+{
+ struct kernel *core, *boot;
+ struct list *c_isa, *b_isa, *c_dev, *b_dev;
+ int i, d;
+
+ if ((core = uc_open("-incore")) == NULL) {
+ msgDebug("save_userconf: Can't read in-core information for kernel.\n");
+ return;
+ }
+
+ if ((boot = uc_open(kern)) == NULL) {
+ msgDebug("save_userconf: Can't read device information for kernel image %s\n", kern);
+ return;
+ }
+
+ msgNotify("Saving any boot -c changes to new kernel...");
+ c_isa = uc_getdev(core, "-isa");
+ b_isa = uc_getdev(boot, "-isa");
+ if (isDebug())
+ msgDebug("save_userconf: got %d ISA device entries from core, %d from boot.\n", c_isa->ac, b_isa->ac);
+ for (d = 0; d < c_isa->ac; d++) {
+ if (isDebug())
+ msgDebug("save_userconf: ISA device loop, c_isa->av[%d] = %s\n", d, c_isa->av[d]);
+ if (strcmp(c_isa->av[d], "npx0")) { /* special case npx0, which mucks with its id_irq member */
+ c_dev = uc_getdev(core, c_isa->av[d]);
+ b_dev = uc_getdev(boot, b_isa->av[d]);
+ if (!c_dev || !b_dev) {
+ msgDebug("save_userconf: c_dev: %x b_dev: %x\n", c_dev, b_dev);
+ continue;
+ }
+ if (isDebug())
+ msgDebug("save_userconf: ISA device %s: %d config parameters (core), %d (boot)\n",
+ c_isa->av[d], c_dev->ac, b_dev->ac);
+ for (i = 0; i < c_dev->ac; i++) {
+ if (isDebug())
+ msgDebug("save_userconf: c_dev->av[%d] = %s, b_dev->av[%d] = %s\n", i, c_dev->av[i], i, b_dev->av[i]);
+ if (strcmp(c_dev->av[i], b_dev->av[i])) {
+ if (isDebug())
+ msgDebug("save_userconf: %s (boot) -> %s (core)\n",
+ c_dev->av[i], b_dev->av[i]);
+ isa_setdev(boot, c_dev);
+ }
+ }
+ }
+ else {
+ if (isDebug())
+ msgDebug("skipping npx0\n");
+ }
+ }
+ if (isDebug())
+ msgDebug("Closing kernels\n");
+ uc_close(core, 0);
+ uc_close(boot, 1);
+}
+#endif
diff --git a/release/sysinstall/install.cfg b/release/sysinstall/install.cfg
index cade7a27ed5f..478156d5d579 100644
--- a/release/sysinstall/install.cfg
+++ b/release/sysinstall/install.cfg
@@ -25,7 +25,7 @@ mediaSetFTP
################################
# Select which distributions we want.
-dists=bin doc manpages info compat21 des src sbase ssys
+dists=bin doc manpages info compat21 des src sbase slkm ssys
distSetCustom
################################
@@ -74,12 +74,12 @@ diskLabelEditor
################################
# And the 3rd.
-disk=da0
+disk=sd0
partition=exclusive
diskPartitionEditor
-da0s1-1=swap 40960 none
-da0s1-2=ufs 0 /tmp
+sd0s1-1=swap 40960 none
+sd0s1-2=ufs 0 /tmp
diskLabelEditor
################################
diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c
index 3cc4c2742214..d68009707107 100644
--- a/release/sysinstall/installUpgrade.c
+++ b/release/sysinstall/installUpgrade.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: installUpgrade.c,v 1.60 1998/11/03 03:38:55 jkh Exp $
+ * $Id: installUpgrade.c,v 1.58 1998/05/24 02:49:54 steve Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -164,7 +164,7 @@ installUpgrade(dialogMenuItem *self)
return installUpgradeNonInteractive(self);
variable_set2(SYSTEM_STATE, "upgrade");
- systemDisplayHelp("UPGRADE");
+ systemDisplayHelp("upgrade");
dialog_clear_norefresh();
if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
@@ -331,6 +331,18 @@ media:
}
}
+ if (extractingBin) {
+ msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
+ "/dev entries and such that a new system expects to see. I'll also perform a\n"
+ "few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
+ "on top of an existing system..");
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
+ msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
+ "You may wish to examine the system a little more closely when\n"
+ "it comes time to merge your /etc customizations back.");
+ }
+ }
+
msgNotify("First stage of upgrade completed successfully!\n\n"
"Next comes stage 2, where we attempt to resurrect your /etc\n"
"directory!");
@@ -472,6 +484,16 @@ installUpgradeNonInteractive(dialogMenuItem *self)
}
}
+ msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
+ "/dev entries and such that a new system expects to see. I'll also perform a\n"
+ "few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
+ "on top of an existing system..");
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
+ msgNotify("Hmmmmm. The fixups don't seem to have been very happy.\n"
+ "You may wish to examine the system a little more closely when\n"
+ "it comes time to merge your /etc customizations back.");
+ }
+
msgNotify("First stage of upgrade completed successfully.");
if (vsystem("tar -cpBf - -C %s . | tar --unlink -xpBf - -C /etc", saved_etc)) {
msgNotify("Unable to resurrect your old /etc!");
diff --git a/release/sysinstall/kget.c b/release/sysinstall/kget.c
deleted file mode 100644
index a71a25e025b7..000000000000
--- a/release/sysinstall/kget.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * Copyright (c) 1999 Andrzej Bialecki <abial@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.
- *
- * $Id: kget.c,v 1.2 1999/01/19 23:15:56 abial Exp $
- */
-
-#include "sysinstall.h"
-#include "i386/isa/isa_device.h"
-#include <sys/sysctl.h>
-
-int
-kget(char *out)
-{
- int len, i, bytes_written = 0;
- char *buf;
- char *mib = "machdep.uc_devlist";
- char name[9];
- FILE *fout;
- struct isa_device *id;
- char *p;
-
- fout = fopen(out, "w");
- if (fout == NULL) {
- msgDebug("kget: Unable to open %s for writing.\n", out);
- return -1;
- }
-
- /* We use sysctlbyname, because the oid is unknown (OID_AUTO) */
- /* get the buffer size */
- i = sysctlbyname(mib, NULL, &len, NULL, NULL);
- if (i) {
- msgDebug("kget: error buffer sizing\n");
- return -1;
- }
- buf = (char *)malloc(len * sizeof(char));
- i = sysctlbyname(mib, buf, &len, NULL, NULL);
- if (i) {
- msgDebug("kget: error retrieving data\n");
- return -1;
- }
- i = 0;
- while (i < len) {
- id = (struct isa_device *)(buf + i);
- p = (buf + i + sizeof(struct isa_device));
- strncpy(name, p, 8);
- if (!id->id_enabled) {
- bytes_written += fprintf(fout, "di %s%d\n", name, id->id_unit);
- } else {
- bytes_written += fprintf(fout, "en %s%d\n", name, id->id_unit);
- if (id->id_iobase > 0) {
- bytes_written += fprintf(fout, "po %s%d %#x\n",
- name, id->id_unit, id->id_iobase);
- }
- if (id->id_irq > 0) {
- bytes_written += fprintf(fout, "ir %s%d %d\n", name,
- id->id_unit, ffs(id->id_irq) - 1);
- }
- if (id->id_drq > 0) {
- bytes_written += fprintf(fout, "dr %s%d %d\n", name,
- id->id_unit, id->id_drq);
- }
- if (id->id_maddr > 0) {
- bytes_written += fprintf(fout, "iom %s%d %#x\n", name,
- id->id_unit, (u_int)id->id_maddr);
- }
- if (id->id_msize > 0) {
- bytes_written += fprintf(fout, "ios %s%d %d\n", name,
- id->id_unit, id->id_msize);
- }
- bytes_written += fprintf(fout, "f %s%d %#x\n", name,
- id->id_unit, id->id_flags);
- }
- i += sizeof(struct isa_device) + 8;
- }
- if (bytes_written)
- fprintf(fout, "q\n");
- else
- unlink(out);
- fclose(fout);
- free(buf);
- return 0;
-}
diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c
index ea49bbe0a169..858bf8d25751 100644
--- a/release/sysinstall/label.c
+++ b/release/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.83 1998/07/18 09:42:01 jkh Exp $
+ * $Id: label.c,v 1.82 1998/03/13 11:09:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -653,9 +653,6 @@ diskLabel(Device *dev)
PartInfo *p, *oldp;
PartType type;
Device **devs;
-#ifdef __alpha__
- int i;
-#endif
label_focus = 0;
pslice_focus = 0;
@@ -668,11 +665,6 @@ diskLabel(Device *dev)
}
labeling = TRUE;
keypad(stdscr, TRUE);
-#ifdef __alpha__
- for (i = 0; devs[i]; i++) {
- All_FreeBSD((Disk*) devs[i]->private, 1);
- }
-#endif
record_label_chunks(devs, dev);
clear();
@@ -1168,9 +1160,6 @@ diskLabelNonInteractive(Device *dev)
d = dev->private;
else
d = devs[0]->private;
-#ifdef __alpha__
- All_FreeBSD(d, 1);
-#endif
record_label_chunks(devs, dev);
for (i = 0; label_chunk_info[i].c; i++) {
Chunk *c1 = label_chunk_info[i].c;
diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c
index 5840896154f2..2769637562c2 100644
--- a/release/sysinstall/main.c
+++ b/release/sysinstall/main.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: main.c,v 1.49 1998/03/10 13:42:02 jkh Exp $
+ * $Id: main.c,v 1.48 1998/02/22 09:54:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -123,14 +123,8 @@ main(int argc, char **argv)
while (1) {
choice = scroll = curr = max = 0;
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE);
- if (getpid() != 1
-#ifdef __alpha__
- || !msgYesNo("Are you sure you wish to exit? The system will halt.")
-#else
- || !msgYesNo("Are you sure you wish to exit? The system will reboot\n"
- "(be sure to remove any floppies from the drives).")
-#endif
- )
+ if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? The system will reboot\n"
+ "(be sure to remove any floppies from the drives)."))
break;
}
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index 87f63f4a986f..c5ae93e653b2 100644
--- a/release/sysinstall/media.c
+++ b/release/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.93 1998/12/02 03:27:37 jkh Exp $
+ * $Id: media.c,v 1.88 1998/10/10 09:43:44 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -204,6 +204,8 @@ mediaSetFloppy(dialogMenuItem *self)
}
else
mediaDevice = devs[0];
+ if (mediaDevice)
+ mediaDevice->private = "/dist";
return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE;
}
@@ -385,28 +387,18 @@ mediaSetFTP(dialogMenuItem *self)
msgDebug("port # = `%d'\n", FtpPort);
}
if (variable_get(VAR_NAMESERVER)) {
- msgNotify("Looking up host %s.", hostname);
- if (isDebug())
- msgDebug("Starting DNS.\n");
kickstart_dns();
- if (isDebug())
- msgDebug("Looking up hostname, %s, using inet_addr().\n", hostname);
- if (inet_addr(hostname) == INADDR_NONE) {
- if (isDebug())
- msgDebug("Looking up hostname, %s, using gethostbyname().\n",
- hostname);
- if (gethostbyname(hostname) == NULL) {
- msgConfirm("Cannot resolve hostname `%s'! Are you sure that"
- " your\nname server, gateway and network interface are"
- " correctly configured?", hostname);
- if (networkDev)
- networkDev->shutdown(networkDev);
- networkDev = NULL;
- variable_unset(VAR_FTP_PATH);
- return DITEM_FAILURE | what;
- }
+ if ((inet_addr(hostname) == INADDR_NONE) && (gethostbyname(hostname) == NULL)) {
+ msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n"
+ "name server, gateway and network interface are correctly configured?", hostname);
+ if (networkDev)
+ networkDev->shutdown(networkDev);
+ networkDev = NULL;
+ variable_unset(VAR_FTP_PATH);
+ return DITEM_FAILURE | what;
}
- msgDebug("Found DNS entry for %s successfully..\n", hostname);
+ else
+ msgDebug("Found DNS entry for %s successfully..\n", hostname);
}
variable_set2(VAR_FTP_HOST, hostname);
variable_set2(VAR_FTP_DIR, dir ? dir : "/");
@@ -462,7 +454,7 @@ mediaSetNFS(dialogMenuItem *self)
static Device nfsDevice;
static Device *networkDev = NULL;
char *cp, *idx;
- char hostname[MAXPATHLEN];
+ char hostname[MAXHOSTNAMELEN];
mediaClose();
dialog_clear_norefresh();
cp = variable_get_value(VAR_NFS_PATH, "Please enter the full NFS file specification for the remote\n"
@@ -762,23 +754,3 @@ mediaSetCPIOVerbosity(dialogMenuItem *self)
}
return DITEM_SUCCESS;
}
-
-/* A generic open which follows a well-known "path" of places to look */
-FILE *
-mediaGenericGet(char *base, const char *file)
-{
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "%s/%s", base, file);
- if (file_readable(buf))
- return fopen(buf, "r");
- snprintf(buf, PATH_MAX, "%s/releases/%s", base, file);
- if (file_readable(buf))
- return fopen(buf, "r");
- snprintf(buf, PATH_MAX, "%s/%s/%s", base, variable_get(VAR_RELNAME), file);
- if (file_readable(buf))
- return fopen(buf, "r");
- snprintf(buf, PATH_MAX, "%s/releases/%s/%s", base, variable_get(VAR_RELNAME), file);
- return fopen(buf, "r");
-}
-
diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c
index d5da830734f8..0fc25abdb5a8 100644
--- a/release/sysinstall/menus.c
+++ b/release/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.179 1999/01/06 13:55:12 peter Exp $
+ * $Id: menus.c,v 1.170 1998/09/30 11:49:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -233,11 +233,11 @@ DMenu MenuIndex = {
{ "Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll },
{ "Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 },
{ "Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation },
- { "Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" },
- { "Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "HARDWARE" },
- { "Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "INSTALL" },
+ { "Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "readme" },
+ { "Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "hardware" },
+ { "Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "install" },
{ "Doc, Copyright", "The distribution copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" },
- { "Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "RELNOTES" },
+ { "Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "relnotes" },
{ "Doc, HTML", "The HTML documentation menu.", NULL, docBrowser },
{ "Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell },
{ "Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor },
@@ -290,8 +290,8 @@ DMenu MenuIndex = {
/* The initial installation menu */
DMenu MenuInitial = {
DMENU_NORMAL_TYPE,
- "/stand/sysinstall Main Menu", /* title */
- "Welcome to the FreeBSD installation and configuration tool. Please\n" /* prompt */
+ "Welcome to FreeBSD! [" RELEASE_NAME "]", /* title */
+ "This is the main menu of the FreeBSD installation system. Please\n" /* prompt */
"select one of the options below by using the arrow keys or typing the\n"
"first character of the option name you're interested in. Invoke an\n"
"option by pressing [ENTER] or [TAB-ENTER] to exit the installation.",
@@ -303,13 +303,13 @@ DMenu MenuInitial = {
{ "2 Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation },
{ "3 Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap },
{ "4 Options", "View/Set various installation options", NULL, optionsEditor },
- { "5 Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure },
- { "6 Novice", "Begin a novice installation (for beginners)", NULL, installNovice },
- { "7 Express", "Begin a quick installation (for the impatient)", NULL, installExpress },
- { "8 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom },
- { "9 Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit },
- { "U Upgrade", "Upgrade an existing system", NULL, installUpgrade },
- { "L Load Config","Load default install configuration", NULL, dispatch_load_floppy },
+ { "5 Novice", "Begin a novice installation (for beginners)", NULL, installNovice },
+ { "6 Express", "Begin a quick installation (for the impatient)", NULL, installExpress },
+ { "7 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom },
+ { "8 Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit },
+ { "9 Upgrade", "Upgrade an existing system", NULL, installUpgrade },
+ { "c Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure },
+ { "l Load Config","Load default install configuration", NULL, dispatch_load_floppy },
{ "0 Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex },
{ NULL } },
};
@@ -317,7 +317,7 @@ DMenu MenuInitial = {
/* The main documentation menu */
DMenu MenuDocumentation = {
DMENU_NORMAL_TYPE,
- "FreeBSD Documentation Menu",
+ "Documentation for FreeBSD " RELEASE_NAME,
"If you are at all unsure about the configuration of your hardware\n"
"or are looking to build a system specifically for FreeBSD, read the\n"
"Hardware guide! New users should also read the Install document for\n"
@@ -325,11 +325,11 @@ DMenu MenuDocumentation = {
"consult the README file.",
"Confused? Press F1 for help.",
"usage",
- { { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" },
- { "2 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" },
- { "3 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" },
+ { { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "readme" },
+ { "2 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "hardware" },
+ { "3 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "install" },
{ "4 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" },
- { "5 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" },
+ { "5 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "relnotes" },
{ "6 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" },
{ "7 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser },
{ "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit },
@@ -489,6 +489,8 @@ DMenu MenuMediaFTP = {
VAR_FTP_PATH "=ftp://current.freebsd.org/pub/FreeBSD/" },
{ "2.2 SNAP Server", "releng22.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://releng22.freebsd.org/pub/FreeBSD/" },
+ { "2.1 SNAP Server", "releng210.freebsd.org", NULL, dmenuSetVariable, NULL,
+ VAR_FTP_PATH "=ftp://releng210.freebsd.org/pub/FreeBSD/" },
{ "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org/pub/FreeBSD/" },
{ "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL,
@@ -573,12 +575,6 @@ DMenu MenuMediaFTP = {
VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org/pub/FreeBSD/" },
{ "Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org/pub/FreeBSD/" },
- { "Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL,
- VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org/pub/FreeBSD/" },
- { "Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL,
- VAR_FTP_PATH "=ftp://ftp4.kr.freebsd.org/pub/FreeBSD/" },
- { "Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL,
- VAR_FTP_PATH "=ftp://ftp5.kr.freebsd.org/pub/FreeBSD/" },
{ "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org/pub/FreeBSD/" },
{ "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL,
@@ -763,7 +759,7 @@ DMenu MenuSubDistributions = {
srcFlagCheck, distSetSrc },
{ "ports", "The FreeBSD Ports collection",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS },
- { "XFree86", "The XFree86 3.3.3 distribution",
+ { "XFree86", "The XFree86 3.3.2.3 distribution",
x11FlagCheck, distSetXF86 },
{ "All", "All sources, binaries and X Window System binaries",
NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' },
@@ -821,6 +817,8 @@ DMenu MenuSrcDistributions = {
dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIB },
{ "libexec", "/usr/src/libexec (system programs)",
dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIBEXEC },
+ { "lkm", "/usr/src/lkm (Loadable Kernel Modules)",
+ dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LKM },
{ "release", "/usr/src/release (release-generation tools)",
dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_RELEASE },
{ "bin", "/usr/src/bin (system binaries)",
@@ -848,8 +846,8 @@ DMenu MenuSrcDistributions = {
DMenu MenuXF86Select = {
DMENU_NORMAL_TYPE,
- "XFree86 3.3.3 Distribution",
- "Please select the components you need from the XFree86 3.3.3\n"
+ "XFree86 3.3.2.3 Distribution",
+ "Please select the components you need from the XFree86 3.3.2.3\n"
"distribution sets.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86",
@@ -864,7 +862,7 @@ DMenu MenuXF86Select = {
DMenu MenuXF86SelectCore = {
DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS,
- "XFree86 3.3.3 base distribution types",
+ "XFree86 3.3.2.3 base distribution types",
"Please check off the basic XFree86 components you wish to install.\n"
"Bin, lib, and set are recommended for a minimum installaion.",
"Press F1 to read the XFree86 release notes for FreeBSD",
@@ -891,9 +889,9 @@ DMenu MenuXF86SelectCore = {
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET },
{ "9set", "XFree86 Setup Utility for PC98 machines",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET },
- { "sources", "XFree86 3.3.3 standard sources",
+ { "sources", "XFree86 3.3.2.3 standard sources",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SRC },
- { "csources", "XFree86 3.3.3 contrib sources",
+ { "csources", "XFree86 3.3.2.3 contrib sources",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CSRC },
{ "All", "Select all of the above",
NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' },
@@ -1064,18 +1062,11 @@ DMenu MenuInstallCustom = {
"Press F1 to read the installation guide",
"install",
{ { "1 Options", "View/Set various installation options", NULL, optionsEditor },
-#ifdef __alpha__
- { "2 Label", "Label disk partitions", NULL, diskLabelEditor },
- { "3 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions },
- { "4 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia },
- { "5 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit },
-#else
{ "2 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor },
{ "3 Label", "Label allocated disk partitions", NULL, diskLabelEditor },
{ "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions },
{ "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia },
{ "6 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit },
-#endif
{ "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit },
{ NULL } },
};
@@ -1095,7 +1086,7 @@ DMenu MenuMBRType = {
" NOTE: PC-DOS users will almost certainly require \"None\"!",
"Press F1 to read about drive setup",
"drives",
- { { "BootMgr", "Install the FreeBSD Boot Manager",
+ { { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")",
dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr },
{ "Standard", "Install a standard MBR (no boot manager)",
dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 },
diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c
index a20e5614ab2c..7dde08df8252 100644
--- a/release/sysinstall/network.c
+++ b/release/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.32 1998/10/01 19:26:02 msmith Exp $
+ * $Id: network.c,v 1.31 1998/07/12 17:11:53 brian Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -58,15 +58,9 @@ mediaInitNetwork(Device *dev)
if (!RunningAsInit || networkInitialized)
return TRUE;
- if (isDebug())
- msgDebug("Init routine called for network device %s.\n", dev->name);
-
- if (!file_readable("/etc/resolv.conf")) {
- if (DITEM_STATUS(configResolv(NULL)) == DITEM_FAILURE) {
- msgConfirm("Can't seem to write out /etc/resolv.conf. Net cannot be used.");
- return FALSE;
- }
- }
+ msgDebug("Init routine called for network device %s.\n", dev->name);
+ if (!file_readable("/etc/resolv.conf"))
+ configResolv();
/* Old PPP process lying around? */
if (pppPID) {
diff --git a/release/sysinstall/nfs.c b/release/sysinstall/nfs.c
index aeb1dc0fc584..8ab752106177 100644
--- a/release/sysinstall/nfs.c
+++ b/release/sysinstall/nfs.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: nfs.c,v 1.18 1997/02/22 14:12:14 peter Exp $
+ * $Id$
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,11 +42,11 @@
#include <sys/mount.h>
Boolean NFSMounted;
-static char mountpoint[] = "/dist";
Boolean
mediaInitNFS(Device *dev)
{
+ char *mountpoint = "/dist";
Device *netDevice = (Device *)dev->private;
if (NFSMounted)
@@ -68,26 +68,43 @@ mediaInitNFS(Device *dev)
return FALSE;
}
NFSMounted = TRUE;
- if (isDebug())
- msgDebug("Mounted NFS device %s onto %s\n", dev->name, mountpoint);
+ msgDebug("Mounted NFS device %s onto %s\n", dev->name, mountpoint);
return TRUE;
}
FILE *
mediaGetNFS(Device *dev, char *file, Boolean probe)
{
- return mediaGenericGet(mountpoint, file);
+ char buf[PATH_MAX];
+
+ if (isDebug())
+ msgDebug("Request for %s from NFS\n", file);
+ snprintf(buf, PATH_MAX, "/dist/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/dists/%s", file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/%s", variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "/dist/%s/dists/%s", variable_get(VAR_RELNAME), file);
+ return fopen(buf, "r");
}
void
mediaShutdownNFS(Device *dev)
{
+ /* Device *netdev = (Device *)dev->private; */
+ char *mountpoint = "/dist";
+
if (!NFSMounted)
return;
-
msgNotify("Unmounting NFS partition on %s", mountpoint);
if (unmount(mountpoint, MNT_FORCE) != 0)
msgConfirm("Could not unmount the NFS partition: %s", strerror(errno));
+ msgDebug("Unmount of NFS partition successful\n");
+ /* if (netdev) netdev->shutdown(netdev); */
NFSMounted = FALSE;
return;
}
diff --git a/release/sysinstall/register.c b/release/sysinstall/register.c
index c3e3bf13b250..b5200716da31 100644
--- a/release/sysinstall/register.c
+++ b/release/sysinstall/register.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: register.c,v 1.8 1997/08/18 21:47:34 jkh Exp $
+ * $Id: register.c,v 1.7 1997/05/26 04:57:56 jkh Exp $
*
* Copyright (c) 1997
* Jordan Hubbard. All rights reserved.
@@ -175,7 +175,7 @@ handle_registration(void)
hotspots[COMMERCE_EMAIL].sel ? "yes" : "no", hotspots[COMMERCE_MAIL].sel ? "yes" : "no",
hotspots[ANNOUNCE_LIST].sel ? "yes" : "no",
hotspots[NEWSLETTER].sel == 0 ? "no" : hotspots[NEWSLETTER].sel == 1 ? "postal" : "email");
- fprintf(fp, "<version>%s</version>\n", variable_get(VAR_RELNAME));
+ fprintf(fp, "<version>%s</version>\n", RELEASE_NAME);
fprintf(fp, "</entry>\n");
fclose(fp);
dialog_clear_norefresh();
diff --git a/release/sysinstall/sysinstall.8 b/release/sysinstall/sysinstall.8
index 2be7509309bb..336750fb7386 100644
--- a/release/sysinstall/sysinstall.8
+++ b/release/sysinstall/sysinstall.8
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: sysinstall.8,v 1.13 1998/12/02 03:27:37 jkh Exp $
+.\" $Id: sysinstall.8,v 1.10 1998/07/21 06:44:42 jkh Exp $
.\"
.Dd August 9, 1997
.Dt SYSINSTALL 8
@@ -280,9 +280,9 @@ the script.
For example, let's say you have a SCSI disk on which you've created a new
FreeBSD partition in slice 2 (your DOS partition residing in slice 1).
The slice name would be
-.Ar da0s2
+.Ar sd0s2
for the whole FreeBSD partition (
-.Ar da0s1
+.Ar sd0s1
being your DOS primary
partition). Now let's further assume that you have 500MB in this
partition and you want to sub-partition that space into root, swap,
@@ -290,13 +290,13 @@ var and usr file systems for FreeBSD. Your invocation of the
.Ar diskLabelEditor
function might involve setting the following variables:
.Bl -tag -width findx
-.It Li "da0s2-1=ufs 40960 /"
+.It Li "sd0s2-1=ufs 40960 /"
A 20MB root file system (all sizes are in 512 byte blocks).
-.It Li "da0s2-2=swap 131072 /"
+.It Li "sd0s2-2=swap 131072 /"
A 64MB swap partition.
-.It Li "da0s2-3=ufs 204800 /var"
+.It Li "sd0s2-3=ufs 204800 /var"
A 100MB /var file system.
-.It Li "da0s2-4=ufs 0 /usr"
+.It Li "sd0s2-4=ufs 0 /usr"
With the balance of free space (around 316MB) going to the /usr
file system.
.El
@@ -311,7 +311,7 @@ entry is created for it in the new installation. Before calling the
.Ar diskLabelEditor
function, we simply add an additional line:
.nf
- da0s1=/dos_c N
+ sd0s1=/dos_c N
.fi
before the call. This tells the label editor that you want to mount
@@ -394,6 +394,8 @@ Kerberos binaries.
/usr/src/lib
.It Li slibexec
/usr/src/libexec
+.It Li slkm
+/usr/src/lkm
.It Li srelease
/usr/src/release
.It Li sbin
@@ -414,94 +416,94 @@ Kerberos binaries.
XFree86 official sources.
.It Li XF86-co
XFree86 contributed sources.
-.It Li Xbin
-XFree86 3.3.3 binaries.
-.It Li Xcfg
-XFree86 3.3.3 configuration files.
-.It Li Xdoc
-XFree86 3.3.3 documentation.
-.It Li Xhtml
-XFree86 3.3.3 HTML documentation.
-.It Li Xlib
-XFree86 3.3.3 libraries.
-.It Li Xlk98
-XFree86 3.3.3 server link-kit for PC98 machines.
-.It Li Xlkit
-XFree86 3.3.3 server link-kit for standard machines.
-.It Li Xman
-XFree86 3.3.3 manual pages.
-.It Li Xprog
-XFree86 3.3.3 programmer's distribution.
-.It Li Xps
-XFree86 3.3.3 postscript documentation.
-.It Li Xset
-XFree86 3.3.3 graphical setup tool.
-.It Li X8514
-XFree86 3.3.3 8514 server.
-.It Li X9480
-XFree86 3.3.3 PC98 8-bit (256 color) PEGC-480 server.
-.It Li X9EGC
-XFree86 3.3.3 PC98 4-bit (16 color) EGC server.
-.It Li X9GA9
-XFree86 3.3.3 PC98 GA-968V4/PCI (S3 968) server.
-.It Li X9GAN
-XFree86 3.3.3 PC98 GANB-WAP (cirrus) server.
-.It Li X9LPW
-XFree86 3.3.3 PC98 PowerWindowLB (S3) server.
-.It Li X9NKV
-XFree86 3.3.3 PC98 NKV-NEC (cirrus) server.
-.It Li X9NS3
-XFree86 3.3.3 PC98 NEC (S3) server.
-.It Li X9SPW
-XFree86 3.3.3 PC98 SKB-PowerWindow (S3) server.
-.It Li X9TGU
-XFree86 3.3.3 PC98 Cyber9320 and TGUI9680 server.
-.It Li X9WEP
-XFree86 3.3.3 PC98 WAB-EP (cirrus) server.
-.It Li X9WS
-XFree86 3.3.3 PC98 WABS (cirrus) server.
-.It Li X9WSN
-XFree86 3.3.3 PC98 WSN-A2F (cirrus) server.
-.It Li XAGX
-XFree86 3.3.3 8 bit AGX server.
-.It Li XI128
-XFree86 3.3.3 #9 Imagine I128 server.
-.It Li XMa8
-XFree86 3.3.3 ATI Mach8 server.
-.It Li XMa32
-XFree86 3.3.3 ATI Mach32 server.
-.It Li XMa64
-XFree86 3.3.3 ATI Mach64 server.
-.It Li XMono
-XFree86 3.3.3 monochrome server.
-.It Li XP9K
-XFree86 3.3.3 P9000 server.
-.It Li XS3
-XFree86 3.3.3 S3 server.
-.It Li XS3V
-XFree86 3.3.3 S3 Virge server.
-.It Li XSVGA
-XFree86 3.3.3 SVGA server.
-.It Li XVG16
-XFree86 3.3.3 VGA16 server.
-.It Li XW32
-XFree86 3.3.3 ET4000/W32, /W32i and /W32p server.
-.It Li Xnest
-XFree86 3.3.3 nested X server.
-.It Li Xvfb
-XFree86 3.3.3 virtual frame-buffer X server.
-.It Li Xfnts
-XFree86 3.3.3 base font set.
-.It Li Xf100
-XFree86 3.3.3 100DPI font set.
-.It Li Xfcyr
-XFree86 3.3.3 Cyrillic font set.
-.It Li Xfscl
-XFree86 3.3.3 scalable font set.
-.It Li Xfnon
-XFree86 3.3.3 non-english font set.
-.It Li Xfsrv
-XFree86 3.3.3 font server.
+.It Li X332bin
+XFree86 3.3.2.3 binaries.
+.It Li X332cfg
+XFree86 3.3.2.3 configuration files.
+.It Li X332doc
+XFree86 3.3.2.3 documentation.
+.It Li X332html
+XFree86 3.3.2.3 HTML documentation.
+.It Li X332lib
+XFree86 3.3.2.3 libraries.
+.It Li X332lk98
+XFree86 3.3.2.3 server link-kit for PC98 machines.
+.It Li X332lkit
+XFree86 3.3.2.3 server link-kit for standard machines.
+.It Li X332man
+XFree86 3.3.2.3 manual pages.
+.It Li X332prog
+XFree86 3.3.2.3 programmer's distribution.
+.It Li X332ps
+XFree86 3.3.2.3 postscript documentation.
+.It Li X332set
+XFree86 3.3.2.3 graphical setup tool.
+.It Li X3328514
+XFree86 3.3.2.3 8514 server.
+.It Li X3329480
+XFree86 3.3.2.3 PC98 8-bit (256 color) PEGC-480 server.
+.It Li X3329EGC
+XFree86 3.3.2.3 PC98 4-bit (16 color) EGC server.
+.It Li X3329GA9
+XFree86 3.3.2.3 PC98 GA-968V4/PCI (S3 968) server.
+.It Li X3329GAN
+XFree86 3.3.2.3 PC98 GANB-WAP (cirrus) server.
+.It Li X3329LPW
+XFree86 3.3.2.3 PC98 PowerWindowLB (S3) server.
+.It Li X3329NKV
+XFree86 3.3.2.3 PC98 NKV-NEC (cirrus) server.
+.It Li X3329NS3
+XFree86 3.3.2.3 PC98 NEC (S3) server.
+.It Li X3329SPW
+XFree86 3.3.2.3 PC98 SKB-PowerWindow (S3) server.
+.It Li X3329TGU
+XFree86 3.3.2.3 PC98 Cyber9320 and TGUI9680 server.
+.It Li X3329WEP
+XFree86 3.3.2.3 PC98 WAB-EP (cirrus) server.
+.It Li X3329WS
+XFree86 3.3.2.3 PC98 WABS (cirrus) server.
+.It Li X3329WSN
+XFree86 3.3.2.3 PC98 WSN-A2F (cirrus) server.
+.It Li X332AGX
+XFree86 3.3.2.3 8 bit AGX server.
+.It Li X332I128
+XFree86 3.3.2.3 #9 Imagine I128 server.
+.It Li X332Ma8
+XFree86 3.3.2.3 ATI Mach8 server.
+.It Li X332Ma32
+XFree86 3.3.2.3 ATI Mach32 server.
+.It Li X332Ma64
+XFree86 3.3.2.3 ATI Mach64 server.
+.It Li X332Mono
+XFree86 3.3.2.3 monochrome server.
+.It Li X332P9K
+XFree86 3.3.2.3 P9000 server.
+.It Li X332S3
+XFree86 3.3.2.3 S3 server.
+.It Li X332S3V
+XFree86 3.3.2.3 S3 Virge server.
+.It Li X332SVGA
+XFree86 3.3.2.3 SVGA server.
+.It Li X332VG16
+XFree86 3.3.2.3 VGA16 server.
+.It Li X332W32
+XFree86 3.3.2.3 ET4000/W32, /W32i and /W32p server.
+.It Li X332nest
+XFree86 3.3.2.3 nested X server.
+.It Li X332vfb
+XFree86 3.3.2.3 virtual frame-buffer X server.
+.It Li X332fnts
+XFree86 3.3.2.3 base font set.
+.It Li X332f100
+XFree86 3.3.2.3 100DPI font set.
+.It Li X332fcyr
+XFree86 3.3.2.3 Cyrillic font set.
+.It Li X332fscl
+XFree86 3.3.2.3 scalable font set.
+.It Li X332fnon
+XFree86 3.3.2.3 non-english font set.
+.It Li X332fsrv
+XFree86 3.3.2.3 font server.
.El
.It distSetDeveloper
Selects the standard Developer's distribution set.
@@ -540,7 +542,7 @@ Interactively select source subcomponents.
.Pp
\fBVariables:\fR None
.It distSetXF86
-Interactively select XFree86 3.3.3 subcomponents.
+Interactively select XFree86 3.3.2.3 subcomponents.
.Pp
\fBVariables:\fR None
.It distExtractAll
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index a50eb3ee4050..c74c423d8831 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.152 1998/12/22 12:31:25 jkh Exp $
+ * $Id: sysinstall.h,v 1.148 1998/09/30 11:49:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -51,9 +51,15 @@
#include "colors.h"
#include "libdisk.h"
#include "dist.h"
+#include "version.h"
/*** Defines ***/
+/* Different packages we depend on - update symlinks when versions change! */
+#define PACKAGE_GATED "gated"
+#define PACKAGE_PCNFSD "pcnfsd"
+#define PACKAGE_LYNX "lynx"
+
/* device limits */
#define DEV_NAME_MAX 64 /* The maximum length of a device name */
#define DEV_MAX 100 /* The maximum number of devices we'll deal with */
@@ -401,13 +407,13 @@ extern void command_shell_add(char *key, char *fmt, ...);
extern void command_func_add(char *key, commandFunc func, void *data);
/* config.c */
+extern int configFstab(void);
extern void configEnvironmentRC_conf(char *config);
extern void configEnvironmentResolv(char *config);
extern void configRC_conf(char *config);
-extern int configFstab(dialogMenuItem *self);
extern int configRC(dialogMenuItem *self);
extern int configRegister(dialogMenuItem *self);
-extern int configResolv(dialogMenuItem *self);
+extern void configResolv(void);
extern int configPackages(dialogMenuItem *self);
extern int configSaver(dialogMenuItem *self);
extern int configSaverTimeout(dialogMenuItem *self);
@@ -531,17 +537,13 @@ extern int installNovice(dialogMenuItem *self);
extern int installFixitHoloShell(dialogMenuItem *self);
extern int installFixitCDROM(dialogMenuItem *self);
extern int installFixitFloppy(dialogMenuItem *self);
-extern int installFixupBin(dialogMenuItem *self);
-extern int installFixupXFree(dialogMenuItem *self);
+extern int installFixup(dialogMenuItem *self);
extern int installUpgrade(dialogMenuItem *self);
extern int installFilesystems(dialogMenuItem *self);
extern int installVarDefaults(dialogMenuItem *self);
extern void installEnvironment(void);
extern Boolean copySelf(void);
-/* kget.c */
-extern int kget(char *out);
-
/* keymap.c */
extern int loadKeymap(const char *lang);
@@ -587,7 +589,6 @@ extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp);
extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic);
extern Boolean mediaExtractDistEnd(int zpid, int cpid);
extern Boolean mediaVerify(void);
-extern FILE *mediaGenericGet(char *base, const char *file);
/* misc.c */
extern Boolean file_readable(char *fname);
diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c
index 97b7d57008a4..b1a12af5489c 100644
--- a/release/sysinstall/system.c
+++ b/release/sysinstall/system.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: system.c,v 1.86 1999/01/08 00:14:22 jkh Exp $
+ * $Id: system.c,v 1.83 1998/09/30 11:44:29 jkh Exp $
*
* Jordan Hubbard
*
@@ -22,12 +22,12 @@
#include <machine/console.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
+#include <sys/wait.h>
/* Where we stick our temporary expanded doc file */
-#define DOC_TMP_DIR "/tmp/.doc"
-#define DOC_TMP_FILE "/tmp/.doc/doc.tmp"
+#define DOC_TMP_DIR "/tmp"
+#define DOC_TMP_FILE "/tmp/doc.tmp"
static pid_t ehs_pid;
@@ -53,15 +53,8 @@ expand(char *fname)
{
char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
- if (!directory_exists(DOC_TMP_DIR)) {
- Mkdir(DOC_TMP_DIR);
- if (chown(DOC_TMP_DIR, 0, 0) < 0)
- return NULL;
- if (chmod(DOC_TMP_DIR, S_IRWXU) < 0)
- return NULL;
- }
- else
- unlink(DOC_TMP_FILE);
+ Mkdir(DOC_TMP_DIR);
+ unlink(DOC_TMP_FILE);
if (!file_readable(fname) || vsystem("%s < %s > %s", gunzip, fname, DOC_TMP_FILE))
return NULL;
return DOC_TMP_FILE;
@@ -138,7 +131,6 @@ systemInitialize(int argc, char **argv)
if (!getenv("HOME"))
setenv("HOME", "/", 1);
signal(SIGINT, handle_intr);
- (void)vsystem("rm -rf %s", DOC_TMP_DIR);
}
/* Close down and prepare to exit */
@@ -161,18 +153,14 @@ systemShutdown(int status)
/* Shut down curses */
endwin();
- /* If we have a temporary doc dir lying around, nuke it */
- (void)vsystem("rm -rf %s", DOC_TMP_DIR);
+ /* If we have a temporary doc file lying around, nuke it */
+ unlink(DOC_TMP_FILE);
/* REALLY exit! */
if (RunningAsInit) {
/* Put the console back */
ioctl(0, VT_ACTIVATE, 2);
-#ifdef __alpha__
- reboot(RB_HALT);
-#else
reboot(0);
-#endif
}
else
exit(status);
@@ -235,15 +223,9 @@ systemHelpFile(char *file, char *buf)
snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file);
if (file_readable(buf))
return expand(buf);
- snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file);
- if (file_readable(buf))
- return expand(buf);
snprintf(buf, FILENAME_MAX, "/usr/src/release/sysinstall/help/%s.hlp", file);
if (file_readable(buf))
return buf;
- snprintf(buf, FILENAME_MAX, "/usr/src/release/sysinstall/help/%s.TXT", file);
- if (file_readable(buf))
- return buf;
return NULL;
}
diff --git a/release/sysinstall/tape.c b/release/sysinstall/tape.c
index 995a0fe0d154..df3989288f8a 100644
--- a/release/sysinstall/tape.c
+++ b/release/sysinstall/tape.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: tape.c,v 1.19 1997/02/22 14:12:21 peter Exp $
+ * $Id$
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -98,7 +98,7 @@ mediaGetTape(Device *dev, char *file, Boolean probe)
if (file_readable(buf))
fp = fopen(buf, "r");
else {
- sprintf(buf, "%s/releases/%s", (char *)dev->private, file);
+ sprintf(buf, "%s/dists/%s", (char *)dev->private, file);
fp = fopen(buf, "r");
}
/* Nuke the files behind us to save space */
@@ -112,9 +112,8 @@ mediaShutdownTape(Device *dev)
{
if (!tapeInitted)
return;
- if (file_readable((char *)dev->private)) {
- msgNotify("Cleaning up results of tape extract in %s..",
- (char *)dev->private);
+ if (file_readable(dev->private)) {
+ msgNotify("Cleaning up results of tape extract in %s..", dev->private);
(void)vsystem("rm -rf %s", (char *)dev->private);
}
tapeInitted = FALSE;
diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c
index 7ef6358d2eb4..5a862f2856f8 100644
--- a/release/sysinstall/tcpip.c
+++ b/release/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id: tcpip.c,v 1.73 1998/08/31 09:02:03 jkh Exp $
+ * $Id: tcpip.c,v 1.72 1997/09/17 16:18:22 pst Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -311,7 +311,7 @@ netconfig:
}
if (ipaddr[0])
variable_set2(VAR_IPADDR, ipaddr);
- configResolv(NULL); /* XXX this will do it on the MFS copy XXX */
+ configResolv(); /* XXX this will do it on the MFS copy XXX */
ret = DITEM_SUCCESS;
}
else
diff --git a/release/sysinstall/uc_eisa.c b/release/sysinstall/uc_eisa.c
new file mode 100644
index 000000000000..12abd730c7c5
--- /dev/null
+++ b/release/sysinstall/uc_eisa.c
@@ -0,0 +1,166 @@
+/***************************************************
+ * file: userconfig/uc_eisa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_eisa.c,v 1.4 1997/02/22 14:12:26 peter Exp $
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <nlist.h>
+#include <i386/eisa/eisaconf.h>
+
+#include "uc_main.h"
+
+struct eisa_device_node {
+ struct eisa_device dev;
+ struct eisa_device_node *next;
+};
+
+/* module prototypes */
+static void eisa_fill_in(struct kernel *, struct uc_eisa *, struct eisa_device_node *);
+
+void
+get_eisa_info(struct kernel *kp){
+ int i, total;
+ u_int *ls;
+ struct eisa_driver *ed;
+ struct uc_eisa *ep, *epc;
+ char *name;
+
+ if(kp->nl[EISA_SET].n_value || kp->nl[EISA_LIST].n_value) {
+ ep=epc=(struct uc_eisa *)malloc(sizeof(struct uc_eisa));
+ if(!kp->incore) {
+ if(kp->nl[EISA_SET].n_value) {
+ u_int ndev;
+ ls=(u_int *)kv_to_u(kp, kp->nl[EISA_SET].n_value, sizeof(u_int)*10); /* XXX, size? */
+ ndev=ls[0];
+ for(i=1;i<(ndev+1);i++){
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*i);
+ epc = ep+(i-1);
+ ed=(struct eisa_driver *)kv_to_u(kp, ls[i], sizeof(struct eisa_driver));
+ name=(char *)kv_to_u(kp, (u_int)ed->name, 10); /* XXX, size? */
+ asprintf(&epc->device, "%s", name);
+ asprintf(&epc->full_name, "?");
+ }
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*i);
+ epc = ep+(i-1);
+ bzero(epc, sizeof(struct uc_eisa));
+ kp->eisa_devp=ep;
+ } else { /* not incore and no symbol, we have no EISA devs... */
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+ } else {
+ /* if we're incore, we can get data from _eisa_dev_list, */
+ /* which should be much more useful, but I'll need a machine */
+ /* to test :( */
+ if(kp->nl[EISA_LIST].n_value) {
+ u_int t;
+ struct eisa_device_node *edn;
+
+ t=kv_dref_p(kp, kp->nl[EISA_LIST].n_value);
+ total=0;
+ while(t) {
+ edn=(struct eisa_device_node *)
+ kv_to_u(kp, t,sizeof(struct eisa_device_node));
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*(total+1));
+ epc=ep+total;
+ eisa_fill_in(kp, epc, edn);
+ t=(u_int)edn->next;
+ free(edn);
+ total++;
+ }
+
+ ep=(struct uc_eisa *)realloc(ep, sizeof(struct uc_eisa)*(total+1));
+ epc=ep+total;
+ bzero(epc, sizeof(struct uc_eisa));
+ kp->eisa_devp=ep;
+ } else {
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+ }
+ } else {
+ kp->eisa_devp=(struct uc_eisa *)0;
+ }
+}
+
+struct list *
+get_eisa_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_eisa *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->eisa_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_eisa_device(struct uc_eisa *ep){
+ struct list *list;
+ list=list_new();
+
+ list_append(list, ep->device);
+ list_append(list, ep->full_name);
+
+ return(list);
+}
+
+
+static void
+eisa_fill_in(struct kernel *kp, struct uc_eisa *epc, struct eisa_device_node *edn){
+ struct eisa_driver *edrv;
+ char *n;
+
+ edrv=(struct eisa_driver *)kv_to_u(kp, (u_int)edn->dev.driver,
+ sizeof(struct eisa_driver));
+
+ n=(char *)kv_to_u(kp, (u_int)edrv->name, 20);
+ asprintf(&epc->device, "%s%lu", n, edn->dev.unit);
+ free(n);
+
+ n=(char *)kv_to_u(kp, (u_int)edn->dev.full_name, 40); /*XXX*/
+ asprintf(&epc->full_name, "%s", n);
+ free(n);
+ free(edrv);
+}
+
+void
+eisa_free(struct kernel *kp, int writeback){
+ struct uc_eisa *ep;
+
+ for(ep=kp->eisa_devp;ep->device;ep++){
+ free(ep->device);
+ free(ep->full_name);
+ }
+ free(kp->eisa_devp);
+ kp->eisa_devp=0;
+}
+
+/* end of userconfig/uc_eisa.c */
diff --git a/release/sysinstall/uc_isa.c b/release/sysinstall/uc_isa.c
new file mode 100644
index 000000000000..624fc08daa56
--- /dev/null
+++ b/release/sysinstall/uc_isa.c
@@ -0,0 +1,211 @@
+/***************************************************
+ * file: userconfig/uc_isa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_isa.c,v 1.4 1997/02/22 14:12:27 peter Exp $
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <nlist.h>
+#include <i386/isa/isa_device.h>
+
+#include "uc_main.h"
+
+void
+get_isa_info(struct kernel *kp){
+ int total, i, j;
+ struct uc_isa *idp;
+ struct isa_device *p, *isa_dp;
+ struct isa_driver *drv;
+ char *name;
+
+ if(kp->nl[ISA_BIOTAB].n_value || kp->nl[ISA_TTYTAB].n_value || kp->nl[ISA_NETTAB].n_value ||
+ kp->nl[ISA_CAMTAB].n_value || kp->nl[ISA_NULLTAB].n_value ||
+ kp->nl[ISA_WDCTAB].n_value || kp->nl[ISA_FDCTAB].n_value) {
+
+ idp = kp->isa_devp = (struct uc_isa *)malloc(sizeof(struct uc_isa));
+ total=0; /* a running total of the number of isa devices */
+
+ for (i=0; i<6; i++) { /* the isa devices */
+ if(kp->nl[i].n_value) {
+ p = isa_dp = (struct isa_device *)kv_to_u(kp, kp->nl[i].n_value, /* XXX size? */
+ sizeof(struct isa_device)*30);
+ /* build the device list */
+ /* `total' keeps a running total of all the devices found */
+ for (j=0; p->id_id; j++, p++, total++) {
+ kp->isa_devp = (struct uc_isa *)realloc(kp->isa_devp,
+ sizeof(struct uc_isa)*(total+1));
+ idp=kp->isa_devp+total;
+
+ drv=(struct isa_driver *)kv_to_u(kp, (u_int)p->id_driver, sizeof(struct isa_driver));
+ name=(char *)kv_to_u(kp, (u_int)drv->name, 64);
+
+ if (i==ISA_WDCTAB || i==ISA_FDCTAB) { /* special case the disk devices */
+ char n[10];
+ strncpy(n, name, 10);
+ n[strlen(n)-1]=0; /* chop off the trailing 'c' */
+ asprintf(&idp->device, "%s%d", n, j);
+ } else {
+ asprintf(&idp->device, "%s%d", name, p->id_unit);
+ }
+ idp->port=p->id_iobase;
+ idp->irq=p->id_irq;
+ idp->drq=p->id_drq;
+ idp->iomem=(u_int)p->id_maddr & 0xFFFFFF; /* kludge to get pa from kva */
+ idp->iosize=p->id_msize;
+ idp->flags=p->id_flags;
+ idp->alive=p->id_alive;
+ idp->enabled=p->id_enabled;
+ idp->modified=0;
+ if(!kp->incore){
+ idp->idp=p;
+ } else {
+ free(name);
+ free(drv);
+ }
+ }
+ if(kp->incore){
+ free(isa_dp);
+ }
+ }
+ }
+
+ idp=kp->isa_devp+total;
+ bzero(idp, sizeof(struct uc_isa));
+ } else {
+ kp->isa_devp=0;
+ }
+}
+
+
+struct list *
+get_isa_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_isa *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->isa_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_isa_device(struct uc_isa *ip){
+ struct list *list;
+ char *tmp;
+
+ list=list_new();
+
+ asprintf(&tmp, "%s", ip->device );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%04x", ip->port );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->irq>0 ? ffs(ip->irq)-1 : ip->irq);
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->drq );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%08x", ip->iomem );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%x", ip->iosize );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "0x%x", ip->flags );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->alive );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", ip->enabled );
+ list_append(list, tmp);
+ free(tmp);
+
+ return(list);
+}
+
+int
+isa_setdev(struct kernel *kp, struct list *list){
+ int r=1, irq;
+ struct uc_isa *ip;
+
+ if(kp->isa_devp)
+ for(ip=kp->isa_devp;ip->device;ip++){
+ if(strcmp(list->av[0], ip->device)==0){
+ ip->modified=1;
+ ip->port = strtol(list->av[1], (char **)NULL, 0);
+ irq=strtol(list->av[2], (char **)NULL, 0);
+ ip->irq= irq > 0 ? 1 << (irq) : irq;
+ ip->drq = strtol(list->av[3], (char **)NULL, 0);
+ ip->iomem = strtol(list->av[4], (char **)NULL, 0);
+ ip->iosize = strtol(list->av[5], (char **)NULL, 0);
+ ip->flags = strtol(list->av[6], (char **)NULL, 0);
+ ip->enabled = strtol(list->av[8], (char **)NULL, 0);
+ r=0;
+ break;
+ }
+ }
+ return(r);
+}
+
+void
+isa_free(struct kernel *kp, int writeback){
+ struct uc_isa *ip;
+ for(ip=kp->isa_devp; ip->device; ip++){
+ if((!kp->incore) && ip->modified && writeback) {
+ /* save any changes */
+ ip->idp->id_iobase=ip->port;
+ ip->idp->id_irq = ip->irq;
+ ip->idp->id_drq = ip->drq;
+ ip->idp->id_maddr = (caddr_t)ip->iomem;
+ ip->idp->id_msize = ip->iosize;
+ ip->idp->id_flags = ip->flags;
+ ip->idp->id_enabled = ip->enabled;
+ }
+ /* and, be free... */
+ free(ip->device);
+ }
+ /* and free the whole ball of wax */
+ free(kp->isa_devp);
+ kp->isa_devp=0;
+}
+
+/* end of userconfig/uc_isa.c */
diff --git a/release/sysinstall/uc_kmem.c b/release/sysinstall/uc_kmem.c
new file mode 100644
index 000000000000..e0df87209a69
--- /dev/null
+++ b/release/sysinstall/uc_kmem.c
@@ -0,0 +1,87 @@
+/***************************************************
+ * file: userconfig/uc_kmem.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <a.out.h>
+
+#include <stdio.h>
+
+#include "uc_main.h"
+
+/* translate a kv pointer to user space */
+/* malloc()-ing if we aren't mmaped */
+u_int
+kv_to_u(struct kernel *kp, u_int adr, u_int size){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=(u_int)((adr - ep->a_entry + (N_DATOFF(*ep) - ep->a_text))+kp->core);
+ } else {
+ caddr_t ptr;
+ ptr = malloc(size);
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, ptr, size);
+ tadr=(u_int)ptr;
+ }
+ return(tadr);
+}
+
+/* dereference a pointer to kernel space */
+u_int
+kv_dref_p(struct kernel *kp, u_int adr){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=*(u_int*)((adr - ep->a_entry + (N_DATOFF(*ep) - ep->a_text))+kp->core);
+ } else {
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, &tadr, sizeof(tadr));
+ }
+ return(tadr);
+}
+
+/* deref a pointer to kernel text */
+u_int
+kv_dref_t(struct kernel *kp, u_int adr){
+ u_int tadr;
+ if(!kp->incore){
+ struct exec *ep;
+ ep=(struct exec *)kp->core;
+ tadr=*(u_int*)((adr - ep->a_entry) + N_TXTOFF(*ep) + (u_int)kp->core);
+ } else {
+ lseek(kp->fd, adr, SEEK_SET);
+ read(kp->fd, &tadr, sizeof(tadr));
+ }
+ return(tadr);
+}
+
+/* end of userconfig/uc_kmem.c */
diff --git a/release/sysinstall/uc_list.c b/release/sysinstall/uc_list.c
new file mode 100644
index 000000000000..6506c5eb6b1e
--- /dev/null
+++ b/release/sysinstall/uc_list.c
@@ -0,0 +1,76 @@
+/***************************************************
+ * file: userconfig/uc_isa.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <nlist.h>
+#include "uc_main.h"
+
+struct list *
+list_new(void){
+ struct list *rv;
+ rv=(struct list *)malloc(sizeof(struct list));
+ rv->ac=0;
+ rv->av=(char **)0;
+ return(rv);
+}
+
+void
+list_append(struct list *list , char *item){
+
+ if(list->ac==0) {
+ list->av=(char **)malloc(sizeof(char *)*(list->ac+1));
+ } else {
+ list->av=(char **)realloc(list->av, sizeof(char *)*(list->ac+1));
+ }
+ asprintf(list->av+list->ac, "%s", item);
+ list->ac++;
+}
+
+void
+list_print(struct list *list, char *separator){
+ int i;
+ for(i=0; i<list->ac; i++)
+ printf("%s%s", list->av[i], separator);
+}
+
+void
+list_destroy(struct list *list){
+ int i;
+ for(i=0;i<list->ac;i++){
+ free(list->av[i]);
+ list->av[i]=0;
+ }
+ free(list->av);
+ list->av=0;
+ free(list);
+}
+
+/* end of userconfig/uc_list.c */
diff --git a/release/sysinstall/uc_main.c b/release/sysinstall/uc_main.c
new file mode 100644
index 000000000000..102c766d3893
--- /dev/null
+++ b/release/sysinstall/uc_main.c
@@ -0,0 +1,334 @@
+/***************************************************
+ * file: userconfig/uc_main.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ * library functions for userconfig library
+ *
+ * $Id: uc_main.c,v 1.23 1998/10/06 07:41:49 msmith Exp $
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <paths.h>
+#include <sys/mman.h>
+#include <nlist.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "uc_main.h"
+#include "sysinstall.h"
+
+static struct nlist _nl[] = {
+ {"_isa_devtab_bio"},
+ {"_isa_devtab_tty"},
+ {"_isa_devtab_net"},
+ {"_isa_devtab_cam"},
+ {"_isa_devtab_null"},
+ {"_isa_biotab_wdc"},
+ {"_isa_biotab_fdc"},
+ {"_eisadriver_set"},
+ {"_eisa_dev_list"},
+ {"_pcidevice_set"},
+ {"_device_list"},
+#ifdef DO_SCSI
+ {"_scbusses"},
+ {"_scsi_cinit"},
+ {"_scsi_dinit"},
+ {"_scsi_tinit"},
+#endif
+ {""},
+};
+
+struct kernel *
+uc_open(char *name){
+ int kd, flags, incore;
+ struct kernel *kern;
+ struct stat sb;
+ char kname[80];
+ int size, i = 0;
+ struct nlist *nl = _nl;
+
+ if (strcmp(name, "-incore") == 0)
+ incore = 1;
+ else
+ incore = 0;
+
+ if (incore || (strcmp(name,"-bootfile") == 0))
+ SAFE_STRCPY(kname, getbootfile());
+ else
+ SAFE_STRCPY(kname, name);
+
+ if (isDebug())
+ msgDebug("uc_open: kernel name is %s, incore = %d\n", kname, incore);
+ kern = (struct kernel *)malloc(sizeof(struct kernel));
+
+#ifdef KERN_NO_SYMBOLS
+ if (incore) {
+ FILE *fp;
+
+ fp = fopen("/stand/symbols", "r");
+ if (!fp) {
+ msgDebug("Couldn't open /stand/symbols file! Punting.\n");
+ free(kern);
+ return NULL;
+ }
+ if (fscanf(fp, "%d\n", &size) != 1) {
+ msgDebug("Unable to get # of name list entries from symbol file.\n");
+ free(kern);
+ return NULL;
+ }
+ else if (isDebug())
+ msgDebug("uc_open: opened /stand/symbols file, reading %d entries.\n", size);
+
+
+ kern->nl = nl = (struct nlist *)malloc((size + 1) * sizeof(struct nlist));
+ bzero(nl, (size + 1) * sizeof(struct nlist));
+ for (i = 0; i <= size; i++) {
+ char *cp, name[255];
+ int c1;
+ unsigned int uc1;
+ short d1;
+ unsigned long v1;
+
+ if (fgets(name, 255, fp) == NULL) {
+ msgDebug("Can't get name field for entry %d\n", i);
+ free(kern);
+ return NULL;
+ }
+ if ((cp = index(name, '\n')) != NULL)
+ *cp = '\0';
+ nl[i].n_name = strdup(name);
+ if (fscanf(fp, "%u %d %hd %ld\n", &uc1, &c1, &d1, &v1) == 4) {
+ nl[i].n_type = (unsigned char)uc1;
+ nl[i].n_other = (char)c1;
+ nl[i].n_desc = d1;
+ nl[i].n_value = v1;
+ if (isDebug())
+ msgDebug("uc_open: for entry %d, decoded: \"%s\", %u %d %hd %ld\n", i, nl[i].n_name, nl[i].n_type, nl[i].n_other, nl[i].n_desc, nl[i].n_value);
+ }
+ }
+ nl[i].n_name = "";
+ fclose(fp);
+ i = 0;
+ }
+ else
+#endif
+ i = nlist(kname, nl);
+ if (i == -1) {
+ msgDebug("uc_open: kernel %s does not contain symbols.\n", kname);
+ free(kern);
+ return NULL;
+ }
+#ifdef KERN_NO_SYMBOLS
+ if (!incore) {
+#else
+ {
+#endif
+ kern->nl=(struct nlist *)malloc(sizeof(_nl));
+ bcopy(_nl, kern->nl, sizeof(_nl));
+ }
+
+ if (incore) {
+ if (isDebug())
+ msgDebug("uc_open: attempting to open /dev/kmem for incore.\n");
+ if ((kd = open("/dev/kmem", O_RDONLY)) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to open /dev/kmem.\n");
+ return NULL;
+ }
+ kern->core = (caddr_t)NULL;
+ kern->incore = 1;
+ kern->size = 0;
+ }
+ else {
+ if (stat(kname, &sb) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to stat %s.\n", kname);
+ return NULL;
+ }
+ kern->size = sb.st_size;
+ flags = sb.st_flags;
+
+ if (chflags(kname, 0) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to chflags %s.\n", kname);
+ return NULL;
+ }
+
+ if (isDebug())
+ msgDebug("uc_open: attempting to open %s\n", kname);
+ if ((kd = open(kname, O_RDWR, 0644)) < 0) {
+ free(kern);
+ msgDebug("uc_open: Unable to open %s.\n", kname);
+ return NULL;
+ }
+
+ fchflags(kd, flags);
+
+ if (isDebug())
+ msgDebug("uc_open: attempting to mmap %d bytes\n", sb.st_size);
+ kern->core = mmap((caddr_t)0, sb.st_size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, kd, 0);
+ kern->incore = 0;
+ if (kern->core == MAP_FAILED) {
+ free(kern);
+ msgDebug("uc_open: Unable to mmap from %s.\n", kname);
+ return NULL;
+ }
+ }
+
+ kern->fd = kd;
+ get_isa_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got isa information\n");
+
+ get_pci_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got pci information\n");
+
+ get_eisa_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got eisa information\n");
+#ifdef DO_SCSI
+ get_scsi_info(kern);
+ if (isDebug())
+ msgDebug("uc_open: got scsi information\n");
+#else
+ kern->scsi_devp=(struct uc_scsi*)NULL;
+ kern->scsibus_devp=(struct uc_scsibus*)NULL;
+#endif
+ return kern;
+}
+
+int
+uc_close(struct kernel *kern, int writeback)
+{
+ if (kern->isa_devp)
+ isa_free(kern, writeback);
+
+ if (kern->eisa_devp)
+ eisa_free(kern, writeback); /* `writeback' isn't really useful here */
+
+ if (kern->pci_devp)
+ pci_free(kern, writeback); /* or here */
+
+#ifdef DO_SCSI
+ if (kern->scsi_devp)
+ scsi_free(kern, writeback);
+#endif
+ if (!kern->incore)
+ munmap(kern->core, kern->size);
+
+ close(kern->fd);
+ free(kern->nl);
+ free(kern);
+
+ return 0;
+}
+
+struct list *
+uc_getdev(struct kernel *kern, char *dev)
+{
+ struct list *list = (struct list *)0;
+
+ if (*dev == '-') { /* asked for -isa, -eisa, -pci, -scsi, -all */
+ if (strcmp(dev, "-all") == 0) {
+ list = list_new();
+ if (kern->isa_devp)
+ list_append(list, "isa");
+
+ if (kern->eisa_devp)
+ list_append(list, "eisa");
+
+ if (kern->pci_devp)
+ list_append(list, "pci");
+
+#ifdef DO_SCSI
+ if (kern->scsi_devp)
+ list_append(list, "scsi");
+#endif
+
+ }
+ else if (strcmp(dev, "-isa") == 0)
+ list = get_isa_devlist(kern);
+ else if (strcmp(dev, "-eisa") == 0)
+ list = get_eisa_devlist(kern);
+ else if (strcmp(dev, "-pci") == 0)
+ list = get_pci_devlist(kern);
+#ifdef DO_SCSI
+ else if (strcmp(dev, "-scsi") == 0)
+ list = get_scsi_devlist(kern);
+#endif
+ }
+ else {
+ /* we gotta figure out which real device to report */
+ struct uc_isa *ip;
+ struct uc_pci *pp;
+ struct uc_eisa *ep;
+
+ if (kern->isa_devp) {
+ for (ip = kern->isa_devp; ip->device; ip++) {
+ if (strcmp(dev, ip->device) == 0) {
+ list = get_isa_device(ip);
+ goto end;
+ }
+ }
+ }
+
+#ifdef DO_SCSI
+ if (kern->scsi_devp) {
+ struct uc_scsi *sp;
+
+ for (sp = kern->scsi_devp; sp->device; sp++) {
+ if (strcmp(dev, sp->device) == 0) {
+ list = get_scsi_device(sp);
+ goto end;
+ }
+ }
+ }
+#endif
+
+ if (kern->pci_devp) {
+ for(pp = kern->pci_devp; pp->device; pp++) {
+ if (strcmp(dev, pp->device) == 0) {
+ list = get_pci_device(pp);
+ goto end;
+ }
+ }
+ }
+
+ if (kern->eisa_devp) {
+ for (ep = kern->eisa_devp; ep->device; ep++) {
+ if (strcmp(dev, ep->device) == 0) {
+ list = get_eisa_device(ep);
+ goto end;
+ }
+ }
+ }
+ }
+end:
+ return(list);
+}
diff --git a/release/sysinstall/uc_main.h b/release/sysinstall/uc_main.h
new file mode 100644
index 000000000000..046a6646cd55
--- /dev/null
+++ b/release/sysinstall/uc_main.h
@@ -0,0 +1,168 @@
+/***************************************************
+ * file: userconfig/uc_main.h
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id: uc_main.h,v 1.4 1997/02/22 14:12:32 peter Exp $
+ */
+
+#define ISA_BIOTAB 0
+#define ISA_TTYTAB 1
+#define ISA_NETTAB 2
+#define ISA_CAMTAB 3
+#define ISA_NULLTAB 4
+#define ISA_WDCTAB 5
+#define ISA_FDCTAB 6
+#define EISA_SET 7
+#define EISA_LIST 8
+#define PCI_SET 9
+#define SCSI_LIST 10
+#define SCSI_BUSSES 11
+#define SCSI_CINIT 12
+#define SCSI_DINIT 13
+#define SCSI_TINIT 14
+/* symbols + the null terminator */
+#define NSYMBOLS 16
+
+struct kernel {
+ int fd; /* file descriptor for the kernel image, either a binary or /dev/kmem */
+ caddr_t core; /* either the mmap()ed kernel image, or a scratch area */
+ u_int size; /* size of the object at ->core */
+ int incore; /* true if the kernel is running */
+#ifdef UC_PRIVATE
+ struct nlist *nl; /* the symbol table */
+#else
+ void *nl;
+#endif
+ struct uc_isa *isa_devp; /* pointer to the isa devices (if any) */
+ struct uc_eisa *eisa_devp; /* pointer to the eisa devices (if any) */
+ struct uc_pci *pci_devp; /* pointer to the pci devices (if any) */
+ struct uc_scsi *scsi_devp; /* pointer to the scsi devices (if any) */
+ struct uc_scsibus *scsibus_devp; /* internal pointer to scsibus wirings */
+};
+
+struct uc_isa {
+ char *device;
+ u_short port;
+ u_short irq;
+ short drq;
+ u_int iomem;
+ int iosize;
+ int flags;
+ int alive;
+ int enabled;
+#ifdef UC_PRIVATE
+ struct isa_device *idp;
+#else
+ void *idp;
+#endif
+ int modified;
+};
+
+struct uc_pci {
+ char *device;
+};
+
+struct uc_eisa {
+ char *device;
+ char *full_name;
+};
+
+struct uc_scsibus {
+ int bus_no;
+ int unit;
+ char *driver;
+#ifdef UC_PRIVATE
+ struct scsi_ctlr_config *config;
+#else
+ void *config;
+#endif
+};
+
+struct uc_scsi {
+ char *device;
+ char *adapter;
+ u_short target;
+ u_short lun;
+ char *desc;
+#ifdef UC_PRIVATE
+ struct scsi_device_config *config;
+#else
+ void *config;
+#endif
+ int modified;
+};
+
+/* nearly everything useful returns a list */
+
+struct list {
+ int ac;
+ char **av;
+};
+
+/* prototypes */
+
+/* uc_main.c */
+/* these are really the only public ones */
+struct kernel *uc_open(char *name);
+int uc_close(struct kernel *kern, int writeback);
+struct list *uc_getdev(struct kernel *kern, char *dev);
+
+/* uc_isa.c */
+void get_isa_info(struct kernel *kp);
+struct list *get_isa_devlist(struct kernel *kp);
+struct list *get_isa_device(struct uc_isa *ip);
+int isa_setdev(struct kernel *kp, struct list *list);
+void isa_free(struct kernel *kp, int writeback);
+
+/* uc_eisa.c */
+void get_eisa_info(struct kernel *kp);
+struct list *get_eisa_devlist(struct kernel *kp);
+struct list *get_eisa_device(struct uc_eisa *ep);
+void eisa_free(struct kernel *kp, int writeback);
+
+/* uc_pci.c */
+void get_pci_info(struct kernel *kp);
+struct list *get_pci_devlist(struct kernel *kp);
+struct list *get_pci_device(struct uc_pci *pp);
+void pci_free(struct kernel *kp, int writeback);
+
+/* uc_scsi.c */
+void get_scsi_info(struct kernel *kp);
+struct list *get_scsi_devlist(struct kernel *kp);
+struct list *get_scsi_device(struct uc_scsi *sp);
+int scsi_setdev(struct kernel *kp, struct list *list);
+void scsi_free(struct kernel *kp, int writeback);
+
+/* uc_kmem.c */
+u_int kv_to_u(struct kernel *kp, u_int adr, u_int size);
+u_int kv_dref_p(struct kernel *kp, u_int adr);
+u_int kv_dref_t(struct kernel *kp, u_int adr);
+
+/* uc_list.c */
+struct list *list_new(void);
+void list_append(struct list *list, char *item);
+void list_print(struct list *list, char *separator);
+void list_destroy(struct list *list);
+
+/* end of userconfig/uc_main.h */
diff --git a/release/sysinstall/uc_pci.c b/release/sysinstall/uc_pci.c
new file mode 100644
index 000000000000..0b213123b482
--- /dev/null
+++ b/release/sysinstall/uc_pci.c
@@ -0,0 +1,122 @@
+/***************************************************
+ * file: userconfig/uc_pci.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <nlist.h>
+#include <pci/pcivar.h>
+
+#include "uc_main.h"
+
+void
+get_pci_info(struct kernel *kp){
+ int i, total;
+ u_int *ls, ndev;
+ struct pci_device *pd;
+ struct uc_pci *pp,*ppc;
+ char *name;
+
+ if(kp->nl[PCI_SET].n_value){
+ pp = ppc = (struct uc_pci *)malloc(sizeof(struct uc_pci));
+ ls=(u_int *)kv_to_u(kp, kp->nl[PCI_SET].n_value, sizeof(u_int)*30); /* XXX, size? */
+ ndev=ls[0];
+ total=0;
+ for(i=1;i<(ndev+1);i++){
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ pd=(struct pci_device *)kv_to_u(kp, ls[i], sizeof(struct pci_device));
+ /* don't try to dereference a null pointer */
+ name=pd->pd_name ? (char *)kv_to_u(kp, (u_int)pd->pd_name, 10) :
+ pd->pd_name; /* XXX, size? */
+ if(kp->incore){
+ int u, k;
+ /* incore, we can get unit numbers */
+
+ u=kv_dref_p(kp, (u_int)pd->pd_count);
+ for(k=0;k<u;k++,total++){
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ asprintf(&ppc->device, "%s%d", name, k);
+ }
+ free(pd);
+ if(name)
+ free(name);
+ } else {
+ asprintf(&ppc->device, "%s?", name);
+ total++;
+ }
+ }
+ pp=(struct uc_pci *)realloc(pp, sizeof(struct uc_pci)*(total+1));
+ ppc = pp+(total);
+ bzero(ppc, sizeof(struct uc_pci));
+ kp->pci_devp=pp;
+ } else {
+ kp->pci_devp=(struct uc_pci *)0;
+ }
+}
+
+
+struct list *
+get_pci_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_pci *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->pci_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+ return(dl);
+}
+
+
+struct list *
+get_pci_device(struct uc_pci *pp){
+ struct list *list;
+ list=list_new();
+
+ list_append(list, pp->device);
+
+ return(list);
+}
+
+void
+pci_free(struct kernel *kp, int writeback){
+ struct uc_pci *pp;
+
+ for(pp=kp->pci_devp;pp->device;pp++){
+ free(pp->device);
+ }
+ free(kp->pci_devp);
+ kp->pci_devp=0;
+
+}
+
+/* end of userconfig/uc_pci.c */
diff --git a/release/sysinstall/uc_scsi.c b/release/sysinstall/uc_scsi.c
new file mode 100644
index 000000000000..2227bb335add
--- /dev/null
+++ b/release/sysinstall/uc_scsi.c
@@ -0,0 +1,477 @@
+/***************************************************
+ * file: userconfig/uc_scsi.c
+ *
+ * Copyright (c) 1996 Eric L. Hernes (erich@rrnet.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. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <nlist.h>
+#include <scsi/scsiconf.h>
+
+#include "uc_main.h"
+
+/* this stuff is hidden under an #ifdef KERNEL in scsiconf.h */
+#define SCCONF_UNSPEC 255
+#define SCCONF_ANY 254
+
+struct scsi_ctlr_config {
+ int scbus;
+ char *driver;
+ int unit;
+ int bus;
+};
+
+struct scsi_device_config {
+ char *name; /* SCSI device name (sd, st, etc) */
+ int unit; /* desired device unit */
+ int cunit; /* Controller unit */
+ int target; /* SCSI ID (target) */
+ int lun; /* SCSI lun */
+ int flags; /* Flags from config */
+};
+
+/* module prototypes */
+static void get_sl_info(struct kernel *kp, struct uc_scsi *spc,
+ struct scsi_link *sl);
+
+void
+get_scsi_info(struct kernel *kp){
+ int i, j, k;
+
+ if(kp->incore){
+ if (kp->nl[SCSI_BUSSES].n_value) {
+ u_int *es, *sba;
+ struct scsibus_data *sbd;
+ int nsbd, nscsibus, total;
+ struct uc_scsi *sp, *spc;
+ struct uc_scsibus *sbp, *sbpc;
+ struct scsi_link *s_l;
+ u_int *slp;
+ char *temp;
+ struct scsi_device *sdev;
+ u_int t;
+ char name[10];
+
+ sp=(struct uc_scsi*)malloc(sizeof(struct uc_scsi));
+ total=0;
+ sbp=(struct uc_scsibus*)malloc(sizeof(struct uc_scsibus));
+ nscsibus=0;
+
+ es=(u_int *)kv_to_u(kp, kv_dref_p(kp,kp->nl[SCSI_BUSSES].n_value),
+ sizeof(u_int)*2);
+ nsbd=es[0];
+ sba=(u_int *)kv_to_u(kp, es[1], sizeof(u_int)*nsbd);
+ free(es);
+
+ for(i=0;i<nsbd;i++){
+ if(sba[i]){
+ /* first grab the adapter info */
+ sbd=(struct scsibus_data *)kv_to_u(kp, sba[i],
+ sizeof(struct scsibus_data));
+ sbp=(struct uc_scsibus *)realloc(sbp, sizeof(struct uc_scsibus)*
+ (nscsibus+1));
+
+ sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ s_l=(struct scsi_link*)kv_to_u(kp, (u_int)sbd->adapter_link,
+ sizeof(struct scsi_link));
+ get_sl_info(kp, spc, s_l);
+ free(s_l);
+
+ sbpc=sbp+nscsibus;
+ sbpc->bus_no=nscsibus;
+ nscsibus++;
+ sscanf(spc->device, "%[a-z]%d", name, &sbpc->unit);
+ asprintf(&sbpc->driver, "%s", name);
+
+ total++;
+ t=kv_dref_p(kp, (u_int)sbd->sc_link);
+ t=(u_int)sbd->sc_link;
+ for(j=0;j<8;j++) {
+ slp=(u_int *)kv_to_u(kp, t+(j*8*sizeof(u_int)), /* XXX */
+ (sizeof(u_int)*sbd->maxlun));
+ for(k=0;k<sbd->maxlun && slp[k]; k++){
+ struct scsi_link *slt;
+ sp=(struct uc_scsi*)realloc(sp,
+ (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ slt=(struct scsi_link*)kv_to_u(kp, slp[k],
+ sizeof(struct scsi_link));
+ get_sl_info(kp, spc, slt);
+ free(slt);
+ spc->config=(struct scsi_device_config *)0;
+ total++;
+ }
+ free(slp);
+ }
+ free(sbd);
+ }
+ }
+ /* now stuff in the list of drivers configured in the system */
+ t=kv_dref_p(kp, kp->nl[SCSI_LIST].n_value);
+ while(t) {
+ sdev=(struct scsi_device*)kv_to_u(kp, t, sizeof(struct scsi_device));
+ sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ total++;
+ temp=(char *)kv_to_u(kp, (u_int)sdev->name, 10);
+ asprintf(&spc->device, "%s*", temp);
+ free(temp);
+ asprintf(&spc->adapter, "any");
+
+ spc->target=SCCONF_ANY;
+ spc->lun=SCCONF_ANY;
+
+ temp=(char *)kv_to_u(kp, (u_int)sdev->desc, 20);
+ asprintf(&spc->desc, "%s", temp);
+ free(temp);
+
+ spc->config=(struct scsi_device_config *)0;
+
+ t=(u_int)sdev->next;
+ free(sdev);
+ }
+ /* slap on the terminators */
+ sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ bzero(spc, sizeof(struct uc_scsi));
+
+ sbp=(struct uc_scsibus *)realloc(sbp, sizeof(struct uc_scsibus)*
+ (nscsibus+1));
+ sbpc=sbp+nscsibus;
+ bzero(sbpc, sizeof(struct uc_scsibus));
+
+ kp->scsi_devp=sp;
+ kp->scsibus_devp=sbp;
+ } else { /* no symbol, and incore, no scsi */
+ kp->scsi_devp=(struct uc_scsi *)0;
+ kp->scsibus_devp=(struct uc_scsibus *)0;
+ }
+ } else { /* on disk */
+
+ if (kp->nl[SCSI_CINIT].n_value || kp->nl[SCSI_DINIT].n_value ||
+ kp->nl[SCSI_TINIT].n_value) {
+ int total=0;
+ struct uc_scsi *sp, *spc;
+ struct scsi_ctlr_config *sctl_c;
+ struct scsi_device_config *sdev_c;
+ struct scsi_device *sdev;
+
+ struct uc_scsibus *uc_scbus, *uc_scbusc;
+
+ u_int t, ctrl_total;
+ char *temp;
+ u_int initp;
+
+ spc=sp=(struct uc_scsi*)malloc(sizeof(struct uc_scsi));
+ total=0;
+ ctrl_total=0;
+ uc_scbus = NULL; /* Just prevent unused warning */
+
+ /* static kernel, we'll first get the wired controllers/devices */
+ if((t=kp->nl[SCSI_CINIT].n_value)){
+ /* get controller info*/
+ sctl_c=(struct scsi_ctlr_config*)kv_to_u(kp, t, sizeof(struct scsi_ctlr_config));
+ uc_scbus=(struct uc_scsibus*)malloc(sizeof(struct uc_scsibus));
+
+ while(sctl_c->driver){
+
+ /* remember the bus info, for later */
+ uc_scbus=(struct uc_scsibus*)realloc(uc_scbus, sizeof(struct uc_scsibus)*(ctrl_total+1));
+ uc_scbusc=uc_scbus+ctrl_total;
+ uc_scbusc->bus_no=sctl_c->scbus;
+ temp=(char *)kv_to_u(kp, (u_int)sctl_c->driver, 20);
+ uc_scbusc->driver=temp;
+ uc_scbusc->unit=sctl_c->unit;
+ uc_scbusc->config=sctl_c;
+
+ sp=(struct uc_scsi*)realloc(sp,sizeof(struct uc_scsi)*(total+1));
+ spc=sp+total;
+ asprintf(&spc->device, "%s%d", temp, sctl_c->unit);
+ asprintf(&spc->adapter, "%s%d", temp, sctl_c->unit);
+ spc->target=0;
+ spc->lun=0;
+ spc->modified=0;
+ asprintf(&spc->desc, "%s", temp);
+ total++;
+ ctrl_total++;
+ sctl_c++;
+ }
+ }
+
+ if((t=kp->nl[SCSI_DINIT].n_value)){
+ /* get wired device info */
+ sdev_c=(struct scsi_device_config*)kv_to_u(kp, t, sizeof(struct scsi_device_config));
+ while(sdev_c->name){
+ sp=(struct uc_scsi*)realloc(sp, sizeof(struct uc_scsi)*(total+1));
+ spc=sp+total;
+ temp=(char*)kv_to_u(kp, (u_int)sdev_c->name, 10);
+ asprintf(&spc->device, "%s%d", temp, sdev_c->unit);
+ /* figure out controller */
+ if(sdev_c->cunit == SCCONF_ANY){
+ asprintf(&spc->adapter, "any");
+ } else {
+ if(ctrl_total){
+ for(i=0;i<ctrl_total;i++){
+ if(sdev_c->cunit==uc_scbus[i].bus_no){
+ asprintf(&spc->adapter, "%s%d",
+ uc_scbus[i].driver, uc_scbus[i].unit);
+ break;
+ }
+ }
+ if(i==ctrl_total) { /* made it through the whole list */
+ asprintf(&spc->adapter, "any?");
+ }
+ } else {
+ asprintf(&spc->adapter, "any?");
+ }
+ }
+ spc->target= sdev_c->target;
+ spc->lun= sdev_c->lun;
+ spc->desc=(char *)0; /* filled in later */
+ spc->config=sdev_c;
+ spc->modified=0;
+ sdev_c++;
+ total++;
+ }
+ }
+ kp->scsibus_devp=uc_scbus;
+
+ if((t=kp->nl[SCSI_TINIT].n_value)) {
+ /* WARNING: This is teetering on the brink of stupid.
+
+ this ugly little hack only works because the
+ <scsi driver>init routines are macro-generated,
+ so the offset of the device pointers will be
+ the same (hopefully).
+ */
+
+ while((initp=kv_dref_p(kp,t))) {
+ u_int tadr;
+ u_int sl;
+
+ t+=4;
+ tadr=kv_dref_t(kp, initp+4); /* offset in *.text* */
+ sdev=(struct scsi_device*)kv_to_u(kp, tadr, sizeof(struct scsi_device));
+ sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ total++;
+ temp=(char *)kv_to_u(kp, (u_int)sdev->name, 10);
+ asprintf(&spc->device, "%s*", temp);
+
+ asprintf(&spc->adapter, "any");
+
+ spc->target=SCCONF_ANY;
+ spc->lun=SCCONF_ANY;
+ spc->modified=0;
+ temp=(char *)kv_to_u(kp, (u_int)sdev->desc, 20);
+ asprintf(&spc->desc, "%s", temp);
+ /* now try to fill in any device descriptions from above */
+ sl=strlen(spc->device)-1;
+ for(i=0;i<(total-1);i++){ /* don't look at this device */
+ struct uc_scsi *usp;
+
+ usp=sp+i;
+ if(strncmp(usp->device, spc->device, sl)==0 && usp->desc==0) {
+ asprintf(&usp->desc, "%s", spc->desc);
+ }
+ }
+ }
+ if(total){
+ sp=(struct uc_scsi*)realloc(sp, (sizeof(struct uc_scsi)*(total+1)));
+ spc=sp+total;
+ bzero(spc, sizeof(struct uc_scsi));
+ kp->scsi_devp=sp;
+ } else {
+ free(sp);
+ kp->scsi_devp=(struct uc_scsi *)0;
+ }
+ }
+ } else {
+ kp->scsi_devp=(struct uc_scsi *)0;
+ }
+ }
+}
+
+struct list *
+get_scsi_devlist(struct kernel *kp){
+ struct list *dl;
+ struct uc_scsi *kdp;
+
+ dl=list_new();
+
+ for(kdp=kp->scsi_devp; kdp->device; kdp++){
+ list_append(dl, kdp->device);
+ }
+
+ return(dl);
+}
+
+struct list *
+get_scsi_device(struct uc_scsi *sp){
+ struct list *list;
+ char *tmp;
+
+ list=list_new();
+
+ list_append(list, sp->device);
+ list_append(list, sp->adapter);
+
+ asprintf(&tmp, "%d", sp->target );
+ list_append(list, tmp);
+ free(tmp);
+
+ asprintf(&tmp, "%d", sp->lun );
+ list_append(list, tmp);
+ free(tmp);
+
+ list_append(list, sp->desc);
+
+ return(list);
+}
+
+/* given a scsi_link and a uc_scsi pointer, fill it in */
+static void
+get_sl_info(struct kernel *kp, struct uc_scsi *spc, struct scsi_link *sl){
+
+ struct scsi_adapter *sadp;
+ struct scsi_device *sdev;
+ char *temp;
+
+ sadp=(struct scsi_adapter*)kv_to_u(kp, (u_int)sl->adapter,
+ sizeof(struct scsi_adapter));
+
+ sdev=(struct scsi_device*)kv_to_u(kp, (u_int)sl->device,
+ sizeof(struct scsi_device));
+
+ temp=(char *)kv_to_u(kp, (u_int)sdev->name, 20);
+ asprintf(&spc->device, "%s%d", temp, sl->dev_unit);
+ free(temp);
+ temp=(char *)kv_to_u(kp, (u_int)sadp->name, 20);
+ asprintf(&spc->adapter, "%s%d", temp, sl->adapter_unit);
+ free(temp);
+ spc->target = sl->target;
+ spc->lun = sl->lun;
+
+ temp=(char *)kv_to_u(kp, (u_int)sdev->desc, 30);
+ asprintf(&spc->desc, "%s", temp);
+ free(temp);
+
+}
+
+int
+scsi_setdev(struct kernel *kp, struct list *list){
+ int r=1, bus_valid=0;
+ struct uc_scsi *sp;
+ struct uc_scsibus *sbp;
+ char *t;
+
+ if(kp->scsi_devp)
+ for(sp=kp->scsi_devp;sp->device;sp++){
+ if(strcmp(list->av[0], sp->device)==0){
+ for(sbp=kp->scsibus_devp;sbp->driver; sbp++){
+ asprintf(&t, "%s%d", sbp->driver, sbp->unit);
+ if(strcmp(list->av[1], t)==0) {
+ bus_valid=1;
+ }
+ free(t);
+ }
+ if(bus_valid){
+ sp->modified=1;
+ free(sp->adapter);
+ asprintf(&sp->adapter, "%s", list->av[1]);
+ sp->target = strtol(list->av[2], (char **)NULL, 0);
+ sp->lun = strtol(list->av[3], (char **)NULL, 0);
+ r=0;
+ goto done;
+ } else {
+ r=2;
+ }
+ }
+ }
+done:
+ return(r);
+}
+
+void
+scsi_free(struct kernel *kp, int writeback){
+ struct uc_scsi *sp;
+ struct uc_scsibus *sbp;
+ char *t;
+ int scbus, i;
+
+ for(sp=kp->scsi_devp; sp->device; sp++){
+ if((!kp->incore) && sp->modified && writeback) {
+ /* save info */
+
+ /* I'm not sure this is necessary */
+#if 0
+ sscanf(sp->device, "%[a-z]%d", name, &unit);
+ sp->config->unit= unit;
+#endif
+
+ /* figger out the controller, which may have changed */
+ scbus=-1;
+ for(sbp=kp->scsibus_devp, i=0;sbp->driver; sbp++,i++){
+ asprintf(&t, "%s%d", sbp->driver, sbp->unit);
+ if(strcmp(sp->adapter, t)==0) {
+ scbus=i;
+ }
+ free(t);
+ }
+
+ /* if we fell through, don't change anything */
+ if(scbus!=-1){
+ sp->config->cunit= scbus;
+ }
+
+ sp->config->target= sp->target;
+ sp->config->lun= sp->lun;
+ /* sp->config->flags= ; XXX this should be here*/
+
+ }
+ free(sp->device);
+ free(sp->adapter);
+ free(sp->desc);
+ }
+ free(kp->scsi_devp);
+ kp->scsi_devp=(struct uc_scsi *)0;
+ /* now free the bus info */
+ if(kp->incore){
+ for(sbp=kp->scsibus_devp;sbp->driver; sbp++){
+/* fprintf(stderr, "sbp: 0x%x free(0x%x)\n", sbp, sbp->driver);*/
+ free(sbp->driver);
+ }
+ }
+
+ if (kp->scsibus_devp)
+ free(kp->scsibus_devp);
+ kp->scsibus_devp=(struct uc_scsibus *)0;
+}
+
+/* end of userconfig/uc_scsi.c */
diff --git a/release/sysinstall/ufs.c b/release/sysinstall/ufs.c
index 73c06676d6ce..8f61cbed3bda 100644
--- a/release/sysinstall/ufs.c
+++ b/release/sysinstall/ufs.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: ufs.c,v 1.13 1998/09/14 19:14:11 jkh Exp $
+ * $Id: ufs.c,v 1.12 1997/02/22 14:12:35 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -45,5 +45,19 @@
FILE *
mediaGetUFS(Device *dev, char *file, Boolean probe)
{
- return mediaGenericGet((char *)dev->private, file);
+ char buf[PATH_MAX];
+
+ if (isDebug())
+ msgDebug("Request for %s from UFS\n", file);
+ snprintf(buf, PATH_MAX, "%s/%s", (char *)dev->private, file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "%s/dists/%s", (char *)dev->private, file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "%s/%s/%s", (char *)dev->private, variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return fopen(buf, "r");
+ snprintf(buf, PATH_MAX, "%s/%s/dists/%s", (char *)dev->private, variable_get(VAR_RELNAME), file);
+ return fopen(buf, "r");
}
diff --git a/release/sysinstall/version.h b/release/sysinstall/version.h
new file mode 100644
index 000000000000..b42c26e8937d
--- /dev/null
+++ b/release/sysinstall/version.h
@@ -0,0 +1 @@
+#define RELEASE_NAME "__RELEASE"
diff --git a/release/tar.sh b/release/tar.sh
new file mode 100644
index 000000000000..89e6d0fd7f32
--- /dev/null
+++ b/release/tar.sh
@@ -0,0 +1,120 @@
+#!/bin/sh -p
+#
+# Simple replacement for tar(1), using cpio(1).
+#
+# Copyright (c) 1996 Joerg Wunsch
+# 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 DEVELOPERS ``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 DEVELOPERS 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.
+#
+
+#
+# For use on the fixit floppy. External programs required:
+# cpio(1), find(1), test(1)
+#
+
+#
+# $Id$
+#
+
+archive=${TAPE:-/dev/rst0}
+blocksize="20"
+device=""
+mode="none"
+verbose=""
+
+usage()
+{
+ echo "usage: tar -{c|t|x} [-v] [-b blocksize] [-f archive] [files...]" 1>&2
+ exit 64 # EX_USAGE
+}
+
+#
+# Prepend a hyphen to the first arg if necessary, so the traditional form
+# ``tar xvf /dev/foobar'' will work, too. More kludgy legacy forms are not
+# supported however.
+#
+
+if [ $# -lt 1 ] ; then
+ usage
+fi
+
+case "$1" in
+ -*) break
+ ;;
+ *) tmp="$1"
+ shift
+ set -- -$tmp "$@"
+ ;;
+esac
+
+while getopts "ctxvb:f:" option
+do
+ case $option in
+ [ctx])
+ if [ $mode = "none" ] ; then
+ mode=$option
+ else
+ usage
+ fi
+ ;;
+ v)
+ verbose="-v"
+ ;;
+ b)
+ blocksize="${OPTARG}"
+ ;;
+ f)
+ archive="${OPTARG## }"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+shift $(($OPTIND - 1))
+
+if [ "X${archive}" != "X-" ] ; then
+ device="-F ${archive}"
+# else: use stdin or stdout, which is the default for cpio
+fi
+
+case $mode in
+ none)
+ usage
+ ;;
+ t)
+ exec cpio -it $verbose $device --block-size="$blocksize" "$@"
+ ;;
+ x)
+ exec cpio -idmu $verbose $device --block-size="$blocksize" "$@"
+ ;;
+ c)
+ if [ $# -eq 0 ] ; then
+ # use current dir -- slightly bogus
+ set -- "."
+ fi
+ find "$@" -print |\
+ cpio -o -H ustar $verbose $device --block-size="$blocksize"
+ exit $?
+ ;;
+esac
diff --git a/release/texts/FLOPPIES.TXT b/release/texts/FLOPPIES.TXT
deleted file mode 100644
index c817d8c41b32..000000000000
--- a/release/texts/FLOPPIES.TXT
+++ /dev/null
@@ -1,57 +0,0 @@
-For a normal CDROM or network installation, all you need to copy onto an
-actual floppy from this directory is the boot.flp image (for 1.44MB floppies).
-
-If you're on the ALPHA then the boot.flp image is probably larger
-than any kind of floppy you have available and you will need to
-either netboot it, load it from some other type of media (such
-as a jaz drive) or use the kern.flp image described below.
-
-This release still uses only one installation floppy, the boot.flp
-image. For convenience (and for the DEC ALPHA architecture, on which
-binaries are quite a bit larger), however, we also provide the
-functionality of boot.flp now "decoupled" into a kern.flp image,
-which contains just the boot kernel, and mfsroot.flp, which contains
-the compressed MFS root image that is normally stored as part of
-the kernel itself on the boot.flp image. This allows you to boot
-from kern.flp, which will fit on a 1.44MB floppy even on the alpha,
-and then use mfsroot.flp from a 2nd floppy. This also allows you
-to easily make your own boot or MFS floppies should you need to customize
-some aspect of the installation process. As long as the kernel is compiled
-with ``options MFS'' and ``options MFS_ROOT'', it will properly look for
-and boot an mfsroot.flp image when run. The mfsroot.flp image is simply
-a gzip'd filesystem image, something which can be made rather
-easily using vnconfig(8). If none of this makes any sense to you,
-don't worry about it - just use the boot.flp image as always; nothing
-has changed there.
-
-
-NOTE: The *.flp images are NOT DOS files! You cannot simply copy them
-to a DOS or UFS floppy as regular files, you need to *image* copy them
-to the floppy with fdimage.exe under DOS or `dd' under UNIX.
-
-For example:
-
-To create the boot floppy image from DOS, you'd do something like
-this:
-
-C> fdimage boot.flp a:
-
-Assuming that you'd copied fdimage.exe and boot.flp into a directory
-somewhere. If you were doing this from the base of a CD distribution,
-then the *exact* command would be:
-
-E> tools\fdimage floppies\boot.flp a:
-
-
-If you're creating the boot floppy from a UNIX machine, you may find
-that:
-
- dd if=floppies/boot.flp of=/dev/rfd0
-
-or
-
- dd if=floppies/boot.flp of=/dev/floppy
-
-work well, depending on your hardware and operating system environment
-(different versions of UNIX have totally different names for the
-floppy drive - neat, huh? :-).
diff --git a/release/texts/HARDWARE.TXT b/release/texts/HARDWARE.TXT
deleted file mode 100644
index 3ab5f98585bd..000000000000
--- a/release/texts/HARDWARE.TXT
+++ /dev/null
@@ -1,569 +0,0 @@
-Table of Contents
------------------
-0. Document Conventions
-1. Default Configuration (GENERIC kernel)
-2. Using UserConfig to change FreeBSD kernel settings
-3. LINT - other possible configurations
-4. Supported Hardware
-
-See TROUBLE.TXT for Q&A on known hardware problems.
-
-=========================================================================
-
-0. Document Conventions
--- --------------------
-
-We have `underlined' text which represents user input with `-' symbols
-throughout this document to differentiate it from the machine output.
-
-1. Default (GENERIC) Configuration
--- -------------------------------
-
-The following table contains a list of all of the devices that are
-present in the GENERIC kernel. This is the essential part of the
-operating system that is placed in your root partition during the
-installation process. A compressed version of the GENERIC kernel is
-also used on the installation floppy diskette and DOS boot image.
-
-The table describes the various parameters used by the driver to
-communicate with the hardware in your system. There are four
-parameters in the table, though not all are used by each and every
-device:
-
- Port The starting I/O port used by the device, shown in hexadecimal.
-
- IOMem The lowest (or starting) memory address used by the device,
- also shown in hexadecimal.
-
- IRQ The interrupt the device uses to alert the driver to an event,
- given in decimal.
-
- DRQ The DMA (direct memory access) channel the device uses to move
- data to and from main memory, also given in decimal.
-
-If an entry in the table has `n/a' for a value then it means that the
-parameter in question does not apply to that device. A value of `dyn'
-means that the correct value should be determined automatically by the
-kernel when the system boots and that you don't need to worry about
-it.
-
-If an entry is marked with an *, it means that support is currently
-not available for it but should be back as soon as someone converts
-the driver to work within the new 3.0 framework.
-
-FreeBSD GENERIC kernel:
-
- Port IRQ DRQ IOMem Description
- ---- --- --- ----- ---------------------------------
-fdc0 3f0 6 2 n/a Floppy disk controller
-wdc0 1f0 14 n/a n/a IDE/MFM/RLL disk controller
-wdc1 170 15 n/a n/a IDE/MFM/RLL disk controller
-
-adv0 n/a n/a n/a n/a AdvanSys Narrow SCSI controllers
-adw0 n/a n/a n/a n/a AdvanSys Wide SCSI controllers
-ncr0 n/a n/a n/a n/a NCR PCI SCSI controller
-bt0 330 dyn dyn dyn Buslogic SCSI controller
-uha0* 330 dyn 6 dyn Ultrastore 14f
-aha0 330 dyn 5 dyn Adaptec 154x/1535 SCSI controller
-ahb0 dyn dyn dyn dyn Adaptec 174x SCSI controller
-ahc0 dyn dyn dyn dyn Adaptec 274x/284x/294x SCSI controller
-aic0* 340 11 dyn dyn Adaptec 152x/AIC-6360 SCSI
- controller
-isp0 dyn dyn dyn dyn QLogic 10X0, 2100 SCSI/FC controllers
-dpt n/a n/a n/a n/a DPT RAID SCSI controllers.
-
-wt0 300 5 1 dyn Wangtek and Archive QIC-02/QIC-36
-
-psm0 60 12 n/a n/a PS/2 Mouse
-
-mcd0 300 10 n/a n/a Mitsumi CD-ROM
-matcd0 230 n/a n/a n/a Matsushita/Panasonic CD-ROM
-scd0 230 n/a n/a n/a Sony CD-ROM
-
-sio0 3f8 4 n/a n/a Serial Port 0 (COM1)
-sio1 2f8 3 n/a n/a Serial Port 1 (COM2)
-
-lpt0 dyn 7 n/a n/a Printer Port 0
-lpt1 dyn dyn n/a n/a Printer Port 1
-
-ax0 dyn dyn n/a dyn ASIX AX88140A PCI based cards
-de0 n/a n/a n/a n/a DEC DC21x40 PCI based cards
- (including 21140 100bT cards)
-ed0 280 10 dyn d8000 WD & SMC 80xx; Novell NE1000 &
- NE2000; 3Com 3C503; HP PC Lan+
-eg0 310 5 dyn dyn 3Com 3C505
-ep0 300 10 dyn dyn 3Com 3C509
-ex0 dyn dyn dyn n/a Intel EtherExpress Pro/10 cards
-fe0 300 dyn n/a n/a Allied-Telesis AT1700, RE2000 and
- Fujitsu FMV-180 series cards.
-fxp0 dyn dyn n/a dyn Intel EtherExpress Pro/100B
-ie0 300 10 dyn d0000 AT&T StarLAN 10 and EN100;
- 3Com 3C507; NI5210
-ix0 300 10 dyn d0000 Intel EtherExpress cards
-ex0 dyn dyn dyn dyn Intel EtherExpress Pro/10 cards
-le0 300 5 dyn d0000 Digital Equipment EtherWorks
- 2 and EtherWorks 3
-lnc0 280 10 n/a dyn Lance/PCnet cards
- (Isolan, Novell NE2100, NE32-VL,
- some PCnet-PCI cards)
-mx0 dyn dyn n/a dyn Macronix 98713/15/25 PCI based cards
-pn0 dyn dyn n/a dyn Lite-On PNIC PCI based cards
-rl0 dyn dyn n/a dyn RealTek 8129/8139 fast ethernet
-tl0 dyn dyn n/a dyn TI TNET100 'ThunderLAN' cards.
-wb0 dyn dyn n/a dyn Winbond W89C840F PCI based cards.
-vr0 dyn dyn n/a dyn VIA VT3043/VT86C100A PCI based cards.
-vx0 dyn dyn n/a dyn 3Com 3c59x ((Fast) Etherlink III)
-xl0 dyn dyn n/a dyn 3Com 3c900, 3c905 and 3c905B
- ((Fast) Etherlink XL)
-cs0 0x300 dyn n/a n/a Crystal Semiconductor CS89x0-based
- cards.
-ze0 300 5 n/a d8000 IBM/National Semiconductor
- PCMCIA Ethernet Controller
-zp0 300 10 n/a d8000 3Com 3c589 Etherlink III
- PCMCIA Ethernet Controller
---- End of table ---
-
-
-If the hardware in your computer is not set to the same settings as
-those shown in the table and the item in conflict is not marked 'dyn',
-you will have to either reconfigure your hardware or use UserConfig
-to reconfigure the kernel to match the way your hardware is currently set
-(see the next section).
-
-If the settings do not match, the kernel may be unable to locate
-or reliably access the devices in your system.
-
-
-2. Using UserConfig to change FreeBSD kernel settings
--- --------------------------------------------------
-
-The FreeBSD kernel on the install floppy contains drivers for every
-piece of hardware that could conceivably be used to install the rest
-of the system with. Unfortunately, PC hardware being what it is, some
-of these devices can be difficult to detect accurately, and for some,
-the process of detecting another can cause irreversible confusion.
-
-To make this process easier, FreeBSD provides UserConfig. With this
-UserConfig, the user can configure and disable device drivers before
-the kernel is loaded, avoiding potential conflicts, and eliminating
-the need to reconfigure hardware to suit the default driver settings.
-
-Once FreeBSD is installed, it will remember the changes made using
-UserConfig, so that they only need be made once.
-
-It is important to disable drivers that are not relevant to a system
-in order to minimize the possibility of interference, which can cause
-problems that are difficult to track down.
-
-UserConfig features a command line interface for users with serial
-consoles or a need to type commands, and a full screen 'visual'
-interface, which provides point-and-shoot configuration functionality.
-
-Here is a sample UserConfig screen shot in 'visual' mode:
-
----Active Drivers---------------------------10 Conflicts------Dev---IRQ--Port--
- Storage : (Collapsed)
- Network :
- NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters CONF ed0 5 0x280
- NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters CONF ed1 5 0x300
- Communications : (Collapsed)
- Input : (Collapsed)
- Multimedia :
----Inactive Drivers-------------------------------------------Dev--------------
- Storage :
- Network : (Collapsed)
- Communications :
- Input :
- Multimedia :
- PCI :
-
----Parameters-for-device-ed0---------------------------------------------------
- Port address : 0x280 Memory address : 0xd8000
- IRQ number : 5 Memory size : 0x2000
- Flags : 0x0000
--------------------------------------------------------------------------------
- IO Port address (Hexadecimal, 0x1-0x2000)
- [TAB] Change fields [Q] Save device parameters
-
-
- The screen is divided into four sections :
-
- - Active Drivers. Listed here are the device drivers that are currently
- enabled, and their basic parameters.
- - Inactive Drivers. These drivers are present, but are disabled.
- - Parameter edit field. This area is used for editing driver parameters.
- - Help area. Keystroke help is displayed here.
-
-One of the Active and Inactive lists is always in use, and the current
-entry in the list will be shown with a highlight bar. If there are
-more entries in a list than can be shown, it will scroll. The bar can
-be moved up and down using the cursor keys, and moved between lists
-with the TAB key.
-
-Drivers in the Active list may be marked "CONF". This indicates that
-one or more of their parameters conflicts with another device, and
-indicates a potential for problems. The total number of conflicts is
-displayed at the top of the screen.
-
-As a general rule, conflicts should be avoided, either by disabling
-conflicting devices that are not present in the system, or by altering
-their configuration so that they match the installed hardware.
-
-In the list areas, drivers are grouped by their basic function.
-Groups can be 'Collapsed' to simplify the display (this is the default
-state for all groups). If a group is collapsed, it will be shown with
-'(Collapsed)' in the list, as above. To Expand a Collapsed group,
-position the highlight bar over the group heading and press Enter. To
-Collapse it again, repeat the process.
-
-When a device driver in the Active list is highlighted, its full
-parameters are displayed in the Parameter edit area. Note that not
-all drivers use all possible parameters, and some hardware supported
-by drivers may not use all the parameters the driver supports.
-
-To disable a driver, go to the Active list, Expand the group it is in,
-highlight the driver and press Del. The driver will move to its group
-in the Inactive list. (If the group is collapsed or off the screen,
-you may not see the driver in its new location.)
-
-To enable a driver, go to the Inactive list, Expand the group it is
-in, highlight the driver and press Enter. The highlight will move to
-the Active list, and the driver you have just enabled will be
-highlighted, ready to be configured.
-
-To configure a driver, go to the Active list, Expand the group it is
-in, highlight the driver and press Enter. The cursor will move to the
-Parameter edit area, and the device's parameters may be edited.
-
-While editing parameters, the TAB and cursor keys can be used to move
-between fields. Most numeric values (except IRQ) are entered in
-hexadecimal, as indicated by the '0x' at the beginning of the field.
-The allowable values for a given field are show in the Key Help area
-when the field is active.
-
-To finish configuring a driver, press 'Q'.
-
-Note that PCI and EISA devices can be probed reliably, therefore they
-are not shown in the table above nor can their settings be changed
-using UserConfig. PCI drivers may be seen in the "PCI Devices" section
-in the Active Devices list, if you wish to check for their presence.
-
-
-3. LINT - other possible configurations
--- ------------------------------------
-
-The following drivers are not in the GENERIC kernel but remain
-available to those who do not mind compiling a custom kernel (see
-section 6 of FreeBSD.FAQ). The LINT configuration file
-(/sys/i386/conf/LINT) also contains prototype entries for just about
-every device supported by FreeBSD and is a good general reference.
-
-The device names and a short description of each are listed below. The port
-numbers, etc, are not meaningful here since you will need to compile a
-custom kernel to gain access to these devices anyway and can thus
-adjust the addresses to match the hardware in your computer in the process.
-The LINT file contains prototype entries for all of the below which you
-can easily cut-and-paste into your own file (or simply copy LINT and edit
-it to taste):
-
-ctx: Cortex-I frame grabber
-cx: Cronyx/Sigma multiport sync/async
-cy: Cyclades high-speed serial driver
-el: 3Com 3C501
-fea: DEV DEFEA EISA FDDI adapter
-fpa: DEC DEFPA PCI FDDI adapter
-gp: National Instruments AT-GPIB and AT-GPIB/TNT board
-gsc: Genius GS-4500 hand scanner
-gus: Gravis Ultrasound - Ultrasound, Ultrasound 16, Ultrasound MAX
-gusxvi: Gravis Ultrasound 16-bit PCM
-hea: Efficient ENI-155p ATM PCI adapter
-hfa: FORE PCA-200E ATM PCI adapter
-joy: Joystick
-labpc: National Instrument's Lab-PC and Lab-PC+
-meteor: Matrox Meteor frame-grabber card
-bktr: Brooktree Bt848 based frame-grabber cards.
-mpu: Roland MPU-401 stand-alone card
-mse: Microsoft, Logitech, ATI bus mouse ports
-mss: Microsoft Sound System
-nic: Dr Neuhaus NICCY 3008, 3009 & 5000 ISDN cards
-opl: Yamaha OPL-2 and OPL-3 FM - SB, SB Pro, SB 16, ProAudioSpectrum
-pas: ProAudioSpectrum PCM and MIDI
-pca: PCM audio ("/dev/audio") through your PC speaker
-pcm: PCM audio on most modern ISA audio codecs
-psm: PS/2 mouse port
-rc: RISCom/8 multiport card
-sb: SoundBlaster PCM - SoundBlaster, SB Pro, SB16, ProAudioSpectrum
-sbmidi: SoundBlaster 16 MIDI interface
-sbxvi: SoundBlaster 16
-si: Specialix SI/XIO/SX (old and enhanced ISA, PCI, EISA) serial
-spigot: Creative Labs Video Spigot video-acquisition board
-uart: Stand-alone 6850 UART for MIDI
-wds: Western Digital WD7000 IDE
-
---- end of list ---
-
-
-4. Supported Hardware
--- ------------------
-
-FreeBSD currently runs on a wide variety of ISA, VLB, EISA and PCI bus
-based PC's, ranging from 386sx to Pentium class machines (though the
-386sx is not recommended). Support for generic IDE or ESDI drive
-configurations, various SCSI controller, network and serial cards is
-also provided.
-
-What follows is a list of all peripherals currently known to work with
-FreeBSD. Other configurations may also work, we have simply not as yet
-received confirmation of this.
-
-
-4.1. Disk Controllers
----- ----------------
-
-WD1003 (any generic MFM/RLL)
-WD1007 (any generic IDE/ESDI)
-IDE
-ATA
-
-Adaptec 1535 ISA SCSI controllers
-Adaptec 154x series ISA SCSI controllers
-Adaptec 174x series EISA SCSI controller in standard and enhanced mode.
-Adaptec 274X/284X/2920C/294x/2950/3940/3950 (Narrow/Wide/Twin) series
-EISA/VLB/PCI SCSI controllers.
-Adaptec AIC7850, AIC7860, AIC7880, AIC789x, on-board SCSI controllers.
-
-AdvanSys SCSI controllers (all models).
-
-BusLogic MultiMaster controllers:
-
-[ Please note that BusLogic/Mylex "Flashpoint" adapters are NOT yet supported ]
-
-BusLogic MultiMaster "W" Series Host Adapters:
- BT-948, BT-958, BT-958D
-BusLogic MultiMaster "C" Series Host Adapters:
- BT-946C, BT-956C, BT-956CD, BT-445C, BT-747C, BT-757C, BT-757CD, BT-545C,
- BT-540CF
-BusLogic MultiMaster "S" Series Host Adapters:
- BT-445S, BT-747S, BT-747D, BT-757S, BT-757D, BT-545S, BT-542D, BT-742A,
- BT-542B
-BusLogic MultiMaster "A" Series Host Adapters:
- BT-742A, BT-542B
-
-AMI FastDisk controllers that are true BusLogic MultiMaster clones are also
-supported.
-
-DPT SmartCACHE Plus, SmartCACHE III, SmartRAID III, SmartCACHE IV and
-SmartRAID IV SCSI/RAID controllers are supported. The DPT SmartRAID/CACHE V
-is not yet supported.
-
-SymBios (formerly NCR) 53C810, 53C810a, 53C815, 53C820, 53C825a,
-53C860, 53C875, 53C875j, 53C885, 53C895 and 53C896 PCI SCSI controllers:
- ASUS SC-200
- Data Technology DTC3130 (all variants)
- NCR cards (all)
- Symbios cards (all)
- Tekram DC390W, 390U and 390F
- Tyan S1365
-
-
-QLogic 1020, 1040, 1040B and 2100 SCSI and Fibre Channel Adapters
-
-DTC 3290 EISA SCSI controller in 1542 emulation mode.
-
-With all supported SCSI controllers, full support is provided for
-SCSI-I & SCSI-II peripherals, including hard disks, optical disks,
-tape drives (including DAT and 8mm Exabyte), medium changers, processor
-target devices and CDROM drives. WORM devices that support CDROM commands
-are supported for read-only access by the CDROM driver. WORM/CD-R/CD-RW
-writing support is provided by cdrecord, which is in the ports tree.
-
-The following CD-ROM type systems are supported at this time:
-(cd) SCSI interface (also includes ProAudio Spectrum and
- SoundBlaster SCSI)
-(matcd) Matsushita/Panasonic (Creative SoundBlaster) proprietary
- interface (562/563 models)
-(scd) Sony proprietary interface (all models)
-(wcd) ATAPI IDE interface
-
-The following drivers were supported under the old SCSI subsystem, but are
-NOT YET supported under the new CAM SCSI subsystem:
-
- Tekram DC390 and DC390T controllers (maybe other cards based on the
- AMD 53c974 as well).
-
- NCR5380/NCR53400 ("ProAudio Spectrum") SCSI controller.
-
- UltraStor 14F, 24F and 34F SCSI controllers.
-
- Seagate ST01/02 SCSI controllers.
-
- Future Domain 8xx/950 series SCSI controllers.
-
- WD7000 SCSI controller.
-
- Adaptec 1510 series ISA SCSI controllers (not for bootable devices)
- Adaptec 152x series ISA SCSI controllers
- Adaptec AIC-6260 and AIC-6360 based boards, which includes the AHA-152x
- and SoundBlaster SCSI cards.
-
- [ Note: There is work-in-progress to port the AIC-6260/6360 and
- UltraStor drivers to the new CAM SCSI framework, but no estimates on
- when or if they will be completed. ]
-
-Unmaintained drivers, they might or might not work for your hardware:
-
- Floppy tape interface (Colorado/Mountain/Insight)
-
- (mcd) Mitsumi proprietary CD-ROM interface (all models)
-
-4.2. Network cards
----- -------------
-
-Allied-Telesis AT1700 and RE2000 cards
-
-AMD PCnet/PCI (79c970 & 53c974 or 79c974)
-
-SMC Elite 16 WD8013 ethernet interface, and most other WD8003E,
-WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and WD8013EBT
-based clones. SMC Elite Ultra is also supported.
-
-RealTek 8129/8139 fast ethernet NICs including the following:
- Allied Telesyn AT2550
- Allied Telesyn AT2500TX
- Genius GF100TXR (RTL8139)
- NDC Communications NE100TX-E
- OvisLink LEF-8129TX
- OvisLink LEF-8139TX
- Netronix Inc. EA-1210 NetEther 10/100
- KTX-9130TX 10/100 Fast Ethernet
- Accton "Cheetah" EN1027D (MPX 5030/5038; RealTek 8139 clone?)
- SMC EZ Card 10/100 PCI 1211-TX
-
-Lite-On 82c168/82c169 PNIC fast ethernet NICs including the following:
- LinkSys EtherFast LNE100TX
- NetGear FA310-TX Rev. D1
- Matrox FastNIC 10/100
-
-Macronix 98713, 98713A, 98715, 98715A and 98725 fast ethernet NICs
- NDC Communications SFA100A (98713A)
- CNet Pro120A (98713 or 98713A)
- CNet Pro120B (98715)
- SVEC PN102TX (98713)
-
-Winbond W89C840F fast ethernet NICs including the following:
- Trendware TE100-PCIE
-
-VIA Technologies VT3043 "Rhine I" and VT86C100A "Rhine II" fast ethernet
-NICs including the following:
- Hawking Technologies PN102TX
- D-Link DFE530TX
-
-Texas Instruments ThunderLAN PCI NICs, including the following:
- Compaq Netelligent 10, 10/100, 10/100 Proliant, 10/100 Dual-Port
- Compaq Netelligent 10/100 TX Embedded UTP, 10 T PCI UTP/Coax, 10/100 TX UTP
- Compaq NetFlex 3P, 3P Integrated, 3P w/ BNC
- Olicom OC-2135/2138, OC-2325, OC-2326 10/100 TX UTP
-
-ASIX Electronics AX88140A PCI NICs, including the following:
- Alfa Inc. GFC2204
- CNet Pro110B
-
-DEC EtherWORKS III NICs (DE203, DE204, and DE205)
-DEC EtherWORKS II NICs (DE200, DE201, DE202, and DE422)
-DEC DC21040, DC21041, or DC21140 based NICs (SMC Etherpower 8432T, DE245, etc)
-DEC FDDI (DEFPA/DEFEA) NICs
-
-Efficient ENI-155p ATM PCI
-
-FORE PCA-200E ATM PCI
-
-Fujitsu MB86960A/MB86965A
-
-HP PC Lan+ cards (model numbers: 27247B and 27252A).
-
-Intel EtherExpress (not recommended due to driver instability)
-Intel EtherExpress Pro/10
-Intel EtherExpress Pro/100B PCI Fast Ethernet
-
-Isolan AT 4141-0 (16 bit)
-Isolink 4110 (8 bit)
-
-Novell NE1000, NE2000, and NE2100 ethernet interface.
-
-3Com 3C501 cards
-
-3Com 3C503 Etherlink II
-
-3Com 3c505 Etherlink/+
-
-3Com 3C507 Etherlink 16/TP
-
-3Com 3C509, 3C579, 3C589 (PCMCIA), 3C590/592/595/900/905/905B PCI and EISA
-(Fast) Etherlink III / (Fast) Etherlink XL
-
-3Com 3c980 Fast Etherlink XL server adapter
-
-Toshiba ethernet cards
-
-PCMCIA ethernet cards from IBM and National Semiconductor are also
-supported.
-
-Note that NO token ring cards are supported at this time as we're
-still waiting for someone to donate a driver for one of them. Any
-takers?
-
-
-4.3. Misc
----- ----
-
-AST 4 port serial card using shared IRQ.
-
-ARNET 8 port serial card using shared IRQ.
-ARNET (now Digiboard) Sync 570/i high-speed serial.
-
-Boca BB1004 4-Port serial card (Modems NOT supported)
-Boca IOAT66 6-Port serial card (Modems supported)
-Boca BB1008 8-Port serial card (Modems NOT supported)
-Boca BB2016 16-Port serial card (Modems supported)
-
-Cyclades Cyclom-y Serial Board.
-
-STB 4 port card using shared IRQ.
-
-SDL Communications Riscom/8 Serial Board.
-SDL Communications RISCom/N2 and N2pci high-speed sync serial boards.
-
-Specialix SI/XIO/SX multiport serial cards, with both the older
-SIHOST2.x and the new "enhanced" (transputer based, aka JET) host cards.
-ISA, EISA and PCI are supported.
-
-Stallion multiport serial boards: EasyIO, EasyConnection 8/32 & 8/64,
-ONboard 4/16 and Brumby.
-
-Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound
-and Roland MPU-401 sound cards.
-
-Connectix QuickCam
-Matrox Meteor Video frame grabber
-Creative Labs Video Spigot frame grabber
-Cortex1 frame grabber
-Various Frame grabbers based on Brooktree Bt848 chip.
-
-HP4020, HP6020, Philips CDD2000/CDD2660 and Plasmon CD-R drives.
-
-Bus mice
-
-PS/2 mice
-
-Standard PC Joystick
-
-X-10 power controllers
-
-GPIB and Transputer drivers.
-
-Genius and Mustek hand scanners.
-
-Floppy tape drives (some rather old models only, driver rather stale)
-
-
-FreeBSD currently does NOT support IBM's microchannel (MCA) bus.
diff --git a/release/texts/INSTALL.TXT b/release/texts/INSTALL.TXT
deleted file mode 100644
index 3a7c5cf420d8..000000000000
--- a/release/texts/INSTALL.TXT
+++ /dev/null
@@ -1,513 +0,0 @@
-+===================== Installing FreeBSD ==========================+
-| |
-| Table of Contents: |
-| |
-| 0.0 Quick Start: |
-| 0.1 Installing FreeBSD from CDROM or the Internet. |
-| |
-| 1.0 Detail on various installation types: |
-| 1.1 Installing from a network CDROM |
-| 1.2 Installing from Floppies |
-| 1.3 Installing from a DOS partition |
-| 1.4 Installing from QIC/SCSI tape |
-| 1.5 Installing over a network using NFS or FTP |
-| 1.5.1 NFS Installation tips |
-| 1.5.2 FTP Installation tips |
-| |
-| 2.0 DOS User's Q&A section. |
-| 2.1 How do I make space for FreeBSD? |
-| 2.2 Can I use compressed DOS filesystems from FreeBSD? |
-| 2.3 Can I use DOS extended partitions? |
-| 2.4 Can I run DOS executables under FreeBSD? |
-| |
-+=====================================================================+
-
-Author: Jordan K. Hubbard
-Last updated: Tue Mar 24 00:56:14 PST 1998
-
-0.0 Quick Start
---- -----------
-
-This manual documents the process of making a new installation of
-FreeBSD on your machine. If you are upgrading from a previous
-release of FreeBSD, please see the file UPGRADE.TXT for important
-information on upgrading. If you are not familiar with configuring
-PC hardware for FreeBSD, you should also read the HARDWARE.TXT file -
-it contains important information which may save you a lot of grief.
-
-If you're new to FreeBSD then you should also read EVERYTHING listed
-in the Documentation menu on the boot floppy. It may seem like a lot
-to read, but the time you spend now reading the documents will be made
-up many times over because you were adequately prepared. Also, you will
-know the types of information available should you get stuck later.
-Once the system is installed, you can also revisit this menu and use a
-WEB browser to read the installed FAQ (Frequently Asked Questions) and
-Handbook HTML documentation sets for FreeBSD. You can also use the
-browser to visit other WEB sites on the net (like http://www.freebsd.org)
-if you have an Internet connection. See ABOUT.TXT for more information
-on the resources available to you.
-
-The best laid plans sometimes go awry, so if you run into trouble take a
-look at TROUBLE.TXT which contains valuable troubleshooting information.
-
-DISCLAIMER: While FreeBSD does its best to safeguard against
-accidental loss of data, it's still more than possible to WIPE OUT
-YOUR ENTIRE DISK with this installation! Please do not proceed to the
-final FreeBSD installation menu unless you've adequately backed up any
-important data first! We really mean it!
-
-FreeBSD requires a 386 or better processor to run (sorry, there is no
-support for '286 processors), 5 megs of RAM to install and 4 megs of
-ram to run. You will need at least 80 megs of free hard drive space.
-See below for ways of shrinking existing DOS partitions in order to
-install FreeBSD.
-
-
-0.1 Installing FreeBSD from CDROM or the Internet
---- ---------------------------------------------
-
-The easiest type of installation is from CD. If you have a supported
-CDROM drive and a FreeBSD installation CD from Walnut Creek CDROM,
-there are 3 ways of starting the installation from it:
-
- 1. If your system supports bootable CDROM media (usually an option
- which can be selectively enabled in the controller's setup menu
- or in the PC BIOS for some systems) and you have it enabled,
- FreeBSD 2.2.1 and later CDs support the "El Torrito" bootable
- CD standard. Simply put the installation CD in your CDROM drive
- and boot the system to begin installation.
-
- 2. If you have drivers which allow you to see your CDROM drive
- from from DOS, first disable any fancy memory managers you may
- have configured, change directory to the CDROM (E:\ in the example
- below) and then type this:
-
- E> install
-
- and you should boot directly into the FreeBSD installation.
-
- If either steps fail, please go on to step 3.
-
- 3. Build a FreeBSD boot floppy from the floppies/boot.flp
- file in a FreeBSD distribution. Either simply use the
- ``makeflp.bat'' script from DOS or read floppies/README.TXT
- for more information on creating bootable floppies under
- different operating systems. Then you simply boot
- from the floppy and you should go into the FreeBSD
- installation.
-
-If you don't have a CDROM and would like to simply install over the
-net using PPP, slip or a dedicated connection, simply fetch the
-<FreeBSD-release>/floppies/boot.flp file from:
-
- ftp://ftp.freebsd.org/pub/FreeBSD
-
-or one of its many mirrors (http://www.freebsd.org/handbook/mirrors.html)
-and follow step 3 above. You should also read the floppies/README.TXT
-file as it contains important information for downloaders.
-
-Once you have a boot floppy made, please go to section 1.5 of this
-document for additional tips on installing via FTP or NFS.
-
-
-1.0 Detail on various installation types
---- ------------------------------------
-
-Once you've gotten yourself to the initial installation screen
-somehow, you should be able to follow the various menu prompts and go
-from there. If you've never used the FreeBSD installation before, you
-are also encouraged to read some of the documentation in the the
-Documentation submenu as well as the general "Usage" instructions on
-the first menu.
-
- REMEMBER: If you get stuck at a screen, hit F1 for the online
- documentation for that section.
-
-If you've never installed FreeBSD before, or even if you have, the
-"Novice" installation mode is the most recommended since it makes sure
-that you'll visit all the various important checklist items along the
-way. If you're much more comfortable with the FreeBSD installation
-process and know _exactly_ what you want to do, use the Express or
-Custom installation options. If you're upgrading an existing system,
-use the Upgrade option.
-
-The FreeBSD installer supports the direct use of floppy, DOS, tape,
-CDROM, FTP, NFS and UFS partitions as installation media, further tips
-on installing from each type of media listed below.
-
-
-1.1 Installing from a network CDROM
---- -------------------------------
-
-If you simply wish to install from a local CDROM drive then see the
-Quick Start section. If you don't have a CDROM drive on your system
-and wish to use a FreeBSD distribution CD in the CDROM drive of
-another system to which you have network connectivity, there are
-several ways of going about it:
-
-1. If you would be able to FTP install FreeBSD directly from the CDROM
- drive in some FreeBSD machine, it's quite easy: You simply add the
- following line to the password file (using the vipw command):
-
- ftp:*:99:99::0:0:FTP:/cdrom:/sbin/nologin
-
-And anyone else on your network will now be able to chose a Media type
-of FTP and type in: ``ftp://<machine with CDROM drive>'' after picking
-"Other" in the ftp sites menu.
-
-2. If you would rather use NFS to export the CDROM directly to the
- machine(s) you'll be installing from, you need to first add an
- entry to the /etc/exports file (on the machine with the CDROM drive)
- which looks something like this:
-
- /cdrom -ro ziggy.foo.com
-
- To allow the machine "ziggy.foo.com" to mount the CDROM directly
- via NFS during installation. The machine with the CDROM must also
- be configured as an NFS server, of course, and if you're not sure how
- to do that then an NFS installation is probably not the best choice
- for you unless you're willing to read up on rc.conf(5) and configure
- things appropriately. Assuming that this part goes smoothly, you
- should be able to enter: <cdrom-host>:/cdrom as the path for an NFS
- installation when the target machine is installed.
-
-
-1.2 Installing from Floppies
---- ------------------------
-
-If you must install from floppy disks, either due to unsupported
-hardware or just because you enjoy doing things the hard way, you must
-first prepare some floppies for the install.
-
-First, make a boot floppy as described in floppies/README.TXT
-
-Second, read the file LAYOUT.TXT and pay special attention to the
-"Distribution format" section since it describes which files you're
-going to need to put onto floppy and which you can safely skip.
-
-Next you will need, at minimum, as many 1.44MB floppies as it takes to
-hold all files in the bin (binary distribution) directory. If you're
-preparing these floppies under DOS, then THESE floppies *must* be
-formatted using the MS-DOS FORMAT command. If you're using Windows,
-use the Windows File Manager format command.
-
-Don't trust Factory Preformatted floppies! Format them again
-yourself, just to make sure. Many problems reported by our users in
-the past have resulted from the use of improperly formatted media,
-which is why I'm taking such special care to mention it here!
-
-If you're creating the floppies from another FreeBSD machine, a format
-is still not a bad idea though you don't need to put a DOS filesystem
-on each floppy. You can use the `disklabel' and `newfs' commands to
-put a UFS filesystem on a floppy, as the following sequence of
-commands illustrates:
-
- fdformat -f 1440 fd0.1440
- disklabel -w -r fd0.1440 floppy3
- newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0
-
-After you've formatted the floppies for DOS or UFS, you'll need to
-copy the files onto them. The distribution files are split into
-chunks conveniently sized so that 5 of them will fit on a conventional
-1.44MB floppy. Go through all your floppies, packing as many files as
-will fit on each one, until you've got all the distributions you want
-packed up in this fashion. Each distribution should go into its own
-subdirectory on the floppy, e.g.: a:\bin\bin.inf, a:\bin\bin.aa,
-a:\bin\bin.ab, ...
-
-IMPORTANT NOTE: The bin.inf file also needs to go on the first floppy
-of the bin set since it is read by the installation program in order
-to figure out how many additional pieces to look for when fetching and
-concatenating the distribution. When putting distributions onto
-floppies, the <distname>.inf file MUST occupy the first floppy of each
-distribution set!
-
-Once you come to the Media screen of the install, select "Floppy" and
-you'll be prompted for the rest.
-
-
-1.3 Installing from a DOS partition
---- -------------------------------
-
-To prepare for installation from an MS-DOS partition you should simply
-copy the files from the distribution into a directory called
-"FREEBSD" on the Primary DOS partition ("Drive C:"). For example, to do
-a minimal installation of FreeBSD from DOS using files copied from the
-CDROM, you might do something like this:
-
- C:\> MD C:\FREEBSD
- C:\> XCOPY /S E:\BIN C:\FREEBSD\BIN
-
-Assuming that `E:' was where your CD was mounted.
-
-For as many `DISTS' as you wish to install from DOS (and you have free
-space for), install each one in a directory under `C:\FREEBSD' - the
-BIN dist is only the minimal requirement.
-
-IMPORTANT NOTE: Though you can do all of the above by hand if you
-really want to, all of it is much more easily accomplished now by
-Robert Nordier's "setup.exe" program. It will give you a menu of
-distribution choices, verify that you have enough free space and do
-all the copying to C:\FREEBSD for you automatically.
-
-Once you've copied the directories or run setup.exe and let it do all
-the work for you, you can simply launch the installation from DOS by
-running the install.bat script (NOTE: Some memory managers don't like
-this - disable QEMM or EMM386 if they're running before trying this)
-or making a boot floppy as described in section 0.1.
-
-
-1.4 Installing from QIC/SCSI Tape
---- -----------------------------
-
-When installing from tape, the installation program expects the files
-to be simply tar'ed onto it, so after fetching all of the files for
-the distributions you're interested in, simply tar them onto the tape
-with a command something like this:
-
- cd /where/you/have/your/dists
- tar cvf /dev/rwt0 (or /dev/rsa0) dist1 .. dist2
-
-When you go to do the installation, you should also make sure that you
-leave enough room in some temporary directory (which you'll be allowed
-to choose) to accommodate the FULL contents of the tape you've
-created. Due to the non-random access nature of tapes, this method of
-installation requires quite a bit of temporary storage! You should
-expect to require as much temporary storage as you have stuff written
-on tape.
-
-SPECIAL NOTE: When going to do the installation, the tape must be in
-the drive *before* booting from the boot floppy. The installation
-"probe" may otherwise fail to find it.
-
-Now create a boot floppy as described in section 0.1 and proceed with
-the installation.
-
-
-1.5 Installing over a network using FTP or NFS
---- ------------------------------------------
-
-After making a boot floppy as described in the first section, you can
-load the rest of the installation over a network using one of 3 types
-of connections:
-
- Serial port: SLIP / PPP
- Parallel port: PLIP (using ``laplink'' style cable)
- Ethernet: A standard Ethernet controller (including
- certain PCCARD devices).
-
-Serial Port
------------
-
-SLIP support is rather primitive, and is limited primarily to
-hard-wired links, such as a serial cable running between two
-computers. The link must be hard-wired because the SLIP installation
-doesn't currently offer a dialing capability. If you need to dial out
-with a modem or otherwise dialog with the link before connecting to
-it, then I recommend that the PPP utility be used instead.
-
-If you're using PPP, make sure that you have your Internet Service
-Provider's IP address and DNS information handy as you'll need to know
-it fairly early in the installation process. You may also need to
-know your own IP address, though PPP supports dynamic address
-negotiation and may be able to pick up this information directly from
-your ISP if they support it.
-
-You will also need to know how to use the various "AT commands" for
-dialing out with your particular brand of modem as the PPP dialer
-provides only a very simple terminal emulator.
-
-
-Parallel Port
--------------
-
-If a hard-wired connection to another FreeBSD (2.0R or later) or Linux
-machine is available, you might also consider installing over a
-"laplink" style parallel port cable. The data rate over the parallel
-port is much higher than what is typically possible over a serial line
-(up to 50k/sec), thus resulting in a quicker installation. It's not
-typically necessary to use "real" IP addresses when using a
-point-to-point parallel cable in this way and you can generally just
-use RFC 1918 style addresses for the ends of the link (e.g. 10.0.0.1,
-10.0.0.2, etc).
-
-IMPORTANT NOTE: If you use a Linux machine rather than a FreeBSD
-machine as your PLIP peer, you will also have to specify "link0" in
-the TCP/IP setup screen's ``extra options for ifconfig'' field.
-
-
-Ethernet
---------
-
-FreeBSD supports most common PC Ethernet cards, a table of supported
-cards (and their required settings) being provided as part of the
-FreeBSD Hardware Guide (see the Documentation menu on the boot floppy
-or the top level directory of the CDROM). If you are using one of the
-supported PCMCIA Ethernet cards, also be sure that it's plugged in
-_before_ the laptop is powered on! FreeBSD does not, unfortunately,
-currently support "hot insertion" of PCMCIA cards during installation.
-
-You will also need to know your IP address on the network, the
-"netmask" value for your address class and the name of your machine.
-Your system administrator can tell you which values are appropriate to
-your particular network setup. If you will be referring to other
-hosts by name rather than IP address, you'll also need a name server
-and possibly the address of a gateway (if you're using PPP, it's your
-provider's IP address) to use in talking to it.
-
-If you do not know the answers to these questions then you should
-really probably talk to your system administrator _first_ before
-trying this type of installation! Using a randomly chosen IP address
-or netmask on a live network will almost certainly get you shot at
-dawn.
-
-Once you have a network connection of some sort working, the
-installation can continue over NFS or FTP.
-
-
-1.5.1 NFS installation tips
------ ---------------------
-
- NFS installation is fairly straight-forward: Simply copy the
- FreeBSD distribution files you want onto a server somewhere
- and then point the NFS media selection at it.
-
- If this server supports only "privileged port" access (as is
- generally the default for Sun and Linux workstations), you
- will need to set this option in the Options menu before
- installation can proceed.
-
- If you have a poor quality Ethernet card which suffers from very
- slow transfer rates, you may also wish to toggle the appropriate
- Options flag.
-
- In order for NFS installation to work, the server must also support
- "subdir mounts", e.g. if your FreeBSD 2.2 distribution directory
- lives on: ziggy:/usr/archive/stuff/FreeBSD
- Then ziggy will have to allow the direct mounting of
- /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff.
-
- In FreeBSD's /etc/exports file this is controlled by the
- ``-alldirs'' option. Other NFS servers may have different
- conventions. If you are getting `Permission Denied' messages
- from the server then it's likely that you don't have this
- properly enabled!
-
-
-1.5.2 FTP Installation tips
------ ---------------------
-
- FTP installation may be done from any mirror site containing a
- reasonably up-to-date version of FreeBSD. A full menu of
- reasonable choices for almost any location in the world is
- provided in the FTP site menu during installation.
-
- If you are installing from some other FTP site not listed in
- this menu, or you are having troubles getting your name server
- configured properly, you can also specify your own URL by
- selecting the ``Other'' choice in that menu. A URL can
- contain a hostname or an IP address, so the following would
- work in the absence of a name server:
-
- ftp://192.216.191.11/pub/FreeBSD/2.2-RELEASE
-
- There are two FTP installation modes you can use:
-
- o FTP:
-
- For all FTP transfers, use the standard "Active" mode for
- transfers. This will not work through most firewalls but
- will often work best with older ftp servers that do not
- support passive mode. If your connection hangs with
- passive mode, try this one!
-
- o FTP Passive:
-
- For all FTP transfers, use "Passive" mode. This allows
- the user to pass through firewalls that do not allow
- incoming connections on random port addresses.
-
- NOTE: ACTIVE AND PASSIVE MODES ARE NOT THE SAME AS A `PROXY'
- CONNECTIONS, WHERE A PROXY FTP SERVER IS LISTENING ON A
- DIFFERENT PORT!
-
- In such instances, you should specify the URL as something like:
-
- ftp://foo.bar.com:1234/pub/FreeBSD
-
- Where "1234" is the port number of the proxy ftp server.
-
-
-2.0 DOS user's Question and Answer section
---- --------------------------------------
-
-2.1 Help! I have no space! Do I need to delete everything first?
---- --------------------------------------------------------------
-
-If your machine is already running DOS and has little or no free space
-available for FreeBSD's installation, all is not lost! You may find
-the "FIPS" utility, provided in the tools/ subdirectory on the FreeBSD
-CDROM or on the various FreeBSD ftp sites, to be quite useful.
-
-FIPS allows you to split an existing DOS partition into two pieces,
-preserving the original partition and allowing you to install onto the
-second free piece. You first "defrag" your DOS partition, using the
-DOS 6.xx "DEFRAG" utility or the Norton Disk tools, then run FIPS. It
-will prompt you for the rest of the information it needs. Afterwards,
-you can reboot and install FreeBSD on the new partition. Also note
-that FIPS will create the second partition as a "clone" of the first,
-so you'll actually see that you now have two DOS Primary partitions
-where you formerly had one. Don't be alarmed! You can simply delete
-the extra DOS Primary partition (making sure it's the right one by
-examining its size! :)
-
-NOTE: FIPS does NOT currently work with FAT32 or VFAT style partitions
-as used by newer versions of Windows 95. To split up such a
-partition, you will need a commercial product such as Partition Magic
-3.0. Sorry, but this is just the breaks if you've got a Windows
-partition hogging your whole disk and you don't want to reinstall from
-scratch.
-
-2.2 Can I use compressed DOS filesystems from FreeBSD?
---- --------------------------------------------------
-
-No. If you are using a utility such as Stacker(tm) or
-DoubleSpace(tm), FreeBSD will only be able to use whatever portion of
-the filesystem you leave uncompressed. The rest of the filesystem
-will show up as one large file (the stacked/dblspaced file!). DO NOT
-REMOVE THAT FILE as you will probably regret it greatly!
-
-It is probably better to create another uncompressed DOS extended
-partition and use this for communications between DOS and FreeBSD if
-such is your desire.
-
-
-2.3 Can I mount my DOS extended partitions?
---- ---------------------------------------
-
-Yes. DOS extended partitions are mapped in at the end of the other
-``slices'' in FreeBSD, e.g. your D: drive might be /dev/sd0s5, your E:
-drive /dev/sd0s6, and so on. This example assumes, of course, that
-your extended partition is on SCSI drive 0. For IDE drives, substitute
-``wd'' for ``sd'' appropriately. You otherwise mount extended
-partitions exactly like you would mount any other DOS drive, e.g.:
-
-mount -t msdos /dev/sd0s5 /dos_d
-
-
-2.4 Can I run DOS binaries under FreeBSD?
---- -------------------------------------
-
-Ongoing work with BSDI's doscmd utility is bringing this much closer to
-being a reality in FreeBSD 3.0, though it still has some rough edges.
-If you're interested in working on this, please send mail to
-emulation@FreeBSD.org and indicate that you're interested in joining
-this ongoing effort!
-
-There is also a neat utility called "pcemu" in the ports collection
-which emulates an 8088 and enough BIOS services to run DOS text mode
-applications. It requires the X Window System (provided as XFree86
-3.2) to operate.
-
-
----- End of Installation Guide ---
diff --git a/release/texts/README.TXT b/release/texts/README.TXT
deleted file mode 100644
index 5167040e2556..000000000000
--- a/release/texts/README.TXT
+++ /dev/null
@@ -1,110 +0,0 @@
- -----------------------------------------
- FreeBSD 3.0 --- SNAPSHOT Version , ,
- ----------------------------------------- /( )`
- \ \___ / |
-This is a binary snapshot of 3.0-current, the /- _ `-/ '
-(HEAD) branch which is currently moving towards (/\/ \ \ /\
-the follow-on release to 3.0. / / | ` \
- O O ) / |
- `-^--'`< '
- (_.) _ ) /
- `.___/` /
- `-----' /
-Feedback or offers to help with anything <----. __ / __ \
-you see in this release are most welcome <----|====O)))==) \) /====
-and should be sent to one of the approp- <----' `--' `.__,' \
-riate mailing lists - please see the | |
-ABOUT.TXT file for more information. \ / /\
- ______( (_ / \______/
- ,' ,-----' |
- `--{__________)
-
-TARGET AUDIENCE:
-----------------
-This release is aimed primarily at early-adopters and the various
-other folks who want to get involved with the ongoing development
-of FreeBSD and are willing to deal with a few bumps in the road.
-We do our best to ensure that each snapshot works as advertised,
-but tracking -current is a process which frequently has its off
-days.
-
-If you're both technically proficient and know exactly what you're
-getting into here (e.g. you've been following -current) then this
-snapshot is probably for you. If you're more interested in doing
-business with FreeBSD than in playing with the cutting edge of
-technology, however, then 2.2.x is almost certainly your best bet.
-
-
-ROAD MAP:
- Most files here are also in the Documentation
- Menu of the boot floppy
-
- README.TXT This file
-
- ABOUT.TXT All about FreeBSD, including contact information
-
- RELNOTES.TXT Release Notes - what's new & different in this
- release
-
- LAYOUT.TXT Information about the layout of the release
- directory. If you are installing from floppies,
- it is especially important that you
- *read this section!*
-
- ERRATA.TXT Any late-breaking errata information for this
- release. On FTP sites, this file may be frequently
- updated so it's a good idea to check it first
- (the master copy is always on ftp.freebsd.org)
- before reporting problems
-
- HARDWARE.TXT Information about the configuration of the
- GENERIC kernel and supported hardware
-
- INSTALL.TXT How to make a new installation of FreeBSD
- on your PC using the data you see here
-
- UPGRADE.TXT How to upgrade an existing FreeBSD
- installation
-
- TROUBLE.TXT Troubleshooting information
-
-
-o For new installation instructions, see the INSTALL.TXT
- and HARDWARE.TXT files.
-
-o If you are upgrading from a previous FreeBSD version,
- please take a look at UPGRADE.TXT.
-
-o It is also important to check the ERRATA.TXT file for any
- late-breaking issues with this release. This file contains
- the latest information on upgrade, security or other problems
- which an administrator should be aware of.
-
-o Information regarding problems which arise after the CD
- is printed can be found at:
- ftp://ftp.freebsd.org/pub/FreeBSD/3.0-RELEASE/ERRATA.TXT
-
-For the most up-to-date software along the RELENG_2_2 branch
-(also known as -Stable) which is now proceeding onwards toward
-the release of FreeBSD 2.2.8, please install from:
-
- ftp://releng22.freebsd.org/pub/FreeBSD/
-
-Or for the latest 3.0-Current (HEAD branch) snapshot releases,
-please install from:
-
- ftp://current.freebsd.org/pub/FreeBSD
-
-If you plan to run either -Stable or -Current you MUST be
-subscribed to the appropriate mailing list, either
-freebsd-stable or freebsd-current. For information on
-subscribing to either list (or both), send an e-mail to
-majordomo@freebsd.org with the following in the body, not
-the subject of the letter as appropriate:
-
-subscribe freebsd-stable
-subscribe freebsd-current
-end
-
-We hope you enjoy using FreeBSD as much as we enjoyed
-creating it!
diff --git a/release/texts/RELNOTES.TXT b/release/texts/RELNOTES.TXT
deleted file mode 100644
index 68b1997657aa..000000000000
--- a/release/texts/RELNOTES.TXT
+++ /dev/null
@@ -1,574 +0,0 @@
- RELEASE NOTES
- FreeBSD Release 3.0-SNAP
-
-This is a 3.0-CURRENT release SNAPshot of FreeBSD, currently
-on its way to the next release after 3.0-RELEASE, which was
-released on October 16th, 1998.
-
-Any installation failures or crashes should be reported by using the
-send-pr command (those preferring a WEB based interface can also see
-http://www.freebsd.org/send-pr.html).
-
-For information about FreeBSD and the layout of the 3.0-RELEASE
-directory (especially if you're installing from floppies!), see
-ABOUT.TXT. For installation instructions, see the INSTALL.TXT and
-HARDWARE.TXT files.
-
-For the latest of these 3.0-current snapshots, you should always see:
-
- ftp://current.freebsd.org/pub/FreeBSD
-
-If you wish to get the latest post-3.0-RELEASE technology.
-
-Table of contents:
-------------------
-1. What's new since 3.0-RELEASE
- 1.1 KERNEL CHANGES
- 1.2 SECURITY FIXES
- 1.3 USERLAND CHANGES
-
-2. Supported Configurations
- 2.1 Disk Controllers
- 2.2 Ethernet cards
- 2.3 ATM
- 2.4 Misc
-
-3. Obtaining FreeBSD
- 3.1 FTP/Mail
- 3.2 CDROM
-
-4. Upgrading from previous releases of FreeBSD
-
-5. Reporting problems, making suggestions, submitting code
-6. Acknowledgements
-
-
-1. What's new since 3.0-RELEASE
----------------------------------
-All changes described here are unique to the 3.0 branch unless
-specifically marked as [MERGED] features.
-
-1.1. KERNEL CHANGES
--------------------
-
-Added driver support for fast ethernet adapters based on the
-RealTek 8129/8139 and Accton MPX 5030/5038 chips, including the
-SMC EZ Card 10/100 PCI 1211-TX.
-
-Added driver support for Lite-On PNIC-based fast ethernet cards
-including the LinkSys LNE100TX, NetGear FA310TX Rev. D1 and
-Matrox FastNIC 10/100.
-
-Added driver support for fast ethernet adapters based on the
-Macronix 98713, 98713A, 98715, 98715A and 98725 chips.
-
-Added driver support for fast ethernet adapters based on the
-Winbond W89C840F chip.
-
-Added driver support for fast ethernet adapters based on the
-VIA Technologies VT3043 "Rhine I" and VT86C100A "Rhine II" chips.
-
-Added driver support for pocket ethernet adapters based on the
-RealTek RTL 8002 chip.
-
-Added driver support for fast ethernet adapters based on the
-ASIX Electronics AX88140A chip.
-
-Integrated isdn4bsd from the isdn4bsd project group into the
-regular system.
-
-
-1.2. SECURITY FIXES
--------------------
-
-1.3. USERLAND CHANGES
----------------------
-
-When using ipfw(8) with the syntax of the first synopsis line from the
-man page (i. e., with a rules file), it can now optionally be run through
-a preprocessor (m4, cpp) so it's possible to use symbolic names and other
-constructs that make maintenance easier.
-
-
-2. Supported Configurations
----------------------------
-FreeBSD currently runs on a wide variety of ISA, VLB, EISA and PCI bus
-based PC's, ranging from 386sx to Pentium class machines (though the
-386sx is not recommended). Support for generic IDE or ESDI drive
-configurations, various SCSI controller, network and serial cards is
-also provided.
-
-What follows is a list of all peripherals currently known to work with
-FreeBSD. Other configurations may also work, we have simply not as yet
-received confirmation of this.
-
-
-2.1. Disk Controllers
----------------------
-WD1003 (any generic MFM/RLL)
-WD1007 (any generic IDE/ESDI)
-IDE
-ATA
-
-Adaptec 1535 ISA SCSI controllers
-Adaptec 154x series ISA SCSI controllers
-Adaptec 174x series EISA SCSI controller in standard and enhanced mode.
-Adaptec 274X/284X/2920C/294x/2950/3940/3950 (Narrow/Wide/Twin) series
-EISA/VLB/PCI SCSI controllers.
-Adaptec AIC7850, AIC7860, AIC7880, AIC789x, on-board SCSI controllers.
-
-AdvanSys SCSI controllers (all models).
-
-BusLogic MultiMaster controllers:
-
-[ Please note that BusLogic/Mylex "Flashpoint" adapters are NOT yet supported ]
-
-BusLogic MultiMaster "W" Series Host Adapters:
- BT-948, BT-958, BT-958D
-BusLogic MultiMaster "C" Series Host Adapters:
- BT-946C, BT-956C, BT-956CD, BT-445C, BT-747C, BT-757C, BT-757CD, BT-545C,
- BT-540CF
-BusLogic MultiMaster "S" Series Host Adapters:
- BT-445S, BT-747S, BT-747D, BT-757S, BT-757D, BT-545S, BT-542D, BT-742A,
- BT-542B
-BusLogic MultiMaster "A" Series Host Adapters:
- BT-742A, BT-542B
-
-AMI FastDisk controllers that are true BusLogic MultiMaster clones are also
-supported.
-
-DPT SmartCACHE Plus, SmartCACHE III, SmartRAID III, SmartCACHE IV and
-SmartRAID IV SCSI/RAID controllers are supported. The DPT SmartRAID/CACHE V
-is not yet supported.
-
-SymBios (formerly NCR) 53C810, 53C810a, 53C815, 53C820, 53C825a,
-53C860, 53C875, 53C875j, 53C885, 53C895 and 53C896 PCI SCSI controllers:
- ASUS SC-200
- Data Technology DTC3130 (all variants)
- NCR cards (all)
- Symbios cards (all)
- Tekram DC390W, 390U and 390F
- Tyan S1365
-
-
-QLogic 1020, 1040, 1040B and 2100 SCSI and Fibre Channel Adapters
-
-DTC 3290 EISA SCSI controller in 1542 emulation mode.
-
-With all supported SCSI controllers, full support is provided for
-SCSI-I & SCSI-II peripherals, including hard disks, optical disks,
-tape drives (including DAT and 8mm Exabyte), medium changers, processor
-target devices and CDROM drives. WORM devices that support CDROM commands
-are supported for read-only access by the CDROM driver. WORM/CD-R/CD-RW
-writing support is provided by cdrecord, which is in the ports tree.
-
-The following CD-ROM type systems are supported at this time:
-(cd) SCSI interface (also includes ProAudio Spectrum and
- SoundBlaster SCSI)
-(matcd) Matsushita/Panasonic (Creative SoundBlaster) proprietary
- interface (562/563 models)
-(scd) Sony proprietary interface (all models)
-(wcd) ATAPI IDE interface
-
-The following drivers were supported under the old SCSI subsystem, but are
-NOT YET supported under the new CAM SCSI subsystem:
-
- Tekram DC390 and DC390T controllers (maybe other cards based on the
- AMD 53c974 as well).
-
- NCR5380/NCR53400 ("ProAudio Spectrum") SCSI controller.
-
- UltraStor 14F, 24F and 34F SCSI controllers.
-
- Seagate ST01/02 SCSI controllers.
-
- Future Domain 8xx/950 series SCSI controllers.
-
- WD7000 SCSI controller.
-
- Adaptec 1510 series ISA SCSI controllers (not for bootable devices)
- Adaptec 152x series ISA SCSI controllers
- Adaptec AIC-6260 and AIC-6360 based boards, which includes the AHA-152x
- and SoundBlaster SCSI cards.
-
- [ Note: There is work-in-progress to port the AIC-6260/6360 and
- UltraStor drivers to the new CAM SCSI framework, but no estimates on
- when or if they will be completed. ]
-
-Unmaintained drivers, they might or might not work for your hardware:
-
- Floppy tape interface (Colorado/Mountain/Insight)
-
- (mcd) Mitsumi proprietary CD-ROM interface (all models)
-
-2.2. Ethernet cards
--------------------
-Allied-Telesis AT1700 and RE2000 cards
-
-AMD PCnet/PCI (79c970 & 53c974 or 79c974)
-
-SMC Elite 16 WD8013 ethernet interface, and most other WD8003E,
-WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and WD8013EBT
-based clones. SMC Elite Ultra. SMC Etherpower II.
-
-RealTek 8129/8139 fast ethernet NICs including the following:
- Allied Telesyn AT2550
- Allied Telesyn AT2500TX
- Genius GF100TXR (RTL8139)
- NDC Communications NE100TX-E
- OvisLink LEF-8129TX
- OvisLink LEF-8139TX
- Netronix Inc. EA-1210 NetEther 10/100
- KTX-9130TX 10/100 Fast Ethernet
- Accton "Cheetah" EN1027D (MPX 5030/5038; RealTek 8139 clone?)
- SMC EZ Card 10/100 PCI 1211-TX
-
-Lite-On 82c168/82c169 PNIC fast ethernet NICs including the following:
- LinkSys EtherFast LNE100TX
- NetGear FA310-TX Rev. D1
- Matrox FastNIC 10/100
-
-Macronix 98713, 98713A, 98715, 98715A and 98725 fast ethernet NICs
- NDC Communications SFA100A (98713A)
- CNet Pro120A (98713 or 98713A)
- CNet Pro120B (98715)
- SVEC PN102TX (98713)
-
-Winbond W89C840F fast ethernet NICs including the following:
- Trendware TE100-PCIE
-
-VIA Technologies VT3043 "Rhine I" and VT86C100A "Rhine II" fast ethernet
-NICs including the following:
- Hawking Technologies PN102TX
- D-Link DFE530TX
-
-Texas Instruments ThunderLAN PCI NICs, including the following:
- Compaq Netelligent 10, 10/100, 10/100 Proliant, 10/100 Dual-Port
- Compaq Netelligent 10/100 TX Embedded UTP, 10 T PCI UTP/Coax, 10/100 TX UTP
- Compaq NetFlex 3P, 3P Integrated, 3P w/ BNC
- Olicom OC-2135/2138, OC-2325, OC-2326 10/100 TX UTP
-
-ASIX Electronics AX88140A PCI NICs, including the following:
- Alfa Inc. GFC2204
- CNet Pro110B
-
-DEC EtherWORKS III NICs (DE203, DE204, and DE205)
-DEC EtherWORKS II NICs (DE200, DE201, DE202, and DE422)
-DEC DC21040, DC21041, or DC21140 based NICs (SMC Etherpower 8432T, DE245, etc)
-DEC FDDI (DEFPA/DEFEA) NICs
-
-Fujitsu MB86960A/MB86965A
-
-HP PC Lan+ cards (model numbers: 27247B and 27252A).
-
-Intel EtherExpress 16
-Intel EtherExpress Pro/10
-Intel EtherExpress Pro/100B PCI Fast Ethernet
-
-Isolan AT 4141-0 (16 bit)
-Isolink 4110 (8 bit)
-
-Novell NE1000, NE2000, and NE2100 ethernet interface.
-
-3Com 3C501 cards
-
-3Com 3C503 Etherlink II
-
-3Com 3c505 Etherlink/+
-
-3Com 3C507 Etherlink 16/TP
-
-3Com 3C509, 3C579, 3C589 (PCMCIA), 3C590/592/595/900/905/905B PCI and EISA
-(Fast) Etherlink III / (Fast) Etherlink XL
-
-3Com 3c980 Fast Etherlink XL server adapter
-
-Toshiba ethernet cards
-
-Crystal Semiconductor CS89x0-based NICs, including:
- IBM Etherjet ISA
-
-PCMCIA ethernet cards from IBM and National Semiconductor are also
-supported.
-
-Note that NO token ring cards are supported at this time as we're
-still waiting for someone to donate a driver for one of them. Any
-takers?
-
-2.3 ATM
--------
-
- o ATM Host Interfaces
- - FORE Systems, Inc. PCA-200E ATM PCI Adapters
- - Efficient Networks, Inc. ENI-155p ATM PCI Adapters
-
- o ATM Signalling Protocols
- - The ATM Forum UNI 3.1 signalling protocol
- - The ATM Forum UNI 3.0 signalling protocol
- - The ATM Forum ILMI address registration
- - FORE Systems's proprietary SPANS signalling protocol
- - Permanent Virtual Channels (PVCs)
-
- o IETF "Classical IP and ARP over ATM" model
- - RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
- - RFC 1577, "Classical IP and ARP over ATM"
- - RFC 1626, "Default IP MTU for use over ATM AAL5"
- - RFC 1755, "ATM Signaling Support for IP over ATM"
- - RFC 2225, "Classical IP and ARP over ATM"
- - RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
- - Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
- "A Distributed ATMARP Service Using SCSP"
-
- o ATM Sockets interface
-
-2.4. Misc
----------
-
-AST 4 port serial card using shared IRQ.
-
-ARNET 8 port serial card using shared IRQ.
-ARNET (now Digiboard) Sync 570/i high-speed serial.
-
-Boca BB1004 4-Port serial card (Modems NOT supported)
-Boca IOAT66 6-Port serial card (Modems supported)
-Boca BB1008 8-Port serial card (Modems NOT supported)
-Boca BB2016 16-Port serial card (Modems supported)
-
-Comtrol Rocketport card.
-
-Cyclades Cyclom-y Serial Board.
-
-STB 4 port card using shared IRQ.
-
-SDL Communications Riscom/8 Serial Board.
-SDL Communications RISCom/N2 and N2pci high-speed sync serial boards.
-
-Stallion multiport serial boards: EasyIO, EasyConnection 8/32 & 8/64,
-ONboard 4/16 and Brumby.
-
-Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound
-and Roland MPU-401 sound cards. (snd driver)
-
-Most ISA audio codecs manufactured by Crystal Semiconductors, OPTi, Creative
-Labs, Avance, Yamaha and ENSONIQ. (pcm driver)
-
-Connectix QuickCam
-Matrox Meteor Video frame grabber
-Creative Labs Video Spigot frame grabber
-Cortex1 frame grabber
-Hauppauge Wincast/TV boards (PCI)
-STB TV PCI
-Intel Smart Video Recorder III
-Various Frame grabbers based on Brooktree Bt848 chip.
-
-HP4020, HP6020, Philips CDD2000/CDD2660 and Plasmon CD-R drives.
-
-PS/2 mice
-
-Standard PC Joystick
-
-X-10 power controllers
-
-GPIB and Transputer drivers.
-
-Genius and Mustek hand scanners.
-
-Xilinx XC6200 based reconfigurable hardware cards compatible with
-the HOT1 from Virtual Computers (www.vcc.com)
-
-Support for Dave Mills experimental Loran-C receiver.
-
-FreeBSD currently does NOT support IBM's microchannel (MCA) bus.
-
-3. Obtaining FreeBSD
---------------------
-
-You may obtain FreeBSD in a variety of ways:
-
-3.1. FTP/Mail
--------------
-
-You can ftp FreeBSD and any or all of its optional packages from
-`ftp.freebsd.org' - the official FreeBSD release site.
-
-For other locations that mirror the FreeBSD software see the file
-MIRROR.SITES. Please ftp the distribution from the site closest (in
-networking terms) to you. Additional mirror sites are always welcome!
-Contact freebsd-admin@FreeBSD.org for more details if you'd like to
-become an official mirror site.
-
-If you do not have access to the Internet and electronic mail is your
-only recourse, then you may still fetch the files by sending mail to
-`ftpmail@ftpmail.vix.com' - putting the keyword "help" in your message
-to get more information on how to fetch files using this mechanism.
-Please do note, however, that this will end up sending many *tens of
-megabytes* through the mail and should only be employed as an absolute
-LAST resort!
-
-
-3.2. CDROM
-----------
-
-FreeBSD 3.0-RELEASE and 2.2.x-RELEASE CDs may be ordered on CDROM from:
-
- Walnut Creek CDROM
- 4041 Pike Lane, Suite D
- Concord CA 94520
- 1-800-786-9907, +1-925-674-0783, +1-925-674-0821 (FAX)
-
-Or via the Internet from orders@cdrom.com or http://www.cdrom.com.
-Their current catalog can be obtained via ftp from:
-
- ftp://ftp.cdrom.com/cdrom/catalog
-
-Cost per -RELEASE CD is $39.95 or $24.95 with a FreeBSD subscription.
-FreeBSD SNAPshot CDs, when available, are $39.95 or $14.95 with a
-FreeBSD-SNAP subscription (-RELEASE and -SNAP subscriptions are entirely
-separate). With a subscription, you will automatically receive updates as
-they are released. Your credit card will be billed when each disk is
-shipped and you may cancel your subscription at any time without further
-obligation.
-
-Shipping (per order not per disc) is $5 in the US, Canada or Mexico
-and $9.00 overseas. They accept Visa, Mastercard, Discover, American
-Express or checks in U.S. Dollars and ship COD within the United
-States. California residents please add 8.25% sales tax.
-
-Should you be dissatisfied for any reason, the CD comes with an
-unconditional return policy.
-
-
-4. Upgrading from previous releases of FreeBSD
-----------------------------------------------
-
-If you're upgrading from a previous release of FreeBSD, most likely
-it's 2.2.x or 2.1.x (in some lesser number of cases) and some of the
-following issues may affect you, depending of course on your chosen
-method of upgrading. There are two popular ways of upgrading
-FreeBSD distributions:
-
- o Using sources, via /usr/src
- o Using sysinstall's (binary) upgrade option.
-
-In the case of using sources, there are simply two targets you need to
-be aware of: The standard ``world'' target, which will upgrade a 2.x
-system to 3.0, or the ``aout-to-elf'' target, which will both upgrade
-and convert the system to ELF binary format.
-In the case of using the binary upgrade option, the system will go
-straight to 3.0/ELF but also populate the /<basepath>/lib/aout
-directories for backwards compatibility with older binaries.
-
-In either case, going to ELF will mean that you'll have somewhat
-smaller binaries and access to a lot more compiler goodies which have
-been already been ported to other ELF environments (our older and
-somewhat crufty a.out format being largely unsupported by most other
-software projects), but on the downside you'll also have access to far
-fewer ports and packages since many of those have not been adapted to
-ELF yet. This will occur in time, but those who wish to retain access
-to the greatest number of packages and 3rd-party binaries should
-probably stick with a.out.
-
-The kernel is also still in a.out format at this time so that older
-LKMs and library interfaces can continue to work, but a full
-transition to ELF will occur at some point after 3.0-RELEASE. Those
-wishing to generate dynamic kernel components should therefore use the
-newer KLD mechanism rather than the older LKM format - the LKM format
-is not long for this world and will soon be unsupported!
-
-[ other important upgrading notes should go here]
-
-
-5. Reporting problems, making suggestions, submitting code.
------------------------------------------------------------
-Your suggestions, bug reports and contributions of code are always
-valued - please do not hesitate to report any problems you may find
-(preferably with a fix attached, if you can!).
-
-The preferred method to submit bug reports from a machine with
-Internet mail connectivity is to use the send-pr command or use the CGI
-script at http://www.freebsd.org/send-pr.html. Bug reports
-will be dutifully filed by our faithful bugfiler program and you can
-be sure that we'll do our best to respond to all reported bugs as soon
-as possible. Bugs filed in this way are also visible on our WEB site
-in the support section and are therefore valuable both as bug reports
-and as "signposts" for other users concerning potential problems to
-watch out for.
-
-If, for some reason, you are unable to use the send-pr command to
-submit a bug report, you can try to send it to:
-
- freebsd-bugs@FreeBSD.org
-
-Note that send-pr itself is a shell script that should be easy to move
-even onto a totally different system. We much prefer if you could use
-this interface, since it make it easier to keep track of the problem
-reports. However, before submitting, please try to make sure whether
-the problem might have already been fixed since.
-
-
-Otherwise, for any questions or tech support issues, please send mail to:
-
- freebsd-questions@FreeBSD.org
-
-
-Additionally, being a volunteer effort, we are always happy to have
-extra hands willing to help - there are already far more desired
-enhancements than we'll ever be able to manage by ourselves! To
-contact us on technical matters, or with offers of help, please send
-mail to:
-
- freebsd-hackers@FreeBSD.org
-
-
-Please note that these mailing lists can experience *significant*
-amounts of traffic and if you have slow or expensive mail access and
-are only interested in keeping up with significant FreeBSD events, you
-may find it preferable to subscribe instead to:
-
- freebsd-announce@FreeBSD.org
-
-
-All of the mailing lists can be freely joined by anyone wishing
-to do so. Send mail to MajorDomo@FreeBSD.org and include the keyword
-`help' on a line by itself somewhere in the body of the message. This
-will give you more information on joining the various lists, accessing
-archives, etc. There are a number of mailing lists targeted at
-special interest groups not mentioned here, so send mail to majordomo
-and ask about them!
-
-
-6. Acknowledgements
--------------------
-
-FreeBSD represents the cumulative work of many dozens, if not
-hundreds, of individuals from around the world who have worked very
-hard to bring you this release. For a complete list of FreeBSD
-project staffers, please see:
-
- http://www.freebsd.org/handbook/staff.html
-
-or, if you've loaded the doc distribution:
-
- file:/usr/share/doc/handbook/staff.html
-
-
-Special mention to:
-
- The donors listed at http://www.freebsd.org/handbook/donors.html
-
- Justin M. Seger <jseger@freebsd.org> for almost single-handedly
- converting the ports collection to ELF.
-
- Doug Rabson <dfr@freebsd.org> and John Birrell <jb@freebsd.org>
- for making FreeBSD/alpha happen and to the NetBSD project for
- substantial indirect aid.
-
- Peter Wemm <peter@freebsd.org> for the new kernel module system
- (with substantial aid from Doug Rabson).
-
- And to the many thousands of FreeBSD users and testers all over the
- world, without whom this release simply would not have been possible.
-
-We sincerely hope you enjoy this release of FreeBSD!
-
- The FreeBSD Project
diff --git a/release/texts/TROUBLE.TXT b/release/texts/TROUBLE.TXT
deleted file mode 100644
index 45a40bd019c7..000000000000
--- a/release/texts/TROUBLE.TXT
+++ /dev/null
@@ -1,374 +0,0 @@
-===============
-Troubleshooting
-===============
-
- Table of Contents:
-
- Repairing an Existing FreeBSD Installation
-
- Common Installation Problems, Q&A
-
- Common Hardware Problems, Q&A
-
-Repairing an Existing FreeBSD Installation
-------------------------------------------
-
-FreeBSD releases 2.2.1 and later feature a "Fixit" option in the top
-menu of the boot floppy. To use it, you will also need either a
-fixit.flp image floppy, generated in the same fashion as the boot
-floppy, or the 2nd CDROM from Walnut Creek CDROM's FreeBSD
-distribution.
-
-To invoke fixit, simply boot the boot floppy, chose the "Fixit" item
-and insert the fixit floppy or CDROM when asked. You will then be
-placed into a shell with a wide variety of commands available (in the
-/stand and /mnt2/stand directories) for checking, repairing and
-examining file systems and their contents. Some UNIX administration
-experience *is* required to use the fixit option!
-
-Common Installation Problems, Q&A
----------------------------------
-
-Q: I go to boot from the hard disk for the first time after installing
- FreeBSD, the kernel loads and probes my hardware, but stops with
- messages like:
-
- changing root device to wd1s1a
- panic: cannot mount root
-
- What is wrong? What can I do?
-
-Q: What is this 'bios_drive:interface(unit,partition)kernel_name' thing
- that is displayed with the boot help?
-
-A: There is a longstanding problem in the case where the boot disk is
- not the first disk in the system. The BIOS uses a different numbering
- scheme to FreeBSD, and working out which numbers correspond to which
- is difficult to get right.
-
- In the case where the boot disk is not the first disk in the system,
- FreeBSD can need some help finding it. There are two common situations
- here, and in both of these cases, you need to tell FreeBSD where the
- root filesystem is. You do this by specifying the BIOS disk number,
- the disk type and the FreeBSD disk number for that type.
-
- The first situation is where you have two IDE disks, each configured as
- the master on their respective IDE busses, and wish to boot FreeBSD from
- the second disk. The BIOS sees these as disk 0 and disk 1, while
- FreeBSD sees them as wd0 and wd2.
-
- FreeBSD is on BIOS disk 1, of type 'wd' and the FreeBSD disk number
- is 2, so you would say:
-
- 1:wd(2,a)kernel
-
- Note that if you have a slave on the primary bus, the above is not
- necessary (and is effectively wrong).
-
- The second situation involves booting from a SCSI disk when you have
- one or more IDE disks in the system. In this case, the FreeBSD disk
- number is lower than the BIOS disk number. If you have two IDE disks
- as well as the SCSI disk, the SCSI disk is BIOS disk 2, type 'da' and
- FreeBSD disk number 0, so you would say:
-
- 2:da(0,a)kernel
-
- To tell FreeBSD that you want to boot from BIOS disk 2, which is
- the first SCSI disk in the system. If you only had one IDE disk,
- you would use '1:' instead.
-
- Once you have determined the correct values to use, you can put the
- command exactly as you would have typed it in the /boot.config file
- using a standard text editor.
- Unless instructed otherwise, FreeBSD will use the contents of this
- file as the default response to the 'boot:' prompt.
-
-Q: I go to boot from the hard disk for the first time after installing
- FreeBSD, but the Boot Manager prompt just prints `F?' at the boot menu
- each time but the boot won't go any further.
-
-A: The hard disk geometry was set incorrectly in the Partition editor when
- you installed FreeBSD. Go back into the partition editor and specify
- the actual geometry of your hard disk. You must reinstall FreeBSD
- again from the beginning with the correct geometry.
-
- If you are failing entirely in figuring out the correct geometry for
- your machine, here's a tip: Install a small DOS partition at the
- beginning of the disk and install FreeBSD after that. The install
- program will see the DOS partition and try to infer the correct
- geometry from it, which usually works.
-
- The following tip is no longer recommended, but is left here
- for reference:
-
- If you are setting up a truly dedicated FreeBSD server or work-
- station where you don't care for (future) compatibility with DOS,
- Linux or another operating system, you've also got the option to use
- the entire disk (`A' in the partition editor), selecting the
- non-standard option where FreeBSD occupies the entire disk from
- the very first to the very last sector. This will leave all geometry
- considerations aside, but is somewhat limiting unless you're never
- going to run anything other than FreeBSD on a disk.
-
-
-Known Hardware Problems, Q & A
-------------------------------
-
-Q: mcd0 keeps thinking that it has found a device and this stops my Intel
- EtherExpress card from working.
-
-A: Use the UserConfig utility (see HARDWARE.TXT) and disable the probing of
- the mcd0 and mcd1 devices. Generally speaking, you should only leave
- the devices that you will be using enabled in your kernel.
-
-
-Q: FreeBSD claims to support the 3Com PCMCIA card, but my card isn't
- recognized when it's plugged into my laptop.
-
-A: There are a couple of possible problems. First of all, FreeBSD does
- not support multi-function cards, so if you have a combo
- ethernet/modem card (such as the 3C562), it won't work. The
- default driver for the 3C589 card was written just like all of the
- other drivers in FreeBSD, and depend on the card's own configuration
- data stored in NVRAM to work. You must correctly configure FreeBSD's
- driver to match the IRQ, port, and IOMEM stored in NVRAM.
- Unfortunately, the only program capable of reading them is the
- 3COM supplied DOS program. This program must be run on a absolutely
- clean system (no other drivers must be running), and the program will
- whine about CARD-Services not being found, but it will continue.
- This is necessary to read the NVRAM values. You want to know the
- IRQ, port, and IOMEM values (the latter is called the CIS tuple by
- 3COM). The first two can be set in the program, the third is
- un-settable, and can only be read. Once you have these values, set
- them in UserConfig and your card will be recognized.
-
-
-Q: FreeBSD finds my PCMCIA network card, but no packets appear to
- be sent even though it claims to be working.
-
-A: Many PCMCIA cards have the ability to use either the 10-Base2 (BNC)
- or 10-BaseT connectors for connecting to the network. The driver is
- unable to 'auto-select' the correct connector, so you must tell it
- which connector to use. In order to switch between the two
- connectors, the link flags must be set. Depending on the model of
- the card, '-link0 link1' or 'link0 -link1' will choose the correct
- network connector. You can set these in sysinstall by using the
- 'Extra options to ifconfig:' field in the network setup screen.
-
-
-Q: The system finds my ed network card, but I keep getting device
- timeout errors.
-
-A: Your card is probably on a different IRQ from what is specified in the
- kernel configuration. The ed driver does not use the `soft' configuration
- by default (values entered using EZSETUP in DOS), but it will use the
- software configuration if you specify `?' in the IRQ field of your kernel
- config file.
-
- Either move the jumper on the card to a hard configuration setting
- (altering the kernel settings if necessary), or specify the IRQ as
- `-1' in UserConfig or `?' in your kernel config file. This will
- tell the kernel to use the soft configuration.
-
- Another possibility is that your card is at IRQ 9, which is shared
- by IRQ 2 and frequently a cause of problems (especially when you
- have a VGA card using IRQ 2! :). You should not use IRQ 2 or 9 if at
- all possible.
-
-
-Q: I have a Matsushita/Panasonic drive but it isn't recognized by the
- system.
-
-A: Make certain that the I/O port that the matcd driver is set to is
- correct for the host interface card you have. (Some SoundBlaster DOS
- drivers report a hardware I/O port address for the CD-ROM interface
- that is 0x10 lower than it really is.)
-
- If you are unable to determine the settings for the card by examining
- the board or documentation, you can use UserConfig to change the 'port'
- address (I/O port) to -1 and start the system. This setting causes the
- driver to look at a number of I/O ports that various manufacturers
- use for their Matsushita/Panasonic/Creative CD-ROM interfaces.
- Once the driver locates the address, you should run UserConfig again
- and specify the correct address. Leaving the 'port' parameter set to -1
- increases the amount of time that it takes the system to boot, and
- this could interfere with other devices.
-
- The double-speed Matsushita CR-562 and CR-563 are the only drives
- that are supported.
-
-
-Q: I booted the install floppy on my IBM ThinkPad (tm) laptop, and the
- keyboard is all messed up.
-
-A: Older IBM laptops use a non-standard keyboard controller, so you must
- tell the console driver (sc0) to go into a special mode which works
- on the ThinkPads. Change the sc0 'Flags' to 0x10 in UserConfig and
- it should work fine. (Look in the Input Menu for 'Syscons Console
- Driver'.)
-
-
-Q: I have a Matsushita/Panasonic CR-522, a Matsushita/Panasonic CR-523 or
- a TEAC CD55a drive, but it is not recognized even when the correct I/O
- port is set.
-
-A: These CD-ROM drives are currently not supported by FreeBSD. The command
- sets for these drives are not compatible with the double-speed CR-562
- and CR-563 drives.
-
- The single-speed CR-522 and CR-523 drives can be identified by their
- use of a CD-caddy.
-
-
-Q: I'm trying to install from a tape drive but all I get is something like:
- sa0(aha0:1:0) NOT READY csi 40,0,0,0
- on the screen. Help!
-
-A: There's a limitation in the current sysinstall that the tape MUST
- be in the drive while sysinstall is started or it won't be detected.
- Try again with the tape in the drive the whole time.
-
-
-Q: I've installed FreeBSD onto my system, but it hangs when booting from
- the hard drive with the message: ``Changing root to /dev/da0a''.
-
-A: This problem may occur in a system with a 3com 3c509 Ethernet adaptor.
- The ep0 device driver appears to be sensitive to probes for other
- devices that also use address 0x300. Boot your FreeBSD system by power
- cycling the machine (turn off and on). At the ``Boot:'' prompt specify
- the ``-c''. This will invoke UserConfig (see Section 1. above). Use
- the ``disable'' command to disable the device probes for all devices
- at address 0x300 except the ep0 driver. On exit, your machine should
- successfully boot FreeBSD.
-
-
-Q: My system hangs during boot, right after the "fd0: [my floppy drive]"
- line.
-
-A: This is not actually a hang, simply a very LONG "wdc0" probe that
- often takes a long time to complete on certain systems (where there
- usually _isn't_ a WD controller). Be patient, your system will boot!
- To eliminate the problem, boot with the -c flag and eliminate the wdc0
- device, or compile a custom kernel.
-
-
-Q: My system can not find my Intel EtherExpress 16 card.
-
-A: You must set your Intel EtherExpress 16 card to be memory mapped at
- address 0xD0000, and set the amount of mapped memory to 32K using
- the Intel supplied softset.exe program.
-
-
-Q: When installing on an EISA HP Netserver, my on-board AIC-7xxx
- SCSI controller isn't detected.
-
-A: This is a known problem, and will hopefully be fixed in the future.
- In order to get your system installed at all, boot with the -c
- option into UserConfig, but _don't_ use the pretty visual mode but
- the plain old CLI mode. Type
-
- eisa 12
- quit
-
- there at the prompt. (Instead of `quit', you might also type
- `visual', and continue the rest of the configuration session in
- visual mode.) While it's recommended to compile a custom kernel,
- dset(8) now also understands to save this value.
-
- Refer to the FAQ topic 3.16 for an explanation of the problem, and
- for how to continue. Remember that you can find the FAQ on your
- local system in /usr/share/doc/FAQ, provided you have installed the
- `doc' distribution.
-
-
-Q: I have a Panasonic AL-N1 or Rios Chandler Pentium machine and I find
- that the system hangs before ever getting into the installation
- now.
-
-A: Your machine doesn't like the new i586_copyout and i586_copyin code
- for some reason. To disable this, boot the installation boot floppy
- and when it comes to the very first menu (the choice to drop into
- kernel UserConfig mode or not) choose the command-line interface
- ("expert mode") version and type the following at it:
-
- flags npx0 1
-
- Then proceed normally to boot. This will be saved into your kernel,
- so you only need to do it once.
-
-
-Q: I have this CMD640 IDE controller that is said to be broken.
-
-A: Yes, it is. There's a workaround available now and it is enabled
- automatically if this chip is used on your system.
- For the details refer to the manual page of the disk driver (man 4 wd).
-
-
-Q: On a Compaq Aero notebook, I get the message "No floppy devices found!
- Please check ..." when trying to install from floppy.
-
-A: With Compaq being always a little different from other systems, they
- do not announce their floppy drive in the CMOS RAM of an Aero notebook.
- Therefore, the floppy disk driver assumes there is no drive configured.
- Go to the UserConfig screen, and set the Flags value of the fdc0 device
- to 0x1. This pretends the existence of the first floppy drive (as a
- 1.44 MB drive) to the driver without asking the CMOS at all.
-
-
-Q: When I go to boot my Intel AL440LX ("Atlanta") -based system from the
- hard disk the first time, it stops with a "Read Error" message.
-
-A: There appears to be a bug in the BIOS on at least some of these boards,
- this bug results in the FreeBSD bootloader thinking that it is booting
- from a floppy disk.
- This is only a problem if you are not using the BootEasy boot manager.
- Slice the disk in 'compatible' mode and install BootEasy during the
- FreeBSD installation to avoid the bug, or upgrade the BIOS (see Intel's
- website for details).
-
-Q: When installing on an Dell Poweredge XE, Dell proprietary RAID controller
- DSA (Dell SCSI Array) isn't recognized.
-
-A: Configure DSA to use AHA-1540 emulation using EISA configuration utility.
- After that FreeBSD detects DSA as Adaptec AHA-1540 SCSI controller, with
- irq 11 and port 340. Under emulation mode system will use DSA RAID disks,
- but you cannot use DSA specific features such as watching RAID health.
-
-
-Q: My Ethernet adapter is detected as an AMD PCnet-FAST (or similar) but
- it doesn't work. (Eg. onboard Ethernet on IBM Netfinity 5xxx or 7xxx)
-
-A: The 'lnc' driver is currently faulty, and will often not work correctly
- with the PCnet-FAST and PCnet-FAST+. You need to install a different
- Ethernet adapter.
-
-
-Q: I have an IBM EtherJet PCI card, it is detected by the 'fxp' driver
- correctly, but the lights on the card don't come on and it doesn't
- connect to the network.
-
-A: We don't understand why this happens. Neither do IBM (we asked them).
- The card is a standard Intel EtherExpress Pro/100 with an IBM label
- on it, and these cards normally work just fine. You may see these
- symptoms only in some IBM Netfinity servers. The only solution is to
- install a different Ethernet adapter.
-
-
-Q: When I configure the network during installation on an IBM Netfinity
- 3500, the system freezes.
-
-A: There is a problem with the onboard Ethernet in the Netfinity 3500
- which we have not been able to identify at this time. It may be
- related to the SMP features of the system being misconfigured. You
- will have to install another Ethernet adapter, and avoid attempting
- to configure the onboard adapter at any time.
-
-
-Q: Why does my TEAC CD-220E (rev 1.0D) IDE CD-ROM lock up the system when
- I use it?
-
-A: There are apparently firmware problems with this drive and,
- though a fix may soon be forthcoming, it should probably be avoided
- for now.
-
-[ Please send hardware tips for this Q&A section to jkh@freebsd.org ]
diff --git a/sbin/Makefile b/sbin/Makefile
index 63337224be0a..aa64712aafd5 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -1,16 +1,16 @@
# @(#)Makefile 8.5 (Berkeley) 3/31/94
-# $Id: Makefile,v 1.61 1998/12/28 11:06:21 sos Exp $
+# $Id: Makefile,v 1.56 1998/09/15 11:44:41 phk Exp $
# XXX MISSING: icheck ncheck
-SUBDIR= adjkerntz \
- atm \
+SUBDIR= atm \
badsect \
camcontrol \
ccdconfig \
clri \
disklabel \
dmesg \
+ dset \
dump \
dumpfs \
dumpon \
@@ -54,8 +54,8 @@ SUBDIR= adjkerntz \
savecore \
shutdown \
slattach \
- spppcontrol \
startslip \
+ spppcontrol \
swapon \
tunefs \
umount \
@@ -65,4 +65,8 @@ SUBDIR= adjkerntz \
SUBDIR+= ${MACHINE_ARCH}
.endif
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR+=adjkerntz
+.endif
+
.include <bsd.subdir.mk>
diff --git a/sbin/atm/atm/atm.8 b/sbin/atm/atm/atm.8
index 9dc923178fb8..51b39f9a5f01 100644
--- a/sbin/atm/atm/atm.8
+++ b/sbin/atm/atm/atm.8
@@ -22,7 +22,7 @@
.\" Copies of this Software may be made, however, the above copyright
.\" notice must be reproduced on all copies.
.\"
-.\" @(#) $Id: atm.8,v 1.1 1998/09/15 08:22:45 phk Exp $
+.\" @(#) $Id: atm.1,v 1.4 1998/08/26 21:38:28 johnc Exp $
.\"
.\"
.de EX \"Begin example
@@ -178,22 +178,19 @@ Two types of interfaces are supported:
physical interfaces and network interfaces.
A physical interface represents a physical point of attachment to an
ATM network.
-A physical interface has an ATM address associated with it, except
-when the PVC-only signalling manager is being used.
+A physical interface has an ATM address associated with it.
.PP
A network interface is a logical interface.
One or more network interfaces are associated with a physical
interface; each network interface has an IP address associated with it.
+For interfaces controlled by the SPANS or PVC signalling managers,
+there must be one and
+only one network interface associated with each physical interface.
For UNI-controlled interfaces, there can be up to 256 network
interfaces associated with a physical interface.
In this case, the correspondence between the network interface and
the ATM address is determined by the selector field (the last
byte) of the physical interface's ATM address.
-For PVC-only interfaces, there can be up to 256 logical interfaces
-associated with each physical interface.
-For interfaces controlled by the SPANS signalling manager,
-there must be one and
-only one network interface associated with each physical interface.
.SS "Keyword and Documentation Conventions"
Command and subcommand keywords can be abbreviated by simply giving
enough of the first part of the keyword to make it unique.
diff --git a/sbin/atm/atm/atm.h b/sbin/atm/atm/atm.h
index f903bd781bab..efb8d1eaa069 100644
--- a/sbin/atm/atm/atm.h
+++ b/sbin/atm/atm/atm.h
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm.h,v 1.1 1998/09/15 08:22:45 phk Exp $
+ * @(#) $Id: atm.h,v 1.9 1998/07/09 21:23:53 johnc Exp $
*
*/
@@ -35,7 +35,7 @@
*
*/
-#define MAX_NIFS 256 /* Max network interfaces */
+#define MAX_NIFS 32 /* Max network interfaces */
#define MIN_VCI 32 /* Smallest non-reserved VCI */
#ifndef TRUE
diff --git a/sbin/atm/fore_dnld/fore_dnld.c b/sbin/atm/fore_dnld/fore_dnld.c
index d0e965e96e47..6ecafa5d49b9 100644
--- a/sbin/atm/fore_dnld/fore_dnld.c
+++ b/sbin/atm/fore_dnld/fore_dnld.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_dnld.c,v 1.1 1998/09/15 08:22:47 phk Exp $
+ * @(#) $Id: fore_dnld.c,v 1.15 1998/08/26 23:29:32 mks Exp $
*
*/
@@ -37,7 +37,7 @@
*/
#ifndef lint
-static char *RCSid = "@(#) $Id: fore_dnld.c,v 1.1 1998/09/15 08:22:47 phk Exp $";
+static char *RCSid = "@(#) $Id: fore_dnld.c,v 1.15 1998/08/26 23:29:32 mks Exp $";
#endif
#include <sys/types.h>
@@ -407,7 +407,7 @@ unsigned short crctab[1<<B] = {
* -1 unable to send file
*/
int
-xmitfile ( filename )
+sendfile ( filename )
char *filename;
{
int fd;
@@ -1202,7 +1202,7 @@ char *argv[];
sndfile = objfile;
if ( ext && !binary )
- err = xmitfile ( sndfile );
+ err = sendfile ( sndfile );
else
err = sendbinfile ( sndfile, ram );
diff --git a/sbin/atm/ilmid/ilmid.c b/sbin/atm/ilmid/ilmid.c
index 9da24241f726..e515a1088f99 100644
--- a/sbin/atm/ilmid/ilmid.c
+++ b/sbin/atm/ilmid/ilmid.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ilmid.c,v 1.1 1998/09/15 08:22:47 phk Exp $
+ * @(#) $Id: ilmid.c,v 1.9 1998/08/13 20:15:28 jpt Exp $
*
*/
@@ -45,24 +45,40 @@
*
*/
-#include <sys/param.h>
-
#ifndef lint
-__RCSID("@(#) $Id: ilmid.c,v 1.1 1998/09/15 08:22:47 phk Exp $");
+static char *RCSid = "@(#) $Id: ilmid.c,v 1.9 1998/08/13 20:15:28 jpt Exp $";
#endif
+#include <sys/types.h>
+#include <sys/param.h>
+
+#if (defined(BSD) && (BSD >= 199103))
#include <err.h>
-#include <errno.h>
+#endif
+
+#ifdef BSD
+#if __FreeBSD_version < 300001
+#include <stdlib.h>
+#ifdef sun
+#include <unistd.h>
+#endif /* sun */
+#else
+#include <unistd.h>
+#endif /* __FreeBSD_version >= 300001 */
+#endif /* BSD */
+
#include <stdio.h>
#include <stdlib.h>
+#include <time.h>
+#include <sys/errno.h>
#include <string.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
#include <syslog.h>
-#include <time.h>
-#include <unistd.h>
#include <sys/socket.h>
-#include <sys/sockio.h>
#include <net/if.h>
#include <netinet/in.h>
+
#include <netatm/port.h>
#include <netatm/atm.h>
#include <netatm/atm_if.h>
@@ -70,30 +86,36 @@ __RCSID("@(#) $Id: ilmid.c,v 1.1 1998/09/15 08:22:47 phk Exp $");
#include <netatm/atm_sap.h>
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+
#include <dev/hea/eni_stats.h>
#include <dev/hfa/fore_aali.h>
#include <dev/hfa/fore_slave.h>
#include <dev/hfa/fore_stats.h>
-
-#include <libatm.h>
+#include <netatm/uni/unisig_var.h>
#define MAX_LEN 9180
#define MAX_UNITS 8
/*
+ * Time to sleep between loops
+ */
+#define SLEEP_TIME 10
+/*
+ * Time to pass between sending coldStart TRAPs
+ */
+#define TRAP_TIME 5
+
+/*
* Define some ASN types
*/
#define ASN_INTEGER 0x02
#define ASN_OCTET 0x04
-#define ASN_NULL 0x05
#define ASN_OBJID 0x06
#define ASN_SEQUENCE 0x30
#define ASN_IPADDR 0x40
#define ASN_TIMESTAMP 0x43
-static char *Var_Types[] = { "", "", "ASN_INTEGER", "", "ASN_OCTET", "ASN_NULL", "ASN_OBJID" };
-
/*
* Define SNMP PDU types
*/
@@ -103,167 +125,360 @@ static char *Var_Types[] = { "", "", "ASN_INTEGER", "", "ASN_OCTET", "ASN_NULL",
#define PDU_TYPE_SET 0xA3
#define PDU_TYPE_TRAP 0xA4
-static char *PDU_Types[] = { "GET REQUEST", "GETNEXT REQUEST", "GET RESPONSE", "SET REQUEST",
- "TRAP" };
-
/*
- * Define TRAP codes
+ * Every SNMP PDU has the first four fields of this header. The only type
+ * which doesn't have the last three fields is the TRAP type.
*/
-#define TRAP_COLDSTART 0
-#define TRAP_WARMSTART 1
-#define TRAP_LINKDOWN 2
-#define TRAP_LINKUP 3
-#define TRAP_AUTHFAIL 4
-#define TRAP_EGPLOSS 5
-#define TRAP_ENTERPRISE 6
+struct snmp_header {
+ int pdulen;
+ int version;
+ char community[64];
+ int pdutype;
+ int reqid;
+ int error;
+ int erridx;
+};
+typedef struct snmp_header Snmp_Header;
/*
- * Define SNMP Version numbers
+ * Define our internal representation of an OBJECT IDENTIFIER
*/
-#define SNMP_VERSION_1 1
-#define SNMP_VERSION_2 2
+struct objid {
+ int oid[128];
+};
+typedef struct objid Objid;
/*
- * Max string length for Variable
+ * Define some OBJET IDENTIFIERS that we'll try to reply to:
+ *
+ * sysUpTime: number of time ticks since this deamon came up
+ * netpfx_oid: network prefix table
+ * unitype: is this a PRIVATE or PUBLIC network link
+ * univer: which version of UNI are we running
+ * devtype: is this a USER or NODE ATM device
+ * setprefix: used when the switch wants to tell us its NSAP prefix
+ * foresiggrp: FORE specific Objid we see alot of (being connected to FORE
+ * switches...)
*/
-#define STRLEN 128
-
+Objid sysObjId = { 8, 43, 6, 1, 2, 1, 1, 2, 0 };
+Objid sysUpTime = { 8, 43, 6, 1, 2, 1, 1, 3, 0 };
+Objid foresiggrp = { 18, 43, 6, 1, 4, 1, 326, 2, 2, 2, 1, 6, 2, 1, 1, 1, 20, 0, 0 };
+Objid portidx = { 12, 43, 6, 1, 4, 1, 353, 2, 1, 1, 1, 1, 0 };
+Objid myipnm = { 10, 43, 6, 1, 4, 1, 353, 2, 1, 2, 0 };
+Objid layeridx = { 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 1, 0 };
+Objid maxvcc = { 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 3, 0 };
+Objid unitype = { 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 8, 0 };
+Objid univer = { 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 9, 0 };
+Objid devtype = { 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 10, 0 };
+Objid netpfx_oid = { 9, 43, 6, 1, 4, 1, 353, 2, 7, 1 };
+Objid setprefix = { 12, 43, 6, 1, 4, 1, 353, 2, 7, 1, 1, 3, 0 };
/*
- * Unknown variable
+ * (Partialy) pre-encoded SNMP responses
*/
-#define VAR_UNKNOWN -1
/*
- * Define our internal representation of an OBJECT IDENTIFIER
+ * sysObjId reply
*/
-struct objid {
- int oid[128];
+u_char sysObjId_Resp[] = {
+ 54, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x32, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* GET Response */
+ 0x27, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* <--- request id */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x17, /* <--- len */
+ 0x82, 0x00, 0x14, /* <--- len */
+ 0x06, 0x08, /* Objid: 1.3.6.1.4.1.1.2.0 */
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x01, 0x02, 0x00,
+ 0x06, 0x08, /* Objid: 1.3.6.1.4.1.9999.1 */
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0xce, 0x0f, 0x01
};
-typedef struct objid Objid;
/*
- * Define a Veriable classso that we can handle multiple GET/SET's
- * per PDU.
+ * sysUpTime: reply to a sysUpTime GET request
*/
-typedef struct variable Variable;
-struct variable {
- Objid oid;
- int type;
- union {
- int ival; /* INTEGER/TIMESTAMP */
- Objid oval; /* OBJID */
- long aval; /* IPADDR */
- char sval[STRLEN]; /* OCTET */
- } var;
- Variable *next;
+u_char sysUpTime_Resp[] = {
+ 45, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x29, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community - ILMI */
+ PDU_TYPE_GETRESP, /* GET Response */
+ 0x1e, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* <--- request id */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x0E, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x0A, /* <--- len */
+ /* Objid: .1.3.6.1.2.1.1.3.0 */
+ 0x06, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00,
+ /* <--- uptime */
};
/*
- * Every SNMP PDU has the first four fields of this header. The only type
- * which doesn't have the last three fields is the TRAP type.
+ * coldStart TRAP to start the ILMI protocol
*/
-struct snmp_header {
- int pdulen;
- int version;
- char community[64];
- int pdutype;
+u_char coldStart_Trap[] = {
+ 60,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x38, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_TRAP, /* TRAP */
+ 0x2d, /* <--- len */
+ 0x06, 0x08, /* Objid: .1.3.6.1.4.1.3.1.1 */
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x03, 0x01, 0x01,
+ 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, /* IP address - 0.0.0.0 */
+ 0x02, 0x01, 0x00, /* generic trap */
+ 0x02, 0x01, 0x00, /* specific trap */
+ 0x43, 0x01, 0x00, /* Time ticks - 0 */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x10, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x0c, /* <-- len */
+ 0x06, 0x08, /* Objid: 1.3.6.1.2.1.1.3.0 */
+ 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00,
+ 0x05, 0x00 /* Null */
+};
- /* GET/GETNEXT/GETRESP/SET */
- int reqid;
- int error;
- int erridx;
-
- /* TRAP */
- Objid enterprise;
- int ipaddr;
- int generic_trap;
- int specific_trap;
-
- int varlen;
- Variable *head,
- *tail;
+u_char GetNext_Resp[] = {
+ 49,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x2d, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x22, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x02, /* Error Status */
+ 0x02, 0x01, 0x01, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x12, /* <--- len */
+ 0x30, /* Seqence of */
+ 0x82, 0x00, 0x0e, /* <--- len */
+ 0x06, 0x0a, /* Objid: .1.3.6.4.1.353.2.7.1 */
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02, 0x07, 0x01,
+ 0x05, 0x00 /* Get response: NULL */
};
-typedef struct snmp_header Snmp_Header;
-Snmp_Header *ColdStart_Header;
-Snmp_Header *PDU_Header;
+/*
+ * Reply to GET myIpNm
+ */
+u_char MyIpNm_Resp[] = {
+ 54,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x32, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x27, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x17, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x13, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.1.2.1 */
+ 0x06, 0x0B, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02,
+ 0x01, 0x02, 0x01,
+ 0x40, 0x04, 0x00, 0x00, 0x00, 0x00 /* IP address */
+};
/*
- * Define some OBJET IDENTIFIERS that we'll try to reply to:
- *
- * sysUpTime: number of time ticks since this deamon came up
- * netpfx_oid: network prefix table
- * unitype: is this a PRIVATE or PUBLIC network link
- * univer: which version of UNI are we running
- * devtype: is this a USER or NODE ATM device
- * setprefix: used when the switch wants to tell us its NSAP prefix
- * foresiggrp: FORE specific Objid we see alot of (being connected to FORE
- * switches...)
+ * Reply to GET portIndex - we're always 1 + unit number
*/
-Objid Objids[] = {
-#define SYS_OBJID 0
- {{ 8, 43, 6, 1, 2, 1, 1, 2, 0 }},
-#define UPTIME_OBJID 1
- {{ 8, 43, 6, 1, 2, 1, 1, 3, 0 }},
-#define PORT_OBJID 2
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 1, 1, 1, 1, 0 }},
-#define IPNM_OBJID 3
- {{ 10, 43, 6, 1, 4, 1, 353, 2, 1, 2, 0 }},
-#define LAYER_OBJID 4
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 1, 0 }},
-#define MAXVCC_OBJID 5
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 3, 0 }},
-#define UNITYPE_OBJID 6
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 8, 0 }},
-#define UNIVER_OBJID 7
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 9, 0 }},
-#define DEVTYPE_OBJID 8
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 10, 0 }},
-#define ADDRESS_OBJID 9
- {{ 8, 43, 6, 1, 4, 1, 353, 2, 6 }},
-#define NETPFX_OBJID 10
- {{ 9, 43, 6, 1, 4, 1, 353, 2, 7, 1 }},
-#define MY_OBJID 11
- {{ 7, 43, 6, 1, 4, 1, 9999, 1 }},
-#define SETPFX_OBJID 12
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 7, 1, 1, 3, 0 }},
-#define ENTERPRISE_OBJID 13
- {{ 8, 43, 6, 1, 4, 1, 3, 1, 1 }},
-#define ATMF_PORTID 14
- {{ 10, 43, 6, 1, 4, 1, 353, 2, 1, 4, 0 }},
-#define ATMF_SYSID 15
- {{ 12, 43, 6, 1, 4, 1, 353, 2, 1, 1, 1, 8, 0 }},
+u_char PortIndex_Resp[] = {
+ 53,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x31, /* <-- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP,
+ 0x26, /* <-- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x16, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x12, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.1.1.1.1.x */
+ 0x06, 0x0d, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02,
+ 0x01, 0x01, 0x01, 0x01, 0x00,
+ 0x02, 0x01, 0x00, /* Value */
};
-#define NUM_OIDS (sizeof(Objids)/sizeof(Objid))
+/*
+ * Reply to GET MaxVcc
+ */
+u_char maxVCC_Resp[] = {
+ 52, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x30, /* <--- len */
+ 0x02, 0x01, 0x01, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* GET Response */
+ 0x25, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* <--- request id */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x16, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x13, /* <--- len */
+ 0x06, 0x0d, /* Objid: 1.3.6.1.4.1.353.2.2.1.1.3.0 */
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02,
+ 0x02, 0x01, 0x01, 0x03, 0x00,
+ 0x02, 0x02, 0x04, 0x00 /* Value = 1024 */
+};
+
+/*
+ * Reply to GET uniType - we only support PRIVATE
+ */
+u_char UniType_Resp[] = {
+ 53,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x31, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x26, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x16, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x12, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.2.1.1.8.0 */
+ 0x06, 0x0d, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02, 0x02,
+ 0x01, 0x01, 0x08, 0x00,
+ 0x02, 0x01, 0x02 /* Get response: Integer */
+ /* = UNITYPE_PRIVATE (2) */
+};
-#define UNIVER_UNI20 1
#define UNIVER_UNI30 2
#define UNIVER_UNI31 3
#define UNIVER_UNI40 4
-#define UNIVER_UNKNOWN 5
-#define UNITYPE_PUBLIC 1
-#define UNITYPE_PRIVATE 2
+/*
+ * Reply to GET uniVer
+ */
+u_char UniVer_Resp[] = {
+ 53,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x31, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x26, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x16, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x12, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.2.1.1.9.0 */
+ 0x06, 0x0d, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02, 0x02,
+ 0x01, 0x01, 0x09, 0x00,
+ 0x02, 0x01, 0x02 /* Get response: Integer */
+ /* = UNIVER_UNI30 (2) */
+};
-#define DEVTYPE_USER 1
-#define DEVTYPE_NODE 2
+/*
+ * Reply to GET devType - we're a host therefore we're type USER
+ */
+u_char DevType_Resp[] = {
+ 53,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x31, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version -1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x26, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00, /* Error Status */
+ 0x02, 0x01, 0x00, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x16, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x12, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.2.1.1.10.0 */
+ 0x06, 0x0d, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02, 0x02,
+ 0x01, 0x01, 0x0a, 0x00,
+ 0x02, 0x01, 0x01 /* Get response: Integer */
+ /* = DEVTYPE_USER (1) */
+};
/*
- * ILMI protocol states
+ * Reply to GET foreSigGroup.* with noSuchError
*/
-enum ilmi_states {
- ILMI_UNKNOWN, /* Uninitialized */
- ILMI_COLDSTART, /* We need to send a COLD_START trap */
- ILMI_INIT, /* Ensure that switch has reset */
- ILMI_REG, /* Looking for SET message */
- ILMI_RUNNING /* Normal processing */
+u_char NoSuchFore_Resp[] = {
+ 85,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x51, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_GETRESP, /* PDU_TYPE_GETRESP */
+ 0x46, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x02, /* Error Status: noSuch (2) */
+ 0x02, 0x01, 0x01, /* Error Index */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x36, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x17, /* <--- len */
+ /* Objid: .1.3.6.1.5.1.326.2.2.2.1.6.2.1.1.1.20.0.0 */
+ 0x06, 0x13,
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x46,
+ 0x02, 0x02, 0x02, 0x01, 0x06, 0x02, 0x01, 0x01,
+ 0x01, 0x14, 0x00, 0x00,
+ 0x05, 0x00, /* NULL */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x17, /* <--- len */
+ /* Objid: .1.3.6.1.5.1.326.2.2.2.1.6.2.1.1.1.21.0.0 */
+ 0x06, 0x13,
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x46,
+ 0x02, 0x02, 0x02, 0x01, 0x06, 0x02, 0x01, 0x01,
+ 0x01, 0x15, 0x00, 0x00,
+ 0x05, 0x00 /* NULL */
+};
+
+u_char NetPrefix_Resp[] = {
+ 50,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x00, /* <--- len */
+ 0x02, 0x01, 0x00, /* (Version - 1) */
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49, /* Community: ILMI */
+ PDU_TYPE_SET, /* PDU_TYPE_SET */
+ 0x00, /* <--- len */
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, /* Request ID */
+ 0x02, 0x01, 0x00,
+ 0x02, 0x01, 0x00,
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x00, /* <--- len */
+ 0x30, /* Sequence of */
+ 0x82, 0x00, 0x00, /* <--- len */
+ /* Objid: .1.3.6.1.4.1.353.2.6.1.1.3.0. */
+ 0x06, 0x00,
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x61, 0x02,
+ 0x06, 0x01, 0x01, 0x03, 0x00
+ /* Remainder of Objid plus SET value INTEGER =1 */
};
/*
* Our (incrementing) Request ID
*/
-int Req_ID;
+int Req_ID = 0;
/*
* Temporary buffer for building response packets. Should help ensure
@@ -287,15 +502,18 @@ char *Traps[] = { "coldStart", "warmStart", "linkDown", "linkUp",
int NUnits;
-
/*
- * fd for units which have seen a coldStart TRAP and are now exchaning SNMP requests
+ * Time last coldStart trap was sent to this unit
+ */
+time_t last_trap[MAX_UNITS];
+/*
+ * fd for units still awiting coldStart TRAP from network side
*/
-int ilmi_fd[MAX_UNITS + 1];
+int trap_fd[MAX_UNITS];
/*
- * enum ilmi_states for this unit
+ * fd for units which have seen a coldStart TRAP and are now exchaning SNMP requests
*/
-int ilmi_state[MAX_UNITS + 1];
+int ilmi_fd[MAX_UNITS];
/*
* Local copy for HARP physical configuration information
*/
@@ -306,17 +524,11 @@ struct air_cfg_rsp Cfg[MAX_UNITS + 1];
struct air_int_rsp Intf[MAX_UNITS + 1];
/*
- * addressEntry table
- */
-Objid addressEntry[MAX_UNITS + 1];
-
-/*
* When this daemon started
*/
struct timeval starttime;
int Debug_Level = 0;
-int foregnd = 0; /* run in the foreground? */
char *progname;
char hostname[80];
@@ -325,6 +537,14 @@ char hostname[80];
#define LOG_FILE "/var/log/ilmid"
FILE *Log; /* File descriptor for log messages */
+extern int errno;
+
+#ifdef sun
+extern char *optarg;
+extern int optind, opterr;
+extern int getopt __P((int, char **, char *));
+#endif /* sun */
+
void set_reqid __P ( ( u_char *, int ) );
void Increment_DL __P ( ( int ) );
void Decrement_DL __P ( ( int ) );
@@ -354,11 +574,10 @@ write_timestamp()
clock = time ( (time_t)NULL );
tm = localtime ( &clock );
- if ( Log && Debug_Level > 1 )
- if ( Log != stderr )
- fprintf ( Log, "%.3s %2d %.2d:%.2d:%.2d %s: ",
- Months[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min,
- tm->tm_sec, hostname );
+ if ( Log )
+ fprintf ( Log, "%.3s %2d %.2d:%.2d:%.2d %s: ",
+ Months[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min,
+ tm->tm_sec, hostname );
return;
@@ -398,10 +617,8 @@ hexdump ( bp, len )
for ( ; j < 8 && j + i < len; j++ )
if ( Log )
fprintf ( Log, "%.2x ", *bp++ );
- if ( Log ) {
+ if ( Log )
fprintf ( Log, " " );
- fflush ( Log );
- }
for ( ; j < 12 && j + i < len; j++ )
if ( Log )
fprintf ( Log, "%.2x ", *bp++ );
@@ -410,10 +627,8 @@ hexdump ( bp, len )
for ( ; j < 16 && j + i < len; j++ )
if ( Log )
fprintf ( Log, "%.2x ", *bp++ );
- if ( Log ) {
+ if ( Log )
fprintf ( Log, "\n" );
- fflush ( Log );
- }
}
return;
@@ -431,32 +646,24 @@ hexdump ( bp, len )
*
* Arguments:
* bufp - pointer to buffer pointer
- * plen - pointer to PDU length or NULL if not a concern
*
* Returns:
* bufp - updated buffer pointer
- * plen - (possibly) adjusted pdu length
* <len> - decoded length
*
*/
int
-asn_get_pdu_len ( bufp, plen )
- u_char **bufp;
- int *plen;
+asn_get_pdu_len ( bufp )
+ u_char **bufp;
{
u_char *bp = *bufp;
int len = 0;
int i, b;
b = *bp++;
- if ( plen )
- (*plen)--;
if ( b & 0x80 ) {
- for ( i = 0; i < (b & ~0x80); i++ ) {
+ for ( i = 0; i < (b & ~0x80); i++ )
len = len * 256 + *bp++;
- if ( plen )
- (*plen)--;
- }
} else
len = b;
@@ -513,18 +720,15 @@ asn_get_encoded ( bufp, len )
*
* Arguments:
* bufp - pointer to the buffer pointer
- * plen - pointer to PDU length or NULL if not a concern
*
* Returns:
* bufp - updated buffer pointer
- * plen - (possibly) updated PDU length
* <val> - value of encoded integer
*
*/
int
-asn_get_int ( bufp, plen )
- u_char **bufp;
- int *plen;
+asn_get_int ( bufp )
+ u_char **bufp;
{
int i;
int len;
@@ -532,69 +736,14 @@ asn_get_int ( bufp, plen )
u_char *bp = *bufp;
len = *bp++;
- if ( plen )
- (*plen)--;
for ( i = 0; i < len; i++ ) {
v = (v * 256) + *bp++;
- if ( plen )
- (*plen)--;
}
*bufp = bp;
return ( v );
}
/*
- * Set a BER encoded integer
- *
- * Arguments:
- * bufp - pointer to buffer pointer where we are to set int in
- * val - integer value to set
- *
- * Returns:
- * none
- * <bufp> - updated buffer pointer
- *
- */
-void
-asn_set_int ( bufp, val )
- u_char **bufp;
- int val;
-{
- union {
- int i;
- u_char c[4];
- } u;
- int len = sizeof(int);
- int i = 0;
- u_char *bp = *bufp;
-
- /* Check for special case where val == 0 */
- if ( val == 0 ) {
- *bp++ = 1;
- *bp++ = 0;
- *bufp = bp;
- return;
- }
-
- u.i = htonl ( val );
-
- while ( u.c[i] == 0 && i++ < sizeof(int) )
- len--;
-
- if ( u.c[i] > 0x7f ) {
- i--;
- len++;
- }
-
- *bp++ = len;
- UM_COPY ( (caddr_t)&u.c[sizeof(int)-len], bp, len );
- bp += len;
- *bufp = bp;
-
- return;
-}
-
-/*
* Utility to print a object identifier
*
* Arguments:
@@ -633,19 +782,16 @@ print_objid ( objid )
* Arguments:
* bufp - pointer to buffer pointer
* objid - pointer to objid buffer
- * plen - pointer to PDU length or NULL of not a concern
*
* Returns:
* bufp - updated buffer pointer
* objid - internal representation of encoded objid
- * plen - (possibly) adjusted PDU length
*
*/
void
-asn_get_objid ( bufp, objid, plen )
- u_char **bufp;
- Objid *objid;
- int *plen;
+asn_get_objid ( bufp, objid )
+ u_char **bufp;
+ Objid *objid;
{
int len;
u_char *bp = *bufp;
@@ -653,53 +799,17 @@ asn_get_objid ( bufp, objid, plen )
int oidlen = 0;
len = *bp++;
- if ( plen )
- (*plen)--;
while ( len ) {
*ip++ = asn_get_encoded ( &bp, &len );
- if ( plen )
- (*plen)--;
oidlen++;
}
objid->oid[0] = oidlen;
*bufp = bp;
- return;
-}
-
-/*
- * Put OBJID - assumes elements <= 16383 for two byte coding
- *
- */
-int
-asn_put_objid ( bufp, objid )
- u_char **bufp;
- Objid *objid;
-{
- int len = 0;
- u_char *bp = *bufp;
- u_char *cpp;
- int i;
-
- cpp = bp;
- *bp++ = objid->oid[0];
- len++;
- for ( i = 1; i <= objid->oid[0]; i++ ) {
- u_int c = objid->oid[i];
-
- while ( c > 127 ) {
- *bp++ = ( ( c >> 7 ) & 0x7f ) | 0x80;
- len++;
- c &= 0x7f; /* XXX - assumption of two bytes */
- (*cpp)++;
- }
- *bp++ = c;
- len++;
- }
-
- *bufp = bp;
- return ( len );
+ if ( Debug_Level > 1 )
+ print_objid ( objid );
+ return;
}
/*
@@ -711,19 +821,16 @@ asn_put_objid ( bufp, objid )
* Arguments:
* bufp - pointer to buffer pointer
* octet - pointer to octet buffer
- * plen - pointer to PDU length
*
* Returns:
* bufp - updated buffer pointer
* octet - encoded Octet String
- * plen - (possibly) adjusted PDU length
*
*/
void
-asn_get_octet ( bufp, octet, plen )
- u_char **bufp;
- char *octet;
- int *plen;
+asn_get_octet ( bufp, octet )
+ u_char **bufp;
+ char *octet;
{
u_char *bp = *bufp;
int i = 0;
@@ -733,13 +840,10 @@ asn_get_octet ( bufp, octet, plen )
* &i is really a dummy value here as we don't keep track
* of the ongoing buffer length
*/
- len = asn_get_encoded ( &bp, &i, plen );
+ len = asn_get_encoded ( &bp, &i );
- for ( i = 0; i < len; i++ ) {
+ for ( i = 0; i < len; i++ )
*octet++ = *bp++;
- if ( plen )
- (*plen)--;
- }
*bufp = bp;
@@ -761,133 +865,22 @@ void
print_header ( Hdr )
Snmp_Header *Hdr;
{
- Variable *var;
-
if ( Log ) {
write_timestamp();
fprintf ( Log,
- "Pdu len: %d Version: %d Community: \"%s\" Pdu Type: 0x%x %s\n",
+ "Pdu len: %d Version: %d Community: \"%s\" Pdu Type: 0x%x\n",
Hdr->pdulen, Hdr->version + 1, Hdr->community,
- Hdr->pdutype, PDU_Types[Hdr->pdutype - PDU_TYPE_GET] );
- write_timestamp();
- if ( Hdr->pdutype != PDU_TYPE_TRAP && Log )
- fprintf ( Log, "\tReq Id: 0x%x Error: %d Error Index: %d\n",
- Hdr->reqid, Hdr->error, Hdr->erridx );
- }
-
- var = Hdr->head;
- while ( var ) {
- if ( Log ) {
- write_timestamp();
- fprintf ( Log, " Variable Type: %d", var->type );
- if ( Var_Types[var->type] )
- fprintf ( Log, " %s", Var_Types[var->type] );
- fprintf ( Log, "\n\tObject: " );
- print_objid ( &var->oid );
- fprintf ( Log, "\tValue: " );
- switch ( var->type ) {
- case ASN_INTEGER:
- fprintf ( Log, "%d (0x%x)\n", var->var.ival, var->var.ival );
- break;
- case ASN_NULL:
- fprintf ( Log, "NULL" );
- break;
- default:
- fprintf ( Log, "[0x%x]", var->type );
- break;
- }
- fprintf ( Log, "\n" );
- }
- var = var->next;
+ Hdr->pdutype );
}
+ if ( Hdr->pdutype != PDU_TYPE_TRAP && Log )
+ fprintf ( Log, "\tReq Id: 0x%x Error: %d Error Index: %d\n",
+ Hdr->reqid, Hdr->error, Hdr->erridx );
return;
}
/*
- * Pull OID's from GET/SET message
- *
- * Arguments:
- * h - pointer to Snmp_Header
- * bp - pointer to input PDU
- *
- * Returns:
- * none
- *
- */
-void
-parse_oids ( h, bp )
- Snmp_Header *h;
- caddr_t *bp;
-{
- int len = h->varlen;
- int sublen;
- Variable *var;
- caddr_t bufp = *bp;
-
- while ( len > 0 ) {
- if ( *bufp++ == ASN_SEQUENCE ) {
- len--;
-
- /* Create new Variable instance */
- if ( ( var = (Variable *)UM_ALLOC(sizeof(Variable)) ) == NULL )
- {
- *bp = bufp;
- return;
- }
- /* Link to tail */
- if ( h->tail )
- h->tail->next = var;
- /* Set head iff NULL */
- if ( h->head == NULL ) {
- h->head = var;
- }
- /* Adjust tail */
- h->tail = var;
-
- /* Get length of variable sequence */
- sublen = asn_get_pdu_len ( &bufp, &len );
- /* Should be OBJID type */
- if ( *bufp++ != ASN_OBJID ) {
- *bp = bufp;
- return;
- }
- asn_get_objid ( &bufp, &var->oid, &len );
- var->type = *bufp++;
- len--;
- switch ( var->type ) {
- case ASN_INTEGER:
- var->var.ival = asn_get_int ( &bufp, &len );
- break;
- case ASN_NULL:
- bufp++;
- len--;
- break;
- case ASN_OBJID:
- asn_get_objid ( &bufp, &var->var.oval, &len );
- break;
- case ASN_OCTET:
- asn_get_octet ( &bufp, var->var.sval, &len );
- break;
- default:
- if ( Log ) {
- write_timestamp();
- fprintf ( Log, "Unknown variable type: %d\n",
- var->type );
- }
- break;
- }
- var->next = NULL;
- } else
- break;
- }
-
- *bp = bufp;
- return;
-}
-
-/*
* Crack the SNMP header
*
* Pull the PDU length, SNMP version, SNMP community and PDU type.
@@ -908,8 +901,6 @@ asn_get_header ( bufp )
{
Snmp_Header *h;
u_char *bp = *bufp;
- int len = 0;
- int dummy = 0;
/*
* Allocate memory to hold the SNMP header
@@ -918,11 +909,6 @@ asn_get_header ( bufp )
return ( (Snmp_Header *)NULL );
/*
- * Ensure that we wipe the slate clean
- */
- UM_ZERO ( h, sizeof ( Snmp_Header ) );
-
- /*
* PDU has to start as SEQUENCE OF
*/
if ( *bp++ != ASN_SEQUENCE ) /* Class == Universial, f == 1, tag == SEQUENCE */
@@ -931,7 +917,7 @@ asn_get_header ( bufp )
/*
* Get the length of remaining PDU data
*/
- h->pdulen = asn_get_pdu_len ( &bp, NULL );
+ h->pdulen = asn_get_pdu_len ( &bp );
/*
* We expect to find an integer encoding Version-1
@@ -939,7 +925,7 @@ asn_get_header ( bufp )
if ( *bp++ != ASN_INTEGER ) {
return ( (Snmp_Header *)NULL );
}
- h->version = asn_get_int ( &bp, NULL );
+ h->version = asn_get_int ( &bp );
/*
* After the version, we need the community name
@@ -947,7 +933,8 @@ asn_get_header ( bufp )
if ( *bp++ != ASN_OCTET ) {
return ( (Snmp_Header *)NULL );
}
- asn_get_octet ( &bp, h->community, NULL );
+ UM_ZERO ( h->community, sizeof ( h->community ) );
+ asn_get_octet ( &bp, h->community );
/*
* Single byte PDU type
@@ -959,43 +946,31 @@ asn_get_header ( bufp )
*/
if ( h->pdutype != PDU_TYPE_TRAP ) { /* TRAP uses different format */
- (void) asn_get_pdu_len ( &bp, &dummy );
+ bp++; /* Skip over data len */
/* Request ID */
if ( *bp++ != ASN_INTEGER ) {
- UM_FREE ( h );
return ( (Snmp_Header *)NULL );
}
- h->reqid = asn_get_int ( &bp, NULL );
+ h->reqid = asn_get_int ( &bp );
/* Error Status */
if ( *bp++ != ASN_INTEGER ) {
- UM_FREE ( h );
return ( (Snmp_Header *)NULL );
}
- h->error = asn_get_int ( &bp, NULL );
+ h->error = asn_get_int ( &bp );
/* Error Index */
if ( *bp++ != ASN_INTEGER ) {
- UM_FREE ( h );
- return ( (Snmp_Header *)NULL );
- }
- h->erridx = asn_get_int ( &bp, NULL );
-
- /* Sequence of... */
- if ( *bp++ != ASN_SEQUENCE ) {
- UM_FREE ( h );
return ( (Snmp_Header *)NULL );
}
- h->varlen = ( asn_get_pdu_len ( &bp, &len ) - 1 );
- h->varlen += ( len - 1 );
+ h->erridx = asn_get_int ( &bp );
- parse_oids ( h, &bp );
}
*bufp = bp;
- if ( Log && Debug_Level )
+ if ( Debug_Level > 2 )
print_header ( h );
return ( h );
@@ -1003,7 +978,7 @@ asn_get_header ( bufp )
}
/*
- * Compare two internal OID representations
+ * Compare to internal OID representations
*
* Arguments:
* oid1 - Internal Object Identifier
@@ -1019,54 +994,18 @@ oid_cmp ( oid1, oid2 )
Objid *oid1, *oid2;
{
int i;
- int len;
/*
* Compare lengths
*/
- if ( !(oid1->oid[0] == oid2->oid[0] ) )
+ if ( !(oid1->oid[0] == oid2->oid[0]) )
/* Different lengths */
return ( 1 );
- len = oid1->oid[0];
-
- /*
- * value by value compare
- */
- for ( i = 1; i <= len; i++ ) {
- if ( !(oid1->oid[i] == oid2->oid[i]) )
- /* values don't match */
- return ( 1 );
- }
-
- /* Objid's are identical */
- return ( 0 );
-}
-
-/*
- * Compare two internal OID representations
- *
- * Arguments:
- * oid1 - Internal Object Identifier
- * oid2 - Internal Object Identifier
- * len - Length of OID to compare
- *
- * Returns:
- * 0 - Objid's match
- * 1 - Objid's don't match
- *
- */
-int
-oid_ncmp ( oid1, oid2, len )
- Objid *oid1, *oid2;
- int len;
-{
- int i;
-
/*
* value by value compare
*/
- for ( i = 1; i <= len; i++ ) {
+ for ( i = 1; i <= oid1->oid[0]; i++ ) {
if ( !(oid1->oid[i] == oid2->oid[i]) )
/* values don't match */
return ( 1 );
@@ -1077,50 +1016,35 @@ oid_ncmp ( oid1, oid2, len )
}
/*
- * Find the index of a OBJID which matches this Variable instance
- *
- * Arguments:
- * var - pointer to Variable instance
- *
- * Returns:
- * idx - index of matched Variable instance
- * -1 - no matching Variable found
+ * Encode a timeval as the number of time ticks
*
- */
-int
-find_var ( var )
- Variable *var;
-{
- int i;
-
- for ( i = 0; i < NUM_OIDS; i++ )
- if ( oid_cmp ( &var->oid, &Objids[i] ) == 0 ) {
- return ( i );
- }
-
- return ( -1 );
-
-}
-
-/*
- * Return the time process has been running as a number of ticks
+ * Time ticks are the number of 100th's of a second since some event.
+ * For sysUpTime, this is the time ticks since the application started,
+ * not since the host came up. We only support encoding ticks since we
+ * started running (what we are calling 'starttime').
*
* Arguments:
- * none
+ * bufp - pointer to buffer pointer
*
* Returns:
- * number of ticks
+ * bufp - updated buffper pointer
+ * len - number of bytes to encode time ticks value
+ * - ticks since 'starttime' encoded in buffer
*
*/
int
-get_ticks()
+asn_encode_ticks ( bufp, ret )
+ u_char **bufp;
+ int *ret;
{
- struct timeval timenow;
- struct timeval timediff;
+ struct timeval timenow;
+ struct timeval timediff;
+ u_char *bp = *bufp;
+ int len, ticks;
(void) gettimeofday ( &timenow, NULL );
/*
- * Adjust for subtraction
+ * Adjust for subtraction
*/
timenow.tv_sec--;
timenow.tv_usec += 1000000;
@@ -1140,252 +1064,139 @@ get_ticks()
}
/*
- * Compute number of ticks
+ * Compute 100th's of second in diff time structure
*/
- return ( ( timediff.tv_sec * 100 ) + ( timediff.tv_usec / 10000 ) );
+ *ret = ticks = (timediff.tv_sec * 100) + (timediff.tv_usec / 10000);
+
+ /*
+ * The rest of this is just plain gross. I'm sure there
+ * are better ways to do this...
+ */
+
+ /* Compute time ticks length */
+ if ( ticks < 0xFF )
+ len = 1;
+ else if ( ticks < 0xFFFF )
+ len = 2;
+ else if ( ticks < 0xFFFFFF )
+ len = 3;
+ else
+ len = 4;
+
+ /*
+ * Encode time ticks
+ */
+ *bp++ = ASN_TIMESTAMP; /* Time Ticks */
+ *bp++ = len; /* length of value */
+
+ /* there's always a better way but this is quick and dirty... */
+ if ( ticks > 0xFFFFFF ) {
+ *bp++ = ( ticks & 0xFF000000 ) >> 24;
+ ticks &= 0xFFFFFF;
+ }
+ if ( ticks > 0xFFFF ) {
+ *bp++ = ( ticks & 0xFF0000 ) >> 16;
+ ticks &= 0xFFFF;
+ }
+ if ( ticks > 0xFF ) {
+ *bp++ = ( ticks & 0xFF00 ) >> 8;
+ ticks &= 0xFF;
+ }
+ *bp++ = ticks;
+ *bufp = bp;
+ return ( len + 2 );
}
/*
- * Build a response PDU
+ * Send back up sysUpTime response
*
* Arguments:
- * hdr - pointer to PDU Header with completed Variable list
- *
+ * sd - socket descriptor to send reply on
+ * reqid - original GET request id
+ *
* Returns:
- * none
+ * none - response sent
*
*/
void
-build_pdu ( hdr, type )
- Snmp_Header *hdr;
- int type;
+send_uptime_resp ( sd, reqid )
+ int sd;
+ int reqid;
{
- u_char *bp = Resp_Buf;
- u_char *vpp;
- u_char *ppp;
- int erridx = 0;
- int varidx = 1;
- int varlen = 0;
- int pdulen = 0;
- int traplen = 0;
- Variable *var;
-
- /*
- * Clear out the reply
- */
- UM_ZERO ( Resp_Buf, sizeof(Resp_Buf) );
-
- /* [0] is reserved for overall length */
- bp++;
-
- /* Start with SEQUENCE OF */
- *bp++ = ASN_SEQUENCE;
- /* - assume we can code length in two octets */
- *bp++ = 0x82;
- bp++;
- bp++;
- /* Version */
- *bp++ = ASN_INTEGER;
- asn_set_int ( &bp, hdr->version );
- /* Community name */
- *bp++ = ASN_OCTET;
- *bp++ = strlen ( hdr->community );
- UM_COPY ( hdr->community, bp, strlen ( hdr->community ) );
- bp += strlen ( hdr->community );
- /* PDU Type */
- *bp++ = type;
- ppp = bp;
- /* Length of OID data - assume it'll fit in one octet */
- bp++;
-
- if ( type != PDU_TYPE_TRAP ) {
- /* Sequence ID */
- *bp++ = ASN_INTEGER;
- asn_set_int ( &bp, hdr->reqid );
- /*
- * Check to see if all the vaiables were resolved - we do this
- * by looking for something which still has a ASN_NULL value.
- */
- var = hdr->head;
- if ( type == PDU_TYPE_GETRESP ) {
- while ( var && erridx == 0 ) {
- if ( var->type != ASN_NULL ) {
- varidx++;
- var = var->next;
- } else
- erridx = varidx;
- }
- }
-
- /* Error status */
- *bp++ = ASN_INTEGER;
- *bp++ = 0x01; /* length = 1 */
- if ( erridx )
- *bp++ = 0x02; /* NoSuch */
- else
- *bp++ = 0x00; /* NoError */
- /* Error Index */
- *bp++ = ASN_INTEGER;
- *bp++ = 0x01; /* length = 1 */
- *bp++ = erridx; /* index - 0 if no error */
- } else {
- /* type == PDU_TYPE_TRAP */
-
- /* Fill in ENTERPRISE OBJID */
- *bp++ = ASN_OBJID;
- (void) asn_put_objid ( &bp, &hdr->enterprise );
-
- /* Fill in IP address */
- *bp++ = ASN_IPADDR;
- *bp++ = sizeof ( hdr->ipaddr );
- UM_COPY ( (caddr_t)&hdr->ipaddr, bp, sizeof(hdr->ipaddr) );
- bp += sizeof(hdr->ipaddr);
-
- /* Fill in generic and specific trap types */
- *bp++ = ASN_INTEGER;
- asn_set_int ( &bp, hdr->generic_trap );
- *bp++ = ASN_INTEGER;
- asn_set_int ( &bp, hdr->specific_trap );
-
- /* Fill in time-stamp - assume 0 for now */
- *bp++ = ASN_TIMESTAMP;
- asn_set_int ( &bp, 0 );
-
- /* encoded length */
- traplen = ( bp - ppp - 1 );
+ int len;
+ short *sp;
+ u_long *ip;
+ u_char *bp;
+ short val;
+ int ticks;
- /* Continue with variable processing */
- }
+ COPY_RESP ( sysUpTime_Resp );
- /* SEQUENCE OF */
- *bp++ = ASN_SEQUENCE;
- *bp++ = 0x82;
- /* - assume we can code length in two octets */
- vpp = bp;
- varlen = 0;
- bp++;
- bp++;
-
- /* Install Variables */
- var = hdr->head;
- varidx = 1;
- while ( var ) {
- u_char *bpp;
- int len = 0;
-
- /* SEQUENCE OF */
- *bp++ = ASN_SEQUENCE;
- *bp++ = 0x82;
- /* - assume we can code length in two octets */
- bpp = bp;
- bp++;
- bp++;
- /* OBJID */
- *bp++ = ASN_OBJID;
- len++;
- len += asn_put_objid ( &bp, &var->oid );
+ bp = (u_char *)&Resp_Buf[Resp_Buf[0]+1];
+ len = asn_encode_ticks ( &bp, &ticks );
- if ( erridx && varidx >= erridx ) {
- /* Code this variable as NULL */
- *bp++ = ASN_NULL;
- len++;
- bp++;
- len++;
- } else {
- u_char *lpp;
- /* Variable type */
- *bp++ = var->type;
- len++;
- lpp = bp;
- switch ( var->type ) {
- case ASN_INTEGER:
- asn_set_int ( &bp, var->var.ival );
- len += ( *lpp + 1 );
- break;
- case ASN_OCTET:
- *bp++ = var->var.sval[0];
- len++;
- UM_COPY ( (caddr_t)&var->var.sval[1],
- bp, var->var.sval[0] );
- len += var->var.sval[0];
- bp += var->var.sval[0];
- break;
- case ASN_NULL:
- *bp++ = 0x00;
- len++;
- break;
- case ASN_OBJID:
- len += asn_put_objid ( &bp, &var->var.oval );
- break;
- case ASN_SEQUENCE:
- break;
- case ASN_IPADDR:
- *bp++ = 4;
- len++;
- UM_COPY ( (caddr_t)&var->var.aval, bp, 4 );
- len += 4;
- bp += 4;
- break;
- case ASN_TIMESTAMP:
- asn_set_int ( &bp, var->var.ival );
- len += ( *lpp + 1 );
- break;
- default:
- break;
- }
- }
+ /*
+ * Adjust overall length
+ */
+ bp = (u_char *)&Resp_Buf[0];
+ *bp += len;
- /* Accumulate total Variable sequence length */
- varlen += (len + 4);
+ /*
+ * Adjust sequence lengths - works because this is my
+ * PDU and I know all the variable lengths are fixed (ie.
+ * reqid is always 4 byte encoded).
+ */
+#ifndef sun
+ sp = (short *)&Resp_Buf[3];
+ val = ntohs ( *sp );
+ *sp = htons ( val + len );
+ Resp_Buf[15] += len;
+ sp = (u_short *)&Resp_Buf[30];
+ val = ntohs ( *sp );
+ *sp = htons ( val + len );
+ sp = (u_short *)&Resp_Buf[34];
+ val = ntohs ( *sp );
+ *sp = htons ( val + len );
+#else
+ /* Sun SPARCs have alignment requirements */
+ Resp_Buf[4] += len;
+ Resp_Buf[15] += len;
+ Resp_Buf[31] += len;
+ Resp_Buf[35] += len;
+#endif /* sun */
- /* Fill in length of this sequence */
- bpp[1] = len & 0xff;
- bpp[0] = len >> 8;
+ /*
+ * Store the original request ID in the response
+ */
+ set_reqid ( Resp_Buf, reqid );
+#ifdef notdef
+#ifndef sun
+ ip = (u_long *)&Resp_Buf[18];
+ *ip = htonl ( reqid );
+#else
+ /* Sun SPARCs have alignment requirements */
+ UM_COPY ( (caddr_t)&reqid, (caddr_t)&Resp_Buf[18], sizeof(reqid) );
+#endif /* sun */
+#endif
- var = var->next;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tSend sysUpTime: %d\n", ticks );
}
-
- /* Fill in length of Variable sequence */
- vpp[1] = varlen & 0xff;
- vpp[0] = varlen >> 8;
-
- if ( type != PDU_TYPE_TRAP ) {
- /* Fill in length of data AFTER PDU type */
- *ppp = varlen + 12 + ppp[2]; /* + length of reqid */
- } else {
- /* Fill in length of data AFTER PDU type */
- *ppp = varlen + traplen + 4; /* + length of initial sequence of */
+ if ( Debug_Level > 4 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\n===== Sent %d bytes =====\n", Resp_Buf[0] );
+ hexdump ( (u_char *)&Resp_Buf[1], Resp_Buf[0] );
}
-
- /* Fill in overall sequence length */
- pdulen = *ppp + 7 + strlen ( hdr->community );
- Resp_Buf[4] = pdulen & 0x7f;
- Resp_Buf[3] = pdulen >> 8;
-
- pdulen = bp - Resp_Buf - 1;
-
- Resp_Buf[0] = pdulen;
-
- hdr->pdutype = type;
+ /*
+ * Send response
+ */
+ write ( sd, (caddr_t)&Resp_Buf[1], Resp_Buf[0] );
return;
-}
-void
-free_pdu ( hdr )
-Snmp_Header *hdr;
-{
- Variable *var;
-
- while ( hdr->head ) {
- var = hdr->head->next; /* Save next link */
- UM_FREE ( hdr->head ); /* Free current var */
- hdr->head = var; /* Set head to next link */
- }
-
- UM_FREE ( hdr ); /* Free fixed portion */
}
/*
@@ -1410,7 +1221,11 @@ set_reqid ( resp, reqid )
u_char c[4];
} u;
+#ifndef sun
u.i = htonl(reqid);
+#else
+ u.i = reqid;
+#endif /* !sun */
/*
* Replace the current Request ID with the supplied value
@@ -1418,6 +1233,7 @@ set_reqid ( resp, reqid )
UM_COPY ( (caddr_t)&u.c[4-resp[17]], bp, resp[17] );
return;
+
}
/*
@@ -1433,77 +1249,24 @@ set_reqid ( resp, reqid )
*
*/
void
-send_resp ( intf, Hdr, resp )
- int intf;
- Snmp_Header *Hdr;
+send_resp ( sd, reqid, resp )
+ int sd;
+ int reqid;
u_char *resp;
{
- int n;
- if ( ilmi_fd[intf] > 0 ) {
- n = write ( ilmi_fd[intf], (caddr_t)&resp[1], resp[0] );
- if ( Log && Debug_Level > 1 ) {
+ set_reqid ( resp, reqid );
+
+ if ( Debug_Level > 1 && Log ) {
write_timestamp();
- fprintf ( Log, "===== Sent %d of %d bytes (%d) =====\n", n, resp[0], ilmi_fd[intf] );
- print_header ( Hdr );
- if ( Debug_Level > 2 )
- hexdump ( (u_char *)&resp[1], resp[0] );
- }
+ fprintf ( Log, "===== Sent %d bytes =====\n", resp[0] );
+ hexdump ( (u_char *)&resp[1], resp[0] );
}
+ write ( sd, (caddr_t)&resp[1], resp[0] );
- free_pdu ( Hdr );
return;
}
-/*
- * Build a COLD_START TRAP PDU
- *
- */
-Snmp_Header *
-build_cold_start()
-{
- Snmp_Header *hdr;
- Variable *var;
-
- hdr = (Snmp_Header *)UM_ALLOC (sizeof(Snmp_Header));
-
- hdr->pdulen = 0;
- hdr->version = SNMP_VERSION_1 - 1;
- snprintf ( hdr->community, sizeof(hdr->community), "ILMI" );
-
- hdr->ipaddr = 0x0; /* 0.0.0.0 */
- hdr->generic_trap = TRAP_COLDSTART;
- hdr->specific_trap = 0;
- UM_COPY ( (caddr_t)&Objids[ENTERPRISE_OBJID], (caddr_t)&hdr->enterprise,
- sizeof(Objid) );
-
- hdr->head = (Variable *)UM_ALLOC(sizeof(Variable));
- var = hdr->head;
- UM_COPY ( (caddr_t)&Objids[UPTIME_OBJID], (caddr_t)&var->oid,
- sizeof(Objid) );
- var->type = ASN_NULL;
-
- return ( hdr );
-}
-
-/*
- * Build a Generic PDU Header
- *
- */
-Snmp_Header *
-build_generic_header()
-{
- Snmp_Header *hdr;
-
- hdr = (Snmp_Header *)UM_ALLOC(sizeof(Snmp_Header));
-
- hdr->pdulen = 0;
- hdr->version = SNMP_VERSION_1 - 1;
- snprintf ( hdr->community, sizeof(hdr->community), "ILMI" );
-
- return ( hdr );
-}
-
/*
* Initialize information on what physical adapters HARP knows about
*
@@ -1522,7 +1285,7 @@ void
init_ilmi()
{
struct air_cfg_rsp *cfg_info = NULL;
- struct air_int_rsp *intf_info = NULL;
+ struct air_intf_rsp *intf_info = NULL;
int buf_len;
/*
@@ -1536,6 +1299,10 @@ init_ilmi()
UM_ZERO ( Cfg, sizeof(Cfg) );
UM_ZERO ( Intf, sizeof(Intf) );
NUnits = 0;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "NUnits: %d\n", NUnits );
+ }
return;
}
@@ -1547,8 +1314,12 @@ init_ilmi()
* Compute how many units information was returned for
*/
NUnits = buf_len / sizeof(struct air_cfg_rsp);
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "NUnits: %d\n", NUnits );
+ }
/* Housecleaning */
- UM_FREE ( cfg_info );
+ free ( cfg_info );
cfg_info = NULL;
/*
* Get the per interface information
@@ -1567,7 +1338,7 @@ init_ilmi()
*/
UM_COPY ( intf_info, (caddr_t)Intf, buf_len );
/* Housecleaning */
- UM_FREE ( intf_info );
+ free ( intf_info );
intf_info = NULL;
return;
@@ -1599,15 +1370,28 @@ ilmi_open ()
struct t_atm_qos qos;
struct t_atm_app_name appname;
Atm_addr subaddr;
+ char buffer[MAX_LEN+1];
char nifname[IFNAMSIZ];
int optlen;
int unit = 0;
+ struct timer_elem *open_timer,
+ *state_timer;
u_char sig_proto;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "ilmi_open()\n" );
+ }
init_ilmi();
for ( unit = 0; unit < NUnits; unit++ ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "Unit: %d Sig: %d Trap: %d Ilmi: %d\n",
+ unit, Intf[unit].anp_sig_proto, trap_fd[unit],
+ ilmi_fd[unit] );
+ }
/*
* ILMI only makes sense for UNI signalling protocols
*/
@@ -1616,11 +1400,16 @@ ilmi_open ()
sig_proto != ATM_SIG_UNI40 )
continue;
- if ( ilmi_fd[unit] == -1 ) {
+ /*
+ * If we're waiting for a coldStart TRAP, we'll be in trap_fd[],
+ * If we're processing ILMI, we'll be in ilmi_fd[], otherwise,
+ * this unit hasn't been opened yet.
+ */
+ if ( trap_fd[unit] == -1 && ilmi_fd[unit] == -1 ) {
- ilmi_fd[unit] = socket ( AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5 );
+ trap_fd[unit] = socket ( AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5 );
- if ( ilmi_fd[unit] < 0 ) {
+ if ( trap_fd[unit] < 0 ) {
perror ( "open" );
continue;
}
@@ -1633,13 +1422,14 @@ ilmi_open ()
write_timestamp();
fprintf ( Log, "No nif on unit %d\n", unit );
}
- close ( ilmi_fd[unit] );
+ close ( trap_fd[unit] );
+ trap_fd[unit] = -1;
ilmi_fd[unit] = -1;
continue;
}
- sprintf ( nifname, "%s0", Intf[unit].anp_nif_pref );
+ sprintf ( nifname, "%s0\0", Intf[unit].anp_nif_pref );
optlen = sizeof ( nifname );
- if ( setsockopt ( ilmi_fd[unit], T_ATM_SIGNALING,
+ if ( setsockopt ( trap_fd[unit], T_ATM_SIGNALING,
T_ATM_NET_INTF, (caddr_t)nifname, optlen ) < 0 ) {
perror ( "setsockopt" );
if ( Log ) {
@@ -1652,8 +1442,9 @@ ilmi_open ()
write_timestamp();
fprintf ( Log, "nifname: closing unit %d\n", unit );
}
- close ( ilmi_fd[unit] );
- ilmi_fd[unit] = -1;
+ close ( trap_fd[unit] );
+ trap_fd[unit] = -1;
+ ilmi_fd[unit] = -1;
continue;
}
@@ -1662,9 +1453,9 @@ ilmi_open ()
*/
UM_ZERO ( (caddr_t) &satm, sizeof(satm) );
satm.satm_family = AF_ATM;
-#if (defined(BSD) && (BSD >= 199103))
+#ifndef sun
satm.satm_len = sizeof(satm);
-#endif
+#endif /* sun */
satm.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_PRESENT;
satm.satm_addr.t_atm_sap_addr.SVE_tag_selector = T_ATM_ABSENT;
@@ -1690,14 +1481,15 @@ ilmi_open ()
aal5.backward_max_SDU_size = MAX_LEN;
aal5.SSCS_type = T_ATM_NULL;
optlen = sizeof(aal5);
- if ( setsockopt ( ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_AAL5,
+ if ( setsockopt ( trap_fd[unit], T_ATM_SIGNALING, T_ATM_AAL5,
(caddr_t) &aal5, optlen ) < 0 ) {
perror ( "setsockopt(aal5)" );
if ( Debug_Level > 1 && Log ) {
write_timestamp();
fprintf ( Log, "aal5: closing unit %d\n", unit );
}
- close ( ilmi_fd[unit] );
+ close ( trap_fd[unit] );
+ trap_fd[unit] = -1;
ilmi_fd[unit] = -1;
continue;
}
@@ -1718,7 +1510,7 @@ ilmi_open ()
traffic.backward.tagging = T_NO;
traffic.best_effort = T_YES;
optlen = sizeof(traffic);
- if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_TRAFFIC,
+ if (setsockopt(trap_fd[unit], T_ATM_SIGNALING, T_ATM_TRAFFIC,
(caddr_t)&traffic, optlen) < 0) {
perror("setsockopt(traffic)");
}
@@ -1728,7 +1520,7 @@ ilmi_open ()
bearer.clipping_susceptibility = T_NO;
bearer.connection_configuration = T_ATM_1_TO_1;
optlen = sizeof(bearer);
- if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_BEARER_CAP,
+ if (setsockopt(trap_fd[unit], T_ATM_SIGNALING, T_ATM_BEARER_CAP,
(caddr_t)&bearer, optlen) < 0) {
perror("setsockopt(bearer)");
}
@@ -1737,7 +1529,7 @@ ilmi_open ()
qos.forward.qos_class = T_ATM_QOS_CLASS_0;
qos.backward.qos_class = T_ATM_QOS_CLASS_0;
optlen = sizeof(qos);
- if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos,
+ if (setsockopt(trap_fd[unit], T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos,
optlen) < 0) {
perror("setsockopt(qos)");
}
@@ -1745,14 +1537,14 @@ ilmi_open ()
subaddr.address_format = T_ATM_ABSENT;
subaddr.address_length = 0;
optlen = sizeof(subaddr);
- if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_DEST_SUB,
+ if (setsockopt(trap_fd[unit], T_ATM_SIGNALING, T_ATM_DEST_SUB,
(caddr_t)&subaddr, optlen) < 0) {
perror("setsockopt(dest_sub)");
}
strncpy(appname.app_name, "ILMI", T_ATM_APP_NAME_LEN);
optlen = sizeof(appname);
- if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_APP_NAME,
+ if (setsockopt(trap_fd[unit], T_ATM_SIGNALING, T_ATM_APP_NAME,
(caddr_t)&appname, optlen) < 0) {
perror("setsockopt(appname)");
}
@@ -1760,14 +1552,15 @@ ilmi_open ()
/*
* Now try to connect to destination
*/
- if ( connect ( ilmi_fd[unit], (struct sockaddr *) &satm,
+ if ( connect ( trap_fd[unit], (struct sockaddr *) &satm,
sizeof(satm)) < 0 ) {
perror ( "connect" );
if ( Debug_Level > 1 && Log ) {
write_timestamp();
fprintf ( Log, "connect: closing unit %d\n", unit );
}
- close ( ilmi_fd[unit] );
+ close ( trap_fd[unit] );
+ trap_fd[unit] = -1;
ilmi_fd[unit] = -1;
continue;
}
@@ -1776,44 +1569,61 @@ ilmi_open ()
write_timestamp();
fprintf ( Log, "***** opened unit %d\n", unit );
}
-
- ilmi_state[unit] = ILMI_COLDSTART;
-
+ /*
+ * Send coldStart TRAP
+ */
+ if ( Debug_Level > 4 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "===== Sent %d bytes =====\n",
+ coldStart_Trap[0] );
+ hexdump ( (u_char *)&coldStart_Trap[1], coldStart_Trap[0] );
+ }
+ if ( Debug_Level && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tSend coldStart TRAP to unit %d\n", unit );
+ }
+ last_trap[unit] = time ( (time_t *)NULL );
+ write ( trap_fd[unit], (caddr_t)&coldStart_Trap[1],
+ coldStart_Trap[0] );
}
}
+ signal ( SIGALRM, ilmi_open );
+ alarm ( SLEEP_TIME );
+
return;
}
/*
- * Get our local IP address for this interface
+ * Send our local IP address for this interface
*
* Arguments:
- * s - socket to find address for
- * aval - pointer to variable to store address in
+ * s - socket to send message on
+ * hdr - pointer to internal SNMP header
*
* Returns:
* none
*
*/
void
-get_local_ip ( s, aval )
- int s;
- long *aval;
+send_myipnm ( s, hdr )
+ int s;
+ Snmp_Header *hdr;
{
- char intf_name[IFNAMSIZ];
- int namelen = IFNAMSIZ;
- struct air_netif_rsp *net_info = NULL;
+ char intf_name[IFNAMSIZ];
+ int namelen = IFNAMSIZ;
+ struct air_netif_rsp *net_info = NULL;
struct sockaddr_in *sin;
- /*
- * Get physical interface name
- */
+ COPY_RESP ( MyIpNm_Resp );
+
if ( getsockopt ( s, T_ATM_SIGNALING, T_ATM_NET_INTF,
- (caddr_t) intf_name, &namelen ) )
- return;
+ (caddr_t) intf_name, &namelen ) ) {
+ perror ( "Couldn't get socket name" );
+ return;
+ }
/*
* Get network interface information for this physical interface
@@ -1825,14 +1635,23 @@ get_local_ip ( s, aval )
sin = (struct sockaddr_in *)&net_info->anp_proto_addr;
/*
- * Fill in answer
+ * Copy interface's IP address into reply packet
*/
- UM_COPY ( (caddr_t)&sin->sin_addr.s_addr, aval, 4 );
+ UM_COPY ( (caddr_t)&sin->sin_addr.s_addr, (caddr_t)&Resp_Buf[51],
+ 4 );
+
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tSend NM IP address\n" );
+ }
- UM_FREE ( net_info );
+ send_resp ( s, hdr->reqid, Resp_Buf );
+ /*
+ * Clean up
+ */
+ free ( net_info );
return;
-
}
/*
@@ -1853,29 +1672,40 @@ get_local_ip ( s, aval )
*
*/
void
-set_prefix ( oid, hdr, intf )
+set_prefix ( oid, hdr, buf, s )
Objid *oid;
Snmp_Header *hdr;
- int intf;
+ u_char *buf;
+ int s;
{
- struct atmsetreq asr;
- Atm_addr *aa;
- int fd;
- int i;
+ struct atmsetreq asr;
+ Atm_addr *aa;
+ int fd;
+ int i;
+ u_char *cpp;
+ int len; /* PDU length before completion */
+
+ /*
+ * If we don't reply to the SET then it keeps getting retransmitted.
+ */
+ buf[14] = PDU_TYPE_GETRESP;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tSend SET_RESPONSE\n" );
+ }
+ send_resp ( s, hdr->reqid, buf );
/*
* Build IOCTL request to set prefix
*/
asr.asr_opcode = AIOCS_SET_PRF;
- strncpy ( asr.asr_prf_intf, Intf[intf].anp_intf,
+ strncpy ( asr.asr_prf_intf, Intf[0].anp_intf,
sizeof(asr.asr_prf_intf ) );
/*
* Pull prefix out of received Objid
- * save in set_prefix IOCTL and addressEntry table
*/
- for ( i = 0; i < oid->oid[13]; i++ ) {
+ for ( i = 0; i < oid->oid[13]; i++ )
asr.asr_prf_pref[i] = oid->oid[i + 14];
- }
/*
* Pass new prefix to the HARP kernel
@@ -1888,10 +1718,9 @@ set_prefix ( oid, hdr, intf )
syslog ( LOG_ERR, "ilmid: error setting prefix: %m" );
if ( Log ) {
write_timestamp();
- fprintf ( Log, "errno %d setting prefix\n",
+ fprintf ( Log, "ilmid: errno %d setting prefix\n",
errno );
}
- close ( fd );
return;
}
}
@@ -1902,58 +1731,375 @@ set_prefix ( oid, hdr, intf )
*/
init_ilmi();
- aa = &Intf[intf].anp_addr;
+ aa = &Intf[0].anp_addr;
/*
- * Copy our NSAP into addressEntry table
+ * Finish building SET NSAP packet
*/
- addressEntry[intf].oid[0] = 0;
+ COPY_RESP ( NetPrefix_Resp );
+
+ len = Resp_Buf[0];
+ cpp = &Resp_Buf[len + 1]; /* Set to end of response buffer */
+ len++;
+ *cpp++ = aa->address_length;
for ( i = 0; i < aa->address_length; i++ ) {
- addressEntry[intf].oid[0]++; /* Increment length */
- addressEntry[intf].oid[i + 1] = (int)((u_char *)(aa->address))[i];
+ u_char c = ((u_char *)(aa->address))[i];
+ if ( c > 127 ) {
+ *cpp++ = ( c >> 7 ) | 0x80;
+ len++;
+ c &= 0x7f;
+ }
+ *cpp++ = c;
+ len++;
+ }
+ /*
+ * Pack "set = 1" onto end
+ */
+ *cpp++ = 0x02;
+ *cpp++ = 0x01;
+ *cpp++ = 0x01;
+ len += 3;
+
+ /*
+ * Go back and patch up lengths...
+ */
+ Resp_Buf[0] = len;
+ Resp_Buf[4] = (u_char)(len - 4);
+ Resp_Buf[15] = (u_char)(len - 15);
+ Resp_Buf[31] = (u_char)(len - 31);
+ Resp_Buf[35] = (u_char)(len - 35);
+ Resp_Buf[37] = (u_char)(len - 40);
+
+ /*
+ * Set reqid
+ */
+ set_reqid ( Resp_Buf, Req_ID++ );
+
+ /*
+ * Send SET
+ */
+ if ( Debug_Level > 2 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "===== Send SET: %d bytes =====\n",
+ Resp_Buf[0] );
+ hexdump ( (u_char *)&Resp_Buf[1], Resp_Buf[0] );
}
+ write ( s, (caddr_t)&Resp_Buf[1], Resp_Buf[0] );
return;
}
+Objid oid;
+
+/*
+ * Parse an ASN_TYPE_SET pdu
+ *
+ * Crack apart the various pieces of a SET message. The OBJID being set is
+ * left in oid which is compared and handled else where.
+ *
+ * Arguments:
+ * bp - pointer to current location in PDU buffer
+ *
+ * Returns:
+ * bp - updated buffer pointer
+ * 0 - no error
+ * -1 - error in PDU
+ *
+ */
+int
+process_set ( bp )
+ caddr_t *bp;
+{
+ caddr_t bufp = *bp;
+ int pdulen;
+ int b;
+
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "SET:: " );
+ }
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ *bp = bufp;
+ return ( -1 );
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ *bp = bufp;
+ return ( -1 );
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be OBJID
+ */
+ if ( *bufp++ != ASN_OBJID ) {
+ *bp = bufp;
+ return ( -1 );
+ }
+ asn_get_objid ( &bufp, &oid );
+ /*
+ * Should be <= value>
+ */
+ switch ( *bufp++ ) {
+ case ASN_INTEGER:
+ b = asn_get_int ( &bufp );
+ if ( Debug_Level > 5 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "Value = %d\n", b );
+ }
+ break;
+ case ASN_OBJID:
+ break;
+ }
+
+ /*
+ * Return updated pointer
+ */
+ *bp = bufp;
+
+ return ( 0 );
+}
+
+int specific_trap;
+int generic_trap;
+int trap_time;
+u_char trap_ip[5];
+Objid trap_oid;
+Objid extra_trap_oid;
+
+/*
+ * Parse an ASN_TYPE_TRAP pdu
+ *
+ * Crack apart the various pieces of a TRAP message. The information elements are
+ * left in global space and used elsewhere if anyone cares (which they currently don't).
+ *
+ * Arguments:
+ * bp - pointer to current location in PDU buffer
+ * sd - socket descriptor pdu arrived on
+ *
+ * Returns:
+ * bp - updated buffer pointer
+ * 0 - no error
+ * -1 - error in PDU
+ *
+ */
+int
+process_trap ( bp, sd )
+ caddr_t *bp;
+ int sd;
+{
+ caddr_t bufp = *bp;
+ int pdulen;
+ int i;
+
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "TRAP:: " );
+ }
+ /*
+ * Should be pdulen
+ */
+ pdulen = *bufp++;
+ /*
+ * Should be OBJID
+ */
+ if ( *bufp++ != ASN_OBJID ) {
+ if ( Log )
+ fprintf ( Log, "\n" );
+ *bp = bufp;
+ return ( -1 );
+ }
+ asn_get_objid ( &bufp, &trap_oid );
+ /*
+ * First oid coded as 40 * X + Y
+ */
+ if ( Debug_Level > 5 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "%d.%d", trap_oid.oid[1] / 40,
+ trap_oid.oid[1] % 40 );
+ for ( i = 2; i <= trap_oid.oid[0]; i++ )
+ fprintf ( Log, ".%d", trap_oid.oid[i] );
+ fprintf ( Log, "\n" );
+ }
+ /*
+ * Should be OCTET STRING
+ */
+ if ( *bufp++ != ASN_IPADDR ) {
+ if ( Debug_Level > 5 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "Expected IP ADDRESS\n" );
+ }
+ *bp = bufp;
+ return ( -1 );
+ }
+ asn_get_octet ( &bufp, trap_ip );
+ if ( Debug_Level > 5 && Log) {
+ write_timestamp();
+ fprintf ( Log, "\tIP: %d.%d.%d.%d",
+ trap_ip[0], trap_ip[1], trap_ip[2], trap_ip[3] );
+ }
+ /*
+ * Should be Generic Trap followed by Specific Trap
+ */
+ if ( *bufp++ != ASN_INTEGER ) {
+ if ( Log )
+ fprintf ( Log, "\n" );
+ *bp = bufp;
+ return ( -1 );
+ }
+ generic_trap = asn_get_int ( &bufp );
+ if ( Debug_Level > 5 && Log ) {
+ fprintf ( Log, " Generic Trap: %s (%d)",
+ Traps[generic_trap], generic_trap );
+ }
+ if ( *bufp++ != ASN_INTEGER ) {
+ if ( Log )
+ fprintf ( Log, "\n" );
+ *bp = bufp;
+ return ( -1 );
+ }
+ specific_trap = asn_get_int ( &bufp );
+ if ( Debug_Level > 5 && Log ) {
+ fprintf ( Log, " Specific Trap: 0x%x\n",
+ specific_trap );
+ }
+ /*
+ * Should be TIMESTAMP
+ */
+ if ( *bufp++ != ASN_TIMESTAMP ) {
+ if ( Log )
+ fprintf ( Log, "\n" );
+ *bp = bufp;
+ return ( -1 );
+ }
+ trap_time = asn_get_int ( &bufp );
+ if ( Debug_Level > 5 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tTimestamp: %d seconds", trap_time );
+ }
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ *bp = bufp;
+ return ( -1 );
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be OBJID
+ */
+ if ( *bufp++ != ASN_OBJID ) {
+ *bp = bufp;
+ return ( -1 );
+ }
+ asn_get_objid ( &bufp, &extra_trap_oid );
+ if ( Debug_Level > 5 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "\tExtra Objid: " );
+ fprintf ( Log, "%d.%d", extra_trap_oid.oid[1] / 40,
+ extra_trap_oid.oid[1] % 40 );
+ for ( i = 2; i <= extra_trap_oid.oid[0]; i++ )
+ fprintf ( Log, ".%d", extra_trap_oid.oid[i] );
+ fprintf ( Log, "\n" );
+ }
+ /*
+ * Whole thing ended with a NULL
+ */
+ bufp++;
+ bufp++;
+
+ /*
+ * Return updated pointer
+ */
+ *bp = bufp;
+
+ if ( generic_trap == 0 ) {
+ write ( sd, (caddr_t)&coldStart_Trap[1],
+ coldStart_Trap[0] );
+ }
+
+ return ( 0 );
+
+}
+
+u_char No_Such[] = { 37,
+ 0x30, 0x82, 0x00, 0x00,
+ 0x02, 0x01, 0x00,
+ 0x04, 0x04, 0x49, 0x4c, 0x4d, 0x49,
+ PDU_TYPE_GETRESP,
+ 0x00,
+ 0x02, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x01, 0x02,
+ 0x02, 0x01, 0x01,
+ 0x30, 0x82, 0x00, 0x00,
+ 0x30, 0x82, 0x00, 0x00,
+ 0x06, 0x00
+ };
void
-set_address ( hdr, intf )
- Snmp_Header *hdr;
- int intf;
+send_no_such ( s, Hdr, op )
+ int s;
+ Snmp_Header *Hdr;
+ Objid *op;
{
- Variable *var;
- int i, j;
-
- PDU_Header = build_generic_header();
- PDU_Header->head = (Variable *)UM_ALLOC(sizeof(Variable));
- var = PDU_Header->head;
- /* Copy generic addressEntry OBJID */
- UM_COPY ( (caddr_t)&Objids[ADDRESS_OBJID], (caddr_t)&var->oid,
- sizeof(Objid) );
- /* Set specific instance */
- i = var->oid.oid[0] + 1; /* Get length */
- var->oid.oid[i++] = 1;
- var->oid.oid[i++] = 1;
- var->oid.oid[i++] = 3;
- var->oid.oid[i++] = 0;
-
- /* Copy in address length */
- var->oid.oid[i++] = addressEntry[intf].oid[0];
-
- /* Copy in address */
- for ( j = 0; j < addressEntry[intf].oid[0]; j++ )
- var->oid.oid[i++] = addressEntry[intf].oid[j + 1];
- var->oid.oid[0] = i - 1; /* Set new length */
-
- /* Set == VALID */
- var->type = ASN_INTEGER;
- var->var.ival = 1;
-
- build_pdu ( PDU_Header, PDU_TYPE_SET );
- send_resp ( intf, PDU_Header, Resp_Buf );
+ u_char *cp, *cpp;
+ int len;
+ int i;
+
+ len = No_Such[0];
+
+ UM_COPY ( No_Such, Resp_Buf, len + 1 );
+
+ cp = cpp = (u_char *)&Resp_Buf[len];
+
+ /*
+ * Copy OID into response buffer
+ */
+ *cp++ = op->oid[0];
+ for ( i = 1; i <= op->oid[0]; i++ ) {
+ u_int c = op->oid[i];
+
+ if ( c > 127 ) {
+ *cp++ = ( c >> 7 ) | 0x80;
+ len++;
+ c &= 0x7f;
+ /*
+ * Increment OID length
+ */
+ *cpp += 1;
+ }
+ *cp++ = c;
+ len++;
+ }
+ /*
+ * Finish off with a NULL
+ */
+ *cp++ = 0x05;
+ *cp++ = 0x00;
+ len += 2;
+
+ /*
+ * Patch up all the length locations
+ */
+ Resp_Buf[0] = len;
+ Resp_Buf[4] = len - 4;
+ Resp_Buf[15] = len - 15;
+ Resp_Buf[31] = len - 31;
+ Resp_Buf[35] = len - 35;
+
+ /*
+ * Send Response
+ */
+ send_resp ( s, Hdr->reqid, Resp_Buf );
+
+ return;
}
/*
@@ -1997,20 +2143,13 @@ Increment_DL ( sig )
int sig;
{
Debug_Level++;
- if ( Debug_Level && Log == (FILE *)NULL ) {
- if ( foregnd ) {
- Log = stderr;
- } else {
- if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL )
- Log = NULL;
- }
- if ( Log ) {
+ if ( Debug_Level && Log == (FILE *)NULL )
+ if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL )
+ Log = NULL;
+ else
setbuf ( Log, NULL );
- write_timestamp();
- fprintf ( Log, "Raised Debug_Level to %d\n", Debug_Level );
- }
- }
signal ( SIGUSR1, Increment_DL );
+ alarm ( SLEEP_TIME );
return;
}
@@ -2034,388 +2173,37 @@ Decrement_DL ( sig )
if ( Debug_Level <= 0 ) {
Debug_Level = 0;
if ( Log ) {
- write_timestamp();
- fprintf ( Log, "Lowered Debug_Level to %d\n", Debug_Level );
- if ( !foregnd )
- fclose ( Log );
+ fclose ( Log );
Log = NULL;
}
}
signal ( SIGUSR2, Decrement_DL );
+ alarm ( SLEEP_TIME );
return;
}
-/*
- * Loop through GET variable list looking for matches
- *
- */
-void
-process_get ( hdr, intf )
- Snmp_Header *hdr;
- int intf;
-{
- Variable *var;
- int idx;
-
- var = hdr->head;
- while ( var ) {
- idx = find_var ( var );
- switch ( idx ) {
- case SYS_OBJID:
- var->type = ASN_OBJID;
- UM_COPY ( (caddr_t)&Objids[MY_OBJID],
- (caddr_t)&var->var.oval,
- sizeof(Objid) );
- break;
- case UPTIME_OBJID:
- var->type = ASN_TIMESTAMP;
- var->var.ival = get_ticks();
- break;
- case UNITYPE_OBJID:
- var->type = ASN_INTEGER;
- var->var.ival = UNITYPE_PRIVATE;
- break;
- case UNIVER_OBJID:
- var->type = ASN_INTEGER;
- switch ( Intf[intf].anp_sig_proto ) {
- case ATM_SIG_UNI30:
- var->var.ival = UNIVER_UNI30;
- break;
- case ATM_SIG_UNI31:
- var->var.ival = UNIVER_UNI31;
- break;
- case ATM_SIG_UNI40:
- var->var.ival = UNIVER_UNI40;
- break;
- default:
- var->var.ival = UNIVER_UNKNOWN;
- break;
- }
- break;
- case DEVTYPE_OBJID:
- var->type = ASN_INTEGER;
- var->var.ival = DEVTYPE_USER;
- break;
- case MAXVCC_OBJID:
- var->type = ASN_INTEGER;
- var->var.ival = 1024;
- break;
- case PORT_OBJID:
- var->type = ASN_INTEGER;
- var->var.ival = intf + 1;
- break;
- case IPNM_OBJID:
- var->type = ASN_IPADDR;
- get_local_ip ( ilmi_fd[intf],
- &var->var.ival );
- break;
- case ADDRESS_OBJID:
- break;
- case ATMF_PORTID:
- var->type = ASN_INTEGER;
- var->var.ival = 0x30 + intf;
- break;
- case ATMF_SYSID:
- var->type = ASN_OCTET;
- var->var.sval[0] = 6;
- UM_COPY ( (caddr_t)&Cfg[intf].acp_macaddr,
- (caddr_t)&var->var.sval[1], 6 );
- break;
- default:
- /* NO_SUCH */
- break;
- }
- var = var->next;
- }
- build_pdu ( hdr, PDU_TYPE_GETRESP );
- send_resp ( intf, hdr, Resp_Buf );
-
-}
-
-/*
- * ILMI State Processing Loop
- *
- *
- */
-void
-ilmi_do_state ()
-{
- struct timeval tvp;
- fd_set rfd;
- u_char buf[1024];
- Variable *var;
- int intf;
- int maxfd = 0;
-
- /*
- * Loop forever
- */
- for ( ; ; ) {
- int count;
- int n;
- caddr_t bpp;
- Snmp_Header *Hdr;
-
- /*
- * SunOS CC doesn't allow automatic aggregate initialization.
- * Initialize to zero which effects a poll operation.
- */
- tvp.tv_sec = 15;
- tvp.tv_usec = 0;
-
- /*
- * Clear fd_set and initialize to check this interface
- */
- FD_ZERO ( &rfd );
- for ( intf = 0; intf < MAX_UNITS; intf++ )
- if ( ilmi_fd[intf] > 0 ) {
- FD_SET ( ilmi_fd[intf], &rfd );
- maxfd = MAX ( maxfd, ilmi_fd[intf] );
- }
-
- /*
- * Check for new interfaces
- */
- ilmi_open();
-
- for ( intf = 0; intf < MAX_UNITS; intf++ ) {
- /*
- * Do any pre-message state processing
- */
- switch ( ilmi_state[intf] ) {
- case ILMI_COLDSTART:
- /*
- * Clear addressTable
- */
- UM_ZERO ( (caddr_t)&addressEntry[intf], sizeof(Objid) );
-
- /*
- * Start by sending a COLD_START trap. This should cause the
- * remote end to clear the associated prefix/address table(s).
- */
- /* Build ColdStart TRAP header */
- ColdStart_Header = build_cold_start();
- build_pdu ( ColdStart_Header, PDU_TYPE_TRAP );
- send_resp ( intf, ColdStart_Header, Resp_Buf );
-
- /*
- * Start a timeout so that if the next state fails, we re-enter
- * ILMI_COLDSTART.
- */
- /* atm_timeout() */
-
- /* Enter new state */
- ilmi_state[intf] = ILMI_INIT;
- /* fall into ILMI_INIT */
-
- case ILMI_INIT:
- /*
- * After a COLD_START, we need to check that the remote end has
- * cleared any tables. Send a GET_NEXT request to check for this.
- * In the event that the table is not empty, or that no reply is
- * received, return to COLD_START state.
- */
- PDU_Header = build_generic_header();
- PDU_Header->head = (Variable *)UM_ALLOC(sizeof(Variable));
- var = PDU_Header->head;
- UM_COPY ( (caddr_t)&Objids[ADDRESS_OBJID], (caddr_t)&var->oid,
- sizeof(Objid) );
- var->type = ASN_NULL;
- var->next = NULL;
-
- /*
- * Send GETNEXT request looking for empty ATM Address Table
- */
- PDU_Header->reqid = Req_ID++;
- build_pdu ( PDU_Header, PDU_TYPE_GETNEXT );
- send_resp ( intf, PDU_Header, Resp_Buf );
-
- /*
- * Start a timeout while looking for SET message. If we don't receive
- * a SET, then go back to COLD_START state.
- */
- /* atm_timeout() */
- break;
-
- case ILMI_RUNNING:
- /* Normal SNMP processing */
- break;
-
- default:
- break;
- }
- }
-
- count = select ( maxfd + 1, &rfd, NULL, NULL, &tvp );
-
- for ( intf = 0; intf < MAX_UNITS; intf++ ) {
- /*
- * Check for received messages
- */
- if ( ilmi_fd[intf] > 0 && FD_ISSET ( ilmi_fd[intf], & rfd ) ) {
-
- n = read ( ilmi_fd[intf], (caddr_t)&buf[1], sizeof(buf) - 1 );
- if ( n == -1 && ( errno == ECONNRESET || errno == EBADF ) ) {
- ilmi_state[intf] = ILMI_COLDSTART;
- close ( ilmi_fd[intf] );
- ilmi_fd[intf] = -1;
- } else {
- if ( Log && Debug_Level > 1 ) fprintf ( Log, "***** state %d ***** read %d bytes from %d (%d) ***** %s *****\n",
- ilmi_state[intf], n, intf, ilmi_fd[intf], PDU_Types[buf[14] - 0xA0] ); {
- if ( Debug_Level > 2 )
- hexdump ( (caddr_t)&buf[1], n );
- }
- bpp = (caddr_t)&buf[1];
- if ( ( Hdr = asn_get_header ( &bpp ) ) == NULL )
- continue;
-
- /* What we do with this messages depends upon the state we're in */
- switch ( ilmi_state[intf] ) {
- case ILMI_COLDSTART:
- /* We should never be in this state here */
- free_pdu ( Hdr );
- break;
- case ILMI_INIT:
- /* The only messages we care about are GETNEXTs, GETRESPs, and TRAPs */
- switch ( Hdr->pdutype ) {
- case PDU_TYPE_GETNEXT:
- /*
- * Should be because the remote side is attempting
- * to verify that our table is empty
- */
- if ( oid_ncmp ( (caddr_t)&Hdr->head->oid,
- (caddr_t)&Objids[ADDRESS_OBJID],
- Objids[ADDRESS_OBJID].oid[0] ) == 0 ) {
- if ( addressEntry[intf].oid[0] ) {
- /* XXX - FIXME */
- /* Our table is not empty - return address */
- }
- }
- build_pdu ( Hdr, PDU_TYPE_GETRESP );
- send_resp ( intf, Hdr, Resp_Buf );
- break;
- case PDU_TYPE_GETRESP:
- /*
- * This should be in response to our GETNEXT.
- * Check the OIDs and go onto ILMI_RUNNING if
- * the address table is empty. We can cheat and
- * not check sequence numbers because we only send
- * the one GETNEXT request and ILMI says we shouldn't
- * have interleaved sessions.
- */
- /*
- * First look for empty table. If found, go to next state.
- */
- if ( oid_ncmp ( &Objids[ADDRESS_OBJID], &Hdr->head->oid,
- Objids[ADDRESS_OBJID].oid[0] ) == 1 ) {
- ilmi_state[intf] = ILMI_RUNNING; /* ILMI_REG; */
- } else {
- /*
- * Check to see if this matches our address
- * and if so, that it's a VALID entry.
- */
- Atm_addr *aa;
- int l;
- int match = 1;
-
- aa = &Intf[intf].anp_addr;
- if ( aa->address_length == Hdr->head->oid.oid[13] ) {
- for ( l = 0; l < aa->address_length; l++ ) {
- if ( (int)((u_char *)(aa->address))[l] !=
- Hdr->head->oid.oid[14 + l] ) {
- match = 0;
- }
- }
- }
- if ( match ) {
- if ( Hdr->head->var.ival == 1 ) {
- ilmi_state[intf] = ILMI_RUNNING;
- }
- }
- }
- free_pdu ( Hdr );
- break;
- case PDU_TYPE_SET:
- /* Look for SET_PREFIX Objid */
- if ( oid_ncmp ( (caddr_t)&Hdr->head->oid,
- (caddr_t)&Objids[SETPFX_OBJID],
- Objids[SETPFX_OBJID].oid[0] ) == 0 ) {
- set_prefix ( &Hdr->head->oid, Hdr, intf );
- /* Reply to SET before sending our ADDRESS */
- build_pdu(Hdr, PDU_TYPE_GETRESP);
- send_resp( intf, Hdr, Resp_Buf );
- set_address ( Hdr, intf );
- } else {
- build_pdu(Hdr, PDU_TYPE_GETRESP);
- send_resp( intf, Hdr, Resp_Buf );
- }
- break;
- case PDU_TYPE_TRAP:
- /* Remote side wants us to start fresh */
- free_pdu ( Hdr );
- break;
- default:
- /* Ignore */
- free_pdu ( Hdr );
- break;
- }
- break;
- case ILMI_REG:
- break;
- case ILMI_RUNNING:
- /* We'll take anything here */
- switch ( Hdr->pdutype ) {
- case PDU_TYPE_GET:
- process_get ( Hdr, intf );
- break;
- case PDU_TYPE_GETRESP:
- /* Ignore GETRESPs */
- free_pdu ( Hdr );
- break;
- case PDU_TYPE_GETNEXT:
- build_pdu ( Hdr, PDU_TYPE_GETRESP );
- send_resp ( intf, Hdr, Resp_Buf );
- break;
- case PDU_TYPE_SET:
- /* Look for SET_PREFIX Objid */
- if ( oid_ncmp ( (caddr_t)&Hdr->head->oid,
- (caddr_t)&Objids[SETPFX_OBJID],
- Objids[SETPFX_OBJID].oid[0] ) == 0 ) {
- set_prefix ( &Hdr->head->oid, Hdr, intf );
- /* Reply to SET before sending our ADDRESS */
- build_pdu(Hdr, PDU_TYPE_GETRESP);
- send_resp( intf, Hdr, Resp_Buf );
- set_address ( Hdr, intf );
- } else {
- build_pdu(Hdr, PDU_TYPE_GETRESP);
- send_resp( intf, Hdr, Resp_Buf );
- }
- break;
- case PDU_TYPE_TRAP:
- free_pdu ( Hdr );
- break;
- }
- break;
- default:
- /* Unknown state */
- free_pdu ( Hdr );
- break;
- }
- } /* if n > 0 */
- } /* if received message */
- } /* for each interface */
- } /* for ever loop */
-
-}
-
-int
main ( argc, argv )
int argc;
char *argv[];
{
+ u_char buf[256], set_buf[256];
+ char community[1024];
+ u_char *bufp;
+ int s;
int c;
+ int foregnd = 0; /* run in the foreground? */
+ int pdulen;
+ int version;
+ int pdutype;
+ int reqid;
+ int error_status;
+ int error_ptr;
+ int b;
int i;
+ int lerr = 0;
int Reset = 0; /* Should we send a coldStart and exit? */
+ Snmp_Header *Hdr;
+ int n;
/*
* What are we running as? (argv[0])
@@ -2460,10 +2248,34 @@ main ( argc, argv )
* If we're not doing debugging, run in the background
*/
if ( foregnd == 0 ) {
+#ifdef sun
+ int pid, fd;
+
+ if ( ( pid = fork() ) < 0 ) {
+ fprintf ( stderr, "fork failed\n" );
+ exit ( 1 );
+ } else if (pid != 0) {
+ /* Parent process - exit and allow child to run */
+ exit ( 0 );
+ }
+ /* Child process */
+ if ( ( lerr = setpgrp ( 0, getpid() ) ) < 0 ) {
+ fprintf ( stderr, "Can't set process group" );
+ exit ( 1 );
+ }
+ if ( ( fd = open ( "/dev/tty", O_RDWR ) ) >= 0 ) {
+ ioctl ( fd, TIOCNOTTY, (char *)NULL );
+ close ( fd );
+ }
+ /* close all open descriptors */
+ for ( fd = 3; fd < getdtablesize(); fd++ )
+ close ( fd );
+#else
if ( daemon ( 0, 0 ) )
err ( 1, "Can't fork" );
+#endif
} else
- ; /* setbuf ( stdout, NULL ); */
+ setbuf ( stdout, NULL );
signal ( SIGUSR1, Increment_DL );
signal ( SIGUSR2, Decrement_DL );
@@ -2471,16 +2283,11 @@ main ( argc, argv )
/*
* Open log file
*/
- if ( Debug_Level ) {
- if ( foregnd ) {
- Log = stderr;
- } else {
- if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL )
- Log = NULL;
- }
- }
- if ( Log )
- setbuf ( Log, NULL );
+ if ( Debug_Level )
+ if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL )
+ Log = NULL;
+ else
+ setbuf ( Log, NULL );
/*
* Get our startup time
@@ -2489,13 +2296,12 @@ main ( argc, argv )
starttime.tv_sec--;
starttime.tv_usec += 1000000;
- /* Randomize starting request ID */
- Req_ID = starttime.tv_sec;
-
/*
* Reset all the interface descriptors
*/
for ( i = 0; i < MAX_UNITS; i++ ) {
+ trap_fd[i] = -1;
+ last_trap[i] = (time_t)0;
ilmi_fd[i] = -1;
}
/*
@@ -2508,23 +2314,497 @@ main ( argc, argv )
*/
if ( Reset ) {
for ( i = 0; i < MAX_UNITS; i++ )
- if ( ilmi_fd[i] >= 0 ) {
- /* Build ColdStart TRAP header */
- ColdStart_Header = build_cold_start();
- build_pdu ( ColdStart_Header, PDU_TYPE_TRAP );
- send_resp ( i, ColdStart_Header, Resp_Buf );
+ if ( trap_fd[i] >= 0 ) {
if ( Debug_Level > 1 && Log ) {
write_timestamp();
- fprintf ( Log, "Close ilmi_fd[%d]: %d\n",
- i, ilmi_fd[i] );
+ fprintf ( Log, "Close trap_fd[%d]: %d\n",
+ i, trap_fd[i] );
}
- close ( ilmi_fd[i] );
+ close ( trap_fd[i] );
}
exit ( 2 );
}
- ilmi_do_state();
+ /*
+ * For ever...
+ */
+ for ( ; ; ) {
+ int maxfd = 0;
+ int count;
+ struct timeval tvp;
+ fd_set rfd;
+ time_t curtime;
+
+ ilmi_open();
+
+ /*
+ * SunOS CC doesn't allow automatic aggregate initialization.
+ * Make everybody happy and do it here...
+ */
+ tvp.tv_sec = 15;
+ tvp.tv_usec = 0;
+
+ curtime = time ( (time_t *)NULL );
+
+ /*
+ * Check for TRAP messages
+ */
+ FD_ZERO ( &rfd );
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "Check Traps: " );
+ }
+ for ( i = 0; i < MAX_UNITS; i++ ) {
+ if ( Debug_Level > 1 && Log )
+ fprintf ( Log, "trap_fd[%d]: %d ", i, trap_fd[i] );
+ if ( trap_fd[i] != -1 ) {
+ /*
+ * If we haven't sent a coldStart trap recently,
+ * send one now
+ */
+ if ( last_trap[i] + TRAP_TIME < curtime ) {
+ last_trap[i] = curtime;
+ /*
+ * Send coldStart TRAP
+ */
+ if ( Debug_Level > 4 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "===== Sent %d bytes =====\n",
+ coldStart_Trap[0] );
+ hexdump ( (u_char *)&coldStart_Trap[1],
+ coldStart_Trap[0] );
+ }
+ if ( Debug_Level && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend coldStart TRAP to unit %d\n", i );
+ }
+ write ( trap_fd[i], (caddr_t)&coldStart_Trap[1],
+ coldStart_Trap[0] );
+ }
+ if ( (trap_fd[i] >= 0) &&
+ FD_SET ( trap_fd[i], &rfd )) {
+ maxfd = MAX ( maxfd, trap_fd[i] );
+ }
+ }
+ }
+ if ( Debug_Level > 1 && Log )
+ fprintf ( Log, "maxfd: %d\n", maxfd );
+
+ if ( maxfd ) {
+ count = select ( maxfd + 1, &rfd, NULL, NULL, &tvp );
+
+ if ( count > 0 ) {
+ for ( i = 0; i < MAX_UNITS; i++ ) {
+ if ( trap_fd[i] >= 0 && FD_ISSET ( trap_fd[i], &rfd ) ) {
+ s = trap_fd[i];
+
+ n = read ( s, (caddr_t)&buf[1], sizeof(buf) - 1 );
+ if ( n == -1 && ( errno == ECONNRESET ||
+ errno == EBADF ) ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "Bad read: close trap_fd[%d]: %d\n",
+ i, trap_fd[i] );
+ }
+ close ( trap_fd[i] );
+ trap_fd[i] = -1;
+ ilmi_fd[i] = -1;
+ }
+ if ( n ) {
+ buf[0] = n;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "***** Read %d bytes *****\n",
+ n );
+ hexdump ( (caddr_t)&buf[1], n );
+ }
+ bufp = buf;
+ /*
+ * Skip length byte
+ */
+ bufp++;
+ /*
+ * Crack the header
+ */
+ if ( ( Hdr = asn_get_header ( &bufp ) ) == NULL )
+ continue;
+ pdutype = Hdr->pdutype;
+ /*
+ * Only interested in TRAP messages
+ */
+ switch ( pdutype ) {
+ /*
+ * FORE switches often go straight to SET prefix
+ * after receiving a coldStart TRAP from us
+ */
+ case PDU_TYPE_SET:
+ /*
+ * Make a copy of this PDU so that a
+ * SET NSAP prefix can reply to it.
+ */
+ UM_COPY ( buf, set_buf, sizeof(buf) );
+
+ lerr = process_set ( &bufp );
+ /*
+ * Can't do a simple oid_cmp since we
+ * don't yet know what the prefix is.
+ * If it looks like a SET netPrefix.0,
+ * then compare the portion leading up
+ * to the NSAP prefix part.
+ */
+ if ( oid.oid[0] == 26 ) {
+ oid.oid[0] = 12;
+ if ( oid_cmp ( &setprefix, &oid ) == 0 ) {
+ oid.oid[0] = 26;
+ set_prefix ( &oid, Hdr, set_buf, s );
+ }
+ }
+ /*
+ * We now move from awaiting TRAP to processing ILMI
+ */
+ ilmi_fd[i] = trap_fd[i];
+ trap_fd[i] = -1;
+ break;
+ case PDU_TYPE_TRAP:
+ lerr = process_trap ( &bufp, trap_fd[i] );
+ /*
+ * We now move from awaiting TRAP to processing ILMI
+ */
+ ilmi_fd[i] = trap_fd[i];
+ trap_fd[i] = -1;
+ break;
+ }
+ } /* if n */
+ } /* if FD_ISSET */
+ } /* for i */
+ } /* if count */
+ }
+
+ /*
+ * Reset from TRAP checking
+ */
+ maxfd = 0;
+ errno = 0;
+ /*
+ * Check for ILMI messages
+ */
+ FD_ZERO ( &rfd );
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "Check Ilmis: " );
+ }
+ for ( i = 0; i < MAX_UNITS; i++ ) {
+ if ( Debug_Level > 1 && Log )
+ fprintf ( Log, "ilmi_fd[%d]: %d ", i, ilmi_fd[i] );
+ if ( ilmi_fd[i] != -1 ) {
+ if ( (ilmi_fd[i] >= 0) &&
+ FD_SET ( ilmi_fd[i], &rfd )) {
+ maxfd = MAX ( maxfd, ilmi_fd[i] );
+ }
+ }
+ }
+ if ( Debug_Level > 1 && Log )
+ fprintf ( Log, "maxfd: %d\n", maxfd );
+
+ if ( maxfd ) {
+ count = select ( maxfd + 1, &rfd, NULL, NULL, &tvp );
+
+ if ( count > 0 ) {
+ for ( i = 0; i < MAX_UNITS; i++ ) {
+ if ( ilmi_fd[i] >= 0 && FD_ISSET ( ilmi_fd[i], &rfd ) ) {
+
+ s = ilmi_fd[i];
+
+ n = read ( s, (caddr_t)&buf[1], sizeof(buf) - 1 );
+ if ( n == -1 && ( errno == ECONNRESET ||
+ errno == EBADF ) ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "Bad read: close ilmi_fd[%d]: %d\n",
+ i, ilmi_fd[i] );
+ }
+ close ( ilmi_fd[i] );
+ trap_fd[i] = -1;
+ ilmi_fd[i] = -1;
+ }
+ if ( n ) {
+ buf[0] = n;
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "***** Read %d bytes *****\n",
+ n );
+ hexdump ( (caddr_t)&buf[1], n );
+ }
+ bufp = buf;
+ /*
+ * Skip length byte
+ */
+ bufp++;
+ /*
+ * Crack the header
+ */
+ if ( ( Hdr = asn_get_header ( &bufp ) )
+ == NULL )
+ continue;
+ pdutype = Hdr->pdutype;
+
+ /*
+ * Do the operation...
+ */
+ switch ( pdutype ) {
+
+ case PDU_TYPE_GET:
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "GET:: " );
+ }
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ lerr = 1;
+ break;
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ lerr = 1;
+ break;
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be OBJID
+ */
+ if ( *bufp++ != ASN_OBJID ) {
+ lerr = 1;
+ break;
+ }
+ asn_get_objid ( &bufp, &oid );
+ /*
+ * Ended with a NULL
+ */
+ bufp++;
+ bufp++;
+ /*
+ * If GET sysObjId.0
+ */
+ if (oid_cmp(&sysObjId, &oid) == 0 ) {
+ send_resp ( s, Hdr->reqid,
+ sysObjId_Resp );
+
+ } else
+ /*
+ * If GET sysUpTime.0
+ */
+ if (oid_cmp(&sysUpTime, &oid) == 0 ) {
+ send_uptime_resp ( s,
+ Hdr->reqid );
+ } else
+ /*
+ * If GET myIpNm.0
+ */
+ if ( oid_cmp ( &myipnm, &oid ) == 0 ) {
+ send_myipnm ( s, Hdr );
+ } else
+ /*
+ * If GET uniType.0
+ */
+ if ( oid_cmp ( &unitype, &oid ) == 0 ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend uniType\n" );
+ }
+ send_resp ( s, Hdr->reqid,
+ UniType_Resp );
+ } else
+ /*
+ * If GET uniVer.0
+ */
+ if ( oid_cmp ( &univer, &oid ) == 0 ) {
+ int p = UniVer_Resp[0];
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend uniVer\n" );
+ }
+ switch (Intf[i].anp_sig_proto) {
+ case ATM_SIG_UNI30:
+ UniVer_Resp[p] =
+ UNIVER_UNI30;
+ break;
+ case ATM_SIG_UNI31:
+ UniVer_Resp[p] =
+ UNIVER_UNI31;
+ break;
+ case ATM_SIG_UNI40:
+ UniVer_Resp[p] =
+ UNIVER_UNI40;
+ break;
+ }
+ send_resp ( s, Hdr->reqid,
+ UniVer_Resp );
+ } else
+ /*
+ * If GET devType.0
+ */
+ if ( oid_cmp ( &devtype, &oid ) == 0 ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend devType\n" );
+ }
+ send_resp ( s, Hdr->reqid,
+ DevType_Resp );
+ } else
+ /*
+ * If GET foreSigGrp....0
+ */
+ if (oid_cmp(&foresiggrp, &oid) == 0) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend noSuchVar\n" );
+ }
+ send_resp ( s, Hdr->reqid,
+ NoSuchFore_Resp );
+ } else
+ if ( oid_cmp(&layeridx, &oid) == 0 ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\t*** LayerIndex\n" );
+ }
+ } else
+ if ( oid_cmp(&maxvcc, &oid) == 0 ) {
+ send_resp ( s, Hdr->reqid,
+ maxVCC_Resp );
+ } else
+ if ( oid_cmp ( &portidx, &oid ) == 0 ) {
+ int p = PortIndex_Resp[0];
+ PortIndex_Resp[p] = i + 1;
+ send_resp ( s, Hdr->reqid,
+ PortIndex_Resp );
+ } else
+ send_no_such ( s, Hdr, &oid );
+ break;
+
+ case PDU_TYPE_GETNEXT:
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log, "GET_NEXT:: " );
+ }
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ lerr = 1;
+ break;
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be SEQUENCE OF
+ */
+ if ( *bufp++ != ASN_SEQUENCE ) {
+ lerr = 1;
+ break;
+ }
+ pdulen = asn_get_pdu_len ( &bufp );
+ /*
+ * Should be OBJID
+ */
+ if ( *bufp++ != ASN_OBJID ) {
+ lerr = 1;
+ break;
+ }
+ asn_get_objid ( &bufp, &oid );
+ /*
+ * Ended with a NULL
+ */
+ bufp++;
+ bufp++;
+ /*
+ * If this is a GET_NEXT netPrefix then
+ * the other side probably restarted
+ * and is looking for a table empty
+ * indication before restarting the
+ * ILMI protocol.
+ */
+ if ( oid_cmp(&netpfx_oid, &oid) == 0 ) {
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "\tSend GET_RESP:\n" );
+ }
+ send_resp ( s, Hdr->reqid,
+ GetNext_Resp );
+ }
+ break;
+
+ case PDU_TYPE_GETRESP:
+ if ( Debug_Level > 1 && Log ) {
+ write_timestamp();
+ fprintf ( Log,
+ "GET_RESP:: \n" );
+ }
+ /*
+ * Ignore any responses to our GETs.
+ * (We don't send any GETs.)
+ */
+ break;
+
+ case PDU_TYPE_SET:
+ /*
+ * Make a copy of this PDU so that a
+ * SET NSAP prefix can reply to it.
+ */
+ UM_COPY ( buf, set_buf, sizeof(buf) );
+
+ if ( process_set ( &bufp ) < 0 )
+ break;
+
+ /*
+ * Can't do a simple oid_cmp since we
+ * don't know what the prefix is yet.
+ * If it looks like a SET netPrefix.0,
+ * then compare the portion leading up
+ * to the NSAP prefix part.
+ */
+ if ( oid.oid[0] == 26 ) {
+ oid.oid[0] = 12;
+ if ( oid_cmp(&setprefix,&oid)
+ == 0 ) {
+ oid.oid[0] = 26;
+ set_prefix ( &oid, Hdr,
+ set_buf, s );
+ }
+ }
+ break;
+
+ case PDU_TYPE_TRAP:
+ lerr = process_trap ( &bufp, s );
+ break;
+ }
+ /*
+ * Forget about this PDU
+ */
+ free ( Hdr );
+ Hdr = NULL;
- exit(0);
+ } /* end of read(s) */
+ } /* end if FD_ISSET(s) */
+ } /* end of for ( i... */
+ } /* end of if ( count ) */
+ } else {
+ sleep ( SLEEP_TIME );
+ }
+ } /* end of for ever */
+
}
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index 1ab0f8ffc3bc..641797df9e2c 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: camcontrol.8,v 1.8 1998/12/02 22:42:36 billf Exp $
+.\" $Id: camcontrol.8,v 1.6 1998/10/03 19:15:53 ken Exp $
.\"
.Dd September 14, 1998
.Dt CAMCONTROL 8
@@ -67,9 +67,6 @@ eject
rescan
.Aq bus Ns Op :target:lun
.Nm camcontrol
-reset
-.Aq bus Ns Op :target:lun
-.Nm camcontrol
defects
.Op generic args
.Aq Fl f Ar format
@@ -79,7 +76,7 @@ defects
modepage
.Op generic args
.Aq Fl m Ar page
-.Op Fl P Ar pgctl
+.Op Fl P Ar pagectl
.Op Fl e
.Op Fl d
.Nm camcontrol
@@ -187,12 +184,6 @@ Tell the kernel to scan the given bus (XPT_SCAN_BUS), or bus:target:lun
(XPT_SCAN_LUN) for new devices or devices that have gone away. The user
may only specify a bus to scan, or a lun. Scanning all luns on a target
isn't supported.
-.It reset
-Tell the kernel to reset the given bus (XPT_RESET_BUS) by issuing a SCSI bus
-reset for that bus, or to reset the given bus:target:lun
-(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
-connecting to that device. Note that this can have a destructive impact
-on the system.
.It defects
Send the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and
print out any combination of: the total number of defects, the primary
@@ -246,7 +237,7 @@ This flag allows the user to edit values in the mode page.
.It Fl m Ar mode_page
This specifies the number of the mode page the user would like to view
and/or edit. This argument is mandatory.
-.It Fl P Ar pgctl
+.It Fl P page_ctl
This allows the user to specify the page control field. Possible values are:
.Bl -tag -width xxx -compact
.It 0
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index fb2f05e943a5..3403b39eea84 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: camcontrol.c,v 1.8 1998/12/20 20:32:34 mjacob Exp $
+ * $Id: camcontrol.c,v 1.4 1998/10/13 16:23:26 ken Exp $
*/
#include <sys/ioctl.h>
@@ -64,7 +64,6 @@ typedef enum {
CAM_ARG_DEVTREE = 0x00000009,
CAM_ARG_USAGE = 0x0000000a,
CAM_ARG_DEBUG = 0x0000000b,
- CAM_ARG_RESET = 0x0000000c,
CAM_ARG_OPT_MASK = 0x0000000f,
CAM_ARG_VERBOSE = 0x00000010,
CAM_ARG_DEVICE = 0x00000020,
@@ -116,7 +115,6 @@ struct camcontrol_opts option_table[] = {
{"stop", CAM_ARG_STARTSTOP, NULL},
{"eject", CAM_ARG_STARTSTOP | CAM_ARG_EJECT, NULL},
{"rescan", CAM_ARG_RESCAN, NULL},
- {"reset", CAM_ARG_RESET, NULL},
{"cmd", CAM_ARG_SCSI_CMD, scsicmd_opts},
{"command", CAM_ARG_SCSI_CMD, scsicmd_opts},
{"defects", CAM_ARG_READ_DEFECTS, readdefect_opts},
@@ -152,9 +150,9 @@ static int scsidoinquiry(struct cam_device *device, int argc, char **argv,
static int scsiinquiry(struct cam_device *device, int retry_count, int timeout);
static int scsiserial(struct cam_device *device, int retry_count, int timeout);
static int scsixferrate(struct cam_device *device);
-static int dorescan_or_reset(int argc, char **argv, int rescan);
-static int rescan_or_reset_bus(int bus, int rescan);
-static int scanlun_or_reset_dev(int bus, int target, int lun, int scan);
+static int dorescan(int argc, char **argv);
+static int rescanbus(int bus);
+static int scanlun(int bus, int target, int lun);
static int readdefects(struct cam_device *device, int argc, char **argv,
char *combinedopt, int retry_count, int timeout);
static void modepage(struct cam_device *device, int argc, char **argv,
@@ -350,9 +348,6 @@ getdevtree(void)
dev_result->path_id,
dev_result->target_id,
dev_result->target_lun);
-
- need_close = 1;
-
break;
}
case DEV_MATCH_PERIPH: {
@@ -361,14 +356,14 @@ getdevtree(void)
periph_result =
&ccb.cdm.matches[i].result.periph_result;
- if (need_close > 1)
+ if (need_close)
fprintf(stdout, ",");
fprintf(stdout, "%s%d",
periph_result->periph_name,
periph_result->unit_number);
- need_close++;
+ need_close = 1;
break;
}
default:
@@ -802,16 +797,14 @@ scsixferrate(struct cam_device *device)
}
static int
-dorescan_or_reset(int argc, char **argv, int rescan)
+dorescan(int argc, char **argv)
{
- static const char *must =
- "you must specify a bus, or a bus:target:lun to %s";
int error = 0;
int bus = -1, target = -1, lun = -1;
char *tstr, *tmpstr = NULL;
if (argc < 3) {
- warnx(must, rescan? "rescan" : "reset");
+ warnx("you must specify a bus, or a bus:target:lun to rescan");
return(1);
}
/*
@@ -840,12 +833,13 @@ dorescan_or_reset(int argc, char **argv, int rescan)
arglist |= CAM_ARG_LUN;
} else {
error = 1;
- warnx(must, rescan? "rescan" : "reset");
+ warnx("you must specify either a bus or");
+ warnx("a bus, target and lun for rescanning");
}
}
} else {
error = 1;
- warnx(must, rescan? "rescan" : "reset");
+ warnx("you must at least specify a bus to rescan");
}
@@ -853,19 +847,20 @@ dorescan_or_reset(int argc, char **argv, int rescan)
if ((arglist & CAM_ARG_BUS)
&& (arglist & CAM_ARG_TARGET)
&& (arglist & CAM_ARG_LUN))
- error = scanlun_or_reset_dev(bus, target, lun, rescan);
+ error = scanlun(bus, target, lun);
else if (arglist & CAM_ARG_BUS)
- error = rescan_or_reset_bus(bus, rescan);
+ error = rescanbus(bus);
else {
error = 1;
- warnx(must, rescan? "rescan" : "reset");
+ warnx("you must specify either a bus or");
+ warnx("a bus, target and lun for rescanning");
}
}
return(error);
}
static int
-rescan_or_reset_bus(int bus, int rescan)
+rescanbus(int bus)
{
union ccb ccb;
int fd;
@@ -881,7 +876,7 @@ rescan_or_reset_bus(int bus, int rescan)
return(1);
}
- ccb.ccb_h.func_code = rescan? XPT_SCAN_BUS : XPT_RESET_BUS;
+ ccb.ccb_h.func_code = XPT_SCAN_BUS;
ccb.ccb_h.path_id = bus;
ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
ccb.ccb_h.target_lun = CAM_LUN_WILDCARD;
@@ -899,19 +894,17 @@ rescan_or_reset_bus(int bus, int rescan)
close(fd);
if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
- fprintf(stdout, "%s of bus %d was successful\n",
- rescan? "Re-scan" : "Reset", bus);
+ fprintf(stdout, "Re-scan of bus %d was successful\n", bus);
return(0);
} else {
- fprintf(stdout, "%s of bus %d returned error %#x\n",
- rescan? "Re-scan" : "Reset", bus,
- ccb.ccb_h.status & CAM_STATUS_MASK);
+ fprintf(stdout, "Re-scan of bus %d returned error %#x\n",
+ bus, ccb.ccb_h.status & CAM_STATUS_MASK);
return(1);
}
}
static int
-scanlun_or_reset_dev(int bus, int target, int lun, int scan)
+scanlun(int bus, int target, int lun)
{
union ccb ccb;
int fd;
@@ -938,7 +931,7 @@ scanlun_or_reset_dev(int bus, int target, int lun, int scan)
return(1);
}
- ccb.ccb_h.func_code = (scan)? XPT_SCAN_LUN : XPT_RESET_DEV;
+ ccb.ccb_h.func_code = XPT_SCAN_LUN;
ccb.ccb_h.path_id = bus;
ccb.ccb_h.target_id = target;
ccb.ccb_h.target_lun = lun;
@@ -956,13 +949,12 @@ scanlun_or_reset_dev(int bus, int target, int lun, int scan)
close(fd);
if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
- fprintf(stdout, "%s of %d:%d:%d was successful\n",
- scan? "Re-scan" : "Reset", bus, target, lun);
+ fprintf(stdout, "Re-scan of %d:%d:%d was successful\n",
+ bus, target, lun);
return(0);
} else {
- fprintf(stdout, "%s of %d:%d:%d returned error %#x\n",
- scan? "Re-scan" : "Reset", bus, target, lun,
- ccb.ccb_h.status & CAM_STATUS_MASK);
+ fprintf(stdout, "Re-scan of %d:%d:%d returned error %#x\n",
+ bus, target, lun, ccb.ccb_h.status & CAM_STATUS_MASK);
return(1);
}
}
@@ -1797,7 +1789,6 @@ usage(void)
" camcontrol stop [generic args]\n"
" camcontrol eject [generic args]\n"
" camcontrol rescan <bus[:target:lun]>\n"
-" camcontrol reset <bus[:target:lun]>\n"
" camcontrol defects [generic args] <-f format> [-P][-G]\n"
" camcontrol modepage [generic args] <-m page> [-P pagectl][-e][-d]\n"
" camcontrol cmd [generic args] <-c cmd [args]> \n"
@@ -1812,7 +1803,6 @@ usage(void)
"stop send a Stop Unit command to the device\n"
"eject send a Stop Unit command to the device with the eject bit set\n"
"rescan rescan the given bus, or bus:target:lun\n"
-"reset reset the given bus, or bus:target:lun\n"
"defects read the defect list of the specified device\n"
"modepage display or edit (-e) the given mode page\n"
"cmd send the given scsi command, may need -i or -o as well\n"
@@ -1999,8 +1989,7 @@ main(int argc, char **argv)
* commands, we don't use a passthrough device at all, just the
* transport layer device.
*/
- if (((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_RESCAN)
- && ((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_RESET)
+ if (((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_RESCAN)
&& ((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_DEVTREE)
&& ((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_USAGE)
&& ((arglist & CAM_ARG_OPT_MASK) != CAM_ARG_DEBUG)) {
@@ -2011,7 +2000,7 @@ main(int argc, char **argv)
}
/*
- * Reset optind to 2, and reset getopt, so these routines can parse
+ * Reset optind to 2, and reset getopt, so these routines cam parse
* the arguments again.
*/
optind = 2;
@@ -2037,10 +2026,7 @@ main(int argc, char **argv)
timeout);
break;
case CAM_ARG_RESCAN:
- error = dorescan_or_reset(argc, argv, 1);
- break;
- case CAM_ARG_RESET:
- error = dorescan_or_reset(argc, argv, 0);
+ error = dorescan(argc, argv);
break;
case CAM_ARG_READ_DEFECTS:
error = readdefects(cam_dev, argc, argv, combinedopt,
diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8
index cd0ffd4fa7b1..16974e3b505c 100644
--- a/sbin/ccdconfig/ccdconfig.8
+++ b/sbin/ccdconfig/ccdconfig.8
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: ccdconfig.8,v 1.5 1998/06/04 06:41:26 charnier Exp $
+.\" $Id$
.\"
.Dd July 17, 1995
.Dt CCDCONFIG 8
@@ -135,15 +135,15 @@ argument is optional.
#
.Pp
# ccd ileave flags component devices
-ccd0 16 none /dev/da2e /dev/da3e
+ccd0 16 none /dev/sd2e /dev/sd3e
.Ed
.Pp
.Sh EXAMPLE
The following command, executed from the command line, would configure ccd0
-with 4 components (/dev/da2e, /dev/da3e, /dev/da4e, /dev/da5e), and an
+with 4 components (/dev/sd2e, /dev/sd3e, /dev/sd4e, /dev/sd5e), and an
interleave factor of 32 blocks.
.Bd -unfilled -offset indent
-# ccdconfig ccd0 32 0 /dev/da2e /dev/da3e /dev/da4e /dev/da5e
+# ccdconfig ccd0 32 0 /dev/sd2e /dev/sd3e /dev/sd4e /dev/sd5e
.Ed
.Pp
.Sh FILES
diff --git a/sbin/disklabel/disklabel.5 b/sbin/disklabel/disklabel.5
index 7698a6331071..8090bdc5d53d 100644
--- a/sbin/disklabel/disklabel.5
+++ b/sbin/disklabel/disklabel.5
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)disklabel.5.5 8.1 (Berkeley) 6/5/93
-.\" $Id: disklabel.5,v 1.4 1998/06/04 06:49:12 charnier Exp $
+.\" $Id$
.\"
.Dd June 5, 1993
.Dt DISKLABEL 5
@@ -142,7 +142,7 @@ struct disklabel {
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
+ * as found in /usr/mdec. These are returned when using
* getdiskbyname(3)
to retrieve the values from /etc/disktab.
*/
diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8
index 9dfca468e1dd..91362465ec18 100644
--- a/sbin/disklabel/disklabel.8
+++ b/sbin/disklabel/disklabel.8
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94
-.\" $Id: disklabel.8,v 1.9 1998/11/28 09:43:31 rnordier Exp $
+.\" $Id: disklabel.8,v 1.7 1997/06/23 04:02:17 steve Exp $
.\"
.Dd April 19, 1994
.Dt DISKLABEL 8
@@ -116,7 +116,7 @@ option to install bootstrap code.
These variants are described later.
.Pp
The first form of the command (read) is used to examine the label on the named
-disk drive (e.g. da0 or /dev/rda0c).
+disk drive (e.g. sd0 or /dev/rsd0c).
It will display all of the parameters associated with the drive
and its partition layout.
Unless the
@@ -135,7 +135,7 @@ The second form of the command, with the
flag, is used to write a standard label on the designated drive.
The required arguments to
.Nm
-are the drive to be labeled (e.g. da0), and
+are the drive to be labeled (e.g. sd0), and
the drive type as described in the
.Xr disktab 5
file.
@@ -251,19 +251,25 @@ indicates the primary boot program and
the secondary boot program.
If the names are not explicitly given, standard boot programs will be used.
The boot programs are located in
-.Pa /boot .
+.Pa /usr/mdec .
The names of the programs are taken from the ``b0'' and ``b1'' parameters
of the
.Xr disktab 5
entry for the disk if
.Ar disktype
was given and its disktab entry exists and includes those parameters.
-Otherwise, the default boot image names are used, these being:
-.Pa /boot/boot1
+Otherwise, boot program names are derived from the name of the disk.
+These names are of the form
+.Pa basename Ns boot
+for the primary (or only) bootstrap, and
+.Pf boot Pa basename
+for the secondary bootstrap;
+for example,
+.Pa /usr/mdec/sdboot
and
-.Pa /boot/boot2
-for the standard stage1 and stage2 boot images (details may vary
-on architectures like the Alpha, where only a single-stage boot is used).
+.Pa /usr/mdec/bootsd
+if the disk device is
+.Em sd0 .
.Pp
The first of the three boot-installation forms is used to install
bootstrap code without changing the existing label.
@@ -275,55 +281,55 @@ except that they will install bootstrap code in addition to a new label.
.Sh FILES
.Bl -tag -width Pa -compact
.It Pa /etc/disktab
-.It Pa /boot/
-.It Pa /boot/boot<n>
+.It Pa /usr/mdec/ Ns Em xx Ns boot
+.It Pa /usr/mdec/boot Ns Em xx
.El
.Sh EXAMPLES
-.Dl disklabel da0
+.Dl disklabel sd0
.Pp
-Display the in-core label for da0 as obtained via
-.Pa /dev/rda0c .
+Display the in-core label for sd0 as obtained via
+.Pa /dev/rsd0c .
.Pp
-.Dl disklabel -w -r /dev/rda0c da2212 foo
+.Dl disklabel -w -r /dev/rsd0c sd2212 foo
.Pp
-Create a label for da0 based on information for ``da2212'' found in
+Create a label for sd0 based on information for ``sd2212'' found in
.Pa /etc/disktab .
Any existing bootstrap code will be clobbered.
.Pp
-.Dl disklabel -e -r da0
+.Dl disklabel -e -r sd0
.Pp
-Read the on-disk label for da0, edit it and reinstall in-core as well
+Read the on-disk label for sd0, edit it and reinstall in-core as well
as on-disk.
Existing bootstrap code is unaffected.
.Pp
-.Dl disklabel -r -w da0 auto
+.Dl disklabel -r -w sd0 auto
.Pp
-Try to auto-detect the required information from da0, and write a new
+Try to auto-detect the required information from sd0, and write a new
label to the disk. Use another disklabel -e command to edit the
partitioning and file system information.
.Pp
-.Dl disklabel -R da0 mylabel
+.Dl disklabel -R sd0 mylabel
.Pp
-Restore the on-disk and in-core label for da0 from information in
+Restore the on-disk and in-core label for sd0 from information in
.Pa mylabel .
Existing bootstrap code is unaffected.
.Pp
-.Dl disklabel -B da0
+.Dl disklabel -B sd0
.Pp
-Install a new bootstrap on da0.
+Install a new bootstrap on sd0.
The boot code comes from
-.Pa /boot/boot1
+.Pa /usr/mdec/sdboot
and possibly
-.Pa /boot/boot2 .
+.Pa /usr/mdec/bootsd .
On-disk and in-core labels are unchanged.
.Pp
-.Dl disklabel -w -B /dev/rda0c -b newboot da2212
+.Dl disklabel -w -B /dev/rsd0c -b newboot sd2212
.Pp
Install a new label and bootstrap.
-The label is derived from disktab information for ``da2212'' and
+The label is derived from disktab information for ``sd2212'' and
installed both in-core and on-disk.
The bootstrap code comes from the file
-.Pa /boot/newboot .
+.Pa /usr/mdec/newboot .
.Sh SEE ALSO
.Xr disklabel 5 ,
.Xr disktab 5
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index ff04e4b9d17c..be60d542768a 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#endif
static const char rcsid[] =
- "$Id: disklabel.c,v 1.23 1998/10/23 18:57:39 bde Exp $";
+ "$Id: disklabel.c,v 1.20 1998/08/21 23:44:16 gpalmer Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -76,6 +76,12 @@ static const char rcsid[] =
* for the label on such machines.
*/
+#ifdef tahoe
+#define RAWPARTITION 'a'
+#else
+#define RAWPARTITION 'c'
+#endif
+
#ifndef BBSIZE
#define BBSIZE 8192 /* size of boot area, with label */
#endif
@@ -226,7 +232,7 @@ main(argc, argv)
dkname = argv[0];
if (dkname[0] != '/') {
- (void)sprintf(np, "%sr%s%c", _PATH_DEV, dkname, 'a' + RAW_PART);
+ (void)sprintf(np, "%sr%s%c", _PATH_DEV, dkname, RAWPARTITION);
specname = np;
np += strlen(specname) + 1;
} else
@@ -477,7 +483,7 @@ l_perror(s)
case ESRCH:
warnx("%s: no disk label on disk;", s);
fprintf(stderr,
- "use \"disklabel -r\" to install initial label\n");
+ "use \"disklabel -r\" to install initial label\n");
break;
case EINVAL:
@@ -490,8 +496,8 @@ l_perror(s)
break;
case EXDEV:
- warnx("%s: '%c' partition must start at beginning of disk",
- s, 'a' + RAW_PART);
+ warnx(
+ "%s: labeled partition or 'a' partition must start at beginning of disk", s);
break;
default:
@@ -595,13 +601,25 @@ makebootarea(boot, dp, f)
*np++ = '\0';
if (!xxboot) {
- (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR);
- xxboot = boot0;
+ (void)sprintf(np, "%s/%sboot",
+ _PATH_BOOTDIR, dkbasename);
+ if (access(np, F_OK) < 0 && dkbasename[0] == 'r')
+ dkbasename++;
+ xxboot = np;
+ (void)sprintf(xxboot, "%s/%sboot",
+ _PATH_BOOTDIR, dkbasename);
+ np += strlen(xxboot) + 1;
}
#if NUMBOOT > 1
if (!bootxx) {
- (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR);
- bootxx = boot1;
+ (void)sprintf(np, "%s/boot%s",
+ _PATH_BOOTDIR, dkbasename);
+ if (access(np, F_OK) < 0 && dkbasename[0] == 'r')
+ dkbasename++;
+ bootxx = np;
+ (void)sprintf(bootxx, "%s/boot%s",
+ _PATH_BOOTDIR, dkbasename);
+ np += strlen(bootxx) + 1;
}
#endif
}
diff --git a/sbin/disklabel/pathnames.h b/sbin/disklabel/pathnames.h
index a24bdefe68d1..def3297d205e 100644
--- a/sbin/disklabel/pathnames.h
+++ b/sbin/disklabel/pathnames.h
@@ -35,6 +35,6 @@
#include <paths.h>
-#define _PATH_BOOTDIR "/boot"
+#define _PATH_BOOTDIR "/usr/mdec"
#undef _PATH_TMP
#define _PATH_TMP "/tmp/EdDk.aXXXXXX"
diff --git a/sbin/dset/Makefile b/sbin/dset/Makefile
new file mode 100644
index 000000000000..ce15a61510aa
--- /dev/null
+++ b/sbin/dset/Makefile
@@ -0,0 +1,7 @@
+PROG= dset
+DPADD= ${LIBKVM}
+LDADD= -lkvm
+CFLAGS+=-I${.CURDIR}/../../sys/
+MAN8= dset.8
+
+.include <bsd.prog.mk>
diff --git a/sbin/dset/dset.8 b/sbin/dset/dset.8
new file mode 100644
index 000000000000..ed88d4ed06b7
--- /dev/null
+++ b/sbin/dset/dset.8
@@ -0,0 +1,78 @@
+.\"
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
+.\"
+.\" $Id: dset.8,v 1.6 1997/02/22 14:32:15 peter Exp $
+.\" "
+.Dd May 2, 1996
+.Dt DSET 8
+.Os FreeBSD
+.Sh NAME
+.Nm dset
+.Nd "update the boot file to the current configuration"
+.Sh SYNOPSIS
+.Nm dset
+.Op Fl vqt
+.Sh DESCRIPTION
+.Nm Dset
+records the configuration changes for ISA devices that have been made
+from
+.Em UserConfig
+after booting with the
+.Fl c
+option. The changes (if any) are recorded to the file name returned by
+.Xr getbootfile 3 .
+.Nm Dset
+is typically called from within
+.Pa /etc/rc .
+.Pp
+.Nm Dset
+understands the following options:
+.Bl -tag -width indent -compact
+.It Fl v
+Verbose; tell what is being done.
+.It Fl q
+Quiet; don't print any error messages.
+.It Fl t
+Test only; don't actually record any changes to the boot file, print
+only what would have been done. This implies
+.Fl v .
+.El
+.Sh DIAGNOSTICS
+The
+.Nm
+utility exits with status 0 on success, or with status 1 if any
+problem occurred. Unless
+.Fl q
+has been specified, a short message hinting to the cause of the problem
+will be printed to standard error output.
+.Sh SEE ALSO
+.Xr getbootfile 3 ,
+.Xr boot_i386 8 ,
+.Xr rc 8
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.Fx 2.0.5 .
diff --git a/sbin/dset/dset.c b/sbin/dset/dset.c
new file mode 100644
index 000000000000..210e92aa053b
--- /dev/null
+++ b/sbin/dset/dset.c
@@ -0,0 +1,433 @@
+/*
+ * Copyright (c) 1995 Ugen J.S.Antsilevich
+ *
+ * Redistribution and use in source forms, with and without modification,
+ * are permitted provided that this entire comment appears intact.
+ *
+ * Redistribution in binary form may occur without any restrictions.
+ * Obviously, it would be nice if you gave credit where credit is due
+ * but requiring it would be too onerous.
+ *
+ * This software is provided ``AS IS'' without any warranties of any kind.
+ *
+ * Device configuration to kernel image saving utility.
+ */
+
+#ifndef lint
+static const char rcsid[] =
+ "$Id: dset.c,v 1.13 1998/06/28 19:06:17 bde Exp $";
+#endif /* not lint */
+
+#include <err.h>
+#include <fcntl.h>
+#include <kvm.h>
+#include <a.out.h>
+#include <limits.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include "i386/isa/isa_device.h"
+
+#include "i386/isa/pnp.h"
+struct pnp_cinfo new_ov[MAX_PNP_LDN];
+struct pnp_cinfo old_ov[MAX_PNP_LDN];
+
+#define TRUE 1
+#define FALSE 0
+
+struct nlist nl[] = {
+#define N_TABTTY 0
+ {"_isa_devtab_tty"},
+#define N_TABBIO 1
+ {"_isa_devtab_bio"},
+#define N_TABNET 2
+ {"_isa_devtab_net"},
+#define N_TABCAM 3
+ {"_isa_devtab_cam"},
+#define N_TABNULL 4
+ {"_isa_devtab_null"},
+ {""},
+};
+#define N_TABLAST N_TABNULL
+
+struct nlist nlk[] = {
+ {"_isa_devlist"},
+ {""},
+};
+
+struct nlist nlaux[] = {
+ {"_num_eisa_slots"},
+ {""},
+};
+
+struct nlist nlpnp[] = {
+ {"_pnp_ldn_overrides"},
+ {""},
+};
+
+struct nlist nlconfig[] = {
+ {"config.o"},
+ {""},
+};
+
+int quiet = FALSE;
+
+void
+fatal(name, str)
+ char *name, *str;
+{
+ if (quiet)
+ exit(1);
+ if (str)
+ errx(1, "%s: %s", name, str);
+ else
+ errx(1, "%s", name);
+}
+
+void
+error(name, str)
+ char *name, *str;
+{
+ if (quiet)
+ return;
+ if (str)
+ warnx("%s: %s", name, str);
+ else
+ warnx("%s", name);
+}
+
+void
+usage()
+{
+ fprintf(stderr, "usage: dset [-qtv]\n");
+ exit(1);
+}
+
+int
+main(ac, av)
+ int ac;
+ char **av;
+{
+ int f, res, s, i;
+ int modified,dev_found;
+ int sym;
+ u_long pos, entry, pos1, pos_t;
+ u_long flags;
+ struct isa_device buf, buf1;
+ struct isa_driver dbuf;
+ char nbuf[5];
+ struct stat fst;
+ struct exec es;
+ kvm_t *kd;
+ static char errb[_POSIX2_LINE_MAX];
+ const char *kernel = NULL;
+
+ char ch;
+ int testonly = FALSE;
+ int verbose = FALSE;
+
+ while ((ch = getopt(ac, av, "qtv")) != -1)
+ switch (ch) {
+ case 'q':
+ quiet = TRUE;
+ break;
+ case 't':
+ testonly = TRUE;
+ /* In test mode we want to be verbose */
+
+ case 'v':
+ verbose = TRUE;
+ break;
+
+ case '?':
+ default:
+ usage();
+ }
+
+
+ kernel = getbootfile();
+ if (verbose)
+ printf("Boot image: %s\n", kernel);
+
+ if (!(kd = kvm_open(NULL, NULL, NULL, O_RDONLY, errb)))
+ fatal("kvm_open", NULL);
+
+ if (kvm_nlist(kd, nlk) != 0)
+ fatal("kvm_nlist", NULL);
+
+ if (nlk[0].n_type == 0)
+ fatal("kvm_nlist", "bad symbol type");
+
+ if (nlist(kernel, nl) != 0)
+ fatal("nlist", NULL);
+
+ if (nl[0].n_type == 0)
+ fatal("nlist", "bad symbol type");
+
+ if (stat(kernel, &fst) < 0)
+ fatal("stat", NULL);
+
+ flags = fst.st_flags;
+
+ if (chflags(kernel, (u_long) 0) < 0)
+ fatal("chflags", NULL);
+
+ if ((f = open(kernel, O_RDWR)) <= 0)
+ fatal("open", NULL);
+
+ if (read(f, &es, sizeof(struct exec)) <= 0)
+ fatal("read header", NULL);
+
+ entry = es.a_entry;
+
+ for (sym = 0; sym <= N_TABLAST; sym++) {
+ if (verbose)
+ printf("\nTable: %s\n", nl[sym].n_name);
+ pos = nl[sym].n_value + getpagesize() - entry;
+
+ pos1 = nlk[0].n_value;
+
+ if (lseek(f, pos, SEEK_SET) != pos)
+ fatal("seek", NULL);
+
+ if (verbose)
+ printf("----------------------------------------------------\n");
+
+ do {
+ if ((res = read(f, (char *) &buf, sizeof(struct isa_device)))
+ <= 0)
+ fatal("read", NULL);
+
+
+
+ if (kvm_read(kd, pos1, &pos_t, sizeof(u_long)) < 0)
+ fatal("kvmread", NULL);
+ dev_found = 0;
+
+ while(pos_t!=0) {
+ if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0)
+ fatal("kvmread", NULL);
+
+ if (buf1.id_id != buf.id_id) {
+ pos_t = (u_long)(buf1.id_next);
+ continue;
+ } else
+ dev_found=1;
+
+ if (buf1.id_driver)
+ if (kvm_read(kd, (u_long) buf1.id_driver,
+ &dbuf, sizeof(struct isa_driver)) < 0) {
+ error("kvm_read", "no driver");
+ } else {
+ if (kvm_read(kd, (u_long) dbuf.name,
+ nbuf, sizeof(nbuf)) < 0) {
+ error("kvm_read", NULL);
+ } else {
+ nbuf[sizeof(nbuf) - 1] = 0;
+ if (verbose)
+ printf("Device: %s%d\n", nbuf, buf1.id_unit);
+ }
+ }
+ else
+ error("kvm_read", "no driver");
+ break;
+
+ };
+
+ if (!dev_found)
+ continue;
+
+ if (buf1.id_id != 0)
+ if (verbose)
+ printf(
+ "kernel: id=%u io=%X irq=%d drq=%d maddr=%p msize=%d flags=%X enabled=%X \n",
+ buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq,
+ buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled);
+
+ if (buf.id_id != 0)
+ if (verbose)
+ printf(
+ "file: id=%u io=%X irq=%d drq=%d maddr=%p msize=%d flags=%X enabled=%X \n",
+ buf.id_id, buf.id_iobase, buf.id_irq, buf.id_drq,
+ buf.id_maddr, buf.id_msize, buf.id_flags, buf.id_enabled);
+
+
+ /*
+ * OK,now we'd compare values and set'em from kernel.
+ */
+ modified = FALSE;
+
+ if (buf.id_iobase != -1 && buf.id_iobase !=
+ buf1.id_iobase) {
+ if (verbose)
+ printf("Setting IO addr\n");
+ buf.id_iobase = buf1.id_iobase;
+ modified = TRUE;
+ }
+ if (buf.id_irq != (u_short)-1 && buf.id_irq != buf1.id_irq) {
+ if (verbose)
+ printf("Setting IRQ\n");
+ buf.id_irq = buf1.id_irq;
+ modified = TRUE;
+ }
+ if (buf.id_drq != -1 && buf.id_drq != buf1.id_drq) {
+ if (verbose)
+ printf("Setting DRQ\n");
+ buf.id_drq = buf1.id_drq;
+ modified = TRUE;
+ }
+ if (buf.id_maddr != (caddr_t)-1 && buf.id_maddr != buf1.id_maddr) {
+ if (verbose)
+ printf("Setting memory addres\n");
+ buf.id_maddr = buf1.id_maddr;
+ modified = TRUE;
+ }
+ if (buf.id_msize != buf1.id_msize) {
+ if (verbose)
+ printf("Setting msize\n");
+ buf.id_msize = buf1.id_msize;
+ modified = TRUE;
+ }
+ if (buf.id_flags != buf1.id_flags) {
+ if (verbose)
+ printf("Setting flags\n");
+ buf.id_flags = buf1.id_flags;
+ modified = TRUE;
+ }
+ if (buf.id_enabled != buf1.id_enabled) {
+ if (verbose)
+ printf("Setting device enable/disable\n");
+ buf.id_enabled = buf1.id_enabled;
+ modified = TRUE;
+ }
+ if (verbose)
+ printf("----------------------------------------------------\n");
+ if (modified && !testonly) {
+
+ res = lseek(f, -(off_t) sizeof(struct isa_device),
+ SEEK_CUR);
+ if (write(f, &buf, sizeof(struct isa_device)) <= 0)
+ fatal("write", NULL);
+
+ }
+ } while (buf.id_id != 0 && buf1.id_id != 0);
+ }
+
+ if (kvm_nlist(kd, nlaux) != 0) {
+ /* num_eisa_conf need not exist, only handle it if found */
+ if (verbose)
+ printf("num_eisa_slots not found, ignoring.\n");
+ } else {
+ if (nlaux[0].n_type == 0)
+ fatal("kvm_nlist", "bad symbol type");
+ pos1 = nlaux[0].n_value;
+ if (kvm_read(kd, pos1, &s, sizeof(int)) < 0)
+ fatal("kvmread", NULL);
+
+ if (nlist(kernel, nlaux) != 0)
+ fatal("nlist", NULL);
+ if (nlaux[0].n_type == 0)
+ fatal("nlist", "bad symbol type");
+ pos = nlaux[0].n_value + getpagesize() - entry;
+ if (lseek(f, pos, SEEK_SET) != pos)
+ fatal("seek", NULL);
+ if ((res = read(f, (char *) &i, sizeof(int)))
+ <= 0)
+ fatal("read", NULL);
+
+ if (i != s) {
+ if (verbose)
+ printf("\nChanging num_eisa_slots from %d to %d.\n",
+ i, s);
+ if (!testonly) {
+ res = lseek(f, -(off_t) sizeof(int),
+ SEEK_CUR);
+ if (write(f, &s, sizeof(int)) <= 0)
+ fatal("write", NULL);
+ }
+ }
+ }
+
+ if (kvm_nlist(kd, nlpnp) != 0) {
+ /* pnp_ldn_overrides need not exist, only handle it if found */
+ if (verbose)
+ printf("pnp_ldn_overrides not found, ignoring.\n");
+ } else {
+ if (nlpnp[0].n_type == 0)
+ fatal("kvm_nlist", "bad symbol type");
+ /* must handle it, read and write... */
+ pos1 = nlpnp[0].n_value ;
+ if (kvm_read(kd, pos1, &new_ov, sizeof(new_ov) ) < 0 )
+ fatal("kvmread", NULL);
+ if (nlist(kernel, nlpnp) != 0)
+ fatal("nlist", NULL);
+ if (nlpnp[0].n_type == 0)
+ fatal("nlist", "bad symbol type");
+ pos = nlpnp[0].n_value + getpagesize() - entry;
+ if (lseek(f, pos, SEEK_SET) != pos)
+ fatal("seek", NULL);
+ if ((res = read(f, (char *) &old_ov, sizeof(old_ov))) <= 0 )
+ fatal("read", NULL);
+ if (testonly || bcmp(&old_ov, &new_ov, sizeof(old_ov)) ) {
+ if (verbose) {
+ int i;
+ printf("CSN LDN conf en irq drq vendor_id. ....\n");
+ for (i=0; i < MAX_PNP_LDN ; i++) {
+ if (new_ov[i].csn>0 && new_ov[i].csn<255) {
+ int maxp, maxm;
+ for (maxp=7; maxp>=0 ; maxp--)
+ if (new_ov[i].port[maxp] !=0) break;
+ for (maxm=3; maxm>=0 ; maxm--)
+ if (new_ov[i].mem[maxm].base !=0) break;
+ printf("%3d %3d %-4s %c ",
+ new_ov[i].csn,
+ new_ov[i].ldn,
+ new_ov[i].override ? "OS":"BIOS",
+ new_ov[i].enable ? 'y':'n');
+ printf(new_ov[i].irq[0] == 0 ? " -":" %2d",
+ new_ov[i].irq[0]);
+ printf(new_ov[i].irq[1] == 0 ? " - ":"%-2d",
+ new_ov[i].irq[1]);
+ printf(new_ov[i].drq[0] == 4 ? " -":" %d",
+ new_ov[i].drq[0]);
+ printf(new_ov[i].drq[1] == 4 ? " -":" %d",
+ new_ov[i].drq[1]);
+ if (new_ov[i].vendor_id > 0)
+ printf(" 0x%08x", new_ov[i].vendor_id);
+ if (new_ov[i].flags > 0)
+ printf(" flags 0x%08lx", new_ov[i].flags);
+ if (maxp >=0) {
+ int j;
+ printf(" port 0x%x", new_ov[i].port[0]);
+ for(j=1;j<=maxp;j++)
+ printf(" 0x%x", new_ov[i].port[j]);
+ }
+ if (maxm >=0) {
+ int j;
+ printf(" mem 0x%lx", new_ov[i].mem[0].base);
+ for(j=1;j<=maxm;j++)
+ printf(" 0x%lx", new_ov[i].mem[j].base);
+ }
+ printf("\n");
+ }
+ }
+ }
+ if (!testonly) {
+ res = lseek(f, -(off_t) sizeof(new_ov),
+ SEEK_CUR);
+ if (write(f,&new_ov, sizeof(new_ov)) <= 0)
+ fatal("write", NULL);
+ }
+ }
+ }
+ if (chflags(kernel, flags) < 0)
+ fatal("chflags restore", NULL);
+
+ kvm_close(kd);
+ close(f);
+ return(0);
+}
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 555e948ceb7a..952afc6a0bb3 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95";
#endif
static const char rcsid[] =
- "$Id: traverse.c,v 1.7 1998/06/15 06:58:12 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -501,14 +501,14 @@ void
writeheader(ino)
ino_t ino;
{
- register int32_t sum, cnt, *lp;
+ register long sum, cnt, *lp;
spcl.c_inumber = ino;
spcl.c_magic = NFS_MAGIC;
spcl.c_checksum = 0;
- lp = (int32_t *)&spcl;
+ lp = (long *)&spcl;
sum = 0;
- cnt = sizeof(union u_spcl) / (4 * sizeof(int32_t));
+ cnt = sizeof(union u_spcl) / (4 * sizeof(long));
while (--cnt >= 0) {
sum += *lp++;
sum += *lp++;
diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c
index 71e8a05b9139..91b507fa2b13 100644
--- a/sbin/fsck/dir.c
+++ b/sbin/fsck/dir.c
@@ -36,11 +36,10 @@
static const char sccsid[] = "@(#)dir.c 8.8 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: dir.c,v 1.12 1998/09/23 05:37:35 nate Exp $";
+ "$Id: dir.c,v 1.11 1998/06/28 19:23:02 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
-#include <sys/time.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
@@ -89,9 +88,9 @@ propagate()
inp = *inpp;
if (inp->i_parent == 0)
continue;
- if (inoinfo(inp->i_parent)->ino_state == DFOUND &&
- inoinfo(inp->i_number)->ino_state == DSTATE) {
- inoinfo(inp->i_number)->ino_state = DFOUND;
+ if (statemap[inp->i_parent] == DFOUND &&
+ statemap[inp->i_number] == DSTATE) {
+ statemap[inp->i_number] = DFOUND;
change++;
}
}
@@ -124,8 +123,6 @@ dirscan(idesc)
idesc->id_loc = 0;
for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
dsize = dp->d_reclen;
- if (dsize > sizeof(dbuf))
- dsize = sizeof(dbuf);
memmove(dbuf, dp, (size_t)dsize);
# if (BYTE_ORDER == LITTLE_ENDIAN)
if (!newinofmt) {
@@ -238,7 +235,8 @@ dircheck(idesc, dp)
int spaceleft;
spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
- if (dp->d_reclen == 0 ||
+ if (dp->d_ino >= maxino ||
+ dp->d_reclen == 0 ||
dp->d_reclen > spaceleft ||
(dp->d_reclen & 0x3) != 0)
return (0);
@@ -308,40 +306,13 @@ adjust(idesc, lcnt)
register struct inodesc *idesc;
int lcnt;
{
- struct dinode *dp;
- int saveresolved;
+ register struct dinode *dp;
dp = ginode(idesc->id_number);
if (dp->di_nlink == lcnt) {
- /*
- * If we have not hit any unresolved problems, are running
- * in preen mode, and are on a filesystem using soft updates,
- * then just toss any partially allocated files.
- */
- if (resolved && preen && usedsoftdep) {
- clri(idesc, "UNREF", 1);
- return;
- } else {
- /*
- * The filesystem can be marked clean even if
- * a file is not linked up, but is cleared.
- * Hence, resolved should not be cleared when
- * linkup is answered no, but clri is answered yes.
- */
- saveresolved = resolved;
- if (linkup(idesc->id_number, (ino_t)0, NULL) == 0) {
- resolved = saveresolved;
- clri(idesc, "UNREF", 0);
- return;
- }
- /*
- * Account for the new reference created by linkup().
- */
- dp = ginode(idesc->id_number);
- lcnt--;
- }
- }
- if (lcnt != 0) {
+ if (linkup(idesc->id_number, (ino_t)0) == 0)
+ clri(idesc, "UNREF", 0);
+ } else {
pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname :
((dp->di_mode & IFMT) == IFDIR ? "DIR" : "FILE"));
pinode(idesc->id_number);
@@ -384,7 +355,7 @@ mkentry(idesc)
dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
dirp->d_reclen = newent.d_reclen;
if (newinofmt)
- dirp->d_type = inoinfo(idesc->id_parent)->ino_type;
+ dirp->d_type = typemap[idesc->id_parent];
else
dirp->d_type = 0;
dirp->d_namlen = newent.d_namlen;
@@ -417,17 +388,16 @@ chgino(idesc)
return (KEEPON);
dirp->d_ino = idesc->id_parent;
if (newinofmt)
- dirp->d_type = inoinfo(idesc->id_parent)->ino_type;
+ dirp->d_type = typemap[idesc->id_parent];
else
dirp->d_type = 0;
return (ALTERED|STOP);
}
int
-linkup(orphan, parentdir, name)
+linkup(orphan, parentdir)
ino_t orphan;
ino_t parentdir;
- char *name;
{
register struct dinode *dp;
int lostdir;
@@ -440,7 +410,7 @@ linkup(orphan, parentdir, name)
lostdir = (dp->di_mode & IFMT) == IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
pinode(orphan);
- if (preen && dp->di_size == 0)
+ if ((preen || usedsoftdep) && dp->di_size == 0)
return (0);
if (preen)
printf(" (RECONNECTED)\n");
@@ -461,7 +431,6 @@ linkup(orphan, parentdir, name)
lfdir = allocdir(ROOTINO, (ino_t)0, lfmode);
if (lfdir != 0) {
if (makeentry(ROOTINO, lfdir, lfname) != 0) {
- numdirs++;
if (preen)
printf(" (CREATED)\n");
} else {
@@ -497,21 +466,21 @@ linkup(orphan, parentdir, name)
idesc.id_type = ADDR;
idesc.id_func = pass4check;
idesc.id_number = oldlfdir;
- adjust(&idesc, inoinfo(oldlfdir)->ino_linkcnt + 1);
- inoinfo(oldlfdir)->ino_linkcnt = 0;
+ adjust(&idesc, lncntp[oldlfdir] + 1);
+ lncntp[oldlfdir] = 0;
dp = ginode(lfdir);
}
- if (inoinfo(lfdir)->ino_state != DFOUND) {
+ if (statemap[lfdir] != DFOUND) {
pfatal("SORRY. NO lost+found DIRECTORY\n\n");
return (0);
}
(void)lftempname(tempname, orphan);
- if (makeentry(lfdir, orphan, (name ? name : tempname)) == 0) {
+ if (makeentry(lfdir, orphan, tempname) == 0) {
pfatal("SORRY. NO SPACE IN lost+found DIRECTORY");
printf("\n\n");
return (0);
}
- inoinfo(orphan)->ino_linkcnt--;
+ lncntp[orphan]--;
if (lostdir) {
if ((changeino(orphan, "..", lfdir) & ALTERED) == 0 &&
parentdir != (ino_t)-1)
@@ -519,7 +488,7 @@ linkup(orphan, parentdir, name)
dp = ginode(lfdir);
dp->di_nlink++;
inodirty();
- inoinfo(lfdir)->ino_linkcnt++;
+ lncntp[lfdir]++;
pwarn("DIR I=%lu CONNECTED. ", orphan);
if (parentdir != (ino_t)-1) {
printf("PARENT WAS I=%lu\n", (u_long)parentdir);
@@ -530,7 +499,8 @@ linkup(orphan, parentdir, name)
* fixes the parent link count so that fsck does
* not need to be rerun.
*/
- inoinfo(parentdir)->ino_linkcnt++;
+ lncntp[parentdir]++;
+
}
if (preen == 0)
printf("\n");
@@ -688,20 +658,19 @@ allocdir(parent, request, mode)
dp->di_nlink = 2;
inodirty();
if (ino == ROOTINO) {
- inoinfo(ino)->ino_linkcnt = dp->di_nlink;
+ lncntp[ino] = dp->di_nlink;
cacheino(dp, ino);
return(ino);
}
- if (inoinfo(parent)->ino_state != DSTATE &&
- inoinfo(parent)->ino_state != DFOUND) {
+ if (statemap[parent] != DSTATE && statemap[parent] != DFOUND) {
freeino(ino);
return (0);
}
cacheino(dp, ino);
- inoinfo(ino)->ino_state = inoinfo(parent)->ino_state;
- if (inoinfo(ino)->ino_state == DSTATE) {
- inoinfo(ino)->ino_linkcnt = dp->di_nlink;
- inoinfo(parent)->ino_linkcnt++;
+ statemap[ino] = statemap[parent];
+ if (statemap[ino] == DSTATE) {
+ lncntp[ino] = dp->di_nlink;
+ lncntp[parent]++;
}
dp = ginode(parent);
dp->di_nlink++;
diff --git a/sbin/fsck/fsck.8 b/sbin/fsck/fsck.8
index 5ce5e0f681da..51d1679f6d1d 100644
--- a/sbin/fsck/fsck.8
+++ b/sbin/fsck/fsck.8
@@ -1,4 +1,3 @@
-.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -31,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)fsck.8 8.4 (Berkeley) 5/9/95
-.\" $Id: fsck.8,v 1.11 1998/06/15 07:07:12 charnier Exp $
+.\" $Id: fsck.8,v 1.10 1997/03/12 16:35:26 bde Exp $
.\"
-.Dd November 15, 1996
+.Dd May 9, 1995
.Dt FSCK 8
.Os BSD 4
.Sh NAME
@@ -44,13 +43,12 @@
.Fl p
.Op Fl f
.Op Fl m Ar mode
-.Op Ar filesystem
-.Ar ...
.Nm fsck
-.Op Fl ny
.Op Fl b Ar block#
.Op Fl c Ar level
.Op Fl l Ar maxparallel
+.Op Fl y
+.Op Fl n
.Op Fl m Ar mode
.Op Ar filesystem
.Ar ...
@@ -76,8 +74,7 @@ The disk drive containing each filesystem is inferred from the longest prefix
of the device name that ends in a digit; the remaining characters are assumed
to be the partition designator.
.Pp
-In "preen" mode the clean flag of each filesystem's superblock is examined
-and only those filesystems that
+The clean flag of each filesystem's superblock is examined and only those filesystems that
are not marked clean are checked.
Filesystems are marked clean when they are unmounted,
when they have been mounted read-only, or when
@@ -91,8 +88,7 @@ will be checked regardless of the state of their clean flag.
The kernel takes care that only a restricted class of innocuous filesystem
inconsistencies can happen unless hardware or software failures intervene.
These are limited to the following:
-.Pp
-.Bl -item -compact -offset indent
+.Bl -item -compact
.It
Unreferenced inodes
.It
@@ -168,6 +164,32 @@ The following flags are interpreted by
Use the block specified immediately after the flag as
the super block for the filesystem. Block 32 is usually
an alternate super block.
+.It Fl l
+Limit the number of parallel checks to the number specified in the following
+argument.
+By default, the limit is the number of disks, running one process per disk.
+If a smaller limit is given, the disks are checked round-robin, one filesystem
+at a time.
+.It Fl m
+Use the mode specified in octal immediately after the flag as the
+permission bits to use when creating the
+.Pa lost+found
+directory rather than the default 1777.
+In particular, systems that do not wish to have lost files accessible
+by all users on the system should use a more restrictive
+set of permissions such as 700.
+.It Fl y
+Assume a yes response to all questions asked by
+.Nm Ns ;
+this should be used with great caution as this is a free license
+to continue after essentially unlimited trouble has been encountered.
+.It Fl n
+Assume a no response to all questions asked by
+.Nm
+except for
+.Ql CONTINUE? ,
+which is assumed to be affirmative;
+do not open the filesystem for writing.
.It Fl c
Convert the filesystem to the specified level.
Note that the level of a filesystem can only be raised.
@@ -201,40 +223,6 @@ are being converted at once.
The format of a filesystem can be determined from the
first line of output from
.Xr dumpfs 8 .
-.It Fl f
-Force
-.Nm fsck
-to check
-.Sq clean
-filesystems when preening.
-.It Fl l
-Limit the number of parallel checks to the number specified in the following
-argument.
-By default, the limit is the number of disks, running one process per disk.
-If a smaller limit is given, the disks are checked round-robin, one filesystem
-at a time.
-.It Fl m
-Use the mode specified in octal immediately after the flag as the
-permission bits to use when creating the
-.Pa lost+found
-directory rather than the default 1777.
-In particular, systems that do not wish to have lost files accessible
-by all users on the system should use a more restrictive
-set of permissions such as 700.
-.It Fl n
-Assume a no response to all questions asked by
-.Nm
-except for
-.Ql CONTINUE? ,
-which is assumed to be affirmative;
-do not open the filesystem for writing.
-.It Fl p
-Preen filesystems (see above).
-.It Fl y
-Assume a yes response to all questions asked by
-.Nm Ns ;
-this should be used with great caution as this is a free license
-to continue after essentially unlimited trouble has been encountered.
.El
.Pp
If no filesystems are given to
@@ -271,7 +259,7 @@ File pointing to unallocated inode.
.It
Inode number out of range.
.It
-Directories with unallocated blocks (holes).
+Holes in directories.
.It
Dot or dot-dot not the first two entries of a directory
or having the wrong inode number.
diff --git a/sbin/fsck/fsck.h b/sbin/fsck/fsck.h
index 81b229268884..4e0271d815dd 100644
--- a/sbin/fsck/fsck.h
+++ b/sbin/fsck/fsck.h
@@ -42,35 +42,16 @@
#define MAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */
#define INOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */
-/*
- * Each inode on the filesystem is described by the following structure.
- * The linkcnt is initially set to the value in the inode. Each time it
- * is found during the descent in passes 2, 3, and 4 the count is
- * decremented. Any inodes whose count is non-zero after pass 4 needs to
- * have its link count adjusted by the value remaining in ino_linkcnt.
- */
-struct inostat {
- char ino_state; /* state of inode, see below */
- char ino_type; /* type of inode */
- short ino_linkcnt; /* number of links not found */
-};
-/*
- * Inode states.
- */
+#ifndef BUFSIZ
+#define BUFSIZ 1024
+#endif
+
#define USTATE 01 /* inode not allocated */
#define FSTATE 02 /* inode is file */
#define DSTATE 03 /* inode is directory */
#define DFOUND 04 /* directory found during descent */
#define DCLEAR 05 /* directory is to be cleared */
#define FCLEAR 06 /* file is to be cleared */
-/*
- * Inode state information is contained on per cylinder group lists
- * which are described by the following structure.
- */
-struct inostatlist {
- long il_numalloced; /* number of inodes allocated in this cg */
- struct inostat *il_stat;/* inostat info for this cylinder group */
-} *inostathead;
/*
* buffer cache structure.
@@ -182,12 +163,11 @@ struct inoinfo {
ufs_daddr_t i_blks[1]; /* actually longer */
} **inphead, **inpsort;
long numdirs, listmax, inplast;
-long countdirs; /* number of directories we actually found */
char *cdevname; /* name of device being checked */
long dev_bsize; /* computed value of DEV_BSIZE */
long secsize; /* actual disk sector size */
-char fflag; /* force check, ignore clean flag */
+char fflag; /* force fs check (ignore clean flag) */
char nflag; /* assume a no response */
char yflag; /* assume a yes response */
int bflag; /* location of alternate super block */
@@ -197,19 +177,23 @@ int doinglevel1; /* converting to new cylinder group format */
int doinglevel2; /* converting to new inode format */
int newinofmt; /* filesystem has new inode format */
char usedsoftdep; /* just fix soft dependency inconsistencies */
-char preen; /* just fix normal inconsistencies */
-char rerun; /* rerun fsck. Only used in non-preen mode */
-int returntosingle; /* 1 => return to single user mode on exit */
char resolved; /* cleared if unresolved changes => not clean */
+char preen; /* just fix normal inconsistencies */
char hotroot; /* checking root device */
char havesb; /* superblock has been read */
int fsmodified; /* 1 => write done to file system */
int fsreadfd; /* file descriptor for reading file system */
int fswritefd; /* file descriptor for writing file system */
+int returntosingle; /* return to single user mode */
+int rerun; /* rerun fsck. Only used in non-preen mode */
ufs_daddr_t maxfsblock; /* number of blocks in the file system */
char *blockmap; /* ptr to primary blk allocation map */
ino_t maxino; /* number of inodes in file system */
+ino_t lastino; /* last inode in use */
+char *statemap; /* ptr to inode state table */
+u_char *typemap; /* ptr to inode type table */
+short *lncntp; /* ptr to link count table */
ino_t lfdir; /* lost & found directory inode number */
char *lfname; /* lost & found directory name */
@@ -235,7 +219,6 @@ struct dinode zino;
struct fstab;
-
void adjust __P((struct inodesc *, int lcnt));
ufs_daddr_t allocblk __P((long frags));
ino_t allocdir __P((ino_t parent, ino_t request, int mode));
@@ -256,7 +239,6 @@ int chkrange __P((ufs_daddr_t blk, int cnt));
void ckfini __P((int markclean));
int ckinode __P((struct dinode *dp, struct inodesc *));
void clri __P((struct inodesc *, char *type, int flag));
-int clearentry __P((struct inodesc *));
void direrror __P((ino_t ino, char *errmesg));
int dirscan __P((struct inodesc *));
int dofix __P((struct inodesc *, char *msg));
@@ -280,8 +262,7 @@ void getpathname __P((char *namebuf, ino_t curdir, ino_t ino));
struct dinode *ginode __P((ino_t inumber));
void inocleanup __P((void));
void inodirty __P((void));
-struct inostat *inoinfo __P((ino_t inum));
-int linkup __P((ino_t orphan, ino_t parentdir, char *name));
+int linkup __P((ino_t orphan, ino_t parentdir));
int makeentry __P((ino_t parent, ino_t ino, char *name));
void panic __P((const char *fmt, ...));
void pass1 __P((void));
@@ -297,6 +278,6 @@ void pinode __P((ino_t ino));
void propagate __P((void));
void pwarn __P((const char *fmt, ...));
int reply __P((char *question));
-void setinodebuf __P((ino_t));
+void resetinodebuf __P((void));
int setup __P((char *dev));
void voidquit __P((int));
diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c
index 5a8acd289752..b7e80cdffaa6 100644
--- a/sbin/fsck/inode.c
+++ b/sbin/fsck/inode.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: inode.c,v 1.16 1998/08/01 18:03:28 dfr Exp $";
+ "$Id: inode.c,v 1.15 1998/06/28 19:23:02 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -62,8 +62,7 @@ ckinode(dp, idesc)
register struct inodesc *idesc;
{
ufs_daddr_t *ap;
- int ret;
- long n, ndb, offset;
+ long ret, n, ndb, offset;
struct dinode dino;
quad_t remsize, sizepb;
mode_t mode;
@@ -75,7 +74,7 @@ ckinode(dp, idesc)
idesc->id_filesize = dp->di_size;
mode = dp->di_mode & IFMT;
if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
- dp->di_size < (unsigned)sblock.fs_maxsymlinklen))
+ (dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0)))
return (KEEPON);
dino = *dp;
ndb = howmany(dino.di_size, sblock.fs_bsize);
@@ -240,16 +239,8 @@ chkrange(blk, cnt)
{
register int c;
- if (cnt <= 0 || blk <= 0 || blk > maxfsblock ||
- cnt - 1 > maxfsblock - blk)
+ if (blk < 0 || blk >= maxfsblock || cnt < 0 || cnt > maxfsblock - blk)
return (1);
- if (cnt > sblock.fs_frag ||
- fragnum(&sblock, blk) + cnt > sblock.fs_frag) {
- if (debug)
- printf("bad size: blk %ld, offset %ld, size %ld\n",
- blk, fragnum(&sblock, blk), cnt);
- return (1);
- }
c = dtog(&sblock, blk);
if (blk < cgdmin(&sblock, c)) {
if ((blk + cnt) > cgsblock(&sblock, c)) {
@@ -326,29 +317,20 @@ getnextinode(inumber)
size = inobufsize;
lastinum += fullcnt;
}
- /*
- * If bread returns an error, it will already have zeroed
- * out the buffer, so we do not need to do so here.
- */
- (void)bread(fsreadfd, (char *)inodebuf, dblk, size);
+ (void)bread(fsreadfd, (char *)inodebuf, dblk, size); /* ??? */
dp = inodebuf;
}
return (dp++);
}
void
-setinodebuf(inum)
- ino_t inum;
+resetinodebuf()
{
- if (inum % sblock.fs_ipg != 0)
- errx(EEXIT, "bad inode number %d to setinodebuf", inum);
startinum = 0;
- nextino = inum;
- lastinum = inum;
+ nextino = 0;
+ lastinum = 0;
readcnt = 0;
- if (inodebuf != NULL)
- return;
inobufsize = blkroundup(&sblock, INOBUFSIZE);
fullcnt = inobufsize / sizeof(struct dinode);
readpercg = sblock.fs_ipg / fullcnt;
@@ -360,8 +342,11 @@ setinodebuf(inum)
partialcnt = fullcnt;
partialsize = inobufsize;
}
- if ((inodebuf = (struct dinode *)malloc((unsigned)inobufsize)) == NULL)
+ if (inodebuf == NULL &&
+ (inodebuf = (struct dinode *)malloc((unsigned)inobufsize)) == NULL)
errx(EEXIT, "cannot allocate space for inode buffer");
+ while (nextino < ROOTINO)
+ (void)getnextinode(nextino);
}
void
@@ -395,11 +380,14 @@ cacheino(dp, inumber)
inp = (struct inoinfo *)
malloc(sizeof(*inp) + (blks - 1) * sizeof(ufs_daddr_t));
if (inp == NULL)
- errx(EEXIT, "cannot increase directory list");
+ return;
inpp = &inphead[inumber % numdirs];
inp->i_nexthash = *inpp;
*inpp = inp;
- inp->i_parent = inumber == ROOTINO ? ROOTINO : (ino_t)0;
+ if (inumber == ROOTINO)
+ inp->i_parent = ROOTINO;
+ else
+ inp->i_parent = (ino_t)0;
inp->i_dotdot = (ino_t)0;
inp->i_number = inumber;
inp->i_isize = dp->di_size;
@@ -477,7 +465,7 @@ clri(idesc, type, flag)
n_files--;
(void)ckinode(dp, idesc);
clearinode(dp);
- inoinfo(idesc->id_number)->ino_state = USTATE;
+ statemap[idesc->id_number] = USTATE;
inodirty();
}
}
@@ -488,10 +476,8 @@ findname(idesc)
{
register struct direct *dirp = idesc->id_dirp;
- if (dirp->d_ino != idesc->id_parent || idesc->id_entryno < 2) {
- idesc->id_entryno++;
+ if (dirp->d_ino != idesc->id_parent)
return (KEEPON);
- }
memmove(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
return (STOP|FOUND);
}
@@ -512,20 +498,6 @@ findino(idesc)
return (KEEPON);
}
-int
-clearentry(idesc)
- struct inodesc *idesc;
-{
- register struct direct *dirp = idesc->id_dirp;
-
- if (dirp->d_ino != idesc->id_parent || idesc->id_entryno < 2) {
- idesc->id_entryno++;
- return (KEEPON);
- }
- dirp->d_ino = 0;
- return (STOP|FOUND|ALTERED);
-}
-
void
pinode(ino)
ino_t ino;
@@ -562,14 +534,14 @@ blkerror(ino, type, blk)
pfatal("%ld %s I=%lu", blk, type, ino);
printf("\n");
- switch (inoinfo(ino)->ino_state) {
+ switch (statemap[ino]) {
case FSTATE:
- inoinfo(ino)->ino_state = FCLEAR;
+ statemap[ino] = FCLEAR;
return;
case DSTATE:
- inoinfo(ino)->ino_state = DCLEAR;
+ statemap[ino] = DCLEAR;
return;
case FCLEAR:
@@ -577,7 +549,7 @@ blkerror(ino, type, blk)
return;
default:
- errx(EEXIT, "BAD STATE %d TO BLKERR", inoinfo(ino)->ino_state);
+ errx(EEXIT, "BAD STATE %d TO BLKERR", statemap[ino]);
/* NOTREACHED */
}
}
@@ -597,10 +569,10 @@ allocino(request, type)
if (request == 0)
request = ROOTINO;
- else if (inoinfo(request)->ino_state != USTATE)
+ else if (statemap[request] != USTATE)
return (0);
for (ino = request; ino < maxino; ino++)
- if (inoinfo(ino)->ino_state == USTATE)
+ if (statemap[ino] == USTATE)
break;
if (ino == maxino)
return (0);
@@ -612,12 +584,12 @@ allocino(request, type)
cgp->cg_cs.cs_nifree--;
switch (type & IFMT) {
case IFDIR:
- inoinfo(ino)->ino_state = DSTATE;
+ statemap[ino] = DSTATE;
cgp->cg_cs.cs_ndir++;
break;
case IFREG:
case IFLNK:
- inoinfo(ino)->ino_state = FSTATE;
+ statemap[ino] = FSTATE;
break;
default:
return (0);
@@ -626,20 +598,19 @@ allocino(request, type)
dp = ginode(ino);
dp->di_db[0] = allocblk((long)1);
if (dp->di_db[0] == 0) {
- inoinfo(ino)->ino_state = USTATE;
+ statemap[ino] = USTATE;
return (0);
}
- dp->di_mode = type;
dp->di_flags = 0;
+ dp->di_mode = type;
dp->di_atime = time(NULL);
dp->di_mtime = dp->di_ctime = dp->di_atime;
- dp->di_mtimensec = dp->di_ctimensec = dp->di_atimensec = 0;
dp->di_size = sblock.fs_fsize;
dp->di_blocks = btodb(sblock.fs_fsize);
n_files++;
inodirty();
if (newinofmt)
- inoinfo(ino)->ino_type = IFTODT(type);
+ typemap[ino] = IFTODT(type);
return (ino);
}
@@ -661,6 +632,6 @@ freeino(ino)
(void)ckinode(dp, &idesc);
clearinode(dp);
inodirty();
- inoinfo(ino)->ino_state = USTATE;
+ statemap[ino] = USTATE;
n_files--;
}
diff --git a/sbin/fsck/main.c b/sbin/fsck/main.c
index bcf0021fd2a9..9ff947c52f84 100644
--- a/sbin/fsck/main.c
+++ b/sbin/fsck/main.c
@@ -42,13 +42,12 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.15 1998/11/05 03:26:36 mjacob Exp $";
+ "$Id: main.c,v 1.13 1998/03/08 09:55:26 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <sys/time.h>
#include <sys/mount.h>
-#include <sys/resource.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/ufsmount.h>
@@ -59,6 +58,8 @@ static const char rcsid[] =
#include "fsck.h"
+int returntosingle;
+
static int argtoi __P((int flag, char *req, char *str, int base));
static int docheck __P((struct fstab *fsp));
static int checkfilesys __P((char *filesys, char *mntpt, long auxdata,
@@ -72,7 +73,6 @@ main(argc, argv)
{
int ch;
int ret, maxrun = 0;
- struct rlimit rlimit;
sync();
while ((ch = getopt(argc, argv, "dfpnNyYb:c:l:m:")) != -1) {
@@ -131,24 +131,9 @@ main(argc, argv)
(void)signal(SIGINT, catch);
if (preen)
(void)signal(SIGQUIT, catchquit);
- /*
- * Push up our allowed memory limit so we can cope
- * with huge filesystems.
- */
- if (getrlimit(RLIMIT_DATA, &rlimit) == 0) {
- rlimit.rlim_cur = rlimit.rlim_max;
- (void)setrlimit(RLIMIT_DATA, &rlimit);
- }
if (argc) {
- while (argc-- > 0) {
- char *path = blockcheck(*argv);
-
- if (path == NULL)
- pfatal("Can't check %s\n", *argv);
- else
- (void)checkfilesys(path, 0, 0L, 0);
- ++argv;
- }
+ while (argc-- > 0)
+ (void)checkfilesys(blockcheck(*argv++), 0, 0L, 0);
exit(0);
}
ret = checkfstab(preen, maxrun, docheck, checkfilesys);
@@ -313,7 +298,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
muldup = (struct dups *)0;
inocleanup();
if (fsmodified) {
- sblock.fs_time = time(NULL);
+ (void)time(&sblock.fs_time);
sbdirty();
}
if (cvtlevel && sblk.b_dirty) {
@@ -338,13 +323,12 @@ checkfilesys(filesys, mntpt, auxdata, child)
resolved = 0;
}
ckfini(resolved);
-
- for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
- if (inostathead[cylno].il_stat != NULL)
- free((char *)inostathead[cylno].il_stat);
- free((char *)inostathead);
- inostathead = NULL;
- if (fsmodified && !preen)
+ free(blockmap);
+ free(statemap);
+ free((char *)lncntp);
+ if (!fsmodified)
+ return (0);
+ if (!preen)
printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
if (rerun)
printf("\n***** PLEASE RERUN FSCK *****\n");
@@ -364,8 +348,6 @@ checkfilesys(filesys, mntpt, auxdata, child)
if (ret == 0)
return (0);
}
- if (!fsmodified)
- return (0);
if (!preen)
printf("\n***** REBOOT NOW *****\n");
sync();
diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c
index 0d3fc478f37f..30c0e7d5b541 100644
--- a/sbin/fsck/pass1.c
+++ b/sbin/fsck/pass1.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: pass1.c,v 1.13 1998/07/06 19:11:35 bde Exp $";
+ "$Id: pass1.c,v 1.11 1998/06/15 07:07:16 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,17 +52,14 @@ static const char rcsid[] =
static ufs_daddr_t badblk;
static ufs_daddr_t dupblk;
-static ino_t lastino; /* last inode in use */
static void checkinode __P((ino_t inumber, struct inodesc *));
void
pass1()
{
- u_int8_t *cp;
ino_t inumber;
- int c, i, cgd, inosused;
- struct inostat *info;
+ int c, i, cgd;
struct inodesc idesc;
/*
@@ -84,84 +81,15 @@ pass1()
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1check;
+ inumber = 0;
n_files = n_blks = 0;
+ resetinodebuf();
for (c = 0; c < sblock.fs_ncg; c++) {
- inumber = c * sblock.fs_ipg;
- setinodebuf(inumber);
- inosused = sblock.fs_ipg;
- /*
- * If we are using soft updates, then we can trust the
- * cylinder group inode allocation maps to tell us which
- * inodes are allocated. We will scan the used inode map
- * to find the inodes that are really in use, and then
- * read only those inodes in from disk.
- */
- if (preen && usedsoftdep) {
- getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize);
- if (!cg_chkmagic(&cgrp))
- pfatal("CG %d: BAD MAGIC NUMBER\n", c);
- cp = &cg_inosused(&cgrp)[(sblock.fs_ipg - 1) / NBBY];
- for ( ; inosused > 0; inosused -= NBBY, cp--) {
- if (*cp == 0)
- continue;
- for (i = 1 << (NBBY - 1); i > 0; i >>= 1) {
- if (*cp & i)
- break;
- inosused--;
- }
- break;
- }
- if (inosused < 0)
- inosused = 0;
- }
- /*
- * Allocate inoinfo structures for the allocated inodes.
- */
- inostathead[c].il_numalloced = inosused;
- if (inosused == 0) {
- inostathead[c].il_stat = 0;
- continue;
- }
- info = calloc((unsigned)inosused, sizeof(struct inostat));
- if (info == NULL)
- pfatal("cannot alloc %u bytes for inoinfo\n",
- (unsigned)(sizeof(struct inostat) * inosused));
- inostathead[c].il_stat = info;
- /*
- * Scan the allocated inodes.
- */
- for (i = 0; i < inosused; i++, inumber++) {
- if (inumber < ROOTINO) {
- (void)getnextinode(inumber);
+ for (i = 0; i < sblock.fs_ipg; i++, inumber++) {
+ if (inumber < ROOTINO)
continue;
- }
checkinode(inumber, &idesc);
}
- lastino += 1;
- if (inosused < sblock.fs_ipg || inumber == lastino)
- continue;
- /*
- * If we were not able to determine in advance which inodes
- * were in use, then reduce the size of the inoinfo structure
- * to the size necessary to describe the inodes that we
- * really found.
- */
- inosused = lastino - (c * sblock.fs_ipg);
- if (inosused < 0)
- inosused = 0;
- inostathead[c].il_numalloced = inosused;
- if (inosused == 0) {
- free(inostathead[c].il_stat);
- inostathead[c].il_stat = 0;
- continue;
- }
- info = calloc((unsigned)inosused, sizeof(struct inostat));
- if (info == NULL)
- pfatal("cannot alloc %u bytes for inoinfo\n",
- (unsigned)(sizeof(struct inostat) * inosused));
- memmove(info, inostathead[c].il_stat, inosused * sizeof(*info));
- free(inostathead[c].il_stat);
- inostathead[c].il_stat = info;
}
freeinodebuf();
}
@@ -192,7 +120,7 @@ checkinode(inumber, idesc)
inodirty();
}
}
- inoinfo(inumber)->ino_state = USTATE;
+ statemap[inumber] = USTATE;
return;
}
lastino = inumber;
@@ -230,7 +158,8 @@ checkinode(inumber, idesc)
if (debug) {
symbuf[dp->di_size] = 0;
printf("convert symlink %lu(%s) of size %ld\n",
- (u_long)inumber, symbuf, (long)dp->di_size);
+ (u_long)inumber, symbuf,
+ (long)dp->di_size);
}
dp = ginode(inumber);
memmove(dp->di_shortlink, symbuf, (long)dp->di_size);
@@ -241,7 +170,8 @@ checkinode(inumber, idesc)
* Fake ndb value so direct/indirect block checks below
* will detect any garbage after symlink string.
*/
- if (dp->di_size < sblock.fs_maxsymlinklen) {
+ if (dp->di_size < sblock.fs_maxsymlinklen ||
+ dp->di_blocks == 0) {
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
if (ndb > NDADDR) {
j = ndb - NDADDR;
@@ -270,7 +200,7 @@ checkinode(inumber, idesc)
if (ftypeok(dp) == 0)
goto unknown;
n_files++;
- inoinfo(inumber)->ino_linkcnt = dp->di_nlink;
+ lncntp[inumber] = dp->di_nlink;
if (dp->di_nlink <= 0) {
zlnp = (struct zlncnt *)malloc(sizeof *zlnp);
if (zlnp == NULL) {
@@ -287,14 +217,13 @@ checkinode(inumber, idesc)
}
if (mode == IFDIR) {
if (dp->di_size == 0)
- inoinfo(inumber)->ino_state = DCLEAR;
+ statemap[inumber] = DCLEAR;
else
- inoinfo(inumber)->ino_state = DSTATE;
+ statemap[inumber] = DSTATE;
cacheino(dp, inumber);
- countdirs++;
} else
- inoinfo(inumber)->ino_state = FSTATE;
- inoinfo(inumber)->ino_type = IFTODT(mode);
+ statemap[inumber] = FSTATE;
+ typemap[inumber] = IFTODT(mode);
if (doinglevel2 &&
(dp->di_ouid != (u_short)-1 || dp->di_ogid != (u_short)-1)) {
dp = ginode(inumber);
@@ -322,9 +251,9 @@ checkinode(inumber, idesc)
return;
unknown:
pfatal("UNKNOWN FILE TYPE I=%lu", inumber);
- inoinfo(inumber)->ino_state = FCLEAR;
+ statemap[inumber] = FCLEAR;
if (reply("CLEAR") == 1) {
- inoinfo(inumber)->ino_state = USTATE;
+ statemap[inumber] = USTATE;
dp = ginode(inumber);
clearinode(dp);
inodirty();
diff --git a/sbin/fsck/pass1b.c b/sbin/fsck/pass1b.c
index 9380382a9198..32a3be7723bd 100644
--- a/sbin/fsck/pass1b.c
+++ b/sbin/fsck/pass1b.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)pass1b.c 8.4 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: pass1b.c,v 1.4 1998/06/15 07:07:17 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -72,7 +72,7 @@ pass1b()
if (dp == NULL)
continue;
idesc.id_number = inumber;
- if (inoinfo(inumber)->ino_state != USTATE &&
+ if (statemap[inumber] != USTATE &&
(ckinode(dp, &idesc) & STOP))
return;
}
diff --git a/sbin/fsck/pass2.c b/sbin/fsck/pass2.c
index 878bcbead4b7..4c24b23a9ca4 100644
--- a/sbin/fsck/pass2.c
+++ b/sbin/fsck/pass2.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)pass2.c 8.9 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: pass2.c,v 1.7 1998/06/15 07:07:18 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -64,7 +64,7 @@ pass2()
struct dinode dino;
char pathbuf[MAXPATHLEN + 1];
- switch (inoinfo(ROOTINO)->ino_state) {
+ switch (statemap[ROOTINO]) {
case USTATE:
pfatal("ROOT INODE UNALLOCATED");
@@ -113,13 +113,12 @@ pass2()
break;
default:
- errx(EEXIT, "BAD STATE %d FOR ROOT INODE",
- inoinfo(ROOTINO)->ino_state);
+ errx(EEXIT, "BAD STATE %d FOR ROOT INODE", statemap[ROOTINO]);
}
- inoinfo(ROOTINO)->ino_state = DFOUND;
+ statemap[ROOTINO] = DFOUND;
if (newinofmt) {
- inoinfo(WINO)->ino_state = FSTATE;
- inoinfo(WINO)->ino_type = DT_WHT;
+ statemap[WINO] = FSTATE;
+ typemap[WINO] = DT_WHT;
}
/*
* Sort the directory list into disk block order.
@@ -182,9 +181,9 @@ pass2()
inp = *inpp;
if (inp->i_parent == 0 || inp->i_isize == 0)
continue;
- if (inoinfo(inp->i_parent)->ino_state == DFOUND &&
- inoinfo(inp->i_number)->ino_state == DSTATE)
- inoinfo(inp->i_number)->ino_state = DFOUND;
+ if (statemap[inp->i_parent] == DFOUND &&
+ statemap[inp->i_number] == DSTATE)
+ statemap[inp->i_number] = DFOUND;
if (inp->i_dotdot == inp->i_parent ||
inp->i_dotdot == (ino_t)-1)
continue;
@@ -194,15 +193,15 @@ pass2()
if (reply("FIX") == 0)
continue;
(void)makeentry(inp->i_number, inp->i_parent, "..");
- inoinfo(inp->i_parent)->ino_linkcnt--;
+ lncntp[inp->i_parent]--;
continue;
}
fileerror(inp->i_parent, inp->i_number,
"BAD INODE NUMBER FOR '..'");
if (reply("FIX") == 0)
continue;
- inoinfo(inp->i_dotdot)->ino_linkcnt++;
- inoinfo(inp->i_parent)->ino_linkcnt--;
+ lncntp[inp->i_dotdot]++;
+ lncntp[inp->i_parent]--;
inp->i_dotdot = inp->i_parent;
(void)changeino(inp->i_number, "..", inp->i_parent);
}
@@ -229,7 +228,7 @@ pass2check(idesc)
* If converting, set directory entry type.
*/
if (doinglevel2 && dirp->d_ino > 0 && dirp->d_ino < maxino) {
- dirp->d_type = inoinfo(dirp->d_ino)->ino_type;
+ dirp->d_type = typemap[dirp->d_ino];
ret |= ALTERED;
}
/*
@@ -285,7 +284,7 @@ pass2check(idesc)
proto.d_reclen = entrysize;
memmove(dirp, &proto, (size_t)entrysize);
idesc->id_entryno++;
- inoinfo(dirp->d_ino)->ino_linkcnt--;
+ lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + entrysize);
memset(dirp, 0, (size_t)n);
dirp->d_reclen = n;
@@ -320,7 +319,7 @@ chk1:
proto.d_reclen = dirp->d_reclen - n;
dirp->d_reclen = n;
idesc->id_entryno++;
- inoinfo(dirp->d_ino)->ino_linkcnt--;
+ lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + n);
memset(dirp, 0, (size_t)proto.d_reclen);
dirp->d_reclen = proto.d_reclen;
@@ -357,7 +356,7 @@ chk1:
}
idesc->id_entryno++;
if (dirp->d_ino != 0)
- inoinfo(dirp->d_ino)->ino_linkcnt--;
+ lncntp[dirp->d_ino]--;
return (ret|KEEPON);
chk2:
if (dirp->d_ino == 0)
@@ -395,7 +394,7 @@ chk2:
ret |= ALTERED;
} else {
again:
- switch (inoinfo(dirp->d_ino)->ino_state) {
+ switch (statemap[dirp->d_ino]) {
case USTATE:
if (idesc->id_entryno <= 2)
break;
@@ -407,7 +406,7 @@ again:
case FCLEAR:
if (idesc->id_entryno <= 2)
break;
- if (inoinfo(dirp->d_ino)->ino_state == FCLEAR)
+ if (statemap[dirp->d_ino] == FCLEAR)
errmsg = "DUP/BAD";
else if (!preen && !usedsoftdep)
errmsg = "ZERO LENGTH DIRECTORY";
@@ -419,14 +418,14 @@ again:
if ((n = reply("REMOVE")) == 1)
break;
dp = ginode(dirp->d_ino);
- inoinfo(dirp->d_ino)->ino_state =
+ statemap[dirp->d_ino] =
(dp->di_mode & IFMT) == IFDIR ? DSTATE : FSTATE;
- inoinfo(dirp->d_ino)->ino_linkcnt = dp->di_nlink;
+ lncntp[dirp->d_ino] = dp->di_nlink;
goto again;
case DSTATE:
- if (inoinfo(idesc->id_number)->ino_state == DFOUND)
- inoinfo(dirp->d_ino)->ino_state = DFOUND;
+ if (statemap[idesc->id_number] == DFOUND)
+ statemap[dirp->d_ino] = DFOUND;
/* fall through */
case DFOUND:
@@ -440,10 +439,10 @@ again:
namebuf);
if (preen) {
printf(" (REMOVED)\n");
- n = 1;
- break;
+ n = 1;
+ break;
}
- if ((n = reply("REMOVE")) == 1)
+ else if ((n = reply("REMOVE")) == 1)
break;
}
if (idesc->id_entryno > 2)
@@ -451,20 +450,19 @@ again:
/* fall through */
case FSTATE:
- if (newinofmt &&
- dirp->d_type != inoinfo(dirp->d_ino)->ino_type) {
+ if (newinofmt && dirp->d_type != typemap[dirp->d_ino]) {
fileerror(idesc->id_number, dirp->d_ino,
"BAD TYPE VALUE");
- dirp->d_type = inoinfo(dirp->d_ino)->ino_type;
+ dirp->d_type = typemap[dirp->d_ino];
if (reply("FIX") == 1)
ret |= ALTERED;
}
- inoinfo(dirp->d_ino)->ino_linkcnt--;
+ lncntp[dirp->d_ino]--;
break;
default:
errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
- inoinfo(dirp->d_ino)->ino_state, dirp->d_ino);
+ statemap[dirp->d_ino], dirp->d_ino);
}
}
if (n == 0)
diff --git a/sbin/fsck/pass3.c b/sbin/fsck/pass3.c
index f91f2c1df1eb..6524a117e9a6 100644
--- a/sbin/fsck/pass3.c
+++ b/sbin/fsck/pass3.c
@@ -36,83 +36,41 @@
static const char sccsid[] = "@(#)pass3.c 8.2 (Berkeley) 4/27/95";
#endif
static const char rcsid[] =
- "$Id: pass3.c,v 1.4 1998/06/15 07:07:18 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
#include <ufs/ufs/dinode.h>
-#include <ufs/ufs/dir.h>
-#include <ufs/ffs/fs.h>
-
-#include <string.h>
#include "fsck.h"
void
pass3()
{
- struct inoinfo *inp;
- int loopcnt, inpindex, state;
+ register struct inoinfo **inpp, *inp;
ino_t orphan;
- struct inodesc idesc;
- char namebuf[MAXNAMLEN+1];
+ int loopcnt;
- for (inpindex = inplast - 1; inpindex >= 0; inpindex--) {
- inp = inpsort[inpindex];
- state = inoinfo(inp->i_number)->ino_state;
+ for (inpp = &inpsort[inplast - 1]; inpp >= inpsort; inpp--) {
+ inp = *inpp;
if (inp->i_number == ROOTINO ||
- (inp->i_parent != 0 && state != DSTATE))
- continue;
- if (state == DCLEAR)
+ !(inp->i_parent == 0 || statemap[inp->i_number] == DSTATE))
continue;
- /*
- * If we are running with soft updates and we come
- * across unreferenced directories, we just leave
- * them in DSTATE which will cause them to be pitched
- * in pass 4.
- */
- if (preen && resolved && usedsoftdep && state == DSTATE) {
- if (inp->i_dotdot >= ROOTINO)
- inoinfo(inp->i_dotdot)->ino_linkcnt++;
+ if (statemap[inp->i_number] == DCLEAR)
continue;
- }
for (loopcnt = 0; ; loopcnt++) {
orphan = inp->i_number;
if (inp->i_parent == 0 ||
- inoinfo(inp->i_parent)->ino_state != DSTATE ||
- loopcnt > countdirs)
+ statemap[inp->i_parent] != DSTATE ||
+ loopcnt > numdirs)
break;
inp = getinoinfo(inp->i_parent);
}
- if (loopcnt <= countdirs) {
- if (linkup(orphan, inp->i_dotdot, NULL)) {
- inp->i_parent = inp->i_dotdot = lfdir;
- inoinfo(lfdir)->ino_linkcnt--;
- }
- inoinfo(orphan)->ino_state = DFOUND;
- propagate();
- continue;
- }
- pfatal("ORPHANED DIRECTORY LOOP DETECTED I=%lu", orphan);
- if (reply("RECONNECT") == 0)
- continue;
- memset(&idesc, 0, sizeof(struct inodesc));
- idesc.id_type = DATA;
- idesc.id_number = inp->i_parent;
- idesc.id_parent = orphan;
- idesc.id_func = findname;
- idesc.id_name = namebuf;
- if ((ckinode(ginode(inp->i_parent), &idesc) & FOUND) == 0)
- pfatal("COULD NOT FIND NAME IN PARENT DIRECTORY");
- if (linkup(orphan, inp->i_parent, namebuf)) {
- idesc.id_func = clearentry;
- if (ckinode(ginode(inp->i_parent), &idesc) & FOUND)
- inoinfo(orphan)->ino_linkcnt++;
- inp->i_parent = inp->i_dotdot = lfdir;
- inoinfo(lfdir)->ino_linkcnt--;
- }
- inoinfo(orphan)->ino_state = DFOUND;
+ (void)linkup(orphan, inp->i_dotdot);
+ inp->i_parent = inp->i_dotdot = lfdir;
+ lncntp[lfdir]--;
+ statemap[orphan] = DFOUND;
propagate();
}
}
diff --git a/sbin/fsck/pass4.c b/sbin/fsck/pass4.c
index 77b03ee0de81..b2f1fe9ff00b 100644
--- a/sbin/fsck/pass4.c
+++ b/sbin/fsck/pass4.c
@@ -36,13 +36,12 @@
static const char sccsid[] = "@(#)pass4.c 8.4 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: pass4.c,v 1.4 1998/06/15 07:07:19 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
#include <ufs/ufs/dinode.h>
-#include <ufs/ffs/fs.h>
#include <err.h>
#include <string.h>
@@ -56,27 +55,22 @@ pass4()
register struct zlncnt *zlnp;
struct dinode *dp;
struct inodesc idesc;
- int i, n, cg;
+ int n;
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
- for (cg = 0; cg < sblock.fs_ncg; cg++) {
- inumber = cg * sblock.fs_ipg;
- for (i = 0; i < inostathead[cg].il_numalloced; i++, inumber++) {
- if (inumber < ROOTINO)
- continue;
- idesc.id_number = inumber;
- switch (inoinfo(inumber)->ino_state) {
+ for (inumber = ROOTINO; inumber <= lastino; inumber++) {
+ idesc.id_number = inumber;
+ switch (statemap[inumber]) {
- case FSTATE:
- case DFOUND:
- n = inoinfo(inumber)->ino_linkcnt;
- if (n) {
- adjust(&idesc, (short)n);
- break;
- }
- for (zlnp = zlnhead; zlnp; zlnp = zlnp->next) {
+ case FSTATE:
+ case DFOUND:
+ n = lncntp[inumber];
+ if (n)
+ adjust(&idesc, (short)n);
+ else {
+ for (zlnp = zlnhead; zlnp; zlnp = zlnp->next)
if (zlnp->zlncnt == inumber) {
zlnp->zlncnt = zlnhead->zlncnt;
zlnp = zlnhead;
@@ -85,31 +79,30 @@ pass4()
clri(&idesc, "UNREF", 1);
break;
}
- }
- break;
+ }
+ break;
- case DSTATE:
- clri(&idesc, "UNREF", 1);
- break;
+ case DSTATE:
+ clri(&idesc, "UNREF", 1);
+ break;
- case DCLEAR:
- dp = ginode(inumber);
- if (dp->di_size == 0) {
- clri(&idesc, "ZERO LENGTH", 1);
- break;
- }
- /* fall through */
- case FCLEAR:
- clri(&idesc, "BAD/DUP", 1);
+ case DCLEAR:
+ dp = ginode(inumber);
+ if (dp->di_size == 0) {
+ clri(&idesc, "ZERO LENGTH", 1);
break;
+ }
+ /* fall through */
+ case FCLEAR:
+ clri(&idesc, "BAD/DUP", 1);
+ break;
- case USTATE:
- break;
+ case USTATE:
+ break;
- default:
- errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
- inoinfo(inumber)->ino_state, inumber);
- }
+ default:
+ errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
+ statemap[inumber], inumber);
}
}
}
diff --git a/sbin/fsck/pass5.c b/sbin/fsck/pass5.c
index d546e3fe3149..f3994f84e2f8 100644
--- a/sbin/fsck/pass5.c
+++ b/sbin/fsck/pass5.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: pass5.c,v 1.14 1998/08/15 10:07:33 dfr Exp $";
+ "$Id: pass5.c,v 1.13 1998/08/04 09:19:03 phk Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,7 +52,7 @@ static const char rcsid[] =
void
pass5()
{
- int c, blk, frags, basesize, sumsize, mapsize, savednrpos = 0;
+ int c, blk, frags, basesize, sumsize, mapsize, savednrpos;
int inomapsize, blkmapsize;
struct fs *fs = &sblock;
struct cg *cg = &cgrp;
@@ -66,7 +66,7 @@ pass5()
register struct cg *newcg = (struct cg *)buf;
struct ocg *ocg = (struct ocg *)buf;
- inoinfo(WINO)->ino_state = USTATE;
+ statemap[WINO] = USTATE;
memset(newcg, 0, (size_t)fs->fs_cgsize);
newcg->cg_niblk = fs->fs_ipg;
if (cvtlevel >= 3) {
@@ -207,8 +207,8 @@ pass5()
if (fs->fs_postblformat == FS_42POSTBLFMT)
ocg->cg_magic = CG_MAGIC;
j = fs->fs_ipg * c;
- for (i = 0; i < inostathead[c].il_numalloced; j++, i++) {
- switch (inoinfo(j)->ino_state) {
+ for (i = 0; i < fs->fs_ipg; j++, i++) {
+ switch (statemap[j]) {
case USTATE:
break;
@@ -229,7 +229,7 @@ pass5()
if (j < ROOTINO)
break;
errx(EEXIT, "BAD STATE %d FOR INODE I=%ld",
- inoinfo(j)->ino_state, j);
+ statemap[j], j);
}
}
if (c == 0)
@@ -325,7 +325,7 @@ pass5()
if (cg_inosused(cg)[i] & (1 << k))
continue;
pwarn("ALLOCATED INODE %d MARKED FREE\n",
- c * fs->fs_ipg + i * NBBY + k);
+ c * fs->fs_ipg + i * 8 + k);
}
}
for (i = 0; i < blkmapsize; i++) {
@@ -338,7 +338,7 @@ pass5()
if (cg_blksfree(newcg)[i] & (1 << k))
continue;
pwarn("ALLOCATED FRAG %d MARKED FREE\n",
- c * fs->fs_fpg + i * NBBY + k);
+ c * fs->fs_fpg + i * 8 + k);
}
}
}
@@ -355,7 +355,24 @@ pass5()
&& dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
memmove(&fs->fs_cstotal, &cstotal, sizeof *cs);
fs->fs_ronly = 0;
- fs->fs_fmod = 0;
sbdirty();
}
+ if (fs->fs_fmod != 0) {
+ pwarn("MODIFIED FLAG SET IN SUPERBLOCK");
+ if (preen)
+ printf(" (FIXED)\n");
+ if (preen || reply("FIX") == 1) {
+ fs->fs_fmod = 0;
+ sbdirty();
+ }
+ }
+ if (fs->fs_clean == 0) {
+ pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK");
+ if (preen)
+ printf(" (FIXED)\n");
+ if (preen || reply("FIX") == 1) {
+ fs->fs_clean = 1;
+ sbdirty();
+ }
+ }
}
diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c
index cc8bba6e1e66..9705aeea9280 100644
--- a/sbin/fsck/preen.c
+++ b/sbin/fsck/preen.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: preen.c,v 1.9 1998/06/15 07:07:20 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -46,7 +46,7 @@ static const char rcsid[] =
#include <ufs/ufs/dinode.h>
#include <ctype.h>
-#include <errno.h>
+#include <err.h>
#include <fstab.h>
#include <string.h>
@@ -93,8 +93,7 @@ checkfstab(preen, maxrun, docheck, chkit)
sumstatus = 0;
for (passno = 1; passno <= 2; passno++) {
if (setfsent() == 0) {
- fprintf(stderr, "Can't open checklist file: %s\n",
- _PATH_FSTAB);
+ warnx("can't open checklist file: %s", _PATH_FSTAB);
return (8);
}
while ((fsp = getfsent()) != 0) {
@@ -223,15 +222,11 @@ finddisk(name)
dk->name[len] == 0)
return (dk);
}
- if ((*dkp = (struct disk *)malloc(sizeof(struct disk))) == NULL) {
- fprintf(stderr, "out of memory");
- exit (8);
- }
+ if ((*dkp = (struct disk *)malloc(sizeof(struct disk))) == NULL)
+ errx(8, "out of memory");
dk = *dkp;
- if ((dk->name = malloc(len + 1)) == NULL) {
- fprintf(stderr, "out of memory");
- exit (8);
- }
+ if ((dk->name = malloc(len + 1)) == NULL)
+ errx(8, "out of memory");
(void)strncpy(dk->name, name, len);
dk->name[len] = '\0';
dk->part = NULL;
@@ -254,20 +249,14 @@ addpart(name, fsname, auxdata)
printf("%s in fstab more than once!\n", name);
return;
}
- if ((*ppt = (struct part *)malloc(sizeof(struct part))) == NULL) {
- fprintf(stderr, "out of memory");
- exit (8);
- }
+ if ((*ppt = (struct part *)malloc(sizeof(struct part))) == NULL)
+ errx(8, "out of memory");
pt = *ppt;
- if ((pt->name = malloc(strlen(name) + 1)) == NULL) {
- fprintf(stderr, "out of memory");
- exit (8);
- }
+ if ((pt->name = malloc(strlen(name) + 1)) == NULL)
+ errx(8, "out of memory");
(void)strcpy(pt->name, name);
- if ((pt->fsname = malloc(strlen(fsname) + 1)) == NULL) {
- fprintf(stderr, "out of memory");
- exit (8);
- }
+ if ((pt->fsname = malloc(strlen(fsname) + 1)) == NULL)
+ errx(8, "out of memory");
(void)strcpy(pt->fsname, fsname);
pt->next = NULL;
pt->auxdata = auxdata;
@@ -282,7 +271,7 @@ startdisk(dk, checkit)
dk->pid = fork();
if (dk->pid < 0) {
- perror("fork");
+ warn("fork");
return (8);
}
if (dk->pid == 0)
@@ -298,17 +287,19 @@ blockcheck(origname)
struct stat stslash, stblock, stchar;
char *newname, *raw;
struct fstab *fsinfo;
- int retried = 0, len;
+ int retried = 0, l;
hotroot = 0;
if (stat("/", &stslash) < 0) {
- printf("Can't stat /: %s\n", strerror(errno));
+ warn("/");
+ printf("Can't stat root\n");
return (origname);
}
newname = origname;
retry:
if (stat(newname, &stblock) < 0) {
- printf("Can't stat %s: %s\n", newname, strerror(errno));
+ warn("%s", newname);
+ printf("Can't stat %s\n", newname);
return (origname);
}
if ((stblock.st_mode & S_IFMT) == S_IFBLK) {
@@ -316,7 +307,8 @@ retry:
hotroot++;
raw = rawname(newname);
if (stat(raw, &stchar) < 0) {
- printf("Can't stat %s: %s\n", raw, strerror(errno));
+ warn("%s", raw);
+ printf("Can't stat %s\n", raw);
return (origname);
}
if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
@@ -326,15 +318,15 @@ retry:
return (origname);
}
} else if ((stblock.st_mode & S_IFMT) == S_IFCHR && !retried) {
- newname = unrawname(newname);
+ newname = unrawname(origname);
retried++;
goto retry;
} else if ((stblock.st_mode & S_IFMT) == S_IFDIR && !retried) {
- len = strlen(origname) - 1;
- if (len > 0 && origname[len] == '/')
+ l = strlen(origname) - 1;
+ if (l > 0 && origname[l] == '/')
/* remove trailing slash */
- origname[len] = '\0';
- if ((fsinfo = getfsfile(origname)) == NULL) {
+ origname[l] = '\0';
+ if(!(fsinfo=getfsfile(origname))) {
printf("Can't resolve %s to character special device",
origname);
return (0);
diff --git a/sbin/fsck/setup.c b/sbin/fsck/setup.c
index 88a7b6b1e340..25dab92ad56d 100644
--- a/sbin/fsck/setup.c
+++ b/sbin/fsck/setup.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95";
#endif
static const char rcsid[] =
- "$Id: setup.c,v 1.12 1998/06/28 19:23:03 bde Exp $";
+ "$Id: setup.c,v 1.11 1998/06/15 07:07:21 charnier Exp $";
#endif /* not lint */
#define DKTYPENAMES
@@ -82,7 +82,7 @@ setup(dev)
havesb = 0;
fswritefd = -1;
- skipclean = fflag ? 0 : preen;
+ skipclean = preen;
if (stat(dev, &statb) < 0) {
printf("Can't stat %s: %s\n", dev, strerror(errno));
return (0);
@@ -114,7 +114,8 @@ setup(dev)
asblk.b_un.b_buf = malloc(SBSIZE);
if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL)
errx(EEXIT, "cannot allocate space for superblock");
- if ((lp = getdisklabel(NULL, fsreadfd)))
+ lp = getdisklabel((char *)NULL, fsreadfd);
+ if (lp)
dev_bsize = secsize = lp->d_secsize;
else
dev_bsize = secsize = DEV_BSIZE;
@@ -146,10 +147,6 @@ setup(dev)
pwarn("USING ALTERNATE SUPERBLOCK AT %d\n", bflag);
bflag = 0;
}
- if (skipclean && sblock.fs_clean) {
- pwarn("FILESYSTEM CLEAN; SKIPPING CHECKS\n");
- return (-1);
- }
maxfsblock = sblock.fs_size;
maxino = sblock.fs_ncg * sblock.fs_ipg;
/*
@@ -268,6 +265,12 @@ setup(dev)
}
}
/*
+ * If we survive the above basic checks and are preening,
+ * quit here unless forced.
+ */
+ if (skipclean && sblock.fs_clean && !fflag)
+ return (-1);
+ /*
* allocate and initialize the necessary maps
*/
bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(short));
@@ -277,11 +280,22 @@ setup(dev)
(unsigned)bmapsize);
goto badsb;
}
- inostathead = calloc((unsigned)(sblock.fs_ncg),
- sizeof(struct inostatlist));
- if (inostathead == NULL) {
- printf("cannot alloc %u bytes for inostathead\n",
- (unsigned)(sizeof(struct inostatlist) * (sblock.fs_ncg)));
+ statemap = calloc((unsigned)(maxino + 1), sizeof(char));
+ if (statemap == NULL) {
+ printf("cannot alloc %u bytes for statemap\n",
+ (unsigned)(maxino + 1));
+ goto badsb;
+ }
+ typemap = calloc((unsigned)(maxino + 1), sizeof(char));
+ if (typemap == NULL) {
+ printf("cannot alloc %u bytes for typemap\n",
+ (unsigned)(maxino + 1));
+ goto badsb;
+ }
+ lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
+ if (lncntp == NULL) {
+ printf("cannot alloc %u bytes for lncntp\n",
+ (unsigned)(maxino + 1) * sizeof(short));
goto badsb;
}
numdirs = sblock.fs_cstotal.cs_ndir;
@@ -460,11 +474,9 @@ calcsb(dev, devfd, fs)
fstypenames[pp->p_fstype] : "unknown");
return (0);
}
- if (pp->p_fsize == 0 || pp->p_frag == 0 ||
- pp->p_cpg == 0 || pp->p_size == 0) {
- pfatal("%s: %s: type %s fsize %d, frag %d, cpg %d, size %d\n",
- dev, "INCOMPLETE LABEL", fstypenames[pp->p_fstype],
- pp->p_fsize, pp->p_frag, pp->p_cpg, pp->p_size);
+ if (pp->p_fsize == 0 || pp->p_frag == 0) {
+ pfatal("%s: LABELED AS A %s FILE SYSTEM, BUT BLOCK SIZE IS 0\n",
+ dev, fstypenames[pp->p_fstype]);
return (0);
}
memset(fs, 0, sizeof(struct fs));
diff --git a/sbin/fsck/utilities.c b/sbin/fsck/utilities.c
index b072964e8bf2..0d82d6ebbcf6 100644
--- a/sbin/fsck/utilities.c
+++ b/sbin/fsck/utilities.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95";
#endif
static const char rcsid[] =
- "$Id: utilities.c,v 1.8 1998/06/15 07:07:21 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -45,6 +45,7 @@ static const char rcsid[] =
#include <ufs/ufs/dir.h>
#include <ufs/ffs/fs.h>
+#include <ctype.h>
#include <err.h>
#include <string.h>
@@ -115,26 +116,6 @@ reply(question)
}
/*
- * Look up state information for an inode.
- */
-struct inostat *
-inoinfo(inum)
- ino_t inum;
-{
- static struct inostat unallocated = { USTATE, 0, 0 };
- struct inostatlist *ilp;
- int iloff;
-
- if (inum > maxino)
- errx(EEXIT, "inoinfo: inumber %d out of range", inum);
- ilp = &inostathead[inum / sblock.fs_ipg];
- iloff = inum % sblock.fs_ipg;
- if (iloff >= ilp->il_numalloced)
- return (&unallocated);
- return (&ilp->il_stat[iloff]);
-}
-
-/*
* Malloc buffers and set up cache.
*/
void
@@ -291,21 +272,14 @@ ckfini(markclean)
if (bufhead.b_size != cnt)
errx(EEXIT, "panic: lost %d buffers", bufhead.b_size - cnt);
pbp = pdirbp = (struct bufarea *)0;
- if (sblock.fs_clean != markclean) {
- sblock.fs_clean = markclean;
+ if (markclean && sblock.fs_clean == 0) {
+ sblock.fs_clean = 1;
sbdirty();
ofsmodified = fsmodified;
flush(fswritefd, &sblk);
fsmodified = ofsmodified;
- if (!preen) {
- printf("\n***** FILE SYSTEM MARKED %s *****\n",
- markclean ? "CLEAN" : "DIRTY");
- if (!markclean)
- rerun = 1;
- }
- } else if (!preen && !markclean) {
- printf("\n***** FILE SYSTEM STILL DIRTY *****\n");
- rerun = 1;
+ if (!preen)
+ printf("\n***** FILE SYSTEM MARKED CLEAN *****\n");
}
if (debug)
printf("cache missed %ld of %ld (%d%%)\n", diskreads,
@@ -350,8 +324,6 @@ bread(fd, buf, blk, size)
}
}
printf("\n");
- if (errs)
- resolved = 0;
return (errs);
}
@@ -376,7 +348,6 @@ bwrite(fd, buf, blk, size)
fsmodified = 1;
return;
}
- resolved = 0;
rwerror("WRITE", blk);
if (lseek(fd, offset, 0) < 0)
rwerror("SEEK", blk);
@@ -467,8 +438,7 @@ getpathname(namebuf, curdir, ino)
return;
}
if (busy ||
- (inoinfo(curdir)->ino_state != DSTATE &&
- inoinfo(curdir)->ino_state != DFOUND)) {
+ (statemap[curdir] != DSTATE && statemap[curdir] != DFOUND)) {
(void)strcpy(namebuf, "?");
return;
}
@@ -619,16 +589,14 @@ pfatal(fmt, va_alist)
va_end(ap);
if (usedsoftdep)
(void)fprintf(stderr,
- "\nUNEXPECTED SOFT UPDATE INCONSISTENCY\n");
+ "\nUNEXPECTED SOFTDEP INCONSISTENCY\n");
return;
}
- if (cdevname == NULL)
- cdevname = "fsck";
(void)fprintf(stderr, "%s: ", cdevname);
(void)vfprintf(stderr, fmt, ap);
(void)fprintf(stderr,
"\n%s: UNEXPECTED%sINCONSISTENCY; RUN fsck MANUALLY.\n",
- cdevname, usedsoftdep ? " SOFT UPDATE " : " ");
+ cdevname, usedsoftdep ? " SOFTDEP " : " ");
ckfini(0);
exit(EEXIT);
}
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index 423a160bf424..86a02cf25cad 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -30,7 +30,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: fsdb.c,v 1.10 1998/06/15 07:12:19 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -617,7 +617,7 @@ CMDFUNCSTART(newtype)
return 1;
type = curinode->di_mode & IFMT;
for (tp = typenamemap;
- tp < &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)];
+ tp < &typenamemap[sizeof(typemap)/sizeof(*typemap)];
tp++) {
if (!strcmp(argv[1], tp->typename)) {
printf("setting type to %s\n", tp->typename);
@@ -625,7 +625,7 @@ CMDFUNCSTART(newtype)
break;
}
}
- if (tp == &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)]) {
+ if (tp == &typenamemap[sizeof(typemap)/sizeof(*typemap)]) {
warnx("type `%s' not known", argv[1]);
warnx("try one of `file', `dir', `socket', `fifo'");
return 1;
diff --git a/sbin/i386/fdisk/fdisk.8 b/sbin/i386/fdisk/fdisk.8
index e4ce0a54720f..2248b6a0c2a9 100644
--- a/sbin/i386/fdisk/fdisk.8
+++ b/sbin/i386/fdisk/fdisk.8
@@ -110,12 +110,12 @@ prints out the partition table that is written to the disk.
The final disk name can be provided as a
.Sq bare
disk name only, e.g.
-.Ql da0 ,
+.Ql sd0 ,
or as a fully qualified device node under
.Pa /dev .
If omitted, the disks
.Ql wd0 ,
-.Ql da0 ,
+.Ql sd0 ,
and
.Ql od0
are being searched in that order, until one is
diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c
index 219a8b3dcff0..ef274e118d30 100644
--- a/sbin/i386/fdisk/fdisk.c
+++ b/sbin/i386/fdisk/fdisk.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: fdisk.c,v 1.26 1998/11/06 03:43:21 alex Exp $";
+ "$Id: fdisk.c,v 1.23 1998/07/06 06:44:36 charnier Exp $";
#endif /* not lint */
#include <sys/disklabel.h>
@@ -67,7 +67,7 @@ int secsize = 0; /* the sensed sector size */
const char *disk;
const char *disks[] =
{
- "/dev/rwd0", "/dev/rda0", "/dev/rod0", 0
+ "/dev/rwd0", "/dev/rsd0", "/dev/rod0", 0
};
struct disklabel disklabel; /* disk parameters */
@@ -196,11 +196,9 @@ struct part_type
,{0x83, "Linux filesystem"}
,{0x93, "Amoeba filesystem"}
,{0x94, "Amoeba bad block table"}
- ,{0x9F, "BSD/OS"}
,{0xA5, "FreeBSD/NetBSD/386BSD"}
,{0xA6, "OpenBSD"}
,{0xA7, "NEXTSTEP"}
- ,{0xA9, "NetBSD"}
,{0xB7, "BSDI BSD/386 filesystem"}
,{0xB8, "BSDI BSD/386 swap"}
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
diff --git a/sbin/i386/mount_msdos/mount_msdos.8 b/sbin/i386/mount_msdos/mount_msdos.8
index 2088285cc68c..46ca78bcff4c 100644
--- a/sbin/i386/mount_msdos/mount_msdos.8
+++ b/sbin/i386/mount_msdos/mount_msdos.8
@@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: mount_msdos.8,v 1.14 1998/06/30 06:23:41 charnier Exp $
+.\" $Id: mount_msdos.8,v 1.13 1998/03/01 08:41:05 ache Exp $
.\"
.Dd April 7, 1994
.Dt MOUNT_MSDOS 8
@@ -119,7 +119,7 @@ are given,
.Nm
searches the root directory of the filesystem to
be mounted for any existing Win'95 long filenames.
-If no such entries are found, but short DOS filenames are found,
+If no such entries are found,
.Fl s
is the default. Otherwise
.Fl l
@@ -190,6 +190,15 @@ mounted file system.
Cluster sizes larger than 16K are unavoidable for file system sizes
larger than 1G, and also occur when filesystems larger than 1G are
shrunk to smaller than 1G using FIPS.
+.Pp
+The default handling for
+.Fl s
+and
+.Fl l
+will result in empty filesystems to be populated
+with short filenames only. To generate long filenames
+on empty DOS filesystems use
+.Fl l .
.Sh HISTORY
The
.Nm
diff --git a/sbin/init/init.8 b/sbin/init/init.8
index 38d46ac3d72d..7ce1cee83b4a 100644
--- a/sbin/init/init.8
+++ b/sbin/init/init.8
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)init.8 8.3 (Berkeley) 4/18/94
-.\" $Id: init.8,v 1.12 1998/07/06 06:56:07 charnier Exp $
+.\" $Id: init.8,v 1.11 1998/06/19 08:34:52 jkoshy Exp $
.\"
.Dd April 18, 1994
.Dt INIT 8
@@ -113,13 +113,6 @@ This level precludes tampering with filesystems by unmounting them,
but also inhibits running
.Xr newfs 8
while the system is multi-user.
-.It Ic 3
-Network secure mode \- same as highly secure mode, plus
-IP packet filter rules (see
-.Xr ipfw 8
-and
-.Xr ipfirewall 4 )
-can not be changed and dummynet configuration can not be adjusted.
.El
.Pp
If the security level is initially -1, then
@@ -307,12 +300,10 @@ system shutdown commands
.Xr kill 1 ,
.Xr login 1 ,
.Xr sh 1 ,
-.Xr ipfirewall 4 ,
.Xr ttys 5 ,
.Xr crash 8 ,
.Xr getty 8 ,
.Xr halt 8 ,
-.Xr ipfw 8 ,
.Xr rc 8 ,
.Xr reboot 8 ,
.Xr shutdown 8 ,
@@ -327,7 +318,7 @@ Systems without
.Xr sysctl
behave as though they have security level \-1.
.Pp
-Setting the security level above 1 too early in the boot sequence can
+Setting the security level to 2 too early in the boot sequence can
prevent
.Xr fsck 8
from repairing inconsistent filesystems. The
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 40fb58277062..bd70c5822db8 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -6,11 +6,8 @@
.Nd controlling utility for IP firewall
.Sh SYNOPSIS
.Nm ipfw
-.Op Fl q
.Oo
-.Fl p Ar preproc
-.Op Fl D Ar macro Ns Op Ns =value
-.Op Fl U Ar macro
+.Fl q
.Oc
file
.Nm ipfw
@@ -61,32 +58,6 @@ will be read line by line and applied as arguments to the
.Nm
command.
.Pp
-Optionally, a preprocessor can be specified using
-.Fl p Ar preproc
-where
-.Ar file
-is to be piped through. Useful preprocessors include
-.Xr cpp 1
-and
-.Xr m4 1 .
-If
-.Ar preproc
-doesn't start with a slash as its first character, the usual
-.Ev PATH
-name search is performed. Care should be taken with this in environments
-where not all filesystems are mounted (yet) by the time
-.Nm
-is being run (e. g. since they are mounted over NFS). Once
-.Fl p
-has been specified, optional
-.Fl D
-and
-.Fl U
-specifcations can follow and will be passed on to the preprocessor.
-This allows for flexible configuration files (like conditionalizing
-them on the local hostname) and the use of macros to centralize
-frequently required arguments like IP addresses.
-.Pp
The
.Nm
code works by going through the rule-list for each packet,
@@ -511,11 +482,6 @@ ipfw flush
.Ed
.Pp
in similar surroundings is also a bad idea.
-.Pp
-The IP filter list may not be modified if the system security level
-is set to 3 or higher (see
-.Xr init 8
-for information on system security levels).
.Sh PACKET DIVERSION
A divert socket bound to the specified port will receive all packets diverted
to that port; see
@@ -549,14 +515,11 @@ This rule diverts all incoming packets from 192.168.2.0/24 to divert port 5000:
.Pp
.Dl ipfw divert 5000 all from 192.168.2.0/24 to any in
.Sh SEE ALSO
-.Xr cpp 1 ,
-.Xr m4 1 ,
.Xr divert 4 ,
.Xr ip 4 ,
.Xr ipfirewall 4 ,
.Xr protocols 5 ,
.Xr services 5 ,
-.Xr init 8 ,
.Xr reboot 8 ,
.Xr sysctl 8 ,
.Xr syslogd 8
@@ -580,8 +543,6 @@ are reassembled before delivery to the socket, whereas fragments diverted via
are not.
.Pp
Port aliases containing dashes cannot be first in a list.
-.Pp
-The ``tee'' action is unimplemented.
.Sh AUTHORS
.An Ugen J. S. Antsilevich ,
.An Poul-Henning Kamp ,
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index 22e794d6a81a..3f6807b11dc0 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -16,7 +16,7 @@
*
* NEW command line interface for IP firewall facility
*
- * $Id: ipfw.c,v 1.63 1998/12/14 18:43:03 luigi Exp $
+ * $Id: ipfw.c,v 1.59 1998/08/04 14:41:37 thepish Exp $
*
*/
@@ -25,21 +25,18 @@
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/time.h>
-#include <sys/wait.h>
#include <ctype.h>
#include <err.h>
-#include <errno.h>
#include <limits.h>
#include <netdb.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#include <sysexits.h>
#include <time.h>
#include <unistd.h>
+#include <sysexits.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -48,22 +45,17 @@
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_fw.h>
-#include <net/route.h> /* def. of struct route */
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <netinet/ip_dummynet.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
int lineno = -1;
int s; /* main RAW socket */
-int do_resolv=0; /* Would try to resolve all */
+int do_resolv=0; /* Would try to resolv all */
int do_acct=0; /* Show packet/byte count */
int do_time=0; /* Show time stamps */
int do_quiet=0; /* Be quiet in add and flush */
int do_force=0; /* Don't ask for confirmation */
-int do_pipe=0; /* this cmd refers to a pipe */
struct icmpcode {
int code;
@@ -224,9 +216,6 @@ show_ipfw(struct ip_fw *chain, int pcwidth, int bcwidth)
case IP_FW_F_SKIPTO:
printf("skipto %u", chain->fw_skipto_rule);
break;
- case IP_FW_F_PIPE:
- printf("pipe %u", chain->fw_skipto_rule);
- break ;
case IP_FW_F_REJECT:
if (chain->fw_reject_code == IP_FW_REJECT_RST)
printf("reset");
@@ -422,64 +411,12 @@ list(ac, av)
{
struct ip_fw *r;
struct ip_fw rules[1024];
- struct dn_pipe *p;
- struct dn_pipe pipes[1024];
int l,i,bytes;
unsigned long rulenum;
int pcwidth = 0;
int bcwidth = 0;
/* extract rules from kernel */
- if (do_pipe) {
- memset(rules,0,sizeof pipes);
- bytes = sizeof pipes;
- i = getsockopt(s, IPPROTO_IP, IP_DUMMYNET_GET, pipes, &bytes);
- if (i < 0)
- err(2,"getsockopt(IP_DUMMYNET_GET)");
- /* display requested pipes */
- if (ac > 0)
- rulenum = strtoul(*av++, NULL, 10);
- else
- rulenum = 0 ;
- for (p = pipes, l = bytes; l >= sizeof pipes[0];
- p++, l-=sizeof pipes[0]) {
- if (rulenum == 0 || rulenum == p->pipe_nr) {
- double b = p->bandwidth ;
- int l ;
- char buf[30] ;
- char qs[30] ;
- char plr[30] ;
-
- if (b == 0)
- sprintf(buf, "unlimited");
- else if (b >= 1000000)
- sprintf(buf, "%7.3f Mbit/s", b/1000000 );
- else if (b >= 1000)
- sprintf(buf, "%7.3f Kbit/s", b/1000 );
- else
- sprintf(buf, "%7.3f bit/s ", b );
-
- if ( (l = p->queue_size_bytes) ) {
- if (l >= 8192)
- sprintf(qs,"%d KB", l / 1024);
- else
- sprintf(qs,"%d B", l);
- } else
- sprintf(qs,"%3d sl.", p->queue_size);
- if (p->plr)
- sprintf(plr,"plr %f", 1.0*p->plr/(double)(0x7fffffff));
- else
- plr[0]='\0';
-
- printf("%05d: %s %4d ms %s %s -- %d pkts (%d B) %d drops\n",
- p->pipe_nr, buf, p->delay, qs, plr,
- p->r_len, p->r_len_bytes, p->r_drops);
- }
- }
-
- return ;
- }
-
memset(rules,0,sizeof rules);
bytes = sizeof rules;
i = getsockopt(s, IPPROTO_IP, IP_FW_GET, rules, &bytes);
@@ -841,26 +778,15 @@ delete(ac,av)
char **av;
{
struct ip_fw rule;
- struct dn_pipe pipe;
int i;
int exitval = EX_OK;
memset(&rule, 0, sizeof rule);
- memset(&pipe, 0, sizeof pipe);
av++; ac--;
/* Rule number */
while (ac && isdigit(**av)) {
- if (do_pipe) {
- pipe.pipe_nr = atoi(*av); av++; ac--;
- i = setsockopt(s, IPPROTO_IP, IP_DUMMYNET_DEL,
- &pipe, sizeof pipe);
- if (i) {
- exitval = 1;
- warn("rule %u: setsockopt(%s)", pipe.pipe_nr, "IP_DUMMYNET_DEL");
- }
- } else {
rule.fw_number = atoi(*av); av++; ac--;
i = setsockopt(s, IPPROTO_IP, IP_FW_DEL, &rule, sizeof rule);
if (i) {
@@ -868,7 +794,6 @@ delete(ac,av)
warn("rule %u: setsockopt(%s)", rule.fw_number, "IP_FW_DEL");
}
}
- }
if (exitval != EX_OK)
exit(exitval);
}
@@ -919,69 +844,6 @@ fill_iface(char *which, union ip_fw_if *ifu, int *byname, int ac, char *arg)
}
static void
-config_pipe(int ac, char **av)
-{
- struct dn_pipe pipe;
- int i ;
- char *end ;
-
- memset(&pipe, 0, sizeof pipe);
-
- av++; ac--;
- /* Pipe number */
- if (ac && isdigit(**av)) {
- pipe.pipe_nr = atoi(*av); av++; ac--;
- }
- while (ac > 1) {
- if (!strncmp(*av,"bw",strlen(*av)) ||
- ! strncmp(*av,"bandwidth",strlen(*av))) {
- pipe.bandwidth = strtoul(av[1], &end, 0);
- if (*end == 'K')
- end++, pipe.bandwidth *= 1000 ;
- else if (*end == 'M')
- end++, pipe.bandwidth *= 1000000 ;
- if (*end == 'B')
- pipe.bandwidth *= 8 ;
- av+=2; ac-=2;
- } else if (!strncmp(*av,"delay",strlen(*av)) ) {
- pipe.delay = strtoul(av[1], NULL, 0);
- av+=2; ac-=2;
- } else if (!strncmp(*av,"plr",strlen(*av)) ) {
-
- double d = strtod(av[1], NULL);
- pipe.plr = (int)(d*0x7fffffff) ;
- av+=2; ac-=2;
- } else if (!strncmp(*av,"queue",strlen(*av)) ) {
- end = NULL ;
- pipe.queue_size = strtoul(av[1], &end, 0);
- if (*end == 'K') {
- pipe.queue_size_bytes = pipe.queue_size*1024 ;
- pipe.queue_size = 0 ;
- } else if (*end == 'B') {
- pipe.queue_size_bytes = pipe.queue_size ;
- pipe.queue_size = 0 ;
- }
- av+=2; ac-=2;
- } else
- show_usage("unrecognised option ``%s''", *av);
- }
- if (pipe.pipe_nr == 0 )
- show_usage("pipe_nr %d be > 0", pipe.pipe_nr);
- if (pipe.queue_size > 100 )
- show_usage("queue size %d must be 2 <= x <= 100", pipe.queue_size);
- if (pipe.delay > 10000 )
- show_usage("delay %d must be < 10000", pipe.delay);
-#if 0
- printf("configuring pipe %d bw %d delay %d size %d\n",
- pipe.pipe_nr, pipe.bandwidth, pipe.delay, pipe.queue_size);
-#endif
- i = setsockopt(s,IPPROTO_IP, IP_DUMMYNET_CONFIGURE, &pipe,sizeof pipe);
- if (i)
- err(1, "setsockopt(%s)", "IP_DUMMYNET_CONFIGURE");
-
-}
-
-static void
add(ac,av)
int ac;
char **av;
@@ -1011,15 +873,10 @@ add(ac,av)
rule.fw_flg |= IP_FW_F_ACCEPT; av++; ac--;
} else if (!strncmp(*av,"count",strlen(*av))) {
rule.fw_flg |= IP_FW_F_COUNT; av++; ac--;
- } else if (!strncmp(*av,"pipe",strlen(*av))) {
- rule.fw_flg |= IP_FW_F_PIPE; av++; ac--;
- if (!ac)
- show_usage("missing pipe number");
- rule.fw_divert_port = strtoul(*av, NULL, 0); av++; ac--;
} else if (!strncmp(*av,"divert",strlen(*av))) {
rule.fw_flg |= IP_FW_F_DIVERT; av++; ac--;
if (!ac)
- show_usage("missing %s port", "divert");
+ show_usage("missing divert port");
rule.fw_divert_port = strtoul(*av, NULL, 0); av++; ac--;
if (rule.fw_divert_port == 0) {
struct servent *s;
@@ -1028,12 +885,12 @@ add(ac,av)
if (s != NULL)
rule.fw_divert_port = ntohs(s->s_port);
else
- show_usage("illegal %s port", "divert");
+ show_usage("illegal divert port");
}
} else if (!strncmp(*av,"tee",strlen(*av))) {
rule.fw_flg |= IP_FW_F_TEE; av++; ac--;
if (!ac)
- show_usage("missing %s port", "tee divert");
+ show_usage("missing divert port");
rule.fw_divert_port = strtoul(*av, NULL, 0); av++; ac--;
if (rule.fw_divert_port == 0) {
struct servent *s;
@@ -1042,11 +899,8 @@ add(ac,av)
if (s != NULL)
rule.fw_divert_port = ntohs(s->s_port);
else
- show_usage("illegal %s port", "tee divert");
+ show_usage("illegal divert port");
}
-#ifndef IPFW_TEE_IS_FINALLY_IMPLEMENTED
- err(EX_USAGE, "the ``tee'' action is not implemented");
-#endif
} else if (!strncmp(*av,"fwd",strlen(*av)) ||
!strncmp(*av,"forward",strlen(*av))) {
struct in_addr dummyip;
@@ -1345,7 +1199,7 @@ ipfw_main(ac,av)
{
int ch;
- extern int optreset; /* XXX should be declared in <unistd.h> */
+ extern int optind;
if ( ac == 1 ) {
show_usage(NULL);
@@ -1354,7 +1208,7 @@ ipfw_main(ac,av)
/* Set the force flag for non-interactive processes */
do_force = !isatty(STDIN_FILENO);
- optind = optreset = 1;
+ optind = 1;
while ((ch = getopt(ac, av, "afqtN")) != -1)
switch(ch) {
case 'a':
@@ -1381,24 +1235,8 @@ ipfw_main(ac,av)
show_usage("Bad arguments");
}
- if (!strncmp(*av, "pipe", strlen(*av))) {
- do_pipe = 1 ;
- ac-- ;
- av++ ;
- }
- if (!ac) {
- show_usage("pipe requires arguments");
- }
- /* allow argument swapping */
- if (ac > 1 && *av[0]>='0' && *av[0]<='9') {
- char *p = av[0] ;
- av[0] = av[1] ;
- av[1] = p ;
- }
if (!strncmp(*av, "add", strlen(*av))) {
add(ac,av);
- } else if (do_pipe && !strncmp(*av, "config", strlen(*av))) {
- config_pipe(ac,av);
} else if (!strncmp(*av, "delete", strlen(*av))) {
delete(ac,av);
} else if (!strncmp(*av, "flush", strlen(*av))) {
@@ -1451,11 +1289,10 @@ main(ac, av)
#define MAX_ARGS 32
#define WHITESP " \t\f\v\n\r"
char buf[BUFSIZ];
- char *a, *p, *args[MAX_ARGS], *cmd = NULL;
+ char *a, *args[MAX_ARGS];
char linename[10];
- int i, c, qflag, pflag, status;
- FILE *f = NULL;
- pid_t preproc = 0;
+ int i, qflag=0;
+ FILE *f;
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
if ( s < 0 )
@@ -1463,94 +1300,14 @@ main(ac, av)
setbuf(stdout,0);
- if (ac > 1 && access(av[ac - 1], R_OK) == 0) {
- qflag = pflag = i = 0;
+ if (av[1] && (!access(av[1], R_OK) ||
+ (av[2] && (qflag=!strcmp(av[1],"-q")) && !access(av[2], R_OK)))){
lineno = 0;
-
- while ((c = getopt(ac, av, "D:U:p:q")) != -1)
- switch(c) {
- case 'D':
- if (!pflag)
- errx(EX_USAGE, "-D requires -p");
- if (i > MAX_ARGS - 2)
- errx(EX_USAGE,
- "too many -D or -U options");
- args[i++] = "-D";
- args[i++] = optarg;
- break;
-
- case 'U':
- if (!pflag)
- errx(EX_USAGE, "-U requires -p");
- if (i > MAX_ARGS - 2)
- errx(EX_USAGE,
- "too many -D or -U options");
- args[i++] = "-U";
- args[i++] = optarg;
- break;
-
- case 'p':
- pflag = 1;
- cmd = optarg;
- args[0] = cmd;
- i = 1;
- break;
-
- case 'q':
- qflag = 1;
- break;
-
- default:
- show_usage(NULL);
- }
-
- av += optind;
- ac -= optind;
- if (ac != 1)
- show_usage("extraneous filename arguments");
-
- if ((f = fopen(av[0], "r")) == NULL)
- err(EX_UNAVAILABLE, "fopen: %s", av[0]);
-
- if (pflag) {
- /* pipe through preprocessor (cpp or m4) */
- int pipedes[2];
-
- args[i] = 0;
-
- if (pipe(pipedes) == -1)
- err(EX_OSERR, "cannot create pipe");
-
- switch((preproc = fork())) {
- case -1:
- err(EX_OSERR, "cannot fork");
-
- case 0:
- /* child */
- if (dup2(fileno(f), 0) == -1 ||
- dup2(pipedes[1], 1) == -1)
- err(EX_OSERR, "dup2()");
- fclose(f);
- close(pipedes[1]);
- close(pipedes[0]);
- execvp(cmd, args);
- err(EX_OSERR, "execvp(%s) failed", cmd);
-
- default:
- /* parent */
- fclose(f);
- close(pipedes[1]);
- if ((f = fdopen(pipedes[0], "r")) == NULL) {
- int savederrno = errno;
-
- (void)kill(preproc, SIGTERM);
- errno = savederrno;
- err(EX_OSERR, "fdopen()");
- }
- }
- }
-
+ if ((f = fopen(av[ac-1], "r")) == NULL)
+ err(EX_UNAVAILABLE, "fopen: %s", av[ac-1]);
while (fgets(buf, BUFSIZ, f)) {
+ char *p;
+
lineno++;
sprintf(linename, "Line %d", lineno);
args[0] = linename;
@@ -1564,7 +1321,7 @@ main(ac, av)
for (a = strtok(buf, WHITESP);
a && i < MAX_ARGS; a = strtok(NULL, WHITESP), i++)
args[i] = a;
- if (i == (qflag? 2: 1))
+ if (i == 1)
continue;
if (i == MAX_ARGS)
errx(EX_USAGE, "%s: too many arguments", linename);
@@ -1573,21 +1330,6 @@ main(ac, av)
ipfw_main(i, args);
}
fclose(f);
- if (pflag) {
- if (waitpid(preproc, &status, 0) != -1) {
- if (WIFEXITED(status)) {
- if (WEXITSTATUS(status) != EX_OK)
- errx(EX_UNAVAILABLE,
- "preprocessor exited with status %d",
- WEXITSTATUS(status));
- } else if (WIFSIGNALED(status)) {
- errx(EX_UNAVAILABLE,
- "preprocessor exited with signal %d",
- WTERMSIG(status));
- }
- }
- }
-
} else
ipfw_main(ac,av);
return EX_OK;
diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8
index 64d10cb32441..8201f7f18c9b 100644
--- a/sbin/kldload/kldload.8
+++ b/sbin/kldload/kldload.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: kldload.8,v 1.4 1998/03/19 07:45:17 charnier Exp $
+.\" $Id: kldload.8,v 1.3 1998/01/05 07:07:44 charnier Exp $
.\"
.Dd April 25, 1997
.Dt KLDLOAD 8
@@ -38,24 +38,13 @@
.Sh DESCRIPTION
The
.Nm
-loads the file
-.Ar filename.ko
-into the kernel using the kernel linker.
+loads a file into the kernel using the kernel linker.
.Pp
The following option is available:
.Bl -tag -width indent
.It Fl v
Be more verbose.
.El
-.Sh FILES
-.Bl -tag -width /modules -compact
-.It Pa /modules
-directory containing loadable modules. Modules must be have an extention of .ko
-.Sh DIAGNOSTICS
-The
-.Nm
-utility exits with a status of 0 on success
-and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr kldstat 8 ,
.Xr kldunload 8
@@ -63,9 +52,6 @@ and with a nonzero status if an error occurs.
The
.Nm
command first appeared in
-.Fx 3.0 ,
-replacing the
-.Xr lkm 4
-interface.
+.Fx 3.0 .
.Sh AUTHORS
.An Doug Rabson Aq dfr@FreeBSD.org
diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8
index 943f5446c61b..cd1d6a7dc23c 100644
--- a/sbin/kldstat/kldstat.8
+++ b/sbin/kldstat/kldstat.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: kldstat.8,v 1.4 1998/03/19 07:45:28 charnier Exp $
+.\" $Id: kldstat.8,v 1.3 1998/01/05 07:09:28 charnier Exp $
.\"
.Dd April 25, 1997
.Dt KLDSTAT 8
@@ -43,7 +43,7 @@ utility displays the status of any files dynamically linked into the
kernel.
.Pp
The following options are available:
-.Bl -tag -width indentXX
+.Bl -tag -width indent
.It Fl v
Be more verbose.
.It Fl i Ar id
@@ -51,11 +51,6 @@ Display the status of only the file with this ID.
.It Fl n Ar name
Display the status of only the file with this name.
.El
-.Sh DIAGNOSTICS
-The
-.Nm
-utility exits with a status of 0 on success
-and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr kldload 8 ,
.Xr kldunload 8
@@ -63,9 +58,6 @@ and with a nonzero status if an error occurs.
The
.Nm
command first appeared in
-.Fx 3.0 ,
-replacing the
-.Xr lkm 4
-interface.
+.Fx 3.0 .
.Sh AUTHORS
.An Doug Rabson Aq dfr@FreeBSD.org
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c
index 8df5cece0d51..49cdd7a3cde9 100644
--- a/sbin/kldstat/kldstat.c
+++ b/sbin/kldstat/kldstat.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: kldstat.c,v 1.4 1998/01/05 07:09:28 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
@@ -111,7 +111,7 @@ main(int argc, char** argv)
err(1, "can't find file %s", filename);
}
- printf("Id Refs Address Size Name\n");
+ printf("Id Refs Address Size Name\n");
if (fileid)
printfile(fileid, verbose);
else
diff --git a/sbin/kldunload/kldunload.8 b/sbin/kldunload/kldunload.8
index 8fd216d33090..15bbfa257363 100644
--- a/sbin/kldunload/kldunload.8
+++ b/sbin/kldunload/kldunload.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: kldunload.8,v 1.5 1998/11/07 00:42:52 des Exp $
+.\" $Id: kldunload.8,v 1.3 1998/01/05 07:10:41 charnier Exp $
.\"
.Dd April 25, 1997
.Dt KLDUNLOAD 8
@@ -34,10 +34,8 @@
.Sh SYNOPSIS
.Nm kldunload
.Op Fl v
-.Fl i Ar id
-.Nm kldunload
-.Op Fl v
-.Fl n Ar name
+.Op Fl i Ar id
+.Op Fl n Ar name
.Sh DESCRIPTION
The
.Nm
@@ -45,7 +43,7 @@ utility unloads a file which was previously loaded with
.Xr kldload 8 .
.Pp
The following options are available:
-.Bl -tag -width indentXX
+.Bl -tag -width indent
.It Fl v
Be more verbose.
.It Fl i Ar id
@@ -53,11 +51,6 @@ Unload the file with this ID.
.It Fl n Ar name
Unload the file with this name.
.El
-.Sh DIAGNOSTICS
-The
-.Nm
-utility exits with a status of 0 on success
-and with a nonzero status if an error occurs.
.Sh SEE ALSO
.Xr kldload 8 ,
.Xr kldstat 8
@@ -65,9 +58,6 @@ and with a nonzero status if an error occurs.
The
.Nm
command first appeared in
-.Fx 3.0 ,
-replacing the
-.Xr lkm 4
-interface.
+.Fx 3.0 .
.Sh AUTHORS
.An Doug Rabson Aq dfr@FreeBSD.org
diff --git a/sbin/kldunload/kldunload.c b/sbin/kldunload/kldunload.c
index 1d4fb52f5a51..4a942ed1b490 100644
--- a/sbin/kldunload/kldunload.c
+++ b/sbin/kldunload/kldunload.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: kldunload.c,v 1.6 1998/07/06 06:59:52 charnier Exp $";
+ "$Id: kldunload.c,v 1.5 1998/01/05 07:10:42 charnier Exp $";
#endif /* not lint */
#include <err.h>
@@ -39,8 +39,7 @@ static const char rcsid[] =
static void
usage(void)
{
- fprintf(stderr, "usage: kldunload [-v] -i id\n");
- fprintf(stderr, " kldunload [-v] -n name\n");
+ fprintf(stderr, "usage: kldunload [-v] [-i id] [-n name]\n");
exit(1);
}
@@ -69,12 +68,7 @@ main(int argc, char** argv)
argc -= optind;
argv += optind;
- if (!fileid && !filename && (argc == 1)) {
- filename = *argv;
- argc--;
- }
-
- if (argc != 0 || fileid && filename)
+ if (argc != 0)
usage();
if (fileid == 0 && filename == 0)
diff --git a/sbin/mount/Makefile b/sbin/mount/Makefile
index f4e95245514f..e899d4ed6f75 100644
--- a/sbin/mount/Makefile
+++ b/sbin/mount/Makefile
@@ -1,9 +1,12 @@
# @(#)Makefile 8.6 (Berkeley) 5/8/95
-# $Id: Makefile,v 1.7 1998/03/08 14:50:00 msmith Exp $
+# $Id: Makefile,v 1.6 1998/01/20 10:39:57 bde Exp $
PROG= mount
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
MAN8= mount.8
# We do NOT install the getmntopts.3 man page.
+# We support the ROOTSLICE_HUNT hack
+CFLAGS+=-DROOTSLICE_HUNT
+
.include <bsd.prog.mk>
diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c
index c6abfee22b70..00c2e72f0230 100644
--- a/sbin/mount/mount_ufs.c
+++ b/sbin/mount/mount_ufs.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
#endif
static const char rcsid[] =
- "$Id: mount_ufs.c,v 1.14 1998/07/06 07:12:38 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -80,6 +80,10 @@ mount_ufs(argc, argv)
char *fs_name;
struct vfsconf vfc;
int error = 0;
+#ifdef ROOTSLICE_HUNT
+ int slice, result, unit;
+ char part, devbuf[MAXPATHLEN], devpfx[MAXPATHLEN];
+#endif
mntflags = 0;
optind = optreset = 1; /* Reset for parse of new argv. */
@@ -121,8 +125,36 @@ mount_ufs(argc, argv)
warnx("ufs filesystem is not available");
return (1);
}
-
+#ifdef ROOTSLICE_HUNT
+ result = -1;
+ /*
+ * If we are mounting root, and we have a mount of something that
+ * might be the compatibility slice, try mounting other slices
+ * first. If the kernel has done the right thing and mounted
+ * the slice because the disk is really sliced, this will find
+ * the real root filesystem. If not, we'll try what was supplied.
+ */
+ if (!strcmp(fs_name, "/") &&
+ (sscanf(args.fspec, "%[^0-9]%d%c", devpfx, &unit, &part) == 3) &&
+ (part >= 'a') &&
+ (part <= 'h')) {
+ for (slice = 1; (slice < 32) && (result < 0); slice++) {
+ sprintf(devbuf, "%s%ds%d%c",
+ devpfx, unit, slice, part);
+ args.fspec = devbuf;
+ result = mount(vfc.vfc_name, fs_name, mntflags, &args);
+ }
+ args.fspec = argv[0];
+ }
+ if (result == 0)
+ warnx("*** update /etc/fstab entry for %s to use %s ***",
+ fs_name, devbuf);
+ /* Try the mount as originally requested */
+ if ((result < 0) &&
+ (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0)) {
+#else
if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) {
+#endif
switch (errno) {
case EMFILE:
warnx("%s on %s: mount table full",
diff --git a/sbin/mount_null/mount_null.8 b/sbin/mount_null/mount_null.8
index 16635371ec2f..9ed773ebdfa9 100644
--- a/sbin/mount_null/mount_null.8
+++ b/sbin/mount_null/mount_null.8
@@ -35,7 +35,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mount_null.8 8.6 (Berkeley) 5/1/95
-.\" $Id: mount_null.8,v 1.9 1998/07/06 07:17:26 charnier Exp $
+.\" $Id: mount_null.8,v 1.8 1997/03/11 12:33:34 peter Exp $
.\"
.Dd May 1, 1995
.Dt MOUNT_NULL 8
@@ -228,16 +228,6 @@ is that vnodes arguments must be manually mapped.
.sp
UCLA Technical Report CSD-910056,
.Em "Stackable Layers: an Architecture for File System Development" .
-.Sh BUGS
-
-THIS FILESYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
-AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR
-OWN RISK. BEWARE OF DOG. SLIPPERY WHEN WET.
-
-This code also needs an owner in order to be less dangerous - serious
-hackers can apply by sending mail to hackers@freebsd.org and announcing
-their intent to take it over.
-
.Sh HISTORY
The
.Nm
diff --git a/sbin/mount_portal/Makefile b/sbin/mount_portal/Makefile
index 7734df49eee6..af7d5367e943 100644
--- a/sbin/mount_portal/Makefile
+++ b/sbin/mount_portal/Makefile
@@ -1,9 +1,9 @@
# From: @(#)Makefile 8.3 (Berkeley) 3/27/94
-# $Id: Makefile,v 1.8 1998/01/20 10:40:04 bde Exp $
+# $Id: Makefile,v 1.7 1997/03/11 12:34:55 peter Exp $
PROG= mount_portal
SRCS= mount_portal.c activate.c conf.c getmntopts.c pt_conf.c \
- pt_exec.c pt_file.c pt_tcp.c pt_tcplisten.c
+ pt_exec.c pt_file.c pt_tcp.c
MAN8= mount_portal.8
MOUNT= ${.CURDIR}/../mount
diff --git a/sbin/mount_portal/activate.c b/sbin/mount_portal/activate.c
index 6eb0c582753a..5bbd3b5a7106 100644
--- a/sbin/mount_portal/activate.c
+++ b/sbin/mount_portal/activate.c
@@ -39,7 +39,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: activate.c,v 1.5 1998/07/06 07:19:23 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <errno.h>
@@ -148,7 +148,7 @@ int error;
/*
* Send to kernel...
*/
- if ((n = sendmsg(so, &msg, 0)) < 0)
+ if ((n = sendmsg(so, &msg, MSG_EOR)) < 0)
syslog(LOG_ERR, "send: %s", strerror(errno));
#ifdef DEBUG
fprintf(stderr, "sent %d bytes\n", n);
diff --git a/sbin/mount_portal/mount_portal.8 b/sbin/mount_portal/mount_portal.8
index 5a5750faf19f..ed9434e557fe 100644
--- a/sbin/mount_portal/mount_portal.8
+++ b/sbin/mount_portal/mount_portal.8
@@ -35,7 +35,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mount_portal.8 8.3 (Berkeley) 3/27/94
-.\" $Id: mount_portal.8,v 1.3 1998/07/06 07:19:25 charnier Exp $
+.\" $Id$
.\"
.Dd March 27, 1994
.Dt MOUNT_PORTAL 8
@@ -89,22 +89,11 @@ to the calling process as the result of the open system call.
By convention, the portal daemon divides the namespace into sub-namespaces,
each of which handles objects of a particular type.
.Pp
-The following sub-namespaces are currently implemented:
-.Pa tcplisten ,
+Currently, two sub-namespaces are implemented:
.Pa tcp
and
.Pa fs .
The
-.Pa tcplisten
-namespace takes a slash separated hostname and port and creates a TCP/IP
-socket bound to the given hostname-port pair. The hostname may be
-specified as "ANY" to allow any other host to connect to the socket. A
-port number of 0 will dynamically allocate a port, this can be
-discovered by calling
-.Xr getsockname 8
-with the returned file descriptor. Privilaged ports can only be bound to
-by the super-user.
-The
.Pa tcp
namespace takes a hostname and a port (slash separated) and
creates an open TCP/IP connection.
@@ -127,7 +116,6 @@ tells the daemon what type of object to create.
Subsequent fields are passed to the creation function.
.Bd -literal
# @(#)portal.conf 5.1 (Berkeley) 7/13/92
-tcplisten/ tcplisten tcplisten/
tcp/ tcp tcp/
fs/ file fs/
.Ed
diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c
index 6de71ea947e7..d3fa3c3a0dce 100644
--- a/sbin/mount_portal/mount_portal.c
+++ b/sbin/mount_portal/mount_portal.c
@@ -45,7 +45,7 @@ char copyright[] =
static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95";
#endif
static const char rcsid[] =
- "$Id: mount_portal.c,v 1.13 1998/07/06 07:19:25 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -190,9 +190,7 @@ main(argc, argv)
/*
* Everything is ready to go - now is a good time to fork
*/
-#ifndef DEBUG
daemon(0, 0);
-#endif
/*
* Start logging (and change name)
diff --git a/sbin/mount_portal/portald.h b/sbin/mount_portal/portald.h
index f01e8a88ca78..23fce24198fa 100644
--- a/sbin/mount_portal/portald.h
+++ b/sbin/mount_portal/portald.h
@@ -36,7 +36,7 @@
*
* @(#)portald.h 8.1 (Berkeley) 6/5/93
*
- * $Id: portald.h,v 1.3 1997/02/22 14:32:55 peter Exp $
+ * $Id$
*/
#include <sys/cdefs.h>
@@ -73,8 +73,6 @@ extern int portal_file __P((struct portal_cred *,
char *key, char **v, int so, int *fdp));
extern int portal_tcp __P((struct portal_cred *,
char *key, char **v, int so, int *fdp));
-extern int portal_tcplisten __P((struct portal_cred *,
- char *key, char **v, int so, int *fdp));
/*
* Global functions
diff --git a/sbin/mount_portal/pt_conf.c b/sbin/mount_portal/pt_conf.c
index 11088ea2934d..2f9ab9772a81 100644
--- a/sbin/mount_portal/pt_conf.c
+++ b/sbin/mount_portal/pt_conf.c
@@ -39,7 +39,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pt_conf.c,v 1.4 1998/07/06 07:19:25 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -50,6 +50,5 @@ provider providers[] = {
{ "exec", portal_exec },
{ "file", portal_file },
{ "tcp", portal_tcp },
- { "tcplisten", portal_tcplisten },
{ 0, 0 }
};
diff --git a/sbin/mount_portal/pt_tcp.c b/sbin/mount_portal/pt_tcp.c
index 954388ee03fd..d62ca3eb31a7 100644
--- a/sbin/mount_portal/pt_tcp.c
+++ b/sbin/mount_portal/pt_tcp.c
@@ -39,7 +39,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pt_tcp.c,v 1.7 1998/07/06 07:19:27 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <errno.h>
@@ -124,16 +124,16 @@ int portal_tcp(pcr, key, v, kso, fdp)
#endif
sp = getservbyname(port, "tcp");
- if (sp != NULL) {
+ if (sp != NULL)
s_port = (u_short)sp->s_port;
- } else {
+ else {
s_port = strtoul(port, &p, 0);
if (s_port == 0 || *p != '\0')
return (EINVAL);
s_port = htons(s_port);
}
#ifdef DEBUG
- printf ("port number for %s is %d\n", port, (int)ntohs(s_port));
+ printf ("port number for %s is %d\n", port, ntohs(s_port));
#endif
memset(&sain, 0, sizeof(sain));
diff --git a/sbin/mount_portal/pt_tcplisten.c b/sbin/mount_portal/pt_tcplisten.c
deleted file mode 100644
index 43a20c5aa92c..000000000000
--- a/sbin/mount_portal/pt_tcplisten.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- * All rights reserved.
- *
- * This code is derived from software donated to Berkeley by
- * Jan-Simon Pendry.
- *
- * Modified by Duncan Barclay.
- *
- * 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 University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * @(#)pt_tcp.c 8.3 (Berkeley) 3/27/94
- *
- * pt_tcp.c,v 1.1.1.1 1994/05/26 06:34:34 rgrimes Exp
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <strings.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/syslog.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-
-#include "portald.h"
-
-/*
- * Key will be tcplisten/host/port
- *
- * Create a TCP socket bound to the requested host and port.
- * If the host is "ANY" the receving address will be set to INADDR_ANY.
- * If the port is 0 the caller must find out the returned port number
- * using a call to getsockname.
- *
- * XXX! The owner of the socket will be root rather then the user. This
- * may cause remote auth (identd) to return unexpected results.
- *
- */
-int portal_tcplisten(pcr, key, v, kso, fdp)
- struct portal_cred *pcr;
- char *key;
- char **v;
- int kso;
- int *fdp;
-{
- char host[MAXHOSTNAMELEN];
- char port[MAXHOSTNAMELEN];
- char *p = key + (v[1] ? strlen(v[1]) : 0);
- char *q;
- struct hostent *hp;
- struct servent *sp;
- struct in_addr **ipp;
- struct in_addr *ip[2];
- struct in_addr ina;
- u_short s_port;
- int any = 0;
- struct sockaddr_in sain;
-
- q = strchr(p, '/');
- if (q == 0 || q - p >= sizeof(host))
- return (EINVAL);
- *q = '\0';
- snprintf(host, sizeof(host), "%s", p);
- p = q + 1;
-
- q = strchr(p, '/');
- if (q)
- *q = '\0';
- if (strlen(p) >= sizeof(port))
- return (EINVAL);
- snprintf(port, sizeof(port), "%s", p);
-
- if (strcmp(host, "ANY") == 0) {
- any = 1;
- } else {
- hp = gethostbyname(host);
- if (hp != 0) {
- ipp = (struct in_addr **) hp->h_addr_list;
- } else {
- ina.s_addr = inet_addr(host);
- if (ina.s_addr == INADDR_NONE)
- return (EINVAL);
- ip[0] = &ina;
- ip[1] = 0;
- ipp = ip;
- }
- }
-#ifdef DEBUG
- if (any)
- printf("INADDR_ANY to be used for hostname\n");
- else
- printf("inet address for %s is %s\n", host, inet_ntoa(*ipp[0]));
-#endif
-
- sp = getservbyname(port, "tcp");
- if (sp != NULL) {
- s_port = (u_short) sp->s_port;
- } else {
- s_port = strtoul(port, &p, 0);
- if (*p != '\0')
- return (EINVAL);
- s_port = htons(s_port);
- }
- if ((ntohs(s_port) != 0) &&
- (ntohs(s_port) <= IPPORT_RESERVED) &&
- (pcr->pcr_uid != 0))
- return (EPERM);
-#ifdef DEBUG
- printf("port number for %s is %d\n", port, ntohs(s_port));
-#endif
-
- memset(&sain, 0, sizeof(sain));
- sain.sin_len = sizeof(sain);
- sain.sin_family = AF_INET;
- sain.sin_port = s_port;
-
- if (any) {
- int so;
- int sock;
-
- so = socket(AF_INET, SOCK_STREAM, 0);
- if (so < 0) {
- syslog(LOG_ERR, "socket: %m");
- return (errno);
- }
-
- sain.sin_addr.s_addr = INADDR_ANY;
- if (bind(so, (struct sockaddr *) &sain, sizeof(sain)) == 0) {
- listen(so, 1);
- if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) {
- syslog(LOG_ERR, "accept: %m");
- (void) close(so);
- return (errno);
- }
- *fdp = sock;
- (void) close(so);
- return (0);
- }
- syslog(LOG_ERR, "bind: %m");
- (void) close(so);
- return (errno);
- }
-
- while (ipp[0]) {
- int so;
- int sock;
-
- so = socket(AF_INET, SOCK_STREAM, 0);
- if (so < 0) {
- syslog(LOG_ERR, "socket: %m");
- return (errno);
- }
-
- sain.sin_addr = *ipp[0];
- if (bind(so, (struct sockaddr *) &sain, sizeof(sain)) == 0) {
- listen(so, 1);
- if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) {
- syslog(LOG_ERR, "accept: %m");
- (void) close(so);
- return (errno);
- }
- *fdp = sock;
- (void) close(so);
- return (0);
- }
- (void) close(so);
-
- ipp++;
- }
-
- syslog(LOG_ERR, "bind: %m");
- return (errno);
-
-}
diff --git a/sbin/mount_umap/mount_umap.8 b/sbin/mount_umap/mount_umap.8
index 1407305aed31..4b9bd0016be5 100644
--- a/sbin/mount_umap/mount_umap.8
+++ b/sbin/mount_umap/mount_umap.8
@@ -34,7 +34,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mount_umap.8 8.4 (Berkeley) 5/1/95
-.\" $Id: mount_umap.8,v 1.8 1998/07/15 06:12:31 charnier Exp $
+.\" $Id$
.\"
.Dd May 1, 1995
.Dt MOUNT_UMAP 8
@@ -123,16 +123,6 @@ sophisticated.
.Sh SEE ALSO
.Xr mount 8 ,
.Xr mount_null 8
-.Sh BUGS
-
-THIS FILESYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
-AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR
-OWN RISK. BEWARE OF DOG. SLIPPERY WHEN WET.
-
-This code also needs an owner in order to be less dangerous - serious
-hackers can apply by sending mail to hackers@freebsd.org and announcing
-their intent to take it over.
-
.Sh HISTORY
The
.Nm
diff --git a/sbin/mount_union/mount_union.8 b/sbin/mount_union/mount_union.8
index eada8bf8c3f6..60800f1f165f 100644
--- a/sbin/mount_union/mount_union.8
+++ b/sbin/mount_union/mount_union.8
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mount_union.8 8.6 (Berkeley) 3/27/94
-.\" $Id: mount_union.8,v 1.4 1998/07/15 06:13:45 charnier Exp $
+.\" $Id$
.\"
.Dd March 27, 1994
.Dt MOUNT_UNION 8
@@ -183,15 +183,6 @@ accessible via
.Xr mount 8 ,
.Xr mount_null 8
.Sh BUGS
-
-THIS FILESYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
-AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR
-OWN RISK. BEWARE OF DOG. SLIPPERY WHEN WET.
-
-This code also needs an owner in order to be less dangerous - serious
-hackers can apply by sending mail to hackers@freebsd.org and announcing
-their intent to take it over.
-
Without whiteout support from the filesystem backing the upper layer,
there is no way that delete and rename operations on lower layer
objects can be done.
@@ -209,4 +200,3 @@ The
.Nm
command first appeared in
.Bx 4.4 .
-It first worked in FreeBSD-(fill this in).
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index ab9fdc7c8363..fe556db9cc33 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: mountd.c,v 1.33 1998/08/02 16:06:34 bde Exp $";
+ "$Id: mountd.c,v 1.32 1998/07/15 06:21:40 charnier Exp $";
#endif /*not lint*/
#include <sys/param.h>
@@ -119,9 +119,9 @@ struct exportlist {
#define EX_LINKED 0x1
struct netmsk {
- u_int32_t nt_net;
- u_int32_t nt_mask;
- char *nt_name;
+ u_long nt_net;
+ u_long nt_mask;
+ char *nt_name;
};
union grouptypes {
@@ -163,7 +163,7 @@ void add_dlist __P((struct dirlist **, struct dirlist *,
void add_mlist __P((char *, char *));
int check_dirpath __P((char *));
int check_options __P((struct dirlist *));
-int chk_host __P((struct dirlist *, u_int32_t, int *, int *));
+int chk_host __P((struct dirlist *, u_long, int *, int *));
void del_mlist __P((char *, char *));
struct dirlist *dirp_search __P((struct dirlist *, char *));
int do_mount __P((struct exportlist *, struct grouplist *, int,
@@ -192,7 +192,7 @@ void nextfield __P((char **, char **));
void out_of_mem __P((void));
void parsecred __P((char *, struct ucred *));
int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *));
-int scan_tree __P((struct dirlist *, u_int32_t));
+int scan_tree __P((struct dirlist *, u_long));
void send_umntall __P((void));
int umntall_each __P((caddr_t, struct sockaddr_in *));
static void usage __P((void));
@@ -376,7 +376,7 @@ mntsrv(rqstp, transp)
struct statfs fsb;
struct hostent *hp;
struct in_addr saddrin;
- u_int32_t saddr;
+ u_long saddr;
u_short sport;
char rpcpath[RPCMNT_PATHLEN + 1], dirpath[MAXPATHLEN];
int bad = 0, defset, hostset;
@@ -952,7 +952,7 @@ get_exportlist()
out_of_mem();
hpe->h_name = strdup("Default");
hpe->h_addrtype = AF_INET;
- hpe->h_length = sizeof (u_int32_t);
+ hpe->h_length = sizeof (u_long);
hpe->h_addr_list = (char **)NULL;
grp->gr_ptr.gt_hostent = hpe;
@@ -1247,13 +1247,13 @@ dirp_search(dp, dirpath)
int
chk_host(dp, saddr, defsetp, hostsetp)
struct dirlist *dp;
- u_int32_t saddr;
+ u_long saddr;
int *defsetp;
int *hostsetp;
{
struct hostlist *hp;
struct grouplist *grp;
- u_int32_t **addrp;
+ u_long **addrp;
if (dp) {
if (dp->dp_flag & DP_DEFSET)
@@ -1263,7 +1263,7 @@ chk_host(dp, saddr, defsetp, hostsetp)
grp = hp->ht_grp;
switch (grp->gr_type) {
case GT_HOST:
- addrp = (u_int32_t **)
+ addrp = (u_long **)
grp->gr_ptr.gt_hostent->h_addr_list;
while (*addrp) {
if (**addrp == saddr) {
@@ -1293,7 +1293,7 @@ chk_host(dp, saddr, defsetp, hostsetp)
int
scan_tree(dp, saddr)
struct dirlist *dp;
- u_int32_t saddr;
+ u_long saddr;
{
int defset, hostset;
@@ -1458,7 +1458,7 @@ get_host(cp, grp, tgrp)
char **addrp, **naddrp;
struct hostent t_host;
int i;
- u_int32_t saddr;
+ u_long saddr;
char *aptr[2];
if (grp->gr_type != GT_NULL)
@@ -1475,7 +1475,7 @@ get_host(cp, grp, tgrp)
hp = &t_host;
hp->h_name = cp;
hp->h_addrtype = AF_INET;
- hp->h_length = sizeof (u_int32_t);
+ hp->h_length = sizeof (u_long);
hp->h_addr_list = aptr;
aptr[0] = (char *)&saddr;
aptr[1] = (char *)NULL;
@@ -1494,8 +1494,8 @@ get_host(cp, grp, tgrp)
if (checkgrp->gr_type == GT_HOST &&
checkgrp->gr_ptr.gt_hostent != NULL &&
(!strcmp(checkgrp->gr_ptr.gt_hostent->h_name, hp->h_name)
- || *(u_int32_t *)checkgrp->gr_ptr.gt_hostent->h_addr ==
- *(u_int32_t *)hp->h_addr)) {
+ || *(unsigned long *)checkgrp->gr_ptr.gt_hostent->h_addr ==
+ *(unsigned long *)hp->h_addr)) {
grp->gr_type = GT_IGNORE;
return(0);
}
@@ -1640,7 +1640,7 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
struct statfs *fsb;
{
char *cp = (char *)NULL;
- u_int32_t **addrp;
+ u_long **addrp;
int done;
char savedc = '\0';
struct sockaddr_in sin, imask;
@@ -1652,7 +1652,7 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
struct msdosfs_args da;
#endif
} args;
- u_int32_t net;
+ u_long net;
args.ua.fspec = 0;
args.ua.export.ex_flags = exflags;
@@ -1665,9 +1665,9 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
imask.sin_family = AF_INET;
imask.sin_len = sizeof(sin);
if (grp->gr_type == GT_HOST)
- addrp = (u_int32_t **)grp->gr_ptr.gt_hostent->h_addr_list;
+ addrp = (u_long **)grp->gr_ptr.gt_hostent->h_addr_list;
else
- addrp = (u_int32_t **)NULL;
+ addrp = (u_long **)NULL;
done = FALSE;
while (!done) {
switch (grp->gr_type) {
@@ -1759,7 +1759,7 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
}
if (addrp) {
++addrp;
- if (*addrp == (u_int32_t *)NULL)
+ if (*addrp == (u_long *)NULL)
done = TRUE;
} else
done = TRUE;
diff --git a/sbin/natd/README b/sbin/natd/README
deleted file mode 100644
index 6c158d5e4ca1..000000000000
--- a/sbin/natd/README
+++ /dev/null
@@ -1,53 +0,0 @@
-
- A Network Address Translation Daemon for FreeBSD
-
-
-1. WHAT IS NATD ?
-
- This is a simple daemon based on FreeBSD divert sockets
- which performs network address translation (or masquerading)
- for IP packets (see related RFCs 1631 and 1918).
- It is based on packet aliasing package (see README.alias)
- written by Charles Mott (cmott@srv.net).
-
- This package works with any network interface (doesn't have
- to be ppp). I run it on a computer having two ethernet cards,
- one connected to internet and the other one to local network.
-
-2. GETTING IT RUNNING
-
- 1) Get FreeBSD 2.2 - I think the divert sockets are
- not available on earlier versions,
-
- 2) Compile this software by executing "make".
-
- 3) Install the software by executing "make install".
-
- 4) See man natd for further instructions.
-
-3. FTP SITES FOR NATD
-
- This package is available at ftp://ftp.suutari.iki.fi/pub/natd.
-
-4. AUTHORS
-
- This program is the result of the efforts of many people
- at different times:
-
- Archie Cobbs <archie@whistle.com> Divert sockets
- Charles Mott <cmott@srv.net> Packet aliasing engine
- Eivind Eklund <eivind@dimaga.com> Packet aliasing engine
- Ari Suutari <suutari@iki.fi> Natd
- Brian Somers <brian@awfulhak.org> Manual page, glue and
- bunch of good ideas.
-
- The original package written by Charles Mott
- is available at http://www.srv.net/~cmott.
- It is described in README.alias.
-
- Happy Networking - comments and fixes are welcome!
-
- Ari S. (suutari@iki.fi)
-
-
-
diff --git a/sbin/natd/samples/natd.cf.sample b/sbin/natd/samples/natd.cf.sample
deleted file mode 100644
index df1018b7e2d3..000000000000
--- a/sbin/natd/samples/natd.cf.sample
+++ /dev/null
@@ -1,94 +0,0 @@
-#
-# $Id:$
-#
-#
-# Configuration file for natd.
-#
-#
-# Enable logging to file /var/log/alias.log
-#
-log no
-#
-# Incoming connections. Should NEVER be set to "yes" if redirect_port,
-# redirect_address, or permanent_link statements are activated in this file!
-#
-# Setting to yes provides additional anti-crack protection
-#
-deny_incoming no
-#
-# Use sockets to avoid port clashes. Uses additional system resources, but
-# guarantees successful connections when port numbers conflict
-#
-use_sockets no
-#
-# Avoid port changes if possible when altering outbound packets. Makes rlogin
-# work in most cases.
-#
-same_port yes
-#
-# Verbose mode. Enables dumping of packets and disables
-# forking to background. Only set to yes for debugging.
-#
-verbose no
-#
-# Divert port. Can be a name in /etc/services or numeric value.
-#
-port 32000
-#
-# Interface name or address being aliased. Either one,
-# not both is required.
-#
-# Obtain interface name from the command output of "ifconfig -a"
-#
-# alias_address 192.168.0.1
-interface ep0
-#
-# Alias unregistered addresses or all addresses. Set this to yes if
-# the inside network is all RFC1918 addresses.
-#
-unregistered_only no
-#
-# Configure permanent links. If you use host names instead
-# of addresses here, be sure that name server works BEFORE
-# natd is up - this is usually not the case. So either use
-# numeric addresses or hosts that are in /etc/hosts.
-#
-# Note: Current versions of FreeBSD all call /etc/rc.firewall
-# BEFORE running named, so if the DNS server and NAT are on the same
-# machine, the nameserver won't be up if natd is called from /etc/rc.firewall
-#
-# Map connections coming to port 30000 to telnet in my_private_host.
-# Remember to allow the connection /etc/rc.firewall also.
-#
-# The following permanent_link and redirect_port statements are equivalent
-#permanent_link tcp my_private_host:telnet 0.0.0.0:0 30000
-#redirect_port tcp my_private_host:telnet 30000
-#
-# Map connections coming from host.xyz.com to port 30001 to
-# telnet in another_host.
-#permanent_link tcp another_host:telnet host.xyz.com:0 30001
-#
-# Static NAT address mapping:
-#
-# ipconfig must apply any legal IP numbers that inside hosts
-# will be known by to the outside interface. These are sometimes known as
-# virtual IP numbers. It's suggested to use the "interface" directive
-# instead of the "alias_address" directive to make it more clear what is
-# going on. (although both will work)
-#
-# DNS in this situation can get hairy. For example, an inside host
-# named aweb.company.com is located at 192.168.1.56, and needs to be
-# accessible through a legal IP number like 198.105.232.1. If both
-# 192.168.1.56 and 198.105.232.1 are set up as address records in the DNS
-# for aweb.company.com, then external hosts attempting to access
-# aweb.company.com may use address 192.168.1.56 which is inaccessible to them.
-#
-# The obvious solution is to use only a single address for the name, the
-# outside address. However, this creates needless traffic through the
-# NAT, because inside hosts will go through the NAT to get to the legal
-# number, even when the inside number is on the same subnet as they are!
-#
-# It's probably not a good idea to use DNS names in redirect_address statements
-#
-#The following mapping points outside address 198.105.232.1 to 192.168.1.56
-#redirect_address 192.168.1.56 198.105.232.1
diff --git a/sbin/natd/samples/natd.test b/sbin/natd/samples/natd.test
deleted file mode 100644
index cfdbd15aa6e2..000000000000
--- a/sbin/natd/samples/natd.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
- if [ $# != 1 ]
- then
- echo "usage: natd.test ifname"
- exit 1
- fi
-
- ipfw flush
- ipfw add divert 32000 ip from any to any via $1
- ipfw add pass ip from any to any
-
- ./natd -port 32000 -interface $1 -verbose
-
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 4eba3c7fa1bd..afb46a55267e 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
-.\" $Id: newfs.8,v 1.19 1998/11/28 09:59:40 rnordier Exp $
+.\" $Id: newfs.8,v 1.17 1998/09/11 07:08:49 grog Exp $
.\"
.Dd May 3, 1995
.Dt NEWFS 8
@@ -92,13 +92,12 @@ or
the disk must be labeled using
.Xr disklabel 8 .
.Nm Newfs
-builds a file system on the specified special file.
-(We often refer to the
+builds a file system on the specified special file. (We often refer to the
.Dq special file
as the
.Dq disk ,
-although the special file need not be a physical disk.
-In fact, it need not even be special.)
+although the special file need not be a physical disk. In fact, it need not
+even be special.)
Typically the defaults are reasonable, however
.Nm
has numerous options to allow the defaults to be selectively overridden.
@@ -220,10 +219,10 @@ for more details on how to set this option.
.It Fl s Ar size
The size of the file system in sectors.
.It Fl v
-Specify that the disk does not contain any partitions, and that
+Specify that the special device does not contain any partitions, and that
.Nm
-should build a file system on the whole disk.
-This option is useful for synthetic disks such as
+should treat the whole slice as the file system. This option is useful for
+synthetic disks such as
.Nm vinum.
.El
.Pp
@@ -306,7 +305,7 @@ man page for possible options and their meanings.
.El
.Sh EXAMPLES
.Pp
-.Dl mount_mfs -s 131072 -o nosuid,nodev /dev/da0s1b /tmp
+.Dl mount_mfs -s 131072 -o nosuid,nodev /dev/sd0s1b /tmp
.Pp
Mount a 64 MB large memory file system on /tmp, with
.Xr mount 8
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index dbcb4d10b7da..c4d4703a605a 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -27,7 +27,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: newfs_msdos.c,v 1.6 1998/12/07 14:09:17 rnordier Exp $";
+ "$Id: newfs_msdos.c,v 1.3 1998/07/16 12:24:51 rnordier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -243,7 +243,6 @@ main(int argc, char *argv[])
u_int8_t *img;
const char *fname, *dtype, *bname;
ssize_t n;
- time_t now;
u_int fat, bss, rds, cls, dir, lsn, x, x1, x2;
int ch, fd, fd1;
@@ -412,7 +411,7 @@ main(int argc, char *argv[])
bpb.rde = opt_e;
if (mflag) {
if (opt_m < 0xf0)
- errx(1, "illegal media descriptor (%#x)", opt_m);
+ errx(1, "illegal media descriptor (0x%x)", opt_m);
bpb.mid = opt_m;
}
if (opt_a)
@@ -427,7 +426,7 @@ main(int argc, char *argv[])
if (opt_B) {
bname = opt_B;
if (!strchr(bname, '/')) {
- snprintf(buf, sizeof(buf), "/boot/%s", bname);
+ snprintf(buf, sizeof(buf), "/usr/mdec/%s", bname);
if (!(bname = strdup(buf)))
err(1, NULL);
}
@@ -542,8 +541,7 @@ main(int argc, char *argv[])
print_bpb(&bpb);
if (!opt_N) {
gettimeofday(&tv, NULL);
- now = tv.tv_sec;
- tm = localtime(&now);
+ tm = localtime(&tv.tv_sec);
if (!(img = malloc(bpb.bps)))
err(1, NULL);
dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft;
@@ -804,7 +802,7 @@ print_bpb(struct bpb *bpb)
printf(" rde=%u", bpb->rde);
if (bpb->sec)
printf(" sec=%u", bpb->sec);
- printf(" mid=%#x", bpb->mid);
+ printf(" mid=0x%x", bpb->mid);
if (bpb->spf)
printf(" spf=%u", bpb->spf);
printf(" spt=%u hds=%u hid=%u", bpb->spt, bpb->hds, bpb->hid);
@@ -813,9 +811,9 @@ print_bpb(struct bpb *bpb)
if (!bpb->spf) {
printf(" bspf=%u rdcl=%u", bpb->bspf, bpb->rdcl);
printf(" infs=");
- printf(bpb->infs == MAXU16 ? "%#x" : "%u", bpb->infs);
+ printf(bpb->infs == MAXU16 ? "0x%x" : "%u", bpb->infs);
printf(" bkbs=");
- printf(bpb->bkbs == MAXU16 ? "%#x" : "%u", bpb->bkbs);
+ printf(bpb->bkbs == MAXU16 ? "0x%x" : "%u", bpb->bkbs);
}
printf("\n");
}
diff --git a/sbin/nologin/nologin.5 b/sbin/nologin/nologin.5
index 19a070df3eed..d84c56604419 100644
--- a/sbin/nologin/nologin.5
+++ b/sbin/nologin/nologin.5
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)nologin.8 8.1 (Berkeley) 6/19/93
-.\" $Id: nologin.5,v 1.4 1998/07/15 06:37:06 charnier Exp $
+.\" $Id$
.\"
.Dd June 19, 1993
.Dt NOLOGIN 5
@@ -41,22 +41,22 @@
.Sh DESCRIPTION
.Nm Nologin
disallows logins if the file
-.Pa /var/run/nologin
+.Pa /etc/nologin
exists.
Programs display the contents of
-.Pa /var/run/nologin
+.Pa /etc/nologin
to the user and exit.
.Sh SECURITY
Ignored by
.Xr login 1
for user root.
.Sh FILES
-.Bl -tag -width /var/run/nologinxxx -compact
-.It Pa /var/run/nologin
+.Bl -tag -width /etc/nologinxxx -compact
+.It Pa /etc/nologin
The
.Nm
file resides in
-.Pa /var/run .
+.Pa /etc .
.El
.Sh SEE ALSO
.Xr login 1 ,
diff --git a/sbin/ping/ping.8 b/sbin/ping/ping.8
index 50aeb0886be2..db82d5a4b8ba 100644
--- a/sbin/ping/ping.8
+++ b/sbin/ping/ping.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ping.8 8.2 (Berkeley) 12/11/93
-.\" $Id: ping.8,v 1.18 1998/11/29 13:20:04 bde Exp $
+.\" $Id: ping.8,v 1.16 1998/08/26 01:58:39 dillon Exp $
.\"
.Dd March 1, 1997
.Dt PING 8
@@ -48,7 +48,6 @@ packets to network hosts
.Op Fl l Ar preload
.Op Fl p Ar pattern
.Op Fl s Ar packetsize
-.Op Fl S Ar src_addr
.Bo
.Ar host |
.Op Fl L
@@ -86,10 +85,7 @@ Stop after sending
.Pq and receiving
.Ar count
.Tn ECHO_RESPONSE
-packets.
-If this option is not specified,
-.Nm
-will operate until interrupted.
+packets. If this option is not specified, ping will operate until interrupted.
.It Fl d
Set the
.Dv SO_DEBUG
@@ -104,7 +100,7 @@ sent a period
.Dq \&.
is printed, while for every
.Tn ECHO_REPLY
-received a backspace is printed.
+received a backspace is printed. Only root may specify this option.
This provides a rapid display of how many packets are being dropped.
Only the super-user may use this option.
.Bf -emphasis
@@ -115,10 +111,9 @@ Wait
.Ar wait
seconds
.Em between sending each packet .
-The default is to wait for one second between each packet.
-The wait time may be fractional, but only the super-user may specify
-values less then 1 second.
-This option is incompatible with the
+The default is to wait for one second between each packet. The
+wait time may be fractional, but only root may specify values
+less then 1 second. This option is incompatible with the
.Fl f
option.
.It Fl I Ar interface
@@ -202,8 +197,7 @@ The default is 56, which translates into 64
data bytes when combined
with the 8 bytes of
.Tn ICMP
-header data.
-Only the super-user may use this option.
+header data. Only root may use this option.
.It Fl T Ar ttl
Set the IP Time To Live for multicasted packets.
This flag only applies if the ping destination is a multicast address.
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index b1e20e8dec80..4db695bb0ec3 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
#endif
static const char rcsid[] =
- "$Id: ping.c,v 1.41 1998/08/26 18:51:37 des Exp $";
+ "$Id: ping.c,v 1.40 1998/08/26 01:58:39 dillon Exp $";
#endif /* not lint */
/*
@@ -141,7 +141,6 @@ u_char outpack[MAXPACKET];
char BSPACE = '\b'; /* characters written for flood */
char DOT = '.';
char *hostname;
-char *shostname;
int ident; /* process id to identify our packets */
int uid; /* cached uid for micro-optimization */
@@ -185,15 +184,14 @@ main(argc, argv)
{
struct timeval last, intvl;
struct hostent *hp;
- struct sockaddr_in *to, sin;
+ struct sockaddr_in *to;
struct termios ts;
register int i;
int ch, hold, packlen, preload, sockerrno, almost_done = 0;
struct in_addr ifaddr;
unsigned char ttl, loop;
u_char *datap, *packet;
- char *source = NULL, *target, hnamebuf[MAXHOSTNAMELEN];
- char snamebuf[MAXHOSTNAMELEN];
+ char *target, hnamebuf[MAXHOSTNAMELEN];
char *ep;
u_long ultmp;
#ifdef IP_OPTIONS
@@ -219,7 +217,7 @@ main(argc, argv)
preload = 0;
datap = &outpack[8 + PHDR_LEN];
- while ((ch = getopt(argc, argv, "I:LQRS:T:c:adfi:l:np:qrs:v")) != -1) {
+ while ((ch = getopt(argc, argv, "I:LQRT:c:adfi:l:np:qrs:v")) != -1) {
switch(ch) {
case 'a':
options |= F_AUDIBLE;
@@ -318,9 +316,6 @@ main(argc, argv)
optarg);
datalen = ultmp;
break;
- case 'S':
- source = optarg;
- break;
case 'T': /* multicast TTL */
ultmp = strtoul(optarg, &ep, 0);
if (*ep || ep == optarg || ultmp > 255)
@@ -341,31 +336,6 @@ main(argc, argv)
usage();
target = argv[optind];
- if (source) {
- bzero((char *)&sin, sizeof(sin));
- sin.sin_family = AF_INET;
- if (inet_aton(source, &sin.sin_addr) != 0) {
- shostname = source;
- } else {
- hp = gethostbyname2(source, AF_INET);
- if (!hp)
- errx(EX_NOHOST, "cannot resolve %s: %s",
- source, hstrerror(h_errno));
-
- sin.sin_len = sizeof sin;
- if (hp->h_length > sizeof(sin.sin_addr))
- errx(1,"gethostbyname2: illegal address");
- memcpy(&sin.sin_addr, hp->h_addr_list[0],
- sizeof (sin.sin_addr));
- (void)strncpy(snamebuf, hp->h_name,
- sizeof(snamebuf) - 1);
- snamebuf[sizeof(snamebuf) - 1] = '\0';
- shostname = snamebuf;
- }
- if (bind(s, (struct sockaddr *)&sin, sizeof sin) == -1)
- err(1, "bind");
- }
-
bzero((char *)&whereto, sizeof(struct sockaddr));
to = (struct sockaddr_in *)&whereto;
to->sin_family = AF_INET;
@@ -474,13 +444,11 @@ main(argc, argv)
(void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold,
sizeof(hold));
- if (to->sin_family == AF_INET) {
- (void)printf("PING %s (%s)", hostname,
- inet_ntoa(to->sin_addr));
- if (source)
- (void)printf(" from %s", shostname);
- (void)printf(": %d data bytes\n", datalen);
- } else
+ if (to->sin_family == AF_INET)
+ (void)printf("PING %s (%s): %d data bytes\n", hostname,
+ inet_ntoa(to->sin_addr),
+ datalen);
+ else
(void)printf("PING %s: %d data bytes\n", hostname, datalen);
/*
@@ -1316,9 +1284,8 @@ fill(bp, patp)
static void
usage()
{
- fprintf(stderr, "%s\n%s\n%s\n",
+ fprintf(stderr, "%s\n%s\n",
"usage: ping [-QRadfnqrv] [-c count] [-i wait] [-l preload] [-p pattern]",
-" [-s packetsize] [-S src_addr]",
-" [host | [-L] [-I iface] [-T ttl] mcast-group]");
+" [-s packetsize] [host | [-L] [-I iface] [-T ttl] mcast-group]");
exit(EX_USAGE);
}
diff --git a/sbin/reboot/boot_i386.8 b/sbin/reboot/boot_i386.8
index ea2d9978ca91..321fe8f5746c 100644
--- a/sbin/reboot/boot_i386.8
+++ b/sbin/reboot/boot_i386.8
@@ -36,7 +36,7 @@
.\"
.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94
.\"
-.\" $Id: boot_i386.8,v 1.15 1999/01/06 14:19:09 rnordier Exp $
+.\" $Id: boot_i386.8,v 1.13 1998/07/15 06:51:35 charnier Exp $
.\"
.Dd April 19, 1994
.Dt BOOT 8 i386
@@ -52,49 +52,25 @@ An automatic consistency check of the file systems will be performed,
and unless this fails, the system will resume multi-user operations.
.Pp
.Sy Cold starts.
-Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
-known as drive A:) and, failing that, from hard disk drive 0 (sometimes
-known as drive C:, or as drive 0x80 to the BIOS). Some BIOSes allow
-you to change this default sequence, and may also include a CD-ROM
+Most 386
+.Tn "PC AT"
+clones attempt to boot the floppy disk drive 0 (otherwise known as
+drive A:) first, and failing that, attempt to boot the hard disk
+drive 0 (otherwise known as drive C:,
+or (confusingly) hard disk drive 1, or drive 0x80 in the BIOS).
+Some BIOSes let you change this default sequence or may include a CD-ROM
drive as a boot device.
-.Pp
-By default, a three-stage bootstrap is employed, and control is
-automatically passed from the boot blocks (bootstrap stages one and
-two) to a separate third-stage bootstrap program,
-.Pa /boot/loader .
-This third stage provides more sophisticated control over the booting
-process than it is possible to achieve in the boot blocks, which are
-constrained by occupying limited fixed space on a given disk or slice.
-.Pp
-However, it is possible to dispense with the third stage altogether,
-either by specifying a kernel name in the boot block parameter
-file,
-.Pa /boot.config ,
-or by hitting a key during a brief pause (while one of the characters
-.Dv - ,
-.Dv \e ,
-.Dv \&| ,
-or
-.Dv /
-is displayed) before
-.Pa /boot/loader
-is invoked. Booting will also be attempted at stage two, if the
-third stage cannot be loaded.
-.Pp
-The remainder of this subsection deals only with the boot blocks.
-At present, documentation of the third stage is chiefly
-available through online help in the
-.Pa /boot/loader
-program itself.
-.Pp
After the boot blocks have been loaded,
you should see a prompt similar to the following:
.Bd -literal
->> FreeBSD/i386 BOOT
-Default: 0:wd(0,a)/kernel
+>> FreeBSD BOOT @ 0x10000: 640/7168 k of memory, internal console
+Boot default: 0:wd(0,a)kernel
+
boot:
.Ed
.Pp
+(You may see some tips printed on the screen too.)
+.Pp
The automatic boot will attempt to load
.Pa /kernel
from partition
@@ -107,12 +83,8 @@ prompt. At this time, the following input will be accepted:
.Bl -tag -width 10x
.It \&?
Give a short listing of the files in the root directory of the default
-boot device, as a hint about available boot files. (A
-.Dv \&?
-may also be specified as the last segment of a path, in which case
-the listing will be of the relevant subdirectory.)
-.Pp
-.It bios_drive:interface(unit,part) filename Op Fl aCcDdghPrsv
+boot device, as a hint about available boot files.
+.It Op bios_drive:interface(unit,part) Op filename Op Fl aCcDdghPrsv
Specify boot file and flags.
.Bl -tag -width 10x -compact
.It bios_drive
@@ -145,12 +117,12 @@ By convention, only partition
.Ql a
contains a bootable image. If sliced disks are used
.Pq Dq fdisk partitions ,
-any slice can be booted from, with the default being the active slice
-or, otherwise, the first FreeBSD slice.
+only the first BSD slice can be used to boot from. The partition
+letter always refers to the first slice.
.It filename
The pathname of the file to boot (relative to the root directory
on the specified partition). Defaults to
-.Pa /kernel .
+.Pa kernel .
Symbolic links are not supported (hard links are).
.It Fl acCdDghPrsv
Boot flags:
@@ -221,26 +193,36 @@ be verbose during device probing (and later).
.El
.Pp
You may put a BIOS drive number, a controller type, a unit number,
-a partition, a kernel file name, and any valid option in
+a partition, a kernel file name and the
+.Fl D,
+.Fl h
+or
+.Fl P
+options in
.Pa /boot.config
-to set defaults. Enter them in one line just as you type at the
+to set defaults. Write them in one line just as you type at the
.Ql boot:
prompt.
.Sh FILES
.Bl -tag -width /kernel.old.config -compact
.It Pa /boot.config
-parameters for the boot blocks (optional)
-.It Pa /boot/loader
-third-stage bootstrap
+parameters for the boot loader (optional)
+.It Pa /boot.help
+help messages
.It Pa /kernel
default kernel
+.It Pa /kernel.config
+parameters for default kernel (optional)
.It Pa /kernel.old
typical non-default kernel (optional)
+.It Pa /kernel.old.config
+parameters for non-default kernel (optional)
+.\" .It Pa /boot
+.\" system bootstrap
.El
.Sh SEE ALSO
.Xr ddb 4 ,
.Xr ttys 5 ,
-.Xr btxld 8 ,
.Xr config 8 ,
.Xr disklabel 8 ,
.Xr halt 8 ,
@@ -252,4 +234,5 @@ The disklabel format used by this version of
is quite
different from that of other architectures.
.Pp
-Some features are not yet documented.
+The boot flags are not very self-explanatory, and the alphabet has
+too few characters to implement every potentially useful boot option.
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index db68d66a470d..15d7b067909e 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: dirs.c,v 1.12 1998/07/28 06:20:05 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -71,8 +71,8 @@ static const char rcsid[] =
struct inotab {
struct inotab *t_next;
ino_t t_ino;
- int32_t t_seekpt;
- int32_t t_size;
+ long t_seekpt;
+ long t_size;
};
static struct inotab *inotab[HASHSIZE];
@@ -95,8 +95,8 @@ struct modeinfo {
#define DIRBLKSIZ 1024
struct rstdirdesc {
int dd_fd;
- int32_t dd_loc;
- int32_t dd_size;
+ long dd_loc;
+ long dd_size;
char dd_buf[DIRBLKSIZ];
};
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 1d6424db239a..763ca13a3fee 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: interactive.c,v 1.6 1998/09/17 20:18:11 imp Exp $";
+ "$Id: interactive.c,v 1.5 1998/07/28 06:20:08 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -343,8 +343,7 @@ getcmd(curdir, cmd, name, size, ap)
* If no argument, use curdir as the default.
*/
if (*cp == '\0') {
- (void) strncpy(name, curdir, size);
- name[size - 1] = '\0';
+ (void) strcpy(name, curdir);
return;
}
nextarg = cp;
@@ -378,8 +377,7 @@ getnext:
ap->argcnt = ap->glob.gl_pathc;
retnext:
- strncpy(name, ap->glob.gl_pathv[ap->glob.gl_pathc - ap->argcnt], size);
- name[size - 1] = '\0';
+ strcpy(name, ap->glob.gl_pathv[ap->glob.gl_pathc - ap->argcnt]);
if (--ap->argcnt == 0) {
ap->freeglob = 0;
globfree(&ap->glob);
diff --git a/sbin/restore/restore.8 b/sbin/restore/restore.8
index 9c9159614227..2bf072205862 100644
--- a/sbin/restore/restore.8
+++ b/sbin/restore/restore.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)restore.8 8.4 (Berkeley) 5/1/95
-.\" $Id: restore.8,v 1.14 1998/09/22 10:05:27 roberto Exp $
+.\" $Id: restore.8,v 1.13 1998/07/28 06:20:11 charnier Exp $
.\"
.Dd May 1, 1995
.Dt RESTORE 8
@@ -281,7 +281,7 @@ may be a special device file
like
.Pa /dev/rmt12
(a tape drive),
-.Pa /dev/rda1c
+.Pa /dev/rsd1c
(a disk drive),
an ordinary file,
or
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 795669ca74e6..f9a5422ab85b 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)symtab.c 8.3 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: symtab.c,v 1.5 1998/07/28 06:20:13 charnier Exp $";
+ "$Id$";
#endif /* not lint */
/*
@@ -440,13 +440,13 @@ freename(name)
* Useful quantities placed at the end of a dumped symbol table.
*/
struct symtableheader {
- int32_t volno;
- int32_t stringsize;
- int32_t entrytblsize;
+ long volno;
+ long stringsize;
+ long entrytblsize;
time_t dumptime;
time_t dumpdate;
ino_t maxino;
- int32_t ntrec;
+ long ntrec;
};
/*
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 80a14a864e1a..03ddd15aa2bc 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: tape.c,v 1.14 1998/07/28 18:50:01 imp Exp $";
+ "$Id: tape.c,v 1.13 1998/07/28 06:20:15 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1009,32 +1009,32 @@ gethead(buf)
long i;
union {
quad_t qval;
- int32_t val[2];
+ long val[2];
} qcvt;
union u_ospcl {
char dummy[TP_BSIZE];
struct s_ospcl {
- int32_t c_type;
- int32_t c_date;
- int32_t c_ddate;
- int32_t c_volume;
- int32_t c_tapea;
+ long c_type;
+ long c_date;
+ long c_ddate;
+ long c_volume;
+ long c_tapea;
u_short c_inumber;
- int32_t c_magic;
- int32_t c_checksum;
+ long c_magic;
+ long c_checksum;
struct odinode {
unsigned short odi_mode;
u_short odi_nlink;
u_short odi_uid;
u_short odi_gid;
- int32_t odi_size;
- int32_t odi_rdev;
+ long odi_size;
+ long odi_rdev;
char odi_addr[36];
- int32_t odi_atime;
- int32_t odi_mtime;
- int32_t odi_ctime;
+ long odi_atime;
+ long odi_mtime;
+ long odi_ctime;
} c_dinode;
- int32_t c_count;
+ long c_count;
char c_addr[256];
} s_ospcl;
} u_ospcl;
diff --git a/sbin/shutdown/shutdown.8 b/sbin/shutdown/shutdown.8
index 70d6044c8ae1..0d40c1cddbcc 100644
--- a/sbin/shutdown/shutdown.8
+++ b/sbin/shutdown/shutdown.8
@@ -29,10 +29,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95
-.\" $Id: shutdown.8,v 1.8 1998/12/11 10:35:38 bde Exp $
+.\" @(#)shutdown.8 8.1 (Berkeley) 6/5/93
+.\" $Id$
.\"
-.Dd Dec 11, 1998
+.Dd June 5, 1993
.Dt SHUTDOWN 8
.Os BSD 4
.Sh NAME
@@ -41,7 +41,7 @@
.Sh SYNOPSIS
.Nm shutdown
.Op Fl
-.Op Fl hknpr
+.Op Fl hkrn
.Ar time
.Op Ar warning-message ...
.Sh DESCRIPTION
@@ -61,7 +61,7 @@ when
executes
.Xr halt 8 .
.It Fl k
-Kick everybody off.
+Kick every body off.
The
.Fl k
option
@@ -71,8 +71,6 @@ system multi-user with logins disabled (for all but super-user).
Prevent the normal
.Xr sync 2
before stopping.
-.It Fl p
-The system will turn the power off after shutdown if it can.
.It Fl r
.Nm Shutdown
executes
@@ -110,7 +108,7 @@ and starting at ten hours before shutdown, warning messages are displayed
on the terminals of all users logged in. Five minutes before
shutdown, or immediately if shutdown is in less than 5 minutes,
logins are disabled by creating
-.Pa /var/run/nologin
+.Pa /etc/nologin
and copying the
warning message there. If this file exists when a user attempts to
log in,
@@ -129,13 +127,13 @@ to bring the system down to single-user state (depending on above
options).
The time of the shutdown and the warning message
are placed in
-.Pa /var/run/nologin
+.Pa /etc/nologin
and should be used to
inform the users about when the system will be back up
and why it is going down (or anything else).
.Sh FILES
-.Bl -tag -width /var/run/nologin -compact
-.It Pa /var/run/nologin
+.Bl -tag -width /etc/nologin -compact
+.It Pa /etc/nologin
tells login not to let anyone log in
.El
.Sh SEE ALSO
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 680925fc970a..025a1c68b423 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -39,10 +39,10 @@ static const char copyright[] =
#ifndef lint
#if 0
-static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95";
+static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94";
#endif
static const char rcsid[] =
- "$Id: shutdown.c,v 1.15 1998/12/11 11:04:19 bde Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -93,7 +93,7 @@ struct interval {
#undef S
static time_t offset, shuttime;
-static int dohalt, dopower, doreboot, killflg, mbuflen;
+static int dohalt, doreboot, killflg, mbuflen;
static char *nosync, *whom, mbuf[BUFSIZ];
void badtime __P((void));
@@ -121,7 +121,7 @@ main(argc, argv)
#endif
nosync = NULL;
readstdin = 0;
- while ((ch = getopt(argc, argv, "-hknpr")) != -1)
+ while ((ch = getopt(argc, argv, "-hknr")) != -1)
switch (ch) {
case '-':
readstdin = 1;
@@ -135,9 +135,6 @@ main(argc, argv)
case 'n':
nosync = "-n";
break;
- case 'p':
- dopower = 1;
- break;
case 'r':
doreboot = 1;
break;
@@ -151,8 +148,8 @@ main(argc, argv)
if (argc < 1)
usage();
- if (doreboot + dohalt + dopower > 1) {
- warnx("incompatible switches -h, -p and -r");
+ if (doreboot && dohalt) {
+ warnx("incompatible switches -h and -r");
usage();
}
getoffset(*argv++);
@@ -164,7 +161,7 @@ main(argc, argv)
break;
if (p != mbuf)
*p++ = ' ';
- memmove(p, *argv, arglen);
+ bcopy(*argv, p, arglen);
p += arglen;
}
*p = '\n';
@@ -329,8 +326,7 @@ die_you_gravy_sucking_pig_dog()
char *empty_environ[] = { NULL };
syslog(LOG_NOTICE, "%s by %s: %s",
- doreboot ? "reboot" : dohalt ? "halt" : dopower ? "power-down" :
- "shutdown", whom, mbuf);
+ doreboot ? "reboot" : dohalt ? "halt" : "shutdown", whom, mbuf);
(void)sleep(2);
(void)printf("\r\nSystem shutdown time has arrived\007\007\r\n");
@@ -343,8 +339,6 @@ die_you_gravy_sucking_pig_dog()
(void)printf("reboot");
else if (dohalt)
(void)printf("halt");
- else if (dopower)
- (void)printf("power-down");
if (nosync)
(void)printf(" no sync");
(void)printf("\nkill -HUP 1\n");
@@ -361,12 +355,6 @@ die_you_gravy_sucking_pig_dog()
syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_HALT);
warn(_PATH_HALT);
}
- else if (dopower) {
- execle(_PATH_HALT, "halt", "-l", "-p", nosync,
- (char *)NULL, empty_environ);
- syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_HALT);
- warn(_PATH_HALT);
- }
(void)kill(1, SIGTERM); /* to single user */
#endif
finish(0);
@@ -480,8 +468,7 @@ void
finish(signo)
int signo;
{
- if (!killflg)
- (void)unlink(_PATH_NOLOGIN);
+ (void)unlink(_PATH_NOLOGIN);
exit(0);
}
@@ -494,7 +481,6 @@ badtime()
void
usage()
{
- fprintf(stderr,
- "usage: shutdown [-] [-hknpr] time [warning-message ...]\n");
+ fprintf(stderr, "usage: shutdown [-hknr] shutdowntime [ message ]\n");
exit(1);
}
diff --git a/sbin/sysctl/Makefile b/sbin/sysctl/Makefile
deleted file mode 100644
index e0c6a2238d45..000000000000
--- a/sbin/sysctl/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id$
-
-PROG= sysctl
-MAN8= sysctl.8
-
-BINDIR= /sbin
-NOSHARED?= yes
-
-.include <bsd.prog.mk>
diff --git a/sbin/sysctl/pathconf.c b/sbin/sysctl/pathconf.c
deleted file mode 100644
index 07f786d82086..000000000000
--- a/sbin/sysctl/pathconf.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 1993
- * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint
-static const char copyright[] =
-"@(#) Copyright (c) 1993\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)pathconf.c 8.1 (Berkeley) 6/6/93";
-#endif
-static const char rcsid[] =
- "$Id$";
-#endif /* not lint */
-
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/unistd.h>
-
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define PC_NAMES { \
- { 0, 0 }, \
- { "link_max", CTLTYPE_INT }, \
- { "max_canon", CTLTYPE_INT }, \
- { "max_input", CTLTYPE_INT }, \
- { "name_max", CTLTYPE_INT }, \
- { "path_max", CTLTYPE_INT }, \
- { "pipe_buf", CTLTYPE_INT }, \
- { "chown_restricted", CTLTYPE_INT }, \
- { "no_trunc", CTLTYPE_INT }, \
- { "vdisable", CTLTYPE_INT }, \
-}
-#define PC_MAXID 10
-
-struct ctlname pcnames[] = PC_NAMES;
-char names[BUFSIZ];
-
-struct list {
- struct ctlname *list;
- int size;
-};
-struct list pclist = { pcnames, PC_MAXID };
-
-int Aflag, aflag, nflag, wflag, stdinflag;
-
-int findname __P((char *, char *, char**, struct list *));
-void listall __P((char *, struct list *));
-void parse __P((char *, char *, int));
-static void usage __P((void));
-
-int
-main(argc, argv)
- int argc;
- char *argv[];
-{
- char *path;
- int ch;
-
- while ((ch = getopt(argc, argv, "Aan")) != -1) {
- switch (ch) {
-
- case 'A':
- Aflag = 1;
- break;
-
- case 'a':
- aflag = 1;
- break;
-
- case 'n':
- nflag = 1;
- break;
-
- default:
- usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- if (argc == 0)
- usage();
- path = *argv++;
- if (strcmp(path, "-") == 0)
- stdinflag = 1;
- argc--;
- if (Aflag || aflag) {
- listall(path, &pclist);
- exit(0);
- }
- if (argc == 0)
- usage();
- while (argc-- > 0)
- parse(path, *argv, 1);
- exit(0);
-}
-
-/*
- * List all variables known to the system.
- */
-void
-listall(path, lp)
- char *path;
- struct list *lp;
-{
- int lvl2;
-
- if (lp->list == 0)
- return;
- for (lvl2 = 0; lvl2 < lp->size; lvl2++) {
- if (lp->list[lvl2].ctl_name == 0)
- continue;
- parse(path, lp->list[lvl2].ctl_name, Aflag);
- }
-}
-
-/*
- * Parse a name into an index.
- * Lookup and print out the attribute if it exists.
- */
-void
-parse(pathname, string, flags)
- char *pathname;
- char *string;
- int flags;
-{
- int indx, value;
- char *bufp, buf[BUFSIZ];
-
- bufp = buf;
- snprintf(buf, BUFSIZ, "%s", string);
- if ((indx = findname(string, "top", &bufp, &pclist)) == -1)
- return;
- if (bufp) {
- warnx("name %s in %s is unknown", *bufp, string);
- return;
- }
- if (stdinflag)
- value = fpathconf(0, indx);
- else
- value = pathconf(pathname, indx);
- if (value == -1) {
- if (flags == 0)
- return;
- switch (errno) {
- case EOPNOTSUPP:
- warnx("%s: value is not available", string);
- return;
- case ENOTDIR:
- warnx("%s: specification is incomplete", string);
- return;
- case ENOMEM:
- warnx("%s: type is unknown to this program", string);
- return;
- default:
- warn("%s", string);
- return;
- }
- }
- if (!nflag)
- fprintf(stdout, "%s = ", string);
- fprintf(stdout, "%d\n", value);
-}
-
-/*
- * Scan a list of names searching for a particular name.
- */
-int
-findname(string, level, bufp, namelist)
- char *string;
- char *level;
- char **bufp;
- struct list *namelist;
-{
- char *name;
- int i;
-
- if (namelist->list == 0 || (name = strsep(bufp, ".")) == NULL) {
- warnx("%s: incomplete specification", string);
- return (-1);
- }
- for (i = 0; i < namelist->size; i++)
- if (namelist->list[i].ctl_name != NULL &&
- strcmp(name, namelist->list[i].ctl_name) == 0)
- break;
- if (i == namelist->size) {
- warnx("%s level name %s in %s is invalid", level, name, string);
- return (-1);
- }
- return (i);
-}
-
-static void
-usage()
-{
-
- (void)fprintf(stderr, "%s\n%s\n%s\n",
- "usage: pathname [-n] variable ...",
- " pathname [-n] -a",
- " pathname [-n] -A");
- exit(1);
-}
diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8
deleted file mode 100644
index e959ecd77aff..000000000000
--- a/sbin/sysctl/sysctl.8
+++ /dev/null
@@ -1,243 +0,0 @@
-.\" Copyright (c) 1993
-.\" The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
-.\"
-.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93
-.\" $Id: sysctl.8,v 1.17 1998/09/29 02:01:06 jkoshy Exp $
-.\"
-.Dd September 23, 1994
-.Dt SYSCTL 8
-.Os
-.Sh NAME
-.Nm sysctl
-.Nd get or set kernel state
-.Sh SYNOPSIS
-.Nm sysctl
-.Op Fl bdn
-.Ar name ...
-.Nm sysctl
-.Op Fl bn
-.Fl w
-.Ar name=value ...
-.Nm sysctl
-.Op Fl bdn
-.Fl aAX
-.Sh DESCRIPTION
-The
-.Nm
-utility retrieves kernel state and allows processes with
-appropriate privilege to set kernel state.
-The state to be retrieved or set is described using a
-``Management Information Base'' (``MIB'') style name,
-described as a dotted set of components.
-.Pp
-The following options are available:
-.Bl -tag -width indent
-.It Fl a
-List all the currently available string or integer values.
-.It Fl A
-List all the known MIB names including opaques.
-Those with string or integer values will be printed as with the
-.Fl a
-flag; for the opaque values,
-information about the format and the length is printed in addition the first
-few bytes is dumped in hex.
-.It Fl X
-Same as
-.Fl A
-except the entire value of opaque variables is hexdumped.
-.It Fl n
-Specify that the printing of the field name should be
-suppressed and that only its value should be output.
-This flag is useful for setting shell variables.
-For example, to save the pagesize in variable psize, use:
-.Bd -literal -offset indent -compact
-set psize=`sysctl -n hw.pagesize`
-.Ed
-.It Fl b
-Force the value of the variable(s) to be output in raw, binary
-format. No names are printed and no terminating newlines are output.
-This is mostly useful with a single variable.
-.It Fl d
-Display the description rather than the value of the requested
-variable(s).
-.It Fl w Ar name=value ...
-Set the MIB
-.Ar name
-to the new
-.Ar value .
-If just a MIB style
-.Ar name
-is given,
-the corresponding value is retrieved.
-.El
-.Pp
-The information available from
-.Nm
-consists of integers, strings, and opaques.
-.Nm Sysctl
-only knows about a couple of opaque types, and will resort to hexdumps
-for the rest.
-The opaque information is much more useful if retrieved by special
-purpose programs such as
-.Nm ps ,
-.Nm systat ,
-and
-.Nm netstat .
-.Pp
-The string and integer information is summarized below.
-For a detailed description of these variable see
-.Xr sysctl 3 .
-.Pp
-The changeable column indicates whether a process with appropriate
-privilege can change the value.
-.Bl -column net.inet.ip.forwardingxxxxxx integerxxx
-.It Sy Name Type Changeable
-.It kern.ostype string no
-.It kern.osrelease string no
-.It kern.osrevision integer no
-.It kern.version string no
-.It kern.maxvnodes integer yes
-.It kern.maxproc integer no
-.It kern.maxprocperuid integer yes
-.It kern.maxfiles integer yes
-.It kern.maxfilesperproc integer yes
-.It kern.argmax integer no
-.It kern.securelevel integer raise only
-.It kern.hostname string yes
-.It kern.hostid integer yes
-.It kern.clockrate struct no
-.It kern.posix1version integer no
-.It kern.ngroups integer no
-.It kern.job_control integer no
-.It kern.saved_ids integer no
-.It kern.boottime struct no
-.It kern.domainname string yes
-.It kern.update integer yes
-.It kern.osreldate string no
-.It kern.bootfile string yes
-.It kern.corefile string yes
-.It kern.logsigexit integer yes
-.It vm.loadavg struct no
-.It hw.machine string no
-.It hw.model string no
-.It hw.ncpu integer no
-.It hw.byteorder integer no
-.It hw.physmem integer no
-.It hw.usermem integer no
-.It hw.pagesize integer no
-.It hw.floatingpoint integer no
-.It hw.machine_arch string no
-.It machdep.console_device dev_t no
-.It machdep.adjkerntz integer yes
-.It machdep.disable_rtc_set integer yes
-.It user.cs_path string no
-.It user.bc_base_max integer no
-.It user.bc_dim_max integer no
-.It user.bc_scale_max integer no
-.It user.bc_string_max integer no
-.It user.coll_weights_max integer no
-.It user.expr_nest_max integer no
-.It user.line_max integer no
-.It user.re_dup_max integer no
-.It user.posix2_version integer no
-.It user.posix2_c_bind integer no
-.It user.posix2_c_dev integer no
-.It user.posix2_char_term integer no
-.It user.posix2_fort_dev integer no
-.It user.posix2_fort_run integer no
-.It user.posix2_localedef integer no
-.It user.posix2_sw_dev integer no
-.It user.posix2_upe integer no
-.It user.stream_max integer no
-.It user.tzname_max integer no
-.El
-.Sh EXAMPLES
-For example, to retrieve the maximum number of processes allowed
-in the system, one would use the follow request:
-.Bd -literal -offset indent -compact
-sysctl kern.maxproc
-.Ed
-.Pp
-To set the maximum number of processes allowed
-per uid to 1000, one would use the follow request:
-.Bd -literal -offset indent -compact
-sysctl -w kern.maxprocperuid=1000
-.Ed
-.Pp
-Information about the system clock rate may be obtained with:
-.Bd -literal -offset indent -compact
-sysctl kern.clockrate
-.Ed
-.Pp
-Information about the load average history may be obtained with:
-.Bd -literal -offset indent -compact
-sysctl vm.loadavg
-.Ed
-.Pp
-More variables than these exist, and the best and likely only place
-to search for their deeper meaning is undoubtedly the source where
-they are defined.
-.Sh FILES
-.Bl -tag -width <netinet/icmpXvar.h> -compact
-.It Pa <sys/sysctl.h>
-definitions for top level identifiers, second level kernel and hardware
-identifiers, and user level identifiers
-.It Pa <sys/socket.h>
-definitions for second level network identifiers
-.It Pa <sys/gmon.h>
-definitions for third level profiling identifiers
-.It Pa <vm/vm_param.h>
-definitions for second level virtual memory identifiers
-.It Pa <netinet/in.h>
-definitions for third level Internet identifiers and
-fourth level IP identifiers
-.It Pa <netinet/icmp_var.h>
-definitions for fourth level ICMP identifiers
-.It Pa <netinet/udp_var.h>
-definitions for fourth level UDP identifiers
-.El
-.Sh SEE ALSO
-.Xr sysctl 3
-.Sh BUGS
-.Nm Sysctl
-presently exploits an undocumented interface to the kernel
-sysctl facility to traverse the sysctl tree and to retrieve format
-and name information.
-This correct interface is being thought about for the time being.
-.Sh HISTORY
-.Nm Sysctl
-first appeared in
-.Bx 4.4 .
-.Pp
-In
-.Fx 2.2 ,
-.Nm
-was significantly remodeled.
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
deleted file mode 100644
index f264409d6b3d..000000000000
--- a/sbin/sysctl/sysctl.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * Copyright (c) 1993
- * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint
-static const char copyright[] =
-"@(#) Copyright (c) 1993\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93";
-#endif
-static const char rcsid[] =
- "$Id: sysctl.c,v 1.19 1998/11/08 19:27:43 phk Exp $";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/resource.h>
-
-#include <ctype.h>
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag;
-
-static int oidfmt(int *, int, char *, u_int *);
-static void parse(char *);
-static int show_var(int *, int);
-static int sysctl_all (int *oid, int len);
-static int name2oid(char *, int *);
-
-static void
-usage(void)
-{
-
- (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
- "usage: sysctl [-bdn] variable ...",
- " sysctl [-bn] -w variable=value ...",
- " sysctl [-bdn] -a",
- " sysctl [-bdn] -A",
- " sysctl [-bdn] -X");
- exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
- int ch;
- setbuf(stdout,0);
- setbuf(stderr,0);
-
- while ((ch = getopt(argc, argv, "AabdnwX")) != -1) {
- switch (ch) {
- case 'A': Aflag = 1; break;
- case 'a': aflag = 1; break;
- case 'b': bflag = 1; break;
- case 'd': dflag = 1; break;
- case 'n': nflag = 1; break;
- case 'w': wflag = 1; break;
- case 'X': Xflag = Aflag = 1; break;
- default: usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- if (wflag && (Aflag || aflag || dflag))
- usage();
- if (Aflag || aflag)
- exit (sysctl_all(0, 0));
- if (argc == 0)
- usage();
- while (argc-- > 0)
- parse(*argv++);
- exit(0);
-}
-
-/*
- * Parse a name into a MIB entry.
- * Lookup and print out the MIB entry if it exists.
- * Set a new value if requested.
- */
-static void
-parse(char *string)
-{
- int len, i, j;
- void *newval = 0;
- int intval, newsize = 0;
- quad_t quadval;
- int mib[CTL_MAXNAME];
- char *cp, *bufp, buf[BUFSIZ];
- u_int kind;
-
- bufp = buf;
- snprintf(buf, BUFSIZ, "%s", string);
- if ((cp = strchr(string, '=')) != NULL) {
- if (!wflag)
- errx(2, "must specify -w to set variables");
- *strchr(buf, '=') = '\0';
- *cp++ = '\0';
- while (isspace(*cp))
- cp++;
- newval = cp;
- newsize = strlen(cp);
- } else {
- if (wflag)
- usage();
- }
- len = name2oid(bufp, mib);
-
- if (len < 0)
- errx(1, "unknown oid '%s'", bufp);
-
- if (oidfmt(mib, len, 0, &kind))
- err(1, "couldn't find format of oid '%s'", bufp);
-
- if (!wflag) {
- if ((kind & CTLTYPE) == CTLTYPE_NODE) {
- sysctl_all(mib, len);
- } else {
- i = show_var(mib, len);
- if (!i && !bflag)
- putchar('\n');
- }
- } else {
- if ((kind & CTLTYPE) == CTLTYPE_NODE)
- errx(1, "oid '%s' isn't a leaf node", bufp);
-
- if (!(kind&CTLFLAG_WR))
- errx(1, "oid '%s' is read only", bufp);
-
- switch (kind & CTLTYPE) {
- case CTLTYPE_INT:
- intval = atoi(newval);
- newval = &intval;
- newsize = sizeof intval;
- break;
- break;
- case CTLTYPE_STRING:
- break;
- case CTLTYPE_QUAD:
- break;
- sscanf(newval, "%qd", &quadval);
- newval = &quadval;
- newsize = sizeof quadval;
- break;
- default:
- errx(1, "oid '%s' is type %d,"
- " cannot set that", bufp,
- kind & CTLTYPE);
- }
-
- i = show_var(mib, len);
- if (sysctl(mib, len, 0, 0, newval, newsize) == -1) {
- if (!i && !bflag)
- putchar('\n');
- switch (errno) {
- case EOPNOTSUPP:
- errx(1, "%s: value is not available",
- string);
- case ENOTDIR:
- errx(1, "%s: specification is incomplete",
- string);
- case ENOMEM:
- errx(1, "%s: type is unknown to this program",
- string);
- default:
- warn("%s", string);
- return;
- }
- }
- if (!bflag)
- printf(" -> ");
- i = nflag;
- nflag = 1;
- j = show_var(mib, len);
- if (!j && !bflag)
- putchar('\n');
- nflag = i;
- }
-}
-
-/* These functions will dump out various interesting structures. */
-
-static int
-S_clockinfo(int l2, void *p)
-{
- struct clockinfo *ci = (struct clockinfo*)p;
- if (l2 != sizeof *ci)
- err(1, "S_clockinfo %d != %d", l2, sizeof *ci);
- printf("{ hz = %d, tick = %d, tickadj = %d, profhz = %d, stathz = %d }",
- ci->hz, ci->tick, ci->tickadj, ci->profhz, ci->stathz);
- return (0);
-}
-
-static int
-S_loadavg(int l2, void *p)
-{
- struct loadavg *tv = (struct loadavg*)p;
-
- if (l2 != sizeof *tv)
- err(1, "S_loadavg %d != %d", l2, sizeof *tv);
-
- printf("{ %.2f %.2f %.2f }",
- (double)tv->ldavg[0]/(double)tv->fscale,
- (double)tv->ldavg[1]/(double)tv->fscale,
- (double)tv->ldavg[2]/(double)tv->fscale);
- return (0);
-}
-
-static int
-S_timeval(int l2, void *p)
-{
- struct timeval *tv = (struct timeval*)p;
- time_t tv_sec;
- char *p1, *p2;
-
- if (l2 != sizeof *tv)
- err(1, "S_timeval %d != %d", l2, sizeof *tv);
- printf("{ sec = %ld, usec = %ld } ",
- tv->tv_sec, tv->tv_usec);
- tv_sec = tv->tv_sec;
- p1 = strdup(ctime(&tv_sec));
- for (p2=p1; *p2 ; p2++)
- if (*p2 == '\n')
- *p2 = '\0';
- fputs(p1, stdout);
- return (0);
-}
-
-static int
-T_dev_t(int l2, void *p)
-{
- dev_t *d = (dev_t *)p;
- if (l2 != sizeof *d)
- err(1, "T_dev_T %d != %d", l2, sizeof *d);
- printf("{ major = %d, minor = %d }",
- major(*d), minor(*d));
- return (0);
-}
-
-/*
- * These functions uses a presently undocumented interface to the kernel
- * to walk the tree and get the type so it can print the value.
- * This interface is under work and consideration, and should probably
- * be killed with a big axe by the first person who can find the time.
- * (be aware though, that the proper interface isn't as obvious as it
- * may seem, there are various conflicting requirements.
- */
-
-static int
-name2oid(char *name, int *oidp)
-{
- int oid[2];
- int i;
- size_t j;
-
- oid[0] = 0;
- oid[1] = 3;
-
- j = CTL_MAXNAME * sizeof (int);
- i = sysctl(oid, 2, oidp, &j, name, strlen(name));
- if (i < 0)
- return i;
- j /= sizeof (int);
- return (j);
-}
-
-static int
-oidfmt(int *oid, int len, char *fmt, u_int *kind)
-{
- int qoid[CTL_MAXNAME+2];
- u_char buf[BUFSIZ];
- int i;
- size_t j;
-
- qoid[0] = 0;
- qoid[1] = 4;
- memcpy(qoid + 2, oid, len * sizeof(int));
-
- j = sizeof buf;
- i = sysctl(qoid, len + 2, buf, &j, 0, 0);
- if (i)
- err(1, "sysctl fmt %d %d %d", i, j, errno);
-
- if (kind)
- *kind = *(u_int *)buf;
-
- if (fmt)
- strcpy(fmt, (char *)(buf + sizeof(u_int)));
- return 0;
-}
-
-/*
- * This formats and outputs the value of one variable
- *
- * Returns zero if anything was actually output.
- * Returns one if didn't know what to do with this.
- * Return minus one if we had errors.
- */
-
-static int
-show_var(int *oid, int nlen)
-{
- u_char buf[BUFSIZ], *val, *p;
- char name[BUFSIZ], descr[BUFSIZ], *fmt;
- int qoid[CTL_MAXNAME+2];
- int i;
- size_t j, len;
- u_int kind;
- int (*func)(int, void *) = 0;
-
- qoid[0] = 0;
- memcpy(qoid + 2, oid, nlen * sizeof(int));
-
- qoid[1] = 1;
- j = sizeof name;
- i = sysctl(qoid, nlen + 2, name, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl name %d %d %d", i, j, errno);
-
- if (dflag) {
- qoid[1] = 5;
- j = sizeof descr;
- i = sysctl(qoid, nlen + 2, descr, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl name %d %d %d", i, j, errno);
- if (!nflag)
- printf("%s: ", name);
- printf("%s", descr[0] ? descr : "[no description]");
- return (0);
- }
-
- /* find an estimate of how much we need for this var */
- j = 0;
- i = sysctl(oid, nlen, 0, &j, 0, 0);
- j += j; /* we want to be sure :-) */
-
- val = alloca(j);
- len = j;
- i = sysctl(oid, nlen, val, &len, 0, 0);
- if (i || !len)
- return (1);
-
- if (bflag) {
- fwrite(val, 1, len, stdout);
- return (0);
- }
-
- qoid[1] = 4;
- j = sizeof buf;
- i = sysctl(qoid, nlen + 2, buf, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl fmt %d %d %d", i, j, errno);
-
- kind = *(u_int *)buf;
-
- fmt = (char *)(buf + sizeof(u_int));
-
- p = val;
- switch (*fmt) {
- case 'A':
- if (!nflag)
- printf("%s: ", name);
- printf("%s", p);
- return (0);
-
- case 'I':
- if (!nflag)
- printf("%s: ", name);
- val = "";
- while (len >= sizeof(int)) {
- printf("%s%d", val, *(int *)p);
- val = " ";
- len -= sizeof (int);
- p += sizeof (int);
- }
- return (0);
-
- case 'L':
- if (!nflag)
- printf("%s: ", name);
- printf("%ld", *(long *)p);
- return (0);
-
- case 'P':
- if (!nflag)
- printf("%s: ", name);
- printf("%p", *(void **)p);
- return (0);
-
- case 'T':
- case 'S':
- i = 0;
- if (!strcmp(fmt, "S,clockinfo")) func = S_clockinfo;
- else if (!strcmp(fmt, "S,timeval")) func = S_timeval;
- else if (!strcmp(fmt, "S,loadavg")) func = S_loadavg;
- else if (!strcmp(fmt, "T,dev_t")) func = T_dev_t;
- if (func) {
- if (!nflag)
- printf("%s: ", name);
- return ((*func)(len, p));
- }
- /* FALL THROUGH */
- default:
- if (!Aflag)
- return (1);
- if (!nflag)
- printf("%s: ", name);
- printf("Format:%s Length:%d Dump:0x", fmt, len);
- while (len--) {
- printf("%02x", *p++);
- if (Xflag || p < val+16)
- continue;
- printf("...");
- break;
- }
- return (0);
- }
- return (1);
-}
-
-static int
-sysctl_all (int *oid, int len)
-{
- int name1[22], name2[22];
- int i, j;
- size_t l1, l2;
-
- name1[0] = 0;
- name1[1] = 2;
- l1 = 2;
- if (len) {
- memcpy(name1+2, oid, len*sizeof (int));
- l1 += len;
- } else {
- name1[2] = 1;
- l1++;
- }
- while (1) {
- l2 = sizeof name2;
- j = sysctl(name1, l1, name2, &l2, 0, 0);
- if (j < 0)
- if (errno == ENOENT)
- return 0;
- else
- err(1, "sysctl(getnext) %d %d", j, l2);
-
- l2 /= sizeof (int);
-
- if (l2 < len)
- return 0;
-
- for (i = 0; i < len; i++)
- if (name2[i] != oid[i])
- return 0;
-
- i = show_var(name2, l2);
- if (!i && !bflag)
- putchar('\n');
-
- memcpy(name1+2, name2, l2*sizeof (int));
- l1 = 2 + l2;
- }
-}
diff --git a/sbin/tunefs/tunefs.8 b/sbin/tunefs/tunefs.8
index 9706d4323324..42ca903df9b9 100644
--- a/sbin/tunefs/tunefs.8
+++ b/sbin/tunefs/tunefs.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93
-.\" $Id: tunefs.8,v 1.7 1998/08/03 06:41:20 charnier Exp $
+.\" $Id$
.\"
.Dd December 11, 1993
.Dt TUNEFS 8
@@ -45,10 +45,10 @@
.Op Fl d Ar rotdelay
.Op Fl e Ar maxbpg
.Op Fl m Ar minfree
+.Op Fl p
.Bk -words
.Op Fl n Ar enable | disable
.Op Fl o Ar optimize_preference
-.Op Fl p
.Ek
.Op Ar special | Ar filesystem
.Sh DESCRIPTION
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 8a32cb189d05..682c6e2fc4f3 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -42,18 +42,16 @@ static const char copyright[] =
static char sccsid[] = "@(#)tunefs.c 8.2 (Berkeley) 4/19/94";
#endif
static const char rcsid[] =
- "$Id: tunefs.c,v 1.6 1998/08/03 06:41:20 charnier Exp $";
+ "$Id$";
#endif /* not lint */
/*
* tunefs: change layout parameters to an existing file system.
*/
#include <sys/param.h>
-#include <sys/mount.h>
#include <sys/stat.h>
#include <ufs/ffs/fs.h>
-#include <ufs/ufs/ufsmount.h>
#include <err.h>
#include <fcntl.h>
@@ -61,7 +59,6 @@ static const char rcsid[] =
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
/* the optimization warning string template */
@@ -81,7 +78,6 @@ int bread(daddr_t, char *, int);
void getsb(struct fs *, char *);
void usage __P((void));
void printfs __P((void));
-char *rawname __P((char *, char *));
int
main(argc, argv)
@@ -91,27 +87,17 @@ main(argc, argv)
char *cp, *special, *name, *action;
struct stat st;
int i;
- int Aflag = 0, active = 0;
+ int Aflag = 0;
struct fstab *fs;
char *chg[2], device[MAXPATHLEN];
- struct ufs_args args;
- struct statfs stfs;
argc--, argv++;
if (argc < 2)
usage();
special = argv[argc - 1];
fs = getfsfile(special);
- if (fs) {
- if (statfs(special, &stfs) == 0) {
- if ((stfs.f_flags & MNT_RDONLY) == 0) {
- errx(1, "cannot work on read-write mounted file system");
- }
- active = 1;
- special = rawname(fs->fs_spec, device);
- } else
- special = fs->fs_spec;
- }
+ if (fs)
+ special = fs->fs_spec;
again:
if (stat(special, &st) < 0) {
if (*special != '/') {
@@ -259,13 +245,6 @@ again:
bwrite(fsbtodb(&sblock, cgsblock(&sblock, i)),
(char *)&sblock, SBSIZE);
close(fi);
- if (active) {
- bzero(&args, sizeof(args));
- if (mount("ufs", fs->fs_file,
- stfs.f_flags | MNT_UPDATE | MNT_RELOAD, &args) < 0)
- err(9, "%s: reload", special);
- warnx("file system reloaded");
- }
exit(0);
}
@@ -348,25 +327,3 @@ bread(bno, buf, cnt)
}
return (0);
}
-
-char *
-rawname(special, pathbuf)
- char *special;
- char *pathbuf;
-{
- char *p;
- int n;
-
- p = strrchr(special, '/');
- if (p) {
- n = ++p - special;
- bcopy(special, pathbuf, n);
- } else {
- strcpy(pathbuf, _PATH_DEV);
- n = strlen(pathbuf);
- p = special;
- }
- pathbuf[n++] = 'r';
- strcpy(pathbuf + n, p);
- return pathbuf;
-}
diff --git a/sbin/vinum/Makefile b/sbin/vinum/Makefile
index 1c3e2edbdd82..7d0a0c285c93 100644
--- a/sbin/vinum/Makefile
+++ b/sbin/vinum/Makefile
@@ -1,15 +1,23 @@
-# $Id: Makefile,v 1.5 1999/01/13 23:05:26 grog Exp $
-
PROG= vinum
-SRCS= v.c list.c vinumparser.c vinumutil.c vext.h commands.c
+SRCS= v.c list.c parser.c util.c vext.h commands.c
MAN8= vinum.8
-CFLAGS+= -I${.CURDIR}/../../sys -g -Wall -DVINUMDEBUG
-DPADD= ${LIBUTIL} ${LIBREADLINE} ${LIBTERMCAP}
-LDADD= -lutil -lreadline -ltermcap
+CFLAGS= -I${.CURDIR}/../../lkm/vinum -g -Wall -DDEBUG -DRAID5
+
+LDADD+= -lutil -lreadline -ltermcap
+# DPADD+= ${LIBKVM}
BINGRP= kmem
-BINMODE= 555
+BINMODE= 2555
+
+parser.c:
+ rm -f $@
+ ln -s ${.CURDIR}/../../lkm/vinum/$@ .
+
+util.c: statetexts.h
+ rm -f $@
+ ln -s ${.CURDIR}/../../lkm/vinum/$@ .
-.PATH: ${.CURDIR}/../../sys/dev/vinum
+statetexts.h:
+ (cd ${.CURDIR}/../../lkm/vinum; make $@)
.include <bsd.prog.mk>
diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c
index 6d6dcacedfc9..6554d3307a85 100644
--- a/sbin/vinum/commands.c
+++ b/sbin/vinum/commands.c
@@ -36,7 +36,7 @@
*
*/
-/* $Id: commands.c,v 1.5 1999/01/18 03:36:32 grog Exp grog $ */
+/* $Id: commands.c,v 1.1 1998/08/19 08:06:57 grog Exp grog $ */
#include <ctype.h>
#include <errno.h>
@@ -51,7 +51,7 @@
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
-#include <dev/vinum/vinumhdr.h>
+#include "vinumhdr.h"
#include "vext.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -122,21 +122,16 @@ vinum_read(int argc, char *argv[], char *arg0[])
int error;
char buffer[BUFSIZE]; /* read config file in here */
struct _ioctl_reply *reply;
- int i;
-
reply = (struct _ioctl_reply *) &buffer;
- if (argc < 1) { /* wrong arg count */
- fprintf(stderr, "Usage: read drive [drive ...]\n");
+
+ if (argc != 1) { /* wrong arg count */
+ fprintf(stderr, "Expecting 1 parameter, not %d\n", argc);
return;
}
strcpy(buffer, "read ");
- for (i = 0; i < argc; i++) { /* each drive name */
- strcat(buffer, argv[i]);
- strcat(buffer, " ");
- }
-
+ strcat(buffer, argv[0]);
if (ioctl(superdev, VINUM_STARTCONFIG, NULL)) { /* can't get config? */
- fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno);
+ printf("Can't configure: %s (%d)\n", strerror(errno), errno);
return;
}
ioctl(superdev, VINUM_CREATE, &buffer);
@@ -217,7 +212,7 @@ vinum_drive(int argc, char *argv[], char *arg0[])
fprintf(stdout, "** %d %s: %s\n", file_line, reply->msg, strerror(reply->error));
}
-#ifdef VINUMDEBUG
+#ifdef DEBUG
void
vinum_debug(int argc, char *argv[], char *arg0[])
{
@@ -254,7 +249,7 @@ vinum_rm(int argc, char *argv[], char *arg0[])
struct vinum_ioctl_msg *message = (struct vinum_ioctl_msg *) &reply;
if (argc == 0) /* start everything */
- fprintf(stderr, "Usage: rm object [object...]\n");
+ fprintf(stderr, "what do you want to remove?\n");
else { /* start specified objects */
int index;
enum objecttype type;
@@ -306,12 +301,10 @@ vinum_resetconfig(int argc, char *argv[], char *arg0[])
printf("\b Vinum configuration obliterated\n");
system("rm -rf " VINUM_DIR "/" "*"); /* remove the old /dev/vinum */
syslog(LOG_NOTICE | LOG_KERN, "configuration obliterated");
- start_daemon(); /* then restart the daemon */
}
}
}
-/* Initialize a plex */
void
vinum_init(int argc, char *argv[], char *arg0[])
{
@@ -348,77 +341,89 @@ vinum_init(int argc, char *argv[], char *arg0[])
return;
}
}
- pid = fork();
- if (pid == 0) { /* we're the child */
- int failed = 0; /* set if a child dies badly */
- int sdfh; /* and for subdisk */
- char zeros[PLEXINITSIZE];
- int count; /* write count */
- long long offset; /* offset in subdisk */
- long long sdsize; /* size of subdisk */
-
- bzero(zeros, sizeof(zeros));
- openlog("vinum", LOG_CONS | LOG_PERROR | LOG_PID, LOG_KERN);
- for (sdno = 0; sdno < plex.subdisks; sdno++) { /* initialize each subdisk */
+ message->index = plexno; /* pass object number */
+ message->type = plex_object; /* and type of object */
+ message->state = object_initializing;
+ message->force = 1; /* insist */
+ ioctl(superdev, VINUM_SETSTATE, message);
+ if (reply.error) {
+ syslog(LOG_ERR | LOG_KERN,
+ "can't initialize %s: %s",
+ plex.name,
+ reply.msg[0] ? reply.msg : strerror(reply.error));
+ } else {
+ pid = fork();
+ if (pid == 0) { /* we're the child */
+ int failed = 0; /* set if a child dies badly */
+ int sdfh; /* and for subdisk */
+ char zeros[PLEXINITSIZE];
+ int count; /* write count */
+ long long offset; /* offset in subdisk */
+ long long sdsize; /* size of subdisk */
+
+ bzero(zeros, sizeof(zeros));
+ openlog("vinum", LOG_CONS | LOG_PERROR | LOG_PID, LOG_KERN);
+ for (sdno = 0; sdno < plex.subdisks; sdno++) { /* initialize each subdisk */
/* We already have the plex data in global
- * plex from the call to find_object */
- pid = fork(); /* into the background with you */
- if (pid == 0) { /* I'm the child */
- get_plex_sd_info(&sd, plexno, sdno);
- sdsize = sd.sectors * DEV_BSIZE; /* size of subdisk in bytes */
- sprintf(filename, VINUM_DIR "/rsd/%s", sd.name);
- setproctitle("initializing %s", filename); /* show what we're doing */
- syslog(LOG_INFO | LOG_KERN, "initializing subdisk %s", filename);
- if ((sdfh = open(filename, O_RDWR, S_IRWXU)) < 0) { /* no go */
- syslog(LOG_ERR | LOG_KERN,
- "can't open subdisk %s: %s",
- filename,
- strerror(errno));
- exit(1);
- }
- for (offset = 0; offset < sdsize; offset += count) {
- count = write(sdfh, zeros, PLEXINITSIZE); /* write a block */
- if (count < 0) {
+ * plex from the call to find_object */
+ pid = fork(); /* into the background with you */
+ if (pid == 0) { /* I'm the child */
+ get_plex_sd_info(&sd, plexno, sdno);
+ sdsize = sd.sectors * DEV_BSIZE; /* size of subdisk in bytes */
+ sprintf(filename, VINUM_DIR "/sd/%s", sd.name);
+ setproctitle("initializing %s", filename); /* show what we're doing */
+ syslog(LOG_INFO | LOG_KERN, "initializing subdisk %s\n", filename);
+ if ((sdfh = open(filename, O_RDWR, S_IRWXU)) < 0) { /* no go */
syslog(LOG_ERR | LOG_KERN,
- "can't write subdisk %s: %s",
+ "can't open subdisk %s: %s\n",
filename,
strerror(errno));
exit(1);
}
+ for (offset = 0; offset < sdsize; offset += count) {
+ count = write(sdfh, zeros, PLEXINITSIZE); /* write a block */
+ if (count < 0) {
+ syslog(LOG_ERR | LOG_KERN,
+ "can't write subdisk %s: %s\n",
+ filename,
+ strerror(errno));
+ exit(1);
+ }
/* XXX Grrrr why doesn't this thing recognize EOF? */
- else if (count == 0)
- break;
+ else if (count == 0)
+ break;
+ }
+ syslog(LOG_INFO | LOG_KERN, "subdisk %s initialized\n", filename);
+ exit(0);
+ } else if (pid < 0) /* failure */
+ printf("couldn't fork for subdisk %d: %s", sdno, strerror(errno));
+ }
+ /* Now wait for them to complete */
+ for (sdno = 0; sdno < plex.subdisks; sdno++) {
+ int status;
+ pid = wait(&status);
+ if (WEXITSTATUS(status) != 0) { /* oh, oh */
+ printf("child %d exited with status 0x%x\n", pid, WEXITSTATUS(status));
+ failed++;
}
- syslog(LOG_INFO | LOG_KERN, "subdisk %s initialized", filename);
- /* Bring the subdisk up */
- message->index = sd.sdno; /* pass object number */
- message->type = sd_object; /* and type of object */
- message->state = object_up;
- message->force = 1; /* insist */
- ioctl(superdev, VINUM_SETSTATE, message);
- exit(0);
- } else if (pid < 0) /* failure */
- printf("couldn't fork for subdisk %d: %s", sdno, strerror(errno));
- }
- /* Now wait for them to complete */
- for (sdno = 0; sdno < plex.subdisks; sdno++) {
- int status;
- pid = wait(&status);
- if (WEXITSTATUS(status) != 0) { /* oh, oh */
- printf("child %d exited with status 0x%x\n", pid, WEXITSTATUS(status));
- failed++;
}
- }
- if (failed == 0) {
- syslog(LOG_INFO | LOG_KERN, "plex %s initialized", plex.name);
+ if (failed == 0) {
+ for (sdno = 0; sdno < plex.subdisks; sdno++) { /* bring the subdisks up */
+ get_plex_sd_info(&sd, plexno, sdno); /* get the SD info again */
+ message->index = sd.sdno; /* pass object number */
+ message->type = sd_object; /* and type of object */
+ message->state = object_up;
+ message->force = 1; /* insist */
+ ioctl(superdev, VINUM_SETSTATE, message);
+ }
+ syslog(LOG_INFO | LOG_KERN, "plex %s initialized\n", plex.name);
+ } else
+ syslog(LOG_ERR | LOG_KERN, "couldn't initialize plex %s, %d processes died\n",
+ plex.name,
+ failed);
+ exit(0);
} else
- syslog(LOG_ERR | LOG_KERN, "couldn't initialize plex %s, %d processes died",
- plex.name,
- failed);
- exit(0);
- } else {
- close(plexfh); /* we don't need this any more */
- sleep(1); /* give them a chance to print */
+ close(plexfh); /* we don't need this any more */
}
}
}
@@ -445,11 +450,59 @@ vinum_start(int argc, char *argv[], char *arg0[])
message->index = object; /* pass object number */
message->type = type; /* and type of object */
message->state = object_up;
- message->force = 0; /* don't force it, use a larger hammer */
+ /* XXX Kludge until we get the kernelland
+ * config stuff rewritten:
+ * Take all subdisks down, then up. */
+ if (message->type == plex_object) { /* it's a plex */
+ struct plex plex;
+ struct sd sd;
+ int sdno;
+ struct _ioctl_reply sreply;
+ struct vinum_ioctl_msg *smessage = (struct vinum_ioctl_msg *) &sreply;
+
+ get_plex_info(&plex, message->index);
+ if (plex.state != plex_up) {
+ /* And when they were down, they were down */
+ for (sdno = 0; sdno < plex.subdisks; sdno++) {
+ get_plex_sd_info(&sd, plex.plexno, sdno);
+ smessage->type = sd_object;
+ smessage->state = object_down;
+ smessage->force = 1;
+ smessage->index = sd.sdno;
+ ioctl(superdev, VINUM_SETSTATE, smessage);
+ if (sreply.error != 0) {
+ fprintf(stderr,
+ "Can't stop %s: %s (%d)\n",
+ sd.name,
+ sreply.msg[0] ? sreply.msg : strerror(sreply.error),
+ sreply.error);
+ }
+ }
+
+ /* And when they were up, they were up */
+ for (sdno = 0; sdno < plex.subdisks; sdno++) {
+ get_plex_sd_info(&sd, plex.plexno, sdno);
+ smessage->type = sd_object;
+ smessage->state = object_up;
+ smessage->force = 1;
+ smessage->index = sd.sdno;
+ ioctl(superdev, VINUM_SETSTATE, smessage);
+ if (sreply.error != 0) {
+ fprintf(stderr,
+ "Can't stop %s: %s (%d)\n",
+ sd.name,
+ sreply.msg[0] ? sreply.msg : strerror(sreply.error),
+ sreply.error);
+ }
+ }
+ }
+ }
+ /* XXX End kludge until we get the kernelland
+ * config stuff rewritten */
ioctl(superdev, VINUM_SETSTATE, message);
if (reply.error != 0) {
if ((reply.error == EAGAIN) /* we're reviving */
- &&(type == sd_object))
+ &&(type == plex_object))
continue_revive(object);
else
fprintf(stderr,
@@ -674,7 +727,7 @@ vinum_attach(int argc, char *argv[], char *argv0[])
struct _ioctl_reply *reply = (struct _ioctl_reply *) &msg;
const char *objname = argv[0];
const char *supername = argv[1];
- int sdno = -1;
+ int sdno;
int plexno = -1;
char newname[MAXNAME + 8];
int rename = 0; /* set if we want to rename the object */
@@ -718,7 +771,6 @@ vinum_attach(int argc, char *argv[], char *argv0[])
fprintf(stderr, "Can't attach subdisks to a %s plex\n", plex_org(plex.organization));
return;
}
- sdno = msg.index; /* note the subdisk number for later */
break;
case plex_object:
@@ -726,6 +778,7 @@ vinum_attach(int argc, char *argv[], char *argv0[])
fprintf(stderr, "%s can only be attached to a volume\n", objname);
return;
}
+ plexno = msg.index; /* note the plex number, we'll need it again */
break;
case volume_object:
@@ -741,7 +794,7 @@ vinum_attach(int argc, char *argv[], char *argv0[])
ioctl(superdev, VINUM_ATTACH, &msg);
if (reply->error != 0) {
if (reply->error == EAGAIN) /* reviving */
- continue_revive(sdno); /* continue the revive */
+ continue_revive(plexno); /* continue the revive */
else
fprintf(stderr,
"Can't attach %s to %s: %s (%d)\n",
@@ -975,92 +1028,3 @@ vinum_replace(int argc, char *argv[], char *argv0[])
{
fprintf(stderr, "replace function not implemented yet\n");
}
-
-/* Primitive help function */
-void
-vinum_help(int argc, char *argv[], char *argv0[])
-{
- char commands[] =
- {
- "COMMANDS\n"
- " create description-file\n"
- " Create a volume as described in description-file\n"
- " attach plex volume [rename]\n"
- " attach subdisk plex [offset] [rename]\n"
- " Attach a plex to a volume, or a subdisk to a plex.\n"
- " debug\n"
- " Cause the volume manager to enter the kernel debugger.\n"
- " detach [plex | subdisk]\n"
- " Detach a plex or subdisk from the volume or plex to which it is at-\n"
- " tached.\n"
- " info [-v]\n"
- " List information about volume manager state.\n"
- " init [-v]\n"
- " Initialize a plex by writing zeroes to all its subdisks.\n"
- " label volume\n"
- " Create a volume label\n"
- " list [-r] [-s] [-v] [-V] [volume | plex | subdisk]\n"
- " List information about specified objects\n"
- " l [-r] [-s] [-v] [-V] [volume | plex | subdisk]\n"
- " List information about specified objects (alternative to\n"
- " list command)\n"
- " ld [-r] [-s] [-v] [-V] [volume]\n"
- " List information about drives\n"
- " ls [-r] [-s] [-v] [-V] [subdisk]\n"
- " List information about subdisks\n"
- " lp [-r] [-s] [-v] [-V] [plex]\n"
- " List information about plexes\n"
- " lv [-r] [-s] [-v] [-V] [volume]\n"
- " List information about volumes\n"
- " makedev\n"
- " Remake the device nodes in /dev/vinum.\n"
- " read disk-partition\n"
- " Read the vinum configuration from the specified disk partition.\n"
- " rename [-r] [drive | subdisk | plex | volume] newname\n"
- " Change the name of the specified object.\n"
- " replace [subdisk | plex] newobject\n"
- " Replace the object with an identical other object. XXX not im-\n"
- " plemented yet.\n"
- " resetconfig\n"
- " Reset the complete vinum configuration.\n"
- " resetstats [-r] [volume | plex | subdisk]\n"
- " Reset statistisc counters for the specified objects, or for all\n"
- " objects if none are specified.\n"
- " rm [-f] [-r] volume | plex | subdisk\n"
- " Remove an object\n"
- " setdaemon options\n"
- " set the daemon options\n"
- " start [volume | plex | subdisk]\n"
- " Allow the system to access the objects\n"
- " stop [-f] [volume | plex | subdisk]\n"
- " Terminate access the objects\n"
- };
- puts(commands);
-}
-
-/* Set daemon options.
- * XXX quick and dirty: use a bitmap, which requires
- * knowing which bit does what. FIXME */
-void
-vinum_setdaemon(int argc, char *argv[], char *argv0[])
-{
- int options;
-
- switch (argc) {
- case 0:
- if (ioctl(superdev, VINUM_GETDAEMON, &options) < 0)
- fprintf(stderr, "Can't set daemon options: %s (%d)\n", strerror(errno), errno);
- else
- printf("Options mask: %d\n", options);
- break;
-
- case 1:
- options = atoi(argv[0]);
- if (ioctl(superdev, VINUM_SETDAEMON, &options) < 0)
- fprintf(stderr, "Can't set daemon options: %s (%d)\n", strerror(errno), errno);
- break;
-
- default:
- fprintf(stderr, "Usage: \tsetdaemon [<bitmask>]\n");
- }
-}
diff --git a/sbin/vinum/list.c b/sbin/vinum/list.c
index 94f117cfbf60..40807480fff7 100644
--- a/sbin/vinum/list.c
+++ b/sbin/vinum/list.c
@@ -35,7 +35,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: list.c,v 1.17 1999/01/17 02:58:44 grog Exp grog $
+ * $Id: list.c,v 1.12 1998/08/10 05:15:06 grog Exp grog $
*/
#include <ctype.h>
@@ -50,9 +50,9 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
-#include <dev/vinum/vinumhdr.h>
+#include "vinumhdr.h"
#include "vext.h"
-#include <dev/vinum/request.h>
+
/* Take a size in sectors and return a pointer to a
* string which represents the size best.
* If lj is != 0, return left justified, otherwise
@@ -124,21 +124,17 @@ vinum_li(int object, enum objecttype type)
void
vinum_ldi(int driveno, int recurse)
{
- time_t t; /* because Bruce says so */
-
get_drive_info(&drive, driveno);
if (drive.state != drive_unallocated) {
if (verbose) {
printf("Drive %s:\tDevice %s\n",
drive.label.name,
drive.devicename);
- t = drive.label.date_of_birth.tv_sec;
printf("\t\tCreated on %s at %s",
drive.label.sysname,
- ctime(&t));
- t = drive.label.last_update.tv_sec;
+ ctime(&drive.label.date_of_birth.tv_sec));
printf("\t\tConfig last updated %s", /* care: \n at end */
- ctime(&t));
+ ctime(&drive.label.last_update.tv_sec));
printf("\t\tSize: %16qd bytes (%qd MB)\n\t\tUsed: %16qd bytes (%qd MB)\n"
"\t\tAvailable: %11qd bytes (%d MB)\n",
drive.label.drive_size, /* bytes used */
@@ -350,6 +346,55 @@ vinum_lpi(int plexno, int recurse)
get_volume_info(&vol, plex.volno);
printf("\t\tPart of volume %s\n", vol.name);
}
+ if (plex.state == plex_reviving) {
+ printf("\t\tRevive pointer:\t\t%s\n",
+ roughlength(plex.revived << DEV_BSHIFT, 0));
+ printf("\t\tRevive blocksize:\t%s\n"
+ "\t\tRevive interval:\t%10d seconds\n",
+ roughlength(plex.revive_blocksize << DEV_BSHIFT, 0),
+ plex.revive_interval);
+ }
+ if (Verbose) { /* show the unmapped and defective parts */
+ int re; /* freelist entry */
+ struct plexregion region;
+ struct rerq { /* request to pass to ioctl */
+ int plexno; /* plex for the request */
+ int re; /* region */
+ } *rerq = (struct rerq *) &region;
+
+ if (plex.unmapped_regions) {
+ printf("\t\tPlex contains %d unmapped regions:\n\t\t Offset\t Size\n",
+ plex.unmapped_regions);
+ for (re = 0; re < plex.unmapped_regions; re++) {
+ rerq->plexno = plex.plexno;
+ rerq->re = re;
+ if (ioctl(superdev, VINUM_GETUNMAPPED, &region) < 0) {
+ fprintf(stderr,
+ "Can't get unmapped region %d: %s\n",
+ re,
+ strerror(errno));
+ longjmp(command_fail, -1);
+ }
+ printf("\t\t%9qd\t%9qd\n", region.offset, region.length);
+ }
+ }
+ if (plex.defective_regions) {
+ printf("\t\tPlex contains %d defective regions:\n\t\t Offset\t Size\n",
+ plex.defective_regions);
+ for (re = 0; re < plex.defective_regions; re++) {
+ rerq->plexno = plex.plexno;
+ rerq->re = re;
+ if (ioctl(superdev, VINUM_GETDEFECTIVE, &region) < 0) {
+ fprintf(stderr,
+ "Can't get defective region %d: %s\n",
+ re,
+ strerror(errno));
+ longjmp(command_fail, -1);
+ }
+ printf("\t\t%9qd\t%9qd\n", region.offset, region.length);
+ }
+ }
+ }
} else {
char *org = ""; /* organization */
@@ -388,15 +433,12 @@ vinum_lpi(int plexno, int recurse)
if (plex.writes != 0)
printf("\t\tAverage write:\t%16qd bytes\n",
plex.bytes_written / plex.writes);
- if (((plex.reads + plex.writes) > 0)
- && ((plex.organization == plex_striped)
- || (plex.organization == plex_raid5)))
- printf("\t\tMultiblock:\t%16qd (%d%%)\n"
- "\t\tMultistripe:\t%16qd (%d%%)\n",
+ if ((plex.organization == plex_striped)
+ || (plex.organization == plex_raid5))
+ printf("\t\tMultiblock:\t%16qd\n"
+ "\t\tMultistripe:\t%16qd\n",
plex.multiblock,
- (int) (plex.multiblock * 100 / (plex.reads + plex.writes)),
- plex.multistripe,
- (int) (plex.multistripe * 100 / (plex.reads + plex.writes)));
+ plex.multistripe);
}
if (plex.subdisks > 0) {
int sdno;
@@ -465,16 +507,10 @@ vinum_lsi(int sdno, int recurse)
if (sd.plexno >= 0) {
get_plex_info(&plex, sd.plexno);
printf("\t\tPlex %s", plex.name);
- printf(" at offset %qd\n", (long long) sd.plexoffset * DEV_BSIZE);
- }
- if (sd.state == sd_reviving) {
- printf("\t\tRevive pointer:\t\t%s (%d%%)\n",
- roughlength(sd.revived << DEV_BSHIFT, 0),
- (int) (((u_int64_t) (sd.revived * 100)) / sd.sectors));
- printf("\t\tRevive blocksize:\t%s\n"
- "\t\tRevive interval:\t%10d seconds\n",
- roughlength(sd.revive_blocksize, 0),
- sd.revive_interval);
+ if (plex.organization == plex_concat)
+ printf(" at offset %qd\n", (long long) sd.plexoffset * DEV_BSIZE);
+ else
+ printf("\n");
}
} else {
printf("S %-21s State: %s\tPO: %s ",
@@ -569,29 +605,12 @@ listconfig()
vinum_ls(0, NULL, NULL);
}
-/* Convert a timeval to Tue Oct 13 13:54:14.0434324
- * Return pointer to text */
-char *
-timetext(struct timeval *time)
-{
- static char text[30];
- time_t t; /* to keep Bruce happy */
-
- t = time->tv_sec;
- strcpy(text, ctime(&t)); /* to the second */
- sprintf(&text[19], ".%06ld", time->tv_usec); /* and the microseconds */
- return &text[11];
-}
-
void
vinum_info(int argc, char *argv[], char *argv0[])
{
struct meminfo meminfo;
struct mc malloced;
int i;
-#if VINUMDEBUG
- struct rqinfo rq;
-#endif
if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) {
perror("Can't get vinum config");
@@ -608,7 +627,7 @@ vinum_info(int argc, char *argv[], char *argv0[])
meminfo.highwater,
(int) meminfo.malloced);
- if (verbose && (!Verbose))
+ if (Verbose)
for (i = 0; i < meminfo.mallocs; i++) {
malloced.seq = i;
if (ioctl(superdev, VINUM_MALLOCINFO, &malloced) < 0) {
@@ -625,97 +644,6 @@ vinum_info(int argc, char *argv[], char *argv0[])
malloced.line,
(char *) &malloced.file);
}
-#if VINUMDEBUG
- if (Verbose) {
- printf("\nTime\t\t Event\t Buf\tDev\tOffset\t\tBytes\tSD\tSDoff\tDoffset\tGoffset\n\n");
- for (i = RQINFO_SIZE - 1; i >= 0; i--) { /* go through the request list in order */
- *((int *) &rq) = i;
- if (ioctl(superdev, VINUM_RQINFO, &rq) < 0) {
- perror("Can't get information");
- return;
- }
- switch (rq.type) {
- case loginfo_unused: /* never been used */
- break;
-
- case loginfo_user_bp: /* this is the bp when strategy is called */
- printf("%s 1VS %s %p\t0x%x\t0x%-9x\t%ld\n",
- timetext(&rq.timestamp),
- rq.info.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.b.b_dev,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount);
- break;
-
- case loginfo_user_bpl: /* and this is the bp at launch time */
- printf("%s 2LR %s %p\t0x%x\t0x%-9x\t%ld\n",
- timetext(&rq.timestamp),
- rq.info.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.b.b_dev,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount);
- break;
-
- case loginfo_rqe: /* user RQE */
- printf("%s 3RQ %s %p\t0x%x\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.rqe.b.b_dev,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
-
- case loginfo_iodone: /* iodone called */
- printf("%s 4DN %s %p\t0x%x\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.rqe.b.b_dev,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
-
- case loginfo_raid5_data: /* RAID-5 write data block */
- printf("%s 5RD %s %p\t0x%x\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.rqe.b.b_dev,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
-
- case loginfo_raid5_parity: /* RAID-5 write parity block */
- printf("%s 6RP %s %p\t0x%x\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_flags & B_READ ? "Read " : "Write",
- rq.bp,
- rq.info.rqe.b.b_dev,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- }
- }
- }
-#endif
}
/* Print config file to a file. This is a userland version
@@ -781,7 +709,7 @@ vinum_printconfig(int argc, char *argv[], char *argv0[])
plex_state(plex.state),
plex_org(plex.organization));
if ((plex.organization == plex_striped)
- || (plex.organization == plex_raid5)) {
+ ) {
fprintf(of, "%db ", (int) plex.stripesize);
}
if (plex.volno >= 0) { /* we have a volume */
diff --git a/sbin/vinum/v.c b/sbin/vinum/v.c
index d9a11f24f90d..8ae420d784da 100644
--- a/sbin/vinum/v.c
+++ b/sbin/vinum/v.c
@@ -36,7 +36,7 @@
*
*/
-/* $Id: v.c,v 1.24 1999/01/17 02:53:38 grog Exp grog $ */
+/* $Id: v.c,v 1.22 1998/08/11 07:44:54 grog Exp grog $ */
#include <ctype.h>
#include <errno.h>
@@ -51,15 +51,12 @@
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
-#include <dev/vinum/vinumhdr.h>
+#include "vinumhdr.h"
#include "vext.h"
#include <sys/types.h>
#include <sys/wait.h>
#include <readline/history.h>
#include <readline/readline.h>
-#include <sys/linker.h>
-#include <sys/module.h>
-#include <sys/resource.h>
FILE *cf; /* config file handle */
@@ -71,7 +68,7 @@ int inerror; /* set to 1 to exit after end of config file */
/* flags */
-#if VINUMDEBUG
+#if DEBUG
int debug = 0; /* debug flag, usage varies */
#endif
int force = 0; /* set to 1 to force some dangerous ops */
@@ -91,8 +88,6 @@ struct drive drive;
jmp_buf command_fail; /* return on a failed command */
int superdev; /* vinum super device */
-void start_daemon(void);
-
#define ofs(x) ((void *) (& ((struct confdata *) 0)->x)) /* offset of x in struct confdata */
/* create description-file
@@ -117,20 +112,6 @@ int tokens; /* number of tokens */
int
main(int argc, char *argv[])
{
-#if RAID5
-#define VINUMMOD "Vinum"
-#else
-#define VINUMMOD "vinum"
-#endif
-
- if (modfind(VINUMMOD) < 0) {
- /* need to load the vinum module */
- if (kldload(VINUMMOD) < 0 || modfind(VINUMMOD) < 0) {
- perror("vinum kernel module not available");
- return 1;
- }
- }
-
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open it */
if (superdev < 0) { /* no go */
@@ -141,10 +122,6 @@ main(int argc, char *argv[])
return 1;
}
}
- /* Check if the dæmon is running. If not, start it in the
- * background */
- start_daemon();
-
if (argc > 1) { /* we have a command on the line */
if (setjmp(command_fail) != 0) /* long jumped out */
return -1;
@@ -179,13 +156,6 @@ main(int argc, char *argv[])
return 0; /* normal completion */
}
-/* stop the hard way */
-void
-vinum_quit(int argc, char *argv[], char *argv0[])
-{
- exit(0);
-}
-
#define FUNKEY(x) { kw_##x, &vinum_##x } /* create pair "kw_foo", vinum_foo */
struct funkey {
@@ -195,7 +165,7 @@ struct funkey {
FUNKEY(create),
FUNKEY(read),
-#ifdef VINUMDEBUG
+#ifdef DEBUG
FUNKEY(debug),
#endif
FUNKEY(volume),
@@ -221,10 +191,6 @@ struct funkey {
FUNKEY(printconfig),
FUNKEY(start),
FUNKEY(stop),
- FUNKEY(makedev),
- FUNKEY(help),
- FUNKEY(quit),
- FUNKEY(setdaemon),
FUNKEY(resetstats)
};
@@ -253,7 +219,7 @@ parseline(int args, char *argv[])
for (i = 1; (i < args) && (argv[i][0] == '-'); i++) { /* while we have flags */
for (j = 1; j < strlen(argv[i]); j++)
switch (argv[i][j]) {
-#if VINUMDEBUG
+#if DEBUG
case 'd': /* -d: debug */
debug = 1;
break;
@@ -382,7 +348,6 @@ make_devices(void)
system("mkdir -p " VINUM_DIR "/drive " /* and make them again */
VINUM_DIR "/plex "
VINUM_DIR "/sd "
- VINUM_DIR "/rsd "
VINUM_DIR "/vol "
VINUM_DIR "/rvol "
VINUM_RDIR);
@@ -475,16 +440,10 @@ make_devices(void)
if (mknod(filename, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IFBLK, sddev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- /* /dev/vinum/sd/<sd> */
+ /* And /dev/vinum/sd/<sd> */
sprintf(filename, VINUM_DIR "/sd/%s", sd.name);
if (mknod(filename, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IFBLK, sddev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
-
- /* And /dev/vinum/rsd/<sd> */
- sprintf(filename, VINUM_DIR "/rsd/%s", sd.name);
- sddev = VINUMCDEV(volno, plexno, sdno, VINUM_SD_TYPE);
- if (mknod(filename, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IFCHR, sddev) < 0)
- fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
}
}
}
@@ -502,13 +461,6 @@ make_devices(void)
}
}
-/* command line interface for the 'makedev' command */
-void
-vinum_makedev(int argc, char *argv[], char *arg0[])
-{
- make_devices();
-}
-
/* Find the object "name". Return object type at type,
* and the index as the return value.
* If not found, return -1 and invalid_object.
@@ -564,80 +516,46 @@ find_object(const char *name, enum objecttype *type)
return -1;
}
-/* Continue reviving a subdisk in the background */
+/* Continue reviving a plex in the background */
void
-continue_revive(int sdno)
+continue_revive(int plexno)
{
- struct sd sd;
+ struct plex plex;
pid_t pid;
- get_sd_info(&sd, sdno);
+ get_plex_info(&plex, plexno);
-#if VINUMDEBUG
+#if DEBUG
if (debug)
pid = 0; /* wander through into the "child" process */
else
pid = fork(); /* do this in the background */
-#else
- pid = fork(); /* do this in the background */
#endif
if (pid == 0) { /* we're the child */
struct _ioctl_reply reply;
struct vinum_ioctl_msg *message = (struct vinum_ioctl_msg *) &reply;
openlog("vinum", LOG_CONS | LOG_PERROR | LOG_PID, LOG_KERN);
- syslog(LOG_INFO | LOG_KERN, "reviving %s", sd.name);
+ syslog(LOG_INFO | LOG_KERN, "reviving plex %s", plex.name);
for (reply.error = EAGAIN; reply.error == EAGAIN;) {
- message->index = sdno; /* pass sd number */
- message->type = sd_object; /* and type of object */
+ message->index = plexno; /* pass plex number */
+ message->type = plex_object; /* and type of object */
message->state = object_up;
ioctl(superdev, VINUM_SETSTATE, message);
}
if (reply.error) {
syslog(LOG_ERR | LOG_KERN,
- "can't revive %s: %s",
- sd.name,
+ "can't revive plex %s: %s",
+ plex.name,
reply.msg[0] ? reply.msg : strerror(reply.error));
exit(1);
} else {
- get_sd_info(&sd, sdno); /* update the info */
- syslog(LOG_INFO | LOG_KERN, "%s is %s", sd.name, sd_state(sd.state));
+ get_plex_info(&plex, plexno); /* update the info */
+ syslog(LOG_INFO | LOG_KERN, "plex %s is %s", plex.name, plex_state(plex.state));
exit(0);
}
} else if (pid < 0) /* couldn't fork? */
- fprintf(stderr, "Can't continue reviving %s: %s\n", sd.name, strerror(errno));
+ fprintf(stderr, "Can't continue reviving %s: %s\n", plex.name, strerror(errno));
else
- printf("Reviving %s in the background\n", sd.name);
-}
-
-/* Check if the daemon is running,
- * start it if it isn't. The check itself
- * could take a while, so we do it as a separate
- * process, which will become the daemon if one isn't
- * running already */
-void
-start_daemon(void)
-{
- int pid;
- int status;
- int error;
-
- pid = (int) fork();
-
- if (pid == 0) { /* We're the child, do the work */
- error = daemon(0, 0); /* this will fork again, but who's counting? */
- if (error != 0) {
- fprintf(stderr, "Can't start daemon: %s (%d)\n", strerror(errno), errno);
- exit(1);
- }
- setproctitle("Vinum daemon"); /* show what we're doing */
- status = ioctl(superdev, VINUM_FINDDAEMON, NULL);
- if (status != 0) { /* no daemon, */
- ioctl(superdev, VINUM_DAEMON, &verbose); /* we should hang here */
- syslog(LOG_ERR | LOG_KERN, "%s", strerror(errno));
- exit(1);
- }
- exit(0); /* when told to die */
- } else if (pid < 0) /* couldn't fork */
- printf("Can't fork to check daemon\n");
+ printf("Reviving %s in the background\n", plex.name);
}
diff --git a/sbin/vinum/vext.h b/sbin/vinum/vext.h
index a446f8466900..5b1678f6c920 100644
--- a/sbin/vinum/vext.h
+++ b/sbin/vinum/vext.h
@@ -1,9 +1,6 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
+/*
+ * Copyright (c) 1997 Nan Yang Computer Services Limited
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -15,30 +12,28 @@
* 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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 includes software developed for the NetBSD Project
+ * by Jason R. Thorpe.
+ * 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.
*/
-/* $Id: vext.h,v 1.10 1999/01/12 04:31:45 grog Exp grog $ */
+/* $Id: vext.h,v 1.9 1998/08/11 03:06:02 grog Exp grog $ */
#define MAXARGS 64 /* maximum number of args on a line */
-#define PLEXINITSIZE 61440 /* this is what the system does somewhere */
+#define PLEXINITSIZE MAXPHYS /* block size to write when initializing */
enum {
KILOBYTE = 1024,
@@ -66,10 +61,6 @@ void vinum_resetconfig(int argc, char *argv[], char *arg0[]);
void vinum_start(int argc, char *argv[], char *arg0[]);
void continue_revive(int plexno);
void vinum_stop(int argc, char *argv[], char *arg0[]);
-void vinum_makedev(int argc, char *argv[], char *arg0[]);
-void vinum_help(int argc, char *argv[], char *arg0[]);
-void vinum_quit(int argc, char *argv[], char *arg0[]);
-void vinum_setdaemon(int argc, char *argv[], char *arg0[]);
void reset_volume_stats(int volno, int recurse);
void reset_plex_stats(int plexno, int recurse);
void reset_sd_stats(int sdno, int recurse);
@@ -86,8 +77,7 @@ void vinum_ld(int argc, char *argv[], char *arg0[]);
void vinum_ls(int argc, char *argv[], char *arg0[]);
void vinum_lp(int argc, char *argv[], char *arg0[]);
void vinum_lv(int argc, char *argv[], char *arg0[]);
-void start_daemon(void);
-#ifdef VINUMDEBUG
+#ifdef DEBUG
void vinum_debug(int argc, char *argv[], char *arg0[]);
#endif
void make_devices(void);
diff --git a/sbin/vinum/vinum.8 b/sbin/vinum/vinum.8
index d2dfdb6abcb0..8f6c65542295 100644
--- a/sbin/vinum/vinum.8
+++ b/sbin/vinum/vinum.8
@@ -1,6 +1,6 @@
.\" Hey, Emacs, edit this file in -*- nroff-fill -*- mode
.\"
-.Dd 15 January 1999
+.Dd 11 July 1998
.Dt vinum 8
.Os FreeBSD
.Sh NAME
@@ -30,14 +30,9 @@ Attach a plex to a volume, or a subdisk to a plex.
.in +1i
Cause the volume manager to enter the kernel debugger.
.in
-.Cd debug
-.Ar flags
-.in +1i
-Set debugging flags.
-.in
.Cd detach
.Op Ar plex | subdisk
-.in +1i
+.in +1
Detach a plex or subdisk from the volume or plex to which it is attached.
.in
.Cd info
@@ -51,12 +46,7 @@ List information about volume manager state.
.\" XXX
Initialize a plex by writing zeroes to all its subdisks.
.in
-.Cd label
-.Ar volume
-.in +1i
-Create a volume label
-.in
-.Cd list
+.Cd l
.Op Fl r
.Op Fl s
.Op Fl v
@@ -65,16 +55,14 @@ Create a volume label
.in +1i
List information about specified objects
.in
-.Cd l
+.Cd list
.Op Fl r
.Op Fl s
.Op Fl v
.Op Fl V
.Op volume | plex | subdisk
.in +1i
-List information about specified objects (alternative to
-.Cd list
-command)
+List information about specified objects
.in
.Cd ld
.Op Fl r
@@ -112,41 +100,29 @@ List information about plexes
.in +1i
List information about volumes
.in
-.Cd makedev
-.in +1i
-Remake the device nodes in
-.Ar /dev/vinum .
-.in
-.Cd quit
+.Cd label
+.Ar volume
.in +1i
-Exit the
-.Nm
-program when running in interactive mode. Normally this would be done by
-entering the
-.Ar EOF
-character.
+Create a volume label
.in
.Cd read
-.Ar disk Op disk...
+.Ar disk-partition
.in +1i
Read the
.Nm
-configuration from the specified disks.
+configuration from the specified disk partition.
.in
.Cd rename Op Fl r
.Ar [ drive | subdisk | plex | volume ]
.Ar newname
.in +1i
Change the name of the specified object.
-.ig
-XXX
.in
.Cd replace
.Ar [ subdisk | plex ]
.Ar newobject
.in +1i
Replace the object with an identical other object. XXX not implemented yet.
-..
.in
.Cd resetconfig
.in +1i
@@ -178,11 +154,6 @@ XXX
Set the state of the object to \fIstate\fP\|
.in
..
-.Cd setdaemon
-.Op value
-.in +1i
-Set dæmon configuration.
-.in
.Cd start
.Op volume | plex | subdisk
.in +1i
@@ -203,10 +174,7 @@ for more information about the volume manager.
.Xr vinum 8
is designed either for interactive use, when started without a command, or to
execute a single command if the command is supplied as arguments to
-.Nm vinum .
-In interactive mode,
-.Nm
-maintains a command line history.
+.Nm vinum.
.Ss OPTIONS
.Nm
commands may optionally be followed by an option. Any of the following options
@@ -267,8 +235,7 @@ commands perform the following functions:
.Bl -hang
.It Nm attach Ar plex Ar volume
.Op Nm rename
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1v
.It Nm attach Ar subdisk Ar plex Ar [offset]
.Op Nm rename
.sp
@@ -289,25 +256,6 @@ renames the object (and in the case of a plex, any subordinate subdisks) to fit
in with the default
.Nm
naming convention.
-.Pp
-A number of considerations apply to attaching subdisks:
-.Bl -bullet
-.It
-Subdisks can normally only be attached to concatenated plexes.
-.It
-If a striped or RAID-5 plex is missing a subdisk (for example after drive
-failure), it may be replaced by a subdisk of the same size only. No other
-attachment of subdisks is currently allowed.
-.It
-For concatenated plexes, the
-.Ar offset
-parameter specifies the offset in blocks from the beginning of the plex. For
-striped and RAID-5 plexes, it specifies the offset of the first block of the
-subdisk: in other words, the offset is the numerical position of the subdisk
-multiplied by the stripe size. For example, in a plex of block size 256k, the
-first subdisk will have offset 0, the second offset 256k, the third 512k, etc.
-This calculation ignores parity blocks in RAID-5 plexes.
-.El
.It Nm create Ar description-file
.sp
.Nm
@@ -323,49 +271,13 @@ CONFIGURATION FILE below for more information.
.Ar debug
is used to enter the remote kernel debugger. It is only activated if
.Nm
-is built with the
-.Ar VINUMDEBUG
-option. This option will stop the execution of the operating system until the
-kernel debugger is exited. If remote debugging is set and there is no remote
+is built with the DEBUG option. This option will stop the execution of the
+operating system until the kernel debugger is exited. If there is no remote
connection for a kernel debugger, it will be necessary to reset the system and
reboot in order to leave the debugger.
-.It Nm debug
-.Ar flags
-.Pp
-Set a bit mask of internal debugging flags. These will change without warning
-as the product matures; to be certain, read the header file
-.Pa sys/dev/vinumvar.h .
-The bit mask is composed of the following values:
-.Bl -hang
-.It DEBUG_ADDRESSES (1)
-.br
-Show buffer information during requests
-.It DEBUG_NUMOUTPUT (2)
-.br
-Show the value of
-.Dv vp->v_numoutput.
-.It DEBUG_RESID (4)
-.br
-Go into debugger in
-.Fd complete_rqe.
-.It DEBUG_LASTREQS (8)
-.br
-Keep a circular buffer of last requests.
-.It DEBUG_REVIVECONFLICT (16)
-.br
-Print info about revive conflicts.
-.It DEBUG_REMOTEGDB (256)
-.br
-Go into remote
-.Ic gdb
-when the
-.Nm debug
-command is issued.
-.El
.It Nm detach Op Fl f
.Ar plex
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1v
.It Nm detach Op Fl f
.Ar subdisk
.sp
@@ -379,14 +291,8 @@ option is specified. If the object is named after the object above it (for
example, subdisk vol1.p7.s0 attached to plex vol1.p7), the name will be changed
by prepending the text ``ex-'' (for example, ex-vol1.p7.s0). If necessary, the
name will be truncated in the process.
-.Pp
-.Nm detach
-does not reduce the number of subdisks in a striped or RAID-5 plex. Instead,
-the subdisk is marked absent, and can later be replaced with the
-.Nm attach
-command.
.It Nm info
-.br
+.Pp
.Nm
.Ar info
displays information about
@@ -394,117 +300,6 @@ displays information about
memory usage. This is intended primarily for debugging. With the
.Fl v
option, it will give detailed information about the memory areas in use.
-.Pp
-With the
-.Fl V
-option,
-.Ar info
-displays information about the last up to 64 I/O requests handled by the
-.Nm
-driver. This information is only collected if debug flag 8 is set. The format
-looks like:
-.Pp
-.Bd -literal
-vinum -> info -V
-Flags: 0x200 1 opens
-Total of 38 blocks malloced, total memory: 16460
-Maximum allocs: 56, malloc table at 0xf0f72dbc
-
-Time Event Buf Dev Offset Bytes SD SDoff Doffset Goffset
-
-14:40:00.637758 1VS Write 0xf2361f40 0x5b03 0x10 16384
-14:40:00.639280 2LR Write 0xf2361f40 0x5b03 0x10 16384
-14:40:00.639294 3RQ Read 0xf2361f40 0x427 0x104109 8192 19 0 0 0
-14:40:00.639455 3RQ Read 0xf2361f40 0x417 0xd2109 8192 17 0 0 0
-14:40:00.639529 3RQ Read 0xf2361f40 0x40f 0x6e109 8192 16 0 0 0
-14:40:00.652978 4DN Read 0xf2361f40 0x427 0x104109 8192 19 0 0 0
-14:40:00.667040 4DN Read 0xf2361f40 0x40f 0x6e109 8192 16 0 0 0
-14:40:00.668556 4DN Read 0xf2361f40 0x417 0xd2109 8192 17 0 0 0
-14:40:00.669777 6RP Write 0xf2361f40 0x427 0x104109 8192 19 0 0 0
-14:40:00.685547 4DN Write 0xf2361f40 0x427 0x104109 8192 19 0 0 0
-.Ed
-.Pp
-The
-.Ar Buf
-field always contains the address of the user buffer header. This can be used
-to identify the requests associated with a user request, though this is not 100%
-reliable: theoretically two requests in sequence could use the same buffer
-header, though this is not common. The beginning of a request can be identified
-by the event
-.Ar 1VS .
-The example above shows the requests involved in a single user request.
-.Pp
-The
-.Ar Event
-field contains information related to the sequence of events in the request
-chain. The digit
-.Ar 1
-to
-.Ar 6
-indicates the approximate sequence of events, and the two-letter abbreviation is
-a mnemonic for the location
-.Bl -hang
-.It 1VS
-(vinumstrategy) shows information about the user request on entry to
-.Fd vinumstrategy .
-The device number is the
-.Nm
-device, and offset and length are the user parameters. This is always the
-beginning of a request sequence.
-.It 2LR
-(launch_requests) shows the user request just prior to launching the low-level
-.Nm
-requests in the function
-.Fd launch_requests.
-The parameters should be the same as in the
-.Ar 1VS
-information.
-.Pp
-In the following requests,
-.Ar Dev
-is the device number of the associated disk partition,
-.Ar Offset
-is the offset from the beginning of the partition,
-.Ar SD
-is the subdisk index in
-.Dv vinum_conf ,
-.Ar SDoff
-is the offset from the beginning of the subdisk,
-.Ar Doffset
-is the offset of the associated data request, and
-.Ar Goffset
-is the offset of the associated group request, where applicable.
-.It 3RQ
-(request) shows one of possibly several low-level
-.Nm
-requests which are launched to satisfy the high-level request. This information
-is also logged in
-.Fd launch_requests.
-.It 4DN
-(done) is called from
-.Fd complete_rqe,
-showing the completion of a request. This completion should match a request
-launched either at stage
-.Ar 4DN
-from
-.Fd launch_requests,
-or from
-.Fd complete_raid5_write
-at stage
-.Ar 5RD
-or
-.Ar 6RP .
-.It 5RD
-(RAID-5 data) is called from
-.Fd complete_raid5_write
-and represents the data written to a RAID-5 data stripe after calculating
-parity.
-.It 6RP
-(RAID-5 parity) is called from
-.Fd complete_raid5_write
-and represents the data written to a RAID-5 parity stripe after calculating
-parity.
-.El
.\" XXX
.It Nm init Ar plex
.Pp
@@ -519,63 +314,37 @@ initializes all subdisks of a plex in parallel. Since this operation can take a
long time, it is performed in the background.
.Nm
prints a console message when the initialization is complete.
-.It Nm label
-.Ar volume
-.Pp
-The
-.Nm label
-command writes a
-.Ar ufs
-style volume label on a volume. It is a simple alternative to an appropriate
-call to
-.Ar disklabel .
-This is needed because some
-.Ar ufs
-commands still read the disk to find the label instead of using the correct
-.Ar ioctl
-call to access it.
-.Nm
-maintains a volume label separately from the volume data, so this command is not
-needed for
-.Ar newfs .
-This command is deprecated.
-.Pp
.It Nm list
.Op Fl r
.Op Fl V
.Op volume | plex | subdisk
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1
.It Nm l
.Op Fl r
.Op Fl V
.Op volume | plex | subdisk
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1
.It Nm ld
.Op Fl r
.Op Fl s
.Op Fl v
.Op Fl V
.Op volume
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1
.It Nm ls
.Op Fl r
.Op Fl s
.Op Fl v
.Op Fl V
.Op subdisk
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1
.It Nm lp
.Op Fl r
.Op Fl s
.Op Fl v
.Op Fl V
.Op plex
-.if n .sp -1v
-.if t .sp -.6v
+.sp -1
.It Nm lv
.Op Fl r
.Op Fl s
@@ -614,42 +383,39 @@ to output device statistics, the
(verbose) option causes some additional information to be output, and the
.Op Fl V
causes considerable additional information to be output.
-.It Nm makedev
-.br
-The
-.Nm makedev
-command removes the directory /dev/vinum and recreates it with device nodes
-which reflect the current configuration. This command is not intended for
-general use, and is provided for emergency use only.
+.It Nm label
+.Ar volume
.Pp
-.It Nm quit
-Exit the
+The
+.Nm label
+command writes a
+.Ar ufs
+style volume label on a volume. It is a simple alternative to an appropriate
+call to
+.Ar disklabel .
+This is needed because some
+.Ar ufs
+commands still read the disk to find the label instead of using the correct
+.Ar ioctl
+call to access it.
.Nm
-program when running in interactive mode. Normally this would be done by
-entering the
-.Ar EOF
-character.
+maintains a volume label separately from the volume data, so this command is not
+needed for
+.Ar newfs .
+This command is deprecated.
+.Pp
.It Nm read
-.Ar disk Op disk...
+.Ar disk-partition
.Pp
The
.Nm read
-command scans the specified disks for
-.Nm
-partitions containing previously created configuration information. It reads
-the configuration in order from the most recently updated to least recently
-updated configuration. This is the normal method used to start
-.Nm vinum .
+command reads a previously created
.Nm
-maintains an up-to-date copy of all configuration information on each disk
-partition. You must specify all of the partitions in a configuration as the
-parameter to this command.
+configuration from the specified disk partition.
.Nm
-.Nm read
-will accept the names of non-Vinum partitions, so you can specify all partitions
-upon which a
-.Nm
-partition might be resident to this command.
+maintains an up-to-date copy of all configuration information on each of the
+disk slices. You can specify any of the partitions in a configuration as the
+parameter to this command.
.It Nm rename
.Op Fl r
.Ar [ drive | subdisk | plex | volume ]
@@ -689,9 +455,6 @@ Enter text -> \f(BINO FUTURE\fP
Vinum configuration obliterated
.Ed
.ft R
-.Pp
-As the message suggests, this is a last-ditch command. Don't use it unless you
-have an existing configuration which you never want to see again.
.It Nm resetstats
.Op Fl r
.Op volume | plex | subdisk
@@ -759,29 +522,22 @@ care: it can result in total loss of data on a volume.
.\"XXX
.Nm This command has not yet been implemented.
..
-.It Nm setdaemon
-.Op value
-.Pp
-.Nm setdaemon
-sets a variable bitmask for the
-.Nm
-dæmon. This command is temporary and will be replaced. Currently, the bit mask
-may contain the bits 1 (log every action to syslog) and 4 (don't update
-configuration). Option bit 4 can be useful for error recovery.
.It Nm start
.Op volume | plex | subdisk
.Pp
.Nm start
-starts one or more
+starts the
.Nm
-objects. To start a plex in a multi-plex volume, the data must be copied from
-another plex in the volume. This frequently takes a long time and is done in
-the background.
+subsystem or one of its components. To start a plex in a multi-plex volume, the
+data must be copied from another plex in the volume. This frequently takes a
+long time and is done in the background.
.ig
-XXX When invoked without arguments, it checks all disks connected to the system
-for BSD partitions (type 165) and scans the partitions for a
+XXX
+When invoked without arguments, it checks
+all disks connected to the system for BSD partitions (type 165) and scans the
+slices for a
.Nm
-partition, which it calls a \fIdrive\fR\|. The
+slice, which it calls a \fIdrive\fR\|. The
.Nm
drive contains a header with all information about the data stored on the drive,
including the names of the other drives which are required in order to represent
@@ -843,6 +599,7 @@ Options are:
tab(#) ;
l lw50 .
Option#Meaning
+.TH N
T{
.Nm plex
.Ar plexname
@@ -887,9 +644,7 @@ command to first bring them to a consistent state. In the case of striped and
concatenated plexes, however, it does not normally cause problems to leave them
inconsistent: when using a volume for a file system or a swap partition, the
previous contents of the disks are not of interest, so they may be ignored.
-If you want to take this risk, use this keyword. It will only apply to the
-plexes defined immediately after the volume in the configuration file. If you
-add plexes to a volume at a later time, you must integrate them.
+If you want to take this risk, use this keyword.
.Pp
Note that you \fImust\fP\| use the
.Nm init
@@ -907,6 +662,7 @@ Define a plex. Unlike a volume, a plex does not need a name.
tab(#) ;
l lw50 .
Option#Meaning
+.TH N
T{
.Nm name
.Ar plexname
@@ -944,12 +700,6 @@ it specifies the size of a group. A group is a portion of a plex which
stores the parity bits all in the same subdisk. It must be a factor of the plex size (in
other words, the result of dividing the plex size by the stripe size must be an
integer), and it must be a multiple of a disk sector (512 bytes).
-.sp
-For optimum performance, stripes should be at least 128 kB in size: anything
-smaller will result in a significant increase in I/O activity due to mapping of
-individual requests over multiple disks. The increase in concurrency due to
-this mapping will not make up for the increase in latency. A good guideline for
-stripe size is between 256 kB and 512 kB.
T}
.Pp
#T{
@@ -1074,7 +824,7 @@ T}
.TE
.El
.Sh EXAMPLE CONFIGURATION FILE
-.Bd -literal
+.nf
# Sample vinum configuration file
#
# Our drives
@@ -1099,14 +849,14 @@ volume concat
sd length 100m drive drive2
sd length 50m drive drive4
plex org concat
- sd length 150m drive drive4
+ sd length 100m drive drive4
# A volume with one striped plex and one concatenated plex
volume strcon
plex org striped 32b
sd length 100m drive drive2
sd length 100m drive drive4
plex org concat
- sd length 150m drive drive2
+ sd length 100m drive drive2
sd length 50m drive drive4
# a volume with a RAID-5 and a striped plex
# note that the RAID-5 volume is longer by
@@ -1121,7 +871,7 @@ volume vol5
sd length 500m drive drive3
sd length 500m drive drive4
sd length 500m drive drive5
-.Ed
+.fi
.Ss DRIVE LAYOUT CONSIDERATIONS
.Nm
drives are currently BSD disk partitions. They must be of type
@@ -1130,162 +880,13 @@ in order to avoid overwriting file systems. In later versions of
.Nm
this requirement will change to type
.Ar vinum .
-Use
-.Nm disklabel
-.Ar -e
-to edit a partition type definition. The following display shows a typical
-partition layout as shown by
-.Nm disklabel:
-.Bd -literal
-8 partitions:
-# size offset fstype [fsize bsize bps/cpg]
- a: 81920 344064 4.2BSD 0 0 0 # (Cyl. 240*- 297*)
- b: 262144 81920 swap # (Cyl. 57*- 240*)
- c: 4226725 0 unused 0 0 # (Cyl. 0 - 2955*)
- e: 81920 0 4.2BSD 0 0 0 # (Cyl. 0 - 57*)
- f: 1900000 425984 4.2BSD 0 0 0 # (Cyl. 297*- 1626*)
- g: 1900741 2325984 unused 0 0 0 # (Cyl. 1626*- 2955*)
-.Ed
-.sp
-In this example, partition
-.Nm g
-may be used as a
-.Nm
-partition. Partitions
-.Nm a ,
-.Nm e
-and
-.Nm f
-may be used as
-.Nm UFS
-file systems or
-.Nm ccd
-partitions. Partition
-.Nm b
-is a swap partition, and partition
-.Nm c
-represents the whole disk and should not be used for any other purpose.
-.Pp
.Nm
uses the first 265 sectors on each partition for configuration information, so
the maximum size of a subdisk is 265 sectors smaller than the drive.
-.Sh GOTCHAS
-The following points are not bugs, and they have good reasons for existing, but
-they have shown to cause confusion. Each is discussed in the appropriate
-section above.
-.Bl -enum
-.It
-.Nm
-will not create a device on UFS partitions. Instead, it will return an error
-message ``wrong partition type''. The partition type must currently be
-``unused''.
-.It
-When you create a volume with multiple plexes,
-.Nm
-does not automatically initialize the plexes. This means that the contents are
-not known, but they are certainly not consistent. As a result, by default
-.Nm
-sets the state of all newly-created plexes except the first to
-.Ar stale .
-.Pp
-In practice, people aren't too interested in what was in the plex when it was
-created, and other volume managers cheat by setting them
-.Ar up
-anyway.
-.Nm
-provides two ways to ensure that newly created plexes are
-.Ar up :
-.Bl -bullet
-.It
-Create the plexes and then initialize them with
-.Nm vinum init .
-.It
-Create the volume (not the plex) with the keyword
-.Ar setupstate ,
-which tells
-.Nm
-to ignore any possible inconsistency and set the plexes to be
-.Ar up .
-.El
-.It
-Some of the commands currently supported by
-.Nm
-are not really needed. For reasons which I don't understand, however, I find
-that users frequently try the
-.Nm label
-and
-.Nm resetconfig
-commands, though especially
-.Nm resetconfig
-outputs all sort of dire warnings. Don't use these commands unless you have a
-good reason to do so.
-.It
-Some state transitions are not very intuitive. In fact, it's not clear whether
-this is a bug or a feature. If you find that you can't start an object in some
-strange state, such as a
-.Ar reborn
-subdisk, try first to get it into
-.Ar stopped
-state, with the
-.Nm stop
-or
-.Nm stop Ar -f
-commands. If that works, you should then be able to start it. If you find
-that this is the only way to get out of a position where easier methods fail,
-please report the situation.
-.It
-If you build the kernel module with the
-.Ar -DVINUMDEBUG
-option, you must also build
-.Nm vinum(8)
-with the
-.Ar -DVINUMDEBUG
-option, since the size of some data objects used by both components depends on
-this option. If you don't do so, commands will fail with the message
-.Ar Invalid argument ,
-and a console message will be logged such as
-.Pp
-.Bd -literal
-vinumioctl: invalid ioctl from process 247 (vinum): c0e44642
-.Ed
-.Pp
-This error may also occur if you use old versions of kld or userland program.
-.El
.Sh BUGS
-.Bl -enum
-.It
.Nm
is currently in beta test. Many bugs can be expected. The configuration
-mechanism is not yet fully functional. If you have difficulties, please look at
-http://www.lemis.com/vinum_beta.html and
-http://www.lemis.com/vinum_debugging.html before reporting problems.
-.It
-It is possible to unload
-.Nm
-with the
-.Nm kldunload
-command. This is buggy, and the only reason it is present at all is to make it
-easier for people testing the system: the alternative is a reboot. It works
-about 80% of the time: expect about one panic every five unloads.
-.It
-It is possible to configure
-.Nm
-statically, but it has never been tested in this form. Don't even bother to
-report the problem if you have trouble with a static
-.Nm
-pseudo-device.
-.It
-This man page tickles a bug in the
-.Ar doc
-man page macros: depending on your screen size, you may get the error message
-.Bd -literal -offset indent
-warning: page 6: table text block will not fit on one page
-.Ed
-.Pp
-This will be fixed in a later rewrite of the page, when the
-.Nm tbl
-macros will be removed.
-.El
+mechanism is not yet fully functional.
.Sh FILES
.Ar /dev/vinum
- directory with device nodes for
@@ -1306,10 +907,7 @@ plexes.
.Nm
subdisks.
.Sh SEE ALSO
-.Xr vinum 4 ,
-.Xr disklabel 8 ,
-.Nm http://www.lemis.com/vinum.html ,
-.Nm http://www.lemis.com/vinum-debugging.html .
+.Xr vinum 4
.Sh AUTHOR
Greg Lehey
.Pa <grog@lemis.com> .
diff --git a/share/Makefile b/share/Makefile
index 330a31c9838e..6363f071eaac 100644
--- a/share/Makefile
+++ b/share/Makefile
@@ -1,6 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
-SUBDIR= dict doc examples info isdn man me misc mk skel \
+SUBDIR= dict doc examples info man me misc mk skel \
syscons tabset termcap timedef zoneinfo
.include <bsd.subdir.mk>
diff --git a/share/dict/README b/share/dict/README
index afdc408e2132..1574786ed2cb 100644
--- a/share/dict/README
+++ b/share/dict/README
@@ -1,5 +1,5 @@
# @(#)README 8.1 (Berkeley) 6/5/93
-# $Id: README,v 1.5 1998/01/25 19:20:00 wosch Exp $
+# $Id: README,v 1.4 1997/02/22 13:55:34 peter Exp $
WEB ---- (introduction provided by jaw@riacs) -------------------------
@@ -17,13 +17,3 @@ Russian, Spanish, Swahili, Swedish, Yiddish, are available
at ftp://sable.ox.ac.uk/pub/wordlists.
Country names are stored in the file /usr/share/misc/iso3166.
-
-
-FreeBSD Maintenance Notes ---------------------------------------------
-
-Note that FreeBSD is not maintaining a historical document, we're
-maintaining a list of current [American] English spellings.
-
-A few words have been removed because their spellings have depreciated.
-This list of words includes:
- corelation (and its derivatives) -- "correlation" is the preferred spelling
diff --git a/share/dict/web2 b/share/dict/web2
index e7eda933195c..2d9264e0bd38 100644
--- a/share/dict/web2
+++ b/share/dict/web2
@@ -42931,6 +42931,11 @@ Coreidae
coreign
coreigner
corejoice
+corelate
+corelated
+corelation
+corelative
+corelatively
coreless
coreligionist
corella
diff --git a/share/examples/atm/atm-sockets.txt b/share/examples/atm/atm-sockets.txt
index 17436f14492f..258a565f8487 100644
--- a/share/examples/atm/atm-sockets.txt
+++ b/share/examples/atm/atm-sockets.txt
@@ -148,17 +148,15 @@ o Multipoint connections
Example ATM Socket Application
------------------------------
-The following are simple example client and server applications using the ATM
-socket API.
+The following is a simple example application using the ATM socket API.
/*
- * ATM API sample client application
+ * ATM API sample application
*
- * This application will open an ATM socket to a server, send a text string
- * in a PDU and then read one PDU from the socket and print its contents.
+ * This application will open an ATM socket, send a text string in a PDU
+ * and then read one PDU from the socket and print its contents.
*
*/
-#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -167,35 +165,17 @@ socket API.
#define MAX_LEN 4096 /* Maximum PDU length */
#define MY_ID 11 /* BLLI Layer 2 protocol */
-#define MY_APPL "Client"
+#define MY_APPL "SAMPLE"
Atm_addr_nsap dst_addr = {
0x47,
-#error FIX ME: Replace the 2 lines below with your nsap prefix and esi address
{0x00,0x05,0x80,0xff,0xdc,0x00,0x00,0x00,0x00,0x02,0xff,0xff},
{0x11,0x22,0x33,0x44,0x55,0x66},
0x00
};
-static char message[] = "A message from the client";
+static char message[] = "Test message to send on connection";
-void
-print_cause(int s)
-{
- struct t_atm_cause cause;
- int optlen;
-
- optlen = sizeof(cause);
- if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) {
- perror("getsockopt(cause)");
- return;
- }
-
- fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n",
- cause.coding_standard, cause.location, cause.cause_value,
- cause.diagnostics[0], cause.diagnostics[1],
- cause.diagnostics[2], cause.diagnostics[3]);
-}
main(argc, argv)
int argc;
@@ -305,8 +285,6 @@ main(argc, argv)
exit(1);
}
-#ifdef REMOVE_TO_USE_NET_INTF
-#error FIX ME: Replace the ni0 below with the local atm network interface name
strncpy(netintf.net_intf, "ni0", IFNAMSIZ);
optlen = sizeof(netintf);
if (setsockopt(s, T_ATM_SIGNALING, T_ATM_NET_INTF, (caddr_t)&netintf,
@@ -314,7 +292,6 @@ main(argc, argv)
perror("setsockopt(net_intf)");
exit(1);
}
-#endif
strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN);
optlen = sizeof(appname);
@@ -329,7 +306,6 @@ main(argc, argv)
*/
if (connect(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) {
perror("connect");
- print_cause(s);
exit(1);
}
@@ -341,7 +317,7 @@ main(argc, argv)
exit(1);
}
- if ((n = read(s, buffer, MAX_LEN)) < 0) {
+ if ((n = read(s, buffer, MAX_LEN) < 0)) {
perror("read");
exit(1);
}
@@ -360,213 +336,5 @@ main(argc, argv)
exit(0);
}
-
-
-/*
- * ATM API sample server application
- *
- * This application will loop forever listening for connections on an ATM
- * socket. When a new connection arrives, it will send a string in a PDU,
- * read one PDU from the socket and print its contents.
- *
- */
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netatm/atm.h>
-
-#define MAX_LEN 4096 /* Maximum PDU length */
-#define MY_ID 11 /* BLLI Layer 2 protocol */
-#define MY_APPL "Server"
-
-static char message[] = "A message from the server";
-
-void
-print_cause(int s)
-{
- struct t_atm_cause cause;
- int optlen;
-
- optlen = sizeof(cause);
- if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) {
- perror("getsockopt(cause)");
- return;
- }
-
- fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n",
- cause.coding_standard, cause.location, cause.cause_value,
- cause.diagnostics[0], cause.diagnostics[1],
- cause.diagnostics[2], cause.diagnostics[3]);
-}
-
-main(argc, argv)
- int argc;
- char **argv;
-{
- struct sockaddr_atm satm;
- struct t_atm_aal5 aal5;
- struct t_atm_traffic traffic;
- struct t_atm_bearer bearer;
- struct t_atm_qos qos;
- struct t_atm_net_intf netintf;
- struct t_atm_app_name appname;
- char buffer[MAX_LEN+1];
- int s, n, optlen;
-
- /*
- * Create socket
- */
- s = socket(AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5);
- if (s < 0) {
- perror("socket");
- exit(1);
- }
-
- /*
- * Set up destination SAP
- */
- bzero((caddr_t) &satm, sizeof(satm));
- satm.satm_family = AF_ATM;
-#if (defined(BSD) && (BSD >= 199103))
- satm.satm_len = sizeof(satm);
-#endif
- /* Destination ATM address */
- satm.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_ANY;
- satm.satm_addr.t_atm_sap_addr.SVE_tag_selector = T_ATM_ANY;
-
- /* BLLI Layer-2 protocol */
- satm.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT;
- satm.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_USER_ID;
- satm.satm_addr.t_atm_sap_layer2.ID.user_defined_ID = MY_ID;
-
- /* BLLI Layer-3 protocol */
- satm.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT;
-
- /* BHLI protocol */
- satm.satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT;
-
- /*
- * Set up connection parameters
- */
- aal5.forward_max_SDU_size = MAX_LEN;
- aal5.backward_max_SDU_size = MAX_LEN;
- aal5.SSCS_type = T_ATM_NULL;
- optlen = sizeof(aal5);
- if (setsockopt(s, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5,
- optlen) < 0) {
- perror("setsockopt(aal5)");
- exit(1);
- }
-
- traffic.forward.PCR_high_priority = T_ATM_ABSENT;
- traffic.forward.PCR_all_traffic = 100000;
- traffic.forward.SCR_high_priority = T_ATM_ABSENT;
- traffic.forward.SCR_all_traffic = T_ATM_ABSENT;
- traffic.forward.MBS_high_priority = T_ATM_ABSENT;
- traffic.forward.MBS_all_traffic = T_ATM_ABSENT;
- traffic.forward.tagging = T_NO;
- traffic.backward.PCR_high_priority = T_ATM_ABSENT;
- traffic.backward.PCR_all_traffic = 100000;
- traffic.backward.SCR_high_priority = T_ATM_ABSENT;
- traffic.backward.SCR_all_traffic = T_ATM_ABSENT;
- traffic.backward.MBS_high_priority = T_ATM_ABSENT;
- traffic.backward.MBS_all_traffic = T_ATM_ABSENT;
- traffic.backward.tagging = T_NO;
- traffic.best_effort = T_YES;
- optlen = sizeof(traffic);
- if (setsockopt(s, T_ATM_SIGNALING, T_ATM_TRAFFIC, (caddr_t)&traffic,
- optlen) < 0) {
- perror("setsockopt(traffic)");
- exit(1);
- }
-
- bearer.bearer_class = T_ATM_CLASS_X;
- bearer.traffic_type = T_ATM_NULL;
- bearer.timing_requirements = T_ATM_NULL;
- bearer.clipping_susceptibility = T_NO;
- bearer.connection_configuration = T_ATM_1_TO_1;
- optlen = sizeof(bearer);
- if (setsockopt(s, T_ATM_SIGNALING, T_ATM_BEARER_CAP, (caddr_t)&bearer,
- optlen) < 0) {
- perror("setsockopt(bearer)");
- exit(1);
- }
-
- qos.coding_standard = T_ATM_NETWORK_CODING;
- qos.forward.qos_class = T_ATM_QOS_CLASS_0;
- qos.backward.qos_class = T_ATM_QOS_CLASS_0;
- optlen = sizeof(qos);
- if (setsockopt(s, T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos,
- optlen) < 0) {
- perror("setsockopt(qos)");
- exit(1);
- }
-
- strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN);
- optlen = sizeof(appname);
- if (setsockopt(s, T_ATM_SIGNALING, T_ATM_APP_NAME, (caddr_t)&appname,
- optlen) < 0) {
- perror("setsockopt(app_name)");
- exit(1);
- }
-
- /*
- * Now try to bind/listen
- */
- if (bind(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) {
- perror("bind");
- exit(1);
- }
- if (listen(s, 4) < 0) {
- perror("listen");
- exit(1);
- }
-
- for (; ; ) {
- struct sockaddr_atm claddr;
- int clsock, cllen;
-
- /* Wait for incoming call */
- cllen = sizeof(claddr);
- clsock = accept(s, (struct sockaddr *) &claddr, &cllen);
- if (clsock < 0) {
- perror("accept");
- exit(1);
- }
- printf("Server: new connection\n");
-
- /*
- * Exchange message with peer
- */
- if (write(clsock, message, sizeof(message)) != sizeof(message)) {
- perror("write");
- exit(1);
- }
-
- if ((n = read(clsock, buffer, MAX_LEN)) < 0) {
- perror("read");
- exit(1);
- }
-
- buffer[n] = '\0';
- printf("received %d bytes: <%s>\n", n, buffer);
-
- sleep(1);
-
- /*
- * Finish up
- */
- if (close(clsock) < 0) {
- perror("close");
- exit(1);
- }
- }
-
- close(s);
- exit(0);
-}
-
- @(#) $Id: atm-sockets.txt,v 1.1 1998/09/15 08:22:49 phk Exp $
+ @(#) $Id: atm_sockets,v 1.1 1998/08/26 21:52:01 mks Exp $
diff --git a/share/examples/bootforth/README b/share/examples/bootforth/README
deleted file mode 100644
index d86251bcf512..000000000000
--- a/share/examples/bootforth/README
+++ /dev/null
@@ -1,22 +0,0 @@
-Here you can find some simple examples how to use BootFORTH (part of the
-new bootloader) together with terminal emulation code (available when
-compiling /sys/boot/i386/libi386 with -DTERM_EMU).
-
-Normally, you can place the files in /boot as they are here, and they will be
-automatically loaded by /boot/loader.
-
-The files are:
-
-boot.4th example of file which is always loaded by /boot/loader, if
- present in /boot/
-screen.4th helpful words for screen manipulation.
-frames.4th basic frame drawing primitives. Requires screen.4th.
-menu.4th example of simple startup menu.
-
-You're encouraged to add more features to these files - I'm not a Forth
-hacker, unfortunately...
-
-Andrzej Bialecki
-<abial@freebsd.org>
-
-$Id$
diff --git a/share/examples/bootforth/boot.4th b/share/examples/bootforth/boot.4th
deleted file mode 100644
index 467e968f962a..000000000000
--- a/share/examples/bootforth/boot.4th
+++ /dev/null
@@ -1,22 +0,0 @@
-\ Example of the file which is automatically loaded by /boot/loader
-\ on startup.
-\ $Id$
-
-\ Load the screen manipulation words
-
-cr .( Loading Forth extensions:)
-
-cr .( - screen.4th...)
-s" /boot/screen.4th" fopen dup fload fclose
-
-\ Load frame support
-cr .( - frames.4th...)
-s" /boot/frames.4th" fopen dup fload fclose
-
-\ Load our little menu
-cr .( - menu.4th...)
-s" /boot/menu.4th" fopen dup fload fclose
-
-\ Show it
-cr
-main_menu
diff --git a/share/examples/bootforth/frames.4th b/share/examples/bootforth/frames.4th
deleted file mode 100644
index 9895a74466be..000000000000
--- a/share/examples/bootforth/frames.4th
+++ /dev/null
@@ -1,90 +0,0 @@
-\ Words implementing frame drawing
-\ XXX Filled boxes are left as an exercise for the reader... ;-/
-\ $Id$
-
-marker task-frames.4th
-
-variable h_el
-variable v_el
-variable lt_el
-variable lb_el
-variable rt_el
-variable rb_el
-variable fill
-
-\ Single frames
-196 constant sh_el
-179 constant sv_el
-218 constant slt_el
-192 constant slb_el
-191 constant srt_el
-217 constant srb_el
-\ Double frames
-205 constant dh_el
-186 constant dv_el
-201 constant dlt_el
-200 constant dlb_el
-187 constant drt_el
-188 constant drb_el
-\ Fillings
-0 constant fill_none
-32 constant fill_blank
-176 constant fill_dark
-177 constant fill_med
-178 constant fill_bright
-
-
-: hline ( len x y -- ) \ Draw horizontal single line
- at-xy \ move cursor
- 0 do
- h_el @ emit
- loop
-;
-
-: f_single ( -- ) \ set frames to single
- sh_el h_el !
- sv_el v_el !
- slt_el lt_el !
- slb_el lb_el !
- srt_el rt_el !
- srb_el rb_el !
-;
-
-: f_double ( -- ) \ set frames to double
- dh_el h_el !
- dv_el v_el !
- dlt_el lt_el !
- dlb_el lb_el !
- drt_el rt_el !
- drb_el rb_el !
-;
-
-: vline ( len x y -- ) \ Draw vertical single line
- 2dup 4 pick
- 0 do
- at-xy
- v_el @ emit
- 1+
- 2dup
- loop
- 2drop 2drop drop
-;
-
-: box ( w h x y -- ) \ Draw a box
- 2dup 1+ 4 pick 1- -rot
- vline \ Draw left vert line
- 2dup 1+ swap 5 pick + swap 4 pick 1- -rot
- vline \ Draw right vert line
- 2dup swap 1+ swap 5 pick 1- -rot
- hline \ Draw top horiz line
- 2dup swap 1+ swap 4 pick + 5 pick 1- -rot
- hline \ Draw bottom horiz line
- 2dup at-xy lt_el @ emit \ Draw left-top corner
- 2dup 4 pick + at-xy lb_el @ emit \ Draw left bottom corner
- 2dup swap 5 pick + swap at-xy rt_el @ emit \ Draw right top corner
- 2 pick + swap 3 pick + swap at-xy rb_el @ emit
- 2drop
-;
-
-f_single
-fill_none fill !
diff --git a/share/examples/bootforth/menu.4th b/share/examples/bootforth/menu.4th
deleted file mode 100644
index 06493c53f14b..000000000000
--- a/share/examples/bootforth/menu.4th
+++ /dev/null
@@ -1,96 +0,0 @@
-\ Simple greeting screen, presenting basic options.
-\ XXX This is far too trivial - I don't have time now to think
-\ XXX about something more fancy... :-/
-\ $Id: menu.4th,v 1.1 1998/12/22 12:15:45 abial Exp $
-
-: title
- f_single
- 60 11 10 4 box
- 29 4 at-xy 15 fg 7 bg
- ." Welcome to BootFORTH!"
- me
-;
-
-: menu
- 2 fg
- 20 7 at-xy
- ." 1. Start FreeBSD /kernel."
- 20 8 at-xy
- ." 2. Interact with BootFORTH."
- 20 9 at-xy
- ." 3. Reboot."
- me
-;
-
-: tkey ( d -- flag | char )
- seconds +
- begin 1 while
- dup seconds u< if
- drop
- -1
- exit
- then
- key? if
- drop
- key
- exit
- then
- repeat
-;
-
-: prompt
- 14 fg
- 20 11 at-xy
- ." Enter your option (1,2,3): "
- 10 tkey
- dup 32 = if
- drop key
- then
- dup 0< if
- drop 49
- then
- dup emit
- me
-;
-
-: help_text
- 10 18 at-xy ." * Choose 1 if you just want to run FreeBSD."
- 10 19 at-xy ." * Choose 2 if you want to use bootloader facilities."
- 12 20 at-xy ." See '?' for available commands, and 'words' for"
- 12 21 at-xy ." complete list of Forth words."
- 10 22 at-xy ." * Choose 3 in order to warm boot your machine."
-;
-
-: main_menu
- begin 1 while
- clear
- f_double
- 79 23 1 1 box
- title
- menu
- help_text
- prompt
- cr cr cr
- dup 49 = if
- drop
- 1 25 at-xy cr
- ." Loading kernel. Please wait..." cr
- boot
- then
- dup 50 = if
- drop
- 1 25 at-xy cr
- exit
- then
- dup 51 = if
- drop
- 1 25 at-xy cr
- reboot
- then
- 20 12 at-xy
- ." Key " emit ." is not a valid option!"
- 20 13 at-xy
- ." Press any key to continue..."
- key drop
- repeat
-;
diff --git a/share/examples/bootforth/screen.4th b/share/examples/bootforth/screen.4th
deleted file mode 100644
index 4b0a01e7c982..000000000000
--- a/share/examples/bootforth/screen.4th
+++ /dev/null
@@ -1,36 +0,0 @@
-\ Screen manipulation related words.
-\ $Id$
-
-marker task-screen.4th
-
-: escc ( -- ) \ emit Esc-[
- 91 27 emit emit
-;
-
-: ho ( -- ) \ Home cursor
- escc 72 emit \ Esc-[H
-;
-
-: cld ( -- ) \ Clear from current position to end of display
- escc 74 emit \ Esc-[J
-;
-
-: clear ( -- ) \ clear screen
- ho cld
-;
-
-: at-xy ( x y -- ) \ move cursor to x rows, y cols (1-based coords)
- escc .# 59 emit .# 72 emit \ Esc-[%d;%dH
-;
-
-: fg ( x -- ) \ Set foreground color
- escc 3 .# .# 109 emit \ Esc-[3%dm
-;
-
-: bg ( x -- ) \ Set background color
- escc 4 .# .# 109 emit \ Esc-[4%dm
-;
-
-: me ( -- ) \ Mode end (clear attributes)
- escc 109 emit
-;
diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh
index e2bc74c304f4..e8249770a07a 100755
--- a/share/examples/drivers/make_device_driver.sh
+++ b/share/examples/drivers/make_device_driver.sh
@@ -29,7 +29,7 @@ DONE
cat >${UPPER} <<DONE
# Configuration file for kernel type: ${UPPER}
ident ${UPPER}
-# \$Id: make_device_driver.sh,v 1.3 1998/01/12 07:47:03 julian Exp $"
+# \$Id: make_device_driver.sh,v 1.2 1997/12/30 03:23:12 julian Exp $"
DONE
grep -v GENERIC < GENERIC >>${UPPER}
@@ -37,7 +37,7 @@ grep -v GENERIC < GENERIC >>${UPPER}
cat >>${UPPER} <<DONE
# trust me, you'll need this
options DDB
-device ${1}0 at isa? port 0x234 bio irq 5
+device ${1}0 at isa? port 0x234 bio irq 5 vector ${1}intr
DONE
cat >../isa/${1}.c <<DONE
@@ -45,7 +45,7 @@ cat >../isa/${1}.c <<DONE
* Copyright ME
*
* ${1} driver
- * \$Id: make_device_driver.sh,v 1.3 1998/01/12 07:47:03 julian Exp $
+ * \$Id: make_device_driver.sh,v 1.2 1997/12/30 03:23:12 julian Exp $
*/
@@ -65,7 +65,7 @@ cat >../isa/${1}.c <<DONE
-/* Function prototypes (these should all be static) */
+/* Function prototypes (these should all be static except for ${1}intr()) */
static d_open_t ${1}open;
static d_close_t ${1}close;
static d_read_t ${1}read;
@@ -76,7 +76,7 @@ static d_poll_t ${1}poll;
static int ${1}probe (struct isa_device *);
static int ${1}attach (struct isa_device *);
#ifdef ${UPPER}_MODULE
-static ointhand2_t ${1}intr; /* should actually have type inthand2_t */
+void ${1}intr(int unit); /* actually defined in ioconf.h (generated file) */
#endif
#define CDEV_MAJOR 20
@@ -172,13 +172,7 @@ ${1}attach (struct isa_device *dev)
{
int unit = dev->id_unit;
sc_p scp = sca[unit];
-
- /*
- * Attach our interrupt handler to the device struct. Our caller
- * will attach it to the hardware soon after we return.
- */
- dev->id_ointr = ${1}intr;
-
+
/*
* Allocate storage for this instance .
*/
@@ -225,7 +219,7 @@ do { /* the do-while is a safe way to do this grouping */ \
#define CHECKUNIT_DIAG(RETVAL)
#endif /* DIAGNOSTIC */
-static void
+void
${1}intr(int unit)
{
sc_p scp = sca[unit];
diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh
index a68bc7eeaf71..f6fc34248865 100644
--- a/share/examples/drivers/make_pseudo_driver.sh
+++ b/share/examples/drivers/make_pseudo_driver.sh
@@ -21,7 +21,7 @@ DONE
cat >${UPPER} <<DONE
# Configuration file for kernel type: ${UPPER}
ident ${UPPER}
-# \$Id: make_pseudo_driver.sh,v 1.2 1997/12/30 03:23:13 julian Exp $"
+# \$Id: make_pseudo_driver.sh,v 1.1 1997/02/02 07:19:30 julian Exp $"
DONE
grep -v GENERIC < GENERIC >>${UPPER}
@@ -37,7 +37,7 @@ cat >../../dev/${1}.c <<DONE
* Copyright ME
*
* ${1} driver
- * \$Id: make_pseudo_driver.sh,v 1.2 1997/12/30 03:23:13 julian Exp $
+ * \$Id: make_pseudo_driver.sh,v 1.1 1997/02/02 07:19:30 julian Exp $
*/
@@ -55,7 +55,7 @@ cat >../../dev/${1}.c <<DONE
-/* Function prototypes (these should all be static) */
+/* Function prototypes (these should all be static except for ${1}intr()) */
static d_open_t ${1}open;
static d_close_t ${1}close;
static d_read_t ${1}read;
diff --git a/share/examples/isdn/FAQ b/share/examples/isdn/FAQ
deleted file mode 100644
index 8dd1d71c33ac..000000000000
--- a/share/examples/isdn/FAQ
+++ /dev/null
@@ -1,517 +0,0 @@
---------------------------------------------------------------------------------
-
- ISDN4BSD Frequently Asked Questions
- ===================================
-
- last edit-date: [Fri Dec 25 19:59:21 1998]
-
---------------------------------------------------------------------------------
-
-Contents:
-=========
-
- 1. How do I get started with synchronous PPP (sPPP) ?
- 2. does anyone know a software that can receive/send fax over ISDN ?
- 3. does i4b callback only work with setups where the remote end
- returns a busy ?
- 4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
- 5. I want to use -r with isdnd but it does not work
- 6. How do I configure and run the answering machine ?
- 7. Teles S0/16.3 ... unknown ?
- 8. How do i integrate a new lowlevel driver into i4b ?
- 9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
- 10. Incoming alert - what does it mean ?
- 11. How do i change irq's on my teles 16.3 card ?
-
-
-
-1. How do I get started with synchronous PPP (sPPP) ?
-================================================================================
-
- Of course you first have to have sPPP interfaces in your kernel. If
- you installed everything using FreeBSD/install.sh then the correct
- entries should have been automatically made in /sys/conf/files for you.
- For NetBSD it isn't quite as simple since NetBSD/install-netbsd.sh does
- not do it for you.
-
- Then all you need to do is put an entry like this:
-
- pseudo-device "i4bisppp" 4
-
- into your kernel configuration file (if it's not already there) and
- generate and boot the new kernel. The above line will give you 4
- sPPP interfaces - isp0 to isp3.
-
- Then just modify /etc/isdn/isdnd.rc (see the example in etc-isdn/isdnd.rc)
- to suit your needs (telephone numbers, etc).
-
- The next step is to read the spppcontrol man page and then to look at
- etc/rc.isdn-PPP. spppcontrol is a very important component in getting
- sPPP working correctly and the spppcontrol lines in your /etc/rc.isdn
- must be correct.
-
- In my experience there are two things which can cause problems:
-
- 1) the authproto line has to agree with what your ISP desires. In
- general I've found that it's best to have something like this -
-
- spppcontrol <interface> myauthproto={pap,chap} myauthname=<AuthName>
- myauthsecret=<AuthSecret> hisauthproto=none callin
-
- The "hisauthproto=none" is usually needed because the ISP does not want
- to authorise himself to you; he expects you to authorize yourself to him !
- I once forgot to set hisauthproto and it took me quite a while to figure
- out why I couldn't connect.
-
- 2) the IP address at your ISP's end must be correct.
-
- How can I find out (1) whether my ISP wants pap or chap and (2) what his
- IP address is ? you might ask. Generally, your ISP should have provide
- this information to you. But, if he didn't, or you've mislayed the
- documentation (as I did), there's still hope.
-
- Fortunately, J"org Wunsch implemented the sPPP kernel code so that it
- provides all the information required if the interface is configured
- with the debug flag set (e.g. ``ifconfig isp0 debug''). It's just a
- little cryptic.
-
- By the way, I suggest turning the debug flag on until you have things
- working and then turning it off. The debug output is rather voluminous
- and could fill up your /var partition, otherwise.
-
- The debug output will appear on the console and also be logged to
- /var/log/messages (under FreeBSD) unless you changed /etc/syslog.conf.
-
- A. How to figure out the authproto
- ----------------------------------
-
- Here is an example where I configured isp0 with myauthproto=pap, my
- ISP wanted chap, but was willing to accept pap:
-
- /kernel: isp0: lcp up(starting)
- /kernel: isp0: lcp output <conf-req id=0x7 len=10 5-6-34-e4-30-5a>
- /kernel: isp0: lcp input(req-sent): <conf-req id=0x1 len=30 0-4-0-0-1-4-5-
- f4-3-5-c2-23-5-11-4-5-f4-13-9-3-0-c0-7b-6e-fe-b5>
- ^^^^^
- |___ c223 is chap, it's what the ISP wants to use
-
- /kernel: isp0: lcp parse opts: 0x0 [rej] mru auth-proto 0x11 [rej]
- x13 [rej] send conf-rej (I didn't agree)
- /kernel: isp0: lcp output <conf-rej id=0x1 len=21 0-4-0-0-11-4-5-f4-13-9-3-
- 0-c0-7b-6e-fe-b5>
- /kernel: isp0: lcp input(req-sent): <conf-ack id=0x7 len=10 5-6-34-e4-30-5a>
- /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x2 len=13 1-4-5-f4-3-5-
- c2-23-5>
- /kernel: isp0: lcp parse opts: mru auth-proto
- /kernel: isp0: lcp parse opt values: mru 1524 auth-proto [mine 0x0 !=
- his chap] send conf-nak (we want to use pap, not chap)
- /kernel: isp0: lcp output <conf-nak id=0x2 len=9 3-5-c0-23-5>
- ^^^^^
- |___ c023 is pap
-
- /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x3 len=12 1-4-5-f4-3-4-
- c0-23> (he agrees to use pap)
- /kernel: isp0: lcp parse opts: mru auth-proto
- /kernel: isp0: lcp parse opt values: mru 1524 auth-proto send conf-ack
- /kernel: isp0: lcp output <conf-ack id=0x3 len=12 1-4-5-f4-3-4-c0-23>
- he agrees to use pap ___|^^^^^
-
- so, if you have problems in the lcp phase, check which authentication method
- your ISP wants to use. Usually chap is prefered, but pap will be accepted.
-
- B. How to figure out the ISP's IP address
- -----------------------------------------
-
- I also intentionally configured the interface with the wrong address for
- my ISP, like this:
-
- ifconfig isp0 0.0.0.0 10.0.0.1 debug link1
-
- this means that I want the ISP to assign me an address (the 0.0.0.0) and
- that I expect him to use 10.0.0.1 (which is wrong). Here's the result:
- (note that these addresses have been changed by me)
-
- /kernel: isp0: phase network
- /kernel: isp0: ipcp open(initial)
- /kernel: isp0: ipcp up(starting)
- /kernel: isp0: ipcp output <conf-req id=0x9 len=10 3-6-0-0-0-0>
- /kernel: isp0: ipcp input(req-sent): <conf-req id=0x1 len=16 2-6-0-2d-f-1-
- 3-6-c-22-38-4e>
- /kernel: isp0: ipcp parse opts: compression [rej] address send conf-rej
- /kernel: isp0: ipcp output <conf-rej id=0x1 len=10 2-6-0-2d-f-1>
- /kernel: isp0: ipcp input(req-sent): <conf-nak id=0x9 len=10 3-6-c-22-38-4e>
- /kernel: isp0: ipcp nak opts: address [wantaddr 12.34.56.78] [agree]
- ^^^^^
- |___ he assigns me this
-
- /kernel: isp0: ipcp output <conf-req id=0xa len=10 3-6-c3-b4-eb-63>
- /kernel: isp0: ipcp input(req-sent): <conf-req id=0x2 len=10 3-6-62-4c-36-20>
- /kernel: isp0: ipcp parse opts: address
- /kernel: isp0: ipcp parse opt values: address 98.76.54.32 [not agreed]
- ^^^^^
- |_this is *his* address
- send conf-nak
- /kernel: isp0: ipcp output <conf-nak id=0x2 len=10 3-6-a-0-0-1>
- I expect a different address and (incorrectly) reject what he wants.
- I tell him that I expect 10.0.0.1. After this the connection fails.
-
- Anyway, I now know that his address is really 98.76.54.32 and can use
- it to correctly configure the interface.
-
- With the correct IP address I shoulkd now be able to connect with no
- problems. As stated above, the authorization protocol is normally not
- so important since most ISPs are willing to use pap, although chap is
- more secure. Generally, I'd try chap first and only switch to pap if
- the ISP doesn't accept it.
-
- (by Gary Jennejohn, Home - garyj@muc.de, Work - garyj@fkr.dec.com)
-
-
-
-2. does anyone know a software that can receive/send fax over ISDN ?
-================================================================================
-
- > Hi,
- >
- > does anyone know a software that can receive/send fax over ISDN? I am
- > using a Fritz!Card, which can handle group 3 (analogous) fax, but I
- > can't find any hint in the i4b software that this is supported in any
- > way.
-
-This is probably not implemented.
-
-Implementing G3 fax in ISDN would mean simulating an analog modem
-on the digital link. This means having to generate the right waveforms
-for the modulated data, and receive analog data from the other end
-which you had to run FFT analysis on and then interpret.
-
-In addition you have to do this in realtime, to be able to deal with
-the timing involved in the fax protocol, something neither
-FreeBSD or Linux is good at in their native form..
-
-A third point is that a software simulated faxmodem usually does not
-work well. I tested Teles software faxmodem in Win-95 towards an Ericsson V34
-HE modem, and was able to send faxes from the ISDN card at 4800 baud
-only, and receive faxes ad 9600 baud only(!) (And it is not the
-Ericsson modems fault, it works flawlessly towards other fax machines.)
-
-My point is that the best thing to do is to use an ordinary faxmodem
-to handle faxes with Hylafax of mgetty+sendfax or efax, or you may use
-a combined ISDN card with an analog part.
-
-Of course, if you are crazy enough, you may try to implement a
-software simulated modem in e.g. RT-linux, or a similar realtime
-extension for FreeBSD.
-
-Best regards,
-Nils Ulltveit-Moe (etonumo@eto.ericsson.se)
-
-
-
-3. does i4b callback only work with setups where the remote end returns a busy ?
-================================================================================
-
-> Is my assumption correct, does i4b callback only work with setups where
-> the remote end returns a busy on the dialin?
-
-Yes - otherwise you'll pay for the connection, at least here in Germany.
-
-Most routers support two kind of callbacks - the one that i4b supports
-means: the called system rejects (so no charge for this connection), waits
-a configurable time and the calls back. Information on who has called and
-who is to be called back relies on the ISDN calling party number information
-and stuff statically configured in the routers (or isnd's) configuration.
-
-The other type of callback (not supported by i4b right now) means: the
-called system accepts the connection and starts ppp negotiation. During this
-the ppp's aggree to do a callback. Information on who called in and who is
-going to be called back is subject to the authentication/negotiation already
-done by the two ppp's. Then ppp closes down, the connection is disconnected
-and the called system calls back.
-
-I've never seen someone actually use the second type due to its obvious
-disadvantages. It may be usefull if you travel, call in from an unknown
-number and want to be called back at that number.
-
-Martin Husemann <martin@rumolt.teuto.de>
-
-
-4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
-================================================================================
-
- NOTICE: section obsolete since IP address changes are handled properly now!
- ===========================================================================
-
-This section
-> Trying to build a router/gateway between my privat Ethernet and
-> the Internet (via my ISP), I have problems with I4B or NAT (I think:).
->
-> The 2.2.5-R kernel with options IPFIREWALL and IPDIVERT works fine
-> with ISDN4BSD 0.50-alpha and firewall rule 'pass all from any to any'.
-> However, when I add 'divert natd all from any to any via isp0'
-> and start natd, name server lookups to the ISP's NS don't work.
->
-> Also, ping and nslookup fails from any other internal host.
-
-I had exactly the same problems. natd doesn't seem to get a message if
-the IP address of the interface changes (after successful dialout).
-I have to manually send a HUP signal to natd. I do this via the following
-(ugly?!) hack:
-
-I added the following two lines to the system section of isdnd.rc:
-regexpr = "call active" # look for matches in log messages
-regprog = hup_natd # execute program whan match is found
-
-The small script "hup_natd", located in /etc/isdn, looks like:
-#!/bin/sh
-pid=`cat /var/run/natd.pid`
-kill -HUP $pid
-sleep 3
-kill -HUP $pid
-sleep 5
-kill -HUP $pid
-
-It looks ugly, but at least for me it works. The two sleeps are necessary
-since I have to wait for ppp negotiation to complete (I don't get a message
-from isdnd for that). If I'm lucky I have my connection after 3 seconds,
-but 8 seconds should suffice for worst case (the first HUP without a sleep
-sometimes even succeeded on an slow 486/33 with 8MB RAM, more HUPs don't hurt).
-
-I'm really interested in some more elegant method.
-
-Daniel (rock@cs.uni-sb.de)
-
-
-Arve Ronning replied:
-=====================
-
-> I had exactly the same problems. natd doesn't seem to get a message if
-> the IP address of the interface changes (after successful dialout).
-
-Well, it (natd) _does_ pick up the dynamic address supplied for isp0.
-Try 'natd -verbose ...' and you'll see it. Otherwise I agree, there is
-certainly something missing in natd's functionality, or maybe sppp
-does'nt
-supply what it's supposed to ??
-
-> I have to manually send a HUP signal to natd. I do this via the following
-> (ugly?!) hack:
-
-YES...super; strange but correct. It works when I send natd a -HUP after
-sppp is up. Thanx for the tip. However, natd must be -HUPed _every_ time
-sppp has been down (idle timeout) and comes back up!
-
-> I'm really interested in some more elegant method.
-
-So am I, let's see what may come out of the discussion on the list.
-
-
-
-5. I want to use -r with isdnd but it does not work
-================================================================================
-
-> > Use isdnd in fullscreen mode.
->
-> I tried that already, but got an error when I start isdnd that way:
->
-> /usr/local/bin/isdnd -d 0xf9 -f -r /dev/ttyv1 -t cons25
->
-> root is logged in on device /dev/ttyv1, the message in /var/log/messages looks like:
->
-> "May 22 11:52:28 asterix isdnd[4160]: ERR ERROR, cannot setup tty as controlling terminal: Operation not permitted"
->
-> How can I give this device permission ?
-
-
-In case you want to use switch "-r" noone else _must_ use the tty you redirect
-to, you have to remove the getty from the virtual terminal in /etc/ttys and
-restart the init process.
-
-
-6. How do I configure and run the answering machine (under FreeBSD 2.2.x) ?
-================================================================================
-
-The answering machine will be activated, when isdnd executes the program
-that has been named in "/etc/isdn/isdnd.rc" in the section "telephone
-answering" at entry "answerprog = ". If the program is executed
-without a pathname, the answer program is expected in "/etc/isdn".
-Examples of such programs can be found in "/etc/isdn/samples". They
-are named:
-
- "answer" answers only, no recording
- "record" answers, and records messages
- "tell" the number of the calling person is told,
- no recording.
- "tell-record" calling number as answer, message is recorded
- "isdntel.sh" answers and records messages; by using the
- program "isdntel", one has the control over
- the recorded messages in the directory
- "/var/isdn". Look at "man isdntel" and
- "man isdntelctl".
-
-These programs have to be altered to suit your needs. Unfortunately there
-is no program with which you can record your answer message. This is not
-really bad, because you only have to alter the above mentioned program
-"record" a bit (comment out the "if ... fi" statements for the beep
-and msg messages). You have to create the directory "/var/isdn" first in
-order to record messages. They will be stored in this location then.
-
-Stefan Herrmann <stefan@asterix.webaffairs.net>
-
-
-7. Teles S0/16.3 ... unknown ?
-================================================================================
-Hi,
-
-I have just purchased a Teles S0/16.3 card.
-But it's not what i4b is looking for .... I mean, it's a different card.
-
-The docs (and sources)of i4b talks about a Telws S0/16.3 card with 3
-address: d80 etc.
-
-This one (is not PnP) has jumpers for 0x180 0x280 0x380.
-
-It has the SIemens Chips numbered PSB 21525 N (HSCX TE V2.1) and PSB
-2186N V1.1 (ISAC-S TE).
-
-I undestand that the 16.3c is not supported, but over this board is
-written "TELES.S0/16.3 Revision 1.3"
-
-Can anybody tell me what is this card ???
-
-answer:
--------
-
-It's not a different card. The jumpers are documented to select
-IO-address 0x180, 0x280 or 0x380 in some TELES manuals.
-But in fact they select the addresses 0xd80, 0xe80 or 0xf80.
-
-Wolfgang
-
-
-And an additional note from Poul-Henning Kamp:
-----------------------------------------------
-There is an intricate story behind this, in short some ISA cards
-only decode the first 10 address bits (0x3ff), which over the years
-has resulted in a mutation the "de-facto-spec" such that addressbits
-10-15 can be used by the card for selecting various stuff. This
-is extensively used on obscure cards with massive IO needs, sound,
-IEEE488 and ISDN cards often belong in this category.
-
-
-
-8. How do i integrate a new lowlevel driver into i4b ?
-================================================================================
-
-1) Request a flag value from me
-2) add an entry for the card into FreeBSD/CONFIG
-3) add driver filename to FreeBSD/files.i386.cat
-4) add entry for the card to FreeBSD/options.i386.cat
-5) add support to print type of card to diehl/diehlctl/main.c
-6) add support to print type of card to isdnd/support.c, name_of_controller()
-7) place your file as named in 3) into directory layer1
-8) add the flag value and function prototypes to layer1/i4b_l1.h
-9) add support for NetBSD to layer1/isa_isic.c
-10) add support for attach/probe to layer1/i4b_isic.c
-11) add card type to machine/i4b_ioctl.h and update CARD_TYPEP_MAX
-12) add an entry to the man page man/isic.4
-
-Produce diffs (please use context diffs, flag "-c" for diff) and send them in.
-
-
-9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
-================================================================================
-
-as I wrote about two weeks ago I had massive problems concerning this
-"no space in TX FIFO"-thing,
-
-/kernel: i4b-L1-ph_data_req: No Space in TX FIFO, state = F4 Awaiting Signal
-
-Even though I used a correctly recognized Teles S0/16.3 nonpnp isdncard,
-nothing worked, errormsgs were flooding the console until I rebooted the box.
-
-I decided to play around in the BIOS-settings, I first just set them all
-to default, which didn't work, and then changed lots of things - unfortunately
-I can't remember them. After about hundreds of trial 'n errors I gave up.
-
-A few days ago I just made another attempt, booted the box and to my surprise
-it all worked without the smallest problem, great data rates :)
-
-I tried hard to found what the something special was I changed in the BIOS
-settings, but I just couldnt get isdnd back to its stupid behaviour it
-showed all the time before, but I would recommend everybody who has this
-kind of problem to look into his BIOS.
-
- (from Meike Aulbach, strange@stoned.rhein-main.de)
-
-
-i4b now works for me, I had a USB-device interfering on IRQ 9,
-which was supposed to be only for my Creatix Card.
-(NetBSD 1.3, Creatix)
-
-Strange enough, my DOS s0-test worked, are they just polling the card?
-
-Even when the testsoftware under DOS is working, don't be shure, that
-your hw-setup is correct for xxx(x)BSD. Triplecheck all your IRQ and
-enable and disable PNP to triple-verify. Even unconfigured devices can
-block your card. .....
-
-And that took me more than 2 months to discover :-((((
-
- (from Andreas Lohrum, andreas.lohrum@consol.de)
-
-
-when i changed the mainboard of a box that ran i4b alright, i forgot to
-set 'used by isa' in the pnp-bios-settings for the irq of my teles
-isdn-card. because of that some pci-card got the interrupt that the
-isdn-card should have gotten.
-i then also got this error: 'No space in TX FIFO'.
-
-The reason occurred to my rather quick, but i would think, that this would
-be a nice hint in a FAQ :)
-
- (from Heiko Schaefer, hschaefer@fto.de)
-
-
-after my huge amount of problems, Meike's hint (changing the
-ISA/PNP-settings in the BIOS) finally fixed things.
-I have only tried out this stuff with my Creatix-card, I'll check
-out the PNP-stuff with my Sedlbauer-card soon too though.
-
- (from Harold Gutch, logix@foobar.franken.de)
-
-
-10. Incoming alert - what does it mean ?
-================================================================================
-
-In the log on vty6 (isdnd full screen log) I'm seeing
-
-16.07.98 11:42:35 CHD 00001 rwth rate 90 sec/unit (rate)
-16.07.98 11:42:35 CHD 00001 rwth dialing from 4191236 to 441291234
-16.07.98 11:42:35 CHD 00001 rwth outgoing call proceeding (ctl 0, ch 0)
-16.07.98 11:42:35 CHD 00001 rwth incoming alert <<<<<<<<<<<<<<<
-16.07.98 11:42:35 CHD 00001 rwth outgoing call active (ctl 0, ch 0)
-
-What does this 'incoming alert' mean?
-
-
-It means that it is "ringing" at the remote end.
-
-
-11. How do i change irq's on my teles 16.3 card ?
-================================================================================
-
-Question:
-
-So how do you change irq's on your teles 16.3 card (under FBSD or DOS,
-I don't have and don't want to have Windows running on that computer) ?
-
-Answer:
-
-The irq is configured into the card each time the driver under whatever
-OS you currently boot initializes the card. Thus, change the irq for the
-isic driver in your kernel config file to one of the supported (!) irqs
-for this card (hint: read "man isic") which is currently unused in your
-machine and generate a new kernel.
-
-
diff --git a/share/examples/isdn/Overview b/share/examples/isdn/Overview
deleted file mode 100644
index 2f2fc181a81d..000000000000
--- a/share/examples/isdn/Overview
+++ /dev/null
@@ -1,307 +0,0 @@
-
- Short technical overview of isdn4bsd
- ====================================
-
- Copyright (c) 1998 Hellmuth Michaelis. All rights reserved.
-
- $Id: Overview,v 1.3 1998/10/27 10:28:54 hm Exp $
-
- Last edit-date: [Tue Oct 27 11:26:03 1998]
-
- -hm starting an overview ...
-
-
-Contents:
----------
- Functional block diagram
- Layer 1
- Layer 2
- Layer 3
- Debugging control
- Layer 4
- ISDN protocol trace
-
-
-Functional block diagram
-========================
-
- isdndebug isdnd isdntrace
- +-------+ +----------------------------------------------------+ +--------+
- | | | | | |
- | | | | | |
- +-------+ +----------------------------------------------------+ +--------+
- | | |
- | | |
- | /dev/i4bctl Userland | /dev/i4b /dev/i4btrc<n> |
-===============================================================================
- | Kernel | |
- | | |
- +-------+ +----------------------------------------------------+ +--------+
- | | | | | |
- |i4bctl | | i4b | | i4btrc |
- | (6) | | (7) | | (8) |
- | debug | | Layer 4 - common call control interface | | ISDN |
- |control| | | | trace |
- +:-:-:--+ +----------------------------------------------------+ +--------+
- : : : ^ ^ ^
- : : : Call | various ptr arrays | Call %
- . . . Control | in i4b_l3l4.h | Control %
- V V %
- +----------------------+ +----------------------+ %
- | | | | %
- | i4bq931 | ISDN | active card | %
- | (5) | ##### | %
- | Layer 3 (Q.931) | # | driver | %
- | | # | | %
- +----------------------+ # +----------------------+ %
- ^ # B + %
- | i4b_l2l3_func function # | + +------------+ %
- | ptr array in i4b_l2l3.h # C +++++ isp |----> %
- V # h + +------------+ IP %
- +----------------------+ # a + Subsys %
- | | # n + +------------+ %
- | i4bq921 | # n +++++ ipr |----> %
- | (4) | # e + +------------+ IP %
- | Layer 2 (Q.921) | # l + Subsys %
- | | # + +------------+ %
- +----------------------+ # D +++++ tel/rbch |----> %
- ^ # a + +------------+ to %
- | i4b_l1l2_func function # t + /dev/i4btel<n> %
- | ptr array in i4b_l1l2.h # a + or /dev/i4brbch<n>%
- V # + %
- +----------------------+ # +---------------------+ %
- | | # | | %
- | isic (ISAC part) | D-ch trace # | isic (HSCX part) |B-ch%
- | (2) |%%%%%%%%%%%% # | (3) |%%%%%
- | Layer 1 (I.430) | % # | non-HDLC / HDLC |trc %
- | | % # | | %
- +----------------------+ % # +---------------------+ %
- ^ % # ^ %
- D-channel | % # B-channels | %
- +-----------------------------------------------+ %
- | function ptr in % # %
- | in isic_softc in %%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- V i4b_l1.h #
- +----------------------+ #
- | | #
- | isic | #
- | (1) | #
- | Card hardware driver | #
- | for Teles, AVM, USR | #
- | | #
- +----------#-----------+ #
- # #
- # #
- # #
- # #
- |=========#===============================#============================|
- ISDN S0 bus
-
-
-Layer 1
-=======
-
-(1) A driver for a special card hardware consists of a
- - probe routine
- - attach routine
- - FIFO read
- - FIFO write
- - register read
- - register write
- routines. These routines handle the card/manufacturer specific stuff
- required to talk to a particular card.
-
- This addresses of the read/write routines are put into a arrays found
- in struct isic_softc and they are later called by the macros:
-
- ISAC_READ(r), ISAC_WRITE(r,v), ISAC_RDFIFO(b,s), ISAC_WRFIFO(b,s),
- HSCX_READ(n,r), HSCX_WRITE(n,r,v), HSCX_RDFIFO(n,b,s), HSCX_WRFIFO(n,b,s)
-
- (see file layer1/i4b_l1.h)
-
- Files currently used for this purpose are
- - i4b_avm_a1.c AVM A1 and AVM Fritz!Card drivers
- - i4b_ctx_s0P.c Creatix S0 PnP (experimental!)
- - i4b_tel_s016.c Teles S0/16 and clones
- - i4b_tel_s0163.c Teles S0/16.3
- - i4b_tel_s08.c Teles S0/8 and clones
- - i4b_tel_s0P.c Teles S0/16 PnP (experimental!)
- - i4b_usr_sti.c 3Com USRobotics Sportster
-
-
-(2) The files i4b_isac.c and i4b_isac.h contain the code to control the
- ISAC chip by using the above mentioned macros.
-
- Files i4b_l1.c and i4b_l1.h handle stuff used to access layer 1
- functions from layer 2.
-
- Layer 1 and layer 2 access functionality of each other by using
- a well known function pointer array, which contains addresses of
- "primitives" functions which are defined in I.430 and Q.921. The
- function pointer array for layer 1/2 communication is defined in
- file include/i4b_l1l2.h and is initialized i4b_l1.c at the very
- beginning.
-
- File i4b_isic.c contains the main code for the "isic" device driver.
-
- i4b_l1fsm.c is the heart of layer 1 containing the state machine which
- implements the protocol described in I.430 and the ISAC data book.
-
-
-(3) All above code is used for handling of the D channel, the files
- i4b_bchan.c, i4b_hscx.c and i4b_hscx.h contain the code for handling
- the B-channel, the HSCX is used to interface the userland drivers
- isp, ipr, tel and rbch to one of the B-channels and i4b_hscx.c and
- i4b_hscx.h contain the code to handle it (also by using the above
- mentioned macros). i4b_bchan.c contains various maintenance code for
- interfacing to the upper layers.
-
-
-Layer 2
-=======
-
-(4) Layer 2 implements the LAPD protocol described in Q.920/Q.921. Layer 2
- interfaces to layer 1 by the above described function pointer array,
- where layer 1 calls layer 2 functions to provide input to layer 2 and
- layer 2 calls layer 1 functions to feed data to layer 1.
-
- The same mechanism is used for layer 2 / layer 3 communication, the
- pointer array interface is defined in include/i4b_l2l3.h ad the array
- is initialized at the very beginning of i4b_l2.c which also contains
- some layer 1 and some layer 3 interface routines. As with l1/l2, the
- l2/l3 array also contains addresses for "primitives" functions which
- are specified in Q.920/Q.921 and Q.931.
-
- i4b_l2.h contains the definition of l2_softc_t, which describes the
- complete state of a layer 2 link between the exchange and the local
- terminal equipment.
-
- i4b_l2.c contains the entrance of data from layer 1 into the system,
- which is split up in i4b_ph_data_ind() into the 3 classes of layer 2
- frames called S-frame, I-frame and U-frame. They are handled in files
- i4b_sframe.c, i4b_iframe.c and i4b_uframe.c together with the respective
- routines to send data with each ones frame type.
-
- i4b_l2timer.c implements the timers required by Q.921.
-
- i4b_tei.c contains the TEI handling routines.
-
- i4b_lme.c implements a rudimentary layer management entity.
-
- i4b_util.c implements the many utility functions specified
- in Q.921 together wit some misc routines required for overall
- functionality.
-
- i4b_mbuf.c handles all (!) requests for mbufs and frees all mbufs used
- by the whole isdn4bsd kernel part. It should probably be moved else-
- where.
-
- i4b_l2fsm.c and i4b_l2fsm.h contain the heart of layer 2, the state-
- machine implementing the protocol as specified in Q.921.
-
-Layer 3
-=======
-
-(5) i4b_l2if.c and i4b_l4if.c contain the interface routines to communicate
- to layer 2 and layer 4 respectively.
-
- i4b_l3timer.c implements the timers required by layer 3.
-
- i4b_q931.c and i4b_q931.h implement the message and information element
- decoding of the Q.931 protocol.
-
- i4b_q932fac.c and i4b_q932fac.h implement a partial decoding of facility
- messages and/or information elements; the only decoding done here is
- the decoding of AOCD and AOCE, advice of charge during and at end of
- call.
-
- As usual, i4b_l3fsm.c and i4b_l3fsm.h contain the state machine required
- to handle the protocol as specified in Q.931.
-
- Layer 3 uses a structure defined in include/i4b_l3l4.h to store and
- request information about one particular isdncontroller, it is called
- ctrl_desc_t (controller descriptor). It contains information on the
- state of a controller (controller ready/down and which B channels are
- used or idle) as well as a pointer array used for communication of
- layer 4 with layer 3: layer 3 "knows" the routines to call within
- layer 4 by name, but in case layer 4 has to call layer 3, several
- possibilities exist (i.e. active / passive cards) so it has to call
- the routines which the ISDN controller had put into the the function
- pointer array (N_CONNECT_REQUEST, N_CONNECT_RESPONSE etc) at init time.
-
- Layer 3 shares a structure called call_desc_t (call descriptor) with
- layer 4. This structure is used to describe the state of one call. The
- reference to layer 3 is the Q.931 call reference value, the reference to
- layer 4 (and the isdn daemon, isdnd) is the cdid, an unique integer
- value uniquely describing one call, the call descriptor id.
- This structure is used to build an array of this structures
- (call_desc[N_CALL_DESC]), which must be large enough to hold as many
- calls as there are B channels in the system PLUS a reserve to be able
- to handle incoming SETUP messages although all channels are in use.
-
- More, this structure contains the so called "link table pointers"
- (isdn_link_t *ilt and drvr_link_t *dlt) which contain function pointers
- to "link" a B-channel (better the addresses of functions each participant
- needs to access each others functionality) after a successful call setup
- to a userland driver (such as isp, ipr, rbch or tel) to exchange user
- data in the desired protocol and format.
-
-Debugging control
-=================
-
-(6) the device driver for /dev/i4bctl in conjunction with the userland
- program isdndebug(8) is used to set the debug level for each of the
- layers and several other parts of the system, information how to use
- this is contained in machine/i4b_debug.h and all parts of the kernel
- sources. It is only usable for passive cards.
-
-
-Layer 4
-=======
-
-(7) Layer 4 is "just" an abstraction layer used to shield the differences
- of the various possible Layer 3 interfaces (passive cards based on
- Siemens chip-sets, passive cards based on other chip-sets, active cards
- from different manufacturers using manufacturer-specific interfaces)
- and to provide a uniform interface to the isdnd userland daemon, which
- is used to handle all the required actions to setup and close calls
- and to the necessary retry handling and management functionality.
-
- Layer 4 communicates with the userland by using a well defined protocol
- consisting of "messages" sent to userland and which are read(2) by the
- isdnd. The isdnd in turn sends "messages" to the kernel by using the
- ioctl(2) call. This protocol and the required messages for both
- directions are documented in the machine/i4b_ioctl.h file and are
- implemented in files i4b_i4bdrv.c and i4b_l4.c, the latter also
- containing much of the Layer 4 interface to the lower layers.
-
- i4b_l4mgmt.c contains all the required routines to manage the above
- mentioned call descriptor id (cdid) in conjunction with the call
- descriptor (array) and the call reference seen from layer 3.
-
- i4b_l4timer.c implements a timeout timer for Layer 4.
-
-
-ISDN protocol trace
-===================
-
-(8) ISDN D-channel protocol trace for layers 2 and 3 is possible by using
- hooks in the ISAC handling routines.
-
- In case D-channel trace is enabled, every frame is prepended with a
- header containing further data such as a time stamp and sent via the
- i4btrc driver found in driver/i4b_trace.c to one of the /dev/i4btrc<n>
- devices, where <n> corresponds to a passive controller unit number.
-
- If desired, B-channel data can be made available using the same
- mechanism - hooks in the HSCX handler send data up to the i4btrc
- device.
-
- The raw data is then read by the isdntrace userland program which
- decodes the layer 2 and/or layer 3 protocol and formats it to be
- easily readable by the user.
-
- B-channel data is not interpreted but dumped as a hex-dump.
-
-
-/* EOF */
diff --git a/share/examples/isdn/README b/share/examples/isdn/README
deleted file mode 100644
index 6a84fe84eaa1..000000000000
--- a/share/examples/isdn/README
+++ /dev/null
@@ -1,457 +0,0 @@
-
-
-Note: This is the README from the isdn4bsd 0.70.00 ftp-distribution. Shortly
- after release, i4b was integrated into the FreeBSD sourcetree and so
- the following parts about FreeBSD may not apply anymore.
-
- For information of how isdn4bsd is integrated into FreeBSD now, please
- read the file ROADMAP in this directory.
-
-
---------------------------------------------------------------------------------
-
- ISDN4BSD
- ========
-
- beta Version 0.70.00 / December 1998
-
- written by:
-
- Hellmuth Michaelis
- Hallstrasse 20
- D-25462 Rellingen
-
- voice: +49 4101 473574
- fax: +49 4101 473575
- email: hm@kts.org
-
- -----
-
- The isdn4bsd package is:
-
- Copyright (c) 1997, 1998 by Hellmuth Michaelis. All rights reserved.
-
- For details see the file LICENSE.
-
- -----
-
- ISDN4BSD would not be what it is without
- the help and support of many people,
- see file ACKNOWLEDGMENTS !
-
- -----
-
- Vote with your wallet: in case you want to buy new ISDN hardware,
- buy it from manufacturers who support the development of i4b,
- for a list of supporters have a look at file ACKNOWLEDGMENTS!
-
- -----
-
- This package is postcard-ware:
- ==============================
-
- The license fee for using isdn4bsd is sending a picture postcard
- of your home town. My address can be found at the top of this file.
-
-
---------------------------------------------------------------------------------
-
-Contents:
----------
- 1. Disclaimer
- 2. What is ISDN4BSD ?
- 3. Which BSD's are supported ?
- 4. Which ISDN cards are supported ?
- 5. Where do i find documentation for ISDN4BSD ?
- 6. How do i install ISDN4BSD ?
- 7. Where do i get support for ISDN4BSD ?
- 8. Where do i get commercial support for ISDN4BSD ?
- 9. How can i help and/or support ISDN4BSD ?
- 10. How do i report bugs ?
- 11. Is there a mailing-list available for ISDN4BSD ?
- 12. Where can i get ISDN4BSD ?
- 13. What is the reward for reading everything in this file ?
-
-
-1. Disclaimer:
---------------
-
- It may be illegal in your country to connect an ISDN4BSD based machine
- using a passive ISDN card to the ISDN at your site because the protocol
- stack of ISDN4BSD, which is necessary to run passive cards, has not been
- approved by the telecommunication certification authority of your country.
- If in doubt, please contact your local ISDN provider !
-
-
- 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.
-
-
-2. What is ISDN4BSD ?
----------------------
-
-ISDN4BSD (or in short i4b) is a package for interfacing a computer running
-FreeBSD, NetBSD or OpenBSD to the ISDN.
-
-The only ISDN protocol currently supported is the BRI protocol specified in
-I.430, Q.921 and Q.931; better known as DSS1 or Euro-ISDN.
-
-ISDN4BSD allows you to make IP network connections by using either IP packets
-sent in raw HDLC frames on the B channel or by using synchronous PPP.
-
-For telephony, ISDN4BSD can answer incoming phone calls like an answering
-machine.
-
-
-3. Which BSD's are supported ?
-------------------------------
-
-FreeBSD:
- You need FreeBSD 2.2.6 and higher to run i4b out-of-the-box.
-
- This is because PnP support is now available in i4b and
- FreeBSD 2.2.6 was the first version which included PnP support
- in the base OS.
-
- In case you want to install i4b on FreeBSD < 2.2.6, you have to
- patch your system with the PnP patches from Luigi Rizzo (available
- from his home page at http://www.iet.unipi.it/~luigi).
-
- The install/uninstall script in the FreeBSD directory was tested
- with 2.2.7 (it should run with 2.2.n, where n >= 6), 3.0-RELEASE
- and 3.0-CURRENT as of Dec 22, 1998.
-
- Please take the time to read the file FreeBSD/INSTALLATION (and
- the other available documentation) carefully. Thank you!
-
-
-NetBSD/i386:
-
- Important note for i4b users on NetBSD/i386:
- ============================================
-
- While the previous releases of i4b mainly supported the latest
- official releases, this new release now depends on NetBSD-current
- (1.3G or newer). The old stuff is still there, just in case you
- are running an older version, but you need to read the installation
- instructions in NetBSD/INSTALLATION carefully!
- This step was necessary as installation now differs a lot since i4b
- has some prerequisites officially included in -current.
-
- ---------
-
- The NetBSD specific support and the Diehl driver was written by
- Martin Husemann, (martin@rumolt.teuto.de). Since i do not intend
- to run NetBSD and/or Diehl cards, i suggest contacting him in
- case of problems in this two areas.
- Martin has NetBSD/i386 1.3 running and is supporting ISDN4BSD for
- that platform as his time permits it.
-
-NetBSD/Amiga:
- The NetBSD/Atari 1.3F specific support was done by Ignatios Souvatzis,
- (is@netbsd.org).
-
-NetBSD/Atari:
- The NetBSD/Atari 1.3 specific support was done by Leo Weppelman,
- (leo@wau.mis.ah.nl).
-
-OpenBSD/i386:
- The OpenBSD/i386 2.2 specific support was done by Bas Oude Nijeweme
- (bon@serious.xs4all.nl). He reports that it is also running fine
- under OpenBSD 2.3. Known to work under OpenBSD is currently the
- Teles 16.3 and the Teles S0/16, reports for other cards welcome!
-
- NOTICE:
- Isdn4bsd version 0.70 has not been tested with OpenBSD at all,
- it would be great to have someone who likes to work on i4b under
- OpenBSD regularly and takes over the maintenance for that OS!
-
-
-4. Which ISDN cards are supported ?
------------------------------------
-
- Type (passive, ISA) FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- AVM A1 full full
- AVM Fritz!Card full full (Note 1)
- Creatix ISDN-S0/8 full full ( = Teles S0/8 )
- Creatix ISDN-S0/16 full full ( = Teles S0/16 )
- Dr.Neuhaus Niccy 1008 full full ( = Teles S0/8 )
- Dr.Neuhaus Niccy 1016 full full ( = Teles S0/16 )
- ITK ix1 micro full full (Note 13)
- Stollmann Tina-pp full full
- Teles S0/8 full full
- Teles S0/16 full full
- Teles S0/16.3 full full (Note 4)
- 3Com/USR SportsterInt full full ( = Stollmann Tina-pp )
-
- Type (passive, PnP) FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- Asuscom I-IN100-ST-DV experimental unsupported ( = Dynalink IS64PH )
- Creatix ISDN-S0 PnP full full (Note 2)
- Dr.Neuhaus Niccy GO@ full full (Note 2)
- Dynalink IS64PH full full (Note 11)
- ELSA 1000pro ISA full full (Note 3)
- Sagem Cybermod full full ( = Niccy GO@ )
- Sedlbauer Win Speed full full (Note 9)
- Teles S0 PnP experimental full (Note 5)
- 3Com USR PnP internal unsupported unsupported (under development)
-
- Type (passive, PnP) FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- ELSA 1000pro PCI full full
-
- Type (passive, PCMCIA)FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- AVM Fritz!Card PCMCIA full experimental (Note 10)
- ELSA PCMCIA unsupported unsupported (under development)
-
- Type (passive, Amiga) FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- ISDN Blaster unsupported experimental (Note 12, Amiga/NetBSD)
- ISDN Master unsupported experimental (Note 12, Amiga/NetBSD)
-
- Type (active) FreeBSD NetBSD/OpenBSD Notes
- --------------------- ------- -------------- -----------------------
- AVM B1 unsupported unsupported (Note 6)
- DiehlS,SX,SCOM,QUATRO unsupported unsupported (Note 7)
- Miro P1 unsupported unsupported ( = Tina-dd )
- Stollmann Tina-dd unsupported unsupported (Note 8)
-
-
-Note 1: Only the ISA, non-PnP AVM Fritz!Card is supported; the PnP and PCI
- versions are unsupported! The "Teledat 150" sold by the german
- Telekom seems to be an AVM Fritz!Card.
-
-Note 2: FreeBSD
- This is a PnP card. To run it under FreeBSD, you need
- FreeBSD 2.2.6 RELEASE or higher.
- NetBSD
- The NetBSD version has not been verified to work yet.
-
-Note 3: Due to its design, this card produces 128 IRQs/sec. This can be
- reportedly stopped by disconnecting pin 12 of the 7474 and wiring
- it to pin 15 of the 74175. Be careful! This procedure has not been
- verified and doing this will immediately terminate your warranty !!
- The card will not function anymore with drivers for other OSes and
- you may not get any further support from the manufacturer! YMMV!
-
-Note 4: Only the 16.3 is supported; the 16.3c and the 16.3 PnP are currently
- unsupported !
-
-Note 5: The card has not been verified to work yet.
-
-Note 6: This driver is currently under development by Gary Jennejohn who
- develops under FreeBSD only.
-
-Note 7: This driver is currently under construction by Martin Husemann who
- develops under NetBSD only.
-
-Note 8: This driver is currently under development by Hellmuth Michaelis who
- develops under FreeBSD only.
-
-Note 9: This driver was developed by German Tischler, tanis@gaspode.franken.de.
- Please contact him in case of trouble. The "Teledat 100" sold by the
- german Telekom is identical with this card.
-
-Note 10: This driver is developed by Matthias Apitz, matthias.apitz@sisis.de.
- FreeBSD
- Please contact him in case of trouble.
- Please read the file README.PCCARD in the i4b distribution for
- additional installation instructions.
- NetBSD
- Experimental driver support by Martin Husemann.
-
-Note 11: This driver was developed by Martijn Plak (tigrfhur@xs4all.nl)
- Please contact him in case of trouble. This driver might also work
- for Asuscom cards. (Andrew Gordon wrote: Just to let you know that
- I've now tried the i4b "dynalink" driver with the ASUSCOM
- I-IN100-ST-DV card, and it appears to work fine.)
-
-Note 12: This driver was developed by Ignatios Souvatzis (is@netbsd.org)
- Please contact him in case of trouble.
- This driver is supposed to work on the ISDN Master versions and
- lookalikes, like the ISDN Blaster.
-
-Note 13: This driver was developed by Martin Husemann under NetBSD and has
- not been tested under FreeBSD yet. Feedback welcome!
-
-
-5. Where do i find documentation for ISDN4BSD ?
------------------------------------------------
-
-- For installation instructions have a look under the the FreeBSD, NetBSD
- and OpenBSD directories, each of these contains a file "INSTALLATION"
- which describes the installation procedure for isdn4bsd on those operating
- systems.
-
-- Every program has a man page in the respective subdirectory and every
- driver has a man page in the "man" subdirectory. All the man pages are
- installed by running "make install" so its very easy to access them
- (hint: try "apropos isdn4bsd" after you installed isdn4bsd, it displays
- all available manual pages).
-
-- misc/Overview contains a short technical overview of the inner workings
- of isdn4bsd.
-
-- misc/Resources contains URL's and ISBN's to more interesting ISDN related
- stuff.
-
-- handbook/i4b.ps is the start of a handbook for isdn4bsd.
-
-
-6. How do i install ISDN4BSD ?
-------------------------------
-
-Read the instructions in the file {FreeBSD|NetBSD|OpenBSD}/INSTALLATION.
-
-In case they are incomplete, unclear, wrong or outdated, please send me an
-update for inclusion into a future distribution!
-
-
-7. Where do i get support for ISDN4BSD ?
-----------------------------------------
-
-I will support and help with ISDN4BSD as my time permits it. Please
-keep in mind that in this case support is given on a voluntary basis
-and your questions might not be answered immediately.
-
-Also, i recommend subscribing to the mailing list mentioned below.
-
-Due to the experience gained supporting the predecessor of ISDN4BSD, let
-me please clearly state that there is no guarantee that your bug will be
-fixed within some specific amount of time, in fact there is no guarantee
-that your bug will be fixed at all; i'll do my best but there might be
-more important things going on in my life than giving free support for
-ISDN4BSD. Some bugs seem to occur only in certain environments and are
-not reproduceable here without access to the equipment you are connected
-to or other equipment like ISDN simulators (which i don't get access to
-for free): in this case you are the only person being able to trace down
-the bug and fix it.
-
-
-8. Where do i get commercial support for ISDN4BSD ?
-----------------------------------------------------
-
-In case you want to pay for support, maintenance, enhancements, extensions
-to isdn4bsd or whatever else you may need, it is possible to hire me for
-reasonable rates through my employer HCS GmbH; in this case please contact
-me for details at hm@hcs.de or look at http://www.freebsd-support.de.
-
-
-9. How can i help and/or support ISDN4BSD ?
--------------------------------------------
-
-I would really like to hear from you! (even if it runs out of the box :-)
-
-I'm open for suggestions, bugreports, fixes, patches, enhancements and
-comments to improve ISDN4BSD.
-
-Please send flames to /dev/null and/or start writing your own ISDN package.
-
-ISDN4BSD is a project on a voluntary basis and writing and supporting
-communication systems like ISDN4BSD costs much money and much time.
-
-Any contribution in terms of equipment, cards, documentation, cash
-and/or daytime payed work on ISDN4BSD would be highly appreciated.
-
-You can help by not only reporting bugs, but by sending in a patch for
-the problem together with a bugreport.
-
-In case you cannot fix something yourself, please describe your problem
-as detailed as possible, include information which version of an operating
-system you are running, which ISDN board you are using, to which kind
-of ISDN equipment (like the brand of PBX) you are connected etc. etc.
-
-In case you want to get a currently unsupported card supported, write a
-low level driver for it yourself and submit it. In case you can't write
-it yourself there is a good chance to get it supported if you can donate
-one of those cards and - if at all possible - docs for it.
-
-
-10. How do i report bugs ?
---------------------------
-
-Please submit patches ONLY as context diffs (diff -c)!
-
-I vastly prefer receiving bug fixes and enhancements that are clearly
-differentiated. I don't always know what to do with large patches that
-contain many bugs and enhances folded into the same context diffs.
-
-Please keep it to one fix or enhancement per patch!
-
-If your change modifies the external interface of an ISDN4BSD program,
-i.e. more config options, command-line switches, new programs, etc.,
-then please also include patches for the manual pages and documentation.
-
-Thank you!
-
-
-11. Is there a mailing-list available for ISDN4BSD ?
----------------------------------------------------
-
-There is a mailing list available at
-
- freebsd-isdn@freebsd.org
-
-The list is maintained by majordomo, so i.e. to subscribe,
-send a mail with the text
-
- subscribe freebsd-isdn
-
-in the message body sent to
-
- majordomo@freebsd.org
-
-This mailing list is NOT (!) FreeBSD specific, everyone is welcome there!
-
-
-12. Where can i get ISDN4BSD ?
-------------------------------
-
-The ISDN4BSD package is available from:
-
- isdn4bsd@ftp.consol.de/pub
- --------------------------
-
-you have to log in as user
-
- isdn4bsd
- --------
-
-and give your mail address as the password. Then change to the "pub"
-directory. You will find the latest available ISDN4BSD package.
-
-Anonymous ftp as user "ftp" or "anonymous" will NOT (!) give the desired
-result !
-
-This is a sample session:
-
- $ ftp ftp.consol.de
- Connected to stage.consol.de.
- 220 ProFTPD 1.0.0 Server (ConSol* Data Exchange) [stage]
- Name (ftp.consol.de:root): isdn4bsd
- 331 Anonymous login ok, send your complete e-mail address as password.
- Password:
- 230 Anonymous access granted, restrictions apply.
- Remote system type is UNIX.
- Using binary mode to transfer files.
- ftp> cd pub
- 250 CWD command successful.
- ftp>
-
-
-13. What is the reward for reading everything in this file ?
-------------------------------------------------------------
-
-Have fun!
-hellmuth
diff --git a/share/examples/isdn/ROADMAP b/share/examples/isdn/ROADMAP
deleted file mode 100644
index 54f6721b5fb8..000000000000
--- a/share/examples/isdn/ROADMAP
+++ /dev/null
@@ -1,75 +0,0 @@
-
- Roadmap of isdn4bsd as integrated into FreeBSD
- ==============================================
-
- $Id:$
-
- last edit-date: [Mon Jan 18 14:47:09 1999]
-
-
-1. Documentation
----------------------
-
- The command "apropos isdn" will list all manpages available for
- isdn4bsd. Two more manual pages of interest to syncronous PPP
- over ISDN users are the pages for sppp and spppcontrol.
-
- Under directory /usr/share/examples/isdn, you will find:
-
- FAQ - isdn4bsd Frequently Asked Questions
- Overview - short technical overview (a bit outdated)
- README - the original isdn4bsd README file
- ROADMAP - this file
- Resources - some more information about ISDN
- isdnd_acct - perl script to produce accounting reports
-
-
-2. Configuration
----------------------
-
- Configuration of the isdn4bsd package consists of:
-
- - configuring a kernel suitable for running isdn4bsd. An
- example kernel configuration can be found in the file
- /usr/src/sys/i386/conf/LINT. The options available for
- isic device driver in the kernel configuration file are
- described in the output of "man isic".
-
- - configuring the network interfaces iprX and/or ispX; the
- former are used for "IP over raw HDLC" and the latter are
- used for "sync PPP over ISDN". To configure the ipr-
- interfaces, read the output of "man i4bipr", to configure
- the isp-interfaces, read the output of "man i4bisppp",
- "man sppp" and "man spppcontrol" carefully.
- Most of this configuration is now available thru the ISDN
- and spppcontrol sections in /etc/rc.conf.
-
- - writing a configuration file /etc/isdn/isdnd.rc for the
- isdn daemon isdnd(8) which is responsible for the ISDN
- call control mechanisms such as: dial on demand, dial
- retry, dial recovery, timeout and short hold operation.
- A sample (!) file can be found in /etc/isdn. Please read
- the output of "man isdnd" and "man isdnd.rc" carefully.
-
-
-2. Userland programs
--------------------------
-
- The userland programs can be found in the sourcetree under
- /usr/src/usr.sbin/i4b and get installed under /usr/sbin.
-
- Isdntest will not be installed by default.
-
-
-3. Kernel part
--------------------
-
- The kernel part of isdn4bsd can be found at /usr/src/sys/i4b.
-
-
-4. Answering machine messages
-----------------------------------
-
- Messages to be used by the answering machine can be found in
- /usr/share/isdn, you'll find the numbers 0 to 9, a beep and
- a short announcement message here.
diff --git a/share/examples/isdn/Resources b/share/examples/isdn/Resources
deleted file mode 100644
index 97296d232531..000000000000
--- a/share/examples/isdn/Resources
+++ /dev/null
@@ -1,90 +0,0 @@
-
-Doku: Anwahl von T-Offline mittels i4b und FreeBSD (german)
-===========================================================
-
- http://www.de.freebsd.org/de/i4b-t-error.html
-
-
-ISDN Information:
-=================
-
- http://www.alumni.caltech.edu/~dank/isdn/
-
-
-ITU Standards:
-==============
-
- http://www-library.itsi.disa.mil/org/ituccitt.html
- ftp://ftp.leo.org/pub/comp/doc/standards/itu
-
-
-SunShine Project - Implementation of the ISDN recommendations Q.921 & Q.931
-===========================================================================
-
- http://www.tcm.hut.fi/~bos/ISDN/sunshine/SunShine.html
-
-
-CAPI 2.0 documentation
-======================
-
- http://www.capi.org
-
-
-Siemens ISDN chips Databooks (ISAC/HSCX)
-========================================
-
- general:
- --------
- http://w2.siemens.de/semiconductor/products/ICs/33/33.htm
- http://www.smi.siemens.com/applications/comm/isdnte/index.html
-
- ISAC:
- -----
- http://w2.siemens.de/semiconductor/products/ICs/33/isac_ste/iste_11m.pdf
- http://www.smi.siemens.com/pdf/comm/peb2085_6um.pdf
- http://www.smi.siemens.com/pdf/comm/psb2186um.pdf
-
- HSCX:
- -----
- http://w2.siemens.de/semiconductor/products/ICs/33/hscx/sab82525.pdf
- http://www.smi.siemens.com/pdf/comm/SAB82526_5.pdf
- http://www.smi.siemens.com/pdf/comm/psb21525um.pdf
-
-
-CD's:
-=====
- The Infomagic Standards CDROM:
- http://www.infomagic.com/catalog5.htm#standards
-
-Books:
-======
-
- "ISDN: concepts, facilities and services",
- Gary C. Kessler, McGraw-Hill 1993,
- ISBN 0-07-034247-4
-
- "Integrated services digital networks: architectures, protocols, standards",
- Herman J. Helgert, Addison-Wesley 1991,
- ISBN 0-201-52501-1
-
- "ISDN and Broadband ISDN with Frame Relay and ATM",
- William Stallings, Prentice Hall 1995,
- ISBN 0-02-415513-6
-
- "Technik der Netze",
- Gerd Siegmund, R. v. Decker's Verlag 1996,
- ISBN 3-7685-2495-7
-
- "Euro-ISDN fuer Anwender und Techniker"
- Reinhard Heermeyer und Maria Spath, Festo DIDACTIC 1996,
- ISBN 3-8127-4334-5
-
- "ISDN implementors guide: standards, protocols & services",
- Charles K. Summers, McGraw-Hill 1995,
- ISBN 0-07-069416-8
-
- "PPP Design and Debugging",
- James Carlson, Addison-Wesley 1998,
- ISBN 0-0201-18539-3
-
--- EOF -----------------------------------------------------------------------
diff --git a/share/examples/isdn/isdnd_acct b/share/examples/isdn/isdnd_acct
deleted file mode 100644
index faefaa55f85b..000000000000
--- a/share/examples/isdn/isdnd_acct
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/perl
-#---------------------------------------------------------------------------
-#
-# Copyright (c) 1996, 1998 Hellmuth Michaelis. 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.
-#
-#---------------------------------------------------------------------------
-#
-# accounting report script for the isdnd daemon accounting info
-# -------------------------------------------------------------
-#
-# $Id: isdnd_acct,v 1.1 1998/01/23 13:38:53 hm Exp $
-#
-# last edit-date: [Mon Jan 18 14:08:10 1999]
-#
-#---------------------------------------------------------------------------
-
-# where the isdnd accounting file resides
-$ACCT_FILE = "/var/log/isdnd.acct";
-
-# the charge for a unit, currently 0,12 DM
-$UNIT_PRICE = 0.12;
-
-# open accounting file
-open(IN, $ACCT_FILE) ||
- die "ERROR, cannot open $ACCT_FILE !\n";
-
-# set first thru flag
-$first = 1;
-
-# process file line by line
-while (<IN>)
-{
- # remove ( and ) from length and bytecounts
- tr/()//d;
-
- # split line into pieces
- ($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
- = split(/ /, $_);
-
- # get starting date
- if($first)
- {
- $from = "$from_d $from_h";
- $first = 0;
- }
-
- # split bytecount
- ($inb, $outb) = split(/\//, $byte);
-
- # process fields
- $a_secs{$name} += $secs;
- $a_calls{$name}++;
- $a_units{$name} += $units;
- $a_charge{$name} += $units * $UNIT_PRICE;
- $a_inbytes{$name} += $inb;
- $a_outbytes{$name} += $outb;
- $a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
-}
-
-# close accouting file
-close(IN);
-
-# write header
-print "\n";
-print " ISDN Accounting Report ($from -> $to_d $to_h)\n";
-print " ==================================================================\n";
-
-#write the sum for each interface/name
-foreach $name (sort(keys %a_secs))
-{
- $o_secs = $a_secs{$name};
- $gt_secs += $o_secs;
- $o_calls = $a_calls{$name};
- $gt_calls += $o_calls;
- $o_units = $a_units{$name};
- $gt_units += $o_units;
- $o_charge = $a_charge{$name};
- $gt_charge += $o_charge;
- $o_inbytes = $a_inbytes{$name};
- $gt_inbytes += $o_inbytes;
- $o_outbytes = $a_outbytes{$name};
- $gt_outbytes += $o_outbytes;
- $o_bytes = $a_bytes{$name};
- $gt_bytes += $o_bytes;
- write;
-}
-
-$o_secs = $gt_secs;
-$o_calls = $gt_calls;
-$o_units = $gt_units;
-$o_charge = $gt_charge;
-$o_inbytes = $gt_inbytes;
-$o_outbytes = $gt_outbytes;
-$o_bytes = $gt_bytes;
-$name = "Total";
-
-print "======= ====== ===== ===== ======== ============ ============ ============\n";
-write;
-
-print "\n\n";
-exit;
-
-# top of page header
-format top =
-
-Name charge units calls secs inbytes outbytes bytes
-------- ------ ----- ----- -------- ------------ ------------ ------------
-.
-
-# record template
-format STDOUT =
-@<<<<<< @##.## @#### @#### @####### @########### @########### @###########
-$name, $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
-.
-
-# EOF
diff --git a/share/examples/kld/Makefile b/share/examples/kld/Makefile
deleted file mode 100644
index 68504bdbeb84..000000000000
--- a/share/examples/kld/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-# 08 Nov 1998
-#
-# Makefile for sample programs for kld modules package
-#
-# 08 Nov 1998 Rajesh Vaidheeswarran - adapted from lkm Makefile
-#
-# Copyright (c) 1998 Rajesh Vaidheeswarran
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Rajesh Vaidheeswarran.
-# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
-#
-# Copyright (c) 1993 Terrence R. Lambert.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Terrence R. Lambert.
-# 4. The name Terrence R. Lambert may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
-#
-
-SUBDIR= cdev syscall
-
-.include <bsd.subdir.mk>
diff --git a/share/examples/kld/cdev/Makefile b/share/examples/kld/cdev/Makefile
deleted file mode 100644
index 8acbdf991fea..000000000000
--- a/share/examples/kld/cdev/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-# 08 Nov 1998
-#
-# Makefile for sample kld device driver..
-#
-# May 93 Rajesh Vaidheeswarran
-#
-# Copyright (c) 1998 Rajesh Vaidheeswarran
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Rajesh Vaidheeswarran.
-# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
-#
-# Copyright (c) 1993 Terrence R. Lambert.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Terrence R. Lambert.
-# 4. The name Terrence R. Lambert may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
-#
-
-SUBDIR= module test
-
-load: _SUBDIRUSE
-
-unload: _SUBDIRUSE
-
-.include <bsd.subdir.mk>
diff --git a/share/examples/kld/cdev/README b/share/examples/kld/cdev/README
deleted file mode 100644
index 2f1114c6bf36..000000000000
--- a/share/examples/kld/cdev/README
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright (c) 1998 Rajesh Vaidheeswarran
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Rajesh Vaidheeswarran
-# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
-#
-# Copyright (c) 1993 Terrence R. Lambert.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Terrence R. Lambert.
-# 4. The name Terrence R. Lambert may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
-#
-
-1.0 Overview
-
- This is the README file for the sample kld module
- that mimics a character device driver.
-
- A kld module may be used to load any data or
- program into the kernel that can be made available by
- modifying a table, pointer, or other kernel data to inform
- the kernel that the module should be used instead of the
- previous code/data path.
-
- Generally, it is assumed that a loadable module is one of
- a set of similar modules (such as a file system or console
- terminal emulation), and that the reference is through a
- table (such as vfssw[]), and that a "special" value is
- assigned to the slots which are allowed to be replaced.
- This is not enforced, so you may use the kld module
- any way you see fit.
-
- As with the loadable system calls, it may be desirable to
- allow the module loader to replace an *existing* entry to
- try out changes to kernel code without rebuilding and
- booting from the new kernel.
-
-
-2.0 Directions
-
- To test the module, do the following:
-
- cd module
- make load
-
- A load message (the copyright) will be printed on the console.
-
- cd ../test
- make load
-
- The system call prints a message on the console when called.
- This message will be printed when running "make load" in
- the "test" subdirectory.
-
-
-3.0 Recovering resources
-
- The module consumes memory when loaded; it can be freed up by
- unloading it. To unload it, type the following from the directory
- this file is in:
-
- cd module
- make unload
-
- The miscellaneous module will be unloaded by name.
-
-
-4.0 END OF DOCUMENT
diff --git a/share/examples/kld/cdev/module/Makefile b/share/examples/kld/cdev/module/Makefile
deleted file mode 100644
index aa07686853d2..000000000000
--- a/share/examples/kld/cdev/module/Makefile
+++ /dev/null
@@ -1,91 +0,0 @@
-# 08 Nov 1998
-#
-# Makefile for kld char device driver.
-#
-# 08 Nov 1998 Rajesh Vaidheeswarran
-#
-# Copyright (c) 1998 Rajesh Vaidheeswarran
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Rajesh Vaidheeswarran.
-# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
-#
-# $Id: Makefile,v 1.5 1998/11/08 22:31:00 rv Exp $
-#
-# Copyright (c) 1993 Terrence R. Lambert.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Terrence R. Lambert.
-# 4. The name Terrence R. Lambert may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
-#
-
-BINDIR = /tmp
-SRCS = cdev.c cdevmod.c
-KMOD = cdev_mod
-NOMAN = t
-KLDMOD = t
-
-KLDLOAD = /sbin/kldload
-KLDUNLOAD = /sbin/kldunload
-
-CLEANFILES+= ${KMOD}
-
-load: /dev/cdev
- ${KLDLOAD} -v ./${KMOD}
-
-unload:
- rm -f /dev/cdev
- ${KLDUNLOAD} -v -n ${KMOD}
-
-/dev/cdev:
- mknod /dev/cdev c 32 0
-
-.include <bsd.kmod.mk>
diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c
deleted file mode 100644
index 4c9e1397d26b..000000000000
--- a/share/examples/kld/cdev/module/cdev.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* 08 Nov 1998*/
-/*
- * cdev.c
- *
- * 08 Nov 1998 Rajesh Vaidheeswarran
- *
- * Copyright (c) 1998 Rajesh Vaidheeswarran
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Rajesh Vaidheeswarran.
- * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
- *
- * Copyright (c) 1993 Terrence R. Lambert.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Terrence R. Lambert.
- * 4. The name Terrence R. Lambert may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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/param.h>
-#include <sys/systm.h>
-#include <sys/ioccom.h>
-#include "cdev.h"
-
-/*
- * This is the actual code for the system call... it can't be static because
- * it is exported to another part of the module... the only place it needs
- * to be referenced is the sysent we are interested in.
- *
- * To write your own system call using this as a template, you could strip
- * out this code and use the rest as a prototype module, changing only the
- * function names and the number of arguments to the call in the module
- * specific "sysent".
- *
- * You would have to use the "-R" option of "ld" to ensure a linkable file
- * if you were to do this, since you would need to combine multiple ".o"
- * files into a single ".o" file for use by "modload".
- */
-
-#define CDEV_IOCTL1 _IOR('C', 1, u_int)
-
-int
-mydev_open(dev_t dev, int flag, int otyp, struct proc *procp)
-{
- printf("mydev_open: dev_t=%d, flag=%x, otyp=%x, procp=%p\n",
- dev, flag, otyp, procp);
- return (0);
-}
-
-int
-mydev_close(dev_t dev, int flag, int otyp, struct proc *procp)
-{
- printf("mydev_close: dev_t=%d, flag=%x, otyp=%x, procp=%p\n",
- dev, flag, otyp, procp);
- return (0);
-}
-
-int
-mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *procp)
-{
- int error = 0;
-
- printf("mydev_ioctl: dev_t=%d, cmd=%lx, arg=%p, mode=%x procp=%p\n",
- dev, cmd, arg, mode, procp);
-
- switch(cmd) {
- case CDEV_IOCTL1:
- printf("you called mydev_ioctl CDEV_IOCTL1\n");
- break;
- default:
- printf("No such ioctl for me!\n");
- error = EINVAL;
- break;
- }
- return error;
-}
diff --git a/share/examples/kld/cdev/module/cdev.h b/share/examples/kld/cdev/module/cdev.h
deleted file mode 100644
index ae07c342e65d..000000000000
--- a/share/examples/kld/cdev/module/cdev.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* 08 Nov 1998*/
-/*
- * cdev.h - header for sample kld module implementing a character device
- * driver.
- *
- * 08 Nov 1998 Rajesh Vaidheeswarran
- *
- * Copyright (c) 1998 Rajesh Vaidheeswarran
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Rajesh Vaidheeswarran.
- * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
- *
- * Copyright (c) 1993 Terrence R. Lambert.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Terrence R. Lambert.
- * 4. The name Terrence R. Lambert may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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 __CDEV_H_
-#define __CDEV_H_
-
-#include <sys/conf.h>
-
-d_open_t mydev_open;
-d_close_t mydev_close;
-d_ioctl_t mydev_ioctl;
-
-#define CDEV_MAJOR 32
-
-static struct cdevsw my_devsw = {
- mydev_open,
- mydev_close,
- noread,
- nowrite,
- mydev_ioctl,
- nostop,
- nullreset,
- nodevtotty,
- NULL,
- nommap,
- NULL,
- "cdev",
- NULL,
- CDEV_MAJOR
-};
-
-#endif
diff --git a/share/examples/kld/cdev/module/cdevmod.c b/share/examples/kld/cdev/module/cdevmod.c
deleted file mode 100644
index f8440924c2e4..000000000000
--- a/share/examples/kld/cdev/module/cdevmod.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* 08 Nov 1998*/
-/*
- * cdevmod.c - a sample kld module implementing a character device driver.
- *
- * 08 Nov 1998 Rajesh Vaidheeswarran
- *
- * Copyright (c) 1998 Rajesh Vaidheeswarran
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Rajesh Vaidheeswarran.
- * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
- *
- * Copyright (c) 1993 Terrence R. Lambert.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Terrence R. Lambert.
- * 4. The name Terrence R. Lambert may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include "cdev.h"
-
-static int cdev_load(module_t, modeventtype_t, void *);
-
-/*
- * This function is called each time the module is loaded or unloaded.
- * Since we are a miscellaneous module, we have to provide whatever
- * code is necessary to patch ourselves into the area we are being
- * loaded to change.
- *
- * The stat information is basically common to all modules, so there
- * is no real issue involved with stat; we will leave it lkm_nullcmd(),
- * since we don't have to do anything about it.
- */
-
-static int
-cdev_load(mod, cmd, arg)
- module_t mod;
- modeventtype_t cmd;
- void * arg;
-{
- int err = 0;
-
- switch (cmd) {
- case MOD_LOAD:
-
- /* Do any initialization that you should do with the kernel */
-
- /* if we make it to here, print copyright on console*/
- printf("\nSample Loaded kld character device driver\n");
- printf("Copyright (c) 1998\n");
- printf("Rajesh Vaidheeswarran\n");
- printf("All rights reserved\n");
- break; /* Success*/
-
- case MOD_UNLOAD:
- printf("Unloaded kld character device driver\n");
- break; /* Success*/
-
- default: /* we only understand load/unload*/
- err = EINVAL;
- break;
- }
-
- return(err);
-}
-
-/* Now declare the module to the system */
-
-CDEV_MODULE(cdev_mod, CDEV_MAJOR, my_devsw, cdev_load, 0);
diff --git a/share/examples/kld/cdev/test/Makefile b/share/examples/kld/cdev/test/Makefile
deleted file mode 100644
index fa3f9f83a267..000000000000
--- a/share/examples/kld/cdev/test/Makefile
+++ /dev/null
@@ -1,92 +0,0 @@
-# 05 Jun 93
-#
-# Makefile for testmisc
-#
-# 05 Jun 93 Rajesh Vaidheeswarran Original
-#
-# Copyright (c) 1993 Rajesh Vaidheeswarran.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Rajesh Vaidheeswarran.
-# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
-#
-# Copyright (c) 1993 Terrence R. Lambert.
-# 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Terrence R. Lambert.
-# 4. The name Terrence R. Lambert may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
-#
-# $Id: Makefile,v 1.5 1997/02/22 13:55:56 peter Exp $
-#
-PROG= testcdev
-NOMAN=
-
-MODSTAT= /sbin/kldstat
-
-load:
- @echo "This test program will call the sample kld characer device ";
- @echo "driver."
- @echo
- @echo "The sample driver will display a message on the"
- @echo "system console each time an ioctl is sent to it."
- @echo
- @echo
- @echo
- @./testcdev
-
-unload:
- @echo "This test program will cause an error if the driver"
- @echo "has been successfully unloaded by building 'unload' in"
- @echo "the 'module' subdirectory."
- @echo
- ${MODSTAT} -n misc_mod
-
-.include <bsd.prog.mk>
diff --git a/share/examples/kld/cdev/test/testcdev.c b/share/examples/kld/cdev/test/testcdev.c
deleted file mode 100644
index c1aeeba3889c..000000000000
--- a/share/examples/kld/cdev/test/testcdev.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* 08 Nov 1998*/
-/*
- * testmisc.c
- *
- * Test program to call the sample loaded kld device driver.
- *
- * 05 Jun 93 Rajesh Vaidheeswarran Original
- *
- *
- * Copyright (c) 1993 Rajesh Vaidheeswarran.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Rajesh Vaidheeswarran.
- * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
- *
- * Copyright (c) 1993 Terrence R. Lambert.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Terrence R. Lambert.
- * 4. The name Terrence R. Lambert may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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 <stdio.h>
-#include <fcntl.h>
-#include <sys/ioccom.h>
-
-#define CDEV_IOCTL1 _IOR('C', 1, u_int)
-#define CDEV_DEVICE "cdev"
-int
-main()
-{
- int kernel_fd;
- int one;
-
- if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDONLY)) == -1) {
- perror("/dev/" CDEV_DEVICE);
- exit(1);
- }
-
- /* Send ioctl */
- if (ioctl(kernel_fd, CDEV_IOCTL1, &one) == -1) {
- perror("CDEV_IOCTL1");
- } else {
- printf( "Sent ioctl CDEV_IOCTL1 to device /dev/" CDEV_DEVICE "\n");
- }
- exit(0);
-}
diff --git a/share/examples/kld/syscall/Makefile b/share/examples/kld/syscall/Makefile
deleted file mode 100644
index 7ea17df27638..000000000000
--- a/share/examples/kld/syscall/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# Makefile for sample syscall module
-
-SUBDIR= module test
-
-load: _SUBDIRUSE
-
-unload: _SUBDIRUSE
-
-.include <bsd.subdir.mk>
diff --git a/share/examples/kld/syscall/module/Makefile b/share/examples/kld/syscall/module/Makefile
deleted file mode 100644
index 44406f429f3c..000000000000
--- a/share/examples/kld/syscall/module/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Makefile for building the sample syscall module
-
-SRCS = syscall.c
-KMOD = syscall
-KO = ${KMOD}.ko
-KLDMOD = t
-
-KLDLOAD = /sbin/kldload
-KLDUNLOAD = /sbin/kldunload
-
-load: ${KO}
- ${KLDLOAD} -v ./${KO}
-
-unload: ${KO}
- ${KLDUNLOAD} -v -n ${KO}
-
-.include <bsd.kmod.mk>
diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c
deleted file mode 100644
index 1bfb4823fd8c..000000000000
--- a/share/examples/kld/syscall/module/syscall.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (c) 1999 Assar Westerlund
- * 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.
- *
- * $Id$
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/module.h>
-#include <sys/sysent.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-/*
- * The function for implementing the syscall.
- */
-
-static int
-hello (struct proc *p, void *arg)
-{
- printf ("hello kernel\n");
- return 0;
-}
-
-/*
- * The `sysent' for the new syscall
- */
-
-static struct sysent hello_sysent = {
- 0, /* sy_narg */
- hello /* sy_call */
-};
-
-/*
- * The offset in sysent where the syscall is allocated.
- */
-
-static int offset = NO_SYSCALL;
-
-/*
- * The function called at load/unload.
- */
-
-static int
-load (struct module *module, int cmd, void *arg)
-{
- int error = 0;
-
- switch (cmd) {
- case MOD_LOAD :
- printf ("syscall loaded at %d\n", offset);
- break;
- case MOD_UNLOAD :
- printf ("syscall unloaded from %d\n", offset);
- break;
- default :
- error = EINVAL;
- break;
- }
- return error;
-}
-
-SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL);
diff --git a/share/examples/kld/syscall/test/Makefile b/share/examples/kld/syscall/test/Makefile
deleted file mode 100644
index 5968689e31de..000000000000
--- a/share/examples/kld/syscall/test/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# Makefile for simple caller of syscall
-
-PROG = call
-NOMAN = noman
-
-.include <bsd.prog.mk>
diff --git a/share/examples/kld/syscall/test/call.c b/share/examples/kld/syscall/test/call.c
deleted file mode 100644
index 0e4b70e1fa60..000000000000
--- a/share/examples/kld/syscall/test/call.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1999 Assar Westerlund
- * 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.
- *
- * $Id: call.c,v 1.1 1999/01/09 14:26:22 dfr Exp $
- */
-
-#include <stdio.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/module.h>
-
-static void usage (void);
-
-static void
-usage (void)
-{
- fprintf (stderr, "call syscall-number\n");
- exit (1);
-}
-
-int
-main(int argc, char **argv)
-{
- char *endptr;
- int syscall_num;
- struct module_stat stat;
-
- stat.version = sizeof(stat);
- modstat(modfind("syscall"), &stat);
- syscall_num = stat.data.intval;
- return syscall (syscall_num);
-}
diff --git a/share/examples/portal/README b/share/examples/portal/README
deleted file mode 100644
index f3a26909d3f6..000000000000
--- a/share/examples/portal/README
+++ /dev/null
@@ -1,64 +0,0 @@
-
-This contains a couple of examples for using the portal filing system.
-
-The portal file system provides a way of obtaining a file descriptor
-to a filesystem object (i.e. something that is accessed by open(2),
-pipe(2), socket(2) or socketpair(2)) via the filesystem namespace.
-At present the only file descriptor supported are TCP sockets and
-files.
-
-NOTE!!!! The portal file system is experimental in nature and should
-not be considered secure, use with caution.
-
-First off mount the filesystem using something like:
-
-# mount_portal /usr/share/examples/portal/portal.conf /p
-
-Then you should be able to do things like
-# cat /p/tcp/localhost/daytime
-Sun Nov 22 17:50:09 1998
-(assuming inetd is running the daytime service, by default it is off)
-
-Welcome to FreeBSD!
-
-# mkdir -p /tmp/root
-# cd /tmp/root
-# mkdir bin p
-# cp /bin/sh /bin/cat bin
-# mount_portal /usr/share/examples/portal/portal.conf /tmp/root/p
-# chroot /tmp/root
-# pwd
-/
-# echo *
-bin p
-# cat /etc/motd
-cat: /etc/motd: No such file or directory
-# cat /p/fs/etc/motd
-FreeBSD 2.2.6-RELEASE (COMPUTER) #0: Sat Aug 22 17:11:37 BST 1998
-
-Welcome to FreeBSD!
-
-Finally, a very simple example of the listening server is available,
-fire up two xterms. In the first
-
-xterm-1$ cat /p/tcplisten/ANY/6666
-(the ANY is a wildcard just like using INADDR_ANY, any resolvable host
-can be used).
-
-In the second xterm
-xterm-2$ echo "hello there" >/p/tcp/localhost/6666
-
-You should see the "hello there" string appear on the first terminal.
-
-Unprivilged users can't create servers on privalged ports.
-xterm-1$ cat /p/tcplisten/ANY/666
-cat: /p/tcplisten/ANY/666: Operation not permitted
-
-but root can
-xterm-1# cat /p/tcplisten/ANY/666
-
-In the second
-xterm-2$ echo "hello there" >/p/tcp/localhost/666
-should produce the expected response.
-
-You can also swap the client/server read and write commands etc.
diff --git a/share/examples/portal/portal.conf b/share/examples/portal/portal.conf
deleted file mode 100644
index aa7e282d59ca..000000000000
--- a/share/examples/portal/portal.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-tcp/ tcp tcp/
-tcplisten/ tcplisten tcplisten/
-fs/ file fs/
diff --git a/share/examples/printing/ifhp b/share/examples/printing/ifhp
index 373325b0e285..21e6643473e3 100644
--- a/share/examples/printing/ifhp
+++ b/share/examples/printing/ifhp
@@ -26,7 +26,7 @@ else
# Plain text or HP/PCL, so just print it directly; print a form
# at the end to eject the last page.
#
- echo "$first_line" && cat && printf "\f" && exit 2
+ echo $first_line && cat && printf "\f" && exit 2
fi
exit 2
diff --git a/share/examples/printing/psif b/share/examples/printing/psif
index 1a816f64888b..2a657e01aae7 100644
--- a/share/examples/printing/psif
+++ b/share/examples/printing/psif
@@ -12,12 +12,12 @@ if [ "$first_two_chars" = "%!" ]; then
#
# PostScript job, print it.
#
- echo "$first_line" && cat && printf "\004" && exit 0
+ echo $first_line && cat && printf "\004" && exit 0
exit 2
else
#
# Plain text, convert it, then print it.
#
- ( echo "$first_line"; cat ) | /usr/local/bin/textps && printf "\004" && exit 0
+ ( echo $first_line; cat ) | /usr/local/bin/textps && printf "\004" && exit 0
exit 2
fi
diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c
index c2a0f0290eb5..dab474bf1c19 100644
--- a/share/examples/scsi_target/scsi_target.c
+++ b/share/examples/scsi_target/scsi_target.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_target.c,v 1.1 1998/09/15 06:46:32 gibbs Exp $
+ * $Id$
*/
#include <sys/types.h>
@@ -147,6 +147,7 @@ pump_events()
}
if ((targpoll.revents & POLLRDNORM) != 0) {
+ printf("Read Poll event came true\n");
retval = read(targfd, buf, bufsize);
if (retval == -1) {
@@ -162,6 +163,7 @@ pump_events()
if ((targpoll.revents & POLLWRNORM) != 0) {
int amount_read;
+ printf("Write Poll event came true\n");
retval = read(ifd, buf, bufsize);
if (retval == -1) {
perror("Read from file failed");
diff --git a/share/isdn/0.g711a.uu b/share/isdn/0.g711a.uu
deleted file mode 100644
index 69fb7c6a6f5a..000000000000
--- a/share/isdn/0.g711a.uu
+++ /dev/null
@@ -1,322 +0,0 @@
-begin 644 0.g711a
-MJJNKJ^OK:^LKJVO+*ROKJZJJJJHJ*BJJJZNKJBKJZFIJZBJJJRLK*^OKZVMK
-MB^NKJBKJ*JJJJJJKJZNKJZNJJROKZ^OKZROKZRLKJZJJJJNJJJHJJBHJJBIJ
-MRDKJ*JKKZVL+"PN+BPN+:RNJ*NKJZNJJJJJJJROKZ^OKJZJJZNIJ:NKJ:NJK
-MZVN+:^MK:^LKJZHJ:FKJZJHKZ^LKZ^LK*ZJJ*BJJJZNKJRHKBZNKZZJJ*RNK
-MJZLKJZJJJROK*^LK*ZKJ:FIJ:NKJ*JNK*RLKJZLKZ^OKZRLKJZHJJBLK*ZNK
-M*ZNKJZNKJZLKJZHJZBKJJJJK*ROK:VL+"ZMJJFJ*ZBKJJBLK*RLKZVOKZ^LK
-M*RNKJJKJ:HJ*:FIJ*JJKZVN+:^OK*RNK*ZLKJJJKJBHJ*BJJJZNKJZJK*RLK
-MJZNKJRLKJZJJJZHJ*BIJ*^NJJZNJJZNK*ZNK*RNK*ROKZ^MK:^OKZRLKJZLJ
-MZFJ*BFIJ:NKJZBHJJJJK*^OK*RLK*ROK:VMKZ^LK*RNK*^OK*ZNJJBKJ:FIJ
-MZFIJ:BIJBBNK*XL+"VMK:^OKJZJK*^MKZVMKZZLJ*FIJZBHJJJJKJBHJJJNK
-MJZJJJZNK*RLKJZNJJRNKJZNK*^LKJZNJJJJKJJJKJJJKJJJJJRNKJVL+*^OK
-MJJHJZBKJZFKJZNJJJJLK:XMK*ZNKJJNK*VN+BVN+:^LK*ZNKJBKJBHJ*:BJJ
-MJROKZROK*ZNJJJHJ*JJK*ROKZVOKZRLKJJJJJJKJRLKJZNHJJJMKBXL+"XN+
-MZZNJ*BJJJJJKJZNKJJJJJJHJ*BHJJBLKZRLKJZJJ*BHJ*BJJ*ROK:VOK*ZNJ
-M*JHKZXL+R\L+:^NK*BKJB@H*"FKK:ZLKZRMK:^LKJRKJ*BHJJJJK*ZNJJBJJ
-M*NHJZNKJ*BHJ*JHK*ROK:XN+"PL+BXN+:^LKJNIJBFKJ*BHJJBKJ*JJKJZNK
-MJRMK:^OK:VMKZXH**NKJJBHJJZNKJZJJJZNJ*BHJ*JLK*RLKZXN+BXN+BXMK
-M*ZNJZHH*"@J*:NHJJRLK*RLK*^OKZRNK*ROKZ^LKJZNKZVN+:^LKJNIJBHIJ
-MJROJJJJJJZJJJZLKJZHJZFKJZBJJJROK:VOKZVMKZRNKJJJJZNJJJZNJJRNK
-MJRNKJZJKJBJK*^OK*ZNK*ZLKJZNJJZNKJRNK*ROKZVOKZZMJZBNJJNLKJRNK
-MJZNKJZJJJZJKJBKJ*JHJZBHJZNHJJJNK*ROKBPL+BVOK*ZHJ*BHJZBJJJROK
-MZROKZRNJ*NKJZFIJZBJKJROK:XN+BPOKZTL+JRLKJZNKJZHJZFJ*BHIJZNHJ
-MJNIJZBHJJJNKJVN+BVN+BPO+2\N+ZZLJZFIJZNIJ:BHJZBHJ*NHJJBOKZ^N+
-MBXN+:^LK*RLK*ZNJ*NIJNLIJ"FHJJNO+RPL+R\N+ZRNKJJJJJJJJ*BJJJZLJ
-MZNKJZFKJZNHJ*JJK*^MK:VMKZZNJ*BJK*^MK:VLK*ZNK*NKJ*BJJ*JJJJRJJ
-MJBHJ*JL+"^L+B^LKZ^NKJBKJ*JJJ*JJKJJLK*ROKZ^NKJZJJJBKJZNJJJJLK
-M*^MKZ^LKJRKJZBHJJJJJJJLK*ZNK*RLK*ZNJJJJJJJNK*^LKZ^MKZ^JJZZJJ
-MJBJJJJHJ*JJJJJNJJRNKJZNKJZJJ*JNKJ^OKZVOKZRNKJRHJZNHJJBKJZBHJ
-MJBLKZ^LK*ZLKJZJJJJJKJJNKJROKZRNK*BHJ*BKJZZMJ*BHJ*RNKJZNKJRNK
-MJZOK:VOKJZLKZRLKJZLKZ^OKJZNKJBKJ:FIJZNHJJ^OK:VMK:RLK*RNKJJNK
-M*RLK*RNKJNHJZFJ*BFKJ*JNKJNJ*JFLKZ^OK*^OKZ^OKZ^OKZ^LKJZHJJBHJ
-M*BHJ*FIJZBJKJZNJJJOKZVMK:XMKZ^LK*^OK*ZNJJNIJBHIJ*JHJ*BHJJJHJ
-MJJLKBPM+2\N+BTMK*JIJBHH*"FIJZNJJJJJKZ^OKZRNKJZOKZVMK:VMK:VOK
-MJRIJB@H*BHIJZBJJJZNJJJHK:VN+"PN+BXMKZVOK*ZNJJJNJ*NIJZBHJJBIJ
-MRFJJ:BJJ*JJK*^MKBXL+BXMKZZNKJJJJJJJKZ^LKJZLJ:NKJZBHJ*BHJ*BJJ
-MJRMK:RLK*RLK*ROK*RLKZRNKJZJJJBHJ*BHJZBKJZBJJ*BO+:ZLK*RN+:^OK
-M*RLK*RLK*RNK*RLKJ^IJ:FIJZBJJJZNJJZLK*RLK*RLK*ZNJJJJJJZNJJJNK
-MJZOKZVMKZRNJ*BJJJRLKJZJK*^MK:VO+BZHK*RJJJBKJ:NHJ*FIJ*BHK*ROK
-M*ZNJJBKJ:FKJ*JOKB\M+RVLKJZOJZNJJ*^OKJZNJJZNKJJHJ*BKJ:JHK*^MK
-M:VOKZRLKZZOJ:FIJZBJKBRNJ*ZJJJJJJJZNK*RLKZ^MK:^LK*ZNKJJJKJRNK
-M*ZNJ*NIJZNHJ*BJJJROKZXOK*ZNK*BJJJJHJ*BKJZNHJJJOKZ^LKJZNJJJOK
-MZ^OK:ZOJ*^NK*ZNKJZOKZ^OK*^OKZRNKJJLJ*JJJ*FIJZBHJ*JHK*VOK:VOK
-M*RLK*RLK:VOKJRIJ:HJ*BFKJ*BJJJJNKJJJJJJHJ*BJJJRMKBPMK"[N+ZVOK
-M*ZNJ*NHJ*BJJJNKJ*JJJ*BKJZBHJ*^N+RTM+"XOK*^LK*FJ*"FKJ*JHJJJJJ
-MJZNK*ZLK*BKJZJJK*^OK:VN+BXMK:^NKJBKJ:NJ*2NJJZBHJ*JHKZVN+BPN+
-MZRLK*RNKJZHJ*JJKJJJKZRNKJRIJB@J*ZJJK*VMKZVOKZRLKJZJJ*JJKJZNK
-M*RLKJZNJ*BJJ*JHJJBHJJJJJZJN+JJJJZBJKJRLKZVMKBXOKZROK*ZNK*NHJ
-MZNJJJRJK*^NKJZNJJRMK*ZLK:RLJ*ZJ**RJ**NKJ*VLK*^KJ*NJJJZOKJZNK
-MJ^OK:PO+R\L+JXHJZ@H*BFKJZ^JKJJIK*XNKJZNKZRLK*ZNJ:NJ*:NJJ*^MK
-MZXN+:VNKJJJJJNJJ*@KJRXH+*BK+*GMJ"XJJJVHKBJIJZBKJJ^JJJRN+ZXN+
-MNRLK*ZKJ*NKJZBJJ*RLK*ROKZ^OKJRNK*^MKBVOKJZHJ:HJ*BFIJZBHKZRLK
-M*RLK*ZJJZNHJJJOK:XL+"VOK*ZNJ*FIJZNKJ*JNK*RNK*^J**RLKBPN+BVMK
-MZZNJZBHJ*NIJ:NKJZBJKJZHJJJJJJZNJJZLKZVN+BPL+B^LK*RNKJZNJJBKJ
-M:FIJZBKJJJJK*^LKJJNKJRLKZVMKBVMK2SL+"VNJ:FH*"@H*BFKJJJNKJZNK
-MJJJJ*JJJJZOKBXN+:XMKZ^NKJRHJZNKJ*BHJJBHJ*BJJJ^MKZRLKJZNKJRLK
-MZVN+BVMKZ^OKJZKJ:FI*NHH*BBJJ*VN+BXL+B^OK*ZNJJJJK*ZNKJJJKJZNK
-MJZKJ:NIJZNHJZNHJJBOKBPL+BXMK:VOKZZNJ*NIJZNKJZBJJJRLKJJNKJZOK
-MZ^OK*XL+JJNK*JLK*RNJJBHJZFIJZBJJJBLKZ^OK:RNKJJLK*ZNKJZLK*^MK
-MZ^LKJJHJZNHJJBJJJZNKJZNJZBHJ*JJKJRLKZVN+BXN+:VOKZ^LKBLKJBHKJ
-M*JJKJJJJJJNK*RNKJZNKJJJJ*BJJJROKZROKZVMK"XMKZRNK*FIJB@H*"@IJ
-M*BMKBVOKZRNJJJJKJ^MK:XMK:^LKJRHJZBHJZBHK:RHJ*FKJJJJJJROK:XMK
-MZVN+B^LKJFIJZNKJZNJJJZNJJZNKJZJJJ^OK:VMK:^NJZNKJZBJJJRLKZRNK
-MJZLKZRNKJZJK*RLKJZKJZNHJ*@H*JZJK:XL+"VMK:VLKJZNJJJNKJROK*ZNJ
-MZNIJ:FIJZNIJZBHJJBMK"\L+RPMK:ZLJZBHJ*BJJJJLKJRNKJZNJJBHJ*JJK
-M*ZLKJROKZZNK:VNJJZLJJBKJZNKJZBJKZXN+"PMKZRNKJZLK*RLKJZHJZNIJ
-MZFIJ:FHJJJLKZVMK:VMK:^OK:VMKZ^LKZ^OKZZNJJBHJ*BKJ*BKJ*JHJ*BH*
-M"JJJJ^LKZ^OKZ^OKZ^OKZ^LK*RLK*RLKJZNKJJNKJBJJ*FIJ*BHJ*BHJJJHK
-M*VMK:VN+:^LKJZJJJZNJJJJJ*RLKJZHJZFJ*:NHJJ^OK:TO+ZXOK*RLKJZNJ
-M*NIJBHJ*:FKJ*BJJJRLKZ^OKZ^LK*^N+BPL+"^LKJZNJJZHJ*NIJ:FIJZNHJ
-M*JHK*^MKBVOKZ^OK*ZNJJBKJZJHK*VN+JZMKJRHJZFIJZJHKZ^OKZ^NKJBKJ
-MZNKJ:BHJJBLK:VN+"XL+:^LKJRHJ*JJJJZJJ*FJ*ZBJKZ^OK:RNKJZNKJROK
-MZ^OK:VOKZRLK*ZLJ:FHKJFJJ*BJJ*BHJ*BJJ*^OKZ^LKJZJJ*JJKJZNKJZNJ
-MJJNKJZNJJJJKJZLK*ROK*^OKZVMKZRNJJJHJJJJJJJLKJROK*ZLJ:NKJ*JJK
-M*ROK:RJK:RNKJZJKJZNKJJJKJZNKJBHJ*BJJ*^OKZRNJ*BKJ*JJJJJNJJROK
-M*RNKJZOKZ^NK*ZNKJZKJZBJJJBLKJZJJ*JJKJZLK*RMK:XN+:VMKNPNJ*ZKJ
-M:FIJBFKJ:BJJJJNKJZJJJJNJJZLKZ^LK*ZLKJJNKJROK*ZNJZFIJBHIJ*JHK
-MZXN+BXN+ZRNKJZNKJZNJJJNKJRNKJZHJ*BHJJZOJJBLJ*JNJ*^OKZ^LKZRLK
-M*RLKJZJJ*BKJZBJJJRLK*ZNJJJJKJJJJ*BHJJJLKJRJJ*BJJJJHK*^MKZRLK
-MJZJKJRMKZ^LK*ZNJZNKJZNIJJHN+ZXMKZRLKJROK*ZNJ*BHJ*NJJJZNKJJJJ
-MJJJJJJJJJJJJJRMKBXN+BVLKJZJJJJHJ*BHJ*BHJ*BHJ*JJJJJNKJZJJJJLK
-M*ROKZXN+BVOKZBOKJZNKJJHJ*BKJZJHK*ROKZ^LKJZNKJZLJZFIJZBJK*^NK
-MJZLK*RLK*RNKJZNK*^MKZZLKJZNKJZNKJZLJJJHJ*BJJJ^MKZROK*ZHJ:BIK
-MJNJJZNJJJJJJJJNK*ROKZVMKZ^MKZXN+:VLKJZHJ*FJ*ZNHJJRLK*RLKJBJJ
-M*^LK*RNKJZJKJZJKJZLKJZHJZHH*BFKJZBJJJZJK*ROKJRKKBVO+RTM+RPMK
-MZRNJJNKJ:FKJ*BHJ*JHJZFJ*"LH*BNJJ*^MKBPL+"VOKJZHJ*JHK:XMKBXOK
-MZRLKJZJKJBJKJBKJ:BHJ*JJJJRNKJNJKZZKJJBKJ*JJKZ^LKJRNK*RLKZ^LK
-MJZLK*^MKBVN+:^MKZRNK*ZNK*NIJ:NKJ:@H*"@IJZJOK:XN+:^OK*^NKJJLK
-M:VN+BXN+ZRNJ*NIJZ@KZ"NJ**JJK:XN+BVOK*^OKZ^OKZ^LKJZHJ*BJJ*BHJ
-MZFJ*"@H*:BHJ*VL+BVOK:^MKZ^MKZ^OKZ^OK:XOK*RLJ:HH*BBHJJJHJJZNK
-MJRKJ*XLKJBLKJRLJZNJ*:NIJJJJK*^MKZVLK*VLK*ZNJJJOKZVMKZVOK*ZNK
-MJRLKJJKJ:FH*"HH*:FIJ:BHKJVOK*ZNKJZLKJJNKJVMKBPL+:XLK*BNKJBLK
-MJRLKJRNKJZNK*RNK*RNK*RNKJZNK*NIJZNIJ:FHJZBJJJBKJ*JJKJZJJ*JHK
-MZ^MK"PN+RXOK:XN+BPN+BXMKZRNKJBHJ*FIJ:JKK*NJJZBHJZBHJZBIJ:BHJ
-MJZNJ*BHJ*JLK*^N+:VMKZRNKJ^MKZVMKZPO+BXMK*VO+BVN+ZZNKJNIJ:FIJ
-M:FIJ:FKJZNJ*RDI*RLKJ*JHKJJIKBVMKBXN+:XLK*\N+:XN+*^OKZXN+"PN+
-M:^N+ZZJJJJKJJBLKJ^MK:RNKJ^J*RKJZ.KI*NCIZ^CI*"FJKJZLKJZIK:^M+
-MN[L[^_O[.SN;>SL+"^OK*RHK:^LKJZHJ*BJJ*BHJ*BKJZNKJZHJ*"DI*NCKZ
-M^GKZ^CI*R@IJZJHJJXL[^QM;HZ-;VYO;&WN;^TM+"XMK*^LKJNKJB@J*BKIZ
-M:BKJJBIJBHH*NDJZ.IH:VMH:&AJ:.@J*:JJ+RSM[>Z,C8X/C8R,C(R.CF_M+
-MN[N+JNJ*"CKZ^OHZ2@IJ:FJJ*ZLKJNJ*RCIZ>II:(B):^DJ:^LK*ZNHJZVL+
-MNYM;8R-C8X-C@X-;VWL[^_M+BZNJBLK*2KKZFGI*"NJJ*XM+N\L+:ZJ*2AHB
-MXN(BHEK:FAIZ^CK*"NJJZ\L[>UMC`X.C&R.CH^.C.SM+NTO+2VLKJ^J*.AH:
-M&AH:.LIJJVL+2_O[.[N[BZL*^EHB8F*"`@+BHAHZRFHJJRL+N_M[HR.CXR.C
-M8^.C&WM[FWO[.\OKZXMKBDIZVEKB(B+:"BHKB\N[.]L;F_N[:RI*>AK:6B+B
-M(EI:&AJ:>CI*"BKK"TN[>YL;V^/;6UN;>_O[.YN;&YO[.[L+ZZJ*RCKZFIIZ
-MFGHZ.DJJZXL[F]L;^_N["RJZ&B+B(B(B(AIZ^CI*2DH*:FJJ:XN+2SM[FQO;
-M6Z-;FYM[>QO[NSO[.\M+"XLKZ@H*RIK:VMK:FCH**JOKRWO;VWO;&XLJ"AJB
-M(H)"LH):&OHZ^FKJJ^MK"\L[>YNCHZ,CVWL[^[O+R\L+"PL+"VOKZRNK*RLJ
-M*HH*RDIZ&GKZNDJ*ZVOK2QM;(R.;^[N+:OK:(@)"P@*B&AKZ.LHJJZHKZ\L[
-M._M[FYN;>_N[^_N[NWO[.TO+RPOK*^NJZHI*"LK*"LHZNDJ*BDH*JFLK2QO;
-MHR,;^TOK"IHB@H+"0@*BVIHZBBIJJJOK:TN[^_O[F]N;._L+2TL[NWO[2[L[
-M.[L+:VLKJNIJZHI*FIKZ.OIZ^BJJ:HO[>QM;F_L[:[J:HF+BXN(B&AJ:NOI*
-MZJJJZ[L[FQL[F^-;^]M[NXOKJRM+R\M+.YM[NXN+:^NJ*HH*"KKZ&AJ:2DKJ
-MZZMK.WO;(UO[^[NKROJB8F("`B(:6AIZ>OKZ2@JJBPL;FR-C@^/;>[M[RPMK
-M"SL[NTN[2POK"PN+JZIJBFK*&IIZ.KJZ"HOKJCN;VR.C.SO[JCJ:8L+",C)"
-M6IK:&MI*BBJK"SO[^YNC`V-;&SL["XLK*@O+"RM+R[O[BZL+ZZNKJNJ*:DK*
-M2KKZ"BJK"RO+HUMC8QN[.XOZ(N*R\E*N$H(B@IIZ"BL+JJL[R\N;FV.;(_L;
-MXYM[J[MKRPM+>TL[>SL+NZLJ"ZJZ^CJZ^B(Z.KK*:[O+2]N#PT,C6UL[JOJ"
-MDN[NC@ZNDO)"&KHJ"PM+HP,;H]LCFYO;BYM+Z\M[^UNC>UL;FTN#^Z.CJVL*
-M"MIZ0J):8L):JHNJ:GOCTW-#@R-;REJRTFY.?CZN$JY"NNK+:WL;LR/;L^,S
-M0]M+(YL[*LM[.TL[(Z-;8UO;NTOJJ@HJFIJ"6F+2$AHS`PH+[^_/SX.SCR,"
-M+@X>7F;&9K[^OI**ZUN;,\_/4_//C^\S8Z.SF_K*JKO*JZI+0PO[2P,;F]M+
-M(ZL*(OIB+DYJO^JR#X_3I^]*CS]BGHY>A@;VUL:>AA[Z6U.?IV<WQU^G)\\#
-M2R(BVFX^0D*N6B+JTW/K\R_3<X.+*\OBDEJRCMHWYY)GMV\71UKOAW+&!M;H
-MZ(BXZ$9VMBZ+KZ=G-VF)5ZGI%\??@VKZ7O9&1G8VQN:2JRN/AP?G9V>GIU-K
-MRC(>1J;G]Y8[R4^WJ<M[Z0MH!L:(N,B8"(8H*,(/,Z<W5\FYJ5=)J5_/>V)N
-MAN@V!JA6!OZR>ZIOUW?']]<'IX^Z"@*&%H<)*+(9$Z>)<EY7:ACH=OC82'@X
-M#H86+Q<'=[G).9FI]^F'[HY.EO:HR%8F=D;K<P\'!T>IJ:<GQ^^KLGZB:<GV
-M4Z'G/V<29N^V`)@((&#8N&@B#LXI.8D)V=D9N4=G1^OV5O;HZ&AHIL*>#O]'
-MYP>'M]<G&R,/:EXF!N:Z>>%F"9'W"<G^IJ/(T``@</"`6#B:#Z/9`>'AP8$9
-M&8?Z^_:86+B8>"@H$B?_'RFYJ=<7YU^;;E[.7A:V1N;7L3EN\3%7V9^H9F9`
-M[$!`T##@..:I5^E!<<%A`2&)1UYHZ/B`8+B(5HZ;=[E)Z0DY5T]KKKZ&J"C&
-MYN:F?J+Y+6'.D1&7^4(@2"B0S-#`$,!XUA]A81GQK;&AF:DC3GC`()A@(%9R
-M_REIR2$AJ:<'P^:H:`C6YC:F@_\_:1&MZ?F1:0>G8+"@P.R,,`!@=@Y/X7%!
-M@3'Q65=3UHBX`+`@""@&#^G9X5EYF0DOYI;H2#@8.$:NN\]?(<V-QV&MUQ?N
-MK!"`D`Q,<*"8RI^7,>T188%!.:JV&.!8`#`@]NL/=QEA@>%)*5>+*'@8N$A(
-MR';O-W_W<;U19T'!;T>X;-#`D&P,,"@.1XDY\>U18;FYU[98@$"`H"#XCBD9
-M>=F!8=GI+XY&B!C@V%:&9K+?-\FM/;'S03%?M@"LT!`0+`SPPC<W"6'1K1&!
-M"5^OAN#PL&"@&.@;:5GAX2&A6>G+MBB(>*"8Z$;.8_^'`3T-%T=!86?@[*QP
-M4!`L[&"W(1EI(2UM\3GO;H[68)"0X';F]FLY`0'9.?D)!X+H.,AHB`CH/L^G
-M?[GM3<$O%QEY9JQLD'!P<-"PZ"G!P7G9$>TQYXAH9FB`D/"88D]/YXF!L>'I
-MI]]_[DB@&.BV-C:N#U=!S8U9OW>A6<B,#)#`\"RLX+[I@;%AX3%1D6D(V.BH
-MH)"06%+?AS<)(8'A&1>K#OX&B-AX%GX.\ONI,8WMX5_CB7DVK`SLL&#PT`#V
-MJ6%!P0$!04&9LCA8^#C@0&`H[RF)21FA67EI/WZHZ%8HR$BHCJ.G6:UM\0FS
-M1]DW(.R,4(#`D/!8VDGA`;&Q`6&A:>N(H""@H*`8J!M7R7G9&7D)U]_R%HB(
-MJ*CHJ";#27'M$=E/<PG)9C!L[##@@$"`:"?9@<&QP6$9:0>B:"!@X)C(Z`:[
-M5WG9&3D)U^?##O9HR&C61B8RJ;'MK6'?VA?)*V#LC!"`8`"`R-.YX<$Q,0%Y
-M]U\S9I@`P*#H!KXZ)\E9H9D)=S]*GL:H"$B(]G[+"?$M42$_BRE)*H!LC-"`
-MX```N(\9@4$Q,0'Y1U-*1IC`0"#H'H*;A\FAH1G)-R\RYO:H"+A(*/ZW@:TM
-M,<F3IXGWZ!`,;'#@(&`@%M=AL3$Q06')7ZO^Z""P0%AVPLOO%WGA(7DI)YN.
-M1JB(N/A(UFJYD>VM@?>/*0FCX.S,+$`@X("8.GD!,?'Q0:'7HXXV.(`P`/B&
-MZX^'B5GAH;F7#\(&J(@(2$AHQCNY<>TMP3=JA^EC(.Q,[$"@H.`X&]E!\?$Q
-M0:$WP@:H^(`PP/A>4Z?WR:'AH;F7KX[VZ(@(R`CH1JM)<6WM07?B?U>;(.Q,
-M;+!8&*`X.UFQ<7$Q02$76D;HF(`P0)CF+^?WR:'A(3EW<P[VZ`C(R(BHIHMG
-M>9%M[<&')IH?SF!L3.Q`&'AX5D=A,?$QL<$9WV;HR-@`L`#(`B?W*3DAX5D)
-MAPJ&Z,@(B(AH%H[/]SDQ[>TQ]S;FDZX@[$QL0/A(N'8W83$Q04$!&=^V"+C8
-M@$"`B#H'%^DY(>$9::>B!NC("(AH*+82?_>7R4$M[4&_"*@*ON#LS"Q@"&@H
-M+FEAP0'!P6&),FC(R!A@`*#&#_>I"9FA64EWT_[6B`CH**AV?H/'%S<W&1'M
-M<2DH..:BR'!L[$`X*/;"]YGA80'!X>FBUBAH^.#@F$:#A]<)^1F9R1<3IJCH
-M**@H*+;R;V='1X=G";&M<6FH>(8#%D`L+$`XZ';:1PF9H8'!66>^Q@:6^"!8
-M:-Y;)U?)N3FYB4>*QA;V=BAH%HZSSX\?AX?/6ZFQ40%/"&AC/VBP4)"`^"A.
-M+Q]'N6%!X1=J8D)FB-@8R%8^3Y<IZ8DY^:DC_B:&EFCHMOXRBP_GYX\S\WM/
-MV9'QR?XH8B<&8/!P0.`XYH__'XEAL6$I"^+RYJ@X&'B(_J>7=ZG)>3D7DV)>
-M%NCHJ+;F$B]GA^=?'S];#JYI,3%)RF;";^;8`##P@`@NPRION6&!6>E/(J;&
-M1NAX^%9*Y\?WZ0D):9?O3I96EE8H=K[CG^='ET=_H^).QJCRH7%AJ2\;7Z.H
-M&,`0\*#6SKY:*:'A(1E7@S[>SC:X^.C^4^>WUQ=7::G_;C86UE8V?JXZOW<I
-ME^>_@ZZ&-O96J#^QK0')9R_OO@B@D"P0H':NFB<YH6$!(5?R=C:&%FAHZ,:#
-M%VDI]Q>I1W-.%NCHMCX.+MOG5^FI1X_RIF;&=A96MK?QK4%Y9XHZ9DA@4.R0
-MH$9+OZEY(8'!68>F**B6J&@(Z/YGB<GI=[>'OVLFZ`CH!BYJ[V?WJ2E7AUL^
-M-BCHUK;&!AXI$>WQH4>^9JAX`*SLD"`&WRDYV:$!0=D?-DBX"*C6Z*AR][DY
-M:?<?KY-*AN@(*(;BS\<W%RDI]Y^J'M9HZ*AV9JY:JNF1[?&9WT;H2)A@T"SP
-MF`[W21G9&2'A22^6^-BX]HY^?J/W";F)MWO.3OX&%M9&SB-'*2E7E[<G\W*&
-MJ`@(*/;>.E.??W^Y$:T!B>)(^/B8X)#0``A+Z3EYN4F9F:F+5G@8"-X;VS-?
-M]VD)*1\.1@8&AN8F?F)/5VDIER=SZR*^MF@(:)9^*F]?9V<_[PGQD2&7_D@X
-MN+B@,/!@2`+7N7E)B3FYJ?\>B/@(YJ,O4Z_O)_=WIQJF)AZNZJMZNO.'EW=G
-MPW+.#BZ^AO;V!@YKCU\G)Z>/BCHI`8')WX:X2`B(F("`V"A[Z3GY">EIJ;</
-MWH@X:/X+8W-[2S_WJ4<S6HZ^PNJ:$N[Z+Z>'I]MBPOKJPAX&1N9"<U_GWR^[
-MPMZ""8&AZ;^VB"@65GA@('C6$RG)"2FI*1?'KR9HR-82H^\O:\N?]]>'\[*F
-MIE(:`J[N>C/?QR<#RAHJ6[OB'L;FCLHC8_OKNJ(N7AK)`6%YUXXHZ"CHF.#@
-MH,B"E[GYR8GI=\=OGB@(*.;"0X\C@W_'%_<?"N9&)DYRVJ+ZHQ\W]V?/>SHB
-MTOX&=C;F;BO3ST_O8^HNRHF!(4E'Y@@(Z*C(6*#8"&(7.9E)Z7<G7^^N=HAH
-M1@)/9[\#8V_GAW_K)C:&;COOTZ,[\Z>'9S\JCOX^;BY.WJ:^"H_GA__+SL9F
-M#[FAF:F;1JCVAC:(F%AXUJ.I24EI=X<GIU,N=N@HADI/7X_CH^^GA]^[/@;F
-M+@M#HZOZ*R^GYW\C@NZ.[M+NOGYN"I._SR.2?@LI&:'Y1XXH".BH*`CXF,CF
-MWPEY.>F';S-C:C[V**BFPT=7%^=OP[,S:^X&%I8F&N]?'\\O;W_?3_ONYL;F
-MCKI[F[LC[W^GOWON)HZ3QZFI!T,NGAZFAA:(2`C6CH\WJ1>W9Z=?OX,BWH8F
-MCDJ#,T-C8_,OK[.K,FX.KMHJ:VN+V_/O#Z];ZN("0I*NKO(ZZNHJXNXK5]FA
-MF6G[ULA("`A(N'@X%@NIF:&9:2?#*@*.)I8H*&:C1^EIU^>/0_NZ;F86*):F
-M^L_G9Z?_O[\/KZL.AK8&GD)+L_/3;T^_[UMC/P=W=V=#;@9V%A865JA6-OZ[
-M)Q>IUT<?$SL*XJ[._H[B"Z]_'W_/,POZ0E)N#DY.[B(KPX\_/\_O\WOJHBX^
-M?KZN(NJ[2[J"S[FA6=FI[J@X>+BXR,AX2!8R=_FAH;GW[T(.3AYFEBC6ABJW
-M";E)J><;,@Y>!G8H*!:F*Q]'=[?G?V]#"P(^AD8&7C+;#Y\?/V_STU_WJ:FW
-M[R[&UJBHUA96J):&0@\W*>G79R_KHD)RK@[^3L*[#^<'YS_#:L+2$E)NSO[^
-M[LIS?R<G/S-+BGI:LFX^'IX.<MJOZ=G9V3EGLG;(N'AXN/@XB/;Z1PD9&;DI
-MI\OR/GZFAL:VAJXS1^D):7</>GZ&!L9&1K:&?EKOAW?7-R?OJK(N3K[^GCYN
-M8DM3WT=W5U<WI\,2)O:HJ*A6=L9>$DN_AS=WMV<_@RIB[FZ.#FY2`HI;KT^_
-M#Q/[2F*RL@(BVIK*BZ-S[X_OL[M*PJ[.'@[SMRG)R==_8L:H:&CHZ&CHJ+9N
-M+Y>)2<DIAU-*0E(N[DX>IM[N*@\'=Q=WYQ,ZSJ;FYN;FYJ9^$HOOIV=GI\^S
-M2PIZ^CJZ^IK:VCKJ.Y,/OT_O@ZIBKHY.3KZ^SHZNXFH;DV^/;U.#NZMJ^AJB
-MPG)2TD*::R-SKR_O+Y.3\X/;2ZI*&B*"8B):2ONO_Z<GWV\[0OYF1D;&9J8^
-M+F*J8V^?)V?GGR\;N@*24G)"8AJZJCOC\Z_O+W-;ZSIB,I)R\C*"6OJ*"]M#
-M$Y/S,^,;.\LKBLJJ2^.3+Z\#2SKR#OX>'GZ^CBZ2XDI+LP__'Q\_;S.;*[H:
-MXL(R<C*"V@KK>V.S<W-#H[NJNJ*"PD("XIJ*B]O#<U-3$T.C>RLZNHHJ2QM;
-MF^OZ,NZ.#H[NTK)BHIK*ZQLS+X\/CU,#^ZJZVJ*B6OK*ZFN[&ULC8R,;NZO*
-MVF*"@N*:2HHK2_N;6Z.CHUN;RRN*&N*BNNO+(].3@SO*PJ[N;B[R(OH*JNN+
-M.]OCPP,CFPMJ.AK:>DIJ*PL[^WO[^[L+B^NKJRLK*RMKRSL[>_L[BRI*^@IK
-MF]M;H[N*&A(.#@Z.4B)*ZCN;NYM;HUO;&WN[BZOJ:NJJZPN;HR.CFTN+:^NK
-MJRLKZHI*&EIZ^CJ*JZJ*Z@HZN@H*:NL+RSO[2TN[2TN[2PL+B^NJJBHJ*JNK
-MJROKZRNJRLIJRDH*R@H*RDI*R@H*:NJJJRN+R[O[F]O;&YM[N\MKZRNJJNIJ
-M*BHJZNIJ"LK*"@H*:JKK:VOKZRLJBLHZ^CJZ2DJ**JOK"TL[FQNC6UMC6[O+
-MJXK*RDI*RFHK:PO+NTO+:RK*NII:6EK:FOHZN@IJZBN+"TM+N[O+R\M+2\O+
-M2TM+"XOKZVMKZ^OKZRNKJNIJ"@J*:FIJ:FJ*BHIJ:LIJZROKBVOK*ZNJJRNK
-MJBJKZXO+2[N[NTL+B^NKJZHJJJJJ*NJJZTL+*BMJ&GIZXEIJBNK+2RN[.VN+
-M.\L+N\LK*RN*:NKJZNLKZVN+B\M+.\OKJVJ*"KJZ2LJ*ZBJJ*RLKJZHJJJNK
-M*^OKZVMKZRNKJZLJB@H*BFHJJJMK"\M+2[M+2\N+:^LK*ZNKJBHJ*FIJ:NKJ
-M:FH*:NKJZNKJ*BK*BBHJ*JHKZXO+NSL[.TM+RPL+"XMK*ZNJJRIJ:HH*"HIJ
-MBHJ*:FIJZBJJJBJJ*JKKZ^OKZXN+:^OK:^LK*ZNK*ZNKJJLKJZNJJNHJZNIJ
-MZFLKJXOKZRNK*BJJ*JJKJJJKJRLKJZNJJJHJJZLKZRLKZRLK*^OKZ^LK*ZHJ
-MZFIJ:NHJ*JJK*ZNK*ZNKJZLK*RLK*RLK*RNJ*BJJ*^OKJRNK:BJKJJLK*RLK
-M*^OKZVMK:^OK*ZJJZNIJ:BHJ*JJKJZLK*^MK:VOKZZNJ*NIJ*JJKJ^OKZ^LK
-MJZHJ*NHJ*JJJJROKZ^LK*RNJJBHJZBHJ*BL+*ZHKJZNKJZNK*RLKZ^OK*RNJ
-MJBHJ*JNKJZLKJROK:VLKJJHJZNHJJJLKZ^OK*ZLKJRHJ*BHJ*BJJ*NKJZJHJ
-MJJMK:VMKZ^LK*ZLJ*BJJ*HJJ:ROK:VMKZ^MK:RNJ*NKJZBJK*^OKZRNJZNIJ
-M:FIJZNJJ*VMK:VMK:^LKJRHJJJNJJJHJ*BJJJJJJJZNKZ^NKJBJKJZNK*^OK
-MZVOK*ZOKR^LKZZHJZFH*RLIJ:BHJJJJK*^LKZRN+"\L+:^OKZ^LKZ^LK*ZNJ
-MJBIJ"@H*BHIJZJHKZVN+"XMKZZNJ*JJJ*VMKBVOK:ROKZZKJ:HH*BLHZRNKJ
-M*VN+BVOKBXN+B^OKZZNKJBHJZNHJ*JJJJRLK*ZLK*ZJJJJJJJZNK*RLK*^LK
-MJZJJ*JJK*RLK*ZJJJJHK*ZNK*ZLKJJHJZNHJ*BHJ*\OK:PMK*RNKJBHJJJHJ
-M*BJJJJJJJJJJJJJK*ROK*RNKJJJJ*RLK*RLKZ^OK*RNKJBHJ:NKJJJLK*ZNK
-M*ROK*ZNK*RNK*^OKJROKZRNKJZLJ"BHJZBJJ*JJJJZJJJZLK*ROK*RLK*ZNJ
-MJRNK*RNKJZLKJBHJ*BKJJJJKJZJK*ROK*ZLKJZLK*ROKZ^OKJRHJZFKJ*BHJ
-MJJJK*ROK:^OK*XM+*ZNKJJJJJJNKJZNKJRJJJJNKJJNJJJLKZ^OK*ZNJ*NKJ
-MZFHJJZJJJJNKJRLKJRNK*ZNKJROKZ^OKZRLKJZJJ*JJJ*^OK*RNK*ZJJJJLK
-M*FHKZROK:^OK*ZHJZNKJ*BHJ*JJKJZLKJZJJ*NKJ:BKJ*JJK:XL+RPO+B^NK
-M*NHJ*BHJJJNJJJHJJJNKJZNKJZJJ*BJJ*BJJJZNJ*^MKBVO+.XMKZZKJ:HJ*
-MBFIJZBHJJJNK*RLKZ^MK:^OK*RNJJJJK*RLKZROKZRNJ*NIJBHJ*ZBJJJJJJ
-MJJJJJRLKZVOKZROKZVMK*RNKJRHJ*JJK*^J*JZLJJRLK:XL+"PMK*ZLJZNIJ
-M:FIJZBJK*^OK*ZLJ*NKJ:NHJJBMK:XN+BXN+B^OKZZNJ*NHJ*NIJZBHJJBNJ
-M*JJJJJJJJJJKJZNKJZNK:PLK:XMKBXMKZRNKJBKJ:FKJ*NKJ*JJJJJNK*RNK
-MJZNK*ZNJJZLKZROKBPL+:^LKJZKJ:HJ*:FKJZNJJJRLK*ZNKJJJJJROK:VOK
-MZ^OKZRMJRNIJBBHJ*JHK*RNKJJNKJZNK*RLKJZNK*RLK*ROKZVMKZRNJ*NJ*
-M"@IJ*JHKB\L+:^LKJJHJZJHKZ^OKZ^OKJ^J*"@IJ:BJJJJNKJRNJZBOK*JJJ
-MZJJK*VN+RPN+:^LKJZLJZNHJ*NJJJRLKJRLKJRNKJZJKJRLK*^LK*ZNJJBHJ
-M*NHJJJLK:XN+:PN+B^LKJNIJ:FIJ:FKJ:NHJJJOKJJJ+ZVL+"PL+"VMK*ZHJ
-MZHH*RLK*BFHJJBLK*ZNKJZNK*^MKZVN+"PL+B^NKJBJJJNHJ*NHJZNKJZBHJ
-MJJJK*ZLK*RNK*RNK*^OK:VMK*RMK:RJJ*HK*R@J*:BJJ*VN+:XN+:^OKJZLK
-M*RLK*ZNKJNKJZBHJJJNJJZJJJJNKJBJJJZNKJJMKBVLKJZOK:VLKJZNKJRHJ
-MJ^OK*ZJJ*JJK*LH*JFJ**JLK*ZJKJJOK*^OKBXN+ZRLK*RHJB@J*ZBJKJZNJ
-M*NIJZJKK:VMK"PN+Z^OK*RLK*RLK*RNJJZNKJJKJ*JJJ*NIJZBHJZNHJJJHK
-M2_O+2POK*RIJ:HIJZJHKJZHJ*JNKJZJJJROKZROK:VOK*ZJJJJLKZRNKJJHJ
-M*NKJJJJJJJJJJJJK*VL+RPMK*RLKJZJKZ^LK*ZNJJRLKJZJ*:JKJZJLKZVOK
-MJZJJJJLK*ZNJ*FKJ*JJKJZNKJ^LKZ^LK*RLKJZJJ*NHJ*BHJ*JJJ*^MK:^NK
-M*RLK*RNKJZJJJJLKZVOK*ZLJ*BKJ*JKJZNOK*BNKJRLK*RLKJZLKZ^OK*ZNJ
-MJZLKJZNKJZNKJJJKJJHJZNHJJZNK*ZNKJZJJJROK*RHJ*BHJJJLK*ZNJ*JHK
-MZ^LK*RNKJNKJ*JNKJRNKBNKKJZMK:RNJJJJJJROK:VOK*ZNKJRLKJZLJ*NIJ
-M:FKJ*JJKJROK*RNK*ZJJ*VMK:^OK*RLKBZL*BHI*J@NJZJO+NVKB>OO+JRN[
-MVPJ*>P.+6J)**\K*B]O[FOH[N[MJ^LK*6OKJJLN[XP.[JXL[6TMJ:JOJ&B*:
-MRLIJ:JJJ*NKJBDKJ"]MCHYO[BZHJBNKJZNJ+ZRKJ"BJKN\OJZLK*"MJ*:ZLJ
-MB_L+Z^KJ*NJJ"TMKZNHK*ZN+R[L[*^KJZHJZRBJKJ@K**JJK*BJKBSMKB^LK
-M:RNKJVOKJFK*:NHKB^NK:NKKZZHJ:HHJJJJKZROKRPL[FTN+*^LKJXJZ^CK*
-MZJJ**^OK*RIK:RLJJJLJJZIJJZOK2PMKR[M+:XMKJVJZ"HH*.LK*"JOK"TN+
-MBXLK*ZHKJVJJJBJJ*JJJ*JKKR^N*BBJKZXNKJBLKJFIJZJLKJRLKZ^NKJZLJ
-MJZNJJBMK*RLK*VOK:^MKBXOKJJJJZNJJJBHJ*JJJ*BHJJBHJ*NJJ*PO+"PM+
-MR^LKJJHJZNIJJVLK:NHJZBHJ*JHJZBHK*ZOKZRLK*RNK:NJK:RNJ*RNK*NHJ
-MZFH*8NZ26DKK.]OC8P,#@V,C6QM[.TN+ZZNJZFJ*"LK*2DI*2DK*RLK*"HJ*
-M:NHJ*JJKJRLK*^OKZ^OK:^OKZ^OKZ^LK*RLK*ZNKJZNKJZNKJZNJJJJJJJNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNK________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/1.g711a.uu b/share/isdn/1.g711a.uu
deleted file mode 100644
index 2ce020038a8a..000000000000
--- a/share/isdn/1.g711a.uu
+++ /dev/null
@@ -1,322 +0,0 @@
-begin 644 1.g711a
-MJNKJ*JJKJJLJZBHJJBHJJJJK*ROK:XMKZVMK:RNJ*BKJZFKJZJHK*RNK*ZOK
-MZZNKJZNKJZMJJFNK*XN+ZRLK*NKJZBJJJZNKZ^OKZZLJ:FKJ*JJKZ^NKJJJJ
-MJJJJJJLKZRNK*JHK*ZLK*ROK*RLKZXMKZRNKJBLKJRNKJZJJJJHKZRNKJJNJ
-MZNMKJZNJ*NKJZFKJ*JLKZ^LK*ZKJZNKJ*JJKJJJKJ^MKBXMK:VMKZZNJJBIJ
-M:FIJZBJJ*^OK:VNKJZJJJJNKJJJJJJNJJRLKZVMKZ^LK*JHKZBJKJJNKJZLK
-M*RNKJJNKJBIJZNHJJ^MK:^NKJJNK*ZNJ*^MKB^NK*FJ*BFHJJ^MKBXN+:^OK
-MJRHJZBHJJBLK*^OK*ZLKJZNJ:NHJJZNK:LIJ*JHK:XN+:VLKJRNKJJNJJZNJ
-MJRNK*RNJZHIJZBJJJJNJ*^OKBPN+BVOK*ZLK:^OKJZIJBHH*:NJJJBJJJZJJ
-MJJJJJBLK*^MK:^MKZRN+BZNKJRHJJJNJJJJJJRLK*RNKJJOK:^LKJBIJBHJ*
-MBNHJJJOKB[L[N\N+ZZHJ*NKJZFIJZBJJ*^LK*ZLJ*NKJ*JNJJJJJ*VMK:RNK
-M*JJJJNIJ*RLKZVN+B^NKJJJK*^LKJZHJ:HIJZBJJ*RLK*VOK:XMKZRNJJNIJ
-M:NHJJJJJZBHJJJNK*ZNJJZNKJZNJJJOK:VMK:RNKJBKJZBHJZHJ*JBNJZXN+
-MRTO+"XMK*ZNJ*JJK*NKJ:NKJJNLK*ZNJJJNKJRKJZNJJZPO+2TN+*ZJJ*FJ*
-MRDK*BNJJZ^MK:VNKJJJJJJJKJJJJJJOK:VMK:ROJ:JJJJJHJ*JJJ*ZLK:XN+
-MZVN+"PMKJNKJ*JJKJZIJBFHJJBOKJRJ*BHKJJ^OK*RLKJJJKJJLJJBNKJFNK
-MBVLK:RMK*RJJ*JMK:VLKJBIJ:JLKJBNK*BHJ*JOKZVN+B^OJ:NIJZBIJZFHJ
-MJZMKBXN+:^LJZNIJJBHJ*BJKZRMK:XN+BXMKZRNKJRLK*RNKJZNK*FIJBFIJ
-MZBHJJJJJJRLKZBKK*^N+ZZLK*RNKJZLJ:NHJJROKZ^LKJZLK*RMKZZHJZFIJ
-MJJJJJZJJ*RMKBXN+:RLKJRKJ*JHKZ^NKJBIJ:FJ*:FHJJZLK*^MK"PL+BXL+
-MBRLKJRHJ:@J*ZNHJJBHJJJOKZ^NK*BHJJBMK:^OKZRNKJZLKJZHJ*JNKJZHJ
-M*BJJJJKJ:NHJ*JOKBPO+RPMKZRNJ*NHJ*BJJJZNJZNJJJ@H*:@H*:BHK:XN+
-M:^MKBXL+RPL+B^OK*ZHJ*NIJZJHJJZNJ*HJ*B@J*:NHJJBMK"\L+"XOKZZHJ
-MJJJKJZNKJJNKJBLK*ZNKJFH*"BNJ^@KK*VO+"PN[NXLK*RMKB^LJZFKJZBKJ
-M:BHJ*BJJ*JI+*XJ+*NHK*BJJ*RNJ:VOKBVNKJZNJJNIJ:NHJJRLK*ROKZZNK
-MJZJJJJJJJBOKZVOKZ^LJJJLJ*BHJJJHJ*BJK*^OKZVOKZRNKJZHJ*BKJJZJK
-MJZNKJJJJJJNJ*BJKZRNK*FIJ:NJJ*VN+:^NKJJNKZRNJ*BHJJRLKZRLKJZLK
-M*^LK*XNKZNKJZNHJJJHKJRMK:VOKJZNJJJJK*ROK:^OKZRLKJJKJZHH*"HJ*
-M:NHJ*JJK*VL+"TN[2PN+ZROJ:FIJZJHK*ZNJ*BHJ*BHJJJJJJJNK*JMK*XMK
-MBPL+:RNJ*FIJ:NJJJJJJJJLK*RLK*ZNJJJNJJNHJ*JJK*^MK:VOK*^NK*BHJ
-MJBIJ:BJK*^OKZ^OKZRLJZFIJ:NHJJBOKBVMKZVM+"^OKJBHJZBHJ*BHJ*JNK
-MJZHJZNKJZNHJ*JLK:PO+"TO[2ZHJ:VLK:ZO*2FIJ:FH*N@HJJZNK*ROK"PN+
-M:^LKZVMKZZNJ*JJK*ZNKJNIJROH*BHJK:XO+BVMKZ^LKJRLKJJHJ*JHKZRNK
-MJZJJJBHJZJOKZ^LKJZJJJZNKJZLK:XN+:^LKJRHJ*BHJZNKJ:NHJ*BJKJZHJ
-M*BKJZNJJJJHKRXN+RPL+"PN+ZZNJ*NIJ:FKJJNOK*ZLK*ZNK*BKJZBJJ*ROK
-MZXN+:VOK*RLK*ZNKJJKJ:NKJZBHJJRLKZZNJJJHJ*NIJZJNK*^MKZ^MK:RLJ
-MZVLKZRNKJZJJJJNJJJKJZBJJJJHJZFKJJJNK*ROK:^MKZ^OK*ZNKJRLKJZLJ
-M*NKJ:FIJZBHJ*BHKZVMKBXMKB^LK:^OK*ZNJJJJK*RLJJJOJZJHJ*BKJZNKJ
-M*JJKJRMK:^LK*RNK*RNKJZNK*^OKZ^LK*FIJ"LK*"HIJZJMK"PL+RTO+"XOK
-M*ZNJZFHJJZNK*RNK*ZNK*NIJ:HJ*:NIJ:NN+ZXL+"PO+2\N+ZRLJ:FKJZNHJ
-M*JJJ*NKJ:FIJ:NJJJZLK*^N+BPL+"XN+:^NK*NKJZBHJ*BKJJJLK:RNJZNKJ
-MZJJKJROK*ZLKJROK*XL+Z^OKZZLJ:FIJBNHJZNKJJBMKBVMKZROK*ZNKJJJJ
-MJZNKZ^OKZRNK*NKJZBHJ*BJJJ^OKZVMKZZLJZNJJJ^OKZ^LK*ZNK*ZLK:VMK
-M*ZHJBKK*RLIJ*BHJJROKBVN+B^OK:VMKZROK:^LK*ZNK*RNK*BKJBHJ*"LH*
-M"HKJJVL+2\L+:^NKJJHKZRLK*RLKJZNJJZNK*RNKJNIJ:FIJ:HJJBRMK"PO+
-MBVNKJBHJJZJJJBHJJBLKZVLKJJHJZFKJ*BHJJJNK*^L+R\M+RVLKJBJ*BFKJ
-M*JJKJRLKJJJK*NIJBHH*BFJJJVN+BXN+BPL+"^LK:RNKJZNK*ZNK*RLKJRIJ
-M:FKJZBHJJJJK*ZLJ*NJJ*BOKZVN+BXL+BVOKJ^J*"@K*"HJ*:JJK*RMKBVMK
-MZROK*RNK*ZNKJZNKJZLKJZHJJZMJZBHJZBJJJJMK"PN+BXMK:^OK*RHJZBHJ
-M*JHK*RNKJJHJ:LK*RHKJ*BMK"PL+"PL+B^LK*ZNKJBKJZBJJ*VN+:^NKZFIJ
-MZBJJ*BHJ*NJ*:JLKZXL+BXOK*ZJJJ^MK:RNKJJJK*RLK*ZHJZFIJ:HJ*:BJJ
-M*VL+RPN+Z^LKJJNKJZJJJZNKJBHJ:FKJ*JJJJBOKZXN+BXN+ZZNK*^OK*VMK
-M*BIJBNHJ*NJ*BFKJ*BJKZROK*ZNJJ^N+BXMKZRNJJBHJJJJKJZHK*ZNKJZNJ
-MJZNJJJJKJZNJ*JJKJJLKJRNKJZJJJ^OK:VMKZ^LKZRNK:HKJ"@IJZNJ*ZBJJ
-M*^N+BVOK*ZJJJBMKB\L+:RLK*^LK*ZKJ:HJ*BFKJ*JHJZJJK:\O+RPN+Z^OK
-M:RLJZNKJZNKJZJJK*^LK*ZHJZFHJZNHK*ZMKBXN+BVLKJZJKJJLKJZHJ*NKJ
-MZNKJJJJKJZLKJJNK*ROKZXMKBVOKZRLK*ZKJ:NHJJPN[.TOK"IKB`N*:ZLL;
-M(Z/[BZIJBNKK2WM[.ZMJBKK*:JMK"\L+*VI*NDI*"FJJJRNKZNHJJNN+R\L+
-M:^LK*ROK:VN+B^LK*NIJ:FIJZJHKJZKJ:FKJ*JOKBVLKJZNJ*BJJJ^OKZ^MK
-MB^LK:ZN*:HJ*:JHKZXO+2\L+:VOK*RNJZNIJZNJJ*BHJJJJKJBKJBHJ*:FIJ
-MZBJK*ROK:^NKJRLK*RLK*^MKBXO+R\L+"PL+BXOK*RLKJZJK*ZOJ:NIJ:FH*
-MRKKZ.CHZ^OKZRFJJZXL+R\O+RTM+2[N[N\O+RTN[^YO;HR,CHR.C&[MK:OIB
-MDNX.SDX.[E+"&LHJ:\N[>QM;H^,CVQM[N[L[&V,#`T/#0[,S<R]OCV\O`ZO"
-MSJ8&1D;&9AX.\IJJN]L#DR]OCX_OTT/;2ZH*2DJ**SLCLQ.OKW,#(UO;VZ.C
-M&TMJ8BX^7B;F)EX^[H*ZZWM;HX.S0_-SDY/S`R.;.TO+"\L[&Z/C8^-;6]O;
-M6R,C6SNK>C*.?J8FYJ:>SA):ZCOC,Y-3KU-3D_-#@R.;2^NKJJMKNYNC(^-C
-M8^,CXV/C6YM+"H*N3MZF)B9>_HYR6FJ[(_.O+^_O[Z^3PZ.;R^NK*BHKRWNC
-M8P/#L_,SDZ]3DT,;*F)NGN8&QL:&)O[N8NK[`Q/OC\_/SP]O4T,C.VNK:KJ*
-MJNM+FZ.#`V/C8V/#,_-S0Z-K&J[^)@;&Q@;FGFYBJEMS[P]/3\_/;R\3PUN[
-M*XKZFOK*JLM[V^/#0[,#X]N[ZRH*NGJ:VEKB@D(RDM*2PD)"XEJ:2FJK:TN;
-MVUM;VYO[^WN;F_O[>WN;FWM[>SL[.[O+RXOKJRJ*:NHKNUL#0T-C2\K";GZF
-M)B:F'L[2VBM;\R^/#X_O4S,#H_L+ZRH*BFIJ*\L[&Z/C@P.#(]N[Z^K*N@KJ
-M:_NC@X-;2XIB+CY>YF;FIGYN@BH;<^\/SP^/[Z^3,\,#(]O[BRI*FJ+B`@+B
-MVCJJ2QN#L_/SLV/;.PMJNGJB(GH*:]LS4Z\O$R/K(FZ>)H8&AB:>CD**>S/O
-MS[___[_/CZ]SXSLKRMK"\A*2,L):BLM;LZ_O[R\SVZI:(GJJHP\G!T='Y^]*
-M_C;HR$A(""BV?KJOI\?W=W<WQ^??/\]OK],S([MJXBY.'B;F)E[^[F*JX^]/
-M_W__SR^S&RM*H@(R\C*R`J+:^DH*BBHK:\N[^QM;HZ,;.\LK:FIJ.OK*BBHK
-M:XO+2TL+:^NK*FH*"HIJ:NHJJJNJ*HJ*B@H*:BKK"TM+N[M+RPN+:VOK:RNK
-MJNKJZFIJ:NIJZNIJBHH*BHKJJJLK:PO+R\O+:ZOKJNHJZFKJZBJJZXL+NSN[
-M2\O+"\N+ZZNK*NJ*BLK*"FHJ*JJK*^OK*RLKZ^MK"[O[^[N+JPIZ(K)2+HZ.
-MCN[RHFI[0Z\/O[^_3X]3PQN[Z[I:@O(20DK[K]\'-_<WAT\+CL:HB$BX2(BH
-MQ@XKC^>WEQ<7E_>WQV<GGT^OVXJ2?H;V5B@HJ/;F+DN_!Y>IJ=<W9\_[0OYF
-MML8F+ONG%VG)R6EW_R+&:/@86!@XB'9^ZH_GM_=W-T<'AP<'Q[='!R>/ZXX&
-MUF@(R(BHQHZ;WS>IZ>DI%\??$RM"#AXFYF;FYB:F_N[:(__'5VD)"6G7YWN>
-M%@CX&!AX2.BVCAM?-ZEIB6GIJ7<'?S-*;B9&=A;6=L9><ON_AW=7J:D7MZ=3
-MBFXF-M8HZ.BH!FYC-XGYV5EY"4=;YFCX6""@&+@HAI);?\=W5RGI:8F):2F7
-MYX/N1NA(^/BXB/:^6^?7:0D)B2GWYR^KKJ9&%BAHJ`8.0Y<)>:'9.2G_;BAX
-MH&!@(!C(]@X[_P=W%]>IZ6D)2<D)Z3</4C8(>%A8&$A6WCLGE^EI:>FIE\>G
-M;[O"_@:6*&B(%IX+E_FA88$AN8>.B"``0+``(#@6[O/G-]>IJ>F)R3F9F?G)
-M%^\^*'@@X.!82';N4\>IZ6EI*5=W1R>_@UK^QE9H",C(%F(?"6'!L3%A.3]V
-M&,!P<'!`(+B64D,G1Q?IB;D9H2$AH?DISWYHV."`8*`XUFY3QU?I:6GI*5>7
-M1Z>ORIZVJ(C(2`AHECKW28%Q<7%!F6=VH+!0K-"0`)BH;B]'*8GY6:'A@>$A
-M&>F?/NC88`"`X'@H/N_WZ<E)20GI5T<?K\H.)K;6J"@HJ':&7CZC*9EAD=%Q
-M,9F/:$#0[(RL$`"(GG\IR9D96>'AX6&A.5?CQC@@@,!@&(A^OY<)N;G)Z=>'
-M[]M:/EYFQ@9F'D[2^MIB6K(.)C+7N2%1T3&Q*6;@+.P,C'``R(^W"3E)>3F9
-M8>'AX0D?ICC@P``@>`83!VE)"0FIEX>O`Y(&MJ@H-EYJOP<71Q\3C@8V5G9V
-MECK)H4'MK3&!N_B0C(P,[&`8_A=7.3D98>'!L>%Y1S88P+#`8&@N#VE)R4F)
-MZ5<'GQ+VZ/AX:+9+-PGYR2E?CD8H"(AHR*B7@4&-3=$Q_V`L?#Q,#"`&V]D9
-M(>&AL4&!0;G2N/"LK##H@QDQ08$9QULF)AX6EFC8^,C&I[EA`>'Y/T8(V!@X
-M"*BHEA;HMRW-?>6]X<:\)`2$O*P&D9&M4<&Q(0'QR;,X[+S\#."'+7T]37$?
-M.##PL&#H:&AFIE]Y`7%!H0>(((!@R&8C/RJZ?B9K,Z=AS<WMS0D`[*3<W,Q*
-MI\&-L;&A%\D.&N8P,!!0&)NQ#0U-D:=HT"R0P,;;J9FI"2GGEX.N-CAHZ/Y'
-M]VD7*HZHJ`8FHP+V`O$]S9W-J-`DA"1<<O'1'>UY=\C&B&CBP/"PD*AY+?U-
-M;=D@$`SL(%Z9X2'9)Y\#CKMFJ(@X1D)W>6G7&Y86*#;>_J+FJ-89'=U]?2[,
-MY+2DO&H];4VM?I;8%C+H7L`LL"!?T0U-+2':P$#`X$;^C^>W>;G9":ZH(."X
-MQC>)28DC@@Z>2LX&:'@(=F*74:6ES9'`W&1DC&!A3='Q::CHJ*\F.%C0\'C_
-M0:TML:DK!IX+CI888)@>^3&1P;_8,'#8(LE9B=]>]CX;YT^2]@C(%JXCZNG-
-M)?V-*<RDA)Q`2LWM03D(N$B[AZ@(,-`@YJ&143&)_T(ZI^X(X,#X$P&M$2'F
-M0-`PJ*GA(3=^2,A^9\E7RR@8.!8#=\=B3XW=S>WNS*1D+$A93;&9B(#XZ'D7
-MGLC00/C?P;'Q.0=W3V<N.``P>'_!+9'YUK"0@(ZY(3EKJ,BV?RF)IQ[H2):>
-MZ\]KQM(MI9UM3KPDY*PJ`6VA6F#@9F<!:5;`+,"V>4&!H6?'R0FI!F"0L";9
-MK:WA[H`PX*9I>2FNB,@FQ\D)9_XH:':^(INSZY*V$JVE?:W63%Q<``<AL9-H
-M@`@'.<'?F/!0V#NA(4DIXZFA(4EFX'"`ZR$1L:EH`.`HOPGISW9(Z+(WZ1>_
-M2L[FME96ADIGQ\/N(7T=#6DL_*3L#E<!YQ:@F$<)`>E(0*R`)@DAR0D':>$A
-M:5:`L-BW8?'AKTA@2+)7B5\^R+BV+RDI1\LFAN8./E[>#B._@XZ)3=U-83"\
-MW`SVW]FG*)B8QPGAB8B`$(!&=SD7Z1>Y`8&Y-F"P(#^A0:%OZ!BHZ]<I4Z8(
-M"#:[U^D7TSZVMJ9^?J:.0U_/[O^M'7T1.,P</)BGN??H&%CO2:'Y%F!PP)8'
-MN7?W*?FQP0EHL#!8Y^'!V:,H2,8/=T>ZAE:6OMOGAR=/F_*&%JBVRB=G2T;Z
-MK5V=T:"\G$SVZ3GCX(`@5^$!^4A`$&!^5SF?)RE9\<&I^##`B&GA(=?FUK:/
-MJ7>CJ`B(AL.'U\=_H^IBAJ@(%AI_=Y<W@<W-T4ZLC,P@"J>/"+B8`TFY"18@
-MP.!VKXDWMVDY8>'I!J!8*&?)">?>AL[?5T<[%HCHALO?!U^_`VNJ[GXF)OXN
-M8HX.6;W=S6D03+RP:F>KV&"@*Z$A>=X@P(`HNH>/[VDA,;&Y1H!@B(>9N2<&
-M%MX_*:G/AB@H-NXJLT^G)U_3OO8HEM)/)_.)[?W-(6!L#/`N0Y)8`*`^&:'Y
-MPJ```,C.IV<?:9EAX0E#EA:F\T<?Z^9F`C_W!V_N9F8&9F9^HF_'YV_J;E[>
-MXCM+SJ9IC1V]6;`,#$`;6S8`0)A382$))J#@((@&P@J/^6%!X:D2Z%;^#P=O
-M2IZ.&S_GOR/R/E[&MD;.[Q<IYW(6Z#::WZ=*1M*QG1TM=FS,+/;?/J!P(`:9
-MX0G[>*!8");&+B*IX4$!2:\V%O[JWR\JHF)3OQ_OBUJ^SN8V=F:J)U>7#XZ6
-MU@;:SV_R-BG-73UYD,R,(/\Z.'"P"-=A^6>HF/BX:(CV/N<AP<&9IS*^^V,#
-MJXYBNF/OKV^S<\K.YI86MJYO1V<[[A[.\KL3^N96^G$=W:TH;&R0)O.(`'"8
-MBWD9YQ*(B&A(N#@VX[D!`2%IGWIN,A**ZGO3FZ/+&^\/+W*F-JB6'A/'=U\Z
-M?B:^2GL"QBCCK5T=<=AL[,!B,MAPD$BG(?G/IFA6J$@8>$9_H4&!&3>_DR^#
-MKB[..K.;R_H;3R=_<L8HZ/8.KZ?GCVHBXJOK(BYFUJ^M'?U!V"Q0X)K.(/`P
-M"%_YB0-.=D;6.-@X9F=9`2&Y!P^GQZ?:WJ:N(QM*XJM/9Z>*YA8H-LX++X_O
-M0[L*`BY2TJ8VGRT=/8$8K!"@#L:`<$`HQSEI,Z[F9A;X()CVG]D!X0E_JD_I
-MN1=:5JBF*H/K"C,G!R^^%JC&CLK+:Z*RXMH:FNMC2E[>^<T=C7<`T+#(!GA`
-M,"#"5XD'PKXFIJCXV#AF!]EAH6DGC\?IZ5\.=G;^:X-+>V^G)P/^EJ@VGH)J
-M"OJJXX-[.VNB+HZ2Z2V];?F(``"8:)C`0.!6?[<WSRONOH8(.$B6NVD9V;GI
-ME_?WY^]Z_B:>DKH[@\__SR-RYG;V!@[*JDH:VIJK@Y,;>N[NU]%-[9E&6&"8
-M")@`P.#(.I]')Y,:PJYV*.@H)G_IR4EIZ>GIER<S<CZFWCXN0NKS+S^ONJ9&
-MQJ8B*OHRKG*Z>UL;8Y/;[_F1K8$W&I:(:+@@X*"@R`9.(T-+RJ,[2HL2/A([
-ML[_G!Q>I%[?')T\3*B*B"KJZ^CK+JV*.OK[2VD*NCO[^[G+":OL#$Y,OEUD9
-M)Y]W)V_34@:FQE;V=JAVUF@H!B8NBRIJPX_OCT\_I]]_I]\?WQ^/3]_??\\#
-MJOJ2/MZ>O@Z^IJ9^CF[N,AH*"[NK+PE9]W_IZ9='/R[NCC9V=NCHZ,A(UL9F
-M$N*">S^_[X]O/^?G)X<'Y^=?_W\?GW\O*QK"3M[>'GX^IN:>S@[N4E(:"VNJ
-M:RLOB7EG)TD)5[?O[AK"QG96B.@H"`C6]@82VCI#3]/#\Z]_9^<G)^=G9]\_
-MIV>G3^.JRF*.GEY>'MZF7GY.SHZNHNL[FQM+BSO;I\F)/Q<)J;?GBV[:?K:V
-M5F@HB,CH1H:^HB+*$V^ST^\/I^>GIR>G)R>??Z>G?^^;ZZH"3G[^_DX^IJ8^
-M#L[.+H)Z2JI+"\L+NP>YJ;\IR5='WYI"*IZV-J@H%BB(5L;&3B)B*A.S2Z/S
-M;Z>G_Q\G)^<G?Y\G)U]/8XLK&NX^?G[^'B8F7AY^#E+"F@HJB[L;8UL[LQ=)
-MA[]IB1<';T(*ZUY&]BBHUNAH=L;&/G)"BR_CRX.O3Z=??Z=G9^<GWZ?G)W]O
-MH^OJ@LY^?IZ>'J:F'OX^#B[R6FHKJPM;\S-[:Q^):>_'">DW)SMRZ\)F1A8H
-MUE9H*#:V9FX2HEMS>]OS[]_GIZ=G!X>'7W^G)]]/`\L+.BX.SGY>IB8F7EZF
-M'DXNPIHZ"LO#D_-3[V^O;T>)MT]7:?=?+V(".IY&]E:HUBB(J#:VWG+:"],S
-M@Z]/7V?GYX>'YR???Y_??T\O&^KZ$DY^'EY>IB8F7J9^;I*BJ@M+HX.S[X]3
-M\W//ERF_?RDI!S^;DOI"9K;VUA86Z"CVQF:.0AK[DP,S[S\G9R>GYV?GI[\/
-M_W\/+V.+ZAJN3OZ>?AZFIMX>GD[N\AIJ"SN;PR_O[X_OTQ]7UZ^G5W<GC^I2
-MVNYFQO86-G8H5D8&IM*BBF/3LW/OOR?GIR>'A^<?#V_/SR^#BVHZ@NX^_G[^
-M_MX>/KX^CC*B2BKKF_-SLQ.O<_.O9ZEG;S?7Q__SXB+Z_H9&EI8VUJ@VAN:.
-MHKI+<T.S+X\_IU^?7R<G7S\/S[^/$Z,K2IKR3OZ>GI[>7IZ^#FY28LIK"TL;
-M@_/3DQ,OWT<'IV='!Z=O2\H:+AYF1K:V]I8V!N;^KF+J>]NC\Z\/?]^GIU]?
-M)U^_CX_OT\-+BOKBDB[.?AZ>WAY^/LXN<N+**[O;@W.OTU-_1[=?YS>W)\];
-MBLJ"OJ:&QL9&]K:&YI[NPCKK>YM;PU,/S\\_7Z>?GQ^??S]O<\.["MHR[@Z^
-M?A[>WG[.#FYRXGKJ:WL#\]/OCP\_WU\??W\_CY-;:PJBDNZ^'EZF)J;>GK[N
-M$@)Z"JH+^UO#,Y,O;V^/#\\/CV\O<V-[:RJZFMHB@H*"@@)"`F)B8LI;$R-[
-M;\\O8[NKJVOZ@K(2TE)NCE+"`II*BBHKZFHKRYNCV]NC8X,#`X-#,[,SPX-C
-M8Z-[N^LJ"AKB@L(R<I)R<O("`N*B6IHZ"BIK2[M[8^,CPP/#0[-#PP,#8]O[
-M^TMKJHI*.AJB8L)"PD)"PN(BFDH*:BKKR_L;6R/C8^,;^POKZHK*2DI*2@IJ
-M*FO+NSM[^SM+ZZNKJZNK*ZJKRPOJZSO+"\MKZVLJBLHZ&MHB@B):(J+:FOI*
-MZJN+.YO;V]L;&]N;>WO[NTM+"PM+2[O[.[N["ZHJ*HJZ^MJBVMI:&OHZ^KK*
-MBBHK:PO+R\O+BPMKJZNKJBJJZVN+RPL+RVLK*ZJJ*RNK*JHJJBLK:XOKZ^MK
-MBVLKJRNKJZKJBFKJBFIJ:HH*"HJ*BFJKZ^OKZ^N+:^N+"PL+"VMK:^LKZ^NJ
-M:JOK*RLKJJOKZZKJZBHJ*JJJZFIJ:HIJZBJJJJJJJBOKZ^OKZ^OKZZNKJRMK
-MBVOKZ^OK"TO+:RNK*NIJ:FIJZBJJJRHJ:FJ*"HJ*ZJHJJJN+ZZOK*^MK*RLK
-MJZNKZ^N+"\M+"VOKJZJJ*BJJJNIJ:NHJJJOKZXL+B^LKJBHJB@K*2DK*:NIJ
-MJBOKBVOKZVMKZ^LK*RLK*RLKJRMKBXN+JVHJJ^KJ*BJJJZNKJJLJZJJK*^LK
-MJZNKJBJJ*NJJJJLK*^MKZZNJJJJK*ZNK*RLK*RLJ*BKJ*BJJJJJJZNHJ*^MK
-M:VN+"POK*ZNJ*NKJ:FHJZZHJJRIJZNKJ*NKJ*JOKZ^MKBPL+:VMKZZNKJJHJ
-M*BKJZBHJJJJJJBKJZNHJJBOKBVN+BVOKZ^NKJZJKJ^OKZRLKJZNJ*NHJ*FJ*
-MBNJJ*RNKZVOK:VOK*ZKJ:HJ*ZJJKJZOK:^OK*ZNJ*BKJBFKJJJNKJRMK:VN+
-M"VMK:^OK*ZHJ*NKJZNHJJJJK*RNKZHIJJBNK*ROK:VMK:XMKZ^NK*^LJ*JHJ
-M*BHJ*JHJZNKJ:NKJZFKJZJOK:XN+"XN+BVN+:RLK*RLKJBHJZFKJ:HIJZJHJ
-MJROK*ZLKJZJKJRMK"\O+B^NKJZJJ*NKJJJLJ*BH*2NJJJJNKJZLK*VMKBXMK
-M*RNKJZLKZZNJ*NKJ*BHJ*JJJJJJJ*BJJJJJJ*^MKBXN+:VOK*ZNJJJJJ*NHJ
-MJJHJJJLK*ZHJZNJJJJJJJBHJJFO+:XO+:^OKZ^LK*ZNK*RNKJBHJ:HKJZHJ*
-MZBJJ*NKJJRLKJZJK*^MKZ^LKZ^N+"XN+:^LKJZJJJZNKJZKJ:FIJ:NKJ*JJJ
-MJ^N+RTM+RXN+*@HJZFHJ*BHJJNIJZBJKJRLKJ^OK*ZLKJRLK*ZNK*^MKZZNK
-MJRHJ*JJJJJJJJBIJ*BJJJJJK*^MK:VOK*ZJJ*JJKZRLKZRLKJZNKJZNJJBJJ
-MJ^JJJ^KJZNJK*RLKZROK:VMK:VOKJZNJJRLK*ZNJ*BKJ:NIJ:FIJZBJK*ROK
-MZ^MK:VMK:^LKJRHJZBJJJNOKJZHJ:HH*"HIJ*BJJ*VL+2XMKRPMK:^NKJRJJ
-MJJJKJZLJ*BJJJJHKJZHJZNKJ*BJJJJNKJROKZVN+:VN+:^LKJRKJ:NKJJJLJ
-M*BHJJRNKJBKJ:FIJZNJJ*XL+"PO+RPN+RXLJJJHJ*NIJZNKJZNKJ*BHJ*BJK
-MJJLKJROK:VOKZROKBVMK:RNK*RNKJBLKJZNJ*NKJZFIJZBJK*VOKJRHJJJHJ
-MJJNK*^OK:^OK*RNKJBK*2NIJZBHJ*VMK:VLKJZLKJJJKZ^OKZ^LK:VLKJZNK
-MJNJ*"@J*:NHJJJLK:VMK:VOKJZJKJBKJ*JJK*^OK:XMKZZNJ*BHJ:HJ*:NKJ
-MJJOK*XL+ZXMK*ZJJ*JJJJZNJJZNJ*BJJ*BHJ*JHK*RMKZRLKZRNKZRLK*RLK
-MJZOJZBJJJZLKZRLKJZHJJJKJ*BHJJJNKJRLKJZNKJZNKZVMK:^LK:HHJ:FHJ
-M*BHJJBLK:XN+ZRNJ*BJJJNHJ*JNKZ^OKZXOK*ZNJJBKJJBHJJJNK*^LKJZJJ
-MZFIJZBJKZXL+BVOK*RLK*ZNJ*BKJZNHJ*JNJ*BKK*ZHKJ^HJJZLK*RLKZRLK
-M*ROK*ZHJJBHJJJNKZRLKJJJJJBJJ*NIJ:NJJ*^N+BVMKZRLKJZNKJZNK*RNK
-M*ROKZ^OK*FIJ:BJJJZNJ*BJJJ^JJZRHJJBJJ*^LK*RLK*^OK*RLK*ZNJJBHJ
-MJJNJ*JHJ*JJJJZNKJBJJJJJKJJNK*^OK:^OKZ^LK*RLK*RKJ:NHJJJJJ*BKJ
-M*JHKZ^MK:^MKRVNKZRNJ*BKJ:FKJJJNJJZNJJROKZVMKZVLK*^MKBVOKZZHJ
-MZHJ*BHIJ:FH*BFHJJ^MKBVOK*RLK*^MK:^OK:^LKZ^LKJZNKJBHJZBHJJZJ*
-M:NH*:JJK*VMKZRLK*RLK*RLK*^MK:^LKZRNKJZKJBNHJJBHJ*NKJZNJJJZLK
-M*RLKZVMKB^LKJJJJJJJK*RNJJJKJ:FIJ:FIJBFJKZVMKRSO+BPMKZRNKJJHJ
-MZNHJJJNJJRLK*ZLJZNKJ:FKJ*NJJJRMK:VMKZVOKZ^OK*RNJ*JHKJZHJ*JJJ
-M*NIJZNHJJJOKZVMK:^NJJJJJ*BJJ*JHJ"BJKJJLKZXN+"XN+BXOKJZJKJZNK
-M*NKJ:BJJJJNJ*JHJJZJJJJNKJJHJ*JJK:VN+:^LKJZNKJRNKJVLJ2BKJJJNK
-MJJOKJRNJ*JNJ*JJJZJN+*ROK*^NK*JLJJROK*VN+:VOK*RLK*RNK*BHJ*BKJ
-MZBKJBHJ*:BJK*RMK:PM+"VOKZ^OKZRNKJZLJZBHJ*NHJ*NKJ*JJKJZLJJJLK
-M:^MK*^JKZROKZZNKJZJJJRLK*^LKJRNK*RNJ*BKJ:@IJZJMKBXOK*RNKJZNK
-MJZNKJRNKJZLK*^LKJZNKJBHJ*FIJ:FIJ*JOK:VNKJJJK*^MK:^N+RRLJJNIJ
-MB@IJ:NKJJJJJJZNKJZLKJRLK*VMKZ^MKZVN+"XN+:VOK*RIJ"LI*R@IJ*JLK
-MZVOK*RLK*^OKJRLKZ^OK*ZLJJJKJ:NKJZFHJ*RLJZ^LKZVMK:VOK*ZNJ*NKJ
-MZBJJJZNKJZNJJJHJZNKJJJJKJRLK*^LK*^OKZVMK:^OKZ^OK*ZHJ*JKJZNIJ
-MZJJJJJJJ*JNKJZLJ*NHJJBJJBTO+RTMKZ^NK*NKJZNKJ*JHK:VOK*ZNK*NIJ
-MBFKJZNKJ*JHKBXN+BXN+BXN+Z^NJZBJJJJNK*ZLK*BHJ*BHJ*BHJJJJK*ROK
-M:XMKZ^NKJBLJBJJJ*JJJJJJJJROKZZNKJNKJ*JJJJRNKJJLKZRLKJBHJJJLK
-MZVOK*ZKJ:FIJZNHJ*JHK:PL+"VOKJ^KJ:NJKZVN+BVLKJZNJJJKJBHH*BJKK
-MJ^L+:VMK*ZNJ*BHJJJJKJJJJJZLK*^OK*ZNKJJHJ:FIJBFIJ:BJK*BJK*XL+
-MBXN+:^LK*ZJJJ^OKZVOK*ZLJ:NKJJJJJ*HJ*ZBJK*^MK*HJJJJHKZ^OKZ^LK
-MJJJJ*JLK*RNK*RLKJRHJ*BHJ*BJJJJJJJROK"XMK*ZNJJJHJJJJJ*JJJJROK
-MZ^OK*ZHJ*BHJZNJJJZNK*^OKZRNKJJJ+"ZNKJRKJ*BHJ*NHJJJLKJZNK*NKJ
-M*JJK:PN+:VMKZROKJRHJ:NHJJZNKJRHJZFHJJBOKZZLJZJJJJBNKJZNKJROK
-M:^OKZZNK*JLKJJHJJHH**NKJJROK:VOKZ^LKJROKZ^LKJJJKJZNK*RLKJRIJ
-M:BHJJJJK*RLK*ZNK*^OK*ZJJJJJJJJJJJBJJ*JJJ*BHJ*JJJJBLK*ZJJJZLK
-MJZKK2[N+BVNKJZHJJNJJJJJJJJNK*^LKJZHJZFIJZNKJ*BHJJJJKZVN+R\O+
-M2\N+*ZHJ*BHJZFJ*BFKJZJJK*ZNKJZNJJJJJJROK:PL+BXMKBVOJBFK*"HKJ
-MZJJJ*VMK:^LKZRLK*ZNKJRNK*^OK:^NKJJJKJBHJ*FJ*B@J*:BJJJBLKZ^MK
-MBVMK"PL+"XN+:^OK*ZNKJBKJ:FIJ:NKJ*BKJZBNKZJNJ*JJJJZNK*^OKZRNJ
-MJBOKBVMK:VMKBRLKJBHJZFIJ:NIJ:FKJJJLKZRLK*ROK*RLKZ^OK*ZNKJ^MK
-M"XN+ZZNJ*BHJZBHJ*BHJ*JNK:FJK*NHJJBLK*^LK*ROKZ^OK*ZNKJZNKJJHJ
-MJJJJJZNK*ZLKZ^LK*ROK*RNK*ZHJ*BHJJJHJ*BJKJZNJJJJJJJNJ*RNKJZNK
-MJ^MKZVOKJ^L+B^OKJ^IJBHKJZNKJ*NKJZBHJJJJJJZLKZVN+"\O+RPMK*ZNJ
-M*NKJZFHJJJNKJNHJ*JJKZRNJJZJJJZLK*^OKZ^OK*ZNKJZJJJZNKJZHJ*HHJ
-M*ZOKZZNKJZNKZVN+BXMK*ZLJ:HJ*:FKJ*BHJJJJJJZNJJJHJZNHJJVN+"PL+
-M"VMKZ^OK*^LKJZLJ*JHJZNIJ:FIJ:NIJ:BJKZXL+BVMKRXLKZZNKJZLKJZNK
-MJRNKJBKJZBJJ*BHJ*JJJJJJJJRNJJ^OK:VN+ZZLJ:NKJZBJJJZNKJZLKJZJK
-MJJJJZFKJ*JLK*^MK:XL+"XMK:^OKZZN*ZBJ*:NKJJBHJJJOKBVLK*ZHJJJLK
-MJZLJJJJJJ^OK*RNJJJNKJZNKJJJJJBHJ*BHJ*^LKZRLK*RNJ*JJK*^OKZ^MK
-MZRNK*BHJZBKJJJHJ:\L+:VLKJZHJZBKJ*JJJJBJJJROK*^OKZZNKJBJJJZNK
-MJZNJJJLJ*BJJJBOKZRLKJZJJJJJJJRNKJBHJJ^LK:VOK:^LK*ZNK*NKJZJHJ
-M*BNK*NMKZROKZZLJZNKJJJLKJRNK*RNJJJHJZJHJZBJJJJNK*VMKBXOK*ZNJ
-MJBJJJ^LKJZHJJBHJ*BJJJZNKJNKJ*NKJ*JHK*RLK*RLK*RLKJ^O+*ZLK*ZNK
-M*JKJZFJ*:FKJJVN+BXMKBXOK*^LKZVMKBVOKJNIJ:NKJ:HH*BFHJJ^MK:^OK
-M*ZJJJRLK*^OK*ROKZRNKJZLKJ^KJZFJ*:NHJBDKJJRMKBVMKBXN+ZRLK*ZNJ
-MJJJJJZLKZRNKJJHJ*JNJJJLJJBHJZBJKZ^LK*ZNK*^OKZRLK*ZHJ*NJJ*RLK
-M*ZJJJBHJ*BHJ*JJJ*^OKZZHKBVMKB^NKJRHJZFKJZJJKJ^OKZVN+:RNJ*NKJ
-MZHJ*:NHJ:FJJ*^N+"PL+2\N+"^LK*ZJKJZOK:VOKZZJJ*NHJ:@KJ*NJ*RFHK
-M:XMKB^NK:ZIJJ^MKBVLK*JLK:XOKJNIJJFIJ:FJ*"NL#6[)RJU/K)K9[!X/S
-M/Q.S?\XV$D=I#]8HBYO/JIY;OJ(CWS]")N9"F]_W!V+>PAZV&AM?Y[,O3^IN
-M^^_OT_HNPC*./J8F6@M[P\\/\ZI*DQ/;@DK/,SJ[.ZICC[HF)O(:3OKJ(J?O
-MFH,K\NICDT-CD_.BNN,2^F)^,D-3X\*F$N)3_P_O*F,"6JN:KY,/RN[*`H+J
-M8G*:"^LJNSMC8T.J.D.;NDJN[IIK*BM+._N[HRJZ^ZH;`YI"Z[MJBK(;VSM;
-MBP/JJQK2\B)JLB,OV]N*VKIC,XMKJ^JZVJMZ"EOSJUI:>FNJ:IO[*\K"BPLK
-M>XM#$SJ">IKZ.^N+V\JZ@FNC^TOB@OH[FXIJVEHK.^O[RTL;NQLKZCNKZBJB
-M>OM[ZYJJ^ZH+ZN)B"[L*"J*:ZH-;>UM+XWIR>LKJRHL+.XMJXYNCVWIZ:ALK
-M2KIB2@O+BJN+>GJJ8WMJBOKKJRMJ.QNJJYK*NUOJ&JO*NYNJ6L*[HZ,K`EH:
-MZWM[2ZIK*OL+BTO[VVLJBHI*ZLI*RVO*"CKJNGK*JVN;NZL+2]NJ2@KZRNO;
-MRVM+2^LJ:OJZ"NOJBBN+ZRLJRCHK*XOK^KHJ2PO[*TL;>YN*2IHJZ\I*&NJK
-M2RMKB^LJ.FL[RSJZZHO+ZTM+N\LKRVOKRAI:F@H+:XLJBFNKJZLKR@KJ*NM+
-M^PNJJLLK:XNK*XJ*NBN*.NMK>ZLJZVNKRLJ*2SNJ2RL"#B["FNH+^UOC8X-C
-M8R.C&YL[NPN+*ZLJZHJ*RLI*2DI*2LI*RLH*"FIJZNHJ*JNK*ZLK*^OKZ^MK
-MZ^OKZROK*^LK*RLKJRNK*ZNKJZNKJZJKJJNJJZJKJJNJJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNK________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M__________________________________________________\`````````
-M````````````````````````````````````````````````````````````
-:````````````````````````````````````
-`
-end
diff --git a/share/isdn/2.g711a.uu b/share/isdn/2.g711a.uu
deleted file mode 100644
index 53e09cc226e3..000000000000
--- a/share/isdn/2.g711a.uu
+++ /dev/null
@@ -1,277 +0,0 @@
-begin 644 2.g711a
-MZ^LKJBKJZBHJJROKZFJKZBHJ*BKJZJJKZXL+R\L+B^LKJZHJ*BKJ:HJ*ZBJJ
-MJ^MK:ZMJRLH*BNKJ:BHK:PM+N[N[2PMK*ZNJJJNJJNIJZBJJJZNJJZNJZHJ*
-M:FHK:^N+"XN+B^OK*ZJKJZLJZNHJ*BHJZBHJ:FJ*ZJJK*^OK*RLKZRLKZ^OK
-MZVN+BVMK*RKJ:FKJZNIJ:BJK*ROK"TO+"VLKJBKJ*BKJZNJK*RJKBXMKB^NJ
-MZFIJ:FKJZNJJJROKBPO+RVOK*ZLJ:NHJ*BJJJROKZZNJ*NKJZFIJ:FKJ*JJK
-M*ZNJJROKBXN+BXN+BXN+ZZHJ*BJJJRNKJBKJJJKJ*NIJ:FJ*:FJK:XL+BPL+
-M"VLK*RNKJZKJZNKJ*BJJJBHJJJNJJZJJJZNKJZLKZXL+"XLK*RNJZFIJ:FIJ
-MZBHJJRMKZVMK*ZNJJBJJJRNJJXMKBPMK:^LK*RKJ:HJ*:BKJ*JJJJZNJJJLK
-MZVOK*RLKJZJKJZJK*RNKJJHJZJJJJJLJZNHJ*BHJJBOK:VOKZ^OKJZNKJZNK
-MJJNKJZLKZTL+ZXMK*RLK*BHJ*BKJZNIJ:NHJJRNKJJNKJJNKZ^MKBVLK*ZNK
-MJZNK*ZNKJJHJZNHJ*JHK*ZNJ*JJKZZOJ*JJJJ^OKZ^OK:RLKJRHJJBKJBHIJ
-MBBHJJJJJZ^MK2[O+RPOKZ^OJ*BLJJJJ*JBJ*J^KJJXJJJBJK*^LJ*ZMJ*VOK
-MZXO+:XMKJBHJJZJJZHJ*BBJKJJHKZFJK*^NJ*FLKJZOKZZKK"PL+:XN+:ROJ
-MBHIJ:HKJZBJK*XOKJZHJJZLJ*JJKJJJKJBMKB\L+:^LKJRKJ:NHJ*JJJJJJJ
-MJZJJJROK:VMKZ^LK*RLK*RLKJRJJ*HHJ*RHJ*NHJJJHJ:NKJ*JNKJRN+"PMK
-M*VMKZZLJBNJK*^LKJ^MK:VNK*BHJ*JHJ*FJ*BBJJJRLKZ^MK:^OKJBHJ*BHJ
-M*BJJJRMK:^NK*ZLK"^NJJ^IJZNJJ*BJKZXN+:RLK*ZNJ*NHJ*BJJJ^MK:^LK
-MJZKJBHIJZNJJJBMK:PO+RPN+:VNK*JJJ*BHJZFKJ*JMK:^OK*ZNJ*BIJ*BJJ
-M*ZKJJVN+"\L+"^NKBZN*ZPK*JLIJJRJJ:ZLJ*^IJJBKJJBHJZVN+"^OJJNL+
-M._O+:ZIJ*JNKJNH*RHIJJBMKBRN*NDIJJVMKZRLK:TN[2PNKJBLJJJLJZNIJ
-MZJJKJBHJZBHJ*^OK*RNKJZNK*^OKJZHJZJHK*ZLJZBJJJJNK*RNKJJJJJZNK
-MJZNK*^OK:VMKZRLKJZNJJRNK*^MK"XMKZZN*^KHZ.LJ**NMK"TM+"PL+:VN+
-M*ZLJZBKJ*BHJJBJJ*BJJ*BKJZNIJZBJJ*^N+"\L+"XMKZRNKJBKJ*NKJZFKJ
-M*JHK*ZNKJZLKJZHJJJHJZBKKJJHKJROKZ^MK:VOKJZKJZNHJJJHKZ^MKZ^LK
-M*ZLJJBKJBHJ*ZBHJ*JHKZVOKZZNKJZLK*^N+B\L+:VMK*ZNKZFIJBFKJZFIJ
-M*JOK:PL+*^JK*FKJZNJJJJNKJJHKZXN+BXMKZZNKJRJJJJHJZBHJ*JJJJRLK
-M*RLKJZJJJBHJ*NHJ*JJJ*RNK*^OKZVMK*RNJ*NKJJJJJJZOKZ^MK*RHJJHJ*
-MBHJ**JKKBPN+"XN+:^OK*^LKJNHJ*JLKZZNKJBKJ*NIJBFIJ*JJK*^MKBVMK
-M:^OKZROK*RNJ*BKJ*JJJJJJJ*FKJ*JNK*ZNJJJHJZNIJ*RLK"PO+RXMK*ZNK
-MJRIJ:FHJJJLKZ^MK*ZHJZFKJJBNK*ROK:^LKJZOK:PO+"^NJZHK*2DK*"NJJ
-MJZLK*^LKZZNJJZJK*RLKZ^OKZ^OKB\OKZRLJZFJ*:FHJJJLK*^OK*RLKJBKJ
-MZNHJJJOKZVMKZ^LK*^LKJJJJJJJKJZHJ*JJK*ROK*ZNKJZJJJROK*ZLK*RLK
-MZRNKJZNKJBHJJJKJBJJJZNHJ*JHJ*JNKZXN+"\O+"XN+ZZNJJZJJ*RNKJRKJ
-M:FJ*BHJ*BHIJZNJKZXL+RPMKZ^N+:^LK*BHJ*JJKZRLK*ZJK*BHJZNIJBHH*
-M:NO+BXN+:VOK*ZNJJZHJ*NKJZJJJJZHJZFIJZNHJJROKBVMK:XN+:^OKJZNK
-M*^LK*RNKJZHJ*BKJZNHJ*JHKZVOK*^LKJBHJ*JHK*RLK*^OKZFHJ*NKJZFIJ
-MZNJK*RLK*VMKB^LKJRKJ*BHJJJMKBXN+"PL+:VLKJ^IJ:FKJ:FIJBNKJ:NKJ
-MJJJK*^LKZRLKZ^MK"PO+"VNKJJJJJZJJJFJJJ@IJ:HIJZBJJJRMK"\O+B^OK
-M*ZNJ*JJJJZNKJJJJ*NKJZNKJ*JJJ*JJKJZLKZ^MK:VN+:RLK*ZNJJZJKJZJJ
-MJBHJJJNJ*BHJJJJKJZJKJ^KJ*ROKBXN+Z^HK"ZL*JLLJBNOKJJMKJ^JK*VIJ
-MZHI*:BKJ*NOKJ^N+:ROKB^OKBVNJJRNKJJKJ:NHJJNKJ*JHJ*JJJJJNJ*ROK
-M:XL+"VN+R\NK*RNJ*BKJZFIJZHIJZBJJ*JJKJZNKZ^OKZ^OK:VMKZ^OK*RNJ
-MJZLJZNKJZ@J*:NKJ*JLKZVMK:VMK*ZNKJZNK*VMKBPL+:RNJ*BIJZNK*BBIJ
-M:BHJJJLK*RMK:XL+:^NJJBKJJBMKBPL+BRNKJNH*"HH*"HIJZJJKJRMK:XN+
-M"VOKZRLK*RLKJZNK*RLK*ZJJ*NIJ:NKJZNKJZNJJ*TM+"TO+"TL+BVNK*NIJ
-MBHIJZNJJJZJJJNIJ:NKJZBJJ*XL+R\O+RPMKZZNKJZJKJZHJZFIJBNIJ:NHJ
-MJZJJJJNJJJHJ*JHKZ^N+"PN+Z^OKZFIJ"HIJZBJK*^OKZVMKZRLKJZHJZNJJ
-M*^OK*RNKJRLK*RNKJRLKZRLKJZKJ:HKJ*JJK*ZNJJJJJJJJJJZJJJZNKZ^MK
-M:VMK*^NKJJJJZFJJ*@HJZBJJJRNKJ^OK*ROKJZLKJZNK*^MKZ^LKJJNJ*NIJ
-MZNKJ*BJJ*JJK*RNJJJNKJRNKJRN+:^OKBPL+BXOK*ZLJ:HH*R@H*BNJJJZLK
-MJ^JJZRMK:VL+"XMK*^LKJZNKJBIJ*BHJ*NIJ:NIJ:FIJ*JLKZ^N+"PO+2POK
-MJRLKJZKJ:NHJJBNKJZJKJZHJZFJ*BNHJJJOK"PL+RXL+ZZJJ*ZKJJBJJJRLK
-MJZHJZFJ*:BJJJJHJ*BJJ*VN+R\O+"PN+*ZHJZNKJ*NHJ*BHJ*NHJJJLK*^LK
-M*ROK:VMKZRNKJBMK:^OKJZNJ*NIJBHKJ*FI*"FIJJBOK:VN+BXMKZ^LK*RNJ
-M*BOK:XOKZRNJJJNJZFIJB@IJZNHJJJHKZ^OKZ^NK*^LKJZNKJZNKJRLK*RLK
-MJBHJZFHJJJJJJZJKZ^LKZPOK*VLK*^LKZ^LKJZHJ*BHJZFIJZBKJZBJJJJJK
-MJJNJJRLKZ^OKZVMKZVOKJZNKJBKJZNKJ*JJJJ^OK:VLKJZJJJJLK*ROKZ^OK
-M:^LK*RNKBFKJBNJJJROK*ZNJJZNJJBKJ*BHJ*BJJJZOK:VMK:VMKZRNJJBKJ
-M*BIJBHKJ*JLK*^MKZRNJ*NHJ*JJJ*JJK*^MKBXN+:^OKJRNK*JJK*JLKJNJJ
-M*BHJ*BJK*RLK*^NKJJNKJZNJJJNJJROK:VN+:ZLJZFJ*:FKJ*JNKZ^MKBVOK
-MJZJJJBHJJJLK*ROKJRKJZBKJZBJJJJJKJZLK*RLKJBKKBXN+:RNJJJHKZRLK
-M*ZNK*ZHJJBHJZNJ*"HIJ*JJK*^N+"PO+RXLKJRIJ:FHJJZLJJZJJJJKJZNJ*
-MZJLKZVOKJZJKJZOKBXL+2\L+:ZJKZ^IJB@J*:NJJJBNK*^OK*ZNKJZNJ*BKJ
-M*JHKZ^LK*ZNJJRLKZRNKJZNK*NKJZJHKZRLK*RLK*ZNKJZHJJJJK*VMKZ^LK
-M*ZNK*RNK*ROKZZOJJZKJ*NJ*:NKJ*BJKJZJKJZNK*^OK:XMK:VN+ZRLK*BKJ
-M:HIJ*BJJ*RLK*ROKZ^LKJZLKJJJJJJJJJBNK*ZNKJZJJZBHJ*BKJZNHJJROK
-MR_L+RPMK*ZHJZNIJ:NKKKV<"!I.^_A..2A.BZW-K6X,+8R.J>YNZNTO"(XJ:
-M.XLO&UY'6[C?VM:'#J['3AL?6H^CB@.G$V;C*X9STN[O6@_GHWXK(L:#COLO
-M#H\KPU."4RH#2K(;>@MG#J:)-N9W:%]#%I>F6X?V9\HJ\\[O,Y*7HRZ#7MO^
-MM@]./N^NCPLC;Y+GOW[?P^J[VFM:@ONNDA,2(B_.#U):W^:_:J)/^J/:,VKC
-M2U\OEL>H'H]VOTJ>]^XSYPY?[TO;(DJ[)L,N^NHZ*CJC^NK[N[/"BX^NC\H"
-M3R(#>HMK0P(ZJAH[GB/B@J^^#]O[JVM3RGHK[MM[_I\NK[,^+P,Z6ZI"HZ..
-M@\N[NGXOJK*O[F-S[KM*NZ):NNH;FWLZDR]NK\-:.KK+4LOS7O__/B^"Y^:.
-M1RCSOZ8/XY/Z[D=RYE>F3F<FRSZ_"U:'8KX##ZM*9V)NYTIR[QMZKJ,O-N]S
-MIF<JXF^*XZK2I[Z+JW(*RIH.,PJCXHL[TN\:HLM34HJ/+L^Z6BK+ZWMN#[MN
-M!TY#_W+:R^JZ#N^COH?ZCG^+RN:GH^;3KMMR>AK>HX]NB[]KVM^KBD\NPZ:#
-M`Q;W,J:'[IL/FW_B*F-^>VO^+TIN)VZ3K[8G[G(*_H?*DI]J0Z-N:R^2`DL+
-M2X+B&[I*R]ZGXVY/N@^BGJ>.0T,^[X\:VVIK(PY*$HX/#MX/B[H+^[OZ:V-J
-M6T^K^C,C>\X3RHYSVOOB:N_*2\J*TR[B^[*+PF*_6IM;"GMZ*HHN2\N.LROZ
-M"]M3^Z-/@GNSPFK*&W*.JNMJ2LO;.TM*N[-*BZI+FC**@H*J[FI;,ENJ\W-+
-MK\-O.^HC6PJR>H+*PAJZ^LOBFYM+:QH[N^O+:NH[@VIJ`VNK:BHK@J[BCF[J
-M$KHZ:Z,"0^."ZI-+N[./SZJ?$Z\?N^]["VM:B\K2`@H*ZEO3KQ,_KXO[>DZF
-MQK:H*%8HJ/:&GG*#;__W=Y<7U]?GAZ=3\ZJ;;R.*TW.CNVNJ[PGYLR_9B4L.
-M^NOH>!C@H.#`@!@(".AJA\<I.:%AX2%9V=FI+P,JADBX:$@XR%:FKCKSQRDW
-M9U?7Y],O[SH^)M[.TMI7F5^G(7FW#[_GM@A((*#@P(#@2,@(^J<WR7DA(2'9
-M">F7:J8&=NA(:%;V)DX;QY<7Z0D)J3<WIXM./B/IN;H2H;DKYD[_J*#88*#@
-MP("@*-9H`O=I23GAP6&AN;F)R\:VMNA8&.C65E:.)T?G!XDYUV=W%^=NLI=9
-MH>MS01FC)@Y':(!@0&!`D+"`"&CXSJFY27G!,0'AH=G)_VZV%FB@(#CH:(@F
-M+Q\G%XD)Z=<WMV?;GG+G&2&N+_&A;]Z+:8A@H,#@0!`PP$B(6!Y724FYP?$!
-M8:%9^0\^-JAH(.`X:.@(QD^G9W<I20E75[?G;^+#R0&)QEE!%WXH9P(`8$#`
-M@'"P0%BF:*C_N5G)H?%!@2&9^7=:]F@H.."@R%9H:#(?9P>W"<FI-\<7_VYJ
-M!QD!7XI!84?F1JF6P&"P@$`0L+#X!L@&Y_FAR>%QL8%9F?EGCJ@(*)C@H,BV
-MZ.B*1Q?'5WE)J7>'A]M.KMIIP;=&8;$)SE;)JX#@0&``$,#PX`9HJ#K)84D9
-M,3$!6?EY!_JV2.BXH"!XQK;HCB<I%[<)28GI)T\?>X[F/V%9QL>Q6<_H\]=X
-MX&#`8/!`P+!H!E:FGR&A26%!P8$9^:E/2NA("#B8H$@&ED;:WQ=WJ>G7*=?_
-M\Z/J>B=A8>*WL>&'Z/K7^(``0`!PL,#P.&8&7O.A@=F!,;$!6?E7NQ*HF!@8
-MF*!X=H;>JN?IZ6D)Z6F7OV,+"KY+H8%#KX&!Z?9^5]8@@$"`\+``\""6IIZR
-M28$AX<&Q02&9*8^+AC@8F#C86&C&WO(S-REIB2FI5[>_:LY.R[EAI\HA`?F^
-M1JD:F&!`8$`P`/"`:&8^IL?AX:'A`4%A&8G?0Q+H>%@X2!BX5A[Z*W^7Z0DI
-M%ZE7!PNN8AK_V=F;1^'AJ9:R!Q98``!@,,``L""H+M(":6%AX6'!P2'Y=\N"
-MYHC8H+C(.,@6TD./!ZEIB2E7=\<G@V).>DEA!\JYX=FBUA.^""!``$``X$#`
-M^![C4L\9@0&!@<&!H4DOKLXV2."@N$A(B+8*C\>7J8D):=?G)Q_C+J8"*2$I
-MR^E9H2<V(DZH^`#`0,"@`,`@%K.[(VFA`<&!@>$AV<<")L96&*"8.&@H%M[*
-MAZD7%RD):4??CT/CXK[K25GG?^EYN1J^;M;H&.#`,.#8X(#8GL_O1PFA`<&!
-M(9D92=^.]A;H.)@8.*BV)LY;]RDIJ=<IJ0?_(S,#;IZ?V;G3AVEY5VZ21FB(
-M&.`P,*`8(."X<C]G*;FA@<$!63FY*<_>J&C(N/B8N"AF4DK/MZGI*:G7M[?G
-M;WNR#LXG&6FOYREY=]*N-JAHF""PL*`86"`XCH]'Z4G98<'!H;D)J5^NEFBX
-MN$@X.,@V`KO/9Y=I:>E7QP<'7P-2/O[:*4E?KR=I26_BWE:6B#C@L&`8>!@8
-MJ,)/J<DYV>$!@1D)%V=33I9(>+C(R,AHAN+OA\>7Z0D)J;='AY\;KOYFGL<)
-M9\-/5XF?"V[6J&B(&`"`H/A(2*A>R]>Y>7D9X6%9R?=/>U+FZ#CX2(CHJ`8N
-M<\<7J2DIZ2FI]U\SZQJNY@:KU[?O;Y]WA\^SYE;HZ(B@8"#8N,BH!LZ/Z?D9
-MF=FA67F)QY,BSH8H2#BXB%;&IA*OQU<I*:FIJ=?'OPORCKZF!IY?5P?GI[?W
-M7]_*1BAHZ+B@(*"82.A&IF+GB?F9F=G9F3DI)RONWO;H2#A(Z/:F;JK/QU?I
-MB>G7%Y?'#[H.)F9FQAX_ET>'9_?W)U_K9JB(:#B@(*`8.&@&ONIGZ;EYV:'9
-M>4DI9Z-2YM9H"`B(:!8FLD-?QY<IB6FIE\<_&Z+.YD:VMK;.ARF7][>I5T?'
-M8^8HB&@XH*`@H'AH!I["3]>Y&:&A&7DYB7?O\H96*&C(R`BHAA)#GX=W*8F)
-MZ1=GST-K,B9&MD;&AK('5Y>7=ZEW!V<K9BB("/C86*#8^"AFSBO?UTF9H:$9
-M^4GI-P^B9E;H:(B(:%9&OIL?QW?7*>DI5T<?XSJ2?F;&1K9&AA*'*:E7=Q=W
-M1[>OOM8(R/@8V*"@V`C&;GNGEPF9(>&A&;GI-[]*)J@(2$B(*!9&/ILG%^EI
-MZ2FI5T=/BLYF1O9V=O8V1EXOZ<G)B2DIEQ>W2X:(^)B@H*`@(-AH9@I?=VDY
-MH6%AX=G)5Z<CKK9HN'@XR"CV9NZCYU=I"0EIJ3<G+\K^MJCHZ-9&YAY.F@>Y
-M&1GY":G'QQ^"=CB@X&`@(*"@F&BFDY<)^=DA86%AH4EW+Y)FUFBX>)@X:$;.
-MZR\G]^D)R0FI)V.:TG[&%BCHJ,:^>GNSG^EY&5GYB4?3(X)FZ)@@@(#@6/C(
-MZ`9"IVEYH:&AH5G9^>GG^H96Z&B("`AH5F8BCV?W%U<I*5?'OTLN)K9VEA;V
-M1N9.>J^G!ZFY>7DY:7>O.HY&*+@8(.`@&+CH=E["+_=I.9D9&?DYR>DW#R+F
-MEJ@HZ.@HJ#8F@L.?![<W-S='YT^CPAZ&QL:&9J:^8GOOGU]?-XG)28D7WPH2
-MOF;VZ+C8H-CXB-;&'BZ[I]>)N?DY2<F)*7??R[Y&EM86EI9V-F8.JH^G9V?G
-M9V<G3Z-Z4OXF!L9FWFX:"P,O_U\G-^F)B>EWI\O"SF8V*`CX&'@X"*A&GI([
-MGS<I"4FYR0GIU[=?X_*FQG:6=C;&9AXN^J./IX>'9R>?+TNB+DZ>9D9&9L[:
-MVR\_7Z<G9Y?IB6FI!_-R?F:VEB@(.)AXN.@VWI**<Z<W*<DY.<F)5\?_X]J^
-M9C9V]@9>;J*+6Y./OS_/+Z-*$KX>7MY^/H[RNB./7^?GYU\_7S>I*=?'#X*F
-M!C:65B@(N$@(J(:N2U-/'Z>'-]>IUS?G#V-K"MI:6N(BVKH+H\,#V\N*HK*2
-M4NYN#K[^OFXR.KL#4X\_GY]_/Q_'%]=WMZ<[+EY&=A;6*&AHZ*C&3GJC;[^_
-MGR>'Q\>'I\]S&VNJ"WO[N\L+"SL;&WN[*YJRTNZ.C@Y.OD[N0DH+XQ,O;V^/
-MCP]_)X>'9R=/H[JN_J;F!C;V=O9&YC[2>@NC0U//GZ<GIW_/$R,;V]L;V_MK
-M*ZJJ*PN+Z^IZ`G+2$JXNTM*20F)*RX.3+Z_OIW=7U]=W_VH27L;&!C86%E96
-MMJ92BR]/+U.3TR_OC^^3XPNJ:X//'Z=??T_38Z,[JAIROJ8F)J:^K@):FMJB
-M2FL;,Z_3<[,CV^.SD].O+Z^OTW-#HTMJ(E+._GZ>GIY^_DYNDMKJ2UO#,T-#
-M0T/SDY.S(QN[:RLKB_O;6]O;>\O+NSM[>[LKBOJB8F)ZFR_O+R]C>D)R[BX2
-M4@X^?AX^+B(K8Q.30X-CP[.S0R.[JLKZ2HNC0Y-3T_.SL\/#PZ,KVD*N[BZN
-M4G*RDI+"HKJKRSL[.POKZPL[VUN;>_M[&V,SDZ\3X_N+JVJ*2OI:@D)"XIJZ
-M:NH*NGK:VIIZ^CJZN@KJ*\M[6Z,CH]N;NTL+:ZH*.IJ:.HHKN]MC8V/C(R/C
-M(YN[ZPJ:VIK*ZTM[VTMJFJ+B@B*:&N*R$M(R`IIJ:XN+:^L+^R.STU/S8YM+
-MNWN;FQN;2^LJ:BJJJZNJ:DKZFMK:&IJ:>OKZ.CHZ2NHKB\M+2SL[NTN[.SL[
-M.[M+R\L+"PO+:VK*NOI*:BMKBPMK*@I*RFJKJRH*^MK:&GK**BN+"VMKBXO+
-MNSL[2XLKJJLKB\L[>_O[.XOKZVOKJNJ*RKHZ^KI*RLJ**NKJJJLJJZNK*ZJJ
-M:^LK*ZNK*XO+R\O+"PL+B^LK*RNK*HK*2DJ*JVN+"PMKJZKJBFKJZNIJBHKJ
-M*JIK"TM+"XLKZLJZ.IH:^DJ**[N;6^-C8^-;F_O+:RMJBLJZRLH*:NKJ*NKJ
-MJFH*:HJZ.CJZ2HKJ*BN+"TM+N[L[.SO[2PN+ZZNJJZKJ:HJ*:HJ*:FHJJRNK
-MJRLKJBJJJRNJJZKJZFKJZBJK*^OK:^NJJFLKZVMKBXN+"VOKJZNK*JJJJBOK
-M*ZNKJNHJZNIJZFJ*ZJJK*ROKZROKZ^OK:^NKJBHJ*BHJ*JHK:XN+:ZLJ:FKJ
-MZNKJ*JJKJJHKZXN+*XN+JBLKJZNJZJJJJZLK*RMKBRLKJBJJJBIJBHJ*:BJK
-M*^MK"POKZ^LK*ZLJ:HIJBNJJJ^OKZRLK*ZNJJZNJ*JJJJZOK:XN+:VMKZRNJ
-M:HH*NDKJ:NHKJZMK:XOK*RLK*ZHJJJOK"TM+2TO+:RLJBLJZ.DH*"HIJ*BHK
-MZVN+"XL+B^NJ*JJJJJNJ*^OK*RLK*ZNJZFIJBHIJ:FIJBNHJJNM+N\O+B^OK
-MZRLKJZJK*RLKJZNJ*JLJZNHJ*NHJJJJKJJNKJRLKJZJJ*^LKZ^LK*RLKJZLK
-M:VOKZ^NKJNIJZFIJBFKJBNHJJBLK:^LK:VN+:RHJ*ZJKJJHJ*JJK*RMK:RNK
-MJFJ*R@IJ:NHJ*VN+"PO+2\N+:RNKJZJKJJLJ*NHJ*BJJJZNJ*NIJZFIJ*BHJ
-MJBMKBVN+:XL+BVLKJZJJJBHJZZLJ*ZJJJJHJ*JHJZNKJZNJJJJJJ*ROK:VN+
-MBPO+"XOKZ^OK*RNKJRKJ:FIJ:NKJ:FKJ:NHJJJOKBPL+"XN+ZZLJ*NIJZNJJ
-MJJLK*RLK*ZIJ*JNJJBLK*RNK*RLKZ^OK:VOKJZNJ*BKJ:@H*:FIJZJHK:VMK
-M:^N+BXMK:^OKZRLK*RLKJBHJB@J*:FIJ*BHJJJNKJRLKZVOKZVMK:XOKZTN+
-M*^LKJZKJ:FKJZNHJJJNJ*BKJZJJJJJLK*RMK:RLKZRNKJJNK*^NKJJHJ*JJJ
-M*NHJJZNKJJJJ*ROK*RNK*JJK*^OK:VMK:^OKJRJJJJNJ:BJKJJLJZJHJJZJJ
-MJJJJJJNK*BHJ*BJJ*VN+BPN+ZZLJZHH*:FIJZBJKJBJJJZNK*RLKJZOKZ^LK
-MJRLK*VN+:RNKJZKJ:BKJ:HJ*:HKJ*JL+BXO+"VMK:XMKJRIJ:NKJJJHKZ^OK
-M:^LKJZNK*NIJ:NKJ*BHJZBJKZRNK*RLKZ^LKJZNJJZNJJRNKJZNJJRNK*RNK
-MJJNJ*NKJZBJJJBMKJFJJJRJJJZMKBVOKZXN+:^OK*ZNJ*NJ*BHIJJJLK*ROK
-MZ^OKJROKJRKJZNHJ*JLK*RNKJZKJ*BHJ:FHJ*NJJJZNKZXL+"XN+BVOK*ZNJ
-M*FHJ:ZKJJRIJ*JNJJBMKJZJJJZLKJRLK*ZKK*^MKZ^MK:RNKJBHJ*BKJJJLJ
-M*JNKJ^LK*BJJ*JHKJFJJJRHJ*VN+:ROKZZNK*ZNJJNKJJJOJJJMJJJKJZJKJ
-MJNLK*^N+*RL+BVLKJRNK*JJKJBJKJFKJZFH**JHJJZJK*ROK:VNK:\N+:VMK
-MZRLJ*NLK*FKJ*BHJZJMKJZJJZHHJ*HKJ*BKKR\LKJNLK*ZLK"^NJJJNJ*^NK
-MJZNJJBIJBFHJ*^NKJXL+BVN+:RNKJBJ*BFHJ*JJJJZNKJBOKZPN+ZRNKJBHJ
-MZBHKZZLJZBJKJRLKJZLK:RMJ:JJKJJJJJZHJ:LKJJRJK:^LKBXOKZVMK"VNK
-MJZLJ*BLJ*JNKJZOJ:BHJ2LHJZBJJJNL+*^L+:^N+Z^MK*^N+:RLKJBHJ*FHJ
-M*FIJZBJJJJKK*^MK*RNK*NKJJBIJ*BOKJZLKBVLK:^LJ:NHJ*BHJJJKJZNMK
-M*ZMKBVOKZVMK:^MKZZHJ*JN*N@HJ*FKJJZNJJ^IJZ[O+BVOK*ZNKB[L+*^KJ
-MBFH*NNIKZRMKBPMKJBHKZZIJB@HJJHIJJBLK*ZNK*^OK*ZHJJBLK*VJ**HOK
-MJ^N+R\N+BXOKJRIJ:FIJBFKJ:NJK"XMKZZJ*"NKJZBIKRVOK*^M+2PN+"\OK
-M:DI*2@H*2LH*BFJKZ\N[2PN+RTL+Z^LKZFH*RHJJJFIJ*POKZJH+2TM+JHHJ
-MBCHZR@KJZ@KJBTL[>_N[N\NKJJLJ*@K**\O+BRLJ*JKJBJHKZLJZ.@JKZ^OK
-MJZOKJNJKR\N+:RNJJZKJ*JOK:VN+"\OKJFK*RFJK*NJJJZLJ:HJJZZNKZ^LK
-MJFIJJBOKBXMKZ^N+2TMKBRMJ.KKJJRNKZHHJ*RN+:ZLKZVI*NDKJZRNJ*\L[
-MFWO[.[N+*XK*"LI*RLI*RHKJJBMK"XLJ:JMK"\L+ZRLJRLKJJNMK*^MK:PMK
-MZXOK*BJ*:JKKJRKJJRJ*:JIK"\OK*NIJ*BOKZXLK:DKZ.LJK*ZN+"\M+RTL[
-M^TN+JXI*BLI*RLIJZBJJJZLK*VN+B^OKB^OJZJNKJZJJJBLK*VLK*JNJZFKJ
-MZFIJJ^MK*^LKZ^LK:PN+ZRMJBBKJ*JJJZVNJ*JLK:PMKJRNKZHI*RNJK*JJJ
-M*XMK:VMKZZJJZBIJBFJJJBMK:^LKZZOJZJJJ*BKJJJJJJZJJJRLK:XO+RPN+
-MZZNK*NJK*RKJJZKJZBKJZJNJJZKJ:BJK*XMK:PMKZRLKJBKJZBKJZBJJ*BHK
-MZRLKJRKJJJNJZVMK:XL+:VN+ZRNJJJJJJBJJ*BHJJJHJ*NJ*ZBHJ*BJJZVOK
-MZXMKZ^LKJ^LKJJNJJRLKJJJJ*BJJJBOKZVN+JRHJJZNJZXMK:^OKJZLJZBKJ
-MZNIJ:HIJ:FHK:PL+:VOKBPN+*RNKZBJKJJNJ*BKJBHIJB@KJZNJJ*ROK*RN+
-MRTO+2TL+"PMKZRNJBHJ*2DH*:BHJJJJJJJOKZRNKJJHJZBJJJROK:VMKB^NK
-MJZNJJJNJJJNKJJOK*ZNJZNIJZNKJ*BJJ*RLKZVOKZ^NKJZNJJBNK*JLK*^OK
-M*^LKJZKJBHKJ:NIJ:NKJJBMK:XO+R\O+"^LK*^OKJ^H**JOJ:NKJJBNK*^MK
-MBVMKJRKJ:FIJ:NHJ*BJJ*RNKJ^LKJBHJJJNK*^MK"TN[NTN+*ZNJZFIJZBJJ
-MJJNK*RNKJNIJBHK*2DJZ2FHJJNMKB_N[RSL[R\L+RXMKZ^LKZ^LK*ZNJZHJ*
-MRHIJBFKJJJHJZFJ*:BHJJBOK:VMKBXL+"PN+:VMK*ZNJJZHJZNKJ:FKJ:FIJ
-MZNJJJRLKZ^MK"PMKJNOK*JHJ*BJJJRLKZ^LKJZNK*BHJZFJ*ZJHKBVMK:VN+
-MBPMK:RLJZFIJ"@H*NKHZ2LIJJ^MK:VL+2SO[>_L[2XLK*NJ*RDI*2DJZ"FJK
-MZPL[2PO+:^OK*RNKJRJ*:@K*"HIJJJHK:PO+2\O+"XOK*ZLJZHJ*"HIJZBJK
-M*^OKZRLK*RLKJZLJ*JJKJZJKJJJJJZNJJZNJ*RNK*^OK*RLKJNJK*RMKZZNK
-M*ZNK*RMKBPMKZZHJZFIJ:NKJZBHJZBHJJJOKZVOK*RMK:^LK:XMK:RNJJJNJ
-M*BKJ*JJJZBKJ:NHJZNHJJRNKJZNJJJLKZ^N+N\L+RVLK*ZHJ:FHJ*JJK*ZLK
-M*RHJZNKJJJJJJZNKZXMKZ^OKJZNJZBKJ:BJJ*^MK:VMKZRNJZBHJJJJJ*BKJ
-MZNKJJJOK:VN+:^LKJJNJJNH*:NJ*JJNKZVN+BXN+*ZHJZJJK*ROK*RLK*ZOK
-MZ^LKJZKJZFJ*"@J*:NHJJJJJJBOKBPO+RXN+:ZLKZRLK*^MKBVLKJFH*2DJZ
-M2LH*:FIJ*\L+B\N+:VMK:XMK:VOKZ^OK*RNKJBHJZFJ*"@H*"HHJJBOK:PN+
-MBVOK:^MKBXMKZRNKJZHJ*JJJJBHJ*NKJ*BHJ*BHJJJJK*^MK:^LKZ^NJZJNJ
-M:BHJ*BHJJJJK*RLK*ZJJ*ZNK*RNKJZNK*^OK*^LKJRLKZVN+:^NKZFKJZBHJ
-MJZLKJZHJ:HIJ:FKJJBLKZVMK:VMK*^OKZRLK*ZNKJ^L+*ZNK*BHJ:HJ*BFKJ
-M*BKJ:NJJ*^OK:XN+:VN+BXMK:RLKJVH*"@J*:JHK*NJKZRMKRVLK*BKK*BJK
-MZ^LK:ZJJZ^OK*ZNJ*BHJZHKJJJNK*BJ+BVMK*ZOK*ZJKJZNK*ZJJJZLK*ZHJ
-MZNIJ:NIJ"FKJZJHKZ^OKZ^MK:XMKZ^OKZRLK*^OK*ZNJ*BIJ:FKJJBHJ*BHJ
-M*BJJJROK:^OKZVO+^\M+2VOK*^J*"@H*R@IJ:FIJ*BKJZJHKZVN+"PL+RTN+
-MBPMK*ZNJZHJ*:NKJ:FHJ*BHJZNKJ*JLKZ^OKZVMK:VN+BVNK*JNJ*JJJJBJK
-MJFJ**BIJ*JJK*^LKJZHJJBLKZVMKZVOK:^OK*ZJJJBHJ*JHJZBHJ*NIJ:FKJ
-MJJLK:VLK*VMKBXN+:VMK*ZNKJBHJJBHJZNKJ*NIJ:NKJZNIJ*\MKBPL+"PL+
-MBVOKJZJKJZJKJ^KJ:NIJZFIJ*JNJJJJKJJNKZVMKBVMKZRLK*RNJJBKJ*NIJ
-M:BJJJJNK*RNKJJHJ*BJJJJNK*RMK:XMK"VLJBBKJBFIJ*BLKZVMK:VOKZRNK
-M*ZLKJZHJ*NIJ:NKJJJLK*ZJJJJJJJRMK*RLKJRLK*^OK*RNK*BJJJZJJJBKJ
-M*JNK*^OK:VOKZRNJJJLJZBMKJZJJ*JKJBNKJJJJK*RMK:VMK:XMKBPN+:VLK
-MJZJJ*BHJB@H*BHIJ*JJKJZNJJJJK*^OKZVMK:XL+BXOK:RNJJBIJ"@IJBFKJ
-M*JJJJJJJ:FJKJJOKZVL+"PL+BVLKJZHJZJJK*^LK*ZNJ*BIJBFKJ*BIJZBJK
-M*VN+:XMKZZNKJJLKZZLK*RLK*ZNKJJJJJJHJZNKJ*JLK*^MK:RLK*ZOK:ZNK
-M*ZLJ:FIJZBHJJZNKJBKJZJJK*^MKBPN+"XN+BVOKJZNKJZHJJJHJZFIJ"@J*
-M:NHJJJLKZVOKZXL+"XMK:VMK"XOKJZKJ:HJ*:JJKJHH**FKJJZOKZVOK*ZNJ
-MJZNKJZJKJJJKJZLKZRLK*ZLJZNHJ*BHJZBJK*VMK:VOK:^OK:VLK*BKJ:BJJ
-MJZNKJZNKJZNKJZNK*RLKJZHJ*NHJZ^NJZRNK*BHJ*NJKJJOKZVMKZ^OKZRNK
-M*FIJ:NHJJJNKJBJJ*ROK:^MK:^MK:VLK*ZKJ:NJJJZLJ:NHJZFIJ:FJ*"FHJ
-M:PL+"\N[2\O+"^LJJBNJJZLJJJLJ*NKJZFKJZNJJ*^MKZRLK*ZNK*RLKJNJ*
-M:NHJZHKJJZKJZBL+"PN[NPO+RXNJZFHJ*@IJZJNJJNNKJFHJ*NHJBJHJJFL+
-M^_M+*^NJRNI;VTZNS_.&B+JI6RHWWVLGNB@&/[EI%GBVZ>F^Z,:G?VL^4R<>
-M:!8'*6DW1H9JJH;6'LIWJ6=_RCH/[\[.2NH"4N*:`@8>^Z^/3]_;;MY:<[O*
-M[@-GAS]#[WL[;H:6)BMZ$D(#_R=J+A-:HY_3"PXJ:TN:>J.#^SX>PT^3:^8^
-MRLL_PY.J(AL"8QH*;T/CDOI++JJKTEHR>VO[4V._XTMJ2ANZ@LX.D@K;NNI[
-M`X.;VVNK2ZOJ#@XKS[.#"HK/`WMRJ@M"HC*R\HJZ2P]O;R,Z#H)+VB+Z"^H[
-MJG*KKV^S:RZJ6\K";G,;:\IBLTOC"PMS>IMZ+NZR\^L+&TI[Z\L[ZVM:*H/;
-MNV+Z2KJ#2\NKXLKKVZHBNHJ+:_KR:W.#^JJC2]MKDD*K8R,KVF*Z8ULKB^KC
-MZT+RDOK::CN;LQL;8V-CZX*B2_MZRJ)BFV/+J[OJ^GH*HVM:@FK+R^NK0^-;
-M*H(K2ZM:`AJK$UO:`HHS,PNZTIJ+ZKOK"FLK&PNJRSL#ZWJ:"JLZF@KKHXL*
-MJ@I*BNKK.AL[2@M+XSLJ2MHJ*@IKJNMK2RJ*NJLK*WOJRXNKB^MJ&OHKBQOK
-M.JKJ"HJ+*VL+(TLZVDK;:[KBNOMC@^LJZFL*2HLJ*WIJRFM+"FM+.VOK.RN*
-M^H):"IM;.TNK"_OKJFH:&KJ*"LL[RWNKZ\N[*[H*"LIZ2FK**KL;VXN+>RNZ
-MHMKJ"[N+ZWL[NXLKZDJZ.@JZ:NNZ:@O+*^L+.QNK>NKKJTH*JXO;"XK+NRL*
-M2KKJ*DHZ*@NJ:KK*JKM;RXO+NRMJBPL+*[JJ*BNKJRN"#J["&FIK.QLCXV/C
-MXZ-;&WL[NPN+ZRNJ*NIJB@H*"LK*R@K*"@H*"HIJZNHJ*JJJJZLK*RLKZ^OK
-MZ^OKZROK*RLK*RLK*RLK*ZLKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNK________________________________________________________
-#____
-`
-end
diff --git a/share/isdn/3.g711a.uu b/share/isdn/3.g711a.uu
deleted file mode 100644
index de5aa8ac1ee7..000000000000
--- a/share/isdn/3.g711a.uu
+++ /dev/null
@@ -1,322 +0,0 @@
-begin 644 3.g711a
-MJZNKJBKK:RJJJNKJ:NKJ*BHJ*JJK*^N+:VN+:VOK*ZNJ*NKJZNKJJJJKJ^OK
-MZ^OKZRNK*JHJ*BJJ*BJJ*^OK:VN+B^LK*ZNJJBKJ:FIJ:NHJJNL+R^LK:ZNJ
-M*NHJ*NJJJVL+NTO+:RLJ:HJ*:@J*BNHJ*JJJ*NKJZJHK*ZOKBPL+BVMK:^MK
-MZRLK*ZLJZBHJJJOK*RNK*NIJBHKJZBJJJZLKZ^MKRPLKZZLJ*JHKZVN+B^LK
-MJRHJZFJ*"HKJJJHK*RLKZXN+:^LKJRJ*BFHJJJLK:VMK:^LKJNIJBHJ*:NJJ
-M:\M+2TO+B^MKZ^OKZZHJBDI*RHH*ZNLK*^LKJZJJJROK*RNKJZHK:XO+RXN+
-MZRNKJZKJZFKJ*NKJJBHJZBHJ*JJJJJNJJJLK*RLK*ZLKZRLK*^MKBXMKZRNJ
-MJBKJ:FIJ*JOK:PMK*BKJBFIJ:FHJJROK:XO+2\N+ZZJJJJHJZBHJ*JJK*^LK
-MJZNJZFJ*ZNHJJ^MK:VMKZ^LKJRHJ*BKJ:HIJZNJJJZLK*XL+"\N+BVNKJZNK
-MZJKK*RNKJZHJ:FJ*BNJKJ^OKZRNKJNJ*"HHJ*VO+N[M+"^NJ*NKJ:BHJ*BHJ
-M*JKKBVLKJZHJ*BHJZNIJ:FKJJNN+R\O+"^NKJBKJBNHJ*NO+"ROK*ZHJ:HJ*
-MBBJJJROK:VMKZRNK*BHJ*JHJJJLKJZJJ*BJKZ^MKZ^OKZRNKJJHJ*BJJJROK
-M*^OKZ^OKJZHJJBKJ*NIJ:BHJ*JJKJRLK*ZHK*RHJ*JNKZVMKBPN+B^OKZRNJ
-MJJJJJJKJZNKJZFJ*:BJK*^N+:^OKZ^OKZ^OKZ^N+:^OK*RLKJZKJB@J*BFHJ
-M*BJJJJHJZBJJ*^N+"VN+2VNKJZJKJJNKJZLJ*BHJZFKJ*NKJ*BJJJBJK*XO+
-MNSO+"XOKJZHJ:@H*R@IJ:JLKZ^NKJBJJJBJJJ^MK"\O+RPN+ZVOKJRKJZFK*
-MR@J*ZNIJJRLKZVLKJZNJ*JJKJZNJJBLK*^LK*ROK*ZNK*ZHJJBKJ:HIJ*JJK
-MZ^OK:VLKJZHJZJHK*VN+BXL+B^LKJBJJ*NKJZBHJ*JJJJZNJJJJJ*XLK*^NK
-MJZNJ*BKJZBJJZ^MKBRNJ*NHJJBNKJBHJ*JNK*^LK*RLKJZJKJRLK*RLK*RLK
-M*RNKJBHJ*BKJZNHJJJLK*ZOK:PO+RXMKZRLK*RLJ:BHJZJJJJBOKJRKJ"DI*
-MRHJ*:BJJ*VN+R\O+"\L+:^NKJZLJJJJKJRNKJNJJJJOKZZLJBHH*:NKJ*JOK
-MBVLK*RNK*^MKZ^OKJZNKJZNKJBMKJNJJJJNKJZNJ*JNJJBHJJJNK*^MK:^LK
-MJZHJZNKJ*BJJJZLK*ZNKJZLK*ZNK*BKJZBJJJ^OKZ^OK:VMK:XMK:RNKJBKJ
-MZNHJ*JJKJZJKZFHJJBJJJJJK*XL+"PN+ZZHJ*BHJ*BHJ*BHJZNJJ*NIJ:BJK
-MJRMKBPN+:RLK*ZJJJROK*ROK*ROKZ^NJZHJ*BFKJ:NJJ*ROK:VMK:VOK*ZMK
-MBRNKZZNJJJHJJJJJ*JJJJBJJJBKJ*JJKJRLKBPO+"XLKJBKJ:FKJ*JLK*ZNK
-M*JJKJZHJ*JJKJZNKJZNKJZNK*^MK"PN+:RLK*ZNJZFHJJHJ*JJJJJBHJ*JHJ
-MJBOK:VOKZ^OK:XL+"PMK*ZLJ:HJ*BHIJZFKJ*BJK*RMKZ^LK*NKJZBJKJBOK
-MZXL+"PN+B^NK*FJ*ZNIJZBJJJJJJ*^LKZ^OJ*JLK*RLK*ZNKJJHJJRMKBVLK
-MJZJJJJHJZNIJ:NHJJ^OKZRLKJBKJJJLK:VL+RXMKZZLJZJJKJZHJ*BKJ*JKJ
-MZNHJJJHKZVMK:PL+"^OJ:JHJ*JHJ*BJK*VMK:^LKZFJ*BHKJJRLK:^OK*ZNK
-M*BKJZJJJ*ROK*^LKZ^MK*^MK:^NK*HH*BHIJZBJKJROK*^OKZ^LK*^OKZZJJ
-M*RLK*XN+JJJJJJNJJNIJZNKJZNKJ*JJKJ^OK*RNKZXN+BVN+"VOKJZHJZNIJ
-MZNKJZJJJJJHJZNKJJJOK:XN+"\L+:^LKJRKJZNHJJBHJ*NJ*BNHJ:NKKJROK
-MZ^MKZROKBXO+2\L+ZZKJ:FJ*:FKJZNHJ*JJKJZHJZFKJJJN+RTO+B^LKJZNK
-MJJNJJJJK*RNJ:FKJ:NHJZBHJ*JJK*VN+R\M+:RMKZRJJJBKJZFIJZJOKBPL+
-M:ZLJZHJ*ZBHJZNJJJZLKBXO+"XMK*ZIJZJNJJZNKJBJJJJHJ*BKJ*NKJJJLK
-MZXL+"\O+B^NK*BKJ*JLK:XL+BRHJJHJ*:FKJ*BJJ*BHJJJNJJRLK:XL+"PL+
-MB^NKJBHJ:@J*BFJJJRLKJZNKJJNKZ^LKJZJKJRJKJ^MK:XL+B^LKJRKJ:HH*
-MBHJ*:BJKZ^OK"XOKZ^LKZ^LKJZNK*RLKJZLKZRNKJBKJ:FIJ:FIJ*JJKJZNJ
-MJROKJZLKJRHJJBOK:XMK*^OKZ^OKZRNJJNHJ*BJJ*FKJ*NKJ*BJJ*ZLK:^LJ
-MJBLKZXMKZ^LKZXN+:VLK*FH*"@J*:FKJJJLKZVN+BXMK:VLKJZHJZBJJJZLK
-M*RLKJZJJ:HJ*ZNKJZBHJ*VN+RTM+RXMK*ZOJB@H*"HIJJHN+ZVOKZRNKJZHJ
-M*FKJ*JJJ*VN+BXN+BXOKJBIJ:NKJ*BKJZNKJZJLK*^OK*RNKJRNKJZLKZ^OK
-MZROK*ZNJJJJKJZNJ*NIJ*JJJJZNK*^NK:JHKJJJKJ^OKZ^OK:VMK:^NKJBHJ
-M*NIJZBHJ*BJK*BHJ*BJJJJOK*^OKZ^LK*ZOK:VMKZRNKJZHJZNJ*:NJJJJJJ
-M*BHJ*JJK:XN+BXN+:XL+ZZJJZNKJJJNKJROK*RKJ:FKJZBHJ*BHJ*BHK:VN+
-M"PN+ZRNKJNKJZBHJJZNKJZJJ*JHK*^OKZ^NJ*NKJ*JJK*VMKBVMKZROKJJNK
-MJBHJZHHJ*FIJZNHJJJJJ*FIJZBHK*VMKRTM+RTO+"XOKJNIJ:HIJZBJJJJKJ
-M*BHJ*NKJZNKJJJLK:PL+RTM+"VNKJNIJBFKJ*FIJ:FIJZBJJJJHK"^NJZ^MK
-MBXL+:^OKJBHJ*JJK*RNKJJJJ*NIJ:NKJ:JJK*^MK:VOK:^MKZRNJZFKJZNJJ
-MJ^N+R\L+:VOK*ZLJ:HH*:FKJ*JKKZ^MK:^NKJRIJJBKJJBOKR[L[NPNKRCHZ
-MNKJZNDIJ*TL[N\MKZ^N+"^LK*ZOK:^NKJJJKZVOKJRHJ*BJJ*NIJ:NKJZNHJ
-MJBOK:VMKBXN+:RNJ*NJ*BHJ**BNJJ^LK*ZLKJZNK*BKJ:FKJJNN+BVN+"PL+
-MBVLK*FJ*"@J*:BHJ*JHKZ^OKZZNJJJJKJZMKBPMK*ZLK*ROK*ZNKJNKJJBLK
-MJZNJJBKJ*JMJ"BJJ*JJJJNMKBXN+"VOK*^MKZ^LKJJHJ*BKJZBHJZFKJ:LJ*
-M:NKJZJNKZVMKBXN+"XL+B\L+:^LK*ZOJ:HH*RKI*BNHJJRN+"XN+BXNKJNL+
-MJZLKJRNJJJJK*RNK*JKJ"FKJZFJ*ZNJJ*VM+N[O+B^NJJBKJJJHKJZLJJJHJ
-M*JHK*ZLJ*JJKJNHJJJJJJJOK:XN+BXMK*RNK*ZLJ*JJK:HJKJZLKJJHJ*BHJ
-MJJJJ*ROKZ^OKJROK*^OKJZJJ*JJKJJJJJJHJJJNKJZNKJZHJJBJJJZNKJRNK
-MJJHJJ^N+BVLKJBKJ:FKJ*JNKJ^LK*RL+RROK*ZLKJZHJ*NHJZNJJ*ZNK:XN+
-MB^NK*FIJZBJK*VN+B^OKZRNJ*NKJ:HJ*BFHJJBOKBVMKBXNKJBJKJZLKJFIJ
-MJBKJJBJK*^L+:VN+:ZNJZRJ**JJK*ROK:^LKJJNJZFJ*"HIJZNJJ*^OKZRMK
-MBXN+ZVLKJBHJ*JLKJRMK:VOKJFH*"HIJ:JJKJZNKJZJJJJJJJJJJ*BNKJZOK
-M:^OK"PLKZVOK:RNJZNKJZHJ*"LJ*JJLKZVMKB\O+RPN+ZZKJZFHJ*JKKZRLK
-MJZOJBHH*"FKJJJNKJRLK*RMKBPL+:RLKJJJJJJJJJZKJ*BHJJJOJ*FLK*RLK
-MJZNJJZNK*RLKZVOK*ZNJJBKJ*JHJ*BHJ*BKJBFKJ*JJJJ^N+BXN+"PMKZVLK
-M*ZLK:XMKZRNJ*NH*RLJ*:NKJ:NJKJVN+BVOKZXMKJJJJ*JNK*ZNJJBHJZJJK
-MJRLKJRIJZNKJJJLKZ^N+BPN+ZRNK*FJ*BBHJZBJJ*^MKZZNKJJJJ*FKJ*JOK
-MBPO+2TM+RXLK*FJ*BFIJZBHJ"HKJ:FKJ*JNK*ROK:ROKZ^OK:VMK:XMKJRNK
-MJZNJ*JHK*ZNK*BJ*:HHJJJMK:ZL*ZJNJJNN+*ZHJJZOKJXM+R^NJ*@K*BFHJ
-MJJHK:XLKZZJK*TOJ8FHZ:NKJ*RL[R[N+R\M+"XOKZZHK:FH*RHKJZBJJ*BJJ
-MZVLJBNJJZVOK*ZOKB^OK:PN+*^OK*HJ*BHKJZJHJ*JJK*RHJJZMK"PN+ZROK
-M:ZMK:VIJ*XO+.X_?.R*&AD*^&D(K&[-#8^/#T^/[>Z-K"FKJ*DHZ^@KKR@LJ
-M"XJ*JFHKBVL+ZBHJRRHK*XH*ZHHJ*RKK"JH+BFI*JZM+RPL[^\LJ"ZHJ*^HJ
-M"NHK^VLJJ^JJZNMJ"JHJ2RMJJJJ+NRN*"JJ**^LJJRL+*DHJ*VJB:UO+VRNJ
-M^FKK.KL+ZXM*2VM+JMHJRUNZBLI:2KI**WL[FWO[R_I**J,KZHIZF^M+.]LK
-MNTI*ZN+JPFJJ@N/:&TK+2RN[ZWO#NVOZ2QI""L)#\BJ*.E,S`TNJ2\)K*JJJ
-M:RN"JTK*RIMKNOOJ^LM+*_M+^^MZ>JOJJJKB&CN;&YKZV_IJ@_NO^@K**F,K
-M6KZB^@-;6H^:CV]ZKRZ[>HKS#J^.4HL>#U+J`T+_`P./"A.""QH>*OZ"R@M3
-M"KL[@\/K<ZOJJ@HK2JN[HLO*VPMB8KHCKDNNBB]#,POC:V\*VI)N`Y*R\X+O
-M,[Y/<NNO[H_:VO\J`^NN4EK:>XKRF\)+D\*+8^J_`\I;<B(JGEH;JF.:N[]S
-M#ROK,UN[.ZZ>&OZ[R@YC`NO_.ZL3LD)S;BI[GIO[F@^#B\^[RZL;/AM+'G-Z
-MGM.+FB<*.V?[HJOR#LJBQBK;\@^S0F,_4EM/DOOSPH)#V_)38SXOZ]YS>QY[
-M+ZY*SS*JORXZ[P+*0V)*4Q*ZW_+2#PLN`WKN<U*ZJYICV^LBX]M:`^JJZLN[
-MVX,"*S/28ML*RTLZ2SO*2SH:.EK[*[H[F^-[^INZBFH*^VZK.PIKN\JZLVJ*
-MXPO:^R,:Z@JK"IJKFR+K8RO**HLZZS([;ZYK;QJBZKO[(TN#ZCKJFWH2FH(C
-MBNL/"KJJBPONZTJ;`UHJ*]J"NX-**NI[`RKC&QOJFOJ*RZMB2SJR*MH*R^-[
-M8QLB2OKJRJK3:ZMCNQHZZXOZBGO[0J+CZNL**C/"OKJSXR)KOSMR^U-+VLJ[
-M*ZMZVFH:`LMSRGJ"`U.B^FM#@II/^Z)N`P]ZRUKNFNLRJ^^JJELK`UO:6J/;
-M+I*BZGL*`[/;Z^L+:HH*2Z.;(JX+(QMN3F-3ZA(*C_.2$LL?<\[KLZO*8B*"
-MJH)J\^.SJEJZ*ZJ[BJK[KS,R@NJ[@CHC8TM2*^,BPL**>\I;VPL+._,NKK]#
-MHB)ZBFN+DDJ#FVOB2NI*;[\C*TJ[JNOZKEKRZTJ[$VH2PALS"EI;<_O;&SOC
-MNK)R8H):0JOKNKN3C^]+&NN#N_KR(IK:JLJJ(L)+K\,[>PO+(]N[>L+B*SOK
-M@NX:"RM*JXM[ZZICP^LZ*^O#.UIZ*SNB@BNCF\KZ.KNO(TK:"\M*>MH::BLK
-MZBN3`\KBVGLC"VOZNNN+^O)*VZL*BWNC6PLJ:AK*B[H+(M+K8_LZ8].;*RI;
-MZA+R:R.+BQL#.XKZZPOZTF[:ZDKJ*JK+TX^SZRKKJZNJ*@HZ.LKZ2NNKJBKK
-M^^,["MH::DO[JXHK"BJ;.RKJJZMK2XL*2BN[B^NJ:RI:(KKK^SNK2CHK^TNK
-M:JJKJHNJ>MKJ.SMK*\N[2RLJ*\O;F\O*^BJ+JR)"2LL[Z^M+"XNJBNM+J@H*
-MZ\LJBBJ*&GKJ2YO+BVK*JROJRHJ+"^NK*[M+2_L[>^O*JLN+JVK*2KIZ@D*:
-MZNN+R]NC^^JZZ@L[ZPH*:CN;.\LK*CJ:BHL+*OJZ:QNCV[O+"VNJ*FNJRKI*
-M*SM;^ZH*.KI*"@JZ2LKJ*^OJ2BIKNWN;FTLJ2CHZ"LKZ&B):&OI*>CKKH_-3
-ML^.[ZZLJB_N[*RKK6Y-SX[MK"\N+JKH:FLIK(U//OT\O0UM+BD(^9K9VEA86
-MEO8&GK([#^='-W>7]T?G/_,[ZLHJ*BI+HR.;F]M;@Z/[BVJ:D@[^CAM'Z2EG
-MBRZRZRL.]HBXN,@(Z*@V9DZ*_Y=IR<D)R;FY"5>G>RXFMM8H:(AHJ`:.*E-_
-M9[?W-P>GOR-BOA[^[D)"\C)BNLN?::$A>?=[^D./RG9X(.`@6)CXR.AV/C-W
-M21G9>?EYF?F)!\O>]E8H:`C(".A&KK.G!S>7J>GIUP<OXI[FYN;F9H8F'FZ#
-M*:%AH>E/\Z<'4\9XX&#@(*`8>$AHQNOWN9F9>1DA82&Y1V,R?L:H"#AX^,BH
-MIJ(;KU_W:<G)Z7<G+VNROB;&=M:6MN:B-QEA(<E'YY>I)_Y((&!@X.`@H!@X
-M*([G"?DY.1GA`8%9*7]+8KZV:/A8H)B(1DXR^C,':;FY":E'7R]+LEXVJ"@H
-M=M[/2>$AN9<W:<D7(FA8(.#@8&#@(*!(9K\I"8G)F6'!P>&Y-\_C:DX6N%B@
-MF,BH]L8FXG^I2;G)*1?W1U_[_C96J)9&9L(W&2&9Z3>I"5>+5GB@(&"`@.`@
-MH#@V,]=IB4G9@4'!X3D7WQ.JGBAXH%CX".BH]MZ+9RD)R6FIUQ<W'SKF-C;&
-M!H8F(PDAH<EWEPD)IX9(V"#@@`"`8&#8J/J'URG)H8%!P6$9"=?GDPXHF*`8
-M.$BX2"BFF^>7*6F)B8GI-V\:#A[FMA;6-@X'66'9*1=)64DKB!C8H&!`,+!`
-MX,A>NV]G">%!00%A(5FY%Z\>Z/AX>'C86/BHOFNO)]<)N3E)*4>?K^O.MJBH
-M=J:J5UFA":E)69G?UL@(.."P\#!`@-CH9D*?R>'!`8$!00$9=Y.R9NCXH.`@
-MV,BH]F8J!^F)B0G)B5>';[I^A@9&%A9>?WF!V2F)H>')#@AH:*!`$!`PP.!X
-MB+8#R>&!X8$QD4'9J>=O;N@8(""@F/@XB";O1[=W"9F9B?<')\-NAO:6EG8&
-MVJGAX0D)(8%YRB@VMM@PT'"P0$#@.)9[Z1FAX4$1D0&9N0DG!KB8&*#@X-A(
-MUKY[__<)>?G):6E7O_*^GL;6*/::J:%YQXD!`6G>!L,^X)#P@`!P<&#(MH(G
-M:=F!L3$!88$A*8JF9BA88*!X^/B()AN?QZF)N?G)J4?G3V)FQF:&YMH7V4F'
-M.8$9IQXZ\PA`0("`,)``>$C6.K>YH8'!P<'!X<E'#T)6>!AXV*`8")9F,L^W
-MJ6F)"6DIE]][ZB+>!A[3Z?FIWQF!B:HN#^M80."@`)#P(+BXZ-*W21FA@;&Q
-M8=EYR6?.EJ@(V*#8^#C(=A);CP?I20DI*:FWCZIBLF[.ZJG9%^^A89?;>^=N
-M(."@8$!PL"`8^(A^-PD)6<$QP:'AX6E/2HYV>-AX>)@8N+;.DB,'Z>E7:0DI
-MQV]O#UI.ZZEY=XL9@0?[S^<:&*"8((#P,"#8H!@&A\?'F0$!@>&!8;DW3Z,^
-M"'BX^%B@.%86QGK?-_>I"8DI]\<W;WJK<T?I*0_IX4<CQT\*:#BX(.!`L.`@
-MX!B6ZIM/R2'AX8$!@=G)*8<Z-JAH>*#8>#BX*!XBF_]WZ>GIZ>FIAQ^_0\]'
-MZ:EOB1DOG^=JPNA(.*`@0,!8X"`X=JZKYXF9X>$A@>&9R:G'"J;&:$CX&#@X
-MR*C&KNJ/MQ<I*>EI5_<WIP?I.7?C&4FRAWNN+CAXF-C@,.#88%A(1J*;APE9
-M(=GA@=GYN2F'*\YF%HAXN`@XR*@&WNYSIP>7%REI=\<WA_\'R4D_-R'G[[=.
-MV^:8N'B@P,#8X"!XR'[*.T>Y67E9@2$9^0GIYVJNGA;(2`BX.(A61F9N0Y_G
-M1U=IU]<I-_>)N;GWZ5FGIZ>>*RC8.*!@0``@@""8:#ZR8ZF9V9GA`2%9F4GI
-M7VK")NA(R$AX^`BH]L92K[^G-ZEI5Y<I]W?I^3EG2:'OEQ\>CVB82*#@L`#@
-M@*!8:$Z^(RGY>=EA@2&AF3GI_WLZYN@("$CX.(BHUC:26Z\_!^FI=^DI%ZFY
-M62DWX>G?:?ZS>EC(F"``L&``8"#81J:^7XF9F5D!@2%9&7E7#^.R!HA(R/B8
-M^`BHJ(:BVP\GERD7J>E7]Q=)&>GG63ESJ:MJXYA(2""`0.!@@"#8]N8FSVDY
-MN5EA82%9V7G7'V\J9BCHB+AX.(CH*$8NZJ.?1U?7E^DI=U>)F4GG&9ESZ1NR
-MC_A(""#@0&!@@""@5F;F$]=).9EA82%9V7DI9\]['JCH:+AXN`AHZ#;.&CM/
-M1]<75^DI5]<)V4FGV1E#Z1M"GWA(""#@0&!@@""@5D8&$Y?).7EA@:&AH9GI
-M!Z>;?M8HZ#AXN,B(B);^4JM/!Q<7%VDI%W<I^7E'U^$'?ZD>IV98=IC@@``@
-M@&`@N+;60F>I.3FA@2&AH=FYUP?_(H96*`B8^+A(".C&_G(C)P=W*1=I*?>I
-M%[F99ZDAWZ>IYN=F&,88(&``H(#@H+AVJ+*G-TFY66$A(2'9.2DW?YJFEJC(
-M^#@XN,CH1B:N<Z='%ZDIZ:D7ES<IN2D_>4GK:9M:I_BH*""@`.#@@"#8*"A&
-M+^=727DAX:&A(7D)Z<>/`F8VZ+@XN/BX"*BV)I*O)V<7Z:DI*5?W!T=I27_G
-MH4__5X;')IA>>-@@8!C@(%@(%B@R/V?IR1FAH=FAV<EI%Z=[/@;6"+BXN+C(
-M*#;F[F-_A[=7Z:DIJ;<WYT?)J7L)2=JIH^['N*BVH)A@H%C@6)BHJ+9C?W<I
-MN=G9H1FAF6EI]P\K/N:H"`A(2+@(UG9FLL-_Y_<IZ:D7J9>GWV>IB0NGH9J_
-MET9W]K@">/A8H#@@6'CH%JBBKZ?W*7F9>1G9&0EI5Z>SKO[&:&AH",B(UC8&
-MC@NO_X<WUQ>WJ7>G7W]G=ZD+=YF>%X<&5VBHKEA(V-CX()@X*"@6NLM_]^DY
-M.9D9&7G)B=<G[UH^QBCHB,@(:*AVABZ*<Z<']U?7%Y=WI_^_\W?7"J<Y"O^7
-M9G<FB`NX2+A8R*#8.&BH*&Z*0V>7N4G)69DY.8EI1\]SPB86J"C(R&@H%C9.
-MNHO/IT?WMQ?WMV>?3]N+PS?GGFGI?HF+2ZF(,JZX*)A(N*!XN"@(EE)R\Y_7
-M28FYV1DY24DI1S]C(H:6%N@(".A6U@9NVKOOAP<'ET>WQW_?TZIJJ^='OH?Y
-M_I<W/@E&AL](J,@X"*!X.(B(:+[.2O_'"0G)V5DY.?EIU^>/>]ZV=B@(R&@H
-MJ'8>\EKSIP?'Q_>WYZ=_;VI:"NX/E\Z_&;+WB3[)@C9?:"AHF,B@V)A("`BF
-M?MH_9XE)2=FAV?EYR==';_N^=G8HR,@(Z"@6IJ[Z,Q]GA\>W!R<GSV,CVE(B
-M#A^I)O=9#LG7PGG&'K_(5KAX2*#8F`A(:/Y.FW\W20GYV1E9.;D)-^>S>GYV
-MENB(B(BHJ#;^+DH#OR<GAX=GI[^/,RI*.A)NLRFS(J%GSWGN::=H7W8(:-C(
-M&*"8R&C()JXZ_^=IR0D9F7EY2<FIYS\;;H8V%NAH:"BH%F8.TBO3OQ^GAR=?
-M7\_OL\O+ZY(:,W<GCGFIFOFK!_?H[UX(*'B(F-@XR"@(AO(N+Q_7B>DYF9FY
-MR?FI!P<#RMY&QBB(Z.@H*+:FWL(+[S__!X<G)Z>GP_//ZNI:KK/7`\Y9YUJ9
-M+G=GB*>&"%:X:)AXR(@HB#Y"+G^G5VFI.?D)"<GIMV=_VZXFYC8HJ-86]D:^
-M<C)[;X\/__^/KP.3H^K[*GJZ&D)[UP<BF0GKF4_GJ:CC_DCH>$@8V#BXZ(AF
-M8I(?!ZG)B3GY^<F)B<>?;V+N!O8V**C6=L;F+@J+4_^G'Q\?KX/K8H(.;N[^
-M0O+.4RDWV]F9KUF7MVGV@ZXXB)AXH""8>(C(!IJN?[<I20GY>3D)B>FGOW.R
-M#D;&MJ@V1H;>3@K[(X]__P^/[\NZXFX.?OZ23N[JZ@>IK^E9IXG)WZGZ;@KH
-M",@XF-@XN&@H-AKB4Y>WJ4EIB<FI*1=?OR]Z[FXF9N8&'AY^XN+JVQLS,P/C
-M2TJ",HX.#FYRLMIK>R^'-\<I:=>I]\??BP*>]NB(R#BXR(BH=B9RBM.G1Q>I
-M*>DI5Y='?R\[(A(^GAZFGCYNDEKK.X.S0S,;"ZNB,M+N;@XN\G(KWT<O5[D?
-MZ>D?EVH:RA:HZ&A(2.B(UC9F>N(#)^<W]Q=7][<W9\^/DTLBPH)NSFX2TJZ:
-MZBJKBZ.+JTO*(K*2+N[2,EJ:JF,#TW_GIV=')R<?;Y,K`NZ>9D9&]C;&!J9^
-M;AH*^S-S#\_/OX]OKQ,SVR/;B\L+BRMK2ZL+2^M[F[M;6_M["RJZ&CI*JQ/J
-MXR?*[_^:0T(N$B8FAN8&!GZF#K):(X/OGY]?WU^?3P\3PYO+RRIJJJJJJHL+
-MRSL[NXOJ*KHB@I+NCLY.SHXN\J*ZRZ.S[X\/3\\/CZ^3PUM["ZI*FIJBXMI:
-MXAKZ>DJ*"BIJZJMJZNJZNGJ:VB+B8J(:>CJ*JFM+>UOC(X,#8^,CHZ,;6R,C
-MH^/C&QL["RL*:NJZBJMZ^HH:HH+",I(2KE*NTH)BVHJKR]L#L[.S<W,#@\-[
-MNSL+RVLK"VMK:VOKJFLK*JKJ:LI*ROKZFGHZ^HJJJXO+.SN[>_M+BZNK"LI*
-M.DJZ2HKJ*VO+R\L[.TM+B^LK:FK*.OJ:(L*BVMI*ZNM+.]M;(V-C8V,CVWL[
-M"XMK*ZLJZFKJ*JJKZJOK*JJJ"@I*^OK:(N(B(B+:&AHZ"NJKBWL;6R-C8R.C
-MVWM+2PMK"XLKJ^J*RLKJJZOK:VMK"PMKBXOKJVJ*"LJZN@H*R@J**JJJZRNJ
-M*RNJ*ZMJ"KHZFIHZ2HIJZFN+2[L[.[O[FYN;VUM;HYO[NVNKZHI*.OIZ>DK*
-MBJKKJROK:^NKZZJ*"CKZFAKZFGHZRFHJ:TL[>WM[^[M+2\O+2TO+2\M+2\N+
-MZRNKJNIJBNJ*RLK*NOKZ.OHZRHKJJ^L+RTM+2\O+RXMKZZNKJJJKB\OKZRLJ
-MJJKJ:FH*"@H*:NJJJROK*ZNJ*BJJ*VMK"\O+N[O+RPN+:RNKJNIJ:FH*"HKJ
-MZNHJJJJKJZJJJBJJ*RLK:^LKJZLK*RMK:RLJJJJ*"BKJ:BHJ*JHJJROK:VN+
-MBPO+"XMKBXN+BVOK*ROKJJKJBHK*2DK*2KK*BNHJJJOK:^OKZ^OKZ^OKZZNK
-M:VMKBPN[^_L[RVLK*FH*2KJZ2BIKZPO+"PMK*ZMJ"@H*RDK*"FIJZBHJJJNK
-MZ^MK:^LKJJLKZXM+.WM[F_N[B^LKJZHJJJHJ*BKJ:HJ*"@H*:HH*"@I*2DK*
-MBFJJ*VMK"TL[R\O[N\L+BPN+:XN+ZRNJZNHJ*JJK*ZLJ:HK*2DK*R@IJJBMK
-MR\L+RXOKJZJKJJJJJJHJJJNJJZNK*RNK*ROKZ^LKZ^OKJRLKJZKJBHJ*B@JK
-M*RJKJZOKZZNJJZNKJZNKJZLKZVMK:^LK*RNK*RNKJ^LKJZHKJRKJ:FKJ*BKJ
-MZJOKZVN+:^OKZVMKZ^LKJ^KJ*FKJJJLKZVOK*ZLJZNIJ:LK*ZFJJ:VL+"VOK
-M*ZLK:XN+BVOKJZJJJBHJJBKJ*BKJZNKJZBKJZBJJJ^MKBPL+"PMK*ZHJZHJ*
-M:NKJZBJK*VMK:^LKJNIJ:NHJJROK:^L+.TMKZZLJ:FIJZNKJZJJJJJJKZFKJ
-M*JNK*^MK:XMK:^LKJRNJJJNKJZNK*RLK*RLJZNKJZBJJJJHK*ROK"XMK*RIJ
-M:NKJJBOK:VMKZ^LK:RMJ:NH*"HJ*ZJLKZVN+:VOKZ^LK*^OKZ^OKZRNKJJJK
-MJJJJ*BKJ:HIJ:FKJ*JHK*ZNKJZHJ*^MK:ROK*ROKZVMK*ZNJZBHJZNKJ*JJJ
-MJRNJZ\O+BPN+Z^NK*BJJJZHJ*FIJ:HJ*:NJKJROKZ^LKJZHJ*BJJJJHK*VN+
-MBXOKZVMK:RNJJBHJ*NKJZNHJJJKJZJLK*ZLK*ZNKJROK:XN+:XOK*BJJ*BKJ
-MZNHJJJNKJZNKJJJJ*JJKJRLKZ^MK:^MKZRNKJZNJ*RNKJJJKJZNK*RNJ*NIJ
-MBHIJ:NHJJ^LK*RNKJZLK*^MKZ^LK*RNKJZNJ*BL+ZZJJZNHJJJJJ*ROKZRNJ
-M*BHJ*BJJ*JJKJ^N+R\O+"XOKJRIJ:FIJ:BJKJZNKJZJJJRJJJBHJZJLKZ^MK
-MZRLK*RNK*^LKJZJKJJJKJRIJBKJ*JJHK:VOK*VMKBVOKZROK:VOK*ROKJZJJ
-M*NJ*BHJ*:NHJ*JJK*RLKZ^MK:VMKZ^LK*^LKJRIJBHKJ*BJJ*BKJZNHJ*RLK
-MZVOK*^N+:VN+2^NKJRJ*:NKJZBJJJJJJ*JJKJZNKJZHJJROKZRLK*RLK*RLK
-M*ZNKJZKJZFKJ*JHJ*BJJ*RLKJZNKJ^N+"\O+"VNJ*NIJBHIJZJKKZVOK*RH*
-MZBHJ*NHJJZLK*ROKZ^MKBXOKZZLJZFIJBFKJJJNKJZNKJZNKJJJJJBKJJJNK
-M*RLK*RHJZBHJJBMK:XN+BXL+B^LKJBIJB@H*BFIJZJJK:TMK:XLKJJJJ*ROK
-MZROKZZNK*BHJ:NKJZNHJJRNKJRNKJJJKJRLKZ^OK:VMK:VMK*ZNJ*NIJBFKJ
-M*JJKJROKZRLKJJJJJRLK*^OK*RNK*^LKJNOK*ZNKJBHJZNKJ*JNJJNKJZNJJ
-MJJJKJJHKJRLK*^OKBXN+BXN+:VOKJRKJBFHJZNHJJJJJ*BJJJZHJ*NHJJJJK
-MZ^N+BVOKZ^OK*RLKJ^MK*BJKJJJJ*BKJZNJJJZLKJJJKJBJJJJNJ*^MKZVMK
-M:^LKJZKJ:FKJZBHJJRLKZ^MKBXL+B^LK*BHJ*JJJJRLKZ^LK*ZHJZHJ*ZBHJ
-MJBLK*NHK*RN+BXN+:XN+Z^OK*RNKJJJKJZNJ:HH*RFKJJFLKJBMKJZMK*RJ*
-M:BLK*VO+BVN+ZZNKJNIJ:HH*RFKJZJOK*ZNK*^OKBXMKZRLK*BJ+2XN+:RNJ
-MJJHJZNIJ*NIJBFKJ*JHK*VN+BXMKZRNKJBHJJROK:VLKJZKJ"@H*B@J*ZJJK
-MZXL+R\L+B^NKJJJKJZLKZVMK*ZNJ*BHJZFKJJNKJ*RLKZROK*ZJJ*BJJJJLK
-MZ^LK*^LK*ZNJ*NIJ:BJJJ^MK:^LK*ZNJJBHJJJHJ*JJKJZJK*ZLK*RLK*^MK
-MZRLKJRNKJZNK*ZLJJNIJ:@K**JIJ*JNJZVMK:^MK:XMKBXOKZRLK*RNKJZJJ
-MJNIJ:NKJ:NKJ*JNKJJHJJROK:PL+BVOK*ZKJZBHJ*NJJJZLK*RLK*ZJKJZNJ
-MJBJJJJLK*RLJ*NNKJJLK*^MK*ZLJZNKJZJJJJROKZVN+BXN+ZZHJ*BHJJZJJ
-MJZNJJJNJJBHJ*JHJ*JHK*RLK*ZOKZZOKZRNJ*BJJJJJK*RNKJZKJ*JJJJVMK
-M*JJJZBJK*^OKZ^NKJRNKJZNJJJLKBVMK:VOKJJJJ*RNKJJKJZFKJ*NHJ*NIJ
-MZBHJJBMKBXOKZ^OK*RLKJZLK*RNK*VL+:^NJ*FK*"@K*2@JKJZOK*^OKZVLK
-MJRLK*ZLJJBJJJRNKJJLKZ^MK:RNKJJNKJJNKJZNKJZJJJJNKJJLKZRLK*ZJK
-MJZJJ*BHJ*BHJJJJK*RLK*RLKJZJJ*JH+"^N+:RNKJZJJJNKJZNKJ*JNJJZNK
-MJZHJZNHJJZNK*^MKBXMKR\L+"PMK*RNK*FIJBHIJ:FKJZNKJ*BKJ*BJJJJOK
-MB\M+2TL+RPMK*RKJBCJZ"HKJJJNKJJNKJZNJJRJJJZLKZ^LK*^LKJRIJBNHJ
-MJJNK*RLKJZLK*ZJJZNKJ*JHKBPL+"XOK:RLJZNKJZBHJ*JJK*ZNKJZNK*RNK
-M*RJJ:^NKZRNK*RLKJZLKJZNJJBHJ*JJKJZJJ*FIJZBJK*^N+:VL+B^NKJNJ*
-M:NJJ*RMK:^OK*RNKJBHJJJNK*^MK:^NKJBHJZNKJ*JJJ*VN+B^OJ*JLJJZNK
-M*^OK*ZNKJ^IJ"FKJJNL+"XN+:RLKJZHJ:FKJ:FHJJJLKZ^OK*RNJZNKJZJHK
-MZ^OKJRLKJZLK*RNKJJNKJZNKJZNJ*BKJZJJJ*\N+Z^NJZFIJB@H*:BHK:PL+
-M"PN+BVOK*RNJ*BJK*^OKJRHJZNHJ*FKJZFIJZBKJZJNKJRLK:^LKZRLKZ^OK
-MZ^OK*RNK*JJJ*BKJZBJKJZLJ"FJJJROK:XL+"PN+BVOKJ^KJ*BHJZJHJJRLK
-M*ZNKJRIJZFH*BFKJJBMKB\M+2TM+B^NKJNIJ:FJ*B@J*:JJK*RNKJBHJJJNK
-MJZNK*VMKZPO[RVMKZRLKJZNKJBHJ:FJ*BHIJZJJKZ^NKJJJJJJJKJRLK*ZNK
-MJZLK*ROK:VMK:^LK*ZNKJJJJJJJKJJJJJRKJZJHJJJJJJBHJ*JJJ*XMKJFHJ
-M*NKJ*JHKZ^MK"XN+:VOK*ZNJJZNJJZNJ*BHJJJHKZRLKJZJJ:HIJZNKJJJLK
-MZVN+BXN+:^LKJZNJJJHJ*NKJZFIJ:FHJ*BKJ:BJK*ZN+2PN+RVMK:^NK*VOK
-M*^OK*ZNK*NIJ:HJ*"HIJJBOKZRNK*^OKZVMK:^OKZ^MK:^LKJZKJZFJ*ZNHJ
-MJBJJ*^OKZRNJJZLJJBLK*RNKJZNKJ^J**JJJ*JJKJZJJJRJJJZNKJROK:XMK
-MZRLKJNKJZBJJJJLK*RLKZRLK*RNKJJJJ*NKJ*BHJ*JHJZJJJJROK:^LKZVMK
-MZ^MKZ^LKJZNJJZNJ:PNKJBH*2DK*R@J*:BJJZXL+"PO+"XMKZZLJ*BJJJRLK
-MZVLKJBHJZFIJBHKJ*JOK:VN+B^NK*RLKJZNKJRNKJ^KJJZJJJFJJ:VOKJZLK
-MJVH*:BLJZJMK2[N[BVLKZHK*2HIJZJNJZHIJJBN+R[M+Z^HJ*^MK:^MK*ZKJ
-MB@IJJJKKBVOK*ZNJ*BJJ:LK*ZJKJZNL+BPN+BZMJ"@J*ZBL+R[N[RTN[:RKJ
-MZNKJ2PHN6HHZ@_LR3HLGVT)ZN]\GXC9*I\_["R[F#X^2?@8JG\<#ILH[;B:2
-MC\=_OB9R:^JK^X.?QW>G0EX.BK*>_H)S8SH.LJ)*D_OJ4T\SBA*.ZALKFX^_
-MCR,R[N*K[GX.>B]3+TH*K^\[CH+""J^C:DJS.TLKLNK:DA):ZJ\OJZ)Z(^-#
-M:YKJ:YL*"VI*P_LJVMHJLOKZ8HLKHXJ+TQ./Z_J*HH(BHC(*(S/SBZJKZZNB
-MHDHKJLL;ZDJJR]LKJ\I*N\NJB@I**BJ*RGM[6X.;RX*2`HM;ZVI:ZCMKR^J+
-M:RN*>F*ZH[M+>[-[FVIZ*@JC*KKZLBNB:FH*$[.#NJ***LN:*GJ*@QN[RFNJ
-MBNKJJPL+B\NJ:IJZRRIJBFK*BQNJBDK+VVN*6HN+JZO*JMIKVTN+BTL*JSHZ
-MZLJJ*WM+N\OJ2RNJ"LJKJIM+JSJJHXM*&@JK"@OK*RN**XL+JKL+*LIJ*J(Z
-MRHKK:KOCH\M*JFM+"ZI*VDIJ"SLKZFJ+"TLJ&BJ+.ZOZ"HM+BFN+RZN*:XK*
-M*OMKZ@O+R^J*"HJ*"@J*2SLK*[MKJNMJVDH+"^MKB_O[JPJJ*NJ+:^HZRJJK
-MJBKK:ZJKBRKZ^DHJRPMJZ@O+2ROJ:NH+RWL+JBM+.VNK*RNJBDIJ:LHZ>@H*
-MBYMKJXKKJHI*^JLKB^M+VYO;N[OKJNMJ:GI*:HKJRJOJJHL+J\JKZRKJ*FOK
-M2TL+RZHKJ@HZ.JIJBNJJBVMKZROK*JKJ*ZMJ:\N+JVN+*TO+JZJ+:ZH*RNHK
-MJ[K**HOKBKK**XOKJ^JJZ^NJJVN+"XLJJ@OKJBMKJBJKZLJ*:BIKBVO+BVLK
-M:BH+*PHJZJKKZUH.+@*:Z@O[6R-C8V-C(Z,;FSN["XLKJRKJBHH*RDI*2DI*
-M2LK*R@J*BFKJZBHJJJNKJRLKZ^OKZ^OKZ^OKZ^LK*RLK*RLK*RLKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/4.g711a.uu b/share/isdn/4.g711a.uu
deleted file mode 100644
index cf431adbb6bf..000000000000
--- a/share/isdn/4.g711a.uu
+++ /dev/null
@@ -1,322 +0,0 @@
-begin 644 4.g711a
-M*JOK:XL+R\L+ZRN+:VKJZNHJZNHJ*BIJ:NKJ*BJJJJJK*^OK*RLKJ^MK:RNK
-MJROKJZJJJBKJ:NKJ*JJK*^LK*VN+"VN+BRLKJZNJ*JHJJJJJZ^LKZ^LKJBHJ
-M*@H*ZFIJZBHK:VMK:VN+ZZHJZNKJ*JLKZVN+BPL+BVNK*HH*BHJ*:BJJJJLJ
-MJZNKZ^LKJRNK*VMK:PLK*XNKBJJK*BHJ:FKJZJJJJJNKJZHK"\MK"PN+BVN+
-MZRLKJJKJBHH*"HIJZBHJ*NHJ*JHKZ^MKZVMK:XN+B\L+RXLKJZHJ:HH*"HJ*
-M:NJ*JBLKJRLKJ^OKZRLK*ZJJJBJJ*ROK:^MJ:BIJZJHJJJJKZ^OKZROK*ZNJ
-MJJJKZVOKZ^OK*ZJKZFIJZBJJJJJK*VMKZZOJ:FIJZBHJJRLKZVN+:^LK*^LK
-MJRHJZBJJJJNK*RNKZFH*BJJJ*BOK:XL+"XN+BXN+*RKJZBHJ*JHJ*JJJJJJJ
-MJ^OKZZLJ:HJ*:FKJJ^N+"\O+"PL+BRNK*ZLJZHIJZBHJZNHJZNKJ*JLK*ROK
-M:VMK:VOKZBHKJJLK*RNKJJJJJJJJJJHJZNJK*VMKZ^LK*ZJJJBHJJJKJ*JJJ
-M*^OKZ^MKZRLKZROK:^NKJZJJJZNJZBJJJBHJ*NKJJBJJJBLK*^OK*RN+ZZJK
-M*ZHJ:@H*"FHJJJNKZVOK:^LKJ^N+"PMKZ^LK*ZNJJJLKZRLKJBJJJZLJBHJ*
-M:NJJJROKZ^LKJRLK*ZNK*ZNKJNHJ:NJJJRLKJZNK*LJ*ZFHJJ^OK"\M+RPL+
-MBXMK*ZKJB@H*RLH*:JOKBXMKZRLKJZNK*NHJ*JLK*^MK:RNKJZJJJJNJ*BJK
-MJJJJJZHJ*JJJJRHJJJLK*ROKZRLK"XLK:^NKJRLKJBHJ*BHJJJJKJJJJJBKJ
-MZBJJJJHJJJHK*RLKZVMKBXN+B^LKJBHJJBIJBHJ*ZBJKZVN+BXL+R\L+:RLK
-MJRLKJZNKJBKJ*NH*:BIJBNKJ:FKJ*BJJJRMKBXMKBPN+BPN+ZRNKJRHJZNKJ
-MZNKJ*JJJ*JJK*ZJJJZNJJJNKJROK:VMK:RLK*ZNKJJJJJJJKJZNKJZJJZFJ*
-M*FLKJ^LKJZNK*ZNKJJHKZ^OK*ZNJZFJ*:FKJJBMK"XMKZRNKJJHJZBHJJBLK
-M*^OK*ROKZZNJJJJJ*JHJJJNJJZJKJZOKZ^LK*NIJ*BHJJBLK*BMK*VMK:XN+
-M:VOKZ^LKJNJ*"@H*"HJ*ZBJJJROK:^MK:VMK:^MKB^LKJZJK*BHJJJHJZFJ*
-M:HJ*ZJHJJJNK*^MKBPO+R\O+"PL+:RNJ*JHKJFHJZHJ*B@H*"@J**JJK*VMK
-M"\L+:^NKJZLKZVN+BVMKZZNJZHH*B@H*BFHJJBHJJJJJJRLKZXL+BPMKZRLK
-MJZJKJBJJ*JLK*RNKJZNKZLIJ*NHJ*JJK*^MK"PN+BVMK:XOKJRKJZNKJ:NKJ
-MJJKJ*JJK*NHJZJHK*^MK"PL+"XOK*ZIJBFKJZBHJ*FIJ*BJJJJNJJRLKZROK
-M:XMK:VL+NXLKZZLJ*NKJZFIJB@J*ZBJJ*JOK*ZOKZVMKBXN+:^OKJZJJJZJJ
-M*BJJJZNK*^OK*RNKJBIJZNHJJRNK*RLK*ZNKJZJKJZHJ*JHJJBOK:^NJZVNK
-MJBHJJNKJ*BJJJZLJ*JHKZVMKBXOK*^MKZRNK*ZNJJJJJJBLK*HK*"FIJZNKJ
-MJBMKBXO+"PL+BVLK*ZNK*ZKJ:FJ*BFKJZNHJ*FJ**NNKJXMK:VN+"XL+BXN+
-MBVLKJNJ*BFKJZNKJZBHJJJJKJJHJJBHJJJJJ*VMKBPL+BVMK:RNKJZNKJBJJ
-MJNKJZNHJJNOK*ZLKJZKJ:NKJZBIJ"JIK:PO+"\M+"^NJZNKJ:FIJ:NHJ*JJK
-MJJHK*^MK:VMK:VOK:VOKJZNK*ZNJJBKJZNHJZNIJ:FKJ*JJJJJJJJRLK:XL+
-MRPN+ZVOKZRNJ*JOKZFIJ"@J*BHJ*:BJJJRL+R[M+R\N+ZZLJ*JJJJJJKJZHJ
-MZNHJ*BJJJRKJZNHJJROKBXMK:VOK*ZNKJRNKJZHJZFKJ*JJK*ROK:^OKZ^LK
-M*@KJ*BJK*ROK*ZNKJJHJ*BJKJZNKJJJJJZLKJRIJBFKJ*JJJ*RLK*RLKJZLK
-MZ^OKZ^MK:PL+B^NKJZHJB@H*R@J**JJKJJHKZ^MK:PN+*ZMKRVN+RXMKZZKJ
-M:HK*RHIJZNIJ:FIJZBJK*RMK:VMKZ^MK:VMKZ^NKJJJJJJHJJJJK*RNKJNIJ
-M:FKJ*JJJJ^OK:^MKZZNKJZNKJ^LK*ZNK*ZKJJJHJJBJJJZLKJZJKJZNK*^OK
-MZ^LK*ZHJ*JJJJJJJ*JNJJZNKJZLK*^NKJBHJ*NIJZJHK:XL+BXMK:RNK*NIJ
-M:NHJ*BKJ:FKJ*BJJJZJJ:POKZVOKZRLK*^OKZVMK*^OKZRLJ:HH*"HIJZBJK
-M*RLKZ^MK*ZJJJJHJZBHJJZLK*^LK*RLKJZLJJJNK*ZLKJZNKJBLK*^OK:RNJ
-MJZNJ*BH*2FKJZJJJ*ZNK*^OKZ^LKJBJJJBLK*^OKJZJJ*JNK*^MKZZHJ*BHJ
-MJJOK:VNK*NJ*BNHJJNKJZFHJ*ROK:VMKBXN+ZRNKJBJJ*JNKJRHJ*NN+*RNJ
-M:FK*R@J*ZJIK:XN+:^OK*ZLKZRNKZXN+:^NK*NKJ:FIJBFKJJZNKZVMKZZKJ
-MZBJKZXN+:VLKZVN+ZRIJ:HIJ*BHJJZNJJZLKZZNJ"DJ*BNHKZ^OKZRMKZ^MK
-MZVOK*RNK*ZNKJZOKJNOKJRNJJ^JJZBKJ"FJ*ZBJKJXN+:VOKZ^LKJZHJJVLK
-MJZNJZBOJBBKJJRLKJRJKJJHK*BMKRVOK*VJJZJNKJZNJJJJK*BJJZBIJ:BHK
-M:XO+"PL+*^OK*^NK*BIJ*NJKJRN+Z^LKJNIJZNKJJNHK*^NJJNHJJRHKB\L+
-MBVOKBXLKJZIJ"KIZB@KJJZHKJVMK*^OK:RLK:XO+BROK*JHJJHLK:RKJZFJJ
-MJBHJJZJJJXMKJZKJZBJJ*FHJ*JLKRPN[N\N+JFJ*:FK*2LKJJXN+R[N[NXNK
-MJRL*BNK*2@H*BHO[RVNJ*NJJ:RLJ*JKJZXLKJHH*ZJMKBVLKJFO+RXNJ:FJJ
-MZXLKJZIJ*JLKJRKKJFJ*"HHJJ^J*ZNJJ"_M+ZZJJJXN[NXOK:RMK:\NJ2OIZ
-M*NMKZKKZ.JHK:NHJ:^OKBXL+N\L+:ZOK:ZJ*:JKK:XLKJBJJJJJJJRNJB@I*
-M2HHJJBHJ:VM+>\OK*^LJ*FOJJVLJZBHJZ@M+JBMKBZMJ*BK*BJNJ"PLJ:BIK
-M:RNK:BKKZ^N*:BOKN^L*ZHL[NRMJ^DKK6]LKRAI**HHJJBKKJZKJZTO+.^MJ
-M:CM;:WI:6JK+"RLJ*ZOJF@H[>XMJZHN+ZFNKZ\O[>PJ*JBNJZNIZ"@MKJFKJ
-MBZK*:BJJ*ZHJZLIJ2SO+:RN*"YM+BZMK*^J["XL+.KIZ>KK*RVHZ*@J+FSN+
-MRDHKNQL[^^NZRHMKRHOCJSHJ.HH+ZZJ+2QKBJZHKJBJJZPM[&^MK*LH*ZRLJ
-M2JHZ@HJJ6^/[:AI*"LL+*RLJBVMJ2^MK*IKK>SOK*BMJR@KBRLO;2[KZ^OJK
-M"PLJ*NN+>TOK*HM[J^IK"WMK:VO[2VJZNHOJ.CJ:^LJ[VRO*JHH:NJMK:XMJ
-MRFL#8XN*RNMK"XNKJFHZBHIKN^MS6R)B<AJZFPL:"KM[^PMK.UNCNZK*NAHJ
-MBXN*BFM;ZEJ::KL+"^NZBXM:>NK[&[N[RRIJRROK*SHB2JJZ*ZIK>QN[^RKK
-M^QH*JGHB&FLK2^.J>FL+NX-K"EIR@HL#FXOK:[LK*\MK"L*:RV,;NAKJX_.;
-M"GJ*RH*2RGNC@RNZNNJC0QNZHAJZFVNZRKO[:PN+:WKB(IJ*(V.;H^H*JZH+
-M:YMJ>HIK"[L*XAI::N.CNGJZ"^.+ZHHKRRLKBNL[*ROJBKOC&^KZ&F)*FSNK
-M"CIJ2RKZZ^-KRBK*"]M[*MJ*FOK[`R.:DHJJBV,[JXOKNGH;,^OB\HMS>[I"
-M0CK;.[L;R[IBLCIC(R.J"AOK*^JKJTKK:VK+6PKR0KIC<YOJ&@J+Z[MJHGJK
-M:XNC*_IZV\.Z@OI+F^L*HMHC4V.JNLKZJQNK>BH+^\K:6KIC2ZJ+^FOK:LM+
-MB^KZ*_LCNT*2>JK:ZM,OKT.B$AH+"\+B6@K++X]JLC*R:KO;6ZMKFNOK:_.3
-MXQIB>DMSHS)N&IOS6SH"`LM;:^JJ*[I**J.C^\H*B[JJZDJ+^EI"6ILS$R,+
-MRHNJ^F)""LLO#YO:"KKB*DNJ:H/+ZZH*BMJ:.H/#&S(N.IJZ(JI;@\^SB^O:
-MXI+:8Z];BZ*:*ANS(PK.PB.;(_MZJKJZ2V,CJH(BRCL;BPH2;@(;`X-KNE)*
-M@V-#*X/S2\KN[OOS(VL*8IJBZCN[(\O[^JMKBOOJ:EK""\-+BBLJZB.[^N)Z
-MJN-S2\JRJ\,[<L+J"WOC8VIZ`CH*V[,KNPNOD[+.'B/S\H(NZ]M#KXH#P^]#
-MLKK:0J+JJFK"FI.;0B*S0X.3"BYNHNHK6SLJF]MS+RNZJ_N;CM+RNAO:.OJ#
-MSR^SBV("J[M:JII2RONO$YM;VD*:FNH"J[M[(^O+B@HZDK(BR^.[2^K[KV_#
-MHPINPF)*8Z\SR\*^[M+OWPOR+JX+CT^*+@*:WW_Z;JYB^GJ[*^-C&_L3TY-Z
-M$@(2NR/+<E)BNAO+>L,[VCNJ@^\/_\):*A):/CZ"6BO*>R]O0WL;\THBNAN3
-MXTLN;B+"RD.SZRZNNB,#OP_+XOKZDBLO;PK*KCY*0X_J&LZ2L@O_@\J>[NN+
-M0P./AV_CRPJ:V@JSBZZB2C):,V(*J\ZJDC+R.A\:RX]S@QNS(NZ""@,3[P,N
-MPB,";IK;MV>C[C:>'@(/+T/KH@OO3_-R\J+["\M/+_K"SCYN0FKN4K)39R>/
-MFUN"^]JFVLNC6F*O:VLJ2C("AT>G6Q+^'NZRZY/?HQKN)GX:\T,OJ]*2;EL_
-MSR]K"EKZ8W-O"M*:8ONS\WJ.4K,/^R[BZS)B4EMO>W-J\DXR`Y,_KR/KH\LR
-MHBY^TNOST\_S>M+2(I*OHZM[2OMJXCI+H]LS7P\[;J;.OJ[Z@X]S<PMC$[,+
-M^LKRHJ*"^HI+*KMJJX_+JJ-JRDIK.X+N(NL*FX^C8T.+LOXN[LJ/\\OZHJK[
-MDZ,#&Z*RP@+*2BO/ST,O8TX28H[:ZRJ##Q]_2Z;^>CH[KB[BRN./GT];^G).
-M_D[*"DO;[R>?3Z(NKG[N\DI+8W^_`Z]+PO("*PM+HWN:KDZ&)M+J#^=G/V_3
-M@^JB(AIZSGXNJL-;<R\OT_K2<N)ZX@H#D_O*2R,;,WMB(H(::XIB\KJJ"FH*
-M*^/[^GM3&TIZZZJB.M/_KR/Z+F[24O)[$R_S8]/3<SKN?I["BJ,CBNHC+T-*
-M+B[*DZ\3XPL"3GZ.NJ.C:\M#TX\S*RI*$FYBJWNCKV\OTUN:PB):`M)"8BYR
-M@HHSSS^#RN*"RY-SNVO;2XKBHNK+"RNB,KI+6V-C*L+RDH+*RZ,#0\-S\WNJ
-M&L)"0J+**\O[*S(^_J[ZVU.OKR-:TO+"^F,_W]]_?S_O0\L:+D[.[GH3AZF)
-MR8EWLX;(H&#@6$B6/BK#$U.O+R_OS[\__S]/CV^/CX\_']^GYX>')\]+<B8&
-MKQE!D9%AYUA0C,R,4.`6VO]GMZD)66%AH8EOQDAXN*B>2Y]G!S?7J=<'K\[6
-MB(A67ALG-S>'WQ-K2AKBKCIIL:TMK6&S`&R\/`P0>(KWB8GI*6DYV7GIKT8X
-MH)@H$F<IZ9>G#X^_G\\+?I8H*+8R?Q<I*7>G`WIR3AXJ>='M;:W9%JP\G'P,
-ML`;IV>&A^0EI2<D7PY;8@&!X'C>9(5EI'[H./F[2CN8V]@8NKS<I*7=?FZ[>
-M)EZK>:T-#>UAYE`\'!S,\-:I6>$AF4D)R0E'XHC@0,!X@DD!L0'Y'UZHZ*A&
-M)AZFGA*;IW>IE^?#CK8HZ*@.^>T]?;V1XQ!\I*3\K&AI8<$!(7E)20D'SOA`
-M$)!@YDDQ4=$!B;JHN#C(Z%;VYL)O=XE)B3>SGE;(N`C6_S%-?7T-X;@,7"2D
-M3,#[(;%Q02%Y20EWBNA@D-`PN!]A$:WQH<>>:+A(B.A6-MYJIZD)"=>_+M;(
-M^+AHHH'-?1T],<9LW"0D//#2(?$1,>%YB2G'HNA@D%#P^$_A$:UQH6?FB+@(
-M*';&Y@ZKWU>)B1</CE;(^/@(DF$-?1V]L09LW"0DO#!*X?$1,>$YZ5<G$FA@
-MD%`P.*>!42UQH1^6^!@XZ/8FOC)CA^G)"==OGNCX&)A(MNFM/9V=;0D`/*3D
-M7&R8:;%14;$A25?G&A98L-"08":Y\:U1P8FN"!B8R%:&_BZ*#_=I"6E'FX:(
-M.'@X:"_QS7V=#2%XS%PDI`S@-\'143$A"?<GBD8X`'!P@)8I0:VML3DKB%B@
-M^"@FLBKC3\=7*5=G.Z:H"$BX"'8WD<W]?8V9H$Q<)%R,V(GQK:VQV:D_&\YV
-M.("PL*"FB4'1D8'I+@@8F`CVON)JV\]'J>FI9^N&:#AX.&@*@8T]?4W!=NP<
-M)*1,P/]!K2UQ(6G_Z_Z62"#`0.#VEX'1T;&Y"@@@('BHOGN/_Z?'%U=WWTJ&
-M*`C(B%;&;P%MO3T-`7;L'"2D3`#G,2WM$>&IBQYV:+@@@(#8IBD!$1'!"5(X
-MX."85M)O9P>'AT>WAV^B9JB(R`@HAJG1S?W][6D`/*0DW"PH(:UM+4&YCYXV
-MZ,C88`!@B$\A$:T1X3\(8$"`N!X_]Q?WAX<'9W]K'M:(R`@H!IHYK4T]O='G
-M,/RD)'P07H$M[:T!::M&*$@X6&!@V$:7@=&M\9F:>`!`X&B:M^GIEV>GG\^C
-M<H:HB`B(UB:CH>U-/4WQ2M!\I*0\L-,Q[6VM81=.*$AX&"!@(+@NR4&MK4$)
-M9B"PL""HT^E)R:EG3S-[2H[&J&AH*+8^6[E1S4U-T:>P/%RD?)#NP>UM+0&I
-MCF@X&!A8(*`(KFD!$=%!"9Z@0+`@J,,I2<FIYX\#.^H2YA8HZ*BV3HH'@>W-
-M36TAZ.R<I%R,V`E1;6T1F;,H>%A8F!B8"&8G63'1<2'?",#PL-@FM_D9N5>?
-MN\+N3B:VEM;VYB[+KP<AK8T-[>'&K/Q<W`P@UQ%M;=&9R\B@(*#X2(C6OJ=Y
-MP9'QX<?H`/"P6.9W&:'Y5V_"?M[>)L8V-@9><B-/GRG!+6UM$:F@C)S<_-`&
-M82UM+0$'J"!@(/CH%C;>2Q=90?'!2?)8L/``B*\Y(:')YR(FQ@;F)B:F'H[B
-MRQ.30U?!+>UM<0=@S!S</#"+L6V-K:'*.&!@V.@&AF;^B_>AL7'!B29@D'"`
-MEK>A@2&)+Q[VEL8F7I[^#L)KKT_O.V^9D2WMK7EH[/P<?*PVX2UM+6&3R.#@
-MF"B>SB:&CC])`7$QV;L8\-"PN*]Y@6'Y)S[6Z%9FCB(Z*ULS4U/;0AY>Q[$M
-MC8U!NI`\W-P,>$FM;2W!)^B@(+B6;JZ&5O8BJ6%QD8%'"+#0<*#RR>%AF<>.
-MUBB67B*+N[M[6V,CBV*^IGZWL>V-;<'R$/S<'(RXN5'M48&?*)AXZ&;23O9H
-M**ZI89$1`?=H0!!P('XIH2$YAS(&1B:NJ_M+*KJ*Z\LKNGH:LJH)\2WMK1DH
-MK#R</*QV&=&M<:'O%DC(J,8F1BAHMO.YP9&1(;\X,-#P6`XIH2&95V,^!L;F
-M?F[RNAL3+Q/[&J[.CB[O(:WM[7$'X`Q\?,P`_T&M44&)#H@X"*@V-JAH*.[7
-MX7'1,4EF@-#00(A?V8'A.6<N-M9V9@ZB2_/O;W-+HJZNLKI*BVDQK2W1>2BL
-MO/R\T+89$5'QV:_6.+AH%L8VEA;>I_G!<3&AL_BP$#"86@DAX9F7J^;V]@:>
-MPHOS#T\O>PHBPH(:(CX^U[&M+:W95JP\_+R07B%143$YFHB82"C&WH9V5J:G
-M>4&1\:&C&/#0\!AJN6&!V1?Z1JBHMOZB>V]_GX\;6@Y^OE("\LXJ>1$M[9$I
-MV&S\_`R`_\%1$8&7ACB8")8FG@:6]F)7(3&10<FFX'"0P&A_>6'A>;>:!M;6
-MMJ;2:^\?'V\+4J;FGD(+`VM"QP%1+:WA_G!,_+RL5GD143'YXLB@F.AF(AJN
-M#MKGR2$!@;FZ.`"P@`@#R:$A.<?B!G8VYHY:Z]M#DS,C*]J2[FZ.[HY^IL\!
-M+6WMP:*0/)S\+'8AK2UQ^:;8@""()OM#ZD)*IXFA@6&Y^PA@P.!H0PFAH3G'
-M@K:HJ+;^FIL3CV\S"]K2#@Y28IJ*BI(.=S'M[5%YR&Q\?,P`MW'MK8$?N(``
-M6';K)Z<S.@MGB1FA^7?N"%B@2(8/Z3DYB0>JYM8H5H;2FX__/R^;^BX^?KZN
-MRK,/CTLNCR$147$9QA#,3(P`WT&M$>&/^```6+:O%Q??JK([Y^FYN5?3INC(
-MZ`:J9ZGIJ6=[_K;6E@:.:X_?W\^#.NY^?@Z2"K-/O[,N!J,AT:UQF790S$SL
-M(*GQK?&9;B#`@+@2MVD7,YYF$C_I>?DICSZ65K:>2E/?9^>GCVN.!I:69K(O
-M9\?G4^*FQ@:>@F/_)Y\STO;HLB&M[5$A!M!,3&R@:7&M,;EF8$"`2,K7"9?+
-M9C8>\REYF8FG$D;V9HY*0[^?IR=_\^+FUJ@VK@\WEV?+)M8H=LX#)T<'GWLN
-M9M:H.N&M[=&A)I#,#"Q8*;&1P>GV8,#@*._I"4?2J&BV^RG9H?FW$G86)KK_
-M!V?_0RN:HO*>QO9&_KO?A]_KII96Q@)_]U<W;Y+FQ@;FIBO9K>U1@5,`C,QL
-ML,IA\4'Y^M@`X$A"=VEWRA9H=NJIV>%9J8M&*/;N+X>WQY_[PKZ&-O9&7CH_
-MYR=3<@86EN;J)W>7Q\\ZGH;F3F)Z2D<!K='!Z>@0C.P0",G!05F?B&#@./ZW
-M">F/MD@(9I\YX>%Y9U[H:/:R'Q>IEQ\BAM:H%N:"K^=G#Z)F5JBV+@^7Z5>G
-MBMY&1GXJ#Q]3:F?A\3$AQT@0[*Q`9GD!8<D:."`8*`N7*0?2*,AV.^FA85DI
-M2E8(J![#Q]>7)_N>-I9V!HX[3U__FXX&M@;NLV?WQT_JSJ;^6I.GYT_ZYH;G
-MX3'!&:_8$%!P6.\9X7DG]IB8B$Z'*:F_)FCH7K\)6=G)9ZYV5L:N+P>W!\]:
-M)G;6-MYZ+U^?`T(F1@:^BY]'1]\C(HX.XMO/W_\;OG:VI^$QP1G3&'#0\)C/
-MF:%)C]:8^"@B-^E7#^;H*#X?"1D9R>=.J.AV#B]'=[<_0L96J+8.8Z>'WQL.
-M!C9F@@\'-V<3&@[^TKL/_\\C0EY&-O*)`4'A*>9@\+`@9JEYN6<>"+BH#J=7
-M%]_N5FBVJC=)>4D7&P8H5B9+!ZFIQYMF*&C6?L-G1R>CC@8V9A)#IT>'[UK^
-M'JX;_V=G3XH>-A8VFHF!`:$7)J``@)BFMXFI+R;HZ,9ZY_>'<WX65J:S%[GY
-MB><2=BB6#B\WJ9<_KK:H5F9Z_\<'3YJF1L:^"Y^')V^K[O[N*E,?)T^[;H;V
-M!N,)X>$YI_98X*!H^C>I!ZH&J!8FZZ>'ISM^ML;"GU?IU^?K'@:F@M,G9U^3
-M>DZF)OXR:Q._SX.:CAZ>THLOS^^CFO+BJO/_GR]*/H:&LL<YV3F7@FB8>`BF
-M;X>G^_ZVMI[*[[^OBDXFGBJ?MW?'OZON_DZ:+R=G7R^KKO[>_J[*8Z]3@ZJ2
-MOC[N^J.OTZ/KRGHJ6U-O4POR3@XZGZF)Z4>;ANAHJ"8J#P^;<J;F?H([`UM*
-MKD[N"E.?IY_O&XHZZJ,O;U/#6TNJNL(N4B(K6\/;RG)NKN*KPU.SFZNBLJ(K
-M@U.OP\M*8D*Z\Z?'!Y^[;N:&)NY*NPNBCGY^#B++6]O+:KJ*BYO#\_.SHTL+
-MBVN+^]N;NRNZ&IJZJKN;FYO[NXL*HB*ZJ\L[^\MKJZH+^SOKZOI:V@K;+T\_
-MST/*4K[^;K(::BI*6L+R\D*"HDHK.]M;&Z.C&QM[RXMKJBK+FQNC&[OKRMKB
-M.LMC@]M+J\HZ2HJ+VZ.;2XN+:ROJ>H(RXKHJ2^/S$[.;ZVJ*ZHHZVJ+:^KJ:
-M6J("\I(2,AHJ:XN+:VN+:RN+2SM[VP.OCV^O$S,#H_O+"PO+RVLKZOKB@F)B
-M(N("@B(:^LJ**JHJJ_N#0Q,S.THB(EIZZLN[Z\H:X@*"`K("VDJK"TMKJNKJ
-MBZ.O#^^3@UN;VP/S4].#.^OJ:BKK*SJR+HZ.;JX"^JN+ZZHJ*VMK:\N;(^-;
-M&TMKJ^KJZJLKJFJZ6F)B8L)"8AJZ*NMK"SN;6UL;6V,#0\/CV]NCXZ,;&YL+
-MJHHZ^@HZXJ)Z^CIZX@):>GHZRNHKZLJ*J\M[>PMK"[L["PN[RXL+JHHJJ^JJ
-MJRKJ2GJ:VIK*JHN[>WO;FSM+B^L+NPO+N_N;>[N+B^LJ*HIZ.DKZ&AK:VLHJ
-M:NJKZFJK:LHJJZMKBRN+2[N[2VLK:^NJJZLKJ^KJZVMKBXN+BXNK:NJ*RHIJ
-M"NJJJJNJ:FKK:^N+BXL+:VMKZZOJ:FKJ*BKJJFOK*BJ*"NJJBFHJZJJJZBM+
-MNVMK:ZL+RVMKR\L+2^OK"ZOJJ@K**^NJJRIJ:LKZ^CH*ZNKJJRMK"^NKZPO+
-M"VLKBPMK2TL+2\LK*JKJ:FH*:FIJ:LHZNDJ*ZJHKBTL[.TL+"PMK*ZJKJJLJ
-M:FJ**JNK*RNJ*ROJ:NKJ*JJKZVLK*VMKZRNK*^LKJJJJJJNK*FIJZFIJ*FH*
-MJNNK*^LKZ^LKJVMK:TL+:XLK*NKJZNIJ:NIJZJNJ*NL+:XOKJZLKZHIJ:NOK
-M*VLK*XM+BVN+:RMKZZJJJFIJBHKJZJHJ:FJJZZKJJBOK:RN*JFOKJZJ*ZBLJ
-M:JJJJHOKJFOKJNMKJBNJ:JL+"TL[BZOKJZIK*ZHKJJJJ"@HJB@IJ*BJJJVKJ
-MJZJK*RLK:RLK:XL+2\N+ZZLJJHIJZJJKZHJ**FJ*JJHJJRHJJZLJ*JJJZXMK
-MB\N+*ZNKJXL+ZROK*VN+JRJKJBNKZJHK*FJ*RFKJJHNK*VOKJJNKJFOKJJNJ
-M*JJJ*BHKZ^MK:^OK:RNJ*ZJJZ@J*:HHJJRLKBVL+2\N+:RLK:RNJJJHJJJHJ
-M:HKJJBHK*ZOK*^JJJNHK*ZKKBVL+RVMK"POKJNIJ*BJ*"@H*BHH*"HKJ*NNK
-MJ^MK"POKZVM+RPL+N\L+RVLKJRLJBDJZRNKJ:HJ*JJLJ"LJJJZLK*^OK:ZLJ
-M*RMK2RNK:VMK*^OKB^NJZHKJZHI*RFJJJRJK:POK*VOK*^OKZNHKZROKZPO+
-MRPNJ*NKJ2DKJJZMKZ^N+"ZLJ*BHJZHH*ZBJJJJOKRXNK*ZHJJ^HZ2NKJJ^HJ
-MZPN+2\L+.[N+:^LK*ROJZBHJ*JIJZJOKJZNKBJOK*FK*"@KJ:JIK:XL+"PO+
-MBVLK*RNKJBOJZNJ*BJIJ*JLJZNNK*XNKZTLJ*HNJZBN*BJLJZXOJZBOJ:BKJ
-MZJLKJJHJJPMK:^OK"[L+*ZOK:^NJ:BKKJZK*RBJJZNK*ZNNK:NHJZ\L+*ZN+
-M"^OJZJHKZRLJJPO+ZRLKJBNJ"JJJZBKJR@KJ*JLK*RMKZRNK*ZJK*^OK*ZJJ
-M:VMKZZJJ*ZNJ*NJJZ^NK*RLJZVH*ZBIJ:NHJ*RNJ*JNK*ROKZ\M+RXO+"\MK
-M*FIJ*BJ*BBKKJBJ*RHJ*:NJ**XNK*BOKB[MKZVL+"XNK*JNKJ^H**BLJ*FIJ
-MJBLJ:NHJJVMK*XN+:VOKZXMKZRLK*ZHJZJJJJBJK*BHJ*BJJJZNJZJN+JFHJ
-MJNN+J^HJ*XO+BXO+NPOKJNH*:FJ*ZBKJZJLK*ZNK:BHKZHIJ:NHKZZOK:^L+
-M"POKZXOK*BHJ*ZNJ"@JJJRNKJVO+BXLKJNOKZBNJZJHKJFHJJJOJ*BHJJJMJ
-M:NJJZFJ*JFN+BXMK:^NKJZKKZZLJJRNK*JKJZXMKJXN+*RLJ:NIJZHH*ZJNK
-M:XNKZPOKJROJ:JHJJNLJZ\MKJZNK*RLJ:BHK"XLJ*JJJJZO*"BJJJRHJJNOK
-M:RNK*RHJ*BHJZ^OK:^OJJ^OKJZNJ*RNK*HIJJJHJ*JLK:RNKZZJJJVJ*BBJJ
-MJZNKBRNKJZLK:ZNK"TLKZZLK*VKJZBJK:RNJ*^LKJRKJZNIJZNKJJRNK*JMK
-MRPN+"XMK:^NJ*^LK*RLJZBJ*ZHI*NDI**JLKJRNKBPOKZ^OKZROJJ^OKBPN+
-MN[NK"JNJJJLJBNJJ*@I*RFJKJVHJJVN+B^M+2[L+BRL+RVNJ*ZOK*ZLJJZKJ
-M:LH**JLJ*FKJZFIJ*JNK*HL+BVMKJZNJJ^HK*JHJJBHKJZN+"[L+JJHJ"HHJ
-MJJNKJ^MKZROKZXL+"ZOK:ZLJZHKJ*JMJ:HKJ"LJ*JJHKZZNK*VOKZRMK"XN+
-M"VOKZRIJ*NJJJZKJJ^J*BBHK:^OK*JNK*RHK*JIK*ZKK:VNJJZHJJ^NJJJJK
-MJZNK:ZKJZJOJJJHKZZNJZNHJJFHJJJMK"VMK:POKZZHJJVNKJ^HKZXNKJNJJ
-MJBIJ:HIJJJLJZJOKBVLJJZNK:RNJZPLKJVNKJVNJJBIJZNOJJZN*JFNK*ZLJ
-M*XNK*JLK:PNK:NJJJZJ*RNLKZRNK*\MK*VLJ*BJ*"NIJJNOKZPN+:PL+:^OJ
-MJVOJJFIJ*NK**NJ*J^LJ*RLKBVOKZ^MKBVLKJROJ:HHJ:BIJBJJJZJLKZXO+
-M*VN+ZRLKZJJK*ZHK*VN+B^NKJRN+J^NKJZNK:FH*BLK*BJJKJBLKJBKJJ^LJ
-M*ZNKZ^LJZRL+"PLKBXN+*^NJ*^NJ*FIJJFLJJNJJ*RLJ:FKJ*JKJ*JJKZRNJ
-MZ\M+RPOK"\OKJJKJJJMJ:JHKJZNK:VOKZROKZZLJBDHZ2HH*:JLKJROK:VMK
-M*^L+*VLKJRL+:PL+JNLK*HJ*"FH*2@KJJXLKJHO+*RLK*ZOK:BHKJBKKJZN+
-MZVOKJZKK*NKJ:NKJ"@JJZZOKJFL+:\O+BXO+Z^KJJZHJ"DK*ZJNKZJKK:VMK
-MJXL+ZVLKJRL+JRNJJJJKZJLJ:NIJB@KJRDJ*"FJJZNKK2TN[RXO+RVMK:VN+
-MBZJK*ZLKJXKJ:JHJ2KJ*:NHKZZOK:XMK*^JKJZLKJXKJJJHKJVHJ*ZOK*^KJ
-MZZJKJBJKBVN+*ZHJ*RHJ*VLK:PNK*BIJJ^OJ:JKJJRK*BNLK*ZMJ*ZNJJVLJ
-MZXO+:RNKZRNJ:JKJJZLJ:BNK*RLJ*BMKBVLK:XOKZRNJJZIJZBNJ*RMJBJJK
-MZBLKJBLK*JJJZBOJZJKJZBKJJVN+R[N[2\N+*ZJ**JLK*RLKZVJ**@H*JBKJ
-M*BIJ*JKJZJHKZ^NK:VO+:ROKBPN+ZZJJJBH*BHKJ*JLK*ZNJJZOKBRLK*RJK
-M*ZNK*ZLK:VLJ*BHJJNIJZFOK:ZLKZ^LK*FKJ*ZKJ*BJJJFHJ*BIK:ZOKZRJK
-M*^NKJBOKJZKK*RMK*RMK*ZOK*ZOK*ZLKZRJKJNKJJBOKJVHJJJOKJNJKJXJ*
-MB@KJZHHJJVO+"\M+"RLKJ^KJJRJJ:VMKBZOJJJKJ:@I*"FJJZBJJ:\N+*VN+
-MBXMKZBJJJ^MKJRN+:ZOJBNJK:JKJ:BOKJJNK*BOK*JKKJNLK*JN+*ZIJ:JIK
-M*FJJ*JLKZBHK*^NKZFHK:VOK*VO+R^NKJJNJJBHJJJLJBDH*:JNJJZKK"XOK
-M*JLK:ZLK*ROK*ZLKJZJKJNKJJBKKZ^LJ*JHKZZNK*^N+:RNK*^OK*ZKJBBLK
-M:@KJJZLJZNJK:ZNKJROKJFIJJRNJ*NJKBZLJJNOK:VOK:PN+B^MKZROK*RMK
-MJZNJ*BIJ"DIJBNIJBNJJ*BLK*RL+:RNKZVMKBXO+NTO+JRJJ:@JZ2HJJ"@J*
-M:BHJBHJJ*ZOK*XO+"XL+NTOK*^OKZ^LK*NNKJNJ*"NIJ"@KJ*BJJJZJKJ^HJ
-MZNMK:XL+BPN+BXN+BVLKJROJ:BJJ*HKJZFKJJBIJ*NJJJ^LK*^MKZ^NKBXOK
-M*RHJJZJJ*NHJZFIJ:NJJJJJK:PO+"XOK"PMKJZKJJJKJZJLKJNKJZJJKZHIJ
-M:FKJZJOK:^OK:XO+NXMKRPN+ZZNK*BJ*2HIJZFIJ:HHJ:NJKZPMKZROK*ROK
-MJROKJNOKJBJJZJJJ*BKKZ^NJ*ZNJJZOJJ^NKJNNJJZNJ*ROKJZLJJJLJBNHK
-MRVLJJNLJZFKJJFN+"RLK*ZOJ:NIJZNKJ*BJJ*ZOKZRNK:^MK:VLKZZLJ*BJJ
-MJ^MK*ZNKZHJ*B@HJJRKJJBJKJVMK"[N[RPL+ZZLJ:BKJ:@J*ZBLJZJLKJZLJ
-MJJLKJBMK"PO+R\O+RXMK:^LK:FKJ*HJ*BFKJZFHJZBIJJJLKJZJJJJJJJJKK
-M:VOK:PO+"XOK:XN+JZLJZFH*"FKJJRLK*^NK:NHJ*BNKJJJKJZNJJJMK:^NJ
-M*JJKJJJKZVOK:^OKZ^NKJJNKJJJKZZNKJZJKJNJJ*ZNJJZHJ*JJJJZNJJBIJ
-M*JNKJZJJJ^N+BVMK:VOK*^MKJZOK*BJJJJJJ*BJJJRIJ:HJ*ZNHJJJNKJ^MK
-MBXL+"\N+BXMK*RLKJJHJZBJJ*JHJZBHJ*BHJ*RNKJJNJJROKZXN+:XOK*ZLJ
-M:HI*2LJ*BLHJ*ZLK:PN+B^LK*RLK*RLK:VMKBVMKBRNJZBIJ:@H*BFIJ*BHJ
-MJJJJ*VMKRPL+RXLK*^NK*JNKJJJJJBJKJBHJ*NHJ*NHJ*FKJZNHJ*VM+.VOK
-MB^OK*ZNJJBNKJBHJ*JLK*ZHJ*BJJZBHJ*BJJ*JJK*VO+2TO+"PMKJRJJJJJK
-MJFIJZNIJZNHJ*BJJ*JNKJZNJ*JLKZ^N+BPN+:ZJJJNJ*JBLKZXL+BVLKJJHK
-MZHH*RDIJZNIJ*JOKJZKK2TM+FYN[J^IJ*BK**BJ**JHJJVMKZRLJZFH*NCK*
-MBNKKRPL+RSO[FTL+.PNJJHH*NGK*:JI[,[(^JJ,:!C8G5[HJWUL[I\K6CM<Y
-MKDAV;ZE'7OC>_\_ZRP?"]G9J%X<GVZ8*?R.F!B9[]P<_FWKKI\.^FC(."DM:
-M3MZF`GJ+SW_[0MIJ<\^#6VH3C\^OR^O:CDY.9E+3F^+J&V_OZG*J`HLO>WL:
-MLX/[HXJKFCK.\@.SLVH^/FKS_Z\CKJYJJ\,:BJ-#6[*Z:ZN:0K(2(K/#>[LC
-MLR\36JOO2[(NK@+*R@IK^XK*PZ-KHCL+HGJ"R[/;"ZXJ,_-C8BLKJSJZRYKJ
-M&NJOXVN:VEI*J[K:NZ-+ZHKZRO/OHP*"&\L+:K+SKPMRDIOJ*CH:*TI+NMK:
-MZJ^[BRMJZYM;JFI*FIN36XJB"HK**LOJFK(ZDS-K(KJ[B^LJBFO;RQIK.ZM+
-MJJ(BZWM[BZ*B:AO[ZVOJRZMZXJ**(BK[R^,;(R-;F\KBRML+6FJ:NFN;&[I*
-MZHHZF]OJ2KJKNSOJ*MM[B_I:2R.+8H*Z.T,[>J*J(_LZ(@(*RPN[*ZIJ*]MK
-M"LK[6XN*>HH+.\KJ.YN[ZBH*"KHZ"XH["QJ+.[N*^GJ:B@H+:RJ;2TLKJRM[
-MRRJ[JRHJ:\LK:J+*N[O;:GI*RKI*:ZOKZ_M+NOJJ>ZN:6NK;>\OKR^NK"JI+
-MJCJZ*ZJK:PLKF\LJB\O[BCH:NJN+RZIK"JO[:VJZ^HHJZRM[>TN["LHJZVH:
-M.NKJ:FLK:JJ+B^LKZ^LK"JHKRWM+B^M+"ZIJ:LKZ.FKJ*NNJ"JL+"ZJZ2HL+
-M*^J[6YL:CJX"&FJ+.]NCX^/C(Z-;FWN[2PMK*ZLJZFJ*"LK*RDI*2LK*"@J*
-MBFIJZNHJJJJK*RLKZ^OKZ^MKZ^OKZ^OKZRLK*RLKJZNKJZNKJZNKJZJJJJJJ
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M__________________________________________________________\`
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-:````````````````````````````````````
-`
-end
diff --git a/share/isdn/5.g711a.uu b/share/isdn/5.g711a.uu
deleted file mode 100644
index 03fe03bdfb75..000000000000
--- a/share/isdn/5.g711a.uu
+++ /dev/null
@@ -1,368 +0,0 @@
-begin 644 5.g711a
-MZVOK*RNKJZNKJZNKJ^LKZVMK:RNK*NJJJNJJJRHJ*BHJJBOK:^OK*RLKJZNJ
-MJBKJ*BJJZ^MKBXMK:RNKJRHJZNIJBFHJJZNJ*^MKZRLKJZHJ*JJKJJNK*^MK
-MBVMKZZLJ*BHJ*JJKJHK*:FKJJ^MK:XMKBXMK:XMKZ^OKJZJJ*NKJZNIJBFJ*
-M:NJJJZLKZ^OKZ^N+BVMK:VLKJRNKJNKJ*BJJJJJJJBKJ*JJJJJJJJZNJJJOK
-M:^OK2[MK:^NJ*NKJZBHJ*NKJJRLK*RNKJRIJ:NHJJJNK*RNKJJLK*^OKZZNK
-MJZLK*^OK*ZJJJJNKJRLKJRNKZ^LK*RLKJZNKJRLK*ZNK*RNJJJIJ:JKJZBJJ
-MJJNKJBJJZBJJ*^LKZXN+:VN+B^NKJJJJJROK*ZNK*BKJ:HH*"LH*:BJJJRMK
-MBXN+:^MK:^OKZVOKZ^OK*RLKJRHJZHJ*BFIJ*JNKZJHK*VN+BXOKZZNJJZJJ
-MJBHJ*JJJJ^LK*ZLKZRLKJZNJ*BHJJBJJ*^MK:^NKJBHJJZNKJZHJ*NHJ*JJK
-MJRMKZRLKJZJJ*BJJJRNK*ROK*JKKJZLK*^OKZVLKJZJJ*JJKJZNKJRLK*RNK
-MJJJJJJHJ*BJJJRLKJZLK*RLJZNHJJJJJJJLK*ZNJJZLJJJNKJZJJZVOK:VMK
-M*ZLKJZNKJJKK*RHJ*FIJZBJKJBLK*ZNKJ^OK:^LK*RLK*ZNKJZNJJZLK*ZNJ
-M*NHJJJNKJBKJ:FKJ*JLKZ^MKBXOKZ^NJ*JJJJJJJJJLK:^LK*ZNJ*NIJBLIJ
-MJRHKBXN+B^LK*RLKJROK*RNJJJLJJJNKJBKJZNJJJJJJJJHJZNJJJROK:VMK
-M:^OK:RNKJJJJJJNJ*NIJZNKJ*NKJ*JNKJROKZVOKZROKRXOK:VOKZZNKJZKJ
-M:FH*"HIJZNHJJJJKJRLKZ^LK*^OKZVN+B\L+:^LKJRIJB@H*BHKJZNHJ*JHK
-M*^OKZ^OKZROK*^NKJZJJJZNKZRNK*ZJ*BHH*:NKJJNOKZVOKZVOKZ^MKBXN+
-M:VOKJZHJZFJ*BFHJJRMKZ^LK*ZNKJRHJJJJKJRNK*RNKJBHK*ZNKJNIJZBJJ
-MJROKZ^OKZZOJ:FKJJFMKZPN+:VOKJZHJZNHJJJHJ*BJJJBIJZBHJJJLK:^OK
-MZRNKJZOK:VOKZ^MK"PL+:^OKJRJ*BHJ*"@IJ*JJJJRLKZRLK*ROKZ^OKZRNK
-MJZNJ:JKK*RLK*ZNJ*NKJZNKJZBJJJJLK:VOK:XN+:VOK*ZLJ*JJK*ZNK*BHJ
-MZBKJJJJKJZNK*ROK:VOK*RNKJJNJJZNKJZNJ*^MKZROK*ZNJJJMK*ZNKJBKJ
-MBHJ*BFIJZBJJ*^OKZROKZ^N+:XMK:VNKJZJJ*NIJ:NIJ:FKJZNJJJBMKZ^MK
-MBVN+RPN+BVMKZRNK*NIJ:HJ*:NKJZNKJZNJJ*FHJJRHKZVL+BPM+2[M+BRLJ
-MZFIJ:NIJ:FHJ*BHJ*BHJ*JJJJZNJJZLK*RN+:VMKZRLK*RLK*ZHJJBNK*JKJ
-MZFKJ*JHKZZLKZ^LK*RLKZROK"VMKB^NJZFKJ:NHJZFIJZFIJZBJKZ^OK:^LK
-MZRLKJZNKJJOK:XN+:^NK*BHJ*NKJZNHJ*JHK*ZNKJRMK"PN+BVOKJRJJJJNJ
-M*NIJZNJJ*ZKJJJLJJJNJZROKZZNK*RMKBPN+B^NKJJJKJNIJB@K*"HKJJZJJ
-MJJJJJJNKZRLK*^OK*^OKZ^LKZ^NKJZJKJJHJBFKJ*BHJJBOK:VMKZRNJJ^NJ
-MZJJJJ^MK:^OKZRLK*RNKJBHJJBKJ*NIJZNHJZBHJJJJKJJJK*RMKBXMK:PO+
-M2PMKZZLJZNHJZNKJZFH*BLJ**BJK*ZLK*RLK*RLK:XOKJVMK*^OKJZNKJJHJ
-M*NIJ:FIJZJJJ*^OK:XL+BXN+:^NKJJLJ*BHJ*BKJ*BHJ*NIJZFHJZFKJ*JNK
-M*VN+2\M+R\L+ZRNJ*BKJZFKJ*JJJ*JKKJBJJ*BJJ*JJJJRNKJRLKZRLK*VMK
-M:VOK*ZLJ*BHJ*BJJ*RLKJJHJ*JJJ*ZNJJJHJJJNKZVOK*^OK*RNKJZJJ*BHJ
-MJRMKJPHK*_HK2\KJ:PJK"ZLKBRNJ:VNJZTN+R\LKJBIJ:NHJZJJKJJLK*ZHJ
-MJZJJJJNK*ROK*ZNJJJLK*ZOJZNHJ*BKJ*JHJ*BJJJJJK:PO+RPN+BRLK*ZNK
-MJZHKBRLK*ZNJ*FIJ:HJ*BFIJ:NHJZBJJ*ZOKBPL+BXN+BVMKBRNKJZHJJJNJ
-M*JHKJZJJZBHJ*FIJBHIJJBOKZVMKZ^NKJZLK:VLK*^LK*RLK*RJ*ZBKJ:HJ*
-MBHIJZJHK:PO+"PL+BPL+:^OKZZLJZFKJ*JNJJBKJ:FJ*ZNIJ*JJKJZMKBXMK
-MZ^OK:^LKZRNJJZNJZNKJ:FHJJBJJ*^OK*ZNK:PLK*VLKJRLKJBKJ*JJKJZNK
-MZNKJ:BHJ*JJJJJNK:VN+:VMKBVOKBVNKJZLK*^LKZRNJZHJ*:NHJJNKJZJHJ
-M*BHJ*ROKZZNJJ^MKZ^OKZ^NJ*NOK*VMKZ^NK*NIJZBHJZNHJ*BHJ*BJKZ^MK
-MZ^LK*RNK*^OK*ZNKJBHJJJJJ*BHJ*FKJZNJJJJLKZVMKBVN+2\O+BXOKJZLJ
-M:HKJ*JJJ*BN+JBKJZNKJZBJKJBLKZRLKZVMK:VOK*RNJ*BKJ:FKJZNKJZBJK
-M*^OK:VOK*ZJJJROK:^MK:RLKJJNJZNKJZNKJ*BHJ*JJJJBJJJBLKZ^OKJJMK
-M:VN+BVN+:^OKZ^OKZRNJ:HH*R@H*BFIJ*BJJJROKZVMK:^NKJJNK*ROKZ^OK
-M:^MKBVN+:RNKZHK*2LH*BFKJJBOKZ^OKZVOK*RNKJZL+"VL+B^MK:RLKJBKJ
-MZFH*:HIJ:FIJZNHJ*JLKZ^OKZ^MK:VN+BVMK:^LKJZLJZFKJ:HJ*:NKJZNIJ
-MJBMK:XN+:^NKJZNKJRLK*RNKJZJK*^J*ZFKJ*BJK*^MKZ^OK*^OKZVMKZ^OK
-MZ^LKJRKJ*BHJZNKJZBHJ*BKJZNKJZNKJZJHKBTN[N[O+RPL+B^NK*FJ*:HJ*
-M:NHJZFH*"@H*:BJK"POKBPO+2TO+"XN+:VOKZRNK*HH*BHH*2LJ*ZNJJJRMK
-M:^N+BVMK"PN+ZRNKJBIJ:NKJ*BKJJBNK*NKJ:NHJ*BOK*RN+BRMKBVOKJZIJ
-MZNI*"JNJJNLK*^LK:^LKZZNK*JLKJBOK:VOKZVOK*^KJBFJ*ZBJJJBOK*^MK
-M:VLK*ZNJ*JNK*ZNJJRIJZ@IJJZHKJVMKBPOK:ZNJJRHJZNHJ*NMKJZHJBLH*
-M2LKJ:FIJJBMKN[N[NTM+R\N+:VMK*RNKJFIJBHJ*:NKJBLK*"HHJ*BOKB\N+
-M"XMK"PL+"VLKJBKJ:HIJ:FIJZNKJ*JJK*VOKZBIKZVMK*^LKJRNK*^MK*ROK
-M*ZLJJZNJZHJ*BHKJ*JNJJVOK:VOKZ^OK*ROK*RLKZ^LKZRNK*ZNJZNKJ:FIJ
-MZBHJJJHKZXN+:XL+B^NKJJN+ZZLKJZJJJBHJ:@K*RKI*RHIJ*BOK:PO+R[L[
-M.TO+"VOK:RNKJBIJBFKJZBKJZNIJ"@J*:BJJJJJJJVL+R\M+N[M+RPN+ZRLJ
-MZHJ*RLJ*BLIJJBHJJBHJ*JHK:^LKZVMK*^MKZRLK:VMKZRNJJZIJB@J**JNK
-MJJNKJZNJJRNKZRNKJ^LKJZIK:^NKJZLJ*BJJJRHJZNHJJJJKZVOKJZJJ:RNJ
-M*RLK*ZNK*RNJZVMKZRLK*ZNJZNKJ"@J*:FIJ*JHKJROK:XN+BVMKZZLKZXN+
-MJZOKZZNJJJNKJ^IJB@J*ZNIJBJHKZ^NK*XL+:^OKBXLJJBLJ*BKJZJMK:ROK
-M*ZOJ:FIJ:NJJ*^LKZVL+RXOKZRNK*FHJJZNJZNJJJBJ*BFIJ:NJJJNLKJRLK
-MZROK:^MKZ^OKZ^OK*ZLJ*NL+JBJJJ^OJ2@KJJRKJ*JOKZRNJJBOK:XMKB\L+
-M"PMKJBHJRLK*"HIJJRLJJBMK:ZNKJ^LKJJHKZ^LJ*NMKZROK:XLKJFH*.@JK
-M:FJK:JJK*XO+"[N+*FOKJVLKJ^NJ*BHJZVNJJRKJ*ROJ"JKJBFIJJNIJJNL+
-M"\OJ:@O+RVMK:^LJZ^N*:NHKJVKJJJJJNTNB.FHJJDHKJ^OKJRJ+BVLKZVN+
-MBXL+B^NKZBJK*FNJ*ZHJ*BIKZ^JJN@JJ:ZL**NJ+ZRO+:^M+R^N**JJK*VKK
-MJZLKJJLK*RH*BBNJZLH*JJIK.SL+"VO+2^NK:HI*NHJ*J\HJ*VHKZ^KJJNIK
-M*VHJ:@N+Z\M+.[MK"BK+:VL["XJ*JFNZ&FJZ2BHKZNNJZ^OK2^LJNTLJBJHK
-MZNL+JBKKJZJ*.YLJFJL*:XJ:NBH+*NHJ"PL+"ZOJ2\LK.RHJB[J*ZLOJ>FN[
-MR\JJ*VL;J[H*ZFJK"XMKJ[MKZZM*:NJ+NFJ**DMJ*FHKZPN[JBI+Z@J*XJKK
-MRBL;B^LJ:TM+2ZKJ:^MKB^IZZ@JKJBOK"BOKZRKK*DO*2KH*"EIJ:_N+:_OK
-MH[L*:QO+:LJJ2^J:FBN[R[JZ.WOJ>CKKBXNJ2BNJ*[N+*TJ*._N+:@H*2_NZ
-MFFKJ"LJJZVNJ:NI[^^J*.BN+>ZOJJALC\PORBII:"JJK:ZN;.\-/NJ;N4MJ"
-M\OJC+^/;DX];R^N;HPLB<GJ[0WL[:D)**[NJ$@(K*VKJ*NMK:^IJVYM[BTIK
-MFXORLJL+:WHK`[LJ:LK[:[N:"KH:HZLKZNKJ([NJNAI+RFN;RJKK2OI;X^HK
-MNLL+ZZJ+ZZYKNZOJZONJ*@OC^XKJHBKKBIH26U,3ZZ(*(BLK:UM3JX*B(NMZ
-MBK*Z,X,CPAJZ2R-+8_H::DLO+\MJHKK[2XKB&FN#:V)RXKNK6\M*RLO[:J+B
-MRPMKNLI+VTO*FSLOJHH#BRMJZL(*DAH+.TKJ[PONFHL*,@*+\[\CRGJ3"OLJ
-M*YMR&M*#,Z)RDGO3R^LC"[,ZLHIB>\H*N^JKVR/"J[M*&WJO2UIZ"QL"TDHC
-M"YI2HR?K[DXSC_N:@LNJ<QIJ*B(KNK\JVNK;NWNSPAMNKOK+0YK"&[M[BDJ*
-MFVL;>ZLK"HO;XIHS,GNRLJ.*8WMZZU,/:XJNFF/2(HZ:KY-J+B^ORF*KJZO+
-MJ_/#2UK:0T)RHJ*BBI/[^P,::@-J:NH[NMMK"V)*R^H+`L*#8VNR*@^Z.]NZ
-M@SO"VCJZNAJ[*UL#>E)J>\(S6XKOJNORSJ*;C[OZHJKC[UI"^OLS2J(J>HL:
-MBN]ZVBM+>VMC>Q*K:W/#+O+*ZF]#NA)+3RKJTAH[^I-K6DJ*BN)+:C)ZFZ^;
-MBEHJBYL+ZNKKR_L*NV-ZBA(;"F(*:CNO&DK3ZGJJRAM#FML3.F+.PB^"LNL_
-M&YJ;2ONKZROJ`ZM:CK[:F^.CFUN+4U-J*Z)R2TLZ&EK;^\*R#QNBXWNJ<NJO
-M`OXBFT.O:PIJRQL;ZYLK^NN:8@M"0J_[^@*J(ZHSVMH[NB*"2^*K;\.O[TLK
-MXF)ZZGLBZJ-"8CHC`[KJ:UH*0[/;6LLJ"HM:PNL/VXH*#B*J*@/[XFLKZC,Z
-M^B+#;[LZ+DK[#DK;BB_SFZXJ`XIJ:@O[&AM/ZIH+"EKBHF+JHLI[\V_+"SZJ
-MNKJCJX/*:UJN&R_;:Q.#,BM;4JZ.6N^O8SOBKHHO\R/KZSK.SJN;FB[J1P^B
-MBBX^^Z^+(\-:RF,;,\NR(J+#BS*R,IK[2PH[(O(*6X.3@[JB*F/O:P(Z>V.;
-M:RH#@FI[JZ/:TJZJN[MSNUH23O(+ZGHJT^^#$RL[2H)ZRCLK6WL[:TLBRBH*
-M*XL:"QN+>WH"J^/[VH)KPUMN^R,Z"H)Z>WMKLMHBTR."2@NJ>_/+^ZIB:G.3
-MZT*ZJ^O"FDNC^TIK+UMKHF)KJDNJPZ^;;EY.+JHK:V/3C[.S*^(R,CKN6NK;
-M+_,*FK\O6RI.8LO;*C-+ZX\[.I*RDLX.PNN+*IO;,\,3$\N#(Z-#^I+2(CH:
-MNGH**FNK.MHJN^N+<\\O2I(R`KIJR^OK"RJ[*TH+^_./#WO._NX".ONKNW./
-M+ZJBRAI":DHZ2BN[RVL*XHK[&\NZ*@OKZ^LZ8IIK6Y/#>_MK*\N*6B*:JNL*
-M*TMZ.@N[(Z^3>RI:4G(">LK+X_MK"\OKZRL*^J)JFUM+"H+RRGM#`\M[6^.C
-M*EK"R@J:JDOKFOH[VZKB@N*:2HHKNSNC$^]3(PJBFKJZ.LJ*JNN+JVJKZ\IZ
-M.KI*RJH[&R.CVSM[^VI:XAK*ZHO[6YO[NPH"TC):JAM[:VO+VX-C6XO*RKHZ
-MZNO+FYN[2B+B@J*Z*JIJ"HIJZ[M+2PLKBII*:QNC.PO+NQO;2VKZ>GK*"NHK
-M"R,STP.+VO)".DM[RRIZXN(BHLHKNUM#,ULJLH[N&CL#LUNJ.LJ*>J*:NFH[
-MP]LJ^MH:JP,3`QM;XV,SLQO+ZIK"0MJ[+P^/TV/[2\OKNN)R;O[>7IYN`B)B
-M8C(N[A(".LLC0W/3\R-[*[JJ,[_?'\^O+X]O#W\_4ROR_B;^:RGA`9EOZ.#`
-MX,A&+D+>QJ8",W^_2IZF?BY*(U._AY>IUZ=:YL9^(\?7E^?;[GX.6MLOKQOZ
-MLEK[D[MN!H8GX3$!Z4;@L("(DK_S)F@H_C_7ES-F**CFBG,OCW_G]_>?`@:6
-MIJ_7::FGZLZ^$@H;,_.CR\O[NTM+:Z*^!K9*>?%QH3L8L+#8AG._@M9H!H/W
-MJ5^FB`@6KF^G)X>W-\?_6L;6QNOW"6E'^SXFCHM3TWOZVJN[>ULCXWO*;F9V
-MAO=!T4%7*`#P8"BJGUNVB!8:9]?'8E:(UE(/)W_/_X=W!SMF5G82AVF)1XM>
-MYJZ#/P^+KFZBP\_ONZ(B:ON+TF:^:3'1@=\X,'`@QC\'NZBXJ"('*<=2*,A6
-M`E^')]__IT<'&^;6-AHW">FG0L;&[J\G?]NNOG+;#P]#ZWI:(I*^9N[)<5$!
-M/YAPD*`FI\>KZ/A6ZG=IMVYH..@NIT<'YZ?GQR=+)M86KL>):8=ZAL9.FW\?
-ML[+^CNMO3Z\[>B+ZVBY>!C.!+5'9Y@!0\+@J-X=^N+CF'VGILU8XN#:CQ[<'
-M9P>7U]_N%NCVFZE)J6^^QJ8*SW^3(IY>\M.GG]M"[C*J.Z*FAO\!K1'YED!0
-ML(CS=Z?F.,C^YVFI&Z@XR$8[)X>'1W>I%V\F*"B>)XF)Q_J&1DYC7Q]C4J:F
-MDC-?IQ."#N[:*BM*;OY?@:V12:C`$,"H;W=_!CA(IE_IJ;NHN`@&&^<'AX='
-M%W>/7B@HGB=IB4<*AL;NDZ>?^VY>/GJO_R\J$FZRJR/;FMXF!T&M\2D(L!"`
-M1N?7/T8X"$[G*7>BZ#@(AN/G!\<'MY?W[QY65CXGZ6G'JB9FKEL/;_NRCBX:
-M6]-#J@*2(KO#N]+F?JDQK4'G^#"0(/['%]/6^&@NYZD';NA(*`YO)^=GA[<7
-MM\,FJ!:NAVGI)P*&AG*OIW_C,OZ^(F/O$SN**\LKNO(^!B;WL5&QEPA`<"!F
-MW\>C%CB(#B>I-PK6""A>>\\?AS>75_>O7M:6;J>IUU]*?G[:,P]3ZW*.KCI[
-M8YN*FGHJ.PLZ+MYFJMG1T2$2('"PN`I'AV+HN':+1Q?_IFB(ENX#O^>WEU?7
-MYV(V5F8C]RDW4])^+NO3K^,*$@[N&IN#FXLK:TO*<DZFGN<!T3&)UH#P8!:3
-MQT^F"&B>T\>'"O;HUEYJ0R_?1U<IEZ_F*%9NYRDI9^N^'C+;K[.+HK+B.FL;
-MN\JB6FH["R(>1F(9T5'ALN"0\#@J=S=**,A&.X='PP9H*&:Z<W.O'[<I:?>*
-MEFB6BY=IEX\2WHZK<]-;NC("2@N;"QI:^DHJBB).YK+Y$:V!6Z!P<!@N!T<K
-MEHC&:Q_G>P;H5E[*,R.#G_?I:3<:UFB6NU>)%X_"?HY*B^JZNHIKNVH:VEKB
-M*C.OFZ).AB;7\:TQ%[@PD&!&#P<S9N@VZD\?.^8H5E[*0YLKTP<IB2E/YNCH
-MWE_IZ0<C\JZB.AK"`DJ[VRO:,G+:ZV.SF_JNGF8J(:VM(0Y@D#"X<I__TG86
-M\F^/P[Z6UN;:BPHR"J>I"6EG<A8HQOLWJ;?/^RJKRM+^/H)C;],K`JXR"ILS
-M\SOB#J;F[X&MD;D6`'#`*$J_,TY&9CLO6QHFMF8R"TI2[CO'Z0FIKX;HJ#Z_
-ME_<?D_-SHWH^9KZ;?Y]SFFZ.8FOC0P,[\N;&?[$M<6G(L)"`EOIS6J;F<A\_
-MNJ86=IY+P^+^OC-7R0F7HV;6MBZOIY\/_^>?2S[&9F(/IT^+[K[RRP.S&THR
-M+OYFYW'M\1?X,'#@AH**$MY.:^>3GL:6AG+CNWYFSG]I26GGNB8&WA(;3__?
-MA\</DH9&GCO_S^M"(KOS2Y(^S@H3,Y(&WW%MD=>8\)#@9M+N7J:B3_=3!E96
-MINM3*F;&<L=)2=</&@[>IMX28]]'=X?;_H8F<B,OH\KZ:_-ONZYN.J/[VMZV
-MWY&-<>>@,+#8)H;6-@[/1[=Z**@F*A.K'A8&VU?)*6=O0\ON!C:>4[=7=]\J
-M#K[N0DJ*>HKC[U,+8A*RZOOKPGX&HH&-K0G(P``@*-;(5L('EZ="Z"CN&UN.
-MQD9^SQ?IU^?G!]_BEBB&8P<'/Y/#\YL"?MX2RP/C.POJ*@O+"ZO[>]J.!F*!
-M;5%7N&#@6(C(&.@C*=?#)BA&^]."1G9^:Z='!P>WJ7=#)A9&,D,O<^]G!_^:
-MIN:.ZQOJNDMO;VO2SF)SSSN.WJ;#P6TQ#SB8R/@X6*#VAVDG_L9F8J\:1E:F
-M0Z]#+U_W*2D'FB;FSH+"&EM?=T>34OYNPAHB$N*CSR\[JBMK.TOZ;B8&CODM
-MK8GV"!8(H&"`B/_I)QZF^J\O4I;6#J\;SEIG*>EW9X\K0IYFWG++KR?'IW-*
-M;CZN2LH:Z[-3\_L*"GN#ND[^;IYF]]$M>1[V;E;@P`!(+W?SAM*'1S-F5K;R
-M`X(F8D=I%R>G)X\*?F8F4BM+TX<WYR-"D@+"[@X:TS_O"_H[LPLN)IXB@B9.
-MH>WQ'\:2NOA`0*#F4VLF+I<I+V;V_AJ2!C8:MZD'?T>IQXO^7KX.SFYK9Q>'
-MTYO#6X(>)LYKKX,ZJE,3ZJ+R#G(2!G:WT:TI+G^IQD`P8.A>AO9.EXE_;I*#
-M2N;V!F*_'U._*0G'ZEJ#2WZV9J+O?X]/YR?SHH+"CCXRBQM+JNO;^X+^3B*:
-M_F8'<='I:D=I-D!`H.@HB%;:*2ESPE.GXG:VCB+Z2V]'*1<_\]\?X@8F>GLJ
-M*E.GI^\[^QN:/GX:(\H.TN,/VZY."B_J!O9C87&Y8U=Y+^``F`CXH$A.AT?[
-M,Y>IH\9>2L*F_@M_!\<G)T>'6PZNR@+.DJ,/+_.3;^\K;N[JRS*.&CMJHJ+J
-M6XNN'NX"S^'!*8?)2>;@F+CXH-@HOF\#"P?IMR(R4V/^AO(CDS/S3V<'#QO#
-M<RKN$BH+RGJ;+Z^[>BL#&T(RN\OB,AKZ@L(:VEIB<JK)01DG*;DGN-A(^-@@
-M^)8"F]I?Z:E/2U\/TE[^(J+ZZEOGA_]3/U^S.CI+6\I"`KM#"O*K;R]K:DN;
-M&KZ^$@+2(JO:HIK:_UGA-T>Y">Y(*(CX6*#(-JZ>LO<IQV^'-W,R#JZR+FZ2
-MPS]3CR?G#U./LUNKXH):XFY2*KMKRS/OHRHK*SJR,H(2DM*.CE*#^>'7E_DY
-M0Z@V*+B@X'CHMM:>1U?'9ZGIIW.KNMK^ICYJRZ*C'^?_OZ=_#UM*(I(N3NY"
-M,J*+0Q-S+U,#:F*"4M)NCM*RT@Z'(3EG"9DI3F9&"+B@(#@H*.B*Q^?G%PE7
-MAW_S`Z+>INXR?JZ##^^/9T>'_Q.3BR[>3J[>ID*#<Z.O_X][ZRL"4I)R;E*2
-MOJY;B9FWJ?G)G_YR]F@X()A("+C6`],OY^D)UW?'9Y\*;D[NIL8^HJO+CP?'
-MQ^??G[,:#N[.YN9^+F(ZRZ]_[Z./3WHNJBH.'F[^#I?YAS>9.8<K<]ZH:-@8
-MN$B82(ZRLF_7Z5?IJ9=WGR/*VO[&II[^[HHOSZ=G9V>_4Z-K\GX^SDY.KGKJ
-MJ[LSDTL[,QN*NKK"/OXC::FO5[GI$XM#3H:(.`B(N!@H'N:>HW=W]ZDIZ1?G
-M?R\[/J9.?J:F(DM+,P\G)_^/#P^K\D("CM[.KN[2`NIKZU,/D[-#F_I23NNI
-M]\-W":EC6^^.9N@(B(A(F"AF1B9K1P='*>EI5_=G?R^N/D[>!H:NTC*[+Y]_
-MIZ=?GX/+Z\I2'LX.3KY.DDJ+ZB.?3[.3\XM:$KHW]\.GJ:E[8@,RYJ@H*"CH
-M2"@FIB9B)V?G]ZGIUS<GGT^:GIX.WH;^HJN[LS^G)W^_GP^;"LHBCH[N#K[N
-M6IKZ.[,C6P-;Z_J"KF[JYV<OY]>7[[L#NKZVEM:HZ(BH!J:>$L^'9\<7*7=G
-MIS\#8N[./KY^CMI[0U.?Y^=?_S]3.QKRK@Y./DYN+A)::NL;`R.CH_L*N@J"
-MKBKG9Y/_M[>3:AN*CL8V-G86*/8>3H[";R<?IP?WAW\/\]N"#@YRHO+Z6R\/
-M[[]_/X]3DZ,KHO+R[HX.;I*RXIK+V^N+>SOKNKK*2J)"^JH3WS^/_V=?RPIK
-M2KYFYF:&QL:FOA+"2G-/OV__)Y_OPS/CZKIJZRL+FQMSKY.3$_.[B@H*VD)R
-M`GHZ(@)ZJBKZ&BN[*_IBZJM*8AKK2MH::P/O/X_/___O"ROJX@X>/I[>WGYN
-M4F)ZZ\,S0[,3K\/;VULC.QMCXQL[&TL[HSN+"QO+:HN+*[J::FI*>GI*NII"
-MVJKZPGJ+JF*:JLL+JXO+(YN+.]OCFWMCL[.C>\OJ2AHBLA)2KJ[20D+"VGIJ
-MJ\M;`\-#0T/#LS/;&\N[R]L;"ZIJNXMJ"KKZFEJ::FJ*J[KKFXI*BRJZ"@HK
-M"@HZ:JLKJZH[NROKRQN[BSLK*JNK:\LJJXJZZZH*JBHJ*NHJ:NN+2GIJBOJB
-MHFO+JRI+`WLK"QM+BTMJR\LZ6JL;^XN+VWOJ"JJKR^KZ2NMJJBHKJOH:>KOK
-M&KIJNDIKR^M[&WO[F_N+L_O*BOMK>IH**LIB@JN*RTJJFXNJ*_N[:@JJNF*:
-M*JIKJJJ["PN+JWL[NDH+"PL+"YL[:^NKJ\MJ*@KJ&SJ:BNK*^NMJ"KN+&BHC
-MJB+*(UO*:B/+JFH+BWHJ:VMJ*^LZ:PLKNDMCFL+:2JHJ:DO;VRMJRRO+Z_KJ
-MJ_HJB[JJ&SK*>\O*ZW.*:CN[JOIJ(FI+RN-+Z\JJ&TJZ&IN*HNK*BRH[ZHNO
-M`]N+&ZK*HO(*:AO*PJNKJJ)[@XO+NHM+R_K":OJ[NCJ[ZULJRZO[NSH+"[N*
-M"DN*>[N+:DHK0EJ*:HMC:YJJRNN[NQM;>X*B:BJK.IN#([L+2^)ZN^KJ:VIZ
-MJNOZBTO+JRMZXKH"JP-[J_N3R_JJ.YMZ"NH*BG)BBDN+:QN3XQMSBZ*N<EJ:
-M`GK*2Z,C:^O#&SKJ:Y/OP\O:FIHB4HJJ>\.KJWL;2@*:XBJJ#H+#[^^#JZH;
-M0J[ZDSLRRLIK"JJ[N_N;X]LK@ZONKCMJ$DJC8ZOC.]H:BRH".G,S(CJ;"PKJ
-M2KHZRZ,+(LHS*KOC"VJ*"SJ*.DH#^[L*V[H"ZMJZVF.;VFO;XWJ+RTKKFV.[
-MBB(2&D(N@P^OBSL"CHKS>]IOTVMB[M+ZVPJ;K_,S0PIB#@ZN>HO+Z^/;6WMJ
-M>RN[VOH+*BL+JKNC>OM[2BO;>J)+PII*2YJKVRH[&\NJJ[LJ:SIZ@\NJ.^IZ
-MNVI:V@K+._JJBTKJ(RM:JR.CBB([ZRI+"^HC2PLZ*DL:^FOK2@N*PLKKRPJ*
-MJNKZN^,B:\,+"K/;2KL+.LHJZBJ*NNK[&VJKRX):^ZK+2KJ:NPN*NGK+"[LJ
-M>POJFS/["@,JBFJ"VAL;NBH+2FO*>@H:*L,[>CM*"FN:VZ^C*JJ*+F)*ZBJJ
-M:AO#VCL+P^.RJNM;.\):JDMB*IM2:^.O*IHCRMMJNGJJ(ZL*XMLKKO.;,H*K
-M8SJ[JZH;>QOZF\N:NVLK:\H*B@LKNGH[XSIZRXJRJUL:*J-+:B,[VHN*J@LJ
-M:KHZ:BHBJ]-#:Z*;8PI*2M+Z2VJ[ZBOJ2[OK^[KK"VKZ:HNK"_JJZRJCF^.#
-M([HBZMJJBZXNBMMJZH,CJ\NCZMKJ^BO+NKHJ2LM[ZHL+R^J+:AN;"YOKBTO*
-M2O(RFN*RVJ.[*T.OB@JOPVO[Z[H*HS,B+KKK2EHJ,IK;F^)B\_OC2^KCBRIZ
-MBDK*.BJ;B[.[*H-+.J*ZJ^H*@L+ZBFO[JHLK._,;JZ-CHOJKZM+ZTS,K*@MZ
-MBYLJ,GI*ROO:&CMKRJK[2LL:FNL:*^H[FV,C"[,C*WMJBVH"8NMK:KO:6ONC
-M:C*[H\M+.@KZJ\JK.LI;2ZNK&AH;6VKJ2UMC&XIK.[JZ@FKKNNKJ*@J**JN[
-M:\MKBZJZ^[NJJOHJ:YN[`NH+"IK+FRH;JPJ:2JHJ$R/BZH/3"O(B@AKJ:^H[
-M:SO[BXJZHZ.C:ZJ*2JJR6HNKB^JJZVH+*SIK&Y,[RFHJZZHJXCJ;N\IZ^GH+
-M.RLJ:@M+RDHZ&HMK>SL+FUN;ZJN*"BI*:@I*^R,KJGOK>NN*>KHK:MJJ^XJ:
-M2SL*JB-[ZXL[Z^KK"@N[:XN:RHI*"NJ;JZIJ*KMZNJJK&KIK>FH[^TM+^RO[
-M6RLJ^NL[BVMJ.^O*R[I*2J*:"BM["RIJZ@KJRTIZ>_.+NCO+*XH+2WKJ*RM*
-M:RH*NXLK>BI[BIJZZ]O[*PIK.[N+JKLJZJM+RYKZBJOK*\IZ:^NJZ^OKV@J+
-M>DH*:DN[:\N;VZH+VVNJZNI+.ZM*JVJB`CKJBJOKNZH[.WLC^FJ[&ROZ*VM*
-MFFI**]L+NPMJ2LI+Z\KJ:IJ*.^J*JRHJ"TN**PLK*BO+2SNJ&_MKJCHJZRMJ
-M*KK:R@(Z:VKJ*ULJ2Z,[6_I*NHKKNDHZFYO[B^HJ*MNK>JKJZSM+2DH+*\N+
-MJVKJ"RL;"XJJN^N:VMJ*2@IK^\OJ"^M+NN+K2RN*RYO+>VHZX@)JJNM**TOK
-M&YNCVSOJ*J/+J_N[JNHJRAK*&HHJZGJ:BKKJ*ZIK.SN+F\.[JRHJBGJ*RHIJ
-MJGL+*VKK^[N+:ZL;.AJK*@I:.LK+^VO*"X.+BWL+:O+RDG*:"ALOO[^_+QL*
-M`JY^IAX.@@K+L^_O[^]#2VMJ"NHJFZ,SLV-;2[N:`M+2TJYN3KZ^[AHC$S/S
-MO]\_<QO*(J+Z"HNST[]O\QL+2E(.3L[N;N[N,J):NNJ[TP^??X_O[V];ZQIB
-M&N*"TCHJ*BNZZRO+*OI:\O(BFN+"FBI[6WM;D]-3TP-CL[/;BVHZNCIB\JXR
-M@GJ:@LJ+VV-CVTMC([L+:CJZROK:.DIZ^OI*"BJKZWN;HYL;>\M[FYM+*RHJ
-MZLIJJTJ:.@HJ"LI*BJKJJ^J*:JN;^ZNK*TLKZBLK*\N;BRN+ZRIKRZK+NZK*
-MBJOJ:HK*RLJZ^KKJZ@HJJVO;(_MJ*\OKNSM[BPM+ZNJJJOH:>IHZ.DK*2JLK
-M2SM+>_M[N[L+ZZOJ"@J*:FJK:RMKBRN*JFLKJDKZ:BHK*KI*RJJ+NQL[R\L+
-M*^IJ"FHJJJJJJ^LK:VLKZVLKJZJK*JJK:HKJBDJZNKIJJBLKB\N[.XOK:^NJ
-MJPN+RSL[2PO+ZZHJ2CI*RDJZ"KIZRHJJ:^OKBTL+BRNKZXMK*NHK"_L;^VNK
-M:^NJ*@JZ.DJZ2NH*"FHKB\M+*ZHK:VL+R^OK.SLKBLI*"HJ*"JHKJRNJ:JMK
-M*ZHKZZJKJXK*"_O+NXNJJVLJZNNKJVN[RZLJJ@L+JCIZ2KJZRFJK:\M+NXOK
-M:^NJ*JJKJRJ*BBL+:^MKZZIJ:@J*JZNJ*VOKJ^LKZJO+BZKJJBO+"^NJZNNK
-MZ@H**JN*:NKJZJNKJNM+^SN+*FJJ*LI*J\O+N[M+:^OJ2LH*ZBKJ:NJJ*BKJ
-MZNO+BVNK*JL+RPL+:^OKJFJJJXIJJNJJJXI*:FJ**JOJ:JNK*PMKZPM+R[N[
-M"PMKJHH*RNJK:FHK"^NJ*NJJ:@HJ*^MKZZMKRRIJJZOJJBNK:XMKBPOK:BKJ
-M"FHJZNKJZBKKZZNK*RH*:BNKJRLK*PL[BRN+BXOKJJJKJJKJ"KJ**FKJZBJK
-MJRNK*NJ**NN+BXO+2XOKJRHJ:POK:XN+2POJ"BJ*"BIJ"FJJZLH*ZJJKJ^N+
-MRTN+ZXL+*RHKJJJ+*\KJJ^HJ*RJK*XIJZZKJJZJKBRN*JVOJ*BMKZRNKJZOJ
-M*JLK:^LJJNLK*BJ*"BIKZVO+:VN+*RHK*RJJJFJ**BHJZHIJZ\OK*PN[RXLK
-M*^NKZDJ*BHJJ*BKK:VL+*RHKJXKJJNKJJ^J*JZOJJJLKBXLK*VNKZRL*"FOK
-MJPM+J^O+ZRHJ:NJKZHJJ*ZLJZHHJJ@I*:BKJZBN+:XO+2\N+*RLK2[L+"PMK
-M*HKJ:HJZNBKJBJLJBFJJ:BKKZVMK:XN+*ZJKJBJJ:TMKZRNK*JHJZNLKBJKK
-M:FJJ*NKK:XN+JRHKJ^KJ:NHKBROKZRL+"^LK"\NKJNJZRFK*BJLKZ^NKJZLJ
-MJ^NJJ^LKZ^NJ*FIJJJJ**NOK"VNKJ^NJ*VNK*VNJZJHJZBJJ*BMK*ROKJJLK
-MZ@HJJ^HJJZNJ*^OKZVMKZVNKBBHKJHJJB^MKBVMKR^NJZRNKZZIJ*BMJJHN*
-M*HNKJJMJ"JJKRNHJ:BOKJFO+"VOKJZHKJJOJZJJKJRMK:ZJJ*JIJ*JLJZBMK
-MJJNKZBJKJJIKZVL+ZROKJRLKJFKJ*NKJZNJK*ZNJ*VN+"ZJJB\OKJBOKZVNJ
-MJJLK:RLJ*JOK*RIJ"NJKZDK**BKJZHHJ*XMK:VN+BXMKZVO+"XN+"\N+Z@HJ
-MZHJ*ZNJ*BNH*:FH*ZBLKJRN+BPL+RSL["\O+:ROJJRLKJNIJ*NJZ.@JZ2NKJ
-M:JOKBPN+"\O+"\O+"^N+JPKJ:LH*:@H**ZMJJRNJ*VOKBRNK*RNJJVNKJXN+
-M*ZLKJJJJ*JNJ*JOJ*JIJ*HOK*JLK*VOJBBNKZXOKJFMKJJNJ:JNK*BHJBJJK
-M"FJKJFL+*RO+"XOKJZNK*BJK*BKKZZHJ*RLK*ZJJ*BKK:VOK:JKK*FHJ:FJK
-M*HKJJBJJ*HIJZ^MK"VNKZPOKZ^LK:PN+ZXN+JRNK:HJ**FKJ*^KJJ^OKJRLK
-M*^LJ*BKJ:NJ*"FJK"VMJZ\LK*JNJZNKJZBJJ*^OK:^L+:ZOKB^OKZZHJZZOJ
-MJNHJB^NJJRNK*JKJJZHKBZNKJRHKJZJKZVNKZJJJ*HJ*RNHJ:FIJ*JLJJXN+
-MJZK*"NNJ*JO+NTM[^PN[^\MK:ZNKJHH*RCK*R@H*:JHKJRLKJZKJRLJJJJKK
-MR\M+N\L+"PN+:VNJJ^OJZBNK*NH*2LJ*B@J*BHJKB^LJ*VMK:TO+ZVOK:VLK
-MZXMK*ZKJZNJ*:JNK*BHK:^LKJ^IJJRKJJVLKJBHJJFJJZ^LKZXL+ZRLKJZOK
-M*ZNJ*BIJR@HK:ZL+NVNKBZJ**JKJJNN+"\MK:JMKJJHK*BJKZHKKZZLKJRJK
-MZZKJ*HKJ*JLKJHKJZZNJ:^N+R^LJZJLJJBKJ*BKJZBHJ:JLK*NOKZ^N+ZRMK
-MZVMK:VMKZRLJZHKJ:FJJJJMK:RMKJNJK*FHJJBHJZPN+:RLJ*JLKJFJJ*BIJ
-MBHJJJZMKZ^MKRVOKZZJJ*RLJ*XNJJNLK*ZH*:JOJR@H*:BJJJNMK:[L["XL+
-M"VNKZNJJZLKJ*ROK*ZMK:ZJ*"NH*RHKJZNHJ*XOK:XMK*^OK*PN+*VN+*RLK
-MZVOKJ^I*ZNLJBJKK*BJKZJKK:NHJ*JJJBNJK*JOK*TL["XL+ZVHJJ^JJBVOK
-MZZIJZ@K*"HHJJBJKJVL+2SN[^SO+"^NKJBIJ"NIJJJLJJBNJJ^H*:NJ*BNJ*
-M*NMKZ^OK:XMKJRLK*RNKZBHKJ^J*JNNKZVN+"XLKJZIJJRLJ*BN+Z^HK*ZJ+
-M:VJK:ZLJZBJK*RIJ*FIJJZNK:XMKJBIKJZHKJRJJJZHJ:JIK*ZKKBVL+"ZJK
-MJNJ*BHIJJBNJZJHKJZOJ*JL+BRNKZTL+Z^OK:VLKJBJJ:BHKZ@H*BHKJ*BJK
-MZ^NKJ^OKZBHK:VL+"XN[NVLK*^NJJJLJZJLJZJOJ:NIJRLJ**FJ*:JOK"VLK
-MZ^LK*ZOJ*VLK:XOKJVMKJZNK:^LK*ZJJZ@IJJBLK*^OK*ZHJ:FJJ*FKJZBJK
-MJVJJBXM+2PMKZVNK:HKJJFJJ*^MKZZNJ*RNK*NJJ*ZJJJNHJ*ZLJJZNK*RMJ
-MZBMKJBJK:RLJJZOKZRNK*ZMKZ^NKZ^LKJNHJ*FIJ:HKJ*RKJJ^OKZZJK*ZNK
-M:XLK*XL+ZROK:ZNKJZJK*RKJJJLJJBNKJZJJ*ZHJJRNJZNJJJNHKJZKK:\OK
-MJ^NJJZJJ*BJJZFKJZBNK:JIKZRLKZVMK:VNK*BIJ:BJJJ^NKJZMK"XNK*NNK
-M:HJ*:BJK*BN+ZVLKJZHJJBMK*ZKKZZJK*ROK"RNJ*RIJJBIJ:BHJJZNK*BJJ
-MJ^MK*ZMKBZHKBZOK*^JJ*ZLJJZJKZZKJ*ZJ*:HH*ZJNK:PN+2[O+BTOKJJOJ
-MJBNJ*JJJ*JJJJNJJ*VKJZVHZ:NH*ZBJ**PMKR\O+2SN[BPL+:ZJK*ZKJ"@IJ
-MJJNJJBJJJBKJJZJKJRMKJRJJJZJJ*FJKZZKJ*HMKJZHKJJLJ:JHK*JLKJZOK
-M:^OKJZNK:VLJJROJJBHJJRLKJJOK:RNK:RNJ*RIJJBNK*JNKJZNJJ^OK*RJJ
-MJZOK:^JK*RKJJRKJJBJJ:HKJ*JIKZRLKBVL+*ROKJBOKJNL+ZRLKJRNJRJHJ
-M^HJ+ZFHJZFKK*ZKK*^OKZRNK:XN+:VL+BRNK:@HJ*NHJJNJKJ^HJJRMK*FHJ
-MJRJKZRMKJZHKZRN+:VMKZZJKZNIJ*JOKJZJKJFKJ*NN+J^MKZRLJ*BIJ*NIJ
-MZJLK:VN+"VMKBXLKZJKKJHHJZJLK*JL+ZZLKJ^KJBLIJBFJK*RJKZXN+ZRN+
-M:RIJJJNJ*ZLK*ZJKJNHJJ^N+BVLK:FIKZBIK:RLK*^HJ*ZIJB@K*RLH*JNHK
-MBVL+"VL+BVN+BXN+:^OKZZN+"ROJ*JKJ:@IJZNJ*:NJ*"FJ*JJNJZBOK:PL+
-MR\N+BXLJ:JJJ:JL+BROK:XMKZZNKJZLJ*NJJ*JHJ:BHKJBHJJBOKZZMK:RNK
-M*FHJJZJJJJNK*ZLJJRNJJZJJ*BHKJZOKZVN+BVMKBZNJ*ZKJZHH*:NIJ:JKK
-MZZLJ*ZHKZRLKJZOK:ZNJJ^N+BVOKZRNJJBKJBHIJZNIJJXOK*VMKJBHJJBJK
-MJRMK:PL+RPL+"^LJZFH*BFIJ:BJJ:FHJJNKJ*JJK:ZNK:ZNJBXNK"RNJ:^LK
-M:VLK:RLJJJKJJZLJ*NIJJJIJJNOK:XLKBPOKJJLJZJHJ:JJKJZHJZJNKJZLK
-M*VMKJZMK:ROKZXL+:^OKJJNK:FHJ:HHJ*NKJBBJKJZLKZZHKJZN+ZROKZPN+
-MZVOK*ZNJJRHKJRKJZBJKJRHJJZNKJBHJ*NMKZVN+ZVMKJBJKJZLK*RNKJBHJ
-M*JHJBFJ*"LI*"HKJ*JOKB[M+:TL+BVLK*BOKJRLKZXN+Z^OKJZHJ:FIJ:FKJ
-MJJOKJZLK*ZOJZBJJ*ZNKJRHK*RJKZZLJ*ZIJJZHJJBOKBXLKZVOK*RLK*ZLK
-M*ZHKZXL+*RMKJBJK*NJKJXIJZFIJ:FHJJZKJ*NHJ*ZOK:^OKJHJKRXOK:XN+
-M:^MK:^LKZ^H*BLJ*RDIJZJHK:^NKZRNJ*VL+N[N[^[OK*ZIJ"KK*2LJ+ZXKJ
-MJVMK*FIJJ@NSRM[*4XL2ULYI9]I#:Q.?<\86*IG):#CVYTFSB(@+UP>+ZW+>
-M#D[/YZ?G4L[:VN[>_HZ?M_?G#B8#I\M+2NZZ8OHR!I8NK[,/GR^CB_)J3Z,*
-MJG,3V\/KJHM:KFZFOHL;XHOKVT\C&H,*8L^O"V)J0R,K>AK:2I+2R^\3JRZ^
-MRJ//CR/:[JJ*NSH:2QL#.CIKVJ+ZZNJ:VSOK"QNS8P/*BC-+VB[NLJ*K*BJ+
-MZBJC&YOKR^,C:K+K0[LK4AH+N_/Z2FOKBOJ*HLJ*J_/CFRKZ8OJ;FR):N]N;
-M*CIZZZ_38FZKNXIK8BIC>\I:BPH;(ZL[JNJ*2N(B8WN[NPHZJJ-+"AHB"[.;
-MJEH*^DK[FPHJBNNCXR/Z&NLJ:NK:&LM+6@J[BQO[F@(Z>ULJHIIJ^]N+"_K+
-M8^N:FBMZJTOJR^I[(\M+*OK*6X.K"OJZ"HL+.KJ*BHJ;(RJZNDKKNXNJRSO+
-M*AIJ2VLZ.BL+6QL*6OJ;P^M:PIJJB\N*"NNJHQN*NDN#R^M*FBN[ZHHJJVMJ
-M:CKB^LI[JNLC:LO[6\M**JMJBHO[*HL+R^OJ2JJ*RFMJ2NJ+RRJJ"OH+2SNJ
-M.FIJRFKKJXL[(TL*NHJ[*TI*^FM;&XLJ>NOKJ@NJ:OIK:ZHKZBH+:VLJBBHJ
-MRAHZ*_O;"[LKJTLKJDJ:2NKKJBL+Z\N*JJNK2ZK*JVN*BJO*NFL+BZJ+2TNK
-M*BIK2TMK*NOKZXKJ*KH*ZHJK:ZJ*JVN+ZRJB[M+B^BH+^]NCX^/C(Z/;FWN[
-M2PMK*ZLJZFJ*"@K*RLK*R@H*"@J*BFKJZBJJJJNKJRLK*^OKZ^OKZ^OKZRLK
-M*RLK*RLK*RLKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNK________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M________________````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-$````````
-`
-end
diff --git a/share/isdn/6.g711a.uu b/share/isdn/6.g711a.uu
deleted file mode 100644
index 67d99454d17f..000000000000
--- a/share/isdn/6.g711a.uu
+++ /dev/null
@@ -1,277 +0,0 @@
-begin 644 6.g711a
-MJZLK*ZLKJZNKZFIJZNIJZNHJJJJK*^MKBVMK*RLK*RNJJJNK*RNJJJHJZNHJ
-M*BJJJJJJJZNKJROK*ZJKJJNJJZMJ:PM+N\L+:VNJJJLK*RMK:RNJJJHJZ@K*
-M2DH*:NHJ*NL+RPMK*ZHJZVOK*RNJJROK:RLJZJKK*^H*BBHJJJKJZBHK:^MK
-M:XN+B\O+RXLKZ\LK:@H*BFIJBNJJJJOK:^NJ:BJJ*FKJJVL+2POKJBMKBZIJ
-MJBOKJBIJBNHJJJJJJRLK*RNKZBJJJ^MKZZNK*RLKJNKJZBHJJJLK*RLKJRNK
-M*JNKJBLK*^OKJRHJJJJJJ^MKBVMKZ^LKJZLJ*FIJ:FKJZBJJJZLKZ^LKJZNJ
-M*BHJJJNK*^OK"\N+:^NK*ZKJ*JHJ:HJ*BHJ*ZBKJ:BHKZVM+BXO+B^OK*ZNJ
-MJROKZZNJJNIJBNHJ*BJ*"FJJJZJK:XOKZVMK:^MK:VMKZZNKJZLK:VLKJNJ*
-M"@K*"FKJJBLKZVMKBVLKJRKJZNHK:XMKJRJK*NJJJRKJZNKJJJKK*^OKZ^LK
-M:VMK:^MK:VOK*ROKZZOJ:HJ*"FKJJJJJ*RNK*NJJJZNJJJNKJ^OK:XMKZRLK
-M*^LKJBHJJBKJ*JJJZNJJJ^HJ*RLKJRJK*ZJJJBMKBPN+:^OK*ZNKJBKJ*NKJ
-MZNJJJJNKJBKJZBJK*ZHKZ^MKBVLK*^OKJRHJJRLKJRLKJZKJ:FKJJJJK*^OK
-M*ZOKB^LJ*ZNKJNKJZJJK*RLKZ^LKJZHKJZNJ*NKJZNJJJZLKZVOK*ZLJ*BHJ
-MZBJK*RLK*RMKBPL+BVLKJJJJ*HJ*:FKJ*JJJ*BJK*RNJJ^OK:RNK:PLKJJLK
-M*RNK*ZNKJBIJ:BIJBHIJZJJKJJOKZROK:VOKZVOK*ZJJJRLKJZNJJJNKJBHJ
-MJVOK*ZNJJJLK*RN+R\N+:^NKZFIJ:FJ*"HHJJBOJ"BHJ*JJJJBMKZVN+R\O+
-M"VOKZ^OK*RLK*ZOJBHJ*B@H*BFKJZJJK*RLK*RNKJJLKZ^OK:XN+BXN+"XL+
-MZZNJJBIJ:@H*BHIJBNJJ*RLK:TL["PN+*ZIJBFJ*:NJK:PN+:VOK*ZHJ:HJ*
-MBFHJJ^LK:XN+"XMKZZNJZFIJB@J*ZJHJ*JJJ*RLKJZOK*ZNJJJLKZROKBXN+
-M:^OKZ^NJ*BJKBLIJZBJKJJJJJZNKJZLK*RLKZ^OK:VOKZ^LK*^LKJJHJ*FJ*
-M"HKJZNKJJJNK*RMK:^LKZRNJ*NKJ*JJK*RLK*ZLK*RNKJJJKJZLK*RLKJZMK
-MBZJK*ZNJ*BHKJZJJ*BHJ*NKJJJNKJROKZVOKZRNK*NHJZBHJJBLK*^NKJBKJ
-MZBJK*ZNKZ^NKJZLKZXOK*ZNKJBJJJBHJ*BOK*^OKZ^LKJVKJZ^OK:^LKJROK
-M*RNKJBHJ*FKJZJJJJZHJ*BHJJRMKB^OK*VMK:^MKBVLK*ZKJZNKJ*JJJ*BKJ
-MBHJ*BNJJJZLK*RMKR\N+:^OKZZNJ*JJK*RLJ*JNJJZLJ*FKJJJHKJZLKJJHJ
-MJBMKBXMKZVOK*^NKJJLJ*JJKJJJJJJJJ*BKJ*BHJJJLKZ^OKJZLK:VOK:VMK
-M*ZJJ*NIJ:NIJ:BJJJZIJ*BNJ*VMK:RLKJZJKJ^OK*RLKZRLK*ZNJ*BIJBHJ*
-MBNJJJZLK*^OKZXO+RVLKZVLK*ZNKJZHJBFIJZBKJ*BKJZBHJJJOKZ^OK*ROK
-MZ^NKJXN+*XN+:ZLJ:FJ*BHIJ:BJJJBNKJRNK*^MKZZLJJBN+R\L+BVLKJNKJ
-M*JJJ*NJ*BFHJJZOKZVOKZVOKZ^MKB^NK*^OK*^LKJRJJJZNKJZKJ.KH*"BJK
-M*VOKZRLK*RLK*ZNKJBHJJBOKZ^LKJZLJJBHJJJJKJBJJJBJK*RLK*RLK*RNK
-MJZNKJRLK*RLK*ZNKJROKZVMKZZHJ*BHJ*JJKJJIKZRJJ*NHJ*BHJJJNKJZNK
-MJZLK*RLK*RNKJRIJ"HJ*:BHJJJJKZVN+"XL+BVOKZRNJZNKJJJNK*ZNKJZJK
-M*RLK*ZLJZNIJZJHKZ^MKBVMKZRJK:ZLK*ZNJ*JNK*^LKZRNKJBHJZFIJZBKJ
-M*NKJZBJJJJNKJ^OK:VMKBVN+BVOKJFJ*"@J*:BJKJJKJZJHJJROK:^OKBPL+
-M"XMK:XOKJBKJJ^H*:HIJ*JJK*ZJKJZJJJZJJJJNKJ^MK:XMK:VOKJVJ*"HKJ
-MZFIJZNHJ*JOKB\M+2XLK*ROKZRLKJZNKJZNK*NHJ*BHJ*JJK*ZJJJJJJ*ZOJ
-MJBNK*^NKJJJJJJJJJZLK*ROKZ^OK*^OKZRNK*ZNJ*NIJ:HIJZNHJJJJK*RLK
-MZ^OK*RLK*RLK*ZJKJZJKJJJJJZNJZFJ*:NHJ*JLK:VMK"SO+R\N+BVLKJBHJ
-MJJHJJJNJ*NIJBFIJ:NKJZNJJJ^N+"PN+BXMKZRNKJZKJ:HIJ*JJJJJNK*JJK
-MJRLK*RNK*ZNKJZJJJJHK*RLKZ^MKBXLKZNKJZBHJZNKJ*JHK*^MK:^NKJJJJ
-MJRLK*ROK:VOK*ZNJZNHJJJHJ*BKJ*JNJJRLKZ^OKJZLKZ^OK*ZHJ*BJJJZLK
-MZVOK*ZKJZHJ*BHJ*BJIKZVN+BXMKZRNKJ^MK:^LKJZLK*ZNKJZNJ*JJJJJNK
-MJBHJZNKJZBJJ*^OK:XMK:VOK*ZNK*RNKJZHKZ^MK:^NKZNIJ:@J*ZBJJ*ROK
-M:^OKJ^KKZROKZRNJZNIJ:NKJJBLKZ^OKZRLKJZKJ:FKJ*JLKZ^N+BVOKZRNK
-MJJJJJJNKJJNKJZNJJZLKJZNK*BJKJZHK:VN+ZRLKJRLK*RNKJFJJ*ZJK*ZLK
-M*ZHJZNJ*"HIJZBJJJJLKZVL+"XL+:^NKJBIJZNJJJROK:^NKZNHJZBJJJVN+
-MZRLK*ZOJZBKJJJLKZXN+ZROK*ZNK*ZHJ*BJJZRJ**^LJJJNJ*NHJ*NJJ*VMK
-M:XN+BPN+*RJJJVI*:JMKJNHK*ZLJRHJKJBJJ:VOKBXL+:XMK:PN+JVHJJRIJ
-MJNOJ2HKJJBNKJBJKJ^HJJRNJZ\N+BVNK*^OKZRNJ:@H*BLJ*JBNKJJNJJ^N+
-M"^MK*ZOKBZNJZZJJZ^OKZROJ*NJ*RHHJ:FJK*ZJJ*BKKZXM+B^NKZPOKJ@L+
-MR[N[BZOJZNK*2FK*RFKJ*BIJ:JJK*RJJJRHJ:VNJJRN+ZXM+ZXMK"XLJJXOK
-MJHKJ*@H**JN*"BHKJBIKZPL+B^NJJJNK*RLK*ZOKJZKKZZHKJJJK:ZH*"NKK
-MZFJJ*ZLKZVL+:ZOKJ^JKJNHJZXOKJ^NKJRJKZRLKZJNKJROJJJKJZBKKJNOK
-MZZNK:XOJJNNKZJHKJBHJ*RHKJ^JK*^JJZFJ*JVLKRZHJ:JOKJFL+ZXO+R^NK
-MZZOJZBOK:XL*2BOK*ZNJJ^H*BDHJZRHJ*PO+:^LK"RLKJXIJB@KJZFHJZVMK
-M*ZIKBRLJBFHJ*ZHKB^N+RXNK"XLKJZNKJZOJB@KJB@HJ"HKKJBOKJXOKBTOK
-MZPO+*NJ+:^LJ:XL**NHJZBHJRBKJ"NHJ:JHJJBL+.[OK:XLKBFIKZRLJJNK+
-MNZO+"ZNK.KK**FHZ*BM*:NJJ2POK2\L+JRJ+:NLKJNMKJ@HJBRLKZJHKJ^JJ
-M*XHJJZNJ*FN+:TL+*ZN+ZZOKJZMKBZK**FIJBKIZ*DKJJFN;ZDN+BRJZZJLK
-MZ^L+NSLKBXLJNRNJZ[KJBNJJ2DJZZ_J*BXIK"XH+*[LKJ^N+:XN;"ZOK^^LZ
-M"NIJRJMKJLMJBLIJJJI+JDIJBDLJ2BI+:ZMKRZM*:CN[Z\O[:^I*ZNJJZJKK
-M*LMJZFN+JTK**NHJZ^JJRSJ+*^MK:YLKRDIJ:[LKRKNK:BHZ:ZL*RFI+*RJJ
-M"_LKZSLKBJJK^TM*.LNJRBJ:^VL::BI+*KH+JDO*NF.+BBN[ZZNKRNMJ"WO*
-MZWHJRXI+ZXIZ:\O**RJ*J[OJJSN+&BJK&VNJBPJK^HJ[^[MJZWN;Z^)K.RIZ
-M"GLJ.KJZ*ZJKJNHJ:PH*RINK:FMK(XNJRVN["RHKRNNB&HIJ8\HJPPL+RN+K
-M*\KJFNNK"TOKJXOKZOO[J\JKZ_H[6GHKBRKZ*ZL[J[H+:PL;RTO*.TMJBTL*
-M.BHJJ^N*BXOKRQIJ^CHB.LMK^^H[X\OJJFL[JEIZ:RN+:ZO+*\H[RBIKF\NZ
-MBJK*NJJJR\MK*ZMZ"NOJRBL+JCNK*X/CN[IJ"CHZ2LLJBVNJBZI:*LN+NWJ"
-MN\MZJBJK*EO[*DHJ^WHZ0SLZVWN;2XLK.[NJPNJ:4NMZ8ALJ`KO+NANSJWMC
-MN[I#ZT)JJMKZ\AI+JN.;`QMZ:^."&JNZ>FO[^MJ*BJKSTP.S.RZ*BW*N>[/S
-M$]HR>AIJ6O+*HS.[2YN:RAO["@H:2NH+2HJO^[I[&RHCJQJ[RRH:`FJZ8@JK
-MZNJ**[M;F_KZPR-JZNNJBBK+Z_J*B[O+BTJ+6R(ZX\O::FNJRHJ:*QNK:RNZ
-M2RLJJFJ**_N+B\IJ:X+B2ZJKVP.;VUL;BP+R2KOBZJM+NPO*8NJKNNOK6GJZ
-M:HK+JTL*>Z-;B[NC8X/CP^]C*FHKZYHBFHJBXIHZ6B+26@HZHJK+"J(B,L+2
-MSHXBVN(K+Q_GAT?WE_<W=S<'7X]K4J8V*&B(R`CH*!;&)GX.KB)[(PL[8^,3
-M'S=I^5FQ4<%9X=G?1KA@P$#0K,"@&.@K=SDA(2&!H:GSHO9XX&#@6/@('N?7
-MJ<EY.2D'7S>!$8EGP<$'7L:(N!C04*!X8*#:R?EIB5E9AV:V;A:@($CH2/@H
-MV\<OVY<A$2VMT:VM`>>VN&`0;(PL<$!@EI?9(8&148$7[Z((`/!`8.#@2#OW
-MA[<YH?F7Y\?A;4$[8:TYAE;H.-B0[,!HH,`6B8D)H>$AF3]&GH8@`)C(&!B(
-MY@\?:\<YB?>A+6TQ09&Q"::8(&`0;"Q`8&"X+[E96>$Q06EK:SYX``"@F-AX
-M!O^?`T?)B4=/ORG!T0$A<7'Y0Z8H&$"LK+"`P.#^%REIH4&QV0<'!]9@8%C@
-M`."(SLH*9[GY*7<I:2%1D2'!<2$OQFB@0-`L$("`8);W"0D9@;&!R5]?.GB`
-M(*!@8/BV.H//*?E)5Y>7GQ=!L?DA,6&IBV:(6$!0D(``P+A[1Q=)(0$!6=<7
-M9RC@("!`0"`()NO/Z:'9R;GYMSHO(7%I'\%!J6;&G@B`D/#86+"@6U>?9UG!
-M@<G'5Z=HX*"88,#8-L)[I[FA.6F)E_I.]QG9V1F!P4D3(N[(0/#`P+!`&.;[
-MSQ=9@6%92:D?QGC86&``V%9>B@?)F7FYR:D/#D8J66&G:1%!=^.WD[A@0,!@
-M,'"@WK[&AR%AH1D9^3<F:*@X`(!(*&CF_Q>I*6D)Z1\;3ZD9X=D908&GZN]&
-MX,"`0#!`@)A&\MNIH>$A(7GI)]*H2'B@('B(J%ZCI_?IB8GI%V=?)VEAX2EY
-MP;D";LOH8&!@`,"`H`B&#CLIV=GY^9GI0XXF5GC8N`@(J,YCG[<IB0EIJ7<'
-M)ZDAV5\)X5>F_B^H(%AXH(`@>(B6!JZ'B0GIN7FIWV\;)BBHJ&B(EIZNR@^W
-MU]>IJ=<WAP<)&1>'.>F[#F.22$CH2*!82$C(J.;"0X?7J2DI5P=_[\K^9H:V
-M=H8.PFJ_1S>7J:EWQX</FVH;+VLRVR^J3IH;3H:F_D96MN9F!GY:"FH;;V_S
-M\^\S.UO#V_L#DQ.O;X_O[Y.#XQOK2LH*6N):>GI**JJK:XOK"KJZVH*BFF("
-MFKK:&FJJ2LKK2PM+&Z-;&_N[N[OKJJOK*ZKJZBNJR@IK"RL+6V-;FQO[BRMJ
-MRKKZVJ)Z>J):2FJ*BNM+"PN[^\LKZVOKJFJKRVMJJVOJNDJ*B@HJ"SL[>SL[
-MNXLKJZJ*"NKJ"HJK:ZNJBPOKJBHJZFH*"NJK*^N+2[N[.TMKJ^H*NOIZ^DIJ
-MJRMKRPNK*JKJRHJJZ^N+2SN[._N[.[MK*RNJ:DK*"DJZ2FIJZJJKJJLK*NHJ
-MZHIJJBN+2SO[^_N[RVNK*HI*.KH*ZBJJ:\N+ZXN+:^LKJJKJ:NJKZRHJJ^LK
-MZHJ*RCJZZNLKJLN[RXN+BVNJBHIJBLJ**JJKJ^O+N[L[>YO[R\O+BZMJ:NJ*
-MNOI*RDHZ.LK*NLKJJ^L+._M[^[N[RVLKJZNJ*NIJZNJJ*RLKZXOKJZNKBHJJ
-M:FHJJZNJJZNKZVNKJBHJ:HJ*"HKJ*JJJ*ZLK:XL+BXMK:XN+ZZOK:ZNJJRNJ
-MZBHJZBKJZBHKJRJJJNKJZNKJZJHKZROK*^LKZRNKJBL+RVN+:VMK*NKJZNHJ
-MZFKJJNIJ*JNK*VMK*RJKJZHJJJHJJRLKZPO+RXMKZ^LK*NHJ*NIJ*JHJZBHJ
-M:FKJJBJJJROKZ^OK:VOKZXL+"XL+"RKJ*FIJ:FIJ:FH*"FJJ*JOK:VN+:VL+
-MR\N+:ROJ"@J*BFHJJZJKJZNKJJNJJJJJJJJKJZHKZVL+RPMKZ^NKZBHJZNIJ
-MZJJJJZOKZ^NKJZJJ:^NKJRHJJJJJJRMKBPMKJZNJZBHJZBJKZZNK*ZNJ*BKJ
-MZBJJJJNKJZLKZVMKB\N+ZRLK*ZLJZFHJ*NHJJJHJ*BKJZBKJ*JJJJBMKBVL+
-M"^LJ*XOK:XMK:RNKJBHJ*FH*"LJ*ZNHJJRLKJRLKJBJJJJJJ*ROKZ^MKBVLK
-MJZNKJZJKJBHJ*BJJJRLK*RLKJZNKJZJJ*BJK*ZNK*RNKJZLJJFLKJBNJJBLK
-MJZNKJRMK:VOK*ZNKJRKJ:NKJJJJKZ^MK*ZNKJBHJJBNKJRLKJRJJZBJJJJMK
-MBRLK*RLKZVO+@X^3FC[>#N(JJ^HJRR-#8YL+:[O[Z^KJJJIJ*LN["ZOK"PN+
-MZZHJ*FJ*B@J*BLKZFBK/1R=:QC:^N]L"/L[*CS\SRSNO3R_;ZZMK>J)BVKJ:
-MBBIJZDN;N[N+^PMJBNIKJAKZ*RL:FNHKZ\H*BLI+"SM+R^,CZOH[6QI::BNJ
-M*@KJJAJZ"ZNK*ZO#RXOK>\OK>\KKZZHJHIIKRKJJ:@NZ2MLK:_I+XPOZ^F,[
-M*LK+XPLZ"NL;*P)J*\JZVFHZJNLZ:SN+2\LK*KN+J[I+^XNJ*]N;*F(KVSH:
-M*DJKBVKZ2FLJ>FK+6[NK:\NKRPMKZDL;ZXK:"JMJ>CJJ2XH*2KO[N@N+*BOK
-M.VIZBTN+"HJ+"_J*2RIK:VL+BZHJBPK:BHJK*XN[ZVNKRLN+BBLKZRIK*FJK
-M2NLKB@NJ2^J*J[HKJXN+ZDO+ZVNJ2NJK2LLK:HNJZBJJZBOK*FJKZPNJ*JL+
-MZXMKJZO+B[H**VK**BH+"\LKBNOJ"^KZJ\K*Z^IKJVL+J^MKN^OJZNM*:FNJ
-MBZMK^RKKBFLK*RN*ZZNJ:^N*"JJ+JGNJ:NNJ"TK*JNH*N@IKJNJKZ[NZN_O+
-M.ZNJR_LK"JHKZGJJNZJJZXLK*VHJBJHJ^FJ*:XMJ:ZH+JRH*B@N["RN+:\IK
-MRRHJ:BH+ZBJ[:RH*JON+NIHKZWJZRJL+:QM[2SMJ"PKZ*HIJJNL+ZBJKJVNK
-MR_KJ"RJK2NMKJFNJ2XHJ*XI*BOL+.PLKRXLJ^KKK:\I*"JN+2RMJBXLJRLOK
-M*VKK2VOK:XLJJ^NZ:BOZ*PHJZRHK"NL+2_H*&[LJZCNK*BJK*HLJB@N+JLJK
-M*JMKZNJKZRMKJVHJJ^HJ:HH+"ZH*:XMJ:ZJ+BRL*JFN[Z\J+Z[I+2ZIJ:RNK
-M:@HJ"JHKJPL+RBMKJJO+*\J+ZXKJNGO**JKKNVK*BKM+JVJJJRN+Z@I+:XMJ
-MRJKKR\OKJ@OK"FIK*OJK:CH+Z^J*R^HKNZNJ"SNK*NKK>ZN*"HHK*BOKBZN+
-M:PH*BFMKJNIKZVJZZ\MJBVOJ"JH+ZHHKBFN+BFJJ"ZMKJNH+ZRN+JRK**LJJ
-M*\LJ2BHK*XIJBVOK:VO[*ZNJ*RNJ*ZJKJRKJ*@OZJFN*JFLKRLIK:RN+N\NK
-M:VL:ZBI*RLO+JLMK:FL[.VJ*RVN+BOJZ2BHJRBOKJTIKJBL[RTM+JTKK:VNK
-MZZHKZ^MK2JNJBJH*JJJK2[KZBHLJBXNJ:JLKJZHJBXO[:^M+.ZLJJRJK:ZNK
-MZRJK*BJ*NJOJ^AIJR^MKJXM+ZXOJ*VL+JFMKJ@L[2DIKBNIJ:JH**JJ*"LN+
-MZJNK:RIK*PN+2XLJ"@KJJJNJJ@MJ:HJJBDJJ^PO*:FM[ZNM+"\N+BRO**@KK
-MZZH*BV/+FGKKB_HZRFKK"BH+ZZMJ>^LJBZNKBRKZJDN+*RIKNTN[ZFLJ:FI*
-M2CK**\LKJZL+ZXLKRBMKBNOK*FN+ZVJ**LM+BDJ+Z^M*:BL+R\IK:BHJJPI*
-MB^O+JBN+RPLJ"VO+*NNK"JLJJDIJZLOJ"CN+:ZIKZ^NKNBMJ2JJK*HKK"[O+
-M*NIKJ\JZBBHJZZKK:RMKBNLK"[OKJFJKZRIJJNLK2WN[RBL+>JHJ^KH*:ZKJ
-MBHO+*FLJ.\NK"JN;B^JJZVNK"LJKZRH*JXLK*JL*^NH+"RMKBVOK2LIJ*RHJ
-MZJJJ*BIJRRH+2RNJBWNKJ^MK"RJ+JFHKJTIJJ_IJN@IJ:FNJJXN+ZXO[B^O+
-MZRI*RVJZ:JH+JNMK:\N+ZBN+2VIJZZOJRLJJJZO*ZLL+R^LK*EM+BKHJBOI*
-MJNL+"[L+:PK:FAJ:8J)*ZBJJ.]MC0X-CH\-C&^LKJHJJROIZ:JL*BEIZ^DI*
-MFCKZ:HIJJRJ+BTN;>]O;6YM[>TMKJ^J*R@I*.LIJZNJJZFKJ:HJ*"LHJJBKK
-M"\L[NTL+2\O+"PL+"^LJBFH*R@KJ:NJJ*ZIJZBKJJJHJJJJK*^N+BPN+ZRIJ
-M*JLKZXN+:ZNJZNKJZJOKZXMKJRKJZBJKJBKK:RNKZXL+:ZJJJNJ*"@K*BFKJ
-MJJNKJVMKZ^N+:ZHK:^OK:PMKZROJ:BKJ*JHJZBHJ*JOKJRHJZBHJJXL+BVMK
-MZ^MKZROK:RNKJNHJ*NHJJBMKB^LJ:FJ*RLH*RHHJJRMKB\O+"PL[^[M+BZLJ
-MZHI*RFKJZBIJZJKJ:@H*ZBNKJBNKJFMKZ\L[^YN;NXL+*RJJ:@IJJNIJ:HIJ
-M*FH*ZJLJJZOJ:BJJJ^LKZ[L[RVN+"VNK*BHJBHIJ"FJJJ^HJ*HJ**JMKBVN+
-MRPMKB^NKJRLJ*JLKJZNK*NJJ*HIJJJNJJJJKZROK*ZHK"PNKJBKJ*BKJJFO+
-M.\NK*XNKBFIJBBHKJZLK*^H*RLJ*:BJKZPO+"[N[BZMK:RLK*@IJJFJ*:HJ*
-MZFIJ*VNK*^NK*VLK*XOKZPL+ZVLK*JJJR@JJ*NKKBVL+"VLK*DI*B@K*"LJ*
-MZXMKRTMK"[O+B\N+:^MJNLJ*"LHJ*XL+JZM+:^KJ:FJK*FIJZJMKJRJKJ^JJ
-MJJLKZROK*RHJ*ZLJJXN+:RLK"\MKJZJ*R@JZ2BJK*HL[NSO[RPM+BZJJJNJJ
-M"GI*2GHZZBJJ2[MKZZLJJVH*:NHJ*^NK:TN+BTN+:\MK*RNKZBHJBJLK:BHK
-M:NJJRLIJZFHKB^MK2VLKBVLK:PMK:XLKJNJ*B@I*RBHJ*JHKZ^OK:XMKJNIJ
-M*FLKJXN+:RLK*RLJ*JLJJ^N+:ZLJ:@I*2DI*:JNKBTMKBPLKJVOKZPL+*VNK
-M:JMKJBJJZNJK*FJJJHJJ*FKJZFJK*RKK2VLK"\MKB^NK*^OJ2NJKZPN+*XL+
-M*ZJKZ@KJBKJ**BKKZRJK:ZKJJZNKJZHKZZNKZ^LK:^NK:RLJ*JJK:VOKZ^LK
-M*ZKJJJIJBLH**BKJ*BNK:SM+:XM+"RNJJPO+*ZJK:XNJZBHJBKJZ"LJ*ZBIJ
-M*NN+Z^N+BXN+"XN+:RLJ:BJJJBKJZFIJ*BKJJXOK*^LKJNOKJRHJJJNK:TM+
-MRVN+"VNKJJKJ"LJ*ZBKJ*BJKJ^OK*^OKZZNJ*JJKJNKJJBNK*ZNJ*^NKZXOK
-MZVNKJJJK*JJJJBNK:HHJ*BIJZJOKZRLK*PL+:ZNKZROKZRNKJROKJZKK*ZJJ
-M:@IJBKH*JZJJZZNJBXNJZJJJ*RNJ*ZLK"PN+:VMK:^LK*VNKJJNKZNHJ"FJK
-M*BHKJNHJZNKJJJKKZZHK"RNKBPNKJHN+:XMK*ZOJBFKJ*NHJJJLKJ@J*JBKJ
-M*RNKJBNKJJKKBVLK:VMK:XOKBVNJZNH*2@KJ*BHJ:XLK*XMKJJJKJZNK*^LK
-M*RNKJZKK:ZLKZZKJJFJ*:FJ*:BJJJRJK*ROKBXMKRPOKBVNJJZLKZRNK*RKJ
-MZHJ**NKJJZNJ*ZKJJJHJ*VOKZVLK:VLK*VLKJBIJ:BKJZJJKJNIJJBNJ*BHK
-MZZOKRXMKBXL+:ROKZRK*BFJ*:BIJBNHJ*ZNJ:VNJJRLKZ^LKJZNK*ZLK:\MK
-MZXL+J^IJ"KK*BNJJJZLK*^NK*JHJ*JMJBBHJJBLKJNL+RSN[BTO[RVMKZRN+
-MJHKJ"DH*B@IJ:BHK*NJKJZJ+:^JJJVHJZRLK:^MKB^OK*RLKJJJJ*^NKJ^H*
-M:FIJ*JJJ*RNJ*VNKZXOK*^LJZBNJJVLK*BOKJBNKJBLK*^NJJXMK*^OK*XN+
-M:@HJZFJ*2HIJ"LKJZJLKZXN+:VN+BVN+"VOKZRNJ*BJJJBIJ:FKJ*NJ*:JJJ
-MZNKJ*XN+:XO+"POKJZHKJBHJJJJKJJJK*^OKJZOK*ZHJ:HHKZVJKBROK*^HJ
-MJRKJJZHJJZJJ*RNJJRKJ*VMKBRLK:VLK:ZNK*RJ*ZFH*BFKJ*JLKZZLK:^NK
-MJZJJ*VOKZTN[2\N+Z^OKZRNJ*FH*"@H*"DJ**JJKZXMK*ROKBTL+ZPN+*^LK
-M*JHKZNHJ*NJ*RHJ*:NJKJBMKZVN+Z^OK*ZJ*BHKJBFKJJZOK"TL+:VOKZ^OK
-MJNIJ:FHJJFO+R\O+:VN+2[LKJZIJRLI*2HJKJJHKZXN+ZZJ*:NIJ"FHJJNHJ
-M"XLKZPOKZXNKJVOK*ROKJBHJJJIJ*NNJJZKJ*JJJJRNJJVLKJ^LKJ^LK*JJK
-M*^KJ*ZMJJFNJ*XMK*^LK:VNKZVLJJJOJ:NKJJBNKJRNKJBHJ*NIJBHIJZJKK
-M:TO+BXMKZ^LKZRNJ*BHJ*NHJJBMKB^LKJBIJBNKJZJJJ*XMKJJNJJFLKJFN+
-MZVOK*^OKJ^OKJBJJ*JJJJZNKJZNKJZJK*JJJZBJJ*NJJ*BHJ*JKKJZHJ*JJK
-MJNN+:\M+B^LKJZJJ*JJK*RJJJJNJJ^OK*ZLKZRLJBFJJ:NHJJFMK*^NKJBJK
-MZXL+Z^OK*BIJBFHJJZHJZNHJJBOKZ^MK:RLJZBHJJZNK:^NK*ZNK*ROK*ZHJ
-M*JOJZJJJ*ZLKZ^NJ*BHJJJJJ*^N+JRJKZFHJJJJK*^OKZRNKJ^OK:^LK*^NK
-MJJOK:RLKZRLKJZHJJBKJZFIJ:FHJZJMKBXMKJROKJBJKJJKK*ZMK"VMKJZHJ
-M:@K*BFIJZBJ+:ZHKBVN+BVMKBPL+:VN+:RNK*BHJZHJ*RLK*BFJ*BHIJJBNK
-MJ^N+"PMKZ^MKBXMK:RMK:^MK*ROKJRHJZDJ*ZHIJ*NHJJRHJJRNKJJHJJROK
-MRXOK"^LJ*JHJ*JHJJJLK*VNKJNNKJZNJJJNKJJLK:PN+*^NKJHH*BFJ*BFKJ
-MZJJKZRLKZ^N+BXMK:VLKZ^OK*^LK*RLKJRNKJZJKJRIJBDHZ:JLJ*VLKZVNK
-MJ^LKZVMK*^MK*^MKZ^LKJJIJ:HIJZFKJZFKJZNHJ*RLKZVMKZPL+:VL+ZZLJ
-MZNKJZBJJJBHJ*JNJJJJJJJLK*VOK:XOKB[L+:XNKZHH*RDH*BFHJJJNJJBOK
-M*ZNKJRLKZRLKZ^MK*ZJKZ^MKZZHJJJJJ*NHJJJJJJJNJJJJJ*ZNJJRJJJBJJ
-MJZHJJRNKJBLKJ^N+BPOKJBMK*RNJZJHJZNHJ*BJK*ZLJZFHJJJJKJJJJJBMK
-MZ^MKBXL+"XOK*ZJJZBJJZJHJZNHJJJJJ*BHJJBHJJJLK*VN+:PO+BVMK:ZLJ
-M*NIJ:BHKJZLKZRNJJZNKJNHJJJJJJBOKZ^NKJZHKZRLK*RNKJZLJ*JJJJBKJ
-MZBHJ*NHJ*^OKBVOK*ZLJZNKJ*NHJJJJK*RLKZXOK*ZNJ*NHJ*JJKJNHK*RMK
-M:VL+"XMK:VMKZRLK*RLKJZNKJZNJ*NKJB@I*"HIJZJHK:XN+:^OK*RNKJRNK
-MJRNKJROK*^LK*RNK*BKJBFIJZBJJ*RLK*^OK*RMKR^OKZZKJZBHJJJNKJ^MK
-M:XMKZ^LKJRKJB@KJZHH*"NJK*JHK:PL+B[N[BZOKJXH*"BJKJXO+:VNKZ^NJ
-MZ@J*"JK*>HHKR[M[2XNJ*_-3#GY_R^C(CPE;2W^7-ZLV:!('B:DFH,A)&<Y(
-M'H?;`F(OWW8HMC>9"3>HJ!XZ\BBH<JFYB>?N[D/C.@+NNY/NYJY"YC[:BY]'
-MYRHF9J)?`^+:^R>_D\IC_Y/NEN:>8U.2_FM'7PL^.VK[_ZLB+NL[KPH2+X,R
-M9OZ31[_"WJ:J`V^3<ZON8GI[JQK#4SOK\Z."@FLR+HZ:(R,CRP]O*AOC\RKB
-M/J8NLHK*V[.[4T-C(XJKJDI^#FM3&^OK*Z\/`QJK"\KZTC("HH(+_V\/JVY"
-M.F.:X@KKX]JJ6GJ36P-+`FN[`B[B#],J>NI#BZ/;:_.BB_H.$H)#J^O+2EM+
-MNTN*(H(+`WO*BFI:>IM#,VO2RLMS.SJ*NLLZ6L)[,PJ*:IL;8XLR0OI[^ZOZ
-MXGKC6Z-;R^/[FC):6II*:ILC"Z,CHQOZ0AHJJ^J*HGI+VQM[6VNZNLI[H^)N
-MRCN[^\K;TQOZ,FK+ZII:(JN#X]KB*YLO>WIB>FJJ8POZ*JHCH^OK&P.+&L)*
-MJAJR.OL#B_KJ:JHKJVHK@SN+N^M;&VJ:0AHK"BIK.ZN+RWJZBJO+:[KZZTL[
-M"VLZ*IO;>VI*2FKZR@O+:XOC"_JB"ON[>C*:^\/S"VIK*^NZJRNZFAHKJHM+
-MFR.+RTM[JJ+B0F)JH^-;FWN;2XLK*N)"8AK*Z\L[XPL+>[OKR@KZNJ(*RDHK
-MZSL+JXN[:_JBN@M+.SN[F_L[*XN*2OH:*BO+"RHJ"SMK2LHK"SJB:BHJJJNJ
-M2SLJ*OL[*FK*ZLOK:HNCHTL*HOIJBXOJ"BLKZLHJRZL*6BIKJVLJ"ZOK.TMK
-MJXHZZNOK:NHK*ZLK^QNKRDH*BH+NDJ)**[L;(V.#@V/C(UL;>[O+BVNKJNIJ
-MB@K*RDI*2DI*RLK*"@J*:FKJZBJJJJNK*ROKZ^OKZVOKZ^OKZ^LK*RLK*RNK
-MJZNKJZNKJZNKJJJJJJJKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZO_________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M_____________P``````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-#````
-`
-end
diff --git a/share/isdn/7.g711a.uu b/share/isdn/7.g711a.uu
deleted file mode 100644
index d7e7791336ad..000000000000
--- a/share/isdn/7.g711a.uu
+++ /dev/null
@@ -1,231 +0,0 @@
-begin 644 7.g711a
-MZZIJ:@H*:NJ*BNHJJBMKBVMKZRNKJJJK*JLKZVN+"\L+:RNJZFJ*BHJ*:NHJ
-MZBHJJZNK*ZLK*RLKZ^LK*RLK:VNKJJJJZBHJJ^LKJZJJ*ZIJZJJJ*RNKJROK
-M*ROKZZNKJBJJJZLJ*NKJ*NHJJRMK:^LKZ^OKZ^LKJZJJJROK:^OK*ZKJZFIJ
-M:NHJZFIJ*JHKZ^MKZRLKJZNKJJJJJZLJ*TL+BXLKJJNJ*BJJ*JHJZNKJZFKJ
-MJJHJJJNKJZNKJZLK*RLK:XL+2[M+RPOKJZNKJRHJB@J*"@J*:FHJJJJK*ZNJ
-M*JHK*^MKBVMK:RMKBXOKZJHJ"HJ*:NHJ*BJJJJJKJZOK:^MKBPMK:VOKJZJJ
-M*BHJJJNKJZHJZBHJ*BKJ*NKJ*JNKJRLKZVMKZ^NK*RLKZRLKJRLKJ^LKJBKJ
-MZBJJJNM+"^OKJBHJ:FIJZBJJJZNKJJHKJZHKZVMKZVOKZZNKJZNJ*NKJ:FJ*
-MZBJJJ^N+:VL+"PN+:VOK*ZOJ*NIJ:NJJJZNKJZJJZHJ*:FIJZBHKJRIKN[N[
-M2\N+:RNJJBIJ:HIJZNKJ*JNK*ZNJJJHJ*JJKJZLKZVOK*RLK*RLKZRLK*RLK
-MJZNKJZNKJZNKJZHJ*BKJZBJJJJNKJRNKJJNKJROK"VOKB^OKZ^LKJBJJJJHJ
-MJJHJZNHJ*JNKJZNKJZNKJZLKJBJJJNKJZNIJZJJKJZLK*^MK:VMKZ^OK:VOK
-MZRNJJJNK*^LK*ZNKJBJJJNKJZHI*:BHJJRLKZ^MK:XN+:^NKJZJJJZNJJJNK
-MJZNKJBHJZNKJ*BJJJJJKJZJJJJJK*^OK:ROKZ^LKJZJJ*JHJZBJJJRLK*^LK
-MJRLKZ^NJJJLJ*XLK*VLKJZNJ*NHJJJNK*^LK*^NKJJHKJRKJZNHJJJJKJNMK
-MRTO+"VLK*ZJKJBHJ:NKJ:FKJZNKJ*FIJZBHJJBOK*^MK:XL+BPL+BVMK:VNJ
-MZBKJ:FHJ*JJJZNKJZNKJJRLKZ^N+BXOK*^OK*RNJ*NKJ*JJJ*NKJJJKJ:NIJ
-M*BJJJBOK:^MK*RLK*RNKJRLK*ZJJJJHJJJNKJZJK*RNJ*NN+JZLKJZLK*RLK
-MJZHJJNJJ*JJKJRNKJZNJJJJJ*JJK*RNJJJNKJJJJ*RNKJJHK*RMK"\N+B^LK
-MJRNJ*NKJ*BJKJRLKJBKJ:FIJZFIJBNHKJRKK:VN+BXO+RXOK:^NJ*NHJZBHJ
-MJBOKZVLKJBIJZNIJZFHJ*VL+"\L+BXMK*^J*RLJ*:NHJ*JJKJJJJJZJJ*^MK
-M*ROK:^MK:^LKJBNKZFHJ*^JKJ^HJJBKJ:BKJ*JLKBVL+"XMK"RNKZZHKJRLK
-M*^MKJJLJJZKJZNKJZFIJJNJKJ^NKJZJJ:BKJJRNJ*XOK*RN+BPO+"XMKJZNK
-M*FKJ*@I*B@K*:FJJ*ZNJZVO+2\N+:^MKZRNK*VMK*ZNJJZHJRFJ*B@K*BNKK
-M*RKKBVO+BVMK2PMK:RN+:ZOJJZMJRKH*BJLJZHJJ:RNJZROK*FHK:QN+Z\L+
-M2ZHJ*JOKB@K*"FJ*:FIJ*NKK:^MK:^NJJVMKRVOK"PN+JZJKJ^NKBHJJJNIJ
-MZNLJZLIJ*VMKJZMKJZHKJZHJJJNK*^L+"\N+ZVLJZHIJJJLKJRJJJJMJBHKJ
-M:BHJ*JNJZVN+:ZLKJZNJ*VNKZVLK*ZJJJJNJZJNJZJJJJ^H*BJKKJJLKBSO+
-M:^MKZRJK*ZMJ2BIJ*NHJ:^LK*^N+*NMKJVHJ*ZJK*RLK:ROKB^LKZZJJ:NIJ
-MBNH*JFIJJRHJZJNK:^LJ*ZHJ*XL+BRN+*VNK*NOKJROK*^MKJZJJZNHJJJKJ
-MJBHJZNHJ*NLJBFHKBPM+:XN[*ZHKZ^NKJJJKZJJJZFMJ"BJ*JZN*JJLKBNKK
-M:FLK"SMK^RJK^\I**DOKRHNKB@HKJ\HK"LJJ:FL+"XJJ&\NK*XL+:^H+*WKJ
-M"RNK:ZM*ZJKZRJMZ*VNK*BH[:VNKZBN+>RN+JRI[:FJJBFL+ZXK**PHZ"JOK
-M"HHKBRH*J^JK:VH+B\N[:^OKZ[JK:RI+"ZKJ:FMKJPKJZZNJRHJJBBIJ:HOK
-M"RJJ^PO+*RO+2ZLJ:VJ**NJKBBOKJ^LK"@H+RKKJ:XM*BJLKZVH+2YN+Z^L*
-M:RKJZHHJ:JM+*[I**XNZ:BLJ.WLK:PNKJFJ[FTNK2LL+*BN*ZSK*J@J*:FM*
-MRHM*RBHKBPM+*[N+FYN+BRNKBHOK2BIJ"XLZ:FM+*\H*JBN:VJH[Z^OK"SLJ
-M*JLJ*JM*JSNJJBLJNSL*BCN+*VH*:@NK:FJ**BJ*ZBN+"@J+*HL+JON[*NLJ
-M:RMK*ZNZRNLJ*VLK^QL+RHKZZZL*JFOK*CKZ*\L[JBH[:RMK"FK*:HNJ"SO+
-MRDHKZ[MJ"DHKNGJZBNHJZPN+ZYN;NPK*@TO*:XI+2LJJZZ.**VKZ*ZJJ2BJK
-M2BK+ZJJ+:ZM+6ZN+.RH+*XH*>JH[:SJZJDKJ.\OJ2JHKBZO*JOLK^LH+NXN*
-MJCMKBJO+JNJ+:TN[2AHB*DM**KN+2NKK6FJC*SL+*NL*"NMKNHM[>[LK"EH*
-M:TL*ZLM[FXNZ^LJK*[NKBOM[:HJ**BM*ZNH+JSIK:VK[J^JZJDOJJWKJ2_IJ
-M"\MJR\N*6QM+RTLJ&BNKZZKJ:JJ+BSJ+ZDIJ2RJB:_MJ(JJZJDJK&RKK`PO#
-M2XMJ^BOJ.RI+:AIJ"AM+*HOJFY)2JJIK:JN+BXMJJVIJ:J,;^\N:VRIK.SIZ
-M^LKJ.FOCR[MKBFM*NNNZJBOJNDO+:P.K*DM+NHO+"YIZ(RN"0AH+*CJ+:ENC
-MZX,#^LI*BF+*.TL;2\LK2TN+>XOK2VKKPIKJ6JLZRFI+&F)+&[KJ6_I[NWKK
-M8ZN"JLK[.ZI+NW-KBFNJTJJ[JZHJ:\H*R_L;:EN+ZFLJ"LHK"NMKJJH[FNI*
-M.TIJJHJJJHH:JNHZ*KM*(QO;BXK*RZMZ2XI+PV-K:^NZJXO::T,J^FL*`AK*
-M>@JKZHIK:^H[&_JK(WMZ^FN;RZK*:UNJ.NIC^XK*:FNJ*HJJJFN*JNJ*:KK:
-MFHKJBFL[BXN;FPO+^]O+BVIJJON+ZILCNPI*:@KZFEIZZJL*FLK*FAI**HH*
-M2LJ*"DHJ"ZNZJZ-C8U./+^\/+S/#6_O+:^HJ*[MKNB)"<BZ^?GZ^#H[N4D*"
-M<N[N\MHZBHL;K[]/;T^?GQ\?/V^G.4&!5Y^G*@C@0`"@N#@([H?75U>7]P=#
-M_F;>YI;VO@LO3T_?A^=S8FY._GZ>ON)S7V=W@8WM&1<72Z"0+*P`>'AH?YFA
-M&?GI9R\^:+C(B"C&P@_']T<GSWN2)L8&?C+BHING]ZF9+;V1Z;>?R!#L;)"8
-MZ"A[66&A.1<;'I;X6$CV)BYO-U?WGPL:LM[&ACY"*P/O#[^GARFQS6WYYV<F
-M0"SLK*#6=F[)@>$Y=PN&UK@@.";B8E-WJ3>O;AX.GK8&4@LCK[]/3[\?-V$-
-MS2$GAS)@+&PL8#;F+FF!83D'+M:(."#89C_GYW<I%S\>*!8FYL8.\Z=GGQ-C
-MTP^G^>V]<4=?NQBL;.Q`%N[B=V$!F;?NZ#AX6!@VOW?7*:G'+_XH*`8FYBZS
-MO]]_$P/#F]-)K4VMZ:=3"!!L[/#HTLI'H0'9M[[HN/AX>/;#1Y>7]R<O[A:H
-M!DZN"J-37_^+VFIK=Y&];;F'!T;P;(Q0N$(*YZ%!X2D2B'AX>)@H"_<IJ9=G
-MDTZHB%:F+GH3YP>GHVZ.ZY>Q38U9E_?^0.QLK-@^ZE^906%I&F@8V)AX**HW
-M*=?WYT.^J.CV'A*:8S\G'QORHN^I0<T-X;?GIL`L;*P@?D/G.0%A"2IHV%BX
-M"*ANIZG7MY_[[@86=J8":ZOJ,X]CRYNGH6V]T5?_:T@0;&PP%B,?J2$!6<=&
-MF*!X".@&^N<7=Z=;.@Z&]L;.^KIB"M-_O^^/*7%-#>&_RT:`+(PLH'(/YPGA
-MX<F+B-AXZ%:H]BMW%Z?C6\,*7K;F4C)^GDJ_YX?G1R%MO1$'LEXXD.SLL,;_
-MI[=YX1G'1GAX5L8HB"8?1Y_+J],OTO;VO@+.'O+/]_=GA]GM/:TI8IX(,"QL
-MD.C3IR<)H=DISK@8J)ZH."BCMR<;*_\'&[;67M).'O)/]Q>WAPE1O6WY>^Y6
-M`*QLK%BN#T]7>=E)SY9(J/[6F#C>C\^#@U]WY^YVQ@X^)KY;9Y=W1TE1/6T9
-MP\ZH@-!L+"!>DV\7^1DY!Z:(%B;H&/A&:O,3TR?W)V*&9GX^3D(CIS>7UXGQ
-MS6WAY\+V(/`L+$!HKDI?Z;EY:6^FWDYHH%B(AO)C+P<I5^]N#HY^/JYZPR?'
-M1ZD!C8U!:;.^.`#0+'"@%IZ+1^GY^>D_>ZJV^*#82-9^RM^IZ3>/VSJND@*Z
-MVT\G9T>YD>UQV3?39OB`$!!`&.@V,F^7"4EIEP?KEK@8>$BHYNJ'5Q<'IY_O
-MD\/;8R_/[X]_UV$Q@3DWG^(6^(#`8)B(*+;^.V>7J5<WKPZV5JBHEB::CY\?
-M?Y\?GY]__]^?#S-C0\//*1DY*0<_2[X&Z+BX""BHEN;."E.?#VN"KF[.3NZ"
-M*^.S<R^/C\__/_\_S^_3,S.3<V/+\[<I]Y_CBUJN/L86%D8F)B:F3D+B0E*N
-M0CIK.SL[HR/;6^,SLT.S<R\OTQ-3+Z^SHZ.C.S-GM^>/HXLZ6@).)F9FYN;F
-MYJ:>3BY"XCHKNSN[>YN;&Z/#@^-#T\^_#V]OSX]3@]N;B^KKCZ=/`PL+JGI"
-M#AY>WOZ>GIZ^KO+"\O(B.DKZBHN;X]LC0T.S+Z_O[^\/+R\30R/[2ZM*FNIO
-MW[_SN\MJ2OI2/GX.KN[.GIZ^SLX.+D+:NJH+2YNC0Y-3K^_/O\_/;Z^3$\.C
-M>ZMJ"KI:.K._;X/+RROJ2@)2;F[NSG[>GL[NTE)R`F):2NL[&T,34R\O+U/O
-M;R^O$Y/#PX.;>\MJ>EK+SY\/,R,;JWJRCC[^SHY._M[^CBXN4O)B&LHJR]N#
-MPX.S,Y.OC\]O;V]OTP.#VTO+*TK:B[_?3T,[B\IZ`H[^?@YN3IY>/HYN[BY"
-M@OHJJLL+2R/SKP.3+Z\O4V\O+U/SD_-C>QL+VW\G__,[RPJ:\K[>IGX^_GZF
-M7MX^CFZ2`LIK.YO+RUMC6Z,#T_^?/P]/OZ\3,S-C^^O+_P?GOX/;J]I2GF;&
-M9J9>7IX^3FXNKG)"6LIJRR.[^UL#8V.SXR\_OP_/OV^O\^-;&P_W%\?_4T.J
-M8DX&=I8VMD:&I@[2LE*N@IKZN@JK:UO;:WM[LQ.3;\]/CT\?CV_OKV,#MVFI
-MAT_ONX).1J@H5A;6ED:FTNL;*ZK+RPLJ2IIJ2VL*NBMK>Z.S;P^_WS]/#\]O
-MXZ>).>G'WX_[+@;HR`AH*"C6MMX*3^?_\_OJ.G).?HYZ*@KZ"AOS[P_/#S_?
-M_V^O<[-OU]G9B?>'7ZJ>*'@8>$A(""A&$M.G9Y<I]R^"_N9&1L:F`IOC(R\/
-MCV\/3^\O4W-3KZ\?N6&AR9>W_[+&N*`@V'AXR"AFN^<WQS>IJ><:YD8V]I8V
-M7BJ//W\GA^=_K\.;JGI"PCKS"<'!60GI=\MFN"#@(-C8N"CF^\<7MP>'I_^O
-MXN:VQ@:&)DZ:4^<'!X=G7Z^+>O*.SFXRBA/I`4$AR6FI<Z8((&`@V%@X*"9+
-M!Y='AV>?\[MB?N9F9N9^;MJ#WP?'1V>G/[.Z[DY.SFX26@N'6<'AN6F)1VJV
-M^"`@V%@8"':>PV?GYX?GCZ-J6EK"#CXN6KK*BY.?YR<?GT]SBQIR,F*"TBZR
-MHCI/B7D)UVG)]V_ZQFB(:+A(:*CVGJ[N`DLC8]/OSW__;P,+.AK:.@L#4V^/
-M+Z^3LR-+:VH:`I*N;FZN+I*C1T>?5[GI]S<?N@)N-M8VEJC6UJ@6!B;^XDMS
-MCX_O#P]3TZ\S<V^O`T/3TU,OTQ,O4Z/KNN+2;LX^GE[>,M_G$_>YB?=W9\NZ
-M<D:61O96EI96=F8F/L+KLP^/4^^/[Z^OK^^/+W/S4Z]3+X\/CQ-+&K(NOAX>
-M'GX^3DX^DK_WG^=)N=<W1_.Z"IXV!N8V=G:H5D9FIFYZ&R\OHP/O[^^/#S^?
-M3U/SL[.34U.O+U-CJF+2;C[>7GZ^OCY.[JZNN_=7)ZEYB<>'/SH:<L8VAD:6
-M]A:HMJ8^<JI;[T^S:WL#LZ\/;_^G#V/#,V.#L\.S<R,*,B[N[NXNTC*"LH[.
-M[K*R`MOWJ5\W26EG)S_JNF)F1H:V%G:6%@9^CJ*K"[,ONSI+8X.3CX]/'[^3
-MP[.S$Q-#(]L["H(2$O)"8MK:(N("\M*RVCK:NA]7)U-7B<<_3PNB.OZVAF9&
-M1L8V!GZ.,LHJ.]-#ZBH;VR,STV]_/V_O[R]3,V-CX[NJ.B)B8C*N\H+"@K*2
-M0N(B@EJ*>F)[A\<OAVDIAU]O:^I"IF8F9@;&-O:&ICZ2(LKC,XL*"_N;`Z_/
-M?]\_S\\/C^^OKR]S>^H:0A(N#@Y2$J[NCFY2\C)"FJKJ>MM'=P^'">G')\^[
-MZP(FAN8&Q@;V=@8F?M(B>IL#*J)JR[NC\R^?Y]]/?U^?OP_O;Z_;"N(R4FX^
-M?LYN;@X.;G)BXN*:J@LJZK^79[\7:9<G/]LJ:H[FYH;&!D;V1B:>KEI:"AL[
-M^IKK&\/S+S_?W]_?WZ>G'T]O$Z,J`FX.#C[>WGZ^SLZ.<IJ*JVL+^Z.CR^J;
-M)W??OY>I!_^OJ@KZOB8F9@8&MO8&IOZNHAHK6XOZBCM#K^\/WV?G?_^GIY_/
-MTP/C:V+N3DY._AY^SNY2<O(".HH*:NL+2\OK2S\WYS\WJ?>G#WNJRFZF)H8&
-M!D8V!B8>[N+:ZEL;*BH[`Z\/;\_?IW^/;\^_CW,#(SN*8E+N[NX.S@XNDJZN
-M`AHZ"JNKB]L;*ZN;SX=?O\<71Q\O2^I*[MZFYF9F!K:&'KZNHCHKF[LJJCOC
-M<^^/SW_??\^/#\^/D^-[ZSH"TJXN+F[.;JX2$G*R@IJ*ZBJ+VV/;>WOSW^?_
-M_P=')\]#BVHB#GX>)N;FAH8FGD[28B)*N\LJ"Z.S$Z\OCS__3\]/3P_O\X.C
-MR\KB,A*N[HZ.[J[2$A*R8AI*:JI+>SM[>SM;#R<?_V='9Y^O>VLZ+CX>)N9F
-MA@;FIG[N`AHJ2PNJN^.S+X\O#W\_#P^/CX\OLX.C"PH:`K(RTNXNKBY2TM)R
-M`J+:>HHK2_L;(X/#+_^?_W^GI_^OV^NZ0NX./AZFIEX>?K[NLJ(Z*NN+2]OC
-M0U.34P\/[X^/+Z\3LX.CRVKZXK+RDM+2DC+",I(RXIKZ^FJ[VWO[V^.#,P^?
-M3[]?I[\3&RJZ`FY./AZFIB:FGLXN0IH*Z[N[.WOCD^\O+P^_SX^/+Z^O0UN;
-MRPK:`G*2DE*NTA(2,K*R8MJZ*HN[6X-C@X.#`X,CX_/O[U-3KY-C"VHZ@A+N
-MCLY.OKY.SHZNLB)ZZCM;(X.3+Z\O[R]3<P,C>TL[NPOKJRK*.AJBVMI:HN+B
-M6GHZNHKK"\L[>QM;VYO[NWN;RVO+V]L[NYLC&VOJZ@J:XK(2TM)2KE+20B(:
-MNFJ+&X,#(V,SLR-[FYO;FWO;XUO[.TL+*VI*2@JZ6F)BHAH:&CH*JVN+BVM+
-M.SN[:TN;>\OKZRMKZ^JJ.YM[.TM+2^MJRLJZ.GI:@N*B6B(B6IHZ^OH**JJJ
-MZPN[F]NC(Z/C0V,;(X.C&SL+"\LKRLKJ:HH*.IJ:^CJ:6IJZ2DH*:JN+B^N+
-MR[O[.\M+NTN[.PMKRTMK:KKZ.IHBXJ+:FAK:&CJZ2NHK:TO[>QNC(Z,C@X.C
-MHYN[^WM+BPOKJJJ*.GHZ^IJ:VAJ:&AHZ2DIJJ^L+N[N+"[L+*ZMKZRMK"XL+
-M2XOKR[L+BVN+B^LJ:HI*2LJZNDJZ^OIZ^DK*"NJK:TN[2SN;6UO;6]M;VSM+
-MNXLJJJL*.KI*2DJZ2HH*2DK*2CIZ>KKJ*BKKNWO[^QO;HQM+R[O+JBKJ"HIJ
-M"LK*:JJJZHIJJZMJ"BKK:RLJJFOKJBMK:TL+*HHJJFJ*BBIK:VN+"XL+2POK
-MBVMKBZNJJNH*"LJZ2NHJ:BHKZRLK*ZOK:RNJJRKJZBHK*RN+"POK*ZLJJZJJ
-MZVMKBPMK*BHJZHK*>OIJ:HKJJBOK*ROKBXN+:VOKZXO+"RLKZVNK*JJJJBHJ
-M*JNJZNJJ*BHK*@H*B@J*ZJJK"POK"[O+"\O+"RLKZRLJ:NKJ:FKJ*BKJBBHK
-MZHHK:ZNJZJKKZRLK:\MK*ZOKZ^LKJZJKJNKJZJKK:ROJJJNJJFIJJRMJRHHJ
-MJRLK*XO+RXOKZROK:RMKBVLK*ROK*RJ*BBHJZNKJ*JJJ*BHJ*FKJJJOK:^N+
-MB^OKZZLJ*JJKJZHKJRJJZZLJZBJK*NJJJJLKZVL+"^LKZRLJZNKJZFHJJZKJ
-M:BKJJJNKJROKJZJKZXMK:[L[:^N+J^JKJZJKB^NJ*@H*BLJ*:HKJZ^OKBVOK
-M:VNJ*BJJ*BHJJRNJJNMK*ROK*RLK*JKKJFKJJJNJ*NHJ*RN+RPL+B^L+"ZOJ
-MJBIJB@KJJBKJJRNJJBNKJBJ*ZJOJJROKBXOK*XL+ZRHK:RLJZJLK*BKJJJLK
-MJBJJZFHJ*FKJJJNJJRMKRPMKBXN+BXLKJBJ*.KK*"FJKJJOK:RLK*ZIJ*BKJ
-MBBHK:VN+2YL[2SM+"VOKJJJJZHK*RLK*"HKJJBHKBVLKJNIJZJJJJRMKBXOK
-M*RLKZVLKJRKJJROJ:BNKJBMKZVMKZPN+ZVN+JNHJ*NH*RLJ*:FIJ*JJK:NHK
-MJ^NKJNL+BVN+B^MKRVOK*ZOK"VNJZVNKJJLJBHK*RNIJ:JHJ"HHJZFJJJRN+
-MB^MKZZLK*^MK:VMKB^LK*ROK*ZHJJZKJ*BHJZNKJ:JLKZFHJ:NJKJ^N+:PO+
-M"XOKJJHKJBJK*BJK*JIK"RNJ*NIJBHKJJJJKZ^NKZVN+"XOKR\OKZRNJ*RMJ
-MZJLJ*NLK*FN+JRKJZBOJRLJ*:BKK*@IKRRMKBROK"^NJJBNKJVJ*JJNJ*NHJ
-MJZNJJBMK"\LKJBOK*HHJJBJJ*JJ+BRLKZ^MK:ZOJ:FKJJZHK:VOK*BHK"XLK
-MZVLK*ZJ*:JNJ:FHJ:RNJJNKJB@K*"FKJ*JLKZVO+2PL+BPL+:RJJJBJKJRJJ
-M:RLJ*ROK*^KJ*ZIJ:BJ*:NHJJ^NK*VOKBPOKZPN+*ZHJZNKJ:FJKJROK*RJJ
-M*^K*BBIJJZNK:\M+BPL+"^NKJZJKJBLJ*BKJ*JHJ*BLKJNIJ:NIJZNKJ*HH*
-M*JNK*^OKBPL+R\L+R\N+*^L+*ZJJ*FKJZHIJ:@K*"@J*:JNK:[L["XO+2^NK
-MJRHJJRIJ*NKJ:FIJZJJK*VN+"^LKJZHJJJHJZVMK:^MKB^LJ*NJ*B@H*BNHJ
-MZBHJJJOK*^N+NTO+2TMK:XLKJROJZBIJZFJ*NHKJ"BJJZBN+ZVMK*RN+BXL+
-MBPN+:VMKZZKJBHKJZNIJZBHJZNKJZJNJJNL+*ZJK*RN+ZRL+B^MKZRHJJXJZ
-M"@I*ZBNK:PN+"\N+:XLKJNN+JZJJ"HHJZNKK:ROKZZLJZNHJJBJJ*^OKZVOK
-M*^NKZBHJZBJJJZJK*RHJ*NJJ*^OK*ZLJ*FKJZJJKJBJJ*^OK:VN+RXNKJJNK
-M*BJKZXN+JVJJJZIKZRMKZRNJB@H*BFIJ*BHK*RNK*VL+B^LKJZJJZHIJZNJJ
-MJ^HJZRNJ*VOK:VNJJ^NK*FIJ*FMKJBHKJRJJJNJJZRNKJZNKZVOKJZLK"ZOJ
-MJZNKZ^LK*ZIJ:JJ*RBIK*ZLKJJN+:RO+2VMKJFIJZBJJJJOK"VNK*ZKJ:FIJ
-MZNJJJZNKZVMKB^OKZXMK*ZNKJNIJZBHJ*FJJJZHJJ^IJJZJKZRNJZ^LK:PL+
-MRPN+BRNJJZIJBHJ*ZNIJ*JLJ*BLKJ^NKJBLK*BJJ*VOK*VL+:XL+B^OK*ZJJ
-MZHJ*:HJ*:BKJ*JNKJJLJJBNKJROK:POK:\MK*RMK:ZKJ*BHJJJHJJJLJZNKJ
-MJROKBRNJJJJKJZJJ*^OKZ^NKJRLKZVNKZFJ*:FJ*RHHJJFN+"PL+"PN+:^MK
-MBVMKJRJJJZHJJZMJ2@J*:FJ*ZJNKJZLJ*JJKJBN+BPL+:^MK:VOKJZIJBHK*
-MRFJJJZHK:XL+"XMK*RLK*RJ**BNKJ^MK:^LKJZNK*NJ*"HJ*ZBJJJ^MK:^NK
-MJNM+ZZOKJBHJ*RNJJZNJ*JHJ*BKJ*JLK*^MKZVMKJZNK*RNKZRNJ*NIJZBKJ
-MZJNJJZJKJVOK*^OK*ZJKJZKK:^OKZ^NKJ^J*ZJJJJROKZ^OKZ@HJJJHKZVMK
-MZVLKJJJKJHJ*:FK*RFHJ*BMKBXMK:^NKJZNK*JHKZRLK:XN+B^NJ*BJ*BHH*
-M2FHJ:HKJJBN+:VO+RPL+"XN+B^LK:RLJ*FHJ*ZKJZHIJ:BKJ*JHJ*JJJJJJJ
-MJZOKBPO+"XMK:ZLJZFKJ*BKJJBOKJRLKJJJJZNHJZFHJJJHJ*VN+ZZOKZ^LK
-M*JKKZ^MKZZNJJRKJ*JJK*^J*JRNKJZJJ*^OKZPL+BPLK*NHJZNKJZBJJZNJK
-MJRHJJBHJJZHJJ^NKJZNJJBOK*^OK*VN+*RLKJZNJ*BJJ*BHJ*BMK:^LKJBLK
-MZ^LK*RNK*^NKJ^NKZFHJ*NKJ*JJKJZNKJNKJ*NKJ*JLKZXN+:VN+BVOK*RNK
-MJNHJJNHJ*^OKZ^LJ*BIJBFKJ:FKJZJN+ZVL+"^NK*RNKJJHK*RMKBXNKJNNK
-MJJNK*FIJ:HJ*BFIJ*JHKZRMK"PN+BXMKBXOKJZJKJ^NKJRLKJRKJ:HJ*RLI*
-MRHIJZJJKJVL+"PO+2TL+BVOKJZLJ:NKJZBJKJZLKJJMKJBLK*BJJJNHJ*JOK
-MZ^MK:PL+ZZJKJRKJ:HJ**JHJ*NMKBVOK*ZNKJBHJZBLK*XMK:^OK:^NJJJHJ
-M*NJ*"HIJZBHJJROKZZNJ*RJK*ZJJZNJKJZJJJZNKJRLKZXO+BXN+:RNKJZLJ
-MZJHJ*JHKJJJJJRNJ:FHJZFHJ*JJKJZKKZRMK:^OK*RIJZJHJJROKBPL+B^NK
-MJBNK*JHJ*NHJ*JKKZZJK*FKJB@KJ*BJJ*^OKBXN+"XL+"VMKZVMKZZLJZFIJ
-MBHIJ*NIJ:BKJZJHJJJLKJZNKJZOKBVMKBPL+R\L+:^NKJJKJ:HJ*:BKK:^MK
-MBZIJ*NHJ*NHJ*JJJJJHKJJOKZ^MKZ^OKJRKJ*FKJJJLK*RNKJRKJ:NKJ*JHK
-MJ^NK*^MKR\O+"XMKJZLKJZHJZHH*:FKJZBHK*ZNJJZLKJZJK:XLK*ROKZROK
-MJZJKJRHJJNIJZHJ*:FJJJZNK*XO+R\M+2\MK*ZKJ:HIJ:NJJJZHJZBJJ*JJK
-MJJJJZBHK:^N+Z^MK:^MK:^OKZRNK*ZLJJBH*:JHJJNLKJJNJJZNK*ZNK*ZNK
-MJJJKJZNKJRKJ*NKJ*JNK*^OK:VMK:^LK*ZNK*ZOKZRNKJZLJJZKJZJHJJJKJ
-M*BJK*^OKJRIJ"HKJ*JLK:\O+ZVMKZROKZZLJJJOKZXL+RXLKJZHJ:HJ*"@H*
-MBNKJ*JJKZ^OK*ZLJ*BJJJJLK*ZNK*^MK:XN+:VMKJRKJZFKJZNJJZXN+BPN+
-M:RLKJRLK:@K*NDH*"FJKZ^LK:VN+BPO+R^NK*NH*2FIJJXL+2\N+*RNK:NKJ
-M2OHZRFJKZ^MKBTL[*VJJJJJJJ^N+.XLJJZHJZBMKZDH*ZNL+JZJKJNJK:^M+
-MFS.+OM)+F^NFAO]WBIHJHF>'KD:RMZDF*&[GJ6L6Z+Y'IX*B<R..WA+O?Z>[
-MIHLOPIY>OM/W/Z<G.^JOJA+Z#BXJ.T*F9G[J&^/OOP\;^L)+@TK""Z]/SX.K
-M*UHB^GX.^BH**^LB@U/BZMOZ&P-#>II3>U.;,O*Z8LXRRZ_#NN[JHR.3.ZKR
-MJMNZ2VJ[6[.;HOL+HEKRH@):NZK+8T.3<\LB>UL"KBY:*JNJZDOC:TM["\IZ
-MJBI+2MK[`R.Z8EOCVPNZ"TL*.CJBFNOZ2Y,;RFKJ&LH;:F)*J\MJRHHJ`[/K
-MFKHC&\M*(N.#BP)BN_NJ^NK;BGJZ(EH*^ZL+J^J+2_OJ*XJJXX/;RKHJJXN+
-M"LHJ"DOCPZI:BZH*^GJ:*COZ^OM+"SNJ.FI+2VO:6BI+FZJ+"RH[BPJB*JOZ
-MBXL[VPM[2RM+R@+ZNRK:NFJ+>WN*2JHJ2NH[:PHKRHN;JXH+F[L[ZCJ+"XIB
-M>FO+"ZN:&ON#RPH*.CO+BFHJRZNJ2ZO*RHO[2ZO**CL+RHJJ"XJ:.@J*NJMK
-MJB-+:YO+:TJZ"FIZB@OKR\LK*VLJBBIJZTOJRWL[.ROJNBKK*ZNZ.LKJJVKJ
-MRPLKJPH*2NIK*NK*BZ,;^[NJZRN*JFJ*2FI[:PMKZFO+RZKJJZO*>J+*ZHOK
-MZPNK>\L*2DJZJHNKJSM+JRJJBRMK*PJJ:XMJJJH*JNMK*^HJZZOJJJH+>\OK
-MBTOKJ\IJ:LKJJVLKBZHJZVH*ZHKJ*VMJRFO+B^HJ*XM+ZNH+.RN*:BM+ZPH*
-M*VL*"DH*JXN[:ROK"ZJK:ZLKJRJJJJJJ*ZKJJBOKJHKJJFNK:HHK:^OKJPN+
-MZZHJZUINTN+ZJLM[6R/C8^/CH]N;^[O+BVNKJBIJB@K*RDI*2DI*RLH*"HJ*
-M:FKJ*BJJJJLK*ROKZ^OKZ^OKZ^OKZ^LK*RLK*RLKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-9JZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-`
-end
diff --git a/share/isdn/8.g711a.uu b/share/isdn/8.g711a.uu
deleted file mode 100644
index 1e0fb029a72d..000000000000
--- a/share/isdn/8.g711a.uu
+++ /dev/null
@@ -1,322 +0,0 @@
-begin 644 8.g711a
-MRVLJ:NJ*"FKJ*BHJ*BHJ*BJJJZNKJZNJJJLKZVOKZXN+B^LK*ZLJ*NIJ:FKJ
-MZNHJ*BJJ*JNK*^MK:RLKZRLK*^OKZ^N+:^OK*RNK*NJ*BHK*N@J*BJHKZVL+
-M"PN+:XN+BVOK*RNKJHI*:BKJZNHKJZJKJJNJJJHKJZJKJRMK:XMK:VOK*RNJ
-M*FIJ:NKJJBJJJJKKZRNKJNLKJFJ**JOKJZLK:JMKBXOK*ZOK*RIJ*NLK*^LK
-M:^LKJRHJJ^HJZFHJ:JJK*BIJ*POK:VOKZZNKJNJJZNHJJBNK*^N+:^N+ZRK*
-MBBKJJZHK*ROKZ^MK:XN+*ZOK*ZHJZBJJJRIJ:BHJJBHJJRNKJBKJ*BOK*VN+
-M:VN+"RNKJZKJ:FKJZBKJ:BJJJRNK*RLK*ZNJ*JHKZVMKZVLKJRLKBVLKJJKK
-MJBKJ*JHJ*HIJJRJJ*VMK*RHJJBNKJBOK:ZOJ*JN+"^LKJJLJBNHJJJOJ*BHJ
-MZNJJ*RMK*ZOKZ^LK:\N+BRNJJJJJ*BJKJZJJ*BKJZNIJZNKJ*JJJZ^MKNTMK
-MB^LKZVOKZ^NKJJHJ*JLJ*BHJ*HH*:BHJJJLKZ^OK*XM+N\OK:XOK*BJKJZHJ
-MZBJJ*BHJZNKJ:@J*ZJJKJ^N+BXN+"POK*RLKJRKJJJH*"NIJB@J*ZJLKZVO+
-M2PN+:VMK*RNKJZOJ*BJK:VN+:^MKJRJK*BHJ*BKJZNIJ:FHJ*BJKZ^LK*RLK
-M*ZNK*^OK*ZLKZ^NK*RMKZZLJ*BKJ:BLKJBNKJJHJ*BJK*RNKJZNJJJNKJ^OK
-M*ZOK:VLK*RLKJRJJJRKJ:NHJJJJJ*^MKBVMK:XN+ZRNK*ZLJ*NKJZBKJZJNJ
-M*BHJ*NHJ*JJKJRLKJBN+B\M+B^LKJJHJ*BHJJJJK*^LKJBJJJBKJZBKJ:FKJ
-MJ^OK:PO+"XMKBXN+*ZJJJBKJZJJKJRHJ*BKJBHIJ*JJJJRNKJROKBPL+"\O+
-MBVN+ZRJK*FJ*"@J*BNHJ*NHJJJLK:XN+:^NKJZNKJJOK:VOKJROKZZNKJZKJ
-M:HIJ*BJJ*RLKJZOK:VMKZVOKJZNKJZNKJZOKJRHKZZNK*BHJBDH**NIJ*JKK
-MBXL+BPN+ZRLKJBHJJRLK*RMKB^NK*NKJ:HH*BNHJJBLK*RLK*ROKZROK:XMK
-M*ZJK*RNKJJJKJJNKJJKJBFKJ*JJKJRLKJBJJ"PMKRXOKZRNJ*NIJ:HIJZNJJ
-MJZLKJZNJ*NKJ*JJJJROKZVL+RPN+BVLKJZNKJZKJZBKJ"FHJ*BJJ*^LKJROK
-M:^LK*^MK:XO+R\MKJ^KJ*HJZ2HH*:JJKZRLKJZJKJJJJJZHJ:NJJJZOK:VMK
-M:^LK*^MKZZNJJRHJJZNKJJHJZNKJZNJJJJJJJJNKJZLKJZLK*^MKZ^LK*ZNK
-MJJNJJ^NKJVNJ:JNJ*BJJ*ZLKZVOKJBKJ:BJJJJJJJJNJJBHJ*[NCN\IJJHL*
-M^@IJZDH*JXMKJZIKRPNKJ^MKJ^HJ*^LKJVN+:ZKJ:FIJ"@IJZNKJZNMKJRN+
-MR\MKJ^N+:VOK:VLKJBHK:^LKZ^LK*FIJZFJ*R@J*:BHKRTO+BVLKZHJ*:JJJ
-MJJHKZ^MKBPMK*ZHJZFIJZBJK*RLKZXN+*RN+"^NK*JOK*HHJ*FIJZBIJBFJJ
-MZ^N+BXMK:RNKJJLKJZNKJJNJJ^MKZRLK*ZLK*ZKJZNJ*"FHJJVL+BXMKBVOK
-M*RLK*RJ*BNJJJJNJJJNJJBLKZZHJZ@J**FHJJBMKBXL+B\L+"XOK*ZLJ*BJJ
-MJBHJJJLKJRHJ*BJ*"FHJ*BHJJZNK*VO+2PL+ZRLKJRKJ*JNJ*NKJJ^OKZVLK
-MJBKJ:NHJ:FKJZFJJ"\O+.TN+:ZOJ:NHJZNKJ*BJJJ^MK:XLK*ZNJ*BHKJRHJ
-MZJNK*^MKBXLKJZHJJBKJJZNK*NJJ*RLK*^OK*ZKJ:FJ*:NHJJJJKZXL+R\M+
-M2^MJZJLJ*JJJJZLJ*BJJJJJJJBHJ*JJJJ^OKZ^LKJZNKZXN+BRNJJJHJZFKJ
-MBHJ*:BHJJROK:ROK:VL+"PL+:VMKZVOKJRKJBHH*"@H*BFHJJHMK*XMKZ^OK
-MZ^OK*^LKJBIJZFKJZNHJJJOK:XN+BXMK*RHJ*JJJJJHJ*BHJJZMK"XMKZRNJ
-M*BHJ*JJKJZNKZ^MKZRLK*FIJ:NJJ*JJK*RNK*BN+:VN+ZZLKJJJKJZNJ*BIJ
-MZJJKJZJJZ@H*R@KJJ^OKZ^OK:PL+"\N+:ZNK*ZNKJBKJZNKJ:FIJ:HJ**JLK
-M:XMKZ^MKBXN+:VMKZ^LK*^N+J^KJ:LK*"FKJ*BJK*ZNKJJNK*RLK*RNKJJJK
-MJJHKZ^MK:RNK*NKJ*JNJJRLK:^OKZZNKJBKJ:NKJ*JHK*RNKJRLKJZLK*ZLK
-MZ^MK:^OK*VHJJRHJJJNKJZLK*ROK:VN+ZRNJJJNKJRKJ*JJKJZHJ*BHJ:@J*
-M:NKJ*JJKJRMKBVMK:VOKZ^OK*ZLKJZNK*RLK*RNJZ@H*BHIJZBJK*ZMK2\O+
-M2PN+:RLJZNJ*:FIJJJJJJZJKJRHJ*JJJ*JLK*^OK:PMK:^LKZRLKZRNK*BKJ
-MZBHJZNKJZNHJJRNKJ^OK*ZNKJZJJJJOK:XN+"PL+"VLJJJKJ:HJ*BHKJZNKJ
-M*JOKZRNKJ^OKZ^OK:^MK:VN+:RNJJJJK*NKJ:NKJZNIJZBHJ*NHJJJLK*^OK
-M:VOK*ROKBPL+B^NK*BKJZNIJ:HJ*:JHJ*BNJJROK:^MK:^MK:^OKJZJJJJNJ
-MJJHJ*JHJJJJJJBHJZJJKJ^OK:PL+"XN+:VMK*ZNJZHH*"@J*:NHJ*JJJJJLK
-MZ^OK*ZNJJJLK*^LKJNMK*VOK*ZNJJBHJJBOK:^LK*RNK*JJJJJJJ*NKJZBJJ
-MJRLKZRLK*ROK*RLK*^LKZ^OKZRNJZNKJ*JKJ:FKJZFHJ*NHJJJNK*^OKZVMK
-MZ^L+JRHKJZJJZNIJ:FKJ:BJJJROK:^MK:^LKJZOKZ^MKZVOK*ZNKJJHJZFJ*
-M"LH*:NJKZVMK:XN+:VMK:VOKZRLK*ZNJ*NKJZBHJJJNJJJJK*FKJZHHJJJLK
-M:XL+"POKJJJK*ROKJZHJZNHJJJNJJNKJ*BJJJBHJZBJJJBLKZXL+"PN+BXL+
-MBVLKJVJ*"FHJ*JNKJBKJ:FKJ*BKJZBJJJBN+^[N[NPN+ZZNKJRIJ:HH*"HJ*
-M:BHJ*BHJJRLK*^MKZRLKBPO+"XMKZ^LKJZJJ*BJ*"@H*BFHJJJJJJZOK:VMK
-M:VOK*RLKJRLKZ^OK:VOKZZH*BFH*"FKJ*BKJZNHJJ^MK"XMK*ZNKJZNKJJJJ
-MJBLKZRNK*^NKJBHJJJLKJRHJ*NJJJROKZ^OK*RLK*ZLKJZLJ:FKJJNMKZRNK
-MJNKJZNKJJNNJ*JNJJBLKZ^OKJZNKJZNKJZLK:VMK:RNKJRKJ:HIJZBJJ*BHJ
-M*JJK*ROK:VOKZXN+:^OKZRNKJBKJ:NHJJJNK*ZLJZNHJJJJKJJNK*VLKJFL+
-M"\L+ZZNJ*NKJ:HIJ*JJJ*JJK*RNK*NKJ:FHJJRLKZ^OKZ^MKZRLK*^LK*ZLJ
-MJBKJZFKJZNJJ*VOKZ^NKJBJJJJLK*RLKZVMK:XMKJZLKZHHJ*JHJZNHJJJJK
-MZRNKJZNKJJHJ*BLK*RLKZ^LK*^OKJRHJ*JJJ*BHJ*NJ*BFKJ*JHKZVMK"\L+
-M"VLK*ZLKJZJJJJNK*BKJZFIJ*BJJ*@KJJBJK*^N+B\M+RTL+:RLJZBIJ:NJJ
-MJJJKJZLKJZNJ*FKJZNKJ*JOK:VMK:XN+B^NKJRLKJZNJJNKJ*BJJJZLKJZHJ
-M*NKJ*JJKJRMKZ^MKR^LK:RNKJZHJ*JHJ*JHJ*BHJJJNKJZLK*^OKZRLK*^LK
-MJRLK*RLKZ^OK*ZNK*NKJ:NHJJJNJJBHJZJJKJZHJ*BHJJ^MK:VOKZVMKBVN+
-MBRLJJJLJ*NJ*:FH*BFJ*:NHJJJOKZVMK:VMK:^OK:VMKBXMK:VOK*ZLJZHIJ
-MBHJ*BFIJZBJJ*VN+BXMKZROK*ZJJ*BHJ*JNJJRLK*ZNKJBIJZJNJ*JNK*^OK
-M:XL+BVLK*RNKJZHJZFKJ:NHJ*JJJ*BKJZBJJJJOKZ^LKZXL+RXMKZRLK*ZNJ
-MJZNJ*NKJZBHJJZNJJBJJJBJJ*JHJ*JJKZXMK*VN+ZRLKJZNK*RLKJZKJ:FIJ
-MZBJJJZNK*RLKJZJKJZJJZNHJJROK:XL+BVLK*ZNJ*BHJZFIJZBJJJZLK:XN+
-M:ZLK*ZNJ*BJKZ^OK*RNKJBMKJJJK*NIJBHJ*:NJKJRLKJJJJJJNKZVMKB^LK
-MZVMKBPL+*ZHJ:FIJ:NHJJJNJJJJJJJJJJJNK*RLKZ^MKBPMKZZLJJJHJJJLK
-MJZJKJZJJ:LJ*B@KJ*JJKJROK:^OKZVMK:^LKZRNKJJNKJZNJJJNJJBKJZNKJ
-MZNHJJ^L+RTM+R\MKZZLJ*NHJ*BHJ*BHJZNKJZBHJ*JNK*RNKJBOKZRMKR^OK
-M"PL+B^MKZZNKJRJ*B@K*"HKJZBHJ*BHK*^MK:VOK*RNKJZNKZVN+BVLKJBHJ
-MZBKJZNIJBFIJZJJJ*VMK:RLK*RNKJJJJJ^N+RTM+2RMJ*FK*R@IJ:FJ*BNJK
-MJROKZ^LK*ZNK*ROK:^N+"XMK*ZHJBHH*RHIJBFHJJJJJ*RNKJJJK*^L+"\O+
-M"XMK:VMKZZKJZFJ*BHJ*:BJJJBOK:PLKJZKJ*FIJJBMK"\L+BXMKZRNJ*NKJ
-MZNIJ*BHJJJJJZNKJ:BJKJZOK:^NKJROKZ^MK"^NKJZNKJZKJZBJK*JHK*ZHJ
-M*VOKJXKJJVJ*JNLK:NN+:^LKZXLKJBN+BRNKJBHJ:HJJZRNJZPLJ"BKJBFJJ
-MJJIKJ^HK:^LK"PLK*RNJ*BIJZBHJJZHK*RJKZRLJJZHJZRNJ*XNK*FN+:PL+
-MR[N+*^LKBLKJBKHZ2FHJ:JHKB\O+2PL+"ZLJ*BJKJRLKZXLJ*NNKZHHK*IKZ
-MJNK*B@N+*JO+NRLK"\NJZBL+ZVKJ*VL*RHN+JBHKZNHJ:FJJZXK*ZJLJJXM+
-MN[O[2XMKBRL*ZHMKZJIKZRNJJZNK"OI*:FH:^BH*FHHK"FK+RRL+RSM#PXN*
-MNXO"XHKJBOO#4^^O8[/3*^+:NK+R6EJ"XN):^OHB(MH"KJXR0J(K>ZLJ,P^C
-MZE./.VO;XY._D\.GYQ?YB3NO_T:X.&AH:$82KY_O3Z<?FI9&OC96IH,O+R?'
-MA\\[RSOBDLMS3Q^G-T>G7]^Z6V&!)N[YZZ``>,@@&"A;*7^#UXF/EK:2'A8F
-M<Y^?SU_'[Y)2ZO+>[BI[8V\G)Y\?9]\B*R-^SFIW03&_-R'K8+`@(+#@*,]I
-MMZEY^;,H-D9(^%ZI9]N).0?NP@H&5L8J0UHJIS?_B^^?+UIRRJ(BDO+*V3TM
-MH-FM6.PLF$#LH$89X=^YP:'H8`;H@`#6%YF!V5D!MR@(5A@@=HNG]U?)B:=R
-M[MJ&5O;.XH+/A^>WJ9EQT2->F49P$*!8P`@N=TGW-^G7ACAVEL@H[ZDWJ6DI
-M7RZFIF869GL#NG-G7WOJ6Y/Z[FJ*XBM3_Q,'44UW9G$W\"R`8%``.,_Y-Y=9
-M(</(QO88X&BG%V<)89EOJK,F2(@F_EX:7Y<W?__?8\ZFGJ;^BD,/Y]G-[;9)
-M\8@LT-APT""VZ>FW.8$Y-J@>R.!8+A_+QZ&AMS_G"G;H-B8&)NL'1Q_GMW]K
-MZX(^$J[.LC>MS;<?K<>PT"!`+$`8NY>G"8%ASUXJ-EC@:#*R2VFA"5\7AR:H
-MAE[6-I*#?W]_QX</TYO+.LXRF@^QS4FJK<F`\-@`[+"@A@^OJ2'A1SH/GDB8
-M*%[F(K<)EX>7YS+F#@ZV9B(K.]._/T_O3V^JP@J+KX$-H2L16:`PH(`L<&`H
-M"GJ7(>'7_\>2R+A6-JC^7W?'!U>7>YZ"2D8VFJM"(\\3SZ=/+T\O*@)7K2W[
-M.5$;``!XD"RP($8^"HGA&>>W=Z8(*$8H*-)/?Y]'J>>*JX-^EDY*+C*3SQ-/
-MGT<'2N__Q]%M?^FM/P!@^)`LL&#HADY7(1GWJ:FN5A9VB.BFRZ^_MRFW[\_/
-MKL9.[B9N:GIKG]_GMY<7$UF-`>8!P3A`F*"LD(#X1L9C^:'7!XE/-C;F%HC6
-MCGN;$S>IGY-?TQX>\KY^TJ+KVV,G-Q]'"8%ML6<Q(0B`H(#L4+#@");/^:&Y
-M2?D'6LZH^/C(Z`8BSQ?IJ2GWT^*N)I8VYGXR(Z?W*6D),8U!UW$A2&"@0.Q0
-M\&`XZ".YV3F9V=?/6Q;X.'CXZ"9B'U?IB6DWWP-NQO9&-D:",Z<I2<&-+1GQ
-M\2Y8H(#L[-`P8!A>J9GY68%Y=[=:N/CX(-AHQI*GUXE):1>W#PZ&9G:H!GZK
-M!VD!C>UAK1%O*$B`[.PLK#"`Z-_)>6%!X7GY#VB(&`!@&#A6LP?I>?FY2?>+
-M^GYHJ+;6?E^)<8WQ\8T!0^8H,.PL[*S00&ASE_G!08$!(4^FQJ!`@.#@2'Z#
-M=TEYV9GIMR>N=K96*"9#(2VQ08V1"<?C&!#0+"PL4(`(/@>A@8&Q\5E/3Y[@
-M`."``/@&8J=IF:%Y24E'JZ+FJ)9F2X%Q27%MH:GI(R!`\*RL+!!@.!9G&:&!
-M<3$9B==F&*!@P(#8B&:SE\GY>1FY%X?_SH;./M=Q>>GMP4?IJ19@(/"04%#`
-M(!BV=^FY`3%A^?D7A@BX((#@F,CV:H<I"?D922FI)R)*HMHA`2^!45<'Z2^8
-M&.`P,!`P8*#X`D='><$!H7GY9X;6""!@6)@X]OI_]XGY.0F)J:>OXSIIL2EW
-M45F/%_?6H/@`0'#P@""@J*^/5R&!(9D9R8->1DB@6)@8R`:2<T=I2;FYR>G'
-MY^\?`2$BP;$S)_<B6+C@`$!P@.`@.'ICGWGAX:&9&9<NSG886/@8F*@F[A/W
-MZ8G)B0DI9X>?";%7M]%)VS=GZ-BX``#PL&#@H-8K"I>AX:'9H4F_B\Z(F/B8
-M6$@69K+_ERF)R;E)B6>_Z:%9XV$!"X='RI@(&(``L.!@(+@>3C,)F5FAF9D)
-MKXL^B#A(F)AHU@;B#P>I:8D)Z:D7)RFQN:]QV:-W!V8XB.#@L+!@@&`(IH:_
-M"7FAV5DA*9_?3@B(R-CXZ"BV@N\G]^D):>EI%U^7@:&+P6&J]X=NN&A8(`"P
-MX&#@N,:V2ZFY&7E9(>FW1UJH5FB8^`B(*-YJTP>I:8F)B>E'J8$A$P%A2Y=G
-M;LAHH.``,&"`8/B6UKHW:9E9F2%YUZF_!K;6^/C(2&A&GHL?QZF):8EIEP?7
-M(=F;82'J%V>N:*B86&#`(&#@^):H$N<7N9FYH1FIJ<?2YF9H2`B(B*AF4JL/
-M1Y=7:6F7]VGAH?^!X4]WI]N(Z#B@@,`@@&"8*.@^3_<)F3E9(8EI5[/^WJ@(
-M"$@(*';>VKNGMQ<IZ2G7J4EA*;<!UV_W#X;65AAX8.`@8"`(:"@:3X<)F4G9
-M&8GI=^-R'M;H:`AH*-9>4CK_!_>I::FI5\EA5Q<!%]\7WR9&UO@X8."@8&#(
-M2(C.V[]IN6FAF0E)Z9^S"H8VJ&CHZ"AFIKYSGZ>7J1=7UW?Y6:=)H2?GM]/&
-MIBC(^""@6""@"$CH/OOO*2EI&3F)"2G?_QM^YD:HUA96AB;.JZ_/1W<WUZDW
-M%_F)OTF)LV]_6K8FJ.A(>/BXF#@H*);.>X/'-Q=I::DIJ><?#XKN#N8&AN8^
-MKK(+[\\?Y^=?Y]]_SP]_']N#SYOB6@K.'AZF!@;&1H:&IGZN,DJ[H_/OCP]/
-M[Z^O4\,#XQL;.\L["ZO+BZH+RXN+.SL[VYN;.[N[JVJ*2AJB(J*B6GKJ*RO[
-M&[N+^XNKZKJZ>N*"HH)"PF+BHOJ*:NJ+RTO;X\/#\W/S,[-#8Z-[N\NJ2KKZ
-M6J(BHJ(:2LH*JNOKRSM+RSM+B\N+*RIJ2KHZ^GJ:>GKZNLH*JXMKRPL+2[N[
-M.SL[^TL+B^NJ*NK*2FKJZJKK*ZHK"XMKR_N[BTN+Z^NK*BH*2HJZ.@H*RHHJ
-M:BHK:PN+BPMKZ^LK*RN+ZZOJ:NK*"HH*ZNK*BJKJJPM+"\L+*^OK:^LK*^NJ
-M*JNKJVO+"\O+BXN+:^LKJZHJ*JHJ*BHJJNJ*:NHJ*NKJBFKJ"HHJ*ZJK:VLK
-MJXN+:ROK*BHJ*HJ*ZJNJ*[L[R[N[^SM+"PMK*RLJBFJ*"FIJ:JJJ*BHJ*FKJ
-M*BJJ*NJJJRLKZ^LK*RNK*BKJ:@IJ*JJJ*VMK:PM+2TM+"VN+ZZLJ:HJ*B@IJ
-M:FHJZBJJBFJJJBJJJZOK:PO+2TM+RXMKJ^J*"@K*BNHJ*JLKZRNK*ZNKZRNK
-MJZNJ*JNJ*JNJJJNJJZOK*RNK*BJKJJJKJROKZ^OKZROK*RLKZRNKZFJK*HHJ
-M*JHKZVL+RVLKJNKJZNKJ*NKJZNKJ:FJJZ^OK:XMKBPOKZ^OK:VMK:^OK:ZNJ
-MZHJ*"LH*ZFIJ*JNJZ^LKZ^MKZROKZ^OK:VOKJZHJJHJ*JNKJZHIJZBJJJRNK
-MJRLKJBN+B\O+"VOKZ^LKJZJKJZLK*RLKJBNJ*NIJZBKJ*FJ*ZBHJJJJKJNMK
-MZXN+Z^NKZNIJZNIJZBJKJRMKBVMK"XLK:VMKBXMKZZNK*NHJJNHJ*NIJBFIJ
-MZBHJJBJJJROK*RLK*ZLKZRNKJRNK*RNK*ZNKJZNK*ROKZRLKJZHJ*BKJ*JHK
-MJ^OKZ^OK:^MK:ROJZBIJ:BKJ*JNK*ZHKZZNJ*FH*RHKJJBOKBPO+R\L+"PMK
-M*RKJ:HJ**J/S+H(+,J-BNZMJRVI[:FLKRPM+:[N+2ZKKJXIJ*HHJ2JIJ:BMJ
-MBVN;:PN[ZXOJJBLK:HKJRHK*BNJJJBHKJBNKJPL+JROJ*ZHJZRMKJHLK*ZJJ
-M*JLJ*FKJJPJ*JBKKB^L;JSNK2VMK2PJ+R@N*JHKK*BIJ:RNZNX.GVWZF?NZ"
-M6H/#FX,SCZH;R_O;>S.Z9T-FVHZ"XM)C+EN2"S-BXSLC2QNK6ZH#FBK#^B/2
-MJVL2HS(+F@JKFF-B^WIC.MO:#^[_CI/ZX[IZ$[(3#@_2KVY/KM.BNSHJ6U+_
-M`X>.KF9^YHY:FT]2AS,O4XLO&WO*ZGLK#DL:Z@HZJON2ZR+;&U)[B[L**RI#
-MRIN*HQOBBNIZFQJ+JWJC^MK;VN,Z\_O3(RJJGEJFDH)[BJ]#KV^CKQL[FR++
-M.NNBVH++F@*;[INBRPI;BPOJLVL;,WJ#ZHOZBQJN6P([$J/:"CO:`[HKNK,C
-MVBM*"PI[&PMKRH([8ZO[<N,ZP[J*[U+:.HKS^BI+N\..F@K[FK(#BB/[LO.*
-M<V[3KRJ;+GNB2U+*VRKKTI-[DUH+6[MZ"H)+ZDLR2[.N:S*;.WI+FL_"&LOJ
-M+\**FSM;KHK3BS/";WL*&OI+NG(B&VJ2&WIOVJHZ2X.BBBK;(DN"$TI**UMO
-M>@,*DVL+0H(C#J("^XMB^R);BPI*K\ORL[I#XDLZ._.K*OH/<KLBZZJJJ_*O
-M2G.""GLNPU)[VI.*[H\;BZ*/3JM#PF(C\PX[$\+[<PJ"JXH.+PN:@E/:$M/K
-MJWN_:F-SPKOK6@ZC2S(C*L(K2AX#[RJ:[XN::KY+CZ^2^L][@AHJ(PLB2J-C
-MVZZ;B[LRSB,"+Y)J*N-:\DN##TI+ZK.*KEL;&UIZN^N+*ZK[$DL"NJ(JDZHR
-MV]NJ.H(;BH]Z"V/O:\+CXT+B*AO;@HZ:LZH.FO,;&V);2]LB?H_KFTYK>UM3
-M8D-SPZMZ"]JKSJX[SVKB.[/;@NHZ#WKJKCI#&KK:XX,2@KNOBSK",RK[,KKS
-M"GMZ#WI[XM*J.@O:.SM+NDLK6\N;@NK[^HL+:J.+:N+*"YKCVEMJ+^J:RZ*C
-M;KI..LK"LZO_.CMCLX,*^FNSHK+;0[LKJAJ;JF+ZZ\ORZDMC.SNZ*FLZHE)[
-MRHJR`],*:ZM;*OLJ*DO+*UJS>FIK>@+ZNYJ*JAM+,TK;,^O:8JNB*DM+H^K:
-M^BN#J]M["IMK.T*:&B(+ZBJ*`ZOJXR-KZBJ"JPMRPBM+NEO;&[.C:^KC@OKJ
-M:VMJZJX*"OH+RWN*>YH+(YLK&BK:2RJ*:N.;"NJJ2RJKR@LK*N)*"VIJ"LIK
-M^VNKRR-KJ\KJZBJKJ^,;&PM[.SNKVGK"HD+:.NM+J^K+@[L;2SM+*LHZNRN:
-M6HJKRXMJ^]N[RBKJ*[N*@C)*^HJJ:TO[2PL#LYM*FKK*6N*ZV\-C2PL[*CK:
-M"FKJ"LHJ*RNKFX/;J^OJ"@HZZBJ+:NJ*^@I**NN[N[M+JHKZ"@KJBWNCH_M+
-MZVMKJ\I*2KJZ6B(ZJPL+N_L[NVNK2@JJ:NJ*"@K*ZNH+"WO;6_O+RVKJ^GK*
-MZJJJBWL[ZVM+"^K*NGHZNCI*JJMKJNHKJ\L+FUN;2RLJRGJ"VCHJ:\L;>]L[
-M"^NKZDIJZNKJJRLJ*ROKJJJKJFJK"^OJBJHJJJJ*2KJJZFJ+^SO+2XN+BZN*
-M*NLJBHIKRSO+:VL+B\KZFKKZ.NHJBTL+ZZJJ*BJK2PL+*PN[ZVI*RNJK*HJJ
-M2SNJRLHK"ZH*NJN[RZJJ.WN+:@HJ"PNK*JOKJHJZNCJZRKIJ*JNKZ\L[VTLK
-M*JKJ.OKZ*KL;.SN;>SO[RZLKJVKZ>CI**BJJJNHJ:JHK:^LK*RNJ"HJK*^OK
-M*RMKBVL+NVNJB@K*2@I**NMKR\N+*JHK:^JZR@HJ*JHKZXL+.TL+BXMKZVLK
-MJRJJJZNK*HIJ*NH*2LH*ZFLJ2BI+NVLK:^MKJRIKBXNKJBOJ:NJJJBLKJBOK
-M:VNJ:FHJ:@J*BBJJJRNJJZOK:^MK*ROK*^OK:^MKZ^HJJZJKJJNK*ROJJJN*
-MBJHK*JIK*RN+"XMK:^NKZ@KJ:HKJJRIJ*NJKBXL+R[O+NSMK:FIJR@H*RNHK
-M*ZOKZZJKJZHK:^LJZBJ*"HK*2FHJ*PL+BTO[NPO+B\N[BRIJZHJ*"KJZZJJJ
-MJHN+BRNJJJKJBFHJ*JKJ:NHKBVN+"PN[2\L[N\L+JXI*RLKZNHHJJRLKJ^OK
-MJRNK*NJJ*^LKJBJJJBJJ*^L+2XMKZRNJJBNKJZLJZFH*R@IJ:JIK"PN+"XO+
-MR^LKJZNKJRHJJBHJJZHJ:KI*ZJJKZXLK*VNJZBLK*JLKJRLKJBL+B\N[RPN+
-M*RKJ"@H*2DI*2HHJJRN+BXN+:^LK*RLKJROK:ZNKZ^LK*ZNK*BKJZNHJJBKJ
-MJJKJZBHJ:XMK"XOKJZNK*JJKJNOKJZHK*RHJ*^LKZ^NK*ZNJZNKJZJJKJROK
-MBXLKJJHJZHIJZHKJ:NHJJ^OK*^MK:^LK*VMK:^MK*ZNKZBJJJ^LK*ZMJ*NIJ
-M:FIJZNJJJBMKJZHKJZJK*ZNKJZJJ*ZOKRTL+R\L+BVLKJBHJZBIJ:BH*"BHJ
-M:HIJ"HIJ*BJJ*BIK"\O+RTN[RVLK*RMKZRLKJBJJ*^NJZBIJ"HJ*"@J*:NHJ
-M*ZOKBXMKZ^OKJ^MKBXMKBPL+B^NK:HIJ:HH*BFHJ*JJJ*JJK*BJJJJJK:VN+
-M"PL+:RNK*NKJ:NKJZBJKJJJK*^LK:BKKJZLJZBKK:^L+2XN+:ZLJJ^KJ*FJ*
-M:FIJ*JHJ*BHJJJJKZVN+"PN+"XMK:VMKJROKJZKJZFIJB@H*"HIJB@KJ*JHK
-M*^OK:VN+"\L+:PN[BROKZ^OK*RKJ*JHJZFKJ*JHJJJNJZFJ*B@J*JBOK:PO+
-MBXMK*ZNJ*NIJZJJJJRMK:RMK:RNKJZNJJ^MK"\N+BVNKJNJ*B@J*BFKJZJNK
-MZFJJJZHK*ZOK:VLK*VN+B^NKJZLKJZNK*ROK*ZOJ*JJJ*BJK*ZLK*ZJJZXNK
-MJZNJ*BJJJJLK*ZNK*ROKJZOK*RNK*ZNK*ZLJ*NIJ:HIJZJOK:ROK"VOK*ROK
-M:XMKZZNK*RJJJZJJ*FJ*BHH*B@J*ZNHJJ^N+2[L[.TO+"VMKJ^HJ*HH*BNJJ
-MJJHJJNJ*BFKJJROK:PMK:PN+:PN+Z^NJZHK*:NIJ*JJJJJJJJBNKJRNK*^OK
-M*ZNKJJHJ*JLK*RLKZ^LKJZNJJBHJ*BJJJZNKJJOK*ZJJJZHJ*BKJ*JJJJJJK
-M:VMKZ^N+:^OKZRNJJJHJJVOK*ZLJJBIJ:HH*ZBJJJZJKZ^LKJZNK*VOKBXLK
-MJZKJ:HIJ*BIJZJHJ*JOKZ^NKJROKZVN+BPL+BXMK*ZJJZNIJ:NKJ*BKJJJNJ
-M*JLK*RNJ:JKK*VMK:XMK:^NJJBNK*BHKJJJKJBJJJJNJZNJJ*NKJ*BJJJBMK
-MZ^OK*^OKJZJJ*RLKZRNJJZHJ*^MK*ZLJJJLJZBHJJJNKJ^N+"VLKJNO+:ROK
-MJ^OK*ZHJ*JNJJZHJZ@I*"HKJJJLK*^MKZROK:PO+2\N+:ROJ:FJ*RLH*BNJK
-MJJJK*ZLK*ZNKJZNK*ROK:PL+"^OKJRNK*ZLJ:NIJRDKJZFJJJBJKJZOKJZJK
-M*ZLKZVN+"XMK:VN+:ZOJZBHJJJHJ*BHJJJNJJBJJJRKJ*BJK*ZJJJ^LKZ^OK
-MZ^NKJBKJ:NJJJZJJJBJJZBJKJJIK2XN+"VLKZRLK*RLK*ZLKZ^MKZZNJJJIJ
-MBHH*BHJ*:NHJJJOK"TM+"PMKZ^LKJZLJZFIJZNJJ*^OK*RNKJJJJ*FIJ*JNK
-M*^MKBVOK*ZJKZRJ**BKJJJNJJRLK*VMKZ^LKJZHJ*BHJJZOK*^OK*^OK*RNK
-MJBHJ*FJ*BHIJ:FIJZBJKZVMK:VLK*^OK*ZLK*RLKZ^OK:XMK:^LK*ZJ*BHJ*
-M*NNKJJHJJJNKJJJJ*NKJ*JJKZVMK"TM+RXN+:RNJZNKJ*NIJ:FIJZNHJJJLK
-MZRNK*RLKJROK:XMK:^LKZ^NKJJJJJJJK*RNKZFKJ*NJ*"FH*2NHJJVMKBPN+
-MBPL+BVMK*^LKJRHJJJJJJZLKZZKJZBJJJZNKJRLK*ROKZ^LKJZJJ*BJJJBJJ
-MJRLK*ZNJ*BJJJJNKJRNKJZLK*^OKZ^OKJRMKJJJJZBJJJZNKJZNJJJJJJBJK
-M*ZNKJJNKJJNJJVLK:XNK*NMKJRL+ZRJ*ZJMJ:NHJ:BJK*JKKZRNK*FKJJJNK
-MJVN+BXL+R\O+B^NJZNIJ2OH*RLKJJZOKBPN+ZRJJJJNKZVMK:VOKJZJJJJNK
-M*JHJ:HJ*:NKJ*BJKJZOK:VMK:^NKJZNK*JJJJJNK*RLKJZHJZFKJZJJJ*JLK
-M*ZLKJVN+2VLK:RNKJJJJ*JJJ*BKJZBHJ*JJK*ZNK*ROKZ^OK*ZNK*RLKZ^NK
-MJJKJ*JJKJZJJJJJJ*JHKZXN+BXN+:RLJJBKJ:NIJ:NJJJRMKB\L+BZKJJRLK
-MZZNJJBHJJJNKJRNJ*NIJ:NHJJJJK*RLKZ^MK:VOKZZNJJJJJ*JJKJZNKJJNJ
-MJJHJJJNJ*BHJZBJKZ^MK:^OK:VMKZZNK*RLK*ZLJJ^LJJJLJJJNJJNKJ*FKJ
-M*BJJZVOK*ZNKJJLKZVOKZ^OKZRLK*ZNK*RLK*ZNJ*BJJJJJJ*NIJ*BHJJJJJ
-MJJNKJZHJ*JJJJJJJJ^OK*^OKZ^NJ:JHJZJHK:XN+:XL+"XMKZRNKJRJJZBJJ
-M*BKJZFJ*"HKJJRMK:^LKJROK:VL+"XOKJNKJ:NHJJRNK*RLJZBHJ*NIJ:BHJ
-MJJLK*VL+BVMKZXO+*^MK*RLK*ZNJ*JJJ*BJJJJNJJJNJ*JNJ*BHJJJOKBVMK
-MZRNKZFJ*:NHJJBLK*RNKJRLKJZLKJ^NKJJNJJJJJJZLKZVL+B^NKJBKJZJJK
-MZHJJJBJKZ^OK*ZLJZBJJ*FIJZBHJJ^MK"TM+RPN+ZZKJBHKJZNIJ:HKJZJJJ
-MJJOKBXN+BXOK*ROK:^OKZRLJ*NKJ*NKJ:FKJ*JHJ*JJJ*NHKBROK:^LK*RNK
-MJZLK*RNJ*NHJ*BHKJJHJ*JLK:XL+"VOKJBKJJROK*ZHJ:FHJJJNKJ^MK:^OK
-M*ROK*ZNJJJHJ*NHJ*BIJ*JLKJ^OK*RNKJ^J*JJHJJBJJJRLKZVMK:VN+:^LK
-MJJKJ:FIJ*JJKZXL+"\L+BVNKJBIJ"@H*BNKJJJNKJ^OK*ZNJ*JHJZFKJ*JHK
-M:XL+"\L+B^NKJZNKJZLJ*VNJ*NJ*BHJ*ZBHJ*BJJ*ROKZXMKZ^LKZRLKZRLK
-MJZNJJRNJJBOK*ROK*ZNJJBKJ*NHJ*BHJJJNK*^OKZ^OK*^OKJJHKJZJJJRLK
-MZRNKZVNKJNLKJJJK*BHJ*NKJ*NKJ*JHK:XL+"^NKJHH*RDH*:JHKZ^N+"PN+
-MBVOKJZNK*RNK*BJKJZHJJJNK*RLKJZJJJJJJ*JJK*^MK:^OK*RNKJBMKJJLK
-MJJJK*NIJ:NKJZBHJZJJKJJJJJJMK:PL+:^MKZ^MK:^LKJZKJZHH*BFKJZBJJ
-MJJLKZVN+B^NJZNHJJJOKBXL+BVMKZZNJJJHJ*BKJBHJJ*BJKZRNKJRNKJBJJ
-M*JJJJJJJJZNJJZLKZVMK*ZNK*JJJJNHJZFKJ*BHJ*JNKJRMK:VMKZRLKZVMK
-MZ^LKJZNKJZJJ*BKJZNKJ*FJ*"HJKBVL+2PN+:^OK*ROK*ZLJJJJKJJJJJBHJ
-MZNIJZFKJJJHKZROK:^OKZ^OKZRLKJRHJZBJJJZNK*RNKJZNJJBLKZ^OKJZNK
-MJZNKJVMK:VOKZRJ*ZHJ*:FJJ*NHJ*JJJ*ROK:^MK*ZJJJZJK*RLKZROKZROK
-MZVOKZRNKJNKJZNHJZNKJZJHKJZJJJJLJ*NHJ*JHKZXN+"\O+RXLKJJHJ*NJ*
-M*JOJ*BNKJZNJJJJKJZLKJZLK*ZNK*ZNJJJJKJRLKJZHJ*BHJ*JKK:XMKZXMK
-M*ZLK*ZJKJZOK*^OK*ZJK*ZNKJJHJ*BHJJJJKJZJJJRLK*VNK*BNJJZNKJZJJ
-M*NHJZFKJ*BMKBPN+BXOK*ZHJZNIJ:NHJJRNKZ^MKBPL+BVMKZZNJZFIJ:BJK
-MJZLK*RLKJZJJZFJ*:HJ*:BJJ*^OKZ^MKB\M+Z^N+*ZNJJJHJJZNJJ^HJ*NHJ
-M*JNKJZNJ*BOK:XN+BVMK:RLKJZNKJBJJJJHJZBJJJZNKJJLKJZLJZNHJ*JJK
-MZVN+"XN+:RNKJRKJ:NHJB@HJ*JHKZVMK:VMK*ZLKJJJK*ZNKJZNK*RNKJBHJ
-MZFIJ:FIJBNHJ*^OKBXO+2PL+BRNKJZJJJJJJ*ZJJJBJJJZHJZNKJZBJJJJNJ
-MJJHJZNIK"VN+"XN+:RNK*NKJ:NJJJJLKZZNJ*BHJ*JJK*ZNJ*FHJ*JHK*VMK
-MBXOK:VMK:^LKJBKJ:NHJ*JJKJZNKJJHJ*BJJJZNKZ^OK*^MKZVOKZRJ**NIJ
-M*BHK:XN+:RNJJJNJJBKJZBJJJ^LK*RNJZFKJZNHJJRLKJJJJ*BHJ*BOKZXN+
-M"\N+BVOK*ZNK*NHJZNJJJJJJJJNKZVMK*ZNKJFJ*JJIJ:BJJJJLKZVOKZZNK
-MJNIJZNHJJROKBXN+BVMK:^OKZ^NJ*NKJBHJ*"FKJJBMKZRNKJJJK*VMKZ^LK
-M*RLK*^N+:RNJZFKJZNHJ*JJJJJIJ:BLK:XMKZROK:XN+BXOK*ZIJBHJ*:FIJ
-MZJJJJJJJJJNK*ZNJJROK:XMKZRNJ*JNJ*BHJ*BHJJJLK:^NKJZHJJJJKZRNK
-MJZNK*^MK"PMKZXMKZFIJBFIJBFIJJJKKBPO+"PMK*ZLJ*BKJZNKJZNHJJJOK
-M:VMK*ZJK*NKJZNKJJJJKJZNJJJJJJZLKZXN+BPL+BXMKJ^IJ*BJJ*RNKZFKJ
-MR@JK*VL+"XMK:VMKZZOJ"DJZ2KH*ZFIJ*BNKJVL+NSL+2[N["XOKJNIJJJJJ
-M*VN+*PMKJRJ*"@I*"GI:.JH#T[*N4R/&2`K70S_'Q_NO([:&#SE7:%CV2<DR
-M^(A/7T<"KV.V=B8WZ2F'!D9+CR;H:#['*8GG(HI/O^J.#N[+LP..1O9FFML_
-MYP<3'L;.\Z]+(AN'QR>_\QM[\@:HMKHZSAY+9W>#0G-*OZ?#/F8Z@X_K2]N;
-MPB9^2M_ONJ8&>E,'+\N[:I^;6S)^LU-3>L**CJOKOM+N2SNZD\._,S-#B_-*
-M6GZF$LJC>GJ;`Z_S@ZL:*@L[#L[JDW.;*DI3+[.ZLCIZ:YK.;G*B\_\?GSMR
-M+OK;XA)Z2^N*"W+Z+P_3J])JR\+RKC,C`^MR8YN_D^I[LD.:3@Y2\RJ+"^L;
-M*N/K>J*RBAN["JHK"BISPR/KVCM+.POZ.EH*RIH2B_-[RHJC2UOK,D(ZHUL*
-MV@)*\].C2XMSXYK"\C):&JL;8\/CV[M;*T(:&LKZHO)"HY,C^WN[NJN;&[MB
-M<@IKJNH:N[/;NUI*NZKZ,B(+@^/B0HIC[ULJDGIKHYM:@GI+`UNKJ_O;.^H:
-M2DKZ>HO;,SOJ*_KJZ\HBPOM+&DHKPUL*BAI*NZN[*[M+>VLZ"CIK2RKZNNNJ
-MBRI*>@J;(UNKBHMJ2HI*.FK[,SMZFNJC^TJRFIN#8VO*RFH+"HO*.J+*ZRN+
-MBFO;&]N;^VL*&A*R>LN+JJJ+F_L["^OZ&BJKJPM[&YN*JDO+*\H*FAKB&IKZ
-MBWM;.RL+HPNK^J+*JLLK:[NC&XOK"FJ*N@J**JL*:JO+ZZKK2UNKZ@H*:NK+
-M:XMKBDIKRZKJRKIJBZMK.UO;JAJZJDM[*@JKBRK*ZFKJRIKJBBHKJPMKR_M[
-MN_NK"FHKZCJZ2CK**FMKJBJJZXN+BXL+RPOKZ[O["RH*:N*.KH)ZZHL[VZ,C
-MXR,C6]M[^[O+BVLKJBKJ:HH*"LK*RLK*R@H*"HJ*:NKJ*BJJJZLK*RLKZ^OK
-MZ^OKZ^OKZ^LK*RLK*RLK*ZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJ_______________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/9.g711a.uu b/share/isdn/9.g711a.uu
deleted file mode 100644
index 7765d02bf103..000000000000
--- a/share/isdn/9.g711a.uu
+++ /dev/null
@@ -1,231 +0,0 @@
-begin 644 9.g711a
-MZBHJ*JNKJZNKJZHK*RLJ:NJJ*^N+"RNKZZJJJ^JJ*VMKJRIJ:JJKZRNKZHIJ
-MZBJJJZJJZFIK^RLZRJHJJBN+NWO[NPLKBPN+ZZLJZNH*RLJ*ZBHJJJHJZBHJ
-MJJLKZ^NJ*JJJ*VMKRTL+"XOKZRNKJ^J*2KJZ2@J*ZBJJ*JNKZXN+BXN+BXN+
-MZVN+:VOK*ZNJ*BHJZFIJZNHJJJJJ*JHKZVN+BXMK:^LK*ZNJZFKJZNKJJJLK
-M:^OJ:JNKJJHJ*JHK*ZJJ*JHK*^MKBVMK:^LKJZHJ:NKJ*NHJJJJJJJJJJBNK
-MJRKJ*JNKJZLKZROK:^OKZVLKJZJJJZNKZ^MK*ZNKJZJJJBHJJHMKJ^OKZ^LK
-MJZJJJZJJ*BKJZNKJZNKJ*JJJJJHJ*JJKZVOK:RNKJBJJJBOKZXN+:^MKZZNK
-M*BHJZNHJZNKJZNHJJNL+"\O+RPMKZRNJ*BHJRLKJ:BJKJZLK*RNKJNJ*:NHJ
-MJBOKBPN+"PMK*ZNJ*BHJ*BHJ*BHJJBHJJJJJJBJJ*JLK*^N+"XMK:XOK*ZNJ
-MJBHJ*JJJZFHJ*JJJJJJJJRL+BROKJRJJZBJJ*RNK*^MKBVN+*RNJJRNK*BJJ
-MJBKJ:FIJ*JNK*RLKJBHJ*NHJ*VOKZ^OK:XL+BVLK*NKJ:NIJ*NJJJJNKJZNK
-MJRLK*ZJKJ^JJZROKBVOK:^MK:^OK*ZNJJJLJZNKJZFHJJJJK*RLK*^LKJZHJ
-M*JLKJRLK*^OK*ZNKJZNJJJNKJZJJJRHJZBJJ*JJJJJNKZRLKZROKZVMK"VNJ
-MJBHJJJJKJRLKJRKJ*BHJJJJJJBNKJZNJJRMK:^OK:VN+:^LKZRNKJBHJ*NKJ
-MZNJ*BFKJ*BHJJBOKBPO+R\L+B^LKJZNKJZNJZBJJJRI*"FH*BFJ*:BHKZXL+
-M"PL+BVMKZZNKJZNKJZJJJNIJZNKJJJJJ*RLKZ^OK*RLKJZNKJZJJJZJKZRLK
-MJZHJZNKJZNKJ*BOKZ^MK:VN+:^NKJBLJBBHJ*JJJJBHJ*BJKJJLK*ZLKZVOK
-MZROKZRLKZRLK*RNKJRKJ:FIJ*JJKBPL+:^LKJZKJZHJ*:NHJ*NHJJ^MK"PMK
-M*RNKJJNKJZNK*^LKZJOKJJNKJJNKJJNJJJJKJJHJ*BJJJ^MKZ^OK*ZNJ*NHJ
-M*JJJJJLKJZNKJJJJJJNKJZNKJZNKJJLKZ^OKZRLK*ZLK*^OKZROKZ^MK*ZNK
-M*BHKJHIJ:FIJ:FIJ:NHJJVN+R\N+*ZNK*RNKJZLK*^MK:VLKJJKJZFIJ:NJJ
-M*JJK*^MK:VMKBPO+"XOK*ZNJ*BKJZFIJ:NKJZBHJJZHJJZLK*@HJJRMK:XN+
-MR\O+"VOKJBKJ:HH*BNKJ*JJJJJJJJZLKZRNJJRKJ*JNK*^N+:VMKBVOKJZNJ
-M*NJ*"HIJ*BJKZ^LK*RLKJZNKJZNKZXN+RVN+2PLKJRHJZFIJZBHJZNKJJJNJ
-MJZNKJZNK*^OK*RNKJBJJJROKZ^OK:^NKJBJJZNHJ*BKJ*JHJJJNKJJOKZVMK
-M:VLKJRHJ*BJJJJNKJROK:^NJJRLJ*BKJ*BHJJZJJJ^OKZVOKZ^OK*ZNKJRJJ
-MJJLKZRNKJJJJJZNKJRKJZBHJJBLKJZNK*RLKJZNJJJNKJJJJJJHJ*JJJJJNK
-MJZJKZRNJZ[L+BXNKJJJKJZNKJBHJJJJKJBJJ*BHJJJNKJZJJJZJJ*ZNKJJJK
-MJJNK*VMKZ^LK*RNKJZNKJBHJZNHJ:NJK*^OK:VOKZRNKJJNKJRLK*^NKZJJK
-M*BJJ*NHJJJHJZBJK*ZNJ*^OK:^MK:XN+:^LKJJHJ*JJJJBKJB@J*BNJKJRLK
-M*RNJJBJJJROK:VOKZROKZROK*^LK*ZNKJZHJZFIJ:NJK*NJKJJOKZRNKJZLK
-MZVN+:^MK:VNK*NKJZBJJJZHKZ^MKZ^LKJJHJZFIJZNHJJBMKBPL+B^NJ*BKJ
-MZNHJJBJJJBHJJRLK:VOK*RNJ*ROKJXJJJNHJJRLKJZNJJJJJJZNK*^OKJZJK
-M*^MK:^LK*RNKJZNKJBHJZBKJ*BHJ*JJKZVMK:VMK*ZNKJBKJZBHJ*JJJJBJJ
-MJZJJJJLK*^MKZ^N+2VOKZZHJZNKJ:HJ*BHJ*ZNHJ*VL+RPN+:^LKJZHJJJLK
-MZVL+"XMKZZIJBFKJZBJKJZNJJRLK*ROK*ZNJ*BHJJJJJJJNKJZJJJRLK*ZNJ
-MJ^J*JJLJJRLK*ZNKJZJJ*ROK*ZLK*RNJ*NHJ*NKJJJJJJJLK*^OKZZNJJBJJ
-MJJJKJRNKJRMKBPO+RPOKJZHJ:FHJ*JHK*RLKJBKJ:FJ*BHJ*JFOK:PL+R\MK
-MJRHJ*BHJ*JHJJJJJJZJJJZNKJZLK*RNKJJNJJZLK*RLK*VOKZ^LK*RNK*BKJ
-M:BHJ*BJJJJJKJRLK:VMKZROKZRNKJBHJJBOJ"NKJZBJJJJOK:^OK*ZHK*ROK
-MZ^OKZZLJJBKJ*BJJJJJJJBNKJ^LKJZNKJZLKJZNKJZJK*^LK*RLK*ZHJ*JJK
-MJRLK*ZNKJ^LK*RNKJBKJ:JKK*BHJ*JJJZBHJJZLKZ^LKJROKZRMK:^NKJJHJ
-M*BHJJRLK*ZNJJBHJ*NKJ:BHJJRLK:XN+:RLKJZNJ*BHJ*NHJJJNK*RNKJZJJ
-MJJJJJROKJRKKZ^MK:XN+:RNKJNJ*BHIJ:BJJ*ZLKZ^OK*ZNK*VOKJRHJJRKJ
-M*BJKJZNKJZJJJZNKJJJK*ZLK*ZNKJZNKJJNK*^NKJZHJJJOK:VN+:RMKBZLK
-MJZNKJBKJ:FKJ:HJ*ZBHJJJHJJNN+"PN+:^LK*ZLKZVN+BXNK*NJ*RLK*BHKJ
-MZBHJJJLKJRLK*ROK:VMK"XN+BVLKJZJJZBHJZBJJJPI*BNJJJ^MKZVMK:^OK
-M:VL+RXMK*ZNK*FIJ:NKJZBJJJRNKJZHJ*BIJZJJJ*JNJ*^OK:XN+ZRLKJZNK
-M*ZNKJRHJ*FIJZJJKJ^MKB^LKJRIJJRLJJZNKZ^LKJZNKJJLJ*BKJ*NHJ*BHJ
-MJJJJJBOK:XL+"\L+BVMKZ^OKZRLKJZJJJZNJZNKJ:NIJZNIJ:HIJ:JJKJBOK
-MZ^OK:^N+BXMKZROJZNNJ*BJJ*NKJJJHJJROKBXN+RTO+BVLKJZHJJRNJZBJJ
-M*FIJ:FKJZFIJ:HJ*B@J*ZBJJZVN+BVOKZ^LK*RLKZXN+B\O+"\L+"PO+RPMK
-MBTN+JZNJJJNJZBKJ:FJ*2KHZ.OIZ&J):6EK:&OI*"FJJ*^MK2SL[>YO;HV.#
-M@P-#P\-#`Z,;F[L+NYL[.QN;^[MKRAJ"DN[./GZ>'AZ>_@ZN<N(*:WMC0W/3
-M+V^/#P^/;^\OKU,3\Y-S`^.CNPNCT^]S0Z^C"MKNIN8FAL8&1K8&YB;^DLI;
-MKX]/?W__'Z=?7^>G?\\OPYL+JZOJNMJ"$JZN[HXNKBZNKN[NKO(BRFO;LQ/O
-M#P\_I^<G9X>G_\\#BJ)2/MZFA@8&Q@;F'K[N(DHJB\L+N_N;HV,#PW/3KV\/
-M3S^_3P]OKS.#HSLJZ^__X^,?+^N;:CZ>/H9&AK:6M@8&)KZNRJ/S;_]__Z??
-MOW\_KW.3H_NCFPN;&RNK:VJZ^J+"PC)24E+2PJ+:2J,?!Q]G5T=?IT\J^J+>
-MYJ;&EO;V]@:FSMI+6]-ODX,#HUM#8]O#\X-CXUN#T].3<Y/S(^O*2KH*"IH*
-MSV=#4S<G\\]S<G+"9D;FMI:VMO9F/F[Z6_.//\^/;S/C,\-;(R-;8X,[>T,S
-M,[,#8]O+ZIJ"@F("8N)[YU_CQQ???]][`NKNQF:&EI;V%G9F'J[J>]-/#V]/
-M4UM#$P.S\Z.#$T.;6^-C`X,C&POJFH)"@F+B^L-'A[/'U^???[K^DCXV-I8H
-MU@9FI@Y"(]\?CR\#ZCI"'MZNHBHS+T_GQ\<'IP]SXVIRSAY>OA+:V[>9(?E'
-MA^>KGJB8H#@(""B69CL'-^??GV?G^][&AIYNSKXB#\?WMP<'!Z=;KM[F9B9^
-MC@+K0P]?Y^<I84%9I]XF]NCX("!(YHXN\DJ_E[<#?B8N&OZ6EHX/Q^>O0Y^'
-MI]-K:\/#&K[>#IJ;`^-S_Z>G?[?A<8$7QNBH:#C@8)AFJLJR[@L'=Z]FJ$9J
-M+])&'D^IJ?]",O/?CRKB.T^/"KX>TCLSVPN#[[\GR3%1@:=H.+BX>.#@2"XO
-M@YINRV?'JQ8(5KH_*MZNIVGI;UXFBA^GLSH+CP]+CJ:.2P^_\ZHK$_?AK5&9
-MIMC8>+B8(-C60Z>3\MY*7W\.:$A&SR=KCJO'*7?*-D;B'V?_PR-S\ZN._@*O
-M7T\#@],70>U1:<@`8!AHR%@8-D^W7W(&#D\?+FC(AA/?,PLO!W>GTO9&0O_'
-M9X]+BMJ"$I(JKY\??X^?>:UM04I@,("X]F@82*:G]W^>UJ8[(QXHJ*;JTS]G
-MQ\??ZEZ&?BM?-\?/2@[.LFMS#T^_GY_7L6VM"3@PL""6YLAXB'+'UW^&5N:B
-MVN:6MIY*#[?7MW\*IH:>^F_GQR?3HCZ^HN-_IT^S<P?A[6UA-C!P`&@"QKAX
-MUO-7J2L6J`:N[B8&9CZ*IU=79[M>QEZZ;R<')R^*CD[RNT_G9W^O9V'M[>&H
-M<!#`UA.2:'AH@A=I[T;HJ&8N>B+>MN:O*6G'6G86/B^'1R?S:B(24EK;OX<W
-MAX<9K6TQ"T!0<)C++R;(N/;3Z9>*]HCHMH+[4K;6$G=)B5.6R!;[EXFI#S)N
-M$B*JVZ]?!\='F='M\0^`4!"@PH_2*,A6ZBFICQ[HB*C^:]IFUD['R0D_]CAH
-M@C<)Z1^R3O*+;P\OOZ?'";'M4?G(\!#`5FM:]@@H?N>IYQI&J*@&8K+&*#9O
-MB;D7+HA(Q@_IB;<[/CZ:+U]_S_]G27%M46E8T-"`7G^:J#AHKE>)Y^[6*):^
-M"GZHB&8'.3D'QOBX)B>)Z1\27NX;)\=GIQ^WH:UM,?/`4)!8>L_.B#BH>VEI
-MGSZHZ$9:\A:X"%J)H3GS:!B(:BFYUXK&1I+_]S=?OX>948W1!X"LT"!Z9V*(
-MF&CK"3G'ONB(-LH*EGB8WFDAV9]HH+BRZ7EIFT9V#@_WE^?/IWFM#5'W@*Q0
-M(/IG0DB@R`I)>7=N:,B6>@NV^'BF*:'9?X@@.+(I^>ECAC:./U>IAR\?62V-
-M<7NP+!`X/V>FF""([_DY!QYHB&8[,N@82#LYX;FB^*!H,XFYMS)&YFO'*9>G
-MC_?!;>TAB)!0`&;GH^B@F&:7^2EKEBC&FJ(H6-B&Z>&AYRA8.*Z7"==;GEY*
-M7Q<79Y^W(2UM0<XPK+#HWT]VH*!67SD);X:H!KKJUJ`@J'<A(9>6V#@^]PE7
-M8Z;F6J?7J0<_IWE1C9&/0*SPR#^GQE@@Z,])"2^&J&:+,T:@@,AG(6'I!ACX
-MWL?I=QN>_NH?MW?'YS=9K8UQ&["L,(A_[Z@@H/;G2:DZ-O:N;[MH@("H*6$A
-M1U:8"`)'EU\K<CJOI^=G9P?765%M,=O`$,!HD^N((-CF!PF7LL8F"@^:2,"`
-M%NGAH:=6N%;*YX?/.ZJ;$^^_9Y?IR6$M[6$V,'!@MO->>.!(FI?IO_Y>.D_S
-MMB#`6)HYH6FZUE8^P[_OLT-#(^OJK_<)23G!+:TY2/"PV*;*J*"@UH\7-PH>
-MVO^'HCC``*@WF4E_'D;^^BJJ&W]G3VJN^J?IN4G9$6TQRP!P8%8J)IC@N/I'
-M1UM>DC\'KZC@P)@KB<FWZCY.$M+RR]^WYSO.#J\I.;F)82TM>4CP0#B^<L@@
-MV.;GQ_-^OK_WAZ:@P*!>-^DW$ZLJHGZ&;L_W-V-^7@N72;D)&5%M01Y`,!C&
-MKN@@6#;_)VJ>OA]7!XZ8@"`6[P=GG[_/ZB:6)D_7%S,>'HM'Z6DIR?$-K>=@
-M,-@V)FC@H+8_G_Y&SF>)!T[(H!B(IKL_1_=G:^8VIL-'MY\ZCM)#]VEI::$M
-MC6&6P&#H]NB@X(AJWR(VGO]I5UI6.'BXZ%Z[A]<W#RYF)G(O)R<OND**_Q=I
-MB4FQC:UG6&!(%H@88/B.+\IVQJ\IZ0-&J,CX."AR7Q>7IR,2?OYB+R>G8UKZ
-M8^=7*6G9K8V!-B!XMFA8X*!&@RI&5NK7:2>F!H:(V!B6+S?WIT]OBGXF8I\'
-MCU+N>U\WEU=IX>WMR<@8%F9X8&"XTFKFJ.:'Z3<K_OI>>.!X/K__OR>WIZ[&
-M?N_'WTHNF]^GI\<I28'MK;>(:"968`"@Z,ZFEK9J=W?_Z^OO9J`@B'(+:C_7
-MJ6_F!LH?/XOB^[]O6W^I"<GA+5&WJ!;>:("`&"@F1I;F8T?GK^-O[U8@6*A^
-MWO+'B:G[)G)/?XLBVT]3^BMG*>DIH:VMZ7:&@J@`P!CH]BBH?F]'W^\_Y]\V
-MH-BH-JBF1\D7NU)SIP.2JA\?:ZX[QY>WE]E1+8GF>A.H0,#X:(BX*)(/I^\?
-M-\?_YOCXB&@(9L?IAQL3AY]";J_GDY)28V>W!_>9$2UY,O]GUD#`.$B8&"BR
-MVS-SQZEGDXIV./C(:$;SQ^??9\?_ZDIOIP,24LM/?U]'"4$M@>_'*?Z``#AX
-M(*!H3D**D[?I1Z^/:HC8..BH9CLGAP<'9S]3;Y_O6JY*PY.O)Y=Y<1$))\FW
-M"``8N."`F#9>'BJGZ2D?OP?R^'@HZ`BV,Z>?)[<W)P]_IX/RHNMKNQ,GU^'1
-M`7=)><L8H`B@P&!(EM;F8W=IMW^W%Q[XZ/;(.(8/L_LG5Y<_SX=G6ZYJXZLB
-MXP<IX9$A*5E)TCBX"(#`(#AH:.;OUZDGAZDWY@CVJ/A()LMRJD<I]S\'5\=+
-MFG/[KBZOY[_)\0&IF:%_*`BH(,!@6,C(J.*'U]_G*>FCJ(:F"/C6`MZ>GQ>W
-M7S?I=V]+;UNN,JJS^Z=A,6D)@0GNUF9(`&`@F#BXQOO''X\7*9<BAL+V.`BF
-MWM9"9V?GMRG71U^_/PL2(DMK>@=A`9=Y`1<^IE(X`""@&)CXMMH/^P^I%W<?
-M.IHF*.C&!JA.OS^?1ZG7]\=?G[MR2KJ24KN7X:&7X>$G2@I.H.`8(-B@N+;N
-M*PH'=V<71_-:_O:HMA96SOM3)Y=7UZFWI]]CPOJZCJX*,TGAJ?D!*:_3&P@@
-M>*!8V*!H9L)N4_=?-RG'BDJ2UA9&ED8RKS]'=Y>IE^<_;\M"HI)NKJXK:>$I
-MR4$)O_]3J"`XH*#8(`@VSI[[MQ_'J5=#:HMF-D9&QOY+\R<'MU>7!Z?_<_IB
-MDHY.;@)[Z2'I.<%I)Z=O*%BXH%B@H,C6)H:+)P]GU^F/F^\N9D9F!B8:`U_G
-MQY>7QZ<?[YM*\M(.?GY2XM\9.5=A6;<G9UKX"#C8V""8R/;VAC/OGX<IJ4\/
-M3Z*&ADXFIH+3_W]G-W='AV<_>SH";E[FWLZNZG<9B0DAN?<?YXX(B$CXH-@X
-M"*@6WKKO3Z=7%]]OS[N^ILZNCD(SWU_G1W='YU]/$\NZXI+NSA)ZRHK#IX?G
-M_T_G7T-[*E*>3A[&MD;&=I;V1N9^4FKS[T_?_U/S;Y/[6V,CFSM+HY/S4X_/
-MCX^/@\L[J]HB@C+*CZ</_[>W'P_OJE)NIC:6EE8HJ-9VAOYRRF/OST_/[Q.O
-M+_/#D^_O+R]O3T\/[^^O,R/+:@(2DN[.#JY2\CM?YW_'UT??G^^ZPM)>!D;V
-MUJA65G:&?JX*(Z]O;^]OCR\O;P]O[^^OK^]O;X\/[Z]#N^IZ0BYN;HX.;BZN
-MHI.G/Z>7UP<GIT.B@@Z&1D:6J-;6%L8>;B*[,X\_SR^/OV^O[Z_3KU/ST^\O
-M+R\3@]O+"MK"4NYN;NY2<N+Z>HM_AQ_G%Y<GW_^;(H(.YH;&=A9V%I;&IKZ2
-MBGLS+^\O;[^_SP_/SX_O+V_O4Q,#8Z/+*KJZFL+R0K*NKG)R\F(:VBJ/YU^G
-M=Q>')Z<OJKIR7F8&EE;65JAV9GY2.KOS;V^O;S\_3P_/SX_OK],O[R]S0X.;
-M:XKZVMJ:HD(RPF("`H*B^CI*J@/_IQ^']\=?G^^K`BX>9@8V%A9V=C;FSL+*
-M>Y,O+Z]O#X\/#V\O4_.#XP/SD]/3<\-C6\OJJJK*&B("PL(R<@*:>MJ:NDOO
-M#^]?!V=_/^_+.L).'EZ&-K:V-D8F#N(J>Y./+],O+U,O+Y/S,R,;HZ-C$R^O
-M+^^O0^-["^OJ6K+RDF[.;E*20J+Z2KHZ.T]_3^<WAW]/TXO*PDY^GN9&1K8V
-MQB:^\HJ;0W-#`\.#`Q.O<S/S0P/#LU///[^_OP_3PWLKZDH"KBYN3KX.CBXR
-MPJ(Z"@HJ"S/_'_\GAU^/K^,*(I+._A[FQD8&9J9.<LJ;8X-#\[.#8P-#LP,C
-M8_.O+^]/GY\_#^^3H\L*&H(R+DY.;@X.TN+:RFN+Z\M["^KJ"V/#H[-O;W.#
-MXYL+:MK"<NX^GIY^_CYN8CK**HO[&WN;([-S<_,S<],3<U/O;V\OD\-;B\KZ
-M^CJ:XB(:XK*R,C*"8@*B>EI:.DI*JHL+XZ^O4P]/[U-38TOK2L)R$HZ^3KY.
-M#NZNPJ):RJOKR_O;H\/SDU,O[V]OCX]O+Z]3LX/C&VN*FL)2[HX.CFYN+G(R
-MPN+:BHN+"YM;^_L;FR/S<Y/O#^^3\X.;RXK:XK+NSDX^?C[.CJZR(CH*JLL;
-MXT/3+V\/ST\_/P_O[].#&TN*^OI:@L(R4E(2+FZN,C(R(OIZ^KH*JPO+>^,#
-M\Y-STR_OK^_OD\-#6RH:HO+N#DZ^3KX^SBY2\AH*ZCM;H[,3<W.OKU.OKQ,3
-MD\,C(UO[2XNJ*BKZ`H(B\NXNDM+20@*B2NKJRZ-;6X-CH^/C6QN;>[L+B\N[
-MBZOK:^I*"KH:VMI:&II:6AI:6DHJRBIKJJN[^SN;6QN;&WM+2WN;.\N[2VLK
-M*RLKJRHJJBJ*:NKJZHK*"@K*RHJ*BHJJ:ZN**NOJRJHK:NJ+RVL+N\N[F[L+
-M2SL+:VLKJBIJRIKZ"FI*.BJJRFKJ^KHJ.AKJ:^KJ"XMK2TN+^QN["SO[2TL+
-MZ\N[BXM+RXL+JXHJJPHZ"FJZ&AIZ2LHZ"NN+Z^N+2[MKJ^LKZNJKJFKJJJL+
-M>_M[FWO[RVLK:CKZNKIZ&KHZ^OKZ^@IKBXN[^[N+*FKJ:BHK:VL+RXMKR[N[
-M^WL[2PLKJJNJ*NKJB@I*>CJ*BLKJ*VN+BVL+"XM+2PO+.VN*JBMJ"DI*:BKJ
-M"NHKJJJJJJMKJFHJJFIJJJHKZVMK2TL+BXN+:ZLJ*^NJ*BOK*ZLKJHKJ*LI*
-MBBIJ:JJK*ZOKBXO+NSL[^SO+ZZKJ:FJ*JJL*:JHJZJLJZBKJRFJK*FJKJBJK
-MJNJKZZKK2TL+2POKBVOJZJIJBJHJBJJKZHHJ:NJK*^N+RPN+B^OKB^NK*ROK
-M*ZHJJBIJ*JNKZFHJZHH*2FIJ*BKJJNMKBPN[NTL+RXLKZRLJJ^LK*BHJB@H*
-M:JHJZBHK*ZOK*ZMKJXIJJRKJJXN+BXN+"VNK*XNKJBOKJBIJZBJJJBN+ZROK
-MJVJ*:JHKZNJJJBHJ*^LKZ^NJJJLJ*JJKJZOK*ZNJZVLK*ZLKJNHJ*JLKZZNK
-M*ZNKJZKJ*BKJZBJJJJLKJZNKJBJJJZHK"POK:PMK:VN+"XNK*JKJ2DIJ"FJK
-MJZNKJNHJ*ZLKZ^LKJJJJZ^LK:VNKJJKJZNIJ:NHJ*JOK:^OKJRNJJJOKZRLK
-MJROK*JHKJZHK*ZLK:VOKZVOK*ZHJJZLJJBIJ:JJ+:ZKK*VH*BFIJZJHKZVMK
-MZ^OKZ^LK*^OK*ZKJ*BHJ*NKJJJNK*VMKZROKZRLJ*JHJZBJKZJOKJZJKJ^HJ
-MJZNKJRNKJZJKJZNKJRLKZ^LK*ZKJZZNJ*ZNKJZKJZBHJZJJJJ^LKJRLKJJJK
-MJZOK:VN+:VN+*ZJJJRIJ*NKJ*NHKZZNJJRLJ*RNJJJJJJJJJJBKJ*JHJJJNK
-MJBOK*RMK*ZJJB^NJJRLK*ROK*ZJJJZNKJJJJJJJK:^LK:^LKJZNJZBKJ:@H*
-M"HKJJBN+BPN+"PN+:^MK*ZNJ*JJKJROKZ^MK:^NKJBIJBNIJ:NIJZNKJ*JLJ
-MZNLK*^OK:PN+BXMKJZNJJNKJ*JNKJZHJZBJJ*JJK*ZNKJRHJ*JLKJ^MK:^OK
-MZVOKJZJKJNHJ*BHJJBHJZFIJ:HIJJBMK"XN+BXMK*RNKJPO+*RLKJRHJZBHJ
-MJJNKJJJJ*NKJBFIJZBHJ*BJKJRMKBPL+:RNKJZNKZZLKJZJJJJNJ*^LKJRKJ
-M:FIJJJNJJRNJ*JOKZVMKBVNK*RLK*ZNJB@HJ:FHJ*BJJJJNJJZLK*ZLKJJLK
-MZXN+"\N+Z^LK*JJK*ZHJ*NKJ*NKJ*BOKZRLK*ZJJ*BHJJJJK*ZNKJRNKJJJJ
-MJJJJJRKJZNKJ*BHK*RL+:ZOK*ZNKJZHK*^OKZVMKZ^LKJRKJZNIJBFIJ:FIJ
-MZJJJJ^N+RPL+BXOKZRNKJZLK*ZNKJBJJJJLKJZNKJJJKJZJJ*BKJZJJK*^OK
-M*^N+*XJZB@IJZVOKZ^LK*ROJ*NHK"PL+*RLJZPNKBBHKJHIZ"NKK*ZN+JVKK
-M2VMK:PO+BXNJJZLKZ^NJ2DHZ2NKJ:LKJ*VO+2[M+BRNJJZH*RLHK\RM^&B-;
-M8UYV6]?C&[O.IU?::.9_";?FJ([''R8H@I^_BZOOR[Z&<LN?YW]*AKI^GB(N
-MTX?WE_?;!B9:ZPOB7OJ/6_XV!H+GQP_+"AO;0JZK\].;>WMJZ]LJ8HHZIL;Z
-M,X._3R*K/^HNNV)B$T^:OD/S&]OZ0N)Z4J*S+[.JTA("ZR_OV]J[FTHB>FNC
-MSUM":B+";L(K:L.#N[HJDY.#&OK+VCK:+G*+>QMC`VNZZRMJ^HJ:J_LZJOM+
-MJ@H+X^-[RRK*RCLJ\DJK*DHKP^-+JY*B^SMZ>DN;R^IB.H)J[W.ZHBIJ*NM[
-M8W/[.BI*^DN+ZEJB:FH"VOJJ,R/+BKK+BYM+NNO;H^J"R\LZ:KLK2JMK>XMK
-MJAI*FIIKBHKKF^N:*TN[NZO*.@O[ZRMJR[N[^\JZ:TNK^MK:(CKKN\.CJGLC
-M2YIZJXKKZRH*ZFMKB\J*:XL*NAM;JLKZ2FHJJ\O[*VNK>KJ+:OH[NRL["SKZ
-MJCL[.ZHZJZLKNXOKBZNJ*^I*ZLOK:@KZBFH**OM;RZMK*J(*2PI*NYOK:[O+
-MZOHJRAHJ2XOJN\MJ*JOZFHN[ZHKJ*XN+:^J*"QM[NXHZJBLJBNJJ2WL[JQH*
-MZNKKJHJJBSN+ZJL*:FHJRRN*ZFO+*XJKV_LK*ZNJ:FKZ>KH*:TLK*BO+*ZLK
-MBFHJ.TN+N^N+"ZJZ"LKZ:BLJZFNK:FL+B\LK:HN[*DK*ZJH+RZMK"POK:^I*
-MNFHJZJLJ*JH+ZRJK:BL+"ZHJZ^N+:TOKZ^NKJZOK:NHJZHOK:BHKN\MJVKHJ
-MZPMJJFNJ:RMJJRJJJRLK*JMKJ^LKZZJKZXIJJJNJ:JKJJRLKZPL+JXL[:^IK
-MZXI*JCMK:PNKJNHKZNJJZZJJJ\IJ*B)N4F+Z*LM[6R-C8V/CHUL;FSN["XLK
-MJRKJ:HH*"LK*2LK*RLH*"HJ*:FKJZBJJJJNKJRLKZ^OKZ^OKZ^OK*^LK*RLK
-M*RLK*RLKJRNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZO_
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-9____________________________________
-`
-end
diff --git a/share/isdn/Makefile b/share/isdn/Makefile
deleted file mode 100644
index dbc797334f0c..000000000000
--- a/share/isdn/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# @(#)Makefile 8.1 (Berkeley) 6/8/93
-# $Id: Makefile,v 1.8 1998/01/03 14:13:46 wosch Exp $
-
-FILES= 0.g711a 1.g711a 2.g711a 3.g711a 4.g711a 5.g711a 6.g711a 7.g711a \
- 8.g711a 9.g711a beep.g711a msg.g711a
-
-CLEANFILES+= ${FILES}
-
-all: ${FILES}
-
-${FILES}:
- uudecode < ${.CURDIR}/${.TARGET}.uu
-
-depend lint tags:
-
-install:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE} ${FILES} \
- ${DESTDIR}${BINDIR}/isdn
-
-.include <bsd.prog.mk>
diff --git a/share/isdn/beep.g711a.uu b/share/isdn/beep.g711a.uu
deleted file mode 100644
index c1fc86d9b82e..000000000000
--- a/share/isdn/beep.g711a.uu
+++ /dev/null
@@ -1,106 +0,0 @@
-begin 644 beep.g711a
-M/3FLS$"G:8A0,/F=I8UF'.2,Q^T11W:I+0V!,.1D;('=?3'6(,I9%_#<'."-
-MY=VQ0#PL7ODCP'`#3:6]5TQD?):M;:&FBC&-<;A<A#S'G5TM:P#(Z4F8O-S0
-M\26E+;@\3!BY"<@PJ*U=?6$LY*0`<<UQ[P:9+5&Z/(3<:+VES8D`@(LY?NR<
-M;+E=)<T[3'SPER&[X)B!?9T1`"3D+*%-[<DV'_&MZ>SD)+#M)7T!H)"(Z>>P
-M/,RN_>7]^6S<;)*!28B@*4T=[=9<9+P?34T!ON:AT:%`I.1LP:5=K:BL`._I
-M2(Q,&&WEW;%P7#SX80$[F$HM?0UG/(3<"(W]K1_H1[$!"'SDO'?=)0UOK%"6
-MZ<(0S+`QI:4MF-S<\'EQ2:CVP;U-6>QD)##1G0TYB":AP8L,)!RH/>4]F9!L
-MX,<W(&S021TES2+\)&PGT<$K*,F-3;'`Y&2,(9T]03:X-X$I$*2DP&WEW3%@
-MS!!""080K!I-)3U)#.3\UA&MB7:OT4U1:%R$_(_]':V;H"89>:!\I"Q!):7M
-MZ,R,R`F'X%#(+:6=P=#D7`!!;0$"IF&-+2^\A%PXS:4-B2"8-]EF#%S,*5WE
-M3?^,O$#W.78P(`$=W:T@I.0LF0VME[:IK>VY+&3D<*VE_8%XP%XYWQ"</$8]
-MY7U9+'PL(J'G((`IO5V-'AQDO).-C2&F.L$M80`D9(SAI=U1MG`8]^F@3/S@
-M;>5=<4`<3$BA&79@`NT=32E,9-PX[;V1TS:YT;'HG&3\/QVEC1]P,"Z)ANP\
-MD$$EI>T(?)RPN0'GF*@Q?3UAK&0D<''];0FHLT'QLPSD7+B])3T9L*PX5Y]`
-MS"SI'25-;[RD[!\Q6;;(^<W]D6`D9(R9_;V!QI;Y,8G0)"3P+24=\:!LL$,I
-MR.QLGDTE?1EL)+S6,3&GB'\M/2TVW(1\*KU]4?LXCX&A(!PD;($EI>TVC"S6
-M:8KP[)@M)=WQ\"3<@(&MV09^04UM!TR$I-B-W8UIF%8YX<;,)+QGW>5-Q^S,
-MX'>IF*P`@=VE+?A<)"RY[?&/]CEMC=FL9.30$5T]@<B@SZ$?K%Q\:+WE?2$0
-M/-#K^6ZP,%<]I<WK?.1,:^WM.<;/D8W!@"1D#-G='='F`*A):6#\',`MY5T1
-M8/P,:'FIF+#.;5T]N0QDW/BM#4&Z7B'MD1:<A'S*?:6-YT#@?[FH#)RL`:4E
-M;98\_``)H4Z`"'$=?<$0Y"1P0;TMUW:7$=&?S&2D6,TE/=F`<':)PQ#\C#<=
-MY;W'S-PL_P$I.)@9/9U16"1D#$F]#2$&+F'1N=`D)-!1)1WQ>*P@9Q>@S,QV
-M3>6=X2RD3)8!X0Z8IVU];<Z<A'QNS3V1ZRCI\>$@W.0,H:6E[:8LD)YIAJS,
-MX*TE71'`7)Q@X?&IB!YQ/0TIS(2D(.V=;2G(@N$!!KSD_%N=)4T7K.R8UZ<`
-M;/!A7:5MZ!RDK(E180[66<U-X5!DY*SQ';WAZ(AI@:<LI-QX3>5]83#,,%-I
-MZ*S0-_TE3=\\Y$R:K1%WUL<MS?$@)(3,29V=$9Z@HJ$)P!Q<<*WE7=&@3.QV
-M2:\`T(:-I?U9;.0<>)%M(7[208VM9IR$G!X]76V'8$CIF8A,7&PAI26-ILQ,
-MX&D)"/!XD=T=\3`D))"!#9%?1KDM+;<,9*3@C:6]V2"`NODJ+!S,3YWEO:F,
-M?-#_H6-@X-G]W2VXI&0,Z<UM>0;O\2T9$.3DK'&EG?'(<,@I=P`\/`C-Y1V!
-MT!P,-N&Y:.!?#1T-6WR$?":-3;$BAEE1`:!<9$PY7:7M[A#`XVGHC#S`K26E
-M4>`<_.!9@8/8YM&=33F,9*1@K?TM]RAG,;'F/&2<3GTE32F04"CINY!,T"&E
-M)8W&?%Q0*?$YJ.CAO3W!D.3DK,%]S:%69J$Q!^PDI"`-Y7V!P&R`)Q?8;"Q?
-M?26]%TPDS`)Q01N(5VT]T9BDA$PI_?WQODA'`3E`7"10$25=4?B,4-Z)WA#L
-M5HTEG6$L))QX,5%)EKJ13>V2?(0<]DW=[6?89AFAR#PD#)FE)8TRC(R8Z<?@
-MK""1I=T1`"2D<.'MP0H&H8UMZ8R$)`#M74T9F)A'H1ILI#P:G>4]"2R\\-^Y
-M1O#`&9VE;:C<Y(P7;:TIMC>M;>%PY&3LL:5],>@`YOEW,)Q\&`WE'<'P_&QF
-MV8<@0+_-74UG/&1\QNT-84Z2`>VQ&%QDO"G=72W:L-BW"3A,G/`1):6MV'R\
-M6'F9-@"VK=T]H6QDI(#1O=&G-@E1D0X\9!SV/27-:;`P_@GN+/PLV:4E#2X\
-M')!7@0<82(']??&PY.0L83V-^78[P1&7[.2D`&TE?8'@K)B7!P!,C%O]Y3T)
-M#*2,0D&AQGCI#7TM"*2$O+>]O4&^ECGQ&;"DY"PQ)5U1B.PPZNGH[`S(C24=
-MP="D_/@!,6?(JZW]C?/\A-PH#9TM)T@3@6%(?.1,B5TEC3OL+&CI(S",@'&E
-MI:T@7%SP65&AAL:!30TY;&0DL*W=S7E(J+F!>HPD?&;]Y3VY4`P`9ZGX+'!Y
-M':6-)IPDC$<M<1_6:>W-`3#D9&R!W?VQUE@O(1>0W-S@C>4=L<"\K,ZYPK`0
-M@TVEO2E,Y/SVK>V9AMMQ#9&X7(0\QYW=+2M@*,FYV#Q<4/$EI2U(O,SX22F8
-M<"@M77UA+.2D@/$-,=OFH>VM"CR$7&B]I<UI8.`/^29L'(Q)727-&\S\,)=9
-M[@#8`9T=$8`DY"RA32UIML<1K6GL9"2P[27]@5CP5HE?\/Q,COWE_?GL'.PB
-M82DX(&E-'>V6W&2\'\W-89Y.8:TA0"3D;,&E75%6T.!?*7@,O-B-Y=TQ\-R\
-MN.'AKEAJ[9T-![R$W`AM_='/J*GQP0B<9#SWW26-[U`0AFF^K$PP,:6E+7@<
-M'+!Y,>F(]K$]3:'L9"0PT9V-26BNX;&K#.0<*#WE/7EP[*#WAV",4$D=)<TZ
-M_*1LYQ&!KN@Y#;TQP.1DC"&=/<$VB.G!*="DI,!MY1TQ8`QPBHG6K"RBO27]
-MN0PD/':1$:FH3ZU-K>A<A/R/_1VM2UCRH9D@G*0L026E[2@,;&@)3P"L2"VE
-M'4'0)%R`0>UASIX!#>V/O(1<.,U=#6F@2"FA1@RDS*E=Y<U_C$P`=PEHD.`!
-MW=VMH*0D+)F-T0>VB2UMN2QDY'"MI?V!^(`"F?_0'#PV/>5]6:S\K&K9$V``
-MZ3U=C3X<9+Q3C6U9YALQ[8'`)&2,X5W=T;8PN"GIX#Q\8&WE77'`G,P(6;EH
-M`()MW4WI3&3<N"U-\1L&F:TQZ)QD_,^=I8V?\,"J"?9L_!!!)27MB'Q\P$EA
-MTZ`H\7T]8:QD)/#Q/>WIUM\Q<3/,9%PX324]&4!0B"F/,+SLZ1TE3<^\7"Q?
-ML?FHN)E-_9%@)&2,F?U-8<8&6?&)4"0D\"TE'3&@[`#/J7ALC*:]Y7W9;*2\
-MEK%!\TBG[?TM1MR$_.J]?1%KR(?!H2`<)&QAI:7MMFRLMFGN$&P8+27=\?"D
-M'&"!T3F6/C&]C4=,A*38C1V-*?@&V6&V3"2\)]TE3<?LC*`7-Z`LP`%=I>TX
-M7"2LN2U!._:9C0U9K&3DT!%=O6$(F`?A_RRDG(B]Y7TA$+R0HTF&</"I_:7-
-M.WSD3#LMK8FVIU$-08`D9,P9W1T1YF`&^6D`?-Q`+>5=D6`\C*CY1R#POHVE
-M/3D,9!PX48T!\DZ!;1$6G(1\.GVEC2?`6,<YZ,P<+($E)6UVO#Q@B9G&P,B1
-M'7U!$.0D<$%-K;<VZ5&MW\QDI%C-);T98+`FR4M0?`RW'>6]1PP<K!]A1]C8
-M63V=K=BD9(Q)30U9!LK!43G0Y.30424=,?A0V#=WX$Q,%DWEG>$L7,PV@:$&
-M6.>-G6WNG(1\;LT]\3J629%A(%SD#%FEI>U>K/#R:9;L3."M)5T1P%Q\X"&Q
-M1TB>$?W-Z<R$I"#M?>W7B*,!P<:\Y/P[G25-EU`LN*F/0`QP8:6E;2@<I%")
-M$2%F5B%-36'09.2L,1U-(>BHN<&G["3<F$WE?>$P#$!/*4@L4#=])4TG/"3,
-MBE%QYZAW[4UQ("2$S,F=?7$>V+/AR4#<I'"MY5W16,PLQLD*L*P&#:5]H6SD
-MG/AQ+=GFXC$-K2:<A)S>/=UMYR#HR1G(O*1L(:4EC5[,S*!I*?@0F)%='7$P
-M)*1P@8WQ+\:9[>TW#(2D8(VEO1F@X!.9VNS<3&\=Y;TI;/R0W]FRP&!9?=WM
-M2*3DC.D-[4E&IY'MV1#DY*QQI9TQR#`HB?=`_#S(S>4=@="<C`8AZ3B`I\W=
-M#<-\9'RFC<W!$A[AK<&@7&1,N5VE[>Z08$^)R`S\0*TEI5'@G#R@V>$R(.:M
-MG;WYC&2DX*T]K0=6EW$Q)CQDG/Y])4VI\!#V:1K0O%`AI26-AOS<$"FQ:0AH
-M83T]07#DY*S!?0T9UL[A\0?LY*3@#>5]80#L(`<W(`SL'WTEO5?,I`P:\8&R
-MR"F-/5%XI(1,*?T],?Z(J4$YL*0D4)$E7=$XC!#N:;:L;*@-)9UA+"1\^+$1
-MZ:BKT;WM`GR$'/9-'2TG>.XA(;C\)`QYI26-PFQL..G?@"P@D:5=T0"DI/`A
-M+8&N!N$-C6F,A"0`[5W-F7BXJ2$"C*0\`GWE/0DL3+`G"2@00-F=I6W6W.2,
-MU^U1=_97+8WA<.1D[$%=?;$H8"X9]_`<G-@-Y1W!,/SLWID/@#"_3:5-!SQD
-M_`8MC2$>.K%M,1BDA+PI'5TMHD`XJ<F8O!QP$26EK1C\3!CYN>A`]BW=_:'L
-M9*1@$4V1S\8YK1&./&0<=CVES>G`P"))GNQ\[!FE)0T2O)SP5V%O(#@!?7WQ
-ML.3D+&&];4GV#S'1%VSD)`!M)7V!X-!(J>=`O`P[?>4]"8Q<;-K!^:@8:<V=
-M+8BD9$Q'O4W!_L;9D=FPI.0L,25=48@LP,,IR&S,2(WE'<'0I#RX@<%O.$LM
-M_8TO_(0<*`U]K7^()T&!2'SD3(E=)8T[+*RHZ?J0#`!QI:6M(%S<,-D1>99&
-MP;W-^6QD)$"M'0TY"$89`:(,))P&_>4]N=",8,>76.R0>1VE#=Z<)&RWK;%#
-MJ,F-3<$PY&1L@1W]019X9V$7$%S<8(WE';'`3-#RR5YPT&.]);WI3.0\ME$M
-M2;93$<T12%R$/`=]':V*X+;Y.:#\7%#Q):4MR$R,2,DWH!`H+:5]@:SD7&`Q
-MC<%*IN%MK2H\A%R(3:4-Z>"@9YD&C-R,25TES:/,/$`7F89`6,$='=&`).0L
-MH<VMJ;8742V)[&0D,"VE_8'8L`9)_Y!\O$[]Y?UY[)PL2B$WV.")O=UM]MQD
-M3-\-#>&FP@&M(4`DY&P!I=W15A"@QRE83#Q8C>7=,?`<3,@AH68@JNT=S4>\
-MA-P(;3V14Y8)D4'(G&0\M]VEC>\0\#Z)YBR\\#$EI2WX')Q`^4$W.)8Q_;VA
-M[&0D,!%];0DH:P$QJ\SD'.@])3UY\"QX%Z?`#*Q)W27-*CRD[&=Q(2:(><T]
-M,<#D9&PA?;V!-JA)02E0I*1`[>4=L>",,%OIB"SL@KTE_3D,)+PV<7''Z-\M
-MO:TH7(3\;SV=4:MX&^$9X)PD[$$EI2VH#.RHB9NP++@MI1U!$"3<8,$MH28^
-M0<WM3[R$7/@-78WIV.C)(3;,I$Q7W27-GVS,8!?I.-!@P=U=K:"D)*R9;7&?
-MMDGM;?DL9.1PK:4]83@@X]G/K-S\=CWE?5FL_%!+F9K`0&D]I8T.G&1,KVWM
-M>8;O<6T!P"1DC.%='=%&0&B)*6#\G&#MY5UQP'P,Z-EIN,""C5V]:<QD'$@M
-MS;'J)J$M\>@<9/QOG:6-_S"`K\E6C'S0024E[6C\_`!)(2+@Z'&=_8&L9"3P
-M\3TM5Y9'<1'SS&1<.$TE/9G`D*AIPY`\;.G=)4T_3-PL)\&)"#C9O7T1X"1D
-MC)D]S2'&?N&1"5`D)'`M)1TQ6"Q@I]=8#`PFO>5]6>RD3+9!@=HX9VU][<8<
-MA/SJ3?V1BFC7L:'@W.2,8:6E[4;LT"9I)E",6"TEW?$PI)S@89&)*,YQ/8TW
-M3(2DV(T=;:FX3B%A]KPD/*<=)4W'+&P85V=@[$`!7:7MN-RDK$FM`<)V60W-
-MH:QDY-"1W;WAB$A78;\LI)P(O>5](9!,\%,)UM"0J?VES>/\Y,R;+5&I=L>M
-2#;%@)&0,F1V=D>;@SMEIP)S<
-`
-end
diff --git a/share/isdn/msg.g711a.uu b/share/isdn/msg.g711a.uu
deleted file mode 100644
index d1cb02bbd369..000000000000
--- a/share/isdn/msg.g711a.uu
+++ /dev/null
@@ -1,1505 +0,0 @@
-begin 666 msg.g711a
-MRXL+"^OJJ^LJJBNKJBKJJJJJ*BJJJJHJZBHJJBOK"PO+2\L+ZRNKJJNKJZKJ
-MBHJ*ZNKJZNKJ*JLK*ZNK*VO+2\L+:VOK*ZNKJRLK*ZKJ:HJ*:FH**HLKJRNK
-MJJHJ*JNJJZHJJNMK:VMKZ^LK*ROKZZNK*RLKJRNKJZHJ*JKJZBHJZNIJZFHJ
-MJJNK*RLKZVOKZ^MK"VNKJROK:XMKZ^NK*FKJZBIJ2FJJ:JKKZVN+"^LJZBJK
-MJ^NKJJNK*^MK:^NKZ@I*RFJKZ^LKJZNJJROKZ^OK*RLK:^LKJZHKJRHJJZNJ
-MZNJ*:BJKJRLKJZHJ*JHJ*XN+ZXM+ZROKJBHJZNIJBNJJJZLJZNHJJROK*RMK
-MRVOKZRLKZVN+*ZHJZNJJZ^LK*ZJJJZNK*HIJ:FJ*ZJHKZZNJJJLKZ^OK*^MK
-MBXL+"VOKZRLKZKIJJFJJJ^KJZBHJZBHJJ^OK:^LK*RLKJNHJ*BOKZVN+BVMK
-MZVOKJRKJBHKJ*BHJ*JJKJJJJ*RLKJRHJ*JLK:XN+Z^LK*NKJZNHJ*JHK*ZMK
-M2VOK:ZJK:VLKJBHJ*BHJ*JHJZBHJ*NHJ*BHJ:NJJ*^N+BXO+NTL+ZRNKJ^J*
-M:NJJJJKJ:BJJJBJJ*ROKJZHJ*JKJZBHJJJHKZVN+BXN+BRLJ"PNK*RLJ*BKJ
-MZJJKZRLKJZNJ*NHJJBLKZ^OKZRNK*NIJ"HIJ*JJJ*VOK*RNK*^LK*ROKBVOK
-MZVMK:RNKJBKJZNJK*RNKJZOK:RNJZHH**JJ*ZJNKZ^LK*^MK:XN+:^OK*RLK
-MJBKJ*JHJZNHJJJJJJBJJ*VL+BVOKZRNJZNHJ*JJKJBIJ:FKJJVL+"PL+"XMK
-MZZNKJJHJZFIJZBKJ*JLJRBJKJNMKZVMK"\M+R\MKJRKJB@IJZNKJ*NHJ*BJJ
-M*^LKJZLK:RNKJRLK:VLKJNKJJJMKR\MKJZJJ*NKJ*JHKZRLKJ^OKJFH*:BJK
-MJRNKJHL+JJOKJZNK*JNJ*BJJ*VL+"VLK*RLKJZNJJJHJZNKJJNMKBVMKZZLJ
-MZBJJJJJJJRNK*FIJ*JJJ*BJKJZNKJZNJJJJK*^LK*VL+RTO+BVN+*RIKZ^KJ
-MB@H*:FKJZJHJZNKJJBMK"XMK:VMKZZNKJRLKJZJJJBOK*ZJJJZNKJZJKJNKJ
-MZBJKJZKJZBJJJBKJJJLKZVN+BVOK:XMKBXN+ZRO+"RJJJNJ*BLK*"@IJZNHJ
-MJRLK*RLK:XN+:^OKJRHJ*JNK*RNKJRLKJROKJZNK*^LKZ^LKJZLJZFJ*BFKJ
-MJJNKJZNK*ROK:VMKZRNKJRLK:^I**NIJ*BHJ*JJKJZLK*RLK*^OKZRLK*RLK
-MJZNKJZNKZ^OKJRHJJNKJZJJKJRKJ*JLKJZJKJRKJ*JLKZ^N+BVMK:^LK*VN+
-MZZLJZNKJZFJ*ZVMJ*BKJJJNJ*BJJJJNKJROKZVMKZVN+ZZHJ*BJJJJHK:XMK
-M:RLKJJKJZFH*BFHJJBJJJJHKZ^MK:^LK*ZOK:VLK*ZLJZHJ*:BJKZ^OKZVOJ
-M"BNJ*BOK:XN+:VOK*ZHJJJLKJZLKJZJKJZNKJZKJ:HJ*ZBJJ*^MK:^LK*RLK
-M*RNKJZNJJZJJ*NHJ*JLK:VOKZZNKJROK*^OK*ZNK*NIJ*HMKZJNK*BHJJBLK
-MZ^LKJJJKJROK*ZNJ*FIJBHH*"FJKZVMK:^OK*ZLK:PO+RPN+ZRNJJNKJ*BJJ
-MJJJK*ZNK*ZNJ*FJ*:BJJ*JHKZ^OK*ZNK:HJKJBHKZ^MKZ^MKZRNK*^MKZ^LK
-MJZLJ:HIJ*BHJ*JJJ*XL+BVOKJZJJ*FIJZNKJJJJKJROKZVOK*RLKZVMK:^OK
-MZRNKJZNKJBIJBHIJ:NJ+R^N+B^LKJNIJ:NKJJJLK*ZNJ*BJJJJLKJROK:VOK
-M:VLKJZOKZ^MKZ^OKJRHJJJNJ*NKJZNHJ*JJKJBHJZBJJ*VMK:^MKZ^OK*RNJ
-M*JJJJFKJBXOK:VMKZRNKJZNJ*BHJJJNJJJHJJROK:RNKJZHJ*BJJJZJJZFKJ
-MJJNK*^MK:^LK*ROKZVMKZRNKJBKJZNKJ*BMK:XMKZRNKJZHJ*FKJ:^MJJJJJ
-MJRLKJRHJZNKJ*JJJJJLK*RLKZ^MKBXN+RTO+BVLKJBKJZBJJJBKJZNIJ"HIJ
-M:NHJJBOK:XMKZ^LKJRJJ*NKJ*JJKZVMKBPN+:VLJJ@OKJRNJJJNKJZLKJRKJ
-MBHIJZNHJ*BJJJJNKJZNK*RLKZ^OKZ^LKJZNJJJNKJ^LKJJJK*^OK*ZNKJJJJ
-MJJNK*^MKZRNJ*FIJ:FKJZBHJJPMKJBLK*^OKZ^LKJZJKJZLKJZKJ:HIJ*JJK
-MZRLK*ROKZ^OK*ZNK*RLKJZLKZVN+:VOKJRKJZFJ*:NHJZNHJJJHK*RLK:VN+
-MBXMKZRNJJJNJRHHKJZNKJBKJ*JJJJROK*RNKJZNKJZNK*VOKJZNK*BHJ*JJK
-M*RNKJNIJZBHJ*BJJ*RLK*ROK:VMK:^LK*VOKZ^OK*ZJJJJHJ*BHJ*NIJBNIK
-M*^JKJZLKZ^OK*ZNKJROKJZJK*VMKZRNK*BJJJJJJ*NJJJZJK*ZLK*RLK*RLK
-M*ZNKJJJJJJJK*^OKZROK*RNKJZLKJZJJ*BHJJJHJZNHJ*HKJZZLKBVOKBXN+
-MBVMK:XN+*ZHJJJLJZFKJ:HIJZNKJ*BJK*RLKZRMKZ^MKBXMK*ZIJZNHJJJJJ
-M*BHJ*JNKJZOKBPO+B^LKJZHJJJHJ*NJJ:RH*JBLK*RNKJBJJJJOKBVOK*ZJJ
-M*NKJZJJKJZNK*VMKZRLKZ^NKJZNJ*BJK*ZLKJZJJ*JJJJJLKZ^MK*ZHJ*JHJ
-M*BHJ*BOKZ^LK*RLK*ROJJHOK:XOKJZJJ*BHJZNKJ*BJKJJJK*RLK*ZHJZFKJ
-MJJJKJZLK*ROKZ^OKZ^OKZVMKBXL+:ZOJZNKJ:FKJZNHJ*BHJ*BHJ*JLKZVN+
-MRXOK:\LKZJHJZBHJJJJK*ZNKJZJJJNKJJNMK:VOKJRKJZBJJJJHJJJJKJRMK
-M:XOKJJJKZVMKZRIJ"HIJZJJKJZNK*NIJ*BJJJ^L+RSN[2TM+RPOKB@KJ"@J*
-MBFIJ:NHJJJJJJJJJ*BHJJBOK"\O+"XOKJZNKJZNJJBHJ*JHK:XL+:RLKJZKJ
-MZFH*2DH*BFHJ*BJJ*RLK:\O+R\O+"VLKJZJJJNO+JFHJZNJJ*BHJ*JJJJROK
-MZRLKJROKZ^LKJBHJ*JLK*ZNKJZNJJRNK*JJK*^LKJZNJ*JJKJJLKZRLK*ZNJ
-MJROKBXMK*RKJ:FHJJRKJJBHJJVKJ:VOKZRLKJ^MKJJLK*ZJKJBHJ*NHJJZLK
-M*ZNK:VN+ZZLKZRLKJZKJ:NKJZNKJZBJJJBMK:\N+:VN+BXOK*BOK*ZNJZFHJ
-MZFIJZNKJ*HHJ:RNJ:RLK:VMKZ^NKJROK*RNJJBKJ:BJKJZNK*BJKJBJJJZJK
-M*ZOKBXMK:ZLJ*JNJJJLJZJJK*BJJ*JHK*ZNKJZLKJZLKZ^OKZZNKJNKJ*ROJ
-MJ^LK:XOKZRNKJZLJZNJJJZLKJZKJ:NJJJZOK*RLKZ^OK:^NK*BHJJRJJJRNK
-M*RNKJZLK*ZNJ*BHJJZNKJZNJJBNK*ZNJJBNKJZNK*RNK:\OK*XMKJ^H*"HKJ
-M*JJKJNKJZNJJJJMK:^LK*RLK:PM+"XMKZZNJJNHJ*NKJZJJKJZNJJJKJZFKJ
-MJJJJ*NHJJJOKZVMKBXMKZ^OK*RNJ*BNJBJHKJBMKZROK*^LKJZNJ*BHJ*NKJ
-M*BHJ*JJKJJJKJ^LKJZJK*VOK*ZLKZ^OK*ZNK*BJKJJJK*RNK*FIJ*JJJJJOK
-MZXMKZVMK:VOKZRNK*FL+JBJKZHJ*B@J**BHJ*JJK*ZNJJBLK:VMK"PN+ZRNK
-M*RNKJRMK:^OK*^LKJNJ*:FH*"@J*:NHJ*BJKZVOK:XN+BVMKZ^MK"XOKJZNK
-MJZJKZ@HJJVIJZNJJJ^MK:^NKJJLKZRLKJFH*"NHJJ^OK*^MKZROK*ZNJJJJJ
-MJJJKJROKZVOKZRNK*RLK*RNJ*NJJJZNKJBHJJJJJ*NHJJZOKZZN+B^HJ*FKJ
-MJJJKZ^OKZVN+BXN+:RNKJZNJ*BHJZNKJ:FIJ*BJJJRLKJRNK*VOK:^OKZ^LK
-MJRHJJJNK*RNKJZHKZROKJ^KJZBHJ*BHJ*BJJ*ZNJ"TN+BVMKB^NJZFJ*:FIJ
-M:BHJ*JJJ*ZLKZRLK:XMKZVMK"XOKJRHJJJNJ*BKJZNKJ*BHJJBLK*ROKZ^NK
-MJBHJ*JOK:VMK:VMKBVNK*FIJ*VLJ*JHJJJNJJJJJJBMKZRNK*JHK*^LKJRNK
-MJZOKZRNK*BKJ:FHJJROKZRLKJRLKJZNKJZNJJROK:VLKJBHJZJKKZRNKJZJJ
-MJJNKJZHK*^NJ:BMK*VOK*RNJJBJJ*ZNJJBHJ*BJJJZJK*RLK*ZLK*^OK*ZLJ
-MJJJJJJJK*RLKJZJK*ZNKJRNJ*BJJJZNKJZNJJJHJJJJKJ^NKJBNK*VMKBTM+
-MJJJJZNKJ:BJJ*BHJJJJJJBKJJJJK*^OK*ZLK*RLK*^LK*ROK*RLK*ZNKJJNK
-MJZNKJBKJ*JJJJBHJJJLKZ^LKJZNJJZNK*RNKJJJKJZOKJRJ+B^MKZRLKJZHJ
-MZBJJJZLJ*BJJJZJJJROK:^LKJZJJ*^MKZRLJ:FKJJROK:VMK:^NKJBHJJJNJ
-M*BJJJJJKJRNK*^OKZ^LK*ZNJJZHJ*JJ+B^KJ*BJJJZNK*^LK*RNKJZJJJRNK
-MJZNKJZNKJJNKJZJJJRNJJROK:VOKZXMK:RLJZNJ*:HJ*:NJJJZJJJJLK*^OK
-MZ^OK:VN+:RLK*ROKZ^H*JJIJ*BJJ*BJJJRLKJJOK:^LKJZNJ*NHJZBHJ*NKJ
-MJ^MK:^LK*NHJJBOK:VOKZ^OK*RLKJZJJ*FIJ:NHJJNMK:^NK*^OKZZLJ*BJJ
-MJBKJ*ZN*JBNJJROKZ^MK:^OK*^N+:RNJZBJJJBHJ*BHJ*BJKJJJJJ^N+BVMK
-MZZNJZHJ*:NKJZNHJJRLKJZNK:PO+NTL+BVOKJZLJ*BJJ*BKJZBK*2JJKJJNK
-MJBKJJJJKJZLKZVMKZRLK*^LKJRHJJZJK*ROKZ^OKJZJKJZNJZFJ*:BJJ*ZNK
-M*ZNKJZNK*JHK*ZNJ*BHJJRLKJRLKJROK*ZNJJFOKZBOKJZHJZNKJ*JLKJZLJ
-MJJNKJ^MKBPL+BVLKJJJJJZNJ*JNK*FIJZNHJ*BJJJZNKJRLKJRLK*^MK:^MK
-M:^LKJJJJ*BJJJBKJZNHJJBHJBHKKZ^L+BXN+:^LKJZKJ*JJJ*JLKJZOKZ^OK
-M*ZLJ:FIJZJJKJZNKJZNJJZNK*RLK*^MK:RNKJZNJJJNKJZLJZFIJZJJKJZLK
-MJZNJJJNJJJL+BZMKZZJJJRHJ*JJJ*JHJ*JJK*ZLKZ^OK*ROKZ^LKJROKZRLK
-MJBJJJJJJ*JJK*^LK*RNJ:NHJJZNJ*NKJJZLKZ^MKZ^LKJ^KJ*JHKZ^OK*VIJ
-M*ZNJ*RLKZZNK*VL+"PMKZRNK*FIJZFIJBHIJ:BJJ*RNKJBHJJROKBPN+:XMK
-MZRNKJJNKJBKJZBJJJZLJZNHJ*BJJJROK:^OKBPL+"^LKZRJ*:FHJJZNJJBIJ
-MBHJ*ZBHK*^LK*ROKZVMK:^OK:VOKZRNK*BJJJZNKJBKJ:FJ*BNJJ*^OKZVN+
-MBVLKJROK*ZJJJBHJJZOKZVLKJZLJJJN*BJLJ*JIJBNHJJRLKJROK:XN+RTO+
-M"XMKZZLJZHIJZNKJ*BHJ*JJKJZNKJJJKJZJKJ^IJZNJJ*VN+"PL+B^NKJJJJ
-MJJNKJBHJJJLK*ZNJJXLK:JJJ*BKJ*JJJ*^OKZRNK*RLK*RNKJZKJ*JJJJJJK
-MJRKJZJKKBPL+"VLKJZJJJBJJ*FKJ*JJKZRNJJBJJJBJJZ^MK:^LK*ZJKJJJJ
-MJJNJ"NIKJZJKJJNK*RNKJZNKZVN+ZRNJ*NHJ*JNK*JJJJROK:VOK*RKJ:NIJ
-MZJHJJJKJ*JMK"PMK*ZNJJJJJJ^N+ZZNKJROK*ZLJ:FHJJJLKJRL+*RKK*ROK
-M*ZLKJRKJ*BJJ*RLKJNKJZBHJJJHJ*JHK*ROK:XN+:VOKJZNK*BKJJJNKJZLK
-MJRLK*^LKJJJKZVOKJNKJ:HJ*:BJJJJHJZNJJZZL+^TO+RPN+BVLKJJHJ:FHJ
-MZFJ*"@J*:NJJ*^OK*ZLK:^MK:RNK*ZNJJBHJJJLK*RNKJZNJ*NKJ*JOKZRLK
-M*RNKJNKJ*NIJ:NHK:XL+:ROKR^LJ*ZJK*RNKJZJKJRNKJZJJJZNK*^OK*RLK
-MJZNKJZLK*^OK*RNKJJNK*ROKJZJK*FH*"FKJZNHJJ^MK:VN+BXMK:^MK"\L+
-MZZMJ"HIJ*BK*BJIJ:JJKZVMK*ZLK*ZLKZ^LK*ZNJJJJJJJNK*NJK*RLK*RNJ
-MJJJJJJJJJ^OKJFH*ZBJK*^NKJVM+2XNJ:@IJJRNKJZNK*RLJ:FHJJRNK*XNJ
-M*FN+ZZIJ:JJ+RXLKJZJJJJHJJJOK:XLKZ@J*ZBLKJVK*"FJJ*RLK*^MK"VOK
-M*ROKZRNK*BJJ*ZNJ*NKJJNN+"XOK*^OKJRIJ*NL+B^LJN@HJZJJJZNJJ*^MK
-M*ZJJ*JNKJ^OKZVMK:RLJZBHKBPOKJZLK*RNJZNKJZBJJ*FHJ*^MK*ZJJJBN+
-M"XLKJNKJ:HJ*:BHK:VLK*NHJJ^OKJ^M+BVL+ZZJJJJJKZZNJ*NKJ*NIJ:FHJ
-MJRLK*ZLKZVMK:^NKJZLKJRKJZBJJJZKJZJHKZXN+BXMK:PN+ZRNK*RNK:@I*
-M2HJJJRKJBHHJJZLKJVHK"PN+:ROK"PN+:RNKZVN+ZZIJ"LJ*BFIJZJOKZRLK
-M*RMKR\OK*HIJ*JHKZRNKZVOKJHK*RHHJJ^OKZ^MK:VOKJZOK:XOKJNKJ*BJJ
-MZ@HJRPL+RRNJZNJJJBHJ*BOK:RLJBHKJJBLKJBJJ*RNK*NHJZ\N[.\MKZRLK
-MZRNK*BHJJBIJ"@KJJRNKZFHJZXL+:ZLJ*JHKJNHJJ^N+BRNJJJKJ:XOJ"@KJ
-MZVNKJZLK:PN+*ZHJZJJJJJNJJ^OKJRHJJBOKBXLK*NHJJ^NKJJJJJ^LKJNKJ
-M*JJJZFKJ*BMK:ZMJBNJK:VN+:^N+"PN+*ZKJ*\OKJZJ*BFHJ*NIJBNJJJBIJ
-M:JIKBXN+*ZNK*VMKZZNJJJNKJBIJ*BOK:ZNJJBMKBVLKJZLK*RIJBHIJ*XO+
-M"^NK*JHJZHH*:JMK:ZLJ*JNK:JOK*JKK:VOK*ROKBPL+:RNJ*JJJ*FIJ:NJJ
-M*ZKJ*JJK*ZNKJJHKBXMKJZJJJJJKJRKJ*JJKJBKJJNL+2\N+ZROK:^NJ:FKJ
-MJRLJ:HH*BNO+JZHK*XL+:ZOJ:NJKZRLJ:NJKZRNJ*JJKZXN+:VOKZ^NKZFKJ
-MJBOK*ZHJZBJK*ZLJZJKK:RLJBHKJ*VN+*ZLK:PMKJRJJZXO+:ZNJ*JN+JXKJ
-MZ@KJJRLKJRJKZVOK*RHJJJJJ*HH*BBHJ*ZNK*VN+:^LKJZHKB\MKJNKJ*BKJ
-MB@KJ*XL+BRNK*VN+:RNK*JHK*ZMJBFKJJZNJ*FIJZBKKBZKKBXN+:ZKJ*BOK
-M*ZLJZBKKBVOK*ZOKZ^NKJBJK:PMKJ^KJZJJJJFH*BNHJ*NIJ:BKK"\MK*RLK
-M:XN+:^LKZ^LK:LH*:JOKZRLKZPO+BRI*ZJKJ*RNJZFJ*:NIJ:FJJZ\N[RVLK
-M*RLK*ZLJ*JOKZRLK*ZNJJJHJZFHJJJHJ:FJJ*XO+BRLJJBOK*RHJZNJJJZNK
-MJRMKRPOKJZHK:^NJJBI*BBKJZFJ*ZJN+:^LKZVL+NTO+BVOKZRNKZFKJ*BKJ
-M:HIJ*JNKJJHJ*JNKJZHJ*JKKBXMK*RLK*RNK*BJKBTM+RVNKJJHJ:HK*RHHJ
-M*ZL*NNKKZXMKZVN+RPN+*RHJ*NHJ*NIJ*JJKJRHJ*JHK*ZNK*^MK"XOKJ^N+
-M"XOKJNIJZJJJ*NIJZBMK:RNJJBOKBVNK*BJJJZIJBFHJJJJJ*NL+ZXN+ZRNJ
-MJRN+:ZNK*RLKJZNJZBHKZRNJ:FHJ*^LKJBHJJ^OKJNIJZJMKZZKJZBHK:RNK
-MJRMKBVNJZHKJZ^MK*ZHJJRLKJZKJZJHKZRLK:HKKZRIJ:JIK._M+ZZNKJZNJ
-MZNJ**JJJJBKJZJLK*ZHJ*JLK*ZOJBNHKB\L+ZZJJJJLJZNHJZTL[2XOKZVN+
-M:ZLJ:FJJ*NH*2DH*:BJJZFIK"RMK:^N+"TN[BZLJ*BHJZFJ*ZNL+2XOK*BHJ
-MJZNKJZJK:VNK:@H*"HIJZNHJ*BMK:^LKZXO+2TN+JZLKJZLJ*BKJJRNKZHIJ
-MZNJKJROK:^NKZRH*:FJJ*RNKJZOK:VOK*ZJK*^LKJZHJJBOK*ZKJZJKK*ZKJ
-M*BJKZRLK*ZNK*RNKJZHJ*JLK*RHJJBMKZZLJJNL+2\OK*ROK:VNK*@H**VOJ
-MZFJ*ZJJJJBHJJBMKBRNJ*JHKZ^NK*BJK*ZNKJBJJJXN+:VNKJZNK*NKJJFL+
-MRXLK*BJJ*JJJ*BJJJZLJZNIJ*JJJZNHJJ^MKB^OKBTL+BTLK:NJJ*NIJ:HHJ
-M*ZLJZFHJJ^OK*RJJZXL+B^LK*VN+B^LJBFJJJRIJ"@HJ*^LKJJJKZVOK*ZJJ
-MJVMK*RIJZBN+RPMK*RMK:^LJ:HJ**@MK:FKJ:BHJZFKJ*PM+"^LJZBHKZRNJ
-M*BJJJ^J*R@IJ*XL+B^N+2SL[RRNK:PO+"RLJ:FKJ*FK*2LIJJBNJ:NHJJZOJ
-M:FKJZPL+:ZLKZVMKZFHKJRL+B^LKJZNK:PN+Z^OKZ^LJBLH*ZJOK*ZHJZBJJ
-MJBHJ*JHK*ZJJ*JJKZVMK*ZJJJJLJ:FJJ:\N[2XOK*^L+:ZLJ*JKKZRK*NDJ*
-M:JJ+*^KKB^OKZZNJ*^N+B^NKJJNKJNJ*:NJK:XLKJBJJZVOK*ZNKZ^NK*HIJ
-MJNOK*^LKJRLK*FJ*ZJOK"\L+BXL+"XNJBLH*:JHJ:@K*BJHK*^KJ:XL+RVNJ
-M*BJJJROK*ROKZVMKJRHJ*VN+ZRNJJRNKJNKJZBJK*ZLJZNKJZNKJ:NJJ:PN+
-MZRLK:XN+ZZIJZBJKJZLJ*JKK:RNJ*BJJJZJKBRLJ:^NK*FKJJNOKJBKJ*NN+
-M:^LKJZNK*FJ*BNJKZ^NKZBJJZVMKZZNKZVL+:^NKJROKZZIJ:FHJ*BJJ*JMK
-M"POKJNKJJRLK*ZNJ*^LKJNJZNBHJJBLJJVL+2PLKJJHK:XMKJ^IJ*JNKJZJK
-MJ^MKZZIJBNHJJROJBBHKZZLJZBJKB\M+:^MK"POKJRKJ*BOKJFJ*BNJK*ZNJ
-M*JMKBVLJ*FLKJXMK*ZJJ*^OKJ^IJ:JHK*ZHJJJNKJ^J*"FJJZ^LKJJNK*RNK
-MJZJK:XN+ZZNKZVOK*RKJ*JJKJRJ*BNJK"\N+ZRLK*RLJZHKJJBOKJZKJ2HHK
-MJJLKJ^N+"XLKJZLKZ^LKJBHJ*JJJ*NHJJ^N+:RNKJ^MK*ZHJJJJKJZIJBHHJ
-MJRNKJZJK*^OKJZNK*VN+ZZHJJBOK:RLJZBJK*ZNJ:FKK*RJKJBJJJRLJZFIJ
-M*BOK:^LKZXL+B^NKJNN+BXOKJFJ*BHJ*:NKJ*BOKJZJJJ^OKZ^OK*XL+:^NJ
-M*JIK:^LJBLJ*ZJHJ*JHKBPO+:ROK*VJJ:VJ*ZBKK:VMKZ^OK*RNK*NHJJBNK
-MZHKJJJNK*FKJ*BOK:^LKZ^MKBXOKZ^MK:^NK*FJ**JNJ*NJJJROKJ^IJ*NMK
-M:ZLJ:FKJZNKJZBIK^\OKZZNK:PL+:^MK:VOKJRKJZJOKZZOJ:NHJJJJJJJHK
-M:^LJ:FKJJJNKJBHJJ^OKJ^IJZJMK:VOK:XL+RXLKJBJK:^NJZBHJJ^MKZZNK
-MZVLJJJN*:JOK:VLK*NIJ:HH*"NJJZ^LKJZJK*^MK*ZJJJVO+BZMJ:JN+"VOK
-MJ^L+BVNKJBMKBXOKJNIJZNIJRKI*RFHJJBKJZJKK:VOKZROK"TNK*NMKR\N+
-MZRLKZ^OK*ZHJJJLKJ^IJBNJJ*FK*RFJJ*^NKJJLK:VLKJJLKBXMKJNJ*:NHJ
-M*^LK*^MK:RNJJNN+RTMKJZJK*^NK*BJJJVLKRDJ*RBJKJZJJJJOKZZJ*R@KJ
-MJVOKJZOKBTO+:RNKZVN+:^LKJZNK*FJ*:NJK:^NJ*JJK*ZNKJZLK:VNK*HH*
-MBBJJJJJJJ^MKZRLKZ^OK:PM+*ZOK*ZLJ:FKJ*BOKJRKJJFOKJZJK*VN+*RIJ
-M:NKJ*BJJ*BJKZ^NK:HIJJVN+BXN+BXN+*ZJJJJOK*ZLJ*BJJ*ZLJZBHKZRLK
-M*FIJZJHK*XKJ*ZLK*ZHJ*BJKZ^NKJROK:VNKZBJJZXMKJNKJJBOK*RNKJRLK
-MJRKJZBHKZRLJZBJKJZMJBNJJZPL+B^OK:VLK*NIJ*JLKJNIJ*JJKJRKK"ROK
-MB^NJZFHJJROK*ZLK:PL+*^IJ*JOK*RIJBHIJZBHJ*JKKBVNKJBHJJBMKBVOK
-MB\O+BZNK*XN+:ZLJJJJJJHI*2DJ*JJNKJJJJZXMK:ZN**XOKZZLK:XL+RXLK
-MJRMKZZOJBFKJJJNKJZJJJJKJB@IJ*NN+ZZNK*^MK:^LKJ^L+"VNJ:@H*BFIJ
-M*NKJ*JJJZNJJ*XM+NPMKBPM+NPLK:PNKJZL*2KI*"DI*BBJJ*VMKJRHJ*BOK
-M:^OKB\M+RVNK*JHK:VOKJZJK*RLJ:HIJ*JNKZHH*"FKJJJJJ*XO+RPN+ZVN+
-M:^LKJBJJ*^LKJZLJBNMKZHJ*:BJKJRKJ:BHK:VLKJROK:VLKJBHJ*^OKJZNK
-MZ^MK*ZHJJJJKJZKJZBHK*ZNJJZLKZRLJ:NJJZXOKJNHJJ^LK*ZJKJ^OK*ZOJ
-MBJN+JJHK*JJKZVNKJJJJZPO+:RNKJZKJ:FIJ*NN+:RNJ*JJK*ZNJ*JJJJZHJ
-MZNJJZVOKJZJJ*XL+BZNJJ^N+:^OKJZNKJZKJ:HIJZBKJ:NJJ*FHKZZJKB[M[
-MN\MK*RLKJRKJ:NHJ*BKJ:FKJJJNK*BJJ*VMK*RHJJFN+:^NK*BHJ*JJKJBN+
-MRPMK*ZLK*^LK*FIJZJHJ:@H*BBJKJZNK*RO+R^KJJJN+RXNKZBJK*^NKJBHJ
-M*^OKZROK:XL+RXLKZBKJZ@I*2@IJJ^NKZNHJJBOK:VMK"PN+*RKJZJHKJZJJ
-MJROK*RKJ*BMKRTO+ZRLK*^I*BFH**BLKJ^IJBNJJJJJK*VM+2XLKJJMKBXMK
-MJZJKJRNJJNKJ*BLKJZJJJJLKJRHJZJHK:^LJBFKJJROKJZJKZVN+:^LKZVMK
-M:^NJJBJJ:RL*:BHJJBIJBHIJ*JNKJJJJZPL+BRNKZXL+ZZNJ*JOK*ZLJ*JHK
-MZRLJZJKKBVLKZHJ*:JJKJZHJ*JLKJRKJ*JOKB^NKJRMK:RNKJJLKZVNJBJNK
-MJNOK*ZNKZXN+J^IJBFHJJBIJ:NJJJJHJ*BJK:XL+"PL+"TO+ZZOJZNIJ:@I*
-MR@KJ*JNKJJKK:PN+*ZLK:PL+BRNK*VOKJFH*"NJK*XMK:BHKJZHJZBHKZ^NK
-M*FJ*ZJLK*RNK*^OK*ZNK*VO+R^NKJJLKZZLJZBHKBVLKJNIJ*BHJ*JJKZVMK
-MJ^IJZJOKB^NJJJJKJNJ*"HJJ:PN+*FIKBVMKZ^OK:PO+BROJ:NJJ*ZOJBNJJ
-MJZIJBHJJ*^LKZHIJ:BJJ*JJKZPO+BRNK*XO+BVMKZVL+BRLJBHHJJRNKZFIJ
-M*JJJZFKJ*JKK*ZN+"ROKJVIJ:NJK*VOK*RLKZ^LKJROKB\L+:^NKJJJJJNJ*
-MBNKJZFJ*"FJKBPN+ZZLKZ^NKZNKJJBOKZZLK*RLKJBIJBBHKZRLKZ^L+R\L+
-MB^IJ*ZIJBHHJJVN+BZNJJRNKJNJ*:JKK:ZOJ*JJJJZNJJZJKJRLKJZJK:PL+
-M"VOKZVN+:ZOJ"@J*BFKJ*JJKZRNK*^OK:PN+*ZIJ"FHJZ@JZJBNK:^NKJJMK
-M:^MKZROK:XMK*ZLK:XN+JRKJ*JHJ*NJ*BBHKZ^LKJZOK:RNJZFJJZ^NJZHKJ
-MJJLK*ZKJJBOKZRLJ*BOKBXLKJZOKBXMK:XNJJHLK:NKJ*BOK:ZOJ:NHJ*FH*
-M"HKJJJIJ:NJK:PMK:XO+N_N[:ZNK*^OKJ^KJ:BJJJBIJZNHJ*BHJZFHJZVOK
-MJZJK*VN+ZZJK*^NJ:HH*ZLM+:VLKJJOK:^NKJJHK:VNJ:HIJJ^OKJ^KJJBOK
-M*ZKJ*BL+"POKJZJJJZHJ:@H**JHJ:NJJ*VMKZRNK*XL+B^LKJRLKJZJJJJLK
-M*ZOJBFHJ*BKK*BHKZVMK*ZNJ*VN+:ZOJZBJJ:LI*2HJKBVLKJROKBXMK:ROK
-M:XL+B^NKJZNKJRKJZNKJZFIJZBHK*RLJ:HIJZJJJJZJK:XN+:RNJ*NL[R^OK
-MZVN+:ZMJ"FHJJZLJB@J*JJNKJBJJZXN+:^OKZVMKZ^NKJBJJJFJ*BFJJZVOK
-MJZLK*RNJZFKJJNMKZZJJJJJJJNHJJBL+2PLKJROKBZKJ*RJJZ^NK*NIJZBHJ
-M*BJJJRMK:RNK*^MK"\OKJZLKZRNJ*NIJZBKJ:FIJ*JLK*RLK*VL+RXOKJROK
-MZ^NK:NJJJJKJBHKJJBLKJNHJJJKKR^OJJBMKBRNJZNJKZ^LKJZOKBPN+ZZKJ
-M*JLKJ^J*ZNHJ:HH*BNJKZ^NKJBMK"PL+BVL+RPLK*NJ*:BJJJNKJJ^OKJFJ*
-MZBHKBVNKJBOKZ^LJ*BNJJRNKJZNJJRLK*ZLKZRNJJBJKZ^LKJBJJJJJJJBJJ
-MJJJJJJJKJJNK*^LKJZNKJZJJZFKJ*BLKZVOK:PO+"XMK*ZHJ*JHJ*NKJ*BIJ
-MZBOJBJJJJJNK*RNK*^OK*^OK:XN+ZRKJ*JJJJBMK:VMKZ^LKJJJJ*NKJ:NHJ
-MZFKJJZNJJBOKZ^NJJRLK:^NJJBLKJZOK:VOKJZLK:^LKJZJJ:FHKJBJKZVMK
-M*ZHJJZHJJBKJ*JJJ*JJKJRHJJJOK:VOK*ZLK*XN+ZZLKZ^LKZRNK*ZNKJRJJ
-M*FJ*:JLKJRJ*"FJKBPOK*RNKZXOKJ^J*:JM+:RJJ*JHK*ZLJBFHKB\L+JBJJ
-M*\L[RRMJ"NHK:VNKZNJJZ^NKJBHKZRNKJNJ*"FJJ*ZIJ"NHK:^NK*BJJJRNK
-M*^LK*^OK:VOKZXO+2VMKZVHJ:ROK:VN+*ZLK*HJ*:FIJB@K*"HIJB@K*"HHJ
-M*XM+2\M+N[O+R\L+:RNKJ^LKJZNJJZNJZNJJJJKJ:FKJ*JJJJJJJJZHJZFIJ
-MZNKJ*JN+.VNK:XMKZ^NKJ^LKJZJKJROKZ^LKJZNKJ^OK:VOKZXL+BXLK*^NK
-M*FIJBHJ*"HIJZNKJBHKJ*JHKJZNKJZLK:VN+:RNKJJJK*PM+RPL+2\NK*VLJ
-M*VMK:^NKJNKJZNIJZBJJJBKJB@H*"LJ*ZBJJJBJJJRMKZ^OK:XMKBVN+BXN+
-MRTN[RXOKJZLK*ZHJZBHJ*BIJBFJ*"@J*"@K*"@J*JXNJJVMKBXLK*ZHKZXN+
-M*ZHJ*JLK:XMK:VO+R\O+RPMKZ^NK*NHJZNKJ:FH*RLH*"LI*RLH*:BJK*RLK
-MZXO+RPN+BXMKZVN+RPN+:VN+"POKBNJJ:FIJZJJKZ^NKJZHJ*NIJZJJJZFKJ
-M*BLK*ZLJ*JHJ*NKJZNJJJJHK:PO+2PL+"\M+2TL+:^LK*NIJZBKJZNJJJZLK
-M*RNJZFJ*BFKJZJOK:HKJ:HIJ:NJJJROK:^N+"\M+2\O+BVMK:ROKZ^LK*ZNJ
-MJBHJJNKJ*BHJ*NKJ*JHJ*NIJZFH*"FHJJZN+"PN+Z^OK*ZNKJ^N+"XMKZ^OK
-MJVJKZZJK*RLKJRIJ:NHJJJKJ:BHJ*BKJ*BJKZVOKZ^MK:VOKJJJK*NIJBFKJ
-MJJNJJROK:XL+"PL+"POK*ZLJ*BJJ*^OKJZKJZBKJ*BJK*RN+"RIJ*BJJZNHJ
-MZFJ*"FKJ*JLK*^MKBXN+BPL+R\O+"VLKJRKJZBHJZNIJ:NHJJZNJJBOKBVOK
-MJZJJJBHJ*BHJJRLKJBJKJZJKJBHJZNHJ*ZIJJ^LKBXN+"\M+N\L+BVOK*ZKJ
-M"DK*"FHJJZNJZNHJJJNJJROKZZNJ*BJJJJJJJJJK*VOK:^NKJZNKZ^OK*^LK
-MZ^OKZVLKJZNJ*BKJ*BIJJBN*BJJJ*NHJJJLK:PL+:^LK*ZLKJBKJZFIJ:NKJ
-M*BMKZXO+RPN+:VMKZRLK*RLKJBHJ*JHK*RNK*ZHJ:FKJZFKJZNHJJBHJJJHJ
-MJBNK*VNK:NO+:PL+"PMKZRNK*VMKBPLKJBIJ"HIJZHKJJBHJ*ZNJZZLJ*ROJ
-MJ^NKZ^NKJJKJ*JJJJROK:ROK:XMKJ^IJBNJJ*BJK*^LK*ZHK:XL+ZPN[ZZNK
-MJVKJ*BKJ*BKJ:FIJ:BJJJJHJ*NHJJBOK:VMK:VOK:XN+:^OKZVLKJFIJZNHJ
-M*JJK*^LKJJLJ*JOK*^N+:ZNKZLK*"@J*:NJK:VN+ZRKKZZHK*RJJ*JJKJZNK
-M*VMKBPN+"PN+BXMKZ^LKJNIJBHIJ:HH*BNKJ*BKJZBJK*^OK*ZNKJZNKJJLK
-MJROKJZLJ*BN+"PL+R[N[RPMKJNJKZVHJJNIJB@I*2HKJZNJJJBHJ*JHK:^OK
-M:PN+"XOKZRNKJRNKZ^OK*RLKZRLK*RNKJZJJJRHJ*BKJ:NIJZJLKZRLKZVMK
-MZ^LKJBHJ:FJ*Z@I**JLKBPL+RPN+Z^LKJJJKJZNKJZLKZRLK*RLKJRLK*^NK
-MJBIJBNJJ*BHJZNJJJBHJ*JJKJJHJ*JHKZVN+BXL+B^OKZ^MKZ^OK*ZNJZNKJ
-M*^MJ*JHJ*NIJZNJKJJJJJNIJZBJK*ROK:VOK*RLKZRLKJZLKZ^OKZ^OK*ZNJ
-M*NHJ*BJJ*ROKBXN+:VOKJZNKJBHJZFIJ"@K*R@J*:BJJ*VNKJ@L+:PL+"PL+
-MBVNKJZNKJZLJZNKJ:BJJJJLK*^MKB^OK:^NKJBIJBFIJ:NKJ:NKJZBHJJROK
-M:XL+"\N+:VOKZRNK*ZNK*NKJ*JOK*RNJJFMKZJNK:NKJ:FJ*:FKJ*BHJ*BOK
-M*^LK*VN+BXN+BVMKZ^OKJZJJJJNJJNIJBFKJJJNK*RMK:VMKJRHJJZLKZRNK
-MJJJJ*NKJZNJJJBKJJBMKJRJ+:^MKZZJJ*BJJJRLK*ROKZ^OK:^MK:^LKJBKJ
-M*JJJJBKJ:NIJBFKJ*JHKZVN+"\N+:^LKJRLK*ZNJ*NIJ:BHJJRNKJRIJZNHJ
-MJJNKJRO+R^N+BVMKZZNKJRNKJZHJ*BHJ*JHK*ZNKJJHJ*BJJ*BHJJBOKBPL+
-MBVN+:^LKJZNJ*BHJZBJJ*JJJ*NIJBFKJJBOK:VMKZRLK*ZLKZ^OK:RJ**FJ*
-MZNJJZPO+BVOKZRLK*RNJ*NKJ:FIJ*BHJ*RLK*RNKJRLKJZNKZVMKZ^LK*ZJJ
-MJBHJ*BKJ:FKJJBOK:VLKJZNK*NIJ:BJK*ROKZZNK"XNJZ^OKBVOKZZNK*RNK
-MJBIJB@K*BFKJJJHJ*BJJJRLKJROKBPO+"PO+"XMK:XN+ZRNJ*BHJ:@J*:NIJ
-MBFKJ*BLKJBKJ:NKJ*BN+R\L+BVNJ*@N+ZVMK*^LKJRHJ*JHJZNKJZNHJ*JJK
-MZ^OK*^LKZ^LKJZJKJZJJJBHJJROKZRNKJZNK*FH*"HKJJBOK"PN+:VN+"TM+
-MRPN+ZZKJB@I*2NJ*2FHJZNKJJJLKZ^OK:VLK*RLK*^OKZVMKBXOKJ^IJ:NKJ
-MZBJKJRHJJZJJJJLK*RLKJRLK*ROKZ^OK*RNK*BHJ*BJJJBJJJBHJ*BHJ*JJK
-MZNHK*BJJJ^MK"PN+:VOK*RLKJZLKZRNJ*NKJ*JJJJROKZ^OKJZHJZNIJBHJ*
-MZJHKZ^OK*^OKZ^MKZVMKZ^OKZVOKJZLK*RLKZRNKJBHJ:NIK*RHKJFJ*"HIJ
-MZBHJ*BHJJBJK:VN+"PL+"XMK:XN+BXOKJRKJ*JHJZNKJZBKJ*BJJJJJJJJJJ
-MJBJJJJHJJJLK:^LK*ROK*ZNKJRMKBXL+BZJJ:ZOJ*NKJJJJJJJNJJJLKZ^OK
-M*ZNKJRJ*R@J**JNKJZNKJRNKJZNK*^MK:VOKZRNKJZJKJRKJJJJJJZNJJROK
-MZRNKZRNJZNIJBFKJ*FJJB^NJZ^OK:VN+BVOKJZJK*^OK*ZLJZFJ*:FIJ*JNK
-MJZNKJJNKZVMK:VOKZ^OKJZJKJRHJ*JJKJZLJ:FKJJBMKZRLK*RNJJBJJJRLK
-MJZNK*ROJ*NNJJJLK:PL+"XOKJZJJJRHJZHH*"HIJJ^OK*ROK:^OK*RNKJZLJ
-MJJJK*^OK*RLK*ZNJJBHJZBHJ*JKKZVN+B^LKJRIJ:BHJJJLK*RNJJHNKZJNK
-MJZNJJRLK*^MKZZNJJJJJJZNK*JNJ*JNKJZJKJZJK*^OK*ZLJZBHJ*BJKJZNK
-M*^NKJRLK*^OKZZLK*ROK:^MK:^OKZRNKJBHJJJNJR@JJZFJ*"@J*BNJJ*^N+
-MR\N+BXL+"PL+BXOKJBHJ*JNKZ^LKJ^IJBHH*"HJ*:FKJ*JKKZ^OKZ^OKJZJK
-MJRMK"PL+BXMK*ZLJJBHJ:HIJ:JJ+JRHKJZJJ*VOKZRNKJJHJZBJJ*RNKJJNJ
-M*BJJJZNKZ^OK:^LK*RLKJZJJJ^MKBXOK*ZLJ*NHJJJJKJBIJ"@J*:BJKJRMK
-M:VN+:VN+Z^MK:^JJB^MK:^OK*ZNKJZHJJBKJ:HJ*B@H*BFHJJZLK*^N+"VN+
-MBPL+"PL+:RNJZFKJJBHJJBKJ"LH*BNHJJROKBPMK*ZNKJJLJ*JLK:VOK:ROK
-MBRIJJBKJ*FIJ:NJJ*RLK:^LK*^OKZVOKJNKJ*JHK:XOK*RLKJJJJJJLKZ^MK
-MZRLK*ZNK*NJ*BHH*"@J*ZJOK"PN+BVMK:XOKJJLKZ^OK:RN*ZJOJZJJJJROK
-MZZLJ*JJK*ZNJ*NHJ*JJK*VMKZRNKJZOKZVOKJBHJZBHJZFIJZBJJ*VN+"PL+
-M"PMK*ZJJ*^LKJZJJJBKJZHJ*B@K*"FKJ:[N+:\L+BVOK*ZKJ:FKJJJNKJJNK
-M*JHKZXL+RPL+RVNKZFKJJBNKJBHJZ@H*"@J*:BHJJJJJJ^N+"PL+BVMKBXMK
-M:VOKJZNJ:HIJZBHJJBNJBBHK*JJKJJLK*RLKJRNKJRLKZVLKJZNK*ROK*ZNK
-M*ZLJZFKJ*JJKJZLKJZNJJJNKJZLKZ^OK*RN+BXMKZRLKJJJK*^OK*ZIJBHIJ
-MZBKJBNJK:NJKJJJK*VN+"\O+RPMK*ZNKJJNKJNIJBHK*6JI[._LJBZNK*RKK
-MJRNJ*JJKZ^NJJNKJZBJKJZNKJZNKJ^OKJZHJ:NJJJZHK:XL+"XMK*^IKRVN+
-M*ZNJ*BKJZNHJ*BKJZFIJ:HJ*BHJJ*^OKBVMK:XN+ZRLK*^OKZZLJJBKJZBJK
-M*ROK*ZNJJBHJ*JHJ*BLK*ROK:^LK*^OKJZHJZFKJ*^HJJZJKJNHJJRLKZ^LK
-MJBJJJ^L+R\L+:VOK:VLKJZNJZBHJZNHJZHJ*BFHJ*BJJJJJJJBOKBVMKBVLK
-M*ZLJZJJK*^LK*RLK:RNJJBLKJRK**BLJZVOK:^OKZRNJJFJ*:HIJ:NHJJRNK
-MZVOK*RLKJRNKJZNKJJJKZRMK:VLKJZHK*ZHJ*NKJ*NHJJ^OKZRNKJZNKZ^LK
-MJRJ*"HIJ*JLJ*XNK*VLK*ROKZRLKZ^OKZROKZZNJJBKJJROK*RLK*RLKJBHJ
-M*FKJZJJJJZHJJJJJJJJK*ROK:VMKBXOKZVOK*RNJJJNKJRKJZBKJZBJJJBLJ
-M:JNK*JLKZVMKBVMKZZLKJZHJ*BKJ:FHJJ^LKJZJJJBMK:^MKBVMK*ZJJ*FJ*
-MBFKJ*JJKZVN+BXN+ZZNK*NIJ:NJJ*^LKJNJJ*^MK:^NK*FN+JBN+ZZLJJJKJ
-M:NKJZBJJ*JHKZ^OKZ^OK*ZNJJNHJ*CIZZVO*XAK;^]M;<Y,#0SO;*^KBLF+B
-M6G(:RBHKRJNKRRHK"ZJ[.QM+RTN["^NK:DHJ*HHZ*BO+JLLKZ\NJ*JIKJRLK
-M*NIK:JMJ*^KKBJIJJ^JK:TNJ:[N*JBLK>BK+B[J*BZIJ*\NKJDLK:BM[*XK+
-M^\I*BRHK*ZOJ2NLKJJJ+RVJKBXLK*BNKZJKJRNKJ*@J**JHJRJOJZNHKJVN+
-M"SO[2TO[^XN+2^OKBNMJ*FJKBHJ*BFK*:@HK"FJ*Z^M*:^L+*BMKZPLJ"RMK
-M:VMK*@M*ZFN+:^L+JVOK*TK**ZH*>FJ+*RKJ^\NJ"FH+*VL**[N+*[IKZZK*
-M*POJROH+"JI:NSLJ*FH;JTO*JVMK2OHK*TNJBSO["ZJ+RRLBCHHCJYH[;\,+
-MBZ,C*]IZJZHBPOHKJ_JZ:_N+:BI+.VHZ*HNJ^@H+"RMJ:\N[ZPKKRVMJBJK+
-M*XJKRTMKZ^NK*NH**BOJ"JLKZFHKBXLKBXLK*ROJZJHJZNOK:NJJ:^J**XOK
-MJBLKJZMJJ@N+*ZIK"VLJ*XNK:FJK*RN*"BNJBLH*JBNJJRN+:RHK"PNJ*NOK
-MZBIKBVOK*VOKJJOJBHIJ*NHJ*JOKZBNJZJJJ*ZLK"PMK*VN+:ZLJJJHJZJOK
-MJBOKZZHKBRNK*ZLJZFHJJNHJJBHK*RNJ:BKJ:JJK*^MKZPOKZ^LJ*NIJJZLK
-MZRLK:VN+ZZL+*^HKJJJJ:FJJZFIJZJLK*RLK:POKJJLKJRKJJBKJ*FHJZZJJ
-MJBJJ*JKKZVMKZVN+B^OKZRNKJBNJ*FHJ*ZJKJZNJ*NKJ*NIJB@HJJFHJJXL[
-M2^N+:RLKJZNJJJOK:^NKJJLKJZNKJZHJ*BLKZRNJJZJJ*JJJ*BJJJRNKJZNJ
-M*ZJJ*NHJ*JHKZ^LK*RLKZ^LK*^LK*FIJZJJK*^OKZZLKZ^H**BJJJJKK:XOK
-MJZOKZZIJZNKJBNJJ*ZLK*^LKJZOKBVOKZVMKJZJKJBIJ:NHJJJNK*ZNJ*NJK
-MJZJJ*^OK*^OKZRNKJJLJZ@J**BJJJZOK2\LK*ZLJJJJJJNKJ*JNK*^MKBVMK
-MZRNJ*JJKJZHJJJHJZNHJJJLK*RLK*RKJJROKZRLK*RLK*ZNJJZNK*^LKJZHJ
-MJJHJZBJJJJHJZNKJJBOJZNNKJ^LK*ROKBXMK:^OK*^MK:VOK*RLK*RIJ:FIJ
-MZNHJJJHJZFKJ*JHK:VOKZ^OK*ROK:^NK*NKJZNKJJBOK*ROKZ^OK:POKZZNJ
-MJRHJ*@O+*VLKZNJ*"HKJJRMK:VMK*RNJ*BHJJJLKJZHJJJNKJBHJJJJK*ZNK
-M*^MK"PN+:^LK*ZJJJJNK*RLKJRJ*"@KJJJLKJZJJJJJJ*ROK:VMK*FHKJBHK
-MZ^OKZ^LKJZNKJZLJ:HKJ*JJJJJNKJZNKJRNKJ^N+"XMKB^OK*RNJ*NJ*BFIJ
-MBHIJZBJJJRMK:XMK:VMKBVOK*ZHJ*BJJJJJJ*JJ+ZRHK*ZJJ*JJKJZNKJJHJ
-M*BHJZBJJJJLKZVOK:XN+:XN+:RNKJNJ*"@J*BNHJ*BJJ*JJJJ^OKBXOKB\O+
-M2VOKZROKZ@H*RFJ*BHJ*JJLK*VHJ:ZLKBXN+BVOK*RNK*NHJJJLK*ZKJ:NHJ
-M*JJJJRLKZVN+:^OKJZLJZNHJJRLKZ^OKZ^OKZRNJJJKJB@H*"HIJZBHJJJJK
-M*XL+"\O+"XL+.\NKZRLKJRIJ:FHJ*BKJZBJK*ZNKJRLKZ^NKJJJJ*BJJJBJJ
-M*ROKZ^OK*^OKJZHJJJJKJZJK*^LKJRKJJJJKJJLKJZJKJZNKJZJJJBMK:^MJ
-M:BNK*RNJJZLJ*BJKJZLK*ZNJJZHJJ^MK"PN+B^LKJZJKJZJJZFIJZNKJ*JJJ
-MJJOKZRNK*ZNKJJJJJBNJZBHKZRLKZRMK:^LKJJJKJZHJZTLKZJJJJJNKJRNK
-MJZNJ*BJJJRLK*ZJJ*BKJ*JOK*ZNJJJHKZRLK*^OK*^MK:^NK*BNJZBJ*JRJJ
-M*LKJ:JJJJFOK:^LKZRLK*ROKZ^OKZ^LK:BHKJBLKJRNK*NHJZFKJZNHJ*BHJ
-M*BJKJROKZ^L+"PL+"XN+:VLK*ZNKJRJJJBHJ:FIJ:NJ*BNHJ*BJJJROK*RLK
-MZ^MK:VLK*RLKJZNJJJL+*ZKK*ZHJJBNKZNKJ*FIJ*BIKB^NKZJNJJROK"RLK
-MJJNJJJNJ*BHJJJLKZVN+:RLKJZJJ*BHJJROKZRNKJJLKJBHJJBLK*ZJJ*RLK
-M*RMKZVHJ:RLKJRHJ*JHJ:@J*JFN+ZRHJJ^LK*RNKZ^LJ:HJKBVLK*RNK*BKJ
-MJ^LKJRKKRVLKJRMKJ^IJZBLKJRLK*^J*ZBJKJBHJ*\N+JHK*:NO+2ZJJRPNK
-MZJIK:RKJZ[N[:XI*:BNJZ@KJ:ZL*RNIK:ZMJ:HL[NRMJZJKKZZLK*^OK*ZHJ
-MJJJK*^LKJNL+R\LK*FKJ*HI*^CJ*Z\L+JBIK.\M*.NJ*JNKJB[L;N^J*BBIK
-M^_NKZNHJZLJK:XO[*^JKJZK*:BLJRGKZ"CNC"[JZ:UL#VVI*ZBHJ*KHZ*[N[
-M:PIJBNJKBDJ*RSN+ZXK*:SL;H_N*FKIJ*DN;:PIZ.DK*B_M+>YMK^J(*2P-[
-MND(""JL[.PM[RZNK*JOZ&CKJ6UOK@N*+(P,+FMHZBTMKBVJK^_M;F_MKFOHK
-M.RO"4F+[`]N*\IH+*^N[6_OJVIIJRX/CBVK*BIKB*SLC6\J"PLHS0WMKJBKJ
-M:FIJJKO+J^M+REI:"GM[ZNHJ"HH*JRJK2PM[VXNZHGH*RV/[2KH**GN[B[M[
-MRV)BNFH;N[L+*POB&FHJH^H*^KI[2LL[ZW.#^PIB>MK+`YL[JPJZ.FO+R^OZ
-M.FHK&JZ2B@/#^RHJN_N[:FJKZFMJJ]O[BTJJB_M+PD++LV-*VN+*K^]K,O)Z
-MJVL*(JIS[WMBLB(J(^I:@FLO(^NB&N/;PZLNKIHC&WLC._OJ,L+JVWL[:ZJZ
-M(AHJ(R.;(^JBLMI[F[-*@@J+TQN+2MH["GHZVJM[VZM"VBN;PVIB0JMOKQMJ
-MR@MJ:ZJBRSOK*OIJFNH[2DI*JNKJB^M[`QL:\J+;+Z^;X@)JJNNZHCJ[\P.J
-MFF):RAMS@SOZKFZ22R_O0[I"V@NC,]LKVBXR6DJKBP.+*YL#$]OZ[FXZH\,C
-MBYHZ"X.;"B+R^@LKBHK[^RN[8UMJ:RHB&LI+ZTLCBCK[6VMB,J+Z6]MK2EJ+
-M.R.["HLKBZNKZQKZ*RNKZ]OC>R.JFLJ+>\IZVEIKF^-*TF[N6@OS&WIRPN./
-M?^_+NB++XY,O>WH.TLNOOV/Z$@)J:FJR;M)JHR/3,TJ"`LHZNLI2TH+*REI*
-MJM-/[YM"DJ*;4R\ODS.34S.+*NH+@R_O(WN*HC)J;X^#SC:6!J[BHLYFAF9.
-M0DMCNRLZJAMS;Z\OCZ>'7Z_*VK-G]V>GESDA65=F&*`XMA)B9BAH*$:F;A*N
-M+BXNWC;6MH(':6D'JOY.`P>71W_O0S,[6_<AK8W1]V"LK.`ZJ;=&^&"87N^W
-MZH;(:&Z*6^;VWJ=Y^2D2:(@VT\=7QY/;(Z='QU^K(KN)D>W1%UCP<$@;-XK(
-MV&!HVU<IR@;XR$8>$C8&WJ\IJ4<B7H[[MY=W'P/_E[EYR3<K^D/_IUO2-I:F
-MPL-*?JC(Z`;+ZZ9H2!;"IY_J'K[;IS<'IP^_Y[>7-^?3R_O/QY<79\-R_GYF
-M-E:HE@9>IH;&QB;.0@+N?J8..R?W-X<_'_?Y`7'QH5MX`&!(\C^OCE8HEBY_
-MU_?N2.#@^';Z6\/CPV.C4P/S$]-O'Q=YL2WM07_8,$`X;J.N%H@H;M_'!P=_
-MYEBP\`!H_TDY5WLVJ)Z_UY<?*M,YD6WM@1+@P!@>+YHHF'AV/^D7KP(NSI:8
-M`$!8SFG92?/HN/:?:>DG.R?9$>T1B0@`8"A/]RMH&$C.]XD'CI869B8H6&`8
-M3NG922-H.!;OR9FY5ZF9`;$ACTC@>.;/_^[H2/8CE]=3!HC("&AH:"CF(P>W
-MGSJF_GOWN1E9H2$A.:<&R$AV6O.J7A867NOO$^KF:/B8N.@&;KKC[S]O8ZN+
-MYPDA`<'AR1-&Z*@>"Y/*WD8&CNK[^M+>]HCX&/@HWHL3\X-;`],?=PEYH>$A
-M^;>NJ&BVPG.O>J;&7A):PF[>9O9HN#@(-G)S[P-*HC+C=_DAX>&A23=KAJB6
-M7F)KVCZFOO*R;AXF!L;6"#C(EA)/)__C^L**YXD9(2$A>>GO9NCHQ@*#6U(F
-MIHYR[MZ&QL;6"#C(EM(O?S_OPVOKW^F9H2$AF6D_WJ@HQO)+JPXFWJX"CN;&
-M!L:6"'AXZ#Y3IY^/\S-SIRGY6:&AH3DW(M9H5C[K.S*F7E*"CH9V]@9&Z#AX
-M"`:JCX^/CW^_3^<I^:'AX:&)#^;HZ+9NHF(.#O+2GD9VQGY.-LB8.*AN([,#
-M[Q_G/Q-/U_DA@6$AB2\&B`BHIG*:XEJJPJ9V5C8>;@9H>/@HOAL3#W\G9\_;
-MPT=)H6%A89E'_HCXR/;.`L*"RVN^-JC6YC*^UDBXZ"9*NR//AS=?"T*3ESDA
-M88&!68?VF%A(M@Y2KNJO<[ZHB"@F@J[VB`BH7EJK.Q_WUX<JGD(GZ3FA@;&Q
-M><*8X%AH1F;>RJ<G"Q;(*.::J]Z(2*CF+B*J[S?7YZI.+L,WJ=>IV3$1`7\(
-M6#AH:+AH$D=W6T;H]NXNYL:V5E86=I[31S='I]/;*X(Z;\>I:0DA<?')_@@X
-M.#@8>,8?-^]27AX.OL:FHCXHN&A>K^=/3P='ST)FWCM?)R='*:%1+6&::+AX
-MH&!@:.?I7Y).6GI.9H[ZIJC(B,::VX]'5P?K9K82&_/S_S?IB;DQ[?&G5LB8
-MX`#`>,\)-\O*XTNF*)8:HR;(2);.0CJ?J2D?/K8.>VK2JX?I:1<I08T1OU:6
-M:.`P,)A?"3^"CP<[ELA6H\]>R$B6YH9.'PF))QJFYH;F[L]7Z:DIZ0G!;7'#
-MACX(0'#`^&/W6P.7MR;(*`;"&@Y2#JC(5B+/1S?'AR]F*(9+SS_G%XF)-U]I
-M\>U9QDY[2/#P6'8J;H:?B?_H:([R)I;>/W\.]O[#N[*Z!ZF?GB9**MZF8]?I
-M1Y]'-Z\[F2TQNFX7JV#P8#B6MB@RUS?F=F/[!I8.;Y-Z\B_WCZ8^___.9C*O
-M8\X>FX>G<T^'YS,J:YMJ/AHA[;&:AUFZ,/"8V*#X5@\IQ^[SZ7OH5H*N5I;N
-M7\?S$ZFY1YXN[SH6%K([XB(/][</X__GRQZN2TI2^N.;QT&M26+)Z7B0($B`
-MX`B>CX>?,ZEW)I:2ZY;H?DLS6W]7:6G7-R>;+F;V=F9".X_?)R?_,^I*&JY2
-MXEJB^JH+>P.[6F*K"3$Y_NF99@!(GN!@:#XFII/3![>*:G^?)@9S2_["W^?O
-MGR=GIR\_'Z,.S@HR?FY+T^,C6QO*+L*+BZ)J(\N*BOJR6HOK2NL[@LYS*0GI
-M1RD7,D8V-KCX5I86-E++"V_/I^>_0QOS&@[J,R/[O^<_CX^/<^,[HEIB3G[N
-M`BZ2*LOJ&LJK>QOKBR,CZ[L+\AH#"Z)#?R.KHZLNKK_)^4='.7<VZ!YHX-@H
-M*`@&R@M3S_]GA[_;;^_"$J,ONX.G)___)R</RZMCXN9>8JZF<J,J<KI[>O+Z
-M^R.+2S.3JP(J^PJB&X^S2WL;RG)N_FY/B>G?5PF_)G[."/CHJ&@HII(KKZ^?
-M!X<??]\#*X,32RN3TQN;PX,JNNM;:QIJ:K(.+G+N+B**:@L#XX,#,_,#`[LK
-MBPL+*DN;FVLKVPM:4A(N?AZN[]>W_REITX[+XHB(=E9H5MZ^6EMO9\<'YT=G
-M0SL#.]+RJFHZZ@/S@UOCDZ,K2CK:4H[N4LY.H@K:.J,S(P,3$V-;8T-;:YL;
-MJTIK>VOKR[LJXL+"[AX^>C.GQ^<WE[]JJFI&%@8VJ%8F7H;ZSV.']Z^WCQ^;
-M#^^"/YJ:LBZRBZX;ST,#,Z-K>\O""RY^+DZ^KJOK0^\#0V-C8SO;`WL*J^K:
-MFNHJRQNK"QMK.OI*6D(2DJXN2B^G?W_'YU.[8_HFIJ:&MF8^/E(Z6U-OSS_?
-MSR^O`SNKBJ)"8L*B^NK+VP,#,S.CNPN*`O*R,I(""DO;@U,OD[,#FVIZFAHB
-M`GJZ2BIKZRLK*^LJ"@HJ:IK*JLI:&OIZ:CMS#^_/?T_#"TNBC@YNSGXN`H*B
-M"KO[&YO[&\LJZDO+JLO;6YMCPSL+2^NZ.DK:&LI*2BM+B[LCHWM;6PLJ*BO*
-MNFJ*:BLK2@H+JWJZRPN**OL;*DJ*BB+R,H*:^@IK.YL[FZ/C8^/S,P,CH]NJ
-M.KHZHD):>IHZ:BJZ.KIZ6J):HAJZ2FKK^YM[FSL;F]M#`R,C8^-;6]M[BZKJ
-MNAIZNKKZNLI*^KK*NDIJ*FH*ZJOJ"@H*"FHJJBIK2PO+^_M+BVLKJBJKJRMK
-M:XL+RXLKJ^KJZBJJJJJKJBHK:^HJ*RIJZNKJ*JJK*ZNKZRLJZNKJ*JJK*RLK
-MZXMK*ZKJZNHK"PN+"TN[RXOK*RNJ*JOKZRNKJRNKJNKJZFIJBLJZ^DJ*BHKJ
-MJJOKBXN+R\LK:\L+B^LK:^LKZXL+:VOK*RJ*RLJ**JHJJBNKJBJJ*BJJJZJJ
-MJZHJ*VOK*VN+RPMKJ@KZFIIZ.@HJ*XO+2[O[^WO[2PMKJRJJ*RLK*ZLJ:POJ
-MBNIJZNIJBHJ*ZHK*"HIJJBLKZVN+:VN+BXMKZRLK*VOKJNJKZZNK*^LKJZNJ
-M*JJKJZJK*RNK*BIJZJJJJZNK*VN+:^OKJXK*"@J*ZJKJBNN+B\N+BPMKZRNJ
-M*BJJJZHJ*NKJ*JHKB\L+ZRLKJZKJRDH*ZJHJZBJKZXMKZ^OKZPL+:ZJ*:FKJ
-M*BHJJZLK*ZLK*RLK*RLJZNHJJZJJJFN[:RNKJJHJJNOKJBJJ*JIKBRLKZ^LK
-MJFI*NKK*BBJKJZL+"PL+B^LK:\O+BVOKJRHJZFJ*B@J*ZJJKJJJKJZNKJFIJ
-M*JOKR\N+*VN+:PM+*KKJJFJKZVLKJJNJ*JJJ*JOKZRNJJBHJJVOK:XOK*JJK
-M*RNJ*FKJJBHJ*NJJ*^MKBXN+:RNJZBHJJBIJ:BJJJ\L+BNKKJRJJJRJJ*JN+
-MBVN+Z^JKBXMK*FHJJRLK*HIJ:BJK*RNJJZJJ"_N[RXNKJROKJRKJ:FKJ*BHJ
-MZHH*ZBJJ*ZNJ*XN+"PN+*ZJJZVOKJVK*:NO+"ZOJ:JLKZ^LKZRKJ:ZMJZJJK
-MJRJJZZLJJFIJ*NH*"JHKZPM+:^L+2PL+ZRNK*VLK*NJJZJJJBFJJZFJK*BHK
-MZRKJJNO+"ROJZBN+BVOKJ^HJ*BHJBHIJ*NJJR\NJJVMK"XMKZZNK:^LKJBHJ
-M*JLKZZNKJZLJJJJJZHIJ*BHJ*RNKJRLK:^OK*^IJZJJKZVLK*XN+RSN["^NJ
-M:HK*2LIJZJOK*ZNJJFL+BVMJNNHJ:BJJJNL+"VMKJRHJ*JHJJJNKZBJJJJJJ
-MZNHK"\N[RRLK:PO+RVNK*BJJ:HH*B@IJ*BOKJVH*:NJKZRNJ*JMK"PMKJJHK
-M:^OKJZKJJ@N+*BNJ*JJK*VMK*ZNKZHH*BBKJZFKJJNN+B^MKBXN+RPNKZFKJ
-M*JJJ*JKKZVMK*ZJ*2LKJJBKJ*JJJJBMK:VMK:^L+2TL+:VOKZVN+*^IJ"@JK
-M*NKJ"HIJJBNJZNJK:XL+:RNK*ZJKJNHJ*NKJJBMKB^NKJRN+"XOK*ZJJZJHK
-MJZKK*ZJKJJNJ*NHJJBIJBJJK:\N+:VOK*FHJ*^NJJJL+:PJ*:HIJZHKJJROK
-MZRLKB[N[RXMK:XL+BRLKJZHJZJKJ:FKJJJHJ*BJJJJHJZNIJ:NKJJBNJZNKJ
-M*VL+BVN+RPN+BVMKZZLKBXOK*ZHJ*ZJJZVH*:NHKBZIJ:HKJJZIJ:@J**BMK
-MB^OKZ^MK*ZNJ*JNKJJLK*RLK*RLKJRLKZ^NJJFL+"POKJNKJZPMKJNJJ*XOK
-M:DI*"NJJ*RK*NDKJR\NK*NKJJNMKZRLKZ\N[2[M+:RLK*VOKZFJK:XNK*JJJ
-MZNHJ*JNK:DH*JFN+*^IJJBNKJNK*:JJKJNKJ*JLKJRMKB^MK"XN+:ZLKZVN+
-M2\NJRJHK*XLK*BJJJJJKJZNJ:NHJ*BIJ"FKJ*BJJ*JMKB^NKJZLJJZHJJRNJ
-MJZNKBVOKB\M+RVOK"TO+"VLKJJLKJ^J*"FIJBFIJBFH*.OHZ:@MK*JMKB\MK
-M*^LK*VMKZVOKJJHK:XL+2VNJJJOKZZOJBJKK"VNKJZLK*ZJJZHH*BFIJBHKJ
-M*BKJ:BKJZJHK*ZNJ*VL+B^MKR[N["RLJJNMKJJOKJJJJZVMK"VOK:TO+:^I*
-M2HKJZFK*^KI*"FK*RHKJ*JOKZ^OK:XMKBPO+R\O+RPM+BZNKZVN+Z^MKZRLK
-MJJHJZNIJB@K*:JJJ:DI*2HHKJVJKJXH**JMKZZJKB\L+ZZNKZRL+NPNKJBMK
-MR[M+2PL+2SN[ZVJZNLJ*BLI*2LJ*:NJJJBKJ*PN+:RN*2LJ*JFNKJZJJ*RLK
-M:PM+BXO+R^OK"VN+2PL+"VLKJBJKJJJJ*JJJ*FKJ:HI*.KK*BFIJ:NJJZFKJ
-MJBNK*JHK"TO+"XN+BVL+"VNKZPM+.TL+Z^O["[M+:ZI*2KJ*"DKZFII*JHI*
-MBDJ*ZFHJ*JMK:PO+R\N+:VN+:^NK*VN+B^OK:VL+"PN+:VOKZRNJ*NHJJ^H*
-MRLIJJRNKJHJ*:JJJZFKJ*NIJ:HIJJJNKJJJJJJOK"PNJJTO+NYM[^_M[^[O+
-M:VN+"^LJ"LI*2DKZ&MJ:.DK*RDHZNFJKBVLK:\N[.TM+2PN+:XMK:VOKZXO+
-M:ZNKJZNJJ^LKJNHJZVOKJFH*"LH**FNJZBNJ:HH*BNKJZJJJ*NHJ*JMK:^LK
-MZPO+2PMK*ZLK:XN+:^OK*VL+BRNK*^OK*RKJ:FIJ:@H*"HJ*"@J*R@IJ:FJ*
-M:BHJ*BN+"PO+N_O["TL["\M+"XOK*^LKJZJKJVH*"NHJJJNKJZJJ*RLJB@K*
-M:JJKJ^H*2LIJ:HIJ:FJJ:XN+ZVN+R[M[^\OKZVN+BXLKJBJK*RLJ*JOKJZNK
-MZJJ+JFJ*RLH*RDK*R@IJ*JHJZNJK*XL+BVOK:XL+"\L+:XL+"PMKJ^IJ*BN+
-MB^NKJJJK*RNJJJLJJJNKZHI*^OJZ:BIJ"FJJZ\L+*ZJJZPM+"^HJZRN+RVLK
-MJBHK"\M+"^LKZVMKB^NK*JJKJRIJ:NIJ:LJZ2DH*ZJJKJZNK*ZNKJROKZVMK
-M*ZHK*^OKZVMKBTM+"VLKJBJJJ^MKZ^OKJRJKB^I*RDJ*:HJ*BFKJZNHJJBIJ
-M:NJK:XO+"PM+RPMK*^LK*VN+"XMK*ZLK:RNK*FK*"NKJZBHJJROKZRLKJRKJ
-M:FKJZNKJ:@J*:BJKZ^OK:^LJ*XNK*^N+RTO+BXL+N[O+ZZOJZBJJZFKJ:FIJ
-M:NKJZNIJ:FJJJZNK*RLKZRLKZVOK*RNKJJHJ*JJJJZJKJZLKJZNK*ROKZVMK
-M:RLK*RNJ:TMK*^OKJ@J*RHJ*:NJ*"@IJ:BHK*RNK*XL+"^LKJZLK*^OK:^LK
-MZ^MK"XN+:VOK*BHJJBKJ*NJKJZLJZHJ*BFJ*"LIJZJLKZVMKB\L+"POK:JL+
-MZXN+*ZIJBLIJ*NKJ*BJK*HO+*JMK:ZJJ:ZHKJHLJZFL**ZNJZZN+ZJMK*ZNK
-M:ZJ*ZNKJBHKJR@KJ*RMJZVOKR[O["PN+BXLK*RNK*FO[*VKJ"LJZBNIJ"FKJ
-MZJKK:^OKBXOKJZLK*BHKJBLJ*JJKZ^MKZZJJZXOKZVMK:^OKJRHJZNJJ*NKJ
-M*BJJ*ZLKJ^OKZZNJ*RNKBRNJ*BJJ"KH*Z@IJ*JHKZ^MK:^MK:^LKZXL+"PM+
-MZZKKJNJ*ZJNKJZNJJNJ**BJ*"FHJJBMK:^NKJJHJ*NHJJROKZ^NKJ^MK:^NK
-MJZNKJJLK*RLKJ^N+BRHJJ^KJ*BJJJBOK*ZLJZBJJ*^LKJZJJJJHJZNIJZBJK
-MJZNKJ^N+R^N+"^LK*NOKZVNKZRLKJRJJ*^JJZBJJ*BKJJRNK*ZNJ*BKJ*JOK
-MZZMJ*XLKZ^LKZRNJJZNKJRLKJRHJ*JJKJRKJZBHJJRMK*RLKZ^MK:VLK*^MK
-M:RNJ:HJ*BHJ*"FHJJRLK*RLKZ^OK*^MK"PO+R\N+:ZNJ*NIJJBN*ZBIJZBKJ
-MZNKJ:HJ*:NHJ*ROK:VMKZVMKB\O+RPMKZRNKJNIJ*BJJJZLJJJJJ*BKJ*JLK
-M*RNJ*BHJJROKZ^MKBXN+*ZKJ:FIJ:NHJJJLJBJLK*JNK*VLK*^MKBVN+ZZNJ
-MJZJJJBHJ*JJJJRLKZRLK*ZNKJRLK*RNKJBKJ:NIJBHJ*ZJJK*^MKZROKZVMK
-MZROK:VMKZ^LKJZOJZNHJZBL+*ROKJRLKZYM;*XHJ"EKNOH[BX^]ODYO[2ZO:
-M<F)*P[\/0ZOB8MJ**@JKF[/3DVMN7B;>+@I#[T\_C\/JXG(R2@NC8]M+BKIZ
-MNNM[@V-[BL)"0K*BNNN;`_/#&RO*RD.GWQM.1O9F0IO#,]M[H[/;"AJZRY/O
-M\VOZ6DK+>_O+"VL*&DN?)V^*3EYN.Z\;VJZN6FO[.H*"^HN[2@[FYDZ[_Z>_
-M(\IZ"JLJRDJ;[\_SNK[^3QD!60<&&%AH/G+.4CKC)P>K]JAV3I]7-XM^)J::
-M4]/+:[/#ZRX&MDZ_%U?'FXYN:R_#&DZ>[NKW@?%94^C@8,@N2IXN.\-?QWHH
-MZ$8Z1XEW\O9VAKH?7_.;&ZJ2W@;FFG\'QU_S^Y/_+^I2_GY28ZD!$6'/R,`P
-MH.;KDF+#PX\G(FC(=HIW2>FK=NBH#A\W!]_30J8&QB;B?_>I%^<S"LHK8P/J
-MSB8>:TD1K5DF8!`PN&M#/K+S+^<G9GA(/L=)^4?&2$CV6Q<IQV_:9A;6!D+?
-M5XEIMUN.<B/_?Z\:_GY^CC^![7&W^)"LP,;_&D[#;[]GFD@8ED^)V4D2>-CH
-MB^G)AY(FWM(Z&M)*)RF)5[]BKDL__[.:+DY^FJG!D8&'R``P@'CH]JX?%W>/
-MYBC6@O>)US+(6+@FG]>I]P<_Z]ZVAFI'*5=G#Q.#.W,'-[,FJ!9NJ4$180_(
-MX.#X*&@(MCMGYZMV"+:_B8F?QOB8:*8+/\<7U\>;IL:.#Y>I-]]3*[K*D^='
-M)P^I0:V!HJ``H.@VN"`(ZD<_YHAHFA?7+U[VEI:6UN9OZ<F7&V9&SCL/'X<7
-M*=<_VHK_1R?[4UDMK6FX`"!H%KB`6)I7IY:X*`JIM_JF#@*V^%B(+PG)ASH:
-MFTN.YK*'B8E'PPN?J2EG=[&-\?)8(#C(^&``!JE'IDAV&H]O7GXS4V98H&C*
-MQ]\S3P<'VO:VR@>'_[]GZ0FI1XD1#<'>Z/:66,#`()+GCK;.)P].YJ;OI^8X
-M>*@&MB8Z!ZG_PG)JNNYN*J?WEY<I>3&-47<C9_+@D,"@"+8HQI^)9Z;Z7S\"
-M5L@(:,C(IJ_/;_\G/]HF3@/#4B)GZ0FAK8W!*0F7J$!`X&!8^.ARW[=_Q\FI
-M6^;6:)B@>*B^XNN?QR>;RG,S8C(#)\>YD6TQ68$9YF#@(#`PX,CF6N\GB1GI
-M(V_/:.#8^)BXYAOOIX]O)]^J8N]G)S>9T2UAH<$9QJ"XH)!PX#A(5KN72<F)
-MN4<>*$B@X'AH5CY[[W_?3W]G'P^'*4EA4;$9P8'3B*B(\)!@(*!(?N\W*:DY
-M>:?&EO:@`/@H:*A*)[\?!Q?W?R>I:3E!L5GA@>D^YN:@P"!8H)CHWDOG]\E)
-M1P-.MG@@>$A(:.:KBMM_QS>'EVD).0$Q(2&!N3N^_G@`X*"@6,AFBO_'";DW
-M9WO6"/B@H$AH:'[+FJ\WEP<7B8EY0?'AX<'Y<TXF>`"`X."@N$8:+P?)>6E'
-M0A[V6*!("'CH2NZ>4V?_3]?IZ9FQ$<&!0:'_)F;XL+"`X."8MDIOMSG9B=]S
-M(@@@^,B8.`:2_F*_YX_/%RG72;$1@8$QX3_^KKBPL(!@@%C6,I-'N5E)3[,#
-M:.#XB!CXYE(FPO]G?Q^7Z2G)05$!(3&!#X:":##P8&#`(*B"OZEY.?=G;T9(
-M2#B82*CVII)*+V>'QZGIZ?GQK6'A<2$NMH*8T#`@@,`8)M/'*<F)MXM>]@@8
-M>&@H*,;:&J)_%[>'*0D)@2WQ&7$Q'Z@:EA"0X&"PX/9+9Q?I":G[9L8HV*"(
-MJ"B6LONZ[Q?IMW?)^>&M$:%!\9?6[B8PT(!@L&"HZH<W=XDI,M9FUMC85I8H
-M=G(+6L-'Z9<7R1E!+?&A<;'O:&*H$!!@X$`@!I_W!U<)AP96-@A8^'8V-@:B
-MBWI#Q]>WUPE9$>V!85&!/BC+F%"08&#`V/[7J;\723.(*#9(H`AF)@9F&R][
-M,S?7![?IH:TMH0&MH=96RR"L\.#@8'C2Z5>OMPF*2(AVB!@()F*FQ@N?TUMG
-M5S<G1UDM[1D!+>'6B"N@4!"`H"!8)@G)R^>Y#PA(J"AX^-9+HC:RYR=;'Y?7
-M!W_'@6UQB9&MZ?@67L!0<&`86/BJF8GCA^G#Z'CHEDB8%M.2MJZG9S^GMRGW
-MS]_9[:T)`:TAZ'C&('`0L-BX2$9IV8?#YX>.2#BH%H@(?@H"/E(_-\=_QZDW
-M___9[2TYX9%A=N"88+!0$.`H]H97H8DGW^<+%G@XJ+9H5F[#2YKS9U>77Z>W
-M]W^_6>VM>9GA^78@8$"``#``*&,3-RFI%S<;1E:HR,@H=H9N*[L#OR<'1P?'
-MQX<GIVEQ+0$)R?D/R""P0%C8@&!&_]<IYU-GJ:/HN$BH1G8H1@,GOR-;)RD)
-MEU_GM_=GOVE!\1D'Y^<"AHB`@/CH>-AH9J\W#T[2OP,.AE;V@K.R?KJC+Y^_
-M/V<7]P>'IS^_K^J#"2$YA^<7AS.*EOA(Z,CXR&@HWF(>9EIC*GNO8Y/?O\/3
-M$\H*R[K"*OL[HU,O3Q\??Z?'Z4G73\>I9Z]O[G;F7B@(J-8H-L:HU@[R/L)[
-MFX^?DRKK6PKBXL*B^[/O?X>'9Z=?_V^#@]\IJ:?W":E?!T^FYAXHN(@HN,BH
-MUM:&'IXNJ_M#[Z_3[\]O;Z^30X,[F]LS0],OOU_G7Y__/_.S9U<_F[>I_^^G
-M8H8.7NB(5HA(Z*CH%CZ^OLL?'Q^?3R\_;TNZ.R/;&T-#K_^G?[__/[_/TWO[
-M.SHNKLN'9_.GJ??_7R^.OHY&Z*BH"&BH**B&WOYB(U._9X>GIR=_CX]O,[/S
-MHZNKZRM+DZ^3DR]S@R.+VIJ:4F["(Z??KR=7=^<G#TJ:.MYV=G:H*"AH:%;V
-MMJ8B8\]?AT<W]S=G7Z<?$_N[J^I+JMKJV_O[0[,C0W.C.\LJNAHR[F[BTT^[
-MXX>WW_]/ZH+J[K;VMA:H%E:H=N;>OJ+;;Q^'1[>WEY?'AP>G[Z_CFF(:,BZ"
-M6@*:BAIZ*AHR0O)NCB[N;JXR@@KOA^>?1ZF7AX?_2TM+#@:&9O:6=M:H]H;F
-M?L*+<S^G)R<'MX<?I^=_KY-;JXLK@I(:^@)"DHZ.TE)N+K(::JN*"NKJBKIZ
-MZP_'QR>W*:DWQZ>#NRM.MO;V5BBH*"B6!N:FCII+@U.//U_G9V<'MT?G'S_O
-M(SNJFGIJ2MJB8A*N4F[.CE*2\@*B&DHJJNHJ8]^'YY]G%Y='AS^[*XH^]E:H
-M**C65M9&?M(:NW./'^<G'_^G9R=/,Z-C`]NK2@O#PWN+BPO+ZC+.O@Y._IY^
-MCF+J:DJ+8S-S#[<)2>F7%W<GV[[VJ-8H2+@(J#9FWFZ['R<_SY^GWP\;ZGO3
-M<WO+,T__C_.3#T^O"WH:VC+.'A[.TM+NKEJK"RH*^_/#H]LCP\.C6R?I:9?'
-MQV?O"N:HJ*AHN$CHEN:^+OIOAX<?OY^GWP\C>Y,/+WL+0^\OXSO;,S.+XO*"
-M@FX>WLYR@@)B"INS`R.S+^]3LZ/;(QOJ6CMG%_<'9V=?PZZV5J@H"+C(Z/;F
-M'JZC)[='QT?W]P>?;X\3JUJ"`EKJZLH;+Z\CF_LK2H*./HZNCL[2FBN[6P/3
-MSP_S&V/3P\OK"\N+"@(:[^??3T\_;Z-:)L8&1M8H5O8&'LY"NX]?IR=GA^>?
-M#U/#>ZHZ^JM+N[O;,U.O4_/CNVKB4FYN[NZND@)*ZSM;@[.#H_MK"SNK.@J+
-M"VLKZDK*2CJZRLN;(X-CX_O+JGHB0G(NSK[^#B[2(@H+H_.O+^^/[Z]3TS-;
-MJZJ*RDKZ:BN[RZN*JJOJ^HHKRPOK:PIJZBO+RSL+JFHZ"FJZ.KIJJRNK^LJ:
-M6HH*BNJKZIHZ.KJJ:[M[@[/;V^/CF_NC(TL[R^J*VCJ:(B)BVJ+Z2OHJ*JI+
-M^WM+RPM*>NJJNPO+"RN+>]N;FUO+BSN+ZBIJ"LJ*BMK:NBHZ.LJK*JHKJPN+
-M.RL**^OK*SO["XLJRJHJZXOKBVKJZFIJ:BJ*JRNKJZLKJNN+:ZNJZROK:RO+
-MNPNJZFNJBNIJJRLJB@HJ"@K*^NH+RPN+"[L+"\N+2POK*RM+BPKJJ^JJNDH:
-M.@I*Z@JZJLL+JJK+"SO+RTM+FXOKBRMKB@IJ"DI*ZBJK"XOKZ@HJ:RJZNKH*
-MNLKKJJH+^WM;HV.;ZVO[B^KKJLK*JVJ:.NK:6FIKB@H+JXKKBPL+JNIKBRN+
-M.SM+.QO;"^MKZRJ:NGJZRMKZ(IH*:VJZ*_O[RSM[&YN;>^OJBXLK2CKJZJL+
-M:HJJJRLK:FJJBDJ*BJN+RRJJ:HI;.[IJ*FN+JTJZJBH+.WN+*[N;*PHKZ[IJ
-M"POJ2LIJ:@JJ:LK*J^LKB[N+:XM+*NO+B\NJ*RNK*RJJZHK*BNNK*\K*JVO+
-M:ZKK*\NKJLLJZOJ*:\I*JKLKB_L[ZVJ+:^J*JZHJ*NJZN@JK"RL+ZXOK:FOK
-MJJO["^IK"XLK:JMJJBJ*JNKJJJNJJJKJNHHKJVLKRZLJ*JLK*BL+"PK*JRO[
-MR^O+>SLK^HHKRDIJZCJK*BK*:HLJR[O+*NI+ZHN*J\N+:[KK*VHJ:CLK:BLK
-MR^N;RROK*ZJ*ZBHZNKIJJJMKZJOK*HNKZLOKZNKK:ROKJFO*.COJ*HMK"^OJ
-MZZLK*NL*"@OK*DI+RRNK:VLJZFKKZNIK>ZOJ2^KKZNJJJRLKZDJKJDJKJBHK
-M2^LJ"XN*BPNJ*NI+JJHK"FMJ:JK*RXN+J^N+*BMJZJHJJJKKFRNJ:ZJKZJNJ
-M:FK*"BIJ*KL+"POKN\N+*TJZJRMJZ@H*"\NK:JLKJHM+:^IJJXLKJ^LKZRHJ
-MBVJ*RBKK*NOK*ZKKZPOKJ^KKBRMKR^NJZ^LJ:BJJ*CH*:NKKBKH**BOKZYLK
-MZJL[;QL"8D*:"FNK^CLK^QN;FQN[:XL*"NLK(AIJNLL[NDH*RVO*BWN+NSO+
-M"\O["DJK2@HJJR)BRNNJNON[Z_O+*RL;>TN**LO*JHO**RHKB\J+:\IZ2HMK
-MBVOB.OL;Z^L*2DN["XK*J[N#*[K+*FJJZBH*JYH::PL+RBLKJGOKRYNK"TKK
-M>^OKJFI:&OL#.C*ZRVN**^MJ(JOC"VLKJBNKFY,K(OKZ^OL;BCHKV^OJ2VOZ
-MVBO+*[N+>XOZZDHZ^CL+FOI;6\K[JZ(*2WL+RZM*JPOJFWOJFDI+BLMKVLH[
-M:[IK:[K*JOMJ2HLJ.TL".FHJNXM[BRK[RROJ:GM;*@H+JBJ*FGKKZXIJ*BM+
-MR]HBBZ-JVLM+R\.;2FHKFOI;>RK:R@L*>VL:"PL**ZNKBZM+^^KKZ^N+HGKJ
-M>BLKZNO*B[M+"\JZ2@O["_LKBLKJBTL;R^J+BMKJJCN+FBN*HBK[*LIK*R/#
-MZ_HK"ZMKJ^O:FDL*BP/J@MK+.VOKJRHZ*GMKBLJ:JQL["ZM+.RJJ:VNZNOJ*
-MRVNK*FOKZPNKJ\MKZBN+B@H**^O*.NJJZXLJ*ZOKN[MKJPJZB@LK:\O+ZROJ
-MBLL+BKL;BXLJRLK*RLH*.DJZ"DO+BZN+RRMJJDO[.\MK2AH*:SN["ZJZN@IK
-M2ZLKJ_KZ*[NKZBMJZNIJJ^N[RXK**WN;Z^H+NZJK*ZNJ*TN[*RKJ:@K*BDJ*
-M2KHZ"FN+2\LJR@KJ"@I*NFJKZ^N+FV.S,T,#(V/ST_/C^RNZFEKB0E*.3LZ.
-M[JZR&KH*ZNO+2]O[JBKJ:NM[HUM+RUO3#_^G)R=G!\<'I^_+PDZFAC;6*.@H
-M%@9^KN(*2_._IR<?;R-J&AH:`E)2<F*+SP=WU^E)F9E)J0</"AXV*$@8("#8
-M.`@HMNZ3QRD)">FIES<G`\Y&UBBH]@8FWHZ+YRG)^:'AX:$Y:3<S7BBXV."`
-M@.`@&,A&"N<I2?GY.;D)5_\"AM9HR$A(R"CF"R>7B1D!L4'A&;GIWP[HV(``
-M`(``@"`(WML'"1E9H:'9R3</6D:(^)C8V'AH!AK?*7EAL?%!82%9:8/V2%A@
-MP+`P0&!X*,9J5QFAH:&A&<GW8Z96B#B@()B(1DY+1_F!L<%A`<$A5RN>EGB`
-ML#"PP(`@>/8OE^FY(6&A^4EIIS+&Z$@X^#B(MFZCMQEA(:$!P:$IQZ<^2!B@
-M@,#``&"8J.:N)\FY";G9^=?GO^*&-A86]L8>FH<)J2FA(?FIZ8F/AD:6N%B@
-MH%B82&BV@DN3!RDI=_?79TMZ.C+N[I)J4S?7!VEYB1?7Z2=2#DZH2,A(^/C(
-M:*@F/BXO)Q_G][<_$\]C0@J;@CH/)[=']PF)*==7U\^:`CY6B`C(N/BXB%:6
-MAC*[HP]G9Z=?Y_\3/W_S$Y^G1\=GJ:GW1S<WLTJ*KO;65NB(R`AH**CVI@XN
-MJN^O<Q]GGU_'9]^']Y>IM_=I%^?GQT^R>J*FUI;6:&AHZ"BHUD;>G@[*^PJC
-MOP^O)P<G!W?7*6D7Z<EW1S<W0X+K/C96%N@(B(@H**AV9B;><DHZRM/O\X]G
-M9R?'-Q<I*9=IB;=WE\=;^YL>QI9VZ(AH:.AHJ/;&QM["XAH[;].OWX<G9S?W
-M%RDI=^GI!_='IYNKBZ9FMC:HZ*@HJ"@6-K8&WFXNPNH;HW,/IZ?G-_<7*6FI
-MJ8F7QT=G#_KJ#H:VUE9HZ*BHJ'9F9J9.LO+B:BL+2R.OST_?9\<W5RD7J0E7
-M-W='_^J[D@8V%E:(B"CH*):&9J8N2DKK8_/C(\-S+],O/Q^GAY>71ZEI-[=W
-M1V_K,W*&MC;6"&BH*.B6YH9F<FL:*B\/@U/_;Q//_P]O_Z=GQP<'J9=GQT<G
-MN_MCSH8&YM9H5O:HZ+:F1@;"BL(B,V\+XS^_K\\GIT^?YV>'!V<']X=?)X=/
-MBCMKS@8&YA;H%D:65L8>)N9NVAJBBX,#PZ^/3S]_GQ]?W]^GAV>?IP?G/X\?
-M#PO*&D)^YF;&]O:V-K;&AF;>#A+BRINSKX^_?]_?'Q^?/X\O4W.3KR_3TZ\O
-M4Y-SXTNJ.H(N#C[>IB:F7GZ^#NX2PAH*JJLKBTL[>]M;HR,C(^/#0T/3+^^/
-MST]/#V]O[Z\3,R-+ZAJRKFY.GEZFIJ9>'GX^SHZN0IIJZSM;`W,O;X^/;V_O
-M+Z^3,T,#8V,#,_.3<Q-3KZ]S(XNZ@JZ.OIY>IB;>GIY.;A(">BH+>ULC8X-C
-MXR.CVWM[FQL;6V,#`X.#8Z-;VYL;6V/C(X-#LS-#`QL+ZOJB,BZ.3K[^/KZ^
-M/K[.;BYRXGH*:WLCP_/3KZ^O+U/3[R]3$_.S`R/;&YO[NTO+NTM+:ZLKJBJJ
-MZLIZHL(2+NYN;HX.CFXN+E(RHCIJ"WM;`_/3KZ\O+R^OT_/#@Z,;>[M+RXOK
-MJHH*2CIZ.CHZ:FK**BOK:XM+.YN;.PNJBKIZ&N+"\I+24JY2$O)"(OH**HL[
-M6P-STU-3T],3D_/#@R/;>[L+*RKJ:NJ*"DHZ^OJZ2DJZ.DH*RHIJ"LIJJBNK
-M*TL+ZVLK*FK*NOJ:>IH:VMH:&OK*ZNM+^]OCPS-SDW,SLT.#6WL+JDKZFJ)B
-M@F*BVIHZNDI*2DI*RHKJJPM+NSO[^_N;VZ/C@P.#XR,;N_N+"KI:`D*R<M+2
-M$I+RPN):>KK**NO+^YNC8X.S<Y/S,T/#8R-;&WN["RNJZ@HZ&J+B@L*R0F):
-M>DI*BNJJ:\N[&Z.C(R.CHQL;(W.;NCO3.PXNJW-JQN;*.SY&OBHK`GHO/^]#
-M#U]/,_./;UOK:WL+@E*"^AKRLII*&B*:BLHKRROKVP.*6EM#^J)C+R/KHT_S
-MBON/VQ+JXV(>KKJ>9BYR7OY:HE+*(Z-#,X]_/\]_IR]#;P,**\.*+FI*CFZB
-MLCZ2FJX:2KHJBJJ*@TNJ0YO;H_,["[/J+\>;*M>?@C]':Z:?JC8>S@961H9V
-MAL:>`IY"KR^;_W=?'Y>WYX?WA_^?_^^ZXHI.9J;>]G8F!K:FSLX2ZZ/#;W_?
-M7U]?)W^3[],K.[N:6BI//PXGETX_)\]".C\&/F9&9HCV-JC6-I*V3I-J$X]'
-M-X>I5RF7E^D'A^=/KR*BDB:&MH:HUL86]@8>/LXKRP,O?^>?AP?GIW^GKV,#
-M^RIB"O)"#X].WY=^)U\;(\)3I@[&AB;(QK;H]K9^1FXK*K\O]W?'Z2DI%ZFI
-MA[<G;P,+\GZF1K9V5G:6=K:&YG[RXDL3#U\G!P?'!V<G_\\3FZKZXK(",FYN
-M@KH#^TMGDZ-?<P.J>]J^ON:F]C8&%C8&WOZ.*ONOSR?'!_>7E_<W-X?G_R\S
-M^C*N7F:&1G8VMK8&YOXN@DMS[_\GYV>'9R??_^_C.RMZDK(R[M+2KNZ2`AKS
-M0\O_7[-/'V^S(]O*TDZ^YC8&QC9&YAZ>+KJ[0\\GYX>WMT<'Q\=G7Q_/"RN:
-M/EYFQC8V1L8&YC[N0LO#[W\G9V=GY]]/;Q,;RPK"DBXN+JZN0H+R^J(B@^\3
-M[R<?;Q\_KV-KJJX^'B9&-D8V-@8F_HZ:VU._)\?'-W<WM\>'9Y\O[TN"TGZF
-MQ@;&1L8&IJ8.8DJ[0[\_WR>G7Q\_+R]#R^LZ.D*2$JX"DH+B^@JZJ\JK^^-O
-M,V\GSS^GPS,SXJ[N)D8&]A;V=L:F_D*+P\]G!T=W]W?WMP>')R_3"V(N'J8&
-MQL;&!H8>_FZ"BCOCC[^?WU]?3X\OLVNJB^+B@J+:(GI*"VM+FPMK*PJZ"QOC
-MP].O[],SDVO*@NZ>)H9&1D;&9EZ.@NL#3Z=GQ[<W-[<'YR<_$P/J\BZ>)F:&
-MQH:F7LX2(@I+8Q-OCP\/CX_3`UL[JBOK2HJ+ZRI+HVMK"RL*^OJ"\O(ZFQNC
-M+S\/KX\O.VH:4AYF!D;V]L9FIH[Z&Z]?!S?WEY?WQV=?;[-KPJY.7N9F9H8F
-MWDZN6LM;L]/O+]-3D^,;&[OK*FHK*ZJ+HYN+8U/;^\.[&AK";NZ:@V-C3Z?_
-M$X_3ZI+N_@9VEO9VEL8>CF(#?R<'=]?7=S=')V\SF[I"\KZ>3MZF_NYN\DJ*
-MZVO+2SNJ*TN*RHL+*DLC6[,3<U/O0V/#^ZMJ"J+B`M+N4NMO#P\G!Z=O4_NR
-M'@:V%BCHJ)8VYE(+[Z>WUZFI5]<W)\_#"E).?OZ.;DY"ZLJ:"Z.KJVN*FL(N
-MKK+N;B**BNNCKT]/CW_?[Y-OXVKJRC*2,M(RXK)R&JKOYR>GAP=/HVHN)C96
-MJ*@HJ+:FSF*#_X?WE]?7=P>GSZ-J8A)R4J[RVOI:"NIJBHK*^IH"LK(R<D):
-M2FO[8Y-3+V\/+Y,S@QN+JHKZ6@)B8F*BFCKZVAI*:U,_O_\?GZ^;2I+.)@9&
-MQD;&YGZN&OMOIV=GAP>'WP_38\NZXMI:0K*"VAKZ>LKKZOJZZGK:VAJ:>OHZ
-MJSL;@W/3KR_3PZ-[R^KJBOIZ2DJBHKJ*.IJ:&J*"@HI#[R]/WY_O0_O*`@ZF
-M)J9FAB;^;D)J(V^?W]\G)Q__3W-+ZMJN[BYN+F):&NH+"TM;V]OC6_O[2XJ:
-M.@IJJXM+&R,C&UM[BRLJNJ("<K+"@N(Z*^LKZSN;.PN+RTMJNKI*2AJ:"HL[
-M^]MC0\-#0V,[B^OJ6D(2+F[NT@*:2NN;@\-CHYNC6\LKZZIJNGJZ"NHK.TO#
-M8SM;XUN[^RL;NZN*N@KBVN):XNJ*.NKJ:KJ+JKM[:NKK:^K:>NMJZGHZ*HN+
-MN]M[.PL[.\L+"SN;RPH*ZKKZRJK+Z[LK*\KJJZHJZLL+NGJ*^AHZ:JLKZFKK
-MBVLK"[N+"SK+:VJ;"WOC2TL+"^NKJZK[JVMZ&NKZRJJ*"JMZ*[KKZNL[*CN*
-MRTJZBLHJ"JKK.SN+"QL["_O+BPLK:FJJ"NHZ^BJB(CH+JPHKJDL+*QNC6PN[
-M6RK+2KIJ:\I*BXHJ2BJZZRJ*:NHK>FOJ*XLKB\L+*BN+J^J+*\OKRZJ+2VM+
-MB^OJRDHJ>CH*:JN*RJNK*@M+:ZLJZRMKZZNK"VLJZRH**HKJ*ZK+J\NJ^ZOK
-MRZOK"FMKJJOK*BJ*ZFH*JDJKBJH+JJIJZVMK*\HK:^KJJXLJ*NH+ZZL+R_L+
-M*VL+:LHJ*^LJ:FJK:VHKZRLJ*RL+:RHK:BIJJJ)*ZJLJ*LLKBVMKR^LKJ^O+
-MZBJ*ZJL*ZXMKJHMKJRHKJFHK*RNJ*RHJJRNKB^JK*NN+:^OKN^H+*ZIJ2FI*
-M:DH*:NHK*JJ+2TL+RPL+Z^K*ZRL**JHK*JMK*XMJ*RMKJ^LK:ZJ*"NJJ*BOJ
-MZHHJZBN+ZRLKZVLKJBOK*ZJK*RLKJBNK:ZLK*ZOKBXN+ZRNKJJLJZNJKJZHJ
-MJJNJ*BKJJJJ*"NNKJ^NKJZLKZ^LK*ZJJ*VN+BPMKZRLK*ZNJJJJJJNIJ:FIJ
-M*BJJ*JHK*VMKZRLK*RLKZ^LKJRNK*JHKZRNKJZNK*ZNJ*JJJJZLK*RNKJFMK
-M*BOKJBHJ*JHJ*JJJJ^MKBVOK*ZKJ:FKJ*JHKJZOK:XOKJJNKJBHJJJHKJZNK
-MZVMK*ZHJJZNJJBKJ:FKJZNHJJROKZROKZ^MK:XMK*ZJJ"@JK*^N+:VN+:VOK
-MZZNJJNKJ*JLJ:NKJ*JHJZHH*"HIJZJN+R[O[.[L+:^LKJRKJZFH*BNKJ*BJJ
-MJZNK*ZNKJZNK*ZOKZ^OK*ROKZ^OK*RO+:^JJ*FKJ:NHJ*JJK*^OKZ^NKJZNJ
-MJJLK*ZNJJBHJJJNKJBHJJNMK:VOK*RNK*RNKJZNJBHIJ*NN+BXN+BVOK*RLK
-M*ZJJ*BKJ:NKJ*BJJ*VH**ZNJJZJJ*^N+B^LK*^LK*RNKJZJJ*BHJZFIJ*JJK
-MJRLKZ^OKZ^OK:VMKZZNJ*BHJ*JNKJZNJ*BHJJJLKZRNK*NJJJROKJZNJJZNJ
-MJZHKN\NKJZHJJBLKBTL+:HIJBBHJJZJK*NJJ*FKJ*NJKBTM+^TO+ZRNKJZJ*
-MZBJJJNLK*JJJ*RK+8XLKJQJ:HIH::@KJJJIKB\N+2QN[&_M[NVNJ:HOJJNNJ
-MRBL*:DJ*2LIJBBN+*ZN+"RJK*RIK*XNK*ZNKJ^HJJRJJ:VOJJ^I**ZKJJHNJ
-MJHNK*@LKZZMJ*VN*:SN*R]NJBSOZJHNZZ[LZZOO**LM*JNO*ZFNZ:NO:2BKZ
-M.NI:^FOZJ@L**\MKR]O+&WO+XTL[^_L+:\N*B^HJ:[L;J@.#RZ,;8PMKB[J:
-M<L(NSLY.#CX.4I*"FHO+VW/O[X^?_P]_3^\O0X/+BMJ"DNXNSLZ.[B[2@GKJ
-M*YOCH[-#XZ.C>\._&QL'@R\G8R=K(].R@MY"QL8F]J:6)C[F+M*+.EL/SZ<_
-M!X>GAV>'WQ^G[S,[Z]H.[GZFYN:F9J8>O@ZN2HK[8]./[T^_SP^/[[/#HULS
-M$YL#3_MSCR-SZDMJ$FX>_L;&9D9FQMX^_K)*&]LO'W^G)X<'YP=GI_\_3X/[
-M*TJR/@X>9F;FYF:F_KZ.<HKJR_,O[X__/T__S^_3,S_G8X^ILZ\W[X]">P*V
-MYBA&Z$A&J!;V/MK>HV\/7Q^7-X?W]S>?GV=S2]N#"F[K"RYNHMK^3F+NGKYR
-MCMXN8E(NHDMJBD/OTQ-_7\\/G_]SXW._IR-#=_\ZPZ?S]DZK]FBHIJA(QGYF
-MQE+O2QO?QT>'1Y<WQZ??IV_;R[OKXN+R<N*N[J[R4CX.K@X^3E(2KN+ZZKMC
-M$R]/GY\?'Q^_[U,#.RNZ2OO3&^JCKS,*.HIN_IXFQC9FY@8F/BX2.N,#0[^G
-MIU\GYU\?WS]OKU/#&]LKFMHBLJXN+@Z.;FYNKC(24O("6KJJ"_L#$U,O;P\/
-M#X\O$S/C^XMJ^NKCF\I+TW.[&QMB4I)NIF;>IF:F_CX^<DI*ZW,/S[]?IY]_
-M'[_O+X\O(^/CRVH*.H)R\JZ.;NYNCNZN[M*"8EH*B[M;DZ^O;X]O[R^O0X-C
-M>PN[8^,[&T,3`Z.[2@(2;GXF)B;F)EZ>?L[R6KH+`R\//Y_?WZ>G?[\_S^^3
-M@WLKREKRTM*N[NXN+B[2$J[2,L*"VDJ**_OC`S.O;V^/CV\O4_,CN^L*&NJ#
-MX^H[;V^;2_MB[B[.)H:FWN8FGC[.,NHKNU.__S]?IW\_/P^OKR\38Z/C.XKZ
-M&K(NKB[.SN[N#FZN4O(:RNI+`Q,3+X]O[^\ODT,#6[LK*T//0VM3_R\+FRLN
-M[HZF1L8F9@:F'OYN&JOJ&V__GW\?'S]__X\O[R]S0\-[Z^OJHK)"0G+R<BXN
-M4A*NKI)"8MJ:2BO+F^/#<U,O+Z^O4]-SL^.+NBJS4^KJ+\]C:YMZKC)27F9>
-M_J:F?GX^DCIZRN/OST^__S^_/P\O+V\O,T,#.ZH*>N*RDJ[N[NZ.#HYN+O*B
-M.BJ[H[-3+V]O[Z^3D\.CFYMS3U.[KQ_/.[O+DBXNWL;&)F;&9B:FOD+ZRAOO
-M3[__'Q]_'Y_/;\_/+Y-#(TOKREJ"PK(2KA*N[N[N[FXNTI("&LHK.^-S$U,O
-M;V_O[Z]S0Q/_'T-C_Q^SJ_M:#BY.AC8&Y@:&)B;>[AJ:FF//OY]?IU]?IQ]/
-MSP\O$P/;BVHZXD*2+N[N[NYN;HZ.[J[R(OKJ"]M#$Z_O;P\/C^^O;Q_GO]/_
-MIT_;NSK.OGZ&=G9&1K:&YJ9.0OJZ2^\_3W]?7Z<G)]]_GW\/+],#.ZK*(K(R
-M4F[.SK[^_O[^SBZ2LN+ZJWL#<U/OST]/S\_/?V>'?T^G)P_;BP+^'B9&EG:V
-MMK:&YJ9.PCIJ.R^_/Z>'AV=G9Z=?'P\O+^/KRMJR;@Y.'IZ>WAZ>O@ZN@B(Z
-MZSL#DR]O;[_/+^_O_Q<)%W]G-R=:WH:HEA8(N&@&9L:^XEO_7T_S/^>/^VM+
-MX[-3H^-?YZ=?)V??;Z/B4HZFQC;&AH8FGFZB*LM[P^_OKZ^OK[/#L[,S\R]'
-MR2D_)T=?VF;&J"C6"+@H9IZFTJ.O7R</$X\_LTHJ>UNS\T./!S=??^>?LRKR
-MOAX>9K9F_IZ>CN(KX\,;(^_OPR-C`R-C,P.#K\_'B:E/7P</,@8VJ"BHB,BH
-M9EX^XL-/W^>?;_]/XVM[DP.*NU,OSP]3+T_/`\KZ^JX^?AZ^[N[NPJK+Z_L#
-M,Q.3PR.;HR/+:WL;X]\7M^__9Z_"OF;V]G:HZ);F)MXB&Y,_I]]_IW^3(^/C
-MV[MK^^,#8^.S4Y.#6SNK"J(N[G*N[A("VCIJBPN;PV,[FS,S&QMC&PO+>]LO
-M?V\#KU.KPA*^IB;FQL;FWGYNVJN[0V\/#[]/[R]3HWL;.^O[8UO;0\/;F[N+
-MROHJFE+B^E(".MJJZBO["_OJBP/+ZQMCN\H[8VK*`QLB:H/KHHHK&MJZHG)R
-M6F)2$J)ZHIHK:XJJ0[,J"Z_S"[NS4ZI#_WH*']M.DX].[C_JYJ/S;G*O`V[K
-M$RNKZYI+.[(Z&SJZJFO:ROLKJOH:RP,R<@,++HLCPEKSJ^+K>WLK(^O+T^OJ
-MVPK:TP*R8\JJR[)C[YHR4Y-^&@^B)IN?4N8OIPY^/Z>^VJ<C'J/GPA[;9RXF
-M#[]R+D-/7B['*Y8+J>:6YX_.?A]3!H/G.H9/!_Z2SW^>;O>"]H>?-II'`F;C
-M/Q)N\P-2LF]K[MH_R\[#<]H[^YLZ:P,2,V,^<WLZJB)#&@K+NN..XT,>+VKN
-MV^J33DK_0KJ;0RHK&Z]RJN/*JJ+;&](+.JNC<LJCBK*S^V:/_PZ^/__.3L\?
-MIKN'[@XWVIZJ_P+^ORORJWO2FF_JKNMKZFN2X^J*\XHN\^_":G-3;MM_KK(?
-MZG)Z?^X2NZO*F@(ZFR)*:AN+J_IK(_N":]L"+R.F9ZN+J[ICZ^*KCM._QIK'
-MSOXG6L9W@]8G;V*2[PIBYUY.Q[K>#VHB[\KN"\<F(G,J@I\Z5O??:+-'AL)W
-MABYW)AN/?F^/)EM_ON)?<J;'JN8G:CHJJG,^#^+NTYMB[A,_3B[G$LL;2NL;
-M6]J2+_IR&YL"$V[O"TXWQFK'LMZO?U[.WSM>;_O&IY/FX_^.`PXOX_([`O_N
-M^P.NHY^^ZK^[BL[ODX9_RBX_[M)?4GI;/J<R(K+O;X;_`]*OHGIK&[NNLN>2
-M'A\[$@OC3K_#AL\O;GKSHXZS$VZ^AR^HAZ^FKVXG4IY'K@*SD[[+KZYOMO?R
-MGM_^#[[O\^:_OP9O+Y*#$O_;IB^_GNHOPK.2NN]2:R-NJP\^@C/K,V;3)X;3
-M^T*GCLH_<O,N<Q,^DX,N6T-^2L_*9IL'IN:IGNI3BX]&%[OH%\\6PY^",E*G
-M(N;I!AZ7JN8^=XH6?P<&2F=2WF=;9OI';@;'.M(:)UHFA[M^/QO:LM_+QF=K
-MOB,S,F)#`VXJ+YX#@[ZOBCX_^R[JVY-NBR>>HB?"0A/[;@N_<LY3DU+"7^ZJ
-M#\YO@NK;JII*,R[+BC,2$@<>8B>.&A.Z8RX"3Z*R\T+J4X[_>CJ_+@_#9A]C
-M_L\">N.BFWK:+TX+\PX3JJZORT*#VF.R.\..FVM[>FHOLCJC(\+Z+_I:V^NZ
-M(XL"H^OR0PHBZZJ;0HMO_HO_\GX/[TX*3PN^PZ]2.FM3`B)CJXHZ,]J*CRX;
-M6PH*VN^NLO.*F@JK6]I[2\OZ^^.BX^KZ^ZO"2^.2"J-"FO.J`MMJNQO".\-B
-MZF/JZCO*&X-RRN\"LL.J>OK;ZL)KXYJB[^IR#TOR`YMR>_O"NTKBX\I:&XOZ
-M*WLZRSM*^^KK&TK+J^N*ZLN:JZL*JRL[BDK[RJHK:^IZZ@OKNLJJJNK+RXMK
-M&TMKZ_OK.@O+:VJJ2VJKJBJJ2FJ*2LKJJFIJ:ZMJZZKJ*FKJZZMJJJNJJ\OK
-M:HL;2PN[:PMK*\NK:VN+"ZK+:XN+ZPMKZRHJ*CHZ2IJ:VAKZ^KHZ2DI*BHIJ
-MZJKJZPLK"VNK2[N+^YL[NR,C&T.#(R,;VUOS@UL3,R,#X_OK.@*NSAZF)N;F
-MIAY^#I)BN@L#D^_/3P^/CZ_SLV,;NSL+:VNK:XL+"PLCOS];QT=#QU\?$X(3
-MIH8&J):(J!:HMH8N\HKO/^>GMS<GAZ>?`[L;LB[N;FX.6MJZN^-SP^_OTQ\'
-MI]\I!Y^7IW^:&F)6]BAHB+BH*%:&_OHBSX>G1Y>7QV<'C_OK(@[>_IZFSD*:
-MBF-O;P\_O^^/'\<'/^D7KY<G3\H.BBA65@AHN%96J&9^2F)#AU^'-Q?')X>/
-M>[JB[B:^OIX.PJJK0P]O#T\_+Z\/?T<G7^F'O_??[]*"+BB6*&@(R':HEB:.
-M>F*/IQ\'MY?GW^>3ZUH"#J9NC@XRJAO[+T]O#[^_DQ,/?^??QY<GI\>?2Z*R
-M)E;6*(B(Z!86MI[N8JL/G]_'1T=GWQ\C"TH2;KXN;BYZ:GN#+V^OSV^OLX/O
-M_R?GQW>')[=_N[KNIM;6J(AHZ-;6MGZ.(@N/_U_'QT?GW[];*R*N#LXN+D(Z
-MZR-#;X]OCZ]3`T//WR?'M[<'Y\<3"X+>ABC6:`CHZ)86ADXN*X,_?^='Q\>G
-MWR_+BT(NSFX2+IH*:^.SKU/O+Q-S,P^GYS<W]S?G-^^K6N9F*%9HR.AH=A:&
-MCNY+H_^G)\?'!S_/[\J"@JY^;F)2@@MCHZ^_[^_/;W/OIR?']P<7Y^?GJBJF
-MIG9HULCH:%8V]FZ.*IOO)W]GAP=/+S\*\H(2WKZ:+D(C,X/OGV\O/X\/7R='
-MEX<7=__GTYM^9N9HJ&CH:.A&EJ9^HDO[IZ?G9\??<T^;,I)"/AX"<M)K,P.O
-MG_\/_]^G)T>I1[>I)Q^/>ZY&IJCHZ&BH:$9&)DYR(SN_'Z=??Z?S>PN:#KY2
-M_CZ2^DH;#^_/IU]?A\?'%ZFWUQ<__\-ZYL9&:"AH*"C69H8.4@N#,____\\_
-M$_L+HJY.;LZ.TF(J^_.O#T^?IV='MU<I]Q<7'T\#.N:VQN@HZ-:H%B8F[M([
-MD]-_'Q^O;T,ZHJX.7GZ^3BZRJYN3;W\?WX='-Y?I*7>I]__3V\*V1G;HZ.C6
-M*#;F_BYR(T-O3U]_+X^C:O*N3M[^ONZNHBO;@^]_7V>W%]<IZ5?7]Z>3:P*&
-M]G:HZ&C6UO9FOA+"^W./#S]/KQ.;:YH"[H[N;E(R.BK[0Z_/?R?GQS=W%_='
-M9Y\3*B+.YL:VMG8VQH8F?BZ2VHO;8Q-3P\-CNVHJREKB8@*R(IJZZ@O;LV__
-M7V?'-_>WQP>G;V.J$CY>9D:VMC9&AN:FSD(ZR\.SLZ]3H[L[JGH:(C+"HJ(Z
-MZYM#;W\G!S<7%_?WQU\O&Z).WN9&]C8V-D:&YE[NHFH;\_.O+\/[N^M*2DI:
-MVKKZNBN[(Z]/'V>W=W<W-P=?+SN"OJ9F1C8VMD8&)EY.LDI+@Y,3$[-C&VLJ
-M2OJB@B(:&DHKNP/OOU^'M_<WMT=G_Y,+PKZFAK8V-C:VAB:>+AJK&[/34]-#
-MV\OJ.AI:6IJZRBK+VS-OOU]GQT?'AV>G#P,K0L[>YD:VQL8&)MZ^\GJK>V.S
-M,X/[R^L*>AKBXII**DN#TP]_IV='M\=GYU\/8RJR3M[FQK;&QH;FWCXN8DK+
-M([.3<^.;.^N*NAKBFLK*JUO3#_^G!T>WMX?GIV^;RI(^IN;&1L8&AN8>OJX:
-MJLM[@[/C&WN+JBH*&GIJ*BK+8R^_WR>'1[?'9R>?K_LZ+IXFAD:V1L:&)MZ^
-MKAJJ"UO#XR-;NRMJ2@H*JHN[8U.//U_GAP?'AR>GOX/JXFZ>)F;&Q@8&9J9^
-M#G*ZB_M;`P.CFTLKZ@I*"JKK2^,3;S_?YX<'!V>G'X^C:F)N?J9FAH9FYB:F
-M?BX">BKK.UL;.[OKJJKJBJJ+RUN3[\\?)^?G9^??_P^SB[JR#OX>)N8FIJ8>
-M/@ZN8KK*"FM+BXN+JNKJBHKKRUL3;T^?)V=GY^>G/P^3BQJR3EY>YF;FIAZ^
-M;JY">@JJ:VMKR^MJ:LJZ2@HJ"]NS[T\_W^?G)R>G3^\3.SJ"+CX>7B8F7IZ^
-M;BZ2@OHJJRO+.XN+Z\JZRLJ*Z_M#[T^?IZ<G)Q__C]/C:_JR[DX^GM[>?K[.
-M[JZ2LB(:&IIZ>CJ*ZNL;,V]/?U^G)Z<?_S_/+P-+"J)RCK[^GIZ>?K[.CBY2
-MDD("`J)*JPM;DV^_'Z>G)U\?'S\/KP/[*GIBDN[.OCY^?OZ^3LZ.[JZ2LN)Z
-M:@M;<V^_'Z<GYR>G'S^/KX/[JOKBLJZ.SDZ^OCZ^S@Z.[NXNKI+"V@K+PR_/
-MGZ?GAV?GYU\_#W/[BN+2;D[^?OX^OKY.#NZNKI)"8IJZ*OO#KX^_GU]?7]^?
-MOV]S6XO*HD+2[HX.SDY.3D[.;JYR8LJ+>X/3CT\___\_3P\O0]L+BMHR$E+N
-MC@X.[JX2PGJJNUL#\Y-S,\-CHYN[RVNJBLHZFMI:HEKZ2NK+6X-#,[.#HTNJ
-M2IJ"\I*2$M)RPN(:2FH+FX.O#\^_OP_OTP/;"PJB0K*N;FX.CFYN[E("FBI[
-M@W/O#P^/[Z_3,^/[:^K*>B+"PL+"PL)B&FH+"[NC8^/C&\N+JTJ:6B*B(B+:
-MVIH**BM+(_/3K^]O+]/#&PLJ.N+R+BZN[NXNTD):RHLC0W,O[^^O<R.;2ZI*
-MFB("0D("@N)Z:FN;@T-SK]/S8QM+*TI:PG+24E*2,L):BHL;`T.3+R]3DX-[
-M"^HZ&F+"0K*R0F(Z:NN;H^/S4]/S@YO+JKH:8G+R0K("HEHZRR,C6V.SL\-;
-M:RIJBKH:XB*:.KK*:@OC<_,#(R,C>RK:`H+B8K)"HCJ**BJK.S/3LR-;HUL[
-M"F)B6F)B6MI*"YM[2\N;PS.C2XMKZXJBPF(:^CKZRJM+&_N+*PL;&TLKJFL+
-MJ[I:6CK*NKK*J\N[RXN+RPOKJRN+"PL+BXL+BROJ:NHJ:LJ*ZZOKBZNKJRKJ
-MZNJJ*RNJZHH*2DK*BBJJ*RMKR[N[N\OKJZKKB\L[.SM+RPMKJFI*NOJ:FOHZ
-MBBHK:RNJZ@J*:BL+2[O[.SN[2VLKZ^NKJ^K*ZBNKJZLJZHI*.KH**NL+2TL+
-M:ZNK:VNKZFKJJZHJ*NO+RTO+ZVH*:HJ*BFIJZJJK*VMKBVN+:VMKZ^OKJZHJ
-MJJLKZVN+:RNK*FIJBFIJ*PNJ*JLJ:HK*"HIJZBHJJVO+2_M[.[L[.TMKJJKJ
-MZHH*"@IJBFIJ:FIJ*JJK*RLK*RNKZXO+RVN+BXMK*ROK*RLKJJJ*BDK*"@J*
-MBHKJ*JNK:NN+ZVOK:^NKZZN+"XO+:\N+Z^NKJZKJ*ZOJ*XJKB@KJ2BIJZBKJ
-MZ^NKZZKK:RN+JZLJBFIJZJNJ*ZLK:ZLK*^L+RTL+:^NK*^LK*ZNJJNMKZNJK
-MZFIJB@K*R@H*BNHJJJLKZ^OKZ^LKZXL+"\L+BVLKJZJJJJNKJBNKJJLKZRLK
-M*RNK*BHJ*BIJ"@J*BHHJ*NHJJROKBXMK:XL+BVN+JVHJZHKJJJLK*RLK*ZOK
-MZVL+B^OK:RNKJZKJZNIJBFKJJJNK*ZNJJJJJJJJJJJJJJJJJJJJJ*BJJJ^MK
-MBXL+RXMK:VOK*ZNKJJNJJZNK*BKKBRHJJFIJ*BHJZNKJZNIJ:NJJJRLKZXL+
-M"PO+"PL+:VOK*ZLKJZJJJFIJ*JJKJZNJ*BIJ:NKJJBNKJJLKJNHJJJHK*ZOK
-M*^LK:\O+"XMK*XJZZNH*ZBHJJJHJJJLK*^NKJROKZ^OK:XMKZ^OKJZLKJZHJ
-M*BHJBFIJBFJJ*JLK*XOKZXL+*ZLKJRMK*ZNJZNHJJJJKJZLK*^LKZ^MK*RKJ
-MJZMJ*JKJZJJK*JJKJRMK:XMKZZKJ:FIJ*JHKJJNK*RNKJZNKJZKJJJLJJROK
-MBXMK:RNJJBLKJRNJ*JJK*ZNKJBLK*ZLJZNJ*ZJJK*BJJJ^NJ:NLKZJHKRTO+
-M:RNKJBHJ*BJKZ^OKZ^NJJZJKJBHJ*BJJJJNJJJJJJBJJZFHJ*JJKJJOKZ^MK
-M:VN+:VL+B^MKBXMKZZJJ*NIJB@K*.OHZ2BHK*JNJ:FHJJNN+RSM[FWL[N\N+
-MZVN+:RNK:CJ:6N+:2JMK:RLK:\MK:GH:6J*:.HKKVS.O[V]OKS/#LUOJ&H+2
-MKG)"LC*"FLHJ"PNJZJNKBLHJROH*Z[M[>ULS,QM+:[KZ:BOKJTJ:VGJ*:CJ:
-MNBH;<Z^OKU.OSU]_`\JR;DX.CKY>IDZ":KO;.VL[X\.C:[I:(CIK2^OJJ[N#
-M4^_3XSM[&SM+:@*N+E+RLO*RVFM#CT_/;R^OKW,#>RIZ"BMJ6K)2+BZN,H*R
-M$@)Z"BHK:^NJJTO;&SO[VV.#HSOKBKI*2CK:8H(BFCJJ^^/SK^^/CR]S<V.;
-MHZ__G].J`BX./AZFY@;&YDZR2FN;`]/O3_^/@PMJBJMKZPO+:PL;@[.#2XKZ
-M(L("`O+2T@**>V-S+V]O;V_OKT-;XX^GWU.J,HX^GEZFYL:V!AX2R@LC<].O
-M#S]/+V.[RVNJ*[N;2RN+&]L+"OIZ6N(B^DKZVGIJRYNC0Q,3,T-#LS-#D\^G
-MYY_S:G+.'B9FAD;V]L9>4DK[,^]OSY_?G[^O8]L[BRM+&QLK>J*BHJ):&GK:
-M8B)ZBBN+NQLC8\,S<P,;RTO;`],/)T?'7Y.J8NX>AD;VUJBHEF8.XNLSCS_?
-M)V=GI\^3H\LKB_M+JLKZ2JJ+>WMK"EJR\D)"0L+B^JL[VP-S4Z\SXWM+BPN+
-MZXN[`]_W=^?3FJ[.IH9F9K:H**C&#J++TP]//_^G!\?G?R\CNWM#[Z_+@NY.
-M_K[26@IZ,K)Z:YM;0W-CBRHKF\.#N^HZ6MH*.X/CN^N;OT?7%P</JNXF!L;&
-M-E;H:"@VWEJSO]^GIR<'1T<'IV\[FL(BRBJK:CK:>JK;\S,CJR("0F(:FAJB
-M8H):BCLC`P.CFYNSS_\OJ]+.CG+B*K,/CQ.;"SN;R\H";AYFQ@;F?FYR8OJ+
-M`P]?YV?GI_^/4T/;ZYJRTE(2`GHJBPOKJZO+6QL+JXI*BBKK.SMK*FKK2TO+
-MBZHZ(@+"8GJJ@T]?'\_S>ZK:DFZ^'N;&M@:F[GH[\X^_GU^GI]__CS.;:^JZ
-M&B("L@(:BNM+.TLKNB+::NJ*:DJ*:[N;&QN[NQO;>VL*.KH*2GK:6AJ*(S^'
-MQV<_XTIRSAXF9D9V%G8&OIICC__?I^>'!V>GS\,+"LHJ*\J"KFXNPOKJBPOJ
-M>AHZ*BNZVB+BRENO#P\O,V/;F_N+"MK"DI(R8IHZZZ]G=W>'C^OR_N8&1O96
-M*"B6IF*#OR>'QT>W-T<G#]LZLM*2(CHZVMK*2R,;:VKZ8M+NKO+"LL(B*T.O
-M#W^?SQ-C6YN[JJ+2[F[2HDJ*NFM/EVGIMY/R'@8V]I:H:(@HQH+3GR?GA\>W
-M-T>G,TI"0AH*RKIJ:_MC\S,;2E*.;BX2DM(NKN+KPV^/4W,SLQ.O<^.+.B(B
-M>NJK"AJ"0GI/Z3G)QTK>)B:VJ&C(N,A6CG-/;P^GMQ<71S\J[JXJ8YO*FJL3
-MG^=G?TNNSNY2#J;FIKZ2ZH,SHZ.33W_/K\-+>B*::FH:`MJJBVNK\ZE9&4>N
-MAH;F-NB(R#@(IF-OTW,/)V<G9_\R9AZJ;V\CHV\?9_>7)R/:\A)N7H9&MB:B
-M6YNJZHOCPR,[2C+ZPR\SFSM;0Z_O`\IB>F).RSG!X4<RABC("`B8('CFK\\_
-MYW];[P>'FQYFIDXJ)P=/SS<I5[?GKU*F/DZ&-B8.<LL/4[KRHAH2+@*:^MN_
-M?^\O\XNK@Q.;"AHNCC=!D9F[MOB@2"AXX'BFCX=WAV)>>Z?#HJYFMB[_QR<?
-MA_=7B>FG"I(^AH8FYB9R,[]OFW(F9GYN[J)[K_]?3[O:FHHKVWLK6V.[Z9&M
-MF8)HX&!(J)@@B'J?=]?[=L;;SZ/K#A9&RZ?GY^>'EPG)-VN.IJ:.0E)2"L-#
-M"W+F-@8.&BJ+>P.O+R/JN@LC.^N*XB**FXE1;2&NN`"`2):X(.B#9Y?'W@B6
-M.Z<_@PY6]NH_G^=GMRG):7]"TJ*B\@[^PA._8W)>9N9^#H[R:IN#`^.CHWO*
-MXMH*ZJ+Z.6T-V19@<.!&DFB@EJ=W]_M(6+9'Z8=Z-FCVREM[/S>)^;E'4@:>
-M@LHJ"ENGQX_NQL8>@DKB4D+ZNGJBXLIKJJHK@K[^XLEMO8$H`'#@WNHH("CW
-M"9=RF""&:4GGIF@(-LJKTC.IF:&YST:HAD+JB^._QT>;AI9F8B]OJ^XNPMJ:
-MFAJK,_/J[J9F/@F-O>%HP/#8LB(((!:7"6?&V!BK>4F3%LBH;MOB;K\)&?E'
-M/E9F:]LR$LO?-X?:QB9*0V,Z[NYZBYHR*_-SF\)>)AY"&0V-J9C`0`BKWOC8
-M0HGIJF@8J'>A5WYHR';R@NX+U]DA^:.(^"CNPYM+CX>'+XZF@K]G3X*FWE)Z
-MJJ./3V..!D:.H<UM9QA@8&A.B."8DPDWWDBXLDE99\:6AG[^=E:J.8&AIX;6
-M!K)2!H9CEY?OO@9:YP>OHG***Q)F9J)?9[/N_G\QC<&&&'A(YC;@`,@_UP^F
-M*`:'B7>R!EX"/C86;M<9N0<[&B("GO:V@A_G;XK:@^?G+[I:JGN:;IZ^VD.C
-M(NJYT9'7MJCH]KZX@"#V"@NNQK8SJ2DG&I["*^[>?M+31[>GTQOJ:J*2<NN3
-M#V\S&],/CZ_3HSN[^JXN$G(RXF.I^7>BPY\+&ZOVB'9F%O:&M@8NFKI;KX_/
-M;P__CY,O\\LKRE)RJ@OZ&DHKP].[RDOS;X]S2^MK"^K:PB)+!ZDO2U?IIS\S
-MWB:Z7F@HUM;&YG86ACZB(U._7Z>'!]_O;Q-[^PN:8F)BHFI[(Q/OCR\S\Q-[
-M2OK:TFX*9X=:4VG7_^>O_G([!NB6%M;&!I:VGFX"*NL;[U]G)\]OCW-C(^HB
-M2BHK8_.;>_-SLY.30\/;ZN)R$KNW!_K?";?3OTJ&+OH6:'86UL8&]N92&NL[
-MB[/?YQ_OF[O#HZHJ2]L3[^-K2_OC[V]SLQ.#&\LZ,GK_UY^RAVDG@^\RYLI:
-M*&CV%E8VEJA&[DH+*QNGM^<_+V,3;YO:2@N[&SL**\.O+V]3PS-3`WM+"\-'
-MU^.;*:G#HUL>IH*VR"A&]O:VEO:^^BIZVA/GIR]#.Z,_CTJ:>Z-;8TLK<\^/
-MCV_3KU/C^PM+7U=?:O>)7QM3$F92GH@(]G:HEA86IAJZRFLO9^?O@[-CH[M2
-M#@I;*^O;PW^'IV^_G\\O8PJ*#Y='N_]IEU,3:Z8>#E;(J#:H5O86!E("<EH;
-MO]_OHX-S\]O:TFI#>ZH[@V]?WX_/_P]3DZ-S)W<W(T=YJ3\KKGZ>1IC8*!8H
-MZ#8>:Y\#HF.'/P*.>B+.)J:.>J)RF^>W9^>W=X?O@Q-#8ZEA&=\WR1>F5I:H
-M*#C8.*@V*+;+)Z]KYS=#WCXRTIYFWDM;4@[[+R/+[V?'WP__IR\+VP^?5V%A
-MQ]<Y1S;H1FCXH-AHJ"C6XI^/,S_7]P)F0M)V5B;NTFX2`P^KJY^'IQ_?Y]^S
-M6P\_C[?A`1>7F:E>*,:H>*#8:&C(J!I/*PMGU\<:?OOZUE9NKF8>REMJ0B/G
-M)\^G1^<_CP\_[\_)P7D_^7FK5B8F.%@8B"CXR$ZOJZK_EQ>C#F-JJ%9";C8F
-M*AOB+ING;X,G1Q^_7Q__?W_7(2&G:5E/-EZNB%AXB*BX2*9[`HZ?E^>ORR^+
-M]O;";E;F&]K.<O.O:T-GAR^_AR>/#V=I(9GG^9D*9@J.^)B(:`AXZ`Z.WCOG
-MG]]?,_L:9F8NYO8.FKX."^.;0]]GIY]GAS]/)_>Y6=?7&>=>0IHH>(CH:,B(
-MINY>@C^_SZ>/6\N>9NZF]J;"3GZB:\O[[Z=?OR='7_\'MXFA";=YJ6[22G;X
-MB.AH"`C&TOZN;]\_#T.ON@:FDF9V?K+^+JK+"P,?Y\^_!X<_I\<WR9FI*3G?
-M4DLN:+CHB`@(Z&9^'HI?;T.'YTIBBLXF)J:>GK["BIH+C\\//U^G']]?!U<Y
-M.7?)R=M*.Z;(""C("(B6)J:N,]^/?V?SZS*>_N:VYLZ>_JIK*U,_GQ_?YV=?
-MWP>7";FI:<F_>B..:,@H"$B(J`;FSAM/C\^'_TKKPJ;>'F9F/LX2NJJ3OS^G
-MYR<GY^=G=\G)5XF);TLS3NB(Z,A("*A&ALZ+;^_/QY^JVTH^GAYFAEY^4EKZ
-M<W^?IX>'9X=G!ZG)Z7<)UZJCNX9H*"C("&B6!N;R@Z^3)]_;6_HN#OY>WCY>
-M#F*RZ^\/_V=G!T>'QU<)"5<IZ>]*FTZHZ%9HR&A6M@:.RP.O_\^3XS+NDCXF
-MGLX>3H+:JY,_I^=GM[>'Q]=IB2DIZ1\*^\XHB*B(2&BH=@:.JEN3GV>3V\.N
-MOBX^YIZ./E*B^N-O_U]GAV='MW?IR>E7:8<JFT)VZ*AHR(@H=L8>H@,O;R=/
-M`[NRKCZFYMX>IBYB6ML/_Z<'QP='M_<I"6FI:9<CHZO&Z*CH2`CHJ)9F<BK;
-M[]]OX[,:+G(.)IZ.GL[:&BL3/]\G!S?'1Y<I"8FIB1<;PYO&:%;HN`@HJ!9F
-M[GH[TQ]/<^-JVG(.GGY^'@YR@JM3SY_G!\='-_?7:0FIJ2G/RT-NUJ@6",CH
-M**BVOO*KPU./KQN*2L+.3@X^?F[RLLKC+\^GQP>W]_>I"0FI:>DO\U.>J!:H
-MN`CH:"C&3M)J\S]O,^^J,MIRWGYN7IXRLB(CSS^GQT>W]Q?I"6GIB7=3O]N&
-M5O;HN&CH:*CF/H[[#T-O/VO::X)>SNZF'E*N4DO3[Y]G![?W]]=IB2GI*2<O
-MCT)&-O:(B"CHZ#9>_I)[[\.33]LB*DH>'BY>YBXR;JKO;[\'1\=WUU=I:2DI
-ME_]OL[[&QI9H*%8HUH8F3@*J8T.S^SN*@JYNSDZ^3BZ2&OMS;]^'QS<7*>EI
-MB2G7AW]SDB:V=BCH*"BH1N9><MH+FT.;JVN*8JX2CL[N4JY:NV,OG^>'MW?7
-MJ>GI*=?'/Z\Z'L;VJ.BHJ%:V)I[2H@NC@TMK*]K"LJX.+J[NDAJ*FZ]/WV='
-M-Q>I*>DIU[>GCRH.9K;6J*BH5O;FI@X:RBN#&TJ+2T)R6BY.PH)N`NNJF\__
-MGP?W]]<IZ2FIE^?_(]*FQI:HJ*BH=H;FGK*:"H.#^BI[(JXZ8LZR.J[R"PMK
-M+S]/I[<W=ZGI*:D7AW^3.OYFMA:HJ*C61N;>;H**BSNKJVL*HN)B0G*"@B**
-M.QLS;[\?YX='=U>I5Y='9S];PGZ&]A96J-;VQN;^KJ(*^QO+:\OJVEHB\D*B
-M6AHJ.QM#;T\?YP=']]>I%_?')X_K4MX&-G86%G:V9MZ^4J(J&YL+NTL*(B)"
-MTK*"PJ(JNYL#+T\?YX=']]=7%S?'YP^[LGZ&MG;6UG:VAJ:^KEJJRPM+2RN*
-M^J("0D+"XIIJ2R-SC__?)V>'-Q<7]T<')X^[`C[FQO:6EO:V!B8^+L+*"XL+
-M.\NJZLJBXN+"`MK*JSOCT\^?IV<'MY<7][?'Y\_;&@ZF!K9V=O:V!B9^#O+*
-M*RO[&^OJ:AH"0L(RPEJ:*IMC4T^?)X?'-Q?7ES='Y\\;(K[FQO86%G8VQN:>
-M#K(J.\O;@_OKJ_H"8@+RPJ(::OOC4[^?IX?'-Y<7=[?')V^[`K[F!C:6EO9&
-MQB8^+N(J^YL;&TOJNMI"<G*2\B*ZJIOS[S^G9\?W%]?7=T=G_V/:;J;&-G86
-MEO:VAMZ.PNH;HV/#VXMJ&@)",A+R8EH*.X.O/Z=G1W<7UQ=WQ^?_(QKN7@:V
-M=M:6]D:&IDX":SNCKQ-CX[OZHN(2KO)"@KJKR\,/'X>W]Q>I5_='YX_+@KYF
-MQK9V=C:V!N8>SK**NR-#LV-;.XHB`D*R@N(:JIL#+Y]G!S>7UQ?W1^=/6]J.
-MI@9&]G;VML9F7KZNFFO;0S/#0X/+2CJ:XF(B6LH+VY/_)V?']Y=WM\<G3^/Z
-M;EYF1O;V-D8&YAZ.\EJK&R-#$\-CHXOJJLJ:N@K*J@M+DW\?7\?WMT<'7X\S
-MZJZ^WF:&AL8&YEY^CI*""CL[^Z.CFQL[JXN[JHHJ:BH+.QN3OQ\?YP>')U\_
-M\SL*P@Z>IN;FYN8FGDXN`AKJFZ/;8R-[>SNJBNK*.HKJ:BN[@V_/SZ>'YZ>G
-MO]/#:\*N[KZ>WJ:F?KX.KL):ZIO[R]M[ZRNJ2DHJJNKJ*JJ+"[L;`X^_3W^G
-M7_^_[V,[*H*N[D[^_GZ>/HXN<EJZRNL[2[L[RRLK*ZHK:RLKZRLK"QNS+R^/
-M?Y^_SV_#&TOZ\I*N#@X.3LXNTI*"&KJK2XN+^YO+JJIJJXNK*HO+NWM[FR,#
-M@P-#<_-#,_-CVSLJFEJ"<G(R<O("`K("(EHZBJKK"XMK:VOK:VLKJJLJZBJJ
-M:YNS$U/OCV\O4X-+*XJ:HF+"DM+R$I)"`B)ZRFHJ*JKK._MK"_N+*\N+BBMK
-M*JO+ZRM+^SM;P\-#$W.#(WOKBDH:`L*R,D)"0@*BVGI*RBJ+2SN;V[N+2VMJ
-MJ@NJ:HLKRJK+*RO;6Z,S\[/S,^,;2ZL*>B)"\I*2<G(R`B*:RJMKR[L[._N;
-M>SL[.\LKJZOJ:JJJZJHKJ^O[&UMCL[/S,V.;2ZO*FF+RTJZNTC("VDKJ:PO+
-M6QL[2PL+B^NKBHHJZNJK*ZN+NSL;XV,#,T-C@UN[:ZHZVJ)"\D)"0F*BHIK*
-MZJL+2SO[.\MKZ^OKZRNKJBHJJZLK:^N+^ULC`T,#(YN[2ZMZVMHB@H)B8N)Z
-M.KKJ:XO+.[O+BZOJ:FJ*BFHJ*^OK*^N+B\N[>]LC8X-CHSOKZDH:(F+BHJ+:
-MNFJKZXN+"\L+:^LJ:HH*2KI*"@IJ*VNJ*[M+NYO;HR,C(UN;NRMJ2IHB(AJ:
-M^LJ*BBHKJ^O+RPN+:ZKJBKIZ^KI*"HKJ*^MK2WN;&Z/CXR.CVSN+*KIZFIJ:
-MFOI*"@J**JMKB^LKZ\LK"NKJ:NKJZBJJJ^L+"VOKZ^MK2[L[^_L[R^LJBKJ:
-M&IIZ.@IJJNOKZVN+"\N[NTO+:RLJBDJZ2LH*:FKJJ^MKBXL+B^N+"\O+"\N+
-M:VLK"LHJB@J*BFJJJJHKZZNK*RNJ*NIJBHJ*BNJJ*VL+2[O+R\N+ZZHJ*JLK
-MZ^N+B^OKJRKJ:HH*RLH**NO+FYL+:KJ:6CJJ:PN[N\L+BRLK:VL+BRNKZHK*
-MR@IJ:BJJJRNKJZNKJBKJJROKZVN+R\M+N[L+BXOKJFH*2DI*2KI*"FIJ:FHJ
-MJRN+NSN[N[N[R\L+B^NKZFJ*BHIJ:NJKZVMK:^J**HH*:FKJ*NHJJBLKZ^NK
-MJROK:PO+R\O+"XOKJBKJ:HIJBHHJJZNK*XOKZZNKJJJJ*NHJ*BHJZNKJZBJK
-MJRNK*VL+R\O+2PN+:ZNKJNIJJFK*:HIJJFMK:VMK:XOKJNJ*"@IJZHIJZBJK
-M*RNKJZNK:TM+2PMK:XL+BRNKJBKJZNJ*:BJK*^LK*^LK*FJ*BHIJ:FIJ:FKJ
-M*JJJJROKRSN+RWO[NSO+B^NKZHK*NKJZ2HHJZBHK:XO+RXMKZZLJZNJ*R@H*
-MRHJ*"FJJJ^L+N_M[FQN;.[O+ZZIJ"LIJ*FJ*ZNKJ*JHJ*BNKJBNK*NJ*BJIJ
-MR@H*"HH*ZJHK"TL[FUNC(R-;FTOKJFK*NCJZ2HJ*:BJJ*NKJ*BKJZFIJ:FIJ
-MZBHJZNKJZFJ*"LIJ*BN+^UOC@P.#8R-;>\OKJVI*NCJ:XEKZVMIZ^DJ*ZJOK
-M:^MKBVOKZXN+*XN[RXN+Z^IJJBIJ:@HZNLI*"JL+RSN;6V-#0\.#(YM+:^KZ
-M&B*"PL("@B*:.LHJ*VOKZ^OK*RNJ*JN+*^N[^YL;>_M;V_O[^VOJZHKZ>OI:
-M(EHB@F*BVOKJBSM;0]/O;^^OKY,#6TN*VF+RKBZNKJ[R@J)ZBNHJZPM+2SL[
-M"XO+"XO+2PO+F]O;6YO[.PMK*FJ*2OIZFAH:VIHZ:BMK"TL[VR.#P[/#8Z-;
-M^^LJ"AJ"8L)RDC*RPB(:>@JK:RLK:\L+2SL[2[L["^OKZRN+BZNJZVNK:TL[
-M&]NCXR/CX]L;^[M[&[LKJZJZVB(R+NZN+NZN<C(">HJJR]LCXV,#`^-;F_N[
-M2PNJBDJZ.CJZ2@KJJPM+2SNC`[-#0P.#XZ,;>WM;XQM+>_LK"AI2#HY._GX^
-MS@ZN0H*B2BO+V_.OKR]O+U/3D\.CFXN*.OH:HJ(:>KKJJJL+FR/C@X-C(UL;
-M>[MKZYLC>\L[^^NK*AJ2KNY./DY.3H[2LL*BBLL[8Q-3KR^OTU.30R/;2RLJ
-M"CKZRHJ**JJJ:[L[._O[.SL[2^LKJ^H*NCK*ZHM[>[M[@P.C>^NZHN*2#CZ^
-M3HXNTA*R&FKK.]MC,U,OKR^O,Y,3PR/;NVNJ:LHZNLJ*:NKJ:NJJ*RMK:VMK
-MBXOK*RLJB@J*"HHK2\OKBZ-C^XNKBCJZHE(NTG*2\K("VKI*2NKKRSN;&UN#
-MPT.S,_-#@X-C>_M[RPN+ZZHJZ@H*BHJ*:BIJ"@I*.OJ:6EH:>GJZ*FN[>YM[
-MFR/C(Z,;^TLKNB("0G+2$O(RPF):.FJKRWM;XP/#0S/S\T,#X]M[2VOKZDH*
-M2IKZRNKK*VL;&VKKRTHBVLKZHB*ZNIJB^@IZNILO4W,/G\^3+Z][>J+R3AY>
-MWJ:FG@[2LDI[PW./_S\_/_^/TS/;ZMHB,A(2<K)B&LJ[VUL#\S-#`V,;.SOK
-M*BK*VDKZ,J(:8@(:>FH3TYL/'T/##X/:"GK.?MXFYF8F?KZ^8BOKXT^_OZ?G
-M)R<GWS_O`Z.*`L(23LYN3LZN\D(:JJO+HS,3KR^OKS,S8SLKZLK:HN*"`K(B
-MJAN;6R]3XW/S.ZLJ>A(./GZF)IY^_F[R@CK[@U./?U]?IR>G'W\/\P.+>N+2
-M#DX^GOZ^3NZ28OIK8U,O#T\/3V]S\UL[BRJZFN*R`D+:.WM*K^^+K]/CRZMJ
-MLNX^#J9F7B:F'NZ26HL#+V\?)R?GAX?G)]]/$^,+6M(._B;FYN;FICX.TOKK
-M&_/OCS]__Y\_3P^OLZ-+ZNIZ`@)"8OKJRNN#V[OC(\LJ2AI2C@[^7EY^GCZ.
-MD@+:BZ-#+[^?7R?GYR>GI_^/[WLK.E(N_MXF9N;F)EZ^CG+Z*@/3[[]_WU]?
-M?__/+Y,C^VHZ6C(R4A(:ND*K(SHC6YM[.OMZLC*NCIY.?CY.;K+2NFL[8Y,/
-M#S^?7]\?'S__CV]#.^LB`NZ./AY^IMZ>/LZ.DC)JBQMSK\\_WY]_'\^/[W/C
-M.^M*XC+R[JYBVC*Z>_J+.[O;BJ,KVOH"LHXN[@YN+L*2VBJK>UN3$Z_/3[]/
-M/T]/#Z^O(\OK&H(2;DY^GMY^_KZ.KL+:*YO#KX]/_Y]__[\/K\,C.ZM*HB)R
-M`AJBXAI+2NJ;*[M*:^JR&O*2[BX2;JZ2`@):JJI+V[,34P\/#P]/SV\/+[-S
-MXPNJ^J)2;LX>?IZ>GCYN[K*:BULSC\^_/Y__3[]OT[/CNRM*6H+RVF(RB@I*
-MJXO+JBHK.H+BLJ[N[BYN[K+"@GKJ*\M;LY,O#T]/3T\/[^_O<UN#>SK*VK+N
-MCBY^?KY^/DXN+O+**_LS#\\_WY___[^/D[-C*ZI*`AIZ>B+ZZJ)*BLH*FBJ:
-M,H(24HYN4FX2PN*B^BMK^V.3KZ^/SP\/#X^OKZ_3LYO[*WJZXM)N#@Y^GCY^
-M_@Y2<J+KVX/33\_/G_]/#P]38R/[RVKKB\H*^ZJZ>_JJVN)J#I)NOD[>#OZ^
-M+G):VKM[VY.OSV]/?[\_O[^/4]/CFWM+*_H:(A)N;@Z^/KY./@ZN4D)ZJLNC
-M$^]OOW_/O[]O[W/SXZ,CX]MJ<VLZ@X*+LJXZWFY^WI[FOEZ^#JZB@GM;PV^/
-MG[]_7_]_/[]OTY-;B^H*2J("HG)2\J[N+JZN+E+R<O(B&OJK^UNSD^^/+T]O
-MKR_SL]./L[-O\UL;H^J:8D*.7CZF9F;FIB;^+A+BJP.S[W_?7Z<GIY^?_^_#
-M6PO*(C+2+NZNTJZR>J+Z*JOK*VNJ"LHZ6F(B8F+Z2BJ+NV,S4^]O[^]O?Y^O
-M/W^#0R,[@A)2/J;FI@9&9B:FGM+:>GOO3T]?YR>G)Z>_[R\#ZJ)B$LZ.+HYN
-MLMK:BGNC6T/3D[,SPZ/+2XNZ^EH"$A(2+E+2\K)B2HHK^^-#LZ^O<_/SPUM;
-MHUNCL^.;KVM[8YHK,L(NOHZ>#OYN,JZZ"FN;@Z^S4U/S0YO;N^HJ"LKZ^LJZ
-M"BKK"[NCXX/#`R/[NPNJBDHZVJ*B(F(B&GJZZJHK*XN[N_M[.\O+RVNK*BJ*
-MRJJJ*LN[ZSO[*RJ*VB*:@F)"0EJ::LH+(]L3[[^?OY]_CS.#^\(N+IZFIMX>
-M_JXB2@MC+Z\OSV_S6WLJHF(RKBXR6GIJ^\-S4X^/+U,3X\NJ2N+RDC(RLEJZ
-MRJI+>SN[>QO+*^MJ^IH:HB+:NLKJ2QLC(V/CV_M+*XJZ.GH:^DIJJHL[F]L;
-MFSL+ZRH*2KHZ^KK*BFHJ*XL+RPO+B^LK*@I*NKK*:BJKZPM+NTO+RPMK:FJK
-MZBJK*^LK*RLKZRNKJZIJ2KI*NHJJ*BJK:XN+BPL+RXMKZZNJJJNJJZLK"PL+
-M:RNJ*NKJRKK*RHHJJBHKJVM+RPN+:RJJ*FKJZBJKJNO[2^LK*ZHJ*FKJJBLJ
-M*BKJZJNK*ZNKJZLKJNHJ*JJKJJOKZXOK:XMKBXN+"XN+:ZNJZNKJZNIJ:NKJ
-MZFIJZJJKJZJJ*FHJJBKJJJJK:XO+RRN+RVOKZZNJJZOK:^NJZNHJJJHJ:FKJ
-MZFIJ*BJK*ZLKZ^OKZZNJJJJKJZLK*^LK*RLKZ^NKJJLK*ZNJJBKJZJJJ*JHK
-M:VOK*ZLJJHN+*DK*"^N*ZFJKBRIJ*NL+JPIJJJNK:JJ+:PNKZ[O+N^MJNZHK
-M*GH+"JHK>LMJ*JL*:ROK*ZJK*ROJZZHK*XHKZJOK*JNJZVMKB\M+RPLKZ^LK
-MJVJZ2HJKBDJ*ZHN+ZZLJZPMK"NJJ*ZJ**BKK"RLK*PN+*RKJJJNJBHJJ*^NK
-MJJJKZRNJJ^MKZVOKJZJJJZNJJBHJZFKJ*BHJ*BHJJZNKJZNKZ\OK*VLKJBHJ
-MJROKBXN+Z^LKJZJJJZNJJZJK*VLKJ^J*BFJ*BHKJJJLKJROKBXL+BVN+:XOK
-M*RNJZHJ*"HIJZBJKJZNK*VN+"XMKZRLK*XOKZJOKJJJJ*NJJ*^LKJBIJBFIJ
-M*BHJJJNKJZJJJROK:XL+BXN+ZRLK*RLKJZNJ*BHJ*BJKJZNJJBKJ:NHJ*JJK
-MJJNKZVMKZRLKJZNJ*JNJ*NM+*ZLK*ZNKJJNJ*RNKJRHJJJJK*^MKZ^LK*RNJ
-M*JHJ*JKK:VLK*RNK*FIJZFIJ:FKJJJLKZXL+R\L+"TO+BXNKJHIJ*FKJ:NKJ
-M:BHJJNOKJRHJJZNJJZNKJRLJ*JJJ*JJK:^LKZ^LKZ^MKZ^OK*RLK*ZLJZNJK
-MF^]S(CX>;HKSKTO*ZWN#VZO:&OO#XXNB<@*K(Z,;"ROK"VM*(N)Z*YNC>RKJ
-MJRNK"KJ*:QN;Z[I:VLKK2PNJRDH*"@J**[N;&[L+JXIJJFO+RTN+BXOK*^K*
-MZBO+.VNKRKI*"JNJJZNKZZNK*@HJJVLKZHHZNHJKZVJ*BWM[NXOJ:JKKBXO+
-M2POKJJJJ*BLK*ROK*VJ**JOK"PNJ:NHJZFKJ:NJJJZNJ*NHJ*ZLJZFJ*RHJK
-M:\N+JRJJZZNJJBOKBSL[RVNK*FJJN_N+:XLKZPLK:@H*BFIJROKZ2FJJ*VLK
-MZXL+BZNJ*NKJJVLKJZNK:LK*2HJJB_L;&_L+Z^MK"SM+*VH*BNJKJZLKBTMK
-M*IIBHDI+>Z.;JLKBXOIJ"QLSP_OZ<M+B"T-#RQI"0GIK6T-#`V/[JPJZNJI[
-M&SMKZ@K*ROK:^JH[.ZO*.GI*JSM[BXJZ2BIK:RK*RFKKFS,38RM:LL)*^Z.[
-MJJHKZPLK2LHKRTL+JVKJZPL+2POKJLK:@B)Z2JK[XV.;N[L[F[NJ>B+:>HJK
-MZVLK*AH"8AIZ>OIZ.@JJZ\OC$Z^OTP-+*FJJ^_/36PHBHKJKZAKB0L+Z.[/3
-M4^]3:_(^GC[2BFOK*ZOKNZ-;>WNC@Z.+VJXNPBJCPWO*PBZ.4OK+@Z^/[Q,#
-M^^JBPEKK\R\36SL;XZ-KVD+:*TM*KLX.[G+*,P=IZ?_^J.CVDC,C*CKZB@L+
-M`JXZ\Q_G_ZI.WC[BVZ_SH\OJVJX^/F+3)X>G$XJ"8AKZ.NI;$]-;2F*Z0X^S
-M:C+"(DJKZT-CTL96-H(IH?E?AFCH!CNSVJZ:0Z_SLH8FB\>IE\_.-G;F$INO
-M#S\/H]+F!IZ+7T>'CRJ24AH+^QN3#V\CNA(2:B_?'Z,.AN;2XV^3*[(._KZ.
-MDJ(;-[GYZ;+XH`BJ!R=KGH[[/\,^IB)G*==OQF@HWD/?)Y_O,[K^ML8RGY?W
-M3UI.KGJ;0Y-/7W]KW@8^LR>GTTKRKJZNDCHCCR^K[J8F/MJ+2EI#%TFINP:6
-MAN*#NGZ.^\\3&LYN6R<G+_K.YH8F?C+C_Y\OR\+N0BMC,]/O#^\CJPM3G_\3
-MB\H*:DK"0BMC.R*NKJY2CK*W&?EGAG@XMLX&*`Z'UX<R1B9C!V]JHQ_G6^86
-MYH-?S]L+@SL.QL9"3^<GWU^?LP+NJX]O(]NC&YO+ZHN;.PH:.BNG*<?2!J;>
-M=B@69K++&L[2F^-*RD-_I\\*DNM#2I+JPQ,#*V*:"ZH">J\?OW,#C[_S(SN:
-MJH,KDKKO\\JKDS=)%VZ&,J[H."@&YMY.`ON3*Y(+#\,Z*Q/SZR+R2ML[Z[/_
-M4QHB:XNKVZ_/G]]/$],OVZI[6Z/;:SOSOX>7!YI.KD;(2!;VJ`:":RN[LW/O
-M;^,CPRO2CD(B\EK[;[]O,\.C*HHC`SO#C].OW]^/SU]_PX]'UQ=_.NIN*$AH
-MULC(!LY^#@O/C^^O+V_[TKYN;IYN"\-C+Y_?SU.OC^_C^Q-OLS-/'S\?Q]<I
-M*=<_,XJVB`B(N/B(-H;>NH^??S^/TTNN?D[^YAXB"DH#_Y^_?R>?TT./;_/3
-MCY]GU^FYF5>'=XN6Z"CXH)A(B*@&XH]OW\?GDRHZ?H8&AB8>SH(C;V^G1V<G
-MQP>G?Y\GQS<723G']^G;!L9&N-@X2`AHE@Y;"R]')W.CXU+F9F9F!N:.2@KK
-M3Z?_IP>'9\>7Z2DI>3DG=ZEJAB;&N#@("&CHMA)KJQ\'(W,S#J9>!G;F)N;N
-M(CK;#[^G9Z<G)X>IB6D96=<):1N^GO:8.#AX2`CV;N,;1^G/KV=KMN:FJ*C&
-M9F;^XGMS[V='IV>7%RD)22&YMSE73H9N*"`XN#@X:"8*F]OIZ4//MP)6'E[H
-MZ`:&1A[Z6R,/Q[?GQ^D)"7F!.9>AJ2Z&C@C@>-B8V`BV0F-;Z8F'CS>3]@9>
-MU@@V)L:&0F.;4V>79\<I"0FY@:''V;E:1I*68-@8&*#X]F[CFNE)IV]7CZAF
-M?JC(MN:VYL)S,\\'%\?':3GY^2'9R<GW@UXVN-A8(*"8"*@RC[_7:4<_9PJV
-MMD;H:/8V!CZZ8_^'M]?7*0GY.:$A"3F)O\XFUJ#86*"@.%8F0]/7Z;>?)]OV
-M1C;H"!:V1K[BLS^'MZDIJ0EYF5DAR4EI3[[F%J"@V*"@N'9^0Z^I:6<_9PJH
-MMO:(R!9VMCY:+R>W=VEIZ4D9F5E9"4G7>V8&:"!8&!C8:"::[R<I]Z?O0R;6
-M=BAHZ/8VWB[JSX<W%VEIB?E9H2$YR0D_SC:6V"!8V!@X1I*OI]?WYW\K'O:6
-MZ.BH%C9>$GIOYS=W*6F)N1FAX9G)N0=N]G9XX*!8&'A6[N_GEY>WY^O.AO9H
-MZ%:6]J;R2G/?-Y>I*6D)>5DA&0FY=XJV%KC@("`8^"A>0X>IEX?'$Q[V1B@(
-M*#9&YJZ*CZ='%^GIZ0F9H2&9R3GW8O86..#@(!@X*%Y3!Y<W!^=[7C:VJ&BH
-M1N8>DKO_)T?7:2GIR=DA(3E)N>=^%J@8X."@>,C64A_WUP<G3^(VUG8H:-9F
-M?G)*KP?W=ZEIZ2D)&2&A:0F)OP96Z!@@X%BX*':NAZFG+Z<O)J@6]JCHUIX"
-M<NJGEU=7Z0D):4FAX3FI:??:J&@XV"#@F*A&MNN7M]-#K[H&J-9&EJA&<@J*
-ML\<IZ:GI"0D)&>%9B6D7$P9H.!B@X*#(%L;"9S?_+Z_+_C:6MK86=GXBBIL?
-M=RDI*6D)B3DA(4EIZ:=NUD@8V"`@>.AVOO,_#S_3ZT)^!@8&ML:FC@+[;V=W
-MJ2GIZ>G)(>$YB0D7:T9H^)B@X%B(U@82VV^_XVJJ`E[F)N:FICZ"@W-_QQ?7
-M5U>I:=EA&0G)B=]^U@BXV.`@..C6]LY[+ZOZ>R/BOOX.KCZ>$C/3C]]WUZF7
-M%REYX=F)"0FWPC;H"'@@('B(:.C&@H.K(MMOVS(N<MJN?JYSS\__1Q?7=_<7
-M"5E9B>EI5[.>%FC(F*#8N`B(5N9BJEJK[P^;RN)*2K*.*B\__^>W5ZE7-T<I
-M^4EW1W<'FQ[6J"C(>#@(Z.BH1NZR<LHSCZ_;ZX/SVVNS#]]_7V<WQV<GIR?W
-M*9>'AP?_R[X&MA:(2`AH:.A6!LZN8OL/OV^SKW\/&UN/ST]O3U\G?[_?IQ\?
-MYT?'IY_/\[H.YC865BCH*-8VAJ8.`LHK2T/#K\\O<S./S\_//[__'U]?_[]/
-MK]O;"X/S0_NJBAJR#GZ>7F:&!H:&AN:>CO)ZZ^,SD^]OST\_OQ__G[]//[\3
-ML_.C2^LJ(B("`CIJ.HK*:HIZLI(2DHX^OGY.KFY2FJIKH[-3DZ_O;X_C+V_#
-MDZ_32RJZBDJ:.OHK:ZMJ2SOK"XI*:CJB0B*"@K*BRZMJ"JN[NHJZBUNJZ_M#
-MV^J*:ZJ+JBJKRRI+8TI;@RJJ:@LKNLKB*NOBFGHC"[N;^W.KHSL+JN+J"POZ
-M.@IZ&B):X@KK6BI+.WNK&TL;RXL*>MKZZDHKFUO[6]O#(]M+VRI*:HL*BKIB
-MXOIZ2DH:R^H*.NH+ZRN[&SO[RRNZ:HJ*^CO+6RIJ^^M+R]N[:^JKZXOJRKM*
-M>BK"BBHKNAHKRPO*Z_NKJ@J*BGHZZ^O+"UM;JTL;(YN[R\NKZ\KJ2NHK^KJZ
-M2J)ZBJNBRLLJRZJKB_OKBSLJNQO[R^OKJVKK:INJRRIKNRN*.FOJ2NI*.FHZ
-MV@H**TJK*VL[JRJ+"^O+JB-KRRLKBXO*.POKJVNJZCIJ^XL[BXO*JLI*NGHZ
-MZBI:JBIJBPMK:BNKZBOJ:VNJ&VN*.\L[>ZMK"VL+ZDMJJ^LJJ^IJ*JLKZ\HJ
-MRHJKZNNZ^CIJ:[KJZZIKJTOKJLL[BXN;ZHN+Z^NK"VLJJFJ+Z@OJ*JJZ*ZNK
-MJRJKJNLJZROJ*VJJZFJ*ZBH*BBJJ*^NK"_O+2^M+ZROK*ZLK:^OJ*NMK:BJJ
-MJBOJ:NJJ*ZJKZZNK*JKJ:FKJZJMK"XN+BVOKJZNJZFKJJBHJJNN+BVLK*ZNK
-MJJNKJ^NKJZNKJJJKJZNKJZNKJ^MKZ^NKJJJJJZNK:FHKJBJKJJJJ*BJJJZNK
-M*^OK*^MK"TO+BVN+:ZNJJJIJB@H*BFIJ:NHJZNHJJRMKBPL+B^LK*ROK*ZLK
-M*ROK*RNKJBHJ*NJ*"FHJJJJJ*JL+:ZMK:RMKZRMKZ^NKJZJJ*JJKJJLKZRLK
-MZRLK*ZKJZBHJJBNKJJHJJJNK*RLKZVOK*ZLKZ^OKJZJJJJNKJRKJZNJJJZNK
-M*ZNJJZNKJZLK:ZNJBRNKZRLK*ZNKJJHJZNHJ*BHJJBLK*ZNJJ^LKJZNK*^OK
-MJZJJJJLKJ^MKZRNKJ^LKJBKJZBKJ:FKJZFIJ*JLKJZJJJRMK:PO+"\L+BVMK
-MRVLJJBKJZNKJ:FKJ:FIJZJOK:^LK*ZNK*ZNKJJHJZNKJZNJJ*RLK*^MKBXN+
-MBVOK*ROKZRLKJRHJZFKJJJJJJBHJJJJJJNKJZFIJ*JJJ*RMJ*HN+:XMKBVOK
-M*ROKZ^OK*RLK*ZOJ:NKJ*FKJZNIJZBJJ*JJK*VMK:RNKJZHJ*JJK*ROK:XN+
-M:RLKZRNKJJJK*JHJ*BJJJZJJZNHJJJHJ*[O+*VMKRT-+$CHZNHHJ:[HJZPMK
-MZTO["Z-OFQIK`H*"2OK:"JKK"_M;.\N[6SMK>TLJJRMJ*LHJRLIJZBIJRNJ*
-M2HJKJZIJ^Y.#:UMZXIK:8J)Z"NN+>X.;JQNC2[OCZVJJJZOKB@JK2LJZZFIJ
-MJXKKJVHJJRLKZ_NJRFOJ:LNK*COKZFNJJVJ+:XJ+ZJH+ZVIKZVIKBZHJBZHJ
-M*FHJ"BL+ZBMKJBNK*XNK*SLKZFLJZJMJRHIJBNJJ*ROK*NHK*^N+:JN[BXMK
-M"^N[NWO[R\N+JZLK*JOJNCIZ.CH:>KJZ2FJ*JNNJJLI*:LKJJPL+"\L[^UN#
-M@_,S<W/S<[,#8P-[*PH:@E)NSO[^GI[^OLXNDH*:.JO[&T.OD^]/S_]?YZ>G
-MAR=?WY_/@QMJLKZ>YD9&MK;V1H;FWN[BFOMS[X\?YZ=?IQ]O+T/+RJ("+NXN
-M[E)ZFCMO;P_G9Z>'YX>_SP_KFNX.9@9&MG9VQK:&IFXN(DO#[[\GIR=G9Z<?
-M?U-;*_HNCDZ>'G[N+L*+[[_/M[=G=[=W)R<G^^H2CL:V=A8HJ':H=L9>'A*+
-M8Z^?AV?'MS<'!V?_;^.[\NX.7J:FWGZ.PLKC_[^'EP<7MS='3Z>;RN[^AG:6
-MJ*CHEM9V!B9.KFNC[W^'Q[?W=_='1R>_$Z/Z+KXFAL:&!N:^+IIKKR?'Y]<I
-M1RE'=Z<OG[(2IN96*"AH:(@6J/;FSA**[Y_GQZG7URFI=[<'/X,KHI[F9C:6
-M]D8&)DXR^D,_I[>IEZD)EZGW!X>*LXYF=E9H2,BXB$BHEK9^HN-O!W>I*8D)
-M:6DIEV=?L]I.)D:HJ*@HJ#8&IJXZV^^G!_<I">DI^7<7]Q_?OJ(&J(B(N!A(
-M^(C(EB9^2C\'Q^F)"0E)22FIEU^C*HZ&]M8H:"C6UC;>;F*#SQ\GQS=WU^G)
-MMU=)#X=_2X+V7NB(^&CX&.@(5A82"L,?URD7R4F)Z8FI)Z>38J9F1B@H5E:H
-MQAY^`B/O;]]GIQ^GI_^G-RGGQTD/_R<+CA8FB`AXB(AX-H:^CE]G9W>IZ0<W
-MM]_[,QM>/HY>9CX2[D([[[OCOP,J2SN2KB(N;O(**Z]GJ4FIZ5D')T<J9FB6
-MF'A8^(CX!NYC&]=I%^DIJ=_/,PH^'DYFWOY"NBI#3[\S?Z_JRAJN?@[.SN[B
-M2Z-3IY<)>>D)H9^;O[Z(F&B@6-C(-BC"_W=?*4DWAR<?$OZ^_J;F.LM;C^?G
-M3_]OF\(2+EXFWHX^;JK;6Q/?']_GMPEY=P<9?P;B#@@@:+CX2"A:SCK_Z>=3
-M5^<*+@NNYIX2&RO39S=GY_?/2^HN)@:&QJ8>KHN[@V]_#\^_SS]OGXEYGQ]Y
-MKY;^$@@@Z&AH:)9[RTI;*8=JIR=K'J(ZDA(:GQ^OSP?_6HJJCF8>\J[.VE/S
-MFR_?+\NO3[.C[V?)N?]'22JH!CXXH&@H5BAFLP\CHU<'JUMOZB:.LB):.G^W
-MIV\')]INXNX&9BY:`OK3/U-SGY^S(^_3X[_I^<=O::?VZ&96V$@H1D9&HD^G
-MZ\^W;QH"JRX>SLHOL\^7ES_O;_I^IB:FODY"8W/;;Z?_[X\/[^/[DY>9Z6K7
-MJ2;(=G[X>"AF_O9.HV=C`J>GF_[R"JY.<B<'$S_W9Z)"RF[FAO[B6O*[G__3
-M#R??TP,O#R^'>?D#3Q?Z",C&"#AH]B[.;F)?YQJKDW,.AC[2R@)C=]=?OP>_
-M\GYN[AZFCBM[>LL_GY-S3T^OP],GB:$I.S<'QGAHMKBXZ-ZB/NX[QW\Z.R\#
-M)K:FTH**G\?'9Q_OFZON/BXRKJY*>UN#4[^_KY-OCQ,OEQEY3_,W"XAX5JC(
-M"!8RVNY2CT<OZNL3J^:V'LO[B\\WM^_[V_LRG@[:BO+".],#V^\?_\-C+Z]S
-M)[FAU[.'_X8X"*AH:&AF@A(^,I]_>V*JD\)FYBOO[[\?9Z>C\D**TO[NBKNK
-MJP._?V_O/T_#V[,/QTGYAWL_RY:XZ-:HJ)8^FEKN6L\/^P)Z*]+>CO//4^__
-MWX]KTL+Z4KZNJSOK:Y,_O^_O3[_O+X_G:9GIPT/37LBXZ%;6J$;R*X)NRS_O
-MNJZ:6CY>^J^OK^__'V_*0JJK0BXBJVLK:Y._3V_/_S^/K[\7.;E?JD.:5OC(
-MJ!86EM[*"\*"D_^3HF)*@DZ2>Z-#KZ^3KUOB8BMKFB)J>^,;&S./;Y-S;[^/
-MCS<YF3?KFVL&2$CH%G;61BY+RK*+S[^KTD):<BXB`_]/K],/$XJ2\KKJ8L(K
-MDW-;6R_/[T/S+V^O[P<)>9=+J\O>B+B(%K9VMOZKRZ)Z\S\#(A+:J]I2&F_?
-M;UM#[\/ZTL(*R@(BFR_3FV//?V\S[S__S]^I21?;8CKN5@B(5D9&-H9"&^MZ
-M"^\O2Z(B(H*:*N/3CV_30^,[:IIZ&AK*:[NC0_-S+T]/CV_/ST^WB2EO>HKZ
-M!NB(Z';&MO:F.LMJ*H/O[\.K`JY:^UN+X^^_KUM+.]M[2B)*NXOJJ]OS+U/S
-MTP]/[Q._]^FWXQJK^N86**CV9D9V9C(KNTN;D_^/:T(BRR/+&OHC;\/K*IOS
-MKULKN[,S([M[<^\38Z.#L\,;BWNOOZ\*8JMJD@Y^)M[.WF8>[G*"XL+:*\L[
-MHX-S[R\3,^-[>SN+ZZN*ZJJ*RFO[&[.30[.OK[.#VTO[\P\3ZR//\ZOZ<CX^
-MON9&YA[>?O[^+MJ*"YN#[T\/;V^3`\-[JJJK:NHK*XM[VX/3TQ/34W/#V[O+
-MRR/O<VJ;;Z/Z&A(^#HXFAJ9^GKY./FY:JBO+PV^/#\\3@Y/#"^N+*HHK"VN[
-M(X,S4U/S\W/S<Y.#2RHK^^/+\@+CF[*NK@XN0DZF3O)R$M(N\@J+:VN[H_/S
-MXTO+FZ.;R\M+>Z-CHZ-#,[-SDT.#LS.#>[MK*HO[^ZJ*B\NZXL*N[JX.GO[.
-MS@XN+M):*LM[6P,S<T-CH]O;>TN+B\O[VR/C`S/S\[,#@X/CXQN+*ZLKNZ.[
-MJYOCZYKBK@YNSMY>GKYNCHZNPOJKRQO#<_.3$T-;6UL[N_N[N]LC6R-C@T.3
-M<T/#PV,;RZOJZHM;F^O[XPO*>O*.C@X>7IY^/H[N4H)*JXO[6X-#,S-CV]NC
-M&_N;F[M;8UMCLW/3KR]3\\/C&PMJ^MIZJLLJ*CL[JLI:4FYNSO[^/DYNTG)"
-MVHIK>Z/C(P/S@_N[^TL[&_N[HV-C`\-CPY.30T-#0P,CNRNKZ_L;RRN[2VIZ
-MLFX.SOY>WIX^CBXN$F*ZJDM[6[.OKS,#8R,CXZ,;6V/C@[,#8S,3LV-C6QM;
-M.ZHJ*JH+RZJJNTLJ.H*N;FZ^'I[^3FZN$D)ZZBJ*ZSL;@P.#@X/#L\-C8T,S
-M\W-S\W/SP^.C6YM[.PNKJJIK2XMK"^L*>H*N;@Z^?GX^O@[N[G+:2NKKRSO;
-M@P.#@\-#LS-#0[/S<Y.3,S/S\S/CVYM+RRLJJZLJJBLJBNJ*^MIB,M*NCDZ^
-MODX.;B[2PEJZ:BL+FV,SD],3TU-3$].O+R\O4_-#0X-;&WN[RXNJBLJZ>GIZ
-M6EH:VEHB8L)RKBYNCNXNKA)R0B)Z"BL[VX.S<].O+^_O[R^O4Q,3,V,CX]O[
-M2^LKJRI*.CK:(F+B(@*R,K("`H(:NOJR@MJ"VKHJ*ZKKN_N+.]L[2YM;F^.S
-M6UMC6^.C^]N;FTN["PL+"VLJJ^K*.OI:>IJ:HIJ:VDK:.DJ*NDH*^FJ*BHKJ
-MJZOK:RO+RTL[.SN;&UM;VUM;6WL[RXNKJRKJ*HIJBHJ*NIJZ2KJZ.KJZNKI*
-M"NJJJZMKBPOK*^MKBXMK*^L+2PL+B^OKZ^N+2SM+R\MKJRHJZDI*2KK*2@J*
-MZJNK*JLKJJNJ*BKK"PL+BXN+:ZNJ*FHKZVJJJFKJJ^LKZVLKJBL+"VOKB[O+
-MZZNKZZMJBDI*"NJ*ZNLK"VLKZRLKJJNKZBHKJ^KJZBJJJVHJ*RNK*XLKJXLK
-M*ZMK:^H+B^L+:\OKJBHZ:FK*JNIJZXOKZ^OK:ZN*ZBJ*BBIJZBJJJZKK*XO+
-M"XOK*ZOK:XN+:^MK*ZMJZBJ*"@IJBFKJZJNKJ^OKJPN+:\OK*ZMK"RLJJVNK
-MZFH*JXOJJNNJJZKJ*BOKJRLJJBLJJRLKJRLKZNHK*NL+:POKJJN+*ZNKZJNK
-MJRLJBHJKZJHK:ZN*JRLJJBMK*ZLKBRHJ*NHKZBKKJJLJ*BLJZRI*RJHJZFMK
-M*XM+"PM+"[O+ZRNKZJJKZRHJZHHJ*FH*:JH**BMJ:NIJZBHKZZJ+Z^OKB\MK
-MBZMJBTL+*BO+ZVLKJNKJJFJJJZH*BJJJ:NH*BBLK:NJK*^LKZPN+ZZNK:ZJK
-M*PL+ZJJKBHJKJNL["XLKJPNK:DHJB^KJ*NOJRBLKBNIJBJM+BZNJBXLJ*BN[
-MZ[KJB^N*.JLKJZJKZVJJZVLKZBI["ZKK:[NKJVKKJHL+*BL*ZFJ*ZFHJ:JL+
-M*RJK:RNK:P.?8R:>NHLZFFLJJQNCFXNK*^M+"VM[FZL*"@JJNRM*JHOKZZJK
-MZFM+BAH*JRLK:ZL*VKHJBNHK:ZKK^VOJ:DO;ZXNK*JNKBVHJZLKJZNM+J^KK
-M"[L+ZLKK>^NJN\LKJHOJ6DI*NJH*2HK+2^IJ*PN[JXM+"FOKZNO+ZDIJZLHK
-MFSO+2FI+"\LJJFMJ"GIJZJJ[*VIJ*VMK*\J*ZTOK*@OK2PN*RNN;JWH:NFI[
-M.PHZBJKK^\NK*NM["^I*2JM+JDIJZRIJBXN+:FN[^ZH:RHJC6XHJZFLJ"JKJ
-M2XM*"BJJ2BJ+*JMJ*B/;:WI*:XM[*KJ*:@JJ.TMJ*NN+RVL[*NHKNPO+^ZKB
-M\OJ+.ZHZ(CH;XRO*"SN*.R\*[G+ZJKN+>GJ+8]M+:TNKZFOK"\N+BRJ+2YO;
-M*^J*>BJZ8DKK.XNJJLJJ*JK;R^NKJ^K:6FO;JX("FNK[F^O+BRN;>PN+.PMK
-M:ULS2XIBPJ+:NEIK,P-+&FHKZ[OZFAIJ2^IZ2LO#@_MJNNN+*CO+:JJ+*IJZ
-M*HJKJCHZJ]N;6]L+:VJ*R^NZ*LHZ2HO[:ZLJJPI*:DH+:VJK"DHJ"[N[ZQL[
-M:RIJ"GJ*2EJ*Z[NK^HO;6YN[>VLK*XKK*FHJ2LIJRFKKJJJJB^LJJRJ[*HK*
-M:HN[^RJZ.FH["XO[2XMJ:LI*"KJ*JROK*NHK"SL;^XOJJHN+^AJJJFLCX_NK
-MJ^NK*DI*NCI*^CJ*:CJ:>KHKVS,SHXO*&IH*:]NC6QL[*^KJJXN+JFK*FAJ*
-MJVLK:@J*:BHJJNK**JNK*ZLKR_O;>WL["VNKZCH*"XLKBII:6OK*"BO+.[MK
-MJ^JJ*RNK*VMK:XMK:^NJJBHJZTL;HUN;RZO*&IKZ"BJK*VJ*2DJJ2QLCHQL+
-MBMJ"@F)ZBNKJBOIZ(H(B^NKJ2[L+V^,#@^,#8R-C8P/C(_OJ>@)R,L*B6KI+
-M[V<7*>D7GS)VR'AXR-8^2T_?GX_#FQL#TR^O,QOJ>OIJB]OCHTNK"KH*JJLJ
-MBCK:&FJ[\X]/3P\S"YKRKJZ20L*B>Z>IR?FY*:\&..!@(+BV"V?W1]\;DLXN
-M.@,/3^^CRN*Z@U\WES>G(^Z&ML:FLILOC^_C*PHZNFJJ*HI*2BH[XT,C^^NB
-MDBX.#OI?Z?D9>>F3-GA@@"#(IL\7J7>?VB8&IA*#G]\/VR(NTBJ/QZGIJ4<O
-MLN;VED9>LGO3[Z^CRC+NCNY"2CNS[^]3PSLJNGKZ:LM[*N+R:X=I^1EYJ>NH
-MH,#`((@N!^GI=R^^-G9FP@^'!Z?3FF[N2H^W*8EIE__BAJCH*/9^*N\?7\\;
-M`OXF7H[Z`[^?/^];2L)"HJO#[X\O8PJNKG,7R7EY:7-VV`!`8$B>)^EI%S^N
-MMA9&+N]'=T<?>W)N,GNG=ZDI%R=;+@865I;&_KHS/Q_/._*>9N:^6L.?YR?_
-M,^KBXCK[+S\_CUO"IK8F<RGY65F)XZ@@L+#@"+)W2<FI3W[6J$8R_W<7M_\J
-M#CX2(V?7*2GW?\K>-JBH=F9NR\]?W^^*OH:VALZ['[=WMY^;<DZ.FD,?9R=/
-MB\Z&=C;"-SE9H;D?-MC`L(!(/@<)R5?_;I:H1C)_URF7ITO.IK[*/S>IJ1?G
-M"QXVJ"@6ABXC'^<G#^J^9L9F#LM_1_?'_QO"CBX:6\^G'Z^*3H8V)N.I^5D9
-M:;LHH`#`H"C:-XGIQV/>=O;>Z^>7EX>OHKY.8O-GE]=WQS^+CF8VEO;&'B+S
-M?]]/V]*F!H;^*C_'=[>G`R*.#O(JDS__+^LNIIX[]\EYF6GCUE@`P""(4D>)
-M:7>/3C9V9D*/!\<G[VKR`@M/Q]?7]^>S`AZ&MD9FWJ[*VU/O\^LROEX>CAK#
-M_R<G?U.+FJ(*VU-O[T,JKHZJYVDY.8G_ACA@`&`X1H/WJ7?G&XX>3@);S\\3
-MVPK:JG,?QY<7]\<?FU(F=E;6]N:RP_^G'Y,Z#J9FWJZJKW]?WW\/4T,C&[LK
-M2MH"ND\7B4E)UZ/&2"!@H#BH#K/_7Z</,_.O+^_32R)2[O*+#X?WUQ<W9Q\O
-MBW(>1M:HUC8>^G._/R]+HM(N,HJC4V]O4_,#8S.3DY/#>ZO+CP<7J5<'.R:H
-MN'@X"*B&3I(:"UL3?^<'AR=OZR(2DCHCSZ>'!X?GGR\;^N[>9@8&YO[2.LO[
-MN^LJ2KK**LL;HP,STR]OCV^O<^/[ZVJZ^NJ;,U.O$YM*$AYF!H9F)IY.CJX"
-M>JLCT^^/;R_3TZ\O#S__/\\OPSL*(C)R,@+B6AIZFMKBPC)R<C)"@B)Z*@M;
-M,R^/#P_OKY-#HSO+*RJ*RKHZ.IH:&B*"6J(BFCH**BOK*ZOJ"KKZ>IKZ2LKJ
-M*XO+NWL;6Z-;VQL;V]O;6]O["RMJNGI:(J*B(J(:^KIJ*TN;6Z-;F_M+"PMK
-M:XL+R\N+ZZIJ"DJZZBH*B@KZFAK:FKJ*JFO+RPMK*ZJJJBN+"PN+BVLK*RLK
-MJZLKZZNK*ZNJJJNJJBIJBNJJJRMKR[O[^SL[N\MKJ^J*BNHK*RNJJBKJBHH*
-M"FH*2BIJ2LK*:NO+N[O+B^NJZNKJJROK:VOKJRN+"\O+RXNK:@K*"@J*B@J*
-MZBJK*VMK:XMKZ^OK:^LKJZJJJRMK"[M[F_M+BRNJ:HK*NOIZ>LK*^LJ*BJMK
-MB\O+:ZHJ*BHJZNKJ:NHJJ^N+NWN;FWL["VLKZHH*BHJ*BHJ*BFKJ*JJKJZLK
-MZ^OKJZLKZVN+:XMKBXO+BRNKZ^LKJZNJ*NJ*>AK*RKH*ZJHKZVMK:RNKJZJJ
-M*BJJZVN+"\O+RXL+BRNKJBJJJBJJ*NIJ"HIJZNJJJRMK:VMK"XMK:XO+2TO+
-MR\L+B^LKJRIJ"DKZFIIZ>KJJJ^JJ*FIJZNHJJBOK:XN+R[L[^SL[.[L+ZZLJ
-MZFIJBLJ*:FIJZJJKJVMK:^OK*RNKZXL+"PN+:^OKJZJJJJNK*BKJB@K*2LK*
-M"NHK:VOKZ^KJZRLKBVMK*ZNK*^LK*RLKJBHJ*BKJZNKJ:FHJJBOK:XN+BPO+
-MR\N+:^OK:XN+BPO+2TL+:RNK*NJ*"@H*"LH*:FH*RDI*2LH*:NJJJZHKRXNK
-M*ZNJJRLKZVN+BVL+"\M+RXLKJBKJ:NJJJZNKZZNJ*FIJZBHJJJJK:XL+2[O+
-MBXN+ZZLJZBKJ*BJJJRIJ"@H*B@H*BFHJJRMKB\O+RPNJ*FNKJ^NKJJLKJRLK
-M*RNKJBKJ:HJ*ZBHJ*NHJJ^LKJZJJJVN+RTO+"\O+2[N[NTL+"VLK*ZKJ:FJ*
-MRDI*2DK*"@H*BFKJZBHJ*JJK*RNKZ[M+:VNKZBHJ*JJKJZJK*VL+BVMK:VOK
-M*RLK*ZNK*RNK*NKJ:FIJZBJK*RLK*ROKZRNKJZNK*^N+"XOKZ^LKJNJ*BFHJ
-MJJHJZBHK*VMKZ^OK:HHJZJHKJZJKJNHJJBKJZFH*BFHJ*XL+"PN+"PN+BPL+
-M"VOK*ZNKJBKJ:NKJ*FJ*ZJJKZVMKZ^OKZVOKZVLKJJJK*FH*RFIJBHH*"@H*
-MBBJ+ZRO+"\L[N[M+RXMKZRNKJBKJ:FIJZJLK*^OK*ZLJ:FIJBFHJ*JHJ*BHK
-M:VN+:XN+BVMK:RNJ*BHJJROKZ^OK*^MKZRLKJNIJ:@H*:FIJ:KJ*JBHJ*ZLK
-M:VMK"\O+"PO+"VOKZVMK:RNKJBKJ*NKJ:HJ*:NJJJZNKJJJK*^OKJZLK*^LK
-MJZHJZFKJZNKJJBMK:VMK:^NKJBHJ*NIJ*BHKR^NK:RNJJBMK:VN+B^NKJBHJ
-M:@H*BFJ*ZNJJJRLK:TM+JRLKZVLK:VNJZBN+FYMJ>CJZJBIJ2AK*ZRLK"]O#
-M^RK+&QMK2FKZFIKZ>EKZ2DHZ"BOKNWM[6R.C6YL[RTN[*\H*NVM:ZLO*JJNK
-M.OHJ2HJ[.EJKZBM*2@OK*VK+^ZJJ:ZOJRNM[*@I+JRNKVCO+.BN;H\K[0ZIJ
-MRZ,K"NHZ"PK:2VJ:JBL*Z@M*2SO*ZRIKJ^O+B[LKNVOJ*[JJ6EIJFMK:2J):
-M^MJZ>HHK:_OKHYO;KZ.SK_L#`\.S"_M+ZZKJ*RH*(LKZPKH:(FKJ"JJ+:NM+
-MZYM+"\OJBIKB@G)RKJY2DK(">LH*BPO[VP/34U.O$_,S,\.#HYMCR\N;ZNMK
-MRHMJ:FHKRCK*NJ/J:G,KZX.J&THZJQ)2+LY^'OX>?L[2,O(JNR/3CS^_?Q^?
-M_T^_+P/;J_H"TA(NDD("(KHJ2KO[6\-C4S/#PR/CLY,+8V_*LYLJ>RZ*KGYN
-M7G[F)MXF'OXN[L+KNQ/O?Q^?YU]?G\]/$P-[J_IB`JXN$L(BHJKJZQN[XP,C
-MXZ.C`]-#.R\OZN_+.SNN>\[.[J9^9J:FYA[^;FZBJLNS4S\_'^=?IQ__OY/#
-M.PK:@O+NKM*2PEHKRWOC(\/#\].O+T^O`]^K,_.BTTY*$B8NAEZ&!J:&IEX.
-MCD+K2U-3?Q__9U\GWS__\[-[2MJR,BZN\G*BVNN+2P-;<]./OS^G+U]/H]^K
-M,^INBN8>9D8&=L:V!F:F3L[Z:EOO3R>GAX?G9Z??3R\3NZJ:`A(N+JX2,AK*
-M:MNC\V_OGZ?/IX<OWR]CLVX*/F8F-K86EC;VMF:>?D)J>R]O9V?G1P>'YZ>?
-M[S.;BN("4NZNTK*"&BNK>P.#+\^_9_]_-U.G3]OOCOK.AN;V]JC6UA:6-EZF
-MTJO;#_\'!\<W1T=G9Q^/TWOJ8G(NCH[NKI(:6BK;(X]/GP>'7_=GOV=CKZ*.
-M\D9&EM8HZ"@H5A9F'KYK(X\G!_=WEQ>7M\<G3Z]+^K+.3AZ>_OY2\IIK&],/
-MIR>'EV>'EW^GO[O[?DYF%E8H:,AH:"@6-DYNZC^G1W>IJ:FIUS?GIR]K^NZ^
-MIF8FYB:^KF(JPR]/7\>WM^DWQ^F?Y_\JB^8FEN@(R,AX",AH%C8NVC-G=ZGI
-M"8EI*:DWW^][,GZFAC;VQF;FCKI+,W\G9S?75RD)]U<ITY^[CB96J$BXF/CX
-MF(B(%F9R<Z>7Z4E)23D)J9?G0QI.AG:HJ*BH]B:^@@,?Y[?7J:DIB6D):>?I
-MW_*C)O8(B/A8&*`X&$@61@ZCQS>).?F9.;D)EY]3\D;VJ&B(:"B6!KYK<Z?W
-MJ2GIB>FIJ:DIU]]?ATZ^GA:(N`B8>)BX:`BV;CI;QZG7";E)"6G7I]-27K8H
-MZ.@HJ$:F[LLO)_?7J6DI5Q<WAV=WUP^S%TNF`MX6R.A(.'CX*`CH9FH:,U>I
-MJ8FY":G79U.RIL;6Z"C6%D8^6ML_AQ>IURGI=T?'IZ?WUZ=31S^^WCYV2$A(
-MN!B8B*@HQCN/OW>)B6D)"5=GOSO^ME:HZ.C6!GX2`U\']]<IJ=?WQR>/$T]W
-MJ;_OZ6?>4N(VN,A(^!A8B%8H-J/?_W<)26EI:==_.K*F5F@HUJ@VODL#/[=7
-MUW>I5P>?_^\+*M]IJ0]'"5^^[JZH>!AX>""@"+;VII_75RFY><FI]P>[9G:6
-M:$AH]F;>*Z>W]]?IZ7<'AQ^;*DHBRS>Y5Z=)2:\.$F:X6""@6&"@*.;F:Q<)
-M2;GY><D'SZ]>B(AH2`BHIDJ3_Q>)Z:DIJ<=/8PM:/CYZAWGICYD9IX**/KB8
-M@."@8&#(?N8[%[EYF3DY.6=+.B8(2,A(Z%9F^V<GE\G)*1=W!T]Z4F)N'F[/
-M.5FW:2')6]Y>B!@`0.`@8*`&FJ^W25DAF<FY*<->-NA(>'AHQB:RY]>I*0D)
-M*<<_OUN./NYNTH,)X0DI67DGGL8(>&`PP"`@(.@NCS=I>2$A28GI)\Z6:(A(
-M>,C&+J)/%^EIZ>GIEW_#VX+>'D[NNK?9.5<YF:DK'JC(V`#`X"`@.#:BWQ>)
-MF:%Y26GW$PX6:(BXN.AF[ENG]RF):>DI]Z>/N_+N[BXN^]?YJ?<)B2=R9JB(
-MF&!@6%C8",::/T>I.9FY:2EWO_+&]G;H:):F\NKS)Q>I%]>IUP<_DS,++CZN
-MZB<7)U\7EX^Z#@;V:)B8N/CXB'8>.N/?J6FI5RD7Y[/B$HZ&]H9^CI*Z+\?W
-M-Y>IEP=_KQ,[0FXNLDJ/G]./7S\;FLZF!E9H:.AH*!;&_IH;3X='1S='YQ^O
-MBXH"3LY20FH;`W_G)^?GG_^_TR-[*QH:(H*"ZQ-3PQ,3H^IROAXFQC;VMD8&
-M9CZ2^JN#[\\/C\__OS-;X]L+N^NCKW,OSS]/[Q.O;]L[&PM*&B)BBIJZNR,+
-MJPNJ2D+N#FZ^IJ8>?IX>OI*BXB+K>Z.S0X\_CR^OKV_/[R\/[X,S+_-;"^N[
-M"POJJRHJ^AIZ>AH:>GIJBDJ:.J*"PD(R\E+N[NX.;FYNDD(ZJP/3C^\/?W^/
-M_T]O[_,36W-;6\L+JHK*"BH*R@JJ:DJ"LK)",L+:.HHK:FJK:\OK*CKB$E)2
-MKHYN$N)Z*LL#T],O[\\/#].ODW/CH]N["RIK*^MJ*VHJZDI*^IH:8C)"@B)B
-M>KJKBPM+VYM+JRH*&H("PD("`OJZ:ZL;VX-#(S-;(WO[(WN[:[L[N\M[6YO[
-MB^L+*DK:FEJ"@N+:&DHZ*RO[&WL[Z[MKBAHZFMJBFDI*^HHK^\O+BWN;RVOK
-M"ZJ+BTN[2XM[>YL[>PO+Z^JJJFJ:6IKZ2FIJJZJJ*\O+BZLJBFJZ&CIZ"FKJ
-MJNN+N[LC^WN[N[N+:ZHK:NH*BFH*ZBK+BXNJRXNJJZKJJLI*2HJJ*XN+BVO+
-M:VMJJSJJBLHZ"FJKJFN+R\L+^[L[^\MK:ZLK:@K*BLIJ*JHJ*HMKBRLJJDH*
-MRHK*BBJKBPO+^TM+:VLKZXMJRBIJ.KK*ZNJKJVOK:VN+"PMK*ZKJZJJK*BHK
-M:^LK"\M+2PLKZ@J*B@K*BFKJJZNK:VMK*RNK*ZIJ"@KJ:JKJ*JLK:PL+B^LK
-M*ROK*ZLJRJI+BPL+:^NJZHK*NDK*BFJJJ^N+"TM+R\O+RPOK*ZKJBLI*2@IJ
-MZNIJ:FJJ*^MKBVMKZVN+:^OK*RNKJJJKJJJJJJHJ*FJ*ZBJJJZJK:[N;2TL[
-M"^OKJZIJBHH*NCI*BFIJZJLKZXL+B^NK*FIJ:BJK*RMK"[N[N[L+ZZHJ*BKJ
-MJJJJJBJJJNIJJNMK*ZLJ*NIJZJJKJZNK*ROKZ^MK*VHK:ZNJ*NKJ*JJJJJHK
-MZXN+BXMKJZJJJFIJ"HKJJVM+2\L+:RNKJ^H*RLJ*:NHJ*JLKJZLKJJMK:RLK
-M*^MKBVN+"XMKZ^LKJBJ*"HJ*BHJK:^IJZFHJJVN+BPN+ZZNKJZJJ*NKJ*NHJ
-MJBHJ*BHK:PN+BXMK:^LKZVLKJJHJ:HJ*ZJMKBPL+BZOJ:HIJZFKJJ^MKB\L+
-M:RNKJBIJ:FKJJNK*JFLK:RLKZZNK*ZLKJZNK*RNJJBJJJJJJJZNK*ROK:ZNJ
-M*BHJ*JHJJJLJ*JJK*RNKJJJKJBJJJBOKZ^OK:XN+B\O+BROKJRNKJBKJ:HJ*
-MZJH*RFKJJJJKJBHJZNHJ*JJKJFJJ*^O[.]L;^_L+*RIK*ZHKZVO+`],B+MIK
-M@HY2[EJ:[S]+"TN*.HHC2RMKFR.JBOL["LJ[^\IKJNNJ:JL+:DJ+2VH*:VN*
-M"BH**II*B^O*Z[NKZPOKNFHJJOLJ:_LKJ\LK.BIZ:ZOKJ\LK:\LKJ^IKJPMK
-MBRLZNN)J:IJ*ZB+*^QJ+:R-SHR/;KZJ[^PL+BJMZ^G(*^EKB^NK:BDHK:FJ#
-M&VL[.VMKRSN+*JO+JRI+.\N[6R/;FZ.C2PN[:^K*^MJR$A+N#NYN3NY2<@*:
-M"LO[VS-ST^\/+R^/KQ,OL\.SF[O[ZOHJ(X]+X^>3XR\3ZD)B;C[&9@:6%D;&
-M-N:^DN)+#Y_GQW>7]_?W9Q_/@[KN3EYF!F9F9IZNFNM3SW_GIZ>GG\^OT]]?
-MRL]G*ML3^\(.CC[&%F;V*)8V]K8F3I(2H[\/)_>7EU?7E[=GYR\KNE*FYH9&
-MQ@8F?LX":R,O_Z?G)R>G?T\3`TN3CWIC/XJJVZOZ4C)2IH:FQI:VMK:VYD[.
-M+FO#\W]GQS>75W>W]X<_;]MZ4DY^YH8F)B8^+G+Z2P/3;_^?_S]/K[.#BXK:
-M6N,++F\S6F_;TXOJXV(.S@[&A@9&1K;>IM[2"NHC/]_GA[>W1\>')S]/P[MZ
-M0BZ^/IY^?L[N,GJ*NYLS$Y.O4_/SX[O[ZNH*NO/;PD_S:D^;CSOK,T+NCCX&
-MYH9FAL9^)GY2PIK+$X_?)\?'!\?GIZ?_K^/KZB*N+@X.;M(R8GI**JO+R^OK
-MJ^OKBZK+>^M+B^N[LPM[W[-3#R\/RS,+$BZ.GH9F!@:VAB9F_JZ"FGLO3_^G
-M!X='1\<')Z=/T^,+`A*.WGY>'IZ^KC*B:DO[`Z_O[V\OD].;:^JB(EHJLIKO
-MZUOS(Y,J`\MBHB*N_KX>/EX>/AZ.[I(":J,3CQ\GIP=G)Z?_OW.#.SH"@I+N
-M;@YR,F(:&OKJ2LI+JTO;@S-;(\/[2_MZ^FMJ.O/;HV]##_L#,QJ:PJ[>WJ8F
-M9@:F9I[.+J)JXQ//GV?G)P?G9R??_U,#2_H"\BX.#HXN+C+BHCH*ZPO+^TM[
-M2\L+V[N+^^HK.\,CRV]36U.S,XOKBX*2KLXFIB;F)J;.#JZ:BJK[,U,/?R>G
-M7R<GWS^/0[NJVO+N[HZ.4K+:HDHJ:NNKRVNK&WL;XYN;8\L**\H*6P,+PS\C
-MPZ^C&VJKFE).OAX&)N:&II[.#G(*.\/OG]^G9P>'9P<G?[]3VPJB[G[>7AZF
-M'KYN<N+JNR/#DZ^3DP.C<X-KNYN[*RJK:P,#:^_/2P-O@R**2VY^OAX&MF:&
-M!F:>KM)ZX^_/GP='A\<W1Z>GI^^;Z\HN/CZ>IB;>OLYN,LH[NWL#D\/C$Z^S
-M8UO;XQL*>@O+:OJ+@X-;FW-3&ZN*ZEHNSKX^GMX>_L[N4N)*BQO#KV_/3\_/
-M#V\OKQ-S\P.CNVLJ2II:XK*2TE+2$I+R@MIZ2NIKNYNC`[,S,\.#@P.;:^NJ
-M*JJJJHJZ.OHZNCHZ.CIZ^CKZNHKJJBMKZ\O+"TO+RXLK*^N+"VL+"VLJBLI*
-M"@H*R@J**BOK:PO+2[N[NSO[^[L+:RNK*ZLK*^LKBFHJ"DH*"FIJBHJ*"LJ*
-M:FJ*"FKJJBOKBXL+RPO+"PLK*JJJ*ROK:^LKZVMKB^LJB@K*2DI*:JMKBXO+
-MRTN[2TN[NPN+:ZLJZBKJBHJ*"@HJRCI*NCK*ZBMKB\M+R\O+B^LKZRNKZVN+
-M:ZNJJRLKJRNKJZJJ*NIJBFJ*"@K*BFHJ*JJKZVMK:XL+R\L+:^LK*^LKZRNK
-MJZIJBFIJ*NIJ:LKJ:ZNK*^MK:VMK:VMKZ^MKZRNJ*HJ*BNHJ*JJKZVOKZ^LK
-M*ZKJ*JKJZNHJJJLKZRNKJRMK:^NK*RLK*RLKZVMKZVOK*RIJ:FKJ:FIJ*JKK
-MRVNK:^OKZRLK*ZHJ*BKJZBJJJBJJJJHJ*JJKJZHJ*NIJBHIJ*JOKBPO+R\M+
-M2TL+BVN+:RNJZNIJ:FIJZFIJBNJJJJLKZVOK*ZLJZFIJ:FK**FNKZVMK"XL+
-M2\L+BVLKJZHJZHJ*:@I*2@J**JHKZROK:VMKBPL+"VOK*RLKZ^OK*ZNKJBIJ
-M:NHJJBKJJJJJZFJ*:BJJ*^OKBXN+:VOK:\NKZJLJ*BKJZFKJ*NHJJJNJJ^OK
-M:^OK:XN+:^OKJZNJJJNKJZHJ*FKJZBJJJZJJJBOKZ^LKJZLK:VMKZ^OKZ^OK
-M*ZNKJRKJZBHJZBJJJZLJ"HJJ:NJJ*VN+"PO+"PN+*ZLJ*JHJ:HJ*:NHJJBOK
-MZ^LKJJJKJZNJ*BKJ*JKK"\L+"^OK*RNKJJJKJRNKJBHJ*FKJZFHJJJNKJZNK
-MJRHJ*BL+JJIKBXL+:^OKZRNJJJJJ*JJKJBHJ*BHJ*JJJ*NHJJZLKZVMKBXMK
-M:XMKB^LKJZJJJZLKJZHJJJNK*FH*R@H*"HKJ*JJKZVMKZ^MK"TL["RHKBROK
-M:^NK*JLKJZKJZNIJRDJ**JKJ:NKJ*BJJJJNK*VN+BXMKBTM[(W,#NMH*.HI*
-MNCH:6B):^HJK"[L+2UOC+R\C(\-[*@K:KBXNKK+BHCIKX[-3T_,S6^LB(MHB
-MLI(BFDIZ>HJ[0[/3D_-3TU-C"RK**OK2DGIK*@IK2QLKVGKZZAH"6DI;&PNC
-M6UN*^LI**IIZ&KK+ZDI*JTL*:NI+,\,CV[-#*GHB^OJB&DK[X_,#*XN+N@+"
-MXGJKZCHKN^NK.UO+"\NZ>BHKVKICPWO[6PL*"OKZJBI*RP-[:JH*&IHBPII+
-M.^K[KW.+.JJKRGKB.JJJ:TO;FZL**LO*&NH+:XHJ2]NC.^NJ:ZM:HFIJRJJ;
-M>VOKBLKJZLIJFSOZ.BIK*JJ[FYN[:LIJNK*RBB.#&R.OK\NR[I)"<@*J\V\O
-M@TO+.^IRPBH*^FIKBSM[NCJ[2WHZ&WL**WL;NXIBHFLKVFHC`WNK^AJ*.O(B
-M^P,;6\/C2TIBHHIJ&@K;@_NK"_NKFD+BN@J*"\/S&ZM*RJJZ0MK+RXKKHX.C
-MNXNK:OJBNFHZRLL;.^NKBWMKHAJ[H^NZ"BKJ.II*RQM[V^.;:EHZ:CK:.NMK
-MB\N[NXN[2VNKBHH*RCJ:BJJ*ZOMCF^LKJJMKZOHK&VKB"OL+NBJ;FTLJ.FHK
-M2@+B:WNKNFM#6[HZFZ.JJPL+:ZK*2FOKRJH[.ZL*RCH*.F(ZR[NKZ_L[ZPK*
-MZ@L+*JN[2RHJ:XN+:ZMK:PJZBFL+JXM;VZKZ^CH:VGJZZYN[B_L;RZK*6DI+
-M:XI+@UMK:KJZ.MH:Z^/[JKM;.RHZ^NHK"JI[^XN+"VOKZ[J::JJ*2NJJZBHJ
-MJ^I:PJ*:>OKJ>UO[RXOKZRKJB_L;6T/S([LK"PMZKA)*:MHZ._.?=W=_ST\*
-M9G;VEG:&?MHS#X\/OUNB@G*.SO)J0_^GAP=/>TMZGN8^CNZ:"X/OSQ-S3Q,*
-MJ]NK8N(:HDHZKJ[ZK^FAR:-_]W[8V(A(2);N?]?7AT?WHP9&)D96!KJ?M_<7
-M*2GGZG+N)K9F$F/?EXE7WZ_RELA("(BV+N-GEW>'YQ\*;I(";N[+\[-S`\NB
-MSO\!`4Y:H1>@`#8HX/@VNP>W)X=)1\;&0J:X"`[+4W\W";GIWP]/TG:6)M[>
-MBE\W%REI=ZL&%HB8F(A&3AL'J2F7Y[\3>D[NXO)R>S_/$P_C<GYNJ8$IEBDA
-MCF"(JAB`Z&ZN3N]'%RDOZY\O!H@FXN9^4S?W-U<7MS\JLNX>1F;2.IOGZ2E?
-MC]/^:$AHB`CV$L-/AQ?7-R?_/T.";@)*8OH[H^,[BA)2_WDYD@_9Y[C(XQ:`
-M.#[&"%X'GS_'%Q=G3PIB(N8&OF(RFE^''^<WMP]C&^(.?DZ"\]/RNY\Z9CXJ
-MYJC^8IX>6[^[<V>'SX_GO[O[XTM:&GJ"HA(.4NX.LVGWVO<YWX:+Q_9X!@[(
-MF";*]N9_-X\?Z:FG'X=_(C+BCJ8FCJ[2&CN/C^\_7U__OZ.KRS*>?FY>!DXR
-MSD[*(^IKSY^O$U\_FQO38]KZ^XHBRJNZHNHJ6EH*BH+:BSLC@V.S\Z.KJJKB
-M$C*R[F[B>AIJ^WMKNV,;JBO+JXJKB^L+HWN+&UM+RYL;NPL[2^LJ*NJ*2DH*
-M:DH**NK*:HNK^II*2CK*"KI**NJ**@L+B[L;>[N;XUM[&]N;2PN+JPJZ^IHB
-MHIJ:FLJJ*^L+2TL+J^JZ.@K*BJNK:_L;VQN;>TN+J^IJ*BJJJJKJBDK*:@JZ
-MRNKJ:JIKBVL+2TL+"VOKJRHJ*@K*BBJJ*\N[.YL;VWN+*DK:XF+B6IKZZ@M+
-M^Z/C>_O+JLKZ.@H*"JIKRPL+BPL+BXNKZNHK:PN+Z^NJ"DK*2CJZB@K*:NN+
-MZPN[.[M+BZLJJRKJBHJ*:JLK"TL+^SL+*^LKZ@K*2LH*BFKJJZNJ"@JKJRN+
-M:VOKZ^MKBVNK*JHK:PN+:XMK*^IJB@K*NDH*BFKJJZLKZZNKJBOKBTM+2TN[
-M2VLK*HH*RKHZ2NKKZZOKBVMK:XN+ZROKJZJJZBHK*FHJ"DI*RFJK:\N[^_M[
-M2VNJ:DI*NOHZ"BHKRSO[.[M+"^NJZNKJ:NHJZBJJ*XO+B^NKJBKJ:FKJ:HIJ
-MZJHK*ZHJJJHJJZJJJRLKJZOK*^KJBVL+N\M+RPN+BVMK:^OKJ^JJJBIJBLJZ
-MRHJ*:NHK"\M+"XOKJZOKJVJJJBHJZFJ*ZFIJ*BJJJJMK:^O+N\L+2TOKJJKJ
-MBBKJ:@IJZ@J*BZLJZVLK*JOK*RMKJZMKZZJJ*^H*J@LKVX]Z#FHB[KH+HBM#
-M>QO#6[O;FVN[NZJJZGK:RKHZ:FKJBVOKJ^NJZPN*JFNJNCJJ.GKJ2ZNKNRL:
-MVA*NQ\D^GF?.)B\WGF[#SE(+BU)[HX+O_](NHXZ>"TH.4P<*6J>+LN]+CBKB
-MKBOJ^PKO)Z-O$QO2.KI>4C(N#MIJ2EOO@R^/DZ,[J^+:RJ)*0CJ:2DMK(RM+
-MXRK;ZNJJBNLZ*AK*"CH+BZL+"[O+:TN[FRO+:VHZNBI*:FMJZNM+ZJIKJFJ+
-M:BJKRBHJ*GHK*DJJRROJRQN;J[I+"VN+JRL[*XI+NPJK>ZL*BXOZFGHBHIH:
-MRNI*:WO##^NK0RHBZ@NNFKM:^OMKRLMCBSM;&WL+*PIJRLKJRDK*NFN+ZVO[
-M6\LKBXLKRJJKNIH**ZNJZFJ*"HI*:NL*^NM+"@I;6ZJJ(R.KZUNCZCI+.Z*"
-M:DOJXBH;JR+JPPOBZJ.J8NH+BLN[:BL[*^K[VZMK^XOJ*BKJZBKZ.JJ*.FHK
-MRCIKJMIJBVH*BHKKNZLK8]L*.W-[:B,SNMI[.T(BXVORNIN*,JO;RFJ+ZRNK
-MBJ*[`RK[KY-K2Z\[XGHJ^M(R`C("@EJJ&_OK@],;BWN;&A+:BIK:*WM+J^H+
-M>ZJZNW,;J@,O*_*[<SI"&Q/ZXEM[2B(*"YKNKDHK2BIS_X_S+].[2GHR;HY.
-M_NY"0J+[<ULCTY-;2]L;ZXIJJPHZJLM[.WMC`R/CXSNJBGHBVKI:KJ[:HI*"
-M._L"&B,SR^N#$W,[.GOORZ[KGWM.VO,:WE(#8[M3_U_?DVO+RXYF/NZF9HZB
-MLEKK(Z]3`W-O\ZOKFZIBVFL+NQO;,[.;>S,3R^M[B_KR;@YNCKXN@@+BJWL;
-M$P^OKT_/6[OC2SHZZGK:RHK:\J*#+S-OOX\#Z\IR+L[>'CZ.CA(J:\M;0_,#
-MPZ/;&XMKBXNJBCN;^]NCXYL+JRHJJ\L[^VLJJ@H:\A+NCN[NPDJ*RHH#TX.S
-M;X]#@V,;&SOJ2JOJ,M)Z8Y,OOT\_[\L"[@XF9B:F_@Y""MNO+V\/CQ.;BRLZ
-MLC(:2BH+^P/S,S/S,R.;ZXJJ^_L+2ZJZ8A*.O@[.#J[BRJK[8Y./#V^/#_,[
-M^PLZ8F*2TMK[[P_/_]_/F\K";A[F9B:>OHYBRR-C4^]ODYN["ZNZ6KHKBPO;
-M,Y,S@P-#XSNKRLIZ(F(:ZXNJJLL+2CHZ.EH2+NY20C("&NN;P^\//S_/[Z^O
-M8RKZ(L*NKN)K6]OC<R_S^^IZ6JZ^_KZ.#@Z2>JM+X_,O[Q.3,X.;"RMJ:LHZ
-M"JL+:RMKR_O[N\L+"VNKJBHJJRHJ:GJB@F)B8H(B^FKK2YM;XV,C6Z,CFSM+
-M"^KZ.IH:^LHJZXN+:ZNK.YN;HZ.;BVHZ>GIZ&OHZ^KKJ*RLJBLKZ^CKZN@HJ
-MJJL+.QNC8[,SHYM[^[O+2RKJ:DH*2CKZ2@H*R@KJZJHKZVOKZRNKZNKJ"LJZ
-M.KH**VLK"[M+BXMKBRNJJZOK:VOK:RLKZPN[.[N[NTOKJZJK:HKJ"CHZ2LH*
-MZJHJ*BHJZJHJ:NIJRHJ**NJJJ^MK*^L+^WM[.[L[2[N[N[N[NXMJFOHZFOKZ
-MN@IJ*PM+RVOKJRIJ"@J**BKJZJKKZVN+2\N+"PL+BRLK*BKJ*BKJ*NKJJBLK
-M*XL+:^NJJFIJZJHK*ZNJ*VOKJBHJ:HJ*"FIJZBOK:JHKJBN+BXO+2[L[2TM+
-M"^NJB@J*R@IJ:FJJJZNJJNMK*ZNJ:@H*:BLK*ZNK*ZNKZXN+ZRLK*ZJJJBMK
-M*RNKJZNJJBJKJBJJJJNJJ^N+BRO+NPMK*ZJJ*BIJBBJJ*HH*:NJJJROK*ZJJ
-MJFM+RPJZNJJ["SLJ*@I*:FJJJDN[.TL+ZXOKJZJJ"@J*ZBOKZRNKJJJJZHIJ
-MBBKJ"FJJ*VL[^XO+RXN+*RNK:^NJ*LH*"@IJ:JJJJJNKJJHJ*JMKZXMKJRMK
-M*RMK*ZJK:VOK*NJK*ZLJ*JHK:VNKJBIJBHJJZXL+BVMKJJHJ*JNK*ZOJZHJ*
-M"PO+2XLKJ^JJ*ZLJ:FJ*BHKJJJLKBZLJ*BHK:XMKZZNJJBMK"XOKZ^NKJZLK
-MJZNKJRLKJRHJJJIJ"HHJ*BJKJRKJ*JJK*^LKBPL+"VN+2TLKZXLKZ^N*NMH:
-MFOKKFVJZNRMJBPMCHPO;VZJ+JOKK.CKKFCJJNKKJJVLKRRL+"XOJ2BIJ*PH[
-M.]J#Z@I;.DMK*BIKZPI;HAM;(@.Z>KM*LB,J4N_R>M.N`]OR[V*JKP[OXTX_
-MJG[''FHGAC_K_C_N^O/N(YO.#^K.7V[JOZ9_ROX'C@+?;OH/WN\C/C]"RF\.
-M:K]^:T^.:QO*N\*O*J[ORXYOJLXGCBL/OF.+XN,B8]HK&S)[BR+;*]K#"]H[
-MZT*OBE+O2U)3B@*[&A/"4N>F6W,^?Q++4X+J\[J2([MR:V\N&M-Z6H,;+A-[
-M#L\K#G\BKG_20C,:HK-KPG,JZQN"(Z.^D^_FDV^^>[OC[FMO#ON[FBL;,L/C
-MCD^+K@\BHT*S:S)C:FJ+`NHC<NK+8PZJ7WX2=V9:)Z+^7TJNL_HO#M-S+EL;
-MPAN"XPK"LP+B3XX"OQ*:$QK:[ZYJ9V9SWZ9_6J)?AG-/9N\*BUHK@QIBKVHJ
-MBWI;2^(3@CI3#N,:$D,J8J_R>J>.*V]R>UM*RINZ&T)S*[XG@@Z'YD//)H,3
-M/BHOHM)[+P*N+_-^;X(32[Y_XR9/`YX/HH(/XHX'?NZW'L(G[H(?KJ)O[@I_
-M)N._IGLO4OKSZF*O^OH#DE/*$@^+KNMOVDY_>B)#,C/ZTM.C_OLG7D('TGX_
-M8PYKBU-*[D,/\E*/KV8[YQZ.Y[H^SSH;DIN#RG(Z![::=W;;I[[KDY+C3X:?
-M^Z;O#R8*YT(2>Z,J<EI?+JY/ZHY#RN)OOK,?AF,G)FH_LN+/CO-;KH,#\JI3
-M[GMO/KHG9BM?GDH?9D^OAB_?QEM?9@^+@H.;SH\+OJ=R3N<BOJ=B(@_R>A\F
-M"U_F8P]NBY^F>H=&\__VYVOFI[O>[_\&IW/&-_*F-^Y>MPZ^)RX2IXZNAQXJ
-M;ZX[:^K;FOH3Z[Z?:QX_2RZORRYCN[*+LS)#BP*S^Y*JFX+KJWI*(WJ[.HHC
-M"CK+KXZKGT)B0^LJ*XHJ\\)BWRYN?VJ^;VLN4ZJ"C^(NGYN&/S,F?_+"[X+B
-MPRHR;]+KCSY#DRZC,^[S(R)J$]*[[TY38_YO^TZC0Y[S.Q[OZW);6V(;&^YO
-M:KZG^LZG\H(_DL(/NI+?;JIOK@OO8HO+.BO[XNX?$@X/*A(36NY?@N[_8DIO
-M[DOOLKHK+U)KV[(O^N[O:JY/.N[/"P[3*@*K\V+;:[K;J_NN<Z-.OQO>WRL.
-M0_NN2VJKZBZ/\B)O$FJ_?EM?9H,/;OLKFI-R2U,*:C-JFL].:B^"KK,K6GIK
-M2_*SJ@*O^C*_&BX?`HZ?\G(3K@NO7G_;7J>:;@>.ZB>F+T_F_TJ.7VZB+\Z[
-MRVZ#0FNKFGN+VKN;"G.:^[/:\VNNW[YZGV8CNSZ/>JY3XLI;ZLHCRCMK6TOB
-M4RL:0^(*DX+*P]K[`QJ;F@N+@GM:PM/*8CNBJHKZR[(Z^[K;^GK/2W*?@I*G
-M\CKS4B,CXDM[J^H#ZF(JVVK"VZLRLXORBPH",]IB,ZN::UORBUNZJJJJ8VNZ
-M^TN+BR,+&AN;*J)*N[H*JXI*2PK+BM+;FUI;"AKS*KN;XKL[JBM*NDL+Z@H*
-M*\M*ZXJJ6ZJ[2DK;.HM*(LO*2VJZ&^HC.XJ[NAO[^JKK*@O+*RK*JZKZNHK+
-MBBHK:JN+*NHKZ^L+*BI+J@N+ZCLKBDO*ZNL*BRH*BRJJ"XNKZJOKJFHJJFO+
-M"XMKJJNJ:BL+ZBIJRHJZRHJK"^LKJZHK:[O+2_O+ZZJKJ^JK*FHJBFJ*2HJJ
-MBJHKJDN[:VNKBPOJJJNJBVNK*@H*ZFJ*BNHKZPN+*^LKJBLJ*JLJJXN+JNJJ
-MJRIJ*JJKBPMK2TN+BVMK*VIJRDH*BLJZ"LJ**ROKBRL+R^MK:^L+"XLK*NKJ
-M*VO+"XOKJFH*BBHK*ZJJ*^IJ:HIJZNHJ*JKKBRNKZHKK2XN+B^NJBFJKZTM+
-M:ZNJJBHJB@JJJBOKJZN+RXLJ"FIJ*BOK:PL+*XI*RBHK*^OK:PMKJZKK:\M+
-M:RLJ"LH*BJOKZ^NJJNJ*"HKJ*FN+B^N*JNLK:XM+RVNK:FHJJFL+:RLKZHIJ
-MZJKK:RLJZFIJZJJKJBKJ*BNK:XN+"VLK:NHK:\L+*RJ*2HHJ*\M+2XOJ:BJJ
-MJZLJ:FIJ:FHJ*RLJJJH**LL+"\MKZZLJ*VMK*RJ*BNJKZXMK*ZHJZJJJ*ROJ
-MBHJ**BMK"XOK*ZNKZVL+RPLKJZJJ*RLKZZHJ:@H*BNHJJZLJ*NKJ*JOKZ^OK
-MZPOK*FL+*^LKJRMK:VLKZHH*:JJJJ^MKZZNJ*JLKJVMK:VOKZRNKJBHJ:NHJ
-M*NHJ*BHJJJNK*^MK:^OK:^MK:^LKJJLKJJLKJRNKJ^MKZZKJZJMKZNJJJBHJ
-MJNKJ*JJJJJJJJZHJJZOKZ^MK:^LK*ZNJJJOK:XN+:VMK:^LK*RNKJBHJ*BHJ
-M*BKJZNIJZBKJJBOKZZNKJJJJJZNJ*JOKZVL+*RIK:ZLK*ZNKJRLKJZOKZVOK
-MZ^LKJZKJBFIJZBHJ*BHJ*JHK*VN+:^OKJZHJJJJJJRLKJRNKJJJK:PN+:^LK
-MJJKJ:@H*BJKK*^N+BVOKJRIKBRJJJBHJ*NKJ:JHKJZNKJBJJZBHK:XN+Z^OK
-MZZJK*RLK*ZJJ*FKJJJLK*^LKJ^LKJZLKJZKJZBJKJJJKJRMKZZNK*ZNJ*NKJ
-MJJHJJZHK:RJ*JJIJ*JNK*RLK:^MKBVMKBXMK:^LKJFJ*BHIJZNKJ*JJJJZJK
-MZ^OK:^LKZ^OKJZJJ*NKJ*BKJZBN+:^MK:^OKB^OKBVNKJBHJ*BIJ:FJ*Z^OJ
-MJBNKJZNJ*JHKZ^MK*ZNJ*BJJJ^OKZ^OKZRNKJZLKJZJKJZNJJBKJZBHJBFJJ
-MJRLKJRMKBXN+:RLK*RNK*^OK*ZNK*NHJZNHJ*JJJJ^OJ"JNJJBLKJZIK:VOK
-MZVOK*RLKJFIJBHIJ*BKJ*JOKBPO+BVMKZRNJ*JOKZZNKJNKJ*BJJ*ZHJ*BJK
-MJRJJJRJJJBIJZJHKZ^OKZVN+B^NKJHMKJFMKJZNK*BJJJZNKJRKJZNKJ*BLK
-MZXOK*ZKJZNJ*BFKJJNOKZ^MK:VOKZVOKZ^LKJZLJ:FHJ*BJJ*^LKZ^MKZZLJ
-M*JHJ:FJ*BBHK*PO+ZZN+ZZNK*ZNJ*JJJ*BJJJBHJJBLK:ZNJJBMKZRLK*ZNK
-MZVOKJZNK*BJKJZJJJZNJJJJKJZJJ:FKJ*JJKJRNKJJOK*ZLKJZLK*RLK*ZLK
-M*RL+:VJJJJJJ*ROKZ^LK*^LKJZNK*RNK*FKJZBJJJBJJ*BHJZBJJ*BHJJNKJ
-MJBOKZRLK:PL+RPN+ZRNK*ZKJBNHJ*BHJJBHJJJNJ*JJK:XL+BRKJZZOJ*NKJ
-M:BHJJJLKZVN+"XMKZVOK*RHJ:@K*:JKK:RNKJRJJJRN+R\OK*RNJZNKJJJNJ
-MZFKJ*BJJJROK*ZHJ*NKJJZNKJZLKZXL+BROKRROJJZKJ*NIJBFHJ*BJJ*^MK
-MBVOKJROK:VOK*ZKJZNKJ*JJKJZHJ*JJJJRLK*^OKZ^OKJZNK*RLK*ZHJ:HJ*
-MBHHJJRLKJZLKZVLKZVMK"PNJ*XMKZVLK*BKJZFJ*:HJ*BFHJJROKZRNK*RLK
-M:XMKZ^OKJZIJ:BJJJ^MKZ^MKZ^OKZROK:VLKZHIJ:HJ*ZNKJZNHJJROK:XL+
-M"\L+BXLK*POKZBIJ"HIJB@H*BNJJJRLK*ZNKJRMK:VMKRTO+BXN+ZZLJZBKJ
-M:NKJ:FHJJBJKJZJKJZHJJJHK:VOK*ZJJ*^OK:XMK*ZNK*NKJ*BKJZBHJRFKK
-MZ^N+BPO+"VLK*ZHJZNIJ:NKJJJNK*RNJ*JLKJZLK*ZLKZRLK*RNK*ZNJJRHJ
-M*FKJ*JJJZ^OKBPN+:^NKJJJJJJNJJJL+2VN*HH+:R@M[BVKJJ^N+NTO+"XLK
-M:PN+ZRIJ:FKJ:NIJ:JKKBXO+BXN+BRLJZBJJJFIJZJJK*RNKJJKJ:NKJ:FIJ
-M*BMKZ^OKBPO+"VLK*BHK*VMKBVLKJ@KJZRHJJBHJJ^NK*RNKJRLK*ZHJ*JHK
-M*ZHJZHJ*BFJKBXOKJZNK:VL+"PN+JZHJZJHKZ^LKJRKJ:FIJZBIJ:NJK:XN+
-M:RNJJBHJZ^OKJXJJRVOK"POKZZMJBFHJ*JNK*NHJJJNKJZJKZRLK*RNKJRKJ
-M:NHJJZNJJJJKZVN+"\M+R\MK*^LKJZIJ"HIJZBJJJNIJBHHJJRNKZVOK:VL+
-M2TLK*VLJ*BNKJBIJ"LI*2@KJJJJJ*FIJZBN+N_M[^TMKZROK*^OK*^OK:XMK
-M*RIJ2KI*RHJ*RLI*2DH*ZNKJZNJJB\O[&WO[NTM+"PN+:RNKZXNJBJHJ:FIJ
-MBHKJ*NHJZNJJJZOKZZNKJZJJJJLK*RNJ*BJK:VMKZZNK*NKJ*JOKZZIJZJJK
-M*ROKZ^MK"\M+2PMKJ^K*2@IJ*NHJJZHKZXMK*BNJRNJKZZNKZXMK*RLKZVNK
-MJBIJZJHK*^NK*JJJ*BHK*^NJZFJ*ZJJK*VL+BVMKZ^MK:^NJJBKJ*BHJZFJ*
-M:BHJJJNK*JOK*^OK*RNKZJO+ZVO+ZZJJJJJK*^OKJZHJZBJJ*RLKJZNKJ^MK
-MBXOKJFJ*"@J*BNKJZNJJ*ZOK:VMKZVL+RTM+2\L+:RNKZ@H*2DJZ"NJJ*NJJ
-MJROK:XMKZRHKBZLKZRLK*ZNJ*JLKZ^LK*ZNJ*NJJ*JKKZRLKZZNJZFIJZBJJ
-MJ^OK*RNK*RNKJZNKJBHJ*JNKJZJK*ZNJJBHJJJLK*RLK:^LKZZNKJRHKBZNJ
-MZZHJ*ZNK*^OKZ^LK*ZHJJBLKJZNK*NKJZNHJJBJJJZLK*VL+"TN[RXOK*^LK
-MJBJ*"FJ*"HKJ*BJKJ^OK:VOKJZJJ*JJJZHH**JLKZZJ**\N+"\N+BXN+BVMK
-M*ZJJJBHJ*NKJZFKJB@IJZBJJJJJK*RLKZROK:VN+:RNKJRLKZVOK*ZNJ*BKJ
-M*BHJZBJK*ROKZ^LKJRNKJBHJJRNKBPLK*^LK*NKJZNKJ*FKJ*JJK*^MK:^MK
-MBVOKZ^LKJZNJJZLJ*JJKJRJJJJLKJZHJZNJJ*ZLK*^N+:ZNJJZNJJZNKJZNJ
-MJJHJZBJJJ^N+BXLK:BHJBBJJJRNKJZJJ*^N+:^OKZZNJ*JOK:VNKJJHJ*BJJ
-MJJJJ*NKJ*BJJJJHJJNLK*RNKJZLKZVN+BVOK*ZHJJJOKZRNJZBJJ*BKJZBJJ
-M*NL+*NJJZBJJ*JHKZ^OK:ROKZXL+B^NK*NJJ*RNKJNHJ:@K*RLJ*ZBJK:PN[
-M^WM[^[N+ZZLJZNHJJJHJ*BHJZNIJBNHJJJLKJZHJJNKJJJJK*HJJJRHK:VL+
-M2[N[.SO+"^LKJZNK:LJZ.DJZ2HKJZBHJ*BJJ*^MK2TN[NTO+BRLK*ZLJZNIJ
-M:BHJ*BHJ*BHJZFHJJBLKZVL+B^OKZZJKJJO+2RLK*^KJZBKJ*BKJ:NKJZJHJ
-M*JHKZ^N+:VOKZXN+RPO+RVOKJRKJ:NIJBHIJ:FIJZJLKJRLK*^LKJZJK*ROK
-MZVMK:VLKJRHJZFIJZBJJJVI*JBOKR\M+N\N+Z^LKJRHJ*NIJBHHJJBHJ*BIJ
-MZJHKZ^LK*ZHJJJOKZ^LK*^LKJBKJJJNJJZLKZRLK*ZNJ*RMKBXMKZRNJ*BKJ
-M*BIJBHIJ*^LJJRNJJBOKBXOK*ZHJJJKKBVNKJJJJJJNJ*RNJ*NJ*:JLKZRNK
-M*BJJZXN+:XMK:PN+:XMKZROKJNKJZNHJJNJ*BHIJ*BKJ*JJJJJOK:^OJ"JOK
-M:TL[N[O+BVOK*RNKJNJ*"FHJ*BIJ*BHJ*BKJ*NKJZNJJ*^LKZ^OK*ROKB\N[
-MNXN+ZZLK*ZLJZNIJ:FHJ*FH*RLK*2HJKZVMKZROKB_N;R\N+*ZHKJRIJ:FKJ
-M*NHJJZNKJJHJ*BJJJJOK*ZLKJ^MKZVOKJNKJJ^MK:^LK*ZNJ*ZLK*RNJ*XN+
-M"XLKJFH*"FJ*"FIJBNKJJROKZVO+*ZH+"XO+RVNKJJJJJRNKJJKJ:NIJ:NKJ
-M*BHJJBL+R\N+ZZNJJJOK*RLJJJKJZHIJJBLK*ZNJ*^OKZRNJ*FIJZJJKZVOK
-MJNHJJNMKZZNK*BK+NVL+BRNK*HIJZBKJBFKJ:FHJ*^LK*JLK"\M+RPMKJFIJ
-MBNKJ*NHJJ^MK*^OKJZLKJZNKJZNKJNHJJRLKJNHJZNIJ:NKJ:FHJZXL[^WL[
-M2RN*JJNJZRNK*FJ*BNJJZRNJZHH*BNJK*FJ*ZJOKBPO+"^NKJZOK:PO+BZLJ
-MZFKJJ^NKJJIJBNIJ*JJKJZLKZRLKZVOK*ZLK*RHJ*FIJJZOKBVMKBXLKZ^LJ
-MB@KJ:HHJZNJJ*XMKZRMKBPO+R\N+*RHJZFIJJJLJ:HH*ZJJKZ^OK:RNK*JJJ
-M*JHJJJHJJJOK:VN+R\MKZRNJ*JLK*ZLKZROJBBIJ:BKJ:HJJ*RLKJZNKJZJK
-M*ZLK*ROKJ^HJZNJJ*ROK"XOK*ZKJ*JNKJNKJ*BHJZXO+RXN+BVLK*RNKJRIJ
-M:FKJZJKJ*BHJZFHJJJJJJXOKJXMKB^OK*ZNKJRLK*^NKJ^LKZROKJZNJJJOK
-M*RNJZNJ*"FHJJNKJJBOKJJNKJRLKJZHKBXMK"PN+Z^OKZ^NJJZNJZHH*R@H*
-M:JMK:VMKZNIKJZOKB\N[2\N+:ROJB@K*"LH*BHIJ*BLK*ROK"TN+BXL+ZRNK
-MJ@I*2KI*BBJK*VL+2\O+RXMK*ZNK*BJJJBIJ:FHJ*JMK:RNKJJLKZVN[BZJJ
-M:LJ*ZBJJJZLJJBJJJ^L+:^LKJRLK:VN+:RNK*JJJ*JHK*ZIJZJJJJZNK*RLK
-M:^OKZZOJ:LH*:NJJJJNJJRNK*^MK:VOK:XO+"PL+Z\JZRLH*:NJK*ZNKJJHK
-MJRIJ*JJK*VL+RXMKJZJJZ^OK:VLKJNJJ*FJ*"@H*:FJJZPL+BXLKJRMK*^OK
-MZZLK*^N+*ZJK*NKJZBJK*^J*"@HJBRNK:VOK*ZNJJROKZ^NKJBOK:^LKJZIJ
-M"@J*:JJKJZJKJJJK*ROK:VMKZXO+R\L+*ZIJRDH*BNJJJZLJJJNKJBHJ*JJK
-M*ZLKJZLJ:BHKBVNK"TOKZVMKBVLK*NKJ*JJKJRNKZRNKJZHJ:HH*"NJJZRNJ
-M*BHJJJMKBVMK:VMKBPN+BXOKJJJJ*BJJZNH*RLH*ZJOK:VOK*VMKBPMK*RKJ
-MJFNJZJNJ*NH*"HKJ*^MKBPMK*ROKZROKZRNJ:HH*BBJK*RLKJBLK*RLK*^N+
-M"XOKJJNKJJLKJZLKJNH*R@IJJBN+"\L+:RNK*RLKJZNJZBKJRFJK*JIKZROK
-MZ^MKJ^KJJJJKZXO+BVLKJBJ*:NKJ*JHJ*BIJZHJJZRMK:XMKZ^MKBPO+"XOK
-MJNH*RFIJ:NKJZBJJJJLKJJNJJ^OK:XOKZPN[*XJ*:BHKJZNK*NKJ*JOK:RNJ
-MZFHJ*BJKZPN+BVOKJZNKJRNJJBJKZ^OKJJKK:RNJZNKJ:FJ*ZJJJJJNJJJJK
-M*RLKJROK:\M+2TL+*RIJROK**FHJJJJK:VMKZ^LKJZNK*^MKZZNJ*FH*"@J*
-MBFJJJJJJJJN+R[O+BPL+"XOK:VLKJVJ*:@K*B@H*"NJKZ^MK:XN+:^LKZVOK
-M*RHJ*BIKRRNJJVIJ:FHJ*JHJZNHJJ^MKBXN+:RNJJJOKBPN+*ZNJJJNKJ^H*
-M2DH*BFKJ*JJKZVMK"PO+2TM+B^NK*NIJBHH*"BJJJZHJ*JHK:PL+:ZL**BNK
-M:^OK:RNJ*BHJJJHJZNKJZBHKBVLK*BJK*^MKBVOK*RMK*ZLJ:BJJ*NIJ:FIJ
-M:JLK*^OKBXN+"XMKBXN+:^NK*FJ*:FKJ*RNKJBKJ*NLJJNLK*RNJJ^OK*RLK
-MZFKJZBHKJZNKJJJKZPN+BROJZFHJ*JJK*^NJJ^N+2PN+JRJJ*JJKZRLJZFKJ
-M*JHJJNNK*ZLJJFNK*JMJZNKJZXNJ*HN[RPN[2\OKJXJZ"OJ**NJJ*VKJ\V,^
-M,L_K:+AW"5^_#F+'J1OF2,C?F>GJH]>NR.BHI\X>0M=W#AHK:3<OP@IF_M[&
-MIA9>*O_7J9=/>VH#?X;V]C8NVRY;WSKO-S='#J;:4R]#>@ZO_L+B+OJ2D[L*
-MYC:CJ4D7B^:FSNLK+I9HABN/-U?GTW.;XZI"IG9N2ML#AX?:\UM*"KH/^W+2
-M7HX+"A+.C\?G;YJ^YB:RJVN?XV-;[Z>[;H9>"B\;;E(*\_\'8^)Z(HNZ"P*2
-M+CI#L^\#Z^Z"+P^#GHXK&RJB^FO;JL/G>S)2.NL^GJ:"LY,/?Q_/^C(B>O+N
-M"ELJDT]O8UK*HNNJ&KON'HYSAZ\[,CNJKJK2&JH+\QN[>HK[FVI"`D):FX_;
-MVLO;BCM#V_LZXJZNNZ_3>D*CHW-S&G(ZLPOR"AIB0@*#+Y-3$QK2DD)RVNK:
-MJW-/+SM*BYL"[@XB"HK#LYM:^W-3+ZO2(NL;&TJ:>KN#&^MZ>FO*BKMJ(J(;
-M&]JBZHO[JTJ:JHO*ZN(*(\.[:]O;V]LZZUO[JOK*XA+2:X.;^_LKJZM*XDIS
-M,]K::DL+"AH::XIJZP,CJ]HZ,^/JZKKK:AI"+N)JFSOC$]O#`RO*"COZRKK:
-M(J++JZI+PV/[^\NKJZH*(NMKV@IJRB+:*YL["RNZB@IKNQOJRHOKP^.+BKJ+
-MBVNK^LKJ*ZHZ2@MJ.LO+"LM+B^L+6RL*"OIJZ^HZBR-;2_K:^J*BFHHKNP,S
-M(ZN+ZOH:>BL[:RJK.WN+ZGJ:^FO;NPNJ:OO[>\JZ&LJ[2EH:*VLJN_N+"@KK
-MJZIKJRMKZPMK*ZLKJLJJJBJ+RYOKJRKJ:@JZ.NM[ZCKKRSN[NZIJJVN+:@K*
-MRF(.+@*:*@M[6^-C@X-CXZ/;F_N[RXOKJRKJ:HH*"LK*2DI*RLK*R@H*BHIJ
-MZBHJJJJKJRLKZ^OKZ^OK:^MKZ^LKZRLK*RLK*ZLKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-MJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-GJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK
-`
-end
diff --git a/share/man/man1/Makefile b/share/man/man1/Makefile
index f1ed384cd840..6084116648e2 100644
--- a/share/man/man1/Makefile
+++ b/share/man/man1/Makefile
@@ -1,7 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
-# $Id: Makefile,v 1.6 1998/12/20 06:27:00 bde Exp $
+# $Id: Makefile,v 1.3 1997/03/07 03:27:49 jmg Exp $
MAN1= cd.1 intro.1 wait.1
MLINKS= intro.1 introduction.1
.include <bsd.prog.mk>
+
diff --git a/share/man/man1/intro.1 b/share/man/man1/intro.1
index 93a5b086aaac..cbb1fdb745dc 100644
--- a/share/man/man1/intro.1
+++ b/share/man/man1/intro.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)intro.1 8.2 (Berkeley) 12/30/93
-.\" $Id: intro.1,v 1.11 1998/12/19 09:33:03 dillon Exp $
+.\" $Id: intro.1,v 1.9 1997/04/22 05:52:54 jmg Exp $
.\"
.Dd December 30, 1993
.Dt INTRO 1
@@ -61,7 +61,6 @@ completion of the command.
.Sh SEE ALSO
.Xr apropos 1 ,
.Xr man 1 ,
-.Xr security 1 ,
.Xr intro 2 ,
.Xr intro 3 ,
.Xr intro 4 ,
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 28ffe9e810c3..888dfcbfa25e 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -1,15 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 6/18/93
-MAN4= bpf.4 bridge.4 ccd.4 cd.4 ch.4 da.4 ddb.4 divert.4 drum.4 \
- dummynet.4 fd.4 fpa.4 \
- icmp.4 ifmib.4 iic.4 iicbb.4 iicbus.4 iicsmb.4 \
- imm.4 inet.4 intro.4 ip.4 ipfirewall.4 \
- lkm.4 lo.4 lpbb.4 natm.4 netintro.4 \
- null.4 od.4 pass.4 plip.4 ppbus.4 ppi.4 ppp.4 pt.4 pty.4 \
- route.4 sa.4 scsi.4 \
- sd.4 sl.4 smb.4 smbus.4 smp.4 snp.4 sppp.4 ssc.4 st.4 su.4 tcp.4 \
+MAN4= bpf.4 ccd.4 cd.4 ch.4 da.4 ddb.4 divert.4 drum.4 fd.4 fpa.4 \
+ icmp.4 ifmib.4 inet.4 intro.4 ip.4 ipfirewall.4 \
+ lkm.4 lo.4 natm.4 netintro.4 \
+ null.4 od.4 pass.4 ppi.4 ppp.4 pt.4 pty.4 route.4 sa.4 \
+ scsi.4 sd.4 sl.4 smp.4 snp.4 sppp.4 ssc.4 st.4 su.4 tcp.4 \
ttcp.4 termios.4 tty.4 tun.4 udp.4 uk.4 update.4 unix.4 vinum.4 vn.4 \
- vpo.4 worm.4 wst.4 xpt.4 yp.4 zero.4
+ worm.4 wst.4 xpt.4 yp.4 zero.4
MLINKS+=fd.4 stderr.4 fd.4 stdin.4 fd.4 stdout.4
MLINKS+=netintro.4 networking.4
diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4
index 22b4aeb5586c..c70ec943ebc2 100644
--- a/share/man/man4/bpf.4
+++ b/share/man/man4/bpf.4
@@ -20,7 +20,7 @@
.\" This document is derived in part from the enet man page (enet.4)
.\" distributed with 4.3BSD Unix.
.\"
-.\" $Id: bpf.4,v 1.15 1998/11/03 22:01:21 des Exp $
+.\" $Id: bpf.4,v 1.12 1998/03/12 07:30:16 charnier Exp $
.\"
.Dd January 16, 1996
.Dt BPF 4
@@ -170,7 +170,7 @@ and resets the statistics that are returned by BIOCGSTATS.
.It Dv BIOCGETIF
.Pq Li "struct ifreq"
Returns the name of the hardware interface that the file is listening on.
-The name is returned in the ifr_name field of
+The name is returned in the if_name field of
the
.Li ifreq
structure.
@@ -180,7 +180,7 @@ All other fields are undefined.
Sets the hardware interface associate with the file. This
command must be performed before any packets can be read.
The device is indicated by name using the
-.Li ifr_name
+.Li if_name
field of the
.Li ifreq
structure.
diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4
deleted file mode 100644
index 5482c0e1f00e..000000000000
--- a/share/man/man4/bridge.4
+++ /dev/null
@@ -1,65 +0,0 @@
-.\"
-.\" $Id$
-.\"
-.Dd Sep 28, 1998
-.Dt BRIDGE 4
-.Os
-.Sh NAME
-.Nm bridge
-.Nd Bridging support
-.Sh DESCRIPTION
-Starting from version 2.2.8, FreeBSD supports bridging on ethernet-type
-interfaces. This is achieved using the following option
-.Bd -literal
- options BRIDGE
-.Ed
-
-in the kernel config file, and is controlled by two
-.Nm sysctl
-variables:
-.Bd -literal
- net.link.ether.bridge
-.Ed
-
-Set to 1 to enable bridging, set to 0 to disable it
-.Bd -literal
- net.link.ether.bridge_ipfw
-.Ed
-
-Set to 1 to enable
-.Nm ipfw
-filtering on bridged packets. Note that
-.Nm ipfw
-rules only apply
-to IP packets. Non-IP packets are subject to the default
-.Nm ipfw
-rule (number 65535) which must be an
-.Ar allow
-rule if we want ARP and other non-IP packets to flow through the
-bridge.
-
-
-.Sh BUGS
-.Pp
-Care must be taken not to construct loops in the bridge topology.
-The kernel supports only a primitive form of loop detection, by disabling
-some interfaces when a loop is detected. No support for a daemon running the
-spanning tree algorithm is currently provided.
-.Pp
-With bridging active, interfaces are in promiscuous mode,
-thus causing some load on the system to receive and filter
-out undesired traffic.
-.Pp
-Extended functionality to enable bridging selectively on clusters
-of interfaces is still in the works.
-.Pp
-Not all interface support bridging -- at the moment it works for
-``ed'', ``de'', ``ep'', ``fxp'', ``lnc'' interfaces.
-.Sh SEE ALSO
-.Xr ip 4 ,
-.Xr ipfw 8 ,
-.Xr sysctl 8 .
-.Sh HISTORY
-.Nm
-bridging has been introduced in FreeBSD 2.2.8
-by Luigi Rizzo <luigi@iet.unipi.it>.
diff --git a/share/man/man4/dummynet.4 b/share/man/man4/dummynet.4
deleted file mode 100644
index caefdefe035e..000000000000
--- a/share/man/man4/dummynet.4
+++ /dev/null
@@ -1,182 +0,0 @@
-.\"
-.\" $Id$
-.\"
-.Dd Sep 28, 1998
-.Dt DUMMYNET 4
-.Os
-.Sh NAME
-.Nm dummynet
-.Nd Flexible bandwidth manager and delay emulator
-.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/queue.h>
-.Fd #include <netinet/in.h>
-.Fd #include <netinet/ip_fw.h>
-.Ft int
-.Fn setsockopt raw_socket IPPROTO_IP "ipfw option" "struct ipfw" size
-.Sh DESCRIPTION
-dummynet is a system facility that permits the control of traffic
-going through the various network interfaces, by applying bandwidth
-and queue size limitations, and simulating delays and losses.
-.Pp
-In its current implementation,
-packet selection is done with the
-.Nm ipfw
-program, by means of
-.Nm ``pipe''
-rules.
-A dummynet
-.Nm pipe
-is characterized by a bandwidth, delay, queue size, and loss
-rate, which can be configured with the
-.Nm ipfw
-program. Pipes are
-numbered from 1 to 65534, and packets can be passed through multiple
-pipes depending on the ipfw configuration.
-.Pp
-Dummynet operates at the ip level, but if bridging extensions are
-enabled, it is possible to pass bridged packets through pipes as well.
-.Sh USAGE
-Packets are sent to a pipe using the command
-.Bd -literal
- ipfw add pipe NNN ....
-.Ed
-
-and pipes are configured as follows:
-.Bd -literal
- ipfw pipe NNN config bw B delay D queue Q plr P
-.Ed
-
-where the bandwidth B can be expressed in bit/s, Kbit/s, Mbit/s,
-Bytes/s, KBytes/s, MBytes/s , delay in milliseconds, queue size in
-packets or Bytes, plr is the fraction of packets randomly dropped.
-.Pp
-Getting ipfw to work right is not very intuitive, especially when
-the system is acting as a router or a bridge.
-.Pp
-When acting as a router, the same ruleset is applied on both the
-input and the output path for routed packets, so you have to make
-sure that a packet does not go through the same pipe twice (unless
-this is what you really want).
-.Pp
-When acting as a bridge, the
-.Nm ipfw
-filter is invoked only once, in the input path,
-for bridged packets.
-.Pp
-Also, when simulating true full-duplex channels, be sure to pass
-traffic through two different pipes, depending on the direction.
-E.g. a suitable rule set for simulating an asymmetric bidirectional
-link would be the following:
-.Bd -literal
- ipfw add pipe 1 ip from A to B out
- ipfw add pipe 2 ip from B to A in
- ipfw pipe 1 config bw 1Mbit/s delay 80ms
- ipfw pipe 2 config bw 128Kbit/s delay 300ms
-.Ed
-
-.Pp
-.Sh OPERATION
-The
-.Nm ipfw
-code is used to select packets that must be subject to
-bandwidth/queue/delay/losses, and returns the identifier of
-the ``pipe'' describing such limitations.
-.Pp
-Selected packets are first queued in a bounded size queue, from which
-they are extracted at the programmed rate and passed to a second queue
-where delay is simulated. At the output from the second queue packets
-are reinjected into the protocol stack at the same point they came
-from (i.e. ip_input(), ip_output(), bdg_forward() ).
-Depending on the setting of the sysctl variable
- sys.net.inet.ipfw.one_pass
-Packets coming from a pipe can be either forwarded to their
-destination, or passed again through the
-.Nm ipfw
-rules, starting from the one after the matching rule.
-.Pp
-.Nm dummynet
-performs its task once per timer tick. The granularity of operation is
-thus controlled by the kernel option
-.Bd -literal
- options HZ
-.Ed
-
-whose default value (100) means a granularity of 10ms.
-For an accurate simulation of high data rates it might be necessary to
-reduce the timer granularity to 1ms or less. Consider, however,
-that some interfaces using programmed I/O may require a considerable
-time to output packets. So, reducing the granularity too much might
-actually cause ticks to be missed thus reducing the accuracy of
-operation.
-
-.Sh KERNEL OPTIONS
-The following options in the kernel configuration file are related
-to
-.Nm dummynet
-operation:
-.Bd -literal
- IPFIREWALL - enable ipfirewall (required for dummynet).
- IPFIREWALL_VERBOSE - enable firewall output.
- IPFIREWALL_VERBOSE_LIMIT - limit firewall output.
- DUMMYNET - enable dummynet operation.
- NMBCLUSTER - set the amount of network packet buffers
- HZ - sets the timer granularity
-.Ed
-.Pp
-Generally, the following options are required:
-.Bd -literal
- options IPFIREWALL
- options DUMMYNET
-.Ed
-
-additionally, one may want to increase the number
-of mbuf clusters (used to store network packets) according to the
-sum of the bandwidth-delay products and queue sizes of all configured
-pipes.
-
-
-.Sh SYSCTL VARIABLES
-.Pp
-.Bd -literal
- net.inet.ip.fw.one_pass
-.Ed
-
-is set to 1 if we want packets to pass through the firewall code only
-once.
-.Bd -literal
- net.link.ether.bridge_ipfw
-.Ed
-
-is set if we want bridged packets to pass through the firewall code.
-
-.Sh COMMANDS
-The following socket options are used to manage pipes:
-.Pp
-IP_DUMMYNET_CONFIGURE updates a pipe configuration (or creates a
-new one.
-.Pp
-IP_DUMMYNET_DEL deletes all pipes having the matching rule number.
-.Pp
-IP_DUMMYNET_GET returns the pipes matching the number.
-.Pp
-IP_FW_FLUSH flushes the pipes matching the number.
-.Pp
-When the kernel security level is greater than 2, only IP_DUMMYNET_GET
-is allowed.
-.Sh SEE ALSO
-.Xr setsockopt 2 ,
-.Xr ip 4 ,
-.Xr ipfw 8 ,
-.Xr sysctl 8 .
-.Sh BUGS
-This manpage is not illustrating all the possible ways to use
-dummynet.
-.Sh HISTORY
-.Nm
-dummynet
-was initially implemented as a testing tool for TCP congestion control
-by Luigi Rizzo <luigi@iet.unipi.it>, as described on ACM Computer
-Communication Review, Jan.97 issue. Later it has been then modified
-to work at the ip and bridging level, and integrated with the IPFW
-packet filter.
diff --git a/share/man/man4/iic.4 b/share/man/man4/iic.4
deleted file mode 100644
index 9e18d9abe64d..000000000000
--- a/share/man/man4/iic.4
+++ /dev/null
@@ -1,63 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd October 25, 1998
-.Dt IIC 4
-.Os FreeBSD
-.Sh NAME
-.Nm iic
-.Nd
-I2C generic i/o device driver
-.Sh SYNOPSIS
-.Cd "device iic0 at iicbus?"
-.Sh DESCRIPTION
-The
-.Em iic
-character device driver provides generic i/o to any
-.Xr iicbus 4
-instance. In order to control I2C devices, use /dev/iic? with the
-following ioctls:
-.Pp
-.Bl -column "Ioctls" -compact
-.It Em Ioctl Ta Em Description
-.It Sy I2CSTART Ta "send start condition to the specified device (with 7-bit address) on the bus"
-.It Sy I2CSTOP Ta "send stop condition to the bus"
-.It Sy I2CRSTCARD Ta "reset the bus"
-.El
-.Pp
-You may also use read/write routines, then I2C start/stop handshake is
-managed by the iicbus system.
-.Pp
-.Sh SEE ALSO
-.Xr iicbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/iicbb.4 b/share/man/man4/iicbb.4
deleted file mode 100644
index cbe5fb466d45..000000000000
--- a/share/man/man4/iicbb.4
+++ /dev/null
@@ -1,59 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd October 25, 1998
-.Dt IICBB 4
-.Os FreeBSD
-.Sh NAME
-.Nm iicbb
-.Nd
-I2C generic bit-banging driver
-.Sh SYNOPSIS
-.Cd "controller iicbb0"
-.Pp
-.Cd "device lpbb at ppbus?"
-.Pp
-For one or more iicbus busses:
-.Cd "controller iicbus0"
-.Sh DESCRIPTION
-The
-.Em iicbb
-driver provides support to any bit-banging interface for the
-.Xr iicbus 4
-system.
-.Pp
-.Sh SEE ALSO
-.Xr iicbus 4 ,
-.Xr lpbb 4 ,
-.Xr ppbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/iicbus.4 b/share/man/man4/iicbus.4
deleted file mode 100644
index f45943a488d1..000000000000
--- a/share/man/man4/iicbus.4
+++ /dev/null
@@ -1,108 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd August 6, 1998
-.Dt IICBUS 4
-.Os FreeBSD
-.Sh NAME
-.Nm iicbus
-.Nd
-I2C bus system
-.Sh SYNOPSIS
-.Cd "controller iicbus0"
-.Cd "controller iicbb0"
-.Pp
-.Cd "device iic0 at iicbus?"
-.Cd "device ic0 at iicbus?"
-.Cd "device iicsmb0 at iicbus?"
-.Sh DESCRIPTION
-The
-.Em iicbus
-system provides a uniform, modular and architecture-independent
-system for the implementation of drivers to control various I2C devices
-and to utilize different I2C controllers.
-.Sh I2C
-I2C is an acronym for Inter Integrated Circuit bus. The I2C bus was developed
-in the early 1980's by Philips semiconductors. It's purpose was to provide an
-easy way to connect a CPU to peripheral chips in a TV-set.
-.Pp
-The BUS physically consists of 2 active wires and a ground connection.
-The active wires, SDA and SCL, are both bidirectional. Where SDA is the
-Serial DAta line and SCL is the Serial CLock line.
-
-Every component hooked up to the bus has its own unique address whether it
-is a CPU, LCD driver, memory, or complex function chip. Each of these chips
-can act as a receiver and/or transmitter depending on it's functionality.
-Obviously an LCD driver is only a receiver, while a memory or I/O chip can
-both be transmitter and receiver. Furthermore there may be one or
-more BUS MASTER's.
-
-The BUS MASTER is the chip issuing the commands on the BUS. In the I2C protocol
-specification it is stated that the IC that initiates a data transfer on the
-bus is considered the BUS MASTER. At that time all the others are regarded to
-as the BUS SLAVEs. As mentioned before, the IC bus is a Multi-MASTER BUS.
-This means that more than one IC capable of initiating data transfer can be
-connected to it.
-.Sh DEVICES
-Some I2C device drivers are available:
-.Pp
-.Bl -column "Device drivers" -compact
-.It Em Devices Ta Em Description
-.It Sy iic Ta "general i/o operation"
-.It Sy ic Ta "network IP interface"
-.It Sy iicsmb Ta "I2C to SMB software bridge"
-.El
-.Sh INTERFACES
-The I2C protocol may be implemented by hardware or software. Software
-interfaces rely on very simple hardware, usually two lines
-twiddled by 2 registers. Hardware interfaces are more intelligent and receive
-8-bit characters they write to the bus according to the I2C protocol.
-
-I2C interfaces may act on the bus as slave devices, allowing spontaneous
-bidirectional communications, thanks to the mutli-master capabilities of the
-I2C protocol.
-
-Some I2C interfaces are available:
-.Pp
-.Bl -column "Interface drivers" -compact
-.It Em Interface Ta Em Description
-.It Sy pcf Ta "Philips PCF8584 master/slave interface"
-.It Sy iicbb Ta "generic bit-banging master-only driver"
-.It Sy lpbb Ta "parallel port specific bit-banging interface"
-.It Sy bktr Ta "Brooktree848 video chipset, hardware and software master-only interface"
-.El
-.Sh SEE ALSO
-.Xr pcf 4 ,
-.Xr iicbb 4 ,
-.Xr lpbb 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/iicsmb.4 b/share/man/man4/iicsmb.4
deleted file mode 100644
index 0a1b92bb506c..000000000000
--- a/share/man/man4/iicsmb.4
+++ /dev/null
@@ -1,57 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd August 10, 1998
-.Dt IICSMB 4
-.Os FreeBSD
-.Sh NAME
-.Nm iicsmb
-.Nd
-I2C to SMB bridge
-.Sh SYNOPSIS
-.Cd "device iicsmb0 at iicbus?"
-.Pp
-For one or more smbus busses:
-.Cd "controller smbus0"
-.Sh DESCRIPTION
-The
-.Em iicsmb
-driver supports SMB commands over
-.Xr iicbus 4
-for the
-.Xr smbus 4
-system.
-.Pp
-.Sh SEE ALSO
-.Xr smbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/imm.4 b/share/man/man4/imm.4
deleted file mode 100644
index cbc307068677..000000000000
--- a/share/man/man4/imm.4
+++ /dev/null
@@ -1,59 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd October 27, 1998
-.Dt IMM 4
-.Os FreeBSD
-.Sh NAME
-.Nm imm
-.Nd
-Parallel to SCSI interface driver
-.Sh SYNOPSIS
-.Cd "controller vpo at ppbus?"
-.Pp
-For one or more SCSI busses:
-.Cd "controller scbus0 at vpo0"
-.Sh DESCRIPTION
-The imm driver is an extension of the
-.Xr vpo 4
-driver for the Iomega Matchmaker Parallel to SCSI interface. This driver
-is mostly written with the
-.Xr microseq 9
-mechanism.
-.Sh SEE ALSO
-.Xr ppbus 4 ,
-.Xr vpo 4 ,
-.Xr microseq 9 ,
-.Xr scsi 4 ,
-.Xr sd 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/intro.4 b/share/man/man4/intro.4
index e89d3c0b9676..cc44936ef1c3 100644
--- a/share/man/man4/intro.4
+++ b/share/man/man4/intro.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: intro.4,v 1.10 1998/03/12 07:30:17 charnier Exp $
+.\" $Id: intro.4,v 1.9 1997/09/29 10:10:14 wosch Exp $
.\"
.Dd January 20, 1996
.Dt INTRO 4
@@ -112,9 +112,9 @@ implement a buffered device. For the latter group of devices, the
differentiation is conventionally done by prepending the latter
.Ql r
to the path name of the device node, for example
-.Pa /dev/rda0
+.Pa /dev/rsd0
denotes the raw device for the first SCSI disk, while
-.Pa /dev/da0
+.Pa /dev/sd0
is the corresponding device node for the buffered device.
.Pp
Unbuffered devices should be used for all actions that are not related
diff --git a/share/man/man4/lpbb.4 b/share/man/man4/lpbb.4
deleted file mode 100644
index 14033d962097..000000000000
--- a/share/man/man4/lpbb.4
+++ /dev/null
@@ -1,79 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd October 25, 1998
-.Dt LPBB 4
-.Os FreeBSD
-.Sh NAME
-.Nm lpbb
-.Nd
-Parallel port I2C bit-banging interface
-.Sh SYNOPSIS
-.Cd "controller iicbus"
-.Cd "controller iicbb0"
-.Pp
-.Cd "device lpbb0 at ppbus?"
-.Cd "device iic0 at iicbus?"
-.Sh DESCRIPTION
-The
-.Em lpbb
-driver supports the Philips official I2C parallel bit-banging interface.
-.Pp
-
- LS05 pin 14 (Vcc) o -------
- | | |
- +--+--+---------------------+--+--+------------+------+-o 1 |
- | | | | | | ===.1uF | +5V |
- -------- [R][R][R] 3x10K 3x10K [R][R][R] LS05 | | |
- | | | | | | | | pin 7 o-+------+-o 2 |
- | 12 o-+--+ | | 3|\\ 4 | | | (Gnd) | GND |
- | 17 o-+-----|--|----| >o-------------+--|--|--------------+ | |
- | | | | |/ 8 /|9 | | 10 /|11 +----+-o 3 |
- | 15 o-+-----+--|--------------o< |------+--|------o< |----+ | SCL |
- | | | 1|\\ 2 \\| | \\| | |
- | 9 o-+--------|----| >o-------------------+--------------+----+-o 4 |
- | | | |/ 6 /|5 | | SDA |
- | 11 o-+--------+----------------------------------o< |----+ -------
- | 10 o-+-+ \\| 4-pin
- | 13 o-+-+--oGND Connector
- | 25 o-+-+ ------------------ Part List --------------------------
- -------- | 1 - .1 uF capacitor | 6 - 10K 5% resistors |
- 25-pin male D | 1 - 4-pin connector | 1 - 25-pin male D connector |
- connector to PC | 1 - 74LS05 open collector hex inverter |
- printer port -------------------------------------------------------
-.Pp
-.Sh SEE ALSO
-.Xr iicbus 4 ,
-.Xr iicbb 4 ,
-.Xr ppbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile
index 054976add2b7..3950e7624fd8 100644
--- a/share/man/man4/man4.i386/Makefile
+++ b/share/man/man4/man4.i386/Makefile
@@ -1,25 +1,23 @@
-# $Id: Makefile,v 1.94 1999/01/09 18:12:06 wpaul Exp $
+# $Id: Makefile,v 1.80 1998/08/19 01:54:13 jkoshy Exp $
-MAN4= adv.4 adw.4 aha.4 ahb.4 ahc.4 aic.4 apm.4 ar.4 asc.4 ax.4 \
- bktr.4 bt.4 cs.4 cx.4 cy.4 de.4 \
- dgb.4 dpt.4 ed.4 el.4 en.4 ep.4 ex.4 fdc.4 fe.4 fxp.4 gsc.4 ie.4 \
- io.4 joy.4 keyboard.4 labpc.4 le.4 lnc.4 lp.4 lpt.4 matcd.4 mcd.4 \
- mem.4 meteor.4 mouse.4 mse.4 mtio.4 mx.4 ncr.4 npx.4 \
- pcf.4 pcm.4 pcvt.4 perfmon.4 pn.4 pnp.4 ppc.4 psm.4 \
- rdp.4 rl.4 sb.4 scd.4 screen.4 si.4 sio.4 \
- spkr.4 sr.4 sysmouse.4 tl.4 tw.4 tx.4 vr.4 vx.4 \
- wb.4 wd.4 wfd.4 wl.4 wt.4 xl.4 ze.4 zp.4
+MAN4= aha.4 ahb.4 ahc.4 aic.4 alog.4 apm.4 ar.4 asc.4 bktr.4 bt.4 \
+ cs.4 cx.4 cy.4 de.4 \
+ dgb.4 ed.4 eg.4 el.4 en.4 ep.4 ex.4 fdc.4 fe.4 fxp.4 gsc.4 ie.4 io.4 \
+ joy.4 keyboard.4 labpc.4 le.4 lnc.4 lp.4 lpt.4 matcd.4 mcd.4 mem.4 \
+ meteor.4 mouse.4 mse.4 mtio.4 nca.4 ncr.4 npx.4 \
+ pcm.4 pcvt.4 perfmon.4 pnp.4 psm.4 \
+ sb.4 scd.4 screen.4 sea.4 si.4 sio.4 \
+ spkr.4 sr.4 sysmouse.4 tl.4 tw.4 tx.4 uha.4 vx.4 \
+ wd.4 wfd.4 wl.4 wt.4 xl.4 ze.4 zp.4
-MLINKS= adv.4 ../adv.4
-MLINKS+= adw.4 ../adw.4
-MLINKS+= aha.4 ../aha.4
+MLINKS= aha.4 ../aha.4
MLINKS+= ahb.4 ../ahb.4
MLINKS+= ahc.4 ../ahc.4
MLINKS+= aic.4 ../aic.4
+MLINKS+= alog.4 ../alog.4
MLINKS+= apm.4 ../apm.4
MLINKS+= ar.4 ../ar.4
MLINKS+= asc.4 ../asc.4
-MLINKS+= ax.4 ../ax.4
MLINKS+= bktr.4 ../bktr.4
MLINKS+= bt.4 ../bt.4
MLINKS+= cs.4 ../cs.4
@@ -27,8 +25,8 @@ MLINKS+= cx.4 ../cx.4
MLINKS+= cy.4 ../cy.4
MLINKS+= de.4 ../de.4
MLINKS+= dgb.4 ../dgb.4
-MLINKS+= dpt.4 ../dpt.4
MLINKS+= ed.4 ../ed.4
+MLINKS+= eg.4 ../eg.4
MLINKS+= el.4 ../el.4
MLINKS+= en.4 ../en.4
MLINKS+= ep.4 ../ep.4
@@ -44,7 +42,7 @@ MLINKS+= keyboard.4 ../keyboard.4
MLINKS+= labpc.4 ../labpc.4
MLINKS+= le.4 ../le.4
MLINKS+= lnc.4 ../lnc.4
-MLINKS+= lp.4 ../lp.4
+MLINKS+= lp.4 ../lp.4 lp.4 plip.4 lp.4 ../plip.4
MLINKS+= lpt.4 ../lpt.4
MLINKS+= matcd.4 ../matcd.4
MLINKS+= mcd.4 ../mcd.4
@@ -53,22 +51,18 @@ MLINKS+= meteor.4 ../meteor.4
MLINKS+= mouse.4 ../mouse.4
MLINKS+= mse.4 ../mse.4
MLINKS+= mtio.4 ../mtio.4
-MLINKS+= mx.4 ../mx.4
+MLINKS+= nca.4 ../nca.4
MLINKS+= ncr.4 ../ncr.4
MLINKS+= npx.4 ../npx.4
-MLINKS+= pcf.4 ../pcf.4
MLINKS+= pcm.4 ../pcm.4
MLINKS+= pcvt.4 vt.4 pcvt.4 ../pcvt.4 pcvt.4 ../vt.4
MLINKS+= perfmon.4 ../perfmon.4
-MLINKS+= pn.4 ../pn.4
MLINKS+= pnp.4 ../pnp.4
-MLINKS+= ppc.4 ../ppc.4
MLINKS+= psm.4 ../psm.4
-MLINKS+= rdp.4 ../rdp.4
-MLINKS+= rl.4 ../rl.4
MLINKS+= sb.4 ../sb.4
MLINKS+= scd.4 ../scd.4
MLINKS+= screen.4 ../screen.4
+MLINKS+= sea.4 ../sea.4
MLINKS+= si.4 ../si.4
MLINKS+= sio.4 ../sio.4
MLINKS+= spkr.4 ../spkr.4 spkr.4 speaker.4 spkr.4 ../speaker.4
@@ -77,9 +71,8 @@ MLINKS+= sysmouse.4 ../sysmouse.4
MLINKS+= tl.4 ../tl.4
MLINKS+= tw.4 ../tw.4
MLINKS+= tx.4 ../tx.4
-MLINKS+= vr.4 ../vr.4
+MLINKS+= uha.4 ../uha.4
MLINKS+= vx.4 ../vx.4
-MLINKS+= wb.4 ../wb.4
MLINKS+= wd.4 ../wd.4
MLINKS+= wfd.4 ../wfd.4
MLINKS+= wl.4 ../wl.4
diff --git a/share/man/man4/man4.i386/adv.4 b/share/man/man4/man4.i386/adv.4
deleted file mode 100644
index 221976b49bc0..000000000000
--- a/share/man/man4/man4.i386/adv.4
+++ /dev/null
@@ -1,170 +0,0 @@
-.\"
-.\" Copyright (c) 1998
-.\" Justin T. Gibbs. 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software withough 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.
-.\"
-.\" $Id$
-.\"
-.Dd October 16, 1998
-.Dt ADV 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm adv
-.Nd Advansys ISA/VL/EISA/PCI 8bit SCSI Host adapter driver
-.Sh SYNOPSIS
-For one or more ISA or VL cards:
-.Cd controller isa0
-.Cd controller "adv0 at isa? port ? cam irq ? drq ?"
-.Pp
-For one or more EISA cards:
-.Cd controller eisa0
-.Cd controller adv0
-.Pp
-For one or more PCI cards:
-.Cd controller pci0
-.Cd controller adv0
-.Pp
-For one or more SCSI busses:
-.Cd controller scbus0 at adv0
-.Sh DESCRIPTION
-This driver provides access to the 8bit
-.Tn SCSI
-bus connected to the Advanced Systems Products, Inc.
-.Tn ASC900 ,
-.Tn ASC1000 ,
-.Tn ASC1090 ,
-.Tn ASC1200 ,
-.Tn ASC3050 ,
-and
-.Tn ASC3150
-host adapter chips.
-The following tables list the AdvanSys products using these chips,
-their bus attachment type, maximum sync rate, and the maximum number of
-commands that can be handled by the adapter concurrently.
-.Pp
-.Bd -filled -offset indent
-.Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " Footnotes
-Connectivity Products:
-.Pp
-.Em "Adapter Bus Floppy MaxSync Commands Footnotes"
-ABP510/5150 ISA No 10MHz 240 1
-ABP5140 ISA PnP No 10MHz 16 1, 3
-ABP5142 ISA PnP Yes 10MHz 16 4
-ABP920 PCI No 10MHz 16
-ABP930 PCI No 10MHz 16 5
-ABP930U PCI No 20MHz 16
-ABP930UA PCI No 20MHz 16
-ABP960 PCI No 10MHz 16 2
-ABP960U PCI No 20MHz 16 2
-.El
-.Pp
-Footnotes:
-.Bl -enum -compact
-.It
-This board has been shipped by HP with the 4020i CD-R drive.
-The board has no BIOS so it cannot control a boot device, but
-it can control any secondary SCSI device.
-.It
-This board has been sold by Iomega as a Jaz Jet PCI adapter.
-.It
-This board has been sold by SIIG as the i540 SpeedMaster.
-.It
-This board has been sold by SIIG as the i542 SpeedMaster.
-.It
-This board has been sold by SIIG as the Fast SCSI Pro PCI.
-.El
-.Ed
-.Pp
-.Bd -filled -offset indent
-.Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " Commands
-Single Channel Products:
-.Pp
-.Em "Adapter Bus Floppy MaxSync Commands"
-ABP542 ISA Yes 10MHz 240
-ABP742 EISA Yes 10MHz 240
-ABP842 VL Yes 10MHz 240
-ABP940 PCI No 10MHz 240
-ABP940U PCI No 20MHz 240
-ABP970 PCI No 10MHz 240
-ABP970U PCI No 20MHz 240
-.El
-.Ed
-.Pp
-.Bd -filled -offset indent
-.Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " "Channels "
-Multi Channel Products (Commands are per-channel):
-.Pp
-.Em "Adapter Bus Floppy MaxSync Commands Channels"
-ABP752 EISA Yes 10MHz 240 2
-ABP852 VL Yes 10MHz 240 2
-ABP950 PCI No 10MHz 240 2
-ABP980 PCI No 10MHz 240 4
-ABP980U PCI No 20MHz 240 4
-.El
-.Ed
-.Pp
-For ISA or Vesa Local Bus adapters, one kernel config entry is required
-for every card to be attached by the system. Specific values for the port
-address, irq, and drq may be specified. If wildcard values are used, the
-driver will query the device for its current settings and use those. If
-the port address is a wildcard, the driver consults an internal table of
-possible port address locations and attaches to the first unattached card
-it finds. The possible port addresses for these card are 0x110, 0x130,
-0x150, 0x190, 0x210, 0x230, 0x250, and 0x330.
-.Pp
-Per target configuration performed in the
-.Tn AdvanceWare
-menu, which is accessible at boot,
-is honored by this driver.
-This includes synchronous/asynchronous transfers,
-maximum synchronous negotiation rate, disconnection, tagged queueing,
-and the host adapter's SCSI ID.
-The global setting for the maximum number of tagged transactions allowed
-per target is not honored as the CAM SCSI system will automatically determine
-the maximum number of tags a device can receive as well as guarantee fair
-resource allocation among devices.
-.Sh SEE ALSO
-.Xr adw 4 ,
-.Xr aha 4 ,
-.Xr ahb 4 ,
-.Xr ahc 4 ,
-.Xr cd 4 ,
-.Xr da 4 ,
-.Xr sa 4 ,
-.Xr scsi 4
-.Sh AUTHORS
-The
-.Nm adv
-driver was ported by
-.An Justin T. Gibbs
-from the Linux driver
-written by
-.An Bob Frey
-of Advanced System Products, Inc.
-Many thanks to AdvanSys for providing the original driver under a suitable
-license for use in FreeBSD.
-.Sh HISTORY
-The
-.Nm
-driver appeared in
-.Fx 3.0 .
-
-
diff --git a/share/man/man4/man4.i386/adw.4 b/share/man/man4/man4.i386/adw.4
deleted file mode 100644
index 413274909d19..000000000000
--- a/share/man/man4/man4.i386/adw.4
+++ /dev/null
@@ -1,79 +0,0 @@
-.\"
-.\" Copyright (c) 1998
-.\" Justin T. Gibbs. 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software withough 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.
-.\"
-.\" $Id$
-.\"
-.Dd October 16, 1998
-.Dt ADW 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm adw
-.Nd Advansys PCI 16bit SCSI Host adapter driver
-.Sh SYNOPSIS
-.Cd controller pci0
-.Cd controller adw0
-.Pp
-For one or more SCSI busses:
-.Cd controller scbus0 at adw0
-.Sh DESCRIPTION
-This driver provides access to the 16bit
-.Tn SCSI
-bus connected to the Advanced Systems Products, Inc.
-.Tn ASC3550
-as found on the ABP940UW SCSI Host Adapter board. This chip
-supports, Ultra SCSI (20MHz), 16bit transfers, tagged queueing,
-and up to 253 concurrent SCSI transactions.
-.Pp
-Per target configuration performed in the
-.Tn AdvanceWare
-menu, which is accessible at boot,
-is honored by this driver.
-This includes synchronous/asynchronous transfers,
-maximum synchronous negotiation rate, wide transfers, disconnection,
-tagged queueing, and the host adapter's SCSI ID.
-The global setting for the maximum number of tagged transactions allowed
-per target is not honored as the CAM SCSI system will automatically determine
-the maximum number of tags a device can receive as well as guarantee fair
-resource allocation among devices.
-.Sh SEE ALSO
-.Xr adv 4 ,
-.Xr cd 4 ,
-.Xr scsi 4 ,
-.Xr da 4 ,
-.Xr sa 4
-.Sh AUTHORS
-The
-.Nm
-driver was ported by
-.An Justin T. Gibbs
-from the Linux driver written by
-.An Bob Frey
-of Advanced System Products, Inc. Many thanks to AdvanSys for providing
-the original driver under a suitable license for use in FreeBSD.
-.Sh HISTORY
-The
-.Nm
-driver appeared in
-.Fx 3.0 .
-
-
diff --git a/share/man/man4/man4.i386/ahc.4 b/share/man/man4/man4.i386/ahc.4
index 5ff9df86bbea..b786034749c1 100644
--- a/share/man/man4/man4.i386/ahc.4
+++ b/share/man/man4/man4.i386/ahc.4
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1995, 1996, 1997, 1998
+.\" Copyright (c) 1995, 1996, 1997
.\" Justin T. Gibbs. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,9 +24,9 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ahc.4,v 1.12 1998/06/13 19:06:49 steve Exp $
+.\" $Id: ahc.4,v 1.11 1998/06/08 06:11:58 jkoshy Exp $
.\"
-.Dd October 15, 1998
+.Dd April 20, 1996
.Dt AHC 4 i386
.Os FreeBSD
.Sh NAME
@@ -41,6 +41,12 @@ For one or more PCI cards:
.Cd controller pci0
.Cd controller ahc0
.Pp
+To enable SCB paging:
+.Cd options AHC_SCBPAGING_ENABLE
+.Pp
+To enable tagged queueing:
+.Cd options AHC_TAGENABLE
+.Pp
To allow PCI adapters to use memory mapped I/O if enabled:
.Cd options AHC_ALLOW_MEMIO
.Pp
@@ -49,49 +55,59 @@ For one or more SCSI busses:
.Sh DESCRIPTION
This driver provides access to the
.Tn SCSI
-bus(es) connected to Adaptec
+bus(es) connected to Adaptec
+274x, 284x, 2940, 3940, or controllers based on the
.Tn AIC7770,
.Tn AIC7850,
.Tn AIC7860,
.Tn AIC7870,
-.Tn AIC7880,
-.Tn AIC7890,
-.Tn AIC7891,
-.Tn AIC7895,
-.Tn AIC7896,
or
-.Tn AIC7897
+.Tn AIC7880
host adapter chips.
-These chips are found on many motherboards as well as the following
-Adaptec SCSI controller cards:
-.Tn 274X(W),
-.Tn 274X(T),
-.Tn 284X,
-.Tn 2920C,
-.Tn 2940,
-.Tn 2940U,
-.Tn 2940AU,
-.Tn 2940UW,
-.Tn 2940UW Dual,
-.Tn 2940U2W,
-.Tn 2940U2B,
-.Tn 2950U2W,
-.Tn 2950U2B,
-.Tn 3940,
-.Tn 3940U,
-.Tn 3940AU,
-.Tn 3940UW,
-.Tn 3940AUW,
-.Tn 3940U2W,
-and
-.Tn 3985.
-.Pp
-Driver features include support for twin and wide busses,
-fast, ultra and ultra2 synchronous transfers depending on controller type,
-tagged queueing,
+Features include support for twin and wide busses,
+ultra
+.Tn SCSI,
+two active commands at a time per non-tagged queueing target,
+tagged queuing,
and SCB paging.
.Pp
-Memory mapped I/O can be enabled for PCI devices with the
+The number of concurrent transactions allowed is chip dependent
+and ranges from 3 to 16.
+On PCI adapters,
+this number can be increased with the SCB paging option.
+SCB paging implements an algorithm to 'page-out' transactions
+that are in the disconnected state so that the freed space in
+the controller's memory can be used to start additional transactions.
+On the aic7880 and aic7870,
+this increases the maximum number of outstanding transactions from 16 to 255.
+On the aic7850 and aic7860 controllers, this maximum rises from 3 to 8.
+During the hardware probe,
+a diagnostic showing the ratio of hardware supported 'slots' to number
+of transactions is printed.
+SCB paging is enabled with the
+.Dq Dv AHC_SCBPAGING_ENABLE
+configuration option.
+This option will likely be removed and become the default behavior for
+adapters that support it,
+in the near future.
+.Pp
+Tagged queueing is enabled with the
+.Dq Dv AHC_TAGENABLE
+configuration option.
+Tagged queueing allows multiple transactions to be queued at the device
+level instead of the host level,
+allowing the device to re-order I/O to minimize seeks,
+seek distance,
+and to increase throughput.
+Tagged queueing can have a significant impact on performance for seek
+bound applications and should be enabled for most configurations.
+Unfortunately, some devices that claim to support tagged queueing fail
+miserably when it is used.
+The only reason tagged queueing remains as a controller option is as a
+stop gap measure until a mechanism to detect these broken devices and to
+control this feature on a per device basis is in place.
+.Pp
+Memory mapped I/O can be enabled with the
.Dq Dv AHC_ALLOW_MEMIO
configuration option.
Memory mapped I/O is more efficient than the alternative, programmed I/O.
@@ -123,12 +139,7 @@ must be enabled for
adaptors. This includes synchronous/asynchronous transfers,
maximum synchronous negotiation rate,
disconnection,
-the host adapter's SCSI ID,
-and,
-in the case of
-.Tn EISA
-Twin Channel controllers,
-the primary channel selection.
+and the host adapter's SCSI ID.
.Pp
Note that I/O addresses are determined automatically by the probe routines,
but care should be taken when using a 284x
@@ -140,110 +151,35 @@ system. Ensure that the jumpers setting the I/O area for the 284x match the
slot into which the card is inserted to prevent conflicts with other
.Tn EISA
cards.
-.Pp
-Performance and feature sets vary throughout the aic7xxx product line.
-The following table provides a comparison of the different chips supported
-by the
-.Nm
-driver. Note that wide and twin channel features, although always supported
-by a particular chip, may be disabled in a particular motherboard or card
-design.
-.Pp
-.Bd -filled -offset indent
-.Bl -column "aic7770 " "10 " "EISA/VL " "10MHz " "16bit " "SCBs " Features
-.Em "Chip MIPS Bus MaxSync MaxWidth SCBs Features"
-aic7770 10 EISA/VL 10MHz 16Bit 4 1
-aic7850 10 PCI/32 10MHz 8Bit 3
-aic7860 10 PCI/32 20MHz 8Bit 3
-aic7870 10 PCI/32 10MHz 16Bit 16
-aic7880 10 PCI/32 20MHz 16Bit 16
-aic7890 20 PCI/32 40MHz 16Bit 16 3 4 5 6 7
-aic7891 20 PCI/64 40MHz 16Bit 16 3 4 5 6 7
-aic7895 15 PCI/32 20MHz 16Bit 16 2 3 4 5
-aic7896 20 PCI/32 40MHz 16Bit 16 2 3 4 5 6 7
-aic7897 20 PCI/64 40MHz 16Bit 16 2 3 4 5 6 7
-.El
-.Pp
-.Bl -enum -compact
-.It
-Multiplexed Twin Channel Device - One controller servicing two busses.
-.It
-Multi-function Twin Channel Device - Two controllers on one chip.
-.It
-Command Channel Secondary DMA Engine - Allows scatter gather list and
-SCB prefetch.
-.It
-64 Byte SCB Support - SCSI CDB is embedded in the SCB to eliminate an extra DMA.
-.It
-Block Move Instruction Support - Doubles the speed of certain sequencer
-operations.
-.It
-.Sq Bayonet
-style Scatter Gather Engine - Improves S/G prefetch performance.
-.It
-Queueing Registers - Allows queueing of new transactions without pausing the
-sequencer.
-.El
-.Ed
-.Pp
-
-.Sh SCSI CONTROL BLOCKS (SCBs)
-Every transaction sent to a device on the SCSI bus is assigned a
-.Sq SCSI Control Block
-(SCB). The SCB contains all of the information required by the
-controller to process a transaction. The chip feature table lists
-the number of SCBs that can be stored in on chip memory. All chips
-with model numbers greater than or equal to 7870 allow for the on chip
-SCB space to be augmented with external SRAM up to a maximum of 255 SCBs.
-Very few Adaptec controller have external SRAM.
-
-If external SRAM is not available, SCBs are a limited resource and
-using them in a straight forward manner would only allow us to
-keep as many transactions as there are SCBs outstanding at a time.
-This would not allow enough concurrency to fully utilize the SCSI
-bus and it's devices. The solution to this problem is
-.Em SCB Paging ,
-a concept similar to memory paging. SCB paging takes advantage of
-the fact that devices usually disconnect from the SCSI bus for long
-periods of time without talking to the controller. The SCBs
-for disconnected transactions are only of use to the controller
-when the transfer is resumed. When the host queues another transaction
-for the controller to execute, the controller firmware will use a
-free SCB if one is available. Otherwise, the state of the most recently
-disconnected (and therefor most likely to stay disconnected) SCB is
-saved, via dma, to host memory, and the local SCB reused to start
-the new transaction. This allows the controller to queue up to
-255 transactions regardless of the amount of SCB space. Since the
-local SCB space serves as a cache for disconnected transactions, the
-more SCB space available, the less host bus traffic consumed saving
-and restoring SCB data.
.Sh BUGS
Some Quantum drives (at least the Empire 2100 and 1080s) will not run on an
.Tn AIC7870
Rev B in synchronous mode at 10MHz. Controllers with this problem have a
-42 MHz clock crystal on them and run slightly above 10MHz. This confuses
-the drive and hangs the bus. Setting a maximum synchronous negotiation rate
-of 8MHz in the
+42 MHz clock crystal on them and run slightly above 10MHz. This causes the
+drive much confusion. Setting a maximum synchronous negotiation rate of 8MHz
+in the
.Tn SCSI-Select
utility
-will allow normal operation.
+will allow normal function.
.Sh SEE ALSO
.Xr aha 4 ,
.Xr ahb 4 ,
.Xr cd 4 ,
.Xr scsi 4 ,
-.Xr da 4 ,
-.Xr sa 4
+.Xr sd 4 ,
+.Xr st 4
.Sh AUTHORS
The
.Nm
-driver, the
+driver was written by
+.An Justin Gibbs .
+The
.Tn AIC7xxx
-sequencer-code assember,
-and the firmware running on the aic7xxx chips was written by
-.An Justin T. Gibbs .
+sequencer-code assembler was
+written by
+.An John Aycock .
.Sh HISTORY
The
.Nm
driver appeared in
-.Fx 2.0 .
+.Fx 2.1 .
diff --git a/share/man/man4/man4.i386/alog.4 b/share/man/man4/man4.i386/alog.4
new file mode 100644
index 000000000000..3deabeb829a7
--- /dev/null
+++ b/share/man/man4/man4.i386/alog.4
@@ -0,0 +1,149 @@
+.\"
+.\" Copyright (c) 1998 Scottibox
+.\" 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
+.\" in this position and unchanged.
+.\" 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
+.\"
+.\" 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.
+.\"
+.\" Industrial Computer Source model AIO8-P
+.\" 8 channel, moderate speed analog to digital converter board with
+.\" 128 channel MUX capability via daisy-chained AT-16P units
+.\" alog.c, character device driver, last revised January 6 1998
+.\" See http://www.scottibox.com
+.\" http://www.indcompsrc.com/products/data/html/aio8g-p.html
+.\" http://www.indcompsrc.com/products/data/html/at16-p.html
+.\"
+.\" Written by: Jamil J. Weatherbee <jamil@scottibox.com>
+.\"
+.\"
+.Dd January 6, 1998
+.Dt ALOG 4 i386
+.Os FreeBSD
+.Sh NAME
+.Nm alog
+.Nd
+Industrial Computer Source AIO8-P driver
+.Sh SYNOPSIS
+.Cd "device alog0 at isa? port 0x260 tty irq 5 vector alogintr"
+.Sh DESCRIPTION
+This driver supports the Industrial Computer Source \fIAIO8-P 8-Channel
+12-Bit Analog Input board\fP.
+.Pp
+This board provides 8 12 bit, single-ended analog input ports.
+The driver also directly provides support for up to 8 daisy chained
+\fIAT16-P Programmable Analog Multiplexers with 16 Differential Inputs\fP.
+This makes it possible to sample up to 128 differential channels with a single
+interface board.
+Use of at least one \fIAT16-P\fP is highly recommended as the \fIAIO8-P\fP
+offers no signal conditioning options and only operates in a -5 to +5 Volt
+input range. However, if you wish to use the \fIAIO8-P\fP standalone,
+insert the following into your kernel
+.Xr config 8
+file:
+.Bd -literal -offset indent
+options ALOG_CHANNELS=8
+.Ed
+.Pp
+Selection of the input port is through the minor number:
+.Pp
+.Bd -literal -offset indent
+The 8 bit minor number format is UCCCCMMM, where
+ U: board unit (0-1)
+CCCC: external multiplexer channel (0-15) (on AT-16P units)
+ MMM: internal multiplexer channel (0-7) (on AIO8-P card)
+.Ed
+.Pp
+.Xr devfs 5
+device node names are of the form: alog[0-1][a-p][0-7]
+.Pp
+.Sh IOCTL
+The following
+.Xr ioctl 2
+calls apply to
+.Nm
+devices. Their declaration can be found in the header files
+.Pa <sys/alogio.h>
+and
+.Pa <sys/dataacq.h>
+.Bl -tag -width AD_MICRO_PERIOD_SET
+.It Dv AD_MICRO_PERIOD_SET
+Takes a pointer to a long argument specifying the number of microseconds
+between samples. Half of this is used as the external multiplexer
+settling time and the other half as conversion time.
+.It Dv AD_MICRO_PERIOD_GET
+Takes a pointer to a long argument and returns the current number of
+microseconds between samples.
+.It Dv AD_NCHANS_GET
+Takes a pointer to an integer and returns the number of channels the board
+supports. This should be 8 for a standalone \fIAIO8-P\fP or 128 for any
+other setup.
+.It Dv AD_FIFOSIZE_GET
+Takes a pointer to an integer and returns the size of the fifo in
+entries. The compile time option ALOG_FIFOSIZE is by default set to 64.
+.It Dv AD_FIFO_TRIGGER_GET
+Takes a pointer to an integer and returns the minimum number of entries a
+fifo must contain to cause
+.Xr poll 2
+to return. This by default is set to 1.
+.It Dv AD_FIFO_TRIGGER_SET
+Takes a pointer to an integer specifying the minimum number of entries a
+fifo must contain to cause
+.Xr poll 2
+to return.
+.It Dv AD_START
+Starts the clocked accumulation of sample values into a channel's driver fifo.
+When a channel is first opened its software fifo is initialized in the
+stopped state. This is to prevent high sample clocks from overrunning the
+fifos before the user is ready to read from the channel. The driver
+automatically performs an AD_START when the user issues the first read,
+except for channels opened with the O_NONBLOCK flag which must explicitly
+have an AD_START issued.
+.It Dv AD_STOP
+Stops the clocked accumulation of sample values into a channel's driver fifo.
+.Sh BUGS
+On the \fIAIO8-P\fP, interrupt driven conversion (the only type
+supported by the
+.Nm
+driver) is facilitated through 8253 timer #2. In order for interrupts to
+be generated you must connect line 6 to line 24 (counter 2 output to
+interrupt input) and line 23 to line 29 (counter 2 gate to +5VDC).
+The design of the \fIAIO8-P\fP precludes the use of programmable
+gain control.
+.Pp
+Use the combination of non-blocking i/o,
+.Xr poll 2
+and a custom fifo trigger
+wherever possible, especially with large numbers of open channels.
+Using this method, multichannel sample rates as high as 16,000 samples/sec
+have been observed.
+.Pp
+Sample rates lower than 32 Hz are not supported.
+.Sh SEE ALSO
+.Bd -literal
+http://www.scottibox.com
+http://www.indcompsrc.com/products/data/html/aio8g-p.html
+http://www.indcompsrc.com/products/data/html/at16-p.html
+.Ed
+.Sh AUTHORS
+.An Jamil J. Weatherbee Aq jamil@scottibox.com
diff --git a/share/man/man4/man4.i386/apm.4 b/share/man/man4/man4.i386/apm.4
index 24aa3a1deefb..959439ba7116 100644
--- a/share/man/man4/man4.i386/apm.4
+++ b/share/man/man4/man4.i386/apm.4
@@ -9,7 +9,7 @@
.\" the author assume any responsibility for damages incurred with its
.\" use.
.\"
-.\" $Id: apm.4,v 1.8 1998/06/08 06:11:58 jkoshy Exp $
+.\" $Id: apm.4,v 1.7 1998/02/20 07:19:51 hosokawa Exp $
.\"
.Dd November 1, 1994
.Dt APM 4 i386
@@ -116,15 +116,15 @@ WARNING! Many, if not most, of the implementations of APM-bios in laptops
today are buggy. You may be putting your LCD-display and batteries at
a risk by using this interface. (The reason this isn't a problem for
MS-windows is that they use the real-mode interface.) If you see any
-weird behavior from your system with this code in use, unplug the
+weird behaviour from your system with this code in use, unplug the
power and batteries ASAP, if not immediately, and disable this code.
.Pp
We are very interested in getting this code working, so please send you
-observations of any anomalous behavior to us.
+observations of any anormalous behaviour to us.
.Pp
When
.Nm apm
-is active, calling the BIOS setup routine by using hot-keys,
+is active, calling the BIOS setup routine by using hotkeys,
may cause serious trouble when resuming the system.
BIOS setup programs should be called during bootstrap, or from DOS.
.Pp
@@ -138,7 +138,7 @@ by using
or
.Xr zzz 8 .
.Pp
-Disk spin-down, LCD backlight control, and power on demand have not
+Disk spindown, LCD backlight control, and power on demand have not
been supported on the current version.
.Sh SEE ALSO
.Xr apm 8 ,
diff --git a/share/man/man4/man4.i386/ar.4 b/share/man/man4/man4.i386/ar.4
index 5446b667e92f..5ba3c209e9e6 100644
--- a/share/man/man4/man4.i386/ar.4
+++ b/share/man/man4/man4.i386/ar.4
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: ar.4,v 1.8 1998/06/08 06:11:58 jkoshy Exp $
+.\" $Id: ar.4,v 1.7 1998/03/12 07:30:30 charnier Exp $
.\"
.Dd November 19, 1995
.Dt AR 4 i386
@@ -38,8 +38,8 @@
.Nd
synchronous Arnet device driver.
.Sh SYNOPSIS
-.Cd "device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000"
-.Cd "device ar1 at isa? port 0x310 net irq 11 iomem 0xd0000"
+.Cd "device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector arintr"
+.Cd "device ar1 at isa? port 0x310 net irq 11 iomem 0xd0000 vector arintr"
.Pp
.Cd "pseudo-device sppp"
.Sh DESCRIPTION
diff --git a/share/man/man4/man4.i386/asc.4 b/share/man/man4/man4.i386/asc.4
index d84ae7b49f4a..f3789554ac66 100644
--- a/share/man/man4/man4.i386/asc.4
+++ b/share/man/man4/man4.i386/asc.4
@@ -29,7 +29,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: asc.4,v 1.7 1998/06/08 06:11:58 jkoshy Exp $
+.\" $Id: asc.4,v 1.6 1997/02/22 13:25:13 peter Exp $
.Dd January 19, 1995
.Dt ASC 4 i386
.Os FreeBSD
@@ -37,7 +37,7 @@
.Nm asc
.Nd device driver for a GI1904-based hand scanner
.Sh SYNOPSIS
-.Cd "device asc0 at isa? port" \&"IO_ASC1\&" tty drq 3 irq 10
+.Cd "device asc0 at isa? port IO_ASC1 tty drq 3 irq 10 vector ascintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/ax.4 b/share/man/man4/man4.i386/ax.4
deleted file mode 100644
index 58507c8930b5..000000000000
--- a/share/man/man4/man4.i386/ax.4
+++ /dev/null
@@ -1,152 +0,0 @@
-.\" Copyright (c) 1997, 1998, 1999
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: ax.4,v 1.1 1999/01/09 18:12:06 wpaul Exp $
-.\"
-.Dd January 2, 1999
-.Dt AX 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm ax
-.Nd
-ASIX Electronics AX88140A fast ethernet device driver
-.Sh SYNOPSIS
-.Cd "device ax0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the ASIX AX88140A fast ethernet controller chip,
-including the Alfa Inc. GFC2204 and the CNet Pro110B.
-.Pp
-The ASIX chip uses bus master DMA and is designed to be a
-DEC 21x4x workalike. The only major difference between the DEC
-and ASIX parts is that the ASIX receiver filter is programmed
-using two special registers where as the DEC chip is programmed
-by uploading a special setup frame via the transmit DMA engine.
-The ASIX receive filter can only be programmed with a single
-perfect filter entry for the local station address and a 64-bit
-multicast hash table; the DEC filter has supports several other
-options. The ASIX fast ethernet controller supports both
-10 and 100Mbps speeds in either full or half duplex using
-an external MII transceiver.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options.
-The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "ax%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "ax%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "ax%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "ax%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "ax%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "ax%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Rs
-.%T ASIX AX81140A data sheet
-.%O http://www.asix.com.tw
-.Re
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
diff --git a/share/man/man4/man4.i386/bktr.4 b/share/man/man4/man4.i386/bktr.4
index d0c151d1098c..04d30a7b2d10 100644
--- a/share/man/man4/man4.i386/bktr.4
+++ b/share/man/man4/man4.i386/bktr.4
@@ -1,5 +1,5 @@
.\"
-.\" $Id: bktr.4,v 1.1 1998/03/09 10:56:22 jkh Exp $
+.\" $Id$
.\"
.Dd January 28, 1998
.br
@@ -11,10 +11,6 @@
.Nd video capture driver
.Sh SYNOPSIS
.Nm device bktr0
-.Pp
-.Nm controller iicbus0
-.Nm controller iicbb0
-.Nm controller smbus0
.Sh DESCRIPTION
The
.Nm bktr
@@ -51,15 +47,6 @@ rgb24
rgb32
.in -0.5i
.Pp
-On these cards, tuners and other components are interconnected with an I2C bus.
-The Brooktree848 chips act as a master device on the bus to control them.
-Therefore,
-.Xr iicbus 4 ,
-.Xr iicbb 4
-and
-.Xr smbus 4
-controller declarations are mandatory to active bktr support.
-.Pp
The following kernel parameters may be used to further configure the driver:
.Pp
.Em options "BROOKTREE_ALLOC_PAGES=xxx"
diff --git a/share/man/man4/man4.i386/bt.4 b/share/man/man4/man4.i386/bt.4
index a5756956f8e3..39cb8915e240 100644
--- a/share/man/man4/man4.i386/bt.4
+++ b/share/man/man4/man4.i386/bt.4
@@ -24,112 +24,44 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: bt.4,v 1.5 1998/03/12 07:30:30 charnier Exp $
+.\" $Id: bt.4,v 1.4 1997/03/07 02:49:45 jmg Exp $
.\"
-.Dd October 16, 1998
+.Dd August 31, 1994
.Dt BT 4 i386
.Os FreeBSD
.Sh NAME
.Nm bt
-.Nd Buslogic/Mylex MultiMaster SCSI host adapter driver
+.Nd Buslogic SCSI host adapter driver
.Sh SYNOPSIS
-.Cd "controller bt0 at isa? port ? cam irq ?"
+.Cd "controller bt0 at isa? port IO_BT0 bio irq ? vector btintr"
.Cd controller scbus0 at bt0
.Sh DESCRIPTION
This driver provides access to the
.Tn SCSI
-bus connected to a Buslogic/Mylex MultiMaster or compatible controller:
-.Pp
-.Bd -filled -offset indent
-.Bl -column "BT-956CD " "ISA " "Commands " Description
-MultiMaster "W" Series Host Adapters:
-.Pp
-.Em "Adapter Bus Commands Description"
-BT-948 PCI 192 ULtra SCSI-3
-BT-958 PCI 192 Wide ULtra SCSI-3
-BT-958D PCI 192 Wide Differential ULtra SCSI-3
-.El
-.Bl -column "BT-956CD " "ISA " "Commands " Description
-MultiMaster "C" Series Host Adapters:
-.Pp
-.Em "Adapter Bus Commands Description"
-BT-946C PCI 100 Fast SCSI-2
-BT-956C PCI 100 Wide Fast SCSI-2
-BT-956CD PCI 100 Wide Differential Fast SCSI-2
-BT-445C VLB 100 Fast SCSI-2
-BT-747C EISA 100 Fast SCSI-2
-BT-757C EISA 100 Wide Fast SCSI-2
-BT-757CD EISA 100 Wide Differential Fast SCSI-2
-BT-545C ISA 50 Fast SCSI-2
-BT-540CF ISA 50 Fast SCSI-2
-.El
-.Bl -column "BT-956CD " "ISA " "Commands " Description
-MultiMaster "S" Series Host Adapters:
-.Pp
-.Em "Adapter Bus Commands Description"
-BT-445S VLB 30 Fast SCSI-2
-BT-747S EISA 30 Fast SCSI-2
-BT-747D EISA 30 Differential Fast SCSI-2
-BT-757S EISA 30 Wide Fast SCSI-2
-BT-757D EISA 30 Wide Differential Fast SCSI-2
-BT-545S ISA 30 Fast SCSI-2
-BT-542D ISA 30 Differential Fast SCSI-2
-BT-742A EISA 30 SCSI-2 (742A revision H)
-BT-542B ISA 30 SCSI-2 (542B revision H)
-.El
-.Bl -column "BT-956CD " "ISA " "Commands " Description
-MultiMaster "A" Series Host Adapters:
-.Pp
-.Em "Adapter Bus Commands Description"
-BT-742A EISA 30 SCSI-2 (742A revisions A - G)
-BT-542B ISA 30 SCSI-2 (542B revisions A - G)
-.El
-.Ed
-.Pp
-AMI FastDisk Host Adapters that are true BusLogic MultiMaster clones are also
-supported by this driver.
-.Pp
-Tagged queueing is supported on 'W' series adapters, 'C' series adapters
-with firmware of rev 4.42 and higher, and 'S' series adapters with firmware
-of rev 3.35 and higher.
-.Pp
-Boards with certain firmware revisions may lock up under heavy load to
-certain devices, especially if tagged queueing is used. Should you encounter
-a problem with your adapter, contact Mylex technical support and ensure you
-have the latest firmware for your controller.
+bus connected to a Buslogic
+545, 445, 742, 747 or 946 host adapter.
+.\"
+.\" .Sh DIAGNOSTICS
+.\"
.Sh SEE ALSO
.Xr cd 4 ,
.Xr scsi 4 ,
-.Xr da 4 ,
-.Xr sa 4
+.Xr sd 4 ,
+.Xr st 4
.Sh AUTHORS
+The
+.Nm
+driver was written by
.An Julian Elischer
-wrote a driver for the Multimaster cards that appeared in the 386BSD
-patch kit. The driver was rewritten by
-.An Justin T. Gibbs
-to take advantage of new board features and work with the CAM SCSI framework
-in FreeBSD 3.0R.
-.Pp
-Special thanks to Leonard N. Zubkoff
-for writing such a complete and well documented Mylex/BusLogic MultiMaster
-driver for Linux. Support in this driver for the wide range of MultiMaster
-controllers and firmware revisions, with their otherwise undocumented quirks,
-would not have been possible without his efforts.
-.Sh FILES
-.Bl -tag -width /usr/share/man0/template.doc -compact
-.It Pa sys/dev/buslogic/bt.c
-Core Driver Implementation
-.It Pa sys/dev/buslogic/btreg.h
-MultiMaster Register Set and Core Driver Data Structures
-.It Pa sys/pci/bt_pci.c
-PCI Bus Driver Attachment
-.It Pa sys/i386/eisa/bt_eisa.c
-EISA Bus Driver Attachment
-.It Pa sys/i386/isa/bt_isa.c
-ISA/VL Bus Driver Attachment
-.El
+for use with
+.Tn Mach
+2.5. The interface for the
+.Tn PCI
+and
+.Tn EISA
+busses was written by
+.An Justin Gibbs .
.Sh HISTORY
-The
+We're not sure when the
.Nm
-driver first appeared in the 386BSD patch kit.
-
+driver first appeared.
diff --git a/share/man/man4/man4.i386/cs.4 b/share/man/man4/man4.i386/cs.4
index 4121ee521971..912ad259f9c2 100644
--- a/share/man/man4/man4.i386/cs.4
+++ b/share/man/man4/man4.i386/cs.4
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: cs.4,v 1.1 1998/07/20 20:02:32 msmith Exp $
+.\" $Id$
.\"
.Dd July 20, 1998
.Dt CS 4 i386
@@ -32,8 +32,8 @@
.Nm cs
.Nd ethernet device driver
.Sh SYNOPSIS
-.Cd "device cs0 at isa? port 0x300 net irq ?"
-.Cd "device cs1 at isa? port 0x300 net irq 10 iomem 0xd0000"
+.Cd "device cs0 at isa? port 0x300 net irq ? vector csintr"
+.Cd "device cs1 at isa? port 0x300 net irq 10 iomem 0xd0000 vector csintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/cy.4 b/share/man/man4/man4.i386/cy.4
index 316dfc51c494..6fd1017624d4 100644
--- a/share/man/man4/man4.i386/cy.4
+++ b/share/man/man4/man4.i386/cy.4
@@ -35,7 +35,7 @@
.\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91
.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
.\" from: sio.4,v 1.16 1995/06/26 06:05:30 bde Exp $
-.\" $Id: cy.4,v 1.8 1997/03/21 20:13:42 mpp Exp $
+.\" $Id: cy.4,v 1.7 1997/03/03 18:38:37 bde Exp $
.\"
.Dd October 10, 1995
.Dt CY 4 i386
@@ -44,8 +44,8 @@
.Nm cy
.Nd Cyclades Cyclom-Y serial driver
.Sh SYNOPSIS
-.Cd "device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000"
-.Cd "device cy1 at isa? tty irq 11 iomem 0xd6000 iosiz 0x2000"
+.Cd "device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000 vector cyintr
+.Cd "device cy1 at isa? tty irq 11 iomem 0xd6000 iosiz 0x2000 vector cyintr
.Pp
Minor numbering:
.Pp
diff --git a/share/man/man4/man4.i386/dpt.4 b/share/man/man4/man4.i386/dpt.4
deleted file mode 100644
index cb0e9b20f308..000000000000
--- a/share/man/man4/man4.i386/dpt.4
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" Copyright (c) 1998 Justin T. Gibbs
-.\" 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. 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.
-.\"
-.\" $Id$
-.\"
-.Dd October 16, 1998
-.Dt DPT 4 i386
-.Os FreeBSD 3.0
-.Sh NAME
-.Nm dpt
-.Nd DPT RAID Controller SCSI driver
-.Sh SYNOPSIS
-For one or more EISA Controllers
-.Cd "controller eisa0"
-.Cd "controller dpt0"
-.Pp
-For one or more PCI Controllers
-.Cd "controller pci0"
-.Cd "controller dpt0"
-.Pp
-To allow PCI adapters to use memory mapped I/O if enabled:
-.Cd options DPT_ALLOW_MEMIO
-.Pp
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for the DPT Smart Cache Plus, Smart Cache III,
-Smart Raid III, Smart Cache IV, and Smart RAID IV families of procucts.
-.Sh FILES
-.Bl -tag -width /usr/share/man0/template.doc -compact
-.It Pa sys/dev/dpt/dpt_scsi.c
-Core Driver Implementation
-.It Pa sys/dev/dpt/dpt.h
-Register Set and Core Driver Data Structures
-.It Pa sys/pci/dpt_pci.c
-PCI Bus Driver Attachment
-.It Pa sys/i386/eisa/dpt_eisa.c
-EISA Bus Driver Attachment
-.El
-.Sh SEE ALSO
-.Xr cd 4 ,
-.Xr ch 4 ,
-.Xr scsi 4 ,
-.Xr da 4 ,
-.Xr sa 4
-.Sh AUTHORS
-The
-.Nm
-driver was written by
-.An Simon Shapiro
-and ported to the CAM SCSI system by
-.An Justin T. Gibbs .
-.Sh HISTORY
-The
-.Nm
-driver first appeared in
-.Fx 2.2.6 .
-
diff --git a/share/man/man4/man4.i386/ed.4 b/share/man/man4/man4.i386/ed.4
index 60ed90d4aa71..88460ce932e8 100644
--- a/share/man/man4/man4.i386/ed.4
+++ b/share/man/man4/man4.i386/ed.4
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: ed.4,v 1.12 1998/06/08 06:11:59 jkoshy Exp $
+.\" $Id: ed.4,v 1.11 1998/03/12 07:30:31 charnier Exp $
.\"
.Dd October 28, 1995
.Dt ED 4 i386
@@ -37,9 +37,9 @@
.Nm ed
.Nd high performance ethernet device driver
.Sh SYNOPSIS
-.Cd "device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000"
-.Cd "device ed1 at isa? port 0x300 net irq 5 iomem 0xd8000"
-.Cd "device ed2 at isa? port 0x320 net irq 10 flags 0x4 iosiz 16384 iomem 0xd8000"
+.Cd "device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr"
+.Cd "device ed1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector edintr"
+.Cd "device ed2 at isa? port 0x320 net irq 10 flags 0x4 iosiz 16384 iomem 0xd8000 vector edintr"
.Sh DESCRIPTION
The
.Nm ed
diff --git a/share/man/man4/man4.i386/eg.4 b/share/man/man4/man4.i386/eg.4
new file mode 100644
index 000000000000..9e96270b2a7a
--- /dev/null
+++ b/share/man/man4/man4.i386/eg.4
@@ -0,0 +1,72 @@
+.\"
+.\" Copyright (c) 1994 James A. Jegers
+.\" 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. 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.
+.\"
+.\" $Id: eg.4,v 1.5 1997/02/22 13:25:19 peter Exp $
+.\"
+.Dd July 10, 1995
+.Dt EG 4 i386
+.Os
+.Sh NAME
+.Nm eg
+.Nd Ethernet driver for 3Com 3c505 Etherlink+ Ethernet board
+.Sh SYNOPSIS
+.Cd "device eg0 at isa? port 0x310 net irq 5 vector egintr"
+.Sh DESCRIPTION
+The
+.Nm
+interface provides access to a 10 Mb/s Ethernet network via the
+3Com 3c505 board based on the Intel 82586 Ethernet chip.
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "eg%d: configure card command failed"
+For some reason, the driver could not initialize the card. Please check
+the card's IRQ and I/O settings relative to those in the kernel
+configuration file.
+.El
+.Pp
+.Sh BUGS
+Uses the onboard firmware, which is not a good way to do it.
+Doesn't support DMA or high speeds.
+Currently the driver does not support multicast.
+The timeout interval can be quite long (16 seconds) for a 512k board.
+.Sh SEE ALSO
+.Xr ed 4 ,
+.Xr el 4 ,
+.Xr ep 4 ,
+.Xr ie 4 ,
+.Xr intro 4 ,
+.Xr le 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 2.0.5
+coming from NetBSD.
+.Sh AUTHORS
+The
+.Nm
+device driver was written by
+.An Dean Huxley .
+This manual page was written by
+.An James A. Jegers .
diff --git a/share/man/man4/man4.i386/el.4 b/share/man/man4/man4.i386/el.4
index 1e1add5529b9..fe1c78bae1d3 100644
--- a/share/man/man4/man4.i386/el.4
+++ b/share/man/man4/man4.i386/el.4
@@ -21,7 +21,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: el.4,v 1.6 1997/08/12 20:03:54 adam Exp $
+.\" $Id: el.4,v 1.5 1997/02/22 13:25:20 peter Exp $
.\"
.Dd July 10, 1995
.Dt EL 4 i386
@@ -30,7 +30,7 @@
.Nm el
.Nd Ethernet driver for 3Com Etherlink 3C501 device driver
.Sh SYNOPSIS
-.Cd "device el0 at isa? port 0x300 net irq 9"
+.Cd "device el0 at isa? port 0x300 net irq 9 vector elintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/ep.4 b/share/man/man4/man4.i386/ep.4
index c0abf0112cc7..666e2908f6eb 100644
--- a/share/man/man4/man4.i386/ep.4
+++ b/share/man/man4/man4.i386/ep.4
@@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ep.4,v 1.8 1998/01/08 17:09:38 joerg Exp $
+.\" $Id: ep.4,v 1.7 1997/12/22 07:37:50 charnier Exp $
.\"
.Dd February 04, 1993
.Dt EP 4 i386
@@ -36,7 +36,7 @@
.Nm ep
.Nd Ethernet driver for 3Com Etherlink III (3c5x9)
.Sh SYNOPSIS
-.Cd "device ep0 at isa? port 0x300 net irq 10"
+.Cd "device ep0 at isa? port 0x300 net irq 10 vector epintr"
.Sh DESCRIPTION
The
.Nm ep
diff --git a/share/man/man4/man4.i386/ex.4 b/share/man/man4/man4.i386/ex.4
index b51769ea2a36..ab7e3fbd690e 100644
--- a/share/man/man4/man4.i386/ex.4
+++ b/share/man/man4/man4.i386/ex.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ex.4,v 1.5 1998/03/12 07:30:32 charnier Exp $
+.\" $Id: ex.4,v 1.4 1997/09/26 17:16:52 msmith Exp $
.\"
.Dd January 19, 1997
.Dt EX 4 i386
@@ -33,7 +33,7 @@
.Nd
Ethernet device driver for the Intel EtherExpress Pro/10 and Pro/10+
.Sh SYNOPSIS
-.Cd "device ex0 at isa? port? net irq ?"
+.Cd "device ex0 at isa? port? net irq? vector exintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/fdc.4 b/share/man/man4/man4.i386/fdc.4
index ae04bc1682a8..6c8861d1166f 100644
--- a/share/man/man4/man4.i386/fdc.4
+++ b/share/man/man4/man4.i386/fdc.4
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: fdc.4,v 1.10 1998/10/22 14:49:00 bde Exp $
+.\" $Id: fdc.4,v 1.8 1997/02/22 13:25:23 peter Exp $
.\"
.Dd August 31, 1994
.Dt FDC 4 i386
@@ -34,9 +34,12 @@
.Nd
PC architecture floppy disk controller driver
.Sh SYNOPSIS
-.Cd "controller fdc0 at isa? port" \&"IO_FD1\&" "bio flags 0x1 irq 6 drq 2"
+.Cd "controller fdc0 at isa? port" \&"IO_FD1\&" bio "flags 0x1" "irq 6" "drq 2" "vector fdintr"
.Cd "disk fd0 at fdc0 drive 0
.Cd "disk fd1 at fdc0 drive 1
+.Pp
+For QIC40 and QIC80 tapedrives controlled by the floppy controller:
+.Cd "tape ft0 at fdc0 drive 2
.Sh DESCRIPTION
This driver provides access to floppy disk drives and QIC40/80 tapedrives.
In /dev for each floppy device a number of minor devices are present. The
@@ -59,11 +62,16 @@ floppy disk device nodes
.It /dev/fd*.<size in kB>
floppy disk device nodes where the trailing number indicates the floppy
capacity
+.It /dev/ft*
+floppy tape (QIC40/80) device nodes
.It Pa /sys/i386/conf/GENERIC
sample generic kernel config file
.It Pa /sys/i386/isa/fd.c
floppy driver source
+.It Pa /sys/i386/isa/ft.c
+floppy tape (QIC40/80 driver source
.El
.Sh SEE ALSO
.Xr fdformat 1 ,
.Xr disktab 5 ,
+.Xr ft 8
diff --git a/share/man/man4/man4.i386/fe.4 b/share/man/man4/man4.i386/fe.4
index 1902932bff3f..1a0e3bee2085 100644
--- a/share/man/man4/man4.i386/fe.4
+++ b/share/man/man4/man4.i386/fe.4
@@ -21,14 +21,14 @@
.\" Contributed by M. Sekiguchi <seki@sysrap.cs.fujitsu.co.jp>.
.\" for fe driver.
.\"
-.\" $Id: fe.4,v 1.10 1998/03/12 07:30:32 charnier Exp $
+.\" $Id: fe.4,v 1.9 1997/02/22 13:25:26 peter Exp $
.Dd March 3, 1996
.Dt FE 4 i386
.Sh NAME
.Nm fe
.Nd Fujitsu MB86960A/MB86965A based Ethernet adapters
.Sh SYNOPSIS
-.Cd "device fe0 at isa? port 0x300 net irq ?"
+.Cm "device fe0 at isa? port 0x300 net irq ? vector feintr"
.Sh DESCRIPTION
The
.Nm fe
diff --git a/share/man/man4/man4.i386/ie.4 b/share/man/man4/man4.i386/ie.4
index d81b7b5ff41b..a18a8acf0f4e 100644
--- a/share/man/man4/man4.i386/ie.4
+++ b/share/man/man4/man4.i386/ie.4
@@ -2,7 +2,7 @@
.\" Copyright (c) 1994, Wilko Bulte
.\" All rights reserved.
.\"
-.\" $Id: ie.4,v 1.6 1998/06/17 08:33:10 jkoshy Exp $
+.\" $Id: ie.4,v 1.5 1998/03/12 07:30:33 charnier Exp $
.\"
.Dd September 23, 1994
.Dt IE 4 i386
@@ -12,7 +12,7 @@
.Nd
ethernet device driver
.Sh SYNOPSIS
-.Cd "device ie0 at isa? port 0x360 net irq 7 iomem 0xd0000"
+.Cd "device ie0 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr"
.Sh DESCRIPTION
The
.Nm ie
diff --git a/share/man/man4/man4.i386/labpc.4 b/share/man/man4/man4.i386/labpc.4
index 350bc6236257..0dba76f5b73d 100644
--- a/share/man/man4/man4.i386/labpc.4
+++ b/share/man/man4/man4.i386/labpc.4
@@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: labpc.4,v 1.5 1998/06/08 06:11:59 jkoshy Exp $
+.\" $Id: labpc.4,v 1.4 1997/03/07 02:49:48 jmg Exp $
.\"
.rm ES
.rm EE
@@ -48,7 +48,7 @@
.Nd
National Instruments LABPC and LABPC+ driver
.Sh SYNOPSIS
-.Cd "device labpc0 at isa? port 260 tty irq 5"
+.Cd "device labpc0 at isa? port 260 tty irq 5 vector labpcintr
.Sh DESCRIPTION
This supports the National Instruments LABPC and LABPC+ \fILow-Cost
Multifunction I/O Board\fP.
diff --git a/share/man/man4/man4.i386/le.4 b/share/man/man4/man4.i386/le.4
index f9ba670a6964..e6888a7f2160 100644
--- a/share/man/man4/man4.i386/le.4
+++ b/share/man/man4/man4.i386/le.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: le.4,v 1.4 1998/03/12 07:30:34 charnier Exp $
+.\" $Id: le.4,v 1.3 1997/02/22 13:25:33 peter Exp $
.\"
.Dd January 19, 1997
.Dt LE 4 i386
@@ -33,7 +33,7 @@
.Nd
DEC EtherWORKS II/III Ethernet device driver
.Sh SYNOPSIS
-.Cd "device le0 at isa? port 0x300 net irq 5 iomem 0xd0000"
+.Cd "device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/lnc.4 b/share/man/man4/man4.i386/lnc.4
index 23c24bece083..9bfc10a1434a 100644
--- a/share/man/man4/man4.i386/lnc.4
+++ b/share/man/man4/man4.i386/lnc.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: lnc.4,v 1.5 1998/10/22 14:12:55 bde Exp $
+.\" $Id: lnc.4,v 1.3 1997/02/22 13:25:34 peter Exp $
.\"
.Dd January 19, 1997
.Dt LNC 4 i386
@@ -33,7 +33,7 @@
.Nd
AMD Lance/PCnet Ethernet device driver
.Sh SYNOPSIS
-.Cd "device lnc0 at isa? port 0x280 net irq 10 drq 0"
+.Cd "device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr"
.Sh DESCRIPTION
The
.Nm
@@ -47,8 +47,6 @@ interface are:
.It Novell NE32-VL
.It Isolan BICC
.It Digital DEPCA
-.It Hewlett Packard Vectra 486/66XM
-.It Hewlett Packard Vectra XU
.El
.Sh DIAGNOSTICS
.Bl -diag
diff --git a/share/man/man4/man4.i386/lp.4 b/share/man/man4/man4.i386/lp.4
index 26010f8ecb1a..37721455f484 100644
--- a/share/man/man4/man4.i386/lp.4
+++ b/share/man/man4/man4.i386/lp.4
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: lp.4,v 1.6 1998/10/15 20:36:55 wosch Exp $
+.\" $Id: lp.4,v 1.5 1997/03/07 02:49:48 jmg Exp $
.\"
.Dd March 4, 1996
.Os
@@ -43,7 +43,7 @@
.Nm ifconfig lp0
.Ar myaddress hisaddress
.Op Fl link0
-.Cd "device lpt0 at isa? port? tty irq 7"
+.Cd "device lpt0 at isa? port? tty irq 7 vector lptintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/lpt.4 b/share/man/man4/man4.i386/lpt.4
index 2c2354ea4b64..85edd0fb98ba 100644
--- a/share/man/man4/man4.i386/lpt.4
+++ b/share/man/man4/man4.i386/lpt.4
@@ -29,7 +29,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" from: lpt.4,v 1.1 1993/08/06 10:34:12 cgd Exp
-.\" $Id: lpt.4,v 1.7 1998/10/15 20:27:26 wosch Exp $
+.\" $Id: lpt.4,v 1.6 1997/03/07 02:49:49 jmg Exp $
.\"
.Dd August 28, 1993
.Dt LPT 4 i386
@@ -40,12 +40,12 @@
Parallel port driver
.Sh SYNOPSIS
For interrupt-driven ports:
-.Cd "device lpt0 at isa? port" \&"IO_LPT1\&" tty irq 7
-.Cd "device lpt1 at isa? port" \&"IO_LPT2\&" tty irq 7
-.Cd "device lpt2 at isa? port" \&"IO_LPT3\&" tty irq 7
+.Cd "device lpt0 at isa? port" \&"IO_LPT1\&" tty irq 7 vector lptintr
+.Cd "device lpt1 at isa? port" \&"IO_LPT2\&" tty irq 7 vector lptintr
+.Cd "device lpt2 at isa? port" \&"IO_LPT3\&" tty irq 7 vector lptintr
.Pp
For BIOS-probed ports:
-.Cd "device lpt0 at isa? port? tty irq 7"
+.Cd "device lpt0 at isa? port? tty irq 7 vector lptintr"
.Pp
For polled ports:
.Cd "device lpt0 at isa? port? tty"
diff --git a/share/man/man4/man4.i386/mcd.4 b/share/man/man4/man4.i386/mcd.4
index 28febc901a7f..79814f311d99 100644
--- a/share/man/man4/man4.i386/mcd.4
+++ b/share/man/man4/man4.i386/mcd.4
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: mcd.4,v 1.5 1998/03/12 07:30:35 charnier Exp $
+.\" $Id: mcd.4,v 1.4 1997/03/21 20:13:46 mpp Exp $
.\"
.Dd December 8, 1994
.Dt MCD 4 i386
@@ -33,7 +33,7 @@
.Nm mcd
.Nd Mitsumi CD-ROM driver
.Sh SYNOPSIS
-.Cd "device mcd0 at isa? port 0x300 bio irq 10"
+.Cd "device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr"
.Sh DESCRIPTION
The
.Nm mcd
diff --git a/share/man/man4/man4.i386/mse.4 b/share/man/man4/man4.i386/mse.4
index 64936b24f483..9e3202cd8818 100644
--- a/share/man/man4/man4.i386/mse.4
+++ b/share/man/man4/man4.i386/mse.4
@@ -10,7 +10,7 @@
.\" this software for any purpose. It is provided "as is"
.\" without express or implied warranty.
.\"
-.\" $Id: mse.4,v 1.4 1997/12/07 08:46:53 yokota Exp $
+.\" $Id: mse.4,v 1.3 1997/03/07 02:49:53 jmg Exp $
.\"
.Dd December 3, 1997
.Dt MSE 4 i386
@@ -20,7 +20,7 @@
.Nd bus and InPort mice driver
.Sh SYNOPSIS
.\" .Cd "options" \&"MSE_XXX=N\&"
-.Cd "device mse0 at isa? port 0x23c tty irq 5"
+.Cd "device mse0 at isa? port" 0x23c tty irq 5 vector mseintr
.Sh DESCRIPTION
The
.Nm
@@ -328,13 +328,13 @@ movement counts as described in
.Em devfs .
.El
.Sh EXAMPLE
-.Dl "device mse0 at isa? port 0x23c tty irq 5"
+.Dl "device mse0 at isa? port" 0x23c tty irq 5 vector mseintr
.Pp
Add the
.Nm
driver at the primary port address with the IRQ 5.
.Pp
-.Dl "device mse1 at isa? port 0x238 tty flags 0x30 irq 4"
+.Dl "device mse1 at isa? port" 0x238 tty flags 0x30 irq 4 vector mseintr
.Pp
Define the
.Nm
diff --git a/share/man/man4/man4.i386/mx.4 b/share/man/man4/man4.i386/mx.4
deleted file mode 100644
index 5c600b8a3f1b..000000000000
--- a/share/man/man4/man4.i386/mx.4
+++ /dev/null
@@ -1,167 +0,0 @@
-.\" Copyright (c) 1997, 1998
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: mx.4,v 1.1 1998/12/04 18:01:22 wpaul Exp $
-.\"
-.Dd November 5, 1998
-.Dt MX 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm mx
-.Nd
-Macronix 98713/98715/98725 fast ethernet device driver
-.Sh SYNOPSIS
-.Cd "device mx0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the Macronix 98713, 98713A, 98715, 98715A and
-98725 fast ethernet controller chips. This includes the NDC
-Communications SOHOware SFA110, the SVEC PN102-TX
-fast ethernet card, and various other adapters.
-.Pp
-The Macronix chips use bus master DMA and are designed to be
-DEC 'tulip' workalikes. The original 98713 had an MII bus for
-controlling an external PHY, however the 98713A and up use an
-internal transceiver with NWAY support. The Macronix parts are
-advertised as being register compatible with the DEC 21x4x
-controllers. All of the Macronix controllers support both
-10 and 100Mbps speeds in either full or half duplex.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options.
-The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-Note that the 100baseTX media type is only available if supported
-by the adapter.
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "mx%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "mx%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "mx%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "mx%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "mx%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "mx%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Rs
-.%T Macronix 98713/A, 98715/A and 98725 data sheets
-.%O http://www.macronix.com
-.Re
-.Rs
-.%T Macronix 98713/A and 98715/A app notes
-.%O http://www.macronix.com
-.Re
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
-.Sh BUGS
-The Macronix application notes claim that in order to put the
-chips in normal operation, the driver must write a certian magic
-number into the CSR16 register. The numbers are documented in
-the app notes, but the exact meaning of the bits is not.
-.Pp
-The 98713A seems to have a problem with 10Mbps full duplex mode.
-The transmitter works but the receiver tends to produce many
-unexplained errors leading to very poor overall performance. The
-98715A does not exhibit this problem. All other modes on the
-98713A seem to work correctly.
diff --git a/share/man/man4/man4.i386/nca.4 b/share/man/man4/man4.i386/nca.4
new file mode 100644
index 000000000000..687cc37df6a4
--- /dev/null
+++ b/share/man/man4/man4.i386/nca.4
@@ -0,0 +1,71 @@
+.\"Manual pages for FreeBSD generic NCR-5380/NCR-53C400 SCSI driver.
+.\"
+.\"Copyright 1994, Serge Vakulenko (vak@cronyx.ru)
+.\"
+.\"Redistribution and use of this document, with or without
+.\"modification, are permitted provided redistributions must retain
+.\"the above copyright notice and this condition.
+.\"
+.\" $Id$
+.Dd January 9, 1995
+.Dt NCA 4 i386
+.Os FreeBSD
+.Sh NAME
+.Nm nca
+.Nd
+Generic NCR-5380/NCR-53C400 SCSI adapter driver
+.Sh SYNOPSIS
+Trantor 130, with IRQ:
+.Cd "controller nca0 at isa? port 0x350 bio irq 5 vector ncaintr
+.Pp
+Trantor 130, without IRQ:
+.Cd "controller nca0 at isa? port 0x350
+.Pp
+ProAudioSpectrum-16, with IRQ:
+.Cd "controller nca0 at isa? port 0x1f88 bio irq 5 vector ncaintr
+.Cd "controller nca1 at isa? port 0x1f84 bio irq 5 vector ncaintr
+.Cd "controller nca2 at isa? port 0x1f8c bio irq 5 vector ncaintr
+.Cd "controller nca3 at isa? port 0x1e88 bio irq 5 vector ncaintr
+.Pp
+ProAudioSpectrum-16, without IRQ:
+.Cd "controller nca0 at isa? port 0x1f88
+.Cd "controller nca1 at isa? port 0x1f84
+.Cd "controller nca2 at isa? port 0x1f8c
+.Cd "controller nca3 at isa? port 0x1e88
+.Sh DESCRIPTION
+This driver provides access to SCSI devices connected to
+NCR-5380/NCR-53C400 SCSI adapter.
+.Pp
+It's possible to use the adapter without IRQ line.
+The data rate then slightly decreases (by 20-30%).
+.Pp
+The \fBflags\fP keyword in the configuration file can be used to set
+some adapter driver parameters:
+.Pp
+Bits Description
+.br
+------------------------------------------
+.br
+0x01 Disable SCSI bus parity check.
+.Pp
+Tested on the following hardware:
+.br
+ Adapter: Trantor T130
+ Adapter: ProAudioSpectrum16
+.br
+ Streamer: Archive Viper 150
+.br
+ CD-ROM: NEC CDR-25
+ CD-ROM: PLEXTOR CD-ROM PX-4XCH
+.Sh FILES
+.Bl -tag -width Pa -compact
+.It Pa /sys/i386/isa/ncr5380.c
+.It Pa /sys/i386/isa/ic/ncr5380.h
+.It Pa /sys/i386/isa/ic/ncr53400.h
+driver source
+.El
+.Sh SEE ALSO
+.Xr cd 4 ,
+.Xr scsi 4 ,
+.Xr sd 4 ,
+.Xr st 4
diff --git a/share/man/man4/man4.i386/npx.4 b/share/man/man4/man4.i386/npx.4
index 4bbb263a5705..ff79d593308e 100644
--- a/share/man/man4/man4.i386/npx.4
+++ b/share/man/man4/man4.i386/npx.4
@@ -28,7 +28,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" from: npx.4,v 1.1 1993/08/06 10:58:03 cgd Exp
-.\" $Id: npx.4,v 1.4 1997/02/22 13:25:36 peter Exp $
+.\" $Id$
.\"
.Dd August 28, 1993
.Dt NPX 4 i386
@@ -39,7 +39,7 @@
.Sh SYNOPSIS
.Cd "options MATH_EMULATE"
.\" XXX this is awful hackery to get it to work right... -- cgd
-.Cd "device npx0 at isa? port IO_NPX tty irq 13"
+.Cd "device npx0 at isa? port" \&"IO_NPX0\&" tty irq 13 vector npxintr
.Sh DESCRIPTION
The
.Nm npx
diff --git a/share/man/man4/man4.i386/pcf.4 b/share/man/man4/man4.i386/pcf.4
deleted file mode 100644
index d7825dfc353c..000000000000
--- a/share/man/man4/man4.i386/pcf.4
+++ /dev/null
@@ -1,64 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd August 6, 1998
-.Dt PCF 4
-.Os FreeBSD
-.Sh NAME
-.Nm pcf
-.Nd
-Philips I2C bus controller
-.Sh SYNOPSIS
-.Cd "controller pcf0 at isa? port? irq 5"
-.Pp
-For one or more iicbus busses:
-.Cd "controller iicbus0"
-.Sh DESCRIPTION
-The
-.Em pcf
-driver provides support to the Philips PCF8584 I2C controller for the
-.Xr iicbus 4
-system.
-.Pp
-The PCF8584 is an integrated circuit designed in CMOS technology which serves
-as an interface between most standard parallel-bus
-microcontrollers/microprocessors and the serial I2C-bus. The PCF8584
-provides both master and slave functions. Communication with I2C-bus is
-carried out on a byte-wise basis using interrupt or polled handshake. It
-controls all the I2C-bus specific sequences, protocol, arbitration and timing.
-The PCF8584 allows parallel-bus systems to communicate bidirectionally with
-the I2C-bus.
-.Pp
-.Sh SEE ALSO
-.Xr iicbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/man4.i386/pcm.4 b/share/man/man4/man4.i386/pcm.4
index 51f8e179ea63..de715206ae6a 100644
--- a/share/man/man4/man4.i386/pcm.4
+++ b/share/man/man4/man4.i386/pcm.4
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: pcm.4,v 1.1 1998/08/09 19:42:53 jkh Exp $
+.\" $Id: pcm.4,v 1.1 1998/06/03 14:23:06 lr Exp $
.\"
.Dd June 3, 1998
.Dt PCM 4 i386
@@ -32,7 +32,7 @@
.Nm pcm
.Nd FreeBSD audio device driver
.Sh SYNOPSIS
-.Cd "device pcm0 at isa? port? tty irq 5 drq 1 flags 0x15"
+.Cd "device pcm0 at isa? port? tty irq 5 drq 1 flags 0x15 vector pcmintr"
.Sh DESCRIPTION
The
.Nm pcm
diff --git a/share/man/man4/man4.i386/pcvt.4 b/share/man/man4/man4.i386/pcvt.4
index 96ef474f8e34..c7faf0e92a74 100644
--- a/share/man/man4/man4.i386/pcvt.4
+++ b/share/man/man4/man4.i386/pcvt.4
@@ -31,7 +31,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" @(#)pcvt.4, 3.20, Last Edit-Date: [Sun Apr 2 18:23:39 1995]
-.\" $Id: pcvt.4,v 1.12 1998/10/22 14:29:03 bde Exp $
+.\" $Id: pcvt.4,v 1.10 1998/03/12 07:30:35 charnier Exp $
.\"
.\" Man page pcvt(4) created after pcvt_ioctl.h on 13-Jan-93
.\" by Joerg Wunsch
@@ -65,7 +65,17 @@ see
below
.Pc
.Pp
-.Cd "device vt0 at isa? port IO_KBD tty irq 1"
+device
+.Em vt0
+at
+.Em isa?
+port
+.Dq Em IO_KBD
+.Em tty
+irq
+.Em 1
+vector
+.Em pcrint
.Sh DESCRIPTION
.Ss Overview
The
diff --git a/share/man/man4/man4.i386/pn.4 b/share/man/man4/man4.i386/pn.4
deleted file mode 100644
index 813fb5d82cfe..000000000000
--- a/share/man/man4/man4.i386/pn.4
+++ /dev/null
@@ -1,161 +0,0 @@
-.\" Copyright (c) 1997, 1998
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: pn.4,v 1.2 1998/12/05 09:31:25 rnordier Exp $
-.\"
-.Dd November 7, 1998
-.Dt PN 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm pn
-.Nd
-Lite-On 82c168/82c169 PNIC fast ethernet device driver
-.Sh SYNOPSIS
-.Cd "device pn0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the Lite-On 82c168 and 82c169 fast ethernet
-controller chips. This includes the LinkSys LNE100TX, the
-Bay Networks Netgear FA310TX revision D1, the Matrox Networks
-FastNIC 10/100, certain adapters manufactured by D-Link and
-Trendware, and various other commodity fast ethernet cards.
-.Pp
-The Lite-On chips use bus master DMA and are designed to be
-DEC 'tulip' workalikes. Many vendors that formerly based their
-designs around the DEC 21x4x devices are now using the PNIC
-instead. The chips support both an internal transceiver
-and external transceivers via an MII bus. The Lite-On parts are
-advertised as being register compatible with the DEC 21x4x
-controllers, however there are some differences in the way the
-EEPROM and MII access is done. The PNIC controllers support both
-10 and 100Mbps speeds in either full or half duplex.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options.
-The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-Note that the 100baseTX media type is only available if supported
-by the adapter.
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "pn%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "pn%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "pn%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "pn%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "pn%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "pn%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
-.Sh BUGS
-The
-.Nm
-driver currently only supports cards with external transceivers
-connected to the PNIC controller via its MII bus. This is because
-the author had no boards available for testing which made use of the
-internal transceiver. Most of the PNIC implementations on the market
-today use an external PHY, so hopefully this will not present any
-serious problems. Code to support the internal transceiver may be
-added later if hardware becomes available.
diff --git a/share/man/man4/man4.i386/ppc.4 b/share/man/man4/man4.i386/ppc.4
deleted file mode 100644
index 91cb2d3b4353..000000000000
--- a/share/man/man4/man4.i386/ppc.4
+++ /dev/null
@@ -1,112 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd March 5, 1998
-.Dt PPC 4
-.Os FreeBSD
-.Sh NAME
-.Nm ppc
-.Nd
-Parallel port chipset driver
-.Sh SYNOPSIS
-.Cd "controller ppc0 at isa? port? tty irq 7"
-.Pp
-For one or more PPBUS busses:
-.Cd "controller ppbus at ppc0"
-.Sh DESCRIPTION
-The
-.Em ppc
-driver provides low level support to various parallel port chipsets for the
-.Xr ppbus 4
-system.
-.Pp
-During the probe phasis, ppc detects parallel port chipsets and initialize
-private data according to their operating mode: COMPATIBLE,
-NIBBLE, PS/2, EPP, ECP and other mixed modes. If a mode is provided at startup
-throw the flags variable of the boot interface, the operating mode of the
-chipset is forced according to 'flags' and its available modes.
-.Pp
-During attach phasis, ppc allocates a ppbus structure, initializes it and
-calls ppbus attach function.
-.Ss Supported flags
-.Bl -item -offset indent
-.It
-bits 0-4: chipset forced mode(s)
-.Bd -literal
-PPB_COMPATIBLE 0x0 /* Centronics compatible mode */
-PPB_NIBBLE 0x1 /* reverse 4 bit mode */
-PPB_PS2 0x2 /* PS/2 byte mode */
-PPB_EPP 0x4 /* EPP mode, 32 bit */
-PPB_ECP 0x8 /* ECP mode */
-.Ed
-.Pp
-And any mixed values.
-.It
-bit 5: EPP protocol (0 EPP 1.9, 1 EPP 1.7)
-.It
-bit 6: activate IRQ (1 IRQ disabled, 0 IRQ enabled)
-.El
-.Ss Supported chipsets
-Some parallel port chipsets are explicitly supported by ppc: detection and
-initialisation code has been written according to specs datasheets.
-.Bl -bullet -offset indent
-.It
-SMC FDC37C665GT and FDC37C666GT chipsets
-.It
-Natsemi PC873xx-family (PC87332 and PC87306)
-.It
-Winbond W83877xx-family (W83877F and W83877AF)
-.It
-SMC-like chipsets with mixed modes (see
-.Xr ppbus 4 )
-.El
-.Ss Adding support to a new chipset
-You may want to add support for the newest chipset your last motherboard was
-sold with? For the ISA bus, just retrieve the specs of the chipset and
-write the corresponding
-.Fn ppc_mychipset_detect ""
-function.
-Then add an entry to the general purpose
-.Fn ppc_detect ""
-function.
-.Pp
-Your
-.Fn ppc_mychipset_detect ""
-function should ensure that: if the mode field of the
-.Va flags
-boot variable is not null, then the operating
-mode is forced to the given mode and no other mode is available and
-ppb->ppb_avm field contains the available modes of the chipset
-.Sh SEE ALSO
-.Xr ppbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/man4.i386/psm.4 b/share/man/man4/man4.i386/psm.4
index ef215f3bf76c..0c3b7c9a469a 100644
--- a/share/man/man4/man4.i386/psm.4
+++ b/share/man/man4/man4.i386/psm.4
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: psm.4,v 1.12 1998/03/12 07:30:36 charnier Exp $
+.\" $Id: psm.4,v 1.11 1998/01/24 12:14:13 yokota Exp $
.\"
.Dd December 3, 1997
.Dt PSM 4 i386
@@ -40,7 +40,7 @@ PS/2 mouse style pointing device driver
.Cd "options" \&"KBD_MAXWAIT=N\&"
.Cd "options" \&"PSM_DEBUG=N\&"
.Cd "options" \&"KBDIO_DEBUG=N\&"
-.Cd "device psm0 at isa? port IO_KBD conflicts tty irq 12"
+.Cd "device psm0 at isa? port" \&"IO_KBD\&" conflicts tty irq 12 vector psmintr
.Sh DESCRIPTION
The
.Nm
@@ -48,7 +48,7 @@ driver provides support for the PS/2 mouse style pointing device.
Currently there can be only one
.Nm
device node in the system.
-.Em port IO_KBD
+.Em port \&"IO_KBD\&"
and
.Em conflicts
are required,
@@ -570,14 +570,15 @@ movement counts as described in
.El
.Sh EXAMPLE
.Dl "options" \&"PSM_HOOKAPM\&"
-.Dl "device psm0 at isa? port IO_KBD conflicts tty irq 12"
+.Dl "device psm0 at isa? port" \&"IO_KBD\&" conflicts tty irq 12 vector psmintr
.Pp
Add the
.Nm
driver to the kernel with the optional code to stimulate the pointing device
after the `resume' event.
.Pp
-.Dl "device psm0 at isa? port IO_KBD conflicts tty flags 0x024 irq 12"
+.Dl "device psm0 at isa? port" \&"IO_KBD\&" conflicts tty flags 0x024 irq 12
+.Dl vector psmintr
.Pp
Set the device resolution high (4) and the acceleration factor to 2.
.Sh DIAGNOSTICS
diff --git a/share/man/man4/man4.i386/rdp.4 b/share/man/man4/man4.i386/rdp.4
deleted file mode 100644
index fb70f402aa93..000000000000
--- a/share/man/man4/man4.i386/rdp.4
+++ /dev/null
@@ -1,181 +0,0 @@
-.\"
-.\"
-.\" Copyright (c) 1997 Joerg Wunsch
-.\"
-.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
-.\"
-.\" $Id: rdp.4,v 1.1.1.1 1998/12/21 12:43:35 j Exp $
-.\"
-.\"
-.\" " (emacs disconfusion)
-.Dd December 21, 1998
-.Dt RDP 4 i386
-.Os
-.Sh NAME
-.Nm rdp
-.Nd Ethernet driver for RealTek RTL 8002 pocket ethernet
-.Sh SYNOPSIS
-.Cd "device rdp0 at isa? port 0x378 net irq 7"
-.Cd "device rdp0 at isa? port 0x378 net irq 7 flags 0x2"
-.Sh DESCRIPTION
-The
-.Nm
-device driver supports RealTek RTL 8002-based pocket ethernet adapters,
-connected to a standard parallel port.
-.Pp
-These adapters seem to belong to the cheaper choices among pocket
-ethernet adapters. The RTL 8002 is the central part, containing an
-interface to BNC and UTP (10 Mbit/s) media, as well as a host
-interface that is designed to talk to standard parallel printer
-adapters. For the full ethernet adapter to work, it is completed by
-an external RAM used as the Tx and Rx packet buffer (16 K x 4 for the
-RTL 8002), and an EEPROM to hold the assigned ethernet hardware
-address. For the RTL 8002, the EEPROM can be either a standard 93C46
-serial EEPROM (which seems to be a common choice), or a 74S288
-parallel one. The latter variant needs the device configuration flag
-0x1 in order to work.
-.Pp
-Since standard printer adapters seem to vary wildly among their timing
-requirements, there are currently two possible choices for the way
-data are being exchanged between the pocket ethernet adapter and the
-printer interface. The default is the fastest mode the RTL 8002
-supports. If the printer adapter to use is particularly slow (which
-can be noticed by watching the ethernet wire for crippled packets, or
-by not seeing correclty received packets), the configuration flag 0x2
-can be set in order to throttle down the
-.Nm
-driver. Note that in fast mode, the data rate is assymetric, sending
-is a little faster (up to two times) than receiving. Rates like 150
-KB/s for sending and 80 KB/s for receiving are common. For slow mode,
-both rates are about the same, and in the range of 50 KB/s through 70
-KB/s. As always, your mileage may vary.
-.Pp
-In case the adapter isn't recognized at boot-time, setting the
-.Em bootverbose
-flag
-.Pq Ql Fl v
-might help in diagnosing the reason. Since the RTL 8002 requires
-the availability of a working interrupt for the printer adapter (unlike
-the
-.Xr lpt 4
-driver), the
-.Nm
-driver fails to attach if the ethernet adapter cannot assert an
-interrupt at probe time.
-.Pp
-The RTL 8002 doesn't support (hardware) multicast.
-.Pp
-The
-.Nm
-driver internally sets a flag so it gets probed very early. This way,
-it is possible to configure both, an
-.Nm
-driver as well as an
-.Xr lpt 4
-driver into the same kernel. If no RTL 8002 hardware is present, probing
-will eventually detect the printer driver.
-.Sh DIAGNOSTICS
-.Pp
-.Dl "rdp0: configured IRQ (7) cannot be asserted by device"
-.Pp
-The probe routine was unable to get the RTL 8002 asserting an interrupt
-request through the printer adapter.
-.Pp
-.Dl "rdp0: failed to find a valid hardware address in EEPROM"
-.Pp
-Since there doesn't seem to be a standard place for storing the hardware
-ethernet address within the EEPROM, the
-.Nm
-driver walks the entire (serial) EEPROM contents until it finds something
-that looks like a valid ethernet hardware address, based on the IEEE's
-OUI assignments. This diagnostic tells the driver was unable to find
-one. Note: it might as well be the current adapter is one of the rare
-examples with a 74S288 EEPROM, so
-.Ql flags 0x1
-should be tried.
-.Pp
-.Dl "rdp0: Device timeout"
-.Pp
-After initiating a packet transmission, the ethernet adapter didn't
-return a notification of the (successful or failed) transmission. The
-hardware is likely to be wedged, and is being reset.
-.Pp
-.Sh SEE ALSO
-.Xr lpt 4 ,
-.Xr ifconfig 8
-.Sh AUTHORS
-This driver was written by
-.ie t J\(:org Wunsch,
-.el Joerg Wunsch,
-based on RealTek's packet driver for the RTL 8002, as well as on some
-description of the successor chip, RTL 8012, RealTek was gratefully
-providing.
-.Sh BUGS
-There are certainly many of them.
-.Pp
-Since the
-.Nm
-driver wants to probe its hardware at boot-time, the adapter needs
-to be present then in order to be detected.
-.Pp
-Only two out of the eight different speed modes RealTek's packet
-driver could handle are implemented. Thus there might be hardware
-where even the current slow mode is too fast.
-.Pp
-There should be a DMA transfer test in the probe routine that figures
-out the usable mode automatically.
-.Pp
-Abusing a standard printer interface for data exchange is error-prone.
-Occasional stuck hardware shouldn't surprise too much, hopefully the
-timeout routine will catch these cases. Flood-pinging is a good
-example of triggering this problem. Likewise, albeit BPF is of course
-supported, it's certainly a bad idea attempting to watch a crowded
-ethernet wire using promiscuous mode.
-.Pp
-Since the RTL 8002 has only 4 KB of Rx buffer space (2 x 2 KB are used
-as Tx buffers), the usual NFS deadlock with large packets arriving too
-quickly could happen if a machine using the
-.Nm
-driver NFS-mounts some fast server with the standard NFS blocksize of
-8 KB. (Since NFS can only retransmit entire NFS packets, the same
-packet will be retransmitted over and over again.)
-.Pp
-The heuristic to find out the ethernet hardware address from the
-EEPROM sucks, but seems to be the only sensible generic way that
-doesn't depend on the actual location in EEPROM. RealTek's sample
-driver placed it directly at address 0, other vendors picked something
-like 15, with other junk in front of it that must not be confused with
-a valid ethernet address.
-.Pp
-The driver should support the successor chip RTL 8012, which seems to
-be available and used these days. (The RTL 8002 is already somewhat
-aged, around 1992/93.) The RTL 8012 offers support for advanced
-printer adapter hardware, like bidirectional SPP, or EPP, which could
-speed up the transfers substantially. The RTL 8012 also supports
-hardware multicast, and has the ability to address 64 K x 4 packet
-buffer RAM.
-.Pp
-The driver should be layered upon the ppc driver, instead of working
-standalone, and should be available as a loadable module, so the
-device probing can be deferred until the pocket ethernet adapter has
-actually been attached.
diff --git a/share/man/man4/man4.i386/rl.4 b/share/man/man4/man4.i386/rl.4
deleted file mode 100644
index 32f54c960e63..000000000000
--- a/share/man/man4/man4.i386/rl.4
+++ /dev/null
@@ -1,192 +0,0 @@
-.\" Copyright (c) 1997, 1998
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: rl.4,v 1.6 1998/12/07 18:14:30 wpaul Exp $
-.\"
-.Dd November 4, 1998
-.Dt RL 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm rl
-.Nd
-RealTek 8129/8139 fast ethernet device driver
-.Sh SYNOPSIS
-.Cd "device rl0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the RealTek 8129 and 8139 fast ethernet controller
-chips. This includes the Allied Telesyn AT2550, Genius GF100TXR,
-NDC Communications NE100TX-E, OvisLink LEF-8129TX, OvisLink LEF-8139TX,
-Netronix Inc. EA-1210 NetEther 10/100, KTX-9130TX 10/100 Fast Ethernet,
-Encore ENL832-TX 10/100 M PCI, Longshine LCS-8038TX-R, the
-SMC EZ Card 10/100 PCI 1211-TX, and various other cheap adapters.
-It also supports the Accton EN1207D which has a
-chip labeled MPX5030 (or MPX5038) which appears to be a RealTek workalike.
-.Pp
-The RealTek controllers use bus master DMA but do not use a
-descriptor-based data transfer mechanism. The receiver uses a
-single fixed size ring buffer from which packets must be copied
-into mbufs. For transmission, there are only four outbound packet
-address registers which require all outgoing packets to be stored
-as contiguous buffers. Furthermore, outbound packet buffers must
-be longword aligned or else transmission will fail.
-.Pp
-The 8129 differs from the 8139 in that the 8139 has an internal
-PHY which is controlled through special direct access registers
-whereas the 8129 uses an external PHY via an MII bus. The 8139
-supports both 10 and 100Mbps speeds in either full or half duplex.
-The 8129 can support the same speeds and modes given an appropriate
-PHY chip.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options. This is only
-supported if the PHY chip attached to the RealTek controller
-supports NWAY autonegotiation. The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-Note that the 100baseTX media type is only available if supported
-by the adapter.
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "rl%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "rl%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "rl%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "rl%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "rl%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "rl%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Rs
-.%B The RealTek 8129 and 8139 datasheets
-.%O ftp.realtek.com.tw:/lancard/data sheet
-.Re
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
-.Sh BUGS
-Since outbound packets must be longword aligned, the transmit
-routine has to copy an unaligned packet into an mbuf cluster buffer
-before transmission. The driver abuses the fact that the cluster buffer
-pool is allocated at system startup time in a contiguous region starting
-at a page boundary. Since cluster buffers are 2048 bytes, they are
-longword aligned by definition. The driver probably should not be
-depending on this characteristic.
-.Pp
-The RealTek data sheets are of especially poor quality: the grammar
-and spelling are awful and there is a lot of information missing,
-particularly concerning the receiver operation. One particularly
-important fact that the data sheets fail to mention relates to the
-way in which the chip fills in the receive buffer. When an interrupt
-is posted to signal that a frame has been received, it is possible that
-another frame might be in the process of being copied into the receive
-buffer while the driver is busy handling the first one. If the driver
-manages to finish processing the first frame before the chip is done
-DMAing the rest of the next frame, the driver may attempt to process
-the next frame in the buffer before the chip has had a chance to finish
-DMAing all of it.
-.Pp
-The driver can check for an incomplete frame by inspecting the frame
-length in the header preceeding the actual packet data: an incomplete
-frame will have the magic length of 0xFFF0. When the driver encounters
-this value, it knows that it has finished processing all currently
-available packets. Neither this magic value nor its significance are
-documented anywhere in the RealTek data sheets.
diff --git a/share/man/man4/man4.i386/sb.4 b/share/man/man4/man4.i386/sb.4
index 9c74e9e86f03..4ec2bfcb5887 100644
--- a/share/man/man4/man4.i386/sb.4
+++ b/share/man/man4/man4.i386/sb.4
@@ -23,7 +23,7 @@ For all sound cards supported with the sb driver this is needed:
.Pp
For the SoundBlaster, SB Pro, SoundBlaster16, or the Pro Audio Spectrum
(emulating SB):
-.Cd "device sb0 at isa? port 0x220 irq 7 drq 1"
+.Cd "device sb0 at isa? port 0x220 irq 7 drq 1 vector sbintr"
.Pp
For specific SB16 support:
.Cd "device sbxvi0 at isa? drq 5"
diff --git a/share/man/man4/man4.i386/sea.4 b/share/man/man4/man4.i386/sea.4
new file mode 100644
index 000000000000..1e5b1cc1702a
--- /dev/null
+++ b/share/man/man4/man4.i386/sea.4
@@ -0,0 +1,90 @@
+.\"Manual pages for FreeBSD Seagate ST01/02, Future Domain TMC-885,
+.\"TMC-950 SCSI driver.
+.\"
+.\"Copyright 1994, Serge Vakulenko (vak@cronyx.ru)
+.\"
+.\"Redistribution and use of this document, with or without
+.\"modification, are permitted provided redistributions must retain
+.\"the above copyright notice and this condition.
+.\"
+.\" $Id: sea.4,v 1.6 1997/02/22 13:25:40 peter Exp $
+.Dd December 25, 1994
+.Dt SEA 4 i386
+.Os FreeBSD
+.Sh NAME
+.Nm sea
+.Nd
+Seagate ST01/ST02, Future Domain TMC-885, TMC-950 SCSI adapter driver
+.Sh SYNOPSIS
+With explicit memory and IRQ parameters:
+.Cd "controller sea0 at isa? bio irq 5 iomem 0xc8000 vector seaintr
+.Pp
+With automatic memory address detection and no IRQ:
+.Cd "controller sea0 at isa?
+.Pp
+.Cd "controller scbus0
+.Pp
+For each connected disk:
+.Cd "device sd0
+.Pp
+For each connected tape device:
+.Cd "device st0
+.Pp
+For one or more cdroms:
+.Cd "device cd0
+.Sh DESCRIPTION
+This driver provides access to SCSI devices connected to Seagate ST01/ST02 or
+Future Domain TMC-885, TMC-950 SCSI adapter.
+.Pp
+It's possible to use the Seagate ST01/ST02 adapter without IRQ line.
+The data rate then slightly decreases (by 20-30%).
+.Pp
+The \fBflags\fP keyword in the configuration file can be used to set
+some adapter driver parameters:
+.Pp
+Bits Description
+.br
+------------------------------------------
+.br
+0x01 Disable SCSI bus parity check.
+.Pp
+The original Seagate ST02
+BIOS cannot coexist with IDE or any other disk controller
+because it does not share BIOS disk drive numbers (80h, 81h)
+with others. The probing code of the driver allows using ST02 controller
+without BIOS: just unplug the ST02 BIOS chip from the board.
+.Pp
+Another problem is the floppy adapter on ST02 which could not be
+disabled by jumpers. The ST02 adapter it the best as a cheap solution
+for attaching the tape and CD-ROM drives, and an extra floppy controller
+is just a headache. There exist a simple workaround: cutting off
+the AEN signal (A11 contact on ISA connector). AEN then goes high and
+disables the floppy adapter port address decoder.
+.Pp
+Some motherboards also have a problem with ST02 conflicting with IDE during
+IDE data write phase. It seems than ST02 makes some noise
+on /IOW line. The /IOW line is used only for floppy controller
+part of ST02, and because it's rarely needed, cutting off the /IOW
+(contact B13) will help.
+.Pp
+Tested on the following hardware:
+.br
+ Adapter: Seagate ST02
+.br
+ Disk: HP D1686
+.br
+Streamers: Archive Viper 150, Wangtek 5525
+.br
+ CD-ROMs: Toshiba XM-3401, NEC CDR-25
+.Pp
+Maximum data rate is about 270-280 kbytes/sec (on 386DX/40).
+.Sh FILES
+.Bl -tag -width Pa -compact
+.It Pa /sys/i386/isa/seagate.c
+driver source
+.El
+.Sh SEE ALSO
+.Xr cd 4 ,
+.Xr scsi 4 ,
+.Xr sd 4 ,
+.Xr st 4
diff --git a/share/man/man4/man4.i386/sio.4 b/share/man/man4/man4.i386/sio.4
index 4cc36bd8e3aa..de4d3c75767f 100644
--- a/share/man/man4/man4.i386/sio.4
+++ b/share/man/man4/man4.i386/sio.4
@@ -34,7 +34,7 @@
.\"
.\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91
.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
-.\" $Id: sio.4,v 1.27 1998/06/08 06:11:59 jkoshy Exp $
+.\" $Id: sio.4,v 1.26 1998/05/31 11:16:09 bde Exp $
.\"
.Dd October 10, 1995
.Dt SIO 4 i386
@@ -45,23 +45,23 @@
fast interrupt driven asynchronous serial communications interface
.Sh SYNOPSIS
For standard ports:
-.Cd "device sio0 at isa? port" \&"IO_COM1\&" tty irq 4
-.Cd "device sio1 at isa? port" \&"IO_COM2\&" tty irq 3
-.Cd "device sio2 at isa? port" \&"IO_COM3\&" tty irq 5
-.Cd "device sio3 at isa? port" \&"IO_COM4\&" tty irq 9
+.Cd "device sio0 at isa? port" \&"IO_COM1\&" tty irq 4 vector siointr
+.Cd "device sio1 at isa? port" \&"IO_COM2\&" tty irq 3 vector siointr
+.Cd "device sio2 at isa? port" \&"IO_COM3\&" tty irq 5 vector siointr
+.Cd "device sio3 at isa? port" \&"IO_COM4\&" tty irq 9 vector siointr
.Pp
For AST compatible multiport cards with 4 ports:
.Cd "options" \&"COM_MULTIPORT\&"
.Cd "device sio4 at isa? port 0x2a0 tty flags 0x701"
.Cd "device sio5 at isa? port 0x2a8 tty flags 0x701"
.Cd "device sio6 at isa? port 0x2b0 tty flags 0x701"
-.Cd "device sio7 at isa? port 0x2b8 tty flags 0x701 irq 12"
+.Cd "device sio7 at isa? port 0x2b8 tty flags 0x701 irq 12 vector siointr"
.Pp
For Boca Board compatible multiport cards with 8 ports:
.Cd "options" \&"COM_MULTIPORT\&"
.Cd "device sio4 at isa? port 0x100 tty flags 0xb05"
.Cd "..."
-.Cd "device sio11 at isa? port 0x138 tty flags 0xb05 irq 12"
+.Cd "device sio11 at isa? port 0x138 tty flags 0xb05 irq 12 vector siointr"
.Pp
For Hayes ESP cards:
.Cd "options" \&"COM_ESP\&"
@@ -161,7 +161,9 @@ The same master port must be specified for all ports in a group.
.Pp
The
.Em irq
-specification must be given for master ports
+and
+.Em vector
+specifications must be given for master ports
and for ports that are not part of an IRQ sharing group,
and not for other ports.
.Pp
diff --git a/share/man/man4/man4.i386/sr.4 b/share/man/man4/man4.i386/sr.4
index 8c84f6fec0f5..c4d31d3228ea 100644
--- a/share/man/man4/man4.i386/sr.4
+++ b/share/man/man4/man4.i386/sr.4
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: sr.4,v 1.9 1998/06/08 06:11:59 jkoshy Exp $
+.\" $Id: sr.4,v 1.8 1998/03/12 07:30:38 charnier Exp $
.\"
.Dd July 4, 1996
.Dt SR 4 i386
@@ -37,8 +37,8 @@
.Nm sr
.Nd synchronous RISCom/N2 / WANic 400/405 device driver.
.Sh SYNOPSIS
-.Cd "device sr0 at isa? port 0x300 net irq 10 iomem 0xd0000"
-.Cd "device sr1 at isa? port 0x310 net irq 11 flags 0x1 iomem 0xd0000"
+.Cd "device sr0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector srintr"
+.Cd "device sr1 at isa? port 0x310 net irq 11 flags 0x1 iomem 0xd0000 vector srintr"
.Pp
.Cd "pseudo-device sppp"
.Sh DESCRIPTION
diff --git a/share/man/man4/man4.i386/tl.4 b/share/man/man4/man4.i386/tl.4
index b967d5ea4a60..7491592c2b0e 100644
--- a/share/man/man4/man4.i386/tl.4
+++ b/share/man/man4/man4.i386/tl.4
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: tl.4,v 1.1 1998/05/21 03:20:39 wpaul Exp $
+.\" $Id: tl.4,v 1.3 1998/05/06 05:40:56 wpaul Exp $
.\"
.Dd May 1, 1998
.Dt TL 4 i386
@@ -105,7 +105,7 @@ the network connection (cable).
.It "tl%d: no memory for rx list"
The driver failed to allocate an mbuf for the receiver ring.
.It "tl%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
+The driver fauled to allocate an mbuf for the transmitter ring when
allocating a pad buffer or collapsing an mbuf chain into a cluster.
.El
.Sh SEE ALSO
diff --git a/share/man/man4/man4.i386/tx.4 b/share/man/man4/man4.i386/tx.4
index 329ce0c878aa..2a12c0390857 100644
--- a/share/man/man4/man4.i386/tx.4
+++ b/share/man/man4/man4.i386/tx.4
@@ -79,7 +79,7 @@ While reseting, driver failed to stop device correctly.
.Sh BUGS
.Pp
The multicast packets filtering is not supported.
-Only one PHY was really tested (Quality Semiconductor QS6612).
+Only one PHY was realy tested (Quality Semiconductor QS6612).
.Sh SEE ALSO
.Xr arp 4 ,
.Xr netintro 4 ,
diff --git a/share/man/man4/man4.i386/uha.4 b/share/man/man4/man4.i386/uha.4
new file mode 100644
index 000000000000..f51f121afe78
--- /dev/null
+++ b/share/man/man4/man4.i386/uha.4
@@ -0,0 +1,73 @@
+.\"
+.\" Copyright (c) 1994 Wilko Bulte
+.\" 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 withough 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.
+.\"
+.\" $Id: uha.4,v 1.8 1997/02/22 13:25:45 peter Exp $
+.Dd August 31, 1994
+.Dt UHA 4 i386
+.Os FreeBSD
+.Sh NAME
+.Nm uha
+.Nd
+UltraStor SCSI host adapter driver
+.Sh SYNOPSIS
+For ULTRA 24F controllers in EISA mode:
+.Cd "controller uha0 at isa? bio irq ? vector uhaintr
+.Cd "controller scbus0
+.Pp
+For ULTRA 14F and 34F controllers:
+.Cd "controller uha0 at isa? port" \&"IO_UHA0\&" bio irq ? drq 5 vector uhaintr
+.Cd "controller scbus0
+.Pp
+For each disk:
+.Cd "device sd0
+.Pp
+For each tape device:
+.Cd "device st0
+.Pp
+For one or more cdroms:
+.Cd "device cd0
+.Sh DESCRIPTION
+This driver provides access to SCSI devices connected to an UltraStor
+ULTRA 14F, ULTRA 24F or ULTRA 34F host adapter.
+.Pp
+Note that for an ULTRA 24F in EISA mode no I/O addresses or DMA channels
+are required in the kernel config file. If they are present, the driver
+will correctly find the ULTRA 24F, but you tie up precious DMA channels
+and I/O ranges which are not used by the card.
+The ULTRA 24F uses EISA slot specific I/O which is configured
+automatically.
+.Sh FILES
+.Bl -tag -width Pa -compact
+.It Pa /sys/i386/conf/GENERIC
+sample generic kernel config file for Bustek and UltraStor based systems
+.It Pa /sys/i386/isa/ultra14f.c
+driver source
+.El
+.Sh SEE ALSO
+.Xr cd 4 ,
+.Xr scsi 4 ,
+.Xr sd 4 ,
+.Xr st 4
diff --git a/share/man/man4/man4.i386/vr.4 b/share/man/man4/man4.i386/vr.4
deleted file mode 100644
index ee4a2b598a09..000000000000
--- a/share/man/man4/man4.i386/vr.4
+++ /dev/null
@@ -1,164 +0,0 @@
-.\" Copyright (c) 1997, 1998
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: vr.4,v 1.1 1998/12/04 18:01:22 wpaul Exp $
-.\"
-.Dd November 22, 1998
-.Dt VR 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm vr
-.Nd
-VIA Technologies VT3043 and VT86C100A ethernet device driver
-.Sh SYNOPSIS
-.Cd "device vr0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the VIA Technologies VT3043 Rhine I and
-VT86C100A Rhine II fast ethernet controller chips. This includes
-the D-Link DFE530-TX and various other commodity fast ethernet
-cards.
-.Pp
-The VIA Rhine chips use bus master DMA and have a software interface
-designed to resemble that of the DEC 21x4x "tulip" chips. The major
-differences are that the receive filter in the Rhine chips is
-much simpler and is programmed through registers rather than by
-downloading a special setup frame through the transmit DMA engine,
-and that transmit and receive DMA buffers must be longword
-aligned. The Rhine chips are meant to be interfaced with external
-physical layer devices via an MII bus. They support both
-10 and 100Mbps speeds in either full or half duplex.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options.
-The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-Note that the 100baseTX media type is only available if supported
-by the adapter.
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "vr%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "vr%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "vr%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "vr%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "vr%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "vr%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Rs
-.%T The VIA Technologies VT86C100A data sheet
-.%O http://www.via.com.tw
-.Re
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
-.Sh BUGS
-The
-.Nm
-driver always copies transmit mbuf chains into longword-aligned
-buffers prior to transmission in order to pacify the Rhine chips.
-If buffers are not aligned correctly, the chip will round the
-supplied buffer address and begin DMAing from the wrong location.
-This buffer copying impairs transmit performance on slower systems but can't
-be avoided. On faster machines (e.g. a Pentium II), the performance
-impact is much less noticable.
diff --git a/share/man/man4/man4.i386/wb.4 b/share/man/man4/man4.i386/wb.4
deleted file mode 100644
index d7171b615190..000000000000
--- a/share/man/man4/man4.i386/wb.4
+++ /dev/null
@@ -1,159 +0,0 @@
-.\" Copyright (c) 1997, 1998
-.\" Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Bill Paul.
-.\" 4. Neither the name of the author nor the names of any co-contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
-.\" 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.
-.\"
-.\" $Id: wb.4,v 1.1 1998/12/04 18:01:22 wpaul Exp $
-.\"
-.Dd November 4, 1998
-.Dt WB 4 i386
-.Os FreeBSD
-.Sh NAME
-.Nm wb
-.Nd
-Winbond W89C840F fast ethernet device driver
-.Sh SYNOPSIS
-.Cd "device wb0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for PCI ethernet adapters and embedded
-controllers based on the Winbond W89C840F fast ethernet controller
-chip. This includes the Trendware TE100-PCIE and various other cheap
-boards. The 840F should not be confused with the 940F, which is
-an NE2000 clone and only supports 10Mbps speeds.
-.Pp
-The Winbond controller uses bus master DMA and is designed to be
-a DEC 'tulip' workalike. It differs from the standard DEC design
-in several ways: the control and status registers are spaced 4
-bytes apart instead of 8, and the receive filter is programmed through
-registers rather than by downloading a special setup frame via
-the transmit DMA engine. Using an external PHY, the Winbond chip
-supports both 10 and 100Mbps speeds in either full or half duplex.
-.Pp
-The
-.Nm
-driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options. This is only
-supported if the PHY chip attached to the Winbond controller
-supports NWAY autonegotiation. The user can manually override
-the autoselected mode by adding media options to the
-.Pa /etc/rc.conf
-fine.
-.It 10baseT/UTP
-Set 10Mbps operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex modes.
-.It 100baseTX
-Set 100Mbps (fast ethernet) operation. The
-.Ar mediaopt
-option can also be used to select either
-.Ar full-duplex
-or
-.Ar half-duplex
-modes.
-.El
-.Pp
-The
-.Nm
-driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Force full duplex operation
-.It half-duplex
-Force half duplex operation.
-.El
-.Pp
-Note that the 100baseTX media type is only available if supported
-by the adapter.
-For more information on configuring this device, see
-.Xr ifconfig 8 .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "wb%d: couldn't map memory"
-A fatal initialization error has occurred.
-.It "wb%d: couldn't map interrupt"
-A fatal initialization error has occurred.
-.It "wb%d: watchdog timeout"
-The device has stopped responding to the network, or there is a problem with
-the network connection (cable).
-.It "wb%d: no memory for rx list"
-The driver failed to allocate an mbuf for the receiver ring.
-.It "wb%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
-allocating a pad buffer or collapsing an mbuf chain into a cluster.
-.It "wb%d: chip is in D3 power state -- setting to D0"
-This message applies only to adapters which support power
-management. Some operating systems place the controller in low power
-mode when shutting down, and some PCI BIOSes fail to bring the chip
-out of this state before configuring it. The controller loses all of
-its PCI configuration in the D3 state, so if the BIOS does not set
-it back to full power mode in time, it won't be able to configure it
-correctly. The driver tries to detect this condition and bring
-the adapter back to the D0 (full power) state, but this may not be
-enough to return the driver to a fully operational condition. If
-you see this message at boot time and the driver fails to attach
-the device as a network interface, you will have to perform second
-warm boot to have the device properly configured.
-.Pp
-Note that this condition only occurs when warm booting from another
-operating system. If you power down your system prior to booting
-.Fx ,
-the card should be configured correctly.
-.El
-.Sh SEE ALSO
-.Xr arp 4 ,
-.Xr netintro 4 ,
-.Xr ifconfig 8
-.Sh HISTORY
-The
-.Nm
-device driver first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-The
-.Nm
-driver was written by
-.An Bill Paul Aq wpaul@ctr.columbia.edu .
-.Sh BUGS
-The Winbond chip seems to behave strangely in some cases when the
-link partner switches modes. If for example both sides are set to
-10Mbps half-duplex, and the other end is changed to 100Mbps
-full-duplex, the Winbond's receiver suddenly starts writing trash
-all over the RX descriptors. The
-.Nm
-driver handles this by forcing a reset of both the controller
-chip and attached PHY. This is drastic, but it appears to be the
-only way to recover properly from this condition.
diff --git a/share/man/man4/man4.i386/wd.4 b/share/man/man4/man4.i386/wd.4
index 27547cedcf8d..123f53b8650a 100644
--- a/share/man/man4/man4.i386/wd.4
+++ b/share/man/man4/man4.i386/wd.4
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: wd.4,v 1.9 1998/06/08 06:11:59 jkoshy Exp $
+.\" $Id: wd.4,v 1.8 1998/04/09 22:31:47 sos Exp $
.\"
.Dd August 31, 1994
.Dt WD 4 i386
@@ -34,7 +34,7 @@
.Nd
Generic WD100x/IDE diskcontroller driver
.Sh SYNOPSIS
-.Cd "controller wdc0 at isa? port" \&"IO_WD1\&" bio irq 14
+.Cd "controller wdc0 at isa? port" \&"IO_WD1\&" bio irq 14 vector wdintr
.Cd "disk wd0 at wdc0 drive 0
.Cd "disk wd1 at wdc0 drive 1
.Pp
diff --git a/share/man/man4/man4.i386/wl.4 b/share/man/man4/man4.i386/wl.4
index 336380f118a2..f954ccbed10f 100644
--- a/share/man/man4/man4.i386/wl.4
+++ b/share/man/man4/man4.i386/wl.4
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: wl.4,v 1.5 1998/08/31 16:41:07 wosch Exp $
+.\" $Id: wl.4,v 1.4 1998/06/08 06:11:59 jkoshy Exp $
.Dd July 7, 1997
.Dt WL 4 i386
.Os FreeBSD
@@ -36,7 +36,7 @@
.Nm wl
.Nd T1 speed ISA/radio lan card
.Sh SYNOPSIS
-.Cd "device wl0 at isa? port 0x300 net irq 5"
+.Cd "device wl0 at isa? port 0x300 net irq 5 vector wlintr"
.Sh DESCRIPTION
The
.Nm wl
diff --git a/share/man/man4/man4.i386/wt.4 b/share/man/man4/man4.i386/wt.4
index b83d6b4d433a..3db0f92ad491 100644
--- a/share/man/man4/man4.i386/wt.4
+++ b/share/man/man4/man4.i386/wt.4
@@ -21,7 +21,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: wt.4,v 1.3 1997/03/07 02:50:01 jmg Exp $
+.\" $Id$
.\"
.Dd July 10, 1995
.Dt WT 4 i386
@@ -31,7 +31,7 @@
.Nd
Archive/Wangtek cartridge tape driver
.Sh SYNOPSIS
-.Cd "device wt0 at isa? port 0x300 bio irq 5 drq 1"
+.Cd "device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr"
.Sh DESCRIPTION
The
.Nm wt
diff --git a/share/man/man4/man4.i386/xl.4 b/share/man/man4/man4.i386/xl.4
index cb2ca676b192..2d62c23f1ab1 100644
--- a/share/man/man4/man4.i386/xl.4
+++ b/share/man/man4/man4.i386/xl.4
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: xl.4,v 1.2 1998/12/05 09:31:25 rnordier Exp $
+.\" $Id: tl.4,v 1.3 1998/05/06 05:40:56 wpaul Exp $
.\"
.Dd August 16, 1998
.Dt XL 4 i386
@@ -47,7 +47,7 @@ controllers based on the 3Com "boomerang" and "cyclone" bus-master
Etherlink XL chips. This includes the 3c900-TP, 3c900-COMBO, 3c905-TX,
3c905-T4, 3c905B-TP, 3c905B-T4 and 3c905B-TX, and embedded 3c905-TX
and 3c905B-TX ethernet hardware in certain Dell Optiplex and Dell
-Precision desktop machines, and certain Dell Latitude laptop docking
+Precision dexktop machines, and certain Dell Latitude laptop docking
stations.
.Pp
The Etherlink XL chips support built-in 10baseT, 10base2 and 10base5
@@ -121,10 +121,10 @@ the network connection (cable).
.It "xl%d: no memory for rx list"
The driver failed to allocate an mbuf for the receiver ring.
.It "xl%d: no memory for tx list"
-The driver failed to allocate an mbuf for the transmitter ring when
+The driver fauled to allocate an mbuf for the transmitter ring when
allocating a pad buffer or collapsing an mbuf chain into a cluster.
.It "xl%d: command never completed!"
-Some commands issued to the 3c90x ASIC take time to complete: the
+Some commands issued ot the 3c90x ASIC take time to complete: the
driver is supposed to wait until the 'command in progress' bit in
the status register clears before continuing. In rare instances, this
bit may not clear. To avoid getting caught in an infinite wait loop,
diff --git a/share/man/man4/man4.i386/ze.4 b/share/man/man4/man4.i386/ze.4
index bfce5f106ca4..7326561a8f44 100644
--- a/share/man/man4/man4.i386/ze.4
+++ b/share/man/man4/man4.i386/ze.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ze.4,v 1.5 1998/03/12 07:30:40 charnier Exp $
+.\" $Id: ze.4,v 1.4 1997/03/21 20:14:00 mpp Exp $
.\"
.Dd January 19, 1997
.Dt ZE 4 i386
@@ -33,7 +33,7 @@
.Nd
IBM/National Semiconductor PCMCIA Ethernet device driver
.Sh SYNOPSIS
-.Cd "device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000"
+.Cd "device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000 vector zeintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/man4.i386/zp.4 b/share/man/man4/man4.i386/zp.4
index b25ed472d056..518a73fff6bc 100644
--- a/share/man/man4/man4.i386/zp.4
+++ b/share/man/man4/man4.i386/zp.4
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: zp.4,v 1.4 1998/03/12 07:30:40 charnier Exp $
+.\" $Id: zp.4,v 1.3 1997/02/22 13:25:46 peter Exp $
.\"
.Dd January 19, 1997
.Dt ZP 4 i386
@@ -33,7 +33,7 @@
.Nd
3Com PCMCIA Etherlink III Ethernet device driver
.Sh SYNOPSIS
-.Cd "device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000"
+.Cd "device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr"
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/plip.4 b/share/man/man4/plip.4
deleted file mode 100644
index 63674adab9bb..000000000000
--- a/share/man/man4/plip.4
+++ /dev/null
@@ -1,71 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd March 5, 1998
-.Dt PLIP 4
-.Os FreeBSD
-.Sh NAME
-.Nm plip
-.Nd
-Parallel port network interface
-.Sh SYNOPSIS
-.Cd "device plip at ppbus?"
-.Sh DESCRIPTION
-The
-.Em plip
-driver is the port of the
-.Xr lp 4
-driver to the
-.Xr ppbus 4
-system.
-.Pp
-One purpose of this port is to allow parallel port sharing with other
-parallel devices. Parallel port bus allocation has been added to the original
-.Xr lp 4
-driver. Secondly, inb()/outb() calls have been replaced by ppbus function
-calls. plip is now arch-independent thanks to the ppbus interface. See
-.Xr ppbus 4
-for more info about the ppbus system.
-.Pp
-The ppbus is allocated when the parallel network interface comes up, then
-released when the interface goes down. Consequently, the parallel port bus
-is unavailable to other devices when the network interface is up. plip is
-interrupt driven and needs to own the bus to receive parallel port interrupts.
-.Pp
-Please, ensure the
-.Xr ppc 4
-entry in you MACHINE file has the net interrupt level...
-.Sh SEE ALSO
-.Xr ppbus 4 ,
-.Xr lp 4 ,
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/ppbus.4 b/share/man/man4/ppbus.4
deleted file mode 100644
index 74a06bdd9bcc..000000000000
--- a/share/man/man4/ppbus.4
+++ /dev/null
@@ -1,315 +0,0 @@
-.\" Copyright (c) 1998, 1999 Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd March 1, 1998
-.Dt PPBUS 4
-.Os FreeBSD
-.Sh NAME
-.Nm ppbus
-.Nd
-Parallel port bus system
-.Sh SYNOPSIS
-.Cd "controller ppbus0"
-.Pp
-.Cd "controller vpo0 at ppbus?"
-.Pp
-.Cd "device nlpt0 at ppbus?"
-.Cd "device plip0 at ppbus?"
-.Cd "device ppi0 at ppbus?"
-.Cd "device pps0 at ppbus?"
-.Cd "device lpbb0 at ppbus?"
-.Sh DESCRIPTION
-The
-.Em ppbus
-system provides a uniform, modular and architecture-independent
-system for the implementation of drivers to control various parallel devices,
-and to utilize different parallel port chipsets.
-.Sh DEVICE DRIVERS
-In order to write new drivers or port existing drivers, the ppbus system
-provides the following facilities:
-.Bl -bullet -item -offset indent
-.It
-architecture-independent macros or functions to access parallel ports
-.It
-mechanism to allow various devices to share the same parallel port
-.It
-a user interface named
-.Xr ppi 4
-that allows parallel port access from outside the kernel without confliting
-with kernel-in drivers.
-.El
-.Ss Developing new drivers
-.Pp
-The ppbus system has been designed to support the development of standard
-and non-standard software:
-.Pp
-.Bl -column "Driver" -compact
-.It Em Driver Ta Em Description
-.It Sy vpo Ta "VPI0 parallel to Adaptec AIC-7110 SCSI controller driver."
-It uses standard and non-standard parallel port accesses
-.It Sy ppi Ta "Parallel port interface for general I/O"
-.It Sy pps Ta "Pulse per second Timing Interface"
-.It Sy lpbb Ta "Philips official parallel port I2C bit-banging interface"
-.El
-.Ss Porting existing drivers
-.Pp
-Another approach to the ppbus system is to port existing drivers.
-Various drivers have already been ported:
-.Pp
-.Bl -column "Driver" -compact
-.It Em Driver Ta Em Description
-.It Sy nlpt Ta "lpt printer driver"
-.It Sy plip Ta "lp parallel network interface driver"
-.El
-.Pp
-ppbus should let you port any other software even from other operating systems
-that provide similar services.
-.Sh PARALLEL PORT CHIPSETS
-Parallel port chipset support is provided by
-.Xr ppc 4 .
-.Pp
-The ppbus system provides functions and macros to allocate a new
-parallel port bus, then initialize it and upper peripheral device drivers.
-.Pp
-ppc makes chipset detection and initialisation and then calls ppbus attach
-functions to initialize the ppbus system.
-.Sh PARALLEL PORT MODEL
-The logical parallel port model chosen for the ppbus system is the PC's
-parallel port model. Consequently, for the i386 implementation of ppbus,
-most of the services provided by ppc are macros for inb()
-and outb() calls. But, for an other architecture, accesses to one of our logical
-registers (data, status, control...) may require more than one I/O access.
-.Ss Description
-The parallel port may operate in the following modes:
-.Bl -bullet -item -offset indent
-.It
-compatible mode, also called Centronics mode
-.It
-bidirectional 8/4-bits mode, also called NIBBLE mode
-.It
-byte mode, also called PS/2 mode
-.It
-Extended Capability Port mode, ECP
-.It
-Enhanced Parallel Port mode, EPP
-.It
-mixed ECP+EPP or ECP+PS/2 modes
-.El
-.Ss Compatible mode
-This mode defines the protocol used by most PCs to transfer data to a printer.
-In this mode, data is placed on the port's data lines, the printer status is
-checked for no errors and that it is not busy, and then a data Strobe is
-generated by the sofware to clock the data to the printer.
-.Pp
-Many I/O controllers have implemented a mode that uses a FIFO buffer to
-transfer data with the Compatibility mode protocol. This mode is referred to as
-"Fast Centronics" or "Parallel Port FIFO mode".
-.Ss Bidirectional mode
-The NIBBLE mode is the most common way to get reverse channel data from a
-printer or peripheral. Combined with the standard host to printer mode, it
-provides a complete bidirectional channel.
-.Pp
-In this mode, outputs are 8-bits long. Inputs are accomplished by reading
-4 of the 8 bits of the status register.
-.Ss Byte mode
-In this mode, the data register is used either for outputs and inputs. Then,
-any transfer is 8-bits long.
-.Ss Extended Capability Port mode
-The ECP protocol was proposed as an advanced mode for communication with
-printer and scanner type peripherals. Like the EPP protocol, ECP mode provides
-for a high performance bidirectional communication path between the host
-adapter and the peripheral.
-.Pp
-ECP protocol features include:
-.Bl -item -offset indent
-.It
-Run_Length_Encoding (RLE) data compression for host adapters
-.It
-FIFOs for both the forward and reverse channels
-.It
-DMA as well as programmed I/O for the host register interface.
-.El
-.Ss Enhanced Parallel Port mode
-The EPP protocol was originally developed as a means to provide a high
-performance parallel port link that would still be compatible with the
-standard parallel port.
-.Ss Mixed modes
-Some manufacturers, like SMC, have implemented chipsets that support mixed
-modes. With such chipsets, mode switching is available at any time by
-accessing the extended control register.
-.Sh IEEE1284-1994 Standard
-.Ss Background
-This standard is also named "IEEE Standard Signaling Method for a
-Bidirectional Parallel Peripheral Interface for Personal Computers". It
-defines a signaling method for asynchroneous, fully interlocked, bidirectional
-parallel communications between hosts and printers or other peripherals. It
-also specifies a format for a peripheral identification string and a method of
-returning this string to the host outside of the bidirectional data stream.
-.Pp
-This standard is architecture independent and only specifiy dialog handshake
-at signal level. One should refer to any architecture specific document in
-order to manipulate machine dependent registers, mapped memory or whatelse
-to control these signals.
-.Pp
-The IEEE1284 protocol is fully oriented with all supported parallel port
-modes. The computer acts as master and the peripheral as slave.
-.Pp
-Any transfer is defined as a finite state automate. It allows software to
-properly manage the fully interlocked scheme of the signaling method.
-The compatible mode is supported "as is" without any negociation because it
-is compatible. Any other mode must be firstly negociated by the host to check
-it is supported by the peripheral, then to enter one of the forward idle
-states.
-.Pp
-At any time, the slave may want to send data to the host. This is only
-possible from forward idle states (nibble, byte, ecp...). So, the
-host must have previously negociated to permit the peripheral to
-request transfer. Interrupt lines may be dedicated to the requesting signals
-to prevent time consuming polling methods.
-.Pp
-But peripheral requests are only a hint to the master host. If the host
-accepts the transfer, it must firstly negociate the reverse mode and then
-starts the transfer. At any time during reverse transfer, the host may
-terminate the transfer or the slave may drive wires to signal that no more
-data is available.
-.Ss Implementation
-IEEE1284 Standard support has been implemented at the top of the ppbus system
-as a set of procedures that perform high level functions like negociation,
-termination, transfer in any mode without bothering you with low level
-caracteristics of the stantdard.
-.Pp
-IEEE1284 interacts with the ppbus system as least as possible. That means
-you still have to request the ppbus when you want to access it, the negociate
-function doesn't do it for you. And of course, release it later.
-.Sh ARCHITECTURE
-.Ss adapter, ppbus and device layers
-First, there is the
-.Em adapter
-layer, the lowest of the ppbus system. It provides
-chipset abstraction throw a set of low level functions that maps the logical
-model to the underlying hardware.
-.Pp
-Secondly, there is the
-.Em ppbus
-layer that provides functions to:
-.Bl -enum -offset indent
-.It
-share the parallel port bus among the daisy-chain like connected devices
-.It
-manage devices linked to ppbus
-.It
-propose an arch-independent interface to access the hardware layer.
-.El
-.Pp
-Finaly, the
-.Em device
-layer gathers the parallel peripheral device drivers.
-.Pp
-Each layer has its own C structure respectively ppb_adapter, ppb_data and
-ppb_device. The ppb_link structure gathers pointers to other structures and
-info shared among different layers.
-.Pp
-See description of these structures in
-.Xr ppbconf 9 .
-.Ss Parallel modes managment
-We have to differenciate operating modes at various ppbus system layers.
-Actually, ppbus and adapter operating modes on one hands and for each
-one, current and available modes are seperated.
-.Pp
-With this level of abstraction a particular chipset may commute from any
-native mode the any other mode emulated with extended modes without
-disturbing upper layers. For example, most chipsets support NIBBLE mode as
-native and emulated with ECP and/or EPP.
-.Pp
-This achitecture should support IEEE1284-1994 modes.
-.Sh FEATURES
-.Ss The boot process
-The boot process starts with the probe phasis of the
-.Xr ppc 4
-driver during ISA bus (PC architecture) initialisation. During attachment of
-the ppc driver, a new ppbus structure is allocated, initialized
-(linked to the adapter structure) then passed to the function
-.Fn ppb_attachdevs "struct ppb_data *ppb" .
-.Pp
-.Fn ppb_attachdevs ""
-tries to detect any PnP parallel peripheral (according to
-.%T "Plug and Play Parallel Port Devices"
-draft from (c)1993-4 Microsoft Corporation)
-then probes and attaches known device drivers.
-.Pp
-During probe, device drivers are supposed to request the ppbus and try to
-set their operating mode. This mode will be saved in the context structure and
-returned each time the driver requests the ppbus.
-.Ss Bus allocation and interrupts
-ppbus allocation is mandatory not to corrupt I/O of other devices. An other
-usage of ppbus allocation is to reserve the port and receive incoming
-interrupts.
-.Pp
-Interrupts are connected to the
-.Fn ppcintr ""
-function which delivers them to ppbus directly with a
-.Fn ppb_intr "struct ppb_link *pl"
-call. ppbus redirects the
-interrupt to the bus owner's handler if defined. Consequently, if a device
-wants to be delivered an interrupt, it must own the ppbus.
-.Ss Microsequences
-.Em Microsequences
-is a general purpose mechanism to allow fast low-level
-manipulation of the parallel port. Microsequences may be used to do either
-standard (in IEEE1284 modes) or non-standard transfers. The philosophy of
-microsequences is to avoid the overhead of the ppbus layer and do most of
-the job at adapter level.
-.Pp
-A microsequence is an array of opcodes and parameters. Each opcode codes an
-operation (opcodes are described in
-.Xr microseq 9 ).
-Standard I/O operations are implemented at ppbus level whereas basic I/O
-operations and microseq langage are coded at adapter level for efficiency.
-.Pp
-As an example, the
-.Xr vpo 4
-driver uses microsequences to implement:
-.Bl -bullet -offset indent
-.It
-a modified version of the NIBBLE transfer mode
-.It
-various I/O sequences to initialize, select and allocate the peripheral
-.El
-.Sh SEE ALSO
-.Xr ppbconf 9 ,
-.Xr ppc 4 ,
-.Xr ppi 4 ,
-.Xr vpo 4 ,
-.Xr nlpt 4 ,
-.Xr plip 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/sl.4 b/share/man/man4/sl.4
index 00a347e09181..c2b8607451d5 100644
--- a/share/man/man4/sl.4
+++ b/share/man/man4/sl.4
@@ -76,4 +76,4 @@ family; the packet was dropped.
.Xr intro 4 ,
.Xr slattach 8 ,
.Xr sliplogin 8 ,
-.Xr slstat 8
+.Xr slstats 8
diff --git a/share/man/man4/smb.4 b/share/man/man4/smb.4
deleted file mode 100644
index 90d126e929a4..000000000000
--- a/share/man/man4/smb.4
+++ /dev/null
@@ -1,70 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd October 25, 1998
-.Dt SMB 4
-.Os FreeBSD
-.Sh NAME
-.Nm smb
-.Nd
-SMB generic i/o device driver
-.Sh SYNOPSIS
-.Cd "device smb0 at smbus?"
-.Sh DESCRIPTION
-The
-.Em smb
-character device driver provides generic i/o to any
-.Xr smbus 4
-instance. In order to control SMB devices, use /dev/smb? with the
-following ioctls:
-.Pp
-.Bl -column "System Management Bus ioctls" -compact
-.It Em Ioctl Ta Em Description
-.It Sy SMB_QUICK_WRITE Ta "QuickWrite command"
-.It Sy SMB_QUICK_READ Ta "QuickRead command"
-.It Sy SMB_SENDB Ta "SendByte command"
-.It Sy SMB_RECVB Ta "ReceiveByte command"
-.It Sy SMB_WRITEB Ta "WriteByte command"
-.It Sy SMB_WRITEW Ta "WriteWord command"
-.It Sy SMB_READB Ta "ReadByte command"
-.It Sy SMB_READW Ta "ReadWord command"
-.It Sy SMB_PCALL Ta "ProcedureCall command"
-.It Sy SMB_BWRITE Ta "BlockWrite command"
-.It Sy SMB_BREAD Ta "BlockRead command"
-.El
-.Pp
-Using the write routine is equivalent to a SMB_WRITEW ioctl.
-.Pp
-.Sh SEE ALSO
-.Xr smbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/smbus.4 b/share/man/man4/smbus.4
deleted file mode 100644
index f3b5ada9460d..000000000000
--- a/share/man/man4/smbus.4
+++ /dev/null
@@ -1,75 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd August 10, 1998
-.Dt SMBBUS 4
-.Os FreeBSD
-.Sh NAME
-.Nm smbus
-.Nd
-System Management Bus
-.Sh SYNOPSIS
-.Cd "controller smbus"
-.Pp
-.Cd "device iicsmb0 at iicbus?"
-.Cd "device bktr0"
-.Sh DESCRIPTION
-The
-.Em smbus
-system provides a uniform, modular and architecture-independent
-system for the implementation of drivers to control various SMB devices
-and to utilize different SMB controllers (I2C, PIIX4, Brooktree848, vm86...).
-.Sh System Management Bus
-The
-.Em System Management Bus
-is a two-wire interface through which simple power-related chips can communicate
-with rest of the system. It uses I2C as its backbone (see
-.Xr iicbus 4 ).
-
-A system using SMB passes messages to and from devices instead of tripping
-individual control lines.
-
-With the SMBus, a device can provide manufacturer information, tell the
-system what its model/part number is, save its state for a suspend event,
-report different types of errors, accept control parameters, and return its
-status.
-
-The SMBus may share the same host device and physical bus as ACCESS bus
-components provided that an appropriate electrical bridge is provided
-between the internal SMB devices and external ACCESS bus devices.
-.Sh SEE ALSO
-.Xr iicbus 4 ,
-.Xr iicsmb 4 ,
-.Xr bktr 4 ,
-.Xr smb 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man4/vinum.4 b/share/man/man4/vinum.4
index f155ee32972a..52407df2caba 100644
--- a/share/man/man4/vinum.4
+++ b/share/man/man4/vinum.4
@@ -35,7 +35,7 @@
.\" otherwise) arising in any way out of the use of this software, even if
.\" advised of the possibility of such damage.
.\"
-.\" $Id: vinum.4,v 1.8 1999/01/15 03:54:40 grog Exp grog $
+.\" $Id: vinum.4,v 1.4 1998/08/20 02:01:16 grog Exp grog $
.\"
.Dd 22 July 1998
.Dt vinum 4
@@ -44,8 +44,8 @@
.Nm vinum
.Nd Logical Volume Manager
.Sh SYNOPSIS
-.Cd "kldload vinum"
-.Cd "kldload Vinum"
+.Cd "modload /lkm/vinum_mod.o"
+.Cd "modload /lkm/vinum_mod.raid5.o"
.Sh DESCRIPTION
.Nm
is a logical volume manager inspired by, but not derived from, the Veritas
@@ -56,8 +56,7 @@ It provides device-independent logical disks, called \fIvolumes\fP. Volumes are
not restricted to the size of any disk on the system.
.It
The volumes consist of one or more \fIplexes\fP, each of which contain the
-entire address space of a volume. This represents an implementation of RAID-1
-(mirroring). Multiple plexes can also be used for
+entire address space of a volume. Multiple plexes can be used for
.\" XXX What about sparse plexes? Do we want them?
.if t .sp
.Bl -bullet
@@ -146,70 +145,43 @@ perform this function.
.El
.Sh KERNEL CONFIGURATION
.Nm
-is currently supplied as a kernel loadable module (kld), and does not require
-configuration. As with other klds, it is absolutely necessary to match the kld
-to the version of the operating system. Failure to do so will cause
+does not require kernel configuration, since it is supplied \fIonly\fP\| as a
+loadable kernel module (\fILKM\fP\|). As with other LKMs, it is absolutely
+necessary to match the LKM to the version of the operating system. Failure to
+do so will cause
.Nm
to issue an error message and terminate.
.Pp
.Nm
is currently available in two versions: a freely available version which does
not contain RAID-5 functionality, and a full version including RAID-5
-functionality, which is available from Cybernet Systems
-Inc. (http://www.cybernet.com\fR).
+functionality, which is available from Cybernet Systems Inc.
.Sh RUNNING VINUM
-Normally, you start a configured version of
-.Nm
-at boot time. Set the variable
-.Ar vinum_slices
-in
-.Ar /etc/rc.conf
-to indicate the slices on which
-.Nm
-drives are located. For example, if you have
-.Nm
-drives on
-.Ar /dev/da1h ,
-.Ar /dev/da2h ,
-.Ar /dev/da3h ,
-.Ar /dev/da4h
-and
-.Ar /dev/da5h ,
-you would set the variable to:
-.Bd -literal
-vinum_slices="/dev/da1h /dev/da2h /dev/da3h /dev/da4h /dev/da5h"
-.Ed
-.Pp
-.Sh VINUM INSTALLATION
The freely available version of the
.Nm
-kld is called
-.Pa /modules/vinum.ko ,
+LKM is called
+.Pa /lkm/vinum_mod.o ,
and the RAID-5 version is
-.Pa /modules/Vinum.o .
+.Pa /lkm/vinum_mod.raid5.o .
To load the module:
-.Pp
.Bd -unfilled -offset indent
-# kldload vinum
+# modload /lkm/vinum_mod.o
.Ed
.Pp
-.Nm vinum(8)
-also automatically loads the kld module if it is not yet loaded.
-.Pp
-After loading
-.Nm vinum ,
-it must be confiugred. In an existing installation, the following command reads
-the configuration an existing set of disks:
+At this point,
+.Nm
+is loaded but has not been configured. In an existing installation, the
+following command reads the configuration from disk
+.Ar /dev/da1h .
.Bd -unfilled -offset indent
-# vinum read /dev/da1h /dev/da2h /dev/da3h /dev/da4h /dev/da5h /dev/da6h
+# vinum read /dev/da1h
.Ed
.sp
-This command must specify all of the devices used by
+The name of the disk device (in this example
+.Ar /dev/da1h )
+can be any of the devices used by
.Nm vinum .
-.Nm vinum(8)
-reads the configuration from the device with the newest configuration file, then
-updates it if necessary with additional information from successively older
-configurations. These commands are normally embedded in the startup file
+These commands are normally embedded in the startup file
.Pa /etc/rc .
.Pp
See
@@ -218,27 +190,26 @@ for information on how to create a
.Nm
configuration.
.Pp
-To unload the kld, first find the
+To unload the LKM, first find the
.Ar Id
field in
-.Pa kldstat:
+.Pa modstat:
.Bd -unfilled -offset indent
-# kldstat
-Id Refs Address Size Name
- 1 2 0xf0100000 1c7de8 kernel
- 2 1 0xf0f5b000 b0000 Vinum.ko
+# modstat
+Type Id Off Loadaddr Size Info Rev Module Name
+MISC 0 0 f2b6e000 0061 f2b7b034 1 vinum_mod
.Ed
.Pp
-To unload the module, use
-.Pa kldunload:
+Use this value as the parameter for
+.Pa modunload:
.Bd -unfilled -offset indent
-# kldunload -n Vinum
+# modunload -i 0
.Ed
.Pp
-The kld can only be unloaded when idle, in other words when no volumes are
+The LKM can only be unloaded when idle, in other words when no volumes are
mounted and no other instances of the
.Nm
-program are active. Unloading the kld does not harm the data in the volumes.
+program are active. Unloading the LKM does not harm the data in the volumes.
.Ss CONFIGURING AND STARTING OBJECTS
Use the
.Xr vinum 8
@@ -563,6 +534,7 @@ box,center,tab(#) ;
lfCWp9 | lw65 .
State#Meaning
=
+.TH N
volume_unallocated#T{
present but unused. This will not normally be seen from a user perspective.
T}
@@ -582,6 +554,7 @@ box,center,tab(#) ;
lfCWp9 | lw65 .
State#Meaning
=
+.TH N
volume_unallocated#T{
present but unused. This will not normally be seen from a user perspective.
T}
@@ -614,6 +587,7 @@ box,center,tab(#) ;
lfCWp9 | lw65 .
State#Meaning
=
+.TH N
plex_unallocated#T{
An empty entry, not a plex at all.
T}
@@ -701,6 +675,7 @@ box,center,tab(#) ;
lfCWp9 | lw65 .
State#Meaning
=
+.TH N
sd_unallocated#T{
An empty entry, not a subdisk at all.
T}
@@ -795,6 +770,7 @@ box,center,tab(#) ;
lfCWp9 | lw65 .
State#Meaning
=
+.TH N
drive_unallocated#T{
Unused entry.
T}
@@ -833,7 +809,7 @@ should fail. I don't know any good way to enforce this initialization (or the
even slower alternative of rebuilding the parity blocks). If anybody has a good
idea, I'd be grateful for input.
.It
-Det ection of differences between the version of the kernel and the kld is not
+Detection of differences between the version of the kernel and the LKM is not
yet implemented.
.El
.Sh AUTHOR
diff --git a/share/man/man4/vpo.4 b/share/man/man4/vpo.4
deleted file mode 100644
index 28f8ed4906c3..000000000000
--- a/share/man/man4/vpo.4
+++ /dev/null
@@ -1,56 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd March 5, 1998
-.Dt VP0 4
-.Os FreeBSD
-.Sh NAME
-.Nm vpo
-.Nd
-Parallel to SCSI interface driver
-.Sh SYNOPSIS
-.Cd "controller vpo at ppbus?"
-.Pp
-For one or more SCSI busses:
-.Cd "controller scbus0 at vpo0"
-.Sh DESCRIPTION
-The primary purpose of the
-.Em vpo
-driver is to provide access to the Adaptec AIC-7110 SCSI controller built
-in the Iomega ZIP drive. But it should also work with the Iomega Jaz Traveller
-parallel to SCSI interface.
-.Sh SEE ALSO
-.Xr ppbus 4 ,
-.Xr scsi 4 ,
-.Xr sd 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 0a5993eb8833..6ea12b962835 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -22,17 +22,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: rc.conf.5,v 1.26 1998/12/12 23:26:52 dillon Exp $
+.\" $Id: rc.conf.5,v 1.23 1998/10/06 19:24:26 phk Exp $
.\"
.Dd April 26, 1997
.Dt RC.CONF 5
.Os FreeBSD 2.2.2
.Sh NAME
.Nm rc.conf
-.Nd system configuration information.
-.Pp
-.Nm rc.conf.local
-.Nd localized system configuration information.
+.Nd local configuration information.
.Sh DESCRIPTION
The file
.Nm rc.conf
@@ -43,16 +40,15 @@ started up at system initial boot time. In new installations, the
file is generally initialized by the system installation utility:
.Pa /stand/sysinstall .
.Pp
-The
-.Nm rc.conf.local
-file may be used to override variables set in rc.conf. The system
-administrator typically uses the distribution-supplied
-.Nm rc.conf
-file and maintains local overrides/additions in
-.Nm rc.conf.local.
-.Pp
+It is the duty of the system administrator to properly maintain this file
+as changes occur on the local host.
+.Sh FILES
+.Bl -tag -width /etc/rc.conf -compact
+.It Pa /etc/rc.conf
+.El
+.Sh DESCRIPTION
The purpose of
-.Nm rc.conf[.local]
+.Nm
is not to run commands or perform system startup actions
directly. Instead, it is included by the
various generic startup scripts in
@@ -264,12 +260,6 @@ and
run the
.Xr rwhod 8
daemon at boot time.
-.It Ar rwhod_flags
-(str) If
-.Ar rwhod_enable
-is set to
-.Ar YES ,
-these are the flags to pass to it.
.It Ar amd_enable
(bool) If set to
.Ar YES ,
@@ -283,15 +273,6 @@ is set to
.Ar YES ,
these are the flags to pass to it. Use the \fBinfo amd\fR
command for more information.
-.It Ar update_motd
-(bool) If set to
-.Ar YES ,
-.Nm /etc/motd
-will be updated at boot time to reflect the kernel release
-bring run. If set to
-.Ar NO ,
-.Nm
-will not be updated
.It Ar nfs_client_enable
(bool) If set to
.Ar YES ,
@@ -304,16 +285,6 @@ is set to
these are the flags to pass to the
.Xr nfsiod 8
daemon.
-.It Ar nfs_access_cache
-if
-.Ar nfs_client_enable
-is set to
-.Ar YES ,
-this can be set to
-.Ar 0
-to disable NFS ACCESS RPC caching, or to the number of seconds for which NFS ACCESS
-results should be cached. A value of 2-10 seconds will substantially reduce network
-traffic for many NFS operations.
.It Ar nfs_server_enable
(bool) If set to
.Ar YES ,
@@ -930,14 +901,7 @@ most secure). See
.Xr init 8
for the list of possible security levels and their effect
on system operation.
-.Sh FILES
-.Bl -tag -width /etc/rc.conf -compact
-.It Pa /etc/rc.conf
-.El
-.Pp
-.Bl -tag -width /etc/rc.conf.local -compact
-.It Pa /etc/rc.conf.local
-.El
+
.Sh SEE ALSO
.Xr gdb 1 ,
.Xr info 1 ,
@@ -951,7 +915,6 @@ on system operation.
.Xr ifconfig 8 ,
.Xr inetd 8 ,
.Xr lpd 8 ,
-.Xr motd 5 ,
.Xr moused 8 ,
.Xr mrouted 8 ,
.Xr named 8 ,
diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile
index e0e17ef56aa4..1c77b690aa00 100644
--- a/share/man/man7/Makefile
+++ b/share/man/man7/Makefile
@@ -1,9 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
-# $Id: Makefile,v 1.8 1998/11/26 00:21:24 jkoshy Exp $
+# $Id: Makefile,v 1.6 1997/03/07 03:28:12 jmg Exp $
-#MISSING: eqnchar.7 ms.7 term.7
+#MISSING: eqnchar.7 man.7 ms.7 term.7
MAN7= ascii.7 clocks.7 environ.7 hier.7 hostname.7 intro.7 mailaddr.7 \
- man.7 mdoc.7 mdoc.samples.7 operator.7 ports.7 security.7
+ mdoc.7 mdoc.samples.7 operator.7 ports.7
MLINKS= intro.7 miscellaneous.7
.include <bsd.prog.mk>
diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7
index bade82e7b607..6712a6ae5e2e 100644
--- a/share/man/man7/hier.7
+++ b/share/man/man7/hier.7
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)hier.7 8.1 (Berkeley) 6/5/93
-.\" $Id: hier.7,v 1.15 1997/09/13 17:52:36 wosch Exp $
+.\" $Id: hier.7,v 1.14 1997/03/21 20:14:10 mpp Exp $
.\"
.Dd June 5, 1993
.Dt HIER 7
@@ -301,7 +301,7 @@ ports collection (optional).
.It Li sbin/
system daemons & system utilities (executed by users)
.It Li share/
-architecture-independent files
+architecture-independent ascii text files
.Pp
.Bl -tag -width "calendar/" -compact
.It Li calendar/
diff --git a/share/man/man7/man.7 b/share/man/man7/man.7
deleted file mode 100644
index bccc9bf0e60c..000000000000
--- a/share/man/man7/man.7
+++ /dev/null
@@ -1,343 +0,0 @@
-.\" Copyright (c) 1998.
-.\" The FreeBSD 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:
-.\" 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 University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
-.\"
-.\" $Id$
-.\"
-.Dd November 30, 1998
-.Os
-.Dt MAN 7
-.Sh NAME
-.Nm man
-.Nd quick reference guide for the
-.Nm \-man
-macro package
-.Sh SYNOPSIS
-.Nm groff
-.Fl m Ns Ar an
-.Ar
-.Sh DESCRIPTION
-The
-.Nm \-man
-package is a set of macros used to format
-.Ux
-manual pages. On
-.Bx
-systems, the use of
-.Nm
-is deprecated and the more expressive
-.Nm mdoc
-package is recommended in its place.
-.Sh USAGE
-.Ss Conventions
-.Nm
-macros are named using one or two upper case alphabetic characters.
-Following regular
-.Xr troff 1
-convention, each macro request starts with a
-.Li "."
-as the first character of a line. Arguments to macro requests
-expecting printable text may consist of zero to six words. Some macros will
-process the next input line if no arguments are supplied. For
-example, a
-.Li ".I"
-request on a line by itself will cause the next input line to be set
-in italics.
-Whitespace characters may be embedded in an argument by enclosing
-it in quotes. Type font and size are reset to their defaults before
-each paragraph and after processing font size and face changing macros.
-.Ss Indentation
-The prevailing indent distance is remembered between successive
-indented paragraphs and is reset to the default on reaching a
-non-indented paragraph. Default units for indents are
-.Dq ens .
-.Ss Preprocessing
-The
-.Xr man 1
-program is conventionally used to format and display manual pages. If
-the first line of the manual page source starts with the literal string
-.Li \&\'\e"
-.\" " bring emacs's font-lock mode back in sync ...
-then the remaining letters on the line indicate preprocessors that
-need to be run prior to formatting with
-.Xr troff 1 .
-Supported preprocessing directives are:
-.Bl -column "Letter" "Preprocessor" -offset indent
-.It Em Letter Ta Em Preprocessor
-.It e Ta Xr eqn 1
-.It g Ta Xr grap 1
-.It p Ta Xr pic 1
-.It r Ta Xr refer 1
-.It t Ta Xr tbl 1
-.It v Ta Xr vgrind 1
-.El
-.Ss Available Strings
-The
-.Nm
-package has the following predefined strings:
-.Bl -column "String" "XXXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
-.It Em String Ta Em Description
-.It "\e*R" Ta "registration symbol"
-.It "\e*S" Ta "change to default font size"
-.It "\e*(Tm" Ta "trademark symbol"
-.It "\e*(lq" Ta "left quote"
-.It "\e*(rq" Ta "right quote"
-.El
-.Pp
-.Ss Available Macros
-The available macros are presented in alphabetical order.
-.Bl -tag -width "XXX XX"
-.It ".B" Op Ar words
-typeset
-.Ar words
-using a bold face. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".BI" Op Ar words
-join
-.Ar words
-alternating bold and italic faces. Does not cause a line break. If
-no arguments are given the next text line is processed.
-.It ".BR" Op Ar words
-join
-.Ar words
-alternating bold and roman faces. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".DT"
-restore the default tab spacing of 0.5 inches. Does not cause a line
-break.
-.It ".HP" Op Ar indent
-Begin a paragraph with a hanging indent and sets the prevailing indent
-to
-.Ar indent .
-This request forces a line break. If
-.Ar indent
-is not specified, the value of the prevailing indent is used.
-.It ".I" Op Ar words
-typeset
-.Ar words
-using an italic face. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".IB" Op Ar words
-join
-.Ar words
-alternating italic and bold faces. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".IP" Op Ar tag Op Ar indent
-Begin an indented paragraph with tag
-.Ar tag
-and prevailing indent set to
-.Ar indent .
-If
-.Ar tag
-is not specified it is taken to be the null string
-.Qq "" .
-If
-.Ar indent
-is not specified it is taken to be the prevailing indent.
-.It ".IR" Op Ar words
-join
-.Ar words
-alternating italic and roman faces. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".LP"
-begin a left-aligned paragraph. The prevailing indent is set to the
-default. This request forces a line break.
-.It "\&.P"
-aliased to \&.LP.
-.It ".PD" Op Ar distance
-set the vertical distance between paragraphs to
-.Ar distance .
-If argument
-.Ar distance
-is not specified a value of 0.4v is used.
-.It ".PP"
-aliased to \&.LP.
-.It ".RE"
-end of a relative indent (see \&.RS below). This request forces a
-line break and restores the prevailing indent to its previous value.
-.It ".RB" Op Ar words
-join
-.Ar words
-alternating roman and bold faces. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".RI" Op Ar words
-join
-.Ar words
-alternating roman and italic faces. Does not cause a line break. If no
-arguments are given the next text line is processed.
-.It ".RS" Op Ar indent
-start a relative indent, increasing the indentation by
-.Ar indent .
-If argument
-.Ar indent
-is not specified, the value of the prevailing indent is used.
-.It ".SB" Op Ar words
-typeset
-.Ar words
-using a bold face after reducing the font size by 1 point.
-Does not cause a line break. If no arguments are given the next text
-line is processed.
-.It ".SH" Op Ar words
-specifies a section heading. This request forces a line break.
-It resets the prevailing indent and margins to their defaults.
-.It ".SM" Op Ar words
-typeset
-.Ar words
-after reducing the font size by 1 point. Does not cause a line break.
-If no arguments are given the next text line is processed.
-.It ".SS" Op Ar words
-specifies a section subheading. This request forces a line
-break. If no arguments are given the next text line is processed.
-It resets the prevailing indent and margins to their defaults.
-.It ".TH" Ar name Ar section Ar date Xo
-.Op Ar footer Op Ar center
-.Xc
-Begin reference page
-.Ar name
-belonging to section
-.Ar section .
-The third argument
-.Ar date ,
-is the date of the most recent change. If present,
-.Ar footer
-specifies the left page footer text and
-.Ar center
-specifies the center header text. This request must the very first
-request in the manual page.
-.It ".TP" Op Ar indent
-begin an indented paragraph with the tag specified in the next text
-line. If argument
-.Ar indent
-is given, it specifies the new value of the prevailing indent.
-This request forces a line break.
-.El
-.Sh PAGE STRUCTURE
-Most manual pages follow the general structure outlined below:
-.Bl -tag -width ".SH NAME"
-.It ".TH" Ar title Op Ar section-number
-The very first macro request in a manual page has to be the \&.TH
-request which establishes the name and title of the manual page. The
-\&.TH request also establishes the number of the manual page section.
-.It ".SH NAME"
-The name, or list of names, by which the command is called, followed
-by a dash and a one-line summary of the action performed. This
-section should not contain any
-.Nm troff
-commands or escapes, or any macro requests. This section is used to
-generate the database used by the
-.Xr whatis 1
-command.
-.It ".SH SYNOPSIS"
-A brief summary of the usage of the command or function being
-described.
-.Bl -tag -width "Commands"
-.It Commands
-The syntax of the command and its arguments as would be typed on the
-command line. Words that have to be typed exactly as printed are to
-be presented in bold face. Arguments are indicated by the use of an
-italic face. Arguments and command names so indicated should not be
-capitalized, even when starting a sentence.
-.Pp
-Syntactic symbols used should appear in roman face:
-.Bl -tag -width "XXX"
-.It "[]"
-square brackets are used to indicate optional arguments.
-.It "|"
-vertical bars are used to indicate a one of many exclusive choice.
-Only one item from a list separated by vertical bars is to be selected.
-.It "..."
-an ellipsis following an argument is used to indicate that the
-arguments can be repeated. When an ellipsis follows a bracketed set,
-the expression within the brackets can be repeated.
-.El
-.It Functions
-Required data declarations or
-.Li "#include"
-directives are to be shown first, followed by the function declaration.
-.El
-.It ".SH DESCRIPTION"
-An overview of the command or functions external behavior, including
-its interactions with files or data, how standard input, standard
-output and standard error are handled. Internals and implementation
-details are not normally specified. The question answered by this
-section is "what does it do?" or "what is it for?".
-.Pp
-Literal text, filenames and references to items that appear elsewhere
-in the reference manuals should be presented using a constant width
-face. Arguments should be presented using an italic face.
-.It ".SH OPTIONS"
-The list of options together with a description of how each affects
-the commands operation.
-.It ".SH USAGE"
-This section is optional and contains a detailed description of the
-subcommands and input grammar understood by the command.
-.It ".SH RETURN VALUES"
-The list of return values a library routine could return to the caller,
-with the conditions that cause these values to be returned.
-.It ".SH EXIT STATUS"
-The list of values returned as the exit status of the command, with
-the conditions that cause these values to be returned.
-.It ".SH FILES"
-The list of files associated with the command or function.
-.It ".SH SEE ALSO"
-A comma separated list of related manual pages followed by references
-to other published documentation.
-.It ".SH DIAGNOSTICS"
-A list of diagnostic messages with corresponding explanations.
-.It ".SH BUGS"
-Known defects and limitations, if any.
-.El
-.Sh FILES
-.Bl -tag -width "/usr/share/lib/tmac/tmac.groff_an"
-.It "/usr/share/lib/tmac/tmac.an"
-Initial file defining the
-.Nm
-package.
-.It "/usr/share/lib/tmac/tmac.groff_an"
-.Nm groff
-source for macro definitions.
-.It "/usr/share/lib/tmac/man.local"
-local modifications to the
-.Nm
-package.
-.El
-.Sh SEE ALSO
-.Xr apropos 1 ,
-.Xr groff 1 ,
-.Xr man 1 ,
-.Xr nroff 1 ,
-.Xr troff 1 ,
-.Xr whatis 1 ,
-.Xr mdoc 7 ,
-.Xr mdoc.samples 7
-.Sh HISTORY
-This manual page was written by
-.An "Joseph Koshy"
-.Ad Aq jkoshy@freebsd.org .
diff --git a/share/man/man7/mdoc.7 b/share/man/man7/mdoc.7
index 48e8dba3924c..2117a633d306 100644
--- a/share/man/man7/mdoc.7
+++ b/share/man/man7/mdoc.7
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93
-.\" $Id: mdoc.7,v 1.7 1998/12/01 19:58:58 billf Exp $
+.\" $Id: mdoc.7,v 1.5 1997/03/19 20:31:37 mpp Exp $
.\"
.Dd December 30, 1993
.Os
@@ -342,11 +342,11 @@ Produces
.It Li \&Pf Ta Yes Ta \&No Ta "Prefix string."
.It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote."
.It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote."
-.It Li \&Qc Ta Yes Ta Yes Ta "Straight Double close quote."
+.It Li \&Qc Ta Yes Ta Yes Ta "Strait Double close quote."
.It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal."
-.It Li \&Qo Ta Yes Ta Yes Ta "Straight Double open quote."
-.It Li \&Qq Ta Yes Ta Yes Ta "Straight Double quote."
-.It Li \&Re Ta \&No Ta \&No Ta "Reference end."
+.It Li \&Qo Ta Yes Ta Yes Ta "Strait Double open quote."
+.It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote."
+.It Li \&Re Ta \&No Ta \&No Ta "Reference start."
.It Li \&Rs Ta \&No Ta \&No Ta "Reference start."
.It Li \&Rv Ta \&No Ta \&No Ta "Return values (sections two and three only)."
.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote."
diff --git a/share/man/man7/mdoc.samples.7 b/share/man/man7/mdoc.samples.7
index 6de33236dbcc..d8a949585d50 100644
--- a/share/man/man7/mdoc.samples.7
+++ b/share/man/man7/mdoc.samples.7
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
-.\" $Id: mdoc.samples.7,v 1.16 1997/12/08 07:44:20 charnier Exp $
+.\" $Id: mdoc.samples.7,v 1.15 1997/03/20 16:04:04 mpp Exp $
.\"
.\" This tutorial sampler invokes every macro in the package several
.\" times and is guaranteed to give a worst case performance
@@ -120,7 +120,7 @@ outlined as follows:
.It "A manual page template" .
.El
.It
-.Tn "TITLE MACROS" .
+.Tn "INTRODUCTION OF TITLE MACROS" .
.It
.Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" .
.Bl -tag -width flag -compact -offset indent
@@ -156,7 +156,6 @@ outlined as follows:
.Bl -tag -width flag -compact -offset indent
.It "AT&T Macro" .
.It "BSD Macro" .
-.It "FreeBSD Macro" .
.It "UNIX Macro" .
.It "Enclosure/Quoting Macros"
.Bl -tag -width flag -compact -offset indent
@@ -167,13 +166,13 @@ outlined as follows:
.It "Single Quotes/Enclosure" .
.It "Prefix Macro" .
.El
+.It "Extended Arguments" .
.It "No\-Op or Normal Text Macro" .
.It "No Space Macro" .
.It "Section Cross References" .
.It "References and Citations" .
.It "Return Values (sections two and three only)"
.It "Trade Names (Acronyms and Type Names)" .
-.It "Extended Arguments" .
.El
.It
.Tn "PAGE STRUCTURE DOMAIN"
@@ -395,7 +394,7 @@ is created by
.Ql \&.Fn fetch char\e *str
.It Fn fetch "char *str"
can also be created by
-.Ql \&.Fn fetch "\\*qchar *str\\*q"
+.Ql \&.Fn fetch "\\*q*char *str\\*q"
.El
.Pp
If the
@@ -445,7 +444,6 @@ Several example man pages can also be found
in
.Pa /usr/share/examples/mdoc .
.Pp
-.Ss A manual page template
.Bd -literal -offset indent
\&.\e" The following requests are required for all man pages.
\&.Dd Month day, year
@@ -596,7 +594,7 @@ The date should be written formally:
.ne 5
.Dl January 25, 1989
.El
-.Sh INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS
+.Sh MANUAL DOMAIN
.Ss What's in a name...
The manual domain macro names are derived from the day to day
informal language used to describe commands, subroutines and related
@@ -804,7 +802,6 @@ escape them with
Typical syntax is shown in the first content macro displayed
below,
.Ql \&.Ad .
-.Sh MANUAL DOMAIN
.Ss Address Macro
The address macro identifies an address construct
of the form addr1[,addr2[,addr3]].
@@ -824,9 +821,9 @@ of the form addr1[,addr2[,addr3]].
.El
.Pp
It is an error to call
-.Ql \&.Ad
+.Li \&.Ad
without arguments.
-.Ql \&.Ad
+.Li \&.Ad
is callable by other macros and is parsed.
.Ss Author Name
The
@@ -857,7 +854,7 @@ without
any arguments.
.Ss Argument Macro
The
-.Ql \&.Ar
+.Li \&.Ar
argument macro may be used whenever
a command line argument is referenced.
.Pp
@@ -878,12 +875,12 @@ a command line argument is referenced.
.El
.Pp
If
-.Ql \&.Ar
+.Li \&.Ar
is called without arguments
.Ql Ar
is assumed.
The
-.Ql \&.Ar
+.Li \&.Ar
macro is parsed and is callable.
.Ss Configuration Declaration (section four only)
The
@@ -1173,7 +1170,7 @@ anywhere else in the man page without problems, but its main purpose
is to present the function type in kernel normal form for the
.Sx SYNOPSIS
of sections two and three
-(it causes a line break allowing the function name to appear
+(it causes a page break allowing the function name to appear
on the next line).
.Pp
.Dl Usage: .Ft type ... \*(Pu
@@ -1561,7 +1558,7 @@ example of
macro usage at its worst.
.Ss No\-Op or Normal Text Macro
The macro
-.Ql \&.No
+.Li \&.No
is
a hack for words in a macro command line which should
.Em not
@@ -1681,9 +1678,9 @@ macro
is parsed and is callable by other macros.
.Ss Extended Arguments
The
-.Ql \&.Xo
+.Li \&.Xo
and
-.Ql \&.Xc
+.Li \&.Xc
macros allow one to extend an argument list
on a macro boundary.
Argument lists cannot
@@ -1854,8 +1851,7 @@ name macro
.Ql \&.Nm
is required for sections 1, 5, 6, 7, 8.
Section 4 manuals require a
-.Ql ".Nm" ,
-.Ql ".Fd"
+.Ql ".Nm" , ".Fd"
or a
.Ql ".Cd"
configuration device usage macro.
@@ -1999,14 +1995,12 @@ User specified
sections may be added,
for example, this section was set with:
.Bd -literal -offset 14n
-\&.Sh PAGE STRUCTURE DOMAIN
+\&.Sh PAGE LAYOUT MACROS
.Ed
.Ss Paragraphs and Line Spacing.
.Bl -tag -width 6n
.It \&.Pp
-The
-.Ql \&.Pp
-paragraph command may
+The \&.Pp paragraph command may
be used to specify a line space where necessary.
The macro is not necessary after a
.Ql \&.Sh
@@ -2147,7 +2141,7 @@ and
.Ql \&.Ek
(end-keep).
The only option that
-.Ql \&.Bk
+.Ql \&.Bl
accepts is
.Fl words
and is useful for preventing line breaks in the middle of options.
@@ -2532,7 +2526,7 @@ Here is the source text which produced the above example:
\&.El
.Ed
.Pp
-Here is a hanged list with two items:
+Here is a hanged list with just one item:
.Bl -hang -offset indent
.It Em Hanged
labels appear similar to tagged lists when the
diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7
index 9669f881a0a9..d86d3a6713ce 100644
--- a/share/man/man7/ports.7
+++ b/share/man/man7/ports.7
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ports.7,v 1.8 1998/06/29 06:54:34 hoek Exp $
+.\" $Id: ports.7,v 1.7 1998/06/23 04:38:50 hoek Exp $
.\"
.Dd January 25, 1998
.Dt PORTS 7
@@ -51,21 +51,14 @@ simply type
.Ic make install
to install the application.
.Pp
-It is possible to download and use ports from the FreeBSD repository
-that are newer than the installed system; however it is important to
-install the appropriate "Upgrade Kit" from http://www.FreeBSD.ORG/ports/
-first! The
-.Xr portcheckout 1
-script (also a port, of course!) will help to download new ports.
-.Pp
For more information about using ports, see
.Nm The Ports Collection
(file:/usr/share/doc/handbook/ports.html --or--
-http://www.FreeBSD.ORG/handbook/ports.html).
+http://www.freebsd.org/handbook/ports.html).
For information about creating new ports, see
.Nm Porting applications
(file:/usr/share/doc/handbook/porting.html --or--
-http://www.FreeBSD.ORG/handbook/porting.html).
+http://www.freebsd.org/handbook/porting.html).
Both are part of the FreeBSD Handbook.
.Pp
.Sh TARGETS
@@ -73,8 +66,7 @@ Both are part of the FreeBSD Handbook.
Some of the targets work recursively through subdirectories.
This lets you, for example, install all of the biology
ports. The targets that do this are
-.Ar build , checksum , clean , configure ,
-.Ar depends , extract , fetch , install ,
+.Ar build , checksum , clean , configure , extract , fetch , install ,
and
.Ar package .
.Pp
@@ -254,6 +246,8 @@ Command to use to fetch files. Normally
If set, overwrite any existing package registration on the system.
.It Ev MOTIFLIB
Location of libXm.{a,so}.
+.It Ev PATCH_DEBUG
+If defined, display verbose output when applying each patch.
.It Ev INTERACTIVE
If defined, only operate on a port if it requires interaction.
.It Ev BATCH
@@ -272,11 +266,7 @@ The big Kahuna.
.Xr pkg_add 1 ,
.Xr pkg_create 1 ,
.Xr pkg_delete 1 ,
-.Xr pkg_info 1 ,
-.Xr portcheckout 1
-(a port),
-.Xr pib 1
-(also a port).
+.Xr pkg_info 1 .
.Pp
The FreeBSD handbook
.Pp
diff --git a/share/man/man7/security.7 b/share/man/man7/security.7
deleted file mode 100644
index d1d34eb5830c..000000000000
--- a/share/man/man7/security.7
+++ /dev/null
@@ -1,446 +0,0 @@
-.\" Copyright (c) 1998, Matthew Dillon. Terms and conditions are those of
-.\" the BSD Copyright as specified in the file "/usr/src/COPYRIGHT" in
-.\" the source tree.
-.\"
-.\" $Id: security.7,v 1.3 1998/12/25 23:39:01 obrien Exp $
-.\"
-.Dd December 20, 1998
-.Dt SECURITY 7
-.Os
-.Sh NAME
-.Nm security
-.Nd introduction to security under FreeBSD
-.Sh DESCRIPTION
-.Pp
-Security is a function that begins and ends with the system administrator.
-While all
-.Bx
-systems are inherently multi-user capable, the job of building and
-maintaining security mechanisms to keep those users 'honest' is probably
-one of the single largest undertakings of the sysadmin. Machines are
-only as secure as you make them, and security concerns are ever competing
-with the human necessity for convenience. UNIX systems,
-in general, are capable of running a huge number of simultaneous processes
-and many of these processes operate as servers - meaning that external entities
-can connect and talk to them. As yesterday's mini-computers and mainframes
-become today's desktops, and as computers become networked and internetworked,
-security becomes an ever bigger issue.
-.Pp
-Security concerns can be split up into several categories:
-.Bl -enum -offset indent
-.It
-Denial of service attacks
-.It
-User account compromises
-.It
-Root compromise through accessible servers
-.It
-Root compromise via user accounts
-.El
-.Pp
-A denial of service attack is an action that deprives the machine of needed
-resources. Typically, D.O.S. attacks are brute-force mechanisms that attempt
-to crash or otherwise make a machine unusable by overwhelming its servers or
-network stack. Some D.O.S. attacks try to take advantages of bugs in the
-networking stack to crash a machine with a single packet. The latter can
-only be fixed by applying a bug fix to the kernel. Attacks on servers can
-often be fixed by properly specifying options to servers to limit the load
-they incur on the system under adverse conditions. Brute-force network
-attacks are harder to deal with. A spoofed-packet attack, for example, is
-nearly impossible to stop short of cutting your system off from the internet.
-.Pp
-A user account compromise is even more common then a D.O.S. attack. Many
-sysadmins still run standard telnetd, rlogind, rshd, and ftpd servers on their
-machines. These servers, by default, do not operate over encrypted
-connections. The result is that if you have any moderate-sized user base,
-one or more of your users logging into your system from a remote location
-(which is the most common and convenient way to login to a system) will
-have his or her password sniffed. The attentive system admin will analyze
-his remote access logs occasionally looking for suspicious source addresses
-even for successful logins.
-.Pp
-One must always assume that once an attacker has access to a user account,
-the attacker can break root. However, the reality is that in a well secured
-and maintained system, access to a user account does not necessarily give the
-attacker access to root. The distinction is important because without access
-to root the attacker cannot generally hide his tracks and may, at best, be
-able to remove that user's files and crash the machine, but not touch anyone
-else's files.
-.Pp
-System administrators must keep in mind that there are several ways to break
-root on a machine. The attacker may know the root password, the attacker
-may find a bug in a root-run server and be able to break root over a network
-connection to that server, or the attacker may know of a bug in an suid-root
-program that allows the attacker to break root once he has broken into a
-user's account.
-.Pp
-Security remedies are always implemented in a multi-layered 'onion peel'
-approach and can be categorized as follows:
-.Bl -enum -offset indent
-.It
-Securing root and staff accounts
-.It
-Securing root - root-run servers and suid/sgid binaries
-.It
-Securing user accounts
-.It
-Securing the password file
-.It
-Securing the kernel core, raw devices, and filesystems
-.It
-Checking file integrity: binaries, configuration files, and so forth
-.It
-Paranoia
-.El
-.Sh SECURING THE ROOT ACCOUNT AND SECURING STAFF ACCOUNTS
-.Pp
-Don't bother securing staff accounts if you haven't secured the root
-account. Most systems have a password assigned to the root account. The
-first thing you do is assume that the password is 'always' compromised.
-To secure the root account you make sure that it is not possible to login
-to the root account using the root password from a random user account or
-over the network. If you haven't already, configure telnetd, rlogind, and
-all other servers that handle login operations to refuse root logins, period,
-whether the right password is given or not. Allow direct root logins only
-via the system console. The '/etc/ttys' file comes in handy here and is
-secure by default on most systems, but a good sysadmin always checks to make
-sure.
-.Pp
-Of course, as a sysadmin you have to be able to get to root, so we open up
-a few holes. But we make sure these holes require additional password
-verification to operate. One way to make root accessible is to add appropriate
-staff accounts to the wheel group (in /etc/group). The staff members placed
-in the wheel group are allowed to 'su' to root. You should never give staff
-members native wheel access via their entry in the password file... put staff
-in a 'staff' group or something and only add those that really need root to
-the wheel group. Unfortunately the wheel mechanism still allows an intruder to
-break root if the intruder has gotten hold of your password file - he need only
-break the root password and the password of one of the staff accounts that
-happens to be in the wheel group. So while the wheel mechanism is usable,
-it isn't much safer then not having a wheel group at all.
-.Pp
-An indirect way to secure the root account is to secure your staff accounts
-by using an alternative login access method and *'ing out the crypted password
-for the staff accounts. This way an intruder may be able to steal the password
-file but will not be able to break into any staff accounts (or, indirectly,
-root, even if root has a crypted password associated with it). Staff members
-get into their staff accounts through a secure login mechanism such as
-kerberos(1) or ssh(1) (see /usr/ports/security/ssh) using a private/public
-key pair. When you use something like kerberos you generally must secure
-the machines which run the kerberos servers and your desktop workstation.
-When you use a public/private key pair with ssh, you must generally secure
-the machine you are logging in FROM (typically your workstation), but you can
-also add an additional layer of protection to the key pair by password
-protecting the key pair when you create it with ssh-keygen(1). Being able
-to *-out the passwords for staff accounts also guarantees that staff members
-can only login through secure access methods that you have setup. You can
-thus force all staff members to use secure, encrypted connections for
-all their sessions which closes an important hole used by many intruders: That
-of sniffing the network from an unrelated, less secure machine.
-.Pp
-The more indirect security mechanisms also assume that you are logging in
-from a more restrictive server to a less restrictive server. For example,
-if your main box is running all sorts of servers, your workstation shouldn't
- be running any. In order for your workstation to be reasonably secure
-you should run as few servers as possible, up to and including no servers
-at all, and you should run a password-protected screen blanker.
- Of course, given physical access to
-a workstation an attacker can break any sort of security you put on it.
-This is definitely a problem that you should consider but you should also
-consider the fact that the vast majority of break-ins occur remotely, over
-a network, from people who do not have physical access to your workstation or
-servers.
-.Pp
-Using something like kerberos also gives you the ability to disable or
-change the password for a staff account in one place and have it immediately
-effect all the machine the staff member may have an account on. If a staff
-member's account gets compromised, the ability to instantly change his
-password on all machines should not be underrated. With discrete passwords,
-changing a password on N machines can be a mess. You can also impose
-re-passwording restrictions with kerberos: not only can a kerberos ticket
-be made to timeout after a while, but the kerberos system can require that
-the user choose a new password after a certain period of time (say, once a
-month).
-.Sh SECURING ROOT - ROOT-RUN SERVERS AND SUID/SGID BINARIES
-.Pp
-The prudent sysadmin only runs the servers he needs to, no more, no less. Be
-aware that third party servers are often the most bug-prone. For example,
-running an old version of imapd or popper is like giving a universal root
-ticket out to the entire world. Never run a server that you have not checked
-out carefully. Many servers do not need to be run as root. For example,
-the ntalk, comsat, and finger daemons can be run in special user 'sandboxes'.
-A sandbox isn't perfect unless you go to a large amount of trouble, but the
-onion approach to security still stands: If someone is able to break in
-through a server running in a sandbox, they still have to break out of the
-sandbox. The more layers the attacker must break through, the lower the
-likelihood of his success. Root holes have historically been found in
-virtually every server ever run as root, including basic system servers.
-If you are running a machine through which people only login via sshd and
-never login via telnetd or rshd or rlogind, then turn off those services!
-.Pp
-FreeBSD now defaults to running ntalkd, comsat, and finger in a sandbox.
-Another program which may be a candidate for running in a sandbox is
-named(8). The default rc.conf includes the arguments necessary to run
-named in a sandbox in a commented-out form. Depending on whether you
-are installing a new system or upgrading an existing system, the special
-user accounts used by these sandboxes may not be installed. The prudent
-sysadmin would research and implement sandboxes for servers whenever possible.
-.Pp
-There are a number of other servers that typically do not run in sandboxes:
-sendmail, popper, imapd, ftpd, and others. There are alternatives to
-some of these, but installing them may require more work then you are willing
-to put (the convenience factor strikes again). You may have to run these
-servers as root and rely on other mechanisms to detect break-ins that might
-occur through them.
-.Pp
-The other big potential root hole in a system are the suid-root and sgid
-binaries installed on the system. Most of these binaries, such as rlogin,
-reside in /bin, /sbin, /usr/bin, or /usr/sbin. While nothing is 100% safe,
-the system-default suid and sgid binaries can be considered reasonably safe.
-Still, root holes are occasionally found in these binaries. A root hole
-was found in Xlib in 1998 that made xterm (which is typically suid) vulnerable.
-It is better to be safe then sorry and the prudent sysadmin will restrict suid
-binaries that only staff should run to a special group that only staff can
-access, and get rid of (chmod 000) any suid binaries that nobody uses. A
-server with no display generally does not need an xterm binary. Sgid binaries
-can be almost as dangerous. If an intruder can break an sgid-kmem binary the
-intruder might be able to read /dev/kmem and thus read the crypted password
-file, potentially compromising any passworded account. An intruder that breaks
-the tty group can write to almost user's tty. If a user is running a terminal
-program or emulator with a talk-back feature, the intruder can potentially
-generate a data stream that causes the user's terminal to echo a command, which
-is then run as that user.
-.Sh SECURING USER ACCOUNTS
-.Pp
-User accounts are usually the most difficult to secure. While you can impose
-Draconian access restrictions on your staff and *-out their passwords, you
-may not be able to do so with any general user accounts you might have. If
-you do have sufficient control then you may win out and be able to secure the
-user accounts properly. If not, you simply have to be more vigilant in your
-monitoring of those accounts. Use of ssh and kerberos for user accounts is
-more problematic, but still a very good solution compared to a crypted
-password.
-.Sh SECURING THE PASSWORD FILE
-.Pp
-The only sure fire way is to *-out as many passwords as you can and
-use ssh or kerberos for access to those accounts. Even though the
-crypted password file (/etc/spwd.db) can only be read by root, it may
-be possible for a intruder to obtain read access to that file even if the
-attacker cannot obtain root-write access.
-.Pp
-Your security scripts should always check for and report changes to
-the password file (see 'Checking file integrity' below).
-.Sh SECURING THE KERNEL CORE, RAW DEVICES, AND FILESYSTEMS
-.Pp
-If an attacker breaks root he can do just about anything, but there
-are certain conveniences. For example, most modern kernels have a
-packet sniffing device driver built in. Under FreeBSD it is called
-the 'bpf' device. A intruder will commonly attempt to run a packet sniffer
-on a compromised machine. You do not need to give the intruder the
-capability and most systems should not have the bpf device compiled in.
-Unfortunately, there is another kernel feature called the Loadable Kernel
-Module interface. An enterprising intruder can use an LKM to install
-his own bpf device or other sniffing device on a running kernel. If you
-do not need to use the module loader, turn it off in the kernel configuration
-with the NO_LKM option.
-.Pp
-But even if you turn off the bpf device, and turn off the module loader,
-you still have /dev/mem and /dev/kmem to worry about. For that matter,
-the intruder can still write raw devices. To avoid this you have to run
-the kernel at a higher secure level... at least securelevel 1. The securelevel
-can be set with a sysctl on the kern.securelevel variable. Once you have
-set the securelevel to 1, write access to raw devices will be denied and
-special chflags flags, such as 'schg', will be enforced. You must also ensure
-that the 'schg' flag is set on critical startup binaries, directories, and
-script files - everything that gets run up to the point where the securelevel
-is set. This might be overdoing it, and upgrading the system is much more
-difficult when you operate at a higher secure level. You may compromise and
-run the system at a higher secure level but not set the schg flag for every
-system file and directory under the sun.
-.Sh CHECKING FILE INTEGRITY: BINARIES, CONFIG FILES, ETC
-.Pp
-When it comes right down to it, you can only protect your core system
-configuration and control files so much before the convenience factor
-rears its ugly head. The last layer of your security onion is perhaps
-the most important - detection.
-.Pp
-The only correct way to check a system's file integrity is via another,
-more secure system. It is fairly easy to setup a 'secure' system: you
-simply do not run any services on it. With a secure system in place you
-can then give it access to other system's root spaces via ssh. This may
-seem like a security breech, but you have to put your trust somewhere and
-as long as you don't do something stupid like run random servers it really
-is possible to build a secure machine. When I say 'secure' here, I assuming
-physical access security as well, of course. Given a secure machine with
-root access on all your other machines, you can then write security scripts
-ON the secure machine to check the other machines on the system. The most
-common way of checking is to have the security script scp(1) over a find
-and md5 binary and then ssh a shell command to the remote machine to md5
-all the files in the system (or, at least, the /, /var, and /usr partitions!).
-The security machine copies the results to a file and diff's them against
-results from a previous run (or compares the results against its own
-binaries), then emails each staff member a daily report of differences.
-.Pp
-Another way to do this sort of check is to NFS export the major filesystems
-from every other machine to the security machine. This is somewhat more
-network intensive but also virtually impossible for an intruder to detect
-or spoof.
-.Pp
-A good security script will also check for changes to user and staff members
-access configuration files: .rhosts, .shosts, .ssh/authorized_keys, and
-so forth... files that might fall outside the prevue of the MD5 check.
-.Pp
-A good security script will check for suid and sgid binaries on all
-filesystems and report their absolute existence as well as a diff against
-the previous report or some baseline (say, make a baseline once a week).
-While you can turn off the ability to run suid and sgid binaries on certain
-filesystems through the 'nosuid' option in fstab/mount, you cannot turn this
-off on root and anyone who breaks root can just install their binary their.
-If you have a huge amount of user disk space, though, it may be useful to
-disallow suid binaries and devices ('nodev' option) on the user partitions
-so you do not have to scan them for such. I would scan them anyway, though,
-at least once a week, since the object of this onion layer is detection of
-a break-in.
-.Pp
-Process accounting (see accton(1)) is a relatively low-overhead feature of
-the operating system which I recommend using as a post-break-in evaluation
-mechanism. It is especially useful in tracking down how an intruder has
-actually broken root on a system, assuming the file is still intact after
-the break-in occurs.
-.Pp
-Finally, security scripts should process the log files and the logs themselves
-should be generated in as secured a manner as possible - remote syslog can be
-very useful. An intruder tries to cover his tracks, and log files are critical
-to the sysadmin trying to track down the time and method of the initial break-in.
-.Sh PARANOIA
-.Pp
-A little paranoia never hurts. As a rule, a sysadmin can add any number
-of security features as long as they do not effect convenience, and
-can add security features that do effect convenience with some added
-thought.
-.Sh SPECIAL SECTION ON D.O.S. ATTACKS
-.Pp
-This section covers Denial of Service attacks. A DOS attack is typically
-a packet attack. While there isn't much you can do about modern spoofed
-packet attacks that saturate your network, you can generally limit the damage
-by ensuring that the attacks cannot take down your servers.
-.Bl -enum -offset indent
-.It
-Limiting server forks
-.It
-Limiting springboard attacks (ICMP response attacks, ping broadcast, etc...)
-.It
-Kernel Route Cache
-.El
-.Pp
-A common DOS attack is against a forking server that attempts to cause the
-server to eat processes, file descriptors, and memory until the machine
-dies. Inetd (see inetd(8)) has several options to limit this sort of attack.
-It should be noted that while it is possible to prevent a machine from going
-down it is not generally possible to prevent a service from being disrupted
-by the attack. Read the inetd manual page carefully and pay specific attention
-to the -c, -C, and -R options. Note that spoofed-IP attacks will circumvent
-the -C option to inetd, so typically a combination of options must be used.
-Some standalone servers have self-fork-limitation parameters.
-.Pp
-Sendmail has its -OMaxDaemonChildren option which tends to work much
-better then trying to use sendmail's load limiting options due to the
-load lag. You should specify a MaxDaemonChildren parameter when you start
-sendmail high enough to handle your expected load but no so high that the
-computer cannot handle that number of sendmails without falling on its face.
-It is also prudent to run sendmail in queued mode (-ODeliveryMode=queued)
-and to run the daemon (sendmail -bd) separate from the queue-runs
-(sendmail -q15m). If you still want realtime delivery you can run the queue
-at a much lower interval, such as -q1m, but be sure to specify a reasonable
-MaxDaemonChildren option for that sendmail to prevent cascade failures.
-.Pp
-Syslogd can be attacked directly and it is strongly recommended that you use
-the -s option whenever possible, and the -a option otherwise.
-.Pp
-You should also be fairly careful
-with connect-back services such as tcpwrapper's reverse-identd, which can
-be attacked directly. You generally do not want to use the reverse-ident
-feature of tcpwrappers for this reason.
-.Pp
-It is a very good idea to protect internal services from external access
-by firewalling them off at your border routers. The idea here is to prevent
-saturation attacks from outside your LAN, not so much to protect internal
-services from root network-based root compromise. Always configure an exclusive
-firewall, i.e. 'firewall everything *except* ports A, B, C, D, and M-Z'. This
-way you can firewall off all of your low ports except for certain specific
-services such as named (if you are primary for a zone), ntalkd, sendmail,
-and other internet-accessible services.
-If you try to configure the firewall the other
-way - as an inclusive or permissive firewall, there is a good chance that you
-will forget to 'close' a couple of services or that you will add a new internal
-service and forget to update the firewall. You can still open up the
-high-numbered port range on the firewall to allow permissive-like operation
-without compromising your low ports. Also take note that FreeBSD allows you to
-control the range of port numbers used for dynamic binding via the various
-net.inet.ip.portrange sysctl's (sysctl -a | fgrep portrange), which can also
-ease the complexity of your firewall's configuration. I usually use a normal
-first/last range of 4000 to 5000, and a hiport range of 49152 to 65535, then
-block everything under 4000 off in my firewall ( except for certain specific
-internet-accessible ports, of course ).
-.Pp
-Another common DOS attack is called a springboard attack - to attack a server
-in a manner that causes the server to generate responses which then overload
-the server, the local network, or some other machine. The most common attack
-of this nature is the ICMP PING BROADCAST attack. The attacker spoofed ping
-packets sent to your LAN's broadcast address with the source IP address set
-to the actual machine they wish to attack. If your border routers are not
-configured to stomp on ping's to broadcast addresses, your LAN winds up
-generating sufficient responses to the spoofed source address to saturate the
-victim, especially when the attacker uses the same trick on several dozen
-broadcast addresses over several dozen different networks at once. Broadcast
-attacks of over a hundred and twenty megabits have been measured. A second
-common springboard attack is against the ICMP error reporting system. By
-constructing packets that generate ICMP error responses, an attacker can
-saturate a server's incoming network and cause the server to saturate its
-outgoing network with ICMP responses. This type of attack can also crash the
-server by running it out of mbuf's, especially if the server cannot drain the
-ICMP responses it generates fast enough. The FreeBSD kernel has a new kernel
-compile option called ICMP_BANDLIM which limits the effectiveness of these
-sorts of attacks. The last major class of springboard attacks is related to
-certain internal inetd services such as the udp echo service. An attacker
-simply spoofs a UDP packet with the source address being server A's echo port,
-and the destination address being server B's echo port, where server A and B
-are both on your LAN. The two servers then bounce this one packet back and
-forth between each other. The attacker can overload both servers and their
-LANs simply by injecting a few packets in this manner. Similar problems
-exist with the internal chargen port. A competent sysadmin will turn off all
-of these inetd-internal test services.
-.Pp
-Spoofed packet attacks may also be used to overload the kernel route cache.
-Refer to the net.inet.ip.rtexpire, rtminexpire, and rtmaxcache sysctl
-parameters. A spoofed packet attack that uses a random source IP will cause
-the kernel to generate a temporary cached route in the route table, viewable
-with 'netstat -rna | fgrep W3'. These routes typically timeout in 1600
-seconds or so. If the kernel detects that the cached route table has gotten
-too big it will dynamically reduce the rtexpire but will never decrease it to
-less then rtminexpire. There are two problems: (1) The kernel does not react
-quickly enough when a lightly loaded server is suddenly attacked, and (2) The
-rtminexpire is not low enough for the kernel to survive a sustained attack.
-If your servers are connected to the internet via a T3 or better it may be
-prudent to manually override both rtexpire and rtminexpire via sysctl(8).
-Never set either parameter to zero (unless you want to crash the machine :-)).
-Setting both parameters to 2 seconds should be sufficient to protect the route
-table from attack.
-
-.Sh SEE ALSO
-.Pp
-.Xr accton 1 ,
-.Xr chflags 1 ,
-.Xr find 1 ,
-.Xr kerberos 1 ,
-.Xr md5 1 ,
-.Xr ssh 1 ,
-.Xr sshd 1 ,
-.Xr syslogd 1 ,
-.Xr xdm 1 ,
-.Xr sysctl 8
-.Sh HISTORY
-The
-.Nm
-manual page was originally written by Matthew Dillon and first appeared
-in FreeBSD-3.0.1, December 1998.
diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8
index f4a48395a20d..88dfe6c006cd 100644
--- a/share/man/man8/rc.8
+++ b/share/man/man8/rc.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rc.8 8.2 (Berkeley) 12/11/93
-.\" $Id: rc.8,v 1.6 1998/12/12 23:08:34 dillon Exp $
+.\" $Id: rc.8,v 1.4 1998/02/26 02:44:17 jkh Exp $
.\"
.Dd December 11, 1993
.Dt RC 8
@@ -56,16 +56,12 @@ is the command script which controls the automatic reboot
(calling the other scripts) and
.Nm rc.local
is the script holding commands which are pertinent only
-to a specific site. Typically, the /usr/local/etc/rc.d
-mechanism is used instead of rc.local these days but if
-you do want to use rc.local, /etc/rc still supports it.
-In this case, rc.local should source /etc/rc.conf and
-contain additional custom startup code for your system.
+to a specific site.
.Nm Rc.conf
contains the global system configuration information referenced
by the rc files, while
.Nm rc.conf.local
-contains the local system configuration. See rc.conf(5)
+contains the local system configuration.
.Pp
.Nm Rc.shutdown
is the command script which contains any necessary commands
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 6a8e09f36842..6d1f81e1a1a3 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.42 1998/12/22 19:47:48 dillon Exp $
+# $Id: Makefile,v 1.38 1998/09/15 10:26:57 gibbs Exp $
MAN9= MD5.9 \
VFS.9 VFS_FHTOVP.9 VFS_INIT.9 VFS_MOUNT.9 VFS_QUOTACTL.9 \
@@ -11,10 +11,10 @@ MAN9= MD5.9 \
VOP_PATHCONF.9 VOP_PRINT.9 VOP_RDWR.9 VOP_READDIR.9 \
VOP_READLINK.9 VOP_REALLOCBLKS.9 VOP_REMOVE.9 VOP_RENAME.9 \
VOP_STRATEGY.9 \
- at_exit.9 at_fork.9 at_shutdown.9 bios.9 boot.9 buf.9 cd.9 copy.9 \
+ at_exit.9 at_fork.9 at_shutdown.9 bios.9 boot.9 cd.9 copy.9 \
devfs_add_devswf.9 devfs_link.9 devfs_remove_dev.9 devstat.9 \
- fetch.9 ifnet.9 inittodr.9 intro.9 kernacc.9 malloc.9 microseq.9 \
- mi_switch.9 namei.9 panic.9 physio.9 posix4.9 ppbconf.9 psignal.9 \
+ fetch.9 ifnet.9 inittodr.9 intro.9 kernacc.9 malloc.9 \
+ mi_switch.9 namei.9 panic.9 physio.9 posix4.9 psignal.9 \
resettodr.9 rtalloc.9 rtentry.9 scsiconf.9 sd.9 sleep.9 spl.9 st.9 \
store.9 style.9 suser.9 time.9 timeout.9 uio.9 \
vget.9 vnode.9 vput.9 vref.9 vrele.9 vslock.9
@@ -53,9 +53,7 @@ MLINKS+=at_exit.9 rm_at_exit.9
MLINKS+=at_fork.9 rm_at_fork.9
MLINKS+=at_shutdown.9 rm_at_shutdown.9
MLINKS+=copy.9 copyin.9 copy.9 copyinstr.9 copy.9 copyout.9 copy.9 copystr.9
-MLINKS+=devstat.9 devicestat.9 devstat.9 devstat_add_entry.9
-MLINKS+=devstat.9 devstat_remove_entry.9 devstat.9 devstat_start_transaction.9
-MLINKS+=devstat.9 devstat_end_transaction.9
+MLINKS+=devstat.9 devicestat.9
MLINKS+=fetch.9 fubyte.9 fetch.9 fuswintr.9 fetch.9 fusword.9 fetch.9 fuword.9
MLINKS+=ifnet.9 if_data.9 ifnet.9 ifaddr.9 ifnet.9 ifqueue.9
MLINKS+=kernacc.9 useracc.9
@@ -65,8 +63,6 @@ MLINKS+=posix4.9 p1003_1b.9
MLINKS+=psignal.9 gsignal.9 psignal.9 pgsignal.9
MLINKS+=rtalloc.9 rtalloc1.9 rtalloc.9 rtalloc_ign.9
MLINKS+=sleep.9 tsleep.9 sleep.9 wakeup.9 sleep.9 wakeup_one.9
-MLINKS+=sleep.9 asleep.9 sleep.9 await.9
-MLINKS+=buf.9 bp.9
MLINKS+=spl.9 spl0.9
MLINKS+=spl.9 splbio.9 spl.9 splclock.9 spl.9 splhigh.9 spl.9 splimp.9
MLINKS+=spl.9 splnet.9 spl.9 splsoftclock.9 spl.9 splsofttty.9
diff --git a/share/man/man9/buf.9 b/share/man/man9/buf.9
deleted file mode 100644
index 869c90e29476..000000000000
--- a/share/man/man9/buf.9
+++ /dev/null
@@ -1,123 +0,0 @@
-.\" Copyright (c) 1998
-.\" The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
-.\"
-.\" $Id: security.7,v 1.1 1998/12/20 20:12:17 dillon Exp $
-.\"
-.Dd December 22, 1998
-.Dt BUF 9
-.Os
-.Sh NAME
-.Nm BUF/BP
-.Nd Kernel Buffer I/O scheme used in FreeBSD VM system
-.Sh DESCRIPTION
-.Pp
-The kernel implements a KVM abstraction of the buffer cache which allows it
-to map potentially disparate vm_page's into contiguous KVM for use by
-(mainly filesystem) devices and device I/O. This abstraction supports
-block sizes from DEV_BSIZE (usually 512) to upwards of several pages or more.
-It also supports a relatively primitive byte-granular valid range and dirty
-range currently hardcoded for use by NFS. The code implementing the
-VM Buffer abstraction is mostly concentrated in /usr/src/sys/kern/vfs_bio.c.
-.Pp
-One of the most important things to remember when dealing with buffer pointers
-(struct buf) is that the underlying pages are mapped directly from the buffer
-cache. No data copying occurs in the scheme proper, though some filesystems
-such as UFS do have to copy a little when dealing with file fragments. The
-second most important thing to remember is that due to the underlying page
-mapping, the b_data base pointer in a buf is always *page* aligned, not
-*block* aligned. When you have a VM buffer representing some b_offset and
-b_size, the actual start of the buffer is (b_data + (b_offset & PAGE_MASK))
-and not just b_data. Finally, the VM system's core buffer cache supports
-valid and dirty bits (m->valid, m->dirty) for pages in DEV_BSIZE chunks. Thus
-a platform with a hardware page size of 4096 bytes has 8 valid and 8 dirty
-bits. These bits are generally set and cleared in groups based on the device
-block size of the device backing the page. Complete page's worth are often
-refered to using the VM_PAGE_BITS_ALL bitmask (i.e. 0xFF if the hardware page
-size is 4096).
-.Pp
-VM buffers also keep track of a byte-granular dirty range and valid range.
-This feature is normally only used by the NFS subsystem. I'm not sure why it
-is used at all, actually, since we have DEV_BSIZE valid/dirty granularity
-within the VM buffer. If a buffer dirty operation creates a 'hole',
-the dirty range will extend to cover the hole. If a buffer validation
-operation creates a 'hole' the byte-granular valid range is left alone and
-will not take into account the new extension. Thus the whole byte-granular
-abstraction is considered a bad hack and it would be nice if we could get rid
-of it completely.
-.Pp
-A VM buffer is capable of mapping the underlying VM cache pages into KVM in
-order to allow the kernel to directly manipulate the data associated with
-the (vnode,b_offset,b_size). The kernel typically unmaps VM buffers the moment
-they are no longer needed but often keeps the 'struct buf' structure
-instantiated and even bp->b_pages array instantiated despite having unmapped
-them from KVM. If a page making up a VM buffer is about to undergo I/O, the
-system typically unmaps it from KVM and replaces the page in the b_pages[]
-array with a placemarker called bogus_page. The placemarker forces any kernel
-subsystems referencing the associated struct buf to re-lookup the associated
-page. I believe the placemarker hack is used to allow sophisticated devices
-such as filesystem devices to remap underlying pages in order to deal with,
-for example, remapping a file fragment into a file block.
-.Pp
-VM buffers are used to track I/O operations within the kernel. Unfortunately,
-the I/O implementation is also somewhat of a hack because the kernel wants
-to clear the dirty bit on the underlying pages the moment it queues the I/O
-to the VFS device, not when the physical I/O is actually initiated. This
-can create confusion within filesystem devices that use delayed-writes because
-you wind up with pages marked clean that are actually still dirty. If not
-treated carefully, these pages could be thrown away! Indeed, a number of
-serious bugs related to this hack were not fixed until the 2.2.8/3.0.0 release.
-The kernel uses an instantiated VM buffer (i.e. struct buf) to placemark pages
-in this special state. The buffer is typically flagged B_DELWRI. When a
-device no longer needs a buffer it typically flags it as B_RELBUF. Due to
-the underlying pages being marked clean, the B_DELWRI|B_RELBUF combination must
-be interpreted to mean that the buffer is still actually dirty and must be
-written to its backing store before it can actually be released. In the case
-where B_DELWRI is not set, the underlying dirty pages are still properly
-marked as dirty and the buffer can be completely freed without losing that
-clean/dirty state information. ( XXX do we have to check other flags in
-regards to this situation ??? ).
-.Pp
-The kernel reserves a portion of its KVM space to hold VM Buffer's data
-maps. Even though this is virtual space (since the buffers are mapped
-from the buffer cache), we cannot make it arbitrarily large because
-instantiated VM Buffers (struct buf's) prevent their underlying pages in the
-buffer cache from being freed. This can complicate the life of the paging
-system.
-.Pp
-.Sh SEE ALSO
-.Pp
-.Xr <fillmein> 9
-.Sh HISTORY
-The
-.Nm
-manual page was originally written by Matthew Dillon and first appeared
-in FreeBSD-3.0.1, December 1998.
-
diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9
index ee32f5b95e6b..bcb69bd53bec 100644
--- a/share/man/man9/malloc.9
+++ b/share/man/man9/malloc.9
@@ -85,7 +85,7 @@ the kernel version takes two more arguments. The
argument further qualifies
.Fn malloc No Ns 's
operational characteristics as follows:
-.Bl -tag -width indent
+.Bl -tag -offset indent
.It Dv M_NOWAIT
Causes
.Fn malloc
@@ -95,45 +95,19 @@ if the request cannot be immediately fulfilled due to resource shortage.
Otherwise,
.Fn malloc
may call sleep to wait for resources to be released by other processes.
-If this flag is set,
+If this flag is not set,
.Fn malloc
-will return
-.Dv NULL
-rather then block. Note that
+will never return
+.Dv NULL .
+Note that
.Dv M_WAITOK
-is defined to be 0, meaning that blocking operation is the default.
-.It Dv M_ASLEEP
-Causes
-.Fn malloc
-to call
-.Fn asleep
-if the request cannot be immediately fulfilled due to a resource shortage.
-M_ASLEEP is not useful alone and should always be or'd with M_NOWAIT to allow
-malloc to call
-.Fn asleep
-and return
-.Dv NULL
-immediately. It is expected that the caller will at some point call
-.Fn await
-and then retry the allocation. Depending on the routine in question, the
-caller may decide to propogate the temporary failure up the call chain
-and actually have some other higher level routine block on the async wait
-that
-.Fn malloc
-queued.
-.It Dv M_WAITOK
-indicates that it is Ok to wait for resources. It is unconveniently
-defined as 0 so care should be taken never to compare against this value
-directly or try to AND it as a flag. The default operation is to block
-until the memory allocation succeeds.
-.Fn malloc
-can only return
-.Dv NULL
-if
-.Dv M_NOWAIT
-is specified.
+is conveniently defined to be 0, and hence may be or'ed into the
+.Fa flags
+argument to indicate that it's Ok to wait for resources.
.El
.Pp
+Currently, only one flag is defined.
+.Pp
The
.Fa type
argument is used to perform statistics on memory usage, and for
@@ -163,23 +137,11 @@ malloc_type_t M_FOOBUF = {
...
MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT);
-.Ed
+.Be
.Sh RETURN VALUES
.Fn malloc
returns a kernel virtual address that is suitably aligned for storage of
-any type of object, or
-.Dv NULL
-if the request could not be satisfied and
-.Dv M_NOWAIT
-was set. If
-.Dv M_ASLEEP
-was set and
-.Fn malloc
-returns
-.Dv NULL ,
-it will call
-.Fn asleep
-as a side effect.
+any type of object.
.Sh SEE ALSO
.Xr vmstat 8
.Sh DIAGNOSTICS
diff --git a/share/man/man9/microseq.9 b/share/man/man9/microseq.9
deleted file mode 100644
index 630f18630089..000000000000
--- a/share/man/man9/microseq.9
+++ /dev/null
@@ -1,118 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd June 6, 1998
-.Dt MICROSEQ 9
-.Os FreeBSD
-.Sh NAME
-.Nm microseq
-.Nd
-ppbus microseqencer developer's guide
-.Sh SYNOPSIS
-.Fd "#include <dev/ppbus/ppb_msq.h>"
-.Sh DESCRIPTION
-See
-.Xr ppbus 4
-for ppbus description and general info about the microsequencer.
-.Pp
-The purpose of this document is to encourage developers to use the
-microsequencer mechanism in order to have:
-.Bl -enum -offset indent
-.It
-a uniform programming model
-.It
-efficient code
-.El
-.Sh INTERFACE
-.Ss C structures
-.Bd -literal
-union ppb_insarg {
- int i;
- char c;
- void *p;
- int (* f)(void *, char *);
-};
-.Ed
-.Bd -literal
-struct ppb_microseq {
- int opcode; /* microins. opcode */
- union ppb_insarg arg[PPB_MS_MAXARGS]; /* arguments */
-};
-.Ed
-.Ss Using microsequences
-.Pp
-To instanciate a microsequence, just declare an array of ppb_microseq
-structures and initialize it as needed. You may either use defined macros
-or code directly your microinstructions according to the ppb_microseq
-definition. For example,
-.Bd -literal
- struct ppb_microseq select_microseq[] = {
-
- /* parameter list
- */
- #define SELECT_TARGET MS_PARAM(0, 1, MS_TYP_INT)
- #define SELECT_INITIATOR MS_PARAM(3, 1, MS_TYP_INT)
-
- /* send the select command to the drive */
- MS_DASS(MS_UNKNOWN),
- MS_CASS(H_nAUTO | H_nSELIN | H_INIT | H_STROBE),
- MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE),
- MS_DASS(MS_UNKNOWN),
- MS_CASS( H_AUTO | H_nSELIN | H_nINIT | H_STROBE),
-
- /* now, wait until the drive is ready */
- MS_SET(VP0_SELTMO),
-/* loop: */ MS_BRSET(H_ACK, 3 /* ready */),
- MS_DBRA(-1 /* loop */),
-/* error: */ MS_RET(1),
-/* ready: */ MS_RET(0)
- };
-.Ed
-.Pp
-Here, some parameters are undefined and must be filled before executing
-the microsequence. In order to initialize seach a microsequence, one should
-use the ppb_MS_init_msq() function like this:
-.Bd -literal
- ppb_MS_init_msq(select_microseq, 2,
- SELECT_TARGET, 1 << target,
- SELECT_INITIATOR, 1 << initiator);
-.Ed
-.Pp
-and then execute the microsequence.
-.Ss The microsequencer
-The microsequencer is executed either at ppbus or adapter level (see
-.Xr ppbus 4
-for info about ppbus system layers).
-.Sh SEE ALSO
-.Xr ppbus 4
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man9/ppbconf.9 b/share/man/man9/ppbconf.9
deleted file mode 100644
index 9b95e7287593..000000000000
--- a/share/man/man9/ppbconf.9
+++ /dev/null
@@ -1,205 +0,0 @@
-.\" Copyright (c) 1998, Nicolas Souchu
-.\" 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.
-.\"
-.\"
-.Dd April 5, 1998
-.Dt PPBCONF 9
-.Os FreeBSD
-.Sh NAME
-.Nm ppbconf
-.Nd
-ppbus developer's guide
-.Sh SYNOPSIS
-.Fd "#include <dev/ppbus/ppbconf.h>"
-.Sh DESCRIPTION
-See
-.Xr ppbus 4
-for ppbus description.
-.Sh PPBUS STRUCTURES
-Each ppbus layer
-.Po
-.Em adapter ,
-.Em ppbus
-and
-.Em device
-.Pc
-is described by one or more C structure.
-.Ss The adapter layer
-.Bd -literal
-struct ppb_adapter {
-
- void (*intr_handler)(int);
- void (*reset_epp_timeout)(int);
- void (*ecp_sync)(int);
-
- int (*exec_microseq)(int, struct ppb_microseq *, int *);
-
- int (*setmode)(int, int);
-
- void (*outsb_epp)(int, char *, int);
- void (*outsw_epp)(int, char *, int);
- void (*outsl_epp)(int, char *, int);
- void (*insb_epp)(int, char *, int);
- void (*insw_epp)(int, char *, int);
- void (*insl_epp)(int, char *, int);
-
- char (*r_dtr)(int);
- char (*r_str)(int);
- char (*r_ctr)(int);
- char (*r_epp)(int);
- char (*r_ecr)(int);
- char (*r_fifo)(int);
-
- void (*w_dtr)(int, char);
- void (*w_str)(int, char);
- void (*w_ctr)(int, char);
- void (*w_epp)(int, char);
- void (*w_ecr)(int, char);
- void (*w_fifo)(int, char);
-};
-.Ed
-.Pp
-This structure is the interface between
-.Xr ppc 4
-layer and upper ppbus system levels. For each ppc device, this
-structure is filled with generic i/o functions that may be redefined if
-needed for particular chipsets.
-.Pp
-Developers are really encouraged to use the
-exec_microseq entry to avoid indirect function call overhead. See
-.Xr microseq 9
-for more info.
-.Ss The ppbus layer
-.Bd -literal
-struct ppb_driver
-{
- struct ppb_device *(*probe)(struct ppb_data *ppb);
- int (*attach)(struct ppb_device *pdp);
- char *name;
-};
-.Ed
-.Bd -literal
-struct ppb_data {
-
-#define PPB_PnP_PRINTER 0
-#define PPB_PnP_MODEM 1
-#define PPB_PnP_NET 2
-#define PPB_PnP_HDC 3
-#define PPB_PnP_PCMCIA 4
-#define PPB_PnP_MEDIA 5
-#define PPB_PnP_FDC 6
-#define PPB_PnP_PORTS 7
-#define PPB_PnP_SCANNER 8
-#define PPB_PnP_DIGICAM 9
-#define PPB_PnP_UNKNOWN 10
- int class_id; /* not a PnP device if class_id < 0 */
-
- ushort mode; /* IEEE 1284-1994 mode
- * NIBBLE, PS2, EPP, ECP */
- ushort avm; /* IEEE 1284-1994 available
- * modes */
-
- struct ppb_link *ppb_link; /* link to the adapter */
- struct ppb_device *ppb_owner; /* device which owns the bus */
- LIST_HEAD(, ppb_device) ppb_devs; /* list of devices on the bus */
- LIST_ENTRY(ppb_data) ppb_chain; /* list of busses */
-};
-.Ed
-.Ss The device layer
-.Bd -literal
-/* microseqences used for GET/PUT operations */
-struct ppb_xfer {
- struct ppb_microseq *prolog; /* loop prologue */
- struct ppb_microseq *body; /* loop body */
- struct ppb_microseq *epilog; /* loop epilogue */
-};
-.Ed
-.Bd -literal
-struct ppb_context {
- int valid; /* 1 if the struct is valid */
- int mode; /* operating mode */
-
- struct microseq *curpc; /* pc in curmsq */
- struct microseq *curmsq; /* currently executed microseq */
-};
-.Ed
-.Bd -literal
-struct ppb_device {
-
- int id_unit; /* unit of the device */
- char *name; /* name of the device */
-
- ushort mode; /* current mode of the device */
- ushort avm; /* available modes of the device */
-
- struct ppb_context ctx; /* context of the device */
-
- /* mode dependent get msq. If NULL,
- * IEEE1284 code is used */
- struct ppb_xfer
- get_xfer[PPB_MAX_XFER];
-
- /* mode dependent put msq. If NULL,
- * IEEE1284 code is used */
- struct ppb_xfer
- put_xfer[PPB_MAX_XFER];
-
- void (*intr)(int); /* interrupt handler */
-
- struct ppb_data *ppb; /* link to the ppbus */
-
- LIST_ENTRY(ppb_device) chain; /* list of devices on the bus */
-};
-.Ed
-.Ss Linking these structures all together
-.Bd -literal
-struct ppb_link {
-
- int adapter_unit; /* unit of the adapter */
- int base; /* base address of the port */
- int id_irq; /* != 0 if irq enabled */
-
-#define EPP_1_9 0x0 /* default */
-#define EPP_1_7 0x1
- int epp_protocol; /* EPP protocol: 0=1.9, 1=1.7 */
-
- struct ppb_adapter *adapter; /* link to the ppc adapter */
- struct ppb_data *ppbus; /* link to the ppbus */
-};
-.Ed
-.Sh EXAMPLE
-See vpo.c source file.
-.Sh SEE ALSO
-.Xr ppbus 4 ,
-.Xr ppi 4 ,
-.Xr microseq 9
-.Sh HISTORY
-The
-.Nm
-manual page first appeared in
-.Fx 3.0 .
-.Sh AUTHOR
-This
-manual page was written by
-.An Nicolas Souchu .
diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9
index 2d9410b30a6c..351de02e2cb6 100644
--- a/share/man/man9/sleep.9
+++ b/share/man/man9/sleep.9
@@ -23,16 +23,14 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: sleep.9,v 1.12 1998/12/21 10:34:53 dillon Exp $
+.\" $Id: sleep.9,v 1.9 1997/04/11 17:49:56 bde Exp $
.\" "
-.Dd December 17, 1998
+.Dd April 3, 1996
.Os
.Dt SLEEP 9
.Sh NAME
.Nm sleep ,
.Nm tsleep ,
-.Nm asleep ,
-.Nm await ,
.Nm wakeup
.Nd wait for events
.Sh SYNOPSIS
@@ -41,10 +39,6 @@
.Fd #include <sys/proc.h>
.Ft int
.Fn tsleep "void *ident" "int priority" "const char *wmesg" "int timo"
-.Ft int
-.Fn asleep "void *ident" "int priority" "const char *wmesg" "int timo"
-.Ft int
-.Fn await "int priority" "int timo"
.Ft void
.Fn wakeup "void *ident"
.Ft void
@@ -112,107 +106,10 @@ is returned if the system call should be interrupted by the signal
is the traditional form. It doesn't let you specify a timeout nor a
.Ar wmesg ,
hence its use is deprecated.
-.Pp
-.Nm Asleep
-implements the new asynchronous sleep function. It takes the same arguments
-as
-.Fn tsleep
-and places the process on the appropriate wait queue, but
-.Fn asleep
-leaves the process runnable and returns immediately. The caller is then
-expected to, at some point in the future, call
-.Fn await
-to actually wait for the previously queued wait condition.
-If
-.Fn asleep
-is called several times, only the most recent call is effective.
-.Fn asleep
-may be called with an
-.Ar ident
-value of NULL
-to remove any previously queued condition.
-.Pp
-.Nm Await
-implements the new asynchronous wait function. When
-.Fn asleep
-is called on an identifier it associates the process with that
-identifier but does not block.
-.Fn await
-will actually block the process until
-.Fn wakeup
-is called on that identifier any time after the
-.Fn asleep .
-If
-.Fn wakeup
-is called after you
-.Fn asleep
-but before you
-.Fn await
-then the
-.Fn await
-call is effectively a NOP.
-If
-.Fn await
-is called multiple times without an intervening
-.Fn asleep ,
-the
-.Fn await
-is effectively a NOP but will also call
-.Fn mswitch
-for safety. The
-.Fn await
-function allows you to override the priority and timeout values to be used.
-If the value -1 is specified for an argument, the value is taken from the
-previous
-.Fn asleep
-call. If -1 is passed for the priority you must be prepared to catch signal
-conditions if the prior call to
-.Fn asleep
-specified it in its priority. If -1 is passed for the timeout you must be
-prepared to catch a timeout condition if the prior call to
-.Fn asleep
-specified a timeout. When you use -1, it is usually a good idea to not make
-assumptions as to the arguments used by the prior
-.Fn asleep
-call.
-.Pp
-The
-.Fn asleep
-and
-.Fn await
-functions are mainly used by the kernel to shift the burden of blocking
-away from extremely low level routines and to push it onto their callers.
-This in turn allows more complex interlocking code to
-.Em backout
-of a temporary resource failure
-(such as lack of memory) in order to release major locks prior to actually
-blocking, and to then retry the operation on wakeup. This key feature is
-expected to be heavily used in SMP situations in order to allow code to make
-better use of spinlocks. A spinlock, by its very nature, cannot be used
-around code that might block. It is hoped that these capabilities will
-make it easier to migrate the SMP master locks deeper into the kernel.
-.Pp
-These routines may also be used to avoid nasty spl*() calls to get around
-race conditions with simple conditional test/wait interlocks. You simple
-call
-.Fn asleep
-prior to your test, then conditonally
-.Fn await
-only if the test fails. It is usually a good idea to cancel an
-.Fn asleep
-if you wind up never calling the related
-.Fn await ,
-but it is not required. If you do not want to waste cpu calling
-.Fn asleep
-unnecessarily, you can surround the whole thing with a second test. The
-race condition is still handled by the inside
-.Fn asleep
-call.
.Sh RETURN VALUES
See above.
.Sh SEE ALSO
-.Xr ps 1 ,
-.Xr malloc 9
+.Xr ps 1
.Sh HISTORY
The sleep/wakeup process synchronization mechanism is very old. It
appeared in a very early version of Unix.
@@ -220,12 +117,7 @@ appeared in a very early version of Unix.
.Nm Tsleep
appeared in
.Bx 4.4 .
-.Pp
-.Nm Asleep/await
-first appeared in FreeBSD-3.0.1 and is designed to shift the burden of blocking
-away from extremely low level routines and push it up to their callers.
.Sh AUTHORS
This man page has been written by
.ie t J\(:org Wunsch.
-.el Joerg Wunsch.
-asleep/await designed and written by Matthew Dillon.
+.el Joerg Wunsch.
diff --git a/share/man/man9/spl.9 b/share/man/man9/spl.9
index ef1a19cad830..f4befd45aaf6 100644
--- a/share/man/man9/spl.9
+++ b/share/man/man9/spl.9
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: spl.9,v 1.6 1998/01/16 18:14:34 bde Exp $
+.\" $Id: spl.9,v 1.5 1997/04/13 14:49:09 bde Exp $
.\" "
.Dd July 21, 1996
.Os
@@ -84,7 +84,7 @@ Each driver that uses interrupts is normally assigned to an interrupt
priority group by a keyword in its config line.
For example:
.Bd -literal -offset indent
-device foo0 at isa? port 0x0815 irq 12 tty
+device foo0 at isa? port 0x0815 irq 12 tty vector foointr
.Ed
.Pp
assigns interrupt 12 to the
diff --git a/share/misc/Makefile b/share/misc/Makefile
index 6fa7a3d41435..6cf2e7cfbe5d 100644
--- a/share/misc/Makefile
+++ b/share/misc/Makefile
@@ -1,8 +1,8 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/8/93
-# $Id: Makefile,v 1.14 1998/09/11 16:38:20 dt Exp $
+# $Id: Makefile,v 1.13 1998/06/21 04:46:53 jkh Exp $
FILES= ascii birthtoken bsd-family-tree eqnchar flowers init.ee inter.phone \
- iso3166 iso639 man.template mdoc.template operator scsi_modes
+ iso3166 man.template mdoc.template operator scsi_modes
NOOBJ= noobj
all clean cleandir depend lint tags:
diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree
index 033d0e50aabc..43a962d61999 100644
--- a/share/misc/bsd-family-tree
+++ b/share/misc/bsd-family-tree
@@ -12,24 +12,24 @@ Fourth Edition (V4)
Fifth Edition (V5)
|
Sixth Edition (V6) -----*
- \ |
- \ |
- \ |
+ | |
+ | |
+ | |
Seventh Edition (V7) |
- \ |
- \ 1BSD
- 32V |
- \ 2BSD---------------*
- \ / |
- \ / |
- \/ |
- 3BSD |
- | |
- 4.0BSD 2.7.9BSD
- | |
- *------ 4.1BSD --------------> 2.8BSD
- / | |
-Eighth Edition | 2.8.1BSD
+ | \ |
+ | \ 1BSD
+ | 32V |
+ | \ 2BSD---------------*
+Eight Edition \ / |
+ | \ / |
+ | \/ |
+ | 3BSD |
+ | | |
+ | 4.0BSD 2.7.9BSD
+Ninth Edition | |
+ | 4.1BSD --------------> 2.8BSD
+ | | |
+ | | 2.8.1BSD
| | |
| 4.1aBSD -----------\ |
| | \ |
@@ -39,15 +39,15 @@ Eighth Edition | 2.8.1BSD
| | |
| | 2.9BSD-Seismo
| | |
- +----<--- 4.2BSD 2.9.1BSD
+ | 4.2BSD 2.9.1BSD
| | |
- +----<--- 4.3BSD -------------> 2.10BSD
+ | 4.3BSD -------------> 2.10BSD
| | / |
-Ninth Edition | / 2.10.1BSD
+ | | / 2.10.1BSD
| 4.3BSD Tahoe-----+ |
| | \ |
| | \ |
- v | 2.11BSD
+ | | 2.11BSD
Tenth Edition | |
| 2.11BSD rev #366
4.3BSD NET/1 |
@@ -97,10 +97,10 @@ FreeBSD 2.1 |
| | NetBSD 1.3.1 |
| FreeBSD 2.2.1 | OpenBSD 2.3
| | NetBSD 1.3.2 |
- | FreeBSD 2.2.2 | OpenBSD 2.4
- | | NetBSD 1.3.3 |
- | FreeBSD 2.2.5 | v
+ | FreeBSD 2.2.2 | v
| | v
+ | FreeBSD 2.2.5
+ | |
| v
| FreeBSD 2.2.6
| |
@@ -113,8 +113,6 @@ FreeBSD 2.1 |
|
FreeBSD 3.0
|
-FreeBSD 3.1
- |
v
@@ -142,7 +140,6 @@ it was the announcement in Usenet or if it was available as tape.
comp.bugs.4bsd.ucb-fixes, June 15, 1988.
[SMS] Steven M. Schultz. 2.11BSD, UNIX for the PDP-11.
[FBD] FreeBSD Project, The.
-[dmr] Dennis Ritchie, via E-Mail
Multics 1965
@@ -164,12 +161,6 @@ Sixth Edition 1975-05-xx [QCU]
Seventh Edition 1979-01-xx [QCU]
first portable Unix
Eight Edition 1985-02-xx [QCU]
- VAX 11/750, VAX 11/780 [dmr]
- descended from 4.1c BSD [dmr]
- descended from 4.1 BSD [44B]
- scooping-out and replacement of the character-device
- and networking part by the streams mechanism
-
Ninth Edition 1986-09-xx [QCU]
Tenth Edition 1989-10-xx [QCU]
@@ -234,8 +225,6 @@ FreeBSD 2.2.2 1997-06-xx [FBD]
FreeBSD 2.2.5 1997-11-xx [FBD]
FreeBSD 2.2.6 1998-03-xx [FBD]
FreeBSD 2.2.7 1998-07-xx [FBD]
-FreeBSD 2.2.8 1998-11-29 [FBD]
-FreeBSD 3.0 1998-10-16 [FBD]
@@ -282,7 +271,6 @@ original BSD announcements from Usenet or tapes.
Steven M. Schultz for providing 2.8BSD, 2.10BSD, 2.11BSD manual pages.
--
-Copyright (c) 1997-1999 Wolfram Schneider <wosch@FreeBSD.ORG>
-URL: ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/share/misc/bsd-family-tree
-
-$Date: 1999/01/12 16:14:24 $ $Revision: 1.10 $
+Copyright (c) 1997 Wolfram Schneider <wosch@FreeBSD.ORG>
+URL: http://www.de.freebsd.org/de/ftp/unix-stammbaum
+$Date: 1998/08/13 10:10:10 $ $Revision: 1.8 $
diff --git a/share/misc/iso639 b/share/misc/iso639
deleted file mode 100644
index 351613e11b3a..000000000000
--- a/share/misc/iso639
+++ /dev/null
@@ -1,176 +0,0 @@
-# $Id$
-#
-# ISO 639 language codes
-#
-# Technical contents of ISO 639:1988 (E/F) "Code for the representation of
-# names of languages".
-#
-# The Registration Authority for ISO 639 is
-#
-# Infoterm,
-# Osterreiches Normungsinstitut (ON),
-# Postfach 130,
-# A-1021 Vienna,
-# Austria.
-#
-aa Afar
-ab Abkhazian
-af Afrikaans
-am Amharic
-ar Arabic
-as Assamese
-ay Aymara
-az Azerbaijani
-
-ba Bashkir
-be Byelorussian
-bg Bulgarian
-bh Bihari
-bi Bislama
-bn Bengali; Bangla
-bo Tibetan
-br Breton
-
-ca Catalan
-co Corsican
-cs Czech
-cy Welsh
-
-da Danish
-de German
-dz Bhutani
-
-el Greek
-en English
-eo Esperanto
-es Spanish
-et Estonian
-eu Basque
-
-fa Persian
-fi Finnish
-fj Fiji
-fo Faeroese
-fr French
-fy Frisian
-
-ga Irish
-gd Scots Gaelic
-gl Galician
-gn Guarani
-gu Gujarati
-
-ha Hausa
-hi Hindi
-hr Croatian
-hu Hungarian
-hy Armenian
-
-ia Interlingua
-ie Interlingue
-ik Inupiak
-in Indonesian
-is Icelandic
-it Italian
-iw Hebrew
-
-ja Japanese
-ji Yiddish
-jw Javanese
-
-ka Georgian
-kk Kazakh
-kl Greenlandic
-km Cambodian
-kn Kannada
-ko Korean
-ks Kashmiri
-ku Kurdish
-ky Kirghiz
-
-la Latin
-ln Lingala
-lo Laothian
-lt Lithuanian
-lv Latvian, Lettish
-
-mg Malagasy
-mi Maori
-mk Macedonian
-ml Malayalam
-mn Mongolian
-mo Moldavian
-mr Marathi
-ms Malay
-mt Maltese
-my Burmese
-
-na Nauru
-ne Nepali
-nl Dutch
-no Norwegian
-
-oc Occitan
-om (Afan) Oromo
-or Oriya
-
-pa Punjabi
-pl Polish
-ps Pashto, Pushto
-pt Portuguese
-
-qu Quechua
-
-rm Rhaeto-Romance
-rn Kirundi
-ro Romanian
-ru Russian
-rw Kinyarwanda
-
-sa Sanskrit
-sd Sindhi
-sg Sangro
-sh Serbo-Croatian
-si Singhalese
-sk Slovak
-sl Slovenian
-sm Samoan
-sn Shona
-so Somali
-sq Albanian
-sr Serbian
-ss Siswati
-st Sesotho
-su Sundanese
-sv Swedish
-sw Swahili
-
-ta Tamil
-te Tegulu
-tg Tajik
-th Thai
-ti Tigrinya
-tk Turkmen
-tl Tagalog
-tn Setswana
-to Tonga
-tr Turkish
-ts Tsonga
-tt Tatar
-tw Twi
-
-uk Ukrainian
-ur Urdu
-uz Uzbek
-
-vi Vietnamese
-vo Volapuk
-
-wo Wolof
-
-xh Xhosa
-
-yo Yoruba
-
-zh Chinese
-zu Zulu \ No newline at end of file
diff --git a/share/mk/Makefile b/share/mk/Makefile
index 80d331122d51..0170c3682d06 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -1,11 +1,10 @@
-# $Id: Makefile,v 1.20 1998/09/09 10:17:34 bde Exp $
+# $Id: Makefile,v 1.19 1998/08/29 11:01:22 wosch Exp $
# @(#)Makefile 8.1 (Berkeley) 6/8/93
FILES= bsd.README
FILES+= bsd.dep.mk bsd.doc.mk bsd.docb.mk bsd.info.mk bsd.kern.mk bsd.kmod.mk
FILES+= bsd.lib.mk bsd.libnames.mk bsd.man.mk bsd.obj.mk bsd.own.mk
-FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk
-FILES+= bsd.prog.mk bsd.sgml.mk bsd.subdir.mk
+FILES+= bsd.port.mk bsd.port.subdir.mk bsd.prog.mk bsd.sgml.mk bsd.subdir.mk
FILES+= sys.mk
NOOBJ= noobj
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index b24e9c328571..1dc24d211248 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -1,4 +1,4 @@
-# $Id: bsd.dep.mk,v 1.25 1998/06/05 18:38:54 dt Exp $
+# $Id: bsd.dep.mk,v 1.24 1998/05/15 09:34:48 bde Exp $
#
# The include file <bsd.dep.mk> handles Makefile dependencies.
#
@@ -135,8 +135,7 @@ tags: ${SRCS} _SUBDIR
.if !target(cleandepend)
cleandepend: _SUBDIR
.if defined(SRCS)
- rm -f ${DEPENDFILE} ${.OBJDIR}/GPATH ${.OBJDIR}/GRTAGS \
- ${.OBJDIR}/GSYMS ${.OBJDIR}/GTAGS
+ rm -f ${DEPENDFILE} ${.OBJDIR}/GRTAGS ${.OBJDIR}/GSYMS ${.OBJDIR}/GTAGS
.if defined(HTML)
rm -rf ${.OBJDIR}/HTML
.endif
diff --git a/share/mk/bsd.docb.mk b/share/mk/bsd.docb.mk
index 014e4817825c..1eb2d5b2a715 100644
--- a/share/mk/bsd.docb.mk
+++ b/share/mk/bsd.docb.mk
@@ -1,7 +1,7 @@
-# $Id$
-#
# The include file <bsd.docb.mk> handles installing SGML/docbook documents.
#
+# $Id
+#
# +++ variables +++
#
# DOC Name of the document.
@@ -52,4 +52,5 @@ install:
${INSTALL} ${COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
${_docs} ${DESTDIR}${DOCDIR}/${VOLUME}
+.include <bsd.dep.mk>
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk
index 29b57249679d..2257c59909a7 100644
--- a/share/mk/bsd.info.mk
+++ b/share/mk/bsd.info.mk
@@ -1,4 +1,4 @@
-# $Id: bsd.info.mk,v 1.53 1999/01/20 05:48:19 markm Exp $
+# $Id: bsd.info.mk,v 1.50 1998/05/06 18:44:01 bde Exp $
#
# The include file <bsd.info.mk> handles installing GNU (tech)info files.
# Texinfo is a documentation system that uses a single source
@@ -93,7 +93,6 @@ INFOSECTION?= Miscellaneous
ICOMPRESS_CMD?= ${COMPRESS_CMD}
ICOMPRESS_EXT?= ${COMPRESS_EXT}
FORMATS?= info
-GREP?= grep
INFO2HTML?= info2html
TEX?= tex
DVIPS?= dvips
@@ -160,25 +159,9 @@ ${x:S/$/${ICOMPRESS_EXT}/}: ${x}
.for x in ${INFO}
INSTALLINFODIRS+= ${x:S/$/-install/}
${x:S/$/-install/}: ${DESTDIR}${INFODIR}/${INFODIRFILE}
- -__section=`${GREP} "^INFO-DIR-SECTION" ${x}.info`; \
- __entry=`${GREP} "^START-INFO-DIR-ENTRY" ${x}.info`; \
- if [ ! -z "$$__section" ]; then \
- if [ ! -z "$$__entry" ]; then \
- ${INSTALLINFO} ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}; \
- else \
- ${INSTALLINFO} --entry=${INFOENTRY_${x}} \
- ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}; \
- fi \
- else \
- if [ ! -z "$$__entry" ]; then \
- ${INSTALLINFO} --section=${INFOSECTION} \
- ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}; \
- else \
- ${INSTALLINFO} --section=${INFOSECTION} \
- --entry=${INFOENTRY_${x}} \
- ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}; \
- fi \
- fi
+ ${INSTALLINFO} --defsection=${INFOSECTION} \
+ --defentry=${INFOENTRY_${x}} \
+ ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
.endfor
.PHONY: ${INSTALLINFODIRS}
diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk
index 40e18cf84cae..003beaf0f9f7 100644
--- a/share/mk/bsd.kern.mk
+++ b/share/mk/bsd.kern.mk
@@ -1,24 +1,16 @@
-# $Id: bsd.kern.mk,v 1.11 1998/12/14 21:03:27 archie Exp $
+# $Id: bsd.kern.mk,v 1.9 1998/05/01 18:13:37 bde Exp $
#
# Warning flags for compiling the kernel and components of the kernel.
#
CWARNFLAGS?= -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
- -Wpointer-arith -Winline -Wuninitialized -Wformat -Wunused \
+ -Wpointer-arith -Winline -Wuninitialized -Wformat \
-fformat-extensions -ansi
#
# The following flags are next up for working on:
-# -W -Wcast-qual -Wall
+# -W -Wunused -Wcast-qual -Wall
#
# When working on removing warnings from code, the `-Werror' flag should be
# of material assistance.
#
-
-#
-# On the alpha, make sure that we don't use floating-point registers and
-# allow the use of EV56 instructions (only needed for low-level i/o).
-#
-.if ${MACHINE_ARCH} == "alpha"
-CFLAGS+= -mno-fp-regs -Wa,-mev56
-.endif
diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk
index c26a207bf2ad..900300f2f7f4 100644
--- a/share/mk/bsd.kmod.mk
+++ b/share/mk/bsd.kmod.mk
@@ -1,5 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $Id: bsd.kmod.mk,v 1.57 1998/11/05 04:01:55 peter Exp $
+# $Id: bsd.kmod.mk,v 1.55 1998/10/14 04:04:22 peter Exp $
#
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
#
@@ -189,11 +189,11 @@ ${PROG}: ${OBJS} ${DPADD} ${KMODDEPS}
.if defined(KMODDEPS)
.for dep in ${KMODDEPS}
-CLEANFILES+= ${dep} __${dep}_hack_dep.c
+CLEANFILES+= ${dep} ${dep}.c
${dep}:
- touch __${dep}_hack_dep.c
- ${CC} -shared ${CFLAGS} -o ${dep} __${dep}_hack_dep.c
+ touch ${dep}.c
+ ${CC} -shared ${CFLAGS} -o ${dep} ${dep}.c
.endfor
.endif
@@ -258,7 +258,7 @@ ${_ILINKS}:
ln -s $$path ${.TARGET}
.endif
-CLEANFILES+= ${PROG} ${OBJS} ${_ILINKS} lkm_verify_tmp symb.tmp tmp.o
+CLEANFILES+= ${KMOD} ${PROG} ${OBJS} ${_ILINKS} lkm_verify_tmp symb.tmp tmp.o
.if !target(install)
.if !target(beforeinstall)
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 0bfc484575a2..7e69c87e108e 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
-# $Id: bsd.lib.mk,v 1.83 1999/01/09 21:50:58 jdp Exp $
+# $Id: bsd.lib.mk,v 1.78 1998/08/30 20:33:27 jb Exp $
#
.if !target(__initialized__)
@@ -9,6 +9,13 @@ __initialized__:
.endif
.endif
+# Default executable format
+.if ${MACHINE} == "alpha"
+OBJFORMAT?= elf
+.else
+OBJFORMAT?= aout
+.endif
+
.if exists(${.CURDIR}/shlib_version)
SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
.if ${OBJFORMAT} == aout
@@ -16,25 +23,8 @@ SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
.endif
.endif
-# Set up the variables controlling shared libraries. After this section,
-# SHLIB_NAME will be defined only if we are to create a shared library.
-# SHLIB_LINK will be defined only if we are to create a link to it.
-# INSTALL_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
-.if defined(NOPIC)
-.undef SHLIB_NAME
-.undef INSTALL_PIC_ARCHIVE
-.else
-.if ${OBJFORMAT} == elf
-.if !defined(SHLIB_NAME) && defined(SHLIB_MAJOR)
-SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR}
-SHLIB_LINK?= lib${LIB}.so
-.endif
-SONAME?= ${SHLIB_NAME}
-.else
-.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
-SHLIB_NAME?= lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
-.endif
-.endif
+.if !defined(NOPIC) && ${OBJFORMAT} == elf
+SONAME?= lib${LIB}.so.${SHLIB_MAJOR}
.endif
.if defined(DESTDIR)
@@ -57,9 +47,9 @@ STRIP?= -s
.MAIN: all
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
-# .So used for PIC object files
+# .so used for PIC object files
.SUFFIXES:
-.SUFFIXES: .out .o .po .So .s .S .c .cc .cpp .cxx .m .C .f .y .l
+.SUFFIXES: .out .o .po .so .s .S .c .cc .cpp .cxx .m .C .f .y .l
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -71,7 +61,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.c.So:
+.c.so:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
@@ -86,7 +76,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.cc.So .C.So .cpp.So .cxx.So:
+.cc.so .C.so .cpp.so .cxx.so:
${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
@@ -101,7 +91,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.f.So:
+.f.so:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
@@ -116,7 +106,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.m.So:
+.m.so:
${OBJC} ${PICFLAG} -DPIC ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
@@ -133,7 +123,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.s.So:
+.s.so:
${CC} -x assembler-with-cpp -fpic -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c \
${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@@ -149,7 +139,7 @@ STRIP?= -s
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
-.S.So:
+.S.so:
${CC} -fpic -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
@@ -162,12 +152,20 @@ _LIBS=lib${LIB}.a
.endif
.endif
-.if defined(SHLIB_NAME)
-_LIBS+=${SHLIB_NAME}
+.if !defined(NOPIC)
+.if ${OBJFORMAT} == aout
+.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
+_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+.if defined(SHLIB_MAJOR)
+_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}
+.endif
.endif
.if defined(INSTALL_PIC_ARCHIVE)
_LIBS+=lib${LIB}_pic.a
.endif
+.endif
.if !defined(PICFLAG)
PICFLAG=-fpic
@@ -177,13 +175,13 @@ all: objwarn ${_LIBS} all-man _SUBDIR # llib-l${LIB}.ln
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
-lib${LIB}.a:: ${OBJS} ${STATICOBJS}
+lib${LIB}.a:: ${OBJS}
@${ECHO} building standard ${LIB} library
@rm -f lib${LIB}.a
- @${AR} cq lib${LIB}.a `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+ @${AR} cq lib${LIB}.a `lorder ${OBJS} | tsort -q` ${ARADD}
${RANLIB} lib${LIB}.a
-POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
+POBJS+= ${OBJS:.o=.po}
.if !defined(NOPROFILE)
lib${LIB}_p.a:: ${POBJS}
@${ECHO} building profiled ${LIB} library
@@ -196,27 +194,25 @@ lib${LIB}_p.a:: ${POBJS}
LDDESTDIRENV?= LIBRARY_PATH=${DESTDIR}${SHLIBDIR}:${DESTDIR}${LIBDIR}
.endif
-SOBJS+= ${OBJS:.o=.So}
+SOBJS+= ${OBJS:.o=.so}
-.if defined(SHLIB_NAME)
-${SHLIB_NAME}: ${SOBJS}
- @${ECHO} building shared library ${SHLIB_NAME}
- @rm -f ${SHLIB_NAME} ${SHLIB_LINK}
-.if defined(SHLIB_LINK)
- @ln -sf ${SHLIB_NAME} ${SHLIB_LINK}
-.endif
+.if !defined(NOPIC)
.if ${OBJFORMAT} == aout
- @${LDDESTDIRENV} ${CC} -shared -Wl,-x,-assert,pure-text \
- -o ${SHLIB_NAME} \
+lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS}
+ @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
+ @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+ @${LDDESTDIRENV} ${CC} -shared -Wl,-x -Wl,-assert -Wl,pure-text \
+ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
`lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD}
.else
+lib${LIB}.so.${SHLIB_MAJOR}: ${SOBJS}
+ @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}\)
+ @rm -f lib${LIB}.so.${SHLIB_MAJOR}
@${LDDESTDIRENV} ${CC} -shared -Wl,-x \
- -o ${SHLIB_NAME} -Wl,-soname,${SONAME} \
+ -o lib${LIB}.so.${SHLIB_MAJOR} -Wl,-soname,${SONAME} \
`lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD}
.endif
-.endif
-.if defined(INSTALL_PIC_ARCHIVE)
lib${LIB}_pic.a:: ${SOBJS}
@${ECHO} building special pic ${LIB} library
@rm -f lib${LIB}_pic.a
@@ -229,12 +225,10 @@ llib-l${LIB}.ln: ${SRCS}
.if !target(clean)
clean: _SUBDIR
- rm -f a.out ${OBJS} ${STATICOBJS} ${OBJS:S/$/.tmp/} ${CLEANFILES}
+ rm -f a.out ${OBJS} ${OBJS:S/$/.tmp/} ${CLEANFILES}
rm -f lib${LIB}.a # llib-l${LIB}.ln
rm -f ${POBJS} ${POBJS:S/$/.tmp/} lib${LIB}_p.a
- rm -f ${SOBJS} ${SOBJS:.So=.so} ${SOBJS:S/$/.tmp/} \
- ${SHLIB_NAME} ${SHLIB_LINK} \
- lib${LIB}.so.* lib${LIB}.so lib${LIB}_pic.a
+ rm -f ${SOBJS} ${SOBJS:S/$/.tmp/} lib${LIB}.so.* lib${LIB}_pic.a
.if defined(CLEANDIRS) && !empty(CLEANDIRS)
rm -rf ${CLEANDIRS}
.endif
@@ -242,17 +236,18 @@ clean: _SUBDIR
_EXTRADEPEND:
@TMP=_depend$$$$; \
- sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.So:/' < ${DEPENDFILE} \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < ${DEPENDFILE} \
> $$TMP; \
mv $$TMP ${DEPENDFILE}
-.if !defined(NOEXTRADEPEND) && defined(SHLIB_NAME)
+.if !defined(NOEXTRADEPEND) && !defined(NOPIC)
.if ${OBJFORMAT} == aout
- echo ${SHLIB_NAME}: \
+ echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \
`${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \
>> ${DEPENDFILE}
.else
.if defined(DPADD) && !empty(DPADD)
- echo ${SHLIB_NAME}: ${DPADD} >> ${DEPENDFILE}
+ echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \
+ ${DPADD} >> ${DEPENDFILE}
.endif
.endif
.endif
@@ -275,18 +270,29 @@ realinstall: beforeinstall
${INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
.endif
.endif
-.if defined(SHLIB_NAME)
+.if !defined(NOPIC)
+.if ${OBJFORMAT} == aout
+.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
+ ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \
+ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+ ${DESTDIR}${SHLIBDIR}
+.endif
+.else
+.if defined(SHLIB_MAJOR)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${INSTALLFLAGS} ${SHLINSTALLFLAGS} \
- ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
-.if defined(SHLIB_LINK)
- ln ${LN_FLAGS} -sf ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK}
+ lib${LIB}.so.${SHLIB_MAJOR} \
+ ${DESTDIR}${SHLIBDIR}
+ ln ${LN_FLAGS} -sf lib${LIB}.so.${SHLIB_MAJOR} \
+ ${DESTDIR}${SHLIBDIR}/lib${LIB}.so
.endif
.endif
.if defined(INSTALL_PIC_ARCHIVE)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
.endif
+.endif
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
@@ -334,7 +340,7 @@ all-man:
.include <bsd.dep.mk>
.if !exists(${DEPENDFILE})
-${OBJS} ${STATICOBJS} ${POBJS} ${SOBJS}: ${SRCS:M*.h}
+${OBJS} ${POBJS} ${SOBJS}: ${SRCS:M*.h}
.endif
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index a48e7aad1bf1..37476aa17112 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -1,4 +1,4 @@
-# $Id: bsd.libnames.mk,v 1.19 1998/11/18 01:53:56 jdp Exp $
+# $Id: bsd.libnames.mk,v 1.17 1998/09/15 10:27:20 gibbs Exp $
#
# The include file <bsd.libnames.mk> define library names.
# Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this
@@ -48,25 +48,10 @@ LIBMYTINFO?= ${DESTDIR}${LIBDIR}/libmytinfo.a
LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a
LIBOBJC?= ${DESTDIR}${LIBDIR}/libobjc.a
LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a
-
-# The static PAM library doesn't know its secondary dependencies,
-# so we have to specify them explictly.
-LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a # XXX doesn't exist
-MINUSLPAM?= -lpam
-.if defined(NOSHARED) && ${NOSHARED} != "no" && ${NOSHARED} != "NO"
-.ifdef MAKE_KERBEROS4
-LIBPAM+= ${LIBKRB} ${LIBDES}
-MINUSLPAM+= -lkrb -ldes
-.endif
-LIBPAM+= ${LIBRADIUS} ${LIBTACPLUS} ${LIBSKEY} ${LIBCRYPT} ${LIBMD}
-MINUSLPAM+= -lradius -ltacplus -lskey -lcrypt -lmd
-.endif
-
LIBPC?= ${DESTDIR}${LIBDIR}/libpc.a # XXX doesn't exist
LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a
LIBPERL?= ${DESTDIR}${LIBDIR}/libperl.a
LIBPLOT?= ${DESTDIR}${LIBDIR}/libplot.a # XXX doesn't exist
-LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a
LIBREADLINE?= ${DESTDIR}${LIBDIR}/libreadline.a
LIBRESOLV?= ${DESTDIR}${LIBDIR}/libresolv.a # XXX doesn't exist
LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a
@@ -75,7 +60,6 @@ LIBSCSI?= ${DESTDIR}${LIBDIR}/libscsi.a
LIBSKEY?= ${DESTDIR}${LIBDIR}/libskey.a
LIBSS?= ${DESTDIR}${LIBDIR}/libss.a
LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a
-LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a
LIBTCL?= ${DESTDIR}${LIBDIR}/libtcl.a
LIBTELNET?= ${DESTDIR}${LIBDIR}/libtelnet.a
LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index fe185aa61d8b..fece2848e2e5 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,4 +1,4 @@
-# $Id: bsd.own.mk,v 1.20 1998/10/19 20:09:17 imp Exp $
+# $Id: bsd.own.mk,v 1.18 1998/08/31 23:34:37 jb Exp $
#
# The include file <bsd.own.mk> set common variables for owner,
# group, mode, and directories. Defaults are in brackets.
@@ -131,7 +131,11 @@ MACHINE_ARCH?= i386
.endif
# Default executable format
+.if ${MACHINE_ARCH} == "alpha"
OBJFORMAT?= elf
+.else
+OBJFORMAT?= aout
+.endif
# Binaries
BINOWN?= root
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index 1b6428627223..39eafd6837d6 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -1,7 +1,7 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
-# $Id: bsd.port.mk,v 1.301 1999/01/11 13:04:18 asami Exp $
+# $Id: bsd.port.mk,v 1.292 1998/10/06 21:12:14 asami Exp $
# $NetBSD: $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
@@ -36,7 +36,6 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# makefile is being used on. Automatically set to
# "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
# OSREL - The release version (numeric) of the operating system.
-# OSVERSION - The value of __FreeBSD_version.
# PORTOBJFORMAT - The object format ("aout" or "elf").
#
# These variables are used to identify your port.
@@ -79,7 +78,7 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# MASTER_SITE_BACKUP - Backup location(s) for distribution files and patch
# files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
# (default:
-# ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/)
+# ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/)
# MASTER_SITE_OVERRIDE - If set, override the MASTER_SITES setting with this
# value.
# MASTER_SITE_FREEBSD - If set, only use ${MASTER_SITE_BACKUP} for
@@ -103,12 +102,6 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# setting ${BATCH}, or compiling only the interactive ports
# by setting ${INTERACTIVE}.
#
-# Set these if your port only makes sense to certain archetictures.
-# They are lists containing names for them (e.g., "alpha i386").
-#
-# ONLY_FOR_ARCHS - Only build ports if ${ARCH} matches one of these.
-# NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
-#
# Use these if your port uses some of the common software packages.
#
# USE_GMAKE - Says that the port uses gmake.
@@ -124,8 +117,6 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# Use this if you need to replace "#!" lines in scripts.
# PERL_VERSION - Full version of perl5 (see below for current value).
# PERL_VER - Short version of perl5 (see below for current value).
-# PERL_ARCH - Directory name of architecture dependent libraries
-# (value: ${ARCH}-freebsd).
# USE_IMAKE - Says that the port uses imake. Implies USE_X_PREFIX.
# XMKMF - Set to path of `xmkmf' if not in $PATH (default: xmkmf -a ).
# NO_INSTALL_MANPAGES - For imake ports that don't like the install.man
@@ -179,9 +170,6 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# LOCALBASE - Where non-X11 ports install things (default: /usr/local).
# PREFIX - Where *this* port installs its files (default: ${X11BASE}
# if USE_X_PREFIX is set, otherwise ${LOCALBASE}).
-# MASTERDIR - Where the port finds patches, package files, etc. Define
-# this is you have two or more ports that share most of the
-# files (default: ${.CURDIR}).
# PORTSDIR - The root of the ports tree. Defaults:
# FreeBSD/OpenBSD: /usr/ports
# NetBSD: /usr/opt
@@ -197,15 +185,17 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# unpacks to. (Default: ${WRKDIR}/${DISTNAME} unless
# NO_WRKSUBDIR is set, in which case simply ${WRKDIR}).
# NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
+# NO_WRKDIR - There's no work directory at all; port does this someplace
+# else.
# PATCHDIR - A directory containing any additional patches you made
# to port this software to FreeBSD (default:
-# ${MASTERDIR}/patches)
+# ${.CURDIR}/patches)
# SCRIPTDIR - A directory containing any auxiliary scripts
-# (default: ${MASTERDIR}/scripts)
+# (default: ${.CURDIR}/scripts)
# FILESDIR - A directory containing any miscellaneous additional files.
-# (default: ${MASTERDIR}/files)
+# (default: ${.CURDIR}/files)
# PKGDIR - A direction containing any package creation files.
-# (default: ${MASTERDIR}/pkg)
+# (default: ${.CURDIR}/pkg)
#
# Motif support:
#
@@ -291,10 +281,10 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
#
# Set these variables if your port doesn't need some of the steps.
# Note that there are no NO_PATCH or NO_CONFIGURE variables becuase
-# those steps are empty by default. NO_EXTRACT is not allowed anymore
-# since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
-# variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
+# those steps are empty by default. Also, NO_CHECKSUM is a user variable
+# and is not to be set in a port's Makefile. See above for NO_PACKAGE.
#
+# NO_EXTRACT - Use a dummy (do-nothing) extract target.
# NO_BUILD - Use a dummy (do-nothing) build target.
# NO_INSTALL - Use a dummy (do-nothing) install target.
#
@@ -334,8 +324,6 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
#
# MAKE_ENV - Additional environment vars passed to sub-make in build
# and install stages (default: see below).
-# MAKE_ARGS - Any extra arguments to sub-make in build and install
-# stages (default: none).
#
# For install:
#
@@ -391,57 +379,40 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# a different checksum and you intend to verify if
# the port still works with it.
-# Start of pre-makefile section.
-.if !defined(AFTERPORTMK)
-
# Get the architecture
-.if !defined(ARCH)
-ARCH!= /usr/bin/uname -m
-.endif
+ARCH!= uname -m
# Get the operating system type
-.if !defined(OPSYS)
-OPSYS!= /usr/bin/uname -s
-.endif
+OPSYS!= uname -s
# Get the operating system revision
-.if !defined(OSREL)
-OSREL!= /usr/bin/uname -r | sed -e 's/[-(].*//'
-.endif
-
-# Get __FreeBSD_version
-.if !defined(OSVERSION)
-.if exists(/sbin/sysctl)
-OSVERSION!= /sbin/sysctl -n kern.osreldate
-.else
-OSVERSION!= /usr/sbin/sysctl -n kern.osreldate
-.endif
-.endif
+OSREL!= uname -r | sed -e 's/[-(].*//'
+PLIST_SUB+= OSREL=${OSREL}
# Get the object format.
-.if !defined(PORTOBJFORMAT)
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-.endif
-
-MASTERDIR?= ${.CURDIR}
+CONFIGURE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+SCRIPTS_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+MAKE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+PLIST_SUB+= PORTOBJFORMAT=${PORTOBJFORMAT}
# If they exist, include Makefile.inc, then architecture/operating
# system specific Makefiles, then local Makefile.local.
-.if exists(${MASTERDIR}/../Makefile.inc)
-.include "${MASTERDIR}/../Makefile.inc"
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
.endif
-.if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
-.include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
-.elif exists(${MASTERDIR}/Makefile.${OPSYS})
-.include "${MASTERDIR}/Makefile.${OPSYS}"
-.elif exists(${MASTERDIR}/Makefile.${ARCH})
-.include "${MASTERDIR}/Makefile.${ARCH}"
+.if exists(${.CURDIR}/Makefile.${ARCH}-${OPSYS})
+.include "${.CURDIR}/Makefile.${ARCH}-${OPSYS}"
+.elif exists(${.CURDIR}/Makefile.${OPSYS})
+.include "${.CURDIR}/Makefile.${OPSYS}"
+.elif exists(${.CURDIR}/Makefile.${ARCH})
+.include "${.CURDIR}/Makefile.${ARCH}"
.endif
-.if exists(${MASTERDIR}/Makefile.local)
-.include "${MASTERDIR}/Makefile.local"
+.if exists(${.CURDIR}/Makefile.local)
+.include "${.CURDIR}/Makefile.local"
.endif
# These need to be absolute since we don't know how deep in the ports
@@ -456,82 +427,59 @@ LOCALBASE?= ${DESTDIR}/usr/local
X11BASE?= ${DESTDIR}/usr/X11R6
DISTDIR?= ${PORTSDIR}/distfiles
_DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
-EXTRACT_SUFX?= .tar.gz
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/templates
-
-.if exists(${MASTERDIR}/patches.${ARCH}-${OPSYS})
-PATCHDIR?= ${MASTERDIR}/patches.${ARCH}-${OPSYS}
-.elif exists(${MASTERDIR}/patches.${OPSYS})
-PATCHDIR?= ${MASTERDIR}/patches.${OPSYS}
-.elif exists(${MASTERDIR}/patches.${ARCH})
-PATCHDIR?= ${MASTERDIR}/patches.${ARCH}
+.if !defined(NO_WRKDIR)
+WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
.else
-PATCHDIR?= ${MASTERDIR}/patches
+WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}
.endif
-
-.if exists(${MASTERDIR}/scripts.${ARCH}-${OPSYS})
-SCRIPTDIR?= ${MASTERDIR}/scripts.${ARCH}-${OPSYS}
-.elif exists(${MASTERDIR}/scripts.${OPSYS})
-SCRIPTDIR?= ${MASTERDIR}/scripts.${OPSYS}
-.elif exists(${MASTERDIR}/scripts.${ARCH})
-SCRIPTDIR?= ${MASTERDIR}/scripts.${ARCH}
+.if defined(NO_WRKSUBDIR)
+WRKSRC?= ${WRKDIR}
.else
-SCRIPTDIR?= ${MASTERDIR}/scripts
+WRKSRC?= ${WRKDIR}/${DISTNAME}
.endif
-.if exists(${MASTERDIR}/files.${ARCH}-${OPSYS})
-FILESDIR?= ${MASTERDIR}/files.${ARCH}-${OPSYS}
-.elif exists(${MASTERDIR}/files.${OPSYS})
-FILESDIR?= ${MASTERDIR}/files.${OPSYS}
-.elif exists(${MASTERDIR}/files.${ARCH})
-FILESDIR?= ${MASTERDIR}/files.${ARCH}
+.if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
+PATCHDIR?= ${.CURDIR}/patches.${ARCH}-${OPSYS}
+.elif exists(${.CURDIR}/patches.${OPSYS})
+PATCHDIR?= ${.CURDIR}/patches.${OPSYS}
+.elif exists(${.CURDIR}/patches.${ARCH})
+PATCHDIR?= ${.CURDIR}/patches.${ARCH}
.else
-FILESDIR?= ${MASTERDIR}/files
+PATCHDIR?= ${.CURDIR}/patches
.endif
-.if exists(${MASTERDIR}/pkg.${ARCH}-${OPSYS})
-PKGDIR?= ${MASTERDIR}/pkg.${ARCH}-${OPSYS}
-.elif exists(${MASTERDIR}/pkg.${OPSYS})
-PKGDIR?= ${MASTERDIR}/pkg.${OPSYS}
-.elif exists(${MASTERDIR}/pkg.${ARCH})
-PKGDIR?= ${MASTERDIR}/pkg.${ARCH}
+.if exists(${.CURDIR}/scripts.${ARCH}-${OPSYS})
+SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}-${OPSYS}
+.elif exists(${.CURDIR}/scripts.${OPSYS})
+SCRIPTDIR?= ${.CURDIR}/scripts.${OPSYS}
+.elif exists(${.CURDIR}/scripts.${ARCH})
+SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}
.else
-PKGDIR?= ${MASTERDIR}/pkg
+SCRIPTDIR?= ${.CURDIR}/scripts
.endif
-.if defined(USE_IMAKE)
-USE_X_PREFIX= yes
-.endif
-.if defined(USE_X_PREFIX)
-USE_XLIB= yes
-.endif
-.if defined(USE_X_PREFIX)
-PREFIX?= ${X11BASE}
+.if exists(${.CURDIR}/files.${ARCH}-${OPSYS})
+FILESDIR?= ${.CURDIR}/files.${ARCH}-${OPSYS}
+.elif exists(${.CURDIR}/files.${OPSYS})
+FILESDIR?= ${.CURDIR}/files.${OPSYS}
+.elif exists(${.CURDIR}/files.${ARCH})
+FILESDIR?= ${.CURDIR}/files.${ARCH}
.else
-PREFIX?= ${LOCALBASE}
-.endif
-
+FILESDIR?= ${.CURDIR}/files
.endif
-# End of pre-makefile section.
-
-# Start of post-makefile section.
-.if !defined(BEFOREPORTMK)
-WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
-.if defined(NO_WRKSUBDIR)
-WRKSRC?= ${WRKDIR}
+.if exists(${.CURDIR}/pkg.${ARCH}-${OPSYS})
+PKGDIR?= ${.CURDIR}/pkg.${ARCH}-${OPSYS}
+.elif exists(${.CURDIR}/pkg.${OPSYS})
+PKGDIR?= ${.CURDIR}/pkg.${OPSYS}
+.elif exists(${.CURDIR}/pkg.${ARCH})
+PKGDIR?= ${.CURDIR}/pkg.${ARCH}
.else
-WRKSRC?= ${WRKDIR}/${DISTNAME}
+PKGDIR?= ${.CURDIR}/pkg
.endif
-PLIST_SUB+= OSREL=${OSREL}
-
-CONFIGURE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-SCRIPTS_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-MAKE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-PLIST_SUB+= PORTOBJFORMAT=${PORTOBJFORMAT}
-
.if defined(MANCOMPRESSED)
.if ${MANCOMPRESSED} != yes && ${MANCOMPRESSED} != no && \
${MANCOMPRESSED} != maybe
@@ -547,6 +495,18 @@ MANCOMPRESSED?= yes
MANCOMPRESSED?= no
.endif
+.if defined(USE_IMAKE)
+USE_X_PREFIX= yes
+.endif
+.if defined(USE_X_PREFIX)
+USE_XLIB= yes
+.endif
+.if defined(USE_X_PREFIX)
+PREFIX?= ${X11BASE}
+.else
+PREFIX?= ${LOCALBASE}
+.endif
+
.if defined(USE_GMAKE)
BUILD_DEPENDS+= gmake:${PORTSDIR}/devel/gmake
.endif
@@ -555,18 +515,11 @@ GNU_CONFIGURE= yes
BUILD_DEPENDS+= autoconf:${PORTSDIR}/devel/autoconf
.endif
-.if defined(REQUIRES_MOTIF) && defined(PARALLEL_PACKAGE_BUILD)
-BUILD_DEPENDS+= ${X11BASE}/lib/libXm.a:${PORTSDIR}/x11-toolkits/Motif-dummy
-.endif
-
PERL_VERSION= 5.00502
PERL_VER= 5.005
-PERL_ARCH= ${ARCH}-freebsd
PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
- PERL_VER=${PERL_VER} \
- PERL_ARCH=${PERL_ARCH}
-
-.if exists(/usr/bin/perl5) && ${OSVERSION} >= 300000
+ PERL_VER=${PERL_VER}
+.if exists(/usr/bin/perl5)
# 3.0-current after perl5 import
.if !exists(/usr/bin/perl${PERL_VERSION}) && defined(USE_PERL5)
.BEGIN:
@@ -589,7 +542,7 @@ LIB_DEPENDS+= X11.6:${PORTSDIR}/x11/XFree86
.endif
.if defined(USE_QT)
-LIB_DEPENDS+= qt.2:${PORTSDIR}/x11-toolkits/qt142
+LIB_DEPENDS+= qt.1:${PORTSDIR}/x11-toolkits/qt140
.endif
.if exists(${PORTSDIR}/../Makefile.inc)
@@ -622,7 +575,7 @@ MD5?= /usr/bin/md5
.else
MD5?= md5
.endif
-MD5_FILE= ${FILESDIR}/md5
+MD5_FILE?= ${FILESDIR}/md5
MAKE_FLAGS?= -f
MAKEFILE?= Makefile
@@ -665,6 +618,7 @@ EXTRACT_CMD?= /bin/tar
.else
EXTRACT_CMD?= /usr/bin/tar
.endif
+EXTRACT_SUFX?= .tar.gz
# Backwards compatability.
.if defined(EXTRACT_ARGS)
EXTRACT_BEFORE_ARGS?= ${EXTRACT_ARGS}
@@ -710,36 +664,28 @@ COMMENT?= ${PKGDIR}/COMMENT
DESCR?= ${PKGDIR}/DESCR
PLIST?= ${PKGDIR}/PLIST
TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
-PKGINSTALL?= ${PKGDIR}/INSTALL
-PKGDEINSTALL?= ${PKGDIR}/DEINSTALL
-PKGREQ?= ${PKGDIR}/REQ
-PKGMESSAGE?= ${PKGDIR}/MESSAGE
PKG_CMD?= /usr/sbin/pkg_create
PKG_DELETE?= /usr/sbin/pkg_delete
.if !defined(PKG_ARGS)
-PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`" ${EXTRA_PKG_ARGS}
-.if exists(${PKGINSTALL})
-PKG_ARGS+= -i ${PKGINSTALL}
+PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`"
+.if exists(${PKGDIR}/INSTALL)
+PKG_ARGS+= -i ${PKGDIR}/INSTALL
.endif
-.if exists(${PKGDEINSTALL})
-PKG_ARGS+= -k ${PKGDEINSTALL}
+.if exists(${PKGDIR}/DEINSTALL)
+PKG_ARGS+= -k ${PKGDIR}/DEINSTALL
.endif
-.if exists(${PKGREQ})
-PKG_ARGS+= -r ${PKGREQ}
+.if exists(${PKGDIR}/REQ)
+PKG_ARGS+= -r ${PKGDIR}/REQ
.endif
-.if exists(${PKGMESSAGE})
-PKG_ARGS+= -D ${PKGMESSAGE}
+.if exists(${PKGDIR}/MESSAGE)
+PKG_ARGS+= -D ${PKGDIR}/MESSAGE
.endif
.if !defined(NO_MTREE)
PKG_ARGS+= -m ${MTREE_FILE}
.endif
.endif
-.if defined(PKG_NOCOMPRESS)
-PKG_SUFX?= .tar
-.else
PKG_SUFX?= .tgz
-.endif
# where pkg_add records its dirty deeds.
PKG_DBDIR?= /var/db/pkg
@@ -791,29 +737,22 @@ INSTALL_TARGET?= install
# Popular master sites
MASTER_SITE_XCONTRIB+= \
ftp://crl.dec.com/pub/X11/contrib/%SUBDIR%/ \
- ftp://ftp.eu.net/X11/contrib/%SUBDIR%/
+ ftp://ftp.eu.net/X11/contrib/%SUBDIR%/
MASTER_SITE_GNU+= \
ftp://prep.ai.mit.edu/pub/gnu/%SUBDIR%/ \
- ftp://wuarchive.wustl.edu/systems/gnu/%SUBDIR%/ \
- ftp://ftp.kddlabs.co.jp/pub/gnu/%SUBDIR%/ \
- ftp://ftp.digex.net/pub/gnu/%SUBDIR%/ \
- ftp://ftp.univ-evry.fr/pub/gnu/%SUBDIR%/ \
- ftp://ftp.cdrom.com/pub/gnu/%SUBDIR%/ \
- ftp://ftp.duke.edu/pub/gnu/%SUBDIR%/ \
- ftp://ftp.gamma.ru/pub/gnu/%SUBDIR%/ \
- ftp://ftp.nihon-u.ac.jp/pub/gnu/%SUBDIR%/
+ ftp://wuarchive.wustl.edu/systems/gnu/%SUBDIR%/
MASTER_SITE_PERL_CPAN+= \
ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/%SUBDIR%/ \
ftp://ftp.cdrom.com/pub/perl/CPAN/modules/by-module/%SUBDIR%/
MASTER_SITE_TEX_CTAN+= \
- ftp://ftp.cdrom.com/pub/tex/ctan/%SUBDIR%/ \
- ftp://wuarchive.wustl.edu/packages/TeX/%SUBDIR%/ \
- ftp://ftp.funet.fi/pub/TeX/CTAN/%SUBDIR%/ \
- ftp://ftp.tex.ac.uk/tex-archive/%SUBDIR%/ \
- ftp://ftp.dante.de/tex-archive/%SUBDIR%/
+ ftp://ftp.cdrom.com/pub/tex/ctan/%SUBDIR%/ \
+ ftp://wuarchive.wustl.edu/packages/TeX/%SUBDIR%/ \
+ ftp://ftp.funet.fi/pub/TeX/CTAN/%SUBDIR%/ \
+ ftp://ftp.tex.ac.uk/tex-archive/%SUBDIR%/ \
+ ftp://ftp.dante.de/tex-archive/%SUBDIR%/
MASTER_SITE_SUNSITE+= \
ftp://sunsite.unc.edu/pub/Linux/%SUBDIR%/ \
@@ -825,18 +764,9 @@ MASTER_SITE_KDE+= \
ftp://ftp.kde.org/pub/kde/%SUBDIR%/ \
ftp://ftp.tuniv.szczecin.pl/pub/kde/%SUBDIR%/ \
ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/%SUBDIR%/ \
- ftp://ftp.dataplus.se/pub/linux/kde/%SUBDIR%/
-
-MASTER_SITE_COMP_SOURCES+= \
- ftp://gatekeeper.dec.com/pub/usenet/comp.sources.%SUBDIR%/ \
- ftp://ftp.uu.net/usenet/comp.sources.%SUBDIR%/ \
- ftp://rtfm.mit.edu/pub/usenet/comp.sources.%SUBDIR%/
-
-MASTER_SITE_GNOME+= \
- ftp://ftp.jimpick.com/pub/mirrors/gnome/sources/%SUBDIR%/ \
- ftp://ftp.geo.net/pub/gnome/sources/%SUBDIR%/ \
- ftp://gnomeftp.wgn.net/pub/gnome/sources/%SUBDIR%/ \
- ftp://ftp.gnome.org/pub/GNOME/sources/%SUBDIR%/
+ ftp://ftp.blaze.net.au/pub/kde/%SUBDIR%/ \
+ ftp://ftp.dataplus.se/pub/linux/kde/%SUBDIR%/ \
+ ftp://ftp.caldera.com/pub/mirrors/kde/%SUBDIR%/
# Empty declaration to avoid "variable MASTER_SITES recursive" error
MASTER_SITES?=
@@ -852,7 +782,7 @@ PATCH_SITES:= ${PATCH_SITES:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
# The primary backup site.
MASTER_SITE_BACKUP?= \
- ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
+ ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
# If the user has this set, go to the FreeBSD repository for everything.
.if defined(MASTER_SITE_FREEBSD)
@@ -861,7 +791,7 @@ MASTER_SITE_OVERRIDE= ${MASTER_SITE_BACKUP}
# Where to put distfiles that don't have any other master site
MASTER_SITE_LOCAL?= \
- ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/LOCAL_PORTS/
+ ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
# I guess we're in the master distribution business! :) As we gain mirror
# sites for distfiles, add them to this list.
@@ -923,11 +853,6 @@ EXTRACT_ONLY?= ${DISTFILES}
# Documentation
MAINTAINER?= ports@FreeBSD.ORG
-.if !target(maintainer)
-maintainer:
- @${ECHO} ${MAINTAINER}
-.endif
-
.if !defined(CATEGORIES)
.BEGIN:
@${ECHO_MSG} "CATEGORIES is mandatory."
@@ -957,7 +882,7 @@ HAS_CONFIGURE= yes
.endif
# Passed to most of script invocations
-SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
+SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
@@ -1085,33 +1010,6 @@ IGNORE= ": You have an old file \(${file}\) that could cause problems for some p
.endfor
.endif
-.if defined(ONLY_FOR_ARCHS)
-.for __ARCH in ${ONLY_FOR_ARCHS}
-.if ${MACHINE_ARCH:M${__ARCH}} != ""
-__ARCH_OK?= 1
-.endif
-.endfor
-.else
-__ARCH_OK?= 1
-.endif
-
-.if defined(NOT_FOR_ARCHS)
-.for __NARCH in ${NOT_FOR_ARCHS}
-.if ${MACHINE_ARCH:M${__NARCH}} != ""
-.undef __ARCH_OK
-.endif
-.endfor
-.endif
-
-.if !defined(__ARCH_OK)
-.if defined(ONLY_FOR_ARCHS)
-IGNORE= "is only for ${ONLY_FOR_ARCHS},"
-.else # defined(NOT_FOR_ARCHS)
-IGNORE= "does not run on ${NOT_FOR_ARCHS},"
-.endif
-IGNORE+= "and you are running ${ARCH}"
-.endif
-
.if !defined(NO_IGNORE)
.if (defined(IS_INTERACTIVE) && defined(BATCH))
IGNORE= "is an interactive port"
@@ -1125,10 +1023,6 @@ IGNORE= "does not require Motif"
IGNORE= "may not be placed on a CDROM: ${NO_CDROM}"
.elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
IGNORE= "is restricted: ${RESTRICTED}"
-.elif defined(NO_WRKDIR)
-IGNORE= "defines NO_WRKDIR, which is obsoleted. If you are defining NO_WRKDIR and NO_EXTRACT, try changing it to NO_WRKSUBDIR=yes and EXTRACT_ONLY= \(the right side intentionally left empty\)"
-.elif defined(NO_EXTRACT)
-IGNORE= "defines NO_EXTRACT, which is obsoleted. Try changing it to EXTRACT_ONLY= \(the right side intentionally left empty\)"
.elif defined(NO_CONFIGURE)
IGNORE= "defines NO_CONFIGURE, which is obsoleted"
.elif defined(NO_PATCH)
@@ -1139,8 +1033,8 @@ IGNORE= "is broken for ELF: ${BROKEN_ELF}"
IGNORE= "is marked as broken: ${BROKEN}"
.endif
-.if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING) && !defined(PARALLEL_PACKAGE_BUILD))
-IGNORE= "has to be built manually: ${MANUAL_PACKAGE_BUILD}"
+.if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
+IGNORE= "package has to be built manually: ${MANUAL_PACKAGE_BUILD}"
clean:
@${IGNORECMD}
.endif
@@ -1172,30 +1066,6 @@ reinstall:
package:
@${IGNORECMD}
.endif
-
-.endif
-
-.if defined(IGNORE) || defined(NO_PACKAGE)
-ignorelist: package-name
-.else
-ignorelist:
- @${DO_NADA}
-.endif
-
-################################################################
-# Clean directories for ftp or CDROM.
-################################################################
-
-.if defined(RESTRICTED)
-clean-restricted: delete-distfiles delete-package
-.else
-clean-restricted:
-.endif
-
-.if defined(NO_CDROM)
-clean-for-cdrom: delete-distfiles delete-package
-.else
-clean-for-cdrom:
.endif
.if defined(ALL_HOOK)
@@ -1236,6 +1106,12 @@ checksum: fetch
@${DO_NADA}
.endif
+# Disable extract
+.if defined(NO_EXTRACT) && !target(extract)
+extract: fetch
+ @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
+.endif
+
# Disable build
.if defined(NO_BUILD) && !target(build)
build: configure
@@ -1331,8 +1207,10 @@ do-fetch:
.if !target(do-extract)
do-extract:
+.if !defined(NO_WRKDIR)
@${RM} -rf ${WRKDIR}
@${MKDIR} ${WRKDIR}
+.endif
@for file in ${EXTRACT_ONLY}; do \
if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
then \
@@ -1417,9 +1295,9 @@ do-configure:
.if !target(do-build)
do-build:
.if defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+ @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
.else defined(USE_GMAKE)
- @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+ @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
.endif
.endif
@@ -1428,14 +1306,14 @@ do-build:
.if !target(do-install)
do-install:
.if defined(USE_GMAKE)
- @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
- @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
.endif
.else defined(USE_GMAKE)
- @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
- @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
.endif
.endif
.endif
@@ -1543,7 +1421,7 @@ _PORT_USE: .USE
${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
exit 1; \
else \
- ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/ >/dev/null; \
+ ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
fi; \
else \
${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
@@ -1714,6 +1592,7 @@ clean: pre-clean
@${MAKE} clean-depends
.endif
@${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
+.if !defined(NO_WRKDIR)
@if [ -d ${WRKDIR} ]; then \
if [ -w ${WRKDIR} ]; then \
${RM} -rf ${WRKDIR}; \
@@ -1721,6 +1600,9 @@ clean: pre-clean
${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
fi; \
fi
+.else
+ @${RM} -f ${WRKDIR}/.*_done ${TMPPLIST}
+.endif
.endif
.if !target(pre-distclean)
@@ -1729,12 +1611,8 @@ pre-distclean:
.endif
.if !target(distclean)
-distclean: pre-distclean clean delete-distfiles
-.endif
-
-.if !target(delete-distfiles)
-delete-distfiles:
- @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
+distclean: pre-distclean clean
+ @${ECHO_MSG} "===> Dist cleaning for ${PKGNAME}"
@(if [ "X${DISTFILES}${PATCHFILES}" != "X" -a -d ${_DISTDIR} ]; then \
cd ${_DISTDIR}; \
${RM} -f ${DISTFILES} ${PATCHFILES}; \
@@ -1853,6 +1731,19 @@ package-name:
@${ECHO} ${PKGNAME}
.endif
+# Show (recursively) all the packages this package depends on.
+
+.if !target(package-depends)
+package-depends:
+ @for dir in `${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
+ if [ -d $$dir ]; then \
+ (cd $$dir ; ${MAKE} package-name package-depends); \
+ else \
+ ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
+ fi; \
+ done
+.endif
+
# Build a package but don't check the package cookie
.if !target(repackage)
@@ -1867,10 +1758,7 @@ pre-repackage:
.if !target(package-noinstall)
package-noinstall:
- @${MKDIR} ${WRKDIR}
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} PACKAGE_NOINSTALL=yes real-package
- @${RM} ${TMPPLIST}
- -@${RMDIR} ${WRKDIR}
.endif
################################################################
@@ -1955,7 +1843,7 @@ lib-depends:
else \
target=${DEPENDS_TARGET}; \
fi; \
- if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \
+ if ${LDCONFIG} -r | ${GREP} -q -e "-l$$lib"; then \
${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - found"; \
else \
${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - not found"; \
@@ -1965,7 +1853,7 @@ lib-depends:
else \
(cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
- if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \
+ if ${LDCONFIG} -r | ${GREP} -q -e "-l$$lib"; then \
${TRUE}; \
else \
${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \
@@ -2024,35 +1912,16 @@ clean-depends:
.endif
.endif
-# Dependency lists: build and runtime. Print out directory names.
-
-build-depends-list:
+.if !target(depends-list)
+depends-list:
@for dir in `${ECHO} "${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
if [ -d $$dir ]; then \
- ${ECHO} $$dir; \
- else \
- ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
- fi; \
- done | sort -u
-
-run-depends-list:
- @for dir in `${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
- if [ -d $$dir ]; then \
- ${ECHO} $$dir; \
- else \
- ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
- fi; \
- done | sort -u
-
-# This one does not print out directory names -- it could take a long time.
-package-depends:
- @for dir in `${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
- if [ -d $$dir ]; then \
- (cd $$dir ; ${MAKE} package-name package-depends); \
+ (cd $$dir ; ${MAKE} package-name depends-list); \
else \
${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
fi; \
done
+.endif
################################################################
# Everything after here are internal targets and really
@@ -2064,7 +1933,7 @@ package-depends:
#
# distribution-name|port-path|installation-prefix|comment| \
# description-file|maintainer|categories|build deps|run deps
-
+#
.if !target(describe)
describe:
@${ECHO} -n "${PKGNAME}|${.CURDIR}|"; \
@@ -2082,12 +1951,12 @@ describe:
${ECHO} -n "|${MAINTAINER}|${CATEGORIES}|"; \
case "A${FETCH_DEPENDS}B${BUILD_DEPENDS}C${LIB_DEPENDS}D${DEPENDS}E" in \
ABCDE) ;; \
- *) cd ${.CURDIR} && ${ECHO} -n `${MAKE} build-depends-list|sort -u`;; \
+ *) cd ${.CURDIR} && ${ECHO} -n `${MAKE} depends-list|sort -u`;; \
esac; \
${ECHO} -n "|"; \
case "A${RUN_DEPENDS}B${LIB_DEPENDS}C${DEPENDS}D" in \
ABCD) ;; \
- *) cd ${.CURDIR} && ${ECHO} -n `${MAKE} run-depends-list|sort -u`;; \
+ *) cd ${.CURDIR} && ${ECHO} -n `${MAKE} package-depends|sort -u`;; \
esac; \
${ECHO} ""
.endif
@@ -2109,27 +1978,25 @@ README.html:
-e 's%%PKG%%${PKGNAME}g' \
-e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
-e '/%%COMMENT%%/d' \
- -e 's%%BUILD_DEPENDS%%'"`${MAKE} pretty-print-build-depends-list`"'' \
- -e 's%%RUN_DEPENDS%%'"`${MAKE} pretty-print-run-depends-list`"'' \
+ -e 's%%BUILD_DEPENDS%%'"`${MAKE} print-depends-list`"'' \
+ -e 's%%RUN_DEPENDS%%'"`${MAKE} print-package-depends`"'' \
>> $@
-# The following two targets require an up-to-date INDEX in ${PORTSDIR}
-
-.if !target(pretty-print-build-depends-list)
-pretty-print-build-depends-list:
+.if !target(print-depends-list)
+print-depends-list:
.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
defined(LIB_DEPENDS) || defined(DEPENDS)
@${ECHO} -n 'This port requires package(s) "'
- @${ECHO} -n `grep '^${PKGNAME}|' ${PORTSDIR}/INDEX | awk -F\| '{print $$8;}'`
+ @${ECHO} -n `${MAKE} depends-list | sort -u`
@${ECHO} '" to build.'
.endif
.endif
-.if !target(pretty-print-run-depends-list)
-pretty-print-run-depends-list:
+.if !target(print-package-depends)
+print-package-depends:
.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
@${ECHO} -n 'This port requires package(s) "'
- @${ECHO} -n `grep '^${PKGNAME}|' ${PORTSDIR}/INDEX | awk -F\| '{print $$9;}'`
+ @${ECHO} -n `${MAKE} package-depends | sort -u`
@${ECHO} '" to run.'
.endif
.endif
@@ -2218,17 +2085,17 @@ fake-pkg:
${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \
${CP} ${COMMENT} ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
- if [ -f ${PKGINSTALL} ]; then \
- ${CP} ${PKGINSTALL} ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
+ if [ -f ${PKGDIR}/INSTALL ]; then \
+ ${CP} ${PKGDIR}/INSTALL ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
fi; \
- if [ -f ${PKGDEINSTALL} ]; then \
- ${CP} ${PKGDEINSTALL} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
+ if [ -f ${PKGDIR}/DEINSTALL ]; then \
+ ${CP} ${PKGDIR}/DEINSTALL ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
fi; \
- if [ -f ${PKGREQ} ]; then \
- ${CP} ${PKGREQ} ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \
+ if [ -f ${PKGDIR}/REQ ]; then \
+ ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \
fi; \
- if [ -f ${PKGMESSAGE} ]; then \
- ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
+ if [ -f ${PKGDIR}/MESSAGE ]; then \
+ ${CP} ${PKGDIR}/MESSAGE ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
fi; \
for dep in `${MAKE} package-depends ECHO_MSG=/usr/bin/true | sort -u`; do \
if [ -d ${PKG_DBDIR}/$$dep ]; then \
@@ -2253,6 +2120,3 @@ depend:
.if !target(tags)
tags:
.endif
-
-.endif
-# End of post-makefile section.
diff --git a/share/mk/bsd.port.post.mk b/share/mk/bsd.port.post.mk
deleted file mode 100644
index be53028b5607..000000000000
--- a/share/mk/bsd.port.post.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-# $Id$
-
-AFTERPORTMK= yes
-
-.include <bsd.port.mk>
-
-.undef AFTERPORTMK
diff --git a/share/mk/bsd.port.pre.mk b/share/mk/bsd.port.pre.mk
deleted file mode 100644
index b4fc122add09..000000000000
--- a/share/mk/bsd.port.pre.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-# $Id$
-
-BEFOREPORTMK= yes
-
-.include <bsd.port.mk>
-
-.undef BEFOREPORTMK
diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk
index 45928f87d460..72a97b2df306 100644
--- a/share/mk/bsd.port.subdir.mk
+++ b/share/mk/bsd.port.subdir.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
-# $Id: bsd.port.subdir.mk,v 1.26 1998/11/08 10:29:53 asami Exp $
+# $Id: bsd.port.subdir.mk,v 1.23 1997/11/20 05:31:44 asami Exp $
#
# The include file <bsd.port.subdir.mk> contains the default targets
# for building ports subdirectories.
@@ -28,9 +28,8 @@
# Creating README.html for package.
#
# afterinstall, all, beforeinstall, build, checksum, clean,
-# clean-for-cdrom, clean-restricted, configure, deinstall,
-# depend, depends, describe, extract, fetch, fetch-list, ignorelist,
-# install, package, package-loop, readmes, realinstall, reinstall, tags
+# configure, deinstall, depend, describe, extract, fetch, fetch-list,
+# install, package, readmes, realinstall, reinstall, tags
#
@@ -79,11 +78,9 @@ ${SUBDIR}::
fi; \
${MAKE} all
-.for __target in all fetch fetch-list package package-loop extract configure \
- build clean clean-for-cdrom clean-restricted \
- deinstall depend depends describe distclean \
- reinstall tags checksum \
- ignorelist
+.for __target in all fetch fetch-list package extract configure \
+ build clean deinstall depend describe distclean \
+ reinstall tags checksum
.if !target(${__target})
${__target}: _SUBDIRUSE
.endif
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 783192d02bbd..5f7ed56e879d 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $Id: bsd.prog.mk,v 1.79 1998/10/18 09:35:17 obrien Exp $
+# $Id: bsd.prog.mk,v 1.77 1998/08/30 20:33:27 jb Exp $
.if !target(__initialized__)
__initialized__:
@@ -8,6 +8,9 @@ __initialized__:
.endif
.endif
+# Default executable format
+OBJFORMAT?= aout
+
.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .s .S
CFLAGS+=${COPTS} ${DEBUG_FLAGS}
@@ -92,7 +95,7 @@ realinstall: beforeinstall
${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}
.endif
.if defined(HIDEGAME)
- (cd ${DESTDIR}/${GBINDIR}; rm -f ${PROG}; ln -s dm ${PROG}; \
+ (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \
chown games:bin ${PROG})
.endif
.if defined(LINKS) && !empty(LINKS)
diff --git a/share/syscons/fonts/INDEX.fonts b/share/syscons/fonts/INDEX.fonts
index cf51b2b21ddf..56ee134676fa 100644
--- a/share/syscons/fonts/INDEX.fonts
+++ b/share/syscons/fonts/INDEX.fonts
@@ -1,5 +1,5 @@
#
-# $Id: INDEX.fonts,v 1.7 1997/09/22 21:44:36 wosch Exp $
+# $Id: INDEX.fonts,v 1.6 1997/02/22 13:56:36 peter Exp $
#
# database for vidfont(8)
#
@@ -43,7 +43,6 @@
# 8859-8 Hebrew
# 8859-9 Latin5, same as 8859-1 except for Turkish instead of Icelandic
# 8859-10 Latin6, for Eskimo/Scandinavian languages
-# 8859-15 Latin9, same as 8859-1 except for new haracters incl. Euro/OE/oe.
#
################################
# Language support: MENU, FONT
@@ -155,10 +154,6 @@ iso-thin-8x16.fnt:en:ISO-8859-1 West European, 8x16 (thin)
iso-thin-8x16.fnt:de:ISO-8859-1 Westeuropa, 8x16 (dünn)
iso-thin-8x16.fnt:fr:ISO-8859-1 Est européen, 8x16 (fine)
-iso15-thin-8x16.fnt:en:ISO-8859-15 West European, 8x16 (thin)
-iso15-thin-8x16.fnt:de:ISO-8859-15 Westeuropa, 8x16 (dünn)
-iso15-thin-8x16.fnt:fr:ISO-8859-15 Est européen, 8x16 (fine)
-
iso-8x8.fnt:en:ISO-8859-1 West European, 8x8
iso-8x8.fnt:de:ISO-8859-1 Westeuropa, 8x8
iso-8x8.fnt:fr:ISO-8859-1 Est européen, 8x8
diff --git a/share/syscons/fonts/Makefile b/share/syscons/fonts/Makefile
index 39e1001f242c..60b88452688d 100644
--- a/share/syscons/fonts/Makefile
+++ b/share/syscons/fonts/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.17 1998/05/04 11:24:00 phk Exp $
+# $Id: Makefile,v 1.16 1998/01/03 14:09:18 wosch Exp $
FONTS= cp437-8x8.fnt cp437-8x14.fnt cp437-8x16.fnt \
cp437-thin-8x8.fnt cp437-thin-8x16.fnt \
@@ -10,7 +10,7 @@ FONTS= cp437-8x8.fnt cp437-8x14.fnt cp437-8x16.fnt \
cp866b-8x16.fnt cp866c-8x16.fnt \
iso-8x8.fnt iso-8x14.fnt iso-8x16.fnt \
iso02-8x8.fnt iso02-8x14.fnt iso02-8x16.fnt \
- iso-thin-8x16.fnt iso15-thin-8x16.fnt \
+ iso-thin-8x16.fnt \
iso-8859-2-8x16.fnt \
koi8-r-8x8.fnt koi8-r-8x14.fnt koi8-r-8x16.fnt \
koi8-rb-8x16.fnt koi8-rc-8x16.fnt \
diff --git a/share/syscons/fonts/iso15-thin-8x16.fnt b/share/syscons/fonts/iso15-thin-8x16.fnt
deleted file mode 100644
index 2dabc22ac69a..000000000000
--- a/share/syscons/fonts/iso15-thin-8x16.fnt
+++ /dev/null
@@ -1,95 +0,0 @@
-begin 644 iso15-thin-8x16
-M```````````````````````````('#Y_/AP(``````!5JE6J5:I5JE6J5:I5
-MJE6J`%!0<%!0`!P("`@(``````#@@."`@``X(#@@(```````8("`@&``,"@P
-M*"@``````("`@(#@`#@@."`@````````&"0D)!@```````````````````@(
-M/@@(`#X``````."@H*"@`"`@("`X``````"@H*#@0``X$!`0$``````8&!@8
-M&!@8&/@```````````````````#X&!@8&!@8&```````````'Q@8&!@8&!@8
-M&!@8&!@8&!\`````````&!@8&!@8&!C_&!@8&!@8&`````#_````````````
-M``````````#_``````````````````````#_``````````````````````#_
-M````````````````````````````&!@8&!@8&!@?&!@8&!@8&!@8&!@8&!@8
-M^!@8&!@8&!@8&!@8&!@8&/\```````````````````#_&!@8&!@8&!@8&!@8
-M&!@8&!@8&!@8&!@````$"!`@0"`0"`0`?```````(!`(!`($"!`@`#X`````
-M`````$!`0'X``````````````"1"_T(D``````````````````@('!P^/G]_
-M``!_?SX^'!P("``````````````````````````````````0$!`0$!`0```0
-M$```````)"0D)````````````````"0D)'XD)"1^)"0D```````(/TA(2#X)
-M"0E^"````````#!),@0($"9)!@`````````8)"08)2(B(AT``````!@("!``
-M````````````````!`@0$!`0$!`(!````````!`(!`0$!`0$"!``````````
-M```D&'X8)`````````````@("'\("`@``````````````````````!@8"!``
-M````````?@`````````````````````````8&``````````!`@0($"!`@```
-M```````8)$)"0D)"0B08````````"!@("`@("`@('````````#Q"`@($"!`@
-M0'X````````\0@("'`("`D(\`````````@8*$B)"?P("`@```````'Y`0$!\
-M`@("0CP````````\0$!`?$)"0D(\````````?@("!`0("!`0$````````#Q"
-M0D(\0D)"0CP````````\0D)"0CX"`@(\````````````&!@``!@8````````
-M```````8&````!@("!``````!`@0($`@$`@$````````````?@``?@``````
-M```````@$`@$`@0($"`````````\0@("!`@0```0$````````!PB25555DP@
-M'@```````#Q"0D)"?D)"0D(```````!\0D)"?$)"0D)\````````/$)`0$!`
-M0$!"/````````'A$0D)"0D)"1'@```````!^0$!`?$!`0$!^````````?D!`
-M0'Q`0$!`0````````#Y`0$!.0D)"0CX```````!"0D)"?D)"0D)"````````
-M'`@("`@("`@('`````````X"`@("`@)"0CP```````!"1$A08&!02$1"````
-M````0$!`0$!`0$!`?@```````$%C54E!04%!04$```````!"8E)22DI&0D)"
-M````````/$)"0D)"0D)"/````````'Q"0D)"?$!`0$`````````\0D)"0D)"
-M0DH\!`(`````?$)"0D)\4$A$0@```````#Q"0$`\`@("0CP```````!_"`@(
-M"`@("`@(````````0D)"0D)"0D)"/````````$%!04%!(B(4%`@```````!!
-M04%!04%)56-!````````04$B%`@(%")!00```````$%!02(4"`@("`@`````
-M``!^`@($"!`@0$!^````````/"`@("`@("`@/`````````"`0"`0"`0"`0``
-M```````\!`0$!`0$!`0\````````"!0B````````````````````````````
-M`````/\``!@0$`@`````````````````````/$("/D)"/0```````$!`0'Q"
-M0D)"0GP````````````\0D!`0$(\`````````@("/D)"0D)"/@``````````
-M`#Q"0GY`0CP````````.$!!^$!`0$!`0````````````/D)"0D)"/@("/```
-M`$!`0'Q"0D)"0D(````````("``X"`@("`@(`````````@(`#@("`@("`@)"
-M/````$!`0$)$2'!(1$(```````!P$!`0$!`0$!`0````````````=DE)24E)
-M20```````````'Q"0D)"0D(````````````\0D)"0D(\````````````?$)"
-M0D)"?$!`0````````#Y"0D)"0CX"`@(```````!<8D!`0$!`````````````
-M/$)`/`)"/````````!`0$'P0$!`0$`X```````````!"0D)"0D(]````````
-M````0D)"0D(D&````````````$E)24E)238```````````!"0B08)$)"````
-M````````0D)"0D)"/@("/````````'X$"!`@0'X```````P0$!`0(!`0$!`,
-M```````0$!`0$!`0$!`0$!``````,`@("`@$"`@("#`````````R3```````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````$!```!`0$!`0$!``````````"`@\2DA(2CP("```````
-M'"(B('@@("`A?@```````!XA('X@?B`A'@````````!!(A0("#X(/@@(````
-M`"08`#Q"0$`\`@)"/````````#Q"(#Q"0D(\!$(\```````D&``\0D`\`D(\
-M````````/D%!75%174%!/@`````````X1$0^`'X`````````````"1(D2)!(
-M)!()`````````````/X"`@(`````````$!```!`0$!`0$!```````#Y!755=
-M655503X`````````?@```````````````````!@D)"08````````````````
-M```("#X("``^````````,$@0('@``````````````'`(,`AP````````````
-M)!@`?@($"!`@0$!^````````````0D)"0D)^04!`@````#Y*2DHZ"@H*"@H`
-M````````````&!@`````````````)!@`?@0($"!`?@```````!!P$!`0````
-M```````````8)!@`/````````````````)!()!()$B1(D````````'^(B(B.
-MB(B(B'\```````````!ND9&?D)%N`````!04`$%!(A0("`@("``````````0
-M$``0$!`@0$!"/```,`P`/$)"0GY"0D)"``````PP`#Q"0D)^0D)"0@`````8
-M)``\0D)"?D)"0D(`````,DP`/$)"0GY"0D)"```````D`#Q"0D)^0D)"0@``
-M```8)!@\0D)"?D)"0D(````````_2$A(?DA(2$A/````````/$)`0$!`0$!"
-M/`0"/``8!@`^("`@/"`@(#X`````!A@`/B`@(#P@("`^``````P2`#X@("`\
-M("`@/@`````4%``^("`@/"`@(#X`````&`8`'`@("`@("`@<``````88`!P(
-M"`@("`@('``````(%``<"`@("`@("!P`````%!0`'`@("`@("`@<````````
-M>$1"0O)"0D)$>```````&28`06%1245#04$`````,`P`/$)"0D)"0D(\````
-M``PP`#Q"0D)"0D)"/``````8)``\0D)"0D)"0CP`````,DP`/$)"0D)"0D(\
-M``````!F`#Q"0D)"0D)"/`````````""1"@0*$2"```````````9)D1*2E)2
-M(F28`````#`,`$)"0D)"0D)"/``````,,`!"0D)"0D)"0CP`````&"0`0D)"
-M0D)"0D(\``````!F`$)"0D)"0D)"/``````$"!!!02(4"`@("`@``````"`@
-M(#XA(2$Q+B`@("``````'B$A(3XA(2$Q+B``````$`@$`#Q"`CY"0CT`````
-M``0($``\0@(^0D(]```````0*$0`/$("/D)"/0```````#),`#Q"`CY"0CT`
-M```````D)``\0@(^0D(]```````<(AP`/$("/D)"/0```````````#8)"3Y(
-M2#X````````````\0D!`0$(\"`1X```@$`@`/$)"?D!"/```````!`@0`#Q"
-M0GY`0CP``````!@D0@`\0D)^0$(\````````)"0`/$)"?D!"/```````$`@$
-M`#@("`@("`@```````0($``X"`@("`@(```````(%"(`.`@("`@("```````
-M`"(B`#@("`@("`@````````P3`0\0D)"0D(\````````,DP`?$)"0D)"0@``
-M````(!`(`#Q"0D)"0CP```````@0(``\0D)"0D(\````````&"0`/$)"0D)"
-M/````````#),`#Q"0D)"0CP````````D```\0D)"0D(\```````````8&`#_
-M`!@8`````````````!TB14E1(EP``````"`0"`!"0D)"0D(]```````($"``
-M0D)"0D)"/0``````&"1"`$)"0D)"0CT````````D)`!"0D)"0D(]````````
-M!`@0`$)"0D)"/@("/```("`@/B$A(2$Q+B`@(``````D)```0D)"0D(^`@(\
-!``@0
-`
-end
diff --git a/share/syscons/keymaps/INDEX.keymaps b/share/syscons/keymaps/INDEX.keymaps
index 2d32bc8826ab..1535dc8217b3 100644
--- a/share/syscons/keymaps/INDEX.keymaps
+++ b/share/syscons/keymaps/INDEX.keymaps
@@ -1,4 +1,4 @@
-# $Id: INDEX.keymaps,v 1.22 1998/10/16 01:49:13 yokota Exp $
+# $Id: INDEX.keymaps,v 1.21 1998/08/10 06:51:47 imp Exp $
#
# database for kbdmap(8)
#
@@ -26,220 +26,177 @@ MENU:de:Wähle Deine Tastaturbelegung
MENU:fr:Choisissez la nationalité de votre clavier
MENU:pl:Wybierz uk³ad klawiatury
MENU:pt:Escolha o layout do teclado
-MENU:es:Seleccione el tipo de su teclado
#
FONT:en:cp437-8x16.fnt
-FONT:de,fr,da,no,sv,pt,es:iso-8x16.fnt
+FONT:de,fr,da,no,sv,pt:iso-8x16.fnt
FONT:ru:koi8-r-8x16.fnt
FONT:pl:iso02-8x16.fnt
#
be.iso.kbd:en:Belgian ISO-8859-1
be.iso.kbd:de:Belgisch ISO-8859-1
-be.iso.kbd:pt,es:Belga ISO-8859-1
+be.iso.kbd:pt:Belga ISO-8859-1
br275.iso.kbd:en:Brazilian 275 ISO-8859-1
br275.iso.kbd:de:Brasilianische 275 ISO-8859-1
br275.iso.kbd:pt:Brasileiro 275 ISO-8859-1
-br275.iso.kbd:es:Brasileño 275 ISO-8859-1
br275.iso.acc.kbd:en:Brazilian 275 ISO-8859-1 (accent keys)
br275.iso.acc.kbd:de:Brasilianische 275 ISO-8859-1 (accent keys)
br275.iso.acc.kbd:pt:Brasileiro 275 ISO-8859-1 (com acentos)
-br275.iso.acc.kbd:es:Brasileño 275 ISO-8859-1 (con acentos)
br275.cp850.kbd:en:Brazilian 275 Codepage 850
br275.cp850.kbd:de:Brasilianische 275 Codeseite 850
br275.cp850.kbd:pt:Brasileiro 275 Codepage 850
-br275.cp850.kbd:es:Brasileño 275 Codepage 850
danish.iso.kbd:en:Danish ISO-8859-1
danish.iso.kbd:da:Dansk ISO-8859-1
danish.iso.kbd:de:Dänisch ISO-8859-1
danish.iso.kbd:fr:Danois ISO-8859-1
danish.iso.kbd:pt:Dinamarquês ISO-8859-1
-danish.iso.kbd:es:Danés ISO-8859-1
danish.cp865.kbd:en:Danish Codepage 865
danish.cp865.kbd:da:Dansk Code page 865
danish.cp865.kbd:de:Dänisch Codeseite 865
danish.cp865.kbd:fr:Danois Code page 865
danish.cp865.kbd:pt:Dinamarquês Codepage 865
-danish.cp865.kbd:es:Danés Codepage 865
fr.iso.kbd:en:French ISO-8859-1
fr.iso.kbd:de:Französisch ISO-8859-1
fr.iso.kbd:fr:Français ISO-8859-1
fr.iso.kbd:pt:Francês ISO-8859-1
-fr.iso.kbd:es:Francés ISO-8859-1
fr.iso.acc.kbd:en:French ISO-8859-1 (accent keys)
fr.iso.acc.kbd:de:Französisch ISO-8859-1 (accent keys)
fr.iso.acc.kbd:fr:Français ISO-8859-1 (accent keys)
fr.iso.acc.kbd:pt:Francês ISO-8859-1 (com acentos)
-fr.iso.acc.kbd:es:Francés ISO-8859-1 (con acentos)
german.iso.kbd:en:German ISO-8859-1
german.iso.kbd:de:Deutsch ISO-8859-1
german.iso.kbd:fr:Allemand ISO-8859-1
german.iso.kbd:pt:Alemão ISO-8859-1
-german.iso.kbd:es:Alemán ISO-8859-1
german.cp850.kbd:en:German Codepage 850
german.cp850.kbd:de:Deutsch Codeseite 850
german.cp850.kbd:fr:Allemand Code page 850
german.cp850.kbd:pt:Alemão Codepage 850
-german.cp850.kbd:es:Alemán Codepage 850
-hu.iso2.101keys.kbd:en:Hungarian 101 ISO-8859-2
-hu.iso2.101keys.kbd:es:Húngaro 101 ISO-8859-2
-
-hu.iso2.102keys.kbd:en:Hungarian 102 ISO-8859-2
-hu.iso2.102keys.kbd:es:Húngaro 102 ISO-8859-2
+hungarian.iso2.kbd:en:Hungarian ISO-8859-2
icelandic.iso.kbd:en:Icelandic ISO-8859-1
icelandic.iso.kbd:pt:Islandês ISO-8859-1
-icelandic.iso.kbd:es:Islandés ISO-8859-1
icelandic.iso.acc.kbd:en:Icelandic ISO-8859-1 (accent keys)
icelandic.iso.acc.kbd:pt:Islandês ISO-8859-1 (com acentos)
-icelandic.iso.acc.kbd:es:Islandés ISO-8859-1 (con acentos)
it.iso.kbd:en:Italian ISO-8859-1
it.iso.kbd:de:Italienisch ISO-8859-1
-it.iso.kbd:pt,es:Italiano ISO-8859-1
+it.iso.kbd:pt:Italiano ISO-8859-1
jp.106.kbd:en:Japanese 106
jp.106.kbd:de:Japanisch 106
jp.106.kbd:pt:Japonês 106
-jp.106.kbd:es:Japonés 106
jp.106x.kbd:en:Japanese 106x
jp.106x.kbd:de:Japanisch 106x
jp.106x.kbd:pt:Japonês 106x
-jp.106x.kbd:es:Japonés 106x
lat-amer.kbd:en:Latin American
-lat-amer.kbd:pt,es:América Latina
+lat-amer.kbd:pt:América Latina
norwegian.iso.kbd:en:Norwegian ISO-8859-1
norwegian.iso.kbd:no:Norsk ISO-8859-1
norwegian.iso.kbd:de:Norwegisch ISO-8859-1
norwegian.iso.kbd:pt:Norueguês ISO-8859-1
-norwegian.iso.kbd:es:Noruego ISO-8859-1
pl_PL.ISO_8859-2.kbd:en:Polish ISO-8859-2 (programmer's)
pl_PL.ISO_8859-2.kbd:pl:Polska ISO-8859-2 (programisty)
pl_PL.ISO_8859-2.kbd:pt:Polonês ISO-8859-2 (para programadores)
-pl_PL.ISO_8859-2.kbd:es:Polaco ISO-8859-2 (para programadores)
-
-pt.iso.kbd:en:Portuguese ISO-8859-1
-pt.iso.kbd:pt:Português ISO-8859-1
-pt.iso.kbd:es:Portugués ISO-8859-1
-
-pt.iso.acc.kbd:en:Portuguese ISO-8859-1 (accent keys)
-pt.iso.acc.kbd:pt:Português ISO-8859-1 (com acentos)
-pt.iso.acc.kbd:es:Portugués ISO-8859-1 (con acentos)
ru.cp866.kbd:en:Russian Codepage 866 (alternative)
ru.cp866.kbd:de:Russisch Codeseite 866 (alternativ)
ru.cp866.kbd:ru:òÕÓÓËÉÊ Codepage 866 (alternative)
ru.cp866.kbd:fr:Russe Code page 866 (alternative)
ru.cp866.kbd:pt:Russo Codepage 866 (alternativo)
-ru.cp866.kbd:es:Ruso Codepage 866 (alternativo)
ru.koi8-r.kbd:en:Russian koi8-r
ru.koi8-r.kbd:de:Russisch koi8-r
ru.koi8-r.kbd:ru:òÕÓÓËÉÊ koi8-r
ru.koi8-r.kbd:fr:Russe koi8-r
ru.koi8-r.kbd:pt:Russo koi8-r
-ru.koi8-r.kbd:es:Ruso koi8-r
ru.koi8-r.shift.kbd:en:Russian koi8-r (shift)
ru.koi8-r.shift.kbd:de:Russisch koi8-r (shift)
ru.koi8-r.shift.kbd:ru:òÕÓÓËÉÊ koi8-r (shift)
ru.koi8-r.shift.kbd:fr:Russe koi8-r (shift)
ru.koi8-r.shift.kbd:pt:Russo koi8-r (shift)
-ru.koi8-r.shift.kbd:es:Ruso koi8-r (shift)
spanish.iso.kbd:en:Spanish ISO-8859-1
spanish.iso.kbd:de:Spanisch ISO-8859-1
spanish.iso.kbd:pt:Espanhol ISO-8859-1
-spanish.iso.kbd:es:Español ISO-8859-1
spanish.iso.acc.kbd:en:Spanish ISO-8859-1 (accent keys)
spanish.iso.acc.kbd:de:Spanisch ISO-8859-1 (accent keys)
spanish.iso.acc.kbd:pt:Espanhol ISO-8859-1 (com acentos)
-spanish.iso.acc.kbd:es:Español ISO-8859-1 (con acentos)
si.iso.kbd:en:Slovenian ISO-8859-2
si.iso.kbd:pt:Eslovênio ISO-8859-2
-si.iso.kbd:es:Esloveno ISO-8859-2
swedish.iso.kbd:en:Swedish ISO-8859-1
swedish.iso.kbd:de:Schwedisch ISO-8859-1
swedish.iso.kbd:fr:Suédois ISO-8859-1
-swedish.iso.kbd:pt,es:Sueco ISO-8859-1
+swedish.iso.kbd:pt:Sueco ISO-8859-1
swedish.cp850.kbd:en:Swedish Codepage 850
swedish.cp850.kbd:de:Schwedisch Codeseite 850
swedish.cp850.kbd:fr:Suédois Code page 850
-swedish.cp850.kbd:pt,es:Sueco Codepage 850
+swedish.cp850.kbd:pt:Sueco Codepage 850
swissfrench.iso.kbd:en:Swiss-French ISO-8859-1
-swissfrench.iso.kbd:es:Suizo-Francés ISO-8859-1
swissgerman.iso.kbd:en:Swiss-German ISO-8859-1
swissgerman.iso.kbd:pt:Suiço-Alemão ISO-8859-1
-swissgerman.iso.kbd:es:Suizo-Alemán ISO-8859-1
uk.iso.kbd:en:United Kingdom ISO-8859-1
uk.iso.kbd:de:Vereinigtes Königreich ISO-8859-1
uk.iso.kbd:fr:Royaume Uni ISO-8859-1
-uk.iso.kbd:pt,es:Reino Unido ISO-8859-1
+uk.iso.kbd:pt:Reino Unido ISO-8859-1
uk.cp850.kbd:en:United Kingdom Codepage 850
uk.cp850.kbd:de:Vereinigtes Königreich Codeseite 850
uk.cp850.kbd:fr:Royaume Uni Code page 850
-uk.cp850.kbd:pt,es:Reino Unido Codepage 850
+uk.cp850.kbd:pt:Reino Unido Codepage 850
us.iso.kbd:en:United States of America ISO-8859-1
us.iso.kbd:de:US-amerikanisch ISO-8859-1
us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1
us.iso.kbd:pt:Estados Unidos da América ISO-8859-1
-us.iso.kbd:es:Estados Unidos de América ISO-8859-1
us.dvorak.kbd:en:United States of America dvorak
us.dvorak.kbd:de:US-amerikanisch dvorak
us.dvorak.kbd:fr:États Unis d'Amérique dvorak
us.dvorak.kbd:pt:Estados Unidos da América dvorak
-us.dvorak.kbd:es:Estados Unidos de América dvorak
us.dvorakr.kbd:en:United States of America righthand dvorak
us.dvorakr.kbd:de:US-amerikanisch dvorak rechter hand
us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr
us.dvorakr.kbd:pt:Estados Unidos da América dvorakr
-us.dvorakr.kbd:es:Estados Unidos de América dvorakr
us.dvorakl.kbd:en:United States of America lefthand dvorak
us.dvorakl.kbd:de:US-amerikanisch dvorak linker hand
us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl
us.dvorakl.kbd:pt:Estados Unidos da América dvorakl
-us.dvorakl.kbd:es:Estados Unidos de América dvorakl
us.dvorakx.kbd:en:United States of America dvorakx
us.dvorakx.kbd:de:US-amerikanisch dvorakx
us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx
us.dvorakx.kbd:pt:Estados Unidos da América dvorakx
-us.dvorakx.kbd:es:Estados Unidos de América dvorakx
us.emacs.kbd:en:United States of America Emacs optimized layout
us.emacs.kbd:de:US-amerikanisch emacs
us.emacs.kbd:fr:États Unis d'Amérique emacs
us.emacs.kbd:pt:Estados Unidos da América emacs
-us.emacs.kbd:es:Estados Unidos de América emacs
us.unix.kbd:en:United States of America Traditional Unix Workstation
us.unix.kbd:de:US-amerikanisch unix
us.unix.kbd:fr:États Unis d'Amérique unix
us.unix.kbd:pt:Estados Unidos da América unix
-us.unix.kbd:es:Estados Unidos de América unix
diff --git a/share/syscons/keymaps/Makefile b/share/syscons/keymaps/Makefile
index 390aa352302c..d0f6509cf447 100644
--- a/share/syscons/keymaps/Makefile
+++ b/share/syscons/keymaps/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.32 1998/10/30 21:00:40 julian Exp $
+# $Id: Makefile,v 1.30 1998/08/07 17:04:42 ache Exp $
KEYMAPS= INDEX.keymaps
KEYMAPS+= be.iso.kbd
@@ -6,14 +6,12 @@ KEYMAPS+= br275.iso.kbd br275.iso.acc.kbd br275.cp850.kbd
KEYMAPS+= danish.iso.kbd danish.cp865.kbd
KEYMAPS+= fr.iso.kbd fr.iso.acc.kbd
KEYMAPS+= german.iso.kbd german.cp850.kbd
-KEYMAPS+= hu.iso2.101keys.kbd hu.iso2.102keys.kbd
-KEYMAPS+= icelandic.iso.kbd icelandic.iso.acc.kbd
+KEYMAPS+= hungarian.iso2.kbd icelandic.iso.kbd icelandic.iso.acc.kbd
KEYMAPS+= it.iso.kbd
KEYMAPS+= jp.106.kbd jp.106x.kbd
KEYMAPS+= lat-amer.kbd
KEYMAPS+= norwegian.iso.kbd
KEYMAPS+= pl_PL.ISO_8859-2.kbd
-KEYMAPS+= pt.iso.kbd pt.iso.acc.kbd
KEYMAPS+= ru.koi8-r.kbd ru.koi8-r.shift.kbd ru.cp866.kbd
KEYMAPS+= si.iso.kbd
KEYMAPS+= spanish.iso.kbd spanish.iso.acc.kbd
diff --git a/share/syscons/keymaps/hu.iso2.101keys.kbd b/share/syscons/keymaps/hu.iso2.101keys.kbd
deleted file mode 100644
index a5a6df11b1c2..000000000000
--- a/share/syscons/keymaps/hu.iso2.101keys.kbd
+++ /dev/null
@@ -1,291 +0,0 @@
-# This is for use with a US keyboard, with only the
-# Hungarian accented characters added to it, and some tricks:
-# The accented characters are available as Alt + something: (and the upper
-# case version is with Alt + Shift + something)
-# ' -> a'
-# ; -> e'
-# ` -> i'
-# = -> o'
-# 0 -> o:
-# [ -> o"
-# ] -> u'
-# - -> u:
-# \ -> u"
-# (i' and I' has another method: Alt + j -> i' and Alt + i -> I')
-#
-# This keymap file has a switching feature:
-# with the Shift+Ctrl combination,
-# we can change the keyboard from US kbd (with hungarian accented letters as
-# Alt+something) to a US kbd, with the help of which we can type the accented
-# characters
-# without the Alt key (and can type the original characters as Alt + ;). So
-# after loading that keymap:
-# ; -> ;
-# Alt + ; -> e'
-# press Shift+Ctrl, and get:
-# ; -> e'
-# Alt + ; -> ;
-# The keyboard switch can be seen at the CapsLock led: off = normal mode; on =
-# switched mode. By the way, we cannot see the CapsLock key's status ;-(
-#
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 nop nop nop nop nop nop nop nop O
- 001 esc esc esc esc esc esc debug esc O
- 002 '1' '!' nop nop '1' '!' nop nop O
- 003 '2' '@' nul nul '2' '@' nul nul O
- 004 '3' '#' nop nop '3' '#' nop nop O
- 005 '4' '$' nop nop '4' '$' nop nop O
- 006 '5' '%' nop nop '5' '%' nop nop O
- 007 '6' '^' rs rs '6' '^' rs rs O
- 008 '7' '&' nop nop '7' '&' nop nop O
- 009 '8' '*' nop nop '8' '*' nop nop O
- 010 '9' '(' nop nop '9' '(' nop nop O
- 011 '0' ')' nop nop 246 214 nop nop O
- 012 '-' '_' ns ns 252 220 ns ns C
- 013 '=' '+' nop nop 243 211 nop nop C
- 014 bs bs del del bs bs del del O
- 015 ht btab nop nop ht btab nop nop O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 205 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '[' '{' esc esc 245 213 esc esc C
- 027 ']' '}' gs gs 250 218 gs gs C
- 028 cr cr nl nl cr cr nl nl O
- 029 lctrl alock lctrl lctrl lctrl lctrl lctrl lctrl O
- 030 'a' 'A' soh soh 'a' 'A' soh soh C
- 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 032 'd' 'D' eot eot 'd' 'D' eot eot C
- 033 'f' 'F' ack ack 'f' 'F' ack ack C
- 034 'g' 'G' bel bel 'g' 'G' bel bel C
- 035 'h' 'H' bs bs 'h' 'H' bs bs C
- 036 'j' 'J' nl nl 237 'J' nl nl C
- 037 'k' 'K' vt vt 'k' 'K' vt vt C
- 038 'l' 'L' ff ff 'l' 'L' ff ff C
- 039 ';' ':' nop nop 233 201 nop nop C
- 040 ''' '"' nop nop 225 193 nop nop C
- 041 '`' '~' nop nop 237 205 nop nop C
- 042 lshift lshift alock lshift lshift lshift lshift lshift O
- 043 '\' '|' fs fs 251 219 fs fs C
- 044 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 045 'x' 'X' can can 'x' 'X' can can C
- 046 'c' 'C' etx etx 'c' 'C' etx etx C
- 047 'v' 'V' syn syn 'v' 'V' syn syn C
- 048 'b' 'B' stx stx 'b' 'B' stx stx C
- 049 'n' 'N' so so 'n' 'N' so so C
- 050 'm' 'M' cr cr 'm' 'M' cr cr C
- 051 ',' '<' nop nop ',' '<' nop nop O
- 052 '.' '>' nop nop '.' '>' nop nop O
- 053 '/' '?' nop nop '/' '?' nop nop C
- 054 rshift rshift alock rshift rshift rshift rshift rshift O
- 055 '*' '*' nscr nscr '*' '*' nscr nscr O
- 056 lalt lalt lalt lalt lalt lalt lalt lalt O
- 057 ' ' ' ' nul ' ' ' ' ' ' ' ' ' ' O
- 058 clock clock clock clock clock clock clock clock O
- 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
- 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
- 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
- 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
- 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
- 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
- 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 069 nlock nlock nlock nlock nlock nlock nlock nlock O
- 070 slock slock slock slock slock slock slock slock O
- 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
- 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
- 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
- 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
- 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
- 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
- 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
- 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
- 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
- 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
- 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
- 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
- 083 del '.' '.' '.' '.' '.' boot boot N
- 084 nop nop nop nop nop nop nop nop O
- 085 nop nop nop nop nop nop nop nop O
- 086 237 205 nop nop nop nop nop nop C
- 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 089 cr cr cr cr cr cr cr cr O
- 090 rctrl alock rctrl rctrl rctrl rctrl rctrl rctrl O
- 091 '/' '/' '/' '/' '/' '/' '/' '/' O
- 092 nscr nop debug nop nop nop nop nop O
- 093 ralt ralt ralt ralt ralt ralt ralt ralt O
- 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
- 104 slock slock slock slock slock slock slock slock O
- 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
- 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
- 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 nop nop nop nop nop nop nop nop O
- 113 nop nop nop nop nop nop nop nop O
- 114 nop nop nop nop nop nop nop nop O
- 115 nop nop nop nop nop nop nop nop O
- 116 nop nop nop nop nop nop nop nop O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
-# ------------------------------------------------------------------
- 128 nop nop nop nop nop nop nop nop O
- 129 esc esc esc esc esc esc debug esc O
- 130 '1' '!' nop nop '1' '!' nop nop O
- 131 '2' '@' nul nul '2' '@' nul nul O
- 132 '3' '#' nop nop '3' '#' nop nop O
- 133 '4' '$' nop nop '4' '$' nop nop O
- 134 '5' '%' nop nop '5' '%' nop nop O
- 135 '6' '^' rs rs '6' '^' rs rs O
- 136 '7' '&' nop nop '7' '&' nop nop O
- 137 '8' '*' nop nop '8' '*' nop nop O
- 138 '9' '(' nop nop '9' '(' nop nop O
- 139 246 214 nop nop '0' ')' nop nop O
- 140 252 220 ns ns '-' '_' ns ns C
- 141 243 211 nop nop '=' '+' nop nop C
- 142 bs bs del del bs bs del del O
- 143 ht btab nop nop ht btab nop nop O
- 144 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 145 'w' 'W' etb etb 'w' 'W' etb etb C
- 146 'e' 'E' enq enq 'e' 'E' enq enq C
- 147 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 148 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 149 'y' 'Y' em em 'y' 'Y' em em C
- 150 'u' 'U' nak nak 'u' 'U' nak nak C
- 151 'i' 'I' ht ht 205 'I' ht ht C
- 152 'o' 'O' si si 'o' 'O' si si C
- 153 'p' 'P' dle dle 'p' 'P' dle dle C
- 154 245 213 esc esc '[' '{' esc esc C
- 155 250 218 gs gs ']' '}' gs gs C
- 156 cr cr nl nl cr cr nl nl O
- 157 lctrl alock lctrl lctrl lctrl lctrl lctrl lctrl O
- 158 'a' 'A' soh soh 'a' 'A' soh soh C
- 159 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 160 'd' 'D' eot eot 'd' 'D' eot eot C
- 161 'f' 'F' ack ack 'f' 'F' ack ack C
- 162 'g' 'G' bel bel 'g' 'G' bel bel C
- 163 'h' 'H' bs bs 'h' 'H' bs bs C
- 164 'j' 'J' nl nl 237 'J' nl nl C
- 165 'k' 'K' vt vt 'k' 'K' vt vt C
- 166 'l' 'L' ff ff 'l' 'L' ff ff C
- 167 233 201 nop nop ';' ':' nop nop C
- 168 225 193 nop nop ''' '"' nop nop C
- 169 237 205 nop nop '`' '~' nop nop C
- 170 lshift lshift alock lshift lshift lshift lshift lshift O
- 171 251 219 fs fs '\' '|' fs fs C
- 172 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 173 'x' 'X' can can 'x' 'X' can can C
- 174 'c' 'C' etx etx 'c' 'C' etx etx C
- 175 'v' 'V' syn syn 'v' 'V' syn syn C
- 176 'b' 'B' stx stx 'b' 'B' stx stx C
- 177 'n' 'N' so so 'n' 'N' so so C
- 178 'm' 'M' cr cr 'm' 'M' cr cr C
- 179 ',' '<' nop nop ',' '<' nop nop O
- 180 '.' '>' nop nop '.' '>' nop nop O
- 181 '/' '?' nop nop '/' '?' nop nop C
- 182 rshift rshift alock rshift rshift rshift rshift rshift O
- 183 '*' '*' nscr nscr '*' '*' nscr nscr O
- 184 lalt lalt lalt lalt lalt lalt lalt lalt O
- 185 ' ' ' ' nul ' ' ' ' ' ' ' ' ' ' O
- 186 clock clock clock clock clock clock clock clock O
- 187 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
- 188 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
- 189 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
- 190 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
- 191 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
- 192 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
- 193 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 194 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 195 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 196 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 197 nlock nlock nlock nlock nlock nlock nlock nlock O
- 198 slock slock slock slock slock slock slock slock O
- 199 fkey49 '7' '7' '7' '7' '7' '7' '7' N
- 200 fkey50 '8' '8' '8' '8' '8' '8' '8' N
- 201 fkey51 '9' '9' '9' '9' '9' '9' '9' N
- 202 fkey52 '-' '-' '-' '-' '-' '-' '-' N
- 203 fkey53 '4' '4' '4' '4' '4' '4' '4' N
- 204 fkey54 '5' '5' '5' '5' '5' '5' '5' N
- 205 fkey55 '6' '6' '6' '6' '6' '6' '6' N
- 206 fkey56 '+' '+' '+' '+' '+' '+' '+' N
- 207 fkey57 '1' '1' '1' '1' '1' '1' '1' N
- 208 fkey58 '2' '2' '2' '2' '2' '2' '2' N
- 209 fkey59 '3' '3' '3' '3' '3' '3' '3' N
- 210 fkey60 '0' '0' '0' '0' '0' '0' '0' N
- 211 del '.' '.' '.' '.' '.' boot boot N
- 212 nop nop nop nop nop nop nop nop O
- 213 nop nop nop nop nop nop nop nop O
- 214 237 205 nop nop nop nop nop nop C
- 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 216 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 217 cr cr cr cr cr cr cr cr O
- 218 rctrl alock rctrl rctrl rctrl rctrl rctrl rctrl O
- 219 '/' '/' '/' '/' '/' '/' '/' '/' O
- 220 nscr nop debug nop nop nop nop nop O
- 221 ralt ralt ralt ralt ralt ralt ralt ralt O
- 222 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 223 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 224 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 225 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 226 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 227 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 228 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 229 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 230 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 231 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
- 232 slock slock slock slock slock slock slock slock O
- 233 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
- 234 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
- 235 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
- 236 nop nop nop nop nop nop nop nop O
- 237 nop nop nop nop nop nop nop nop O
- 238 nop nop nop nop nop nop nop nop O
- 239 nop nop nop nop nop nop nop nop O
- 240 nop nop nop nop nop nop nop nop O
- 241 nop nop nop nop nop nop nop nop O
- 242 nop nop nop nop nop nop nop nop O
- 243 nop nop nop nop nop nop nop nop O
- 244 nop nop nop nop nop nop nop nop O
- 245 nop nop nop nop nop nop nop nop O
- 246 nop nop nop nop nop nop nop nop O
- 247 nop nop nop nop nop nop nop nop O
- 248 nop nop nop nop nop nop nop nop O
- 249 nop nop nop nop nop nop nop nop O
- 250 nop nop nop nop nop nop nop nop O
- 251 nop nop nop nop nop nop nop nop O
- 252 nop nop nop nop nop nop nop nop O
- 253 nop nop nop nop nop nop nop nop O
- 254 nop nop nop nop nop nop nop nop O
- 255 nop nop nop nop nop nop nop nop O
diff --git a/share/syscons/keymaps/hu.iso2.102keys.kbd b/share/syscons/keymaps/hu.iso2.102keys.kbd
deleted file mode 100644
index 00803ae5de99..000000000000
--- a/share/syscons/keymaps/hu.iso2.102keys.kbd
+++ /dev/null
@@ -1,141 +0,0 @@
-# This is an as-close-as-possible (closer :-) representation of the
-# Hungarian keyboard standard (after M$'s W*). There are so many PCs in
-# Hungary with that type of keyboard.
-#
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 nop nop nop nop nop nop nop nop O
- 001 esc esc esc esc esc esc debug esc O
- 002 '1' ''' nop nop '~' nop nop nop O
- 003 '2' '"' nop nop 183 nop nop nop O
- 004 '3' '+' nop nop '^' nop rs rs O
- 005 '4' '!' nop nop 162 nop nop nop O
- 006 '5' '%' nop nop 176 nop nop nop O
- 007 '6' '/' rs rs 178 nop rs rs O
- 008 '7' '=' nop nop '`' nop nop nop O
- 009 '8' '(' nop nop 255 nop nop nop O
- 010 '9' ')' nop nop 180 nop nop nop O
- 011 246 214 nop nop 189 nop nop nop C
- 012 252 220 nop nop 168 nop nop nop C
- 013 243 211 nop nop 184 nop nop nop C
- 014 bs bs del del bs bs del del O
- 015 ht btab nop nop ht btab nop nop O
- 016 'q' 'Q' dc1 dc1 '\' nop fs fs C
- 017 'w' 'W' etb etb '|' nop etb etb C
- 018 'e' 'E' enq enq nop nop enq enq C
- 019 'r' 'R' dc2 dc2 nop nop dc2 dc2 C
- 020 't' 'T' dc4 dc4 nop nop dc4 dc4 C
- 021 'z' 'Z' sub sub nop nop sub sub C
- 022 'u' 'U' nak nak nop nop nak nak C
- 023 'i' 'I' ht ht 205 nop ht ht C
- 024 'o' 'O' si si nop nop si si C
- 025 'p' 'P' dle dle nop nop dle dle C
- 026 245 213 esc esc 247 nop esc esc C
- 027 250 218 gs gs 215 nop gs gs C
- 028 cr cr nl nl cr cr nl nl O
- 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 030 'a' 'A' soh soh nop nop soh soh C
- 031 's' 'S' dc3 dc3 240 nop dc3 dc3 C
- 032 'd' 'D' eot eot 208 nop eot eot C
- 033 'f' 'F' ack ack '[' nop esc esc C
- 034 'g' 'G' bel bel ']' nop gs gs C
- 035 'h' 'H' bs bs nop nop bs bs C
- 036 'j' 'J' nl nl 237 nop nl nl C
- 037 'k' 'K' vt vt 179 nop vt vt C
- 038 'l' 'L' ff ff 163 nop ff ff C
- 039 233 201 nop nop '$' nop nop nop C
- 040 225 193 nop nop 223 nop nop nop C
- 041 '0' 21 nop nop nop nop nop nop O
- 042 lshift lshift lshift lshift lshift lshift lshift lshift O
- 043 251 219 fs fs 164 nop fs fs C
- 044 'y' 'Y' em em '>' '<' em em C
- 045 'x' 'X' can can '#' nop can can C
- 046 'c' 'C' etx etx '&' nop etx etx C
- 047 'v' 'V' syn syn '@' nop nul nul C
- 048 'b' 'B' stx stx '{' nop stx stx C
- 049 'n' 'N' so so '}' nop so so C
- 050 'm' 'M' cr cr '<' nop cr cr C
- 051 ',' '?' nop nop ';' nop nop nop O
- 052 '.' ':' nop nop '>' nop nop nop O
- 053 '-' '_' ns ns '*' nop nop nop O
- 054 rshift rshift rshift rshift rshift rshift rshift rshift O
- 055 '*' '*' nscr nscr '*' '*' nscr nscr O
- 056 lalt lalt lalt lalt lalt lalt lalt lalt O
- 057 ' ' ' ' nul ' ' ' ' ' ' ' ' ' ' O
- 058 clock clock clock clock clock clock clock clock O
- 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
- 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
- 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
- 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
- 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
- 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
- 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 069 nlock nlock nlock nlock nlock nlock nlock nlock O
- 070 slock slock slock slock slock slock slock slock O
- 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
- 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
- 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
- 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
- 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
- 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
- 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
- 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
- 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
- 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
- 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
- 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
- 083 del '.' '.' '.' '.' '.' boot boot N
- 084 nop nop nop nop nop nop nop nop O
- 085 nop nop nop nop nop nop nop nop O
- 086 237 205 nop nop '<' nop nop nop C
- 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 089 cr cr cr cr cr cr cr cr O
- 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
- 091 '/' '/' '/' '/' '/' '/' '/' '/' O
- 092 nscr nop debug nop nop nop nop nop O
- 093 ralt ralt ralt ralt ralt ralt ralt ralt O
- 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
- 104 slock slock slock slock slock slock slock slock O
-# the left Windows key. If you would like to use them,
-# program these keys with:
-# kbdcontrol -f 62 'strings you would like to send'
- 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
-# the right Windows key.
- 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
-# the right Menu pointer key.
- 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 nop nop nop nop nop nop nop nop O
- 113 nop nop nop nop nop nop nop nop O
- 114 nop nop nop nop nop nop nop nop O
- 115 nop nop nop nop nop nop nop nop O
- 116 nop nop nop nop nop nop nop nop O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
diff --git a/share/syscons/keymaps/hungarian.iso2.kbd b/share/syscons/keymaps/hungarian.iso2.kbd
new file mode 100644
index 000000000000..20e92c061c29
--- /dev/null
+++ b/share/syscons/keymaps/hungarian.iso2.kbd
@@ -0,0 +1,112 @@
+# alt
+# scan cntrl alt alt cntrl lock
+# code base shift cntrl shift alt shift cntrl shift state
+# ------------------------------------------------------------------
+ 000 nop nop nop nop nop nop nop nop O
+ 001 esc esc esc esc esc esc debug esc O
+ 002 '1' ''' nop nop '~' nop nop nop O
+ 003 '2' '"' nop nop 183 nop nop nop O
+ 004 '3' '+' nop nop '^' nop rs rs O
+ 005 '4' '!' nop nop 162 nop nop nop O
+ 006 '5' '%' nop nop 176 nop nop nop O
+ 007 '6' '/' rs rs 178 nop rs rs O
+ 008 '7' '=' nop nop '`' nop nop nop O
+ 009 '8' '(' nop nop 255 nop nop nop O
+ 010 '9' ')' nop nop 180 nop nop nop O
+ 011 246 214 nop nop 189 nop nop nop C
+ 012 252 220 nop nop 168 nop nop nop C
+ 013 243 211 nop nop 184 nop nop nop C
+ 014 bs bs del del bs bs del del O
+ 015 ht btab nop nop ht btab nop nop O
+ 016 'q' 'Q' dc1 dc1 '\' nop fs fs C
+ 017 'w' 'W' etb etb '|' nop etb etb C
+ 018 'e' 'E' enq enq nop nop enq enq C
+ 019 'r' 'R' dc2 dc2 nop nop dc2 dc2 C
+ 020 't' 'T' dc4 dc4 nop nop dc4 dc4 C
+ 021 'z' 'Z' sub sub nop nop sub sub C
+ 022 'u' 'U' nak nak nop nop nak nak C
+ 023 'i' 'I' ht ht 205 nop ht ht C
+ 024 'o' 'O' si si nop nop si si C
+ 025 'p' 'P' dle dle nop nop dle dle C
+ 026 245 213 esc esc 247 nop esc esc C
+ 027 250 218 gs gs 215 nop gs gs C
+ 028 cr cr nl nl cr cr nl nl O
+ 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
+ 030 'a' 'A' soh soh nop nop soh soh C
+ 031 's' 'S' dc3 dc3 240 nop dc3 dc3 C
+ 032 'd' 'D' eot eot 208 nop eot eot C
+ 033 'f' 'F' ack ack '[' nop esc esc C
+ 034 'g' 'G' bel bel ']' nop gs gs C
+ 035 'h' 'H' bs bs nop nop bs bs C
+ 036 'j' 'J' nl nl 237 nop nl nl C
+ 037 'k' 'K' vt vt 179 nop vt vt C
+ 038 'l' 'L' ff ff 163 nop ff ff C
+ 039 233 201 nop nop '$' nop nop nop C
+ 040 225 193 nop nop 223 nop nop nop C
+ 041 '0' 21 nop nop nop nop nop nop O
+ 042 lshift lshift lshift lshift lshift lshift lshift lshift O
+ 043 251 219 fs fs 164 nop fs fs C
+ 044 'y' 'Y' em em '>' nop em em C
+ 045 'x' 'X' can can '#' nop can can C
+ 046 'c' 'C' etx etx '&' nop etx etx C
+ 047 'v' 'V' syn syn '@' nop nul nul C
+ 048 'b' 'B' stx stx '{' nop stx stx C
+ 049 'n' 'N' so so '}' nop so so C
+ 050 'm' 'M' cr cr '<' nop cr cr C
+ 051 ',' '?' nop nop ';' nop nop nop O
+ 052 '.' ':' nop nop '>' nop nop nop O
+ 053 '-' '_' us us '*' nop nop nop O
+ 054 rshift rshift rshift rshift rshift rshift rshift rshift O
+ 055 '*' '*' nscr nscr '*' '*' nscr nscr O
+ 056 lalt lalt lalt lalt lalt lalt lalt lalt O
+ 057 ' ' ' ' nul ' ' ' ' ' ' ' ' ' ' O
+ 058 clock clock clock clock clock clock clock clock O
+ 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
+ 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
+ 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
+ 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
+ 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
+ 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
+ 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
+ 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
+ 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
+ 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
+ 069 nlock nlock nlock nlock nlock nlock nlock nlock O
+ 070 slock slock slock slock slock slock slock slock O
+ 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
+ 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
+ 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
+ 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
+ 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
+ 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
+ 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
+ 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
+ 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
+ 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
+ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
+ 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
+ 083 del '.' '.' '.' '.' '.' boot boot N
+ 084 nop nop nop nop nop nop nop nop O
+ 085 nop nop nop nop nop nop nop nop O
+ 086 237 205 nop nop '<' nop nop nop C
+ 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
+ 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
+ 089 cr cr cr cr cr cr cr cr O
+ 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
+ 091 '/' '/' '/' '/' '/' '/' '/' '/' O
+ 092 nscr nop debug nop nop nop nop nop O
+ 093 ralt ralt ralt ralt ralt ralt ralt ralt O
+ 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
+ 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
+ 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
+ 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
+ 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
+ 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
+ 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
+ 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
+ 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
+ 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
+ 104 slock slock slock slock slock slock slock slock O
+ 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
+ 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
+ 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
diff --git a/share/syscons/keymaps/icelandic.iso.acc.kbd b/share/syscons/keymaps/icelandic.iso.acc.kbd
index 12affaa4a473..dce58c853b1a 100644
--- a/share/syscons/keymaps/icelandic.iso.acc.kbd
+++ b/share/syscons/keymaps/icelandic.iso.acc.kbd
@@ -6,15 +6,15 @@
001 esc esc esc esc esc esc debug esc O
002 '1' '!' nop nop nop nop nop nop O
003 '2' '"' nul nul nop nop nul nul O
- 004 '3' '#' nop nop nop nop nop nop O
- 005 '4' '$' nop nop nop nop nop nop O
+ 004 '3' '#' nop nop 163 nop nop nop O
+ 005 '4' '$' nop nop 164 nop nop nop O
006 '5' '%' nop nop nop nop nop nop O
007 '6' '&' nop nop nop nop nop nop O
008 '7' '/' nop nop '{' nop nop nop O
009 '8' '(' nop nop '[' nop nop nop O
010 '9' ')' nop nop ']' nop nop nop O
011 '0' '=' nop nop '}' nop nop nop O
- 012 246 214 nop nop '\' nop fs nop C
+ 012 246 214 nop nop '\' nop fs nop O
013 '-' '_' nop nop nop nop nop nop O
014 bs bs del del bs bs del del O
015 ht btab nop nop ht btab nop nop O
@@ -28,8 +28,8 @@
023 'i' 'I' ht ht 'i' 'I' ht ht C
024 'o' 'O' si si 'o' 'O' si si C
025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 240 208 nop nop nop nop nop nop C
- 027 ''' '?' nop nop '~' nop nop nop O
+ 026 240 208 nop nop '}' ']' nop nop C
+ 027 ''' '?' nop nop '~' nop nop nop C
028 cr cr nl nl cr cr nl nl O
029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
030 'a' 'A' soh soh 'a' 'A' soh soh C
@@ -42,10 +42,10 @@
037 'k' 'K' vt vt 'k' 'K' vt vt C
038 'l' 'L' ff ff 'l' 'L' ff ff C
039 230 198 nop nop '|' '\' nop nop C
- 040 dacu dacu nop nop dtil nop nop nop C
- 041 drin duml nop nop nop nop nop nop O
+ 040 dacu dacu nop nop dtil '[' nop nop C
+ 041 drin duml nop nop dcir '*' nop nop O
042 lshift lshift lshift lshift lshift lshift lshift lshift O
- 043 '+' '*' nop nop '`' '*' nop nop O
+ 043 '+' '*' nop nop '`' '*' nop nop C
044 'z' 'Z' sub sub 'z' 'Z' sub sub C
045 'x' 'X' can can 'x' 'X' can can C
046 'c' 'C' etx etx 'c' 'C' etx etx C
@@ -53,9 +53,9 @@
048 'b' 'B' stx stx 'b' 'B' stx stx C
049 'n' 'N' so so 'n' 'N' so so C
050 'm' 'M' cr cr 'm' 'M' cr cr C
- 051 ',' ';' nop nop nop nop nop nop O
- 052 '.' ':' nop nop nop nop nop nop O
- 053 254 222 us nop nop nop nop nop C
+ 051 ',' ';' nop nop nop '<' nop nop O
+ 052 '.' ':' nop nop nop '>' nop nop O
+ 053 254 222 us nop '/' '?' nop nop O
054 rshift rshift rshift rshift rshift rshift rshift rshift O
055 '*' '*' nl nl '*' '*' nl nl O
056 lalt lalt lalt lalt lalt lalt lalt lalt O
diff --git a/share/syscons/keymaps/pt.iso.acc.kbd b/share/syscons/keymaps/pt.iso.acc.kbd
deleted file mode 100644
index 45bb9e49ec6f..000000000000
--- a/share/syscons/keymaps/pt.iso.acc.kbd
+++ /dev/null
@@ -1,139 +0,0 @@
-#pt.iso.acc.kbd
-#by: pm@dee.uc.pt
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 nop nop nop nop nop nop nop nop O
- 001 esc esc esc esc esc esc debug esc O
- 002 '1' '!' nop nop '1' '!' nop nop O
- 003 '2' '"' nul nul '@' '@' nul nul O
- 004 '3' '#' nop nop '3' '#' nop nop O
- 005 '4' '$' nop nop '4' '$' nop nop O
- 006 '5' '%' nop nop '5' '%' nop nop O
- 007 '6' '&' rs rs '6' '^' rs rs O
- 008 '7' '/' nop nop '{' '&' nop nop O
- 009 '8' '(' nop nop '[' '*' nop nop O
- 010 '9' ')' nop nop ']' '(' nop nop O
- 011 '0' '=' nop nop '}' ')' nop nop O
- 012 ''' '?' ns ns '-' '_' ns ns O
- 013 '=' '+' nop nop '=' '+' nop nop O
- 014 bs bs del del bs bs del del O
- 015 ht btab nop nop ht btab nop nop O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '+' '*' esc esc duml '{' esc esc O
- 027 dacu dgra gs gs ']' '}' gs gs O
- 028 cr cr nl nl cr cr nl nl O
- 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 030 'a' 'A' soh soh 'a' 'A' soh soh C
- 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 032 'd' 'D' eot eot 'd' 'D' eot eot C
- 033 'f' 'F' ack ack 'f' 'F' ack ack C
- 034 'g' 'G' bel bel 'g' 'G' bel bel C
- 035 'h' 'H' bs bs 'h' 'H' bs bs C
- 036 'j' 'J' nl nl 'j' 'J' nl nl C
- 037 'k' 'K' vt vt 'k' 'K' vt vt C
- 038 'l' 'L' ff ff 'l' 'L' ff ff C
- 039 231 199 nop nop ';' ':' nop nop O
- 040 nop nop nop nop ''' '"' nop nop O
- 041 '\' '|' nop nop '`' '~' nop nop O
- 042 lshift lshift lshift lshift lshift lshift lshift lshift O
- 043 dtil dcir fs fs '\' '|' fs fs O
- 044 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 045 'x' 'X' can can 'x' 'X' can can C
- 046 'c' 'C' etx etx 'c' 'C' etx etx C
- 047 'v' 'V' syn syn 'v' 'V' syn syn C
- 048 'b' 'B' stx stx 'b' 'B' stx stx C
- 049 'n' 'N' so so 'n' 'N' so so C
- 050 'm' 'M' cr cr 'm' 'M' cr cr C
- 051 ',' ';' nop nop nop nop nop nop C
- 052 '.' ':' nop nop '.' '>' nop nop O
- 053 '-' '_' nop nop '/' '?' nop nop O
- 054 rshift rshift rshift rshift rshift rshift rshift rshift O
- 055 '*' '*' nscr nscr '*' '*' nscr nscr O
- 056 lalt lalt lalt lalt lalt lalt lalt lalt O
- 057 ' ' ' ' ' ' ' ' ' ' ' ' 130 ' ' O
- 058 clock clock clock clock clock clock clock clock O
- 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
- 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
- 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
- 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
- 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
- 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
- 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 069 nlock nlock nlock nlock nlock nlock nlock nlock O
- 070 slock slock slock slock slock slock slock slock O
- 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
- 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
- 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
- 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
- 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
- 076 nop '5' '5' '5' '5' '5' '5' '5' N
- 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
- 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
- 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
- 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
- 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
- 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
- 083 del '.' del del del del boot del N
- 084 '=' nop nop nop nop nop nop nop O
- 085 '+' nop nop nop nop nop nop nop O
- 086 '<' '>' nop nop nop nop nop nop O
- 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 089 cr cr cr cr cr cr cr cr O
- 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
- 091 '/' '/' '/' '/' '/' '/' '/' '/' O
- 092 nscr nop debug nop nop nop nop nop O
- 093 ralt ralt ralt ralt ralt ralt ralt ralt O
- 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 103 fkey54 fkey54 fkey54 fkey54 fkey54 fkey54 boot fkey54 O
- 104 slock slock slock slock slock slock slock slock O
- 105 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 O
- 106 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
- 107 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
-
- dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 )
- ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 )
- ( 'u' 249 ) ( 'U' 217 )
- dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 )
- ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 )
- ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 )
- dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 )
- ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 )
- ( 'u' 251 ) ( 'U' 219 )
- dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 )
- ( 'o' 245 ) ( 'O' 213 )
- dmac 000
- dbre 000
- ddot 000
- duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 )
- ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 )
- ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 )
- dsla 000
- drin 176 ( 'a' 229 ) ( 'A' 197 )
- dced 184 ( 'c' 231 ) ( 'C' 199 )
- dapo 000
- ddac 000
- dogo 000
- dcar 000
diff --git a/share/syscons/keymaps/pt.iso.kbd b/share/syscons/keymaps/pt.iso.kbd
deleted file mode 100644
index 8c6e7456aa35..000000000000
--- a/share/syscons/keymaps/pt.iso.kbd
+++ /dev/null
@@ -1,114 +0,0 @@
-#pt.iso.kbd
-#by: pm@dee.uc.pt
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 nop nop nop nop nop nop nop nop O
- 001 esc esc esc esc esc esc debug esc O
- 002 '1' '!' nop nop '1' '!' nop nop O
- 003 '2' '"' nul nul '@' '@' nul nul O
- 004 '3' '#' nop nop '3' '#' nop nop O
- 005 '4' '$' nop nop '4' '$' nop nop O
- 006 '5' '%' nop nop '5' '%' nop nop O
- 007 '6' '&' rs rs '6' '^' rs rs O
- 008 '7' '/' nop nop '{' '&' nop nop O
- 009 '8' '(' nop nop '[' '*' nop nop O
- 010 '9' ')' nop nop ']' '(' nop nop O
- 011 '0' '=' nop nop '}' ')' nop nop O
- 012 ''' '?' ns ns '-' '_' ns ns O
- 013 '=' '+' nop nop '=' '+' nop nop O
- 014 bs bs del del bs bs del del O
- 015 ht btab nop nop ht btab nop nop O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '+' '*' esc esc 'h' '{' esc esc O
- 027 ''' '`' gs gs ']' '}' gs gs O
- 028 cr cr nl nl cr cr nl nl O
- 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 030 'a' 'A' soh soh 'a' 'A' soh soh C
- 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 032 'd' 'D' eot eot 'd' 'D' eot eot C
- 033 'f' 'F' ack ack 'f' 'F' ack ack C
- 034 'g' 'G' bel bel 'g' 'G' bel bel C
- 035 'h' 'H' bs bs 'h' 'H' bs bs C
- 036 'j' 'J' nl nl 'j' 'J' nl nl C
- 037 'k' 'K' vt vt 'k' 'K' vt vt C
- 038 'l' 'L' ff ff 'l' 'L' ff ff C
- 039 231 199 nop nop ';' ':' nop nop O
- 040 nop nop nop nop ''' '"' nop nop O
- 041 '\' '|' nop nop '`' '~' nop nop O
- 042 lshift lshift lshift lshift lshift lshift lshift lshift O
- 043 '~' '^' fs fs '\' '|' fs fs O
- 044 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 045 'x' 'X' can can 'x' 'X' can can C
- 046 'c' 'C' etx etx 'c' 'C' etx etx C
- 047 'v' 'V' syn syn 'v' 'V' syn syn C
- 048 'b' 'B' stx stx 'b' 'B' stx stx C
- 049 'n' 'N' so so 'n' 'N' so so C
- 050 'm' 'M' cr cr 'm' 'M' cr cr C
- 051 ',' ';' nop nop nop nop nop nop C
- 052 '.' ':' nop nop '.' '>' nop nop O
- 053 '-' '_' nop nop '/' '?' nop nop O
- 054 rshift rshift rshift rshift rshift rshift rshift rshift O
- 055 '*' '*' nscr nscr '*' '*' nscr nscr O
- 056 lalt lalt lalt lalt lalt lalt lalt lalt O
- 057 ' ' ' ' ' ' ' ' ' ' ' ' 130 ' ' O
- 058 clock clock clock clock clock clock clock clock O
- 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
- 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
- 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
- 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
- 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
- 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
- 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 069 nlock nlock nlock nlock nlock nlock nlock nlock O
- 070 slock slock slock slock slock slock slock slock O
- 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
- 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
- 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
- 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
- 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
- 076 nop '5' '5' '5' '5' '5' '5' '5' N
- 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
- 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
- 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
- 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
- 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
- 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
- 083 del '.' del del del del boot del N
- 084 '=' nop nop nop nop nop nop nop O
- 085 '+' nop nop nop nop nop nop nop O
- 086 '<' '>' nop nop nop nop nop nop O
- 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 089 cr cr cr cr cr cr cr cr O
- 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
- 091 '/' '/' '/' '/' '/' '/' '/' '/' O
- 092 nscr nop debug nop nop nop nop nop O
- 093 ralt ralt ralt ralt ralt ralt ralt ralt O
- 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 103 fkey54 fkey54 fkey54 fkey54 fkey54 fkey54 boot fkey54 O
- 104 slock slock slock slock slock slock slock slock O
- 105 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 O
- 106 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
- 107 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
diff --git a/sys/Makefile b/sys/Makefile
index bca5eded3e54..470207db8201 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 1998/12/30 11:17:09 bde Exp $
+# $Id: Makefile,v 1.12 1998/10/04 00:42:08 gpalmer Exp $
# This is the old aout only boot loader.
.if exists(${MACHINE}/boot) && ${OBJFORMAT} == "aout"
@@ -11,9 +11,6 @@ SUBDIR= boot
SUBDIR= boot
.endif
-# KLD modules build for both a.out and ELF
-SUBDIR+=modules
-
HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh`
.include <bsd.subdir.mk>
diff --git a/sys/alpha/alpha/alpha-gdbstub.c b/sys/alpha/alpha/alpha-gdbstub.c
index 0f8e963e4cb8..d57230dabf3a 100644
--- a/sys/alpha/alpha/alpha-gdbstub.c
+++ b/sys/alpha/alpha/alpha-gdbstub.c
@@ -538,11 +538,11 @@ clear_single_step(db_regs_t* regs)
* Entries not in integer register set are set to -1.
*/
static int tf2gdb[FRAME_SIZE] = {
-/*0*/ R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6,
-/*8*/ R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6,
-/*16*/ R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA,
-/*24*/ R_T12, R_AT, R_SP, -1, -1, -1, -1, -1,
-/*32*/ R_GP, R_A0, R_A1, R_A2,
+ R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6,
+ R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6,
+ R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA,
+ R_T12, R_AT, R_SP, -1, -1, R_GP, R_A0, R_A1,
+ R_A2,
};
/*
diff --git a/sys/alpha/alpha/autoconf.c b/sys/alpha/alpha/autoconf.c
index 46aeb3ffb709..205404f54d7e 100644
--- a/sys/alpha/alpha/autoconf.c
+++ b/sys/alpha/alpha/autoconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: autoconf.c,v 1.12 1998/10/30 01:36:40 jkh Exp $
+ * $Id: autoconf.c,v 1.10 1998/09/26 14:48:19 dfr Exp $
*/
#include "opt_bootp.h"
@@ -58,17 +58,24 @@
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
+#include "scbus.h"
+
static void configure __P((void *));
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
+SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL)
static void configure_finish __P((void));
static void configure_start __P((void));
device_t isa_bus_device = 0;
struct cam_sim *boot_sim = 0;
+extern void xpt_init __P((void));
+
static void
configure_start()
{
+#if NSCBUS > 0
+ xpt_init();
+#endif
}
static void
@@ -210,14 +217,9 @@ cpu_rootconf()
{
#ifdef MFS_ROOT
if (!mountrootfsname) {
- extern u_char *mfs_getimage __P((void));
-
if (bootverbose)
printf("Considering MFS root f/s.\n");
- if (mfs_getimage())
- mountrootfsname = "mfs";
- else if (bootverbose)
- printf("No MFS image available as root f/s.\n");
+ mountrootfsname = "mfs";
}
#endif
diff --git a/sys/alpha/alpha/clock.c b/sys/alpha/alpha/clock.c
index 649b8caeddd4..ef32268fa8cc 100644
--- a/sys/alpha/alpha/clock.c
+++ b/sys/alpha/alpha/clock.c
@@ -1,4 +1,4 @@
-/* $Id: clock.c,v 1.4 1998/10/06 08:40:18 dfr Exp $ */
+/* $Id: clock.c,v 1.3 1998/07/22 08:16:34 dfr Exp $ */
/* $NetBSD: clock.c,v 1.20 1998/01/31 10:32:47 ross Exp $ */
/*
@@ -77,7 +77,7 @@ extern int cycles_per_sec;
static timecounter_get_t alpha_get_timecount;
static timecounter_pps_t alpha_poll_pps;
-static struct timecounter alpha_timecounter = {
+static struct timecounter alpha_timecounter[3] = {
alpha_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -86,7 +86,7 @@ static struct timecounter alpha_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, alpha_timecounter, CTLFLAG_RD,
- &alpha_timecounter, sizeof(alpha_timecounter), "S,timecounter", "");
+ alpha_timecounter, sizeof(alpha_timecounter), "S,timecounter", "");
/* Values for timerX_state: */
#define RELEASED 0
@@ -178,8 +178,8 @@ cpu_initclocks()
scaled_ticks_per_cycle = ((u_int64_t)hz << FIX_SHIFT) / cycles_per_sec;
max_cycles_per_tick = 2*cycles_per_sec / hz;
- alpha_timecounter.tc_frequency = cycles_per_sec;
- init_timecounter(&alpha_timecounter);
+ alpha_timecounter[0].tc_frequency = cycles_per_sec;
+ init_timecounter(alpha_timecounter);
platform.clockintr = (void (*) __P((void *))) handleclock;
diff --git a/sys/alpha/alpha/clock_if.m b/sys/alpha/alpha/clock_if.m
index 75cb78fbf1e6..cc0d265aea67 100644
--- a/sys/alpha/alpha/clock_if.m
+++ b/sys/alpha/alpha/clock_if.m
@@ -23,12 +23,12 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: clock_if.m,v 1.1 1998/06/14 13:52:33 dfr Exp $
+# $Id$
#
#include <machine/clockvar.h>
-INTERFACE clock;
+INTERFACE clock
METHOD void init {
device_t dev;
diff --git a/sys/alpha/alpha/cons.c b/sys/alpha/alpha/cons.c
index ad8465ac3903..78d114987faa 100644
--- a/sys/alpha/alpha/cons.c
+++ b/sys/alpha/alpha/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.2 1998/06/14 13:44:40 dfr Exp $
+ * $Id: cons.c,v 1.1 1998/06/10 10:52:15 dfr Exp $
*/
#include "opt_devfs.h"
@@ -90,7 +90,7 @@ static struct cdevsw cn_cdevsw =
cnpoll, nommap, NULL, "console", NULL, -1 };
static dev_t cn_dev_t; /* seems to be never really used */
-SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
+SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
static int cn_mute;
diff --git a/sys/alpha/alpha/db_disasm.c b/sys/alpha/alpha/db_disasm.c
index 9fc3b1e8b0d7..bec614526a4a 100644
--- a/sys/alpha/alpha/db_disasm.c
+++ b/sys/alpha/alpha/db_disasm.c
@@ -201,7 +201,7 @@ pal_opname(op)
return (pal_op_tbl[i].name);
}
- snprintf(unk, sizeof(unk), "0x%x", op);
+ sprintf(unk, "0x%x", op);
return (unk);
}
@@ -257,7 +257,7 @@ arit_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?arit 0x%x?", op);
+ sprintf(unk, "?arit 0x%x?", op);
return (unk);
}
@@ -307,7 +307,7 @@ logical_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?logical 0x%x?", op);
+ sprintf(unk, "?logical 0x%x?", op);
return (unk);
}
@@ -352,7 +352,7 @@ bitop_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?bit 0x%x?", op);
+ sprintf(unk, "?bit 0x%x?", op);
return (unk);
}
@@ -376,7 +376,7 @@ mul_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?mul 0x%x?", op);
+ sprintf(unk, "?mul 0x%x?", op);
return (unk);
}
@@ -401,7 +401,7 @@ special_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?special 0x%x?", op);
+ sprintf(unk, "?special 0x%x?", op);
return (unk);
}
@@ -440,7 +440,7 @@ intmisc_name(op)
case op_ftois: return ("ftois");
}
- snprintf(unk, sizeof(unk), "?intmisc 0x%x?", op);
+ sprintf(unk, "?intmisc 0x%x?", op);
return (unk);
}
@@ -460,7 +460,7 @@ float_name(tbl, op, type)
return (tbl[i].name);
}
- snprintf(unk, sizeof(unk), "?%s 0x%x?", type, op);
+ sprintf(unk, "?%s 0x%x?", type, op);
return (unk);
}
diff --git a/sys/alpha/alpha/dec_2100_a50.c b/sys/alpha/alpha/dec_2100_a50.c
index 3d5a74908f44..f7bb8c7841ec 100644
--- a/sys/alpha/alpha/dec_2100_a50.c
+++ b/sys/alpha/alpha/dec_2100_a50.c
@@ -58,6 +58,7 @@ static int comcnrate = CONSPEED;
void dec_2100_a50_init __P((void));
static void dec_2100_a50_cons_init __P((void));
+static void dec_2100_a50_device_register __P((struct device *, void *));
static void dec_2100_a50_intr_map __P((void *));
void sio_intr_establish __P((int));
void sio_intr_disestablish __P((int));
@@ -148,7 +149,7 @@ dec_2100_a50_cons_init()
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
- panic("consinit: unknown console type %ld\n",
+ panic("consinit: unknown console type %d\n",
ctb->ctb_term_type);
}
}
@@ -162,6 +163,7 @@ dec_2100_a50_intr_map(void *arg)
u_int32_t pirqreg;
int pirq=0; /* gcc -Wuninitialized XXX */
pcicfgregs *cfg = (pcicfgregs *)arg;
+ static int intr_setup_done=0;
/*
* Slot->interrupt translation. Taken from NetBSD
diff --git a/sys/alpha/alpha/dec_eb164.c b/sys/alpha/alpha/dec_eb164.c
index d2a78f491e49..c0553878288b 100644
--- a/sys/alpha/alpha/dec_eb164.c
+++ b/sys/alpha/alpha/dec_eb164.c
@@ -1,4 +1,4 @@
-/* $Id: dec_eb164.c,v 1.5 1998/12/05 22:36:31 mjacob Exp $ */
+/* $Id: dec_eb164.c,v 1.3 1998/07/22 08:18:34 dfr Exp $ */
/* $NetBSD: dec_eb164.c,v 1.26 1998/04/17 02:45:19 mjacob Exp $ */
/*
@@ -80,7 +80,6 @@ dec_eb164_init()
platform.pci_intr_enable = eb164_intr_enable;
}
-extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
static void
dec_eb164_cons_init()
{
@@ -106,11 +105,6 @@ dec_eb164_cons_init()
*/
DELAY(160000000 / comcnrate);
- /*
- * force a comconsole on com1 if the SRM has a serial
- * console
- */
- comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
@@ -132,7 +126,7 @@ dec_eb164_cons_init()
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %d\n",
- (int) ctb->ctb_term_type);
+ ctb->ctb_term_type);
}
}
diff --git a/sys/alpha/alpha/dec_eb64plus.c b/sys/alpha/alpha/dec_eb64plus.c
deleted file mode 100644
index 597415c90769..000000000000
--- a/sys/alpha/alpha/dec_eb64plus.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-/*
- * Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center
- */
-
-/*
- * Port to based on NetBSD/axp by Wilko Bulte <wilko@freebsd.org>
- * FreeBSD version based on:
- * NetBSD: dec_eb64plus.c,v 1.15 1998/11/19 02:20:07 ross Exp
- *
- * Some info on the Aspen Alpine as this might be hard to come by:
- * - Hardware is close enough to the DEC EB64+ design to allow it to run
- * the EB64+ SRM console f/w
- * - 3 PCI slots, closest to the SIMMs: Alpine calls this slot C
- * the middle one Alpine calls this slot B
- * the 3rd one is Alpine calls this slot A
- * (A, B, C is silkscreened on the PCB)
- * - embedded NCR810, located at PCI slot 5
- * - 3 ISA slots, hanging off an Intel 82378IB PCI-ISA bridge at PCI slot 8
- * - embedded floppy, PC keyboard interface, PS/2 mouse interface, 2x serial
- * ports and a parallel port. All of this hiding after the ISA bridge
- */
-
-#include "opt_ddb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/termios.h>
-
-#include <machine/rpb.h>
-#include <machine/cpuconf.h>
-#include <machine/clock.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#include <pci/pci_ioctl.h>
-
-#include <alpha/pci/apecsreg.h>
-#include <alpha/pci/apecsvar.h>
-
-#include "sio.h"
-#include "sc.h"
-
-#ifndef CONSPEED
-#define CONSPEED TTYDEF_SPEED
-#endif
-static int comcnrate = CONSPEED;
-
-void dec_eb64plus_init __P((void));
-static void dec_eb64plus_cons_init __P((void));
-static void dec_eb64plus_intr_init __P((void));
-
-extern void eb64plus_intr_enable(int irq); /* ../pci/pci_eb64plus_intr.s */
-extern void eb64plus_intr_disable(int irq); /* ../pci/pci_eb64plus_intr.s */
-
-extern const char * bootdev_protocol(void);
-extern int bootdev_boot_dev_type(void);
-
-extern int siocnattach __P((int, int));
-extern int sccnattach __P((void));
-
-const struct alpha_variation_table dec_eb64plus_variations[] = {
- { 0, "DEC EB64-plus" },
- { 0, NULL },
-};
-
-void
-dec_eb64plus_init()
-{
- u_int64_t variation;
-
- platform.family = "EB64+";
-
- if ((platform.model = alpha_dsr_sysname()) == NULL) {
- variation = hwrpb->rpb_variation & SV_ST_MASK;
- if ((platform.model = alpha_variation_name(variation,
- dec_eb64plus_variations)) == NULL)
- platform.model = alpha_unknown_sysname();
- }
-
- platform.iobus = "apecs";
- platform.cons_init = dec_eb64plus_cons_init;
- platform.pci_intr_init = dec_eb64plus_intr_init;
- /* SRM handles PCI interrupt mapping */
- platform.pci_intr_map = NULL;
- /* see ../pci/pci_eb64plus_intr.s for intr. dis/enable */
- platform.pci_intr_disable = eb64plus_intr_disable;
- platform.pci_intr_enable = eb64plus_intr_enable;
-
-}
-
-extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
-/* init the console, serial or graphics */
-static void
-dec_eb64plus_cons_init()
-{
- struct ctb *ctb;
-
- apecs_init();
-
- ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
-
- switch (ctb->ctb_term_type) {
- case 2:
- /* serial console ... */
- /* XXX */
- {
- /*
- * Delay to allow PROM putchars to complete.
- * FIFO depth * character time,
- * character time = (1000000 / (defaultrate / 10))
- */
- DELAY(160000000 / comcnrate);
-
- /*
- * force a comconsole on com1 if the SRM has a serial
- * console
- */
- comconsole = 0;
- if (siocnattach(0x3f8, comcnrate))
- panic("can't init serial console");
-
- break;
- }
-
- case 3:
-#if NSC > 0
- /* graphics adapter console */
- sccnattach();
-#else
- panic("not configured to use display && keyboard console");
-#endif
- break;
-
- default:
- printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
- printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
-
- panic("consinit: unknown console type %d\n",
- (int)ctb->ctb_term_type);
- }
-}
-
-/*
- * The SRM console may have left some some interrupts enabled.
- */
-static void
-dec_eb64plus_intr_init()
-{
- int i;
-
- /* disable all PCI interrupts */
- for(i = 0; i <= 32; i++) /* 32 ?? NetBSD sez so */
- eb64plus_intr_disable(i);
-
- /* Enable ISA-PCI cascade interrupt */
- eb64plus_intr_enable(4);
-
-}
diff --git a/sys/alpha/alpha/dec_kn20aa.c b/sys/alpha/alpha/dec_kn20aa.c
index 1f4e6720a957..2f018fb20691 100644
--- a/sys/alpha/alpha/dec_kn20aa.c
+++ b/sys/alpha/alpha/dec_kn20aa.c
@@ -130,20 +130,20 @@ dec_kn20aa_cons_init()
case 3:
/* display console ... */
/* XXX */
-#if NSC > 0
+#if NPCKBD > 0
sccnattach();
#else
panic("not configured to use display && keyboard console");
break;
-#endif
default:
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %d\n",
- (int)ctb->ctb_term_type);
+ ctb->ctb_term_type);
}
+#endif
}
#if 0
static void
diff --git a/sys/alpha/alpha/dec_st550.c b/sys/alpha/alpha/dec_st550.c
index b7e186a86e87..758b611907cb 100644
--- a/sys/alpha/alpha/dec_st550.c
+++ b/sys/alpha/alpha/dec_st550.c
@@ -78,6 +78,7 @@ extern int sccnattach __P((void));
void
st550_init()
{
+ int i;
platform.family = "Digital Personal Workstation (Miata)";
if ((platform.model = alpha_dsr_sysname()) == NULL) {
@@ -140,7 +141,7 @@ st550_cons_init()
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
- panic("consinit: unknown console type %ld\n",
+ panic("consinit: unknown console type %d\n",
ctb->ctb_term_type);
}
}
diff --git a/sys/alpha/alpha/diskslice_machdep.c b/sys/alpha/alpha/diskslice_machdep.c
index 426df40a32e8..e58dfd592870 100644
--- a/sys/alpha/alpha/diskslice_machdep.c
+++ b/sys/alpha/alpha/diskslice_machdep.c
@@ -36,7 +36,7 @@
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
* from: i386/isa Id: diskslice_machdep.c,v 1.31 1998/08/10 07:22:14 phk Exp
- * $Id: diskslice_machdep.c,v 1.5 1998/10/16 10:13:09 jkh Exp $
+ * $Id: diskslice_machdep.c,v 1.4 1998/10/06 08:38:58 dfr Exp $
*/
#include <sys/param.h>
@@ -421,7 +421,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c
index 785e2edcfccc..847ab2a8af88 100644
--- a/sys/alpha/alpha/elf_machdep.c
+++ b/sys/alpha/alpha/elf_machdep.c
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: elf_machdep.c,v 1.2 1998/10/16 03:54:59 peter Exp $
+ * $Id: elf_machdep.c,v 1.1 1998/09/11 08:47:02 dfr Exp $
*/
#include <sys/param.h>
@@ -97,7 +97,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
break;
case R_ALPHA_RELATIVE:
- addr = relocbase + addend + *where;
+ addr = relocbase + addend;
if (*where != addr)
*where = addr;
break;
@@ -112,7 +112,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
default:
printf("kldload: unexpected relocation type %d\n",
- (int) rtype);
+ rtype);
return -1;
}
return(0);
diff --git a/sys/alpha/alpha/fp_emulate.c b/sys/alpha/alpha/fp_emulate.c
deleted file mode 100644
index d6dc1653e383..000000000000
--- a/sys/alpha/alpha/fp_emulate.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id: fp_emulate.c,v 1.1 1998/12/04 10:52:47 dfr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <vm/vm.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_page.h>
-#include <vm/vm_map.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_object.h>
-#include <vm/vm_pager.h>
-#include <sys/user.h>
-#include <machine/inst.h>
-#include <machine/fpu.h>
-#include <machine/reg.h>
-#include <alpha/alpha/ieee_float.h>
-
-#define GETREG(regs, i) (*(fp_register_t*) &regs->fpr_regs[i])
-#define PUTREG(regs, i, v) (*(fp_register_t*) &regs->fpr_regs[i] = v)
-
-typedef fp_register_t fp_opcode_handler(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t fp_control,
- u_int64_t *status,
- struct fpreg *fpregs);
-
-static fp_register_t fp_add(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_add(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_sub(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_sub(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_mul(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_mul(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_div(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_div(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_cmpun(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmpun(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmpeq(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmpeq(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmplt(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmplt(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmple(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmple(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cvts(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case T_FORMAT:
- return ieee_convert_T_S(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
-
- case Q_FORMAT:
- return ieee_convert_Q_S(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_cvtt(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case S_FORMAT:
- return ieee_convert_S_T(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- case Q_FORMAT:
- return ieee_convert_Q_T(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_cvtq(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case S_FORMAT:
- return ieee_convert_S_Q(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- case T_FORMAT:
- return ieee_convert_T_Q(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_reserved(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
-}
-
-static fp_register_t fp_cvtql(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-
-{
- fp_register_t fb = GETREG(fpregs, ins.f_format.fb);
- *status |= FPCR_INV;
- return ((fb.q & 0xc0000000) << 32 | (fb.q & 0x3fffffff) << 29);
-}
-
-static int fp_emulate(union alpha_instruction ins, struct proc *p)
-{
- u_int64_t control = p->p_addr->u_pcb.pcb_fp_control;
- struct fpreg *fpregs = &p->p_addr->u_pcb.pcb_fp;
- static fp_opcode_handler *ops[16] = {
- fp_add, /* 0 */
- fp_sub, /* 1 */
- fp_mul, /* 2 */
- fp_div, /* 3 */
- fp_cmpun, /* 4 */
- fp_cmpeq, /* 5 */
- fp_cmplt, /* 6 */
- fp_cmple, /* 7 */
- fp_reserved, /* 8 */
- fp_reserved, /* 9 */
- fp_reserved, /* 10 */
- fp_reserved, /* 11 */
- fp_cvts, /* 12 */
- fp_reserved, /* 13 */
- fp_cvtt, /* 14 */
- fp_cvtq, /* 15 */
- };
- int src, rnd;
- fp_register_t result;
- u_int64_t status;
-
- /*
- * Only attempt to emulate ieee instructions & integer overflow
- */
- if ((ins.common.opcode != op_flti) &&
- (ins.f_format.function != fltl_cvtqlsv)){
- printf("fp_emulate: unhandled opcode = 0x%x, fun = 0x%x\n",ins.common.opcode,ins.f_format.function);
- return 0;
- }
- /*
- * Dump the float registers into the pcb so we can get at
- * them.
- */
- if (p == fpcurproc) {
- alpha_pal_wrfen(1);
- savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp);
- alpha_pal_wrfen(0);
- fpcurproc = NULL;
- }
-
- /*
- * Decode and execute the instruction.
- */
- src = (ins.f_format.function >> 4) & 3;
- rnd = (ins.f_format.function >> 6) & 3;
- if (rnd == 3)
- rnd = (fpregs->fpr_cr >> FPCR_DYN_SHIFT) & 3;
- status = 0;
- if (ins.common.opcode == op_fltl
- && ins.f_format.function == fltl_cvtqlsv)
- result = fp_cvtql(ins, src, rnd, control, &status,
- fpregs);
- else
- result = ops[ins.f_format.function & 0xf](ins, src, rnd,
- control, &status,
- fpregs);
-
- /*
- * Handle exceptions.
- */
- if (status) {
- u_int64_t fpcr;
-
- /* Record the exception in the software control word. */
- control |= (status >> IEEE_STATUS_TO_FPCR_SHIFT);
- p->p_addr->u_pcb.pcb_fp_control = control;
-
- /* Regenerate the control register */
- fpcr = fpregs->fpr_cr & FPCR_DYN_MASK;
- fpcr |= ((control & IEEE_STATUS_MASK)
- << IEEE_STATUS_TO_FPCR_SHIFT);
- if (!(control & IEEE_TRAP_ENABLE_INV))
- fpcr |= FPCR_INVD;
- if (!(control & IEEE_TRAP_ENABLE_DZE))
- fpcr |= FPCR_DZED;
- if (!(control & IEEE_TRAP_ENABLE_OVF))
- fpcr |= FPCR_OVFD;
- if (!(control & IEEE_TRAP_ENABLE_UNF))
- fpcr |= FPCR_UNFD;
- if (!(control & IEEE_TRAP_ENABLE_INE))
- fpcr |= FPCR_INED;
- if (control & IEEE_STATUS_MASK)
- fpcr |= FPCR_SUM;
- fpregs->fpr_cr = fpcr;
-
- /* Check the trap enable */
- if ((control >> IEEE_STATUS_TO_EXCSUM_SHIFT)
- & (control & IEEE_TRAP_ENABLE_MASK))
- return 0;
- }
-
- PUTREG(fpregs, ins.f_format.fc, result);
- return 1;
-}
-
-/*
- * Attempt to complete a floating point instruction which trapped by
- * emulating it in software. Return non-zero if the completion was
- * successful, otherwise zero.
- */
-int fp_software_completion(u_int64_t regmask, struct proc *p)
-{
- struct trapframe *frame = p->p_md.md_tf;
- u_int64_t pc = frame->tf_regs[FRAME_PC];
- int error;
-
- /*
- * First we must search back through the trap shadow to find which
- * instruction was responsible for generating the trap.
- */
- pc -= 4;
- while (regmask) {
- union alpha_instruction ins;
-
- /*
- * Read the instruction and figure out the destination
- * register and opcode.
- */
- error = copyin((caddr_t) pc, &ins, sizeof(ins));
- if (error)
- return 0;
-
- switch (ins.common.opcode) {
- case op_call_pal:
- case op_jsr:
- case op_br ... op_bgt:
- /*
- * Condition 6: the trap shadow may not
- * include any branch instructions. Also,
- * the trap shadow is bounded by EXCB, TRAPB
- * and CALL_PAL.
- */
- return 0;
-
- case op_misc:
- switch (ins.memory_format.function) {
- case misc_trapb:
- case misc_excb:
- return 0;
- }
- break;
-
- case op_inta:
- case op_intl:
- case op_ints:
- /*
- * The first 32 bits of the register mask
- * represents integer registers which were
- * modified in the trap shadow.
- */
- regmask &= ~(1LL << ins.o_format.rc);
- break;
-
- case op_fltv:
- case op_flti:
- case op_fltl:
- /*
- * The second 32 bits of the register mask
- * represents float registers which were
- * modified in the trap shadow.
- */
- regmask &= ~(1LL << (ins.f_format.fc + 32));
- break;
- }
-
- if (regmask == 0) {
- /*
- * We have traced back through all the
- * instructions in the trap shadow, so this
- * must be the one which generated the trap.
- */
- if (fp_emulate(ins, p)) {
- /*
- * Restore pc to the first instruction
- * in the trap shadow.
- */
- frame->tf_regs[FRAME_PC] = pc + 4;
- return 1;
- } else
- return 0;
- }
- pc -= 4;
- }
- return 0;
-}
diff --git a/sys/alpha/alpha/genassym.c b/sys/alpha/alpha/genassym.c
index 33febfcfeb61..ca99b6a1b84f 100644
--- a/sys/alpha/alpha/genassym.c
+++ b/sys/alpha/alpha/genassym.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
- * $Id: genassym.c,v 1.3 1998/07/12 16:08:15 dfr Exp $
+ * $Id: genassym.c,v 1.2 1998/06/14 13:44:43 dfr Exp $
*/
#include <sys/param.h>
@@ -46,7 +46,6 @@
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <machine/frame.h>
-#include <machine/chipset.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -96,12 +95,7 @@ main()
OFF(P_PID, struct proc, p_pid);
OFF(P_SWITCHTIME, struct proc, p_switchtime);
OFF(P_RUNTIME, struct proc, p_runtime);
- OFF(P_MD_FLAGS, struct proc, p_md.md_flags);
OFF(P_MD_PCBPADDR, struct proc, p_md.md_pcbpaddr);
- OFF(P_MD_HAE, struct proc, p_md.md_hae);
- CONST1(MDP_HAEUSED);
-
- OFF(CHIPSET_WRITE_HAE, struct alpha_chipset, write_hae);
OFF(PH_LINK, struct prochd, ph_link);
OFF(PH_RLINK, struct prochd, ph_rlink);
diff --git a/sys/alpha/alpha/ieee_float.c b/sys/alpha/alpha/ieee_float.c
deleted file mode 100644
index 9e9846cb9153..000000000000
--- a/sys/alpha/alpha/ieee_float.c
+++ /dev/null
@@ -1,1515 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-/*
- * An implementation of IEEE 754 floating point arithmetic supporting
- * multiply, divide, addition, subtraction and conversion to and from
- * integer. Probably not the fastest floating point code in the world
- * but it should be pretty accurate.
- *
- * A special thanks to John Polstra for pointing out some problems
- * with an earlier version of this code and for educating me as to the
- * correct use of sticky bits.
- */
-
-#include <sys/types.h>
-#ifdef TEST
-#include "../include/fpu.h"
-#include "ieee_float.h"
-#else
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/proc.h>
-#include <machine/fpu.h>
-#include <alpha/alpha/ieee_float.h>
-#endif
-
-/*
- * The number of fraction bits in a T format float.
- */
-#define T_FRACBITS 52
-
-/*
- * The number of fraction bits in a S format float.
- */
-#define S_FRACBITS 23
-
-/*
- * Mask the fraction part of a float to contain only those bits which
- * should be in single precision number.
- */
-#define S_FRACMASK ((1ULL << 52) - (1ULL << 29))
-
-/*
- * The number of extra zero bits we shift into the fraction part
- * to gain accuracy. Two guard bits and one sticky bit are required
- * to ensure accurate rounding.
- */
-#define FRAC_SHIFT 3
-
-/*
- * Values for 1.0 and 2.0 fractions (including the extra FRAC_SHIFT
- * bits).
- */
-#define ONE (1ULL << (T_FRACBITS + FRAC_SHIFT))
-#define TWO (ONE + ONE)
-
-/*
- * The maximum and minimum values for S and T format exponents.
- */
-#define T_MAXEXP 0x3ff
-#define T_MINEXP -0x3fe
-#define S_MAXEXP 0x7f
-#define S_MINEXP -0x7e
-
-/*
- * Exponent values in registers are biased by adding this value.
- */
-#define BIAS_EXP 0x3ff
-
-/*
- * Exponent value for INF and NaN.
- */
-#define NAN_EXP 0x7ff
-
-/*
- * If this bit is set in the fraction part of a NaN, then the number
- * is a quiet NaN, i.e. no traps are generated.
- */
-#define QNAN_BIT (1ULL << 51)
-
-/*
- * Return true if the number is any kind of NaN.
- */
-static __inline int
-isNaN(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && f.t.fraction != 0;
-}
-
-/*
- * Return true if the number is a quiet NaN.
- */
-static __inline int
-isQNaN(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && (f.t.fraction & QNAN_BIT);
-}
-
-/*
- * Return true if the number is a signalling NaN.
- */
-static __inline int
-isSNaN(fp_register_t f)
-{
- return isNaN(f) && !isQNaN(f);
-}
-
-/*
- * Return true if the number is +/- INF.
- */
-static __inline int
-isINF(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && f.t.fraction == 0;
-}
-
-/*
- * Return true if the number is +/- 0.
- */
-static __inline int
-isZERO(fp_register_t f)
-{
- return f.t.exponent == 0 && f.t.fraction == 0;
-}
-
-/*
- * Return true if the number is denormalised.
- */
-static __inline int
-isDENORM(fp_register_t f)
-{
- return f.t.exponent == 0 && f.t.fraction != 0;
-}
-
-/*
- * Extract the exponent part of a float register. If the exponent is
- * zero, the number may be denormalised (if the fraction is nonzero).
- * If so, return the minimum exponent for the source datatype.
- */
-static __inline int
-getexp(fp_register_t f, int src)
-{
- int minexp[] = { S_MINEXP, 0, T_MINEXP, 0 };
- if (f.t.exponent == 0)
- if (f.t.fraction)
- return minexp[src];
- else
- return 0;
- return f.t.exponent - BIAS_EXP;
-}
-
-/*
- * Extract the fraction part of a float register, shift it up a bit
- * to give extra accuracy and add in the implicit 1 bit. Must be
- * careful to handle denormalised numbers and zero correctly.
- */
-static __inline u_int64_t
-getfrac(fp_register_t f)
-{
- if (f.t.exponent == 0)
- return f.t.fraction << FRAC_SHIFT;
- else
- return (f.t.fraction << FRAC_SHIFT) | ONE;
-}
-
-/*
- * Make a float (in register format) from a sign, exponent and
- * fraction, normalising and rounding as necessary.
- * Return the float and set *status if any traps are generated.
- */
-static fp_register_t
-makefloat(int sign, int exp, u_int64_t frac,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- fp_register_t f;
- int minexp = 0, maxexp = 0, alpha = 0;
- u_int64_t epsilon = 0, max = 0;
-
- if (frac == 0) {
- f.t.sign = sign;
- f.t.exponent = 0;
- f.t.fraction = 0;
- return f;
- }
-
- if (frac >= TWO) {
- /*
- * Fraction is >= 2.0.
- * Shift the fraction down, preserving the 'sticky'
- * bit.
- */
- while (frac >= TWO) {
- frac = (frac >> 1) | (frac & 1);
- exp++;
- }
- } else if (frac < ONE) {
- /*
- * Fraction is < 1.0. Shift it up.
- */
- while (frac < ONE) {
- frac = (frac << 1) | (frac & 1);
- exp--;
- }
- }
-
- switch (src) {
- case S_FORMAT:
- minexp = S_MINEXP;
- maxexp = S_MAXEXP;
- alpha = 0xc0;
- epsilon = (1ULL << (T_FRACBITS - S_FRACBITS + FRAC_SHIFT));
- max = TWO - epsilon;
- break;
-
- case T_FORMAT:
- minexp = T_MINEXP;
- maxexp = T_MAXEXP;
- alpha = 0x600;
- epsilon = (1ULL << FRAC_SHIFT);
- max = TWO - epsilon;
- break;
- }
-
- /*
- * Handle underflow before rounding so that denormalised
- * numbers are rounded correctly.
- */
- if (exp < minexp) {
- *status |= FPCR_INE;
- if (control & IEEE_TRAP_ENABLE_UNF) {
- *status |= FPCR_UNF;
- exp += alpha;
- } else {
- /* denormalise */
- while (exp < minexp) {
- exp++;
- frac = (frac >> 1) | (frac & 1);
- }
- exp = minexp - 1;
- }
- }
-
- /*
- * Round the fraction according to the rounding mode.
- */
- if (frac & (epsilon - 1)) {
- u_int64_t fraclo, frachi;
- u_int64_t difflo, diffhi;
-
- fraclo = frac & max;
- frachi = fraclo + epsilon;
- switch (rnd) {
- case ROUND_CHOP:
- frac = fraclo;
- break;
- case ROUND_MINUS_INF:
- if (f.t.sign)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_NORMAL:
- difflo = frac - fraclo;
- diffhi = frachi - frac;
- if (difflo < diffhi)
- frac = fraclo;
- else if (diffhi < difflo)
- frac = frachi;
- else
- /* round to even */
- if (fraclo & epsilon)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_PLUS_INF:
- if (f.t.sign)
- frac = fraclo;
- else
- frac = frachi;
- break;
- }
-
- /*
- * Rounding up may take us to TWO if
- * fraclo == (TWO - epsilon). Also If fraclo has been
- * denormalised to (ONE - epsilon) then there is a
- * possibility that we will round to ONE exactly.
- */
- if (frac >= TWO) {
- frac = (frac >> 1) & ~(epsilon - 1);
- exp++;
- } else if (exp == minexp - 1 && frac == ONE) {
- /* Renormalise to ONE * 2^minexp */
- exp = minexp;
- }
-
- *status |= FPCR_INE;
- }
-
- /*
- * Check for overflow and round to the correct INF as needed.
- */
- if (exp > maxexp) {
- *status |= FPCR_OVF | FPCR_INE;
- if (control & IEEE_TRAP_ENABLE_OVF) {
- exp -= alpha;
- } else {
- switch (rnd) {
- case ROUND_CHOP:
- exp = maxexp;
- frac = max;
- break;
- case ROUND_MINUS_INF:
- if (sign) {
- exp = maxexp + 1; /* INF */
- frac = 0;
- } else {
- exp = maxexp;
- frac = max;
- }
- break;
- case ROUND_NORMAL:
- exp = maxexp + 1; /* INF */
- frac = 0;
- break;
- case ROUND_PLUS_INF:
- if (sign) {
- exp = maxexp;
- frac = max;
- } else {
- exp = maxexp + 1; /* INF */
- frac = 0;
- }
- break;
- }
- }
- }
-
- f.t.sign = sign;
- if (exp > maxexp) /* NaN, INF */
- f.t.exponent = NAN_EXP;
- else if (exp < minexp) /* denorm, zero */
- f.t.exponent = 0;
- else
- f.t.exponent = exp + BIAS_EXP;
- f.t.fraction = (frac & ~ONE) >> FRAC_SHIFT;
- return f;
-}
-
-/*
- * Return the canonical quiet NaN in register format.
- */
-static fp_register_t
-makeQNaN(void)
-{
- fp_register_t f;
- f.t.sign = 0;
- f.t.exponent = NAN_EXP;
- f.t.fraction = QNAN_BIT;
- return f;
-}
-
-/*
- * Return +/- INF.
- */
-static fp_register_t
-makeINF(int sign)
-{
- fp_register_t f;
- f.t.sign = sign;
- f.t.exponent = NAN_EXP;
- f.t.fraction = 0;
- return f;
-}
-
-/*
- * Return +/- 0.
- */
-static fp_register_t
-makeZERO(int sign)
-{
- fp_register_t f;
- f.t.sign = sign;
- f.t.exponent = 0;
- f.t.fraction = 0;
- return f;
-}
-
-fp_register_t
-ieee_add(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int64_t fraca, fracb, frac;
- int sign, sticky;
-
- /* First handle NaNs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle +/- INF */
- if (isINF(fa))
- if (isINF(fb))
- if (fa.t.sign != fb.t.sign) {
- /* If adding -INF to +INF, generate a trap. */
- *status |= FPCR_INV;
- return makeQNaN();
- } else
- return fa;
- else
- return fa;
- else if (isINF(fb))
- return fb;
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca = getfrac(fa);
- fracb = getfrac(fb);
- shift = expa - expb;
- if (shift < 0) {
- shift = -shift;
- exp = expb;
- sticky = (fraca & ((1ULL << shift) - 1)) != 0;
- if (shift >= 64)
- fraca = sticky;
- else
- fraca = (fraca >> shift) | sticky;
- } else if (shift > 0) {
- exp = expa;
- sticky = (fracb & ((1ULL << shift) - 1)) != 0;
- if (shift >= 64)
- fracb = sticky;
- else
- fracb = (fracb >> shift) | sticky;
- } else
- exp = expa;
- if (fa.t.sign) fraca = -fraca;
- if (fb.t.sign) fracb = -fracb;
- frac = fraca + fracb;
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /* -0 + -0 = -0 */
- if (fa.t.exponent == 0 && fa.t.fraction == 0
- && fb.t.exponent == 0 && fb.t.fraction == 0)
- sign = fa.t.sign && fb.t.sign;
-
- return makefloat(sign, exp, frac, src, rnd, control, status);
-}
-
-fp_register_t
-ieee_sub(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- fb.t.sign = !fb.t.sign;
- return ieee_add(fa, fb, src, rnd, control, status);
-}
-
-typedef struct {
- u_int64_t lo;
- u_int64_t hi;
-} u_int128_t;
-
-#define SRL128(x, b) \
-do { \
- x.lo >>= b; \
- x.lo |= x.hi << (64 - b); \
- x.hi >>= b; \
-} while (0)
-
-#define SLL128(x, b) \
-do { \
- if (b >= 64) { \
- x.hi = x.lo << (b - 64); \
- x.lo = 0; \
- } else { \
- x.hi <<= b; \
- x.hi |= x.lo >> (64 - b); \
- x.lo <<= b; \
- } \
-} while (0)
-
-#define SUB128(a, b) \
-do { \
- int borrow = a.lo < b.lo; \
- a.lo = a.lo - b.lo; \
- a.hi = a.hi - b.hi - borrow; \
-} while (0)
-
-#define LESS128(a, b) (a.hi < b.hi || (a.hi == b.hi && a.lo < b.lo))
-
-fp_register_t
-ieee_mul(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int64_t fraca, fracb, tmp;
- u_int128_t frac;
- int sign;
-
- /* First handle NaNs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle INF and 0 */
- if ((isINF(fa) && isZERO(fb)) || (isINF(fa) && isZERO(fb))) {
- /* INF * 0 = NaN */
- *status |= FPCR_INV;
- return makeQNaN();
- } else
- /* If either is INF or zero, get the sign right */
- if (isINF(fa) || isINF(fb))
- return makeINF(fa.t.sign ^ fb.t.sign);
- else if (isZERO(fa) || isZERO(fb))
- return makeZERO(fa.t.sign ^ fb.t.sign);
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca = getfrac(fa);
- fracb = getfrac(fb);
- sign = fa.t.sign ^ fb.t.sign;
-
-#define LO32(x) ((x) & ((1ULL << 32) - 1))
-#define HI32(x) ((x) >> 32)
-
- /*
- * Calculate the 128bit result of multiplying fraca and fracb.
- */
- frac.lo = fraca * fracb;
-#ifdef __alpha__
- /*
- * The alpha has a handy instruction to find the high word.
- */
- __asm__ __volatile__ ("umulh %1,%2,%0"
- : "=r"(tmp)
- : "r"(fraca), "r"(fracb));
- frac.hi = tmp;
-#else
- /*
- * Do the multiply longhand otherwise.
- */
- frac.hi = HI32(LO32(fraca) * HI32(fracb)
- + HI32(fraca) * LO32(fracb)
- + HI32(LO32(fraca) * LO32(fracb)))
- + HI32(fraca) * HI32(fracb);
-#endif
- exp = expa + expb - (T_FRACBITS + FRAC_SHIFT);
-
- while (frac.hi > 0) {
- int sticky;
- exp++;
- sticky = frac.lo & 1;
- SRL128(frac, 1);
- frac.lo |= sticky;
- }
-
- return makefloat(sign, exp, frac.lo, src, rnd, control, status);
-}
-
-static u_int128_t
-divide_128(u_int128_t a, u_int128_t b)
-{
- u_int128_t result;
- u_int64_t bit;
- int i;
-
- /*
- * Make a couple of assumptions on the numbers passed in. The
- * value in 'a' will have bits set in the upper 64 bits only
- * and the number in 'b' will have zeros in the upper 64 bits.
- * Also, 'b' will not be zero.
- */
-#ifdef TEST
- if (a.hi == 0 || b.hi != 0 || b.lo == 0)
- abort();
-#endif
-
- /*
- * Find out how many bits of zeros are at the beginning of the divisor.
- */
- i = 64;
- bit = 1ULL << 63;
- while (i < 127) {
- if (b.lo & bit)
- break;
- i++;
- bit >>= 1;
- }
-
- /*
- * Find out how much to shift the divisor so that its msb
- * matches the msb of the dividend.
- */
- bit = 1ULL << 63;
- while (i) {
- if (a.hi & bit)
- break;
- i--;
- bit >>= 1;
- }
-
- result.lo = 0;
- result.hi = 0;
- SLL128(b, i);
-
- /*
- * Calculate the result in two parts to avoid keeping a 128bit
- * value for the result bit.
- */
- if (i >= 64) {
- bit = 1ULL << (i - 64);
- while (bit) {
- if (!LESS128(a, b)) {
- result.hi |= bit;
- SUB128(a, b);
- if (!a.lo && !a.hi)
- return result;
- }
- bit >>= 1;
- SRL128(b, 1);
- }
- i = 63;
- }
- bit = 1ULL << i;
- while (bit) {
- if (!LESS128(a, b)) {
- result.lo |= bit;
- SUB128(a, b);
- if (!a.lo && !a.hi)
- return result;
- }
- bit >>= 1;
- SRL128(b, 1);
- }
-
- return result;
-}
-
-fp_register_t
-ieee_div(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int128_t fraca, fracb, frac;
- int sign;
-
- /* First handle NaNs, INFs and ZEROs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle INF and 0 */
- if (isINF(fa) && isINF(fb)) {
- *status |= FPCR_INV;
- return makeQNaN();
- } else if (isZERO(fb))
- if (isZERO(fa)) {
- *status |= FPCR_INV;
- return makeQNaN();
- } else {
- *status |= FPCR_DZE;
- return makeINF(fa.t.sign ^ fb.t.sign);
- }
- else if (isZERO(fa))
- return makeZERO(fa.t.sign ^ fb.t.sign);
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca.hi = getfrac(fa);
- fraca.lo = 0;
- fracb.lo = getfrac(fb);
- fracb.hi = 0;
- sign = fa.t.sign ^ fb.t.sign;
-
- frac = divide_128(fraca, fracb);
-
- exp = expa - expb - (64 - T_FRACBITS - FRAC_SHIFT);
- while (frac.hi > 0) {
- int sticky;
- exp++;
- sticky = frac.lo & 1;
- SRL128(frac, 1);
- frac.lo |= sticky;
- }
- frac.lo |= 1;
-
- return makefloat(sign, exp, frac.lo, src, rnd, control, status);
-}
-
-#define IEEE_TRUE 0x4000000000000000ULL
-#define IEEE_FALSE 0
-
-fp_register_t
-ieee_cmpun(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_TRUE;
- } else
- result.q = IEEE_FALSE;
-
- return result;
-}
-
-fp_register_t
-ieee_cmpeq(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_TRUE;
- else if (fa.q == fb.q)
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
-
- return result;
-}
-
-fp_register_t
-ieee_cmplt(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_FALSE;
- else if (fa.t.sign) {
- /* fa is negative */
- if (!fb.t.sign)
- /* fb is positive, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent > fb.t.exponent)
- /* fa has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent == fb.t.exponent
- && fa.t.fraction > fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- } else {
- /* fa is positive */
- if (fb.t.sign)
- /* fb is negative, return false */
- result.q = IEEE_FALSE;
- else if (fb.t.exponent > fa.t.exponent)
- /* fb has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fb.t.exponent == fb.t.exponent
- && fa.t.fraction < fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
- }
-
- return result;
-}
-
-fp_register_t
-ieee_cmple(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_TRUE;
- else if (fa.t.sign) {
- /* fa is negative */
- if (!fb.t.sign)
- /* fb is positive, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent > fb.t.exponent)
- /* fa has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent == fb.t.exponent
- && fa.t.fraction >= fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- } else {
- /* fa is positive */
- if (fb.t.sign)
- /* fb is negative, return false */
- result.q = IEEE_FALSE;
- else if (fb.t.exponent > fa.t.exponent)
- /* fb has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fb.t.exponent == fb.t.exponent
- && fa.t.fraction <= fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
- }
-
- return result;
-}
-
-fp_register_t
-ieee_convert_S_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- f.t.fraction |= QNAN_BIT;
- *status |= FPCR_INV;
- }
- if (isQNaN(f) || isINF(f))
- return f;
-
- /*
- * If the number is a denormalised float, renormalise.
- */
- if (isDENORM(f))
- return makefloat(f.t.sign,
- getexp(f, S_FORMAT),
- getfrac(f),
- T_FORMAT, rnd, control, status);
- else
- return f;
-}
-
-fp_register_t
-ieee_convert_T_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- f.t.fraction |= QNAN_BIT;
- f.t.fraction &= ~S_FRACMASK;
- *status |= FPCR_INV;
- }
- if (isQNaN(f) || isINF(f))
- return f;
-
- return makefloat(f.t.sign,
- getexp(f, T_FORMAT),
- getfrac(f),
- S_FORMAT, rnd, control, status);
-}
-
-fp_register_t
-ieee_convert_Q_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac = f.q;
- int sign, exponent;
-
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /*
- * We shift up one bit to leave the sticky bit clear. This is
- * possible unless frac == (1<<63), in which case the sticky
- * bit is already clear.
- */
- exponent = T_FRACBITS + FRAC_SHIFT;
- if (frac < (1ULL << 63)) {
- frac <<= 1;
- exponent--;
- }
-
- return makefloat(sign, exponent, frac, S_FORMAT, rnd,
- control, status);
-}
-
-fp_register_t
-ieee_convert_Q_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac = f.q;
- int sign, exponent;
-
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /*
- * We shift up one bit to leave the sticky bit clear. This is
- * possible unless frac == (1<<63), in which case the sticky
- * bit is already clear.
- */
- exponent = T_FRACBITS + FRAC_SHIFT;
- if (frac < (1ULL << 63)) {
- frac <<= 1;
- exponent--;
- }
-
- return makefloat(sign, exponent, frac, T_FORMAT, rnd,
- control, status);
-}
-
-fp_register_t
-ieee_convert_T_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac;
- int exp;
-
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- if (isSNaN(f))
- *status |= FPCR_INV;
- f.q = 0;
- return f;
- }
- if (isINF(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- *status |= FPCR_INV;
- f.q = 0;
- return f;
- }
-
- exp = getexp(f, T_FORMAT) - (T_FRACBITS + FRAC_SHIFT);
- frac = getfrac(f);
-
- if (exp > 0) {
- if (exp > 64 || frac >= (1 << (64 - exp)))
- *status |= FPCR_IOV | FPCR_INE;
- if (exp < 64)
- frac <<= exp;
- else
- frac = 0;
- } else if (exp < 0) {
- u_int64_t mask;
- u_int64_t fraclo, frachi;
- u_int64_t diffhi, difflo;
- exp = -exp;
- if (exp > 64) {
- fraclo = 0;
- diffhi = 0;
- difflo = 0;
- if (frac) {
- frachi = 1;
- *status |= FPCR_INE;
- } else
- frachi = 0;
- } else if (exp == 64) {
- fraclo = 0;
- if (frac) {
- frachi = 1;
- difflo = frac;
- diffhi = -frac;
- *status |= FPCR_INE;
- } else {
- frachi = 0;
- difflo = 0;
- diffhi = 0;
- }
- } else {
- mask = (1 << exp) - 1;
- fraclo = frac >> exp;
- if (frac & mask) {
- frachi = fraclo + 1;
- difflo = frac - (fraclo << exp);
- diffhi = (frachi << exp) - frac;
- *status |= FPCR_INE;
- } else {
- frachi = fraclo;
- difflo = 0;
- diffhi = 0;
- }
- }
- switch (rnd) {
- case ROUND_CHOP:
- frac = fraclo;
- break;
- case ROUND_MINUS_INF:
- if (f.t.sign)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_NORMAL:
-#if 0
- /*
- * Round to nearest.
- */
- if (difflo < diffhi)
- frac = fraclo;
- else if (diffhi > difflo)
- frac = frachi;
- else if (fraclo & 1)
- frac = frachi;
- else
- frac = fraclo;
-#else
- /*
- * Round to zero.
- */
- frac = fraclo;
-#endif
- break;
- case ROUND_PLUS_INF:
- if (f.t.sign)
- frac = fraclo;
- else
- frac = frachi;
- break;
- }
- }
-
- if (f.t.sign) {
- if (frac > (1ULL << 63))
- *status |= FPCR_IOV | FPCR_INE;
- frac = -frac;
- } else {
- if (frac > (1ULL << 63) - 1)
- *status |= FPCR_IOV | FPCR_INE;
- }
-
- f.q = frac;
- return f;
-}
-
-fp_register_t
-ieee_convert_S_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- f = ieee_convert_S_T(f, rnd, control, status);
- return ieee_convert_T_Q(f, rnd, control, status);
-}
-
-#ifndef KERNEL
-
-#include <stdio.h>
-#include <math.h>
-#include <stdlib.h>
-
-union value {
- double d;
- fp_register_t r;
-};
-
-
-static double
-random_double()
-{
- union value a;
- int exp;
-
- a.r.t.fraction = ((long long)random() & (1ULL << 20) - 1) << 32
- | random();
- exp = random() & 0x7ff;
-#if 1
- if (exp == 0)
- exp = 1; /* no denorms */
- else if (exp == 0x7ff)
- exp = 0x7fe; /* no NaNs and INFs */
-#endif
-
- a.r.t.exponent = exp;
- a.r.t.sign = random() & 1;
- return a.d;
-}
-
-static float
-random_float()
-{
- union value a;
- int exp;
-
- a.r.t.fraction = ((long)random() & (1ULL << 23) - 1) << 29;
- exp = random() & 0xff;
-#if 1
- if (exp == 0)
- exp = 1; /* no denorms */
- else if (exp == 0xff)
- exp = 0xfe; /* no NaNs and INFs */
-#endif
-
- /* map exponent from S to T format */
- if (exp == 255)
- a.r.t.exponent = 0x7ff;
- else if (exp & 0x80)
- a.r.t.exponent = 0x400 + (exp & 0x7f);
- else if (exp)
- a.r.t.exponent = 0x380 + exp;
- else
- a.r.t.exponent = 0;
- a.r.t.sign = random() & 1;
-
- return a.d;
-}
-
-/*
- * Ignore epsilon errors
- */
-int
-equal_T(union value a, union value b)
-{
- if (isZERO(a.r) && isZERO(b.r))
- return 1;
- if (a.r.t.sign != b.r.t.sign)
- return 0;
- if (a.r.t.exponent != b.r.t.exponent)
- return 0;
-
- return a.r.t.fraction == b.r.t.fraction;
-}
-
-int
-equal_S(union value a, union value b)
-{
- int64_t epsilon = 1ULL << 29;
-
- if (isZERO(a.r) && isZERO(b.r))
- return 1;
- if (a.r.t.sign != b.r.t.sign)
- return 0;
- if (a.r.t.exponent != b.r.t.exponent)
- return 0;
-
- return ((a.r.t.fraction & ~(epsilon-1))
- == (b.r.t.fraction & ~(epsilon-1)));
-}
-
-#define ITER 1000000
-
-static void
-test_double_add()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_add(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d + b.d;
- if (!equal_T(c, x)) {
- printf("bad double add, %g + %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_add(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_add()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
-#if 0
- if (i == 0) {
- a.r.q = 0xb33acf292ca49700ULL;
- b.r.q = 0xcad3191058a693aeULL;
- }
-#endif
- a.d = random_float();
- b.d = random_float();
- status = 0;
- c.r = ieee_add(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d + b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single add, %g + %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_add(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_double_mul()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d * b.d;
- if (!equal_T(c, x)) {
- printf("bad double mul, %g * %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_mul()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_mul(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d * b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single mul, %g * %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_double_div()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_div(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d / b.d;
- if (!equal_T(c, x) && !isZERO(x.r)) {
- printf("bad double div, %g / %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_div(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_div()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_div(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d / b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single div, %g / %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_convert_int_to_double()
-{
- union value a, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.r.q = (u_int64_t)random() << 32
- | random();
- status = 0;
- c.r = ieee_convert_Q_T(a.r, ROUND_NORMAL, 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r))
- continue;
- x.d = (double) a.r.q;
- if (c.d != x.d) {
- printf("bad convert double, (double)%qx = %g (should be %g)\n",
- a.r.q, c.d, x.d);
- c.r = ieee_convert_Q_T(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-static void
-test_convert_int_to_single()
-{
- union value a, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.r.q = (unsigned long long)random() << 32
- | random();
- status = 0;
- c.r = ieee_convert_Q_S(a.r, ROUND_NORMAL, 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r))
- continue;
- xf = (float) a.r.q;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (t.d != x.d) {
- printf("bad convert single, (double)%qx = %g (should be %g)\n",
- a.r.q, c.d, x.d);
- c.r = ieee_convert_Q_S(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-static void
-test_convert_double_to_int()
-{
- union value a, c;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- status = 0;
- c.r = ieee_convert_T_Q(a.r, ROUND_NORMAL, 0, &status);
- if ((int)c.r.q != (int)a.d) {
- printf("bad convert double, (int)%g = %d (should be %d)\n",
- a.d, (int)c.r.q, (int)a.d);
- c.r = ieee_convert_T_Q(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-int
-main(int argc, char* argv[])
-{
- srandom(0);
-
- test_double_div();
- test_single_div();
- test_double_add();
- test_single_add();
- test_double_mul();
- test_single_mul();
- test_convert_int_to_double();
- test_convert_int_to_single();
-#if 0
- /* x86 generates SIGFPE on overflows. */
- test_convert_double_to_int();
-#endif
-
- return 0;
-}
-
-#endif
diff --git a/sys/alpha/alpha/ieee_float.h b/sys/alpha/alpha/ieee_float.h
deleted file mode 100644
index 1977e910a0e1..000000000000
--- a/sys/alpha/alpha/ieee_float.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#define S_FORMAT 0 /* IEEE single */
-#define T_FORMAT 2 /* IEEE double */
-#define Q_FORMAT 3 /* 64 bit fixed */
-
-#define ROUND_CHOP 0 /* truncate fraction */
-#define ROUND_MINUS_INF 1 /* round to -INF */
-#define ROUND_NORMAL 2 /* round to nearest */
-#define ROUND_PLUS_INF 3 /* round to +INF */
-
-typedef union fp_register {
- struct {
- u_int64_t fraction: 52;
- u_int64_t exponent: 11;
- u_int64_t sign: 1;
- } t;
- u_int64_t q;
-} fp_register_t;
-
-fp_register_t
-ieee_add(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_sub(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_mul(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_div(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_cmpun(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmpeq(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmplt(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmple(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_convert_S_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_T_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_Q_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_Q_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_T_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_S_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c
index 6010e745d8de..9390f8fb6b68 100644
--- a/sys/alpha/alpha/interrupt.c
+++ b/sys/alpha/alpha/interrupt.c
@@ -1,4 +1,4 @@
-/* $Id: interrupt.c,v 1.8 1998/11/28 09:55:15 dfr Exp $ */
+/* $Id: interrupt.c,v 1.4 1998/07/12 16:09:27 dfr Exp $ */
/* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */
/*
@@ -50,24 +50,17 @@
#include <machine/bwx.h>
#include <machine/intr.h>
+#if 0
#ifdef EVCNT_COUNTERS
#include <sys/device.h>
struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */
#else
#include <machine/intrcnt.h>
#endif
+#endif
volatile int mc_expected, mc_received;
-static void
-dummy_perf(unsigned long vector, struct trapframe *framep)
-{
- printf("performance interrupt!\n");
-}
-
-void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf;
-
-
void
interrupt(a0, a1, a2, framep)
unsigned long a0, a1, a2;
@@ -81,9 +74,6 @@ interrupt(a0, a1, a2, framep)
panic("possible stack overflow\n");
}
- framep->tf_regs[FRAME_TRAPARG_A0] = a0;
- framep->tf_regs[FRAME_TRAPARG_A1] = a1;
- framep->tf_regs[FRAME_TRAPARG_A2] = a2;
switch (a0) {
case ALPHA_INTR_XPROC: /* interprocessor interrupt */
printf("interprocessor interrupt!\n");
@@ -91,11 +81,13 @@ interrupt(a0, a1, a2, framep)
case ALPHA_INTR_CLOCK: /* clock interrupt */
cnt.v_intr++;
+#if 0
#ifdef EVCNT_COUNTERS
clock_intr_evcnt.ev_count++;
#else
intrcnt[INTRCNT_CLOCK]++;
#endif
+#endif
if (platform.clockintr)
(*platform.clockintr)(framep);
break;
@@ -115,7 +107,7 @@ interrupt(a0, a1, a2, framep)
break;
case ALPHA_INTR_PERF: /* interprocessor interrupt */
- perf_irq(a1, framep);
+ printf("performance interrupt!\n");
break;
case ALPHA_INTR_PASSIVE:
@@ -285,55 +277,32 @@ badaddr_read(addr, size, rptr)
#define HASHVEC(vector) ((vector) % 31)
-LIST_HEAD(alpha_intr_list, alpha_intr);
-
-struct alpha_intr {
- LIST_ENTRY(alpha_intr) list; /* chain handlers in this hash bucket */
- int vector; /* vector to match */
- driver_intr_t *intr; /* handler function */
- void *arg; /* argument to handler */
- volatile long *cntp; /* interrupt counter */
-};
-
static struct alpha_intr_list alpha_intr_hash[31];
-int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg,
- void **cookiep, volatile long *cntp)
+struct alpha_intr *
+alpha_create_intr(int vector, driver_intr_t *intr, void *arg)
{
- int h = HASHVEC(vector);
struct alpha_intr *i;
- int s;
i = malloc(sizeof(struct alpha_intr), M_DEVBUF, M_NOWAIT);
if (!i)
- return ENOMEM;
+ return NULL;
i->vector = vector;
i->intr = intr;
i->arg = arg;
- if (cntp)
- i->cntp = cntp;
- else
- i->cntp = NULL;
-
- s = splhigh();
- LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list);
- splx(s);
-
- *cookiep = i;
- return 0;
-
+ return i;
}
-int alpha_teardown_intr(void *cookie)
+int
+alpha_connect_intr(struct alpha_intr *i)
{
- struct alpha_intr *i = cookie;
+ int h = HASHVEC(i->vector);
int s;
s = splhigh();
- LIST_REMOVE(i, list);
+ LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list);
splx(s);
-
- free(i, M_DEVBUF);
+
return 0;
}
@@ -341,13 +310,8 @@ void
alpha_dispatch_intr(void *frame, unsigned long vector)
{
struct alpha_intr *i;
- volatile long *cntp;
-
int h = HASHVEC(vector);
for (i = LIST_FIRST(&alpha_intr_hash[h]); i; i = LIST_NEXT(i, list))
- if (i->vector == vector) {
- if (cntp = i->cntp)
- (*cntp) ++;
+ if (i->vector == vector)
i->intr(i->arg);
- }
}
diff --git a/sys/alpha/alpha/ipl_funcs.c b/sys/alpha/alpha/ipl_funcs.c
index 815f7f7edfe1..ad6670ecbbef 100644
--- a/sys/alpha/alpha/ipl_funcs.c
+++ b/sys/alpha/alpha/ipl_funcs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ipl_funcs.c,v 1.8 1998/09/26 14:25:32 dfr Exp $
+ * $Id: ipl_funcs.c,v 1.7 1998/09/19 09:29:40 dfr Exp $
*/
#include <sys/types.h>
@@ -40,10 +40,12 @@ unsigned int cam_imask; /* XXX */
unsigned int net_imask; /* XXX */
static void swi_net(void);
+extern void swi_camnet(void);
+extern void swi_cambio(void);
void (*netisrs[32]) __P((void));
swihand_t *ihandlers[32] = { /* software interrupts */
- swi_null, swi_net, swi_null, swi_null,
+ swi_null, swi_net, swi_camnet, swi_cambio,
swi_null, softclock, swi_null, swi_null,
swi_null, swi_null, swi_null, swi_null,
swi_null, swi_null, swi_null, swi_null,
diff --git a/sys/alpha/alpha/locore.s b/sys/alpha/alpha/locore.s
index 9a3acd6b79a7..1a97de23c531 100644
--- a/sys/alpha/alpha/locore.s
+++ b/sys/alpha/alpha/locore.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locore.s,v 1.5 1998/11/15 00:50:59 dima Exp $
+ * $Id: locore.s,v 1.2 1998/06/10 19:59:40 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -56,11 +56,6 @@
#include <sys/syscall.h>
#include <assym.s>
-#ifndef EVCNT_COUNTERS
-#define _LOCORE
-#include <machine/intrcnt.h>
-#endif
-
/*
* PTmap is recursive pagemap at top of virtual address space.
* Within PTmap, the lev1 and lev0 page tables can be found.
@@ -298,20 +293,3 @@ LEAF(restorefpstate, 1)
.text
-/* XXX: make systat/vmstat happy */
- .data
-EXPORT(intrnames)
- .asciz "clock"
-intr_n = 0
-.rept INTRCNT_COUNT
- .ascii "intr "
- .byte intr_n / 10 + '0, intr_n % 10 + '0
- .asciz " " # space for platform-specific rewrite
- intr_n = intr_n + 1
-.endr
-EXPORT(eintrnames)
- .align 3
-EXPORT(intrcnt)
- .fill INTRCNT_COUNT + 1, 8, 0
-EXPORT(eintrcnt)
- .text
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index 5211879cf128..6d35e8a4f371 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: machdep.c,v 1.29 1998/12/30 10:38:58 dfr Exp $
+ * $Id: machdep.c,v 1.17 1998/10/14 10:08:35 peter Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -124,7 +124,6 @@
#include <machine/clock.h>
#include <machine/md_var.h>
#include <machine/reg.h>
-#include <machine/fpu.h>
#include <machine/pal.h>
#include <machine/cpuconf.h>
#include <machine/bootinfo.h>
@@ -199,8 +198,6 @@ int ncpus; /* number of cpus */
vm_offset_t phys_avail[10];
-SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
-
/* must be 2 less so 0 0 can signal end of chunks */
#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2)
@@ -214,17 +211,6 @@ extern struct linker_set netisr_set;
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-/*
- * Hooked into the shutdown chain; if the system is to be halted,
- * unconditionally drop back to the SRM console.
- */
-static void
-alpha_srm_shutdown(int howto, void *junk)
-{
- if (howto & RB_HALT)
- alpha_pal_halt();
-}
-
static void
cpu_startup(dummy)
void *dummy;
@@ -366,12 +352,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -414,8 +394,7 @@ again:
*/
bufinit();
vm_pager_bufferinit();
- at_shutdown_pri(alpha_srm_shutdown, 0, SHUTDOWN_FINAL,
- SHUTDOWN_PRI_LAST);
+
}
int
@@ -490,7 +469,7 @@ alpha_unknown_sysname()
{
static char s[128]; /* safe size */
- snprintf(s, sizeof(s), "%s family, unknown model variation 0x%lx",
+ sprintf(s, "%s family, unknown model variation 0x%lx",
platform.family, hwrpb->rpb_variation & SV_ST_MASK);
return ((const char *)s);
}
@@ -498,21 +477,6 @@ alpha_unknown_sysname()
static void
identifycpu(void)
{
- u_int64_t type, major, minor;
- u_int64_t amask;
- struct pcs *pcsp;
- char *cpuname[] = {
- "unknown", /* 0 */
- "EV3", /* 1 */
- "EV4 (21064)", /* 2 */
- "Simulation", /* 3 */
- "LCA Family", /* 4 */
- "EV5 (21164)", /* 5 */
- "EV45 (21064A)", /* 6 */
- "EV56 (21164A)", /* 7 */
- "EV6 (21264)", /* 8 */
- "PCA56 (21164PC)" /* 9 */
- };
/*
* print out CPU identification information.
@@ -530,32 +494,6 @@ identifycpu(void)
printf("variation: 0x%lx, revision 0x%lx\n",
hwrpb->rpb_variation, *(long *)hwrpb->rpb_revision);
#endif
- pcsp = LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
- /* cpu type */
- type = pcsp->pcs_proc_type;
- major = (type & PCS_PROC_MAJOR) >> PCS_PROC_MAJORSHIFT;
- minor = (type & PCS_PROC_MINOR) >> PCS_PROC_MINORSHIFT;
- if (major < sizeof(cpuname)/sizeof(char *))
- printf("CPU: %s major=%lu minor=%lu",
- cpuname[major], major, minor);
- else
- printf("CPU: major=%lu minor=%lu\n", major, minor);
- /* amask */
- if (major >= PCS_PROC_EV56) {
- amask = 0xffffffff; /* 32 bit for printf */
- amask = (~alpha_amask(amask)) & amask;
- printf(" extensions=0x%b\n", (u_int32_t) amask,
- "\020"
- "\001BWX"
- "\002FIX"
- "\003CIX"
- "\011MVI"
- "\012PRECISE"
- );
- } else
- printf("\n");
- /* PAL code */
- printf("OSF PAL rev: 0x%lx\n", pcsp->pcs_palrevisions[PALvar_OSF1]);
}
extern char kernel_text[], _end[];
@@ -723,7 +661,7 @@ alpha_init(pfn, ptb, bim, bip, biv)
/* NOTREACHED */
}
cpuinit[cputype].init(cputype);
- snprintf(cpu_model, sizeof(cpu_model), "%s", platform.model);
+ strcpy(cpu_model, platform.model);
/*
* Initalize the real console, so the the bootstrap console is
@@ -1091,22 +1029,10 @@ bzero(void *buf, size_t len)
*p++ = 0;
len--;
}
- while (len >= sizeof(u_long) * 8) {
- *(u_long*) p = 0;
- *((u_long*) p + 1) = 0;
- *((u_long*) p + 2) = 0;
- *((u_long*) p + 3) = 0;
- len -= sizeof(u_long) * 8;
- *((u_long*) p + 4) = 0;
- *((u_long*) p + 5) = 0;
- *((u_long*) p + 6) = 0;
- *((u_long*) p + 7) = 0;
- p += sizeof(u_long) * 8;
- }
while (len >= sizeof(u_long)) {
*(u_long*) p = 0;
- len -= sizeof(u_long);
p += sizeof(u_long);
+ len -= sizeof(u_long);
}
while (len) {
*p++ = 0;
@@ -1329,16 +1255,9 @@ sendsig(sig_t catcher, int sig, int mask, u_long code)
ksc.sc_ownedfp = p->p_md.md_flags & MDP_FPUSED;
bcopy(&p->p_addr->u_pcb.pcb_fp, (struct fpreg *)ksc.sc_fpregs,
sizeof(struct fpreg));
- ksc.sc_fp_control = p->p_addr->u_pcb.pcb_fp_control;
+ ksc.sc_fp_control = 0; /* XXX ? */
bzero(ksc.sc_reserved, sizeof ksc.sc_reserved); /* XXX */
- ksc.sc_xxx1[0] = 0; /* XXX */
- ksc.sc_xxx1[1] = 0; /* XXX */
- ksc.sc_traparg_a0 = frame->tf_regs[FRAME_TRAPARG_A0];
- ksc.sc_traparg_a1 = frame->tf_regs[FRAME_TRAPARG_A1];
- ksc.sc_traparg_a2 = frame->tf_regs[FRAME_TRAPARG_A2];
- ksc.sc_xxx2[0] = 0; /* XXX */
- ksc.sc_xxx2[1] = 0; /* XXX */
- ksc.sc_xxx2[2] = 0; /* XXX */
+ bzero(ksc.sc_xxx, sizeof ksc.sc_xxx); /* XXX */
#ifdef COMPAT_OSF1
@@ -1360,7 +1279,8 @@ sendsig(sig_t catcher, int sig, int mask, u_long code)
/*
* Set up the registers to return to sigcode.
*/
- frame->tf_regs[FRAME_PC] = PS_STRINGS - (esigcode - sigcode);
+ frame->tf_regs[FRAME_PC] =
+ (u_int64_t)PS_STRINGS - (esigcode - sigcode);
frame->tf_regs[FRAME_A0] = sig;
frame->tf_regs[FRAME_A1] = code;
frame->tf_regs[FRAME_A2] = (u_int64_t)scp;
@@ -1440,7 +1360,7 @@ sigreturn(struct proc *p,
fpcurproc = NULL;
bcopy((struct fpreg *)ksc.sc_fpregs, &p->p_addr->u_pcb.pcb_fp,
sizeof(struct fpreg));
- p->p_addr->u_pcb.pcb_fp_control = ksc.sc_fp_control;
+ /* XXX ksc.sc_fp_control ? */
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW)
@@ -1466,8 +1386,16 @@ cpu_boot(int howto)
void
cpu_halt(void)
{
- /*alpha_pal_halt(); */
- prom_halt(1);
+ alpha_pal_halt();
+}
+
+/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+ alpha_pal_halt(); /* XXX */
}
/*
@@ -1480,12 +1408,8 @@ setregs(struct proc *p, u_long entry, u_long stack)
bzero(tfp->tf_regs, FRAME_SIZE * sizeof tfp->tf_regs[0]);
bzero(&p->p_addr->u_pcb.pcb_fp, sizeof p->p_addr->u_pcb.pcb_fp);
- p->p_addr->u_pcb.pcb_fp_control = 0;
- p->p_addr->u_pcb.pcb_fp.fpr_cr = (FPCR_DYN_NORMAL
- | FPCR_INVD | FPCR_DZED
- | FPCR_OVFD | FPCR_INED
- | FPCR_UNFD);
-
+#define FP_RN 2 /* XXX */
+ p->p_addr->u_pcb.pcb_fp.fpr_cr = (long)FP_RN << 58;
alpha_pal_wrusp(stack);
tfp->tf_regs[FRAME_PS] = ALPHA_PSL_USERSET;
tfp->tf_regs[FRAME_PC] = entry & ~3;
@@ -1493,7 +1417,7 @@ setregs(struct proc *p, u_long entry, u_long stack)
tfp->tf_regs[FRAME_A0] = stack; /* a0 = sp */
tfp->tf_regs[FRAME_A1] = 0; /* a1 = rtld cleanup */
tfp->tf_regs[FRAME_A2] = 0; /* a2 = rtld object */
- tfp->tf_regs[FRAME_A3] = PS_STRINGS; /* a3 = ps_strings */
+ tfp->tf_regs[FRAME_A3] = (u_int64_t)PS_STRINGS; /* a3 = ps_strings */
tfp->tf_regs[FRAME_T12] = tfp->tf_regs[FRAME_PC]; /* a.k.a. PV */
p->p_md.md_flags &= ~MDP_FPUSED;
diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c
index aa3fcae97094..f08e7d5b2fc5 100644
--- a/sys/alpha/alpha/mem.c
+++ b/sys/alpha/alpha/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.3 1998/11/08 12:39:01 dfr Exp $
+ * $Id: mem.c,v 1.1 1998/06/10 10:52:54 dfr Exp $
*/
/*
@@ -271,7 +271,7 @@ kmemphys:
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, int prot)
+memmmap(dev_t dev, int offset, int prot)
{
/*
* /dev/mem is the only one that makes sense through this
@@ -400,22 +400,16 @@ iskmemdev(dev)
dev_t dev;
{
- return (((major(dev) == mem_cdevsw.d_maj)
- && (minor(dev) == 0 || minor(dev) == 1))
-/* or the osf/1 mem device */
- ||((major(dev) == 0)
- && (minor(dev) == 0x00200002)));
+ return ((major(dev) == mem_cdevsw.d_maj)
+ && (minor(dev) == 0 || minor(dev) == 1));
}
int
iszerodev(dev)
dev_t dev;
{
- return (((major(dev) == mem_cdevsw.d_maj)
- && minor(dev) == 12)
-/* or the osf/1 zero device */
- ||((major(dev) == 0)
- && (minor(dev) == 0x02600000)));
+ return ((major(dev) == mem_cdevsw.d_maj)
+ && minor(dev) == 12);
}
diff --git a/sys/alpha/alpha/pal.s b/sys/alpha/alpha/pal.s
index 3d179a53042a..36ecdfb22e1c 100644
--- a/sys/alpha/alpha/pal.s
+++ b/sys/alpha/alpha/pal.s
@@ -348,24 +348,3 @@ LEAF(alpha_pal_swpctx,1)
call_pal PAL_OSF1_swpctx
RET
END(alpha_pal_swpctx)
-
-
-/*
- * alpha_pal_wrperfmon: Write perf monitor [PRIVILEGED]
- *
- * Enables / disables performance monitoring hardware
- *
- * Arguments:
- * a0 function type
- *
- * a1 function parameter
- *
- * Returns:
- * v0 0 (failure) or 1 (success)
- */
-LEAF(alpha_pal_wrperfmon,2)
- call_pal PAL_OSF1_wrperfmon
- RET
- END(alpha_pal_wrperfmon)
-
-
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index 0e7aa738c64f..2f5b4e6bbe05 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -43,7 +43,7 @@
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp
* with some ideas from NetBSD's alpha pmap
- * $Id: pmap.c,v 1.11 1998/10/21 11:38:06 dg Exp $
+ * $Id: pmap.c,v 1.9 1998/08/23 16:05:55 dfr Exp $
*/
/*
@@ -1045,7 +1045,7 @@ pmap_dispose_proc(p)
*(ptek + i) = 0;
pmap_invalidate_page(kernel_pmap,
(vm_offset_t)p->p_addr + i * PAGE_SIZE);
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
vm_page_free(m);
}
}
@@ -1069,7 +1069,8 @@ pmap_swapout_proc(p)
if ((m = vm_page_lookup(upobj, i)) == NULL)
panic("pmap_swapout_proc: upage already missing???");
m->dirty = VM_PAGE_BITS_ALL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+ vm_page_deactivate(m);
pmap_kremove( (vm_offset_t) p->p_addr + PAGE_SIZE * i);
}
}
@@ -1352,8 +1353,6 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p)
}
#endif
- p->wire_count--;
- cnt.v_wire_count--;
vm_page_free_zero(p);
return 1;
}
diff --git a/sys/alpha/alpha/support.s b/sys/alpha/alpha/support.s
index 5b45b49b9501..1bf8b45156ad 100644
--- a/sys/alpha/alpha/support.s
+++ b/sys/alpha/alpha/support.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.2 1998/12/20 13:21:55 dfr Exp $
+ * $Id$
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -64,7 +64,6 @@
*/
LEAF(suword, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -84,7 +83,6 @@
END(suword)
LEAF(subyte, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -109,7 +107,6 @@
END(subyte)
LEAF(fuword, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -128,7 +125,6 @@
END(fuword)
LEAF(fubyte, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -144,6 +140,7 @@
stq zero, U_PCB_ONFAULT(t2) /* clean up */
+ mov zero, v0
RET
END(fubyte)
diff --git a/sys/alpha/alpha/swtch.s b/sys/alpha/alpha/swtch.s
index ab3f996d6f1e..90d1bcf6ee87 100644
--- a/sys/alpha/alpha/swtch.s
+++ b/sys/alpha/alpha/swtch.s
@@ -1,4 +1,4 @@
-/* $Id: swtch.s,v 1.6 1998/11/15 18:25:15 dfr Exp $ */
+/* $Id: swtch.s,v 1.4 1998/07/12 16:32:03 dfr Exp $ */
/* $NetBSD: locore.s,v 1.47 1998/03/22 07:26:32 thorpej Exp $ */
/*
@@ -325,17 +325,6 @@ Lsetfpenable:
call_pal PAL_OSF1_wrfen
Lrestoreregs:
- /* set the hae register if this process has specified a value */
- ldq t0, curproc
- beq t0, Lnohae
- ldq t1, P_MD_FLAGS(t0)
- and t1, MDP_HAEUSED
- beq t1, Lnohae
- ldq a0, P_MD_HAE(t0)
- ldq pv, chipset + CHIPSET_WRITE_HAE
- CALL((pv))
-Lnohae:
-
/* restore the registers, and return */
bsr ra, exception_restore_regs /* jmp/CALL trashes pv/t12 */
ldq ra,(FRAME_RA*8)(sp)
diff --git a/sys/alpha/alpha/sys_machdep.c b/sys/alpha/alpha/sys_machdep.c
index 0d89b8fbba96..e0c55dd9df72 100644
--- a/sys/alpha/alpha/sys_machdep.c
+++ b/sys/alpha/alpha/sys_machdep.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
- * $Id: sys_machdep.c,v 1.2 1998/11/15 18:25:15 dfr Exp $
+ * $Id: sys_machdep.c,v 1.34 1998/03/23 19:52:34 jlemon Exp $
*
*/
@@ -50,12 +50,9 @@
#include <sys/user.h>
#include <machine/cpu.h>
-#include <machine/sysarch.h>
#include <vm/vm_kern.h> /* for kernel_map */
-#include <machine/fpu.h>
-
#ifndef _SYS_SYSPROTO_H_
struct sysarch_args {
int op;
@@ -63,10 +60,6 @@ struct sysarch_args {
};
#endif
-static int alpha_sethae(struct proc *p, char *args);
-static int alpha_get_fpmask(struct proc *p, char *args);
-static int alpha_set_fpmask(struct proc *p, char *args);
-
int
sysarch(p, uap)
struct proc *p;
@@ -75,79 +68,9 @@ sysarch(p, uap)
int error = 0;
switch(SCARG(uap,op)) {
- case ALPHA_SETHAE:
- error = alpha_sethae(p, uap->parms);
- break;
- case ALPHA_GET_FPMASK:
- error = alpha_get_fpmask(p, uap->parms);
- break;
- case ALPHA_SET_FPMASK:
- error = alpha_set_fpmask(p, uap->parms);
- break;
-
default:
error = EINVAL;
break;
}
return (error);
}
-
-struct alpha_sethae_args {
- u_int64_t hae;
-};
-
-static int
-alpha_sethae(struct proc *p, char *args)
-{
- int error;
- struct alpha_sethae_args ua;
-
- if (error = copyin(args, &ua, sizeof(struct alpha_sethae_args)))
- return (error);
-
- if (securelevel > 0)
- return (EPERM);
-
- if (error = suser(p->p_ucred, &p->p_acflag))
- return error;
-
- p->p_md.md_flags |= MDP_HAEUSED;
- p->p_md.md_hae = ua.hae;
-
- return (0);
-}
-
-struct alpha_fpmask_args {
- u_int64_t mask;
-};
-
-static int
-alpha_get_fpmask(struct proc *p, char *args)
-{
- int error;
- struct alpha_fpmask_args ua;
-
- ua.mask = p->p_addr->u_pcb.pcb_fp_control;
- error = copyout(&ua, args, sizeof(struct alpha_fpmask_args));
-
- return (error);
-}
-
-static int
-alpha_set_fpmask(struct proc *p, char *args)
-{
- int error;
- u_int64_t oldmask, *fp_control;
- struct alpha_fpmask_args ua;
-
- if (error = copyin(args, &ua, sizeof(struct alpha_fpmask_args)))
- return (error);
-
- fp_control = &p->p_addr->u_pcb.pcb_fp_control;
- oldmask = *fp_control;
- *fp_control = ua.mask & IEEE_TRAP_ENABLE_MASK;
- ua.mask = oldmask;
-
- error = copyout(&ua, args, sizeof(struct alpha_fpmask_args));
- return (error);
-}
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c
index 107f1b06a6de..69442a0cd2e9 100644
--- a/sys/alpha/alpha/trap.c
+++ b/sys/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $Id: trap.c,v 1.9 1998/12/16 15:21:50 bde Exp $ */
+/* $Id: trap.c,v 1.4 1998/07/05 12:24:17 dfr Exp $ */
/* $NetBSD: trap.c,v 1.31 1998/03/26 02:21:46 thorpej Exp $ */
/*
@@ -57,7 +57,6 @@
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/pal.h>
-#include <machine/fpu.h>
#ifdef DDB
#include <ddb/ddb.h>
@@ -154,7 +153,7 @@ printtrap(a0, a1, a2, entry, framep, isfatal, user)
entryname = "system call";
break;
default:
- snprintf(ubuf, sizeof(ubuf), "type %lx", entry);
+ sprintf(ubuf, "type %lx", entry);
entryname = (const char *) ubuf;
break;
}
@@ -243,13 +242,11 @@ trap(a0, a1, a2, entry, framep)
case ALPHA_KENTRY_ARITH:
/*
- * If user-land, give a SIGFPE if software completion
- * is not requested or if the completion fails.
+ * If user-land, just give a SIGFPE. Should do
+ * software completion and IEEE handling, if the
+ * user has requested that.
*/
if (user) {
- if (a0 & EXCSUM_SWC)
- if (fp_software_completion(a1, p))
- goto out;
i = SIGFPE;
ucode = a0; /* exception summary */
break;
@@ -419,7 +416,7 @@ trap(a0, a1, a2, entry, framep)
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
- && va < USRSTACK) {
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@@ -450,8 +447,7 @@ trap(a0, a1, a2, entry, framep)
* we need to reflect that as an access error.
*/
if (map != kernel_map &&
- (caddr_t)va >= vm->vm_maxsaddr
- && (caddr_t)va < (caddr_t)USRSTACK) {
+ (caddr_t)va >= vm->vm_maxsaddr) {
if (rv == KERN_SUCCESS) {
unsigned nss;
@@ -497,9 +493,6 @@ trap(a0, a1, a2, entry, framep)
#ifdef DEBUG
printtrap(a0, a1, a2, entry, framep, 1, user);
#endif
- framep->tf_regs[FRAME_TRAPARG_A0] = a0;
- framep->tf_regs[FRAME_TRAPARG_A1] = a1;
- framep->tf_regs[FRAME_TRAPARG_A2] = a2;
trapsignal(p, i, ucode);
out:
if (user) {
@@ -546,14 +539,10 @@ syscall(code, framep)
u_int64_t args[10]; /* XXX */
u_int hidden = 0, nargs;
- framep->tf_regs[FRAME_TRAPARG_A0] = 0;
- framep->tf_regs[FRAME_TRAPARG_A1] = 0;
- framep->tf_regs[FRAME_TRAPARG_A2] = 0;
#if notdef /* can't happen, ever. */
- if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0)
+ if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0) {
panic("syscall");
#endif
-
cnt.v_syscall++;
p = curproc;
p->p_md.md_tf = framep;
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 592a089d11c7..95a41d83feeb 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.6 1998/12/16 15:21:50 bde Exp $
+ * $Id: vm_machdep.c,v 1.3 1998/07/12 16:30:58 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -79,7 +79,6 @@
#include <machine/clock.h>
#include <machine/cpu.h>
-#include <machine/fpu.h>
#include <machine/md_var.h>
#include <machine/prom.h>
@@ -148,17 +147,6 @@ cpu_fork(p1, p2)
p2->p_addr->u_pcb.pcb_hw.apcb_usp = alpha_pal_rdusp();
/*
- * Set the floating point state.
- */
- if ((p2->p_addr->u_pcb.pcb_fp_control & IEEE_INHERIT) == 0) {
- p2->p_addr->u_pcb.pcb_fp_control = 0;
- p2->p_addr->u_pcb.pcb_fp.fpr_cr = (FPCR_DYN_NORMAL
- | FPCR_INVD | FPCR_DZED
- | FPCR_OVFD | FPCR_INED
- | FPCR_UNFD);
- }
-
- /*
* Arrange for a non-local goto when the new process
* is started, to resume here, returning nonzero from setjmp.
*/
@@ -378,10 +366,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
- if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
- return (1);
+ if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= (size_t) USRSTACK)
+ return (1);
- nss = roundup(USRSTACK - sp, PAGE_SIZE);
+ nss = roundup(USRSTACK - (vm_offset_t)sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);
diff --git a/sys/alpha/conf/GENERIC b/sys/alpha/conf/GENERIC
index 6c84ce866ba6..e09424cc1f9c 100644
--- a/sys/alpha/conf/GENERIC
+++ b/sys/alpha/conf/GENERIC
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.13 1998/12/29 03:59:49 gpalmer Exp $
+# $Id: GENERIC,v 1.9 1998/10/13 21:38:46 jkh Exp $
machine "alpha"
cpu "EV4"
@@ -22,7 +22,6 @@ maxusers 10
# Platforms supported
options "DEC_AXPPCI_33" # UDB, Multia, AXPpci33, Noname
options "DEC_EB164" # EB164, PC164, PC164LX, PC164SX
-options "DEC_EB64PLUS" # EB64+, Aspen Alpine, etc
options "DEC_2100_A50" # AlphaStation 200, 250, 255, 400
options "DEC_KN20AA" # AlphaStation 500, 600
options "DEC_ST550" # Personal Workstation 433, 500, 600
@@ -89,7 +88,6 @@ device sio1 at isa0 port "IO_COM2" irq 3 flags 0x50
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
device de0
-device fxp0
device le0
pseudo-device loop
diff --git a/sys/alpha/conf/Makefile.alpha b/sys/alpha/conf/Makefile.alpha
index 99f61697f914..d9b783c91060 100644
--- a/sys/alpha/conf/Makefile.alpha
+++ b/sys/alpha/conf/Makefile.alpha
@@ -1,7 +1,7 @@
# Makefile.alpha -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.alpha 7.1 5/10/91
-# $Id: Makefile.alpha,v 1.15 1998/12/17 22:36:21 dfr Exp $
+# $Id: Makefile.alpha,v 1.9 1998/09/16 08:22:09 dfr Exp $
#
# Makefile for FreeBSD
#
@@ -17,7 +17,7 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
BINFORMAT?= elf
@@ -41,8 +41,8 @@ INCLUDES+= -I$S/../include
.else
INCLUDES+= -I/usr/include
.endif
-COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h
-CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
+COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h -U__NetBSD__
+CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -mno-fp-regs -Wa,-mev56
LOAD_ADDRESS?= 0xfffffc0000300000
DEFINED_PROF= ${PROF}
.if defined(PROF)
@@ -78,7 +78,7 @@ SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
.if ${BINFORMAT} == elf
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o \
${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} --export-dynamic -T$S/alpha/conf/kernel.script -e locorestart \
-o $@ -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
@@ -98,10 +98,6 @@ SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \
makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
@@ -124,9 +120,9 @@ symbols.sort: ${ALPHA}/alpha/symbols.raw
locore.o: ${ALPHA}/alpha/locore.s assym.s
${NORMAL_S}
-hack.So: Makefile
+hack.so: Makefile
echo "void __elf_kld_hack() {}" > hack.c
- ${CC} -shared -nostdlib hack.c -o hack.So
+ ${CC} -shared -nostdlib hack.c -o hack.so
rm -f hack.c
setdef0.o: ${ALPHA}/alpha/setdef0.c setdefs.h
diff --git a/sys/alpha/conf/files.alpha b/sys/alpha/conf/files.alpha
index 6c6d2b598bb8..d38c396d9a2f 100644
--- a/sys/alpha/conf/files.alpha
+++ b/sys/alpha/conf/files.alpha
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $Id: files.alpha,v 1.14 1998/12/04 10:52:47 dfr Exp $
+# $Id: files.alpha,v 1.10 1998/09/17 09:38:36 dfr Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -19,7 +19,6 @@ alpha/alpha/cpuconf.c standard
alpha/alpha/atomic.s standard
alpha/alpha/dec_kn8ae.c optional dec_kn8ae
alpha/alpha/dec_eb164.c optional dec_eb164
-alpha/alpha/dec_eb64plus.c optional dec_eb64plus
alpha/alpha/dec_kn20aa.c optional dec_kn20aa
alpha/alpha/dec_2100_a50.c optional dec_2100_a50
alpha/alpha/dec_st550.c optional dec_st550
@@ -44,8 +43,7 @@ alpha/alpha/in_cksum.c optional inet
# now normal.
# alpha/alpha/locore.s standard
alpha/alpha/machdep.c standard
-alpha/alpha/fp_emulate.c standard
-alpha/alpha/ieee_float.c standard
+alpha/alpha/math_emulate.c optional math_emulate
alpha/alpha/mem.c standard
alpha/alpha/mp_machdep.c optional smp
alpha/alpha/perfmon.c optional perfmon profiling-routine
@@ -66,13 +64,13 @@ clock_if.o standard \
compile-with "${NORMAL_C}" \
no-implicit-rule local
clock_if.c standard \
- dependency "$S/kern/makedevops.pl $S/alpha/alpha/clock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -c $S/alpha/alpha/clock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/alpha/alpha/clock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/alpha/alpha/clock_if.m" \
no-obj no-implicit-rule before-depend local \
clean "clock_if.c"
clock_if.h standard \
- dependency "$S/kern/makedevops.pl $S/alpha/alpha/clock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -h $S/alpha/alpha/clock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/alpha/alpha/clock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/alpha/alpha/clock_if.m" \
no-obj no-implicit-rule before-depend \
clean "clock_if.h"
alpha/alpha/diskslice_machdep.c standard
@@ -98,23 +96,23 @@ mcclock_if.o standard \
compile-with "${NORMAL_C}" \
no-implicit-rule local
mcclock_if.c standard \
- dependency "$S/kern/makedevops.pl $S/dev/dec/mcclock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -c $S/dev/dec/mcclock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/dec/mcclock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/dec/mcclock_if.m" \
no-obj no-implicit-rule before-depend local \
clean "mcclock_if.c"
mcclock_if.h standard \
- dependency "$S/kern/makedevops.pl $S/dev/dec/mcclock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -h $S/dev/dec/mcclock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/dec/mcclock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/dec/mcclock_if.m" \
no-obj no-implicit-rule before-depend \
clean "mcclock_if.h"
alpha/pci/cia.c optional cia
alpha/pci/pci_eb164_intr.s optional cia
+alpha/isa/mcclock_isa.c optional cia
alpha/pci/apecs.c optional apecs
-alpha/pci/pci_eb64plus_intr.s optional apecs
alpha/pci/lca.c optional lca
alpha/pci/pcibus.c optional pci
alpha/isa/isa.c optional isa
-alpha/isa/mcclock_isa.c optional isa
+kern/link_elf.c standard
alpha/alpha/elf_machdep.c standard
libkern/bcd.c standard
libkern/bcmp.c standard
diff --git a/sys/alpha/conf/majors.alpha b/sys/alpha/conf/majors.alpha
index adecadb7ad6e..7766f077b526 100644
--- a/sys/alpha/conf/majors.alpha
+++ b/sys/alpha/conf/majors.alpha
@@ -1,4 +1,4 @@
-$Id: majors.alpha,v 1.6 1999/01/14 03:47:52 msmith Exp $
+$Id: majors.alpha,v 1.1 1998/06/10 10:54:12 dfr Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -125,7 +125,7 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
@@ -140,6 +140,3 @@ chrdev name comments
96 altq alternate queueing (including cbq, red, wfq)
97 prom Alpha PROM console
98 zsc TurboLaser console uart
-99 ipr Iprobe on-chip perf. counters (gallatin@freebsd.org)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-112 kbd keyboard
diff --git a/sys/alpha/conf/options.alpha b/sys/alpha/conf/options.alpha
index 44add990c1fe..a0a559057dac 100644
--- a/sys/alpha/conf/options.alpha
+++ b/sys/alpha/conf/options.alpha
@@ -1,10 +1,9 @@
-# $Id: options.alpha,v 1.7 1998/09/16 08:22:09 dfr Exp $
+# $Id: options.alpha,v 1.6 1998/08/21 23:43:15 gpalmer Exp $
EV5 opt_global.h
EV4 opt_global.h
DEC_KN8AE opt_cpu.h
DEC_EB164 opt_cpu.h
-DEC_EB64PLUS opt_cpu.h
DEC_KN20AA opt_cpu.h
DEC_2100_A50 opt_cpu.h
DEC_ST550 opt_cpu.h
diff --git a/sys/alpha/include/alpha_cpu.h b/sys/alpha/include/alpha_cpu.h
index 80eb3078a309..5107274ff18b 100644
--- a/sys/alpha/include/alpha_cpu.h
+++ b/sys/alpha/include/alpha_cpu.h
@@ -1,4 +1,4 @@
-/* $Id: alpha_cpu.h,v 1.4 1998/12/23 11:50:50 dfr Exp $ */
+/* $Id: alpha_cpu.h,v 1.2 1998/06/10 10:54:21 dfr Exp $ */
/* From: NetBSD: alpha_cpu.h,v 1.15 1997/09/20 19:02:34 mjacob Exp */
/*
@@ -273,10 +273,8 @@ typedef unsigned long alpha_pt_entry_t;
*/
#define ALPHA_AMASK_BWX 0x0001 /* byte/word extension */
-#define ALPHA_AMASK_FIX 0x0002 /* sqrt and f <-> i conversion extension */
-#define ALPHA_AMASK_CIX 0x0004 /* count extension */
-#define ALPHA_AMASK_MVI 0x0100 /* multimedia extension */
-#define ALPHA_AMASK_PRECISE 0x0200 /* Precise arithmetic traps */
+#define ALPHA_AMASK_CIX 0x0002 /* count extension */
+#define ALPHA_AMASK_MAX 0x0100 /* multimedia extension */
/*
* Chip family IDs returned by implver instruction
@@ -326,6 +324,5 @@ void alpha_pal_wrusp __P((unsigned long));
void alpha_pal_wrvptptr __P((unsigned long));
void alpha_pal_wrmces __P((unsigned long));
void alpha_pal_wrval __P((unsigned long));
-unsigned long alpha_pal_wrperfmon __P((unsigned long, unsigned long));
#endif /* __ALPHA_ALPHA_CPU_H__ */
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index 09413e7d49f0..aeaba523e685 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -1,4 +1,4 @@
-/* $Id: ansi.h,v 1.3 1998/10/12 23:57:58 alex Exp $ */
+/* $Id: ansi.h,v 1.2 1998/03/09 05:53:07 jb Exp $ */
/* From: NetBSD: ansi.h,v 1.9 1997/11/23 20:20:53 kleink Exp */
/*-
@@ -63,6 +63,9 @@ typedef struct {
#define _BSD_TIMER_T_ int /* timer_t */
#define _BSD_SUSECONDS_T_ int /* suseconds_t */
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
+#define _BSD_UINT8_T_ unsigned char /* uint8_t */
+#define _BSD_UINT16_T_ unsigned short /* uint16_t */
+#define _BSD_UINT32_T_ unsigned int /* uint32_t */
/*
* Types which are fundamental to the implementation and must be used
@@ -105,20 +108,4 @@ typedef struct {
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-typedef long __intptr_t;
-typedef unsigned long __uintptr_t;
-
#endif /* _ANSI_H_ */
diff --git a/sys/alpha/include/chipset.h b/sys/alpha/include/chipset.h
index f7a61be4c1f2..74698c5c5a9a 100644
--- a/sys/alpha/include/chipset.h
+++ b/sys/alpha/include/chipset.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: chipset.h,v 1.5 1998/10/06 14:18:39 dfr Exp $
+ * $Id: chipset.h,v 1.4 1998/08/10 07:53:58 dfr Exp $
*/
#ifndef _MACHINE_CHIPSET_H_
@@ -54,8 +54,7 @@ typedef void alpha_chipset_cfgwritew_t(u_int, u_int, u_int, u_int,
typedef void alpha_chipset_cfgwritel_t(u_int, u_int, u_int, u_int,
u_int32_t);
typedef vm_offset_t alpha_chipset_addrcvt_t(vm_offset_t);
-typedef u_int64_t alpha_chipset_read_hae_t(void);
-typedef void alpha_chipset_write_hae_t(u_int64_t);
+
typedef struct alpha_chipset {
/*
@@ -92,14 +91,8 @@ typedef struct alpha_chipset {
/*
* PCI address space translation functions
*/
- alpha_chipset_addrcvt_t* cvt_to_dense;
- alpha_chipset_addrcvt_t* cvt_to_bwx;
-
- /*
- * Access the HAE register
- */
- alpha_chipset_read_hae_t* read_hae;
- alpha_chipset_write_hae_t* write_hae;
+ alpha_chipset_addrcvt_t* cvt_to_dense;
+ alpha_chipset_addrcvt_t* cvt_to_bwx;
/*
* PCI interrupt device.
@@ -111,14 +104,4 @@ typedef struct alpha_chipset {
extern alpha_chipset_t chipset;
-/*
- * Exported sysctl variables describing the PCI chipset.
- */
-extern char chipset_type[10];
-extern int chipset_bwx;
-extern long chipset_ports;
-extern long chipset_memory;
-extern long chipset_dense;
-extern long chipset_hae_mask;
-
#endif /* !_MACHINE_CHIPSET_H_ */
diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h
index 52ef8d1649df..d74797622648 100644
--- a/sys/alpha/include/console.h
+++ b/sys/alpha/include/console.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: console.h,v 1.40 1998/09/17 09:38:36 dfr Exp $
+ * $Id: console.h,v 1.39 1998/08/06 09:15:52 dfr Exp $
* from: i386/include console.h,v 1.39
*/
@@ -304,7 +304,7 @@ struct video_info {
int vi_flags;
#define V_INFO_COLOR (1<<0)
#define V_INFO_GRAPHICS (1<<1)
-#define V_INFO_LINEAR (1<<2)
+#define V_INFO_LENEAR (1<<2)
#define V_INFO_VESA (1<<3)
int vi_width;
int vi_height;
diff --git a/sys/alpha/include/fpu.h b/sys/alpha/include/fpu.h
deleted file mode 100644
index c9efceed0293..000000000000
--- a/sys/alpha/include/fpu.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id: fpu.h,v 1.1 1998/12/04 10:52:48 dfr Exp $
- */
-
-#ifndef _MACHINE_FPU_H_
-#define _MACHINE_FPU_H_
-
-/*
- * Floating point control register bits.
- *
- * From Alpha AXP Architecture Reference Manual, Instruction
- * Descriptions (I) PP 4-69.
- */
-
-#define FPCR_INVD (1LL << 49) /* Invalid Operation DIsable */
-#define FPCR_DZED (1LL << 50) /* Division by Zero Disable */
-#define FPCR_OVFD (1LL << 51) /* Overflow Disable */
-#define FPCR_INV (1LL << 52) /* Invalid Operation */
-#define FPCR_DZE (1LL << 53) /* Division by Zero */
-#define FPCR_OVF (1LL << 54) /* Overflow */
-#define FPCR_UNF (1LL << 55) /* Underflow */
-#define FPCR_INE (1LL << 56) /* Inexact Result */
-#define FPCR_IOV (1LL << 57) /* Integer Overflow */
-#define FPCR_DYN_CHOPPED (0LL << 58) /* Chopped rounding mode */
-#define FPCR_DYN_MINUS (1LL << 58) /* Minus infinity */
-#define FPCR_DYN_NORMAL (2LL << 58) /* Normal rounding */
-#define FPCR_DYN_PLUS (3LL << 58) /* Plus infinity */
-#define FPCR_DYN_MASK (3LL << 58) /* Rounding mode mask */
-#define FPCR_DYN_SHIFT 58
-#define FPCR_UNDZ (1LL << 60) /* Underflow to Zero */
-#define FPCR_UNFD (1LL << 61) /* Underflow Disable */
-#define FPCR_INED (1LL << 62) /* Inexact Disable */
-#define FPCR_SUM (1LL << 63) /* Summary Bit */
-#define FPCR_MASK (~0LL << 49)
-
-/*
- * Exception summary bits.
- *
- * From Alpha AXP Architecture Reference Manual, DEC OSF/1 Exceptions
- * and Interrupts (II-B) PP 5-5.
- */
-
-#define EXCSUM_SWC (1LL << 0) /* Software completion */
-#define EXCSUM_INV (1LL << 1) /* Invalid operation */
-#define EXCSUM_DZE (1LL << 2) /* Division by zero */
-#define EXCSUM_OVF (1LL << 3) /* Overflow */
-#define EXCSUM_UNF (1LL << 4) /* Underflow */
-#define EXCSUM_INE (1LL << 5) /* Inexact result */
-#define EXCSUM_IOV (1LL << 6) /* Integer overflow */
-
-/*
- * Definitions for IEEE trap enables. These are implemented in
- * software and should be compatible with OSF/1 and Linux.
- */
-
-/* read/write flags */
-#define IEEE_TRAP_ENABLE_INV (1LL << 1) /* Invalid operation */
-#define IEEE_TRAP_ENABLE_DZE (1LL << 2) /* Division by zero */
-#define IEEE_TRAP_ENABLE_OVF (1LL << 3) /* Overflow */
-#define IEEE_TRAP_ENABLE_UNF (1LL << 4) /* Underflow */
-#define IEEE_TRAP_ENABLE_INE (1LL << 5) /* Inexact result */
-#define IEEE_TRAP_ENABLE_MASK (IEEE_TRAP_ENABLE_INV \
- | IEEE_TRAP_ENABLE_DZE \
- | IEEE_TRAP_ENABLE_OVF \
- | IEEE_TRAP_ENABLE_UNF \
- | IEEE_TRAP_ENABLE_INE)
-
-/* read only flags */
-#define IEEE_STATUS_INV (1LL << 17) /* Invalid operation */
-#define IEEE_STATUS_DZE (1LL << 18) /* Division by zero */
-#define IEEE_STATUS_OVF (1LL << 19) /* Overflow */
-#define IEEE_STATUS_UNF (1LL << 20) /* Underflow */
-#define IEEE_STATUS_INE (1LL << 21) /* Inexact result */
-#define IEEE_STATUS_MASK (IEEE_STATUS_INV \
- | IEEE_STATUS_DZE \
- | IEEE_STATUS_OVF \
- | IEEE_STATUS_UNF \
- | IEEE_STATUS_INE)
-#define IEEE_STATUS_TO_EXCSUM_SHIFT 16 /* convert to excsum */
-#define IEEE_STATUS_TO_FPCR_SHIFT 35 /* convert to fpcr */
-
-#define IEEE_INHERIT (1LL << 63) /* inherit on fork */
-
-/* read and write floating point control register */
-#define GET_FPCR(x) \
- __asm__("trapb"); \
- __asm__("mf_fpcr %0" : "=f" (x)); \
- __asm__("trapb")
-#define SET_FPCR(x) \
- __asm__("trapb"); \
- __asm__("mt_fpcr %0" : : "f" (x)); \
- __asm__("trapb")
-
-#ifdef KERNEL
-
-extern int fp_software_completion(u_int64_t regmask, struct proc *p);
-
-#endif
-
-#endif /* ! _MACHINE_FPU_H_ */
diff --git a/sys/alpha/include/frame.h b/sys/alpha/include/frame.h
index 8af1d7162517..19aaef68ea8d 100644
--- a/sys/alpha/include/frame.h
+++ b/sys/alpha/include/frame.h
@@ -1,4 +1,4 @@
-/* $Id: frame.h,v 1.1 1998/01/10 10:13:14 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: frame.h,v 1.4 1997/04/06 08:47:27 cgd Exp */
/*
@@ -47,39 +47,35 @@
*/
/* Quadword offsets of the registers to be saved. */
-#define FRAME_V0 0
-#define FRAME_T0 1
-#define FRAME_T1 2
-#define FRAME_T2 3
-#define FRAME_T3 4
-#define FRAME_T4 5
-#define FRAME_T5 6
-#define FRAME_T6 7
-#define FRAME_T7 8
-#define FRAME_S0 9
-#define FRAME_S1 10
-#define FRAME_S2 11
-#define FRAME_S3 12
-#define FRAME_S4 13
-#define FRAME_S5 14
-#define FRAME_S6 15
-#define FRAME_A3 16
-#define FRAME_A4 17
-#define FRAME_A5 18
-#define FRAME_T8 19
-#define FRAME_T9 20
-#define FRAME_T10 21
-#define FRAME_T11 22
-#define FRAME_RA 23
-#define FRAME_T12 24
-#define FRAME_AT 25
-#define FRAME_SP 26
-/* The following are set only when a signal is to be delivered to a process. */
-#define FRAME_TRAPARG_A0 27
-#define FRAME_TRAPARG_A1 28
-#define FRAME_TRAPARG_A2 29
+#define FRAME_V0 0
+#define FRAME_T0 1
+#define FRAME_T1 2
+#define FRAME_T2 3
+#define FRAME_T3 4
+#define FRAME_T4 5
+#define FRAME_T5 6
+#define FRAME_T6 7
+#define FRAME_T7 8
+#define FRAME_S0 9
+#define FRAME_S1 10
+#define FRAME_S2 11
+#define FRAME_S3 12
+#define FRAME_S4 13
+#define FRAME_S5 14
+#define FRAME_S6 15
+#define FRAME_A3 16
+#define FRAME_A4 17
+#define FRAME_A5 18
+#define FRAME_T8 19
+#define FRAME_T9 20
+#define FRAME_T10 21
+#define FRAME_T11 22
+#define FRAME_RA 23
+#define FRAME_T12 24
+#define FRAME_AT 25
+#define FRAME_SP 26
-#define FRAME_SW_SIZE (FRAME_TRAPARG_A2 + 1)
+#define FRAME_SW_SIZE (FRAME_SP + 1)
#define FRAME_HW_OFFSET FRAME_SW_SIZE
#define FRAME_PS (FRAME_HW_OFFSET + ALPHA_HWFRAME_PS)
diff --git a/sys/alpha/include/ieeefp.h b/sys/alpha/include/ieeefp.h
index a838e9891955..c0f4c2f4035c 100644
--- a/sys/alpha/include/ieeefp.h
+++ b/sys/alpha/include/ieeefp.h
@@ -1,4 +1,4 @@
-/* $Id: ieeefp.h,v 1.1.1.1 1998/03/09 05:43:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: ieeefp.h,v 1.2 1997/04/06 08:47:28 cgd Exp */
/*
@@ -10,14 +10,12 @@
#define _ALPHA_IEEEFP_H_
typedef int fp_except;
-#define FP_X_INV (1LL << 1) /* invalid operation exception */
-#define FP_X_DZ (1LL << 2) /* divide-by-zero exception */
-#define FP_X_OFL (1LL << 3) /* overflow exception */
-#define FP_X_UFL (1LL << 4) /* underflow exception */
-#define FP_X_IMP (1LL << 5) /* imprecise(inexact) exception */
-#if 0
-#define FP_X_IOV (1LL << 6) /* integer overflow XXX? */
-#endif
+#define FP_X_INV 0x01 /* invalid operation exception */
+#define FP_X_DZ 0x02 /* divide-by-zero exception */
+#define FP_X_OFL 0x04 /* overflow exception */
+#define FP_X_UFL 0x08 /* underflow exception */
+#define FP_X_IMP 0x10 /* imprecise (loss of precision; "inexact") */
+#define FP_X_IOV 0x20 /* integer overflow XXX? */
typedef enum {
FP_RZ=0, /* round to zero (truncate) */
diff --git a/sys/alpha/include/inst.h b/sys/alpha/include/inst.h
deleted file mode 100644
index 27011848b175..000000000000
--- a/sys/alpha/include/inst.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * 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.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_INST_H_
-#define _MACHINE_INST_H_
-
-union alpha_instruction {
- u_int32_t word;
- struct {
- u_int32_t argument : 26;
- u_int32_t opcode : 6;
-#define op_call_pal 0x00
-#define op_lda 0x08
-#define op_ldah 0x09
-#define op_ldbu 0x0a
-#define op_unop 0x0b
-#define op_ldq_u 0x0b
-#define op_ldwu 0x0c
-#define op_stw 0x0d
-#define op_stb 0x0e
-#define op_stq_u 0x0f
-#define op_inta 0x10
-#define inta_addl 0x00
-#define inta_s4addl 0x02
-#define inta_subl 0x09
-#define inta_s4subl 0x0b
-#define inta_cmpbge 0x0f
-#define inta_s8addl 0x12
-#define inta_s8subl 0x1b
-#define inta_cmpult 0x1d
-#define inta_addq 0x20
-#define inta_s4addq 0x22
-#define inta_subq 0x29
-#define inta_s4subq 0x2b
-#define inta_cmpeq 0x2d
-#define inta_s8addq 0x32
-#define inta_s8subq 0x3b
-#define inta_cmpule 0x3d
-#define inta_addlv 0x40
-#define inta_sublv 0x49
-#define inta_cmplt 0x4d
-#define inta_addqv 0x60
-#define inta_subqv 0x69
-#define inta_cmple 0x6d
-#define op_intl 0x11
-#define intl_and 0x00
-#define intl_andnot 0x08
-#define intl_bic 0x08
-#define intl_cmovlbs 0x14
-#define intl_cmovlbc 0x16
-#define intl_or 0x20
-#define intl_bis 0x20
-#define intl_cmoveq 0x24
-#define intl_cmovne 0x26
-#define intl_ornot 0x28
-#define intl_xor 0x40
-#define intl_cmovlt 0x44
-#define intl_cmovge 0x46
-#define intl_eqv 0x48
-#define intl_amask 0x61
-#define intl_cmovle 0x64
-#define intl_cmovgt 0x66
-#define intl_implver 0x6c
-#define op_ints 0x12
-#define ints_mskbl 0x02
-#define ints_extbl 0x06
-#define ints_insbl 0x0b
-#define ints_mskwl 0x12
-#define ints_extwl 0x16
-#define ints_inswl 0x1b
-#define ints_mskll 0x22
-#define ints_extll 0x26
-#define ints_insll 0x2b
-#define ints_zap 0x30
-#define ints_zapnot 0x31
-#define ints_mskql 0x32
-#define ints_srl 0x34
-#define ints_extql 0x36
-#define ints_sll 0x39
-#define ints_insql 0x3b
-#define ints_sra 0x3c
-#define ints_mskwh 0x52
-#define ints_inswh 0x57
-#define ints_extwh 0x5a
-#define ints_msklh 0x62
-#define ints_inslh 0x67
-#define ints_extlh 0x6a
-#define ints_mskqh 0x72
-#define ints_insqh 0x77
-#define ints_extqh 0x7a
-#define op_intm 0x13
-#define intm_mull 0x00
-#define intm_mulq 0x20
-#define intm_umulh 0x30
-#define intm_mullv 0x40
-#define intm_mulqv 0x60
-#define op_opc14 0x14
-#define op_fltv 0x15
-#define op_flti 0x16
-#define flti_addsc 0x000
-#define flti_subsc 0x001
-#define flti_mulsc 0x002
-#define flti_divsc 0x003
-#define flti_addtc 0x020
-#define flti_subtc 0x021
-#define flti_multc 0x022
-#define flti_divtc 0x023
-#define flti_cvttsc 0x02c
-#define flti_cvttqc 0x02f
-#define flti_cvtqsc 0x03c
-#define flti_cvtqtc 0x03e
-
-#define flti_addsm 0x040
-#define flti_subsm 0x041
-#define flti_mulsm 0x042
-#define flti_divsm 0x043
-#define flti_addtm 0x060
-#define flti_subtm 0x061
-#define flti_multm 0x062
-#define flti_divtm 0x063
-#define flti_cvttsm 0x06c
-#define flti_cvttqm 0x06f
-#define flti_cvtqsm 0x07c
-#define flti_cvtqtm 0x07e
-
-#define flti_adds 0x080
-#define flti_subs 0x081
-#define flti_muls 0x082
-#define flti_divs 0x083
-
-#define flti_addt 0x0a0
-#define flti_subt 0x0a1
-#define flti_mult 0x0a2
-#define flti_divt 0x0a3
-#define flti_cmptun 0x0a4
-#define flti_cmpteq 0x0a5
-#define flti_cmptlt 0x0a6
-#define flti_cmptle 0x0a7
-#define flti_cvtts 0x0ac
-#define flti_cvttq 0x0af
-#define flti_cvtqs 0x0bc
-#define flti_cvtqt 0x0be
-
-#define flti_addsd 0x0c0
-#define flti_subsd 0x0c1
-#define flti_mulsd 0x0c2
-#define flti_divsd 0x0c3
-#define flti_addtd 0x0e0
-#define flti_subtd 0x0e1
-#define flti_multd 0x0e2
-#define flti_divtd 0x0e3
-#define flti_cvttsd 0x0ec
-#define flti_cvttqd 0x0ef
-#define flti_cvtqsd 0x0fc
-#define flti_cvtqtd 0x0fe
-
-#define flti_addsuc 0x100
-#define flti_subsuc 0x101
-#define flti_mulsuc 0x102
-#define flti_divsuc 0x103
-#define flti_addtuc 0x120
-#define flti_subtuc 0x121
-#define flti_multuc 0x122
-#define flti_divtuc 0x123
-#define flti_cvttsuc 0x12c
-#define flti_cvttqvc 0x12f
-
-#define flti_addsum 0x140
-#define flti_subsum 0x141
-#define flti_mulsum 0x142
-#define flti_divsum 0x143
-#define flti_addtum 0x160
-#define flti_subtum 0x161
-#define flti_multum 0x162
-#define flti_divtum 0x163
-#define flti_cvttsum 0x16c
-#define flti_cvttqvm 0x16f
-
-#define flti_addsu 0x180
-#define flti_subsu 0x181
-#define flti_mulsu 0x182
-#define flti_divsu 0x183
-#define flti_addtu 0x1a0
-#define flti_subtu 0x1a1
-#define flti_multu 0x1a2
-#define flti_divtu 0x1a3
-#define flti_cvttsu 0x1ac
-#define flti_cvttqv 0x1af
-
-#define flti_addsud 0x1c0
-#define flti_subsud 0x1c1
-#define flti_mulsud 0x1c2
-#define flti_divsud 0x1c3
-#define flti_addtud 0x1e0
-#define flti_subtud 0x1e1
-#define flti_multud 0x1e2
-#define flti_divtud 0x1e3
-#define flti_cvttsud 0x1ec
-#define flti_cvttqvd 0x1ef
-
-#define flti_cvtst 0x2ac
-
-#define flti_addssuc 0x500
-#define flti_subssuc 0x501
-#define flti_mulssuc 0x502
-#define flti_divssuc 0x503
-#define flti_addtsuc 0x520
-#define flti_subtsuc 0x521
-#define flti_multsuc 0x522
-#define flti_divtsuc 0x523
-#define flti_cvttssuc 0x52c
-#define flti_cvttqsvc 0x52f
-
-#define flti_addssum 0x540
-#define flti_subssum 0x541
-#define flti_mulssum 0x542
-#define flti_divssum 0x543
-#define flti_addtsum 0x560
-#define flti_subtsum 0x561
-#define flti_multsum 0x562
-#define flti_divtsum 0x563
-#define flti_cvttssum 0x56c
-#define flti_cvttqsvm 0x56f
-
-#define flti_addssu 0x580
-#define flti_subssu 0x581
-#define flti_mulssu 0x582
-#define flti_divssu 0x583
-#define flti_addtsu 0x5a0
-#define flti_subtsu 0x5a1
-#define flti_multsu 0x5a2
-#define flti_divtsu 0x5a3
-#define flti_cmptunsu 0x5a4
-#define flti_cmpteqsu 0x5a5
-#define flti_cmptltsu 0x5a6
-#define flti_cmptlesu 0x5a7
-#define flti_cvttssu 0x5ac
-#define flti_cvttqsv 0x5af
-
-#define flti_addssud 0x5c0
-#define flti_subssud 0x5c1
-#define flti_mulssud 0x5c2
-#define flti_divssud 0x5c3
-#define flti_addtsud 0x5e0
-#define flti_subtsud 0x5e1
-#define flti_multsud 0x5e2
-#define flti_divtsud 0x5e3
-#define flti_cvttssud 0x5ec
-#define flti_cvttqsvd 0x5ef
-
-#define flti_cvtsts 0x6ac
-
-#define flti_addssuic 0x700
-#define flti_subssuic 0x701
-#define flti_mulssuic 0x702
-#define flti_divssuic 0x703
-#define flti_addtsuic 0x720
-#define flti_subtsuic 0x721
-#define flti_multsuic 0x722
-#define flti_divtsuic 0x723
-#define flti_cvttssuic 0x72c
-#define flti_cvttqsvic 0x72f
-#define flti_cvtqssuic 0x73c
-#define flti_cvtqtsuic 0x73e
-
-#define flti_addssuim 0x740
-#define flti_subssuim 0x741
-#define flti_mulssuim 0x742
-#define flti_divssuim 0x743
-#define flti_addtsuim 0x760
-#define flti_subtsuim 0x761
-#define flti_multsuim 0x762
-#define flti_divtsuim 0x763
-#define flti_cvttssuim 0x76c
-#define flti_cvttqsvim 0x76f
-#define flti_cvtqssuim 0x77c
-#define flti_cvtqtsuim 0x77e
-
-#define flti_addssui 0x780
-#define flti_subssui 0x781
-#define flti_mulssui 0x782
-#define flti_divssui 0x783
-#define flti_addtsui 0x7a0
-#define flti_subtsui 0x7a1
-#define flti_multsui 0x7a2
-#define flti_divtsui 0x7a3
-#define flti_cmptunsui 0x7a4
-#define flti_cmpteqsui 0x7a5
-#define flti_cmptltsui 0x7a6
-#define flti_cmptlesui 0x7a7
-#define flti_cvttssui 0x7ac
-#define flti_cvttqsvi 0x7af
-#define flti_cvtqssui 0x7bc
-#define flti_cvtqtsui 0x7bc
-
-#define flti_addssuid 0x7c0
-#define flti_subssuid 0x7c1
-#define flti_mulssuid 0x7c2
-#define flti_divssuid 0x7c3
-#define flti_addtsuid 0x7e0
-#define flti_subtsuid 0x7e1
-#define flti_multsuid 0x7e2
-#define flti_divtsuid 0x7e3
-#define flti_cvttssuid 0x7ec
-#define flti_cvttqsvid 0x7ef
-#define flti_cvtqssuid 0x7fc
-#define flti_cvtqtsuid 0x7fc
-
-#define op_fltl 0x17
-#define fltl_cvtlq 0x010
-#define fltl_cpys 0x020
-#define fltl_cpysn 0x021
-#define fltl_cpyse 0x022
-#define fltl_mt_fpcr 0x024
-#define fltl_mf_fpcr 0x025
-#define fltl_fcmoveq 0x02a
-#define fltl_fcmovne 0x02b
-#define fltl_fcmovlt 0x02c
-#define fltl_fcmovge 0x02d
-#define fltl_fcmovle 0x02e
-#define fltl_fcmovgt 0x02f
-#define fltl_cvtql 0x030
-#define fltl_cvtqlv 0x130
-#define fltl_cvtqlsv 0x530
-
-#define op_misc 0x18
-#define misc_trapb 0x0000
-#define misc_excb 0x0400
-#define misc_mb 0x4000
-#define misc_wmb 0x4400
-#define misc_fetch 0x8000
-#define misc_fetch_m 0xa000
-#define misc_rpcc 0xc000
-#define misc_rc 0xe000
-#define misc_ecb 0xe800
-#define misc_rs 0xf000
-#define misc_wh64 0xf800
-
-#define op_pal19 0x19
-#define op_jsr 0x1a
-#define op_pal1b 0x1b
-#define op_pal1c 0x1c
-#define op_pal1d 0x1d
-#define op_pal1e 0x1e
-#define op_pal1f 0x1f
-#define op_ldf 0x20
-#define op_ldg 0x21
-#define op_lds 0x22
-#define op_ldt 0x23
-#define op_stf 0x24
-#define op_stg 0x25
-#define op_sts 0x26
-#define op_stt 0x27
-#define op_ldl 0x28
-#define op_ldq 0x29
-#define op_ldl_l 0x2a
-#define op_ldq_l 0x2b
-#define op_stl 0x2c
-#define op_stq 0x2d
-#define op_stl_c 0x2e
-#define op_stq_c 0x2f
-#define op_br 0x30
-#define op_fbeq 0x31
-#define op_fblt 0x32
-#define op_fble 0x33
-#define op_bsr 0x34
-#define op_fbne 0x35
-#define op_fbge 0x36
-#define op_fbgt 0x37
-#define op_blbc 0x38
-#define op_beq 0x39
-#define op_blt 0x3a
-#define op_ble 0x3b
-#define op_blbs 0x3c
-#define op_bne 0x3d
-#define op_bge 0x3e
-#define op_bgt 0x3f
- } common;
- struct {
- u_int32_t function : 16;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } memory_format;
- struct {
- u_int32_t hint : 14;
- u_int32_t function : 2;
-#define jsr_jmp 0
-#define jsr_jsr 1
-#define jsr_ret 2
-#define jsr_jsr_coroutine 3
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } j_format;
- struct {
- int32_t memory_displacement : 16;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } m_format;
- struct {
- u_int32_t rc : 5;
- u_int32_t function : 7;
- u_int32_t form : 1;
- u_int32_t sbz : 3;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } o_format;
- struct {
- u_int32_t rc : 5;
- u_int32_t function : 7;
- u_int32_t form : 1;
- u_int32_t literal : 8;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } l_format;
- struct {
- u_int32_t fc : 5;
- u_int32_t function : 11;
- u_int32_t fb : 5;
- u_int32_t fa : 5;
- u_int32_t opcode : 6;
- } f_format;
- struct {
- u_int32_t function : 26;
- u_int32_t opcode : 6;
- } pal_format;
- struct {
- int32_t branch_displacement : 21;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } b_format;
-};
-
-#endif /* _MACHINE_INST_H_ */
diff --git a/sys/alpha/include/intr.h b/sys/alpha/include/intr.h
index ea5408920b88..79af6fd9fa6d 100644
--- a/sys/alpha/include/intr.h
+++ b/sys/alpha/include/intr.h
@@ -23,15 +23,24 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: intr.h,v 1.4 1998/11/15 18:25:16 dfr Exp $
+ * $Id: intr.h,v 1.2 1998/07/12 16:09:30 dfr Exp $
*/
#ifndef _MACHINE_INTR_H_
#define _MACHINE_INTR_H_
-int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg,
- void **cookiep, volatile long *cntp);
-int alpha_teardown_intr(void *cookie);
+LIST_HEAD(alpha_intr_list, alpha_intr);
+
+struct alpha_intr {
+ LIST_ENTRY(alpha_intr) list; /* chain handlers in this hash bucket */
+ int vector; /* vector to match */
+ driver_intr_t *intr; /* handler function */
+ void *arg; /* argument to handler */
+};
+
+struct alpha_intr *alpha_create_intr(int vector,
+ driver_intr_t *intr, void *arg);
+int alpha_connect_intr(struct alpha_intr *i);
void alpha_dispatch_intr(void *frame, unsigned long vector);
#endif /* !_MACHINE_INTR_H_ */
diff --git a/sys/alpha/include/intrcnt.h b/sys/alpha/include/intrcnt.h
deleted file mode 100644
index cd9e70173156..000000000000
--- a/sys/alpha/include/intrcnt.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* $Id$ */
-/* $NetBSD: intrcnt.h,v 1.17 1998/11/19 01:48:04 ross Exp $ */
-
-/*
- * Copyright (c) 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#define INTRCNT_CLOCK 0
-#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1)
-#define INTRCNT_ISA_IRQ_LEN 16
-#define INTRCNT_OTHER_BASE (INTRCNT_ISA_IRQ + INTRCNT_ISA_IRQ_LEN)
-#define INTRCNT_OTHER_LEN 48
-#define INTRCNT_COUNT (INTRCNT_OTHER_BASE + INTRCNT_OTHER_LEN)
-
-#define INTRCNT_A12_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_1000A_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_1000_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_2100_A500_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_550_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB164_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB64PLUS_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB66_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_IOASIC INTRCNT_OTHER_BASE
-#define INTRCNT_KN15 INTRCNT_OTHER_BASE
-#define INTRCNT_KN16 INTRCNT_OTHER_BASE
-#define INTRCNT_KN20AA_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_KN300_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_KN8AE_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_TCDS INTRCNT_OTHER_BASE
-
-#define INTRCNT_A12_IRQ_LEN 10
-#define INTRCNT_DEC_1000A_IRQ_LEN 32
-#define INTRCNT_DEC_1000_IRQ_LEN 16
-#define INTRCNT_DEC_2100_A500_IRQ_LEN 16
-#define INTRCNT_DEC_550_IRQ_LEN 48
-#define INTRCNT_EB164_IRQ_LEN 24
-#define INTRCNT_EB64PLUS_IRQ_LEN 32
-#define INTRCNT_EB66_IRQ_LEN 32
-#define INTRCNT_IOASIC_LEN 4
-#define INTRCNT_ISA_IRQ_LEN 16
-#define INTRCNT_KN15_LEN 9
-#define INTRCNT_KN16_LEN 5
-#define INTRCNT_KN20AA_IRQ_LEN 32
-#define INTRCNT_KN300_LEN 19
-#define INTRCNT_KN8AE_IRQ_LEN 2
-#define INTRCNT_TCDS_LEN 2
-
-# define INTRCNT_KN300_NCR810 INTRCNT_KN300_IRQ + 16
-# define INTRCNT_KN300_I2C_CTRL INTRCNT_KN300_IRQ + 17
-# define INTRCNT_KN300_I2C_BUS INTRCNT_KN300_IRQ + 18
-
-#ifdef KERNEL
-#ifndef _LOCORE
-extern volatile long intrcnt[];
-#endif
-#endif
diff --git a/sys/alpha/include/md_var.h b/sys/alpha/include/md_var.h
index c8db0523ed91..b3925f7474c4 100644
--- a/sys/alpha/include/md_var.h
+++ b/sys/alpha/include/md_var.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: md_var.h,v 1.4 1998/09/26 12:22:53 dfr Exp $
+ * $Id: md_var.h,v 1.3 1998/09/14 22:43:24 jdp Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -44,6 +44,7 @@ struct proc;
struct reg;
struct cam_sim;
+void cpu_power_down __P((void));
void cpu_halt __P((void));
void cpu_reset __P((void));
int is_physical_memory __P((vm_offset_t addr));
diff --git a/sys/alpha/include/mouse.h b/sys/alpha/include/mouse.h
index 2abce2cd01c9..3e63ba760f12 100644
--- a/sys/alpha/include/mouse.h
+++ b/sys/alpha/include/mouse.h
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mouse.h,v 1.11 1998/08/06 09:15:52 dfr Exp $
+ * $Id$
* from: i386/include mouse.h,v 1.10
*/
@@ -114,7 +114,6 @@ typedef struct mousehw {
#define MOUSE_MODEL_THINK 5
#define MOUSE_MODEL_EASYSCROLL 6
#define MOUSE_MODEL_MOUSEMANPLUS 7
-#define MOUSE_MODEL_KIDSPAD 8
typedef struct mousemode {
int protocol; /* MOUSE_PROTO_XXX */
@@ -142,7 +141,6 @@ typedef struct mousemode {
#define MOUSE_PROTO_THINK 11 /* Kensignton Thinking Mouse, 3/4 bytes */
#define MOUSE_PROTO_SYSMOUSE 12 /* /dev/sysmouse */
#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */
-#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */
#define MOUSE_RES_UNKNOWN (-1)
#define MOUSE_RES_DEFAULT 0
diff --git a/sys/alpha/include/pcb.h b/sys/alpha/include/pcb.h
index a6d4a18bde20..445617ea71dc 100644
--- a/sys/alpha/include/pcb.h
+++ b/sys/alpha/include/pcb.h
@@ -1,4 +1,4 @@
-/* $Id: pcb.h,v 1.1.1.1 1998/03/09 05:43:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: pcb.h,v 1.6 1997/04/06 08:47:33 cgd Exp */
/*
@@ -50,7 +50,6 @@ struct pcb {
struct alpha_pcb pcb_hw; /* PALcode defined */
unsigned long pcb_context[9]; /* s[0-6], ra, ps [SW] */
struct fpreg pcb_fp; /* FP registers [SW] */
- u_int64_t pcb_fp_control; /* IEEE control word [SW] */
unsigned long pcb_onfault; /* for copy faults [SW] */
unsigned long pcb_accessaddr; /* for [fs]uswintr [SW] */
};
diff --git a/sys/alpha/include/proc.h b/sys/alpha/include/proc.h
index 68add90c7255..6a1af705706e 100644
--- a/sys/alpha/include/proc.h
+++ b/sys/alpha/include/proc.h
@@ -1,4 +1,4 @@
-/* $Id: proc.h,v 1.4 1998/11/15 18:25:16 dfr Exp $ */
+/* $Id: proc.h,v 1.2 1998/06/10 10:55:17 dfr Exp $ */
/* From: NetBSD: proc.h,v 1.3 1997/04/06 08:47:36 cgd Exp */
/*
@@ -38,15 +38,12 @@ struct mdbpt {
};
struct mdproc {
- u_long md_flags;
+ u_long md_flags;
struct trapframe *md_tf; /* trap/syscall registers */
- struct pcb *md_pcbpaddr; /* phys addr of the pcb */
- struct mdbpt md_sstep[2]; /* two single step breakpoints */
- u_int64_t md_hae; /* user HAE register value */
- void *osf_sigtramp; /* user-level signal trampoline */
+ struct pcb *md_pcbpaddr; /* phys addr of the pcb */
+ struct mdbpt md_sstep[2]; /* two single step breakpoints */
};
#define MDP_FPUSED 0x0001 /* Process used the FPU */
#define MDP_STEP1 0x0002 /* Single step normal instruction */
#define MDP_STEP2 0x0004 /* Single step branch instruction */
-#define MDP_HAEUSED 0x0008 /* Process used the HAE */
diff --git a/sys/alpha/include/resource.h b/sys/alpha/include/resource.h
deleted file mode 100644
index 44763783d9ab..000000000000
--- a/sys/alpha/include/resource.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Id$ */
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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 _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
-
-/*
- * Definitions of resource types for Intel Architecture machines
- * with support for legacy ISA devices and drivers.
- */
-
-#define SYS_RES_IRQ 1
-#define SYS_RES_DRQ 2
-#define SYS_RES_MEMORY 3
-#define SYS_RES_IOPORT 4
-
-#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/alpha/include/signal.h b/sys/alpha/include/signal.h
index eb335c063981..32f14c210aa4 100644
--- a/sys/alpha/include/signal.h
+++ b/sys/alpha/include/signal.h
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.1 1998/01/10 10:13:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */
/*
@@ -56,11 +56,7 @@ struct sigcontext {
unsigned long sc_fpcr; /* FP control register (see above) */
unsigned long sc_fp_control; /* FP software control word */
long sc_reserved[2]; /* XXX */
- long sc_xxx1[2]; /* sc_ssize, sc_sbase on DUX */
- unsigned long sc_traparg_a0; /* a0 argument to trap at exception */
- unsigned long sc_traparg_a1; /* a1 argument to trap at exception */
- unsigned long sc_traparg_a2; /* a2 argument to trap at exception */
- long sc_xxx2[3]; /* sc_fp_trap_pc, sc_fp_trigger_sum, sc_fp_trigger_inst */
+ long sc_xxx[8]; /* XXX */
};
#endif /* !_ANSI_SOURCE */
diff --git a/sys/alpha/include/sysarch.h b/sys/alpha/include/sysarch.h
deleted file mode 100644
index e0e0a6b9b617..000000000000
--- a/sys/alpha/include/sysarch.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1993 The Regents of the University of California.
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * $Id: sysarch.h,v 1.1 1998/11/17 10:40:07 dfr Exp $
- */
-
-/*
- * Architecture specific syscalls (alpha)
- */
-#ifndef _MACHINE_SYSARCH_H_
-#define _MACHINE_SYSARCH_H_
-
-#define ALPHA_SETHAE 0
-#define ALPHA_GET_FPMASK 1
-#define ALPHA_SET_FPMASK 2
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-
-union descriptor;
-
-__BEGIN_DECLS
-int alpha_sethae __P((u_int64_t));
-__END_DECLS
-#endif /* !KERNEL */
-
-#endif /* !_MACHINE_SYSARCH_H_ */
diff --git a/sys/alpha/include/types.h b/sys/alpha/include/types.h
index f293bc5268da..1bf185c65193 100644
--- a/sys/alpha/include/types.h
+++ b/sys/alpha/include/types.h
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.8 1998/07/14 05:09:42 bde Exp $ */
+/* $Id: types.h,v 1.7 1998/07/10 02:34:50 bde Exp $ */
/* From: NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp */
/*-
@@ -56,16 +56,34 @@ typedef long vm_ooffset_t;
typedef unsigned long vm_pindex_t;
typedef unsigned long vm_size_t;
+/*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+#define __BIT_TYPES_DEFINED__
+typedef __signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef long int64_t;
+typedef unsigned long u_int64_t;
+
+typedef int64_t register_t;
-typedef __int64_t register_t;
+typedef int32_t ufs_daddr_t;
#ifdef KERNEL
typedef long intfptr_t;
typedef unsigned long uintfptr_t;
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+typedef unsigned long uoff_t;
#endif
/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
+typedef u_int32_t intrmask_t;
/* Interrupt handler function type - arg should be "void *" one day */
typedef void inthand2_t(int _unit);
diff --git a/sys/alpha/include/vmparam.h b/sys/alpha/include/vmparam.h
index 04c62a65a546..fead056e3d0c 100644
--- a/sys/alpha/include/vmparam.h
+++ b/sys/alpha/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $Id: vmparam.h,v 1.3 1998/06/14 13:45:15 dfr Exp $ */
+/* $Id: vmparam.h,v 1.2 1998/06/10 10:55:30 dfr Exp $ */
/* From: NetBSD: vmparam.h,v 1.6 1997/09/23 23:23:23 mjacob Exp */
#ifndef _ALPHA_VMPARAM_H
#define _ALPHA_VMPARAM_H
@@ -54,15 +54,7 @@
* kernel stack.
*/
#define USRTEXT CLBYTES
-/* #define USRSTACK VM_MAXUSER_ADDRESS */
-
-/*
- * This stack location is suitable for OSF1 emulation. Some OSF
- * programs are built as 32bit and assume that the stack is reachable
- * with a 32bit value. OSF1 manages to have a variable location for
- * the user stack which we should probably also support.
- */
-#define USRSTACK (0x12000000LL - (UPAGES*PAGE_SIZE))
+#define USRSTACK VM_MAXUSER_ADDRESS
/*
* Virtual memory related constants, all in bytes
diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c
index 32894e614448..1437a2a87979 100644
--- a/sys/alpha/isa/isa.c
+++ b/sys/alpha/isa/isa.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isa.c,v 1.7 1998/11/18 23:53:11 dfr Exp $
+ * $Id: isa.c,v 1.3 1998/08/10 07:53:59 dfr Exp $
*/
#include <sys/param.h>
@@ -32,37 +32,24 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
-#include <sys/rman.h>
#include <isa/isareg.h>
#include <isa/isavar.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
-#include <machine/resource.h>
-
-MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device");
/*
* The structure used to attach devices to the Isa.
*/
struct isa_device {
- u_short id_port[ISA_NPORT_IVARS];
- u_short id_portsize[ISA_NPORT_IVARS];
- vm_offset_t id_maddr[ISA_NMEM_IVARS];
- vm_size_t id_msize[ISA_NMEM_IVARS];
- int id_irq[ISA_NIRQ_IVARS];
- int id_drq[ISA_NDRQ_IVARS];
+ int id_port;
+ int id_portsize;
int id_flags;
- struct resource *id_portres[ISA_NPORT_IVARS];
- struct resource *id_memres[ISA_NMEM_IVARS];
- struct resource *id_irqres[ISA_NIRQ_IVARS];
- struct resource *id_drqres[ISA_NDRQ_IVARS];
+ int id_irq;
};
#define DEVTOISA(dev) ((struct isa_device*) device_get_ivars(dev))
static devclass_t isa_devclass;
-static struct rman isa_irq_rman;
/*
* Device methods
@@ -72,16 +59,9 @@ static int isa_attach(device_t dev);
static void isa_print_child(device_t dev, device_t child);
static int isa_read_ivar(device_t dev, device_t child, int which, u_long *result);
static int isa_write_ivar(device_t dev, device_t child, int which, u_long result);
-static struct resource *isa_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 isa_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int isa_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int isa_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *isa_create_intr(device_t dev, device_t child, int irq,
+ driver_intr_t *intr, void *arg);
+static int isa_connect_intr(device_t dev, void *ih);
static device_method_t isa_methods[] = {
/* Device interface */
@@ -94,12 +74,8 @@ static device_method_t isa_methods[] = {
DEVMETHOD(bus_print_child, isa_print_child),
DEVMETHOD(bus_read_ivar, isa_read_ivar),
DEVMETHOD(bus_write_ivar, isa_write_ivar),
- DEVMETHOD(bus_alloc_resource, isa_alloc_resource),
- DEVMETHOD(bus_release_resource, isa_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
- DEVMETHOD(bus_setup_intr, isa_setup_intr),
- DEVMETHOD(bus_teardown_intr, isa_teardown_intr),
+ DEVMETHOD(bus_create_intr, isa_create_intr),
+ DEVMETHOD(bus_connect_intr, isa_connect_intr),
{ 0, 0 }
};
@@ -114,69 +90,34 @@ static driver_t isa_driver = {
static void
isa_add_device(device_t dev, const char *name, int unit)
{
- struct isa_device *idev;
- device_t child;
- int sensitive, t;
- static device_t last_sensitive;
-
- if (resource_int_value(name, unit, "sensitive", &sensitive) != 0)
- sensitive = 0;
+ struct isa_device *idev;
+ device_t child;
+ int t;
- idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT);
+ idev = malloc(sizeof(struct isa_device), M_DEVBUF, M_NOWAIT);
if (!idev)
return;
- bzero(idev, sizeof *idev);
if (resource_int_value(name, unit, "port", &t) == 0)
- idev->id_port[0] = t;
+ idev->id_port = t;
else
- idev->id_port[0] = 0;
- idev->id_port[1] = 0;
-
+ idev->id_port = 0;
if (resource_int_value(name, unit, "portsize", &t) == 0)
- idev->id_portsize[0] = t;
- else
- idev->id_portsize[0] = 0;
- idev->id_portsize[1] = 0;
-
- if (resource_int_value(name, unit, "iomem", &t) == 0)
- idev->id_maddr[0] = t;
+ idev->id_portsize = t;
else
- idev->id_maddr[0] = 0;
- idev->id_maddr[1] = 0;
-
- if (resource_int_value(name, unit, "msize", &t) == 0)
- idev->id_msize[0] = t;
- else
- idev->id_msize[0] = 0;
- idev->id_msize[1] = 0;
-
+ idev->id_portsize = 0;
if (resource_int_value(name, unit, "flags", &t) == 0)
idev->id_flags = t;
else
idev->id_flags = 0;
-
if (resource_int_value(name, unit, "irq", &t) == 0)
- idev->id_irq[0] = t;
+ idev->id_irq = t;
else
- idev->id_irq[0] = -1;
- idev->id_irq[1] = -1;
+ idev->id_irq = -1;
- if (resource_int_value(name, unit, "drq", &t) == 0)
- idev->id_drq[0] = t;
- else
- idev->id_drq[0] = -1;
- idev->id_drq[1] = -1;
-
- if (sensitive)
- child = device_add_child_after(dev, last_sensitive, name,
- unit, idev);
- else
- child = device_add_child(dev, name, unit, idev);
- if (child == 0)
+ child = device_add_child(dev, name, unit, idev);
+ if (!child)
return;
- else if (sensitive)
- last_sensitive = child;
if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0)
device_disable(child);
@@ -189,7 +130,7 @@ isa_intr_enable(int irq)
if (irq < 8)
outb(IO_ICU1+1, inb(IO_ICU1+1) & ~(1 << irq));
else
- outb(IO_ICU2+1, inb(IO_ICU2+1) & ~(1 << (irq - 8)));
+ outb(IO_ICU2+1, inb(IO_ICU2+1) & ~(1 << irq));
splx(s);
}
@@ -200,7 +141,7 @@ isa_intr_disable(int irq)
if (irq < 8)
outb(IO_ICU1+1, inb(IO_ICU1+1) | (1 << irq));
else
- outb(IO_ICU2+1, inb(IO_ICU2+1) | (1 << (irq - 8)));
+ outb(IO_ICU2+1, inb(IO_ICU2+1) | (1 << irq));
splx(s);
}
@@ -246,15 +187,6 @@ isa_probe(device_t dev)
resource_query_unit(i));
}
- isa_irq_rman.rm_start = 0;
- isa_irq_rman.rm_end = 15;
- isa_irq_rman.rm_type = RMAN_ARRAY;
- isa_irq_rman.rm_descr = "ISA Interrupt request lines";
- if (rman_init(&isa_irq_rman)
- || rman_manage_region(&isa_irq_rman, 0, 1)
- || rman_manage_region(&isa_irq_rman, 3, 15))
- panic("isa_probe isa_irq_rman");
-
return 0;
}
@@ -283,69 +215,15 @@ isa_attach(device_t dev)
static void
isa_print_child(device_t bus, device_t dev)
{
- struct isa_device *id = DEVTOISA(dev);
-
- if (id->id_port[0] > 0 || id->id_port[1]
- || id->id_maddr[0] > 0 || id->id_maddr[1]
- || id->id_irq[0] >= 0 || id->id_irq[1] >= 0
- || id->id_drq[0] >= 0 || id->id_drq[1] >= 0)
- printf(" at");
- if (id->id_port[0] && id->id_port[1]) {
- printf(" ports %#x", (u_int)id->id_port[0]);
- if (id->id_portsize[0])
- printf("-%#x", (u_int)(id->id_port[0]
- + id->id_portsize[0] - 1));
- printf(" and %#x", (u_int)id->id_port[1]);
- if (id->id_portsize[1])
- printf("-%#x", (u_int)(id->id_port[1]
- + id->id_portsize[1] - 1));
- } else if (id->id_port[0]) {
- printf(" port %#x", (u_int)id->id_port[0]);
- if (id->id_portsize[0])
- printf("-%#x", (u_int)(id->id_port[0]
- + id->id_portsize[0] - 1));
- } else if (id->id_port[1]) {
- printf(" port %#x", (u_int)id->id_port[1]);
- if (id->id_portsize[1])
- printf("-%#x", (u_int)(id->id_port[1]
- + id->id_portsize[1] - 1));
- }
- if (id->id_maddr[0] && id->id_maddr[1]) {
- printf(" iomem %#x", (u_int)id->id_maddr[0]);
- if (id->id_msize[0])
- printf("-%#x", (u_int)(id->id_maddr[0]
- + id->id_msize[0] - 1));
- printf(" and %#x", (u_int)id->id_maddr[1]);
- if (id->id_msize[1])
- printf("-%#x", (u_int)(id->id_maddr[1]
- + id->id_msize[1] - 1));
- } else if (id->id_maddr[0]) {
- printf(" iomem %#x", (u_int)id->id_maddr[0]);
- if (id->id_msize[0])
- printf("-%#x", (u_int)(id->id_maddr[0]
- + id->id_msize[0] - 1));
- } else if (id->id_maddr[1]) {
- printf(" iomem %#x", (u_int)id->id_maddr[1]);
- if (id->id_msize[1])
- printf("-%#x", (u_int)(id->id_maddr[1]
- + id->id_msize[1] - 1));
- }
- if (id->id_irq[0] >= 0 && id->id_irq[1] >= 0)
- printf(" irqs %d and %d", id->id_irq[0], id->id_irq[1]);
- else if (id->id_irq[0] >= 0)
- printf(" irq %d", id->id_irq[0]);
- else if (id->id_irq[1] >= 0)
- printf(" irq %d", id->id_irq[1]);
- if (id->id_drq[0] >= 0 && id->id_drq[1] >= 0)
- printf(" drqs %d and %d", id->id_drq[0], id->id_drq[1]);
- else if (id->id_drq[0] >= 0)
- printf(" drq %d", id->id_drq[0]);
- else if (id->id_drq[1] >= 0)
- printf(" drq %d", id->id_drq[1]);
-
- if (id->id_flags)
- printf(" flags %#x", id->id_flags);
+ struct isa_device* idev = DEVTOISA(dev);
+ printf(" at");
+ if (idev->id_port)
+ printf(" 0x%x", idev->id_port);
+ if (idev->id_portsize > 0)
+ printf("-0x%x", idev->id_port + idev->id_portsize - 1);
+ if (idev->id_irq >= 0)
+ printf(" irq %d", idev->id_irq);
printf(" on %s%d",
device_get_name(bus), device_get_unit(bus));
}
@@ -357,45 +235,18 @@ isa_read_ivar(device_t bus, device_t dev,
struct isa_device* idev = DEVTOISA(dev);
switch (index) {
- case ISA_IVAR_PORT_0:
- *result = idev->id_port[0];
- break;
- case ISA_IVAR_PORT_1:
- *result = idev->id_port[1];
- break;
- case ISA_IVAR_PORTSIZE_0:
- *result = idev->id_portsize[0];
+ case ISA_IVAR_PORT:
+ *result = idev->id_port;
break;
- case ISA_IVAR_PORTSIZE_1:
- *result = idev->id_portsize[1];
- break;
- case ISA_IVAR_MADDR_0:
- *result = idev->id_maddr[0];
- break;
- case ISA_IVAR_MADDR_1:
- *result = idev->id_maddr[1];
- break;
- case ISA_IVAR_MSIZE_0:
- *result = idev->id_msize[0];
- break;
- case ISA_IVAR_MSIZE_1:
- *result = idev->id_msize[1];
- break;
- case ISA_IVAR_IRQ_0:
- *result = idev->id_irq[0];
- break;
- case ISA_IVAR_IRQ_1:
- *result = idev->id_irq[1];
- break;
- case ISA_IVAR_DRQ_0:
- *result = idev->id_drq[0];
- break;
- case ISA_IVAR_DRQ_1:
- *result = idev->id_drq[1];
+ case ISA_IVAR_PORTSIZE:
+ *result = idev->id_portsize;
break;
case ISA_IVAR_FLAGS:
*result = idev->id_flags;
break;
+ case ISA_IVAR_IRQ:
+ *result = idev->id_irq;
+ break;
}
return ENOENT;
}
@@ -407,207 +258,20 @@ isa_write_ivar(device_t bus, device_t dev,
struct isa_device* idev = DEVTOISA(dev);
switch (index) {
- case ISA_IVAR_PORT_0:
- idev->id_port[0] = value;
- break;
- case ISA_IVAR_PORT_1:
- idev->id_port[1] = value;
- break;
- case ISA_IVAR_PORTSIZE_0:
- idev->id_portsize[0] = value;
- break;
- case ISA_IVAR_PORTSIZE_1:
- idev->id_portsize[1] = value;
- break;
- case ISA_IVAR_MADDR_0:
- idev->id_maddr[0] = value;
- break;
- case ISA_IVAR_MADDR_1:
- idev->id_maddr[1] = value;
- break;
- case ISA_IVAR_MSIZE_0:
- idev->id_msize[0] = value;
- break;
- case ISA_IVAR_MSIZE_1:
- idev->id_msize[1] = value;
- break;
- case ISA_IVAR_IRQ_0:
- idev->id_irq[0] = value;
- break;
- case ISA_IVAR_IRQ_1:
- idev->id_irq[1] = value;
+ case ISA_IVAR_PORT:
+ idev->id_port = value;
break;
- case ISA_IVAR_DRQ_0:
- idev->id_drq[0] = value;
- break;
- case ISA_IVAR_DRQ_1:
- idev->id_drq[1] = value;
+ case ISA_IVAR_PORTSIZE:
+ idev->id_portsize = value;
break;
case ISA_IVAR_FLAGS:
idev->id_flags = value;
break;
- default:
- return (ENOENT);
- }
- return (0);
-}
-
-/*
- * This implementation simply passes the request up to the parent
- * bus, which in our case is the pci chipset device, substituting any
- * configured values if the caller defaulted. We can get away with
- * this because there is no special mapping for ISA resources on this
- * platform. When porting this code to another architecture, it may be
- * necessary to interpose a mapping layer here.
- *
- * We manage our own interrupt resources since ISA interrupts go through
- * the ISA PIC, not the PCI interrupt controller.
- */
-static struct resource *
-isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- int isdefault;
- struct resource *rv, **rvp;
- struct isa_device *id;
-
- if (child)
- id = DEVTOISA(child);
- else
- id = NULL;
- isdefault = (start == 0UL && end == ~0UL && *rid == 0);
- if (*rid > 1)
- return 0;
-
- switch (type) {
- case SYS_RES_IRQ:
- /*
- * The hack implementation of intr_create() passes a
- * NULL child device.
- */
- if (isdefault && (id == NULL || id->id_irq[0] >= 0)) {
- start = id->id_irq[0];
- end = id->id_irq[0];
- count = 1;
- }
- rv = rman_reserve_resource(&isa_irq_rman,
- start, end, count,
- 0, child);
- if (!rv)
- return 0;
- if (id) {
- id->id_irqres[*rid] = rv;
- id->id_irq[*rid] = rv->r_start;
- }
- return rv;
-
- case SYS_RES_MEMORY:
- if (isdefault && id->id_maddr[0]) {
- start = id->id_maddr[0];
- count = max(count, (u_long)id->id_msize[0]);
- end = id->id_maddr[0] + count;
- }
- rvp = &id->id_memres[*rid];
- break;
-
- case SYS_RES_IOPORT:
- if (isdefault && id->id_port[0]) {
- start = id->id_port[0];
- count = max(count, (u_long)id->id_portsize[0]);
- end = id->id_port[0] + count;
- }
- rvp = &id->id_portres[*rid];
+ case ISA_IVAR_IRQ:
+ idev->id_irq = value;
break;
-
- default:
- return 0;
}
-
- /*
- * If the client attempts to reallocate a resource without
- * releasing what was there previously, die horribly so that
- * he knows how he !@#$ed up.
- */
- if (*rvp != 0)
- panic("%s%d: (%d, %d) not free for %s%d\n",
- device_get_name(bus), device_get_unit(bus),
- type, *rid,
- device_get_name(child), device_get_unit(child));
-
- /*
- * nexus_alloc_resource had better not change *rid...
- */
- rv = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid,
- start, end, count, flags);
- if ((*rvp = rv) != 0) {
- switch (type) {
- case SYS_RES_MEMORY:
- id->id_maddr[*rid] = rv->r_start;
- id->id_msize[*rid] = count;
- break;
- case SYS_RES_IOPORT:
- id->id_port[*rid] = rv->r_start;
- id->id_portsize[*rid] = count;
- break;
- }
- }
- return rv;
-}
-
-static int
-isa_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- int rv;
- struct resource **rp;
- struct isa_device *id = DEVTOISA(child);
-
- if (rid > 1)
- return EINVAL;
-
- switch (type) {
- case SYS_RES_IRQ:
- return (rman_release_resource(r));
- case SYS_RES_DRQ:
- case SYS_RES_IOPORT:
- case SYS_RES_MEMORY:
- break;
- default:
- return (ENOENT);
- }
-
- rv = BUS_RELEASE_RESOURCE(device_get_parent(bus), child, type, rid, r);
-
- if (rv) {
- switch (type) {
- case SYS_RES_IRQ:
- id->id_irqres[rid] = 0;
- id->id_irq[rid] = -1;
- break;
-
- case SYS_RES_DRQ:
- id->id_drqres[rid] = 0;
- id->id_drq[rid] = -1;
- break;
-
- case SYS_RES_MEMORY:
- id->id_memres[rid] = 0;
- id->id_maddr[rid] = 0;
- id->id_msize[rid] = 0;
- break;
-
- case SYS_RES_IOPORT:
- id->id_portres[rid] = 0;
- id->id_port[rid] = 0;
- id->id_portsize[rid] = 0;
- break;
-
- default:
- return ENOENT;
- }
- }
-
- return rv;
+ return ENOENT;
}
struct isa_intr {
@@ -635,48 +299,37 @@ isa_handle_intr(void *arg)
outb(IO_ICU1, 0x20 | (irq > 7 ? 2 : irq));
}
-static int
-isa_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+isa_create_intr(device_t dev, device_t child, int irq,
+ driver_intr_t *intr, void *arg)
{
struct isa_intr *ii;
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
+ if (irq == 2) irq = 9;
ii = malloc(sizeof(struct isa_intr), M_DEVBUF, M_NOWAIT);
if (!ii)
- return ENOMEM;
+ return NULL;
ii->intr = intr;
ii->arg = arg;
- ii->irq = irq->r_start;
-
- error = alpha_setup_intr(0x800 + (irq->r_start << 4),
- isa_handle_intr, ii, &ii->ih,
- &intrcnt[INTRCNT_ISA_IRQ + irq->r_start]);
- if (error) {
+ ii->irq = irq;
+ ii->ih = alpha_create_intr(0x800 + (irq << 4), isa_handle_intr, ii);
+
+ if (!ii->ih) {
free(ii, M_DEVBUF);
- return error;
+ return NULL;
}
- isa_intr_enable(irq->r_start);
- *cookiep = ii;
- return 0;
+ return ii;
}
static int
-isa_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
+isa_connect_intr(device_t dev, void *ih)
{
- struct isa_intr *ii = cookie;
+ struct isa_intr *ii = ih;
+ struct alpha_intr *i = ii->ih;
- alpha_teardown_intr(ii->ih);
- isa_intr_disable(irq->r_start);
-
- return 0;
+ isa_intr_enable(ii->irq);
+ return alpha_connect_intr(i);
}
DRIVER_MODULE(isa, cia, isa_driver, isa_devclass, 0, 0);
diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c
index 66bedcfcf03d..433410225271 100644
--- a/sys/alpha/pci/apecs.c
+++ b/sys/alpha/pci/apecs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: apecs.c,v 1.4 1998/12/04 22:54:42 archie Exp $
+ * $Id: apecs.c,v 1.1 1998/08/10 07:53:59 dfr Exp $
*/
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -60,16 +60,12 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
#include <machine/cpuconf.h>
#include <machine/swiz.h>
-#include <machine/rpb.h>
#define KV(pa) ALPHA_PHYS_TO_K0SEG(pa)
@@ -107,8 +103,6 @@ static alpha_chipset_cfgwriteb_t apecs_swiz_cfgwriteb;
static alpha_chipset_cfgwritew_t apecs_swiz_cfgwritew;
static alpha_chipset_cfgwritel_t apecs_swiz_cfgwritel;
static alpha_chipset_addrcvt_t apecs_cvt_dense;
-static alpha_chipset_read_hae_t apecs_read_hae;
-static alpha_chipset_write_hae_t apecs_write_hae;
static alpha_chipset_t apecs_swiz_chipset = {
apecs_swiz_inb,
@@ -132,8 +126,6 @@ static alpha_chipset_t apecs_swiz_chipset = {
apecs_swiz_cfgwritel,
apecs_cvt_dense,
NULL,
- apecs_read_hae,
- apecs_write_hae,
};
static int
@@ -427,37 +419,18 @@ apecs_cvt_dense(vm_offset_t addr)
}
-static u_int64_t
-apecs_read_hae(void)
-{
- return apecs_hae_mem & 0xf8000000;
-}
-
-static void
-apecs_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- apecs_swiz_set_hae_mem(&pa);
-}
static int apecs_probe(device_t dev);
static int apecs_attach(device_t dev);
-static int apecs_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int apecs_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *apecs_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int apecs_connect_intr(device_t dev, void* ih);
+
static device_method_t apecs_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, apecs_probe),
DEVMETHOD(device_attach, apecs_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
- DEVMETHOD(bus_setup_intr, apecs_setup_intr),
- DEVMETHOD(bus_teardown_intr, apecs_teardown_intr),
{ 0, 0 }
};
@@ -498,8 +471,6 @@ apecs_probe(device_t dev)
}
apecs_hae_mem = REGVAL(EPIC_HAXR1);
- pci_init_resources();
-
isa0 = device_add_child(dev, "isa", 0, 0);
return 0;
@@ -512,15 +483,7 @@ apecs_attach(device_t dev)
{
struct apecs_softc* sc = APECS_SOFTC(dev);
apecs_init();
-
- /*
- * the avanti routes interrupts through the isa interrupt
- * controller, so we need to special case it
- */
- if(hwrpb->rpb_type == ST_DEC_2100_A50)
- chipset.intrdev = isa0;
- else
- chipset.intrdev = apecs0;
+ chipset.intrdev = isa0;
sc->dmem_base = APECS_PCI_DENSE;
sc->smem_base = APECS_PCI_SPARSE;
@@ -530,46 +493,9 @@ apecs_attach(device_t dev)
set_iointr(alpha_dispatch_intr);
- snprintf(chipset_type, sizeof(chipset_type), "apecs");
- chipset_bwx = 0;
- chipset_ports = APECS_PCI_SIO;
- chipset_memory = APECS_PCI_SPARSE;
- chipset_dense = APECS_PCI_DENSE;
- chipset_hae_mask = EPIC_HAXR1_EADDR;
-
bus_generic_attach(dev);
return 0;
}
-static int
-apecs_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
-{
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
-
- error = alpha_setup_intr(0x900 + (irq->r_start << 4),
- intr, arg, cookiep,
- &intrcnt[INTRCNT_EB64PLUS_IRQ + irq->r_start]);
- if (error)
- return error;
-
- /* Enable PCI interrupt */
- platform.pci_intr_enable(irq->r_start);
- return 0;
-}
-
-static int
-apecs_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
-{
- alpha_teardown_intr(cookie);
- return rman_deactivate_resource(irq);
-}
-
DRIVER_MODULE(apecs, root, apecs_driver, apecs_devclass, 0, 0);
diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c
index c68ef57720ff..065c42065954 100644
--- a/sys/alpha/pci/cia.c
+++ b/sys/alpha/pci/cia.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cia.c,v 1.13 1998/12/02 09:33:27 dfr Exp $
+ * $Id: cia.c,v 1.9 1998/09/16 08:24:30 dfr Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -96,18 +96,14 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#include <alpha/pci/ciareg.h>
#include <alpha/pci/ciavar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/bwx.h>
#include <machine/swiz.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
#include <machine/cpuconf.h>
#include <machine/rpb.h>
-#include <machine/resource.h>
#define KV(pa) ALPHA_PHYS_TO_K0SEG(pa)
@@ -142,8 +138,6 @@ static alpha_chipset_cfgwriteb_t cia_bwx_cfgwriteb, cia_swiz_cfgwriteb;
static alpha_chipset_cfgwritew_t cia_bwx_cfgwritew, cia_swiz_cfgwritew;
static alpha_chipset_cfgwritel_t cia_bwx_cfgwritel, cia_swiz_cfgwritel;
static alpha_chipset_addrcvt_t cia_cvt_dense, cia_cvt_bwx;
-static alpha_chipset_read_hae_t cia_read_hae;
-static alpha_chipset_write_hae_t cia_write_hae;
static alpha_chipset_t cia_bwx_chipset = {
cia_bwx_inb,
@@ -167,8 +161,6 @@ static alpha_chipset_t cia_bwx_chipset = {
cia_bwx_cfgwritel,
cia_cvt_dense,
cia_cvt_bwx,
- cia_read_hae,
- cia_write_hae,
};
static alpha_chipset_t cia_swiz_chipset = {
cia_swiz_inb,
@@ -192,8 +184,6 @@ static alpha_chipset_t cia_swiz_chipset = {
cia_swiz_cfgwritel,
cia_cvt_dense,
NULL,
- cia_read_hae,
- cia_write_hae,
};
static u_int8_t
@@ -449,30 +439,28 @@ cia_swiz_outl(u_int32_t port, u_int32_t data)
}
static __inline void
-cia_swiz_set_hae_mem(u_int32_t *pa)
+cia_swiz_set_hae_mem(u_int32_t pa)
{
- /* Only bother with region 1 */
+ /* Only bother with region 1 */
#define REG1 (7 << 29)
- if ((cia_hae_mem & REG1) != (*pa & REG1)) {
- /*
- * Seems fairly paranoid but this is what Linux does...
- */
- u_int32_t msb = *pa & REG1;
- int s = splhigh();
- cia_hae_mem = (cia_hae_mem & ~REG1) | msb;
- REGVAL(CIA_CSR_HAE_MEM) = cia_hae_mem;
- alpha_mb();
- cia_hae_mem = REGVAL(CIA_CSR_HAE_MEM);
- splx(s);
- *pa -= msb;
- }
+ if ((cia_hae_mem & REG1) != (pa & REG1)) {
+ /*
+ * Seems fairly paranoid but this is what Linux does...
+ */
+ int s = splhigh();
+ cia_hae_mem = (cia_hae_mem & ~REG1) | (pa & REG1);
+ REGVAL(CIA_CSR_HAE_MEM) = cia_hae_mem;
+ alpha_mb();
+ cia_hae_mem = REGVAL(CIA_CSR_HAE_MEM);
+ splx(s);
+ }
}
static u_int8_t
cia_swiz_readb(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_BYTE(KV(CIA_PCI_SMEM1), pa);
}
@@ -480,7 +468,7 @@ static u_int16_t
cia_swiz_readw(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_WORD(KV(CIA_PCI_SMEM1), pa);
}
@@ -488,14 +476,14 @@ static u_int32_t
cia_swiz_readl(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_LONG(KV(CIA_PCI_SMEM1), pa);
}
static void
cia_swiz_writeb(u_int32_t pa, u_int8_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_BYTE(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -503,7 +491,7 @@ cia_swiz_writeb(u_int32_t pa, u_int8_t data)
static void
cia_swiz_writew(u_int32_t pa, u_int16_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_WORD(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -511,7 +499,7 @@ cia_swiz_writew(u_int32_t pa, u_int16_t data)
static void
cia_swiz_writel(u_int32_t pa, u_int32_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_LONG(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -628,35 +616,12 @@ cia_cvt_bwx(vm_offset_t addr)
return (addr |= CIA_EV56_BWMEM);
}
-static u_int64_t
-cia_read_hae(void)
-{
- return cia_hae_mem & REG1;
-}
-static void
-cia_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- cia_swiz_set_hae_mem(&pa);
-}
static int cia_probe(device_t dev);
static int cia_attach(device_t dev);
-static struct resource *cia_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 cia_activate_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_deactivate_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int cia_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *cia_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int cia_connect_intr(device_t dev, void* ih);
static device_method_t cia_methods[] = {
/* Device interface */
@@ -664,12 +629,8 @@ static device_method_t cia_methods[] = {
DEVMETHOD(device_attach, cia_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
- DEVMETHOD(bus_setup_intr, cia_setup_intr),
- DEVMETHOD(bus_teardown_intr, cia_teardown_intr),
+ DEVMETHOD(bus_create_intr, cia_create_intr),
+ DEVMETHOD(bus_connect_intr, cia_connect_intr),
{ 0, 0 }
};
@@ -721,7 +682,6 @@ cia_init()
#if 0
chipset = cia_swiz_chipset; /* XXX */
- cia_ispyxis = 0;
#endif
if (platform.pci_intr_init)
@@ -736,8 +696,6 @@ cia_probe(device_t dev)
cia0 = dev;
device_set_desc(dev, "2117x PCI adapter"); /* XXX */
- pci_init_resources();
-
device_add_child(dev, "isa", 0, 0);
return 0;
@@ -803,54 +761,29 @@ cia_attach(device_t dev)
if (!platform.iointr) /* XXX */
set_iointr(alpha_dispatch_intr);
- if (cia_ispyxis) {
- snprintf(chipset_type, sizeof(chipset_type), "pyxis");
- chipset_bwx = 1;
- chipset_ports = CIA_EV56_BWIO;
- chipset_memory = CIA_EV56_BWMEM;
- chipset_dense = CIA_PCI_DENSE;
- } else {
- snprintf(chipset_type, sizeof(chipset_type), "cia");
- chipset_bwx = 0;
- chipset_ports = CIA_PCI_SIO1;
- chipset_memory = CIA_PCI_SMEM1;
- chipset_dense = CIA_PCI_DENSE;
- chipset_hae_mask = 7L << 29;
- }
-
bus_generic_attach(dev);
return 0;
}
-static int
-cia_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+cia_create_intr(device_t dev, device_t child,
+ int irq, driver_intr_t *intr, void *arg)
{
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
-
- error = alpha_setup_intr(0x900 + (irq->r_start << 4),
- intr, arg, cookiep,
- &intrcnt[INTRCNT_EB164_IRQ + irq->r_start]);
- if (error)
- return error;
-
- /* Enable PCI interrupt */
- platform.pci_intr_enable(irq->r_start);
-
- return 0;
+ return alpha_create_intr(0x900 + (irq << 4), intr, arg);
}
static int
-cia_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
-{
- alpha_teardown_intr(cookie);
- return rman_deactivate_resource(irq);
+cia_connect_intr(device_t dev, void* ih)
+{
+ struct alpha_intr *i = ih;
+ int s = splhigh();
+ int error = alpha_connect_intr(i);
+ if (!error) {
+ /* Enable PCI interrupt */
+ platform.pci_intr_enable((i->vector - 0x900) >> 4);
+ }
+ splx(s);
+ return error;
}
DRIVER_MODULE(cia, root, cia_driver, cia_devclass, 0, 0);
diff --git a/sys/alpha/pci/lca.c b/sys/alpha/pci/lca.c
index f3b194da6332..58f873f3ff74 100644
--- a/sys/alpha/pci/lca.c
+++ b/sys/alpha/pci/lca.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: lca.c,v 1.4 1998/11/15 18:25:16 dfr Exp $
+ * $Id: lca.c,v 1.2 1998/09/23 21:23:51 msmith Exp $
*/
#include <sys/param.h>
@@ -34,7 +34,6 @@
#include <alpha/pci/lcareg.h>
#include <alpha/pci/lcavar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/swiz.h>
#include <machine/intr.h>
#include <machine/cpuconf.h>
@@ -71,8 +70,6 @@ static alpha_chipset_cfgwriteb_t lca_cfgwriteb;
static alpha_chipset_cfgwritew_t lca_cfgwritew;
static alpha_chipset_cfgwritel_t lca_cfgwritel;
static alpha_chipset_addrcvt_t lca_cvt_dense;
-static alpha_chipset_read_hae_t lca_read_hae;
-static alpha_chipset_write_hae_t lca_write_hae;
static alpha_chipset_t lca_chipset = {
lca_inb,
@@ -95,9 +92,6 @@ static alpha_chipset_t lca_chipset = {
lca_cfgwritew,
lca_cfgwritel,
lca_cvt_dense,
- NULL,
- lca_read_hae,
- lca_write_hae,
};
static u_int8_t
@@ -318,18 +312,6 @@ lca_cvt_dense(vm_offset_t addr)
}
-static u_int64_t
-lca_read_hae(void)
-{
- return lca_hae_mem & 0xf8000000;
-}
-
-static void
-lca_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- lca_set_hae_mem(&pa);
-}
static int lca_probe(device_t dev);
static int lca_attach(device_t dev);
@@ -342,10 +324,6 @@ static device_method_t lca_methods[] = {
DEVMETHOD(device_attach, lca_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
{ 0, 0 }
};
@@ -397,13 +375,6 @@ lca_attach(device_t dev)
set_iointr(alpha_dispatch_intr);
- snprintf(chipset_type, sizeof(chipset_type), "lca");
- chipset_bwx = 0;
- chipset_ports = LCA_PCI_SIO;
- chipset_memory = LCA_PCI_SPARSE;
- chipset_dense = LCA_PCI_DENSE;
- chipset_hae_mask = IOC_HAE_ADDREXT;
-
bus_generic_attach(dev);
return 0;
}
diff --git a/sys/alpha/pci/pci_eb64plus_intr.s b/sys/alpha/pci/pci_eb64plus_intr.s
deleted file mode 100644
index 472d741631aa..000000000000
--- a/sys/alpha/pci/pci_eb64plus_intr.s
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $NetBSD: pci_eb64plus_intr.s,v 1.2 1997/09/02 13:19:43 thorpej Exp $ */
-
-/*
- * Copyright (c) 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-/*
- * This file hacked from pci_eb164_intr.s
- *
- * These functions were written by disassembling a Digital UNIX kernel's
- * eb64p_intrdsabl and eb64p_intrenabl functions (because they had
- * interesting names, and looked like the eb164 versions which were
- * known to already work), and then playing with them to see how to call
- * them correctly.
- *
- * It looks like the right thing to do is to call them with the interrupt
- * request that you want to enable or disable (presumably in the range
- * 0 -> 23, since there are 3 8-bit interrupt-enable bits in the
- * interrupt mask PLD).
- */
-
-#include <machine/asm.h>
-
-__KERNEL_RCSID(0, "$NetBSD: pci_eb64plus_intr.s,v 1.2 1997/09/02 13:19:43 thorpej Exp $");
-
- .text
-LEAF(eb64plus_intr_enable,1)
- mov a0, a1
- ldiq a0, 0x34
- call_pal PAL_cserve
- RET
- END(eb64plus_intr_enable)
-
- .text
-LEAF(eb64plus_intr_disable,1)
- mov a0, a1
- ldiq a0, 0x35
- call_pal PAL_cserve
- RET
- END(eb64plus_intr_enable)
diff --git a/sys/alpha/pci/pcibus.c b/sys/alpha/pci/pcibus.c
index 697373cec37d..0cafff2d7738 100644
--- a/sys/alpha/pci/pcibus.c
+++ b/sys/alpha/pci/pcibus.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcibus.c,v 1.7 1998/11/18 23:53:12 dfr Exp $
+ * $Id: pcibus.c,v 1.4 1998/08/10 07:53:59 dfr Exp $
*
*/
@@ -33,34 +33,13 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
-#include <sys/sysctl.h>
-#include <sys/rman.h>
#include <pci/pcivar.h>
#include <machine/chipset.h>
#include <machine/cpuconf.h>
-#include <machine/resource.h>
-char chipset_type[10];
-int chipset_bwx = 0;
-long chipset_ports = 0;
-long chipset_memory = 0;
-long chipset_dense = 0;
-long chipset_hae_mask = 0;
-
-SYSCTL_NODE(_hw, OID_AUTO, chipset, CTLFLAG_RW, 0, "PCI chipset information");
-SYSCTL_STRING(_hw_chipset, OID_AUTO, type, CTLFLAG_RD, chipset_type, 0,
- "PCI chipset type");
-SYSCTL_INT(_hw_chipset, OID_AUTO, bwx, CTLFLAG_RD, &chipset_bwx, 0,
- "PCI chipset supports BWX access");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, ports, CTLFLAG_RD, &chipset_ports,
- "PCI chipset port address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, memory, CTLFLAG_RD, &chipset_memory,
- "PCI chipset memory address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, dense, CTLFLAG_RD, &chipset_dense,
- "PCI chipset dense memory address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, hae_mask, CTLFLAG_RD, &chipset_hae_mask,
- "PCI chipset mask for HAE register");
+static int cfgmech;
+static int devmax;
#ifdef notyet
@@ -137,27 +116,22 @@ struct intrec *
intr_create(void *dev_instance, int irq, inthand2_t handler, void *arg,
intrmask_t *maskptr, int flags)
{
- struct resource *res;
device_t pcib = chipset.intrdev;
- int zero = 0;
- void *cookie;
-
- res = BUS_ALLOC_RESOURCE(pcib, NULL, SYS_RES_IRQ, &zero,
- irq, irq, 1, RF_SHAREABLE | RF_ACTIVE);
- if (BUS_SETUP_INTR(pcib, pcib, res, (driver_intr_t *)handler, arg, &cookie))
+ if (pcib)
+ return BUS_CREATE_INTR(pcib, pcib, irq,
+ (driver_intr_t*) handler, arg);
+ else
return 0;
-
- return (struct intrec *)cookie;
}
int
intr_connect(struct intrec *idesc)
{
- /*
- * intr_create has already connected it (doesn't matter for the
- * only consumer of this interface (pci).
- */
- return 0;
+ device_t pcib = chipset.intrdev;
+ if (pcib)
+ return BUS_CONNECT_INTR(pcib, idesc);
+ else
+ return EINVAL;
}
void
@@ -167,86 +141,6 @@ alpha_platform_assign_pciintr(pcicfgregs *cfg)
platform.pci_intr_map((void *)cfg);
}
-static struct rman irq_rman, port_rman, mem_rman;
-
-void pci_init_resources()
-{
- irq_rman.rm_start = 0;
- irq_rman.rm_end = 32;
- irq_rman.rm_type = RMAN_ARRAY;
- irq_rman.rm_descr = "PCI Interrupt request lines";
- if (rman_init(&irq_rman)
- || rman_manage_region(&irq_rman, 0, 31))
- panic("cia_probe irq_rman");
-
- port_rman.rm_start = 0;
- port_rman.rm_end = 0xffff;
- port_rman.rm_type = RMAN_ARRAY;
- port_rman.rm_descr = "I/O ports";
- if (rman_init(&port_rman)
- || rman_manage_region(&port_rman, 0, 0xffff))
- panic("cia_probe port_rman");
-
- mem_rman.rm_start = 0;
- mem_rman.rm_end = ~0u;
- mem_rman.rm_type = RMAN_ARRAY;
- mem_rman.rm_descr = "I/O memory addresses";
- if (rman_init(&mem_rman)
- || rman_manage_region(&mem_rman, 0x0, (1L << 32)))
- panic("cia_probe mem_rman");
-}
-
-/*
- * Allocate a resource on behalf of child. NB: child is usually going to be a
- * child of one of our descendants, not a direct child of the pci chipset.
- */
-struct resource *
-pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- struct rman *rm;
-
- switch (type) {
- case SYS_RES_IRQ:
- rm = &irq_rman;
- break;
-
- case SYS_RES_IOPORT:
- rm = &port_rman;
- break;
-
- case SYS_RES_MEMORY:
- rm = &mem_rman;
- break;
-
- default:
- return 0;
- }
-
- return rman_reserve_resource(rm, start, end, count, flags, child);
-}
-
-int
-pci_activate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_activate_resource(r));
-}
-
-int
-pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_deactivate_resource(r));
-}
-
-int
-pci_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_release_resource(r));
-}
-
void
memcpy_fromio(void *d, u_int32_t s, size_t size)
{
diff --git a/sys/alpha/pci/pcibus.h b/sys/alpha/pci/pcibus.h
index 38b51b772e9c..eb56cec1e2d8 100644
--- a/sys/alpha/pci/pcibus.h
+++ b/sys/alpha/pci/pcibus.h
@@ -23,17 +23,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcibus.h,v 1.1 1998/06/10 10:55:38 dfr Exp $
+ * $Id$
*/
-void pci_init_resources(void);
-struct resource *pci_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end, u_long count,
- u_int flags);
-int pci_activate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
-int pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
-int pci_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
+typedef int alpha_pci_maxdevs_t(pcicfgregs*);
+typedef int alpha_pci_cfgread_t(pcicfgregs*, int, int);
+typedef void alpha_pci_cfgwrite_t(pcicfgregs*, int, int, int);
+
+struct alpha_pci_ops {
+ alpha_pci_maxdevs_t* maxdevs;
+ alpha_pci_cfgread_t* cfgread;
+ alpha_pci_cfgwrite_t* cfgwrite;
+};
+
+struct alpha_pci_softc {
+ struct alpha_pci_ops* ops;
+};
diff --git a/sys/alpha/tc/am7990.c b/sys/alpha/tc/am7990.c
index d734c155c322..6c65f8248d46 100644
--- a/sys/alpha/tc/am7990.c
+++ b/sys/alpha/tc/am7990.c
@@ -1,4 +1,4 @@
-/* $Id: am7990.c,v 1.1 1998/08/20 08:27:10 dfr Exp $ */
+/* $Id$ */
/* $NetBSD: am7990.c,v 1.43 1998/03/29 22:36:42 mycroft Exp $ */
/*-
@@ -194,8 +194,7 @@ am7990_config(sc)
/* Make sure the chip is stopped. */
am7990_stop(sc);
/* Initialize ifnet structure. */
- snprintf(sc->sc_dev.dv_xname,
- sizeof(sc->sc_dev.dv_xname), "le%d", sc->unit);
+ sprintf(sc->sc_dev.dv_xname, "le%d", sc->unit);
ifp->if_unit = sc->unit;
ifp->if_name = "le";
ifp->if_softc = sc;
diff --git a/sys/alpha/tc/espvar.h b/sys/alpha/tc/espvar.h
index b64b77402685..ad5d139ff658 100644
--- a/sys/alpha/tc/espvar.h
+++ b/sys/alpha/tc/espvar.h
@@ -1,4 +1,4 @@
-/* $Id: espvar.h,v 1.1 1998/08/20 08:27:10 dfr Exp $ */
+/* $Id$ */
/* $NetBSD: espvar.h,v 1.3.4.1 1996/09/10 17:28:18 cgd Exp $ */
/*
@@ -74,7 +74,8 @@ struct ecb {
#define ECB_TRACE(ecb, msg, a, b) do { \
const char *f = "[" msg "]"; \
int n = strlen((ecb)->trace); \
- snprintf((ecb)->trace + n, sizeof((ecb)->trace) - n, f, a, b); \
+ if (n < (sizeof((ecb)->trace)-100)) \
+ sprintf((ecb)->trace + n, f, a, b); \
} while(0)
#else
#define ECB_TRACE(ecb, msg, a, b)
diff --git a/sys/alpha/tlsb/dwlpx.c b/sys/alpha/tlsb/dwlpx.c
index bb80abf25576..7db56ce21960 100644
--- a/sys/alpha/tlsb/dwlpx.c
+++ b/sys/alpha/tlsb/dwlpx.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: dwlpx.c,v 1.6 1998/09/04 08:01:26 dfr Exp $
+ * $Id: dwlpx.c,v 1.5 1998/08/10 07:53:59 dfr Exp $
*/
#include "opt_simos.h"
@@ -288,8 +288,6 @@ dwlpx_attach(device_t dev)
struct dwlpx_softc* sc = DWLPX_SOFTC(dev);
device_t parent = device_get_parent(dev);
vm_offset_t regs;
- void *intr;
-
dwlpx0 = dev;
chipset = dwlpx_chipset;
@@ -303,7 +301,9 @@ dwlpx_attach(device_t dev)
*(u_int32_t*) (regs + PCIA_CTL(0)) = 1; /* Type1 config cycles */
- return BUS_SETUP_INTR(parent, dev, NULL, dwlpx_intr, 0, &intr);
+ BUS_CONNECT_INTR(parent,
+ BUS_CREATE_INTR(parent, dev,
+ 0, dwlpx_intr, 0));
return 0;
}
diff --git a/sys/alpha/tlsb/gbus.c b/sys/alpha/tlsb/gbus.c
index f98a3bd4f24f..9894889cc1d0 100644
--- a/sys/alpha/tlsb/gbus.c
+++ b/sys/alpha/tlsb/gbus.c
@@ -92,8 +92,8 @@ static device_method_t gbus_methods[] = {
DEVMETHOD(bus_print_child, gbus_print_child),
DEVMETHOD(bus_read_ivar, gbus_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -134,7 +134,7 @@ gbus_print_child(device_t bus, device_t dev)
{
struct gbus_device* gdev = DEVTOGBUS(dev);
- printf(" at %s%d offset 0x%x",
+ printf(" at %s%d offset 0x%lx",
device_get_name(bus), device_get_unit(bus),
gdev->gd_offset);
}
diff --git a/sys/alpha/tlsb/kftxx.c b/sys/alpha/tlsb/kftxx.c
index d85b202a4a1e..6f9f89a903ce 100644
--- a/sys/alpha/tlsb/kftxx.c
+++ b/sys/alpha/tlsb/kftxx.c
@@ -1,4 +1,4 @@
-/* $Id: kftxx.c,v 1.3 1998/07/12 16:23:17 dfr Exp $ */
+/* $Id: kftxx.c,v 1.2 1998/06/14 13:45:24 dfr Exp $ */
/* $NetBSD: kftxx.c,v 1.9 1998/05/14 00:01:32 thorpej Exp $ */
/*
@@ -89,8 +89,8 @@ static device_method_t kft_methods[] = {
DEVMETHOD(bus_print_child, kft_print_child),
DEVMETHOD(bus_read_ivar, kft_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
diff --git a/sys/alpha/tlsb/tlsb.c b/sys/alpha/tlsb/tlsb.c
index 00aff9adf87a..6e618a3a11e1 100644
--- a/sys/alpha/tlsb/tlsb.c
+++ b/sys/alpha/tlsb/tlsb.c
@@ -95,11 +95,8 @@ static devclass_t tlsb_devclass;
static int tlsb_probe(device_t dev);
static void tlsb_print_child(device_t dev, device_t child);
static int tlsb_read_ivar(device_t dev, device_t child, int which, u_long* result);
-static int tlsb_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int tlsb_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *tlsb_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int tlsb_connect_intr(device_t dev, void* ih);
static device_method_t tlsb_methods[] = {
/* Device interface */
@@ -112,8 +109,8 @@ static device_method_t tlsb_methods[] = {
DEVMETHOD(bus_print_child, tlsb_print_child),
DEVMETHOD(bus_read_ivar, tlsb_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, tlsb_setup_intr),
- DEVMETHOD(bus_teardown_intr, tlsb_teardown_intr),
+ DEVMETHOD(bus_create_intr, tlsb_create_intr),
+ DEVMETHOD(bus_connect_intr, tlsb_connect_intr),
{ 0, 0 }
};
@@ -268,32 +265,27 @@ tlsb_read_ivar(device_t dev, device_t child,
return ENOENT;
}
-static int
-tlsb_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+tlsb_create_intr(device_t dev, device_t child,
+ int irq, driver_intr_t *intr, void *arg)
{
struct tlsb_softc* sc = device_get_softc(dev);
struct intr_mapping* i;
i = malloc(sizeof(struct intr_mapping), M_DEVBUF, M_NOWAIT);
if (!i)
- return ENOMEM;
+ return NULL;
i->intr = intr;
i->arg = arg;
- STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
- *cookiep = i;
- return 0;
+ return i;
}
static int
-tlsb_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
+tlsb_connect_intr(device_t dev, void *ih)
{
struct tlsb_softc* sc = device_get_softc(dev);
- struct intr_mapping* i = cookie;
+ struct intr_mapping* i = ih;
- STAILQ_REMOVE(&sc->intr_handlers, i, intr_mapping, queue);
- free(i, M_DEVBUF);
+ STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
return 0;
}
@@ -343,8 +335,7 @@ tlsb_node_type_str(u_int32_t dtype)
default:
bzero(tlsb_line, sizeof(tlsb_line));
- snprintf(tlsb_line, sizeof(tlsb_line),
- "unknown, dtype 0x%x", dtype);
+ sprintf(tlsb_line, "unknown, dtype 0x%x", dtype);
return (tlsb_line);
}
/* NOTREACHED */
diff --git a/sys/alpha/tlsb/zs_tlsb.c b/sys/alpha/tlsb/zs_tlsb.c
index e88b8b104cc8..f5e7032b176d 100644
--- a/sys/alpha/tlsb/zs_tlsb.c
+++ b/sys/alpha/tlsb/zs_tlsb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: zs_tlsb.c,v 1.5 1998/07/31 09:20:01 dfr Exp $
+ * $Id: zs_tlsb.c,v 1.4 1998/07/12 16:23:19 dfr Exp $
*/
/*
* This driver is a hopeless hack to get the SimOS console working. A real
@@ -385,7 +385,6 @@ struct zsc_softc {
caddr_t base;
struct zs_softc* sc_a;
struct zs_softc* sc_b;
- void *intr;
};
static int zsc_tlsb_probe(device_t dev);
@@ -405,8 +404,8 @@ static device_method_t zsc_tlsb_methods[] = {
DEVMETHOD(bus_print_child, zsc_tlsb_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -456,7 +455,6 @@ zsc_tlsb_attach(device_t dev)
{
struct zsc_softc* sc = device_get_softc(dev);
device_t parent = device_get_parent(dev);
- void *ih;
bus_generic_attach(dev);
@@ -464,9 +462,9 @@ zsc_tlsb_attach(device_t dev)
sc->sc_a = ZS_SOFTC(0);
sc->sc_b = ZS_SOFTC(1);
- /* XXX should use resource argument to communicate vector */
- return BUS_SETUP_INTR(parent, dev, NULL, zsc_tlsb_intr, sc,
- &sc->intr);
+ BUS_CONNECT_INTR(parent,
+ BUS_CREATE_INTR(parent, dev,
+ 1, zsc_tlsb_intr, sc));
return 0;
}
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index cd271859639f..1de594169211 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -1,7 +1,4 @@
-# Build the add-in FORTH interpreter
-SUBDIR+= ficl
-
-# Pick the machine-dependant subdir based on the target architecture.
-SUBDIR+= ${MACHINE_ARCH}
+# Pick the subdir based on the target architecture.
+SUBDIR= ${MACHINE_ARCH}
.include <bsd.subdir.mk>
diff --git a/sys/boot/alpha/Makefile.inc b/sys/boot/alpha/Makefile.inc
index abb4f65cbc89..bbbea75f1efe 100644
--- a/sys/boot/alpha/Makefile.inc
+++ b/sys/boot/alpha/Makefile.inc
@@ -1,8 +1,10 @@
# Options used when building app-specific libalpha components
-PRIMARY_LOAD_ADDRESS= 0x20000000 # "Region 1 start"
-SECONDARY_LOAD_ADDRESS= 0x2000c000 # "Region 1 start" + 48k
-HEAP_LIMIT= 0x20040000 # "Region 1 start" + 256k
+PRIMARY_LOAD_ADDRESS= 20000000 # "Region 1 start"
+SECONDARY_LOAD_ADDRESS= 2000c000 # "Region 1 start" + 48k
+HEAP_LIMIT= 20040000 # "Region 1 start" + 256k
DPADD+= ${DESTDIR}/${LIBDIR}/libstand.a
LIBSTANDDIR= ${.CURDIR}/../../../../lib/libstand
LIBSTAND= -lstand
LIBALPHA= ${.OBJDIR}/../libalpha/libalpha.a
+
+BINDIR= /usr/mdec
diff --git a/sys/boot/alpha/boot1/Makefile b/sys/boot/alpha/boot1/Makefile
index bfbcb7a88114..e163c03345a4 100644
--- a/sys/boot/alpha/boot1/Makefile
+++ b/sys/boot/alpha/boot1/Makefile
@@ -12,10 +12,9 @@ CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
-CFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} -DMINIMAL
+CFLAGS+= -DSECONDARY_LOAD_ADDRESS=0x${SECONDARY_LOAD_ADDRESS} -DMINIMAL
NOMAN=1
STRIP=
-BINDIR?= /boot
BOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
@@ -23,6 +22,10 @@ CLEANFILES+= ${PROG}.sym ${PROG}.nosym ${PROG}.list
all: ${PROG}
+afterinstall:
+ ln -sf boot1 /usr/mdec/daboot
+ ln -sf boot1 /usr/mdec/fdboot
+
${PROG}.nosym: ${PROG}.sym
cp ${PROG}.sym ${PROG}.nosym
strip ${PROG}.nosym
@@ -33,9 +36,10 @@ ${PROG}: ${PROG}.nosym
.include <bsd.prog.mk>
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
${PROG}.sym: ${OBJS} ${LIBKERN}
${LD} -M -Ttext ${BOOT_RELOC} -N -e start -o ${PROG}.sym ${OBJS} \
${LIBSTAND} ${LIBALPHA} ${LIBSTAND} > ${.OBJDIR}/${PROG}.list
size ${PROG}.sym
+
diff --git a/sys/boot/alpha/boot1/boot1.c b/sys/boot/alpha/boot1/boot1.c
index 9eac7ec64c71..a3fbfc2bf397 100644
--- a/sys/boot/alpha/boot1/boot1.c
+++ b/sys/boot/alpha/boot1/boot1.c
@@ -1,5 +1,5 @@
/*
- * $Id: boot1.c,v 1.2 1998/09/26 10:51:36 dfr Exp $
+ * $Id: boot1.c,v 1.1.1.1 1998/08/21 03:17:41 msmith Exp $
* From $NetBSD: bootxx.c,v 1.4 1997/09/06 14:08:29 drochner Exp $
*/
@@ -181,7 +181,7 @@ main()
init_prom_calls();
- loadfile("/boot/loader", loadaddr);
+ loadfile("/boot/boot2", loadaddr);
entry = (void (*)())loadaddr;
(*entry)();
diff --git a/sys/boot/alpha/boot2/Makefile b/sys/boot/alpha/boot2/Makefile
index 956944d255c8..dfc8e58121eb 100644
--- a/sys/boot/alpha/boot2/Makefile
+++ b/sys/boot/alpha/boot2/Makefile
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
-BASE= loader
+BASE= boot2
PROG= ${BASE}
NOMAN=
NEWVERSWHAT= "SRM disk boot"
@@ -16,9 +16,6 @@ SRCS+= main.c conf.c
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
-CFLAGS+= -DLOADER
-CFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
- -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
CLEANFILES+= vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
setdefs.h start.o
@@ -30,7 +27,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -38,7 +34,7 @@ vers.o: ${.CURDIR}/newvers.sh ${.CURDIR}/Makefile
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
-${BASE}: ${BASE}.sym ${BASE}.help
+${BASE}: ${BASE}.sym
objcopy -O binary ${BASE}.sym ${BASE}
${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
@@ -46,21 +42,9 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
${CRT} setdef0.o ${OBJS} setdef1.o \
vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
-${BASE}.help: help.common help.alpha
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-beforeinstall:
-.if exists(${.OBJDIR}/loader.help)
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
-.else
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
-.endif
-
# Other fragments still to be brought in from ../Makfile.booters?
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c $<
setdef0.o: setdefs.h
diff --git a/sys/boot/alpha/boot2/help.alpha b/sys/boot/alpha/boot2/help.alpha
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/sys/boot/alpha/boot2/help.alpha
+++ /dev/null
diff --git a/sys/boot/alpha/boot2/newvers.sh b/sys/boot/alpha/boot2/newvers.sh
index 978c16489867..88cc010175bb 100644
--- a/sys/boot/alpha/boot2/newvers.sh
+++ b/sys/boot/alpha/boot2/newvers.sh
@@ -35,7 +35,6 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-LC_TIME=C; export LC_TIME
u=${USER-root} h=`hostname` t=`date`
r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
diff --git a/sys/boot/alpha/common/main.c b/sys/boot/alpha/common/main.c
index 41400240b26e..365e5c4cd98c 100644
--- a/sys/boot/alpha/common/main.c
+++ b/sys/boot/alpha/common/main.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.8 1998/10/31 17:12:32 dfr Exp $
+ * $Id: main.c,v 1.4 1998/09/03 02:10:02 msmith Exp $
*/
@@ -63,50 +63,6 @@ memsize()
return total;
}
-static void
-extend_heap()
-{
- struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR;
- struct mddt *mddtp;
- struct mddt_cluster *memc;
- int i;
- unsigned long total = 0;
- unsigned long startpfn;
- vm_offset_t startva;
- vm_offset_t startpte;
-
- /*
- * Find the last usable memory cluster and add some of its pages
- * to our address space. The 256k allowed by the firmware isn't quite
- * adequate for our needs.
- */
- mddtp = (struct mddt *)(((caddr_t)hwrpb) + hwrpb->rpb_memdat_off);
- for (i = mddtp->mddt_cluster_cnt - 1; i >= 0; i--) {
- memc = &mddtp->mddt_clusters[i];
- if (!(memc->mddt_usage & (MDDT_NONVOLATILE | MDDT_PALCODE)))
- break;
- }
-
- /*
- * We want to extend the heap from 256k to 512k. With 8k pages
- * (assumed), we need 32 pages. We take pages from the end of the
- * last usable memory region, taking care to avoid the memory used
- * by the kernel's message buffer. We allow 4 pages for the
- * message buffer.
- */
- startpfn = memc->mddt_pfn + memc->mddt_pg_cnt - 4 - 32;
- startva = 0x20040000;
- startpte = 0x40000000
- + (((startva >> 23) & 0x3ff) << PAGE_SHIFT)
- + (((startva >> 13) & 0x3ff) << 3);
-
- for (i = 0; i < 32; i++) {
- u_int64_t pte;
- pte = ((startpfn + i) << 32) | 0x1101;
- *(u_int64_t *) (startpte + 8 * i) = pte;
- }
-}
-
void
main(void)
{
@@ -114,27 +70,18 @@ main(void)
char bootfile[128];
/*
- * Initialise the heap as early as possible. Once this is done,
- * alloc() is usable. The stack is buried inside us, so this is
- * safe.
+ * Initialise the heap as early as possible. Once this is done, alloc() is usable.
+ * The stack is buried inside us, so this is safe
*/
- extend_heap();
- setheap((void *)end, (void *)0x20080000);
+ setheap((void *)end, (void *)0x20040000);
-#ifdef LOADER
- /*
- * If this is the two stage disk loader, add the memory used by
- * the first stage to the heap.
- */
- free_region((void *)PRIMARY_LOAD_ADDRESS,
- (void *)SECONDARY_LOAD_ADDRESS);
-#endif
/*
- * XXX Chicken-and-egg problem; we want to have console output
- * early, but some console attributes may depend on reading from
- * eg. the boot device, which we can't do yet. We can use
- * printf() etc. once this is done.
+ * XXX Chicken-and-egg problem; we want to have console output early, but some
+ * console attributes may depend on reading from eg. the boot device, which we
+ * can't do yet.
+ *
+ * We can use printf() etc. once this is done.
*/
cons_probe();
@@ -142,11 +89,6 @@ main(void)
OSFpal();
/*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k XXX tune this */
-
- /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
diff --git a/sys/boot/alpha/libalpha/Makefile b/sys/boot/alpha/libalpha/Makefile
index 4928647b7548..a82febf2e2a3 100644
--- a/sys/boot/alpha/libalpha/Makefile
+++ b/sys/boot/alpha/libalpha/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 1998/10/14 09:53:25 peter Exp $
+# $Id: Makefile,v 1.4 1998/09/26 10:51:37 dfr Exp $
LIB= alpha
NOPIC= true
@@ -14,7 +14,7 @@ CFLAGS+= -DDEBUG
CFLAGS+= -I${.CURDIR}/../../common -mno-fp-regs \
-I${.CURDIR}/../../.. -I.
-#CFLAGS+= -DDISK_DEBUG
+CFLAGS+= -DDISK_DEBUG
#CPPFLAGS+= -DNO_DISKLABEL
#CPPFLAGS+= -DSAVE_MEMORY
diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c
index 6b7d17b8e76d..f7427bdb493f 100644
--- a/sys/boot/alpha/libalpha/srmdisk.c
+++ b/sys/boot/alpha/libalpha/srmdisk.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: srmdisk.c,v 1.3 1998/11/02 23:28:10 msmith Exp $
+ * $Id$
*/
/*
@@ -46,7 +46,6 @@
#include <machine/stdarg.h>
#include <machine/prom.h>
-#include "bootstrap.h"
#include "libalpha.h"
#define SRMDISK_SECSIZE 512
@@ -62,16 +61,18 @@
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, void *vdev);
static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
struct open_disk {
int od_fd;
int od_unit; /* our unit number */
int od_boff; /* block offset from beginning of SRM disk */
int od_flags;
+#define BD_MODEMASK 0x3
+#define BD_MODEINT13 0x0
+#define BD_MODEEDD1 0x1
+#define BD_MODEEDD3 0x2
#define BD_FLOPPY (1<<2)
u_char od_buf[BUFSIZE]; /* transfer buffer (do we want/need this?) */
};
@@ -83,8 +84,7 @@ struct devsw srmdisk = {
bd_strategy,
bd_open,
bd_close,
- noioctl,
- bd_print
+ noioctl
};
/*
@@ -120,23 +120,6 @@ bd_init(void)
}
/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i;
- char line[80];
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: SRM drive %s", i, bdinfo[i].bd_name);
- pager_output(line);
- /* XXX more detail? */
- pager_output("\n");
- }
-}
-
-/*
* Attempt to open the disk described by (dev) for use by (f).
*
* Note that the philosophy here is "give them exactly what
@@ -324,17 +307,7 @@ bd_close(struct open_file *f)
}
static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
+bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
{
prom_return_t ret;
struct open_disk *od = (struct open_disk *)devdata;
diff --git a/sys/boot/alpha/libalpha/start.S b/sys/boot/alpha/libalpha/start.S
index 39c3e48952c6..53063aba11ee 100644
--- a/sys/boot/alpha/libalpha/start.S
+++ b/sys/boot/alpha/libalpha/start.S
@@ -1,5 +1,5 @@
/*
- * $Id: start.S,v 1.1.1.1 1998/08/21 03:17:42 msmith Exp $
+ * $Id$
* From: $NetBSD: start.S,v 1.4 1998/03/28 00:54:15 cgd Exp $
*/
@@ -51,15 +51,16 @@ NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
Lstartgp:
LDGP(pv)
+#ifndef PRIMARY_BOOTBLOCK
+ lda sp,start /* start stack below text */
+ lda sp,-ENTRY_FRAME(sp)
+#endif
+
lda a0,_edata
lda a1,_end
subq a1,a0,a1
CALL(bzero)
-#if defined(NETBOOT) || defined(LOADER)
- lda sp,stack + 8192 - ENTRY_FRAME
-#endif
-
CALL(main) /* transfer to C */
XLEAF(_rtt, 0)
@@ -82,7 +83,3 @@ LEAF(cpu_number, 0)
call_pal PAL_VMS_mfpr_whami
RET
END(cpu_number)
-
-#if defined(NETBOOT) || defined(LOADER)
-BSS(stack, 8192)
-#endif
diff --git a/sys/boot/alpha/netboot/Makefile b/sys/boot/alpha/netboot/Makefile
index 927522c4b638..bb4a77ea046d 100644
--- a/sys/boot/alpha/netboot/Makefile
+++ b/sys/boot/alpha/netboot/Makefile
@@ -16,7 +16,8 @@ SRCS+= main.c conf.c dev_net.c
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.OBJDIR}
-CFLAGS+= -DNETBOOT
+# Verbose ls causes extra heap usage
+CFLAGS+= -DVERBOSE_LS
CLEANFILES+= vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
setdefs.h start.o
@@ -28,7 +29,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -49,7 +49,7 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
setdef0.o: setdefs.h
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index c29494ba6aef..805b0094eaa2 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -1,8 +1,7 @@
-# $Id: Makefile.inc,v 1.7 1998/11/02 23:28:10 msmith Exp $
+# $Id: Makefile.inc,v 1.5 1998/09/14 18:27:04 msmith Exp $
-SRCS+= bcache.c boot.c commands.c console.c devopen.c interp.c
-SRCS+= interp_backslash.c interp_parse.c load_aout.c load_elf.c ls.c misc.c
-SRCS+= module.c panic.c
+SRCS+= boot.c commands.c console.c devopen.c interp.c interp_backslash.c
+SRCS+= interp_parse.c load_aout.c load_elf.c ls.c misc.c module.c panic.c
# Machine-independant ISA PnP
.if HAVE_ISABUS
@@ -11,8 +10,3 @@ SRCS+= isapnp.c
.if HAVE_PNP
SRCS+= pnp.c
.endif
-
-# Forth interpreter
-.if BOOT_FORTH
-SRCS+= interp_forth.c
-.endif
diff --git a/sys/boot/common/bcache.c b/sys/boot/common/bcache.c
deleted file mode 100644
index fc12f578f9fa..000000000000
--- a/sys/boot/common/bcache.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@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.
- *
- * $Id: bcache.c,v 1.3 1998/11/04 00:29:01 msmith Exp $
- */
-
-/*
- * Simple LRU block cache
- */
-
-#include <stand.h>
-#include <string.h>
-#include <bitstring.h>
-
-#include "bootstrap.h"
-
-/* #define BCACHE_DEBUG */
-
-#ifdef BCACHE_DEBUG
-#define BCACHE_TIMEOUT 10
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
-#else
-#define BCACHE_TIMEOUT 2
-# define DEBUG(fmt, args...)
-#endif
-
-
-struct bcachectl
-{
- daddr_t bc_blkno;
- time_t bc_stamp;
- int bc_count;
-};
-
-static struct bcachectl *bcache_ctl;
-static caddr_t bcache_data;
-static bitstr_t *bcache_miss;
-static int bcache_nblks;
-static int bcache_blksize;
-static int bcache_hits, bcache_misses, bcache_ops, bcache_bypasses;
-static int bcache_bcount;
-
-static void bcache_insert(caddr_t buf, daddr_t blkno);
-static int bcache_lookup(caddr_t buf, daddr_t blkno);
-
-/*
- * Initialise the cache for (nblks) of (bsize).
- */
-int
-bcache_init(int nblks, size_t bsize)
-{
- int i;
-
- /* discard any old contents */
- if (bcache_data != NULL) {
- free(bcache_data);
- bcache_data = NULL;
- free(bcache_ctl);
- }
-
- /* Allocate control structures */
- bcache_nblks = nblks;
- bcache_blksize = bsize;
- bcache_data = malloc(bcache_nblks * bcache_blksize);
- bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct bcachectl));
- bcache_miss = bit_alloc((bcache_nblks + 1) / 2);
- if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) {
- if (bcache_miss)
- free(bcache_miss);
- if (bcache_ctl)
- free(bcache_ctl);
- if (bcache_data)
- free(bcache_data);
- bcache_data = NULL;
- return(ENOMEM);
- }
-
- /* Invalidate the cache */
- for (i = 0; i < bcache_nblks; i++) {
- bcache_ctl[i].bc_count = -1;
- bcache_ctl[i].bc_blkno = -1;
- }
-
- return(0);
-}
-
-/*
- * Handle a transfer request; fill in parts of the request that can
- * be satisfied by the cache, use the supplied strategy routine to do
- * device I/O and then use the I/O results to populate the cache.
- *
- * Requests larger than 1/2 the cache size will be bypassed and go
- * directly to the disk. XXX tune this.
- */
-int
-bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize)
-{
- struct bcache_devdata *dd = (struct bcache_devdata *)devdata;
- int nblk, p_size;
- daddr_t p_blk;
- caddr_t p_buf;
- int i, j, result;
-
- bcache_ops++;
-
- /* bypass large requests, or when the cache is inactive */
- if ((bcache_data == NULL) || ((size * 2 / bcache_blksize) > bcache_nblks)) {
- DEBUG("bypass %d from %d", size / bcache_blksize, blk);
- bcache_bypasses++;
- return(dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize));
- }
-
- nblk = size / bcache_blksize;
- result = 0;
-
- /* Satisfy any cache hits up front */
- for (i = 0; i < nblk; i++) {
- if (bcache_lookup(buf + (bcache_blksize * i), blk + i)) {
- bit_set(bcache_miss, i); /* cache miss */
- bcache_misses++;
- } else {
- bit_clear(bcache_miss, i); /* cache hit */
- bcache_hits++;
- }
- }
-
- /* Go back and fill in any misses XXX optimise */
- p_blk = -1;
- p_buf = NULL;
- p_size = 0;
- for (i = 0; i < nblk; i++) {
- if (bit_test(bcache_miss, i)) {
- /* miss, add to pending transfer */
- if (p_blk == -1) {
- p_blk = blk + i;
- p_buf = buf + (bcache_blksize * i);
- p_size = 1;
- } else {
- p_size++;
- }
- } else if (p_blk != -1) {
- /* hit, complete pending transfer */
- result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL);
- if (result != 0)
- goto done;
- for (j = 0; j < p_size; j++)
- bcache_insert(p_buf + (j * bcache_blksize), p_blk + j);
- p_blk = -1;
- }
- }
- if (p_blk != -1) {
- /* pending transfer left */
- result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL);
- if (result != 0)
- goto done;
- for (j = 0; j < p_size; j++)
- bcache_insert(p_buf + (j * bcache_blksize), p_blk + j);
- }
-
- done:
- if ((result == 0) && (rsize != NULL))
- *rsize = size;
- return(result);
-}
-
-
-/*
- * Insert a block into the cache. Retire the oldest block to do so, if required.
- *
- * XXX the LRU algorithm will fail after 2^31 blocks have been transferred.
- */
-static void
-bcache_insert(caddr_t buf, daddr_t blkno)
-{
- time_t now;
- int i, cand, ocount;
-
- time(&now);
- cand = 0; /* assume the first block */
- ocount = bcache_ctl[0].bc_count;
-
- /* find the oldest block */
- for (i = 1; i < bcache_nblks; i++) {
- if (bcache_ctl[i].bc_blkno == blkno) {
- /* reuse old entry */
- cand = i;
- break;
- }
- if (bcache_ctl[i].bc_count < ocount) {
- ocount = bcache_ctl[i].bc_count;
- cand = i;
- }
- }
-
- DEBUG("insert blk %d -> %d @ %d # %d", blkno, cand, now, bcache_bcount);
- bcopy(buf, bcache_data + (bcache_blksize * cand), bcache_blksize);
- bcache_ctl[cand].bc_blkno = blkno;
- bcache_ctl[cand].bc_stamp = now;
- bcache_ctl[cand].bc_count = bcache_bcount++;
-}
-
-/*
- * Look for a block in the cache. Blocks more than BCACHE_TIMEOUT seconds old
- * may be stale (removable media) and thus are discarded. Copy the block out
- * if successful and return zero, or return nonzero on failure.
- */
-static int
-bcache_lookup(caddr_t buf, daddr_t blkno)
-{
- time_t now;
- int i;
-
- time(&now);
-
- for (i = 0; i < bcache_nblks; i++)
- /* cache hit? */
- if ((bcache_ctl[i].bc_blkno == blkno) && ((bcache_ctl[i].bc_stamp + BCACHE_TIMEOUT) >= now)) {
- bcopy(bcache_data + (bcache_blksize * i), buf, bcache_blksize);
- DEBUG("hit blk %d <- %d (now %d then %d)", blkno, i, now, bcache_ctl[i].bc_stamp);
- return(0);
- }
- return(ENOENT);
-}
-
-COMMAND_SET(bcachestat, "bcachestat", "get disk block cache stats", command_bcache);
-
-static int
-command_bcache(int argc, char *argv[])
-{
- int i;
-
- for (i = 0; i < bcache_nblks; i++) {
- printf("%08x %04x %04x|", bcache_ctl[i].bc_blkno, bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
- if (((i + 1) % 4) == 0)
- printf("\n");
- }
- printf("\n%d ops %d bypasses %d hits %d misses\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses);
- return(CMD_OK);
-}
-
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index 2de8603e881e..608c9d02a921 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: boot.c,v 1.9 1998/10/31 17:12:32 dfr Exp $
+ * $Id: boot.c,v 1.6 1998/10/11 10:10:41 peter Exp $
*/
/*
@@ -38,7 +38,7 @@
static char *getbootfile(int try);
/* List of kernel names to try (may be overwritten by boot.config) XXX should move from here? */
-static char *default_bootfiles = "kernel;kernel.old";
+static char *default_bootfiles = "kernel,kernel.old";
static int autoboot_tried;
@@ -203,13 +203,11 @@ autoboot(int delay, char *prompt)
break;
}
if (ntime != otime) {
- printf("\rBooting [%s] in %d seconds... ", getbootfile(0), (int)(when - ntime));
+ printf("\rBooting [%s] in %d seconds...", getbootfile(0), (int)(when - ntime));
otime = ntime;
cr = 1;
}
}
- if (yes)
- printf("\rBooting [%s]... ", getbootfile(0));
if (cr)
putchar('\n');
if (yes) {
@@ -243,11 +241,11 @@ getbootfile(int try)
spec = default_bootfiles;
while ((try > 0) && (spec != NULL)) {
- spec = strchr(spec, ';');
+ spec = strchr(spec, ',');
try--;
}
if (spec != NULL) {
- if ((ep = strchr(spec, ';')) != NULL) {
+ if ((ep = strchr(spec, ',')) != NULL) {
len = ep - spec;
} else {
len = strlen(spec);
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index ed450d91602e..84f6d4809764 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -23,11 +23,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootstrap.h,v 1.17 1999/01/15 00:31:45 abial Exp $
+ * $Id: bootstrap.h,v 1.12 1998/10/09 07:09:22 msmith Exp $
*/
#include <sys/types.h>
-#include <sys/queue.h>
/* XXX debugging */
extern struct console vidconsole;
@@ -56,7 +55,7 @@ extern char command_errbuf[]; /* XXX blah, length */
/* interp.c */
extern void interact(void);
-extern int source(char *filename);
+extern void source(char *filename);
/* interp_parse.c */
extern int parse(int *argc, char ***argv, char *str);
@@ -72,15 +71,6 @@ extern size_t strlenout(vm_offset_t str);
extern char *strdupout(vm_offset_t str);
/*
- * Disk block cache
- */
-struct bcache_devdata
-{
- int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize);
- void *dv_devdata;
-};
-
-/*
* Modular console support.
*/
struct console
@@ -104,44 +94,33 @@ extern void cons_probe(void);
/*
* Plug-and-play enumerator/configurator interface.
*/
-struct pnphandler
+struct pnpident
{
- char *pp_name; /* handler/bus name */
- void (* pp_enumerate)(void); /* enumerate PnP devices, add to chain */
+ char *id_ident; /* ASCII identifier, actual format varies with bus/handler */
+ struct pnpident *id_next; /* the next identifier */
};
-struct pnpident
+struct pnphandler;
+struct pnpinfo
{
- char *id_ident; /* ASCII identifier, actual format varies with bus/handler */
- STAILQ_ENTRY(pnpident) id_link;
+ struct pnpident *pi_ident; /* list of identifiers */
+ int pi_revision; /* optional revision (or -1) if not supported */
+ char *pi_module; /* module/args nominated to handle device */
+ int pi_argc; /* module arguments */
+ char **pi_argv;
+ struct pnphandler *pi_handler; /* handler which detected this device */
+ struct pnpinfo *pi_next;
};
-struct pnpinfo
+struct pnphandler
{
- char *pi_desc; /* ASCII description, optional */
- int pi_revision; /* optional revision (or -1) if not supported */
- char *pi_module; /* module/args nominated to handle device */
- int pi_argc; /* module arguments */
- char **pi_argv;
- struct pnphandler *pi_handler; /* handler which detected this device */
- STAILQ_HEAD(,pnpident) pi_ident; /* list of identifiers */
- STAILQ_ENTRY(pnpinfo) pi_link;
+ char *pp_name; /* handler/bus name */
+ void (* pp_enumerate)(struct pnpinfo **); /* add detected devices to chain */
};
extern struct pnphandler *pnphandlers[]; /* provided by MD code */
extern void pnp_addident(struct pnpinfo *pi, char *ident);
-extern struct pnpinfo *pnp_allocinfo(void);
-extern void pnp_freeinfo(struct pnpinfo *pi);
-extern void pnp_addinfo(struct pnpinfo *pi);
-extern char *pnp_eisaformat(u_int8_t *data);
-
-/*
- * < 0 - No ISA in system
- * == 0 - Maybe ISA, search for read data port
- * > 0 - ISA in system, value is read data port address
- */
-extern int isapnp_readport;
/*
* Module metadata header.
@@ -201,53 +180,58 @@ extern vm_offset_t aout_findsym(char *name, struct loaded_module *mp);
extern int elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result);
-#ifndef NEW_LINKER_SET
-#include <sys/linker_set.h>
-
-/* XXX just for conversion's sake, until we move to the new linker set code */
-
-#define SET_FOREACH(pvar, set) \
- for (pvar = set.ls_items; \
- pvar < set.ls_items + set.ls_length; \
- pvar++)
-
-#else /* NEW_LINKER_SET */
+#if defined(__ELF__)
/*
- * Private macros, not to be used outside this header file.
+ * Alpha GAS needs an align before the section change. It seems to assume
+ * that after the .previous, it is aligned, so the following .align 3 is
+ * ignored. Since the previous instructions often contain strings, this is
+ * a problem.
*/
-#define __MAKE_SET(set, sym) \
- static void *__CONCAT(__setentry,__LINE__) \
- __attribute__((__section__("set_" #set),__unused__)) = &sym
-#define __SET_BEGIN(set) \
- ({ extern void *__CONCAT(__start_set_,set); \
- &__CONCAT(__start_set_,set); })
-#define __SET_END(set) \
- ({ extern void *__CONCAT(__stop_set_,set); \
- &__CONCAT(__stop_set_,set); })
-/*
- * Public macros.
- */
+#ifdef __alpha__
+#define MAKE_SET(set, sym) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".align 3"); \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".quad " #sym); \
+ __asm(".previous")
+#else
+#define MAKE_SET(set, sym) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".long " #sym); \
+ __asm(".previous")
+#endif
+#define TEXT_SET(set, sym) MAKE_SET(set, sym)
+#define DATA_SET(set, sym) MAKE_SET(set, sym)
+#define BSS_SET(set, sym) MAKE_SET(set, sym)
+#define ABS_SET(set, sym) MAKE_SET(set, sym)
-/* Add an entry to a set. */
-#define TEXT_SET(set, sym) __MAKE_SET(set, sym)
-#define DATA_SET(set, sym) __MAKE_SET(set, sym)
-#define BSS_SET(set, sym) __MAKE_SET(set, sym)
-#define ABS_SET(set, sym) __MAKE_SET(set, sym)
+#else
/*
- * Iterate over all the elements of a set.
- *
- * Sets always contain addresses of things, and "pvar" points to words
- * containing those addresses. Thus is must be declared as "type **pvar",
- * and the address of each set item is obtained inside the loop by "*pvar".
+ * Linker set support, directly from <sys/kernel.h>
+ *
+ * NB: the constants defined below must match those defined in
+ * ld/ld.h. Since their calculation requires arithmetic, we
+ * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
*/
-#define SET_FOREACH(pvar, set) \
- for (pvar = (__typeof__(pvar))__SET_BEGIN(set); \
- pvar < (__typeof__(pvar))__SET_END(set); pvar++)
+#define MAKE_SET(set, sym, type) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
+#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
+#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
+#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
+#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
+
#endif
+struct linker_set {
+ int ls_length;
+ const void *ls_items[1]; /* really ls_length of them, trailing NULL */
+};
+
/*
* Support for commands
*/
diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c
index fe0eb54d7707..77cc43ca0e71 100644
--- a/sys/boot/common/commands.c
+++ b/sys/boot/common/commands.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: commands.c,v 1.8 1999/01/09 02:34:48 msmith Exp $
+ * $Id: commands.c,v 1.4 1998/10/07 02:38:26 msmith Exp $
*/
#include <stand.h>
@@ -34,181 +34,35 @@
char *command_errmsg;
char command_errbuf[256]; /* XXX should have procedural interface for setting, size limit? */
-
-
-/*
- * Help is read from a formatted text file.
- *
- * Entries in the file are formatted as
-
-# Ttopic [Ssubtopic] Ddescription
-help
-text
-here
-#
-
- *
- * Note that for code simplicity's sake, the above format must be followed
- * exactly.
- *
- * Subtopic entries must immediately follow the topic (this is used to
- * produce the listing of subtopics).
- *
- * If no argument(s) are supplied by the user, the help for 'help' is displayed.
- */
-COMMAND_SET(help, "help", "detailed help", command_help);
-
-static int
-help_getnext(int fd, char **topic, char **subtopic, char **desc)
-{
- char line[81], *cp, *ep;
-
- for (;;) {
- if (fgetstr(line, 80, fd) < 0)
- return(0);
-
- if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
- continue;
-
- *topic = *subtopic = *desc = NULL;
- cp = line + 2;
- while((cp != NULL) && (*cp != 0)) {
- ep = strchr(cp, ' ');
- if ((*cp == 'T') && (*topic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *topic = strdup(cp + 1);
- } else if ((*cp == 'S') && (*subtopic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *subtopic = strdup(cp + 1);
- } else if (*cp == 'D') {
- *desc = strdup(cp + 1);
- ep = NULL;
- }
- cp = ep;
- }
- if (*topic == NULL) {
- if (*subtopic != NULL)
- free(*subtopic);
- if (*desc != NULL)
- free(*desc);
- continue;
- }
- return(1);
- }
-}
-
-static void
-help_emitsummary(char *topic, char *subtopic, char *desc)
-{
- int i;
- pager_output(" ");
- pager_output(topic);
- i = strlen(topic);
- if (subtopic != NULL) {
- pager_output(" ");
- pager_output(subtopic);
- i += strlen(subtopic) + 1;
- }
- if (desc != NULL) {
- do {
- pager_output(" ");
- } while (i++ < 30);
- pager_output(desc);
- }
- pager_output("\n");
-}
+COMMAND_SET(help, "help", "detailed help", command_help);
-
static int
-command_help(int argc, char *argv[])
+command_help(int argc, char *argv[])
{
- char buf[81]; /* XXX buffer size? */
- int hfd, matched, doindex;
- char *topic, *subtopic, *t, *s, *d;
+ char helppath[80]; /* XXX buffer size? */
/* page the help text from our load path */
- sprintf(buf, "%s/boot/loader.help", getenv("loaddev"));
- if ((hfd = open(buf, O_RDONLY)) < 0) {
+ sprintf(helppath, "%s/boot/boot.help", getenv("loaddev"));
+ printf("%s\n", helppath);
+ if (pager_file(helppath) == -1)
printf("Verbose help not available, use '?' to list commands\n");
- return(CMD_OK);
- }
-
- /* pick up request from arguments */
- topic = subtopic = NULL;
- switch(argc) {
- case 3:
- subtopic = strdup(argv[2]);
- case 2:
- topic = strdup(argv[1]);
- break;
- case 1:
- topic = strdup("help");
- break;
- default:
- command_errmsg = "usage is 'help <topic> [<subtopic>]";
- return(CMD_ERROR);
- }
-
- /* magic "index" keyword */
- doindex = !strcmp(topic, "index");
- matched = doindex;
-
- /* Scan the helpfile looking for help matching the request */
- pager_open();
- while(help_getnext(hfd, &t, &s, &d)) {
-
- if (doindex) { /* dink around formatting */
- help_emitsummary(t, s, d);
-
- } else if (strcmp(topic, t)) {
- /* topic mismatch */
- if(matched) /* nothing more on this topic, stop scanning */
- break;
-
- } else {
- /* topic matched */
- matched = 1;
- if (((subtopic == NULL) && (s == NULL)) ||
- ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) {
- /* exact match, print text */
- while((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) {
- pager_output(buf);
- pager_output("\n");
- }
- } else if ((subtopic == NULL) && (s != NULL)) {
- /* topic match, list subtopics */
- help_emitsummary(t, s, d);
- }
- }
- free(t);
- free(s);
- free(d);
- }
- pager_close();
- close(hfd);
- if (!matched) {
- sprintf(command_errbuf, "no help available for '%s'", topic);
- return(CMD_ERROR);
- }
return(CMD_OK);
}
-
COMMAND_SET(commandlist, "?", "list commands", command_commandlist);
static int
command_commandlist(int argc, char *argv[])
{
struct bootblk_command **cmdp;
+ int i;
printf("Available commands:\n");
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL))
- printf(" %-15s %s\n", (*cmdp)->c_name, (*cmdp)->c_desc);
- }
+ cmdp = (struct bootblk_command **)Xcommand_set.ls_items;
+ for (i = 0; i < Xcommand_set.ls_length; i++)
+ if ((cmdp[i]->c_name != NULL) && (cmdp[i]->c_desc != NULL))
+ printf(" %-15s %s\n", cmdp[i]->c_name, cmdp[i]->c_desc);
return(CMD_OK);
}
@@ -299,7 +153,6 @@ command_echo(int argc, char *argv[])
nl = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "n")) != -1) {
switch(ch) {
case 'n':
@@ -344,7 +197,6 @@ command_read(int argc, char *argv[])
timeout = -1;
prompt = NULL;
optind = 1;
- optreset = 1;
while ((c = getopt(argc, argv, "p:t:")) != -1) {
switch(c) {
@@ -382,47 +234,3 @@ command_read(int argc, char *argv[])
setenv(name, buf, 1);
return(CMD_OK);
}
-
-/*
- * List all disk-like devices
- */
-COMMAND_SET(lsdev, "lsdev", "list all devices", command_lsdev);
-
-static int
-command_lsdev(int argc, char *argv[])
-{
- int verbose, ch, i;
- char line[80];
-
- verbose = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "v")) != -1) {
- switch(ch) {
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
- }
- }
- argv += (optind);
- argc -= (optind);
-
- pager_open();
- for (i = 0; devsw[i] != NULL; i++) {
- if (devsw[i]->dv_print != NULL){
- sprintf(line, "%s @ %p\n", devsw[i]->dv_name, devsw[i]->dv_print);
- pager_output(line);
- devsw[i]->dv_print(verbose);
- } else {
- sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name);
- pager_output(line);
- }
- }
- pager_close();
- return(CMD_OK);
-}
-
diff --git a/sys/boot/common/console.c b/sys/boot/common/console.c
index 8c4377f2bcd4..b9534d304030 100644
--- a/sys/boot/common/console.c
+++ b/sys/boot/common/console.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: console.c,v 1.3 1998/10/11 10:19:11 peter Exp $
+ * $Id: console.c,v 1.2 1998/09/26 01:29:13 msmith Exp $
*/
#include <stand.h>
@@ -150,12 +150,8 @@ cons_set(struct env_var *ev, int flags, void *value)
{
int cons, active;
- if ((value == NULL) || ((active = cons_find(value)) == -1)) {
- if (value != NULL)
- printf("no such console '%s'\n", (char *)value);
- printf("Available consoles:\n");
- for (cons = 0; consoles[cons] != NULL; cons++)
- printf(" %s\n", consoles[cons]->c_name);
+ if ((active = cons_find(value)) == -1) {
+ printf("no such console '%s'\n", (char *)value);
return(CMD_ERROR);
}
diff --git a/sys/boot/common/help.common b/sys/boot/common/help.common
deleted file mode 100644
index e467b1ca7092..000000000000
--- a/sys/boot/common/help.common
+++ /dev/null
@@ -1,262 +0,0 @@
-################################################################################
-# Thelp DDisplay command help
-
- help [topic [subtopic]]
- ?
-
- The help command displays help on commands and their usage.
-
- In command help, a term enclosed with <...> indicates a value as
- described by the term. A term enclosed with [...] is optional,
- and may not be required by all forms of the command.
-
- Some commands may not be availalble. Use the '?' command to list
- most available commands.
-
-################################################################################
-# Tautoboot DBoot after a delay
-
- autoboot [<delay> [<prompt>]]
-
- Displays <prompt> or a default prompt, and counts down <delay> seconds
- before attempting to boot. If <delay> is not specified, the default
- value is 10.
-
-################################################################################
-# Tboot DBoot immediately
-
- boot [-<arg> ...] [<kernelname>]
-
- Boot the system. If arguments are specified, they are added to the
- arguments for the kernel. If <kernelname> is specified, and a kernel
- has not already been loaded, it will be booted instead of the default
- kernel.
-
-################################################################################
-# Techo DEcho arguments
-
- echo [-n] [<message>]
-
- Emits <message>, with no trailing newline if -n is specified. This is
- most useful in conjunction with scripts and the '@' line prefix.
-
- Variables are substituted by prefixing them with $, eg.
-
- echo Current device is $currdev
-
- will print the current device.
-
-################################################################################
-# Tload DLoad a kernel or module
-
- load [-t <type>] <filename>
-
- Loads the module contained in <filename> into memory. If no other
- modules are loaded, <filename> must be a kernel or the command will
- fail.
-
- If -t is specified, the module is loaded as raw data of <type>, for
- later use by the kernel or other modules. <type> may be any string.
-
-################################################################################
-# Tls DList files
-
- ls [-l] [<path>]
-
- Displays a listing of files in the directory <path>, or the root
- directory of the current device if <path> is not specified.
-
- The -l argument displays file sizes as well; the process of obtaining
- file sizes on some media may be very slow.
-
-################################################################################
-# Tlsdev DList devices
-
- lsdev [-v]
-
- List all of the devices from which it may be possible to load modules.
- If -v is specified, print more details.
-
-################################################################################
-# Tlsmod DList modules
-
- lsmod [-v]
-
- List loaded modules. If [-v] is specified, print more details.
-
-################################################################################
-# Tpnpscan DScan for PnP devices
-
- pnpscan [-v]
-
- Scan for Plug-and-Play devices. This command is normally automatically
- run as part of the boot process, in order to dynamically load modules
- required for system operation.
-
- If the -v argument is specified, details on the devices found will
- be printed.
-
-################################################################################
-# Tset DSet a variable
-
- set <variable name>
- set <variable name>=<value>
-
- The set command is used to set variables.
-
-################################################################################
-# Tset Sautoboot_delay DSet the default autoboot delay
-
- set autoboot_delay=<value>
-
- Sets the default delay for the autoboot command to <value> seconds.
-
-################################################################################
-# Tset Sbootfile DSet the default boot file set
-
- set bootfile=<filename>[,<filename>...]
-
- The default search path for bootable kernels is /kernel,/kernel.old.
- It may be overridden by setting the bootfile variable to a
- semicolon-separated list of paths, which will be searched for in turn.
-
-################################################################################
-# Tset Sboot_askname DPrompt for root device
-
- set boot_askname
-
- Instructs the kernel to prompt the user for the name of the root device
- when the kernel is booted.
-
-################################################################################
-# Tset Sboot_ddb DDrop to the kernel debugger (DDB)
-
- set boot_ddb
-
- Instructs the kernel to start in the DDB debugger, rather than
- proceeding to initialise when booted.
-
-################################################################################
-# Tset Sboot_gdb DSelect gdb-remote mode
-
- set boot_gdb
-
- Selects gdb-remote mode for the kernel debugger by default.
-
-################################################################################
-# Tset Sboot_single DStart system in single-user mode
-
- set boot_single
-
- Prevents the kernel from initiating a multi-user startup, single-user
- mode will be entered when the kernel has finished device probes.
-
-################################################################################
-# Tset Sboot_verbose DVerbose boot messages
-
- set boot_verbose
-
- Setting this variable causes extra debugging information to be printed
- by the kernel during the boot phase.
-
-################################################################################
-# Tset Sconsole DSet the current console
-
- set console[=<value>]
-
- Sets the current console. If <value> is omitted, a list of valid
- consoles will be displayed.
-
-################################################################################
-# Tset Scurrdev DSet the current device
-
- set currdev=<device>
-
- Selects the default device. Syntax for devices is odd.
-
-################################################################################
-# Tset Smodule_path DSet the module search path
-
- set module_path=<path>[,<path>...]
-
- Sets the list of directories which will be searched in for modules
- named in a load command or implicitly required by a dependancy.
-
-################################################################################
-# Tset Sprompt DSet the command prompt
-
- set prompt=<value>
-
- The command prompt is displayed when the loader is waiting for input.
- Variable substitution is performed on the prompt. The default
- prompt can be set with:
-
- set prompt=\$currdev>
-
-################################################################################
-# Tset Srootdev DSet the root filesystem
-
- set rootdev=<path>
-
- By default the value of $currdev is used to set the root filesystem
- when the kernel is booted. This can be overridden by setting
- $rootdev explicitly.
-
-################################################################################
-# Tshow DShow the values of variables
-
- show [<variable>]
-
- Displays the value of <variable>, or all variables if not specified.
- Multiple paths can be separated with a semicolon.
-
- See the set command for a list of some variables.
-
-################################################################################
-# Tsource DRead commands from a script file
-
- source <filename>
-
- The entire contents of <filename> are read into memory before executing
- commands, so it is safe to source a file from removable media.
-
- A number of modifiers may be prefixed to commands within a script file
- to alter their behaviour:
-
- @ Suppresses the printing of the command when executed.
-
- - Prevents the script from terminating if the command returns
- an error.
-
-################################################################################
-# Tread DRead input from the terminal
-
- read [-t <value>] [-p <prompt>] [<variable name>]
-
- The read command reads a line of input from the terminal. If the
- -t argument is specified, it will return nothing if no input has been
- received after <value> seconds. (Any keypress will cancel the
- timeout).
-
- If -p is specified, <prompt> is printed before reading input. No
- newline is emitted after the prompt.
-
- If a variable name is supplied, the variable is set to the value read,
- less any terminating newline.
-
-################################################################################
-# Tunload DRemove all modules from memory
-
- unload
-
- This command removes any kernel and all loaded modules from memory.
-
-################################################################################
-# Tunset DUnset a variable
-
- unset <variable name>
-
- If allowed, the named variable's value is discarded and the variable
- is removed.
-
-################################################################################
diff --git a/sys/boot/common/interp.c b/sys/boot/common/interp.c
index 22d2199beebc..d24ed6e3182a 100644
--- a/sys/boot/common/interp.c
+++ b/sys/boot/common/interp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: interp.c,v 1.11 1999/01/13 21:59:58 abial Exp $
+ * $Id: interp.c,v 1.5 1998/10/07 02:38:26 msmith Exp $
*/
/*
* Simple commandline interpreter, toplevel and misc.
@@ -35,15 +35,6 @@
#include <string.h>
#include "bootstrap.h"
-#ifdef BOOT_FORTH
-#include "ficl.h"
-#define RETURN(x) stackPushINT32(bf_vm->pStack,!x); return(x)
-
-extern FICL_VM *bf_vm;
-#else
-#define RETURN(x) return(x)
-#endif
-
#define MAXARGS 20 /* maximum number of arguments allowed */
static void prompt(void);
@@ -51,10 +42,10 @@ static void prompt(void);
/*
* Perform the command
*/
-int
+static int
perform(int argc, char *argv[])
{
- int result;
+ int i, result;
struct bootblk_command **cmdp;
bootblk_cmd_t *cmd;
@@ -67,17 +58,17 @@ perform(int argc, char *argv[])
cmd = NULL;
result = CMD_ERROR;
- /* search the command set for the command */
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name))
- cmd = (*cmdp)->c_fn;
+ cmdp = (struct bootblk_command **)Xcommand_set.ls_items;
+ for (i = 0; i < Xcommand_set.ls_length; i++) {
+ if ((cmdp[i]->c_name != NULL) && !strcmp(argv[0], cmdp[i]->c_name))
+ cmd = cmdp[i]->c_fn;
}
if (cmd != NULL) {
result = (cmd)(argc, argv);
} else {
command_errmsg = "unknown command";
}
- RETURN(result);
+ return(result);
}
/*
@@ -87,20 +78,13 @@ void
interact(void)
{
char input[256]; /* big enough? */
-#ifndef BOOT_FORTH
int argc;
char **argv;
-#endif
-
-#ifdef BOOT_FORTH
- bf_init();
-#endif
/*
* Read our default configuration
*/
- if(source("/boot/loader.rc")!=CMD_OK)
- source("/boot/boot.conf");
+ source("/boot/boot.conf");
printf("\n");
/*
* Before interacting, we might want to autoboot.
@@ -118,9 +102,6 @@ interact(void)
input[0] = '\0';
prompt();
ngets(input, sizeof(input));
-#ifdef BOOT_FORTH
- bf_run(input);
-#else
if (!parse(&argc, &argv, input)) {
if (perform(argc, argv))
printf("%s: %s\n", argv[0], command_errmsg);
@@ -128,7 +109,6 @@ interact(void)
} else {
printf("parse error\n");
}
-#endif
}
}
@@ -147,12 +127,10 @@ static int
command_source(int argc, char *argv[])
{
int i;
- int res;
- res=CMD_OK;
- for (i = 1; (i < argc) && (res == CMD_OK); i++)
- res=source(argv[i]);
- return(res);
+ for (i = 1; i < argc; i++)
+ source(argv[i]);
+ return(CMD_OK);
}
struct sourceline
@@ -165,18 +143,18 @@ struct sourceline
struct sourceline *next;
};
-int
+void
source(char *filename)
{
struct sourceline *script, *se, *sp;
char input[256]; /* big enough? */
- int argc,res;
+ int argc;
char **argv, *cp;
int fd, flags, line;
if (((fd = open(filename, O_RDONLY)) == -1)) {
- sprintf(command_errbuf,"can't open '%s': %s\n", filename, strerror(errno));
- return(CMD_ERROR);
+ printf("can't open '%s': %s\n", filename, strerror(errno));
+ return;
}
/*
@@ -223,7 +201,6 @@ source(char *filename)
* Execute the script
*/
argv = NULL;
- res = CMD_OK;
for (sp = script; sp != NULL; sp = sp->next) {
/* print if not being quiet */
@@ -237,16 +214,13 @@ source(char *filename)
if ((argc > 0) && (perform(argc, argv) != 0)) {
/* normal command */
printf("%s: %s\n", argv[0], command_errmsg);
- if (!(sp->flags & SL_IGNOREERR)) {
- res=CMD_ERROR;
+ if (!(sp->flags & SL_IGNOREERR))
break;
- }
}
free(argv);
argv = NULL;
} else {
printf("%s line %d: parse error\n", filename, sp->line);
- res=CMD_ERROR;
break;
}
}
@@ -257,7 +231,6 @@ source(char *filename)
script = script->next;
free(se);
}
- return(res);
}
/*
diff --git a/sys/boot/common/interp_backslash.c b/sys/boot/common/interp_backslash.c
index 6de118ec63fc..8807fdaa9645 100644
--- a/sys/boot/common/interp_backslash.c
+++ b/sys/boot/common/interp_backslash.c
@@ -11,7 +11,7 @@
* Jordan K. Hubbard
* 29 August 1998
*
- * $Id: interp_backslash.c,v 1.2 1998/09/03 06:14:41 jkh Exp $
+ * $Id: interp_backslash.c,v 1.1 1998/09/01 00:41:24 msmith Exp $
*
* Routine for doing backslash elimination.
*/
@@ -52,10 +52,9 @@ backslash(char *str)
str++;
break;
- /* preserve backslashed quotes, dollar signs */
+ /* preserve backslashed quotes */
case '\'':
case '"':
- case '$':
new_str[i++] = '\\';
new_str[i++] = *str++;
break;
diff --git a/sys/boot/common/interp_forth.c b/sys/boot/common/interp_forth.c
deleted file mode 100644
index 68e09340b0ad..000000000000
--- a/sys/boot/common/interp_forth.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1998 Michael Smith <msmith@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.
- *
- * $Id: interp_forth.c,v 1.8 1998/12/22 11:41:51 abial Exp $
- */
-
-#include <string.h>
-#include <stand.h>
-#include "bootstrap.h"
-#include "ficl.h"
-
-/* #define BFORTH_DEBUG */
-
-#ifdef BFORTH_DEBUG
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
-#else
-# define DEBUG(fmt, args...)
-#endif
-
-/*
- * BootForth Interface to Ficl Forth interpreter.
- */
-
-FICL_VM *bf_vm;
-
-/*
- * Shim for taking commands from BF and passing them out to 'standard'
- * argv/argc command functions.
- */
-static void
-bf_command(FICL_VM *vm)
-{
- char *name, *line, *tail, *cp;
- int len;
- struct bootblk_command **cmdp;
- bootblk_cmd_t *cmd;
- int argc, result;
- char **argv;
-
- /* Get the name of the current word */
- name = vm->runningWord->name;
-
- /* Find our command structure */
- cmd = NULL;
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name))
- cmd = (*cmdp)->c_fn;
- }
- if (cmd == NULL)
- panic("callout for unknown command '%s'", name);
-
- /* Get remainder of invocation */
- tail = vmGetInBuf(vm);
- for (cp = tail, len = 0; *cp != 0 && *cp != '\n'; cp++, len++)
- ;
-
- line = malloc(strlen(name) + len + 2);
- strcpy(line, name);
- if (len > 0) {
- strcat(line, " ");
- strncat(line, tail, len);
- vmUpdateTib(vm, tail + len);
- }
- DEBUG("cmd '%s'", line);
-
- command_errmsg = command_errbuf;
- command_errbuf[0] = 0;
- if (!parse(&argc, &argv, line)) {
- result = (cmd)(argc, argv);
- free(argv);
- if(result != 0) {
- vmTextOut(vm,argv[0],0);
- vmTextOut(vm,": ",0);
- vmTextOut(vm,command_errmsg,1);
- }
- } else {
- vmTextOut(vm, "parse error\n", 1);
- result=1;
- }
- free(line);
- stackPushINT32(vm->pStack,!result);
-}
-
-/*
- * Initialise the Forth interpreter, create all our commands as words.
- */
-void
-bf_init(void)
-{
- struct bootblk_command **cmdp;
- int fd;
-
- ficlInitSystem(4000); /* Default dictionary ~4000 cells */
- bf_vm = ficlNewVM();
-
- /* make all commands appear as Forth words */
- SET_FOREACH(cmdp, Xcommand_set)
- ficlBuild((*cmdp)->c_name, bf_command, FW_DEFAULT);
-
- /* try to load and run init file if present */
- if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
- (void)ficlExecFD(bf_vm, fd);
- close(fd);
- }
-}
-
-/*
- * Feed a line of user input to the Forth interpreter
- */
-void
-bf_run(char *line)
-{
- int result;
-
- result = ficlExec(bf_vm, line);
- DEBUG("ficlExec '%s' = %d", line, result);
-
- if (result == VM_USEREXIT)
- panic("interpreter exit");
-}
diff --git a/sys/boot/common/interp_parse.c b/sys/boot/common/interp_parse.c
index 865c8cbc0501..ef235632bd66 100644
--- a/sys/boot/common/interp_parse.c
+++ b/sys/boot/common/interp_parse.c
@@ -11,7 +11,7 @@
* Jordan K. Hubbard
* 29 August 1998
*
- * $Id: interp_parse.c,v 1.5 1999/01/10 05:08:12 msmith Exp $
+ * $Id: interp_parse.c,v 1.3 1998/09/04 02:43:26 msmith Exp $
*
* The meat of the simple parser.
*/
@@ -100,11 +100,7 @@ parse(int *argc, char ***argv, char *str)
while (*p) {
switch (state) {
case STR:
- if ((*p == '\\') && p[1]) {
- p++;
- PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
- buf[i++] = *p++;
- } else if (isquote(*p)) {
+ if (isquote(*p)) {
quote = quote ? 0 : *p;
++p;
}
diff --git a/sys/boot/common/isapnp.c b/sys/boot/common/isapnp.c
index 865e8f683e15..cc28da6c954f 100644
--- a/sys/boot/common/isapnp.c
+++ b/sys/boot/common/isapnp.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isapnp.c,v 1.3 1998/10/21 20:07:04 msmith Exp $
+ * $Id: isapnp.c,v 1.1 1998/09/18 00:24:25 msmith Exp $
*/
/*
@@ -43,17 +43,17 @@ static void isapnp_write(int d, u_char r);
static u_char isapnp_read(int d);
static void isapnp_send_Initiation_LFSR();
static int isapnp_get_serial(u_int8_t *p);
-static int isapnp_isolation_protocol(void);
-static void isapnp_enumerate(void);
+static int isapnp_isolation_protocol(struct pnpinfo **pnplist);
+static void isapnp_enumerate(struct pnpinfo **pnplist);
/* PnP read data port */
-int isapnp_readport = 0;
+static int pnp_rd_port;
#define _PNP_ID_LEN 9
struct pnphandler isapnphandler =
{
- "ISA bus",
+ "isapnp",
isapnp_enumerate
};
@@ -68,7 +68,7 @@ static u_char
isapnp_read(int d)
{
outb (_PNP_ADDRESS, d);
- return (inb(isapnp_readport));
+ return (inb(3 | (pnp_rd_port <<2)));
}
/*
@@ -104,11 +104,11 @@ isapnp_get_serial(u_int8_t *data)
bzero(data, _PNP_ID_LEN);
outb(_PNP_ADDRESS, SERIAL_ISOLATION);
for (i = 0; i < 72; i++) {
- bit = inb(isapnp_readport) == 0x55;
+ bit = inb((pnp_rd_port << 2) | 0x3) == 0x55;
delay(250); /* Delay 250 usec */
/* Can't Short Circuit the next evaluation, so 'and' is last */
- bit = (inb(isapnp_readport) == 0xaa) && bit;
+ bit = (inb((pnp_rd_port << 2) | 0x3) == 0xaa) && bit;
delay(250); /* Delay 250 usec */
valid = valid || bit;
@@ -126,112 +126,87 @@ isapnp_get_serial(u_int8_t *data)
}
/*
- * Fills the buffer with resource info from the device.
- * Returns nonzero if the device fails to report
+ * Format a pnp id as a string in standard ISA PnP format, AAAIIRR
+ * where 'AAA' is the EISA ID, II is the product ID and RR the revision ID.
*/
-static int
-isapnp_get_resource_info(u_int8_t *buffer, int len)
+static char *
+isapnp_format(u_int8_t *data)
{
- int i, j;
- u_char temp;
-
- for (i = 0; i < len; i++) {
- outb(_PNP_ADDRESS, STATUS);
- for (j = 0; j < 100; j++) {
- if ((inb(isapnp_readport)) & 0x1)
- break;
- delay(1);
- }
- if (j == 100) {
- printf("PnP device failed to report resource data\n");
- return(1);
- }
- outb(_PNP_ADDRESS, RESOURCE_DATA);
- temp = inb(isapnp_readport);
- if (buffer != NULL)
- buffer[i] = temp;
- }
- return(0);
+ static char idbuf[8];
+ const char hextoascii[] = "0123456789abcdef";
+
+ idbuf[0] = '@' + ((data[0] & 0x7c) >> 2);
+ idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5));
+ idbuf[2] = '@' + (data[1] & 0x1f);
+ idbuf[3] = hextoascii[(data[2] >> 4)];
+ idbuf[4] = hextoascii[(data[2] & 0xf)];
+ idbuf[5] = hextoascii[(data[3] >> 4)];
+ idbuf[6] = hextoascii[(data[3] & 0xf)];
+ idbuf[7] = 0;
}
/*
- * Scan Resource Data for useful information.
- *
- * We scan the resource data for compatible device IDs and
- * identifier strings; we only take the first identifier string
- * and assume it's for the card as a whole.
- *
- * Returns 0 if the scan completed OK, nonzero on error.
+ * Try to read a compatible device ID from the current device, return
+ * 1 if we found one.
*/
+#define READ_RSC(c) {while ((isapnp_read(STATUS) & 1) == 0); (c) = isapnp_read(RESOURCE_DATA);}
static int
-isapnp_scan_resdata(struct pnpinfo *pi)
+isapnp_getid(u_int8_t *data)
{
- u_char tag, resinfo[8];
- int large_len, limit;
- char *str;
-
- limit = 1000;
- while ((limit-- > 0) && !isapnp_get_resource_info(&tag, 1)) {
- if (PNP_RES_TYPE(tag) == 0) {
- /* Small resource */
- switch (PNP_SRES_NUM(tag)) {
-
- case COMP_DEVICE_ID:
- /* Got a compatible device id resource */
- if (isapnp_get_resource_info(resinfo, PNP_SRES_LEN(tag)))
- return(1);
- pnp_addident(pi, pnp_eisaformat(resinfo));
-
- case END_TAG:
- return(0);
- break;
-
- default:
- /* Skip this resource */
- if (isapnp_get_resource_info(NULL, PNP_SRES_LEN(tag)))
- return(1);
- break;
- }
- } else {
- /* Large resource */
- if (isapnp_get_resource_info(resinfo, 2))
+ int discard, pos, len;
+ u_int8_t c, t;
+
+ discard = 0;
+ len = 0;
+ pos = 0;
+
+ for (;;) {
+ READ_RSC(c);
+ /* skipping junk? */
+ if (discard > 0) {
+ discard--;
+ continue;
+ }
+ /* copying data? */
+ if (len > 0) {
+ data[pos++] = c;
+ /* got all data? */
+ if (pos >= len)
return(1);
-
- large_len = resinfo[1];
- large_len = (large_len << 8) + resinfo[0];
-
- switch(PNP_LRES_NUM(tag)) {
-
- case ID_STRING_ANSI:
- str = malloc(large_len + 1);
- if (isapnp_get_resource_info(str, large_len)) {
- free(str);
- return(1);
- }
- str[large_len] = 0;
- if (pi->pi_desc == NULL) {
- pi->pi_desc = str;
- } else {
- free(str);
- }
- break;
-
- default:
- /* Large resource, skip it */
- if (isapnp_get_resource_info(NULL, large_len))
- return(1);
- }
}
+ /* resource type */
+ if (c & 0x80) { /* large resource, throw it away */
+ if (c == 0xff)
+ return(0); /* end of resources */
+ READ_RSC(c);
+ discard = c;
+ READ_RSC(c);
+ discard += ((int)c << 8);
+ continue;
+ }
+ /* small resource */
+ t = (c >> 3) & 0xf;
+ if (t == 0xf)
+ return(0); /* end of resources */
+ if ((t == LOG_DEVICE_ID) || (t == COMP_DEVICE_ID)) {
+ len = c & 7;
+ pos = 0;
+ continue;
+ }
+ discard = c & 7; /* unwanted small resource */
}
- return(1);
+
}
+
/*
- * Run the isolation protocol. Upon exiting, all cards are aware that
- * they should use isapnp_readport as the READ_DATA port.
+ * Run the isolation protocol. Use pnp_rd_port as the READ_DATA port
+ * value (caller should try multiple READ_DATA locations before giving
+ * up). Upon exiting, all cards are aware that they should use
+ * pnp_rd_port as the READ_DATA port.
*/
static int
-isapnp_isolation_protocol(void)
+isapnp_isolation_protocol(struct pnpinfo **pilist)
{
int csn;
struct pnpinfo *pi;
@@ -246,32 +221,30 @@ isapnp_isolation_protocol(void)
for (csn = 1; ; csn++) {
/* Wake up cards without a CSN (ie. all of them) */
isapnp_write(WAKE, 0);
- isapnp_write(SET_RD_DATA, (isapnp_readport >> 2));
+ isapnp_write(SET_RD_DATA, pnp_rd_port);
outb(_PNP_ADDRESS, SERIAL_ISOLATION);
delay(1000); /* Delay 1 msec */
if (isapnp_get_serial(cardid)) {
isapnp_write(SET_CSN, csn);
- pi = pnp_allocinfo();
+ pi = malloc(sizeof(struct pnpinfo));
+ pi->pi_next = *pilist;
+ *pilist = pi;
ndevs++;
- pnp_addident(pi, pnp_eisaformat(cardid));
/* scan the card obtaining all the identifiers it holds */
- if (isapnp_scan_resdata(pi)) {
- pnp_freeinfo(pi); /* error getting data, ignore */
- } else {
- pnp_addinfo(pi);
+ while (isapnp_getid(cardid)) {
+ printf(" %s\n", isapnp_format(cardid));
+ pnp_addident(pi, isapnp_format(cardid));
}
- } else {
+ } else
break;
- }
}
/* Move all cards to wait-for-key state */
- while (--csn > 0) {
+ while (csn >= 0) {
isapnp_send_Initiation_LFSR();
isapnp_write(WAKE, csn);
isapnp_write(CONFIG_CONTROL, 0x02);
delay(1000); /* XXX is it really necessary ? */
- csn--;
}
return(ndevs);
}
@@ -280,40 +253,17 @@ isapnp_isolation_protocol(void)
* Locate ISA-PnP devices and populate the supplied list.
*/
static void
-isapnp_enumerate(void)
+isapnp_enumerate(struct pnpinfo **pnplist)
{
- int pnp_rd_port;
-
- /* Check for I/O port access */
- if ((archsw.arch_isainb == NULL) || (archsw.arch_isaoutb == NULL))
- return;
-
- /*
- * Validate a possibly-suggested read port value. If the autoscan failed
- * last time, this will return us to autoscan mode again.
- */
- if ((isapnp_readport > 0) &&
- (((isapnp_readport < 0x203) ||
- (isapnp_readport > 0x3ff) ||
- (isapnp_readport & 0x3) != 0x3)))
- /* invalid, go look for ourselves */
- isapnp_readport = 0;
-
- if (isapnp_readport < 0) {
- /* someone is telling us there is no ISA in the system */
- return;
-
- } else if (isapnp_readport > 0) {
- /* Someone has told us where the port is/should be, or we found one last time */
- isapnp_isolation_protocol();
-
- } else {
- /* No clues, look for it ourselves */
- for (pnp_rd_port = 0x80; pnp_rd_port < 0xff; pnp_rd_port += 0x10) {
- /* Look for something, quit when we find it */
- isapnp_readport = (pnp_rd_port << 2) | 0x3;
- if (isapnp_isolation_protocol() > 0)
- break;
- }
+ int devs;
+
+ for (pnp_rd_port = 0x80; pnp_rd_port < 0xff; pnp_rd_port += 0x10) {
+
+ /* Look for something, quit when we find it */
+ if ((devs = isapnp_isolation_protocol(pnplist)) > 0)
+ break;
}
+ printf("Found %d ISA PnP devices\n", devs);
}
+
+
diff --git a/sys/boot/common/isapnp.h b/sys/boot/common/isapnp.h
index 0b3b9ec88527..6c072824867e 100644
--- a/sys/boot/common/isapnp.h
+++ b/sys/boot/common/isapnp.h
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isapnp.h,v 1.1 1998/09/18 00:24:25 msmith Exp $
+ * $Id: pnp.h,v 1.6 1998/01/10 07:41:43 kato Exp $
*/
#ifndef _I386_ISA_PNP_H_
@@ -210,12 +210,6 @@
/*** 32-bit memory accesses are at 0x76 ***/
-/* Macros to parse Resource IDs */
-#define PNP_RES_TYPE(a) (a >> 7)
-#define PNP_SRES_NUM(a) (a >> 3)
-#define PNP_SRES_LEN(a) (a & 0x07)
-#define PNP_LRES_NUM(a) (a & 0x7f)
-
/* Small Resource Item names */
#define PNP_VERSION 0x1
#define LOG_DEVICE_ID 0x2
diff --git a/sys/boot/common/load_aout.c b/sys/boot/common/load_aout.c
index 6d33ad49f367..3a5d34d15a6b 100644
--- a/sys/boot/common/load_aout.c
+++ b/sys/boot/common/load_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: load_aout.c,v 1.10 1998/10/12 09:05:12 peter Exp $
+ * $Id: load_aout.c,v 1.9 1998/10/09 23:15:39 peter Exp $
*/
#include <sys/param.h>
@@ -223,34 +223,30 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex
/* symbol table size */
ssym = addr;
- if(ehdr->a_syms!=NULL) {
- archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms));
- addr += sizeof(ehdr->a_syms);
+ archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms));
+ addr += sizeof(ehdr->a_syms);
- /* symbol table */
- printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
- if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
- return(0);
- addr += ehdr->a_syms;
-
- /* string table */
- read(fd, &ss, sizeof(ss));
- archsw.arch_copyin(&ss, addr, sizeof(ss));
- addr += sizeof(ss);
- ss -= sizeof(ss);
- printf("+0x%x+0x%x]", sizeof(ss), ss);
- if (archsw.arch_readin(fd, addr, ss) != ss)
- return(0);
- addr += ss;
-
- mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
- mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
- } else {
- printf("symbols=[none]");
- }
- printf("\n");
+ /* symbol table */
+ printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
+ if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
+ return(0);
+ addr += ehdr->a_syms;
+
+ /* string table */
+ read(fd, &ss, sizeof(ss));
+ archsw.arch_copyin(&ss, addr, sizeof(ss));
+ addr += sizeof(ss);
+ ss -= sizeof(ss);
+ printf("+0x%x+0x%x]", sizeof(ss), ss);
+ if (archsw.arch_readin(fd, addr, ss) != ss)
+ return(0);
+ printf(" \n");
+ addr += ss;
esym = addr;
+ mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
+ mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
+
return(addr - loadaddr);
}
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index ff1f50638ac8..b2b38c7800b6 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: load_elf.c,v 1.9 1998/10/17 03:06:38 peter Exp $
+ * $Id: load_elf.c,v 1.7 1998/10/15 21:56:47 dfr Exp $
*/
#include <sys/param.h>
@@ -40,7 +40,7 @@
#include "bootstrap.h"
-static int elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, Elf_Ehdr *ehdr, int kernel, caddr_t firstpage, int firstlen);
+static int elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, Elf_Ehdr *ehdr, Elf_Phdr *phdr, int kernel);
char *elf_kerneltype = "elf kernel";
char *elf_moduletype = "elf module";
@@ -54,15 +54,15 @@ int
elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
{
struct loaded_module *mp, *kmp;
- Elf_Ehdr *ehdr;
+ Elf_Ehdr ehdr;
+ Elf_Phdr *phdr;
int fd;
int err, kernel;
u_int pad;
char *s;
- caddr_t firstpage;
- int firstlen;
mp = NULL;
+ phdr = NULL;
/*
* Open the image, read and validate the ELF header
@@ -71,26 +71,21 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
return(EFTYPE);
if ((fd = open(filename, O_RDONLY)) == -1)
return(errno);
- firstpage = malloc(PAGE_SIZE);
- if (firstpage == NULL)
- return(ENOMEM);
- firstlen = read(fd, firstpage, PAGE_SIZE);
- if (firstlen <= sizeof(ehdr)) {
+ if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) {
err = EFTYPE; /* could be EIO, but may be small file */
goto oerr;
}
- ehdr = (Elf_Ehdr *)firstpage;
/* Is it ELF? */
- if (!IS_ELF(*ehdr)) {
+ if (!IS_ELF(ehdr)) {
err = EFTYPE;
goto oerr;
}
- if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
- ehdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
- ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
- ehdr->e_version != EV_CURRENT ||
- ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */
+ if (ehdr.e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
+ ehdr.e_ident[EI_DATA] != ELF_TARG_DATA ||
+ ehdr.e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
+ ehdr.e_version != EV_CURRENT ||
+ ehdr.e_machine != ELF_TARG_MACH) { /* Machine ? */
err = EFTYPE;
goto oerr;
}
@@ -100,7 +95,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
* Check to see what sort of module we are.
*/
kmp = mod_findmodule(NULL, NULL);
- if (ehdr->e_type == ET_DYN) {
+ if (ehdr.e_type == ET_DYN) {
/* Looks like a kld module */
if (kmp == NULL) {
printf("elf_loadmodule: can't load module before kernel\n");
@@ -121,7 +116,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
pad = PAGE_SIZE - pad;
dest += pad;
}
- } else if (ehdr->e_type == ET_EXEC) {
+ } else if (ehdr.e_type == ET_EXEC) {
/* Looks like a kernel */
if (kmp != NULL) {
printf("elf_loadmodule: kernel already loaded\n");
@@ -131,7 +126,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
/*
* Calculate destination address based on kernel entrypoint
*/
- dest = (vm_offset_t) ehdr->e_entry;
+ dest = (vm_offset_t) ehdr.e_entry;
if (dest == 0) {
printf("elf_loadmodule: not a kernel (maybe static binary?)\n");
err = EPERM;
@@ -169,12 +164,36 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
printf("%s ", filename);
#endif
- mp->m_size = elf_loadimage(mp, fd, dest, ehdr, kernel, firstpage, firstlen);
+ phdr = malloc(ehdr.e_phnum * sizeof(*phdr));
+ if (phdr == NULL) {
+ err = ENOMEM;
+ goto out;
+ }
+
+ if (lseek(fd, ehdr.e_phoff, SEEK_SET) == -1) {
+ printf("elf_loadexec: lseek for phdr failed\n");
+ goto ioerr;
+ }
+ if (read(fd, phdr, ehdr.e_phnum * sizeof(*phdr)) !=
+ ehdr.e_phnum * sizeof(*phdr)) {
+ printf("elf_loadmodule: cannot read program header\n");
+ goto ioerr;
+ }
+ if (lseek(fd, 0, SEEK_SET) == -1) {
+ close(fd);
+ if ((fd = open(filename, O_RDONLY)) == -1) {
+ printf("elf_loadmodule: cannot reset file position\n");
+ mod_discard(mp);
+ return errno;
+ }
+ }
+
+ mp->m_size = elf_loadimage(mp, fd, dest, &ehdr, phdr, kernel);
if (mp->m_size == 0 || mp->m_addr == 0)
goto ioerr;
/* save exec header as metadata */
- mod_addmetadata(mp, MODINFOMD_ELFHDR, sizeof(*ehdr), ehdr);
+ mod_addmetadata(mp, MODINFOMD_ELFHDR, sizeof(ehdr), &ehdr);
/* Load OK, return module pointer */
*result = (struct loaded_module *)mp;
@@ -186,8 +205,8 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
oerr:
mod_discard(mp);
out:
- if (firstpage)
- free(firstpage);
+ if (phdr)
+ free(phdr);
close(fd);
return(err);
}
@@ -198,10 +217,9 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
*/
static int
elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
- Elf_Ehdr *ehdr, int kernel, caddr_t firstpage, int firstlen)
+ Elf_Ehdr *ehdr, Elf_Phdr *phdr, int kernel)
{
int i, j;
- Elf_Phdr *phdr;
Elf_Shdr *shdr;
int ret;
vm_offset_t firstaddr;
@@ -221,7 +239,6 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
int symstrindex;
int symtabindex;
long size;
- int fpcopy;
dp = NULL;
shdr = NULL;
@@ -235,12 +252,6 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
#endif
}
- if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > firstlen) {
- printf("elf_loadimage: program header not within first page\n");
- goto out;
- }
- phdr = (Elf_Phdr *)(firstpage + ehdr->e_phoff);
-
for (i = 0; i < ehdr->e_phnum; i++) {
/* We want to load PT_LOAD segments only.. */
if (phdr[i].p_type != PT_LOAD)
@@ -261,22 +272,15 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
printf(" ");
}
#endif
- fpcopy = 0;
- if (firstlen > phdr[i].p_offset) {
- fpcopy = firstlen - phdr[i].p_offset;
- archsw.arch_copyin(firstpage + phdr[i].p_offset,
- phdr[i].p_vaddr + off, fpcopy);
+
+ if (lseek(fd, phdr[i].p_offset, SEEK_SET) == -1) {
+ printf("\nelf_loadexec: cannot seek\n");
+ goto out;
}
- if (phdr[i].p_filesz > fpcopy) {
- if (lseek(fd, phdr[i].p_offset + fpcopy, SEEK_SET) == -1) {
- printf("\nelf_loadexec: cannot seek\n");
- goto out;
- }
- if (archsw.arch_readin(fd, phdr[i].p_vaddr + off + fpcopy,
- phdr[i].p_filesz - fpcopy) != phdr[i].p_filesz - fpcopy) {
- printf("\nelf_loadexec: archsw.readin failed\n");
- goto out;
- }
+ if (archsw.arch_readin(fd, phdr[i].p_vaddr + off, phdr[i].p_filesz) !=
+ phdr[i].p_filesz) {
+ printf("\nelf_loadexec: archsw.readin failed\n");
+ goto out;
}
/* clear space from oversized segments; eg: bss */
if (phdr[i].p_filesz < phdr[i].p_memsz) {
@@ -323,11 +327,11 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
if (shdr == NULL)
goto nosyms;
if (lseek(fd, ehdr->e_shoff, SEEK_SET) == -1) {
- printf("\nelf_loadimage: cannot lseek() to section headers");
+ printf("\nelf_loadimage: cannot lseek() to section headers\n");
goto nosyms;
}
if (read(fd, shdr, chunk) != chunk) {
- printf("\nelf_loadimage: read section headers failed");
+ printf("\nelf_loadimage: read section headers failed\n");
goto nosyms;
}
symtabindex = -1;
@@ -382,7 +386,7 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
lastaddr += sizeof(long);
#ifdef ELF_VERBOSE
- printf("\n%s: 0x%lx@0x%lx -> 0x%lx-0x%lx", secname,
+ printf("%s: 0x%lx@0x%lx -> 0x%lx-0x%lx\n", secname,
shdr[i].sh_size, shdr[i].sh_offset,
lastaddr, lastaddr + shdr[i].sh_size);
#else
@@ -392,14 +396,14 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
#endif
if (lseek(fd, shdr[i].sh_offset, SEEK_SET) == -1) {
- printf("\nelf_loadimage: could not seek for symbols - skipped!");
+ printf("\nelf_loadimage: could not seek for symbols - skipped!\n");
lastaddr = ssym;
ssym = 0;
goto nosyms;
}
if (archsw.arch_readin(fd, lastaddr, shdr[i].sh_size) !=
shdr[i].sh_size) {
- printf("\nelf_loadimage: could not read symbols - skipped!");
+ printf("\nelf_loadimage: could not read symbols - skipped!\n");
lastaddr = ssym;
ssym = 0;
goto nosyms;
@@ -414,14 +418,13 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
}
esym = lastaddr;
#ifndef ELF_VERBOSE
- printf("]");
+ printf("]\n");
#endif
mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
nosyms:
- printf("\n");
ret = lastaddr - firstaddr;
mp->m_addr = firstaddr;
diff --git a/sys/boot/common/ls.c b/sys/boot/common/ls.c
index 73f805700bf8..493482a7b300 100644
--- a/sys/boot/common/ls.c
+++ b/sys/boot/common/ls.c
@@ -1,5 +1,5 @@
/*
- * $Id: ls.c,v 1.6 1998/10/11 10:28:51 peter Exp $
+ * $Id: ls.c,v 1.5 1998/10/09 07:09:22 msmith Exp $
* From: $NetBSD: ls.c,v 1.3 1997/06/13 13:48:47 drochner Exp $
*/
@@ -70,7 +70,6 @@ command_ls(int argc, char *argv[])
fd = -1;
verbose = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "l")) != -1) {
switch(ch) {
case 'l':
diff --git a/sys/boot/common/merge_help.awk b/sys/boot/common/merge_help.awk
deleted file mode 100644
index 1376c53aee3c..000000000000
--- a/sys/boot/common/merge_help.awk
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/awk -f
-#
-# $Id: mergehelp.awk,v 1.3 1999/01/13 20:06:52 jabley Exp $
-#
-# Merge two boot loader help files for FreeBSD 3.0
-# Joe Abley <jabley@patho.gen.nz>
-
-BEGIN \
-{
- state = 0;
- first = 0;
- ind = 0;
-}
-
-# beginning of first command
-/^###/ && (state == 0) \
-{
- state = 1;
- next;
-}
-
-# entry header
-/^# T[[:graph:]]+ (S[[:graph:]]+ )*D[[:graph:]][[:print:]]*$/ && (state == 1) \
-{
- match($0, " T[[:graph:]]+");
- T = substr($0, RSTART + 2, RLENGTH - 2);
- match($0, " S[[:graph:]]+");
- S = (RLENGTH == -1) ? "" : substr($0, RSTART + 2, RLENGTH - 2);
- match($0, " D[[:graph:]][[:print:]]*$");
- D = substr($0, RSTART + 2);
-
- # find a suitable place to store this one...
- ind++;
- if (ind == 1)
- {
- first = ind;
- help[ind, "T"] = T;
- help[ind, "S"] = S;
- help[ind, "link"] = -1;
- } else {
- i = first; j = -1;
- while (help[i, "T"] help[i, "S"] < T S)
- {
- j = i;
- i = help[i, "link"];
- if (i == -1) break;
- }
-
- if (i == -1)
- {
- help[j, "link"] = ind;
- help[ind, "link"] = -1;
- } else {
- help[ind, "link"] = i;
- if (j == -1)
- first = ind;
- else
- help[j, "link"] = ind;
- }
- }
- help[ind, "T"] = T;
- help[ind, "S"] = S;
- help[ind, "D"] = D;
-
- # set our state
- state = 2;
- help[ind, "text"] = 0;
- next;
-}
-
-# end of last command, beginning of next one
-/^###/ && (state == 2) \
-{
- state = 1;
-}
-
-(state == 2) \
-{
- sub("[[:blank:]]+$", "");
- if (help[ind, "text"] == 0 && $0 ~ /^[[:blank:]]*$/) next;
- help[ind, "text", help[ind, "text"]] = $0;
- help[ind, "text"]++;
- next;
-}
-
-# show them what we have (it's already sorted in help[])
-END \
-{
- node = first;
- while (node != -1)
- {
- printf "################################################################################\n";
- printf "# T%s ", help[node, "T"];
- if (help[node, "S"] != "") printf "S%s ", help[node, "S"];
- printf "D%s\n\n", help[node, "D"];
- for (i = 0; i < help[node, "text"]; i++)
- printf "%s\n", help[node, "text", i];
- node = help[node, "link"];
- }
- printf "################################################################################\n";
-}
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c
index 141a8ed32f66..5b0d547af069 100644
--- a/sys/boot/common/module.c
+++ b/sys/boot/common/module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.c,v 1.6 1998/10/09 23:12:34 peter Exp $
+ * $Id: module.c,v 1.5 1998/09/26 10:51:38 dfr Exp $
*/
/*
@@ -72,7 +72,6 @@ command_load(int argc, char *argv[])
dofile = 0;
optind = 1;
- optreset = 1;
typestr = NULL;
while ((ch = getopt(argc, argv, "t:")) != -1) {
switch(ch) {
@@ -134,7 +133,6 @@ command_lsmod(int argc, char *argv[])
verbose = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "v")) != -1) {
switch(ch) {
case 'v':
diff --git a/sys/boot/common/pnp.c b/sys/boot/common/pnp.c
index 74853154ffe7..4a8ee48d5bd4 100644
--- a/sys/boot/common/pnp.c
+++ b/sys/boot/common/pnp.c
@@ -13,10 +13,9 @@
#include <string.h>
#include <bootstrap.h>
-STAILQ_HEAD(,pnpinfo) pnp_devices;
-static int pnp_devices_initted = 0;
+static struct pnpinfo *pnp_devices = NULL;
-static void pnp_discard(void);
+static void pnp_discard(struct pnpinfo **list);
static int pnp_readconf(char *path);
static int pnp_scankernel(void);
@@ -29,56 +28,15 @@ COMMAND_SET(pnpscan, "pnpscan", "scan for PnP devices", pnp_scan);
int
pnp_scan(int argc, char *argv[])
{
- struct pnpinfo *pi;
int hdlr;
- int verbose;
- int ch;
-
- if (pnp_devices_initted == 0) {
- STAILQ_INIT(&pnp_devices);
- pnp_devices_initted = 1;
- }
-
- verbose = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "v")) != -1) {
- switch(ch) {
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
- }
- }
/* forget anything we think we knew */
- pnp_discard();
-
- if (verbose)
- pager_open();
+ pnp_discard(&pnp_devices);
/* iterate over all of the handlers */
for (hdlr = 0; pnphandlers[hdlr] != NULL; hdlr++) {
- if (verbose) {
- pager_output("Probing ");
- pager_output(pnphandlers[hdlr]->pp_name);
- pager_output("...\n");
- }
- pnphandlers[hdlr]->pp_enumerate();
- }
- if (verbose) {
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
- pager_output(pi->pi_ident.stqh_first->id_ident); /* first ident should be canonical */
- if (pi->pi_desc != NULL) {
- pager_output(" : ");
- pager_output(pi->pi_desc);
- }
- pager_output("\n");
- }
- pager_close();
+ printf("Probing bus '%s'...\n", pnphandlers[hdlr]->pp_name);
+ pnphandlers[hdlr]->pp_enumerate(&pnp_devices);
}
return(CMD_OK);
}
@@ -93,7 +51,7 @@ pnp_reload(char *fname)
char *modfname;
/* find anything? */
- if (pnp_devices.stqh_first != NULL) {
+ if (pnp_devices != NULL) {
/* check for kernel, assign modules handled by static drivers there */
if (pnp_scankernel()) {
@@ -112,13 +70,13 @@ pnp_reload(char *fname)
}
/* try to load any modules that have been nominated */
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
+ for (pi = pnp_devices; pi != NULL; pi = pi->pi_next) {
/* Already loaded? */
if ((pi->pi_module != NULL) && (mod_findmodule(pi->pi_module, NULL) == NULL)) {
- modfname = malloc(strlen(pi->pi_module) + 4);
+ modfname = malloc(strlen(pi->pi_module + 3));
sprintf(modfname, "%s.ko", pi->pi_module); /* XXX implicit knowledge of KLD module filenames */
if (mod_load(pi->pi_module, pi->pi_argc, pi->pi_argv))
- printf("Could not load module '%s' for device '%s'\n", modfname, pi->pi_ident.stqh_first->id_ident);
+ printf("Could not load module '%s' for device '%s'\n", modfname, pi->pi_ident->id_ident);
free(modfname);
}
}
@@ -130,14 +88,24 @@ pnp_reload(char *fname)
* Throw away anything we think we know about PnP devices on (list)
*/
static void
-pnp_discard(void)
+pnp_discard(struct pnpinfo **list)
{
struct pnpinfo *pi;
-
- while (pnp_devices.stqh_first != NULL) {
- pi = pnp_devices.stqh_first;
- STAILQ_REMOVE_HEAD(&pnp_devices, pi_link);
- pnp_freeinfo(pi);
+ struct pnpident *id;
+
+ while (*list != NULL) {
+ pi = *list;
+ *list = (*list)->pi_next;
+ while (pi->pi_ident) {
+ id = pi->pi_ident;
+ pi->pi_ident = pi->pi_ident->id_next;
+ free(id);
+ }
+ if (pi->pi_module)
+ free(pi->pi_module);
+ if (pi->pi_argv)
+ free(pi->pi_argv);
+ free(pi);
}
}
@@ -258,14 +226,14 @@ pnp_readconf(char *path)
* assigned.
* XXX no revision parse/test here yet.
*/
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
+ for (pi = pnp_devices; pi != NULL; pi = pi->pi_next) {
/* no driver assigned, bus matches OK */
if ((pi->pi_module == NULL) &&
!strcmp(pi->pi_handler->pp_name, currbus)) {
/* scan idents, take first match */
- for (id = pi->pi_ident.stqh_first; id != NULL; id = id->id_link.stqe_next)
+ for (id = pi->pi_ident; id != NULL; id = id->id_next)
if (!strcmp(id->id_ident, ident))
break;
@@ -299,82 +267,19 @@ pnp_scankernel(void)
void
pnp_addident(struct pnpinfo *pi, char *ident)
{
- struct pnpident *id;
-
- for (id = pi->pi_ident.stqh_first; id != NULL; id = id->id_link.stqe_next)
- if (!strcmp(id->id_ident, ident))
- return; /* already have this one */
-
- id = malloc(sizeof(struct pnpident));
- id->id_ident = strdup(ident);
- STAILQ_INSERT_TAIL(&pi->pi_ident, id, id_link);
-}
-
-/*
- * Allocate a new pnpinfo struct
- */
-struct pnpinfo *
-pnp_allocinfo(void)
-{
- struct pnpinfo *pi;
+ struct pnpident *id, **idp;
- pi = malloc(sizeof(struct pnpinfo));
- bzero(pi, sizeof(struct pnpinfo));
- STAILQ_INIT(&pi->pi_ident);
- return(pi);
-}
-
-/*
- * Release storage held by a pnpinfo struct
- */
-void
-pnp_freeinfo(struct pnpinfo *pi)
-{
- struct pnpident *id;
-
- while (pi->pi_ident.stqh_first != NULL) {
- id = pi->pi_ident.stqh_first;
- STAILQ_REMOVE_HEAD(&pi->pi_ident, id_link);
- free(id->id_ident);
- free(id);
+ if (pi->pi_ident == NULL) {
+ idp = &(pi->pi_ident);
+ } else {
+ for (id = pi->pi_ident; id->id_next != NULL; id = id->id_next)
+ if (!strcmp(id->id_ident, ident))
+ return; /* already have this one */
+ ;
+ idp = &(id->id_next);
}
- if (pi->pi_desc)
- free(pi->pi_desc);
- if (pi->pi_module)
- free(pi->pi_module);
- if (pi->pi_argv)
- free(pi->pi_argv);
- free(pi);
-}
-
-/*
- * Add a new pnpinfo struct to the list.
- */
-void
-pnp_addinfo(struct pnpinfo *pi)
-{
- STAILQ_INSERT_TAIL(&pnp_devices, pi, pi_link);
-}
-
-
-/*
- * Format an EISA id as a string in standard ISA PnP format, AAAIIRR
- * where 'AAA' is the EISA vendor ID, II is the product ID and RR the revision ID.
- */
-char *
-pnp_eisaformat(u_int8_t *data)
-{
- static char idbuf[8];
- const char hextoascii[] = "0123456789abcdef";
-
- idbuf[0] = '@' + ((data[0] & 0x7c) >> 2);
- idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5));
- idbuf[2] = '@' + (data[1] & 0x1f);
- idbuf[3] = hextoascii[(data[2] >> 4)];
- idbuf[4] = hextoascii[(data[2] & 0xf)];
- idbuf[5] = hextoascii[(data[3] >> 4)];
- idbuf[6] = hextoascii[(data[3] & 0xf)];
- idbuf[7] = 0;
- return(idbuf);
+ *idp = malloc(sizeof(struct pnpident));
+ (*idp)->id_next = NULL;
+ (*idp)->id_ident = strdup(ident);
}
diff --git a/sys/boot/common/pnpdata b/sys/boot/common/pnpdata
deleted file mode 100644
index 62d35a819386..000000000000
--- a/sys/boot/common/pnpdata
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-# $Id$
-#
-# This file contains the system default Plug-and-Play data. It is
-# derived from a number of sources, including:
-#
-# - The Microsoft "Windows Generic Device IDs" document
-#
-
-[pci]
-######################################################################
-# PCI devices.
-#
-# Required attributes:
-#
-# ident= PCI identifier in the form 0xDDDDVVVV where
-# 'VVVV' is the 4-digit hex form of the vendor ID and
-# 'DDDD' is the 4-digit hex form of the device ID.
-# or
-#
-# vendor= 0xVVVV where 'VVVV' is above
-# name= Vendor name
-
-vendor=0x8086 name=Intel
-
-
-[isa]
-######################################################################
-# ISA PnP devices
-#
-# Required attributes:
-#
-# ident= ISA PnP identifier in the form AAAIIRR where
-# 'AAA' is the EISA vendor ID, 'II' is the device ID
-# and 'RR' is the revision ID.
-# or
-#
-# vendor= AAA to register just a vendor name.
-# name= Vendor name
-#
-# Optional attributes:
-#
-# module= Support module identifier.
-#
-# args= Arguments to pass to the support module.
-#
-
-vendor=CSC name=Crystal Semiconductor
-vendor=CTL name=Creative Labs
-vendor=PNP name=Generic
-
-# From "Windows Generic Device IDs"
-#
-# --Parallel Devices--
-ident=PNP0400 module=lpt # Standard LPT printer port
-ident=PNP0401 module=lpt # ECP printer port
-
-# --Serial Devices--
-ident=PNP0500 module=sio # Standard PC COM port
-ident=PNP0501 module=sio # 16550A-compatible COM port
-ident=PNP0502 module=sio # Multiport serial device (non-intelligent 16550)
-
-# --Disk Controllers--
-ident=PNP0600 module=wd # Generic ESDI/IDE/ATA compatible hard disk controller
-ident=PNP0603 module=wd # Generic IDE supporting Microsoft Device Bay Specification
-ident=PNP0700 module=fd # PC standard floppy disk controller
-ident=PNP0701 module=fd # Standard floppy controller supporting MS Device Bay Spec
-
-# --Peripheral Buses--
-ident=PNP0A00 module=isa # ISA Bus
-ident=PNP0A01 module=eisa # EISA Bus
-ident=PNP0A03 module=pci # PCI Bus
-ident=PNP0A04 module=isa # VESA/VL Bus
-
-# -- Real Time Clock, BIOS, System board devices--
-ident=PNP0C04 module=npx # Math Coprocessor
-ident=PNP0C05 module=apm # APM BIOS (Version independent)
-
-# --PCMCIA Controller Chipsets--
-ident=PNP0E00 module=pcic # Intel 82365-Compatible PCMCIA Controller
-ident=PNP0E01 module=pcic # Cirrus Logic CL-PD6720 PCMCIA Controller
-ident=PNP0E02 module=pcic # VLSI VL82C146 PCMCIA Controller
-ident=PNP0E03 module=pcic # Intel 82365-compatible CardBus controller
-
-# --Network Adapters--
-ident=PNP8001 module=ed # Novell/Anthem NE3200
-ident=PNP8004 # Compaq NE3200
-ident=PNP80d3 module=ed # Novell/Anthem NE1000
-ident=PNP80d4 module=ed # Novell/Anthem NE2000
-ident=PNP80d5 module=ed # NE1000 Compatible
-ident=PNP80d6 module=ed # NE2000 Compatible
-ident=PNP80d8 module=lnc # Novell/Anthem NE2100
-ident=PNP80e9 module=le # DEC (DE200) EtherWorks Turbo
-ident=PNP80eb module=le # DEC (DE201) EtherWorks Turbo/TP
-ident=PNP80ec module=le # DEC (DE202) EtherWorks Turbo/TP_BNC
-ident=PNP80f1 module=eg # 3Com EtherLink Plus
-ident=PNP80f3 module=ed # 3Com EtherLink II or IITP (8 or 16-bit)
-ident=PNP80f6 module=ed # 3Com EtherLink 16
-ident=PNP80f7 module=ep # 3Com EtherLink III
-ident=PNP80f8 module=ep # 3Com Generic Etherlink Plug and Play Device
-ident=PNP8123 module=ed # SMC StarCard PLUS (WD/8003S)
-ident=PNP8124 module=ed # SMC StarCard PLUS With On Board Hub (WD/8003SH)
-ident=PNP8125 module=ed # SMC EtherCard PLUS (WD/8003E)
-ident=PNP8126 module=ed # SMC EtherCard PLUS With Boot ROM Socket (WD/8003EBT)
-ident=PNP8127 module=ed # SMC EtherCard PLUS With Boot ROM Socket (WD/8003EB)
-ident=PNP8128 module=ed # SMC EtherCard PLUS TP (WD/8003WT)
-ident=PNP812a module=ed # SMC EtherCard PLUS 16 With Boot ROM Socket (WD/8013EBT)
-ident=PNP812d module=ie # Intel EtherExpress 16 or 16TP
-ident=PNP8137 module=ed # Artisoft AE-1
-ident=PNP8138 module=ed # Artisoft AE-2 or AE-3
-ident=PNP8158 module=ed # HP PC LAN Adapter/16 TP Plus (HP27247B)
-ident=PNP8159 module=ed # HP PC LAN Adapter/16 TL Plus (HP27252)
-ident=PNP81c3 module=ed # SMC EtherCard PLUS Elite (WD/8003EP)
-ident=PNP81c4 module=ed # SMC EtherCard PLUS 10T (WD/8003W)
-ident=PNP81c5 module=ed # SMC EtherCard PLUS Elite 16 (WD/8013EP)
-ident=PNP81c6 module=ed # SMC EtherCard PLUS Elite 16T (WD/8013W)
-ident=PNP81c7 module=ed # SMC EtherCard PLUS Elite 16 Combo (WD/8013EW or 8013EWC)
-ident=PNP81c8 module=ed # SMC EtherElite Ultra 16
-ident=PNP820a module=ed # Zenith Data Systems NE2000-Compatible
-ident=PNP8231 module=lnc # Advanced Micro Devices AM2100/AM1500T
-ident=PNP828C module=lnc # AMD PCNet Family cards
-ident=PNP828D module=lnc # AMD PCNet32 (VL version)
-ident=PNP8323 module=ed # SMC EtherCard (All Types except 8013/A)
-ident=PNP8390 module=ed # Generic network adapter
-
-# --SCSI, Proprietary CD Adapters--
-ident=PNPA003 module=matcd # Panasonic proprietary CD-ROM adapter (SBPro/SB16)
-ident=PNPA02B module=scd # Sony proprietary CD-ROM controller
-ident=PNPA030 module=mcd # Mitsumi LU-005 Single Speed CD-ROM controller + drive
-ident=PNPA031 module=mcd # Mitsumi FX-001 Single Speed CD-ROM controller + drive
-ident=PNPA032 module=mcd # Mitsumi FX-001 Double Speed CD-ROM controller + drive
-
-# --Sound/Video-capture, multimedia--
-ident=PNPB000 module=pcm # Sound Blaster 1.5 sound device
-ident=PNPB001 module=pcm # Sound Blaster 2.0 sound device
-ident=PNPB002 module=pcm # Sound Blaster Pro sound device
-ident=PNPB003 module=pcm # Sound Blaster 16 sound device
-ident=PNPB007 module=pcm # Microsoft Windows Sound System-compatible sound device
-ident=PNPB009 module=pcm # Plug and Play Microsoft Windows Sound System Device
-ident=PNPB020 module=pcm # Yamaha OPL3-compatible FM synthesizer device
-ident=PNPB02F module=joy # Joystick/Game port
-
-# --Compatibility with early device ID list--
-ident=PNP0802 module=pcm # Microsoft Sound System compatible device (obsolete, use PNPB0xx instead)
-
-# --Modems--
-ident=PNPC000 module=sio # Compaq 14400 Modem (TBD)
-ident=PNPC001 module=sio # Compaq 2400/9600 Modem (TBD)
-
-# Vendor supplied IDs.
-
-# --Parallel Devices--
-
-# --Serial Devices--
-
-# --Disk Controllers--
-
-# --Peripheral Buses--
-
-# --Real Time Clock, BIOS, System board devices--
-
-# --PCMCIA Controller Chipsets--
-
-# --Network Adapters--
-ident=CSC6040 module=cs # Crystal Semiconductor CS8920
-
-# --SCSI, Proprietary CD Adapters--
-
-# --Sound/Video-capture, multimedia--
-
-# --Modems--
-
-
-
-[com]
-######################################################################
-# COM PnP devices
-#
-
-[lpt]
-######################################################################
-# LPT PnP devices
-#
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
deleted file mode 100644
index 260254e316a1..000000000000
--- a/sys/boot/ficl/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# $Id: Makefile,v 1.6 1998/11/05 08:39:42 jkh Exp $
-#
-LIB= ficl
-NOPROFILE= yes
-INTERNALLIB= yes
-INTERNALSTATICLIB= yes
-BASE_SRCS= dict.c ficl.c math64.c stack.c sysdep.c vm.c words.c
-SRCS= ${BASE_SRCS} softcore.c
-CLEANFILES= softcore.c testmain
-
-# Standard softwords
-SOFTWORDS= softcore.fr jhlocal.fr marker.fr
-# Optional OO extension softwords
-#SOFTWORDS+= oo.fr classes.fr
-
-.PATH: ${.CURDIR}/softwords
-CFLAGS+= -I${.CURDIR}
-
-softcore.c: ${SOFTWORDS} softcore.awk
- (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} | awk -f softcore.awk) > ${.TARGET}
-
-.include <bsd.lib.mk>
-
-testmain: ${.CURDIR}/testmain.c ${SRCS}
- @for i in ${BASE_SRCS}; do echo $${i}... ; \
- ${CC} -c ${CFLAGS} -DTESTMAIN ${.CURDIR}/$${i}; done
- @echo softdep.c...
- @${CC} -c ${CFLAGS} -D_TESTMAIN softcore.c
- cc -o ${.TARGET} ${.CURDIR}/testmain.c ${OBJS}
-
diff --git a/sys/boot/ficl/dict.c b/sys/boot/ficl/dict.c
deleted file mode 100644
index 640a2fddc1ad..000000000000
--- a/sys/boot/ficl/dict.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/*******************************************************************
-** d i c t . c
-** Forth Inspired Command Language - dictionary methods
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This file implements the dictionary -- FICL's model of
-** memory management. All FICL words are stored in the
-** dictionary. A word is a named chunk of data with its
-** associated code. FICL treats all words the same, even
-** precompiled ones, so your words become first-class
-** extensions of the language. You can even define new
-** control structures.
-**
-** 29 jun 1998 (sadler) added variable sized hash table support
-*/
-
-#ifdef TESTMAIN
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-
-static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
-
-/**************************************************************************
- d i c t A b o r t D e f i n i t i o n
-** Abort a definition in process: reclaim its memory and unlink it
-** from the dictionary list. Assumes that there is a smudged
-** definition in process...otherwise does nothing.
-** NOTE: this function is not smart enough to unlink a word that
-** has been successfully defined (ie linked into a hash). It
-** only works for defs in process. If the def has been unsmudged,
-** nothing happens.
-**************************************************************************/
-void dictAbortDefinition(FICL_DICT *pDict)
-{
- FICL_WORD *pFW;
- ficlLockDictionary(TRUE);
- pFW = pDict->smudge;
-
- if (pFW->flags & FW_SMUDGE)
- pDict->here = (CELL *)pFW->name;
-
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- a l i g n P t r
-** Aligns the given pointer to FICL_ALIGN address units.
-** Returns the aligned pointer value.
-**************************************************************************/
-void *alignPtr(void *ptr)
-{
-#if FICL_ALIGN > 0
- char *cp;
- CELL c;
- cp = (char *)ptr + FICL_ALIGN_ADD;
- c.p = (void *)cp;
- c.u = c.u & (~FICL_ALIGN_ADD);
- ptr = (CELL *)c.p;
-#endif
- return ptr;
-}
-
-
-/**************************************************************************
- d i c t A l i g n
-** Align the dictionary's free space pointer
-**************************************************************************/
-void dictAlign(FICL_DICT *pDict)
-{
- pDict->here = alignPtr(pDict->here);
-}
-
-
-/**************************************************************************
- d i c t A l l o t
-** Allocate or remove n chars of dictionary space, with
-** checks for underrun and overrun
-**************************************************************************/
-int dictAllot(FICL_DICT *pDict, int n)
-{
- char *cp = (char *)pDict->here;
-#if FICL_ROBUST
- if (n > 0)
- {
- if ((unsigned)n <= dictCellsAvail(pDict) * sizeof (CELL))
- cp += n;
- else
- return 1; /* dict is full */
- }
- else
- {
- n = -n;
- if ((unsigned)n <= dictCellsUsed(pDict) * sizeof (CELL))
- cp -= n;
- else /* prevent underflow */
- cp -= dictCellsUsed(pDict) * sizeof (CELL);
- }
-#else
- cp += n;
-#endif
- pDict->here = PTRtoCELL cp;
- return 0;
-}
-
-
-/**************************************************************************
- d i c t A l l o t C e l l s
-** Reserve space for the requested number of cells in the
-** dictionary. If nCells < 0 , removes space from the dictionary.
-**************************************************************************/
-int dictAllotCells(FICL_DICT *pDict, int nCells)
-{
-#if FICL_ROBUST
- if (nCells > 0)
- {
- if (nCells <= dictCellsAvail(pDict))
- pDict->here += nCells;
- else
- return 1; /* dict is full */
- }
- else
- {
- nCells = -nCells;
- if (nCells <= dictCellsUsed(pDict))
- pDict->here -= nCells;
- else /* prevent underflow */
- pDict->here -= dictCellsUsed(pDict);
- }
-#else
- pDict->here += nCells;
-#endif
- return 0;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d C e l l
-** Append the specified cell to the dictionary
-**************************************************************************/
-void dictAppendCell(FICL_DICT *pDict, CELL c)
-{
- *pDict->here++ = c;
- return;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d C h a r
-** Append the specified char to the dictionary
-**************************************************************************/
-void dictAppendChar(FICL_DICT *pDict, char c)
-{
- char *cp = (char *)pDict->here;
- *cp++ = c;
- pDict->here = PTRtoCELL cp;
- return;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d W o r d
-** Create a new word in the dictionary with the specified
-** name, code, and flags. Name must be NULL-terminated.
-**************************************************************************/
-FICL_WORD *dictAppendWord(FICL_DICT *pDict,
- char *name,
- FICL_CODE pCode,
- UNS8 flags)
-{
- STRINGINFO si;
- SI_SETLEN(si, strlen(name));
- SI_SETPTR(si, name);
- return dictAppendWord2(pDict, si, pCode, flags);
-}
-
-
-/**************************************************************************
- d i c t A p p e n d W o r d 2
-** Create a new word in the dictionary with the specified
-** STRINGINFO, code, and flags. Does not require a NULL-terminated
-** name.
-**************************************************************************/
-FICL_WORD *dictAppendWord2(FICL_DICT *pDict,
- STRINGINFO si,
- FICL_CODE pCode,
- UNS8 flags)
-{
- FICL_COUNT len = (FICL_COUNT)SI_COUNT(si);
- char *name = SI_PTR(si);
- char *pName;
- FICL_WORD *pFW;
-
- ficlLockDictionary(TRUE);
-
- /*
- ** NOTE: dictCopyName advances "here" as a side-effect.
- ** It must execute before pFW is initialized.
- */
- pName = dictCopyName(pDict, si);
- pFW = (FICL_WORD *)pDict->here;
- pDict->smudge = pFW;
- pFW->hash = hashHashCode(si);
- pFW->code = pCode;
- pFW->flags = (UNS8)(flags | FW_SMUDGE);
- pFW->nName = (char)len;
- pFW->name = pName;
- /*
- ** Point "here" to first cell of new word's param area...
- */
- pDict->here = pFW->param;
-
- if (!(flags & FW_SMUDGE))
- dictUnsmudge(pDict);
-
- ficlLockDictionary(FALSE);
- return pFW;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d U N S 3 2
-** Append the specified UNS32 to the dictionary
-**************************************************************************/
-void dictAppendUNS32(FICL_DICT *pDict, UNS32 u)
-{
- *pDict->here++ = LVALUEtoCELL(u);
- return;
-}
-
-
-/**************************************************************************
- d i c t C e l l s A v a i l
-** Returns the number of empty cells left in the dictionary
-**************************************************************************/
-int dictCellsAvail(FICL_DICT *pDict)
-{
- return pDict->size - dictCellsUsed(pDict);
-}
-
-
-/**************************************************************************
- d i c t C e l l s U s e d
-** Returns the number of cells consumed in the dicionary
-**************************************************************************/
-int dictCellsUsed(FICL_DICT *pDict)
-{
- return pDict->here - pDict->dict;
-}
-
-
-/**************************************************************************
- d i c t C h e c k
-** Checks the dictionary for corruption and throws appropriate
-** errors
-**************************************************************************/
-void dictCheck(FICL_DICT *pDict, FICL_VM *pVM, int nCells)
-{
- if ((nCells >= 0) && (dictCellsAvail(pDict) < nCells))
- {
- vmThrowErr(pVM, "Error: dictionary full");
- }
-
- if ((nCells <= 0) && (dictCellsUsed(pDict) < -nCells))
- {
- vmThrowErr(pVM, "Error: dictionary underflow");
- }
-
- if (pDict->nLists > FICL_DEFAULT_VOCS)
- {
- dictResetSearchOrder(pDict);
- vmThrowErr(pVM, "Error: search order overflow");
- }
- else if (pDict->nLists < 0)
- {
- dictResetSearchOrder(pDict);
- vmThrowErr(pVM, "Error: search order underflow");
- }
-
- return;
-}
-
-
-/**************************************************************************
- d i c t C o p y N a m e
-** Copy up to nFICLNAME characters of the name specified by si into
-** the dictionary starting at "here", then NULL-terminate the name,
-** point "here" to the next available byte, and return the address of
-** the beginning of the name. Used by dictAppendWord.
-** N O T E S :
-** 1. "here" is guaranteed to be aligned after this operation.
-** 2. If the string has zero length, align and return "here"
-**************************************************************************/
-static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si)
-{
- char *oldCP = (char *)pDict->here;
- char *cp = oldCP;
- char *name = SI_PTR(si);
- int i = SI_COUNT(si);
-
- if (i == 0)
- {
- dictAlign(pDict);
- return (char *)pDict->here;
- }
-
- if (i > nFICLNAME)
- i = nFICLNAME;
-
- for (; i > 0; --i)
- {
- *cp++ = *name++;
- }
-
- *cp++ = '\0';
-
- pDict->here = PTRtoCELL cp;
- dictAlign(pDict);
- return oldCP;
-}
-
-
-/**************************************************************************
- d i c t C r e a t e
-** Create and initialize a dictionary with the specified number
-** of cells capacity, and no hashing (hash size == 1).
-**************************************************************************/
-FICL_DICT *dictCreate(unsigned nCells)
-{
- return dictCreateHashed(nCells, 1);
-}
-
-
-FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash)
-{
- FICL_DICT *pDict;
- size_t nAlloc;
-
- nAlloc = sizeof (FICL_DICT) + nCells * sizeof (CELL)
- + sizeof (FICL_HASH) + (nHash - 1) * sizeof (FICL_WORD *);
-
- pDict = ficlMalloc(nAlloc);
- assert(pDict);
- pDict->size = nCells;
- dictEmpty(pDict, nHash);
- return pDict;
-}
-
-
-/**************************************************************************
- d i c t D e l e t e
-** Free all memory allocated for the given dictionary
-**************************************************************************/
-void dictDelete(FICL_DICT *pDict)
-{
- assert(pDict);
- ficlFree(pDict);
- return;
-}
-
-
-/**************************************************************************
- d i c t E m p t y
-** Empty the dictionary, reset its hash table, and reset its search order.
-** Clears and (re-)creates the main hash table (pForthWords) with the
-** size specified by nHash.
-**************************************************************************/
-void dictEmpty(FICL_DICT *pDict, unsigned nHash)
-{
- FICL_HASH *pHash;
-
- pDict->here = pDict->dict;
-
- dictAlign(pDict);
- pHash = (FICL_HASH *)pDict->here;
- dictAllot(pDict,
- sizeof (FICL_HASH) + (nHash - 1) * sizeof (FICL_WORD *));
-
- pHash->size = nHash;
- hashReset(pHash);
-
- pDict->pForthWords = pHash;
- pDict->smudge = NULL;
- dictResetSearchOrder(pDict);
- return;
-}
-
-
-/**************************************************************************
- d i c t H a s h S u m m a r y
-** Calculate a figure of merit for the dictionary hash table based
-** on the average search depth for all the words in the dictionary,
-** assuming uniform distribution of target keys. The figure of merit
-** is the ratio of the total search depth for all keys in the table
-** versus a theoretical optimum that would be achieved if the keys
-** were distributed into the table as evenly as possible.
-** The figure would be worse if the hash table used an open
-** addressing scheme (i.e. collisions resolved by searching the
-** table for an empty slot) for a given size table.
-**************************************************************************/
-void dictHashSummary(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pFHash;
- FICL_WORD **pHash;
- unsigned size;
- FICL_WORD *pFW;
- unsigned i;
- int nMax = 0;
- int nWords = 0;
- int nFilled;
- double avg = 0.0;
- double best;
- int nAvg, nRem, nDepth;
-
- dictCheck(dp, pVM, 0);
-
- pFHash = dp->pSearch[dp->nLists - 1];
- pHash = pFHash->table;
- size = pFHash->size;
- nFilled = size;
-
- for (i = 0; i < size; i++)
- {
- int n = 0;
- pFW = pHash[i];
-
- while (pFW)
- {
- ++n;
- ++nWords;
- pFW = pFW->link;
- }
-
- avg += (double)(n * (n+1)) / 2.0;
-
- if (n > nMax)
- nMax = n;
- if (n == 0)
- --nFilled;
- }
-
- /* Calc actual avg search depth for this hash */
- avg = avg / nWords;
-
- /* Calc best possible performance with this size hash */
- nAvg = nWords / size;
- nRem = nWords % size;
- nDepth = size * (nAvg * (nAvg+1))/2 + (nAvg+1)*nRem;
- best = (double)nDepth/nWords;
-
- sprintf(pVM->pad,
- "%d bins, %2.0f%% filled, Depth: Max=%d, Avg=%2.1f, Best=%2.1f, Score: %2.0f%%",
- size,
- (double)nFilled * 100.0 / size, nMax,
- avg,
- best,
- 100.0 * best / avg);
-
- ficlTextOut(pVM, pVM->pad, 1);
-
- return;
-}
-
-
-/**************************************************************************
- d i c t I n c l u d e s
-** Returns TRUE iff the given pointer is within the address range of
-** the dictionary.
-**************************************************************************/
-int dictIncludes(FICL_DICT *pDict, void *p)
-{
- return ((p >= (void *) &pDict->dict)
- && (p < (void *)(&pDict->dict + pDict->size))
- );
-}
-
-
-/**************************************************************************
- d i c t L o o k u p
-** Find the FICL_WORD that matches the given name and length.
-** If found, returns the word's address. Otherwise returns NULL.
-** Uses the search order list to search multiple wordlists.
-**************************************************************************/
-FICL_WORD *dictLookup(FICL_DICT *pDict, STRINGINFO si)
-{
- FICL_WORD *pFW = NULL;
- FICL_HASH *pHash;
- int i;
- UNS16 hashCode = hashHashCode(si);
-
- assert(pDict);
-
- ficlLockDictionary(1);
-
- for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
- {
- pHash = pDict->pSearch[i];
- pFW = hashLookup(pHash, si, hashCode);
- }
-
- ficlLockDictionary(0);
- return pFW;
-}
-
-
-/**************************************************************************
- d i c t L o o k u p L o c
-** Same as dictLookup, but looks in system locals dictionary first...
-** Assumes locals dictionary has only one wordlist...
-**************************************************************************/
-#if FICL_WANT_LOCALS
-FICL_WORD *dictLookupLoc(FICL_DICT *pDict, STRINGINFO si)
-{
- FICL_WORD *pFW = NULL;
- FICL_HASH *pHash = ficlGetLoc()->pForthWords;
- int i;
- UNS16 hashCode = hashHashCode(si);
-
- assert(pHash);
- assert(pDict);
-
- ficlLockDictionary(1);
- /*
- ** check the locals dict first...
- */
- pFW = hashLookup(pHash, si, hashCode);
-
- /*
- ** If no joy, (!pFW) --------------------------v
- ** iterate over the search list in the main dict
- */
- for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
- {
- pHash = pDict->pSearch[i];
- pFW = hashLookup(pHash, si, hashCode);
- }
-
- ficlLockDictionary(0);
- return pFW;
-}
-#endif
-
-
-/**************************************************************************
- d i c t R e s e t S e a r c h O r d e r
-** Initialize the dictionary search order list to sane state
-**************************************************************************/
-void dictResetSearchOrder(FICL_DICT *pDict)
-{
- assert(pDict);
- pDict->pCompile = pDict->pForthWords;
- pDict->nLists = 1;
- pDict->pSearch[0] = pDict->pForthWords;
- return;
-}
-
-
-/**************************************************************************
- d i c t S e t F l a g s
-** Changes the flags field of the most recently defined word:
-** Set all bits that are ones in the set parameter, clear all bits
-** that are ones in the clr parameter. Clear wins in case the same bit
-** is set in both parameters.
-**************************************************************************/
-void dictSetFlags(FICL_DICT *pDict, UNS8 set, UNS8 clr)
-{
- assert(pDict->smudge);
- pDict->smudge->flags |= set;
- pDict->smudge->flags &= ~clr;
- return;
-}
-
-
-/**************************************************************************
- d i c t S e t I m m e d i a t e
-** Set the most recently defined word as IMMEDIATE
-**************************************************************************/
-void dictSetImmediate(FICL_DICT *pDict)
-{
- assert(pDict->smudge);
- pDict->smudge->flags |= FW_IMMEDIATE;
- return;
-}
-
-
-/**************************************************************************
- d i c t U n s m u d g e
-** Completes the definition of a word by linking it
-** into the main list
-**************************************************************************/
-void dictUnsmudge(FICL_DICT *pDict)
-{
- FICL_WORD *pFW = pDict->smudge;
- FICL_HASH *pHash = pDict->pCompile;
-
- assert(pHash);
- assert(pFW);
- /*
- ** :noname words never get linked into the list...
- */
- if (pFW->nName > 0)
- hashInsertWord(pHash, pFW);
- pFW->flags &= ~(FW_SMUDGE);
- return;
-}
-
-
-/**************************************************************************
- d i c t W h e r e
-** Returns the value of the HERE pointer -- the address
-** of the next free cell in the dictionary
-**************************************************************************/
-CELL *dictWhere(FICL_DICT *pDict)
-{
- return pDict->here;
-}
-
-
-/**************************************************************************
- h a s h F o r g e t
-** Unlink all words in the hash that have addresses greater than or
-** equal to the address supplied. Implementation factor for FORGET
-** and MARKER.
-**************************************************************************/
-void hashForget(FICL_HASH *pHash, void *where)
-{
- FICL_WORD *pWord;
- unsigned i;
-
- assert(pHash);
- assert(where);
-
- for (i = 0; i < pHash->size; i++)
- {
- pWord = pHash->table[i];
-
- while ((void *)pWord >= where)
- {
- pWord = pWord->link;
- }
-
- pHash->table[i] = pWord;
- }
-
- return;
-}
-
-
-/**************************************************************************
- h a s h H a s h C o d e
-**
-** Generate a 16 bit hashcode from a character string using a rolling
-** shift and add stolen from PJ Weinberger of Bell Labs fame. Case folds
-** the name before hashing it...
-** N O T E : If string has zero length, returns zero.
-**************************************************************************/
-UNS16 hashHashCode(STRINGINFO si)
-{
- /* hashPJW */
- UNS8 *cp;
- UNS16 code = (UNS16)si.count;
- UNS16 shift = 0;
-
- if (si.count == 0)
- return 0;
-
- for (cp = (UNS8 *)si.cp; *cp && si.count; cp++, si.count--)
- {
- code = (UNS16)((code << 4) + tolower(*cp));
- shift = (UNS16)(code & 0xf000);
- if (shift)
- {
- code ^= (UNS16)(shift >> 8);
- code ^= (UNS16)shift;
- }
- }
-
- return (UNS16)code;
-}
-
-
-/**************************************************************************
- h a s h I n s e r t W o r d
-** Put a word into the hash table using the word's hashcode as
-** an index (modulo the table size).
-**************************************************************************/
-void hashInsertWord(FICL_HASH *pHash, FICL_WORD *pFW)
-{
- FICL_WORD **pList;
-
- assert(pHash);
- assert(pFW);
-
- if (pHash->size == 1)
- {
- pList = pHash->table;
- }
- else
- {
- pList = pHash->table + (pFW->hash % pHash->size);
- }
-
- pFW->link = *pList;
- *pList = pFW;
- return;
-}
-
-
-/**************************************************************************
- h a s h L o o k u p
-** Find a name in the hash table given the hashcode and text of the name.
-** Returns the address of the corresponding FICL_WORD if found,
-** otherwise NULL.
-** Note: outer loop on link field supports inheritance in wordlists.
-** It's not part of ANS Forth - ficl only. hashReset creates wordlists
-** with NULL link fields.
-**************************************************************************/
-FICL_WORD *hashLookup(FICL_HASH *pHash, STRINGINFO si, UNS16 hashCode)
-{
- FICL_COUNT nCmp = (FICL_COUNT)si.count;
- FICL_WORD *pFW;
- UNS16 hashIdx;
-
- if (nCmp > nFICLNAME)
- nCmp = nFICLNAME;
-
- for (; pHash != NULL; pHash = pHash->link)
- {
- if (pHash->size > 1)
- hashIdx = (UNS16)(hashCode % pHash->size);
- else /* avoid the modulo op for single threaded lists */
- hashIdx = 0;
-
- for (pFW = pHash->table[hashIdx]; pFW; pFW = pFW->link)
- {
- if ( (pFW->nName == si.count)
- && (!strincmp(si.cp, pFW->name, nCmp)) )
- return pFW;
-#if FICL_ROBUST
- assert(pFW != pFW->link);
-#endif
- }
- }
-
- return NULL;
-}
-
-
-/**************************************************************************
- h a s h R e s e t
-** Initialize a FICL_HASH to empty state.
-**************************************************************************/
-void hashReset(FICL_HASH *pHash)
-{
- unsigned i;
-
- assert(pHash);
-
- for (i = 0; i < pHash->size; i++)
- {
- pHash->table[i] = NULL;
- }
-
- pHash->link = NULL;
- return;
-}
-
-
diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c
deleted file mode 100644
index 3b5885f06e2b..000000000000
--- a/sys/boot/ficl/ficl.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************
-** f i c l . c
-** Forth Inspired Command Language - external interface
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This is an ANS Forth interpreter written in C.
-** Ficl uses Forth syntax for its commands, but turns the Forth
-** model on its head in other respects.
-** Ficl provides facilities for interoperating
-** with programs written in C: C functions can be exported to Ficl,
-** and Ficl commands can be executed via a C calling interface. The
-** interpreter is re-entrant, so it can be used in multiple instances
-** in a multitasking system. Unlike Forth, Ficl's outer interpreter
-** expects a text block as input, and returns to the caller after each
-** text block, so the data pump is somewhere in external code. This
-** is more like TCL than Forth.
-**
-** Code is written in ANSI C for portability.
-*/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-
-
-/*
-** Local prototypes
-*/
-
-
-/*
-** System statics
-** The system builds a global dictionary during its start
-** sequence. This is shared by all interpreter instances.
-** Therefore only one instance can update the dictionary
-** at a time. The system imports a locking function that
-** you can override in order to control update access to
-** the dictionary. The function is stubbed out by default,
-** but you can insert one: #define FICL_MULTITHREAD 1
-** and supply your own version of ficlLockDictionary.
-*/
-static FICL_DICT *dp = NULL;
-static FICL_DICT *envp = NULL;
-#if FICL_WANT_LOCALS
-static FICL_DICT *localp = NULL;
-#endif
-static FICL_VM *vmList = NULL;
-
-static int defaultStack = FICL_DEFAULT_STACK;
-static int defaultDict = FICL_DEFAULT_DICT;
-
-
-/**************************************************************************
- f i c l I n i t S y s t e m
-** Binds a global dictionary to the interpreter system.
-** You specify the address and size of the allocated area.
-** After that, ficl manages it.
-** First step is to set up the static pointers to the area.
-** Then write the "precompiled" portion of the dictionary in.
-** The dictionary needs to be at least large enough to hold the
-** precompiled part. Try 1K cells minimum. Use "words" to find
-** out how much of the dictionary is used at any time.
-**************************************************************************/
-void ficlInitSystem(int nDictCells)
-{
- if (dp)
- dictDelete(dp);
-
- if (envp)
- dictDelete(envp);
-
-#if FICL_WANT_LOCALS
- if (localp)
- dictDelete(localp);
-#endif
-
- if (nDictCells <= 0)
- nDictCells = defaultDict;
-
- dp = dictCreateHashed((unsigned)nDictCells, HASHSIZE);
- envp = dictCreate( (unsigned)FICL_DEFAULT_ENV);
-#if FICL_WANT_LOCALS
- /*
- ** The locals dictionary is only searched while compiling,
- ** but this is where speed is most important. On the other
- ** hand, the dictionary gets emptied after each use of locals
- ** The need to balance search speed with the cost of the empty
- ** operation led me to select a single-threaded list...
- */
- localp = dictCreate( (unsigned)FICL_MAX_LOCALS * CELLS_PER_WORD);
-#endif
-
- ficlCompileCore(dp);
-
- return;
-}
-
-
-/**************************************************************************
- f i c l N e w V M
-** Create a new virtual machine and link it into the system list
-** of VMs for later cleanup by ficlTermSystem. If this is the first
-** VM to be created, use it to compile the words in softcore.c
-**************************************************************************/
-FICL_VM *ficlNewVM(void)
-{
- FICL_VM *pVM = vmCreate(NULL, defaultStack, defaultStack);
- pVM->link = vmList;
-
- /*
- ** Borrow the first vm to build the soft words in softcore.c
- */
- if (vmList == NULL)
- ficlCompileSoftCore(pVM);
-
- vmList = pVM;
- return pVM;
-}
-
-
-/**************************************************************************
- f i c l B u i l d
-** Builds a word into the dictionary.
-** Preconditions: system must be initialized, and there must
-** be enough space for the new word's header! Operation is
-** controlled by ficlLockDictionary, so any initialization
-** required by your version of the function (if you overrode
-** it) must be complete at this point.
-** Parameters:
-** name -- duh, the name of the word
-** code -- code to execute when the word is invoked - must take a single param
-** pointer to a FICL_VM
-** flags -- 0 or more of F_IMMEDIATE, F_COMPILE, use bitwise OR!
-**
-**************************************************************************/
-int ficlBuild(char *name, FICL_CODE code, char flags)
-{
- int err = ficlLockDictionary(TRUE);
- if (err) return err;
-
- dictAppendWord(dp, name, code, flags);
-
- ficlLockDictionary(FALSE);
- return 0;
-}
-
-
-/**************************************************************************
- f i c l E x e c
-** Evaluates a block of input text in the context of the
-** specified interpreter. Emits any requested output to the
-** interpreter's output function.
-**
-** Contains the "inner interpreter" code in a tight loop
-**
-** Returns one of the VM_XXXX codes defined in ficl.h:
-** VM_OUTOFTEXT is the normal exit condition
-** VM_ERREXIT means that the interp encountered a syntax error
-** and the vm has been reset to recover (some or all
-** of the text block got ignored
-** VM_USEREXIT means that the user executed the "bye" command
-** to shut down the interpreter. This would be a good
-** time to delete the vm, etc -- or you can ignore this
-** signal.
-**************************************************************************/
-int ficlExec(FICL_VM *pVM, char *pText)
-{
- int except;
- FICL_WORD *tempFW;
- jmp_buf vmState;
- jmp_buf *oldState;
- TIB saveTib;
-
- assert(pVM);
-
- vmPushTib(pVM, pText, &saveTib);
-
- /*
- ** Save and restore VM's jmp_buf to enable nested calls to ficlExec
- */
- oldState = pVM->pState;
- pVM->pState = &vmState; /* This has to come before the setjmp! */
- except = setjmp(vmState);
-
- switch (except)
- {
- case 0:
- if (pVM->fRestart)
- {
- pVM->fRestart = 0;
- pVM->runningWord->code(pVM);
- }
-
- /*
- ** the mysterious inner interpreter...
- ** vmThrow gets you out of this loop with a longjmp()
- */
- for (;;)
- {
- tempFW = *pVM->ip++;
- /*
- ** inline code for
- ** vmExecute(pVM, tempFW);
- */
- pVM->runningWord = tempFW;
- tempFW->code(pVM);
- }
-
- break;
-
- case VM_RESTART:
- pVM->fRestart = 1;
- except = VM_OUTOFTEXT;
- break;
-
- case VM_OUTOFTEXT:
-#ifdef TESTMAIN
- if ((pVM->state != COMPILE) && (pVM->sourceID.i == 0))
- ficlTextOut(pVM, FICL_PROMPT, 0);
-#endif
- break;
-
- case VM_USEREXIT:
- break;
-
- case VM_QUIT:
- if (pVM->state == COMPILE)
- dictAbortDefinition(dp);
- vmQuit(pVM);
- break;
-
- case VM_ERREXIT:
- default: /* user defined exit code?? */
- if (pVM->state == COMPILE)
- {
- dictAbortDefinition(dp);
-#if FICL_WANT_LOCALS
- dictEmpty(localp, localp->pForthWords->size);
-#endif
- }
- dictResetSearchOrder(dp);
- vmReset(pVM);
- break;
- }
-
- pVM->pState = oldState;
- vmPopTib(pVM, &saveTib);
- return (except);
-}
-
-/**************************************************************************
- f i c l E x e c F D
-** reads in text from file fd and passes it to ficlExec()
- * returns VM_OUTOFTEXT on success or the ficlExec() error code on
- * failure.
- */
-#define nLINEBUF 256
-int ficlExecFD(FICL_VM *pVM, int fd)
-{
- char cp[nLINEBUF];
- int i, nLine = 0, rval = VM_OUTOFTEXT;
- char ch;
- CELL id;
-
- id = pVM->sourceID;
- pVM->sourceID.i = fd;
-
- /* feed each line to ficlExec */
- while (1) {
- int status, i;
-
- i = 0;
- while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
- cp[i++] = ch;
- nLine++;
- if (!i) {
- if (status < 1)
- break;
- continue;
- }
- cp[i] = '\0';
- if ((rval = ficlExec(pVM, cp)) >= VM_ERREXIT)
- {
- pVM->sourceID = id;
- vmThrowErr(pVM, "ficlExecFD: Error at line %d", nLine);
- break;
- }
- }
- /*
- ** Pass an empty line with SOURCE-ID == 0 to flush
- ** any pending REFILLs (as required by FILE wordset)
- */
- pVM->sourceID.i = -1;
- ficlExec(pVM, "");
-
- pVM->sourceID = id;
- return rval;
-}
-
-/**************************************************************************
- f i c l L o o k u p
-** Look in the system dictionary for a match to the given name. If
-** found, return the address of the corresponding FICL_WORD. Otherwise
-** return NULL.
-**************************************************************************/
-FICL_WORD *ficlLookup(char *name)
-{
- STRINGINFO si;
- SI_PSZ(si, name);
- return dictLookup(dp, si);
-}
-
-
-/**************************************************************************
- f i c l G e t D i c t
-** Returns the address of the system dictionary
-**************************************************************************/
-FICL_DICT *ficlGetDict(void)
-{
- return dp;
-}
-
-
-/**************************************************************************
- f i c l G e t E n v
-** Returns the address of the system environment space
-**************************************************************************/
-FICL_DICT *ficlGetEnv(void)
-{
- return envp;
-}
-
-
-/**************************************************************************
- f i c l S e t E n v
-** Create an environment variable with a one-CELL payload. ficlSetEnvD
-** makes one with a two-CELL payload.
-**************************************************************************/
-void ficlSetEnv(char *name, UNS32 value)
-{
- STRINGINFO si;
- FICL_WORD *pFW;
-
- SI_PSZ(si, name);
- pFW = dictLookup(envp, si);
-
- if (pFW == NULL)
- {
- dictAppendWord(envp, name, constantParen, FW_DEFAULT);
- dictAppendCell(envp, LVALUEtoCELL(value));
- }
- else
- {
- pFW->param[0] = LVALUEtoCELL(value);
- }
-
- return;
-}
-
-void ficlSetEnvD(char *name, UNS32 hi, UNS32 lo)
-{
- FICL_WORD *pFW;
- STRINGINFO si;
- SI_PSZ(si, name);
- pFW = dictLookup(envp, si);
-
- if (pFW == NULL)
- {
- dictAppendWord(envp, name, twoConstParen, FW_DEFAULT);
- dictAppendCell(envp, LVALUEtoCELL(lo));
- dictAppendCell(envp, LVALUEtoCELL(hi));
- }
- else
- {
- pFW->param[0] = LVALUEtoCELL(lo);
- pFW->param[1] = LVALUEtoCELL(hi);
- }
-
- return;
-}
-
-
-/**************************************************************************
- f i c l G e t L o c
-** Returns the address of the system locals dictionary. This dict is
-** only used during compilation, and is shared by all VMs.
-**************************************************************************/
-#if FICL_WANT_LOCALS
-FICL_DICT *ficlGetLoc(void)
-{
- return localp;
-}
-#endif
-
-
-/**************************************************************************
- f i c l T e r m S y s t e m
-** Tear the system down by deleting the dictionaries and all VMs.
-** This saves you from having to keep track of all that stuff.
-**************************************************************************/
-void ficlTermSystem(void)
-{
- if (dp)
- dictDelete(dp);
- dp = NULL;
-
- if (envp)
- dictDelete(envp);
- envp = NULL;
-
-#if FICL_WANT_LOCALS
- if (localp)
- dictDelete(localp);
- localp = NULL;
-#endif
-
- while (vmList != NULL)
- {
- FICL_VM *pVM = vmList;
- vmList = vmList->link;
- vmDelete(pVM);
- }
-
- return;
-}
diff --git a/sys/boot/ficl/ficl.h b/sys/boot/ficl/ficl.h
deleted file mode 100644
index 3fcb32efbb81..000000000000
--- a/sys/boot/ficl/ficl.h
+++ /dev/null
@@ -1,773 +0,0 @@
-/*******************************************************************
-** f i c l . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is supported on a "best effort"
-** basis only.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__FICL_H__)
-#define __FICL_H__
-/*
-** Ficl (Forth-inspired command language) is an ANS Forth
-** interpreter written in C. Unlike traditional Forths, this
-** interpreter is designed to be embedded into other systems
-** as a command/macro/development prototype language.
-**
-** Where Forths usually view themselves as the center of the system
-** and expect the rest of the system to be coded in Forth, Ficl
-** acts as a component of the system. It is easy to export
-** code written in C or ASM to Ficl in the style of TCL, or to invoke
-** Ficl code from a compiled module. This allows you to do incremental
-** development in a way that combines the best features of threaded
-** languages (rapid development, quick code/test/debug cycle,
-** reasonably fast) with the best features of C (everyone knows it,
-** easier to support large blocks of code, efficient, type checking).
-**
-** Ficl provides facilities for interoperating
-** with programs written in C: C functions can be exported to Ficl,
-** and Ficl commands can be executed via a C calling interface. The
-** interpreter is re-entrant, so it can be used in multiple instances
-** in a multitasking system. Unlike Forth, Ficl's outer interpreter
-** expects a text block as input, and returns to the caller after each
-** text block, so the "data pump" is somewhere in external code. This
-** is more like TCL than Forth, which usually expcets to be at the center
-** of the system, requesting input at its convenience. Each Ficl virtual
-** machine can be bound to a different I/O channel, and is independent
-** of all others in in the same address space except that all virtual
-** machines share a common dictionary (a sort or open symbol table that
-** defines all of the elements of the language).
-**
-** Code is written in ANSI C for portability.
-**
-** Summary of Ficl features and constraints:
-** - Standard: Implements the ANSI Forth CORE word set and part
-** of the CORE EXT word-set, SEARCH and SEARCH EXT, TOOLS and
-** TOOLS EXT, LOCAL and LOCAL ext and various extras.
-** - Extensible: you can export code written in Forth, C,
-** or asm in a straightforward way. Ficl provides open
-** facilities for extending the language in an application
-** specific way. You can even add new control structures!
-** - Ficl and C can interact in two ways: Ficl can encapsulate
-** C code, or C code can invoke Ficl code.
-** - Thread-safe, re-entrant: The shared system dictionary
-** uses a locking mechanism that you can either supply
-** or stub out to provide exclusive access. Each Ficl
-** virtual machine has an otherwise complete state, and
-** each can be bound to a separate I/O channel (or none at all).
-** - Simple encapsulation into existing systems: a basic implementation
-** requires three function calls (see the example program in testmain.c).
-** - ROMable: Ficl is designed to work in RAM-based and ROM code / RAM data
-** environments. It does require somewhat more memory than a pure
-** ROM implementation because it builds its system dictionary in
-** RAM at startup time.
-** - Written an ANSI C to be as simple as I can make it to understand,
-** support, debug, and port. Compiles without complaint at /Az /W4
-** (require ANSI C, max warnings) under Microsoft VC++ 5.
-** - Does full 32 bit math (but you need to implement
-** two mixed precision math primitives (see sysdep.c))
-** - Indirect threaded interpreter is not the fastest kind of
-** Forth there is (see pForth 68K for a really fast subroutine
-** threaded interpreter), but it's the cleanest match to a
-** pure C implementation.
-**
-** P O R T I N G F i c l
-**
-** To install Ficl on your target system, you need an ANSI C compiler
-** and its runtime library. Inspect the system dependent macros and
-** functions in sysdep.h and sysdep.c and edit them to suit your
-** system. For example, INT16 is a short on some compilers and an
-** int on others. Check the default CELL alignment controlled by
-** FICL_ALIGN. If necessary, add new definitions of ficlMalloc, ficlFree,
-** ficlLockDictionary, and ficlTextOut to work with your operating system.
-** Finally, use testmain.c as a guide to installing the Ficl system and
-** one or more virtual machines into your code. You do not need to include
-** testmain.c in your build.
-**
-** T o D o L i s t
-**
-** 1. Unimplemented system dependent CORE word: key
-** 2. Kludged CORE word: ACCEPT
-** 3. Dictionary locking is full of holes - only one vm at a time
-** can alter the dict.
-** 4. Ficl uses the pad in CORE words - this violates the standard,
-** but it's cleaner for a multithreaded system. I'll have to make a
-** second pad for reference by the word PAD to fix this.
-**
-** F o r M o r e I n f o r m a t i o n
-**
-** Web home of ficl
-** http://www.taygeta.com/forth/compilers
-** Check this website for Forth literature (including the ANSI standard)
-** http://www.taygeta.com/forthlit.html
-** and here for software and more links
-** http://www.taygeta.com/forth.html
-**
-** Obvious Performance enhancement opportunities
-** Compile speed
-** - work on interpret speed
-** - turn off locals (FICL_WANT_LOCALS)
-** Interpret speed
-** - Change inner interpreter (and everything else)
-** so that a definition is a list of pointers to functions
-** and inline data rather than pointers to words. This gets
-** rid of vm->runningWord and a level of indirection in the
-** inner loop. I'll look at it for ficl 3.0
-** - Make the main hash table a bigger prime (HASHSIZE)
-** - FORGET about twiddling the hash function - my experience is
-** that that is a waste of time.
-** - eliminate the need to pass the pVM parameter on the stack
-** by dedicating a register to it. Most words need access to the
-** vm, but the parameter passing overhead can be reduced. One way
-** requires that the host OS have a task switch callout. Create
-** a global variable for the running VM and refer to it in words
-** that need VM access. Alternative: use thread local storage.
-** For single threaded implementations, you can just use a global.
-** The first two solutions create portability problems, so I
-** haven't considered doing them. Another possibility is to
-** declare the pVm parameter to be "register", and hope the compiler
-** pays attention.
-**
-*/
-
-/*
-** Revision History:
-** 27 Aug 1998 (sadler) testing and corrections for LOCALS, LOCALS EXT,
-** SEARCH / SEARCH EXT, TOOLS / TOOLS EXT.
-** Added .X to display in hex, PARSE and PARSE-WORD to supplement WORD,
-** EMPTY to clear stack.
-**
-** 29 jun 1998 (sadler) added variable sized hash table support
-** and ANS Forth optional SEARCH & SEARCH EXT word set.
-** 26 May 1998 (sadler)
-** FICL_PROMPT macro
-** 14 April 1998 (sadler) V1.04
-** Ficlwin: Windows version, Skip Carter's Linux port
-** 5 March 1998 (sadler) V1.03
-** Bug fixes -- passes John Ryan's ANS test suite "core.fr"
-**
-** 24 February 1998 (sadler) V1.02
-** -Fixed bugs in <# # #>
-** -Changed FICL_WORD so that storage for the name characters
-** can be allocated from the dictionary as needed rather than
-** reserving 32 bytes in each word whether needed or not -
-** this saved 50% of the dictionary storage requirement.
-** -Added words in testmain for Win32 functions system,chdir,cwd,
-** also added a word that loads and evaluates a file.
-**
-** December 1997 (sadler)
-** -Added VM_RESTART exception handling in ficlExec -- this lets words
-** that require additional text to succeed (like :, create, variable...)
-** recover gracefully from an empty input buffer rather than emitting
-** an error message. Definitions can span multiple input blocks with
-** no restrictions.
-** -Changed #include order so that <assert.h> is included in sysdep.h,
-** and sysdep is included in all other files. This lets you define
-** NDEBUG in sysdep.h to disable assertions if you want to.
-** -Make PC specific system dependent code conditional on _M_IX86
-** defined so that ports can coexist in sysdep.h/sysdep.c
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "sysdep.h"
-#include <limits.h> /* UCHAR_MAX */
-
-/*
-** Forward declarations... read on.
-*/
-struct ficl_word;
-struct vm;
-struct ficl_dict;
-
-/*
-** the Good Stuff starts here...
-*/
-#define FICL_VER "2.02"
-#ifndef FICL_PROMPT
-# define FICL_PROMPT "ok> "
-#endif
-
-/*
-** ANS Forth requires false to be zero, and true to be the ones
-** complement of false... that unifies logical and bitwise operations
-** nicely.
-*/
-#define FICL_TRUE (0xffffffffL)
-#define FICL_FALSE (0)
-#define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
-
-
-/*
-** A CELL is the main storage type. It must be large enough
-** to contain a pointer or a scalar. Let's be picky and make
-** a 32 bit cell explicitly...
-*/
-typedef union _cell
-{
- INT32 i;
- UNS32 u;
- void *p;
-} CELL;
-
-/*
-** LVALUEtoCELL does a little pointer trickery to cast any 32 bit
-** lvalue (informal definition: an expression whose result has an
-** address) to CELL. Remember that constants and casts are NOT
-** themselves lvalues!
-*/
-#define LVALUEtoCELL(v) (*(CELL *)&v)
-
-/*
-** PTRtoCELL is a cast through void * intended to satisfy the
-** most outrageously pedantic compiler... (I won't mention
-** its name)
-*/
-#define PTRtoCELL (CELL *)(void *)
-#define PTRtoSTRING (FICL_STRING *)(void *)
-
-/*
-** Strings in FICL are stored in Pascal style - with a count
-** preceding the text. We'll also NULL-terminate them so that
-** they work with the usual C lib string functions. (Belt &
-** suspenders? You decide.)
-** STRINGINFO hides the implementation with a couple of
-** macros for use in internal routines.
-*/
-
-typedef unsigned char FICL_COUNT;
-#define FICL_STRING_MAX UCHAR_MAX
-typedef struct _ficl_string
-{
- FICL_COUNT count;
- char text[1];
-} FICL_STRING;
-
-typedef struct
-{
- UNS32 count;
- char *cp;
-} STRINGINFO;
-
-#define SI_COUNT(si) (si.count)
-#define SI_PTR(si) (si.cp)
-#define SI_SETLEN(si, len) (si.count = (UNS32)(len))
-#define SI_SETPTR(si, ptr) (si.cp = (char *)(ptr))
-/*
-** Init a STRINGINFO from a pointer to NULL-terminated string
-*/
-#define SI_PSZ(si, psz) \
- {si.cp = psz; si.count = (FICL_COUNT)strlen(psz);}
-/*
-** Init a STRINGINFO from a pointer to FICL_STRING
-*/
-#define SI_PFS(si, pfs) \
- {si.cp = pfs->text; si.count = pfs->count;}
-
-/*
-** Ficl uses a this little structure to hold the address of
-** the block of text it's working on and an index to the next
-** unconsumed character in the string. Traditionally, this is
-** done by a Text Input Buffer, so I've called this struct TIB.
-*/
-typedef struct
-{
- INT32 index;
- char *cp;
-} TIB;
-
-
-/*
-** Stacks get heavy use in Ficl and Forth...
-** Each virtual machine implements two of them:
-** one holds parameters (data), and the other holds return
-** addresses and control flow information for the virtual
-** machine. (Note: C's automatic stack is implicitly used,
-** but not modeled because it doesn't need to be...)
-** Here's an abstract type for a stack
-*/
-typedef struct _ficlStack
-{
- UNS32 nCells; /* size of the stack */
- CELL *pFrame; /* link reg for stack frame */
- CELL *sp; /* stack pointer */
- CELL base[1]; /* Bottom of the stack */
-} FICL_STACK;
-
-/*
-** Stack methods... many map closely to required Forth words.
-*/
-FICL_STACK *stackCreate(unsigned nCells);
-void stackDelete(FICL_STACK *pStack);
-int stackDepth (FICL_STACK *pStack);
-void stackDrop (FICL_STACK *pStack, int n);
-CELL stackFetch (FICL_STACK *pStack, int n);
-CELL stackGetTop(FICL_STACK *pStack);
-void stackLink (FICL_STACK *pStack, int nCells);
-void stackPick (FICL_STACK *pStack, int n);
-CELL stackPop (FICL_STACK *pStack);
-void *stackPopPtr (FICL_STACK *pStack);
-UNS32 stackPopUNS32 (FICL_STACK *pStack);
-INT32 stackPopINT32 (FICL_STACK *pStack);
-void stackPush (FICL_STACK *pStack, CELL c);
-void stackPushPtr (FICL_STACK *pStack, void *ptr);
-void stackPushUNS32(FICL_STACK *pStack, UNS32 u);
-void stackPushINT32(FICL_STACK *pStack, INT32 i);
-void stackReset (FICL_STACK *pStack);
-void stackRoll (FICL_STACK *pStack, int n);
-void stackSetTop(FICL_STACK *pStack, CELL c);
-void stackStore (FICL_STACK *pStack, int n, CELL c);
-void stackUnlink(FICL_STACK *pStack);
-
-/*
-** The virtual machine (VM) contains the state for one interpreter.
-** Defined operations include:
-** Create & initialize
-** Delete
-** Execute a block of text
-** Parse a word out of the input stream
-** Call return, and branch
-** Text output
-** Throw an exception
-*/
-
-typedef struct ficl_word ** IPTYPE; /* the VM's instruction pointer */
-
-/*
-** Each VM has a placeholder for an output function -
-** this makes it possible to have each VM do I/O
-** through a different device. If you specify no
-** OUTFUNC, it defaults to ficlTextOut.
-*/
-typedef void (*OUTFUNC)(struct vm *pVM, char *text, int fNewline);
-
-/*
-** Each VM operates in one of two non-error states: interpreting
-** or compiling. When interpreting, words are simply executed.
-** When compiling, most words in the input stream have their
-** addresses inserted into the word under construction. Some words
-** (known as IMMEDIATE) are executed in the compile state, too.
-*/
-/* values of STATE */
-#define INTERPRET 0
-#define COMPILE 1
-
-/*
-** The pad is a small scratch area for text manipulation. ANS Forth
-** requires it to hold at least 84 characters.
-*/
-#if !defined nPAD
-#define nPAD 256
-#endif
-
-/*
-** ANS Forth requires that a word's name contain {1..31} characters.
-*/
-#if !defined nFICLNAME
-#define nFICLNAME 31
-#endif
-
-/*
-** OK - now we can really define the VM...
-*/
-typedef struct vm
-{
- struct vm *link; /* Ficl keeps a VM list for simple teardown */
- jmp_buf *pState; /* crude exception mechanism... */
- OUTFUNC textOut; /* Output callback - see sysdep.c */
- void * pExtend; /* vm extension pointer */
- short fRestart; /* Set TRUE to restart runningWord */
- IPTYPE ip; /* instruction pointer */
- struct ficl_word
- *runningWord;/* address of currently running word (often just *(ip-1) ) */
- UNS32 state; /* compiling or interpreting */
- UNS32 base; /* number conversion base */
- FICL_STACK *pStack; /* param stack */
- FICL_STACK *rStack; /* return stack */
- CELL sourceID; /* -1 if string, 0 if normal input */
- TIB tib; /* address of incoming text string */
-#if FICL_WANT_USER
- CELL user[FICL_USER_CELLS];
-#endif
- char pad[nPAD]; /* the scratch area (see above) */
-} FICL_VM;
-
-/*
-** A FICL_CODE points to a function that gets called to help execute
-** a word in the dictionary. It always gets passed a pointer to the
-** running virtual machine, and from there it can get the address
-** of the parameter area of the word it's supposed to operate on.
-** For precompiled words, the code is all there is. For user defined
-** words, the code assumes that the word's parameter area is a list
-** of pointers to the code fields of other words to execute, and
-** may also contain inline data. The first parameter is always
-** a pointer to a code field.
-*/
-typedef void (*FICL_CODE)(FICL_VM *pVm);
-
-/*
-** Ficl models memory as a contiguous space divided into
-** words in a linked list called the dictionary.
-** A FICL_WORD starts each entry in the list.
-** Version 1.02: space for the name characters is allotted from
-** the dictionary ahead of the word struct - this saves about half
-** the storage on average with very little runtime cost.
-*/
-typedef struct ficl_word
-{
- struct ficl_word *link; /* Previous word in the dictionary */
- UNS16 hash;
- UNS8 flags; /* Immediate, Smudge, Compile-only */
- FICL_COUNT nName; /* Number of chars in word name */
- char *name; /* First nFICLNAME chars of word name */
- FICL_CODE code; /* Native code to execute the word */
- CELL param[1]; /* First data cell of the word */
-} FICL_WORD;
-
-/*
-** Worst-case size of a word header: nFICLNAME chars in name
-*/
-#define CELLS_PER_WORD \
- ( (sizeof (FICL_WORD) + nFICLNAME + sizeof (CELL)) \
- / (sizeof (CELL)) )
-
-int wordIsImmediate(FICL_WORD *pFW);
-int wordIsCompileOnly(FICL_WORD *pFW);
-
-/* flag values for word header */
-#define FW_IMMEDIATE 1 /* execute me even if compiling */
-#define FW_COMPILE 2 /* error if executed when not compiling */
-#define FW_SMUDGE 4 /* definition in progress - hide me */
-#define FW_CLASS 8 /* Word defines a class */
-
-#define FW_COMPIMMED (FW_IMMEDIATE | FW_COMPILE)
-#define FW_DEFAULT 0
-
-
-/*
-** Exit codes for vmThrow
-*/
-#define VM_OUTOFTEXT 1 /* hungry - normal exit */
-#define VM_RESTART 2 /* word needs more text to suxcceed - re-run it */
-#define VM_USEREXIT 3 /* user wants to quit */
-#define VM_ERREXIT 4 /* interp found an error */
-#define VM_QUIT 5 /* like errexit, but leave pStack & base alone */
-
-
-void vmBranchRelative(FICL_VM *pVM, int offset);
-FICL_VM * vmCreate (FICL_VM *pVM, unsigned nPStack, unsigned nRStack);
-void vmDelete (FICL_VM *pVM);
-void vmExecute(FICL_VM *pVM, FICL_WORD *pWord);
-char * vmGetString(FICL_VM *pVM, FICL_STRING *spDest, char delimiter);
-STRINGINFO vmGetWord(FICL_VM *pVM);
-STRINGINFO vmGetWord0(FICL_VM *pVM);
-int vmGetWordToPad(FICL_VM *pVM);
-STRINGINFO vmParseString(FICL_VM *pVM, char delimiter);
-void vmPopIP (FICL_VM *pVM);
-void vmPushIP (FICL_VM *pVM, IPTYPE newIP);
-void vmQuit (FICL_VM *pVM);
-void vmReset (FICL_VM *pVM);
-void vmSetTextOut(FICL_VM *pVM, OUTFUNC textOut);
-void vmTextOut(FICL_VM *pVM, char *text, int fNewline);
-void vmThrow (FICL_VM *pVM, int except);
-void vmThrowErr(FICL_VM *pVM, char *fmt, ...);
-
-/*
-** vmCheckStack needs a vm pointer because it might have to say
-** something if it finds a problem. Parms popCells and pushCells
-** correspond to the number of parameters on the left and right of
-** a word's stack effect comment.
-*/
-void vmCheckStack(FICL_VM *pVM, int popCells, int pushCells);
-
-/*
-** TIB access routines...
-** ANS forth seems to require the input buffer to be represented
-** as a pointer to the start of the buffer, and an index to the
-** next character to read.
-** PushTib points the VM to a new input string and optionally
-** returns a copy of the current state
-** PopTib restores the TIB state given a saved TIB from PushTib
-** GetInBuf returns a pointer to the next unused char of the TIB
-*/
-void vmPushTib(FICL_VM *pVM, char *text, TIB *pSaveTib);
-void vmPopTib(FICL_VM *pVM, TIB *pTib);
-#define vmGetInBuf(pVM) ((pVM)->tib.cp + (pVM)->tib.index)
-#define vmSetTibIndex(pVM, i) (pVM)->tib.index = i
-#define vmUpdateTib(pVM, str) (pVM)->tib.index = (str) - (pVM)->tib.cp
-
-/*
-** Generally useful string manipulators omitted by ANSI C...
-** ltoa complements strtol
-*/
-#if defined(_WIN32) && !FICL_MAIN
-/* #SHEESH
-** Why do Microsoft Meatballs insist on contaminating
-** my namespace with their string functions???
-*/
-#pragma warning(disable: 4273)
-#endif
-
-char *ltoa( INT32 value, char *string, int radix );
-char *ultoa(UNS32 value, char *string, int radix );
-char digit_to_char(int value);
-char *strrev( char *string );
-char *skipSpace(char *cp);
-char *caseFold(char *cp);
-int strincmp(char *cp1, char *cp2, FICL_COUNT count);
-
-#if defined(_WIN32) && !FICL_MAIN
-#pragma warning(default: 4273)
-#endif
-
-/*
-** Ficl hash table - variable size.
-** assert(size > 0)
-** If size is 1, the table degenerates into a linked list.
-** A WORDLIST (see the search order word set in DPANS) is
-** just a pointer to a FICL_HASH in this implementation.
-*/
-#if !defined HASHSIZE /* Default size of hash table. For best */
-#define HASHSIZE 127 /* performance, use a prime number! */
-#endif
-
-typedef struct ficl_hash
-{
- struct ficl_hash *link; /* eventual inheritance support */
- unsigned size;
- FICL_WORD *table[1];
-} FICL_HASH;
-
-void hashForget(FICL_HASH *pHash, void *where);
-UNS16 hashHashCode(STRINGINFO si);
-void hashInsertWord(FICL_HASH *pHash, FICL_WORD *pFW);
-FICL_WORD *hashLookup(struct ficl_hash *pHash,
- STRINGINFO si,
- UNS16 hashCode);
-void hashReset(FICL_HASH *pHash);
-
-/*
-** A Dictionary is a linked list of FICL_WORDs. It is also Ficl's
-** memory model. Description of fields:
-**
-** here -- points to the next free byte in the dictionary. This
-** pointer is forced to be CELL-aligned before a definition is added.
-** Do not assume any specific alignment otherwise - Use dictAlign().
-**
-** smudge -- pointer to word currently being defined (or last defined word)
-** If the definition completes successfully, the word will be
-** linked into the hash table. If unsuccessful, dictUnsmudge
-** uses this pointer to restore the previous state of the dictionary.
-** Smudge prevents unintentional recursion as a side-effect: the
-** dictionary search algo examines only completed definitions, so a
-** word cannot invoke itself by name. See the ficl word "recurse".
-** NOTE: smudge always points to the last word defined. IMMEDIATE
-** makes use of this fact. Smudge is initially NULL.
-**
-** pForthWords -- pointer to the default wordlist (FICL_HASH).
-** This is the initial compilation list, and contains all
-** ficl's precompiled words.
-**
-** pCompile -- compilation wordlist - initially equal to pForthWords
-** pSearch -- array of pointers to wordlists. Managed as a stack.
-** Highest index is the first list in the search order.
-** nLists -- number of lists in pSearch. nLists-1 is the highest
-** filled slot in pSearch, and points to the first wordlist
-** in the search order
-** size -- number of cells in the dictionary (total)
-** dict -- start of data area. Must be at the end of the struct.
-*/
-typedef struct ficl_dict
-{
- CELL *here;
- FICL_WORD *smudge;
- FICL_HASH *pForthWords;
- FICL_HASH *pCompile;
- FICL_HASH *pSearch[FICL_DEFAULT_VOCS];
- int nLists;
- unsigned size; /* Number of cells in dict (total)*/
- CELL dict[1]; /* Base of dictionary memory */
-} FICL_DICT;
-
-void *alignPtr(void *ptr);
-void dictAbortDefinition(FICL_DICT *pDict);
-void dictAlign(FICL_DICT *pDict);
-int dictAllot(FICL_DICT *pDict, int n);
-int dictAllotCells(FICL_DICT *pDict, int nCells);
-void dictAppendCell(FICL_DICT *pDict, CELL c);
-void dictAppendChar(FICL_DICT *pDict, char c);
-FICL_WORD *dictAppendWord(FICL_DICT *pDict,
- char *name,
- FICL_CODE pCode,
- UNS8 flags);
-FICL_WORD *dictAppendWord2(FICL_DICT *pDict,
- STRINGINFO si,
- FICL_CODE pCode,
- UNS8 flags);
-void dictAppendUNS32(FICL_DICT *pDict, UNS32 u);
-int dictCellsAvail(FICL_DICT *pDict);
-int dictCellsUsed (FICL_DICT *pDict);
-void dictCheck(FICL_DICT *pDict, FICL_VM *pVM, int nCells);
-FICL_DICT *dictCreate(unsigned nCELLS);
-FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash);
-void dictDelete(FICL_DICT *pDict);
-void dictEmpty(FICL_DICT *pDict, unsigned nHash);
-void dictHashSummary(FICL_VM *pVM);
-int dictIncludes(FICL_DICT *pDict, void *p);
-FICL_WORD *dictLookup(FICL_DICT *pDict, STRINGINFO si);
-#if FICL_WANT_LOCALS
-FICL_WORD *dictLookupLoc(FICL_DICT *pDict, STRINGINFO si);
-#endif
-void dictResetSearchOrder(FICL_DICT *pDict);
-void dictSetFlags(FICL_DICT *pDict, UNS8 set, UNS8 clr);
-void dictSetImmediate(FICL_DICT *pDict);
-void dictUnsmudge(FICL_DICT *pDict);
-CELL *dictWhere(FICL_DICT *pDict);
-
-
-/*
-** External interface to FICL...
-*/
-/*
-** f i c l I n i t S y s t e m
-** Binds a global dictionary to the interpreter system and initializes
-** the dict to contain the ANSI CORE wordset.
-** You specify the address and size of the allocated area.
-** After that, ficl manages it.
-** First step is to set up the static pointers to the area.
-** Then write the "precompiled" portion of the dictionary in.
-** The dictionary needs to be at least large enough to hold the
-** precompiled part. Try 1K cells minimum. Use "words" to find
-** out how much of the dictionary is used at any time.
-*/
-void ficlInitSystem(int nDictCells);
-
-/*
-** f i c l T e r m S y s t e m
-** Deletes the system dictionary and all virtual machines that
-** were created with ficlNewVM (see below). Call this function to
-** reclaim all memory used by the dictionary and VMs.
-*/
-void ficlTermSystem(void);
-
-/*
-** f i c l E x e c
-** Evaluates a block of input text in the context of the
-** specified interpreter. Emits any requested output to the
-** interpreter's output function
-** Execution returns when the text block has been executed,
-** or an error occurs.
-** Returns one of the VM_XXXX codes defined in ficl.h:
-** VM_OUTOFTEXT is the normal exit condition
-** VM_ERREXIT means that the interp encountered a syntax error
-** and the vm has been reset to recover (some or all
-** of the text block got ignored
-** VM_USEREXIT means that the user executed the "bye" command
-** to shut down the interpreter. This would be a good
-** time to delete the vm, etc -- or you can ignore this
-** signal.
-** Preconditions: successful execution of ficlInitSystem,
-** Successful creation and init of the VM by ficlNewVM (or equiv)
-*/
-int ficlExec(FICL_VM *pVM, char *pText);
-
-/*
-** ficlExecFD(FICL_VM *pVM, int fd);
- * Evaluates text from file passed in via fd.
- * Execution returns when all of file has been executed or an
- * error occurs.
- */
-int ficlExecFD(FICL_VM *pVM, int fd);
-
-/*
-** Create a new VM from the heap, and link it into the system VM list.
-** Initializes the VM and binds default sized stacks to it. Returns the
-** address of the VM, or NULL if an error occurs.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_VM *ficlNewVM(void);
-
-/*
-** Returns the address of the most recently defined word in the system
-** dictionary with the given name, or NULL if no match.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_WORD *ficlLookup(char *name);
-
-/*
-** f i c l G e t D i c t
-** Utility function - returns the address of the system dictionary.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_DICT *ficlGetDict(void);
-FICL_DICT *ficlGetEnv(void);
-void ficlSetEnv(char *name, UNS32 value);
-void ficlSetEnvD(char *name, UNS32 hi, UNS32 lo);
-#if FICL_WANT_LOCALS
-FICL_DICT *ficlGetLoc(void);
-#endif
-/*
-** f i c l B u i l d
-** Builds a word into the system default dictionary in a thread-safe way.
-** Preconditions: system must be initialized, and there must
-** be enough space for the new word's header! Operation is
-** controlled by ficlLockDictionary, so any initialization
-** required by your version of the function (if you "overrode"
-** it) must be complete at this point.
-** Parameters:
-** name -- the name of the word to be built
-** code -- code to execute when the word is invoked - must take a single param
-** pointer to a FICL_VM
-** flags -- 0 or more of FW_IMMEDIATE, FW_COMPILE, use bitwise OR!
-** Most words can use FW_DEFAULT.
-** nAllot - number of extra cells to allocate in the parameter area (usually zero)
-*/
-int ficlBuild(char *name, FICL_CODE code, char flags);
-
-/*
-** f i c l C o m p i l e C o r e
-** Builds the ANS CORE wordset into the dictionary - called by
-** ficlInitSystem - no need to waste dict space by doing it again.
-*/
-void ficlCompileCore(FICL_DICT *dp);
-void ficlCompileSoftCore(FICL_VM *pVM);
-
-/*
-** from words.c...
-*/
-void constantParen(FICL_VM *pVM);
-void twoConstParen(FICL_VM *pVM);
-
-#if defined(__i386__) && !defined(TESTMAIN)
-extern void ficlOutb(FICL_VM *pVM);
-extern void ficlInb(FICL_VM *pVM);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __FICL_H__ */
diff --git a/sys/boot/ficl/math64.c b/sys/boot/ficl/math64.c
deleted file mode 100644
index e83000a8b4a2..000000000000
--- a/sys/boot/ficl/math64.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************
-** m a t h 6 4 . c
-** Forth Inspired Command Language - 64 bit math support routines
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 25 January 1998
-**
-*******************************************************************/
-
-#include "ficl.h"
-#include "math64.h"
-
-
-/**************************************************************************
- m 6 4 A b s
-** Returns the absolute value of an INT64
-**************************************************************************/
-INT64 m64Abs(INT64 x)
-{
- if (m64IsNegative(x))
- x = m64Negate(x);
-
- return x;
-}
-
-
-/**************************************************************************
- m 6 4 F l o o r e d D i v I
-**
-** FROM THE FORTH ANS...
-** Floored division is integer division in which the remainder carries
-** the sign of the divisor or is zero, and the quotient is rounded to
-** its arithmetic floor. Symmetric division is integer division in which
-** the remainder carries the sign of the dividend or is zero and the
-** quotient is the mathematical quotient rounded towards zero or
-** truncated. Examples of each are shown in tables 3.3 and 3.4.
-**
-** Table 3.3 - Floored Division Example
-** Dividend Divisor Remainder Quotient
-** -------- ------- --------- --------
-** 10 7 3 1
-** -10 7 4 -2
-** 10 -7 -4 -2
-** -10 -7 -3 1
-**
-**
-** Table 3.4 - Symmetric Division Example
-** Dividend Divisor Remainder Quotient
-** -------- ------- --------- --------
-** 10 7 3 1
-** -10 7 -3 -1
-** 10 -7 3 -1
-** -10 -7 -3 1
-**************************************************************************/
-INTQR m64FlooredDivI(INT64 num, INT32 den)
-{
- INTQR qr;
- UNSQR uqr;
- int signRem = 1;
- int signQuot = 1;
-
- if (m64IsNegative(num))
- {
- num = m64Negate(num);
- signQuot = -signQuot;
- }
-
- if (den < 0)
- {
- den = -den;
- signRem = -signRem;
- signQuot = -signQuot;
- }
-
- uqr = ficlLongDiv(m64CastIU(num), (UNS32)den);
- qr = m64CastQRUI(uqr);
- if (signQuot < 0)
- {
- qr.quot = -qr.quot;
- if (qr.rem != 0)
- {
- qr.quot--;
- qr.rem = den - qr.rem;
- }
- }
-
- if (signRem < 0)
- qr.rem = -qr.rem;
-
- return qr;
-}
-
-
-/**************************************************************************
- m 6 4 I s N e g a t i v e
-** Returns TRUE if the specified INT64 has its sign bit set.
-**************************************************************************/
-int m64IsNegative(INT64 x)
-{
- return (x.hi < 0);
-}
-
-
-/**************************************************************************
- m 6 4 M a c
-** Mixed precision multiply and accumulate primitive for number building.
-** Multiplies UNS64 u by UNS32 mul and adds UNS32 add. Mul is typically
-** the numeric base, and add represents a digit to be appended to the
-** growing number.
-** Returns the result of the operation
-**************************************************************************/
-UNS64 m64Mac(UNS64 u, UNS32 mul, UNS32 add)
-{
- UNS64 resultLo = ficlLongMul(u.lo, mul);
- UNS64 resultHi = ficlLongMul(u.hi, mul);
- resultLo.hi += resultHi.lo;
- resultHi.lo = resultLo.lo + add;
-
- if (resultHi.lo < resultLo.lo)
- resultLo.hi++;
-
- resultLo.lo = resultHi.lo;
-
- return resultLo;
-}
-
-
-/**************************************************************************
- m 6 4 M u l I
-** Multiplies a pair of INT32s and returns an INT64 result.
-**************************************************************************/
-INT64 m64MulI(INT32 x, INT32 y)
-{
- UNS64 prod;
- int sign = 1;
-
- if (x < 0)
- {
- sign = -sign;
- x = -x;
- }
-
- if (y < 0)
- {
- sign = -sign;
- y = -y;
- }
-
- prod = ficlLongMul(x, y);
- if (sign > 0)
- return m64CastUI(prod);
- else
- return m64Negate(m64CastUI(prod));
-}
-
-
-/**************************************************************************
- m 6 4 N e g a t e
-** Negates an INT64 by complementing and incrementing.
-**************************************************************************/
-INT64 m64Negate(INT64 x)
-{
- x.hi = ~x.hi;
- x.lo = ~x.lo;
- x.lo ++;
- if (x.lo == 0)
- x.hi++;
-
- return x;
-}
-
-
-/**************************************************************************
- m 6 4 P u s h
-** Push an INT64 onto the specified stack in the order required
-** by ANS Forth (most significant cell on top)
-** These should probably be macros...
-**************************************************************************/
-void i64Push(FICL_STACK *pStack, INT64 i64)
-{
- stackPushINT32(pStack, i64.lo);
- stackPushINT32(pStack, i64.hi);
- return;
-}
-
-void u64Push(FICL_STACK *pStack, UNS64 u64)
-{
- stackPushINT32(pStack, u64.lo);
- stackPushINT32(pStack, u64.hi);
- return;
-}
-
-
-/**************************************************************************
- m 6 4 P o p
-** Pops an INT64 off the stack in the order required by ANS Forth
-** (most significant cell on top)
-** These should probably be macros...
-**************************************************************************/
-INT64 i64Pop(FICL_STACK *pStack)
-{
- INT64 ret;
- ret.hi = stackPopINT32(pStack);
- ret.lo = stackPopINT32(pStack);
- return ret;
-}
-
-UNS64 u64Pop(FICL_STACK *pStack)
-{
- UNS64 ret;
- ret.hi = stackPopINT32(pStack);
- ret.lo = stackPopINT32(pStack);
- return ret;
-}
-
-
-/**************************************************************************
- m 6 4 S y m m e t r i c D i v
-** Divide an INT64 by an INT32 and return an INT32 quotient and an INT32
-** remainder. The absolute values of quotient and remainder are not
-** affected by the signs of the numerator and denominator (the operation
-** is symmetric on the number line)
-**************************************************************************/
-INTQR m64SymmetricDivI(INT64 num, INT32 den)
-{
- INTQR qr;
- UNSQR uqr;
- int signRem = 1;
- int signQuot = 1;
-
- if (m64IsNegative(num))
- {
- num = m64Negate(num);
- signRem = -signRem;
- signQuot = -signQuot;
- }
-
- if (den < 0)
- {
- den = -den;
- signQuot = -signQuot;
- }
-
- uqr = ficlLongDiv(m64CastIU(num), (UNS32)den);
- qr = m64CastQRUI(uqr);
- if (signRem < 0)
- qr.rem = -qr.rem;
-
- if (signQuot < 0)
- qr.quot = -qr.quot;
-
- return qr;
-}
-
-
-/**************************************************************************
- m 6 4 U M o d
-** Divides an UNS64 by base (an UNS16) and returns an UNS16 remainder.
-** Writes the quotient back to the original UNS64 as a side effect.
-** This operation is typically used to convert an UNS64 to a text string
-** in any base. See words.c:numberSignS, for example.
-** Mechanics: performs 4 ficlLongDivs, each of which produces 16 bits
-** of the quotient. C does not provide a way to divide an UNS32 by an
-** UNS16 and get an UNS32 quotient (ldiv is closest, but it's signed,
-** unfortunately), so I've used ficlLongDiv.
-**************************************************************************/
-UNS16 m64UMod(UNS64 *pUD, UNS16 base)
-{
- UNS64 ud;
- UNSQR qr;
- UNS64 result;
-
- result.hi = result.lo = 0;
-
- ud.hi = 0;
- ud.lo = pUD->hi >> 16;
- qr = ficlLongDiv(ud, (UNS32)base);
- result.hi = qr.quot << 16;
-
- ud.lo = (qr.rem << 16) | (pUD->hi & 0x0000ffff);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.hi |= qr.quot & 0x0000ffff;
-
- ud.lo = (qr.rem << 16) | (pUD->lo >> 16);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.lo = qr.quot << 16;
-
- ud.lo = (qr.rem << 16) | (pUD->lo & 0x0000ffff);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.lo |= qr.quot & 0x0000ffff;
-
- *pUD = result;
-
- return (UNS16)(qr.rem);
-}
-
-
diff --git a/sys/boot/ficl/math64.h b/sys/boot/ficl/math64.h
deleted file mode 100644
index 2b7df37006bd..000000000000
--- a/sys/boot/ficl/math64.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************
-** m a t h 6 4 . h
-** Forth Inspired Command Language - 64 bit math support routines
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 25 January 1998
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is not supported.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__MATH64_H__)
-#define __MATH64_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-INT64 m64Abs(INT64 x);
-int m64IsNegative(INT64 x);
-UNS64 m64Mac(UNS64 u, UNS32 mul, UNS32 add);
-INT64 m64MulI(INT32 x, INT32 y);
-INT64 m64Negate(INT64 x);
-INTQR m64FlooredDivI(INT64 num, INT32 den);
-void i64Push(FICL_STACK *pStack, INT64 i64);
-INT64 i64Pop(FICL_STACK *pStack);
-void u64Push(FICL_STACK *pStack, UNS64 u64);
-UNS64 u64Pop(FICL_STACK *pStack);
-INTQR m64SymmetricDivI(INT64 num, INT32 den);
-UNS16 m64UMod(UNS64 *pUD, UNS16 base);
-
-#define i64Extend(i64) (i64).hi = ((i64).lo < 0) ? -1L : 0
-#define m64CastIU(i64) (*(UNS64 *)(&(i64)))
-#define m64CastUI(u64) (*(INT64 *)(&(u64)))
-#define m64CastQRIU(iqr) (*(UNSQR *)(&(iqr)))
-#define m64CastQRUI(uqr) (*(INTQR *)(&(uqr)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/sys/boot/ficl/softwords/classes.fr b/sys/boot/ficl/softwords/classes.fr
deleted file mode 100644
index 75dc35ae0da2..000000000000
--- a/sys/boot/ficl/softwords/classes.fr
+++ /dev/null
@@ -1,140 +0,0 @@
-\ ** ficl/softwords/classes.fr
-\ ** F I C L 2 . 0 C L A S S E S
-\ john sadler 1 sep 98
-\ Needs oop.fr
-
-.( loading ficl utility classes ) cr
-also oop definitions
-
-\ REF subclass holds a pointer to an object. It's
-\ mainly for aggregation to help in making data structures.
-\
-object subclass c-ref
- cell: .class
- cell: .instance
-
- : get ( inst class -- refinst refclass )
- drop 2@ ;
- : set ( refinst refclass inst class -- )
- drop 2! ;
-end-class
-
-object subclass c-byte
- char: .payload
-
- : get drop c@ ;
- : set drop c! ;
-end-class
-
-object subclass c-2byte
- 2 chars: .payload
-
- : get drop w@ ;
- : set drop w! ;
-end-class
-
-object subclass c-4byte
- cell: .payload
-
- : get drop @ ;
- : set drop ! ;
-end-class
-
-
-\ ** C - P T R
-\ Base class for pointers to scalars (not objects).
-\ Note: use c-ref to make references to objects. C-ptr
-\ subclasses refer to untyped quantities of various sizes.
-
-\ Derived classes must specify the size of the thing
-\ they point to, and supply get and set methods.
-
-\ All derived classes must define the @size method:
-\ @size ( inst class -- addr-units )
-\ Returns the size in address units of the thing the pointer
-\ refers to.
-object subclass c-ptr
- c-4byte obj: .addr
-
- \ get the value of the pointer
- : get-ptr ( inst class -- addr )
- c-ptr => .addr
- c-4byte => get
- ;
-
- \ set the pointer to address supplied
- : set-ptr ( addr inst class -- )
- c-ptr => .addr
- c-4byte => set
- ;
-
- \ increment the pointer in place
- : inc-ptr ( inst class -- )
- 2dup 2dup ( i c i c i c )
- c-ptr => get-ptr -rot ( i c addr i c )
- --> @size + -rot ( addr' i c )
- c-ptr => set-ptr
- ;
-
- \ decrement the pointer in place
- : dec-ptr ( inst class -- )
- 2dup 2dup ( i c i c i c )
- c-ptr => get-ptr -rot ( i c addr i c )
- --> @size - -rot ( addr' i c )
- c-ptr => set-ptr
- ;
-
- \ index the pointer in place
- : index-ptr ( index inst class -- )
- locals| class inst index |
- inst class c-ptr => get-ptr ( addr )
- inst class --> @size index * + ( addr' )
- inst class c-ptr => set-ptr
- ;
-
-end-class
-
-
-\ ** C - C E L L P T R
-\ Models a pointer to cell (a 32 bit scalar).
-c-ptr subclass c-cellPtr
- : @size 2drop 4 ;
- \ fetch and store through the pointer
- : get ( inst class -- cell )
- c-ptr => get-ptr @
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr !
- ;
-end-class
-
-
-\ ** C - 2 B Y T E P T R
-\ Models a pointer to a 16 bit scalar
-c-ptr subclass c-2bytePtr
- : @size 2drop 2 ;
- \ fetch and store through the pointer
- : get ( inst class -- value )
- c-ptr => get-ptr w@
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr w!
- ;
-end-class
-
-
-\ ** C - B Y T E P T R
-\ Models a pointer to an 8 bit scalar
-c-ptr subclass c-bytePtr
- : @size 2drop 1 ;
- \ fetch and store through the pointer
- : get ( inst class -- value )
- c-ptr => get-ptr c@
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr c!
- ;
-end-class
-
-
-previous definitions
diff --git a/sys/boot/ficl/softwords/jhlocal.fr b/sys/boot/ficl/softwords/jhlocal.fr
deleted file mode 100644
index 034ada519711..000000000000
--- a/sys/boot/ficl/softwords/jhlocal.fr
+++ /dev/null
@@ -1,77 +0,0 @@
-\ #if FICL_WANT_LOCALS
-\ ** ficl/softwords/jhlocal.fr
-\ ** stack comment style local syntax...
-\ { a b c | cleared -- d e }
-\ variables before the "|" are initialized in reverse order
-\ from the stack. Those after the "|" are zero initialized.
-\ Anything between "--" and "}" is treated as comment
-\ Uses locals...
-\ locstate: 0 = looking for | or -- or }}
-\ 1 = found |
-\ 2 = found --
-hide
-0 constant zero
-
-: ?-- ( c-addr u -- c-addr u flag )
- 2dup s" --" compare 0= ;
-: ?} ( c-addr u -- c-addr u flag )
- 2dup s" }" compare 0= ;
-: ?| ( c-addr u -- c-addr u flag )
- 2dup s" |" compare 0= ;
-
-: ?delim ( c-addr u -- state | c-addr u 0 )
- ?| if
- 2drop 1
- else
- ?-- if
- 2drop 2
- else
- ?} if 2drop 3 else 0 endif
- endif
- endif
-;
-
-set-current
-
-: {
- 0 dup locals| locstate |
-
- \ stack locals until we hit a delimiter
- begin
- parse-word \ ( nLocals c-addr u )
- ?delim dup to locstate
- 0= while
- rot 1+ \ ( c-addr u ... c-addr u nLocals )
- repeat
-
- \ now unstack the locals
- 0 do (local) loop \ ( )
-
- \ zero locals until -- or }
- locstate 1 = if
- begin
- parse-word
- ?delim dup to locstate
- 0= while
- postpone zero (local)
- repeat
- endif
-
- 0 0 (local)
-
- \ toss words until }
- locstate 2 = if
- begin
- parse-word
- ?delim dup to locstate
- 0= while
- 2drop
- repeat
- endif
-
- locstate 3 <> abort" syntax error in { } local line"
-; immediate compile-only
-
-previous
-\ #endif
-
diff --git a/sys/boot/ficl/softwords/marker.fr b/sys/boot/ficl/softwords/marker.fr
deleted file mode 100644
index c80c2cf3f2ce..000000000000
--- a/sys/boot/ficl/softwords/marker.fr
+++ /dev/null
@@ -1,25 +0,0 @@
-\ ** ficl/softwords/marker.fr
-\ ** Ficl implementation of CORE EXT MARKER
-\ John Sadler, 4 Oct 98
-\ Requires ficl 2.02 FORGET-WID !!
-
-: marker ( "name" -- )
- create
- get-current ,
- get-order dup ,
- 0 ?do , loop
- does>
- 0 set-order \ clear search order
- dup body> >name drop
- here - allot \ reset HERE to my xt-addr
- dup @ ( pfa current-wid )
- dup set-current forget-wid ( pfa )
- cell+ dup @ swap ( count count-addr )
- over cells + swap ( last-wid-addr count )
- 0 ?do
- dup @ dup ( wid-addr wid wid )
- >search forget-wid ( wid-addr )
- cell-
- loop
- drop
-;
diff --git a/sys/boot/ficl/softwords/oo.fr b/sys/boot/ficl/softwords/oo.fr
deleted file mode 100644
index cd16c77b28b0..000000000000
--- a/sys/boot/ficl/softwords/oo.fr
+++ /dev/null
@@ -1,464 +0,0 @@
-\ ** ficl/softwords/oo.fr
-\ ** F I C L O - O E X T E N S I O N S
-\ ** john sadler aug 1998
-
-.( loading ficl O-O extensions ) cr
-7 ficl-vocabulary oop
-also oop definitions
-
-\ Design goals:
-\ 0. Traditional OOP: late binding by default for safety.
-\ Early binding if you ask for it.
-\ 1. Single inheritance
-\ 2. Object aggregation (has-a relationship)
-\ 3. Support objects in the dictionary and as proxies for
-\ existing structures (by reference):
-\ *** A ficl object can wrap a C struct ***
-\ 4. Separate name-spaces for methods - methods are
-\ only visible in the context of a class / object
-\ 5. Methods can be overridden, and subclasses can add methods.
-\ No limit on number of methods.
-
-\ General info:
-\ Classes are objects, too: all classes are instances of METACLASS
-\ All classes are derived (by convention) from OBJECT. This
-\ base class provides a default initializer and superclass
-\ access method
-
-\ A ficl object binds instance storage (payload) to a class.
-\ object ( -- instance class )
-\ All objects push their payload address and class address when
-\ executed. All objects have this footprint:
-\ cell 0: first payload cell
-
-\ A ficl class consists of a parent class pointer, a wordlist
-\ ID for the methods of the class, and a size for the payload
-\ of objects created by the class. A class is an object.
-\ The NEW method creates and initializes an instance of a class.
-\ Classes have this footprint:
-\ cell 0: parent class address
-\ cell 1: wordlist ID
-\ cell 2: size of instance's payload
-
-\ Methods expect an object couple ( instance class )
-\ on the stack.
-\ Overridden methods must maintain the same stack signature as
-\ their predecessors. Ficl has no way of enforcing this, though.
-
-user current-class
-0 current-class !
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** L A T E B I N D I N G
-\ Compile the method name, and code to find and
-\ execute it at run-time...
-\ parse-method compiles the method name so that it pushes
-\ the string base address and count at run-time.
-\
-: parse-method \ name run: ( -- c-addr u )
- parse-word
- postpone sliteral
-; compile-only
-
-: lookup-method ( class c-addr u -- class xt )
- 2dup
- local u
- local c-addr
- end-locals
- 2 pick cell+ @ ( -- class c-addr u wid )
- search-wordlist ( -- class 0 | xt 1 | xt -1 )
- 0= if
- c-addr u type ." not found in "
- body> >name type
- cr abort
- endif
-;
-
-: exec-method ( instance class c-addr u -- <method-signature> )
- lookup-method execute
-;
-
-: find-method-xt \ name ( class -- class xt )
- parse-word lookup-method
-;
-
-
-\ Method lookup operator takes a class-addr and instance-addr
-\ and executes the method from the class's wordlist if
-\ interpreting. If compiling, bind late.
-\
-: --> ( instance class -- ??? )
- state @ 0= if
- find-method-xt execute
- else
- parse-method postpone exec-method
- endif
-; immediate
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** E A R L Y B I N D I N G
-\ Early binding operator compiles code to execute a method
-\ given its class at compile time. Classes are immediate,
-\ so they leave their cell-pair on the stack when compiling.
-\ Example:
-\ : get-wid metaclass => .wid @ ;
-\ Usage
-\ my-class get-wid ( -- wid-of-my-class )
-\
-: => \ c:( class meta -- ) run: ( -- ??? ) invokes compiled method
- drop find-method-xt compile, drop
-; immediate compile-only
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** I N S T A N C E V A R I A B L E S
-\ Instance variables (IV) are represented by words in the class's
-\ private wordlist. Each IV word contains the offset
-\ of the IV it represents, and runs code to add that offset
-\ to the base address of an instance when executed.
-\ The metaclass SUB method, defined below, leaves the address
-\ of the new class's offset field and its initial size on the
-\ stack for these words to update. When a class definition is
-\ complete, END-CLASS saves the final size in the class's size
-\ field, and restores the search order and compile wordlist to
-\ prior state. Note that these words are hidden in their own
-\ wordlist to prevent accidental use outside a SUB END-CLASS pair.
-\
-wordlist
-dup constant instance-vars
-dup >search ficl-set-current
-: do-instance-var
- does> ( instance class addr[offset] -- addr[field] )
- nip @ +
-;
-
-: addr-units: ( offset size "name" -- offset' )
- create over , +
- do-instance-var
-;
-
-: chars: \ ( offset nCells "name" -- offset' ) Create n char member.
- chars addr-units: ;
-
-: char: \ ( offset nCells "name" -- offset' ) Create 1 char member.
- 1 chars: ;
-
-: cells: ( offset nCells "name" -- offset' )
- cells >r aligned r> addr-units:
-;
-
-: cell: ( offset nCells "name" -- offset' )
- 1 cells: ;
-
-\ Aggregate an object into the class...
-\ Needs the class of the instance to create
-\ Example: object obj: m_obj
-\
-: do-aggregate
- does> ( instance class pfa -- a-instance a-class )
- 2@ ( inst class a-class a-offset )
- 2swap drop ( a-class a-offset inst )
- + swap ( a-inst a-class )
-;
-
-: obj: ( offset class meta "name" -- offset' )
- locals| meta class offset |
- create offset , class ,
- class meta --> get-size offset +
- do-aggregate
-;
-
-\ Aggregate an array of objects into a class
-\ Usage example:
-\ 3 my-class array: my-array
-\ Makes an instance variable array of 3 instances of my-class
-\ named my-array.
-\
-: array: ( offset n class meta "name" -- offset' )
- locals| meta class nobjs offset |
- create offset , class ,
- class meta --> get-size nobjs * offset +
- do-aggregate
-;
-
-\ Aggregate a pointer to an object: REF is a member variable
-\ whose class is set at compile time. This is useful for wrapping
-\ data structures in C, where there is only a pointer and the type
-\ it refers to is known. If you want polymorphism, see c_ref
-\ in classes.fr. REF is only useful for pre-initialized structures,
-\ since there's no supported way to set one.
-: ref: ( offset class meta "name" -- offset' )
- locals| meta class offset |
- create offset , class ,
- offset cell+
- does> ( inst class pfa -- ptr-inst ptr-class )
- 2@ ( inst class ptr-class ptr-offset )
- 2swap drop + @ swap
-;
-
-\ END-CLASS terminates construction of a class by storing
-\ the size of its instance variables in the class's size field
-\ ( -- old-wid addr[size] 0 )
-\
-: end-class ( old-wid addr[size] size -- )
- swap ! set-current
- search> drop \ pop struct builder wordlist
-;
-
-set-current previous
-\ E N D I N S T A N C E V A R I A B L E S
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ D O - D O - I N S T A N C E
-\ Makes a class method that contains the code for an
-\ instance of the class. This word gets compiled into
-\ the wordlist of every class by the SUB method.
-\ PRECONDITION: current-class contains the class address
-\
-: do-do-instance ( -- )
- s" : .do-instance does> [ current-class @ ] literal ;"
- evaluate
-;
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** M E T A C L A S S
-\ Every class is an instance of metaclass. This lets
-\ classes have methods that are different from those
-\ of their instances.
-\ Classes are IMMEDIATE to make early binding simpler
-\ See above...
-\
-:noname
- wordlist
- create immediate
- 0 , \ NULL parent class
- dup , \ wid
- 3 cells , \ instance size
- ficl-set-current
- does> dup
-; execute metaclass
-
-metaclass drop current-class !
-do-do-instance
-
-\
-\ C L A S S M E T H O D S
-\
-instance-vars >search
-
-create .super ( class metaclass -- parent-class )
- 0 cells , do-instance-var
-
-create .wid ( class metaclass -- wid ) \ return wid of class
- 1 cells , do-instance-var
-
-create .size ( class metaclass -- size ) \ return class's payload size
- 2 cells , do-instance-var
-
-previous
-
-: get-size metaclass => .size @ ;
-: get-wid metaclass => .wid @ ;
-: get-super metaclass => .super @ ;
-
-\ create an uninitialized instance of a class, leaving
-\ the address of the new instance and its class
-\
-: instance ( class metaclass "name" -- instance class )
- locals| meta parent |
- create
- here parent --> .do-instance \ ( inst class )
- parent meta metaclass => get-size
- allot \ allocate payload space
-;
-
-\ create an uninitialized array
-: array ( n class metaclass "name" -- n instance class )
- locals| meta parent nobj |
- create nobj
- here parent --> .do-instance \ ( nobj inst class )
- parent meta metaclass => get-size
- nobj * allot \ allocate payload space
-;
-
-\ create an initialized instance
-\
-: new \ ( class metaclass "name" -- )
- metaclass => instance --> init
-;
-
-\ create an initialized array of instances
-: new-array ( n class metaclass "name" -- )
- metaclass => array
- --> array-init
-;
-
-\ create a proxy object with initialized payload address given
-: ref ( instance-addr class metaclass "name" -- )
- drop create , ,
- does> 2@
-;
-
-\ create a subclass
-: sub ( class metaclass "name" -- old-wid addr[size] size )
- wordlist
- locals| wid meta parent |
- parent meta metaclass => get-wid
- wid wid-set-super
- create immediate
- here current-class ! \ prep for do-do-instance
- parent , \ save parent class
- wid , \ save wid
- here parent meta --> get-size dup , ( addr[size] size )
- metaclass => .do-instance
- wid ficl-set-current -rot
- do-do-instance
- instance-vars >search \ push struct builder wordlist
-;
-
-\ OFFSET-OF returns the offset of an instance variable
-\ from the instance base address. If the next token is not
-\ the name of in instance variable method, you get garbage
-\ results -- there is no way at present to check for this error.
-: offset-of ( class metaclass "name" -- offset )
- drop find-method-xt nip >body @ ;
-
-\ ID returns the string name cell-pair of its class
-: id ( class metaclass -- c-addr u )
- drop body> >name ;
-
-\ list methods of the class
-: methods \ ( class meta -- )
- locals| meta class |
- begin
- class body> >name type ." methods:" cr
- class meta --> get-wid >search words cr previous
- class meta metaclass => get-super
- dup to class
- 0= until cr
-;
-
-\ list class's ancestors
-: pedigree ( class meta -- )
- locals| meta class |
- begin
- class body> >name type space
- class meta metaclass => get-super
- dup to class
- 0= until cr
-;
-
-\ decompile a method
-: see ( class meta -- )
- metaclass => get-wid >search see previous ;
-
-set-current
-\ E N D M E T A C L A S S
-
-\ META is a nickname for the address of METACLASS...
-metaclass drop
-constant meta
-
-\ SUBCLASS is a nickname for a class's SUB method...
-\ Subclass compilation ends when you invoke end-class
-\ This method is late bound for safety...
-: subclass --> sub ;
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** O B J E C T
-\ Root of all classes
-:noname
- wordlist
- create immediate
- 0 , \ NULL parent class
- dup , \ wid
- 0 , \ instance size
- ficl-set-current
- does> meta
-; execute object
-
-object drop current-class !
-do-do-instance
-
-\ O B J E C T M E T H O D S
-\ Convert instance cell-pair to class cell-pair
-\ Useful for binding class methods from an instance
-: class ( instance class -- class metaclass )
- nip meta ;
-
-\ default INIT method zero fills an instance
-: init ( instance class -- )
- meta
- metaclass => get-size ( inst size )
- erase ;
-
-\ Apply INIT to an array of NOBJ objects...
-\
-: array-init ( nobj inst class -- )
- 0 dup locals| &init &next class inst |
- \
- \ bind methods outside the loop to save time
- \
- class s" init" lookup-method to &init
- s" next" lookup-method to &next
- drop
- 0 ?do
- inst class 2dup
- &init execute
- &next execute drop to inst
- loop
-;
-
-\ Instance aliases for common class methods
-\ Upcast to parent class
-: super ( instance class -- instance parent-class )
- meta metaclass => get-super ;
-
-: pedigree ( instance class -- )
- object => class
- metaclass => pedigree ;
-
-: size ( instance class -- sizeof-instance )
- object => class
- metaclass => get-size ;
-
-: methods ( instance class -- )
- object => class
- metaclass => methods ;
-
-\ Array indexing methods...
-\ Usage examples:
-\ 10 object-array --> index
-\ obj --> next
-\
-: index ( n instance class -- instance[n] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size * ( n*size )
- inst + class ;
-
-: next ( instance[n] class -- instance[n+1] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size
- inst +
- class ;
-
-: prev ( instance[n] class -- instance[n-1] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size
- inst swap -
- class ;
-
-set-current
-\ E N D O B J E C T
-
-
-previous definitions
diff --git a/sys/boot/ficl/softwords/softcore.awk b/sys/boot/ficl/softwords/softcore.awk
deleted file mode 100644
index b182b9950897..000000000000
--- a/sys/boot/ficl/softwords/softcore.awk
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/awk -f
-# Convert forth source files to a giant C string
-# Joe Abley <jabley@patho.gen.nz>, 12 January 1999
-
-BEGIN \
-{
- printf "/***************************************************************\n";
- printf "** s o f t c o r e . c\n";
- printf "** Forth Inspired Command Language -\n";
- printf "** Words from CORE set written in FICL\n";
- printf "** Author: John Sadler (john_sadler@alum.mit.edu)\n";
- printf "** Created: 27 December 1997\n";
- printf "** Last update: %s\n", strftime();
- printf "***************************************************************/\n";
- printf "\n/*\n";
- printf "** This file contains definitions that are compiled into the\n";
- printf "** system dictionary by the first virtual machine to be created.\n";
- printf "** Created automagically by ficl/softwords/softcore.awk\n";
- printf "*/\n";
- printf "\n#include \"ficl.h\"\n";
- printf "\nstatic char softWords[] =\n";
-
- commenting = 0;
-}
-
-# some general early substitutions
-{
- gsub("\t", " "); # replace each tab with 4 spaces
- gsub("\"", "\\\""); # escape quotes
- gsub("\\\\[[:space:]]+$", ""); # toss empty comments
-}
-
-# strip out empty lines
-/^ *$/ \
-{
- next;
-}
-
-# emit / ** lines as multi-line C comments
-/^\\[[:space:]]\*\*/ && (commenting == 0) \
-{
- sub("^\\\\[[:space:]]", "");
- printf "/*\n%s\n", $0;
- commenting = 1;
- next;
-}
-
-/^\\[[:space:]]\*\*/ \
-{
- sub("^\\\\[[:space:]]", "");
- printf "%s\n", $0;
- next;
-}
-
-# function to close a comment, used later
-function end_comments()
-{
- commenting = 0;
- printf "*/\n";
-}
-
-# pass commented preprocessor directives
-/^\\[[:space:]]#/ \
-{
- if (commenting) end_comments();
- sub("^\\\\[[:space:]]", "");
- printf "%s\n", $0;
- next;
-}
-
-# toss all other full-line comments
-/^\\/ \
-{
- if (commenting) end_comments();
- next;
-}
-
-# emit all other lines as quoted string fragments
-{
- if (commenting) end_comments();
-
- sub("\\\\[[:space:]]+.*$", ""); # lop off trailing \ comments
- sub("[[:space:]]+$", ""); # remove trailing spaces
- printf " \"%s \\n\"\n", $0;
- next;
-}
-
-END \
-{
- if (commenting) end_comments();
- printf " \"quit \";\n";
- printf "\n\nvoid ficlCompileSoftCore(FICL_VM *pVM)\n";
- printf "{\n";
- printf " assert(ficlExec(pVM, softWords) != VM_ERREXIT);\n";
- printf "}\n";
-}
diff --git a/sys/boot/ficl/softwords/softcore.fr b/sys/boot/ficl/softwords/softcore.fr
deleted file mode 100644
index bcc2696b6efd..000000000000
--- a/sys/boot/ficl/softwords/softcore.fr
+++ /dev/null
@@ -1,125 +0,0 @@
-\ ** ficl/softwords/softcore.fr
-\ ** FICL soft extensions
-\ ** John Sadler (john_sadler@alum.mit.edu)
-\ ** September, 1998
-
-\ ** Ficl USER variables
-\ ** See words.c for primitive def'n of USER
-\ #if FICL_WANT_USER
-
-variable nUser 0 nUser !
-: user \ name ( -- )
- nUser dup @ user 1 swap +! ;
-
-\ #endif
-
-\ ** ficl extras
-\ EMPTY cleans the parameter stack
-: empty ( xn..x1 -- ) depth 0 ?do drop loop ;
-\ CELL- undoes CELL+
-: cell- ( addr -- addr ) [ 1 cells ] literal - ;
-: -rot ( a b c -- c a b ) 2 -roll ;
-
-\ ** CORE
-: abs ( x -- x )
- dup 0< if negate endif ;
-decimal 32 constant bl
-
-: space ( -- ) bl emit ;
-
-: spaces ( n -- ) 0 ?do space loop ;
-
-: abort"
- postpone if
- postpone ."
- postpone cr
- postpone abort
- postpone endif
-; immediate
-
-
-\ ** CORE EXT
-0 constant false
--1 constant true
-: <> = invert ;
-: 0<> 0= invert ;
-: compile, , ;
-: erase ( addr u -- ) 0 fill ;
-: nip ( y x -- x ) swap drop ;
-: tuck ( y x -- x y x) swap over ;
-
-\ ** LOCAL EXT word set
-\ #if FICL_WANT_LOCALS
-: locals| ( name...name | -- )
- begin
- bl word count
- dup 0= abort" where's the delimiter??"
- over c@
- [char] | - over 1- or
- while
- (local)
- repeat 2drop 0 0 (local)
-; immediate
-
-: local ( name -- ) bl word count (local) ; immediate
-
-: end-locals ( -- ) 0 0 (local) ; immediate
-
-\ #endif
-
-\ ** TOOLS word set...
-: ? ( addr -- ) @ . ;
-: dump ( addr u -- )
- 0 ?do
- dup c@ . 1+
- i 7 and 7 = if cr endif
- loop drop
-;
-
-\ ** SEARCH+EXT words and ficl helpers
-\
-: wordlist ( -- )
- 1 ficl-wordlist ;
-
-\ DO_VOCABULARY handles the DOES> part of a VOCABULARY
-\ When executed, new voc replaces top of search stack
-: do-vocabulary ( -- )
- does> @ search> drop >search ;
-
-: vocabulary ( name -- )
- wordlist create , do-vocabulary ;
-
-: ficl-vocabulary ( nBuckets name -- )
- ficl-wordlist create , do-vocabulary ;
-
-\ ALSO dups the search stack...
-: also ( -- )
- search> dup >search >search ;
-
-\ FORTH drops the top of the search stack and pushes FORTH-WORDLIST
-: forth ( -- )
- search> drop
- forth-wordlist >search ;
-
-\ ONLY sets the search order to a default state
-: only ( -- )
- -1 set-order ;
-
-\ ORDER displays the compile wid and the search order list
-: order ( -- )
- ." Search: "
- get-order 0 ?do x. loop cr
- ." Compile: " get-current x. cr ;
-
-\ PREVIOUS drops the search order stack
-: previous ( -- ) search> drop ;
-
-\ FICL-SET-CURRENT sets the compile wordlist and pushes the previous value
-: ficl-set-current ( wid -- old-wid )
- get-current swap set-current ;
-
-wordlist constant hidden
-: hide hidden dup >search ficl-set-current ;
-
-\ ** E N D S O F T C O R E . F R
-
diff --git a/sys/boot/ficl/stack.c b/sys/boot/ficl/stack.c
deleted file mode 100644
index aee9f8f5ff56..000000000000
--- a/sys/boot/ficl/stack.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************
-** s t a c k . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#else
-#include <stand.h>
-#endif
-#include "ficl.h"
-
-#define STKDEPTH(s) ((s)->sp - (s)->base)
-
-/*
-** N O T E: Stack convention:
-**
-** sp points to the first available cell
-** push: store value at sp, increment sp
-** pop: decrement sp, fetch value at sp
-** Stack grows from low to high memory
-*/
-
-/*******************************************************************
- v m C h e c k S t a c k
-** Check the parameter stack for underflow or overflow.
-** nCells controls the type of check: if nCells is zero,
-** the function checks the stack state for underflow and overflow.
-** If nCells > 0, checks to see that the stack has room to push
-** that many cells. If less than zero, checks to see that the
-** stack has room to pop that many cells. If any test fails,
-** the function throws (via vmThrow) a VM_ERREXIT exception.
-*******************************************************************/
-void vmCheckStack(FICL_VM *pVM, int popCells, int pushCells)
-{
- FICL_STACK *pStack = pVM->pStack;
- int nFree = pStack->base + pStack->nCells - pStack->sp;
-
- if (popCells > STKDEPTH(pStack))
- {
- vmThrowErr(pVM, "Error: stack underflow");
- }
-
- if (nFree < pushCells - popCells)
- {
- vmThrowErr(pVM, "Error: stack overflow");
- }
-
- return;
-}
-
-/*******************************************************************
- s t a c k C r e a t e
-**
-*******************************************************************/
-
-FICL_STACK *stackCreate(unsigned nCells)
-{
- size_t size = sizeof (FICL_STACK) + nCells * sizeof (CELL);
- FICL_STACK *pStack = ficlMalloc(size);
-
-#if FICL_ROBUST
- assert (nCells != 0);
- assert (pStack != NULL);
-#endif
-
- pStack->nCells = nCells;
- pStack->sp = pStack->base;
- pStack->pFrame = NULL;
- return pStack;
-}
-
-
-/*******************************************************************
- s t a c k D e l e t e
-**
-*******************************************************************/
-
-void stackDelete(FICL_STACK *pStack)
-{
- if (pStack)
- ficlFree(pStack);
- return;
-}
-
-
-/*******************************************************************
- s t a c k D e p t h
-**
-*******************************************************************/
-
-int stackDepth(FICL_STACK *pStack)
-{
- return STKDEPTH(pStack);
-}
-
-/*******************************************************************
- s t a c k D r o p
-**
-*******************************************************************/
-
-void stackDrop(FICL_STACK *pStack, int n)
-{
-#if FICL_ROBUST
- assert(n > 0);
-#endif
- pStack->sp -= n;
- return;
-}
-
-
-/*******************************************************************
- s t a c k F e t c h
-**
-*******************************************************************/
-
-CELL stackFetch(FICL_STACK *pStack, int n)
-{
- return pStack->sp[-n-1];
-}
-
-void stackStore(FICL_STACK *pStack, int n, CELL c)
-{
- pStack->sp[-n-1] = c;
- return;
-}
-
-
-/*******************************************************************
- s t a c k G e t T o p
-**
-*******************************************************************/
-
-CELL stackGetTop(FICL_STACK *pStack)
-{
- return pStack->sp[-1];
-}
-
-
-/*******************************************************************
- s t a c k L i n k
-** Link a frame using the stack's frame pointer. Allot space for
-** nCells cells in the frame
-** 1) Push pFrame
-** 2) pFrame = sp
-** 3) sp += nCells
-*******************************************************************/
-
-void stackLink(FICL_STACK *pStack, int nCells)
-{
- stackPushPtr(pStack, pStack->pFrame);
- pStack->pFrame = pStack->sp;
- pStack->sp += nCells;
- return;
-}
-
-
-/*******************************************************************
- s t a c k U n l i n k
-** Unink a stack frame previously created by stackLink
-** 1) sp = pFrame
-** 2) pFrame = pop()
-*******************************************************************/
-
-void stackUnlink(FICL_STACK *pStack)
-{
- pStack->sp = pStack->pFrame;
- pStack->pFrame = stackPopPtr(pStack);
- return;
-}
-
-
-/*******************************************************************
- s t a c k P i c k
-**
-*******************************************************************/
-
-void stackPick(FICL_STACK *pStack, int n)
-{
- stackPush(pStack, stackFetch(pStack, n));
- return;
-}
-
-
-/*******************************************************************
- s t a c k P o p
-**
-*******************************************************************/
-
-CELL stackPop(FICL_STACK *pStack)
-{
- return *--pStack->sp;
-}
-
-void *stackPopPtr(FICL_STACK *pStack)
-{
- return (*--pStack->sp).p;
-}
-
-UNS32 stackPopUNS32(FICL_STACK *pStack)
-{
- return (*--pStack->sp).u;
-}
-
-INT32 stackPopINT32(FICL_STACK *pStack)
-{
- return (*--pStack->sp).i;
-}
-
-
-/*******************************************************************
- s t a c k P u s h
-**
-*******************************************************************/
-
-void stackPush(FICL_STACK *pStack, CELL c)
-{
- *pStack->sp++ = c;
-}
-
-void stackPushPtr(FICL_STACK *pStack, void *ptr)
-{
- *pStack->sp++ = LVALUEtoCELL(ptr);
-}
-
-void stackPushUNS32(FICL_STACK *pStack, UNS32 u)
-{
- *pStack->sp++ = LVALUEtoCELL(u);
-}
-
-void stackPushINT32(FICL_STACK *pStack, INT32 i)
-{
- *pStack->sp++ = LVALUEtoCELL(i);
-}
-
-/*******************************************************************
- s t a c k R e s e t
-**
-*******************************************************************/
-
-void stackReset(FICL_STACK *pStack)
-{
- pStack->sp = pStack->base;
- return;
-}
-
-
-/*******************************************************************
- s t a c k R o l l
-** Roll nth stack entry to the top (counting from zero), if n is
-** >= 0. Drop other entries as needed to fill the hole.
-** If n < 0, roll top-of-stack to nth entry, pushing others
-** upward as needed to fill the hole.
-*******************************************************************/
-
-void stackRoll(FICL_STACK *pStack, int n)
-{
- CELL c;
- CELL *pCell;
-
- if (n == 0)
- return;
- else if (n > 0)
- {
- pCell = pStack->sp - n - 1;
- c = *pCell;
-
- for (;n > 0; --n, pCell++)
- {
- *pCell = pCell[1];
- }
-
- *pCell = c;
- }
- else
- {
- pCell = pStack->sp - 1;
- c = *pCell;
-
- for (; n < 0; ++n, pCell--)
- {
- *pCell = pCell[-1];
- }
-
- *pCell = c;
- }
- return;
-}
-
-
-/*******************************************************************
- s t a c k S e t T o p
-**
-*******************************************************************/
-
-void stackSetTop(FICL_STACK *pStack, CELL c)
-{
- pStack->sp[-1] = c;
- return;
-}
-
-
diff --git a/sys/boot/ficl/sysdep.c b/sys/boot/ficl/sysdep.c
deleted file mode 100644
index 84a704dabdd8..000000000000
--- a/sys/boot/ficl/sysdep.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************
-** s y s d e p . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Implementations of FICL external interface functions...
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include <stand.h>
-#ifdef __i386__
-#include <machine/cpufunc.h>
-#endif
-#endif
-#include "ficl.h"
-
-/*
-******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
-*/
-
-UNS64 ficlLongMul(UNS32 x, UNS32 y)
-{
- UNS64 q;
- u_int64_t qx;
-
- qx = (u_int64_t)x * (u_int64_t) y;
-
- q.hi = (u_int32_t)( qx >> 32 );
- q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
-
- return q;
-}
-
-UNSQR ficlLongDiv(UNS64 q, UNS32 y)
-{
- UNSQR result;
- u_int64_t qx, qh;
-
- qh = q.hi;
- qx = (qh << 32) | q.lo;
-
- result.quot = qx / y;
- result.rem = qx % y;
-
- return result;
-}
-
-void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
-{
- IGNORE(pVM);
-
- while(*msg != 0)
- putchar(*(msg++));
- if (fNewline)
- putchar('\n');
-
- return;
-}
-
-void *ficlMalloc (size_t size)
-{
- return malloc(size);
-}
-
-void ficlFree (void *p)
-{
- free(p);
-}
-
-#ifdef __i386__
-/*
- * outb ( port# c -- )
- * Store a byte to I/O port number port#
- */
-void
-ficlOutb(FICL_VM *pVM)
-{
- u_char c;
- u_int32_t port;
-
- port=stackPopUNS32(pVM->pStack);
- c=(u_char)stackPopINT32(pVM->pStack);
- outb(port,c);
-}
-
-/*
- * inb ( port# -- c )
- * Fetch a byte from I/O port number port#
- */
-void
-ficlInb(FICL_VM *pVM)
-{
- u_char c;
- u_int32_t port;
-
- port=stackPopUNS32(pVM->pStack);
- c=inb(port);
- stackPushINT32(pVM->pStack,c);
-}
-#endif
-
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** is guaranteed to be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** befor timeout (optional - could also block forever)
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock)
-{
- IGNORE(fLock);
- return 0;
-}
-#endif /* FICL_MULTITHREAD */
-
-
diff --git a/sys/boot/ficl/sysdep.h b/sys/boot/ficl/sysdep.h
deleted file mode 100644
index 4095701cad2a..000000000000
--- a/sys/boot/ficl/sysdep.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************
- s y s d e p . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Ficl system dependent types and prototypes...
-**
-** Note: Ficl also depends on the use of "assert" when
-** FICL_ROBUST is enabled. This may require some consideration
-** in firmware systems since assert often
-** assumes stderr/stdout.
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is not supported.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__SYSDEP_H__)
-#define __SYSDEP_H__
-
-#include <sys/types.h>
-
-#include <stddef.h> /* size_t, NULL */
-#include <setjmp.h>
-
-#include <assert.h>
-
-#if !defined IGNORE /* Macro to silence unused param warnings */
-#define IGNORE(x) &x
-#endif
-
-
-/*
-** TRUE and FALSE for C boolean operations, and
-** portable 32 bit types for CELLs
-**
-*/
-#if !defined TRUE
-#define TRUE 1
-#endif
-#if !defined FALSE
-#define FALSE 0
-#endif
-
-
-#if !defined INT32
-#define INT32 int32_t
-#endif
-
-#if !defined UNS32
-#define UNS32 u_int32_t
-#endif
-
-#if !defined UNS16
-#define UNS16 u_int16_t
-#endif
-
-#if !defined UNS8
-#define UNS8 u_int8_t
-#endif
-
-#if !defined NULL
-#define NULL ((void *)0)
-#endif
-
-typedef struct
-{
- UNS32 hi;
- UNS32 lo;
-} UNS64;
-
-typedef struct
-{
- UNS32 quot;
- UNS32 rem;
-} UNSQR;
-
-typedef struct
-{
- INT32 hi;
- INT32 lo;
-} INT64;
-
-typedef struct
-{
- INT32 quot;
- INT32 rem;
-} INTQR;
-
-
-/*
-** Build controls
-** FICL_MULTITHREAD enables dictionary mutual exclusion
-** wia the ficlLockDictionary system dependent function.
-*/
-#if !defined FICL_MULTITHREAD
-#define FICL_MULTITHREAD 0
-#endif
-
-/*
-** FICL_ROBUST enables bounds checking of stacks and the dictionary.
-** This will detect stack over and underflows and dictionary overflows.
-** Any exceptional condition will result in an assertion failure.
-** (As generated by the ANSI assert macro)
-** FICL_ROBUST == 1 --> stack checking in the outer interpreter
-** FICL_ROBUST == 2 also enables checking in many primitives
-*/
-
-#if !defined FICL_ROBUST
-#define FICL_ROBUST 2
-#endif
-
-/*
-** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
-** a new virtual machine's stacks, unless overridden at
-** create time.
-*/
-#if !defined FICL_DEFAULT_STACK
-#define FICL_DEFAULT_STACK 128
-#endif
-
-/*
-** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
-** for the system dictionary by default. The value
-** can be overridden at startup time as well.
-** FICL_DEFAULT_ENV specifies the number of cells to allot
-** for the environment-query dictionary.
-*/
-#if !defined FICL_DEFAULT_DICT
-#define FICL_DEFAULT_DICT 12288
-#endif
-
-#if !defined FICL_DEFAULT_ENV
-#define FICL_DEFAULT_ENV 260
-#endif
-
-/*
-** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
-** the dictionary search order. See Forth DPANS sec 16.3.3
-** (file://dpans16.htm#16.3.3)
-*/
-#if !defined FICL_DEFAULT_VOCS
-#define FICL_DEFAULT_VOCS 16
-#endif
-
-/*
-** User variables: per-instance variables bound to the VM.
-** Kinda like thread-local storage. Could be implemented in a
-** VM private dictionary, but I've chosen the lower overhead
-** approach of an array of CELLs instead.
-*/
-#if !defined FICL_WANT_USER
-#define FICL_WANT_USER 1
-#endif
-
-#if !defined FICL_USER_CELLS
-#define FICL_USER_CELLS 16
-#endif
-
-/*
-** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
-** a private dictionary for local variable compilation.
-*/
-#if !defined FICL_WANT_LOCALS
-#define FICL_WANT_LOCALS 1
-#endif
-
-/* Max number of local variables per definition */
-#if !defined FICL_MAX_LOCALS
-#define FICL_MAX_LOCALS 16
-#endif
-
-/*
-** FICL_ALIGN is the power of two to which the dictionary
-** pointer address must be aligned. This value is usually
-** either 1 or 2, depending on the memory architecture
-** of the target system; 2 is safe on any 16 or 32 bit
-** machine.
-*/
-#if !defined FICL_ALIGN
-#define FICL_ALIGN 2
-#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
-#endif
-
-/*
-** System dependent routines --
-** edit the implementations in sysdep.c to be compatible
-** with your runtime environment...
-** ficlTextOut sends a NULL terminated string to the
-** default output device - used for system error messages
-** ficlMalloc and ficlFree have the same semantics as malloc and free
-** in standard C
-** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
-** product
-** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
-** and remainder
-*/
-struct vm;
-void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
-void *ficlMalloc (size_t size);
-void ficlFree (void *p);
-
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** must be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** before timeout (optional - could also block forever)
-**
-** NOTE: this function must be implemented with lock counting
-** semantics: nested calls must behave properly.
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock);
-#else
-#define ficlLockDictionary(x) 0 /* ignore */
-#endif
-
-/*
-** 64 bit integer math support routines: multiply two UNS32s
-** to get a 64 bit prodict, & divide the product by an UNS32
-** to get an UNS32 quotient and remainder. Much easier in asm
-** on a 32 bit CPU than in C, which usually doesn't support
-** the double length result (but it should).
-*/
-UNS64 ficlLongMul(UNS32 x, UNS32 y);
-UNSQR ficlLongDiv(UNS64 q, UNS32 y);
-
-#endif /*__SYSDEP_H__*/
diff --git a/sys/boot/ficl/testmain.c b/sys/boot/ficl/testmain.c
deleted file mode 100644
index f7cdc4440a83..000000000000
--- a/sys/boot/ficl/testmain.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
-** stub main for testing FICL
-**
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "ficl.h"
-
-/*
-** Ficl interface to getcwd
-** Prints the current working directory using the VM's
-** textOut method...
-*/
-static void ficlGetCWD(FICL_VM *pVM)
-{
- char *cp;
-
- cp = getcwd(NULL, 80);
- vmTextOut(pVM, cp, 1);
- free(cp);
- return;
-}
-
-/*
-** Ficl interface to chdir
-** Gets a newline (or NULL) delimited string from the input
-** and feeds it to chdir()
-** Example:
-** cd c:\tmp
-*/
-static void ficlChDir(FICL_VM *pVM)
-{
- FICL_STRING *pFS = (FICL_STRING *)pVM->pad;
- vmGetString(pVM, pFS, '\n');
- if (pFS->count > 0)
- {
- int err = chdir(pFS->text);
- if (err)
- {
- vmTextOut(pVM, "Error: path not found", 1);
- vmThrow(pVM, VM_QUIT);
- }
- }
- else
- {
- vmTextOut(pVM, "Warning (chdir): nothing happened", 1);
- }
- return;
-}
-
-/*
-** Ficl interface to system (ANSI)
-** Gets a newline (or NULL) delimited string from the input
-** and feeds it to system()
-** Example:
-** system del *.*
-** \ ouch!
-*/
-static void ficlSystem(FICL_VM *pVM)
-{
- FICL_STRING *pFS = (FICL_STRING *)pVM->pad;
-
- vmGetString(pVM, pFS, '\n');
- if (pFS->count > 0)
- {
- int err = system(pFS->text);
- if (err)
- {
- sprintf(pVM->pad, "System call returned %d", err);
- vmTextOut(pVM, pVM->pad, 1);
- vmThrow(pVM, VM_QUIT);
- }
- }
- else
- {
- vmTextOut(pVM, "Warning (system): nothing happened", 1);
- }
- return;
-}
-
-/*
-** Ficl add-in to load a text file and execute it...
-** Cheesy, but illustrative.
-** Line oriented... filename is newline (or NULL) delimited.
-** Example:
-** load test.ficl
-*/
-#define nLINEBUF 256
-static void ficlLoad(FICL_VM *pVM)
-{
- char cp[nLINEBUF];
- char filename[nLINEBUF];
- FICL_STRING *pFilename = (FICL_STRING *)filename;
- int nLine = 0;
- FILE *fp;
- int result;
- CELL id;
- struct stat buf;
-
-
- vmGetString(pVM, pFilename, '\n');
-
- if (pFilename->count <= 0)
- {
- vmTextOut(pVM, "Warning (load): nothing happened", 1);
- return;
- }
-
- /*
- ** get the file's size and make sure it exists
- */
- result = stat( pFilename->text, &buf );
-
- if (result != 0)
- {
- vmTextOut(pVM, "Unable to stat file: ", 0);
- vmTextOut(pVM, pFilename->text, 1);
- vmThrow(pVM, VM_QUIT);
- }
-
- fp = fopen(pFilename->text, "r");
- if (!fp)
- {
- vmTextOut(pVM, "Unable to open file ", 0);
- vmTextOut(pVM, pFilename->text, 1);
- vmThrow(pVM, VM_QUIT);
- }
-
- id = pVM->sourceID;
- pVM->sourceID.p = (void *)fp;
-
- /* feed each line to ficlExec */
- while (fgets(cp, nLINEBUF, fp))
- {
- int len = strlen(cp) - 1;
-
- nLine++;
- if (len <= 0)
- continue;
-
- if (cp[len] == '\n')
- cp[len] = '\0';
-
- result = ficlExec(pVM, cp);
- if (result >= VM_ERREXIT)
- {
- pVM->sourceID = id;
- fclose(fp);
- vmThrowErr(pVM, "Error loading file <%s> line %d", pFilename->text, nLine);
- break;
- }
- }
- /*
- ** Pass an empty line with SOURCE-ID == 0 to flush
- ** any pending REFILLs (as required by FILE wordset)
- */
- pVM->sourceID.i = -1;
- ficlExec(pVM, "");
-
- pVM->sourceID = id;
- fclose(fp);
-
- return;
-}
-
-/*
-** Dump a tab delimited file that summarizes the contents of the
-** dictionary hash table by hashcode...
-*/
-static void spewHash(FICL_VM *pVM)
-{
- FICL_HASH *pHash = ficlGetDict()->pForthWords;
- FICL_WORD *pFW;
- FILE *pOut;
- unsigned i;
- unsigned nHash = pHash->size;
-
- if (!vmGetWordToPad(pVM))
- vmThrow(pVM, VM_OUTOFTEXT);
-
- pOut = fopen(pVM->pad, "w");
- if (!pOut)
- {
- vmTextOut(pVM, "unable to open file", 1);
- return;
- }
-
- for (i=0; i < nHash; i++)
- {
- int n = 0;
-
- pFW = pHash->table[i];
- while (pFW)
- {
- n++;
- pFW = pFW->link;
- }
-
- fprintf(pOut, "%d\t%d", i, n);
-
- pFW = pHash->table[i];
- while (pFW)
- {
- fprintf(pOut, "\t%s", pFW->name);
- pFW = pFW->link;
- }
-
- fprintf(pOut, "\n");
- }
-
- fclose(pOut);
- return;
-}
-
-static void ficlBreak(FICL_VM *pVM)
-{
- pVM->state = pVM->state;
- return;
-}
-
-void buildTestInterface(void)
-{
- ficlBuild("break", ficlBreak, FW_DEFAULT);
- ficlBuild("cd", ficlChDir, FW_DEFAULT);
- ficlBuild("load", ficlLoad, FW_DEFAULT);
- ficlBuild("pwd", ficlGetCWD, FW_DEFAULT);
- ficlBuild("system", ficlSystem, FW_DEFAULT);
- ficlBuild("spewhash", spewHash, FW_DEFAULT);
-
- return;
-}
-
-
-int main(int argc, char **argv)
-{
- char in[256];
- FICL_VM *pVM;
-
- ficlInitSystem(10000);
- buildTestInterface();
- pVM = ficlNewVM();
-
- ficlExec(pVM, ".ver .( " __DATE__ " ) cr quit");
-
- /*
- ** load file from cmd line...
- */
- if (argc > 1)
- {
- sprintf(in, ".( loading %s ) cr load %s\n cr", argv[1], argv[1]);
- ficlExec(pVM, in);
- }
-
- for (;;)
- {
- int ret;
- if (fgets(in, sizeof(in) - 1, stdin) == NULL)
- break;
- ret = ficlExec(pVM, in);
- if (ret == VM_USEREXIT)
- {
- ficlTermSystem();
- break;
- }
- }
-
- return 0;
-}
-
diff --git a/sys/boot/ficl/vm.c b/sys/boot/ficl/vm.c
deleted file mode 100644
index 6852c62bd663..000000000000
--- a/sys/boot/ficl/vm.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*******************************************************************
-** v m . c
-** Forth Inspired Command Language - virtual machine methods
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This file implements the virtual machine of FICL. Each virtual
-** machine retains the state of an interpreter. A virtual machine
-** owns a pair of stacks for parameters and return addresses, as
-** well as a pile of state variables and the two dedicated registers
-** of the interp.
-*/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#else
-#include <stand.h>
-#endif
-#include <stdarg.h>
-#include <string.h>
-#include "ficl.h"
-
-static char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
-
-/**************************************************************************
- v m B r a n c h R e l a t i v e
-**
-**************************************************************************/
-void vmBranchRelative(FICL_VM *pVM, int offset)
-{
- pVM->ip += offset;
- return;
-}
-
-
-/**************************************************************************
- v m C r e a t e
-**
-**************************************************************************/
-FICL_VM *vmCreate(FICL_VM *pVM, unsigned nPStack, unsigned nRStack)
-{
- if (pVM == NULL)
- {
- pVM = (FICL_VM *)ficlMalloc(sizeof (FICL_VM));
- pVM->pStack = NULL;
- pVM->rStack = NULL;
- pVM->link = NULL;
- }
- assert (pVM);
-
- if (pVM->pStack)
- stackDelete(pVM->pStack);
- pVM->pStack = stackCreate(nPStack);
-
- if (pVM->rStack)
- stackDelete(pVM->rStack);
- pVM->rStack = stackCreate(nRStack);
-
- pVM->textOut = ficlTextOut;
-
- vmReset(pVM);
- return pVM;
-}
-
-
-/**************************************************************************
- v m D e l e t e
-**
-**************************************************************************/
-void vmDelete (FICL_VM *pVM)
-{
- if (pVM)
- {
- ficlFree(pVM->pStack);
- ficlFree(pVM->rStack);
- ficlFree(pVM);
- }
-
- return;
-}
-
-
-/**************************************************************************
- v m E x e c u t e
-**
-**************************************************************************/
-void vmExecute(FICL_VM *pVM, FICL_WORD *pWord)
-{
- pVM->runningWord = pWord;
- pWord->code(pVM);
- return;
-}
-
-
-/**************************************************************************
- v m G e t S t r i n g
-** Parses a string out of the VM input buffer and copies up to the first
-** FICL_STRING_MAX characters to the supplied destination buffer, a
-** FICL_STRING. The destination string is NULL terminated.
-**
-** Returns the address of the first unused character in the dest buffer.
-**************************************************************************/
-char *vmGetString(FICL_VM *pVM, FICL_STRING *spDest, char delimiter)
-{
- STRINGINFO si = vmParseString(pVM, delimiter);
-
- if (SI_COUNT(si) > FICL_STRING_MAX)
- {
- SI_SETLEN(si, FICL_STRING_MAX);
- }
-
- strncpy(spDest->text, SI_PTR(si), SI_COUNT(si));
- spDest->text[SI_COUNT(si)] = '\0';
- spDest->count = (FICL_COUNT)SI_COUNT(si);
-
- return spDest->text + SI_COUNT(si) + 1;
-}
-
-
-/**************************************************************************
- v m G e t W o r d
-** vmGetWord calls vmGetWord0 repeatedly until it gets a string with
-** non-zero length.
-**************************************************************************/
-STRINGINFO vmGetWord(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
-
- if (SI_COUNT(si) == 0)
- {
- vmThrow(pVM, VM_RESTART);
- }
-
- return si;
-}
-
-
-/**************************************************************************
- v m G e t W o r d 0
-** Skip leading whitespace and parse a space delimited word from the tib.
-** Returns the start address and length of the word. Updates the tib
-** to reflect characters consumed, including the trailing delimiter.
-** If there's nothing of interest in the tib, returns zero. This function
-** does not use vmParseString because it uses isspace() rather than a
-** single delimiter character.
-**************************************************************************/
-STRINGINFO vmGetWord0(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- STRINGINFO si;
- UNS32 count = 0;
- char ch;
-
- pSrc = skipSpace(pSrc);
- SI_SETPTR(si, pSrc);
-
- for (ch = *pSrc; ch != '\0' && !isspace(ch); ch = *++pSrc)
- {
- count++;
- }
-
- SI_SETLEN(si, count);
-
- if (isspace(ch)) /* skip one trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
-
- return si;
-}
-
-
-/**************************************************************************
- v m G e t W o r d T o P a d
-** Does vmGetWord0 and copies the result to the pad as a NULL terminated
-** string. Returns the length of the string. If the string is too long
-** to fit in the pad, it is truncated.
-**************************************************************************/
-int vmGetWordToPad(FICL_VM *pVM)
-{
- STRINGINFO si;
- char *cp = (char *)pVM->pad;
- si = vmGetWord0(pVM);
-
- if (SI_COUNT(si) > nPAD)
- SI_SETLEN(si, nPAD);
-
- strncpy(cp, SI_PTR(si), SI_COUNT(si));
- cp[SI_COUNT(si)] = '\0';
- return (int)(SI_COUNT(si));
-}
-
-
-/**************************************************************************
- v m P a r s e S t r i n g
-** Parses a string out of the input buffer using the delimiter
-** specified. Skips leading delimiters, marks the start of the string,
-** and counts characters to the next delimiter it encounters. It then
-** updates the vm input buffer to consume all these chars, including the
-** trailing delimiter.
-** Returns the address and length of the parsed string, not including the
-** trailing delimiter.
-**************************************************************************/
-STRINGINFO vmParseString(FICL_VM *pVM, char delim)
-{
- STRINGINFO si;
- char *pSrc = vmGetInBuf(pVM);
- char ch;
-
- while (*pSrc == delim) /* skip lead delimiters */
- pSrc++;
-
- SI_SETPTR(si, pSrc); /* mark start of text */
-
- for (ch = *pSrc; (ch != delim)
- && (ch != '\0')
- && (ch != '\r')
- && (ch != '\n'); ch = *++pSrc)
- {
- ; /* find next delimiter or end of line */
- }
-
- /* set length of result */
- SI_SETLEN(si, pSrc - SI_PTR(si));
-
- if (*pSrc == delim) /* gobble trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
- return si;
-}
-
-
-/**************************************************************************
- v m P o p I P
-**
-**************************************************************************/
-void vmPopIP(FICL_VM *pVM)
-{
- pVM->ip = (IPTYPE)(stackPopPtr(pVM->rStack));
- return;
-}
-
-
-/**************************************************************************
- v m P u s h I P
-**
-**************************************************************************/
-void vmPushIP(FICL_VM *pVM, IPTYPE newIP)
-{
- stackPushPtr(pVM->rStack, (void *)pVM->ip);
- pVM->ip = newIP;
- return;
-}
-
-
-/**************************************************************************
- v m P u s h T i b
-** Binds the specified input string to the VM and clears >IN (the index)
-**************************************************************************/
-void vmPushTib(FICL_VM *pVM, char *text, TIB *pSaveTib)
-{
- if (pSaveTib)
- {
- *pSaveTib = pVM->tib;
- }
-
- pVM->tib.cp = text;
- pVM->tib.index = 0;
-}
-
-
-void vmPopTib(FICL_VM *pVM, TIB *pTib)
-{
- if (pTib)
- {
- pVM->tib = *pTib;
- }
- return;
-}
-
-
-/**************************************************************************
- v m Q u i t
-**
-**************************************************************************/
-void vmQuit(FICL_VM *pVM)
-{
- static FICL_WORD *pInterp = NULL;
- if (!pInterp)
- pInterp = ficlLookup("interpret");
- assert(pInterp);
-
- stackReset(pVM->rStack);
- pVM->fRestart = 0;
- pVM->ip = &pInterp;
- pVM->runningWord = pInterp;
- pVM->state = INTERPRET;
- pVM->tib.cp = NULL;
- pVM->tib.index = 0;
- pVM->pad[0] = '\0';
- pVM->sourceID.i = 0;
- return;
-}
-
-
-/**************************************************************************
- v m R e s e t
-**
-**************************************************************************/
-void vmReset(FICL_VM *pVM)
-{
- vmQuit(pVM);
- stackReset(pVM->pStack);
- pVM->base = 10;
- return;
-}
-
-
-/**************************************************************************
- v m S e t T e x t O u t
-** Binds the specified output callback to the vm. If you pass NULL,
-** binds the default output function (ficlTextOut)
-**************************************************************************/
-void vmSetTextOut(FICL_VM *pVM, OUTFUNC textOut)
-{
- if (textOut)
- pVM->textOut = textOut;
- else
- pVM->textOut = ficlTextOut;
-
- return;
-}
-
-
-/**************************************************************************
- v m T e x t O u t
-** Feeds text to the vm's output callback
-**************************************************************************/
-void vmTextOut(FICL_VM *pVM, char *text, int fNewline)
-{
- assert(pVM);
- assert(pVM->textOut);
- (pVM->textOut)(pVM, text, fNewline);
-
- return;
-}
-
-
-/**************************************************************************
- v m T h r o w
-**
-**************************************************************************/
-void vmThrow(FICL_VM *pVM, int except)
-{
- longjmp(*(pVM->pState), except);
-}
-
-
-void vmThrowErr(FICL_VM *pVM, char *fmt, ...)
-{
- va_list va;
- va_start(va, fmt);
- vsprintf(pVM->pad, fmt, va);
- vmTextOut(pVM, pVM->pad, 1);
- va_end(va);
- longjmp(*(pVM->pState), VM_ERREXIT);
-}
-
-
-/**************************************************************************
- w o r d I s I m m e d i a t e
-**
-**************************************************************************/
-int wordIsImmediate(FICL_WORD *pFW)
-{
- return ((pFW != NULL) && (pFW->flags & FW_IMMEDIATE));
-}
-
-
-/**************************************************************************
- w o r d I s C o m p i l e O n l y
-**
-**************************************************************************/
-int wordIsCompileOnly(FICL_WORD *pFW)
-{
- return ((pFW != NULL) && (pFW->flags & FW_COMPILE));
-}
-
-
-/**************************************************************************
- s t r r e v
-**
-**************************************************************************/
-char *strrev( char *string )
-{ /* reverse a string in-place */
- int i = strlen(string);
- char *p1 = string; /* first char of string */
- char *p2 = string + i - 1; /* last non-NULL char of string */
- char c;
-
- if (i > 1)
- {
- while (p1 < p2)
- {
- c = *p2;
- *p2 = *p1;
- *p1 = c;
- p1++; p2--;
- }
- }
-
- return string;
-}
-
-
-/**************************************************************************
- d i g i t _ t o _ c h a r
-**
-**************************************************************************/
-char digit_to_char(int value)
-{
- return digits[value];
-}
-
-
-/**************************************************************************
- l t o a
-**
-**************************************************************************/
-char *ltoa( INT32 value, char *string, int radix )
-{ /* convert long to string, any base */
- char *cp = string;
- int sign = ((radix == 10) && (value < 0));
- UNSQR result;
- UNS64 v;
-
- assert(radix > 1);
- assert(radix < 37);
- assert(string);
-
- if (sign)
- value = -value;
-
- if (value == 0)
- *cp++ = '0';
- else
- {
- v.hi = 0;
- v.lo = (UNS32)value;
- while (v.lo)
- {
- result = ficlLongDiv(v, (UNS32)radix);
- *cp++ = digits[result.rem];
- v.lo = result.quot;
- }
- }
-
- if (sign)
- *cp++ = '-';
-
- *cp++ = '\0';
-
- return strrev(string);
-}
-
-
-/**************************************************************************
- u l t o a
-**
-**************************************************************************/
-char *ultoa(UNS32 value, char *string, int radix )
-{ /* convert long to string, any base */
- char *cp = string;
- UNS64 ud;
- UNSQR result;
-
- assert(radix > 1);
- assert(radix < 37);
- assert(string);
-
- if (value == 0)
- *cp++ = '0';
- else
- {
- ud.hi = 0;
- ud.lo = value;
- result.quot = value;
-
- while (ud.lo)
- {
- result = ficlLongDiv(ud, (UNS32)radix);
- ud.lo = result.quot;
- *cp++ = digits[result.rem];
- }
- }
-
- *cp++ = '\0';
-
- return strrev(string);
-}
-
-
-/**************************************************************************
- c a s e F o l d
-** Case folds a NULL terminated string in place. All characters
-** get converted to lower case.
-**************************************************************************/
-char *caseFold(char *cp)
-{
- char *oldCp = cp;
-
- while (*cp)
- {
- if (isupper(*cp))
- *cp = (char)tolower(*cp);
- cp++;
- }
-
- return oldCp;
-}
-
-
-/**************************************************************************
- s t r i n c m p
-**
-**************************************************************************/
-int strincmp(char *cp1, char *cp2, FICL_COUNT count)
-{
- int i = 0;
- char c1, c2;
-
- for (c1 = *cp1, c2 = *cp2;
- ((i == 0) && count && c1 && c2);
- c1 = *++cp1, c2 = *++cp2, count--)
- {
- i = tolower(c1) - tolower(c2);
- }
-
- return i;
-}
-
-
-
-/**************************************************************************
- s k i p S p a c e
-** Given a string pointer, returns a pointer to the first non-space
-** char of the string, or to the NULL terminator if no such char found.
-**************************************************************************/
-char *skipSpace(char *cp)
-{
- assert(cp);
-
- while (isspace(*cp))
- cp++;
-
- return cp;
-}
-
-
diff --git a/sys/boot/ficl/words.c b/sys/boot/ficl/words.c
deleted file mode 100644
index c76c169a83d3..000000000000
--- a/sys/boot/ficl/words.c
+++ /dev/null
@@ -1,4544 +0,0 @@
-/*******************************************************************
-** w o r d s . c
-** Forth Inspired Command Language
-** ANS Forth CORE word-set written in C
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <fcntl.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-#include "math64.h"
-
-static void colonParen(FICL_VM *pVM);
-static void literalIm(FICL_VM *pVM);
-static void interpWord(FICL_VM *pVM, STRINGINFO si);
-
-/*
-** Control structure building words use these
-** strings' addresses as markers on the stack to
-** check for structure completion.
-*/
-static char doTag[] = "do";
-static char ifTag[] = "if";
-static char colonTag[] = "colon";
-static char leaveTag[] = "leave";
-static char beginTag[] = "begin";
-static char whileTag[] = "while";
-
-/*
-** Pointers to various words in the dictionary
-** -- initialized by ficlCompileCore, below --
-** for use by compiling words. Colon definitions
-** in ficl are lists of pointers to words. A bit
-** simple-minded...
-*/
-static FICL_WORD *pBranchParen = NULL;
-static FICL_WORD *pComma = NULL;
-static FICL_WORD *pDoParen = NULL;
-static FICL_WORD *pDoesParen = NULL;
-static FICL_WORD *pExitParen = NULL;
-static FICL_WORD *pIfParen = NULL;
-static FICL_WORD *pInterpret = NULL;
-static FICL_WORD *pLitParen = NULL;
-static FICL_WORD *pLoopParen = NULL;
-static FICL_WORD *pPLoopParen = NULL;
-static FICL_WORD *pQDoParen = NULL;
-static FICL_WORD *pSemiParen = NULL;
-static FICL_WORD *pStore = NULL;
-static FICL_WORD *pStringLit = NULL;
-static FICL_WORD *pType = NULL;
-
-#if FICL_WANT_LOCALS
-static FICL_WORD *pGetLocalParen= NULL;
-static FICL_WORD *pGetLocal0 = NULL;
-static FICL_WORD *pGetLocal1 = NULL;
-static FICL_WORD *pToLocalParen = NULL;
-static FICL_WORD *pToLocal0 = NULL;
-static FICL_WORD *pToLocal1 = NULL;
-static FICL_WORD *pLinkParen = NULL;
-static FICL_WORD *pUnLinkParen = NULL;
-static int nLocals = 0;
-#endif
-
-
-/*
-** C O N T R O L S T R U C T U R E B U I L D E R S
-**
-** Push current dict location for later branch resolution.
-** The location may be either a branch target or a patch address...
-*/
-static void markBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- stackPushPtr(pVM->pStack, dp->here);
- stackPushPtr(pVM->pStack, tag);
- return;
-}
-
-static void markControlTag(FICL_VM *pVM, char *tag)
-{
- stackPushPtr(pVM->pStack, tag);
- return;
-}
-
-static void matchControlTag(FICL_VM *pVM, char *tag)
-{
- char *cp = (char *)stackPopPtr(pVM->pStack);
- if ( strcmp(cp, tag) )
- {
- vmTextOut(pVM, "Warning -- unmatched control word: ", 0);
- vmTextOut(pVM, tag, 1);
- }
-
- return;
-}
-
-/*
-** Expect a branch target address on the param stack,
-** compile a literal offset from the current dict location
-** to the target address
-*/
-static void resolveBackBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- long offset;
- CELL *patchAddr;
-
- matchControlTag(pVM, tag);
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- offset = patchAddr - dp->here;
- dictAppendCell(dp, LVALUEtoCELL(offset));
-
- return;
-}
-
-
-/*
-** Expect a branch patch address on the param stack,
-** compile a literal offset from the patch location
-** to the current dict location
-*/
-static void resolveForwardBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- long offset;
- CELL *patchAddr;
-
- matchControlTag(pVM, tag);
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- offset = dp->here - patchAddr;
- *patchAddr = LVALUEtoCELL(offset);
-
- return;
-}
-
-/*
-** Match the tag to the top of the stack. If success,
-** sopy "here" address into the cell whose address is next
-** on the stack. Used by do..leave..loop.
-*/
-static void resolveAbsBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- CELL *patchAddr;
- char *cp;
-
- cp = stackPopPtr(pVM->pStack);
- if (strcmp(cp, tag))
- {
- vmTextOut(pVM, "Warning -- Unmatched control word: ", 0);
- vmTextOut(pVM, tag, 1);
- }
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- *patchAddr = LVALUEtoCELL(dp->here);
-
- return;
-}
-
-
-/**************************************************************************
- i s N u m b e r
-** Attempts to convert the NULL terminated string in the VM's pad to
-** a number using the VM's current base. If successful, pushes the number
-** onto the param stack and returns TRUE. Otherwise, returns FALSE.
-**************************************************************************/
-
-static int isNumber(FICL_VM *pVM, STRINGINFO si)
-{
- INT32 accum = 0;
- char isNeg = FALSE;
- unsigned base = pVM->base;
- char *cp = SI_PTR(si);
- FICL_COUNT count= (FICL_COUNT)SI_COUNT(si);
- unsigned ch;
- unsigned digit;
-
- if (*cp == '-')
- {
- cp++;
- count--;
- isNeg = TRUE;
- }
- else if ((cp[0] == '0') && (cp[1] == 'x'))
- { /* detect 0xNNNN format for hex numbers */
- cp += 2;
- count -= 2;
- base = 16;
- }
-
- if (count == 0)
- return FALSE;
-
- while (count-- && ((ch = *cp++) != '\0'))
- {
- if (ch < '0')
- return FALSE;
-
- digit = ch - '0';
-
- if (digit > 9)
- digit = tolower(ch) - 'a' + 10;
- /*
- ** Note: following test also catches chars between 9 and a
- ** because 'digit' is unsigned!
- */
- if (digit >= base)
- return FALSE;
-
- accum = accum * base + digit;
- }
-
- if (isNeg)
- accum = -accum;
-
- stackPushINT32(pVM->pStack, accum);
-
- return TRUE;
-}
-
-
-/**************************************************************************
- a d d & f r i e n d s
-**
-**************************************************************************/
-
-static void add(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i += stackGetTop(pVM->pStack).i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void sub(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i = stackGetTop(pVM->pStack).i - i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void mul(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i *= stackGetTop(pVM->pStack).i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void negate(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = -stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i);
- return;
-}
-
-static void ficlDiv(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i = stackGetTop(pVM->pStack).i / i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-/*
-** slash-mod CORE ( n1 n2 -- n3 n4 )
-** Divide n1 by n2, giving the single-cell remainder n3 and the single-cell
-** quotient n4. An ambiguous condition exists if n2 is zero. If n1 and n2
-** differ in sign, the implementation-defined result returned will be the
-** same as that returned by either the phrase
-** >R S>D R> FM/MOD or the phrase >R S>D R> SM/REM .
-** NOTE: Ficl complies with the second phrase (symmetric division)
-*/
-static void slashMod(FICL_VM *pVM)
-{
- INT64 n1;
- INT32 n2;
- INTQR qr;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 2);
-#endif
- n2 = stackPopINT32(pVM->pStack);
- n1.lo = stackPopINT32(pVM->pStack);
- i64Extend(n1);
-
- qr = m64SymmetricDivI(n1, n2);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-static void onePlus(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i += 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void oneMinus(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i -= 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void twoMul(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i *= 2;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void twoDiv(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i >>= 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void mulDiv(FICL_VM *pVM)
-{
- INT32 x, y, z;
- INT64 prod;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 1);
-#endif
- z = stackPopINT32(pVM->pStack);
- y = stackPopINT32(pVM->pStack);
- x = stackPopINT32(pVM->pStack);
-
- prod = m64MulI(x,y);
- x = m64SymmetricDivI(prod, z).quot;
-
- stackPushINT32(pVM->pStack, x);
- return;
-}
-
-
-static void mulDivRem(FICL_VM *pVM)
-{
- INT32 x, y, z;
- INT64 prod;
- INTQR qr;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 2);
-#endif
- z = stackPopINT32(pVM->pStack);
- y = stackPopINT32(pVM->pStack);
- x = stackPopINT32(pVM->pStack);
-
- prod = m64MulI(x,y);
- qr = m64SymmetricDivI(prod, z);
-
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- b y e
-** TOOLS
-** Signal the system to shut down - this causes ficlExec to return
-** VM_USEREXIT. The rest is up to you.
-**************************************************************************/
-
-static void bye(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_USEREXIT);
- return;
-}
-
-
-/**************************************************************************
- c o l o n d e f i n i t i o n s
-** Code to begin compiling a colon definition
-** This function sets the state to COMPILE, then creates a
-** new word whose name is the next word in the input stream
-** and whose code is colonParen.
-**************************************************************************/
-
-static void colon(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- pVM->state = COMPILE;
- markControlTag(pVM, colonTag);
- dictAppendWord2(dp, si, colonParen, FW_DEFAULT | FW_SMUDGE);
-#if FICL_WANT_LOCALS
- nLocals = 0;
-#endif
- return;
-}
-
-
-/**************************************************************************
- c o l o n P a r e n
-** This is the code that executes a colon definition. It assumes that the
-** virtual machine is running a "next" loop (See the vm.c
-** for its implementation of member function vmExecute()). The colon
-** code simply copies the address of the first word in the list of words
-** to interpret into IP after saving its old value. When we return to the
-** "next" loop, the virtual machine will call the code for each word in
-** turn.
-**
-**************************************************************************/
-
-static void colonParen(FICL_VM *pVM)
-{
- IPTYPE tempIP = (IPTYPE) (pVM->runningWord->param);
- vmPushIP(pVM, tempIP);
-
- return;
-}
-
-
-/**************************************************************************
- s e m i c o l o n C o I m
-**
-** IMMEDIATE code for ";". This function sets the state to INTERPRET and
-** terminates a word under compilation by appending code for "(;)" to
-** the definition. TO DO: checks for leftover branch target tags on the
-** return stack and complains if any are found.
-**************************************************************************/
-static void semiParen(FICL_VM *pVM)
-{
- vmPopIP(pVM);
- return;
-}
-
-
-static void semicolonCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pSemiParen);
- matchControlTag(pVM, colonTag);
-
-#if FICL_WANT_LOCALS
- assert(pUnLinkParen);
- if (nLocals > 0)
- {
- FICL_DICT *pLoc = ficlGetLoc();
- dictEmpty(pLoc, pLoc->pForthWords->size);
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
- nLocals = 0;
-#endif
-
- dictAppendCell(dp, LVALUEtoCELL(pSemiParen));
- pVM->state = INTERPRET;
- dictUnsmudge(dp);
- return;
-}
-
-
-/**************************************************************************
- e x i t
-** CORE
-** This function simply pops the previous instruction
-** pointer and returns to the "next" loop. Used for exiting from within
-** a definition. Note that exitParen is identical to semiParen - they
-** are in two different functions so that "see" can correctly identify
-** the end of a colon definition, even if it uses "exit".
-**************************************************************************/
-static void exitParen(FICL_VM *pVM)
-{
- vmPopIP(pVM);
- return;
-}
-
-static void exitCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- assert(pExitParen);
- IGNORE(pVM);
-
-#if FICL_WANT_LOCALS
- if (nLocals > 0)
- {
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
-#endif
- dictAppendCell(dp, LVALUEtoCELL(pExitParen));
- return;
-}
-
-
-/**************************************************************************
- c o n s t a n t P a r e n
-** This is the run-time code for "constant". It simply returns the
-** contents of its word's first data cell.
-**
-**************************************************************************/
-
-void constantParen(FICL_VM *pVM)
-{
- FICL_WORD *pFW = pVM->runningWord;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPush(pVM->pStack, pFW->param[0]);
- return;
-}
-
-void twoConstParen(FICL_VM *pVM)
-{
- FICL_WORD *pFW = pVM->runningWord;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 2);
-#endif
- stackPush(pVM->pStack, pFW->param[0]); /* lo */
- stackPush(pVM->pStack, pFW->param[1]); /* hi */
- return;
-}
-
-
-/**************************************************************************
- c o n s t a n t
-** IMMEDIATE
-** Compiles a constant into the dictionary. Constants return their
-** value when invoked. Expects a value on top of the parm stack.
-**************************************************************************/
-
-static void constant(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- dictAppendWord2(dp, si, constantParen, FW_DEFAULT);
- dictAppendCell(dp, stackPop(pVM->pStack));
- return;
-}
-
-
-static void twoConstant(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
- CELL c;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- c = stackPop(pVM->pStack);
- dictAppendWord2(dp, si, twoConstParen, FW_DEFAULT);
- dictAppendCell(dp, stackPop(pVM->pStack));
- dictAppendCell(dp, c);
- return;
-}
-
-
-/**************************************************************************
- d i s p l a y C e l l
-** Drop and print the contents of the cell at the top of the param
-** stack
-**************************************************************************/
-
-static void displayCell(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- c = stackPop(pVM->pStack);
- ltoa((c).i, pVM->pad, pVM->base);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-static void displayCellNoPad(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- c = stackPop(pVM->pStack);
- ltoa((c).i, pVM->pad, pVM->base);
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-static void uDot(FICL_VM *pVM)
-{
- UNS32 u;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- u = stackPopUNS32(pVM->pStack);
- ultoa(u, pVM->pad, pVM->base);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-
-static void hexDot(FICL_VM *pVM)
-{
- UNS32 u;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- u = stackPopUNS32(pVM->pStack);
- ultoa(u, pVM->pad, 16);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-
-/**************************************************************************
- d i s p l a y S t a c k
-** Display the parameter stack (code for ".s")
-**************************************************************************/
-
-static void displayStack(FICL_VM *pVM)
-{
- int d = stackDepth(pVM->pStack);
- int i;
- CELL *pCell;
-
- vmCheckStack(pVM, 0, 0);
-
- if (d == 0)
- vmTextOut(pVM, "(Stack Empty)", 1);
- else
- {
- pCell = pVM->pStack->sp;
- for (i = 0; i < d; i++)
- {
- vmTextOut(pVM, ltoa((*--pCell).i, pVM->pad, pVM->base), 1);
- }
- }
-}
-
-
-/**************************************************************************
- d u p & f r i e n d s
-**
-**************************************************************************/
-
-static void depth(FICL_VM *pVM)
-{
- int i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- i = stackDepth(pVM->pStack);
- stackPushINT32(pVM->pStack, i);
- return;
-}
-
-
-static void drop(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- stackDrop(pVM->pStack, 1);
- return;
-}
-
-
-static void twoDrop(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- stackDrop(pVM->pStack, 2);
- return;
-}
-
-
-static void dup(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- stackPick(pVM->pStack, 0);
- return;
-}
-
-
-static void twoDup(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 4);
-#endif
- stackPick(pVM->pStack, 1);
- stackPick(pVM->pStack, 1);
- return;
-}
-
-
-static void over(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 3);
-#endif
- stackPick(pVM->pStack, 1);
- return;
-}
-
-static void twoOver(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 4, 6);
-#endif
- stackPick(pVM->pStack, 3);
- stackPick(pVM->pStack, 3);
- return;
-}
-
-
-static void pick(FICL_VM *pVM)
-{
- CELL c = stackPop(pVM->pStack);
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, c.i+1, c.i+2);
-#endif
- stackPick(pVM->pStack, c.i);
- return;
-}
-
-
-static void questionDup(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- c = stackGetTop(pVM->pStack);
-
- if (c.i != 0)
- stackPick(pVM->pStack, 0);
-
- return;
-}
-
-
-static void roll(FICL_VM *pVM)
-{
- int i = stackPop(pVM->pStack).i;
- i = (i > 0) ? i : 0;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, i+1, i+1);
-#endif
- stackRoll(pVM->pStack, i);
- return;
-}
-
-
-static void minusRoll(FICL_VM *pVM)
-{
- int i = stackPop(pVM->pStack).i;
- i = (i > 0) ? i : 0;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, i+1, i+1);
-#endif
- stackRoll(pVM->pStack, -i);
- return;
-}
-
-
-static void rot(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 3);
-#endif
- stackRoll(pVM->pStack, 2);
- return;
-}
-
-
-static void swap(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 2);
-#endif
- stackRoll(pVM->pStack, 1);
- return;
-}
-
-
-static void twoSwap(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 4, 4);
-#endif
- stackRoll(pVM->pStack, 3);
- stackRoll(pVM->pStack, 3);
- return;
-}
-
-
-/**************************************************************************
- e m i t & f r i e n d s
-**
-**************************************************************************/
-
-static void emit(FICL_VM *pVM)
-{
- char *cp = pVM->pad;
- int i;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- i = stackPopINT32(pVM->pStack);
- cp[0] = (char)i;
- cp[1] = '\0';
- vmTextOut(pVM, cp, 0);
- return;
-}
-
-
-static void cr(FICL_VM *pVM)
-{
- vmTextOut(pVM, "", 1);
- return;
-}
-
-
-static void commentLine(FICL_VM *pVM)
-{
- char *cp = vmGetInBuf(pVM);
- char ch = *cp;
-
- while ((ch != '\0') && (ch != '\r') && (ch != '\n'))
- {
- ch = *++cp;
- }
-
- /*
- ** Cope with DOS or UNIX-style EOLs -
- ** Check for /r, /n, /r/n, or /n/r end-of-line sequences,
- ** and point cp to next char. If EOL is \0, we're done.
- */
- if (ch != '\0')
- {
- cp++;
-
- if ( (ch != *cp)
- && ((*cp == '\r') || (*cp == '\n')) )
- cp++;
- }
-
- vmUpdateTib(pVM, cp);
- return;
-}
-
-
-/*
-** paren CORE
-** Compilation: Perform the execution semantics given below.
-** Execution: ( "ccc<paren>" -- )
-** Parse ccc delimited by ) (right parenthesis). ( is an immediate word.
-** The number of characters in ccc may be zero to the number of characters
-** in the parse area.
-**
-*/
-static void commentHang(FICL_VM *pVM)
-{
- vmParseString(pVM, ')');
- return;
-}
-
-
-/**************************************************************************
- F E T C H & S T O R E
-**
-**************************************************************************/
-
-static void fetch(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- stackPush(pVM->pStack, *pCell);
- return;
-}
-
-/*
-** two-fetch CORE ( a-addr -- x1 x2 )
-** Fetch the cell pair x1 x2 stored at a-addr. x2 is stored at a-addr and
-** x1 at the next consecutive cell. It is equivalent to the sequence
-** DUP CELL+ @ SWAP @ .
-*/
-static void twoFetch(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- stackPush(pVM->pStack, *pCell++);
- stackPush(pVM->pStack, *pCell);
- swap(pVM);
- return;
-}
-
-/*
-** store CORE ( x a-addr -- )
-** Store x at a-addr.
-*/
-static void store(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- *pCell = stackPop(pVM->pStack);
-}
-
-/*
-** two-store CORE ( x1 x2 a-addr -- )
-** Store the cell pair x1 x2 at a-addr, with x2 at a-addr and x1 at the
-** next consecutive cell. It is equivalent to the sequence
-** SWAP OVER ! CELL+ ! .
-*/
-static void twoStore(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- *pCell++ = stackPop(pVM->pStack);
- *pCell = stackPop(pVM->pStack);
-}
-
-static void plusStore(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- pCell->i += stackPop(pVM->pStack).i;
-}
-
-
-static void wFetch(FICL_VM *pVM)
-{
- UNS16 *pw;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pw = (UNS16 *)stackPopPtr(pVM->pStack);
- stackPushUNS32(pVM->pStack, (UNS32)*pw);
- return;
-}
-
-static void wStore(FICL_VM *pVM)
-{
- UNS16 *pw;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pw = (UNS16 *)stackPopPtr(pVM->pStack);
- *pw = (UNS16)(stackPop(pVM->pStack).u);
-}
-
-static void cFetch(FICL_VM *pVM)
-{
- UNS8 *pc;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pc = (UNS8 *)stackPopPtr(pVM->pStack);
- stackPushUNS32(pVM->pStack, (UNS32)*pc);
- return;
-}
-
-static void cStore(FICL_VM *pVM)
-{
- UNS8 *pc;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pc = (UNS8 *)stackPopPtr(pVM->pStack);
- *pc = (UNS8)(stackPop(pVM->pStack).u);
-}
-
-
-/**************************************************************************
- i f C o I m
-** IMMEDIATE
-** Compiles code for a conditional branch into the dictionary
-** and pushes the branch patch address on the stack for later
-** patching by ELSE or THEN/ENDIF.
-**************************************************************************/
-
-static void ifCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- markBranch(dp, pVM, ifTag);
- dictAppendUNS32(dp, 1);
- return;
-}
-
-
-/**************************************************************************
- i f P a r e n
-** Runtime code to do "if" or "until": pop a flag from the stack,
-** fall through if true, branch if false. Probably ought to be
-** called (not?branch) since it does "branch if false".
-**************************************************************************/
-
-static void ifParen(FICL_VM *pVM)
-{
- UNS32 flag;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- flag = stackPopUNS32(pVM->pStack);
-
- if (flag)
- { /* fall through */
- vmBranchRelative(pVM, 1);
- }
- else
- { /* take branch (to else/endif/begin) */
- vmBranchRelative(pVM, (int)(*pVM->ip));
- }
-
- return;
-}
-
-
-/**************************************************************************
- e l s e C o I m
-**
-** IMMEDIATE -- compiles an "else"...
-** 1) Compile a branch and a patch address; the address gets patched
-** by "endif" to point past the "else" code.
-** 2) Pop the the "if" patch address
-** 3) Patch the "if" branch to point to the current compile address.
-** 4) Push the "else" patch address. ("endif" patches this to jump past
-** the "else" code.
-**************************************************************************/
-
-static void elseCoIm(FICL_VM *pVM)
-{
- CELL *patchAddr;
- int offset;
- FICL_DICT *dp = ficlGetDict();
-
- assert(pBranchParen);
- /* (1) compile branch runtime */
- dictAppendCell(dp, LVALUEtoCELL(pBranchParen));
- matchControlTag(pVM, ifTag);
- patchAddr =
- (CELL *)stackPopPtr(pVM->pStack); /* (2) pop "if" patch addr */
- markBranch(dp, pVM, ifTag); /* (4) push "else" patch addr */
- dictAppendUNS32(dp, 1); /* (1) compile patch placeholder */
- offset = dp->here - patchAddr;
- *patchAddr = LVALUEtoCELL(offset); /* (3) Patch "if" */
-
- return;
-}
-
-
-/**************************************************************************
- b r a n c h P a r e n
-**
-** Runtime for "(branch)" -- expects a literal offset in the next
-** compilation address, and branches to that location.
-**************************************************************************/
-
-static void branchParen(FICL_VM *pVM)
-{
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- return;
-}
-
-
-/**************************************************************************
- e n d i f C o I m
-**
-**************************************************************************/
-
-static void endifCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- resolveForwardBranch(dp, pVM, ifTag);
- return;
-}
-
-
-/**************************************************************************
- i n t e r p r e t
-** This is the "user interface" of a Forth. It does the following:
-** while there are words in the VM's Text Input Buffer
-** Copy next word into the pad (vmGetWord)
-** Attempt to find the word in the dictionary (dictLookup)
-** If successful, execute the word.
-** Otherwise, attempt to convert the word to a number (isNumber)
-** If successful, push the number onto the parameter stack.
-** Otherwise, print an error message and exit loop...
-** End Loop
-**
-** From the standard, section 3.4
-** Text interpretation (see 6.1.1360 EVALUATE and 6.1.2050 QUIT) shall
-** repeat the following steps until either the parse area is empty or an
-** ambiguous condition exists:
-** a) Skip leading spaces and parse a name (see 3.4.1);
-**************************************************************************/
-
-static void interpret(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
- assert(pVM);
-
- vmBranchRelative(pVM, -1);
-
- /*
- // Get next word...if out of text, we're done.
- */
- if (si.count == 0)
- {
- vmThrow(pVM, VM_OUTOFTEXT);
- }
-
- interpWord(pVM, si);
-
-
- return; /* back to inner interpreter */
-}
-
-/**************************************************************************
-** From the standard, section 3.4
-** b) Search the dictionary name space (see 3.4.2). If a definition name
-** matching the string is found:
-** 1.if interpreting, perform the interpretation semantics of the definition
-** (see 3.4.3.2), and continue at a);
-** 2.if compiling, perform the compilation semantics of the definition
-** (see 3.4.3.3), and continue at a).
-**
-** c) If a definition name matching the string is not found, attempt to
-** convert the string to a number (see 3.4.1.3). If successful:
-** 1.if interpreting, place the number on the data stack, and continue at a);
-** 2.if compiling, compile code that when executed will place the number on
-** the stack (see 6.1.1780 LITERAL), and continue at a);
-**
-** d) If unsuccessful, an ambiguous condition exists (see 3.4.4).
-**************************************************************************/
-static void interpWord(FICL_VM *pVM, STRINGINFO si)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *tempFW;
-
-#if FICL_ROBUST
- dictCheck(dp, pVM, 0);
- vmCheckStack(pVM, 0, 0);
-#endif
-
-#if FICL_WANT_LOCALS
- if (nLocals > 0)
- {
- tempFW = dictLookupLoc(dp, si);
- }
- else
-#endif
- tempFW = dictLookup(dp, si);
-
- if (pVM->state == INTERPRET)
- {
- if (tempFW != NULL)
- {
- if (wordIsCompileOnly(tempFW))
- {
- vmThrowErr(pVM, "Error: Compile only!");
- }
-
- vmExecute(pVM, tempFW);
- }
-
- else if (!isNumber(pVM, si))
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- }
-
- else /* (pVM->state == COMPILE) */
- {
- if (tempFW != NULL)
- {
- if (wordIsImmediate(tempFW))
- {
- vmExecute(pVM, tempFW);
- }
- else
- {
- dictAppendCell(dp, LVALUEtoCELL(tempFW));
- }
- }
- else if (isNumber(pVM, si))
- {
- literalIm(pVM);
- }
- else
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- }
-
- return;
-}
-
-
-/**************************************************************************
- l i t e r a l P a r e n
-**
-** This is the runtime for (literal). It assumes that it is part of a colon
-** definition, and that the next CELL contains a value to be pushed on the
-** parameter stack at runtime. This code is compiled by "literal".
-**
-**************************************************************************/
-
-static void literalParen(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPushINT32(pVM->pStack, *(INT32 *)(pVM->ip));
- vmBranchRelative(pVM, 1);
- return;
-}
-
-
-/**************************************************************************
- l i t e r a l I m
-**
-** IMMEDIATE code for "literal". This function gets a value from the stack
-** and compiles it into the dictionary preceded by the code for "(literal)".
-** IMMEDIATE
-**************************************************************************/
-
-static void literalIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- assert(pLitParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pLitParen));
- dictAppendCell(dp, stackPop(pVM->pStack));
-
- return;
-}
-
-
-/**************************************************************************
- l i s t W o r d s
-**
-**************************************************************************/
-#define nCOLWIDTH 8
-static void listWords(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pHash = dp->pSearch[dp->nLists - 1];
- FICL_WORD *wp;
- int nChars = 0;
- int len;
- int y = 0;
- unsigned i;
- int nWords = 0;
- char *cp;
- char *pPad = pVM->pad;
-
- for (i = 0; i < pHash->size; i++)
- {
- for (wp = pHash->table[i]; wp != NULL; wp = wp->link, nWords++)
- {
- if (wp->nName == 0) /* ignore :noname defs */
- continue;
-
- cp = wp->name;
- nChars += sprintf(pPad + nChars, "%s", cp);
-
- if (nChars > 70)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- y++;
- if(y>23) {
- y=0;
- vmTextOut(pVM, "--- Press Enter to continue ---",0);
- getchar();
- vmTextOut(pVM,"\r",0);
- }
- vmTextOut(pVM, pPad, 1);
- }
- else
- {
- len = nCOLWIDTH - nChars % nCOLWIDTH;
- while (len-- > 0)
- pPad[nChars++] = ' ';
- }
-
- if (nChars > 70)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- y++;
- if(y>23) {
- y=0;
- vmTextOut(pVM, "--- Press Enter to continue ---",0);
- getchar();
- vmTextOut(pVM,"\r",0);
- }
- vmTextOut(pVM, pPad, 1);
- }
- }
- }
-
- if (nChars > 0)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- vmTextOut(pVM, pPad, 1);
- }
-
- sprintf(pVM->pad, "Dictionary: %d words, %ld cells used of %lu total",
- nWords, dp->here - dp->dict, dp->size);
- vmTextOut(pVM, pVM->pad, 1);
- return;
-}
-
-
-static void listEnv(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetEnv();
- FICL_HASH *pHash = dp->pForthWords;
- FICL_WORD *wp;
- unsigned i;
- int nWords = 0;
-
- for (i = 0; i < pHash->size; i++)
- {
- for (wp = pHash->table[i]; wp != NULL; wp = wp->link, nWords++)
- {
- vmTextOut(pVM, wp->name, 1);
- }
- }
-
- sprintf(pVM->pad, "Environment: %d words, %ld cells used of %lu total",
- nWords, dp->here - dp->dict, dp->size);
- vmTextOut(pVM, pVM->pad, 1);
- return;
-}
-
-
-/**************************************************************************
- l o g i c a n d c o m p a r i s o n s
-**
-**************************************************************************/
-
-static void zeroEquals(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) == 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void zeroLess(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) < 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void zeroGreater(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) > 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void isEqual(FICL_VM *pVM)
-{
- CELL x, y;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i == y.i));
- return;
-}
-
-static void isLess(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- y = stackPop(pVM->pStack);
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i < y.i));
- return;
-}
-
-static void uIsLess(FICL_VM *pVM)
-{
- UNS32 u1, u2;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- u2 = stackPopUNS32(pVM->pStack);
- u1 = stackPopUNS32(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(u1 < u2));
- return;
-}
-
-static void isGreater(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- y = stackPop(pVM->pStack);
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i > y.i));
- return;
-}
-
-static void bitwiseAnd(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i & y.i);
- return;
-}
-
-static void bitwiseOr(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i | y.i);
- return;
-}
-
-static void bitwiseXor(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i ^ y.i);
- return;
-}
-
-static void bitwiseNot(FICL_VM *pVM)
-{
- CELL x;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, ~x.i);
- return;
-}
-
-
-/**************************************************************************
- D o / L o o p
-** do -- IMMEDIATE COMPILE ONLY
-** Compiles code to initialize a loop: compile (do),
-** allot space to hold the "leave" address, push a branch
-** target address for the loop.
-** (do) -- runtime for "do"
-** pops index and limit from the p stack and moves them
-** to the r stack, then skips to the loop body.
-** loop -- IMMEDIATE COMPILE ONLY
-** +loop
-** Compiles code for the test part of a loop:
-** compile (loop), resolve forward branch from "do", and
-** copy "here" address to the "leave" address allotted by "do"
-** i,j,k -- COMPILE ONLY
-** Runtime: Push loop indices on param stack (i is innermost loop...)
-** Note: each loop has three values on the return stack:
-** ( R: leave limit index )
-** "leave" is the absolute address of the next cell after the loop
-** limit and index are the loop control variables.
-** leave -- COMPILE ONLY
-** Runtime: pop the loop control variables, then pop the
-** "leave" address and jump (absolute) there.
-**************************************************************************/
-
-static void doCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pDoParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pDoParen));
- /*
- ** Allot space for a pointer to the end
- ** of the loop - "leave" uses this...
- */
- markBranch(dp, pVM, leaveTag);
- dictAppendUNS32(dp, 0);
- /*
- ** Mark location of head of loop...
- */
- markBranch(dp, pVM, doTag);
-
- return;
-}
-
-
-static void doParen(FICL_VM *pVM)
-{
- CELL index, limit;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- index = stackPop(pVM->pStack);
- limit = stackPop(pVM->pStack);
-
- /* copy "leave" target addr to stack */
- stackPushPtr(pVM->rStack, *(pVM->ip++));
- stackPush(pVM->rStack, limit);
- stackPush(pVM->rStack, index);
-
- return;
-}
-
-
-static void qDoCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pQDoParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pQDoParen));
- /*
- ** Allot space for a pointer to the end
- ** of the loop - "leave" uses this...
- */
- markBranch(dp, pVM, leaveTag);
- dictAppendUNS32(dp, 0);
- /*
- ** Mark location of head of loop...
- */
- markBranch(dp, pVM, doTag);
-
- return;
-}
-
-
-static void qDoParen(FICL_VM *pVM)
-{
- CELL index, limit;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- index = stackPop(pVM->pStack);
- limit = stackPop(pVM->pStack);
-
- /* copy "leave" target addr to stack */
- stackPushPtr(pVM->rStack, *(pVM->ip++));
-
- if (limit.u == index.u)
- {
- vmPopIP(pVM);
- }
- else
- {
- stackPush(pVM->rStack, limit);
- stackPush(pVM->rStack, index);
- }
-
- return;
-}
-
-
-/*
-** Runtime code to break out of a do..loop construct
-** Drop the loop control variables; the branch address
-** past "loop" is next on the return stack.
-*/
-static void leaveCo(FICL_VM *pVM)
-{
- /* almost unloop */
- stackDrop(pVM->rStack, 2);
- /* exit */
- vmPopIP(pVM);
- return;
-}
-
-
-static void unloopCo(FICL_VM *pVM)
-{
- stackDrop(pVM->rStack, 3);
- return;
-}
-
-
-static void loopCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pLoopParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pLoopParen));
- resolveBackBranch(dp, pVM, doTag);
- resolveAbsBranch(dp, pVM, leaveTag);
- return;
-}
-
-
-static void plusLoopCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pPLoopParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pPLoopParen));
- resolveBackBranch(dp, pVM, doTag);
- resolveAbsBranch(dp, pVM, leaveTag);
- return;
-}
-
-
-static void loopParen(FICL_VM *pVM)
-{
- INT32 index = stackGetTop(pVM->rStack).i;
- INT32 limit = stackFetch(pVM->rStack, 1).i;
-
- index++;
-
- if (index >= limit)
- {
- stackDrop(pVM->rStack, 3); /* nuke the loop indices & "leave" addr */
- vmBranchRelative(pVM, 1); /* fall through the loop */
- }
- else
- { /* update index, branch to loop head */
- stackSetTop(pVM->rStack, LVALUEtoCELL(index));
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- }
-
- return;
-}
-
-
-static void plusLoopParen(FICL_VM *pVM)
-{
- INT32 index = stackGetTop(pVM->rStack).i;
- INT32 limit = stackFetch(pVM->rStack, 1).i;
- INT32 increment = stackPop(pVM->pStack).i;
- int flag;
-
- index += increment;
-
- if (increment < 0)
- flag = (index < limit);
- else
- flag = (index >= limit);
-
- if (flag)
- {
- stackDrop(pVM->rStack, 3); /* nuke the loop indices & "leave" addr */
- vmBranchRelative(pVM, 1); /* fall through the loop */
- }
- else
- { /* update index, branch to loop head */
- stackSetTop(pVM->rStack, LVALUEtoCELL(index));
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- }
-
- return;
-}
-
-
-static void loopICo(FICL_VM *pVM)
-{
- CELL index = stackGetTop(pVM->rStack);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-static void loopJCo(FICL_VM *pVM)
-{
- CELL index = stackFetch(pVM->rStack, 3);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-static void loopKCo(FICL_VM *pVM)
-{
- CELL index = stackFetch(pVM->rStack, 6);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-/**************************************************************************
- r e t u r n s t a c k
-**
-**************************************************************************/
-
-static void toRStack(FICL_VM *pVM)
-{
- stackPush(pVM->rStack, stackPop(pVM->pStack));
- return;
-}
-
-static void fromRStack(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, stackPop(pVM->rStack));
- return;
-}
-
-static void fetchRStack(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, stackGetTop(pVM->rStack));
- return;
-}
-
-
-/**************************************************************************
- v a r i a b l e
-**
-**************************************************************************/
-
-static void variableParen(FICL_VM *pVM)
-{
- FICL_WORD *fw = pVM->runningWord;
- stackPushPtr(pVM->pStack, fw->param);
- return;
-}
-
-
-static void variable(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- dictAppendWord2(dp, si, variableParen, FW_DEFAULT);
- dictAllotCells(dp, 1);
- return;
-}
-
-
-
-/**************************************************************************
- b a s e & f r i e n d s
-**
-**************************************************************************/
-
-static void base(FICL_VM *pVM)
-{
- CELL *pBase = (CELL *)(&pVM->base);
- stackPush(pVM->pStack, LVALUEtoCELL(pBase));
- return;
-}
-
-
-static void decimal(FICL_VM *pVM)
-{
- pVM->base = 10;
- return;
-}
-
-
-static void hex(FICL_VM *pVM)
-{
- pVM->base = 16;
- return;
-}
-
-
-/**************************************************************************
- a l l o t & f r i e n d s
-**
-**************************************************************************/
-
-static void allot(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- INT32 i = stackPopINT32(pVM->pStack);
-#if FICL_ROBUST
- dictCheck(dp, pVM, i);
-#endif
- dictAllot(dp, i);
- return;
-}
-
-
-static void here(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- stackPushPtr(pVM->pStack, dp->here);
- return;
-}
-
-
-static void comma(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- CELL c = stackPop(pVM->pStack);
- dictAppendCell(dp, c);
- return;
-}
-
-
-static void cComma(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- char c = (char)stackPopINT32(pVM->pStack);
- dictAppendChar(dp, c);
- return;
-}
-
-
-static void cells(FICL_VM *pVM)
-{
- INT32 i = stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i * (INT32)sizeof (CELL));
- return;
-}
-
-
-static void cellPlus(FICL_VM *pVM)
-{
- char *cp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, cp + sizeof (CELL));
- return;
-}
-
-
-/**************************************************************************
- t i c k
-** tick CORE ( "<spaces>name" -- xt )
-** Skip leading space delimiters. Parse name delimited by a space. Find
-** name and return xt, the execution token for name. An ambiguous condition
-** exists if name is not found.
-**************************************************************************/
-static void tick(FICL_VM *pVM)
-{
- FICL_WORD *pFW = NULL;
- STRINGINFO si = vmGetWord(pVM);
-
- pFW = dictLookup(ficlGetDict(), si);
- if (!pFW)
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- stackPushPtr(pVM->pStack, pFW);
- return;
-}
-
-
-static void bracketTickCoIm(FICL_VM *pVM)
-{
- tick(pVM);
- literalIm(pVM);
-
- return;
-}
-
-
-/**************************************************************************
- p o s t p o n e
-** Lookup the next word in the input stream and compile code to
-** insert it into definitions created by the resulting word
-** (defers compilation, even of immediate words)
-**************************************************************************/
-
-static void postponeCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
- assert(pComma);
-
- tick(pVM);
- pFW = stackGetTop(pVM->pStack).p;
- if (wordIsImmediate(pFW))
- {
- dictAppendCell(dp, stackPop(pVM->pStack));
- }
- else
- {
- literalIm(pVM);
- dictAppendCell(dp, LVALUEtoCELL(pComma));
- }
-
- return;
-}
-
-
-
-/**************************************************************************
- e x e c u t e
-** Pop an execution token (pointer to a word) off the stack and
-** run it
-**************************************************************************/
-
-static void execute(FICL_VM *pVM)
-{
- FICL_WORD *pFW;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
-
- pFW = stackPopPtr(pVM->pStack);
- vmExecute(pVM, pFW);
-
- return;
-}
-
-
-/**************************************************************************
- i m m e d i a t e
-** Make the most recently compiled word IMMEDIATE -- it executes even
-** in compile state (most often used for control compiling words
-** such as IF, THEN, etc)
-**************************************************************************/
-
-static void immediate(FICL_VM *pVM)
-{
- IGNORE(pVM);
- dictSetImmediate(ficlGetDict());
- return;
-}
-
-
-static void compileOnly(FICL_VM *pVM)
-{
- IGNORE(pVM);
- dictSetFlags(ficlGetDict(), FW_COMPILE, 0);
- return;
-}
-
-
-/**************************************************************************
- d o t Q u o t e
-** IMMEDIATE word that compiles a string literal for later display
-** Compile stringLit, then copy the bytes of the string from the TIB
-** to the dictionary. Backpatch the count byte and align the dictionary.
-**
-** stringlit: Fetch the count from the dictionary, then push the address
-** and count on the stack. Finally, update ip to point to the first
-** aligned address after the string text.
-**************************************************************************/
-
-static void stringLit(FICL_VM *pVM)
-{
- FICL_STRING *sp = (FICL_STRING *)(pVM->ip);
- FICL_COUNT count = sp->count;
- char *cp = sp->text;
- stackPushPtr(pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
- cp += count + 1;
- cp = alignPtr(cp);
- pVM->ip = (IPTYPE)(void *)cp;
- return;
-}
-
-static void dotQuoteCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- dp->here = PTRtoCELL vmGetString(pVM, (FICL_STRING *)dp->here, '\"');
- dictAlign(dp);
- dictAppendCell(dp, LVALUEtoCELL(pType));
- return;
-}
-
-
-static void dotParen(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- char *pDest = pVM->pad;
- char ch;
-
- pSrc = skipSpace(pSrc);
-
- for (ch = *pSrc; (ch != '\0') && (ch != ')'); ch = *++pSrc)
- *pDest++ = ch;
-
- *pDest = '\0';
- if (ch == ')')
- pSrc++;
-
- vmTextOut(pVM, pVM->pad, 0);
- vmUpdateTib(pVM, pSrc);
-
- return;
-}
-
-
-/**************************************************************************
- s l i t e r a l
-** STRING
-** Interpretation: Interpretation semantics for this word are undefined.
-** Compilation: ( c-addr1 u -- )
-** Append the run-time semantics given below to the current definition.
-** Run-time: ( -- c-addr2 u )
-** Return c-addr2 u describing a string consisting of the characters
-** specified by c-addr1 u during compilation. A program shall not alter
-** the returned string.
-**************************************************************************/
-static void sLiteralCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- char *cp, *cpDest;
- UNS32 u;
- u = stackPopUNS32(pVM->pStack);
- cp = stackPopPtr(pVM->pStack);
-
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- cpDest = (char *) dp->here;
- *cpDest++ = (char) u;
-
- for (; u > 0; --u)
- {
- *cpDest++ = *cp++;
- }
-
- *cpDest++ = 0;
- dp->here = PTRtoCELL alignPtr(cpDest);
- return;
-}
-
-
-/**************************************************************************
- s t a t e
-** Return the address of the VM's state member (must be sized the
-** same as a CELL for this reason)
-**************************************************************************/
-static void state(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, &pVM->state);
- return;
-}
-
-
-/**************************************************************************
- c r e a t e . . . d o e s >
-** Make a new word in the dictionary with the run-time effect of
-** a variable (push my address), but with extra space allotted
-** for use by does> .
-**************************************************************************/
-
-static void createParen(FICL_VM *pVM)
-{
- CELL *pCell = pVM->runningWord->param;
- stackPushPtr(pVM->pStack, pCell+1);
- return;
-}
-
-
-static void create(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- dictAppendWord2(dp, si, createParen, FW_DEFAULT);
- dictAllotCells(dp, 1);
- return;
-}
-
-
-static void doDoes(FICL_VM *pVM)
-{
- CELL *pCell = pVM->runningWord->param;
- IPTYPE tempIP = (IPTYPE)((*pCell).p);
- stackPushPtr(pVM->pStack, pCell+1);
- vmPushIP(pVM, tempIP);
- return;
-}
-
-
-static void doesParen(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- dp->smudge->code = doDoes;
- dp->smudge->param[0] = LVALUEtoCELL(pVM->ip);
- vmPopIP(pVM);
- return;
-}
-
-
-static void doesCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-#if FICL_WANT_LOCALS
- assert(pUnLinkParen);
- if (nLocals > 0)
- {
- FICL_DICT *pLoc = ficlGetLoc();
- dictEmpty(pLoc, pLoc->pForthWords->size);
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
-
- nLocals = 0;
-#endif
- IGNORE(pVM);
-
- dictAppendCell(dp, LVALUEtoCELL(pDoesParen));
- return;
-}
-
-
-/**************************************************************************
- t o b o d y
-** to-body CORE ( xt -- a-addr )
-** a-addr is the data-field address corresponding to xt. An ambiguous
-** condition exists if xt is not for a word defined via CREATE.
-**************************************************************************/
-static void toBody(FICL_VM *pVM)
-{
- FICL_WORD *pFW = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, pFW->param + 1);
- return;
-}
-
-
-/*
-** from-body ficl ( a-addr -- xt )
-** Reverse effect of >body
-*/
-static void fromBody(FICL_VM *pVM)
-{
- char *ptr = (char *) stackPopPtr(pVM->pStack) - sizeof (FICL_WORD);
- stackPushPtr(pVM->pStack, ptr);
- return;
-}
-
-
-/*
-** >name ficl ( xt -- c-addr u )
-** Push the address and length of a word's name given its address
-** xt.
-*/
-static void toName(FICL_VM *pVM)
-{
- FICL_WORD *pFW = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, pFW->name);
- stackPushUNS32(pVM->pStack, pFW->nName);
- return;
-}
-
-
-/**************************************************************************
- l b r a c k e t e t c
-**
-**************************************************************************/
-
-static void lbracketCoIm(FICL_VM *pVM)
-{
- pVM->state = INTERPRET;
- return;
-}
-
-
-static void rbracket(FICL_VM *pVM)
-{
- pVM->state = COMPILE;
- return;
-}
-
-
-/**************************************************************************
- p i c t u r e d n u m e r i c w o r d s
-**
-** less-number-sign CORE ( -- )
-** Initialize the pictured numeric output conversion process.
-** (clear the pad)
-**************************************************************************/
-static void lessNumberSign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- sp->count = 0;
- return;
-}
-
-/*
-** number-sign CORE ( ud1 -- ud2 )
-** Divide ud1 by the number in BASE giving the quotient ud2 and the remainder
-** n. (n is the least-significant digit of ud1.) Convert n to external form
-** and add the resulting character to the beginning of the pictured numeric
-** output string. An ambiguous condition exists if # executes outside of a
-** <# #> delimited number conversion.
-*/
-static void numberSign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- UNS64 u;
- UNS16 rem;
-
- u = u64Pop(pVM->pStack);
- rem = m64UMod(&u, (UNS16)(pVM->base));
- sp->text[sp->count++] = digit_to_char(rem);
- u64Push(pVM->pStack, u);
- return;
-}
-
-/*
-** number-sign-greater CORE ( xd -- c-addr u )
-** Drop xd. Make the pictured numeric output string available as a character
-** string. c-addr and u specify the resulting character string. A program
-** may replace characters within the string.
-*/
-static void numberSignGreater(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- sp->text[sp->count] = '\0';
- strrev(sp->text);
- stackDrop(pVM->pStack, 2);
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- return;
-}
-
-/*
-** number-sign-s CORE ( ud1 -- ud2 )
-** Convert one digit of ud1 according to the rule for #. Continue conversion
-** until the quotient is zero. ud2 is zero. An ambiguous condition exists if
-** #S executes outside of a <# #> delimited number conversion.
-** TO DO: presently does not use ud1 hi cell - use it!
-*/
-static void numberSignS(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- UNS64 u;
- UNS16 rem;
-
- u = u64Pop(pVM->pStack);
-
- do
- {
- rem = m64UMod(&u, (UNS16)(pVM->base));
- sp->text[sp->count++] = digit_to_char(rem);
- }
- while (u.hi || u.lo);
-
- u64Push(pVM->pStack, u);
- return;
-}
-
-/*
-** HOLD CORE ( char -- )
-** Add char to the beginning of the pictured numeric output string. An ambiguous
-** condition exists if HOLD executes outside of a <# #> delimited number conversion.
-*/
-static void hold(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- int i = stackPopINT32(pVM->pStack);
- sp->text[sp->count++] = (char) i;
- return;
-}
-
-/*
-** SIGN CORE ( n -- )
-** If n is negative, add a minus sign to the beginning of the pictured
-** numeric output string. An ambiguous condition exists if SIGN
-** executes outside of a <# #> delimited number conversion.
-*/
-static void sign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- int i = stackPopINT32(pVM->pStack);
- if (i < 0)
- sp->text[sp->count++] = '-';
- return;
-}
-
-
-/**************************************************************************
- t o N u m b e r
-** to-number CORE ( ud1 c-addr1 u1 -- ud2 c-addr2 u2 )
-** ud2 is the unsigned result of converting the characters within the
-** string specified by c-addr1 u1 into digits, using the number in BASE,
-** and adding each into ud1 after multiplying ud1 by the number in BASE.
-** Conversion continues left-to-right until a character that is not
-** convertible, including any + or -, is encountered or the string is
-** entirely converted. c-addr2 is the location of the first unconverted
-** character or the first character past the end of the string if the string
-** was entirely converted. u2 is the number of unconverted characters in the
-** string. An ambiguous condition exists if ud2 overflows during the
-** conversion.
-** TO DO: presently does not use ud1 hi cell - use it!
-**************************************************************************/
-static void toNumber(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = (char *)stackPopPtr(pVM->pStack);
- UNS64 accum;
- UNS32 base = pVM->base;
- UNS32 ch;
- UNS32 digit;
-
- accum = u64Pop(pVM->pStack);
-
- for (ch = *cp; count > 0; ch = *++cp, count--)
- {
- if (ch < '0')
- break;
-
- digit = ch - '0';
-
- if (digit > 9)
- digit = tolower(ch) - 'a' + 10;
- /*
- ** Note: following test also catches chars between 9 and a
- ** because 'digit' is unsigned!
- */
- if (digit >= base)
- break;
-
- accum = m64Mac(accum, base, digit);
- }
-
- u64Push(pVM->pStack, accum);
- stackPushPtr (pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
-
- return;
-}
-
-
-
-/**************************************************************************
- q u i t & a b o r t
-** quit CORE ( -- ) ( R: i*x -- )
-** Empty the return stack, store zero in SOURCE-ID if it is present, make
-** the user input device the input source, and enter interpretation state.
-** Do not display a message. Repeat the following:
-**
-** Accept a line from the input source into the input buffer, set >IN to
-** zero, and interpret.
-** Display the implementation-defined system prompt if in
-** interpretation state, all processing has been completed, and no
-** ambiguous condition exists.
-**************************************************************************/
-
-static void quit(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_QUIT);
- return;
-}
-
-
-static void ficlAbort(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_ERREXIT);
- return;
-}
-
-
-/**************************************************************************
- a c c e p t
-** accept CORE ( c-addr +n1 -- +n2 )
-** Receive a string of at most +n1 characters. An ambiguous condition
-** exists if +n1 is zero or greater than 32,767. Display graphic characters
-** as they are received. A program that depends on the presence or absence
-** of non-graphic characters in the string has an environmental dependency.
-** The editing functions, if any, that the system performs in order to
-** construct the string are implementation-defined.
-**
-** (Although the standard text doesn't say so, I assume that the intent
-** of 'accept' is to store the string at the address specified on
-** the stack.)
-** Implementation: if there's more text in the TIB, use it. Otherwise
-** throw out for more text. Copy characters up to the max count into the
-** address given, and return the number of actual characters copied.
-**************************************************************************/
-static void accept(FICL_VM *pVM)
-{
- UNS32 count, len;
- char *cp;
- char *pBuf = vmGetInBuf(pVM);
-
- len = strlen(pBuf);
- if (len == 0)
- vmThrow(pVM, VM_RESTART);
- /* OK - now we have something in the text buffer - use it */
- count = stackPopUNS32(pVM->pStack);
- cp = stackPopPtr(pVM->pStack);
-
- strncpy(cp, vmGetInBuf(pVM), count);
- len = (count < len) ? count : len;
- pBuf += len;
- vmUpdateTib(pVM, pBuf);
- stackPushUNS32(pVM->pStack, len);
-
- return;
-}
-
-
-/**************************************************************************
- a l i g n
-** 6.1.0705 ALIGN CORE ( -- )
-** If the data-space pointer is not aligned, reserve enough space to
-** align it.
-**************************************************************************/
-static void align(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- IGNORE(pVM);
- dictAlign(dp);
- return;
-}
-
-
-/**************************************************************************
- a l i g n e d
-**
-**************************************************************************/
-static void aligned(FICL_VM *pVM)
-{
- void *addr = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, alignPtr(addr));
- return;
-}
-
-
-/**************************************************************************
- b e g i n & f r i e n d s
-** Indefinite loop control structures
-** A.6.1.0760 BEGIN
-** Typical use:
-** : X ... BEGIN ... test UNTIL ;
-** or
-** : X ... BEGIN ... test WHILE ... REPEAT ;
-**************************************************************************/
-static void beginCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- markBranch(dp, pVM, beginTag);
- return;
-}
-
-static void untilCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- resolveBackBranch(dp, pVM, beginTag);
- return;
-}
-
-static void whileCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- markBranch(dp, pVM, whileTag);
- twoSwap(pVM);
- dictAppendUNS32(dp, 1);
- return;
-}
-
-static void repeatCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pBranchParen);
- dictAppendCell(dp, LVALUEtoCELL(pBranchParen));
-
- /* expect "begin" branch marker */
- resolveBackBranch(dp, pVM, beginTag);
- /* expect "while" branch marker */
- resolveForwardBranch(dp, pVM, whileTag);
- return;
-}
-
-
-/**************************************************************************
- c h a r & f r i e n d s
-** 6.1.0895 CHAR CORE ( "<spaces>name" -- char )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Put the value of its first character onto the stack.
-**
-** bracket-char CORE
-** Interpretation: Interpretation semantics for this word are undefined.
-** Compilation: ( "<spaces>name" -- )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Append the run-time semantics given below to the current definition.
-** Run-time: ( -- char )
-** Place char, the value of the first character of name, on the stack.
-**************************************************************************/
-static void ficlChar(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord(pVM);
- stackPushUNS32(pVM->pStack, (UNS32)(si.cp[0]));
-
- return;
-}
-
-static void charCoIm(FICL_VM *pVM)
-{
- ficlChar(pVM);
- literalIm(pVM);
- return;
-}
-
-/**************************************************************************
- c h a r P l u s
-** char-plus CORE ( c-addr1 -- c-addr2 )
-** Add the size in address units of a character to c-addr1, giving c-addr2.
-**************************************************************************/
-static void charPlus(FICL_VM *pVM)
-{
- char *cp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, cp + 1);
- return;
-}
-
-/**************************************************************************
- c h a r s
-** chars CORE ( n1 -- n2 )
-** n2 is the size in address units of n1 characters.
-** For most processors, this function can be a no-op. To guarantee
-** portability, we'll multiply by sizeof (char).
-**************************************************************************/
-#if defined (_M_IX86)
-#pragma warning(disable: 4127)
-#endif
-static void ficlChars(FICL_VM *pVM)
-{
- if (sizeof (char) > 1)
- {
- INT32 i = stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i * sizeof (char));
- }
- /* otherwise no-op! */
- return;
-}
-#if defined (_M_IX86)
-#pragma warning(default: 4127)
-#endif
-
-
-/**************************************************************************
- c o u n t
-** COUNT CORE ( c-addr1 -- c-addr2 u )
-** Return the character string specification for the counted string stored
-** at c-addr1. c-addr2 is the address of the first character after c-addr1.
-** u is the contents of the character at c-addr1, which is the length in
-** characters of the string at c-addr2.
-**************************************************************************/
-static void count(FICL_VM *pVM)
-{
- FICL_STRING *sp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- return;
-}
-
-/**************************************************************************
- e n v i r o n m e n t ?
-** environment-query CORE ( c-addr u -- false | i*x true )
-** c-addr is the address of a character string and u is the string's
-** character count. u may have a value in the range from zero to an
-** implementation-defined maximum which shall not be less than 31. The
-** character string should contain a keyword from 3.2.6 Environmental
-** queries or the optional word sets to be checked for correspondence
-** with an attribute of the present environment. If the system treats the
-** attribute as unknown, the returned flag is false; otherwise, the flag
-** is true and the i*x returned is of the type specified in the table for
-** the attribute queried.
-**************************************************************************/
-static void environmentQ(FICL_VM *pVM)
-{
- FICL_DICT *envp = ficlGetEnv();
- FICL_COUNT len = (FICL_COUNT)stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_PSZ(si, cp);
- pFW = dictLookup(envp, si);
-
- if (pFW != NULL)
- {
- vmExecute(pVM, pFW);
- stackPushINT32(pVM->pStack, FICL_TRUE);
- }
- else
- {
- stackPushINT32(pVM->pStack, FICL_FALSE);
- }
-
- return;
-}
-
-/**************************************************************************
- e v a l u a t e
-** EVALUATE CORE ( i*x c-addr u -- j*x )
-** Save the current input source specification. Store minus-one (-1) in
-** SOURCE-ID if it is present. Make the string described by c-addr and u
-** both the input source and input buffer, set >IN to zero, and interpret.
-** When the parse area is empty, restore the prior input source
-** specification. Other stack effects are due to the words EVALUATEd.
-**
-** DEFICIENCY: this version does not handle errors or restarts.
-**************************************************************************/
-static void evaluate(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
- CELL id;
-
- IGNORE(count);
- id = pVM->sourceID;
- pVM->sourceID.i = -1;
- vmPushIP(pVM, &pInterpret);
- ficlExec(pVM, cp);
- vmPopIP(pVM);
- pVM->sourceID = id;
- return;
-}
-
-
-/**************************************************************************
- s t r i n g q u o t e
-** Intrpreting: get string delimited by a quote from the input stream,
-** copy to a scratch area, and put its count and address on the stack.
-** Compiling: compile code to push the address and count of a string
-** literal, compile the string from the input stream, and align the dict
-** pointer.
-**************************************************************************/
-static void stringQuoteIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- if (pVM->state == INTERPRET)
- {
- FICL_STRING *sp = (FICL_STRING *) dp->here;
- vmGetString(pVM, sp, '\"');
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- }
- else /* COMPILE state */
- {
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- dp->here = PTRtoCELL vmGetString(pVM, (FICL_STRING *)dp->here, '\"');
- dictAlign(dp);
- }
-
- return;
-}
-
-/**************************************************************************
- t y p e
-** Pop count and char address from stack and print the designated string.
-**************************************************************************/
-static void type(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
-
- /*
- ** Since we don't have an output primitive for a counted string
- ** (oops), make sure the string is null terminated. If not, copy
- ** and terminate it.
- */
- /* XXX Uses free space on top of dictionary. Is it guaranteed
- * XXX to always fit? (abial)
- */
- if (cp[count] != '\0')
- {
- char *pDest = (char *)ficlGetDict()->here;
- if (cp != pDest)
- strncpy(pDest, cp, count);
-
- pDest[count] = '\0';
- cp = pDest;
- }
-
- vmTextOut(pVM, cp, 0);
- return;
-}
-
-/**************************************************************************
- w o r d
-** word CORE ( char "<chars>ccc<char>" -- c-addr )
-** Skip leading delimiters. Parse characters ccc delimited by char. An
-** ambiguous condition exists if the length of the parsed string is greater
-** than the implementation-defined length of a counted string.
-**
-** c-addr is the address of a transient region containing the parsed word
-** as a counted string. If the parse area was empty or contained no
-** characters other than the delimiter, the resulting string has a zero
-** length. A space, not included in the length, follows the string. A
-** program may replace characters within the string.
-** NOTE! Ficl also NULL-terminates the dest string.
-**************************************************************************/
-static void ficlWord(FICL_VM *pVM)
-{
- FICL_STRING *sp = (FICL_STRING *)pVM->pad;
- char delim = (char)stackPopINT32(pVM->pStack);
- STRINGINFO si;
-
- si = vmParseString(pVM, delim);
-
- if (SI_COUNT(si) > nPAD-1)
- SI_SETLEN(si, nPAD-1);
-
- sp->count = (FICL_COUNT)SI_COUNT(si);
- strncpy(sp->text, SI_PTR(si), SI_COUNT(si));
- strcat(sp->text, " ");
-
- stackPushPtr(pVM->pStack, sp);
- return;
-}
-
-
-/**************************************************************************
- p a r s e - w o r d
-** ficl PARSE-WORD ( <spaces>name -- c-addr u )
-** Skip leading spaces and parse name delimited by a space. c-addr is the
-** address within the input buffer and u is the length of the selected
-** string. If the parse area is empty, the resulting string has a zero length.
-**************************************************************************/
-static void parseNoCopy(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
- stackPushPtr(pVM->pStack, SI_PTR(si));
- stackPushUNS32(pVM->pStack, SI_COUNT(si));
- return;
-}
-
-
-/**************************************************************************
- p a r s e
-** CORE EXT ( char "ccc<char>" -- c-addr u )
-** Parse ccc delimited by the delimiter char.
-** c-addr is the address (within the input buffer) and u is the length of
-** the parsed string. If the parse area was empty, the resulting string has
-** a zero length.
-** NOTE! PARSE differs from WORD: it does not skip leading delimiters.
-**************************************************************************/
-static void parse(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- char *cp;
- UNS32 count;
- char delim = (char)stackPopINT32(pVM->pStack);
-
- cp = pSrc; /* mark start of text */
-
- while ((*pSrc != delim) && (*pSrc != '\0'))
- pSrc++; /* find next delimiter or end */
-
- count = pSrc - cp; /* set length of result */
-
- if (*pSrc == delim) /* gobble trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
- stackPushPtr(pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
- return;
-}
-
-
-/**************************************************************************
- f i l l
-** CORE ( c-addr u char -- )
-** If u is greater than zero, store char in each of u consecutive
-** characters of memory beginning at c-addr.
-**************************************************************************/
-static void fill(FICL_VM *pVM)
-{
- char ch = (char)stackPopINT32(pVM->pStack);
- UNS32 u = stackPopUNS32(pVM->pStack);
- char *cp = (char *)stackPopPtr(pVM->pStack);
-
- while (u > 0)
- {
- *cp++ = ch;
- u--;
- }
-
- return;
-}
-
-
-/**************************************************************************
- f i n d
-** FIND CORE ( c-addr -- c-addr 0 | xt 1 | xt -1 )
-** Find the definition named in the counted string at c-addr. If the
-** definition is not found, return c-addr and zero. If the definition is
-** found, return its execution token xt. If the definition is immediate,
-** also return one (1), otherwise also return minus-one (-1). For a given
-** string, the values returned by FIND while compiling may differ from
-** those returned while not compiling.
-**************************************************************************/
-static void find(FICL_VM *pVM)
-{
- FICL_STRING *sp = stackPopPtr(pVM->pStack);
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_PFS(si, sp);
- pFW = dictLookup(ficlGetDict(), si);
- if (pFW)
- {
- stackPushPtr(pVM->pStack, pFW);
- stackPushINT32(pVM->pStack, (wordIsImmediate(pFW) ? 1 : -1));
- }
- else
- {
- stackPushPtr(pVM->pStack, sp);
- stackPushUNS32(pVM->pStack, 0);
- }
- return;
-}
-
-
-/**************************************************************************
- f m S l a s h M o d
-** f-m-slash-mod CORE ( d1 n1 -- n2 n3 )
-** Divide d1 by n1, giving the floored quotient n3 and the remainder n2.
-** Input and output stack arguments are signed. An ambiguous condition
-** exists if n1 is zero or if the quotient lies outside the range of a
-** single-cell signed integer.
-**************************************************************************/
-static void fmSlashMod(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1 = i64Pop(pVM->pStack);
- qr = m64FlooredDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- s m S l a s h R e m
-** s-m-slash-rem CORE ( d1 n1 -- n2 n3 )
-** Divide d1 by n1, giving the symmetric quotient n3 and the remainder n2.
-** Input and output stack arguments are signed. An ambiguous condition
-** exists if n1 is zero or if the quotient lies outside the range of a
-** single-cell signed integer.
-**************************************************************************/
-static void smSlashRem(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1 = i64Pop(pVM->pStack);
- qr = m64SymmetricDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-static void ficlMod(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1.lo = stackPopINT32(pVM->pStack);
- i64Extend(d1);
- qr = m64SymmetricDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- return;
-}
-
-
-/**************************************************************************
- u m S l a s h M o d
-** u-m-slash-mod CORE ( ud u1 -- u2 u3 )
-** Divide ud by u1, giving the quotient u3 and the remainder u2.
-** All values and arithmetic are unsigned. An ambiguous condition
-** exists if u1 is zero or if the quotient lies outside the range of a
-** single-cell unsigned integer.
-*************************************************************************/
-static void umSlashMod(FICL_VM *pVM)
-{
- UNS64 ud;
- UNS32 u1;
- UNSQR qr;
-
- u1 = stackPopUNS32(pVM->pStack);
- ud = u64Pop(pVM->pStack);
- qr = ficlLongDiv(ud, u1);
- stackPushUNS32(pVM->pStack, qr.rem);
- stackPushUNS32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- l s h i f t
-** l-shift CORE ( x1 u -- x2 )
-** Perform a logical left shift of u bit-places on x1, giving x2.
-** Put zeroes into the least significant bits vacated by the shift.
-** An ambiguous condition exists if u is greater than or equal to the
-** number of bits in a cell.
-**
-** r-shift CORE ( x1 u -- x2 )
-** Perform a logical right shift of u bit-places on x1, giving x2.
-** Put zeroes into the most significant bits vacated by the shift. An
-** ambiguous condition exists if u is greater than or equal to the
-** number of bits in a cell.
-**************************************************************************/
-static void lshift(FICL_VM *pVM)
-{
- UNS32 nBits = stackPopUNS32(pVM->pStack);
- UNS32 x1 = stackPopUNS32(pVM->pStack);
-
- stackPushUNS32(pVM->pStack, x1 << nBits);
- return;
-}
-
-
-static void rshift(FICL_VM *pVM)
-{
- UNS32 nBits = stackPopUNS32(pVM->pStack);
- UNS32 x1 = stackPopUNS32(pVM->pStack);
-
- stackPushUNS32(pVM->pStack, x1 >> nBits);
- return;
-}
-
-
-/**************************************************************************
- m S t a r
-** m-star CORE ( n1 n2 -- d )
-** d is the signed product of n1 times n2.
-**************************************************************************/
-static void mStar(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
- INT64 d;
-
- d = m64MulI(n1, n2);
- i64Push(pVM->pStack, d);
- return;
-}
-
-
-static void umStar(FICL_VM *pVM)
-{
- UNS32 u2 = stackPopUNS32(pVM->pStack);
- UNS32 u1 = stackPopUNS32(pVM->pStack);
- UNS64 ud;
-
- ud = ficlLongMul(u1, u2);
- u64Push(pVM->pStack, ud);
- return;
-}
-
-
-/**************************************************************************
- m a x & m i n
-**
-**************************************************************************/
-static void ficlMax(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
-
- stackPushINT32(pVM->pStack, (n1 > n2) ? n1 : n2);
- return;
-}
-
-static void ficlMin(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
-
- stackPushINT32(pVM->pStack, (n1 < n2) ? n1 : n2);
- return;
-}
-
-
-/**************************************************************************
- m o v e
-** CORE ( addr1 addr2 u -- )
-** If u is greater than zero, copy the contents of u consecutive address
-** units at addr1 to the u consecutive address units at addr2. After MOVE
-** completes, the u consecutive address units at addr2 contain exactly
-** what the u consecutive address units at addr1 contained before the move.
-** NOTE! This implementation assumes that a char is the same size as
-** an address unit.
-**************************************************************************/
-static void move(FICL_VM *pVM)
-{
- UNS32 u = stackPopUNS32(pVM->pStack);
- char *addr2 = stackPopPtr(pVM->pStack);
- char *addr1 = stackPopPtr(pVM->pStack);
-
- if (u == 0)
- return;
- /*
- ** Do the copy carefully, so as to be
- ** correct even if the two ranges overlap
- */
- if (addr1 >= addr2)
- {
- for (; u > 0; u--)
- *addr2++ = *addr1++;
- }
- else
- {
- addr2 += u-1;
- addr1 += u-1;
- for (; u > 0; u--)
- *addr2-- = *addr1--;
- }
-
- return;
-}
-
-
-/**************************************************************************
- r e c u r s e
-**
-**************************************************************************/
-static void recurseCoIm(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
-
- IGNORE(pVM);
- dictAppendCell(pDict, LVALUEtoCELL(pDict->smudge));
- return;
-}
-
-
-/**************************************************************************
- s t o d
-** s-to-d CORE ( n -- d )
-** Convert the number n to the double-cell number d with the same
-** numerical value.
-**************************************************************************/
-static void sToD(FICL_VM *pVM)
-{
- INT32 s = stackPopINT32(pVM->pStack);
-
- /* sign extend to 64 bits.. */
- stackPushINT32(pVM->pStack, s);
- stackPushINT32(pVM->pStack, (s < 0) ? -1 : 0);
- return;
-}
-
-
-/**************************************************************************
- s o u r c e
-** CORE ( -- c-addr u )
-** c-addr is the address of, and u is the number of characters in, the
-** input buffer.
-**************************************************************************/
-static void source(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, pVM->tib.cp);
- stackPushINT32(pVM->pStack, strlen(pVM->tib.cp));
- return;
-}
-
-
-/**************************************************************************
- v e r s i o n
-** non-standard...
-**************************************************************************/
-static void ficlVersion(FICL_VM *pVM)
-{
- vmTextOut(pVM, "ficl Version " FICL_VER, 1);
- return;
-}
-
-
-/**************************************************************************
- t o I n
-** to-in CORE
-**************************************************************************/
-static void toIn(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, &pVM->tib.index);
- return;
-}
-
-
-/**************************************************************************
- d e f i n i t i o n s
-** SEARCH ( -- )
-** Make the compilation word list the same as the first word list in the
-** search order. Specifies that the names of subsequent definitions will
-** be placed in the compilation word list. Subsequent changes in the search
-** order will not affect the compilation word list.
-**************************************************************************/
-static void definitions(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
-
- assert(pDict);
- if (pDict->nLists < 1)
- {
- vmThrowErr(pVM, "DEFINITIONS error - empty search order");
- }
-
- pDict->pCompile = pDict->pSearch[pDict->nLists-1];
- return;
-}
-
-
-/**************************************************************************
- f o r t h - w o r d l i s t
-** SEARCH ( -- wid )
-** Return wid, the identifier of the word list that includes all standard
-** words provided by the implementation. This word list is initially the
-** compilation word list and is part of the initial search order.
-**************************************************************************/
-static void forthWordlist(FICL_VM *pVM)
-{
- FICL_HASH *pHash = ficlGetDict()->pForthWords;
- stackPushPtr(pVM->pStack, pHash);
- return;
-}
-
-
-/**************************************************************************
- g e t - c u r r e n t
-** SEARCH ( -- wid )
-** Return wid, the identifier of the compilation word list.
-**************************************************************************/
-static void getCurrent(FICL_VM *pVM)
-{
- ficlLockDictionary(TRUE);
- stackPushPtr(pVM->pStack, ficlGetDict()->pCompile);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- g e t - o r d e r
-** SEARCH ( -- widn ... wid1 n )
-** Returns the number of word lists n in the search order and the word list
-** identifiers widn ... wid1 identifying these word lists. wid1 identifies
-** the word list that is searched first, and widn the word list that is
-** searched last. The search order is unaffected.
-**************************************************************************/
-static void getOrder(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- int nLists = pDict->nLists;
- int i;
-
- ficlLockDictionary(TRUE);
- for (i = 0; i < nLists; i++)
- {
- stackPushPtr(pVM->pStack, pDict->pSearch[i]);
- }
-
- stackPushUNS32(pVM->pStack, nLists);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- s e a r c h - w o r d l i s t
-** SEARCH ( c-addr u wid -- 0 | xt 1 | xt -1 )
-** Find the definition identified by the string c-addr u in the word list
-** identified by wid. If the definition is not found, return zero. If the
-** definition is found, return its execution token xt and one (1) if the
-** definition is immediate, minus-one (-1) otherwise.
-**************************************************************************/
-static void searchWordlist(FICL_VM *pVM)
-{
- STRINGINFO si;
- UNS16 hashCode;
- FICL_WORD *pFW;
- FICL_HASH *pHash = stackPopPtr(pVM->pStack);
-
- si.count = (FICL_COUNT)stackPopUNS32(pVM->pStack);
- si.cp = stackPopPtr(pVM->pStack);
- hashCode = hashHashCode(si);
-
- ficlLockDictionary(TRUE);
- pFW = hashLookup(pHash, si, hashCode);
- ficlLockDictionary(FALSE);
-
- if (pFW)
- {
- stackPushPtr(pVM->pStack, pFW);
- stackPushINT32(pVM->pStack, (wordIsImmediate(pFW) ? 1 : -1));
- }
- else
- {
- stackPushUNS32(pVM->pStack, 0);
- }
-
- return;
-}
-
-
-/**************************************************************************
- s e t - c u r r e n t
-** SEARCH ( wid -- )
-** Set the compilation word list to the word list identified by wid.
-**************************************************************************/
-static void setCurrent(FICL_VM *pVM)
-{
- FICL_HASH *pHash = stackPopPtr(pVM->pStack);
- FICL_DICT *pDict = ficlGetDict();
- ficlLockDictionary(TRUE);
- pDict->pCompile = pHash;
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- s e t - o r d e r
-** SEARCH ( widn ... wid1 n -- )
-** Set the search order to the word lists identified by widn ... wid1.
-** Subsequently, word list wid1 will be searched first, and word list
-** widn searched last. If n is zero, empty the search order. If n is minus
-** one, set the search order to the implementation-defined minimum
-** search order. The minimum search order shall include the words
-** FORTH-WORDLIST and SET-ORDER. A system shall allow n to
-** be at least eight.
-**************************************************************************/
-static void setOrder(FICL_VM *pVM)
-{
- int i;
- int nLists = stackPopINT32(pVM->pStack);
- FICL_DICT *dp = ficlGetDict();
-
- if (nLists > FICL_DEFAULT_VOCS)
- {
- vmThrowErr(pVM, "set-order error: list would be too large");
- }
-
- ficlLockDictionary(TRUE);
-
- if (nLists >= 0)
- {
- dp->nLists = nLists;
- for (i = nLists-1; i >= 0; --i)
- {
- dp->pSearch[i] = stackPopPtr(pVM->pStack);
- }
- }
- else
- {
- dictResetSearchOrder(dp);
- }
-
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- w o r d l i s t
-** SEARCH ( -- wid )
-** Create a new empty word list, returning its word list identifier wid.
-** The new word list may be returned from a pool of preallocated word
-** lists or may be dynamically allocated in data space. A system shall
-** allow the creation of at least 8 new word lists in addition to any
-** provided as part of the system.
-** Notes:
-** 1. ficl creates a new single-list hash in the dictionary and returns
-** its address.
-** 2. ficl-wordlist takes an arg off the stack indicating the number of
-** hash entries in the wordlist. Ficl 2.02 and later define WORDLIST as
-** : wordlist 1 ficl-wordlist ;
-**************************************************************************/
-static void wordlist(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pHash;
- UNS32 nBuckets;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- nBuckets = stackPopUNS32(pVM->pStack);
-
- dictAlign(dp);
- pHash = (FICL_HASH *)dp->here;
- dictAllot(dp, sizeof (FICL_HASH)
- + (nBuckets-1) * sizeof (FICL_WORD *));
-
- pHash->size = nBuckets;
- hashReset(pHash);
-
- stackPushPtr(pVM->pStack, pHash);
- return;
-}
-
-
-/**************************************************************************
- S E A R C H >
-** ficl ( -- wid )
-** Pop wid off the search order. Error if the search order is empty
-**************************************************************************/
-static void searchPop(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- int nLists;
-
- ficlLockDictionary(TRUE);
- nLists = dp->nLists;
- if (nLists == 0)
- {
- vmThrowErr(pVM, "search> error: empty search order");
- }
- stackPushPtr(pVM->pStack, dp->pSearch[--dp->nLists]);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- > S E A R C H
-** ficl ( wid -- )
-** Push wid onto the search order. Error if the search order is full.
-**************************************************************************/
-static void searchPush(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- ficlLockDictionary(TRUE);
- if (dp->nLists > FICL_DEFAULT_VOCS)
- {
- vmThrowErr(pVM, ">search error: search order overflow");
- }
- dp->pSearch[dp->nLists++] = stackPopPtr(pVM->pStack);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- c o l o n N o N a m e
-** CORE EXT ( C: -- colon-sys ) ( S: -- xt )
-** Create an unnamed colon definition and push its address.
-** Change state to compile.
-**************************************************************************/
-static void colonNoName(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_SETLEN(si, 0);
- SI_SETPTR(si, NULL);
-
- pVM->state = COMPILE;
- pFW = dictAppendWord2(dp, si, colonParen, FW_DEFAULT | FW_SMUDGE);
- stackPushPtr(pVM->pStack, pFW);
- markControlTag(pVM, colonTag);
- return;
-}
-
-
-/**************************************************************************
- u s e r V a r i a b l e
-** user ( u -- ) "<spaces>name"
-** Get a name from the input stream and create a user variable
-** with the name and the index supplied. The run-time effect
-** of a user variable is to push the address of the indexed cell
-** in the running vm's user array.
-**
-** User variables are vm local cells. Each vm has an array of
-** FICL_USER_CELLS of them when FICL_WANT_USER is nonzero.
-** Ficl's user facility is implemented with two primitives,
-** "user" and "(user)", a variable ("nUser") (in softcore.c) that
-** holds the index of the next free user cell, and a redefinition
-** (also in softcore) of "user" that defines a user word and increments
-** nUser.
-**************************************************************************/
-#if FICL_WANT_USER
-static void userParen(FICL_VM *pVM)
-{
- INT32 i = pVM->runningWord->param[0].i;
- stackPushPtr(pVM->pStack, &pVM->user[i]);
- return;
-}
-
-
-static void userVariable(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
- CELL c;
-
- c = stackPop(pVM->pStack);
- if (c.i >= FICL_USER_CELLS)
- {
- vmThrowErr(pVM, "Error - out of user space");
- }
-
- dictAppendWord2(dp, si, userParen, FW_DEFAULT);
- dictAppendCell(dp, c);
- return;
-}
-#endif
-
-
-/**************************************************************************
- t o V a l u e
-** CORE EXT
-** Interpretation: ( x "<spaces>name" -- )
-** Skip leading spaces and parse name delimited by a space. Store x in
-** name. An ambiguous condition exists if name was not defined by VALUE.
-** NOTE: In ficl, VALUE is an alias of CONSTANT
-**************************************************************************/
-static void toValue(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord(pVM);
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
-
-#if FICL_WANT_LOCALS
- FICL_DICT *pLoc = ficlGetLoc();
- if ((nLocals > 0) && (pVM->state == COMPILE))
- {
- pFW = dictLookup(pLoc, si);
- if (pFW)
- {
- dictAppendCell(dp, LVALUEtoCELL(pToLocalParen));
- dictAppendCell(dp, LVALUEtoCELL(pFW->param[0]));
- return;
- }
- }
-#endif
-
- assert(pStore);
-
- pFW = dictLookup(dp, si);
- if (!pFW)
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
-
- if (pVM->state == INTERPRET)
- pFW->param[0] = stackPop(pVM->pStack);
- else /* compile code to store to word's param */
- {
- stackPushPtr(pVM->pStack, &pFW->param[0]);
- literalIm(pVM);
- dictAppendCell(dp, LVALUEtoCELL(pStore));
- }
- return;
-}
-
-
-#if FICL_WANT_LOCALS
-/**************************************************************************
- l i n k P a r e n
-** ( -- )
-** Link a frame on the return stack, reserving nCells of space for
-** locals - the value of nCells is the next cell in the instruction
-** stream.
-**************************************************************************/
-static void linkParen(FICL_VM *pVM)
-{
- INT32 nLink = *(INT32 *)(pVM->ip);
- vmBranchRelative(pVM, 1);
- stackLink(pVM->rStack, nLink);
- return;
-}
-
-
-static void unlinkParen(FICL_VM *pVM)
-{
- stackUnlink(pVM->rStack);
- return;
-}
-
-
-/**************************************************************************
- d o L o c a l I m
-** Immediate - cfa of a local while compiling - when executed, compiles
-** code to fetch the value of a local given the local's index in the
-** word's pfa
-**************************************************************************/
-static void getLocalParen(FICL_VM *pVM)
-{
- INT32 nLocal = *(INT32 *)(pVM->ip++);
- stackPush(pVM->pStack, pVM->rStack->pFrame[nLocal]);
- return;
-}
-
-
-static void toLocalParen(FICL_VM *pVM)
-{
- INT32 nLocal = *(INT32 *)(pVM->ip++);
- pVM->rStack->pFrame[nLocal] = stackPop(pVM->pStack);
- return;
-}
-
-
-static void getLocal0(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, pVM->rStack->pFrame[0]);
- return;
-}
-
-
-static void toLocal0(FICL_VM *pVM)
-{
- pVM->rStack->pFrame[0] = stackPop(pVM->pStack);
- return;
-}
-
-
-static void getLocal1(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, pVM->rStack->pFrame[1]);
- return;
-}
-
-
-static void toLocal1(FICL_VM *pVM)
-{
- pVM->rStack->pFrame[1] = stackPop(pVM->pStack);
- return;
-}
-
-
-/*
-** Each local is recorded in a private locals dictionary as a
-** word that does doLocalIm at runtime. DoLocalIm compiles code
-** into the client definition to fetch the value of the
-** corresponding local variable from the return stack.
-** The private dictionary gets initialized at the end of each block
-** that uses locals (in ; and does> for example).
-*/
-static void doLocalIm(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- int nLocal = pVM->runningWord->param[0].i;
-
- if (pVM->state == INTERPRET)
- {
- stackPush(pVM->pStack, pVM->rStack->pFrame[nLocal]);
- }
- else
- {
-
- if (nLocal == 0)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocal0));
- }
- else if (nLocal == 1)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocal1));
- }
- else
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocalParen));
- dictAppendCell(pDict, LVALUEtoCELL(nLocal));
- }
- }
- return;
-}
-
-
-/**************************************************************************
- l o c a l P a r e n
-** paren-local-paren LOCAL
-** Interpretation: Interpretation semantics for this word are undefined.
-** Execution: ( c-addr u -- )
-** When executed during compilation, (LOCAL) passes a message to the
-** system that has one of two meanings. If u is non-zero,
-** the message identifies a new local whose definition name is given by
-** the string of characters identified by c-addr u. If u is zero,
-** the message is last local and c-addr has no significance.
-**
-** The result of executing (LOCAL) during compilation of a definition is
-** to create a set of named local identifiers, each of which is
-** a definition name, that only have execution semantics within the scope
-** of that definition's source.
-**
-** local Execution: ( -- x )
-**
-** Push the local's value, x, onto the stack. The local's value is
-** initialized as described in 13.3.3 Processing locals and may be
-** changed by preceding the local's name with TO. An ambiguous condition
-** exists when local is executed while in interpretation state.
-**************************************************************************/
-static void localParen(FICL_VM *pVM)
-{
- static CELL *pMark = NULL;
- FICL_DICT *pDict = ficlGetDict();
- STRINGINFO si;
- SI_SETLEN(si, stackPopUNS32(pVM->pStack));
- SI_SETPTR(si, (char *)stackPopPtr(pVM->pStack));
-
- if (SI_COUNT(si) > 0)
- { /* add a local to the dict and update nLocals */
- FICL_DICT *pLoc = ficlGetLoc();
- if (nLocals >= FICL_MAX_LOCALS)
- {
- vmThrowErr(pVM, "Error: out of local space");
- }
-
- dictAppendWord2(pLoc, si, doLocalIm, FW_COMPIMMED);
- dictAppendCell(pLoc, LVALUEtoCELL(nLocals));
-
- if (nLocals == 0)
- { /* compile code to create a local stack frame */
- dictAppendCell(pDict, LVALUEtoCELL(pLinkParen));
- /* save location in dictionary for #locals */
- pMark = pDict->here;
- dictAppendCell(pDict, LVALUEtoCELL(nLocals));
- /* compile code to initialize first local */
- dictAppendCell(pDict, LVALUEtoCELL(pToLocal0));
- }
- else if (nLocals == 1)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pToLocal1));
- }
- else
- {
- dictAppendCell(pDict, LVALUEtoCELL(pToLocalParen));
- dictAppendCell(pDict, LVALUEtoCELL(nLocals));
- }
-
- nLocals++;
- }
- else if (nLocals > 0)
- { /* write nLocals to (link) param area in dictionary */
- *(INT32 *)pMark = nLocals;
- }
-
- return;
-}
-
-
-#endif
-/**************************************************************************
- setParentWid
-** FICL
-** setparentwid ( parent-wid wid -- )
-** Set WID's link field to the parent-wid. search-wordlist will
-** iterate through all the links when finding words in the child wid.
-**************************************************************************/
-static void setParentWid(FICL_VM *pVM)
-{
- FICL_HASH *parent, *child;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- child = (FICL_HASH *)stackPopPtr(pVM->pStack);
- parent = (FICL_HASH *)stackPopPtr(pVM->pStack);
-
- child->link = parent;
- return;
-}
-
-
-/**************************************************************************
- s e e
-** TOOLS ( "<spaces>name" -- )
-** Display a human-readable representation of the named word's definition.
-** The source of the representation (object-code decompilation, source
-** block, etc.) and the particular form of the display is implementation
-** defined.
-** NOTE: these funcs come late in the file because they reference all
-** of the word-builder funcs without declaring them again. Call me lazy.
-**************************************************************************/
-/*
-** isAFiclWord
-** Vet a candidate pointer carefully to make sure
-** it's not some chunk o' inline data...
-** It has to have a name, and it has to look
-** like it's in the dictionary address range.
-** NOTE: this excludes :noname words!
-*/
-static int isAFiclWord(FICL_WORD *pFW)
-{
- void *pv = (void *)pFW;
- FICL_DICT *pd = ficlGetDict();
-
- if (!dictIncludes(pd, pFW))
- return 0;
-
- if (!dictIncludes(pd, pFW->name))
- return 0;
-
- return ((pFW->nName > 0) && (pFW->name[pFW->nName] == '\0'));
-}
-
-/*
-** seeColon (for proctologists only)
-** Walks a colon definition, decompiling
-** on the fly. Knows about primitive control structures.
-*/
-static void seeColon(FICL_VM *pVM, CELL *pc)
-{
- for (; pc->p != pSemiParen; pc++)
- {
- FICL_WORD *pFW = (FICL_WORD *)(pc->p);
-
- if (isAFiclWord(pFW))
- {
- if (pFW->code == literalParen)
- {
- CELL v = *++pc;
- if (isAFiclWord(v.p))
- {
- FICL_WORD *pLit = (FICL_WORD *)v.p;
- sprintf(pVM->pad, " literal %.*s (%#lx)",
- pLit->nName, pLit->name, v.u);
- }
- else
- sprintf(pVM->pad, " literal %ld (%#lx)", v.i, v.u);
- }
- else if (pFW->code == stringLit)
- {
- FICL_STRING *sp = (FICL_STRING *)(void *)++pc;
- pc = (CELL *)alignPtr(sp->text + sp->count + 1) - 1;
- sprintf(pVM->pad, " s\" %.*s\"", sp->count, sp->text);
- }
- else if (pFW->code == ifParen)
- {
- CELL c = *++pc;
- if (c.i > 0)
- sprintf(pVM->pad, " if / while (branch rel %ld)", c.i);
- else
- sprintf(pVM->pad, " until (branch rel %ld)", c.i);
- }
- else if (pFW->code == branchParen)
- {
- CELL c = *++pc;
- if (c.i > 0)
- sprintf(pVM->pad, " else (branch rel %ld)", c.i);
- else
- sprintf(pVM->pad, " repeat (branch rel %ld)", c.i);
- }
- else if (pFW->code == qDoParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " ?do (leave abs %#lx)", c.u);
- }
- else if (pFW->code == doParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " do (leave abs %#lx)", c.u);
- }
- else if (pFW->code == loopParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " loop (branch rel %#ld)", c.i);
- }
- else if (pFW->code == plusLoopParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " +loop (branch rel %#ld)", c.i);
- }
- else /* default: print word's name */
- {
- sprintf(pVM->pad, " %.*s", pFW->nName, pFW->name);
- }
-
- vmTextOut(pVM, pVM->pad, 1);
- }
- else /* probably not a word - punt and print value */
- {
- sprintf(pVM->pad, " %ld (%#lx)", pc->i, pc->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- }
-
- vmTextOut(pVM, ";", 1);
-}
-
-/*
-** Here's the outer part of the decompiler. It's
-** just a big nested conditional that checks the
-** CFA of the word to decompile for each kind of
-** known word-builder code, and tries to do
-** something appropriate. If the CFA is not recognized,
-** just indicate that it is a primitive.
-*/
-static void see(FICL_VM *pVM)
-{
- FICL_DICT *pd = ficlGetDict();
- FICL_WORD *pFW;
-
- tick(pVM);
- pFW = (FICL_WORD *)stackPopPtr(pVM->pStack);
-
- if (pFW->code == colonParen)
- {
- sprintf(pVM->pad, ": %.*s", pFW->nName, pFW->name);
- vmTextOut(pVM, pVM->pad, 1);
- seeColon(pVM, pFW->param);
- }
- else if (pFW->code == doDoes)
- {
- vmTextOut(pVM, "does>", 1);
- seeColon(pVM, (CELL *)pFW->param->p);
- }
- else if (pFW->code == createParen)
- {
- vmTextOut(pVM, "create", 1);
- }
- else if (pFW->code == variableParen)
- {
- sprintf(pVM->pad, "variable = %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else if (pFW->code == userParen)
- {
- sprintf(pVM->pad, "user variable %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else if (pFW->code == constantParen)
- {
- sprintf(pVM->pad, "constant = %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else
- {
- vmTextOut(pVM, "primitive", 1);
- }
-
- if (pFW->flags & FW_IMMEDIATE)
- {
- vmTextOut(pVM, "immediate", 1);
- }
-
- return;
-}
-
-
-/**************************************************************************
- c o m p a r e
-** STRING ( c-addr1 u1 c-addr2 u2 -- n )
-** Compare the string specified by c-addr1 u1 to the string specified by
-** c-addr2 u2. The strings are compared, beginning at the given addresses,
-** character by character, up to the length of the shorter string or until a
-** difference is found. If the two strings are identical, n is zero. If the two
-** strings are identical up to the length of the shorter string, n is minus-one
-** (-1) if u1 is less than u2 and one (1) otherwise. If the two strings are not
-** identical up to the length of the shorter string, n is minus-one (-1) if the
-** first non-matching character in the string specified by c-addr1 u1 has a
-** lesser numeric value than the corresponding character in the string specified
-** by c-addr2 u2 and one (1) otherwise.
-**************************************************************************/
-static void compareString(FICL_VM *pVM)
-{
- char *cp1, *cp2;
- UNS32 u1, u2, uMin;
- int n = 0;
-
- vmCheckStack(pVM, 4, 1);
- u2 = stackPopUNS32(pVM->pStack);
- cp2 = (char *)stackPopPtr(pVM->pStack);
- u1 = stackPopUNS32(pVM->pStack);
- cp1 = (char *)stackPopPtr(pVM->pStack);
-
- uMin = (u1 < u2)? u1 : u2;
- for ( ; (uMin > 0) && (n == 0); uMin--)
- {
- n = (int)(*cp1++ - *cp2++);
- }
-
- if (n == 0)
- n = (int)(u1 - u2);
-
- if (n < 0)
- n = -1;
- else if (n > 0)
- n = 1;
-
- stackPushINT32(pVM->pStack, n);
- return;
-}
-
-
-/**************************************************************************
- r e f i l l
-** CORE EXT ( -- flag )
-** Attempt to fill the input buffer from the input source, returning a true
-** flag if successful.
-** When the input source is the user input device, attempt to receive input
-** into the terminal input buffer. If successful, make the result the input
-** buffer, set >IN to zero, and return true. Receipt of a line containing no
-** characters is considered successful. If there is no input available from
-** the current input source, return false.
-** When the input source is a string from EVALUATE, return false and
-** perform no other action.
-**************************************************************************/
-static void refill(FICL_VM *pVM)
-{
- INT32 ret = (pVM->sourceID.i == -1) ? FICL_FALSE : FICL_TRUE;
- stackPushINT32(pVM->pStack, ret);
- if (ret)
- vmThrow(pVM, VM_OUTOFTEXT);
- return;
-}
-
-
-/**************************************************************************
- f o r g e t
-** TOOLS EXT ( "<spaces>name" -- )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Find name, then delete name from the dictionary along with all
-** words added to the dictionary after name. An ambiguous
-** condition exists if name cannot be found.
-**
-** If the Search-Order word set is present, FORGET searches the
-** compilation word list. An ambiguous condition exists if the
-** compilation word list is deleted.
-**************************************************************************/
-static void forgetWid(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- FICL_HASH *pHash;
-
- pHash = (FICL_HASH *)stackPopPtr(pVM->pStack);
- hashForget(pHash, pDict->here);
-
- return;
-}
-
-
-static void forget(FICL_VM *pVM)
-{
- void *where;
- FICL_DICT *pDict = ficlGetDict();
- FICL_HASH *pHash = pDict->pCompile;
-
- tick(pVM);
- where = ((FICL_WORD *)stackPopPtr(pVM->pStack))->name;
- hashForget(pHash, where);
- pDict->here = PTRtoCELL where;
-
- return;
-}
-
-/************************* freebsd added I/O words **************************/
-
-/* fopen - open a file and return new fd on stack.
- *
- * fopen ( count ptr -- fd )
- */
-static void pfopen(FICL_VM *pVM)
-{
- int fd;
- char *p;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- (void)stackPopINT32(pVM->pStack); /* don't need count value */
- p = stackPopPtr(pVM->pStack);
- fd = open(p, O_RDONLY);
- stackPushINT32(pVM->pStack, fd);
- return;
-}
-
-/* fclose - close a file who's fd is on stack.
- *
- * fclose ( fd -- )
- */
-static void pfclose(FICL_VM *pVM)
-{
- int fd;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (fd != -1)
- close(fd);
- return;
-}
-
-/* fread - read file contents
- *
- * fread ( fd buf nbytes -- nread )
- */
-static void pfread(FICL_VM *pVM)
-{
- int fd, len;
- char *buf;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 1);
-#endif
- len = stackPopINT32(pVM->pStack); /* get number of bytes to read */
- buf = stackPopPtr(pVM->pStack); /* get buffer */
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (len > 0 && buf && fd != -1)
- stackPushINT32(pVM->pStack, read(fd, buf, len));
- else
- stackPushINT32(pVM->pStack, -1);
- return;
-}
-
-/* fload - interpret file contents
- *
- * fload ( fd -- )
- */
-static void pfload(FICL_VM *pVM)
-{
- int fd;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (fd != -1)
- ficlExecFD(pVM, fd);
- return;
-}
-
-/* key - get a character from stdin
- *
- * key ( -- char )
- */
-static void key(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPushINT32(pVM->pStack, getchar());
- return;
-}
-
-/* key? - check for a character from stdin (FACILITY)
- *
- * key? ( -- flag )
- */
-static void keyQuestion(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
-#ifdef TESTMAIN
- /* XXX Since we don't fiddle with termios, let it always succeed... */
- stackPushINT32(pVM->pStack, FICL_TRUE);
-#else
- /* But here do the right thing. */
- stackPushINT32(pVM->pStack, ischar()? FICL_TRUE : FICL_FALSE);
-#endif
- return;
-}
-
-/* seconds - gives number of seconds since beginning of time
- *
- * beginning of time is defined as:
- *
- * BTX - number of seconds since midnight
- * FreeBSD - number of seconds since Jan 1 1970
- *
- * seconds ( -- u )
- */
-static void pseconds(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM,0,1);
-#endif
- stackPushUNS32(pVM->pStack, (u_int32_t) time(NULL));
- return;
-}
-
-/* ms - wait at least that many milliseconds (FACILITY)
- *
- * ms ( u -- )
- *
- */
-static void ms(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM,1,0);
-#endif
-#ifdef TESTMAIN
- usleep(stackPopUNS32(pVM->pStack)*1000);
-#else
- delay(stackPopUNS32(pVM->pStack)*1000);
-#endif
- return;
-}
-
-/* fkey - get a character from a file
- *
- * fkey ( file -- char )
- */
-static void fkey(FICL_VM *pVM)
-{
- int i, fd;
- char ch;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- fd = stackPopINT32(pVM->pStack);
- i = read(fd, &ch, 1);
- stackPushINT32(pVM->pStack, i > 0 ? ch : -1);
- return;
-}
-
-
-/**************************************************************************
- f i c l C o m p i l e C o r e
-** Builds the primitive wordset and the environment-query namespace.
-**************************************************************************/
-
-void ficlCompileCore(FICL_DICT *dp)
-{
- assert (dp);
-
- /*
- ** CORE word set
- ** see softcore.c for definitions of: abs bl space spaces abort"
- */
- pStore =
- dictAppendWord(dp, "!", store, FW_DEFAULT);
- dictAppendWord(dp, "#", numberSign, FW_DEFAULT);
- dictAppendWord(dp, "#>", numberSignGreater,FW_DEFAULT);
- dictAppendWord(dp, "#s", numberSignS, FW_DEFAULT);
- dictAppendWord(dp, "\'", tick, FW_DEFAULT);
- dictAppendWord(dp, "(", commentHang, FW_IMMEDIATE);
- dictAppendWord(dp, "*", mul, FW_DEFAULT);
- dictAppendWord(dp, "*/", mulDiv, FW_DEFAULT);
- dictAppendWord(dp, "*/mod", mulDivRem, FW_DEFAULT);
- dictAppendWord(dp, "+", add, FW_DEFAULT);
- dictAppendWord(dp, "+!", plusStore, FW_DEFAULT);
- dictAppendWord(dp, "+loop", plusLoopCoIm, FW_COMPIMMED);
- pComma =
- dictAppendWord(dp, ",", comma, FW_DEFAULT);
- dictAppendWord(dp, "-", sub, FW_DEFAULT);
- dictAppendWord(dp, ".", displayCell, FW_DEFAULT);
- dictAppendWord(dp, ".#", displayCellNoPad, FW_DEFAULT);
- dictAppendWord(dp, ".\"", dotQuoteCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "/", ficlDiv, FW_DEFAULT);
- dictAppendWord(dp, "/mod", slashMod, FW_DEFAULT);
- dictAppendWord(dp, "0<", zeroLess, FW_DEFAULT);
- dictAppendWord(dp, "0=", zeroEquals, FW_DEFAULT);
- dictAppendWord(dp, "0>", zeroGreater, FW_DEFAULT);
- dictAppendWord(dp, "1+", onePlus, FW_DEFAULT);
- dictAppendWord(dp, "1-", oneMinus, FW_DEFAULT);
- dictAppendWord(dp, "2!", twoStore, FW_DEFAULT);
- dictAppendWord(dp, "2*", twoMul, FW_DEFAULT);
- dictAppendWord(dp, "2/", twoDiv, FW_DEFAULT);
- dictAppendWord(dp, "2@", twoFetch, FW_DEFAULT);
- dictAppendWord(dp, "2drop", twoDrop, FW_DEFAULT);
- dictAppendWord(dp, "2dup", twoDup, FW_DEFAULT);
- dictAppendWord(dp, "2over", twoOver, FW_DEFAULT);
- dictAppendWord(dp, "2swap", twoSwap, FW_DEFAULT);
- dictAppendWord(dp, ":", colon, FW_DEFAULT);
- dictAppendWord(dp, ";", semicolonCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "<", isLess, FW_DEFAULT);
- dictAppendWord(dp, "<#", lessNumberSign, FW_DEFAULT);
- dictAppendWord(dp, "=", isEqual, FW_DEFAULT);
- dictAppendWord(dp, ">", isGreater, FW_DEFAULT);
- dictAppendWord(dp, ">body", toBody, FW_DEFAULT);
- dictAppendWord(dp, ">in", toIn, FW_DEFAULT);
- dictAppendWord(dp, ">number", toNumber, FW_DEFAULT);
- dictAppendWord(dp, ">r", toRStack, FW_DEFAULT);
- dictAppendWord(dp, "?dup", questionDup, FW_DEFAULT);
- dictAppendWord(dp, "@", fetch, FW_DEFAULT);
- dictAppendWord(dp, "abort", ficlAbort, FW_DEFAULT);
- dictAppendWord(dp, "accept", accept, FW_DEFAULT);
- dictAppendWord(dp, "align", align, FW_DEFAULT);
- dictAppendWord(dp, "aligned", aligned, FW_DEFAULT);
- dictAppendWord(dp, "allot", allot, FW_DEFAULT);
- dictAppendWord(dp, "and", bitwiseAnd, FW_DEFAULT);
- dictAppendWord(dp, "base", base, FW_DEFAULT);
- dictAppendWord(dp, "begin", beginCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "c!", cStore, FW_DEFAULT);
- dictAppendWord(dp, "c,", cComma, FW_DEFAULT);
- dictAppendWord(dp, "c@", cFetch, FW_DEFAULT);
- dictAppendWord(dp, "cell+", cellPlus, FW_DEFAULT);
- dictAppendWord(dp, "cells", cells, FW_DEFAULT);
- dictAppendWord(dp, "char", ficlChar, FW_DEFAULT);
- dictAppendWord(dp, "char+", charPlus, FW_DEFAULT);
- dictAppendWord(dp, "chars", ficlChars, FW_DEFAULT);
- dictAppendWord(dp, "constant", constant, FW_DEFAULT);
- dictAppendWord(dp, "count", count, FW_DEFAULT);
- dictAppendWord(dp, "cr", cr, FW_DEFAULT);
- dictAppendWord(dp, "create", create, FW_DEFAULT);
- dictAppendWord(dp, "decimal", decimal, FW_DEFAULT);
- dictAppendWord(dp, "depth", depth, FW_DEFAULT);
- dictAppendWord(dp, "do", doCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "does>", doesCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "drop", drop, FW_DEFAULT);
- dictAppendWord(dp, "dup", dup, FW_DEFAULT);
- dictAppendWord(dp, "else", elseCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "emit", emit, FW_DEFAULT);
- dictAppendWord(dp, "environment?", environmentQ,FW_DEFAULT);
- dictAppendWord(dp, "evaluate", evaluate, FW_DEFAULT);
- dictAppendWord(dp, "execute", execute, FW_DEFAULT);
- dictAppendWord(dp, "exit", exitCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "fill", fill, FW_DEFAULT);
- dictAppendWord(dp, "find", find, FW_DEFAULT);
- dictAppendWord(dp, "fm/mod", fmSlashMod, FW_DEFAULT);
- dictAppendWord(dp, "here", here, FW_DEFAULT);
- dictAppendWord(dp, "hex", hex, FW_DEFAULT);
- dictAppendWord(dp, "hold", hold, FW_DEFAULT);
- dictAppendWord(dp, "i", loopICo, FW_COMPILE);
- dictAppendWord(dp, "if", ifCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "immediate", immediate, FW_DEFAULT);
- dictAppendWord(dp, "invert", bitwiseNot, FW_DEFAULT);
- dictAppendWord(dp, "j", loopJCo, FW_COMPILE);
- dictAppendWord(dp, "k", loopKCo, FW_COMPILE);
- dictAppendWord(dp, "leave", leaveCo, FW_COMPILE);
- dictAppendWord(dp, "literal", literalIm, FW_IMMEDIATE);
- dictAppendWord(dp, "loop", loopCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "lshift", lshift, FW_DEFAULT);
- dictAppendWord(dp, "m*", mStar, FW_DEFAULT);
- dictAppendWord(dp, "max", ficlMax, FW_DEFAULT);
- dictAppendWord(dp, "min", ficlMin, FW_DEFAULT);
- dictAppendWord(dp, "mod", ficlMod, FW_DEFAULT);
- dictAppendWord(dp, "move", move, FW_DEFAULT);
- dictAppendWord(dp, "negate", negate, FW_DEFAULT);
- dictAppendWord(dp, "or", bitwiseOr, FW_DEFAULT);
- dictAppendWord(dp, "over", over, FW_DEFAULT);
- dictAppendWord(dp, "postpone", postponeCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "quit", quit, FW_DEFAULT);
- dictAppendWord(dp, "r>", fromRStack, FW_DEFAULT);
- dictAppendWord(dp, "r@", fetchRStack, FW_DEFAULT);
- dictAppendWord(dp, "recurse", recurseCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "repeat", repeatCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "rot", rot, FW_DEFAULT);
- dictAppendWord(dp, "rshift", rshift, FW_DEFAULT);
- dictAppendWord(dp, "s\"", stringQuoteIm, FW_IMMEDIATE);
- dictAppendWord(dp, "s>d", sToD, FW_DEFAULT);
- dictAppendWord(dp, "sign", sign, FW_DEFAULT);
- dictAppendWord(dp, "sm/rem", smSlashRem, FW_DEFAULT);
- dictAppendWord(dp, "source", source, FW_DEFAULT);
- dictAppendWord(dp, "state", state, FW_DEFAULT);
- dictAppendWord(dp, "swap", swap, FW_DEFAULT);
- dictAppendWord(dp, "then", endifCoIm, FW_COMPIMMED);
- pType =
- dictAppendWord(dp, "type", type, FW_DEFAULT);
- dictAppendWord(dp, "u.", uDot, FW_DEFAULT);
- dictAppendWord(dp, "u<", uIsLess, FW_DEFAULT);
- dictAppendWord(dp, "um*", umStar, FW_DEFAULT);
- dictAppendWord(dp, "um/mod", umSlashMod, FW_DEFAULT);
- dictAppendWord(dp, "unloop", unloopCo, FW_COMPILE);
- dictAppendWord(dp, "until", untilCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "variable", variable, FW_DEFAULT);
- dictAppendWord(dp, "while", whileCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "word", ficlWord, FW_DEFAULT);
- dictAppendWord(dp, "xor", bitwiseXor, FW_DEFAULT);
- dictAppendWord(dp, "[", lbracketCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "[\']", bracketTickCoIm,FW_COMPIMMED);
- dictAppendWord(dp, "[char]", charCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "]", rbracket, FW_DEFAULT);
- /*
- ** CORE EXT word set...
- ** see softcore.c for other definitions
- */
- dictAppendWord(dp, ".(", dotParen, FW_DEFAULT);
- dictAppendWord(dp, ":noname", colonNoName, FW_DEFAULT);
- dictAppendWord(dp, "?do", qDoCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "parse", parse, FW_DEFAULT);
- dictAppendWord(dp, "pick", pick, FW_DEFAULT);
- dictAppendWord(dp, "roll", roll, FW_DEFAULT);
- dictAppendWord(dp, "refill", refill, FW_DEFAULT);
- dictAppendWord(dp, "to", toValue, FW_IMMEDIATE);
- dictAppendWord(dp, "value", constant, FW_DEFAULT);
- dictAppendWord(dp, "\\", commentLine, FW_IMMEDIATE);
-
- /* FreeBSD extension words */
- dictAppendWord(dp, "fopen", pfopen, FW_DEFAULT);
- dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT);
- dictAppendWord(dp, "fread", pfread, FW_DEFAULT);
- dictAppendWord(dp, "fload", pfload, FW_DEFAULT);
- dictAppendWord(dp, "fkey", fkey, FW_DEFAULT);
- dictAppendWord(dp, "key", key, FW_DEFAULT);
- dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT);
- dictAppendWord(dp, "ms", ms, FW_DEFAULT);
- dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT);
-#ifdef __i386__
-#ifndef TESTMAIN
- dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT);
- dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT);
-#endif
- ficlSetEnv("arch-i386", FICL_TRUE);
-#else
- ficlSetEnv("arch-i386", FICL_FALSE);
-#endif
-
- /*
- ** Set CORE environment query values
- */
- ficlSetEnv("/counted-string", FICL_STRING_MAX);
- ficlSetEnv("/hold", nPAD);
- ficlSetEnv("/pad", nPAD);
- ficlSetEnv("address-unit-bits", 8);
- ficlSetEnv("core", FICL_TRUE);
- ficlSetEnv("core-ext", FICL_FALSE);
- ficlSetEnv("floored", FICL_FALSE);
- ficlSetEnv("max-char", UCHAR_MAX);
- ficlSetEnvD("max-d", 0x7fffffff, 0xffffffff );
- ficlSetEnv("max-n", 0x7fffffff);
- ficlSetEnv("max-u", 0xffffffff);
- ficlSetEnvD("max-ud", 0xffffffff, 0xffffffff);
- ficlSetEnv("return-stack-cells",FICL_DEFAULT_STACK);
- ficlSetEnv("stack-cells", FICL_DEFAULT_STACK);
-
- /*
- ** LOCAL and LOCAL EXT
- ** see softcore.c for implementation of locals|
- */
-#if FICL_WANT_LOCALS
- pLinkParen =
- dictAppendWord(dp, "(link)", linkParen, FW_COMPILE);
- pUnLinkParen =
- dictAppendWord(dp, "(unlink)", unlinkParen, FW_COMPILE);
- dictAppendWord(dp, "doLocal", doLocalIm, FW_COMPIMMED);
- pGetLocalParen =
- dictAppendWord(dp, "(@local)", getLocalParen, FW_COMPILE);
- pToLocalParen =
- dictAppendWord(dp, "(toLocal)", toLocalParen, FW_COMPILE);
- pGetLocal0 =
- dictAppendWord(dp, "(@local0)", getLocal0, FW_COMPILE);
- pToLocal0 =
- dictAppendWord(dp, "(toLocal0)",toLocal0, FW_COMPILE);
- pGetLocal1 =
- dictAppendWord(dp, "(@local1)", getLocal1, FW_COMPILE);
- pToLocal1 =
- dictAppendWord(dp, "(toLocal1)",toLocal1, FW_COMPILE);
- dictAppendWord(dp, "(local)", localParen, FW_COMPILE);
-
- ficlSetEnv("locals", FICL_TRUE);
- ficlSetEnv("locals-ext", FICL_TRUE);
- ficlSetEnv("#locals", FICL_MAX_LOCALS);
-#endif
-
- /*
- ** optional SEARCH-ORDER word set
- */
- dictAppendWord(dp, ">search", searchPush, FW_DEFAULT);
- dictAppendWord(dp, "search>", searchPop, FW_DEFAULT);
- dictAppendWord(dp, "definitions",
- definitions, FW_DEFAULT);
- dictAppendWord(dp, "forth-wordlist",
- forthWordlist, FW_DEFAULT);
- dictAppendWord(dp, "get-current",
- getCurrent, FW_DEFAULT);
- dictAppendWord(dp, "get-order", getOrder, FW_DEFAULT);
- dictAppendWord(dp, "search-wordlist",
- searchWordlist, FW_DEFAULT);
- dictAppendWord(dp, "set-current",
- setCurrent, FW_DEFAULT);
- dictAppendWord(dp, "set-order", setOrder, FW_DEFAULT);
- dictAppendWord(dp, "ficl-wordlist", wordlist, FW_DEFAULT);
-
- /*
- ** Set SEARCH environment query values
- */
- ficlSetEnv("search-order", FICL_TRUE);
- ficlSetEnv("search-order-ext", FICL_TRUE);
- ficlSetEnv("wordlists", FICL_DEFAULT_VOCS);
-
- /*
- ** TOOLS and TOOLS EXT
- */
- dictAppendWord(dp, ".s", displayStack, FW_DEFAULT);
- dictAppendWord(dp, "bye", bye, FW_DEFAULT);
- dictAppendWord(dp, "forget", forget, FW_DEFAULT);
- dictAppendWord(dp, "see", see, FW_DEFAULT);
- dictAppendWord(dp, "words", listWords, FW_DEFAULT);
-
- /*
- ** Set TOOLS environment query values
- */
- ficlSetEnv("tools", FICL_TRUE);
- ficlSetEnv("tools-ext", FICL_FALSE);
-
- /*
- ** Ficl extras
- */
- dictAppendWord(dp, ".env", listEnv, FW_DEFAULT);
- dictAppendWord(dp, ".hash", dictHashSummary,FW_DEFAULT);
- dictAppendWord(dp, ".ver", ficlVersion, FW_DEFAULT);
- dictAppendWord(dp, "-roll", minusRoll, FW_DEFAULT);
- dictAppendWord(dp, "2constant", twoConstant, FW_IMMEDIATE); /* DOUBLE */
- dictAppendWord(dp, ">name", toName, FW_DEFAULT);
- dictAppendWord(dp, "body>", fromBody, FW_DEFAULT);
- dictAppendWord(dp, "compare", compareString, FW_DEFAULT); /* STRING */
- dictAppendWord(dp, "compile-only",
- compileOnly, FW_DEFAULT);
- dictAppendWord(dp, "endif", endifCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "forget-wid",forgetWid, FW_DEFAULT);
- dictAppendWord(dp, "parse-word",parseNoCopy, FW_DEFAULT);
- dictAppendWord(dp, "sliteral", sLiteralCoIm, FW_COMPIMMED); /* STRING */
- dictAppendWord(dp, "wid-set-super",
- setParentWid, FW_DEFAULT);
- dictAppendWord(dp, "w@", wFetch, FW_DEFAULT);
- dictAppendWord(dp, "w!", wStore, FW_DEFAULT);
- dictAppendWord(dp, "x.", hexDot, FW_DEFAULT);
-#if FICL_WANT_USER
- dictAppendWord(dp, "(user)", userParen, FW_DEFAULT);
- dictAppendWord(dp, "user", userVariable, FW_DEFAULT);
-#endif
- /*
- ** internal support words
- */
- pExitParen =
- dictAppendWord(dp, "(exit)", exitParen, FW_COMPILE);
- pSemiParen =
- dictAppendWord(dp, "(;)", semiParen, FW_COMPILE);
- pLitParen =
- dictAppendWord(dp, "(literal)", literalParen, FW_COMPILE);
- pStringLit =
- dictAppendWord(dp, "(.\")", stringLit, FW_COMPILE);
- pIfParen =
- dictAppendWord(dp, "(if)", ifParen, FW_COMPILE);
- pBranchParen =
- dictAppendWord(dp, "(branch)", branchParen, FW_COMPILE);
- pDoParen =
- dictAppendWord(dp, "(do)", doParen, FW_COMPILE);
- pDoesParen =
- dictAppendWord(dp, "(does>)", doesParen, FW_COMPILE);
- pQDoParen =
- dictAppendWord(dp, "(?do)", qDoParen, FW_COMPILE);
- pLoopParen =
- dictAppendWord(dp, "(loop)", loopParen, FW_COMPILE);
- pPLoopParen =
- dictAppendWord(dp, "(+loop)", plusLoopParen, FW_COMPILE);
- pInterpret =
- dictAppendWord(dp, "interpret", interpret, FW_DEFAULT);
- dictAppendWord(dp, "(variable)",variableParen, FW_COMPILE);
- dictAppendWord(dp, "(constant)",constantParen, FW_COMPILE);
-
- return;
-}
-
diff --git a/sys/boot/i386/boot0/Makefile b/sys/boot/i386/boot0/Makefile
index 4e890da32565..d6c407a0cc47 100644
--- a/sys/boot/i386/boot0/Makefile
+++ b/sys/boot/i386/boot0/Makefile
@@ -1,16 +1,12 @@
-# $Id: Makefile,v 1.5 1998/10/17 14:20:25 rnordier Exp $
+# $Id: Makefile,v 1.3 1998/10/09 17:19:51 rnordier Exp $
PROG= boot0
NOMAN=
STRIP=
BINDIR?= /boot
-BINMODE= 444
M4?= m4
-B0FLAGS=0x0
-B0TICKS=0xb6
-
ORG= 0x600
boot0: boot0.o
@@ -23,8 +19,8 @@ boot0: boot0.o
.endif
boot0.o: boot0.m4 boot0.s
- (cd ${.CURDIR}; ${M4} -DFLAGS=${B0FLAGS} -DTICKS=${B0TICKS} \
- boot0.m4 boot0.s) | ${AS} ${AFLAGS} -o ${.TARGET}
+ (cd ${.CURDIR}; ${M4} boot0.m4 boot0.s) | \
+ ${AS} ${AFLAGS} -o ${.TARGET}
CLEANFILES+= boot0.out boot0.o
diff --git a/sys/boot/i386/boot0/boot0.m4 b/sys/boot/i386/boot0/boot0.m4
index f0912a888243..c0a38b76911e 100644
--- a/sys/boot/i386/boot0/boot0.m4
+++ b/sys/boot/i386/boot0/boot0.m4
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: boot0.m4,v 1.2 1998/10/19 19:13:53 rnordier Exp $
+# $Id:$
define(_al,0x0)dnl
define(_cl,0x1)dnl
@@ -52,22 +52,25 @@ define(_bx_,0x7)dnl
define(o16,`.byte 0x66')dnl
define(addwia,`.byte 0x5; .word $1')dnl
-define(btwr1,`.word 0xa30f; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
-define(btswr1,`.word 0xab0f; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
-define(cmpbmr,`.byte 0x3a; .byte 0x6 | ($2 << 0x3); .word $1')dnl
-define(cmpw1r,`.byte 0x3b; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
+define(btwrm,`.byte 0xf; .byte 0xa3; .byte 0x6 | ($1 << 0x3); .word $2')dnl
+define(btswrm,`.byte 0xf; .byte 0xab; .byte 0x6 | ($1 << 0x3); .word $2')dnl
+define(cmpwmr,`.byte 0x3b; .byte ($2 << 0x3) | 0x6; .word $1')dnl
define(cmpwi2,`.byte 0x81; .byte 0xb8 | $3; .word $2; .word $1')dnl
-define(addwir,`.byte 0x83; .byte 0xc0 | $2; .byte $1')dnl
+define(cmpwir,`.byte 0x81; .byte 0xf8 | $2; .word $1')dnl
define(movbr0,`.byte 0x88; .byte ($1 << 0x3) | $2')dnl
+define(movbrm,`.byte 0x88; .byte 0x6 | ($1 << 0x3); .word $2')dnl
define(movbr1,`.byte 0x88; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
define(movwr1,`.byte 0x89; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
define(movb0r,`.byte 0x8a; .byte ($2 << 0x3) | $1')dnl
+define(movbmr,`.byte 0x8a; .byte 0x6 | ($2 << 0x3); .word $1')dnl
define(movb1r,`.byte 0x8a; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
define(movw1r,`.byte 0x8b; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
define(movws1,`.byte 0x8c; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
+define(leaw1r,`.byte 0x8d; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
+define(movbma,`.byte 0xa0; .word $1')dnl
+define(movbam,`.byte 0xa2; .word $1')dnl
define(movwir,`.byte 0xb8 | $2; .word $1')dnl
define(movbi0,`.byte 0xc6; .byte $2; .byte $1')dnl
define(callwi,`.byte 0xe8; .word $1 - . - 0x2')dnl
define(jmpnwi,`.byte 0xe9; .word $1 - . - 0x2')dnl
-define(tstbi1,`.byte 0xf6; .byte 0x40 | $3; .byte $2; .byte $1')dnl
define(incb1,`.byte 0xfe; .byte 0x40 | $2; .byte $1')dnl
diff --git a/sys/boot/i386/boot0/boot0.s b/sys/boot/i386/boot0/boot0.s
index 08a8d6be21b2..ae7fa5db8893 100644
--- a/sys/boot/i386/boot0/boot0.s
+++ b/sys/boot/i386/boot0/boot0.s
@@ -13,36 +13,19 @@
# purpose.
#
-# $Id: boot0.s,v 1.5 1998/11/29 14:09:00 rnordier Exp $
+# $Id: boot0.s,v 1.2 1998/10/09 17:19:51 rnordier Exp $
# A 512-byte boot manager.
- .set NHRDRV,0x475 # Number of hard drives
- .set ORIGIN,0x600 # Execution address
- .set DSKPKT,0x800 # Disk packet
- .set FAKE,0x810 # Partition entry
.set LOAD,0x7c00 # Load address
-
+ .set ORIGIN,0x600 # Relocation address
.set PRT_OFF,0x1be # Partition table
-
- .set TBL0SZ,0x3 # Table 0 size
- .set TBL1SZ,0xa # Table 1 size
-
- .set MAGIC,0xaa55 # Magic: bootable
-
- .set KEY_ENTER,0x1c # Enter key scan code
- .set KEY_F1,0x3b # F1 key scan code
-
- .set _NXTDRV,-0x47 # Drive number
- .set _OPT,-0x46 # Default option
- .set _FLAGS,-0x45 # Flags
- .set _TICKS,-0x44 # Timeout ticks
- .set _FAKE,0x10 # Fake partition entry
- .set _MNUOPT,0x1c # Menu options
+ .set FAKE,0x810 # Partition entry
+ .set MNUOPT,0x81c # Menu options
.globl start # Entry point
-start: cld # String ops inc
+start: cld # String ops inc
xorl %eax,%eax # Zero
movl %eax,%es # Address
movl %eax,%ds # data
@@ -53,185 +36,183 @@ start: cld # String ops inc
movwir(0x100,_cx) # Word count
rep # Relocate
movsl # code
- movl %edi,%ebp # Address variables
movb $0x10,%cl # Words to clear
rep # Zero
stosl # them
incb1(-0xe,_di_) # Sector number
jmpnwi(main-LOAD+ORIGIN) # To relocated code
-main: movbr1(_dl,_FAKE,_bp_) # Save drive number
+main: movbrm(_dl,FAKE) # Save drive number
callwi(putn) # To new line
movwir(partbl,_bx) # Partition table
xorl %edx,%edx # Item
-main.1: movbr0(_dh,_bx_) # Mark inactive
+main.1: movbr0(_dh,_bx_) # Mark inactive
movb1r(0x4,_bx_,_al) # Load type
- movwir(tables,_di) # Lookup tables
- movb $TBL0SZ,%cl # Entries
+ movwir(table0,_di) # Exclusion table
+ movb $0x3,%cl # Entries
repne # Exclude
scasb # partition?
je main.3 # Yes
- movb $TBL1SZ,%cl # Entries
+ movb $0xa,%cl # Entries
repne # Known
scasb # type?
jne main.2 # No
- addwir(TBL1SZ,_di) # Adjust
-main.2: movb0r(_di_,_cl) # Partition
- addl %ecx,%edi # description
- callwi(putx) # Display it
-main.3: addwir(0x10,_bx) # Next entry
+ leaw1r(0xa,_di_,_di) # Name table
+main.2: movwir(item,_si) # Display start
+ callwi(putkey) # of menu item
+ movl %edi,%esi # Set pointer
+ lodsb # to
+ cwde # partition
+ add %eax,%esi # description
+ callwi(puts) # Display it
+ btswrm(_dx,MNUOPT) # Flag option enabled
+main.3: addb $0x10,%bl # Next entry
incl %edx # Next item
cmpb $0x4,%dl # Done?
jb main.1 # No
- movb1r(_FAKE,_bp_,_al) # Drive number
- subb $0x80-0x1,%al # Does next
- cmpbmr(NHRDRV,_al) # drive exist?
- jb main.4 # Yes
- decb %al # Already drive 0?
- jz main.5 # Yes
- xorb %al,%al # Drive 0
-main.4: addb $'0'|0x80,%al # Save
- movbr1(_al,_NXTDRV,_bp_) # it
- movwir(drive,_di) # Display
- callwi(putx) # item
-main.5: movwir(prompt,_si) # Display
+ movwir(prompt,_si) # Display
callwi(putstr) # prompt
- movb1r(_OPT,_bp_,_dl) # Display
+ movbmr(opt,_dl) # Display
decl %esi # default
callwi(putkey) # key
xorb %ah,%ah # BIOS: Get
int $0x1a # system time
- movl %edx,%edi # Save ticks
-main.6: movb $0x1,%ah # BIOS: Check
+ movl %edx,%edi # Save
+main.4: movb $0x1,%ah # BIOS: Check
int $0x16 # for keypress
- jnz main.9 # Have one
+ jnz main.6 # Have one
xorb %ah,%ah # BIOS: Get
int $0x1a # system time
subl %edi,%edx # Elapsed time
- cmpw1r(_TICKS,_bp_,_dx) # Timeout?
- jb main.6 # No
-main.7: movb1r(_OPT,_bp_,_al) # Load default
- jmp main.10 # Join common code
-main.8: movb $0x7,%al # Signal
+ cmpwmr(ticks,_dx) # Timeout?
+ jb main.4 # No
+ jmp main.7 # Join common code
+main.5: movb $0x7,%al # Signal
callwi(putchr) # error
-main.9: xorb %ah,%ah # BIOS: Get
+main.6: xorb %ah,%ah # BIOS: Get
int $0x16 # keypress
movb %ah,%al # Scan code
- cmpb $KEY_ENTER,%al # Enter pressed?
- je main.7 # No
- subb $KEY_F1,%al # Less F1 scan code
- cmpb $0x4,%al # F1..F5?
- ja main.8 # No
-main.10: cwtl # Option
- btwr1(_ax,_MNUOPT,_bp_) # enabled?
- jnc main.8 # No
+ cmpb $0x1c,%al # Enter pressed?
+ jne main.8 # No
+main.7: movbma(opt) # Load
+ jmp main.9 # default
+main.8: subb $0x3b,%al # Less F1 scan code
+ jb main.5 # Not a function key
+main.9: cmpb $0x4,%al # F1..F5?
+ ja main.5 # No
movwir(FAKE,_si) # Partition entry
- movb1r(_NXTDRV,_bp_,_dl) # Next drive
- subb $'0',%dl # number
- cmpb $0x4,%al # F5 pressed?
- je main.11 # Yes
- movb0r(_si_,_dl) # Drive number
- movbr1(_al,_OPT,_bp_) # Save option
+ movb0r(_si_,_dl) # Load drive number
+ jne main.10 # If not F5
+ xorb $0x1,%dl # Toggle drive
+ jmp main.11 # number
+main.10: cwtl # Option
+ btwrm(_ax,MNUOPT) # enabled?
+ jnc main.5 # No
+ movbam(opt) # Save option
shlb $0x4,%al # Point to
addwia(partbl) # partition
- xchgl %esi,%eax # entry
- tstbi1(0x40,_FLAGS,_bp_) # No updates?
- jnz main.11 # Yes
+ xchgl %esi,%eax # entry
movbi0(0x80,_si_) # Flag active
pushl %esi # Save
- xchgl %esi,%eax # Fake partition entry
+ movl %eax,%esi # Fake partition entry
movwir(start,_bx) # Data to write
movwir(0x301,_ax) # Write sector
callwi(intx13) # to disk
popl %esi # Restore
+ jc main.5 # If error
main.11: movwir(LOAD,_bx) # Address for read
movwir(0x201,_ax) # Read sector
callwi(intx13) # from disk
- jc main.8 # If error
- cmpwi2(MAGIC,0x1fe,_bx_) # Bootable?
- jne main.8 # No
+ jc main.5 # If error
+ cmpwi2(0xaa55,0x1fe,_bx_) # Bootable?
+ jne main.5 # No
movwir(crlf,_si) # Leave some
callwi(puts) # space
jmp *%ebx # Invoke bootstrap
# Display routines
-putkey: movb $'F',%al # Display
+putkey: movb $'F',%al # Display
callwi(putchr) # 'F'
movb $'1',%al # Prepare
addb %dl,%al # digit
jmp putstr.1 # Display the rest
-putx: btswr1(_dx,_MNUOPT,_bp_) # Enable menu option
- movwir(item,_si) # Display
- callwi(putkey) # key
- movl %edi,%esi # Display the rest
-
puts: callwi(putstr) # Display string
putn: movwir(crlf,_si) # To next line
-putstr: lodsb # Get byte
- testb $0x80,%al # End of string?
+putstr: lodsb # Get byte
+ testb $0x80,%al # End of string?
jnz putstr.2 # Yes
putstr.1: callwi(putchr) # Display char
jmp putstr # Continue
-putstr.2: andb $~0x80,%al # Clear MSB
+putstr.2: andb $~0x80,%al # Clear MSB
-putchr: pushl %ebx # Save
- movwir(0x7,_bx) # Page:attribute
+putchr: pushl %ebx # Save
+ movwir(0x7,_bx) # Page:attribute
movb $0xe,%ah # BIOS: Display
int $0x10 # character
popl %ebx # Restore
ret # To caller
-# Disk I/O routine
+# Disk I/O
-intx13: cli # Disable interrupts
- movb1r(0x1,_si_,_dh) # Load head
+intx13: movb1r(0x1,_si_,_dh) # Load head
movw1r(0x2,_si_,_cx) # Load cylinder:sector
o16 # Load
movw1r(0x8,_si_,_di) # offset
- movwir(DSKPKT,_si) # Packet pointer
+ pushl %ecx # Save
+ pushl %ebx # caller's
+ movwir(0x55aa,_bx) # Magic
+ pushl %eax # Save
+ movb $0x41,%ah # BIOS: EDD extensions
+ int $0x13 # present?
+ popl %eax # Restore
+ jc intx13.1 # No
+ cmpwir(0xaa55,_bx) # Magic?
+ jne intx13.1 # No
+ testb $0x1,%cl # Use packet?
+ jz intx13.1 # No
+ orb $0x40,%ah # Use EDD
+intx13.1: popl %ebx # Restore
+ popl %ecx # caller's
+ testb $0x40,%ah # Use EDD?
+ jz intx13.2 # No
+ movwir(break,_si) # Packet pointer
movbi0(0x10,_si_) # Packet size
movbr1(_al,0x2,_si_) # Block count
movwr1(_bx,0x4,_si_) # Transfer
movws1(_es,0x6,_si_) # buffer
o16 # LBA
movwr1(_di,0x8,_si_) # address
- sti # Enable interrupts
- tstbi1(0x80,_FLAGS,_bp_) # Use packet interface?
- jz intx13.1 # No
- orb $0x40,%ah # Use disk packet
- decl %eax # Verify off
-intx13.1: int $0x13 # BIOS: Disk I/O
+ xorb %al,%al # Verify off
+intx13.2: int $0x13 # BIOS: Disk I/O
ret # To caller
# Menu strings
-item: .ascii " "; .byte ' '|0x80
+crlf: .ascii "\r"; .byte '\n'|0x80
+item: .ascii " "; .byte ' '|0x80
prompt: .ascii "\nDefault:"; .byte ' '|0x80
-crlf: .ascii "\r"; .byte '\n'|0x80
# Partition type tables
-tables:
- .byte 0x0, 0x5, 0xf
-
- .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x63, 0x83
+table0: .byte 0x0, 0x5, 0xf
+table1: .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x63, 0x83
.byte 0xa5, 0xa6
- .byte os_misc-. # Unknown
- .byte os_dos-. # DOS
- .byte os_dos-. # DOS
- .byte os_dos-. # DOS
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_unix-. # UNIX
- .byte os_linux-. # Linux
- .byte os_freebsd-. # FreeBSD
- .byte os_bsd-. # OpenBSD
+ .byte os_misc-.-1 # Unknown
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # Windows
+ .byte os_dos-.-1 # Windows
+ .byte os_dos-.-1 # Windows
+ .byte os_unix-.-1 # UNIX
+ .byte os_linux-.-1 # Linux
+ .byte os_freebsd-.-1 # FreeBSD
+ .byte os_bsd-.-1 # OpenBSD
os_misc: .ascii "?"; .byte '?'|0x80
os_dos: .ascii "DO"; .byte 'S'|0x80
@@ -240,13 +221,12 @@ os_linux: .ascii "Linu"; .byte 'x'|0x80
os_freebsd: .ascii "Free"
os_bsd: .ascii "BS"; .byte 'D'|0x80
- .org PRT_OFF-0xb,0x90
+ .org PRT_OFF-0x3,0x90
+
+opt: .byte 0x1 # Option
+ticks: .word 0xb6 # Delay
-drive: .ascii "Drive "
-nxtdrv: .byte 0x0 # Next drive number
-opt: .byte 0x0 # Option
-flags: .byte FLAGS # Flags
-ticks: .word TICKS # Delay
+partbl: .fill 0x40,0x1,0x0 # Partition table
+ .word 0xaa55 # Magic number
-partbl: .fill 0x40,0x1,0x0 # Partition table
- .word MAGIC # Magic number
+break: # Uninitialized data
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 2b581ec521cd..e36df60f2a9b 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/11/08 15:36:34 rnordier Exp $
+# $Id: Makefile,v 1.6 1998/10/15 20:04:21 rnordier Exp $
PROG= boot2
NOMAN=
@@ -11,10 +11,6 @@ CLEANFILES+= boot1 boot1.out boot1.o \
M4?= m4
-BOOT_COMCONSOLE_PORT?= 0x3f8
-BOOT_COMCONSOLE_SPEED?= 9600
-B2SIOFMT?= 0x3
-
.if exists(${.OBJDIR}/../btx)
BTX= ${.OBJDIR}/../btx
.else
@@ -62,10 +58,7 @@ boot2.out: boot2.o sio.o
${BTX}/lib/crt0.o boot2.o sio.o
sio.o: sio.s
- (cd ${.CURDIR}; ${M4} -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
- -DSIOFMT=${B2SIOFMT} \
- -DSIOSPD=${BOOT_COMCONSOLE_SPEED} sio.s) | \
- ${AS} ${AFLAGS} -o ${.TARGET}
+ ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
diff --git a/sys/boot/i386/boot2/boot1.m4 b/sys/boot/i386/boot2/boot1.m4
index 06bdc9789331..fc221a1854c1 100644
--- a/sys/boot/i386/boot2/boot1.m4
+++ b/sys/boot/i386/boot2/boot1.m4
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: boot1.m4,v 1.2 1998/11/05 20:52:25 rnordier Exp $
+# $Id:$
define(_al,0x0)dnl
define(_cl,0x1)dnl
@@ -60,5 +60,3 @@ define(movbi1,`.byte 0xc6; .byte 0x40 | $3; .byte $2; .byte $1')dnl
define(callwi,`.byte 0xe8; .word $1 - . - 0x2')dnl
define(jmpnwi,`.byte 0xe9; .word $1 - . - 0x2')dnl
define(tstbi0,`.byte 0xf6; .byte $2; .byte $1')dnl
-define(tstbim,`.byte 0xf6; .byte 0x6; .word $2; .byte $1')dnl
-define(incw1,`.byte 0xff; .byte 0x40 | $2; .byte $1')dnl
diff --git a/sys/boot/i386/boot2/boot1.s b/sys/boot/i386/boot2/boot1.s
index 3161b748b8e9..8b408cebeff4 100644
--- a/sys/boot/i386/boot2/boot1.s
+++ b/sys/boot/i386/boot2/boot1.s
@@ -13,10 +13,11 @@
# purpose.
#
-# $Id: boot1.s,v 1.7 1999/01/10 13:29:51 peter Exp $
+# $Id: boot1.s,v 1.1.1.1 1998/10/12 21:16:26 rnordier Exp $
- .set MEM_REL,0x700 # Relocation address
- .set MEM_ARG,0x900 # Arguments
+ .set MEM_REL,0x600 # Relocation address
+ .set MEM_ARG,0x800 # Arguments
+ .set MEM_PKT,0x810 # Disk packet
.set MEM_ORG,0x7c00 # Origin
.set MEM_BUF,0x8c00 # Load area
.set MEM_BTX,0x9000 # BTX start
@@ -37,58 +38,59 @@ start: jmp main # Start recognizably
.org 0x4,0x90
-# External read from disk
-
-xread: pushl %ecx # Set
- pushl %eax # LBA
- pushl %es # Set transfer
- pushl %ebx # buffer
- pushl %edx # Set count:drive
+xread: pushl %cs # Address
+ popl %ds # data
+xread.1: movwir(MEM_PKT,_si) # Packet
+ movbr1(_al,0x2,_si_) # Blocks to read
+ o16 # Transfer
+ movwr1(_bx,0x4,_si_) # buffer
+ o16 # LBA
+ movwr1(_cx,0x8,_si_) # address
callwi(read) # Read from disk
- popl %edx # Pop all
- popl %ebx # registers
- popl %es # pushed, but
- popl %ecx # preserve
- popl %ecx # AX
- lret # To far caller
-
-# Bootstrap
+ lret # To caller
main: cld # String ops inc
- xorl %ecx,%ecx # Zero
- movl %cx,%es # Address
- movl %cx,%ds # data
- movl %cx,%ss # Set up
+ xorl %eax,%eax # Zero
+ movl %ax,%es # Address
+ movl %ax,%ds # data
+ movl %ax,%ss # Set up
movwir(start,_sp) # stack
movl %esp,%esi # Source
movwir(MEM_REL,_di) # Destination
- incb %ch # Word count
+ movwir(0x100,_cx) # Word count
rep # Copy
movsl # code
- movwir(part4,_si) # Partition
+ movb $0x10,%cl # Words to clear
+ rep # Zero
+ stosl # them
+ movbi1(0x10,-0x10,_di_) # Set packet size
cmpb $0x80,%dl # Hard drive?
jb main.4 # No
- movb $0x1,%dh # Block count
- callwi(nread) # Read MBR
- movwir(0x1,_cx) # Two passes
+ movwir(part4,_si) # Read master
+ movb $0x1,%al # boot
+ callwi(nread) # record
+ xorl %eax,%eax # Pass number
main.1: movwir(MEM_BUF+PRT_OFF,_si) # Partition table
movb $0x1,%dh # Partition
main.2: cmpbi1(PRT_BSD,0x4,_si_) # Our partition type?
jne main.3 # No
- jecxz main.5 # If second pass
tstbi0(0x80,_si_) # Active?
jnz main.5 # Yes
+ testb %al,%al # Second pass?
+ jnz main.5 # Yes
main.3: addl $0x10,%esi # Next entry
incb %dh # Partition
- cmpb $0x1+PRT_NUM,%dh # In table?
- jb main.2 # Yes
- decl %ecx # Do two
- jecxz main.1 # passes
+ cmpb $0x1+PRT_NUM,%dh # Done?
+ jb main.2 # No
+ incl %eax # Pass
+ cmpb $0x2,%al # Done?
+ jb main.1 # No
movwir(msg_part,_si) # Message
jmp error # Error
main.4: xorl %edx,%edx # Partition:drive
+ movwir(part4,_si) # Partition pointer
main.5: movwrm(_dx,MEM_ARG) # Save args
- movb $0x10,%dh # Sector count
+ movb $0x10,%al # Sector count
callwi(nread) # Read disk
movwir(MEM_BTX,_bx) # BTX
movw1r(0xa,_bx_,_si) # Point past
@@ -107,34 +109,33 @@ main.5: movwrm(_dx,MEM_ARG) # Save args
# Enable A20
-seta20: cli # Disable interrupts
-seta20.1: inb $0x64,%al # Get status
+seta20: inb $0x64,%al # Get status
testb $0x2,%al # Busy?
- jnz seta20.1 # Yes
+ jnz seta20 # Yes
movb $0xd1,%al # Command: Write
outb %al,$0x64 # output port
-seta20.2: inb $0x64,%al # Get status
+seta20.1: inb $0x64,%al # Get status
testb $0x2,%al # Busy?
- jnz seta20.2 # Yes
+ jnz seta20.1 # Yes
movb $0xdf,%al # Enable
outb %al,$0x60 # A20
- sti # Enable interrupts
ret # To caller
-# Local read from disk
+# Read from disk
-nread: movwir(MEM_BUF,_bx) # Transfer buffer
- movw1r(0x8,_si_,_ax) # Get
- movw1r(0xa,_si_,_cx) # LBA
+nread: xorw %bx,%bx # Transfer
+ movb $MEM_BUF>>0x8,%bh # buffer
+ o16 # LBA
+ movw1r(0x8,_si_,_cx) # address
pushl %cs # Read from
- callwi(xread) # disk
+ callwi(xread.1) # disk
jnc return # If success
movwir(msg_read,_si) # Message
# Error exit
error: callwi(putstr) # Display message
- movwir(prompt,_si) # Display
+ movwir(msg_boot,_si) # Display
callwi(putstr) # prompt
xorb %ah,%ah # BIOS: Get
int $0x16 # keypress
@@ -149,24 +150,40 @@ putstr: lodsb # Get char
testb %al,%al # End of string?
jne putstr.0 # No
-ereturn: movb $0x1,%ah # Invalid
- stc # argument
-return: ret # To caller
+return: ret # Generic return
# Read from disk
-read: movl %esp,%ebp # Address stack frame
+read: testb %dh,%dh # Try for extensions?
+ jz read.3 # No
+ movwir(0x55aa,_bx) # Magic
pushl %edx # Save
+ movb $0x41,%ah # BIOS: Check
+ int $0x13 # extensions present
+ popl %edx # Restore
+ jc read.3 # If error
+ cmpwir(0xaa55,_bx) # Magic?
+ jne read.3 # No
+ testb $0x1,%cl # Packet interface?
+ jz read.3 # No
+ movb $0x42,%ah # BIOS: Extended
+ int $0x13 # read
+ ret # To caller
+
+read.1: movb $0x1,%ah # Invalid
+ stc # parameter
+read.2: ret # To caller
+
+read.3: pushl %edx # Save
movb $0x8,%ah # BIOS: Get drive
int $0x13 # parameters
movb %dh,%ch # Max head number
popl %edx # Restore
- jc return # If error
+ jc read.2 # If error
andb $0x3f,%cl # Sectors per track
- jz ereturn # If zero
- cli # Disable interrupts
+ jz read.1 # If zero
o16 # Get
- movw1r(0x8,_bp_,_ax) # LBA
+ movw1r(0x8,_si_,_ax) # LBA
pushl %edx # Save
movzbw %cl,%bx # Divide by
xorw %dx,%dx # sectors
@@ -174,14 +191,13 @@ read: movl %esp,%ebp # Address stack frame
movb %ch,%bl # Max head number
movb %dl,%ch # Sector number
incl %ebx # Divide by
- xorb %dl,%dl # number
- divw %bx,%ax # of heads
+ xorb %dl,%dl # number of
+ divw %bx,%ax # heads
movb %dl,%bh # Head number
popl %edx # Restore
o16 # Cylinder number
cmpl $0x3ff,%eax # supportable?
- sti # Enable interrupts
- ja ereturn # No
+ ja read.1 # No
xchgb %al,%ah # Set up cylinder
rorb $0x2,%al # number
orb %ch,%al # Merge
@@ -189,39 +205,37 @@ read: movl %esp,%ebp # Address stack frame
xchgl %eax,%ecx # number
movb %bh,%dh # Head number
subb %ah,%al # Sectors this track
- movb1r(0x3,_bp_,_ah) # Blocks to read
+ movb1r(0x2,_si_,_ah) # Blocks to read
cmpb %ah,%al # To read
- jb read.1 # this
+ jb read.4 # this
movb %ah,%al # track
-read.1: movwir(0x5,_di) # Try count
-read.2: lesw1r(0x4,_bp_,_bx) # Transfer buffer
+read.4: movwir(0x5,_bp) # Try count
+read.5: lesw1r(0x4,_si_,_bx) # Transfer buffer
pushl %eax # Save
- movb $0x2,%ah # BIOS: Read
- int $0x13 # from disk
+ movb $0x2,%ah # BIOS: Conventional
+ int $0x13 # read
popl %ebx # Restore
- jnc read.3 # If success
- decl %edi # Retry?
- jz read.5 # No
+ jnc read.6 # If success
+ decl %ebp # Retry?
+ jz read.7 # No
xorb %ah,%ah # BIOS: Reset
int $0x13 # disk system
- xchgl %ebx,%eax # Block count
- jmp read.2 # Continue
-read.3: movzbl %bl,%eax # Sectors read
- addwr1(_ax,0x8,_bp_) # Adjust
- jnc read.4 # LBA,
- incw1(0xa,_bp_) # transfer
-read.4: shlb %bl # buffer
- addbr1(_bl,0x5,_bp_) # pointer,
- subbr1(_al,0x3,_bp_) # block count
- ja read # If not done
-read.5: ret # To caller
+ movl %ebx,%eax # Block count
+ jmp read.5 # Continue
+read.6: movzbw %bl,%ax # Sectors read
+ o16 # Adjust
+ addwr1(_ax,0x8,_si_) # LBA,
+ shlb %bl # buffer
+ addbr1(_bl,0x5,_si_) # pointer,
+ subbr1(_al,0x2,_si_) # block count
+ ja read.3 # If not done
+read.7: ret # To caller
# Messages
-msg_read: .asciz "Read"
-msg_part: .asciz "Boot"
-
-prompt: .asciz " error\r\n"
+msg_read: .asciz "Read error"
+msg_part: .asciz "No bootable partition"
+msg_boot: .asciz "\r\nHit return to reboot: "
.org PRT_OFF,0x90
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c
index fa6058bcccb7..bf9ed8c61f54 100644
--- a/sys/boot/i386/boot2/boot2.c
+++ b/sys/boot/i386/boot2/boot2.c
@@ -14,7 +14,7 @@
*/
/*
- * $Id: boot2.c,v 1.17 1999/01/10 13:29:52 peter Exp $
+ * $Id: boot2.c,v 1.6 1998/10/13 23:43:38 rnordier Exp $
*/
#include <sys/param.h>
@@ -53,9 +53,11 @@
#define PATH_CONFIG "/boot.config"
#define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/kernel"
+#define PATH_HELP "boot.help"
-#define ARGS 0x900
+#define ARGS 0x800
#define NOPT 11
+#define XOPT 2
#define BSIZEMAX 8192
#define NDEV 5
#define MEM_BASE 0x12
@@ -102,6 +104,7 @@ static struct dsk {
} dsk;
static char cmd[512];
static char kname[1024];
+static char help[2048];
static uint32_t opts;
static struct bootinfo bootinfo;
static int ls;
@@ -136,7 +139,7 @@ static int getc(int);
int
main(void)
{
- int autoboot, i;
+ int autoboot, helpon, i;
v86.ctl = V86_FLAGS;
dsk.drive = *(uint8_t *)PTOV(ARGS);
@@ -151,14 +154,11 @@ main(void)
for (i = 0; i < N_BIOS_GEOM; i++)
bootinfo.bi_bios_geom[i] = drvinfo(i);
autoboot = 2;
+ helpon = 1;
readfile(PATH_CONFIG, cmd, sizeof(cmd));
- if (*cmd) {
- printf("%s: %s", PATH_CONFIG, cmd);
- if (parse(cmd))
- autoboot = 0;
- *cmd = 0;
- }
- if (autoboot && !*kname) {
+ if (parse(cmd))
+ autoboot = 0;
+ else if (!*kname) {
if (autoboot == 2) {
memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
if (!keyhit(0x37)) {
@@ -169,21 +169,21 @@ main(void)
if (autoboot == 1)
memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
}
+ readfile(PATH_HELP, help, sizeof(help));
for (;;) {
printf(" \n>> FreeBSD/i386 BOOT\n"
"Default: %u:%s(%u,%c)%s\n"
+ "%s"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,
- 'a' + dsk.part, kname);
+ 'a' + dsk.part, kname, helpon ? help : "");
if (ioctrl & 0x2)
sio_flush();
if (!autoboot || keyhit(0x5a))
getstr(cmd, sizeof(cmd));
- else
- putchar('\n');
- autoboot = 0;
+ autoboot = helpon = 0;
if (parse(cmd))
- putchar('\a');
+ helpon = 1;
else
load(kname);
}
@@ -226,16 +226,22 @@ load(const char *fname)
if (fmt == 0) {
addr = hdr.ex.a_entry & 0xffffff;
p = PTOV(addr);
+ printf("%s=0x%x ", "text", (unsigned)hdr.ex.a_text);
fs_off = PAGE_SIZE;
if (xfsread(ino, p, hdr.ex.a_text))
return;
p += roundup2(hdr.ex.a_text, PAGE_SIZE);
+ printf("%s=0x%x ", "data", (unsigned)hdr.ex.a_data);
if (xfsread(ino, p, hdr.ex.a_data))
return;
- p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE);
+ p += hdr.ex.a_data;
+ printf("%s=0x%x ", "bss", (unsigned)hdr.ex.a_bss);
+ p += roundup2(hdr.ex.a_bss, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
p += sizeof(hdr.ex.a_syms);
+ printf("symbols=[");
+ printf("+0x%x", (unsigned)hdr.ex.a_syms);
if (hdr.ex.a_syms) {
if (xfsread(ino, p, hdr.ex.a_syms))
return;
@@ -245,6 +251,7 @@ load(const char *fname)
x = *(uint32_t *)p;
p += sizeof(int);
x -= sizeof(int);
+ printf("+0x%x", x);
if (xfsread(ino, p, x))
return;
p += x;
@@ -259,12 +266,15 @@ load(const char *fname)
}
for (i = 0; i < 2; i++) {
p = PTOV(ep[i].p_paddr & 0xffffff);
+ printf("%s=0x%x ", !i ? "text" : "data", ep[i].p_filesz);
fs_off = ep[i].p_offset;
if (xfsread(ino, p, ep[i].p_filesz))
return;
}
+ printf("%s=0x%x ", "bss", ep[1].p_memsz - ep[1].p_filesz);
p += roundup2(ep[1].p_memsz, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
+ printf("symbols=[");
if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) {
fs_off = hdr.eh.e_shoff + sizeof(es[0]) *
(hdr.eh.e_shstrndx + 1);
@@ -273,6 +283,7 @@ load(const char *fname)
for (i = 0; i < 2; i++) {
memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
p += sizeof(es[i].sh_size);
+ printf("+0x%x", es[i].sh_size);
fs_off = es[i].sh_offset;
if (xfsread(ino, p, es[i].sh_size))
return;
@@ -282,6 +293,7 @@ load(const char *fname)
addr = hdr.eh.e_entry & 0xffffff;
}
bootinfo.bi_esymtab = VTOP(p);
+ printf("]\nentry=0x%x\n", addr);
bootinfo.bi_kernelname = VTOP(fname);
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
MAKEBOOTDEV(dsk.type, 0, dsk.slice, dsk.unit, dsk.part),
@@ -305,14 +317,16 @@ parse(char *arg)
for (i = 0; c != optstr[i]; i++)
if (i == NOPT - 1)
return -1;
- opts ^= 1 << flags[i];
+ if (i < XOPT)
+ opts ^= 1 << flags[i];
+ else
+ opts |= 1 << flags[i];
}
if (opts & 1 << RBX_PROBEKBD) {
i = *(uint8_t *)PTOV(0x496) & 0x10;
printf("Keyboard: %s\n", i ? "yes" : "no");
if (!i)
opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL;
- opts &= ~(1 << RBX_PROBEKBD);
}
ioctrl = opts & 1 << RBX_DUAL ? 0x3 :
opts & 1 << RBX_SERIAL ? 0x2 : 0x1;
@@ -469,7 +483,7 @@ fsread(ino_t inode, void *buf, size_t nbyte)
return -1;
}
fsblks = fs.fs_bsize >> DEV_BSHIFT;
- dsk.meta++;
+ dsk.meta = 1;
}
if (!inode)
return 0;
@@ -630,15 +644,9 @@ getstr(char *str, int size)
s = str;
do {
switch (c = getchar()) {
- case 0:
- break;
case '\b':
- if (s > str) {
+ if (s > str)
s--;
- putchar(c);
- putchar(' ');
- } else
- c = 0;
break;
case '\n':
*s = 0;
@@ -647,8 +655,7 @@ getstr(char *str, int size)
if (s - str < size - 1)
*s++ = c;
}
- if (c)
- putchar(c);
+ putchar(c);
} while (c != '\n');
}
@@ -731,12 +738,11 @@ drvread(void *buf, unsigned lba, unsigned nblk)
printf("%c\b", c = c << 8 | c >> 24);
v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
- v86.addr = 0x704; /* call to xread in boot1 */
- v86.es = VTOPSEG(buf);
- v86.eax = lba;
- v86.ebx = VTOPOFF(buf);
- v86.ecx = lba >> 16;
- v86.edx = nblk << 8 | dsk.drive;
+ v86.addr = 0x604;
+ v86.eax = nblk;
+ v86.ebx = VTOPSEG(buf) << 16 | VTOPOFF(buf);
+ v86.ecx = lba;
+ v86.edx = 0x100 | dsk.drive;
v86int();
v86.ctl = V86_FLAGS;
if (V86_CY(v86.efl)) {
diff --git a/sys/boot/i386/boot2/sio.s b/sys/boot/i386/boot2/sio.s
index 92237b852b72..985ac04ef469 100644
--- a/sys/boot/i386/boot2/sio.s
+++ b/sys/boot/i386/boot2/sio.s
@@ -13,11 +13,11 @@
# purpose.
#
-# $Id: sio.s,v 1.2 1998/10/20 20:20:48 rnordier Exp $
+# $Id:$
- .set SIO_PRT,SIOPRT # Base port
- .set SIO_FMT,SIOFMT # 8N1
- .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD
+ .set SIO_PRT,0x3f8 # Base port
+ .set SIO_FMT,0x3 # 8N1
+ .set SIO_DIV,0xc # 115200 / 9600
.globl sio_init
.globl sio_flush
diff --git a/sys/boot/i386/btx/btx/btx.s b/sys/boot/i386/btx/btx/btx.s
index 92842626d00f..d94fa2c11a27 100644
--- a/sys/boot/i386/btx/btx/btx.s
+++ b/sys/boot/i386/btx/btx/btx.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btx.s,v 1.7 1998/11/01 13:52:52 rnordier Exp $
+# $Id: btx.s,v 1.5 1998/10/03 18:05:12 rnordier Exp $
#
# Memory layout.
@@ -340,7 +340,7 @@ intx00: pushb $0x0 # Int 0x0: #DE
intx10: pushb $0x10 # Int 0x10: #MF
jmp ex_noc # Floating-point error
#
-# Handle #GP exception.
+#
#
ex_v86: testb $0x2,0x12(%esp,1) # V86 mode?
jz except # No
@@ -459,7 +459,7 @@ v86mon.1: lodsb # Get opcode
v86mon.2: cmpb $0xf4,%al # HLT?
jne v86mon.3 # No
cmpl $inthlt+0x1,%esi # Is inthlt?
- jne v86mon.6 # No (ignore)
+ jne v86mon.4 # No
jmp intrtn # Return to user mode
v86mon.3: cmpb $0xfa,%al # CLI?
je v86cli # Yes
@@ -479,13 +479,13 @@ v86mon.3: cmpb $0xfa,%al # CLI?
cmpb $0xcf,%al # IRET/IRETD?
je v86iret # Yes
popl %ebx # Restore
- popa # Restore
+v86mon.4: popa # Restore
jmp except # Handle exception
-v86mon.4: movl %edx,0x30(%ebp) # Save V86 flags
-v86mon.5: popl %edx # V86 SS adjustment
+v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags
+v86mon.6: popl %edx # V86 SS adjustment
subl %edx,%ebx # Save V86
movl %ebx,0x34(%ebp) # SP
-v86mon.6: subl %edi,%esi # From linear
+v86mon.7: subl %edi,%esi # From linear
movl %esi,0x28(%ebp) # Save V86 IP
popa # Restore
leal 0x8(%esp,1),%esp # Discard int no, error
@@ -494,12 +494,12 @@ v86mon.6: subl %edi,%esi # From linear
# Emulate CLI.
#
v86cli: andb $~0x2,0x31(%ebp) # Clear IF
- jmp v86mon.6 # Finish up
+ jmp v86mon.7 # Finish up
#
# Emulate STI.
#
v86sti: orb $0x2,0x31(%ebp) # Set IF
- jmp v86mon.6 # Finish up
+ jmp v86mon.7 # Finish up
#
# Emulate PUSHF/PUSHFD.
#
@@ -508,7 +508,7 @@ v86pushf: subl %ecx,%ebx # Adjust SP
je v86pushf.1 # Yes
o16 # 16-bit
v86pushf.1: movl %edx,(%ebx) # Save flags
- jmp v86mon.5 # Finish up
+ jmp v86mon.6 # Finish up
#
# Emulate IRET/IRETD.
#
@@ -529,7 +529,7 @@ v86popf.1: movl (%ebx),%eax # Load flags
andl $V86_FLG,%eax # Merge
andl $~V86_FLG,%edx # the
orl %eax,%edx # flags
- jmp v86mon.4 # Finish up
+ jmp v86mon.5 # Finish up
#
# Emulate INT imm8.
#
@@ -546,7 +546,7 @@ v86intn: lodsb # Get int no
movl %edi,0x2c(%ebp) # Save CS
xorl %edi,%edi # No ESI adjustment
andb $~0x3,%dh # Clear IF and TF
- jmp v86mon.4 # Finish up
+ jmp v86mon.5 # Finish up
#
# Hardware interrupt jump table.
#
@@ -693,12 +693,12 @@ intusr.4: shrl $0x4,%eax # Gives segment
xchgl %eax,%ebp # Get int no/address
testb $0x1,%dl # Address?
jnz intusr.5 # Yes
- shll $0x2,%eax # Scale
+ shll $0x2,%eax # XXX Scale
movl (%eax),%eax # Load int vector
-intusr.5: movl %eax,%ecx # Save
+intusr.5: movl %eax,%ecx # XXX Save
shrl $0x10,%eax # Gives segment
stosl # Set CS
- movw %cx,%ax # Restore
+ movw %cx,%ax # XXX Restore
stosl # Set EIP
leal 0x10(%esp,1),%esp # Discard seg regs
popa # Restore
@@ -755,7 +755,7 @@ dump.1: testb $DMP_X32,%ch # Dump long?
dump.2: testb $DMP_MEM,%ch # Dump memory?
jz dump.8 # No
pushl %ds # Save
- testb $0x2,0x52(%ebx) # V86 mode?
+ testb $0x2,0x52(%ebx) # XXX V86 mode?
jnz dump.3 # Yes
verrl 0x4(%esi) # Readable selector?
jnz dump.3 # No
diff --git a/sys/boot/i386/btx/btxldr/Makefile b/sys/boot/i386/btx/btxldr/Makefile
index 32cb4adb0b8e..9df9681867ec 100644
--- a/sys/boot/i386/btx/btxldr/Makefile
+++ b/sys/boot/i386/btx/btxldr/Makefile
@@ -1,7 +1,6 @@
-# $Id: Makefile,v 1.5 1998/10/13 18:29:18 rnordier Exp $
+# $Id: Makefile,v 1.4 1998/09/25 17:14:15 peter Exp $
ORG=0x100000
-AFLAGS+= --assembler-with-cpp
all: btxldr
@@ -15,7 +14,7 @@ btxldr: btxldr.o
.endif
btxldr.o: btxldr.s
- ${CC} ${AFLAGS} -c -o ${.TARGET} ${.CURDIR}/btxldr.s
+ ${AS} ${AFLAGS} -o ${.TARGET} ${.CURDIR}/btxldr.s
CLEANFILES+= btxldr btxldr.out btxldr.o
diff --git a/sys/boot/i386/btx/btxldr/btxldr.s b/sys/boot/i386/btx/btxldr/btxldr.s
index a3172e3e3cb5..7a6bd50b1a15 100644
--- a/sys/boot/i386/btx/btxldr/btxldr.s
+++ b/sys/boot/i386/btx/btxldr/btxldr.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btxldr.s,v 1.3 1998/10/06 07:15:35 rnordier Exp $
+# $Id: btxldr.s,v 1.2 1998/10/06 06:13:36 msmith Exp $
#
# Prototype BTX loader program, written in a couple of hours. The
@@ -70,24 +70,24 @@ start: cld # String ops inc
shll $0xa,%eax # in bytes
movl %eax,%ebp # Base of user stack
movl $m_mem,%esi # Display
- call dhexout # amount of
- call dputstr # base memory
+ call hexout # amount of
+ call putstr # base memory
lgdt gdtdesc # Load new GDT
#
# Relocate caller's arguments.
#
movl $m_esp,%esi # Display
movl %esp,%eax # caller's
- call dhexout # stack
- call dputstr # pointer
+ call hexout # stack
+ call putstr # pointer
movl $m_args,%esi # Format string
leal 0x4(%esp,1),%ebx # First argument
movl $0x6,%ecx # Count
start.1: movl (%ebx),%eax # Get argument and
addl $0x4,%ebx # bump pointer
- call dhexout # Display it
+ call hexout # Display it
loop start.1 # Till done
- call dputstr # End message
+ call putstr # End message
movl $0x48,%ecx # Allocate space
subl %ecx,%ebp # for bootinfo
movl 0x18(%esp,1),%esi # Source
@@ -97,8 +97,8 @@ start.1: movl (%ebx),%eax # Get argument and
movl %ebp,0x18(%esp,1) # Update pointer
movl $m_rel_bi,%esi # Display
movl %ebp,%eax # bootinfo
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
movl $0x18,%ecx # Allocate space
subl %ecx,%ebp # for arguments
leal 0x4(%esp,1),%esi # Source
@@ -107,8 +107,8 @@ start.1: movl (%ebx),%eax # Get argument and
movsb # them
movl $m_rel_args,%esi # Display
movl %ebp,%eax # argument
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
#
# Set up BTX kernel.
#
@@ -145,16 +145,16 @@ start.1: movl (%ebx),%eax # Get argument and
movl %esi,%ebx # Keep place
movl $m_rel_btx,%esi # Restore
popl %eax # parameters
- call dhexout # and
+ call hexout # and
popl %ebp # display
movl %ebp,%eax # the
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
addl $PAG_SIZ,%ebp # Display
movl $m_base,%esi # the
movl %ebp,%eax # user
- call dhexout # base
- call dputstr # address
+ call hexout # base
+ call putstr # address
#
# Set up ELF-format client program.
#
@@ -164,7 +164,7 @@ start.1: movl (%ebx),%eax # Get argument and
call putstr # message
start.2: jmp start.2 # Hang
start.3: movl $m_elf,%esi # Display ELF
- call dputstr # message
+ call putstr # message
movl $m_segs,%esi # Format string
movl $0x2,%edi # Segment count
movl 0x1c(%ebx),%edx # Get e_phoff
@@ -173,14 +173,14 @@ start.3: movl $m_elf,%esi # Display ELF
start.4: cmpl $0x1,(%edx) # Is p_type PT_LOAD?
jne start.6 # No
movl 0x4(%edx),%eax # Display
- call dhexout # p_offset
+ call hexout # p_offset
movl 0x8(%edx),%eax # Display
- call dhexout # p_vaddr
+ call hexout # p_vaddr
movl 0x10(%edx),%eax # Display
- call dhexout # p_filesz
+ call hexout # p_filesz
movl 0x14(%edx),%eax # Display
- call dhexout # p_memsz
- call dputstr # End message
+ call hexout # p_memsz
+ call putstr # End message
pushl %esi # Save
pushl %edi # working
pushl %ecx # registers
@@ -205,7 +205,7 @@ start.5: popl %ecx # Restore
start.6: addl $0x20,%edx # To next entry
loop start.4 # Till done
start.7: movl $m_done,%esi # Display done
- call dputstr # message
+ call putstr # message
movl $start.8,%esi # Real mode stub
movl $MEM_STUB,%edi # Destination
movl $SIZ_STUB,%ecx # Size
@@ -229,10 +229,6 @@ start.9:
#
# Output message [ESI] followed by EAX in hex.
#
-dhexout:
-#ifndef BTXLDR_VERBOSE
- ret
-#endif
hexout: pushl %eax # Save
call putstr # Display message
popl %eax # Restore
@@ -258,12 +254,6 @@ hexout.2: decl %esi # Adjust for inc
#
# Output zero-terminated string [ESI] to the console.
#
-dputstr:
-#ifndef BTXLDR_VERBOSE
- ret
-#else
- jmp putstr
-#endif
putstr.0: call putchr # Output char
putstr: lodsb # Load char
testb %al,%al # End of string?
@@ -272,10 +262,6 @@ putstr: lodsb # Load char
#
# Output character AL to the console.
#
-dputchr:
-#ifndef BTXLDR_VERBOSE
- ret
-#endif
putchr: pusha # Save
xorl %ecx,%ecx # Zero for loops
movb $SCR_MAT,%ah # Mode/attribute
@@ -351,10 +337,7 @@ gdtdesc: .word gdt.1-gdt-1 # Limit
#
# Messages.
#
-m_logo: .asciz "\nBTX loader 0.01 "
-m_vers: .asciz "BTX version is \0\n"
-e_fmt: .asciz "Error: Client format not supported\n"
-#ifdef BTXLDR_VERBOSE
+m_logo: .asciz "\nBTX loader 0.01\n"
m_mem: .asciz "Starting in protected mode (base mem=\0)\n"
m_esp: .asciz "Arguments passed (esp=\0):\n"
m_args: .asciz"<howto="
@@ -365,8 +348,10 @@ m_args: .asciz"<howto="
.asciz" bootinfo=\0>\n"
m_rel_bi: .asciz "Relocated bootinfo (size=48) to \0\n"
m_rel_args: .asciz "Relocated arguments (size=18) to \0\n"
+m_vers: .asciz "BTX version is \0\n"
m_rel_btx: .asciz "Relocated kernel (size=\0) to \0\n"
m_base: .asciz "Client base address is \0\n"
+e_fmt: .asciz "Error: Client format not supported\n"
m_elf: .asciz "Client format is ELF\n"
m_segs: .asciz "text segment: offset="
.asciz " vaddr="
@@ -377,7 +362,6 @@ m_segs: .asciz "text segment: offset="
.asciz " filesz="
.asciz " memsz=\0\n"
m_done: .asciz "Loading complete\n"
-#endif
#
# Uninitialized data area.
#
diff --git a/sys/boot/i386/btx/lib/btxv86.s b/sys/boot/i386/btx/lib/btxv86.s
index 46709a39540c..b67e873510e5 100644
--- a/sys/boot/i386/btx/lib/btxv86.s
+++ b/sys/boot/i386/btx/lib/btxv86.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btxv86.s,v 1.1 1998/09/14 10:37:00 rnordier Exp $
+# $Id:$
#
# BTX V86 interface.
@@ -48,13 +48,11 @@
#
# V86 interface function.
#
-__v86int: popl __v86ret # Save return address
- pushl $__v86 # Push pointer
+__v86int: pushl $__v86 # Push pointer
call __v86_swap # Load V86 registers
int $INT_V86 # To BTX
call __v86_swap # Load user registers
addl $0x4,%esp # Discard pointer
- pushl __v86ret # Restore return address
ret # To user
#
# Swap V86 and user registers.
@@ -82,4 +80,3 @@ __v86_swap: xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP
# V86 interface structure.
#
.comm __v86,SIZ_V86
- .comm __v86ret,4
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index 2cfd2e345956..ec22662921de 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -1,39 +1,26 @@
-# $Id: Makefile,v 1.12 1998/12/22 11:51:25 abial Exp $
+# $Id: Makefile,v 1.7 1998/09/30 22:36:45 peter Exp $
#
-LIB= i386
+LIB= i386
NOPIC=
NOPROFILE=
-INTERNALLIB= true
+INTERNALLIB= true
INTERNALSTATICLIB= true
-SRCS= aout_freebsd.c biosdisk.c biosmem.c biospnp.c biospci.c \
- bootinfo.c comconsole.c devicename.c elf_freebsd.c gatea20.c \
- i386_copy.c i386_module.c time.c vidconsole.c
+SRCS= aout_freebsd.c biosdisk.c biosmem.c bootinfo.c comconsole.c \
+ devicename.c elf_freebsd.c gatea20.c i386_copy.c i386_module.c time.c vidconsole.c
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
-I${.CURDIR}/../../.. -I.
-BOOT_COMCONSOLE_PORT?= 0x3f8
-CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT}
-
-BOOT_COMCONSOLE_SPEED?= 9600
-CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
-
# Make the disk code more talkative
#CFLAGS+= -DDISK_DEBUG
-# Include simple terminal emulation (cons25-compatible)
-CFLAGS+= -DTERM_EMU
-
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
-.endif
-
CLEANFILES+= machine
.include <bsd.lib.mk>
+
+beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index 8b102aefbd5d..1337a92ac0d9 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: biosdisk.c,v 1.19 1999/01/09 02:36:19 msmith Exp $
+ * $Id: biosdisk.c,v 1.13 1998/10/11 10:01:55 peter Exp $
*/
/*
@@ -101,14 +101,10 @@ static int bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest);
static int bd_int13probe(struct bdinfo *bd);
-static void bd_printslice(struct open_disk *od, int offset, char *prefix);
-
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, ...);
static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
struct devsw biosdisk = {
"disk",
@@ -117,8 +113,7 @@ struct devsw biosdisk = {
bd_strategy,
bd_open,
bd_close,
- noioctl,
- bd_print
+ noioctl
};
static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev);
@@ -174,6 +169,7 @@ bd_init(void)
/* XXX we need "disk aliases" to make this simpler */
printf("BIOS drive %c: is disk%d\n",
(unit < 0x80) ? ('A' + unit) : ('C' + unit - 0x80), nbdinfo);
+ bdinfo[nbdinfo].bd_unit = unit;
nbdinfo++;
}
}
@@ -204,91 +200,6 @@ bd_int13probe(struct bdinfo *bd)
}
/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i, j;
- char line[80];
- struct i386_devdesc dev;
- struct open_disk *od;
- struct dos_partition *dptr;
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: BIOS drive %c:\n", i,
- (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit) : ('C' + bdinfo[i].bd_unit - 0x80));
- pager_output(line);
-
- /* try to open the whole disk */
- dev.d_kind.biosdisk.unit = i;
- dev.d_kind.biosdisk.slice = -1;
- dev.d_kind.biosdisk.partition = -1;
-
- if (!bd_opendisk(&od, &dev)) {
-
- /* Do we have a partition table? */
- if (od->od_flags & BD_PARTTABOK) {
- dptr = &od->od_parttab[0];
-
- /* Check for a "truly dedicated" disk */
- if ((dptr[3].dp_typ == DOSPTYP_386BSD) &&
- (dptr[3].dp_start == 0) &&
- (dptr[3].dp_size == 50000)) {
- sprintf(line, " disk%d", i);
- bd_printslice(od, 0, line);
- } else {
- for (j = 0; j < NDOSPART; j++) {
- switch(dptr[j].dp_typ) {
- case DOSPTYP_386BSD:
- sprintf(line, " disk%ds%d", i, j + 1);
- bd_printslice(od, dptr[j].dp_start, line);
- break;
- default:
- }
- }
-
- }
- }
- bd_closedisk(od);
- }
- }
-}
-
-static void
-bd_printslice(struct open_disk *od, int offset, char *prefix)
-{
- char line[80];
- u_char buf[BIOSDISK_SECSIZE];
- struct disklabel *lp;
- int i;
-
- /* read disklabel */
- if (bd_read(od, offset + LABELSECTOR, 1, buf))
- return;
- lp =(struct disklabel *)(&buf[0]);
- if (lp->d_magic != DISKMAGIC) {
- sprintf(line, "%s: bad disklabel\n");
- pager_output(line);
- return;
- }
-
- /* Print partitions */
- for (i = 0; i < lp->d_npartitions; i++) {
- if ((lp->d_partitions[i].p_fstype == FS_BSDFFS) || (lp->d_partitions[i].p_fstype == FS_SWAP) ||
- ((lp->d_partitions[i].p_fstype == FS_UNUSED) &&
- (od->od_flags & BD_FLOPPY) && (i == 0))) { /* Floppies often have bogus fstype, print 'a' */
- sprintf(line, " %s%c: %s %.6dMB (%d - %d)\n", prefix, 'a' + i,
- (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" : "FFS",
- lp->d_partitions[i].p_size / 2048, /* 512-byte sector assumption */
- lp->d_partitions[i].p_offset, lp->d_partitions[i].p_offset + lp->d_partitions[i].p_size);
- pager_output(line);
- }
- }
-}
-
-
-/*
* Attempt to open the disk described by (dev) for use by (f).
*
* Note that the philosophy here is "give them exactly what
@@ -391,14 +302,8 @@ bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
dptr = &od->od_parttab[0];
od->od_flags |= BD_PARTTABOK;
- /* Is this a request for the whole disk? */
- if (dev->d_kind.biosdisk.slice == -1) {
- sector == 0;
- goto unsliced;
- }
-
/* Try to auto-detect the best slice; this should always give a slice number */
- if (dev->d_kind.biosdisk.slice == 0)
+ if (dev->d_kind.biosdisk.slice < 1)
dev->d_kind.biosdisk.slice = bd_bestslice(dptr);
switch (dev->d_kind.biosdisk.slice) {
@@ -406,7 +311,6 @@ bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
error = ENOENT;
goto out;
case 0:
- sector = 0;
goto unsliced;
default:
break;
@@ -570,16 +474,6 @@ bd_closedisk(struct open_disk *od)
static int
bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
{
- struct bcache_devdata bcd;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
-{
struct open_disk *od = (struct open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data);
int blks;
#ifdef BD_SUPPORT_FRAGS
@@ -747,10 +641,7 @@ bd_getgeom(struct open_disk *od)
}
/*
- * Return a suitable dev_t value for (dev).
- *
- * In the case where it looks like (dev) is a SCSI disk, we allow the number of
- * IDE disks to be specified in $num_ide_disks. There should be a Better Way.
+ * Return a suitable dev_t value for (dev)
*/
int
bd_getdev(struct i386_devdesc *dev)
@@ -759,8 +650,6 @@ bd_getdev(struct i386_devdesc *dev)
int biosdev;
int major;
int rootdev;
- char *nip, *cp;
- int unitofs = 0;
biosdev = bd_unit2bios(dev->d_kind.biosdisk.unit);
DEBUG("unit %d BIOS device %d", dev->d_kind.biosdisk.unit, biosdev);
@@ -783,13 +672,6 @@ bd_getdev(struct i386_devdesc *dev)
if ((od->od_flags & BD_LABELOK) && (od->od_disklabel.d_type == DTYPE_SCSI)) {
/* label OK, disk labelled as SCSI */
major = DAMAJOR;
- /* check for unit number correction hint */
- if ((nip = getenv("num_ide_disks")) != NULL) {
- unitofs = strtol(nip, &cp, 0);
- /* check for parse error */
- if ((cp == nip) || (*cp != 0))
- unitofs = 0;
- }
} else {
/* assume an IDE disk */
major = WDMAJOR;
@@ -798,7 +680,7 @@ bd_getdev(struct i386_devdesc *dev)
rootdev = MAKEBOOTDEV(major,
(dev->d_kind.biosdisk.slice + 1) >> 4, /* XXX slices may be wrong here */
(dev->d_kind.biosdisk.slice + 1) & 0xf,
- (biosdev & 0x7f) - unitofs, /* allow for #wd compenstation in da case */
+ biosdev & 0x7f, /* XXX allow/compute shift for da when wd present */
dev->d_kind.biosdisk.partition);
DEBUG("dev is 0x%x\n", rootdev);
return(rootdev);
diff --git a/sys/boot/i386/libi386/biospci.c b/sys/boot/i386/libi386/biospci.c
deleted file mode 100644
index 92f4fd28c297..000000000000
--- a/sys/boot/i386/libi386/biospci.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@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.
- *
- * $Id$
- */
-
-/*
- * PnP enumerator using the PCI BIOS.
- */
-
-#include <stand.h>
-#include <string.h>
-#include <machine/stdarg.h>
-#include <bootstrap.h>
-#include <isapnp.h>
-#include <btxv86.h>
-
-/*
- * Stupid PCI BIOS interface doesn't let you simply enumerate everything
- * that's there, instead you have to ask it if it has something.
- *
- * So we have to scan by class code, subclass code and sometimes programming
- * interface.
- */
-
-struct pci_progif
-{
- int pi_code;
- char *pi_name;
-};
-
-static struct pci_progif progif_null[] = {
- {0x0, NULL},
- {-1, NULL}
-};
-
-static struct pci_progif progif_display[] = {
- {0x0, "VGA"},
- {0x1, "8514"},
- {-1, NULL}
-};
-
-static struct pci_progif progif_ide[] = {
- {0x00, NULL},
- {0x01, NULL},
- {0x02, NULL},
- {0x03, NULL},
- {0x04, NULL},
- {0x05, NULL},
- {0x06, NULL},
- {0x07, NULL},
- {0x08, NULL},
- {0x09, NULL},
- {0x0a, NULL},
- {0x0b, NULL},
- {0x0c, NULL},
- {0x0d, NULL},
- {0x0e, NULL},
- {0x0f, NULL},
- {0x80, NULL},
- {0x81, NULL},
- {0x82, NULL},
- {0x83, NULL},
- {0x84, NULL},
- {0x85, NULL},
- {0x86, NULL},
- {0x87, NULL},
- {0x88, NULL},
- {0x89, NULL},
- {0x8a, NULL},
- {0x8b, NULL},
- {0x8c, NULL},
- {0x8d, NULL},
- {0x8e, NULL},
- {0x8f, NULL},
- {-1, NULL}
-};
-
-static struct pci_progif progif_serial[] = {
- {0x0, "8250"},
- {0x1, "16450"},
- {0x2, "16550"},
- {-1, NULL}
-};
-
-static struct pci_progif progif_parallel[] = {
- {0x0, "Standard"},
- {0x1, "Bidirectional"},
- {0x2, "ECP"},
- {-1, NULL}
-};
-
-
-struct pci_subclass
-{
- int ps_subclass;
- char *ps_name;
- struct pci_progif *ps_progif; /* if set, use for programming interface value(s) */
-};
-
-static struct pci_subclass subclass_old[] = {
- {0x0, "Old non-VGA", progif_null},
- {0x1, "Old VGA", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_mass[] = {
- {0x0, "SCSI", progif_null},
- {0x1, "IDE", progif_ide},
- {0x2, "Floppy disk", progif_null},
- {0x3, "IPI", progif_null},
- {0x4, "RAID", progif_null},
- {0x80, "mass storage", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_net[] = {
- {0x0, "Ethernet", progif_null},
- {0x1, "Token ring", progif_null},
- {0x2, "FDDI", progif_null},
- {0x3, "ATM", progif_null},
- {0x80, "network", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_display[] = {
- {0x0, NULL, progif_display},
- {0x1, "XGA", progif_null},
- {0x80, "other", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_comms[] = {
- {0x0, "serial", progif_serial},
- {0x1, "parallel", progif_parallel},
- {0x80, "communications", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_serial[] = {
- {0x0, "Firewire", progif_null},
- {0x1, "ACCESS.bus", progif_null},
- {0x2, "SSA", progif_null},
- {0x3, "USB", progif_null},
- {0x4, "Fibrechannel", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_class
-{
- int pc_class;
- char *pc_name;
- struct pci_subclass *pc_subclass;
-} pci_classes[] = {
- {0x0, "device", subclass_old},
- {0x1, "controller", subclass_mass},
- {0x2, "controller", subclass_net},
- {0x3, "display", subclass_display},
- {0x7, "controller", subclass_comms},
- {0xc, "controller", subclass_serial},
- {-1, NULL, NULL}
-};
-
-
-static void biospci_enumerate(void);
-static void biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi);
-
-static int biospci_version;
-static int biospci_hwcap;
-
-struct pnphandler biospcihandler =
-{
- "PCI BIOS",
- biospci_enumerate
-};
-
-static void
-biospci_enumerate(void)
-{
- int index, locator, devid;
- struct pci_class *pc;
- struct pci_subclass *psc;
- struct pci_progif *ppi;
-
- /* Find the PCI BIOS */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb101;
- v86.edi = 0x0;
- v86int();
-
- /* Check for OK response */
- if ((v86.efl & 1) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
- return;
-
- biospci_version = v86.ebx & 0xffff;
- biospci_hwcap = v86.eax & 0xff;
-#if 0
- printf("PCI BIOS %d.%d%s%s\n",
- bcd2bin((biospci_version >> 8) & 0xf), bcd2bin(biospci_version & 0xf),
- (biospci_hwcap & 1) ? " config1" : "", (biospci_hwcap & 2) ? " config2" : "");
-#endif
- /* Iterate over known classes */
- for (pc = pci_classes; pc->pc_class >= 0; pc++) {
- /* Iterate over subclasses */
- for (psc = pc->pc_subclass; psc->ps_subclass >= 0; psc++) {
- /* Iterate over programming interfaces */
- for (ppi = psc->ps_progif; ppi->pi_code >= 0; ppi++) {
-
- /* Scan for matches */
- for (index = 0; ; index++) {
-
- /* Look for a match */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb103;
- v86.ecx = (pc->pc_class << 16) + (psc->ps_subclass << 8) + ppi->pi_code;
- v86.esi = index;
- v86int();
- /* error/end of matches */
- if ((v86.efl & 1) || (v86.eax & 0xff00))
- break;
-
- /* Got something */
- locator = v86.ebx;
-
- /* Read the device identifier from the nominated device */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb10a;
- v86.ebx = locator;
- v86.edi = 0x0;
- v86int();
- /* error */
- if ((v86.efl & 1) || (v86.eax & 0xff00))
- break;
-
- /* We have the device ID, create a PnP object and save everything */
- devid = v86.ecx;
- biospci_addinfo(devid, pc, psc, ppi);
- }
- }
- }
- }
-}
-
-static void
-biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi)
-{
- struct pnpinfo *pi;
- char desc[80];
-
-
- /* build the description */
- desc[0] = 0;
- if (ppi->pi_name != NULL) {
- strcat(desc, ppi->pi_name);
- strcat(desc, " ");
- }
- if (psc->ps_name != NULL) {
- strcat(desc, psc->ps_name);
- strcat(desc, " ");
- }
- if (pc->pc_name != NULL)
- strcat(desc, pc->pc_name);
-
- pi = pnp_allocinfo();
- pi->pi_desc = strdup(desc);
- sprintf(desc,"0x%08x", devid);
- pnp_addident(pi, desc);
- pnp_addinfo(pi);
-}
diff --git a/sys/boot/i386/libi386/biospnp.c b/sys/boot/i386/libi386/biospnp.c
deleted file mode 100644
index a6064ba27462..000000000000
--- a/sys/boot/i386/libi386/biospnp.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@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.
- *
- * $Id: biospnp.c,v 1.2 1998/10/23 22:29:08 msmith Exp $
- */
-
-/*
- * PnP BIOS enumerator.
- */
-
-#include <stand.h>
-#include <string.h>
-#include <machine/stdarg.h>
-#include <bootstrap.h>
-#include <isapnp.h>
-#include <btxv86.h>
-
-
-static int biospnp_init(void);
-static void biospnp_enumerate(void);
-
-struct pnphandler biospnphandler =
-{
- "PnP BIOS",
- biospnp_enumerate
-};
-
-struct pnp_ICstructure
-{
- u_int8_t pnp_signature[4] __attribute__ ((packed));
- u_int8_t pnp_version __attribute__ ((packed));
- u_int8_t pnp_length __attribute__ ((packed));
- u_int16_t pnp_BIOScontrol __attribute__ ((packed));
- u_int8_t pnp_checksum __attribute__ ((packed));
- u_int32_t pnp_eventflag __attribute__ ((packed));
- u_int16_t pnp_rmip __attribute__ ((packed));
- u_int16_t pnp_rmcs __attribute__ ((packed));
- u_int16_t pnp_pmip __attribute__ ((packed));
- u_int32_t pnp_pmcs __attribute__ ((packed));
- u_int8_t pnp_OEMdev[4] __attribute__ ((packed));
- u_int16_t pnp_rmds __attribute__ ((packed));
- u_int32_t pnp_pmds __attribute__ ((packed));
-};
-
-struct pnp_devNode
-{
- u_int16_t dn_size __attribute__ ((packed));
- u_int8_t dn_handle __attribute__ ((packed));
- u_int8_t dn_id[4] __attribute__ ((packed));
- u_int8_t dn_type[3] __attribute__ ((packed));
- u_int16_t dn_attrib __attribute__ ((packed));
- u_int8_t dn_data[0] __attribute__ ((packed));
-};
-
-struct pnp_isaConfiguration
-{
- u_int8_t ic_revision __attribute__ ((packed));
- u_int8_t ic_nCSN __attribute__ ((packed));
- u_int16_t ic_rdport __attribute__ ((packed));
- u_int16_t ic_reserved __attribute__ ((packed));
-};
-
-static struct pnp_ICstructure *pnp_Icheck = NULL;
-static u_int16_t pnp_NumNodes;
-static u_int16_t pnp_NodeSize;
-
-static void biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn);
-static int biospnp_call(int func, char *fmt, ...);
-
-#define vsegofs(vptr) (((u_int32_t)VTOPSEG(vptr) << 16) + VTOPOFF(vptr))
-void (* v86bios)(u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) = (void *)v86int;
-
-#define biospnp_f00(NumNodes, NodeSize) biospnp_call(0x00, "ll", NumNodes, NodeSize)
-#define biospnp_f01(Node, devNodeBuffer, Control) biospnp_call(0x01, "llw", Node, devNodeBuffer, Control)
-#define biospnp_f40(Configuration) biospnp_call(0x40, "l", Configuration)
-
-/* PnP BIOS return codes */
-#define PNP_SUCCESS 0x00
-#define PNP_FUNCTION_NOT_SUPPORTED 0x80
-
-/*
- * Initialisation: locate the PnP BIOS, test that we can call it.
- * Returns nonzero if the PnP BIOS is not usable on this system.
- */
-static int
-biospnp_init(void)
-{
- struct pnp_isaConfiguration icfg;
- char *sigptr;
- int result;
-
- /* Search for the $PnP signature */
- pnp_Icheck = NULL;
- for (sigptr = PTOV(0xf0000); sigptr < PTOV(0xfffff); sigptr += 16)
- if (!bcmp(sigptr, "$PnP", 4)) {
- pnp_Icheck = (struct pnp_ICstructure *)sigptr;
- break;
- }
-
- /* No signature, no BIOS */
- if (pnp_Icheck == NULL)
- return(1);
-
- /*
- * Fetch the system table parameters as a test of the BIOS
- */
- result = biospnp_f00(vsegofs(&pnp_NumNodes), vsegofs(&pnp_NodeSize));
- if (result != PNP_SUCCESS) {
- return(1);
- }
-
- /*
- * Look for the PnP ISA configuration table
- */
- result = biospnp_f40(vsegofs(&icfg));
- switch (result) {
- case PNP_SUCCESS:
- /* If the BIOS found some PnP devices, take its hint for the read port */
- if ((icfg.ic_revision == 1) && (icfg.ic_nCSN > 0))
- isapnp_readport = icfg.ic_rdport;
- break;
- case PNP_FUNCTION_NOT_SUPPORTED:
- /* The BIOS says there is no ISA bus (should we trust that this works?) */
- printf("PnP BIOS claims no ISA bus\n");
- isapnp_readport = -1;
- break;
- }
- return(0);
-}
-
-static void
-biospnp_enumerate(void)
-{
- u_int8_t Node;
- struct pnp_devNode *devNodeBuffer;
- int result;
- struct pnpinfo *pi;
- int count;
-
- /* Init/check state */
- if (biospnp_init())
- return;
-
- devNodeBuffer = (struct pnp_devNode *)malloc(pnp_NodeSize);
- Node = 0;
- count = 1000;
- while((Node != 0xff) && (count-- > 0)) {
- result = biospnp_f01(vsegofs(&Node), vsegofs(devNodeBuffer), 0x1);
- if (result != PNP_SUCCESS) {
- printf("PnP BIOS node %d: error 0x%x\n", Node, result);
- } else {
- pi = pnp_allocinfo();
- pnp_addident(pi, pnp_eisaformat(devNodeBuffer->dn_id));
- biospnp_scanresdata(pi, devNodeBuffer);
- pnp_addinfo(pi);
- }
- }
-}
-
-/*
- * Scan the resource data in the node's data area for compatible device IDs
- * and descriptions.
- */
-static void
-biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn)
-{
- int tag, i, rlen, dlen;
- u_int8_t *p;
- char *str;
-
- p = dn->dn_data; /* point to resource data */
- dlen = dn->dn_size - (p - (u_int8_t *)dn); /* length of resource data */
-
- for (i = 0; i < dlen; i+= rlen) {
- tag = p[i];
- i++;
- if (PNP_RES_TYPE(tag) == 0) {
- rlen = PNP_SRES_LEN(tag);
- /* small resource */
- switch (PNP_SRES_NUM(tag)) {
-
- case COMP_DEVICE_ID:
- /* got a compatible device ID */
- pnp_addident(pi, pnp_eisaformat(p + i));
- break;
-
- case END_TAG:
- return;
- }
- } else {
- /* large resource */
- rlen = *(u_int16_t *)(p + i);
- i += sizeof(u_int16_t);
-
- switch(PNP_LRES_NUM(tag)) {
-
- case ID_STRING_ANSI:
- str = malloc(rlen + 1);
- bcopy(p + i, str, rlen);
- str[rlen] = 0;
- if (pi->pi_desc == NULL) {
- pi->pi_desc = str;
- } else {
- free(str);
- }
- break;
- }
- }
- }
-}
-
-
-/*
- * Make a 16-bit realmode PnP BIOS call.
- *
- * The first argument passed is the function number, the last is the
- * BIOS data segment selector. Intermediate arguments may be 16 or
- * 32 bytes in length, and are described by the format string.
- *
- * Arguments to the BIOS functions must be packed on the stack, hence
- * this evil.
- */
-static int
-biospnp_call(int func, char *fmt, ...)
-{
- va_list ap;
- char *p;
- u_int8_t *argp;
- u_int32_t args[4];
- u_int32_t i;
-
- /* function number first */
- argp = (u_int8_t *)args;
- *(u_int16_t *)argp = func;
- argp += sizeof(u_int16_t);
-
- /* take args according to format */
- va_start(ap, fmt);
- for (p = fmt; *p != 0; p++) {
- switch(*p) {
-
- case 'w':
- i = va_arg(ap, u_int16_t);
- *(u_int16_t *)argp = i;
- argp += sizeof(u_int16_t);
- break;
-
- case 'l':
- i = va_arg(ap, u_int32_t);
- *(u_int32_t *)argp = i;
- argp += sizeof(u_int32_t);
- break;
- }
- }
-
- /* BIOS segment last */
- *(u_int16_t *)argp = pnp_Icheck->pnp_rmds;
- argp += sizeof(u_int16_t);
-
- /* prepare for call */
- v86.ctl = V86_ADDR | V86_CALLF;
- v86.addr = ((u_int32_t)pnp_Icheck->pnp_rmcs << 16) + pnp_Icheck->pnp_rmip;
-
- /* call with packed stack and return */
- v86bios(args[0], args[1], args[2], args[3]);
- return(v86.eax & 0xffff);
-}
diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c
index 77ba8b75a83a..5b479cd3446e 100644
--- a/sys/boot/i386/libi386/bootinfo.c
+++ b/sys/boot/i386/libi386/bootinfo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.14 1998/10/15 17:06:36 peter Exp $
+ * $Id: bootinfo.c,v 1.13 1998/10/14 05:07:23 peter Exp $
*/
#include <stand.h>
@@ -249,7 +249,9 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
printf("can't determine root device\n");
return(EINVAL);
}
-
+
+ /* Boot from whatever the current device is */
+ i386_getdev((void **)(&rootdev), NULL, NULL);
switch(rootdev->d_type) {
case DEVT_DISK:
/* pass in the BIOS device number of the current disk */
diff --git a/sys/boot/i386/libi386/comconsole.c b/sys/boot/i386/libi386/comconsole.c
index 7b35d1dce8c9..261e909d225b 100644
--- a/sys/boot/i386/libi386/comconsole.c
+++ b/sys/boot/i386/libi386/comconsole.c
@@ -22,45 +22,16 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: comconsole.c,v 1.5 1998/11/22 07:59:16 rnordier Exp $
+ * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
+ *
+ * $Id: comconsole.c,v 1.3 1998/10/02 16:32:45 msmith Exp $
*/
#include <stand.h>
#include <bootstrap.h>
-#include <machine/cpufunc.h>
+#include <btxv86.h>
#include "libi386.h"
-/* selected defines from ns16550.h */
-#define com_data 0 /* data register (R/W) */
-#define com_dlbl 0 /* divisor latch low (W) */
-#define com_dlbh 1 /* divisor latch high (W) */
-#define com_ier 1 /* interrupt enable (W) */
-#define com_iir 2 /* interrupt identification (R) */
-#define com_fifo 2 /* FIFO control (W) */
-#define com_lctl 3 /* line control register (R/W) */
-#define com_cfcr 3 /* line control register (R/W) */
-#define com_mcr 4 /* modem control register (R/W) */
-#define com_lsr 5 /* line status register (R/W) */
-#define com_msr 6 /* modem status register (R/W) */
-
-/* selected defines from sioreg.h */
-#define CFCR_DLAB 0x80
-#define MCR_RTS 0x02
-#define MCR_DTR 0x01
-#define LSR_TXRDY 0x20
-#define LSR_RXRDY 0x01
-
-#define COMC_FMT 0x3 /* 8N1 */
-#define COMC_TXWAIT 0x40000 /* transmit timeout */
-#define COMC_BPS(x) (115200 / (x)) /* speed to DLAB divisor */
-
-#ifndef COMPORT
-#define COMPORT 0x3f8
-#endif
-#ifndef COMSPEED
-#define COMSPEED 9600
-#endif
-
static void comc_probe(struct console *cp);
static int comc_init(int arg);
static void comc_putchar(int c);
@@ -71,7 +42,7 @@ static int comc_started;
struct console comconsole = {
"comconsole",
- "serial port",
+ "BIOS serial port",
0,
comc_probe,
comc_init,
@@ -80,6 +51,8 @@ struct console comconsole = {
comc_ischar
};
+#define BIOS_COMPORT 0
+
static void
comc_probe(struct console *cp)
{
@@ -90,19 +63,19 @@ comc_probe(struct console *cp)
static int
comc_init(int arg)
{
+ int i;
+
if (comc_started && arg == 0)
return 0;
comc_started = 1;
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0xe3; /* 9600N81 */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
- outb(COMPORT + com_cfcr, CFCR_DLAB | COMC_FMT);
- outb(COMPORT + com_dlbl, COMC_BPS(COMSPEED) & 0xff);
- outb(COMPORT + com_dlbh, COMC_BPS(COMSPEED) >> 8);
- outb(COMPORT + com_cfcr, COMC_FMT);
- outb(COMPORT + com_mcr, MCR_RTS | MCR_DTR);
-
- do
- inb(COMPORT + com_data);
- while (inb(COMPORT + com_lsr) & LSR_RXRDY);
+ for(i = 0; i < 10 && comc_ischar(); i++)
+ (void)comc_getchar();
return(0);
}
@@ -110,23 +83,35 @@ comc_init(int arg)
static void
comc_putchar(int c)
{
- int wait;
-
- for (wait = COMC_TXWAIT; wait > 0; wait--)
- if (inb(COMPORT + com_lsr) & LSR_TXRDY) {
- outb(COMPORT + com_data, c);
- break;
- }
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x100 | c; /* Function 1 = write */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
}
static int
comc_getchar(void)
{
- return(comc_ischar() ? inb(COMPORT + com_data) : -1);
+ if (comc_ischar()) {
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x200; /* Function 2 = read */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
+ return(v86.eax & 0xff);
+ } else {
+ return(-1);
+ }
}
static int
comc_ischar(void)
{
- return(inb(COMPORT + com_lsr) & LSR_RXRDY);
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x300; /* Function 3 = status */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
+ return(v86.eax & 0x100); /* AH bit 1 is "receive data ready" */
}
diff --git a/sys/boot/i386/libi386/vidconsole.c b/sys/boot/i386/libi386/vidconsole.c
index 05e77110c2ef..c67cd72061b5 100644
--- a/sys/boot/i386/libi386/vidconsole.c
+++ b/sys/boot/i386/libi386/vidconsole.c
@@ -26,7 +26,7 @@
*
* From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
*
- * $Id: vidconsole.c,v 1.10 1998/12/31 13:44:04 abial Exp $
+ * $Id: vidconsole.c,v 1.5 1998/10/07 07:34:31 msmith Exp $
*/
#include <stand.h>
@@ -48,28 +48,6 @@ static int vidc_ischar(void);
static int vidc_started;
-#ifdef TERM_EMU
-void end_term();
-void bail_out(int c);
-void vidc_term_emu(int c);
-void get_pos(void);
-void curs_move(int x, int y);
-void write_char(int c, int fg, int bg);
-void scroll_up(int rows, int fg, int bg);
-void AB(void);
-void AF(void);
-void CD(void);
-void CM(void);
-void HO(void);
-void ME(void);
-
-static int args[2],argc,br;
-static int fg,bg,dig;
-static int fg_c,bg_c,curx,cury;
-static int esc;
-#endif
-
-
struct console vidconsole = {
"vidconsole",
"internal video/keyboard",
@@ -106,390 +84,21 @@ vidc_init(int arg)
if (vidc_started && arg == 0)
return;
vidc_started = 1;
-#ifdef TERM_EMU
- /* Init terminal emulator */
- end_term();
- get_pos();
- curs_move(curx,cury);
- fg_c=7;
- bg_c=0;
-#endif
for(i = 0; i < 10 && vidc_ischar(); i++)
(void)vidc_getchar();
return(0); /* XXX reinit? */
}
static void
-vidc_biosputchar(int c)
+vidc_putchar(int c)
{
v86.ctl = 0;
v86.addr = 0x10;
- v86.eax = 0xe00 | (c & 0xff);
+ v86.eax = 0xe00 | c;
v86.ebx = 0x7;
v86int();
}
-static void
-vidc_rawputchar(int c)
-{
- int i;
-
- if(c == '\t')
- /* lame tab expansion */
- for (i = 0; i < 8; i++)
- vidc_rawputchar(' ');
- else {
-#ifndef TERM_EMU
- vidc_biosputchar(c);
-#else
- /* Emulate AH=0eh (teletype output) */
- switch(c) {
- case '\a':
- vidc_biosputchar(c);
- return;
- case '\r':
- curx=0;
- curs_move(curx,cury);
- return;
- case '\n':
- cury++;
- if(cury>24) {
- scroll_up(1,fg_c,bg_c);
- cury--;
- } else {
- curs_move(curx,cury);
- }
- return;
- case '\b':
- if(curx>0) {
- curx--;
- curs_move(curx,cury);
- /* write_char(' ',fg_c,bg_c); XXX destructive(!) */
- return;
- }
- return;
- default:
- write_char(c,fg_c,bg_c);
- curx++;
- if(curx>79) {
- curx=0;
- cury++;
- }
- if(cury>24) {
- curx=0;
- scroll_up(1,fg_c,bg_c);
- cury--;
- }
- }
- curs_move(curx,cury);
-#endif
- }
-}
-
-#ifdef TERM_EMU
-
-/* Get cursor position on the screen. Result is in edx. Sets
- * curx and cury appropriately.
- */
-void
-get_pos(void)
-{
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0300;
- v86.ebx = 0x0;
- v86int();
- curx=v86.edx & 0x00ff;
- cury=(v86.edx & 0xff00)>>8;
-}
-
-/* Move cursor to x rows and y cols (0-based). */
-void
-curs_move(int x, int y)
-{
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0200;
- v86.ebx = 0x0;
- v86.edx = ((0x00ff & y)<<8)+(0x00ff & x);
- v86int();
- curx=x;
- cury=y;
- /* If there is ctrl char at this position, cursor would be invisible.
- * Make it a space instead.
- */
- v86.ctl=0;
- v86.addr = 0x10;
- v86.eax = 0x0800;
- v86.ebx= 0x0;
- v86int();
-#define isvisible(c) (((c)>32) && ((c)<255))
- if(!isvisible(v86.eax & 0x00ff)) {
- write_char(' ',fg_c,bg_c);
- }
-}
-
-/* Scroll up the whole window by a number of rows. If rows==0,
- * clear the window. fg and bg are attributes for the new lines
- * inserted in the window.
- */
-void
-scroll_up(int rows, int fg, int bg)
-{
- if(rows==0) rows=25;
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0600+(0x00ff & rows);
- v86.ebx = (bg<<12)+(fg<<8);
- v86.ecx = 0x0;
- v86.edx = 0x184f;
- v86int();
-}
-
-/* Write character and attribute at cursor position. */
-void
-write_char(int c, int fg, int bg)
-{
- v86.ctl=0;
- v86.addr = 0x10;
- v86.eax = 0x0900+(0x00ff & c);
- v86.ebx = (bg<<4)+fg;
- v86.ecx = 0x1;
- v86int();
-}
-
-/* Calculate power of 10 */
-int
-pow10(int i)
-{
- int res=1;
-
- while(i-->0) {
- res*=10;
- }
- return res;
-}
-
-/**************************************************************/
-/*
- * Screen manipulation functions. They use accumulated data in
- * args[] and argc variables.
- *
- */
-
-/* Set background color */
-void
-AB(void){
- bg_c=args[0];
- end_term();
-}
-
-/* Set foreground color */
-void
-AF(void)
-{
- fg_c=args[0];
- end_term();
-}
-
-/* Clear display from current position to end of screen */
-void
-CD(void)
-{
- get_pos();
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0600;
- v86.ebx = (bg_c<<4)+fg_c;
- v86.ecx = v86.edx;
- v86.edx = 0x184f;
- v86int();
- curx=0;
- curs_move(curx,cury);
- end_term();
-}
-
-/* Absolute cursor move to args[0] rows and args[1] columns
- * (the coordinates are 1-based).
- */
-void
-CM(void)
-{
- if(args[0]>0) args[0]--;
- if(args[1]>0) args[1]--;
- curs_move(args[1],args[0]);
- end_term();
-}
-
-/* Home cursor (left top corner) */
-void
-HO(void)
-{
- argc=1;
- args[0]=args[1]=1;
- CM();
-}
-
-/* Exit attribute mode (reset fore/back-ground colors to defaults) */
-void
-ME(void)
-{
- fg_c=7;
- bg_c=0;
- end_term();
-}
-
-/* Clear internal state of the terminal emulation code */
-void
-end_term(void)
-{
- esc=0;
- argc=-1;
- fg=bg=br=0;
- args[0]=args[1]=0;
- dig=0;
-}
-
-/* Gracefully exit ESC-sequence processing in case of misunderstanding */
-void
-bail_out(int c)
-{
- char buf[6],*ch;
-
- if(esc) vidc_rawputchar('\033');
- if(br) vidc_rawputchar('[');
- if(argc>-1) {
- sprintf(buf,"%d",args[0]);
- ch=buf;
- while(*ch) vidc_rawputchar(*ch++);
-
- if(argc>0) {
- vidc_rawputchar(';');
- sprintf(buf,"%d",args[1]);
- ch=buf;
- while(*ch) vidc_rawputchar(*ch++);
- }
- }
- vidc_rawputchar(c);
- end_term();
-}
-
-/* Emulate basic capabilities of cons25 terminal */
-void
-vidc_term_emu(int c)
-{
-
- if(!esc) {
- if(c=='\033') {
- esc=1;
- } else {
- vidc_rawputchar(c);
- }
- return;
- }
-
- /* Do ESC sequences processing */
- switch(c) {
- case '\033':
- /* ESC in ESC sequence - error */
- bail_out(c);
- break;
- case '[':
- /* Check if it's first char after ESC */
- if(argc<0) {
- br=1;
- } else {
- bail_out(c);
- }
- break;
- case 'H':
- /* Emulate \E[H (cursor home) and
- * \E%d;%dH (cursor absolute move) */
- if(br) {
- switch(argc) {
- case -1:
- HO();
- break;
- case 1:
- if(fg) args[0]+=pow10(dig)*3;
- if(bg) args[0]+=pow10(dig)*4;
- CM();
- break;
- default:
- bail_out(c);
- }
- } else bail_out(c);
- break;
- case 'J':
- /* Emulate \EJ (clear to end of screen) */
- if(br && argc<0) {
- CD();
- } else bail_out(c);
- break;
- case ';':
- /* perhaps args separator */
- if(br && (argc>-1)) {
- argc++;
- } else bail_out(c);
- break;
- case 'm':
- /* Change char attributes */
- if(br) {
- switch(argc) {
- case -1:
- ME();
- break;
- case 0:
- if(fg) AF();
- else AB();
- break;
- default:
- bail_out(c);
- }
- } else bail_out(c);
- break;
- default:
- if(isdigit(c)) {
- /* Carefully collect numeric arguments */
- /* XXX this is ugly. */
- if(br) {
- if(argc==-1) {
- argc=0;
- args[argc]=0;
- dig=0;
- /* in case we're in error... */
- if(c=='3') {
- fg=1;
- return;
- }
- if(c=='4') {
- bg=1;
- return;
- }
- args[argc]=(int)(c-'0');
- dig=1;
- args[argc+1]=0;
- } else {
- args[argc]=args[argc]*10+(int)(c-'0');
- if(argc==0) dig++;
- }
- } else bail_out(c);
- } else bail_out(c);
- break;
- }
-}
-#endif
-
-static void
-vidc_putchar(int c)
-{
-#ifdef TERM_EMU
- vidc_term_emu(c);
-#else
- vidc_rawputchar(c);
-#endif
-}
-
static int
vidc_getchar(void)
{
@@ -511,7 +120,9 @@ vidc_ischar(void)
v86.addr = 0x16;
v86.eax = 0x100;
v86int();
- return(!(v86.efl & PSL_Z));
+ if (!(v86.efl & PSL_Z))
+ return(v86.eax & 0xff);
+ return(0);
}
#if KEYBOARD_PROBE
@@ -537,7 +148,7 @@ static void
delay7(void)
{
/*
- * I know this is broken, but no timer is available yet at this stage...
+ * I know this is broken, but no timer is avaiable yet at this stage...
* See also comments in `delay1ms()'.
*/
inb(IO_DUMMY); inb(IO_DUMMY);
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 053fbd348862..02fd2d005a1a 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.27 1999/01/11 05:52:28 msmith Exp $
+# $Id: Makefile,v 1.11 1998/10/12 01:03:00 rnordier Exp $
BASE= loader
PROG= ${BASE}
@@ -11,17 +11,8 @@ BINDIR?= /boot
SRCS= main.c conf.c
# Enable PnP and ISA-PnP code.
-HAVE_PNP= yes
-HAVE_ISABUS= yes
-
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-.if exists(${.OBJDIR}/../../ficl/libficl.a)
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.else
-LIBFICL= ${.CURDIR}/../../ficl/libficl.a
-.endif
+#HAVE_PNP= yes
+#HAVE_ISABUS= yes
# Always add MI sources
.PATH: ${.CURDIR}/../../common
@@ -29,7 +20,8 @@ LIBFICL= ${.CURDIR}/../../ficl/libficl.a
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../.. -I.
-CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
+CLEANFILES+= vers.c vers.o ${BASE}.list setdef0.o setdef1.o setdefs.h \
+ gensetdefs.o gensetdefs ${BASE}.bin
CFLAGS+= -Wall
LDFLAGS= -nostdlib -static -Ttext 0x1000
@@ -57,9 +49,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib
# BTX is expecting ELF components
CFLAGS+= -elf
-# New linker set code
-CFLAGS+= -DNEW_LINKER_SET
-
# Debug me!
#CFLAGS+= -g
#LDFLAGS+= -g
@@ -68,47 +57,34 @@ vers.o:
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
-${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help
+${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN}
btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
${BASE}.bin
-# /usr/bin/kzip ${.TARGET}
-# mv ${.TARGET}.kz ${.TARGET}
-
-${BASE}.bin: ${BASE}.sym
- cp ${.ALLSRC} ${.TARGET}
- strip ${.TARGET}
-
-${BASE}.help: help.common help.i386
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-beforeinstall:
-.if exists(${DESTDIR}/boot/loader)
- mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
-.endif
-.if exists(${.OBJDIR}/loader.help)
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
-.else
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
-.endif
-# Cannot use ${OBJS} above this line
-.include <bsd.prog.mk>
+${BASE}.bin: ${OBJS} ${LIBI386} vers.o setdef0.o setdef1.o
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} setdef0.o ${OBJS} vers.o setdef1.o \
+ ${LIBSTAND} ${LIBI386} ${LIBSTAND}
-${BASE}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
- ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
- ${LIBFICL} ${LIBSTAND} ${LIBI386} ${LIBSTAND}
+setdef0.o: setdefs.h
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
+setdef1.o: setdefs.h
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
-.endif
-
CLEANFILES+= machine
+.include <bsd.prog.mk>
+# Linker set gymnastics
+setdefs.h: gensetdefs ${OBJS}
+ @echo Generating linker sets
+ @./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} -static gensetdefs.o -o $@
+
+gensetdefs.o: gensetdefs.c
+ ${CC} -c $<
+
+beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index 9b4d554bc1a0..d39d67f33873 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: conf.c,v 1.9 1998/10/22 20:23:58 msmith Exp $
+ * $Id: conf.c,v 1.6 1998/09/30 19:48:42 peter Exp $
*/
#include <stand.h>
@@ -85,12 +85,10 @@ struct console *consoles[] = {
};
extern struct pnphandler isapnphandler;
-extern struct pnphandler biospnphandler;
-extern struct pnphandler biospcihandler;
+/* extern struct pnphandler pcipnphandler;*/
struct pnphandler *pnphandlers[] = {
- &biospnphandler, /* should go first, as it may set isapnp_readport */
- &isapnphandler,
- &biospcihandler,
+/* &isapnphandler, */
+/* &pcipnphandler, */
NULL
};
diff --git a/sys/boot/i386/loader/help.i386 b/sys/boot/i386/loader/help.i386
deleted file mode 100644
index 81288250ade0..000000000000
--- a/sys/boot/i386/loader/help.i386
+++ /dev/null
@@ -1,34 +0,0 @@
-################################################################################
-# Treboot DReboot the system
-
- reboot
-
- Causes the system to immediately reboot.
-
-################################################################################
-# Theap DDisplay memory management statistics
-
- heap
-
- Requests debugging output from the heap manager. For debugging use
- only.
-
-################################################################################
-# Tset Snum_ide_disks DSet the number of IDE disks
-
- set num_ide_disks=<value>
-
- When booting from a SCSI disk on a system with one or more IDE disks,
- and where the IDE disks are the default boot device, it is necessary
- to tell the kernel how many IDE disks there are in order to have it
- correctly locate the SCSI disk you are booting from.
-
-################################################################################
-# Tset Sboot_userconfig DStart Userconfig
-
- set boot_userconfig
-
- Requests that the kernel's interactive device configuration program
- be run when the kernel is booted.
-
-################################################################################
diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c
index dfd1bfffbb98..b9e93f49b357 100644
--- a/sys/boot/i386/loader/main.c
+++ b/sys/boot/i386/loader/main.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.13 1998/10/22 20:23:58 msmith Exp $
+ * $Id: main.c,v 1.10 1998/10/03 18:27:50 rnordier Exp $
*/
/*
@@ -58,8 +58,6 @@ static struct bootinfo *initial_bootinfo;
struct arch_switch archsw; /* MI/MD interface boundary */
static void extract_currdev(void);
-static int isa_inb(int port);
-static void isa_outb(int port, int value);
/* from vers.c */
extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
@@ -98,11 +96,6 @@ main(void)
cons_probe();
/*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k cache XXX tune this */
-
- /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
@@ -112,6 +105,10 @@ main(void)
printf("\n");
printf("%s, Revision %s %d/%dkB\n", bootprog_name, bootprog_rev, getbasemem(), getextmem());
printf("(%s, %s)\n", bootprog_maker, bootprog_date);
+#if 0
+ printf("recovered args howto = 0x%x bootdev = 0x%x bootinfo = %p\n",
+ initial_howto, initial_bootdev, initial_bootinfo);
+#endif
extract_currdev(); /* set $currdev and $loaddev */
setenv("LINES", "24", 1); /* optional */
@@ -121,8 +118,6 @@ main(void)
archsw.arch_copyin = i386_copyin;
archsw.arch_copyout = i386_copyout;
archsw.arch_readin = i386_readin;
- archsw.arch_isainb = isa_inb;
- archsw.arch_isaoutb = isa_outb;
interact(); /* doesn't return */
}
@@ -200,34 +195,3 @@ command_heap(int argc, char *argv[])
printf("heap base at %p, top at %p\n", end, sbrk(0));
return(CMD_OK);
}
-
-/* ISA bus access functions for PnP, derived from <machine/cpufunc.h> */
-static int
-isa_inb(int port)
-{
- u_char data;
-
- if (__builtin_constant_p(port) &&
- (((port) & 0xffff) < 0x100) &&
- ((port) < 0x10000)) {
- __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port)));
- } else {
- __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
- }
- return(data);
-}
-
-static void
-isa_outb(int port, int value)
-{
- u_char al = value;
-
- if (__builtin_constant_p(port) &&
- (((port) & 0xffff) < 0x100) &&
- ((port) < 0x10000)) {
- __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port)));
- } else {
- __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
- }
-}
-
diff --git a/sys/boot/i386/loader/newvers.sh b/sys/boot/i386/loader/newvers.sh
index 476913be37a0..34b0e7e674d9 100755
--- a/sys/boot/i386/loader/newvers.sh
+++ b/sys/boot/i386/loader/newvers.sh
@@ -35,7 +35,6 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-LC_TIME=C; export LC_TIME
u=${USER-root} h=`hostname` t=`date`
#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1`
diff --git a/sys/boot/i386/loader/setdef0.c b/sys/boot/i386/loader/setdef0.c
new file mode 100644
index 000000000000..e2af74e84393
--- /dev/null
+++ b/sys/boot/i386/loader/setdef0.c
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * 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.
+ *
+ * $Id: setdef0.c,v 1.2 1997/05/21 23:21:30 jdp Exp $
+ */
+
+#ifdef __ELF__
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+
+/*
+ * DEFINE_SET creates the section and label for a set, and emits the
+ * count word at the front of it.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".globl " #set); \
+ __asm__(".type " #set ",@object"); \
+ __asm__(".p2align 2"); \
+ __asm__(#set ":"); \
+ __asm__(".long " #count); \
+ __asm__(".previous")
+
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
+
+#endif /* __ELF__ */
diff --git a/sys/boot/i386/loader/setdef1.c b/sys/boot/i386/loader/setdef1.c
new file mode 100644
index 000000000000..3f2011920526
--- /dev/null
+++ b/sys/boot/i386/loader/setdef1.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * 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.
+ *
+ * $Id: setdef1.c,v 1.2 1997/05/21 23:21:30 jdp Exp $
+ */
+
+#ifdef __ELF__
+
+/*
+ * DEFINE_SET emits the NULL terminator for a set.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".long 0"); \
+ __asm__(".previous")
+
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
+
+#endif /* __ELF__ */
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index aaf267056b9f..f2732b49a384 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_ccb.h,v 1.2 1998/10/15 23:17:35 gibbs Exp $
+ * $Id: cam_ccb.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_CCB_H
@@ -412,8 +412,7 @@ typedef enum {
typedef enum {
PIM_SCANHILO = 0x80, /* Bus scans from high ID to low ID */
PIM_NOREMOVE = 0x40, /* Removeable devices not included in scan */
- PIM_NOINITIATOR = 0x20, /* Initiator role not supported. */
- PIM_NOBUSRESET = 0x10, /* User has disabled initial BUS RESET */
+ PIM_NOINQUIRY = 0x20, /* Inquiry data not kept by XPT */
} pi_miscflag;
/* Path Inquiry CCB */
diff --git a/sys/cam/cam_debug.h b/sys/cam/cam_debug.h
index ab07980fc57f..198650ec7c0b 100644
--- a/sys/cam/cam_debug.h
+++ b/sys/cam/cam_debug.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_debug.h,v 1.2 1998/10/02 21:00:50 ken Exp $
+ * $Id: cam_debug.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_DEBUG_H
#define _CAM_CAM_DEBUG_H 1
@@ -42,8 +42,7 @@ typedef enum {
CAM_DEBUG_INFO = 0x01, /* scsi commands, errors, data */
CAM_DEBUG_TRACE = 0x02, /* routine flow tracking */
CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */
- CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */
- CAM_DEBUG_XPT = 0x10 /* print out xpt scheduling */
+ CAM_DEBUG_CDB = 0x08 /* print out SCSI CDBs only */
} cam_debug_flags;
#if defined(CAMDEBUG) && defined(KERNEL)
@@ -54,10 +53,6 @@ extern struct cam_path *cam_dpath;
extern u_int32_t cam_dflags;
/* Debugging macros. */
-#define CAM_DEBUGGED(path, flag) \
- ((cam_dflags & (flag)) \
- && (cam_dpath != NULL) \
- && (xpt_path_comp(path, cam_dpath) >= 0))
#define CAM_DEBUG(path, flag, printfargs) \
if ((cam_dflags & (flag)) \
&& (cam_dpath != NULL) \
@@ -75,7 +70,6 @@ extern u_int32_t cam_dflags;
#else /* !CAMDEBUG || !KERNEL */
-#define CAM_DEBUGGED(A, B) 0
#define CAM_DEBUG(A, B, C)
#define CAM_DEBUG_PRINT(A, B)
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 57ac5338e28b..6d6fe291cf1f 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -26,14 +26,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_periph.c,v 1.8 1998/12/16 21:00:06 ken Exp $
+ * $Id: cam_periph.c,v 1.4 1998/10/13 21:41:32 ken Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/malloc.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/devicestat.h>
@@ -62,11 +62,10 @@ static void camperiphdone(struct cam_periph *periph,
static void camperiphfree(struct cam_periph *periph);
cam_status
-cam_periph_alloc(periph_ctor_t *periph_ctor,
- periph_oninv_t *periph_oninvalidate,
- periph_dtor_t *periph_dtor, periph_start_t *periph_start,
- char *name, cam_periph_type type, struct cam_path *path,
- ac_callback_t *ac_callback, ac_code code, void *arg)
+cam_periph_alloc(periph_ctor_t *periph_ctor, periph_dtor_t *periph_dtor,
+ periph_start_t *periph_start, char *name, cam_periph_type type,
+ struct cam_path *path, ac_callback_t *ac_callback,
+ ac_code code, void *arg)
{
struct periph_driver **p_drv;
struct cam_periph *periph;
@@ -123,7 +122,6 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
cam_init_pinfo(&periph->pinfo);
periph->periph_start = periph_start;
periph->periph_dtor = periph_dtor;
- periph->periph_oninval = periph_oninvalidate;
periph->type = type;
periph->periph_name = name;
periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id);
@@ -374,19 +372,10 @@ cam_periph_invalidate(struct cam_periph *periph)
{
int s;
- s = splsoftcam();
- /*
- * We only call this routine the first time a peripheral is
- * invalidated. The oninvalidate() routine is always called at
- * splsoftcam().
- */
- if (((periph->flags & CAM_PERIPH_INVALID) == 0)
- && (periph->periph_oninval != NULL))
- periph->periph_oninval(periph);
-
periph->flags |= CAM_PERIPH_INVALID;
periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND;
+ s = splsoftcam();
if (periph->refcount == 0)
camperiphfree(periph);
else if (periph->refcount < 0)
@@ -490,14 +479,24 @@ cam_periph_unlock(struct cam_periph *periph)
int
cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
{
- int numbufs, i;
- int flags[CAM_PERIPH_MAXMAPS];
+ int flags, numbufs, i;
u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
u_int32_t lengths[CAM_PERIPH_MAXMAPS];
u_int32_t dirs[CAM_PERIPH_MAXMAPS];
switch(ccb->ccb_h.func_code) {
case XPT_DEV_MATCH:
+ if (ccb->cdm.pattern_buf_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->cdm.pattern_buf_len, MAXPHYS);
+ return(E2BIG);
+ } else if (ccb->cdm.match_buf_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->cdm.match_buf_len, MAXPHYS);
+ return(E2BIG);
+ }
if (ccb->cdm.match_buf_len == 0) {
printf("cam_periph_mapmem: invalid match buffer "
"length 0\n");
@@ -519,11 +518,18 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
}
break;
case XPT_SCSI_IO:
+ if (ccb->csio.dxfer_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->csio.dxfer_len, MAXPHYS);
+ return(E2BIG);
+ }
+
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
return(0);
data_ptrs[0] = &ccb->csio.data_ptr;
- lengths[0] = ccb->csio.dxfer_len;
+ lengths[0] = ccb->csio.dxfer_len;;
dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
numbufs = 1;
break;
@@ -532,40 +538,32 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
break; /* NOTREACHED */
}
+ /* this keeps the current process from getting swapped */
/*
- * Check the transfer length and permissions first, so we don't
- * have to unmap any previously mapped buffers.
+ * XXX KDM should I use P_NOSWAP instead?
*/
- for (i = 0; i < numbufs; i++) {
-
- flags[i] = 0;
+ curproc->p_flag |= P_PHYSIO;
- /*
- * The userland data pointer passed in may not be page
- * aligned. vmapbuf() truncates the address to a page
- * boundary, so if the address isn't page aligned, we'll
- * need enough space for the given transfer length, plus
- * whatever extra space is necessary to make it to the page
- * boundary.
- */
- if ((lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK)) > DFLTPHYS){
- printf("cam_periph_mapmem: attempt to map %u bytes, "
- "which is greater than DFLTPHYS(%d)\n",
- lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK),
- DFLTPHYS);
- return(E2BIG);
- }
+ for (i = 0; i < numbufs; i++) {
+ flags = 0;
if (dirs[i] & CAM_DIR_IN) {
- flags[i] = B_READ;
+ flags = B_READ;
if (useracc(*data_ptrs[i], lengths[i], B_READ) == 0){
printf("cam_periph_mapmem: error, "
"address %p, length %lu isn't "
"user accessible for READ\n",
(void *)*data_ptrs[i],
(u_long)lengths[i]);
+ /*
+ * If we've already mapped one or more
+ * buffers for this CCB, unmap it (them).
+ */
+ if (i > 0)
+ cam_periph_unmapmem(ccb, mapinfo);
+ else
+ curproc->p_flag &= ~P_PHYSIO;
+
return(EACCES);
}
}
@@ -575,27 +573,26 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
* is all 0's, and so it is "set" all the time.
*/
if (dirs[i] & CAM_DIR_OUT) {
- flags[i] |= B_WRITE;
+ flags |= B_WRITE;
if (useracc(*data_ptrs[i], lengths[i], B_WRITE) == 0){
printf("cam_periph_mapmem: error, "
"address %p, length %lu isn't "
"user accessible for WRITE\n",
(void *)*data_ptrs[i],
(u_long)lengths[i]);
+ /*
+ * If we've already mapped one or more
+ * buffers for this CCB, unmap it (them).
+ */
+ if (i > 0)
+ cam_periph_unmapmem(ccb, mapinfo);
+ else
+ curproc->p_flag &= ~P_PHYSIO;
return(EACCES);
}
}
- }
-
- /* this keeps the current process from getting swapped */
- /*
- * XXX KDM should I use P_NOSWAP instead?
- */
- curproc->p_flag |= P_PHYSIO;
-
- for (i = 0; i < numbufs; i++) {
/*
* Get the buffer.
*/
@@ -607,11 +604,11 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
/* put our pointer in the data slot */
mapinfo->bp[i]->b_data = *data_ptrs[i];
- /* set the transfer length, we know it's < DFLTPHYS */
+ /* set the transfer length, we know it's < 64K */
mapinfo->bp[i]->b_bufsize = lengths[i];
/* set the flags */
- mapinfo->bp[i]->b_flags = flags[i] | B_PHYS | B_BUSY;
+ mapinfo->bp[i]->b_flags = flags | B_PHYS | B_BUSY;
/* map the buffer into kernel memory */
vmapbuf(mapinfo->bp[i]);
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index 9bad491f14a1..8e81526d53fd 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_periph.h,v 1.2 1998/10/13 21:41:32 ken Exp $
+ * $Id: cam_periph.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_PERIPH_H
@@ -66,12 +66,11 @@ typedef void periph_start_t (struct cam_periph *periph,
union ccb *start_ccb);
typedef cam_status periph_ctor_t (struct cam_periph *periph,
void *arg);
-typedef void periph_oninv_t (struct cam_periph *periph);
typedef void periph_dtor_t (struct cam_periph *periph);
+
struct cam_periph {
cam_pinfo pinfo;
periph_start_t *periph_start;
- periph_oninv_t *periph_oninval;
periph_dtor_t *periph_dtor;
char *periph_name;
struct cam_path *path; /* Compiled path to device */
@@ -101,10 +100,7 @@ struct cam_periph_map_info {
struct buf *bp[CAM_PERIPH_MAXMAPS];
};
-cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
- periph_oninv_t *periph_oninvalidate,
- periph_dtor_t *periph_dtor,
- periph_start_t *periph_start,
+cam_status cam_periph_alloc(periph_ctor_t*, periph_dtor_t*, periph_start_t*,
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_lock(struct cam_periph *periph, int priority);
diff --git a/sys/cam/cam_queue.h b/sys/cam/cam_queue.h
index 7e3d0df2ce05..8123222f577c 100644
--- a/sys/cam/cam_queue.h
+++ b/sys/cam/cam_queue.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_queue.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
+ * $Id$
*/
#ifndef _CAM_CAM_QUEUE_H
@@ -50,9 +50,7 @@ struct camq {
u_int32_t qfrozen_cnt;
};
-TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr);
-LIST_HEAD(ccb_hdr_list, ccb_hdr);
-SLIST_HEAD(ccb_hdr_slist, ccb_hdr);
+TAILQ_HEAD(ccb_hdr_list, ccb_hdr);
struct cam_ccbq {
struct camq queue;
@@ -60,7 +58,7 @@ struct cam_ccbq {
int dev_openings;
int dev_active;
int held;
- struct ccb_hdr_tailq active_ccbs;
+ struct ccb_hdr_list active_ccbs;
};
struct cam_ed;
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index bd25e744f015..fdd0de518a46 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1,8 +1,8 @@
/*
* Implementation of the Common Access Method Transport (XPT) layer.
*
- * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
- * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
+ * Copyright (c) 1997, 1998 Justin T. Gibbs.
+ * Copyright (c) 1997, 1998 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_xpt.c,v 1.41 1999/01/20 19:08:45 mjacob Exp $
+ * $Id: cam_xpt.c,v 1.23 1998/10/15 17:46:18 ken Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -38,7 +38,6 @@
#include <sys/fcntl.h>
#include <sys/md5.h>
#include <sys/devicestat.h>
-#include <sys/interrupt.h>
#ifdef PC98
#include <pc98/pc98/pc98_machdep.h> /* geometry translation */
@@ -81,7 +80,7 @@ struct async_node {
SLIST_HEAD(async_list, async_node);
SLIST_HEAD(periph_list, cam_periph);
-static STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
+STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
/*
* This is the maximum number of high powered commands (e.g. start unit)
@@ -197,6 +196,7 @@ struct cam_et {
struct cam_eb {
TAILQ_HEAD(, cam_et) et_entries;
TAILQ_ENTRY(cam_eb) links;
+ struct async_list asyncs; /* Async callback info for this B/T/L */
path_id_t path_id;
struct cam_sim *sim;
u_int32_t flags;
@@ -236,7 +236,6 @@ struct xpt_softc {
static const char quantum[] = "QUANTUM";
static const char sony[] = "SONY";
static const char west_digital[] = "WDIGTL";
-static const char samsung[] = "SAMSUNG";
static struct xpt_quirk_entry xpt_quirk_table[] =
{
@@ -267,27 +266,6 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/*
- * Unfortunately, the Quantum Atlas III has the same
- * problem as the Atlas II drives above.
- * Reported by: "Johan Granlund" <johan@granlund.nu>
- *
- * For future reference, the drive with the problem was:
- * QUANTUM QM39100TD-SW N1B0
- *
- * It's possible that Quantum will fix the problem in later
- * firmware revisions. If that happens, the quirk entry
- * will need to be made specific to the firmware revisions
- * with the problem.
- *
- * XXX need to add a quirk for the 18G version of this
- * drive, once inquiry information is known.
- */
- /* Reports QUEUE FULL for temporary resource shortages */
- { T_DIRECT, SIP_MEDIA_FIXED, quantum, "QM39100*", "*" },
- /*quirks*/0, /*mintags*/24, /*maxtags*/32
- },
- {
- /*
* Broken tagged queuing drive
* Reported by: Bret Ford <bford@uop.cs.uop.edu>
* and: Martin Renters <martin@tdc.on.ca>
@@ -302,17 +280,7 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/* Broken tagged queuing drive */
- { T_DIRECT, SIP_MEDIA_FIXED, "CONNER", "CFP2107*", "*" },
- /*quirks*/0, /*mintags*/0, /*maxtags*/0
- },
- {
- /*
- * Broken tagged queuing drive.
- * Submitted by:
- * NAKAJI Hiroyuki <nakaji@zeisei.dpri.kyoto-u.ac.jp>
- * in PR kern/9535
- */
- { T_DIRECT, SIP_MEDIA_FIXED, samsung, "WN34324U*", "*" },
+ { T_DIRECT, SIP_MEDIA_REMOVABLE, "CONNER", "CFP2107*", "*" },
/*quirks*/0, /*mintags*/0, /*maxtags*/0
},
{
@@ -339,9 +307,20 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
* so we need to limit maxtags to what the device
* can handle instead of determining this automatically.
*/
- { T_DIRECT, SIP_MEDIA_FIXED, samsung, "WN321010S*", "*" },
+ { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN321010S*", "*" },
/*quirks*/0, /*mintags*/2, /*maxtags*/32
},
+ {
+ /*
+ * Hack until multiple-luns are supported by
+ * the target mode code.
+ */
+ {
+ T_PROCESSOR, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
+ "FreeBSD", "TM-PT", "*"
+ },
+ CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
+ },
{
/* Really only one LUN */
{
@@ -360,11 +339,12 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/*
- * Many Sony CDROM drives don't like multi-LUN probing.
+ * This drive doesn't like multiple LUN probing.
+ * Verified by: Jean-Marc Zucconi <jmz@FreeBSD.ORG>
*/
{
T_CDROM, SIP_MEDIA_REMOVABLE, sony,
- "CD-ROM CDU*", "*"
+ "CD-ROM CDU-80*", "*"
},
CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
},
@@ -391,17 +371,6 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
CAM_QUIRK_NOSERIAL|CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
},
{
- /*
- * This old revision of the TDC3600 is also SCSI-1, and
- * hangs upon serial number probing.
- */
- {
- T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 3600", "U07:"
- },
- CAM_QUIRK_NOSERIAL, /*mintags*/0, /*maxtags*/0
- },
- {
/* Default tagged queuing parameters for all devices */
{
T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
@@ -449,7 +418,7 @@ static cam_isrq_t cam_bioq;
static cam_isrq_t cam_netq;
/* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */
-static SLIST_HEAD(,ccb_hdr) ccb_freeq;
+SLIST_HEAD(,ccb_hdr) ccb_freeq;
static u_int xpt_max_ccbs; /*
* Maximum size of ccb pool. Modified as
* devices are added/removed or have their
@@ -510,7 +479,7 @@ static struct cdevsw xpt_cdevsw =
static struct intr_config_hook *xpt_config_hook;
/* Registered busses */
-static TAILQ_HEAD(,cam_eb) xpt_busses;
+TAILQ_HEAD(,cam_eb) xpt_busses;
static u_int bus_generation;
/* Storage for debugging datastructures */
@@ -541,9 +510,8 @@ u_int32_t cam_dflags;
#endif /* CAMDEBUG */
#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */
-/* Our boot-time initialization hook */
-static void xpt_init(void *);
-SYSINIT(cam, SI_SUB_CONFIGURE, SI_ORDER_SECOND, xpt_init, NULL);
+/* Forward declarations for private functions */
+void xpt_init(void);
static cam_status xpt_compile_path(struct cam_path *new_path,
struct cam_periph *perph,
@@ -590,11 +558,12 @@ static void xptscandone(struct cam_periph *periph, union ccb *done_ccb);
static xpt_busfunc_t xptconfigbuscountfunc;
static xpt_busfunc_t xptconfigfunc;
static void xpt_config(void *arg);
+static xpt_devicefunc_t xptfinishconfigfunc;
static xpt_devicefunc_t xptpassannouncefunc;
static void xpt_finishconfig(struct cam_periph *periph, union ccb *ccb);
static void xptaction(struct cam_sim *sim, union ccb *work_ccb);
-static swihand_t swi_camnet;
-static swihand_t swi_cambio;
+ void swi_camnet(void);
+ void swi_cambio(void);
static void camisr(cam_isrq_t *queue);
#if 0
static void xptstart(struct cam_periph *periph, union ccb *work_ccb);
@@ -638,16 +607,12 @@ static xpt_targetfunc_t xptdeftargetfunc;
static xpt_devicefunc_t xptdefdevicefunc;
static xpt_periphfunc_t xptdefperiphfunc;
static int xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg);
-#ifdef notusedyet
static int xpt_for_all_targets(xpt_targetfunc_t *tr_func,
void *arg);
-#endif
static int xpt_for_all_devices(xpt_devicefunc_t *tr_func,
void *arg);
-#ifdef notusedyet
static int xpt_for_all_periphs(xpt_periphfunc_t *tr_func,
void *arg);
-#endif
static xpt_devicefunc_t xptsetasyncfunc;
static xpt_busfunc_t xptsetasyncbusfunc;
static cam_status xptregister(struct cam_periph *periph,
@@ -896,7 +861,7 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
union ccb ccb;
/*
- * This is an immediate CCB, so it's okay to
+ * This is an immedaite CCB, so it's okay to
* allocate it on the stack.
*/
@@ -925,7 +890,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
}
case XPT_DEV_MATCH: {
struct cam_periph_map_info mapinfo;
- struct cam_path *old_path;
/*
* We can't deal with physical addresses for this
@@ -935,21 +899,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
error = EINVAL;
break;
}
-
- /*
- * Save this in case the caller had it set to
- * something in particular.
- */
- old_path = inccb->ccb_h.path;
-
- /*
- * We really don't need a path for the matching
- * code. The path is needed because of the
- * debugging statements in xpt_action(). They
- * assume that the CCB has a valid path.
- */
- inccb->ccb_h.path = xpt_periph->path;
-
bzero(&mapinfo, sizeof(mapinfo));
/*
@@ -958,10 +907,8 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
*/
error = cam_periph_mapmem(inccb, &mapinfo);
- if (error) {
- inccb->ccb_h.path = old_path;
+ if (error)
break;
- }
/*
* This is an immediate CCB, we can send it on directly.
@@ -973,8 +920,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
*/
cam_periph_unmapmem(inccb, &mapinfo);
- inccb->ccb_h.path = old_path;
-
error = 0;
break;
}
@@ -1170,9 +1115,8 @@ ptstartover:
}
/* Functions accessed by the peripheral drivers */
-static void
-xpt_init(dummy)
- void *dummy;
+void
+xpt_init()
{
struct cam_sim *xpt_sim;
struct cam_path *path;
@@ -1217,7 +1161,7 @@ xpt_init(dummy)
return;
}
- cam_periph_alloc(xptregister, NULL, NULL, NULL, "xpt", CAM_PERIPH_BIO,
+ cam_periph_alloc(xptregister, NULL, NULL, "xpt", CAM_PERIPH_BIO,
path, NULL, 0, NULL);
xpt_free_path(path);
@@ -1244,8 +1188,11 @@ xpt_init(dummy)
}
/* Install our software interrupt handlers */
- register_swi(SWI_CAMNET, swi_camnet);
- register_swi(SWI_CAMBIO, swi_cambio);
+ /* XXX Should call some MI function to do this */
+#ifdef __i386__
+ ihandlers[SWI_CAMNET] = swi_camnet;
+ ihandlers[SWI_CAMBIO] = swi_cambio;
+#endif
}
static cam_status
@@ -2509,7 +2456,6 @@ xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#ifdef notusedyet
/*
* Execute the given function for every target in the EDT.
*/
@@ -2524,7 +2470,6 @@ xpt_for_all_targets(xpt_targetfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#endif /* notusedyet */
/*
* Execute the given function for every device in the EDT.
@@ -2541,7 +2486,6 @@ xpt_for_all_devices(xpt_devicefunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#ifdef notusedyet
/*
* Execute the given function for every peripheral in the EDT.
*/
@@ -2556,7 +2500,6 @@ xpt_for_all_periphs(xpt_periphfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#endif /* notusedyet */
static int
xptsetasyncfunc(struct cam_ed *device, void *arg)
@@ -2567,15 +2510,6 @@ xptsetasyncfunc(struct cam_ed *device, void *arg)
cur_entry = (struct async_node *)arg;
- /*
- * Don't report unconfigured devices (Wildcard devs,
- * devices only for target mode, device instances
- * that have been invalidated but are waiting for
- * their last reference count to be released).
- */
- if ((device->flags & CAM_DEV_UNCONFIGURED) != 0)
- return (1);
-
xpt_compile_path(&path,
NULL,
device->target->bus->path_id,
@@ -2591,7 +2525,6 @@ xptsetasyncfunc(struct cam_ed *device, void *arg)
return(1);
}
-
static int
xptsetasyncbusfunc(struct cam_eb *bus, void *arg)
{
@@ -2720,8 +2653,6 @@ xpt_action(union ccb *start_ccb)
}
/* FALLTHROUGH */
#endif
- case XPT_ABORT:
- case XPT_RESET_DEV:
case XPT_ACCEPT_TARGET_IO:
case XPT_EN_LUN:
case XPT_IMMED_NOTIFY:
@@ -2905,6 +2836,10 @@ xpt_action(union ccb *start_ccb)
}
case XPT_SASYNC_CB:
{
+ /*
+ * First off, determine the list we want to
+ * be insterted into.
+ */
struct ccb_setasync *csa;
struct async_node *cur_entry;
struct async_list *async_head;
@@ -2913,7 +2848,11 @@ xpt_action(union ccb *start_ccb)
csa = &start_ccb->csa;
added = csa->event_enable;
- async_head = &csa->ccb_h.path->device->asyncs;
+ if (csa->ccb_h.path->device != NULL) {
+ async_head = &csa->ccb_h.path->device->asyncs;
+ } else {
+ async_head = &csa->ccb_h.path->bus->asyncs;
+ }
/*
* If there is already an entry for us, simply
@@ -2937,7 +2876,6 @@ xpt_action(union ccb *start_ccb)
if (csa->event_enable == 0) {
SLIST_REMOVE(async_head, cur_entry,
async_node, links);
- csa->ccb_h.path->device->refcount--;
free(cur_entry, M_DEVBUF);
} else {
cur_entry->event_enable = csa->event_enable;
@@ -2954,7 +2892,6 @@ xpt_action(union ccb *start_ccb)
cur_entry->callback = csa->callback;
cur_entry->event_enable = csa->event_enable;
SLIST_INSERT_HEAD(async_head, cur_entry, links);
- csa->ccb_h.path->device->refcount++;
}
if ((added & AC_FOUND_DEVICE) != 0) {
@@ -3102,11 +3039,8 @@ xpt_action(union ccb *start_ccb)
CAM_REQ_CMP) {
start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
cam_dflags = CAM_DEBUG_NONE;
- } else {
+ } else
start_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_print_path(cam_dpath);
- printf("debugging flags now %x\n", cam_dflags);
- }
} else {
cam_dpath = NULL;
start_ccb->ccb_h.status = CAM_REQ_CMP;
@@ -3122,6 +3056,8 @@ xpt_action(union ccb *start_ccb)
break;
default:
case XPT_SDEV_TYPE:
+ case XPT_ABORT:
+ case XPT_RESET_DEV:
case XPT_TERM_IO:
case XPT_ENG_INQ:
/* XXX Implement */
@@ -3252,7 +3188,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
int retval;
u_int32_t old_priority;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_schedule_dev\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_schedule_dev\n"));
old_priority = pinfo->priority;
@@ -3264,7 +3200,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
if (new_priority < old_priority) {
camq_change_priority(queue, pinfo->index,
new_priority);
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("changed priority to %d\n",
new_priority));
}
@@ -3274,7 +3210,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
if (new_priority < old_priority)
pinfo->priority = new_priority;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("Inserting onto queue\n"));
if (queue->generation++ == 0) {
/* Generation wrap, regen all entries */
@@ -3293,10 +3229,10 @@ xpt_run_dev_allocq(struct cam_eb *bus)
struct cam_devq *devq;
int s;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_run_dev_allocq\n"));
devq = bus->sim->devq;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
(" qfrozen_cnt == 0x%x, entries == %d, "
"openings == %d, active == %d\n",
devq->alloc_queue.qfrozen_cnt,
@@ -3319,7 +3255,7 @@ xpt_run_dev_allocq(struct cam_eb *bus)
/*position*/0);
device = qinfo->device;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("running device %p\n", device));
drvq = &device->drvq;
@@ -3344,7 +3280,7 @@ xpt_run_dev_allocq(struct cam_eb *bus)
splx(s);
xpt_setup_ccb(&work_ccb->ccb_h, drv->path,
drv->pinfo.priority);
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("calling periph start\n"));
drv->periph_start(drv, work_ccb);
} else {
@@ -3378,7 +3314,7 @@ xpt_run_dev_sendq(struct cam_eb *bus)
struct cam_devq *devq;
int s;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_run_dev_sendq\n"));
devq = bus->sim->devq;
@@ -3413,7 +3349,7 @@ xpt_run_dev_sendq(struct cam_eb *bus)
continue;
}
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("running device %p\n", device));
work_ccb = cam_ccbq_peek_ccb(&device->ccbq, 0);
@@ -3590,35 +3526,49 @@ xpt_compile_path(struct cam_path *new_path, struct cam_periph *perph,
bus = xpt_find_bus(path_id);
if (bus == NULL) {
status = CAM_PATH_INVALID;
- } else {
+ } else if (target_id != CAM_TARGET_WILDCARD) {
target = xpt_find_target(bus, target_id);
if (target == NULL) {
- /* Create one */
- struct cam_et *new_target;
-
- new_target = xpt_alloc_target(bus, target_id);
- if (new_target == NULL) {
- status = CAM_RESRC_UNAVAIL;
+ if (path_id == CAM_XPT_PATH_ID) {
+ status = CAM_TID_INVALID;
} else {
- target = new_target;
+ /* Create one */
+ struct cam_et *new_target;
+
+ new_target = xpt_alloc_target(bus, target_id);
+ if (new_target == NULL) {
+ status = CAM_RESRC_UNAVAIL;
+ } else {
+ target = new_target;
+ }
}
}
- if (target != NULL) {
+ if (target != NULL && lun_id != CAM_LUN_WILDCARD) {
device = xpt_find_device(target, lun_id);
if (device == NULL) {
- /* Create one */
- struct cam_ed *new_device;
-
- new_device = xpt_alloc_device(bus,
- target,
- lun_id);
- if (new_device == NULL) {
- status = CAM_RESRC_UNAVAIL;
+ if (path_id == CAM_XPT_PATH_ID) {
+ status = CAM_LUN_INVALID;
} else {
- device = new_device;
+ /* Create one */
+ struct cam_ed *new_device;
+
+ new_device = xpt_alloc_device(bus,
+ target,
+ lun_id);
+ if (new_device == NULL) {
+ status = CAM_RESRC_UNAVAIL;
+ } else {
+ device = new_device;
+ }
}
}
}
+ } else if (lun_id != CAM_LUN_WILDCARD) {
+ /*
+ * Specific luns are not allowed if the
+ * target is wildcarded
+ */
+ status = CAM_LUN_INVALID;
}
/*
@@ -3772,7 +3722,7 @@ xpt_release_ccb(union ccb *free_ccb)
struct cam_ed *device;
struct cam_eb *bus;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_release_ccb\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_release_ccb\n"));
path = free_ccb->ccb_h.path;
device = path->device;
bus = path->bus;
@@ -3833,6 +3783,7 @@ xpt_bus_register(struct cam_sim *sim, u_int32_t bus)
new_bus->path_id = sim->path_id;
new_bus->sim = sim;
+ SLIST_INIT(&new_bus->asyncs);
TAILQ_INIT(&new_bus->et_entries);
s = splsoftcam();
TAILQ_INSERT_TAIL(&xpt_busses, new_bus, links);
@@ -4068,20 +4019,15 @@ xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg)
/*async_update*/TRUE);
}
+
xpt_async_bcast(&device->asyncs,
async_code,
path,
async_arg);
}
}
-
- /*
- * If this wasn't a fully wildcarded async, tell all
- * clients that want all async events.
- */
- if (bus != xpt_periph->path->bus)
- xpt_async_bcast(&xpt_periph->path->device->asyncs, async_code,
- path, async_arg);
+ xpt_async_bcast(&bus->asyncs, async_code,
+ path, async_arg);
splx(s);
}
@@ -4131,7 +4077,7 @@ xpt_freeze_devq(struct cam_path *path, u_int count)
* the CCB. See ahc_action/ahc_freeze_devq for
* an example.
*/
- ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq);
+ ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_list);
if (ccbh && ccbh->status == CAM_REQ_INPROG)
ccbh->status = CAM_REQUEUE_REQ;
splx(s);
@@ -4146,7 +4092,7 @@ xpt_freeze_simq(struct cam_sim *sim, u_int count)
struct ccb_hdr *ccbh;
ccbh = TAILQ_LAST(&sim->devq->active_dev->ccbq.active_ccbs,
- ccb_hdr_tailq);
+ ccb_hdr_list);
if (ccbh && ccbh->status == CAM_REQ_INPROG)
ccbh->status = CAM_REQUEUE_REQ;
}
@@ -4593,17 +4539,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
return;
}
- if ((work_ccb->cpi.hba_misc & PIM_NOINITIATOR) != 0) {
- /*
- * Can't scan the bus on an adapter that
- * cannot perform the initiator role.
- */
- request_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_free_ccb(work_ccb);
- xpt_done(request_ccb);
- return;
- }
-
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
malloc(sizeof(xpt_scan_bus_info), M_TEMP, M_WAITOK);
@@ -4791,7 +4726,6 @@ static void
xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
cam_flags flags, union ccb *request_ccb)
{
- struct ccb_pathinq cpi;
cam_status status;
struct cam_path *new_path;
struct cam_periph *old_periph;
@@ -4799,30 +4733,6 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE,
("xpt_scan_lun\n"));
-
- xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
- cpi.ccb_h.func_code = XPT_PATH_INQ;
- xpt_action((union ccb *)&cpi);
-
- if (cpi.ccb_h.status != CAM_REQ_CMP) {
- if (request_ccb != NULL) {
- request_ccb->ccb_h.status = cpi.ccb_h.status;
- xpt_done(request_ccb);
- }
- return;
- }
-
- if ((cpi.hba_misc & PIM_NOINITIATOR) != 0) {
- /*
- * Can't scan the bus on an adapter that
- * cannot perform the initiator role.
- */
- if (request_ccb != NULL) {
- request_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(request_ccb);
- }
- return;
- }
if (request_ccb == NULL) {
request_ccb = malloc(sizeof(union ccb), M_TEMP, M_NOWAIT);
@@ -4867,7 +4777,7 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h,
periph_links.tqe);
} else {
- status = cam_periph_alloc(proberegister, NULL, probecleanup,
+ status = cam_periph_alloc(proberegister, probecleanup,
probestart, "probe",
CAM_PERIPH_BIO,
request_ccb->ccb_h.path, NULL, 0,
@@ -4948,7 +4858,7 @@ probeschedule(struct cam_periph *periph)
* lun 0. This will insure that any bogus transfer settings are
* invalidated.
*/
- if (((ccb->ccb_h.path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
+ if (((ccb->ccb_h.path->device->flags & CAM_DEV_UNCONFIGURED)==0)
&& (ccb->ccb_h.target_lun == 0))
softc->action = PROBE_TUR;
else
@@ -5605,37 +5515,19 @@ xptconfigfunc(struct cam_eb *bus, void *arg)
"status %#x for bus %d\n", status, bus->path_id);
printf("xptconfigfunc: halting bus configuration\n");
xpt_free_ccb(work_ccb);
- busses_to_config--;
- xpt_finishconfig(xpt_periph, NULL);
return(0);
}
xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
- work_ccb->ccb_h.func_code = XPT_PATH_INQ;
+ work_ccb->ccb_h.func_code = XPT_RESET_BUS;
+ work_ccb->ccb_h.cbfcnp = NULL;
+ CAM_DEBUG(path, CAM_DEBUG_SUBTRACE,
+ ("Resetting Bus\n"));
xpt_action(work_ccb);
- if (work_ccb->ccb_h.status != CAM_REQ_CMP) {
- printf("xptconfigfunc: CPI failed on bus %d "
- "with status %d\n", bus->path_id,
- work_ccb->ccb_h.status);
- xpt_finishconfig(xpt_periph, work_ccb);
- return(1);
- }
-
- if ((work_ccb->cpi.hba_misc & PIM_NOBUSRESET) == 0) {
- xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
- work_ccb->ccb_h.func_code = XPT_RESET_BUS;
- work_ccb->ccb_h.cbfcnp = NULL;
- CAM_DEBUG(path, CAM_DEBUG_SUBTRACE,
- ("Resetting Bus\n"));
- xpt_action(work_ccb);
- xpt_finishconfig(xpt_periph, work_ccb);
- } else {
- /* Act as though we performed a successful BUS RESET */
- work_ccb->ccb_h.func_code = XPT_RESET_BUS;
- xpt_finishconfig(xpt_periph, work_ccb);
- }
+ xpt_finishconfig(xpt_periph, work_ccb);
}
return(1);
+
}
static void
@@ -5682,6 +5574,32 @@ xpt_config(void *arg)
}
}
+static int
+xptfinishconfigfunc(struct cam_ed *device, void *arg)
+{
+ union ccb work_ccb;
+ struct cam_path path;
+ cam_status status;
+
+ if ((status = xpt_compile_path(&path, xpt_periph,
+ device->target->bus->path_id,
+ device->target->target_id,
+ device->lun_id)) != CAM_REQ_CMP) {
+ printf("xptfinishconfig: xpt_compile_path failed with status"
+ " %#x, halting device registration\n", status);
+ return(0);
+ }
+
+ xpt_setup_ccb(&work_ccb.ccb_h, &path, /*priority*/1);
+
+ work_ccb.ccb_h.func_code = XPT_GDEV_TYPE;
+ xpt_action(&work_ccb);
+ xpt_async(AC_FOUND_DEVICE, &path, &work_ccb);
+
+ xpt_release_path(&path);
+ return(1);
+}
+
/*
* If the given device only has one peripheral attached to it, and if that
* peripheral is the passthrough driver, announce it. This insures that the
@@ -5723,10 +5641,11 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb)
}
/* FALLTHROUGH */
case XPT_SCAN_BUS:
- default:
xpt_free_path(done_ccb->ccb_h.path);
busses_to_config--;
break;
+ default:
+ break;
}
}
@@ -5739,6 +5658,12 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb)
}
/*
+ * Itterate through our devices announcing
+ * them in probed bus order.
+ */
+ xpt_for_all_devices(xptfinishconfigfunc, NULL);
+
+ /*
* Check for devices with no "standard" peripheral driver
* attached. For any devices like that, announce the
* passthrough driver so the user will see something.
@@ -5791,16 +5716,18 @@ xptaction(struct cam_sim *sim, union ccb *work_ccb)
/*
* Should only be called by the machine interrupt dispatch routines,
* so put these prototypes here instead of in the header.
+ *
+ * XXX we should really have a way to dynamically register SWI handlers.
*/
-static void
-swi_camnet(void)
+void
+swi_camnet()
{
camisr(&cam_netq);
}
-static void
-swi_cambio(void)
+void
+swi_cambio()
{
camisr(&cam_bioq);
}
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index 1203699e78d5..c87b1eb781a9 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_all.c,v 1.8 1998/12/06 00:05:47 mjacob Exp $
+ * $Id: scsi_all.c,v 1.5 1998/10/02 21:00:54 ken Exp $
*/
#include <sys/param.h>
@@ -1563,6 +1563,7 @@ char *
scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
{
u_int8_t cdb_len;
+ char holdstr[8];
int i;
if (cdb_ptr == NULL)
@@ -1607,9 +1608,17 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
break;
}
*cdb_string = '\0';
- for (i = 0; i < cdb_len; i++)
- snprintf(cdb_string + strlen(cdb_string),
- len - strlen(cdb_string), "%x ", cdb_ptr[i]);
+ for (i = 0; i < cdb_len; i++) {
+ sprintf(holdstr, "%x ", cdb_ptr[i]);
+ /*
+ * If we're about to exceed the length of the string,
+ * just return what we've already printed.
+ */
+ if (strlen(holdstr) + strlen(cdb_string) > len)
+ break;
+
+ strcat(cdb_string, holdstr);
+ }
return(cdb_string);
}
@@ -2201,8 +2210,8 @@ scsi_interpret_sense(struct cam_device *device, union ccb *ccb,
if (((sense_flags & SF_QUIET_IR) != 0)
&& ((sense_flags & SF_PRINT_ALWAYS) == 0))
print_sense = FALSE;
- error = EINVAL;
- break;
+
+ /* FALLTHROUGH */
case SSD_KEY_NOT_READY:
case SSD_KEY_DATA_PROTECT:
case SSD_KEY_VOLUME_OVERFLOW:
@@ -2295,7 +2304,7 @@ scsi_print_inquiry(struct scsi_inquiry_data *inq_data)
{
u_int8_t type;
char *dtype, *qtype;
- char vendor[16], product[48], revision[16], rstr[4];
+ char vendor[16], product[48], revision[16];
type = SID_TYPE(inq_data);
@@ -2375,14 +2384,10 @@ scsi_print_inquiry(struct scsi_inquiry_data *inq_data)
cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision),
sizeof(revision));
- if (SID_ANSI_REV(inq_data) == SCSI_REV_CCS)
- bcopy("CCS", rstr, 4);
- else
- snprintf(rstr, sizeof (rstr), "%d", SID_ANSI_REV(inq_data));
- printf("<%s %s %s> %s %s SCSI-%s device %s\n",
+ printf("<%s %s %s> %s %s SCSI%d device %s\n",
vendor, product, revision,
SID_IS_REMOVABLE(inq_data) ? "Removable" : "Fixed",
- dtype, rstr, qtype);
+ dtype, SID_ANSI_REV(inq_data), qtype);
}
/*
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index ccbab9d7863c..53696071f4e7 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: scsi_all.h,v 1.5 1998/10/15 19:08:58 ken Exp $
+ * $Id: scsi_all.h,v 1.4 1998/10/02 05:25:49 ken Exp $
*/
/*
@@ -486,11 +486,6 @@ struct scsi_inquiry_data
#define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0)
u_int8_t version;
#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07)
-#define SCSI_REV_0 0
-#define SCSI_REV_CCS 1
-#define SCSI_REV_2 2
-#define SCSI_REV_3 3
-
#define SID_ECMA 0x38
#define SID_ISO 0xC0
u_int8_t response_format;
@@ -610,8 +605,6 @@ struct scsi_mode_blk_desc
u_int8_t blklen[3];
};
-#define SCSI_DEFAULT_DENSITY 0x00 /* use 'default' density */
-#define SCSI_SAME_DENSITY 0x7f /* use 'same' density- >= SCSI-2 only */
/*
* Status Byte
*/
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 0ebc68547191..d1f0a4c52896 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_cd.c,v 1.13 1999/01/11 17:45:22 eivind Exp $
+ * $Id: scsi_cd.c,v 1.6 1998/10/12 17:02:37 ken Exp $
*/
/*
* Portions of this driver taken from the original FreeBSD cd driver.
@@ -187,7 +187,6 @@ static periph_init_t cdinit;
static periph_ctor_t cdregister;
static periph_dtor_t cdcleanup;
static periph_start_t cdstart;
-static periph_oninv_t cdoninvalidate;
static void cdasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static void cdshorttimeout(void *arg);
@@ -199,7 +198,7 @@ static int cdrunccb(union ccb *ccb,
u_int32_t cam_flags,
u_int32_t sense_flags),
u_int32_t cam_flags, u_int32_t sense_flags);
-static union ccb *cdgetccb(struct cam_periph *periph,
+union ccb *cdgetccb(struct cam_periph *periph,
u_int32_t priority);
static void cddone(struct cam_periph *periph,
union ccb *start_ccb);
@@ -306,7 +305,7 @@ struct cdchanger {
STAILQ_HEAD(chdevlist, cd_softc) chluns;
};
-static STAILQ_HEAD(changerlist, cdchanger) changerq;
+STAILQ_HEAD(changerlist, cdchanger) changerq;
void
cdinit(void)
@@ -353,74 +352,14 @@ cdinit(void)
}
static void
-cdoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct cd_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct cd_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = cdasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= CD_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- /*
- * If this device is part of a changer, and it was scheduled
- * to run, remove it from the run queue since we just nuked
- * all of its scheduled I/O.
- */
- if ((softc->flags & CD_FLAG_CHANGER)
- && (softc->pinfo.index != CAM_UNQUEUED_INDEX))
- camq_remove(&softc->changer->devq, softc->pinfo.index);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
cdcleanup(struct cam_periph *periph)
{
struct cd_softc *softc;
- int s;
softc = (struct cd_softc *)periph->softc;
xpt_print_path(periph->path);
printf("removing device entry\n");
-
- s = splsoftcam();
/*
* In the queued, non-active case, the device in question
* has already been removed from the changer run queue. Since this
@@ -490,10 +429,8 @@ cdcleanup(struct cam_periph *periph)
free(softc->changer, M_DEVBUF);
num_changers--;
}
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(cdperiphs, periph->unit_number);
- free(softc, M_DEVBUF);
- splx(s);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -519,11 +456,9 @@ cdasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(cdregister, cdoninvalidate,
- cdcleanup, cdstart,
- "cd", CAM_PERIPH_BIO,
- cgd->ccb_h.path, cdasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(cdregister, cdcleanup, cdstart,
+ "cd", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ cdasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -533,8 +468,65 @@ cdasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct cd_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct cd_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = cdasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= CD_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+
+ /*
+ * If this device is part of a changer, and it was scheduled
+ * to run, remove it from the run queue since we just nuked
+ * all of its scheduled I/O.
+ */
+ if ((softc->flags & CD_FLAG_CHANGER)
+ && (softc->pinfo.index != CAM_UNQUEUED_INDEX))
+ camq_remove(&softc->changer->devq, softc->pinfo.index);
+
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_SENT_BDR:
case AC_BUS_RESET:
{
@@ -880,7 +872,6 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
struct ccb_getdev cgd;
u_int32_t size;
int unit, error;
- int s;
unit = dkunit(dev);
periph = cam_extend_get(cdperiphs, unit);
@@ -890,21 +881,11 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct cd_softc *)periph->softc;
- /*
- * Grab splsoftcam and hold it until we lock the peripheral.
- */
- s = splsoftcam();
- if (softc->flags & CD_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & CD_FLAG_INVALID)
return(ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
-
- splx(s);
if ((softc->flags & CD_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
@@ -964,7 +945,7 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
/* Initialize slice tables. */
error = dsopen("cd", dev, fmt, DSO_NOLABELS | DSO_ONESLICE,
- &softc->cd_slices, &label, cdstrategy1,
+ &softc->cd_slices, &label, cdstrategy,
(ds_setgeom_t *)NULL, &cd_cdevsw);
if (error == 0) {
@@ -1330,7 +1311,7 @@ cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb,
return(error);
}
-static union ccb *
+union ccb *
cdgetccb(struct cam_periph *periph, u_int32_t priority)
{
struct cd_softc *softc;
@@ -1691,7 +1672,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
- snprintf(announce_buf, sizeof(announce_buf),
+ sprintf(announce_buf,
"cd present [%lu x %lu byte records]",
cdp->disksize, (u_long)cdp->blksize);
@@ -1759,8 +1740,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
if ((have_sense)
&& ((asc == 0x3a) || (asc == 0x04))
&& (error_code == SSD_CURRENT_ERROR))
- snprintf(announce_buf,
- sizeof(announce_buf),
+ sprintf(announce_buf,
"Attempt to query device "
"size failed: %s, %s",
scsi_sense_key_text[sense_key],
@@ -1794,18 +1774,17 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
}
xpt_print_path(periph->path);
printf("fatal error, failed"
- " to attach to device\n");
+ " to attach to device");
/*
- * Invalidate this peripheral.
+ * Free up resources.
*/
cam_periph_invalidate(periph);
announce_buf[0] = '\0';
} else {
-
/*
- * Invalidate this peripheral.
+ * Free up resources.
*/
cam_periph_invalidate(periph);
announce_buf[0] = '\0';
@@ -1813,23 +1792,14 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
}
}
free(rdcap, M_TEMP);
- if (announce_buf[0] != '\0') {
+ if (announce_buf[0] != '\0')
xpt_announce_periph(periph, announce_buf);
- if (softc->flags & CD_FLAG_CHANGER)
- cdchangerschedule(softc);
- }
softc->state = CD_STATE_NORMAL;
- /*
- * Since our peripheral may be invalidated by an error
- * above or an external event, we must release our CCB
- * before releasing the probe lock on the peripheral.
- * The peripheral will only go away once the last lock
- * is removed, and we need it around for the CCB release
- * operation.
- */
- xpt_release_ccb(done_ccb);
+ if (softc->flags & CD_FLAG_CHANGER)
+ cdchangerschedule(softc);
cam_periph_unlock(periph);
- return;
+
+ break;
}
case CD_CCB_WAITING:
{
@@ -1840,8 +1810,6 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
wakeup(&done_ccb->ccb_h.cbfcnp);
return;
}
- default:
- break;
}
xpt_release_ccb(done_ccb);
}
@@ -2486,7 +2454,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
* don't, dsioctl will pass back an error code of ENOIOCTL.
*/
error = dsioctl("cd", dev, cmd, addr, flag, &softc->cd_slices,
- cdstrategy1, (ds_setgeom_t *)NULL);
+ cdstrategy, (ds_setgeom_t *)NULL);
if (error != ENOIOCTL)
break;
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 17f6fb965966..1f16eb389ec2 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_ch.c,v 1.8 1998/12/12 23:52:46 gibbs Exp $
+ * $Id: scsi_ch.c,v 1.3 1998/10/02 21:20:21 ken Exp $
*/
/*
* Derived from the NetBSD SCSI changer driver.
@@ -101,13 +101,13 @@
* ELEMENT STATUS).
*/
-static const u_int32_t CH_TIMEOUT_MODE_SENSE = 6000;
-static const u_int32_t CH_TIMEOUT_MOVE_MEDIUM = 100000;
-static const u_int32_t CH_TIMEOUT_EXCHANGE_MEDIUM = 100000;
-static const u_int32_t CH_TIMEOUT_POSITION_TO_ELEMENT = 100000;
-static const u_int32_t CH_TIMEOUT_READ_ELEMENT_STATUS = 10000;
-static const u_int32_t CH_TIMEOUT_SEND_VOLTAG = 10000;
-static const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
+const u_int32_t CH_TIMEOUT_MODE_SENSE = 6000;
+const u_int32_t CH_TIMEOUT_MOVE_MEDIUM = 100000;
+const u_int32_t CH_TIMEOUT_EXCHANGE_MEDIUM = 100000;
+const u_int32_t CH_TIMEOUT_POSITION_TO_ELEMENT = 100000;
+const u_int32_t CH_TIMEOUT_READ_ELEMENT_STATUS = 10000;
+const u_int32_t CH_TIMEOUT_SEND_VOLTAG = 10000;
+const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
typedef enum {
CH_FLAG_INVALID = 0x001,
@@ -183,7 +183,6 @@ static d_close_t chclose;
static d_ioctl_t chioctl;
static periph_init_t chinit;
static periph_ctor_t chregister;
-static periph_oninv_t choninvalidate;
static periph_dtor_t chcleanup;
static periph_start_t chstart;
static void chasync(void *callback_arg, u_int32_t code,
@@ -287,43 +286,13 @@ chinit(void)
}
static void
-choninvalidate(struct cam_periph *periph)
-{
- struct ch_softc *softc;
- struct ccb_setasync csa;
-
- softc = (struct ch_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = chasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= CH_FLAG_INVALID;
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-
-}
-
-static void
chcleanup(struct cam_periph *periph)
{
- struct ch_softc *softc;
-
- softc = (struct ch_softc *)periph->softc;
- devstat_remove_entry(&softc->device_stats);
- cam_extend_release(chperiphs, periph->unit_number);
- xpt_print_path(periph->path);
- printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ cam_extend_release(chperiphs, periph->unit_number);
+ xpt_print_path(periph->path);
+ printf("removing device entry\n");
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -349,9 +318,8 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(chregister, choninvalidate,
- chcleanup, chstart, "ch",
- CAM_PERIPH_BIO, cgd->ccb_h.path,
+ status = cam_periph_alloc(chregister, chcleanup, chstart,
+ "ch", CAM_PERIPH_BIO, cgd->ccb_h.path,
chasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
@@ -363,8 +331,42 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct ch_softc *softc;
+ struct ccb_setasync csa;
+
+ softc = (struct ch_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = chasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= CH_FLAG_INVALID;
+
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -443,7 +445,6 @@ chopen(dev_t dev, int flags, int fmt, struct proc *p)
struct cam_periph *periph;
struct ch_softc *softc;
int unit, error;
- int s;
unit = CHUNIT(dev);
periph = cam_extend_get(chperiphs, unit);
@@ -453,19 +454,12 @@ chopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct ch_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & CH_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & CH_FLAG_INVALID)
return(ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
- splx(s);
-
if ((softc->flags & CH_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
return(ENXIO);
@@ -618,8 +612,7 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
softc->sc_picker = softc->sc_firsts[CHET_MT];
#define PLURAL(c) (c) == 1 ? "" : "s"
- snprintf(announce_buf, sizeof(announce_buf),
- "%d slot%s, %d drive%s, "
+ sprintf(announce_buf, "%d slot%s, %d drive%s, "
"%d picker%s, %d portal%s",
softc->sc_counts[CHET_ST],
PLURAL(softc->sc_counts[CHET_ST]),
@@ -851,7 +844,7 @@ chmove(struct cam_periph *periph, struct changer_move *cm)
* Check the request against the changer's capabilities.
*/
if ((softc->sc_movemask[cm->cm_fromtype] & (1 << cm->cm_totype)) == 0)
- return (ENODEV);
+ return (EINVAL);
/*
* Calculate the source and destination elements.
@@ -909,7 +902,7 @@ chexchange(struct cam_periph *periph, struct changer_exchange *ce)
(1 << ce->ce_fdsttype)) == 0) ||
((softc->sc_exchangemask[ce->ce_fdsttype] &
(1 << ce->ce_sdsttype)) == 0))
- return (ENODEV);
+ return (EINVAL);
/*
* Calculate the source and destination elements.
diff --git a/sys/cam/scsi/scsi_ch.h b/sys/cam/scsi/scsi_ch.h
index 0f53c93f177a..97c6c699c8f5 100644
--- a/sys/cam/scsi/scsi_ch.h
+++ b/sys/cam/scsi/scsi_ch.h
@@ -347,7 +347,7 @@ struct page_device_capabilities {
#define MOVE_TO_IE 0x04
#define MOVE_TO_DT 0x08
- u_int8_t reserved1[4];
+ u_int8_t reserved1[2];
/*
* Similar to above, but for EXCHANGE MEDIUM.
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 3463bbf21c28..30f88ddc5e94 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_da.c,v 1.18 1999/01/05 20:43:41 mjacob Exp $
+ * $Id: scsi_da.c,v 1.10 1998/10/13 08:24:29 dg Exp $
*/
#include "opt_hw_wdog.h"
@@ -75,8 +75,7 @@ typedef enum {
typedef enum {
DA_Q_NONE = 0x00,
- DA_Q_NO_SYNC_CACHE = 0x01,
- DA_Q_NO_6_BYTE = 0x02
+ DA_Q_NO_SYNC_CACHE = 0x01
} da_quirks;
typedef enum {
@@ -108,7 +107,6 @@ struct da_softc {
da_state state;
da_flags flags;
da_quirks quirks;
- int minimum_cmd_size;
int ordered_tag_count;
struct disk_params params;
struct diskslices *dk_slices; /* virtual drives */
@@ -143,37 +141,11 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
- * This drive doesn't like the synchronize cache command
- * either. Reported by: Hellmuth Michaelis (hm@kts.org)
- * (PR 8882).
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "MICROP", "2112*", "*"},
- /*quirks*/ DA_Q_NO_SYNC_CACHE
- },
- {
- /*
* Doesn't like the synchronize cache command.
* Reported by: Blaz Zupan <blaz@gold.amis.net>
*/
{T_DIRECT, SIP_MEDIA_FIXED, "NEC", "D3847*", "*"},
/*quirks*/ DA_Q_NO_SYNC_CACHE
- },
- {
- /*
- * Doesn't work correctly with 6 byte reads/writes.
- * Returns illegal request, and points to byte 9 of the
- * 6-byte CDB.
- * Reported by: Adam McDougall <bsdx@spawnet.com>
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 4*", "*"},
- /*quirks*/ DA_Q_NO_6_BYTE
- },
- {
- /*
- * See above.
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 2*", "*"},
- /*quirks*/ DA_Q_NO_6_BYTE
}
};
@@ -191,7 +163,6 @@ static void daasync(void *callback_arg, u_int32_t code,
static periph_ctor_t daregister;
static periph_dtor_t dacleanup;
static periph_start_t dastart;
-static periph_oninv_t daoninvalidate;
static void dadone(struct cam_periph *periph,
union ccb *done_ccb);
static int daerror(union ccb *ccb, u_int32_t cam_flags,
@@ -273,7 +244,6 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
int unit;
int part;
int error;
- int s;
unit = dkunit(dev);
part = dkpart(dev);
@@ -297,14 +267,12 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
softc->flags |= DA_FLAG_OPEN;
}
- s = splsoftcam();
if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) {
/*
* If any partition is open, although the disk has
* been invalidated, disallow further opens.
*/
if (dsisopen(softc->dk_slices)) {
- splx(s);
cam_periph_unlock(periph);
return (ENXIO);
}
@@ -313,7 +281,6 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
dsgone(&softc->dk_slices);
softc->flags &= ~DA_FLAG_PACK_INVALID;
}
- splx(s);
/* Do a read capacity */
{
@@ -447,8 +414,7 @@ daclose(dev_t dev, int flag, int fmt, struct proc *p)
/* Ignore any errors */
cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
- /*sense_flags*/SF_RETRY_UA,
- &softc->device_stats);
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
cam_release_devq(ccb->ccb_h.path,
@@ -608,18 +574,18 @@ daioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
static int
dadump(dev_t dev)
{
- struct cam_periph *periph;
- struct da_softc *softc;
- struct disklabel *lp;
- u_int unit;
- u_int part;
- long num; /* number of sectors to write */
- long blkoff;
- long blknum;
- long blkcnt;
- vm_offset_t addr;
+ struct cam_periph *periph;
+ struct da_softc *softc;
+ struct disklabel *lp;
+ u_int unit;
+ u_int part;
+ long num; /* number of sectors to write */
+ long blkoff;
+ long blknum;
+ long blkcnt;
+ char *addr;
static int dadoingadump = 0;
- struct ccb_scsiio csio;
+ struct ccb_scsiio csio;
/* toss any characters present prior to dump */
while (cncheckc() != -1)
@@ -657,13 +623,13 @@ dadump(dev_t dev)
blknum = dumplo + blkoff;
blkcnt = PAGE_SIZE / softc->params.secsize;
- addr = 0; /* starting address */
+ addr = (char *)0; /* starting address */
while (num > 0) {
- if (is_physical_memory(addr)) {
+ if (is_physical_memory((vm_offset_t)addr)) {
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1,
- trunc_page(addr), VM_PROT_READ, TRUE);
+ trunc_page((vm_offset_t)addr), VM_PROT_READ, TRUE);
} else {
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1,
trunc_page(0), VM_PROT_READ, TRUE);
@@ -677,7 +643,7 @@ dadump(dev_t dev)
MSG_ORDERED_Q_TAG,
/*read*/FALSE,
/*byte2*/0,
- /*minimum_cmd_size*/ softc->minimum_cmd_size,
+ /*minimum_cmd_size*/ 6,
blknum,
blkcnt,
/*data_ptr*/CADDR1,
@@ -697,7 +663,7 @@ dadump(dev_t dev)
return(EIO);
}
- if (addr % (1024 * 1024) == 0) {
+ if ((intptr_t)addr % (1024 * 1024) == 0) {
#ifdef HW_WDOG
if (wdog_tickler)
(*wdog_tickler)();
@@ -710,7 +676,7 @@ dadump(dev_t dev)
/* update block count */
num -= blkcnt;
blknum += blkcnt;
- addr += blkcnt * softc->params.secsize;
+ (long)addr += blkcnt * softc->params.secsize;
/* operator aborting dump? */
if (cncheckc() != -1)
@@ -823,67 +789,12 @@ dainit(void)
}
static void
-daoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct da_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct da_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = daasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= DA_FLAG_PACK_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- SLIST_REMOVE(&softc_list, softc, da_softc, links);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
dacleanup(struct cam_periph *periph)
{
- struct da_softc *softc;
-
- softc = (struct da_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(daperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -909,11 +820,9 @@ daasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(daregister, daoninvalidate,
- dacleanup, dastart,
- "da", CAM_PERIPH_BIO,
- cgd->ccb_h.path, daasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(daregister, dacleanup, dastart,
+ "da", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ daasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -922,8 +831,57 @@ daasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct da_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct da_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = daasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= DA_FLAG_PACK_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ SLIST_REMOVE(&softc_list, softc, da_softc, links);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_SENT_BDR:
case AC_BUS_RESET:
{
@@ -1006,11 +964,6 @@ daregister(struct cam_periph *periph, void *arg)
else
softc->quirks = DA_Q_NONE;
- if (softc->quirks & DA_Q_NO_6_BYTE)
- softc->minimum_cmd_size = 10;
- else
- softc->minimum_cmd_size = 6;
-
/*
* Block our timeout handler while we
* add this softc to the dev list.
@@ -1110,7 +1063,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
tag_code,
bp->b_flags & B_READ,
/*byte2*/0,
- softc->minimum_cmd_size,
+ /*minimum_cmd_size*/ 6,
bp->b_pblkno,
bp->b_bcount / softc->params.secsize,
bp->b_data,
@@ -1296,7 +1249,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
dasetgeom(periph, rdcap);
dp = &softc->params;
- snprintf(announce_buf, sizeof(announce_buf),
+ sprintf(announce_buf,
"%ldMB (%d %d byte sectors: %dH %dS/T %dC)",
dp->sectors / ((1024L * 1024L) / dp->secsize),
dp->sectors, dp->secsize, dp->heads,
@@ -1360,8 +1313,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
*/
if ((have_sense) && (asc == 0x3a)
&& (error_code == SSD_CURRENT_ERROR))
- snprintf(announce_buf,
- sizeof(announce_buf),
+ sprintf(announce_buf,
"Attempt to query device "
"size failed: %s, %s",
scsi_sense_key_text[sense_key],
@@ -1379,7 +1331,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
xpt_print_path(periph->path);
printf("fatal error, failed"
- " to attach to device\n");
+ " to attach to device");
/*
* Free up resources.
@@ -1393,17 +1345,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if (announce_buf[0] != '\0')
xpt_announce_periph(periph, announce_buf);
softc->state = DA_STATE_NORMAL;
- /*
- * Since our peripheral may be invalidated by an error
- * above or an external event, we must release our CCB
- * before releasing the probe lock on the peripheral.
- * The peripheral will only go away once the last lock
- * is removed, and we need it around for the CCB release
- * operation.
- */
- xpt_release_ccb(done_ccb);
cam_periph_unlock(periph);
- return;
+ break;
}
case DA_CCB_WAITING:
{
@@ -1414,8 +1357,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
case DA_CCB_DUMP:
/* No-op. We're polling */
return;
- default:
- break;
}
xpt_release_ccb(done_ccb);
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 40e63762226a..8d861c276d4f 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pass.c,v 1.4 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pass.c,v 1.2 1998/09/16 00:11:53 ken Exp $
*/
#include <sys/param.h>
@@ -42,6 +42,7 @@
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/proc.h>
+#include <sys/cdio.h>
#include <sys/errno.h>
#include <sys/devicestat.h>
@@ -103,7 +104,6 @@ static d_strategy_t passstrategy;
static periph_init_t passinit;
static periph_ctor_t passregister;
-static periph_oninv_t passoninvalidate;
static periph_dtor_t passcleanup;
static periph_start_t passstart;
static void passasync(void *callback_arg, u_int32_t code,
@@ -197,72 +197,15 @@ passinit(void)
}
static void
-passoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct pass_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct pass_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = passasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= PASS_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- if (bootverbose) {
- xpt_print_path(periph->path);
- printf("lost device\n");
- }
-
-}
-
-static void
passcleanup(struct cam_periph *periph)
{
- struct pass_softc *softc;
-
- softc = (struct pass_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
-
cam_extend_release(passperiphs, periph->unit_number);
if (bootverbose) {
xpt_print_path(periph->path);
printf("removing device entry\n");
}
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -286,10 +229,10 @@ passasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(passregister, passoninvalidate,
- passcleanup, passstart, "pass",
- CAM_PERIPH_BIO, cgd->ccb_h.path,
- passasync, AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(passregister, passcleanup, passstart,
+ "pass", CAM_PERIPH_BIO,
+ cgd->ccb_h.path, passasync,
+ AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -299,8 +242,57 @@ passasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct pass_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct pass_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = passasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= PASS_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ if (bootverbose) {
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+ }
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -379,7 +371,6 @@ passopen(dev_t dev, int flags, int fmt, struct proc *p)
struct cam_periph *periph;
struct pass_softc *softc;
int unit, error;
- int s;
error = 0; /* default to no error */
@@ -394,44 +385,27 @@ passopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct pass_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & PASS_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & PASS_FLAG_INVALID)
return(ENXIO);
- }
-
- /*
- * Don't allow access when we're running at a high securelvel.
- */
- if (securelevel > 1) {
- splx(s);
- return(EPERM);
- }
/*
* Only allow read-write access.
*/
- if (((flags & FWRITE) == 0) || ((flags & FREAD) == 0)) {
- splx(s);
+ if (((flags & FWRITE) == 0) || ((flags & FREAD) == 0))
return(EPERM);
- }
/*
* We don't allow nonblocking access.
*/
if ((flags & O_NONBLOCK) != 0) {
- xpt_print_path(periph->path);
- printf("can't do nonblocking accesss\n");
- splx(s);
- return(EINVAL);
+ printf("%s%d: can't do nonblocking accesss\n",
+ periph->periph_name,
+ periph->unit_number);
+ return(ENODEV);
}
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
-
- splx(s);
if ((softc->flags & PASS_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index b937ad420221..b225d76a8e93 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pt.c,v 1.3 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pt.c,v 1.1 1998/09/15 06:36:34 gibbs Exp $
*/
#include <sys/param.h>
@@ -90,7 +90,6 @@ static periph_init_t ptinit;
static void ptasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static periph_ctor_t ptctor;
-static periph_oninv_t ptoninvalidate;
static periph_dtor_t ptdtor;
static periph_start_t ptstart;
static void ptdone(struct cam_periph *periph,
@@ -146,7 +145,6 @@ ptopen(dev_t dev, int flags, int fmt, struct proc *p)
struct pt_softc *softc;
int unit;
int error;
- int s;
unit = minor(dev);
periph = cam_extend_get(ptperiphs, unit);
@@ -155,21 +153,11 @@ ptopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct pt_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & PT_FLAG_DEVICE_INVALID) {
- splx(s);
- return(ENXIO);
- }
-
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
("ptopen: dev=0x%x (unit %d)\n", dev, unit));
- if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0)
return (error); /* error code from tsleep */
- }
-
- splx(s);
if ((softc->flags & PT_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
@@ -396,67 +384,12 @@ ptctor(struct cam_periph *periph, void *arg)
}
static void
-ptoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct pt_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct pt_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = ptasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= PT_FLAG_DEVICE_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
-
- splx(s);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
ptdtor(struct cam_periph *periph)
{
- struct pt_softc *softc;
-
- softc = (struct pt_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
-
cam_extend_release(ptperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -481,10 +414,9 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(ptctor, ptoninvalidate, ptdtor,
- ptstart, "pt", CAM_PERIPH_BIO,
- cgd->ccb_h.path, ptasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(ptctor, ptdtor, ptstart,
+ "pt", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ ptasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -494,6 +426,51 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
}
case AC_LOST_DEVICE:
{
+ int s;
+ struct pt_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct pt_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = ptasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= PT_FLAG_DEVICE_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index f28b07ef4724..59b213f4659c 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_sa.c,v 1.15 1999/01/16 04:02:31 mjacob Exp $
+ * $Id: scsi_sa.c,v 1.2 1998/10/02 05:15:27 ken Exp $
*/
#include <sys/param.h>
@@ -76,10 +76,6 @@
#define SAUNIT(DEV) ((minor(DEV)&0xF0) >> 4) /* 4 bit unit. */
#define SASETUNIT(DEV, U) makedev(major(DEV), ((U) << 4))
-#ifndef UNUSED_PARAMETER
-#define UNUSED_PARAMETER(x) x = x
-#endif
-
typedef enum {
SA_STATE_NORMAL
} sa_state;
@@ -99,14 +95,15 @@ typedef enum {
SA_FLAG_TAPE_MOUNTED = 0x0008,
SA_FLAG_TAPE_WP = 0x0010,
SA_FLAG_TAPE_WRITTEN = 0x0020,
- SA_FLAG_EOM_PENDING = 0x0040,
- SA_FLAG_EIO_PENDING = 0x0080,
- SA_FLAG_EOF_PENDING = 0x0100,
+ SA_FLAG_2FM_AT_EOD = 0x0040,
+ SA_FLAG_EOM_PENDING = 0x0080,
+ SA_FLAG_EIO_PENDING = 0x0100,
+ SA_FLAG_EOF_PENDING = 0x0200,
SA_FLAG_ERR_PENDING = (SA_FLAG_EOM_PENDING|SA_FLAG_EIO_PENDING|
SA_FLAG_EOF_PENDING),
- SA_FLAG_INVALID = 0x0200,
- SA_FLAG_COMP_ENABLED = 0x0400,
- SA_FLAG_COMP_UNSUPP = 0x0800
+ SA_FLAG_INVALID = 0x0400,
+ SA_FLAG_COMP_ENABLED = 0x0800,
+ SA_FLAG_COMP_UNSUPP = 0x1000
} sa_flags;
typedef enum {
@@ -129,10 +126,7 @@ typedef enum {
typedef enum {
SA_QUIRK_NONE = 0x00,
- SA_QUIRK_NOCOMP = 0x01, /* can't deal with compression at all */
- SA_QUIRK_FIXED = 0x02, /* force fixed mode */
- SA_QUIRK_VARIABLE = 0x04, /* force variable mode */
- SA_QUIRK_2FM = 0x08 /* Two File Marks at EOD */
+ SA_QUIRK_NOCOMP = 0x01
} sa_quirks;
struct sa_softc {
@@ -146,83 +140,27 @@ struct sa_softc {
int blk_shift;
u_int32_t max_blk;
u_int32_t min_blk;
- u_int32_t comp_algorithm;
- u_int32_t saved_comp_algorithm;
+ u_int8_t media_density;
u_int32_t media_blksize;
- u_int32_t last_media_blksize;
u_int32_t media_numblks;
- u_int8_t media_density;
+ u_int32_t comp_algorithm;
+ u_int32_t saved_comp_algorithm;
u_int8_t speed;
- u_int8_t scsi_rev;
int buffer_mode;
int filemarks;
union ccb saved_ccb;
- /*
- * Latched Error Info
- */
- struct {
- struct scsi_sense_data _last_io_sense;
- u_int32_t _last_io_resid;
- u_int8_t _last_io_cdb[CAM_MAX_CDBLEN];
- struct scsi_sense_data _last_ctl_sense;
- u_int32_t _last_ctl_resid;
- u_int8_t _last_ctl_cdb[CAM_MAX_CDBLEN];
-#define last_io_sense errinfo._last_io_sense
-#define last_io_resid errinfo._last_io_resid
-#define last_io_cdb errinfo._last_io_cdb
-#define last_ctl_sense errinfo._last_ctl_sense
-#define last_ctl_resid errinfo._last_ctl_resid
-#define last_ctl_cdb errinfo._last_ctl_cdb
- } errinfo;
};
struct sa_quirk_entry {
- struct scsi_inquiry_pattern inq_pat; /* matching pattern */
- sa_quirks quirks; /* specific quirk type */
- u_int32_t prefblk; /* preferred blocksize when in fixed mode */
+ struct scsi_inquiry_pattern inq_pat;
+ sa_quirks quirks;
};
static struct sa_quirk_entry sa_quirk_table[] =
{
{
{ T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "Python 25601*", "*"}, SA_QUIRK_NOCOMP, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "VIPER 150*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "VIPER 2525*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "HP",
- "T4000S*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "HP",
- "HP-88780*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "KENNEDY",
- "*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "M4 DATA",
- "123107 SCSI*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 4200", "*"}, SA_QUIRK_NOCOMP, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "WANGTEK",
- "5525ES*", "*"}, SA_QUIRK_FIXED, 512
+ "Python 25601*", "*"}, /*quirks*/SA_QUIRK_NOCOMP
}
};
@@ -234,7 +172,6 @@ static d_strategy_t sastrategy;
static d_ioctl_t saioctl;
static periph_init_t sainit;
static periph_ctor_t saregister;
-static periph_oninv_t saoninvalidate;
static periph_dtor_t sacleanup;
static periph_start_t sastart;
static void saasync(void *callback_arg, u_int32_t code,
@@ -255,13 +192,12 @@ static int sagetparams(struct cam_periph *periph,
static int sasetparams(struct cam_periph *periph,
sa_params params_to_set,
u_int32_t blocksize, u_int8_t density,
- u_int32_t comp_algorithm,
- u_int32_t sense_flags);
+ u_int32_t comp_algorithm);
static void saprevent(struct cam_periph *periph, int action);
static int sarewind(struct cam_periph *periph);
static int saspace(struct cam_periph *periph, int count,
scsi_space_code code);
-static int samount(struct cam_periph *, int, dev_t);
+static int samount(struct cam_periph *periph);
static int saretension(struct cam_periph *periph);
static int sareservereleaseunit(struct cam_periph *periph,
int reserve);
@@ -269,9 +205,6 @@ static int saloadunload(struct cam_periph *periph, int load);
static int saerase(struct cam_periph *periph, int longerase);
static int sawritefilemarks(struct cam_periph *periph,
int nmarks, int setmarks);
-static int sardpos(struct cam_periph *periph, int, u_int32_t *);
-static int sasetpos(struct cam_periph *periph, int, u_int32_t *);
-
static struct periph_driver sadriver =
{
@@ -330,7 +263,6 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
int mode;
int density;
int error;
- int s;
unit = SAUNIT(dev);
mode = SAMODE(dev);
@@ -346,19 +278,13 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
("saaopen: dev=0x%x (unit %d , mode %d, density %d)\n", dev,
unit, mode, density));
- s = splsoftcam();
- if (softc->flags & SA_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & SA_FLAG_INVALID)
return(ENXIO);
- }
if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0) {
- splx(s);
return (error); /* error code from tsleep */
}
- splx(s);
-
if ((softc->flags & SA_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
return(ENXIO);
@@ -375,8 +301,9 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
error = EBUSY;
}
- if (error == 0)
- error = samount(periph, flags, dev);
+ if (error == 0) {
+ error = samount(periph);
+ }
/* Perform other checking... */
}
@@ -397,7 +324,6 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p)
int unit;
int mode;
int error;
- int closedbits = SA_FLAG_OPEN;
unit = SAUNIT(dev);
mode = SAMODE(dev);
@@ -411,71 +337,24 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p)
return (error); /* error code from tsleep */
}
- /*
- * See whether or not we need to write filemarks...
- */
- error = sacheckeod(periph);
- if (error) {
- xpt_print_path(periph->path);
- printf("failure at writing filemarks - opting for safety\n");
- mode = SA_MODE_OFFLINE;
- }
+ sacheckeod(periph);
- /*
- * Whatever we end up doing, allow users to eject tapes from here on.
- */
saprevent(periph, PR_ALLOW);
- /*
- * Decide how to end...
- */
switch (mode) {
- default:
- xpt_print_path(periph->path);
- printf("unknown close mode %x- opting for safety\n", mode);
- /* FALLTHROUGH */
- case SA_MODE_OFFLINE:
+ case SA_MODE_REWIND:
sarewind(periph);
- saloadunload(periph, FALSE);
- closedbits |= SA_FLAG_TAPE_MOUNTED; /* not mounted now */
break;
- case SA_MODE_REWIND:
+ case SA_MODE_OFFLINE:
sarewind(periph);
- closedbits |= SA_FLAG_TAPE_MOUNTED; /* not mounted now */
+ saloadunload(periph, /*load*/FALSE);
break;
case SA_MODE_NOREWIND:
- /*
- * If we're not rewinding/unloading the tape, find out
- * whether we need to back up over one of two filemarks
- * we wrote (if we wrote two filemarks) so that appends
- * from this point on will be sane.
- */
- if ((softc->quirks & SA_QUIRK_2FM) &&
- (softc->flags & SA_FLAG_TAPE_WRITTEN)) {
- error = saspace(periph, -1, SS_FILEMARKS);
- if (error) {
- xpt_print_path(periph->path);
- printf("unable to backspace over one of double"
- " filemarks at EOD- opting for safety\n");
- sarewind(periph);
- saloadunload(periph, FALSE);
- closedbits |= SA_FLAG_TAPE_MOUNTED;
- }
- }
+ default:
break;
}
- /*
- * We wish to note here that there are no more filemarks to be written.
- */
- softc->filemarks = 0;
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
-
- /*
- * And we are no longer open for business.
- */
-
- softc->flags &= ~closedbits;
+ softc->flags &= ~SA_FLAG_OPEN;
/* release the device */
sareservereleaseunit(periph, FALSE);
@@ -519,16 +398,6 @@ sastrategy(struct buf *bp)
}
softc = (struct sa_softc *)periph->softc;
- s = splsoftcam();
-
- if (softc->flags & SA_FLAG_INVALID) {
- splx(s);
- bp->b_error = ENXIO;
- goto bad;
- }
-
- splx(s);
-
/*
* If it's a null transfer, return immediatly
*/
@@ -541,10 +410,10 @@ sastrategy(struct buf *bp)
* Fixed block device. The byte count must
* be a multiple of our block size.
*/
- if (((softc->blk_mask != ~0) &&
- ((bp->b_bcount & softc->blk_mask) != 0)) ||
- ((softc->blk_mask == ~0) &&
- ((bp->b_bcount % softc->min_blk) != 0))) {
+ if (((softc->blk_mask != ~0)
+ && ((bp->b_bcount & softc->blk_mask) != 0))
+ || ((softc->blk_mask == ~0)
+ && ((bp->b_bcount % softc->min_blk) != 0))) {
xpt_print_path(periph->path);
printf("Invalid request. Fixed block device "
"requests must be a multiple "
@@ -552,31 +421,32 @@ sastrategy(struct buf *bp)
bp->b_error = EINVAL;
goto bad;
}
- } else if ((bp->b_bcount > softc->max_blk) ||
- (bp->b_bcount < softc->min_blk) ||
- (bp->b_bcount & softc->blk_mask) != 0) {
+ } else if ((bp->b_bcount > softc->max_blk)
+ || (bp->b_bcount < softc->min_blk)
+ || (bp->b_bcount & softc->blk_mask) != 0) {
xpt_print_path(periph->path);
printf("Invalid request. Variable block device "
- "requests must be ");
+ "requests must be ");
if (softc->blk_mask != 0) {
- printf("a multiple of %d ", (0x1 << softc->blk_gran));
+ printf("a multiple of %d ",
+ (0x1 << softc->blk_gran));
}
- printf("between %d and %d bytes\n", softc->min_blk,
- softc->max_blk);
+ printf("between %d and %d bytes\n",
+ softc->min_blk, softc->max_blk);
bp->b_error = EINVAL;
goto bad;
}
/*
- * Mask interrupts so that the device cannot be invalidated until
+ * Mask interrupts so that the pack cannot be invalidated until
* after we are in the queue. Otherwise, we might not properly
* clean up one of the buffers.
*/
s = splbio();
/*
- * Place it at the end of the queue.
+ * Place it in the queue of disk activities for this disk
*/
bufq_insert_tail(&softc->buf_queue, bp);
@@ -585,7 +455,7 @@ sastrategy(struct buf *bp)
/*
* Schedule ourselves for performing the work.
*/
- xpt_schedule(periph, 1);
+ xpt_schedule(periph, /* XXX priority */1);
return;
bad:
@@ -628,10 +498,10 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
struct mtget *g = (struct mtget *)arg;
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
- ("saioctl: MTIOGET\n"));
+ ("saioctl: MTIOGET\n"));
bzero(g, sizeof(struct mtget));
- g->mt_type = MT_ISAR;
+ g->mt_type = 0x7; /* Ultrix compat *//*? */
g->mt_density = softc->media_density;
g->mt_blksiz = softc->media_blksize;
if (softc->flags & SA_FLAG_COMP_UNSUPP) {
@@ -664,29 +534,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
error = 0;
break;
}
- case MTIOCERRSTAT:
- {
- struct scsi_tape_errors *sep =
- &((union mterrstat *)arg)->scsi_errstat;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
- ("saioctl: MTIOCERRSTAT\n"));
-
- bzero(sep, sizeof(*sep));
- sep->io_resid = softc->last_io_resid;
- bcopy((caddr_t) &softc->last_io_sense, sep->io_sense,
- sizeof (sep->io_sense));
- bcopy((caddr_t) &softc->last_io_cdb, sep->io_cdb,
- sizeof (sep->io_cdb));
- sep->ctl_resid = softc->last_ctl_resid;
- bcopy((caddr_t) &softc->last_ctl_sense, sep->ctl_sense,
- sizeof (sep->ctl_sense));
- bcopy((caddr_t) &softc->last_ctl_cdb, sep->ctl_cdb,
- sizeof (sep->ctl_cdb));
- bzero((caddr_t) &softc->errinfo, sizeof (softc->errinfo));
- error = 0;
- break;
- }
case MTIOCTOP:
{
struct mtop *mt;
@@ -700,91 +547,46 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
count = mt->mt_count;
switch (mt->mt_op) {
- case MTWEOF: /* write an end-of-file marker */
- error = sawritefilemarks(periph, count, FALSE);
- break;
- case MTWSS: /* write a setmark */
- error = sawritefilemarks(periph, count, TRUE);
+ case MTWEOF: /* write an end-of-file record */
+ error = sawritefilemarks(periph, count,
+ /*setmarks*/FALSE);
break;
case MTBSR: /* backward space record */
case MTFSR: /* forward space record */
case MTBSF: /* backward space file */
case MTFSF: /* forward space file */
- case MTBSS: /* backward space setmark */
- case MTFSS: /* forward space setmark */
case MTEOD: /* space to end of recorded medium */
{
int nmarks;
- scsi_space_code spaceop = SS_FILEMARKS;
+ scsi_space_code spaceop;
nmarks = softc->filemarks;
error = sacheckeod(periph);
- if (error) {
- xpt_print_path(periph->path);
- printf("EOD check prior to spacing failed\n");
- softc->flags |= SA_FLAG_EIO_PENDING;
- break;
- }
nmarks -= softc->filemarks;
- switch(mt->mt_op) {
- case MTBSR:
+
+ if ((mt->mt_op == MTBSR) || (mt->mt_op == MTBSF))
count = -count;
- /* FALLTHROUGH */
- case MTFSR:
+
+ if ((mt->mt_op == MTBSF) || (mt->mt_op == MTFSF))
+ spaceop = SS_FILEMARKS;
+ else if ((mt->mt_op == MTBSR) || (mt->mt_op == MTFSR))
spaceop = SS_BLOCKS;
- break;
- case MTBSF:
- count = -count;
- /* FALLTHROUGH */
- case MTFSF:
- break;
- case MTBSS:
- count = -count;
- /* FALLTHROUGH */
- case MTFSS:
- spaceop = SS_SETMARKS;
- break;
- case MTEOD:
+ else {
spaceop = SS_EOD;
count = 0;
nmarks = 0;
- break;
- default:
- error = EINVAL;
- break;
}
- if (error)
- break;
nmarks = softc->filemarks;
- /*
- * XXX: Why are we checking again?
- */
error = sacheckeod(periph);
- if (error)
- break;
nmarks -= softc->filemarks;
- error = saspace(periph, count - nmarks, spaceop);
- /*
- * At this point, clear that we've written the tape
- * and that we've written any filemarks. We really
- * don't know what the applications wishes to do next-
- * the sacheckeod's will make sure we terminated the
- * tape correctly if we'd been writing, but the next
- * action the user application takes will set again
- * whether we need to write filemarks.
- */
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
- softc->filemarks = 0;
+ if (error == 0)
+ error = saspace(periph, count - nmarks,
+ spaceop);
break;
}
case MTREW: /* rewind */
- (void) sacheckeod(periph);
error = sarewind(periph);
- /* see above */
- softc->flags &=
- ~SA_FLAG_TAPE_WRITTEN|SA_FLAG_TAPE_MOUNTED;
- softc->filemarks = 0;
break;
case MTERASE: /* erase */
error = saerase(periph, count);
@@ -793,12 +595,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
error = saretension(periph);
break;
case MTOFFL: /* rewind and put the drive offline */
-
- (void) sacheckeod(periph);
- /* see above */
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
- softc->filemarks = 0;
-
/*
* Be sure to allow media removal before
* attempting the eject.
@@ -811,6 +607,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
else
break;
+ /* XXX KDM */
softc->flags &= ~SA_FLAG_TAPE_LOCKED;
softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
break;
@@ -822,45 +619,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
case MTSETBSIZ: /* Set block size for device */
error = sasetparams(periph, SA_PARAM_BLOCKSIZE, count,
- 0, 0, 0);
- if (error == 0) {
- softc->last_media_blksize =
- softc->media_blksize;
- softc->media_blksize = count;
- if (count) {
- softc->flags |= SA_FLAG_FIXED;
- if (powerof2(count)) {
- softc->blk_shift =
- ffs(count) - 1;
- softc->blk_mask = count - 1;
- } else {
- softc->blk_mask = ~0;
- softc->blk_shift = 0;
- }
- /*
- * Make the user's desire 'persistent'.
- */
- softc->quirks &= ~SA_QUIRK_VARIABLE;
- softc->quirks |= SA_QUIRK_FIXED;
- } else {
- softc->flags &= ~SA_FLAG_FIXED;
- if (softc->max_blk == 0) {
- softc->max_blk = ~0;
- }
- softc->blk_shift = 0;
- if (softc->blk_gran != 0) {
- softc->blk_mask =
- softc->blk_gran - 1;
- } else {
- softc->blk_mask = 0;
- }
- /*
- * Make the user's desire 'persistent'.
- */
- softc->quirks |= SA_QUIRK_VARIABLE;
- softc->quirks &= ~SA_QUIRK_FIXED;
- }
- }
+ 0, 0);
break;
case MTSETDNSTY: /* Set density for device and mode */
if (count > UCHAR_MAX) {
@@ -868,7 +627,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
break;
} else {
error = sasetparams(periph, SA_PARAM_DENSITY,
- 0, count, 0, 0);
+ 0, count, 0);
}
break;
case MTCOMP: /* enable compression */
@@ -883,7 +642,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
break;
}
error = sasetparams(periph, SA_PARAM_COMPRESSION,
- 0, 0, count, 0);
+ 0, 0, count);
break;
default:
error = EINVAL;
@@ -894,18 +653,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
case MTIOCEEOT:
error = 0;
break;
- case MTIOCRDSPOS:
- error = sardpos(periph, 0, (u_int32_t *) arg);
- break;
- case MTIOCRDHPOS:
- error = sardpos(periph, 1, (u_int32_t *) arg);
- break;
- case MTIOCSLOCATE:
- error = sasetpos(periph, 0, (u_int32_t *) arg);
- break;
- case MTIOCHLOCATE:
- error = sasetpos(periph, 1, (u_int32_t *) arg);
- break;
default:
error = cam_periph_ioctl(periph, cmd, arg, saerror);
break;
@@ -960,66 +707,12 @@ sainit(void)
}
static void
-saoninvalidate(struct cam_periph *periph)
-{
- struct sa_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
- int s;
-
- softc = (struct sa_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = saasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= SA_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-
-}
-
-static void
sacleanup(struct cam_periph *periph)
{
- struct sa_softc *softc;
-
- softc = (struct sa_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(saperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -1045,8 +738,7 @@ saasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(saregister, saoninvalidate,
- sacleanup, sastart,
+ status = cam_periph_alloc(saregister, sacleanup, sastart,
"sa", CAM_PERIPH_BIO, cgd->ccb_h.path,
saasync, AC_FOUND_DEVICE, cgd);
@@ -1057,8 +749,54 @@ saasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct sa_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct sa_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = saasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= SA_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
- break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -1097,7 +835,6 @@ saregister(struct cam_periph *periph, void *arg)
}
bzero(softc, sizeof(*softc));
- softc->scsi_rev = SID_ANSI_REV(&cgd->inq_data);
softc->state = SA_STATE_NORMAL;
bufq_init(&softc->buf_queue);
periph->softc = softc;
@@ -1111,16 +848,9 @@ saregister(struct cam_periph *periph, void *arg)
sizeof(sa_quirk_table)/sizeof(*sa_quirk_table),
sizeof(*sa_quirk_table), scsi_inquiry_match);
- if (match != NULL) {
+ if (match != NULL)
softc->quirks = ((struct sa_quirk_entry *)match)->quirks;
- softc->last_media_blksize =
- ((struct sa_quirk_entry *)match)->prefblk;
-#ifdef CAMDEBUG
- xpt_print_path(periph->path);
- printf("found quirk entry %d\n",
- ((struct sa_quirk_entry *) match) - sa_quirk_table);
-#endif
- } else
+ else
softc->quirks = SA_QUIRK_NONE;
/*
@@ -1157,7 +887,6 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
softc = (struct sa_softc *)periph->softc;
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastart"));
switch (softc->state) {
case SA_STATE_NORMAL:
@@ -1184,10 +913,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
splx(s);
xpt_release_ccb(start_ccb);
} else if ((softc->flags & SA_FLAG_ERR_PENDING) != 0) {
- struct buf *done_bp;
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("sastart- coping with pending error %x\n",
- softc->flags & SA_FLAG_ERR_PENDING));
+
bufq_remove(&softc->buf_queue, bp);
bp->b_resid = bp->b_bcount;
bp->b_flags |= B_ERROR;
@@ -1195,17 +921,13 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
if ((bp->b_flags & B_READ) == 0)
bp->b_error = ENOSPC;
}
- if ((softc->flags & SA_FLAG_EOF_PENDING) != 0) {
- bp->b_error = EIO;
- }
if ((softc->flags & SA_FLAG_EIO_PENDING) != 0) {
bp->b_error = EIO;
}
softc->flags &= ~SA_FLAG_ERR_PENDING;
- done_bp = bp;
bp = bufq_first(&softc->buf_queue);
splx(s);
- biodone(done_bp);
+ biodone(bp);
} else {
u_int32_t length;
@@ -1216,30 +938,17 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
length =
bp->b_bcount >> softc->blk_shift;
} else {
- if (softc->media_blksize == 0) {
- bp->b_error = EIO;
- xpt_print_path(periph->path);
- printf("zero blocksize for "
- "FIXED length writes?\n");
- splx(s);
- biodone(bp);
- break;
- }
length =
- bp->b_bcount / softc->media_blksize;
+ bp->b_bcount / softc->min_blk;
}
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("Fixed Record Count is %d\n", length));
} else {
length = bp->b_bcount;
- CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO,
- ("Variable Record Count is %d\n", length));
}
devstat_start_transaction(&softc->device_stats);
/*
- * Some people have theorized that we should
+ * XXX - Perhaps we should...
* suppress illegal length indication if we are
* running in variable block mode so that we don't
* have to request sense every time our requested
@@ -1250,16 +959,9 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
* information about blocks that are larger than
* our read buffer unless we set the block size
* in the mode page to something other than 0.
- *
- * I believe that this is a non-issue. If user apps
- * don't adjust their read size to match our record
- * size, that's just life. Anyway, the typical usage
- * would be to issue, e.g., 64KB reads and occasionally
- * have to do deal with 512 byte or 1KB intermediate
- * records.
*/
scsi_sa_read_write(&start_ccb->csio,
- /* No Retries */0,
+ /*retries*/4,
sadone,
MSG_SIMPLE_Q_TAG,
bp->b_flags & B_READ,
@@ -1274,6 +976,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
start_ccb->ccb_h.ccb_bp = bp;
bp = bufq_first(&softc->buf_queue);
splx(s);
+
xpt_action(start_ccb);
}
@@ -1304,9 +1007,11 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
bp = (struct buf *)done_ccb->ccb_h.ccb_bp;
error = 0;
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+
if ((error = saerror(done_ccb, 0, 0)) == ERESTART) {
/*
- * A retry was scheduled, so just return.
+ * A retry was scheuled, so
+ * just return.
*/
return;
}
@@ -1357,13 +1062,7 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
softc->filemarks = 0;
}
}
-#ifdef CAMDEBUG
- if (error || bp->b_resid) {
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("error %d resid %ld count %ld\n", error,
- bp->b_resid, bp->b_bcount));
- }
-#endif
+
devstat_end_transaction(&softc->device_stats,
bp->b_bcount - bp->b_resid,
done_ccb->csio.tag_action & 0xf,
@@ -1382,26 +1081,14 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
xpt_release_ccb(done_ccb);
}
-
-/*
- * Mount the tape (make sure it's ready for I/O).
- */
static int
-samount(struct cam_periph *periph, int oflags, dev_t dev)
+samount(struct cam_periph *periph)
{
struct sa_softc *softc;
union ccb *ccb;
struct ccb_scsiio *csio;
int error;
- /*
- * oflags can be checked for 'kind' of open (read-only check) - later
- * dev can be checked for a control-mode or compression open - later
- */
- UNUSED_PARAMETER(oflags);
- UNUSED_PARAMETER(dev);
-
-
softc = (struct sa_softc *)periph->softc;
ccb = cam_periph_getccb(periph, /* priority */1);
csio = &ccb->csio;
@@ -1412,20 +1099,29 @@ samount(struct cam_periph *periph, int oflags, dev_t dev)
* open/mount that would invalidate a mount. This
* will also eat any pending UAs.
*/
- scsi_test_unit_ready(csio, 1, sadone,
- MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, 5000);
+ scsi_test_unit_ready(csio,
+ /*retries*/1,
+ sadone,
+ MSG_SIMPLE_Q_TAG,
+ SSD_FULL_SIZE,
+ /*timeout*/5000);
- cam_periph_runccb(ccb, NULL, 0, 0, &softc->device_stats);
+ cam_periph_runccb(ccb, /*error handler*/NULL, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
}
if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) {
struct scsi_read_block_limits_data *rblim;
int comp_enabled, comp_supported;
- u_int8_t write_protect, guessing = 0;
+ u_int8_t write_protect;
/*
* Clear out old state.
@@ -1441,201 +1137,40 @@ samount(struct cam_periph *periph, int oflags, dev_t dev)
rblim = (struct scsi_read_block_limits_data *)
malloc(sizeof(*rblim), M_TEMP, M_WAITOK);
- /* it is safe to retry this */
- scsi_read_block_limits(csio, 5, sadone, MSG_SIMPLE_Q_TAG,
- rblim, SSD_FULL_SIZE, 5000);
+ scsi_read_block_limits(csio,
+ /*retries*/1,
+ sadone,
+ MSG_SIMPLE_Q_TAG,
+ rblim,
+ SSD_FULL_SIZE,
+ /*timeout*/5000);
- error = cam_periph_runccb(ccb, saerror, 0,
- SF_RETRY_UA, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/SF_RETRY_UA,
+ &softc->device_stats);
xpt_release_ccb(ccb);
- if (error != 0) {
- /*
- * If it's less than SCSI-2, READ BLOCK LIMITS is not
- * a MANDATORY command. Anyway- it doesn't matter-
- * we can proceed anyway.
- */
- softc->blk_gran = 0;
- softc->max_blk = ~0;
- softc->min_blk = 0;
- } else {
- if (softc->scsi_rev >= SCSI_REV_3) {
- softc->blk_gran = RBL_GRAN(rblim);
- } else {
- softc->blk_gran = 0;
- }
- /*
- * We take max_blk == min_blk to mean a default to
- * fixed mode- but note that whatever we get out of
- * sagetparams below will actually determine whether
- * we are actually *in* fixed mode.
- */
- softc->max_blk = scsi_3btoul(rblim->maximum);
- softc->min_blk = scsi_2btoul(rblim->minimum);
-
-
- }
- /*
- * Next, perform a mode sense to determine
- * current density, blocksize, compression etc.
- */
- error = sagetparams(periph, SA_PARAM_ALL,
- &softc->media_blksize,
- &softc->media_density,
- &softc->media_numblks,
- &softc->buffer_mode, &write_protect,
- &softc->speed, &comp_supported,
- &comp_enabled, &softc->comp_algorithm,
- NULL);
-
- if (error != 0) {
- /*
- * We could work a little harder here. We could
- * adjust our attempts to get information. It
- * might be an ancient tape drive. If someone
- * nudges us, we'll do that.
- */
+ if (error != 0)
goto exit;
- }
- /*
- * If no quirk has determined that this is a device that is
- * preferred to be in fixed or variable mode, now is the time
- * to find out.
- */
- if ((softc->quirks & (SA_QUIRK_FIXED|SA_QUIRK_VARIABLE)) == 0) {
- guessing = 1;
- switch (softc->media_density) {
- case SCSI_DENSITY_QIC_11_4TRK:
- case SCSI_DENSITY_QIC_11_9TRK:
- case SCSI_DENSITY_QIC_24:
- case SCSI_DENSITY_QIC_120:
- case SCSI_DENSITY_QIC_150:
- softc->quirks |= SA_QUIRK_FIXED;
- softc->last_media_blksize = 512;
- break;
- default:
- softc->last_media_blksize =
- softc->media_blksize;
- softc->quirks |= SA_QUIRK_VARIABLE;
- break;
- }
- }
-
- /*
- * If no quirk has determined that this is a device that needs
- * to have 2 Filemarks at EOD, now is the time to find out.
- */
-
- if ((softc->quirks & SA_QUIRK_2FM) == 0) {
- switch (softc->media_density) {
- case SCSI_DENSITY_HALFINCH_800:
- case SCSI_DENSITY_HALFINCH_1600:
- case SCSI_DENSITY_HALFINCH_6250:
- case SCSI_DENSITY_HALFINCH_6250C:
- case SCSI_DENSITY_HALFINCH_PE:
- softc->quirks |= SA_QUIRK_2FM;
- break;
- default:
- break;
- }
- }
-
- /*
- * Now validate that some info we got makes sense.
- */
-
- if ((softc->max_blk < softc->media_blksize) ||
- (softc->min_blk > softc->media_blksize &&
- softc->media_blksize)) {
- xpt_print_path(ccb->ccb_h.path);
- printf("BLOCK LIMITS (%d..%d) could not match current "
- "block settings (%d)- adjusting\n", softc->min_blk,
- softc->max_blk, softc->media_blksize);
- softc->max_blk = softc->min_blk =
- softc->media_blksize;
- }
-
- /*
- * Now put ourselves into the right frame of mind based
- * upon quirks...
- */
-tryagain:
- /*
- * If we want to be in FIXED mode and our current blocksize
- * is not equal to our last blocksize (if nonzero), try and
- * set ourselves to this last blocksize (as the 'preferred'
- * block size). The initial quirkmatch at registry sets the
- * initial 'last' blocksize. If, for whatever reason, this
- * 'last' blocksize is zero, set the blocksize to 512,
- * or min_blk if that's larger.
- */
- if ((softc->quirks & SA_QUIRK_FIXED) &&
- (softc->media_blksize != softc->last_media_blksize)) {
- softc->media_blksize = softc->last_media_blksize;
- if (softc->media_blksize == 0) {
- softc->media_blksize = 512;
- if (softc->media_blksize < softc->min_blk) {
- softc->media_blksize = softc->min_blk;
- }
- }
- error = sasetparams(periph, SA_PARAM_BLOCKSIZE,
- softc->media_blksize, 0, 0, SF_NO_PRINT);
- if (error) {
- xpt_print_path(ccb->ccb_h.path);
- printf("unable to set fixed blocksize to %d\n",
- softc->media_blksize);
- goto exit;
- }
- }
-
- if ((softc->quirks & SA_QUIRK_VARIABLE) &&
- (softc->media_blksize != 0)) {
- softc->last_media_blksize = softc->media_blksize;
- softc->media_blksize = 0;
- error = sasetparams(periph, SA_PARAM_BLOCKSIZE,
- 0, 0, 0, SF_NO_PRINT);
- if (error) {
- /*
- * If this fails and we were guessing, just
- * assume that we got it wrong and go try
- * fixed block mode. Don't even check against
- * density code at this point.
- */
- if (guessing) {
- softc->quirks &= ~SA_QUIRK_VARIABLE;
- softc->quirks |= SA_QUIRK_FIXED;
- if (softc->last_media_blksize == 0)
- softc->last_media_blksize = 512;
- goto tryagain;
- }
- xpt_print_path(ccb->ccb_h.path);
- printf("unable to set variable blocksize\n");
- goto exit;
- }
- }
-
- /*
- * Now that we have the current block size,
- * set up some parameters for sastart's usage.
- */
- if (softc->media_blksize) {
+ softc->blk_gran = RBL_GRAN(rblim);
+ softc->max_blk = scsi_3btoul(rblim->maximum);
+ softc->min_blk = scsi_2btoul(rblim->minimum);
+ if (softc->max_blk == softc->min_blk) {
softc->flags |= SA_FLAG_FIXED;
- if (powerof2(softc->media_blksize)) {
- softc->blk_shift =
- ffs(softc->media_blksize) - 1;
- softc->blk_mask = softc->media_blksize - 1;
+ if (powerof2(softc->min_blk)) {
+ softc->blk_mask = softc->min_blk - 1;
+ softc->blk_shift = 0;
+ softc->blk_shift = ffs(softc->min_blk) - 1;
} else {
softc->blk_mask = ~0;
softc->blk_shift = 0;
}
} else {
/*
- * The SCSI-3 spec allows 0 to mean "unspecified".
- * The SCSI-1 spec allows 0 to mean 'infinite'.
- *
- * Either works here.
+ * SCSI-III spec allows 0
+ * to mean "unspecified"
*/
if (softc->max_blk == 0) {
softc->max_blk = ~0;
@@ -1648,6 +1183,22 @@ tryagain:
}
}
+ /*
+ * Next, perform a mode sense to determine
+ * current density, blocksize, compression etc.
+ */
+ error = sagetparams(periph, SA_PARAM_ALL,
+ &softc->media_blksize,
+ &softc->media_density,
+ &softc->media_numblks,
+ &softc->buffer_mode, &write_protect,
+ &softc->speed, &comp_supported,
+ &comp_enabled, &softc->comp_algorithm,
+ NULL);
+
+ if (error != 0)
+ goto exit;
+
if (write_protect)
softc->flags |= SA_FLAG_TAPE_WP;
@@ -1662,22 +1213,24 @@ tryagain:
} else
softc->flags |= SA_FLAG_COMP_UNSUPP;
- if (softc->buffer_mode == SMH_SA_BUF_MODE_NOBUF) {
- error = sasetparams(periph, SA_PARAM_BUFF_MODE, 0,
- 0, 0, SF_NO_PRINT);
- if (error == 0)
- softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF;
- }
+ if (softc->buffer_mode != SMH_SA_BUF_MODE_NOBUF)
+ goto exit;
+ error = sasetparams(periph, SA_PARAM_BUFF_MODE, 0, 0, 0);
if (error == 0)
- softc->flags |= SA_FLAG_TAPE_MOUNTED;
+ softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF;
exit:
if (rblim != NULL)
free(rblim, M_TEMP);
- if (error != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ if (error != 0) {
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+ }
} else
xpt_release_ccb(ccb);
@@ -1696,13 +1249,15 @@ sacheckeod(struct cam_periph *periph)
if ((softc->flags & SA_FLAG_TAPE_WRITTEN) != 0) {
markswanted++;
- if ((softc->quirks & SA_QUIRK_2FM) != 0)
+
+ if ((softc->flags & SA_FLAG_2FM_AT_EOD) != 0)
markswanted++;
}
if (softc->filemarks < markswanted) {
markswanted -= softc->filemarks;
- error = sawritefilemarks(periph, markswanted, FALSE);
+ error = sawritefilemarks(periph, markswanted,
+ /*setmarks*/FALSE);
} else {
error = 0;
}
@@ -1716,7 +1271,6 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
struct sa_softc *softc;
struct ccb_scsiio *csio;
struct scsi_sense_data *sense;
- u_int32_t info, resid;
int error_code, sense_key, asc, ascq;
int error;
@@ -1726,7 +1280,18 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
sense = &csio->sense_data;
scsi_extract_sense(sense, &error_code, &sense_key, &asc, &ascq);
error = 0;
- if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR) {
+
+ if (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR)
+ && ((sense->flags & (SSD_EOM|SSD_FILEMARK|SSD_ILI)) != 0)
+ && ((sense_key == SSD_KEY_NO_SENSE)
+ || (sense_key == SSD_KEY_BLANK_CHECK))) {
+ u_int32_t info;
+ u_int32_t resid;
+ int defer_action;
+
+ /*
+ * Filter out some sense codes of interest.
+ */
if ((sense->error_code & SSD_ERRCODE_VALID) != 0) {
info = scsi_4btoul(sense->info);
resid = info;
@@ -1735,40 +1300,11 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
} else {
resid = csio->dxfer_len;
info = resid;
- if ((softc->flags & SA_FLAG_FIXED) != 0) {
- if (softc->media_blksize)
- info /= softc->media_blksize;
- }
- }
- if (csio->ccb_h.ccb_type == SA_CCB_BUFFER_IO) {
- bcopy((caddr_t) sense, (caddr_t) &softc->last_io_sense,
- sizeof (struct scsi_sense_data));
- bcopy(csio->cdb_io.cdb_bytes, softc->last_io_cdb,
- (int) csio->cdb_len);
- softc->last_io_resid = resid;
- } else {
- bcopy((caddr_t) sense, (caddr_t) &softc->last_ctl_sense,
- sizeof (struct scsi_sense_data));
- bcopy(csio->cdb_io.cdb_bytes, softc->last_ctl_cdb,
- (int) csio->cdb_len);
- softc->last_ctl_resid = resid;
+ if ((softc->flags & SA_FLAG_FIXED) != 0)
+ info /= softc->media_blksize;
}
- }
-
- if (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR)
- && ((sense->flags & (SSD_EOM|SSD_FILEMARK|SSD_ILI)) != 0)
- && ((sense_key == SSD_KEY_NO_SENSE)
- || (sense_key == SSD_KEY_BLANK_CHECK))) {
- int defer_action;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("Key 0x%x ASC/ASCQ 0x%x 0x%x flags 0x%x resid %d "
- "dxfer_len %d\n", sense_key, asc, ascq,
- sense->flags & ~SSD_KEY_RESERVED, resid,
- csio->dxfer_len));
-
- if (resid > 0 && resid < csio->dxfer_len &&
- (softc->flags & SA_FLAG_FIXED) != 0)
+ if ((resid > 0 && resid < csio->dxfer_len)
+ && (softc->flags & SA_FLAG_FIXED) != 0)
defer_action = TRUE;
else
defer_action = FALSE;
@@ -1863,24 +1399,38 @@ retry:
else
ncomp_page = NULL;
- /* it is safe to retry this */
- scsi_mode_sense(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- SMS_PAGE_CTRL_CURRENT, (params_to_get & SA_PARAM_COMPRESSION) ?
- SA_DATA_COMPRESSION_PAGE : SMS_VENDOR_SPECIFIC_PAGE,
- mode_buffer, mode_buffer_len, SSD_FULL_SIZE, 5000);
+ scsi_mode_sense(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*dbd*/ FALSE,
+ /*page_code*/ SMS_PAGE_CTRL_CURRENT,
+ /*page*/ (params_to_get & SA_PARAM_COMPRESSION) ?
+ SA_DATA_COMPRESSION_PAGE :
+ SMS_VENDOR_SPECIFIC_PAGE,
+ /*param_buf*/ mode_buffer,
+ /*param_len*/ mode_buffer_len,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ 5000);
- error = cam_periph_runccb(ccb, saerror, 0,
- SF_NO_PRINT, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
+ /*sense_flags*/SF_NO_PRINT,
+ &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /* relsim_flags */0,
+ /* opening_reduction */0,
+ /* timeout */0,
+ /* getcount_only */ FALSE);
status = ccb->ccb_h.status & CAM_STATUS_MASK;
- if (error == EINVAL && (params_to_get & SA_PARAM_COMPRESSION) != 0) {
+ if (error == EINVAL
+ && (params_to_get & SA_PARAM_COMPRESSION) != 0) {
/*
* Most likely doesn't support the compression
- * page. Remember this for the future and attempt
+ * page. Remeber this for the future and attempt
* the request without asking for compression info.
*/
softc->quirks |= SA_QUIRK_NOCOMP;
@@ -1973,15 +1523,6 @@ retry:
bcopy(ncomp_page, comp_page,sizeof(*comp_page));
}
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) {
- int idx;
- char *xyz = mode_buffer;
- xpt_print_path(periph->path);
- printf("Mode Sense Data=");
- for (idx = 0; idx < mode_buffer_len; idx++)
- printf(" 0x%02x", xyz[idx] & 0xff);
- printf("\n");
- }
} else if (status == CAM_SCSI_STATUS_ERROR) {
/* Tell the user about the fatal error. */
scsi_sense_print(&ccb->csio);
@@ -2012,8 +1553,7 @@ sagetparamsexit:
*/
static int
sasetparams(struct cam_periph *periph, sa_params params_to_set,
- u_int32_t blocksize, u_int8_t density, u_int32_t comp_algorithm,
- u_int32_t sense_flags)
+ u_int32_t blocksize, u_int8_t density, u_int32_t comp_algorithm)
{
struct sa_softc *softc;
u_int32_t current_blocksize;
@@ -2083,17 +1623,12 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
scsi_ulto3b(current_blocksize, mode_blk->blklen);
/*
- * Set density if requested, else preserve old density.
- * SCSI_SAME_DENSITY only applies to SCSI-2 or better
- * devices, else density we've latched up in our softc.
+ * 0x7f means "same as before"
*/
- if (params_to_set & SA_PARAM_DENSITY) {
+ if (params_to_set & SA_PARAM_DENSITY)
mode_blk->density = density;
- } else if (softc->scsi_rev > SCSI_REV_CCS) {
- mode_blk->density = SCSI_SAME_DENSITY;
- } else {
- mode_blk->density = softc->media_density;
- }
+ else
+ mode_blk->density = 0x7f;
/*
* For mode selects, these two fields must be zero.
@@ -2157,7 +1692,6 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
*/
params_to_set &= ~SA_PARAM_COMPRESSION;
-
/*
* Should probably do something other than a printf...like
* set a flag in the softc saying that this drive doesn't
@@ -2186,7 +1720,6 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
ccb = cam_periph_getccb(periph, /*priority*/ 1);
-
scsi_mode_select(&ccb->csio,
/*retries*/1,
/*cbfcnp*/ sadone,
@@ -2200,26 +1733,17 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
/*timeout*/ 5000);
error = cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
- sense_flags, &softc->device_stats);
-
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO) ||
- params_to_set == SA_PARAM_BUFF_MODE) {
- int idx;
- char *xyz = mode_buffer;
- xpt_print_path(periph->path);
- printf("Err%d, Mode Select Data=", error);
- for (idx = 0; idx < mode_buffer_len; idx++)
- printf(" 0x%02x", xyz[idx] & 0xff);
- printf("\n");
- }
-
+ /*sense_flags*/ 0, &softc->device_stats);
if (error == 0) {
xpt_release_ccb(ccb);
} else {
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
-
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
/*
* If we were setting the blocksize, and that failed, we
* want to set it to its original value. If we weren't
@@ -2228,17 +1752,12 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
scsi_ulto3b(current_blocksize, mode_blk->blklen);
/*
- * Set density if requested, else preserve old density.
- * SCSI_SAME_DENSITY only applies to SCSI-2 or better
- * devices, else density we've latched up in our softc.
+ * 0x7f means "same as before".
*/
- if (params_to_set & SA_PARAM_DENSITY) {
+ if (params_to_set & SA_PARAM_DENSITY)
mode_blk->density = current_density;
- } else if (softc->scsi_rev > SCSI_REV_CCS) {
- mode_blk->density = SCSI_SAME_DENSITY;
- } else {
- mode_blk->density = softc->media_density;
- }
+ else
+ mode_blk->density = 0x7f;
if (params_to_set & SA_PARAM_COMPRESSION)
bcopy(current_comp_page, comp_page,
@@ -2249,28 +1768,22 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
* changed that we care about, so reset it back to 1.
*/
ccb->ccb_h.retry_count = 1;
- cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
+ /*sense_flags*/ 0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
}
- if (current_comp_page != NULL)
+ if (params_to_set & SA_PARAM_COMPRESSION)
free(current_comp_page, M_TEMP);
- if (params_to_set & SA_PARAM_COMPRESSION) {
- if (error) {
- softc->flags &= ~SA_FLAG_COMP_ENABLED;
- softc->saved_comp_algorithm = softc->comp_algorithm;
- softc->comp_algorithm = 0;
- } else {
- softc->flags |= SA_FLAG_COMP_ENABLED;
- softc->comp_algorithm = comp_algorithm;
- }
- }
-
free(mode_buffer, M_TEMP);
return(error);
}
@@ -2280,33 +1793,37 @@ saprevent(struct cam_periph *periph, int action)
{
struct sa_softc *softc;
union ccb *ccb;
- int error, sf;
+ int error;
softc = (struct sa_softc *)periph->softc;
- if ((action == PR_ALLOW) && (softc->flags & SA_FLAG_TAPE_LOCKED) == 0)
- return;
- if ((action == PR_PREVENT) && (softc->flags & SA_FLAG_TAPE_LOCKED) != 0)
+ if (((action == PR_ALLOW)
+ && (softc->flags & SA_FLAG_TAPE_LOCKED) == 0)
+ || ((action == PR_PREVENT)
+ && (softc->flags & SA_FLAG_TAPE_LOCKED) != 0)) {
return;
+ }
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO))
- sf = 0;
- else
- sf = SF_QUIET_IR;
-
- ccb = cam_periph_getccb(periph, 1);
+ ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_prevent(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, action,
- SSD_FULL_SIZE, 60000);
+ scsi_prevent(&ccb->csio,
+ /*retries*/0,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ action,
+ SSD_FULL_SIZE,
+ 60000);
- /*
- * We can be quiet about illegal requests.
- */
- error = cam_periph_runccb(ccb, saerror, sf, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
if (error == 0) {
if (action == PR_ALLOW)
@@ -2329,16 +1846,26 @@ sarewind(struct cam_periph *periph)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_rewind(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- SSD_FULL_SIZE, (SA_REWIND_TIMEOUT) * 60 * 1000);
+ scsi_rewind(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ SSD_FULL_SIZE,
+ (SA_REWIND_TIMEOUT) * 60 * 1000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2353,21 +1880,26 @@ saspace(struct cam_periph *periph, int count, scsi_space_code code)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* This cannot be retried */
+ scsi_space(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ code, count,
+ SSD_FULL_SIZE,
+ (SA_SPACE_TIMEOUT) * 60 * 1000);
- scsi_space(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG, code, count,
- SSD_FULL_SIZE, (SA_SPACE_TIMEOUT) * 60 * 1000);
-
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
- /*
- * XXX: If a spacing operation has failed, we need to invalidate
- * XXX: this mount.
- */
+
return (error);
}
@@ -2382,106 +1914,38 @@ sawritefilemarks(struct cam_periph *periph, int nmarks, int setmarks)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* this *must* not be retried */
- scsi_write_filemarks(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG,
- FALSE, setmarks, nmarks, SSD_FULL_SIZE, 60000);
-
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
-
- if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
-
- /*
- * XXXXX: Get back the actual number of filemarks written
- * (there can be a residual).
- */
- if (error == 0 && nmarks) {
- struct sa_softc *softc = (struct sa_softc *)periph->softc;
- softc->filemarks += nmarks;
- }
- xpt_release_ccb(ccb);
- return (error);
-}
-
-static int
-sardpos(struct cam_periph *periph, int hard, u_int32_t *blkptr)
-{
- struct scsi_tape_position_data loc;
- union ccb *ccb;
- struct sa_softc *softc;
- int error;
+ scsi_write_filemarks(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ setmarks,
+ nmarks,
+ SSD_FULL_SIZE,
+ 60000);
- /*
- * First flush any pending writes...
- */
- error = sawritefilemarks(periph, 0, 0);
-
- /*
- * The latter case is for 'write protected' tapes
- * which are too stupid to recognize a zero count
- * for writing filemarks as a no-op.
- */
- if (error != 0 && error != EACCES)
- return (error);
-
- softc = (struct sa_softc *)periph->softc;
- ccb = cam_periph_getccb(periph, /*priority*/1);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
- scsi_read_position(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
- hard, &loc, SSD_FULL_SIZE, 5000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
if (error == 0) {
- if (loc.flags & SA_RPOS_UNCERTAIN) {
- error = EINVAL; /* nothing is certain */
- } else {
- *blkptr = scsi_4btoul(loc.firstblk);
- }
+ struct sa_softc *softc;
+
+ softc = (struct sa_softc *)periph->softc;
+ softc->filemarks += nmarks;
}
xpt_release_ccb(ccb);
- return (error);
-}
-static int
-sasetpos(struct cam_periph *periph, int hard, u_int32_t *blkptr)
-{
- union ccb *ccb;
- struct sa_softc *softc;
- int error;
-
- /*
- * First flush any pending writes...
- */
- error = sawritefilemarks(periph, 0, 0);
-
- /*
- * The latter case is for 'write protected' tapes
- * which are too stupid to recognize a zero count
- * for writing filemarks as a no-op.
- */
- if (error != 0 && error != EACCES)
- return (error);
-
- softc = (struct sa_softc *)periph->softc;
- ccb = cam_periph_getccb(periph, /*priority*/1);
-
- scsi_set_position(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
- hard, *blkptr, SSD_FULL_SIZE, 60 * 60 * 1000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
- if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
- xpt_release_ccb(ccb);
- /*
- * XXX: Note relative file && block number position now unknown (if
- * XXX: these things ever start being maintained in this driver).
- */
return (error);
}
-
static int
saretension(struct cam_periph *periph)
{
@@ -2493,15 +1957,29 @@ saretension(struct cam_periph *periph)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_load_unload(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- FALSE, TRUE, TRUE, SSD_FULL_SIZE, (SA_ERASE_TIMEOUT) * 60 * 1000);
+ scsi_load_unload(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/ FALSE,
+ /*eot*/ FALSE,
+ /*reten*/ TRUE,
+ /*load*/ TRUE,
+ SSD_FULL_SIZE,
+ 60000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return(error);
}
@@ -2510,41 +1988,40 @@ sareservereleaseunit(struct cam_periph *periph, int reserve)
{
union ccb *ccb;
struct sa_softc *softc;
- int error, sflag;
+ int error;
softc = (struct sa_softc *)periph->softc;
+ ccb = cam_periph_getccb(periph, /*priority*/ 1);
+
+ scsi_reserve_release_unit(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*third_party*/ FALSE,
+ /*third_party_id*/ 0,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ 5000,
+ reserve);
+
/*
* We set SF_RETRY_UA, since this is often the first command run
* when a tape device is opened, and there may be a unit attention
* condition pending.
*/
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO))
- sflag = SF_RETRY_UA;
- else
- sflag = SF_RETRY_UA|SF_QUIET_IR;
-
- ccb = cam_periph_getccb(periph, 1);
-
- /* It is safe to retry this operation */
- scsi_reserve_release_unit(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG,
- FALSE, 0, SSD_FULL_SIZE, 5000, reserve);
-
- error = cam_periph_runccb(ccb, saerror, 0, sflag, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/SF_RETRY_UA,
+ &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
- /*
- * If the error was Illegal Request, then the device doesn't support
- * RESERVE/RELEASE. This is not an error.
- */
- if (error == EINVAL) {
- error = 0;
- }
-
return (error);
}
@@ -2559,15 +2036,29 @@ saloadunload(struct cam_periph *periph, int load)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_load_unload(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- FALSE, FALSE, load, SSD_FULL_SIZE, 60000);
+ scsi_load_unload(&ccb->csio,
+ /*retries*/1,
+ /*cbfcnp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ /*eot*/FALSE,
+ /*reten*/FALSE,
+ load,
+ SSD_FULL_SIZE,
+ 60000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2601,7 +2092,9 @@ saerase(struct cam_periph *periph, int longerase)
/*reduction*/0,
/*timeout*/0,
/*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2850,44 +2343,3 @@ scsi_erase(struct ccb_scsiio *csio, u_int32_t retries,
sizeof(*scsi_cmd),
timeout);
}
-
-/*
- * Read Tape Position command.
- */
-void
-scsi_read_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft,
- struct scsi_tape_position_data *sbp,
- u_int8_t sense_len, u_int32_t timeout)
-{
- struct scsi_tape_read_position *scmd;
-
- cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_IN, tag_action,
- (u_int8_t *)sbp, sizeof (*sbp), sense_len, sizeof(*scmd), timeout);
- scmd = (struct scsi_tape_read_position *)&csio->cdb_io.cdb_bytes;
- bzero(scmd, sizeof(*scmd));
- scmd->opcode = READ_POSITION;
- scmd->byte1 = hardsoft;
-}
-
-/*
- * Set Tape Position command.
- */
-void
-scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft, u_int32_t blkno,
- u_int8_t sense_len, u_int32_t timeout)
-{
- struct scsi_tape_locate *scmd;
-
- cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action,
- (u_int8_t *)NULL, 0, sense_len, sizeof(*scmd), timeout);
- scmd = (struct scsi_tape_locate *)&csio->cdb_io.cdb_bytes;
- bzero(scmd, sizeof(*scmd));
- scmd->opcode = LOCATE;
- if (hardsoft)
- scmd->byte1 |= SA_SPOS_BT;
- scsi_ulto4b(blkno, scmd->blkaddr);
-}
diff --git a/sys/cam/scsi/scsi_sa.h b/sys/cam/scsi/scsi_sa.h
index e4ea14fc9845..cc5f14d1f4a8 100644
--- a/sys/cam/scsi/scsi_sa.h
+++ b/sys/cam/scsi/scsi_sa.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_sa.h,v 1.2 1998/12/17 19:04:18 mjacob Exp $
+ * $Id$
*/
#ifndef _SCSI_SCSI_SA_H
@@ -184,43 +184,6 @@ struct scsi_data_compression_page {
u_int8_t reserved[4];
};
-struct scsi_tape_read_position {
- u_int8_t opcode; /* READ_POSITION */
- u_int8_t byte1; /* set LSB to read hardware block pos */
- u_int8_t reserved[8];
-};
-
-struct scsi_tape_position_data { /* Short Form */
- u_int8_t flags;
-#define SA_RPOS_BOP 0x80 /* Beginning of Partition */
-#define SA_RPOS_EOP 0x40 /* End of Partition */
-#define SA_RPOS_BCU 0x20 /* Block Count Unknown (SCSI3) */
-#define SA_RPOS_BYCU 0x10 /* Byte Count Unknown (SCSI3) */
-#define SA_RPOS_BPU 0x04 /* Block Position Unknown */
-#define SA_RPOS_PERR 0x02 /* Position Error (SCSI3) */
-#define SA_RPOS_UNCERTAIN SA_RPOS_BPU
- u_int8_t partition;
- u_int8_t reserved[2];
- u_int8_t firstblk[4];
- u_int8_t lastblk[4];
- u_int8_t reserved2;
- u_int8_t nbufblk[3];
- u_int8_t nbufbyte[4];
-};
-
-struct scsi_tape_locate {
- u_int8_t opcode;
- u_int8_t byte1;
-#define SA_SPOS_IMMED 0x01
-#define SA_SPOS_CP 0x02
-#define SA_SPOS_BT 0x04
- u_int8_t reserved1;
- u_int8_t blkaddr[4];
- u_int8_t reserved2;
- u_int8_t partition;
- u_int8_t control;
-};
-
/*
* Opcodes
*/
@@ -234,24 +197,6 @@ struct scsi_tape_locate {
#define RELEASE_UNIT 0x17
#define ERASE 0x19
#define LOAD_UNLOAD 0x1B
-#define LOCATE 0x2B
-#define READ_POSITION 0x34
-
-/*
- * Tape specific density codes- only enough of them here to recognize
- * some specific older units so we can choose 2FM@EOD or FIXED blocksize
- * quirks.
- */
-#define SCSI_DENSITY_HALFINCH_800 0x01
-#define SCSI_DENSITY_HALFINCH_1600 0x02
-#define SCSI_DENSITY_HALFINCH_6250 0x03
-#define SCSI_DENSITY_HALFINCH_6250C 0xC3 /* HP Compressed 6250 */
-#define SCSI_DENSITY_QIC_11_4TRK 0x04
-#define SCSI_DENSITY_QIC_11_9TRK 0x84 /* Vendor Unique Emulex */
-#define SCSI_DENSITY_QIC_24 0x05
-#define SCSI_DENSITY_HALFINCH_PE 0x06
-#define SCSI_DENSITY_QIC_120 0x0f
-#define SCSI_DENSITY_QIC_150 0x10
__BEGIN_DECLS
void scsi_read_block_limits(struct ccb_scsiio *, u_int32_t,
@@ -304,17 +249,6 @@ void scsi_data_comp_page(struct scsi_data_compression_page *page,
u_int8_t dce, u_int8_t dde, u_int8_t red,
u_int32_t comp_algorithm,
u_int32_t decomp_algorithm);
-
-void scsi_read_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft,
- struct scsi_tape_position_data *sbp,
- u_int8_t sense_len, u_int32_t timeout);
-
-void scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft, u_int32_t blkno,
- u_int8_t sense_len, u_int32_t timeout);
__END_DECLS
#endif /* _SCSI_SCSI_SA_H */
diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c
deleted file mode 100644
index ceddcbe65c60..000000000000
--- a/sys/cam/scsi/scsi_targ_bh.c
+++ /dev/null
@@ -1,715 +0,0 @@
-/*
- * Implementation of the Target Mode 'Black Hole device' for CAM.
- *
- * Copyright (c) 1999 Justin T. Gibbs.
- * 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, immediately at the beginning of the file.
- * 2. 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 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.
- *
- * $Id$
- */
-#include <stddef.h> /* For offsetof */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/types.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/devicestat.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_extend.h>
-#include <cam/cam_periph.h>
-#include <cam/cam_queue.h>
-#include <cam/cam_xpt_periph.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
-typedef enum {
- TARGBH_STATE_NORMAL,
- TARGBH_STATE_EXCEPTION,
- TARGBH_STATE_TEARDOWN
-} targbh_state;
-
-typedef enum {
- TARGBH_FLAG_NONE = 0x00,
- TARGBH_FLAG_LUN_ENABLED = 0x01
-} targbh_flags;
-
-typedef enum {
- TARGBH_CCB_WORKQ,
- TARGBH_CCB_WAITING
-} targbh_ccb_types;
-
-#define MAX_ACCEPT 16
-#define MAX_IMMEDIATE 16
-#define MAX_BUF_SIZE 256 /* Max inquiry/sense/mode page transfer */
-
-#define MIN(a, b) ((a > b) ? b : a)
-
-/* Offsets into our private CCB area for storing accept information */
-#define ccb_type ppriv_field0
-#define ccb_descr ppriv_ptr1
-
-/* We stick a pointer to the originating accept TIO in each continue I/O CCB */
-#define ccb_atio ppriv_ptr1
-
-TAILQ_HEAD(ccb_queue, ccb_hdr);
-
-struct targbh_softc {
- struct ccb_queue pending_queue;
- struct ccb_queue work_queue;
- struct ccb_queue unknown_atio_queue;
- struct devstat device_stats;
- targbh_state state;
- targbh_flags flags;
- u_int init_level;
- u_int inq_data_len;
- struct ccb_accept_tio *accept_tio_list;
- struct ccb_hdr_slist immed_notify_slist;
-};
-
-struct targbh_cmd_desc {
- struct ccb_accept_tio* atio_link;
- u_int data_resid; /* How much left to transfer */
- u_int data_increment;/* Amount to send before next disconnect */
- void* data; /* The data. Can be from backing_store or not */
- void* backing_store;/* Backing store allocated for this descriptor*/
- u_int max_size; /* Size of backing_store */
- u_int32_t timeout;
- u_int8_t status; /* Status to return to initiator */
-};
-
-static struct scsi_inquiry_data no_lun_inq_data =
-{
- T_NODEVICE | (SID_QUAL_BAD_LU << 5), 0,
- /* version */2, /* format version */2
-};
-
-static struct scsi_sense_data no_lun_sense_data =
-{
- SSD_CURRENT_ERROR|SSD_ERRCODE_VALID,
- 0,
- SSD_KEY_NOT_READY,
- 0, 0, 0, 0,
- /*extra_len*/offsetof(struct scsi_sense_data, fru)
- - offsetof(struct scsi_sense_data, extra_len),
- 0, 0, 0, 0,
- /* Logical Unit Not Supported */
- /*ASC*/0x25, /*ASCQ*/0
-};
-
-static const int request_sense_size = offsetof(struct scsi_sense_data, fru);
-
-static periph_init_t targbhinit;
-static void targbhasync(void *callback_arg, u_int32_t code,
- struct cam_path *path, void *arg);
-static cam_status targbhenlun(struct cam_periph *periph);
-static cam_status targbhdislun(struct cam_periph *periph);
-static periph_ctor_t targbhctor;
-static periph_dtor_t targbhdtor;
-static periph_start_t targbhstart;
-static void targbhdone(struct cam_periph *periph,
- union ccb *done_ccb);
-static int targbherror(union ccb *ccb, u_int32_t cam_flags,
- u_int32_t sense_flags);
-static struct targbh_cmd_desc* targbhallocdescr(void);
-static void targbhfreedescr(struct targbh_cmd_desc *buf);
-
-static struct periph_driver targbhdriver =
-{
- targbhinit, "targbh",
- TAILQ_HEAD_INITIALIZER(targbhdriver.units), /* generation */ 0
-};
-
-DATA_SET(periphdriver_set, targbhdriver);
-
-static void
-targbhinit(void)
-{
- cam_status status;
- struct cam_path *path;
-
- /*
- * Install a global async callback. This callback will
- * receive async callbacks like "new path registered".
- */
- status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID,
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
-
- if (status == CAM_REQ_CMP) {
- struct ccb_setasync csa;
-
- xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_PATH_REGISTERED;
- csa.callback = targbhasync;
- csa.callback_arg = NULL;
- xpt_action((union ccb *)&csa);
- status = csa.ccb_h.status;
- xpt_free_path(path);
- }
-
- if (status != CAM_REQ_CMP) {
- printf("targbh: Failed to attach master async callback "
- "due to status 0x%x!\n", status);
- }
-}
-
-static void
-targbhasync(void *callback_arg, u_int32_t code,
- struct cam_path *path, void *arg)
-{
- struct cam_periph *periph;
-
- periph = (struct cam_periph *)callback_arg;
- switch (code) {
- case AC_PATH_REGISTERED:
- {
- struct ccb_pathinq *cpi;
- struct cam_path *new_path;
- cam_status status;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Only attach to controllers that support target mode */
- if ((cpi->target_sprt & PIT_PROCESSOR) == 0)
- break;
-
- /*
- * Allocate a peripheral instance for
- * this target instance.
- */
- status = xpt_create_path(&new_path, NULL,
- xpt_path_path_id(path),
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
- if (status != CAM_REQ_CMP) {
- printf("targbhasync: Unable to create path "
- "due to status 0x%x\n", status);
- break;
- }
- status = cam_periph_alloc(targbhctor, NULL, targbhdtor,
- targbhstart,
- "targbh", CAM_PERIPH_BIO,
- new_path, targbhasync,
- AC_PATH_REGISTERED,
- cpi);
- xpt_free_path(new_path);
- if (status != CAM_REQ_CMP
- && status != CAM_REQ_INPROG)
- printf("targbhasync: Unable to allocate new periph "
- "due to status 0x%x\n", status);
- break;
- }
- case AC_PATH_DEREGISTERED:
- {
- targbhdislun(periph);
- break;
- }
- default:
- break;
- }
-}
-
-/* Attempt to enable our lun */
-static cam_status
-targbhenlun(struct cam_periph *periph)
-{
- union ccb immed_ccb;
- struct targbh_softc *softc;
- cam_status status;
- int i;
-
- softc = (struct targbh_softc *)periph->softc;
-
- if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0)
- return (CAM_REQ_CMP);
-
- xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, /*priority*/1);
- immed_ccb.ccb_h.func_code = XPT_EN_LUN;
-
- /* Don't need support for any vendor specific commands */
- immed_ccb.cel.grp6_len = 0;
- immed_ccb.cel.grp7_len = 0;
- immed_ccb.cel.enable = 1;
- xpt_action(&immed_ccb);
- status = immed_ccb.ccb_h.status;
- if (status != CAM_REQ_CMP) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Enable Lun Rejected for status 0x%x\n",
- status);
- return (status);
- }
-
- softc->flags |= TARGBH_FLAG_LUN_ENABLED;
-
- /*
- * Build up a buffer of accept target I/O
- * operations for incoming selections.
- */
- for (i = 0; i < MAX_ACCEPT; i++) {
- struct ccb_accept_tio *atio;
-
- atio = (struct ccb_accept_tio*)malloc(sizeof(*atio), M_DEVBUF,
- M_NOWAIT);
- if (atio == NULL) {
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- atio->ccb_h.ccb_descr = targbhallocdescr();
-
- if (atio->ccb_h.ccb_descr == NULL) {
- free(atio, M_DEVBUF);
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- xpt_setup_ccb(&atio->ccb_h, periph->path, /*priority*/1);
- atio->ccb_h.func_code = XPT_ACCEPT_TARGET_IO;
- atio->ccb_h.cbfcnp = targbhdone;
- xpt_action((union ccb *)atio);
- status = atio->ccb_h.status;
- if (status != CAM_REQ_INPROG) {
- targbhfreedescr(atio->ccb_h.ccb_descr);
- free(atio, M_DEVBUF);
- break;
- }
- ((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link =
- softc->accept_tio_list;
- softc->accept_tio_list = atio;
- }
-
- if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate accept tio CCBs: "
- "status = 0x%x\n", status);
- targbhdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- /*
- * Build up a buffer of immediate notify CCBs
- * so the SIM can tell us of asynchronous target mode events.
- */
- for (i = 0; i < MAX_ACCEPT; i++) {
- struct ccb_immed_notify *inot;
-
- inot = (struct ccb_immed_notify*)malloc(sizeof(*inot), M_DEVBUF,
- M_NOWAIT);
-
- if (inot == NULL) {
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- xpt_setup_ccb(&inot->ccb_h, periph->path, /*priority*/1);
- inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
- inot->ccb_h.cbfcnp = targbhdone;
- xpt_action((union ccb *)inot);
- status = inot->ccb_h.status;
- if (status != CAM_REQ_INPROG) {
- free(inot, M_DEVBUF);
- break;
- }
- SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
- periph_links.sle);
- }
-
- if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate immediate notify "
- "CCBs: status = 0x%x\n", status);
- targbhdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- return (CAM_REQ_CMP);
-}
-
-static cam_status
-targbhdislun(struct cam_periph *periph)
-{
- union ccb ccb;
- struct targbh_softc *softc;
- struct ccb_accept_tio* atio;
- struct ccb_hdr *ccb_h;
-
- softc = (struct targbh_softc *)periph->softc;
- if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) == 0)
- return CAM_REQ_CMP;
-
- /* XXX Block for Continue I/O completion */
-
- /* Kill off all ACCECPT and IMMEDIATE CCBs */
- while ((atio = softc->accept_tio_list) != NULL) {
-
- softc->accept_tio_list =
- ((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link;
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)atio;
- xpt_action(&ccb);
- }
-
- while ((ccb_h = SLIST_FIRST(&softc->immed_notify_slist)) != NULL) {
- SLIST_REMOVE_HEAD(&softc->immed_notify_slist, periph_links.sle);
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)ccb_h;
- xpt_action(&ccb);
- }
-
- /*
- * Dissable this lun.
- */
- xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, /*priority*/1);
- ccb.cel.ccb_h.func_code = XPT_EN_LUN;
- ccb.cel.enable = 0;
- xpt_action(&ccb);
-
- if (ccb.cel.ccb_h.status != CAM_REQ_CMP)
- printf("targbhdislun - Disabling lun on controller failed "
- "with status 0x%x\n", ccb.cel.ccb_h.status);
- else
- softc->flags &= ~TARGBH_FLAG_LUN_ENABLED;
- return (ccb.cel.ccb_h.status);
-}
-
-static cam_status
-targbhctor(struct cam_periph *periph, void *arg)
-{
- struct ccb_pathinq *cpi;
- struct targbh_softc *softc;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Allocate our per-instance private storage */
- softc = (struct targbh_softc *)malloc(sizeof(*softc),
- M_DEVBUF, M_NOWAIT);
- if (softc == NULL) {
- printf("targctor: unable to malloc softc\n");
- return (CAM_REQ_CMP_ERR);
- }
-
- bzero(softc, sizeof(softc));
- TAILQ_INIT(&softc->pending_queue);
- TAILQ_INIT(&softc->work_queue);
- softc->accept_tio_list = NULL;
- SLIST_INIT(&softc->immed_notify_slist);
- softc->state = TARGBH_STATE_NORMAL;
- periph->softc = softc;
- softc->init_level++;
-
- return (targbhenlun(periph));
-}
-
-static void
-targbhdtor(struct cam_periph *periph)
-{
- struct targbh_softc *softc;
-
- softc = (struct targbh_softc *)periph->softc;
-
- softc->state = TARGBH_STATE_TEARDOWN;
-
- targbhdislun(periph);
-
- switch (softc->init_level) {
- default:
- /* FALLTHROUGH */
- case 1:
- free(softc, M_DEVBUF);
- break;
- case 0:
- panic("targdtor - impossible init level");;
- }
-}
-
-static void
-targbhstart(struct cam_periph *periph, union ccb *start_ccb)
-{
- struct targbh_softc *softc;
- struct ccb_hdr *ccbh;
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *desc;
- struct ccb_scsiio *csio;
- ccb_flags flags;
- int s;
-
- softc = (struct targbh_softc *)periph->softc;
-
- s = splbio();
- ccbh = TAILQ_FIRST(&softc->work_queue);
- if (periph->immediate_priority <= periph->pinfo.priority) {
- start_ccb->ccb_h.ccb_type = TARGBH_CCB_WAITING;
- SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h,
- periph_links.sle);
- periph->immediate_priority = CAM_PRIORITY_NONE;
- splx(s);
- wakeup(&periph->ccb_list);
- } else if (ccbh == NULL) {
- splx(s);
- xpt_release_ccb(start_ccb);
- } else {
- TAILQ_REMOVE(&softc->work_queue, ccbh, periph_links.tqe);
- TAILQ_INSERT_HEAD(&softc->pending_queue, ccbh,
- periph_links.tqe);
- splx(s);
- atio = (struct ccb_accept_tio*)ccbh;
- desc = (struct targbh_cmd_desc *)atio->ccb_h.ccb_descr;
-
- /* Is this a tagged request? */
- flags = atio->ccb_h.flags & (CAM_TAG_ACTION_VALID|CAM_DIR_MASK);
-
- /*
- * If we are done with the transaction, tell the
- * controller to send status and perform a CMD_CMPLT.
- */
- if (desc->data_resid == desc->data_increment)
- flags |= CAM_SEND_STATUS;
-
- csio = &start_ccb->csio;
- cam_fill_ctio(csio,
- /*retries*/2,
- targbhdone,
- flags,
- /*tag_action*/MSG_SIMPLE_Q_TAG,
- atio->tag_id,
- atio->init_id,
- desc->status,
- /*data_ptr*/desc->data_increment == 0
- ? NULL : desc->data,
- /*dxfer_len*/desc->data_increment,
- /*timeout*/desc->timeout);
-
- /* Override our wildcard attachment */
- start_ccb->ccb_h.target_id = atio->ccb_h.target_id;
- start_ccb->ccb_h.target_lun = atio->ccb_h.target_lun;
-
- start_ccb->ccb_h.ccb_type = TARGBH_CCB_WORKQ;
- start_ccb->ccb_h.ccb_atio = atio;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Sending a CTIO\n"));
- xpt_action(start_ccb);
- s = splbio();
- ccbh = TAILQ_FIRST(&softc->work_queue);
- splx(s);
- }
- if (ccbh != NULL)
- xpt_schedule(periph, /*priority*/1);
-}
-
-static void
-targbhdone(struct cam_periph *periph, union ccb *done_ccb)
-{
- struct targbh_softc *softc;
-
- softc = (struct targbh_softc *)periph->softc;
-
- if (done_ccb->ccb_h.ccb_type == TARGBH_CCB_WAITING) {
- /* Caller will release the CCB */
- wakeup(&done_ccb->ccb_h.cbfcnp);
- return;
- }
-
- switch (done_ccb->ccb_h.func_code) {
- case XPT_ACCEPT_TARGET_IO:
- {
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *descr;
- u_int8_t *cdb;
-
- atio = &done_ccb->atio;
- descr = (struct targbh_cmd_desc*)atio->ccb_h.ccb_descr;
- cdb = atio->cdb_io.cdb_bytes;
- if (softc->state == TARGBH_STATE_TEARDOWN
- || atio->ccb_h.status == CAM_REQ_ABORTED) {
- targbhfreedescr(descr);
- free(done_ccb, M_DEVBUF);
- return;
- }
-
- /*
- * Determine the type of incoming command and
- * setup our buffer for a response.
- */
- switch (cdb[0]) {
- case INQUIRY:
- {
- struct scsi_inquiry *inq;
-
- inq = (struct scsi_inquiry *)cdb;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Saw an inquiry!\n"));
- /*
- * Validate the command. We don't
- * support any VPD pages, so complain
- * if EVPD is set.
- */
- if ((inq->byte2 & SI_EVPD) != 0
- || inq->page_code != 0) {
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_NONE;
- descr->data_resid = 0;
- descr->data_increment = 0;
- descr->status = SCSI_STATUS_CHECK_COND;
- break;
- }
- /*
- * Direction is always relative
- * to the initator.
- */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_IN;
- descr->data = &no_lun_inq_data;
- descr->data_resid = MIN(sizeof(no_lun_inq_data),
- inq->length);
- descr->data_increment = descr->data_resid;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_OK;
- break;
- }
- case REQUEST_SENSE:
- {
- struct scsi_request_sense *rsense;
-
- rsense = (struct scsi_request_sense *)cdb;
- /* Refer to static sense data */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_IN;
- descr->data = &no_lun_sense_data;
- descr->data_resid = request_sense_size;
- descr->data_resid = MIN(descr->data_resid,
- rsense->length);
- descr->data_increment = descr->data_resid;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_OK;
- break;
- }
- default:
- /* Constant CA, tell initiator */
- /* Direction is always relative to the initator */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_NONE;
- descr->data_resid = 0;
- descr->data_increment = 0;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_CHECK_COND;
- break;
- }
-
- /* Queue us up to receive a Continue Target I/O ccb. */
- TAILQ_INSERT_TAIL(&softc->work_queue, &atio->ccb_h,
- periph_links.tqe);
- xpt_schedule(periph, /*priority*/1);
- break;
- }
- case XPT_CONT_TARGET_IO:
- {
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *desc;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Received completed CTIO\n"));
- atio = (struct ccb_accept_tio*)done_ccb->ccb_h.ccb_atio;
- desc = (struct targbh_cmd_desc *)atio->ccb_h.ccb_descr;
-
- TAILQ_REMOVE(&softc->pending_queue, &atio->ccb_h,
- periph_links.tqe);
-
- /* XXX Check for errors */
- desc->data_resid -= desc->data_increment;
- xpt_release_ccb(done_ccb);
- if (softc->state != TARGBH_STATE_TEARDOWN) {
-
- /*
- * Send the original accept TIO back to the
- * controller to handle more work.
- */
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Returning ATIO to target\n"));
- /* Restore wildcards */
- atio->ccb_h.target_id = CAM_TARGET_WILDCARD;
- atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
- xpt_action((union ccb *)atio);
- break;
- } else {
- targbhfreedescr(desc);
- free(atio, M_DEVBUF);
- }
- break;
- }
- case XPT_IMMED_NOTIFY:
- {
- if (softc->state == TARGBH_STATE_TEARDOWN
- || done_ccb->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an immediate notify\n");
- free(done_ccb, M_DEVBUF);
- }
- break;
- }
- }
-}
-
-static int
-targbherror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
-{
- return 0;
-}
-
-static struct targbh_cmd_desc*
-targbhallocdescr()
-{
- struct targbh_cmd_desc* descr;
-
- /* Allocate the targbh_descr structure */
- descr = (struct targbh_cmd_desc *)malloc(sizeof(*descr),
- M_DEVBUF, M_NOWAIT);
- if (descr == NULL)
- return (NULL);
-
- bzero(descr, sizeof(*descr));
-
- /* Allocate buffer backing store */
- descr->backing_store = malloc(MAX_BUF_SIZE, M_DEVBUF, M_NOWAIT);
- if (descr->backing_store == NULL) {
- free(descr, M_DEVBUF);
- return (NULL);
- }
- descr->max_size = MAX_BUF_SIZE;
- return (descr);
-}
-
-static void
-targbhfreedescr(struct targbh_cmd_desc *descr)
-{
- free(descr->backing_store, M_DEVBUF);
- free(descr, M_DEVBUF);
-}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index 109582997d30..4c50f140e160 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -1,7 +1,7 @@
/*
* Implementation of a simple Target Mode SCSI Proccessor Target driver for CAM.
*
- * Copyright (c) 1998, 1999 Justin T. Gibbs.
+ * Copyright (c) 1998 Justin T. Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_target.c,v 1.6 1998/12/17 00:03:14 gibbs Exp $
+ * $Id: scsi_target.c,v 1.1 1998/09/15 06:36:34 gibbs Exp $
*/
#include <stddef.h> /* For offsetof */
@@ -46,7 +46,6 @@
#include <cam/cam_ccb.h>
#include <cam/cam_extend.h>
#include <cam/cam_periph.h>
-#include <cam/cam_queue.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_debug.h>
@@ -64,8 +63,7 @@ typedef enum {
typedef enum {
TARG_FLAG_NONE = 0x00,
TARG_FLAG_SEND_EOF = 0x01,
- TARG_FLAG_RECEIVE_EOF = 0x02,
- TARG_FLAG_LUN_ENABLED = 0x04
+ TARG_FLAG_RECEIVE_EOF = 0x02
} targ_flags;
typedef enum {
@@ -106,13 +104,11 @@ struct targ_softc {
u_int init_level;
u_int inq_data_len;
struct scsi_inquiry_data *inq_data;
- struct ccb_accept_tio *accept_tio_list;
- struct ccb_hdr_slist immed_notify_slist;
struct initiator_state istate[MAX_INITIATORS];
};
struct targ_cmd_desc {
- struct ccb_accept_tio* atio_link;
+ SLIST_ENTRY(targ_cmd_desc) links;
u_int data_resid; /* How much left to transfer */
u_int data_increment;/* Amount to send before next disconnect */
void* data; /* The data. Can be from backing_store or not */
@@ -159,8 +155,6 @@ static int targsendccb(struct cam_periph *periph, union ccb *ccb,
static periph_init_t targinit;
static void targasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
-static cam_status targenlun(struct cam_periph *periph);
-static cam_status targdislun(struct cam_periph *periph);
static periph_ctor_t targctor;
static periph_dtor_t targdtor;
static void targrunqueue(struct cam_periph *periph,
@@ -267,7 +261,7 @@ targasync(void *callback_arg, u_int32_t code,
"due to status 0x%x\n", status);
break;
}
- status = cam_periph_alloc(targctor, NULL, targdtor, targstart,
+ status = cam_periph_alloc(targctor, targdtor, targstart,
"targ", CAM_PERIPH_BIO,
new_path, targasync,
AC_PATH_REGISTERED,
@@ -293,20 +287,62 @@ targasync(void *callback_arg, u_int32_t code,
}
}
-/* Attempt to enable our lun */
static cam_status
-targenlun(struct cam_periph *periph)
+targctor(struct cam_periph *periph, void *arg)
{
union ccb immed_ccb;
struct targ_softc *softc;
cam_status status;
int i;
- softc = (struct targ_softc *)periph->softc;
+ /* Allocate our per-instance private storage */
+ softc = (struct targ_softc *)malloc(sizeof(*softc), M_DEVBUF, M_NOWAIT);
+ if (softc == NULL) {
+ printf("targctor: unable to malloc softc\n");
+ return (CAM_REQ_CMP_ERR);
+ }
+
+ bzero(softc, sizeof(softc));
+ TAILQ_INIT(&softc->pending_queue);
+ TAILQ_INIT(&softc->work_queue);
+ TAILQ_INIT(&softc->snd_ccb_queue);
+ TAILQ_INIT(&softc->rcv_ccb_queue);
+ TAILQ_INIT(&softc->unknown_atio_queue);
+ bufq_init(&softc->snd_buf_queue);
+ bufq_init(&softc->rcv_buf_queue);
+ softc->state = TARG_STATE_NORMAL;
+ periph->softc = softc;
+ softc->init_level++;
+
+ cam_extend_set(targperiphs, periph->unit_number, periph);
- if ((softc->flags & TARG_FLAG_LUN_ENABLED) != 0)
- return (CAM_REQ_CMP);
+ /*
+ * We start out life with a UA to indicate power-on/reset.
+ */
+ for (i = 0; i < MAX_INITIATORS; i++)
+ softc->istate[i].pending_ua = UA_POWER_ON;
+
+ /*
+ * Allocate an initial inquiry data buffer. We might allow the
+ * user to override this later via an ioctl.
+ */
+ softc->inq_data_len = sizeof(*softc->inq_data);
+ softc->inq_data = malloc(softc->inq_data_len, M_DEVBUF, M_NOWAIT);
+ if (softc->inq_data == NULL) {
+ printf("targctor - Unable to malloc inquiry data\n");
+ targdtor(periph);
+ }
+ bzero(softc->inq_data, softc->inq_data_len);
+ softc->inq_data->device = T_PROCESSOR | (SID_QUAL_LU_CONNECTED << 5);
+ softc->inq_data->version = 2;
+ softc->inq_data->response_format = 2; /* SCSI2 Inquiry Format */
+ softc->inq_data->additional_length = softc->inq_data_len - 4;
+ strncpy(softc->inq_data->vendor, "FreeBSD ", SID_VENDOR_SIZE);
+ strncpy(softc->inq_data->product, "TM-PT ", SID_PRODUCT_SIZE);
+ strncpy(softc->inq_data->revision, "0.0 ", SID_REVISION_SIZE);
+ softc->init_level++;
+ /* Attempt to enable the lun of interrest */
xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, /*priority*/1);
immed_ccb.ccb_h.func_code = XPT_EN_LUN;
@@ -316,15 +352,17 @@ targenlun(struct cam_periph *periph)
immed_ccb.cel.enable = 1;
xpt_action(&immed_ccb);
status = immed_ccb.ccb_h.status;
+
if (status != CAM_REQ_CMP) {
xpt_print_path(periph->path);
- printf("targenlun - Enable Lun Rejected for status 0x%x\n",
+ printf("targctor - Enable Lun Rejected for status 0x%x\n",
status);
+ targdtor(periph);
return (status);
}
-
- softc->flags |= TARG_FLAG_LUN_ENABLED;
+ softc->init_level++;
+
/*
* Build up a buffer of accept target I/O
* operations for incoming selections.
@@ -353,20 +391,16 @@ targenlun(struct cam_periph *periph)
xpt_action((union ccb *)atio);
status = atio->ccb_h.status;
if (status != CAM_REQ_INPROG) {
- freedescr(atio->ccb_h.ccb_descr);
free(atio, M_DEVBUF);
break;
}
- ((struct targ_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link =
- softc->accept_tio_list;
- softc->accept_tio_list = atio;
}
if (i == 0) {
xpt_print_path(periph->path);
- printf("targenlun - Could not allocate accept tio CCBs: "
+ printf("targctor - Could not allocate accept tio CCBs: "
"status = 0x%x\n", status);
- targdislun(periph);
+ targdtor(periph);
return (CAM_REQ_CMP_ERR);
}
@@ -394,129 +428,15 @@ targenlun(struct cam_periph *periph)
free(inot, M_DEVBUF);
break;
}
- SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
- periph_links.sle);
}
if (i == 0) {
xpt_print_path(periph->path);
- printf("targenlun - Could not allocate immediate notify CCBs: "
+ printf("targctor - Could not allocate immediate notify CCBs: "
"status = 0x%x\n", status);
- targdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- return (CAM_REQ_CMP);
-}
-
-static cam_status
-targdislun(struct cam_periph *periph)
-{
- union ccb ccb;
- struct targ_softc *softc;
- struct ccb_accept_tio* atio;
- struct ccb_hdr *ccb_h;
-
- softc = (struct targ_softc *)periph->softc;
- if ((softc->flags & TARG_FLAG_LUN_ENABLED) == 0)
- return CAM_REQ_CMP;
-
- /* XXX Block for Continue I/O completion */
-
- /* Kill off all ACCECPT and IMMEDIATE CCBs */
- while ((atio = softc->accept_tio_list) != NULL) {
-
- softc->accept_tio_list =
- ((struct targ_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link;
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)atio;
- xpt_action(&ccb);
- }
-
- while ((ccb_h = SLIST_FIRST(&softc->immed_notify_slist)) != NULL) {
- SLIST_REMOVE_HEAD(&softc->immed_notify_slist, periph_links.sle);
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)ccb_h;
- xpt_action(&ccb);
- }
-
- /*
- * Dissable this lun.
- */
- xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, /*priority*/1);
- ccb.cel.ccb_h.func_code = XPT_EN_LUN;
- ccb.cel.enable = 0;
- xpt_action(&ccb);
-
- if (ccb.cel.ccb_h.status != CAM_REQ_CMP)
- printf("targdislun - Disabling lun on controller failed "
- "with status 0x%x\n", ccb.cel.ccb_h.status);
- else
- softc->flags &= ~TARG_FLAG_LUN_ENABLED;
- return (ccb.cel.ccb_h.status);
-}
-
-static cam_status
-targctor(struct cam_periph *periph, void *arg)
-{
- struct ccb_pathinq *cpi;
- struct targ_softc *softc;
- int i;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Allocate our per-instance private storage */
- softc = (struct targ_softc *)malloc(sizeof(*softc), M_DEVBUF, M_NOWAIT);
- if (softc == NULL) {
- printf("targctor: unable to malloc softc\n");
- return (CAM_REQ_CMP_ERR);
- }
-
- bzero(softc, sizeof(softc));
- TAILQ_INIT(&softc->pending_queue);
- TAILQ_INIT(&softc->work_queue);
- TAILQ_INIT(&softc->snd_ccb_queue);
- TAILQ_INIT(&softc->rcv_ccb_queue);
- TAILQ_INIT(&softc->unknown_atio_queue);
- bufq_init(&softc->snd_buf_queue);
- bufq_init(&softc->rcv_buf_queue);
- softc->accept_tio_list = NULL;
- SLIST_INIT(&softc->immed_notify_slist);
- softc->state = TARG_STATE_NORMAL;
- periph->softc = softc;
- softc->init_level++;
-
- cam_extend_set(targperiphs, periph->unit_number, periph);
-
- /*
- * We start out life with a UA to indicate power-on/reset.
- */
- for (i = 0; i < MAX_INITIATORS; i++)
- softc->istate[i].pending_ua = UA_POWER_ON;
-
- /*
- * Allocate an initial inquiry data buffer. We might allow the
- * user to override this later via an ioctl.
- */
- softc->inq_data_len = sizeof(*softc->inq_data);
- softc->inq_data = malloc(softc->inq_data_len, M_DEVBUF, M_NOWAIT);
- if (softc->inq_data == NULL) {
- printf("targctor - Unable to malloc inquiry data\n");
targdtor(periph);
+ return (CAM_REQ_CMP_ERR);
}
- bzero(softc->inq_data, softc->inq_data_len);
- softc->inq_data->device = T_PROCESSOR | (SID_QUAL_LU_CONNECTED << 5);
- softc->inq_data->version = 2;
- softc->inq_data->response_format = 2; /* SCSI2 Inquiry Format */
- softc->inq_data->flags =
- cpi->hba_inquiry & (PI_SDTR_ABLE|PI_WIDE_16|PI_WIDE_32);
- softc->inq_data->additional_length = softc->inq_data_len - 4;
- strncpy(softc->inq_data->vendor, "FreeBSD ", SID_VENDOR_SIZE);
- strncpy(softc->inq_data->product, "TM-PT ", SID_PRODUCT_SIZE);
- strncpy(softc->inq_data->revision, "0.0 ", SID_REVISION_SIZE);
- softc->init_level++;
return (CAM_REQ_CMP);
}
@@ -530,11 +450,25 @@ targdtor(struct cam_periph *periph)
softc->state = TARG_STATE_TEARDOWN;
- targdislun(periph);
-
switch (softc->init_level) {
default:
/* FALLTHROUGH */
+ case 3:
+ {
+ struct ccb_en_lun cel;
+ /*
+ * XXX Spec requires abort of all ACCEPT and
+ * IMMEDIATE CCBS first. Act accordingly.
+ */
+ /*
+ * Dissable this lun.
+ */
+ xpt_setup_ccb(&cel.ccb_h, periph->path, /*priority*/1);
+ cel.ccb_h.func_code = XPT_EN_LUN;
+ cel.enable = 0;
+ xpt_action((union ccb *)&cel);
+ /* FALLTHROUGH */
+ }
case 2:
free(softc->inq_data, M_DEVBUF);
/* FALLTHROUGH */
@@ -550,68 +484,32 @@ static int
targopen(dev_t dev, int flags, int fmt, struct proc *p)
{
struct cam_periph *periph;
- u_int unit;
- cam_status status;
- int error;
- int s;
+ struct targ_softc *softc;
+ u_int unit;
+ int s;
unit = minor(dev);
-
- s = splsoftcam();
periph = cam_extend_get(targperiphs, unit);
- if (periph == NULL) {
+ if (periph == NULL)
return (ENXIO);
- splx(s);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
- return (error);
- }
- splx(s);
-
- status = targenlun(periph);
- switch (status) {
- case CAM_REQ_CMP:
- error = 0;
- break;
- case CAM_RESRC_UNAVAIL:
- error = ENOMEM;
- break;
- case CAM_LUN_ALRDY_ENA:
- error = EADDRINUSE;
- break;
- default:
- error = ENXIO;
- break;
- }
- cam_periph_unlock(periph);
- return (error);
+ softc = (struct targ_softc *)periph->softc;
+
+ return (0);
}
static int
targclose(dev_t dev, int flag, int fmt, struct proc *p)
{
- struct cam_periph *periph;
- struct targ_softc *softc;
- u_int unit;
- int s;
- int error;
+ struct cam_periph *periph;
+ struct targ_softc *softc;
+ u_int unit;
+ int s;
unit = minor(dev);
- s = splsoftcam();
periph = cam_extend_get(targperiphs, unit);
- if (periph == NULL) {
- splx(s);
+ if (periph == NULL)
return (ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO)) != 0)
- return (error);
softc = (struct targ_softc *)periph->softc;
- splx(s);
-
- targdislun(periph);
-
- cam_periph_unlock(periph);
return (0);
}
@@ -623,6 +521,7 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
struct targ_softc *softc;
u_int unit;
int error;
+ int s;
unit = minor(dev);
periph = cam_extend_get(targperiphs, unit);
@@ -700,8 +599,8 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
error = EINVAL;
break;
}
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("GET/SETISTATE for %d\n", ioc_istate->initiator_id));
+ xpt_print_path(periph->path);
+ printf("GET/SETISTATE for %d\n", ioc_istate->initiator_id);
if (cmd == TARGIOCGETISTATE) {
bcopy(&softc->istate[ioc_istate->initiator_id],
&ioc_istate->istate, sizeof(ioc_istate->istate));
@@ -709,9 +608,9 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
bcopy(&ioc_istate->istate,
&softc->istate[ioc_istate->initiator_id],
sizeof(ioc_istate->istate));
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("pending_ca now %x\n",
- softc->istate[ioc_istate->initiator_id].pending_ca));
+ xpt_print_path(periph->path);
+ printf("pending_ca now %x\n",
+ softc->istate[ioc_istate->initiator_id].pending_ca);
}
break;
}
@@ -730,6 +629,7 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
static int
targsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
{
+ struct buf *bp[2];
struct targ_softc *softc;
struct cam_periph_map_info mapinfo;
int error, need_unmap;
@@ -946,12 +846,12 @@ targstrategy(struct buf *bp)
*/
bp->b_resid = bp->b_bcount;
if ((bp->b_flags & B_READ) != 0) {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Queued a SEND buffer\n"));
+ xpt_print_path(periph->path);
+ printf("Queued a SEND buffer\n");
bufq_insert_tail(&softc->snd_buf_queue, bp);
} else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Queued a RECEIVE buffer\n"));
+ xpt_print_path(periph->path);
+ printf("Queued a RECEIVE buffer\n");
bufq_insert_tail(&softc->rcv_buf_queue, bp);
}
@@ -983,6 +883,7 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
struct buf *bp;
struct targ_cmd_desc *desc;
struct ccb_hdr *ccbh;
+ int added;
int s;
s = splbio();
@@ -1004,9 +905,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
if (bp == NULL)
softc->flags &= ~TARG_FLAG_SEND_EOF;
else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("De-Queued a SEND buffer %ld\n",
- bp->b_bcount));
+ xpt_print_path(periph->path);
+ printf("De-Queued a SEND buffer %ld\n",
+ bp->b_bcount);
}
bufq = &softc->snd_buf_queue;
pending_queue = &softc->snd_ccb_queue;
@@ -1017,9 +918,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
if (bp == NULL)
softc->flags &= ~TARG_FLAG_RECEIVE_EOF;
else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("De-Queued a RECEIVE buffer %ld\n",
- bp->b_bcount));
+ xpt_print_path(periph->path);
+ printf("De-Queued a RECEIVE buffer %ld\n",
+ bp->b_bcount);
}
bufq = &softc->rcv_buf_queue;
pending_queue = &softc->rcv_ccb_queue;
@@ -1044,9 +945,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
desc->data_increment =
MIN(desc->data_resid, bp->b_resid);
}
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Buffer command: data %x: datacnt %d\n",
- (intptr_t)desc->data, desc->data_increment));
+ xpt_print_path(periph->path);
+ printf("Buffer command: data %x: datacnt %d\n",
+ (intptr_t)desc->data, desc->data_increment);
TAILQ_INSERT_TAIL(&softc->work_queue, &atio->ccb_h,
periph_links.tqe);
}
@@ -1116,8 +1017,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb)
start_ccb->ccb_h.ccb_type = TARG_CCB_WORKQ;
start_ccb->ccb_h.ccb_atio = atio;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Sending a CTIO\n"));
+ xpt_print_path(periph->path);
+ printf("Sending a CTIO\n");
xpt_action(start_ccb);
s = splbio();
ccbh = TAILQ_FIRST(&softc->work_queue);
@@ -1152,9 +1053,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
descr = (struct targ_cmd_desc*)atio->ccb_h.ccb_descr;
istate = &softc->istate[atio->init_id];
cdb = atio->cdb_io.cdb_bytes;
- if (softc->state == TARG_STATE_TEARDOWN
- || atio->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an accept tio\n");
+ if (softc->state == TARG_STATE_TEARDOWN) {
freedescr(descr);
free(done_ccb, M_DEVBUF);
return;
@@ -1209,8 +1108,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
inq = (struct scsi_inquiry *)cdb;
sense = &istate->sense_data;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Saw an inquiry!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw an inquiry!\n");
/*
* Validate the command. We don't
* support any VPD pages, so complain
@@ -1285,9 +1184,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
fill_sense(sense, SSD_CURRENT_ERROR,
SSD_KEY_NO_SENSE, 0x00,
0x00);
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("No pending CA!\n"));
+ xpt_print_path(periph->path);
+ printf("No pending CA!\n");
} else if (pending_ca == CA_UNIT_ATTN) {
u_int ascq;
@@ -1298,9 +1196,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
fill_sense(sense, SSD_CURRENT_ERROR,
SSD_KEY_UNIT_ATTENTION,
0x29, ascq);
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Pending UA!\n"));
+ xpt_print_path(periph->path);
+ printf("Pending UA!\n");
}
/*
* Direction is always relative
@@ -1334,9 +1231,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
atio->ccb_h.flags &= ~CAM_DIR_MASK;
if (cdb[0] == SEND) {
atio->ccb_h.flags |= CAM_DIR_OUT;
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Saw a SEND!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw a SEND!\n");
atio->ccb_h.flags |= CAM_DIR_OUT;
TAILQ_INSERT_TAIL(&softc->snd_ccb_queue,
&atio->ccb_h,
@@ -1344,9 +1240,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
selwakeup(&softc->snd_select);
} else {
atio->ccb_h.flags |= CAM_DIR_IN;
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Saw a RECEIVE!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw a RECEIVE!\n");
TAILQ_INSERT_TAIL(&softc->rcv_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
@@ -1389,8 +1284,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
struct targ_cmd_desc *desc;
struct buf *bp;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Received completed CTIO\n"));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Received completed CTIO\n");
atio = (struct ccb_accept_tio*)done_ccb->ccb_h.ccb_atio;
desc = (struct targ_cmd_desc *)atio->ccb_h.ccb_descr;
@@ -1404,9 +1299,9 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
bp->b_resid -= desc->data_increment;
bp->b_error = 0;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Buffer I/O Completed - Resid %ld:%d\n",
- bp->b_resid, desc->data_resid));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Buffer I/O Completed - Resid %ld:%d\n",
+ bp->b_resid, desc->data_resid);
/*
* Send the buffer back to the client if
* either the command has completed or all
@@ -1418,8 +1313,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
/* Short transfer */
bp->b_flags |= B_ERROR;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Completing a buffer\n"));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Completing a buffer\n");
biodone(bp);
desc->bp = NULL;
}
@@ -1433,26 +1328,22 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
* Send the original accept TIO back to the
* controller to handle more work.
*/
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Returning ATIO to target\n"));
+ xpt_print_path(atio->ccb_h.path);
+ printf("Returning ATIO to target\n");
xpt_action((union ccb *)atio);
break;
}
+ if (desc->bp != NULL)
+ panic("targ%d: desc->bp should be NULL",
+ periph->unit_number);
+
/* Queue us up for another buffer */
if (atio->cdb_io.cdb_bytes[0] == SEND) {
- if (desc->bp != NULL)
- TAILQ_INSERT_HEAD(
- &softc->snd_buf_queue.queue,
- bp, b_act);
TAILQ_INSERT_HEAD(&softc->snd_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
} else {
- if (desc->bp != NULL)
- TAILQ_INSERT_HEAD(
- &softc->rcv_buf_queue.queue,
- bp, b_act);
TAILQ_INSERT_HEAD(&softc->rcv_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
@@ -1472,9 +1363,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
}
case XPT_IMMED_NOTIFY:
{
- if (softc->state == TARG_STATE_TEARDOWN
- || done_ccb->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an immediate notify\n");
+ if (softc->state == TARG_STATE_TEARDOWN) {
free(done_ccb, M_DEVBUF);
}
break;
@@ -1552,7 +1441,7 @@ allocdescr()
static void
freedescr(struct targ_cmd_desc *descr)
{
- free(descr->backing_store, M_DEVBUF);
+ free(descr->data, M_DEVBUF);
free(descr, M_DEVBUF);
}
diff --git a/sys/coda/00READ b/sys/coda/00READ
index ef554177daf0..29e45b1a008f 100644
--- a/sys/coda/00READ
+++ b/sys/coda/00READ
@@ -1,3 +1,14 @@
+NOTE: The matching user level code has not been released
+ yet. It will be available soon. The existing released
+ Coda code is not quite ready for current. We'll
+ have some patches out soon.
+
+BUG: There is a bug in file mapping/executing. When a file is
+ first created in Coda, it can not be executed. But after
+ you restart Coda (unmount/mount -- actually vutil -shutdown),
+ you can run the file just fine. I haven't had time to look
+ for this problem yet.
+
WARNING:
A version of this code has run on stable for a while now.
The code has been recently ported to current. It is mostly
diff --git a/sys/coda/cnode.h b/sys/coda/cnode.h
index bf6f632b8b7c..bd93389c7502 100644
--- a/sys/coda/cnode.h
+++ b/sys/coda/cnode.h
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: cnode.h,v 1.4 1998/09/13 13:57:59 rvb Exp $
+ * $Id: cnode.h,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
@@ -47,9 +47,6 @@
/*
* HISTORY
* $Log: cnode.h,v $
- * Revision 1.4 1998/09/13 13:57:59 rvb
- * Finish conversion of cfs -> coda
- *
* Revision 1.3 1998/09/11 18:50:17 rvb
* All the references to cfs, in symbols, structs, and strings
* have been changed to coda. (Same for CFS.)
@@ -297,20 +294,19 @@ enum dc_status {
};
/* cfs_psdev.h */
-extern int coda_call(struct coda_mntinfo *mntinfo, int inSize, int *outSize, caddr_t buffer);
-extern int coda_kernel_version;
+int coda_call(struct coda_mntinfo *mntinfo, int inSize, int *outSize, caddr_t buffer);
/* cfs_subr.h */
-extern int handleDownCall(int opcode, union outputArgs *out);
-extern void coda_unmounting(struct mount *whoIam);
-extern int coda_vmflush(struct cnode *cp);
+int handleDownCall(int opcode, union outputArgs *out);
+void coda_unmounting(struct mount *whoIam);
+int coda_vmflush(struct cnode *cp);
/* cfs_vnodeops.h */
-extern struct cnode *make_coda_node(ViceFid *fid, struct mount *vfsp, short type);
-extern int coda_vnodeopstats_init(void);
+struct cnode *make_coda_node(ViceFid *fid, struct mount *vfsp, short type);
+int coda_vnodeopstats_init(void);
/* coda_vfsops.h */
-extern struct mount *devtomp(dev_t dev);
+struct mount *devtomp(dev_t dev);
/* sigh */
#define CODA_RDWR ((u_long) 31)
diff --git a/sys/coda/coda.h b/sys/coda/coda.h
index 7b67ea9245bd..8e77c20d230f 100644
--- a/sys/coda/coda.h
+++ b/sys/coda/coda.h
@@ -27,11 +27,10 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda.h,v 1.5 1998/10/28 19:33:49 rvb Exp $
+ * $Id: coda.h,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
-
/*
*
* Based on cfs.h from Mach, but revamped for increased simplicity.
@@ -41,51 +40,17 @@
#ifndef _CODA_HEADER_
#define _CODA_HEADER_
-
-
/* Catch new _KERNEL defn for NetBSD */
#ifdef __NetBSD__
#include <sys/types.h>
#endif
-#ifndef CODA_MAXSYMLINKS
-#define CODA_MAXSYMLINKS 10
-#endif
-
-#if defined(DJGPP) || defined(__CYGWIN32__)
-#ifdef KERNEL
-typedef unsigned long u_long;
-typedef unsigned int u_int;
-typedef unsigned short u_short;
-typedef u_long ino_t;
-typedef u_long dev_t;
-typedef void * caddr_t;
-#ifdef DOS
-typedef unsigned __int64 u_quad_t;
-#else
-typedef unsigned long long u_quad_t;
-#endif
-
-#define inline
-
-struct timespec {
- long ts_sec;
- long ts_nsec;
-};
-#else /* DJGPP but not KERNEL */
-#include <sys/types.h>
-#include <sys/time.h>
-typedef unsigned long long u_quad_t;
-#endif /* !KERNEL */
-#endif /* !DJGPP */
-
-
-#if defined(__linux__)
+#if defined(__linux__) || defined(__CYGWIN32__)
#define cdev_t u_quad_t
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
#define _UQUAD_T_ 1
typedef unsigned long long u_quad_t;
-#endif
+#endif
#else
#define cdev_t dev_t
#endif
@@ -100,7 +65,7 @@ struct timespec {
/*
- * Cfs constants
+ * Coda constants
*/
#define CODA_MAXNAMLEN 255
#define CODA_MAXPATHLEN 1024
@@ -113,14 +78,12 @@ struct timespec {
#define C_O_WRITE 0x002
#define C_O_TRUNC 0x010
#define C_O_EXCL 0x100
-#define C_O_CREAT 0x200
/* these are to find mode bits in Venus */
#define C_M_READ 00400
#define C_M_WRITE 00200
/* for access Venus will use */
-#define C_A_C_OK 8 /* Test for writing upon create. */
#define C_A_R_OK 4 /* Test for read permission. */
#define C_A_W_OK 2 /* Test for write permission. */
#define C_A_X_OK 1 /* Test for execute permission. */
@@ -145,13 +108,13 @@ struct venus_dirent {
* File types
*/
#define CDT_UNKNOWN 0
-#define CDT_FIFO 1
+#define CDT_FIFO 1
#define CDT_CHR 2
#define CDT_DIR 4
#define CDT_BLK 6
#define CDT_REG 8
#define CDT_LNK 10
-#define CDT_SOCK 12
+#define CDT_SOCK 12
#define CDT_WHT 14
/*
@@ -179,40 +142,32 @@ typedef struct ViceFid {
} ViceFid;
#endif /* VICEFID */
-
-#ifdef __linux__
-static __inline__ ino_t coda_f2i(struct ViceFid *fid)
+#ifdef __linux__
+static inline ino_t coda_f2i(struct ViceFid *fid)
{
- if ( ! fid )
- return 0;
- if (fid->Vnode == 0xfffffffe || fid->Vnode == 0xffffffff)
- return ((fid->Volume << 20) | (fid->Unique & 0xfffff));
- else
- return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
+ if ( fid ) {
+ return (fid->Unique + (fid->Vnode << 10) + (fid->Volume << 20));
+ } else {
+ return 0;
+ }
}
-
-#else
-#define coda_f2i(fid)\
- ((fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0)
-#endif
-
-
-#ifndef __BIT_TYPES_DEFINED__
-#define u_int32_t unsigned int
#endif
-
#ifndef _VUID_T_
#define _VUID_T_
-typedef u_int32_t vuid_t;
-typedef u_int32_t vgid_t;
+typedef u_long vuid_t;
+typedef u_long vgid_t;
#endif /*_VUID_T_ */
#ifndef _CODACRED_T_
#define _CODACRED_T_
struct coda_cred {
vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
- vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+ vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#else
+ vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#endif
};
#endif
@@ -224,7 +179,7 @@ struct coda_cred {
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
struct coda_vattr {
- int va_type; /* vnode type (for create) */
+ enum coda_vtype va_type; /* vnode type (for create) */
u_short va_mode; /* files access mode and type */
short va_nlink; /* number of references to file */
vuid_t va_uid; /* owner user id */
@@ -248,38 +203,36 @@ struct coda_vattr {
* Kernel <--> Venus communications.
*/
-#define CODA_ROOT 2
-#define CODA_SYNC 3
-#define CODA_OPEN 4
-#define CODA_CLOSE 5
-#define CODA_IOCTL 6
-#define CODA_GETATTR 7
-#define CODA_SETATTR 8
-#define CODA_ACCESS 9
-#define CODA_LOOKUP 10
-#define CODA_CREATE 11
-#define CODA_REMOVE 12
-#define CODA_LINK 13
-#define CODA_RENAME 14
-#define CODA_MKDIR 15
-#define CODA_RMDIR 16
-#define CODA_READDIR 17
-#define CODA_SYMLINK 18
-#define CODA_READLINK 19
-#define CODA_FSYNC 20
-#define CODA_INACTIVE 21
-#define CODA_VGET 22
-#define CODA_SIGNAL 23
-#define CODA_REPLACE 24
-#define CODA_FLUSH 25
-#define CODA_PURGEUSER 26
-#define CODA_ZAPFILE 27
-#define CODA_ZAPDIR 28
-#define CODA_PURGEFID 30
-#define CODA_OPEN_BY_PATH 31
-#define CODA_RESOLVE 32
-#define CODA_REINTEGRATE 33
-#define CODA_NCALLS 34
+#define CODA_ROOT ((u_long) 2)
+#define CODA_SYNC ((u_long) 3)
+#define CODA_OPEN ((u_long) 4)
+#define CODA_CLOSE ((u_long) 5)
+#define CODA_IOCTL ((u_long) 6)
+#define CODA_GETATTR ((u_long) 7)
+#define CODA_SETATTR ((u_long) 8)
+#define CODA_ACCESS ((u_long) 9)
+#define CODA_LOOKUP ((u_long) 10)
+#define CODA_CREATE ((u_long) 11)
+#define CODA_REMOVE ((u_long) 12)
+#define CODA_LINK ((u_long) 13)
+#define CODA_RENAME ((u_long) 14)
+#define CODA_MKDIR ((u_long) 15)
+#define CODA_RMDIR ((u_long) 16)
+#define CODA_READDIR ((u_long) 17)
+#define CODA_SYMLINK ((u_long) 18)
+#define CODA_READLINK ((u_long) 19)
+#define CODA_FSYNC ((u_long) 20)
+#define CODA_INACTIVE ((u_long) 21)
+#define CODA_VGET ((u_long) 22)
+#define CODA_SIGNAL ((u_long) 23)
+#define CODA_REPLACE ((u_long) 24)
+#define CODA_FLUSH ((u_long) 25)
+#define CODA_PURGEUSER ((u_long) 26)
+#define CODA_ZAPFILE ((u_long) 27)
+#define CODA_ZAPDIR ((u_long) 28)
+#define CODA_ZAPVNODE ((u_long) 29)
+#define CODA_PURGEFID ((u_long) 30)
+#define CODA_NCALLS 31
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
@@ -287,15 +240,7 @@ struct coda_vattr {
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
VC_MAXDATASIZE
-#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int))
-#if 0
- /* don't care about kernel version number */
-#define CODA_KERNEL_VERSION 0
- /* The old venus 4.6 compatible interface */
-#define CODA_KERNEL_VERSION 1
-#endif
- /* venus_lookup gets an extra parameter to aid windows.*/
-#define CODA_KERNEL_VERSION 2
+
/*
* Venus <-> Coda RPC arguments
@@ -405,17 +350,11 @@ struct coda_access_out {
struct coda_out_hdr out;
};
-
-/* lookup flags */
-#define CLU_CASE_SENSITIVE 0x01
-#define CLU_CASE_INSENSITIVE 0x02
-
/* coda_lookup: */
struct coda_lookup_in {
struct coda_in_hdr ih;
ViceFid VFid;
int name; /* Place holder for data. */
- int flags;
};
struct coda_lookup_out {
@@ -641,22 +580,10 @@ struct coda_replace_out { /* coda_replace is a venus->kernel call */
ViceFid OldFid;
};
-/* coda_open_by_path: */
-struct coda_open_by_path_in {
- struct coda_in_hdr ih;
- ViceFid VFid;
- int flags;
-};
-
-struct coda_open_by_path_out {
- struct coda_out_hdr oh;
- int path;
-};
-
/*
- * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
- * For instance, if the fid is inconsistent.
- * This case is handled by setting the top bit of the type result parameter.
+ * Occasionally, don't cache the fid returned by CODA_LOOKUP. For instance, if
+ * the fid is inconsistent. This case is handled by setting the top bit of the
+ * return result parameter.
*/
#define CODA_NOCACHE 0x80000000
@@ -682,7 +609,6 @@ union inputArgs {
struct coda_inactive_in coda_inactive;
struct coda_vget_in coda_vget;
struct coda_rdwr_in coda_rdwr;
- struct coda_open_by_path_in coda_open_by_path;
};
union outputArgs {
@@ -704,7 +630,6 @@ union outputArgs {
struct coda_purgefid_out coda_purgefid;
struct coda_rdwr_out coda_rdwr;
struct coda_replace_out coda_replace;
- struct coda_open_by_path_out coda_open_by_path;
};
union coda_downcalls {
@@ -730,20 +655,11 @@ struct ViceIoctl {
short out_size; /* Maximum size of output buffer, <= 2K */
};
-#if defined(__CYGWIN32__) || defined(DJGPP)
struct PioctlData {
- unsigned long cmd;
const char *path;
int follow;
struct ViceIoctl vi;
};
-#else
-struct PioctlData {
- const char *path;
- int follow;
- struct ViceIoctl vi;
-};
-#endif
#define CODA_CONTROL ".CONTROL"
#define CODA_CONTROLLEN 8
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c
index 66bfe07f6299..8d407ae5e696 100644
--- a/sys/coda/coda_fbsd.c
+++ b/sys/coda/coda_fbsd.c
@@ -27,12 +27,16 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_fbsd.c,v 1.10 1999/01/05 18:49:49 eivind Exp $
+ * $Id: coda_fbsd.c,v 1.6 1998/09/28 20:52:57 rvb Exp $
*
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include "vcoda.h"
#include "opt_devfs.h"
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -80,58 +84,59 @@ static struct cdevsw codadevsw =
vc_nb_poll, nommap, NULL, "Coda", NULL, -1
};
+void vcattach __P((void));
+static dev_t codadev;
+
int vcdebug = 1;
#define VCDEBUG if (vcdebug) printf
-static int
-codadev_modevent(module_t mod, int type, void *data)
+void
+vcattach(void)
+{
+ /*
+ * In case we are an LKM, set up device switch.
+ */
+ if (0 == (codadev = makedev(VC_DEV_NO, 0)))
+ VCDEBUG("makedev returned null\n");
+ else
+ VCDEBUG("makedev OK.\n");
+
+ cdevsw_add(&codadev, &codadevsw, NULL);
+ VCDEBUG("coda: codadevsw entry installed at %d.\n", major(codadev));
+}
+
+static vc_devsw_installed = 0;
+static void vc_drvinit __P((void *unused));
+
+static void
+vc_drvinit(void *unused)
{
dev_t dev;
#ifdef DEVFS
int i;
#endif
- static struct cdevsw *oldcdevsw;
- switch (type) {
- case MOD_LOAD:
+ if( ! vc_devsw_installed ) {
dev = makedev(VC_DEV_NO, 0);
- cdevsw_add(&dev,&codadevsw, &oldcdevsw);
+ cdevsw_add(&dev,&codadevsw, NULL);
+ vc_devsw_installed = 1;
+ }
#ifdef DEVFS
- /* tmp */
+ /* tmp */
#undef NVCODA
#define NVCODA 1
- for (i = 0; i < NVCODA; i++) {
- cfs_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "cfs%d", i);
- coda_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "coda%d", i);
- }
-#endif
- break;
- case MOD_UNLOAD:
-#ifdef DEVFS
- for (i = 0; i < NVCODA; i++) {
- devfs_remove_dev(cfs_devfs_token[i]);
- devfs_remove_dev(coda_devfs_token[i]);
- }
-#endif
- cdevsw_add(&dev, oldcdevsw, NULL);
- break;
- default:
- break;
+ for (i = 0; i < NVCODA; i++) {
+ cfs_devfs_token[i] =
+ devfs_add_devswf(&codadevsw, i,
+ DV_CHR, UID_ROOT, GID_WHEEL, 0666,
+ "cfs%d", i);
+ coda_devfs_token[i] =
+ devfs_add_devswf(&codadevsw, i,
+ DV_CHR, UID_ROOT, GID_WHEEL, 0666,
+ "coda%d", i);
}
- return 0;
+#endif
}
-static moduledata_t codadev_mod = {
- "codadev",
- codadev_modevent,
- NULL
-};
-DECLARE_MODULE(codadev, codadev_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+VC_DEV_NO);
int
coda_fbsd_getpages(v)
@@ -172,7 +177,7 @@ printf("coda_getp: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_getpage: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -214,3 +219,57 @@ coda_fbsd_putpages(v)
return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count,
ap->a_sync, ap->a_rtvals);
}
+
+
+SYSINIT(codadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+VC_DEV_NO,vc_drvinit,NULL)
+
+#ifdef VFS_LKM
+
+#include <sys/mount.h>
+#include <sys/lkm.h>
+
+extern struct vfsops coda_vfsops;
+
+static struct vfsconf _fs_vfsconf = { &coda_vfsops, "coda", -1, 0, 0 };
+
+extern struct linker_set coda_modvnops ;
+
+static struct lkm_vfs coda_mod_vfs = {
+ LM_VFS, LKM_VERSION, "coda", 0, &coda_modvnops, &_fs_vfsconf };
+
+static struct lkm_dev coda_mod_dev = {
+ LM_DEV, LKM_VERSION, "codadev", VC_DEV_NO, LM_DT_CHAR, (void *) &codadevsw};
+
+int coda_mod(struct lkm_table *, int, int);
+int
+coda_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ int error = 0;
+
+ if (ver != LKM_VERSION)
+ return EINVAL;
+
+ switch (cmd) {
+ case LKM_E_LOAD:
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_dev;
+ error = lkmdispatch(lkmtp, cmd);
+ if (error)
+ break;
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_vfs ;
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ case LKM_E_UNLOAD:
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_vfs ;
+ error = lkmdispatch(lkmtp, cmd);
+ if (error)
+ break;
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_dev;
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ case LKM_E_STAT:
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ }
+ return error;
+}
+#endif
diff --git a/sys/coda/coda_namecache.c b/sys/coda/coda_namecache.c
index 2da7b096896d..d66f1151a63d 100644
--- a/sys/coda/coda_namecache.c
+++ b/sys/coda/coda_namecache.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_namecache.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_namecache.c,v 1.7 1998/09/28 20:52:58 rvb Exp $
+ * $Id: coda_namecache.c,v 1.6 1998/09/25 17:38:31 rvb Exp $
*
*/
@@ -47,9 +47,6 @@
/*
* HISTORY
* $Log: coda_namecache.c,v $
- * Revision 1.7 1998/09/28 20:52:58 rvb
- * Cleanup and fix THE bug
- *
* Revision 1.6 1998/09/25 17:38:31 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -705,7 +702,7 @@ coda_nc_purge_user(uid, dcstat)
return;
CODA_NC_DEBUG(CODA_NC_PURGEUSER,
- myprintf(("ZapDude: uid %x\n", uid)); )
+ myprintf(("ZapDude: uid %lx\n", uid)); )
coda_nc_stat.zapUsers++;
for (cncp = CODA_NC_LRUGET(coda_nc_lru);
diff --git a/sys/coda/coda_psdev.c b/sys/coda/coda_psdev.c
index 0d29f6e1d737..3abbff04878a 100644
--- a/sys/coda/coda_psdev.c
+++ b/sys/coda/coda_psdev.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_psdev.c,v 1.9 1998/11/11 20:32:20 rvb Exp $
+ * $Id: coda_psdev.c,v 1.6 1998/09/28 20:52:58 rvb Exp $
*
*/
@@ -53,25 +53,6 @@
/*
* HISTORY
* $Log: coda_psdev.c,v $
- * Revision 1.9 1998/11/11 20:32:20 rvb
- * coda_lookup now passes up an extra flag. But old veni will
- * be ok; new veni will check /dev/cfs0 to make sure that a new
- * kernel is running.
- * Also, a bug in vc_nb_close iff CODA_SIGNAL's were seen has been
- * fixed.
- *
- * Revision 1.8 1998/10/28 20:31:13 rvb
- * Change the way unmounting happens to guarantee that the
- * client programs are allowed to finish up (coda_call is
- * forced to complete) and release their locks. Thus there
- * is a reasonable chance that the vflush implicit in the
- * unmount will not get hung on held locks.
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/28 20:52:58 rvb
* Cleanup and fix THE bug
*
@@ -188,7 +169,11 @@
extern int coda_nc_initialized; /* Set if cache has been initialized */
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -210,13 +195,6 @@ extern int coda_nc_initialized; /* Set if cache has been initialized */
#define CTL_C
int coda_psdev_print_entry = 0;
-static
-int outstanding_upcalls = 0;
-int coda_call_sleep = PZERO - 1;
-#ifdef CTL_C
-int coda_pcatch = PCATCH;
-#else
-#endif
#define ENTRY if(coda_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
@@ -284,7 +262,7 @@ vc_nb_close (dev, flag, mode, p)
struct proc *p;
{
register struct vcomm *vcp;
- register struct vmsg *vmp, *nvmp = NULL;
+ register struct vmsg *vmp;
struct coda_mntinfo *mi;
int err;
@@ -305,23 +283,21 @@ vc_nb_close (dev, flag, mode, p)
* Put this before WAKEUPs to avoid queuing new messages between
* the WAKEUP and the unmount (which can happen if we're unlucky)
*/
- if (!mi->mi_rootvp) {
- /* just a simple open/close w no mount */
- MARK_VC_CLOSED(vcp);
- return 0;
+ if (mi->mi_rootvp) {
+ /* Let unmount know this is for real */
+ VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
+ coda_unmounting(mi->mi_vfsp);
+ err = dounmount(mi->mi_vfsp, flag, p);
+ if (err)
+ myprintf(("Error %d unmounting vfs in vcclose(%d)\n",
+ err, minor(dev)));
}
-
- /* Let unmount know this is for real */
- VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
- coda_unmounting(mi->mi_vfsp);
-
- outstanding_upcalls = 0;
+
/* Wakeup clients so they can return. */
for (vmp = (struct vmsg *)GETNEXT(vcp->vc_requests);
!EOQ(vmp, vcp->vc_requests);
- vmp = nvmp)
- {
- nvmp = (struct vmsg *)GETNEXT(vmp->vm_chain);
+ vmp = (struct vmsg *)GETNEXT(vmp->vm_chain))
+ {
/* Free signal request messages and don't wakeup cause
no one is waiting. */
if (vmp->vm_opcode == CODA_SIGNAL) {
@@ -329,34 +305,18 @@ vc_nb_close (dev, flag, mode, p)
CODA_FREE((caddr_t)vmp, (u_int)sizeof(struct vmsg));
continue;
}
- outstanding_upcalls++;
+
wakeup(&vmp->vm_sleep);
}
-
+
for (vmp = (struct vmsg *)GETNEXT(vcp->vc_replys);
!EOQ(vmp, vcp->vc_replys);
vmp = (struct vmsg *)GETNEXT(vmp->vm_chain))
{
- outstanding_upcalls++;
wakeup(&vmp->vm_sleep);
}
-
+
MARK_VC_CLOSED(vcp);
-
- if (outstanding_upcalls) {
-#ifdef CODA_VERBOSE
- printf("presleep: outstanding_upcalls = %d\n", outstanding_upcalls);
- (void) tsleep(&outstanding_upcalls, coda_call_sleep, "coda_umount", 0);
- printf("postsleep: outstanding_upcalls = %d\n", outstanding_upcalls);
-#else
- (void) tsleep(&outstanding_upcalls, coda_call_sleep, "coda_umount", 0);
-#endif
- }
-
- err = dounmount(mi->mi_vfsp, flag, p);
- if (err)
- myprintf(("Error %d unmounting vfs in vcclose(%d)\n",
- err, minor(dev)));
return 0;
}
@@ -546,22 +506,6 @@ vc_nb_ioctl(dev, cmd, addr, flag, p)
return(ENODEV);
}
break;
- case CIOC_KERNEL_VERSION:
- switch (*(u_int *)addr) {
- case 0:
- *(u_int *)addr = coda_kernel_version;
- return 0;
- break;
- case 1:
- case 2:
- if (coda_kernel_version != *(u_int *)addr)
- return ENOENT;
- else
- return 0;
- default:
- return ENOENT;
- }
- break;
default :
return(EINVAL);
break;
@@ -610,6 +554,12 @@ struct coda_clstat coda_clstat;
* (e.g. kill -9).
*/
+int coda_call_sleep = PZERO - 1;
+#ifdef CTL_C
+int coda_pcatch = PCATCH;
+#else
+#endif
+
int
coda_call(mntinfo, inSize, outSize, buffer)
struct coda_mntinfo *mntinfo; int inSize; int *outSize; caddr_t buffer;
@@ -687,11 +637,6 @@ coda_call(mntinfo, inSize, outSize, buffer)
#ifdef CODA_VERBOSE
printf("coda_call: tsleep returns %d SIGIO, cnt %d\n", error, i);
#endif
- } else if (p->p_siglist == sigmask(SIGALRM)) {
- p->p_sigmask |= p->p_siglist;
-#ifdef CODA_VERBOSE
- printf("coda_call: tsleep returns %d SIGALRM, cnt %d\n", error, i);
-#endif
} else {
printf("coda_call: tsleep returns %d, cnt %d\n", error, i);
printf("coda_call: siglist = %x, sigmask = %x, mask %x\n",
@@ -705,7 +650,7 @@ coda_call(mntinfo, inSize, outSize, buffer)
p->p_siglist & ~p->p_sigmask);
#endif
}
- } while (error && i++ < 128 && VC_OPEN(vcp));
+ } while (error && i++ < 128);
p->p_sigmask = psig_omask;
#else
(void) tsleep(&vmp->vm_sleep, coda_call_sleep, "coda_call", 0);
@@ -779,9 +724,6 @@ coda_call(mntinfo, inSize, outSize, buffer)
CODA_FREE(vmp, sizeof(struct vmsg));
- if (outstanding_upcalls > 0 && (--outstanding_upcalls == 0))
- wakeup(&outstanding_upcalls);
-
if (!error)
error = ((struct coda_out_hdr *)buffer)->result;
return(error);
diff --git a/sys/coda/coda_subr.c b/sys/coda/coda_subr.c
index 40d2d0b0b1a4..d24b5d602e2e 100644
--- a/sys/coda/coda_subr.c
+++ b/sys/coda/coda_subr.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_subr.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_subr.c,v 1.8 1998/10/28 19:33:50 rvb Exp $
+ * $Id: coda_subr.c,v 1.6 1998/09/25 17:38:31 rvb Exp $
*
*/
@@ -46,17 +46,6 @@
/*
* HISTORY
* $Log: coda_subr.c,v $
- * Revision 1.8 1998/10/28 19:33:50 rvb
- * Venus must be passed O_CREAT flag on VOP_OPEN iff this is
- * a creat so that we can will allow a mode 444 file to be
- * written into. Sync with the latest coda.h and deal with
- * collateral damage.
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/25 17:38:31 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -229,7 +218,11 @@
* 4. coda_cacheprint (under DEBUG) prints names with vnode/cnode address
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -632,6 +625,22 @@ int handleDownCall(opcode, out)
return(0);
}
+ case CODA_ZAPVNODE : {
+ coda_clstat.ncalls++;
+ coda_clstat.reqs[CODA_ZAPVNODE]++;
+
+ myprintf(("CODA_ZAPVNODE: Called, but uniplemented\n"));
+ /*
+ * Not that below we must really translate the returned coda_cred to
+ * a netbsd cred. This is a bit muddled at present and the cfsnc_zapnode
+ * is further unimplemented, so punt!
+ * I suppose we could use just the uid.
+ */
+ /* coda_nc_zapvnode(&out->coda_zapvnode.VFid, &out->coda_zapvnode.cred,
+ IS_DOWNCALL); */
+ return(0);
+ }
+
case CODA_PURGEFID : {
struct cnode *cp;
diff --git a/sys/coda/coda_venus.c b/sys/coda/coda_venus.c
index 96228f1737aa..25dceeb1af76 100644
--- a/sys/coda/coda_venus.c
+++ b/sys/coda/coda_venus.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/cfs/coda_venus.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_venus.c,v 1.5 1998/10/28 19:33:50 rvb Exp $
+ * $Id: coda_venus.c,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
@@ -112,7 +112,6 @@
if (from & FWRITE) to |= C_O_WRITE; \
if (from & O_TRUNC) to |= C_O_TRUNC; \
if (from & O_EXCL) to |= C_O_EXCL; \
- if (from & O_CREAT) to |= C_O_CREAT; \
} while (0)
#define CNV_VV2V_ATTR(top, fromp) \
@@ -159,8 +158,6 @@
} while (0)
-int coda_kernel_version = CODA_KERNEL_VERSION;
-
int
venus_root(void *mdp,
struct ucred *cred, struct proc *p,
@@ -410,17 +407,7 @@ venus_lookup(void *mdp, ViceFid *fid,
INIT_IN(&inp->ih, CODA_LOOKUP, cred, p);
inp->VFid = *fid;
- /* NOTE:
- * Between version 1 and version 2 we have added an extra flag field
- * to this structure. But because the string was at the end and because
- * of the wierd way we represent strings by having the slot point to
- * where the string characters are in the "heap", we can just slip the
- * flag parameter in after the string slot pointer and veni that don't
- * know better won't see this new flag field ...
- * Otherwise we'd need two different venus_lookup functions.
- */
inp->name = Isize;
- inp->flags = CLU_CASE_SENSITIVE; /* doesn't really matter for BSD */
STRCPY(name, nm, len); /* increments Isize */
error = coda_call(mdp, Isize, &Osize, (char *)inp);
diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c
index 8f6befec3e93..835af3763e2f 100644
--- a/sys/coda/coda_vfsops.c
+++ b/sys/coda/coda_vfsops.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_vfsops.c,v 1.10 1998/12/04 22:54:43 archie Exp $
+ * $Id: coda_vfsops.c,v 1.6 1998/09/25 17:38:32 rvb Exp $
*
*/
@@ -47,37 +47,6 @@
/*
* HISTORY
* $Log: coda_vfsops.c,v $
- * Revision 1.10 1998/12/04 22:54:43 archie
- * Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
- * for possible buffer overflow problems. Replaced most sprintf()'s
- * with snprintf(); for others cases, added terminating NUL bytes where
- * appropriate, replaced constants like "16" with sizeof(), etc.
- *
- * These changes include several bug fixes, but most changes are for
- * maintainability's sake. Any instance where it wasn't "immediately
- * obvious" that a buffer overflow could not occur was made safer.
- *
- * Reviewed by: Bruce Evans <bde@zeta.org.au>
- * Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
- * Reviewed by: Mike Spengler <mks@networkcs.com>
- *
- * Revision 1.9 1998/11/16 19:48:26 rvb
- * A few bug fixes for Robert Watson
- *
- * Revision 1.8 1998/11/03 08:55:06 peter
- * Support KLD. We register and unregister two modules. "coda" (the vfs)
- * via VFS_SET(), and "codadev" for the cdevsw entry. From kldstat -v:
- * 3 1 0xf02c5000 115d8 coda.ko
- * Contains modules:
- * Id Name
- * 2 codadev
- * 3 coda
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/25 17:38:32 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -221,7 +190,11 @@
*
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -449,7 +422,6 @@ coda_unmount(vfsp, mntflags, p)
vrele(mi->mi_rootvp);
active = coda_kill(vfsp, NOT_DOWNCALL);
- mi->mi_rootvp->v_flag &= ~VROOT;
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
printf("coda_unmount: active = %d, vflush active %d\n", active, error);
error = 0;
@@ -529,7 +501,7 @@ coda_root(vfsp, vpp)
MARK_INT_SAT(CODA_ROOT_STATS);
goto exit;
- } else if (error == ENODEV || error == EINTR) {
+ } else if (error == ENODEV) {
/* Gross hack here! */
/*
* If Venus fails to respond to the CODA_ROOT call, coda_call returns
@@ -605,8 +577,8 @@ coda_nb_statfs(vfsp, sbp, p)
sbp->f_files = NB_SFS_SIZ;
sbp->f_ffree = NB_SFS_SIZ;
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
- snprintf(sbp->f_mntonname, sizeof(sbp->f_mntonname), "/coda");
- snprintf(sbp->f_mntfromname, sizeof(sbp->f_mntfromname), "CODA");
+ strcpy(sbp->f_mntonname, "/coda");
+ strcpy(sbp->f_mntfromname, "CODA");
/* MARK_INT_SAT(CODA_STATFS_STATS); */
return(0);
}
@@ -767,4 +739,11 @@ struct vfsops coda_vfsops = {
coda_init,
};
+#ifdef VFS_LKM
+/*
+ * This case is being handled in coda_fbsd.c
+ * What we want is too hairy for VFS_SET to get right!
+ */
+#else
VFS_SET(coda_vfsops, coda, VFCF_NETWORK);
+#endif
diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c
index c0cfa5e00f92..420ef3c515b8 100644
--- a/sys/coda/coda_vnops.c
+++ b/sys/coda/coda_vnops.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_vnops.c,v 1.12 1999/01/07 16:14:12 bde Exp $
+ * $Id: coda_vnops.c,v 1.5 1998/09/25 17:38:32 rvb Exp $
*
*/
@@ -48,34 +48,6 @@
/*
* HISTORY
* $Log: coda_vnops.c,v $
- * Revision 1.12 1999/01/07 16:14:12 bde
- * Don't pass unused unused timestamp args to UFS_UPDATE() or waste
- * time initializing them. This almost finishes centralizing (in-core)
- * timestamp updates in ufs_itimes().
- *
- * Revision 1.11 1999/01/05 18:49:51 eivind
- * Remove the 'waslocked' parameter to vfs_object_create().
- *
- * Revision 1.10 1998/12/04 18:44:21 rvb
- * Don't print diagnostic anymore
- *
- * Revision 1.9 1998/11/16 19:48:26 rvb
- * A few bug fixes for Robert Watson
- *
- * Revision 1.8 1998/10/28 20:31:13 rvb
- * Change the way unmounting happens to guarantee that the
- * client programs are allowed to finish up (coda_call is
- * forced to complete) and release their locks. Thus there
- * is a reasonable chance that the vflush implicit in the
- * unmount will not get hung on held locks.
- *
- * Revision 1.7 1998/10/25 17:44:41 phk
- * Nitpicking and dusting performed on a train. Removes trivial warnings
- * about unused variables, labels and other lint.
- *
- * Revision 1.6 1998/09/28 20:52:58 rvb
- * Cleanup and fix THE bug
- *
* Revision 1.5 1998/09/25 17:38:32 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -370,7 +342,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = {
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee)
-#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
+#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd)
missing
{ &vop_reallocblks_desc, (vop_t *) ufs_missingop },
@@ -390,12 +362,10 @@ int
coda_vop_error(void *anon) {
struct vnodeop_desc **desc = (struct vnodeop_desc **)anon;
- myprintf(("coda_vop_error: Vnode operation %s called, but not defined.\n",
+ myprintf(("Vnode operation %s called, but not defined\n",
(*desc)->vdesc_name));
- /*
panic("coda_vop_error");
- */
- return EIO;
+ return 0;
}
/* A generic do-nothing. For lease_check, advlock */
@@ -513,7 +483,7 @@ coda_open(v)
}
/* grab (above) does this when it calls newvnode unless it's in the cache*/
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_open: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -554,12 +524,7 @@ coda_close(v)
printf("coda_close: destroying container ref %d, ufs vp %p of vp %p/cp %p\n",
vp->v_usecount, cp->c_ovp, vp, cp);
#endif
-#ifdef hmm
vgone(cp->c_ovp);
-#else
- VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */
- vrele(cp->c_ovp);
-#endif
} else {
#ifdef CODA_VERBOSE
printf("coda_close: NO container vp %p/cp %p\n", vp, cp);
@@ -673,7 +638,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_rdwr: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -1547,6 +1512,8 @@ coda_link(v)
CODADEBUG(CODA_LINK, myprintf(("in link result %d\n",error)); )
+exit:
+
/* Drop the name buffer if we don't need to SAVESTART */
if ((cnp->cn_flags & SAVESTART) == 0) {
zfree(namei_zone, cnp->cn_pnbuf);
@@ -1896,7 +1863,7 @@ printf("coda_readdir: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_readdir: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -1956,9 +1923,7 @@ coda_bmap(v)
#endif
return ret;
} else {
-#if 0
printf("coda_bmap: no container\n");
-#endif
return(EOPNOTSUPP);
}
}
@@ -2042,12 +2007,7 @@ coda_lock(v)
cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
}
-#ifndef DEBUG_LOCKS
return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p));
-#else
- return (debuglockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p,
- "coda_lock", vp->filename, vp->line));
-#endif
}
int
diff --git a/sys/conf/files b/sys/conf/files
index 795f6f833e8e..69c78b92d12d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -13,30 +13,34 @@ aic7xxx_{seq,reg}.h optional ahc device-driver \
no-obj no-implicit-rule before-depend \
clean "aic7xxx_seq.h aic7xxx_reg.h" \
dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+kern/subr_bus.c standard \
+ dependency "device_if.h bus_if.h"
device_if.o standard \
+ dependency "device_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
device_if.c standard \
- dependency "$S/kern/makedevops.pl $S/kern/device_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/kern/device_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/device_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/kern/device_if.m" \
no-obj no-implicit-rule before-depend local \
clean "device_if.c"
device_if.h standard \
- dependency "$S/kern/makedevops.pl $S/kern/device_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/kern/device_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/device_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/kern/device_if.m" \
no-obj no-implicit-rule before-depend \
clean "device_if.h"
bus_if.o standard \
+ dependency "bus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
bus_if.c standard \
- dependency "$S/kern/makedevops.pl $S/kern/bus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/kern/bus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/bus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/kern/bus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "bus_if.c"
bus_if.h standard \
- dependency "$S/kern/makedevops.pl $S/kern/bus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/kern/bus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/bus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/kern/bus_if.m" \
no-obj no-implicit-rule before-depend \
clean "bus_if.h"
coda/coda_namecache.c optional vcoda
@@ -61,7 +65,6 @@ cam/scsi/scsi_ch.c optional ch
cam/scsi/scsi_pass.c optional pass
cam/scsi/scsi_scan.c optional scan
cam/scsi/scsi_target.c optional targ
-cam/scsi/scsi_targ_bh.c optional targbh
ddb/db_access.c optional ddb
ddb/db_kld.c optional ddb
ddb/db_aout.c optional ddb
@@ -135,73 +138,44 @@ dev/ppbus/vpo.c optional vpo
dev/ppbus/vpoio.c optional vpo
dev/ppbus/immio.c optional vpo
dev/ppbus/if_plip.c optional plip
-dev/ppbus/lpbb.c optional lpbb
smbus_if.o optional smbus \
- dependency "smbus_if.c smbus_if.h" \
+ dependency "smbus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
smbus_if.c optional smbus \
- dependency "$S/kern/makedevops.pl $S/dev/smbus/smbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/smbus/smbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/smbus/smbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/smbus/smbus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "smbus_if.c"
smbus_if.h optional smbus \
- dependency "$S/kern/makedevops.pl $S/dev/smbus/smbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/smbus/smbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/smbus/smbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/smbus/smbus_if.m" \
no-obj no-implicit-rule before-depend \
clean "smbus_if.h"
dev/smbus/smbconf.c optional smbus
dev/smbus/smbus.c optional smbus
dev/smbus/smb.c optional smb
-dev/iicbus/iicbb.c optional iicbb
-iicbb_if.o optional iicbb \
- dependency "iicbb_if.c" \
- compile-with "${NORMAL_C}" \
- no-implicit-rule local
-iicbb_if.c optional iicbb \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/iicbus/iicbb_if.m" \
- no-obj no-implicit-rule before-depend local \
- clean "iicbb_if.c"
-iicbb_if.h optional iicbb \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/iicbus/iicbb_if.m" \
- no-obj no-implicit-rule before-depend \
- clean "iicbb_if.h"
-dev/iicbus/iicsmb.c optional iicsmb \
- dependency "iicbus_if.h"
+dev/iicbus/iicsmb.c optional iicsmb
iicbus_if.o optional iicbus \
- dependency "iicbus_if.c iicbus_if.h" \
+ dependency "iicbus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
iicbus_if.c optional iicbus \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/iicbus/iicbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/iicbus/iicbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/iicbus/iicbus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "iicbus_if.c"
iicbus_if.h optional iicbus \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/iicbus/iicbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/iicbus/iicbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/iicbus/iicbus_if.m" \
no-obj no-implicit-rule before-depend \
clean "iicbus_if.h"
dev/iicbus/iiconf.c optional iicbus
dev/iicbus/iicbus.c optional iicbus
dev/iicbus/if_ic.c optional ic
dev/iicbus/iic.c optional iic
-dev/vinum/vinum.c optional vinum device-driver
-dev/vinum/vinumparser.c optional vinum device-driver
-dev/vinum/vinumconfig.c optional vinum device-driver
-dev/vinum/vinumio.c optional vinum device-driver
-dev/vinum/vinumutil.c optional vinum device-driver
-dev/vinum/vinumstate.c optional vinum device-driver
-dev/vinum/vinummemory.c optional vinum device-driver
-dev/vinum/vinumrequest.c optional vinum device-driver
-dev/vinum/vinumlock.c optional vinum device-driver
-dev/vinum/vinumrevive.c optional vinum device-driver
-dev/vinum/vinumioctl.c optional vinum device-driver
-dev/vinum/vinuminterrupt.c optional vinum device-driver
-dev/vn/vn.c optional vn
-dev/vx/if_vx.c optional vx device-driver
+dev/vn/vn.c optional vn
+dev/vx/if_vx.c optional vx device-driver
gnu/ext2fs/ext2_alloc.c optional ext2fs
gnu/ext2fs/ext2_balloc.c optional ext2fs
gnu/ext2fs/ext2_inode.c optional ext2fs
@@ -212,42 +186,6 @@ gnu/ext2fs/ext2_lookup.c optional ext2fs
gnu/ext2fs/ext2_subr.c optional ext2fs
gnu/ext2fs/ext2_vfsops.c optional ext2fs
gnu/ext2fs/ext2_vnops.c optional ext2fs
-# device drivers
-i4b/driver/i4b_trace.c optional i4btrc device-driver
-i4b/driver/i4b_rbch.c optional i4brbch device-driver
-i4b/driver/i4b_tel.c optional i4btel device-driver
-i4b/driver/i4b_ipr.c optional i4bipr
-i4b/driver/i4b_ctl.c optional i4bctl device-driver
-i4b/driver/i4b_isppp.c optional i4bisppp device-driver
-net/if_spppsubr.c optional sppp
-# needed by i4bipr
-net/slcompress.c optional i4bipr
-# tina-dd control driver
-i4b/tina-dd/i4b_tina_dd.c optional tina device-driver
-# support
-i4b/layer2/i4b_mbuf.c optional i4btrc device-driver
-# Q.921 handler
-i4b/layer2/i4b_l2.c optional i4bq921
-i4b/layer2/i4b_l2fsm.c optional i4bq921
-i4b/layer2/i4b_uframe.c optional i4bq921
-i4b/layer2/i4b_tei.c optional i4bq921
-i4b/layer2/i4b_sframe.c optional i4bq921
-i4b/layer2/i4b_iframe.c optional i4bq921
-i4b/layer2/i4b_l2timer.c optional i4bq921
-i4b/layer2/i4b_util.c optional i4bq921
-i4b/layer2/i4b_lme.c optional i4bq921
-# Q.931 handler
-i4b/layer3/i4b_q931.c optional i4bq931
-i4b/layer3/i4b_l3fsm.c optional i4bq931
-i4b/layer3/i4b_l3timer.c optional i4bq931
-i4b/layer3/i4b_l2if.c optional i4bq931
-i4b/layer3/i4b_l4if.c optional i4bq931
-i4b/layer3/i4b_q932fac.c optional i4bq931
-# isdn device driver, interface to i4bd
-i4b/layer4/i4b_i4bdrv.c optional i4b device-driver
-i4b/layer4/i4b_l4.c optional i4b device-driver
-i4b/layer4/i4b_l4mgmt.c optional i4b device-driver
-i4b/layer4/i4b_l4timer.c optional i4b device-driver
isofs/cd9660/cd9660_bmap.c optional cd9660
isofs/cd9660/cd9660_lookup.c optional cd9660
isofs/cd9660/cd9660_node.c optional cd9660
@@ -276,7 +214,7 @@ kern/kern_exec.c standard
kern/kern_exit.c standard
kern/kern_fork.c standard
kern/kern_ktrace.c standard
-kern/kern_lkm.c optional lkm
+kern/kern_lkm.c standard
kern/kern_lock.c standard
kern/kern_lockf.c standard
kern/kern_malloc.c standard
@@ -290,14 +228,12 @@ kern/kern_shutdown.c standard
kern/kern_sig.c standard
kern/kern_subr.c standard
kern/kern_synch.c standard
-kern/kern_syscalls.c standard
kern/kern_sysctl.c standard
kern/kern_time.c standard
kern/kern_timeout.c standard
kern/kern_xxx.c standard
kern/md5c.c standard
kern/subr_autoconf.c standard
-kern/subr_bus.c standard
kern/subr_devstat.c standard
kern/subr_diskslice.c standard
kern/subr_dkbad.c standard
@@ -306,12 +242,10 @@ kern/subr_module.c standard
kern/subr_prf.c standard
kern/subr_prof.c standard
kern/subr_rlist.c standard
-kern/subr_scanf.c standard
kern/subr_xxx.c standard
kern/sys_generic.c standard
kern/sys_pipe.c standard
kern/sys_process.c standard
-kern/subr_rman.c standard
kern/sys_socket.c standard
kern/sysv_ipc.c standard
kern/sysv_msg.c optional sysvmsg
@@ -384,7 +318,6 @@ msdosfs/msdosfs_vfsops.c optional msdosfs
msdosfs/msdosfs_vnops.c optional msdosfs
net/bpf.c optional bpfilter
net/bpf_filter.c optional bpfilter
-net/bridge.c optional bridge
net/bsd_comp.c optional ppp_bsdcomp
#net/hostcache.c standard
net/if.c standard
@@ -435,8 +368,7 @@ netatm/ipatm/ipatm_usrreq.c optional atm_ip atm_core
netatm/ipatm/ipatm_vcm.c optional atm_ip atm_core
netatm/sigpvc/sigpvc_if.c optional atm_sigpvc atm_core
netatm/sigpvc/sigpvc_subr.c optional atm_sigpvc atm_core
-netatm/spans/spans_arp.c optional atm_spans atm_core \
- dependency "spans_xdr.h"
+netatm/spans/spans_arp.c optional atm_spans atm_core
netatm/spans/spans_cls.c optional atm_spans atm_core
netatm/spans/spans_if.c optional atm_spans atm_core
netatm/spans/spans_kxdr.c optional atm_spans atm_core
@@ -508,7 +440,6 @@ netinet/in_proto.c optional inet
netinet/in_rmx.c optional inet
netinet/ip_auth.c optional ipfilter inet
netinet/ip_divert.c optional ipdivert
-netinet/ip_dummynet.c optional dummynet
netinet/ip_fil.c optional ipfilter inet
netinet/ip_flow.c optional inet
netinet/ip_frag.c optional ipfilter inet
@@ -577,26 +508,19 @@ pci/adw_pci.c optional adw device-driver
pci/ahc_pci.c optional ahc device-driver \
dependency "aic7xxx_reg.h $S/pci/ahc_pci.c"
pci/brooktree848.c optional bktr device-driver
-pci/bt848_i2c.c optional bktr device-driver
pci/bt_pci.c optional bt device-driver
pci/dpt_pci.c optional pci dpt device-driver
pci/cy_pci.c optional cy device-driver
-pci/if_ax.c optional ax device-driver
pci/if_de.c optional de device-driver
pci/if_ed_p.c optional ed device-driver
pci/if_en_pci.c optional en device-driver
pci/if_fxp.c optional fxp device-driver
pci/if_lnc_p.c optional lnc device-driver
-pci/if_mx.c optional mx device-driver
-pci/if_pn.c optional pn device-driver
pci/if_fpa.c optional fpa device-driver
-pci/if_rl.c optional rl device-driver
pci/if_sr_p.c optional sr device-driver
pci/if_tl.c optional tl device-driver
pci/if_tx.c optional tx device-driver
-pci/if_vr.c optional vr device-driver
pci/if_vx_pci.c optional vx device-driver
-pci/if_wb.c optional wb device-driver
pci/if_xl.c optional xl device-driver
pci/isp_pci.c optional isp device-driver
pci/meteor.c optional meteor device-driver
@@ -604,6 +528,7 @@ pci/ncr.c optional ncr device-driver
pci/pci.c optional pci device-driver
pci/pci_compat.c optional pci
pci/pcisupport.c optional pci
+pci/tek390.c optional amd device-driver
pci/wdc_p.c optional wdc device-driver
pci/simos.c optional simos device-driver
pci/xrpu.c optional xrpu device-driver
@@ -654,40 +579,3 @@ vm/vm_swap.c standard
vm/vm_unix.c standard
vm/vnode_pager.c standard
vm/vm_zone.c standard
-#
-# USB support
-dev/pci/uhci_pci.c optional uhci device-driver
-dev/pci/ohci_pci.c optional ohci device-driver
-usb_if.o optional usb device-driver \
- dependency "usb_if.c" \
- compile-with "${NORMAL_C}" \
- no-implicit-rule local
-usb_if.c optional usb device-driver \
- dependency "$S/kern/makedevops.pl $S/dev/usb/usb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/usb/usb_if.m" \
- no-obj no-implicit-rule before-depend local \
- clean "usb_if.c"
-usb_if.h optional usb device-driver \
- dependency "$S/kern/makedevops.pl $S/dev/usb/usb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/usb/usb_if.m" \
- no-obj no-implicit-rule before-depend \
- clean "usb_if.h"
-dev/usb/uhci.c optional uhci device-driver
-dev/usb/ohci.c optional ohci device-driver
-dev/usb/usb.c optional usb device-driver
-dev/usb/usbdi.c optional usb device-driver
-dev/usb/usbdi_util.c optional usb device-driver
-#dev/usb/usb_mem.c optional usb device-driver
-dev/usb/usb_subr.c optional usb device-driver
-dev/usb/usb_quirks.c optional usb device-driver
-dev/usb/hid.c optional usb device-driver
-# ordering in the list of drivers below is important and should
-# be the inverse of the wanted one (MAKE_SET)
-dev/usb/ugen.c optional ugen device-driver
-dev/usb/uhid.c optional hid device-driver
-dev/usb/umodem.c optional umodem device-driver
-dev/usb/ucom.c optional ucom device-driver
-dev/usb/ums.c optional ums device-driver
-dev/usb/ulpt.c optional ulpt device-driver
-dev/usb/ukbd.c optional ukbd device-driver
-dev/usb/uhub.c optional uhub device-driver
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 0e07eb0d4178..90198060837a 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -32,11 +32,11 @@
# SUCH DAMAGE.
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-# $Id: newvers.sh,v 1.40 1998/10/16 06:55:36 jkh Exp $
+# $Id: newvers.sh,v 1.38 1998/09/19 11:45:37 jkh Exp $
TYPE="FreeBSD"
REVISION="3.0"
-BRANCH="CURRENT"
+BRANCH="RELEASE"
RELEASE="${REVISION}-${BRANCH}"
SNAPDATE=""
if [ "X${SNAPDATE}" != "X" ]; then
@@ -90,7 +90,8 @@ fi
touch version
v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
-echo "$COPYRIGHT" > vers.c
+cat /dev/null > vers.c
+echo "$COPYRIGHT" >> vers.c
echo "char ostype[] = \"${TYPE}\";" >> vers.c
echo "char osrelease[] = \"${RELEASE}\";" >> vers.c
echo "int osreldate = ${RELDATE};" >> vers.c
diff --git a/sys/conf/options b/sys/conf/options
index 35ceb1a53ffa..c922510bdd56 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -1,4 +1,4 @@
-# $Id: options,v 1.120 1999/01/17 19:02:39 peter Exp $
+# $Id: options,v 1.104 1998/10/09 23:26:26 peter Exp $
#
# On the handling of kernel options
#
@@ -44,7 +44,6 @@ ADW_ALLOW_MEMIO opt_adw.h # Allow PCI devices to use memory
COMPAT_43 opt_compat.h
COMPAT_SUNOS opt_compat.h
COMPILING_LINT opt_lint.h
-CY_PCI_FASTINTR
DDB
DDB_UNATTENDED opt_ddb.h
GDB_REMOTE_CHAT opt_ddb.h
@@ -55,7 +54,6 @@ KTRACE
MD5
MFS_ROOT opt_mfs.h
MFS_ROOT_SIZE opt_mfs.h
-NTIMECOUNTER opt_ntp.h
EXPORTMFS opt_mfs.h
NO_LKM
NSWAPDEV opt_swap.h
@@ -67,7 +65,6 @@ SYSVMSG opt_sysvipc.h
SYSVSEM opt_sysvipc.h
SYSVSHM opt_sysvipc.h
UCONSOLE
-ICMP_BANDLIM
# POSIX kernel options
P1003_1B opt_posix.h
@@ -125,7 +122,6 @@ CD9660_ROOTDELAY opt_cd9660.h
UNION
# Options used only in param.c.
-HZ opt_param.h
MAXUSERS opt_param.h
MSGMNB opt_param.h
MSGMNI opt_param.h
@@ -134,7 +130,6 @@ MSGSSZ opt_param.h
MSGTQL opt_param.h
NBUF opt_param.h
NMBCLUSTERS opt_param.h
-NSFBUFS opt_param.h
SEMMAP opt_param.h
SEMMNI opt_param.h
SEMMNS opt_param.h
@@ -187,11 +182,9 @@ BOOTP_COMPAT opt_bootp.h
BOOTP_NFSROOT opt_bootp.h
BOOTP_NFSV3 opt_bootp.h
BOOTP_WIRED_TO opt_bootp.h
-BRIDGE opt_bdg.h
MROUTING opt_mrouting.h
INET opt_inet.h
IPDIVERT
-DUMMYNET opt_ipdn.h
IPFIREWALL opt_ipfw.h
IPFIREWALL_VERBOSE opt_ipfw.h
IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h
@@ -240,11 +233,7 @@ DPT_RESET_HBA opt_dpt.h
# 'DEBUG', and then let people recompile just the interesting modules
# with 'make CC="cc -DDEBUG'.
CLUSTERDEBUG opt_debug_cluster.h
-DEBUG_1284 opt_ppb_1284.h
-PERIPH_1284 opt_ppb_1284.h
-DONTPROBE_1284 opt_ppb_1284.h
-VP0_DEBUG opt_vpo.h
-NLPT_DEBUG opt_nlpt.h
+DEBUG_1284 opt_debug_1284.h
LOCKF_DEBUG opt_debug_lockf.h
LOUTB opt_debug_outb.h
NPX_DEBUG opt_debug_npx.h
@@ -255,14 +244,9 @@ SI_DEBUG opt_debug_si.h
# These cause changes all over the kernel
DEBUG opt_global.h
-DEBUG_LOCKS opt_global.h
-DEBUG_VFS_LOCKS opt_global.h
DIAGNOSTIC opt_global.h
-ENABLE_VFS_IOOPT opt_global.h
-INVARIANT_SUPPORT opt_global.h
-INVARIANTS opt_global.h
SIMPLELOCK_DEBUG opt_global.h
-VFS_BIO_DEBUG opt_global.h
+ENABLE_VFS_IOOPT opt_global.h
# These are VM related options
VM_KMEM_SIZE opt_vm.h
@@ -275,10 +259,6 @@ PQ_MEDIUMCACHE opt_vmpage.h
PQ_LARGECACHE opt_vmpage.h
PQ_HUGECACHE opt_vmpage.h
-# Standard SMP options
-SMP opt_global.h
-NCPU opt_smp.h
-NBUS opt_smp.h
# sys/netkey
KEY
@@ -320,16 +300,3 @@ METEOR_DEALLOC_ABOVE opt_meteor.h
# Include tweaks for running under the SimOS machine simulator.
SIMOS opt_simos.h
-
-# options for bus/device framework
-BUS_DEBUG opt_bus.h
-
-# options for USB support
-USB_DEBUG opt_usb.h
-USBVERBOSE opt_usb.h
-
-# Vinum options
-VINUMDEBUG opt_vinum.h
-
-# Include LKM compatability module
-LKM
diff --git a/sys/conf/param.c b/sys/conf/param.c
index ef98c59c6e25..454298416c6f 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -36,11 +36,9 @@
* SUCH DAMAGE.
*
* @(#)param.c 8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.31 1998/11/05 14:28:17 dg Exp $
+ * $Id: param.c,v 1.29 1998/06/30 21:25:35 phk Exp $
*/
-#include <stddef.h>
-
#include "opt_sysvipc.h"
#include "opt_param.h"
@@ -97,12 +95,6 @@ int maxsockets = MAXSOCKETS;
/* allocate 1/4th amount of virtual address space for mbufs XXX */
int nmbufs = NMBCLUSTERS * 4;
-/* maximum # of sf_bufs (sendfile(2) zero-copy virtual buffers) */
-#ifndef NSFBUFS
-#define NSFBUFS (512 + MAXUSERS * 16)
-#endif
-int nsfbufs = NSFBUFS;
-
/*
* Values in support of System V compatible shared memory. XXX
*/
diff --git a/sys/contrib/softupdates/README b/sys/contrib/softupdates/README
deleted file mode 100644
index 8a7433b61e9e..000000000000
--- a/sys/contrib/softupdates/README
+++ /dev/null
@@ -1,320 +0,0 @@
-Introduction
-
-This package constitutes the alpha distribution of the soft update
-code updates for the fast filesystem.
-
-For More information on what Soft Updates is, see:
-http://www.ece.cmu.edu/~ganger/papers/CSE-TR-254-95/
-
-Status
-
-My `filesystem torture tests' (described below) run for days without
-a hitch (no panic's, hangs, filesystem corruption, or memory leaks).
-However, I have had several panic's reported to me by folks that
-are field testing the code which I have not yet been able to
-reproduce or fix. Although these panic's are rare and do not cause
-filesystem corruption, the code should only be put into production
-on systems where the system administrator is aware that it is being
-run, and knows how to turn it off if problems arise. Thus, you may
-hand out this code to others, but please ensure that this status
-message is included with any distributions. Please also include
-the file ffs_softdep.stub.c in any distributions so that folks that
-cannot abide by the need to redistribute source will not be left
-with a kernel that will not link. It will resolve all the calls
-into the soft update code and simply ignores the request to enable
-them. Thus you will be able to ensure that your other hooks have
-not broken anything and that your kernel is softdep-ready for those
-that wish to use them. Please report problems back to me with
-kernel backtraces of panics if possible. This is massively complex
-code, and people only have to have their filesystems hosed once or
-twice to avoid future changes like the plague. I want to find and
-fix as many bugs as soon as possible so as to get the code rock
-solid before it gets widely released. Please report any bugs that
-you uncover to mckusick@mckusick.com.
-
-Performance
-
-Running the Andrew Benchmarks yields the following raw data:
-
- Phase Normal Softdep What it does
- 1 3s <1s Creating directories
- 2 8s 4s Copying files
- 3 6s 6s Recursive directory stats
- 4 8s 9s Scanning each file
- 5 25s 25s Compilation
-
- Normal: 19.9u 29.2s 0:52.8 135+630io
- Softdep: 20.3u 28.5s 0:47.8 103+363io
-
-Another interesting datapoint are my `filesystem torture tests'.
-They consist of 1000 runs of the andrew benchmarks, 1000 copy and
-removes of /etc with randomly selected pauses of 0-60 seconds
-between each copy and remove, and 500 find from / with randomly
-selected pauses of 100 seconds between each run). The run of the
-torture test compares as follows:
-
-With soft updates: writes: 6 sync, 1,113,686 async; run time 19hr, 50min
-Normal filesystem: writes: 1,459,147 sync, 487,031 async; run time 27hr, 15min
-
-The upshot is 42% less I/O and 28% shorter running time.
-
-Another interesting test point is a full MAKEDEV. Because it runs
-as a shell script, it becomes mostly limited by the execution speed
-of the machine on which it runs. Here are the numbers:
-
-With soft updates:
-
- labrat# time ./MAKEDEV std
- 2.2u 32.6s 0:34.82 100.0% 0+0k 11+36io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Without soft updates:
-
- labrat# time ./MAKEDEV std
- 2.0u 40.5s 0:42.53 100.0% 0+0k 11+1221io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Of course, some of the system time is being pushed
-to the syncer process, but that is a different story.
-
-To show a benchmark designed to highlight the soft update code
-consider a tar of zero-sized files and an rm -rf of a directory tree
-that has at least 50 files or so at each level. Running a test with
-a directory tree containing 28 directories holding 202 empty files
-produces the following numbers:
-
-With soft updates:
-tar: 0.0u 0.5s 0:00.65 76.9% 0+0k 0+44io 0pf+0w (0 sync, 33 async writes)
-rm: 0.0u 0.2s 0:00.20 100.0% 0+0k 0+37io 0pf+0w (0 sync, 72 async writes)
-
-Normal filesystem:
-tar: 0.0u 1.1s 0:07.27 16.5% 0+0k 60+586io 0pf+0w (523 sync, 0 async writes)
-rm: 0.0u 0.5s 0:01.84 29.3% 0+0k 0+318io 0pf+0w (258 sync, 65 async writes)
-
-The large reduction in writes is because inodes are clustered, so
-most of a block gets allocated, then the whole block is written
-out once rather than having the same block written once for each
-inode allocated from it. Similarly each directory block is written
-once rather than once for each new directory entry. Effectively
-what the update code is doing is allocating a bunch of inodes
-and directory entries without writing anything, then ensuring that
-the block containing the inodes is written first followed by the
-directory block that references them. If there were data in the
-files it would further ensure that the data blocks were written
-before their inodes claimed them.
-
-Copyright Restrictions
-
-Please familiarize yourself with the copyright restrictions
-contained at the top of either the sys/ufs/ffs/softdep.h or
-sys/ufs/ffs/ffs_softdep.c file. The key provision is similar
-to the one used by the DB 2.0 package and goes as follows:
-
- Redistributions in any form must be accompanied by information
- on how to obtain complete source code for any accompanying
- software that uses the this software. This source code must
- either be included in the distribution or be available for
- no more than the cost of distribution plus a nominal fee,
- and must be freely redistributable under reasonable
- conditions. For an executable file, complete source code
- means the source code for all modules it contains. It does
- not mean source code for modules or files that typically
- accompany the operating system on which the executable file
- runs, e.g., standard library modules or system header files.
-
-The idea is to allow those of you freely redistributing your source
-to use it while retaining for myself the right to peddle it for
-money to the commercial UNIX vendors. Note that I have included a
-stub file ffs_softdep.c.stub that is freely redistributable so that
-you can put in all the necessary hooks to run the full soft updates
-code, but still allow vendors that want to maintain proprietary
-source to have a working system. I do plan to release the code with
-a `Berkeley style' copyright once I have peddled it around to the
-commercial vendors. If you have concerns about this copyright,
-feel free to contact me with them and we can try to resolve any
-difficulties.
-
-Soft Dependency Operation
-
-The soft update implementation does NOT require ANY changes
-to the on-disk format of your filesystems. Furthermore it is
-not used by default for any filesystems. It must be enabled on
-a filesystem by filesystem basis by running tunefs to set a
-bit in the superblock indicating that the filesystem should be
-managed using soft updates. If you wish to stop using
-soft updates due to performance or reliability reasons,
-you can simply run tunefs on it again to turn off the bit and
-revert to normal operation. The additional dynamic memory load
-placed on the kernel malloc arena is approximately equal to
-the amount of memory used by vnodes plus inodes (for a system
-with 1000 vnodes, the additional peak memory load is about 300K).
-
-Kernel Changes
-
-There are two new changes to the kernel functionality that are not
-contained in in the soft update files. The first is a `trickle
-sync' facility running in the kernel as process 3. This trickle
-sync process replaces the traditional `update' program (which should
-be commented out of the /etc/rc startup script). When a vnode is
-first written it is placed 30 seconds down on the trickle sync
-queue. If it still exists and has dirty data when it reaches the
-top of the queue, it is sync'ed. This approach evens out the load
-on the underlying I/O system and avoids writing short-lived files.
-The papers on trickle-sync tend to favor aging based on buffers
-rather than files. However, I sync on file age rather than buffer
-age because the data structures are much smaller as there are
-typically far fewer files than buffers. Although this can make the
-I/O spikey when a big file times out, it is still much better than
-the wholesale sync's that were happening before. It also adapts
-much better to the soft update code where I want to control
-aging to improve performance (inodes age in 10 seconds, directories
-in 15 seconds, files in 30 seconds). This ensures that most
-dependencies are gone (e.g., inodes are written when directory
-entries want to go to disk) reducing the amount of rollback that
-is needed.
-
-The other main kernel change is to split the vnode freelist into
-two separate lists. One for vnodes that are still being used to
-identify buffers and the other for those vnodes no longer identifying
-any buffers. The latter list is used by getnewvnode in preference
-to the former.
-
-Packaging of Kernel Changes
-
-The sys subdirectory contains the changes and additions to the
-kernel. My goal in writing this code was to minimize the changes
-that need to be made to the kernel. Thus, most of the new code
-is contained in the two new files softdep.h and ffs_softdep.c.
-The rest of the kernel changes are simply inserting hooks to
-call into these two new files. Although there has been some
-structural reorganization of the filesystem code to accommodate
-gathering the information required by the soft update code,
-the actual ordering of filesystem operations when soft updates
-are disabled is unchanged.
-
-The kernel changes are packaged as a set of diffs. As I am
-doing my development in BSD/OS, the diffs are relative to the
-BSD/OS versions of the files. Because BSD/OS recently had
-4.4BSD-Lite2 merged into it, the Lite2 files are a good starting
-point for figuring out the changes. There are 40 files that
-require change plus the two new files. Most of these files have
-only a few lines of changes in them. However, four files have
-fairly extensive changes: kern/vfs_subr.c, ufs/ufs/ufs_lookup.c,
-ufs/ufs/ufs_vnops.c, and ufs/ffs/ffs_alloc.c. For these four
-files, I have provided the original Lite2 version, the Lite2
-version with the diffs merged in, and the diffs between the
-BSD/OS and merged version. Even so, I expect that there will
-be some difficulty in doing the merge; I am certainly willing
-to assist in helping get the code merged into your system.
-
-Packaging of Utility Changes
-
-The utilities subdirectory contains the changes and additions
-to the utilities. There are diffs to three utilities enclosed:
-
- tunefs - add a flag to enable and disable soft updates
-
- mount - print out whether soft updates are enabled and
- also statistics on number of sync and async writes
-
- fsck - tighter checks on acceptable errors and a slightly
- different policy for what to put in lost+found on
- filesystems using soft updates
-
-In addition you should recompile vmstat so as to get reports
-on the 13 new memory types used by the soft update code.
-It is not necessary to use the new version of fsck, however it
-would aid in my debugging if you do. Also, because of the time
-lag between deleting a directory entry and the inode it
-references, you will find a lot more files showing up in your
-lost+found if you do not use the new version. Note that the
-new version checks for the soft update flag in the superblock
-and only uses the new algorithms if it is set. So, it will run
-unchanged on the filesystems that are not using soft updates.
-
-Operation
-
-Once you have booted a kernel that incorporates the soft update
-code and installed the updated utilities, do the following:
-
-1) Comment out the update program in /etc/rc.
-
-2) Run `tunefs -n enable' on one or more test filesystems.
-
-3) Mount these filesystems and then type `mount' to ensure that
- they have been enabled for soft updates.
-
-4) Copy the test directory to a softdep filesystem, chdir into
- it and run `./doit'. You may want to check out each of the
- three subtests individually first: doit1 - andrew benchmarks,
- doit2 - copy and removal of /etc, doit3 - find from /.
-
-====
-Additional notes from Feb 13
-
-hen removing huge directories of files, it is possible to get
-the incore state arbitrarily far ahead of the disk. Maintaining
-all the associated depedency information can exhaust the kernel
-malloc arena. To avoid this senario, I have put some limits on
-the soft update code so that it will not be allowed to rampage
-through all of the kernel memory. I enclose below the relevant
-patches to vnode.h and vfs_subr.c (which allow the soft update
-code to speed up the filesystem syncer process). I have also
-included the diffs for ffs_softdep.c. I hope to make a pass over
-ffs_softdep.c to isolate the differences with my standard version
-so that these diffs are less painful to incorporate.
-
-Since I know you like to play with tuning, I have put the relevant
-knobs on sysctl debug variables. The tuning knobs can be viewed
-with `sysctl debug' and set with `sysctl -w debug.<name>=value'.
-The knobs are as follows:
-
- debug.max_softdeps - limit on any given resource
- debug.tickdelay - ticks to delay before allocating
- debug.max_limit_hit - number of times tickdelay imposed
- debug.rush_requests - number of rush requests to filesystem syncer
-
-The max_softdeps limit is derived from vnodesdesired which in
-turn is sized based on the amount of memory on the machine.
-When the limit is hit, a process requesting a resource first
-tries to speed up the filesystem syncer process. Such a
-request is recorded as a rush_request. After syncdelay / 2
-unserviced rush requests (typically 15) are in the filesystem
-syncers queue (i.e., it is more than 15 seconds behind in its
-work), the process requesting the memory is put to sleep for
-tickdelay seconds. Such a delay is recorded in max_limit_hit.
-Following this delay it is granted its memory without further
-delay. I have tried the following experiments in which I
-delete an MH directory containing 16,703 files:
-
-Run # 1 2 3
-
-max_softdeps 4496 4496 4496
-tickdelay 100 == 1 sec 20 == 0.2 sec 2 == 0.02 sec
-max_limit_hit 16 == 16 sec 27 == 5.4 sec 203 == 4.1 sec
-rush_requests 147 102 93
-run time 57 sec 46 sec 45 sec
-I/O's 781 859 936
-
-When run with no limits, it completes in 40 seconds. So, the
-time spent in delay is directly added to the bottom line.
-Shortening the tick delay does cut down the total running time,
-but at the expense of generating more total I/O operations
-due to the rush orders being sent to the filesystem syncer.
-Although the number of rush orders decreases with a shorter
-tick delay, there are more requests in each order, hence the
-increase in I/O count. Also, although the I/O count does rise
-with a shorter delay, it is still at least an order of magnitude
-less than without soft updates. Anyway, you may want to play
-around with these value to see what works best and to see if
-you can get an insight into how best to tune them. If you get
-out of memory panic's, then you have max_softdeps set too high.
-The max_limit_hit and rush_requests show be reset to zero
-before each run. The minimum legal value for tickdelay is 2
-(if you set it below that, the code will use 2).
-
-
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index cb41d85694f3..1a44450cdfc7 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_command.c,v 1.28 1998/07/08 10:53:45 bde Exp $
+ * $Id: db_command.c,v 1.27 1998/05/19 18:42:03 phk Exp $
*/
/*
@@ -35,7 +35,7 @@
* Command dispatcher.
*/
#include <sys/param.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/reboot.h>
#include <sys/systm.h>
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index 8c5f91e97927..60d48ec0c960 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_sym.c,v 1.26 1998/07/08 10:53:51 bde Exp $
+ * $Id: db_sym.c,v 1.25 1998/07/08 09:11:38 bde Exp $
*/
/*
@@ -91,7 +91,9 @@ db_qualify(sym, symtabname)
static char tmp[256];
db_symbol_values(sym, &symname, 0);
- snprintf(tmp, sizeof(tmp), "%s:%s", symtabname, symname);
+ strcpy(tmp,symtabname);
+ strcat(tmp,":");
+ strcat(tmp,symname);
return tmp;
}
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c
index f0588f891637..ac47f8d7bac4 100644
--- a/sys/dev/advansys/advansys.c
+++ b/sys/dev/advansys/advansys.c
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: advansys.c,v 1.6 1998/12/04 22:54:44 archie Exp $
+ * $Id: advansys.c,v 1.3 1998/10/07 03:32:56 gibbs Exp $
*/
/*
* Ported from:
@@ -134,7 +134,7 @@ adv_name(struct adv_softc *adv)
{
static char name[10];
- snprintf(name, sizeof(name), "adv%d", adv->unit);
+ sprintf(name, "adv%d", adv->unit);
return (name);
}
@@ -554,10 +554,8 @@ adv_alloc_ccb_info(struct adv_softc *adv)
struct adv_ccb_info *cinfo;
cinfo = malloc(sizeof(*cinfo), M_DEVBUF, M_NOWAIT);
- if (cinfo == NULL) {
+ if (cinfo == NULL)
printf("%s: Can't malloc CCB info\n", adv_name(adv));
- return (NULL);
- }
cinfo->state = ACCB_FREE;
error = bus_dmamap_create(adv->buffer_dmat, /*flags*/0,
&cinfo->dmamap);
@@ -1050,9 +1048,7 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done without error, "
- "unknown host status %x\n", host_stat);
+ /* QHSTA error occurred */
/* XXX Can I get more explicit information here? */
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
@@ -1088,9 +1084,6 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done with error, "
- "unknown host status %x\n", host_stat);
/* XXX Can I get more explicit information here? */
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
@@ -1104,9 +1097,7 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done with unknown status %x:%x\n",
- done_stat, host_stat);
+ printf("adv_done: Unknown done status 0x%x\n", done_stat);
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
}
diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c
index e612974c44aa..617266a6aa87 100644
--- a/sys/dev/advansys/advlib.c
+++ b/sys/dev/advansys/advlib.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: advlib.c,v 1.9 1998/10/29 17:41:34 gibbs Exp $
+ * $Id: advlib.c,v 1.7 1998/10/07 03:32:57 gibbs Exp $
*/
/*
* Ported from:
@@ -1031,8 +1031,7 @@ adv_isr_chip_halted(struct adv_softc *adv)
ccb = (union ccb *) adv_read_lram_32(adv, halt_q_addr
+ ADV_SCSIQ_D_CCBPTR);
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
- ccb->ccb_h.status |= CAM_DEV_QFRZN|CAM_SCSI_STATUS_ERROR;
- ccb->csio.scsi_status = SCSI_STATUS_QUEUE_FULL;
+ ccb->ccb_h.status |= CAM_DEV_QFRZN;
adv_abort_ccb(adv, tid_no, ADV_TIX_TO_LUN(target_ix),
/*ccb*/NULL, CAM_REQUEUE_REQ,
/*queued_only*/TRUE);
@@ -1971,6 +1970,7 @@ adv_abort_ccb(struct adv_softc *adv, int target, int lun, union ccb *ccb,
struct adv_ccb_info *cinfo;
scsiq->q_status |= QS_ABORTED;
+ scsiq->d3.done_stat = QD_ABORTED_BY_HOST;
adv_write_lram_8(adv, q_addr + ADV_SCSIQ_B_STATUS,
scsiq->q_status);
aborted_ccb = (union ccb *)scsiq->d2.ccb_ptr;
@@ -2009,6 +2009,8 @@ adv_reset_bus(struct adv_softc *adv)
count = 0;
while ((ccb = (union ccb *)LIST_FIRST(&adv->pending_ccbs)) != NULL) {
+ struct adv_ccb_info *cinfo;
+
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)
ccb->ccb_h.status |= CAM_SCSI_BUS_RESET;
adv_done(adv, ccb, QD_ABORTED_BY_HOST, 0, 0, 0);
diff --git a/sys/dev/advansys/adwlib.c b/sys/dev/advansys/adwlib.c
index c727ca633b75..e2b93ac0fc2c 100644
--- a/sys/dev/advansys/adwlib.c
+++ b/sys/dev/advansys/adwlib.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adwlib.c,v 1.1 1998/10/07 03:20:46 gibbs Exp $
+ * $Id$
*/
/*
* Ported from:
@@ -43,8 +43,7 @@
* code retain the above copyright notice and this comment without
* modification.
*/
-
-#include <sys/types.h>
+#include <sys/queue.h>
#include <sys/systm.h>
#include <machine/bus_pio.h>
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c
index dcabdeaa71ad..9109c6d4cfe3 100644
--- a/sys/dev/aha/aha.c
+++ b/sys/dev/aha/aha.c
@@ -55,11 +55,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aha.c,v 1.18 1998/12/22 22:31:06 imp Exp $
+ * $Id: aha.c,v 1.9 1998/10/15 19:53:30 imp Exp $
*/
-#include "pnp.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -81,15 +79,10 @@
#include <vm/vm.h>
#include <vm/pmap.h>
-
-#if NPNP > 0
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h> /* XXX pnp isn't x86 only */
-#endif
#include <dev/aha/ahareg.h>
-struct aha_softc *aha_softcs[NAHATOT];
+struct aha_softc *aha_softcs[NAHA];
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define PRVERB(x) if (bootverbose) printf x
@@ -132,15 +125,15 @@ ahanextoutbox(struct aha_softc *aha)
/* CCB Mangement functions */
static __inline u_int32_t ahaccbvtop(struct aha_softc *aha,
- struct aha_ccb *accb);
+ struct aha_ccb *bccb);
static __inline struct aha_ccb* ahaccbptov(struct aha_softc *aha,
u_int32_t ccb_addr);
static __inline u_int32_t
-ahaccbvtop(struct aha_softc *aha, struct aha_ccb *accb)
+ahaccbvtop(struct aha_softc *aha, struct aha_ccb *bccb)
{
return (aha->aha_ccb_physbase
- + (u_int32_t)((caddr_t)accb - (caddr_t)aha->aha_ccb_array));
+ + (u_int32_t)((caddr_t)bccb - (caddr_t)aha->aha_ccb_array));
}
static __inline struct aha_ccb *
ahaccbptov(struct aha_softc *aha, u_int32_t ccb_addr)
@@ -150,10 +143,10 @@ ahaccbptov(struct aha_softc *aha, u_int32_t ccb_addr)
}
static struct aha_ccb* ahagetccb(struct aha_softc *aha);
-static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb);
+static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *bccb);
static void ahaallocccbs(struct aha_softc *aha);
static bus_dmamap_callback_t ahaexecuteccb;
-static void ahadone(struct aha_softc *aha, struct aha_ccb *accb,
+static void ahadone(struct aha_softc *aha, struct aha_ccb *bccb,
aha_mbi_comp_code_t comp_code);
/* Host adapter command functions */
@@ -170,7 +163,7 @@ static void ahafetchtransinfo(struct aha_softc *aha,
struct ccb_trans_settings *cts);
/* CAM SIM entry points */
-#define ccb_accb_ptr spriv_ptr0
+#define ccb_bccb_ptr spriv_ptr0
#define ccb_aha_ptr spriv_ptr1
static void ahaaction(struct cam_sim *sim, union ccb *ccb);
static void ahapoll(struct cam_sim *sim);
@@ -187,26 +180,12 @@ u_long aha_unit = 0;
*/
struct aha_isa_port aha_isa_ports[] =
{
- { 0x130, 0, 4 },
- { 0x134, 0, 5 },
- { 0x230, 0, 2 },
- { 0x234, 0, 3 },
- { 0x330, 0, 0 },
- { 0x334, 0, 1 }
-};
-
-/*
- * I/O ports listed in the order enumerated by the
- * card for certain op codes.
- */
-u_int16_t aha_board_ports[] =
-{
- 0x330,
- 0x334,
- 0x230,
- 0x234,
- 0x130,
- 0x134
+ { 0x330, 0 },
+ { 0x334, 0 },
+ { 0x230, 0 },
+ { 0x234, 0 },
+ { 0x130, 0 },
+ { 0x134, 0 }
};
/* Exported functions */
@@ -216,7 +195,7 @@ aha_alloc(int unit, bus_space_tag_t tag, bus_space_handle_t bsh)
struct aha_softc *aha;
if (unit != AHA_TEMP_UNIT) {
- if (unit >= NAHATOT) {
+ if (unit >= NAHA) {
printf("aha: unit number (%d) too high\n", unit);
return NULL;
}
@@ -242,8 +221,6 @@ aha_alloc(int unit, bus_space_tag_t tag, bus_space_handle_t bsh)
aha->unit = unit;
aha->tag = tag;
aha->bsh = bsh;
- aha->ccb_sg_opcode = INITIATOR_SG_CCB_WRESID;
- aha->ccb_ccb_opcode = INITIATOR_CCB_WRESID;
if (aha->unit != AHA_TEMP_UNIT) {
aha_softcs[unit] = aha;
@@ -315,26 +292,13 @@ aha_probe(struct aha_softc* aha)
status = aha_inb(aha, STATUS_REG);
if ((status == 0)
|| (status & (DIAG_ACTIVE|CMD_REG_BUSY|
- STATUS_REG_RSVD)) != 0) {
- PRVERB(("%s: status reg test failed %x\n", aha_name(aha),
- status));
+ STATUS_REG_RSVD|CMD_INVALID)) != 0) {
return (ENXIO);
}
intstat = aha_inb(aha, INTSTAT_REG);
if ((intstat & INTSTAT_REG_RSVD) != 0) {
- PRVERB(("%s: Failed Intstat Reg Test\n", aha_name(aha)));
- return (ENXIO);
- }
-
- /*
- * Looking good so far. Final test is to reset the
- * adapter and fetch the board ID and ensure we aren't
- * looking at a BusLogic.
- */
- if ((error = ahareset(aha, /*hard_reset*/TRUE)) != 0) {
- if (bootverbose)
- printf("%s: Failed Reset\n", aha_name(aha));
+ printf("%s: Failed Intstat Reg Test\n", aha_name(aha));
return (ENXIO);
}
@@ -342,7 +306,7 @@ aha_probe(struct aha_softc* aha)
* Get the board ID. We use this to see if we're dealing with
* a buslogic card or a aha card (or clone).
*/
- error = aha_cmd(aha, AOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
(u_int8_t*)&board_id, sizeof(board_id),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -360,29 +324,12 @@ aha_probe(struct aha_softc* aha)
* this register, and return 0xff, while buslogic cards will return
* something different.
*
- * It appears that for reasons unknow, for the for the
- * aha-1542B cards, we need to wait a little bit before trying
- * to read the geometry register. I picked 10ms since we have
- * reports that a for loop to 1000 did the trick, and this
- * errs on the side of conservatism. Besides, no one will
- * notice a 10mS delay here, even the 1542B card users :-)
- *
- * Some compatible cards return 0 here.
- *
- * XXX I'm not sure how this will impact other cloned cards
- *
- * This really should be replaced with the esetup command, since
- * that appears to be more reliable.
+ * XXX I'm not sure how this will impact other cloned cards.
*/
if (aha->boardid <= 0x42) {
- /* Wait 10ms before reading */
- DELAY(10000);
status = aha_inb(aha, GEOMETRY_REG);
- if (status != 0xff && status != 0x00) {
- PRVERB(("%s: Geometry Register test failed\n",
- aha_name(aha)));
+ if (status != 0xff)
return (ENXIO);
- }
}
return (0);
@@ -402,31 +349,31 @@ aha_fetch_adapter_info(struct aha_softc *aha)
switch (aha->boardid) {
case BOARD_1540_16HEAD_BIOS:
- snprintf(aha->model, sizeof(aha->model), "1540 16 head BIOS");
+ strcpy(aha->model, "1540 16 head BIOS");
break;
case BOARD_1540_64HEAD_BIOS:
- snprintf(aha->model, sizeof(aha->model), "1540 64 head BIOS");
+ strcpy(aha->model, "1540 64 head BIOS");
break;
case BOARD_1542:
- snprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS");
+ strcpy(aha->model, "1540/1542 64 head BIOS");
break;
case BOARD_1640:
- snprintf(aha->model, sizeof(aha->model), "1640");
+ strcpy(aha->model, "1640");
break;
case BOARD_1740:
- snprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744");
+ strcpy(aha->model, "1740A/1742A/1744");
break;
case BOARD_1542C:
- snprintf(aha->model, sizeof(aha->model), "1542C");
+ strcpy(aha->model, "1542C");
break;
case BOARD_1542CF:
- snprintf(aha->model, sizeof(aha->model), "1542CF");
+ strcpy(aha->model, "1542CF");
break;
case BOARD_1542CP:
- snprintf(aha->model, sizeof(aha->model), "1542CP");
+ strcpy(aha->model, "1542CP");
break;
default:
- snprintf(aha->model, sizeof(aha->model), "Unknown");
+ strcpy(aha->model, "Unknown");
break;
}
/*
@@ -442,24 +389,24 @@ aha_fetch_adapter_info(struct aha_softc *aha)
(aha->boardid == 0x41
&& aha->fw_major == 0x31 &&
aha->fw_minor >= 0x34)) {
- error = aha_cmd(aha, AOP_RETURN_EXT_BIOS_INFO, NULL,
+ error = aha_cmd(aha, BOP_RETURN_EXT_BIOS_INFO, NULL,
/*paramlen*/0, (u_char *)&extbios, sizeof(extbios),
DEFAULT_CMD_TIMEOUT);
- error = aha_cmd(aha, AOP_MBOX_IF_ENABLE, (u_int8_t *)&extbios,
+ error = aha_cmd(aha, BOP_MBOX_IF_ENABLE, (u_int8_t *)&extbios,
/*paramlen*/2, NULL, 0, DEFAULT_CMD_TIMEOUT);
}
if (aha->boardid < 0x41)
- printf("%s: Warning: aha-1542A won't likely work.\n",
+ printf("%s: Likely aha 1542A, which might not work properly\n",
aha_name(aha));
- aha->max_sg = 17; /* Need >= 17 to do 64k I/O */
+ aha->max_sg = 17; /* Need 17 to do 64k I/O */
aha->diff_bus = 0;
aha->extended_lun = 0;
aha->extended_trans = 0;
aha->max_ccbs = 16;
/* Determine Sync/Wide/Disc settings */
length_param = sizeof(setup_info);
- error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, &length_param,
+ error = aha_cmd(aha, BOP_INQUIRE_SETUP_INFO, &length_param,
/*paramlen*/1, (u_int8_t*)&setup_info,
sizeof(setup_info), DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -477,7 +424,7 @@ aha_fetch_adapter_info(struct aha_softc *aha)
/* Determine our SCSI ID */
- error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
(u_int8_t*)&config_data, sizeof(config_data),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -634,8 +581,8 @@ aha_attach(struct aha_softc *aha)
struct cam_devq *devq;
/*
- * We don't do tagged queueing, since the aha cards don't
- * support it.
+ * We reserve 1 ccb for error recovery, so don't
+ * tell the XPT about it.
*/
tagged_dev_openings = 0;
@@ -677,7 +624,7 @@ aha_name(struct aha_softc *aha)
{
static char name[10];
- snprintf(name, sizeof(name), "aha%d", aha->unit);
+ sprintf(name, "aha%d", aha->unit);
return (name);
}
@@ -702,7 +649,7 @@ void
aha_mark_probed_bio(isa_compat_io_t port)
{
if (port < BIO_DISABLED)
- aha_mark_probed_iop(aha_board_ports[port]);
+ aha_isa_ports[port].probed = 1;
}
void
@@ -718,43 +665,6 @@ aha_mark_probed_iop(u_int ioport)
}
}
-void
-aha_find_probe_range(int ioport, int *port_index, int *max_port_index)
-{
- if (ioport > 0) {
- int i;
-
- for (i = 0;i < AHA_NUM_ISAPORTS; i++)
- if (ioport <= aha_isa_ports[i].addr)
- break;
- if ((i >= AHA_NUM_ISAPORTS)
- || (ioport != aha_isa_ports[i].addr)) {
- printf("\n"
-"aha_isa_probe: Invalid baseport of 0x%x specified.\n"
-"aha_isa_probe: Nearest valid baseport is 0x%x.\n"
-"aha_isa_probe: Failing probe.\n",
- ioport,
- (i < AHA_NUM_ISAPORTS)
- ? aha_isa_ports[i].addr
- : aha_isa_ports[AHA_NUM_ISAPORTS - 1].addr);
- *port_index = *max_port_index = -1;
- return;
- }
- *port_index = *max_port_index = aha_isa_ports[i].bio;
- } else {
- *port_index = 0;
- *max_port_index = AHA_NUM_ISAPORTS - 1;
- }
-}
-
-int
-aha_iop_from_bio(isa_compat_io_t bio_index)
-{
- if (bio_index >= 0 && bio_index < AHA_NUM_ISAPORTS)
- return (aha_board_ports[bio_index]);
- return (-1);
-}
-
static void
ahaallocccbs(struct aha_softc *aha)
{
@@ -793,7 +703,7 @@ ahaallocccbs(struct aha_softc *aha)
next_ccb->sg_list = segs;
next_ccb->sg_list_phys = physaddr;
- next_ccb->flags = ACCB_FREE;
+ next_ccb->flags = BCCB_FREE;
error = bus_dmamap_create(aha->buffer_dmat, /*flags*/0,
&next_ccb->dmamap);
if (error != 0)
@@ -806,54 +716,50 @@ ahaallocccbs(struct aha_softc *aha)
}
/* Reserve a CCB for error recovery */
- if (aha->recovery_accb == NULL) {
- aha->recovery_accb = SLIST_FIRST(&aha->free_aha_ccbs);
+ if (aha->recovery_bccb == NULL) {
+ aha->recovery_bccb = SLIST_FIRST(&aha->free_aha_ccbs);
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
}
}
static __inline void
-ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb)
+ahafreeccb(struct aha_softc *aha, struct aha_ccb *bccb)
{
int s;
s = splcam();
- if ((accb->flags & ACCB_ACTIVE) != 0)
- LIST_REMOVE(&accb->ccb->ccb_h, sim_links.le);
+ if ((bccb->flags & BCCB_ACTIVE) != 0)
+ LIST_REMOVE(&bccb->ccb->ccb_h, sim_links.le);
if (aha->resource_shortage != 0
- && (accb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) {
- accb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
+ && (bccb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) {
+ bccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
aha->resource_shortage = FALSE;
}
- accb->flags = ACCB_FREE;
- SLIST_INSERT_HEAD(&aha->free_aha_ccbs, accb, links);
- aha->active_ccbs--;
+ bccb->flags = BCCB_FREE;
+ SLIST_INSERT_HEAD(&aha->free_aha_ccbs, bccb, links);
splx(s);
}
static struct aha_ccb*
ahagetccb(struct aha_softc *aha)
{
- struct aha_ccb* accb;
+ struct aha_ccb* bccb;
int s;
s = splcam();
- if ((accb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) {
+ if ((bccb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) {
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
- aha->active_ccbs++;
} else if (aha->num_ccbs < aha->max_ccbs) {
ahaallocccbs(aha);
- accb = SLIST_FIRST(&aha->free_aha_ccbs);
- if (accb == NULL)
- printf("%s: Can't malloc ACCB\n", aha_name(aha));
- else {
+ bccb = SLIST_FIRST(&aha->free_aha_ccbs);
+ if (bccb == NULL)
+ printf("%s: Can't malloc BCCB\n", aha_name(aha));
+ else
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
- aha->active_ccbs++;
- }
}
splx(s);
- return (accb);
+ return (bccb);
}
static void
@@ -870,13 +776,13 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
case XPT_SCSI_IO: /* Execute the requested I/O operation */
case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
struct aha_hccb *hccb;
/*
- * get a accb to use.
+ * get a bccb to use.
*/
- if ((accb = ahagetccb(aha)) == NULL) {
+ if ((bccb = ahagetccb(aha)) == NULL) {
int s;
s = splcam();
@@ -888,17 +794,17 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
return;
}
- hccb = &accb->hccb;
+ hccb = &bccb->hccb;
/*
- * So we can find the ACCB when an abort is requested
+ * So we can find the BCCB when an abort is requested
*/
- accb->ccb = ccb;
- ccb->ccb_h.ccb_accb_ptr = accb;
+ bccb->ccb = ccb;
+ ccb->ccb_h.ccb_bccb_ptr = bccb;
ccb->ccb_h.ccb_aha_ptr = aha;
/*
- * Put all the arguments for the xfer in the accb
+ * Put all the arguments for the xfer in the bccb
*/
hccb->target = ccb->ccb_h.target_id;
hccb->lun = ccb->ccb_h.target_lun;
@@ -911,13 +817,13 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
csio = &ccb->csio;
ccbh = &csio->ccb_h;
- hccb->opcode = aha->ccb_ccb_opcode;
+ hccb->opcode = INITIATOR_CCB_WRESID;
hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) != 0;
hccb->dataout = (ccb->ccb_h.flags & CAM_DIR_OUT) != 0;
hccb->cmd_len = csio->cdb_len;
if (hccb->cmd_len > sizeof(hccb->scsi_cdb)) {
ccb->ccb_h.status = CAM_REQ_INVALID;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -929,7 +835,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
} else {
/* I guess I could map it in... */
ccbh->status = CAM_REQ_INVALID;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -955,11 +861,11 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
s = splsoftvm();
error = bus_dmamap_load(
aha->buffer_dmat,
- accb->dmamap,
+ bccb->dmamap,
csio->data_ptr,
csio->dxfer_len,
ahaexecuteccb,
- accb,
+ bccb,
/*flags*/0);
if (error == EINPROGRESS) {
/*
@@ -982,7 +888,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
seg.ds_addr =
(bus_addr_t)csio->data_ptr;
seg.ds_len = csio->dxfer_len;
- ahaexecuteccb(accb, &seg, 1, 0);
+ ahaexecuteccb(bccb, &seg, 1, 0);
}
} else {
struct bus_dma_segment *segs;
@@ -1000,11 +906,11 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
/* Just use the segments provided */
segs = (struct bus_dma_segment *)
csio->data_ptr;
- ahaexecuteccb(accb, segs,
+ ahaexecuteccb(bccb, segs,
csio->sglist_cnt, 0);
}
} else {
- ahaexecuteccb(accb, NULL, 0, 0);
+ ahaexecuteccb(bccb, NULL, 0, 0);
}
} else {
hccb->opcode = INITIATOR_BUS_DEV_RESET;
@@ -1013,7 +919,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
hccb->dataout = TRUE;
hccb->cmd_len = 0;
hccb->sense_len = 0;
- ahaexecuteccb(accb, NULL, 0, 0);
+ ahaexecuteccb(bccb, NULL, 0, 0);
}
break;
}
@@ -1138,14 +1044,14 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
static void
ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
union ccb *ccb;
struct aha_softc *aha;
int s;
u_int32_t paddr;
- accb = (struct aha_ccb *)arg;
- ccb = accb->ccb;
+ bccb = (struct aha_ccb *)arg;
+ ccb = bccb->ccb;
aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr;
if (error != 0) {
@@ -1156,7 +1062,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN;
}
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -1169,7 +1075,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
end_seg = dm_segs + nseg;
/* Copy the segments into our SG list */
- sg = accb->sg_list;
+ sg = bccb->sg_list;
while (dm_segs < end_seg) {
ahautoa24(dm_segs->ds_len, sg->len);
ahautoa24(dm_segs->ds_addr, sg->addr);
@@ -1178,13 +1084,13 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
if (nseg > 1) {
- accb->hccb.opcode = aha->ccb_sg_opcode;
+ bccb->hccb.opcode = INITIATOR_SG_CCB_WRESID;
ahautoa24((sizeof(aha_sg_t) * nseg),
- accb->hccb.data_len);
- ahautoa24(accb->sg_list_phys, accb->hccb.data_addr);
+ bccb->hccb.data_len);
+ ahautoa24(bccb->sg_list_phys, bccb->hccb.data_addr);
} else {
- bcopy(accb->sg_list->len, accb->hccb.data_len, 3);
- bcopy(accb->sg_list->addr, accb->hccb.data_addr, 3);
+ bcopy(bccb->sg_list->len, bccb->hccb.data_len, 3);
+ bcopy(bccb->sg_list->addr, bccb->hccb.data_addr, 3);
}
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
@@ -1192,12 +1098,12 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
else
op = BUS_DMASYNC_PREWRITE;
- bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op);
+ bus_dmamap_sync(aha->buffer_dmat, bccb->dmamap, op);
} else {
- accb->hccb.opcode = INITIATOR_CCB;
- ahautoa24(0, accb->hccb.data_len);
- ahautoa24(0, accb->hccb.data_addr);
+ bccb->hccb.opcode = INITIATOR_CCB_WRESID;
+ ahautoa24(0, bccb->hccb.data_len);
+ ahautoa24(0, bccb->hccb.data_addr);
}
s = splcam();
@@ -1208,47 +1114,28 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
*/
if (ccb->ccb_h.status != CAM_REQ_INPROG) {
if (nseg != 0)
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
- ahafreeccb(aha, accb);
+ bus_dmamap_unload(aha->buffer_dmat, bccb->dmamap);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
splx(s);
return;
}
- accb->flags = ACCB_ACTIVE;
+ bccb->flags = BCCB_ACTIVE;
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le);
ccb->ccb_h.timeout_ch =
- timeout(ahatimeout, (caddr_t)accb,
+ timeout(ahatimeout, (caddr_t)bccb,
(ccb->ccb_h.timeout * hz) / 1000);
/* Tell the adapter about this command */
- if (aha->cur_outbox->action_code != AMBO_FREE) {
- /*
- * We should never encounter a busy mailbox.
- * If we do, warn the user, and treat it as
- * a resource shortage. If the controller is
- * hung, one of the pending transactions will
- * timeout causing us to start recovery operations.
- */
- printf("%s: Encountered busy mailbox with %d out of %d "
- "commands active!!!", aha_name(aha), aha->active_ccbs,
- aha->max_ccbs);
- untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch);
- if (nseg != 0)
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
- ahafreeccb(aha, accb);
- aha->resource_shortage = TRUE;
- xpt_freeze_simq(aha->sim, /*count*/1);
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
- xpt_done(ccb);
- return;
- }
- paddr = ahaccbvtop(aha, accb);
+ paddr = ahaccbvtop(aha, bccb);
ahautoa24(paddr, aha->cur_outbox->ccb_addr);
- aha->cur_outbox->action_code = AMBO_START;
- aha_outb(aha, COMMAND_REG, AOP_START_MBOX);
+ if (aha->cur_outbox->action_code != BMBO_FREE)
+ panic("%s: Too few mailboxes or to many ccbs???", aha_name(aha));
+ aha->cur_outbox->action_code = BMBO_START;
+ aha_outb(aha, COMMAND_REG, BOP_START_MBOX);
ahanextoutbox(aha);
splx(s);
@@ -1270,13 +1157,13 @@ aha_intr(void *arg)
aha_outb(aha, CONTROL_REG, RESET_INTR);
if ((intstat & IMB_LOADED) != 0) {
- while (aha->cur_inbox->comp_code != AMBI_FREE) {
+ while (aha->cur_inbox->comp_code != BMBI_FREE) {
u_int32_t paddr;
paddr = aha_a24tou(aha->cur_inbox->ccb_addr);
ahadone(aha,
ahaccbptov(aha, paddr),
aha->cur_inbox->comp_code);
- aha->cur_inbox->comp_code = AMBI_FREE;
+ aha->cur_inbox->comp_code = BMBI_FREE;
ahanextinbox(aha);
}
}
@@ -1288,17 +1175,17 @@ aha_intr(void *arg)
}
static void
-ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_code)
+ahadone(struct aha_softc *aha, struct aha_ccb *bccb, aha_mbi_comp_code_t comp_code)
{
union ccb *ccb;
struct ccb_scsiio *csio;
- ccb = accb->ccb;
- csio = &accb->ccb->csio;
+ ccb = bccb->ccb;
+ csio = &bccb->ccb->csio;
- if ((accb->flags & ACCB_ACTIVE) == 0) {
- printf("%s: ahadone - Attempt to free non-active ACCB %p\n",
- aha_name(aha), (void *)accb);
+ if ((bccb->flags & BCCB_ACTIVE) == 0) {
+ printf("%s: ahadone - Attempt to free non-active BCCB %p\n",
+ aha_name(aha), (void *)bccb);
return;
}
@@ -1309,13 +1196,13 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
op = BUS_DMASYNC_POSTREAD;
else
op = BUS_DMASYNC_POSTWRITE;
- bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op);
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
+ bus_dmamap_sync(aha->buffer_dmat, bccb->dmamap, op);
+ bus_dmamap_unload(aha->buffer_dmat, bccb->dmamap);
}
- if (accb == aha->recovery_accb) {
+ if (bccb == aha->recovery_bccb) {
/*
- * The recovery ACCB does not have a CCB associated
+ * The recovery BCCB does not have a CCB associated
* with it, so short circuit the normal error handling.
* We now traverse our list of pending CCBs and process
* any that were terminated by the recovery CCBs action.
@@ -1329,7 +1216,7 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
/* Notify all clients that a BDR occured */
error = xpt_create_path(&path, /*periph*/NULL,
cam_sim_path(aha->sim),
- accb->hccb.target,
+ bccb->hccb.target,
CAM_LUN_WILDCARD);
if (error == CAM_REQ_CMP)
@@ -1337,16 +1224,16 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
ccb_h = LIST_FIRST(&aha->pending_ccbs);
while (ccb_h != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- if (pending_accb->hccb.target == accb->hccb.target) {
- pending_accb->hccb.ahastat = AHASTAT_HA_BDR;
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ if (pending_bccb->hccb.target == bccb->hccb.target) {
+ pending_bccb->hccb.ahastat = AHASTAT_HA_BDR;
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
- ahadone(aha, pending_accb, AMBI_ERROR);
+ ahadone(aha, pending_bccb, BMBI_ERROR);
} else {
ccb_h->timeout_ch =
- timeout(ahatimeout, (caddr_t)pending_accb,
+ timeout(ahatimeout, (caddr_t)pending_bccb,
(ccb_h->timeout * hz) / 1000);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
@@ -1355,35 +1242,29 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
return;
}
- untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch);
+ untimeout(ahatimeout, bccb, ccb->ccb_h.timeout_ch);
switch (comp_code) {
- case AMBI_FREE:
+ case BMBI_FREE:
printf("%s: ahadone - CCB completed with free status!\n",
aha_name(aha));
break;
- case AMBI_NOT_FOUND:
+ case BMBI_NOT_FOUND:
printf("%s: ahadone - CCB Abort failed to find CCB\n",
aha_name(aha));
break;
- case AMBI_ABORT:
- case AMBI_ERROR:
+ case BMBI_ABORT:
+ case BMBI_ERROR:
/* An error occured */
- if (accb->hccb.opcode < INITIATOR_CCB_WRESID)
- csio->resid = 0;
- else
- csio->resid = aha_a24tou(accb->hccb.data_len);
- switch(accb->hccb.ahastat) {
+ switch(bccb->hccb.ahastat) {
case AHASTAT_DATARUN_ERROR:
- {
- if (csio->resid <= 0) {
+ if (bccb->hccb.data_len <= 0) {
csio->ccb_h.status = CAM_DATA_RUN_ERR;
break;
}
/* FALLTHROUGH */
- }
case AHASTAT_NOERROR:
- csio->scsi_status = accb->hccb.sdstat;
+ csio->scsi_status = bccb->hccb.sdstat;
csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
switch(csio->scsi_status) {
case SCSI_STATUS_CHECK_COND:
@@ -1393,10 +1274,10 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
* The aha writes the sense data at different
* offsets based on the scsi cmd len
*/
- bcopy((caddr_t) &accb->hccb.scsi_cdb +
- accb->hccb.cmd_len,
+ bcopy((caddr_t) &bccb->hccb.scsi_cdb +
+ bccb->hccb.cmd_len,
(caddr_t) &csio->sense_data,
- accb->hccb.sense_len);
+ bccb->hccb.sense_len);
break;
default:
break;
@@ -1404,6 +1285,7 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
csio->ccb_h.status = CAM_REQ_CMP;
break;
}
+ csio->resid = aha_a24tou(bccb->hccb.data_len);
break;
case AHASTAT_SELTIMEOUT:
csio->ccb_h.status = CAM_SEL_TIMEOUT;
@@ -1418,16 +1300,8 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
panic("%s: Inavlid Action code", aha_name(aha));
break;
case AHASTAT_INVALID_OPCODE:
- if (accb->hccb.opcode < INITIATOR_CCB_WRESID)
- panic("%s: Invalid CCB Opcode %x hccb = %p",
- aha_name(aha), accb->hccb.opcode,
- &accb->hccb);
- printf("%s: AHA-1540A detected, compensating\n",
- aha_name(aha));
- aha->ccb_sg_opcode = INITIATOR_SG_CCB;
- aha->ccb_ccb_opcode = INITIATOR_CCB;
- xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
- csio->ccb_h.status = CAM_REQUEUE_REQ;
+ panic("%s: Inavlid CCB Opcode code %x hccb = %p",
+ aha_name(aha), bccb->hccb.opcode, &bccb->hccb);
break;
case AHASTAT_LINKED_CCB_LUN_MISMATCH:
/* We don't even support linked commands... */
@@ -1438,11 +1312,11 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
break;
case AHASTAT_HA_SCSI_BUS_RESET:
if ((csio->ccb_h.status & CAM_STATUS_MASK)
- != CAM_CMD_TIMEOUT)
+ != CAM_CMD_TIMEOUT)
csio->ccb_h.status = CAM_SCSI_BUS_RESET;
break;
case AHASTAT_HA_BDR:
- if ((accb->flags & ACCB_DEVICE_RESET) == 0)
+ if ((bccb->flags & BCCB_DEVICE_RESET) == 0)
csio->ccb_h.status = CAM_BDR_SENT;
else
csio->ccb_h.status = CAM_CMD_TIMEOUT;
@@ -1452,19 +1326,18 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
xpt_freeze_devq(csio->ccb_h.path, /*count*/1);
csio->ccb_h.status |= CAM_DEV_QFRZN;
}
- if ((accb->flags & ACCB_RELEASE_SIMQ) != 0)
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0)
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
break;
- case AMBI_OK:
+ case BMBI_OK:
/* All completed without incident */
/* XXX DO WE NEED TO COPY SENSE BYTES HERE???? XXX */
- /* I don't think so since it works???? */
ccb->ccb_h.status |= CAM_REQ_CMP;
- if ((accb->flags & ACCB_RELEASE_SIMQ) != 0)
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0)
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
break;
}
@@ -1552,11 +1425,11 @@ ahareset(struct aha_softc* aha, int hard_reset)
* Perform completion processing for all outstanding CCBs.
*/
while ((ccb_h = LIST_FIRST(&aha->pending_ccbs)) != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- pending_accb->hccb.ahastat = AHASTAT_HA_SCSI_BUS_RESET;
- ahadone(aha, pending_accb, AMBI_ERROR);
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ pending_bccb->hccb.ahastat = AHASTAT_HA_SCSI_BUS_RESET;
+ ahadone(aha, pending_bccb, BMBI_ERROR);
}
return (0);
@@ -1575,13 +1448,11 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
u_int intstat;
u_int reply_buf_size;
int s;
- int cmd_complete;
/* No data returned to start */
reply_buf_size = reply_len;
reply_len = 0;
intstat = 0;
- cmd_complete = 0;
aha->command_cmp = 0;
/*
@@ -1617,13 +1488,10 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
if ((intstat & (INTR_PENDING|CMD_COMPLETE))
- == (INTR_PENDING|CMD_COMPLETE)) {
- cmd_complete = 1;
+ == (INTR_PENDING|CMD_COMPLETE))
break;
- }
if (aha->command_cmp != 0) {
status = aha->latched_status;
- cmd_complete = 1;
break;
}
if ((status & DATAIN_REG_READY) != 0)
@@ -1643,7 +1511,7 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
* For all other commands, we wait for any output data
* and the final comand completion interrupt.
*/
- while (cmd_complete == 0 && --cmd_timeout) {
+ while (--cmd_timeout) {
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
@@ -1741,7 +1609,7 @@ ahainitmboxes(struct aha_softc *aha)
/* Tell the adapter about them */
init_mbox.num_mboxes = aha->num_boxes;
ahautoa24(aha->mailbox_physbase, init_mbox.base_addr);
- error = aha_cmd(aha, AOP_INITIALIZE_MBOX, (u_int8_t *)&init_mbox,
+ error = aha_cmd(aha, BOP_INITIALIZE_MBOX, (u_int8_t *)&init_mbox,
/*parmlen*/sizeof(init_mbox), /*reply_buf*/NULL,
/*reply_len*/0, DEFAULT_CMD_TIMEOUT);
@@ -1774,7 +1642,7 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts)
* the sync info for older models.
*/
param = sizeof(setup_info);
- error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, &param, /*paramlen*/1,
+ error = aha_cmd(aha, BOP_INQUIRE_SETUP_INFO, &param, /*paramlen*/1,
(u_int8_t*)&setup_info, sizeof(setup_info),
DEFAULT_CMD_TIMEOUT);
@@ -1844,24 +1712,24 @@ ahapoll(struct cam_sim *sim)
void
ahatimeout(void *arg)
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
union ccb *ccb;
struct aha_softc *aha;
int s;
u_int32_t paddr;
- accb = (struct aha_ccb *)arg;
- ccb = accb->ccb;
+ bccb = (struct aha_ccb *)arg;
+ ccb = bccb->ccb;
aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr;
xpt_print_path(ccb->ccb_h.path);
- printf("CCB %p - timed out\n", (void *)accb);
+ printf("CCB %p - timed out\n", (void *)bccb);
s = splcam();
- if ((accb->flags & ACCB_ACTIVE) == 0) {
+ if ((bccb->flags & BCCB_ACTIVE) == 0) {
xpt_print_path(ccb->ccb_h.path);
printf("CCB %p - timed out CCB already completed\n",
- (void *)accb);
+ (void *)bccb);
splx(s);
return;
}
@@ -1876,26 +1744,26 @@ ahatimeout(void *arg)
* in attempting to handle errors in parrallel. Timeouts will
* be reinstated when the recovery process ends.
*/
- if ((accb->flags & ACCB_DEVICE_RESET) == 0) {
+ if ((bccb->flags & BCCB_DEVICE_RESET) == 0) {
struct ccb_hdr *ccb_h;
- if ((accb->flags & ACCB_RELEASE_SIMQ) == 0) {
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) == 0) {
xpt_freeze_simq(aha->sim, /*count*/1);
- accb->flags |= ACCB_RELEASE_SIMQ;
+ bccb->flags |= BCCB_RELEASE_SIMQ;
}
ccb_h = LIST_FIRST(&aha->pending_ccbs);
while (ccb_h != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- untimeout(ahatimeout, pending_accb, ccb_h->timeout_ch);
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ untimeout(ahatimeout, pending_bccb, ccb_h->timeout_ch);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
}
- if ((accb->flags & ACCB_DEVICE_RESET) != 0
- || aha->cur_outbox->action_code != AMBO_FREE) {
+ if ((bccb->flags & BCCB_DEVICE_RESET) != 0
+ || aha->cur_outbox->action_code != BMBO_FREE) {
/*
* Try a full host adapter/SCSI bus reset.
* We do this only if we have already attempted
@@ -1917,22 +1785,22 @@ ahatimeout(void *arg)
* If this fails, we'll get another timeout 2 seconds
* later which will attempt a bus reset.
*/
- accb->flags |= ACCB_DEVICE_RESET;
- ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)accb, 2 * hz);
- aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET;
+ bccb->flags |= BCCB_DEVICE_RESET;
+ ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)bccb, 2 * hz);
+ aha->recovery_bccb->hccb.opcode = INITIATOR_BUS_DEV_RESET;
/* No Data Transfer */
- aha->recovery_accb->hccb.datain = TRUE;
- aha->recovery_accb->hccb.dataout = TRUE;
- aha->recovery_accb->hccb.ahastat = 0;
- aha->recovery_accb->hccb.sdstat = 0;
- aha->recovery_accb->hccb.target = ccb->ccb_h.target_id;
+ aha->recovery_bccb->hccb.datain = TRUE;
+ aha->recovery_bccb->hccb.dataout = TRUE;
+ aha->recovery_bccb->hccb.ahastat = 0;
+ aha->recovery_bccb->hccb.sdstat = 0;
+ aha->recovery_bccb->hccb.target = ccb->ccb_h.target_id;
/* Tell the adapter about this command */
- paddr = ahaccbvtop(aha, aha->recovery_accb);
+ paddr = ahaccbvtop(aha, aha->recovery_bccb);
ahautoa24(paddr, aha->cur_outbox->ccb_addr);
- aha->cur_outbox->action_code = AMBO_START;
- aha_outb(aha, COMMAND_REG, AOP_START_MBOX);
+ aha->cur_outbox->action_code = BMBO_START;
+ aha_outb(aha, COMMAND_REG, BOP_START_MBOX);
ahanextoutbox(aha);
}
diff --git a/sys/dev/aha/ahareg.h b/sys/dev/aha/ahareg.h
index 82f3f4a49bd4..7af8b537d40d 100644
--- a/sys/dev/aha/ahareg.h
+++ b/sys/dev/aha/ahareg.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahareg.h,v 1.4 1998/11/10 06:44:42 gibbs Exp $
+ * $Id: ahareg.h,v 1.2 1998/10/01 04:53:55 imp Exp $
*/
#ifndef _AHAREG_H_
@@ -101,41 +101,41 @@
* Opcodes for Adapter commands.
*/
typedef enum {
- AOP_NOP = 0x00,
- AOP_INITIALIZE_MBOX = 0x01,
- AOP_START_MBOX = 0x02,
- AOP_EXECUTE_BIOS_CMD = 0x03,
- AOP_INQUIRE_BOARD_ID = 0x04,
- AOP_ENABLE_OMBR_INT = 0x05,
- AOP_SET_SEL_TIMOUT = 0x06,
- AOP_SET_TIME_ON_BUS = 0x07,
- AOP_SET_TIME_OFF_BUS = 0x08,
- AOP_SET_BUS_TRANS_RATE = 0x09,
- AOP_INQUIRE_INST_LDEVS = 0x0A,
- AOP_INQUIRE_CONFIG = 0x0B,
- AOP_ENABLE_TARGET_MODE = 0x0C,
- AOP_INQUIRE_SETUP_INFO = 0x0D,
- AOP_WRITE_LRAM = 0x1A,
- AOP_READ_LRAM = 0x1B,
- AOP_WRITE_CHIP_FIFO = 0x1C,
- AOP_READ_CHIP_FIFO = 0x1D,
- AOP_ECHO_DATA_BYTE = 0x1F,
- AOP_ADAPTER_DIAGNOSTICS = 0x20,
- AOP_SET_ADAPTER_OPTIONS = 0x21,
- AOP_SET_EEPROM = 0x22,
- AOP_RETURN_EEPROM = 0x23,
- AOP_ENABLE_SHADOW_RAM = 0x24,
- AOP_INIT_BIOS_MBOX = 0x25,
- AOP_SET_BIOS_BANK_1 = 0x26,
- AOP_SET_BIOS_BANK_2 = 0x27,
- AOP_RETURN_EXT_BIOS_INFO= 0x28,
- AOP_MBOX_IF_ENABLE = 0x29,
- AOP_SCSI_TERM_STATUS = 0x2C,
- AOP_INQUIRE_SCAM_DEV = 0x2D,
- AOP_SCSI_DEV_TABLE = 0x2E,
- AOP_SCAM_OP = 0x2F,
- AOP_START_BIOS_CMD = 0x82,
- AOP_INQUIRE_ESETUP_INFO = 0x8D
+ BOP_NOP = 0x00,
+ BOP_INITIALIZE_MBOX = 0x01,
+ BOP_START_MBOX = 0x02,
+ BOP_EXECUTE_BIOS_CMD = 0x03,
+ BOP_INQUIRE_BOARD_ID = 0x04,
+ BOP_ENABLE_OMBR_INT = 0x05,
+ BOP_SET_SEL_TIMOUT = 0x06,
+ BOP_SET_TIME_ON_BUS = 0x07,
+ BOP_SET_TIME_OFF_BUS = 0x08,
+ BOP_SET_BUS_TRANS_RATE = 0x09,
+ BOP_INQUIRE_INST_LDEVS = 0x0A,
+ BOP_INQUIRE_CONFIG = 0x0B,
+ BOP_ENABLE_TARGET_MODE = 0x0C,
+ BOP_INQUIRE_SETUP_INFO = 0x0D,
+ BOP_WRITE_LRAM = 0x1A,
+ BOP_READ_LRAM = 0x1B,
+ BOP_WRITE_CHIP_FIFO = 0x1C,
+ BOP_READ_CHIP_FIFO = 0x1D,
+ BOP_ECHO_DATA_BYTE = 0x1F,
+ BOP_ADAPTER_DIAGNOSTICS = 0x20,
+ BOP_SET_ADAPTER_OPTIONS = 0x21,
+ BOP_SET_EEPROM = 0x22,
+ BOP_RETURN_EEPROM = 0x23,
+ BOP_ENABLE_SHADOW_RAM = 0x24,
+ BOP_INIT_BIOS_MBOX = 0x25,
+ BOP_SET_BIOS_BANK_1 = 0x26,
+ BOP_SET_BIOS_BANK_2 = 0x27,
+ BOP_RETURN_EXT_BIOS_INFO= 0x28,
+ BOP_MBOX_IF_ENABLE = 0x29,
+ BOP_SCSI_TERM_STATUS = 0x2C,
+ BOP_INQUIRE_SCAM_DEV = 0x2D,
+ BOP_SCSI_DEV_TABLE = 0x2E,
+ BOP_SCAM_OP = 0x2F,
+ BOP_START_BIOS_CMD = 0x82,
+ BOP_INQUIRE_ESETUP_INFO = 0x8D
} aha_op_t;
/************** Definitions of Multi-byte commands and responses ************/
@@ -217,9 +217,10 @@ typedef struct {
struct aha_isa_port {
u_int16_t addr;
u_int8_t probed;
- u_int8_t bio; /* board IO offset */
};
+extern struct aha_isa_port aha_isa_ports[];
+
#define AHA_NUM_ISAPORTS 6
typedef enum {
@@ -245,9 +246,9 @@ typedef struct {
/********************** Mail Box definitions *******************************/
typedef enum {
- AMBO_FREE = 0x0, /* MBO intry is free */
- AMBO_START = 0x1, /* MBO activate entry */
- AMBO_ABORT = 0x2 /* MBO abort entry */
+ BMBO_FREE = 0x0, /* MBO intry is free */
+ BMBO_START = 0x1, /* MBO activate entry */
+ BMBO_ABORT = 0x2 /* MBO abort entry */
} aha_mbo_action_code_t;
typedef struct aha_mbox_out {
@@ -256,11 +257,11 @@ typedef struct aha_mbox_out {
} aha_mbox_out_t;
typedef enum {
- AMBI_FREE = 0x0, /* MBI entry is free */
- AMBI_OK = 0x1, /* completed without error */
- AMBI_ABORT = 0x2, /* aborted ccb */
- AMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */
- AMBI_ERROR = 0x4 /* Completed with error */
+ BMBI_FREE = 0x0, /* MBI entry is free */
+ BMBI_OK = 0x1, /* completed without error */
+ BMBI_ABORT = 0x2, /* aborted ccb */
+ BMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */
+ BMBI_ERROR = 0x4 /* Completed with error */
} aha_mbi_comp_code_t;
typedef struct aha_mbox_in {
@@ -312,11 +313,11 @@ struct aha_hccb {
};
typedef enum {
- ACCB_FREE = 0x0,
- ACCB_ACTIVE = 0x1,
- ACCB_DEVICE_RESET = 0x2,
- ACCB_RELEASE_SIMQ = 0x4
-} accb_flags_t;
+ BCCB_FREE = 0x0,
+ BCCB_ACTIVE = 0x1,
+ BCCB_DEVICE_RESET = 0x2,
+ BCCB_RELEASE_SIMQ = 0x4
+} bccb_flags_t;
struct aha_ccb {
struct aha_hccb hccb; /* hccb assumed to be at 0 */
@@ -347,15 +348,12 @@ struct aha_softc {
struct aha_ccb *aha_ccb_array;
SLIST_HEAD(,aha_ccb) free_aha_ccbs;
LIST_HEAD(,ccb_hdr) pending_ccbs;
- u_int active_ccbs;
u_int32_t aha_ccb_physbase;
- aha_ccb_opcode_t ccb_sg_opcode;
- aha_ccb_opcode_t ccb_ccb_opcode;
aha_mbox_in_t *in_boxes;
aha_mbox_out_t *out_boxes;
struct scsi_sense_data *sense_buffers;
u_int32_t sense_buffers_physbase;
- struct aha_ccb *recovery_accb;
+ struct aha_ccb *recovery_bccb;
u_int num_boxes;
bus_dma_tag_t parent_dmat; /*
* All dmat's derive from
@@ -412,11 +410,6 @@ char * aha_name(struct aha_softc *aha);
int aha_check_probed_iop(u_int ioport);
void aha_mark_probed_bio(isa_compat_io_t port);
void aha_mark_probed_iop(u_int ioport);
-void aha_find_probe_range(int ioport,
- int *port_index,
- int *max_port_index);
-
-int aha_iop_from_bio(isa_compat_io_t bio_index);
#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */
int aha_cmd(struct aha_softc *aha, aha_op_t opcode,
@@ -430,18 +423,4 @@ int aha_cmd(struct aha_softc *aha, aha_op_t opcode,
#define aha_outb(aha, port, value) \
bus_space_write_1((aha)->tag, (aha)->bsh, port, value)
-
-#ifndef EXTRA_AHA
-#if NPNP > 0
-#define EXTRA_AHA MAX_PNP_CARDS
-#else
-#define EXTRA_AHA 0
-#endif
-#endif
-
-#define NAHATOT (NAHA + EXTRA_AHA)
-
-#define AHA1542_PNP 0x42159004 /* ADP1542 */
-#define AHA1542_PNPCOMPAT 0xA000D040 /* PNP00A0 */
-
#endif /* _AHA_H_ */
diff --git a/sys/dev/aic7xxx/Makefile b/sys/dev/aic7xxx/Makefile
index b47dab352081..0a74ca9c8c47 100644
--- a/sys/dev/aic7xxx/Makefile
+++ b/sys/dev/aic7xxx/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 1997/09/27 19:37:22 gibbs Exp $
+# $Id: Makefile,v 1.3 1997/09/03 03:44:32 gibbs Exp $
PROG= aicasm
@@ -19,7 +19,7 @@ LDADD+= -ll
DEPENDFILE=
.endif
-CFLAGS+= -I/usr/include -I.
+CFLAGS+= -I.
NOMAN= noman
.ifdef DEBUG
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c
index e442be536b9e..48014aef3e1a 100644
--- a/sys/dev/aic7xxx/aic7xxx.c
+++ b/sys/dev/aic7xxx/aic7xxx.c
@@ -5,7 +5,7 @@
* pci/ahc_pci.c 3985, 3980, 3940, 2940, aic7895, aic7890,
* aic7880, aic7870, aic7860, and aic7850 controllers
*
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999 Justin T. Gibbs.
+ * Copyright (c) 1994, 1995, 1996, 1997, 1998 Justin T. Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.15 1999/01/14 06:14:14 gibbs Exp $
+ * $Id: aic7xxx.c,v 1.8 1998/10/15 18:21:47 gibbs Exp $
*/
/*
* A few notes on features of the driver.
@@ -133,8 +133,9 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define ALL_TARGETS (~0)
+#define ALL_LUNS (~0)
#define ALL_CHANNELS '\0'
-#define ALL_TARGETS_MASK 0xFFFF
#define SIM_IS_SCSIBUS_B(ahc, sim) \
(sim == ahc->sim_b)
@@ -154,22 +155,11 @@
#define ccb_scb_ptr spriv_ptr0
#define ccb_ahc_ptr spriv_ptr1
-typedef enum {
- ROLE_UNKNOWN,
- ROLE_INITIATOR,
- ROLE_TARGET,
-} role_t;
-
struct ahc_devinfo {
int target_offset;
u_int16_t target_mask;
u_int8_t target;
- u_int8_t lun;
char channel;
- role_t role; /*
- * Only guaranteed to be correct if not
- * in the busfree state.
- */
};
typedef enum {
@@ -188,10 +178,9 @@ static int ahc_debug = AHC_DEBUG;
void ahc_pci_intr(struct ahc_softc *ahc);
#endif
-#if UNUSED
static void ahc_dump_targcmd(struct target_cmd *cmd);
-#endif
static void ahc_shutdown(int howto, void *arg);
+static void ahcminphys(struct buf *bp);
static cam_status
ahc_find_tmode_devs(struct ahc_softc *ahc,
struct cam_sim *sim, union ccb *ccb,
@@ -215,33 +204,16 @@ static struct scb *
static void ahc_fetch_devinfo(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo);
static void ahc_compile_devinfo(struct ahc_devinfo *devinfo,
- u_int target, u_int lun, char channel,
- role_t role);
+ u_int target, char channel);
static u_int ahc_abort_wscb(struct ahc_softc *ahc, u_int scbpos, u_int prev);
static void ahc_done(struct ahc_softc *ahc, struct scb *scbp);
-static void ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim,
- union ccb *ccb);
-static int ahc_handle_target_cmd(struct ahc_softc *ahc,
- struct target_cmd *cmd);
+static void ahc_handle_target_cmd(struct ahc_softc *ahc);
static void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat);
static void ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat);
-static void ahc_build_transfer_msg(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static void ahc_setup_initiator_msgout(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct scb *scb);
-static void ahc_setup_target_msgin(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static int ahc_handle_msg_reject(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static void ahc_clear_msg_state(struct ahc_softc *ahc);
-static void ahc_handle_message_phase(struct ahc_softc *ahc,
- struct cam_path *path);
-static int ahc_sent_msg(struct ahc_softc *ahc, u_int msgtype, int full);
-static int ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
+static void ahc_handle_reqinit(struct ahc_softc *ahc,
+ struct scb *scb);
+static int ahc_parse_msg(struct ahc_softc *ahc, struct scb *scb,
struct ahc_devinfo *devinfo);
-static void ahc_handle_ign_wide_residue(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
static void ahc_handle_devreset(struct ahc_softc *ahc, int target,
char channel, cam_status status,
ac_code acode, char *message,
@@ -260,8 +232,6 @@ static void ahc_print_scb(struct scb *scb);
static int ahc_search_qinfifo(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
u_int32_t status, ahc_search_action action);
-static void ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim,
- union ccb *ccb);
static int ahc_reset_channel(struct ahc_softc *ahc, char channel,
int initiate_reset);
static int ahc_abort_scbs(struct ahc_softc *ahc, int target,
@@ -275,8 +245,6 @@ static void ahc_add_curscb_to_free_list(struct ahc_softc *ahc);
static void ahc_clear_intstat(struct ahc_softc *ahc);
static void ahc_reset_current_bus(struct ahc_softc *ahc);
static struct ahc_syncrate *
- ahc_devlimited_syncrate(struct ahc_softc *ahc, u_int *period);
-static struct ahc_syncrate *
ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
u_int maxsync);
static u_int ahc_find_period(struct ahc_softc *ahc, u_int scsirate,
@@ -284,13 +252,6 @@ static u_int ahc_find_period(struct ahc_softc *ahc, u_int scsirate,
static void ahc_validate_offset(struct ahc_softc *ahc,
struct ahc_syncrate *syncrate,
u_int *offset, int wide);
-static void ahc_update_target_msg_request(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct ahc_target_tinfo *tinfo,
- int force);
-static int ahc_create_path(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct cam_path **path);
static void ahc_set_syncrate(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo,
struct cam_path *path,
@@ -312,7 +273,6 @@ static void ahc_set_recoveryscb(struct ahc_softc *ahc, struct scb *scb);
static timeout_t
ahc_timeout;
-static __inline int sequencer_paused(struct ahc_softc *ahc);
static __inline void pause_sequencer(struct ahc_softc *ahc);
static __inline void unpause_sequencer(struct ahc_softc *ahc,
int unpause_always);
@@ -335,12 +295,6 @@ ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index)
#define AHC_BUSRESET_DELAY 25 /* Reset delay in us */
-static __inline int
-sequencer_paused(struct ahc_softc *ahc)
-{
- return ((ahc_inb(ahc, HCNTRL) & PAUSE) != 0);
-}
-
static __inline void
pause_sequencer(struct ahc_softc *ahc)
{
@@ -350,15 +304,16 @@ pause_sequencer(struct ahc_softc *ahc)
* Since the sequencer can disable pausing in a critical section, we
* must loop until it actually stops.
*/
- while (sequencer_paused(ahc) == 0)
+ while ((ahc_inb(ahc, HCNTRL) & PAUSE) == 0)
;
}
static __inline void
unpause_sequencer(struct ahc_softc *ahc, int unpause_always)
{
- if (unpause_always
- || (ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0)
+ if ((ahc->flags & AHC_HANDLING_REQINITS) == 0
+ && (unpause_always
+ || (ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0))
ahc_outb(ahc, HCNTRL, ahc->unpause);
}
@@ -418,7 +373,7 @@ ahc_name(struct ahc_softc *ahc)
{
static char name[10];
- snprintf(name, sizeof(name), "ahc%d", ahc->unit);
+ sprintf(name, "ahc%d", ahc->unit);
return (name);
}
@@ -604,30 +559,6 @@ ahc_reset(struct ahc_softc *ahc)
}
/*
- * Called when we have an active connection to a target on the bus,
- * this function finds the nearest syncrate to the input period limited
- * by the capabilities of the bus connectivity of the target.
- */
-static struct ahc_syncrate *
-ahc_devlimited_syncrate(struct ahc_softc *ahc, u_int *period) {
- u_int maxsync;
-
- if ((ahc->features & AHC_ULTRA2) != 0) {
- if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
- && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
- maxsync = AHC_SYNCRATE_ULTRA2;
- } else {
- maxsync = AHC_SYNCRATE_ULTRA;
- }
- } else if ((ahc->features & AHC_ULTRA) != 0) {
- maxsync = AHC_SYNCRATE_ULTRA;
- } else {
- maxsync = AHC_SYNCRATE_FAST;
- }
- return (ahc_find_syncrate(ahc, period, maxsync));
-}
-
-/*
* Look up the valid period to SCSIRATE conversion in our table.
* Return the period and offset that should be sent to the target
* if this was the beginning of an SDTR.
@@ -721,62 +652,10 @@ ahc_validate_offset(struct ahc_softc *ahc, struct ahc_syncrate *syncrate,
}
static void
-ahc_update_target_msg_request(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct ahc_target_tinfo *tinfo,
- int force)
-{
- int paused;
- u_int targ_msg_req_orig;
-
- targ_msg_req_orig = ahc->targ_msg_req;
- if (tinfo->current.period != tinfo->goal.period
- || tinfo->current.width != tinfo->goal.width
- || (force
- && (tinfo->goal.period != 0
- || tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT)))
- ahc->targ_msg_req |= devinfo->target_mask;
- else
- ahc->targ_msg_req &= ~devinfo->target_mask;
-
- if (ahc->targ_msg_req != targ_msg_req_orig) {
- /* Update the message request bit for this target */
- paused = sequencer_paused(ahc);
-
- if (!paused)
- pause_sequencer(ahc);
-
- ahc_outb(ahc, TARGET_MSG_REQUEST, ahc->targ_msg_req & 0xFF);
- ahc_outb(ahc, TARGET_MSG_REQUEST + 1,
- (ahc->targ_msg_req >> 8) & 0xFF);
-
- if (!paused)
- unpause_sequencer(ahc, /*unpause always*/FALSE);
- }
-}
-
-static int
-ahc_create_path(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
- struct cam_path **path)
-{
- path_id_t path_id;
-
- if (devinfo->channel == 'B')
- path_id = cam_sim_path(ahc->sim_b);
- else
- path_id = cam_sim_path(ahc->sim);
-
- return (xpt_create_path(path, /*periph*/NULL,
- path_id, devinfo->target,
- devinfo->lun));
-}
-
-static void
ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
struct cam_path *path, struct ahc_syncrate *syncrate,
u_int period, u_int offset, u_int type)
{
- struct ahc_target_tinfo *tinfo;
u_int old_period;
u_int old_offset;
@@ -785,16 +664,15 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
offset = 0;
}
- tinfo = &ahc->transinfo[devinfo->target_offset];
- old_period = tinfo->current.period;
- old_offset = tinfo->current.offset;
+ old_period = ahc->transinfo[devinfo->target_offset].current.period;
+ old_offset = ahc->transinfo[devinfo->target_offset].current.offset;
if ((type & AHC_TRANS_CUR) != 0
&& (old_period != period || old_offset != offset)) {
- struct cam_path *path2;
+ struct ccb_trans_settings neg;
u_int scsirate;
- scsirate = tinfo->scsirate;
+ scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
if ((ahc->features & AHC_ULTRA2) != 0) {
scsirate &= ~SXFR_ULTRA2;
@@ -803,8 +681,11 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
scsirate |= syncrate->sxfr_ultra2;
}
- if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
+ if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE) {
ahc_outb(ahc, SCSIOFFSET, offset);
+ }
+ ahc_outb(ahc, TARG_OFFSET + devinfo->target_offset,
+ offset);
} else {
scsirate &= ~(SXFR|SOFS);
@@ -833,45 +714,25 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
ahc_outb(ahc, SCSIRATE, scsirate);
- tinfo->scsirate = scsirate;
- tinfo->current.period = period;
- tinfo->current.offset = offset;
+ ahc->transinfo[devinfo->target_offset].scsirate = scsirate;
+ ahc->transinfo[devinfo->target_offset].current.period = period;
+ ahc->transinfo[devinfo->target_offset].current.offset = offset;
/* Update the syncrates in any pending scbs */
ahc_update_pending_syncrates(ahc);
/*
- * If possible, tell the SCSI layer about the
+ * Tell the SCSI layer about the
* new transfer parameters.
*/
- /* If possible, update the XPT's notion of our transfer rate */
- path2 = NULL;
- if (path == NULL) {
- int error;
-
- error = ahc_create_path(ahc, devinfo, &path2);
- if (error == CAM_REQ_CMP)
- path = path2;
- else
- path2 = NULL;
- }
-
- if (path != NULL) {
- struct ccb_trans_settings neg;
-
- neg.sync_period = period;
- neg.sync_offset = offset;
- neg.valid = CCB_TRANS_SYNC_RATE_VALID
- | CCB_TRANS_SYNC_OFFSET_VALID;
- xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, path, &neg);
- }
-
- if (path2 != NULL)
- xpt_free_path(path2);
-
+ neg.sync_period = period;
+ neg.sync_offset = offset;
+ neg.valid = CCB_TRANS_SYNC_RATE_VALID
+ | CCB_TRANS_SYNC_OFFSET_VALID;
+ xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, path, &neg);
if (bootverbose) {
- if (offset != 0) {
+ if (neg.sync_offset != 0) {
printf("%s: target %d synchronous at %sMHz, "
"offset = 0x%x\n", ahc_name(ahc),
devinfo->target, syncrate->rate, offset);
@@ -884,80 +745,57 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
}
if ((type & AHC_TRANS_GOAL) != 0) {
- tinfo->goal.period = period;
- tinfo->goal.offset = offset;
+ ahc->transinfo[devinfo->target_offset].goal.period = period;
+ ahc->transinfo[devinfo->target_offset].goal.offset = offset;
}
if ((type & AHC_TRANS_USER) != 0) {
- tinfo->user.period = period;
- tinfo->user.offset = offset;
+ ahc->transinfo[devinfo->target_offset].user.period = period;
+ ahc->transinfo[devinfo->target_offset].user.offset = offset;
}
-
- ahc_update_target_msg_request(ahc, devinfo, tinfo, /*force*/FALSE);
}
static void
ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
struct cam_path *path, u_int width, u_int type)
{
- struct ahc_target_tinfo *tinfo;
- u_int oldwidth;
+ u_int oldwidth;
- tinfo = &ahc->transinfo[devinfo->target_offset];
- oldwidth = tinfo->current.width;
+ oldwidth = ahc->transinfo[devinfo->target_offset].current.width;
if ((type & AHC_TRANS_CUR) != 0 && oldwidth != width) {
- struct cam_path *path2;
+ struct ccb_trans_settings neg;
u_int scsirate;
- scsirate = tinfo->scsirate;
+ scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
scsirate &= ~WIDEXFER;
if (width == MSG_EXT_WDTR_BUS_16_BIT)
scsirate |= WIDEXFER;
- tinfo->scsirate = scsirate;
+ ahc->transinfo[devinfo->target_offset].scsirate = scsirate;
if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
ahc_outb(ahc, SCSIRATE, scsirate);
- tinfo->current.width = width;
-
- /* If possible, update the XPT's notion of our transfer rate */
- path2 = NULL;
- if (path == NULL) {
- int error;
-
- error = ahc_create_path(ahc, devinfo, &path2);
- if (error == CAM_REQ_CMP)
- path = path2;
- else
- path2 = NULL;
- }
-
- if (path != NULL) {
- struct ccb_trans_settings neg;
-
- neg.bus_width = width;
- neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
- xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, path, &neg);
- }
-
- if (path2 != NULL)
- xpt_free_path(path2);
+ ahc->transinfo[devinfo->target_offset].current.width = width;
+ /* Tell the SCSI layer about the new transfer params */
+ neg.bus_width = width;
+ neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
+ xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, path, &neg);
if (bootverbose) {
printf("%s: target %d using %dbit transfers\n",
ahc_name(ahc), devinfo->target,
- 8 * (0x01 << width));
+ 8 * (0x01 << neg.bus_width));
}
}
- if ((type & AHC_TRANS_GOAL) != 0)
- tinfo->goal.width = width;
- if ((type & AHC_TRANS_USER) != 0)
- tinfo->user.width = width;
-
- ahc_update_target_msg_request(ahc, devinfo, tinfo, /*force*/FALSE);
+ if ((type & AHC_TRANS_GOAL) != 0) {
+ ahc->transinfo[devinfo->target_offset].goal.width = width;
+ }
+ if ((type & AHC_TRANS_USER) != 0) {
+ ahc->transinfo[devinfo->target_offset].user.width = width;
+ }
}
/*
@@ -1089,29 +927,19 @@ fail:
static void
ahc_fetch_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
- u_int saved_tcl;
- role_t role;
-
- if (ahc_inb(ahc, SSTAT0) & TARGET)
- role = ROLE_TARGET;
- else
- role = ROLE_INITIATOR;
+ u_int saved_tcl;
saved_tcl = ahc_inb(ahc, SAVED_TCL);
ahc_compile_devinfo(devinfo, (saved_tcl >> 4) & 0x0f,
- saved_tcl & 0x3, (saved_tcl & SELBUSB) ? 'B': 'A',
- role);
+ (saved_tcl & SELBUSB) ? 'B': 'A');
}
static void
-ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int target, u_int lun,
- char channel, role_t role)
+ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int target, char channel)
{
devinfo->target = target;
- devinfo->lun = lun;
devinfo->target_offset = target;
devinfo->channel = channel;
- devinfo->role = role;
if (channel == 'B')
devinfo->target_offset += 8;
devinfo->target_mask = (0x01 << devinfo->target_offset);
@@ -1161,6 +989,12 @@ ahc_intr(void *arg)
scb_index = ahc->qoutfifo[ahc->qoutfifonext];
ahc->qoutfifo[ahc->qoutfifonext++] = SCB_LIST_NULL;
+ if (scb_index == TARGET_CMD_CMPLT
+ && (ahc->flags & AHC_TARGETMODE) != 0) {
+ ahc_handle_target_cmd(ahc);
+ continue;
+ }
+
scb = ahc->scb_data->scbarray[scb_index];
if (!scb || !(scb->flags & SCB_ACTIVE)) {
printf("%s: WARNING no command for scb %d "
@@ -1178,23 +1012,6 @@ ahc_intr(void *arg)
ahc_calc_residual(scb);
ahc_done(ahc, scb);
}
-
- if ((ahc->flags & AHC_TARGETMODE) != 0) {
- while (ahc->targetcmds[ahc->tqinfifonext].cmd_valid) {
- struct target_cmd *cmd;
-
- cmd = &ahc->targetcmds[ahc->tqinfifonext];
-
- /*
- * Only advance through the queue if we
- * had the resources to process the command.
- */
- if (ahc_handle_target_cmd(ahc, cmd) != 0)
- break;
- ahc->tqinfifonext++;
- cmd->cmd_valid = 0;
- }
- }
}
if (intstat & BRKADRINT) {
/*
@@ -1213,8 +1030,8 @@ ahc_intr(void *arg)
(ahc_inb(ahc, SEQADDR1) << 8));
/* Tell everyone that this HBA is no longer availible */
- ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, ALL_CHANNELS,
- CAM_LUN_WILDCARD, SCB_LIST_NULL, CAM_NO_HBA);
+ ahc_abort_scbs(ahc, ALL_TARGETS, ALL_CHANNELS,
+ ALL_LUNS, SCB_LIST_NULL, CAM_NO_HBA);
}
if (intstat & SEQINT)
ahc_handle_seqint(ahc, intstat);
@@ -1224,207 +1041,31 @@ ahc_intr(void *arg)
}
static void
-ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
-{
- struct tmode_tstate *tstate;
- struct tmode_lstate *lstate;
- struct ccb_en_lun *cel;
- cam_status status;
- int target;
- int lun;
-
- status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate,
- /* notfound_failure*/FALSE);
-
- if (status != CAM_REQ_CMP) {
- ccb->ccb_h.status = status;
- return;
- }
-
- cel = &ccb->cel;
- target = ccb->ccb_h.target_id;
- lun = ccb->ccb_h.target_lun;
- if (cel->enable != 0) {
- u_int scsiseq;
-
- /* Are we already enabled?? */
- if (lstate != NULL) {
- ccb->ccb_h.status = CAM_LUN_ALRDY_ENA;
- return;
- }
-
- if (cel->grp6_len != 0
- || cel->grp7_len != 0) {
- /*
- * Don't (yet?) support vendor
- * specific commands.
- */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- return;
- }
-
- /*
- * Seems to be okay.
- * Setup our data structures.
- */
- if (target != CAM_TARGET_WILDCARD && tstate == NULL) {
- tstate = malloc(sizeof(*tstate), M_DEVBUF, M_NOWAIT);
- if (tstate == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- return;
- }
- bzero(tstate, sizeof(*tstate));
- ahc->enabled_targets[target] = tstate;
- }
- lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT);
- if (lstate == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- return;
- }
- bzero(lstate, sizeof(*lstate));
- SLIST_INIT(&lstate->accept_tios);
- SLIST_INIT(&lstate->immed_notifies);
- if (target != CAM_TARGET_WILDCARD) {
- tstate->enabled_luns[lun] = lstate;
- ahc->enabled_luns++;
- } else
- ahc->black_hole = lstate;
- pause_sequencer(ahc);
- if ((ahc->features & AHC_MULTI_TID) != 0) {
- u_int16_t targid_mask;
-
- targid_mask = ahc_inb(ahc, TARGID)
- | (ahc_inb(ahc, TARGID + 1) << 8);
-
- targid_mask |= (0x01 << target);
- ahc_outb(ahc, TARGID, targid_mask);
- ahc_outb(ahc, TARGID+1, (targid_mask >> 8));
- }
- /* Allow select-in operations */
- if (ahc->black_hole != NULL && ahc->enabled_luns > 0) {
- scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
- scsiseq |= ENSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
- scsiseq = ahc_inb(ahc, SCSISEQ);
- scsiseq |= ENSELI;
- ahc_outb(ahc, SCSISEQ, scsiseq);
- }
- unpause_sequencer(ahc, /*always?*/FALSE);
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_print_path(ccb->ccb_h.path);
- printf("Lun now enabled for target mode\n");
- xpt_done(ccb);
- } else {
- struct ccb_hdr *elm;
-
- if (lstate == NULL) {
- ccb->ccb_h.status = CAM_LUN_INVALID;
- return;
- }
-
- ccb->ccb_h.status = CAM_REQ_CMP;
- LIST_FOREACH(elm, &ahc->pending_ccbs, sim_links.le) {
- if (elm->func_code == XPT_CONT_TARGET_IO
- && !xpt_path_comp(elm->path, ccb->ccb_h.path)){
- printf("CTIO pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- return;
- }
- }
-
- if (SLIST_FIRST(&lstate->accept_tios) != NULL) {
- printf("ATIOs pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- }
-
- if (SLIST_FIRST(&lstate->immed_notifies) != NULL) {
- printf("INOTs pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- }
-
- if (ccb->ccb_h.status == CAM_REQ_CMP) {
- int i, empty;
-
- xpt_print_path(ccb->ccb_h.path);
- printf("Target mode disabled\n");
- free(lstate, M_DEVBUF);
-
- pause_sequencer(ahc);
- /* Can we clean up the target too? */
- if (target != CAM_TARGET_WILDCARD) {
- tstate->enabled_luns[lun] = NULL;
- ahc->enabled_luns--;
- for (empty = 1, i = 0; i < 8; i++)
- if (tstate->enabled_luns[i] != NULL) {
- empty = 0;
- break;
- }
- if (empty) {
- free(tstate, M_DEVBUF);
- ahc->enabled_targets[target] = NULL;
- if (ahc->features & AHC_MULTI_TID) {
- u_int16_t targid_mask;
-
- targid_mask =
- ahc_inb(ahc, TARGID)
- | (ahc_inb(ahc, TARGID + 1)
- << 8);
-
- targid_mask &= (0x01 << target);
- ahc_outb(ahc, TARGID,
- targid_mask);
- ahc_outb(ahc, TARGID+1,
- (targid_mask >> 8));
- }
-
- for (empty = 1, i = 0; i < 16; i++)
- if (ahc->enabled_targets[i]
- != NULL) {
- empty = 0;
- break;
- }
- }
- } else {
-
- ahc->black_hole = NULL;
-
- /*
- * We can't allow selections without
- * our black hole device.
- */
- empty = TRUE;
- }
- if (empty) {
- /* Disallow select-in */
- u_int scsiseq;
-
- scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
- scsiseq &= ~ENSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
- scsiseq = ahc_inb(ahc, SCSISEQ);
- scsiseq &= ~ENSELI;
- ahc_outb(ahc, SCSISEQ, scsiseq);
- }
- unpause_sequencer(ahc, /*always?*/FALSE);
- }
- }
-}
-
-static int
-ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
+ahc_handle_target_cmd(struct ahc_softc *ahc)
{
struct tmode_tstate *tstate;
struct tmode_lstate *lstate;
struct ccb_accept_tio *atio;
+ struct target_cmd *cmd;
u_int8_t *byte;
int initiator;
int target;
int lun;
- initiator = cmd->initiator_channel >> 4;
+ cmd = &ahc->targetcmds[ahc->next_targetcmd];
+ ahc->next_targetcmd++;
+ if (ahc->next_targetcmd >= ahc->num_targetcmds)
+ ahc->next_targetcmd = 0;
+
+ initiator = cmd->icl >> 4;
target = cmd->targ_id;
lun = (cmd->identify & MSG_IDENTIFY_LUNMASK);
+ xpt_print_path(ahc->path);
+ printf("Received Target Command (%d:%d:%d)\n",
+ initiator, target, lun);
+ ahc_dump_targcmd(cmd);
+
byte = cmd->bytes;
tstate = ahc->enabled_targets[target];
lstate = NULL;
@@ -1432,28 +1073,23 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
lstate = tstate->enabled_luns[lun];
/*
- * Commands for disabled luns go to the black hole driver.
+ * XXX Need to have a default TMODE devce that attaches to luns
+ * that wouldn't otherwise be enabled and returns the proper
+ * inquiry information. After all, we don't want to duplicate
+ * this code in each driver. For now, simply drop it on the
+ * floor.
*/
if (lstate == NULL) {
printf("Incoming Command on disabled lun\n");
- lstate = ahc->black_hole;
- atio =
- (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
- /* Fill in the wildcards */
- atio->ccb_h.target_id = target;
- atio->ccb_h.target_lun = lun;
- } else {
- atio =
- (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
+ return;
}
+
+ atio = (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
+ /* XXX Should reconnect and return BUSY status */
if (atio == NULL) {
printf("No ATIOs for incoming command\n");
- /*
- * Wait for more ATIOs from the peripheral driver for this lun.
- */
- return (1);
+ return;
}
- SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle);
/*
* Package it up and send it off to
@@ -1494,6 +1130,7 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
}
bcopy(byte, atio->cdb_io.cdb_bytes, atio->cdb_len);
+ SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle);
atio->ccb_h.status |= CAM_CDB_RECVD;
if ((cmd->identify & MSG_IDENTIFY_DISCFLAG) == 0) {
@@ -1503,10 +1140,11 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
* continue target I/O comes in response
* to this accept tio.
*/
+ xpt_print_path(atio->ccb_h.path);
+ printf("Incoming Command did not disconnect %p\n", lstate);
ahc->pending_device = lstate;
}
xpt_done((union ccb*)atio);
- return (0);
}
static void
@@ -1581,6 +1219,130 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
devinfo.target);
}
break;
+ case EXTENDED_MSG:
+ {
+ ahc->msg_type = MSG_TYPE_INITIATOR_MSGIN;
+ ahc->msg_len = 0;
+ ahc->msg_index = 0;
+
+ /*
+ * To actually receive the message, simply turn on
+ * REQINIT interrupts and let our interrupt handler
+ * do the rest (REQINIT should already be true).
+ */
+ ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) | ENREQINIT);
+ ahc->flags |= AHC_HANDLING_REQINITS;
+ return;
+ }
+ case REJECT_MSG:
+ {
+ /*
+ * What we care about here is if we had an
+ * outstanding SDTR or WDTR message for this
+ * target. If we did, this is a signal that
+ * the target is refusing negotiation.
+ */
+ u_int scb_index;
+ u_int last_msg;
+
+ scb_index = ahc_inb(ahc, SCB_TAG);
+ scb = ahc->scb_data->scbarray[scb_index];
+
+ last_msg = ahc_inb(ahc, LAST_MSG);
+
+ if ((last_msg == MSG_IDENTIFYFLAG
+ || last_msg == HOST_MSG)
+ && (scb->flags & SCB_MSGOUT_WDTR) != 0
+ && (scb->flags & SCB_MSGOUT_SENT) != 0) {
+ struct ahc_target_tinfo *tinfo;
+
+ /* note 8bit xfers and clear flag */
+ printf("%s:%c:%d: refuses WIDE negotiation. Using "
+ "8bit transfers\n", ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->wdtrpending &= ~devinfo.target_mask;
+ ahc_set_width(ahc, &devinfo, scb->ccb->ccb_h.path,
+ MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
+ ahc_set_syncrate(ahc, &devinfo, scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0, AHC_TRANS_ACTIVE);
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ if (tinfo->goal.period) {
+ /* Start the sync negotiation */
+ ahc->sdtrpending |= devinfo.target_mask;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
+ }
+ } else if ((last_msg == MSG_IDENTIFYFLAG
+ || last_msg == HOST_MSG)
+ && (scb->flags & SCB_MSGOUT_SDTR) != 0
+ && (scb->flags & SCB_MSGOUT_SENT) != 0) {
+
+ /* note asynch xfers and clear flag */
+ ahc_set_syncrate(ahc, &devinfo, scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0,
+ AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->sdtrpending &= ~devinfo.target_mask;
+ printf("%s:%c:%d: refuses synchronous negotiation. "
+ "Using asynchronous transfers\n",
+ ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+ } else if ((last_msg == MSG_IDENTIFYFLAG)
+ && (scb->hscb->control & MSG_SIMPLE_Q_TAG) != 0) {
+ struct ccb_trans_settings neg;
+
+ printf("%s:%c:%d: refuses tagged commands. Performing "
+ "non-tagged I/O\n", ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+
+ ahc->tagenable &= ~devinfo.target_mask;
+ neg.flags = 0;
+ neg.valid = CCB_TRANS_TQ_VALID;
+ xpt_setup_ccb(&neg.ccb_h, scb->ccb->ccb_h.path,
+ /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, scb->ccb->ccb_h.path, &neg);
+ /*
+ * Resend the identify for this CCB as the target
+ * may believe that the selection is invalid otherwise.
+ */
+ ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL)
+ & ~MSG_SIMPLE_Q_TAG);
+ scb->hscb->control &= ~MSG_SIMPLE_Q_TAG;
+ scb->ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
+ ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
+ ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
+
+ /*
+ * Requeue all tagged commands for this target
+ * currently in our posession so they can be
+ * converted to untagged commands.
+ */
+ ahc_search_qinfifo(ahc, SCB_TARGET(scb),
+ SCB_CHANNEL(scb),
+ SCB_LUN(scb),
+ /*tag*/SCB_LIST_NULL,
+ CAM_REQUEUE_REQ,
+ SEARCH_COMPLETE);
+ } else {
+ /*
+ * Otherwise, we ignore it.
+ */
+#ifdef AHC_DEBUG
+ if (ahc_debug & AHC_SHOWMISC)
+ printf("%s:%c:%d: Message reject -- ignored\n",
+ ahc_name(ahc), devinfo.channel,
+ devinfo.target);
+#endif
+ break;
+ }
+ break;
+ }
case BAD_STATUS:
{
u_int scb_index;
@@ -1683,17 +1445,31 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
* but due to the way we page SCBs, we can't.
*/
hscb->control = 0;
-
/*
* This request sense could be because the
* the device lost power or in some other
* way has lost our transfer negotiations.
* Renegotiate if appropriate.
*/
+ ahc_set_width(ahc, &devinfo,
+ scb->ccb->ccb_h.path,
+ MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_CUR);
+ ahc_set_syncrate(ahc, &devinfo,
+ scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0, AHC_TRANS_CUR);
+ scb->flags &= ~SCB_MSGOUT_BITS;
tinfo = &ahc->transinfo[devinfo.target_offset];
- ahc_update_target_msg_request(ahc, &devinfo,
- tinfo,
- /*force*/TRUE);
+ if (tinfo->goal.width) {
+ ahc->wdtrpending |= devinfo.target_mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_WDTR;
+ } else if (tinfo->goal.period) {
+ ahc->sdtrpending |= devinfo.target_mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ }
hscb->status = 0;
hscb->SG_count = 1;
hscb->SG_pointer = scb->ahc_dmaphys;
@@ -1736,15 +1512,19 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
}
break;
}
- case TRACE_POINT:
+ case TARGET_SYNC_CMD:
{
- printf("SSTAT2 = 0x%x DFCNTRL = 0x%x\n", ahc_inb(ahc, SSTAT2),
- ahc_inb(ahc, DFCNTRL));
- printf("SSTAT3 = 0x%x DSTATUS = 0x%x\n", ahc_inb(ahc, SSTAT3),
- ahc_inb(ahc, DFSTATUS));
- printf("SSTAT0 = 0x%x, SCB_DATACNT = 0x%x\n",
- ahc_inb(ahc, SSTAT0),
- ahc_inb(ahc, SCB_DATACNT));
+ /*
+ * We've already processed the command. If the command
+ * is still pending, don't unpause the sequencer until
+ * it returns.
+ */
+ xpt_print_path(ahc->path);
+ printf("Saw a target sync cmd\n");
+ if (ahc->pending_device != NULL) {
+ printf(" Pending device too.\n");
+ return;
+ }
break;
}
case TARGET_MSG_HELP:
@@ -1755,56 +1535,105 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
restart_sequencer(ahc);
return;
}
- case HOST_MSG_LOOP:
+ case AWAITING_MSG:
{
+ u_int scb_index;
+
+ scb_index = ahc_inb(ahc, SCB_TAG);
+ scb = ahc->scb_data->scbarray[scb_index];
+
+ /*
+ * To facilitate adding multiple messages together,
+ * each routine should increment the index and len
+ * variables instead of setting them explicitly.
+ */
+ ahc->msg_index = 0;
+ ahc->msg_len = 0;
+
/*
- * The sequencer has encountered a message phase
- * that requires host assistance for completion.
- * While handling the message phase(s), we will be
- * notified by the sequencer after each byte is
- * transfered so we can track bus phases.
- *
- * If this is the first time we've seen a HOST_MSG_LOOP,
- * initialize the state of the host message loop.
+ * This SCB had MK_MESSAGE set in its control byte or
+ * we have explicitly set HOST_MSG in MSG_OUT,
+ * informing the sequencer that we want to send a
+ * special message to this target.
*/
- if (ahc->msg_type == MSG_TYPE_NONE) {
- u_int bus_phase;
-
- bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
- if (bus_phase != P_MESGIN && bus_phase != P_MESGOUT)
- panic("ahc_intr: HOST_MSG_LOOP bad phase 0x%x",
- bus_phase);
-
- if (devinfo.role == ROLE_INITIATOR) {
- struct scb *scb;
- u_int scb_index;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
-
- if (bus_phase == P_MESGOUT)
- ahc_setup_initiator_msgout(ahc,
- &devinfo,
- scb);
- else {
- ahc->msg_type =
- MSG_TYPE_INITIATOR_MSGIN;
- ahc->msgin_index = 0;
+ if ((scb->flags & SCB_DEVICE_RESET) == 0
+ && ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG
+ && (scb->hscb->control & TAG_ENB) != 0) {
+ ahc->msg_buf[ahc->msg_index++] =
+ scb->ccb->csio.tag_action;
+ ahc->msg_buf[ahc->msg_index++] =
+ scb->hscb->tag;
+ ahc->msg_len += 2;
+ }
+
+ if (scb->flags & SCB_DEVICE_RESET) {
+ ahc->msg_buf[ahc->msg_index++] = MSG_BUS_DEV_RESET;
+ ahc->msg_len++;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Bus Device Reset Message Sent\n");
+ } else if (scb->flags & SCB_ABORT) {
+ if ((scb->hscb->control & TAG_ENB) != 0)
+ ahc->msg_buf[ahc->msg_index++] = MSG_ABORT_TAG;
+ else
+ ahc->msg_buf[ahc->msg_index++] = MSG_ABORT;
+ ahc->msg_len++;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Abort Message Sent\n");
+ } else if (scb->flags & SCB_MSGOUT_WDTR) {
+ struct ahc_target_tinfo *tinfo;
+
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ ahc_construct_wdtr(ahc, tinfo->goal.width);
+ } else if (scb->flags & SCB_MSGOUT_SDTR) {
+ struct ahc_target_tinfo *tinfo;
+ u_int period;
+ u_int maxsync;
+
+ /*
+ * Now that the target is actually selected, we
+ * can further refine our sync rate based on the
+ * output transceiver mode.
+ */
+ if ((ahc->features & AHC_ULTRA2) != 0) {
+ if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
+ && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
+ maxsync = AHC_SYNCRATE_ULTRA2;
+ } else {
+ maxsync = AHC_SYNCRATE_ULTRA;
}
+ } else if ((ahc->features & AHC_ULTRA) != 0) {
+ maxsync = AHC_SYNCRATE_ULTRA;
} else {
- if (bus_phase == P_MESGOUT) {
- ahc->msg_type =
- MSG_TYPE_TARGET_MSGOUT;
- ahc->msgin_index = 0;
- } else
- /* XXX Ever executed??? */
- ahc_setup_target_msgin(ahc, &devinfo);
+ maxsync = AHC_SYNCRATE_FAST;
}
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ period = tinfo->goal.period;
+ ahc_find_syncrate(ahc, &period, maxsync);
+ ahc_construct_sdtr(ahc, period, tinfo->goal.offset);
+ } else {
+ printf("ahc_intr: AWAITING_MSG for an SCB that "
+ "does not have a waiting message");
+ panic("SCB = %d, SCB Control = %x, MSG_OUT = %x "
+ "SCB flags = %x", scb_index, scb->hscb->control,
+ ahc_inb(ahc, MSG_OUT), scb->flags);
}
- /* Pass a NULL path so that handlers generate their own */
- ahc_handle_message_phase(ahc, /*path*/NULL);
- break;
+ /*
+ * Record the fact that we attempted to send a message.
+ */
+ scb->flags |= SCB_MSGOUT_SENT;
+
+ /*
+ * To actually send the message, simply turn on
+ * REQINIT interrupts and let our interrupt handler
+ * do the rest (REQINIT should already be true).
+ */
+ ahc->msg_index = 0;
+ ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
+ ahc->flags |= AHC_HANDLING_REQINITS;
+ ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) | ENREQINIT);
+
+ return;
}
case DATA_OVERRUN:
{
@@ -1997,7 +1826,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
CAM_UNEXP_BUSFREE);
} else {
ahc_abort_scbs(ahc, target, channel,
- CAM_LUN_WILDCARD, SCB_LIST_NULL,
+ ALL_LUNS, SCB_LIST_NULL,
CAM_UNEXP_BUSFREE);
printf("%s: ", ahc_name(ahc));
}
@@ -2006,8 +1835,10 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
lastphase, ahc_inb(ahc, SEQADDR0)
| (ahc_inb(ahc, SEQADDR1) << 8));
}
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, MSG_OUT, MSG_NOOP);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
ahc_outb(ahc, CLRSINT1, CLRBUSFREE);
ahc_outb(ahc, CLRINT, CLRSCSIINT);
restart_sequencer(ahc);
@@ -2030,6 +1861,11 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
"valid during SELTO scb(%d, %d)\n",
ahc_name(ahc), scbptr, scb_index);
} else {
+ /*
+ * Clear any pending messages for the timed out
+ * target.
+ */
+ ahc_outb(ahc, MSG_OUT, MSG_NOOP);
ahc_handle_devreset(ahc, SCB_TARGET(scb),
SCB_CHANNEL(scb), CAM_SEL_TIMEOUT,
/*ac_code*/0, "Selection Timeout",
@@ -2038,7 +1874,9 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
/* Stop the selection */
ahc_outb(ahc, SCSISEQ, 0);
- ahc_clear_msg_state(ahc);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~ENREQINIT);
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRBUSFREE);
@@ -2109,14 +1947,14 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
* mesg_out to something other than MSG_NOP.
*/
if (mesg_out != MSG_NOOP) {
- if (ahc->msg_type != MSG_TYPE_NONE)
- ahc->send_msg_perror = TRUE;
- else
- ahc_outb(ahc, MSG_OUT, mesg_out);
+ ahc_outb(ahc, MSG_OUT, mesg_out);
}
ahc_outb(ahc, CLRSINT1, CLRSCSIPERR);
ahc_outb(ahc, CLRINT, CLRSCSIINT);
unpause_sequencer(ahc, /*unpause_always*/TRUE);
+ } else if ((status & REQINIT) != 0
+ && (ahc->flags & AHC_HANDLING_REQINITS) != 0) {
+ ahc_handle_reqinit(ahc, scb);
} else {
xpt_print_path(scb->ccb->ccb_h.path);
printf("Unknown SCSIINT. Status = 0x%x\n", status);
@@ -2127,529 +1965,101 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
}
static void
-ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * We need to initiate transfer negotiations.
- * If our current and goal settings are identical,
- * we want to renegotiate due to a check condition.
- */
- struct ahc_target_tinfo *tinfo;
- int dowide;
- int dosync;
-
- tinfo = &ahc->transinfo[devinfo->target_offset];
- dowide = tinfo->current.width != tinfo->goal.width;
- dosync = tinfo->current.period != tinfo->goal.period;
-
- if (!dowide && !dosync) {
- dowide = tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT;
- dosync = tinfo->goal.period != 0;
- }
-
- if (dowide)
- ahc_construct_wdtr(ahc, tinfo->goal.width);
- else if (dosync) {
- struct ahc_syncrate *rate;
- u_int period;
- u_int offset;
-
- period = tinfo->goal.period;
- rate = ahc_devlimited_syncrate(ahc, &period);
- offset = tinfo->goal.offset;
- ahc_validate_offset(ahc, rate, &offset,
- tinfo->current.width);
- ahc_construct_sdtr(ahc, period, offset);
- } else {
- panic("ahc_intr: AWAITING_MSG for negotiation, "
- "but no negotiation needed\n");
- }
-}
-
-static void
-ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
- struct scb *scb)
-{
- /*
- * To facilitate adding multiple messages together,
- * each routine should increment the index and len
- * variables instead of setting them explicitly.
- */
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
-
- if ((scb->flags & SCB_DEVICE_RESET) == 0
- && ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG) {
- u_int identify_msg;
-
- identify_msg = MSG_IDENTIFYFLAG | SCB_LUN(scb);
- if ((scb->hscb->control & DISCENB) != 0)
- identify_msg |= MSG_IDENTIFY_DISCFLAG;
- ahc->msgout_buf[ahc->msgout_index++] = identify_msg;
- ahc->msgout_len++;
-
- if ((scb->hscb->control & TAG_ENB) != 0) {
- ahc->msgout_buf[ahc->msgout_index++] =
- scb->ccb->csio.tag_action;
- ahc->msgout_buf[ahc->msgout_index++] = scb->hscb->tag;
- ahc->msgout_len += 2;
- }
- }
-
- if (scb->flags & SCB_DEVICE_RESET) {
- ahc->msgout_buf[ahc->msgout_index++] = MSG_BUS_DEV_RESET;
- ahc->msgout_len++;
- xpt_print_path(scb->ccb->ccb_h.path);
- printf("Bus Device Reset Message Sent\n");
- } else if (scb->flags & SCB_ABORT) {
- if ((scb->hscb->control & TAG_ENB) != 0)
- ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT_TAG;
- else
- ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT;
- ahc->msgout_len++;
- xpt_print_path(scb->ccb->ccb_h.path);
- printf("Abort Message Sent\n");
- } else if ((ahc->targ_msg_req & devinfo->target_mask) != 0) {
- ahc_build_transfer_msg(ahc, devinfo);
- } else {
- printf("ahc_intr: AWAITING_MSG for an SCB that "
- "does not have a waiting message");
- panic("SCB = %d, SCB Control = %x, MSG_OUT = %x "
- "SCB flags = %x", scb->hscb->tag, scb->hscb->control,
- ahc_inb(ahc, MSG_OUT), scb->flags);
- }
-
- /*
- * Clear the MK_MESSAGE flag from the SCB so we aren't
- * asked to send this message again.
- */
- ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL) & ~MK_MESSAGE);
- ahc->msgout_index = 0;
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
-}
-
-static void
-ahc_setup_target_msgin(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * To facilitate adding multiple messages together,
- * each routine should increment the index and len
- * variables instead of setting them explicitly.
- */
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
-
- if ((ahc->targ_msg_req & devinfo->target_mask) != 0)
- ahc_build_transfer_msg(ahc, devinfo);
- else
- panic("ahc_intr: AWAITING target message with no message");
-
- ahc->msgout_index = 0;
- ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
-}
-
-static int
-ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * What we care about here is if we had an
- * outstanding SDTR or WDTR message for this
- * target. If we did, this is a signal that
- * the target is refusing negotiation.
- */
- struct scb *scb;
- u_int scb_index;
- u_int last_msg;
- int response = 0;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
-
- /* Might be necessary */
- last_msg = ahc_inb(ahc, LAST_MSG);
-
- if (ahc_sent_msg(ahc, MSG_EXT_WDTR, /*full*/FALSE)) {
- struct ahc_target_tinfo *tinfo;
-
- /* note 8bit xfers and clear flag */
- printf("%s:%c:%d: refuses WIDE negotiation. Using "
- "8bit transfers\n", ahc_name(ahc),
- devinfo->channel, devinfo->target);
- ahc_set_width(ahc, devinfo, scb->ccb->ccb_h.path,
- MSG_EXT_WDTR_BUS_8_BIT,
- AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
- ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
- /*syncrate*/NULL, /*period*/0,
- /*offset*/0, AHC_TRANS_ACTIVE);
- tinfo = &ahc->transinfo[devinfo->target_offset];
- if (tinfo->goal.period) {
- u_int period;
-
- /* Start the sync negotiation */
- period = tinfo->goal.period;
- ahc_devlimited_syncrate(ahc, &period);
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, tinfo->goal.offset);
- ahc->msgout_index = 0;
- response = 1;
- }
- } else if (ahc_sent_msg(ahc, MSG_EXT_SDTR, /*full*/FALSE)) {
- /* note asynch xfers and clear flag */
- ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
- /*syncrate*/NULL, /*period*/0,
- /*offset*/0,
- AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
- printf("%s:%c:%d: refuses synchronous negotiation. "
- "Using asynchronous transfers\n",
- ahc_name(ahc),
- devinfo->channel, devinfo->target);
- } else if ((scb->hscb->control & MSG_SIMPLE_Q_TAG) != 0) {
- struct ccb_trans_settings neg;
-
- printf("%s:%c:%d: refuses tagged commands. Performing "
- "non-tagged I/O\n", ahc_name(ahc),
- devinfo->channel, devinfo->target);
-
- ahc->tagenable &= ~devinfo->target_mask;
- neg.flags = 0;
- neg.valid = CCB_TRANS_TQ_VALID;
- xpt_setup_ccb(&neg.ccb_h, scb->ccb->ccb_h.path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, scb->ccb->ccb_h.path, &neg);
-
- /*
- * Resend the identify for this CCB as the target
- * may believe that the selection is invalid otherwise.
- */
- ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL)
- & ~MSG_SIMPLE_Q_TAG);
- scb->hscb->control &= ~MSG_SIMPLE_Q_TAG;
- scb->ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
- ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
- ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
-
- /*
- * Requeue all tagged commands for this target
- * currently in our posession so they can be
- * converted to untagged commands.
- */
- ahc_search_qinfifo(ahc, SCB_TARGET(scb), SCB_CHANNEL(scb),
- SCB_LUN(scb), /*tag*/SCB_LIST_NULL,
- CAM_REQUEUE_REQ, SEARCH_COMPLETE);
- } else {
- /*
- * Otherwise, we ignore it.
- */
- printf("%s:%c:%d: Message reject for %x -- ignored\n",
- ahc_name(ahc), devinfo->channel, devinfo->target,
- last_msg);
- }
- return (response);
-}
-
-static void
-ahc_clear_msg_state(struct ahc_softc *ahc)
-{
- ahc->msgout_len = 0;
- ahc->msgin_index = 0;
- ahc->msg_type = MSG_TYPE_NONE;
- ahc_outb(ahc, MSG_OUT, MSG_NOOP);
-}
-
-static void
-ahc_handle_message_phase(struct ahc_softc *ahc, struct cam_path *path)
+ahc_handle_reqinit(struct ahc_softc *ahc, struct scb *scb)
{
struct ahc_devinfo devinfo;
- u_int bus_phase;
- int end_session;
+ u_int simode1;
ahc_fetch_devinfo(ahc, &devinfo);
-
- end_session = FALSE;
- bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
-
-reswitch:
switch (ahc->msg_type) {
case MSG_TYPE_INITIATOR_MSGOUT:
{
- int lastbyte;
- int phasemis;
- int msgdone;
+ int lastbyte;
+ int phasemis;
+ u_int bus_phase;
- if (ahc->msgout_len == 0)
+ if (ahc->msg_len == 0)
panic("REQINIT interrupt with no active message");
+ lastbyte = (ahc->msg_index == ahc->msg_len - 1);
+ bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
phasemis = bus_phase != P_MESGOUT;
- if (phasemis) {
- if (bus_phase == P_MESGIN) {
- /*
- * Change gears and see if
- * this messages is of interest to
- * us or should be passed back to
- * the sequencer.
- */
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- ahc->send_msg_perror = FALSE;
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGIN;
- ahc->msgin_index = 0;
- goto reswitch;
- }
- end_session = TRUE;
- break;
- }
-
- if (ahc->send_msg_perror) {
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_outb(ahc, SCSIDATL, MSG_PARITY_ERROR);
- break;
- }
-
- msgdone = ahc->msgout_index == ahc->msgout_len;
- if (msgdone) {
- /*
- * The target has requested a retry.
- * Re-assert ATN, reset our message index to
- * 0, and try again.
- */
- ahc->msgout_index = 0;
- ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
- }
-
- lastbyte = ahc->msgout_index == (ahc->msgout_len - 1);
- if (lastbyte) {
- /* Last byte is signified by dropping ATN */
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- }
- /*
- * Clear our interrupt status and present
- * the next byte on the bus.
- */
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
- break;
- }
- case MSG_TYPE_INITIATOR_MSGIN:
- {
- int phasemis;
- int message_done;
-
- phasemis = bus_phase != P_MESGIN;
-
- if (phasemis) {
- ahc->msgin_index = 0;
- if (bus_phase == P_MESGOUT
- && (ahc->send_msg_perror == TRUE
- || (ahc->msgout_len != 0
- && ahc->msgout_index == 0))) {
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
- goto reswitch;
+ if (lastbyte || phasemis) {
+ /* Time to end our message session */
+ ahc->msg_len = 0;
+ ahc->msg_type = MSG_TYPE_NONE;
+ simode1 = ahc_inb(ahc, SIMODE1) & ~ENREQINIT;
+ ahc_outb(ahc, SIMODE1, simode1);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+
+ if (phasemis == 0) {
+ ahc_outb(ahc, SINDEX,
+ ahc->msg_buf[ahc->msg_index]);
+ ahc_outb(ahc, RETURN_1, 0);
+ } else {
+ ahc_outb(ahc, RETURN_1, MSGOUT_PHASEMIS);
}
- end_session = TRUE;
- break;
- }
-
- /* Pull the byte in without acking it */
- ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIBUSL);
-
- message_done = ahc_parse_msg(ahc, path, &devinfo);
-
- if (message_done) {
- /*
- * Clear our incoming message buffer in case there
- * is another message following this one.
- */
- ahc->msgin_index = 0;
+ unpause_sequencer(ahc, /* unpause_always */TRUE);
+ } else {
/*
- * If this message illicited a response,
- * assert ATN so the target takes us to the
- * message out phase.
+ * Clear our interrupt status and present the byte
+ * on the bus, but don't unpause the sequencer.
*/
- if (ahc->msgout_len != 0)
- ahc_outb(ahc, SCSISIGO,
- ahc_inb(ahc, SCSISIGO) | ATNO);
+ ahc_outb(ahc, CLRSINT1, CLRREQINIT);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ ahc_outb(ahc, SCSIDATL, ahc->msg_buf[ahc->msg_index++]);
}
-
- /* Ack the byte */
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_inb(ahc, SCSIDATL);
- ahc->msgin_index++;
break;
}
- case MSG_TYPE_TARGET_MSGIN:
+ case MSG_TYPE_INITIATOR_MSGIN:
{
- int msgdone;
- int msgout_request;
+ int phasemis;
+ int done;
- if (ahc->msgout_len == 0)
- panic("Target MSGIN with no active message");
+ phasemis = (ahc_inb(ahc, SCSISIGI) & PHASE_MASK) != P_MESGIN;
- /*
- * If we interrupted a mesgout session, the initiator
- * will not know this until our first REQ. So, we
- * only honor mesgout requests after we've sent our
- * first byte.
- */
- if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0
- && ahc->msgout_index > 0)
- msgout_request = TRUE;
- else
- msgout_request = FALSE;
+ if (phasemis == 0) {
- if (msgout_request) {
-
- /*
- * Change gears and see if
- * this messages is of interest to
- * us or should be passed back to
- * the sequencer.
- */
- ahc->msg_type = MSG_TYPE_TARGET_MSGOUT;
- ahc_outb(ahc, SCSISIGO, P_MESGOUT | BSYO);
- ahc->msgin_index = 0;
- /* Dummy read to REQ for first byte */
+ ahc->msg_len++;
+ /* Pull the byte in without acking it */
+ ahc->msg_buf[ahc->msg_index] = ahc_inb(ahc, SCSIBUSL);
+ done = ahc_parse_msg(ahc, scb, &devinfo);
+ /* Ack the byte */
+ ahc_outb(ahc, CLRSINT1, CLRREQINIT);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_inb(ahc, SCSIDATL);
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- break;
+ ahc->msg_index++;
}
-
- msgdone = ahc->msgout_index == ahc->msgout_len;
- if (msgdone) {
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
- end_session = TRUE;
- break;
+ if (phasemis || done) {
+ /* Time to end our message session */
+ ahc->msg_len = 0;
+ ahc->msg_type = MSG_TYPE_NONE;
+ simode1 = ahc_inb(ahc, SIMODE1) & ~ENREQINIT;
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+ ahc_outb(ahc, SIMODE1, simode1);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ unpause_sequencer(ahc, /* unpause_always */TRUE);
}
-
- /*
- * Present the next byte on the bus.
- */
- ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
- break;
- }
- case MSG_TYPE_TARGET_MSGOUT:
- {
- int lastbyte;
- int msgdone;
-
- /*
- * The initiator signals that this is
- * the last byte by dropping ATN.
- */
- lastbyte = (ahc_inb(ahc, SCSISIGI) & ATNI) == 0;
-
- /*
- * Read the latched byte, but turn off SPIOEN first
- * so that we don't inadvertantly cause a REQ for the
- * next byte.
- */
- ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
- ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIDATL);
- msgdone = ahc_parse_msg(ahc, path, &devinfo);
- ahc->msgin_index++;
-
- /*
- * XXX Read spec about initiator dropping ATN too soon
- * and use msgdone to detect it.
- */
- if (msgdone) {
- ahc->msgin_index = 0;
-
- /*
- * If this message illicited a response, transition
- * to the Message in phase and send it.
- */
- if (ahc->msgout_len != 0) {
- ahc_outb(ahc, SCSISIGO, P_MESGIN | BSYO);
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
- ahc->msgin_index = 0;
- break;
- }
- }
-
- if (lastbyte)
- end_session = TRUE;
- else {
- /* Ask for the next byte. */
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- }
-
break;
}
default:
panic("Unknown REQINIT message type");
}
-
- if (end_session) {
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, RETURN_1, EXIT_MSG_LOOP);
- } else
- ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
}
-/*
- * See if we sent a particular extended message to the target.
- * If "full" is true, the target saw the full message.
- * If "full" is false, the target saw at least the first
- * byte of the message.
- */
static int
-ahc_sent_msg(struct ahc_softc *ahc, u_int msgtype, int full)
-{
- int found;
- int index;
-
- found = FALSE;
- index = 0;
-
- while (index < ahc->msgout_len) {
- if ((ahc->msgout_buf[index] & MSG_IDENTIFYFLAG) != 0
- || ahc->msgout_buf[index] == MSG_MESSAGE_REJECT)
- index++;
- else if (ahc->msgout_buf[index] >= MSG_SIMPLE_Q_TAG
- && ahc->msgout_buf[index] < MSG_IGN_WIDE_RESIDUE) {
- /* Skip tag type and tag id */
- index += 2;
- } else if (ahc->msgout_buf[index] == MSG_EXTENDED) {
- /* Found a candidate */
- if (ahc->msgout_buf[index+2] == msgtype) {
- u_int end_index;
-
- end_index = index + 1
- + ahc->msgout_buf[index + 1];
- if (full) {
- if (ahc->msgout_index > end_index)
- found = TRUE;
- } else if (ahc->msgout_index > index)
- found = TRUE;
- }
- break;
- } else {
- panic("ahc_sent_msg: Inconsistent msg buffer");
- }
- }
- return (found);
-}
-
-static int
-ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
+ahc_parse_msg(struct ahc_softc *ahc, struct scb *scb,
struct ahc_devinfo *devinfo)
{
int reject;
int done;
- int response;
u_int targ_scsirate;
done = FALSE;
- response = FALSE;
reject = FALSE;
targ_scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
/*
@@ -2658,48 +2068,26 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* the entire message is availible and has been
* handled, return TRUE indicating that we have
* parsed an entire message.
- *
- * In the case of extended messages, we accept the length
- * byte outright and perform more checking once we know the
- * extended message type.
*/
- switch (ahc->msgin_buf[0]) {
- case MSG_MESSAGE_REJECT:
- response = ahc_handle_msg_reject(ahc, devinfo);
- /* FALLTHROUGH */
- case MSG_NOOP:
- done = TRUE;
- break;
- case MSG_IGN_WIDE_RESIDUE:
- {
- struct ahc_target_tinfo *tinfo;
-
- tinfo = &ahc->transinfo[devinfo->target_offset];
- /* Wait for the whole message */
- if (ahc->msgin_index >= 1) {
- if (ahc->msgin_buf[1] != 1
- || tinfo->current.width == MSG_EXT_WDTR_BUS_8_BIT) {
- reject = TRUE;
- done = TRUE;
- } else
- ahc_handle_ign_wide_residue(ahc, devinfo);
- }
- break;
+ if (ahc->msg_buf[0] != MSG_EXTENDED) {
+ reject = TRUE;
}
- case MSG_EXTENDED:
- {
- /* Wait for enough of the message to begin validation */
- if (ahc->msgin_index < 2)
- break;
- switch (ahc->msgin_buf[2]) {
+
+ /*
+ * Just accept the length byte outright and perform
+ * more checking once we know the message type.
+ */
+ if (!reject && (ahc->msg_len > 2)) {
+ switch (ahc->msg_buf[2]) {
case MSG_EXT_SDTR:
{
struct ahc_syncrate *syncrate;
u_int period;
u_int offset;
u_int saved_offset;
+ u_int maxsync;
- if (ahc->msgin_buf[1] != MSG_EXT_SDTR_LEN) {
+ if (ahc->msg_buf[1] != MSG_EXT_SDTR_LEN) {
reject = TRUE;
break;
}
@@ -2707,19 +2095,28 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
/*
* Wait until we have both args before validating
* and acting on this message.
- *
- * Add one to MSG_EXT_SDTR_LEN to account for
- * the extended message preamble.
*/
- if (ahc->msgin_index < (MSG_EXT_SDTR_LEN + 1))
+ if (ahc->msg_len < (MSG_EXT_SDTR_LEN + /*preamble*/2))
break;
- period = ahc->msgin_buf[3];
- saved_offset = offset = ahc->msgin_buf[4];
- syncrate = ahc_devlimited_syncrate(ahc, &period);
+ period = ahc->msg_buf[3];
+ saved_offset = offset = ahc->msg_buf[4];
+ if ((ahc->features & AHC_ULTRA2) != 0) {
+ if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
+ && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
+ maxsync = AHC_SYNCRATE_ULTRA2;
+ } else {
+ maxsync = AHC_SYNCRATE_ULTRA;
+ }
+ } else if ((ahc->features & AHC_ULTRA) != 0) {
+ maxsync = AHC_SYNCRATE_ULTRA;
+ } else {
+ maxsync = AHC_SYNCRATE_FAST;
+ }
+ syncrate = ahc_find_syncrate(ahc, &period, maxsync);
ahc_validate_offset(ahc, syncrate, &offset,
targ_scsirate & WIDEXFER);
- ahc_set_syncrate(ahc, devinfo, path,
+ ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
syncrate, period, offset,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
@@ -2728,23 +2125,27 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* and didn't have to fall down to async
* transfers.
*/
- if (ahc_sent_msg(ahc, MSG_EXT_SDTR, /*full*/TRUE)) {
+ if ((scb->flags & (SCB_MSGOUT_SDTR|SCB_MSGOUT_SENT))
+ == (SCB_MSGOUT_SDTR|SCB_MSGOUT_SENT)) {
/* We started it */
if (saved_offset != offset) {
/* Went too low - force async */
reject = TRUE;
}
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->sdtrpending &= ~devinfo->target_mask;
} else {
/*
* Send our own SDTR in reply
*/
- if (bootverbose)
- printf("Sending SDTR!\n");
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, offset);
- ahc->msgout_index = 0;
- response = TRUE;
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc->sdtrpending |= devinfo->target_mask;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Sending SDTR!!\n");
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
}
done = TRUE;
break;
@@ -2752,10 +2153,8 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
case MSG_EXT_WDTR:
{
u_int bus_width;
- u_int sending_reply;
- sending_reply = FALSE;
- if (ahc->msgin_buf[1] != MSG_EXT_WDTR_LEN) {
+ if (ahc->msg_buf[1] != MSG_EXT_WDTR_LEN) {
reject = TRUE;
break;
}
@@ -2763,26 +2162,13 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
/*
* Wait until we have our arg before validating
* and acting on this message.
- *
- * Add one to MSG_EXT_WDTR_LEN to account for
- * the extended message preamble.
- */
- if (ahc->msgin_index < (MSG_EXT_WDTR_LEN + 1))
- break;
-
- /*
- * Due to a problem with sync/wide transfers
- * on the aic7880 only allow this on Ultra2
- * controllers for the moment.
*/
- if (devinfo->role == ROLE_TARGET
- && (ahc->features & AHC_ULTRA2) == 0) {
- reject = TRUE;
+ if (ahc->msg_len < (MSG_EXT_WDTR_LEN + /*preamble*/2))
break;
- }
- bus_width = ahc->msgin_buf[3];
- if (ahc_sent_msg(ahc, MSG_EXT_WDTR, /*full*/TRUE)) {
+ bus_width = ahc->msg_buf[3];
+ if ((scb->flags & (SCB_MSGOUT_WDTR|SCB_MSGOUT_SENT))
+ == (SCB_MSGOUT_WDTR|SCB_MSGOUT_SENT)) {
/*
* Don't send a WDTR back to the
* target, since we asked first.
@@ -2806,12 +2192,15 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
case MSG_EXT_WDTR_BUS_16_BIT:
break;
}
+ scb->flags &= ~SCB_MSGOUT_WDTR;
+ ahc->wdtrpending &= ~devinfo->target_mask;
} else {
/*
* Send our own WDTR in reply
*/
- if (bootverbose)
- printf("Sending WDTR!\n");
+ printf("Sending WDTR!\n");
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ scb->flags |= SCB_MSGOUT_WDTR;
switch (bus_width) {
default:
if (ahc->features & AHC_WIDE) {
@@ -2825,41 +2214,33 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
bus_width = MSG_EXT_WDTR_BUS_8_BIT;
break;
}
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_wdtr(ahc, bus_width);
- ahc->msgout_index = 0;
- response = TRUE;
- sending_reply = TRUE;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
+ ahc->wdtrpending |= devinfo->target_mask;
}
- ahc_set_width(ahc, devinfo, path, bus_width,
+ ahc_set_width(ahc, devinfo, scb->ccb->ccb_h.path,
+ bus_width,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
/* After a wide message, we are async */
- ahc_set_syncrate(ahc, devinfo, path,
+ ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
/*syncrate*/NULL, /*period*/0,
/*offset*/0, AHC_TRANS_ACTIVE);
- if (sending_reply == FALSE && reject == FALSE) {
+ if ((ahc->wdtrpending & devinfo->target_mask) == 0
+ && (reject == 0)) {
struct ahc_target_tinfo *tinfo;
+ scb->flags &= ~SCB_MSGOUT_WDTR;
tinfo = &ahc->transinfo[devinfo->target_offset];
if (tinfo->goal.period) {
- struct ahc_syncrate *rate;
- u_int period;
- u_int offset;
-
/* Start the sync negotiation */
- period = tinfo->goal.period;
- rate = ahc_devlimited_syncrate(ahc,
- &period);
- offset = tinfo->goal.offset;
- ahc_validate_offset(ahc, rate, &offset,
- tinfo->current.width);
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, offset);
- ahc->msgout_index = 0;
- response = TRUE;
+ ahc->sdtrpending |=
+ devinfo->target_mask;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
}
}
done = TRUE;
@@ -2870,20 +2251,6 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
reject = TRUE;
break;
}
- break;
- }
- case MSG_ABORT:
- case MSG_ABORT_TAG:
- case MSG_BUS_DEV_RESET:
- case MSG_CLEAR_QUEUE:
- case MSG_TERM_IO_PROC:
- /* Target mode messages */
- if (devinfo->role != ROLE_TARGET)
- reject = TRUE;
- break;
- default:
- reject = TRUE;
- break;
}
if (reject) {
@@ -2891,128 +2258,43 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* Assert attention and setup to
* reject the message.
*/
- ahc->msgout_index = 0;
- ahc->msgout_len = 1;
- ahc->msgout_buf[0] = MSG_MESSAGE_REJECT;
+ ahc_outb(ahc, MSG_OUT, MSG_MESSAGE_REJECT);
+ ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
done = TRUE;
- response = TRUE;
}
-
- if (done && !response)
- /* Clear the outgoing message buffer */
- ahc->msgout_len = 0;
-
return (done);
}
static void
-ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- u_int scb_index;
- struct scb *scb;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
- if ((ahc_inb(ahc, SEQ_FLAGS) & DPHASE) == 0
- || (scb->ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_IN) {
- /*
- * Ignore the message if we haven't
- * seen an appropriate data phase yet.
- */
- } else {
- /*
- * If the residual occurred on the last
- * transfer and the transfer request was
- * expected to end on an odd count, do
- * nothing. Otherwise, subtract a byte
- * and update the residual count accordingly.
- */
- u_int resid_sgcnt;
-
- resid_sgcnt = ahc_inb(ahc, SCB_RESID_SGCNT);
- if (resid_sgcnt == 0
- && ahc_inb(ahc, DATA_COUNT_ODD) == 1) {
- /*
- * If the residual occurred on the last
- * transfer and the transfer request was
- * expected to end on an odd count, do
- * nothing.
- */
- } else {
- u_int data_cnt;
- u_int data_addr;
- u_int sg_index;
-
- data_cnt = (ahc_inb(ahc, SCB_RESID_DCNT + 2) << 16)
- | (ahc_inb(ahc, SCB_RESID_DCNT + 1) << 8)
- | (ahc_inb(ahc, SCB_RESID_DCNT));
-
- data_addr = (ahc_inb(ahc, SHADDR + 3) << 24)
- | (ahc_inb(ahc, SHADDR + 2) << 16)
- | (ahc_inb(ahc, SHADDR + 1) << 8)
- | (ahc_inb(ahc, SHADDR));
-
- data_cnt += 1;
- data_addr -= 1;
-
- sg_index = scb->sg_count - resid_sgcnt;
-
- /*
- * scb->ahc_dma starts with the second S/G entry.
- */
- if (sg_index-- != 0
- && (scb->ahc_dma[sg_index].len < data_cnt)) {
- u_int sg_addr;
-
- data_cnt = 1;
- data_addr = scb->ahc_dma[sg_index - 1].addr
- + scb->ahc_dma[sg_index - 1].len - 1;
-
- sg_addr = scb->ahc_dmaphys
- + (sg_index * sizeof(*scb->ahc_dma));
- ahc_outb(ahc, SG_NEXT + 3, sg_addr >> 24);
- ahc_outb(ahc, SG_NEXT + 2, sg_addr >> 16);
- ahc_outb(ahc, SG_NEXT + 1, sg_addr >> 8);
- ahc_outb(ahc, SG_NEXT, sg_addr);
- }
-
- ahc_outb(ahc, SCB_RESID_DCNT + 2, data_cnt >> 16);
- ahc_outb(ahc, SCB_RESID_DCNT + 1, data_cnt >> 8);
- ahc_outb(ahc, SCB_RESID_DCNT, data_cnt);
-
- ahc_outb(ahc, SHADDR + 3, data_addr >> 24);
- ahc_outb(ahc, SHADDR + 2, data_addr >> 16);
- ahc_outb(ahc, SHADDR + 1, data_addr >> 8);
- ahc_outb(ahc, SHADDR, data_addr);
- }
- }
-}
-
-static void
ahc_handle_devreset(struct ahc_softc *ahc, int target, char channel,
cam_status status, ac_code acode, char *message,
int verbose_only)
{
struct ahc_devinfo devinfo;
struct cam_path *path;
+ path_id_t path_id;
int found;
int error;
- ahc_compile_devinfo(&devinfo, target, CAM_LUN_WILDCARD, channel,
- ROLE_UNKNOWN);
+ ahc_compile_devinfo(&devinfo, target, channel);
- error = ahc_create_path(ahc, &devinfo, &path);
+ if (channel == 'B')
+ path_id = cam_sim_path(ahc->sim_b);
+ else
+ path_id = cam_sim_path(ahc->sim);
+ error = xpt_create_path(&path, /*periph*/NULL, path_id, target,
+ CAM_LUN_WILDCARD);
/*
* Go back to async/narrow transfers and renegotiate.
- * ahc_set_width and ahc_set_syncrate can cope with NULL
- * paths.
*/
- ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
- AHC_TRANS_CUR);
- ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
- /*period*/0, /*offset*/0, AHC_TRANS_CUR);
- found = ahc_abort_scbs(ahc, target, channel, CAM_LUN_WILDCARD,
+ if (error == CAM_REQ_CMP) {
+ ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_CUR);
+ ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
+ /*period*/0, /*offset*/0, AHC_TRANS_CUR);
+ }
+ found = ahc_abort_scbs(ahc, target, channel, ALL_LUNS,
SCB_LIST_NULL, status);
if (error == CAM_REQ_CMP && acode != 0)
@@ -3064,6 +2346,8 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
ahc_index_busy_tcl(ahc, scb->hscb->tcl, /*unbusy*/TRUE);
if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
+ xpt_print_path(ccb->ccb_h.path);
+ printf("CONT_TARGET_IO complete\n");
ccb->ccb_h.status = CAM_REQ_CMP;
ahc_free_scb(ahc, scb);
xpt_done(ccb);
@@ -3108,6 +2392,22 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
ccb->ccb_h.status);
}
+ if ((scb->flags & (SCB_MSGOUT_WDTR|SCB_MSGOUT_SDTR)) != 0) {
+ /*
+ * Turn off the pending flags for any DTR messages
+ * regardless of whether they completed successfully
+ * or not. This ensures that we don't have lingering
+ * state after we abort an SCB.
+ */
+ u_int16_t mask;
+
+ mask = (0x01 << (SCB_TARGET(scb)
+ | (SCB_IS_SCSIBUS_B(scb) ? SELBUSB : 0)));
+ if (scb->flags & SCB_MSGOUT_WDTR)
+ ahc->wdtrpending &= ~mask;
+ if (scb->flags & SCB_MSGOUT_SDTR)
+ ahc->sdtrpending &= ~mask;
+ }
/* Don't clobber any existing error state */
if (ahc_ccb_status(ccb) == CAM_REQ_INPROG) {
ccb->ccb_h.status |= CAM_REQ_CMP;
@@ -3150,7 +2450,6 @@ ahc_init(struct ahc_softc *ahc)
int i;
int term;
u_int scsi_conf;
- u_int scsiseq_template;
#ifdef AHC_PRINT_SRAM
printf("Scratch Ram:");
@@ -3179,21 +2478,11 @@ ahc_init(struct ahc_softc *ahc)
}
/*
- * Default to allowing initiator operations.
- */
- ahc->flags |= AHC_INITIATORMODE;
-
- /*
* XXX Would be better to use a per device flag, but PCI and EISA
* devices don't have them yet.
*/
- if ((AHC_TMODE_ENABLE & (0x01 << ahc->unit)) != 0) {
+ if ((AHC_TMODE_ENABLE & (0x01 << ahc->unit)) != 0)
ahc->flags |= AHC_TARGETMODE;
- if ((ahc->features & AHC_ULTRA2) == 0)
- /* Only have space for both on the Ultra2 chips */
- ahc->flags &= ~AHC_INITIATORMODE;
- }
-
if ((ahc->features & AHC_TWIN) != 0) {
printf("Twin Channel, A SCSI Id=%d, B SCSI Id=%d, primary %c, ",
@@ -3246,10 +2535,18 @@ ahc_init(struct ahc_softc *ahc)
if (ahc->scb_data->maxhscbs < AHC_SCB_MAX) {
ahc->flags |= AHC_PAGESCBS;
ahc->scb_data->maxscbs = AHC_SCB_MAX;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ /* Steal one slot for TMODE commands */
+ ahc->scb_data->maxscbs--;
+ }
printf("%d/%d SCBs\n", ahc->scb_data->maxhscbs,
ahc->scb_data->maxscbs);
} else {
ahc->scb_data->maxscbs = ahc->scb_data->maxhscbs;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ /* Steal one slot for TMODE commands */
+ ahc->scb_data->maxscbs--;
+ }
ahc->flags &= ~AHC_PAGESCBS;
printf("%d SCBs\n", ahc->scb_data->maxhscbs);
}
@@ -3283,14 +2580,13 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, SIMODE1, ENSELTIMO|ENSCSIRST|ENSCSIPERR);
ahc_outb(ahc, SXFRCTL0, DFON|SPIOEN);
-#if 0
- if ((scsi_conf & RESET_SCSI) != 0
- && (ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_B;
-#else
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_B;
-#endif
+ if (scsi_conf & RESET_SCSI) {
+ /* Reset the bus */
+ if (bootverbose)
+ printf("%s: Resetting Channel B\n",
+ ahc_name(ahc));
+ ahc_reset_current_bus(ahc);
+ }
/* Select Channel A */
ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~SELBUSB);
@@ -3318,14 +2614,14 @@ ahc_init(struct ahc_softc *ahc)
ahc_name(ahc));
}
-#if 0
- if ((scsi_conf & RESET_SCSI) != 0
- && (ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_A;
-#else
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_A;
-#endif
+ if (scsi_conf & RESET_SCSI) {
+ /* Reset the bus */
+ if (bootverbose)
+ printf("%s: Resetting Channel %c\n", ahc_name(ahc),
+ ahc->channel);
+
+ ahc_reset_current_bus(ahc);
+ }
/*
* Look at the information that board initialization or
@@ -3337,7 +2633,7 @@ ahc_init(struct ahc_softc *ahc)
* flag.
*/
ahc->ultraenb = 0;
- ahc->tagenable = ALL_TARGETS_MASK;
+ ahc->tagenable = ALL_TARGETS;
/* Grab the disconnection disable table and invert it for our needs */
if (ahc->flags & AHC_USEDEFAULTS) {
@@ -3345,7 +2641,7 @@ ahc_init(struct ahc_softc *ahc)
"device parameters\n", ahc_name(ahc));
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B|
AHC_TERM_ENB_A|AHC_TERM_ENB_B;
- ahc->discenable = ALL_TARGETS_MASK;
+ ahc->discenable = ALL_TARGETS;
if ((ahc->features & AHC_ULTRA) != 0)
ahc->ultraenb = 0xffff;
} else {
@@ -3421,6 +2717,8 @@ ahc_init(struct ahc_softc *ahc)
}
}
+ ahc->sdtrpending = 0;
+ ahc->wdtrpending = 0;
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOWMISC)
@@ -3463,10 +2761,9 @@ ahc_init(struct ahc_softc *ahc)
if ((ahc->flags & AHC_TARGETMODE) != 0) {
size_t array_size;
- array_size = AHC_TMODE_CMDS * sizeof(struct target_cmd);
- ahc->targetcmds = contigmalloc(array_size, M_DEVBUF,
- M_NOWAIT, 0ul, 0xffffffff,
- PAGE_SIZE, 0x10000);
+ ahc->num_targetcmds = 32;
+ array_size = ahc->num_targetcmds * sizeof(struct target_cmd);
+ ahc->targetcmds = malloc(array_size, M_DEVBUF, M_NOWAIT);
if (ahc->targetcmds == NULL) {
printf("%s: unable to allocate targetcmd array. "
@@ -3474,11 +2771,8 @@ ahc_init(struct ahc_softc *ahc)
return (-1);
}
- /* All target command blocks start out invalid. */
- for (i = 0; i < AHC_TMODE_CMDS; i++)
- ahc->targetcmds[i].cmd_valid = 0;
- ahc_outb(ahc, KERNEL_TQINPOS, 0);
- ahc_outb(ahc, TQINPOS, 0);
+ bzero(ahc->targetcmds, array_size);
+ ahc_outb(ahc, TMODE_CMDADDR_NEXT, 0);
}
/*
@@ -3535,10 +2829,6 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, QINPOS, 0);
ahc_outb(ahc, QOUTPOS, 0);
- /* Don't have any special messages to send to targets */
- ahc_outb(ahc, TARGET_MSG_REQUEST, 0);
- ahc_outb(ahc, TARGET_MSG_REQUEST + 1, 0);
-
/*
* Use the built in queue management registers
* if they are available.
@@ -3561,16 +2851,6 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, MSG_OUT, MSG_NOOP);
/*
- * Setup the allowed SCSI Sequences based on operational mode.
- * If we are a target, we'll enalbe select in operations once
- * we've had a lun enabled.
- */
- scsiseq_template = ENSELO|ENAUTOATNO|ENAUTOATNP;
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- scsiseq_template |= ENRSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq_template);
-
- /*
* Load the Sequencer program and Enable the adapter
* in "fast" mode.
*/
@@ -3586,6 +2866,21 @@ ahc_init(struct ahc_softc *ahc)
return (0);
}
+static void
+ahcminphys(struct buf *bp)
+{
+/*
+ * Even though the card can transfer up to 16megs per command
+ * we are limited by the number of segments in the dma segment
+ * list that we can hold. The worst case is that all pages are
+ * discontinuous physically, hense the "page per segment" limit
+ * enforced here.
+ */
+ if (bp->b_bcount > ((AHC_NSEG - 1) * PAGE_SIZE)) {
+ bp->b_bcount = ((AHC_NSEG - 1) * PAGE_SIZE);
+ }
+}
+
static cam_status
ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
struct tmode_tstate **tstate, struct tmode_lstate **lstate,
@@ -3601,34 +2896,22 @@ ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
return (CAM_REQ_INVALID);
/* Range check target and lun */
+ if (cam_sim_bus(sim) == 0)
+ our_id = ahc->our_id;
+ else
+ our_id = ahc->our_id_b;
+ if (ccb->ccb_h.target_id > ((ahc->features & AHC_WIDE) ? 15 : 7)
+ || ((ahc->features & AHC_MULTI_TID) == 0
+ && (ccb->ccb_h.target_id != our_id)))
+ return (CAM_TID_INVALID);
- /*
- * Handle the 'black hole' device that sucks up
- * requests to unattached luns on enabled targets.
- */
- if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD
- && ccb->ccb_h.target_lun == CAM_LUN_WILDCARD) {
- *tstate = NULL;
- *lstate = ahc->black_hole;
- } else {
- if (cam_sim_bus(sim) == 0)
- our_id = ahc->our_id;
- else
- our_id = ahc->our_id_b;
- if (ccb->ccb_h.target_id > ((ahc->features & AHC_WIDE) ? 15 : 7)
- || ((ahc->features & AHC_MULTI_TID) == 0
- && (ccb->ccb_h.target_id != our_id)))
- return (CAM_TID_INVALID);
-
- if (ccb->ccb_h.target_lun > 8)
- return (CAM_LUN_INVALID);
-
- *tstate = ahc->enabled_targets[ccb->ccb_h.target_id];
- *lstate = NULL;
- if (*tstate != NULL)
- *lstate =
- (*tstate)->enabled_luns[ccb->ccb_h.target_lun];
- }
+ if (ccb->ccb_h.target_lun > 8)
+ return (CAM_LUN_INVALID);
+
+ *tstate = ahc->enabled_targets[ccb->ccb_h.target_id];
+ *lstate = NULL;
+ if (*tstate != NULL)
+ *lstate = (*tstate)->enabled_luns[ccb->ccb_h.target_lun];
if (notfound_failure != 0 && *lstate == NULL)
return (CAM_PATH_INVALID);
@@ -3662,15 +2945,9 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
&lstate, TRUE);
if (status != CAM_REQ_CMP) {
- if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
- /* Response from the black hole device */
- tstate = NULL;
- lstate = ahc->black_hole;
- } else {
- ccb->ccb_h.status = status;
- xpt_done(ccb);
- break;
- }
+ ccb->ccb_h.status = status;
+ xpt_done(ccb);
+ break;
}
if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
@@ -3685,6 +2962,8 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
* the original command.
*/
target_id = ccb->csio.init_id;
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Sending a continue TIO\n");
/* FALLTHROUGH */
}
case XPT_SCSI_IO: /* Execute the requested I/O operation */
@@ -3746,7 +3025,21 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
hscb->control |= MK_MESSAGE;
ahc_execute_scb(scb, NULL, 0, 0);
} else {
- if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
+ if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
+ if (tinfo->current.width != tinfo->goal.width) {
+ if ((ahc->wdtrpending & mask) == 0) {
+ ahc->wdtrpending |= mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_WDTR;
+ }
+ } else if ((tinfo->current.period
+ != tinfo->goal.period)
+ && (ahc->sdtrpending & mask) == 0) {
+ ahc->sdtrpending |= mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ }
+ } else {
if (ahc->pending_device == lstate) {
scb->flags |= SCB_TARGET_IMMEDIATE;
ahc->pending_device = NULL;
@@ -3797,14 +3090,105 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
break;
}
case XPT_EN_LUN: /* Enable LUN as a target */
- ahc_handle_en_lun(ahc, sim, ccb);
- xpt_done(ccb);
- break;
- case XPT_ABORT: /* Abort the specified CCB */
{
- ahc_abort_ccb(ahc, sim, ccb);
+ struct tmode_tstate *tstate;
+ struct tmode_lstate *lstate;
+ struct ccb_en_lun *cel;
+ cam_status status;
+ int target;
+ int lun;
+
+ status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate,
+ /* notfound_failure*/FALSE);
+
+ if (status != CAM_REQ_CMP) {
+ ccb->ccb_h.status = status;
+ xpt_done(ccb);
+ break;
+ }
+
+ cel = &ccb->cel;
+ target = ccb->ccb_h.target_id;
+ lun = ccb->ccb_h.target_lun;
+ if (cel->enable != 0) {
+ /* Are we already enabled?? */
+ if (lstate != NULL) {
+ ccb->ccb_h.status = CAM_LUN_ALRDY_ENA;
+ xpt_done(ccb);
+ break;
+ }
+
+ if (cel->grp6_len != 0
+ || cel->grp7_len != 0) {
+ /*
+ * Don't (yet?) support vendor
+ * specific commands.
+ */
+ ccb->ccb_h.status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ break;
+ }
+
+ /*
+ * Seems to be okay.
+ * Setup our data structures.
+ */
+ if (tstate == NULL) {
+ tstate = malloc(sizeof(*tstate),
+ M_DEVBUF, M_NOWAIT);
+ if (tstate == NULL) {
+ ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ xpt_done(ccb);
+ break;
+ }
+ bzero(tstate, sizeof(*tstate));
+ ahc->enabled_targets[target] = tstate;
+ }
+ lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT);
+ if (lstate == NULL) {
+ ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ xpt_done(ccb);
+ break;
+ }
+ bzero(lstate, sizeof(*lstate));
+ SLIST_INIT(&lstate->accept_tios);
+ SLIST_INIT(&lstate->immed_notifies);
+ tstate->enabled_luns[lun] = lstate;
+ if ((ahc->features & AHC_MULTI_TID) != 0) {
+ u_int16_t targid_mask;
+
+ pause_sequencer(ahc);
+ targid_mask = ahc_inb(ahc, TARGID)
+ | (ahc_inb(ahc, TARGID + 1) << 8);
+
+ targid_mask |= (0x01 << target);
+ ahc_outb(ahc, TARGID, targid_mask);
+ ahc_outb(ahc, TARGID+1, (targid_mask >> 8));
+ unpause_sequencer(ahc, /*always?*/FALSE);
+ }
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Lun now enabled for target mode\n");
+ xpt_done(ccb);
+ break;
+ } else {
+ /* XXX Fully Implement Disable */
+ if (lstate == NULL) {
+ ccb->ccb_h.status = CAM_LUN_INVALID;
+ xpt_done(ccb);
+ break;
+ }
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ xpt_done(ccb);
+ break;
+ }
break;
}
+ case XPT_ABORT: /* Abort the specified CCB */
+ /* XXX Implement */
+ ccb->ccb_h.status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ break;
case XPT_SET_TRAN_SETTINGS:
{
struct ahc_devinfo devinfo;
@@ -3815,9 +3199,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts = &ccb->cts;
ahc_compile_devinfo(&devinfo, cts->ccb_h.target_id,
- cts->ccb_h.target_lun,
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
tinfo = &ahc->transinfo[devinfo.target_offset];
update_type = 0;
if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
@@ -3853,8 +3235,10 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
break;
}
- ahc_set_width(ahc, &devinfo, cts->ccb_h.path,
- cts->bus_width, update_type);
+ if ((update_type & AHC_TRANS_GOAL) != 0)
+ tinfo->goal.width = cts->bus_width;
+ if ((update_type & AHC_TRANS_USER) != 0)
+ tinfo->user.width = cts->bus_width;
}
if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
@@ -3868,21 +3252,30 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
else
maxsync = AHC_SYNCRATE_FAST;
- if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0)
+ if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
+ if (cts->sync_offset != 0)
+ cts->sync_offset = ~0;
+ } else {
cts->sync_offset = 0;
+ }
syncrate = ahc_find_syncrate(ahc, &cts->sync_period,
maxsync);
ahc_validate_offset(ahc, syncrate, &cts->sync_offset,
- MSG_EXT_WDTR_BUS_8_BIT);
+ tinfo->goal.width);
/* We use a period of 0 to represent async */
if (cts->sync_offset == 0)
cts->sync_period = 0;
- ahc_set_syncrate(ahc, &devinfo, cts->ccb_h.path,
- syncrate, cts->sync_period,
- cts->sync_offset, update_type);
+ if ((update_type & AHC_TRANS_GOAL) != 0) {
+ tinfo->goal.period = cts->sync_period;
+ tinfo->goal.offset = cts->sync_offset;
+ }
+ if ((update_type & AHC_TRANS_USER) != 0) {
+ tinfo->user.period = cts->sync_period;
+ tinfo->user.offset = cts->sync_offset;
+ }
}
splx(s);
ccb->ccb_h.status = CAM_REQ_CMP;
@@ -3900,9 +3293,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts = &ccb->cts;
ahc_compile_devinfo(&devinfo, cts->ccb_h.target_id,
- cts->ccb_h.target_lun,
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
targ_info = &ahc->transinfo[devinfo.target_offset];
if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
@@ -4007,20 +3398,14 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
} else {
cpi->target_sprt = 0;
}
- cpi->hba_misc = (ahc->flags & AHC_INITIATORMODE)
- ? 0 : PIM_NOINITIATOR;
+ cpi->hba_misc = 0;
cpi->hba_eng_cnt = 0;
cpi->max_target = (ahc->features & AHC_WIDE) ? 15 : 7;
cpi->max_lun = 7;
- if (SIM_IS_SCSIBUS_B(ahc, sim)) {
+ if (SIM_IS_SCSIBUS_B(ahc, sim))
cpi->initiator_id = ahc->our_id_b;
- if ((ahc->flags & AHC_RESET_BUS_B) == 0)
- cpi->hba_misc |= PIM_NOBUSRESET;
- } else {
+ else
cpi->initiator_id = ahc->our_id;
- if ((ahc->flags & AHC_RESET_BUS_A) == 0)
- cpi->hba_misc |= PIM_NOBUSRESET;
- }
cpi->bus_id = cam_sim_bus(sim);
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
@@ -4051,9 +3436,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
struct ahc_devinfo devinfo;
ahc_compile_devinfo(&devinfo, xpt_path_target_id(path),
- xpt_path_lun_id(path),
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
/*
* Revert to async/narrow transfers
@@ -4152,12 +3535,12 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
(ccb->ccb_h.timeout * hz) / 1000);
if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Returning an immediate CTIO\n");
if ((ahc->flags & AHC_PAGESCBS) == 0)
ahc_outb(ahc, SCBPTR, scb->hscb->tag);
- pause_sequencer(ahc);
ahc_outb(ahc, SCB_TAG, scb->hscb->tag);
- ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
- unpause_sequencer(ahc, /*unpause_always*/FALSE);
+ unpause_sequencer(ahc, /*unpause_always*/TRUE);
} else {
ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag;
@@ -4428,10 +3811,7 @@ ahc_loadseq(struct ahc_softc *ahc)
u_int8_t download_consts[4];
/* Setup downloadable constant table */
-#if 0
- /* No downloaded constants are currently defined. */
download_consts[TMODE_NUMCMDS] = ahc->num_targetcmds;
-#endif
cur_patch = patches;
downloaded = 0;
@@ -4716,14 +4096,12 @@ ahc_timeout(void *arg)
break;
}
- printf(", SEQADDR == 0x%x\n",
- ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
-
-#if 0
printf(", SCSISIGI == 0x%x\n", ahc_inb(ahc, SCSISIGI));
- printf("SIMODE1 = 0x%x\n", ahc_inb(ahc, SIMODE1));
- printf("INTSTAT = 0x%x\n", ahc_inb(ahc, INTSTAT));
+
+ printf("SEQADDR == 0x%x\n", ahc_inb(ahc, SEQADDR0)
+ | (ahc_inb(ahc, SEQADDR1) << 8));
printf("SSTAT1 == 0x%x\n", ahc_inb(ahc, SSTAT1));
+#if 0
printf("SCSIRATE == 0x%x\n", ahc_inb(ahc, SCSIRATE));
printf("CCSCBCTL == 0x%x\n", ahc_inb(ahc, CCSCBCTL));
printf("CCSCBCNT == 0x%x\n", ahc_inb(ahc, CCSCBCNT));
@@ -4731,6 +4109,7 @@ ahc_timeout(void *arg)
printf("DFSTATUS == 0x%x\n", ahc_inb(ahc, DFSTATUS));
printf("CCHCNT == 0x%x\n", ahc_inb(ahc, CCHCNT));
#endif
+ /* Decide our course of action */
if (scb->flags & SCB_DEVICE_RESET) {
/*
* Been down this road before.
@@ -4743,26 +4122,18 @@ bus_reset:
"%d SCBs aborted\n", ahc_name(ahc), channel, found);
} else {
/*
- * If we are a target, transition to bus free and report
- * the timeout.
- *
- * The target/initiator that is holding up the bus may not
+ * Send a Bus Device Reset message:
+ * The target that is holding up the bus may not
* be the same as the one that triggered this timeout
* (different commands have different timeout lengths).
- * If the bus is idle and we are actiing as the initiator
- * for this request, queue a BDR message to the timed out
- * target. Otherwise, if the timed out transaction is
- * active:
- * Initiator transaction:
- * Stuff the message buffer with a BDR message and assert
- * ATN in the hopes that the target will let go of the bus
- * and go to the mesgout phase. If this fails, we'll
- * get another timeout 2 seconds later which will attempt
- * a bus reset.
- *
- * Target transaction:
- * Transition to BUS FREE and report the error.
- * It's good to be the target!
+ * Our strategy here is to queue a BDR message
+ * to the timed out target if the bus is idle.
+ * Otherwise, if we have an active target we stuff the
+ * message buffer with a BDR message and assert ATN
+ * in the hopes that the target will let go of the bus
+ * and go to the mesgout phase. If this fails, we'll
+ * get another timeout 2 seconds later which will attempt
+ * a bus reset.
*/
u_int active_scb_index;
@@ -4793,25 +4164,7 @@ bus_reset:
(newtimeout * hz) / 1000);
splx(s);
return;
- }
-
- /* It's us */
- if ((scb->hscb->control & TARGET_SCB) != 0) {
-
- /*
- * Send back any queued up transactions
- * and properly record the error condition.
- */
- ahc_freeze_devq(ahc, scb->ccb->ccb_h.path);
- ahc_set_ccb_status(scb->ccb, CAM_CMD_TIMEOUT);
- ahc_freeze_ccb(scb->ccb);
- ahc_done(ahc, scb);
-
- /* Will clear us from the bus */
- restart_sequencer(ahc);
- return;
}
-
ahc_set_recoveryscb(ahc, active_scb);
ahc_outb(ahc, MSG_OUT, MSG_BUS_DEV_RESET);
ahc_outb(ahc, SCSISIGO, bus_state|ATNO);
@@ -4824,15 +4177,6 @@ bus_reset:
} else {
int disconnected;
- if (bus_state != P_BUSFREE
- && (ahc_inb(ahc, SSTAT0) & TARGET) != 0) {
- /* Hung target selection. Goto busfree */
- printf("%s: Hung target selection\n",
- ahc_name(ahc));
- restart_sequencer(ahc);
- return;
- }
-
if (ahc_search_qinfifo(ahc, target, channel, lun,
scb->hscb->tag, /*status*/0,
SEARCH_COUNT) > 0) {
@@ -4959,86 +4303,6 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
}
-static void
-ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
-{
- union ccb *abort_ccb;
-
- abort_ccb = ccb->cab.abort_ccb;
- switch (abort_ccb->ccb_h.func_code) {
- case XPT_ACCEPT_TARGET_IO:
- case XPT_IMMED_NOTIFY:
- case XPT_CONT_TARGET_IO:
- {
- struct tmode_tstate *tstate;
- struct tmode_lstate *lstate;
- struct ccb_hdr_slist *list;
- cam_status status;
-
- status = ahc_find_tmode_devs(ahc, sim, abort_ccb, &tstate,
- &lstate, TRUE);
-
- if (status != CAM_REQ_CMP) {
- ccb->ccb_h.status = status;
- break;
- }
-
- if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
- list = &lstate->accept_tios;
- else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY)
- list = &lstate->immed_notifies;
- else
- list = NULL;
-
- if (list != NULL) {
- struct ccb_hdr *curelm;
- int found;
-
- curelm = SLIST_FIRST(list);
- found = 0;
- if (curelm == &abort_ccb->ccb_h) {
- found = 1;
- SLIST_REMOVE_HEAD(list, sim_links.sle);
- } else {
- while(curelm != NULL) {
- struct ccb_hdr *nextelm;
-
- nextelm =
- SLIST_NEXT(curelm, sim_links.sle);
-
- if (nextelm == &abort_ccb->ccb_h) {
- found = 1;
- SLIST_NEXT(curelm,
- sim_links.sle) =
- SLIST_NEXT(nextelm,
- sim_links.sle);
- break;
- }
- curelm = nextelm;
- }
- }
-
- if (found)
- abort_ccb->ccb_h.status = CAM_REQ_ABORTED;
- else {
- printf("Not found\n");
- ccb->ccb_h.status = CAM_PATH_INVALID;
- }
- break;
- }
- /* FALLTHROUGH */
- }
- case XPT_SCSI_IO:
- /* XXX Fully implement the hard ones */
- ccb->ccb_h.status = CAM_UA_ABORT;
- break;
- default:
- ccb->ccb_h.status = CAM_REQ_INVALID;
- break;
- }
- xpt_done(ccb);
-}
-
/*
* Abort all SCBs that match the given description (target/channel/lun/tag),
* setting their status to the passed in status if the status has not already
@@ -5303,9 +4567,8 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
* Clean up all the state information for the
* pending transactions on this bus.
*/
- found = ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, channel,
- CAM_LUN_WILDCARD, SCB_LIST_NULL,
- CAM_SCSI_BUS_RESET);
+ found = ahc_abort_scbs(ahc, ALL_TARGETS, channel, ALL_LUNS,
+ SCB_LIST_NULL, CAM_SCSI_BUS_RESET);
path = channel == 'B' ? ahc->path_b : ahc->path;
/* Notify the XPT that a bus reset occurred */
@@ -5318,8 +4581,7 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
for (target = 0; target <= max_target; target++) {
struct ahc_devinfo devinfo;
- ahc_compile_devinfo(&devinfo, target, CAM_LUN_WILDCARD,
- channel, ROLE_UNKNOWN);
+ ahc_compile_devinfo(&devinfo, target, channel);
ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
AHC_TRANS_CUR);
ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
@@ -5341,7 +4603,8 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
* upsetting the current bus.
*/
ahc_outb(ahc, SBLKCTL, sblkctl ^ SELBUSB);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
if (initiate_reset)
@@ -5351,8 +4614,10 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
unpause_sequencer(ahc, /*unpause_always*/FALSE);
} else {
/* Case 2: A command from this bus is active or we're idle */
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+ ahc->msg_type = MSG_TYPE_NONE;
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
if (initiate_reset)
@@ -5373,9 +4638,9 @@ ahc_match_scb (struct scb *scb, int target, char channel, int lun, u_int tag)
match = ((chan == channel) || (channel == ALL_CHANNELS));
if (match != 0)
- match = ((targ == target) || (target == CAM_TARGET_WILDCARD));
+ match = ((targ == target) || (target == ALL_TARGETS));
if (match != 0)
- match = ((lun == slun) || (lun == CAM_LUN_WILDCARD));
+ match = ((lun == slun) || (lun == ALL_LUNS));
if (match != 0)
match = ((tag == scb->hscb->tag) || (tag == SCB_LIST_NULL));
@@ -5385,22 +4650,22 @@ ahc_match_scb (struct scb *scb, int target, char channel, int lun, u_int tag)
static void
ahc_construct_sdtr(struct ahc_softc *ahc, u_int period, u_int offset)
{
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR_LEN;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR;
- ahc->msgout_buf[ahc->msgout_index++] = period;
- ahc->msgout_buf[ahc->msgout_index++] = offset;
- ahc->msgout_len += 5;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXTENDED;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_SDTR_LEN;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_SDTR;
+ ahc->msg_buf[ahc->msg_index++] = period;
+ ahc->msg_buf[ahc->msg_index++] = offset;
+ ahc->msg_len += 5;
}
static void
ahc_construct_wdtr(struct ahc_softc *ahc, u_int bus_width)
{
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR_LEN;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR;
- ahc->msgout_buf[ahc->msgout_index++] = bus_width;
- ahc->msgout_len += 4;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXTENDED;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_WDTR_LEN;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_WDTR;
+ ahc->msg_buf[ahc->msg_index++] = bus_width;
+ ahc->msg_len += 4;
}
static void
@@ -5495,9 +4760,7 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
pending_scb = (struct scb *)ccbh->ccb_scb_ptr;
pending_hscb = pending_scb->hscb;
ahc_compile_devinfo(&devinfo, SCB_TARGET(pending_scb),
- SCB_LUN(pending_scb),
- SCB_CHANNEL(pending_scb),
- ROLE_UNKNOWN);
+ SCB_CHANNEL(pending_scb));
tinfo = &ahc->transinfo[devinfo.target_offset];
pending_hscb->control &= ~ULTRAENB;
if ((ahc->ultraenb & devinfo.target_mask) != 0)
@@ -5528,9 +4791,7 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
pending_scb = ahc->scb_data->scbarray[scb_tag];
pending_hscb = pending_scb->hscb;
ahc_compile_devinfo(&devinfo, SCB_TARGET(pending_scb),
- SCB_LUN(pending_scb),
- SCB_CHANNEL(pending_scb),
- ROLE_UNKNOWN);
+ SCB_CHANNEL(pending_scb));
tinfo = &ahc->transinfo[devinfo.target_offset];
control = ahc_inb(ahc, SCB_CONTROL);
control &= ~ULTRAENB;
@@ -5544,7 +4805,6 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
ahc_outb(ahc, SCBPTR, saved_scbptr);
}
-#if UNUSED
static void
ahc_dump_targcmd(struct target_cmd *cmd)
{
@@ -5552,9 +4812,9 @@ ahc_dump_targcmd(struct target_cmd *cmd)
u_int8_t *last_byte;
int i;
- byte = &cmd->initiator_channel;
+ byte = &cmd->icl;
/* Debugging info for received commands */
- last_byte = &cmd[1].initiator_channel;
+ last_byte = &cmd[1].icl;
i = 0;
while (byte < last_byte) {
@@ -5570,7 +4830,6 @@ ahc_dump_targcmd(struct target_cmd *cmd)
}
}
}
-#endif
static void
ahc_shutdown(int howto, void *arg)
diff --git a/sys/dev/aic7xxx/aic7xxx.h b/sys/dev/aic7xxx/aic7xxx.h
index e46d277e8d58..06f7d4abd4e1 100644
--- a/sys/dev/aic7xxx/aic7xxx.h
+++ b/sys/dev/aic7xxx/aic7xxx.h
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.h,v 1.4 1998/12/15 08:22:41 gibbs Exp $
+ * $Id: aic7xxx.h,v 1.40 1997/02/25 03:05:35 gibbs Exp $
*/
#ifndef _AIC7XXX_H_
@@ -68,12 +68,6 @@
* aic7850 has only 3.
*/
-#define AHC_TMODE_CMDS 256 /*
- * Ring Buffer of incoming target commands.
- * We allocate 256 to simplify the logic
- * in the sequencer by using the natural
- * wrap point of an 8bit counter.
- */
#if defined(__FreeBSD__)
extern u_long ahc_unit;
@@ -117,11 +111,9 @@ typedef enum {
AHC_AIC7860_FE = AHC_ULTRA|AHC_SPIOCAP,
AHC_AIC7870_FE = AHC_FENONE,
AHC_AIC7880_FE = AHC_ULTRA,
- AHC_AIC7890_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS
- |AHC_SG_PRELOAD|AHC_MULTI_TID,
+ AHC_AIC7890_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS|AHC_SG_PRELOAD|AHC_MULTI_TID,
AHC_AIC7895_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA,
- AHC_AIC7896_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS
- |AHC_SG_PRELOAD|AHC_MULTI_TID,
+ AHC_AIC7896_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS|AHC_SG_PRELOAD|AHC_MULTI_TID,
} ahc_feature;
typedef enum {
@@ -141,16 +133,11 @@ typedef enum {
AHC_INDIRECT_PAGING = 0x008,
AHC_SHARED_SRAM = 0x010,
AHC_LARGE_SEEPROM = 0x020,/* Uses C56_66 not C46 */
- AHC_RESET_BUS_A = 0x040,
- AHC_RESET_BUS_B = 0x080,
AHC_EXTENDED_TRANS_A = 0x100,
AHC_EXTENDED_TRANS_B = 0x200,
AHC_TERM_ENB_A = 0x400,
AHC_TERM_ENB_B = 0x800,
- AHC_INITIATORMODE = 0x1000,/*
- * Allow initiator operations on
- * this controller.
- */
+ AHC_HANDLING_REQINITS = 0x1000,
AHC_TARGETMODE = 0x2000,/*
* Allow target operations on this
* controller.
@@ -172,6 +159,11 @@ typedef enum {
SCB_DEVICE_RESET = 0x0004,
SCB_SENSE = 0x0008,
SCB_RECOVERY_SCB = 0x0040,
+ SCB_MSGOUT_SENT = 0x0200,
+ SCB_MSGOUT_SDTR = 0x0400,
+ SCB_MSGOUT_WDTR = 0x0800,
+ SCB_MSGOUT_BITS = (SCB_MSGOUT_SDTR|SCB_MSGOUT_WDTR
+ |SCB_MSGOUT_SENT),
SCB_ABORT = 0x1000,
SCB_QUEUED_MSG = 0x2000,
SCB_ACTIVE = 0x4000,
@@ -255,17 +247,13 @@ struct scb_data {
* Connection desciptor for select-in requests in target mode.
* The first byte is the connecting target, followed by identify
* message and optional tag information, terminated by 0xFF. The
- * remainder is the command to execute. The cmd_valid byte is on
- * an 8 byte boundary to simplify setting it on aic7880 hardware
- * which only has limited direct access to the DMA FIFO.
+ * remainder is the command to execute.
*/
struct target_cmd {
- u_int8_t initiator_channel;
- u_int8_t targ_id; /* Target ID we were selected at */
- u_int8_t identify; /* Identify message */
- u_int8_t bytes[21];
- u_int8_t cmd_valid;
- u_int8_t pad[7];
+ u_int8_t icl; /* Really only holds Initiator ID */
+ u_int8_t targ_id; /* Target ID we were selected at */
+ u_int8_t identify; /* Identify message */
+ u_int8_t bytes[29];
};
/*
@@ -273,8 +261,8 @@ struct target_cmd {
* and immediate notify CCB pools.
*/
struct tmode_lstate {
- struct ccb_hdr_slist accept_tios;
- struct ccb_hdr_slist immed_notifies;
+ SLIST_HEAD(, ccb_hdr) accept_tios;
+ SLIST_HEAD(, ccb_hdr) immed_notifies;
};
/*
@@ -386,9 +374,7 @@ struct ahc_syncrate {
typedef enum {
MSG_TYPE_NONE = 0x00,
MSG_TYPE_INITIATOR_MSGOUT = 0x01,
- MSG_TYPE_INITIATOR_MSGIN = 0x02,
- MSG_TYPE_TARGET_MSGOUT = 0x03,
- MSG_TYPE_TARGET_MSGIN = 0x04
+ MSG_TYPE_INITIATOR_MSGIN = 0x02
} ahc_msg_type;
struct ahc_softc {
@@ -409,12 +395,6 @@ struct ahc_softc {
struct tmode_tstate* enabled_targets[16];
/*
- * The black hole device responsible for handling requests for
- * disabled luns on enabled targets.
- */
- struct tmode_lstate* black_hole;
-
- /*
* Device instance currently on the bus awaiting a continue TIO
* for a command that was not given the disconnect priveledge.
*/
@@ -452,9 +432,10 @@ struct ahc_softc {
* Per target state bitmasks.
*/
u_int16_t ultraenb; /* Using ultra sync rate */
+ u_int16_t sdtrpending; /* Pending SDTR request */
+ u_int16_t wdtrpending; /* Pending WDTR request */
u_int16_t discenable; /* Disconnection allowed */
u_int16_t tagenable; /* Tagged Queuing allowed */
- u_int16_t targ_msg_req; /* Need negotiation messages */
/*
* Hooks into the XPT.
@@ -481,24 +462,18 @@ struct ahc_softc {
int unsolicited_ints;
pcici_t pci_config_id;
- /*
- * Target incoming command FIFO.
- */
+ /* Hmmm. */
struct target_cmd *targetcmds;
- u_int8_t tqinfifonext;
+ int next_targetcmd;
+ int num_targetcmds;
/*
* Incoming and outgoing message handling.
*/
- u_int8_t send_msg_perror;
ahc_msg_type msg_type;
- u_int8_t msgout_buf[8]; /* Message we are sending */
- u_int8_t msgin_buf[8]; /* Message we are receiving */
- u_int msgout_len; /* Length of message to send */
- u_int msgout_index; /* Current index in msgout */
- u_int msgin_index; /* Current index in msgin */
-
- u_int enabled_luns;
+ u_int8_t msg_buf[8]; /* Message we are sending */
+ u_int msg_len; /* Length of message to send */
+ u_int msg_index; /* Current index in message */
/*
* "Bus" addresses of our data structures.
diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg
index 775c0e31086f..fff2b6f26fc1 100644
--- a/sys/dev/aic7xxx/aic7xxx.reg
+++ b/sys/dev/aic7xxx/aic7xxx.reg
@@ -1,7 +1,7 @@
/*
* Aic7xxx register and scratch ram definitions.
*
- * Copyright (c) 1994-1999 Justin Gibbs.
+ * Copyright (c) 1994-1998 Justin Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.reg,v 1.11 1998/12/17 00:06:52 gibbs Exp $
+ * $Id: aic7xxx.reg,v 1.4 1997/06/27 19:38:39 gibbs Exp $
*/
/*
@@ -471,7 +471,7 @@ register SEQCTL {
* Sequencer RAM Data (p. 3-34)
* Single byte window into the Scratch Ram area starting at the address
* specified by SEQADDR0 and SEQADDR1. To write a full word, simply write
- * four bytes in succession. The SEQADDRs will increment after the most
+ * four bytes in sucessesion. The SEQADDRs will increment after the most
* significant byte is written
*/
register SEQRAM {
@@ -675,20 +675,20 @@ register INTSTAT {
mask SEND_REJECT 0x10|SEQINT /* sending a message reject */
mask NO_IDENT 0x20|SEQINT /* no IDENTIFY after reconnect*/
mask NO_MATCH 0x30|SEQINT /* no cmd match for reconnect */
+ mask EXTENDED_MSG 0x40|SEQINT /* Extended message received */
mask ABORT_REQUESTED 0x50|SEQINT /* Reconect of aborted SCB */
+ mask REJECT_MSG 0x60|SEQINT /* Reject message received */
mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
mask RESIDUAL 0x80|SEQINT /* Residual byte count != 0 */
- mask TRACE_POINT 0x90|SEQINT
- mask HOST_MSG_LOOP 0xa0|SEQINT /*
- * The bus is ready for the
- * host to perform another
- * message transaction. This
- * mechanism is used for things
- * like sync/wide negotiation
- * that require a kernel based
- * message state engine.
+ mask AWAITING_MSG 0xa0|SEQINT /*
+ * Kernel requested to specify
+ * a message to this target
+ * (command was null), so tell
+ * it that it can fill the
+ * message buffer.
*/
mask TARGET_MSG_HELP 0xb0|SEQINT
+ mask TARGET_SYNC_CMD 0xc0|SEQINT
mask TRACEPOINT 0xd0|SEQINT
mask MSGIN_PHASEMIS 0xe0|SEQINT /*
* Target changed phase on us
@@ -763,16 +763,6 @@ register DFSTATUS {
bit FIFOEMP 0x01
}
-register DFWADDR {
- address 0x95
- access_mode RW
-}
-
-register DFRADDR {
- address 0x97
- access_mode RW
-}
-
register DFDAT {
address 0x099
access_mode RW
@@ -1265,25 +1255,18 @@ scratch_ram {
size 1
}
/*
- * Kernel and sequencer offsets into the queue of
- * incoming target mode command descriptors. The
- * queue is full when the ((KERNEL_TQINPOS - TQINPOS) == 1)
+ * Offset into the command descriptor array for the next
+ * available desciptor to use.
*/
- KERNEL_TQINPOS {
- size 1
- }
- TQINPOS {
+ TMODE_CMDADDR_NEXT {
size 1
}
ARG_1 {
size 1
- mask SEND_MSG 0x80
- mask SEND_SENSE 0x40
- mask SEND_REJ 0x20
- mask MSGOUT_PHASEMIS 0x10
- mask EXIT_MSG_LOOP 0x08
- mask CONT_MSG_LOOP 0x04
- mask CONT_TARG_SESSION 0x02
+ mask SEND_MSG 0x80
+ mask SEND_SENSE 0x40
+ mask SEND_REJ 0x20
+ mask MSGOUT_PHASEMIS 0x10
alias RETURN_1
}
ARG_2 {
@@ -1306,44 +1289,6 @@ scratch_ram {
size 1
}
- /*
- * Interrupt kernel for a message to this target on
- * the next transaction. This is usually used for
- * negotiation requests.
- */
- TARGET_MSG_REQUEST {
- size 2
- }
-
- /*
- * Sequences the kernel driver has okayed for us. This allows
- * the driver to do things like prevent initiator or target
- * operations.
- */
- SCSISEQ_TEMPLATE {
- size 1
- bit ENSELO 0x40
- bit ENSELI 0x20
- bit ENRSELI 0x10
- bit ENAUTOATNO 0x08
- bit ENAUTOATNI 0x04
- bit ENAUTOATNP 0x02
- }
-
- /*
- * Track whether the transfer byte count for
- * the current data phase is odd.
- */
- DATA_COUNT_ODD {
- size 1
- }
-
- /*
- * The initiator specified tag for this target mode transaction.
- */
- INITIATOR_TAG {
- size 1
- }
/*
* These are reserved registers in the card's scratch ram. Some of
@@ -1415,7 +1360,5 @@ const CMD_GROUP5_BYTE_DELTA 11
/*
* Number of command descriptors in the command descriptor array.
- * No longer used, but left here as an example for how downloaded
- * constantants can be defined.
-const TMODE_NUMCMDS download
*/
+const TMODE_NUMCMDS download
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq
index 3377449cd302..c1ab64df4193 100644
--- a/sys/dev/aic7xxx/aic7xxx.seq
+++ b/sys/dev/aic7xxx/aic7xxx.seq
@@ -1,7 +1,7 @@
/*
* Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
*
- * Copyright (c) 1994-1999 Justin Gibbs.
+ * Copyright (c) 1994-1998 Justin Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.seq,v 1.83 1998/12/17 00:06:52 gibbs Exp $
+ * $Id: aic7xxx.seq,v 1.78 1998/09/15 07:24:16 gibbs Exp $
*/
#include <dev/aic7xxx/aic7xxx.reg>
@@ -58,9 +58,12 @@
reset:
clr SCSISIGO; /* De-assert BSY */
- and SXFRCTL1, ~BITBUCKET;
/* Always allow reselection */
- and SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ_TEMPLATE;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ mvi SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP;
+ } else {
+ mvi SCSISEQ, ENRSELI|ENAUTOATNP;
+ }
if ((ahc->features & AHC_CMD_CHAN) != 0) {
/* Ensure that no DMA operations are in progress */
@@ -178,12 +181,13 @@ initialize_scsiid:
and SCSIID, OID; /* Clear old target */
or SCSIID, A;
}
- mov SINDEX, SCSISEQ_TEMPLATE;
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SCB_CONTROL, TARGET_SCB jz . + 2;
- or SINDEX, TEMODE;
+ and SINDEX, TARGET_SCB, SCB_CONTROL;
+ or SCSISEQ, ENSELO|ENAUTOATNO|ENSELI
+ |ENRSELI|ENAUTOATNP, SINDEX ret ;
+ } else {
+ mvi SCSISEQ, ENSELO|ENAUTOATNO|ENRSELI|ENAUTOATNP ret;
}
- mov SCSISEQ, SINDEX ret;
/*
* Initialize transfer settings and clear the SCSI channel.
@@ -212,26 +216,29 @@ selection:
mvi CLRSINT0, CLRSELDI;
select_in:
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- if ((ahc->flags & AHC_INITIATORMODE) != 0) {
- test SSTAT0, TARGET jz initiator_reselect;
- }
-
+ test SSTAT0, TARGET jz initiator_reselect;
/*
* We've just been selected. Assert BSY and
* setup the phase for receiving messages
* from the target.
*/
mvi SCSISIGO, P_MESGOUT|BSYO;
- mvi CLRSINT1, CLRBUSFREE;
+
+ /*
+ * LAST_MSG gives an indication to the host of what
+ * went wrong should we need to terminate this selection
+ * before doing real work. Initialize it to SCB_LIST_NULL to
+ * indicate an improper initiator selection.
+ */
+ mvi LAST_MSG, SCB_LIST_NULL;
/*
* Setup the DMA for sending the identify and
- * command information.
+ * command information. We keep a count of the
+ * number of bytes to send to the host in ARG_2.
*/
or SEQ_FLAGS, CMDPHASE_PENDING;
-
- /* XXX If ring buffer is full, return busy or queue full */
- mov A, TQINPOS;
+ mov A, TMODE_CMDADDR_NEXT;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mvi DINDEX, CCHADDR;
mvi TMODE_CMDADDR call set_32byte_addr;
@@ -265,9 +272,6 @@ select_in:
}
}
- /* No tag yet */
- mvi INITIATOR_TAG, SCB_LIST_NULL;
-
/*
* If ATN isn't asserted, the target isn't interested
* in talking to us. Go directly to bus free.
@@ -279,20 +283,20 @@ select_in:
* initiator. We follow the guidlines from section 6.5
* of the SCSI-2 spec for what messages are allowed when.
*/
- call target_inb;
+ call targ_inb;
/*
* Our first message must be one of IDENTIFY, ABORT, or
* BUS_DEVICE_RESET.
*/
- /* XXX May need to be more lax here for older initiators... */
- test DINDEX, MSG_IDENTIFYFLAG jz host_target_message_loop;
+ test DINDEX, MSG_IDENTIFYFLAG jz more_first_messages;
/* Store for host */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mov CCSCBRAM, DINDEX;
} else {
mov DFDAT, DINDEX;
}
+ mvi ARG_2, 3;
/* Remember for disconnection decision */
test DINDEX, MSG_IDENTIFY_DISCFLAG jnz . + 2;
@@ -300,7 +304,7 @@ select_in:
or SEQ_FLAGS, NO_DISCONNECT;
test SCSISIGI, ATNI jz ident_messages_done;
- call target_inb;
+ call targ_inb;
/*
* If this is a tagged request, the tagged message must
* immediately follow the identify. We test for a valid
@@ -324,39 +328,39 @@ select_in:
* free.
*/
test SCSISIGI, ATNI jz target_busfree;
-
/*
* Store the tag for the host.
*/
- call target_inb;
+ call targ_inb;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mov CCSCBRAM, DINDEX;
} else {
mov DFDAT, DINDEX;
}
- mov INITIATOR_TAG, DINDEX;
+ add ARG_2, 2;
jmp ident_messages_done;
+more_first_messages:
/*
- * Pushed message loop to allow the kernel to
- * run it's own target mode message state engine.
+ * Hmm. Now we're down to only accepting
+ * either an ABORT or BDR.
*/
-host_target_message_loop:
- mvi INTSTAT, HOST_MSG_LOOP;
- nop;
- cmp RETURN_1, EXIT_MSG_LOOP je target_ITloop;
- test SSTAT0, SPIORDY jz .;
- jmp host_target_message_loop;
+ cmp DINDEX, MSG_ABORT je . + 2;
+ cmp DINDEX, MSG_BUS_DEV_RESET jne target_busfree;
+
+ /* Record the event and notify the host */
+ mov LAST_MSG, DINDEX;
+ jmp target_busfree;
ident_messages_done:
+ mvi LAST_MSG, MSG_NOOP; /* We are so far successful */
/* Terminate the ident list */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mvi CCSCBRAM, SCB_LIST_NULL;
} else {
mvi DFDAT, SCB_LIST_NULL;
}
- or SEQ_FLAGS, TARG_CMD_PENDING|IDENTIFY_SEEN;
- test SCSISIGI, ATNI jnz target_mesgout_pending_msg;
+ or SEQ_FLAGS, TARG_CMD_PENDING;
jmp target_ITloop;
/*
@@ -364,20 +368,16 @@ ident_messages_done:
* message byte we receive so it can be checked prior to
* driving REQ on the bus for the next byte.
*/
-target_inb:
- /*
- * Drive REQ on the bus by enabling SCSI PIO.
- */
+targ_inb:
+ /* Drive REQ on the bus by enabling SCSI PIO */
or SXFRCTL0, SPIOEN;
/* Wait for the byte */
test SSTAT0, SPIORDY jz .;
/* Prevent our read from triggering another REQ */
and SXFRCTL0, ~SPIOEN;
- /* Save latched contents */
mov DINDEX, SCSIDATL ret;
}
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
/*
* Reselection has been initiated by a target. Make a note that we've been
* reselected, but haven't seen an IDENTIFY message from the target yet.
@@ -389,7 +389,7 @@ initiator_reselect:
test SBLKCTL, SELBUSB jz . + 2;
or SAVED_TCL, SELBUSB;
}
- or SXFRCTL0, SPIOEN|CLRSTCNT|CLRCHN;
+ or SXFRCTL0, SPIOEN|CLRCHN;
mvi CLRSINT1,CLRBUSFREE;
or SIMODE1, ENBUSFREE; /*
* We aren't expecting a
@@ -399,7 +399,6 @@ initiator_reselect:
*/
mvi MSG_OUT, MSG_NOOP; /* No message to send */
jmp ITloop;
-}
/*
* After the selection, remove this SCB from the "waiting SCB"
@@ -409,7 +408,11 @@ initiator_reselect:
*/
select_out:
/* Turn off the selection hardware */
- and SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ_TEMPLATE;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ mvi SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP;
+ } else {
+ mvi SCSISEQ, ENRSELI|ENAUTOATNP;
+ }
mvi CLRSINT0, CLRSELDO;
mov SCBPTR, WAITING_SCBH;
mov WAITING_SCBH,SCB_NEXT;
@@ -422,8 +425,7 @@ select_out:
* Assert BSY and setup the phase for
* sending our identify messages.
*/
- mvi P_MESGIN|BSYO call change_phase;
- mvi CLRSINT1,CLRBUSFREE;
+ mvi SCSISIGO, P_MESGIN|BSYO;
/*
* Start out with a simple identify message.
@@ -437,22 +439,19 @@ select_out:
*/
test SCB_CONTROL, TAG_ENB jz . + 3;
mvi MSG_SIMPLE_Q_TAG call target_outb;
- mov SCB_INITIATOR_TAG call target_outb;
- mov INITIATOR_TAG, SCB_INITIATOR_TAG;
+ mov SCB_TAG call target_outb;
target_synccmd:
/*
* Now determine what phases the host wants us
* to go through.
*/
mov SEQ_FLAGS, SCB_TARGET_PHASES;
-
target_ITloop:
/*
- * Start honoring ATN signals now that
- * we properly identified ourself.
+ * XXX Start honoring ATN signals now that
+ * we properly identified ourself.
*/
- test SCSISIGI, ATNI jnz target_mesgout;
test SEQ_FLAGS, CMDPHASE_PENDING jnz target_cmdphase;
test SEQ_FLAGS, DPHASE_PENDING jnz target_dphase;
test SEQ_FLAGS, SPHASE_PENDING jnz target_sphase;
@@ -465,35 +464,38 @@ target_ITloop:
if ((ahc->flags & AHC_PAGESCBS) != 0) {
mov ALLZEROS call get_free_or_disc_scb;
}
- mov RETURN_1, ALLZEROS;
call complete_target_cmd;
- cmp RETURN_1, CONT_MSG_LOOP jne .;
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
mov SCB_TAG call dma_scb;
jmp target_synccmd;
-target_mesgout:
- mvi SCSISIGO, P_MESGOUT|BSYO;
- call target_inb;
- /* Local Processing goes here... */
-target_mesgout_pending_msg:
- jmp host_target_message_loop;
-
target_disconnect:
- mvi P_MESGIN|BSYO call change_phase;
- test SEQ_FLAGS, DPHASE jz . + 2;
- mvi MSG_SAVEDATAPOINTER call target_outb;
+ mvi SCSISIGO, P_MESGIN|BSYO;
mvi MSG_DISCONNECT call target_outb;
target_busfree:
+ and SXFRCTL0, ~SPIOEN;
clr SCSISIGO;
call complete_target_cmd;
+ cmp LAST_MSG, MSG_NOOP je . + 2;
+ mvi INTSTAT, TARGET_MSG_HELP;
call clear_target_state;
jmp poll_for_work;
target_cmdphase:
- mvi P_COMMAND|BSYO call change_phase;
- call target_inb;
+ /*
+ * Add one for the terminating byte
+ * and one for the command code.
+ */
+ if ((ahc->features & AHC_CMD_CHAN) != 0) {
+ add CCHCNT, 2, ARG_2;
+ } else {
+ add HCNT[0], 2, ARG_2;
+ clr HCNT[1];
+ clr HCNT[2];
+ }
+ mvi SCSISIGO, P_COMMAND|BSYO;
+ call targ_inb;
mov A, DINDEX;
/* Store for host */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -504,16 +506,20 @@ target_cmdphase:
/*
* Determine the number of bytes to read
- * based on the command group code via table lookup.
- * We reuse the first 8 bytes of the TARG_SCSIRATE
- * BIOS array for this table. Count is one less than
- * the total for the command since we've already fetched
- * the first byte.
+ * based on the command group code using an adding
+ * jump table. Count is one less than the total
+ * since we've already fetched the first byte.
*/
shr A, CMD_GROUP_CODE_SHIFT;
add SINDEX, TARG_SCSIRATE, A;
mov A, SINDIR;
+ if ((ahc->features & AHC_CMD_CHAN) != 0) {
+ add CCHCNT, A;
+ } else {
+ add HCNT[0], A;
+ }
+
test A, 0xFF jz command_phase_done;
command_loop:
or SXFRCTL0, SPIOEN;
@@ -537,20 +543,20 @@ target_dphase:
* Data direction flags are from the
* perspective of the initiator.
*/
+ and SXFRCTL0, ~SPIOEN;
+ or SXFRCTL0, CLRCHN;
test SCB_TARGET_PHASES[1], TARGET_DATA_IN jz . + 4;
+ mvi SCSISIGO, P_DATAIN|BSYO;
mvi LASTPHASE, P_DATAOUT;
- mvi P_DATAIN|BSYO call change_phase;
- jmp . + 3;
+ jmp p_data;
+ mvi SCSISIGO, P_DATAOUT|BSYO;
mvi LASTPHASE, P_DATAIN;
- mvi P_DATAOUT|BSYO call change_phase;
- mov ALLZEROS call initialize_channel;
jmp p_data;
target_sphase:
- mvi P_STATUS|BSYO call change_phase;
- mvi LASTPHASE, P_STATUS;
+ mvi SCSISIGO, P_STATUS|BSYO;
mov SCB_TARGET_STATUS call target_outb;
- /* XXX Watch for ATN or parity errors??? */
+ /* XXX Watch for ATN for parity errors??? */
mvi SCSISIGO, P_MESGIN|BSYO;
/* MSG_CMDCMPLT is 0, but we can't do an immediate of 0 */
mov ALLZEROS call target_outb;
@@ -560,52 +566,37 @@ complete_target_cmd:
test SEQ_FLAGS, TARG_CMD_PENDING jnz . + 2;
mov SCB_TAG jmp complete_post;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
- /* Set the valid byte */
- mvi CCSCBADDR, 24;
- mov CCSCBRAM, ALLONES;
- mvi CCHCNT, 28;
or CCSCBCTL, CCSCBEN|CCSCBRESET;
test CCSCBCTL, CCSCBDONE jz .;
clr CCSCBCTL;
} else {
- /* Set the valid byte */
- or DFCNTRL, FIFORESET;
- mvi DFWADDR, 3; /* Third 64bit word or byte 24 */
- mov DFDAT, ALLONES;
- mvi HCNT[0], 28;
- clr HCNT[1];
- clr HCNT[2];
or DFCNTRL, HDMAEN|FIFOFLUSH;
call dma_finish;
}
- inc TQINPOS;
- mvi INTSTAT,CMDCMPLT ret;
+ inc TMODE_CMDADDR_NEXT;
+ cmp TMODE_CMDADDR_NEXT, TMODE_NUMCMDS jne . + 2;
+ clr TMODE_CMDADDR_NEXT;
+ mvi TARGET_CMD_CMPLT jmp complete_post;
}
-
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
initiator_select:
mvi SPIOEN call initialize_channel;
-
- /*
- * We aren't expecting a bus free, so interrupt
- * the kernel driver if it happens.
- */
+/*
+ * We aren't expecting a bus free, so interrupt
+ * the kernel driver if it happens.
+ */
mvi CLRSINT1,CLRBUSFREE;
or SIMODE1, ENBUSFREE;
-
- /*
- * As soon as we get a successful selection, the target
- * should go into the message out phase since we have ATN
- * asserted.
- */
+/*
+ * As soon as we get a successful selection, the target should go
+ * into the message out phase since we have ATN asserted.
+ */
mvi MSG_OUT, MSG_IDENTIFYFLAG;
or SEQ_FLAGS, IDENTIFY_SEEN;
- /*
- * Main loop for information transfer phases. Wait for the
- * target to assert REQ before checking MSG, C/D and I/O for
- * the bus phase.
- */
+/*
+ * Main loop for information transfer phases. Wait for the target
+ * to assert REQ before checking MSG, C/D and I/O for the bus phase.
+ */
ITloop:
call phase_lock;
@@ -617,7 +608,7 @@ ITloop:
cmp A,P_STATUS je p_status;
cmp A,P_MESGIN je p_mesgin;
- mvi INTSTAT,BAD_PHASE;
+ mvi INTSTAT,BAD_PHASE; /* unknown phase - signal driver */
jmp ITloop; /* Try reading the bus again. */
await_busfree:
@@ -628,27 +619,20 @@ await_busfree:
test SSTAT1,REQINIT|BUSFREE jz .;
test SSTAT1, BUSFREE jnz poll_for_work;
mvi INTSTAT, BAD_PHASE;
-}
clear_target_state:
- /*
- * We assume that the kernel driver may reset us
- * at any time, even in the middle of a DMA, so
- * clear DFCNTRL too.
- */
- clr DFCNTRL;
-
- /*
- * We don't know the target we will connect to,
- * so default to narrow transfers to avoid
- * parity problems.
- */
- if ((ahc->features & AHC_ULTRA2) != 0) {
- bmov SCSIRATE, ALLZEROS, 2;
- } else {
- clr SCSIRATE;
- and SXFRCTL0, ~(FAST20);
- }
+ clr DFCNTRL; /*
+ * We assume that the kernel driver
+ * may reset us at any time, even
+ * in the middle of a DMA, so clear
+ * DFCNTRL too.
+ */
+ clr SCSIRATE; /*
+ * We don't know the target we will
+ * connect to, so default to narrow
+ * transfers to avoid parity problems.
+ */
+ and SXFRCTL0, ~(FAST20);
mvi LASTPHASE, P_BUSFREE;
/* clear target specific flags */
clr SEQ_FLAGS ret;
@@ -664,7 +648,6 @@ data_phase_reinit:
mvi DINDEX, STCNT;
mvi SCB_RESID_DCNT call bcopy_3;
}
- and DATA_COUNT_ODD, 0x1, SCB_RESID_DCNT[0];
jmp data_phase_loop;
p_data:
@@ -699,7 +682,6 @@ p_data:
mvi DINDEX, HADDR;
mvi SCB_DATAPTR call bcopy_7;
}
- and DATA_COUNT_ODD, 0x1, SCB_DATACNT[0];
if ((ahc->features & AHC_ULTRA2) == 0) {
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -826,10 +808,6 @@ prefetched_segs_avail:
mvi HADDR call dfdat_in_7;
}
- /* Track odd'ness */
- test HCNT[0], 0x1 jz . + 2;
- xor DATA_COUNT_ODD, 0x1;
-
if ((ahc->features & AHC_ULTRA2) == 0) {
/* Load STCNT as well. It is a mirror of HCNT */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -844,12 +822,7 @@ prefetched_segs_avail:
add SG_NEXT[0],SG_SIZEOF;
adc SG_NEXT[1],A;
- if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SSTAT0, TARGET jnz data_phase_loop;
- }
- test SSTAT1, REQINIT jz .;
test SSTAT1,PHASEMIS jz data_phase_loop;
-
/* Ensure the last seg is visable at the shaddow layer */
if ((ahc->features & AHC_ULTRA2) != 0) {
or DFCNTRL, PRELOADEN;
@@ -878,14 +851,8 @@ data_phase_finish:
}
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SEQ_FLAGS, DPHASE_PENDING jz ITloop;
+ test SEQ_FLAGS, DPHASE_PENDING jz . + 3;
and SEQ_FLAGS, ~DPHASE_PENDING;
- /*
- * For data-in phases, wait for any pending acks from the
- * initiator before changing phase.
- */
- test DFCNTRL, DIRECTION jz target_ITloop;
- test SSTAT1, REQINIT jnz .;
jmp target_ITloop;
}
jmp ITloop;
@@ -915,7 +882,6 @@ ultra2_dmahalt:
ret;
}
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
/*
* Command phase. Set up the DMA registers and let 'er rip.
*/
@@ -972,22 +938,17 @@ p_status:
jmp ITloop;
/*
- * Message out phase. If MSG_OUT is MSG_IDENTIFYFLAG, build a full
- * indentify message sequence and send it to the target. The host may
- * override this behavior by setting the MK_MESSAGE bit in the SCB
- * control byte. This will cause us to interrupt the host and allow
- * it to handle the message phase completely on its own. If the bit
- * associated with this target is set, we will also interrupt the host,
- * thereby allowing it to send a message on the next selection regardless
- * of the transaction being sent.
+ * Message out phase. If MSG_OUT is 0x80, build I full indentify message
+ * sequence and send it to the target. In addition, if the MK_MESSAGE bit
+ * is set in the SCB_CONTROL byte, interrupt the host and allow it to send
+ * it's own message.
*
* If MSG_OUT is == HOST_MSG, also interrupt the host and take a message.
- * This is done to allow the host to send messages outside of an identify
+ * This is done to allow the hsot to send messages outside of an identify
* sequence while protecting the seqencer from testing the MK_MESSAGE bit
* on an SCB that might not be for the current nexus. (For example, a
* BDR message in responce to a bad reselection would leave us pointed to
* an SCB that doesn't have anything to do with the current target).
- *
* Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag,
* bus device reset).
*
@@ -995,29 +956,22 @@ p_status:
* in case the target decides to put us in this phase for some strange
* reason.
*/
-p_mesgout_retry:
- or SCSISIGO,ATNO,LASTPHASE;/* turn on ATN for the retry */
p_mesgout:
mov SINDEX, MSG_OUT;
cmp SINDEX, MSG_IDENTIFYFLAG jne p_mesgout_from_host;
- test SCB_CONTROL,MK_MESSAGE jnz host_message_loop;
- mov FUNCTION1, SCB_TCL;
- mov A, FUNCTION1;
- mov SINDEX, TARGET_MSG_REQUEST[0];
- if ((ahc->features & AHC_TWIN) != 0) {
- /* Second Channel uses high byte bits */
- test SCB_TCL, SELBUSB jz . + 2;
- mov SINDEX, TARGET_MSG_REQUEST[1];
- } else if ((ahc->features & AHC_WIDE) != 0) {
- test SCB_TCL, 0x80 jz . + 2; /* target > 7 */
- mov SINDEX, TARGET_MSG_REQUEST[1];
- }
- test SINDEX, A jnz host_message_loop;
p_mesgout_identify:
- and SINDEX,LID,SCB_TCL; /* lun */
+ if ((ahc->features & AHC_WIDE) != 0) {
+ and SINDEX,0xf,SCB_TCL; /* lun */
+ } else {
+ and SINDEX,0x7,SCB_TCL; /* lun */
+ }
and A,DISCENB,SCB_CONTROL; /* mask off disconnect privledge */
or SINDEX,A; /* or in disconnect privledge */
or SINDEX,MSG_IDENTIFYFLAG;
+p_mesgout_mk_message:
+ test SCB_CONTROL,MK_MESSAGE jz p_mesgout_tag;
+ mov SCSIDATL, SINDEX; /* Send the last byte */
+ jmp p_mesgout_from_host + 1;/* Skip HOST_MSG test */
/*
* Send a tag message if TAG_ENB is set in the SCB control block.
* Use SCB_TAG (the position in the kernel's SCB array) as the tag value.
@@ -1032,27 +986,36 @@ p_mesgout_tag:
cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
mov SCB_TAG jmp p_mesgout_onebyte;
/*
- * Interrupt the driver, and allow it to handle this message
- * phase and any required retries.
+ * Interrupt the driver, and allow it to send a message
+ * if it asks.
*/
p_mesgout_from_host:
cmp SINDEX, HOST_MSG jne p_mesgout_onebyte;
- jmp host_message_loop;
+ mvi INTSTAT,AWAITING_MSG;
+ nop;
+ /*
+ * Did the host detect a phase change?
+ */
+ cmp RETURN_1, MSGOUT_PHASEMIS je p_mesgout_done;
p_mesgout_onebyte:
mvi CLRSINT1, CLRATNO;
mov SCSIDATL, SINDEX;
/*
- * If the next bus phase after ATN drops is message out, it means
+ * If the next bus phase after ATN drops is a message out, it means
* that the target is requesting that the last message(s) be resent.
*/
call phase_lock;
- cmp LASTPHASE, P_MESGOUT je p_mesgout_retry;
+ cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
+ or SCSISIGO,ATNO,LASTPHASE;/* turn on ATN for the retry */
+ jmp p_mesgout;
p_mesgout_done:
mvi CLRSINT1,CLRATNO; /* Be sure to turn ATNO off */
mov LAST_MSG, MSG_OUT;
+ cmp MSG_OUT, MSG_IDENTIFYFLAG jne . + 2;
+ and SCB_CONTROL, ~MK_MESSAGE;
mvi MSG_OUT, MSG_NOOP; /* No message left */
jmp ITloop;
@@ -1067,22 +1030,19 @@ p_mesgin:
cmp A,MSG_SAVEDATAPOINTER je mesgin_sdptrs;
cmp ALLZEROS,A je mesgin_complete;
cmp A,MSG_RESTOREPOINTERS je mesgin_rdptrs;
+ cmp A,MSG_EXTENDED je mesgin_extended;
+ cmp A,MSG_MESSAGE_REJECT je mesgin_reject;
cmp A,MSG_NOOP je mesgin_done;
+rej_mesgin:
/*
- * Pushed message loop to allow the kernel to
- * RUN IT's own message state engine. To avoid an
- * extra nop instruction after signaling the kernel,
- * we perform the phase_lock before checking to see
- * if we should exit the loop and skip the phase_lock
- * in the ITloop. Performing back to back phase_locks
- * shouldn't hurt, but why do it twice...
+ * We have no idea what this message in is, so we issue a message reject
+ * and hope for the best. In any case, rejection should be a rare
+ * occurrence - signal the driver when it happens.
*/
-host_message_loop:
- mvi INTSTAT, HOST_MSG_LOOP;
- call phase_lock;
- cmp RETURN_1, EXIT_MSG_LOOP je ITloop + 1;
- jmp host_message_loop;
+ mvi INTSTAT,SEND_REJECT; /* let driver know */
+
+ mvi MSG_MESSAGE_REJECT call mk_mesg;
mesgin_done:
mov NONE,SCSIDATL; /*dummy read from latch to ACK*/
@@ -1147,7 +1107,6 @@ complete_queue:
add_to_free_list:
call add_scb_to_free_list;
jmp await_busfree;
-}
complete_post:
/* Post the SCBID in SINDEX and issue an interrupt */
@@ -1162,9 +1121,23 @@ complete_post:
if ((ahc->features & AHC_QUEUE_REGS) == 0) {
inc QOUTPOS;
}
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ test SEQ_FLAGS, NO_DISCONNECT jz . + 3;
+ mvi INTSTAT,TARGET_SYNC_CMD|CMDCMPLT;
+ ret;
+ }
mvi INTSTAT,CMDCMPLT ret;
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
+/*
+ * Is it an extended message? Copy the message to our message buffer and
+ * notify the host. The host will tell us whether to reject this message,
+ * respond to it with the message that the host placed in our message buffer,
+ * or simply to do nothing.
+ */
+mesgin_extended:
+ mvi INTSTAT,EXTENDED_MSG; /* let driver know */
+ jmp ITloop;
+
/*
* Is it a disconnect message? Set a flag in the SCB to remind us
* and await the bus going free.
@@ -1293,6 +1266,16 @@ not_found:
jmp mesgin_done;
/*
+ * Message reject? Let the kernel driver handle this. If we have an
+ * outstanding WDTR or SDTR negotiation, assume that it's a response from
+ * the target selecting 8bit or asynchronous transfer, otherwise just ignore
+ * it since we have no clue what it pertains to.
+ */
+mesgin_reject:
+ mvi INTSTAT, REJECT_MSG;
+ jmp mesgin_done;
+
+/*
* [ ADD MORE MESSAGE HANDLING HERE ]
*/
@@ -1337,35 +1320,18 @@ inb_first:
mov DINDIR,SCSIBUSL ret; /*read byte directly from bus*/
inb_last:
mov NONE,SCSIDATL ret; /*dummy read from latch to ACK*/
-}
if ((ahc->flags & AHC_TARGETMODE) != 0) {
-/*
- * Change to a new phase. If we are changing the state of the I/O signal,
- * from out to in, wait an additional data release delay before continuing.
- */
-change_phase:
- and DINDEX, IOI, SCSISIGI;
- mov SCSISIGO, SINDEX;
- and A, IOI, SINDEX;
- cmp DINDEX, A je change_phase_wait;
- test SINDEX, IOI jz change_phase_wait;
- call change_phase_wait;
-change_phase_wait:
- nop;
- nop;
- nop;
- nop ret;
-
-/*
- * Send a byte to an initiator in Automatic PIO mode.
- */
+ /*
+ * Send a byte to an initiator in Automatic PIO mode.
+ * SPIOEN must be on prior to calling this routine.
+ */
target_outb:
or SXFRCTL0, SPIOEN;
test SSTAT0, SPIORDY jz .;
mov SCSIDATL, SINDEX;
test SSTAT0, SPIORDY jz .;
- and SXFRCTL0, ~SPIOEN ret;
+ ret;
}
mesgin_phasemis:
@@ -1584,8 +1550,8 @@ get_SCBID_from_host:
phase_lock:
test SSTAT1, REQINIT jz phase_lock;
test SSTAT1, SCSIPERR jnz phase_lock;
- and SCSISIGO, PHASE_MASK, SCSISIGI;
- and LASTPHASE, PHASE_MASK, SCSISIGI ret;
+ and LASTPHASE, PHASE_MASK, SCSISIGI;
+ mov SCSISIGO, LASTPHASE ret;
if ((ahc->features & AHC_CMD_CHAN) == 0) {
set_stcnt_from_hcnt:
diff --git a/sys/dev/aic7xxx/aicasm_gram.y b/sys/dev/aic7xxx/aicasm_gram.y
index fdf352249ab8..09a62b936d27 100644
--- a/sys/dev/aic7xxx/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm_gram.y
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aicasm_gram.y,v 1.5 1998/09/15 07:24:17 gibbs Exp $
+ * $Id: aicasm_gram.y,v 1.4 1997/09/27 19:37:28 gibbs Exp $
*/
#include <stdio.h>
@@ -861,12 +861,12 @@ code:
;
code:
- T_NOP ret ';'
+ T_NOP ';'
{
expression_t immed;
make_expression(&immed, 0xff);
- format_1_instr(AIC_OP_AND, &none, &immed, &allzeros, $2);
+ format_1_instr(AIC_OP_AND, &none, &immed, &allzeros, FALSE);
}
;
diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c
index 33ca81f6b2a6..719684436883 100644
--- a/sys/dev/buslogic/bt.c
+++ b/sys/dev/buslogic/bt.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt.c,v 1.12 1998/12/04 22:54:44 archie Exp $
+ * $Id: bt.c,v 1.6 1998/10/15 23:17:58 gibbs Exp $
*/
/*
@@ -181,26 +181,12 @@ u_long bt_unit = 0;
*/
struct bt_isa_port bt_isa_ports[] =
{
- { 0x130, 0, 4 },
- { 0x134, 0, 5 },
- { 0x230, 0, 2 },
- { 0x234, 0, 3 },
- { 0x330, 0, 0 },
- { 0x334, 0, 1 }
-};
-
-/*
- * I/O ports listed in the order enumerated by the
- * card for certain op codes.
- */
-u_int16_t bt_board_ports[] =
-{
- 0x330,
- 0x334,
- 0x230,
- 0x234,
- 0x130,
- 0x134
+ { 0x330, 0 },
+ { 0x334, 0 },
+ { 0x230, 0 },
+ { 0x234, 0 },
+ { 0x130, 0 },
+ { 0x134, 0 }
};
/* Exported functions */
@@ -449,15 +435,15 @@ bt_fetch_adapter_info(struct bt_softc *bt)
if (esetup_info.bus_type == 'A'
&& bt->firmware_ver[0] == '2') {
- snprintf(bt->model, sizeof(bt->model), "542B");
+ strcpy(bt->model, "542B");
} else if (esetup_info.bus_type == 'E'
&& (strncmp(bt->firmware_ver, "2.1", 3) == 0
|| strncmp(bt->firmware_ver, "2.20", 4) == 0)) {
- snprintf(bt->model, sizeof(bt->model), "742A");
+ strcpy(bt->model, "742A");
} else if (esetup_info.bus_type == 'E'
&& bt->firmware_ver[0] == '0') {
/* AMI FastDisk EISA Series 441 0.x */
- snprintf(bt->model, sizeof(bt->model), "747A");
+ strcpy(bt->model, "747A");
} else {
ha_model_data_t model_data;
int i;
@@ -819,7 +805,7 @@ bt_name(struct bt_softc *bt)
{
static char name[10];
- snprintf(name, sizeof(name), "bt%d", bt->unit);
+ sprintf(name, "bt%d", bt->unit);
return (name);
}
@@ -828,7 +814,7 @@ bt_check_probed_iop(u_int ioport)
{
u_int i;
- for (i = 0; i < BT_NUM_ISAPORTS; i++) {
+ for (i=0; i < BT_NUM_ISAPORTS; i++) {
if (bt_isa_ports[i].addr == ioport) {
if (bt_isa_ports[i].probed != 0)
return (1);
@@ -844,7 +830,7 @@ void
bt_mark_probed_bio(isa_compat_io_t port)
{
if (port < BIO_DISABLED)
- bt_mark_probed_iop(bt_board_ports[port]);
+ bt_isa_ports[port].probed = 1;
}
void
@@ -860,44 +846,6 @@ bt_mark_probed_iop(u_int ioport)
}
}
-void
-bt_find_probe_range(int ioport, int *port_index, int *max_port_index)
-{
- if (ioport > 0) {
- int i;
-
- for (i = 0;i < BT_NUM_ISAPORTS; i++)
- if (ioport <= bt_isa_ports[i].addr)
- break;
- if ((i >= BT_NUM_ISAPORTS)
- || (ioport != bt_isa_ports[i].addr)) {
- printf("
-bt_isa_probe: Invalid baseport of 0x%x specified.
-bt_isa_probe: Nearest valid baseport is 0x%x.
-bt_isa_probe: Failing probe.\n",
- ioport,
- (i < BT_NUM_ISAPORTS)
- ? bt_isa_ports[i].addr
- : bt_isa_ports[BT_NUM_ISAPORTS - 1].addr);
- *port_index = *max_port_index = -1;
- return;
- }
- *port_index = *max_port_index = bt_isa_ports[i].bio;
- } else {
- *port_index = 0;
- *max_port_index = BT_NUM_ISAPORTS - 1;
- }
-}
-
-int
-bt_iop_from_bio(isa_compat_io_t bio_index)
-{
- if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS)
- return (bt_board_ports[bio_index]);
- return (-1);
-}
-
-
static void
btallocccbs(struct bt_softc *bt)
{
@@ -970,7 +918,6 @@ btfreeccb(struct bt_softc *bt, struct bt_ccb *bccb)
}
bccb->flags = BCCB_FREE;
SLIST_INSERT_HEAD(&bt->free_bt_ccbs, bccb, links);
- bt->active_ccbs--;
splx(s);
}
@@ -983,16 +930,13 @@ btgetccb(struct bt_softc *bt)
s = splcam();
if ((bccb = SLIST_FIRST(&bt->free_bt_ccbs)) != NULL) {
SLIST_REMOVE_HEAD(&bt->free_bt_ccbs, links);
- bt->active_ccbs++;
} else if (bt->num_ccbs < bt->max_ccbs) {
btallocccbs(bt);
bccb = SLIST_FIRST(&bt->free_bt_ccbs);
if (bccb == NULL)
printf("%s: Can't malloc BCCB\n", bt_name(bt));
- else {
+ else
SLIST_REMOVE_HEAD(&bt->free_bt_ccbs, links);
- bt->active_ccbs++;
- }
}
splx(s);
@@ -1015,6 +959,7 @@ btaction(struct cam_sim *sim, union ccb *ccb)
{
struct bt_ccb *bccb;
struct bt_hccb *hccb;
+ u_int16_t targ_mask;
/*
* get a bccb to use.
@@ -1047,6 +992,7 @@ btaction(struct cam_sim *sim, union ccb *ccb)
hccb->target_lun = ccb->ccb_h.target_lun;
hccb->btstat = 0;
hccb->sdstat = 0;
+ targ_mask = (0x01 << hccb->target_id);
if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
struct ccb_scsiio *csio;
@@ -1055,8 +1001,8 @@ btaction(struct cam_sim *sim, union ccb *ccb)
csio = &ccb->csio;
ccbh = &csio->ccb_h;
hccb->opcode = INITIATOR_CCB_WRESID;
- hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) ? 1 : 0;
- hccb->dataout =(ccb->ccb_h.flags & CAM_DIR_OUT) ? 1 : 0;
+ hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) != 0;
+ hccb->dataout = (ccb->ccb_h.flags & CAM_DIR_OUT) != 0;
hccb->cmd_len = csio->cdb_len;
if (hccb->cmd_len > sizeof(hccb->scsi_cdb)) {
ccb->ccb_h.status = CAM_REQ_INVALID;
@@ -1365,7 +1311,7 @@ btexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op);
} else {
- bccb->hccb.opcode = INITIATOR_CCB;
+ bccb->hccb.opcode = INITIATOR_SG_CCB;
bccb->hccb.data_len = 0;
bccb->hccb.data_addr = 0;
}
@@ -1395,27 +1341,8 @@ btexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
/* Tell the adapter about this command */
bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb);
- if (bt->cur_outbox->action_code != BMBO_FREE) {
- /*
- * We should never encounter a busy mailbox.
- * If we do, warn the user, and treat it as
- * a resource shortage. If the controller is
- * hung, one of the pending transactions will
- * timeout causing us to start recovery operations.
- */
- printf("%s: Encountered busy mailbox with %d out of %d "
- "commands active!!!", bt_name(bt), bt->active_ccbs,
- bt->max_ccbs);
- untimeout(bttimeout, bccb, ccb->ccb_h.timeout_ch);
- if (nseg != 0)
- bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap);
- btfreeccb(bt, bccb);
- bt->resource_shortage = TRUE;
- xpt_freeze_simq(bt->sim, /*count*/1);
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
- xpt_done(ccb);
- return;
- }
+ if (bt->cur_outbox->action_code != BMBO_FREE)
+ panic("%s: Too few mailboxes or to many ccbs???", bt_name(bt));
bt->cur_outbox->action_code = BMBO_START;
bt_outb(bt, COMMAND_REG, BOP_START_MBOX);
btnextoutbox(bt);
@@ -1536,22 +1463,14 @@ btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code)
break;
case BMBI_ABORT:
case BMBI_ERROR:
- if (bootverbose) {
- printf("bt: ccb %p - error %x occured. "
- "btstat = %x, sdstat = %x\n",
- (void *)bccb, comp_code, bccb->hccb.btstat,
- bccb->hccb.sdstat);
- }
+#if 0
+ printf("bt: ccb %x - error %x occured. btstat = %x, sdstat = %x\n",
+ bccb, comp_code, bccb->hccb.btstat, bccb->hccb.sdstat);
+#endif
/* An error occured */
switch(bccb->hccb.btstat) {
case BTSTAT_DATARUN_ERROR:
- if (bccb->hccb.data_len == 0) {
- /*
- * At least firmware 4.22, does this
- * for a QUEUE FULL condition.
- */
- bccb->hccb.sdstat = SCSI_STATUS_QUEUE_FULL;
- } else if (bccb->hccb.data_len < 0) {
+ if (bccb->hccb.data_len <= 0) {
csio->ccb_h.status = CAM_DATA_RUN_ERR;
break;
}
@@ -1779,13 +1698,11 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
u_int intstat;
u_int reply_buf_size;
int s;
- int cmd_complete;
/* No data returned to start */
reply_buf_size = reply_len;
reply_len = 0;
intstat = 0;
- cmd_complete = 0;
bt->command_cmp = 0;
/*
@@ -1821,13 +1738,10 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
status = bt_inb(bt, STATUS_REG);
intstat = bt_inb(bt, INTSTAT_REG);
if ((intstat & (INTR_PENDING|CMD_COMPLETE))
- == (INTR_PENDING|CMD_COMPLETE)) {
- cmd_complete = 1;
+ == (INTR_PENDING|CMD_COMPLETE))
break;
- }
if (bt->command_cmp != 0) {
status = bt->latched_status;
- cmd_complete = 1;
break;
}
if ((status & DATAIN_REG_READY) != 0)
@@ -1849,7 +1763,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
* the CMD_REG_BUSY status to clear and check for a command
* failure.
*/
- if (cmd_complete == 0 && opcode == BOP_MODIFY_IO_ADDR) {
+ if (opcode == BOP_MODIFY_IO_ADDR) {
while (--cmd_timeout) {
status = bt_inb(bt, STATUS_REG);
@@ -1874,7 +1788,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
* For all other commands, we wait for any output data
* and the final comand completion interrupt.
*/
- while (cmd_complete == 0 && --cmd_timeout) {
+ while (--cmd_timeout) {
status = bt_inb(bt, STATUS_REG);
intstat = bt_inb(bt, INTSTAT_REG);
diff --git a/sys/dev/buslogic/btreg.h b/sys/dev/buslogic/btreg.h
index fa049bcfc3e2..d31db883fc3d 100644
--- a/sys/dev/buslogic/btreg.h
+++ b/sys/dev/buslogic/btreg.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: btreg.h,v 1.2 1998/10/30 02:06:44 gibbs Exp $
+ * $Id$
*/
#ifndef _BTREG_H_
@@ -408,7 +408,6 @@ typedef struct {
struct bt_isa_port {
u_int16_t addr;
u_int8_t probed;
- u_int8_t bio;
};
extern struct bt_isa_port bt_isa_ports[];
@@ -550,7 +549,7 @@ struct bt_hccb {
wide_tag_type :2; /* Wide Lun CCB format */
u_int8_t cmd_len;
u_int8_t sense_len;
- int32_t data_len; /* residuals can be negative */
+ u_int32_t data_len;
u_int32_t data_addr;
u_int8_t reserved[2];
u_int8_t btstat;
@@ -600,7 +599,6 @@ struct bt_softc {
struct bt_ccb *bt_ccb_array;
SLIST_HEAD(,bt_ccb) free_bt_ccbs;
LIST_HEAD(,ccb_hdr) pending_ccbs;
- u_int active_ccbs;
u_int32_t bt_ccb_physbase;
bt_mbox_in_t *in_boxes;
bt_mbox_out_t *out_boxes;
@@ -668,11 +666,6 @@ char * bt_name(struct bt_softc *bt);
int bt_check_probed_iop(u_int ioport);
void bt_mark_probed_bio(isa_compat_io_t port);
void bt_mark_probed_iop(u_int ioport);
-void bt_find_probe_range(int ioport,
- int *port_index,
- int *max_port_index);
-
-int bt_iop_from_bio(isa_compat_io_t bio_index);
#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */
int bt_cmd(struct bt_softc *bt, bt_op_t opcode,
diff --git a/sys/dev/dec/mcclock_if.m b/sys/dev/dec/mcclock_if.m
index 79686237ed57..39a06baf5d48 100644
--- a/sys/dev/dec/mcclock_if.m
+++ b/sys/dev/dec/mcclock_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: mcclock_if.m,v 1.1 1998/06/14 13:52:55 dfr Exp $
+# $Id$
#
-INTERFACE mcclock;
+INTERFACE mcclock
#
# Read an RTC register and return its value.
diff --git a/sys/dev/dpt/dpt_control.c b/sys/dev/dpt/dpt_control.c
index b28fb672d1cf..ba4bec9c3cdb 100644
--- a/sys/dev/dpt/dpt_control.c
+++ b/sys/dev/dpt/dpt_control.c
@@ -36,7 +36,7 @@
* future.
*/
-#ident "$Id: dpt_control.c,v 1.9 1998/09/15 08:33:31 gibbs Exp $"
+#ident "$Id: dpt_control.c,v 1.8 1998/08/05 00:54:36 eivind Exp $"
#include "opt_dpt.h"
@@ -782,8 +782,7 @@ dpt_ioctl(dev_t dev, u_long cmd, caddr_t cmdarg, int flags, struct proc * p)
compat_softc.ha_npend = dpt->submitted_ccbs_count;
compat_softc.ha_active_jobs = dpt->waiting_ccbs_count;
strncpy(compat_softc.ha_fw_version,
- dpt->board_data.firmware,
- sizeof(compat_softc.ha_fw_version));
+ dpt->board_data.firmware, 4);
compat_softc.ha_ccb = NULL;
compat_softc.ha_cblist = NULL;
compat_softc.ha_dev = NULL;
diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c
index 47c12a51bdad..42ff038f6645 100644
--- a/sys/dev/dpt/dpt_scsi.c
+++ b/sys/dev/dpt/dpt_scsi.c
@@ -43,7 +43,7 @@
* arrays that span controllers (Wow!).
*/
-#ident "$Id: dpt_scsi.c,v 1.21 1998/12/22 00:52:27 eivind Exp $"
+#ident "$Id: dpt_scsi.c,v 1.19 1998/10/15 23:17:56 gibbs Exp $"
#define _DPT_C_
@@ -300,12 +300,11 @@ dptallocsgmap(struct dpt_softc *dpt)
return (NULL);
}
- (void)bus_dmamap_load(dpt->sg_dmat, sg_map->sg_dmamap, sg_map->sg_vaddr,
- PAGE_SIZE, dptmapmem, &sg_map->sg_physaddr,
- /*flags*/0);
-
SLIST_INSERT_HEAD(&dpt->sg_maps, sg_map, links);
+ bus_dmamap_load(dpt->sg_dmat, sg_map->sg_dmamap, sg_map->sg_vaddr,
+ PAGE_SIZE, dptmapmem, &sg_map->sg_physaddr, /*flags*/0);
+
return (sg_map);
}
@@ -1129,7 +1128,7 @@ dpt_free(struct dpt_softc *dpt)
free(dpt, M_DEVBUF);
}
-static u_int8_t string_sizes[] =
+u_int8_t string_sizes[] =
{
sizeof(((dpt_inq_t*)NULL)->vendor),
sizeof(((dpt_inq_t*)NULL)->modelNum),
@@ -1148,9 +1147,6 @@ dpt_init(struct dpt_softc *dpt)
int i;
int retval;
- dpt->init_level = 0;
- SLIST_INIT(&dpt->sg_maps);
-
#ifdef DPT_RESET_BOARD
printf("dpt%d: resetting HBA\n", dpt->unit);
dpt_outb(dpt, HA_WCOMMAND, EATA_CMD_RESET);
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 44a465927ca4..2e22fd1db329 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1278,8 +1278,8 @@ caddr_t data;
break;
if ((shadow = pvc_attach(ifp)) != NULL) {
- snprintf(ifr->ifr_name, sizeof(ifr->ifr_name),
- "%s%d", shadow->if_name, shadow->if_unit);
+ sprintf(ifr->ifr_name, "%s%d",
+ shadow->if_name, shadow->if_unit);
}
else
error = ENOBUFS;
@@ -3643,8 +3643,8 @@ static int en_pvctx(sc, pvcreq)
pvcreq->pvc_ifname);
return (EINVAL);
}
- snprintf(pvcreq->pvc_ifname, sizeof(pvcreq->pvc_ifname),
- "%s%d", sc->enif.if_name, sc->enif.if_unit);
+ sprintf(pvcreq->pvc_ifname, "%s%d",
+ sc->enif.if_name, sc->enif.if_unit);
ATM_PH_FLAGS(&api.aph) = ATM_PH_PVCSIF |
(ATM_PH_FLAGS(pvc_aph) & (ATM_PH_AAL5|ATM_PH_LLCSNAP));
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c
deleted file mode 100644
index 99d15f852a37..000000000000
--- a/sys/dev/fb/fb.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
- *
- * $Id: fb.c,v 1.2 1999/01/12 10:35:50 yokota Exp $
- */
-
-#include "fb.h"
-#include "opt_fb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-
-/* local arrays */
-
-/*
- * We need at least one entry each in order to initialize a video card
- * for the kernel console. The arrays will be increased dynamically
- * when necessary.
- */
-
-static int adapters = 1;
-static video_adapter_t *adp_ini;
-static video_adapter_t **adapter = &adp_ini;
-static video_switch_t *vidsw_ini;
- video_switch_t **vidsw = &vidsw_ini;
-
-#ifdef FB_INSTALL_CDEV
-
-#define ARRAY_DELTA 4
-
-static struct cdevsw *vidcdevsw_ini;
-static struct cdevsw **vidcdevsw = &vidcdevsw_ini;
-
-static void
-vid_realloc_array(void)
-{
- video_adapter_t **new_adp;
- video_switch_t **new_vidsw;
- struct cdevsw **new_cdevsw;
- int newsize;
- int s;
-
- s = spltty();
- newsize = ((adapters + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA;
- new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_WAITOK);
- new_vidsw = malloc(sizeof(*new_vidsw)*newsize, M_DEVBUF, M_WAITOK);
- new_cdevsw = malloc(sizeof(*new_cdevsw)*newsize, M_DEVBUF, M_WAITOK);
- bzero(new_adp, sizeof(*new_adp)*newsize);
- bzero(new_vidsw, sizeof(*new_vidsw)*newsize);
- bzero(new_cdevsw, sizeof(*new_cdevsw)*newsize);
- bcopy(adapter, new_adp, sizeof(*adapter)*adapters);
- bcopy(vidsw, new_vidsw, sizeof(*vidsw)*adapters);
- bcopy(vidcdevsw, new_cdevsw, sizeof(*vidcdevsw)*adapters);
- if (adapters > 1) {
- free(adapter, M_DEVBUF);
- free(vidsw, M_DEVBUF);
- free(vidcdevsw, M_DEVBUF);
- }
- adapter = new_adp;
- vidsw = new_vidsw;
- vidcdevsw = new_cdevsw;
- adapters = newsize;
- splx(s);
-
- if (bootverbose)
- printf("fb: new array size %d\n", adapters);
-}
-
-#endif /* FB_INSTALL_CDEV */
-
-/*
- * Low-level frame buffer driver functions
- * frame buffer subdrivers, such as the VGA driver, call these functions
- * to initialize the video_adapter structure and register it to the virtual
- * frame buffer driver `fb'.
- */
-
-/* initialize the video_adapter_t structure */
-void
-vid_init_struct(video_adapter_t *adp, char *name, int type, int unit)
-{
- adp->va_flags = 0;
- adp->va_name = name;
- adp->va_type = type;
- adp->va_unit = unit;
-}
-
-/* Register a video adapter */
-int
-vid_register(video_adapter_t *adp)
-{
- video_driver_t **list;
- video_driver_t *p;
- int index;
-
- for (index = 0; index < adapters; ++index) {
- if (adapter[index] == NULL)
- break;
- }
- if (index >= adapters)
- return -1;
-
- adp->va_index = index;
- adp->va_token = NULL;
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, adp->va_name) == 0) {
- adapter[index] = adp;
- vidsw[index] = p->vidsw;
- return index;
- }
- }
-
- return -1;
-}
-
-int
-vid_unregister(video_adapter_t *adp)
-{
- if ((adp->va_index < 0) || (adp->va_index >= adapters))
- return ENOENT;
- if (adapter[adp->va_index] != adp)
- return ENOENT;
-
- adapter[adp->va_index] = NULL;
- vidsw[adp->va_index] = NULL;
- return 0;
-}
-
-/* Get video I/O function table */
-video_switch_t
-*vid_get_switch(char *name)
-{
- video_driver_t **list;
- video_driver_t *p;
-
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, name) == 0)
- return p->vidsw;
- }
-
- return NULL;
-}
-
-/*
- * Video card client functions
- * Video card clients, such as the console driver `syscons' and the frame
- * buffer cdev driver, use these functions to claim and release a card for
- * exclusive use.
- */
-
-/* find the video card specified by a driver name and a unit number */
-int
-vid_find_adapter(char *driver, int unit)
-{
- int i;
-
- for (i = 0; i < adapters; ++i) {
- if (adapter[i] == NULL)
- continue;
- if (strcmp("*", driver) && strcmp(adapter[i]->va_name, driver))
- continue;
- if ((unit != -1) && (adapter[i]->va_unit != unit))
- continue;
- return i;
- }
- return -1;
-}
-
-/* allocate a video card */
-int
-vid_allocate(char *driver, int unit, void *id)
-{
- int index;
- int s;
-
- s = spltty();
- index = vid_find_adapter(driver, unit);
- if (index >= 0) {
- if (adapter[index]->va_token) {
- splx(s);
- return -1;
- }
- adapter[index]->va_token = id;
- }
- splx(s);
- return index;
-}
-
-int
-vid_release(video_adapter_t *adp, void *id)
-{
- int error;
- int s;
-
- s = spltty();
- if (adp->va_token == NULL) {
- error = EINVAL;
- } else if (adp->va_token != id) {
- error = EPERM;
- } else {
- adp->va_token = NULL;
- error = 0;
- }
- splx(s);
- return error;
-}
-
-/* Get a video adapter structure */
-video_adapter_t
-*vid_get_adapter(int index)
-{
- if ((index < 0) || (index >= adapters))
- return NULL;
- return adapter[index];
-}
-
-/* Configure drivers: this is a backdoor for the console driver XXX */
-int
-vid_configure(int flags)
-{
- video_driver_t **list;
- video_driver_t *p;
-
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (p->configure != NULL)
- (*p->configure)(flags);
- }
-
- return 0;
-}
-
-/*
- * Virtual frame buffer cdev driver functions
- * The virtual frame buffer driver dispatches driver functions to
- * appropriate subdrivers.
- */
-
-#define DRIVER_NAME "fb"
-
-#ifdef FB_INSTALL_CDEV
-
-#define FB_UNIT(dev) minor(dev)
-#define FB_MKMINOR(unit) (u)
-
-#if notyet
-
-static d_open_t fbopen;
-static d_close_t fbclose;
-static d_ioctl_t fbioctl;
-static d_mmap_t fbmmap;
-
-#define CDEV_MAJOR 141 /* XXX */
-
-static struct cdevsw fb_cdevsw = {
- fbopen, fbclose, noread, nowrite, /* ??? */
- fbioctl, nostop, nullreset, nodevtotty,
- seltrue, fbmmap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-static void
-vfbattach(void *arg)
-{
- static int fb_devsw_installed = FALSE;
- dev_t dev;
-
- if (!fb_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &fb_cdevsw, NULL);
- fb_devsw_installed = TRUE;
- }
-}
-
-PSEUDO_SET(vfbattach, fb);
-
-#endif /* notyet */
-
-int
-fb_attach(dev_t dev, video_adapter *adp, struct cdevsw *cdevsw)
-{
- int s;
-
- if (adp->va_index >= adapters)
- return EINVAL;
- if (adapter[adp->va_index] != adp)
- return EINVAL;
-
- s = spltty();
- adp->va_minor = minor(dev);
- vidcdevsw[adp->va_index] = cdevsw;
- splx(s);
-
- /* XXX: DEVFS? */
-
- if (adp->va_index + 1 >= adapters)
- vid_realloc_array();
-
- printf("fb%d at %s%d\n", adp->va_index, adp->va_name, adp->va_unit);
- return 0;
-}
-
-int
-fb_detach(dev_t dev, video_adapter *adp, struct cdevsw *cdevsw)
-{
- int s;
-
- if (adp->va_index >= adapters)
- return EINVAL;
- if (adapter[adp->va_index] != adp)
- return EINVAL;
- if (vidcdevsw[adp->va_index] != cdevsw)
- return EINVAL;
-
- s = spltty();
- vidcdevsw[adp->va_index] = NULL;
- splx(s);
- return 0;
-}
-
-#endif /* FB_INSTALL_CDEV */
-
-static char
-*adapter_name(int type)
-{
- static struct {
- int type;
- char *name;
- } names[] = {
- { KD_MONO, "MDA" },
- { KD_HERCULES, "Hercules" },
- { KD_CGA, "CGA" },
- { KD_EGA, "EGA" },
- { KD_VGA, "VGA" },
- { KD_PC98, "PC-98x1" },
- { -1, "Unknown" },
- };
- int i;
-
- for (i = 0; names[i].type != -1; ++i)
- if (names[i].type == type)
- break;
- return names[i].name;
-}
-
-void
-fb_dump_adp_info(char *driver, video_adapter_t *adp, int level)
-{
- if (level <= 0)
- return;
-
- printf("%s%d: %s%d, %s, type:%s (%d), flags:0x%x\n",
- DRIVER_NAME, adp->va_index, driver, adp->va_unit, adp->va_name,
- adapter_name(adp->va_type), adp->va_type, adp->va_flags);
- printf("%s%d: port:0x%x-0x%x, crtc:0x%x, mem:0x%x 0x%x\n",
- DRIVER_NAME, adp->va_index,
- adp->va_io_base, adp->va_io_base + adp->va_io_size - 1,
- adp->va_crtc_addr, adp->va_mem_base, adp->va_mem_size);
- printf("%s%d: init mode:%d, bios mode:%d, current mode:%d\n",
- DRIVER_NAME, adp->va_index,
- adp->va_initial_mode, adp->va_initial_bios_mode, adp->va_mode);
- printf("%s%d: window:0x%x size:%dk gran:%dk, buf:0x%x size:%dk\n",
- DRIVER_NAME, adp->va_index,
- adp->va_window, (int)adp->va_window_size/1024,
- (int)adp->va_window_gran/1024, adp->va_buffer,
- (int)adp->va_buffer_size/1024);
-}
-
-void
-fb_dump_mode_info(char *driver, video_adapter_t *adp, video_info_t *info,
- int level)
-{
- if (level <= 0)
- return;
-
- printf("%s%d: %s, mode:%d, flags:0x%x ",
- driver, adp->va_unit, adp->va_name, info->vi_mode, info->vi_flags);
- if (info->vi_flags & V_INFO_GRAPHICS)
- printf("G %dx%dx%d, %d plane(s), font:%dx%d, ",
- info->vi_width, info->vi_height,
- info->vi_depth, info->vi_planes,
- info->vi_cwidth, info->vi_cheight);
- else
- printf("T %dx%d, font:%dx%d, ",
- info->vi_width, info->vi_height,
- info->vi_cwidth, info->vi_cheight);
- printf("win:0x%x\n", info->vi_window);
-}
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
deleted file mode 100644
index 46f0343d0edd..000000000000
--- a/sys/dev/fb/fbreg.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: fbreg.h,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#ifndef _DEV_FB_FBREG_H_
-#define _DEV_FB_FBREG_H_
-
-#ifdef KERNEL
-
-#define V_MAX_ADAPTERS 8 /* XXX */
-
-/* some macros */
-#ifdef __i386__
-#define bcopy_toio(s, d, c) generic_bcopy((void *)(s), (void *)(d), c)
-#define bcopy_fromio(s, d, c) generic_bcopy((void *)(s), (void *)(d), c)
-#define bzero_io(d, c) generic_bzero((void *)(d), c)
-void generic_bcopy(const void *s, void *d, size_t c);
-void generic_bzero(void *d, size_t c);
-#else /* !__i386__ */
-#define bcopy_toio(s, d, c) memcpy_toio(d, s, c)
-#define bcopy_fromio(s, d, c) memcpy_fromio(d, s, c)
-#define bzero_io(d, c) memset_io(d, 0, c)
-#endif /* !__i386__ */
-
-/* video function table */
-typedef int vi_probe_t(int unit, video_adapter_t **adpp, void *arg, int flags);
-typedef int vi_init_t(int unit, video_adapter_t *adp, int flags);
-typedef int vi_get_info_t(video_adapter_t *adp, int mode, video_info_t *info);
-typedef int vi_query_mode_t(video_adapter_t *adp, video_info_t *info);
-typedef int vi_set_mode_t(video_adapter_t *adp, int mode);
-typedef int vi_save_font_t(video_adapter_t *adp, int page, int size,
- u_char *data, int c, int count);
-typedef int vi_load_font_t(video_adapter_t *adp, int page, int size,
- u_char *data, int c, int count);
-typedef int vi_show_font_t(video_adapter_t *adp, int page);
-typedef int vi_save_palette_t(video_adapter_t *adp, u_char *palette);
-typedef int vi_load_palette_t(video_adapter_t *adp, u_char *palette);
-typedef int vi_set_border_t(video_adapter_t *adp, int border);
-typedef int vi_save_state_t(video_adapter_t *adp, void *p, size_t size);
-typedef int vi_load_state_t(video_adapter_t *adp, void *p);
-typedef int vi_set_win_org_t(video_adapter_t *adp, off_t offset);
-typedef int vi_read_hw_cursor_t(video_adapter_t *adp, int *col, int *row);
-typedef int vi_set_hw_cursor_t(video_adapter_t *adp, int col, int row);
-typedef int vi_set_hw_cursor_shape_t(video_adapter_t *adp, int base,
- int height, int celsize, int blink);
-typedef int vi_blank_display_t(video_adapter_t *adp, int mode);
-#define V_DISPLAY_POWER_ON 0
-#define V_DISPLAY_SUSPEND 1
-#define V_DISPLAY_SUSPEND1 1
-#define V_DISPLAY_SUSPEND2 2
-#define V_DISPLAY_POWER_OFF 3
-typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset);
-typedef int vi_diag_t(video_adapter_t *adp, int level);
-
-typedef struct video_switch {
- vi_probe_t *probe;
- vi_init_t *init;
- vi_get_info_t *get_info;
- vi_query_mode_t *query_mode;
- vi_set_mode_t *set_mode;
- vi_save_font_t *save_font;
- vi_load_font_t *load_font;
- vi_show_font_t *show_font;
- vi_save_palette_t *save_palette;
- vi_load_palette_t *load_palette;
- vi_set_border_t *set_border;
- vi_save_state_t *save_state;
- vi_load_state_t *load_state;
- vi_set_win_org_t *set_win_org;
- vi_read_hw_cursor_t *read_hw_cursor;
- vi_set_hw_cursor_t *set_hw_cursor;
- vi_set_hw_cursor_shape_t *set_hw_cursor_shape;
- vi_blank_display_t *blank_display;
- vi_mmap_t *mmap;
- vi_diag_t *diag;
-} video_switch_t;
-
-/* video driver */
-typedef struct video_driver {
- char *name;
- video_switch_t *vidsw;
- int (*configure)(int); /* backdoor for the console driver */
-} video_driver_t;
-
-#define VIDEO_DRIVER(name, sw, config) \
- static struct video_driver name##_driver = { \
- #name, &sw, config \
- }; \
- DATA_SET(videodriver_set, name##_driver);
-
-/* global variables */
-extern struct video_switch **vidsw;
-extern struct linker_set videodriver_set;
-
-/* functions for the video card driver */
-int vid_register(video_adapter_t *adp);
-int vid_unregister(video_adapter_t *adp);
-video_switch_t *vid_get_switch(char *name);
-void vid_init_struct(video_adapter_t *adp, char *name, int type,
- int unit);
-
-/* functions for the video card client */
-int vid_allocate(char *driver, int unit, void *id);
-int vid_release(video_adapter_t *adp, void *id);
-int vid_find_adapter(char *driver, int unit);
-video_adapter_t *vid_get_adapter(int index);
-
-/* a backdoor for the console driver to tickle the video driver XXX */
-int vid_configure(int flags);
-#define VIO_PROBE_ONLY (1 << 0) /* probe only, don't initialize */
-
-#ifdef FB_INSTALL_CDEV
-
-/* virtual frame buffer driver functions */
-int fb_attach(dev_t dev, video_adapter_t *adp,
- struct cdevsw *cdevsw);
-int fb_detach(dev_t dev, video_adapter_t *adp,
- struct cdevsw *cdevsw);
-
-#endif /* FB_INSTALL_CDEV */
-
-/* generic low-level driver functions */
-
-void fb_dump_adp_info(char *driver, video_adapter_t *adp, int level);
-void fb_dump_mode_info(char *driver, video_adapter_t *adp,
- video_info_t *info, int level);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_FB_FBREG_H_ */
diff --git a/sys/dev/fb/splash.c b/sys/dev/fb/splash.c
deleted file mode 100644
index 1f3281e361a3..000000000000
--- a/sys/dev/fb/splash.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: splash.c,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#include "splash.h"
-
-#if NSPLASH > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/linker.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
-/* video adapter and image decoder */
-static video_adapter_t *splash_adp;
-static splash_decoder_t *splash_decoder;
-
-/* decoder candidates */
-static int decoders;
-static splash_decoder_t **decoder_set;
-#define DECODER_ARRAY_DELTA 4
-
-/* console driver callback */
-static int (*splash_callback)(int);
-
-static int
-splash_find_data(splash_decoder_t *decoder)
-{
- caddr_t image_module;
- caddr_t p;
-
- if (decoder->data_type == NULL)
- return 0;
- image_module = preload_search_by_type(decoder->data_type);
- if (image_module == NULL)
- return ENOENT;
- p = preload_search_info(image_module, MODINFO_ADDR);
- if (p == NULL)
- return ENOENT;
- decoder->data = *(void **)p;
- p = preload_search_info(image_module, MODINFO_SIZE);
- if (p == NULL)
- return ENOENT;
- decoder->data_size = *(size_t *)p;
- if (bootverbose)
- printf("splash: image@%p, size:%u\n",
- decoder->data, decoder->data_size);
- return 0;
-}
-
-static int
-splash_test(splash_decoder_t *decoder)
-{
- if (splash_find_data(decoder))
- return ENOENT; /* XXX */
- if ((*decoder->init)(splash_adp)) {
- decoder->data = NULL;
- decoder->data_size = 0;
- return ENODEV; /* XXX */
- }
- if (bootverbose)
- printf("splash: image decoder found: %s\n", decoder->name);
- return 0;
-}
-
-static void
-splash_new(splash_decoder_t *decoder)
-{
- splash_decoder = decoder;
- if (splash_callback != NULL)
- (*splash_callback)(SPLASH_INIT);
-}
-
-int
-splash_register(splash_decoder_t *decoder)
-{
- splash_decoder_t **p;
- int error;
- int i;
-
- if (splash_adp != NULL) {
- /*
- * If the video card has aleady been initialized, test
- * this decoder immediately.
- */
- error = splash_test(decoder);
- if (error == 0) {
- /* replace the current decoder with new one */
- if (splash_decoder != NULL)
- error = splash_term(splash_adp);
- if (error == 0)
- splash_new(decoder);
- }
- return error;
- } else {
- /* register the decoder for later use */
- for (i = 0; i < decoders; ++i) {
- if (decoder_set[i] == NULL)
- break;
- }
- if ((i >= decoders) && (decoders % DECODER_ARRAY_DELTA) == 0) {
- p = malloc(sizeof(*p)*(decoders + DECODER_ARRAY_DELTA),
- M_DEVBUF, M_NOWAIT);
- if (p == NULL)
- return ENOMEM;
- if (decoder_set != NULL)
- bcopy(decoder_set, p, sizeof(*p)*decoders);
- free(decoder_set, M_DEVBUF);
- decoder_set = p;
- i = decoders++;
- }
- decoder_set[i] = decoder;
- }
-
- return 0;
-}
-
-int
-splash_unregister(splash_decoder_t *decoder)
-{
- int error;
-
- if (splash_decoder == decoder) {
- if ((error = splash_term(splash_adp)) != 0)
- return error;
- }
- return 0;
-}
-
-int
-splash_init(video_adapter_t *adp, int (*callback)(int))
-{
- int i;
-
- splash_adp = adp;
- splash_callback = callback;
-
- splash_decoder = NULL;
- for (i = 0; i < decoders; ++i) {
- if (decoder_set[i] == NULL)
- continue;
- if (splash_test(decoder_set[i]) == 0) {
- splash_new(decoder_set[i]);
- break;
- }
- decoder_set[i] = NULL;
- }
- for (++i; i < decoders; ++i) {
- decoder_set[i] = NULL;
- }
- return 0;
-}
-
-int
-splash_term(video_adapter_t *adp)
-{
- int error = 0;
-
- if (splash_decoder != NULL) {
- if (splash_callback != NULL)
- error = (*splash_callback)(SPLASH_TERM);
- if (error == 0)
- error = (*splash_decoder->term)(adp);
- if (error == 0)
- splash_decoder = NULL;
- }
- return error;
-}
-
-int
-splash(video_adapter_t *adp, int on)
-{
- if (splash_decoder != NULL)
- return (*splash_decoder->splash)(adp, on);
- return ENODEV;
-}
-
-#endif /* NSPLASH > 0 */
diff --git a/sys/dev/fb/splashreg.h b/sys/dev/fb/splashreg.h
deleted file mode 100644
index fb785346202d..000000000000
--- a/sys/dev/fb/splashreg.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: splashreg.h,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#ifndef _DEV_FB_SPLASHREG_H_
-#define _DEV_FB_SPLASHREG_H_
-
-#define SPLASH_IMAGE "splash_image_data"
-
-struct video_adapter;
-
-struct image_decoder {
- char *name;
- int (*init)(struct video_adapter *adp);
- int (*term)(struct video_adapter *adp);
- int (*splash)(struct video_adapter *adp, int on);
- char *data_type;
- void *data;
- size_t data_size;
-};
-
-typedef struct image_decoder splash_decoder_t;
-typedef struct image_decoder scrn_saver_t;
-
-#define SPLASH_DECODER(name, sw) \
- static int name##_modevent(module_t mod, int type, void *data) \
- { \
- switch ((modeventtype_t)type) { \
- case MOD_LOAD: \
- return splash_register(&sw); \
- case MOD_UNLOAD: \
- return splash_unregister(&sw); \
- default: \
- break; \
- } \
- return 0; \
- } \
- static moduledata_t name##_mod = { \
- #name, \
- name##_modevent, \
- NULL \
- }; \
- DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
-
-#define SAVER_MODULE(name, sw) \
- static int name##_modevent(module_t mod, int type, void *data) \
- { \
- switch ((modeventtype_t)type) { \
- case MOD_LOAD: \
- return splash_register(&sw); \
- case MOD_UNLOAD: \
- return splash_unregister(&sw); \
- default: \
- break; \
- } \
- return 0; \
- } \
- static moduledata_t name##_mod = { \
- #name, \
- name##_modevent, \
- NULL \
- }; \
- DECLARE_MODULE(name, name##_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE)
-
-/* entry point for the splash image decoder */
-int splash_register(splash_decoder_t *decoder);
-int splash_unregister(splash_decoder_t *decoder);
-
-/* entry points for the console driver */
-int splash_init(video_adapter_t *adp, int (*callback)(int));
-int splash_term(video_adapter_t *adp);
-int splash(video_adapter_t *adp, int on);
-
-/* event types for the callback function */
-#define SPLASH_INIT 0
-#define SPLASH_TERM 1
-
-#endif /* _DEV_FB_SPLASHREG_H_ */
diff --git a/sys/dev/fb/vgareg.h b/sys/dev/fb/vgareg.h
deleted file mode 100644
index 841408e89879..000000000000
--- a/sys/dev/fb/vgareg.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id:$
- */
-
-#ifndef _DEV_FB_VGAREG_H_
-#define _DEV_FB_VGAREG_H_
-
-/* physical addresses */
-#define MDA_BUF_BASE 0xb0000
-#define MDA_BUF_SIZE 0x08000
-#define MDA_BUF BIOS_PADDRTOVADDR(MDA_BUF_BASE)
-#define CGA_BUF_BASE 0xb8000
-#define CGA_BUF_SIZE 0x08000
-#define CGA_BUF BIOS_PADDRTOVADDR(CGA_BUF_BASE)
-#define EGA_BUF_BASE 0xa0000
-#define EGA_BUF_SIZE 0x20000
-#define EGA_BUF BIOS_PADDRTOVADDR(EGA_BUF_BASE)
-#define GRAPHICS_BUF_BASE 0xa0000
-#define GRAPHICS_BUF_SIZE 0x10000
-#define GRAPHICS_BUF BIOS_PADDRTOVADDR(GRAPHICS_BUF_BASE)
-#define FONT_BUF BIOS_PADDRTOVADDR(GRAPHICS_BUF_BASE)
-#define VIDEO_BUF_BASE 0xa0000
-#define VIDEO_BUF_SIZE 0x20000
-
-/* I/O port addresses */
-#define MONO_CRTC (IO_MDA + 0x04) /* crt controller base mono */
-#define COLOR_CRTC (IO_CGA + 0x04) /* crt controller base color */
-#define MISC (IO_VGA + 0x02) /* misc output register */
-#define ATC (IO_VGA + 0x00) /* attribute controller */
-#define TSIDX (IO_VGA + 0x04) /* timing sequencer idx */
-#define TSREG (IO_VGA + 0x05) /* timing sequencer data */
-#define PIXMASK (IO_VGA + 0x06) /* pixel write mask */
-#define PALRADR (IO_VGA + 0x07) /* palette read address */
-#define PALWADR (IO_VGA + 0x08) /* palette write address */
-#define PALDATA (IO_VGA + 0x09) /* palette data register */
-#define GDCIDX (IO_VGA + 0x0E) /* graph data controller idx */
-#define GDCREG (IO_VGA + 0x0F) /* graph data controller data */
-
-#ifdef KERNEL
-extern int (*vga_sub_configure)(int flags);
-#endif
-
-#endif /* _DEV_FB_VGAREG_H_ */
diff --git a/sys/dev/hea/eni.c b/sys/dev/hea/eni.c
index 8c3e0604c1ac..977ed9bf2060 100644
--- a/sys/dev/hea/eni.c
+++ b/sys/dev/hea/eni.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni.c,v 1.4 1998/12/04 22:54:45 archie Exp $
+ * @(#) $Id: eni.c,v 1.1 1998/09/15 08:22:52 phk Exp $
*
*/
@@ -35,20 +35,20 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni.c,v 1.1 1998/09/15 08:22:52 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni.c,v 1.4 1998/12/04 22:54:45 archie Exp $");
-#endif
-
/*
* Typedef local functions
*/
-static const char *eni_pci_probe __P((pcici_t, pcidi_t));
+static char *eni_pci_probe __P((pcici_t, pcidi_t));
static void eni_pci_attach __P((pcici_t, int));
static int eni_get_ack __P((Eni_unit *));
static int eni_get_sebyte __P((Eni_unit *));
@@ -98,7 +98,7 @@ DATA_SET ( pcidevice_set, eni_pci_device );
* NULL unrecognized vendor/device
*
*/
-static const char *
+static char *
eni_pci_probe ( pcici_t config_id, pcidi_t device_id )
{
@@ -496,12 +496,10 @@ eni_pci_attach ( pcici_t config_id, int unit )
* Make a hw version number from the ID register values.
* Format: {Midway ID}.{Mother board ID}.{Daughter board ID}
*/
- snprintf ( eup->eu_config.ac_hard_vers,
- sizeof ( eup->eu_config.ac_hard_vers ),
- "%ld/%ld/%ld",
- (val >> ID_SHIFT) & ID_MASK,
+ sprintf ( eup->eu_config.ac_hard_vers, "%ld/%ld/%ld",
+ (val >> ID_SHIFT) & ID_MASK,
(val >> MID_SHIFT) & MID_MASK,
- (val >> DID_SHIFT) & DID_MASK );
+ (val >> DID_SHIFT) & DID_MASK );
/*
* There is no software version number
diff --git a/sys/dev/hea/eni_buffer.c b/sys/dev/hea/eni_buffer.c
index 71d2eb9128ca..35d1b13ae4f8 100644
--- a/sys/dev/hea/eni_buffer.c
+++ b/sys/dev/hea/eni_buffer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_buffer.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_buffer.c,v 1.8 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_buffer.c,v 1.8 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_buffer.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
static int eni_test_memory __P((Eni_unit *));
/*
diff --git a/sys/dev/hea/eni_globals.c b/sys/dev/hea/eni_globals.c
index 71253e27a823..a2a51fa83409 100644
--- a/sys/dev/hea/eni_globals.c
+++ b/sys/dev/hea/eni_globals.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_globals.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_globals.c,v 1.2 1997/05/06 22:07:52 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_globals.c,v 1.2 1997/05/06 22:07:52 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_globals.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
/*
* Device unit table
*/
diff --git a/sys/dev/hea/eni_if.c b/sys/dev/hea/eni_if.c
index 49f5e09516cd..41ffd485b3f1 100644
--- a/sys/dev/hea/eni_if.c
+++ b/sys/dev/hea/eni_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_if.c,v 1.2 1998/10/31 20:06:45 phk Exp $
+ * @(#) $Id: eni_if.c,v 1.6 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_if.c,v 1.6 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
@@ -42,10 +46,6 @@
#include <dev/hea/eni_suni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_if.c,v 1.2 1998/10/31 20:06:45 phk Exp $");
-#endif
-
static void eni_get_stats __P((Eni_unit *));
/*
@@ -194,8 +194,7 @@ eni_atm_ioctl ( code, data, arg )
*/
if ( eup == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response structure onto user's buffer
diff --git a/sys/dev/hea/eni_init.c b/sys/dev/hea/eni_init.c
index 5706c65adb32..d8106ab0e763 100644
--- a/sys/dev/hea/eni_init.c
+++ b/sys/dev/hea/eni_init.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_init.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_init.c,v 1.6 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_init.c,v 1.6 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_init.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
/*
* Initialize adapter for PDU processing
*
diff --git a/sys/dev/hea/eni_intr.c b/sys/dev/hea/eni_intr.c
index ccc0d6bbc547..44a6790eb88d 100644
--- a/sys/dev/hea/eni_intr.c
+++ b/sys/dev/hea/eni_intr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_intr.c,v 1.2 1998/09/17 09:34:58 phk Exp $
+ * @(#) $Id: eni_intr.c,v 1.1 1998/09/15 08:22:53 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_intr.c,v 1.1 1998/09/15 08:22:53 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
@@ -42,10 +46,6 @@
#include <dev/hea/eni_suni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_intr.c,v 1.2 1998/09/17 09:34:58 phk Exp $");
-#endif
-
static void eni_suni_intr __P((Eni_unit *));
/*
diff --git a/sys/dev/hea/eni_receive.c b/sys/dev/hea/eni_receive.c
index 8e8be36d6577..94ce8c48a221 100644
--- a/sys/dev/hea/eni_receive.c
+++ b/sys/dev/hea/eni_receive.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_receive.c,v 1.2 1998/09/17 09:34:58 phk Exp $
+ * @(#) $Id: eni_receive.c,v 1.1 1998/09/15 08:22:53 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_receive.c,v 1.1 1998/09/15 08:22:53 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_receive.c,v 1.2 1998/09/17 09:34:58 phk Exp $");
-#endif
-
static void eni_recv_stack __P((void *, KBuffer *));
#ifdef DIAGNOSTIC
diff --git a/sys/dev/hea/eni_transmit.c b/sys/dev/hea/eni_transmit.c
index 2721709a8fd6..25066dfb6060 100644
--- a/sys/dev/hea/eni_transmit.c
+++ b/sys/dev/hea/eni_transmit.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_transmit.c,v 1.2 1998/10/18 11:58:57 phk Exp $
+ * @(#) $Id: eni_transmit.c,v 1.20 1998/07/17 20:20:16 root Exp $
*
*/
@@ -36,16 +36,16 @@
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_transmit.c,v 1.20 1998/07/17 20:20:16 root Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_transmit.c,v 1.2 1998/10/18 11:58:57 phk Exp $");
-#endif
-
/*
* Make a variable which controls printing of PDUs
* as they travel through the driver.
@@ -467,7 +467,7 @@ retry:
/*
* Gotta slide the data up
*/
- eup->eu_stats.eni_st_drv.drv_xm_segnoal++;
+ eup->eu_stats.eni_st_drv.drv_xm_segnoal;
bfr = cp - align;
KM_COPY ( cp, bfr, KB_LEN ( m ) );
KB_HEADMOVE ( m, -align );
diff --git a/sys/dev/hea/eni_vcm.c b/sys/dev/hea/eni_vcm.c
index a88fc01bc67a..36c2a3dbcec5 100644
--- a/sys/dev/hea/eni_vcm.c
+++ b/sys/dev/hea/eni_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_vcm.c,v 1.1 1998/09/15 08:22:54 phk Exp $
+ * @(#) $Id: eni_vcm.c,v 1.8 1998/06/29 23:03:18 mks Exp $
*
*/
@@ -36,16 +36,16 @@
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_vcm.c,v 1.8 1998/06/29 23:03:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_vcm.c,v 1.1 1998/09/15 08:22:54 phk Exp $");
-#endif
-
/*
* VCC Stack Instantiation
diff --git a/sys/dev/hfa/fore_buffer.c b/sys/dev/hfa/fore_buffer.c
index 6952f01cc23d..d8bdce48c6d1 100644
--- a/sys/dev/hfa/fore_buffer.c
+++ b/sys/dev/hfa/fore_buffer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_buffer.c,v 1.1 1998/09/15 08:22:54 phk Exp $
+ * @(#) $Id: fore_buffer.c,v 1.6 1997/05/06 22:09:21 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_buffer.c,v 1.1 1998/09/15 08:22:54 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_buffer.c,v 1.6 1997/05/06 22:09:21 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_command.c b/sys/dev/hfa/fore_command.c
index d8e0e9d3cd2e..980be432deaa 100644
--- a/sys/dev/hfa/fore_command.c
+++ b/sys/dev/hfa/fore_command.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_command.c,v 1.3 1998/10/31 20:06:52 phk Exp $
+ * @(#) $Id: fore_command.c,v 1.1 1998/09/15 08:22:54 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_command.c,v 1.3 1998/10/31 20:06:52 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_command.c,v 1.1 1998/09/15 08:22:54 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local variables
*/
@@ -341,8 +341,7 @@ fore_cmd_drain(fup)
sizeof(struct mac_addr));
fup->fu_config.ac_macaddr =
fup->fu_pif.pif_macaddr;
- snprintf(fup->fu_config.ac_hard_vers,
- sizeof(fup->fu_config.ac_hard_vers),
+ sprintf(fup->fu_config.ac_hard_vers,
"%ld.%ld.%ld",
(fp->pr_hwver >> 16) & 0xff,
(fp->pr_hwver >> 8) & 0xff,
diff --git a/sys/dev/hfa/fore_globals.c b/sys/dev/hfa/fore_globals.c
index 5dc803a95417..4abc5fa437c3 100644
--- a/sys/dev/hfa/fore_globals.c
+++ b/sys/dev/hfa/fore_globals.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_globals.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_globals.c,v 1.6 1997/05/06 22:09:31 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_globals.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_globals.c,v 1.6 1997/05/06 22:09:31 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Supported device models
diff --git a/sys/dev/hfa/fore_if.c b/sys/dev/hfa/fore_if.c
index 479e7e672f81..7d3b3b6dff5f 100644
--- a/sys/dev/hfa/fore_if.c
+++ b/sys/dev/hfa/fore_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_if.c,v 1.2 1998/10/31 20:06:52 phk Exp $
+ * @(#) $Id: fore_if.c,v 1.6 1998/08/26 23:28:58 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_if.c,v 1.2 1998/10/31 20:06:52 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_if.c,v 1.6 1998/08/26 23:28:58 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Handle netatm core service interface ioctl requests
@@ -85,8 +85,7 @@ fore_atm_ioctl(code, data, arg)
fup = (Fore_unit *)pip;
if ( pip == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response structure onto user's buffer
diff --git a/sys/dev/hfa/fore_init.c b/sys/dev/hfa/fore_init.c
index 7c1ee96dd905..d82a8f8f7a1d 100644
--- a/sys/dev/hfa/fore_init.c
+++ b/sys/dev/hfa/fore_init.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_init.c,v 1.3 1998/10/31 20:06:53 phk Exp $
+ * @(#) $Id: fore_init.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_init.c,v 1.3 1998/10/31 20:06:53 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_init.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
@@ -122,8 +122,7 @@ fore_initialize(fup)
errmsg = "unsupported microcode version";
goto failed;
}
- snprintf(fup->fu_config.ac_firm_vers,
- sizeof(fup->fu_config.ac_firm_vers), "%ld.%ld.%ld",
+ sprintf(fup->fu_config.ac_firm_vers, "%ld.%ld.%ld",
(vers >> 16) & 0xff, (vers >> 8) & 0xff, vers & 0xff);
#ifdef notdef
diff --git a/sys/dev/hfa/fore_intr.c b/sys/dev/hfa/fore_intr.c
index 6fba5f224a7c..f295b6267e39 100644
--- a/sys/dev/hfa/fore_intr.c
+++ b/sys/dev/hfa/fore_intr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_intr.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_intr.c,v 1.7 1997/05/06 22:09:48 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_intr.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_intr.c,v 1.7 1997/05/06 22:09:48 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
#if defined(sun)
/*
* Polling interrupt routine
diff --git a/sys/dev/hfa/fore_load.c b/sys/dev/hfa/fore_load.c
index e41370efe5c3..251443d25247 100644
--- a/sys/dev/hfa/fore_load.c
+++ b/sys/dev/hfa/fore_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_load.c,v 1.4 1998/12/04 22:54:45 archie Exp $
+ * @(#) $Id: fore_load.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,26 +35,26 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_load.c,v 1.4 1998/12/04 22:54:45 archie Exp $");
+static char *RCSid = "@(#) $Id: fore_load.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
*/
static int fore_start __P((void));
-#ifdef sun
static int fore_stop __P((void));
static int fore_doload __P((void));
static int fore_dounload __P((void));
+#ifdef sun
static int fore_identify __P((char *));
static int fore_attach __P((struct devinfo *));
#endif
#ifdef __FreeBSD__
-static const char * fore_pci_probe __P((pcici_t, pcidi_t));
+static char * fore_pci_probe __P((pcici_t, pcidi_t));
static void fore_pci_attach __P((pcici_t, int));
#if BSD < 199506
static int fore_pci_shutdown __P((struct kern_devconf *, int));
@@ -156,8 +156,6 @@ fore_start()
}
-#ifdef sun
-
/*
* Halt driver processing
*
@@ -242,6 +240,8 @@ fore_stop()
return (0);
}
+
+#ifdef sun
/*
* Device identify routine
*
@@ -726,12 +726,10 @@ fore_attach(devinfo_p)
val = getprop ( devinfo_p->devi_nodeid, "hw-version", -1 );
}
if (val != -1) {
- snprintf(fcp->ac_hard_vers,
- sizeof(fcp->ac_hard_vers), "%d.%d.%d",
+ sprintf(fcp->ac_hard_vers, "%d.%d.%d",
(val >> 16) & 0xff, (val >> 8) & 0xff, val & 0xff);
} else
- snprintf(fcp->ac_hard_vers,
- sizeof(fcp->ac_hard_vers), "Unknown");
+ sprintf(fcp->ac_hard_vers, "Unknown");
val = getprop ( devinfo_p->devi_nodeid, "serialnumber", -1 );
if ( val != -1 )
@@ -844,7 +842,7 @@ fore_attach(devinfo_p)
* NULL device not claimed by this driver
*
*/
-static const char *
+static char *
fore_pci_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1145,8 +1143,8 @@ fore_unattach(fup)
struct dev_info *devinfo_p = fup->fu_devinfo;
struct dev_reg *dev_reg_p;
struct dev_intr *dev_intr_p;
- int i;
#endif
+ int i;
/*
@@ -1361,7 +1359,6 @@ fore_reset(fup)
*******************************************************************
*/
-#ifdef sun
/*
* Generic module load processing
*
@@ -1421,6 +1418,7 @@ fore_dounload()
}
+#ifdef sun
/*
* Loadable driver description
*/
diff --git a/sys/dev/hfa/fore_output.c b/sys/dev/hfa/fore_output.c
index d92d5a01ca48..59c82c939dc3 100644
--- a/sys/dev/hfa/fore_output.c
+++ b/sys/dev/hfa/fore_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_output.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_output.c,v 1.7 1998/02/19 20:10:34 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_output.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_output.c,v 1.7 1998/02/19 20:10:34 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_receive.c b/sys/dev/hfa/fore_receive.c
index 431a03f17cba..12dfcec0d69c 100644
--- a/sys/dev/hfa/fore_receive.c
+++ b/sys/dev/hfa/fore_receive.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_receive.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_receive.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_receive.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_receive.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_stats.c b/sys/dev/hfa/fore_stats.c
index c1a1fab14e81..c70b09879a7a 100644
--- a/sys/dev/hfa/fore_stats.c
+++ b/sys/dev/hfa/fore_stats.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_stats.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_stats.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_stats.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_stats.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Get device statistics from CP
diff --git a/sys/dev/hfa/fore_timer.c b/sys/dev/hfa/fore_timer.c
index 15cb02efbe65..e0d0c0ee0a39 100644
--- a/sys/dev/hfa/fore_timer.c
+++ b/sys/dev/hfa/fore_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_timer.c,v 1.1 1998/09/15 08:22:56 phk Exp $
+ * @(#) $Id: fore_timer.c,v 1.5 1997/05/06 22:10:24 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_timer.c,v 1.1 1998/09/15 08:22:56 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_timer.c,v 1.5 1997/05/06 22:10:24 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Process a Fore timer tick
diff --git a/sys/dev/hfa/fore_transmit.c b/sys/dev/hfa/fore_transmit.c
index bced06c25e67..744e7751c756 100644
--- a/sys/dev/hfa/fore_transmit.c
+++ b/sys/dev/hfa/fore_transmit.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_transmit.c,v 1.1 1998/09/15 08:22:56 phk Exp $
+ * @(#) $Id: fore_transmit.c,v 1.8 1998/07/17 20:19:37 root Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_transmit.c,v 1.1 1998/09/15 08:22:56 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_transmit.c,v 1.8 1998/07/17 20:19:37 root Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Allocate Transmit Queue Data Structures
diff --git a/sys/dev/hfa/fore_vcm.c b/sys/dev/hfa/fore_vcm.c
index 325883b31b6e..2481d17c20ba 100644
--- a/sys/dev/hfa/fore_vcm.c
+++ b/sys/dev/hfa/fore_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_vcm.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_vcm.c,v 1.1 1998/09/15 08:22:56 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_vcm.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_vcm.c,v 1.1 1998/09/15 08:22:56 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* VCC Stack Instantiation
diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c
index 7af9db71f632..52626e090443 100644
--- a/sys/dev/iicbus/if_ic.c
+++ b/sys/dev/iicbus/if_ic.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ic.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: if_ic.c,v 1.1.1.11 1998/08/13 17:10:42 son Exp $
*/
/*
@@ -213,7 +213,7 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return ENOBUFS;
}
- iicbus_reset(parent, IIC_FASTEST, 0, NULL);
+ iicbus_reset(parent, IIC_FASTEST);
ifp->if_flags |= IFF_RUNNING;
}
@@ -290,6 +290,7 @@ icintr (device_t dev, int event, char *ptr)
int unit = device_get_unit(dev);
int s, len;
struct mbuf *top;
+ int i;
s = splhigh();
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index e41d08b8a2b7..45d551b8f5de 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iic.c,v 1.5 1998/12/07 21:58:16 archie Exp $
+ * $Id: iic.c,v 1.2 1998/09/04 17:53:35 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -40,7 +40,6 @@
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
-
#include <machine/iic.h>
#include "iicbus_if.h"
@@ -118,6 +117,8 @@ iic_probe(device_t dev)
static int
iic_attach(device_t dev)
{
+ struct iic_softc *sc = (struct iic_softc *)device_get_softc(dev);
+
return (0);
}
@@ -210,16 +211,15 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
+ int error;
device_t parent = device_get_parent(iicdev);
- struct iiccmd *s = (struct iiccmd *)data;
- int error, count;
if (!sc)
return (EINVAL);
switch (cmd) {
case I2CSTART:
- error = iicbus_start(parent, s->slave, 0);
+ error = iicbus_start(parent, sc->sc_addr);
break;
case I2CSTOP:
@@ -227,15 +227,7 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
break;
case I2CRSTCARD:
- error = iicbus_reset(parent, 0, 0, NULL);
- break;
-
- case I2CWRITE:
- error = iicbus_write(parent, s->buf, s->count, &count, 0);
- break;
-
- case I2CREAD:
- error = iicbus_read(parent, s->buf, s->count, &count, s->last, 0);
+ error = iicbus_reset(parent, 0);
break;
default:
diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c
deleted file mode 100644
index 81629bcf2b09..000000000000
--- a/sys/dev/iicbus/iicbb.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu
- * 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.
- *
- * $Id: iicbb.c,v 1.1 1998/10/31 11:31:07 nsouch Exp $
- *
- */
-
-/*
- * Generic I2C bit-banging code
- *
- * Example:
- *
- * iicbus
- * / \
- * iicbb pcf
- * | \
- * bti2c lpbb
- *
- * From Linux I2C generic interface
- * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
- *
- * TODO: port Peter's generic bit-banging code <dufault@hda.com>
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include <dev/smbus/smbconf.h>
-
-#include "iicbus_if.h"
-#include "iicbb_if.h"
-
-struct iicbb_softc {
- int dummy;
-};
-
-static int iicbb_probe(device_t);
-static int iicbb_attach(device_t);
-static void iicbb_print_child(device_t, device_t);
-
-static int iicbb_callback(device_t, int, caddr_t);
-static int iicbb_start(device_t, u_char, int);
-static int iicbb_stop(device_t);
-static int iicbb_write(device_t, char *, int, int *, int);
-static int iicbb_read(device_t, char *, int, int *, int, int);
-static int iicbb_reset(device_t, u_char, u_char, u_char *);
-
-static device_method_t iicbb_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, iicbb_probe),
- DEVMETHOD(device_attach, iicbb_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, iicbb_print_child),
-
- /* iicbus interface */
- DEVMETHOD(iicbus_callback, iicbb_callback),
- DEVMETHOD(iicbus_start, iicbb_start),
- DEVMETHOD(iicbus_repeated_start, iicbb_start),
- DEVMETHOD(iicbus_stop, iicbb_stop),
- DEVMETHOD(iicbus_write, iicbb_write),
- DEVMETHOD(iicbus_read, iicbb_read),
- DEVMETHOD(iicbus_reset, iicbb_reset),
-
- { 0, 0 }
-};
-
-static driver_t iicbb_driver = {
- "iicbb",
- iicbb_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct iicbb_softc),
-};
-
-static devclass_t iicbb_devclass;
-
-static int iicbb_probe(device_t dev)
-{
- device_set_desc(dev, "I2C generic bit-banging driver");
-
- return (0);
-}
-
-static int iicbb_attach(device_t dev)
-{
- return (0);
-}
-
-static void
-iicbb_print_child(device_t bus, device_t dev)
-{
- int error;
- u_char oldaddr;
-
- /* retrieve the interface I2C address */
- error = IICBB_RESET(device_get_parent(bus), IIC_FASTEST, 0, &oldaddr);
- if (error == IIC_ENOADDR) {
- printf(" on %s%d master-only", device_get_name(bus),
- device_get_unit(bus));
-
- } else {
- /* restore the address */
- IICBB_RESET(device_get_parent(bus), IIC_FASTEST, oldaddr, NULL);
-
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), oldaddr & 0xff);
- }
-
- return;
-}
-
-#define I2C_SET(dev,ctrl,data) \
- IICBB_SETLINES(device_get_parent(dev), ctrl, data)
-
-#define I2C_GET(dev) (IICBB_GETDATALINE(device_get_parent(dev)))
-
-static int i2c_debug = 0;
-#define I2C_DEBUG(x) if (i2c_debug) (x)
-
-static void iicbb_one(device_t dev)
-{
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
- I2C_SET(dev,0,1);
- return;
-}
-
-static void iicbb_zero(device_t dev)
-{
- I2C_SET(dev,0,0);
- I2C_SET(dev,1,0);
- I2C_SET(dev,0,0);
- return;
-}
-
-/*
- * Waiting for ACKNOWLEDGE.
- *
- * When a chip is being addressed or has received data it will issue an
- * ACKNOWLEDGE pulse. Therefore the MASTER must release the DATA line
- * (set it to high level) and then release the CLOCK line.
- * Now it must wait for the SLAVE to pull the DATA line low.
- * Actually on the bus this looks like a START condition so nothing happens
- * because of the fact that the IC's that have not been addressed are doing
- * nothing.
- *
- * When the SLAVE has pulled this line low the MASTER will take the CLOCK
- * line low and then the SLAVE will release the SDA (data) line.
- */
-static int iicbb_ack(device_t dev, int timeout)
-{
- int noack;
- int k = timeout/10;
-
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
-
- do {
- noack = I2C_GET(dev);
- if (!noack)
- break;
- DELAY(10); /* XXX wait 10us */
- } while (k--);
-
- I2C_SET(dev,0,1);
- I2C_DEBUG(printf("%c ",noack?'-':'+'));
-
- return (noack);
-}
-
-static void iicbb_sendbyte(device_t dev, u_char data)
-{
- int i;
-
- I2C_SET(dev,0,0);
- for (i=7; i>=0; i--)
- (data&(1<<i)) ? iicbb_one(dev) : iicbb_zero(dev);
- I2C_DEBUG(printf("w%02x",(int)data));
- return;
-}
-
-static u_char iicbb_readbyte(device_t dev, int last)
-{
- int i;
- unsigned char data=0;
-
- I2C_SET(dev,0,1);
- for (i=7; i>=0; i--)
- {
- I2C_SET(dev,1,1);
- if (I2C_GET(dev))
- data |= (1<<i);
- I2C_SET(dev,0,1);
- }
- last ? iicbb_one(dev) : iicbb_zero(dev);
- I2C_DEBUG(printf("r%02x%c ",(int)data,last?'-':'+'));
- return data;
-}
-
-static int iicbb_callback(device_t dev, int index, caddr_t data)
-{
- return (IICBB_CALLBACK(device_get_parent(dev), index, data));
-}
-
-static int iicbb_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
-{
- return (IICBB_RESET(device_get_parent(dev), speed, addr, oldaddr));
-}
-
-static int iicbb_start(device_t dev, u_char slave, int timeout)
-{
- int error;
-
- I2C_DEBUG(printf("<"));
-
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
- I2C_SET(dev,1,0);
- I2C_SET(dev,0,0);
-
- /* send address */
- iicbb_sendbyte(dev, slave);
-
- /* check for ack */
- if (iicbb_ack(dev, timeout)) {
- error = IIC_ENOACK;
- goto error;
- }
-
- return(0);
-
-error:
- iicbb_stop(dev);
- return (error);
-}
-
-static int iicbb_stop(device_t dev)
-{
- I2C_SET(dev,0,0);
- I2C_SET(dev,1,0);
- I2C_SET(dev,1,1);
- I2C_DEBUG(printf(">"));
- return (0);
-}
-
-static int iicbb_write(device_t dev, char * buf, int len, int *sent,
- int timeout)
-{
- int bytes, error = 0;
-
- bytes = 0;
- while (len) {
- /* send byte */
- iicbb_sendbyte(dev,(u_char)*buf++);
-
- /* check for ack */
- if (iicbb_ack(dev, timeout)) {
- error = IIC_ENOACK;
- goto error;
- }
- bytes ++;
- len --;
- }
-
-error:
- *sent = bytes;
- return (error);
-}
-
-static int iicbb_read(device_t dev, char * buf, int len, int *read,
- int last, int delay)
-{
- int bytes;
-
- bytes = 0;
- while (len) {
- /* XXX should insert delay here */
- *buf++ = (char)iicbb_readbyte(dev, (len == 1) ? 1 : 0);
-
- bytes ++;
- len --;
- }
-
- *read = bytes;
- return (0);
-}
-
-DRIVER_MODULE(iicbb, bti2c, iicbb_driver, iicbb_devclass, 0, 0);
-DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbb_if.m b/sys/dev/iicbus/iicbb_if.m
deleted file mode 100644
index bdf1108fac95..000000000000
--- a/sys/dev/iicbus/iicbb_if.m
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (c) 1998 Nicolas Souchu
-# 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.
-#
-# $Id: iicbb_if.m,v 1.1 1998/10/31 11:31:07 nsouch Exp $
-#
-
-INTERFACE iicbb;
-
-#
-# iicbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
-# Set I2C bus lines
-#
-METHOD void setlines {
- device_t dev;
- int ctrl;
- int data;
-};
-
-#
-# Get I2C bus lines
-#
-#
-METHOD int getdataline {
- device_t dev;
-};
-
-#
-# Reset interface
-#
-METHOD int reset {
- device_t dev;
- u_char speed;
- u_char addr;
- u_char *oldaddr;
-};
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index cf9f6ba5ac26..41a0cea4f01c 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.c,v 1.6 1998/12/07 21:58:16 archie Exp $
+ * $Id: iicbus.c,v 1.1.2.7 1998/08/29 16:54:16 son Exp $
*
*/
@@ -54,7 +54,6 @@ struct iicbus_device {
int iicd_class; /* driver or slave device class */
const char *iicd_desc; /* device descriptor */
u_char iicd_addr; /* address of the device */
- int iicd_waitack; /* wait for ack timeout or delay */
int iicd_alive; /* 1 if device found */
};
@@ -62,10 +61,10 @@ struct iicbus_device {
* Common I2C addresses
*/
#define I2C_GENERAL_CALL 0x0
-#define PCF_MASTER_ADDRESS 0xaa
-#define FIRST_SLAVE_ADDR 0x2
+#define I2C_MASTER_ADDRESS 0xaa
+#define I2C_INET_ADDRESS 0xaa
-#define LAST_SLAVE_ADDR 255
+#define MAXSLAVE 256
#define IICBUS_UNKNOWN_CLASS 0
#define IICBUS_DEVICE_CLASS 1
@@ -73,15 +72,13 @@ struct iicbus_device {
/*
* list of known devices
- *
- * XXX only one smb driver should exist for each I2C interface
*/
struct iicbus_device iicbus_children[] = {
+ { "iic", IICBUS_DRIVER_CLASS, "General Call", I2C_GENERAL_CALL },
{ "iicsmb", IICBUS_DRIVER_CLASS, "I2C to SMB bridge" },
- { "iic", IICBUS_DRIVER_CLASS, "I2C general purpose I/O" },
-#if 0
- { "ic", IICBUS_DEVICE_CLASS, "network interface", PCF_MASTER_ADDRESS },
-#endif
+ { "iic", IICBUS_DEVICE_CLASS, "PCF8574 I2C to 8 bits parallel i/o", 64},
+ { "iic", IICBUS_DEVICE_CLASS, "PCF8584 as slave", I2C_MASTER_ADDRESS },
+ { "ic", IICBUS_DEVICE_CLASS, "network interface", I2C_INET_ADDRESS },
{ NULL, 0 }
};
@@ -94,7 +91,6 @@ static int iicbus_probe(device_t);
static int iicbus_attach(device_t);
static void iicbus_print_child(device_t, device_t);
static int iicbus_read_ivar(device_t , device_t, int, u_long *);
-static int iicbus_write_ivar(device_t , device_t, int, u_long);
static device_method_t iicbus_methods[] = {
/* device interface */
@@ -106,7 +102,9 @@ static device_method_t iicbus_methods[] = {
/* bus interface */
DEVMETHOD(bus_print_child, iicbus_print_child),
DEVMETHOD(bus_read_ivar, iicbus_read_ivar),
- DEVMETHOD(bus_write_ivar, iicbus_write_ivar),
+ DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -118,118 +116,59 @@ static driver_t iicbus_driver = {
sizeof(struct iicbus_softc),
};
-static int
-iicbus_probe(device_t dev)
-{
- device_set_desc(dev, "Philips I2C bus");
-
- return (0);
-}
-
-#if 0
-static int
-iic_probe_device(device_t dev, u_char addr)
-{
- int count;
- char byte;
-
- if ((addr & 1) == 0) {
- /* is device writable? */
- if (!iicbus_start(dev, (u_char)addr, 0)) {
- iicbus_stop(dev);
- return (1);
- }
- } else {
- /* is device readable? */
- if (!iicbus_block_read(dev, (u_char)addr, &byte, 1, &count))
- return (1);
- }
-
- return (0);
-}
-#endif
-
/*
- * We add all the devices which we know about.
- * The generic attach routine will attach them if they are alive.
+ * At 'probe' time, we add all the devices which we know about to the
+ * bus. The generic attach routine will probe and attach them if they
+ * are alive.
*/
static int
-iicbus_attach(device_t dev)
+iicbus_probe(device_t dev)
{
+ struct iicbus_softc *sc = device_get_softc(dev);
struct iicbus_device *iicdev;
device_t child;
- iicbus_reset(dev, IIC_FASTEST, 0, NULL);
+ /* XXX should query parent */
+ sc->ownaddr = I2C_MASTER_ADDRESS;
- /* device probing is meaningless since the bus is supposed to be
- * hot-plug. Moreover, some I2C chips do not appreciate random
- * accesses like stop after start to fast, reads for less than
- * x bytes...
- */
-#if 0
- printf("Probing for devices on iicbus%d:", device_get_unit(dev));
-
- /* probe any devices */
- for (addr = FIRST_SLAVE_ADDR; addr <= LAST_SLAVE_ADDR; addr++) {
- if (iic_probe_device(dev, (u_char)addr)) {
- printf(" <%x>", addr);
- }
- }
- printf("\n");
-#endif
+ iicbus_reset(dev, IIC_FASTEST);
- /* attach known devices */
for (iicdev = iicbus_children; iicdev->iicd_name; iicdev++) {
+
+ /* probe devices, not drivers */
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- /* check if the devclass exists */
- if (devclass_find(iicdev->iicd_name))
+ if (!iicbus_start(dev, iicdev->iicd_addr)) {
+ iicbus_stop(dev);
iicdev->iicd_alive = 1;
- else if (bootverbose)
- printf("iicbus: %s devclass not found\n",
- iicdev->iicd_name);
+ }
break;
-
case IICBUS_DRIVER_CLASS:
- /* check if the devclass exists */
- if (devclass_find(iicdev->iicd_name))
- iicdev->iicd_alive = 1;
- else if (bootverbose)
- printf("iicbus: %s devclass not found\n",
- iicdev->iicd_name);
+ iicdev->iicd_addr = sc->ownaddr;
break;
-
default:
panic("%s: unknown class!", __FUNCTION__);
}
- if (iicdev->iicd_alive) {
- child = device_add_child(dev, iicdev->iicd_name,
- -1, iicdev);
- device_set_desc(child, iicdev->iicd_desc);
- }
+ child = device_add_child(dev, iicdev->iicd_name, -1, iicdev);
+ device_set_desc(child, iicdev->iicd_desc);
}
- bus_generic_attach(dev);
-
- return (0);
-}
-int
-iicbus_generic_intr(device_t dev, int event, char *buf)
-{
return (0);
}
-int
-iicbus_null_callback(device_t dev, int index, caddr_t data)
+static int
+iicbus_attach(device_t dev)
{
- return (0);
+ bus_generic_attach(dev);
+
+ return (0);
}
int
-iicbus_null_repeated_start(device_t dev, u_char addr)
+iicbus_generic_intr(device_t dev, int event, char *buf)
{
- return (IIC_ENOTSUPP);
+ return (0);
}
static void
@@ -239,8 +178,9 @@ iicbus_print_child(device_t bus, device_t dev)
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), iicdev->iicd_addr);
+ printf(" on %s%d addr %d %s", device_get_name(bus),
+ device_get_unit(bus), iicdev->iicd_addr,
+ (iicdev->iicd_alive) ? "found" : "not found");
break;
case IICBUS_DRIVER_CLASS:
@@ -272,17 +212,4 @@ iicbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
return (0);
}
-static int
-iicbus_write_ivar(device_t bus, device_t dev, int index, u_long val)
-{
- switch (index) {
- default:
- return (ENOENT);
- }
-
- return (0);
-}
-
DRIVER_MODULE(iicbus, pcf, iicbus_driver, iicbus_devclass, 0, 0);
-DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0);
-DRIVER_MODULE(iicbus, bti2c, iicbus_driver, iicbus_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbus.h b/sys/dev/iicbus/iicbus.h
index 3c230955bbc1..e84525286175 100644
--- a/sys/dev/iicbus/iicbus.h
+++ b/sys/dev/iicbus/iicbus.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iicbus.h,v 1.1.2.3 1998/08/13 17:10:43 son Exp $
*
*/
#ifndef __IICBUS_H
@@ -31,9 +31,8 @@
struct iicbus_softc {
+ u_char ownaddr; /* address of the adapter */
device_t owner; /* iicbus owner device structure */
- u_char started; /* address of the 'started' slave
- * 0 if no start condition succeeded */
};
extern devclass_t iicbus_devclass;
diff --git a/sys/dev/iicbus/iicbus_if.m b/sys/dev/iicbus/iicbus_if.m
index 7e29333db495..bf7efeb3a45a 100644
--- a/sys/dev/iicbus/iicbus_if.m
+++ b/sys/dev/iicbus/iicbus_if.m
@@ -23,13 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: iicbus_if.m,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+# $Id: iicbus_if.m,v 1.1.2.4 1998/08/13 17:10:43 son Exp $
#
-INTERFACE iicbus;
+INTERFACE iicbus
#
-# Interpret interrupt
+# Interprete interrupt
#
METHOD int intr {
device_t dev;
@@ -38,21 +38,11 @@ METHOD int intr {
};
#
-# iicbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
# Send REPEATED_START condition
#
METHOD int repeated_start {
device_t dev;
u_char slave;
- int timeout;
};
#
@@ -61,7 +51,6 @@ METHOD int repeated_start {
METHOD int start {
device_t dev;
u_char slave;
- int timeout;
};
#
@@ -79,8 +68,6 @@ METHOD int read {
char *buf;
int len;
int *bytes;
- int last;
- int delay;
};
#
@@ -91,7 +78,6 @@ METHOD int write {
char *buf;
int len;
int *bytes;
- int timeout;
};
#
@@ -100,6 +86,4 @@ METHOD int write {
METHOD int reset {
device_t dev;
u_char speed;
- u_char addr;
- u_char *oldaddr;
};
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c
index 47f1686fac0f..b037b7cca2b1 100644
--- a/sys/dev/iicbus/iiconf.c
+++ b/sys/dev/iicbus/iiconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
+ * $Id: iiconf.c,v 1.1.1.11 1998/08/29 17:02:05 son Exp $
*
*/
#include <sys/param.h>
@@ -65,29 +65,10 @@ iicbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "iicbus", -1, NULL);
- return (child);
-}
-
-static int
-iicbus_poll(struct iicbus_softc *sc, int how)
-{
- int error;
+ if (child)
+ device_set_desc(child, "Philips I2C bus");
- switch (how) {
- case (IIC_WAIT | IIC_INTR):
- error = tsleep(sc, IICPRI|PCATCH, "iicreq", 0);
- break;
-
- case (IIC_WAIT | IIC_NOINTR):
- error = tsleep(sc, IICPRI, "iicreq", 0);
- break;
-
- default:
- return (EWOULDBLOCK);
- break;
- }
-
- return (error);
+ return (child);
}
/*
@@ -103,20 +84,25 @@ iicbus_request_bus(device_t bus, device_t dev, int how)
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
int s, error = 0;
- /* first, ask the underlying layers if the request is ok */
- do {
- error = IICBUS_CALLBACK(device_get_parent(bus),
- IIC_REQUEST_BUS, (caddr_t)&how);
- if (error)
- error = iicbus_poll(sc, how);
- } while (error);
-
while (!error) {
s = splhigh();
if (sc->owner) {
splx(s);
- error = iicbus_poll(sc, how);
+ switch (how) {
+ case (IIC_WAIT | IIC_INTR):
+ error = tsleep(sc, IICPRI|PCATCH, "iicreq", 0);
+ break;
+
+ case (IIC_WAIT | IIC_NOINTR):
+ error = tsleep(sc, IICPRI, "iicreq", 0);
+ break;
+
+ default:
+ return (EWOULDBLOCK);
+ break;
+ }
+
} else {
sc->owner = dev;
@@ -137,13 +123,7 @@ int
iicbus_release_bus(device_t bus, device_t dev)
{
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int s, error;
-
- /* first, ask the underlying layers if the release is ok */
- error = IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL);
-
- if (error)
- return (error);
+ int s;
s = splhigh();
if (sc->owner != dev) {
@@ -161,99 +141,6 @@ iicbus_release_bus(device_t bus, device_t dev)
}
/*
- * iicbus_started()
- *
- * Test if the iicbus is started by the controller
- */
-int
-iicbus_started(device_t bus)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- return (sc->started);
-}
-
-/*
- * iicbus_start()
- *
- * Send start condition to the slave addressed by 'slave'
- */
-int
-iicbus_start(device_t bus, u_char slave, int timeout)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int error = 0;
-
- if (sc->started)
- return (EINVAL); /* bus already started */
-
- if (!(error = IICBUS_START(device_get_parent(bus), slave, timeout)))
- sc->started = slave;
- else
- sc->started = 0;
-
- return (error);
-}
-
-/*
- * iicbus_stop()
- *
- * Send stop condition to the bus
- */
-int
-iicbus_stop(device_t bus)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int error = 0;
-
- if (!sc->started)
- return (EINVAL); /* bus not started */
-
- error = IICBUS_STOP(device_get_parent(bus));
-
- /* refuse any further access */
- sc->started = 0;
-
- return (error);
-}
-
-/*
- * iicbus_write()
- *
- * Write a block of data to the slave previously started by
- * iicbus_start() call
- */
-int
-iicbus_write(device_t bus, char *buf, int len, int *sent, int timeout)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- /* a slave must have been started with the appropriate address */
- if (!sc->started || (sc->started & LSB))
- return (EINVAL);
-
- return (IICBUS_WRITE(device_get_parent(bus), buf, len, sent, timeout));
-}
-
-/*
- * iicbus_read()
- *
- * Read a block of data from the slave previously started by
- * iicbus_read() call
- */
-int
-iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- /* a slave must have been started with the appropriate address */
- if (!sc->started || !(sc->started & LSB))
- return (EINVAL);
-
- return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
-}
-
-/*
* iicbus_block_write()
*
* Write a block of data to slave ; start/stop protocol managed
@@ -264,10 +151,10 @@ iicbus_block_write(device_t bus, u_char slave, char *buf, int len, int *sent)
u_char addr = slave & ~LSB;
int error;
- if ((error = iicbus_start(bus, addr, 0)))
+ if ((error = iicbus_start(bus, addr)))
return (error);
- error = iicbus_write(bus, buf, len, sent, 0);
+ error = iicbus_write(bus, buf, len, sent);
iicbus_stop(bus);
@@ -285,12 +172,12 @@ iicbus_block_read(device_t bus, u_char slave, char *buf, int len, int *read)
u_char addr = slave | LSB;
int error;
- if ((error = iicbus_start(bus, addr, 0)))
+ if ((error = iicbus_start(bus, addr)))
return (error);
- error = iicbus_read(bus, buf, len, read, IIC_LAST_READ, 0);
+ error = iicbus_read(bus, buf, len, read);
- iicbus_stop(bus);
+ /* STOP condition sent at adapter level */
return (error);
}
@@ -303,7 +190,7 @@ iicbus_block_read(device_t bus, u_char slave, char *buf, int len, int *read)
u_char
iicbus_get_addr(device_t dev)
{
- uintptr_t addr;
+ u_long addr;
device_t parent = device_get_parent(dev);
BUS_READ_IVAR(parent, dev, IICBUS_IVAR_ADDR, &addr);
@@ -311,3 +198,10 @@ iicbus_get_addr(device_t dev)
return ((u_char)addr);
}
+u_char
+iicbus_get_own_address(device_t bus)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+
+ return (sc->ownaddr);
+}
diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h
index 0b548fbdf8f0..9bf0ed35e3cd 100644
--- a/sys/dev/iicbus/iiconf.h
+++ b/sys/dev/iicbus/iiconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iiconf.h,v 1.1.1.10 1998/08/13 17:10:43 son Exp $
*/
#ifndef __IICONF_H
#define __IICONF_H
@@ -59,14 +59,6 @@
#define IIC_FAST 0x2
#define IIC_FASTEST 0x3
-#define IIC_LAST_READ 0x1
-
-/*
- * callback index
- */
-#define IIC_REQUEST_BUS 0x1
-#define IIC_RELEASE_BUS 0x2
-
/*
* interrupt events
*/
@@ -89,8 +81,6 @@
#define IIC_ESTATUS 0x5 /* status error */
#define IIC_EUNDERFLOW 0x6 /* slave ready for more data */
#define IIC_EOVERFLOW 0x7 /* too much data */
-#define IIC_ENOTSUPP 0x8 /* request not supported */
-#define IIC_ENOADDR 0x9 /* no address assigned to the interface */
/*
* ivars codes
@@ -103,25 +93,23 @@ extern device_t iicbus_alloc_bus(device_t);
extern void iicbus_intr(device_t, int, char *);
-extern int iicbus_null_repeated_start(device_t, u_char);
-extern int iicbus_null_callback(device_t, int, caddr_t);
-
-#define iicbus_repeated_start(bus,slave,timeout) \
- (IICBUS_REPEATED_START(device_get_parent(bus), slave, timeout))
-#define iicbus_reset(bus,speed,addr,oldaddr) \
- (IICBUS_RESET(device_get_parent(bus), speed, addr, oldaddr))
-
-/* basic I2C operations */
-extern int iicbus_started(device_t);
-extern int iicbus_start(device_t, u_char, int);
-extern int iicbus_stop(device_t);
-extern int iicbus_write(device_t, char *, int, int *, int);
-extern int iicbus_read(device_t, char *, int, int *, int, int);
+#define iicbus_repeated_start(bus,slave) \
+ (IICBUS_REPEATED_START(device_get_parent(bus), slave))
+#define iicbus_start(bus,slave) \
+ (IICBUS_START(device_get_parent(bus), slave))
+#define iicbus_stop(bus) \
+ (IICBUS_STOP(device_get_parent(bus)))
+#define iicbus_reset(bus,speed) \
+ (IICBUS_RESET(device_get_parent(bus), speed))
+#define iicbus_write(bus,buf,len,sent) \
+ (IICBUS_WRITE(device_get_parent(bus), buf, len, sent))
+#define iicbus_read(bus,buf,len,sent) \
+ (IICBUS_READ(device_get_parent(bus), buf, len, sent))
-/* Read/write operations with start/stop conditions managed */
extern int iicbus_block_write(device_t, u_char, char *, int, int *);
extern int iicbus_block_read(device_t, u_char, char *, int, int *);
extern u_char iicbus_get_addr(device_t);
+extern u_char iicbus_get_own_address(device_t);
#endif
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 060c548d8a2f..8f3a8bb7066d 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -23,26 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicsmb.c,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $
+ * $Id: iicsmb.c,v 1.1.2.2 1998/08/13 17:10:44 son Exp $
*
*/
/*
* I2C to SMB bridge
- *
- * Example:
- *
- * smb bttv
- * \ /
- * smbus
- * / \
- * iicsmb bti2c
- * |
- * iicbus
- * / | \
- * iicbb pcf ...
- * |
- * lpbb
*/
#include <sys/param.h>
@@ -86,7 +72,6 @@ static int iicsmb_attach(device_t);
static void iicsmb_print_child(device_t, device_t);
static void iicsmb_intr(device_t dev, int event, char *buf);
-static int iicsmb_callback(device_t dev, int index, caddr_t data);
static int iicsmb_quick(device_t dev, u_char slave, int how);
static int iicsmb_sendb(device_t dev, u_char slave, char byte);
static int iicsmb_recvb(device_t dev, u_char slave, char *byte);
@@ -112,7 +97,6 @@ static device_method_t iicsmb_methods[] = {
DEVMETHOD(iicbus_intr, iicsmb_intr),
/* smbus interface */
- DEVMETHOD(smbus_callback, iicsmb_callback),
DEVMETHOD(smbus_quick, iicsmb_quick),
DEVMETHOD(smbus_sendb, iicsmb_sendb),
DEVMETHOD(smbus_recvb, iicsmb_recvb),
@@ -239,32 +223,6 @@ end:
}
static int
-iicsmb_callback(device_t dev, int index, caddr_t data)
-{
- device_t parent = device_get_parent(dev);
- int error = 0;
- int how;
-
- switch (index) {
- case SMB_REQUEST_BUS:
- /* request underlying iicbus */
- how = *(int *)data;
- error = iicbus_request_bus(parent, dev, how);
- break;
-
- case SMB_RELEASE_BUS:
- /* release underlying iicbus */
- error = iicbus_release_bus(parent, dev);
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
iicsmb_quick(device_t dev, u_char slave, int how)
{
device_t parent = device_get_parent(dev);
@@ -272,11 +230,11 @@ iicsmb_quick(device_t dev, u_char slave, int how)
switch (how) {
case SMB_QWRITE:
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
break;
case SMB_QREAD:
- error = iicbus_start(parent, slave | LSB, 0);
+ error = iicbus_start(parent, slave | LSB);
break;
default:
@@ -296,10 +254,10 @@ iicsmb_sendb(device_t dev, u_char slave, char byte)
device_t parent = device_get_parent(dev);
int error, sent;
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- error = iicbus_write(parent, &byte, 1, &sent, 0);
+ error = iicbus_write(parent, &byte, 1, &sent);
iicbus_stop(parent);
}
@@ -313,13 +271,10 @@ iicsmb_recvb(device_t dev, u_char slave, char *byte)
device_t parent = device_get_parent(dev);
int error, read;
- error = iicbus_start(parent, slave | LSB, 0);
+ error = iicbus_start(parent, slave | LSB);
- if (!error) {
- error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, 0);
-
- iicbus_stop(parent);
- }
+ if (!error)
+ error = iicbus_read(parent, byte, 1, &read);
return (error);
}
@@ -330,11 +285,11 @@ iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
device_t parent = device_get_parent(dev);
int error, sent;
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- if (!(error = iicbus_write(parent, &cmd, 1, &sent, 0)))
- error = iicbus_write(parent, &byte, 1, &sent, 0);
+ if (!(error = iicbus_write(parent, &cmd, 1, &sent)))
+ error = iicbus_write(parent, &byte, 1, &sent);
iicbus_stop(parent);
}
@@ -351,12 +306,12 @@ iicsmb_writew(device_t dev, u_char slave, char cmd, short word)
char low = (char)(word & 0xff);
char high = (char)((word & 0xff00) >> 8);
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- if (!(error = iicbus_write(parent, &cmd, 1, &sent, 0)))
- if (!(error = iicbus_write(parent, &low, 1, &sent, 0)))
- error = iicbus_write(parent, &high, 1, &sent, 0);
+ if (!(error = iicbus_write(parent, &cmd, 1, &sent)))
+ if (!(error = iicbus_write(parent, &low, 1, &sent)))
+ error = iicbus_write(parent, &high, 1, &sent);
iicbus_stop(parent);
}
@@ -370,20 +325,19 @@ iicsmb_readb(device_t dev, u_char slave, char cmd, char *byte)
device_t parent = device_get_parent(dev);
int error, sent, read;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, byte, 1, &read)))
goto error;
error:
- iicbus_stop(parent);
return (error);
}
@@ -397,23 +351,22 @@ iicsmb_readw(device_t dev, u_char slave, char cmd, short *word)
int error, sent, read;
char buf[2];
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, 2, &read)))
goto error;
/* first, receive low, then high byte */
*word = BUF2SHORT(buf[0], buf[1]);
error:
- iicbus_stop(parent);
return (error);
}
@@ -424,30 +377,29 @@ iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata)
int error, sent, read;
char buf[2];
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
/* first, send low, then high byte */
buf[0] = (char)(sdata & 0xff);
buf[1] = (char)((sdata & 0xff00) >> 8);
- if ((error = iicbus_write(parent, buf, 2, &sent, 0)))
+ if ((error = iicbus_write(parent, buf, 2, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, 2, &read)))
goto error;
/* first, receive low, then high byte */
*rdata = BUF2SHORT(buf[0], buf[1]);
error:
- iicbus_stop(parent);
return (error);
}
@@ -457,13 +409,13 @@ iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
device_t parent = device_get_parent(dev);
int error, sent;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
+ if ((error = iicbus_start(parent, slave & ~LSB)))
goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_write(parent, buf, (int)count, &sent, 0)))
+ if ((error = iicbus_write(parent, buf, (int)count, &sent)))
goto error;
if ((error = iicbus_stop(parent)))
@@ -479,21 +431,19 @@ iicsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
device_t parent = device_get_parent(dev);
int error, sent, read;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, (int)count, &read,
- IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, (int)count, &read)))
goto error;
error:
- iicbus_stop(parent);
return (error);
}
diff --git a/sys/dev/isp/asm_pci.h b/sys/dev/isp/asm_pci.h
index b7e0f9a9a11d..fd9313bd263e 100644
--- a/sys/dev/isp/asm_pci.h
+++ b/sys/dev/isp/asm_pci.h
@@ -1,13 +1,1314 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: asm_pci.h,v 1.8 1998/09/14 23:24:59 mjacob Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998 by Qlogic Corporation
*/
/*
- * Firmware Version 7.55.00 (16:16 Mar 20, 1998)
+ * Version 2.10 Initiator Firmware (16:13 Oct 18, 1995)
+ *
+ * (this f/w now deprecated for newer f/w, but the old is held here
+ * in case of problems...)
*/
+
#define ISP_CODE_ORG 0x1000
+#if 0
+#define ISP_CODE_VERSION 2*1024+10
+static const u_int16_t ISP_RISC_CODE[] = {
+ 0x0078, 0x1041, 0x0000, 0x283a, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
+ 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320,
+ 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350,
+ 0x3130, 0x3230, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x322e, 0x3130, 0x2020, 0x2043,
+ 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050,
+ 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020,
+ 0x2400, 0x20b9, 0x1212, 0x2071, 0x0010, 0x70c3, 0x0004, 0x20c9,
+ 0x43ff, 0x2089, 0x115b, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf,
+ 0x2020, 0x70d3, 0x0002, 0x3f00, 0x70d6, 0x20c1, 0x0008, 0x2019,
+ 0x0000, 0x2009, 0xfeff, 0x2100, 0x200b, 0xa5a5, 0xa1ec, 0x7fff,
+ 0x2d64, 0x206b, 0x0a0a, 0xaddc, 0x3fff, 0x2b54, 0x205b, 0x5050,
+ 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10b3, 0xa386, 0x000f, 0x0040,
+ 0x1079, 0x2c6a, 0x2a5a, 0x20c1, 0x0000, 0x2019, 0x000f, 0x0078,
+ 0x1059, 0x2c6a, 0x2a5a, 0x20c1, 0x0008, 0x2009, 0x7fff, 0x2148,
+ 0x2944, 0x204b, 0x0a0a, 0xa9bc, 0x3fff, 0x2734, 0x203b, 0x5050,
+ 0x2114, 0xa286, 0x0a0a, 0x0040, 0x109d, 0x284a, 0x263a, 0x20c1,
+ 0x0004, 0x2009, 0x3fff, 0x2134, 0x200b, 0x5050, 0x2114, 0xa286,
+ 0x5050, 0x0040, 0x109e, 0x0078, 0x1163, 0x284a, 0x263a, 0x98c0,
+ 0xa188, 0x1000, 0x212c, 0x200b, 0xa5a5, 0x2114, 0xa286, 0xa5a5,
+ 0x0040, 0x10b0, 0x250a, 0xa18a, 0x1000, 0x98c1, 0x0078, 0x10b5,
+ 0x250a, 0x0078, 0x10b5, 0x2c6a, 0x2a5a, 0x2130, 0xa18a, 0x0040,
+ 0x2128, 0xa1a2, 0x3900, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424,
+ 0x8424, 0xa192, 0x4400, 0x2009, 0x0000, 0x2001, 0x002f, 0x1078,
+ 0x1a70, 0x2218, 0x2079, 0x3900, 0x2fa0, 0x2408, 0x2011, 0x0000,
+ 0x20a9, 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10d0, 0x7eea, 0x7dde,
+ 0x8528, 0x7dda, 0x7ce2, 0x7be6, 0x787b, 0x0000, 0x2031, 0x0030,
+ 0x78c3, 0x0101, 0x780b, 0x0002, 0x780f, 0x0002, 0x784f, 0x0003,
+ 0x2069, 0x3940, 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa,
+ 0x680f, 0x0008, 0x6813, 0x0005, 0x681f, 0x0000, 0x6823, 0x0006,
+ 0x6817, 0x0008, 0x6827, 0x0000, 0x2069, 0x3a00, 0x2011, 0x0020,
+ 0x2009, 0x0010, 0x680b, 0x0c19, 0x680f, 0x0019, 0x6803, 0xfd00,
+ 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
+ 0x8109, 0x00c0, 0x1102, 0x2069, 0x3a80, 0x20a9, 0x0080, 0x680b,
+ 0x0040, 0x7be8, 0xa386, 0xfeff, 0x00c0, 0x1124, 0x6817, 0x0100,
+ 0x681f, 0x0064, 0x0078, 0x1128, 0x6817, 0x0064, 0x681f, 0x0002,
+ 0xade8, 0x0010, 0x0070, 0x112e, 0x0078, 0x1117, 0x1078, 0x1d15,
+ 0x1078, 0x3366, 0x1078, 0x18a4, 0x1078, 0x37fc, 0x3200, 0xa085,
+ 0x000d, 0x2090, 0x70c3, 0x0000, 0x0090, 0x1145, 0x70c0, 0xa086,
+ 0x0002, 0x00c0, 0x1145, 0x1078, 0x1274, 0x1078, 0x1186, 0x78c0,
+ 0xa005, 0x00c0, 0x1151, 0x1078, 0x1a99, 0x0068, 0x1155, 0x1078,
+ 0x1c6f, 0x0068, 0x1155, 0x1078, 0x1997, 0x00e0, 0x1145, 0x1078,
+ 0x369a, 0x0078, 0x1145, 0x1163, 0x1165, 0x1ebb, 0x1ebb, 0x33d7,
+ 0x33d7, 0x1ebb, 0x1ebb, 0x0078, 0x1163, 0x0078, 0x1165, 0x0078,
+ 0x1167, 0x0078, 0x1169, 0x2009, 0x0022, 0x2104, 0xa086, 0x4000,
+ 0x0040, 0x1181, 0x7008, 0x800b, 0x00c8, 0x1181, 0x7007, 0x0002,
+ 0xa08c, 0x0060, 0x00c0, 0x1182, 0xa084, 0x0008, 0x0040, 0x1181,
+ 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x1277, 0x0068, 0x11f1,
+ 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x11f1, 0x7814,
+ 0xa005, 0x00c0, 0x1197, 0x0010, 0x11f2, 0x0078, 0x11f1, 0x2009,
+ 0x3968, 0x2104, 0xa005, 0x00c0, 0x11f1, 0x2009, 0x3971, 0x200b,
+ 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11bc, 0x7816, 0x2009,
+ 0x396f, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca,
+ 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce,
+ 0x1078, 0x1896, 0x0078, 0x11ef, 0x7814, 0xa086, 0x0018, 0x00c0,
+ 0x11c3, 0x1078, 0x1622, 0x7817, 0x0000, 0x2009, 0x396f, 0x2104,
+ 0xa065, 0x0040, 0x11df, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6,
+ 0x0c7f, 0x609f, 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6087,
+ 0x0103, 0x1078, 0x181d, 0x00c0, 0x11eb, 0x1078, 0x1896, 0x2009,
+ 0x396f, 0x200b, 0x0000, 0x2009, 0x3969, 0x2104, 0x200b, 0x0000,
+ 0xa005, 0x0040, 0x11ef, 0x2001, 0x4005, 0x0078, 0x1276, 0x0078,
+ 0x1274, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000,
+ 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1242, 0x2038,
+ 0x0079, 0x1202, 0x1274, 0x12cf, 0x1293, 0x12cf, 0x1338, 0x1338,
+ 0x128a, 0x16fd, 0x1343, 0x1282, 0x1297, 0x1299, 0x129b, 0x129d,
+ 0x1702, 0x1282, 0x1355, 0x1380, 0x163a, 0x16f7, 0x129f, 0x1569,
+ 0x158b, 0x15a1, 0x15be, 0x1526, 0x1534, 0x1548, 0x155c, 0x13f3,
+ 0x1282, 0x13a1, 0x13a7, 0x13ac, 0x13b1, 0x13b7, 0x13bc, 0x13c1,
+ 0x13c6, 0x13cb, 0x13cf, 0x13e4, 0x13f0, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x13ff, 0x1408, 0x1417, 0x143d, 0x1447, 0x144e, 0x1474,
+ 0x1483, 0x1492, 0x14a4, 0x1506, 0x1516, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x151b, 0xa0bc, 0xffa0, 0x00c0, 0x1282, 0x2038, 0xa084,
+ 0x001f, 0x0079, 0x124b, 0x1719, 0x171c, 0x172c, 0x17a8, 0x17e1,
+ 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x1282, 0x1282, 0x12c5, 0x132e, 0x134b, 0x1376, 0x1630,
+ 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x17f9, 0x1803, 0x1807,
+ 0x1815, 0x1282, 0x1282, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078,
+ 0x1276, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068,
+ 0x1277, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091,
+ 0x4080, 0x007c, 0x70c3, 0x4001, 0x0078, 0x1277, 0x70c3, 0x4006,
+ 0x0078, 0x1277, 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005,
+ 0x53a3, 0x0078, 0x1274, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078,
+ 0x1274, 0x0078, 0x1274, 0x0078, 0x1274, 0x0078, 0x1274, 0x2091,
+ 0x8000, 0x70c3, 0x0000, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf,
+ 0x2020, 0x70d3, 0x0002, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b,
+ 0x0001, 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051,
+ 0x0470, 0x2061, 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091,
+ 0x5000, 0x2091, 0x4080, 0x0078, 0x0455, 0x1078, 0x1a04, 0x00c0,
+ 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x12d2, 0x2029,
+ 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2098,
+ 0x2031, 0x0030, 0x81ff, 0x0040, 0x1274, 0x7007, 0x0004, 0x731a,
+ 0x721e, 0x7422, 0x7526, 0x2051, 0x0012, 0x2049, 0x130d, 0x2041,
+ 0x1274, 0x7003, 0x0002, 0xa786, 0x0001, 0x0040, 0x12f5, 0xa786,
+ 0x0050, 0x0040, 0x12f5, 0x0078, 0x12fb, 0x2049, 0x131a, 0x2041,
+ 0x1326, 0x7003, 0x0003, 0x7017, 0x0000, 0x810b, 0x7112, 0x00c8,
+ 0x1303, 0x7017, 0x0001, 0x7007, 0x0001, 0xa786, 0x0001, 0x0040,
+ 0x131a, 0xa786, 0x0050, 0x0040, 0x131a, 0x700c, 0xa084, 0x007f,
+ 0x2009, 0x0040, 0xa102, 0x8004, 0x094a, 0x20a8, 0x26a0, 0x53a6,
+ 0x0078, 0x116b, 0x700c, 0xa084, 0x007f, 0x0040, 0x131a, 0x80ac,
+ 0x0048, 0x131a, 0x2698, 0x53a5, 0x0078, 0x116b, 0x700c, 0xa084,
+ 0x007f, 0x80ac, 0x2698, 0x53a5, 0x0078, 0x1274, 0x1078, 0x1a04,
+ 0x00c0, 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x12d2,
+ 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x1340, 0x200a,
+ 0x72ca, 0x0078, 0x1273, 0x70c7, 0x0002, 0x70cb, 0x000a, 0x70cf,
+ 0x0000, 0x0078, 0x1274, 0x1078, 0x1a04, 0x00c0, 0x1286, 0x75d8,
+ 0x76dc, 0x75da, 0x76de, 0x0078, 0x1358, 0x2029, 0x0000, 0x2530,
+ 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, 0x73ce, 0x74d2,
+ 0xa005, 0x0040, 0x1370, 0x8001, 0x788a, 0x7a92, 0x7b96, 0x7d9a,
+ 0x7e9e, 0x7c8e, 0x78c0, 0xa084, 0xfffc, 0x78c2, 0x0078, 0x1374,
+ 0x78c0, 0xa085, 0x0001, 0x78c2, 0x0078, 0x1274, 0x1078, 0x1a04,
+ 0x00c0, 0x1286, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x1383,
+ 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6,
+ 0x72ca, 0x73ce, 0x74d6, 0xa005, 0x0040, 0x139b, 0x8001, 0x78a6,
+ 0x7aae, 0x7bb2, 0x7db6, 0x7eba, 0x7caa, 0x78c0, 0xa084, 0xfcff,
+ 0x78c2, 0x0078, 0x139f, 0x78c0, 0xa085, 0x0100, 0x78c2, 0x0078,
+ 0x1274, 0x2009, 0x395f, 0x210c, 0x7ae4, 0x0078, 0x1272, 0x2009,
+ 0x3941, 0x210c, 0x0078, 0x1273, 0x2009, 0x3942, 0x210c, 0x0078,
+ 0x1273, 0x2061, 0x3940, 0x610c, 0x6210, 0x0078, 0x1272, 0x2009,
+ 0x3945, 0x210c, 0x0078, 0x1273, 0x2009, 0x3946, 0x210c, 0x0078,
+ 0x1273, 0x2009, 0x3947, 0x210c, 0x0078, 0x1273, 0x2009, 0x3948,
+ 0x210c, 0x0078, 0x1273, 0x7908, 0x7a0c, 0x0078, 0x1272, 0x71c4,
+ 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, 0x3a00,
+ 0x6a00, 0x6804, 0xa084, 0x0008, 0x0040, 0x13e1, 0x6b08, 0x0078,
+ 0x13e2, 0x6b0c, 0x0078, 0x1271, 0x77c4, 0x1078, 0x18b4, 0x2091,
+ 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x1271,
+ 0x794c, 0x0078, 0x1273, 0x77c4, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6908, 0x6a18, 0x6b10, 0x2091, 0x8001, 0x0078, 0x1271, 0x71c4,
+ 0xa182, 0x0010, 0x00c8, 0x126c, 0x1078, 0x1d9b, 0x0078, 0x1271,
+ 0x71c4, 0xa182, 0x0010, 0x00c8, 0x126c, 0x2011, 0x3941, 0x2204,
+ 0x007e, 0x2112, 0x1078, 0x1d54, 0x017f, 0x0078, 0x1273, 0x71c4,
+ 0x2011, 0x1435, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0040, 0x1427,
+ 0x8210, 0x0070, 0x1425, 0x0078, 0x141c, 0x0078, 0x126c, 0xa292,
+ 0x1435, 0x027e, 0x2011, 0x3942, 0x2204, 0x2112, 0x017f, 0x007e,
+ 0x1078, 0x1d60, 0x017f, 0x0078, 0x1273, 0x03e8, 0x00fa, 0x01f4,
+ 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x3940, 0x610c,
+ 0x6210, 0x70c4, 0x600e, 0x70c8, 0x6012, 0x0078, 0x1272, 0x2061,
+ 0x3940, 0x6114, 0x70c4, 0x6016, 0x0078, 0x1273, 0x71c4, 0x2011,
+ 0x0004, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x1467, 0x2011,
+ 0x0005, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040, 0x1467, 0x2011,
+ 0x0006, 0x2019, 0x2323, 0xa186, 0x003c, 0x00c0, 0x126c, 0x2061,
+ 0x3940, 0x6018, 0x007e, 0x611a, 0x23b8, 0x1078, 0x1d71, 0x1078,
+ 0x37fc, 0x017f, 0x0078, 0x1273, 0x71c4, 0xa184, 0xffcf, 0x00c0,
+ 0x126c, 0x2011, 0x3947, 0x2204, 0x2112, 0x007e, 0x1078, 0x1d93,
+ 0x017f, 0x0078, 0x1273, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x126c,
+ 0x2011, 0x3948, 0x2204, 0x007e, 0x2112, 0x1078, 0x1d82, 0x017f,
+ 0x0078, 0x1273, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x126b,
+ 0xa284, 0xfffd, 0x00c0, 0x126b, 0x2100, 0x7908, 0x780a, 0x2200,
+ 0x7a0c, 0x780e, 0x0078, 0x1272, 0x71c4, 0x8107, 0xa084, 0x000f,
+ 0x8003, 0x8003, 0x8003, 0xa0e8, 0x3a00, 0x2019, 0x0000, 0x72c8,
+ 0x6800, 0x007e, 0xa226, 0x0040, 0x14d3, 0x6a02, 0xa484, 0x2000,
+ 0x0040, 0x14bc, 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x14c2,
+ 0xa39d, 0x0008, 0xa484, 0x4000, 0x0040, 0x14d3, 0x810f, 0xa284,
+ 0x4000, 0x0040, 0x14cf, 0x1078, 0x1db5, 0x0078, 0x14d3, 0x1078,
+ 0x1da7, 0x0078, 0x14d3, 0x72cc, 0x82ff, 0x0040, 0x14ff, 0x6808,
+ 0xa206, 0x0040, 0x14ff, 0xa2a4, 0x00ff, 0x2061, 0x3940, 0x6118,
+ 0xa186, 0x0028, 0x0040, 0x14ec, 0xa186, 0x0032, 0x0040, 0x14f2,
+ 0xa186, 0x003c, 0x0040, 0x14f8, 0xa482, 0x0064, 0x00c8, 0x126d,
+ 0x0078, 0x14fc, 0xa482, 0x0050, 0x00c8, 0x126d, 0x0078, 0x14fc,
+ 0xa482, 0x0043, 0x00c8, 0x126d, 0x6a0a, 0xa39d, 0x000a, 0x6804,
+ 0xa305, 0x6806, 0x027f, 0x6b0c, 0x0078, 0x1271, 0x77c4, 0x1078,
+ 0x18b4, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8,
+ 0x6816, 0x70cc, 0x681e, 0x2708, 0x0078, 0x1271, 0x70c4, 0x794c,
+ 0x784e, 0x0078, 0x1273, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010,
+ 0x00c8, 0x126c, 0x1078, 0x1dc3, 0x0078, 0x1271, 0x77c4, 0x1078,
+ 0x18b4, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0002, 0x6a0a, 0x2091,
+ 0x8001, 0x2708, 0x0078, 0x1272, 0x77c4, 0x1078, 0x18b4, 0x2091,
+ 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040,
+ 0x1543, 0x1078, 0x1cf6, 0x2091, 0x8001, 0x2708, 0x0078, 0x1272,
+ 0x77c4, 0x1078, 0x18b4, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0004,
+ 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1557, 0x1078, 0x1cf6, 0x2091,
+ 0x8001, 0x2708, 0x0078, 0x1272, 0x77c4, 0x2041, 0x0001, 0x2049,
+ 0x0005, 0x2051, 0x0020, 0x1078, 0x18c1, 0x2708, 0x6a08, 0x0078,
+ 0x1272, 0x77c4, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x1078,
+ 0x193c, 0x00c0, 0x1587, 0x6818, 0xa005, 0x0040, 0x1581, 0x2708,
+ 0x1078, 0x1dd3, 0x00c0, 0x1581, 0x7817, 0x0015, 0x2091, 0x8001,
+ 0x007c, 0x2091, 0x8001, 0x2001, 0x4005, 0x0078, 0x1276, 0x2091,
+ 0x8001, 0x0078, 0x1274, 0x77c4, 0x77c6, 0x2061, 0x3940, 0x60a3,
+ 0x0003, 0x67b6, 0x60c7, 0x000f, 0x2041, 0x0021, 0x2049, 0x0005,
+ 0x2051, 0x0020, 0x1078, 0x18c1, 0x7817, 0x0016, 0x1078, 0x1cf6,
+ 0x007c, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2061, 0x3940, 0x60a3,
+ 0x0002, 0x67b6, 0x60c7, 0x000f, 0x7817, 0x0017, 0x1078, 0x1cf6,
+ 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x1078, 0x18c1,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x15b6, 0x007c, 0x78c0, 0xa084,
+ 0x0003, 0x00c0, 0x15e2, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049,
+ 0x0004, 0x2051, 0x0008, 0x1078, 0x18b4, 0x2091, 0x8000, 0x6808,
+ 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x0007, 0x00c0,
+ 0x15cb, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00,
+ 0x00c0, 0x15cb, 0x2091, 0x8000, 0x2069, 0x0100, 0x6830, 0xa084,
+ 0x0040, 0x0040, 0x160b, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848,
+ 0xa084, 0x0004, 0x0040, 0x15f8, 0x0070, 0x15f8, 0x0078, 0x15ef,
+ 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040,
+ 0x1605, 0x0070, 0x1605, 0x0078, 0x15fc, 0x20a9, 0x00fa, 0x0070,
+ 0x160b, 0x0078, 0x1607, 0x2079, 0x3900, 0x7817, 0x0018, 0x2061,
+ 0x3940, 0x60a3, 0x0001, 0x60c7, 0x000f, 0x78c0, 0xa085, 0x0002,
+ 0x78c2, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0047, 0x2091,
+ 0x8001, 0x007c, 0x78c0, 0xa084, 0xfffd, 0x78c2, 0xa084, 0x0001,
+ 0x00c0, 0x162c, 0x1078, 0x197e, 0x71c4, 0x71c6, 0x794a, 0x007c,
+ 0x1078, 0x1a04, 0x00c0, 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de,
+ 0x0078, 0x163d, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc,
+ 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x3900, 0x1078, 0x188d, 0x0040,
+ 0x16e5, 0x20a9, 0x0005, 0x20a1, 0x3916, 0x41a1, 0x2009, 0x0040,
+ 0x1078, 0x1857, 0x0040, 0x1658, 0x1078, 0x1896, 0x0078, 0x16e5,
+ 0x6004, 0xa084, 0xff00, 0x8007, 0x8009, 0x0040, 0x16b9, 0x0c7e,
+ 0x2c68, 0x1078, 0x188d, 0x0040, 0x1688, 0x2c00, 0x689e, 0x8109,
+ 0x00c0, 0x1660, 0x609f, 0x0000, 0x0c7f, 0x0c7e, 0x7218, 0x731c,
+ 0x7420, 0x7524, 0x2c68, 0x689c, 0xa065, 0x0040, 0x16b8, 0x2009,
+ 0x0040, 0x1078, 0x1857, 0x00c0, 0x16a1, 0x6004, 0xa084, 0x00ff,
+ 0xa086, 0x0002, 0x00c0, 0x1688, 0x2d00, 0x6002, 0x0078, 0x166e,
+ 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6, 0x0c7f, 0x609f,
+ 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6008, 0xa085, 0x0200,
+ 0x600a, 0x6004, 0x6086, 0x1078, 0x181d, 0x1078, 0x1896, 0x0078,
+ 0x16e5, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6, 0x0c7f,
+ 0x609f, 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6087, 0x0103,
+ 0x601b, 0x0003, 0x1078, 0x181d, 0x1078, 0x1896, 0x0078, 0x16e5,
+ 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x7817, 0x0012, 0x0e7e,
+ 0x2071, 0x3940, 0x70a3, 0x0005, 0x70a7, 0x0000, 0x73aa, 0x72ae,
+ 0x74b2, 0x70b6, 0x70bb, 0x0000, 0x2c00, 0x70be, 0x70c3, 0x0000,
+ 0xa02e, 0x2530, 0x611c, 0xa184, 0x0060, 0x0040, 0x16d9, 0x1078,
+ 0x330a, 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x669a, 0x60af, 0x0000,
+ 0x60b3, 0x0000, 0x1078, 0x1cf6, 0x007c, 0x70c3, 0x4005, 0x0078,
+ 0x1277, 0x20a9, 0x0005, 0x2099, 0x3916, 0x530a, 0x2100, 0xa210,
+ 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x71c4,
+ 0x70c7, 0x0000, 0x7906, 0x0078, 0x1274, 0x71c4, 0x71c6, 0x2168,
+ 0x0078, 0x1704, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210,
+ 0x8d68, 0x8109, 0x00c0, 0x1706, 0xa285, 0x0000, 0x00c0, 0x1714,
+ 0x70c3, 0x4000, 0x0078, 0x1716, 0x70c3, 0x4003, 0x70ca, 0x0078,
+ 0x1277, 0x79d8, 0x0078, 0x1273, 0x71c4, 0x71c6, 0x2198, 0x20a1,
+ 0x0042, 0x20a9, 0x0004, 0x53a3, 0x21a0, 0x2099, 0x0042, 0x20a9,
+ 0x0004, 0x53a3, 0x0078, 0x1274, 0x70c4, 0x2068, 0x2079, 0x3900,
+ 0x1078, 0x188d, 0x0040, 0x17a4, 0x6007, 0x0001, 0x600b, 0x0000,
+ 0x602b, 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x0007, 0xa284,
+ 0x00f0, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016, 0xa284,
+ 0x0800, 0x0040, 0x174f, 0x601b, 0x000a, 0x0078, 0x1755, 0xa284,
+ 0x1000, 0x0040, 0x1755, 0x601b, 0x000c, 0xa284, 0x0300, 0x0040,
+ 0x175e, 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085, 0x0001,
+ 0x601e, 0x6023, 0x0000, 0x6027, 0x000a, 0xa284, 0x0400, 0x0040,
+ 0x176b, 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b, 0x20a0,
+ 0xad80, 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0, 0x1780,
+ 0x6046, 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078, 0x178a,
+ 0x6800, 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c, 0x6552,
+ 0x6596, 0x669a, 0x6014, 0x7817, 0x0042, 0x2c08, 0x2061, 0x3940,
+ 0x60a3, 0x0005, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x60af, 0x0000,
+ 0x60b3, 0x0000, 0x60b6, 0x61be, 0xa284, 0x0400, 0x60c2, 0x1078,
+ 0x32f5, 0x1078, 0x1cf6, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1277,
+ 0x78f0, 0xa005, 0x0040, 0x1282, 0x2091, 0x8000, 0x70c4, 0x800a,
+ 0x2011, 0x0010, 0x810c, 0x0048, 0x17ba, 0x3a00, 0xa084, 0xfff7,
+ 0x0078, 0x17bd, 0x3a00, 0xa085, 0x0008, 0x20d0, 0x0005, 0x0005,
+ 0xa084, 0xfffb, 0x20d0, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005,
+ 0x0005, 0x0005, 0x0005, 0xa085, 0x0004, 0x20d0, 0x0005, 0x0005,
+ 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x8211, 0x00c0,
+ 0x17b2, 0x3a00, 0xa085, 0x0008, 0x20d0, 0x2091, 0x8001, 0x0078,
+ 0x1274, 0x2011, 0x04fd, 0x2204, 0xa082, 0x0004, 0x0048, 0x17f5,
+ 0x78f3, 0x0001, 0x2009, 0xff01, 0x200a, 0x2001, 0x000c, 0x20d8,
+ 0x2001, 0x000c, 0x20d0, 0x0078, 0x1274, 0x2001, 0x4005, 0x0078,
+ 0x1276, 0x7978, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x126c,
+ 0x797a, 0x0078, 0x1274, 0x7978, 0x71c6, 0x0078, 0x1274, 0x796c,
+ 0x71c6, 0x71c4, 0x796e, 0x7970, 0x71ca, 0x71c8, 0x7972, 0x7974,
+ 0x71ce, 0x71cc, 0x7976, 0x0078, 0x1274, 0x796c, 0x71c6, 0x7970,
+ 0x71ca, 0x7974, 0x71ce, 0x0078, 0x1274, 0x700c, 0xa084, 0x00ff,
+ 0x0040, 0x1829, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
+ 0x1824, 0x7017, 0x0000, 0x7112, 0x721a, 0x731e, 0x7422, 0x7526,
+ 0xac80, 0x0001, 0x8108, 0x810c, 0x81a9, 0x8098, 0x20a1, 0x0030,
+ 0x6084, 0x20a2, 0x53a6, 0x780c, 0xa085, 0x0000, 0x7002, 0x7007,
+ 0x0001, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1841,
+ 0x7108, 0x8103, 0x00c8, 0x1841, 0x7014, 0xa005, 0x0040, 0x1841,
+ 0x7007, 0x0002, 0xa184, 0x0060, 0x7003, 0x0000, 0x007c, 0x700c,
+ 0xa084, 0x00ff, 0x0040, 0x1863, 0x7007, 0x0004, 0x7004, 0xa084,
+ 0x0004, 0x00c0, 0x185e, 0x7017, 0x0000, 0x7112, 0x721a, 0x7422,
+ 0x7526, 0x731e, 0x2099, 0x0030, 0x8108, 0x81ac, 0x780c, 0xa085,
+ 0x0001, 0x7002, 0x7007, 0x0001, 0x2009, 0x0022, 0x2104, 0xa084,
+ 0x4000, 0x00c0, 0x1874, 0x7008, 0x800b, 0x00c8, 0x1874, 0x7007,
+ 0x0002, 0xa08c, 0x0060, 0x00c0, 0x188a, 0xac80, 0x0001, 0x20a0,
+ 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c, 0x7850, 0xa065, 0x0040,
+ 0x1895, 0x2c04, 0x7852, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079,
+ 0x3900, 0x7850, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x18a1, 0x1078,
+ 0x1eac, 0x7852, 0x0f7f, 0x007c, 0x2011, 0x4400, 0x7a52, 0x7be4,
+ 0x8319, 0x0040, 0x18b1, 0xa280, 0x002f, 0x2012, 0x2010, 0x0078,
+ 0x18a8, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
+ 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8, 0x3a80,
+ 0x007c, 0x1078, 0x18b4, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808,
+ 0xa084, 0xffef, 0xa80d, 0x690a, 0x2091, 0x8000, 0x2009, 0x394f,
+ 0x210c, 0x6804, 0xa005, 0x0040, 0x18de, 0xa116, 0x00c0, 0x18de,
+ 0x2060, 0x6000, 0x6806, 0x017e, 0x0078, 0x18e1, 0x2009, 0x0000,
+ 0x017e, 0x6804, 0xa065, 0x0040, 0x18f0, 0x6000, 0x6806, 0x1078,
+ 0x1903, 0x1078, 0x1a14, 0x6810, 0x8001, 0x6812, 0x00c0, 0x18e1,
+ 0x017f, 0x6902, 0x6906, 0x2091, 0x8001, 0x007c, 0xa065, 0x0040,
+ 0x1902, 0x609c, 0x609f, 0x0000, 0x2008, 0x1078, 0x1896, 0x2100,
+ 0x0078, 0x18f6, 0x007c, 0x6007, 0x0103, 0x20a9, 0x001c, 0xac80,
+ 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c,
+ 0x6022, 0x007c, 0x0e7e, 0x2071, 0x3940, 0x7040, 0xa08c, 0x0080,
+ 0x00c0, 0x1920, 0xa088, 0x3980, 0x2d0a, 0x8000, 0x7042, 0xa006,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x3940, 0x2009, 0x3980, 0x7240,
+ 0x8221, 0x8211, 0x0048, 0x193a, 0x2104, 0x8108, 0xad06, 0x00c0,
+ 0x1929, 0x8119, 0x211e, 0x8108, 0x8318, 0x8211, 0x00c8, 0x1932,
+ 0x7442, 0xa006, 0x0e7f, 0x007c, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6804, 0x781e, 0xa065, 0x0040, 0x197d, 0x0078, 0x194d, 0x2c00,
+ 0x781e, 0x6000, 0xa065, 0x0040, 0x197d, 0x6010, 0xa306, 0x00c0,
+ 0x1947, 0x600c, 0xa206, 0x00c0, 0x1947, 0x2c28, 0x6804, 0xac06,
+ 0x00c0, 0x1964, 0x6000, 0x2060, 0x6806, 0xa005, 0x00c0, 0x1964,
+ 0x6803, 0x0000, 0x0078, 0x196e, 0x6400, 0x781c, 0x2060, 0x6402,
+ 0xa486, 0x0000, 0x00c0, 0x196e, 0x2c00, 0x6802, 0x2560, 0x1078,
+ 0x1903, 0x601b, 0x0005, 0x6023, 0x0020, 0x1078, 0x1a14, 0x6810,
+ 0x8001, 0x6812, 0x2001, 0xffff, 0xa005, 0x007c, 0x2039, 0x0000,
+ 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078, 0x18c1,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x1986, 0xa7bc, 0xff00, 0x873f,
+ 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1986, 0x007c, 0x2061,
+ 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x19a8, 0x2091, 0x8000,
+ 0x78d4, 0x78d7, 0x0000, 0x2091, 0x8001, 0xa005, 0x00c0, 0x19a9,
+ 0x007c, 0xa08c, 0xfff0, 0x0040, 0x19af, 0x1078, 0x1eac, 0x0079,
+ 0x19b1, 0x19c1, 0x19c3, 0x19c9, 0x19cd, 0x19c1, 0x19d1, 0x19c1,
+ 0x19d8, 0x19dc, 0x19e0, 0x1a0a, 0x1a0e, 0x19c1, 0x19c1, 0x19c1,
+ 0x19c1, 0x1078, 0x1eac, 0x1078, 0x197e, 0x2001, 0x8001, 0x0078,
+ 0x1276, 0x2001, 0x8003, 0x0078, 0x1276, 0x2001, 0x8004, 0x0078,
+ 0x1276, 0x1078, 0x197e, 0x2001, 0x8006, 0x007c, 0x0078, 0x1276,
+ 0x2001, 0x8008, 0x0078, 0x1276, 0x2001, 0x8009, 0x0078, 0x1276,
+ 0x2091, 0x8000, 0x2069, 0x3940, 0x6800, 0xa086, 0x0000, 0x0040,
+ 0x19ee, 0x2091, 0x8001, 0x78d7, 0x0009, 0x007c, 0x68b4, 0xa0bc,
+ 0xff00, 0x2091, 0x8000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051,
+ 0x0010, 0x1078, 0x18c1, 0x8738, 0xa784, 0x0007, 0x00c0, 0x19f9,
+ 0x2001, 0x800a, 0x0078, 0x1276, 0x2001, 0x04fd, 0x2004, 0xa086,
+ 0x0004, 0x007c, 0x2001, 0x800c, 0x0078, 0x1276, 0x1078, 0x197e,
+ 0x2001, 0x800d, 0x0078, 0x1276, 0x6004, 0x6086, 0x2c08, 0x2063,
+ 0x0000, 0x787c, 0x8000, 0x787e, 0x7880, 0xa005, 0x7982, 0x0040,
+ 0x1a24, 0x2c02, 0x0078, 0x1a25, 0x7986, 0x007c, 0x0c7e, 0x2061,
+ 0x3900, 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x607c, 0x8000,
+ 0x607e, 0x6080, 0xa005, 0x6182, 0x0040, 0x1a39, 0x2d02, 0x0078,
+ 0x1a3a, 0x6186, 0x0c7f, 0x007c, 0x1078, 0x1a4d, 0x0040, 0x1a4c,
+ 0x0c7e, 0x609c, 0xa065, 0x0040, 0x1a47, 0x1078, 0x18f6, 0x0c7f,
+ 0x609f, 0x0000, 0x1078, 0x1896, 0x007c, 0x7884, 0xa065, 0x0040,
+ 0x1a5f, 0x2091, 0x8000, 0x787c, 0x8001, 0x787e, 0x2c04, 0x7886,
+ 0xa005, 0x00c0, 0x1a5d, 0x7882, 0x8000, 0x2091, 0x8001, 0x007c,
+ 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, 0x00c8, 0x1a69,
+ 0xa200, 0x0070, 0x1a6d, 0x0078, 0x1a64, 0x8086, 0x818e, 0x007c,
+ 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x1a93, 0xa11a, 0x00c8,
+ 0x1a93, 0x8213, 0x818d, 0x0048, 0x1a84, 0xa11a, 0x00c8, 0x1a85,
+ 0x0070, 0x1a8b, 0x0078, 0x1a79, 0xa11a, 0x2308, 0x8210, 0x0070,
+ 0x1a8b, 0x0078, 0x1a79, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080,
+ 0x007f, 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078,
+ 0x1a8f, 0x798c, 0x70d0, 0x007e, 0x007f, 0xa106, 0x0040, 0x1ae9,
+ 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x1ae9,
+ 0x7008, 0x7208, 0xa206, 0x00c0, 0x1ae9, 0xa286, 0x0008, 0x00c0,
+ 0x1ae9, 0x2071, 0x0010, 0x1078, 0x188d, 0x0040, 0x1ae9, 0x7a94,
+ 0x7b90, 0x7c9c, 0x7d98, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
+ 0x0000, 0x2009, 0x0040, 0x1078, 0x1857, 0x2091, 0x8001, 0x0040,
+ 0x1ae0, 0x1078, 0x1896, 0x78a0, 0x8000, 0x78a2, 0xa086, 0x0002,
+ 0x00c0, 0x1ae9, 0x2091, 0x8000, 0x78d7, 0x0002, 0x78a3, 0x0000,
+ 0x78c0, 0xa085, 0x0003, 0x78c2, 0x2091, 0x8001, 0x0078, 0x1ae9,
+ 0x78a3, 0x0000, 0x1078, 0x1c38, 0x6004, 0xa084, 0x000f, 0x0079,
+ 0x1aee, 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x1afe, 0x1b20,
+ 0x1b46, 0x1afe, 0x1b58, 0x1b0d, 0x1afe, 0x1afe, 0x1afe, 0x1b1a,
+ 0x1b40, 0x1afe, 0x1afe, 0x1afe, 0x1afe, 0x1afe, 0x2039, 0x0400,
+ 0x78d0, 0xa705, 0x78d2, 0x6008, 0xa705, 0x600a, 0x1078, 0x1b96,
+ 0x609c, 0x78ce, 0x1078, 0x1c20, 0x007c, 0x78d0, 0xa084, 0x0100,
+ 0x0040, 0x1b14, 0x0078, 0x1afe, 0x601c, 0xa085, 0x0080, 0x601e,
+ 0x0078, 0x1b27, 0x1078, 0x1a04, 0x00c0, 0x1afe, 0x1078, 0x1c52,
+ 0x78d0, 0xa084, 0x0100, 0x0040, 0x1b27, 0x0078, 0x1afe, 0x78d3,
+ 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff, 0x78c6, 0x8001, 0x609f,
+ 0x0000, 0x0040, 0x1b3d, 0x1078, 0x1b96, 0x0040, 0x1b3d, 0x78d0,
+ 0xa085, 0x0100, 0x78d2, 0x0078, 0x1b3f, 0x1078, 0x1bba, 0x007c,
+ 0x1078, 0x1a04, 0x00c0, 0x1afe, 0x1078, 0x1c4e, 0x78d0, 0xa08c,
+ 0x0e00, 0x00c0, 0x1b4f, 0xa084, 0x0100, 0x00c0, 0x1b51, 0x0078,
+ 0x1afe, 0x1078, 0x1b96, 0x00c0, 0x1b57, 0x1078, 0x1bba, 0x007c,
+ 0x78d0, 0xa084, 0x0100, 0x0040, 0x1b5f, 0x0078, 0x1afe, 0x78d3,
+ 0x0000, 0x6714, 0x20a9, 0x0001, 0x6018, 0xa005, 0x0040, 0x1b7a,
+ 0xa7bc, 0xff00, 0x20a9, 0x0008, 0xa08e, 0x0001, 0x0040, 0x1b7a,
+ 0x2039, 0x0000, 0x20a9, 0x0080, 0xa08e, 0x0002, 0x0040, 0x1b7a,
+ 0x0078, 0x1b93, 0x1078, 0x18b4, 0x2d00, 0xa088, 0x0002, 0x2091,
+ 0x8000, 0x2168, 0x682b, 0x0000, 0x682f, 0x0000, 0x2104, 0xa084,
+ 0xffde, 0x200a, 0x2100, 0xa088, 0x0010, 0x2091, 0x8001, 0x0070,
+ 0x1b93, 0x0078, 0x1b7f, 0x1078, 0x1896, 0x007c, 0x78c8, 0xa06d,
+ 0x00c0, 0x1ba1, 0x2c00, 0x78ca, 0x78ce, 0x609f, 0x0000, 0x0078,
+ 0x1bad, 0x2c00, 0x689e, 0x609f, 0x0000, 0x78ca, 0x2d00, 0x6002,
+ 0x78cc, 0xad06, 0x00c0, 0x1bad, 0x6002, 0x78c4, 0x8001, 0x78c6,
+ 0x00c0, 0x1bb9, 0x78d0, 0xa084, 0x0000, 0x78d2, 0x78cc, 0x2060,
+ 0xa006, 0x007c, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0xc1ff,
+ 0x601e, 0xa184, 0x0060, 0x0040, 0x1bc9, 0x0e7e, 0x1078, 0x330a,
+ 0x0e7f, 0x6596, 0x669a, 0x6714, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6808, 0xa084, 0x0001, 0x0040, 0x1be5, 0x2091, 0x8001, 0x1078,
+ 0x1903, 0x2091, 0x8000, 0x1078, 0x1a14, 0x2091, 0x8001, 0x78cb,
+ 0x0000, 0x78cf, 0x0000, 0x0078, 0x1c1f, 0x6024, 0xa096, 0x0001,
+ 0x00c0, 0x1bec, 0x8000, 0x6026, 0x6a10, 0x6814, 0x2091, 0x8001,
+ 0xa202, 0x0048, 0x1bfb, 0x0040, 0x1bfb, 0x2039, 0x0200, 0x1078,
+ 0x1c20, 0x0078, 0x1c1f, 0x2c08, 0x2091, 0x8000, 0x6800, 0xa065,
+ 0x0040, 0x1c03, 0x6102, 0x6902, 0x00c0, 0x1c07, 0x6906, 0x2160,
+ 0x6003, 0x0000, 0x6810, 0x8000, 0x6812, 0x2091, 0x8001, 0x6808,
+ 0xa08c, 0x0040, 0x0040, 0x1c19, 0xa086, 0x0040, 0x680a, 0x1078,
+ 0x1912, 0x1078, 0x1cf6, 0x78cf, 0x0000, 0x78cb, 0x0000, 0x007c,
+ 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x1a14, 0x2091,
+ 0x8001, 0x78cc, 0xa065, 0x0040, 0x1c33, 0x609c, 0x78ce, 0x609f,
+ 0x0000, 0x0078, 0x1c23, 0x78cb, 0x0000, 0x78cf, 0x0000, 0x007c,
+ 0x7988, 0x788c, 0x8000, 0xa10a, 0x00c8, 0x1c3f, 0xa006, 0x788e,
+ 0x70d2, 0x7804, 0xa005, 0x0040, 0x1c4d, 0x8001, 0x7806, 0x00c0,
+ 0x1c4d, 0x0068, 0x1c4d, 0x2091, 0x4080, 0x007c, 0x2039, 0x1c66,
+ 0x0078, 0x1c54, 0x2039, 0x1c6c, 0x2704, 0xa005, 0x0040, 0x1c65,
+ 0xac00, 0x2068, 0x6b08, 0x6c0c, 0x6910, 0x6a14, 0x690a, 0x6a0e,
+ 0x6b12, 0x6c16, 0x8738, 0x0078, 0x1c54, 0x007c, 0x0003, 0x0009,
+ 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, 0x0068,
+ 0x1c87, 0x2029, 0x0000, 0x7884, 0xa065, 0x0040, 0x1c82, 0x1078,
+ 0x1c88, 0x0040, 0x1c82, 0x1078, 0x1c99, 0x00c0, 0x1c82, 0x8528,
+ 0x0078, 0x1c73, 0x85ff, 0x0040, 0x1c87, 0x2091, 0x4080, 0x007c,
+ 0x7ba4, 0x79a8, 0x70d4, 0x007e, 0x007f, 0xa102, 0x00c0, 0x1c93,
+ 0x2300, 0xa005, 0x007c, 0x0048, 0x1c97, 0xa302, 0x007c, 0x8002,
+ 0x007c, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0,
+ 0x1cdd, 0x7008, 0x7208, 0xa206, 0x00c0, 0x1cdd, 0xa286, 0x0008,
+ 0x00c0, 0x1cdd, 0x2071, 0x0010, 0x1078, 0x1ce2, 0x2009, 0x001c,
+ 0x6028, 0xa005, 0x0040, 0x1cb6, 0x2009, 0x0040, 0x1078, 0x181d,
+ 0x0040, 0x1ccf, 0x78bc, 0x8000, 0x78be, 0xa086, 0x0002, 0x00c0,
+ 0x1cdd, 0x2091, 0x8000, 0x78d7, 0x0003, 0x78bf, 0x0000, 0x78c0,
+ 0xa085, 0x0300, 0x78c2, 0x2091, 0x8001, 0x0078, 0x1cdd, 0x78bf,
+ 0x0000, 0x1078, 0x1a3c, 0x79a4, 0x78a8, 0x8000, 0xa10a, 0x00c8,
+ 0x1cda, 0xa006, 0x78aa, 0x70d6, 0xa006, 0x2071, 0x0010, 0x2091,
+ 0x8001, 0x007c, 0x8107, 0x8004, 0x8004, 0x7ab0, 0x7bac, 0x7cb8,
+ 0x7db4, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
+ 0x007c, 0x2009, 0x3968, 0x2091, 0x8000, 0x200a, 0x0f7e, 0x2079,
+ 0x0100, 0x2009, 0x3940, 0x2091, 0x8000, 0x2104, 0xa086, 0x0000,
+ 0x00c0, 0x1d11, 0x2009, 0x3912, 0x2104, 0xa005, 0x00c0, 0x1d11,
+ 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1d11, 0x0018, 0x1d11, 0x781b,
+ 0x0045, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300,
+ 0x2071, 0x3940, 0x2079, 0x0100, 0x784b, 0x000f, 0x2019, 0x3205,
+ 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040, 0x1d2f, 0x789a, 0x8318,
+ 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318, 0x0078, 0x1d22, 0x789b,
+ 0x0020, 0x20a9, 0x0010, 0x78af, 0x0000, 0x78af, 0x0020, 0x0070,
+ 0x1d3b, 0x0078, 0x1d33, 0x7003, 0x0000, 0x1078, 0x1e40, 0x7004,
+ 0xa084, 0x000f, 0xa085, 0x6280, 0x7806, 0x780f, 0x9200, 0x7843,
+ 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008, 0x7047, 0x397f, 0x7043,
+ 0x0000, 0x127f, 0x2000, 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101,
+ 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x1078, 0x1e40, 0x007c,
+ 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b, 0x0070, 0x1d69, 0x0078,
+ 0x1d64, 0xa18c, 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012,
+ 0x007c, 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x0070, 0x1d7a,
+ 0x0078, 0x1d75, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205,
+ 0x200a, 0x007c, 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070,
+ 0x1d8b, 0x0078, 0x1d86, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff,
+ 0xa105, 0x2012, 0x007c, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf,
+ 0xa105, 0x2012, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e,
+ 0x2061, 0x0100, 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103,
+ 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4,
+ 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080,
+ 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020,
+ 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e,
+ 0x2061, 0x0100, 0x609a, 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae,
+ 0x2018, 0x0c7f, 0x007c, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040,
+ 0x1e1c, 0x2061, 0x4380, 0x1078, 0x1e22, 0x0040, 0x1e06, 0x20a9,
+ 0x0000, 0x2061, 0x4280, 0x0c7e, 0x1078, 0x1e22, 0x0040, 0x1df0,
+ 0x0c7f, 0x8c60, 0x0070, 0x1dee, 0x0078, 0x1de3, 0x0078, 0x1e1c,
+ 0x007f, 0xa082, 0x4280, 0x2071, 0x3940, 0x70ba, 0x6020, 0xa085,
+ 0x0800, 0x6022, 0x2091, 0x8001, 0x71b6, 0x2001, 0x0004, 0x70a2,
+ 0x70c7, 0x000f, 0x1078, 0x1cf1, 0x0078, 0x1e18, 0x2071, 0x3940,
+ 0x6020, 0xa085, 0x0800, 0x6022, 0x2091, 0x8001, 0x71b6, 0x2c00,
+ 0x70be, 0x2001, 0x0006, 0x70a2, 0x70c7, 0x000f, 0x1078, 0x1cf1,
+ 0x2001, 0x0000, 0x0078, 0x1e1e, 0x2001, 0x0001, 0xa005, 0x0e7f,
+ 0x0c7f, 0x007c, 0x2091, 0x8000, 0x2c04, 0xa005, 0x0040, 0x1e3b,
+ 0x2060, 0x6010, 0xa306, 0x00c0, 0x1e38, 0x600c, 0xa206, 0x00c0,
+ 0x1e38, 0x6014, 0xa106, 0x00c0, 0x1e38, 0xa006, 0x0078, 0x1e3f,
+ 0x6000, 0x0078, 0x1e25, 0xa085, 0x0001, 0x2091, 0x8001, 0x007c,
+ 0x2011, 0x3941, 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204,
+ 0xa084, 0x0100, 0x0040, 0x1e56, 0x2021, 0xff04, 0x2122, 0x810b,
+ 0x810b, 0x810b, 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e,
+ 0x68e4, 0xa08c, 0x0020, 0x0040, 0x1eaa, 0xa084, 0x0006, 0x00c0,
+ 0x1eaa, 0x6014, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
+ 0xa0f0, 0x3a00, 0x7004, 0xa084, 0x000a, 0x00c0, 0x1eaa, 0x7108,
+ 0xa194, 0xff00, 0x0040, 0x1eaa, 0xa18c, 0x00ff, 0x2001, 0x000c,
+ 0xa106, 0x0040, 0x1e91, 0x2001, 0x0012, 0xa106, 0x0040, 0x1e95,
+ 0x2001, 0x0014, 0xa106, 0x0040, 0x1e99, 0x2001, 0x0019, 0xa106,
+ 0x0040, 0x1e9d, 0x2001, 0x0032, 0xa106, 0x0040, 0x1ea1, 0x0078,
+ 0x1ea5, 0x2009, 0x0012, 0x0078, 0x1ea7, 0x2009, 0x0014, 0x0078,
+ 0x1ea7, 0x2009, 0x0019, 0x0078, 0x1ea7, 0x2009, 0x0020, 0x0078,
+ 0x1ea7, 0x2009, 0x003f, 0x0078, 0x1ea7, 0x2011, 0x0000, 0x2100,
+ 0xa205, 0x700a, 0x0e7f, 0x007c, 0x2071, 0x0010, 0x70ca, 0x007f,
+ 0x70c6, 0x70c3, 0x8002, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091,
+ 0x4080, 0x0078, 0x1eb9, 0x107e, 0x007e, 0x127e, 0x2091, 0x2300,
+ 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x2009, 0x3974, 0x78a0, 0x200a,
+ 0x8108, 0x250a, 0x8108, 0x240a, 0x8108, 0x260a, 0x8108, 0x270a,
+ 0xa594, 0x003f, 0xa484, 0x4000, 0x0040, 0x1edc, 0xa784, 0x007c,
+ 0x00c0, 0x318f, 0x1078, 0x1eac, 0xa49c, 0x000f, 0xa382, 0x0004,
+ 0x0050, 0x1ee4, 0x1078, 0x1eac, 0x8507, 0xa084, 0x000f, 0x0079,
+ 0x1ee9, 0x236e, 0x240d, 0x242e, 0x2699, 0x28dd, 0x293b, 0x2984,
+ 0x29f0, 0x2a8d, 0x2b1a, 0x1f11, 0x1ef9, 0x21c3, 0x2288, 0x28bc,
+ 0x1ef9, 0x1078, 0x1eac, 0x0018, 0x1ec0, 0x127f, 0x2091, 0x8001,
+ 0x007f, 0x107f, 0x007c, 0x7003, 0x0000, 0x703f, 0x0000, 0x7030,
+ 0xa005, 0x0040, 0x1f0d, 0x7033, 0x0000, 0x1078, 0x316a, 0x0018,
+ 0x1ec0, 0x2009, 0x390f, 0x200b, 0x0000, 0x705c, 0xa005, 0x00c0,
+ 0x1fe2, 0x70a0, 0xa084, 0x0007, 0x0079, 0x1f1e, 0x2005, 0x1f26,
+ 0x1f34, 0x1f51, 0x1f73, 0x1fc0, 0x1f99, 0x1f26, 0x7808, 0xa084,
+ 0xfffd, 0x780a, 0x2009, 0x0047, 0x1078, 0x27c1, 0x00c0, 0x1f32,
+ 0x7003, 0x0004, 0x0078, 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f4f,
+ 0x70b4, 0x8007, 0x7882, 0x789b, 0x0010, 0x78ab, 0x000c, 0x789b,
+ 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 0x2009, 0x00fb, 0x1078,
+ 0x27bf, 0x00c0, 0x1f4f, 0x7003, 0x0004, 0x70c7, 0x000f, 0x0078,
+ 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f71, 0x71b4, 0x8107, 0x7882,
+ 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
+ 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
+ 0x00fb, 0x1078, 0x27bf, 0x00c0, 0x1f71, 0x7003, 0x0004, 0x70c7,
+ 0x000f, 0x0078, 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f97, 0x71b4,
+ 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0,
+ 0x79aa, 0x78ab, 0x0020, 0x71b8, 0x79aa, 0x78ab, 0x000d, 0x789b,
+ 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 0x2009, 0x00fb, 0x1078,
+ 0x27bf, 0x00c0, 0x1f97, 0x7003, 0x0004, 0x70c7, 0x000f, 0x0078,
+ 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1fbe, 0x71b4, 0x8107, 0x7882,
+ 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
+ 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
+ 0x00fb, 0x1078, 0x27bf, 0x00c0, 0x1fbe, 0x70bc, 0x70bf, 0x0000,
+ 0x2068, 0x703e, 0x7003, 0x0002, 0x70c7, 0x000f, 0x0078, 0x1efb,
+ 0x1078, 0x3151, 0x00c0, 0x1efb, 0x70bc, 0x2068, 0x1078, 0x31f3,
+ 0x789b, 0x0010, 0x6814, 0xa084, 0x0007, 0xa085, 0x0080, 0x007e,
+ 0x007f, 0x78aa, 0x6e1c, 0x067e, 0x067f, 0x2041, 0x0001, 0x70c0,
+ 0xa084, 0x0400, 0x2001, 0x0004, 0x0040, 0x1fe0, 0x2001, 0x0006,
+ 0x0078, 0x20e1, 0x1078, 0x3151, 0x00c0, 0x1efb, 0x789b, 0x0010,
+ 0x705c, 0x2068, 0x1078, 0x31f3, 0x6f14, 0x1078, 0x3099, 0x6008,
+ 0xa085, 0x0010, 0x600a, 0xad80, 0x0009, 0x2003, 0x0005, 0x6814,
+ 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x2031, 0x0020, 0x2041,
+ 0x0001, 0x2001, 0x0003, 0x0078, 0x20e1, 0x0018, 0x1ec0, 0x7440,
+ 0xa485, 0x0000, 0x0040, 0x201f, 0xa080, 0x3980, 0x2030, 0x7144,
+ 0x8108, 0xa12a, 0x0048, 0x2016, 0x2009, 0x3980, 0x2164, 0x6504,
+ 0x85ff, 0x00c0, 0x202c, 0x8421, 0x00c0, 0x2010, 0x7146, 0x7003,
+ 0x0000, 0x703f, 0x0000, 0x0078, 0x1efb, 0x7640, 0xa6b0, 0x3980,
+ 0x7144, 0x2600, 0x0078, 0x201b, 0x7146, 0x2568, 0x2558, 0x753e,
+ 0x2c50, 0x6708, 0x7736, 0xa784, 0x013f, 0x0040, 0x2059, 0xa784,
+ 0x0021, 0x00c0, 0x2029, 0xa784, 0x0002, 0x0040, 0x2046, 0xa784,
+ 0x0004, 0x0040, 0x2029, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008,
+ 0x00c0, 0x2029, 0xa784, 0x0010, 0x00c0, 0x2029, 0xa784, 0x0100,
+ 0x0040, 0x2059, 0x6018, 0xa005, 0x00c0, 0x2029, 0xa7bc, 0xfeff,
+ 0x670a, 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e, 0x6118, 0x0040,
+ 0x2069, 0x601c, 0xa102, 0x0048, 0x206c, 0x0040, 0x206c, 0x0078,
+ 0x2025, 0x81ff, 0x00c0, 0x2025, 0xa784, 0x0080, 0x00c0, 0x2072,
+ 0x700c, 0x6022, 0x1078, 0x31f3, 0x0018, 0x1ec0, 0x789b, 0x0010,
+ 0xa046, 0x1078, 0x3151, 0x00c0, 0x1efb, 0x6b14, 0xa39c, 0x0007,
+ 0xa39d, 0x00c0, 0x704c, 0xa084, 0x8000, 0x0040, 0x208b, 0xa684,
+ 0x0001, 0x0040, 0x208d, 0xa39c, 0xffbf, 0xa684, 0x0010, 0x0040,
+ 0x2093, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684, 0x000e, 0x00c0,
+ 0x209e, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x20df, 0x714c, 0xa18c,
+ 0x0800, 0x0040, 0x2cfc, 0x2011, 0x0021, 0x8004, 0x8004, 0x0048,
+ 0x20b5, 0x2011, 0x0022, 0x8004, 0x0048, 0x20b5, 0x2011, 0x0020,
+ 0x8004, 0x0048, 0x20b5, 0x0040, 0x20df, 0x7aaa, 0x8840, 0x1078,
+ 0x316a, 0x6a14, 0x610c, 0x8108, 0xa18c, 0x00ff, 0xa1e0, 0x4280,
+ 0x2c64, 0x8cff, 0x0040, 0x20d6, 0x6014, 0xa206, 0x00c0, 0x20c0,
+ 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x20bb, 0x0c7e, 0x2a60, 0x6008,
+ 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, 0x2005, 0x1078, 0x3151,
+ 0x00c0, 0x1efb, 0x2a60, 0x610e, 0x79aa, 0x8840, 0x712e, 0x2001,
+ 0x0001, 0x007e, 0x7150, 0xa184, 0x0018, 0x0040, 0x20fc, 0xa184,
+ 0x0010, 0x0040, 0x20ef, 0x1078, 0x2ee3, 0x00c0, 0x211f, 0xa184,
+ 0x0008, 0x0040, 0x20fc, 0x69a0, 0xa184, 0x0600, 0x00c0, 0x20fc,
+ 0x1078, 0x2ddf, 0x0078, 0x211f, 0x69a0, 0xa184, 0x0800, 0x0040,
+ 0x2113, 0x0c7e, 0x027e, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002,
+ 0x6104, 0xa18d, 0x0010, 0x6106, 0x027f, 0x0c7f, 0x1078, 0x2ee3,
+ 0x00c0, 0x211f, 0x69a0, 0xa184, 0x0200, 0x0040, 0x211b, 0x1078,
+ 0x2e2e, 0x0078, 0x211f, 0xa184, 0x0400, 0x00c0, 0x20f8, 0x69a0,
+ 0xa184, 0x1000, 0x0040, 0x212a, 0x6914, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x1da7, 0x007f, 0x7002, 0xa68c, 0x00e0, 0xa684, 0x0060,
+ 0x0040, 0x2138, 0xa086, 0x0060, 0x00c0, 0x2138, 0xa18d, 0x4000,
+ 0x88ff, 0x0040, 0x213d, 0xa18d, 0x0004, 0x795a, 0x69b6, 0x789b,
+ 0x0060, 0x2800, 0x78aa, 0x789b, 0x0061, 0x6818, 0xa08d, 0x8000,
+ 0xa084, 0x7fff, 0x691a, 0xa68c, 0x0080, 0x0040, 0x215c, 0x70cb,
+ 0x0000, 0xa08a, 0x000d, 0x0050, 0x215a, 0xa08a, 0x000c, 0x71ca,
+ 0x2001, 0x000c, 0x800c, 0x71ce, 0x78aa, 0x8008, 0x810c, 0x0040,
+ 0x2d07, 0xa18c, 0x00f8, 0x00c0, 0x2d07, 0x157e, 0x137e, 0x147e,
+ 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b,
+ 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814, 0x8007, 0x7882,
+ 0x6d94, 0x7dd6, 0x7dde, 0x6e98, 0x7ed2, 0x7eda, 0x7830, 0xa084,
+ 0x00c0, 0x00c0, 0x2185, 0x0098, 0x218d, 0x6008, 0xa084, 0xffef,
+ 0x600a, 0x1078, 0x316a, 0x0078, 0x1f03, 0x7200, 0xa284, 0x0007,
+ 0xa086, 0x0001, 0x00c0, 0x219a, 0x781b, 0x004a, 0x1078, 0x316a,
+ 0x0078, 0x21ab, 0x6ab4, 0xa295, 0x2000, 0x7a5a, 0x781b, 0x004a,
+ 0x1078, 0x316a, 0x7200, 0x2500, 0xa605, 0x0040, 0x21ab, 0xa284,
+ 0x0007, 0x1079, 0x21b9, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0,
+ 0x1efb, 0x6018, 0x8000, 0x601a, 0xad80, 0x0009, 0x7032, 0x0078,
+ 0x1efb, 0x21c1, 0x3571, 0x3571, 0x3560, 0x3571, 0x21c1, 0x3560,
+ 0x21c1, 0x1078, 0x1eac, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0f7e,
+ 0x2079, 0x3900, 0x78c0, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x21e9,
+ 0x70a0, 0xa086, 0x0001, 0x00c0, 0x21d8, 0x70a2, 0x0078, 0x226c,
+ 0x70a0, 0xa086, 0x0005, 0x00c0, 0x21e7, 0x70bc, 0x2068, 0x681b,
+ 0x0004, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x70a3,
+ 0x0000, 0x157e, 0x2011, 0x0004, 0x71a0, 0xa186, 0x0001, 0x0040,
+ 0x2207, 0xa186, 0x0007, 0x00c0, 0x21fb, 0x2009, 0x3935, 0x200b,
+ 0x0005, 0x0078, 0x2207, 0x2009, 0x3913, 0x2104, 0x2009, 0x3912,
+ 0x200a, 0x2009, 0x3935, 0x200b, 0x0001, 0x0078, 0x2209, 0x70a3,
+ 0x0000, 0x1078, 0x32f5, 0x20a9, 0x0010, 0x2039, 0x0000, 0x1078,
+ 0x2f9a, 0xa7b8, 0x0100, 0x0070, 0x2217, 0x0078, 0x220f, 0x7000,
+ 0x0079, 0x221a, 0x2248, 0x2231, 0x2231, 0x2224, 0x2248, 0x2248,
+ 0x2248, 0x2222, 0x1078, 0x1eac, 0x2021, 0x3957, 0x2404, 0xa005,
+ 0x0040, 0x2248, 0xad06, 0x00c0, 0x2231, 0x6800, 0x2022, 0x0078,
+ 0x2241, 0x6820, 0xa084, 0x0001, 0x00c0, 0x223d, 0x6f14, 0x1078,
+ 0x3099, 0x1078, 0x2cc9, 0x0078, 0x2241, 0x7054, 0x2060, 0x6800,
+ 0x6002, 0x6a1a, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078, 0x1a26,
+ 0x2021, 0x4380, 0x1078, 0x2272, 0x2021, 0x3957, 0x1078, 0x2272,
+ 0x20a9, 0x0000, 0x2021, 0x4280, 0x1078, 0x2272, 0x8420, 0x0070,
+ 0x225b, 0x0078, 0x2254, 0x20a9, 0x0080, 0x2061, 0x3a80, 0x6018,
+ 0x6110, 0xa102, 0x6012, 0x601b, 0x0000, 0xace0, 0x0010, 0x0070,
+ 0x226b, 0x0078, 0x225f, 0x157f, 0x7003, 0x0000, 0x703f, 0x0000,
+ 0x0078, 0x1efb, 0x047e, 0x2404, 0xa005, 0x0040, 0x2284, 0x2068,
+ 0x6800, 0x007e, 0x6a1a, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078,
+ 0x1a26, 0x007f, 0x0078, 0x2274, 0x047f, 0x2023, 0x0000, 0x007c,
+ 0xa282, 0x0003, 0x0050, 0x228e, 0x1078, 0x1eac, 0x2300, 0x0079,
+ 0x2291, 0x2294, 0x2311, 0x232e, 0xa282, 0x0002, 0x0040, 0x229a,
+ 0x1078, 0x1eac, 0x70a0, 0x70a3, 0x0000, 0x70c7, 0x0000, 0x0079,
+ 0x22a1, 0x22a9, 0x22a9, 0x22ab, 0x22e9, 0x2d0d, 0x22a9, 0x22e9,
+ 0x22a9, 0x1078, 0x1eac, 0x77b4, 0x1078, 0x2f9a, 0x77b4, 0xa7bc,
+ 0x0f00, 0x1078, 0x3099, 0x6018, 0xa005, 0x0040, 0x22e0, 0x2021,
+ 0x4380, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x0040,
+ 0x22e0, 0x157e, 0x20a9, 0x0000, 0x2021, 0x4280, 0x047e, 0x2009,
+ 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x047f, 0x0040, 0x22d5,
+ 0x8420, 0x0070, 0x22d5, 0x0078, 0x22c6, 0x157f, 0x2021, 0x3957,
+ 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x0040, 0x22e0,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x22b1, 0x0078, 0x1f03, 0x0078,
+ 0x1f03, 0x77b4, 0x1078, 0x3099, 0x6018, 0xa005, 0x0040, 0x230f,
+ 0x2021, 0x4380, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x2349,
+ 0x0040, 0x230f, 0x157e, 0x20a9, 0x0000, 0x2021, 0x4280, 0x047e,
+ 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x2349, 0x047f, 0x0040,
+ 0x230e, 0x8420, 0x0070, 0x230e, 0x0078, 0x22ff, 0x157f, 0x0078,
+ 0x1f03, 0x2200, 0x0079, 0x2314, 0x2317, 0x2319, 0x2319, 0x1078,
+ 0x1eac, 0x2009, 0x0012, 0x70a0, 0xa086, 0x0002, 0x0040, 0x2322,
+ 0x2009, 0x000e, 0x6818, 0xa084, 0x8000, 0x0040, 0x2328, 0x691a,
+ 0x70a3, 0x0000, 0x70a7, 0x0001, 0x0078, 0x311c, 0x2200, 0x0079,
+ 0x2331, 0x2336, 0x2319, 0x2334, 0x1078, 0x1eac, 0x1078, 0x27ce,
+ 0x7000, 0xa086, 0x0001, 0x00c0, 0x2c9f, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x2c9f, 0x0078,
+ 0x2005, 0x2404, 0xa005, 0x0040, 0x236a, 0x2068, 0x2d04, 0x007e,
+ 0x6814, 0xa706, 0x0040, 0x2358, 0x2d20, 0x007f, 0x0078, 0x234a,
+ 0x007f, 0x2022, 0x691a, 0x6820, 0xa205, 0x6822, 0x1078, 0x1a26,
+ 0x6010, 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078,
+ 0x2cdf, 0x007c, 0xa085, 0x0001, 0x0078, 0x2369, 0x2300, 0x0079,
+ 0x2371, 0x2376, 0x2374, 0x23c2, 0x1078, 0x1eac, 0x78e4, 0xa005,
+ 0x00d0, 0x238a, 0x0018, 0x238a, 0xa084, 0x0007, 0x0079, 0x2380,
+ 0x239b, 0x23a8, 0x238e, 0x2388, 0x3144, 0x3144, 0x2388, 0x23b5,
+ 0x1078, 0x1eac, 0x2001, 0x0003, 0x0078, 0x26ad, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2395, 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b,
+ 0x0053, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040, 0x23a2,
+ 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b, 0x00de, 0x0078, 0x1efb,
+ 0x6818, 0xa084, 0x8000, 0x0040, 0x23af, 0x681b, 0x001d, 0x1078,
+ 0x2f7d, 0x781b, 0x00e5, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000,
+ 0x0040, 0x23bc, 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b, 0x009c,
+ 0x0078, 0x1efb, 0xa584, 0x000f, 0x00c0, 0x23e1, 0x1078, 0x27ce,
+ 0x7000, 0x0079, 0x23cb, 0x23d3, 0x23d5, 0x23d3, 0x2c9f, 0x2c9f,
+ 0x2c9f, 0x2c9f, 0x23d3, 0x1078, 0x1eac, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x2c9f, 0x0078,
+ 0x2005, 0x79e4, 0xa005, 0x00d0, 0x238a, 0x0018, 0x238a, 0xa184,
+ 0x0007, 0x0079, 0x23eb, 0x23fb, 0x2401, 0x23f5, 0x23f3, 0x3144,
+ 0x3144, 0x23f3, 0x313c, 0x1078, 0x1eac, 0x1078, 0x2f85, 0x781b,
+ 0x0053, 0x0078, 0x1efb, 0x1078, 0x2f85, 0x781b, 0x00de, 0x0078,
+ 0x1efb, 0x1078, 0x2f85, 0x781b, 0x00e5, 0x0078, 0x1efb, 0x1078,
+ 0x2f85, 0x781b, 0x009c, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2410,
+ 0x2415, 0x2413, 0x2417, 0x1078, 0x1eac, 0x0078, 0x29f0, 0x681b,
+ 0x0008, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x29f0,
+ 0xa184, 0x0007, 0x0079, 0x2424, 0x242c, 0x2401, 0x238e, 0x311c,
+ 0x3144, 0x3144, 0x242c, 0x313c, 0x1078, 0x1eac, 0xa282, 0x0005,
+ 0x0050, 0x2434, 0x1078, 0x1eac, 0x2300, 0x0079, 0x2437, 0x243a,
+ 0x265e, 0x266a, 0x2200, 0x0079, 0x243d, 0x2457, 0x2444, 0x2457,
+ 0x2442, 0x2643, 0x1078, 0x1eac, 0x789b, 0x0018, 0x78a8, 0xa084,
+ 0x00ff, 0xa082, 0x0020, 0x0048, 0x2f69, 0xa08a, 0x0004, 0x00c8,
+ 0x2f69, 0x0079, 0x2453, 0x2f69, 0x2f69, 0x2f69, 0x2f23, 0x789b,
+ 0x0018, 0x79a8, 0xa184, 0x0080, 0x0040, 0x246c, 0xa184, 0x0018,
+ 0x0040, 0x2468, 0x0078, 0x2f69, 0x7000, 0xa005, 0x00c0, 0x2462,
+ 0x2011, 0x0004, 0x0078, 0x2b28, 0xa184, 0x00ff, 0xa08a, 0x0010,
+ 0x00c8, 0x2f69, 0x0079, 0x2474, 0x2486, 0x2484, 0x249e, 0x24a2,
+ 0x255a, 0x2f69, 0x2f69, 0x255c, 0x2f69, 0x2f69, 0x263f, 0x263f,
+ 0x2f69, 0x2f69, 0x2f69, 0x2641, 0x1078, 0x1eac, 0xa684, 0x1000,
+ 0x0040, 0x2493, 0x2001, 0x0300, 0x8000, 0x8000, 0x783a, 0x781b,
+ 0x0099, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040, 0x249c,
+ 0x681b, 0x001d, 0x0078, 0x248a, 0x0078, 0x311c, 0x681b, 0x001d,
+ 0x0078, 0x2f75, 0x6920, 0xa184, 0x8000, 0x00c0, 0x24ae, 0x68af,
+ 0x0000, 0x68b3, 0x0000, 0xa18d, 0x8000, 0x6922, 0xa684, 0x1800,
+ 0x00c0, 0x24ed, 0x6820, 0xa084, 0x0001, 0x00c0, 0x24f3, 0x6818,
+ 0xa086, 0x0008, 0x00c0, 0x24be, 0x681b, 0x0000, 0xa684, 0x0400,
+ 0x0040, 0x2556, 0xa684, 0x0080, 0x0040, 0x24e9, 0x70cb, 0x0000,
+ 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, 0x0050, 0x24e9, 0xa08a,
+ 0x000c, 0x71ca, 0x2001, 0x000c, 0x800c, 0x71ce, 0x789b, 0x0061,
+ 0x78aa, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
+ 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
+ 0x157f, 0x781b, 0x0056, 0x0078, 0x1efb, 0xa684, 0x1000, 0x0040,
+ 0x24f3, 0x0078, 0x1efb, 0xa684, 0x0060, 0x0040, 0x2552, 0xa684,
+ 0x0800, 0x0040, 0x2552, 0xa684, 0x8000, 0x00c0, 0x2503, 0x69b0,
+ 0x6aac, 0x0078, 0x251d, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb6, 0x789b,
+ 0x0074, 0x7aac, 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2510, 0x8000,
+ 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302,
+ 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0xa684, 0x4000, 0x0040,
+ 0x2525, 0xa6b4, 0xbfff, 0x7e5a, 0x6eb6, 0xa006, 0x1078, 0x362f,
+ 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, 0x2534,
+ 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x6ba6, 0x7bd6,
+ 0x2300, 0xa405, 0x00c0, 0x2544, 0xa6b5, 0x4000, 0x7e5a, 0x6eb6,
+ 0x781b, 0x0065, 0x0078, 0x1efb, 0x781b, 0x0065, 0x2200, 0xa115,
+ 0x00c0, 0x254e, 0x1078, 0x3571, 0x0078, 0x1efb, 0x1078, 0x35a6,
+ 0x0078, 0x1efb, 0x781b, 0x0068, 0x0078, 0x1efb, 0x781b, 0x0056,
+ 0x0078, 0x1efb, 0x1078, 0x1eac, 0x0078, 0x25b1, 0x6920, 0xa184,
+ 0x0100, 0x0040, 0x2570, 0xa18c, 0xfeff, 0x6922, 0x0c7e, 0x7048,
+ 0x2060, 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x25a0,
+ 0xa184, 0x0200, 0x0040, 0x25a0, 0xa18c, 0xfdff, 0x6922, 0x0c7e,
+ 0x7048, 0x2060, 0x6004, 0xa084, 0xffef, 0x6006, 0x2008, 0x2c48,
+ 0x0c7f, 0xa184, 0x0008, 0x0040, 0x25a0, 0x1078, 0x3095, 0x1078,
+ 0x2ddf, 0x88ff, 0x0040, 0x25a0, 0x789b, 0x0060, 0x2800, 0x78aa,
+ 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x259c,
+ 0x781b, 0x0053, 0x0078, 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb,
+ 0x7e58, 0xa684, 0x0400, 0x00c0, 0x25a9, 0x781b, 0x0056, 0x0078,
+ 0x1efb, 0x781b, 0x0068, 0x0078, 0x1efb, 0x0078, 0x2f6f, 0x0078,
+ 0x2f6f, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x0040, 0x25af,
+ 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0,
+ 0x25d4, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x25cc,
+ 0x0048, 0x25cc, 0x0078, 0x25ce, 0x0078, 0x255e, 0x24a8, 0x7aa8,
+ 0x00f0, 0x25ce, 0x0078, 0x25ba, 0xa284, 0x00f0, 0xa086, 0x0020,
+ 0x00c0, 0x2630, 0x8318, 0x8318, 0x2300, 0xa102, 0x0040, 0x25e4,
+ 0x0048, 0x25e4, 0x0078, 0x262d, 0xa286, 0x0023, 0x0040, 0x25af,
+ 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1, 0xa085,
+ 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085, 0x0010, 0x600a, 0x0c7e,
+ 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0010,
+ 0x0040, 0x2608, 0x1078, 0x3095, 0x1078, 0x2ee3, 0x0078, 0x2617,
+ 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xa184,
+ 0x0008, 0x0040, 0x25a0, 0x1078, 0x3095, 0x1078, 0x2ddf, 0x88ff,
+ 0x0040, 0x25a0, 0x789b, 0x0060, 0x2800, 0x78aa, 0xa6b5, 0x0004,
+ 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2629, 0x781b, 0x0053, 0x0078,
+ 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb, 0x7aa8, 0x0078, 0x25ba,
+ 0x8318, 0x2300, 0xa102, 0x0040, 0x2639, 0x0048, 0x2639, 0x0078,
+ 0x25ba, 0xa284, 0x0080, 0x00c0, 0x2f75, 0x0078, 0x2f6f, 0x0078,
+ 0x2f75, 0x0078, 0x2f69, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff,
+ 0xa08e, 0x0001, 0x0040, 0x264e, 0x1078, 0x1eac, 0x7aa8, 0xa294,
+ 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x2f69,
+ 0x0079, 0x265a, 0x2f69, 0x2d32, 0x2f69, 0x2e7e, 0xa282, 0x0000,
+ 0x00c0, 0x2664, 0x1078, 0x1eac, 0x1078, 0x2f7d, 0x781b, 0x0067,
+ 0x0078, 0x1efb, 0xa282, 0x0003, 0x00c0, 0x2670, 0x1078, 0x1eac,
+ 0xa484, 0x8000, 0x00c0, 0x2693, 0x70a0, 0xa005, 0x0040, 0x267a,
+ 0x1078, 0x1eac, 0x6f14, 0x77b6, 0xa7bc, 0x0f00, 0x1078, 0x3099,
+ 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x0007, 0x00c0,
+ 0x267e, 0x1078, 0x2f81, 0x70a3, 0x0002, 0x2009, 0x3935, 0x200b,
+ 0x0009, 0x0078, 0x2695, 0x1078, 0x2f8d, 0x781b, 0x0067, 0x0078,
+ 0x1efb, 0xa282, 0x0004, 0x0050, 0x269f, 0x1078, 0x1eac, 0x2300,
+ 0x0079, 0x26a2, 0x26a5, 0x2781, 0x27a9, 0xa286, 0x0003, 0x0040,
+ 0x26ab, 0x1078, 0x1eac, 0x2001, 0x0000, 0x703a, 0x7000, 0xa084,
+ 0x0007, 0x0079, 0x26b3, 0x26bb, 0x26bd, 0x26bd, 0x2871, 0x28a2,
+ 0x1f03, 0x28a2, 0x26bb, 0x1078, 0x1eac, 0xa684, 0x1000, 0x00c0,
+ 0x26c5, 0x1078, 0x32f5, 0x0040, 0x275b, 0x7868, 0xa08c, 0x00ff,
+ 0x0040, 0x270d, 0xa186, 0x0008, 0x00c0, 0x26dc, 0x1078, 0x2cdf,
+ 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x270d,
+ 0x1078, 0x32f5, 0x0078, 0x26f4, 0xa186, 0x0028, 0x00c0, 0x270d,
+ 0x1078, 0x32f5, 0x6008, 0xa084, 0xffef, 0x600a, 0x6018, 0xa005,
+ 0x0040, 0x26f4, 0x8001, 0x601a, 0xa005, 0x0040, 0x26f4, 0x8001,
+ 0xa005, 0x0040, 0x26f4, 0x601e, 0x6820, 0xa084, 0x0001, 0x0040,
+ 0x1f03, 0x6820, 0xa084, 0xfffe, 0x6822, 0x7054, 0x0c7e, 0x2060,
+ 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, 0x2d00, 0x00c0,
+ 0x270a, 0x6002, 0x6006, 0x0078, 0x1f03, 0x017e, 0x1078, 0x27ce,
+ 0x017f, 0xa684, 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14, 0x81ff,
+ 0x0040, 0x275b, 0xa186, 0x0002, 0x00c0, 0x2753, 0xa684, 0x0800,
+ 0x00c0, 0x272a, 0xa684, 0x0060, 0x0040, 0x272a, 0x78d8, 0x7adc,
+ 0x682e, 0x6a32, 0x6820, 0xa084, 0x0800, 0x00c0, 0x275b, 0x8717,
+ 0xa294, 0x000f, 0x8213, 0x8213, 0x8213, 0xa290, 0x3a00, 0xa290,
+ 0x0000, 0x221c, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012, 0x8211,
+ 0xa384, 0x0400, 0x0040, 0x274d, 0x68a0, 0xa084, 0x0100, 0x00c0,
+ 0x274d, 0x1078, 0x2830, 0x0078, 0x1f03, 0x6008, 0xa085, 0x0002,
+ 0x600a, 0x0078, 0x275b, 0xa186, 0x0018, 0x0040, 0x275b, 0xa186,
+ 0x0014, 0x0040, 0x1f03, 0x6916, 0x6818, 0xa084, 0x8000, 0x0040,
+ 0x2763, 0x7038, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 0x2cd0,
+ 0x1078, 0x2cdf, 0x00c0, 0x2770, 0x6008, 0xa084, 0xffef, 0x600a,
+ 0x6820, 0xa084, 0x0001, 0x00c0, 0x2779, 0x1078, 0x2cc9, 0x0078,
+ 0x277d, 0x7054, 0x2060, 0x6800, 0x6002, 0x1078, 0x1a26, 0x0078,
+ 0x1f03, 0xa282, 0x0004, 0x0048, 0x2787, 0x1078, 0x1eac, 0x2200,
+ 0x0079, 0x278a, 0x2785, 0x278e, 0x2794, 0x278e, 0x1078, 0x2f7d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x7890, 0x8007, 0x8001, 0xa084,
+ 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186,
+ 0x0003, 0x0040, 0x27a5, 0x0078, 0x2f69, 0x781b, 0x0068, 0x0078,
+ 0x1efb, 0x6820, 0xa085, 0x0004, 0x6822, 0x82ff, 0x00c0, 0x27b4,
+ 0x1078, 0x2f7d, 0x0078, 0x27bb, 0x8211, 0x0040, 0x27b9, 0x1078,
+ 0x1eac, 0x1078, 0x2f8d, 0x781b, 0x0067, 0x0078, 0x1efb, 0x1078,
+ 0x316a, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x27cb, 0x0018, 0x27cb,
+ 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060,
+ 0x00c0, 0x27d8, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x282f,
+ 0xa684, 0x0800, 0x00c0, 0x27e8, 0x6998, 0x6a94, 0x692e, 0x6a32,
+ 0x7000, 0xa086, 0x0006, 0x0040, 0x27e7, 0x1078, 0x32f5, 0x007c,
+ 0xa684, 0x0020, 0x0040, 0x2802, 0xa684, 0x4000, 0x0040, 0x27f6,
+ 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x27e0, 0x7038, 0xa005,
+ 0x00c0, 0x27fc, 0x703b, 0x0015, 0x79d8, 0x7adc, 0x692e, 0x6a32,
+ 0x0078, 0x27e0, 0xa684, 0x4000, 0x0040, 0x280c, 0x682f, 0x0000,
+ 0x6833, 0x0000, 0x0078, 0x27e0, 0x7038, 0xa005, 0x00c0, 0x2812,
+ 0x703b, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 0x00c8, 0x2819,
+ 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32,
+ 0x2100, 0xa205, 0x00c0, 0x2826, 0x0078, 0x27e0, 0x7000, 0xa086,
+ 0x0006, 0x0040, 0x282f, 0x1078, 0x362f, 0x0078, 0x27e0, 0x007c,
+ 0xa384, 0x0200, 0x0040, 0x2838, 0x6008, 0xa085, 0x0002, 0x600a,
+ 0x681b, 0x0006, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003,
+ 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020,
+ 0x7000, 0x0079, 0x284b, 0x2853, 0x2855, 0x285e, 0x2853, 0x2853,
+ 0x2853, 0x2853, 0x2853, 0x1078, 0x1eac, 0x6820, 0xa084, 0x0001,
+ 0x00c0, 0x285e, 0x1078, 0x2cc9, 0x0078, 0x2864, 0x7054, 0x2c50,
+ 0x2060, 0x6800, 0x6002, 0x2a60, 0x2021, 0x3957, 0x2404, 0xa005,
+ 0x0040, 0x286d, 0x2020, 0x0078, 0x2866, 0x2d22, 0x206b, 0x0000,
+ 0x007c, 0x1078, 0x2cd0, 0x1078, 0x2cdf, 0x682b, 0x0000, 0x789b,
+ 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x366b, 0xa684, 0x0800,
+ 0x0040, 0x2886, 0x691c, 0xa18d, 0x2000, 0x691e, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2896, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2894,
+ 0x681b, 0x001e, 0x0078, 0x2896, 0x681b, 0x0000, 0x2021, 0x3957,
+ 0x6800, 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x1a26,
+ 0x0078, 0x1f03, 0x1078, 0x27ce, 0x682b, 0x0000, 0x789b, 0x000e,
+ 0x6f14, 0x1078, 0x316f, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x28b5, 0x7038, 0x681a, 0xa68c, 0xdf00, 0x691e,
+ 0x70a3, 0x0000, 0x0078, 0x1f03, 0xa006, 0x1078, 0x32f5, 0x6817,
+ 0x0000, 0x681b, 0x0001, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000,
+ 0x7000, 0x0079, 0x28cb, 0x28d3, 0x28d5, 0x28d5, 0x28d7, 0x28d7,
+ 0x28d7, 0x28d7, 0x28d3, 0x1078, 0x1eac, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x0078, 0x2caa, 0x2300, 0x0079, 0x28e0,
+ 0x28e3, 0x28e5, 0x2939, 0x1078, 0x1eac, 0x7000, 0x0079, 0x28e8,
+ 0x28f0, 0x28f2, 0x28f2, 0x290d, 0x28f2, 0x291a, 0x290d, 0x28f0,
+ 0x1078, 0x1eac, 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x2909,
+ 0xa6b4, 0xffdf, 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x681c,
+ 0xa084, 0xffdf, 0x681e, 0x1078, 0x32f5, 0x1078, 0x3571, 0x0078,
+ 0x311c, 0xa684, 0x2000, 0x0040, 0x28fc, 0x6818, 0xa084, 0x8000,
+ 0x0040, 0x291a, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040, 0x291a,
+ 0x681b, 0x0007, 0x2009, 0x391e, 0x210c, 0xa186, 0x0000, 0x0040,
+ 0x292f, 0xa186, 0x0001, 0x0040, 0x2933, 0x2009, 0x3935, 0x200b,
+ 0x000b, 0x70a3, 0x0001, 0x781b, 0x0047, 0x0078, 0x1efb, 0x781b,
+ 0x00df, 0x0078, 0x1efb, 0x2009, 0x3935, 0x200b, 0x000a, 0x0078,
+ 0x1efb, 0x1078, 0x1eac, 0x2300, 0x0079, 0x293e, 0x2941, 0x2943,
+ 0x2976, 0x1078, 0x1eac, 0x7000, 0x0079, 0x2946, 0x294e, 0x2950,
+ 0x2950, 0x296b, 0x2950, 0x2972, 0x296b, 0x294e, 0x1078, 0x1eac,
+ 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x2967, 0xa6b4, 0xffbf,
+ 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffbf,
+ 0x681e, 0x1078, 0x32f5, 0x1078, 0x3571, 0x0078, 0x311c, 0xa684,
+ 0x2000, 0x0040, 0x295a, 0x6818, 0xa084, 0x8000, 0x0040, 0x2972,
+ 0x681b, 0x0007, 0x781b, 0x00e6, 0x0078, 0x1efb, 0x6820, 0xa085,
+ 0x0004, 0x6822, 0x1078, 0x30e7, 0xa6b5, 0x0800, 0x1078, 0x2f7d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2987, 0x298a,
+ 0x298c, 0x298e, 0x1078, 0x1eac, 0x1078, 0x1eac, 0xa684, 0x0400,
+ 0x00c0, 0x29ae, 0x782b, 0x3009, 0x6920, 0xa18c, 0xfdff, 0xa18c,
+ 0xfeff, 0x6922, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb,
+ 0x785a, 0x79e4, 0xa184, 0x0020, 0x00c0, 0x29aa, 0x2001, 0x0014,
+ 0x0078, 0x26ad, 0xa184, 0x0007, 0x0079, 0x29e6, 0x7a90, 0xa294,
+ 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x29e4, 0x789b,
+ 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x29d5, 0x7ba8, 0x7ba8,
+ 0xa386, 0x0001, 0x00c0, 0x29c8, 0x2009, 0xfff7, 0x0078, 0x29ce,
+ 0xa386, 0x0003, 0x00c0, 0x29d5, 0x2009, 0xffef, 0x0c7e, 0x7048,
+ 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab,
+ 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c,
+ 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x311c, 0x239b, 0x23a8,
+ 0x3124, 0x3124, 0x29ee, 0x29ee, 0x29ee, 0x3124, 0x1078, 0x1eac,
+ 0x79e4, 0xa184, 0x0030, 0x00c0, 0x2a06, 0x70a0, 0xa086, 0x0002,
+ 0x00c0, 0x29fe, 0x2011, 0x0002, 0x0078, 0x2288, 0x6818, 0xa085,
+ 0x8000, 0x681a, 0x2001, 0x0014, 0x0078, 0x26ad, 0xa184, 0x0007,
+ 0x0079, 0x2a0a, 0x311c, 0x311c, 0x2a12, 0x311c, 0x3144, 0x3144,
+ 0x311c, 0x311c, 0xa684, 0x0080, 0x0040, 0x2a41, 0x71c8, 0x81ff,
+ 0x0040, 0x2a41, 0xa182, 0x000d, 0x00d0, 0x2a22, 0x70cb, 0x0000,
+ 0x0078, 0x2a27, 0xa182, 0x000c, 0x70ca, 0x2009, 0x000c, 0x789b,
+ 0x0061, 0x79aa, 0x157e, 0x137e, 0x147e, 0x70cc, 0x8114, 0xa210,
+ 0x72ce, 0xa080, 0x000b, 0xad00, 0x2098, 0x20a1, 0x012b, 0x789b,
+ 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f, 0x137f, 0x157f, 0x0078,
+ 0x3124, 0xa684, 0x0400, 0x00c0, 0x2a82, 0x6820, 0xa084, 0x0001,
+ 0x0040, 0x3124, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040, 0x2a56,
+ 0xa086, 0x0060, 0x00c0, 0x2a56, 0xa18d, 0x4000, 0xa18c, 0xfffb,
+ 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061,
+ 0x6818, 0xa085, 0x8000, 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040,
+ 0x2d07, 0xa18c, 0x00f8, 0x00c0, 0x2d07, 0x157e, 0x137e, 0x147e,
+ 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b,
+ 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814, 0x8007, 0x7882,
+ 0x0078, 0x3124, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a89, 0x681b,
+ 0x0008, 0x781b, 0x00da, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2a90,
+ 0x2a95, 0x2b18, 0x2a93, 0x1078, 0x1eac, 0x7000, 0xa084, 0x0007,
+ 0x0079, 0x2a9a, 0x2aa2, 0x2aa4, 0x2ac0, 0x2aa2, 0x2aa2, 0x1f03,
+ 0x2aa2, 0x2aa2, 0x1078, 0x1eac, 0x6920, 0xa18d, 0x0001, 0x6922,
+ 0x6800, 0x6006, 0xa005, 0x00c0, 0x2aae, 0x6002, 0x681c, 0xa084,
+ 0x000e, 0x0040, 0x2aba, 0x7014, 0x68ba, 0x712c, 0xa188, 0x4280,
+ 0x0078, 0x2abc, 0x2009, 0x4380, 0x2104, 0x6802, 0x2d0a, 0x7156,
+ 0x6920, 0xa184, 0x8000, 0x00c0, 0x2acc, 0x68af, 0x0000, 0x68b3,
+ 0x0000, 0xa18d, 0x8000, 0x6922, 0x6eb6, 0xa684, 0x0060, 0x0040,
+ 0x2b16, 0xa684, 0x0800, 0x00c0, 0x2add, 0x6894, 0x68a6, 0x6898,
+ 0x68aa, 0x1078, 0x32f5, 0x0078, 0x2b16, 0xa684, 0x0020, 0x0040,
+ 0x2aea, 0xa006, 0x1078, 0x362f, 0x79d8, 0x7adc, 0x69aa, 0x6aa6,
+ 0x0078, 0x2af0, 0x1078, 0x30a6, 0x69aa, 0x6aa6, 0x1078, 0x362f,
+ 0xa684, 0x8000, 0x0040, 0x2b16, 0xa684, 0x7fff, 0x68b6, 0x789b,
+ 0x0074, 0x1078, 0x316f, 0x2010, 0x1078, 0x316f, 0x2008, 0xa684,
+ 0x0020, 0x00c0, 0x2b0e, 0x1078, 0x316f, 0x801b, 0x00c8, 0x2b09,
+ 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100,
+ 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x0078, 0x1f03,
+ 0x0078, 0x2f75, 0x7033, 0x0000, 0xa282, 0x0006, 0x0050, 0x2b22,
+ 0x1078, 0x1eac, 0x2300, 0x0079, 0x2b25, 0x2b28, 0x2b4e, 0x2b72,
+ 0x2200, 0x0079, 0x2b2b, 0x2b31, 0x2f75, 0x2b33, 0x2b31, 0x2b9c,
+ 0x2bed, 0x1078, 0x1eac, 0x7003, 0x0005, 0x2001, 0x4390, 0x2068,
+ 0x703e, 0x157e, 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070,
+ 0x2b43, 0x0078, 0x2b3c, 0x157f, 0x6817, 0x0000, 0x68b7, 0x0700,
+ 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, 0x2f69, 0x7000, 0xa086,
+ 0x0001, 0x00c0, 0x2b5b, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034,
+ 0x600a, 0x0078, 0x2b60, 0x7000, 0xa086, 0x0003, 0x0040, 0x2b55,
+ 0x7003, 0x0005, 0x2001, 0x4390, 0x2068, 0x703e, 0x7032, 0x2200,
+ 0x0079, 0x2b6a, 0x2f75, 0x2b70, 0x2b70, 0x2b9c, 0x2b70, 0x2f75,
+ 0x1078, 0x1eac, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2b7f, 0x1078,
+ 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a, 0x0078, 0x2b84, 0x7000,
+ 0xa086, 0x0003, 0x0040, 0x2b79, 0x7003, 0x0005, 0x2001, 0x4390,
+ 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, 0x2b8e, 0x2b96, 0x2b94,
+ 0x2b94, 0x2b96, 0x2b94, 0x2b96, 0x1078, 0x1eac, 0x1078, 0x2f8d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x7000, 0xa086, 0x0001, 0x00c0,
+ 0x2ba9, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a, 0x0078,
+ 0x2bae, 0x7000, 0xa086, 0x0003, 0x0040, 0x2ba3, 0x7003, 0x0002,
+ 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007,
+ 0xa215, 0x2069, 0x4380, 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005,
+ 0x0040, 0x2bc9, 0x6814, 0xa206, 0x0040, 0x2be2, 0x6800, 0x0078,
+ 0x2bbc, 0x7003, 0x0005, 0x2001, 0x4390, 0x2068, 0x703e, 0x7032,
+ 0x157e, 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070, 0x2bda,
+ 0x0078, 0x2bd3, 0x157f, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800,
+ 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040,
+ 0x2c4b, 0x1078, 0x2f85, 0x0078, 0x2c4b, 0x7000, 0xa086, 0x0001,
+ 0x00c0, 0x2bfa, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a,
+ 0x0078, 0x2bff, 0x7000, 0xa086, 0x0003, 0x0040, 0x2bf4, 0x7003,
+ 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484,
+ 0x0007, 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8, 0x4280,
+ 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040, 0x2c1e, 0x6814,
+ 0xa206, 0x0040, 0x2c36, 0x6800, 0x0078, 0x2c11, 0x7003, 0x0005,
+ 0x2001, 0x4390, 0x2068, 0x703e, 0x157e, 0x20a9, 0x002f, 0x2003,
+ 0x0000, 0x8000, 0x0070, 0x2c2e, 0x0078, 0x2c27, 0x157f, 0x6a16,
+ 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a,
+ 0x6820, 0xa084, 0x0c00, 0x0040, 0x2c4b, 0xa084, 0x0800, 0x0040,
+ 0x2c45, 0x1078, 0x2f89, 0x0078, 0x2c4b, 0x1078, 0x2f85, 0x70bf,
+ 0x0000, 0x0078, 0x2c4b, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x3a00, 0x2060, 0x704a, 0x6000, 0x704e,
+ 0x6004, 0x7052, 0xa684, 0x0060, 0x0040, 0x2c64, 0x68a8, 0x78d2,
+ 0x78da, 0x68a4, 0x78d6, 0x78de, 0x077f, 0x1078, 0x3099, 0x2009,
+ 0x0068, 0xa684, 0x0008, 0x0040, 0x2c6f, 0x2009, 0x0067, 0xa6b5,
+ 0x2000, 0x7e5a, 0x791a, 0xa684, 0x0060, 0x0040, 0x2c85, 0xa684,
+ 0x0800, 0x00c0, 0x2c7f, 0x1078, 0x3571, 0x0078, 0x2c85, 0xa684,
+ 0x4000, 0x00c0, 0x2c85, 0x1078, 0x3502, 0x2d00, 0x703e, 0x8207,
+ 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3a00, 0x2048,
+ 0x0078, 0x1efb, 0x6020, 0xa005, 0x0040, 0x2c9e, 0x8001, 0x6022,
+ 0x6008, 0xa085, 0x0008, 0x600a, 0x7010, 0x6026, 0x007c, 0xa006,
+ 0x1078, 0x32f5, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040,
+ 0x681f, 0x0100, 0x7000, 0xa084, 0x0007, 0x0079, 0x2caf, 0x2cb7,
+ 0x2cb9, 0x2cb9, 0x2cc5, 0x2cc1, 0x2cb7, 0x2cc1, 0x2cb7, 0x1078,
+ 0x1eac, 0x1078, 0x2cd0, 0x1078, 0x2cc9, 0x1078, 0x1a26, 0x0078,
+ 0x1f03, 0x70a3, 0x0000, 0x0078, 0x1f03, 0x681b, 0x0000, 0x0078,
+ 0x2871, 0x6800, 0xa005, 0x00c0, 0x2cce, 0x6002, 0x6006, 0x007c,
+ 0x6010, 0xa005, 0x0040, 0x2cd9, 0x8001, 0x00d0, 0x2cd9, 0x1078,
+ 0x1eac, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x007c, 0x6018,
+ 0xa005, 0x0040, 0x2ce5, 0x8001, 0x601a, 0x007c, 0x1078, 0x316a,
+ 0x6818, 0xa084, 0x8000, 0x0040, 0x2cef, 0x681b, 0x0018, 0x0078,
+ 0x2d26, 0x1078, 0x316a, 0x6818, 0xa084, 0x8000, 0x0040, 0x2cfa,
+ 0x681b, 0x0019, 0x0078, 0x2d26, 0x1078, 0x316a, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2d05, 0x681b, 0x001a, 0x0078, 0x2d26, 0x1078,
+ 0x316a, 0x681b, 0x0003, 0x0078, 0x2d26, 0x71b8, 0xa18c, 0x00ff,
+ 0xa1e8, 0x4280, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0, 0x2d1a,
+ 0x0078, 0x1f03, 0x6814, 0x72b4, 0xa206, 0x0040, 0x2d22, 0x6800,
+ 0x0078, 0x2d13, 0x6800, 0x200a, 0x681b, 0x0005, 0x681f, 0x0000,
+ 0x6823, 0x0020, 0x1078, 0x2cd0, 0x1078, 0x2cc9, 0x1078, 0x1a26,
+ 0x0078, 0x1f03, 0xa282, 0x0003, 0x00c0, 0x2f69, 0x7da8, 0xa5ac,
+ 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, 0xa18d, 0x0080, 0x6922,
+ 0xa184, 0x0100, 0x0040, 0x2d92, 0xa18c, 0xfeff, 0x6922, 0xa6b4,
+ 0x00ff, 0x0040, 0x2d7c, 0xa682, 0x000c, 0x0048, 0x2d53, 0x0040,
+ 0x2d53, 0x2031, 0x000c, 0x852b, 0x852b, 0x1078, 0x3018, 0x0040,
+ 0x2d5d, 0x1078, 0x2e4a, 0x0078, 0x2d85, 0x1078, 0x2fd3, 0x0c7e,
+ 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x2e6e, 0x0c7f,
+ 0x6920, 0xa18d, 0x0100, 0x6922, 0x7e58, 0xa6b5, 0x0004, 0x7e5a,
+ 0xa684, 0x0400, 0x00c0, 0x2d78, 0x781b, 0x0053, 0x0078, 0x1efb,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x0c7e, 0x2960, 0x6004, 0xa084,
+ 0xfff5, 0x6006, 0x1078, 0x2e6e, 0x0c7f, 0x7e58, 0xa684, 0x0400,
+ 0x00c0, 0x2d8e, 0x781b, 0x0056, 0x0078, 0x1efb, 0x781b, 0x0068,
+ 0x0078, 0x1efb, 0x0c7e, 0x7048, 0x2060, 0x6100, 0xa18c, 0x1000,
+ 0x0040, 0x2dd2, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c,
+ 0x0048, 0x2da6, 0x0040, 0x2da6, 0x2011, 0x000c, 0x2600, 0xa202,
+ 0x00c8, 0x2dab, 0x2230, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086,
+ 0x0028, 0x00c0, 0x2dbb, 0xa282, 0x0019, 0x00c8, 0x2dc1, 0x2011,
+ 0x0019, 0x0078, 0x2dc1, 0xa282, 0x000c, 0x00c8, 0x2dc1, 0x2011,
+ 0x000c, 0x2200, 0xa502, 0x00c8, 0x2dc6, 0x2228, 0x1078, 0x2fd7,
+ 0x852b, 0x852b, 0x1078, 0x3018, 0x0040, 0x2dd2, 0x1078, 0x2e4a,
+ 0x0078, 0x2dd6, 0x1078, 0x2fd3, 0x1078, 0x2e6e, 0x7858, 0xa085,
+ 0x0004, 0x785a, 0x0c7f, 0x781b, 0x0067, 0x0078, 0x1efb, 0x0c7e,
+ 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x2df7, 0x6010, 0xa084,
+ 0x000f, 0x00c0, 0x2df1, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x0c7f,
+ 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x2e1e, 0x68a0,
+ 0xa084, 0x0200, 0x00c0, 0x2df1, 0x6208, 0xa294, 0x00ff, 0x7018,
+ 0xa086, 0x0028, 0x00c0, 0x2e0c, 0xa282, 0x0019, 0x00c8, 0x2e12,
+ 0x2011, 0x0019, 0x0078, 0x2e12, 0xa282, 0x000c, 0x00c8, 0x2e12,
+ 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c,
+ 0x0048, 0x2e1e, 0x0040, 0x2e1e, 0x2019, 0x000c, 0x78ab, 0x0001,
+ 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
+ 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x2960,
+ 0x6104, 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000,
+ 0x0078, 0x2e3a, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001,
+ 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 0x6822,
+ 0x0c7f, 0x007c, 0x0c7e, 0x7148, 0x2160, 0x2008, 0xa084, 0xfff0,
+ 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4, 0xa084,
+ 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6, 0x6016, 0x788a, 0xa6b4,
+ 0x000f, 0x8637, 0x8204, 0x8004, 0xa084, 0x00ff, 0xa605, 0x600e,
+ 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x007c, 0x0c7e, 0x7048,
+ 0x2060, 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012,
+ 0x7884, 0xa084, 0xfff0, 0x7886, 0x0c7f, 0x007c, 0xa282, 0x0002,
+ 0x00c0, 0x2f69, 0x7aa8, 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184,
+ 0x0200, 0x0040, 0x2ec3, 0xa18c, 0xfdff, 0x6922, 0xa294, 0x00ff,
+ 0xa282, 0x0002, 0x00c8, 0x2f69, 0x1078, 0x2f0a, 0x1078, 0x2e6e,
+ 0xa980, 0x0001, 0x200c, 0x1078, 0x3095, 0x1078, 0x2ddf, 0x88ff,
+ 0x0040, 0x2eb6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5,
+ 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2eb2, 0x781b, 0x0053,
+ 0x0078, 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb, 0x7e58, 0xa684,
+ 0x0400, 0x00c0, 0x2ebf, 0x781b, 0x0056, 0x0078, 0x1efb, 0x781b,
+ 0x0068, 0x0078, 0x1efb, 0xa282, 0x0002, 0x00c8, 0x2ecb, 0xa284,
+ 0x0001, 0x0040, 0x2ed5, 0x7148, 0xa188, 0x0000, 0x210c, 0xa18c,
+ 0x2000, 0x00c0, 0x2ed5, 0x2011, 0x0000, 0x1078, 0x2fc5, 0x1078,
+ 0x2f0a, 0x1078, 0x2e6e, 0x7858, 0xa085, 0x0004, 0x785a, 0x781b,
+ 0x0067, 0x0078, 0x1efb, 0x0c7e, 0x027e, 0x2960, 0x6000, 0x2011,
+ 0x0001, 0xa084, 0x2000, 0x00c0, 0x2efa, 0x6014, 0xa084, 0x0040,
+ 0x00c0, 0x2ef8, 0xa18c, 0xffef, 0x6106, 0xa006, 0x0078, 0x2f07,
+ 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003,
+ 0x7aaa, 0xa8c0, 0x0004, 0x6820, 0xa085, 0x0200, 0x6822, 0x027f,
+ 0x0c7f, 0x007c, 0x0c7e, 0x7048, 0x2060, 0x82ff, 0x0040, 0x2f12,
+ 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084,
+ 0xffbf, 0xa205, 0x78a6, 0x6016, 0x788a, 0x6004, 0xa084, 0xffef,
+ 0x6006, 0x0c7f, 0x007c, 0xa684, 0x0020, 0x0040, 0x2f65, 0x7888,
+ 0xa084, 0x0040, 0x0040, 0x2f65, 0x7bb8, 0xa384, 0x003f, 0x831b,
+ 0x00c8, 0x2f33, 0x8000, 0xa005, 0x0040, 0x2f4c, 0x831b, 0x00c8,
+ 0x2f3c, 0x8001, 0x0040, 0x2f61, 0xa684, 0x4000, 0x0040, 0x2f4c,
+ 0x78b8, 0x801b, 0x00c8, 0x2f45, 0x8000, 0xa084, 0x003f, 0x00c0,
+ 0x2f61, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001,
+ 0xa108, 0x00c8, 0x2f55, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6,
+ 0x7ade, 0x1078, 0x362f, 0x781b, 0x0065, 0x1078, 0x3502, 0x0078,
+ 0x1efb, 0x781b, 0x0065, 0x0078, 0x1efb, 0x781b, 0x0068, 0x0078,
+ 0x1efb, 0x1078, 0x2f91, 0x781b, 0x0067, 0x0078, 0x1efb, 0x1078,
+ 0x2f7d, 0x781b, 0x0067, 0x0078, 0x1efb, 0x6827, 0x0002, 0x1078,
+ 0x2f85, 0x781b, 0x0067, 0x0078, 0x1efb, 0x2001, 0x0005, 0x0078,
+ 0x2f93, 0x2001, 0x000c, 0x0078, 0x2f93, 0x2001, 0x0006, 0x0078,
+ 0x2f93, 0x2001, 0x000d, 0x0078, 0x2f93, 0x2001, 0x0009, 0x0078,
+ 0x2f93, 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa, 0xa6b5, 0x0008,
+ 0x7e5a, 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b,
+ 0x8703, 0xa0e0, 0x3a00, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184,
+ 0x000f, 0x0040, 0x2fb3, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004,
+ 0xa085, 0x0008, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184,
+ 0x0040, 0x0040, 0x2fc3, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004,
+ 0xa085, 0x0010, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab,
+ 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060,
+ 0x78ab, 0x0004, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b,
+ 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa,
+ 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007,
+ 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4,
+ 0xa18c, 0xfff0, 0x2001, 0x3946, 0x2004, 0xa082, 0x0028, 0x0040,
+ 0x3001, 0x2021, 0x307c, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078,
+ 0x3007, 0x2021, 0x3088, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011,
+ 0x0064, 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 0x3016, 0x8420,
+ 0x2300, 0xa210, 0x0070, 0x3016, 0x0078, 0x3009, 0x157f, 0x007c,
+ 0x157e, 0x2011, 0x3946, 0x2214, 0xa282, 0x0032, 0x0048, 0x302c,
+ 0x0040, 0x3030, 0x2021, 0x306e, 0x2019, 0x0011, 0x20a9, 0x000e,
+ 0x2011, 0x0032, 0x0078, 0x3042, 0xa282, 0x0028, 0x0040, 0x303a,
+ 0x2021, 0x307c, 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064,
+ 0x0078, 0x3042, 0x2021, 0x3088, 0x2019, 0x0019, 0x20a9, 0x000d,
+ 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x3052, 0x0048, 0x3052,
+ 0x8420, 0x2300, 0xa210, 0x0070, 0x304f, 0x0078, 0x3042, 0x157f,
+ 0xa006, 0x007c, 0x157f, 0x7a08, 0xa582, 0x0064, 0x00c8, 0x305d,
+ 0xa285, 0x0040, 0x780a, 0x0078, 0x305d, 0x78ec, 0xa084, 0x0300,
+ 0x0040, 0x306b, 0x2404, 0xa09e, 0x2002, 0x00c0, 0x306b, 0x2001,
+ 0x2101, 0x0078, 0x306c, 0x2404, 0xa015, 0x007c, 0x2002, 0x3002,
+ 0x3202, 0x4203, 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806,
+ 0x7a06, 0x0a07, 0x0c07, 0x0e07, 0x3202, 0x4202, 0x5202, 0x6202,
+ 0x7202, 0x6605, 0x7605, 0x7805, 0x7a05, 0x7c05, 0x7e05, 0x7f05,
+ 0x2202, 0x3202, 0x4202, 0x5202, 0x5404, 0x6404, 0x7404, 0x7604,
+ 0x7804, 0x7a04, 0x7c04, 0x7e04, 0x7f04, 0x789b, 0x0010, 0xa046,
+ 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784, 0x0007, 0x8003, 0x8003,
+ 0x8003, 0x8003, 0xa105, 0xa0e0, 0x3a80, 0x007c, 0x79d8, 0x7adc,
+ 0x78d0, 0x801b, 0x00c8, 0x30ad, 0x8000, 0xa084, 0x003f, 0xa108,
+ 0xa291, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3940,
+ 0x2091, 0x8000, 0x2104, 0x0079, 0x30bd, 0x30e3, 0x30c7, 0x30c7,
+ 0x30c7, 0x30c7, 0x30c7, 0x30c7, 0x30c5, 0x1078, 0x1eac, 0x784b,
+ 0x0004, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 0xa085, 0x4000,
+ 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x30e3, 0x0018, 0x30e3,
+ 0x681c, 0xa084, 0x0020, 0x00c0, 0x30e1, 0x781b, 0x00df, 0x0078,
+ 0x30e3, 0x781b, 0x00e6, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x0c7e,
+ 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0,
+ 0x3a00, 0x6004, 0xa084, 0x000a, 0x00c0, 0x311a, 0x6108, 0xa194,
+ 0xff00, 0x0040, 0x311a, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106,
+ 0x0040, 0x3109, 0x2001, 0x0032, 0xa106, 0x0040, 0x310d, 0x0078,
+ 0x3111, 0x2009, 0x0020, 0x0078, 0x3113, 0x2009, 0x003f, 0x0078,
+ 0x3113, 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085,
+ 0x0002, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x0068, 0x0078, 0x1efb,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x781b, 0x0056, 0x0078, 0x1efb,
+ 0x781b, 0x0053, 0x0078, 0x1efb, 0x781b, 0x00df, 0x0078, 0x1efb,
+ 0x781b, 0x00de, 0x0078, 0x1efb, 0x781b, 0x00e6, 0x0078, 0x1efb,
+ 0x781b, 0x00e5, 0x0078, 0x1efb, 0x781b, 0x009d, 0x0078, 0x1efb,
+ 0x781b, 0x009c, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040,
+ 0x314b, 0x681b, 0x001d, 0x70a3, 0x0001, 0x781b, 0x0047, 0x0078,
+ 0x1efb, 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3168, 0x7808,
+ 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec,
+ 0xa084, 0x0021, 0x0040, 0x3168, 0x7808, 0xa085, 0x0002, 0x780a,
+ 0x007f, 0x007c, 0x7808, 0xa085, 0x0002, 0x780a, 0x007c, 0x7830,
+ 0xa084, 0x0040, 0x00c0, 0x316f, 0x0098, 0x3178, 0x78ac, 0x007c,
+ 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
+ 0x78ec, 0xa084, 0x0021, 0x0040, 0x3187, 0x0098, 0x3185, 0x78ac,
+ 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784,
+ 0x0070, 0x0040, 0x319b, 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x1e57,
+ 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 0x31a8, 0x784b,
+ 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x1f03, 0x0078, 0x311c,
+ 0xa784, 0x0004, 0x0040, 0x31db, 0x78b8, 0xa084, 0x4001, 0x0040,
+ 0x31db, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x1f03,
+ 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 0x31db, 0x78c0,
+ 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00e6, 0x0078, 0x1efb,
+ 0x784b, 0x0008, 0x6818, 0xa084, 0x8000, 0x0040, 0x31d7, 0x681b,
+ 0x0015, 0xa684, 0x4000, 0x0040, 0x31d7, 0x681b, 0x0007, 0x781b,
+ 0x00df, 0x0078, 0x1efb, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00,
+ 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78e4,
+ 0xa005, 0x00d0, 0x238a, 0xa084, 0x0020, 0x0040, 0x238a, 0x0018,
+ 0x238a, 0x0078, 0x2f6f, 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x3a00, 0x2060, 0x2048, 0x704a, 0x6000,
+ 0x704e, 0x6004, 0x7052, 0x2a60, 0x007c, 0x0020, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062,
+ 0x0009, 0x0014, 0x0014, 0x9848, 0x0014, 0x0014, 0x98f9, 0x98e9,
+ 0x0014, 0x0014, 0x0080, 0x00c0, 0x0100, 0x0402, 0x2008, 0xf880,
+ 0x0018, 0xa20a, 0x0014, 0x300b, 0xa20c, 0x0014, 0xa200, 0x8838,
+ 0x3806, 0x8839, 0x28c2, 0x9cc2, 0xa805, 0x0864, 0xa83d, 0x3008,
+ 0x28c1, 0x9cc2, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000,
+ 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9c9f, 0xa8f3, 0x0864,
+ 0xa82b, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9c9f, 0x280d, 0xa204,
+ 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677,
+ 0xa80f, 0x786e, 0x883e, 0xa80c, 0x282b, 0xa205, 0x64a0, 0x67a0,
+ 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677, 0xa801, 0x883e,
+ 0x206b, 0x28c1, 0x9cc2, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8dc,
+ 0xa207, 0x2901, 0xa80a, 0x0014, 0xa203, 0x8000, 0x85a4, 0x1872,
+ 0x879a, 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, 0x866f, 0x0704,
+ 0x3008, 0x9c9f, 0x0014, 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8,
+ 0x19e2, 0xf848, 0x8174, 0x86eb, 0x85eb, 0x872e, 0x87a9, 0x883f,
+ 0x08e6, 0xa8f1, 0xf861, 0xa8e8, 0xf801, 0x0014, 0xf881, 0x0016,
+ 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221,
+ 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0xa206, 0x6865,
+ 0x817e, 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, 0x8008, 0xa8fa,
+ 0x8000, 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, 0x84a8, 0x11d6,
+ 0x7042, 0x20dd, 0x0011, 0x20d4, 0x8822, 0x0016, 0x8000, 0x2848,
+ 0x1011, 0xa8fc, 0x3008, 0x8000, 0xa000, 0x2802, 0x1011, 0xa8fd,
+ 0xa883, 0x3008, 0x283d, 0x1011, 0xa8fd, 0xa209, 0x0017, 0x300c,
+ 0x8000, 0x85a4, 0x1de2, 0xdac1, 0x0014, 0xd301, 0x0014, 0x26e0,
+ 0x873a, 0xfaa2, 0x19f2, 0x1fe2, 0x0014, 0xa20b, 0x0014, 0xa20d,
+ 0x3806, 0x0210, 0x9ccc, 0x0704, 0x0000, 0x127e, 0x2091, 0x2200,
+ 0x2049, 0x32f5, 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 0x7008,
+ 0xa084, 0xfff7, 0xa205, 0x0040, 0x3307, 0x1078, 0x3380, 0x127f,
+ 0x2000, 0x007c, 0x6428, 0x84ff, 0x0040, 0x3336, 0x2c70, 0x7004,
+ 0xa0bc, 0x000f, 0xa7b8, 0x3346, 0x273c, 0x87fb, 0x00c0, 0x3324,
+ 0x0048, 0x331c, 0x1078, 0x1eac, 0x609c, 0xa075, 0x0040, 0x3336,
+ 0x0078, 0x330f, 0x2039, 0x333b, 0x2704, 0xae68, 0x6808, 0xa630,
+ 0x680c, 0xa529, 0x8421, 0x0040, 0x3336, 0x8738, 0x2704, 0xa005,
+ 0x00c0, 0x3325, 0x709c, 0xa075, 0x00c0, 0x330f, 0x007c, 0x0000,
+ 0x0005, 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000,
+ 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x333b,
+ 0x3338, 0x0000, 0x0000, 0x8000, 0x0000, 0x333b, 0x0000, 0x3343,
+ 0x3340, 0x0000, 0x0000, 0x0000, 0x0000, 0x3343, 0x0000, 0x333e,
+ 0x333e, 0x0000, 0x0000, 0x8000, 0x0000, 0x333e, 0x0000, 0x3344,
+ 0x3344, 0x0000, 0x0000, 0x0000, 0x0000, 0x3344, 0x127e, 0x2091,
+ 0x2200, 0x2079, 0x3900, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007,
+ 0x0002, 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007,
+ 0x0002, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c,
+ 0x2049, 0x3380, 0x2019, 0x0000, 0x7004, 0x8004, 0x00c8, 0x33b2,
+ 0x7007, 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, 0x338a, 0xa184,
+ 0x01e0, 0x0040, 0x3395, 0x1078, 0x1eac, 0xa184, 0x4000, 0x00c0,
+ 0x338a, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040, 0x33a7, 0xa386,
+ 0x0008, 0x0040, 0x33b2, 0xa386, 0x200c, 0x00c0, 0x338a, 0x7200,
+ 0x8204, 0x0048, 0x33b2, 0x730c, 0xa384, 0x00ff, 0x0040, 0x33b2,
+ 0x1078, 0x1eac, 0x7007, 0x0012, 0x7000, 0xa084, 0x0001, 0x00c0,
+ 0x33c3, 0x7310, 0x7014, 0xa305, 0x0040, 0x33c3, 0x700c, 0xa084,
+ 0x00ff, 0x00c0, 0x3380, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004,
+ 0xa084, 0x0008, 0x00c0, 0x33c7, 0x7007, 0x0012, 0x7108, 0x8103,
+ 0x0048, 0x33cc, 0x7003, 0x0000, 0x2049, 0x0000, 0x007c, 0x107e,
+ 0x007e, 0x127e, 0x157e, 0x2091, 0x2200, 0x7108, 0x1078, 0x33e7,
+ 0x157f, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c, 0x7204,
+ 0x7500, 0x730c, 0xa384, 0x0300, 0x00c0, 0x3426, 0xa184, 0x0060,
+ 0x00c0, 0x3442, 0x7008, 0x7108, 0xa106, 0x00c0, 0x33f2, 0xa184,
+ 0x01e0, 0x00c0, 0x3442, 0xa184, 0x4000, 0x00c0, 0x33f2, 0xa986,
+ 0x362f, 0x00c0, 0x341a, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040,
+ 0x3411, 0xa386, 0x0008, 0x0040, 0x341a, 0xa386, 0x200c, 0x00c0,
+ 0x33f2, 0x7200, 0x8204, 0x0048, 0x341a, 0x730c, 0xa384, 0x00ff,
+ 0x00c0, 0x3426, 0xa184, 0x0007, 0x0079, 0x341e, 0x3428, 0x3436,
+ 0x3426, 0x3436, 0x3426, 0x348f, 0x3426, 0x348d, 0x1078, 0x1eac,
+ 0x7007, 0x0002, 0x8aff, 0x00c0, 0x3431, 0x2049, 0x0000, 0x0078,
+ 0x3435, 0x1078, 0x3606, 0x00c0, 0x3431, 0x007c, 0x7007, 0x0002,
+ 0x8aff, 0x00c0, 0x343d, 0x0078, 0x3441, 0x1078, 0x3606, 0x00c0,
+ 0x343d, 0x007c, 0x7108, 0x7008, 0xa106, 0x00c0, 0x3442, 0xa184,
+ 0x4000, 0x00c0, 0x3442, 0x7007, 0x0012, 0x7108, 0x7008, 0xa106,
+ 0x00c0, 0x344d, 0xa184, 0x4000, 0x00c0, 0x344d, 0x00e0, 0x3456,
+ 0x2091, 0x6000, 0x00e0, 0x345a, 0x2091, 0x6000, 0x7007, 0x0012,
+ 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x3462, 0x7007,
+ 0x0012, 0x7108, 0x8103, 0x0048, 0x3467, 0x7003, 0x0000, 0x7000,
+ 0xa005, 0x00c0, 0x347b, 0x7004, 0xa005, 0x00c0, 0x347b, 0x700c,
+ 0xa005, 0x0040, 0x347d, 0x0078, 0x345e, 0x2049, 0x0000, 0x1078,
+ 0x30b3, 0x6818, 0xa084, 0x8000, 0x0040, 0x3488, 0x681b, 0x0002,
+ 0x007c, 0x1078, 0x1eac, 0x1078, 0x1eac, 0x1078, 0x34ed, 0x7210,
+ 0x7114, 0x700c, 0xa09c, 0x00ff, 0x2800, 0xa300, 0xa211, 0xa189,
+ 0x0000, 0x1078, 0x34ed, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200,
+ 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305, 0x0040, 0x34b2,
+ 0x00c8, 0x34b2, 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60,
+ 0x0078, 0x3499, 0x2b60, 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008,
+ 0x0040, 0x34be, 0xa7ba, 0x3340, 0x0078, 0x34c0, 0xa7ba, 0x3338,
+ 0x007f, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x1078,
+ 0x3380, 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x34dd, 0x609c,
+ 0xa005, 0x0040, 0x34ea, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080,
+ 0x3346, 0x203c, 0x87fb, 0x1040, 0x1eac, 0x8a51, 0x0040, 0x34e9,
+ 0x7008, 0x7508, 0xa52e, 0x00c0, 0x34e0, 0xa084, 0x0003, 0xa086,
+ 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704,
+ 0xa004, 0x00c0, 0x3501, 0x6000, 0xa064, 0x00c0, 0x34f8, 0x2d60,
+ 0x6004, 0xa084, 0x000f, 0xa080, 0x3356, 0x203c, 0x87fb, 0x1040,
+ 0x1eac, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6884,
+ 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084,
+ 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x351c,
+ 0xa0b8, 0x3340, 0x0078, 0x351e, 0xa0b8, 0x3338, 0x7e08, 0xa6b5,
+ 0x000c, 0x681c, 0xa084, 0x0040, 0x0040, 0x3528, 0xa6b5, 0x0001,
+ 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x352a, 0x2400,
+ 0xa305, 0x00c0, 0x3535, 0x0078, 0x3559, 0x2c58, 0x2704, 0x6104,
+ 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184,
+ 0x0008, 0x0040, 0x3549, 0x6010, 0xa001, 0x7022, 0x6014, 0xa001,
+ 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203,
+ 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078, 0x34ca, 0x0078,
+ 0x355b, 0x1078, 0x3606, 0x00c0, 0x3559, 0x127f, 0x2000, 0x007c,
+ 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007, 0x0004, 0x7004,
+ 0xa084, 0x0004, 0x00c0, 0x3567, 0x7003, 0x0008, 0x127f, 0x2000,
+ 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x3571,
+ 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x357a, 0x7e08,
+ 0xa6b5, 0x000c, 0x681c, 0xa084, 0x0020, 0x00c0, 0x3589, 0xa6b5,
+ 0x0001, 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8,
+ 0x3346, 0x273c, 0x87fb, 0x00c0, 0x359f, 0x0048, 0x3599, 0x1078,
+ 0x1eac, 0x689c, 0xa065, 0x0040, 0x35a3, 0x0078, 0x358c, 0x1078,
+ 0x3606, 0x00c0, 0x359f, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e,
+ 0x017e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f, 0x047f, 0x7e08,
+ 0xa6b5, 0x000c, 0x681c, 0xa084, 0x0040, 0x0040, 0x35b9, 0xa6b5,
+ 0x0001, 0x2049, 0x35a6, 0x6828, 0xa055, 0x0040, 0x3603, 0x2d70,
+ 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3346, 0x273c, 0x87fb,
+ 0x00c0, 0x35d5, 0x0048, 0x35ce, 0x1078, 0x1eac, 0x709c, 0xa075,
+ 0x2060, 0x0040, 0x3603, 0x0078, 0x35c1, 0x2704, 0xae68, 0x6808,
+ 0xa422, 0x680c, 0xa31b, 0x0048, 0x35f0, 0x8a51, 0x00c0, 0x35e2,
+ 0x1078, 0x1eac, 0x8738, 0x2704, 0xa005, 0x00c0, 0x35d6, 0x709c,
+ 0xa075, 0x2060, 0x0040, 0x3603, 0x2039, 0x3338, 0x0078, 0x35c1,
+ 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122,
+ 0x690c, 0x2300, 0xa11b, 0x00c8, 0x35ff, 0x1078, 0x1eac, 0x2071,
+ 0x0020, 0x0078, 0x3528, 0x127f, 0x2000, 0x007c, 0x7008, 0x7508,
+ 0xa52e, 0x00c0, 0x3606, 0xa084, 0x0003, 0xa086, 0x0003, 0x0040,
+ 0x362e, 0x2704, 0xac08, 0x2104, 0x701a, 0x8108, 0x2104, 0x701e,
+ 0x8108, 0x2104, 0x7012, 0x8108, 0x2104, 0x7016, 0x6004, 0xa084,
+ 0x0008, 0x0040, 0x3629, 0x8108, 0x2104, 0x7022, 0x8108, 0x2104,
+ 0x7026, 0x7602, 0x7007, 0x0001, 0x1078, 0x34ca, 0x007c, 0x127e,
+ 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x362f, 0x0d7f, 0x087f,
+ 0x7108, 0x7008, 0xa106, 0x00c0, 0x3638, 0xa184, 0x4000, 0x00c0,
+ 0x3638, 0xa184, 0x0003, 0x00c0, 0x364f, 0x6828, 0xa005, 0x0040,
+ 0x365d, 0x0020, 0x364f, 0x1078, 0x348f, 0x0078, 0x365d, 0x00a0,
+ 0x3656, 0x7108, 0x1078, 0x33e7, 0x0078, 0x3638, 0x7007, 0x0010,
+ 0x00a0, 0x3658, 0x7108, 0x1078, 0x33e7, 0x7008, 0xa086, 0x0008,
+ 0x00c0, 0x3638, 0x7000, 0xa005, 0x00c0, 0x3638, 0x2049, 0x0000,
+ 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0d7e,
+ 0x2091, 0x2200, 0x0d7f, 0x2049, 0x366b, 0xad80, 0x0011, 0x20a0,
+ 0x2099, 0x0031, 0x700c, 0xa084, 0x00ff, 0x682a, 0x7007, 0x0008,
+ 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 0x3689, 0x8000, 0x80ac,
+ 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x368b,
+ 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f,
+ 0x2000, 0x007c, 0x2091, 0x6000, 0x78c0, 0xa005, 0x0040, 0x36af,
+ 0x798c, 0x70d0, 0xa106, 0x00c0, 0x36af, 0x7804, 0xa005, 0x0040,
+ 0x36af, 0x7807, 0x0000, 0x0068, 0x36af, 0x2091, 0x4080, 0x7820,
+ 0x8001, 0x7822, 0x00c0, 0x370f, 0x7824, 0x7822, 0x2091, 0x8000,
+ 0x78f0, 0xa005, 0x0040, 0x36dc, 0x78d4, 0xa005, 0x00c0, 0x36dc,
+ 0x3a10, 0xa284, 0x0002, 0x00c0, 0x36cc, 0x78d7, 0x0007, 0x2009,
+ 0xff01, 0x200a, 0x0078, 0x36dc, 0xa284, 0x0001, 0x00c0, 0x36d4,
+ 0x78ef, 0x0000, 0x0078, 0x36dc, 0x78ec, 0xa005, 0x00c0, 0x36dc,
+ 0x78d7, 0x0008, 0x78ef, 0x0001, 0x2069, 0x3940, 0x6800, 0xa084,
+ 0x0007, 0x0040, 0x36f3, 0xa086, 0x0002, 0x0040, 0x36f3, 0x6830,
+ 0xa00d, 0x0040, 0x36f3, 0x2104, 0xa005, 0x0040, 0x36f3, 0x8001,
+ 0x200a, 0x0040, 0x37b1, 0x7848, 0xa005, 0x0040, 0x3703, 0x8001,
+ 0x784a, 0x00c0, 0x3703, 0x0f7e, 0x2079, 0x0100, 0x1078, 0x316a,
+ 0x0f7f, 0x1078, 0x1cf6, 0x68c4, 0xa005, 0x0040, 0x370f, 0x8001,
+ 0x68c6, 0x00c0, 0x370f, 0x68a3, 0x0000, 0x68a7, 0x0001, 0x1078,
+ 0x3716, 0x1078, 0x373b, 0x2091, 0x8001, 0x007c, 0x7834, 0x8001,
+ 0x7836, 0x00c0, 0x373a, 0x7838, 0x7836, 0x2091, 0x8000, 0x7844,
+ 0xa005, 0x00c0, 0x3725, 0x2001, 0x0101, 0x8001, 0x7846, 0xa080,
+ 0x4280, 0x2040, 0x2004, 0xa065, 0x0040, 0x373a, 0x6024, 0xa005,
+ 0x0040, 0x3736, 0x8001, 0x6026, 0x0040, 0x376a, 0x6000, 0x2c40,
+ 0x0078, 0x372b, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0, 0x3769,
+ 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x3748, 0x2001, 0x0080,
+ 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090, 0x3a80,
+ 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x3769, 0xa290,
+ 0x0009, 0x2204, 0xa005, 0x0040, 0x3761, 0x8001, 0x2012, 0x00c0,
+ 0x3769, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a, 0x1078,
+ 0x1cf6, 0x007c, 0x2069, 0x3940, 0x6800, 0xa005, 0x0040, 0x3774,
+ 0x683c, 0xac06, 0x0040, 0x37b1, 0x601b, 0x0006, 0x60b4, 0xa084,
+ 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022,
+ 0x6000, 0x2042, 0x6714, 0x6fb6, 0x1078, 0x18b4, 0x6818, 0xa005,
+ 0x0040, 0x378c, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef, 0x680a,
+ 0x6810, 0x8001, 0x00d0, 0x3796, 0x1078, 0x1eac, 0x6812, 0x602f,
+ 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x1a26, 0x2069, 0x3940,
+ 0x2001, 0x0006, 0x68a2, 0x7944, 0xa184, 0x0100, 0x00c0, 0x37ac,
+ 0x69ba, 0x2001, 0x0004, 0x68a2, 0x1078, 0x1cf1, 0x2091, 0x8001,
+ 0x007c, 0x2009, 0x394f, 0x2164, 0x2069, 0x0100, 0x1078, 0x1e57,
+ 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084,
+ 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000,
+ 0x6830, 0xa084, 0x0040, 0x0040, 0x37ed, 0x684b, 0x0004, 0x20a9,
+ 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x37da, 0x0070, 0x37da,
+ 0x0078, 0x37d1, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084,
+ 0x0001, 0x0040, 0x37e7, 0x0070, 0x37e7, 0x0078, 0x37de, 0x20a9,
+ 0x00fa, 0x0070, 0x37ed, 0x0078, 0x37e9, 0x6808, 0xa084, 0xfffd,
+ 0x680a, 0x681b, 0x0047, 0x2009, 0x3968, 0x200b, 0x0007, 0x784c,
+ 0x784a, 0x2091, 0x8001, 0x007c, 0x2079, 0x3900, 0x1078, 0x3827,
+ 0x1078, 0x380b, 0x1078, 0x3819, 0x7833, 0x0000, 0x7847, 0x0000,
+ 0x784b, 0x0000, 0x007c, 0x2019, 0x000c, 0x2011, 0x3946, 0x2204,
+ 0xa086, 0x003c, 0x0040, 0x3816, 0x2019, 0x0008, 0x7b2a, 0x7b2e,
+ 0x007c, 0x2019, 0x0039, 0x2011, 0x3946, 0x2204, 0xa086, 0x003c,
+ 0x0040, 0x3824, 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019,
+ 0x3971, 0x2011, 0x3946, 0x2204, 0xa086, 0x003c, 0x0040, 0x3832,
+ 0x2019, 0x2626, 0x7b22, 0x7b26, 0x783f, 0x0000, 0x7843, 0x000a,
+ 0x007c, 0x8e59
+};
+#define ISP_CODE_LENGTH 0x283a
+#endif
+/*
+ * Firmware Version 7.55.00 (16:16 Mar 20, 1998)
+ */
+
#define ISP_CODE_VERSION 7*1024+55
static const u_int16_t ISP_RISC_CODE[] = {
0x0078, 0x103a, 0x0000, 0x3cd2, 0x0000, 0x2043, 0x4f50, 0x5952,
@@ -1960,6166 +3261,5933 @@ static const u_int16_t ISP_RISC_CODE[] = {
};
#define ISP_CODE_LENGTH 0x3cd2
-/*
- * We now only support 1.15.07 version F/W with some various flavors
- *
- * ISP2100_FABRIC provides Fabric Login support
- * ISP2100_SCCLUN provides 16 bits worth of lun.
- *
- * As of 11/24/98 neither Fabric nor SCCLUN have been extensively tested.
- */
#define ISP2100_CODE_ORG 0x1000
-#define ISP2100_CODE_VERSION 1*1024+15
-/* #define ISP2100_FABRIC 1 */
-/* #define ISP2100_SCCLUN 1 */
-
-#if !defined(ISP2100_FABRIC) && !defined(ISP2100_SCCLUN)
/************************************************************************
* *
- * --- ISP2100 Initiator/Target Firmware --- *
+ * --- ISP2100 Fabric Initiator/Target Firmware --- *
* *
* *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
+ ************************************************************************/
+#if 0
/*
- * Firmware Version 1.15.07 (14:43 Oct 13, 1998)
+ * Firmware Version 1.13.00 (18:04 May 04, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+13
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x5e69, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5c95, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6e69, 0x2009, 0x0000, 0x20a9,
- 0x0697, 0x41a4, 0x3400, 0x20c9, 0x72ff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1ff1, 0x2051, 0x6f00,
- 0x2a70, 0x705b, 0x8d00, 0x705f, 0xffff, 0x7057, 0x8cf9, 0x7063,
- 0x0300, 0x1078, 0x1235, 0x20a1, 0x7500, 0x715c, 0x810d, 0x810d,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3133, 0x2020, 0x2020,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6c95, 0x2009, 0x0000, 0x20a9,
+ 0x076b, 0x41a4, 0x3400, 0x20c9, 0x71ff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1e36, 0x2051, 0x6d00,
+ 0x2a70, 0x705b, 0x8c00, 0x705f, 0xffff, 0x7057, 0x8bf9, 0x7063,
+ 0x0300, 0x1078, 0x1264, 0x20a1, 0x7400, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1200, 0x1078, 0x1321, 0x1078, 0x14a6, 0x1078, 0x192f,
- 0x1078, 0x32c3, 0x1078, 0x5567, 0x1078, 0x12ac, 0x1078, 0x22f7,
- 0x1078, 0x38fc, 0x1078, 0x36d4, 0x1078, 0x40ad, 0x1078, 0x1dbe,
- 0x1078, 0x42ec, 0x1078, 0x3e1a, 0x1078, 0x1cdd, 0x1078, 0x1d9d,
+ 0x1078, 0x122b, 0x1078, 0x134e, 0x1078, 0x14d3, 0x1078, 0x17d7,
+ 0x1078, 0x324a, 0x1078, 0x54fc, 0x1078, 0x12d9, 0x1078, 0x2191,
+ 0x1078, 0x3875, 0x1078, 0x3655, 0x1078, 0x4064, 0x1078, 0x1c35,
+ 0x1078, 0x4213, 0x1078, 0x3d73, 0x1078, 0x1b5d, 0x1078, 0x1c14,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2a3b, 0x1078, 0x231f, 0x1078, 0x394c,
- 0x1078, 0x37bf, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x40c5, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5239, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
- 0x10cd, 0x117d, 0x11fd, 0x11fe, 0x11ff, 0x1078, 0x1288, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b5e, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x31f0, 0x1078, 0x4187,
+ 0x00c0, 0x10bd, 0x1078, 0x2a96, 0x1078, 0x21b9, 0x1078, 0x38c5,
+ 0x1078, 0x373c, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x4078, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x52d8, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x1151,
+ 0x10cd, 0x11aa, 0x1228, 0x1229, 0x122a, 0x1078, 0x12b7, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2aec, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x1142, 0x2011, 0x318e, 0x1078, 0x40d1,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b0, 0x1078, 0x29fa, 0x1078, 0x5084, 0x2011, 0x0004, 0x1078,
- 0x622b, 0x1078, 0x366e, 0x2079, 0x6f51, 0x7804, 0xd0ac, 0x00c0,
- 0x1115, 0x2011, 0x0001, 0x1078, 0x622b, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x20a1, 0x2011, 0x0005,
- 0x1078, 0x5193, 0x1078, 0x4893, 0x0c7e, 0x2061, 0x0100, 0x60e3,
- 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x5193, 0x1078,
- 0x4893, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
- 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
- 0x0040, 0x1138, 0x1078, 0x20a1, 0x1078, 0x4893, 0x0078, 0x117b,
- 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x6f52, 0x2004, 0xd0ac,
- 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x017e, 0x1078, 0x34cb, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
- 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
- 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
- 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f8a, 0x1078, 0x2a74,
- 0x2001, 0x70b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
- 0x0000, 0x1078, 0x5193, 0x2011, 0x0000, 0x1078, 0x519d, 0x1078,
- 0x4893, 0x1078, 0x4943, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010, 0x7942,
- 0x7924, 0xd1b4, 0x0040, 0x118e, 0x7827, 0x0040, 0xd19c, 0x0040,
- 0x1193, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a,
- 0x0003, 0x0050, 0x11b9, 0x7954, 0xd1ac, 0x00c0, 0x11b9, 0x2009,
- 0x00f8, 0x1078, 0x3292, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
- 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11b1, 0x7824, 0xd0ac, 0x00c0,
- 0x11ed, 0x00f0, 0x11a9, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x0078,
- 0x11f6, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0,
- 0x11bf, 0x2091, 0x6000, 0x00f0, 0x11bf, 0x7853, 0x0400, 0x782f,
- 0x0000, 0x2009, 0x00f8, 0x1078, 0x3292, 0x20a9, 0x000e, 0x0005,
- 0x00f0, 0x11cf, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e4,
- 0x7824, 0xd0ac, 0x00c0, 0x11ed, 0x8319, 0x00c0, 0x11da, 0x2001,
- 0x0001, 0x1078, 0x1f8a, 0x0078, 0x11f4, 0x7828, 0xc09d, 0x782a,
- 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f,
- 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120c,
- 0x704f, 0xffff, 0x0078, 0x120e, 0x704f, 0x0000, 0x7053, 0xffff,
- 0x2061, 0x70a0, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800,
- 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000,
- 0x601f, 0x07d0, 0x2061, 0x70a8, 0x6003, 0x8000, 0x6007, 0x0000,
- 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000,
- 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x125b, 0x2011,
- 0x0000, 0x81ff, 0x0040, 0x125a, 0xa186, 0x0001, 0x00c0, 0x124a,
- 0x705f, 0x8fff, 0x7057, 0x7d01, 0x7063, 0x0100, 0x705b, 0x7d00,
- 0x0078, 0x1258, 0xa186, 0x0002, 0x00c0, 0x1252, 0x2011, 0x0000,
- 0x0078, 0x1258, 0xa186, 0x0005, 0x00c0, 0x1258, 0x2011, 0x0001,
- 0x1078, 0x1282, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078,
- 0x1282, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061,
- 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1270, 0xc18d, 0x0078, 0x127d,
- 0xc185, 0x2011, 0x0001, 0x1078, 0x1282, 0x2061, 0xffff, 0x2362,
- 0x2c04, 0xa306, 0x00c0, 0x127d, 0xc195, 0x2011, 0x0001, 0x1078,
- 0x1282, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c,
- 0x2091, 0x8000, 0x0068, 0x128a, 0x007e, 0x017e, 0x2079, 0x0000,
- 0x7818, 0xa084, 0x0000, 0x00c0, 0x1290, 0x017f, 0x792e, 0x007f,
- 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x6f00, 0x7803,
- 0x0005, 0x0078, 0x12a9, 0x007c, 0x2071, 0x6f00, 0x7158, 0x712e,
- 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c2,
- 0x705c, 0xa302, 0x00c8, 0x12c2, 0x220a, 0x2208, 0x2310, 0x8420,
- 0x0078, 0x12b4, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00, 0x7098, 0xa0ea, 0x0010,
- 0x00c8, 0x12d5, 0xa06e, 0x0078, 0x12df, 0x8001, 0x709a, 0x702c,
- 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f,
- 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x127e, 0x2091, 0x8000,
- 0x7098, 0x8001, 0x00c8, 0x12ef, 0xa06e, 0x0078, 0x12f8, 0x709a,
- 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000,
- 0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x6f00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
- 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x1317, 0x6804, 0x6807,
- 0x0000, 0x007e, 0x1078, 0x12fb, 0x0d7f, 0x0078, 0x130b, 0x007c,
- 0x0e7e, 0x2071, 0x6f00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7007, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012,
- 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x70d9,
- 0x7018, 0xa088, 0x70e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
- 0x7004, 0xa005, 0x00c0, 0x134a, 0x0f7e, 0x2079, 0x0010, 0x1078,
- 0x135b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7004,
- 0xa005, 0x00c0, 0x1359, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x135b,
- 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x135e, 0x1362, 0x13cc,
- 0x13e9, 0x13e9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x136a, 0x7007,
- 0x0000, 0x007c, 0x0d7e, 0xa180, 0x70e2, 0x2004, 0x700a, 0x2068,
- 0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832,
- 0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e,
- 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138c, 0x7007,
- 0x0001, 0x1078, 0x1391, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a7,
- 0x007c, 0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040,
- 0x00c8, 0x139c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
- 0x7803, 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e,
- 0x027e, 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014,
- 0x7803, 0x0026, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8,
- 0x13bb, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
- 0x7803, 0x0020, 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099,
- 0x6fe5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
- 0x127e, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000,
- 0xc084, 0x7002, 0x700b, 0x6fe0, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x7014, 0x209c, 0x20a1,
- 0x0014, 0x7803, 0x0026, 0x2001, 0x7015, 0x20ac, 0x53a6, 0x2099,
- 0x7016, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
- 0x127e, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000,
- 0xc08c, 0x7002, 0x700b, 0x7011, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x017e, 0x0e7e, 0x2071, 0x70d9, 0x0f7e, 0x2079, 0x0010,
- 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x142c, 0xa18c, 0x0700,
- 0x0040, 0x1429, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
- 0x142c, 0x7004, 0x1079, 0x1430, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
- 0x135b, 0x1438, 0x145a, 0x1474, 0x149d, 0x1436, 0x0078, 0x1436,
- 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x1391, 0x007c,
- 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078,
- 0x135b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x13a7,
- 0x007c, 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a,
- 0x7838, 0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007,
- 0x0000, 0x1078, 0x135b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
- 0x6fe3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x6fe5, 0x2004, 0xd0bc,
- 0x0040, 0x1493, 0x2001, 0x6fee, 0x2004, 0xa080, 0x000d, 0x20a0,
- 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000,
- 0x1078, 0x39f5, 0x1078, 0x135b, 0x007c, 0x2001, 0x7013, 0x2003,
- 0x0100, 0x7007, 0x0000, 0x1078, 0x135b, 0x007c, 0x127e, 0x2091,
- 0x2100, 0x2079, 0x0030, 0x2071, 0x70ea, 0x7003, 0x0000, 0x700f,
- 0x70f0, 0x7013, 0x70f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x14bc, 0x14c4, 0x150a, 0x14c4, 0x14c4,
- 0x14c4, 0x14ef, 0x14d3, 0x14c8, 0xa085, 0x0001, 0x0078, 0x1524,
- 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c, 0x682a,
- 0x6858, 0x0078, 0x1512, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
- 0x14c4, 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c,
- 0x682a, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0x6858, 0x0078, 0x151a, 0xa18c,
- 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14c4, 0x684c, 0xd0ac, 0x0040,
- 0x14c4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
- 0x0078, 0x151a, 0x684c, 0xd0ac, 0x0040, 0x14c4, 0xa006, 0x682e,
- 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1beb, 0x210c, 0x6932,
- 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1,
- 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x153f, 0xa280,
- 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x153b, 0x1078,
- 0x14b7, 0x10c0, 0x1288, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e,
- 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f,
- 0x7000, 0xa005, 0x00c0, 0x1553, 0x7206, 0x2001, 0x1567, 0x007e,
- 0x2260, 0x0078, 0x167f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108,
- 0x240a, 0x8108, 0xa182, 0x710b, 0x0048, 0x1560, 0x2009, 0x70f0,
- 0x710e, 0x7000, 0xa005, 0x00c0, 0x1567, 0x1078, 0x1668, 0x127f,
- 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100,
- 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110,
- 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x15bb, 0x6808, 0xa005,
- 0x0040, 0x1621, 0x7000, 0xa005, 0x00c0, 0x1588, 0x0078, 0x15b5,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1625, 0x7004, 0xa406, 0x00c0,
- 0x15b5, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x159e, 0x047e,
- 0x1078, 0x1737, 0x047f, 0x2460, 0x0078, 0x157e, 0x2001, 0x0207,
- 0x2004, 0xd09c, 0x00c0, 0x1591, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x15af, 0xa086, 0x6000, 0x0040, 0x15af, 0x0078, 0x1591, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x55fc, 0x0078, 0x1625, 0x6808, 0xa005, 0x0040, 0x1621, 0x7000,
- 0xa005, 0x00c0, 0x15c5, 0x0078, 0x1621, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x15ce, 0x7004, 0xa406, 0x00c0, 0x1621, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15db, 0x047e, 0x1078, 0x1737, 0x047f,
- 0x2460, 0x0078, 0x15bb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15ce, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d4, 0x7804,
- 0xa084, 0x6000, 0x0040, 0x15f2, 0xa086, 0x6000, 0x0040, 0x15f2,
- 0x0078, 0x15ce, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e,
- 0x0001, 0x0040, 0x1613, 0xa08e, 0x0002, 0x00c0, 0x1621, 0x0c7e,
- 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1bc0, 0x2804, 0xac70, 0x6034,
- 0xd09c, 0x00c0, 0x160f, 0x7308, 0x720c, 0x0078, 0x1611, 0x7310,
- 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810,
- 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x2009, 0x0048, 0x1078, 0x55fc, 0x0c7f, 0x0d7f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x70ea, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1665, 0x7004, 0xac06, 0x00c0, 0x1656, 0x2079, 0x0030,
- 0x7804, 0xd0fc, 0x00c0, 0x1652, 0x2001, 0x0207, 0x2004, 0xd09c,
- 0x00c0, 0x1638, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1644,
- 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000,
- 0x0078, 0x1656, 0x1078, 0x1737, 0x0078, 0x162d, 0x157e, 0x20a9,
- 0x0009, 0x2009, 0x70f0, 0x2104, 0xac06, 0x00c0, 0x1660, 0x200a,
- 0xa188, 0x0003, 0x00f0, 0x165b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1670, 0x7003, 0x0000, 0x007c,
+ 0x73b8, 0x1078, 0x2a53, 0x1078, 0x5129, 0x2011, 0x0004, 0x1078,
+ 0x6135, 0x1078, 0x35ef, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
+ 0x0000, 0x1078, 0x1145, 0x2011, 0x0000, 0x2079, 0x6d51, 0x7804,
+ 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
+ 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
+ 0x1078, 0x6135, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
+ 0x0f7f, 0x1078, 0x1ee6, 0x2011, 0x0005, 0x1078, 0x5232, 0x1078,
+ 0x476a, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
+ 0x0078, 0x1144, 0x7003, 0x0003, 0x2001, 0x0000, 0x1078, 0x1dc9,
+ 0x2011, 0x0000, 0x1078, 0x5232, 0x2011, 0x0000, 0x1078, 0x523c,
+ 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x1078, 0x476a,
+ 0x1078, 0x4821, 0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082,
+ 0x2009, 0x007e, 0x1078, 0x342f, 0x8108, 0x00f0, 0x114a, 0x0c7f,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086, 0xffff, 0x0040,
+ 0x115f, 0x1078, 0x1ee6, 0x1078, 0x476a, 0x0078, 0x11a8, 0x70bc,
+ 0xd09c, 0x0040, 0x1187, 0xd084, 0x0040, 0x1187, 0x0f7e, 0x2079,
+ 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, 0x0040, 0x1187,
+ 0x70c0, 0xa086, 0xffff, 0x0040, 0x1183, 0x1078, 0x1fdb, 0x1078,
+ 0x476a, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078, 0x2013, 0x1078,
+ 0x476a, 0x0078, 0x11a8, 0x70c4, 0xa005, 0x00c0, 0x11a8, 0x7088,
+ 0xa005, 0x00c0, 0x11a8, 0x7003, 0x0003, 0x708f, 0xffff, 0x2001,
+ 0x0000, 0x1078, 0x1dc9, 0x1078, 0x2ad1, 0x2001, 0x6f11, 0x2004,
+ 0xa086, 0x0005, 0x00c0, 0x11a0, 0x2011, 0x0000, 0x1078, 0x5232,
+ 0x2011, 0x0000, 0x1078, 0x523c, 0x1078, 0x476a, 0x1078, 0x4821,
+ 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079,
+ 0x0100, 0x7843, 0x0000, 0x7924, 0xd1b4, 0x0040, 0x11b9, 0x7827,
+ 0x0040, 0xd19c, 0x0040, 0x11be, 0x7827, 0x0008, 0x007e, 0x037e,
+ 0x157e, 0x7900, 0xa18a, 0x0003, 0x0050, 0x11e4, 0x7954, 0xd1ac,
+ 0x00c0, 0x11e4, 0x2009, 0x00f8, 0x1078, 0x3233, 0x7843, 0x0090,
+ 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11dc,
+ 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x00f0, 0x11d4, 0x2001, 0x0001,
+ 0x1078, 0x1dc9, 0x0078, 0x1221, 0x7853, 0x0000, 0x782f, 0x0020,
+ 0x20a9, 0x0008, 0x00e0, 0x11ea, 0x2091, 0x6000, 0x00f0, 0x11ea,
+ 0x7853, 0x0400, 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x3233,
+ 0x20a9, 0x000e, 0x0005, 0x00f0, 0x11fa, 0x7853, 0x1400, 0x7843,
+ 0x0090, 0x7843, 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005,
+ 0xd08c, 0x0040, 0x120f, 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x8319,
+ 0x00c0, 0x1205, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x0078, 0x121f,
+ 0x7828, 0xc09d, 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853,
+ 0x0400, 0x157f, 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c,
+ 0x007c, 0x007c, 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082,
+ 0x0002, 0x0048, 0x1237, 0x704f, 0xffff, 0x0078, 0x1239, 0x704f,
+ 0x0000, 0x7053, 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061,
+ 0x6f00, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f,
+ 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f,
+ 0x07d0, 0x2061, 0x6f08, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b,
+ 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b,
+ 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x128a, 0x2011, 0x0000,
+ 0x81ff, 0x0040, 0x1289, 0xa186, 0x0001, 0x00c0, 0x1279, 0x705f,
+ 0x8fff, 0x7057, 0x7c01, 0x7063, 0x0100, 0x705b, 0x7c00, 0x0078,
+ 0x1287, 0xa186, 0x0002, 0x00c0, 0x1281, 0x2011, 0x0000, 0x0078,
+ 0x1287, 0xa186, 0x0005, 0x00c0, 0x1287, 0x2011, 0x0001, 0x1078,
+ 0x12b1, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12b1,
+ 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff,
+ 0x2c04, 0xa406, 0x0040, 0x129f, 0xc18d, 0x0078, 0x12ac, 0xc185,
+ 0x2011, 0x0001, 0x1078, 0x12b1, 0x2061, 0xffff, 0x2362, 0x2c04,
+ 0xa306, 0x00c0, 0x12ac, 0xc195, 0x2011, 0x0001, 0x1078, 0x12b1,
+ 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091,
+ 0x8000, 0x0068, 0x12b9, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818,
+ 0xa084, 0x0000, 0x00c0, 0x12bf, 0x017f, 0x792e, 0x007f, 0x782a,
+ 0x007f, 0x7826, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
+ 0x2091, 0x4080, 0x2079, 0x6d00, 0x7803, 0x0005, 0x0078, 0x12d6,
+ 0x007c, 0x2071, 0x6d00, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
+ 0x002d, 0xa298, 0x002d, 0x0048, 0x12ef, 0x705c, 0xa302, 0x00c8,
+ 0x12ef, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x12e1, 0x200b,
+ 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6d00, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1302, 0xa06e,
+ 0x0078, 0x130c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
+ 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6d00, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
+ 0x131c, 0xa06e, 0x0078, 0x1325, 0x70a2, 0x702c, 0x2068, 0x2d04,
+ 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
+ 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6d00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
+ 0x8dff, 0x0040, 0x1344, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
+ 0x1328, 0x0d7f, 0x0078, 0x1338, 0x007c, 0x0e7e, 0x2071, 0x6d00,
+ 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6f31, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
+ 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2270, 0x700b, 0x0000, 0x2071, 0x6f31, 0x7018, 0xa088, 0x6f3a,
+ 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
+ 0x1377, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x2071, 0x6f31, 0x7004, 0xa005, 0x00c0, 0x1386,
+ 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f, 0x007c,
+ 0x7000, 0x0079, 0x138b, 0x138f, 0x13f9, 0x1416, 0x1416, 0x7018,
+ 0x711c, 0xa106, 0x00c0, 0x1397, 0x7007, 0x0000, 0x007c, 0x0d7e,
+ 0xa180, 0x6f3a, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
+ 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
+ 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
+ 0x0d7f, 0xd084, 0x0040, 0x13b9, 0x7007, 0x0001, 0x1078, 0x13be,
+ 0x007c, 0x7007, 0x0002, 0x1078, 0x13d4, 0x007c, 0x017e, 0x027e,
+ 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13c9, 0x2110,
+ 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
+ 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
+ 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
+ 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e8, 0x2110, 0xa006,
+ 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
+ 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x6dc5, 0x20a1, 0x0018,
+ 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+ 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
+ 0x6dc0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
+ 0x157e, 0x2001, 0x6df4, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
+ 0x2001, 0x6df5, 0x20ac, 0x53a6, 0x2099, 0x6df6, 0x20a1, 0x0018,
+ 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+ 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
+ 0x6df1, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
+ 0x2071, 0x6f31, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
+ 0xd1fc, 0x0040, 0x1459, 0xa18c, 0x0700, 0x0040, 0x1456, 0x7008,
+ 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1459, 0x7004, 0x1079,
+ 0x145d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1388, 0x1465, 0x1487,
+ 0x14a1, 0x14ca, 0x1463, 0x0078, 0x1463, 0x137e, 0x147e, 0x157e,
+ 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
+ 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
+ 0x0040, 0x148e, 0x1078, 0x13be, 0x007c, 0x7008, 0xa080, 0x0002,
+ 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1388, 0x007c, 0x700c,
+ 0xa005, 0x0040, 0x148e, 0x1078, 0x13d4, 0x007c, 0x0d7e, 0x7008,
+ 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
+ 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x1388,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6dc3, 0x2004, 0xa080,
+ 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
+ 0x53a5, 0x2001, 0x6dc5, 0x2004, 0xd0bc, 0x0040, 0x14c0, 0x2001,
+ 0x6dce, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
+ 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x396e, 0x1078,
+ 0x1388, 0x007c, 0x2001, 0x6df3, 0x2003, 0x0100, 0x7007, 0x0000,
+ 0x1078, 0x1388, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
+ 0x2071, 0x6f42, 0x7003, 0x0000, 0x700f, 0x6f48, 0x7013, 0x6f48,
+ 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
+ 0x14e9, 0x14f1, 0x151b, 0x14f1, 0x14f1, 0x14f1, 0x1500, 0x14f1,
+ 0x14f5, 0xa085, 0x0001, 0x0078, 0x1531, 0x684c, 0xd0bc, 0x0040,
+ 0x14f1, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x1523,
+ 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14f1, 0x684c, 0xd0ac,
+ 0x0040, 0x14f1, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1a82, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a,
+ 0x6858, 0x0078, 0x152b, 0x684c, 0xd0ac, 0x0040, 0x14f1, 0xa006,
+ 0x682e, 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1a82, 0x210c,
+ 0x6932, 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006,
+ 0x680a, 0x007c, 0x82ff, 0x0040, 0x1545, 0xa280, 0x0004, 0x0d7e,
+ 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1541, 0x1078, 0x14e4, 0x10c0,
+ 0x12b7, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e,
+ 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005,
+ 0x00c0, 0x1559, 0x7206, 0x2001, 0x156d, 0x007e, 0x2260, 0x0078,
+ 0x164f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108,
+ 0xa182, 0x6f63, 0x0048, 0x1566, 0x2009, 0x6f48, 0x710e, 0x7000,
+ 0xa005, 0x00c0, 0x156d, 0x1078, 0x1638, 0x127f, 0x007c, 0x127e,
+ 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f,
+ 0x037f, 0x027f, 0x0c7e, 0x0d7e, 0x2460, 0x6110, 0x2168, 0x6a62,
+ 0x6b5e, 0xa005, 0x0040, 0x15bc, 0x6808, 0xa005, 0x0040, 0x15ea,
+ 0x7000, 0xa005, 0x00c0, 0x158e, 0x0078, 0x15b4, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15b4, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x1597, 0x7804, 0xa084, 0x6000, 0x0040, 0x15ae,
+ 0xa086, 0x6000, 0x0040, 0x15ae, 0x0078, 0x1597, 0x7803, 0x0004,
+ 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591,
+ 0x0078, 0x15ee, 0x0078, 0x15ee, 0x6808, 0xa005, 0x0040, 0x15ea,
+ 0x7000, 0xa005, 0x00c0, 0x15c6, 0x0078, 0x15ea, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15ea, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x15cf, 0x7804, 0xa084, 0x6000, 0x0040, 0x15e6,
+ 0xa086, 0x6000, 0x0040, 0x15e6, 0x0078, 0x15cf, 0x7803, 0x0004,
+ 0x7003, 0x0000, 0x2009, 0x0048, 0x1078, 0x5591, 0x0d7f, 0x0c7f,
+ 0x127f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x6f42, 0x7000, 0xa086,
+ 0x0000, 0x0040, 0x1635, 0x7004, 0xac06, 0x00c0, 0x1626, 0x2079,
+ 0x0030, 0x7804, 0xd0fc, 0x00c0, 0x1622, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x1601, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0,
+ 0x160d, 0x7908, 0xd1ec, 0x00c0, 0x1619, 0x2009, 0x0009, 0x0078,
+ 0x161b, 0x2009, 0x0019, 0x7803, 0x0002, 0x7902, 0x7003, 0x0003,
+ 0x0078, 0x1635, 0x1078, 0x16e5, 0x0078, 0x15f6, 0x157e, 0x20a9,
+ 0x0009, 0x2009, 0x6f48, 0x2104, 0xac06, 0x00c0, 0x1630, 0x200a,
+ 0xa188, 0x0003, 0x00f0, 0x162b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
+ 0x700c, 0x7110, 0xa106, 0x00c0, 0x1640, 0x7003, 0x0000, 0x007c,
0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108,
- 0xa182, 0x710b, 0x0048, 0x167e, 0x2009, 0x70f0, 0x7112, 0x8cff,
- 0x00c0, 0x169e, 0x7908, 0xd1ec, 0x00c0, 0x1692, 0x1078, 0x190d,
- 0x0040, 0x1692, 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168c,
- 0x7803, 0x0006, 0x7007, 0x0000, 0x1078, 0x190d, 0x0040, 0x16c5,
- 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x16c5, 0x6010, 0x2068,
- 0x2d58, 0x6828, 0xa406, 0x00c0, 0x16a9, 0x682c, 0xa306, 0x0040,
- 0x16ad, 0x1078, 0x1c0b, 0x00c0, 0x1682, 0x684c, 0xd0f4, 0x00c0,
- 0x1682, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
- 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078, 0x16c6, 0x0040, 0x16c4,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x2d58, 0x007c, 0x8aff, 0x0040,
- 0x1732, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e5, 0x0d7e,
- 0x2804, 0xac68, 0x2900, 0x0079, 0x16d5, 0x1714, 0x16f5, 0x16f5,
- 0x1714, 0x1714, 0x170c, 0x1714, 0x16f5, 0x1714, 0x16fb, 0x16fb,
- 0x1714, 0x1714, 0x1714, 0x1703, 0x16fb, 0xc0fc, 0x6852, 0x6b6c,
- 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1717, 0x2804,
- 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1717, 0x6b08, 0x6a0c, 0x6d00,
- 0x6c04, 0x0078, 0x1717, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
- 0x6e0c, 0x0078, 0x1717, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
- 0xa086, 0x001e, 0x00c0, 0x1714, 0x0d7f, 0x1078, 0x1ba7, 0x00c0,
- 0x16c6, 0xa00e, 0x0078, 0x1732, 0x0d7f, 0x1078, 0x1288, 0x7b22,
- 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
- 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
- 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816,
- 0x1078, 0x1ba7, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1735, 0xa184, 0x0003,
- 0xa086, 0x0003, 0x0040, 0x1735, 0x7000, 0x0079, 0x174f, 0x1757,
- 0x1759, 0x182a, 0x188e, 0x18a5, 0x1757, 0x1757, 0x1757, 0x1078,
- 0x1288, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0, 0x176e, 0x8aff,
- 0x0040, 0x17ca, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0040, 0x18b7,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e, 0x037e, 0x6b28,
- 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a,
- 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101,
- 0x6816, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078,
- 0x1bc0, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003,
- 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x17ab, 0x684c, 0xd0e4, 0x0040, 0x17ab, 0x7004, 0x2060, 0x2009,
- 0x0048, 0x1078, 0x55fc, 0x7808, 0xd0ec, 0x00c0, 0x17b5, 0x7803,
- 0x0009, 0x7003, 0x0004, 0x0078, 0x18b7, 0x1078, 0x1668, 0x0078,
- 0x18b7, 0x057e, 0x7d0c, 0x1078, 0x6e15, 0x057f, 0x1078, 0x18bb,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0,
- 0x17e2, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17de,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x55fc, 0x1078, 0x1668,
- 0x0078, 0x18b7, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183,
- 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007,
- 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a,
- 0x810b, 0x810b, 0x810b, 0x1078, 0x18ea, 0x7803, 0x0004, 0x780f,
- 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1803, 0x7803,
- 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007, 0x0000,
- 0x2060, 0x2009, 0x0048, 0x1078, 0x55fc, 0x1078, 0x190d, 0x0040,
- 0x17de, 0x7908, 0xd1ec, 0x00c0, 0x1821, 0x2009, 0x0009, 0x0078,
- 0x1823, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x8001, 0x7002, 0xd194, 0x0040, 0x183c, 0x7804,
- 0xd0fc, 0x00c0, 0x173f, 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001,
- 0x1078, 0x16c6, 0x0078, 0x18b7, 0xa184, 0x0880, 0x00c0, 0x1849,
- 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078,
- 0x18b7, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x187d,
- 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0, 0x0d7e, 0x0f7e,
- 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x186d, 0x6808,
- 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c,
- 0x7814, 0xa101, 0x7816, 0x0078, 0x1879, 0x6810, 0x2008, 0xa31a,
- 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101,
- 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1779, 0x057e, 0x7d0c, 0x1078,
- 0x6e15, 0x057f, 0x1078, 0x18bb, 0x697c, 0x6912, 0x6980, 0x6916,
- 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x18a1, 0x6808, 0x8001,
- 0x680a, 0x00c0, 0x18a1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x55fc, 0x1078, 0x1668, 0x0078, 0x18b7, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x18a1, 0x2068,
- 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x167f, 0x017f,
- 0x007f, 0x127f, 0x007c, 0x1078, 0x18cc, 0x20e1, 0x9028, 0x700f,
- 0x70f0, 0x7013, 0x70f0, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102,
- 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003,
- 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0,
- 0x18e9, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x18e9,
- 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18e9, 0x8421, 0x00c0,
- 0x18d3, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
- 0xa084, 0xf000, 0xa10d, 0x1078, 0x18cc, 0x20e1, 0x7000, 0x7324,
- 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e,
- 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138,
- 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908,
- 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x191a, 0xa085, 0x0001,
- 0x0078, 0x192c, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1925, 0x20e1,
- 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c,
- 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e,
- 0x2071, 0x710b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
- 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x19b1, 0x6934, 0xa184,
- 0x0007, 0x0079, 0x1943, 0x194b, 0x199c, 0x194b, 0x194b, 0x194b,
- 0x1981, 0x195e, 0x194d, 0x1078, 0x1288, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x19a4, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x194b, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0x0078,
- 0x19ad, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x19b1, 0x684c,
- 0xd0b4, 0x0040, 0x1ab3, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0xa006,
- 0x682e, 0x682a, 0x0078, 0x19ad, 0x684c, 0xd0b4, 0x0040, 0x1733,
- 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084,
- 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd,
- 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc,
- 0x10c0, 0x1ab7, 0x0e7e, 0x0d7e, 0x2071, 0x710b, 0x7000, 0xa005,
- 0x00c0, 0x1a2d, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004,
- 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e,
- 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004,
- 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060,
- 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007,
- 0x0040, 0x19ef, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108,
- 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a,
- 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0,
- 0x1a06, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a13, 0x037e, 0x047e,
- 0x6b14, 0x6c10, 0x1078, 0x1c0b, 0x047f, 0x037f, 0x0040, 0x1a13,
- 0x0c7f, 0x0078, 0x1a2d, 0x8aff, 0x00c0, 0x1a1b, 0x0c7f, 0xa085,
- 0x0001, 0x0078, 0x1a2d, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020,
- 0x2009, 0x0001, 0x1078, 0x1a31, 0x0040, 0x1a2a, 0x2009, 0x0001,
- 0x1078, 0x1a31, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff,
- 0x0040, 0x1aac, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203,
- 0x0048, 0x1aab, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a5e,
- 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1a4e, 0x1a8d, 0x1a6e,
- 0x1a6e, 0x1a8d, 0x1a8d, 0x1a85, 0x1a8d, 0x1a6e, 0x1a8d, 0x1a74,
- 0x1a74, 0x1a8d, 0x1a8d, 0x1a8d, 0x1a7c, 0x1a74, 0xc0fc, 0x6852,
- 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a91, 0x0d7e,
- 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x6b08, 0x6a0c,
- 0x6d00, 0x6c04, 0x0078, 0x1a90, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
- 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x0d7f, 0x0d7e, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1a8d, 0x0d7f, 0x1078, 0x1ba7,
- 0x00c0, 0x1a37, 0xa00e, 0x0078, 0x1aac, 0x0d7f, 0x1078, 0x1288,
- 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902,
- 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201,
- 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078,
- 0x1ba7, 0x0078, 0x1aac, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f,
- 0x067f, 0x077f, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x2079, 0x0020, 0x2071, 0x710b, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1ab5, 0x7000, 0x0079,
- 0x1ad1, 0x1b78, 0x1ad5, 0x1b45, 0x1b76, 0x8001, 0x7002, 0xd19c,
- 0x00c0, 0x1ae9, 0x8aff, 0x0040, 0x1b08, 0x2009, 0x0001, 0x1078,
- 0x1a31, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31, 0x0078,
- 0x1b78, 0x7803, 0x0004, 0xd194, 0x0040, 0x1af9, 0x6850, 0xc0fc,
- 0x6852, 0x8aff, 0x00c0, 0x1afe, 0x684c, 0xc0f5, 0x684e, 0x0078,
- 0x1afe, 0x1078, 0x1bc0, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826,
- 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b78,
- 0x711c, 0x81ff, 0x0040, 0x1b1e, 0x7918, 0x7922, 0x7827, 0x0000,
- 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e,
- 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1b78, 0x0f7e, 0x027e,
- 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284,
- 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b2c,
- 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803,
- 0x0008, 0x7003, 0x0000, 0x0078, 0x1b78, 0x8001, 0x7002, 0xd194,
- 0x0040, 0x1b5a, 0x7804, 0xd0fc, 0x00c0, 0x1ac7, 0xd19c, 0x00c0,
- 0x1b74, 0x8aff, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31,
- 0x0078, 0x1b78, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0,
- 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b6d, 0x6808,
- 0xa31a, 0x680c, 0xa213, 0x0078, 0x1b71, 0x6810, 0xa31a, 0x6814,
- 0xa213, 0x0d7f, 0x0078, 0x1af9, 0x0078, 0x1af9, 0x1078, 0x1288,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c,
- 0x0f7e, 0x0e7e, 0x2071, 0x710b, 0x7000, 0xa086, 0x0000, 0x0040,
- 0x1ba4, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040,
- 0x1b8b, 0x1078, 0x1ab7, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b8b,
- 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b9a, 0x20e1, 0x9040,
+ 0xa182, 0x6f63, 0x0048, 0x164e, 0x2009, 0x6f48, 0x7112, 0x8cff,
+ 0x00c0, 0x1658, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x167b,
+ 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x1663, 0x682c,
+ 0xa306, 0x0040, 0x1667, 0x1078, 0x1aa2, 0x00c0, 0x1652, 0x6824,
+ 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f,
+ 0x2009, 0x0011, 0x1078, 0x167c, 0x0040, 0x167a, 0x2009, 0x0001,
+ 0x1078, 0x167c, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x16e0, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x169b, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x168b, 0x16ca, 0x16ab, 0x16ab, 0x16ca, 0x16ca,
+ 0x16c2, 0x16ca, 0x16ab, 0x16ca, 0x16b1, 0x16b1, 0x16ca, 0x16ca,
+ 0x16ca, 0x16ca, 0x16b1, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x16cd, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x16cd, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x16cd, 0x7b0c, 0xd3bc, 0x0040, 0x16ba, 0x7b08, 0xa39c, 0x0fff,
+ 0x0078, 0x16bb, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
+ 0x0078, 0x16cd, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x167c, 0xa00e,
+ 0x0078, 0x16e0, 0x0d7f, 0x1078, 0x12b7, 0x7b22, 0x7a26, 0x7d32,
+ 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
+ 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x1078, 0x1a3f,
+ 0x007c, 0x1078, 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2100,
+ 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
+ 0xa184, 0x0700, 0x00c0, 0x16e3, 0xa184, 0x0003, 0xa086, 0x0003,
+ 0x0040, 0x16e3, 0x7000, 0x0079, 0x16fd, 0x1701, 0x1703, 0x1779,
+ 0x17c0, 0x1078, 0x12b7, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0,
+ 0x1718, 0x8aff, 0x0040, 0x175b, 0x2009, 0x0001, 0x1078, 0x167c,
+ 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x1751, 0x027e,
+ 0x037e, 0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872,
+ 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834,
+ 0x6822, 0x1078, 0x1a58, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800,
+ 0x6832, 0x7003, 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001,
+ 0x680a, 0x00c0, 0x174d, 0x684c, 0xd0e4, 0x0040, 0x174d, 0x7004,
+ 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078, 0x1638, 0x0078,
+ 0x17d3, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x1758, 0x1078, 0x6c41,
+ 0x057f, 0x0078, 0x1773, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
+ 0x00c0, 0x1773, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
+ 0x176f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078,
+ 0x1638, 0x0078, 0x17d3, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078,
+ 0x17d3, 0x8001, 0x7002, 0xd194, 0x0040, 0x178b, 0x7804, 0xd0fc,
+ 0x00c0, 0x16ed, 0x8aff, 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078,
+ 0x167c, 0x0078, 0x17d3, 0xa184, 0x0880, 0x00c0, 0x1798, 0x8aff,
+ 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e,
+ 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1a58, 0x0d7e, 0x2804, 0xac68,
+ 0x6034, 0xd09c, 0x00c0, 0x17b2, 0x6808, 0xa31a, 0x680c, 0xa213,
+ 0x0078, 0x17b6, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f, 0x0078,
+ 0x1723, 0x057e, 0x7d0c, 0x1078, 0x6c41, 0x057f, 0x0078, 0x1773,
+ 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x17d1, 0x6808, 0x8001,
+ 0x680a, 0x00c0, 0x17d1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x5591, 0x1078, 0x1638, 0x017f, 0x007f, 0x127f, 0x007c, 0x0e7e,
+ 0x2071, 0x6f63, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
+ 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1836, 0x6934, 0xa184,
+ 0x0007, 0x0079, 0x17eb, 0x17f3, 0x1821, 0x17f3, 0x17f3, 0x17f3,
+ 0x1806, 0x17f3, 0x17f5, 0x1078, 0x12b7, 0x684c, 0xd0b4, 0x0040,
+ 0x192f, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
+ 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1829, 0xa18c, 0x00ff,
+ 0xa186, 0x0015, 0x00c0, 0x1836, 0x684c, 0xd0b4, 0x0040, 0x192f,
+ 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
+ 0x1a82, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0078,
+ 0x1832, 0x684c, 0xd0b4, 0x0040, 0x16e1, 0x6958, 0xa006, 0x682e,
+ 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x1a82,
+ 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c,
+ 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1933, 0x0e7e,
+ 0x0d7e, 0x2071, 0x6f63, 0x7000, 0xa005, 0x00c0, 0x18b2, 0x0c7e,
+ 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x6818, 0x0d7e,
+ 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040, 0x2079,
+ 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f, 0x0d7f,
+ 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
+ 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040, 0x1874, 0x017e,
+ 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116, 0x701e,
+ 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012,
+ 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x188b, 0x6928, 0x6810,
+ 0xa106, 0x0040, 0x1898, 0x037e, 0x047e, 0x6b14, 0x6c10, 0x1078,
+ 0x1aa2, 0x047f, 0x037f, 0x0040, 0x1898, 0x0c7f, 0x0078, 0x18b2,
+ 0x8aff, 0x00c0, 0x18a0, 0x0c7f, 0xa085, 0x0001, 0x0078, 0x18b2,
+ 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x1078,
+ 0x18b6, 0x0040, 0x18af, 0x2009, 0x0001, 0x1078, 0x18b6, 0x127f,
+ 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, 0x067e,
+ 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1928, 0x700c,
+ 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048, 0x1927, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x18e3, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x18d3, 0x1909, 0x18f3, 0x18f3, 0x1909, 0x1909,
+ 0x1901, 0x1909, 0x18f3, 0x1909, 0x18f9, 0x18f9, 0x1909, 0x1909,
+ 0x1909, 0x1909, 0x18f9, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0xd99c, 0x0040, 0x190d, 0x0d7e, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x190c, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x190c, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
+ 0x190c, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x18bc, 0xa00e, 0x0078,
+ 0x1928, 0x0d7f, 0x1078, 0x12b7, 0x0d7f, 0x7b22, 0x7a26, 0x7d32,
+ 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x6828,
+ 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c, 0xa300, 0x700e,
+ 0x7010, 0xa201, 0x7012, 0x1078, 0x1a3f, 0x0078, 0x1928, 0xa006,
+ 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f, 0x007c, 0x1078,
+ 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, 0x2071, 0x6f63,
+ 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700,
+ 0x00c0, 0x1931, 0x7000, 0x0079, 0x194d, 0x1a09, 0x1951, 0x19d6,
+ 0x1a07, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1965, 0x8aff, 0x0040,
+ 0x199a, 0x2009, 0x0001, 0x1078, 0x18b6, 0x0040, 0x1a09, 0x2009,
+ 0x0001, 0x1078, 0x18b6, 0x0078, 0x1a09, 0x7803, 0x0004, 0xd194,
+ 0x0040, 0x1975, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1990,
+ 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1990, 0x027e, 0x037e, 0x6b28,
+ 0x6a2c, 0x701c, 0xa005, 0x10c0, 0x1a11, 0x7820, 0x686e, 0xa31a,
+ 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830,
+ 0x681e, 0x7834, 0x6822, 0x1078, 0x1a58, 0x6850, 0xc0fd, 0x6852,
+ 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000,
+ 0x0078, 0x1a09, 0x711c, 0x81ff, 0x0040, 0x19af, 0x7922, 0x7827,
+ 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
+ 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1a09, 0x0f7e,
+ 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
+ 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
+ 0x19bd, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
+ 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
+ 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1a09, 0x8001, 0x7002,
+ 0xd194, 0x0040, 0x19eb, 0x7804, 0xd0fc, 0x00c0, 0x1943, 0xd19c,
+ 0x00c0, 0x1a05, 0x8aff, 0x0040, 0x1a09, 0x2009, 0x0001, 0x1078,
+ 0x18b6, 0x0078, 0x1a09, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
+ 0x1a58, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x19fe,
+ 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1a02, 0x6810, 0xa31a,
+ 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1979, 0x0078, 0x1975, 0x1078,
+ 0x12b7, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
+ 0x007c, 0x7920, 0xa108, 0x7922, 0x7924, 0xa189, 0x0000, 0x7926,
+ 0x7930, 0xa10a, 0x7932, 0x7934, 0xa18b, 0x0000, 0x7936, 0x007c,
+ 0x0f7e, 0x0e7e, 0x2071, 0x6f63, 0x7000, 0xa086, 0x0000, 0x0040,
+ 0x1a3c, 0x2079, 0x0020, 0x7804, 0xa084, 0x0003, 0x0040, 0x1a36,
+ 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1a32, 0x20e1, 0x9040,
0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840,
- 0x2804, 0xa005, 0x00c0, 0x1bbb, 0x6004, 0xa005, 0x0040, 0x1bbd,
- 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1beb, 0x2044,
- 0x88ff, 0x1040, 0x1288, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
- 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1bda, 0x2c00, 0xad06,
- 0x0040, 0x1bcf, 0x6000, 0xa005, 0x00c0, 0x1bcf, 0x2d00, 0x2060,
- 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1bfb, 0x2044, 0x88ff,
- 0x1040, 0x1288, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
+ 0x2804, 0xa005, 0x00c0, 0x1a53, 0x6004, 0xa005, 0x0040, 0x1a55,
+ 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a82, 0x2044,
+ 0x88ff, 0x1040, 0x12b7, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
+ 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1a72, 0x2c00, 0xad06,
+ 0x0040, 0x1a67, 0x6000, 0xa005, 0x00c0, 0x1a67, 0x2d00, 0x2060,
+ 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a92, 0x2044, 0x88ff,
+ 0x1040, 0x12b7, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021,
- 0x0027, 0x0000, 0x0000, 0x0000, 0x1be0, 0x1bdc, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be0, 0x0000, 0x1be7, 0x1be4, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be7, 0x0000, 0x1be2, 0x1be2, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be2, 0x0000, 0x1be8, 0x1be8, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be8, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055,
- 0x0040, 0x1ca8, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1beb,
- 0xa986, 0x0007, 0x0040, 0x1c24, 0xa986, 0x000e, 0x0040, 0x1c24,
- 0xa986, 0x000f, 0x00c0, 0x1c28, 0x605c, 0xa422, 0x6060, 0xa31a,
- 0x2804, 0xa045, 0x00c0, 0x1c36, 0x0050, 0x1c30, 0x0078, 0x1ca8,
- 0x6004, 0xa065, 0x0040, 0x1ca8, 0x0078, 0x1c13, 0x2804, 0xa005,
- 0x0040, 0x1c54, 0xac68, 0xd99c, 0x00c0, 0x1c44, 0x6808, 0xa422,
- 0x680c, 0xa31b, 0x0078, 0x1c48, 0x6810, 0xa422, 0x6814, 0xa31b,
- 0x0048, 0x1c73, 0x2300, 0xa405, 0x0040, 0x1c5a, 0x8a51, 0x0040,
- 0x1ca8, 0x8840, 0x0078, 0x1c36, 0x6004, 0xa065, 0x0040, 0x1ca8,
- 0x0078, 0x1c13, 0x8a51, 0x0040, 0x1ca8, 0x8840, 0x2804, 0xa005,
- 0x00c0, 0x1c6d, 0x6004, 0xa065, 0x0040, 0x1ca8, 0x6034, 0xa0cc,
- 0x000f, 0xa9c0, 0x1beb, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc,
- 0x6852, 0x0078, 0x1ca0, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000,
- 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c8e,
- 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1288,
- 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1c9a, 0x6910, 0x2400,
- 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1288, 0x6800, 0xa420,
- 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852,
- 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1cad,
+ 0x0027, 0x0000, 0x0000, 0x1a78, 0x1a74, 0x0000, 0x0000, 0x8000,
+ 0x0000, 0x1a78, 0x0000, 0x1a7f, 0x1a7c, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1a7f, 0x0000, 0x1a7a, 0x1a7a, 0x0000, 0x0000, 0x8000,
+ 0x0000, 0x1a7a, 0x0000, 0x1a80, 0x1a80, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1a80, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040,
+ 0x1b28, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1a82, 0xa986,
+ 0x0007, 0x0040, 0x1ab7, 0xa986, 0x000f, 0x00c0, 0x1abb, 0x605c,
+ 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ac9, 0x0050,
+ 0x1ac3, 0x0078, 0x1b28, 0x6004, 0xa065, 0x0040, 0x1b28, 0x0078,
+ 0x1aaa, 0x2804, 0xa005, 0x0040, 0x1ae7, 0xac68, 0xd99c, 0x00c0,
+ 0x1ad7, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0078, 0x1adb, 0x6810,
+ 0xa422, 0x6814, 0xa31b, 0x0048, 0x1af5, 0x2300, 0xa405, 0x0040,
+ 0x1aed, 0x8a51, 0x0040, 0x1b28, 0x8840, 0x0078, 0x1ac9, 0x6004,
+ 0xa065, 0x0040, 0x1b28, 0x0078, 0x1aaa, 0x8a51, 0x8840, 0x2b68,
+ 0x6850, 0xc0fc, 0x6852, 0x0078, 0x1b22, 0x8422, 0x8420, 0x831a,
+ 0xa399, 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c,
+ 0x00c0, 0x1b10, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b,
+ 0x1048, 0x12b7, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1b1c,
+ 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12b7,
+ 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850,
+ 0xc0fd, 0x6852, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1b2d,
0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005,
- 0x2004, 0xa084, 0x0007, 0x0079, 0x1cb5, 0x1cbd, 0x1cbe, 0x1cc1,
- 0x1cc4, 0x1cc9, 0x1ccc, 0x1cd1, 0x1cd6, 0x007c, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1737, 0x007c, 0x1078, 0x1737, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1411, 0x007c, 0x1078, 0x1ab7, 0x1078, 0x1411,
- 0x007c, 0x1078, 0x1737, 0x1078, 0x1411, 0x007c, 0x1078, 0x1737,
- 0x1078, 0x1ab7, 0x1078, 0x1411, 0x007c, 0x127e, 0x2091, 0x2300,
- 0x2079, 0x0200, 0x2071, 0x7380, 0x2069, 0x6f00, 0x2009, 0x0004,
- 0x7912, 0x7817, 0x0004, 0x1078, 0x1fb7, 0x781b, 0x0002, 0x20e1,
- 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084,
- 0x0007, 0x0079, 0x1cfb, 0x1d1f, 0x1d03, 0x1d07, 0x1d0b, 0x1d11,
- 0x1d15, 0x1d19, 0x1d1d, 0x1078, 0x3e23, 0x0078, 0x1d1f, 0x1078,
- 0x3e52, 0x0078, 0x1d1f, 0x1078, 0x3e23, 0x1078, 0x3e52, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x127f,
- 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040,
- 0x1d2b, 0x1078, 0x1288, 0xa184, 0x0030, 0x0040, 0x1d3c, 0x6a00,
- 0xa286, 0x0003, 0x00c0, 0x1d36, 0x1078, 0x1288, 0x1078, 0x3229,
- 0x20e1, 0x9010, 0x0078, 0x1d48, 0xa184, 0x00c0, 0x0040, 0x1d42,
- 0x1078, 0x1288, 0xa184, 0x0300, 0x0040, 0x1d48, 0x20e1, 0x9020,
- 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e,
- 0x2071, 0x6f00, 0x7128, 0x2001, 0x70a3, 0x2102, 0x2001, 0x70ab,
- 0x2102, 0xa182, 0x0211, 0x00c8, 0x1d61, 0x2009, 0x0008, 0x0078,
- 0x1d8b, 0xa182, 0x0259, 0x00c8, 0x1d69, 0x2009, 0x0007, 0x0078,
- 0x1d8b, 0xa182, 0x02c1, 0x00c8, 0x1d71, 0x2009, 0x0006, 0x0078,
- 0x1d8b, 0xa182, 0x0349, 0x00c8, 0x1d79, 0x2009, 0x0005, 0x0078,
- 0x1d8b, 0xa182, 0x0421, 0x00c8, 0x1d81, 0x2009, 0x0004, 0x0078,
- 0x1d8b, 0xa182, 0x0581, 0x00c8, 0x1d89, 0x2009, 0x0003, 0x0078,
- 0x1d8b, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182, 0x0005,
- 0x00c8, 0x1d95, 0x7916, 0x0078, 0x1d97, 0x7817, 0x0004, 0x1078,
- 0x1fb7, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2061, 0x0100, 0x2071, 0x6f00, 0x6024, 0x6026, 0x6033, 0x00ef,
- 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7,
- 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af,
- 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6f2b,
- 0x2003, 0x0000, 0x2001, 0x6f2a, 0x2003, 0x0001, 0x007c, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c,
- 0x00c0, 0x1dd6, 0xa184, 0x0007, 0x0079, 0x1ddc, 0xa195, 0x0004,
- 0xa284, 0x0007, 0x0079, 0x1ddc, 0x1e08, 0x1de4, 0x1de8, 0x1dec,
- 0x1df2, 0x1df6, 0x1dfc, 0x1e02, 0x1078, 0x42ff, 0x0078, 0x1e08,
- 0x1078, 0x43ee, 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x42ff,
- 0x0078, 0x1e08, 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x42ff,
- 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x1e0d,
- 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x42ff, 0x1078, 0x1e0d,
- 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1ebd,
- 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196,
- 0xff00, 0x0040, 0x1e3c, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116,
- 0x0040, 0x1e3c, 0x7130, 0xd18c, 0x00c0, 0x1e3c, 0x2011, 0x6f52,
- 0x2214, 0xd2ec, 0x0040, 0x1e30, 0xc18d, 0x7132, 0x0078, 0x1e3c,
- 0x6240, 0xa294, 0x0010, 0x0040, 0x1e7a, 0x6248, 0xa294, 0xff00,
- 0xa296, 0xff00, 0x00c0, 0x1e7a, 0x037e, 0x73b0, 0x2011, 0x8013,
- 0x1078, 0x29fa, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0x6f52,
- 0x220c, 0xd1a4, 0x0040, 0x1e62, 0x017e, 0x2009, 0x0001, 0x2011,
- 0x0100, 0x1078, 0x42cd, 0x2019, 0x000e, 0x1078, 0x6d5c, 0xa484,
- 0x00ff, 0x1078, 0x1fe4, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
- 0x6dc4, 0x017f, 0xd1ac, 0x00c0, 0x1e6b, 0x2019, 0x0004, 0x1078,
- 0x2186, 0x0078, 0x1e7a, 0x157e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x1078, 0x34cb, 0x00c0, 0x1e76, 0x1078, 0x32cf, 0x8108, 0x00f0,
- 0x1e70, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
- 0x1078, 0x3292, 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0000,
- 0x0040, 0x1e92, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140,
- 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x5193, 0x2011,
- 0x0002, 0x1078, 0x519d, 0x1078, 0x50a9, 0x1078, 0x4204, 0x037e,
- 0x2019, 0x0000, 0x1078, 0x513b, 0x037f, 0x60e3, 0x0000, 0x017f,
- 0x2001, 0x6f00, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1eb5, 0xd19c,
- 0x00c0, 0x1eb5, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001,
- 0x6f1e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1f5e,
- 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0001, 0x00c0, 0x1ee1,
- 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x2079, 0x70b6, 0x7807, 0x0000, 0x7833,
- 0x0000, 0x1078, 0x4893, 0x1078, 0x4943, 0x017f, 0x0f7f, 0x0078,
- 0x1f5e, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040, 0x1f16, 0x1078,
- 0x4204, 0x1078, 0x4f8e, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x1ef9, 0x6803, 0x1000, 0x6803,
- 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6028, 0xa09a, 0x0002,
- 0x00c8, 0x1f09, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x4f80, 0x0078,
- 0x1f5d, 0x2019, 0x70bf, 0x2304, 0xa065, 0x0040, 0x1f13, 0x2009,
- 0x0027, 0x1078, 0x55fc, 0x0c7f, 0x0078, 0x1f5d, 0xd2bc, 0x0040,
- 0x1f5d, 0x1078, 0x4212, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e,
- 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1f2b, 0x6803,
- 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6044,
- 0xa09a, 0x0002, 0x00c8, 0x1f4c, 0x8000, 0x6046, 0x603c, 0x0c7f,
- 0xa005, 0x0040, 0x1f5d, 0x1078, 0x4209, 0xa080, 0x0007, 0x2004,
- 0xa086, 0x0006, 0x00c0, 0x1f48, 0x6017, 0x0012, 0x0078, 0x1f5d,
- 0x6017, 0x0016, 0x0078, 0x1f5d, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x513b, 0x037f, 0x2019, 0x70c5, 0x2304, 0xa065, 0x0040, 0x1f5c,
- 0x2009, 0x004f, 0x1078, 0x55fc, 0x0c7f, 0x017f, 0xd19c, 0x0040,
- 0x1f86, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078,
- 0x5193, 0x2011, 0x0002, 0x1078, 0x519d, 0x1078, 0x50a9, 0x1078,
- 0x4204, 0x037e, 0x2019, 0x0000, 0x1078, 0x513b, 0x037f, 0x60e3,
- 0x0000, 0x1078, 0x6e33, 0x1078, 0x6e51, 0x2001, 0x6f00, 0x2003,
- 0x0004, 0x6027, 0x0008, 0x1078, 0x117d, 0x017f, 0xa18c, 0xffd0,
- 0x6126, 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x6f00, 0x71a8, 0x70aa, 0xa116, 0x0040,
- 0x1fb0, 0x81ff, 0x0040, 0x1fa2, 0x2011, 0x8011, 0x1078, 0x29fa,
- 0x0078, 0x1fb0, 0x2011, 0x8012, 0x1078, 0x29fa, 0x037e, 0x0c7e,
- 0x2061, 0x0100, 0x2019, 0x0028, 0x1078, 0x2186, 0x0c7f, 0x037f,
- 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e,
- 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1fd2, 0x2204,
- 0x60f2, 0xa192, 0x0005, 0x00c8, 0x1fc9, 0xa190, 0x1fdb, 0x0078,
- 0x1fcb, 0x2011, 0x1fdf, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f,
- 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, 0x0348,
- 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140,
- 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0xa080, 0x2207, 0x200c, 0xa18c,
- 0xff00, 0x810f, 0x007c, 0xa080, 0x2207, 0x200c, 0xa18c, 0x00ff,
- 0x007c, 0x2011, 0x2015, 0x2019, 0x201f, 0x2025, 0x202b, 0x2031,
- 0x2039, 0x2041, 0x2047, 0x204d, 0x2055, 0x205d, 0x2065, 0x206d,
- 0x2077, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x107e, 0x007e, 0x0078, 0x209a, 0x107e, 0x007e, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078,
- 0x209a, 0x0005, 0x0078, 0x2081, 0xb084, 0x003c, 0x8004, 0x8004,
- 0x0079, 0x208a, 0x209a, 0x2017, 0x201b, 0x2021, 0x2027, 0x202d,
- 0x2033, 0x203b, 0x2043, 0x2049, 0x204f, 0x2057, 0x205f, 0x2067,
- 0x206f, 0x2079, 0x0008, 0x2084, 0x007f, 0x107f, 0x2091, 0x8001,
- 0x007c, 0x0c7e, 0x027e, 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff,
- 0x0040, 0x20f0, 0x037e, 0x7384, 0xa38e, 0xffff, 0x00c0, 0x20b2,
- 0x2019, 0x0001, 0x8314, 0xa2e0, 0x74c0, 0x2c04, 0xa38c, 0x0001,
- 0x0040, 0x20bf, 0xa084, 0xff00, 0x8007, 0x0078, 0x20c1, 0xa084,
- 0x00ff, 0xa70e, 0x0040, 0x20e5, 0xa08e, 0x0000, 0x0040, 0x20e5,
- 0xa08e, 0x00ff, 0x0040, 0x20eb, 0x1078, 0x1fe4, 0x1078, 0x3494,
- 0x00c0, 0x20e8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x20df, 0x1078, 0x2138, 0x0040, 0x20e8, 0x0078, 0x20e5, 0x1078,
- 0x21d3, 0x1078, 0x215f, 0x0040, 0x20e8, 0x8318, 0x0078, 0x20b2,
- 0x7386, 0x0078, 0x20ed, 0x7087, 0xffff, 0x037f, 0x0078, 0x2135,
- 0xa780, 0x2207, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e,
- 0x2009, 0x0000, 0x7084, 0xa096, 0xffff, 0x0040, 0x210c, 0xa092,
- 0x007e, 0x0048, 0x2107, 0x7087, 0xffff, 0x0078, 0x2132, 0x2008,
- 0x2011, 0x007e, 0xa202, 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106,
- 0x0040, 0x2129, 0x1078, 0x3494, 0x00c0, 0x2132, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2123, 0x1078, 0x2138, 0x0040,
- 0x2132, 0x0078, 0x2129, 0x1078, 0x21d3, 0x1078, 0x215f, 0x0040,
- 0x2132, 0x017f, 0x8108, 0x157f, 0x00f0, 0x210c, 0x7087, 0xffff,
- 0x0078, 0x2135, 0x017f, 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c,
- 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x556f, 0x0040,
- 0x215a, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
- 0x3463, 0x2001, 0x0000, 0x1078, 0x3477, 0x127e, 0x2091, 0x8000,
- 0x7080, 0x8000, 0x7082, 0x127f, 0x2009, 0x0004, 0x1078, 0x55fc,
- 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e,
- 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x556f, 0x0040, 0x2181,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2001, 0x0002, 0x1078, 0x3477, 0x127e, 0x2091, 0x8000, 0x7080,
- 0x8000, 0x7082, 0x127f, 0x2009, 0x0002, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e,
- 0x067e, 0x037e, 0x027e, 0x1078, 0x4582, 0x1078, 0x4532, 0x1078,
- 0x59e4, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb,
- 0x00c0, 0x219e, 0x1078, 0x364c, 0x1078, 0x32cf, 0x017f, 0x8108,
- 0x00f0, 0x2195, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0,
- 0x027e, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08,
- 0x1078, 0x6bfe, 0x017f, 0x2e60, 0x1078, 0x364c, 0x1078, 0x32cf,
- 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
- 0x2071, 0x6f00, 0x7080, 0xa005, 0x0040, 0x21d0, 0x8001, 0x7082,
- 0x007f, 0x0e7f, 0x007c, 0x6000, 0xc08c, 0x6002, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x81ff, 0x00c0, 0x21e4,
- 0x20a9, 0x0001, 0x0078, 0x21e8, 0x20a9, 0x007e, 0x2011, 0x0000,
- 0x027e, 0xa2e0, 0x7020, 0x2c64, 0x8cff, 0x0040, 0x21fa, 0x2019,
- 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe,
- 0x1078, 0x364c, 0x027f, 0x8210, 0x00f0, 0x21e8, 0x027e, 0x027f,
- 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x7eef,
- 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
- 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
- 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
- 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
- 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
- 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
- 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
- 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
- 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
- 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
- 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
- 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
- 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
- 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
- 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
- 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
- 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
- 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
- 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
- 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
- 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
- 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
- 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
- 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
- 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
- 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x2071,
- 0x6f6d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e,
- 0x7033, 0x6f7d, 0x7037, 0x6f7d, 0x7007, 0x0001, 0x2061, 0x6fbd,
- 0x6003, 0x0002, 0x007c, 0x0090, 0x231e, 0x0068, 0x231e, 0x2071,
- 0x6f6d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x231e, 0x2a60, 0x7820,
- 0xa08e, 0x0069, 0x00c0, 0x2405, 0x0079, 0x23a2, 0x007c, 0x2071,
- 0x6f6d, 0x7004, 0x0079, 0x2324, 0x2328, 0x2329, 0x2333, 0x2345,
- 0x007c, 0x0090, 0x2332, 0x0068, 0x2332, 0x2b78, 0x7818, 0xd084,
- 0x0040, 0x2351, 0x007c, 0x2b78, 0x2061, 0x6fbd, 0x6008, 0xa08e,
- 0x0100, 0x0040, 0x2340, 0xa086, 0x0200, 0x0040, 0x23fd, 0x007c,
- 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834,
- 0xa086, 0x0103, 0x0040, 0x234d, 0x007c, 0x2a60, 0x2b78, 0x7018,
- 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x235a, 0x61a8,
- 0x0079, 0x2362, 0x2100, 0xa08a, 0x0036, 0x00c8, 0x23f9, 0x61a8,
- 0x0079, 0x23a2, 0x23db, 0x240d, 0x2415, 0x2419, 0x2421, 0x2427,
- 0x242b, 0x2434, 0x2438, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x23f9,
- 0x2448, 0x23f9, 0x2458, 0x246f, 0x2486, 0x2502, 0x2507, 0x2534,
- 0x2581, 0x2590, 0x25b1, 0x25e7, 0x25f1, 0x25fe, 0x2611, 0x2629,
- 0x2632, 0x266f, 0x2675, 0x23f9, 0x2680, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2684, 0x268a, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2692, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x269f, 0x26a5, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x26b7, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2704, 0x27d1, 0x27e5, 0x27ec, 0x284f, 0x28a0,
- 0x28ab, 0x28ed, 0x28fa, 0x2907, 0x290a, 0x26bb, 0x2933, 0x297a,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2a81, 0x2a8f, 0x2a9c, 0x2ad6,
- 0x713c, 0x0078, 0x23db, 0x2021, 0x4000, 0x1078, 0x29d4, 0x127e,
- 0x2091, 0x8000, 0x0068, 0x23e8, 0x7818, 0xd084, 0x0040, 0x23eb,
- 0x127f, 0x0078, 0x23df, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a,
- 0x7b2e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f,
- 0x007c, 0x2021, 0x4001, 0x0078, 0x23dd, 0x2021, 0x4002, 0x0078,
- 0x23dd, 0x2021, 0x4003, 0x0078, 0x23dd, 0x2021, 0x4005, 0x0078,
- 0x23dd, 0x2021, 0x4006, 0x0078, 0x23dd, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x29e3, 0x7823, 0x0004, 0x7824,
- 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x29e7, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x23db, 0x7924,
- 0x2114, 0x0078, 0x23db, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9,
- 0x0007, 0x53a3, 0x0078, 0x23db, 0x7824, 0x2060, 0x0078, 0x244a,
- 0x2009, 0x0001, 0x2011, 0x000f, 0x2019, 0x0007, 0x0078, 0x23db,
- 0x7d38, 0x7c3c, 0x0078, 0x240f, 0x7d38, 0x7c3c, 0x0078, 0x241b,
- 0x2061, 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109,
- 0x00c0, 0x244c, 0x2010, 0xa005, 0x0040, 0x23db, 0x0078, 0x2401,
- 0x2061, 0x6f51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019,
- 0x0040, 0x2409, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056,
- 0xa006, 0x605a, 0x605e, 0x1078, 0x3917, 0x0078, 0x23db, 0x2061,
- 0x6f51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019, 0x0040,
- 0x2409, 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006,
- 0x606a, 0x606e, 0x1078, 0x36ed, 0x0078, 0x23db, 0xa02e, 0x2520,
- 0x81ff, 0x00c0, 0x2405, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005,
- 0x20a1, 0x6f74, 0x41a1, 0x1078, 0x29ab, 0x0040, 0x2405, 0x2009,
- 0x0020, 0x1078, 0x29e3, 0x701b, 0x249e, 0x007c, 0x6834, 0x2008,
- 0xa084, 0x00ff, 0xa096, 0x0011, 0x0040, 0x24aa, 0xa096, 0x0019,
- 0x00c0, 0x2405, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x2405, 0x710e,
- 0x700c, 0x8001, 0x0040, 0x24db, 0x700e, 0x1078, 0x29ab, 0x0040,
- 0x2405, 0x2009, 0x0020, 0x2061, 0x6fbd, 0x6224, 0x6328, 0x642c,
- 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
- 0x0000, 0x1078, 0x29e3, 0x701b, 0x24ce, 0x007c, 0x6834, 0xa084,
- 0x00ff, 0xa096, 0x0002, 0x0040, 0x24d9, 0xa096, 0x000a, 0x00c0,
- 0x2405, 0x0078, 0x24b0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x33c8, 0x00c0, 0x24e9, 0x7007, 0x0003, 0x701b, 0x24eb,
- 0x007c, 0x1078, 0x37b0, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005,
- 0x2099, 0x6f74, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1,
- 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f,
- 0x0078, 0x29e7, 0x6190, 0x7824, 0x6092, 0x0078, 0x23db, 0x2091,
- 0x8000, 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f,
- 0x2020, 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061,
- 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a,
- 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003,
- 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x2405, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x7c28, 0x7d2c, 0x1078, 0x360f, 0xd28c,
- 0x00c0, 0x2546, 0x1078, 0x359f, 0x0078, 0x2548, 0x1078, 0x35db,
- 0x00c0, 0x2572, 0x2061, 0x7500, 0x127e, 0x2091, 0x8000, 0x6000,
- 0xa086, 0x0000, 0x0040, 0x2560, 0x6010, 0xa06d, 0x0040, 0x2560,
- 0x683c, 0xa406, 0x00c0, 0x2560, 0x6840, 0xa506, 0x0040, 0x256b,
- 0x127f, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x2405, 0x0078, 0x254c, 0x1078, 0x6019, 0x127f, 0x0040, 0x2405,
- 0x0078, 0x23db, 0xa00e, 0x2001, 0x0005, 0x1078, 0x37b0, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x63dd, 0x1078, 0x3720, 0x127f, 0x0078,
- 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x1078, 0x3554, 0x1078, 0x3620, 0x0040, 0x2405, 0x0078, 0x23db,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x2031,
- 0x000f, 0x1078, 0x3554, 0x8631, 0x00c8, 0x2599, 0x2019, 0x0005,
- 0x1078, 0x3641, 0x0040, 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2409, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4194, 0x0078,
- 0x23db, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0, 0x25e1, 0x2029,
- 0x007d, 0x644c, 0x2400, 0xa506, 0x0040, 0x25db, 0x2508, 0x1078,
- 0x34cb, 0x00c0, 0x25db, 0x2031, 0x000f, 0x1078, 0x3554, 0x8631,
- 0x00c8, 0x25c5, 0x2019, 0x0004, 0x1078, 0x3641, 0x0040, 0x25e1,
- 0x7824, 0xa08a, 0x1000, 0x00c8, 0x25e4, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x4194, 0x8529, 0x00c8, 0x25ba, 0x127f, 0x0078,
- 0x23db, 0x127f, 0x0078, 0x2405, 0x127f, 0x0078, 0x2409, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x1078, 0x3584, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x1078, 0x356d, 0x1078, 0x360f, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x35de, 0x0040,
- 0x2405, 0x1078, 0x3410, 0x1078, 0x3598, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x3554, 0x62a0,
- 0x2019, 0x0005, 0x0c7e, 0x1078, 0x364c, 0x0c7f, 0x1078, 0x457b,
- 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x360f, 0x2208,
- 0x0078, 0x23db, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0x6fff, 0x6810,
- 0x6914, 0xa10a, 0x00c8, 0x263e, 0x2009, 0x0000, 0x6816, 0x2011,
- 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d, 0x2069, 0x7020, 0x2d04,
- 0xa075, 0x0040, 0x2653, 0x704c, 0x1078, 0x265d, 0xa210, 0x7080,
- 0x1078, 0x265d, 0xa318, 0x8d68, 0x00f0, 0x2647, 0x2300, 0xa218,
- 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x23db, 0x0f7e, 0x017e, 0xa07d,
- 0x0040, 0x266c, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040,
- 0x266c, 0x2178, 0x0078, 0x2664, 0x017f, 0x0f7f, 0x007c, 0x2069,
- 0x6fff, 0x6910, 0x6294, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405,
- 0x614c, 0xa190, 0x2207, 0x2214, 0xa294, 0x00ff, 0x0078, 0x23db,
- 0x613c, 0x6240, 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6244, 0x6338,
- 0x0078, 0x23db, 0x613c, 0x6240, 0x7824, 0x603e, 0x7b28, 0x6342,
- 0x2069, 0x6f51, 0x831f, 0xa305, 0x6816, 0x0078, 0x23db, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040,
- 0x2409, 0x7828, 0xa00d, 0x0040, 0x2409, 0x782c, 0xa005, 0x0040,
- 0x2409, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, 0x23db, 0x7d38,
- 0x7c3c, 0x0078, 0x2488, 0x7824, 0xa09c, 0x00ff, 0xa39a, 0x0003,
- 0x00c8, 0x2405, 0x624c, 0xa084, 0xff00, 0x8007, 0xa206, 0x00c0,
- 0x26d3, 0x2001, 0x6f40, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x29e7, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3,
- 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x2405, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040, 0x2405, 0x6837,
- 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x62f3, 0x0040, 0x2405,
- 0x7007, 0x0003, 0x701b, 0x26f5, 0x007c, 0x6830, 0xa086, 0x0100,
- 0x0040, 0x2405, 0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x0078, 0x29e7, 0x1078, 0x29ab, 0x0040, 0x2405,
- 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x29e3,
- 0x701b, 0x2713, 0x007c, 0xade8, 0x000d, 0x6800, 0xa005, 0x0040,
- 0x2409, 0x6804, 0xd0ac, 0x0040, 0x2720, 0xd0a4, 0x0040, 0x2409,
- 0xd094, 0x0040, 0x272b, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c,
- 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2736, 0x0c7e, 0x2061,
- 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100,
- 0x210c, 0xa18a, 0x0002, 0x0048, 0x274b, 0xd084, 0x0040, 0x274b,
- 0x6a28, 0xa28a, 0x007e, 0x00c8, 0x2409, 0xa288, 0x2207, 0x210c,
- 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x2754, 0x6828, 0xa08a,
- 0x007e, 0x00c8, 0x2409, 0x604e, 0x6808, 0xa08a, 0x0100, 0x0048,
- 0x2409, 0xa08a, 0x0841, 0x00c8, 0x2409, 0xa084, 0x0007, 0x00c0,
- 0x2409, 0x680c, 0xa005, 0x0040, 0x2409, 0x6810, 0xa005, 0x0040,
- 0x2409, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x2409, 0x8001, 0x0040,
- 0x2409, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x2409, 0x8001, 0x0040,
- 0x2409, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x6f51, 0x2da0, 0x53a3,
- 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff, 0x6042,
- 0x1078, 0x3917, 0x1078, 0x36ed, 0x6000, 0xa086, 0x0000, 0x00c0,
- 0x27cf, 0x6808, 0x602a, 0x1078, 0x1d4d, 0x6818, 0x691c, 0x6a20,
- 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e,
- 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x27af, 0x6830, 0x6934, 0x6a38,
- 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x27b1, 0xa084,
- 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x4220, 0x0c7e,
- 0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f, 0x60ac,
- 0xa005, 0x0040, 0x27cb, 0x6003, 0x0001, 0x2091, 0x301d, 0x1078,
- 0x3229, 0x0078, 0x27cf, 0x6003, 0x0004, 0x2091, 0x301d, 0x0078,
- 0x23db, 0x6000, 0xa086, 0x0000, 0x0040, 0x2405, 0x2069, 0x6f51,
- 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00, 0x2009, 0x001c, 0x7a2c,
- 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29e7, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x3229, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x6174,
- 0x81ff, 0x0040, 0x2806, 0x703f, 0x0000, 0x2001, 0x74c0, 0x2009,
- 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x29e7, 0x701b, 0x23d8, 0x127f, 0x007c, 0x703f, 0x0001,
- 0x0d7e, 0x2069, 0x74c0, 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2019,
- 0xffff, 0x43a4, 0x654c, 0xa588, 0x2207, 0x210c, 0xa18c, 0x00ff,
- 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040, 0x2838,
- 0x1078, 0x34cb, 0x00c0, 0x2838, 0x6014, 0x821c, 0x0048, 0x2830,
- 0xa398, 0x74c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078, 0x2837,
- 0xa398, 0x74c0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a, 0x8210,
- 0x8108, 0xa182, 0x007f, 0x00c8, 0x283f, 0x0078, 0x281c, 0x8201,
- 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040, 0x20a1,
- 0x74c0, 0x2099, 0x74c0, 0x1078, 0x3272, 0x0078, 0x27f5, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040,
- 0x2405, 0x2001, 0x6f52, 0x2004, 0xd0b4, 0x0040, 0x287c, 0x6000,
- 0xd08c, 0x00c0, 0x287c, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x287c, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078,
- 0x630f, 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2878, 0x007c,
- 0x1078, 0x29c3, 0x0040, 0x2409, 0x20a9, 0x0029, 0x2c98, 0xade8,
- 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098,
- 0xad80, 0x0006, 0x20a0, 0x1078, 0x3272, 0x20a9, 0x0004, 0xac80,
- 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, 0x1078, 0x3272, 0x2d00,
- 0x2009, 0x0029, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29e7,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078,
- 0x362b, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x7828, 0xa08a,
- 0x1000, 0x00c8, 0x2409, 0x1078, 0x29c3, 0x0040, 0x2409, 0x2031,
- 0x000f, 0x1078, 0x3554, 0x8631, 0x00c8, 0x28b9, 0x2019, 0x0004,
- 0x1078, 0x3641, 0x7924, 0x810f, 0x7a28, 0x1078, 0x28c9, 0x0078,
- 0x23db, 0xa186, 0x00ff, 0x0040, 0x28d1, 0x1078, 0x28e1, 0x0078,
- 0x28e0, 0x2029, 0x007d, 0x2061, 0x6f00, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x28dd, 0x2508, 0x1078, 0x28e1, 0x8529, 0x00c8, 0x28d6,
- 0x007c, 0x1078, 0x34cb, 0x00c0, 0x28ec, 0x2200, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x4194, 0x007c, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x3554, 0x1078, 0x3636,
- 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040,
- 0x2409, 0x1078, 0x3554, 0x1078, 0x3620, 0x0078, 0x23db, 0x6100,
- 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6004, 0xa086,
- 0x0707, 0x0040, 0x2409, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003,
- 0x00c0, 0x2405, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040,
- 0x2923, 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007,
- 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c,
- 0x0200, 0x0078, 0x23db, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff,
- 0x0040, 0x293d, 0x81ff, 0x00c0, 0x2405, 0x7828, 0xa08a, 0x1000,
- 0x00c8, 0x2409, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff,
- 0x0040, 0x2951, 0xa182, 0x007e, 0x00c8, 0x2409, 0x2100, 0x1078,
- 0x1feb, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2061, 0x70c9,
- 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, 0x6030, 0xa084,
- 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
- 0x2009, 0x001e, 0x2011, 0x324e, 0x1078, 0x4217, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0x7a28, 0x1078, 0x28c9, 0x127f, 0x0c7f, 0x027f,
- 0x0078, 0x23db, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078,
- 0x3494, 0x2c08, 0x0c7f, 0x00c0, 0x2409, 0x0078, 0x23db, 0x017e,
- 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a,
- 0x8108, 0x00f0, 0x2989, 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e,
- 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000, 0x205c,
- 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f,
- 0x0a7f, 0x017f, 0x007c, 0x1078, 0x12c7, 0x0040, 0x29c2, 0xa006,
- 0x6802, 0x7010, 0xa005, 0x00c0, 0x29ba, 0x2d00, 0x7012, 0x7016,
- 0x0078, 0x29c0, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016,
- 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078,
- 0x34cb, 0x00c0, 0x29d1, 0xa6b4, 0x00ff, 0xa682, 0x0010, 0x0048,
- 0x29d2, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040,
- 0x29df, 0x2168, 0x6904, 0x1078, 0x12fb, 0x0078, 0x29d6, 0x7112,
- 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x29e9, 0x2031,
- 0x0000, 0x2061, 0x6fbd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b,
- 0x23db, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000,
- 0x2001, 0x6f7b, 0x2004, 0xa005, 0x00c0, 0x2a14, 0x0068, 0x2a14,
- 0x7818, 0xd084, 0x00c0, 0x2a14, 0x781b, 0x0001, 0x7a22, 0x7b26,
- 0x2091, 0x4080, 0x0078, 0x2a38, 0x017e, 0x0c7e, 0x0e7e, 0x2071,
- 0x6f6d, 0x7138, 0xa182, 0x0008, 0x0048, 0x2a22, 0x7030, 0x2060,
- 0x0078, 0x2a33, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x6fbd, 0x0048,
- 0x2a2b, 0x2061, 0x6f7d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2a31,
- 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x0e7f, 0x0c7f, 0x017f,
- 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x6f6d, 0x7038, 0xa005,
- 0x0040, 0x2a72, 0x127e, 0x2091, 0x8000, 0x0068, 0x2a71, 0x0f7e,
- 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2a70, 0x0c7e, 0x781b,
- 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x2091,
- 0x4080, 0x7038, 0x8001, 0x703a, 0xa005, 0x00c0, 0x2a66, 0x7033,
- 0x6f7d, 0x7037, 0x6f7d, 0x0c7f, 0x0078, 0x2a70, 0xac80, 0x0008,
- 0xa0fa, 0x6fbd, 0x0048, 0x2a6e, 0x2001, 0x6f7d, 0x7036, 0x0c7f,
- 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e, 0x2001, 0x6f52, 0x2004,
- 0xd0c4, 0x0040, 0x2a7f, 0x2011, 0x8014, 0x1078, 0x29fa, 0x027f,
- 0x007c, 0x81ff, 0x00c0, 0x2405, 0x127e, 0x2091, 0x8000, 0x6030,
- 0xc08d, 0x6032, 0x1078, 0x3229, 0x127f, 0x0078, 0x23db, 0x7824,
- 0x2008, 0xa18c, 0xfffd, 0x00c0, 0x2a9a, 0x61b4, 0xa10d, 0x61b6,
- 0x0078, 0x23db, 0x0078, 0x2409, 0x81ff, 0x00c0, 0x2405, 0x6000,
- 0xa086, 0x0003, 0x00c0, 0x2405, 0x2001, 0x6f52, 0x2004, 0xd0a4,
- 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2ab9, 0x7828, 0xa005, 0x0040,
- 0x23db, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040, 0x2405, 0x6837,
- 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x637c,
- 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2acf, 0x007c, 0x6830,
- 0xa086, 0x0100, 0x0040, 0x2405, 0x0078, 0x23db, 0x2001, 0x6f00,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x2405, 0x7f24, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x1078, 0x29ab, 0x0040, 0x2405, 0x2009, 0x0000,
- 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0005,
- 0x7026, 0x20a0, 0x1078, 0x34cb, 0x00c0, 0x2b1c, 0x6004, 0xa0c6,
- 0x0707, 0x0040, 0x2b1c, 0xa084, 0x00ff, 0xa0c6, 0x0006, 0x00c0,
- 0x2b1c, 0x87ff, 0x0040, 0x2b0f, 0xac80, 0x0006, 0x2098, 0x3400,
- 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2995, 0x0078, 0x2b18, 0xac80,
- 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2995,
- 0x21a2, 0x94a0, 0xa6b0, 0x0005, 0x8108, 0xa186, 0x007e, 0x0040,
- 0x2b27, 0xa686, 0x0028, 0x0040, 0x2b30, 0x0078, 0x2af2, 0x86ff,
- 0x00c0, 0x2b2e, 0x7120, 0x810b, 0x0078, 0x23db, 0x702f, 0x0001,
- 0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0x6fbd, 0x6007,
- 0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b, 0x2b48, 0x007c,
- 0x702c, 0xa005, 0x00c0, 0x2b5a, 0x711c, 0x7024, 0x20a0, 0x7728,
- 0x2031, 0x0000, 0x2061, 0x6fbd, 0x6224, 0x6328, 0x642c, 0x6530,
- 0x0078, 0x2af2, 0x7120, 0x810b, 0x0078, 0x23db, 0x127e, 0x0c7e,
- 0x0e7e, 0x2061, 0x0100, 0x2071, 0x6f00, 0x6044, 0xd0a4, 0x00c0,
- 0x2b87, 0xd084, 0x0040, 0x2b70, 0x1078, 0x2cae, 0x0078, 0x2b83,
- 0xd08c, 0x0040, 0x2b77, 0x1078, 0x2bc5, 0x0078, 0x2b83, 0xd094,
- 0x0040, 0x2b7e, 0x1078, 0x2ba8, 0x0078, 0x2b83, 0xd09c, 0x0040,
- 0x2b83, 0x1078, 0x2b91, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e,
- 0x6128, 0xd19c, 0x00c0, 0x2b8e, 0xc19d, 0x612a, 0x017f, 0x0078,
- 0x2b83, 0x6043, 0x0040, 0x6043, 0x0000, 0x7067, 0x0000, 0x707f,
- 0x0001, 0x709f, 0x0000, 0x2009, 0x74c0, 0x200b, 0x0000, 0x706b,
- 0x000f, 0x2009, 0x000f, 0x2011, 0x31e9, 0x1078, 0x4217, 0x007c,
- 0x7068, 0xa005, 0x00c0, 0x2bc4, 0x2011, 0x31e9, 0x1078, 0x4187,
- 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c, 0x00c0, 0x2bc0,
- 0x707b, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2bc4,
- 0x706f, 0x0000, 0x0078, 0x2bc4, 0x007c, 0x706c, 0xa08a, 0x0003,
- 0x00c8, 0x2bce, 0x1079, 0x2bd1, 0x0078, 0x2bd0, 0x1078, 0x1288,
- 0x007c, 0x2bd4, 0x2c23, 0x2cad, 0x0f7e, 0x706f, 0x0001, 0x20e1,
- 0xa000, 0x20e1, 0x8700, 0x1078, 0x1d4d, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x2079, 0x7300, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b,
- 0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b,
- 0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b,
- 0x0000, 0x782f, 0x0000, 0x2079, 0x730c, 0x207b, 0x1101, 0x7807,
- 0x0000, 0x2099, 0x6f05, 0x20a1, 0x730e, 0x20a9, 0x0004, 0x53a3,
- 0x2079, 0x7312, 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7300,
- 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f,
- 0x0000, 0x1078, 0x3210, 0x0f7f, 0x7073, 0x0000, 0x6043, 0x0008,
- 0x6043, 0x0000, 0x007c, 0x0d7e, 0x7070, 0x7073, 0x0000, 0xa025,
- 0x0040, 0x2c97, 0x6020, 0xd0b4, 0x00c0, 0x2c95, 0x717c, 0x81ff,
- 0x0040, 0x2c7e, 0xa486, 0x000c, 0x00c0, 0x2c89, 0xa480, 0x0018,
- 0x8004, 0x20a8, 0x2011, 0x7380, 0x2019, 0x7300, 0x220c, 0x2304,
- 0xa106, 0x00c0, 0x2c55, 0x8210, 0x8318, 0x00f0, 0x2c3e, 0x6043,
- 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x706f,
- 0x0002, 0x707b, 0x0002, 0x0078, 0x2c95, 0x2069, 0x7380, 0x6930,
- 0xa18e, 0x1101, 0x00c0, 0x2c89, 0x6834, 0xa005, 0x00c0, 0x2c89,
- 0x6900, 0xa18c, 0x00ff, 0x00c0, 0x2c69, 0x6804, 0xa005, 0x0040,
- 0x2c7e, 0x2011, 0x738e, 0x2019, 0x6f05, 0x20a9, 0x0004, 0x220c,
- 0x2304, 0xa102, 0x0048, 0x2c7c, 0x00c0, 0x2c89, 0x8210, 0x8318,
- 0x00f0, 0x2c6f, 0x0078, 0x2c89, 0x707f, 0x0000, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x0014,
- 0x53a6, 0x6043, 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0,
- 0x2c95, 0x60c3, 0x000c, 0x1078, 0x3210, 0x0d7f, 0x007c, 0x6020,
- 0xd0b4, 0x00c0, 0x2c95, 0x60c3, 0x000c, 0x2011, 0x70c0, 0x2013,
- 0x0000, 0x7073, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7,
- 0x9575, 0x1078, 0x4f85, 0x0078, 0x2c95, 0x007c, 0x7078, 0xa08a,
- 0x001d, 0x00c8, 0x2cb7, 0x1079, 0x2cba, 0x0078, 0x2cb9, 0x1078,
- 0x1288, 0x007c, 0x2cde, 0x2ced, 0x2d1e, 0x2d33, 0x2d63, 0x2d8b,
- 0x2dbb, 0x2de5, 0x2e15, 0x2e3b, 0x2e86, 0x2ea8, 0x2ecc, 0x2ee2,
- 0x2f08, 0x2f1b, 0x2f24, 0x2f3d, 0x2f6b, 0x2f93, 0x2fc1, 0x2feb,
- 0x3030, 0x3065, 0x3087, 0x30c5, 0x30e9, 0x3102, 0x310f, 0x7003,
- 0x0007, 0x6004, 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94,
- 0x608f, 0xf0f0, 0x6043, 0x0002, 0x707b, 0x0001, 0x2009, 0x07d0,
- 0x2011, 0x31f0, 0x1078, 0x417a, 0x007c, 0x0f7e, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x2d1c, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0,
- 0x2d1c, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d1a,
- 0x7834, 0xa005, 0x00c0, 0x2d1a, 0x7a38, 0xd2fc, 0x0040, 0x2d10,
- 0x709c, 0xa005, 0x00c0, 0x2d10, 0x1078, 0x32a9, 0x709f, 0x0001,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0x707b, 0x0010, 0x1078, 0x2f24,
- 0x0078, 0x2d1c, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0003,
- 0x6043, 0x0004, 0x1078, 0x327a, 0x20a3, 0x1102, 0x20a3, 0x0000,
- 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x2d2a, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2d61,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2d5d,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d5d, 0x7834,
- 0xa005, 0x00c0, 0x2d5d, 0x7a38, 0xd2fc, 0x0040, 0x2d57, 0x709c,
- 0xa005, 0x00c0, 0x2d57, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0004, 0x1078, 0x2d63, 0x0078, 0x2d61, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0005, 0x1078, 0x327a, 0x20a3,
- 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2d7d, 0x714c, 0xa186, 0xffff, 0x0040, 0x2d7d, 0x1078,
- 0x31b4, 0x0040, 0x2d7d, 0x1078, 0x32a9, 0x20a9, 0x0008, 0x2298,
- 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2db9,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2db5,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2db5, 0x7834,
- 0xa005, 0x00c0, 0x2db5, 0x7a38, 0xd2fc, 0x0040, 0x2daf, 0x709c,
- 0xa005, 0x00c0, 0x2daf, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0006, 0x1078, 0x2dbb, 0x0078, 0x2db9, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0007, 0x1078, 0x327a, 0x20a3,
- 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2dd7, 0x7150, 0xa186, 0xffff, 0x0040, 0x2dd7, 0xa180,
- 0x2207, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x31b4, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x2e13, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014,
- 0x00c0, 0x2e0f, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1104, 0x00c0,
- 0x2e0f, 0x7834, 0xa005, 0x00c0, 0x2e0f, 0x7a38, 0xd2fc, 0x0040,
- 0x2e09, 0x709c, 0xa005, 0x00c0, 0x2e09, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x707b, 0x0008, 0x1078, 0x2e15, 0x0078, 0x2e13, 0x707b,
- 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0009, 0x1078,
- 0x327a, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x7064, 0xa005,
- 0x00c0, 0x2e28, 0x1078, 0x311e, 0x0040, 0x2e38, 0x0078, 0x2e32,
- 0x20a9, 0x0008, 0x2099, 0x738e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3210, 0x0078, 0x2e3a,
- 0x1078, 0x2cd7, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e84,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2e80,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e80, 0x7834,
- 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2e69, 0x7a38, 0xd2fc, 0x0040,
- 0x2e61, 0x709c, 0xa005, 0x00c0, 0x2e61, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x7077, 0x0001, 0x707b, 0x000a, 0x1078, 0x2e86, 0x0078,
- 0x2e84, 0xa005, 0x00c0, 0x2e80, 0x7a38, 0xd2fc, 0x0040, 0x2e78,
- 0x709c, 0xa005, 0x00c0, 0x2e78, 0x1078, 0x32a9, 0x709f, 0x0001,
- 0x7077, 0x0000, 0x707b, 0x000e, 0x1078, 0x2f08, 0x0078, 0x2e84,
- 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000b,
- 0x2011, 0x730e, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4,
- 0x20a9, 0x0002, 0x2009, 0x0000, 0x41a4, 0x1078, 0x327a, 0x20a3,
- 0x1106, 0x20a3, 0x0000, 0x6030, 0xa085, 0x0100, 0x2012, 0x2298,
- 0x20a9, 0x0042, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x3210, 0x007c,
- 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2eca, 0x2011, 0x31f0, 0x1078,
- 0x4187, 0xa086, 0x0084, 0x00c0, 0x2ec6, 0x2079, 0x7380, 0x7a30,
- 0xa296, 0x1106, 0x00c0, 0x2ec6, 0x7834, 0xa005, 0x00c0, 0x2ec6,
- 0x707b, 0x000c, 0x1078, 0x2ecc, 0x0078, 0x2eca, 0x707b, 0x0002,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000d, 0x1078, 0x327a,
- 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0x738e, 0x20a9, 0x0040,
- 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078,
- 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f06, 0x2011,
- 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084, 0x00c0, 0x2f02, 0x2079,
- 0x7380, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x2f02, 0x7834, 0xa005,
- 0x00c0, 0x2f02, 0x1078, 0x326c, 0x707b, 0x000e, 0x1078, 0x2f08,
- 0x0078, 0x2f06, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
- 0x707b, 0x000f, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5,
- 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x31f0,
- 0x1078, 0x417a, 0x007c, 0x7070, 0xa005, 0x0040, 0x2f23, 0x2011,
- 0x31f0, 0x1078, 0x4187, 0x007c, 0x707b, 0x0011, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x7470, 0xa480,
- 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6,
- 0x60c3, 0x0014, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x2f69, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014,
- 0x00c0, 0x2f67, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1103, 0x00c0,
- 0x2f67, 0x7834, 0xa005, 0x00c0, 0x2f67, 0x7a38, 0xd2fc, 0x0040,
- 0x2f61, 0x709c, 0xa005, 0x00c0, 0x2f61, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x707b, 0x0012, 0x1078, 0x2f6b, 0x0078, 0x2f69, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0013, 0x1078, 0x3286, 0x20a3,
- 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2f85, 0x714c, 0xa186, 0xffff, 0x0040, 0x2f85, 0x1078,
- 0x31b4, 0x0040, 0x2f85, 0x1078, 0x32a9, 0x20a9, 0x0008, 0x2298,
+ 0x2004, 0xa084, 0x0007, 0x0079, 0x1b35, 0x1b3d, 0x1b3e, 0x1b41,
+ 0x1b44, 0x1b49, 0x1b4c, 0x1b51, 0x1b56, 0x007c, 0x1078, 0x1933,
+ 0x007c, 0x1078, 0x16e5, 0x007c, 0x1078, 0x16e5, 0x1078, 0x1933,
+ 0x007c, 0x1078, 0x143e, 0x007c, 0x1078, 0x1933, 0x1078, 0x143e,
+ 0x007c, 0x1078, 0x16e5, 0x1078, 0x143e, 0x007c, 0x1078, 0x16e5,
+ 0x1078, 0x1933, 0x1078, 0x143e, 0x007c, 0x127e, 0x2091, 0x2300,
+ 0x2079, 0x0200, 0x2071, 0x7280, 0x2069, 0x6d00, 0x2009, 0x0004,
+ 0x7912, 0x7916, 0x1078, 0x1df6, 0x781b, 0x0002, 0x20e1, 0x8700,
+ 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007,
+ 0x0079, 0x1b7a, 0x1b9e, 0x1b82, 0x1b86, 0x1b8a, 0x1b90, 0x1b94,
+ 0x1b98, 0x1b9c, 0x1078, 0x3d7c, 0x0078, 0x1b9e, 0x1078, 0x3db0,
+ 0x0078, 0x1b9e, 0x1078, 0x3d7c, 0x1078, 0x3db0, 0x0078, 0x1b9e,
+ 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x0078, 0x1b9e,
+ 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x127f, 0x007c,
+ 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1baa,
+ 0x1078, 0x12b7, 0xa184, 0x0030, 0x0040, 0x1bbb, 0x6a00, 0xa286,
+ 0x0003, 0x00c0, 0x1bb5, 0x1078, 0x12b7, 0x1078, 0x31cb, 0x20e1,
+ 0x9010, 0x0078, 0x1bc7, 0xa184, 0x00c0, 0x0040, 0x1bc1, 0x1078,
+ 0x12b7, 0xa184, 0x0300, 0x0040, 0x1bc7, 0x20e1, 0x9020, 0x7932,
+ 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071,
+ 0x6d00, 0x7128, 0x2001, 0x6f03, 0x2102, 0x2001, 0x6f0b, 0x2102,
+ 0xa182, 0x0211, 0x00c8, 0x1be0, 0x2009, 0x0008, 0x0078, 0x1c0a,
+ 0xa182, 0x0259, 0x00c8, 0x1be8, 0x2009, 0x0007, 0x0078, 0x1c0a,
+ 0xa182, 0x02c1, 0x00c8, 0x1bf0, 0x2009, 0x0006, 0x0078, 0x1c0a,
+ 0xa182, 0x0349, 0x00c8, 0x1bf8, 0x2009, 0x0005, 0x0078, 0x1c0a,
+ 0xa182, 0x0421, 0x00c8, 0x1c00, 0x2009, 0x0004, 0x0078, 0x1c0a,
+ 0xa182, 0x0581, 0x00c8, 0x1c08, 0x2009, 0x0003, 0x0078, 0x1c0a,
+ 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1df6,
+ 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061,
+ 0x0100, 0x2071, 0x6d00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7,
+ 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043,
+ 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x0caf, 0x600f,
+ 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6d2d, 0x2003,
+ 0x0000, 0x2001, 0x6d2c, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091,
+ 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0,
+ 0x1c4d, 0xa184, 0x0007, 0x0079, 0x1c53, 0xa195, 0x0004, 0xa284,
+ 0x0007, 0x0079, 0x1c53, 0x1c7f, 0x1c5b, 0x1c5f, 0x1c63, 0x1c69,
+ 0x1c6d, 0x1c73, 0x1c79, 0x1078, 0x4226, 0x0078, 0x1c7f, 0x1078,
+ 0x42e4, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x0078,
+ 0x1c7f, 0x1078, 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x4226, 0x1078,
+ 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x1c84, 0x0078,
+ 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x1078, 0x1c84, 0x027f,
+ 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1d24, 0x017e,
+ 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00, 0xa196, 0xff00,
+ 0x0040, 0x1cb3, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040,
+ 0x1cb3, 0x7130, 0xd18c, 0x00c0, 0x1cb3, 0x2011, 0x6d52, 0x2214,
+ 0xd2ec, 0x0040, 0x1ca7, 0xc18d, 0x7132, 0x0078, 0x1cb3, 0x6240,
+ 0xa294, 0x0010, 0x0040, 0x1cf2, 0x6248, 0xa294, 0xff00, 0xa296,
+ 0xff00, 0x00c0, 0x1cf2, 0x2011, 0x8013, 0x1078, 0x2a53, 0x7130,
+ 0xc185, 0x7132, 0x2011, 0x6d52, 0x220c, 0xd1a4, 0x0040, 0x1cda,
+ 0x017e, 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x41f4, 0x2019,
+ 0x000e, 0x1078, 0x6b8f, 0xa484, 0x00ff, 0xa080, 0x2091, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
+ 0x6bf7, 0x017f, 0xd1ac, 0x00c0, 0x1ce3, 0x2019, 0x0004, 0x1078,
+ 0x202f, 0x0078, 0x1cf2, 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000,
+ 0x1078, 0x3447, 0x00c0, 0x1cee, 0x1078, 0x3256, 0x8108, 0x00f0,
+ 0x1ce8, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
+ 0x1078, 0x3233, 0x2011, 0x0003, 0x1078, 0x5232, 0x2011, 0x0002,
+ 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c, 0x037e, 0x2019,
+ 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001,
+ 0x6d00, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1d1c, 0xd19c, 0x00c0,
+ 0x1d1c, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x6d20,
+ 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1d9d, 0x017e,
+ 0x6220, 0xd2b4, 0x0040, 0x1d5b, 0x1078, 0x414c, 0x1078, 0x4fe5,
+ 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
+ 0x0040, 0x1d3e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
+ 0x2061, 0x6f10, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1d4e, 0x8000,
+ 0x602a, 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x1d9c, 0x2019, 0x6f19,
+ 0x2304, 0xa065, 0x0040, 0x1d58, 0x2009, 0x0014, 0x1078, 0x5591,
+ 0x0c7f, 0x0078, 0x1d9c, 0xd2bc, 0x0040, 0x1d9c, 0x1078, 0x415a,
+ 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
+ 0xa084, 0x4000, 0x0040, 0x1d70, 0x6803, 0x1000, 0x6803, 0x0000,
+ 0x0d7f, 0x0c7e, 0x2061, 0x6f10, 0x6044, 0xa09a, 0x0002, 0x00c8,
+ 0x1d91, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1d9c,
+ 0x1078, 0x4151, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
+ 0x1d8d, 0x6017, 0x0012, 0x0078, 0x1d9c, 0x6017, 0x0016, 0x0078,
+ 0x1d9c, 0x2019, 0x6f1f, 0x2304, 0xa065, 0x0040, 0x1d9b, 0x2009,
+ 0x004a, 0x1078, 0x5591, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1dc5,
+ 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5232,
+ 0x2011, 0x0002, 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c,
+ 0x037e, 0x2019, 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000,
+ 0x1078, 0x6c5f, 0x1078, 0x6c7d, 0x2001, 0x6d00, 0x2003, 0x0004,
+ 0x6027, 0x0008, 0x1078, 0x11aa, 0x017f, 0xa18c, 0xffd0, 0x6126,
+ 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6d00, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x1def,
+ 0x81ff, 0x0040, 0x1de1, 0x2011, 0x8011, 0x1078, 0x2a53, 0x0078,
+ 0x1def, 0x2011, 0x8012, 0x1078, 0x2a53, 0x037e, 0x0c7e, 0x2061,
+ 0x0100, 0x2019, 0x0028, 0x1078, 0x202f, 0x0c7f, 0x037f, 0x127f,
+ 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e,
+ 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1e09, 0x2204, 0x60f2,
+ 0xa190, 0x1e12, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f,
+ 0x007c, 0x083e, 0x083e, 0x083e, 0x0580, 0x0420, 0x0348, 0x02c0,
+ 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8,
+ 0x00d0, 0x00b0, 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0,
+ 0x1e24, 0x81ff, 0x0040, 0x1e28, 0x1078, 0x3f00, 0x0078, 0x1e2f,
+ 0xa080, 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c,
+ 0xa080, 0x2091, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1e56, 0x1e5a,
+ 0x1e5e, 0x1e64, 0x1e6a, 0x1e70, 0x1e76, 0x1e7e, 0x1e86, 0x1e8c,
+ 0x1e92, 0x1e9a, 0x1ea2, 0x1eaa, 0x1eb2, 0x1ebc, 0x1ec6, 0x1ec6,
+ 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6,
+ 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x107e, 0x007e,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf,
+ 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b2e,
+ 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e,
+ 0x1078, 0x1b2e, 0x1078, 0x1b72, 0x0078, 0x1edf, 0x0005, 0x0078,
+ 0x1ec6, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x1ecf, 0x1edf,
+ 0x1e5c, 0x1e60, 0x1e66, 0x1e6c, 0x1e72, 0x1e78, 0x1e80, 0x1e88,
+ 0x1e8e, 0x1e94, 0x1e9c, 0x1ea4, 0x1eac, 0x1eb4, 0x1ebe, 0x0008,
+ 0x1ec9, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e,
+ 0x2041, 0x007e, 0x70bc, 0xd09c, 0x0040, 0x1ef0, 0x2041, 0x007f,
+ 0x2001, 0x010c, 0x203c, 0x727c, 0x82ff, 0x0040, 0x1f3b, 0x037e,
+ 0x738c, 0xa38e, 0xffff, 0x00c0, 0x1eff, 0x2019, 0x0001, 0x8314,
+ 0xa2e0, 0x73c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x1f0c, 0xa084,
+ 0xff00, 0x8007, 0x0078, 0x1f0e, 0xa084, 0x00ff, 0xa70e, 0x0040,
+ 0x1f30, 0xa08e, 0x00ff, 0x0040, 0x1f36, 0x2009, 0x0000, 0x1078,
+ 0x1e1b, 0x1078, 0x3410, 0x00c0, 0x1f33, 0x6004, 0xa084, 0x00ff,
+ 0xa086, 0x0006, 0x00c0, 0x1f2a, 0x1078, 0x1f8d, 0x0040, 0x1f33,
+ 0x0078, 0x1f30, 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f33,
+ 0x8318, 0x0078, 0x1eff, 0x738e, 0x0078, 0x1f38, 0x708f, 0xffff,
+ 0x037f, 0x0078, 0x1f8a, 0xa780, 0x2091, 0x203c, 0xa7bc, 0xff00,
+ 0x873f, 0x708c, 0xa096, 0xffff, 0x0040, 0x1f4d, 0xa812, 0x00c8,
+ 0x1f5d, 0x708f, 0xffff, 0x0078, 0x1f87, 0x2009, 0x0000, 0x70bc,
+ 0xd09c, 0x0040, 0x1f58, 0xd094, 0x0040, 0x1f58, 0x2009, 0x007e,
+ 0x2100, 0xa802, 0x20a8, 0x0078, 0x1f61, 0x2008, 0x2810, 0xa202,
+ 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x1f7e, 0x1078,
+ 0x3410, 0x00c0, 0x1f87, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x00c0, 0x1f78, 0x1078, 0x1f8d, 0x0040, 0x1f87, 0x0078, 0x1f7e,
+ 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f87, 0x017f, 0x8108,
+ 0x157f, 0x00f0, 0x1f61, 0x708f, 0xffff, 0x0078, 0x1f8a, 0x017f,
+ 0x157f, 0x718e, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e,
+ 0x0c7e, 0x2c68, 0x1078, 0x5504, 0x0040, 0x1faf, 0x2d00, 0x601a,
+ 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0000,
+ 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a,
+ 0x127f, 0x2009, 0x0004, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f,
+ 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x5504, 0x0040, 0x1fd6, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078,
+ 0x3410, 0x00c0, 0x1fe9, 0x1078, 0x1fec, 0x0040, 0x1fe9, 0x70c3,
+ 0xffff, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x5504, 0x0040, 0x200e, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x127e, 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078,
+ 0x3410, 0x00c0, 0x202c, 0x2c68, 0x1078, 0x5504, 0x0040, 0x202c,
+ 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e,
+ 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, 0x4463, 0x1078, 0x4417,
+ 0x1078, 0x59ce, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078,
+ 0x3447, 0x00c0, 0x2047, 0x1078, 0x35cf, 0x1078, 0x3256, 0x017f,
+ 0x8108, 0x00f0, 0x203e, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270,
+ 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9,
+ 0x2c08, 0x1078, 0x6a57, 0x017f, 0x2e60, 0x1078, 0x35cf, 0x1078,
+ 0x3256, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
+ 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x00c0, 0x2083,
+ 0x2071, 0x6d00, 0x7088, 0xa005, 0x0040, 0x2080, 0x8001, 0x708a,
+ 0x007f, 0x0e7f, 0x007c, 0x2071, 0x6d00, 0x70c4, 0xa005, 0x0040,
+ 0x2080, 0x8001, 0x70c6, 0x0078, 0x2080, 0x6000, 0xc08c, 0x6002,
+ 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc,
+ 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1,
+ 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6,
+ 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4,
+ 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa,
+ 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d,
+ 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282,
+ 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074,
+ 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a,
+ 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559,
+ 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d,
+ 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043,
+ 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932,
+ 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227,
+ 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18,
+ 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000,
+ 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000,
+ 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00,
+ 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900,
+ 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200,
+ 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00,
+ 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600,
+ 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00,
+ 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900,
+ 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000,
+ 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000,
+ 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x2071, 0x6d6d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016,
+ 0x703a, 0x703e, 0x7033, 0x6d7d, 0x7037, 0x6d7d, 0x7007, 0x0001,
+ 0x2061, 0x6d9d, 0x6003, 0x0002, 0x007c, 0x0090, 0x21b8, 0x0068,
+ 0x21b8, 0x2071, 0x6d6d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x21b8,
+ 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x229c, 0x0079, 0x223c,
+ 0x007c, 0x2071, 0x6d6d, 0x7004, 0x0079, 0x21be, 0x21c2, 0x21c3,
+ 0x21cd, 0x21df, 0x007c, 0x0090, 0x21cc, 0x0068, 0x21cc, 0x2b78,
+ 0x7818, 0xd084, 0x0040, 0x21eb, 0x007c, 0x2b78, 0x2061, 0x6d9d,
+ 0x6008, 0xa08e, 0x0100, 0x0040, 0x21da, 0xa086, 0x0200, 0x0040,
+ 0x2294, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010,
+ 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x21e7, 0x007c, 0x2a60,
+ 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8,
+ 0x21f4, 0x61b0, 0x0079, 0x21fc, 0x2100, 0xa08a, 0x0033, 0x00c8,
+ 0x2290, 0x61b0, 0x0079, 0x223c, 0x2272, 0x22a4, 0x22ac, 0x22b0,
+ 0x22b8, 0x22be, 0x22c2, 0x22cb, 0x22cf, 0x22d7, 0x22db, 0x2290,
+ 0x2290, 0x2290, 0x22df, 0x2290, 0x22ef, 0x2306, 0x231d, 0x2399,
+ 0x239e, 0x23cb, 0x2416, 0x2425, 0x2446, 0x247c, 0x2486, 0x2493,
+ 0x24a6, 0x24be, 0x24c7, 0x2504, 0x250a, 0x2290, 0x251a, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x251e, 0x2524, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x252c, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2539, 0x253f, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x22d7, 0x22db, 0x2290, 0x2290,
+ 0x2551, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x259e, 0x265d, 0x2671, 0x2678,
+ 0x26db, 0x2736, 0x2741, 0x2783, 0x2790, 0x279d, 0x27a0, 0x2555,
+ 0x27c9, 0x2811, 0x281e, 0x28fd, 0x29cb, 0x29f2, 0x2ade, 0x713c,
+ 0x0078, 0x2272, 0x2021, 0x4000, 0x1078, 0x2a2d, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x227f, 0x7818, 0xd084, 0x0040, 0x2282, 0x127f,
+ 0x0078, 0x2276, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e,
+ 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f, 0x007c,
+ 0x2021, 0x4001, 0x0078, 0x2274, 0x2021, 0x4002, 0x0078, 0x2274,
+ 0x2021, 0x4003, 0x0078, 0x2274, 0x2021, 0x4005, 0x0078, 0x2274,
+ 0x2021, 0x4006, 0x0078, 0x2274, 0xa02e, 0x2520, 0x7b28, 0x7a2c,
+ 0x7824, 0x7930, 0x0078, 0x2a3c, 0x7823, 0x0004, 0x7824, 0x007a,
+ 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2a40,
+ 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2272, 0x7924, 0x2114,
+ 0x0078, 0x2272, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007,
+ 0x53a3, 0x0078, 0x2272, 0x7824, 0x2060, 0x0078, 0x22e1, 0x2009,
+ 0x0001, 0x2011, 0x000d, 0x2019, 0x0000, 0x0078, 0x2272, 0x7d38,
+ 0x7c3c, 0x0078, 0x22a6, 0x7d38, 0x7c3c, 0x0078, 0x22b2, 0x2061,
+ 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0,
+ 0x22e3, 0x2010, 0xa005, 0x0040, 0x2272, 0x0078, 0x2298, 0x2061,
+ 0x6d51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040,
+ 0x22a0, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056, 0xa006,
+ 0x605a, 0x605e, 0x1078, 0x3890, 0x0078, 0x2272, 0x2061, 0x6d51,
+ 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040, 0x22a0,
+ 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006, 0x606a,
+ 0x606e, 0x1078, 0x366e, 0x0078, 0x2272, 0xa02e, 0x2520, 0x81ff,
+ 0x00c0, 0x229c, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1,
+ 0x6d74, 0x41a1, 0x1078, 0x2a04, 0x0040, 0x229c, 0x2009, 0x0020,
+ 0x1078, 0x2a3c, 0x701b, 0x2335, 0x007c, 0x6834, 0x2008, 0xa084,
+ 0x00ff, 0xa096, 0x0011, 0x0040, 0x2341, 0xa096, 0x0019, 0x00c0,
+ 0x229c, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x229c, 0x710e, 0x700c,
+ 0x8001, 0x0040, 0x2372, 0x700e, 0x1078, 0x2a04, 0x0040, 0x229c,
+ 0x2009, 0x0020, 0x2061, 0x6d9d, 0x6224, 0x6328, 0x642c, 0x6530,
+ 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
+ 0x1078, 0x2a3c, 0x701b, 0x2365, 0x007c, 0x6834, 0xa084, 0x00ff,
+ 0xa096, 0x0002, 0x0040, 0x2370, 0xa096, 0x000a, 0x00c0, 0x229c,
+ 0x0078, 0x2347, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078,
+ 0x3344, 0x00c0, 0x2380, 0x7007, 0x0003, 0x701b, 0x2382, 0x007c,
+ 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099,
+ 0x6d74, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000,
+ 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, 0x0078,
+ 0x2a40, 0x6198, 0x7824, 0x609a, 0x0078, 0x2272, 0x2091, 0x8000,
+ 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, 0x2020,
+ 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100,
+ 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, 0x2009,
+ 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091,
+ 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8,
+ 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x7c28, 0x7d2c, 0x1078, 0x3592, 0xd28c, 0x00c0,
+ 0x23dd, 0x1078, 0x3522, 0x0078, 0x23df, 0x1078, 0x355e, 0x00c0,
+ 0x2409, 0x2061, 0x7400, 0x127e, 0x2091, 0x8000, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x23f7, 0x6010, 0xa06d, 0x0040, 0x23f7, 0x683c,
+ 0xa406, 0x00c0, 0x23f7, 0x6840, 0xa506, 0x0040, 0x2402, 0x127f,
+ 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x229c,
+ 0x0078, 0x23e3, 0x1078, 0x5f5d, 0x127f, 0x0040, 0x229c, 0x0078,
+ 0x2272, 0xa00e, 0x2001, 0x0005, 0x1078, 0x372d, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x36a1, 0x127f, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078,
+ 0x35a3, 0x0040, 0x229c, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078, 0x34d7,
+ 0x8631, 0x00c8, 0x242e, 0x2019, 0x0005, 0x1078, 0x35c4, 0x0040,
+ 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x22a0, 0x8003, 0x800b,
+ 0x810b, 0xa108, 0x1078, 0x40de, 0x0078, 0x2272, 0x127e, 0x2091,
+ 0x8000, 0x81ff, 0x00c0, 0x2476, 0x2029, 0x00ff, 0x644c, 0x2400,
+ 0xa506, 0x0040, 0x2470, 0x2508, 0x1078, 0x3447, 0x00c0, 0x2470,
+ 0x2031, 0x000f, 0x1078, 0x34d7, 0x8631, 0x00c8, 0x245a, 0x2019,
+ 0x0004, 0x1078, 0x35c4, 0x0040, 0x2476, 0x7824, 0xa08a, 0x1000,
+ 0x00c8, 0x2479, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x40de,
+ 0x8529, 0x00c8, 0x244f, 0x127f, 0x0078, 0x2272, 0x127f, 0x0078,
+ 0x229c, 0x127f, 0x0078, 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x1078, 0x3507, 0x1078, 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34f0, 0x1078,
+ 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x3561, 0x0040, 0x229c, 0x1078, 0x338c,
+ 0x1078, 0x351b, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x34d7, 0x62a0, 0x2019, 0x0005, 0x0c7e,
+ 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08,
+ 0x1078, 0x6a57, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x3592, 0x2208, 0x0078, 0x2272, 0x157e,
+ 0x0d7e, 0x0e7e, 0x2069, 0x6ddf, 0x6810, 0x6914, 0xa10a, 0x00c8,
+ 0x24d3, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000,
+ 0x20a9, 0x007e, 0x2069, 0x6e00, 0x2d04, 0xa075, 0x0040, 0x24e8,
+ 0x704c, 0x1078, 0x24f2, 0xa210, 0x7080, 0x1078, 0x24f2, 0xa318,
+ 0x8d68, 0x00f0, 0x24dc, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f,
+ 0x0078, 0x2272, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2501, 0x2001,
+ 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2501, 0x2178, 0x0078,
+ 0x24f9, 0x017f, 0x0f7f, 0x007c, 0x2069, 0x6ddf, 0x6910, 0x629c,
+ 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x614c, 0xa190, 0x2091,
+ 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00, 0xa215, 0x6364,
+ 0x0078, 0x2272, 0x613c, 0x6240, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x6244, 0x6338, 0x0078, 0x2272, 0x613c, 0x6240, 0x7824, 0x603e,
+ 0x7b28, 0x6342, 0x2069, 0x6d51, 0x831f, 0xa305, 0x6816, 0x0078,
+ 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078,
+ 0x2a1c, 0x0040, 0x22a0, 0x7828, 0xa00d, 0x0040, 0x22a0, 0x782c,
+ 0xa005, 0x0040, 0x22a0, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078,
+ 0x2272, 0x7d38, 0x7c3c, 0x0078, 0x231f, 0x7824, 0xa09c, 0x00ff,
+ 0xa39a, 0x0003, 0x00c8, 0x229c, 0x624c, 0xa084, 0xff00, 0x8007,
+ 0xa206, 0x00c0, 0x256d, 0x2001, 0x6d40, 0x2009, 0x000c, 0x7a2c,
+ 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0, 0x229c,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa084, 0x00ff, 0xa086,
+ 0x0006, 0x00c0, 0x229c, 0x0c7e, 0x1078, 0x2a04, 0x0c7f, 0x0040,
+ 0x229c, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6223,
+ 0x0040, 0x229c, 0x7007, 0x0003, 0x701b, 0x258f, 0x007c, 0x6830,
+ 0xa086, 0x0100, 0x0040, 0x229c, 0xad80, 0x000e, 0x2009, 0x000c,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x1078, 0x2a04,
+ 0x0040, 0x229c, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+ 0x1078, 0x2a3c, 0x701b, 0x25ad, 0x007c, 0xade8, 0x000d, 0x6800,
+ 0xa005, 0x0040, 0x22a0, 0x6804, 0xd0ac, 0x0040, 0x25ba, 0xd0a4,
+ 0x0040, 0x22a0, 0xd094, 0x0040, 0x25c5, 0x0c7e, 0x2061, 0x0100,
+ 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x25d0,
+ 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f,
+ 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x25e5, 0xd084,
+ 0x0040, 0x25e5, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0xa088,
+ 0x2091, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x25ee,
+ 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0x604e, 0x6808, 0xa08a,
+ 0x0100, 0x0048, 0x22a0, 0xa08a, 0x0841, 0x00c8, 0x22a0, 0xa084,
+ 0x0007, 0x00c0, 0x22a0, 0x680c, 0xa005, 0x0040, 0x22a0, 0x6810,
+ 0xa005, 0x0040, 0x22a0, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x22a0,
+ 0x8001, 0x0040, 0x22a0, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x22a0,
+ 0x8001, 0x0040, 0x22a0, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x6d51,
+ 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084,
+ 0x00ff, 0x6042, 0x1078, 0x3890, 0x1078, 0x366e, 0x6000, 0xa086,
+ 0x0000, 0x00c0, 0x265b, 0x6808, 0x602a, 0x1078, 0x1bcc, 0x6818,
+ 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
+ 0x611a, 0x621e, 0x6322, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x4168, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x2657, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x31cb, 0x0078, 0x265b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x2272, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x229c, 0x2069, 0x6d51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x2a40, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x31cb, 0x0078, 0x2272,
+ 0x81ff, 0x00c0, 0x229c, 0x617c, 0x81ff, 0x0040, 0x2692, 0x703f,
+ 0x0000, 0x2001, 0x73c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2a40, 0x701b, 0x226f,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x73c0, 0x20a9,
+ 0x0040, 0x20a1, 0x73c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x2091, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x26c4, 0x1078, 0x3447, 0x00c0, 0x26c4,
+ 0x6014, 0x821c, 0x0048, 0x26bc, 0xa398, 0x73c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x26c3, 0xa398, 0x73c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8,
+ 0x26cb, 0x0078, 0x26a8, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x73c0, 0x2099, 0x73c0, 0x1078,
+ 0x3213, 0x0078, 0x2681, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0c7e,
+ 0x1078, 0x2a04, 0x0c7f, 0x0040, 0x229c, 0x2001, 0x6d52, 0x2004,
+ 0xd0b4, 0x0040, 0x2708, 0x6000, 0xd08c, 0x00c0, 0x2708, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2708, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x625b, 0x0040, 0x229c, 0x7007,
+ 0x0003, 0x701b, 0x2704, 0x007c, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078,
+ 0x3213, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006,
+ 0x20a0, 0x1078, 0x3213, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098,
+ 0xad80, 0x000a, 0x20a0, 0x1078, 0x3213, 0x2d00, 0x2009, 0x0029,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x35ae, 0x0078,
+ 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8,
+ 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078,
+ 0x34d7, 0x8631, 0x00c8, 0x274f, 0x2019, 0x0004, 0x1078, 0x35c4,
+ 0x7924, 0x810f, 0x7a28, 0x1078, 0x275f, 0x0078, 0x2272, 0xa186,
+ 0x00ff, 0x0040, 0x2767, 0x1078, 0x2777, 0x0078, 0x2776, 0x2029,
+ 0x007e, 0x2061, 0x6d00, 0x644c, 0x2400, 0xa506, 0x0040, 0x2773,
+ 0x2508, 0x1078, 0x2777, 0x8529, 0x00c8, 0x276c, 0x007c, 0x1078,
+ 0x3447, 0x00c0, 0x2782, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108,
+ 0x1078, 0x40de, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078, 0x35b9, 0x0078, 0x2272,
+ 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078,
+ 0x34d7, 0x1078, 0x35a3, 0x0078, 0x2272, 0x6100, 0x0078, 0x2272,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa086, 0x0707, 0x0040,
+ 0x22a0, 0x2001, 0x6d00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x229c,
+ 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x27b9, 0xace8,
+ 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04,
+ 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078,
+ 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8,
+ 0x22a0, 0x7924, 0xa184, 0x00ff, 0xa082, 0x0010, 0x00c8, 0x22a0,
+ 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x27e6, 0xa182,
+ 0x007f, 0x00c8, 0x22a0, 0x2100, 0x1078, 0x1e30, 0x027e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x2061, 0x6f23, 0x601b, 0x0000, 0x601f,
+ 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6030,
+ 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043,
+ 0x0010, 0x2009, 0x001e, 0x2011, 0x31f0, 0x1078, 0x415f, 0x7924,
+ 0x810f, 0x7a28, 0x1078, 0x275f, 0x127f, 0x0c7f, 0x027f, 0x0078,
+ 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x3410,
+ 0x2c08, 0x0c7f, 0x00c0, 0x22a0, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x60bc, 0xd09c, 0x0040, 0x229c, 0x1078, 0x2a04, 0x0040,
+ 0x229c, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2a3c,
+ 0x701b, 0x2833, 0x007c, 0x2009, 0x0080, 0x1078, 0x3447, 0x00c0,
+ 0x229c, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10,
+ 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, 0x28a7, 0xa0be,
+ 0x0112, 0x0040, 0x28a7, 0xa0be, 0x0113, 0x0040, 0x28a7, 0xa0be,
+ 0x0114, 0x0040, 0x28a7, 0xa0be, 0x0117, 0x0040, 0x28a7, 0xa0be,
+ 0x011a, 0x0040, 0x28a7, 0xa0be, 0x0121, 0x0040, 0x289d, 0xa0be,
+ 0x0131, 0x0040, 0x289d, 0xa0be, 0x0171, 0x0040, 0x28a7, 0xa0be,
+ 0x01a1, 0x00c0, 0x2870, 0x6830, 0x8007, 0x6832, 0x0078, 0x28ad,
+ 0xa0be, 0x0212, 0x0040, 0x28a3, 0xa0be, 0x0213, 0x0040, 0x28a3,
+ 0xa0be, 0x0214, 0x0040, 0x2895, 0xa0be, 0x0217, 0x0040, 0x288f,
+ 0xa0be, 0x021a, 0x00c0, 0x2889, 0x6838, 0x8007, 0x683a, 0x0078,
+ 0x28a7, 0xa0be, 0x0300, 0x0040, 0x28a7, 0x0078, 0x229c, 0xad80,
+ 0x0010, 0x20a9, 0x0007, 0x1078, 0x28d9, 0xad80, 0x000e, 0x20a9,
+ 0x0001, 0x1078, 0x28d9, 0x0078, 0x28a7, 0xad80, 0x000c, 0x1078,
+ 0x28e7, 0x0078, 0x28ad, 0xad80, 0x000e, 0x1078, 0x28e7, 0xad80,
+ 0x000c, 0x20a9, 0x0001, 0x1078, 0x28d9, 0x0c7e, 0x1078, 0x2a04,
+ 0x0040, 0x28ce, 0x6837, 0x0119, 0x684f, 0x0020, 0x685b, 0x0001,
+ 0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92,
+ 0x6996, 0x689b, 0x0000, 0x0c7f, 0x0d7f, 0x1078, 0x623f, 0x0040,
+ 0x229c, 0x7007, 0x0003, 0x701b, 0x28d2, 0x007c, 0x0c7f, 0x0d7f,
+ 0x0078, 0x229c, 0x6820, 0xa086, 0x8001, 0x0040, 0x229c, 0x0078,
+ 0x2272, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a,
+ 0x8108, 0x280a, 0x8108, 0x00f0, 0x28db, 0x017f, 0x007c, 0x017e,
+ 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054,
+ 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108,
+ 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x00c0, 0x229c,
+ 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081, 0x0048, 0x22a0,
+ 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x7a2c, 0x7b28, 0x6064, 0xa306,
+ 0x00c0, 0x2918, 0x6068, 0xa206, 0x00c0, 0x2918, 0x0078, 0x22a0,
+ 0x0c7e, 0x1078, 0x297b, 0x2c68, 0x0c7f, 0x0040, 0x2939, 0xa0c6,
+ 0x4007, 0x00c0, 0x2926, 0x7c26, 0x0078, 0x2936, 0xa0c6, 0x4008,
+ 0x00c0, 0x292e, 0x7f26, 0x7e2a, 0x0078, 0x2936, 0xa0c6, 0x4009,
+ 0x00c0, 0x2934, 0x0078, 0x2936, 0x2001, 0x4006, 0x2020, 0x0078,
+ 0x2274, 0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x5504,
+ 0x0040, 0x2969, 0x2d00, 0x601a, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e,
+ 0x1078, 0x2a04, 0x0c7f, 0x2b70, 0x0040, 0x229c, 0x6837, 0x0000,
+ 0x2d00, 0x6012, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088,
+ 0x8000, 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x229c, 0x7007,
+ 0x0003, 0x701b, 0x2974, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0,
+ 0x2272, 0x0078, 0x229c, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021,
+ 0x0081, 0x20a9, 0x007e, 0x2071, 0x6e81, 0x2e04, 0xa005, 0x00c0,
+ 0x298f, 0x2100, 0xa406, 0x0040, 0x29c0, 0x0078, 0x29b4, 0x2068,
+ 0x6f10, 0x2700, 0xa306, 0x00c0, 0x29a5, 0x6e14, 0x2600, 0xa206,
+ 0x00c0, 0x29a5, 0x2400, 0xa106, 0x00c0, 0x29a1, 0x2d60, 0x0078,
+ 0x29c6, 0x2001, 0x4007, 0x0078, 0x29c7, 0x2400, 0xa106, 0x00c0,
+ 0x29b4, 0x6e14, 0x87ff, 0x00c0, 0x29b0, 0x86ff, 0x0040, 0x29c0,
+ 0x2001, 0x4008, 0x0078, 0x29c7, 0x8420, 0x8e70, 0x00f0, 0x2985,
+ 0x2001, 0x4009, 0x0078, 0x29c7, 0x2001, 0x0001, 0x0078, 0x29c7,
+ 0x1078, 0x3410, 0x00c0, 0x29bc, 0x6312, 0x6216, 0xa006, 0xa005,
+ 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a04,
+ 0x0040, 0x229c, 0x6837, 0x0000, 0x7824, 0xa005, 0x0040, 0x22a0,
+ 0xa096, 0x00ff, 0x0040, 0x29e0, 0xa092, 0x0004, 0x00c8, 0x22a0,
+ 0x2010, 0x2d18, 0x1078, 0x2013, 0x0040, 0x229c, 0x7007, 0x0003,
+ 0x701b, 0x29eb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x229c,
+ 0x0078, 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081,
+ 0x0048, 0x22a0, 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x1078, 0x615b,
+ 0x1078, 0x342f, 0x0078, 0x2272, 0x1078, 0x12f4, 0x0040, 0x2a1b,
+ 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0, 0x2a13, 0x2d00, 0x7012,
+ 0x7016, 0x0078, 0x2a19, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006,
+ 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff,
+ 0x1078, 0x3447, 0x00c0, 0x2a2a, 0xa6b4, 0x00ff, 0xa682, 0x0010,
+ 0x0048, 0x2a2b, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff,
+ 0x0040, 0x2a38, 0x2168, 0x6904, 0x1078, 0x1328, 0x0078, 0x2a2f,
+ 0x7112, 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2a42,
+ 0x2031, 0x0000, 0x2061, 0x6d9d, 0x6606, 0x6112, 0x600e, 0x6226,
+ 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x135f, 0x7007, 0x0002,
+ 0x701b, 0x2272, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079,
+ 0x0000, 0x2001, 0x6d7b, 0x2004, 0xa005, 0x00c0, 0x2a6e, 0x0068,
+ 0x2a6e, 0x7818, 0xd084, 0x00c0, 0x2a6e, 0x781b, 0x0001, 0x7a22,
+ 0x7b26, 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2a93, 0x017e, 0x0c7e,
+ 0x0e7e, 0x2071, 0x6d6d, 0x7138, 0xa182, 0x0004, 0x0048, 0x2a7c,
+ 0x7030, 0x2060, 0x0078, 0x2a8d, 0x7030, 0xa0e0, 0x0008, 0xac82,
+ 0x6d9d, 0x0048, 0x2a85, 0x2061, 0x6d7d, 0x2c00, 0x7032, 0x81ff,
+ 0x00c0, 0x2a8b, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a,
+ 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6d6d, 0x7038, 0xa005, 0x0040, 0x2acf, 0x127e, 0x2091, 0x8000,
+ 0x0068, 0x2ace, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0,
+ 0x2acd, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822,
+ 0x6004, 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001,
+ 0x703a, 0xa005, 0x00c0, 0x2ac3, 0x7033, 0x6d7d, 0x7037, 0x6d7d,
+ 0x0c7f, 0x0078, 0x2acd, 0xac80, 0x0008, 0xa0fa, 0x6d9d, 0x0048,
+ 0x2acb, 0x2001, 0x6d7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f,
+ 0x007c, 0x027e, 0x2001, 0x6d52, 0x2004, 0xd0c4, 0x0040, 0x2adc,
+ 0x2011, 0x8014, 0x1078, 0x2a53, 0x027f, 0x007c, 0x81ff, 0x00c0,
+ 0x229c, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078,
+ 0x31cb, 0x127f, 0x0078, 0x2272, 0x127e, 0x0c7e, 0x0e7e, 0x2061,
+ 0x0100, 0x2071, 0x6d00, 0x6044, 0xd0a4, 0x00c0, 0x2b11, 0xd084,
+ 0x0040, 0x2afe, 0x1078, 0x2c34, 0x0078, 0x2b11, 0xd08c, 0x0040,
+ 0x2b05, 0x1078, 0x2b4b, 0x0078, 0x2b11, 0xd094, 0x0040, 0x2b0c,
+ 0x1078, 0x2b2c, 0x0078, 0x2b11, 0xd09c, 0x0040, 0x2b11, 0x1078,
+ 0x2b15, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x6043, 0x0040, 0x6043,
+ 0x0000, 0x706f, 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009,
+ 0x73c0, 0x200b, 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011,
+ 0x3187, 0x1078, 0x415f, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2b4a,
+ 0x2011, 0x3187, 0x1078, 0x40d1, 0x6043, 0x0020, 0x6043, 0x0000,
+ 0x6044, 0xd08c, 0x00c0, 0x2b46, 0x7003, 0x0001, 0x7083, 0x0000,
+ 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2b4a, 0x7077, 0x0000,
+ 0x0078, 0x2b4a, 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2b54,
+ 0x1079, 0x2b57, 0x0078, 0x2b56, 0x1078, 0x12b7, 0x007c, 0x2b5a,
+ 0x2ba9, 0x2c33, 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1,
+ 0x8700, 0x1078, 0x1bcc, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079,
+ 0x7200, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f,
+ 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f,
+ 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f,
+ 0x0000, 0x2079, 0x720c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099,
+ 0x6d05, 0x20a1, 0x720e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7212,
+ 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7200, 0x20a1, 0x020b,
+ 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078,
+ 0x31b2, 0x0f7f, 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000,
+ 0x007c, 0x0d7e, 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2c1d,
+ 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x7184, 0x81ff, 0x0040, 0x2c04,
+ 0xa486, 0x000c, 0x00c0, 0x2c0f, 0xa480, 0x0018, 0x8004, 0x20a8,
+ 0x2011, 0x7280, 0x2019, 0x7200, 0x220c, 0x2304, 0xa106, 0x00c0,
+ 0x2bdb, 0x8210, 0x8318, 0x00f0, 0x2bc4, 0x6043, 0x0004, 0x608b,
+ 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x7077, 0x0002, 0x7083,
+ 0x0002, 0x0078, 0x2c1b, 0x2069, 0x7280, 0x6930, 0xa18e, 0x1101,
+ 0x00c0, 0x2c0f, 0x6834, 0xa005, 0x00c0, 0x2c0f, 0x6900, 0xa18c,
+ 0x00ff, 0x00c0, 0x2bef, 0x6804, 0xa005, 0x0040, 0x2c04, 0x2011,
+ 0x728e, 0x2019, 0x6d05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102,
+ 0x0048, 0x2c02, 0x00c0, 0x2c0f, 0x8210, 0x8318, 0x00f0, 0x2bf5,
+ 0x0078, 0x2c0f, 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043,
+ 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x60c3,
+ 0x000c, 0x1078, 0x31b2, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0,
+ 0x2c1b, 0x60c3, 0x000c, 0x2011, 0x6f1a, 0x2013, 0x0000, 0x707b,
+ 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4fdc, 0x0078, 0x2c1b, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8,
+ 0x2c3d, 0x1079, 0x2c40, 0x0078, 0x2c3f, 0x1078, 0x12b7, 0x007c,
+ 0x2c64, 0x2c73, 0x2ca6, 0x2cbb, 0x2ced, 0x2d17, 0x2d49, 0x2d73,
+ 0x2da5, 0x2dcb, 0x2e1a, 0x2e3c, 0x2e60, 0x2e76, 0x2e9c, 0x2eaf,
+ 0x2eb8, 0x2ed1, 0x2f01, 0x2f2b, 0x2f5b, 0x2f85, 0x2fce, 0x3003,
+ 0x3025, 0x3063, 0x3087, 0x30a0, 0x30ad, 0x7003, 0x0007, 0x6004,
+ 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0,
+ 0x6043, 0x0002, 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x318e,
+ 0x1078, 0x40c4, 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0,
+ 0x2ca4, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2ca4, 0x2079,
+ 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ca2, 0x7834, 0xa005,
+ 0x00c0, 0x2ca2, 0x7a38, 0xd2fc, 0x0040, 0x2c98, 0x70a4, 0xa005,
+ 0x00c0, 0x2c98, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0x7083, 0x0010, 0x1078, 0x2eb8,
+ 0x0078, 0x2ca4, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0003,
+ 0x6043, 0x0004, 0x1078, 0x321b, 0x20a3, 0x1102, 0x20a3, 0x0000,
+ 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x2cb2, 0x60c3, 0x0014,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2ceb,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2ce7,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ce7, 0x7834,
+ 0xa005, 0x00c0, 0x2ce7, 0x7a38, 0xd2fc, 0x0040, 0x2ce1, 0x70a4,
+ 0xa005, 0x00c0, 0x2ce1, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0004, 0x1078, 0x2ced, 0x0078, 0x2ceb, 0x7083,
+ 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0005, 0x1078,
+ 0x321b, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e,
+ 0x706c, 0xa005, 0x00c0, 0x2d09, 0x714c, 0xa186, 0xffff, 0x0040,
+ 0x2d09, 0x1078, 0x3152, 0x0040, 0x2d09, 0x2019, 0x002a, 0x1078,
+ 0x202f, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e,
+ 0x7078, 0xa005, 0x0040, 0x2d47, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0xa086, 0x0014, 0x00c0, 0x2d43, 0x2079, 0x7280, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2d43, 0x7834, 0xa005, 0x00c0, 0x2d43, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d3d, 0x70a4, 0xa005, 0x00c0, 0x2d3d, 0x2019,
+ 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078,
+ 0x2d49, 0x0078, 0x2d47, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f,
+ 0x007c, 0x7083, 0x0007, 0x1078, 0x321b, 0x20a3, 0x1104, 0x20a3,
+ 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2d65,
+ 0x7150, 0xa186, 0xffff, 0x0040, 0x2d65, 0xa180, 0x2091, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9, 0x0008, 0x2298,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2fbf,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2fbd,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2fbd, 0x7834,
- 0xa005, 0x00c0, 0x2fbd, 0x7a38, 0xd2fc, 0x0040, 0x2fb7, 0x709c,
- 0xa005, 0x00c0, 0x2fb7, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0014, 0x1078, 0x2fc1, 0x0078, 0x2fbf, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0015, 0x1078, 0x3286, 0x20a3, 0x1104, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa006, 0x00c0, 0x2fdd,
- 0x7150, 0xa186, 0xffff, 0x0040, 0x2fdd, 0xa180, 0x2207, 0x200c,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x31b4, 0x20a9, 0x0008, 0x2298,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2da3,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2d9f,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2d9f, 0x7834,
+ 0xa005, 0x00c0, 0x2d9f, 0x7a38, 0xd2fc, 0x0040, 0x2d99, 0x70a4,
+ 0xa005, 0x00c0, 0x2d99, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0008, 0x1078, 0x2da5, 0x0078, 0x2da3, 0x7083,
+ 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0009, 0x1078,
+ 0x321b, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x706c, 0xa005,
+ 0x00c0, 0x2db8, 0x1078, 0x30bc, 0x0040, 0x2dc8, 0x0078, 0x2dc2,
+ 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x2dca,
+ 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2e18,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2e14,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e14, 0x7834,
+ 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2dfb, 0x7a38, 0xd2fc, 0x0040,
+ 0x2df3, 0x70a4, 0xa005, 0x00c0, 0x2df3, 0x2019, 0x002a, 0x1078,
+ 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083, 0x000a, 0x1078,
+ 0x2e1a, 0x0078, 0x2e18, 0xa005, 0x00c0, 0x2e14, 0x7a38, 0xd2fc,
+ 0x0040, 0x2e0c, 0x70a4, 0xa005, 0x00c0, 0x2e0c, 0x2019, 0x002a,
+ 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e,
+ 0x1078, 0x2e9c, 0x0078, 0x2e18, 0x7083, 0x0002, 0x707b, 0x0000,
+ 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x720e, 0x22a0, 0x20a9,
+ 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
+ 0x41a4, 0x1078, 0x321b, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
+ 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
+ 0x2e5e, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0,
+ 0x2e5a, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2e5a,
+ 0x7834, 0xa005, 0x00c0, 0x2e5a, 0x7083, 0x000c, 0x1078, 0x2e60,
+ 0x0078, 0x2e5e, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
+ 0x7083, 0x000d, 0x1078, 0x321b, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x728e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078,
+ 0xa005, 0x0040, 0x2e9a, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086,
+ 0x0084, 0x00c0, 0x2e96, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2e96, 0x7834, 0xa005, 0x00c0, 0x2e96, 0x1078, 0x320d,
+ 0x7083, 0x000e, 0x1078, 0x2e9c, 0x0078, 0x2e9a, 0x7083, 0x0002,
+ 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000,
+ 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
+ 0x2009, 0x07d0, 0x2011, 0x318e, 0x1078, 0x40c4, 0x007c, 0x7078,
+ 0xa005, 0x0040, 0x2eb7, 0x2011, 0x318e, 0x1078, 0x40d1, 0x007c,
+ 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280,
+ 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x31b2,
+ 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2eff, 0x2011, 0x318e,
+ 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2efd, 0x2079, 0x7280,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2efd, 0x7834, 0xa005, 0x00c0,
+ 0x2efd, 0x7a38, 0xd2fc, 0x0040, 0x2ef7, 0x70a4, 0xa005, 0x00c0,
+ 0x2ef7, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083,
+ 0x0012, 0x1078, 0x2f01, 0x0078, 0x2eff, 0x707b, 0x0000, 0x0f7f,
+ 0x007c, 0x7083, 0x0013, 0x1078, 0x3227, 0x20a3, 0x1103, 0x20a3,
+ 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2f1d,
+ 0x714c, 0xa186, 0xffff, 0x0040, 0x2f1d, 0x1078, 0x3152, 0x0040,
+ 0x2f1d, 0x2019, 0x002a, 0x1078, 0x202f, 0x20a9, 0x0008, 0x2298,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x302e,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x302c,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x302c, 0x7834,
- 0x2011, 0x0100, 0xa21e, 0x00c0, 0x3015, 0x7a38, 0xd2fc, 0x0040,
- 0x3011, 0x709c, 0xa005, 0x00c0, 0x3011, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x7077, 0x0001, 0x0078, 0x3026, 0xa005, 0x00c0, 0x302c,
- 0x7a38, 0xd2fc, 0x0040, 0x3024, 0x709c, 0xa005, 0x00c0, 0x3024,
- 0x1078, 0x32a9, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x0016,
- 0x1078, 0x3030, 0x0078, 0x302e, 0x7073, 0x0000, 0x0f7f, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b,
- 0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0x738e, 0x7074, 0xa005,
- 0x0040, 0x3046, 0x707b, 0x0017, 0x0078, 0x3048, 0x707b, 0x001b,
- 0x7064, 0xa005, 0x00c0, 0x3052, 0x1078, 0x311e, 0x0040, 0x3062,
- 0x0078, 0x305c, 0x20a9, 0x0008, 0x2099, 0x738e, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3210,
- 0x0078, 0x3064, 0x1078, 0x2cd7, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x3085, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084,
- 0x00c0, 0x3083, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1106, 0x00c0,
- 0x3083, 0x7834, 0xa005, 0x00c0, 0x3083, 0x707b, 0x0018, 0x1078,
- 0x3087, 0x0078, 0x3085, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x0019, 0x1078, 0x3286, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430,
- 0x2099, 0x738e, 0x2039, 0x730e, 0x27a0, 0x20a9, 0x0040, 0x53a3,
- 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294,
- 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0,
- 0x730e, 0x2414, 0xa38c, 0x0001, 0x0040, 0x30b2, 0xa294, 0xff00,
- 0x0078, 0x30b5, 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798,
- 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0084, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x30e7, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084,
- 0x00c0, 0x30e5, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1107, 0x00c0,
- 0x30e5, 0x7834, 0xa005, 0x00c0, 0x30e5, 0x1078, 0x326c, 0x707b,
- 0x001a, 0x1078, 0x30e9, 0x0078, 0x30e7, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
- 0x7380, 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007,
- 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078,
- 0x3210, 0x007c, 0x7070, 0xa005, 0x0040, 0x310e, 0x2011, 0x31f0,
- 0x1078, 0x4187, 0x707b, 0x001c, 0x1078, 0x310f, 0x007c, 0x7073,
- 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009,
- 0x07d0, 0x2011, 0x31f0, 0x1078, 0x417a, 0x007c, 0x087e, 0x097e,
- 0x2029, 0x6f52, 0x252c, 0x20a9, 0x0008, 0x2041, 0x730e, 0x28a0,
- 0x2099, 0x738e, 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4,
- 0x0040, 0x3134, 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6,
- 0xffff, 0x00c0, 0x3146, 0xd5d4, 0x0040, 0x3141, 0x8210, 0x0078,
- 0x3142, 0x8211, 0x00f0, 0x3134, 0x0078, 0x31ab, 0x82ff, 0x00c0,
- 0x3158, 0xd5d4, 0x0040, 0x3152, 0xa1a6, 0x3fff, 0x0040, 0x313e,
- 0x0078, 0x3156, 0xa1a6, 0x3fff, 0x0040, 0x31ab, 0xa18d, 0xc000,
- 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0040, 0x3161, 0x2019,
- 0x0010, 0x2120, 0xd5d4, 0x0040, 0x3168, 0x8423, 0x0078, 0x3169,
- 0x8424, 0x00c8, 0x3176, 0xd5d4, 0x0040, 0x3171, 0x8319, 0x0078,
- 0x3172, 0x8318, 0x00f0, 0x3162, 0x0078, 0x31ab, 0x23a8, 0x2021,
- 0x0001, 0x8426, 0x8425, 0x00f0, 0x317a, 0x2328, 0x8529, 0xa2be,
- 0x0007, 0x0040, 0x318e, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a,
- 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, 0x318a, 0x754e, 0xa5c8,
- 0x2207, 0x292c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
- 0x2018, 0x2304, 0xa405, 0x201a, 0x7067, 0x0001, 0x26a0, 0x2898,
- 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x31b1, 0xa006, 0x0078, 0x31b1, 0xa006, 0x1078,
- 0x1288, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001,
- 0x0007, 0xa39a, 0x0010, 0x0048, 0x31c1, 0x8420, 0x8001, 0x0078,
- 0x31b9, 0x2118, 0x84ff, 0x0040, 0x31ca, 0xa39a, 0x0010, 0x8421,
- 0x00c0, 0x31c5, 0x2021, 0x0001, 0x83ff, 0x0040, 0x31d3, 0x8423,
- 0x8319, 0x00c0, 0x31cf, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x31e8,
- 0xa405, 0x203a, 0x714e, 0xa1a0, 0x2207, 0x242c, 0xa5ac, 0x00ff,
- 0x6532, 0x60e7, 0x0000, 0x65ea, 0x7067, 0x0001, 0xa084, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x706b, 0x0000, 0x0e7f, 0x007c,
- 0x0e7e, 0x0f7e, 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x4f8e,
- 0x7004, 0xa084, 0x4000, 0x0040, 0x3201, 0x7003, 0x1000, 0x7003,
- 0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f1e, 0x2073, 0x0000,
- 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x2011, 0x70c0, 0x2013, 0x0000, 0x7073,
- 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x4f85, 0x2009, 0x07d0, 0x2011, 0x31f0, 0x1078, 0x4217,
- 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x00f7, 0x1078, 0x3292, 0x2061, 0x70c9, 0x601b, 0x0000, 0x601f,
- 0x0000, 0x2061, 0x6f00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
- 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x324e, 0x1078,
- 0x417a, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078, 0x4f8e, 0x2071,
- 0x0140, 0x7004, 0xa084, 0x4000, 0x0040, 0x3262, 0x7003, 0x1000,
- 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x1078, 0x3229,
- 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x74c0,
- 0x2099, 0x738e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0,
- 0x3272, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7300,
- 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x000c,
- 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001,
- 0x6f2a, 0x2004, 0xa005, 0x00c0, 0x32a3, 0x6030, 0xa084, 0x00ff,
- 0xa105, 0x0078, 0x32a5, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f,
- 0x007c, 0x017e, 0x047e, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040,
- 0x32bc, 0xa006, 0x2020, 0x2009, 0x002a, 0x1078, 0x6dc4, 0x2001,
- 0x6f0c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2186,
- 0x047f, 0x017f, 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x7020,
- 0xa006, 0x200a, 0x8108, 0x00f0, 0x32c9, 0x157f, 0x007c, 0x0d7e,
- 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0x6f51, 0xa006, 0x6002,
- 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2207, 0x231c,
- 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0,
- 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e,
- 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066,
- 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086,
- 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a,
- 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042,
- 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x33bb,
- 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x33c1, 0x2001,
- 0x6f0c, 0x2004, 0xa084, 0x0003, 0x00c0, 0x33a4, 0xa188, 0x7020,
- 0x2104, 0xa065, 0x0040, 0x339a, 0x6004, 0xa084, 0x00ff, 0xa08e,
- 0x0006, 0x00c0, 0x33a0, 0x6078, 0xa00d, 0x0040, 0x3345, 0xa680,
- 0x6e58, 0x2004, 0xa10c, 0x00c0, 0x3394, 0x607c, 0xa00d, 0x0040,
- 0x3361, 0xa680, 0x6e58, 0x2004, 0xa10c, 0x0040, 0x3361, 0x694c,
- 0xd1fc, 0x00c0, 0x3357, 0x1078, 0x3454, 0x0078, 0x338f, 0x1078,
- 0x3425, 0x694c, 0xd1ec, 0x00c0, 0x338f, 0x1078, 0x356d, 0x0078,
- 0x338f, 0x694c, 0xa184, 0xa000, 0x0040, 0x337f, 0xd1ec, 0x0040,
- 0x3378, 0xd1fc, 0x0040, 0x3370, 0x1078, 0x3584, 0x0078, 0x337b,
- 0xa680, 0x6e58, 0x200c, 0x607c, 0xa105, 0x607e, 0x0078, 0x337f,
- 0xd1fc, 0x0040, 0x337f, 0x1078, 0x3425, 0x0078, 0x338f, 0x6050,
- 0xa00d, 0x0040, 0x338a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
- 0x0078, 0x338f, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078,
- 0x445d, 0xa006, 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000,
- 0x0078, 0x33c5, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x33c5,
- 0xa082, 0x0006, 0x0048, 0x333b, 0x2009, 0x6f0c, 0x210c, 0xd18c,
- 0x0040, 0x33ae, 0x2001, 0x0004, 0x0078, 0x33b7, 0xd184, 0x0040,
- 0x33b5, 0x2001, 0x0004, 0x0078, 0x33b7, 0x2001, 0x0029, 0x2009,
- 0x0000, 0x0078, 0x33c5, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x33c5, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c,
- 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x340a, 0xa18c,
- 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x33fa, 0xa188, 0x7020,
- 0x2104, 0xa065, 0x0040, 0x33fa, 0x6004, 0xa084, 0x00ff, 0xa08e,
- 0x0006, 0x00c0, 0x3400, 0x684c, 0xd0ec, 0x0040, 0x33ed, 0x1078,
- 0x3584, 0x1078, 0x3425, 0x0078, 0x33f5, 0x1078, 0x3425, 0x684c,
- 0xd0fc, 0x0040, 0x33f5, 0x1078, 0x356d, 0x1078, 0x3598, 0xa006,
- 0x0078, 0x340e, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x340e,
- 0xa082, 0x0006, 0x0048, 0x33e3, 0x2001, 0x0029, 0x2009, 0x0000,
- 0x0078, 0x340e, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x341e, 0x2d00,
- 0x200a, 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052,
- 0x604e, 0x6803, 0x0000, 0x0078, 0x341c, 0x127e, 0x2091, 0x8000,
- 0x604c, 0xa005, 0x0040, 0x3431, 0x6802, 0x2d00, 0x604e, 0x127f,
- 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x342f,
- 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x3446, 0x6800,
- 0xa005, 0x00c0, 0x3444, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c,
- 0x604c, 0xa06d, 0x0040, 0x3453, 0x6800, 0xa005, 0x00c0, 0x3451,
- 0x6052, 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d,
- 0x0040, 0x345e, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086,
- 0x6082, 0x0078, 0x345d, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000,
- 0x6218, 0x2260, 0x6200, 0xa005, 0x0040, 0x3471, 0xc285, 0x0078,
- 0x3472, 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e,
- 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00,
- 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091,
- 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215,
- 0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048,
- 0x349d, 0xa085, 0x0001, 0x0078, 0x34b1, 0xa190, 0x7020, 0x2204,
- 0xa065, 0x00c0, 0x34b0, 0x017e, 0x0d7e, 0x1078, 0x12c7, 0x2d60,
- 0x0d7f, 0x017f, 0x0040, 0x3499, 0x2c00, 0x2012, 0x1078, 0x32cf,
- 0xa006, 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x34bc,
- 0xa085, 0x0001, 0x0078, 0x34c9, 0x0d7e, 0xa190, 0x7020, 0x2204,
- 0xa06d, 0x0040, 0x34c7, 0x2013, 0x0000, 0x1078, 0x12fb, 0x0d7f,
- 0xa006, 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x34d4,
- 0xa085, 0x0001, 0x0078, 0x34db, 0xa188, 0x7020, 0x2104, 0xa065,
- 0x0040, 0x34d0, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e,
- 0x147e, 0x600b, 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002,
- 0x2069, 0x738e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a,
- 0x0048, 0x34f3, 0x603a, 0x6814, 0x6066, 0x2099, 0x7396, 0xac88,
- 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x739a, 0xac88,
- 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x73ae, 0x6808,
- 0x606a, 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182,
- 0x0211, 0x00c8, 0x3517, 0x2009, 0x0008, 0x0078, 0x3541, 0xa182,
- 0x0259, 0x00c8, 0x351f, 0x2009, 0x0007, 0x0078, 0x3541, 0xa182,
- 0x02c1, 0x00c8, 0x3527, 0x2009, 0x0006, 0x0078, 0x3541, 0xa182,
- 0x0349, 0x00c8, 0x352f, 0x2009, 0x0005, 0x0078, 0x3541, 0xa182,
- 0x0421, 0x00c8, 0x3537, 0x2009, 0x0004, 0x0078, 0x3541, 0xa182,
- 0x0581, 0x00c8, 0x353f, 0x2009, 0x0003, 0x0078, 0x3541, 0x2009,
- 0x0002, 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e,
- 0x2071, 0x738d, 0x2e04, 0x6896, 0x2071, 0x738e, 0x7004, 0x689a,
- 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001, 0x6e58, 0xa600, 0x2004,
- 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d, 0x617a, 0x127f, 0x007c,
- 0x2001, 0x6e58, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000,
- 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c, 0x2001, 0x6e58, 0xa600,
- 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10c, 0x617e,
- 0x127f, 0x0078, 0x357d, 0x1078, 0x3410, 0x1078, 0x35de, 0x00c0,
- 0x357b, 0x1078, 0x3598, 0x007c, 0x2001, 0x6e58, 0xa600, 0x2004,
- 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d, 0x617e, 0x127f, 0x0078,
- 0x3593, 0x1078, 0x3454, 0x1078, 0x35a2, 0x00c0, 0x3591, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x445d, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x35a4, 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000,
- 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, 0x35c4, 0x8dff, 0x0040,
- 0x35d9, 0x83ff, 0x0040, 0x35bc, 0x6844, 0xa084, 0x00ff, 0xa606,
- 0x0040, 0x35c9, 0x0078, 0x35c4, 0x683c, 0xa406, 0x00c0, 0x35c4,
- 0x6840, 0xa506, 0x0040, 0x35c9, 0x2d08, 0x6800, 0x2068, 0x0078,
- 0x35ae, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x35d1, 0x624e, 0x0078,
- 0x35d4, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x35d9, 0x6152,
- 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x35e0, 0x2019, 0x0001,
- 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x360e, 0x83ff, 0x0040,
- 0x35f1, 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x35fe, 0x0078,
- 0x35f9, 0x683c, 0xa406, 0x00c0, 0x35f9, 0x6840, 0xa506, 0x0040,
- 0x35fe, 0x2d08, 0x6800, 0x2068, 0x0078, 0x35e3, 0x6a00, 0x6080,
- 0xad06, 0x00c0, 0x3606, 0x6282, 0x0078, 0x3609, 0xa180, 0x0000,
- 0x2202, 0x82ff, 0x00c0, 0x360e, 0x6186, 0x8dff, 0x007c, 0x2001,
- 0x6e58, 0xa600, 0x2004, 0x6178, 0xa10c, 0x0040, 0x3619, 0x2011,
- 0x0001, 0x617c, 0xa10c, 0x0040, 0x361f, 0xa295, 0x0002, 0x007c,
- 0x1078, 0x366b, 0x0040, 0x3628, 0x1078, 0x62c8, 0x0078, 0x362a,
- 0xa085, 0x0001, 0x007c, 0x1078, 0x366b, 0x0040, 0x3633, 0x1078,
- 0x6257, 0x0078, 0x3635, 0xa085, 0x0001, 0x007c, 0x1078, 0x366b,
- 0x0040, 0x363e, 0x1078, 0x629d, 0x0078, 0x3640, 0xa085, 0x0001,
- 0x007c, 0x1078, 0x366b, 0x0040, 0x3649, 0x1078, 0x6273, 0x0078,
- 0x364b, 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x8000, 0x6080, 0xa06d, 0x0040, 0x3663, 0x6800, 0x007e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x63d5, 0x1078, 0x3720,
- 0x007f, 0x0078, 0x3652, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f,
- 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x2079,
- 0x6f51, 0x7804, 0xd0a4, 0x0040, 0x3697, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb, 0x00c0, 0x368b,
- 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, 0x368b,
- 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x367b, 0x0c7f,
- 0x157f, 0x2009, 0x07d0, 0x2011, 0x3699, 0x1078, 0x4217, 0x0f7f,
- 0x007c, 0x2011, 0x3699, 0x1078, 0x4187, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb, 0x00c0, 0x36c5,
- 0x6000, 0xd0ec, 0x0040, 0x36c5, 0x047e, 0x62a0, 0xa294, 0x00ff,
- 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6dc4, 0x6000, 0xc0e5,
- 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be,
- 0x2009, 0x0000, 0x1078, 0x6bfe, 0x047f, 0x017f, 0x8108, 0x00f0,
- 0x36a3, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060, 0x6000,
- 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x6fff, 0x7003, 0x0001,
- 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020,
- 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6fff,
- 0x684c, 0xa005, 0x00c0, 0x36fb, 0x7028, 0xc085, 0x702a, 0xa085,
- 0x0001, 0x0078, 0x371e, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868,
- 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844,
- 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c,
- 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, 0x7372,
- 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x3771, 0x6804, 0xa00d, 0x0040,
- 0x373f, 0x0d7e, 0x0e7e, 0x2071, 0x6f00, 0x027e, 0xa016, 0x702c,
- 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, 0x3730,
- 0x702e, 0x7098, 0xa200, 0x709a, 0x027f, 0x0e7f, 0x0d7f, 0x2071,
- 0x6fff, 0x701c, 0xa005, 0x00c0, 0x3782, 0x0068, 0x3780, 0x2071,
- 0x6f51, 0x7004, 0xd09c, 0x0040, 0x3780, 0x6934, 0xa186, 0x0103,
- 0x00c0, 0x3793, 0x6948, 0x6844, 0xa105, 0x00c0, 0x3773, 0x2009,
- 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3780, 0x7122,
- 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
- 0x2071, 0x6f00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000,
- 0x709a, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3780,
- 0x6868, 0xa005, 0x00c0, 0x3780, 0x2009, 0x8020, 0x0078, 0x3759,
- 0x2071, 0x6fff, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012,
- 0x7018, 0xa06d, 0x711a, 0x0040, 0x3790, 0x6902, 0x0078, 0x3791,
- 0x711e, 0x0078, 0x3771, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040,
- 0x37a1, 0xa186, 0x001e, 0x0040, 0x37a1, 0xa18e, 0x001f, 0x00c0,
- 0x3780, 0x684c, 0xd0cc, 0x0040, 0x3780, 0x6850, 0xa084, 0x00ff,
- 0xa086, 0x0001, 0x00c0, 0x3780, 0x2009, 0x8021, 0x0078, 0x3759,
- 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071,
- 0x6fff, 0x7004, 0x0079, 0x37c4, 0x37cc, 0x37db, 0x386b, 0x386c,
- 0x387c, 0x3882, 0x37cd, 0x3859, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x0068, 0x37da, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080,
- 0x7007, 0x0001, 0x127f, 0x701c, 0xa06d, 0x0040, 0x3858, 0x0e7e,
- 0x2071, 0x6f51, 0x7004, 0xd09c, 0x0040, 0x383a, 0x6934, 0xa186,
- 0x0103, 0x00c0, 0x3810, 0x6948, 0x6844, 0xa105, 0x00c0, 0x382d,
- 0x2009, 0x8020, 0x127e, 0x2091, 0x8000, 0x0068, 0x380c, 0x2071,
- 0x0000, 0x7018, 0xd084, 0x00c0, 0x380c, 0x7122, 0x683c, 0x7026,
- 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f,
- 0x1078, 0x38b5, 0x0078, 0x3858, 0x127f, 0x0e7f, 0x0078, 0x3858,
- 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, 0x381e, 0xa186, 0x001e,
- 0x0040, 0x381e, 0xa18e, 0x001f, 0x00c0, 0x383a, 0x684c, 0xd0cc,
- 0x0040, 0x383a, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
- 0x383a, 0x2009, 0x8021, 0x0078, 0x37f2, 0x6844, 0xa086, 0x0100,
- 0x00c0, 0x383a, 0x6868, 0xa005, 0x00c0, 0x383a, 0x2009, 0x8020,
- 0x0078, 0x37f2, 0x0e7f, 0x1078, 0x38c9, 0x0040, 0x3858, 0x700f,
- 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, 0x384f,
- 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x384f, 0x710e, 0x7007,
- 0x0003, 0x1078, 0x38e9, 0x7050, 0xa086, 0x0100, 0x0040, 0x386c,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x386a, 0x1078, 0x38c9, 0x0040,
- 0x386a, 0x7007, 0x0003, 0x1078, 0x38e9, 0x7050, 0xa086, 0x0100,
- 0x0040, 0x386c, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0,
- 0x3875, 0x7007, 0x0004, 0x0078, 0x387c, 0xa086, 0x0200, 0x00c0,
- 0x387b, 0x7007, 0x0005, 0x007c, 0x1078, 0x3883, 0x7006, 0x1078,
- 0x38b5, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
- 0x3890, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, 0x389a,
- 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x389a, 0x7070, 0xa081,
- 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0, 0x38ae,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x38b1, 0x2001, 0x000d, 0x2102,
- 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001, 0x0007,
- 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x38c8, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04,
- 0x701e, 0xa005, 0x00c0, 0x38c5, 0x701a, 0x127f, 0x1078, 0x12fb,
- 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x38d8,
- 0x2304, 0x230c, 0xa10e, 0x0040, 0x38d8, 0xa006, 0x0078, 0x38e8,
- 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x38e2, 0x2300, 0xa005,
- 0x0078, 0x38e8, 0x0048, 0x38e7, 0xa302, 0x0078, 0x38e8, 0x8002,
- 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x70d9, 0x2104, 0xc08d, 0x200a,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x2071, 0x6fcd, 0x7003, 0x0000,
- 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000,
- 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000,
- 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x6fcd, 0x6848, 0xa005, 0x00c0, 0x3925, 0x7028, 0xc085,
- 0x702a, 0xa085, 0x0001, 0x0078, 0x394a, 0x6a50, 0x7236, 0x6b54,
- 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848,
- 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006,
- 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319,
- 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f,
- 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x6fcd, 0x7004,
- 0x1079, 0x39aa, 0x700c, 0x0079, 0x3955, 0x395a, 0x394f, 0x394f,
- 0x394f, 0x394f, 0x007c, 0x700c, 0x0079, 0x395e, 0x3963, 0x39a8,
- 0x39a8, 0x39a9, 0x39a9, 0x7830, 0x7930, 0xa106, 0x0040, 0x396d,
- 0x7830, 0x7930, 0xa106, 0x00c0, 0x3993, 0x7030, 0xa10a, 0x0040,
- 0x3993, 0x00c8, 0x3975, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8,
- 0x3994, 0x1078, 0x12c7, 0x0040, 0x3993, 0x2d00, 0x705a, 0x7063,
- 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091,
- 0x8000, 0x2009, 0x70d9, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x1078, 0x12c7, 0x0040, 0x3993,
- 0x2d00, 0x705a, 0x1078, 0x12c7, 0x00c0, 0x39a0, 0x0078, 0x397f,
- 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x3983,
- 0x007c, 0x007c, 0x39bb, 0x39bc, 0x39f3, 0x39f4, 0x39a8, 0x3a2a,
- 0x3a2f, 0x3a66, 0x3a67, 0x3a82, 0x3a83, 0x3a84, 0x3a85, 0x3a86,
- 0x3a87, 0x3af0, 0x3b1a, 0x007c, 0x700c, 0x0079, 0x39bf, 0x39c4,
- 0x39c7, 0x39d7, 0x39f2, 0x39f2, 0x1078, 0x395b, 0x007c, 0x127e,
- 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3df9, 0x0040, 0x39d4,
- 0x2091, 0x8000, 0x1078, 0x395b, 0x0d7f, 0x0078, 0x39e0, 0x127e,
- 0x8001, 0x700e, 0x1078, 0x3df9, 0x7058, 0x2068, 0x7084, 0x705a,
- 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a,
- 0x0020, 0x00c8, 0x39ef, 0x1079, 0x3a0a, 0x127f, 0x007c, 0x127f,
- 0x1078, 0x3a88, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0x6fcd,
- 0x700c, 0x0079, 0x39fb, 0x3a00, 0x3a00, 0x3a00, 0x3a02, 0x3a06,
- 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3a08, 0x700f, 0x0002,
- 0x0e7f, 0x007c, 0x3a88, 0x3a88, 0x3aa4, 0x3a88, 0x3b8f, 0x3a88,
- 0x3a88, 0x3a88, 0x3a88, 0x3a88, 0x3aa4, 0x3bd4, 0x3c1d, 0x3c75,
- 0x3c88, 0x3a88, 0x3a88, 0x3ac0, 0x3aa4, 0x3a88, 0x3a88, 0x3ad6,
- 0x3d0f, 0x3d2c, 0x3a88, 0x3ac0, 0x3a88, 0x3a88, 0x3a88, 0x3a88,
- 0x3ad6, 0x3d2c, 0x7020, 0x2068, 0x1078, 0x12fb, 0x007c, 0x700c,
- 0x0079, 0x3a32, 0x3a37, 0x3a3a, 0x3a4a, 0x3a65, 0x3a65, 0x1078,
- 0x395b, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078,
- 0x3df9, 0x0040, 0x3a47, 0x2091, 0x8000, 0x1078, 0x395b, 0x0d7f,
- 0x0078, 0x3a53, 0x127e, 0x8001, 0x700e, 0x1078, 0x3df9, 0x7058,
- 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834,
- 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x3a62, 0x1079, 0x3a68,
- 0x127f, 0x007c, 0x127f, 0x1078, 0x3a88, 0x007c, 0x007c, 0x007c,
- 0x3a88, 0x3aa4, 0x3b79, 0x3a88, 0x3aa4, 0x3a88, 0x3aa4, 0x3aa4,
- 0x3a88, 0x3aa4, 0x3b79, 0x3aa4, 0x3aa4, 0x3aa4, 0x3aa4, 0x3aa4,
- 0x3a88, 0x3aa4, 0x3b79, 0x3a88, 0x3a88, 0x3aa4, 0x3a88, 0x3a88,
- 0x3a88, 0x3aa4, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3720, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3720, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3720,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3720, 0x127f, 0x007c,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3a96, 0x8001, 0x00c0,
- 0x3acd, 0x7007, 0x0001, 0x0078, 0x3b56, 0x7007, 0x0006, 0x7012,
- 0x2d00, 0x7016, 0x701a, 0x704b, 0x3b56, 0x007c, 0x2d00, 0x7016,
- 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0x6ff8,
- 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3ab2, 0x6884,
- 0xa08a, 0x0003, 0x00c8, 0x3ab2, 0xa080, 0x3b47, 0x2004, 0x70c6,
- 0x7010, 0xa015, 0x0040, 0x3b3a, 0x1078, 0x12c7, 0x00c0, 0x3afb,
- 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000,
- 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, 0x3b0a,
- 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296, 0x0004,
- 0x0040, 0x3b13, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022,
- 0x1078, 0x1332, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3b2e, 0xa086,
- 0x0200, 0x0040, 0x3b26, 0x7007, 0x0010, 0x007c, 0x7020, 0x2068,
- 0x1078, 0x12fb, 0x7014, 0x2068, 0x0078, 0x3ab2, 0x7020, 0x2068,
- 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a,
- 0x0078, 0x3af0, 0x7014, 0x2068, 0x7007, 0x0001, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x0040, 0x3d49, 0x0078, 0x3b56, 0x3b4a,
- 0x3b4e, 0x3b52, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f,
- 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006, 0x2009, 0x6f2a,
- 0x210c, 0x81ff, 0x00c0, 0x3b73, 0x6838, 0xa084, 0x00ff, 0x683a,
- 0x6853, 0x0000, 0x1078, 0x3316, 0x00c0, 0x3b67, 0x007c, 0x1078,
- 0x37b0, 0x127e, 0x2091, 0x8000, 0x1078, 0x63d5, 0x1078, 0x3720,
- 0x127f, 0x0078, 0x3b66, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
- 0x3b67, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
- 0x8001, 0x7012, 0x0040, 0x3b88, 0x7007, 0x0006, 0x0078, 0x3b8e,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2f59,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2f57,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2f57, 0x7834,
+ 0xa005, 0x00c0, 0x2f57, 0x7a38, 0xd2fc, 0x0040, 0x2f51, 0x70a4,
+ 0xa005, 0x00c0, 0x2f51, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0014, 0x1078, 0x2f5b, 0x0078, 0x2f59, 0x707b,
+ 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078, 0x3227, 0x20a3,
+ 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa006,
+ 0x00c0, 0x2f77, 0x7150, 0xa186, 0xffff, 0x0040, 0x2f77, 0xa180,
+ 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9,
+ 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005,
+ 0x0040, 0x2fcc, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014,
+ 0x00c0, 0x2fca, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0,
+ 0x2fca, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2fb1, 0x7a38,
+ 0xd2fc, 0x0040, 0x2fad, 0x70a4, 0xa005, 0x00c0, 0x2fad, 0x2019,
+ 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078,
+ 0x2fc4, 0xa005, 0x00c0, 0x2fca, 0x7a38, 0xd2fc, 0x0040, 0x2fc2,
+ 0x70a4, 0xa005, 0x00c0, 0x2fc2, 0x2019, 0x002a, 0x1078, 0x202f,
+ 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x2fce,
+ 0x0078, 0x2fcc, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x000e,
+ 0x53a6, 0x3430, 0x2011, 0x728e, 0x707c, 0xa005, 0x0040, 0x2fe4,
+ 0x7083, 0x0017, 0x0078, 0x2fe6, 0x7083, 0x001b, 0x706c, 0xa005,
+ 0x00c0, 0x2ff0, 0x1078, 0x30bc, 0x0040, 0x3000, 0x0078, 0x2ffa,
+ 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x3002,
+ 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3023,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3021,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3021, 0x7834,
+ 0xa005, 0x00c0, 0x3021, 0x7083, 0x0018, 0x1078, 0x3025, 0x0078,
+ 0x3023, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0019, 0x1078,
+ 0x3227, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x728e,
+ 0x2039, 0x720e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514,
+ 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
+ 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0x720e, 0x2414,
+ 0xa38c, 0x0001, 0x0040, 0x3050, 0xa294, 0xff00, 0x0078, 0x3053,
+ 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9,
+ 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3085,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3083,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3083, 0x7834,
+ 0xa005, 0x00c0, 0x3083, 0x1078, 0x320d, 0x7083, 0x001a, 0x1078,
+ 0x3087, 0x0078, 0x3085, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
+ 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1,
+ 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8,
+ 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c,
+ 0x7078, 0xa005, 0x0040, 0x30ac, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0x7083, 0x001c, 0x1078, 0x30ad, 0x007c, 0x707b, 0x0000, 0x608b,
+ 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011,
+ 0x318e, 0x1078, 0x40c4, 0x007c, 0x087e, 0x097e, 0x2029, 0x6d52,
+ 0x252c, 0x20a9, 0x0008, 0x2041, 0x720e, 0x28a0, 0x2099, 0x728e,
+ 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x30d2,
+ 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0,
+ 0x30e4, 0xd5d4, 0x0040, 0x30df, 0x8210, 0x0078, 0x30e0, 0x8211,
+ 0x00f0, 0x30d2, 0x0078, 0x3149, 0x82ff, 0x00c0, 0x30f6, 0xd5d4,
+ 0x0040, 0x30f0, 0xa1a6, 0x3fff, 0x0040, 0x30dc, 0x0078, 0x30f4,
+ 0xa1a6, 0x3fff, 0x0040, 0x3149, 0xa18d, 0xc000, 0x20a9, 0x0010,
+ 0x2019, 0x0001, 0xd5d4, 0x0040, 0x30ff, 0x2019, 0x0010, 0x2120,
+ 0xd5d4, 0x0040, 0x3106, 0x8423, 0x0078, 0x3107, 0x8424, 0x00c8,
+ 0x3114, 0xd5d4, 0x0040, 0x310f, 0x8319, 0x0078, 0x3110, 0x8318,
+ 0x00f0, 0x3100, 0x0078, 0x3149, 0x23a8, 0x2021, 0x0001, 0x8426,
+ 0x8425, 0x00f0, 0x3118, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040,
+ 0x312c, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8,
+ 0xa5a8, 0x0010, 0x00f0, 0x3128, 0x754e, 0xa5c8, 0x2091, 0x292c,
+ 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304,
+ 0xa405, 0x201a, 0x706f, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
+ 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078,
+ 0x314f, 0xa006, 0x0078, 0x314f, 0xa006, 0x1078, 0x12b7, 0x097f,
+ 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a,
+ 0x0010, 0x0048, 0x315f, 0x8420, 0x8001, 0x0078, 0x3157, 0x2118,
+ 0x84ff, 0x0040, 0x3168, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3163,
+ 0x2021, 0x0001, 0x83ff, 0x0040, 0x3171, 0x8423, 0x8319, 0x00c0,
+ 0x316d, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x3186, 0xa405, 0x203a,
+ 0x714e, 0xa1a0, 0x2091, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
+ 0x0000, 0x65ea, 0x706f, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e,
+ 0x2071, 0x6d00, 0x7073, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e,
+ 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x4fe5, 0x7004, 0xa084,
+ 0x4000, 0x0040, 0x319f, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x6d00, 0x7003, 0x0001, 0x2071, 0x6d20,
+ 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f,
+ 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x6f1a, 0x2013,
+ 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056,
+ 0x60a7, 0x9575, 0x1078, 0x4fdc, 0x2009, 0x07d0, 0x2011, 0x318e,
+ 0x1078, 0x415f, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x2009, 0x00f7, 0x1078, 0x3233, 0x2061, 0x6f23, 0x601b,
+ 0x0000, 0x601f, 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061,
+ 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011,
+ 0x31f0, 0x1078, 0x40c4, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c,
+ 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078,
+ 0x4fe5, 0x2071, 0x0140, 0xa084, 0x4000, 0x0040, 0x3203, 0x7003,
+ 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x1078,
+ 0x31cb, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1,
+ 0x73c0, 0x2099, 0x728e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0,
+ 0x00f0, 0x3213, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+ 0x7200, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9,
+ 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f,
+ 0x2001, 0x6d2c, 0x2004, 0xa005, 0x00c0, 0x3244, 0x6030, 0xa084,
+ 0x00ff, 0xa105, 0x0078, 0x3246, 0xa185, 0x00f7, 0x604a, 0x007f,
+ 0x0c7f, 0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009, 0x6e00, 0xa006,
+ 0x200a, 0x8108, 0x00f0, 0x3250, 0x157f, 0x007c, 0x0d7e, 0x037e,
+ 0x157e, 0x137e, 0x147e, 0x2069, 0x6d51, 0xa006, 0x6002, 0x6007,
+ 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2091, 0x231c, 0xa39c,
+ 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4,
+ 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042,
+ 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a,
+ 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a,
+ 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a, 0x6810,
+ 0x603a, 0x680c, 0x6046, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682,
+ 0x0010, 0x00c8, 0x3337, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
+ 0x00c8, 0x333d, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3316,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x331c, 0x6078,
+ 0xa00d, 0x0040, 0x32c1, 0xa680, 0x6c84, 0x2004, 0xa10c, 0x00c0,
+ 0x3310, 0x607c, 0xa00d, 0x0040, 0x32dd, 0xa680, 0x6c84, 0x2004,
+ 0xa10c, 0x0040, 0x32dd, 0x694c, 0xd1fc, 0x00c0, 0x32d3, 0x1078,
+ 0x33d0, 0x0078, 0x330b, 0x1078, 0x33a1, 0x694c, 0xd1ec, 0x00c0,
+ 0x330b, 0x1078, 0x34f0, 0x0078, 0x330b, 0x694c, 0xa184, 0xa000,
+ 0x0040, 0x32fb, 0xd1ec, 0x0040, 0x32f4, 0xd1fc, 0x0040, 0x32ec,
+ 0x1078, 0x3507, 0x0078, 0x32f7, 0xa680, 0x6c84, 0x200c, 0x607c,
+ 0xa105, 0x607e, 0x0078, 0x32fb, 0xd1fc, 0x0040, 0x32fb, 0x1078,
+ 0x33a1, 0x0078, 0x330b, 0x6050, 0xa00d, 0x0040, 0x3306, 0x2d00,
+ 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x330b, 0x2d00, 0x6052,
+ 0x604e, 0x6803, 0x0000, 0x1078, 0x4346, 0xa006, 0x127f, 0x007c,
+ 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x3341, 0xa082, 0x0006, 0x0048, 0x32b7,
+ 0x2009, 0x6d0c, 0x210c, 0xd18c, 0x0040, 0x332a, 0x2001, 0x0004,
+ 0x0078, 0x3333, 0xd184, 0x0040, 0x3331, 0x2001, 0x0004, 0x0078,
+ 0x3333, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001,
+ 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0029, 0x2009,
+ 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682,
+ 0x0010, 0x00c8, 0x3386, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
+ 0x00c8, 0x3376, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3376,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x337c, 0x684c,
+ 0xd0ec, 0x0040, 0x3369, 0x1078, 0x3507, 0x1078, 0x33a1, 0x0078,
+ 0x3371, 0x1078, 0x33a1, 0x684c, 0xd0fc, 0x0040, 0x3371, 0x1078,
+ 0x34f0, 0x1078, 0x351b, 0xa006, 0x0078, 0x338a, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x338a, 0xa082, 0x0006, 0x0048, 0x335f,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x338a, 0x2001, 0x0029,
+ 0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050,
+ 0xa00d, 0x0040, 0x339a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+ 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078,
+ 0x3398, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x33ad,
+ 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
+ 0x6803, 0x0000, 0x0078, 0x33ab, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa06d, 0x0040, 0x33c2, 0x6800, 0xa005, 0x00c0, 0x33c0, 0x6052,
+ 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x33cf,
+ 0x6800, 0xa005, 0x00c0, 0x33cd, 0x6052, 0x604e, 0xad05, 0x007c,
+ 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x33da, 0x2d00, 0x200a,
+ 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x33d9, 0x127e,
+ 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005,
+ 0x0040, 0x33ed, 0xc285, 0x0078, 0x33ee, 0xc284, 0x6202, 0x027f,
+ 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218,
+ 0x2260, 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f,
+ 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204,
+ 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
+ 0x027e, 0xa182, 0x00ff, 0x0048, 0x3419, 0xa085, 0x0001, 0x0078,
+ 0x342d, 0xa190, 0x6e00, 0x2204, 0xa065, 0x00c0, 0x342c, 0x017e,
+ 0x0d7e, 0x1078, 0x12f4, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x3415,
+ 0x2c00, 0x2012, 0x1078, 0x3256, 0xa006, 0x027f, 0x007c, 0x027e,
+ 0xa182, 0x00ff, 0x0048, 0x3438, 0xa085, 0x0001, 0x0078, 0x3445,
+ 0x0d7e, 0xa190, 0x6e00, 0x2204, 0xa06d, 0x0040, 0x3443, 0x2013,
+ 0x0000, 0x1078, 0x1328, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
+ 0xa182, 0x00ff, 0x0048, 0x3450, 0xa085, 0x0001, 0x0078, 0x3457,
+ 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x344c, 0xa006, 0x017f,
+ 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f,
+ 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x728e, 0x6808, 0x605e,
+ 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x346f, 0x603a, 0x6814,
+ 0x6066, 0x2099, 0x7296, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2099, 0x729a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2069, 0x72ae, 0x6904, 0xa18c, 0x00ff, 0x810f, 0x6808,
+ 0xa084, 0x00ff, 0xa105, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072,
+ 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x349a, 0x2009, 0x0008,
+ 0x0078, 0x34c4, 0xa182, 0x0259, 0x00c8, 0x34a2, 0x2009, 0x0007,
+ 0x0078, 0x34c4, 0xa182, 0x02c1, 0x00c8, 0x34aa, 0x2009, 0x0006,
+ 0x0078, 0x34c4, 0xa182, 0x0349, 0x00c8, 0x34b2, 0x2009, 0x0005,
+ 0x0078, 0x34c4, 0xa182, 0x0421, 0x00c8, 0x34ba, 0x2009, 0x0004,
+ 0x0078, 0x34c4, 0xa182, 0x0581, 0x00c8, 0x34c2, 0x2009, 0x0003,
+ 0x0078, 0x34c4, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f,
+ 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x728d, 0x2e04, 0x6896, 0x2071,
+ 0x728e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001,
+ 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d,
+ 0x617a, 0x127f, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002,
+ 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c,
+ 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000,
+ 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3500, 0x1078, 0x338c,
+ 0x1078, 0x3561, 0x00c0, 0x34fe, 0x1078, 0x351b, 0x007c, 0x2001,
+ 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d,
+ 0x617e, 0x127f, 0x0078, 0x3516, 0x1078, 0x33d0, 0x1078, 0x3525,
+ 0x00c0, 0x3514, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4346,
+ 0x127f, 0x007c, 0xa01e, 0x0078, 0x3527, 0x2019, 0x0001, 0xa00e,
+ 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0,
+ 0x3547, 0x8dff, 0x0040, 0x355c, 0x83ff, 0x0040, 0x353f, 0x6844,
+ 0xa084, 0x00ff, 0xa606, 0x0040, 0x354c, 0x0078, 0x3547, 0x683c,
+ 0xa406, 0x00c0, 0x3547, 0x6840, 0xa506, 0x0040, 0x354c, 0x2d08,
+ 0x6800, 0x2068, 0x0078, 0x3531, 0x6a00, 0x604c, 0xad06, 0x00c0,
+ 0x3554, 0x624e, 0x0078, 0x3557, 0xa180, 0x0000, 0x2202, 0x82ff,
+ 0x00c0, 0x355c, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078,
+ 0x3563, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040,
+ 0x3591, 0x83ff, 0x0040, 0x3574, 0x6844, 0xa084, 0x00ff, 0xa606,
+ 0x0040, 0x3581, 0x0078, 0x357c, 0x683c, 0xa406, 0x00c0, 0x357c,
+ 0x6840, 0xa506, 0x0040, 0x3581, 0x2d08, 0x6800, 0x2068, 0x0078,
+ 0x3566, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3589, 0x6282, 0x0078,
+ 0x358c, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3591, 0x6186,
+ 0x8dff, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x6178, 0xa10c,
+ 0x0040, 0x359c, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040, 0x35a2,
+ 0xa295, 0x0002, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35ab, 0x1078,
+ 0x61f8, 0x0078, 0x35ad, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec,
+ 0x0040, 0x35b6, 0x1078, 0x6187, 0x0078, 0x35b8, 0xa085, 0x0001,
+ 0x007c, 0x1078, 0x35ec, 0x0040, 0x35c1, 0x1078, 0x61cd, 0x0078,
+ 0x35c3, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35cc,
+ 0x1078, 0x61a3, 0x0078, 0x35ce, 0xa085, 0x0001, 0x007c, 0x127e,
+ 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040, 0x35e4,
+ 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x36a1, 0x007f, 0x0078, 0x35d5, 0x6083, 0x0000, 0x6087, 0x0000,
+ 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e,
+ 0x2079, 0x6d51, 0x7804, 0xd0a4, 0x0040, 0x3618, 0x157e, 0x0c7e,
+ 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0,
+ 0x360c, 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0,
+ 0x360c, 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x35fc,
+ 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011, 0x361a, 0x1078, 0x415f,
+ 0x0f7f, 0x007c, 0x2011, 0x361a, 0x1078, 0x40d1, 0x157e, 0x0c7e,
+ 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0,
+ 0x3646, 0x6000, 0xd0ec, 0x0040, 0x3646, 0x047e, 0x62a0, 0xa294,
+ 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6000,
+ 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078,
+ 0x43a9, 0x2009, 0x0000, 0x1078, 0x6a57, 0x047f, 0x017f, 0x8108,
+ 0x00f0, 0x3624, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060,
+ 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x6ddf, 0x7003,
+ 0x0001, 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b,
+ 0x0000, 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b,
+ 0x0020, 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071,
+ 0x6ddf, 0x684c, 0xa005, 0x00c0, 0x367c, 0x7028, 0xc085, 0x702a,
+ 0xa085, 0x0001, 0x0078, 0x369f, 0x6a60, 0x7236, 0x6b64, 0x733a,
+ 0x6868, 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e,
+ 0x6844, 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006,
+ 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e,
+ 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f,
+ 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x36f2, 0x6804, 0xa00d,
+ 0x0040, 0x36c0, 0x0d7e, 0x0e7e, 0x2071, 0x6d00, 0x027e, 0xa016,
+ 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0,
+ 0x36b1, 0x702e, 0x70a0, 0xa200, 0x70a2, 0x027f, 0x0e7f, 0x0d7f,
+ 0x2071, 0x6ddf, 0x701c, 0xa005, 0x00c0, 0x3703, 0x0068, 0x3701,
+ 0x2071, 0x6d51, 0x7004, 0xd09c, 0x0040, 0x3701, 0x6934, 0xa186,
+ 0x0103, 0x00c0, 0x3714, 0x6948, 0x6844, 0xa105, 0x00c0, 0x36f4,
+ 0x2009, 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3701,
+ 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091,
+ 0x4080, 0x2071, 0x6d00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a0,
+ 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0,
+ 0x3701, 0x6868, 0xa005, 0x00c0, 0x3701, 0x2009, 0x8020, 0x0078,
+ 0x36da, 0x2071, 0x6ddf, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000,
+ 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040, 0x3711, 0x6902, 0x0078,
+ 0x3712, 0x711e, 0x0078, 0x36f2, 0xa18c, 0x00ff, 0xa18e, 0x0017,
+ 0x0040, 0x371e, 0xa18e, 0x001f, 0x00c0, 0x3701, 0x684c, 0xd0cc,
+ 0x0040, 0x3701, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
+ 0x3701, 0x2009, 0x8021, 0x0078, 0x36da, 0x007e, 0x6837, 0x0103,
+ 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4,
+ 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0x6ddf, 0x7004, 0x0079,
+ 0x3741, 0x3749, 0x3758, 0x37e4, 0x37e5, 0x37f5, 0x37fb, 0x374a,
+ 0x37d2, 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3757, 0x2009,
+ 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f,
+ 0x701c, 0xa06d, 0x0040, 0x37d1, 0x0e7e, 0x2071, 0x6d51, 0x7004,
+ 0xd09c, 0x0040, 0x37b3, 0x6934, 0xa186, 0x0103, 0x00c0, 0x378d,
+ 0x6948, 0x6844, 0xa105, 0x00c0, 0x37a6, 0x2009, 0x8020, 0x127e,
+ 0x2091, 0x8000, 0x0068, 0x3789, 0x2071, 0x0000, 0x7018, 0xd084,
+ 0x00c0, 0x3789, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b,
+ 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x382e, 0x0078,
+ 0x37d1, 0x127f, 0x0e7f, 0x0078, 0x37d1, 0xa18c, 0x00ff, 0xa18e,
+ 0x0017, 0x0040, 0x3797, 0xa18e, 0x001f, 0x00c0, 0x37b3, 0x684c,
+ 0xd0cc, 0x0040, 0x37b3, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001,
+ 0x00c0, 0x37b3, 0x2009, 0x8021, 0x0078, 0x376f, 0x6844, 0xa086,
+ 0x0100, 0x00c0, 0x37b3, 0x6868, 0xa005, 0x00c0, 0x37b3, 0x2009,
+ 0x8020, 0x0078, 0x376f, 0x0e7f, 0x1078, 0x3842, 0x0040, 0x37d1,
+ 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0,
+ 0x37c8, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x37c8, 0x710e,
+ 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086, 0x0100, 0x0040,
+ 0x37e5, 0x007c, 0x701c, 0xa06d, 0x0040, 0x37e3, 0x1078, 0x3842,
+ 0x0040, 0x37e3, 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086,
+ 0x0100, 0x0040, 0x37e5, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100,
+ 0x00c0, 0x37ee, 0x7007, 0x0004, 0x0078, 0x37f5, 0xa086, 0x0200,
+ 0x00c0, 0x37f4, 0x7007, 0x0005, 0x007c, 0x1078, 0x37fc, 0x7006,
+ 0x1078, 0x382e, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102,
+ 0x0048, 0x3809, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078,
+ 0x3813, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x3813, 0x7070,
+ 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0,
+ 0x3827, 0x127e, 0x2091, 0x8000, 0x0068, 0x382a, 0x2001, 0x000d,
+ 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001,
+ 0x0007, 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d,
+ 0x0040, 0x3841, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012,
+ 0x2d04, 0x701e, 0xa005, 0x00c0, 0x383e, 0x701a, 0x127f, 0x1078,
+ 0x1328, 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x3851, 0x2304, 0x230c, 0xa10e, 0x0040, 0x3851, 0xa006, 0x0078,
+ 0x3861, 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x385b, 0x2300,
+ 0xa005, 0x0078, 0x3861, 0x0048, 0x3860, 0xa302, 0x0078, 0x3861,
+ 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053,
+ 0x0000, 0x127e, 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc08d,
+ 0x200a, 0x127f, 0x1078, 0x1379, 0x007c, 0x2071, 0x6dad, 0x7003,
+ 0x0000, 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f,
+ 0x0000, 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083,
+ 0x0000, 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dad, 0x6848, 0xa005, 0x00c0, 0x389e, 0x7028,
+ 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x38c3, 0x6a50, 0x7236,
+ 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e,
+ 0x6848, 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007,
+ 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100,
+ 0xa319, 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001,
+ 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x6dad,
+ 0x7004, 0x1079, 0x3923, 0x700c, 0x0079, 0x38ce, 0x38d3, 0x38c8,
+ 0x38c8, 0x38c8, 0x38c8, 0x007c, 0x700c, 0x0079, 0x38d7, 0x38dc,
+ 0x3921, 0x3921, 0x3922, 0x3922, 0x7830, 0x7930, 0xa106, 0x0040,
+ 0x38e6, 0x7830, 0x7930, 0xa106, 0x00c0, 0x390c, 0x7030, 0xa10a,
+ 0x0040, 0x390c, 0x00c8, 0x38ee, 0x712c, 0xa10a, 0xa18a, 0x0002,
+ 0x00c8, 0x390d, 0x1078, 0x12f4, 0x0040, 0x390c, 0x2d00, 0x705a,
+ 0x7063, 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e,
+ 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc085, 0x200a, 0x007f,
+ 0x700e, 0x127f, 0x1078, 0x1379, 0x007c, 0x1078, 0x12f4, 0x0040,
+ 0x390c, 0x2d00, 0x705a, 0x1078, 0x12f4, 0x00c0, 0x3919, 0x0078,
+ 0x38f8, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078,
+ 0x38fc, 0x007c, 0x007c, 0x3934, 0x3935, 0x396c, 0x396d, 0x3921,
+ 0x39a3, 0x39a8, 0x39df, 0x39e0, 0x39fb, 0x39fc, 0x39fd, 0x39fe,
+ 0x39ff, 0x3a00, 0x3a69, 0x3a93, 0x007c, 0x700c, 0x0079, 0x3938,
+ 0x393d, 0x3940, 0x3950, 0x396b, 0x396b, 0x1078, 0x38d4, 0x007c,
+ 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3d52, 0x0040,
+ 0x394d, 0x2091, 0x8000, 0x1078, 0x38d4, 0x0d7f, 0x0078, 0x3959,
+ 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52, 0x7058, 0x2068, 0x7084,
+ 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff,
+ 0xa08a, 0x0020, 0x00c8, 0x3968, 0x1079, 0x3983, 0x127f, 0x007c,
+ 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071,
+ 0x6dad, 0x700c, 0x0079, 0x3974, 0x3979, 0x3979, 0x3979, 0x397b,
+ 0x397f, 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3981, 0x700f,
+ 0x0002, 0x0e7f, 0x007c, 0x3a01, 0x3a01, 0x3a1d, 0x3a01, 0x3aff,
+ 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a1d, 0x3b44, 0x3b8d,
+ 0x3be5, 0x3bf8, 0x3a01, 0x3a01, 0x3a39, 0x3a1d, 0x3a01, 0x3a01,
+ 0x3a4f, 0x3c74, 0x3c91, 0x3a01, 0x3a39, 0x3a01, 0x3a01, 0x3a01,
+ 0x3a01, 0x3a01, 0x3c91, 0x7020, 0x2068, 0x1078, 0x1328, 0x007c,
+ 0x700c, 0x0079, 0x39ab, 0x39b0, 0x39b3, 0x39c3, 0x39de, 0x39de,
+ 0x1078, 0x38d4, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3d52, 0x0040, 0x39c0, 0x2091, 0x8000, 0x1078, 0x38d4,
+ 0x0d7f, 0x0078, 0x39cc, 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52,
+ 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x39db, 0x1079,
+ 0x39e1, 0x127f, 0x007c, 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c,
+ 0x007c, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a1d, 0x3a01, 0x3a1d,
+ 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a1d, 0x3a1d, 0x3a1d, 0x3a1d,
+ 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a01, 0x3a1d, 0x3a01,
+ 0x3a01, 0x3a01, 0x3a1d, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
+ 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007,
+ 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838,
+ 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff,
+ 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f,
+ 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3a0f, 0x8001,
+ 0x00c0, 0x3a46, 0x7007, 0x0001, 0x0078, 0x3ac8, 0x7007, 0x0006,
+ 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3ac8, 0x007c, 0x2d00,
+ 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1,
+ 0x6dd8, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3a2b,
+ 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3a2b, 0xa080, 0x3ab9, 0x2004,
+ 0x70c6, 0x7010, 0xa015, 0x0040, 0x3ab3, 0x1078, 0x12f4, 0x00c0,
+ 0x3a74, 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060,
+ 0x6000, 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8,
+ 0x3a83, 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296,
+ 0x0004, 0x0040, 0x3a8c, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90,
+ 0x0022, 0x1078, 0x135f, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3aa7,
+ 0xa086, 0x0200, 0x0040, 0x3a9f, 0x7007, 0x0010, 0x007c, 0x7020,
+ 0x2068, 0x1078, 0x1328, 0x7014, 0x2068, 0x0078, 0x3a2b, 0x7020,
+ 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906,
+ 0x711a, 0x0078, 0x3a69, 0x7014, 0x2068, 0x7007, 0x0001, 0x0078,
+ 0x3ac8, 0x3abc, 0x3ac0, 0x3ac4, 0x0002, 0x0011, 0x0007, 0x0004,
+ 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006,
+ 0x2009, 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3ae3, 0x6838, 0xa084,
+ 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3299, 0x00c0, 0x3ad9,
+ 0x007c, 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1,
+ 0x127f, 0x0078, 0x3ad8, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
+ 0x3ad9, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
+ 0x8001, 0x7012, 0x0040, 0x3af8, 0x7007, 0x0006, 0x0078, 0x3afe,
0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, 0x7007,
0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff,
- 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3bba, 0x2009, 0x0000,
- 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3bba, 0xa005, 0x00c0,
- 0x3bd1, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34cb, 0x00c0,
- 0x3bd1, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, 0x3560, 0x067f,
- 0x0078, 0x3bd1, 0x047e, 0x2011, 0x6f0c, 0x2224, 0xc484, 0xc48c,
- 0x2412, 0x047f, 0x0c7e, 0x1078, 0x34cb, 0x00c0, 0x3bcd, 0x2091,
- 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, 0x00f0, 0x3bc3,
- 0x0c7f, 0x1078, 0x12fb, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007,
- 0x0001, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3c14, 0x6944,
- 0x1078, 0x3e15, 0x6100, 0xd184, 0x0040, 0x3bf9, 0x6858, 0xa084,
- 0x00ff, 0x00c0, 0x3c17, 0x6000, 0xd084, 0x0040, 0x3c14, 0x6004,
- 0xa005, 0x00c0, 0x3c1a, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078,
- 0x3c11, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x3c01, 0x2001,
- 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x3c14,
- 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3c14, 0x600a,
- 0x6202, 0x127f, 0x0078, 0x3de8, 0x127f, 0x0078, 0x3de0, 0x127f,
- 0x0078, 0x3dd8, 0x127f, 0x0078, 0x3ddc, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3c72,
- 0x6944, 0x1078, 0x3e15, 0x6000, 0xa084, 0x0001, 0x0040, 0x3c72,
- 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x3c4a, 0x6958,
- 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3c43, 0x2100, 0xa210, 0x0048,
- 0x3c6f, 0x0078, 0x3c4a, 0x8001, 0x00c0, 0x3c6f, 0x2100, 0xa212,
- 0x0048, 0x3c6f, 0xa484, 0x000c, 0x0040, 0x3c64, 0x6958, 0x810f,
- 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3c5c, 0x2100, 0xa318,
- 0x0048, 0x3c6f, 0x0078, 0x3c64, 0xa082, 0x0004, 0x00c0, 0x3c6f,
- 0x2100, 0xa31a, 0x0048, 0x3c6f, 0x6860, 0xa005, 0x0040, 0x3c6a,
- 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x3de8, 0x127f,
- 0x0078, 0x3de4, 0x127f, 0x0078, 0x3de0, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x6944, 0x1078, 0x3e15, 0x6308, 0x8318, 0x0048,
- 0x3c85, 0x630a, 0x127f, 0x0078, 0x3df6, 0x127f, 0x0078, 0x3de4,
+ 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3b2a, 0x2009, 0x0000,
+ 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3b2a, 0xa005, 0x00c0,
+ 0x3b41, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x3447, 0x00c0,
+ 0x3b41, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, 0x34e3, 0x067f,
+ 0x0078, 0x3b41, 0x047e, 0x2011, 0x6d0c, 0x2224, 0xc484, 0xc48c,
+ 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x3b3d, 0x2091,
+ 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, 0x00f0, 0x3b33,
+ 0x0c7f, 0x1078, 0x1328, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007,
+ 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3b84, 0x6944,
+ 0x1078, 0x3d6e, 0x6100, 0xd184, 0x0040, 0x3b69, 0x6858, 0xa084,
+ 0x00ff, 0x00c0, 0x3b87, 0x6000, 0xd084, 0x0040, 0x3b84, 0x6004,
+ 0xa005, 0x00c0, 0x3b8a, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078,
+ 0x3b81, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x3b71, 0x2001,
+ 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x3b84,
+ 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3b84, 0x600a,
+ 0x6202, 0x127f, 0x0078, 0x3d41, 0x127f, 0x0078, 0x3d39, 0x127f,
+ 0x0078, 0x3d31, 0x127f, 0x0078, 0x3d35, 0x127e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3be2,
+ 0x6944, 0x1078, 0x3d6e, 0x6000, 0xa084, 0x0001, 0x0040, 0x3be2,
+ 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x3bba, 0x6958,
+ 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3bb3, 0x2100, 0xa210, 0x0048,
+ 0x3bdf, 0x0078, 0x3bba, 0x8001, 0x00c0, 0x3bdf, 0x2100, 0xa212,
+ 0x0048, 0x3bdf, 0xa484, 0x000c, 0x0040, 0x3bd4, 0x6958, 0x810f,
+ 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3bcc, 0x2100, 0xa318,
+ 0x0048, 0x3bdf, 0x0078, 0x3bd4, 0xa082, 0x0004, 0x00c0, 0x3bdf,
+ 0x2100, 0xa31a, 0x0048, 0x3bdf, 0x6860, 0xa005, 0x0040, 0x3bda,
+ 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x3d41, 0x127f,
+ 0x0078, 0x3d3d, 0x127f, 0x0078, 0x3d39, 0x127e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x6944, 0x1078, 0x3d6e, 0x6308, 0x8318, 0x0048,
+ 0x3bf5, 0x630a, 0x127f, 0x0078, 0x3d4f, 0x127f, 0x0078, 0x3d3d,
0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac,
- 0x0040, 0x3c9c, 0x027e, 0x2009, 0x0000, 0x2011, 0xfcff, 0x1078,
- 0x42cd, 0x027f, 0x0078, 0x3cd2, 0x6858, 0xa005, 0x0040, 0x3ce6,
- 0x685c, 0xa065, 0x0040, 0x3ce2, 0x2001, 0x6f2a, 0x2004, 0xa005,
- 0x0040, 0x3cae, 0x1078, 0x6337, 0x0078, 0x3cb4, 0x6013, 0x0400,
- 0x2009, 0x0041, 0x1078, 0x55fc, 0x6958, 0xa18c, 0xe600, 0xa186,
- 0x2000, 0x0040, 0x3cca, 0xa186, 0x0400, 0x0040, 0x3cca, 0x6944,
- 0x0c7e, 0x1078, 0x4225, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
- 0x0078, 0x3cd2, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
- 0x42cd, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3cde, 0x6944, 0x1078,
- 0x4225, 0x6008, 0x8000, 0x0048, 0x3cde, 0x600a, 0x0c7f, 0x127f,
- 0x0078, 0x3de8, 0x0c7f, 0x127f, 0x0078, 0x3de0, 0x6954, 0xa186,
- 0x002a, 0x00c0, 0x3cf2, 0x2001, 0x6f0c, 0x200c, 0xc194, 0x2102,
- 0x0078, 0x3cd2, 0xa186, 0x0020, 0x0040, 0x3d07, 0xa186, 0x0029,
- 0x00c0, 0x3ce2, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34cb,
- 0x00c0, 0x3cd2, 0x6000, 0xc0e4, 0x6002, 0x0078, 0x3cd2, 0x685c,
- 0xa065, 0x0040, 0x3ce2, 0x6017, 0x0014, 0x0078, 0x3cd2, 0x6944,
- 0x1078, 0x3e15, 0x6000, 0xa084, 0x0001, 0x0040, 0x3d28, 0x2091,
- 0x8000, 0x6204, 0x8210, 0x0048, 0x3d22, 0x6206, 0x2091, 0x8001,
- 0x0078, 0x3df6, 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x3def,
- 0x6853, 0x0007, 0x0078, 0x3def, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x00c0, 0x3d36, 0x1078, 0x3a96, 0x0078, 0x3d48, 0x2030, 0x8001,
- 0x00c0, 0x3d40, 0x7007, 0x0001, 0x1078, 0x3d49, 0x0078, 0x3d48,
- 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3d49,
- 0x007c, 0x0e7e, 0x2009, 0x6f2a, 0x210c, 0x81ff, 0x00c0, 0x3dca,
- 0x2009, 0x6f0c, 0x210c, 0xd194, 0x00c0, 0x3dd4, 0x6848, 0x2070,
- 0xae82, 0x7500, 0x0048, 0x3db9, 0x2001, 0x6f15, 0x2004, 0xae02,
- 0x00c8, 0x3db9, 0x6944, 0x1078, 0x3e15, 0x6100, 0xa184, 0x0001,
- 0x0040, 0x3d9f, 0xa184, 0x0100, 0x00c0, 0x3dbd, 0xa184, 0x0200,
- 0x00c0, 0x3dc1, 0x601c, 0xa005, 0x00c0, 0x3dc5, 0x711c, 0xa186,
- 0x0006, 0x00c0, 0x3da4, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08,
- 0x127e, 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x3d96, 0x7112,
- 0x7018, 0xa065, 0x0040, 0x3dc9, 0x6000, 0xd0e4, 0x00c0, 0x3dce,
- 0x2e60, 0x1078, 0x422e, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800,
- 0xa005, 0x00c0, 0x3d96, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f,
- 0x6853, 0x0006, 0x0078, 0x3def, 0x6944, 0xa18c, 0xff00, 0x810f,
- 0x1078, 0x34cb, 0x00c0, 0x3dcf, 0x6000, 0xd0e4, 0x00c0, 0x3dcf,
- 0x711c, 0xa186, 0x0007, 0x00c0, 0x3db9, 0x6853, 0x0002, 0x0078,
- 0x3dd1, 0x6853, 0x0008, 0x0078, 0x3dd1, 0x6853, 0x000e, 0x0078,
- 0x3dd1, 0x6853, 0x0017, 0x0078, 0x3dd1, 0x6853, 0x0035, 0x0078,
- 0x3dd1, 0x127f, 0x6853, 0x0028, 0x0078, 0x3dd1, 0x127f, 0x6853,
- 0x0029, 0x0e7f, 0x0078, 0x3def, 0x6853, 0x002a, 0x0078, 0x3dd1,
- 0x2009, 0x003e, 0x0078, 0x3dea, 0x2009, 0x0004, 0x0078, 0x3dea,
- 0x2009, 0x0006, 0x0078, 0x3dea, 0x2009, 0x0016, 0x0078, 0x3dea,
- 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091,
- 0x8000, 0x1078, 0x3720, 0x2091, 0x8001, 0x007c, 0x1078, 0x12fb,
- 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x3e06, 0xa00e,
- 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3e12, 0x7070, 0xa080,
- 0x0040, 0x7072, 0x00c8, 0x3e12, 0x7074, 0xa081, 0x0000, 0x7076,
- 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x4225,
- 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002,
- 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000,
- 0x3d00, 0xa084, 0x7000, 0x0040, 0x3e31, 0xa086, 0x1000, 0x00c0,
- 0x3e4d, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x3e38, 0x3e60,
- 0xac84, 0x0007, 0x00c0, 0x3e4d, 0xac82, 0x7500, 0x0048, 0x3e4d,
- 0x6854, 0xac02, 0x00c8, 0x3e4d, 0x2009, 0x0047, 0x1078, 0x55fc,
- 0x7a1c, 0xd284, 0x00c0, 0x3e23, 0x007c, 0xa016, 0x1078, 0x1525,
- 0x0078, 0x3e48, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20,
- 0x3e28, 0xa584, 0x0070, 0x00c0, 0x3e7b, 0xa484, 0x7000, 0xa086,
- 0x1000, 0x00c0, 0x3e7b, 0x1078, 0x3e88, 0x0040, 0x3e7b, 0x20e1,
- 0x3000, 0x7828, 0x7828, 0x1078, 0x3ea6, 0x147f, 0x137f, 0x157f,
- 0x2009, 0x70be, 0x2104, 0xa005, 0x00c0, 0x3e77, 0x007c, 0x1078,
- 0x4893, 0x0078, 0x3e76, 0x1078, 0x6df7, 0x1078, 0x3e88, 0x20e1,
- 0x3000, 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3e76,
- 0xa484, 0x01ff, 0x6872, 0xa005, 0x0040, 0x3e9a, 0xa080, 0x001f,
- 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
- 0x53a5, 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099,
- 0x020a, 0x53a5, 0xa085, 0x0001, 0x0078, 0x3e99, 0x7000, 0xa084,
- 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3eb3,
- 0x0078, 0x3f9f, 0x007c, 0xa196, 0x2000, 0x00c0, 0x3ec4, 0x6900,
- 0xa18e, 0x0001, 0x00c0, 0x3ec0, 0x1078, 0x2b5e, 0x0078, 0x3eb2,
- 0x1078, 0x3ecc, 0x0078, 0x3eb2, 0xa196, 0x8000, 0x00c0, 0x3eb2,
- 0x1078, 0x4025, 0x0078, 0x3eb2, 0x0c7e, 0x7110, 0xa18c, 0xff00,
- 0x810f, 0xa196, 0x0001, 0x0040, 0x3ed9, 0xa196, 0x0023, 0x00c0,
- 0x3f97, 0xa08e, 0x0023, 0x00c0, 0x3f0a, 0x1078, 0x4097, 0x0040,
- 0x3f97, 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3ef2,
- 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0015, 0x1078, 0x55fc,
- 0x0078, 0x3f97, 0xa08e, 0x0210, 0x00c0, 0x3efc, 0x2009, 0x0015,
- 0x1078, 0x55fc, 0x0078, 0x3f97, 0xa08e, 0x0100, 0x00c0, 0x3f97,
- 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0016, 0x1078, 0x55fc,
- 0x0078, 0x3f97, 0xa08e, 0x0022, 0x00c0, 0x3f97, 0x7030, 0xa08e,
- 0x0300, 0x00c0, 0x3f1b, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x0017, 0x0078, 0x3f7f, 0xa08e, 0x0500, 0x00c0, 0x3f27, 0x7034,
- 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0018, 0x0078, 0x3f7f, 0xa08e,
- 0x2010, 0x00c0, 0x3f2f, 0x2009, 0x0019, 0x0078, 0x3f7f, 0xa08e,
- 0x2110, 0x00c0, 0x3f37, 0x2009, 0x001a, 0x0078, 0x3f7f, 0xa08e,
- 0x5200, 0x00c0, 0x3f43, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x001b, 0x0078, 0x3f7f, 0xa08e, 0x5000, 0x00c0, 0x3f4f, 0x7034,
- 0xa005, 0x00c0, 0x3f97, 0x2009, 0x001c, 0x0078, 0x3f7f, 0xa08e,
- 0x1200, 0x00c0, 0x3f5b, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x0024, 0x0078, 0x3f7f, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0,
- 0x3f65, 0x2009, 0x002d, 0x0078, 0x3f7f, 0xa08c, 0xff00, 0xa18e,
- 0x5300, 0x00c0, 0x3f6f, 0x2009, 0x002a, 0x0078, 0x3f7f, 0xa08e,
- 0x0f00, 0x00c0, 0x3f77, 0x2009, 0x0020, 0x0078, 0x3f7f, 0xa08e,
- 0x5300, 0x00c0, 0x3f7d, 0x0078, 0x3f7d, 0x2009, 0x001d, 0x017e,
- 0x2011, 0x7383, 0x2204, 0x1078, 0x1fe4, 0x1078, 0x3494, 0x00c0,
- 0x3f99, 0x0c7e, 0x1078, 0x556f, 0x0040, 0x3f9c, 0x017f, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x55fc, 0x0c7f,
- 0x007c, 0x017f, 0x0078, 0x3f97, 0x0c7f, 0x0078, 0x3f99, 0xa084,
- 0x0007, 0x0079, 0x3fa4, 0x007c, 0x3fac, 0x3fac, 0x3fac, 0x3fac,
- 0x3fac, 0x3fad, 0x3fc6, 0x400e, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x3fc5, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x3fc5, 0xac8a,
- 0x7500, 0x0048, 0x3fc5, 0x6854, 0xac02, 0x00c8, 0x3fc5, 0x7124,
- 0x610a, 0x2009, 0x0046, 0x1078, 0x55fc, 0x007c, 0x0c7e, 0x7110,
- 0xd1bc, 0x00c0, 0x400c, 0x2011, 0x7383, 0x2204, 0xa080, 0x2207,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34cb, 0x00c0, 0x400c,
- 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3ff1,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x400c, 0x611a, 0x601f,
- 0x0006, 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x55fc, 0x0078,
- 0x400c, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x400c, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x4004,
- 0x6007, 0x0005, 0x0078, 0x4006, 0x6007, 0x0001, 0x6003, 0x0001,
- 0x1078, 0x448b, 0x1078, 0x4893, 0x0c7f, 0x007c, 0x7110, 0xd1bc,
- 0x0040, 0x4024, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x4024,
- 0xac82, 0x7500, 0x0048, 0x4024, 0x6854, 0xac02, 0x00c8, 0x4024,
- 0x2009, 0x0045, 0x1078, 0x55fc, 0x007c, 0x7110, 0xa18c, 0xff00,
- 0x810f, 0xa18e, 0x0000, 0x00c0, 0x4035, 0xa084, 0x000f, 0xa08a,
- 0x0006, 0x10c8, 0x1288, 0x1079, 0x4036, 0x007c, 0x403c, 0x403d,
- 0x403c, 0x403c, 0x4079, 0x4088, 0x007c, 0x7110, 0xd1bc, 0x00c0,
- 0x4078, 0x700c, 0x1078, 0x1fe4, 0x1078, 0x3494, 0x00c0, 0x4078,
- 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4061,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x4078, 0x611a, 0x601f,
- 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x55fc, 0x0078,
- 0x4078, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x4078, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x4074,
- 0x2009, 0x0005, 0x0078, 0x4076, 0x2009, 0x0001, 0x1078, 0x55fc,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4087, 0x1078, 0x4097, 0x0040,
- 0x4087, 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x55fc, 0x007c,
- 0x7110, 0xd1bc, 0x0040, 0x4096, 0x1078, 0x4097, 0x0040, 0x4096,
- 0x7124, 0x610a, 0x2009, 0x008a, 0x1078, 0x55fc, 0x007c, 0x7020,
- 0x2060, 0xac84, 0x0007, 0x00c0, 0x40aa, 0xac82, 0x7500, 0x0048,
- 0x40aa, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8, 0x40aa, 0xa085,
- 0x0001, 0x007c, 0xa006, 0x0078, 0x40a9, 0x2071, 0x70c9, 0x7003,
- 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7500,
- 0x7007, 0x0000, 0x7026, 0x702b, 0x4f9b, 0x7032, 0x7037, 0x4fdc,
- 0x703b, 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x70c9, 0x00e0,
- 0x4174, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x413d,
- 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138,
- 0x8109, 0x713a, 0x00c0, 0x413b, 0x703b, 0x0002, 0x2009, 0x0100,
- 0x2104, 0xa082, 0x0003, 0x00c8, 0x413b, 0x703c, 0xa086, 0x0001,
- 0x00c0, 0x4118, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x40f6, 0x6803, 0x1000, 0x0078, 0x40fd, 0x6804, 0xa084,
- 0x1000, 0x0040, 0x40fd, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f,
- 0x0000, 0x2069, 0x70b6, 0x6804, 0xa082, 0x0006, 0x00c0, 0x410a,
- 0x6807, 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x4111, 0x6833,
- 0x0000, 0x1078, 0x4893, 0x1078, 0x4943, 0x0d7f, 0x0078, 0x413b,
- 0x0d7e, 0x2069, 0x6f00, 0x6944, 0x6860, 0xa102, 0x00c8, 0x413a,
- 0x2069, 0x70b6, 0x6804, 0xa086, 0x0000, 0x00c0, 0x413a, 0x6830,
- 0xa086, 0x0000, 0x00c0, 0x413a, 0x703f, 0x0001, 0x6807, 0x0006,
- 0x6833, 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140,
- 0x6803, 0x0600, 0x0d7f, 0x0078, 0x4140, 0x127e, 0x2091, 0x8000,
- 0x7024, 0xa00d, 0x0040, 0x4151, 0x7020, 0x8001, 0x7022, 0x00c0,
- 0x4151, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x4151, 0x7028,
- 0x107a, 0x7030, 0xa00d, 0x0040, 0x4162, 0x702c, 0x8001, 0x702e,
- 0x00c0, 0x4162, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0, 0x4162,
- 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x4173, 0x7008, 0x8001,
- 0x700a, 0x00c0, 0x4173, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0,
- 0x4173, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4177, 0x419e,
- 0x419f, 0x41bb, 0x0e7e, 0x2071, 0x70c9, 0x7018, 0xa005, 0x00c0,
- 0x4185, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e,
- 0x007e, 0x2071, 0x70c9, 0x701c, 0xa206, 0x00c0, 0x4191, 0x701a,
- 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x6088,
- 0xa102, 0x0048, 0x419c, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110,
- 0x1078, 0x34cb, 0x00c0, 0x41b1, 0x6088, 0x8001, 0x0048, 0x41b1,
- 0x608a, 0x00c0, 0x41b1, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893,
- 0x127f, 0x8108, 0xa182, 0x007e, 0x0048, 0x41b9, 0xa00e, 0x7007,
- 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000,
- 0x6014, 0xa005, 0x0040, 0x41ea, 0x8001, 0x6016, 0x00c0, 0x41ea,
- 0x611c, 0xa186, 0x0003, 0x0040, 0x41d1, 0xa186, 0x0006, 0x00c0,
- 0x41e8, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x41e8,
- 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x41e1, 0x2001,
- 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x41ea,
- 0x1078, 0x60aa, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001, 0x6f16,
- 0x2004, 0xa102, 0x0048, 0x41f8, 0x7017, 0x7500, 0x7007, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x7027, 0x07d0, 0x7023, 0x0009,
- 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001, 0x70d2, 0x2003, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x7033, 0x07d0, 0x702f, 0x0009,
- 0x0e7f, 0x007c, 0x2011, 0x70d5, 0x2013, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x70c9, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
- 0x0c7e, 0x2061, 0x715a, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003,
- 0x8003, 0x8003, 0xa080, 0x715a, 0x2060, 0x007c, 0x6854, 0xa08a,
- 0x199a, 0x0048, 0x4235, 0x2001, 0x1999, 0xa005, 0x00c0, 0x4245,
- 0x6944, 0x0c7e, 0x1078, 0x4225, 0x6014, 0x0c7f, 0xa005, 0x00c0,
- 0x424a, 0x2001, 0x001e, 0x0078, 0x424a, 0xa08e, 0xffff, 0x00c0,
- 0x424a, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c,
- 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x4285, 0xd0b4, 0x00c0,
- 0x4261, 0xd0bc, 0x00c0, 0x4273, 0x2009, 0x0006, 0x1078, 0x42a8,
- 0x007c, 0xd0fc, 0x0040, 0x426e, 0xa084, 0x0003, 0xa08e, 0x0003,
- 0x0040, 0x42a1, 0xa08e, 0x0000, 0x00c0, 0x42a1, 0x2009, 0x0043,
- 0x1078, 0x55fc, 0x007c, 0xd0fc, 0x0040, 0x4280, 0xa084, 0x0003,
- 0xa08e, 0x0003, 0x0040, 0x42a1, 0xa08e, 0x0000, 0x00c0, 0x42a1,
- 0x2009, 0x0042, 0x1078, 0x55fc, 0x007c, 0xd0fc, 0x0040, 0x4297,
- 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x42a1, 0xa08e, 0x0002,
- 0x0040, 0x429b, 0x2009, 0x0041, 0x1078, 0x55fc, 0x007c, 0x1078,
- 0x42a6, 0x0078, 0x4296, 0x2009, 0x0043, 0x1078, 0x55fc, 0x0078,
- 0x4296, 0x2009, 0x0004, 0x1078, 0x42a8, 0x007c, 0x2009, 0x0001,
- 0x6010, 0xa0ec, 0xf000, 0x0040, 0x42cc, 0x2068, 0x6952, 0x6800,
- 0x6012, 0xa186, 0x0001, 0x00c0, 0x42c6, 0x694c, 0xa18c, 0x8100,
- 0xa18e, 0x8100, 0x00c0, 0x42c6, 0x0c7e, 0x6944, 0x1078, 0x4225,
- 0x6204, 0x8210, 0x0048, 0x42c5, 0x6206, 0x0c7f, 0x1078, 0x3720,
- 0x6010, 0xa06d, 0x10c0, 0x422e, 0x007c, 0x157e, 0x0c7e, 0x20a9,
- 0x0010, 0x2061, 0x715a, 0x6000, 0x81ff, 0x0040, 0x42da, 0xa205,
- 0x0078, 0x42db, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x42d3,
- 0x0c7f, 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x42eb, 0x8001,
- 0x680a, 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079,
- 0x70b6, 0x127f, 0x0d7e, 0x2069, 0x70b6, 0x6803, 0x0005, 0x2069,
- 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e,
- 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x4307, 0x4311,
- 0x4336, 0x4391, 0x4317, 0x4336, 0x430f, 0x430f, 0x430f, 0x1078,
- 0x1288, 0x1078, 0x4204, 0x1078, 0x4893, 0x0c7f, 0x007c, 0x62c0,
- 0x82ff, 0x00c0, 0x431d, 0x0c7f, 0x007c, 0x2011, 0x31f0, 0x1078,
- 0x4187, 0x7828, 0xa092, 0x0002, 0x00c8, 0x432c, 0x8000, 0x782a,
- 0x1078, 0x3220, 0x0078, 0x431b, 0x1078, 0x31f0, 0x7807, 0x0003,
- 0x7827, 0x0000, 0x782b, 0x0000, 0x0078, 0x431b, 0x1078, 0x4204,
- 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f,
- 0x20e0, 0x82ff, 0x0040, 0x4354, 0x62c0, 0x82ff, 0x00c0, 0x4354,
- 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1288, 0x2009, 0x0013,
- 0x1078, 0x55fc, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x71fa, 0x00c8,
- 0x435b, 0x1078, 0x54ff, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x1288,
- 0x7804, 0xa086, 0x0004, 0x0040, 0x43d6, 0x7828, 0xa092, 0x2710,
- 0x00c8, 0x4371, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x4f80, 0x0078,
- 0x4352, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4388, 0x0e7e, 0x2071,
- 0x6f00, 0x70b4, 0x0e7f, 0xd08c, 0x0040, 0x4388, 0x0c7e, 0x0e7e,
- 0x2061, 0x0100, 0x2071, 0x6f00, 0x1078, 0x3229, 0x0e7f, 0x0c7f,
- 0x1078, 0x6e4a, 0x2009, 0x0014, 0x1078, 0x55fc, 0x0c7f, 0x0078,
- 0x4352, 0x2001, 0x70d2, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0,
- 0x43a5, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1288, 0x2009,
- 0x0013, 0x1078, 0x5649, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900,
- 0xa082, 0x71fa, 0x00c8, 0x43ae, 0x1078, 0x54ff, 0x7824, 0xa005,
- 0x1040, 0x1288, 0x781c, 0xa06d, 0x1040, 0x1288, 0x6800, 0xc0dc,
- 0x6802, 0x7924, 0x2160, 0x1078, 0x55d5, 0x693c, 0x81ff, 0x1040,
- 0x1288, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x43ca, 0x7a1e,
- 0x0078, 0x43cc, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000,
- 0x0d7f, 0x0c7f, 0x1078, 0x4893, 0x0078, 0x43a3, 0x6104, 0xa186,
- 0x0002, 0x0040, 0x43e1, 0xa186, 0x0004, 0x0040, 0x43e1, 0x0078,
- 0x4365, 0x7808, 0xac06, 0x0040, 0x4365, 0x1078, 0x479a, 0x1078,
- 0x448b, 0x0c7f, 0x1078, 0x4893, 0x0078, 0x4352, 0x0c7e, 0x6027,
- 0x0002, 0x2011, 0x70d5, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0,
- 0x4408, 0x62c4, 0x82ff, 0x00c0, 0x4408, 0x793c, 0xa1e5, 0x0000,
- 0x0040, 0x4406, 0x2009, 0x0049, 0x1078, 0x55fc, 0x0c7f, 0x007c,
- 0x3908, 0xa192, 0x71fa, 0x00c8, 0x440f, 0x1078, 0x54ff, 0x6017,
- 0x0010, 0x793c, 0x81ff, 0x0040, 0x4406, 0x7944, 0xa192, 0x7530,
- 0x00c8, 0x442e, 0x8108, 0x7946, 0x1078, 0x4209, 0x793c, 0xa188,
- 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x442a, 0x6017, 0x0012,
- 0x0078, 0x4406, 0x6017, 0x0016, 0x0078, 0x4406, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x513b, 0x037f, 0x1078, 0x6e4a, 0x793c, 0x2160,
- 0x2009, 0x004a, 0x1078, 0x55fc, 0x0078, 0x4406, 0x007e, 0x017e,
+ 0x0040, 0x3c0c, 0x027e, 0x2009, 0x0000, 0x2011, 0xfcff, 0x1078,
+ 0x41f4, 0x027f, 0x0078, 0x3c42, 0x6858, 0xa005, 0x0040, 0x3c56,
+ 0x685c, 0xa065, 0x0040, 0x3c52, 0x2001, 0x6d2c, 0x2004, 0xa005,
+ 0x0040, 0x3c1e, 0x1078, 0x6283, 0x0078, 0x3c24, 0x6013, 0x0400,
+ 0x2009, 0x0041, 0x1078, 0x5591, 0x6958, 0xa18c, 0xe600, 0xa186,
+ 0x2000, 0x0040, 0x3c3a, 0xa186, 0x0400, 0x0040, 0x3c3a, 0x6944,
+ 0x0c7e, 0x1078, 0x416d, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
+ 0x0078, 0x3c42, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
+ 0x41f4, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3c4e, 0x6944, 0x1078,
+ 0x416d, 0x6008, 0x8000, 0x0048, 0x3c4e, 0x600a, 0x0c7f, 0x127f,
+ 0x0078, 0x3d41, 0x0c7f, 0x127f, 0x0078, 0x3d39, 0x6954, 0xa186,
+ 0x0020, 0x0040, 0x3c6c, 0xa186, 0x0029, 0x00c0, 0x3c52, 0x6944,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x3447, 0x00c0, 0x3c42, 0x6000,
+ 0xc0e4, 0x6002, 0x0078, 0x3c42, 0x685c, 0xa065, 0x0040, 0x3c52,
+ 0x6017, 0x0014, 0x0078, 0x3c42, 0x6944, 0x1078, 0x3d6e, 0x6000,
+ 0xa084, 0x0001, 0x0040, 0x3c8d, 0x2091, 0x8000, 0x6204, 0x8210,
+ 0x0048, 0x3c87, 0x6206, 0x2091, 0x8001, 0x0078, 0x3d4f, 0x2091,
+ 0x8001, 0x6853, 0x0016, 0x0078, 0x3d48, 0x6853, 0x0007, 0x0078,
+ 0x3d48, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x3c9b, 0x1078,
+ 0x3a0f, 0x0078, 0x3cad, 0x2030, 0x8001, 0x00c0, 0x3ca5, 0x7007,
+ 0x0001, 0x1078, 0x3cae, 0x0078, 0x3cad, 0x7007, 0x0006, 0x7012,
+ 0x2d00, 0x7016, 0x701a, 0x704b, 0x3cae, 0x007c, 0x0e7e, 0x2009,
+ 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3d28, 0x6848, 0x2070, 0xae82,
+ 0x7400, 0x0048, 0x3d18, 0x2001, 0x6d15, 0x2004, 0xae02, 0x00c8,
+ 0x3d18, 0x6944, 0x1078, 0x3d6e, 0x6100, 0xa184, 0x0001, 0x0040,
+ 0x3cfe, 0xa184, 0x0100, 0x00c0, 0x3d1c, 0xa184, 0x0200, 0x00c0,
+ 0x3d20, 0x601c, 0xa005, 0x00c0, 0x3d24, 0x711c, 0xa186, 0x0006,
+ 0x00c0, 0x3d03, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x127e,
+ 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x3cf5, 0x7112, 0x7018,
+ 0xa065, 0x0040, 0x3d28, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x2e60,
+ 0x1078, 0x4176, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005,
+ 0x00c0, 0x3cf5, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853,
+ 0x0006, 0x0078, 0x3d48, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3447, 0x00c0, 0x3d2c, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x711c,
+ 0xa186, 0x0007, 0x00c0, 0x3d18, 0x6853, 0x0002, 0x0078, 0x3d2e,
+ 0x6853, 0x0008, 0x0078, 0x3d2e, 0x6853, 0x000e, 0x0078, 0x3d2e,
+ 0x6853, 0x0017, 0x0078, 0x3d2e, 0x6853, 0x0035, 0x0078, 0x3d2e,
+ 0x6853, 0x0028, 0x0078, 0x3d2e, 0x6853, 0x0029, 0x0e7f, 0x0078,
+ 0x3d48, 0x2009, 0x003e, 0x0078, 0x3d43, 0x2009, 0x0004, 0x0078,
+ 0x3d43, 0x2009, 0x0006, 0x0078, 0x3d43, 0x2009, 0x0016, 0x0078,
+ 0x3d43, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856,
+ 0x2091, 0x8000, 0x1078, 0x36a1, 0x2091, 0x8001, 0x007c, 0x1078,
+ 0x1328, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x3d5f,
+ 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3d6b, 0x7070,
+ 0xa080, 0x0040, 0x7072, 0x00c8, 0x3d6b, 0x7074, 0xa081, 0x0000,
+ 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078,
+ 0x416d, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085,
+ 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1,
+ 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3d8a, 0xa086, 0x1000,
+ 0x00c0, 0x3dab, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x3d91,
+ 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3dab, 0xac82, 0x7400, 0x0048,
+ 0x3dab, 0x6854, 0xac02, 0x00c8, 0x3dab, 0x2009, 0x0047, 0x1078,
+ 0x5591, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x7a28, 0x7a1c, 0xd284,
+ 0x00c0, 0x3d7c, 0x007c, 0xa016, 0x1078, 0x1532, 0x0078, 0x3da1,
+ 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584,
+ 0x0070, 0x00c0, 0x3dd9, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0,
+ 0x3dd9, 0x1078, 0x3de6, 0x0040, 0x3dd9, 0x20e1, 0x3000, 0x7828,
+ 0x7828, 0x1078, 0x3e04, 0x147f, 0x137f, 0x157f, 0x2009, 0x6f18,
+ 0x2104, 0xa005, 0x00c0, 0x3dd5, 0x007c, 0x1078, 0x476a, 0x0078,
+ 0x3dd4, 0x1078, 0x6c23, 0x1078, 0x3de6, 0x20e1, 0x3000, 0x7828,
+ 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3dd4, 0xa484, 0x01ff,
+ 0x687a, 0xa005, 0x0040, 0x3df8, 0xa080, 0x001f, 0xa084, 0x03f8,
+ 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c,
+ 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
+ 0xa085, 0x0001, 0x0078, 0x3df7, 0x7000, 0xa084, 0xff00, 0xa08c,
+ 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3e11, 0x0078, 0x3f51,
+ 0x007c, 0xa196, 0x2000, 0x00c0, 0x3e22, 0x6900, 0xa18e, 0x0001,
+ 0x00c0, 0x3e1e, 0x1078, 0x2aec, 0x0078, 0x3e10, 0x1078, 0x3e2a,
+ 0x0078, 0x3e10, 0xa196, 0x8000, 0x00c0, 0x3e10, 0x1078, 0x3fd7,
+ 0x0078, 0x3e10, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196,
+ 0x0001, 0x0040, 0x3e37, 0xa196, 0x0023, 0x00c0, 0x3ef8, 0xa08e,
+ 0x0023, 0x00c0, 0x3e68, 0x1078, 0x404e, 0x0040, 0x3ef8, 0x7124,
+ 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3e50, 0x7034, 0xa005,
+ 0x00c0, 0x3ef8, 0x2009, 0x0015, 0x1078, 0x5591, 0x0078, 0x3ef8,
+ 0xa08e, 0x0210, 0x00c0, 0x3e5a, 0x2009, 0x0015, 0x1078, 0x5591,
+ 0x0078, 0x3ef8, 0xa08e, 0x0100, 0x00c0, 0x3ef8, 0x7034, 0xa005,
+ 0x00c0, 0x3ef8, 0x2009, 0x0016, 0x1078, 0x5591, 0x0078, 0x3ef8,
+ 0xa08e, 0x0022, 0x00c0, 0x3ef8, 0x7030, 0xa08e, 0x0300, 0x00c0,
+ 0x3e79, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x0017, 0x0078,
+ 0x3eda, 0xa08e, 0x0500, 0x00c0, 0x3e85, 0x7034, 0xa005, 0x00c0,
+ 0x3ef8, 0x2009, 0x0018, 0x0078, 0x3eda, 0xa08e, 0x2010, 0x00c0,
+ 0x3e8d, 0x2009, 0x0019, 0x0078, 0x3eda, 0xa08e, 0x2110, 0x00c0,
+ 0x3e95, 0x2009, 0x001a, 0x0078, 0x3eda, 0xa08e, 0x5200, 0x00c0,
+ 0x3ea1, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x001b, 0x0078,
+ 0x3eda, 0xa08e, 0x5000, 0x00c0, 0x3ead, 0x7034, 0xa005, 0x00c0,
+ 0x3ef8, 0x2009, 0x001c, 0x0078, 0x3eda, 0xa08e, 0x2400, 0x00c0,
+ 0x3eb3, 0x0078, 0x3ed8, 0xa08e, 0x5300, 0x00c0, 0x3eb9, 0x0078,
+ 0x3ed8, 0xa08e, 0x0f00, 0x00c0, 0x3ec1, 0x2009, 0x0020, 0x0078,
+ 0x3eda, 0xa08e, 0x5300, 0x00c0, 0x3ec7, 0x0078, 0x3ed8, 0xa08e,
+ 0x6104, 0x00c0, 0x3ed8, 0x2009, 0x728e, 0x2011, 0x8015, 0x211c,
+ 0x8108, 0x2124, 0x1078, 0x2a53, 0x2009, 0x0023, 0x0078, 0x3eda,
+ 0x2009, 0x001d, 0x017e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c,
+ 0x1078, 0x1e1b, 0x00c0, 0x3efa, 0x1078, 0x3410, 0x00c0, 0x3efa,
+ 0x6612, 0x6516, 0x0c7e, 0x1078, 0x5504, 0x0040, 0x3efd, 0x017f,
+ 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x5591,
+ 0x0c7f, 0x007c, 0x017f, 0x0078, 0x3ef8, 0x0c7f, 0x0078, 0x3efa,
+ 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff, 0x00c0, 0x3f20,
+ 0xa596, 0xfffd, 0x00c0, 0x3f10, 0x2009, 0x007f, 0x0078, 0x3f4d,
+ 0xa596, 0xfffe, 0x00c0, 0x3f18, 0x2009, 0x007e, 0x0078, 0x3f4d,
+ 0xa596, 0xfffc, 0x00c0, 0x3f20, 0x2009, 0x0080, 0x0078, 0x3f4d,
+ 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082, 0x2071, 0x6e7e,
+ 0x2e1c, 0x83ff, 0x00c0, 0x3f32, 0x82ff, 0x00c0, 0x3f41, 0x2410,
+ 0x0078, 0x3f41, 0x2368, 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f,
+ 0x00c0, 0x3f41, 0x6b14, 0xa31e, 0x00c0, 0x3f41, 0x2408, 0x0078,
+ 0x3f4d, 0x8420, 0x8e70, 0x00f0, 0x3f28, 0x82ff, 0x00c0, 0x3f4c,
+ 0xa085, 0x0001, 0x0078, 0x3f4e, 0x2208, 0xa006, 0x0d7f, 0x0e7f,
+ 0x007c, 0xa084, 0x0007, 0x0079, 0x3f56, 0x007c, 0x3f5e, 0x3f5e,
+ 0x3f5e, 0x3f5e, 0x3f5e, 0x3f5f, 0x3f78, 0x3fc0, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x3f77, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0,
+ 0x3f77, 0xac8a, 0x7400, 0x0048, 0x3f77, 0x6854, 0xac02, 0x00c8,
+ 0x3f77, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x5591, 0x007c,
+ 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x3fbe, 0x2011, 0x7283, 0x2204,
+ 0x8211, 0x220c, 0x1078, 0x1e1b, 0x00c0, 0x3fbe, 0x1078, 0x3447,
+ 0x00c0, 0x3fbe, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006,
+ 0x00c0, 0x3fa3, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x3fbe,
+ 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009, 0x0044, 0x1078,
+ 0x5591, 0x0078, 0x3fbe, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040,
+ 0x3fbe, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004,
+ 0x00c0, 0x3fb6, 0x6007, 0x0005, 0x0078, 0x3fb8, 0x6007, 0x0001,
+ 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0c7f, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x3fd6, 0x7020, 0x2060, 0xac84, 0x0007,
+ 0x00c0, 0x3fd6, 0xac82, 0x7400, 0x0048, 0x3fd6, 0x6854, 0xac02,
+ 0x00c8, 0x3fd6, 0x2009, 0x0045, 0x1078, 0x5591, 0x007c, 0x7110,
+ 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x3fe7, 0xa084,
+ 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12b7, 0x1079, 0x3fe8, 0x007c,
+ 0x3fee, 0x3fef, 0x3fee, 0x3fee, 0x4030, 0x403f, 0x007c, 0x7110,
+ 0xd1bc, 0x00c0, 0x402f, 0x700c, 0x7108, 0x1078, 0x1e1b, 0x00c0,
+ 0x402f, 0x1078, 0x3410, 0x00c0, 0x402f, 0x6612, 0x6516, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4018, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f, 0x0005,
+ 0x7120, 0x610a, 0x2009, 0x0028, 0x1078, 0x5591, 0x0078, 0x402f,
+ 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x402b, 0x2009,
+ 0x0005, 0x0078, 0x402d, 0x2009, 0x0001, 0x1078, 0x5591, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x403e, 0x1078, 0x404e, 0x0040, 0x403e,
+ 0x7124, 0x610a, 0x2009, 0x0029, 0x1078, 0x5591, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x404d, 0x1078, 0x404e, 0x0040, 0x404d, 0x7124,
+ 0x610a, 0x2009, 0x002a, 0x1078, 0x5591, 0x007c, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x4061, 0xac82, 0x7400, 0x0048, 0x4061,
+ 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x4061, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x4060, 0x2071, 0x6f23, 0x7003, 0x0003,
+ 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7400, 0x7007,
+ 0x0000, 0x7026, 0x702b, 0x4ff2, 0x7032, 0x7037, 0x503e, 0x007c,
+ 0x2071, 0x6f23, 0x00e0, 0x40be, 0x2091, 0x6000, 0x700c, 0x8001,
+ 0x700e, 0x00c0, 0x4087, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e,
+ 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x409b, 0x7020, 0x8001,
+ 0x7022, 0x00c0, 0x409b, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0,
+ 0x409b, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x40ac, 0x702c,
+ 0x8001, 0x702e, 0x00c0, 0x40ac, 0x702f, 0x0009, 0x8109, 0x7132,
+ 0x00c0, 0x40ac, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x40bd,
+ 0x7008, 0x8001, 0x700a, 0x00c0, 0x40bd, 0x700b, 0x0009, 0x8109,
+ 0x711a, 0x00c0, 0x40bd, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079,
+ 0x40c1, 0x40e8, 0x40e9, 0x4105, 0x0e7e, 0x2071, 0x6f23, 0x7018,
+ 0xa005, 0x00c0, 0x40cf, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f,
+ 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6f23, 0x701c, 0xa206, 0x00c0,
+ 0x40db, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6f23, 0x6088, 0xa102, 0x0048, 0x40e6, 0x618a, 0x0e7f, 0x007c,
+ 0x007c, 0x7110, 0x1078, 0x3447, 0x00c0, 0x40fb, 0x6088, 0x8001,
+ 0x0048, 0x40fb, 0x608a, 0x00c0, 0x40fb, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x476a, 0x127f, 0x8108, 0xa182, 0x00ff, 0x0048, 0x4103,
+ 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e,
+ 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x4134, 0x8001, 0x6016,
+ 0x00c0, 0x4134, 0x611c, 0xa186, 0x0003, 0x0040, 0x411b, 0xa186,
+ 0x0006, 0x00c0, 0x4132, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a,
+ 0x0048, 0x4132, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048,
+ 0x412b, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116,
+ 0x0078, 0x4134, 0x1078, 0x5fea, 0x127f, 0xac88, 0x0008, 0x7116,
+ 0x2001, 0x6d16, 0x2004, 0xa102, 0x0048, 0x4142, 0x7017, 0x7400,
+ 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7027, 0x07d0,
+ 0x7023, 0x0009, 0x0e7f, 0x007c, 0x2001, 0x6f2c, 0x2003, 0x0000,
+ 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7033, 0x07d0, 0x702f, 0x0009,
+ 0x0e7f, 0x007c, 0x2011, 0x6f2f, 0x2013, 0x0000, 0x007c, 0x0e7e,
+ 0x2071, 0x6f23, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
+ 0x0c7e, 0x2061, 0x6fb2, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x6fb2, 0x2060, 0x007c, 0x684c, 0xa08c,
+ 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x41ac, 0xd0b4, 0x00c0, 0x4188,
+ 0xd0bc, 0x00c0, 0x419a, 0x2009, 0x0006, 0x1078, 0x41cf, 0x007c,
+ 0xd0fc, 0x0040, 0x4195, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
+ 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009, 0x0043, 0x1078,
+ 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41a7, 0xa084, 0x0003, 0xa08e,
+ 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009,
+ 0x0042, 0x1078, 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41be, 0xa084,
+ 0x0003, 0xa08e, 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0002, 0x0040,
+ 0x41c2, 0x2009, 0x0041, 0x1078, 0x5591, 0x007c, 0x1078, 0x41cd,
+ 0x0078, 0x41bd, 0x2009, 0x0043, 0x1078, 0x5591, 0x0078, 0x41bd,
+ 0x2009, 0x0004, 0x1078, 0x41cf, 0x007c, 0x2009, 0x0001, 0x6010,
+ 0xa0ec, 0xf000, 0x0040, 0x41f3, 0x2068, 0x6952, 0x6800, 0x6012,
+ 0xa186, 0x0001, 0x00c0, 0x41ed, 0x694c, 0xa18c, 0x8100, 0xa18e,
+ 0x8100, 0x00c0, 0x41ed, 0x0c7e, 0x6944, 0x1078, 0x416d, 0x6204,
+ 0x8210, 0x0048, 0x41ec, 0x6206, 0x0c7f, 0x1078, 0x36a1, 0x6010,
+ 0xa06d, 0x10c0, 0x4176, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010,
+ 0x2061, 0x6fb2, 0x6000, 0x81ff, 0x0040, 0x4201, 0xa205, 0x0078,
+ 0x4202, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x41fa, 0x0c7f,
+ 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x4212, 0x8001, 0x680a,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x6f10,
+ 0x127f, 0x0d7e, 0x2069, 0x6f10, 0x6803, 0x0005, 0x2069, 0x0004,
+ 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027,
+ 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x422e, 0x4238, 0x425d,
+ 0x428e, 0x423e, 0x425d, 0x4236, 0x4236, 0x4236, 0x1078, 0x12b7,
+ 0x1078, 0x414c, 0x1078, 0x476a, 0x0c7f, 0x007c, 0x62c0, 0x82ff,
+ 0x00c0, 0x4244, 0x0c7f, 0x007c, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0x7828, 0xa092, 0x0002, 0x00c8, 0x4253, 0x8000, 0x782a, 0x1078,
+ 0x31c2, 0x0078, 0x4242, 0x1078, 0x318e, 0x7807, 0x0003, 0x7827,
+ 0x0000, 0x782b, 0x0000, 0x0078, 0x4242, 0x1078, 0x414c, 0x62c0,
+ 0x82ff, 0x00c0, 0x426f, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040,
+ 0x12b7, 0x2009, 0x0013, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x0c7e,
+ 0x7824, 0xa065, 0x1040, 0x12b7, 0x7804, 0xa086, 0x0004, 0x0040,
+ 0x42cc, 0x7828, 0xa092, 0x2710, 0x00c8, 0x4285, 0x8000, 0x782a,
+ 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x426d, 0x1078, 0x6c76, 0x2009,
+ 0x0014, 0x1078, 0x5591, 0x0c7f, 0x0078, 0x426d, 0x2001, 0x6f2c,
+ 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x42a2, 0x782b, 0x0000,
+ 0x7824, 0xa065, 0x1040, 0x12b7, 0x2009, 0x0013, 0x1078, 0x55df,
+ 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x7824, 0xa005, 0x1040, 0x12b7,
+ 0x781c, 0xa06d, 0x1040, 0x12b7, 0x6800, 0xc0dc, 0x6802, 0x7924,
+ 0x2160, 0x1078, 0x556a, 0x693c, 0x81ff, 0x1040, 0x12b7, 0x8109,
+ 0x693e, 0x6854, 0xa015, 0x0040, 0x42c0, 0x7a1e, 0x0078, 0x42c2,
+ 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f,
+ 0x1078, 0x476a, 0x0078, 0x42a0, 0x6104, 0xa186, 0x0002, 0x0040,
+ 0x42d7, 0xa186, 0x0004, 0x0040, 0x42d7, 0x0078, 0x4279, 0x7808,
+ 0xac06, 0x0040, 0x4279, 0x1078, 0x4671, 0x1078, 0x4376, 0x0c7f,
+ 0x1078, 0x476a, 0x0078, 0x426d, 0x0c7e, 0x6027, 0x0002, 0x2011,
+ 0x6f2f, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x42fe, 0x62c4,
+ 0x82ff, 0x00c0, 0x42fe, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x42fc,
+ 0x2009, 0x0049, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x6017, 0x0010,
+ 0x793c, 0x81ff, 0x0040, 0x42fc, 0x7944, 0xa192, 0x2710, 0x00c8,
+ 0x431d, 0x8108, 0x7946, 0x1078, 0x4151, 0x793c, 0xa188, 0x0007,
+ 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4319, 0x6017, 0x0012, 0x0078,
+ 0x42fc, 0x6017, 0x0016, 0x0078, 0x42fc, 0x1078, 0x6c76, 0x793c,
+ 0x2160, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078, 0x42fc, 0x007e,
+ 0x017e, 0x0c7e, 0x127e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x6f10,
+ 0x2091, 0x8000, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040,
+ 0x4342, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f,
+ 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x433d, 0x0d7e, 0x2069,
+ 0x6f10, 0x6000, 0xd0d4, 0x0040, 0x435d, 0x6820, 0x8000, 0x6822,
+ 0xa086, 0x0001, 0x00c0, 0x4356, 0x2c00, 0x681e, 0x6804, 0xa084,
+ 0x0007, 0x0079, 0x4772, 0x0d7f, 0x007c, 0xc0d5, 0x6002, 0x6818,
+ 0xa005, 0x0040, 0x436f, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00,
+ 0x681a, 0x0d7f, 0x685a, 0x2069, 0x6f10, 0x0078, 0x434d, 0x6056,
+ 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x434d, 0x007e, 0x017e,
0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061,
- 0x70b6, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, 0x4459,
- 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f,
- 0x007c, 0x6116, 0x6112, 0x0078, 0x4454, 0x0d7e, 0x2069, 0x70b6,
- 0x6000, 0xd0d4, 0x0040, 0x4472, 0x6820, 0x8000, 0x6822, 0xa086,
- 0x0001, 0x00c0, 0x446d, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007,
- 0x0079, 0x489b, 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040, 0x4484,
- 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a,
- 0x2069, 0x70b6, 0x0078, 0x4464, 0x6056, 0x605a, 0x2c00, 0x681a,
- 0x681e, 0x0078, 0x4464, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6, 0x6020, 0x8000,
- 0x6022, 0x6008, 0xa005, 0x0040, 0x44a6, 0xa080, 0x0003, 0x2102,
- 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e, 0x610a,
- 0x0078, 0x44a1, 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6,
- 0x6034, 0xa005, 0x0040, 0x44ba, 0xa080, 0x0003, 0x2102, 0x6136,
- 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x44b8, 0x0f7e, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2071, 0x70b6,
- 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x4520,
- 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x451b, 0x703c,
- 0xac06, 0x00c0, 0x44e0, 0x6003, 0x000a, 0x630a, 0x0078, 0x451b,
- 0x7038, 0xac36, 0x00c0, 0x44e6, 0x660c, 0x763a, 0x7034, 0xac36,
- 0x00c0, 0x44f4, 0x2c00, 0xaf36, 0x0040, 0x44f2, 0x2f00, 0x7036,
- 0x0078, 0x44f4, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x44fd, 0x7e0e, 0x0078, 0x44fe, 0x2678, 0x600f, 0x0000,
- 0x1078, 0x6216, 0x0040, 0x4516, 0x6010, 0x2068, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4529, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x63d5, 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337,
- 0x0c7f, 0x0078, 0x44cd, 0x2c78, 0x600c, 0x2060, 0x0078, 0x44cd,
- 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x450b, 0x1078, 0x6d80,
- 0x0078, 0x4516, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031,
- 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x70b6, 0x7838, 0xa065,
- 0x0040, 0x4569, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c, 0xac06,
- 0x00c0, 0x4550, 0x6003, 0x000a, 0x630a, 0x2c30, 0x0078, 0x4566,
- 0x1078, 0x6216, 0x0040, 0x4564, 0x6010, 0x2068, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4572, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337, 0x007f, 0x0078,
- 0x453f, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x455b, 0x1078,
- 0x6d80, 0x0078, 0x4564, 0x027e, 0x1078, 0x458f, 0x1078, 0x4628,
- 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x70b6, 0x2091, 0x8000,
- 0x1078, 0x46bf, 0x1078, 0x4727, 0x127f, 0x0f7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, 0x4617,
- 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x4612, 0x7024,
- 0xac06, 0x00c0, 0x45d5, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
- 0x45d0, 0x1078, 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7027,
+ 0x6f10, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x4391,
+ 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f,
+ 0x007c, 0x610e, 0x610a, 0x0078, 0x438c, 0x0c7e, 0x600f, 0x0000,
+ 0x2c08, 0x2061, 0x6f10, 0x6034, 0xa005, 0x0040, 0x43a5, 0xa080,
+ 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078,
+ 0x43a3, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
+ 0x127e, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000,
+ 0x8cff, 0x0040, 0x4405, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206,
+ 0x00c0, 0x4400, 0x703c, 0xac06, 0x00c0, 0x43cb, 0x6003, 0x000a,
+ 0x630a, 0x0078, 0x4400, 0x7038, 0xac36, 0x00c0, 0x43d1, 0x660c,
+ 0x763a, 0x7034, 0xac36, 0x00c0, 0x43df, 0x2c00, 0xaf36, 0x0040,
+ 0x43dd, 0x2f00, 0x7036, 0x0078, 0x43df, 0x7037, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x43e8, 0x7e0e, 0x0078, 0x43e9,
+ 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003,
+ 0x00c0, 0x440e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x0c7f, 0x0078, 0x43b8,
+ 0x2c78, 0x600c, 0x2060, 0x0078, 0x43b8, 0x127f, 0x007f, 0x027f,
+ 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x43f2, 0x1078, 0x6bb3, 0x0078, 0x43fb, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091,
+ 0x8000, 0x2079, 0x6f10, 0x7838, 0xa065, 0x0040, 0x444a, 0x600c,
+ 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4435, 0x6003,
+ 0x000a, 0x630a, 0x2c30, 0x0078, 0x4447, 0x6010, 0x2068, 0x601c,
+ 0xa086, 0x0003, 0x00c0, 0x4453, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x007f,
+ 0x0078, 0x4424, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f,
+ 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x443c,
+ 0x1078, 0x6bb3, 0x0078, 0x4445, 0x027e, 0x1078, 0x4470, 0x1078,
+ 0x4507, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x6f10, 0x2091,
+ 0x8000, 0x1078, 0x4599, 0x1078, 0x4601, 0x127f, 0x0f7f, 0x007c,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040,
+ 0x44f6, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x44f1,
+ 0x7024, 0xac06, 0x00c0, 0x44b6, 0x2069, 0x0100, 0x68c0, 0xa005,
+ 0x0040, 0x44b1, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+ 0x0040, 0x44a6, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
+ 0x6824, 0xd084, 0x0040, 0x44ae, 0x6827, 0x0001, 0x037f, 0x0078,
+ 0x44b6, 0x6003, 0x0009, 0x630a, 0x0078, 0x44f1, 0x7014, 0xac36,
+ 0x00c0, 0x44bc, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x44ca,
+ 0x2c00, 0xaf36, 0x0040, 0x44c8, 0x2f00, 0x7012, 0x0078, 0x44ca,
+ 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x44d3,
+ 0x7e0e, 0x0078, 0x44d4, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x44ea, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x44fe, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078,
+ 0x447e, 0x2c78, 0x600c, 0x2060, 0x0078, 0x447e, 0x127f, 0x007f,
+ 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x44e1, 0x1078, 0x6bb3, 0x0078, 0x44ea, 0x0c7e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x6e00, 0x2004, 0xa065,
+ 0x0040, 0x4595, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x6f10,
+ 0x6654, 0x7018, 0xac06, 0x00c0, 0x451e, 0x761a, 0x701c, 0xac06,
+ 0x00c0, 0x452a, 0x86ff, 0x00c0, 0x4529, 0x7018, 0x701e, 0x0078,
+ 0x452a, 0x761e, 0x6058, 0xa07d, 0x0040, 0x452f, 0x7e56, 0xa6ed,
+ 0x0000, 0x0040, 0x4535, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b,
+ 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040,
+ 0x4591, 0x7624, 0x86ff, 0x0040, 0x4586, 0xa680, 0x0004, 0x2004,
+ 0xad06, 0x00c0, 0x4586, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005,
+ 0x0040, 0x457d, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+ 0x0040, 0x4566, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
+ 0x6824, 0xd084, 0x0040, 0x456e, 0x6827, 0x0001, 0x037f, 0x0d7f,
+ 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4577, 0x8001, 0x603e, 0x2660,
+ 0x1078, 0x6283, 0x0c7f, 0x0078, 0x4586, 0x0d7f, 0x0c7e, 0x2660,
+ 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x453d, 0x6837, 0x0103,
+ 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078,
+ 0x453d, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f,
+ 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814,
+ 0xa065, 0x0040, 0x45f1, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824,
+ 0xac06, 0x00c0, 0x45d6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x45d0, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827,
0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
0x45c5, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
- 0xd084, 0x0040, 0x45cd, 0x6827, 0x0001, 0x037f, 0x0078, 0x45d5,
- 0x6003, 0x0009, 0x630a, 0x0078, 0x4612, 0x7014, 0xac36, 0x00c0,
- 0x45db, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x45e9, 0x2c00,
- 0xaf36, 0x0040, 0x45e7, 0x2f00, 0x7012, 0x0078, 0x45e9, 0x7013,
- 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x45f2, 0x7e0e,
- 0x0078, 0x45f3, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
- 0x6216, 0x0040, 0x460b, 0x601c, 0xa086, 0x0003, 0x00c0, 0x461f,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x63d5, 0x1078,
- 0x3720, 0x1078, 0x632a, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f,
- 0x0078, 0x459d, 0x2c78, 0x600c, 0x2060, 0x0078, 0x459d, 0x127f,
- 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4600, 0x1078, 0x6d80, 0x0078, 0x460b,
- 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x7020, 0x2004,
- 0xa065, 0x0040, 0x46bb, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071,
- 0x70b6, 0x6654, 0x7018, 0xac06, 0x00c0, 0x463f, 0x761a, 0x701c,
- 0xac06, 0x00c0, 0x464b, 0x86ff, 0x00c0, 0x464a, 0x7018, 0x701e,
- 0x0078, 0x464b, 0x761e, 0x6058, 0xa07d, 0x0040, 0x4650, 0x7e56,
- 0xa6ed, 0x0000, 0x0040, 0x4656, 0x2f00, 0x685a, 0x6057, 0x0000,
- 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3448,
- 0x0040, 0x46b7, 0x7624, 0x86ff, 0x0040, 0x46a7, 0xa680, 0x0004,
- 0x2004, 0xad06, 0x00c0, 0x46a7, 0x0d7e, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x469e, 0x1078, 0x4f8e, 0x68c3, 0x0000, 0x1078,
- 0x5405, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x4687, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x468f, 0x6827, 0x0001, 0x037f,
- 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4698, 0x8001, 0x603e,
- 0x2660, 0x1078, 0x6337, 0x0c7f, 0x0078, 0x46a7, 0x0d7f, 0x0c7e,
- 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x465e, 0x8dff,
- 0x0040, 0x46b3, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
- 0x63d5, 0x1078, 0x3720, 0x1078, 0x52d5, 0x0078, 0x465e, 0x067f,
- 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040,
- 0x4717, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0,
- 0x46fc, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x46f6, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7827, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x46eb, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x46f3, 0x6827, 0x0001, 0x037f, 0x0078, 0x46fc, 0x6003, 0x0009,
- 0x630a, 0x2c30, 0x0078, 0x4714, 0x6010, 0x2068, 0x1078, 0x6216,
- 0x0040, 0x4710, 0x601c, 0xa086, 0x0003, 0x00c0, 0x471e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x1078, 0x6337, 0x1078, 0x52d5, 0x007f, 0x0078, 0x46c6, 0x7e16,
- 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x4707, 0x1078, 0x6d80, 0x0078, 0x4710, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4793, 0x6054,
- 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc,
- 0x6002, 0x1078, 0x3448, 0x0040, 0x4790, 0x7e24, 0x86ff, 0x0040,
- 0x4782, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4782, 0x0d7e,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4779, 0x1078, 0x4f8e,
- 0x68c3, 0x0000, 0x1078, 0x5405, 0x7827, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4762, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x476a,
- 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040,
- 0x4773, 0x8001, 0x603e, 0x2660, 0x1078, 0x6337, 0x0c7f, 0x0078,
- 0x4782, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f,
- 0x0078, 0x4739, 0x8dff, 0x0040, 0x478c, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x52d5, 0x0078, 0x4739,
- 0x007f, 0x0078, 0x472c, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x70b6, 0x7004, 0xa084,
- 0x0007, 0x0079, 0x47a3, 0x47ad, 0x47b0, 0x47c9, 0x47e5, 0x482a,
- 0x47ad, 0x47ad, 0x47ab, 0x1078, 0x1288, 0x0c7f, 0x0e7f, 0x007c,
- 0x7024, 0xa065, 0x0040, 0x47be, 0x7020, 0x8001, 0x7022, 0x600c,
- 0xa015, 0x0040, 0x47c5, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000,
- 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078,
- 0x47be, 0x6018, 0x2060, 0x1078, 0x3448, 0x6000, 0xc0dc, 0x6002,
- 0x7020, 0x8001, 0x7022, 0x0040, 0x47da, 0x6054, 0xa015, 0x0040,
- 0x47e1, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
- 0x007c, 0x7218, 0x721e, 0x0078, 0x47da, 0x7024, 0xa065, 0x0040,
- 0x4827, 0x700c, 0xac06, 0x00c0, 0x47fc, 0x1078, 0x52d5, 0x600c,
- 0xa015, 0x0040, 0x47f8, 0x720e, 0x600f, 0x0000, 0x0078, 0x4825,
- 0x720e, 0x720a, 0x0078, 0x4825, 0x7014, 0xac06, 0x00c0, 0x480f,
- 0x1078, 0x52d5, 0x600c, 0xa015, 0x0040, 0x480b, 0x7216, 0x600f,
- 0x0000, 0x0078, 0x4825, 0x7216, 0x7212, 0x0078, 0x4825, 0x6018,
- 0x2060, 0x1078, 0x3448, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x52d5,
- 0x701c, 0xa065, 0x0040, 0x4825, 0x6054, 0xa015, 0x0040, 0x4823,
- 0x721e, 0x0078, 0x4825, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4837, 0x1078, 0x52d5,
- 0x600c, 0xa015, 0x0040, 0x483e, 0x720e, 0x600f, 0x0000, 0x1078,
- 0x5405, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a,
- 0x0078, 0x4837, 0x0d7e, 0x2069, 0x70b6, 0x6830, 0xa084, 0x0003,
- 0x0079, 0x484a, 0x4850, 0x4852, 0x4878, 0x4850, 0x1078, 0x1288,
- 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x486e,
- 0x683c, 0xa065, 0x0040, 0x4863, 0x600c, 0xa015, 0x0040, 0x486a,
- 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f,
- 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x4863, 0x6843, 0x0000,
- 0x6838, 0xa065, 0x0040, 0x4863, 0x6003, 0x0003, 0x0078, 0x4863,
- 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040,
- 0x4890, 0x600c, 0xa015, 0x0040, 0x488c, 0x6a3a, 0x600f, 0x0000,
- 0x683f, 0x0000, 0x0078, 0x4890, 0x683f, 0x0000, 0x683a, 0x6836,
- 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6804, 0xa084,
- 0x0007, 0x0079, 0x489b, 0x48a5, 0x4932, 0x4932, 0x4932, 0x4932,
- 0x4934, 0x4932, 0x48a3, 0x1078, 0x1288, 0x6820, 0xa005, 0x00c0,
- 0x48ab, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x48ba,
- 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x497a, 0x0c7f,
- 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x48c8, 0x6807, 0x0001,
- 0x6826, 0x682b, 0x0000, 0x1078, 0x497a, 0x0c7f, 0x0d7f, 0x007c,
- 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x492d, 0x704c,
- 0xa00d, 0x0040, 0x48d7, 0x7088, 0xa005, 0x0040, 0x48ef, 0x7054,
- 0xa075, 0x0040, 0x48e0, 0xa20e, 0x0040, 0x492d, 0x0078, 0x48e5,
- 0x6818, 0xa20e, 0x0040, 0x492d, 0x2070, 0x704c, 0xa00d, 0x0040,
- 0x48d7, 0x7088, 0xa005, 0x00c0, 0x48d7, 0x2e00, 0x681e, 0x733c,
- 0x7038, 0xa302, 0x00c8, 0x48d7, 0x1078, 0x55a4, 0x0040, 0x492d,
- 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004,
- 0xa08a, 0x199a, 0x0048, 0x4906, 0x2001, 0x1999, 0x8003, 0x801b,
- 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xa1e0,
- 0x2207, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
- 0x4c94, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
- 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
- 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
- 0x0078, 0x492b, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
- 0x4940, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x497a,
- 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x70b6, 0x6830,
- 0xa086, 0x0000, 0x00c0, 0x4961, 0x6838, 0xa07d, 0x0040, 0x4961,
- 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091,
- 0x2200, 0x027f, 0x1078, 0x19b3, 0x00c0, 0x4964, 0x127f, 0x1078,
- 0x4ec1, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803,
- 0x0002, 0x780c, 0xa015, 0x0040, 0x4976, 0x6a3a, 0x780f, 0x0000,
- 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x4961, 0x683a, 0x6836,
- 0x0078, 0x4970, 0x601c, 0xa084, 0x0007, 0x1079, 0x4980, 0x007c,
- 0x4988, 0x498d, 0x4bcc, 0x4c64, 0x498d, 0x4bcc, 0x4c64, 0x4988,
- 0x1078, 0x479a, 0x1078, 0x4893, 0x007c, 0x157e, 0x137e, 0x147e,
- 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x6118,
- 0x2178, 0x79a0, 0xa1f8, 0x2207, 0x2f0c, 0xa18c, 0x00ff, 0x2c78,
- 0x2061, 0x0100, 0x619a, 0x1079, 0x49ab, 0x0f7f, 0x0c7f, 0x147f,
- 0x137f, 0x157f, 0x007c, 0x49dd, 0x4a15, 0x4a2d, 0x4a66, 0x4a93,
- 0x4a9b, 0x4abc, 0x4acd, 0x4ade, 0x4ae6, 0x4af7, 0x4ae6, 0x4b3f,
- 0x4acd, 0x4b60, 0x4b68, 0x4ade, 0x4b68, 0x4b79, 0x49db, 0x49db,
- 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db,
- 0x49db, 0x49db, 0x504c, 0x5061, 0x49db, 0x49db, 0x49db, 0x49db,
- 0x4abc, 0x4ae6, 0x49db, 0x4a2d, 0x4a66, 0x49db, 0x551f, 0x4ae6,
- 0x49db, 0x5542, 0x4ae6, 0x1078, 0x1288, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6f51,
- 0x6804, 0xd084, 0x0040, 0x49f7, 0x6828, 0x20a3, 0x0000, 0x017e,
- 0x1078, 0x1feb, 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x49fc, 0x0d7f,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6f05,
- 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a3, 0x0000,
- 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x001c, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030,
- 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6,
- 0x60c3, 0x0010, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x2099, 0x70a0, 0x20a9,
- 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
- 0x00f0, 0x4a46, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4a4c,
- 0x2099, 0x70a8, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3,
- 0x0000, 0x00f0, 0x4a57, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0,
- 0x4a5d, 0x60c3, 0x0074, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4b8e, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800,
- 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x0f7e, 0x2079, 0x6f51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4a82,
- 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4a87, 0xa085, 0x0010, 0xa085,
- 0x0002, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x20a3,
- 0x5000, 0x0078, 0x4a33, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x20a3,
- 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4bad,
- 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0004, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
- 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4bad, 0x20a3, 0x0200, 0x0078, 0x4a33, 0x20a1, 0x020b,
- 0x1078, 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003,
- 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210, 0x20a3, 0x0014,
- 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0,
- 0x4b1d, 0x6998, 0xa184, 0xc000, 0x00c0, 0x4b19, 0xd1ec, 0x0040,
- 0x4b15, 0x20a3, 0x2100, 0x0078, 0x4b1f, 0x20a3, 0x0100, 0x0078,
- 0x4b1f, 0x20a3, 0x0400, 0x0078, 0x4b1f, 0x20a3, 0x0700, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6f51,
- 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4b2f, 0xa085, 0x0020, 0xd1a4,
- 0x0040, 0x4b34, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2,
- 0x20a2, 0x60c3, 0x0014, 0x1078, 0x4f7a, 0x0d7f, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+ 0xd084, 0x0040, 0x45cd, 0x6827, 0x0001, 0x037f, 0x0078, 0x45d6,
+ 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x45ee, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x45ea, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x45f8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x007f, 0x0078,
+ 0x45a0, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c,
+ 0x601c, 0xa086, 0x0006, 0x00c0, 0x45e1, 0x1078, 0x6bb3, 0x0078,
+ 0x45ea, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040,
+ 0x466a, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
+ 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040, 0x4667, 0x7e24,
+ 0x86ff, 0x0040, 0x465c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
+ 0x465c, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4653,
+ 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827, 0x0000,
+ 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x463c,
+ 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
+ 0x0040, 0x4644, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
+ 0xa005, 0x0040, 0x464d, 0x8001, 0x603e, 0x2660, 0x1078, 0x6283,
+ 0x0c7f, 0x0078, 0x465c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
+ 0x630a, 0x0c7f, 0x0078, 0x4613, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078, 0x4613, 0x007f,
+ 0x0078, 0x4606, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x6f10, 0x7004, 0xa084, 0x0007,
+ 0x0079, 0x467a, 0x4684, 0x4687, 0x46a0, 0x46bc, 0x4701, 0x4684,
+ 0x4682, 0x4682, 0x1078, 0x12b7, 0x0c7f, 0x0e7f, 0x007c, 0x7024,
+ 0xa065, 0x0040, 0x4695, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015,
+ 0x0040, 0x469c, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027,
+ 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4695,
+ 0x6018, 0x2060, 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x7020,
+ 0x8001, 0x7022, 0x0040, 0x46b1, 0x6054, 0xa015, 0x0040, 0x46b8,
+ 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
+ 0x7218, 0x721e, 0x0078, 0x46b1, 0x7024, 0xa065, 0x0040, 0x46fe,
+ 0x700c, 0xac06, 0x00c0, 0x46d3, 0x1078, 0x5374, 0x600c, 0xa015,
+ 0x0040, 0x46cf, 0x720e, 0x600f, 0x0000, 0x0078, 0x46fc, 0x720e,
+ 0x720a, 0x0078, 0x46fc, 0x7014, 0xac06, 0x00c0, 0x46e6, 0x1078,
+ 0x5374, 0x600c, 0xa015, 0x0040, 0x46e2, 0x7216, 0x600f, 0x0000,
+ 0x0078, 0x46fc, 0x7216, 0x7212, 0x0078, 0x46fc, 0x6018, 0x2060,
+ 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x5374, 0x701c,
+ 0xa065, 0x0040, 0x46fc, 0x6054, 0xa015, 0x0040, 0x46fa, 0x721e,
+ 0x0078, 0x46fc, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
+ 0x007c, 0x7024, 0xa065, 0x0040, 0x470e, 0x1078, 0x5374, 0x600c,
+ 0xa015, 0x0040, 0x4715, 0x720e, 0x600f, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078,
+ 0x470e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa084, 0x0003, 0x0079,
+ 0x4721, 0x4727, 0x4729, 0x474f, 0x4725, 0x1078, 0x12b7, 0x0d7f,
+ 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x4745, 0x683c,
+ 0xa065, 0x0040, 0x473a, 0x600c, 0xa015, 0x0040, 0x4741, 0x6a3a,
+ 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f,
+ 0x007c, 0x683a, 0x6836, 0x0078, 0x473a, 0x6843, 0x0000, 0x6838,
+ 0xa065, 0x0040, 0x473a, 0x6003, 0x0003, 0x0078, 0x473a, 0x0c7e,
+ 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4767,
+ 0x600c, 0xa015, 0x0040, 0x4763, 0x6a3a, 0x600f, 0x0000, 0x683f,
+ 0x0000, 0x0078, 0x4767, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f,
+ 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6804, 0xa084, 0x0007,
+ 0x0079, 0x4772, 0x477c, 0x4810, 0x4810, 0x4810, 0x4810, 0x4812,
+ 0x477a, 0x477a, 0x1078, 0x12b7, 0x6820, 0xa005, 0x00c0, 0x4782,
+ 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4791, 0x6807,
+ 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f,
+ 0x007c, 0x6814, 0xa065, 0x0040, 0x479f, 0x6807, 0x0001, 0x6826,
+ 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e,
+ 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x480b, 0x704c, 0xa00d,
+ 0x0040, 0x47ae, 0x7088, 0xa005, 0x0040, 0x47c6, 0x7054, 0xa075,
+ 0x0040, 0x47b7, 0xa20e, 0x0040, 0x480b, 0x0078, 0x47bc, 0x6818,
+ 0xa20e, 0x0040, 0x480b, 0x2070, 0x704c, 0xa00d, 0x0040, 0x47ae,
+ 0x7088, 0xa005, 0x00c0, 0x47ae, 0x2e00, 0x681e, 0x733c, 0x7038,
+ 0xa302, 0x00c8, 0x47ae, 0x1078, 0x5539, 0x0040, 0x480b, 0x8318,
+ 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a,
+ 0x199a, 0x0048, 0x47dd, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b,
+ 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, 0x0040,
+ 0x47ed, 0x2009, 0x0000, 0x0078, 0x47f2, 0xa1e0, 0x2091, 0x2c0c,
+ 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x4c44, 0x7300,
+ 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000,
+ 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f,
+ 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4809,
+ 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x481e, 0x6807,
+ 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f,
+ 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa086, 0x0000,
+ 0x00c0, 0x483f, 0x6838, 0xa07d, 0x0040, 0x483f, 0x6833, 0x0001,
+ 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f,
+ 0x1078, 0x1838, 0x00c0, 0x4842, 0x127f, 0x1078, 0x4ed5, 0x0d7f,
+ 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c,
+ 0xa015, 0x0040, 0x4854, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
+ 0x683f, 0x0000, 0x0078, 0x483f, 0x683a, 0x6836, 0x0078, 0x484e,
+ 0x601c, 0xa084, 0x000f, 0x1079, 0x485e, 0x007c, 0x4867, 0x4869,
+ 0x4b33, 0x4c15, 0x4869, 0x4b33, 0x4c15, 0x4867, 0x4869, 0x1078,
+ 0x12b7, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
+ 0x0024, 0x10c8, 0x12b7, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2091,
+ 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079,
+ 0x4887, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x48ad,
+ 0x48ec, 0x4904, 0x494c, 0x4979, 0x4981, 0x49a2, 0x49b3, 0x49c4,
+ 0x49cc, 0x49dd, 0x49cc, 0x4a25, 0x49b3, 0x4a55, 0x4a5d, 0x49c4,
+ 0x4a5d, 0x4a6e, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab,
+ 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x50b8, 0x50cd,
+ 0x50f0, 0x5114, 0x49a2, 0x1078, 0x12b7, 0x20a1, 0x020b, 0x1078,
+ 0x4a83, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6d51,
+ 0x6804, 0xd084, 0x0040, 0x48ce, 0x6828, 0x017e, 0x2069, 0x6d00,
+ 0x694c, 0xa106, 0x017f, 0x00c0, 0x48ce, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x0d7f, 0x0078, 0x48d3, 0x0d7f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6d01, 0x53a6, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x001c, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x60c3,
+ 0x0010, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4917,
+ 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4919, 0x20a3,
+ 0x0300, 0x20a3, 0x0000, 0x2099, 0x6f00, 0x20a9, 0x0008, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x20a9, 0x0004, 0x2099,
+ 0x6d01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x492c,
+ 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4932, 0x2099, 0x6f08,
+ 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x493d, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4943, 0x60c3,
+ 0x0074, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079,
+ 0x6d51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4968, 0xa085, 0x0020,
+ 0xd1a4, 0x0040, 0x496d, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4fd1,
+ 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x5000, 0x0078,
+ 0x4919, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x2110, 0x20a3,
+ 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0x20a3, 0x0000, 0x20a3,
0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4f7a, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0200, 0x0078, 0x49e3,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f7a,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078,
- 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
- 0x0000, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078,
- 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4f69,
- 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
- 0x0085, 0x1048, 0x1288, 0xa08a, 0x008c, 0x10c8, 0x1288, 0x6118,
- 0x2178, 0x79a0, 0xa1f8, 0x2207, 0x2f0c, 0xa18c, 0x00ff, 0x2c78,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x1079, 0x4bea, 0x0f7f,
- 0x0c7f, 0x007c, 0x4bf3, 0x4bfe, 0x4c18, 0x4bf1, 0x4bf1, 0x4bf1,
- 0x4bf3, 0x1078, 0x1288, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c2b,
- 0x60c3, 0x0000, 0x1078, 0x4f7a, 0x147f, 0x007c, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x4c3e, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808,
- 0x20a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x4f7a, 0x147f, 0x007c,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c51, 0x20a3, 0x0003, 0x20a3,
- 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078,
- 0x4f7a, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x4b9f, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078,
- 0x4bbe, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1,
- 0x20a3, 0x0000, 0x0078, 0x4bbe, 0x0c7e, 0x0f7e, 0x2c78, 0x7804,
- 0xa08a, 0x0040, 0x1048, 0x1288, 0xa08a, 0x0050, 0x10c8, 0x1288,
- 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2207, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c82, 0x0f7f,
- 0x0c7f, 0x007c, 0x4c94, 0x4d46, 0x4d07, 0x4e55, 0x4c92, 0x4c92,
- 0x4c92, 0x4c92, 0x4c92, 0x4c92, 0x4c92, 0x51ee, 0x51ff, 0x5210,
- 0x5221, 0x4c92, 0x1078, 0x1288, 0x0d7e, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x4ce7, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
+ 0x0022, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004,
+ 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3,
+ 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
+ 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa,
+ 0x20a3, 0x0200, 0x0078, 0x4919, 0x20a1, 0x020b, 0x1078, 0x4afa,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x0d7e, 0x20a1, 0x020b,
+ 0x1078, 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800,
+ 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4a03, 0x6998,
+ 0xa184, 0xc000, 0x00c0, 0x49ff, 0xd1ec, 0x0040, 0x49fb, 0x20a3,
+ 0x2100, 0x0078, 0x4a05, 0x20a3, 0x0100, 0x0078, 0x4a05, 0x20a3,
+ 0x0400, 0x0078, 0x4a05, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6d51, 0x7904, 0x0f7f,
+ 0xd1ac, 0x00c0, 0x4a15, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4a1a,
+ 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x0014, 0x1078, 0x4fd1, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x6018,
+ 0x0d7e, 0x2068, 0x6804, 0x0d7f, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x0040, 0x4a3e, 0x20a3, 0x0400, 0x0078, 0x4a40, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0200, 0x0078, 0x48b3, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
+ 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008,
+ 0x1078, 0x4fd1, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, 0x4a96,
+ 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x4ac4, 0xa286, 0x007f,
+ 0x00c0, 0x4aa1, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, 0x0078,
+ 0x4ab8, 0xd2bc, 0x0040, 0x4ac0, 0xa286, 0x0080, 0x0d7e, 0x00c0,
+ 0x4aaf, 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x4ab8, 0xa2e8,
+ 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, 0x20a2,
+ 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4ac8,
+ 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3,
+ 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x6d19, 0x2da6,
+ 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078,
+ 0x4acc, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3,
+ 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
+ 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4b19, 0x0d7e,
+ 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, 0x6814,
+ 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
+ 0x4b21, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2,
+ 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0025,
+ 0x1048, 0x12b7, 0xa08a, 0x002c, 0x10c8, 0x12b7, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x2091, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0025, 0x1079, 0x4b51, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4b5a, 0x4b65, 0x4b7f, 0x4b58, 0x4b58, 0x4b58, 0x4b5a,
+ 0x1078, 0x12b7, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x60c3,
+ 0x0000, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4bbb, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x000c, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4be8, 0x20a3, 0x0003, 0x20a3, 0x0300,
+ 0x60c3, 0x0004, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x027e, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
+ 0x007e, 0x0048, 0x4bad, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810,
+ 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6,
+ 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4bb5, 0x20a3, 0x8100, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3,
+ 0x0000, 0x0078, 0x4acc, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4bda,
+ 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2,
+ 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
+ 0x0078, 0x4be2, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xa092, 0x007e, 0x0048, 0x4c07, 0x0d7e, 0xa0e8, 0x6e00,
+ 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069,
+ 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4c0f, 0x20a3,
+ 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25, 0x0c7e, 0x0f7e, 0x2c78,
+ 0x7804, 0xa08a, 0x0040, 0x1048, 0x12b7, 0xa08a, 0x004f, 0x10c8,
+ 0x12b7, 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2091, 0x2c0c, 0xa18c,
+ 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c33,
+ 0x0f7f, 0x0c7f, 0x007c, 0x4c44, 0x4d28, 0x4cd0, 0x4e50, 0x4c42,
+ 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x528d, 0x529e,
+ 0x52af, 0x52c0, 0x1078, 0x12b7, 0x0d7e, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c93, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006,
- 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4cb1, 0x20a3, 0x0002, 0x0078,
- 0x4cbd, 0xd1b4, 0x0040, 0x4cb8, 0x20a3, 0x0001, 0x0078, 0x4cbd,
- 0x20a3, 0x0000, 0x2230, 0x0078, 0x4cbf, 0x6a80, 0x6e7c, 0x20a9,
+ 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4c61, 0x20a3, 0x0002, 0x0078,
+ 0x4c6d, 0xd1b4, 0x0040, 0x4c68, 0x20a3, 0x0001, 0x0078, 0x4c6d,
+ 0x20a3, 0x0000, 0x2230, 0x0078, 0x4c6f, 0x6a80, 0x6e7c, 0x20a9,
0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0,
- 0x4cc3, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
- 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x70d2, 0x2003,
- 0x07d0, 0x2001, 0x70d1, 0x2003, 0x0009, 0x2001, 0x70d7, 0x2003,
- 0x0002, 0x1078, 0x14b7, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600, 0x6198,
- 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2, 0x22a2,
- 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c, 0x0d7e,
- 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4d27, 0x7810,
- 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c,
- 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c,
- 0x1078, 0x4f7a, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000,
- 0x1078, 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e36, 0x7810, 0x2068,
- 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084,
- 0xf000, 0x00c0, 0x4d63, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x4d6b, 0x0078, 0x4d66, 0xa006, 0x1079, 0x4d6b, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x4d75, 0x4dd7, 0x4ddb, 0x4dfe, 0x4e0b,
- 0x4e1d, 0x4e21, 0x4d73, 0x1078, 0x1288, 0x017e, 0x037e, 0x694c,
- 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d88, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x4e02,
- 0xa186, 0x0001, 0x00c0, 0x4dd2, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2,
- 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4dd1, 0xd3c4, 0x0040,
- 0x4da3, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4da8, 0x6874, 0xa108,
- 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2,
- 0x8000, 0x00f0, 0x4dad, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184,
- 0x0003, 0x0040, 0x4dd1, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4f69, 0x22a2, 0x20a3,
- 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4f7a, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x4e00, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a,
- 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0028,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018,
- 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0020, 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x4e00, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff,
- 0x8001, 0x00c0, 0x4e2f, 0x22a2, 0x037f, 0x0078, 0x4e00, 0x20a3,
- 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4e02, 0x027e, 0x20e1,
+ 0x4c73, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
+ 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x6f2c, 0x2003,
+ 0x07d0, 0x2001, 0x6f2b, 0x2003, 0x0009, 0x1078, 0x14e4, 0x147f,
+ 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18,
+ 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4cb9, 0x0d7e,
+ 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814,
+ 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
+ 0x4cc1, 0x20a3, 0x0600, 0x6198, 0x21a2, 0x20a3, 0x0000, 0x6130,
+ 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000,
+ 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cf0,
+ 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2,
+ 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x000c, 0x1078, 0x4fd1, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xd0bc, 0x0040, 0x4d0e, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c,
+ 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19,
+ 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4d16, 0x20a3, 0x0500,
+ 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889,
+ 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e18,
+ 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x7810, 0xa084, 0xf000, 0x00c0, 0x4d45, 0x7810, 0xa084, 0x0700,
+ 0x8007, 0x1079, 0x4d4d, 0x0078, 0x4d48, 0xa006, 0x1079, 0x4d4d,
+ 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4d57, 0x4db9, 0x4dbd,
+ 0x4de0, 0x4ded, 0x4dff, 0x4e03, 0x4d55, 0x1078, 0x12b7, 0x017e,
+ 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d6a,
+ 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f,
+ 0x0078, 0x4de4, 0xa186, 0x0001, 0x00c0, 0x4db4, 0x6b78, 0x23a2,
+ 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2,
+ 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4db3,
+ 0xd3c4, 0x0040, 0x4d85, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4d8a,
+ 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c,
+ 0x831f, 0x23a2, 0x8000, 0x00f0, 0x4d8f, 0x157f, 0x22a2, 0x22a2,
+ 0x22a2, 0xa184, 0x0003, 0x0040, 0x4db3, 0x20a1, 0x020b, 0x20e1,
0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078,
- 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e,
- 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x4e68, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
- 0x4e70, 0x4e70, 0x4e72, 0x4e70, 0x4e70, 0x4e70, 0x4e97, 0x4e70,
- 0x1078, 0x1288, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912,
- 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4ea1, 0x0d7e, 0x2069,
- 0x6f51, 0x6804, 0xd0bc, 0x0040, 0x4e8c, 0x682c, 0xa084, 0x00ff,
- 0x8007, 0x20a2, 0x0078, 0x4e8e, 0x20a3, 0x3f00, 0x0d7f, 0x22a2,
- 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4f7a, 0x007c, 0x20a1,
- 0x020b, 0x2009, 0x0003, 0x1078, 0x4ea1, 0x20a3, 0x7f00, 0x0078,
- 0x4e8f, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0100,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888,
- 0xa18d, 0x0008, 0x21a2, 0x1078, 0x4f69, 0x22a2, 0x20a3, 0x0000,
- 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071, 0x6f00,
- 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2207, 0x2014, 0xa294,
- 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x4f08, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014,
- 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e,
- 0x6017, 0x0016, 0x1078, 0x4209, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
- 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040,
- 0x4f3d, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073,
+ 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4fc0,
+ 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4fd1,
+ 0x007c, 0x20a3, 0x0008, 0x0078, 0x4de2, 0x20a3, 0x0302, 0x22a2,
+ 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2,
+ 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4fd1, 0x007c,
+ 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x60c3, 0x0018, 0x1078, 0x4fd1, 0x007c, 0x20a3, 0x0100, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x007c, 0x20a3,
+ 0x0008, 0x0078, 0x4de2, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812,
+ 0xa384, 0x00ff, 0x8001, 0x00c0, 0x4e11, 0x22a2, 0x037f, 0x0078,
+ 0x4de2, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4de4,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xd0bc, 0x0040, 0x4e36, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c,
+ 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19,
+ 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4e3e, 0x20a3, 0x0700,
+ 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898,
+ 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084,
+ 0x0700, 0x8007, 0x1079, 0x4e63, 0x037f, 0x017f, 0x147f, 0x137f,
+ 0x157f, 0x0d7f, 0x007c, 0x4e6b, 0x4e6b, 0x4e6d, 0x4e6b, 0x4e6b,
+ 0x4e6b, 0x4e92, 0x4e6b, 0x1078, 0x12b7, 0x7910, 0xa18c, 0xf8ff,
+ 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078,
+ 0x4e9c, 0x0d7e, 0x2069, 0x6d51, 0x6804, 0xd0bc, 0x0040, 0x4e87,
+ 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4e89, 0x20a3,
+ 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078,
+ 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4e9c,
+ 0x20a3, 0x7f00, 0x0078, 0x4e8a, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4eba,
+ 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2,
+ 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
+ 0x0078, 0x4ec2, 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078,
+ 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, 0x6d00, 0x6130,
+ 0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x4eee, 0xa080,
+ 0x2091, 0x2014, 0xa294, 0x00ff, 0x0078, 0x4ef2, 0x6910, 0x6a14,
+ 0x7364, 0x7468, 0x781c, 0xa086, 0x0006, 0x0040, 0x4f3d, 0xd5bc,
+ 0x0040, 0x4f02, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e,
+ 0x0078, 0x4f08, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e,
+ 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff,
+ 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808,
+ 0x6086, 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c,
+ 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af,
+ 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x4f31, 0x2011,
+ 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, 0x4151, 0x037f, 0x047f,
+ 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c,
+ 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x4f83, 0xd5bc, 0x0040,
+ 0x4f51, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078,
+ 0x4f57, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073,
0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e,
0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082,
0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca,
0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
- 0x629e, 0x6017, 0x0012, 0x0078, 0x4f02, 0x6063, 0x0700, 0x6266,
- 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000, 0x688c,
- 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000,
- 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, 0x608e,
- 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036,
- 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078,
- 0x4f02, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff,
- 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6843, 0x0001,
- 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x4f85, 0x1078, 0x41f9, 0x007c, 0x007e, 0x6014, 0xa084,
- 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e,
- 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016,
- 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078,
- 0x4204, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x4fd8, 0x1078, 0x4f8e, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0c7e, 0x2061, 0x70b6, 0x6128, 0xa192, 0x0002, 0x00c8, 0x4fc5,
- 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x4fd3, 0x1078,
- 0x41f9, 0x1078, 0x4f85, 0x0078, 0x4fd3, 0x6124, 0xa1e5, 0x0000,
- 0x0040, 0x4fd0, 0x1078, 0x6e4a, 0x2009, 0x0014, 0x1078, 0x55fc,
- 0x0c7f, 0x0078, 0x4fd3, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x1078, 0x3229, 0x0078, 0x4fd3, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e,
- 0x027e, 0x1078, 0x4212, 0x2071, 0x70b6, 0x713c, 0x81ff, 0x0040,
- 0x5006, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x500c, 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x513b, 0x037f, 0x713c, 0x2160, 0x1078, 0x6e4a,
- 0x2009, 0x004a, 0x1078, 0x55fc, 0x0078, 0x5006, 0x027f, 0x017f,
- 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8,
- 0x4ff6, 0x8108, 0x7146, 0x1078, 0x4209, 0x0078, 0x5006, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x70b6, 0x7018, 0x2068,
- 0x8dff, 0x0040, 0x5043, 0x68a0, 0xa406, 0x0040, 0x5033, 0x6854,
- 0x2068, 0x0078, 0x5028, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644,
- 0xa6b4, 0x000f, 0x2d60, 0x1078, 0x359f, 0x0040, 0x5043, 0x1078,
- 0x52d5, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x4b8e, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x147f, 0x157f,
- 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3,
- 0x0200, 0x20a3, 0x0000, 0x20a9, 0x0006, 0x2011, 0x6f40, 0x2019,
- 0x6f41, 0x23a6, 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0,
- 0x5071, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
- 0x4f7a, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x70b6, 0x700c, 0x2060, 0x8cff, 0x0040,
- 0x50a0, 0x1078, 0x6364, 0x00c0, 0x5097, 0x1078, 0x57d2, 0x600c,
- 0x007e, 0x1078, 0x55d5, 0x1078, 0x52d5, 0x0c7f, 0x0078, 0x508e,
- 0x700f, 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f,
- 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e,
- 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140,
- 0x2071, 0x70b6, 0x7024, 0x2060, 0x8cff, 0x0040, 0x50f9, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x4204, 0x2009, 0x0013, 0x1078,
- 0x55fc, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x50dc, 0x6827,
- 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x50ee, 0x7803, 0x1000,
- 0x7803, 0x0000, 0x0078, 0x50ee, 0xd084, 0x0040, 0x50e3, 0x6827,
- 0x0001, 0x0078, 0x50e5, 0x00f0, 0x50cb, 0x7804, 0xa084, 0x1000,
- 0x0040, 0x50ee, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
- 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f,
- 0x007c, 0x2001, 0x6f00, 0x2004, 0xa096, 0x0001, 0x0040, 0x5131,
- 0xa096, 0x0004, 0x0040, 0x5131, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0x20a9, 0x01f4, 0x6824, 0xd094,
- 0x0040, 0x511f, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
- 0x5131, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5131, 0xd084,
- 0x0040, 0x5126, 0x6827, 0x0001, 0x0078, 0x5128, 0x00f0, 0x510e,
- 0x7804, 0xa084, 0x1000, 0x0040, 0x5131, 0x7803, 0x0100, 0x7803,
- 0x0000, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100,
- 0x2079, 0x0140, 0x2071, 0x70b6, 0x703c, 0x2060, 0x8cff, 0x0040,
- 0x5189, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
- 0x4212, 0x1078, 0x1b80, 0xa39d, 0x0000, 0x00c0, 0x5163, 0x2009,
- 0x0049, 0x1078, 0x55fc, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
- 0x5176, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5188,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5188, 0xd094, 0x0040,
- 0x517d, 0x6827, 0x0002, 0x0078, 0x517f, 0x00f0, 0x5165, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5188, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x157f, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069,
- 0x70b6, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
- 0x8000, 0x2069, 0x70b6, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x70b6, 0x7614,
- 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x51e7, 0x601c,
- 0xa206, 0x00c0, 0x51e2, 0x7014, 0xac36, 0x00c0, 0x51c1, 0x660c,
- 0x7616, 0x7010, 0xac36, 0x00c0, 0x51cf, 0x2c00, 0xaf36, 0x0040,
- 0x51cd, 0x2f00, 0x7012, 0x0078, 0x51cf, 0x7013, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x51d8, 0x7e0e, 0x0078, 0x51d9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f,
- 0x0078, 0x51b4, 0x2c78, 0x600c, 0x2060, 0x0078, 0x51b4, 0x127f,
- 0x007f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x5230, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x5230,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078,
- 0x5230, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810,
- 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
- 0x1078, 0x52e0, 0x60c3, 0x0020, 0x1078, 0x4f7a, 0x147f, 0x157f,
- 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120,
- 0xd1b4, 0x00c0, 0x5248, 0xd1bc, 0x00c0, 0x5292, 0x0078, 0x52d2,
- 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
- 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x5289, 0x6020, 0xd0b4, 0x0040, 0x5289, 0x6024, 0xd094,
- 0x00c0, 0x5289, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
- 0x5289, 0x00f0, 0x5255, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
- 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b,
- 0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024,
- 0xd094, 0x00c0, 0x5288, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x527f,
- 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
- 0x0078, 0x52d2, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
- 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x52cb, 0x6020, 0xd0bc, 0x0040, 0x52cb,
- 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x52cb, 0x00f0,
- 0x529f, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
- 0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043,
- 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000,
- 0x00c0, 0x52c5, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
- 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x70b6,
- 0x7020, 0xa005, 0x0040, 0x52de, 0x8001, 0x7022, 0x0e7f, 0x007c,
- 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x52e2, 0x20a2, 0x20a2, 0x007c,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x2039,
- 0x0001, 0x87ff, 0x0040, 0x5378, 0x8cff, 0x0040, 0x5378, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x5373, 0x88ff, 0x0040, 0x530f, 0x2800,
- 0xac06, 0x00c0, 0x5373, 0x2039, 0x0000, 0x0078, 0x5313, 0x6018,
- 0xa206, 0x00c0, 0x5373, 0x7024, 0xac06, 0x00c0, 0x5341, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x533c, 0x6817, 0x0008, 0x68c3,
- 0x0000, 0x1078, 0x5405, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x5331, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5339, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x5341, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x5373, 0x7014, 0xac36, 0x00c0, 0x5347, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x5355, 0x2c00, 0xaf36, 0x0040, 0x5353, 0x2f00,
- 0x7012, 0x0078, 0x5355, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x535e, 0x7e0e, 0x0078, 0x535f, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040, 0x5369, 0x1078,
- 0x6d80, 0x1078, 0x6337, 0x1078, 0x52d5, 0x88ff, 0x00c0, 0x5382,
- 0x0c7f, 0x0078, 0x52f9, 0x2c78, 0x600c, 0x2060, 0x0078, 0x52f9,
- 0xa006, 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
- 0x5379, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6, 0x7638, 0x2660, 0x2678,
- 0x8cff, 0x0040, 0x53f4, 0x601c, 0xa086, 0x0006, 0x00c0, 0x53ef,
- 0x88ff, 0x0040, 0x53a9, 0x2800, 0xac06, 0x00c0, 0x53ef, 0x0078,
- 0x53ad, 0x6018, 0xa206, 0x00c0, 0x53ef, 0x703c, 0xac06, 0x00c0,
- 0x53bf, 0x037e, 0x2019, 0x0001, 0x1078, 0x513b, 0x7033, 0x0000,
- 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038,
- 0xac36, 0x00c0, 0x53c5, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
- 0x53d3, 0x2c00, 0xaf36, 0x0040, 0x53d1, 0x2f00, 0x7036, 0x0078,
- 0x53d3, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
- 0x53dc, 0x7e0e, 0x0078, 0x53dd, 0x2678, 0x600f, 0x0000, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x53e7, 0x1078, 0x6d80, 0x1078,
- 0x6337, 0x88ff, 0x00c0, 0x53fe, 0x0c7f, 0x0078, 0x5398, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5398, 0xa006, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
- 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x53f5, 0x0e7e, 0x2071, 0x70b6,
- 0x2001, 0x6f00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5413, 0x7007,
- 0x0005, 0x0078, 0x5415, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x70b6, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x5455, 0x2200, 0xac06, 0x00c0, 0x5450, 0x7038, 0xac36, 0x00c0,
- 0x5433, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5441, 0x2c00,
- 0xaf36, 0x0040, 0x543f, 0x2f00, 0x7036, 0x0078, 0x5441, 0x7037,
- 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5449, 0x7e0e, 0x0078,
- 0x544a, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5455,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5426, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
- 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x54ee, 0x6018, 0xa080,
- 0x0028, 0x2004, 0xa206, 0x00c0, 0x54e9, 0x7024, 0xac06, 0x00c0,
- 0x549c, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x549c, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5493, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x549b, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x54a2,
- 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x54b0, 0x2c00, 0xaf36,
- 0x0040, 0x54ae, 0x2f00, 0x700a, 0x0078, 0x54b0, 0x700b, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x54b9, 0x7e0e, 0x0078,
- 0x54ba, 0x2678, 0x600f, 0x0000, 0x1078, 0x6350, 0x00c0, 0x54c4,
- 0x1078, 0x21c6, 0x0078, 0x54e0, 0x1078, 0x6364, 0x00c0, 0x54cc,
- 0x1078, 0x57d2, 0x0078, 0x54e0, 0x6010, 0x2068, 0x1078, 0x6216,
- 0x0040, 0x54e0, 0x601c, 0xa086, 0x0003, 0x00c0, 0x54f6, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x6003, 0x0000, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f, 0x0078,
- 0x546b, 0x2c78, 0x600c, 0x2060, 0x0078, 0x546b, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x54d7, 0x1078, 0x6d80, 0x0078, 0x54e0, 0x037e,
- 0x157e, 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c,
- 0xa39e, 0x20a0, 0x00c0, 0x5510, 0x8210, 0x8000, 0x0078, 0x5507,
- 0xa005, 0x0040, 0x551a, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
- 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0200, 0x20a3, 0x0014,
- 0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c,
- 0x20a3, 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004,
- 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x4f7a,
- 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210,
- 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x4f7a, 0x007c, 0x2061,
- 0x7500, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7500, 0x007c, 0x0e7e,
- 0x127e, 0x2071, 0x6f00, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
- 0x0048, 0x55a1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x558d, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5589, 0x0078,
- 0x557c, 0x2061, 0x7500, 0x0078, 0x557c, 0x6003, 0x0008, 0x8529,
- 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x559d, 0x754a,
- 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7500, 0x0078,
- 0x5598, 0xa006, 0x0078, 0x559a, 0x0e7e, 0x2071, 0x6f00, 0x7544,
- 0xa582, 0x0001, 0x0048, 0x55d2, 0x7048, 0x2060, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x55bf, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
- 0x55bb, 0x0078, 0x55ae, 0x2061, 0x7500, 0x0078, 0x55ae, 0x6003,
- 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8,
- 0x55ce, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7500,
- 0x0078, 0x55ca, 0xa006, 0x0078, 0x55cc, 0xac82, 0x7500, 0x1048,
- 0x1288, 0x2001, 0x6f15, 0x2004, 0xac02, 0x10c8, 0x1288, 0xa006,
- 0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
- 0x6003, 0x0000, 0x2061, 0x6f00, 0x6044, 0x8000, 0x6046, 0xa086,
- 0x0001, 0x0040, 0x55f4, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4893, 0x127f, 0x0078, 0x55f3, 0x601c, 0xa084, 0x0007, 0x0079,
- 0x5601, 0x5609, 0x5611, 0x562d, 0x5649, 0x63e1, 0x63fd, 0x6419,
- 0x5609, 0xa18e, 0x0047, 0x00c0, 0x5610, 0xa016, 0x1078, 0x1525,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x561b, 0x067f, 0x007c, 0x562b, 0x56f6, 0x57e1, 0x562b, 0x562b,
- 0x562b, 0x562b, 0x562b, 0x56a5, 0x5a63, 0x562b, 0x562b, 0x562b,
- 0x562b, 0x562b, 0x562b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x5637, 0x067f, 0x007c, 0x5647,
- 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5ed3,
- 0x5f99, 0x5647, 0x5eec, 0x5f45, 0x5eec, 0x5f45, 0x5647, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x5653, 0x067f, 0x007c, 0x5663, 0x5aa1, 0x5b47, 0x5c09, 0x5d5d,
- 0x5663, 0x5663, 0x5663, 0x5a7f, 0x5e88, 0x5e8c, 0x5663, 0x5663,
- 0x5663, 0x5663, 0x5eb2, 0x1078, 0x1288, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5673, 0x0e7e,
- 0x1078, 0x6216, 0x0040, 0x568a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x0d7e, 0x20a9,
- 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0,
- 0x56a2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
- 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x567f, 0x2100, 0xa1b2, 0x0030,
- 0x10c8, 0x1288, 0x0079, 0x56ac, 0x56de, 0x56ea, 0x56de, 0x56de,
- 0x56de, 0x56de, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56de, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56de, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x1078, 0x1288, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x448b, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x448b, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4893, 0x127f, 0x007c, 0x6004, 0xa0b2,
- 0x0030, 0x10c8, 0x1288, 0xa1b6, 0x0013, 0x00c0, 0x5702, 0x2008,
- 0x0079, 0x575a, 0xa1b6, 0x0027, 0x00c0, 0x5740, 0x1078, 0x479a,
- 0x6004, 0x1078, 0x6350, 0x0040, 0x5713, 0x1078, 0x6364, 0x0040,
- 0x573c, 0x0078, 0x5737, 0x1078, 0x21c6, 0x2001, 0x0007, 0x1078,
- 0x3477, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x457b, 0x1078, 0x44be, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x572e, 0x1078, 0x364c, 0x0c7f, 0x2c08,
- 0x1078, 0x6bfe, 0x037f, 0x027f, 0x017f, 0x1078, 0x34b3, 0x1078,
- 0x55d5, 0x1078, 0x4893, 0x007c, 0x1078, 0x57d2, 0x0078, 0x5737,
- 0xa186, 0x0014, 0x00c0, 0x573b, 0x1078, 0x479a, 0x1078, 0x21a8,
- 0x1078, 0x6350, 0x00c0, 0x5750, 0x1078, 0x21c6, 0x0078, 0x5737,
- 0x1078, 0x6364, 0x00c0, 0x5758, 0x1078, 0x57d2, 0x0078, 0x5737,
- 0x0078, 0x5737, 0x578c, 0x578e, 0x5792, 0x5796, 0x579a, 0x579e,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x57a2, 0x57a8, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x57a8, 0x57a8, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x1078, 0x1288, 0x0078, 0x57a8, 0x2001, 0x000b,
- 0x0078, 0x57b1, 0x2001, 0x0003, 0x0078, 0x57b1, 0x2001, 0x0005,
- 0x0078, 0x57b1, 0x2001, 0x0001, 0x0078, 0x57b1, 0x2001, 0x0009,
- 0x0078, 0x57b1, 0x1078, 0x1288, 0x0078, 0x57b0, 0x1078, 0x3477,
- 0x1078, 0x479a, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x4893,
- 0x007c, 0x1078, 0x3477, 0x1078, 0x479a, 0x6003, 0x0002, 0x037e,
- 0x2019, 0x6f5c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x57c3, 0x2019,
- 0x0028, 0x0078, 0x57cc, 0x8007, 0xa09a, 0x0004, 0x0048, 0x57bf,
- 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4893,
- 0x0078, 0x57b0, 0x0e7e, 0x1078, 0x6216, 0x0040, 0x57df, 0x6010,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f,
- 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x1288, 0x6604, 0xa6b6, 0x0028, 0x00c0,
- 0x57f5, 0x1078, 0x6399, 0x0078, 0x581e, 0x6604, 0xa6b6, 0x0029,
- 0x00c0, 0x57fe, 0x1078, 0x63b3, 0x0078, 0x581e, 0x6604, 0xa6b6,
- 0x001f, 0x00c0, 0x5807, 0x1078, 0x5665, 0x0078, 0x581e, 0x6604,
- 0xa6b6, 0x0000, 0x00c0, 0x5810, 0x1078, 0x568e, 0x0078, 0x581e,
- 0xa1b6, 0x0015, 0x00c0, 0x5818, 0x1079, 0x5823, 0x0078, 0x581e,
- 0xa1b6, 0x0016, 0x00c0, 0x581f, 0x1079, 0x58ec, 0x007c, 0x1078,
- 0x5609, 0x0078, 0x581e, 0x582f, 0x5832, 0x582f, 0x5873, 0x582f,
- 0x589b, 0x582f, 0x582f, 0x582f, 0x58c4, 0x582f, 0x58da, 0x0005,
- 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070, 0xa086, 0x0074,
- 0x00c0, 0x585c, 0x1078, 0x6bd6, 0x00c0, 0x584e, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x5860, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x3477,
- 0x1078, 0x21c6, 0x1078, 0x55d5, 0x0078, 0x585e, 0x2001, 0x000a,
- 0x1078, 0x3477, 0x1078, 0x21c6, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x448b, 0x0078, 0x585e, 0x1078, 0x588b, 0x0e7f, 0x007c,
- 0x6800, 0xd084, 0x0040, 0x5872, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2069, 0x6f51, 0x6804, 0xd0a4, 0x0040, 0x5872, 0x2001, 0x0006,
- 0x1078, 0x3485, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0074,
- 0x00c0, 0x5888, 0x1078, 0x59b5, 0x2001, 0x0004, 0x1078, 0x3477,
- 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x448b, 0x0078, 0x588a,
- 0x1078, 0x588b, 0x007c, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003,
- 0x0040, 0x5896, 0x2001, 0x0007, 0x1078, 0x3477, 0x1078, 0x55d5,
- 0x1078, 0x21c6, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x58c0, 0x7000, 0xa086, 0x0003, 0x00c0, 0x58aa,
- 0x1078, 0x2a74, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3547, 0x1078,
- 0x5860, 0x0d7f, 0x1078, 0x59bf, 0x00c0, 0x58c0, 0x2001, 0x0006,
- 0x1078, 0x3477, 0x1078, 0x55d5, 0x1078, 0x21c6, 0x0078, 0x58c2,
- 0x1078, 0x588b, 0x0e7f, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x58d7, 0x2001, 0x0002, 0x1078, 0x3477, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x58d9, 0x1078,
- 0x588b, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x58e9, 0x2001, 0x0007, 0x1078, 0x3477, 0x1078, 0x55d5, 0x0078,
- 0x58eb, 0x1078, 0x588b, 0x007c, 0x582f, 0x58f8, 0x582f, 0x591e,
- 0x582f, 0x596a, 0x582f, 0x582f, 0x582f, 0x597d, 0x582f, 0x5990,
- 0x0c7e, 0x1078, 0x59a3, 0x00c0, 0x590d, 0x2001, 0x0000, 0x1078,
- 0x3463, 0x2001, 0x0002, 0x1078, 0x3477, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x448b, 0x0078, 0x591c, 0x2009, 0x738f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x591a, 0x1078, 0x55d5,
- 0x0078, 0x591c, 0x1078, 0x588b, 0x0c7f, 0x007c, 0x1078, 0x59b2,
- 0x00c0, 0x5932, 0x2001, 0x0000, 0x1078, 0x3463, 0x2001, 0x0002,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b,
- 0x0078, 0x5952, 0x2009, 0x738e, 0x2134, 0xa6b4, 0x00ff, 0xa686,
- 0x0005, 0x0040, 0x5953, 0x2009, 0x738f, 0x2104, 0xa084, 0xff00,
- 0xa086, 0x1900, 0x00c0, 0x5950, 0xa686, 0x0009, 0x0040, 0x5953,
- 0x2001, 0x0004, 0x1078, 0x3477, 0x1078, 0x55d5, 0x0078, 0x5952,
- 0x1078, 0x588b, 0x007c, 0x0d7e, 0x6018, 0x2068, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x5965, 0x8001, 0x6842, 0x6017, 0x000a,
- 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5952, 0x1078, 0x21a8, 0x0d7f,
- 0x0078, 0x5950, 0x1078, 0x59b2, 0x00c0, 0x597a, 0x2001, 0x0004,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x448b,
- 0x0078, 0x597c, 0x1078, 0x588b, 0x007c, 0x1078, 0x59b2, 0x00c0,
- 0x598d, 0x2001, 0x0008, 0x1078, 0x3477, 0x6003, 0x0001, 0x6007,
- 0x0005, 0x1078, 0x448b, 0x0078, 0x598f, 0x1078, 0x588b, 0x007c,
- 0x1078, 0x59b2, 0x00c0, 0x59a0, 0x2001, 0x000a, 0x1078, 0x3477,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x59a2,
- 0x1078, 0x588b, 0x007c, 0x2009, 0x738e, 0x2104, 0xa086, 0x0003,
- 0x00c0, 0x59b1, 0x2009, 0x738f, 0x2104, 0xa084, 0xff00, 0xa086,
- 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88,
- 0x0006, 0x2164, 0x1078, 0x34dd, 0x017f, 0x0c7f, 0x007c, 0x0e7e,
- 0x2071, 0x738c, 0x7004, 0xa086, 0x0014, 0x00c0, 0x59e2, 0x7008,
- 0xa086, 0x0800, 0x00c0, 0x59e2, 0x700c, 0xd0ec, 0x0040, 0x59e0,
- 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59e0, 0x7024, 0xd0a4,
- 0x0040, 0x59e0, 0xd08c, 0x0040, 0x59e0, 0xa006, 0x0078, 0x59e2,
- 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e,
- 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2029,
- 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061, 0x7500, 0x2071,
- 0x6f00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a39, 0x1078, 0x6ddc,
- 0x0040, 0x5a31, 0x671c, 0xa786, 0x0001, 0x0040, 0x5a31, 0xa786,
- 0x0007, 0x0040, 0x5a31, 0x2500, 0xac06, 0x0040, 0x5a31, 0x2400,
- 0xac06, 0x0040, 0x5a31, 0x0c7e, 0x6000, 0xa086, 0x0004, 0x00c0,
- 0x5a1b, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x5a2e, 0xa786, 0x0003, 0x00c0, 0x5a43, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5a39, 0x0078,
- 0x59f9, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, 0x077f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x5a25, 0x1078,
- 0x6d80, 0x0078, 0x5a2e, 0x220c, 0x2304, 0xa106, 0x00c0, 0x5a56,
- 0x8210, 0x8318, 0x00f0, 0x5a4b, 0xa006, 0x007c, 0x2304, 0xa102,
- 0x0048, 0x5a5e, 0x2001, 0x0001, 0x0078, 0x5a60, 0x2001, 0x0000,
- 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288,
- 0x1078, 0x6350, 0x0040, 0x5a72, 0x1078, 0x6364, 0x0040, 0x5a7b,
- 0x0078, 0x5a74, 0x1078, 0x21c6, 0x1078, 0x479a, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x57d2, 0x0078, 0x5a74, 0xa182,
- 0x0040, 0x0079, 0x5a83, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93,
- 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a95, 0x5a95,
- 0x5a95, 0x5a95, 0x5a93, 0x1078, 0x1288, 0x6003, 0x0001, 0x6106,
- 0x1078, 0x443e, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893, 0x127f,
- 0x007c, 0xa186, 0x0013, 0x00c0, 0x5aaa, 0x6004, 0xa082, 0x0040,
- 0x0079, 0x5b20, 0xa186, 0x0027, 0x00c0, 0x5ac7, 0x1078, 0x479a,
- 0x1078, 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6216, 0x0040,
- 0x5ac1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3720, 0x1078,
- 0x632a, 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0xa186,
- 0x0014, 0x00c0, 0x5ad0, 0x6004, 0xa082, 0x0040, 0x0079, 0x5af0,
- 0xa186, 0x0047, 0x10c0, 0x1288, 0x2001, 0x0109, 0x2004, 0xd084,
- 0x0040, 0x5aed, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e,
- 0x1078, 0x42ff, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x5aed, 0x0078, 0x5b47, 0x1078, 0x5609, 0x007c,
- 0x5b02, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00,
- 0x5b00, 0x5b00, 0x5b00, 0x5b19, 0x5b19, 0x5b19, 0x5b19, 0x5b00,
- 0x1078, 0x1288, 0x1078, 0x479a, 0x0d7e, 0x6110, 0x2168, 0x1078,
- 0x6216, 0x0040, 0x5b13, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
- 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4893,
- 0x007c, 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c,
- 0x5b32, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30,
- 0x5b30, 0x5b30, 0x5b30, 0x5b40, 0x5b40, 0x5b40, 0x5b40, 0x5b30,
- 0x1078, 0x1288, 0x1078, 0x479a, 0x6003, 0x0002, 0x1078, 0x4893,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c,
- 0x1078, 0x479a, 0x6003, 0x000f, 0x1078, 0x4893, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x5b4b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b,
- 0x5b5d, 0x5be6, 0x5bfe, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b,
- 0x5b5b, 0x5b5b, 0x5b5b, 0x1078, 0x1288, 0x0e7e, 0x0d7e, 0x2071,
- 0x738c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040,
- 0x5bca, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5b8f, 0xa186,
- 0x0028, 0x00c0, 0x5b79, 0x1078, 0x633e, 0x684b, 0x001c, 0x0078,
- 0x5b91, 0xd6dc, 0x0040, 0x5b84, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5b91, 0xd6d4, 0x0040, 0x5b8f, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5b91, 0x684b,
- 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5ba4,
- 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7398, 0xad90,
- 0x0019, 0x1078, 0x6008, 0x037f, 0xd6cc, 0x0040, 0x5bda, 0x7124,
- 0x695a, 0xa192, 0x0021, 0x00c8, 0x5bb8, 0x2071, 0x7398, 0x831c,
- 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6008, 0x0078, 0x5bda,
- 0x6838, 0xd0fc, 0x0040, 0x5bc1, 0x2009, 0x0020, 0x695a, 0x0078,
- 0x5bad, 0x0f7e, 0x2d78, 0x1078, 0x5fa0, 0x0f7f, 0x1078, 0x5ff5,
- 0x0078, 0x5bdc, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c,
- 0xd0ac, 0x0040, 0x5bda, 0x6810, 0x6914, 0xa115, 0x0040, 0x5bda,
- 0x1078, 0x5d4e, 0x1078, 0x3720, 0x6218, 0x2268, 0x6a3c, 0x8211,
- 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
+ 0xa582, 0x0080, 0x0048, 0x4f7e, 0x2011, 0x0000, 0x629e, 0x6017,
+ 0x0012, 0x0078, 0x4f34, 0xd5bc, 0x0040, 0x4f8e, 0xa185, 0x0700,
+ 0x20a2, 0x6266, 0x636a, 0x646e, 0x0078, 0x4f94, 0x6063, 0x0700,
+ 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
+ 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
+ 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
+ 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
+ 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
+ 0x4fbb, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x4f34,
+ 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202,
+ 0x8217, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6843, 0x0001, 0x0d7f,
+ 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4fdc, 0x1078, 0x4143, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004,
+ 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061,
+ 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f,
+ 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x414c,
+ 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040,
+ 0x503a, 0x1078, 0x4fe5, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e,
+ 0x2061, 0x6f10, 0x6128, 0xa192, 0x0002, 0x00c8, 0x5027, 0x8108,
+ 0x612a, 0x613c, 0x0c7f, 0x81ff, 0x0040, 0x5035, 0x1078, 0x4143,
+ 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x5023, 0x6017,
+ 0x0012, 0x0078, 0x5035, 0x1078, 0x4fdc, 0x0078, 0x5035, 0x6124,
+ 0xa1e5, 0x0000, 0x0040, 0x5032, 0x1078, 0x6c76, 0x2009, 0x0014,
+ 0x1078, 0x5591, 0x0c7f, 0x0078, 0x5035, 0x027f, 0x017f, 0x0d7f,
+ 0x0c7f, 0x007c, 0x1078, 0x31cb, 0x0078, 0x5035, 0x0c7e, 0x0d7e,
+ 0x0e7e, 0x017e, 0x027e, 0x1078, 0x415a, 0x2071, 0x6f10, 0x713c,
+ 0x81ff, 0x0040, 0x5079, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
+ 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x507f, 0x6017, 0x0010,
+ 0x7144, 0xa192, 0x0002, 0x00c8, 0x5071, 0x8108, 0x7146, 0x1078,
+ 0x4151, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x506d, 0x6017, 0x0012, 0x0078, 0x5079, 0x6017, 0x0016, 0x0078,
+ 0x5079, 0x1078, 0x6c76, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078,
+ 0x5079, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x1078,
+ 0x4151, 0x0078, 0x5079, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e,
+ 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0,
+ 0x2071, 0x6f10, 0x7018, 0x2068, 0x8dff, 0x0040, 0x50af, 0x68a0,
+ 0xa406, 0x0040, 0x509f, 0x6854, 0x2068, 0x0078, 0x5094, 0x6010,
+ 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f, 0x2d60, 0x1078,
+ 0x3522, 0x0040, 0x50af, 0x1078, 0x5374, 0xa085, 0x0001, 0x127f,
+ 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x0f00,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008,
+ 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9,
+ 0x0006, 0x2011, 0x6d40, 0x2019, 0x6d40, 0x23a6, 0x22a6, 0xa398,
+ 0x0002, 0xa290, 0x0002, 0x00f0, 0x50dd, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x001c, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c,
+ 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x4ada,
+ 0x1078, 0x4af1, 0x7810, 0x007e, 0xa080, 0x0015, 0x2098, 0x7808,
+ 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004, 0x8003, 0x60c2,
+ 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078, 0x4fd1, 0x027f,
+ 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4a83, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x147f, 0x157f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6f10, 0x700c, 0x2060, 0x8cff, 0x0040, 0x513f, 0x600c, 0x007e,
+ 0x1078, 0x556a, 0x1078, 0x5374, 0x0c7f, 0x0078, 0x5133, 0x700f,
+ 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
+ 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
+ 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+ 0x6f10, 0x7024, 0x2060, 0x8cff, 0x0040, 0x5198, 0x1078, 0x4fe5,
+ 0x68c3, 0x0000, 0x1078, 0x414c, 0x2009, 0x0013, 0x1078, 0x5591,
+ 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x517b, 0x6827, 0x0004,
+ 0x7804, 0xa084, 0x4000, 0x0040, 0x518d, 0x7803, 0x1000, 0x7803,
+ 0x0000, 0x0078, 0x518d, 0xd084, 0x0040, 0x5182, 0x6827, 0x0001,
+ 0x0078, 0x5184, 0x00f0, 0x516a, 0x7804, 0xa084, 0x1000, 0x0040,
+ 0x518d, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
+ 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
+ 0x2001, 0x6d00, 0x2004, 0xa096, 0x0001, 0x0040, 0x51d0, 0xa096,
+ 0x0004, 0x0040, 0x51d0, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
+ 0x318e, 0x1078, 0x40d1, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
+ 0x51be, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x51d0,
+ 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x51d0, 0xd084, 0x0040,
+ 0x51c5, 0x6827, 0x0001, 0x0078, 0x51c7, 0x00f0, 0x51ad, 0x7804,
+ 0xa084, 0x1000, 0x0040, 0x51d0, 0x7803, 0x0100, 0x7803, 0x0000,
+ 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
+ 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
+ 0x0140, 0x2071, 0x6f10, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5228,
+ 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x415a,
+ 0x1078, 0x1a20, 0xa39d, 0x0000, 0x00c0, 0x5202, 0x2009, 0x0049,
+ 0x1078, 0x5591, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5215,
+ 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5227, 0x7803,
+ 0x1000, 0x7803, 0x0000, 0x0078, 0x5227, 0xd094, 0x0040, 0x521c,
+ 0x6827, 0x0002, 0x0078, 0x521e, 0x00f0, 0x5204, 0x7804, 0xa084,
+ 0x1000, 0x0040, 0x5227, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
+ 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
+ 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x6f10,
+ 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
+ 0x2069, 0x6f10, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x6f10, 0x7614, 0x2660,
+ 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5286, 0x601c, 0xa206,
+ 0x00c0, 0x5281, 0x7014, 0xac36, 0x00c0, 0x5260, 0x660c, 0x7616,
+ 0x7010, 0xac36, 0x00c0, 0x526e, 0x2c00, 0xaf36, 0x0040, 0x526c,
+ 0x2f00, 0x7012, 0x0078, 0x526e, 0x7013, 0x0000, 0x660c, 0x067e,
+ 0x2c00, 0xaf06, 0x0040, 0x5277, 0x7e0e, 0x0078, 0x5278, 0x2678,
+ 0x600f, 0x0000, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078,
+ 0x5253, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5253, 0x127f, 0x007f,
+ 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x52cf, 0x157e, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x52cf, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x52cf,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
+ 0x537f, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c,
+ 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
+ 0x00c0, 0x52e7, 0xd1bc, 0x00c0, 0x5331, 0x0078, 0x5371, 0x2009,
+ 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
+ 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x5328, 0x6020, 0xd0b4, 0x0040, 0x5328, 0x6024, 0xd094, 0x00c0,
+ 0x5328, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5328,
+ 0x00f0, 0x52f4, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
+ 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
+ 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
+ 0x00c0, 0x5327, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x531e, 0x027f,
+ 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
+ 0x5371, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
+ 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
+ 0x4000, 0x0040, 0x536a, 0x6020, 0xd0bc, 0x0040, 0x536a, 0x2104,
+ 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x536a, 0x00f0, 0x533e,
+ 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
+ 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
+ 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
+ 0x5364, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
+ 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x6f10, 0x7020,
+ 0xa005, 0x0040, 0x537d, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
+ 0x0008, 0x20a2, 0x00f0, 0x5381, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
+ 0x87ff, 0x0040, 0x5417, 0x8cff, 0x0040, 0x5417, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x5412, 0x88ff, 0x0040, 0x53ae, 0x2800, 0xac06,
+ 0x00c0, 0x5412, 0x2039, 0x0000, 0x0078, 0x53b2, 0x6018, 0xa206,
+ 0x00c0, 0x5412, 0x7024, 0xac06, 0x00c0, 0x53e0, 0x2069, 0x0100,
+ 0x68c0, 0xa005, 0x0040, 0x53db, 0x6817, 0x0008, 0x68c3, 0x0000,
+ 0x1078, 0x54a4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
+ 0xa384, 0x1000, 0x0040, 0x53d0, 0x6803, 0x0100, 0x6803, 0x0000,
+ 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x53d8, 0x6827, 0x0001,
+ 0x037f, 0x0078, 0x53e0, 0x6003, 0x0009, 0x630a, 0x0078, 0x5412,
+ 0x7014, 0xac36, 0x00c0, 0x53e6, 0x660c, 0x7616, 0x7010, 0xac36,
+ 0x00c0, 0x53f4, 0x2c00, 0xaf36, 0x0040, 0x53f2, 0x2f00, 0x7012,
+ 0x0078, 0x53f4, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+ 0x0040, 0x53fd, 0x7e0e, 0x0078, 0x53fe, 0x2678, 0x600f, 0x0000,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5408, 0x1078, 0x6bb3,
+ 0x1078, 0x6283, 0x1078, 0x5374, 0x88ff, 0x00c0, 0x5421, 0x0c7f,
+ 0x0078, 0x5398, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5398, 0xa006,
+ 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5418,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x5493, 0x601c, 0xa086, 0x0006, 0x00c0, 0x548e, 0x88ff,
+ 0x0040, 0x5448, 0x2800, 0xac06, 0x00c0, 0x548e, 0x0078, 0x544c,
+ 0x6018, 0xa206, 0x00c0, 0x548e, 0x703c, 0xac06, 0x00c0, 0x545e,
+ 0x037e, 0x2019, 0x0001, 0x1078, 0x51da, 0x7033, 0x0000, 0x703f,
+ 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
+ 0x00c0, 0x5464, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5472,
+ 0x2c00, 0xaf36, 0x0040, 0x5470, 0x2f00, 0x7036, 0x0078, 0x5472,
+ 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x547b,
+ 0x7e0e, 0x0078, 0x547c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x5486, 0x1078, 0x6bb3, 0x1078, 0x6283,
+ 0x88ff, 0x00c0, 0x549d, 0x0c7f, 0x0078, 0x5437, 0x2c78, 0x600c,
+ 0x2060, 0x0078, 0x5437, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
+ 0xa8c5, 0x0001, 0x0078, 0x5494, 0x0e7e, 0x2071, 0x6f10, 0x2001,
+ 0x6d00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x54b2, 0x7007, 0x0005,
+ 0x0078, 0x54b4, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6f10, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x54f4,
+ 0x2200, 0xac06, 0x00c0, 0x54ef, 0x7038, 0xac36, 0x00c0, 0x54d2,
+ 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x54e0, 0x2c00, 0xaf36,
+ 0x0040, 0x54de, 0x2f00, 0x7036, 0x0078, 0x54e0, 0x7037, 0x0000,
+ 0x660c, 0x2c00, 0xaf06, 0x0040, 0x54e8, 0x7e0e, 0x0078, 0x54e9,
+ 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x54f4, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x54c5, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x2061, 0x7400, 0x2a70, 0x7060,
+ 0x7046, 0x704b, 0x7400, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x6d00,
+ 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x5536, 0x7048,
+ 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5522, 0xace0, 0x0008,
+ 0x7054, 0xac02, 0x00c8, 0x551e, 0x0078, 0x5511, 0x2061, 0x7400,
+ 0x0078, 0x5511, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008,
+ 0x7054, 0xa502, 0x00c8, 0x5532, 0x754a, 0xa085, 0x0001, 0x127f,
+ 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x552d, 0xa006, 0x0078,
+ 0x552f, 0x0e7e, 0x2071, 0x6d00, 0x7544, 0xa582, 0x0001, 0x0048,
+ 0x5567, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5554,
+ 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5550, 0x0078, 0x5543,
+ 0x2061, 0x7400, 0x0078, 0x5543, 0x6003, 0x0008, 0x8529, 0x7546,
+ 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5563, 0x754a, 0xa085,
+ 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x555f, 0xa006,
+ 0x0078, 0x5561, 0xac82, 0x7400, 0x1048, 0x12b7, 0x2001, 0x6d15,
+ 0x2004, 0xac02, 0x10c8, 0x12b7, 0xa006, 0x6006, 0x600a, 0x600e,
+ 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x2061,
+ 0x6d00, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x5589,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x0078,
+ 0x5588, 0x601c, 0xa084, 0x000f, 0x0079, 0x5596, 0x559f, 0x55a7,
+ 0x55c3, 0x55df, 0x629a, 0x62b6, 0x62d2, 0x559f, 0x55a7, 0xa18e,
+ 0x0047, 0x00c0, 0x55a6, 0xa016, 0x1078, 0x1532, 0x007c, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55b1, 0x067f,
+ 0x007c, 0x55c1, 0x5698, 0x5792, 0x55c1, 0x57d7, 0x55c1, 0x55c1,
+ 0x55c1, 0x5653, 0x5a4d, 0x55c1, 0x55c1, 0x55c1, 0x55c1, 0x55c1,
+ 0x55c1, 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+ 0x12b7, 0x1079, 0x55cd, 0x067f, 0x007c, 0x55dd, 0x55dd, 0x55dd,
+ 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x5e10, 0x5edd, 0x55dd,
+ 0x5e29, 0x5e8f, 0x5e29, 0x5e8f, 0x55dd, 0x1078, 0x12b7, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55e9, 0x067f,
+ 0x007c, 0x55f9, 0x5a96, 0x5b05, 0x5bbb, 0x5cd2, 0x55f9, 0x55f9,
+ 0x55f9, 0x5a75, 0x5dc6, 0x5dca, 0x55f9, 0x55f9, 0x55f9, 0x55f9,
+ 0x5df0, 0x1078, 0x12b7, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
+ 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398, 0x94a0, 0x3318,
+ 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8, 0x0002, 0xa398,
+ 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5609, 0x0e7e, 0x6010, 0x2070,
+ 0x7007, 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x0d7e, 0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x562d, 0x6018,
+ 0x2068, 0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040,
+ 0x5637, 0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078,
+ 0x556a, 0x037f, 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98,
+ 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5650, 0x6018,
+ 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802,
+ 0x0d7f, 0x0078, 0x5615, 0x2100, 0xa1b2, 0x0024, 0x10c8, 0x12b7,
+ 0x0079, 0x565a, 0x5680, 0x568c, 0x5680, 0x5680, 0x5680, 0x5680,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x5680, 0x567e, 0x5680, 0x5680, 0x567e, 0x1078, 0x12b7,
+ 0x6003, 0x0001, 0x6106, 0x1078, 0x4376, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x476a, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x4376, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c,
+ 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7, 0xa1b6, 0x0013, 0x00c0,
+ 0x56a4, 0x2008, 0x0079, 0x5706, 0xa1b6, 0x0014, 0x00c0, 0x56fd,
+ 0x1078, 0x4671, 0x6004, 0xa08e, 0x0000, 0x0040, 0x56fe, 0xa08e,
+ 0x0002, 0x0040, 0x56c9, 0xa08e, 0x0003, 0x0040, 0x56c9, 0xa08e,
+ 0x0004, 0x0040, 0x56c9, 0xa08e, 0x001f, 0x0040, 0x56fe, 0xa08e,
+ 0x0021, 0x0040, 0x5702, 0xa08e, 0x0022, 0x0040, 0x56fe, 0x0078,
+ 0x56f9, 0x1078, 0x206f, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018,
+ 0xa080, 0x0028, 0x200c, 0x1078, 0x5778, 0xa186, 0x007e, 0x00c0,
+ 0x56df, 0x2001, 0x6d2f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e,
+ 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, 0x445c, 0x1078,
+ 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x56f0, 0x1078, 0x35cf,
+ 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f, 0x017f, 0x1078,
+ 0x342f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x5778,
+ 0x0078, 0x56f9, 0x1078, 0x5786, 0x0078, 0x56f9, 0x572c, 0x572e,
+ 0x5732, 0x5736, 0x573a, 0x573e, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x5742, 0x5748, 0x572a, 0x5752,
+ 0x5748, 0x572a, 0x1078, 0x12b7, 0x0078, 0x5748, 0x2001, 0x000b,
+ 0x0078, 0x575b, 0x2001, 0x0003, 0x0078, 0x575b, 0x2001, 0x0005,
+ 0x0078, 0x575b, 0x2001, 0x0001, 0x0078, 0x575b, 0x2001, 0x0009,
+ 0x0078, 0x575b, 0x1078, 0x12b7, 0x0078, 0x575a, 0x1078, 0x33f3,
+ 0x1078, 0x4671, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x476a,
+ 0x0078, 0x575a, 0x1078, 0x4671, 0x6003, 0x0004, 0x6017, 0x0028,
+ 0x1078, 0x476a, 0x007c, 0x1078, 0x33f3, 0x1078, 0x4671, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6d5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x576d, 0x2019, 0x0028, 0x0078, 0x5772, 0x8007, 0x8003, 0x801b,
+ 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x476a, 0x0078, 0x575a,
+ 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5784, 0x2070, 0x7007, 0x0000,
+ 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c, 0x0e7e, 0xacf0,
+ 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023, 0x8001,
+ 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff,
+ 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7, 0x6604, 0xa6b6, 0x001f,
+ 0x00c0, 0x57a6, 0x1078, 0x55fb, 0x0078, 0x57c6, 0x6604, 0xa6b6,
+ 0x0000, 0x00c0, 0x57af, 0x1078, 0x563c, 0x0078, 0x57c6, 0x6604,
+ 0xa6b6, 0x0022, 0x00c0, 0x57b8, 0x1078, 0x5620, 0x0078, 0x57c6,
+ 0xa1b6, 0x0015, 0x00c0, 0x57c0, 0x1079, 0x57cb, 0x0078, 0x57c6,
+ 0xa1b6, 0x0016, 0x00c0, 0x57c7, 0x1079, 0x58f6, 0x007c, 0x1078,
+ 0x559f, 0x0078, 0x57c6, 0x57ef, 0x57f2, 0x57ef, 0x5833, 0x57ef,
+ 0x5892, 0x57ef, 0x57ef, 0x57ef, 0x58ce, 0x57ef, 0x58e4, 0xa1b6,
+ 0x0048, 0x0040, 0x57e3, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1532, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000,
+ 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c, 0x0005,
+ 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0074,
+ 0x00c0, 0x581c, 0x1078, 0x6a2b, 0x00c0, 0x580e, 0x0d7e, 0x6018,
+ 0x2068, 0x1078, 0x5820, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x33f3,
+ 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x581e, 0x2001, 0x000a,
+ 0x1078, 0x33f3, 0x1078, 0x206f, 0x6003, 0x0001, 0x6007, 0x0001,
+ 0x1078, 0x4376, 0x0078, 0x581e, 0x1078, 0x5889, 0x0e7f, 0x007c,
+ 0x6800, 0xd084, 0x0040, 0x5832, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2069, 0x6d51, 0x6804, 0xd0a4, 0x0040, 0x5832, 0x2001, 0x0006,
+ 0x1078, 0x3401, 0x007c, 0x0d7e, 0x2011, 0x6d1e, 0x2204, 0xa086,
+ 0x0074, 0x00c0, 0x5885, 0x1078, 0x599f, 0x6018, 0x2068, 0xa080,
+ 0x0028, 0x2014, 0xa286, 0x007e, 0x0040, 0x5850, 0xa286, 0x0080,
+ 0x00c0, 0x5879, 0x6813, 0x00ff, 0x6817, 0xfffc, 0x0078, 0x586f,
+ 0x0e7e, 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x6d2f,
+ 0x2e04, 0xa085, 0x0003, 0x2072, 0x2071, 0x7280, 0x2079, 0x0100,
+ 0x2e04, 0xa084, 0x00ff, 0x2069, 0x6d19, 0x206a, 0x78e6, 0x8e70,
+ 0x2e04, 0x2069, 0x6d1a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001,
+ 0x0006, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078,
+ 0x5887, 0x2001, 0x0004, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007,
+ 0x0003, 0x1078, 0x4376, 0x0078, 0x5887, 0x1078, 0x5889, 0x0d7f,
+ 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078,
+ 0x556a, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0014,
+ 0x00c0, 0x58c8, 0x7000, 0xa086, 0x0003, 0x00c0, 0x58a5, 0x6010,
+ 0xa005, 0x00c0, 0x58a5, 0x1078, 0x2ad1, 0x0d7e, 0x6018, 0x2068,
+ 0x1078, 0x34ca, 0x1078, 0x5820, 0x0d7f, 0x1078, 0x59a9, 0x00c0,
+ 0x58c8, 0x2001, 0x0006, 0x1078, 0x33f3, 0x0e7e, 0x6010, 0xa005,
+ 0x0040, 0x58c1, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0200, 0x0e7f, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x58cc,
+ 0x1078, 0x5778, 0x1078, 0x5889, 0x0e7f, 0x007c, 0x2011, 0x6d1e,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x58e1, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078,
+ 0x58e3, 0x1078, 0x5889, 0x007c, 0x2011, 0x6d1e, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x58f3, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078,
+ 0x556a, 0x0078, 0x58f5, 0x1078, 0x5889, 0x007c, 0x57ef, 0x5902,
+ 0x57ef, 0x5928, 0x57ef, 0x5952, 0x57ef, 0x57ef, 0x57ef, 0x5967,
+ 0x57ef, 0x597a, 0x0c7e, 0x1078, 0x598d, 0x00c0, 0x5917, 0x2001,
+ 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x0078, 0x5926, 0x2009,
+ 0x728f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5924,
+ 0x1078, 0x556a, 0x0078, 0x5926, 0x1078, 0x5889, 0x0c7f, 0x007c,
+ 0x1078, 0x599c, 0x00c0, 0x593c, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4376, 0x0078, 0x5951, 0x1078, 0x5778, 0x2009, 0x728f,
+ 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x594f, 0x2001,
+ 0x0004, 0x1078, 0x33f3, 0x1078, 0x556a, 0x0078, 0x5951, 0x1078,
+ 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x5962, 0x2001, 0x0004,
+ 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4376,
+ 0x0078, 0x5966, 0x1078, 0x5778, 0x1078, 0x5889, 0x007c, 0x1078,
+ 0x599c, 0x00c0, 0x5977, 0x2001, 0x0008, 0x1078, 0x33f3, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4376, 0x0078, 0x5979, 0x1078,
+ 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x598a, 0x2001, 0x000a,
+ 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376,
+ 0x0078, 0x598c, 0x1078, 0x5889, 0x007c, 0x2009, 0x728e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x599b, 0x2009, 0x728f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x3459, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x728c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x59cc, 0x7008, 0xa086, 0x0800, 0x00c0, 0x59cc, 0x700c, 0xd0ec,
+ 0x0040, 0x59ca, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59ca,
+ 0x7024, 0xd0a4, 0x0040, 0x59ca, 0xd08c, 0x0040, 0x59ca, 0xa006,
+ 0x0078, 0x59cc, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a23,
+ 0x1078, 0x6c0f, 0x0040, 0x5a1b, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x5a1b, 0xa786, 0x0007, 0x0040, 0x5a1b, 0x2500, 0xac06, 0x0040,
+ 0x5a1b, 0x2400, 0xac06, 0x0040, 0x5a1b, 0x0c7e, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x5a11, 0xa786, 0x0003, 0x00c0, 0x5a2d,
+ 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078,
+ 0x6276, 0x6000, 0xa086, 0x0004, 0x00c0, 0x5a18, 0x1078, 0x15f2,
+ 0x1078, 0x6283, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x5a23, 0x0078, 0x59e3, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x5a08, 0x1078, 0x6bb3, 0x0078, 0x5a11, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5a40, 0x8210, 0x8318, 0x00f0, 0x5a35, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x5a48, 0x2001, 0x0001, 0x0078, 0x5a4a,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0024,
+ 0x10c8, 0x12b7, 0xa08e, 0x0000, 0x0040, 0x5a71, 0xa08e, 0x0002,
+ 0x0040, 0x5a68, 0xa08e, 0x0003, 0x0040, 0x5a68, 0xa08e, 0x0004,
+ 0x0040, 0x5a68, 0xa08e, 0x001f, 0x0040, 0x5a71, 0x0078, 0x5a6a,
+ 0x1078, 0x206f, 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a,
+ 0x007c, 0x1078, 0x5778, 0x0078, 0x5a6a, 0xa182, 0x0040, 0x0079,
+ 0x5a79, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88,
+ 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a8a, 0x5a8a, 0x5a8a, 0x5a8a,
+ 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0xa186, 0x0013,
+ 0x00c0, 0x5a9f, 0x6004, 0xa082, 0x0040, 0x0079, 0x5adf, 0xa186,
+ 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x0079, 0x5aa8,
+ 0x5ab9, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7,
+ 0x5ab7, 0x5ab7, 0x5ab7, 0x5ad4, 0x5ad4, 0x5ad4, 0x5ad4, 0x1078,
+ 0x12b7, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x4671, 0x0d7e,
+ 0x6110, 0x2168, 0x1078, 0x6120, 0x0040, 0x5ace, 0x6837, 0x0103,
+ 0x684b, 0x0028, 0x1078, 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x1078,
+ 0x556a, 0x1078, 0x476a, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3,
+ 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x5af0,
+ 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee,
+ 0x5aee, 0x5aee, 0x5afe, 0x5afe, 0x5afe, 0x5afe, 0x1078, 0x12b7,
+ 0x1078, 0x4671, 0x6003, 0x0002, 0x1078, 0x476a, 0x6010, 0xa088,
+ 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4671,
+ 0x6003, 0x000f, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x5b09, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b1a, 0x5b98,
+ 0x5bb0, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18,
+ 0x1078, 0x12b7, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2168,
+ 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x5b87, 0xa68c, 0x00ff,
+ 0xa186, 0x0002, 0x0040, 0x5b4c, 0xa186, 0x0028, 0x00c0, 0x5b36,
+ 0x1078, 0x628a, 0x684b, 0x001c, 0x0078, 0x5b4e, 0xd6dc, 0x0040,
+ 0x5b41, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5b4e, 0xd6d4, 0x0040, 0x5b4c, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5b4e, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5b61, 0x7328, 0x732c, 0x6b56,
+ 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078, 0x5f4c,
+ 0x037f, 0xd6cc, 0x0040, 0x5b8c, 0x7124, 0x695a, 0xa192, 0x0021,
+ 0x00c8, 0x5b75, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18, 0xad90,
+ 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5b8c, 0x6838, 0xd0fc, 0x0040,
+ 0x5b7e, 0x2009, 0x0020, 0x695a, 0x0078, 0x5b6a, 0x0f7e, 0x2d78,
+ 0x1078, 0x5ee4, 0x0f7f, 0x1078, 0x5f39, 0x0078, 0x5b8e, 0x684b,
+ 0x0000, 0x6837, 0x0103, 0x6e46, 0x1078, 0x36a1, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x17de, 0x1078, 0x4395, 0x1078, 0x4821, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x5bbf, 0x5bce,
+ 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x5bd0, 0x5c5e, 0x5bce, 0x5bce,
+ 0x5c74, 0x5cb4, 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x1078, 0x12b7,
+ 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178,
+ 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218,
+ 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5c59, 0xa694,
+ 0xff00, 0xa284, 0x0c00, 0x0040, 0x5bf1, 0x7018, 0x7862, 0x701c,
+ 0x785e, 0xa284, 0x0300, 0x0040, 0x5c59, 0x1078, 0x130f, 0x1040,
+ 0x12b7, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103,
+ 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
+ 0x00ff, 0xa186, 0x0002, 0x0040, 0x5c2b, 0xa186, 0x0028, 0x00c0,
+ 0x5c15, 0x684b, 0x001c, 0x0078, 0x5c2d, 0xd6dc, 0x0040, 0x5c20,
+ 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5c2d,
+ 0xd6d4, 0x0040, 0x5c2b, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5c2d, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
+ 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c42, 0x7328, 0x732c,
+ 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078,
+ 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5c59, 0x7124, 0x695a, 0xa192,
+ 0x0021, 0x00c8, 0x5c56, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18,
+ 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5c59, 0x2d78, 0x1078,
+ 0x5ee4, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
+ 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x44aa, 0x1078, 0x4943, 0x007c, 0x6003, 0x0004,
- 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x5c0d, 0x5c1d, 0x5c1d, 0x5c1d,
- 0x5c1d, 0x5c1d, 0x5c1f, 0x5cb6, 0x5c1d, 0x5c1d, 0x5ccc, 0x5d2e,
- 0x5c1d, 0x5c1d, 0x5c1d, 0x5c1d, 0x5d35, 0x1078, 0x1288, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2178, 0x7614,
+ 0x17de, 0x1078, 0x4fca, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
+ 0x4719, 0x1078, 0x4821, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
+ 0x5cb2, 0xd1cc, 0x0040, 0x5c8d, 0x6948, 0x017e, 0x1078, 0x1338,
+ 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5cb0, 0x6837, 0x0103, 0x6944,
+ 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5cac, 0xa086, 0x0028,
+ 0x00c0, 0x5c9e, 0x684b, 0x001c, 0x0078, 0x5cae, 0xd1dc, 0x0040,
+ 0x5ca5, 0x684b, 0x0015, 0x0078, 0x5cae, 0xd1d4, 0x0040, 0x5cac,
+ 0x684b, 0x0007, 0x0078, 0x5cae, 0x684b, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x556a, 0x0d7f, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3,
+ 0x1078, 0x4719, 0x0f7e, 0x0d7e, 0x6110, 0x2178, 0x1078, 0x6120,
+ 0x0040, 0x5ccb, 0x7837, 0x0103, 0x784b, 0x0028, 0x2f68, 0x1078,
+ 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x0f7f, 0x1078, 0x556a, 0x1078,
+ 0x4821, 0x007c, 0xa182, 0x0040, 0x0079, 0x5cd6, 0x5ce5, 0x5ce5,
+ 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce7, 0x5ce5, 0x5d82, 0x5d8a, 0x5ce5,
+ 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x1078, 0x12b7, 0x077e,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178, 0x7614,
0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5cb1, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x5c40, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x5cb1, 0x1078, 0x12e2, 0x1040, 0x1288,
- 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838,
- 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x5c7a, 0xa186, 0x0028, 0x00c0, 0x5c64,
- 0x684b, 0x001c, 0x0078, 0x5c7c, 0xd6dc, 0x0040, 0x5c6f, 0x684b,
- 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5c7c, 0xd6d4,
- 0x0040, 0x5c7a, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e,
- 0x0078, 0x5c7c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
- 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c91, 0x7328, 0x732c, 0x6b56,
- 0x037e, 0x2308, 0x2019, 0x7398, 0xad90, 0x0019, 0x1078, 0x6008,
- 0x037f, 0xd6cc, 0x0040, 0x5cb1, 0x7124, 0x695a, 0xa192, 0x0021,
- 0x00c8, 0x5ca5, 0x2071, 0x7398, 0x831c, 0x2300, 0xae18, 0xad90,
- 0x001d, 0x1078, 0x6008, 0x0078, 0x5cb1, 0x7838, 0xd0fc, 0x0040,
- 0x5cae, 0x2009, 0x0020, 0x695a, 0x0078, 0x5c9a, 0x2d78, 0x1078,
- 0x5fa0, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x4f73, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
- 0x4842, 0x1078, 0x4943, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
- 0x5d2c, 0xd1cc, 0x0040, 0x5d07, 0x6948, 0x6838, 0xd0fc, 0x0040,
- 0x5cff, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d,
- 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012,
- 0x8318, 0x8210, 0x00f0, 0x5cee, 0x157f, 0x007f, 0x6852, 0x007f,
- 0x684e, 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5d2a, 0x017e,
- 0x1078, 0x130b, 0x0d7f, 0x1078, 0x5ff5, 0x0078, 0x5d2a, 0x6837,
- 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5d26,
- 0xa086, 0x0028, 0x00c0, 0x5d18, 0x684b, 0x001c, 0x0078, 0x5d28,
- 0xd1dc, 0x0040, 0x5d1f, 0x684b, 0x0015, 0x0078, 0x5d28, 0xd1d4,
- 0x0040, 0x5d26, 0x684b, 0x0007, 0x0078, 0x5d28, 0x684b, 0x0000,
- 0x1078, 0x3720, 0x1078, 0x55d5, 0x0d7f, 0x007c, 0x6003, 0x0002,
- 0x1078, 0x4842, 0x1078, 0x4943, 0x007c, 0x1078, 0x4842, 0x1078,
- 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6216, 0x0040, 0x5d48,
- 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4943, 0x007c, 0x684b, 0x0015,
- 0xd1fc, 0x0040, 0x5d5a, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a,
- 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x5d61, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d73, 0x5d71,
- 0x5e17, 0x5e1f, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71,
- 0x5d71, 0x1078, 0x1288, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x738c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x5e09, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5d94,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5e06,
- 0x1078, 0x12e2, 0x1040, 0x1288, 0x2d00, 0x784a, 0x7f4c, 0xa7bd,
- 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e,
- 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
- 0x5dcf, 0xa186, 0x0028, 0x00c0, 0x5db9, 0x684b, 0x001c, 0x0078,
- 0x5dd1, 0xd6dc, 0x0040, 0x5dc4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5dd1, 0xd6d4, 0x0040, 0x5dcf, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5dd1, 0x684b,
- 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4,
- 0x0040, 0x5de6, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
- 0x7398, 0xad90, 0x0019, 0x1078, 0x6008, 0x037f, 0xd6cc, 0x0040,
- 0x5e06, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5dfa, 0x2071,
- 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6008,
- 0x0078, 0x5e06, 0x7838, 0xd0fc, 0x0040, 0x5e03, 0x2009, 0x0020,
- 0x695a, 0x0078, 0x5def, 0x2d78, 0x1078, 0x5fa0, 0xd6dc, 0x00c0,
- 0x5e0c, 0xa006, 0x0078, 0x5e10, 0x2001, 0x0001, 0x7218, 0x731c,
- 0x1078, 0x1569, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0x0d7e,
- 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5e86,
- 0xd1cc, 0x0040, 0x5e56, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x5e4e,
- 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198,
- 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x5e3d, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e,
- 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5e84, 0x017e, 0x1078,
- 0x130b, 0x0d7f, 0x1078, 0x5ff5, 0x0078, 0x5e84, 0x6837, 0x0103,
- 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5e75, 0xa086,
- 0x0028, 0x00c0, 0x5e67, 0x684b, 0x001c, 0x0078, 0x5e82, 0xd1dc,
- 0x0040, 0x5e6e, 0x684b, 0x0015, 0x0078, 0x5e82, 0xd1d4, 0x0040,
- 0x5e75, 0x684b, 0x0007, 0x0078, 0x5e82, 0x684b, 0x0000, 0x684c,
- 0xd0ac, 0x0040, 0x5e82, 0x6810, 0x6914, 0xa115, 0x0040, 0x5e82,
- 0x1078, 0x5d4e, 0x1078, 0x3720, 0x1078, 0x55d5, 0x0d7f, 0x007c,
- 0x1078, 0x479a, 0x0078, 0x5e8e, 0x1078, 0x4842, 0x1078, 0x6216,
- 0x0040, 0x5ea5, 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009,
- 0x6f0c, 0x210c, 0xd18c, 0x00c0, 0x5eae, 0xd184, 0x00c0, 0x5eaa,
- 0x6108, 0x694a, 0x1078, 0x3720, 0x0d7f, 0x1078, 0x55d5, 0x1078,
- 0x4893, 0x007c, 0x684b, 0x0004, 0x0078, 0x5ea2, 0x684b, 0x0004,
- 0x0078, 0x5ea2, 0xa182, 0x0040, 0x0079, 0x5eb6, 0x5ec6, 0x5ec6,
- 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec8, 0x5ec6, 0x5ecb, 0x5ec6, 0x5ec6,
- 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x1078, 0x1288,
- 0x1078, 0x55d5, 0x007c, 0x007e, 0x027e, 0xa016, 0x1078, 0x1525,
- 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, 0x5ed7, 0x5ee0,
- 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x1078, 0x1288,
- 0x6003, 0x0001, 0x6106, 0x1078, 0x443e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x4893, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x5ef6,
- 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x5f2a, 0xa186, 0x0027,
- 0x00c0, 0x5f17, 0x1078, 0x479a, 0x1078, 0x21a8, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x5f0d, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x5609, 0x0078, 0x5f12, 0xa186,
- 0x0014, 0x00c0, 0x5f13, 0x1078, 0x479a, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x5f0d, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x0078, 0x5f09, 0x5f33, 0x5f31, 0x5f31, 0x5f31, 0x5f31, 0x5f31,
- 0x5f3c, 0x1078, 0x1288, 0x1078, 0x479a, 0x6017, 0x0014, 0x6003,
- 0x000c, 0x1078, 0x4893, 0x007c, 0x1078, 0x479a, 0x6017, 0x0014,
- 0x6003, 0x000e, 0x1078, 0x4893, 0x007c, 0xa182, 0x008c, 0x00c8,
- 0x5f4f, 0xa182, 0x0085, 0x0048, 0x5f4f, 0x0079, 0x5f52, 0x1078,
- 0x5609, 0x007c, 0x5f59, 0x5f59, 0x5f59, 0x5f59, 0x5f5b, 0x5f7a,
- 0x5f59, 0x1078, 0x1288, 0x0d7e, 0x1078, 0x632a, 0x1078, 0x6216,
- 0x0040, 0x5f76, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4,
- 0x0040, 0x5f6e, 0x684b, 0x0006, 0x0078, 0x5f72, 0x684b, 0x0005,
- 0x1078, 0x63dd, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x55d5,
- 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x5f95, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x5f8b, 0x684b,
- 0x0006, 0x0078, 0x5f8f, 0x684b, 0x0005, 0x1078, 0x63dd, 0x6847,
- 0x0000, 0x1078, 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5,
- 0x007c, 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c,
- 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, 0x0101,
- 0x00c8, 0x5fac, 0x0078, 0x5fae, 0x2009, 0x0100, 0x2130, 0x2069,
- 0x7398, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d,
- 0x1078, 0x6008, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, 0x5fc2,
- 0x1078, 0x130b, 0x1078, 0x12e2, 0x0040, 0x5fec, 0x8528, 0x6837,
- 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x00c8,
- 0x5fd8, 0x2608, 0xad90, 0x000f, 0x1078, 0x6008, 0x0078, 0x5fec,
- 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, 0x1078,
- 0x6008, 0x0078, 0x5fc2, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36,
- 0xa5ac, 0x0000, 0x0078, 0x5ff1, 0x0f7f, 0x852f, 0xa5ad, 0x0003,
- 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, 0x0040,
- 0x6006, 0x6804, 0xa07d, 0x0040, 0x6004, 0x6807, 0x0000, 0x1078,
- 0x3720, 0x2f68, 0x0078, 0x5ff9, 0x1078, 0x3720, 0x0f7f, 0x007c,
- 0x157e, 0xa184, 0x0001, 0x0040, 0x600e, 0x8108, 0x810c, 0x21a8,
- 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6010, 0x157f,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6023, 0x127f, 0x007c, 0x6032, 0x602b, 0x602d, 0x604b, 0x602b,
- 0x602d, 0x602d, 0x602d, 0x1078, 0x1288, 0xa006, 0x007c, 0xa085,
- 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x6048, 0xa00e, 0x2001, 0x0005, 0x1078, 0x37b0, 0x1078, 0x63dd,
- 0x1078, 0x3720, 0x1078, 0x55d5, 0xa085, 0x0001, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x6046, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288,
- 0x1079, 0x6053, 0x007c, 0x6063, 0x6080, 0x6065, 0x6091, 0x607c,
- 0x6063, 0x602d, 0x6032, 0x6032, 0x602d, 0x602d, 0x602d, 0x602d,
- 0x602d, 0x602d, 0x602d, 0x1078, 0x1288, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x606e, 0x1078, 0x63dd, 0x0d7f, 0x6007,
- 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x443e, 0x1078,
- 0x4893, 0xa085, 0x0001, 0x007c, 0x1078, 0x1629, 0x0078, 0x6065,
- 0x0e7e, 0x2071, 0x70b6, 0x7024, 0xac06, 0x00c0, 0x6089, 0x1078,
- 0x50a9, 0x1078, 0x5017, 0x0e7f, 0x00c0, 0x6065, 0x1078, 0x602d,
- 0x007c, 0x037e, 0x0e7e, 0x2071, 0x70b6, 0x703c, 0xac06, 0x00c0,
- 0x60a1, 0x2019, 0x0000, 0x1078, 0x513b, 0x0e7f, 0x037f, 0x0078,
- 0x6065, 0x1078, 0x5417, 0x0e7f, 0x037f, 0x00c0, 0x6065, 0x1078,
- 0x602d, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x60b2,
- 0x0c7f, 0x007c, 0x60c0, 0x611d, 0x61ba, 0x60c4, 0x60c0, 0x60c0,
- 0x6a64, 0x55d5, 0x1078, 0x6364, 0x00c0, 0x60c0, 0x1078, 0x57d2,
- 0x007c, 0x6017, 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8,
- 0x1288, 0x1079, 0x60cc, 0x007c, 0x60dc, 0x60de, 0x60fe, 0x6110,
- 0x6110, 0x60dc, 0x60c0, 0x60c0, 0x60c0, 0x6110, 0x6110, 0x60dc,
- 0x60dc, 0x60dc, 0x60dc, 0x611a, 0x1078, 0x1288, 0x0e7e, 0x6010,
- 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0x70b6, 0x7024, 0xac06,
- 0x0040, 0x60fa, 0x1078, 0x5017, 0x6007, 0x0085, 0x6003, 0x000b,
- 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x443e, 0x1078, 0x4893,
- 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x60f8, 0x0d7e, 0x6010,
- 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003,
- 0x000b, 0x601f, 0x0002, 0x1078, 0x443e, 0x1078, 0x4893, 0x007c,
- 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852,
- 0x0d7f, 0x007c, 0x1078, 0x55d5, 0x007c, 0x6000, 0xa08a, 0x0010,
- 0x10c8, 0x1288, 0x1079, 0x6125, 0x007c, 0x6135, 0x60c1, 0x6137,
- 0x6135, 0x6135, 0x6135, 0x6135, 0x6135, 0x60ba, 0x60ba, 0x6135,
- 0x6135, 0x6135, 0x6135, 0x6135, 0x6135, 0x1078, 0x1288, 0x0d7e,
- 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c,
- 0x10c8, 0x1288, 0x1079, 0x6145, 0x007c, 0x6151, 0x616c, 0x6151,
- 0x616c, 0x6151, 0x616c, 0x6153, 0x615c, 0x6151, 0x616c, 0x6151,
- 0x6161, 0x1078, 0x1288, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6163,
- 0xa08e, 0x0002, 0x0040, 0x6163, 0x6004, 0x1078, 0x6364, 0x0040,
- 0x61b6, 0x1078, 0x21a8, 0x1078, 0x6364, 0x00c0, 0x6169, 0x1078,
- 0x57d2, 0x1078, 0x55d5, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186,
- 0x0016, 0x0040, 0x61a6, 0xa186, 0x0002, 0x00c0, 0x6191, 0x6018,
- 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6191, 0x8001,
- 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078,
- 0x556f, 0x0040, 0x6191, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078,
- 0x61a6, 0x0d7f, 0x0c7f, 0x1078, 0x6364, 0x00c0, 0x6199, 0x1078,
- 0x57d2, 0x1078, 0x21a8, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x21c6, 0x127f, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x2001, 0x0002,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b,
- 0x1078, 0x4893, 0x0d7f, 0x0c7f, 0x0078, 0x61a5, 0x1078, 0x57d2,
- 0x0078, 0x6169, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x61c2, 0x007c, 0x61d2, 0x61d2, 0x61d2, 0x61d2, 0x61d2, 0x61d2,
- 0x61d2, 0x61d2, 0x61d2, 0x60c0, 0x61d2, 0x60c1, 0x61d4, 0x60c1,
- 0x61dd, 0x61d2, 0x1078, 0x1288, 0x6007, 0x008b, 0x6003, 0x000d,
- 0x1078, 0x443e, 0x1078, 0x4893, 0x007c, 0x1078, 0x632a, 0x1078,
- 0x6216, 0x0040, 0x61ff, 0x1078, 0x21a8, 0x0d7e, 0x1078, 0x6216,
- 0x0040, 0x61f2, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x1078, 0x3720, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
- 0x0001, 0x1078, 0x448b, 0x1078, 0x4893, 0x0078, 0x6201, 0x1078,
- 0x55d5, 0x007c, 0xa284, 0x0007, 0x00c0, 0x6213, 0xa282, 0x7500,
- 0x0048, 0x6213, 0x2001, 0x6f15, 0x2004, 0xa202, 0x00c8, 0x6213,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x6212, 0x027e, 0x0e7e,
- 0x2071, 0x6f00, 0x6210, 0x7058, 0xa202, 0x0048, 0x6228, 0x705c,
- 0xa202, 0x00c8, 0x6228, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c,
- 0xa006, 0x0078, 0x6225, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7344, 0x7060,
- 0xa302, 0x00c8, 0x6251, 0x601c, 0xa206, 0x00c0, 0x6249, 0x1078,
- 0x6364, 0x00c0, 0x6245, 0x1078, 0x57d2, 0x0c7e, 0x1078, 0x55d5,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6251, 0x0078,
- 0x6236, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
- 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x556f, 0x057f,
- 0x0040, 0x6270, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x626c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
- 0x62a0, 0x0c7e, 0x1078, 0x556f, 0x057f, 0x0040, 0x629a, 0x6013,
- 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x364c,
- 0x0c7f, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe,
- 0x2009, 0x004c, 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f,
- 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6296, 0x0c7e, 0x057e, 0x127e,
- 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x556f, 0x057f, 0x0040,
- 0x62c5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
- 0x2560, 0x1078, 0x364c, 0x0c7f, 0x1078, 0x457b, 0x1078, 0x44be,
- 0x2c08, 0x1078, 0x6bfe, 0x2009, 0x004d, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62c1,
+ 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5d74, 0xa694, 0xff00,
+ 0xa284, 0x0c00, 0x0040, 0x5d08, 0x7018, 0x7862, 0x701c, 0x785e,
+ 0xa284, 0x0300, 0x0040, 0x5d71, 0x1078, 0x130f, 0x1040, 0x12b7,
+ 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
+ 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
+ 0x00ff, 0xa186, 0x0002, 0x0040, 0x5d43, 0xa186, 0x0028, 0x00c0,
+ 0x5d2d, 0x684b, 0x001c, 0x0078, 0x5d45, 0xd6dc, 0x0040, 0x5d38,
+ 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d45,
+ 0xd6d4, 0x0040, 0x5d43, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5d45, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
+ 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5d5a, 0x7328, 0x732c,
+ 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078,
+ 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5d71, 0x7124, 0x695a, 0xa192,
+ 0x0021, 0x00c8, 0x5d6e, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18,
+ 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5d71, 0x2d78, 0x1078,
+ 0x5ee4, 0xd6dc, 0x00c0, 0x5d77, 0xa006, 0x0078, 0x5d7b, 0x2001,
+ 0x0001, 0x7218, 0x731c, 0x1078, 0x156f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
+ 0x1532, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c,
+ 0xd1e4, 0x0040, 0x5dc4, 0xd1cc, 0x0040, 0x5d9f, 0x6948, 0x017e,
+ 0x1078, 0x1338, 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5dc2, 0x6837,
+ 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5dbe,
+ 0xa086, 0x0028, 0x00c0, 0x5db0, 0x684b, 0x001c, 0x0078, 0x5dc0,
+ 0xd1dc, 0x0040, 0x5db7, 0x684b, 0x0015, 0x0078, 0x5dc0, 0xd1d4,
+ 0x0040, 0x5dbe, 0x684b, 0x0007, 0x0078, 0x5dc0, 0x684b, 0x0000,
+ 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x1078, 0x4671,
+ 0x0078, 0x5dcc, 0x1078, 0x4719, 0x1078, 0x6120, 0x0040, 0x5de3,
+ 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0x6d0c, 0x210c,
+ 0xd18c, 0x00c0, 0x5dec, 0xd184, 0x00c0, 0x5de8, 0x6108, 0x694a,
+ 0x1078, 0x36a1, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c,
+ 0x684b, 0x0004, 0x0078, 0x5de0, 0x684b, 0x0004, 0x0078, 0x5de0,
+ 0xa182, 0x0040, 0x0079, 0x5df4, 0x5e03, 0x5e03, 0x5e03, 0x5e03,
+ 0x5e03, 0x5e05, 0x5e03, 0x5e08, 0x5e03, 0x5e03, 0x5e03, 0x5e03,
+ 0x5e03, 0x5e03, 0x5e03, 0x1078, 0x12b7, 0x1078, 0x556a, 0x007c,
+ 0x007e, 0x027e, 0xa016, 0x1078, 0x1532, 0x027f, 0x007f, 0x007c,
+ 0xa182, 0x0025, 0x0079, 0x5e14, 0x5e1d, 0x5e1b, 0x5e1b, 0x5e1b,
+ 0x5e1b, 0x5e1b, 0x5e1b, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106,
+ 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f,
+ 0x007c, 0xa186, 0x0013, 0x00c0, 0x5e33, 0x6004, 0xa082, 0x0025,
+ 0x2008, 0x0079, 0x5e74, 0xa186, 0x0014, 0x00c0, 0x5e70, 0x1078,
+ 0x4671, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018, 0xa080, 0x0028,
+ 0x200c, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078,
+ 0x445c, 0x1078, 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x5e52,
+ 0x1078, 0x35cf, 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f,
+ 0x017f, 0x1078, 0x342f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120,
+ 0x0040, 0x5e6a, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c,
+ 0x1078, 0x559f, 0x0078, 0x5e6f, 0x5e7d, 0x5e7b, 0x5e7b, 0x5e7b,
+ 0x5e7b, 0x5e7b, 0x5e86, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6017,
+ 0x0014, 0x6003, 0x000c, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671,
+ 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x476a, 0x007c, 0xa182,
+ 0x002c, 0x00c8, 0x5e99, 0xa182, 0x0025, 0x0048, 0x5e99, 0x0079,
+ 0x5e9c, 0x1078, 0x559f, 0x007c, 0x5ea3, 0x5ea3, 0x5ea3, 0x5ea3,
+ 0x5ea5, 0x5ebf, 0x5ea3, 0x1078, 0x12b7, 0x0d7e, 0x1078, 0x6276,
+ 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xa084, 0x0040, 0x0040,
+ 0x5eb5, 0x684b, 0x0006, 0x0078, 0x5eb7, 0x684b, 0x0005, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5ed9, 0x6837, 0x0103,
+ 0x6850, 0xa084, 0x0040, 0x0040, 0x5ed1, 0x684b, 0x0006, 0x0078,
+ 0x5ed3, 0x684b, 0x0005, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078,
+ 0x6276, 0x0d7f, 0x1078, 0x556a, 0x007c, 0x1078, 0x4671, 0x1078,
+ 0x556a, 0x1078, 0x476a, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
+ 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x5ef0, 0x0078, 0x5ef2,
+ 0x2009, 0x0100, 0x2130, 0x2069, 0x7298, 0x831c, 0x2300, 0xad18,
+ 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x5f4c, 0xa6b2, 0x0020,
+ 0x7804, 0xa06d, 0x0040, 0x5f06, 0x1078, 0x1338, 0x1078, 0x130f,
+ 0x0040, 0x5f30, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
+ 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x5f1c, 0x2608, 0xad90, 0x000f,
+ 0x1078, 0x5f4c, 0x0078, 0x5f30, 0xa6b2, 0x003c, 0x2009, 0x003c,
+ 0x2d78, 0xad90, 0x000f, 0x1078, 0x5f4c, 0x0078, 0x5f06, 0x0f7f,
+ 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5f35,
+ 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
+ 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x5f4a, 0x6804, 0xa07d, 0x0040,
+ 0x5f48, 0x6807, 0x0000, 0x1078, 0x36a1, 0x2f68, 0x0078, 0x5f3d,
+ 0x1078, 0x36a1, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
+ 0x5f52, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
+ 0x8210, 0x00f0, 0x5f54, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
+ 0x601c, 0xa084, 0x000f, 0x1079, 0x5f67, 0x127f, 0x007c, 0x5f76,
+ 0x5f6f, 0x5f71, 0x5f8d, 0x5f6f, 0x5f71, 0x5f71, 0x5f71, 0x1078,
+ 0x12b7, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
+ 0x2068, 0x1078, 0x6120, 0x0040, 0x5f8a, 0xa00e, 0x2001, 0x0005,
+ 0x1078, 0x372d, 0x1078, 0x36a1, 0x1078, 0x556a, 0xa085, 0x0001,
+ 0x0d7f, 0x007c, 0xa006, 0x0078, 0x5f88, 0x6000, 0xa08a, 0x0010,
+ 0x10c8, 0x12b7, 0x1079, 0x5f95, 0x007c, 0x5fa5, 0x5fc4, 0x5fa7,
+ 0x5fd5, 0x5fc0, 0x5fa5, 0x5f71, 0x5f76, 0x5f76, 0x5f71, 0x5f71,
+ 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x1078, 0x12b7, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5fb2, 0x6850, 0xa085,
+ 0x0005, 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f,
+ 0x0002, 0x1078, 0x4327, 0x1078, 0x476a, 0xa085, 0x0001, 0x007c,
+ 0x1078, 0x15f2, 0x0078, 0x5fa7, 0x0e7e, 0x2071, 0x6f10, 0x7024,
+ 0xac06, 0x00c0, 0x5fcd, 0x1078, 0x5148, 0x1078, 0x5083, 0x0e7f,
+ 0x00c0, 0x5fa7, 0x1078, 0x5f71, 0x007c, 0x037e, 0x0e7e, 0x2071,
+ 0x6f10, 0x703c, 0xac06, 0x00c0, 0x5fe1, 0x2019, 0x0000, 0x1078,
+ 0x51da, 0x1078, 0x54b6, 0x0e7f, 0x037f, 0x00c0, 0x5fa7, 0x1078,
+ 0x5f71, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x5ff2,
+ 0x0c7f, 0x007c, 0x5ffb, 0x605b, 0x60c8, 0x5fff, 0x5ffb, 0x5ffb,
+ 0x5ffb, 0x556a, 0x605b, 0x007c, 0x6017, 0x0001, 0x007c, 0x6000,
+ 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x6007, 0x007c, 0x6017,
+ 0x6019, 0x603a, 0x604d, 0x604d, 0x6017, 0x5ffb, 0x5ffb, 0x5ffb,
+ 0x604d, 0x604d, 0x6017, 0x6017, 0x6017, 0x6017, 0x6058, 0x1078,
+ 0x12b7, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xa085, 0x0040, 0x7052,
+ 0x2071, 0x6f10, 0x7024, 0xac06, 0x0040, 0x6036, 0x1078, 0x5083,
+ 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017, 0x0014,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x007c, 0x6017, 0x0001,
+ 0x0078, 0x6034, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xa085, 0x0040,
+ 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x007c, 0x0d7e, 0x6017, 0x0001,
+ 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, 0x6852, 0x0d7f, 0x007c,
+ 0x1078, 0x556a, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x6063, 0x007c, 0x6073, 0x5ffc, 0x6075, 0x6073, 0x6075,
+ 0x6073, 0x6073, 0x6073, 0x5ffb, 0x5ffb, 0x6073, 0x6073, 0x6073,
+ 0x6073, 0x6073, 0x6073, 0x1078, 0x12b7, 0x0d7e, 0x6018, 0x2068,
+ 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12b7,
+ 0x1079, 0x6083, 0x007c, 0x608f, 0x60b1, 0x608f, 0x60b1, 0x608f,
+ 0x60b1, 0x6091, 0x609a, 0x608f, 0x60b1, 0x608f, 0x60aa, 0x1078,
+ 0x12b7, 0x6004, 0xa08e, 0x0004, 0x0040, 0x60ac, 0xa08e, 0x0002,
+ 0x0040, 0x60ac, 0xa08e, 0x0000, 0x0040, 0x60c0, 0xa08e, 0x001f,
+ 0x0040, 0x60c0, 0xa08e, 0x0021, 0x0040, 0x60c4, 0xa08e, 0x0022,
+ 0x0040, 0x60c0, 0x1078, 0x2051, 0x1078, 0x5778, 0x1078, 0x556a,
+ 0x007c, 0x1078, 0x5778, 0x1078, 0x2051, 0x0e7e, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x206f, 0x127f, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x1078, 0x5778, 0x0078, 0x60ac, 0x1078, 0x5786, 0x0078, 0x60ac,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x60d0, 0x007c,
+ 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0,
+ 0x60e0, 0x5ffb, 0x60e0, 0x5ffc, 0x60e2, 0x5ffc, 0x60eb, 0x60e0,
+ 0x1078, 0x12b7, 0x6007, 0x002b, 0x6003, 0x000d, 0x1078, 0x4327,
+ 0x1078, 0x476a, 0x007c, 0x1078, 0x6276, 0x1078, 0x6120, 0x0040,
+ 0x6109, 0x1078, 0x2051, 0x0d7e, 0x6010, 0x2068, 0x6837, 0x0103,
+ 0x684b, 0x0006, 0x1078, 0x36a1, 0x0d7f, 0x601f, 0x0001, 0x6007,
+ 0x0001, 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078,
+ 0x610b, 0x1078, 0x556a, 0x007c, 0xa284, 0x0007, 0x00c0, 0x611d,
+ 0xa282, 0x7400, 0x0048, 0x611d, 0x2001, 0x6d15, 0x2004, 0xa202,
+ 0x00c8, 0x611d, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x611c,
+ 0x027e, 0x0e7e, 0x2071, 0x6d00, 0x6210, 0x7058, 0xa202, 0x0048,
+ 0x6132, 0x705c, 0xa202, 0x00c8, 0x6132, 0xa085, 0x0001, 0x0e7f,
+ 0x027f, 0x007c, 0xa006, 0x0078, 0x612f, 0x0e7e, 0x0c7e, 0x037e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7400, 0x2071, 0x6d00,
+ 0x7344, 0x7060, 0xa302, 0x00c8, 0x6155, 0x601c, 0xa206, 0x00c0,
+ 0x614d, 0x0c7e, 0x1078, 0x556a, 0x0c7f, 0xace0, 0x0008, 0x7054,
+ 0xac02, 0x00c8, 0x6155, 0x0078, 0x6140, 0x127f, 0x007f, 0x037f,
+ 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e, 0x2091,
+ 0x8000, 0xa188, 0x6e00, 0x210c, 0x81ff, 0x0040, 0x6182, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7344, 0x7060, 0xa302, 0x00c8, 0x6182,
+ 0x6018, 0xa106, 0x00c0, 0x617c, 0x1078, 0x2051, 0x017e, 0x0c7e,
+ 0x1078, 0x556a, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054, 0xac02,
+ 0x0048, 0x6170, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
+ 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x057f,
+ 0x0040, 0x61a0, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x619c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
+ 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040, 0x61ca, 0x6013,
+ 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x35cf,
+ 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57,
+ 0x2009, 0x004c, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f,
+ 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61c6, 0x0c7e, 0x057e, 0x127e,
+ 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040,
+ 0x61f5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
+ 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9,
+ 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004d, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61f1,
0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078,
- 0x556f, 0x057f, 0x0040, 0x62f0, 0x6612, 0x651a, 0x601f, 0x0003,
- 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x364c, 0x0c7f, 0x1078,
- 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe, 0x2009, 0x004e,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x62ec, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
- 0x1078, 0x556f, 0x017f, 0x0040, 0x630c, 0x660a, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6309, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040,
- 0x6327, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
- 0x0078, 0x6324, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff,
- 0x0040, 0x6334, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013,
- 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e,
- 0x0d7e, 0x2031, 0x6f52, 0x2634, 0xd6e4, 0x0040, 0x634c, 0x6618,
- 0x2660, 0x6e44, 0x1078, 0x3584, 0x0d7f, 0x0c7f, 0x067f, 0x007c,
- 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6361, 0xa08e,
- 0x0003, 0x0040, 0x6361, 0xa08e, 0x0004, 0x0040, 0x6361, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e,
- 0x0000, 0x0040, 0x6379, 0xa08e, 0x001f, 0x0040, 0x6379, 0xa08e,
- 0x0028, 0x0040, 0x6379, 0xa08e, 0x0029, 0x0040, 0x6379, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x6396, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x1078, 0x21a8, 0x2009, 0x0028, 0x1078,
- 0x55fc, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x6393, 0xa186, 0x0015, 0x00c0, 0x63ae, 0x2011, 0x6f1c, 0x2204,
- 0xa086, 0x0074, 0x00c0, 0x63ae, 0x1078, 0x59b5, 0x6003, 0x0001,
- 0x6007, 0x0029, 0x1078, 0x448b, 0x0078, 0x63b2, 0x1078, 0x57d2,
- 0x1078, 0x55d5, 0x007c, 0xa186, 0x0015, 0x00c0, 0x63d0, 0x2011,
- 0x6f1c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x63d0, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x3547, 0x0d7f, 0x1078, 0x59bf, 0x00c0, 0x63d0,
- 0x2001, 0x0006, 0x1078, 0x3477, 0x1078, 0x567f, 0x0078, 0x63d4,
- 0x1078, 0x57d2, 0x1078, 0x55d5, 0x007c, 0x6848, 0xa086, 0x0005,
- 0x00c0, 0x63dc, 0x1078, 0x63dd, 0x007c, 0x6850, 0xc0ad, 0x6852,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x63eb, 0x067f, 0x007c, 0x63fb, 0x65cb, 0x66ac, 0x63fb, 0x63fb,
- 0x63fb, 0x63fb, 0x63fb, 0x6435, 0x6712, 0x63fb, 0x63fb, 0x63fb,
- 0x63fb, 0x63fb, 0x63fb, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x6407, 0x067f, 0x007c, 0x6417,
- 0x6a13, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x69ee,
- 0x6a5d, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x6423, 0x067f, 0x007c, 0x6433, 0x685f, 0x68d1, 0x68f3, 0x693f,
- 0x6433, 0x6433, 0x6999, 0x671e, 0x69d6, 0x69da, 0x6433, 0x6433,
- 0x6433, 0x6433, 0x6433, 0x1078, 0x1288, 0xa1b2, 0x0030, 0x10c8,
- 0x1288, 0x2100, 0x0079, 0x643c, 0x646c, 0x6549, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646e, 0x649d, 0x64a8, 0x64d0, 0x64d6,
- 0x650a, 0x6542, 0x646c, 0x646c, 0x6551, 0x646c, 0x646c, 0x646c,
- 0x6558, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x6575, 0x646c,
- 0x646c, 0x6580, 0x646c, 0x646c, 0x1078, 0x1288, 0x1078, 0x36cc,
- 0x6618, 0x0c7e, 0x2660, 0x1078, 0x34dd, 0x0c7f, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x648f, 0x1078,
- 0x6b3d, 0x00c0, 0x64ca, 0x1078, 0x6adb, 0x00c0, 0x648b, 0x6007,
- 0x0008, 0x0078, 0x6544, 0x6007, 0x0009, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x6499, 0x1078, 0x6b3d, 0x0040, 0x6483, 0x0078,
- 0x64ca, 0x6013, 0x1900, 0x0078, 0x648b, 0x6106, 0x1078, 0x6a9e,
- 0x6007, 0x0006, 0x0078, 0x6544, 0x6007, 0x0007, 0x0078, 0x6544,
- 0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x64ba, 0xa686, 0x0004, 0x0040, 0x64ba, 0x0d7f,
- 0x0078, 0x64ca, 0x1078, 0x6b9b, 0x00c0, 0x64c5, 0x1078, 0x3547,
- 0x6007, 0x000a, 0x0d7f, 0x0078, 0x6544, 0x6007, 0x000b, 0x0d7f,
- 0x0078, 0x6544, 0x1078, 0x21a8, 0x6007, 0x0001, 0x0078, 0x6544,
- 0x1078, 0x21a8, 0x6007, 0x000c, 0x0078, 0x6544, 0x1078, 0x36cc,
+ 0x5504, 0x057f, 0x0040, 0x6220, 0x6612, 0x651a, 0x601f, 0x0003,
+ 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078,
+ 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004e,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x621c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x623c, 0x660a, 0x611a, 0x601f,
+ 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6239, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040,
+ 0x6258, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012, 0x2009,
+ 0x0021, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x6255, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x6273, 0x611a, 0x601f, 0x0001,
+ 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5591, 0xa085, 0x0001,
+ 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6270, 0x027e, 0x0d7e,
+ 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6280, 0x8211, 0x6a3e,
+ 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017,
+ 0x0014, 0x007c, 0x067e, 0x0c7e, 0x2031, 0x6d52, 0x2634, 0xd6e4,
+ 0x0040, 0x6297, 0x6618, 0x2660, 0x6e44, 0x1078, 0x3507, 0x0c7f,
+ 0x067f, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x62a4, 0x067f, 0x007c, 0x62b4, 0x640b, 0x64d4, 0x62b4,
+ 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x62ee, 0x6542, 0x62b4, 0x62b4,
+ 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x1078, 0x12b7, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x62c0, 0x067f, 0x007c,
+ 0x62d0, 0x6837, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0,
+ 0x6812, 0x687d, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0,
+ 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x62dc, 0x067f, 0x007c, 0x62ec, 0x668f, 0x66fb, 0x671c,
+ 0x6769, 0x62ec, 0x62ec, 0x67be, 0x654e, 0x67fa, 0x67fe, 0x62ec,
+ 0x62ec, 0x62ec, 0x62ec, 0x62ec, 0x1078, 0x12b7, 0xa1b2, 0x0024,
+ 0x10c8, 0x12b7, 0x2100, 0x0079, 0x62f5, 0x6319, 0x63f5, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x631b, 0x634a, 0x6354, 0x637c,
+ 0x6382, 0x63b6, 0x63ee, 0x6319, 0x6319, 0x63fd, 0x6319, 0x6319,
+ 0x6404, 0x1078, 0x12b7, 0x1078, 0x364d, 0x6618, 0x0c7e, 0x2660,
+ 0x1078, 0x3459, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
+ 0xa082, 0x0006, 0x0048, 0x633c, 0x1078, 0x6993, 0x00c0, 0x6376,
+ 0x1078, 0x6931, 0x00c0, 0x6338, 0x6007, 0x0008, 0x0078, 0x63f0,
+ 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x6346,
+ 0x1078, 0x6993, 0x0040, 0x6330, 0x0078, 0x6376, 0x6013, 0x1900,
+ 0x0078, 0x6338, 0x1078, 0x68b7, 0x6007, 0x0006, 0x0078, 0x63f0,
+ 0x6007, 0x0007, 0x0078, 0x63f0, 0x0d7e, 0x6618, 0x2668, 0x6e04,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6366, 0xa686,
+ 0x0004, 0x0040, 0x6366, 0x0d7f, 0x0078, 0x6376, 0x1078, 0x69f1,
+ 0x00c0, 0x6371, 0x1078, 0x34ca, 0x6007, 0x000a, 0x0d7f, 0x0078,
+ 0x63f0, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x63f0, 0x1078, 0x2051,
+ 0x6007, 0x0001, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007, 0x000c,
+ 0x0078, 0x63f0, 0x1078, 0x364d, 0x6618, 0xa6b0, 0x0001, 0x2634,
+ 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x63a3, 0xa6b4, 0xff00,
+ 0x8637, 0xa686, 0x0006, 0x00c0, 0x6376, 0x1078, 0x6a00, 0x00c0,
+ 0x639d, 0x6007, 0x000e, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007,
+ 0x000f, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63b0, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6395, 0x0078, 0x6376,
+ 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x364d,
0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006,
- 0x0048, 0x64f7, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
- 0x64ca, 0x1078, 0x6baa, 0x00c0, 0x64f1, 0x6007, 0x000e, 0x0078,
- 0x6544, 0x1078, 0x21a8, 0x6007, 0x000f, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x6504, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x64e9, 0x0078, 0x64ca, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6544, 0x1078, 0x36cc, 0x6618, 0xa6b0, 0x0001, 0x2634,
- 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x652f, 0xa6b4, 0xff00,
- 0x8637, 0xa686, 0x0006, 0x00c0, 0x64ca, 0x1078, 0x6bd6, 0x00c0,
- 0x6529, 0x1078, 0x6adb, 0x00c0, 0x6529, 0x6007, 0x0010, 0x0078,
- 0x6544, 0x1078, 0x21a8, 0x6007, 0x0011, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x653c, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x651d, 0x0078, 0x64ca, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6544, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x448b,
- 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x448b, 0x0078,
- 0x6548, 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x448b, 0x007c,
- 0x017e, 0x027e, 0x2011, 0x7388, 0x2214, 0x2c08, 0x1078, 0x6d97,
- 0x00c0, 0x6569, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078,
- 0x656e, 0x1078, 0x55d5, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001,
- 0x1078, 0x448b, 0x027f, 0x017f, 0x007c, 0x6106, 0x1078, 0x6587,
- 0x6007, 0x002b, 0x0078, 0x6544, 0x6007, 0x002c, 0x0078, 0x6544,
- 0x6106, 0x1078, 0x658c, 0x6007, 0x002e, 0x0078, 0x6544, 0x0d7e,
- 0x1078, 0x65b2, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x65c1, 0x00c0,
- 0x65ab, 0x680c, 0xa08c, 0xff00, 0x6824, 0xa084, 0x00ff, 0xa115,
- 0x6212, 0xd1e4, 0x0040, 0x65a0, 0x2009, 0x0001, 0x0078, 0x65a7,
- 0xd1ec, 0x0040, 0x65ab, 0x2009, 0x0000, 0xa294, 0x00ff, 0x1078,
- 0x21d7, 0x0078, 0x65af, 0xa085, 0x0001, 0x0078, 0x65b0, 0xa006,
- 0x0d7f, 0x007c, 0x2069, 0x738d, 0x6800, 0xa082, 0x0010, 0x00c8,
- 0x65bf, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x65c0, 0xa006,
- 0x007c, 0x6013, 0x0000, 0x2069, 0x738c, 0x6808, 0xa084, 0xff00,
- 0xa086, 0x0800, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1288,
- 0xa1b6, 0x0013, 0x00c0, 0x65d7, 0x2008, 0x0079, 0x65ea, 0xa1b6,
- 0x0027, 0x0040, 0x65df, 0xa1b6, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x3485, 0x1078, 0x479a, 0x1078, 0x6337, 0x1078,
- 0x4893, 0x007c, 0x661a, 0x661c, 0x661a, 0x661a, 0x661a, 0x661c,
- 0x6624, 0x6687, 0x664a, 0x6687, 0x665e, 0x6687, 0x6624, 0x6687,
- 0x667f, 0x6687, 0x667f, 0x6687, 0x6687, 0x661a, 0x661a, 0x661a,
- 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a,
- 0x661a, 0x661a, 0x6687, 0x661a, 0x661a, 0x661a, 0x661a, 0x6687,
- 0x6687, 0x661a, 0x661a, 0x661a, 0x661a, 0x6687, 0x6687, 0x661a,
- 0x6687, 0x6687, 0x1078, 0x1288, 0x1078, 0x479a, 0x6003, 0x0002,
- 0x1078, 0x4893, 0x0078, 0x668d, 0x0f7e, 0x2079, 0x6f51, 0x7804,
- 0x0f7f, 0xd0ac, 0x00c0, 0x6687, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2001, 0x0002, 0x1078, 0x3477, 0x1078, 0x479a, 0x601f, 0x0001,
- 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b, 0x1078, 0x4893,
- 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x4194, 0x0c7f,
- 0x0078, 0x668d, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6687, 0xa686, 0x0004,
- 0x0040, 0x6687, 0x2001, 0x0004, 0x0078, 0x6685, 0x2001, 0x6f00,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x6667, 0x1078, 0x2a74, 0x2001,
- 0x0006, 0x1078, 0x668e, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6687, 0x2001,
- 0x0006, 0x0078, 0x6685, 0x2001, 0x0004, 0x0078, 0x6685, 0x2001,
- 0x0006, 0x1078, 0x668e, 0x0078, 0x6687, 0x1078, 0x3485, 0x1078,
- 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0x017e, 0x0d7e,
- 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x66a9, 0x6104, 0xa18e,
- 0x000a, 0x00c0, 0x66a1, 0x699c, 0xd1a4, 0x00c0, 0x66a1, 0x2001,
- 0x0007, 0x1078, 0x3477, 0x2001, 0x0000, 0x1078, 0x3463, 0x1078,
- 0x21c6, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1288,
- 0xa1b6, 0x0015, 0x00c0, 0x66c0, 0x1079, 0x66c7, 0x0078, 0x66c6,
- 0xa1b6, 0x0016, 0x10c0, 0x1288, 0x1079, 0x66f7, 0x007c, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x66d3, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x0f7e, 0x2079, 0x6f51, 0x7804, 0x0f7f,
- 0xd0ac, 0x00c0, 0x66ef, 0x2001, 0x0000, 0x1078, 0x3463, 0x2001,
- 0x0002, 0x1078, 0x3477, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x448b, 0x1078, 0x4893, 0x0078, 0x66f6, 0x2011,
- 0x7383, 0x220c, 0x1078, 0x32cf, 0x1078, 0x55d5, 0x007c, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x6703, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x1078, 0x59b2, 0x00c0, 0x670f, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x6711, 0x1078,
- 0x55d5, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x1078,
- 0x479a, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6722, 0x6732, 0x6732, 0x6732, 0x6732, 0x6734, 0x6732,
- 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732,
- 0x6732, 0x6732, 0x1078, 0x1288, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e,
- 0x047e, 0x027e, 0x6106, 0x2071, 0x7380, 0x7444, 0xa4a4, 0xe600,
- 0x0040, 0x67a5, 0xa486, 0x2000, 0x0040, 0x6764, 0xa486, 0x0400,
- 0x0040, 0x6764, 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
- 0x6837, 0x0c7e, 0x1078, 0x4225, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
- 0x0001, 0x0040, 0x6818, 0x1078, 0x42e3, 0x0040, 0x6843, 0xa295,
- 0x0200, 0x6a02, 0x0078, 0x676a, 0x2009, 0x0001, 0x2011, 0x0200,
- 0x1078, 0x42cd, 0x1078, 0x12e2, 0x1040, 0x1288, 0x6003, 0x0007,
- 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a,
- 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0xa18c,
- 0x00ff, 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078,
- 0x3720, 0xa486, 0x2000, 0x00c0, 0x6793, 0x2019, 0x0017, 0x1078,
- 0x6d5c, 0x0078, 0x6805, 0xa486, 0x0400, 0x00c0, 0x679d, 0x2019,
- 0x0002, 0x1078, 0x6d5c, 0x0078, 0x6805, 0xa486, 0x0200, 0x00c0,
- 0x67a3, 0x1078, 0x6d4d, 0x0078, 0x6805, 0x7130, 0xa184, 0xff00,
- 0x00c0, 0x6857, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6857,
- 0x0c7e, 0x1078, 0x4225, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001,
- 0x0040, 0x685b, 0xa284, 0x0300, 0x00c0, 0x6853, 0x6804, 0xa005,
- 0x0040, 0x6843, 0x8001, 0x6806, 0x6003, 0x0007, 0x1078, 0x12c7,
- 0x0040, 0x680c, 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, 0x0116,
- 0x683b, 0x0000, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007,
- 0xa10d, 0x6946, 0x6853, 0x003d, 0x7044, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x00c0, 0x67e7, 0x684f, 0x0040, 0x0078, 0x67f1, 0xa086,
- 0x0001, 0x00c0, 0x67ef, 0x684f, 0x0080, 0x0078, 0x67f1, 0x684f,
- 0x0000, 0x20a9, 0x000a, 0x2001, 0x7390, 0xad90, 0x0015, 0x200c,
- 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x67f7, 0x200c, 0x6982,
- 0x8000, 0x200c, 0x697e, 0x1078, 0x3720, 0x027f, 0x047f, 0x157f,
- 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001,
- 0x6007, 0x0041, 0x1078, 0x443e, 0x1078, 0x4893, 0x0078, 0x6805,
- 0x2069, 0x7392, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0,
- 0x6837, 0x2069, 0x7380, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110,
- 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007,
- 0x0043, 0x1078, 0x443e, 0x1078, 0x4893, 0x0078, 0x6805, 0x6013,
- 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x443e, 0x1078,
- 0x4893, 0x0078, 0x6805, 0x6013, 0x0300, 0x0078, 0x6849, 0x6013,
- 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x443e, 0x1078,
- 0x4893, 0x0078, 0x6805, 0x6013, 0x0500, 0x0078, 0x6849, 0x6013,
- 0x0600, 0x0078, 0x6818, 0x6013, 0x0200, 0x0078, 0x6818, 0xa186,
- 0x0013, 0x00c0, 0x6871, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1288,
- 0xa08a, 0x0050, 0x10c8, 0x1288, 0xa082, 0x0040, 0x2008, 0x0079,
- 0x68a2, 0xa186, 0x0047, 0x00c0, 0x6877, 0x0078, 0x68d1, 0xa186,
- 0x0027, 0x0040, 0x687f, 0xa186, 0x0014, 0x10c0, 0x1288, 0x6004,
- 0xa082, 0x0040, 0x2008, 0x0079, 0x6885, 0x6895, 0x6897, 0x6897,
- 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895,
- 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x1078, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x3485, 0x1078, 0x479a, 0x1078, 0x6337, 0x1078,
- 0x4893, 0x007c, 0x68b2, 0x68c2, 0x68bb, 0x68cb, 0x68b2, 0x68b2,
- 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2,
- 0x68b2, 0x68b2, 0x1078, 0x1288, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x1078, 0x479a, 0x6003, 0x0002, 0x1078,
- 0x4893, 0x007c, 0x1078, 0x479a, 0x1078, 0x42a6, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x479a, 0x2009, 0x0041, 0x0078,
- 0x6999, 0xa182, 0x0040, 0x0079, 0x68d5, 0x68e5, 0x68e7, 0x68e5,
- 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x68e8, 0x68e5, 0x68e5, 0x68e5,
- 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x1078, 0x1288, 0x007c,
- 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1525, 0x007c, 0xa182, 0x0040, 0x0079, 0x68f7, 0x6907,
- 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907,
- 0x6909, 0x692c, 0x6907, 0x6907, 0x6907, 0x6907, 0x692c, 0x1078,
- 0x1288, 0x1078, 0x4842, 0x1078, 0x4943, 0x6010, 0x0d7e, 0x2068,
- 0x684c, 0xd0fc, 0x0040, 0x691f, 0xa08c, 0x0003, 0xa18e, 0x0002,
- 0x0040, 0x6925, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6999, 0x6003,
- 0x0007, 0x1078, 0x42a6, 0x0d7f, 0x007c, 0x1078, 0x42a6, 0x1078,
- 0x55d5, 0x0d7f, 0x0078, 0x6924, 0x037e, 0x1078, 0x4842, 0x1078,
- 0x4943, 0x6010, 0x0d7e, 0x2068, 0x2019, 0x0004, 0x1078, 0x6d80,
- 0x1078, 0x6337, 0x6017, 0x0028, 0x0d7f, 0x037f, 0x007c, 0xa186,
- 0x0013, 0x00c0, 0x694d, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1288,
- 0x1078, 0x479a, 0x1078, 0x4893, 0x007c, 0xa186, 0x0027, 0x0040,
- 0x6955, 0xa186, 0x0014, 0x00c0, 0x6965, 0x6004, 0xa086, 0x0042,
- 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078, 0x3485, 0x1078, 0x479a,
- 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x6969, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
- 0x697b, 0x6987, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
- 0x6979, 0x1078, 0x1288, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1525, 0x047f, 0x037f, 0x007c, 0x6010,
- 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x6993, 0x2009, 0x0041,
- 0x0d7f, 0x0078, 0x6999, 0x6003, 0x0007, 0x1078, 0x42a6, 0x0d7f,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x699d, 0x69ad, 0x69af, 0x69bb,
- 0x69c7, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad,
- 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x1078, 0x1288, 0x6003,
- 0x0001, 0x6106, 0x1078, 0x443e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4893, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x443e,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4893, 0x127f, 0x007c, 0x6003,
- 0x0003, 0x6106, 0x2c10, 0x1078, 0x1936, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x44aa, 0x1078, 0x4943, 0x127f, 0x007c, 0x1078, 0x479a,
- 0x0078, 0x69dc, 0x1078, 0x4842, 0x6110, 0x81ff, 0x0040, 0x69e9,
- 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x6d80, 0x037f,
- 0x0d7f, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0085,
- 0x0079, 0x69f2, 0x69f9, 0x69f9, 0x69f9, 0x69fb, 0x69f9, 0x69f9,
- 0x69f9, 0x1078, 0x1288, 0x027e, 0x0e7e, 0x2071, 0x7380, 0x7220,
- 0x1078, 0x6c9a, 0x0040, 0x6a08, 0x6007, 0x0086, 0x0078, 0x6a0a,
- 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, 0x443e, 0x1078, 0x4893,
- 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6a24, 0x6004,
- 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a, 0x008c, 0x10c8, 0x1288,
- 0xa082, 0x0085, 0x0079, 0x6a37, 0xa186, 0x0027, 0x0040, 0x6a2c,
- 0xa186, 0x0014, 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078, 0x3485,
- 0x1078, 0x479a, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0x6a3e,
- 0x6a40, 0x6a40, 0x6a3e, 0x6a3e, 0x6a3e, 0x6a3e, 0x1078, 0x1288,
- 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0xa182,
- 0x0085, 0x1048, 0x1288, 0xa182, 0x008c, 0x10c8, 0x1288, 0xa182,
- 0x0085, 0x0079, 0x6a53, 0x6a5a, 0x6a5a, 0x6a5a, 0x6a5c, 0x6a5a,
- 0x6a5a, 0x6a5a, 0x1078, 0x1288, 0x007c, 0x1078, 0x479a, 0x1078,
- 0x6337, 0x1078, 0x4893, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078,
- 0x6a6d, 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e,
- 0x2091, 0x8000, 0x2c40, 0x1078, 0x52e8, 0x00c0, 0x6a9a, 0x1078,
- 0x5389, 0x00c0, 0x6a9a, 0x6000, 0xa086, 0x0000, 0x0040, 0x6a9a,
- 0x601c, 0xa086, 0x0007, 0x0040, 0x6a9a, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x6a8d, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078,
- 0x6216, 0x0040, 0x6a95, 0x1078, 0x6d80, 0x0d7f, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e,
- 0x037e, 0x157e, 0x2079, 0x7380, 0x7838, 0xa084, 0x00ff, 0xa005,
- 0x00c0, 0x6ad6, 0x783c, 0x1078, 0x1fe4, 0x017e, 0x0c7e, 0x1078,
- 0x34cb, 0x00c0, 0x6ad4, 0x2011, 0x7390, 0xac98, 0x000a, 0x20a9,
- 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6ad4, 0x017f, 0x027f, 0x027e,
- 0x017e, 0x2019, 0x0029, 0x1078, 0x545d, 0x1078, 0x457b, 0x1078,
- 0x44be, 0x017f, 0x1078, 0x6bfe, 0x1078, 0x364c, 0x017f, 0x1078,
- 0x32cf, 0xa006, 0x0078, 0x6ad6, 0x0c7f, 0x017f, 0x157f, 0x037f,
- 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6f1c,
- 0x2104, 0xa086, 0x0074, 0x00c0, 0x6b32, 0x2069, 0x738e, 0x690c,
- 0xa182, 0x0100, 0x0048, 0x6b22, 0x6908, 0xa184, 0x8000, 0x0040,
- 0x6b2e, 0xa184, 0x0800, 0x0040, 0x6b2e, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x6b26, 0x6914, 0x2069, 0x73ae, 0x6904, 0x81ff, 0x00c0,
- 0x6b1a, 0x690c, 0xa182, 0x0100, 0x0048, 0x6b22, 0x6908, 0x81ff,
- 0x00c0, 0x6b1e, 0x6910, 0xa18a, 0x0001, 0x0048, 0x6b26, 0x6918,
- 0xa18a, 0x0001, 0x0048, 0x6b2e, 0x0078, 0x6b38, 0x6013, 0x0100,
- 0x0078, 0x6b34, 0x6013, 0x0300, 0x0078, 0x6b34, 0x6013, 0x0500,
- 0x0078, 0x6b34, 0x6013, 0x0700, 0x0078, 0x6b34, 0x6013, 0x0900,
- 0x0078, 0x6b34, 0x6013, 0x0b00, 0x0078, 0x6b34, 0x6013, 0x0f00,
- 0x0078, 0x6b34, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x6b39,
- 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
- 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
- 0x0006, 0x0040, 0x6b61, 0xa286, 0x0004, 0x0040, 0x6b61, 0xa394,
- 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x6b61, 0xa286, 0x0004,
- 0x0040, 0x6b61, 0x0c7e, 0x2d60, 0x1078, 0x34dd, 0x0c7f, 0x0078,
- 0x6b94, 0x2011, 0x7396, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x5a4b, 0x00c0, 0x6b95, 0x2011, 0x739a, 0xad98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6b95, 0x047e, 0x017e, 0x6aa0,
- 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x6f52, 0x210c, 0xd1a4,
- 0x0040, 0x6b89, 0x2009, 0x0029, 0x1078, 0x6dc4, 0x6800, 0xc0e5,
- 0x6802, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08,
- 0x1078, 0x6bfe, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
- 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x738e, 0x6800, 0xa086,
- 0x0800, 0x0040, 0x6ba7, 0x6013, 0x0000, 0x0078, 0x6ba8, 0xa006,
- 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2079, 0x738c, 0x7830, 0xa00d, 0x00c0, 0x6bcf, 0x7834, 0x1078,
- 0x1fe4, 0x1078, 0x34cb, 0x00c0, 0x6bcf, 0x2011, 0x7390, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6bcf, 0x2011,
- 0x7394, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e,
- 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0x7383, 0x2204, 0x1078,
- 0x1fe4, 0x1078, 0x34cb, 0x00c0, 0x6bf7, 0x2011, 0x7396, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6bf7, 0x2011,
- 0x739a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
- 0x2029, 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061, 0x7500,
- 0x2071, 0x6f00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6c63,
- 0x2100, 0xac06, 0x0040, 0x6c59, 0x1078, 0x6ddc, 0x0040, 0x6c59,
- 0x671c, 0xa786, 0x0001, 0x0040, 0x6c78, 0xa786, 0x0007, 0x0040,
- 0x6c59, 0x2500, 0xac06, 0x0040, 0x6c59, 0x2400, 0xac06, 0x0040,
- 0x6c59, 0x1078, 0x6df0, 0x00c0, 0x6c59, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x6c3f, 0x017e, 0x1078, 0x1629, 0x017f, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x6c56, 0xa786, 0x0003, 0x00c0,
- 0x6c6c, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
- 0x63d5, 0x1078, 0x3720, 0x017f, 0x1078, 0x632a, 0x0d7f, 0x1078,
- 0x6337, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x6c63, 0x0078, 0x6c10, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f,
- 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x6c49,
- 0xa386, 0x0005, 0x0040, 0x6c59, 0x1078, 0x6d80, 0x0078, 0x6c56,
- 0x1078, 0x6df0, 0x00c0, 0x6c59, 0xa180, 0x0001, 0x2004, 0xa086,
- 0x0018, 0x00c0, 0x6c59, 0x6000, 0xa086, 0x0002, 0x00c0, 0x6c59,
- 0x1078, 0x6350, 0x0040, 0x6c94, 0x1078, 0x6364, 0x00c0, 0x6c59,
- 0x1078, 0x57d2, 0x0078, 0x6c96, 0x1078, 0x21c6, 0x1078, 0x6337,
- 0x0078, 0x6c59, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078,
- 0x6d97, 0x017f, 0x0040, 0x6ca9, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6cac, 0x0e7f, 0x0c7f, 0x007c, 0x6cb4, 0x6cb4, 0x6cb4, 0x6cb4,
- 0x6cb4, 0x6cb4, 0x6cb6, 0x6cb4, 0xa006, 0x007c, 0x047e, 0x017e,
- 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00,
- 0x2009, 0x0020, 0x1078, 0x6dc4, 0x017f, 0x047f, 0x037e, 0x2019,
- 0x0002, 0x1078, 0x6a6d, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0001, 0x1078, 0x3463, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
- 0x0004, 0x2019, 0x6f05, 0x2011, 0x7396, 0x1078, 0x5a4b, 0x037f,
- 0x027f, 0x017f, 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7500,
- 0x2079, 0x0001, 0x8fff, 0x0040, 0x6d40, 0x2071, 0x6f00, 0x7644,
- 0x7060, 0x8001, 0xa602, 0x00c8, 0x6d40, 0x88ff, 0x0040, 0x6d06,
- 0x2800, 0xac06, 0x00c0, 0x6d36, 0x2079, 0x0000, 0x1078, 0x6ddc,
- 0x0040, 0x6d36, 0x2400, 0xac06, 0x0040, 0x6d36, 0x671c, 0xa786,
- 0x0006, 0x00c0, 0x6d36, 0xa786, 0x0007, 0x0040, 0x6d36, 0x88ff,
- 0x00c0, 0x6d1e, 0x6018, 0xa206, 0x00c0, 0x6d36, 0x0d7e, 0x6000,
- 0xa086, 0x0004, 0x00c0, 0x6d26, 0x1078, 0x1629, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x6d30, 0x047e, 0x1078, 0x6d80, 0x047f,
- 0x0d7f, 0x1078, 0x6337, 0x88ff, 0x00c0, 0x6d49, 0xace0, 0x0008,
- 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6d40, 0x0078, 0x6cf2,
- 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f,
- 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6d41, 0x087e, 0x2041, 0x0000,
- 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078, 0x52e8, 0x1078, 0x5389,
- 0x1078, 0x6ce5, 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e,
- 0x157e, 0x2c20, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x037e,
- 0x1078, 0x34cb, 0x00c0, 0x6d75, 0x2c10, 0x2041, 0x0000, 0x1078,
- 0x52e8, 0x1078, 0x5389, 0x1078, 0x6ce5, 0x037f, 0x017f, 0x8108,
- 0x00f0, 0x6d66, 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c,
- 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6d94, 0x6800, 0xa07d, 0x0040,
- 0x6d91, 0x6803, 0x0000, 0x6b52, 0x1078, 0x3720, 0x2f68, 0x0078,
- 0x6d85, 0x6b52, 0x1078, 0x3720, 0x0f7f, 0x017f, 0x007c, 0x0e7e,
- 0x047e, 0x037e, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7444, 0x7060,
- 0x8001, 0xa402, 0x00c8, 0x6dbf, 0x2100, 0xac06, 0x0040, 0x6db1,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x6db1, 0x6008, 0xa206, 0x0040,
- 0x6dbb, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x6dbf, 0x0078, 0x6d9c, 0xa085, 0x0001, 0x0078, 0x6dc0, 0xa006,
- 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x12e2,
- 0x007f, 0x1040, 0x1288, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b,
- 0x0000, 0x685b, 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000,
- 0x1078, 0x3720, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040,
- 0x6def, 0xa786, 0x0001, 0x0040, 0x6def, 0xa786, 0x000a, 0x0040,
- 0x6def, 0xa786, 0x0009, 0x0040, 0x6def, 0xa085, 0x0001, 0x007c,
- 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e,
- 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f40, 0xd5a4, 0x0040,
- 0x6e04, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6e0a, 0x7030,
- 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6e11, 0x2071, 0x6f4a, 0x1078,
- 0x6e40, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e,
- 0x2091, 0x8000, 0x2071, 0x6f40, 0xd5a4, 0x0040, 0x6e22, 0x7034,
- 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6e28, 0x7030, 0x8000, 0x7032,
- 0xd5ac, 0x0040, 0x6e2f, 0x2071, 0x6f4a, 0x1078, 0x6e40, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
- 0x2071, 0x6f42, 0x1078, 0x6e40, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x2e04, 0x8000, 0x2072, 0x00c8, 0x6e49, 0x8e70, 0x2e04, 0x8000,
- 0x2072, 0x007c, 0x0e7e, 0x2071, 0x6f40, 0x1078, 0x6e40, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x6f44, 0x1078, 0x6e40, 0x0e7f, 0x007c,
- 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
- 0x5879
+ 0x0048, 0x63db, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
+ 0x6376, 0x1078, 0x6a2b, 0x00c0, 0x63d5, 0x1078, 0x6931, 0x00c0,
+ 0x63d5, 0x6007, 0x0010, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007,
+ 0x0011, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63e8, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c9, 0x0078, 0x6376,
+ 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x6007, 0x0012,
+ 0x6003, 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0001, 0x6003,
+ 0x0001, 0x1078, 0x4376, 0x0078, 0x63f4, 0x6007, 0x0020, 0x6003,
+ 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0023, 0x6003, 0x0001,
+ 0x1078, 0x4376, 0x007c, 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7,
+ 0xa1b6, 0x0013, 0x00c0, 0x6417, 0x2008, 0x0079, 0x6426, 0xa1b6,
+ 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078,
+ 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x644a, 0x644c,
+ 0x644a, 0x644a, 0x644a, 0x644c, 0x6454, 0x64af, 0x6472, 0x64af,
+ 0x6486, 0x64af, 0x6454, 0x64af, 0x64a7, 0x64af, 0x64a7, 0x64af,
+ 0x64af, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a,
+ 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x64af, 0x644a,
+ 0x644a, 0x64af, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6003, 0x0002,
+ 0x1078, 0x476a, 0x0078, 0x64b5, 0x0f7e, 0x2079, 0x6d51, 0x7804,
+ 0x0f7f, 0xd0ac, 0x00c0, 0x64af, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x1078, 0x4671, 0x601f, 0x0001,
+ 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x1078, 0x476a,
+ 0x0078, 0x64b5, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0xa686, 0x0004,
+ 0x0040, 0x64af, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001, 0x6d00,
+ 0x2004, 0xa086, 0x0003, 0x00c0, 0x648f, 0x1078, 0x2ad1, 0x2001,
+ 0x0006, 0x1078, 0x64b6, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0x2001,
+ 0x0006, 0x0078, 0x64ad, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001,
+ 0x0006, 0x1078, 0x64b6, 0x0078, 0x64af, 0x1078, 0x3401, 0x1078,
+ 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x017e, 0x0d7e,
+ 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x64d1, 0x6104, 0xa18e,
+ 0x000a, 0x00c0, 0x64c9, 0x699c, 0xd1a4, 0x00c0, 0x64c9, 0x2001,
+ 0x0007, 0x1078, 0x33f3, 0x2001, 0x0000, 0x1078, 0x33df, 0x1078,
+ 0x206f, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
+ 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7,
+ 0xa1b6, 0x0015, 0x00c0, 0x64e8, 0x1079, 0x64ef, 0x0078, 0x64ee,
+ 0xa1b6, 0x0016, 0x10c0, 0x12b7, 0x1079, 0x6527, 0x007c, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x64fb, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x0f7e, 0x2079, 0x6d51, 0x7804, 0x0f7f,
+ 0xd0ac, 0x00c0, 0x6517, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001,
+ 0x0002, 0x1078, 0x33f3, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
+ 0x0002, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078, 0x6526, 0x2011,
+ 0x7283, 0x220c, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x6526,
+ 0x1078, 0x3256, 0x0c7f, 0x017f, 0x1078, 0x556a, 0x007c, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x6533, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x1078, 0x599c, 0x00c0, 0x653f, 0x6003,
+ 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078, 0x6541, 0x1078,
+ 0x556a, 0x007c, 0x6004, 0xa08a, 0x0024, 0x10c8, 0x12b7, 0x1078,
+ 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040,
+ 0x0079, 0x6552, 0x6561, 0x6561, 0x6561, 0x6561, 0x6563, 0x6561,
+ 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561,
+ 0x6561, 0x1078, 0x12b7, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e,
+ 0x027e, 0x2071, 0x7280, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x65d4,
+ 0xa486, 0x2000, 0x0040, 0x6592, 0xa486, 0x0400, 0x0040, 0x6592,
+ 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6663, 0x0c7e,
+ 0x1078, 0x416d, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040,
+ 0x6644, 0x1078, 0x420a, 0x0040, 0x666f, 0xa295, 0x0200, 0x6a02,
+ 0x0078, 0x6598, 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x41f4,
+ 0x1078, 0x130f, 0x1040, 0x12b7, 0x6003, 0x0007, 0x6106, 0x2d00,
+ 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00,
+ 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0xa18c, 0x00ff,
+ 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x36a1,
+ 0xa486, 0x2000, 0x00c0, 0x65c2, 0x2019, 0x0017, 0x1078, 0x6b8f,
+ 0x0078, 0x6631, 0xa486, 0x0400, 0x00c0, 0x65cc, 0x2019, 0x0002,
+ 0x1078, 0x6b8f, 0x0078, 0x6631, 0xa486, 0x0200, 0x00c0, 0x65d2,
+ 0x1078, 0x6b80, 0x0078, 0x6631, 0x7130, 0xa18c, 0x00ff, 0xa182,
+ 0x0010, 0x00c8, 0x6687, 0x0c7e, 0x1078, 0x416d, 0x2c68, 0x0c7f,
+ 0x6a00, 0xa284, 0x0001, 0x0040, 0x668b, 0xa284, 0x0300, 0x00c0,
+ 0x6683, 0x6804, 0xa005, 0x0040, 0x666f, 0x8001, 0x6806, 0x6003,
+ 0x0007, 0x6106, 0x1078, 0x12f4, 0x0040, 0x6638, 0x6013, 0x0000,
+ 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a,
+ 0x6018, 0x2078, 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d,
+ 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x6613, 0x684f,
+ 0x0040, 0x0078, 0x661d, 0xa086, 0x0001, 0x00c0, 0x661b, 0x684f,
+ 0x0080, 0x0078, 0x661d, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
+ 0x7290, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
+ 0x00f0, 0x6623, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
+ 0x36a1, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
+ 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327,
+ 0x1078, 0x476a, 0x0078, 0x6631, 0x2069, 0x7292, 0x2d04, 0xa084,
+ 0xff00, 0xa086, 0x1200, 0x00c0, 0x6663, 0x2069, 0x7280, 0x686c,
+ 0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112,
+ 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x4327, 0x1078,
+ 0x476a, 0x0078, 0x6631, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
+ 0x0041, 0x1078, 0x4327, 0x1078, 0x476a, 0x0078, 0x6631, 0xa284,
+ 0x0004, 0x00c0, 0x6677, 0x6013, 0x0300, 0x0078, 0x6679, 0x6013,
+ 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327, 0x1078,
+ 0x476a, 0x0078, 0x6631, 0x6013, 0x0500, 0x0078, 0x6679, 0x6013,
+ 0x0600, 0x0078, 0x6644, 0x6013, 0x0200, 0x0078, 0x6644, 0xa186,
+ 0x0013, 0x00c0, 0x66a1, 0x6004, 0xa08a, 0x0040, 0x1048, 0x12b7,
+ 0xa08a, 0x004f, 0x10c8, 0x12b7, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x66cd, 0xa186, 0x0047, 0x00c0, 0x66a7, 0x0078, 0x66fb, 0xa186,
+ 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x66b1, 0x66c0, 0x66c2, 0x66c2, 0x66c0, 0x66c0, 0x66c0, 0x66c0,
+ 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0,
+ 0x1078, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671,
+ 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x66dc, 0x66ec, 0x66e5,
+ 0x66f5, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc,
+ 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x1078, 0x12b7, 0x6010, 0xa088,
+ 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x4671, 0x6003,
+ 0x0002, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x1078, 0x41cd,
+ 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x2009,
+ 0x0041, 0x0078, 0x67be, 0xa182, 0x0040, 0x0079, 0x66ff, 0x670e,
+ 0x6710, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x6711, 0x670e,
+ 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x1078, 0x12b7,
+ 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20,
+ 0x2c10, 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x6720,
+ 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f,
+ 0x672f, 0x6731, 0x6754, 0x672f, 0x672f, 0x672f, 0x672f, 0x1078,
+ 0x12b7, 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068,
+ 0x684c, 0xd0fc, 0x0040, 0x6747, 0xa08c, 0x0003, 0xa18e, 0x0002,
+ 0x0040, 0x674d, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be, 0x6003,
+ 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0x1078, 0x41cd, 0x1078,
+ 0x556a, 0x0d7f, 0x0078, 0x674c, 0x2001, 0x0007, 0x1078, 0x3401,
+ 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068, 0x037e,
+ 0x2019, 0x0004, 0x1078, 0x6bb3, 0x037f, 0x1078, 0x6283, 0x0d7f,
+ 0x007c, 0xa186, 0x0013, 0x00c0, 0x6777, 0x6004, 0xa086, 0x0042,
+ 0x10c0, 0x12b7, 0x1078, 0x4671, 0x1078, 0x476a, 0x007c, 0xa186,
+ 0x0014, 0x00c0, 0x678b, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12b7,
+ 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671, 0x1078, 0x6283,
+ 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079, 0x678f, 0x679e,
+ 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x67a0, 0x67ac,
+ 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x1078, 0x12b7,
+ 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
+ 0x1532, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c,
+ 0xd0fc, 0x0040, 0x67b8, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be,
+ 0x6003, 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0xa182, 0x0040,
+ 0x0079, 0x67c2, 0x67d1, 0x67d3, 0x67df, 0x67eb, 0x67d1, 0x67d1,
+ 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1,
+ 0x67d1, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x476a, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
+ 0x17de, 0x127e, 0x2091, 0x8000, 0x1078, 0x4395, 0x1078, 0x4821,
+ 0x127f, 0x007c, 0x1078, 0x4671, 0x0078, 0x6800, 0x1078, 0x4719,
+ 0x6110, 0x81ff, 0x0040, 0x680d, 0x0d7e, 0x2168, 0x037e, 0x2019,
+ 0x0029, 0x1078, 0x6bb3, 0x037f, 0x0d7f, 0x1078, 0x6283, 0x1078,
+ 0x476a, 0x007c, 0xa182, 0x0025, 0x0079, 0x6816, 0x681d, 0x681d,
+ 0x681d, 0x681f, 0x681d, 0x681d, 0x681d, 0x1078, 0x12b7, 0x027e,
+ 0x0e7e, 0x2071, 0x7280, 0x7220, 0x1078, 0x6ad1, 0x0040, 0x682c,
+ 0x6007, 0x0026, 0x0078, 0x682e, 0x6007, 0x0027, 0x6003, 0x0001,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x027f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x6848, 0x6004, 0xa08a, 0x0025, 0x1048, 0x12b7,
+ 0xa08a, 0x002c, 0x10c8, 0x12b7, 0xa082, 0x0025, 0x0079, 0x6857,
+ 0xa186, 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401,
+ 0x1078, 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x685e,
+ 0x6860, 0x6860, 0x685e, 0x685e, 0x685e, 0x685e, 0x1078, 0x12b7,
+ 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0xa182,
+ 0x0025, 0x1048, 0x12b7, 0xa182, 0x002c, 0x10c8, 0x12b7, 0xa182,
+ 0x0025, 0x0079, 0x6873, 0x687a, 0x687a, 0x687a, 0x687c, 0x687a,
+ 0x687a, 0x687a, 0x1078, 0x12b7, 0x007c, 0x1078, 0x4671, 0x1078,
+ 0x6283, 0x1078, 0x476a, 0x007c, 0x127e, 0x037e, 0x087e, 0x2091,
+ 0x8000, 0x2c40, 0x2019, 0x0002, 0x1078, 0x5387, 0x00c0, 0x68b3,
+ 0x1078, 0x5428, 0x00c0, 0x68b3, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x68b3, 0x601c, 0xa086, 0x0007, 0x0040, 0x68b3, 0x0d7e, 0x6010,
+ 0x2068, 0x1078, 0x6120, 0x0040, 0x68a7, 0x1078, 0x6bb3, 0x0d7f,
+ 0x6000, 0xa086, 0x0004, 0x00c0, 0x68af, 0x1078, 0x15f2, 0x6013,
+ 0x0000, 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e,
+ 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7280, 0x7938, 0x783c, 0x1078,
+ 0x1e1b, 0x00c0, 0x68e8, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0,
+ 0x68e8, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a35, 0x00c0, 0x68e8, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019,
+ 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x017f, 0x1078, 0x6a57,
+ 0x1078, 0x35cf, 0x017f, 0x1078, 0x3256, 0xa006, 0x0078, 0x68ea,
+ 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x0d7e, 0x0c7e, 0x047e, 0x037e, 0x027e, 0x2061, 0x7400, 0x2071,
+ 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6929, 0x2100,
+ 0xac06, 0x0040, 0x691b, 0x6000, 0xa086, 0x0000, 0x0040, 0x691b,
+ 0x6018, 0x2068, 0x68a0, 0xa206, 0x00c0, 0x691b, 0x631c, 0xa386,
+ 0x0004, 0x0040, 0x6925, 0xa386, 0x0005, 0x0040, 0x6925, 0xa386,
+ 0x0006, 0x0040, 0x6925, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004,
+ 0xac02, 0x00c8, 0x6929, 0x0078, 0x68f7, 0xa085, 0x0001, 0x0078,
+ 0x692a, 0xa006, 0x027f, 0x037f, 0x047f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6d1e, 0x2104, 0xa086,
+ 0x0074, 0x00c0, 0x6988, 0x2069, 0x728e, 0x690c, 0xa182, 0x0100,
+ 0x0048, 0x6978, 0x6908, 0xa184, 0x8000, 0x0040, 0x6984, 0xa184,
+ 0x0800, 0x0040, 0x6984, 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c,
+ 0x6914, 0x2069, 0x72ae, 0x6904, 0x81ff, 0x00c0, 0x6970, 0x690c,
+ 0xa182, 0x0100, 0x0048, 0x6978, 0x6908, 0x81ff, 0x00c0, 0x6974,
+ 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c, 0x6918, 0xa18a, 0x0001,
+ 0x0048, 0x6984, 0x0078, 0x698e, 0x6013, 0x0100, 0x0078, 0x698a,
+ 0x6013, 0x0300, 0x0078, 0x698a, 0x6013, 0x0500, 0x0078, 0x698a,
+ 0x6013, 0x0700, 0x0078, 0x698a, 0x6013, 0x0900, 0x0078, 0x698a,
+ 0x6013, 0x0b00, 0x0078, 0x698a, 0x6013, 0x0f00, 0x0078, 0x698a,
+ 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x698f, 0xa006, 0x017f,
+ 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e,
+ 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040,
+ 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7, 0xa394, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x0040, 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7,
+ 0x0c7e, 0x2d60, 0x1078, 0x3459, 0x0c7f, 0x0078, 0x69ea, 0x2011,
+ 0x7296, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0,
+ 0x69eb, 0x2011, 0x729a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078,
+ 0x5a35, 0x00c0, 0x69eb, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff,
+ 0x8227, 0xa006, 0x2009, 0x6d52, 0x210c, 0xd1a4, 0x0040, 0x69df,
+ 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6800, 0xc0e5, 0x6802, 0x2019,
+ 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57,
+ 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x0d7e, 0x2069, 0x728e, 0x6800, 0xa086, 0x0800, 0x0040,
+ 0x69fd, 0x6013, 0x0000, 0x0078, 0x69fe, 0xa006, 0x0d7f, 0x007c,
+ 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x728c,
+ 0x7930, 0x7834, 0x1078, 0x1e1b, 0x00c0, 0x6a24, 0x1078, 0x3447,
+ 0x00c0, 0x6a24, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004,
+ 0x1078, 0x5a35, 0x00c0, 0x6a24, 0x2011, 0x7294, 0xac98, 0x0006,
+ 0x20a9, 0x0004, 0x1078, 0x5a35, 0x157f, 0x037f, 0x027f, 0x017f,
+ 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e,
+ 0x157e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c, 0x1078, 0x1e1b,
+ 0x00c0, 0x6a50, 0x1078, 0x3447, 0x00c0, 0x6a50, 0x2011, 0x7296,
+ 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0, 0x6a50,
+ 0x2011, 0x729a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a35,
+ 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e,
+ 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8,
+ 0x6abc, 0x2100, 0xac06, 0x0040, 0x6ab2, 0x1078, 0x6c0f, 0x0040,
+ 0x6ab2, 0x671c, 0xa786, 0x0001, 0x0040, 0x6ab2, 0xa786, 0x0007,
+ 0x0040, 0x6ab2, 0x2500, 0xac06, 0x0040, 0x6ab2, 0x2400, 0xac06,
+ 0x0040, 0x6ab2, 0x6018, 0x2070, 0x70a0, 0xa206, 0x00c0, 0x6ab2,
+ 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6aa6, 0xa786,
+ 0x0003, 0x00c0, 0x6ac5, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x017e, 0x1078, 0x36a1, 0x017f, 0x1078, 0x6276, 0x0d7f, 0x6000,
+ 0xa086, 0x0004, 0x00c0, 0x6ab0, 0x017e, 0x1078, 0x15f2, 0x017f,
+ 0x1078, 0x6283, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02,
+ 0x00c8, 0x6abc, 0x0078, 0x6a69, 0x127f, 0x027f, 0x047f, 0x057f,
+ 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x6a9b, 0xa386, 0x0005, 0x0040, 0x6ab2, 0x1078, 0x6bb3, 0x0078,
+ 0x6aa6, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x6bca,
+ 0x017f, 0x0040, 0x6ae0, 0x601c, 0xa084, 0x000f, 0x1079, 0x6ae3,
+ 0x0e7f, 0x0c7f, 0x007c, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb,
+ 0x6aeb, 0x6aed, 0x6aeb, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018,
+ 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009,
+ 0x0020, 0x1078, 0x6bf7, 0x017f, 0x047f, 0x1078, 0x6884, 0xa085,
+ 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x33df, 0x157e, 0x017e,
+ 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x6d05, 0x2011, 0x7296,
+ 0x1078, 0x5a35, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
+ 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
+ 0x8000, 0x2061, 0x7400, 0x2079, 0x0001, 0x8fff, 0x0040, 0x6b73,
+ 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6b73,
+ 0x88ff, 0x0040, 0x6b39, 0x2800, 0xac06, 0x00c0, 0x6b69, 0x2079,
+ 0x0000, 0x1078, 0x6c0f, 0x0040, 0x6b69, 0x2400, 0xac06, 0x0040,
+ 0x6b69, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6b69, 0xa786, 0x0007,
+ 0x0040, 0x6b69, 0x88ff, 0x00c0, 0x6b51, 0x6018, 0xa206, 0x00c0,
+ 0x6b69, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6b5c,
+ 0x047e, 0x1078, 0x6bb3, 0x047f, 0x0d7f, 0x6000, 0xa086, 0x0004,
+ 0x00c0, 0x6b64, 0x1078, 0x15f2, 0x1078, 0x6283, 0x88ff, 0x00c0,
+ 0x6b7c, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8,
+ 0x6b73, 0x0078, 0x6b25, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
+ 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6b74,
+ 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
+ 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18, 0x087f, 0x007c, 0x027e,
+ 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009,
+ 0x0000, 0x017e, 0x037e, 0x1078, 0x3447, 0x00c0, 0x6ba8, 0x2c10,
+ 0x2041, 0x0000, 0x1078, 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18,
+ 0x037f, 0x017f, 0x8108, 0x00f0, 0x6b99, 0x157f, 0x0c7f, 0x087f,
+ 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6bc7,
+ 0x6800, 0xa07d, 0x0040, 0x6bc4, 0x6803, 0x0000, 0x6b52, 0x1078,
+ 0x36a1, 0x2f68, 0x0078, 0x6bb8, 0x6b52, 0x1078, 0x36a1, 0x0f7f,
+ 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7400, 0x2071,
+ 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6bf2, 0x2100,
+ 0xac06, 0x0040, 0x6be4, 0x6000, 0xa086, 0x0000, 0x0040, 0x6be4,
+ 0x6008, 0xa206, 0x0040, 0x6bee, 0xace0, 0x0008, 0x2001, 0x6d15,
+ 0x2004, 0xac02, 0x00c8, 0x6bf2, 0x0078, 0x6bcf, 0xa085, 0x0001,
+ 0x0078, 0x6bf3, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
+ 0x007e, 0x1078, 0x130f, 0x007f, 0x1040, 0x12b7, 0x6837, 0x010d,
+ 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
+ 0x6c46, 0x684f, 0x0000, 0x1078, 0x36a1, 0x0d7f, 0x007c, 0x6700,
+ 0xa786, 0x0000, 0x0040, 0x6c22, 0xa786, 0x0001, 0x0040, 0x6c22,
+ 0xa786, 0x000a, 0x0040, 0x6c22, 0xa786, 0x0009, 0x0040, 0x6c22,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6d00, 0xd5a4, 0x0040, 0x6c30, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6c36, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6c3d, 0x2071, 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d00,
+ 0xd5a4, 0x0040, 0x6c4e, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040,
+ 0x6c54, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6c5b, 0x2071,
+ 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e,
+ 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d02, 0x1078, 0x6c6c,
+ 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8,
+ 0x6c75, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071,
+ 0x6d00, 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6d04,
+ 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800,
+ 0x1000, 0x2000, 0x4000, 0x8000, 0x614c
};
-#define ISP2100_CODE_LENGTH 0x5e69
+#define ISP2100_CODE_LENGTH 0x5c95
#endif
-#if !defined(ISP2100_FABRIC) && defined(ISP2100_SCCLUN)
-/************************************************************************
- * *
- * --- ISP2100 Initiator/Target Firmware --- *
- * with expanded LUN addressing. *
- * *
- * *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
+#if 0
/*
- * Firmware Version 1.15.07 (14:38 Oct 13, 1998)
+ * Firmware Version 1.14.06 (15:32 Jul 02, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+14
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x5f74, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5baf, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6f74, 0x2009, 0x0000, 0x20a9,
- 0x068c, 0x41a4, 0x3400, 0x20c9, 0x73ff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1ff1, 0x2051, 0x7000,
- 0x2a70, 0x705b, 0x8e00, 0x705f, 0xffff, 0x7057, 0x8df9, 0x7063,
- 0x0300, 0x1078, 0x1235, 0x20a1, 0x7600, 0x715c, 0x810d, 0x810d,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3134, 0x2020, 0x2020,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6baf, 0x2009, 0x0000, 0x20a9,
+ 0x0651, 0x41a4, 0x3400, 0x20c9, 0x6fff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1f6e, 0x2051, 0x6c00,
+ 0x2a70, 0x705b, 0x8a00, 0x705f, 0xffff, 0x7057, 0x89f9, 0x7063,
+ 0x0300, 0x1078, 0x1217, 0x20a1, 0x7200, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1200, 0x1078, 0x1321, 0x1078, 0x14a6, 0x1078, 0x192f,
- 0x1078, 0x32e1, 0x1078, 0x5687, 0x1078, 0x12ac, 0x1078, 0x22f7,
- 0x1078, 0x3a1c, 0x1078, 0x37f4, 0x1078, 0x41d0, 0x1078, 0x1dbe,
- 0x1078, 0x4410, 0x1078, 0x3f3d, 0x1078, 0x1cdd, 0x1078, 0x1d9d,
+ 0x1078, 0x11e2, 0x1078, 0x1301, 0x1078, 0x1486, 0x1078, 0x18ce,
+ 0x1078, 0x3162, 0x1078, 0x53b7, 0x1078, 0x128c, 0x1078, 0x2244,
+ 0x1078, 0x37a0, 0x1078, 0x3578, 0x1078, 0x3f4c, 0x1078, 0x1d4c,
+ 0x1078, 0x418b, 0x1078, 0x3cbc, 0x1078, 0x1c74, 0x1078, 0x1d2b,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2a59, 0x1078, 0x231f, 0x1078, 0x3a6c,
- 0x1078, 0x38df, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x41e8, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5359, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
- 0x10cd, 0x117d, 0x11fd, 0x11fe, 0x11ff, 0x1078, 0x1288, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b7c, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x320e, 0x1078, 0x42aa,
+ 0x00c0, 0x10bd, 0x1078, 0x2967, 0x1078, 0x226c, 0x1078, 0x37f0,
+ 0x1078, 0x3663, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x3f64, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x50d1, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x1130,
+ 0x10cd, 0x1161, 0x11df, 0x11e0, 0x11e1, 0x1078, 0x126a, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2a02, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x112d, 0x2011, 0x308c, 0x1078, 0x4026,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b0, 0x1078, 0x2a18, 0x1078, 0x51a4, 0x2011, 0x0004, 0x1078,
- 0x634b, 0x1078, 0x378e, 0x2079, 0x7051, 0x7804, 0xd0ac, 0x00c0,
- 0x1115, 0x2011, 0x0001, 0x1078, 0x634b, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x20a1, 0x2011, 0x0005,
- 0x1078, 0x52b3, 0x1078, 0x49b7, 0x0c7e, 0x2061, 0x0100, 0x60e3,
- 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x52b3, 0x1078,
- 0x49b7, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
- 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
- 0x0040, 0x1138, 0x1078, 0x20a1, 0x1078, 0x49b7, 0x0078, 0x117b,
- 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x7052, 0x2004, 0xd0ac,
- 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x017e, 0x1078, 0x34fa, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
- 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
- 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
- 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f8a, 0x1078, 0x2a92,
- 0x2001, 0x71b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
- 0x0000, 0x1078, 0x52b3, 0x2011, 0x0000, 0x1078, 0x52bd, 0x1078,
- 0x49b7, 0x1078, 0x4a67, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010, 0x7942,
- 0x7924, 0xd1b4, 0x0040, 0x118e, 0x7827, 0x0040, 0xd19c, 0x0040,
- 0x1193, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a,
- 0x0003, 0x0050, 0x11b9, 0x7954, 0xd1ac, 0x00c0, 0x11b9, 0x2009,
- 0x00f8, 0x1078, 0x32b0, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
- 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11b1, 0x7824, 0xd0ac, 0x00c0,
- 0x11ed, 0x00f0, 0x11a9, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x0078,
- 0x11f6, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0,
- 0x11bf, 0x2091, 0x6000, 0x00f0, 0x11bf, 0x7853, 0x0400, 0x782f,
- 0x0000, 0x2009, 0x00f8, 0x1078, 0x32b0, 0x20a9, 0x000e, 0x0005,
- 0x00f0, 0x11cf, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e4,
- 0x7824, 0xd0ac, 0x00c0, 0x11ed, 0x8319, 0x00c0, 0x11da, 0x2001,
- 0x0001, 0x1078, 0x1f8a, 0x0078, 0x11f4, 0x7828, 0xc09d, 0x782a,
- 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f,
- 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120c,
- 0x704f, 0xffff, 0x0078, 0x120e, 0x704f, 0x0000, 0x7053, 0xffff,
- 0x2061, 0x71a0, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800,
- 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000,
- 0x601f, 0x07d0, 0x2061, 0x71a8, 0x6003, 0x8000, 0x6007, 0x0000,
- 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000,
- 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x125b, 0x2011,
- 0x0000, 0x81ff, 0x0040, 0x125a, 0xa186, 0x0001, 0x00c0, 0x124a,
- 0x705f, 0x8fff, 0x7057, 0x7e01, 0x7063, 0x0100, 0x705b, 0x7e00,
- 0x0078, 0x1258, 0xa186, 0x0002, 0x00c0, 0x1252, 0x2011, 0x0000,
- 0x0078, 0x1258, 0xa186, 0x0005, 0x00c0, 0x1258, 0x2011, 0x0001,
- 0x1078, 0x1282, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078,
- 0x1282, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061,
- 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1270, 0xc18d, 0x0078, 0x127d,
- 0xc185, 0x2011, 0x0001, 0x1078, 0x1282, 0x2061, 0xffff, 0x2362,
- 0x2c04, 0xa306, 0x00c0, 0x127d, 0xc195, 0x2011, 0x0001, 0x1078,
- 0x1282, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c,
- 0x2091, 0x8000, 0x0068, 0x128a, 0x007e, 0x017e, 0x2079, 0x0000,
- 0x7818, 0xa084, 0x0000, 0x00c0, 0x1290, 0x017f, 0x792e, 0x007f,
- 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x7000, 0x7803,
- 0x0005, 0x0078, 0x12a9, 0x007c, 0x2071, 0x7000, 0x7158, 0x712e,
- 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c2,
- 0x705c, 0xa302, 0x00c8, 0x12c2, 0x220a, 0x2208, 0x2310, 0x8420,
- 0x0078, 0x12b4, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x7000, 0x7098, 0xa0ea, 0x0010,
- 0x00c8, 0x12d5, 0xa06e, 0x0078, 0x12df, 0x8001, 0x709a, 0x702c,
+ 0x73b0, 0x1078, 0x2926, 0x1078, 0x4f22, 0x2011, 0x0004, 0x1078,
+ 0x5fe2, 0x1078, 0x3512, 0x2079, 0x6c51, 0x7804, 0xd0ac, 0x00c0,
+ 0x1115, 0x2011, 0x0001, 0x1078, 0x5fe2, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x201e, 0x2011, 0x0005,
+ 0x1078, 0x502b, 0x1078, 0x4713, 0x0c7e, 0x2061, 0x0100, 0x60e3,
+ 0x0008, 0x0c7f, 0x127f, 0x0078, 0x112f, 0x7003, 0x0003, 0x2001,
+ 0x0000, 0x1078, 0x1f0f, 0x2011, 0x0000, 0x1078, 0x502b, 0x2011,
+ 0x0000, 0x1078, 0x5035, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008,
+ 0x0c7f, 0x1078, 0x4713, 0x1078, 0x47c3, 0x0f7f, 0x127f, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff, 0x0040, 0x113e,
+ 0x1078, 0x201e, 0x1078, 0x4713, 0x0078, 0x115f, 0x7080, 0xa005,
+ 0x00c0, 0x115f, 0x7003, 0x0003, 0x7087, 0xffff, 0x2001, 0x0000,
+ 0x1078, 0x1f0f, 0x1078, 0x29a0, 0x2001, 0x6db1, 0x2004, 0xa086,
+ 0x0005, 0x00c0, 0x1157, 0x2011, 0x0000, 0x1078, 0x502b, 0x2011,
+ 0x0000, 0x1078, 0x5035, 0x1078, 0x4713, 0x1078, 0x47c3, 0x127f,
+ 0x007c, 0x017e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0100,
+ 0x7843, 0x0000, 0x7924, 0xd1b4, 0x0040, 0x1170, 0x7827, 0x0040,
+ 0xd19c, 0x0040, 0x1175, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e,
+ 0x7900, 0xa18a, 0x0003, 0x0050, 0x119b, 0x7954, 0xd1ac, 0x00c0,
+ 0x119b, 0x2009, 0x00f8, 0x1078, 0x3131, 0x7843, 0x0090, 0x7843,
+ 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1193, 0x7824,
+ 0xd0ac, 0x00c0, 0x11cf, 0x00f0, 0x118b, 0x2001, 0x0001, 0x1078,
+ 0x1f0f, 0x0078, 0x11d8, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9,
+ 0x0008, 0x00e0, 0x11a1, 0x2091, 0x6000, 0x00f0, 0x11a1, 0x7853,
+ 0x0400, 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x3131, 0x20a9,
+ 0x000e, 0x0005, 0x00f0, 0x11b1, 0x7853, 0x1400, 0x7843, 0x0090,
+ 0x7843, 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c,
+ 0x0040, 0x11c6, 0x7824, 0xd0ac, 0x00c0, 0x11cf, 0x8319, 0x00c0,
+ 0x11bc, 0x2001, 0x0001, 0x1078, 0x1f0f, 0x0078, 0x11d6, 0x7828,
+ 0xc09d, 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400,
+ 0x157f, 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c,
+ 0x007c, 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002,
+ 0x0048, 0x11ee, 0x704f, 0xffff, 0x0078, 0x11f0, 0x704f, 0x0000,
+ 0x7053, 0xffff, 0x2061, 0x6da0, 0x6003, 0x0909, 0x6007, 0x0000,
+ 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003,
+ 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, 0x6da8, 0x6003, 0x8000,
+ 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff,
+ 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078,
+ 0x123d, 0x2011, 0x0000, 0x81ff, 0x0040, 0x123c, 0xa186, 0x0001,
+ 0x00c0, 0x122c, 0x705f, 0x8fff, 0x7057, 0x7a01, 0x7063, 0x0100,
+ 0x705b, 0x7a00, 0x0078, 0x123a, 0xa186, 0x0002, 0x00c0, 0x1234,
+ 0x2011, 0x0000, 0x0078, 0x123a, 0xa186, 0x0005, 0x00c0, 0x123a,
+ 0x2011, 0x0001, 0x1078, 0x1264, 0x007c, 0x2009, 0x0000, 0x2011,
+ 0x0000, 0x1078, 0x1264, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362,
+ 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1252, 0xc18d,
+ 0x0078, 0x125f, 0xc185, 0x2011, 0x0001, 0x1078, 0x1264, 0x2061,
+ 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0, 0x125f, 0xc195, 0x2011,
+ 0x0001, 0x1078, 0x1264, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205,
+ 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068, 0x126c, 0x007e, 0x017e,
+ 0x2079, 0x0000, 0x7818, 0xa084, 0x0000, 0x00c0, 0x1272, 0x017f,
+ 0x792e, 0x007f, 0x782a, 0x007f, 0x7826, 0x7823, 0x8002, 0x781b,
+ 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x6c00, 0x7803,
+ 0x0005, 0x0078, 0x1289, 0x007c, 0x2071, 0x6c00, 0x7158, 0x712e,
+ 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12a2,
+ 0x705c, 0xa302, 0x00c8, 0x12a2, 0x220a, 0x2208, 0x2310, 0x8420,
+ 0x0078, 0x1294, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x6c00, 0x7098, 0xa0ea, 0x0010,
+ 0x00c8, 0x12b5, 0xa06e, 0x0078, 0x12bf, 0x8001, 0x709a, 0x702c,
0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f,
- 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x127e, 0x2091, 0x8000,
- 0x7098, 0x8001, 0x00c8, 0x12ef, 0xa06e, 0x0078, 0x12f8, 0x709a,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6c00, 0x127e, 0x2091, 0x8000,
+ 0x7098, 0x8001, 0x00c8, 0x12cf, 0xa06e, 0x0078, 0x12d8, 0x709a,
0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000,
0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7000, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
- 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x1317, 0x6804, 0x6807,
- 0x0000, 0x007e, 0x1078, 0x12fb, 0x0d7f, 0x0078, 0x130b, 0x007c,
- 0x0e7e, 0x2071, 0x7000, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x71d9, 0x7007, 0x0000, 0x701b, 0x0000,
+ 0x6c00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
+ 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x12f7, 0x6804, 0x6807,
+ 0x0000, 0x007e, 0x1078, 0x12db, 0x0d7f, 0x0078, 0x12eb, 0x007c,
+ 0x0e7e, 0x2071, 0x6c00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
+ 0x007c, 0x0e7e, 0x2071, 0x6dd3, 0x7007, 0x0000, 0x701b, 0x0000,
0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012,
- 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x71d9,
- 0x7018, 0xa088, 0x71e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
- 0x7004, 0xa005, 0x00c0, 0x134a, 0x0f7e, 0x2079, 0x0010, 0x1078,
- 0x135b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x71d9, 0x7004,
- 0xa005, 0x00c0, 0x1359, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x135b,
- 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x135e, 0x1362, 0x13cc,
- 0x13e9, 0x13e9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x136a, 0x7007,
- 0x0000, 0x007c, 0x0d7e, 0xa180, 0x71e2, 0x2004, 0x700a, 0x2068,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x6dd3,
+ 0x7018, 0xa088, 0x6ddc, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
+ 0x7004, 0xa005, 0x00c0, 0x132a, 0x0f7e, 0x2079, 0x0010, 0x1078,
+ 0x133b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6dd3, 0x7004,
+ 0xa005, 0x00c0, 0x1339, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x133b,
+ 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x133e, 0x1342, 0x13ac,
+ 0x13c9, 0x13c9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x134a, 0x7007,
+ 0x0000, 0x007c, 0x0d7e, 0xa180, 0x6ddc, 0x2004, 0x700a, 0x2068,
0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832,
0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e,
- 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138c, 0x7007,
- 0x0001, 0x1078, 0x1391, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a7,
+ 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x136c, 0x7007,
+ 0x0001, 0x1078, 0x1371, 0x007c, 0x7007, 0x0002, 0x1078, 0x1387,
0x007c, 0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040,
- 0x00c8, 0x139c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
+ 0x00c8, 0x137c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
0x7803, 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e,
0x027e, 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014,
0x7803, 0x0026, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8,
- 0x13bb, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
+ 0x139b, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
0x7803, 0x0020, 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f,
0x137f, 0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099,
- 0x70e5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
+ 0x6ce5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
0x127e, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000,
- 0xc084, 0x7002, 0x700b, 0x70e0, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x7114, 0x209c, 0x20a1,
- 0x0014, 0x7803, 0x0026, 0x2001, 0x7115, 0x20ac, 0x53a6, 0x2099,
- 0x7116, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
+ 0xc084, 0x7002, 0x700b, 0x6ce0, 0x127f, 0x157f, 0x147f, 0x137f,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6d14, 0x209c, 0x20a1,
+ 0x0014, 0x7803, 0x0026, 0x2001, 0x6d15, 0x20ac, 0x53a6, 0x2099,
+ 0x6d16, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
0x127e, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000,
- 0xc08c, 0x7002, 0x700b, 0x7111, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x017e, 0x0e7e, 0x2071, 0x71d9, 0x0f7e, 0x2079, 0x0010,
- 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x142c, 0xa18c, 0x0700,
- 0x0040, 0x1429, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
- 0x142c, 0x7004, 0x1079, 0x1430, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
- 0x135b, 0x1438, 0x145a, 0x1474, 0x149d, 0x1436, 0x0078, 0x1436,
+ 0xc08c, 0x7002, 0x700b, 0x6d11, 0x127f, 0x157f, 0x147f, 0x137f,
+ 0x007c, 0x017e, 0x0e7e, 0x2071, 0x6dd3, 0x0f7e, 0x2079, 0x0010,
+ 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x140c, 0xa18c, 0x0700,
+ 0x0040, 0x1409, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
+ 0x140c, 0x7004, 0x1079, 0x1410, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
+ 0x133b, 0x1418, 0x143a, 0x1454, 0x147d, 0x1416, 0x0078, 0x1416,
0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803,
0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x1391, 0x007c,
+ 0x137f, 0x700c, 0xa005, 0x0040, 0x1441, 0x1078, 0x1371, 0x007c,
0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078,
- 0x135b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x13a7,
+ 0x133b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1441, 0x1078, 0x1387,
0x007c, 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a,
0x7838, 0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007,
- 0x0000, 0x1078, 0x135b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
- 0x70e3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x70e5, 0x2004, 0xd0bc,
- 0x0040, 0x1493, 0x2001, 0x70ee, 0x2004, 0xa080, 0x000d, 0x20a0,
+ 0x0000, 0x1078, 0x133b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
+ 0x6ce3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
+ 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x6ce5, 0x2004, 0xd0bc,
+ 0x0040, 0x1473, 0x2001, 0x6cee, 0x2004, 0xa080, 0x000d, 0x20a0,
0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000,
- 0x1078, 0x3b15, 0x1078, 0x135b, 0x007c, 0x2001, 0x7113, 0x2003,
- 0x0100, 0x7007, 0x0000, 0x1078, 0x135b, 0x007c, 0x127e, 0x2091,
- 0x2100, 0x2079, 0x0030, 0x2071, 0x71ea, 0x7003, 0x0000, 0x700f,
- 0x71f0, 0x7013, 0x71f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x14bc, 0x14c4, 0x150a, 0x14c4, 0x14c4,
- 0x14c4, 0x14ef, 0x14d3, 0x14c8, 0xa085, 0x0001, 0x0078, 0x1524,
- 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c, 0x682a,
- 0x6858, 0x0078, 0x1512, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
- 0x14c4, 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c,
+ 0x1078, 0x3899, 0x1078, 0x133b, 0x007c, 0x2001, 0x6d13, 0x2003,
+ 0x0100, 0x7007, 0x0000, 0x1078, 0x133b, 0x007c, 0x127e, 0x2091,
+ 0x2100, 0x2079, 0x0030, 0x2071, 0x6de4, 0x7003, 0x0000, 0x700f,
+ 0x6dea, 0x7013, 0x6dea, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
+ 0xa184, 0x0007, 0x0079, 0x149c, 0x14a4, 0x14ea, 0x14a4, 0x14a4,
+ 0x14a4, 0x14cf, 0x14b3, 0x14a8, 0xa085, 0x0001, 0x0078, 0x1504,
+ 0x684c, 0xd0bc, 0x0040, 0x14a4, 0x6860, 0x682e, 0x685c, 0x682a,
+ 0x6858, 0x0078, 0x14f2, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
+ 0x14a4, 0x684c, 0xd0bc, 0x0040, 0x14a4, 0x6860, 0x682e, 0x685c,
0x682a, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0x6858, 0x0078, 0x151a, 0xa18c,
- 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14c4, 0x684c, 0xd0ac, 0x0040,
- 0x14c4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
- 0x0078, 0x151a, 0x684c, 0xd0ac, 0x0040, 0x14c4, 0xa006, 0x682e,
- 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1beb, 0x210c, 0x6932,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0x6858, 0x0078, 0x14fa, 0xa18c,
+ 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14a4, 0x684c, 0xd0ac, 0x0040,
+ 0x14a4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
+ 0x0078, 0x14fa, 0x684c, 0xd0ac, 0x0040, 0x14a4, 0xa006, 0x682e,
+ 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1b82, 0x210c, 0x6932,
0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1,
- 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x153f, 0xa280,
- 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x153b, 0x1078,
- 0x14b7, 0x10c0, 0x1288, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e,
- 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f,
- 0x7000, 0xa005, 0x00c0, 0x1553, 0x7206, 0x2001, 0x1567, 0x007e,
- 0x2260, 0x0078, 0x167f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108,
- 0x240a, 0x8108, 0xa182, 0x720b, 0x0048, 0x1560, 0x2009, 0x71f0,
- 0x710e, 0x7000, 0xa005, 0x00c0, 0x1567, 0x1078, 0x1668, 0x127f,
- 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100,
- 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110,
- 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x15bb, 0x6808, 0xa005,
- 0x0040, 0x1621, 0x7000, 0xa005, 0x00c0, 0x1588, 0x0078, 0x15b5,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1625, 0x7004, 0xa406, 0x00c0,
- 0x15b5, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x159e, 0x047e,
- 0x1078, 0x1737, 0x047f, 0x2460, 0x0078, 0x157e, 0x2001, 0x0207,
- 0x2004, 0xd09c, 0x00c0, 0x1591, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x15af, 0xa086, 0x6000, 0x0040, 0x15af, 0x0078, 0x1591, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x571c, 0x0078, 0x1625, 0x6808, 0xa005, 0x0040, 0x1621, 0x7000,
- 0xa005, 0x00c0, 0x15c5, 0x0078, 0x1621, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x15ce, 0x7004, 0xa406, 0x00c0, 0x1621, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15db, 0x047e, 0x1078, 0x1737, 0x047f,
- 0x2460, 0x0078, 0x15bb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15ce, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d4, 0x7804,
- 0xa084, 0x6000, 0x0040, 0x15f2, 0xa086, 0x6000, 0x0040, 0x15f2,
- 0x0078, 0x15ce, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e,
- 0x0001, 0x0040, 0x1613, 0xa08e, 0x0002, 0x00c0, 0x1621, 0x0c7e,
- 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1bc0, 0x2804, 0xac70, 0x6034,
- 0xd09c, 0x00c0, 0x160f, 0x7308, 0x720c, 0x0078, 0x1611, 0x7310,
- 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810,
- 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x2009, 0x0048, 0x1078, 0x571c, 0x0c7f, 0x0d7f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x71ea, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1665, 0x7004, 0xac06, 0x00c0, 0x1656, 0x2079, 0x0030,
- 0x7804, 0xd0fc, 0x00c0, 0x1652, 0x2001, 0x0207, 0x2004, 0xd09c,
- 0x00c0, 0x1638, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1644,
- 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000,
- 0x0078, 0x1656, 0x1078, 0x1737, 0x0078, 0x162d, 0x157e, 0x20a9,
- 0x0009, 0x2009, 0x71f0, 0x2104, 0xac06, 0x00c0, 0x1660, 0x200a,
- 0xa188, 0x0003, 0x00f0, 0x165b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1670, 0x7003, 0x0000, 0x007c,
- 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108,
- 0xa182, 0x720b, 0x0048, 0x167e, 0x2009, 0x71f0, 0x7112, 0x8cff,
- 0x00c0, 0x169e, 0x7908, 0xd1ec, 0x00c0, 0x1692, 0x1078, 0x190d,
- 0x0040, 0x1692, 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168c,
- 0x7803, 0x0006, 0x7007, 0x0000, 0x1078, 0x190d, 0x0040, 0x16c5,
- 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x16c5, 0x6010, 0x2068,
- 0x2d58, 0x6828, 0xa406, 0x00c0, 0x16a9, 0x682c, 0xa306, 0x0040,
- 0x16ad, 0x1078, 0x1c0b, 0x00c0, 0x1682, 0x684c, 0xd0f4, 0x00c0,
- 0x1682, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
- 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078, 0x16c6, 0x0040, 0x16c4,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x2d58, 0x007c, 0x8aff, 0x0040,
- 0x1732, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e5, 0x0d7e,
- 0x2804, 0xac68, 0x2900, 0x0079, 0x16d5, 0x1714, 0x16f5, 0x16f5,
- 0x1714, 0x1714, 0x170c, 0x1714, 0x16f5, 0x1714, 0x16fb, 0x16fb,
- 0x1714, 0x1714, 0x1714, 0x1703, 0x16fb, 0xc0fc, 0x6852, 0x6b6c,
- 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1717, 0x2804,
- 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1717, 0x6b08, 0x6a0c, 0x6d00,
- 0x6c04, 0x0078, 0x1717, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
- 0x6e0c, 0x0078, 0x1717, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
- 0xa086, 0x001e, 0x00c0, 0x1714, 0x0d7f, 0x1078, 0x1ba7, 0x00c0,
- 0x16c6, 0xa00e, 0x0078, 0x1732, 0x0d7f, 0x1078, 0x1288, 0x7b22,
- 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
- 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
- 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816,
- 0x1078, 0x1ba7, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1735, 0xa184, 0x0003,
- 0xa086, 0x0003, 0x0040, 0x1735, 0x7000, 0x0079, 0x174f, 0x1757,
- 0x1759, 0x182a, 0x188e, 0x18a5, 0x1757, 0x1757, 0x1757, 0x1078,
- 0x1288, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0, 0x176e, 0x8aff,
- 0x0040, 0x17ca, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0040, 0x18b7,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e, 0x037e, 0x6b28,
- 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a,
- 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101,
- 0x6816, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078,
- 0x1bc0, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003,
- 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x17ab, 0x684c, 0xd0e4, 0x0040, 0x17ab, 0x7004, 0x2060, 0x2009,
- 0x0048, 0x1078, 0x571c, 0x7808, 0xd0ec, 0x00c0, 0x17b5, 0x7803,
- 0x0009, 0x7003, 0x0004, 0x0078, 0x18b7, 0x1078, 0x1668, 0x0078,
- 0x18b7, 0x057e, 0x7d0c, 0x1078, 0x6f20, 0x057f, 0x1078, 0x18bb,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0,
- 0x17e2, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17de,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x571c, 0x1078, 0x1668,
- 0x0078, 0x18b7, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183,
- 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007,
- 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a,
- 0x810b, 0x810b, 0x810b, 0x1078, 0x18ea, 0x7803, 0x0004, 0x780f,
- 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1803, 0x7803,
- 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007, 0x0000,
- 0x2060, 0x2009, 0x0048, 0x1078, 0x571c, 0x1078, 0x190d, 0x0040,
- 0x17de, 0x7908, 0xd1ec, 0x00c0, 0x1821, 0x2009, 0x0009, 0x0078,
- 0x1823, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x8001, 0x7002, 0xd194, 0x0040, 0x183c, 0x7804,
- 0xd0fc, 0x00c0, 0x173f, 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001,
- 0x1078, 0x16c6, 0x0078, 0x18b7, 0xa184, 0x0880, 0x00c0, 0x1849,
- 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078,
- 0x18b7, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x187d,
- 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0, 0x0d7e, 0x0f7e,
- 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x186d, 0x6808,
- 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c,
- 0x7814, 0xa101, 0x7816, 0x0078, 0x1879, 0x6810, 0x2008, 0xa31a,
- 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101,
- 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1779, 0x057e, 0x7d0c, 0x1078,
- 0x6f20, 0x057f, 0x1078, 0x18bb, 0x697c, 0x6912, 0x6980, 0x6916,
- 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x18a1, 0x6808, 0x8001,
- 0x680a, 0x00c0, 0x18a1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x571c, 0x1078, 0x1668, 0x0078, 0x18b7, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x18a1, 0x2068,
- 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x167f, 0x017f,
- 0x007f, 0x127f, 0x007c, 0x1078, 0x18cc, 0x20e1, 0x9028, 0x700f,
- 0x71f0, 0x7013, 0x71f0, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102,
- 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003,
- 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0,
- 0x18e9, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x18e9,
- 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18e9, 0x8421, 0x00c0,
- 0x18d3, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
- 0xa084, 0xf000, 0xa10d, 0x1078, 0x18cc, 0x20e1, 0x7000, 0x7324,
- 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e,
- 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138,
- 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908,
- 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x191a, 0xa085, 0x0001,
- 0x0078, 0x192c, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1925, 0x20e1,
- 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c,
- 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e,
- 0x2071, 0x720b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
- 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x19b1, 0x6934, 0xa184,
- 0x0007, 0x0079, 0x1943, 0x194b, 0x199c, 0x194b, 0x194b, 0x194b,
- 0x1981, 0x195e, 0x194d, 0x1078, 0x1288, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x19a4, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x194b, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0x0078,
- 0x19ad, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x19b1, 0x684c,
- 0xd0b4, 0x0040, 0x1ab3, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0xa006,
- 0x682e, 0x682a, 0x0078, 0x19ad, 0x684c, 0xd0b4, 0x0040, 0x1733,
- 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084,
- 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd,
- 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc,
- 0x10c0, 0x1ab7, 0x0e7e, 0x0d7e, 0x2071, 0x720b, 0x7000, 0xa005,
- 0x00c0, 0x1a2d, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004,
- 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e,
- 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004,
- 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060,
- 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007,
- 0x0040, 0x19ef, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108,
- 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a,
- 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0,
- 0x1a06, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a13, 0x037e, 0x047e,
- 0x6b14, 0x6c10, 0x1078, 0x1c0b, 0x047f, 0x037f, 0x0040, 0x1a13,
- 0x0c7f, 0x0078, 0x1a2d, 0x8aff, 0x00c0, 0x1a1b, 0x0c7f, 0xa085,
- 0x0001, 0x0078, 0x1a2d, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020,
- 0x2009, 0x0001, 0x1078, 0x1a31, 0x0040, 0x1a2a, 0x2009, 0x0001,
- 0x1078, 0x1a31, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff,
- 0x0040, 0x1aac, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203,
- 0x0048, 0x1aab, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a5e,
- 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1a4e, 0x1a8d, 0x1a6e,
- 0x1a6e, 0x1a8d, 0x1a8d, 0x1a85, 0x1a8d, 0x1a6e, 0x1a8d, 0x1a74,
- 0x1a74, 0x1a8d, 0x1a8d, 0x1a8d, 0x1a7c, 0x1a74, 0xc0fc, 0x6852,
- 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a91, 0x0d7e,
- 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x6b08, 0x6a0c,
- 0x6d00, 0x6c04, 0x0078, 0x1a90, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
- 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x0d7f, 0x0d7e, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1a8d, 0x0d7f, 0x1078, 0x1ba7,
- 0x00c0, 0x1a37, 0xa00e, 0x0078, 0x1aac, 0x0d7f, 0x1078, 0x1288,
- 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902,
- 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201,
- 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078,
- 0x1ba7, 0x0078, 0x1aac, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f,
- 0x067f, 0x077f, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x2079, 0x0020, 0x2071, 0x720b, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1ab5, 0x7000, 0x0079,
- 0x1ad1, 0x1b78, 0x1ad5, 0x1b45, 0x1b76, 0x8001, 0x7002, 0xd19c,
- 0x00c0, 0x1ae9, 0x8aff, 0x0040, 0x1b08, 0x2009, 0x0001, 0x1078,
- 0x1a31, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31, 0x0078,
- 0x1b78, 0x7803, 0x0004, 0xd194, 0x0040, 0x1af9, 0x6850, 0xc0fc,
- 0x6852, 0x8aff, 0x00c0, 0x1afe, 0x684c, 0xc0f5, 0x684e, 0x0078,
- 0x1afe, 0x1078, 0x1bc0, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826,
- 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b78,
- 0x711c, 0x81ff, 0x0040, 0x1b1e, 0x7918, 0x7922, 0x7827, 0x0000,
- 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e,
- 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1b78, 0x0f7e, 0x027e,
- 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284,
- 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b2c,
- 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803,
- 0x0008, 0x7003, 0x0000, 0x0078, 0x1b78, 0x8001, 0x7002, 0xd194,
- 0x0040, 0x1b5a, 0x7804, 0xd0fc, 0x00c0, 0x1ac7, 0xd19c, 0x00c0,
- 0x1b74, 0x8aff, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31,
- 0x0078, 0x1b78, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0,
- 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b6d, 0x6808,
- 0xa31a, 0x680c, 0xa213, 0x0078, 0x1b71, 0x6810, 0xa31a, 0x6814,
- 0xa213, 0x0d7f, 0x0078, 0x1af9, 0x0078, 0x1af9, 0x1078, 0x1288,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c,
- 0x0f7e, 0x0e7e, 0x2071, 0x720b, 0x7000, 0xa086, 0x0000, 0x0040,
- 0x1ba4, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040,
- 0x1b8b, 0x1078, 0x1ab7, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b8b,
- 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b9a, 0x20e1, 0x9040,
- 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840,
- 0x2804, 0xa005, 0x00c0, 0x1bbb, 0x6004, 0xa005, 0x0040, 0x1bbd,
- 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1beb, 0x2044,
- 0x88ff, 0x1040, 0x1288, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
- 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1bda, 0x2c00, 0xad06,
- 0x0040, 0x1bcf, 0x6000, 0xa005, 0x00c0, 0x1bcf, 0x2d00, 0x2060,
- 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1bfb, 0x2044, 0x88ff,
- 0x1040, 0x1288, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
- 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021,
- 0x0027, 0x0000, 0x0000, 0x0000, 0x1be0, 0x1bdc, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be0, 0x0000, 0x1be7, 0x1be4, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be7, 0x0000, 0x1be2, 0x1be2, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be2, 0x0000, 0x1be8, 0x1be8, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be8, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055,
- 0x0040, 0x1ca8, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1beb,
- 0xa986, 0x0007, 0x0040, 0x1c24, 0xa986, 0x000e, 0x0040, 0x1c24,
- 0xa986, 0x000f, 0x00c0, 0x1c28, 0x605c, 0xa422, 0x6060, 0xa31a,
- 0x2804, 0xa045, 0x00c0, 0x1c36, 0x0050, 0x1c30, 0x0078, 0x1ca8,
- 0x6004, 0xa065, 0x0040, 0x1ca8, 0x0078, 0x1c13, 0x2804, 0xa005,
- 0x0040, 0x1c54, 0xac68, 0xd99c, 0x00c0, 0x1c44, 0x6808, 0xa422,
- 0x680c, 0xa31b, 0x0078, 0x1c48, 0x6810, 0xa422, 0x6814, 0xa31b,
- 0x0048, 0x1c73, 0x2300, 0xa405, 0x0040, 0x1c5a, 0x8a51, 0x0040,
- 0x1ca8, 0x8840, 0x0078, 0x1c36, 0x6004, 0xa065, 0x0040, 0x1ca8,
- 0x0078, 0x1c13, 0x8a51, 0x0040, 0x1ca8, 0x8840, 0x2804, 0xa005,
- 0x00c0, 0x1c6d, 0x6004, 0xa065, 0x0040, 0x1ca8, 0x6034, 0xa0cc,
- 0x000f, 0xa9c0, 0x1beb, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc,
- 0x6852, 0x0078, 0x1ca0, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000,
- 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c8e,
- 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1288,
- 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1c9a, 0x6910, 0x2400,
- 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1288, 0x6800, 0xa420,
- 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852,
- 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1cad,
- 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005,
- 0x2004, 0xa084, 0x0007, 0x0079, 0x1cb5, 0x1cbd, 0x1cbe, 0x1cc1,
- 0x1cc4, 0x1cc9, 0x1ccc, 0x1cd1, 0x1cd6, 0x007c, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1737, 0x007c, 0x1078, 0x1737, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1411, 0x007c, 0x1078, 0x1ab7, 0x1078, 0x1411,
- 0x007c, 0x1078, 0x1737, 0x1078, 0x1411, 0x007c, 0x1078, 0x1737,
- 0x1078, 0x1ab7, 0x1078, 0x1411, 0x007c, 0x127e, 0x2091, 0x2300,
- 0x2079, 0x0200, 0x2071, 0x7480, 0x2069, 0x7000, 0x2009, 0x0004,
- 0x7912, 0x7817, 0x0004, 0x1078, 0x1fb7, 0x781b, 0x0002, 0x20e1,
- 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084,
- 0x0007, 0x0079, 0x1cfb, 0x1d1f, 0x1d03, 0x1d07, 0x1d0b, 0x1d11,
- 0x1d15, 0x1d19, 0x1d1d, 0x1078, 0x3f46, 0x0078, 0x1d1f, 0x1078,
- 0x3f75, 0x0078, 0x1d1f, 0x1078, 0x3f46, 0x1078, 0x3f75, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x127f,
- 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040,
- 0x1d2b, 0x1078, 0x1288, 0xa184, 0x0030, 0x0040, 0x1d3c, 0x6a00,
- 0xa286, 0x0003, 0x00c0, 0x1d36, 0x1078, 0x1288, 0x1078, 0x3247,
- 0x20e1, 0x9010, 0x0078, 0x1d48, 0xa184, 0x00c0, 0x0040, 0x1d42,
- 0x1078, 0x1288, 0xa184, 0x0300, 0x0040, 0x1d48, 0x20e1, 0x9020,
- 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e,
- 0x2071, 0x7000, 0x7128, 0x2001, 0x71a3, 0x2102, 0x2001, 0x71ab,
- 0x2102, 0xa182, 0x0211, 0x00c8, 0x1d61, 0x2009, 0x0008, 0x0078,
- 0x1d8b, 0xa182, 0x0259, 0x00c8, 0x1d69, 0x2009, 0x0007, 0x0078,
- 0x1d8b, 0xa182, 0x02c1, 0x00c8, 0x1d71, 0x2009, 0x0006, 0x0078,
- 0x1d8b, 0xa182, 0x0349, 0x00c8, 0x1d79, 0x2009, 0x0005, 0x0078,
- 0x1d8b, 0xa182, 0x0421, 0x00c8, 0x1d81, 0x2009, 0x0004, 0x0078,
- 0x1d8b, 0xa182, 0x0581, 0x00c8, 0x1d89, 0x2009, 0x0003, 0x0078,
- 0x1d8b, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182, 0x0005,
- 0x00c8, 0x1d95, 0x7916, 0x0078, 0x1d97, 0x7817, 0x0004, 0x1078,
- 0x1fb7, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2061, 0x0100, 0x2071, 0x7000, 0x6024, 0x6026, 0x6033, 0x00ef,
- 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7,
- 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af,
- 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x702b,
- 0x2003, 0x0000, 0x2001, 0x702a, 0x2003, 0x0001, 0x007c, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c,
- 0x00c0, 0x1dd6, 0xa184, 0x0007, 0x0079, 0x1ddc, 0xa195, 0x0004,
- 0xa284, 0x0007, 0x0079, 0x1ddc, 0x1e08, 0x1de4, 0x1de8, 0x1dec,
- 0x1df2, 0x1df6, 0x1dfc, 0x1e02, 0x1078, 0x4423, 0x0078, 0x1e08,
- 0x1078, 0x4512, 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x4423,
- 0x0078, 0x1e08, 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x4423,
- 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x1e0d,
- 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x4423, 0x1078, 0x1e0d,
- 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1ebd,
- 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196,
- 0xff00, 0x0040, 0x1e3c, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116,
- 0x0040, 0x1e3c, 0x7130, 0xd18c, 0x00c0, 0x1e3c, 0x2011, 0x7052,
- 0x2214, 0xd2ec, 0x0040, 0x1e30, 0xc18d, 0x7132, 0x0078, 0x1e3c,
- 0x6240, 0xa294, 0x0010, 0x0040, 0x1e7a, 0x6248, 0xa294, 0xff00,
- 0xa296, 0xff00, 0x00c0, 0x1e7a, 0x037e, 0x73b0, 0x2011, 0x8013,
- 0x1078, 0x2a18, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0x7052,
- 0x220c, 0xd1a4, 0x0040, 0x1e62, 0x017e, 0x2009, 0x0001, 0x2011,
- 0x0100, 0x1078, 0x43f1, 0x2019, 0x000e, 0x1078, 0x6e67, 0xa484,
- 0x00ff, 0x1078, 0x1fe4, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
- 0x6ecf, 0x017f, 0xd1ac, 0x00c0, 0x1e6b, 0x2019, 0x0004, 0x1078,
- 0x2186, 0x0078, 0x1e7a, 0x157e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x1078, 0x34fa, 0x00c0, 0x1e76, 0x1078, 0x32ed, 0x8108, 0x00f0,
- 0x1e70, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
- 0x1078, 0x32b0, 0x0f7e, 0x2079, 0x71c9, 0x783c, 0xa086, 0x0000,
- 0x0040, 0x1e92, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140,
- 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x52b3, 0x2011,
- 0x0002, 0x1078, 0x52bd, 0x1078, 0x51c9, 0x1078, 0x4327, 0x037e,
- 0x2019, 0x0000, 0x1078, 0x525b, 0x037f, 0x60e3, 0x0000, 0x017f,
- 0x2001, 0x7000, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1eb5, 0xd19c,
- 0x00c0, 0x1eb5, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001,
- 0x701e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1f5e,
- 0x0f7e, 0x2079, 0x71c9, 0x783c, 0xa086, 0x0001, 0x00c0, 0x1ee1,
- 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x2079, 0x71b6, 0x7807, 0x0000, 0x7833,
- 0x0000, 0x1078, 0x49b7, 0x1078, 0x4a67, 0x017f, 0x0f7f, 0x0078,
- 0x1f5e, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040, 0x1f16, 0x1078,
- 0x4327, 0x1078, 0x50b0, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x1ef9, 0x6803, 0x1000, 0x6803,
- 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x71b6, 0x6028, 0xa09a, 0x0002,
- 0x00c8, 0x1f09, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x50a2, 0x0078,
- 0x1f5d, 0x2019, 0x71bf, 0x2304, 0xa065, 0x0040, 0x1f13, 0x2009,
- 0x0027, 0x1078, 0x571c, 0x0c7f, 0x0078, 0x1f5d, 0xd2bc, 0x0040,
- 0x1f5d, 0x1078, 0x4335, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e,
- 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1f2b, 0x6803,
- 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x71b6, 0x6044,
- 0xa09a, 0x0002, 0x00c8, 0x1f4c, 0x8000, 0x6046, 0x603c, 0x0c7f,
- 0xa005, 0x0040, 0x1f5d, 0x1078, 0x432c, 0xa080, 0x0007, 0x2004,
- 0xa086, 0x0006, 0x00c0, 0x1f48, 0x6017, 0x0012, 0x0078, 0x1f5d,
- 0x6017, 0x0016, 0x0078, 0x1f5d, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x525b, 0x037f, 0x2019, 0x71c5, 0x2304, 0xa065, 0x0040, 0x1f5c,
- 0x2009, 0x004f, 0x1078, 0x571c, 0x0c7f, 0x017f, 0xd19c, 0x0040,
- 0x1f86, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078,
- 0x52b3, 0x2011, 0x0002, 0x1078, 0x52bd, 0x1078, 0x51c9, 0x1078,
- 0x4327, 0x037e, 0x2019, 0x0000, 0x1078, 0x525b, 0x037f, 0x60e3,
- 0x0000, 0x1078, 0x6f3e, 0x1078, 0x6f5c, 0x2001, 0x7000, 0x2003,
- 0x0004, 0x6027, 0x0008, 0x1078, 0x117d, 0x017f, 0xa18c, 0xffd0,
- 0x6126, 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7000, 0x71a8, 0x70aa, 0xa116, 0x0040,
- 0x1fb0, 0x81ff, 0x0040, 0x1fa2, 0x2011, 0x8011, 0x1078, 0x2a18,
- 0x0078, 0x1fb0, 0x2011, 0x8012, 0x1078, 0x2a18, 0x037e, 0x0c7e,
- 0x2061, 0x0100, 0x2019, 0x0028, 0x1078, 0x2186, 0x0c7f, 0x037f,
- 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e,
- 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1fd2, 0x2204,
- 0x60f2, 0xa192, 0x0005, 0x00c8, 0x1fc9, 0xa190, 0x1fdb, 0x0078,
- 0x1fcb, 0x2011, 0x1fdf, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f,
- 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, 0x0348,
- 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140,
- 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0xa080, 0x2207, 0x200c, 0xa18c,
- 0xff00, 0x810f, 0x007c, 0xa080, 0x2207, 0x200c, 0xa18c, 0x00ff,
- 0x007c, 0x2011, 0x2015, 0x2019, 0x201f, 0x2025, 0x202b, 0x2031,
- 0x2039, 0x2041, 0x2047, 0x204d, 0x2055, 0x205d, 0x2065, 0x206d,
- 0x2077, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x107e, 0x007e, 0x0078, 0x209a, 0x107e, 0x007e, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078,
- 0x209a, 0x0005, 0x0078, 0x2081, 0xb084, 0x003c, 0x8004, 0x8004,
- 0x0079, 0x208a, 0x209a, 0x2017, 0x201b, 0x2021, 0x2027, 0x202d,
- 0x2033, 0x203b, 0x2043, 0x2049, 0x204f, 0x2057, 0x205f, 0x2067,
- 0x206f, 0x2079, 0x0008, 0x2084, 0x007f, 0x107f, 0x2091, 0x8001,
- 0x007c, 0x0c7e, 0x027e, 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff,
- 0x0040, 0x20f0, 0x037e, 0x7384, 0xa38e, 0xffff, 0x00c0, 0x20b2,
- 0x2019, 0x0001, 0x8314, 0xa2e0, 0x75c0, 0x2c04, 0xa38c, 0x0001,
- 0x0040, 0x20bf, 0xa084, 0xff00, 0x8007, 0x0078, 0x20c1, 0xa084,
- 0x00ff, 0xa70e, 0x0040, 0x20e5, 0xa08e, 0x0000, 0x0040, 0x20e5,
- 0xa08e, 0x00ff, 0x0040, 0x20eb, 0x1078, 0x1fe4, 0x1078, 0x34bf,
- 0x00c0, 0x20e8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x20df, 0x1078, 0x2138, 0x0040, 0x20e8, 0x0078, 0x20e5, 0x1078,
- 0x21d3, 0x1078, 0x215f, 0x0040, 0x20e8, 0x8318, 0x0078, 0x20b2,
- 0x7386, 0x0078, 0x20ed, 0x7087, 0xffff, 0x037f, 0x0078, 0x2135,
- 0xa780, 0x2207, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e,
- 0x2009, 0x0000, 0x7084, 0xa096, 0xffff, 0x0040, 0x210c, 0xa092,
- 0x007e, 0x0048, 0x2107, 0x7087, 0xffff, 0x0078, 0x2132, 0x2008,
- 0x2011, 0x007e, 0xa202, 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106,
- 0x0040, 0x2129, 0x1078, 0x34bf, 0x00c0, 0x2132, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2123, 0x1078, 0x2138, 0x0040,
- 0x2132, 0x0078, 0x2129, 0x1078, 0x21d3, 0x1078, 0x215f, 0x0040,
- 0x2132, 0x017f, 0x8108, 0x157f, 0x00f0, 0x210c, 0x7087, 0xffff,
- 0x0078, 0x2135, 0x017f, 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c,
- 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x568f, 0x0040,
- 0x215a, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
- 0x348e, 0x2001, 0x0000, 0x1078, 0x34a2, 0x127e, 0x2091, 0x8000,
- 0x7080, 0x8000, 0x7082, 0x127f, 0x2009, 0x0004, 0x1078, 0x571c,
- 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e,
- 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x568f, 0x0040, 0x2181,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2001, 0x0002, 0x1078, 0x34a2, 0x127e, 0x2091, 0x8000, 0x7080,
- 0x8000, 0x7082, 0x127f, 0x2009, 0x0002, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e,
- 0x067e, 0x037e, 0x027e, 0x1078, 0x46a6, 0x1078, 0x4656, 0x1078,
- 0x5b04, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa,
- 0x00c0, 0x219e, 0x1078, 0x36e4, 0x1078, 0x32ed, 0x017f, 0x8108,
- 0x00f0, 0x2195, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0,
- 0x027e, 0x2019, 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08,
- 0x1078, 0x6d09, 0x017f, 0x2e60, 0x1078, 0x36e4, 0x1078, 0x32ed,
- 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
- 0x2071, 0x7000, 0x7080, 0xa005, 0x0040, 0x21d0, 0x8001, 0x7082,
- 0x007f, 0x0e7f, 0x007c, 0x6000, 0xc08c, 0x6002, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x81ff, 0x00c0, 0x21e4,
- 0x20a9, 0x0001, 0x0078, 0x21e8, 0x20a9, 0x007e, 0x2011, 0x0000,
- 0x027e, 0xa2e0, 0x7120, 0x2c64, 0x8cff, 0x0040, 0x21fa, 0x2019,
- 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x1078, 0x36e4, 0x027f, 0x8210, 0x00f0, 0x21e8, 0x027e, 0x027f,
- 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x7eef,
- 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
- 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
- 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
- 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
- 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
- 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
- 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
- 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
- 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
- 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
- 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
- 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
- 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
- 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
- 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
- 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
- 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
- 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
- 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
- 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
- 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
- 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
- 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
- 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
- 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
- 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x2071,
- 0x706d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e,
- 0x7033, 0x707d, 0x7037, 0x707d, 0x7007, 0x0001, 0x2061, 0x70bd,
- 0x6003, 0x0002, 0x007c, 0x0090, 0x231e, 0x0068, 0x231e, 0x2071,
- 0x706d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x231e, 0x2a60, 0x7820,
- 0xa08e, 0x0069, 0x00c0, 0x2405, 0x0079, 0x23a2, 0x007c, 0x2071,
- 0x706d, 0x7004, 0x0079, 0x2324, 0x2328, 0x2329, 0x2333, 0x2345,
- 0x007c, 0x0090, 0x2332, 0x0068, 0x2332, 0x2b78, 0x7818, 0xd084,
- 0x0040, 0x2351, 0x007c, 0x2b78, 0x2061, 0x70bd, 0x6008, 0xa08e,
- 0x0100, 0x0040, 0x2340, 0xa086, 0x0200, 0x0040, 0x23fd, 0x007c,
- 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834,
- 0xa086, 0x0103, 0x0040, 0x234d, 0x007c, 0x2a60, 0x2b78, 0x7018,
- 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x235a, 0x61a8,
- 0x0079, 0x2362, 0x2100, 0xa08a, 0x0036, 0x00c8, 0x23f9, 0x61a8,
- 0x0079, 0x23a2, 0x23db, 0x240d, 0x2415, 0x2419, 0x2421, 0x2427,
- 0x242b, 0x2434, 0x2438, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x23f9,
- 0x2448, 0x23f9, 0x2458, 0x246f, 0x2486, 0x2502, 0x2507, 0x2534,
- 0x258e, 0x259f, 0x25bd, 0x25f0, 0x25fa, 0x2607, 0x261a, 0x2634,
- 0x263d, 0x267a, 0x2680, 0x23f9, 0x268b, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x268f, 0x2695, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x269d, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x26aa, 0x26b0, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x26c2, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x270f, 0x27dc, 0x27f0, 0x27f7, 0x285a, 0x28ab,
- 0x28b6, 0x28f5, 0x2904, 0x2913, 0x2916, 0x26c6, 0x293f, 0x2986,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2a9f, 0x2aad, 0x2aba, 0x2af4,
- 0x713c, 0x0078, 0x23db, 0x2021, 0x4000, 0x1078, 0x29f2, 0x127e,
- 0x2091, 0x8000, 0x0068, 0x23e8, 0x7818, 0xd084, 0x0040, 0x23eb,
- 0x127f, 0x0078, 0x23df, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a,
- 0x7b2e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f,
- 0x007c, 0x2021, 0x4001, 0x0078, 0x23dd, 0x2021, 0x4002, 0x0078,
- 0x23dd, 0x2021, 0x4003, 0x0078, 0x23dd, 0x2021, 0x4005, 0x0078,
- 0x23dd, 0x2021, 0x4006, 0x0078, 0x23dd, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2a01, 0x7823, 0x0004, 0x7824,
- 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2a05, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x23db, 0x7924,
- 0x2114, 0x0078, 0x23db, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9,
- 0x0007, 0x53a3, 0x0078, 0x23db, 0x7824, 0x2060, 0x0078, 0x244a,
- 0x2009, 0x0001, 0x2011, 0x000f, 0x2019, 0x0007, 0x0078, 0x23db,
- 0x7d38, 0x7c3c, 0x0078, 0x240f, 0x7d38, 0x7c3c, 0x0078, 0x241b,
- 0x2061, 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109,
- 0x00c0, 0x244c, 0x2010, 0xa005, 0x0040, 0x23db, 0x0078, 0x2401,
- 0x2061, 0x7051, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019,
- 0x0040, 0x2409, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056,
- 0xa006, 0x605a, 0x605e, 0x1078, 0x3a37, 0x0078, 0x23db, 0x2061,
- 0x7051, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019, 0x0040,
- 0x2409, 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006,
- 0x606a, 0x606e, 0x1078, 0x380d, 0x0078, 0x23db, 0xa02e, 0x2520,
- 0x81ff, 0x00c0, 0x2405, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005,
- 0x20a1, 0x7074, 0x41a1, 0x1078, 0x29b7, 0x0040, 0x2405, 0x2009,
- 0x0020, 0x1078, 0x2a01, 0x701b, 0x249e, 0x007c, 0x6834, 0x2008,
- 0xa084, 0x00ff, 0xa096, 0x0011, 0x0040, 0x24aa, 0xa096, 0x0019,
- 0x00c0, 0x2405, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x2405, 0x710e,
- 0x700c, 0x8001, 0x0040, 0x24db, 0x700e, 0x1078, 0x29b7, 0x0040,
- 0x2405, 0x2009, 0x0020, 0x2061, 0x70bd, 0x6224, 0x6328, 0x642c,
- 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
- 0x0000, 0x1078, 0x2a01, 0x701b, 0x24ce, 0x007c, 0x6834, 0xa084,
- 0x00ff, 0xa096, 0x0002, 0x0040, 0x24d9, 0xa096, 0x000a, 0x00c0,
- 0x2405, 0x0078, 0x24b0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x33f2, 0x00c0, 0x24e9, 0x7007, 0x0003, 0x701b, 0x24eb,
- 0x007c, 0x1078, 0x38d0, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005,
- 0x2099, 0x7074, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1,
- 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f,
- 0x0078, 0x2a05, 0x6190, 0x7824, 0x6092, 0x0078, 0x23db, 0x2091,
- 0x8000, 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f,
- 0x2020, 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061,
- 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a,
- 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003,
- 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x2405, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0, 0x2409, 0x7e38,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x2548, 0x0078, 0x2409,
- 0x7c28, 0x7d2c, 0x1078, 0x36ab, 0xd28c, 0x00c0, 0x2553, 0x1078,
- 0x363f, 0x0078, 0x2555, 0x1078, 0x3679, 0x00c0, 0x257f, 0x2061,
- 0x7600, 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x256d, 0x6010, 0xa06d, 0x0040, 0x256d, 0x683c, 0xa406, 0x00c0,
- 0x256d, 0x6840, 0xa506, 0x0040, 0x2578, 0x127f, 0xace0, 0x0008,
- 0x2001, 0x7015, 0x2004, 0xac02, 0x00c8, 0x2405, 0x0078, 0x2559,
- 0x1078, 0x6139, 0x127f, 0x0040, 0x2405, 0x0078, 0x23db, 0xa00e,
- 0x2001, 0x0005, 0x1078, 0x38d0, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x64fd, 0x1078, 0x3840, 0x127f, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040,
- 0x2405, 0x1078, 0x36b8, 0x0040, 0x2405, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x1078, 0x29e1, 0x0040, 0x2409, 0x1078, 0x371f,
- 0x0040, 0x2405, 0x2019, 0x0005, 0x1078, 0x36d9, 0x0040, 0x2405,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x42b7, 0x0078, 0x23db, 0x127e, 0x2091, 0x8000,
- 0x81ff, 0x00c0, 0x25ea, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x25e4, 0x2508, 0x1078, 0x34fa, 0x00c0, 0x25e4, 0x1078,
- 0x371f, 0x0040, 0x2405, 0x2019, 0x0004, 0x1078, 0x36d9, 0x0040,
- 0x25ea, 0x7824, 0xa08a, 0x1000, 0x00c8, 0x25ed, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x42b7, 0x8529, 0x00c8, 0x25c6, 0x127f,
- 0x0078, 0x23db, 0x127f, 0x0078, 0x2405, 0x127f, 0x0078, 0x2409,
- 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x35f0, 0x1078, 0x36ab,
- 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29cf, 0x0040,
- 0x2409, 0x1078, 0x35df, 0x1078, 0x36ab, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x367c,
- 0x0040, 0x2405, 0x1078, 0x343b, 0x1078, 0x3638, 0x1078, 0x36ab,
- 0x0078, 0x23db, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583,
- 0x0040, 0x2405, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078, 0x36e4,
- 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x1078, 0x36ab, 0x0078, 0x23db, 0x1078, 0x29cf, 0x0040, 0x2409,
- 0x1078, 0x36ab, 0x2208, 0x0078, 0x23db, 0x157e, 0x0d7e, 0x0e7e,
- 0x2069, 0x70ff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2649, 0x2009,
- 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d,
- 0x2069, 0x7120, 0x2d04, 0xa075, 0x0040, 0x265e, 0x704c, 0x1078,
- 0x2668, 0xa210, 0x7080, 0x1078, 0x2668, 0xa318, 0x8d68, 0x00f0,
- 0x2652, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x23db,
- 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2677, 0x2001, 0x0000, 0x8000,
- 0x2f0c, 0x81ff, 0x0040, 0x2677, 0x2178, 0x0078, 0x266f, 0x017f,
- 0x0f7f, 0x007c, 0x2069, 0x70ff, 0x6910, 0x6294, 0x0078, 0x23db,
- 0x81ff, 0x00c0, 0x2405, 0x614c, 0xa190, 0x2207, 0x2214, 0xa294,
- 0x00ff, 0x0078, 0x23db, 0x613c, 0x6240, 0x0078, 0x23db, 0x1078,
- 0x29e1, 0x0040, 0x2409, 0x0078, 0x23db, 0x1078, 0x29e1, 0x0040,
- 0x2409, 0x6244, 0x6338, 0x0078, 0x23db, 0x613c, 0x6240, 0x7824,
- 0x603e, 0x7b28, 0x6342, 0x2069, 0x7051, 0x831f, 0xa305, 0x6816,
- 0x0078, 0x23db, 0x1078, 0x29e1, 0x0040, 0x2409, 0x0078, 0x23db,
- 0x1078, 0x29e1, 0x0040, 0x2409, 0x7828, 0xa00d, 0x0040, 0x2409,
- 0x782c, 0xa005, 0x0040, 0x2409, 0x6244, 0x6146, 0x6338, 0x603a,
- 0x0078, 0x23db, 0x7d38, 0x7c3c, 0x0078, 0x2488, 0x7824, 0xa09c,
- 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2405, 0x624c, 0xa084, 0xff00,
- 0x8007, 0xa206, 0x00c0, 0x26de, 0x2001, 0x7040, 0x2009, 0x000c,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29e1, 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff,
- 0xa086, 0x0006, 0x00c0, 0x2405, 0x0c7e, 0x1078, 0x29b7, 0x0c7f,
- 0x0040, 0x2405, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078,
- 0x6413, 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2700, 0x007c,
- 0x6830, 0xa086, 0x0100, 0x0040, 0x2405, 0xad80, 0x000e, 0x2009,
- 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05, 0x1078,
- 0x29b7, 0x0040, 0x2405, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x1078, 0x2a01, 0x701b, 0x271e, 0x007c, 0xade8, 0x000d,
- 0x6800, 0xa005, 0x0040, 0x2409, 0x6804, 0xd0ac, 0x0040, 0x272b,
- 0xd0a4, 0x0040, 0x2409, 0xd094, 0x0040, 0x2736, 0x0c7e, 0x2061,
- 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040,
- 0x2741, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106,
- 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x2756,
- 0xd084, 0x0040, 0x2756, 0x6a28, 0xa28a, 0x007e, 0x00c8, 0x2409,
- 0xa288, 0x2207, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040,
- 0x275f, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2409, 0x604e, 0x6808,
- 0xa08a, 0x0100, 0x0048, 0x2409, 0xa08a, 0x0841, 0x00c8, 0x2409,
- 0xa084, 0x0007, 0x00c0, 0x2409, 0x680c, 0xa005, 0x0040, 0x2409,
- 0x6810, 0xa005, 0x0040, 0x2409, 0x6848, 0x6940, 0xa10a, 0x00c8,
- 0x2409, 0x8001, 0x0040, 0x2409, 0x684c, 0x6944, 0xa10a, 0x00c8,
- 0x2409, 0x8001, 0x0040, 0x2409, 0x20a9, 0x001c, 0x2d98, 0x2069,
- 0x7051, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007,
- 0xa084, 0x00ff, 0x6042, 0x1078, 0x3a37, 0x1078, 0x380d, 0x6000,
- 0xa086, 0x0000, 0x00c0, 0x27da, 0x6808, 0x602a, 0x1078, 0x1d4d,
- 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
- 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x27ba,
- 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f,
- 0x0078, 0x27bc, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312,
- 0x1078, 0x4343, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f,
- 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x27d6, 0x6003, 0x0001,
- 0x2091, 0x301d, 0x1078, 0x3247, 0x0078, 0x27da, 0x6003, 0x0004,
- 0x2091, 0x301d, 0x0078, 0x23db, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x2405, 0x2069, 0x7051, 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00,
- 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x3247, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x6174, 0x81ff, 0x0040, 0x2811, 0x703f, 0x0000,
- 0x2001, 0x75c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x2a05, 0x701b, 0x23d8, 0x127f,
- 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x75c0, 0x20a9, 0x0040,
- 0x20a1, 0x75c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2207,
- 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100,
- 0xa506, 0x0040, 0x2843, 0x1078, 0x34fa, 0x00c0, 0x2843, 0x6014,
- 0x821c, 0x0048, 0x283b, 0xa398, 0x75c0, 0xa085, 0xff00, 0x8007,
- 0x201a, 0x0078, 0x2842, 0xa398, 0x75c0, 0x2324, 0xa4a4, 0xff00,
- 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8, 0x284a,
- 0x0078, 0x2827, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f,
- 0x20a9, 0x0040, 0x20a1, 0x75c0, 0x2099, 0x75c0, 0x1078, 0x3290,
- 0x0078, 0x2800, 0x1078, 0x29e1, 0x0040, 0x2409, 0x0c7e, 0x1078,
- 0x29b7, 0x0c7f, 0x0040, 0x2405, 0x2001, 0x7052, 0x2004, 0xd0b4,
- 0x0040, 0x2887, 0x6000, 0xd08c, 0x00c0, 0x2887, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2887, 0x6837, 0x0000, 0x6838,
- 0xc0fd, 0x683a, 0x1078, 0x642f, 0x0040, 0x2405, 0x7007, 0x0003,
- 0x701b, 0x2883, 0x007c, 0x1078, 0x29e1, 0x0040, 0x2409, 0x20a9,
- 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004,
- 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x3290,
- 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0,
- 0x1078, 0x3290, 0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x2a05, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29cf,
- 0x0040, 0x2409, 0x1078, 0x36c3, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x1078, 0x29e1,
- 0x0040, 0x2409, 0x1078, 0x371f, 0x0040, 0x2405, 0x2019, 0x0004,
- 0x1078, 0x36d9, 0x7924, 0x810f, 0x7a28, 0x1078, 0x28d1, 0x0078,
- 0x23db, 0xa186, 0x00ff, 0x0040, 0x28d9, 0x1078, 0x28e9, 0x0078,
- 0x28e8, 0x2029, 0x007d, 0x2061, 0x7000, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x28e5, 0x2508, 0x1078, 0x28e9, 0x8529, 0x00c8, 0x28de,
- 0x007c, 0x1078, 0x34fa, 0x00c0, 0x28f4, 0x2200, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x42b7, 0x007c, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040, 0x2405,
- 0x1078, 0x36ce, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078,
- 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040, 0x2405, 0x1078,
- 0x36b8, 0x0078, 0x23db, 0x6100, 0x0078, 0x23db, 0x1078, 0x29e1,
- 0x0040, 0x2409, 0x6004, 0xa086, 0x0707, 0x0040, 0x2409, 0x2001,
- 0x7000, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2405, 0x0d7e, 0xace8,
- 0x000a, 0x7924, 0xd184, 0x0040, 0x292f, 0xace8, 0x0006, 0x680c,
+ 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x82ff, 0x0040, 0x1518,
+ 0xa280, 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1514,
+ 0x1078, 0x1497, 0x10c0, 0x126a, 0x6808, 0x8000, 0x680a, 0x0d7f,
+ 0x127e, 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f,
+ 0x047f, 0x7000, 0xa005, 0x00c0, 0x152c, 0x7206, 0x2001, 0x1540,
+ 0x007e, 0x2260, 0x0078, 0x1652, 0x710c, 0x220a, 0x8108, 0x230a,
+ 0x8108, 0x240a, 0x8108, 0xa182, 0x6e05, 0x0048, 0x1539, 0x2009,
+ 0x6dea, 0x710e, 0x7000, 0xa005, 0x00c0, 0x1540, 0x1078, 0x163b,
+ 0x127f, 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091,
+ 0x2100, 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460,
+ 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x1594, 0x6808,
+ 0xa005, 0x0040, 0x15f4, 0x7000, 0xa005, 0x00c0, 0x1561, 0x0078,
+ 0x158e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x15f8, 0x7004, 0xa406,
+ 0x00c0, 0x158e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x1577,
+ 0x047e, 0x1078, 0x170a, 0x047f, 0x2460, 0x0078, 0x1557, 0x2001,
+ 0x0207, 0x2004, 0xd09c, 0x00c0, 0x156a, 0x7804, 0xa084, 0x6000,
+ 0x0040, 0x1588, 0xa086, 0x6000, 0x0040, 0x1588, 0x0078, 0x156a,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048,
+ 0x1078, 0x544c, 0x0078, 0x15f8, 0x6808, 0xa005, 0x0040, 0x15f4,
+ 0x7000, 0xa005, 0x00c0, 0x159e, 0x0078, 0x15f4, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15a7, 0x7004, 0xa406, 0x00c0, 0x15f4, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x0040, 0x15b4, 0x047e, 0x1078, 0x170a,
+ 0x047f, 0x2460, 0x0078, 0x1594, 0x2001, 0x0207, 0x2004, 0xd09c,
+ 0x00c0, 0x15a7, 0x7804, 0xa084, 0x6000, 0x0040, 0x15c5, 0xa086,
+ 0x6000, 0x0040, 0x15c5, 0x0078, 0x15a7, 0x7007, 0x0000, 0xa016,
+ 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x15e6, 0xa08e, 0x0002,
+ 0x00c0, 0x15f4, 0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1b57,
+ 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x15e2, 0x7308, 0x720c,
+ 0x0078, 0x15e4, 0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318,
+ 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048, 0x1078, 0x544c,
+ 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x6de4,
+ 0x7000, 0xa086, 0x0000, 0x0040, 0x1638, 0x7004, 0xac06, 0x00c0,
+ 0x1629, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0, 0x1625, 0x2001,
+ 0x0207, 0x2004, 0xd09c, 0x00c0, 0x160b, 0x7803, 0x0004, 0x7804,
+ 0xd0ac, 0x00c0, 0x1617, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003,
+ 0x0003, 0x7007, 0x0000, 0x0078, 0x1629, 0x1078, 0x170a, 0x0078,
+ 0x1600, 0x157e, 0x20a9, 0x0009, 0x2009, 0x6dea, 0x2104, 0xac06,
+ 0x00c0, 0x1633, 0x200a, 0xa188, 0x0003, 0x00f0, 0x162e, 0x157f,
+ 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x1643,
+ 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060, 0x8108, 0x211c,
+ 0x8108, 0x2124, 0x8108, 0xa182, 0x6e05, 0x0048, 0x1651, 0x2009,
+ 0x6dea, 0x7112, 0x8cff, 0x00c0, 0x1671, 0x7908, 0xd1ec, 0x00c0,
+ 0x1665, 0x1078, 0x18ac, 0x0040, 0x1665, 0x7803, 0x0009, 0x7904,
+ 0xd1fc, 0x0040, 0x165f, 0x7803, 0x0006, 0x7007, 0x0000, 0x1078,
+ 0x18ac, 0x0040, 0x1698, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078,
+ 0x1698, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x167c,
+ 0x682c, 0xa306, 0x0040, 0x1680, 0x1078, 0x1ba2, 0x00c0, 0x1655,
+ 0x684c, 0xd0f4, 0x00c0, 0x1655, 0x6824, 0x2050, 0x6818, 0x2060,
+ 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078,
+ 0x1699, 0x0040, 0x1697, 0x2009, 0x0001, 0x1078, 0x1699, 0x2d58,
+ 0x007c, 0x8aff, 0x0040, 0x1705, 0xa03e, 0x2730, 0x6850, 0xd0fc,
+ 0x00c0, 0x16b8, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x16a8,
+ 0x16e7, 0x16c8, 0x16c8, 0x16e7, 0x16e7, 0x16df, 0x16e7, 0x16c8,
+ 0x16e7, 0x16ce, 0x16ce, 0x16e7, 0x16e7, 0x16e7, 0x16d6, 0x16ce,
+ 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c,
+ 0x0040, 0x16ea, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x16ea,
+ 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x16ea, 0x6b10, 0x6a14,
+ 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x16ea, 0x0d7f, 0x0d7e,
+ 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x16e7, 0x0d7f,
+ 0x1078, 0x1b3e, 0x00c0, 0x1699, 0xa00e, 0x0078, 0x1705, 0x0d7f,
+ 0x1078, 0x126a, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
+ 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a,
+ 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200,
+ 0x6a14, 0xa203, 0x6816, 0x1078, 0x1b3e, 0x007c, 0x1078, 0x126a,
+ 0x1078, 0x126a, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68,
+ 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0,
+ 0x1708, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x1708, 0x7000,
+ 0x0079, 0x1722, 0x172a, 0x172c, 0x17f3, 0x184d, 0x1864, 0x172a,
+ 0x172a, 0x172a, 0x1078, 0x126a, 0x8001, 0x7002, 0xa184, 0x0880,
+ 0x00c0, 0x1741, 0x8aff, 0x0040, 0x1793, 0x2009, 0x0001, 0x1078,
+ 0x1699, 0x0040, 0x1876, 0x2009, 0x0001, 0x1078, 0x1699, 0x0078,
+ 0x1876, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x178c,
+ 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824,
+ 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812,
+ 0x7824, 0x6914, 0xa101, 0x6816, 0x037f, 0x027f, 0x7830, 0x681e,
+ 0x7834, 0x6822, 0x1078, 0x1b57, 0x2a00, 0x6826, 0x2c00, 0x681a,
+ 0x2800, 0x6832, 0x7003, 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808,
+ 0x8001, 0x680a, 0x00c0, 0x177e, 0x684c, 0xd0e4, 0x0040, 0x177e,
+ 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x7808, 0xd0ec,
+ 0x00c0, 0x1788, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1876,
+ 0x1078, 0x163b, 0x0078, 0x1876, 0x057e, 0x7d0c, 0x1078, 0x6b5b,
+ 0x057f, 0x0078, 0x17ab, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
+ 0x00c0, 0x17ab, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
+ 0x17a7, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x1078,
+ 0x163b, 0x0078, 0x1876, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
+ 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
+ 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
+ 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x187a, 0x7803, 0x0004,
+ 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x17cc,
+ 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
+ 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x1078, 0x18ac,
+ 0x0040, 0x17a7, 0x7908, 0xd1ec, 0x00c0, 0x17ea, 0x2009, 0x0009,
+ 0x0078, 0x17ec, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
+ 0x0003, 0x0078, 0x1876, 0x8001, 0x7002, 0xd194, 0x0040, 0x1805,
+ 0x7804, 0xd0fc, 0x00c0, 0x1712, 0x8aff, 0x0040, 0x1876, 0x2009,
+ 0x0001, 0x1078, 0x1699, 0x0078, 0x1876, 0xa184, 0x0880, 0x00c0,
+ 0x1812, 0x8aff, 0x0040, 0x1876, 0x2009, 0x0001, 0x1078, 0x1699,
+ 0x0078, 0x1876, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
+ 0x1846, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1b57, 0x0d7e,
+ 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1836,
+ 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
+ 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x1842, 0x6810, 0x2008,
+ 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
+ 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x174c, 0x057e, 0x7d0c,
+ 0x1078, 0x6b5b, 0x057f, 0x0078, 0x17ab, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0x7004, 0xa00d, 0x0040, 0x1860, 0x6808, 0x8001, 0x680a,
+ 0x00c0, 0x1860, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c,
+ 0x1078, 0x163b, 0x0078, 0x1876, 0x7803, 0x0004, 0x7003, 0x0000,
+ 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1860, 0x2068, 0x6808,
+ 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x1652, 0x017f, 0x007f,
+ 0x127f, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
+ 0xa084, 0xf000, 0xa10d, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000,
+ 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0, 0x1894, 0x2001, 0x0111,
+ 0x201c, 0x83ff, 0x0040, 0x1888, 0x20e1, 0x7000, 0x7324, 0x7420,
+ 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f,
+ 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202,
+ 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908, 0xa18c,
+ 0x0fff, 0xa182, 0x0009, 0x0048, 0x18b9, 0xa085, 0x0001, 0x0078,
+ 0x18cb, 0x2001, 0x020a, 0x81ff, 0x0040, 0x18c4, 0x20e1, 0x6000,
+ 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c, 0x200c,
+ 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e, 0x2071,
+ 0x6e05, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004,
+ 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1950, 0x6934, 0xa184, 0x0007,
+ 0x0079, 0x18e2, 0x18ea, 0x193b, 0x18ea, 0x18ea, 0x18ea, 0x1920,
+ 0x18fd, 0x18ec, 0x1078, 0x126a, 0x684c, 0xd0b4, 0x0040, 0x1a52,
+ 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a,
+ 0x6880, 0x680e, 0x6958, 0x0078, 0x1943, 0x6834, 0xa084, 0x00ff,
+ 0xa086, 0x001e, 0x00c0, 0x18ea, 0x684c, 0xd0b4, 0x0040, 0x1a52,
+ 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a,
+ 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1b82, 0x2004, 0x6832, 0x6958, 0x0078, 0x194c,
+ 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1950, 0x684c, 0xd0b4,
+ 0x0040, 0x1a52, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1b82, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e,
+ 0x682a, 0x0078, 0x194c, 0x684c, 0xd0b4, 0x0040, 0x1706, 0x6958,
+ 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e,
+ 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0,
+ 0x1a56, 0x0e7e, 0x0d7e, 0x2071, 0x6e05, 0x7000, 0xa005, 0x00c0,
+ 0x19cc, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068,
+ 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1,
+ 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6,
+ 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830,
+ 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040,
+ 0x198e, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a,
+ 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006,
+ 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x19a5,
+ 0x6928, 0x6810, 0xa106, 0x0040, 0x19b2, 0x037e, 0x047e, 0x6b14,
+ 0x6c10, 0x1078, 0x1ba2, 0x047f, 0x037f, 0x0040, 0x19b2, 0x0c7f,
+ 0x0078, 0x19cc, 0x8aff, 0x00c0, 0x19ba, 0x0c7f, 0xa085, 0x0001,
+ 0x0078, 0x19cc, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009,
+ 0x0001, 0x1078, 0x19d0, 0x0040, 0x19c9, 0x2009, 0x0001, 0x1078,
+ 0x19d0, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c,
+ 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040,
+ 0x1a4b, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048,
+ 0x1a4a, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x19fd, 0x0d7e,
+ 0x2804, 0xac68, 0x2900, 0x0079, 0x19ed, 0x1a2c, 0x1a0d, 0x1a0d,
+ 0x1a2c, 0x1a2c, 0x1a24, 0x1a2c, 0x1a0d, 0x1a2c, 0x1a13, 0x1a13,
+ 0x1a2c, 0x1a2c, 0x1a2c, 0x1a1b, 0x1a13, 0xc0fc, 0x6852, 0x6b6c,
+ 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a30, 0x0d7e, 0x2804,
+ 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a2f, 0x6b08, 0x6a0c, 0x6d00,
+ 0x6c04, 0x0078, 0x1a2f, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
+ 0x6e0c, 0x0078, 0x1a2f, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
+ 0xa086, 0x001e, 0x00c0, 0x1a2c, 0x0d7f, 0x1078, 0x1b3e, 0x00c0,
+ 0x19d6, 0xa00e, 0x0078, 0x1a4b, 0x0d7f, 0x1078, 0x126a, 0x0d7f,
+ 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000,
+ 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
+ 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x1b3e,
+ 0x0078, 0x1a4b, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f,
+ 0x077f, 0x007c, 0x1078, 0x126a, 0x1078, 0x126a, 0x127e, 0x2091,
+ 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079,
+ 0x0020, 0x2071, 0x6e05, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803,
+ 0x0002, 0xa184, 0x0700, 0x00c0, 0x1a54, 0x7000, 0x0079, 0x1a70,
+ 0x1b17, 0x1a74, 0x1ae4, 0x1b15, 0x8001, 0x7002, 0xd19c, 0x00c0,
+ 0x1a88, 0x8aff, 0x0040, 0x1aa7, 0x2009, 0x0001, 0x1078, 0x19d0,
+ 0x0040, 0x1b17, 0x2009, 0x0001, 0x1078, 0x19d0, 0x0078, 0x1b17,
+ 0x7803, 0x0004, 0xd194, 0x0040, 0x1a98, 0x6850, 0xc0fc, 0x6852,
+ 0x8aff, 0x00c0, 0x1a9d, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1a9d,
+ 0x1078, 0x1b57, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00,
+ 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b17, 0x711c,
+ 0x81ff, 0x0040, 0x1abd, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803,
+ 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010,
+ 0xa081, 0x0000, 0x7012, 0x0078, 0x1b17, 0x0f7e, 0x027e, 0x781c,
+ 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004,
+ 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1acb, 0x79c8,
+ 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6, 0xa284,
+ 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008,
+ 0x7003, 0x0000, 0x0078, 0x1b17, 0x8001, 0x7002, 0xd194, 0x0040,
+ 0x1af9, 0x7804, 0xd0fc, 0x00c0, 0x1a66, 0xd19c, 0x00c0, 0x1b13,
+ 0x8aff, 0x0040, 0x1b17, 0x2009, 0x0001, 0x1078, 0x19d0, 0x0078,
+ 0x1b17, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1b57, 0x0d7e,
+ 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b0c, 0x6808, 0xa31a,
+ 0x680c, 0xa213, 0x0078, 0x1b10, 0x6810, 0xa31a, 0x6814, 0xa213,
+ 0x0d7f, 0x0078, 0x1a98, 0x0078, 0x1a98, 0x1078, 0x126a, 0x0c7f,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x2071, 0x6e05, 0x7000, 0xa086, 0x0000, 0x0040, 0x1b3b,
+ 0x2079, 0x0020, 0x7804, 0xa084, 0x0003, 0x0040, 0x1b35, 0x7803,
+ 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b31, 0x20e1, 0x9040, 0x7803,
+ 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840, 0x2804,
+ 0xa005, 0x00c0, 0x1b52, 0x6004, 0xa005, 0x0040, 0x1b54, 0x681a,
+ 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1b82, 0x2044, 0x88ff,
+ 0x1040, 0x126a, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50,
+ 0x8841, 0x2804, 0xa005, 0x00c0, 0x1b71, 0x2c00, 0xad06, 0x0040,
+ 0x1b66, 0x6000, 0xa005, 0x00c0, 0x1b66, 0x2d00, 0x2060, 0x681a,
+ 0x6034, 0xa084, 0x000f, 0xa080, 0x1b92, 0x2044, 0x88ff, 0x1040,
+ 0x126a, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021,
+ 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027,
+ 0x0000, 0x0000, 0x0000, 0x1b77, 0x1b73, 0x0000, 0x0000, 0x1b81,
+ 0x0000, 0x1b77, 0x0000, 0x1b7e, 0x1b7b, 0x0000, 0x0000, 0x0000,
+ 0x1b81, 0x1b7e, 0x0000, 0x1b79, 0x1b79, 0x0000, 0x0000, 0x1b81,
+ 0x0000, 0x1b79, 0x0000, 0x1b7f, 0x1b7f, 0x0000, 0x0000, 0x0000,
+ 0x1b81, 0x1b7f, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040,
+ 0x1c3f, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1b82, 0xa986,
+ 0x0007, 0x0040, 0x1bbb, 0xa986, 0x000e, 0x0040, 0x1bbb, 0xa986,
+ 0x000f, 0x00c0, 0x1bbf, 0x605c, 0xa422, 0x6060, 0xa31a, 0x2804,
+ 0xa045, 0x00c0, 0x1bcd, 0x0050, 0x1bc7, 0x0078, 0x1c3f, 0x6004,
+ 0xa065, 0x0040, 0x1c3f, 0x0078, 0x1baa, 0x2804, 0xa005, 0x0040,
+ 0x1beb, 0xac68, 0xd99c, 0x00c0, 0x1bdb, 0x6808, 0xa422, 0x680c,
+ 0xa31b, 0x0078, 0x1bdf, 0x6810, 0xa422, 0x6814, 0xa31b, 0x0048,
+ 0x1c0a, 0x2300, 0xa405, 0x0040, 0x1bf1, 0x8a51, 0x0040, 0x1c3f,
+ 0x8840, 0x0078, 0x1bcd, 0x6004, 0xa065, 0x0040, 0x1c3f, 0x0078,
+ 0x1baa, 0x8a51, 0x0040, 0x1c3f, 0x8840, 0x2804, 0xa005, 0x00c0,
+ 0x1c04, 0x6004, 0xa065, 0x0040, 0x1c3f, 0x6034, 0xa0cc, 0x000f,
+ 0xa9c0, 0x1b82, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852,
+ 0x0078, 0x1c37, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e,
+ 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c25, 0x6908,
+ 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x126a, 0x6800,
+ 0xa420, 0x6804, 0xa319, 0x0078, 0x1c31, 0x6910, 0x2400, 0xa122,
+ 0x6914, 0x2300, 0xa11b, 0x1048, 0x126a, 0x6800, 0xa420, 0x6804,
+ 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00,
+ 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1c44, 0x087f,
+ 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004,
+ 0xa084, 0x0007, 0x0079, 0x1c4c, 0x1c54, 0x1c55, 0x1c58, 0x1c5b,
+ 0x1c60, 0x1c63, 0x1c68, 0x1c6d, 0x007c, 0x1078, 0x1a56, 0x007c,
+ 0x1078, 0x170a, 0x007c, 0x1078, 0x170a, 0x1078, 0x1a56, 0x007c,
+ 0x1078, 0x13f1, 0x007c, 0x1078, 0x1a56, 0x1078, 0x13f1, 0x007c,
+ 0x1078, 0x170a, 0x1078, 0x13f1, 0x007c, 0x1078, 0x170a, 0x1078,
+ 0x1a56, 0x1078, 0x13f1, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079,
+ 0x0200, 0x2071, 0x7080, 0x2069, 0x6c00, 0x2009, 0x0004, 0x7912,
+ 0x7916, 0x1078, 0x1f3c, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f,
+ 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079,
+ 0x1c91, 0x1cb5, 0x1c99, 0x1c9d, 0x1ca1, 0x1ca7, 0x1cab, 0x1caf,
+ 0x1cb3, 0x1078, 0x3cc5, 0x0078, 0x1cb5, 0x1078, 0x3cf9, 0x0078,
+ 0x1cb5, 0x1078, 0x3cc5, 0x1078, 0x3cf9, 0x0078, 0x1cb5, 0x1078,
+ 0x1cb7, 0x0078, 0x1cb5, 0x1078, 0x1cb7, 0x0078, 0x1cb5, 0x1078,
+ 0x1cb7, 0x0078, 0x1cb5, 0x1078, 0x1cb7, 0x127f, 0x007c, 0x007e,
+ 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1cc1, 0x1078,
+ 0x126a, 0xa184, 0x0030, 0x0040, 0x1cd2, 0x6a00, 0xa286, 0x0003,
+ 0x00c0, 0x1ccc, 0x1078, 0x126a, 0x1078, 0x30c9, 0x20e1, 0x9010,
+ 0x0078, 0x1cde, 0xa184, 0x00c0, 0x0040, 0x1cd8, 0x1078, 0x126a,
+ 0xa184, 0x0300, 0x0040, 0x1cde, 0x20e1, 0x9020, 0x7932, 0x027f,
+ 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0x6c00,
+ 0x7128, 0x2001, 0x6da3, 0x2102, 0x2001, 0x6dab, 0x2102, 0xa182,
+ 0x0211, 0x00c8, 0x1cf7, 0x2009, 0x0008, 0x0078, 0x1d21, 0xa182,
+ 0x0259, 0x00c8, 0x1cff, 0x2009, 0x0007, 0x0078, 0x1d21, 0xa182,
+ 0x02c1, 0x00c8, 0x1d07, 0x2009, 0x0006, 0x0078, 0x1d21, 0xa182,
+ 0x0349, 0x00c8, 0x1d0f, 0x2009, 0x0005, 0x0078, 0x1d21, 0xa182,
+ 0x0421, 0x00c8, 0x1d17, 0x2009, 0x0004, 0x0078, 0x1d21, 0xa182,
+ 0x0581, 0x00c8, 0x1d1f, 0x2009, 0x0003, 0x0078, 0x1d21, 0x2009,
+ 0x0002, 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1f3c, 0x0f7f,
+ 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, 0x0100,
+ 0x2071, 0x6c00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, 0x0000,
+ 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000,
+ 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af, 0x600f, 0x00ff,
+ 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6c2b, 0x2003, 0x0000,
+ 0x2001, 0x6c2a, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200,
+ 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x1d64,
+ 0xa184, 0x0007, 0x0079, 0x1d6a, 0xa195, 0x0004, 0xa284, 0x0007,
+ 0x0079, 0x1d6a, 0x1d96, 0x1d72, 0x1d76, 0x1d7a, 0x1d80, 0x1d84,
+ 0x1d8a, 0x1d90, 0x1078, 0x419e, 0x0078, 0x1d96, 0x1078, 0x427a,
+ 0x0078, 0x1d96, 0x1078, 0x427a, 0x1078, 0x419e, 0x0078, 0x1d96,
+ 0x1078, 0x1d9b, 0x0078, 0x1d96, 0x1078, 0x419e, 0x1078, 0x1d9b,
+ 0x0078, 0x1d96, 0x1078, 0x427a, 0x1078, 0x1d9b, 0x0078, 0x1d96,
+ 0x1078, 0x427a, 0x1078, 0x419e, 0x1078, 0x1d9b, 0x027f, 0x017f,
+ 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1e48, 0x017e, 0x047e,
+ 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196, 0xff00, 0x0040,
+ 0x1dca, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x1dca,
+ 0x7130, 0xd18c, 0x00c0, 0x1dca, 0x2011, 0x6c52, 0x2214, 0xd2ec,
+ 0x0040, 0x1dbe, 0xc18d, 0x7132, 0x0078, 0x1dca, 0x6240, 0xa294,
+ 0x0010, 0x0040, 0x1e05, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00,
+ 0x00c0, 0x1e05, 0x2011, 0x8013, 0x1078, 0x2926, 0x7130, 0xc185,
+ 0x7132, 0x2011, 0x6c52, 0x220c, 0xd1a4, 0x0040, 0x1ded, 0x017e,
+ 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x416c, 0x2019, 0x000e,
+ 0x1078, 0x6aa2, 0xa484, 0x00ff, 0x1078, 0x1f61, 0x8127, 0xa006,
+ 0x2009, 0x000e, 0x1078, 0x6b0a, 0x017f, 0xd1ac, 0x00c0, 0x1df6,
+ 0x2019, 0x0004, 0x1078, 0x2103, 0x0078, 0x1e05, 0x157e, 0x20a9,
+ 0x007e, 0x2009, 0x0000, 0x1078, 0x336a, 0x00c0, 0x1e01, 0x1078,
+ 0x316e, 0x8108, 0x00f0, 0x1dfb, 0x157f, 0x0c7f, 0x047f, 0x6043,
+ 0x0000, 0x2009, 0x00f7, 0x1078, 0x3131, 0x0f7e, 0x2079, 0x6dc3,
+ 0x783c, 0xa086, 0x0000, 0x0040, 0x1e1d, 0x6027, 0x0004, 0x783f,
+ 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003,
+ 0x1078, 0x502b, 0x2011, 0x0002, 0x1078, 0x5035, 0x1078, 0x4f41,
+ 0x1078, 0x40a3, 0x037e, 0x2019, 0x0000, 0x1078, 0x4fd3, 0x037f,
+ 0x60e3, 0x0000, 0x017f, 0x2001, 0x6c00, 0x2014, 0xa296, 0x0004,
+ 0x00c0, 0x1e40, 0xd19c, 0x00c0, 0x1e40, 0x6228, 0xc29d, 0x622a,
+ 0x2003, 0x0001, 0x2001, 0x6c1e, 0x2003, 0x0000, 0x6027, 0x0020,
+ 0xd194, 0x0040, 0x1ee3, 0x0f7e, 0x2079, 0x6dc3, 0x783c, 0xa086,
+ 0x0001, 0x00c0, 0x1e6c, 0x017e, 0x6027, 0x0004, 0x783f, 0x0000,
+ 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000, 0x2079, 0x6db0,
+ 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4713, 0x1078, 0x47c3,
+ 0x017f, 0x0f7f, 0x0078, 0x1ee3, 0x0f7f, 0x017e, 0x6220, 0xd2b4,
+ 0x0040, 0x1ea1, 0x1078, 0x40a3, 0x1078, 0x4e17, 0x6027, 0x0004,
+ 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1e84,
+ 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x6db0,
+ 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1e94, 0x8000, 0x602a, 0x0c7f,
+ 0x1078, 0x4e09, 0x0078, 0x1ee2, 0x2019, 0x6db9, 0x2304, 0xa065,
+ 0x0040, 0x1e9e, 0x2009, 0x0027, 0x1078, 0x544c, 0x0c7f, 0x0078,
+ 0x1ee2, 0xd2bc, 0x0040, 0x1ee2, 0x1078, 0x40b1, 0x6017, 0x0010,
+ 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
+ 0x0040, 0x1eb6, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
+ 0x2061, 0x6db0, 0x6044, 0xa09a, 0x0002, 0x00c8, 0x1ed7, 0x8000,
+ 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1ee2, 0x1078, 0x40a8,
+ 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x1ed3, 0x6017,
+ 0x0012, 0x0078, 0x1ee2, 0x6017, 0x0016, 0x0078, 0x1ee2, 0x2019,
+ 0x6dbf, 0x2304, 0xa065, 0x0040, 0x1ee1, 0x2009, 0x004f, 0x1078,
+ 0x544c, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1f0b, 0x017e, 0x6028,
+ 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x502b, 0x2011, 0x0002,
+ 0x1078, 0x5035, 0x1078, 0x4f41, 0x1078, 0x40a3, 0x037e, 0x2019,
+ 0x0000, 0x1078, 0x4fd3, 0x037f, 0x60e3, 0x0000, 0x1078, 0x6b79,
+ 0x1078, 0x6b97, 0x2001, 0x6c00, 0x2003, 0x0004, 0x6027, 0x0008,
+ 0x1078, 0x1161, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
+ 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6c00, 0x71a8, 0x70aa, 0xa116, 0x0040, 0x1f35, 0x81ff, 0x0040,
+ 0x1f27, 0x2011, 0x8011, 0x1078, 0x2926, 0x0078, 0x1f35, 0x2011,
+ 0x8012, 0x1078, 0x2926, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
+ 0x0028, 0x1078, 0x2103, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
+ 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
+ 0x2061, 0x0100, 0xa190, 0x1f4f, 0x2204, 0x60f2, 0xa190, 0x1f58,
+ 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x083e,
+ 0x083e, 0x083e, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
+ 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
+ 0x00a0, 0xa080, 0x2154, 0x200c, 0xa18c, 0xff00, 0x810f, 0x007c,
+ 0xa080, 0x2154, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1f8e, 0x1f92,
+ 0x1f96, 0x1f9c, 0x1fa2, 0x1fa8, 0x1fae, 0x1fb6, 0x1fbe, 0x1fc4,
+ 0x1fca, 0x1fd2, 0x1fda, 0x1fe2, 0x1fea, 0x1ff4, 0x1ffe, 0x1ffe,
+ 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe,
+ 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x107e, 0x007e,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x0078, 0x2017,
+ 0x107e, 0x007e, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1c89, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c45,
+ 0x1078, 0x1c89, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55,
+ 0x1078, 0x1c45, 0x1078, 0x1c89, 0x0078, 0x2017, 0x0005, 0x0078,
+ 0x1ffe, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x2007, 0x2017,
+ 0x1f94, 0x1f98, 0x1f9e, 0x1fa4, 0x1faa, 0x1fb0, 0x1fb8, 0x1fc0,
+ 0x1fc6, 0x1fcc, 0x1fd4, 0x1fdc, 0x1fe4, 0x1fec, 0x1ff6, 0x0008,
+ 0x2001, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e,
+ 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff, 0x0040, 0x206d, 0x037e,
+ 0x7384, 0xa38e, 0xffff, 0x00c0, 0x202f, 0x2019, 0x0001, 0x8314,
+ 0xa2e0, 0x71c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x203c, 0xa084,
+ 0xff00, 0x8007, 0x0078, 0x203e, 0xa084, 0x00ff, 0xa70e, 0x0040,
+ 0x2062, 0xa08e, 0x0000, 0x0040, 0x2062, 0xa08e, 0x00ff, 0x0040,
+ 0x2068, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x2065, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x205c, 0x1078, 0x20b5,
+ 0x0040, 0x2065, 0x0078, 0x2062, 0x1078, 0x2150, 0x1078, 0x20dc,
+ 0x0040, 0x2065, 0x8318, 0x0078, 0x202f, 0x7386, 0x0078, 0x206a,
+ 0x7087, 0xffff, 0x037f, 0x0078, 0x20b2, 0xa780, 0x2154, 0x203c,
+ 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e, 0x2009, 0x0000, 0x7084,
+ 0xa096, 0xffff, 0x0040, 0x2089, 0xa092, 0x007e, 0x0048, 0x2084,
+ 0x7087, 0xffff, 0x0078, 0x20af, 0x2008, 0x2011, 0x007e, 0xa202,
+ 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x20a6, 0x1078,
+ 0x3333, 0x00c0, 0x20af, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x00c0, 0x20a0, 0x1078, 0x20b5, 0x0040, 0x20af, 0x0078, 0x20a6,
+ 0x1078, 0x2150, 0x1078, 0x20dc, 0x0040, 0x20af, 0x017f, 0x8108,
+ 0x157f, 0x00f0, 0x2089, 0x7087, 0xffff, 0x0078, 0x20b2, 0x017f,
+ 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e,
+ 0x0c7e, 0x2c68, 0x1078, 0x53bf, 0x0040, 0x20d7, 0x2d00, 0x601a,
+ 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x3302, 0x2001, 0x0000,
+ 0x1078, 0x3316, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082,
+ 0x127f, 0x2009, 0x0004, 0x1078, 0x544c, 0xa085, 0x0001, 0x0c7f,
+ 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x53bf, 0x0040, 0x20fe, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x3302, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x544c, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e,
+ 0x1078, 0x4406, 0x1078, 0x43b6, 0x1078, 0x5826, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x017e, 0x1078, 0x336a, 0x00c0, 0x211b, 0x1078,
+ 0x34f2, 0x1078, 0x316e, 0x017f, 0x8108, 0x00f0, 0x2112, 0x027f,
+ 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e,
+ 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x017f,
+ 0x2e60, 0x1078, 0x34f2, 0x1078, 0x316e, 0x017f, 0x027f, 0x037f,
+ 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6c00, 0x7080,
+ 0xa005, 0x0040, 0x214d, 0x8001, 0x7082, 0x007f, 0x0e7f, 0x007c,
+ 0x6000, 0xc08c, 0x6002, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
+ 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
+ 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
+ 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
+ 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
+ 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
+ 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
+ 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
+ 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
+ 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
+ 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
+ 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
+ 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
+ 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
+ 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
+ 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
+ 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
+ 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
+ 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
+ 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
+ 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
+ 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
+ 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
+ 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
+ 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
+ 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
+ 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
+ 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x0000, 0x2071, 0x6c6d, 0x7003, 0x0002,
+ 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x6c7d, 0x7037,
+ 0x6c7d, 0x7007, 0x0001, 0x2061, 0x6cbd, 0x6003, 0x0002, 0x007c,
+ 0x0090, 0x226b, 0x0068, 0x226b, 0x2071, 0x6c6d, 0x2b78, 0x7818,
+ 0xd084, 0x00c0, 0x226b, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0,
+ 0x2351, 0x0079, 0x22ef, 0x007c, 0x2071, 0x6c6d, 0x7004, 0x0079,
+ 0x2271, 0x2275, 0x2276, 0x2280, 0x2292, 0x007c, 0x0090, 0x227f,
+ 0x0068, 0x227f, 0x2b78, 0x7818, 0xd084, 0x0040, 0x229e, 0x007c,
+ 0x2b78, 0x2061, 0x6cbd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x228d,
+ 0xa086, 0x0200, 0x0040, 0x2349, 0x007c, 0x7014, 0x2068, 0x2a60,
+ 0x7018, 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040,
+ 0x229a, 0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820,
+ 0xa08a, 0x0040, 0x00c8, 0x22a7, 0x61a8, 0x0079, 0x22af, 0x2100,
+ 0xa08a, 0x0035, 0x00c8, 0x2345, 0x61a8, 0x0079, 0x22ef, 0x2327,
+ 0x2359, 0x2361, 0x2365, 0x236d, 0x2373, 0x2377, 0x2380, 0x2384,
+ 0x238c, 0x2390, 0x2345, 0x2345, 0x2345, 0x2394, 0x2345, 0x23a4,
+ 0x23bb, 0x23d2, 0x244e, 0x2453, 0x2480, 0x24cb, 0x24da, 0x24fb,
+ 0x2531, 0x253b, 0x2548, 0x255b, 0x2573, 0x257c, 0x25b9, 0x25bf,
+ 0x2345, 0x25ca, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x25ce,
+ 0x25d4, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x25dc, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x25e9,
+ 0x25ef, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x238c,
+ 0x2390, 0x2345, 0x2345, 0x2601, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x264e,
+ 0x271d, 0x2731, 0x2738, 0x279b, 0x27ec, 0x27f7, 0x2839, 0x2846,
+ 0x2853, 0x2856, 0x2605, 0x287f, 0x28ca, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x29ad, 0x29bb, 0x29c8, 0x713c, 0x0078, 0x2327, 0x2021,
+ 0x4000, 0x1078, 0x2900, 0x127e, 0x2091, 0x8000, 0x0068, 0x2334,
+ 0x7818, 0xd084, 0x0040, 0x2337, 0x127f, 0x0078, 0x232b, 0x781b,
+ 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
+ 0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
+ 0x2329, 0x2021, 0x4002, 0x0078, 0x2329, 0x2021, 0x4003, 0x0078,
+ 0x2329, 0x2021, 0x4005, 0x0078, 0x2329, 0x2021, 0x4006, 0x0078,
+ 0x2329, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
+ 0x290f, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
+ 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2913, 0x7924, 0x7828, 0x2114,
+ 0x200a, 0x0078, 0x2327, 0x7924, 0x2114, 0x0078, 0x2327, 0x2099,
+ 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x2327,
+ 0x7824, 0x2060, 0x0078, 0x2396, 0x2009, 0x0001, 0x2011, 0x000e,
+ 0x2019, 0x0006, 0x0078, 0x2327, 0x7d38, 0x7c3c, 0x0078, 0x235b,
+ 0x7d38, 0x7c3c, 0x0078, 0x2367, 0x2061, 0x1000, 0x610c, 0xa006,
+ 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2398, 0x2010, 0xa005,
+ 0x0040, 0x2327, 0x0078, 0x234d, 0x2061, 0x6c51, 0x7824, 0x7930,
+ 0xa11a, 0x00c8, 0x2355, 0x8019, 0x0040, 0x2355, 0x604a, 0x6142,
+ 0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
+ 0x37bb, 0x0078, 0x2327, 0x2061, 0x6c51, 0x7824, 0x7930, 0xa11a,
+ 0x00c8, 0x2355, 0x8019, 0x0040, 0x2355, 0x604e, 0x6146, 0x782c,
+ 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x3591,
+ 0x0078, 0x2327, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2351, 0x7924,
+ 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x6c74, 0x41a1, 0x1078,
+ 0x28d7, 0x0040, 0x2351, 0x2009, 0x0020, 0x1078, 0x290f, 0x701b,
+ 0x23ea, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
+ 0x0040, 0x23f6, 0xa096, 0x0019, 0x00c0, 0x2351, 0x810f, 0xa18c,
+ 0x00ff, 0x0040, 0x2351, 0x710e, 0x700c, 0x8001, 0x0040, 0x2427,
+ 0x700e, 0x1078, 0x28d7, 0x0040, 0x2351, 0x2009, 0x0020, 0x2061,
+ 0x6cbd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
+ 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x290f, 0x701b,
+ 0x241a, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
+ 0x2425, 0xa096, 0x000a, 0x00c0, 0x2351, 0x0078, 0x23fc, 0x7010,
+ 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x3267, 0x00c0, 0x2435,
+ 0x7007, 0x0003, 0x701b, 0x2437, 0x007c, 0x1078, 0x3654, 0x127e,
+ 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x6c74, 0x530a, 0x2100,
+ 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
+ 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2913, 0x6190, 0x7824,
+ 0x6092, 0x0078, 0x2327, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
+ 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
+ 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
+ 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
+ 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
+ 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
+ 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x7c28,
+ 0x7d2c, 0x1078, 0x34b5, 0xd28c, 0x00c0, 0x2492, 0x1078, 0x3445,
+ 0x0078, 0x2494, 0x1078, 0x3481, 0x00c0, 0x24be, 0x2061, 0x7200,
+ 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x24ac,
+ 0x6010, 0xa06d, 0x0040, 0x24ac, 0x683c, 0xa406, 0x00c0, 0x24ac,
+ 0x6840, 0xa506, 0x0040, 0x24b7, 0x127f, 0xace0, 0x0008, 0x2001,
+ 0x6c15, 0x2004, 0xac02, 0x00c8, 0x2351, 0x0078, 0x2498, 0x1078,
+ 0x5de3, 0x127f, 0x0040, 0x2351, 0x0078, 0x2327, 0xa00e, 0x2001,
+ 0x0005, 0x1078, 0x3654, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4,
+ 0x127f, 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x1078, 0x33fa, 0x1078, 0x34c6, 0x0040, 0x2351,
+ 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040,
+ 0x2355, 0x2031, 0x000f, 0x1078, 0x33fa, 0x8631, 0x00c8, 0x24e3,
+ 0x2019, 0x0005, 0x1078, 0x34e7, 0x0040, 0x2351, 0x7828, 0xa08a,
+ 0x1000, 0x00c8, 0x2355, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078,
+ 0x4033, 0x0078, 0x2327, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0,
+ 0x252b, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506, 0x0040, 0x2525,
+ 0x2508, 0x1078, 0x336a, 0x00c0, 0x2525, 0x2031, 0x000f, 0x1078,
+ 0x33fa, 0x8631, 0x00c8, 0x250f, 0x2019, 0x0004, 0x1078, 0x34e7,
+ 0x0040, 0x252b, 0x7824, 0xa08a, 0x1000, 0x00c8, 0x252e, 0x8003,
+ 0x800b, 0x810b, 0xa108, 0x1078, 0x4033, 0x8529, 0x00c8, 0x2504,
+ 0x127f, 0x0078, 0x2327, 0x127f, 0x0078, 0x2351, 0x127f, 0x0078,
+ 0x2355, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078, 0x342a, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x1078, 0x3413, 0x1078, 0x34b5, 0x0078, 0x2327,
+ 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x3484, 0x0040, 0x2351, 0x1078, 0x32af, 0x1078, 0x343e, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x33fa, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078, 0x34f2, 0x0c7f,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x34b5, 0x2208, 0x0078, 0x2327, 0x157e, 0x0d7e, 0x0e7e, 0x2069,
+ 0x6cff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2588, 0x2009, 0x0000,
+ 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d, 0x2069,
+ 0x6d20, 0x2d04, 0xa075, 0x0040, 0x259d, 0x704c, 0x1078, 0x25a7,
+ 0xa210, 0x7080, 0x1078, 0x25a7, 0xa318, 0x8d68, 0x00f0, 0x2591,
+ 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x2327, 0x0f7e,
+ 0x017e, 0xa07d, 0x0040, 0x25b6, 0x2001, 0x0000, 0x8000, 0x2f0c,
+ 0x81ff, 0x0040, 0x25b6, 0x2178, 0x0078, 0x25ae, 0x017f, 0x0f7f,
+ 0x007c, 0x2069, 0x6cff, 0x6910, 0x6294, 0x0078, 0x2327, 0x81ff,
+ 0x00c0, 0x2351, 0x614c, 0xa190, 0x2154, 0x2214, 0xa294, 0x00ff,
+ 0x0078, 0x2327, 0x613c, 0x6240, 0x0078, 0x2327, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x6244, 0x6338, 0x0078, 0x2327, 0x613c, 0x6240, 0x7824, 0x603e,
+ 0x7b28, 0x6342, 0x2069, 0x6c51, 0x831f, 0xa305, 0x6816, 0x0078,
+ 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x0078, 0x2327, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x7828, 0xa00d, 0x0040, 0x2355, 0x782c,
+ 0xa005, 0x0040, 0x2355, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078,
+ 0x2327, 0x7d38, 0x7c3c, 0x0078, 0x23d4, 0x7824, 0xa09c, 0x00ff,
+ 0xa39a, 0x0003, 0x00c8, 0x2351, 0x624c, 0xa084, 0xff00, 0x8007,
+ 0xa206, 0x00c0, 0x261d, 0x2001, 0x6c40, 0x2009, 0x000c, 0x7a2c,
+ 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x81ff, 0x00c0, 0x2351,
+ 0x1078, 0x28ef, 0x0040, 0x2355, 0x6004, 0xa084, 0x00ff, 0xa086,
+ 0x0006, 0x00c0, 0x2351, 0x0c7e, 0x1078, 0x28d7, 0x0c7f, 0x0040,
+ 0x2351, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x60a4,
+ 0x0040, 0x2351, 0x7007, 0x0003, 0x701b, 0x263f, 0x007c, 0x6830,
+ 0xa086, 0x0100, 0x0040, 0x2351, 0xad80, 0x000e, 0x2009, 0x000c,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x1078, 0x28d7,
+ 0x0040, 0x2351, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+ 0x1078, 0x290f, 0x701b, 0x265d, 0x007c, 0xade8, 0x000d, 0x6800,
+ 0xa005, 0x0040, 0x2355, 0x6804, 0xd0ac, 0x0040, 0x266a, 0xd0a4,
+ 0x0040, 0x2355, 0xd094, 0x0040, 0x2675, 0x0c7e, 0x2061, 0x0100,
+ 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2680,
+ 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f,
+ 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x2697, 0xd084,
+ 0x0040, 0x2697, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2355, 0xa088,
+ 0x2154, 0x210c, 0xa18c, 0x00ff, 0x6152, 0x0078, 0x26a0, 0xd0dc,
+ 0x0040, 0x26a0, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2355, 0x604e,
+ 0x6808, 0xa08a, 0x0100, 0x0048, 0x2355, 0xa08a, 0x0841, 0x00c8,
+ 0x2355, 0xa084, 0x0007, 0x00c0, 0x2355, 0x680c, 0xa005, 0x0040,
+ 0x2355, 0x6810, 0xa005, 0x0040, 0x2355, 0x6848, 0x6940, 0xa10a,
+ 0x00c8, 0x2355, 0x8001, 0x0040, 0x2355, 0x684c, 0x6944, 0xa10a,
+ 0x00c8, 0x2355, 0x8001, 0x0040, 0x2355, 0x20a9, 0x001c, 0x2d98,
+ 0x2069, 0x6c51, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
+ 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x37bb, 0x1078, 0x3591,
+ 0x6000, 0xa086, 0x0000, 0x00c0, 0x271b, 0x6808, 0x602a, 0x1078,
+ 0x1ce3, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
+ 0x26fb, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x0078, 0x26fd, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x40bf, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x2717, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x30c9, 0x0078, 0x271b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x2327, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x2351, 0x2069, 0x6c51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x2913, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x30c9, 0x0078, 0x2327,
+ 0x81ff, 0x00c0, 0x2351, 0x6174, 0x81ff, 0x0040, 0x2752, 0x703f,
+ 0x0000, 0x2001, 0x71c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2913, 0x701b, 0x2324,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x71c0, 0x20a9,
+ 0x0040, 0x20a1, 0x71c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x2154, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x2784, 0x1078, 0x336a, 0x00c0, 0x2784,
+ 0x6014, 0x821c, 0x0048, 0x277c, 0xa398, 0x71c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x2783, 0xa398, 0x71c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8,
+ 0x278b, 0x0078, 0x2768, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x71c0, 0x2099, 0x71c0, 0x1078,
+ 0x3111, 0x0078, 0x2741, 0x1078, 0x28ef, 0x0040, 0x2355, 0x0c7e,
+ 0x1078, 0x28d7, 0x0c7f, 0x0040, 0x2351, 0x2001, 0x6c52, 0x2004,
+ 0xd0b4, 0x0040, 0x27c8, 0x6000, 0xd08c, 0x00c0, 0x27c8, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x27c8, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x60c0, 0x0040, 0x2351, 0x7007,
+ 0x0003, 0x701b, 0x27c4, 0x007c, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078,
+ 0x3111, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a,
+ 0x20a0, 0x1078, 0x3111, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x81ff, 0x00c0, 0x2351, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x1078, 0x34d1, 0x0078, 0x2327, 0x81ff,
+ 0x00c0, 0x2351, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2355, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x2031, 0x000f, 0x1078, 0x33fa, 0x8631,
+ 0x00c8, 0x2805, 0x2019, 0x0004, 0x1078, 0x34e7, 0x7924, 0x810f,
+ 0x7a28, 0x1078, 0x2815, 0x0078, 0x2327, 0xa186, 0x00ff, 0x0040,
+ 0x281d, 0x1078, 0x282d, 0x0078, 0x282c, 0x2029, 0x007d, 0x2061,
+ 0x6c00, 0x644c, 0x2400, 0xa506, 0x0040, 0x2829, 0x2508, 0x1078,
+ 0x282d, 0x8529, 0x00c8, 0x2822, 0x007c, 0x1078, 0x336a, 0x00c0,
+ 0x2838, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4033,
+ 0x007c, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x1078, 0x33fa, 0x1078, 0x34dc, 0x0078, 0x2327, 0x81ff, 0x00c0,
+ 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078, 0x33fa, 0x1078,
+ 0x34c6, 0x0078, 0x2327, 0x6100, 0x0078, 0x2327, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x6004, 0xa086, 0x0707, 0x0040, 0x2355, 0x2001,
+ 0x6c00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2351, 0x0d7e, 0xace8,
+ 0x000a, 0x7924, 0xd184, 0x0040, 0x286f, 0xace8, 0x0006, 0x680c,
0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00,
- 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x23db, 0x7824,
- 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2949, 0x81ff, 0x00c0,
- 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x295d, 0xa182, 0x007e,
- 0x00c8, 0x2409, 0x2100, 0x1078, 0x1feb, 0x027e, 0x0c7e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x71c9, 0x601b, 0x0000, 0x601f, 0x0000,
- 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a,
- 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x326c,
- 0x1078, 0x433a, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078,
- 0x28d1, 0x127f, 0x0c7f, 0x027f, 0x0078, 0x23db, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0x0c7e, 0x1078, 0x34bf, 0x2c08, 0x0c7f, 0x00c0,
- 0x2409, 0x0078, 0x23db, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c,
- 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2995, 0x017f,
- 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c,
- 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108,
- 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x1078,
- 0x12c7, 0x0040, 0x29ce, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
- 0x29c6, 0x2d00, 0x7012, 0x7016, 0x0078, 0x29cc, 0x7014, 0x6802,
- 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0, 0x29de, 0x7e28,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x29df, 0xa066, 0x8cff,
- 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0,
- 0x29ef, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x29f0, 0xa066,
- 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x29fd, 0x2168,
- 0x6904, 0x1078, 0x12fb, 0x0078, 0x29f4, 0x7112, 0x7116, 0x017f,
- 0x007c, 0x2031, 0x0001, 0x0078, 0x2a07, 0x2031, 0x0000, 0x2061,
- 0x70bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b, 0x23db, 0x007c,
- 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x707b,
- 0x2004, 0xa005, 0x00c0, 0x2a32, 0x0068, 0x2a32, 0x7818, 0xd084,
- 0x00c0, 0x2a32, 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080,
- 0x0078, 0x2a56, 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x706d, 0x7138,
- 0xa182, 0x0008, 0x0048, 0x2a40, 0x7030, 0x2060, 0x0078, 0x2a51,
- 0x7030, 0xa0e0, 0x0008, 0xac82, 0x70bd, 0x0048, 0x2a49, 0x2061,
- 0x707d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2a4f, 0x7036, 0x8108,
- 0x713a, 0x2262, 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f,
- 0x007c, 0x0e7e, 0x2071, 0x706d, 0x7038, 0xa005, 0x0040, 0x2a90,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x2a8f, 0x0f7e, 0x2079, 0x0000,
- 0x7818, 0xd084, 0x00c0, 0x2a8e, 0x0c7e, 0x781b, 0x0001, 0x7034,
- 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038,
- 0x8001, 0x703a, 0xa005, 0x00c0, 0x2a84, 0x7033, 0x707d, 0x7037,
- 0x707d, 0x0c7f, 0x0078, 0x2a8e, 0xac80, 0x0008, 0xa0fa, 0x70bd,
- 0x0048, 0x2a8c, 0x2001, 0x707d, 0x7036, 0x0c7f, 0x0f7f, 0x127f,
- 0x0e7f, 0x007c, 0x027e, 0x2001, 0x7052, 0x2004, 0xd0c4, 0x0040,
- 0x2a9d, 0x2011, 0x8014, 0x1078, 0x2a18, 0x027f, 0x007c, 0x81ff,
- 0x00c0, 0x2405, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032,
- 0x1078, 0x3247, 0x127f, 0x0078, 0x23db, 0x7824, 0x2008, 0xa18c,
- 0xfffd, 0x00c0, 0x2ab8, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x23db,
- 0x0078, 0x2409, 0x81ff, 0x00c0, 0x2405, 0x6000, 0xa086, 0x0003,
- 0x00c0, 0x2405, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x00c0, 0x2405,
- 0x1078, 0x29e1, 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff, 0xa086,
- 0x0006, 0x00c0, 0x2ad7, 0x7828, 0xa005, 0x0040, 0x23db, 0x0c7e,
- 0x1078, 0x29b7, 0x0c7f, 0x0040, 0x2405, 0x6837, 0x0000, 0x6833,
- 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x649c, 0x0040, 0x2405,
- 0x7007, 0x0003, 0x701b, 0x2aed, 0x007c, 0x6830, 0xa086, 0x0100,
- 0x0040, 0x2405, 0x0078, 0x23db, 0x2001, 0x7000, 0x2004, 0xa086,
- 0x0003, 0x00c0, 0x2405, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x1078, 0x29b7, 0x0040, 0x2405, 0x2009, 0x0000, 0x2031, 0x0000,
- 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0,
- 0x1078, 0x34fa, 0x00c0, 0x2b3a, 0x6004, 0xa0c6, 0x0707, 0x0040,
- 0x2b3a, 0xa084, 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2b3a, 0x87ff,
- 0x0040, 0x2b2d, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004,
- 0x53a3, 0x1078, 0x29a1, 0x0078, 0x2b36, 0xac80, 0x000a, 0x2098,
- 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x29a1, 0x21a2, 0x94a0,
- 0xa6b0, 0x0005, 0x8108, 0xa186, 0x007e, 0x0040, 0x2b45, 0xa686,
- 0x0028, 0x0040, 0x2b4e, 0x0078, 0x2b10, 0x86ff, 0x00c0, 0x2b4c,
- 0x7120, 0x810b, 0x0078, 0x23db, 0x702f, 0x0001, 0x711e, 0x7020,
- 0xa600, 0x7022, 0x772a, 0x2061, 0x70bd, 0x6007, 0x0000, 0x6612,
- 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
- 0x1332, 0x7007, 0x0002, 0x701b, 0x2b66, 0x007c, 0x702c, 0xa005,
- 0x00c0, 0x2b78, 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000,
- 0x2061, 0x70bd, 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2b10,
- 0x7120, 0x810b, 0x0078, 0x23db, 0x127e, 0x0c7e, 0x0e7e, 0x2061,
- 0x0100, 0x2071, 0x7000, 0x6044, 0xd0a4, 0x00c0, 0x2ba5, 0xd084,
- 0x0040, 0x2b8e, 0x1078, 0x2ccc, 0x0078, 0x2ba1, 0xd08c, 0x0040,
- 0x2b95, 0x1078, 0x2be3, 0x0078, 0x2ba1, 0xd094, 0x0040, 0x2b9c,
- 0x1078, 0x2bc6, 0x0078, 0x2ba1, 0xd09c, 0x0040, 0x2ba1, 0x1078,
- 0x2baf, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c,
- 0x00c0, 0x2bac, 0xc19d, 0x612a, 0x017f, 0x0078, 0x2ba1, 0x6043,
- 0x0040, 0x6043, 0x0000, 0x7067, 0x0000, 0x707f, 0x0001, 0x709f,
- 0x0000, 0x2009, 0x75c0, 0x200b, 0x0000, 0x706b, 0x000f, 0x2009,
- 0x000f, 0x2011, 0x3207, 0x1078, 0x433a, 0x007c, 0x7068, 0xa005,
- 0x00c0, 0x2be2, 0x2011, 0x3207, 0x1078, 0x42aa, 0x6043, 0x0020,
- 0x6043, 0x0000, 0x6044, 0xd08c, 0x00c0, 0x2bde, 0x707b, 0x0000,
- 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2be2, 0x706f, 0x0000,
- 0x0078, 0x2be2, 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2bec,
- 0x1079, 0x2bef, 0x0078, 0x2bee, 0x1078, 0x1288, 0x007c, 0x2bf2,
- 0x2c41, 0x2ccb, 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1,
- 0x8700, 0x1078, 0x1d4d, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079,
- 0x7400, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f,
- 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f,
- 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f,
- 0x0000, 0x2079, 0x740c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099,
- 0x7005, 0x20a1, 0x740e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7412,
- 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7400, 0x20a1, 0x020b,
- 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078,
- 0x322e, 0x0f7f, 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000,
- 0x007c, 0x0d7e, 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2cb5,
- 0x6020, 0xd0b4, 0x00c0, 0x2cb3, 0x717c, 0x81ff, 0x0040, 0x2c9c,
- 0xa486, 0x000c, 0x00c0, 0x2ca7, 0xa480, 0x0018, 0x8004, 0x20a8,
- 0x2011, 0x7480, 0x2019, 0x7400, 0x220c, 0x2304, 0xa106, 0x00c0,
- 0x2c73, 0x8210, 0x8318, 0x00f0, 0x2c5c, 0x6043, 0x0004, 0x608b,
- 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b,
- 0x0002, 0x0078, 0x2cb3, 0x2069, 0x7480, 0x6930, 0xa18e, 0x1101,
- 0x00c0, 0x2ca7, 0x6834, 0xa005, 0x00c0, 0x2ca7, 0x6900, 0xa18c,
- 0x00ff, 0x00c0, 0x2c87, 0x6804, 0xa005, 0x0040, 0x2c9c, 0x2011,
- 0x748e, 0x2019, 0x7005, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102,
- 0x0048, 0x2c9a, 0x00c0, 0x2ca7, 0x8210, 0x8318, 0x00f0, 0x2c8d,
- 0x0078, 0x2ca7, 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043,
- 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2cb3, 0x60c3,
- 0x000c, 0x1078, 0x322e, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0,
- 0x2cb3, 0x60c3, 0x000c, 0x2011, 0x71c0, 0x2013, 0x0000, 0x7073,
- 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
- 0x50a7, 0x0078, 0x2cb3, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8,
- 0x2cd5, 0x1079, 0x2cd8, 0x0078, 0x2cd7, 0x1078, 0x1288, 0x007c,
- 0x2cfc, 0x2d0b, 0x2d3c, 0x2d51, 0x2d81, 0x2da9, 0x2dd9, 0x2e03,
- 0x2e33, 0x2e59, 0x2ea4, 0x2ec6, 0x2eea, 0x2f00, 0x2f26, 0x2f39,
- 0x2f42, 0x2f5b, 0x2f89, 0x2fb1, 0x2fdf, 0x3009, 0x304e, 0x3083,
- 0x30a5, 0x30e3, 0x3107, 0x3120, 0x312d, 0x7003, 0x0007, 0x6004,
- 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0,
- 0x6043, 0x0002, 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x320e,
- 0x1078, 0x429d, 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0,
- 0x2d3a, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2d3a, 0x2079,
- 0x7480, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d38, 0x7834, 0xa005,
- 0x00c0, 0x2d38, 0x7a38, 0xd2fc, 0x0040, 0x2d2e, 0x709c, 0xa005,
- 0x00c0, 0x2d2e, 0x1078, 0x32c7, 0x709f, 0x0001, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0x707b, 0x0010, 0x1078, 0x2f42, 0x0078, 0x2d3a,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004,
- 0x1078, 0x3298, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a,
- 0x20a3, 0x0000, 0x00f0, 0x2d48, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2d7f, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2d7b, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d7b, 0x7834, 0xa005, 0x00c0,
- 0x2d7b, 0x7a38, 0xd2fc, 0x0040, 0x2d75, 0x709c, 0xa005, 0x00c0,
- 0x2d75, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078,
- 0x2d81, 0x0078, 0x2d7f, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0005, 0x1078, 0x3298, 0x20a3, 0x1103, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2d9b,
- 0x714c, 0xa186, 0xffff, 0x0040, 0x2d9b, 0x1078, 0x31d2, 0x0040,
- 0x2d9b, 0x1078, 0x32c7, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2dd7, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2dd3, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2dd3, 0x7834, 0xa005, 0x00c0,
- 0x2dd3, 0x7a38, 0xd2fc, 0x0040, 0x2dcd, 0x709c, 0xa005, 0x00c0,
- 0x2dcd, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078,
- 0x2dd9, 0x0078, 0x2dd7, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0007, 0x1078, 0x3298, 0x20a3, 0x1104, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2df5,
- 0x7150, 0xa186, 0xffff, 0x0040, 0x2df5, 0xa180, 0x2207, 0x200c,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x31d2, 0x20a9, 0x0008, 0x2298,
+ 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x2327, 0x7824,
+ 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2889, 0x81ff, 0x00c0,
+ 0x2351, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2355, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x289d, 0xa182, 0x007e,
+ 0x00c8, 0x2355, 0x2100, 0x1078, 0x1f68, 0x027e, 0x0c7e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x6dc3, 0x601b, 0x0000, 0x601f, 0x0000,
+ 0x2061, 0x6c00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6030, 0xa084,
+ 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
+ 0x2009, 0x001e, 0x2011, 0x30ee, 0x1078, 0x40b6, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0x7a28, 0x1078, 0x2815, 0x127f, 0x0c7f, 0x027f,
+ 0x0078, 0x2327, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078,
+ 0x3333, 0x2c08, 0x0c7f, 0x00c0, 0x2355, 0x0078, 0x2327, 0x1078,
+ 0x12a7, 0x0040, 0x28ee, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
+ 0x28e6, 0x2d00, 0x7012, 0x7016, 0x0078, 0x28ec, 0x7014, 0x6802,
+ 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24,
+ 0x860f, 0xa18c, 0x00ff, 0x1078, 0x336a, 0x00c0, 0x28fd, 0xa6b4,
+ 0x00ff, 0xa682, 0x0010, 0x0048, 0x28fe, 0xa066, 0x8cff, 0x007c,
+ 0x017e, 0x7110, 0x81ff, 0x0040, 0x290b, 0x2168, 0x6904, 0x1078,
+ 0x12db, 0x0078, 0x2902, 0x7112, 0x7116, 0x017f, 0x007c, 0x2031,
+ 0x0001, 0x0078, 0x2915, 0x2031, 0x0000, 0x2061, 0x6cbd, 0x6606,
+ 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
+ 0x1312, 0x7007, 0x0002, 0x701b, 0x2327, 0x007c, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x6c7b, 0x2004, 0xa005,
+ 0x00c0, 0x2940, 0x0068, 0x2940, 0x7818, 0xd084, 0x00c0, 0x2940,
+ 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080, 0x0078, 0x2964,
+ 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x6c6d, 0x7138, 0xa182, 0x0008,
+ 0x0048, 0x294e, 0x7030, 0x2060, 0x0078, 0x295f, 0x7030, 0xa0e0,
+ 0x0008, 0xac82, 0x6cbd, 0x0048, 0x2957, 0x2061, 0x6c7d, 0x2c00,
+ 0x7032, 0x81ff, 0x00c0, 0x295d, 0x7036, 0x8108, 0x713a, 0x2262,
+ 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6c6d, 0x7038, 0xa005, 0x0040, 0x299e, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x299d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084,
+ 0x00c0, 0x299c, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04,
+ 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
+ 0xa005, 0x00c0, 0x2992, 0x7033, 0x6c7d, 0x7037, 0x6c7d, 0x0c7f,
+ 0x0078, 0x299c, 0xac80, 0x0008, 0xa0fa, 0x6cbd, 0x0048, 0x299a,
+ 0x2001, 0x6c7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
+ 0x027e, 0x2001, 0x6c52, 0x2004, 0xd0c4, 0x0040, 0x29ab, 0x2011,
+ 0x8014, 0x1078, 0x2926, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2351,
+ 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x30c9,
+ 0x127f, 0x0078, 0x2327, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
+ 0x29c6, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x2327, 0x0078, 0x2355,
+ 0x81ff, 0x00c0, 0x2351, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2351,
+ 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x29e5, 0x7828, 0xa005, 0x0040, 0x2327, 0x0c7e, 0x1078, 0x28d7,
+ 0x0c7f, 0x0040, 0x2351, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+ 0xc0fd, 0x683a, 0x1078, 0x612d, 0x0040, 0x2351, 0x7007, 0x0003,
+ 0x701b, 0x29fb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2351,
+ 0x0078, 0x2327, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
+ 0x6c00, 0x6044, 0xd0a4, 0x00c0, 0x2a27, 0xd084, 0x0040, 0x2a14,
+ 0x1078, 0x2b4a, 0x0078, 0x2a27, 0xd08c, 0x0040, 0x2a1b, 0x1078,
+ 0x2a61, 0x0078, 0x2a27, 0xd094, 0x0040, 0x2a22, 0x1078, 0x2a42,
+ 0x0078, 0x2a27, 0xd09c, 0x0040, 0x2a27, 0x1078, 0x2a2b, 0x0e7f,
+ 0x0c7f, 0x127f, 0x007c, 0x6043, 0x0040, 0x6043, 0x0000, 0x7067,
+ 0x0000, 0x707f, 0x0001, 0x709f, 0x0000, 0x2009, 0x71c0, 0x200b,
+ 0x0000, 0x706b, 0x000f, 0x2009, 0x000f, 0x2011, 0x3085, 0x1078,
+ 0x40b6, 0x007c, 0x7068, 0xa005, 0x00c0, 0x2a60, 0x2011, 0x3085,
+ 0x1078, 0x4026, 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c,
+ 0x00c0, 0x2a5c, 0x7003, 0x0001, 0x707b, 0x0000, 0x6043, 0x0090,
+ 0x6043, 0x0010, 0x0078, 0x2a60, 0x706f, 0x0000, 0x0078, 0x2a60,
+ 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2a6a, 0x1079, 0x2a6d,
+ 0x0078, 0x2a6c, 0x1078, 0x126a, 0x007c, 0x2a70, 0x2abf, 0x2b49,
+ 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
+ 0x1ce3, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7000, 0x207b,
+ 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813,
+ 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823,
+ 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079,
+ 0x700c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x6c05, 0x20a1,
+ 0x700e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7012, 0x207b, 0x0000,
+ 0x7807, 0x0000, 0x2099, 0x7000, 0x20a1, 0x020b, 0x20a9, 0x0014,
+ 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x30b0, 0x0f7f,
+ 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
+ 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2b33, 0x6020, 0xd0b4,
+ 0x00c0, 0x2b31, 0x717c, 0x81ff, 0x0040, 0x2b1a, 0xa486, 0x000c,
+ 0x00c0, 0x2b25, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7080,
+ 0x2019, 0x7000, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2af1, 0x8210,
+ 0x8318, 0x00f0, 0x2ada, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
+ 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b, 0x0002, 0x0078,
+ 0x2b31, 0x2069, 0x7080, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2b25,
+ 0x6834, 0xa005, 0x00c0, 0x2b25, 0x6900, 0xa18c, 0x00ff, 0x00c0,
+ 0x2b05, 0x6804, 0xa005, 0x0040, 0x2b1a, 0x2011, 0x708e, 0x2019,
+ 0x6c05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2b18,
+ 0x00c0, 0x2b25, 0x8210, 0x8318, 0x00f0, 0x2b0b, 0x0078, 0x2b25,
+ 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080,
+ 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2b31, 0x60c3, 0x000c, 0x1078,
+ 0x30b0, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2b31, 0x60c3,
+ 0x000c, 0x2011, 0x6dba, 0x2013, 0x0000, 0x7073, 0x0000, 0x20e1,
+ 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4e0e, 0x0078,
+ 0x2b31, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8, 0x2b53, 0x1079,
+ 0x2b56, 0x0078, 0x2b55, 0x1078, 0x126a, 0x007c, 0x2b7a, 0x2b89,
+ 0x2bba, 0x2bcf, 0x2bff, 0x2c27, 0x2c57, 0x2c81, 0x2cb1, 0x2cd7,
+ 0x2d22, 0x2d44, 0x2d68, 0x2d7e, 0x2da4, 0x2db7, 0x2dc0, 0x2dd9,
+ 0x2e07, 0x2e2f, 0x2e5d, 0x2e87, 0x2ecc, 0x2f01, 0x2f23, 0x2f61,
+ 0x2f85, 0x2f9e, 0x2fab, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
+ 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002,
+ 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x4019,
+ 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0, 0x2bb8, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2bb8, 0x2079, 0x7080, 0x7a30,
+ 0xa296, 0x1102, 0x00c0, 0x2bb6, 0x7834, 0xa005, 0x00c0, 0x2bb6,
+ 0x7a38, 0xd2fc, 0x0040, 0x2bac, 0x709c, 0xa005, 0x00c0, 0x2bac,
+ 0x1078, 0x3148, 0x709f, 0x0001, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0x707b, 0x0010, 0x1078, 0x2dc0, 0x0078, 0x2bb8, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004, 0x1078, 0x3119,
+ 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000,
+ 0x00f0, 0x2bc6, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2bfd, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2bf9, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1102, 0x00c0, 0x2bf9, 0x7834, 0xa005, 0x00c0, 0x2bf9, 0x7a38,
+ 0xd2fc, 0x0040, 0x2bf3, 0x709c, 0xa005, 0x00c0, 0x2bf3, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078, 0x2bff, 0x0078,
+ 0x2bfd, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0005, 0x1078, 0x3119, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2c19, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2c19, 0x1078, 0x3050, 0x0040, 0x2c19, 0x1078,
+ 0x3148, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2c55, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2c51, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2c51, 0x7834, 0xa005, 0x00c0, 0x2c51, 0x7a38,
+ 0xd2fc, 0x0040, 0x2c4b, 0x709c, 0xa005, 0x00c0, 0x2c4b, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078, 0x2c57, 0x0078,
+ 0x2c55, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0007, 0x1078, 0x3119, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2c73, 0x7150, 0xa186,
+ 0xffff, 0x0040, 0x2c73, 0xa180, 0x2154, 0x200c, 0xa18c, 0xff00,
+ 0x810f, 0x1078, 0x3050, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2caf, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0014, 0x00c0, 0x2cab, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2cab, 0x7834, 0xa005, 0x00c0,
+ 0x2cab, 0x7a38, 0xd2fc, 0x0040, 0x2ca5, 0x709c, 0xa005, 0x00c0,
+ 0x2ca5, 0x1078, 0x3148, 0x709f, 0x0001, 0x707b, 0x0008, 0x1078,
+ 0x2cb1, 0x0078, 0x2caf, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
+ 0x007c, 0x707b, 0x0009, 0x1078, 0x3119, 0x20a3, 0x1105, 0x20a3,
+ 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2cc4, 0x1078, 0x2fba,
+ 0x0040, 0x2cd4, 0x0078, 0x2cce, 0x20a9, 0x0008, 0x2099, 0x708e,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e31,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2e2d,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2e2d, 0x7834,
- 0xa005, 0x00c0, 0x2e2d, 0x7a38, 0xd2fc, 0x0040, 0x2e27, 0x709c,
- 0xa005, 0x00c0, 0x2e27, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b,
- 0x0008, 0x1078, 0x2e33, 0x0078, 0x2e31, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0009, 0x1078, 0x3298, 0x20a3,
- 0x1105, 0x20a3, 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2e46,
- 0x1078, 0x313c, 0x0040, 0x2e56, 0x0078, 0x2e50, 0x20a9, 0x0008,
- 0x2099, 0x748e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x322e, 0x0078, 0x2e58, 0x1078, 0x2cf5,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2ea2, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2e9e, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e9e, 0x7834, 0x2011, 0x0100,
- 0xa21e, 0x00c0, 0x2e87, 0x7a38, 0xd2fc, 0x0040, 0x2e7f, 0x709c,
- 0xa005, 0x00c0, 0x2e7f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077,
- 0x0001, 0x707b, 0x000a, 0x1078, 0x2ea4, 0x0078, 0x2ea2, 0xa005,
- 0x00c0, 0x2e9e, 0x7a38, 0xd2fc, 0x0040, 0x2e96, 0x709c, 0xa005,
- 0x00c0, 0x2e96, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077, 0x0000,
- 0x707b, 0x000e, 0x1078, 0x2f26, 0x0078, 0x2ea2, 0x707b, 0x0002,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x740e,
- 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002,
- 0x2009, 0x0000, 0x41a4, 0x1078, 0x3298, 0x20a3, 0x1106, 0x20a3,
- 0x0000, 0x6030, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042,
- 0x53a6, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070,
- 0xa005, 0x0040, 0x2ee8, 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086,
- 0x0084, 0x00c0, 0x2ee4, 0x2079, 0x7480, 0x7a30, 0xa296, 0x1106,
- 0x00c0, 0x2ee4, 0x7834, 0xa005, 0x00c0, 0x2ee4, 0x707b, 0x000c,
- 0x1078, 0x2eea, 0x0078, 0x2ee8, 0x707b, 0x0002, 0x7073, 0x0000,
- 0x0f7f, 0x007c, 0x707b, 0x000d, 0x1078, 0x3298, 0x20a3, 0x1107,
- 0x20a3, 0x0000, 0x2099, 0x748e, 0x20a9, 0x0040, 0x53a6, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c,
- 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f24, 0x2011, 0x320e, 0x1078,
- 0x42aa, 0xa086, 0x0084, 0x00c0, 0x2f20, 0x2079, 0x7480, 0x7a30,
- 0xa296, 0x1107, 0x00c0, 0x2f20, 0x7834, 0xa005, 0x00c0, 0x2f20,
- 0x1078, 0x328a, 0x707b, 0x000e, 0x1078, 0x2f26, 0x0078, 0x2f24,
- 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f,
- 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005,
- 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x320e, 0x1078, 0x429d,
- 0x007c, 0x7070, 0xa005, 0x0040, 0x2f41, 0x2011, 0x320e, 0x1078,
- 0x42aa, 0x007c, 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080,
- 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f87,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2f85,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2f85, 0x7834,
- 0xa005, 0x00c0, 0x2f85, 0x7a38, 0xd2fc, 0x0040, 0x2f7f, 0x709c,
- 0xa005, 0x00c0, 0x2f7f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b,
- 0x0012, 0x1078, 0x2f89, 0x0078, 0x2f87, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0013, 0x1078, 0x32a4, 0x20a3, 0x1103, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2fa3,
- 0x714c, 0xa186, 0xffff, 0x0040, 0x2fa3, 0x1078, 0x31d2, 0x0040,
- 0x2fa3, 0x1078, 0x32c7, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2fdd, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2fdb, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2fdb, 0x7834, 0xa005, 0x00c0,
- 0x2fdb, 0x7a38, 0xd2fc, 0x0040, 0x2fd5, 0x709c, 0xa005, 0x00c0,
- 0x2fd5, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078,
- 0x2fdf, 0x0078, 0x2fdd, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x0015, 0x1078, 0x32a4, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x748e, 0x7064, 0xa006, 0x00c0, 0x2ffb, 0x7150, 0xa186,
- 0xffff, 0x0040, 0x2ffb, 0xa180, 0x2207, 0x200c, 0xa18c, 0xff00,
- 0x810f, 0x1078, 0x31d2, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x304c, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x304a, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1105, 0x00c0, 0x304a, 0x7834, 0x2011, 0x0100,
- 0xa21e, 0x00c0, 0x3033, 0x7a38, 0xd2fc, 0x0040, 0x302f, 0x709c,
- 0xa005, 0x00c0, 0x302f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077,
- 0x0001, 0x0078, 0x3044, 0xa005, 0x00c0, 0x304a, 0x7a38, 0xd2fc,
- 0x0040, 0x3042, 0x709c, 0xa005, 0x00c0, 0x3042, 0x1078, 0x32c7,
- 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x304e,
- 0x0078, 0x304c, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x000e,
- 0x53a6, 0x3430, 0x2011, 0x748e, 0x7074, 0xa005, 0x0040, 0x3064,
- 0x707b, 0x0017, 0x0078, 0x3066, 0x707b, 0x001b, 0x7064, 0xa005,
- 0x00c0, 0x3070, 0x1078, 0x313c, 0x0040, 0x3080, 0x0078, 0x307a,
- 0x20a9, 0x0008, 0x2099, 0x748e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e, 0x0078, 0x3082,
- 0x1078, 0x2cf5, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x30a3,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0084, 0x00c0, 0x30a1,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x30a1, 0x7834,
- 0xa005, 0x00c0, 0x30a1, 0x707b, 0x0018, 0x1078, 0x30a5, 0x0078,
- 0x30a3, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078,
- 0x32a4, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x748e,
- 0x2039, 0x740e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514,
- 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
- 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0x740e, 0x2414,
- 0xa38c, 0x0001, 0x0040, 0x30d0, 0xa294, 0xff00, 0x0078, 0x30d3,
- 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9,
- 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x3105,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0084, 0x00c0, 0x3103,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3103, 0x7834,
- 0xa005, 0x00c0, 0x3103, 0x1078, 0x328a, 0x707b, 0x001a, 0x1078,
- 0x3107, 0x0078, 0x3105, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7480, 0x20a1,
- 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8,
- 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c,
- 0x7070, 0xa005, 0x0040, 0x312c, 0x2011, 0x320e, 0x1078, 0x42aa,
- 0x707b, 0x001c, 0x1078, 0x312d, 0x007c, 0x7073, 0x0000, 0x608b,
- 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011,
- 0x320e, 0x1078, 0x429d, 0x007c, 0x087e, 0x097e, 0x2029, 0x7052,
- 0x252c, 0x20a9, 0x0008, 0x2041, 0x740e, 0x28a0, 0x2099, 0x748e,
- 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3152,
- 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0,
- 0x3164, 0xd5d4, 0x0040, 0x315f, 0x8210, 0x0078, 0x3160, 0x8211,
- 0x00f0, 0x3152, 0x0078, 0x31c9, 0x82ff, 0x00c0, 0x3176, 0xd5d4,
- 0x0040, 0x3170, 0xa1a6, 0x3fff, 0x0040, 0x315c, 0x0078, 0x3174,
- 0xa1a6, 0x3fff, 0x0040, 0x31c9, 0xa18d, 0xc000, 0x20a9, 0x0010,
- 0x2019, 0x0001, 0xd5d4, 0x0040, 0x317f, 0x2019, 0x0010, 0x2120,
- 0xd5d4, 0x0040, 0x3186, 0x8423, 0x0078, 0x3187, 0x8424, 0x00c8,
- 0x3194, 0xd5d4, 0x0040, 0x318f, 0x8319, 0x0078, 0x3190, 0x8318,
- 0x00f0, 0x3180, 0x0078, 0x31c9, 0x23a8, 0x2021, 0x0001, 0x8426,
- 0x8425, 0x00f0, 0x3198, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040,
- 0x31ac, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8,
- 0xa5a8, 0x0010, 0x00f0, 0x31a8, 0x754e, 0xa5c8, 0x2207, 0x292c,
- 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304,
- 0xa405, 0x201a, 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
- 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078,
- 0x31cf, 0xa006, 0x0078, 0x31cf, 0xa006, 0x1078, 0x1288, 0x097f,
- 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a,
- 0x0010, 0x0048, 0x31df, 0x8420, 0x8001, 0x0078, 0x31d7, 0x2118,
- 0x84ff, 0x0040, 0x31e8, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x31e3,
- 0x2021, 0x0001, 0x83ff, 0x0040, 0x31f1, 0x8423, 0x8319, 0x00c0,
- 0x31ed, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x3206, 0xa405, 0x203a,
- 0x714e, 0xa1a0, 0x2207, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
- 0x0000, 0x65ea, 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x7000, 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e,
- 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x50b0, 0x7004, 0xa084,
- 0x4000, 0x0040, 0x321f, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x701e, 0x2073, 0x0000, 0x7843, 0x0090,
- 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x2011, 0x71c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x127f,
- 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x50a7,
- 0x2009, 0x07d0, 0x2011, 0x320e, 0x1078, 0x433a, 0x007c, 0x017e,
- 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078,
- 0x32b0, 0x2061, 0x71c9, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061,
- 0x7000, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043,
- 0x0010, 0x2009, 0x001e, 0x2011, 0x326c, 0x1078, 0x429d, 0x127f,
- 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x0100, 0x1078, 0x50b0, 0x2071, 0x0140, 0x7004,
- 0xa084, 0x4000, 0x0040, 0x3280, 0x7003, 0x1000, 0x7003, 0x0000,
- 0x2001, 0x0001, 0x1078, 0x1f8a, 0x1078, 0x3247, 0x127f, 0x007f,
- 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x75c0, 0x2099, 0x748e,
- 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x3290, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7400, 0x20a1, 0x020b,
- 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c,
- 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001, 0x702a, 0x2004,
- 0xa005, 0x00c0, 0x32c1, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078,
- 0x32c3, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e,
- 0x047e, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x0040, 0x32da, 0xa006,
- 0x2020, 0x2009, 0x002a, 0x1078, 0x6ecf, 0x2001, 0x700c, 0x200c,
- 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2186, 0x047f, 0x017f,
- 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x7120, 0xa006, 0x200a,
- 0x8108, 0x00f0, 0x32e7, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x2069, 0x7051, 0xa006, 0x6002, 0x6007, 0x0707,
- 0x600a, 0x600e, 0x6012, 0xa198, 0x2207, 0x231c, 0xa39c, 0x00ff,
- 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9,
- 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e,
- 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e,
- 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a, 0x608e,
- 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x0d7e, 0x60a4, 0xa06d,
- 0x0040, 0x332c, 0x1078, 0x12fb, 0x60a7, 0x0000, 0x60a8, 0xa06d,
- 0x0040, 0x3334, 0x1078, 0x12fb, 0x60ab, 0x0000, 0x0d7f, 0xa006,
- 0x604a, 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff,
- 0x6042, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x00c8, 0x33e5, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8,
- 0x33eb, 0x2001, 0x700c, 0x2004, 0xa084, 0x0003, 0x00c0, 0x33ce,
- 0xa188, 0x7120, 0x2104, 0xa065, 0x0040, 0x33c4, 0x6004, 0xa084,
- 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x33ca, 0x60a4, 0xa00d, 0x0040,
- 0x3375, 0x1078, 0x370a, 0x0040, 0x33be, 0x60a8, 0xa00d, 0x0040,
- 0x338f, 0x1078, 0x375a, 0x00c0, 0x338f, 0x694c, 0xd1fc, 0x00c0,
- 0x3385, 0x1078, 0x347f, 0x0078, 0x33b9, 0x1078, 0x3450, 0x694c,
- 0xd1ec, 0x00c0, 0x33b9, 0x1078, 0x35df, 0x0078, 0x33b9, 0x694c,
- 0xa184, 0xa000, 0x0040, 0x33a9, 0xd1ec, 0x0040, 0x33a2, 0xd1fc,
- 0x0040, 0x339e, 0x1078, 0x35f0, 0x0078, 0x33a5, 0x1078, 0x35f0,
- 0x0078, 0x33a9, 0xd1fc, 0x0040, 0x33a9, 0x1078, 0x3450, 0x0078,
- 0x33b9, 0x6050, 0xa00d, 0x0040, 0x33b4, 0x2d00, 0x200a, 0x6803,
- 0x0000, 0x6052, 0x0078, 0x33b9, 0x2d00, 0x6052, 0x604e, 0x6803,
- 0x0000, 0x1078, 0x4581, 0xa006, 0x127f, 0x007c, 0x2001, 0x0005,
- 0x2009, 0x0000, 0x0078, 0x33ef, 0x2001, 0x0028, 0x2009, 0x0000,
- 0x0078, 0x33ef, 0xa082, 0x0006, 0x0048, 0x336d, 0x2009, 0x700c,
- 0x210c, 0xd18c, 0x0040, 0x33d8, 0x2001, 0x0004, 0x0078, 0x33e1,
- 0xd184, 0x0040, 0x33df, 0x2001, 0x0004, 0x0078, 0x33e1, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x33ef, 0x2001, 0x0029, 0x2009,
- 0x0000, 0x0078, 0x33ef, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005,
- 0x127f, 0x007c, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x00c8, 0x3435, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8,
- 0x3425, 0xa188, 0x7120, 0x2104, 0xa065, 0x0040, 0x3425, 0x6004,
- 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x342b, 0x684c, 0xd0ec,
- 0x0040, 0x3418, 0x1078, 0x35f0, 0x1078, 0x3450, 0x0078, 0x3420,
- 0x1078, 0x3450, 0x684c, 0xd0fc, 0x0040, 0x3420, 0x1078, 0x35df,
- 0x1078, 0x3638, 0xa006, 0x0078, 0x3439, 0x2001, 0x0028, 0x2009,
- 0x0000, 0x0078, 0x3439, 0xa082, 0x0006, 0x0048, 0x340e, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x3439, 0x2001, 0x0029, 0x2009,
- 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d,
- 0x0040, 0x3449, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x127f,
- 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x3447,
- 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x345c, 0x6802,
- 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803,
- 0x0000, 0x0078, 0x345a, 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d,
- 0x0040, 0x3471, 0x6800, 0xa005, 0x00c0, 0x346f, 0x6052, 0x604e,
- 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x347e, 0x6800,
- 0xa005, 0x00c0, 0x347c, 0x6052, 0x604e, 0xad05, 0x007c, 0x6803,
- 0x0000, 0x6084, 0xa00d, 0x0040, 0x3489, 0x2d00, 0x200a, 0x6086,
- 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3488, 0x127e, 0x0c7e,
- 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005, 0x0040,
- 0x349c, 0xc285, 0x0078, 0x349d, 0xc284, 0x6202, 0x027f, 0x0c7f,
- 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260,
- 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294,
- 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e,
- 0xa182, 0x007e, 0x0048, 0x34c8, 0xa085, 0x0001, 0x0078, 0x34e0,
- 0xa190, 0x7120, 0x2204, 0xa065, 0x00c0, 0x34df, 0x017e, 0x0d7e,
- 0x1078, 0x12c7, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x34c4, 0x2c00,
- 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x1078, 0x32ed, 0xa006,
- 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x34eb, 0xa085,
- 0x0001, 0x0078, 0x34f8, 0x0d7e, 0xa190, 0x7120, 0x2204, 0xa06d,
- 0x0040, 0x34f6, 0x2013, 0x0000, 0x1078, 0x12fb, 0x0d7f, 0xa006,
- 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x3503, 0xa085,
- 0x0001, 0x0078, 0x350a, 0xa188, 0x7120, 0x2104, 0xa065, 0x0040,
- 0x34ff, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
+ 0x1078, 0x30b0, 0x0078, 0x2cd6, 0x1078, 0x2b73, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d20, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2d1c, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2d1c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2d05, 0x7a38, 0xd2fc, 0x0040, 0x2cfd, 0x709c, 0xa005, 0x00c0,
+ 0x2cfd, 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0001, 0x707b,
+ 0x000a, 0x1078, 0x2d22, 0x0078, 0x2d20, 0xa005, 0x00c0, 0x2d1c,
+ 0x7a38, 0xd2fc, 0x0040, 0x2d14, 0x709c, 0xa005, 0x00c0, 0x2d14,
+ 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x000e,
+ 0x1078, 0x2da4, 0x0078, 0x2d20, 0x707b, 0x0002, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x700e, 0x22a0, 0x20a9,
+ 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
+ 0x41a4, 0x1078, 0x3119, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
+ 0x0084, 0x1078, 0x30b0, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040,
+ 0x2d66, 0x2011, 0x308c, 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0,
+ 0x2d62, 0x2079, 0x7080, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2d62,
+ 0x7834, 0xa005, 0x00c0, 0x2d62, 0x707b, 0x000c, 0x1078, 0x2d68,
+ 0x0078, 0x2d66, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
+ 0x707b, 0x000d, 0x1078, 0x3119, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x708e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x30b0, 0x007c, 0x0f7e, 0x7070,
+ 0xa005, 0x0040, 0x2da2, 0x2011, 0x308c, 0x1078, 0x4026, 0xa086,
+ 0x0084, 0x00c0, 0x2d9e, 0x2079, 0x7080, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2d9e, 0x7834, 0xa005, 0x00c0, 0x2d9e, 0x1078, 0x310b,
+ 0x707b, 0x000e, 0x1078, 0x2da4, 0x0078, 0x2da2, 0x707b, 0x0002,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f, 0x7073, 0x0000,
+ 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
+ 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x4019, 0x007c, 0x7070,
+ 0xa005, 0x0040, 0x2dbf, 0x2011, 0x308c, 0x1078, 0x4026, 0x007c,
+ 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080,
+ 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e05, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0014, 0x00c0, 0x2e03, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2e03, 0x7834, 0xa005, 0x00c0,
+ 0x2e03, 0x7a38, 0xd2fc, 0x0040, 0x2dfd, 0x709c, 0xa005, 0x00c0,
+ 0x2dfd, 0x1078, 0x3148, 0x709f, 0x0001, 0x707b, 0x0012, 0x1078,
+ 0x2e07, 0x0078, 0x2e05, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0013, 0x1078, 0x3125, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2e21, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2e21, 0x1078, 0x3050, 0x0040, 0x2e21, 0x1078,
+ 0x3148, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2e5b, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2e59, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1104, 0x00c0, 0x2e59, 0x7834, 0xa005, 0x00c0, 0x2e59, 0x7a38,
+ 0xd2fc, 0x0040, 0x2e53, 0x709c, 0xa005, 0x00c0, 0x2e53, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078, 0x2e5d, 0x0078,
+ 0x2e5b, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0015, 0x1078,
+ 0x3125, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x708e,
+ 0x7064, 0xa006, 0x00c0, 0x2e79, 0x7150, 0xa186, 0xffff, 0x0040,
+ 0x2e79, 0xa180, 0x2154, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3050, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2eca, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2ec8, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2ec8, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2eb1, 0x7a38, 0xd2fc, 0x0040, 0x2ead, 0x709c, 0xa005, 0x00c0,
+ 0x2ead, 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0001, 0x0078,
+ 0x2ec2, 0xa005, 0x00c0, 0x2ec8, 0x7a38, 0xd2fc, 0x0040, 0x2ec0,
+ 0x709c, 0xa005, 0x00c0, 0x2ec0, 0x1078, 0x3148, 0x709f, 0x0001,
+ 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x2ecc, 0x0078, 0x2eca,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7080, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
+ 0x2011, 0x708e, 0x7074, 0xa005, 0x0040, 0x2ee2, 0x707b, 0x0017,
+ 0x0078, 0x2ee4, 0x707b, 0x001b, 0x7064, 0xa005, 0x00c0, 0x2eee,
+ 0x1078, 0x2fba, 0x0040, 0x2efe, 0x0078, 0x2ef8, 0x20a9, 0x0008,
+ 0x2099, 0x708e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x30b0, 0x0078, 0x2f00, 0x1078, 0x2b73,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f21, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0, 0x2f1f, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2f1f, 0x7834, 0xa005, 0x00c0,
+ 0x2f1f, 0x707b, 0x0018, 0x1078, 0x2f23, 0x0078, 0x2f21, 0x7073,
+ 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078, 0x3125, 0x20a3,
+ 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x708e, 0x2039, 0x700e,
+ 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084,
+ 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a,
+ 0x6030, 0x2310, 0x8214, 0xa2a0, 0x700e, 0x2414, 0xa38c, 0x0001,
+ 0x0040, 0x2f4e, 0xa294, 0xff00, 0x0078, 0x2f51, 0xa294, 0x00ff,
+ 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f83, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0, 0x2f81, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1107, 0x00c0, 0x2f81, 0x7834, 0xa005, 0x00c0,
+ 0x2f81, 0x1078, 0x310b, 0x707b, 0x001a, 0x1078, 0x2f85, 0x0078,
+ 0x2f83, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x001b, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080, 0x20a1, 0x020b, 0x7470,
+ 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8,
+ 0x53a6, 0x60c3, 0x0084, 0x1078, 0x30b0, 0x007c, 0x7070, 0xa005,
+ 0x0040, 0x2faa, 0x2011, 0x308c, 0x1078, 0x4026, 0x707b, 0x001c,
+ 0x1078, 0x2fab, 0x007c, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f,
+ 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078,
+ 0x4019, 0x007c, 0x087e, 0x097e, 0x2029, 0x6c52, 0x252c, 0x20a9,
+ 0x0008, 0x2041, 0x700e, 0x28a0, 0x2099, 0x708e, 0x53a3, 0x20a9,
+ 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x2fd0, 0x2011, 0x0000,
+ 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x2fe2, 0xd5d4,
+ 0x0040, 0x2fdd, 0x8210, 0x0078, 0x2fde, 0x8211, 0x00f0, 0x2fd0,
+ 0x0078, 0x3047, 0x82ff, 0x00c0, 0x2ff4, 0xd5d4, 0x0040, 0x2fee,
+ 0xa1a6, 0x3fff, 0x0040, 0x2fda, 0x0078, 0x2ff2, 0xa1a6, 0x3fff,
+ 0x0040, 0x3047, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
+ 0xd5d4, 0x0040, 0x2ffd, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
+ 0x3004, 0x8423, 0x0078, 0x3005, 0x8424, 0x00c8, 0x3012, 0xd5d4,
+ 0x0040, 0x300d, 0x8319, 0x0078, 0x300e, 0x8318, 0x00f0, 0x2ffe,
+ 0x0078, 0x3047, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
+ 0x3016, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x302a, 0x007e,
+ 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010,
+ 0x00f0, 0x3026, 0x754e, 0xa5c8, 0x2154, 0x292c, 0xa5ac, 0x00ff,
+ 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a,
+ 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x304d, 0xa006,
+ 0x0078, 0x304d, 0xa006, 0x1078, 0x126a, 0x097f, 0x087f, 0x007c,
+ 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048,
+ 0x305d, 0x8420, 0x8001, 0x0078, 0x3055, 0x2118, 0x84ff, 0x0040,
+ 0x3066, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3061, 0x2021, 0x0001,
+ 0x83ff, 0x0040, 0x306f, 0x8423, 0x8319, 0x00c0, 0x306b, 0xa238,
+ 0x2704, 0xa42c, 0x00c0, 0x3084, 0xa405, 0x203a, 0x714e, 0xa1a0,
+ 0x2154, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
+ 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6c00,
+ 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
+ 0x2071, 0x0140, 0x1078, 0x4e17, 0x7004, 0xa084, 0x4000, 0x0040,
+ 0x309d, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6c00, 0x7003, 0x0001, 0x2071, 0x6c1e, 0x2073, 0x0000,
+ 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x2011, 0x6dba, 0x2013, 0x0000, 0x7073,
+ 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
+ 0x1078, 0x4e0e, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x40b6,
+ 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009,
+ 0x00f7, 0x1078, 0x3131, 0x2061, 0x6dc3, 0x601b, 0x0000, 0x601f,
+ 0x0000, 0x2061, 0x6c00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
+ 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x30ee, 0x1078,
+ 0x4019, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078, 0x4e17, 0x2071,
+ 0x0140, 0xa084, 0x4000, 0x0040, 0x3101, 0x7003, 0x1000, 0x7003,
+ 0x0000, 0x2001, 0x0001, 0x1078, 0x1f0f, 0x1078, 0x30c9, 0x127f,
+ 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x71c0, 0x2099,
+ 0x708e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x3111,
+ 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7000, 0x20a1,
+ 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x2099, 0x7080, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6,
+ 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001, 0x6c2a,
+ 0x2004, 0xa005, 0x00c0, 0x3142, 0x6030, 0xa084, 0x00ff, 0xa105,
+ 0x0078, 0x3144, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c,
+ 0x017e, 0x047e, 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x0040, 0x315b,
+ 0xa006, 0x2020, 0x2009, 0x002a, 0x1078, 0x6b0a, 0x2001, 0x6c0c,
+ 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2103, 0x047f,
+ 0x017f, 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x6d20, 0xa006,
+ 0x200a, 0x8108, 0x00f0, 0x3168, 0x157f, 0x007c, 0x0d7e, 0x037e,
+ 0x157e, 0x137e, 0x147e, 0x2069, 0x6c51, 0xa006, 0x6002, 0x6007,
+ 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2154, 0x231c, 0xa39c,
+ 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4,
+ 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042,
+ 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a,
+ 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a,
+ 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a, 0x6810,
+ 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x147f,
+ 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000,
+ 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x325a, 0xa18c,
+ 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x3260, 0x2001, 0x6c0c,
+ 0x2004, 0xa084, 0x0003, 0x00c0, 0x3243, 0xa188, 0x6d20, 0x2104,
+ 0xa065, 0x0040, 0x3239, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+ 0x00c0, 0x323f, 0x6078, 0xa00d, 0x0040, 0x31e4, 0xa680, 0x6b9e,
+ 0x2004, 0xa10c, 0x00c0, 0x3233, 0x607c, 0xa00d, 0x0040, 0x3200,
+ 0xa680, 0x6b9e, 0x2004, 0xa10c, 0x0040, 0x3200, 0x694c, 0xd1fc,
+ 0x00c0, 0x31f6, 0x1078, 0x32f3, 0x0078, 0x322e, 0x1078, 0x32c4,
+ 0x694c, 0xd1ec, 0x00c0, 0x322e, 0x1078, 0x3413, 0x0078, 0x322e,
+ 0x694c, 0xa184, 0xa000, 0x0040, 0x321e, 0xd1ec, 0x0040, 0x3217,
+ 0xd1fc, 0x0040, 0x320f, 0x1078, 0x342a, 0x0078, 0x321a, 0xa680,
+ 0x6b9e, 0x200c, 0x607c, 0xa105, 0x607e, 0x0078, 0x321e, 0xd1fc,
+ 0x0040, 0x321e, 0x1078, 0x32c4, 0x0078, 0x322e, 0x6050, 0xa00d,
+ 0x0040, 0x3229, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0078,
+ 0x322e, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078, 0x42e3,
+ 0xa006, 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000, 0x0078,
+ 0x3264, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x3264, 0xa082,
+ 0x0006, 0x0048, 0x31da, 0x2009, 0x6c0c, 0x210c, 0xd18c, 0x0040,
+ 0x324d, 0x2001, 0x0004, 0x0078, 0x3256, 0xd184, 0x0040, 0x3254,
+ 0x2001, 0x0004, 0x0078, 0x3256, 0x2001, 0x0029, 0x2009, 0x0000,
+ 0x0078, 0x3264, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3264,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944,
+ 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x32a9, 0xa18c, 0xff00,
+ 0x810f, 0xa182, 0x007e, 0x00c8, 0x3299, 0xa188, 0x6d20, 0x2104,
+ 0xa065, 0x0040, 0x3299, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+ 0x00c0, 0x329f, 0x684c, 0xd0ec, 0x0040, 0x328c, 0x1078, 0x342a,
+ 0x1078, 0x32c4, 0x0078, 0x3294, 0x1078, 0x32c4, 0x684c, 0xd0fc,
+ 0x0040, 0x3294, 0x1078, 0x3413, 0x1078, 0x343e, 0xa006, 0x0078,
+ 0x32ad, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x32ad, 0xa082,
+ 0x0006, 0x0048, 0x3282, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
+ 0x32ad, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c, 0x127e,
+ 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x32bd, 0x2d00, 0x200a,
+ 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
+ 0x6803, 0x0000, 0x0078, 0x32bb, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa005, 0x0040, 0x32d0, 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c,
+ 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x32ce, 0x127e,
+ 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x32e5, 0x6800, 0xa005,
+ 0x00c0, 0x32e3, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c, 0x604c,
+ 0xa06d, 0x0040, 0x32f2, 0x6800, 0xa005, 0x00c0, 0x32f0, 0x6052,
+ 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040,
+ 0x32fd, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082,
+ 0x0078, 0x32fc, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218,
+ 0x2260, 0x6200, 0xa005, 0x0040, 0x3310, 0xc285, 0x0078, 0x3311,
+ 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e,
+ 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00, 0xa215,
+ 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000,
+ 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206,
+ 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x333c,
+ 0xa085, 0x0001, 0x0078, 0x3350, 0xa190, 0x6d20, 0x2204, 0xa065,
+ 0x00c0, 0x334f, 0x017e, 0x0d7e, 0x1078, 0x12a7, 0x2d60, 0x0d7f,
+ 0x017f, 0x0040, 0x3338, 0x2c00, 0x2012, 0x1078, 0x316e, 0xa006,
+ 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x335b, 0xa085,
+ 0x0001, 0x0078, 0x3368, 0x0d7e, 0xa190, 0x6d20, 0x2204, 0xa06d,
+ 0x0040, 0x3366, 0x2013, 0x0000, 0x1078, 0x12db, 0x0d7f, 0xa006,
+ 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x3373, 0xa085,
+ 0x0001, 0x0078, 0x337a, 0xa188, 0x6d20, 0x2104, 0xa065, 0x0040,
+ 0x336f, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
0x600b, 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069,
- 0x748e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048,
- 0x3522, 0x603a, 0x6814, 0x6066, 0x2099, 0x7496, 0xac88, 0x000a,
- 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x749a, 0xac88, 0x0006,
- 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x74ae, 0x6808, 0x606a,
- 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211,
- 0x00c8, 0x3546, 0x2009, 0x0008, 0x0078, 0x3570, 0xa182, 0x0259,
- 0x00c8, 0x354e, 0x2009, 0x0007, 0x0078, 0x3570, 0xa182, 0x02c1,
- 0x00c8, 0x3556, 0x2009, 0x0006, 0x0078, 0x3570, 0xa182, 0x0349,
- 0x00c8, 0x355e, 0x2009, 0x0005, 0x0078, 0x3570, 0xa182, 0x0421,
- 0x00c8, 0x3566, 0x2009, 0x0004, 0x0078, 0x3570, 0xa182, 0x0581,
- 0x00c8, 0x356e, 0x2009, 0x0003, 0x0078, 0x3570, 0x2009, 0x0002,
- 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071,
- 0x748d, 0x2e04, 0x6896, 0x2071, 0x748e, 0x7004, 0x689a, 0x701c,
- 0x689e, 0x0e7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4,
- 0xa06d, 0x0040, 0x35a7, 0x6900, 0x81ff, 0x00c0, 0x35bb, 0x6a04,
- 0xa282, 0x0010, 0x00c8, 0x35c0, 0xad88, 0x0004, 0x20a9, 0x0010,
- 0x2104, 0xa086, 0xffff, 0x0040, 0x35a2, 0x8108, 0x00f0, 0x3598,
- 0x1078, 0x1288, 0x260a, 0x8210, 0x6a06, 0x0078, 0x35bb, 0x1078,
- 0x12c7, 0x0040, 0x35c0, 0x2d00, 0x60a6, 0x6803, 0x0000, 0xad88,
- 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x35b3,
- 0x6807, 0x0001, 0x6e12, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x35bd, 0x127e, 0x2091, 0x8000, 0x1078, 0x3703,
- 0x00c0, 0x35dd, 0x200b, 0xffff, 0x0d7e, 0x60a4, 0x2068, 0x6804,
- 0xa08a, 0x0002, 0x0048, 0x35d8, 0x8001, 0x6806, 0x0078, 0x35dc,
- 0x1078, 0x12fb, 0x60a7, 0x0000, 0x0d7f, 0x127f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x376f, 0x0078, 0x35e8, 0x1078, 0x343b,
- 0x1078, 0x367c, 0x00c0, 0x35e6, 0x1078, 0x3638, 0x127f, 0x007c,
- 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a8, 0xa06d, 0x0040, 0x3614,
- 0x6950, 0x81ff, 0x00c0, 0x3628, 0x6a54, 0xa282, 0x0010, 0x00c8,
- 0x3635, 0xad88, 0x0018, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff,
- 0x0040, 0x360f, 0x8108, 0x00f0, 0x3605, 0x1078, 0x1288, 0x260a,
- 0x8210, 0x6a56, 0x0078, 0x3628, 0x1078, 0x12c7, 0x0040, 0x3635,
- 0x2d00, 0x60aa, 0x6853, 0x0000, 0xad88, 0x0018, 0x20a9, 0x0010,
- 0x200b, 0xffff, 0x8108, 0x00f0, 0x3620, 0x6857, 0x0001, 0x6e62,
- 0x0078, 0x362c, 0x1078, 0x347f, 0x1078, 0x3642, 0x00c0, 0x362a,
- 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x3632,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4581, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x3644, 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000,
- 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, 0x3662, 0x8dff, 0x0040,
- 0x3677, 0x83ff, 0x0040, 0x365a, 0x6848, 0xa606, 0x0040, 0x3667,
- 0x0078, 0x3662, 0x683c, 0xa406, 0x00c0, 0x3662, 0x6840, 0xa506,
- 0x0040, 0x3667, 0x2d08, 0x6800, 0x2068, 0x0078, 0x364e, 0x6a00,
- 0x604c, 0xad06, 0x00c0, 0x366f, 0x624e, 0x0078, 0x3672, 0xa180,
- 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3677, 0x6152, 0x8dff, 0x127f,
- 0x007c, 0xa01e, 0x0078, 0x367e, 0x2019, 0x0001, 0xa00e, 0x6080,
- 0x2068, 0x8dff, 0x0040, 0x36aa, 0x83ff, 0x0040, 0x368d, 0x6848,
- 0xa606, 0x0040, 0x369a, 0x0078, 0x3695, 0x683c, 0xa406, 0x00c0,
- 0x3695, 0x6840, 0xa506, 0x0040, 0x369a, 0x2d08, 0x6800, 0x2068,
- 0x0078, 0x3681, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x36a2, 0x6282,
- 0x0078, 0x36a5, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x36aa,
- 0x6186, 0x8dff, 0x007c, 0x1078, 0x3703, 0x00c0, 0x36b1, 0x2011,
- 0x0001, 0x1078, 0x3753, 0x00c0, 0x36b7, 0xa295, 0x0002, 0x007c,
- 0x1078, 0x378b, 0x0040, 0x36c0, 0x1078, 0x63e8, 0x0078, 0x36c2,
- 0xa085, 0x0001, 0x007c, 0x1078, 0x378b, 0x0040, 0x36cb, 0x1078,
- 0x6377, 0x0078, 0x36cd, 0xa085, 0x0001, 0x007c, 0x1078, 0x378b,
- 0x0040, 0x36d6, 0x1078, 0x63bd, 0x0078, 0x36d8, 0xa085, 0x0001,
- 0x007c, 0x1078, 0x378b, 0x0040, 0x36e1, 0x1078, 0x6393, 0x0078,
- 0x36e3, 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x8000, 0x6080, 0xa06d, 0x0040, 0x36fb, 0x6800, 0x007e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x007f, 0x0078, 0x36ea, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f,
- 0x007f, 0x127f, 0x007c, 0x60a4, 0xa00d, 0x00c0, 0x370a, 0xa085,
- 0x0001, 0x007c, 0x0e7e, 0x2170, 0x7000, 0xa005, 0x00c0, 0x371d,
- 0x20a9, 0x0010, 0xae88, 0x0004, 0x2104, 0xa606, 0x0040, 0x371d,
- 0x8108, 0x00f0, 0x3714, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0d7e,
- 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x00c0, 0x372d, 0x1078,
- 0x12c7, 0x0040, 0x373f, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807,
- 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108,
- 0x00f0, 0x3735, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006,
- 0x0078, 0x373c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d,
- 0x0040, 0x3750, 0x60a7, 0x0000, 0x1078, 0x12fb, 0xa085, 0x0001,
- 0x127f, 0x0d7f, 0x007c, 0x60a8, 0xa00d, 0x00c0, 0x375a, 0xa085,
- 0x0001, 0x007c, 0x0e7e, 0x2170, 0x7050, 0xa005, 0x00c0, 0x376d,
- 0x20a9, 0x0010, 0xae88, 0x0018, 0x2104, 0xa606, 0x0040, 0x376d,
- 0x8108, 0x00f0, 0x3764, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3753, 0x00c0, 0x3789, 0x200b, 0xffff,
- 0x0d7e, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0048, 0x3784,
- 0x8001, 0x6856, 0x0078, 0x3788, 0x1078, 0x12fb, 0x60ab, 0x0000,
- 0x0d7f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x2079,
- 0x7051, 0x7804, 0xd0a4, 0x0040, 0x37b7, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa, 0x00c0, 0x37ab,
- 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, 0x37ab,
- 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x379b, 0x0c7f,
- 0x157f, 0x2009, 0x07d0, 0x2011, 0x37b9, 0x1078, 0x433a, 0x0f7f,
- 0x007c, 0x2011, 0x37b9, 0x1078, 0x42aa, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa, 0x00c0, 0x37e5,
- 0x6000, 0xd0ec, 0x0040, 0x37e5, 0x047e, 0x62a0, 0xa294, 0x00ff,
- 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6ecf, 0x6000, 0xc0e5,
- 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2,
- 0x2009, 0x0000, 0x1078, 0x6d09, 0x047f, 0x017f, 0x8108, 0x00f0,
- 0x37c3, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060, 0x6000,
- 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x70ff, 0x7003, 0x0001,
- 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020,
- 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70ff,
- 0x684c, 0xa005, 0x00c0, 0x381b, 0x7028, 0xc085, 0x702a, 0xa085,
- 0x0001, 0x0078, 0x383e, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868,
- 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844,
- 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c,
- 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, 0x7372,
- 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x3891, 0x6804, 0xa00d, 0x0040,
- 0x385f, 0x0d7e, 0x0e7e, 0x2071, 0x7000, 0x027e, 0xa016, 0x702c,
- 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, 0x3850,
- 0x702e, 0x7098, 0xa200, 0x709a, 0x027f, 0x0e7f, 0x0d7f, 0x2071,
- 0x70ff, 0x701c, 0xa005, 0x00c0, 0x38a2, 0x0068, 0x38a0, 0x2071,
- 0x7051, 0x7004, 0xd09c, 0x0040, 0x38a0, 0x6934, 0xa186, 0x0103,
- 0x00c0, 0x38b3, 0x6948, 0x6844, 0xa105, 0x00c0, 0x3893, 0x2009,
- 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x38a0, 0x7122,
- 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
- 0x2071, 0x7000, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000,
- 0x709a, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x38a0,
- 0x6868, 0xa005, 0x00c0, 0x38a0, 0x2009, 0x8020, 0x0078, 0x3879,
- 0x2071, 0x70ff, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012,
- 0x7018, 0xa06d, 0x711a, 0x0040, 0x38b0, 0x6902, 0x0078, 0x38b1,
- 0x711e, 0x0078, 0x3891, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040,
- 0x38c1, 0xa186, 0x001e, 0x0040, 0x38c1, 0xa18e, 0x001f, 0x00c0,
- 0x38a0, 0x684c, 0xd0cc, 0x0040, 0x38a0, 0x6850, 0xa084, 0x00ff,
- 0xa086, 0x0001, 0x00c0, 0x38a0, 0x2009, 0x8021, 0x0078, 0x3879,
- 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071,
- 0x70ff, 0x7004, 0x0079, 0x38e4, 0x38ec, 0x38fb, 0x398b, 0x398c,
- 0x399c, 0x39a2, 0x38ed, 0x3979, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x0068, 0x38fa, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080,
- 0x7007, 0x0001, 0x127f, 0x701c, 0xa06d, 0x0040, 0x3978, 0x0e7e,
- 0x2071, 0x7051, 0x7004, 0xd09c, 0x0040, 0x395a, 0x6934, 0xa186,
- 0x0103, 0x00c0, 0x3930, 0x6948, 0x6844, 0xa105, 0x00c0, 0x394d,
- 0x2009, 0x8020, 0x127e, 0x2091, 0x8000, 0x0068, 0x392c, 0x2071,
- 0x0000, 0x7018, 0xd084, 0x00c0, 0x392c, 0x7122, 0x683c, 0x7026,
- 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f,
- 0x1078, 0x39d5, 0x0078, 0x3978, 0x127f, 0x0e7f, 0x0078, 0x3978,
- 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, 0x393e, 0xa186, 0x001e,
- 0x0040, 0x393e, 0xa18e, 0x001f, 0x00c0, 0x395a, 0x684c, 0xd0cc,
- 0x0040, 0x395a, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
- 0x395a, 0x2009, 0x8021, 0x0078, 0x3912, 0x6844, 0xa086, 0x0100,
- 0x00c0, 0x395a, 0x6868, 0xa005, 0x00c0, 0x395a, 0x2009, 0x8020,
- 0x0078, 0x3912, 0x0e7f, 0x1078, 0x39e9, 0x0040, 0x3978, 0x700f,
- 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, 0x396f,
- 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x396f, 0x710e, 0x7007,
- 0x0003, 0x1078, 0x3a09, 0x7050, 0xa086, 0x0100, 0x0040, 0x398c,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x398a, 0x1078, 0x39e9, 0x0040,
- 0x398a, 0x7007, 0x0003, 0x1078, 0x3a09, 0x7050, 0xa086, 0x0100,
- 0x0040, 0x398c, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0,
- 0x3995, 0x7007, 0x0004, 0x0078, 0x399c, 0xa086, 0x0200, 0x00c0,
- 0x399b, 0x7007, 0x0005, 0x007c, 0x1078, 0x39a3, 0x7006, 0x1078,
- 0x39d5, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
- 0x39b0, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, 0x39ba,
- 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x39ba, 0x7070, 0xa081,
- 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0, 0x39ce,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x39d1, 0x2001, 0x000d, 0x2102,
- 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001, 0x0007,
- 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x39e8, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04,
- 0x701e, 0xa005, 0x00c0, 0x39e5, 0x701a, 0x127f, 0x1078, 0x12fb,
- 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x39f8,
- 0x2304, 0x230c, 0xa10e, 0x0040, 0x39f8, 0xa006, 0x0078, 0x3a08,
- 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x3a02, 0x2300, 0xa005,
- 0x0078, 0x3a08, 0x0048, 0x3a07, 0xa302, 0x0078, 0x3a08, 0x8002,
- 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x71d9, 0x2104, 0xc08d, 0x200a,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x2071, 0x70cd, 0x7003, 0x0000,
- 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000,
- 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000,
- 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x70cd, 0x6848, 0xa005, 0x00c0, 0x3a45, 0x7028, 0xc085,
- 0x702a, 0xa085, 0x0001, 0x0078, 0x3a6a, 0x6a50, 0x7236, 0x6b54,
- 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848,
- 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006,
- 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319,
- 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f,
- 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x70cd, 0x7004,
- 0x1079, 0x3aca, 0x700c, 0x0079, 0x3a75, 0x3a7a, 0x3a6f, 0x3a6f,
- 0x3a6f, 0x3a6f, 0x007c, 0x700c, 0x0079, 0x3a7e, 0x3a83, 0x3ac8,
- 0x3ac8, 0x3ac9, 0x3ac9, 0x7830, 0x7930, 0xa106, 0x0040, 0x3a8d,
- 0x7830, 0x7930, 0xa106, 0x00c0, 0x3ab3, 0x7030, 0xa10a, 0x0040,
- 0x3ab3, 0x00c8, 0x3a95, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8,
- 0x3ab4, 0x1078, 0x12c7, 0x0040, 0x3ab3, 0x2d00, 0x705a, 0x7063,
- 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091,
- 0x8000, 0x2009, 0x71d9, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x1078, 0x12c7, 0x0040, 0x3ab3,
- 0x2d00, 0x705a, 0x1078, 0x12c7, 0x00c0, 0x3ac0, 0x0078, 0x3a9f,
- 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x3aa3,
- 0x007c, 0x007c, 0x3adb, 0x3adc, 0x3b13, 0x3b14, 0x3ac8, 0x3b4a,
- 0x3b4f, 0x3b86, 0x3b87, 0x3ba2, 0x3ba3, 0x3ba4, 0x3ba5, 0x3ba6,
- 0x3ba7, 0x3c10, 0x3c3a, 0x007c, 0x700c, 0x0079, 0x3adf, 0x3ae4,
- 0x3ae7, 0x3af7, 0x3b12, 0x3b12, 0x1078, 0x3a7b, 0x007c, 0x127e,
- 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3f1c, 0x0040, 0x3af4,
- 0x2091, 0x8000, 0x1078, 0x3a7b, 0x0d7f, 0x0078, 0x3b00, 0x127e,
- 0x8001, 0x700e, 0x1078, 0x3f1c, 0x7058, 0x2068, 0x7084, 0x705a,
- 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a,
- 0x0020, 0x00c8, 0x3b0f, 0x1079, 0x3b2a, 0x127f, 0x007c, 0x127f,
- 0x1078, 0x3ba8, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0x70cd,
- 0x700c, 0x0079, 0x3b1b, 0x3b20, 0x3b20, 0x3b20, 0x3b22, 0x3b26,
- 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3b28, 0x700f, 0x0002,
- 0x0e7f, 0x007c, 0x3ba8, 0x3ba8, 0x3bc4, 0x3ba8, 0x3caf, 0x3ba8,
- 0x3ba8, 0x3ba8, 0x3ba8, 0x3ba8, 0x3bc4, 0x3cee, 0x3d38, 0x3d91,
- 0x3da5, 0x3ba8, 0x3ba8, 0x3be0, 0x3bc4, 0x3ba8, 0x3ba8, 0x3bf6,
- 0x3e30, 0x3e4e, 0x3ba8, 0x3be0, 0x3ba8, 0x3ba8, 0x3ba8, 0x3ba8,
- 0x3bf6, 0x3e4e, 0x7020, 0x2068, 0x1078, 0x12fb, 0x007c, 0x700c,
- 0x0079, 0x3b52, 0x3b57, 0x3b5a, 0x3b6a, 0x3b85, 0x3b85, 0x1078,
- 0x3a7b, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078,
- 0x3f1c, 0x0040, 0x3b67, 0x2091, 0x8000, 0x1078, 0x3a7b, 0x0d7f,
- 0x0078, 0x3b73, 0x127e, 0x8001, 0x700e, 0x1078, 0x3f1c, 0x7058,
- 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834,
- 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x3b82, 0x1079, 0x3b88,
- 0x127f, 0x007c, 0x127f, 0x1078, 0x3ba8, 0x007c, 0x007c, 0x007c,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3ba8, 0x3bc4, 0x3ba8, 0x3bc4, 0x3bc4,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3bc4, 0x3bc4, 0x3bc4, 0x3bc4, 0x3bc4,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3ba8, 0x3ba8, 0x3bc4, 0x3ba8, 0x3ba8,
- 0x3ba8, 0x3bc4, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3840, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3840, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3840,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3840, 0x127f, 0x007c,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3bb6, 0x8001, 0x00c0,
- 0x3bed, 0x7007, 0x0001, 0x0078, 0x3c76, 0x7007, 0x0006, 0x7012,
- 0x2d00, 0x7016, 0x701a, 0x704b, 0x3c76, 0x007c, 0x2d00, 0x7016,
- 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0x70f8,
- 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3bd2, 0x6884,
- 0xa08a, 0x0003, 0x00c8, 0x3bd2, 0xa080, 0x3c67, 0x2004, 0x70c6,
- 0x7010, 0xa015, 0x0040, 0x3c5a, 0x1078, 0x12c7, 0x00c0, 0x3c1b,
- 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000,
- 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, 0x3c2a,
- 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296, 0x0004,
- 0x0040, 0x3c33, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022,
- 0x1078, 0x1332, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3c4e, 0xa086,
- 0x0200, 0x0040, 0x3c46, 0x7007, 0x0010, 0x007c, 0x7020, 0x2068,
- 0x1078, 0x12fb, 0x7014, 0x2068, 0x0078, 0x3bd2, 0x7020, 0x2068,
- 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a,
- 0x0078, 0x3c10, 0x7014, 0x2068, 0x7007, 0x0001, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x0040, 0x3e6b, 0x0078, 0x3c76, 0x3c6a,
- 0x3c6e, 0x3c72, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f,
- 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006, 0x2009, 0x702a,
- 0x210c, 0x81ff, 0x00c0, 0x3c93, 0x6838, 0xa084, 0x00ff, 0x683a,
- 0x6853, 0x0000, 0x1078, 0x3347, 0x00c0, 0x3c87, 0x007c, 0x1078,
- 0x38d0, 0x127e, 0x2091, 0x8000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x127f, 0x0078, 0x3c86, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
- 0x3c87, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
- 0x8001, 0x7012, 0x0040, 0x3ca8, 0x7007, 0x0006, 0x0078, 0x3cae,
- 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, 0x7007,
- 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff,
- 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3cd8, 0x2009, 0x0000,
- 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3cd8, 0xa005, 0x00c0,
- 0x3ceb, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0,
- 0x3ceb, 0x067e, 0x6e50, 0x1078, 0x35c3, 0x067f, 0x0078, 0x3ceb,
- 0x047e, 0x2011, 0x700c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f,
- 0x0c7e, 0x1078, 0x34fa, 0x00c0, 0x3ce7, 0x1078, 0x3742, 0x8108,
- 0x00f0, 0x3ce1, 0x0c7f, 0x1078, 0x12fb, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x7007, 0x0001, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x0040,
- 0x3d2f, 0x2009, 0x0000, 0x1078, 0x3f38, 0x6100, 0xd184, 0x0040,
- 0x3d14, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3d32, 0x6000, 0xd084,
- 0x0040, 0x3d2f, 0x6004, 0xa005, 0x00c0, 0x3d35, 0x6003, 0x0000,
- 0x600b, 0x0000, 0x0078, 0x3d2c, 0x2011, 0x0001, 0x6860, 0xa005,
- 0x00c0, 0x3d1c, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084,
- 0x00ff, 0x0040, 0x3d2f, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3d2f, 0x600a, 0x6202, 0x127f, 0x0078, 0x3f0b, 0x127f,
- 0x0078, 0x3f03, 0x127f, 0x0078, 0x3efb, 0x127f, 0x0078, 0x3eff,
- 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7052, 0x2004,
- 0xd0a4, 0x0040, 0x3d8e, 0x2009, 0x0000, 0x1078, 0x3f38, 0x6000,
- 0xa084, 0x0001, 0x0040, 0x3d8e, 0x6204, 0x6308, 0x6c48, 0xa484,
- 0x0003, 0x0040, 0x3d66, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
- 0x3d5f, 0x2100, 0xa210, 0x0048, 0x3d8b, 0x0078, 0x3d66, 0x8001,
- 0x00c0, 0x3d8b, 0x2100, 0xa212, 0x0048, 0x3d8b, 0xa484, 0x000c,
- 0x0040, 0x3d80, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
- 0x00c0, 0x3d78, 0x2100, 0xa318, 0x0048, 0x3d8b, 0x0078, 0x3d80,
- 0xa082, 0x0004, 0x00c0, 0x3d8b, 0x2100, 0xa31a, 0x0048, 0x3d8b,
- 0x6860, 0xa005, 0x0040, 0x3d86, 0x8000, 0x6016, 0x6206, 0x630a,
- 0x127f, 0x0078, 0x3f0b, 0x127f, 0x0078, 0x3f07, 0x127f, 0x0078,
- 0x3f03, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2009, 0x0000,
- 0x1078, 0x3f38, 0x6308, 0x8318, 0x0048, 0x3da2, 0x630a, 0x127f,
- 0x0078, 0x3f19, 0x127f, 0x0078, 0x3f07, 0x127e, 0x0c7e, 0x2091,
- 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3dbb, 0x2009,
- 0x0000, 0x0c7e, 0x1078, 0x4348, 0x6000, 0x2001, 0xfcff, 0x6002,
- 0x0c7f, 0x0078, 0x3df2, 0x6858, 0xa005, 0x0040, 0x3e07, 0x685c,
- 0xa065, 0x0040, 0x3e03, 0x2001, 0x702a, 0x2004, 0xa005, 0x0040,
- 0x3dcd, 0x1078, 0x6457, 0x0078, 0x3dd3, 0x6013, 0x0400, 0x2009,
- 0x0041, 0x1078, 0x571c, 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000,
- 0x0040, 0x3dea, 0xa186, 0x0400, 0x0040, 0x3dea, 0x2009, 0x0000,
- 0x0c7e, 0x1078, 0x4348, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
- 0x0078, 0x3df2, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
- 0x43f1, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3dff, 0x2009, 0x0000,
- 0x1078, 0x4348, 0x6008, 0x8000, 0x0048, 0x3dff, 0x600a, 0x0c7f,
- 0x127f, 0x0078, 0x3f0b, 0x0c7f, 0x127f, 0x0078, 0x3f03, 0x6954,
- 0xa186, 0x002a, 0x00c0, 0x3e13, 0x2001, 0x700c, 0x200c, 0xc194,
- 0x2102, 0x0078, 0x3df2, 0xa186, 0x0020, 0x0040, 0x3e28, 0xa186,
- 0x0029, 0x00c0, 0x3e03, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34fa, 0x00c0, 0x3df2, 0x6000, 0xc0e4, 0x6002, 0x0078, 0x3df2,
- 0x685c, 0xa065, 0x0040, 0x3e03, 0x6017, 0x0014, 0x0078, 0x3df2,
- 0x2009, 0x0000, 0x1078, 0x3f38, 0x6000, 0xa084, 0x0001, 0x0040,
- 0x3e4a, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x3e44, 0x6206,
- 0x2091, 0x8001, 0x0078, 0x3f19, 0x2091, 0x8001, 0x6853, 0x0016,
- 0x0078, 0x3f12, 0x6853, 0x0007, 0x0078, 0x3f12, 0x6834, 0x8007,
- 0xa084, 0x00ff, 0x00c0, 0x3e58, 0x1078, 0x3bb6, 0x0078, 0x3e6a,
- 0x2030, 0x8001, 0x00c0, 0x3e62, 0x7007, 0x0001, 0x1078, 0x3e6b,
- 0x0078, 0x3e6a, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a,
- 0x704b, 0x3e6b, 0x007c, 0x0e7e, 0x2009, 0x702a, 0x210c, 0x81ff,
- 0x00c0, 0x3eed, 0x2009, 0x700c, 0x210c, 0xd194, 0x00c0, 0x3ef7,
- 0x6848, 0x2070, 0xae82, 0x7600, 0x0048, 0x3edc, 0x2001, 0x7015,
- 0x2004, 0xae02, 0x00c8, 0x3edc, 0x2009, 0x0000, 0x1078, 0x3f38,
- 0x6100, 0xa184, 0x0001, 0x0040, 0x3ec2, 0xa184, 0x0100, 0x00c0,
- 0x3ee0, 0xa184, 0x0200, 0x00c0, 0x3ee4, 0x601c, 0xa005, 0x00c0,
- 0x3ee8, 0x711c, 0xa186, 0x0006, 0x00c0, 0x3ec7, 0x6853, 0x0000,
- 0x6803, 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010, 0xa005,
- 0x00c0, 0x3eb9, 0x7112, 0x7018, 0xa065, 0x0040, 0x3eec, 0x6000,
- 0xd0e4, 0x00c0, 0x3ef1, 0x2e60, 0x1078, 0x4351, 0x127f, 0x0e7f,
- 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x3eb9, 0x6902, 0x127f,
- 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3f12, 0x6944,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x34fa, 0x00c0, 0x3ef2, 0x6000,
- 0xd0e4, 0x00c0, 0x3ef2, 0x711c, 0xa186, 0x0007, 0x00c0, 0x3edc,
- 0x6853, 0x0002, 0x0078, 0x3ef4, 0x6853, 0x0008, 0x0078, 0x3ef4,
- 0x6853, 0x000e, 0x0078, 0x3ef4, 0x6853, 0x0017, 0x0078, 0x3ef4,
- 0x6853, 0x0035, 0x0078, 0x3ef4, 0x127f, 0x6853, 0x0028, 0x0078,
- 0x3ef4, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3f12, 0x6853,
- 0x002a, 0x0078, 0x3ef4, 0x2009, 0x003e, 0x0078, 0x3f0d, 0x2009,
- 0x0004, 0x0078, 0x3f0d, 0x2009, 0x0006, 0x0078, 0x3f0d, 0x2009,
- 0x0016, 0x0078, 0x3f0d, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00,
- 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x3840, 0x2091, 0x8001,
- 0x007c, 0x1078, 0x12fb, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102,
- 0x0048, 0x3f29, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078,
- 0x3f35, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3f35, 0x7074,
- 0xa081, 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c,
- 0x0d7e, 0x1078, 0x4348, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004,
- 0x2204, 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002,
- 0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3f54,
- 0xa086, 0x1000, 0x00c0, 0x3f70, 0x20e1, 0x0004, 0x3d60, 0xd1bc,
- 0x00c0, 0x3f5b, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3f70, 0xac82,
- 0x7600, 0x0048, 0x3f70, 0x6854, 0xac02, 0x00c8, 0x3f70, 0x2009,
- 0x0047, 0x1078, 0x571c, 0x7a1c, 0xd284, 0x00c0, 0x3f46, 0x007c,
- 0xa016, 0x1078, 0x1525, 0x0078, 0x3f6b, 0x157e, 0x137e, 0x147e,
- 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0070, 0x00c0, 0x3f9e,
- 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x3f9e, 0x1078, 0x3fab,
- 0x0040, 0x3f9e, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078, 0x3fc9,
- 0x147f, 0x137f, 0x157f, 0x2009, 0x71be, 0x2104, 0xa005, 0x00c0,
- 0x3f9a, 0x007c, 0x1078, 0x49b7, 0x0078, 0x3f99, 0x1078, 0x6f02,
- 0x1078, 0x3fab, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f, 0x137f,
- 0x157f, 0x0078, 0x3f99, 0xa484, 0x01ff, 0x6872, 0xa005, 0x0040,
- 0x3fbd, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000,
- 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c, 0x20e1,
- 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001, 0x0078,
- 0x3fbc, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196,
- 0x0000, 0x00c0, 0x3fd6, 0x0078, 0x40c2, 0x007c, 0xa196, 0x2000,
- 0x00c0, 0x3fe7, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x3fe3, 0x1078,
- 0x2b7c, 0x0078, 0x3fd5, 0x1078, 0x3fef, 0x0078, 0x3fd5, 0xa196,
- 0x8000, 0x00c0, 0x3fd5, 0x1078, 0x4148, 0x0078, 0x3fd5, 0x0c7e,
- 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040, 0x3ffc,
- 0xa196, 0x0023, 0x00c0, 0x40ba, 0xa08e, 0x0023, 0x00c0, 0x402d,
- 0x1078, 0x41ba, 0x0040, 0x40ba, 0x7124, 0x610a, 0x7030, 0xa08e,
- 0x0200, 0x00c0, 0x4015, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009,
- 0x0015, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e, 0x0210, 0x00c0,
- 0x401f, 0x2009, 0x0015, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e,
- 0x0100, 0x00c0, 0x40ba, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009,
- 0x0016, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e, 0x0022, 0x00c0,
- 0x40ba, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x403e, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x0017, 0x0078, 0x40a2, 0xa08e, 0x0500,
- 0x00c0, 0x404a, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009, 0x0018,
- 0x0078, 0x40a2, 0xa08e, 0x2010, 0x00c0, 0x4052, 0x2009, 0x0019,
- 0x0078, 0x40a2, 0xa08e, 0x2110, 0x00c0, 0x405a, 0x2009, 0x001a,
- 0x0078, 0x40a2, 0xa08e, 0x5200, 0x00c0, 0x4066, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x001b, 0x0078, 0x40a2, 0xa08e, 0x5000,
- 0x00c0, 0x4072, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009, 0x001c,
- 0x0078, 0x40a2, 0xa08e, 0x1200, 0x00c0, 0x407e, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x0024, 0x0078, 0x40a2, 0xa08c, 0xff00,
- 0xa18e, 0x2400, 0x00c0, 0x4088, 0x2009, 0x002d, 0x0078, 0x40a2,
- 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x4092, 0x2009, 0x002a,
- 0x0078, 0x40a2, 0xa08e, 0x0f00, 0x00c0, 0x409a, 0x2009, 0x0020,
- 0x0078, 0x40a2, 0xa08e, 0x5300, 0x00c0, 0x40a0, 0x0078, 0x40a0,
- 0x2009, 0x001d, 0x017e, 0x2011, 0x7483, 0x2204, 0x1078, 0x1fe4,
- 0x1078, 0x34bf, 0x00c0, 0x40bc, 0x0c7e, 0x1078, 0x568f, 0x0040,
- 0x40bf, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f,
- 0x1078, 0x571c, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x40ba, 0x0c7f,
- 0x0078, 0x40bc, 0xa084, 0x0007, 0x0079, 0x40c7, 0x007c, 0x40cf,
- 0x40cf, 0x40cf, 0x40cf, 0x40cf, 0x40d0, 0x40e9, 0x4131, 0x007c,
- 0x7110, 0xd1bc, 0x0040, 0x40e8, 0x7120, 0x2160, 0xac8c, 0x0007,
- 0x00c0, 0x40e8, 0xac8a, 0x7600, 0x0048, 0x40e8, 0x6854, 0xac02,
- 0x00c8, 0x40e8, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x571c,
- 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x412f, 0x2011, 0x7483,
- 0x2204, 0xa080, 0x2207, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34fa, 0x00c0, 0x412f, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x00c0, 0x4114, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x412f, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009, 0x0044,
- 0x1078, 0x571c, 0x0078, 0x412f, 0x0c7e, 0x1078, 0x568f, 0x017f,
- 0x0040, 0x412f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286,
- 0x0004, 0x00c0, 0x4127, 0x6007, 0x0005, 0x0078, 0x4129, 0x6007,
- 0x0001, 0x6003, 0x0001, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0c7f,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4147, 0x7020, 0x2060, 0xac84,
- 0x0007, 0x00c0, 0x4147, 0xac82, 0x7600, 0x0048, 0x4147, 0x6854,
- 0xac02, 0x00c8, 0x4147, 0x2009, 0x0045, 0x1078, 0x571c, 0x007c,
- 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x4158,
- 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x1288, 0x1079, 0x4159,
- 0x007c, 0x415f, 0x4160, 0x415f, 0x415f, 0x419c, 0x41ab, 0x007c,
- 0x7110, 0xd1bc, 0x00c0, 0x419b, 0x700c, 0x1078, 0x1fe4, 0x1078,
- 0x34bf, 0x00c0, 0x419b, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x00c0, 0x4184, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x419b, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088,
- 0x1078, 0x571c, 0x0078, 0x419b, 0x0c7e, 0x1078, 0x568f, 0x017f,
- 0x0040, 0x419b, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286,
- 0x0004, 0x00c0, 0x4197, 0x2009, 0x0005, 0x0078, 0x4199, 0x2009,
- 0x0001, 0x1078, 0x571c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x41aa,
- 0x1078, 0x41ba, 0x0040, 0x41aa, 0x7124, 0x610a, 0x2009, 0x0089,
- 0x1078, 0x571c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x41b9, 0x1078,
- 0x41ba, 0x0040, 0x41b9, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078,
- 0x571c, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x41cd,
- 0xac82, 0x7600, 0x0048, 0x41cd, 0x2001, 0x7015, 0x2004, 0xac02,
- 0x00c8, 0x41cd, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x41cc,
- 0x2071, 0x71c9, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a,
- 0x7012, 0x7017, 0x7600, 0x7007, 0x0000, 0x7026, 0x702b, 0x50bd,
- 0x7032, 0x7037, 0x50fe, 0x703b, 0x0002, 0x703f, 0x0000, 0x007c,
- 0x2071, 0x71c9, 0x00e0, 0x4297, 0x2091, 0x6000, 0x700c, 0x8001,
- 0x700e, 0x00c0, 0x4260, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e,
- 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x425e, 0x703b,
- 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8, 0x425e,
- 0x703c, 0xa086, 0x0001, 0x00c0, 0x423b, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x4219, 0x6803, 0x1000, 0x0078,
- 0x4220, 0x6804, 0xa084, 0x1000, 0x0040, 0x4220, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x71b6, 0x6804, 0xa082,
- 0x0006, 0x00c0, 0x422d, 0x6807, 0x0000, 0x6830, 0xa082, 0x0003,
- 0x00c0, 0x4234, 0x6833, 0x0000, 0x1078, 0x49b7, 0x1078, 0x4a67,
- 0x0d7f, 0x0078, 0x425e, 0x0d7e, 0x2069, 0x7000, 0x6944, 0x6860,
- 0xa102, 0x00c8, 0x425d, 0x2069, 0x71b6, 0x6804, 0xa086, 0x0000,
- 0x00c0, 0x425d, 0x6830, 0xa086, 0x0000, 0x00c0, 0x425d, 0x703f,
- 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100, 0x6830,
- 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078, 0x4263,
- 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x4274, 0x7020,
- 0x8001, 0x7022, 0x00c0, 0x4274, 0x7023, 0x0009, 0x8109, 0x7126,
- 0x00c0, 0x4274, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x4285,
- 0x702c, 0x8001, 0x702e, 0x00c0, 0x4285, 0x702f, 0x0009, 0x8109,
- 0x7132, 0x00c0, 0x4285, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040,
- 0x4296, 0x7008, 0x8001, 0x700a, 0x00c0, 0x4296, 0x700b, 0x0009,
- 0x8109, 0x711a, 0x00c0, 0x4296, 0x701c, 0x107a, 0x127f, 0x7004,
- 0x0079, 0x429a, 0x42c1, 0x42c2, 0x42de, 0x0e7e, 0x2071, 0x71c9,
- 0x7018, 0xa005, 0x00c0, 0x42a8, 0x711a, 0x721e, 0x700b, 0x0009,
- 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x71c9, 0x701c, 0xa206,
- 0x00c0, 0x42b4, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x71c9, 0x6088, 0xa102, 0x0048, 0x42bf, 0x618a, 0x0e7f,
- 0x007c, 0x007c, 0x7110, 0x1078, 0x34fa, 0x00c0, 0x42d4, 0x6088,
- 0x8001, 0x0048, 0x42d4, 0x608a, 0x00c0, 0x42d4, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x49b7, 0x127f, 0x8108, 0xa182, 0x007e, 0x0048,
- 0x42dc, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060,
- 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x430d, 0x8001,
- 0x6016, 0x00c0, 0x430d, 0x611c, 0xa186, 0x0003, 0x0040, 0x42f4,
- 0xa186, 0x0006, 0x00c0, 0x430b, 0x6010, 0x2068, 0x6854, 0xa08a,
- 0x199a, 0x0048, 0x430b, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a,
- 0x0048, 0x4304, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108,
- 0x6116, 0x0078, 0x430d, 0x1078, 0x61ca, 0x127f, 0xac88, 0x0008,
- 0x7116, 0x2001, 0x7016, 0x2004, 0xa102, 0x0048, 0x431b, 0x7017,
- 0x7600, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x7027,
- 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001,
- 0x71d2, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x7033,
- 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x71d5, 0x2013,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x711a, 0x721e, 0x700b,
- 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x725a, 0x0c7f, 0x007c,
- 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x725a, 0x2060,
- 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4358, 0x2001, 0x1999,
- 0xa005, 0x00c0, 0x4368, 0x6944, 0x0c7e, 0x1078, 0x4348, 0x6014,
- 0x0c7f, 0xa005, 0x00c0, 0x436d, 0x2001, 0x001e, 0x0078, 0x436d,
- 0xa08e, 0xffff, 0x00c0, 0x436d, 0xa006, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040,
- 0x43a8, 0xd0b4, 0x00c0, 0x4384, 0xd0bc, 0x00c0, 0x4396, 0x2009,
- 0x0006, 0x1078, 0x43cb, 0x007c, 0xd0fc, 0x0040, 0x4391, 0xa084,
- 0x0003, 0xa08e, 0x0003, 0x0040, 0x43c4, 0xa08e, 0x0000, 0x00c0,
- 0x43c4, 0x2009, 0x0043, 0x1078, 0x571c, 0x007c, 0xd0fc, 0x0040,
- 0x43a3, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x43c4, 0xa08e,
- 0x0000, 0x00c0, 0x43c4, 0x2009, 0x0042, 0x1078, 0x571c, 0x007c,
- 0xd0fc, 0x0040, 0x43ba, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
- 0x43c4, 0xa08e, 0x0002, 0x0040, 0x43be, 0x2009, 0x0041, 0x1078,
- 0x571c, 0x007c, 0x1078, 0x43c9, 0x0078, 0x43b9, 0x2009, 0x0043,
- 0x1078, 0x571c, 0x0078, 0x43b9, 0x2009, 0x0004, 0x1078, 0x43cb,
- 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040, 0x43f0,
- 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0, 0x43ea,
- 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x43ea, 0x0c7e,
- 0x2009, 0x0000, 0x1078, 0x4348, 0x6204, 0x8210, 0x0048, 0x43e9,
- 0x6206, 0x0c7f, 0x1078, 0x3840, 0x6010, 0xa06d, 0x10c0, 0x4351,
- 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x725a, 0x6000,
- 0x81ff, 0x0040, 0x43fe, 0xa205, 0x0078, 0x43ff, 0xa204, 0x6002,
- 0xace0, 0x0008, 0x00f0, 0x43f7, 0x0c7f, 0x157f, 0x007c, 0x6808,
- 0xa005, 0x0040, 0x440f, 0x8001, 0x680a, 0xa085, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x2079, 0x71b6, 0x127f, 0x0d7e, 0x2069,
- 0x71b6, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001,
- 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084,
- 0x0007, 0x0079, 0x442b, 0x4435, 0x445a, 0x44b5, 0x443b, 0x445a,
- 0x4433, 0x4433, 0x4433, 0x1078, 0x1288, 0x1078, 0x4327, 0x1078,
- 0x49b7, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x4441, 0x0c7f,
- 0x007c, 0x2011, 0x320e, 0x1078, 0x42aa, 0x7828, 0xa092, 0x0002,
- 0x00c8, 0x4450, 0x8000, 0x782a, 0x1078, 0x323e, 0x0078, 0x443f,
- 0x1078, 0x320e, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
- 0x0078, 0x443f, 0x1078, 0x4327, 0x3c00, 0x007e, 0x2011, 0x0209,
- 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040, 0x4478,
- 0x62c0, 0x82ff, 0x00c0, 0x4478, 0x782b, 0x0000, 0x7824, 0xa065,
- 0x1040, 0x1288, 0x2009, 0x0013, 0x1078, 0x571c, 0x0c7f, 0x007c,
- 0x3900, 0xa082, 0x72fa, 0x00c8, 0x447f, 0x1078, 0x561f, 0x0c7e,
- 0x7824, 0xa065, 0x1040, 0x1288, 0x7804, 0xa086, 0x0004, 0x0040,
- 0x44fa, 0x7828, 0xa092, 0x2710, 0x00c8, 0x4495, 0x8000, 0x782a,
- 0x0c7f, 0x1078, 0x50a2, 0x0078, 0x4476, 0x6104, 0xa186, 0x0003,
- 0x00c0, 0x44ac, 0x0e7e, 0x2071, 0x7000, 0x70b4, 0x0e7f, 0xd08c,
- 0x0040, 0x44ac, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7000,
- 0x1078, 0x3247, 0x0e7f, 0x0c7f, 0x1078, 0x6f55, 0x2009, 0x0014,
- 0x1078, 0x571c, 0x0c7f, 0x0078, 0x4476, 0x2001, 0x71d2, 0x2003,
- 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x44c9, 0x782b, 0x0000, 0x7824,
- 0xa065, 0x1040, 0x1288, 0x2009, 0x0013, 0x1078, 0x5769, 0x0c7f,
- 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082, 0x72fa, 0x00c8, 0x44d2,
- 0x1078, 0x561f, 0x7824, 0xa005, 0x1040, 0x1288, 0x781c, 0xa06d,
- 0x1040, 0x1288, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078,
- 0x56f5, 0x693c, 0x81ff, 0x1040, 0x1288, 0x8109, 0x693e, 0x6854,
- 0xa015, 0x0040, 0x44ee, 0x7a1e, 0x0078, 0x44f0, 0x7918, 0x791e,
- 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x49b7,
- 0x0078, 0x44c7, 0x6104, 0xa186, 0x0002, 0x0040, 0x4505, 0xa186,
- 0x0004, 0x0040, 0x4505, 0x0078, 0x4489, 0x7808, 0xac06, 0x0040,
- 0x4489, 0x1078, 0x48be, 0x1078, 0x45af, 0x0c7f, 0x1078, 0x49b7,
- 0x0078, 0x4476, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x71d5, 0x2013,
- 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x452c, 0x62c4, 0x82ff, 0x00c0,
- 0x452c, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x452a, 0x2009, 0x0049,
- 0x1078, 0x571c, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x72fa, 0x00c8,
- 0x4533, 0x1078, 0x561f, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040,
- 0x452a, 0x7944, 0xa192, 0x7530, 0x00c8, 0x4552, 0x8108, 0x7946,
- 0x1078, 0x432c, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006,
- 0x00c0, 0x454e, 0x6017, 0x0012, 0x0078, 0x452a, 0x6017, 0x0016,
- 0x0078, 0x452a, 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x037f,
- 0x1078, 0x6f55, 0x793c, 0x2160, 0x2009, 0x004a, 0x1078, 0x571c,
- 0x0078, 0x452a, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x600f, 0x0000, 0x2c08, 0x2061, 0x71b6, 0x6020, 0x8000, 0x6022,
- 0x6010, 0xa005, 0x0040, 0x457d, 0xa080, 0x0003, 0x2102, 0x6112,
- 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078,
- 0x4578, 0x0d7e, 0x2069, 0x71b6, 0x6000, 0xd0d4, 0x0040, 0x4596,
- 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0, 0x4591, 0x2c00,
- 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x49bf, 0xc0d5, 0x6002,
- 0x6818, 0xa005, 0x0040, 0x45a8, 0x6056, 0x605b, 0x0000, 0x007e,
- 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x71b6, 0x0078, 0x4588,
- 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x4588, 0x007e,
- 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
- 0x2061, 0x71b6, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040,
- 0x45ca, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f,
- 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x45c5, 0x0c7e, 0x600f,
- 0x0000, 0x2c08, 0x2061, 0x71b6, 0x6034, 0xa005, 0x0040, 0x45de,
- 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136,
- 0x0078, 0x45dc, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e,
- 0x007e, 0x127e, 0x2071, 0x71b6, 0x7638, 0x2660, 0x2678, 0x2091,
- 0x8000, 0x8cff, 0x0040, 0x4644, 0x6018, 0xa080, 0x0028, 0x2004,
- 0xa206, 0x00c0, 0x463f, 0x703c, 0xac06, 0x00c0, 0x4604, 0x6003,
- 0x000a, 0x630a, 0x0078, 0x463f, 0x7038, 0xac36, 0x00c0, 0x460a,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x4618, 0x2c00, 0xaf36,
- 0x0040, 0x4616, 0x2f00, 0x7036, 0x0078, 0x4618, 0x7037, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x4621, 0x7e0e, 0x0078,
- 0x4622, 0x2678, 0x600f, 0x0000, 0x1078, 0x6336, 0x0040, 0x463a,
- 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x464d, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x1078, 0x644a, 0x1078, 0x6457, 0x0c7f, 0x0078, 0x45f1, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x45f1, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x708e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048,
+ 0x3392, 0x603a, 0x6814, 0x6066, 0x2099, 0x7096, 0xac88, 0x000a,
+ 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x709a, 0xac88, 0x0006,
+ 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x70ae, 0x6904, 0xa18c,
+ 0x00ff, 0x810f, 0x6808, 0xa084, 0x00ff, 0xa105, 0x606a, 0x690c,
+ 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8,
+ 0x33bd, 0x2009, 0x0008, 0x0078, 0x33e7, 0xa182, 0x0259, 0x00c8,
+ 0x33c5, 0x2009, 0x0007, 0x0078, 0x33e7, 0xa182, 0x02c1, 0x00c8,
+ 0x33cd, 0x2009, 0x0006, 0x0078, 0x33e7, 0xa182, 0x0349, 0x00c8,
+ 0x33d5, 0x2009, 0x0005, 0x0078, 0x33e7, 0xa182, 0x0421, 0x00c8,
+ 0x33dd, 0x2009, 0x0004, 0x0078, 0x33e7, 0xa182, 0x0581, 0x00c8,
+ 0x33e5, 0x2009, 0x0003, 0x0078, 0x33e7, 0x2009, 0x0002, 0x6192,
+ 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x708d,
+ 0x2e04, 0x6896, 0x2071, 0x708e, 0x7004, 0x689a, 0x701c, 0x689e,
+ 0x0e7f, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x127e, 0x2091,
+ 0x8000, 0x6178, 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x6b9e,
+ 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c,
+ 0x617a, 0x127f, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x8002,
+ 0x127e, 0x2091, 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078,
+ 0x3423, 0x1078, 0x32af, 0x1078, 0x3484, 0x00c0, 0x3421, 0x1078,
+ 0x343e, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x127e, 0x2091,
+ 0x8000, 0x617c, 0xa10d, 0x617e, 0x127f, 0x0078, 0x3439, 0x1078,
+ 0x32f3, 0x1078, 0x3448, 0x00c0, 0x3437, 0x007c, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x42e3, 0x127f, 0x007c, 0xa01e, 0x0078, 0x344a,
+ 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068,
+ 0x6000, 0xd0dc, 0x00c0, 0x346a, 0x8dff, 0x0040, 0x347f, 0x83ff,
+ 0x0040, 0x3462, 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x346f,
+ 0x0078, 0x346a, 0x683c, 0xa406, 0x00c0, 0x346a, 0x6840, 0xa506,
+ 0x0040, 0x346f, 0x2d08, 0x6800, 0x2068, 0x0078, 0x3454, 0x6a00,
+ 0x604c, 0xad06, 0x00c0, 0x3477, 0x624e, 0x0078, 0x347a, 0xa180,
+ 0x0000, 0x2202, 0x82ff, 0x00c0, 0x347f, 0x6152, 0x8dff, 0x127f,
+ 0x007c, 0xa01e, 0x0078, 0x3486, 0x2019, 0x0001, 0xa00e, 0x6080,
+ 0x2068, 0x8dff, 0x0040, 0x34b4, 0x83ff, 0x0040, 0x3497, 0x6844,
+ 0xa084, 0x00ff, 0xa606, 0x0040, 0x34a4, 0x0078, 0x349f, 0x683c,
+ 0xa406, 0x00c0, 0x349f, 0x6840, 0xa506, 0x0040, 0x34a4, 0x2d08,
+ 0x6800, 0x2068, 0x0078, 0x3489, 0x6a00, 0x6080, 0xad06, 0x00c0,
+ 0x34ac, 0x6282, 0x0078, 0x34af, 0xa180, 0x0000, 0x2202, 0x82ff,
+ 0x00c0, 0x34b4, 0x6186, 0x8dff, 0x007c, 0x2001, 0x6b9e, 0xa600,
+ 0x2004, 0x6178, 0xa10c, 0x0040, 0x34bf, 0x2011, 0x0001, 0x617c,
+ 0xa10c, 0x0040, 0x34c5, 0xa295, 0x0002, 0x007c, 0x1078, 0x350f,
+ 0x0040, 0x34ce, 0x1078, 0x6079, 0x0078, 0x34d0, 0xa085, 0x0001,
+ 0x007c, 0x1078, 0x350f, 0x0040, 0x34d9, 0x1078, 0x6008, 0x0078,
+ 0x34db, 0xa085, 0x0001, 0x007c, 0x1078, 0x350f, 0x0040, 0x34e4,
+ 0x1078, 0x604e, 0x0078, 0x34e6, 0xa085, 0x0001, 0x007c, 0x1078,
+ 0x350f, 0x0040, 0x34ef, 0x1078, 0x6024, 0x0078, 0x34f1, 0xa085,
+ 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080,
+ 0xa06d, 0x0040, 0x3507, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x35c4, 0x007f, 0x0078, 0x34f8, 0x6083,
+ 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c,
+ 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x6c51, 0x7804, 0xd0a4, 0x0040,
+ 0x353b, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x336a, 0x00c0, 0x352f, 0x6004, 0xa084, 0xff00, 0x8007,
+ 0xa086, 0x0006, 0x00c0, 0x352f, 0x6000, 0xc0ed, 0x6002, 0x017f,
+ 0x8108, 0x00f0, 0x351f, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
+ 0x353d, 0x1078, 0x40b6, 0x0f7f, 0x007c, 0x2011, 0x353d, 0x1078,
+ 0x4026, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x336a, 0x00c0, 0x3569, 0x6000, 0xd0ec, 0x0040, 0x3569,
+ 0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
+ 0x1078, 0x6b0a, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2009, 0x0000, 0x1078, 0x6946,
+ 0x047f, 0x017f, 0x8108, 0x00f0, 0x3547, 0x0c7f, 0x157f, 0x007c,
+ 0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
+ 0x2071, 0x6cff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
+ 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
+ 0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
+ 0x007c, 0x0e7e, 0x2071, 0x6cff, 0x684c, 0xa005, 0x00c0, 0x359f,
+ 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x35c2, 0x6a60,
+ 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
+ 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
+ 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
+ 0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
+ 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
+ 0x3615, 0x6804, 0xa00d, 0x0040, 0x35e3, 0x0d7e, 0x0e7e, 0x2071,
+ 0x6c00, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
+ 0x2d00, 0x81ff, 0x00c0, 0x35d4, 0x702e, 0x7098, 0xa200, 0x709a,
+ 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x6cff, 0x701c, 0xa005, 0x00c0,
+ 0x3626, 0x0068, 0x3624, 0x2071, 0x6c51, 0x7004, 0xd09c, 0x0040,
+ 0x3624, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3637, 0x6948, 0x6844,
+ 0xa105, 0x00c0, 0x3617, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
+ 0xd084, 0x00c0, 0x3624, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
+ 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x6c00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x0e7f, 0x007c, 0x6844,
+ 0xa086, 0x0100, 0x00c0, 0x3624, 0x6868, 0xa005, 0x00c0, 0x3624,
+ 0x2009, 0x8020, 0x0078, 0x35fd, 0x2071, 0x6cff, 0x2d08, 0x206b,
+ 0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
+ 0x3634, 0x6902, 0x0078, 0x3635, 0x711e, 0x0078, 0x3615, 0xa18c,
+ 0x00ff, 0xa186, 0x0017, 0x0040, 0x3645, 0xa186, 0x001e, 0x0040,
+ 0x3645, 0xa18e, 0x001f, 0x00c0, 0x3624, 0x684c, 0xd0cc, 0x0040,
+ 0x3624, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3624,
+ 0x2009, 0x8021, 0x0078, 0x35fd, 0x007e, 0x6837, 0x0103, 0x20a9,
+ 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
+ 0x684a, 0x6952, 0x007c, 0x2071, 0x6cff, 0x7004, 0x0079, 0x3668,
+ 0x3670, 0x367f, 0x370f, 0x3710, 0x3720, 0x3726, 0x3671, 0x36fd,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x367e, 0x2009, 0x000d,
+ 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
+ 0xa06d, 0x0040, 0x36fc, 0x0e7e, 0x2071, 0x6c51, 0x7004, 0xd09c,
+ 0x0040, 0x36de, 0x6934, 0xa186, 0x0103, 0x00c0, 0x36b4, 0x6948,
+ 0x6844, 0xa105, 0x00c0, 0x36d1, 0x2009, 0x8020, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x36b0, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
+ 0x36b0, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
+ 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3759, 0x0078, 0x36fc,
+ 0x127f, 0x0e7f, 0x0078, 0x36fc, 0xa18c, 0x00ff, 0xa186, 0x0017,
+ 0x0040, 0x36c2, 0xa186, 0x001e, 0x0040, 0x36c2, 0xa18e, 0x001f,
+ 0x00c0, 0x36de, 0x684c, 0xd0cc, 0x0040, 0x36de, 0x6850, 0xa084,
+ 0x00ff, 0xa086, 0x0001, 0x00c0, 0x36de, 0x2009, 0x8021, 0x0078,
+ 0x3696, 0x6844, 0xa086, 0x0100, 0x00c0, 0x36de, 0x6868, 0xa005,
+ 0x00c0, 0x36de, 0x2009, 0x8020, 0x0078, 0x3696, 0x0e7f, 0x1078,
+ 0x376d, 0x0040, 0x36fc, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
+ 0xa086, 0x0003, 0x00c0, 0x36f3, 0x810f, 0xa18c, 0x00ff, 0x8101,
+ 0x0040, 0x36f3, 0x710e, 0x7007, 0x0003, 0x1078, 0x378d, 0x7050,
+ 0xa086, 0x0100, 0x0040, 0x3710, 0x007c, 0x701c, 0xa06d, 0x0040,
+ 0x370e, 0x1078, 0x376d, 0x0040, 0x370e, 0x7007, 0x0003, 0x1078,
+ 0x378d, 0x7050, 0xa086, 0x0100, 0x0040, 0x3710, 0x007c, 0x007c,
+ 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3719, 0x7007, 0x0004, 0x0078,
+ 0x3720, 0xa086, 0x0200, 0x00c0, 0x371f, 0x7007, 0x0005, 0x007c,
+ 0x1078, 0x3727, 0x7006, 0x1078, 0x3759, 0x007c, 0x007c, 0x702c,
+ 0x7130, 0x8108, 0xa102, 0x0048, 0x3734, 0xa00e, 0x7034, 0x706e,
+ 0x7038, 0x7072, 0x0078, 0x373e, 0x706c, 0xa080, 0x0040, 0x706e,
+ 0x00c8, 0x373e, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x3752, 0x127e, 0x2091, 0x8000, 0x0068,
+ 0x3755, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
+ 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
+ 0x007c, 0x701c, 0xa06d, 0x0040, 0x376c, 0x127e, 0x2091, 0x8000,
+ 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3769,
+ 0x701a, 0x127f, 0x1078, 0x12db, 0x007c, 0x2019, 0x000d, 0x2304,
+ 0x230c, 0xa10e, 0x0040, 0x377c, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x377c, 0xa006, 0x0078, 0x378c, 0x732c, 0x8319, 0x7130, 0xa102,
+ 0x00c0, 0x3786, 0x2300, 0xa005, 0x0078, 0x378c, 0x0048, 0x378b,
+ 0xa302, 0x0078, 0x378c, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
+ 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
+ 0x6dd3, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x132c, 0x007c,
+ 0x2071, 0x6ccd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
+ 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
+ 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
+ 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6ccd, 0x6848, 0xa005,
+ 0x00c0, 0x37c9, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
+ 0x37ee, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
+ 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
+ 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
+ 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
+ 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
+ 0x2b78, 0x2071, 0x6ccd, 0x7004, 0x1079, 0x384e, 0x700c, 0x0079,
+ 0x37f9, 0x37fe, 0x37f3, 0x37f3, 0x37f3, 0x37f3, 0x007c, 0x700c,
+ 0x0079, 0x3802, 0x3807, 0x384c, 0x384c, 0x384d, 0x384d, 0x7830,
+ 0x7930, 0xa106, 0x0040, 0x3811, 0x7830, 0x7930, 0xa106, 0x00c0,
+ 0x3837, 0x7030, 0xa10a, 0x0040, 0x3837, 0x00c8, 0x3819, 0x712c,
+ 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3838, 0x1078, 0x12a7, 0x0040,
+ 0x3837, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
+ 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x6dd3, 0x2104,
+ 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x132c, 0x007c,
+ 0x1078, 0x12a7, 0x0040, 0x3837, 0x2d00, 0x705a, 0x1078, 0x12a7,
+ 0x00c0, 0x3844, 0x0078, 0x3823, 0x2d00, 0x7086, 0x7063, 0x0080,
+ 0x2001, 0x0004, 0x0078, 0x3827, 0x007c, 0x007c, 0x385f, 0x3860,
+ 0x3897, 0x3898, 0x384c, 0x38ce, 0x38d3, 0x390a, 0x390b, 0x3926,
+ 0x3927, 0x3928, 0x3929, 0x392a, 0x392b, 0x3994, 0x39be, 0x007c,
+ 0x700c, 0x0079, 0x3863, 0x3868, 0x386b, 0x387b, 0x3896, 0x3896,
+ 0x1078, 0x37ff, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3c9b, 0x0040, 0x3878, 0x2091, 0x8000, 0x1078, 0x37ff,
+ 0x0d7f, 0x0078, 0x3884, 0x127e, 0x8001, 0x700e, 0x1078, 0x3c9b,
+ 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3893, 0x1079,
+ 0x38ae, 0x127f, 0x007c, 0x127f, 0x1078, 0x392c, 0x007c, 0x007c,
+ 0x007c, 0x0e7e, 0x2071, 0x6ccd, 0x700c, 0x0079, 0x389f, 0x38a4,
+ 0x38a4, 0x38a4, 0x38a6, 0x38aa, 0x0e7f, 0x007c, 0x700f, 0x0001,
+ 0x0078, 0x38ac, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x392c, 0x392c,
+ 0x3948, 0x392c, 0x3a31, 0x392c, 0x392c, 0x392c, 0x392c, 0x392c,
+ 0x3948, 0x3a76, 0x3abf, 0x3b17, 0x3b2a, 0x392c, 0x392c, 0x3964,
+ 0x3948, 0x392c, 0x392c, 0x397a, 0x3bb1, 0x3bce, 0x392c, 0x3964,
+ 0x392c, 0x392c, 0x392c, 0x392c, 0x397a, 0x3bce, 0x7020, 0x2068,
+ 0x1078, 0x12db, 0x007c, 0x700c, 0x0079, 0x38d6, 0x38db, 0x38de,
+ 0x38ee, 0x3909, 0x3909, 0x1078, 0x37ff, 0x007c, 0x127e, 0x8001,
+ 0x700e, 0x7058, 0x007e, 0x1078, 0x3c9b, 0x0040, 0x38eb, 0x2091,
+ 0x8000, 0x1078, 0x37ff, 0x0d7f, 0x0078, 0x38f7, 0x127e, 0x8001,
+ 0x700e, 0x1078, 0x3c9b, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
+ 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
+ 0x00c8, 0x3906, 0x1079, 0x390c, 0x127f, 0x007c, 0x127f, 0x1078,
+ 0x392c, 0x007c, 0x007c, 0x007c, 0x392c, 0x3948, 0x3a1b, 0x392c,
+ 0x3948, 0x392c, 0x3948, 0x3948, 0x392c, 0x3948, 0x3a1b, 0x3948,
+ 0x3948, 0x3948, 0x3948, 0x3948, 0x392c, 0x3948, 0x3a1b, 0x392c,
+ 0x392c, 0x3948, 0x392c, 0x392c, 0x392c, 0x3948, 0x007c, 0x007c,
+ 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
+ 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4,
+ 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
+ 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4, 0x127f, 0x007c,
+ 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x35c4, 0x127f, 0x007c, 0x7007, 0x0001,
+ 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x35c4, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
+ 0x0040, 0x393a, 0x8001, 0x00c0, 0x3971, 0x7007, 0x0001, 0x0078,
+ 0x39fa, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
+ 0x39fa, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
+ 0x0024, 0x2098, 0x20a1, 0x6cf8, 0x53a3, 0x6858, 0x7012, 0xa082,
+ 0x0401, 0x00c8, 0x3956, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3956,
+ 0xa080, 0x39eb, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x39de,
+ 0x1078, 0x12a7, 0x00c0, 0x399f, 0x7007, 0x000f, 0x007c, 0x2d00,
+ 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
+ 0x6008, 0xa20a, 0x00c8, 0x39ae, 0xa00e, 0x2200, 0x7112, 0x620c,
+ 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x39b7, 0xa108, 0x719a,
+ 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x1312, 0x7090, 0xa08e,
+ 0x0100, 0x0040, 0x39d2, 0xa086, 0x0200, 0x0040, 0x39ca, 0x7007,
+ 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x12db, 0x7014, 0x2068,
+ 0x0078, 0x3956, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
+ 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3994, 0x7014, 0x2068,
+ 0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
+ 0x3beb, 0x0078, 0x39fa, 0x39ee, 0x39f2, 0x39f6, 0x0002, 0x0011,
+ 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
+ 0x0005, 0x0006, 0x2009, 0x6c2a, 0x210c, 0x81ff, 0x00c0, 0x3a15,
+ 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x31b5,
+ 0x00c0, 0x3a0b, 0x007c, 0x1078, 0x3654, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x35c4, 0x127f, 0x0078, 0x3a0a, 0x2001, 0x0028, 0x2009,
+ 0x0000, 0x0078, 0x3a0b, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906,
+ 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3a2a, 0x7007, 0x0006,
+ 0x0078, 0x3a30, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a,
+ 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848,
+ 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3a5c,
+ 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3a5c,
+ 0xa005, 0x00c0, 0x3a73, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078,
+ 0x336a, 0x00c0, 0x3a73, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078,
+ 0x3406, 0x067f, 0x0078, 0x3a73, 0x047e, 0x2011, 0x6c0c, 0x2224,
+ 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078, 0x336a, 0x00c0,
+ 0x3a6f, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108,
+ 0x00f0, 0x3a65, 0x0c7f, 0x1078, 0x12db, 0x007c, 0x127e, 0x2091,
+ 0x8000, 0x7007, 0x0001, 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x0040,
+ 0x3ab6, 0x6944, 0x1078, 0x3cb7, 0x6100, 0xd184, 0x0040, 0x3a9b,
+ 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3ab9, 0x6000, 0xd084, 0x0040,
+ 0x3ab6, 0x6004, 0xa005, 0x00c0, 0x3abc, 0x6003, 0x0000, 0x600b,
+ 0x0000, 0x0078, 0x3ab3, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0,
+ 0x3aa3, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff,
+ 0x0040, 0x3ab6, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040,
+ 0x3ab6, 0x600a, 0x6202, 0x127f, 0x0078, 0x3c8a, 0x127f, 0x0078,
+ 0x3c82, 0x127f, 0x0078, 0x3c7a, 0x127f, 0x0078, 0x3c7e, 0x127e,
+ 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6c52, 0x2004, 0xd0a4,
+ 0x0040, 0x3b14, 0x6944, 0x1078, 0x3cb7, 0x6000, 0xa084, 0x0001,
+ 0x0040, 0x3b14, 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040,
+ 0x3aec, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3ae5, 0x2100,
+ 0xa210, 0x0048, 0x3b11, 0x0078, 0x3aec, 0x8001, 0x00c0, 0x3b11,
+ 0x2100, 0xa212, 0x0048, 0x3b11, 0xa484, 0x000c, 0x0040, 0x3b06,
+ 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3afe,
+ 0x2100, 0xa318, 0x0048, 0x3b11, 0x0078, 0x3b06, 0xa082, 0x0004,
+ 0x00c0, 0x3b11, 0x2100, 0xa31a, 0x0048, 0x3b11, 0x6860, 0xa005,
+ 0x0040, 0x3b0c, 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078,
+ 0x3c8a, 0x127f, 0x0078, 0x3c86, 0x127f, 0x0078, 0x3c82, 0x127e,
+ 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078, 0x3cb7, 0x6308,
+ 0x8318, 0x0048, 0x3b27, 0x630a, 0x127f, 0x0078, 0x3c98, 0x127f,
+ 0x0078, 0x3c86, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001,
+ 0x684c, 0xd0ac, 0x0040, 0x3b3e, 0x027e, 0x2009, 0x0000, 0x2011,
+ 0xfcff, 0x1078, 0x416c, 0x027f, 0x0078, 0x3b74, 0x6858, 0xa005,
+ 0x0040, 0x3b88, 0x685c, 0xa065, 0x0040, 0x3b84, 0x2001, 0x6c2a,
+ 0x2004, 0xa005, 0x0040, 0x3b50, 0x1078, 0x60e8, 0x0078, 0x3b56,
+ 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x544c, 0x6958, 0xa18c,
+ 0xe600, 0xa186, 0x2000, 0x0040, 0x3b6c, 0xa186, 0x0400, 0x0040,
+ 0x3b6c, 0x6944, 0x0c7e, 0x1078, 0x40c4, 0x6000, 0xa084, 0xfdff,
+ 0x6002, 0x0c7f, 0x0078, 0x3b74, 0x027e, 0x2009, 0x0000, 0x2011,
+ 0xfdff, 0x1078, 0x416c, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3b80,
+ 0x6944, 0x1078, 0x40c4, 0x6008, 0x8000, 0x0048, 0x3b80, 0x600a,
+ 0x0c7f, 0x127f, 0x0078, 0x3c8a, 0x0c7f, 0x127f, 0x0078, 0x3c82,
+ 0x6954, 0xa186, 0x002a, 0x00c0, 0x3b94, 0x2001, 0x6c0c, 0x200c,
+ 0xc194, 0x2102, 0x0078, 0x3b74, 0xa186, 0x0020, 0x0040, 0x3ba9,
+ 0xa186, 0x0029, 0x00c0, 0x3b84, 0x6944, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x336a, 0x00c0, 0x3b74, 0x6000, 0xc0e4, 0x6002, 0x0078,
+ 0x3b74, 0x685c, 0xa065, 0x0040, 0x3b84, 0x6017, 0x0014, 0x0078,
+ 0x3b74, 0x6944, 0x1078, 0x3cb7, 0x6000, 0xa084, 0x0001, 0x0040,
+ 0x3bca, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x3bc4, 0x6206,
+ 0x2091, 0x8001, 0x0078, 0x3c98, 0x2091, 0x8001, 0x6853, 0x0016,
+ 0x0078, 0x3c91, 0x6853, 0x0007, 0x0078, 0x3c91, 0x6834, 0x8007,
+ 0xa084, 0x00ff, 0x00c0, 0x3bd8, 0x1078, 0x393a, 0x0078, 0x3bea,
+ 0x2030, 0x8001, 0x00c0, 0x3be2, 0x7007, 0x0001, 0x1078, 0x3beb,
+ 0x0078, 0x3bea, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a,
+ 0x704b, 0x3beb, 0x007c, 0x0e7e, 0x2009, 0x6c2a, 0x210c, 0x81ff,
+ 0x00c0, 0x3c6c, 0x2009, 0x6c0c, 0x210c, 0xd194, 0x00c0, 0x3c76,
+ 0x6848, 0x2070, 0xae82, 0x7200, 0x0048, 0x3c5b, 0x2001, 0x6c15,
+ 0x2004, 0xae02, 0x00c8, 0x3c5b, 0x6944, 0x1078, 0x3cb7, 0x6100,
+ 0xa184, 0x0001, 0x0040, 0x3c41, 0xa184, 0x0100, 0x00c0, 0x3c5f,
+ 0xa184, 0x0200, 0x00c0, 0x3c63, 0x601c, 0xa005, 0x00c0, 0x3c67,
+ 0x711c, 0xa186, 0x0006, 0x00c0, 0x3c46, 0x6853, 0x0000, 0x6803,
+ 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0,
+ 0x3c38, 0x7112, 0x7018, 0xa065, 0x0040, 0x3c6b, 0x6000, 0xd0e4,
+ 0x00c0, 0x3c70, 0x2e60, 0x1078, 0x40cd, 0x127f, 0x0e7f, 0x007c,
+ 0x2068, 0x6800, 0xa005, 0x00c0, 0x3c38, 0x6902, 0x127f, 0x0e7f,
+ 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3c91, 0x6944, 0xa18c,
+ 0xff00, 0x810f, 0x1078, 0x336a, 0x00c0, 0x3c71, 0x6000, 0xd0e4,
+ 0x00c0, 0x3c71, 0x711c, 0xa186, 0x0007, 0x00c0, 0x3c5b, 0x6853,
+ 0x0002, 0x0078, 0x3c73, 0x6853, 0x0008, 0x0078, 0x3c73, 0x6853,
+ 0x000e, 0x0078, 0x3c73, 0x6853, 0x0017, 0x0078, 0x3c73, 0x6853,
+ 0x0035, 0x0078, 0x3c73, 0x127f, 0x6853, 0x0028, 0x0078, 0x3c73,
+ 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3c91, 0x6853, 0x002a,
+ 0x0078, 0x3c73, 0x2009, 0x003e, 0x0078, 0x3c8c, 0x2009, 0x0004,
+ 0x0078, 0x3c8c, 0x2009, 0x0006, 0x0078, 0x3c8c, 0x2009, 0x0016,
+ 0x0078, 0x3c8c, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105,
+ 0x6856, 0x2091, 0x8000, 0x1078, 0x35c4, 0x2091, 0x8001, 0x007c,
+ 0x1078, 0x12db, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
+ 0x3ca8, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3cb4,
+ 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3cb4, 0x7074, 0xa081,
+ 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e,
+ 0x1078, 0x40c4, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204,
+ 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08,
+ 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3cd3, 0xa086,
+ 0x1000, 0x00c0, 0x3cf4, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0,
+ 0x3cda, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3cf4, 0xac82, 0x7200,
+ 0x0048, 0x3cf4, 0x6854, 0xac02, 0x00c8, 0x3cf4, 0x2009, 0x0047,
+ 0x1078, 0x544c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x7a28, 0x7a1c,
+ 0xd284, 0x00c0, 0x3cc5, 0x007c, 0xa016, 0x1078, 0x1505, 0x0078,
+ 0x3cea, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28,
+ 0xa584, 0x0070, 0x00c0, 0x3d22, 0xa484, 0x7000, 0xa086, 0x1000,
+ 0x00c0, 0x3d22, 0x1078, 0x3d2f, 0x0040, 0x3d22, 0x20e1, 0x3000,
+ 0x7828, 0x7828, 0x1078, 0x3d4d, 0x147f, 0x137f, 0x157f, 0x2009,
+ 0x6db8, 0x2104, 0xa005, 0x00c0, 0x3d1e, 0x007c, 0x1078, 0x4713,
+ 0x0078, 0x3d1d, 0x1078, 0x6b3d, 0x1078, 0x3d2f, 0x20e1, 0x3000,
+ 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3d1d, 0xa484,
+ 0x01ff, 0x6872, 0xa005, 0x0040, 0x3d41, 0xa080, 0x001f, 0xa084,
+ 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
+ 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
+ 0x53a5, 0xa085, 0x0001, 0x0078, 0x3d40, 0x7000, 0xa084, 0xff00,
+ 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3d5a, 0x0078,
+ 0x3e3e, 0x007c, 0xa196, 0x2000, 0x00c0, 0x3d6b, 0x6900, 0xa18e,
+ 0x0001, 0x00c0, 0x3d67, 0x1078, 0x2a02, 0x0078, 0x3d59, 0x1078,
+ 0x3d73, 0x0078, 0x3d59, 0xa196, 0x8000, 0x00c0, 0x3d59, 0x1078,
+ 0x3ec4, 0x0078, 0x3d59, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f,
+ 0xa196, 0x0001, 0x0040, 0x3d80, 0xa196, 0x0023, 0x00c0, 0x3e36,
+ 0xa08e, 0x0023, 0x00c0, 0x3db1, 0x1078, 0x3f36, 0x0040, 0x3e36,
+ 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3d99, 0x7034,
+ 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0015, 0x1078, 0x544c, 0x0078,
+ 0x3e36, 0xa08e, 0x0210, 0x00c0, 0x3da3, 0x2009, 0x0015, 0x1078,
+ 0x544c, 0x0078, 0x3e36, 0xa08e, 0x0100, 0x00c0, 0x3e36, 0x7034,
+ 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0016, 0x1078, 0x544c, 0x0078,
+ 0x3e36, 0xa08e, 0x0022, 0x00c0, 0x3e36, 0x7030, 0xa08e, 0x0300,
+ 0x00c0, 0x3dc2, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0017,
+ 0x0078, 0x3e1e, 0xa08e, 0x0500, 0x00c0, 0x3dce, 0x7034, 0xa005,
+ 0x00c0, 0x3e36, 0x2009, 0x0018, 0x0078, 0x3e1e, 0xa08e, 0x2010,
+ 0x00c0, 0x3dd6, 0x2009, 0x0019, 0x0078, 0x3e1e, 0xa08e, 0x2110,
+ 0x00c0, 0x3dde, 0x2009, 0x001a, 0x0078, 0x3e1e, 0xa08e, 0x5200,
+ 0x00c0, 0x3dea, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x001b,
+ 0x0078, 0x3e1e, 0xa08e, 0x5000, 0x00c0, 0x3df6, 0x7034, 0xa005,
+ 0x00c0, 0x3e36, 0x2009, 0x001c, 0x0078, 0x3e1e, 0xa08e, 0x1200,
+ 0x00c0, 0x3e02, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0024,
+ 0x0078, 0x3e1e, 0xa08e, 0x2400, 0x00c0, 0x3e08, 0x0078, 0x3e1c,
+ 0xa08e, 0x5300, 0x00c0, 0x3e0e, 0x0078, 0x3e1c, 0xa08e, 0x0f00,
+ 0x00c0, 0x3e16, 0x2009, 0x0020, 0x0078, 0x3e1e, 0xa08e, 0x5300,
+ 0x00c0, 0x3e1c, 0x0078, 0x3e1c, 0x2009, 0x001d, 0x017e, 0x2011,
+ 0x7083, 0x2204, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x3e38,
+ 0x0c7e, 0x1078, 0x53bf, 0x0040, 0x3e3b, 0x017f, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x544c, 0x0c7f, 0x007c,
+ 0x017f, 0x0078, 0x3e36, 0x0c7f, 0x0078, 0x3e38, 0xa084, 0x0007,
+ 0x0079, 0x3e43, 0x007c, 0x3e4b, 0x3e4b, 0x3e4b, 0x3e4b, 0x3e4b,
+ 0x3e4c, 0x3e65, 0x3ead, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3e64,
+ 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x3e64, 0xac8a, 0x7200,
+ 0x0048, 0x3e64, 0x6854, 0xac02, 0x00c8, 0x3e64, 0x7124, 0x610a,
+ 0x2009, 0x0046, 0x1078, 0x544c, 0x007c, 0x0c7e, 0x7110, 0xd1bc,
+ 0x00c0, 0x3eab, 0x2011, 0x7083, 0x2204, 0xa080, 0x2154, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x336a, 0x00c0, 0x3eab, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3e90, 0x0c7e,
+ 0x1078, 0x53bf, 0x017f, 0x0040, 0x3eab, 0x611a, 0x601f, 0x0006,
+ 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x544c, 0x0078, 0x3eab,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x3eab, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x3ea3, 0x6007,
+ 0x0005, 0x0078, 0x3ea5, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
+ 0x4311, 0x1078, 0x4713, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040,
+ 0x3ec3, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x3ec3, 0xac82,
+ 0x7200, 0x0048, 0x3ec3, 0x6854, 0xac02, 0x00c8, 0x3ec3, 0x2009,
+ 0x0045, 0x1078, 0x544c, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f,
+ 0xa18e, 0x0000, 0x00c0, 0x3ed4, 0xa084, 0x000f, 0xa08a, 0x0006,
+ 0x10c8, 0x126a, 0x1079, 0x3ed5, 0x007c, 0x3edb, 0x3edc, 0x3edb,
+ 0x3edb, 0x3f18, 0x3f27, 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x3f17,
+ 0x700c, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x3f17, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3f00, 0x0c7e,
+ 0x1078, 0x53bf, 0x017f, 0x0040, 0x3f17, 0x611a, 0x601f, 0x0005,
+ 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x544c, 0x0078, 0x3f17,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x3f17, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x3f13, 0x2009,
+ 0x0005, 0x0078, 0x3f15, 0x2009, 0x0001, 0x1078, 0x544c, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x3f26, 0x1078, 0x3f36, 0x0040, 0x3f26,
+ 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x544c, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x3f35, 0x1078, 0x3f36, 0x0040, 0x3f35, 0x7124,
+ 0x610a, 0x2009, 0x008a, 0x1078, 0x544c, 0x007c, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x3f49, 0xac82, 0x7200, 0x0048, 0x3f49,
+ 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x3f49, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x3f48, 0x2071, 0x6dc3, 0x7003, 0x0003,
+ 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7200, 0x7007,
+ 0x0000, 0x7026, 0x702b, 0x4e24, 0x7032, 0x7037, 0x4e70, 0x703b,
+ 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x6dc3, 0x00e0, 0x4013,
+ 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x3fdc, 0x700f,
+ 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138, 0x8109,
+ 0x713a, 0x00c0, 0x3fda, 0x703b, 0x0002, 0x2009, 0x0100, 0x2104,
+ 0xa082, 0x0003, 0x00c8, 0x3fda, 0x703c, 0xa086, 0x0001, 0x00c0,
+ 0x3fb7, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x3f95, 0x6803, 0x1000, 0x0078, 0x3f9c, 0x6804, 0xa084, 0x1000,
+ 0x0040, 0x3f9c, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f, 0x0000,
+ 0x2069, 0x6db0, 0x6804, 0xa082, 0x0006, 0x00c0, 0x3fa9, 0x6807,
+ 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x3fb0, 0x6833, 0x0000,
+ 0x1078, 0x4713, 0x1078, 0x47c3, 0x0d7f, 0x0078, 0x3fda, 0x0d7e,
+ 0x2069, 0x6c00, 0x6944, 0x6860, 0xa102, 0x00c8, 0x3fd9, 0x2069,
+ 0x6db0, 0x6804, 0xa086, 0x0000, 0x00c0, 0x3fd9, 0x6830, 0xa086,
+ 0x0000, 0x00c0, 0x3fd9, 0x703f, 0x0001, 0x6807, 0x0006, 0x6833,
+ 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140, 0x6803,
+ 0x0600, 0x0d7f, 0x0078, 0x3fdf, 0x127e, 0x2091, 0x8000, 0x7024,
+ 0xa00d, 0x0040, 0x3ff0, 0x7020, 0x8001, 0x7022, 0x00c0, 0x3ff0,
+ 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x3ff0, 0x7028, 0x107a,
+ 0x7030, 0xa00d, 0x0040, 0x4001, 0x702c, 0x8001, 0x702e, 0x00c0,
+ 0x4001, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0, 0x4001, 0x7034,
+ 0x107a, 0x7018, 0xa00d, 0x0040, 0x4012, 0x7008, 0x8001, 0x700a,
+ 0x00c0, 0x4012, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x4012,
+ 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4016, 0x403d, 0x403e,
+ 0x405a, 0x0e7e, 0x2071, 0x6dc3, 0x7018, 0xa005, 0x00c0, 0x4024,
+ 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
+ 0x2071, 0x6dc3, 0x701c, 0xa206, 0x00c0, 0x4030, 0x701a, 0x701e,
+ 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6dc3, 0x6088, 0xa102,
+ 0x0048, 0x403b, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078,
+ 0x336a, 0x00c0, 0x4050, 0x6088, 0x8001, 0x0048, 0x4050, 0x608a,
+ 0x00c0, 0x4050, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f,
+ 0x8108, 0xa182, 0x007e, 0x0048, 0x4058, 0xa00e, 0x7007, 0x0002,
+ 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x6014,
+ 0xa005, 0x0040, 0x4089, 0x8001, 0x6016, 0x00c0, 0x4089, 0x611c,
+ 0xa186, 0x0003, 0x0040, 0x4070, 0xa186, 0x0006, 0x00c0, 0x4087,
+ 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4087, 0xa082,
+ 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x4080, 0x2001, 0x1999,
+ 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x4089, 0x1078,
+ 0x5e70, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001, 0x6c16, 0x2004,
+ 0xa102, 0x0048, 0x4097, 0x7017, 0x7200, 0x7007, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dc3, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b,
+ 0x0002, 0x0e7f, 0x007c, 0x2001, 0x6dcc, 0x2003, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dc3, 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f,
+ 0x007c, 0x2011, 0x6dcf, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071,
+ 0x6dc3, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e,
+ 0x2061, 0x6e54, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003, 0x8003,
+ 0x8003, 0xa080, 0x6e54, 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a,
+ 0x0048, 0x40d4, 0x2001, 0x1999, 0xa005, 0x00c0, 0x40e4, 0x6944,
+ 0x0c7e, 0x1078, 0x40c4, 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x40e9,
+ 0x2001, 0x001e, 0x0078, 0x40e9, 0xa08e, 0xffff, 0x00c0, 0x40e9,
+ 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c,
+ 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x4124, 0xd0b4, 0x00c0, 0x4100,
+ 0xd0bc, 0x00c0, 0x4112, 0x2009, 0x0006, 0x1078, 0x4147, 0x007c,
+ 0xd0fc, 0x0040, 0x410d, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
+ 0x4140, 0xa08e, 0x0000, 0x00c0, 0x4140, 0x2009, 0x0043, 0x1078,
+ 0x544c, 0x007c, 0xd0fc, 0x0040, 0x411f, 0xa084, 0x0003, 0xa08e,
+ 0x0003, 0x0040, 0x4140, 0xa08e, 0x0000, 0x00c0, 0x4140, 0x2009,
+ 0x0042, 0x1078, 0x544c, 0x007c, 0xd0fc, 0x0040, 0x4136, 0xa084,
+ 0x0003, 0xa08e, 0x0003, 0x0040, 0x4140, 0xa08e, 0x0002, 0x0040,
+ 0x413a, 0x2009, 0x0041, 0x1078, 0x544c, 0x007c, 0x1078, 0x4145,
+ 0x0078, 0x4135, 0x2009, 0x0043, 0x1078, 0x544c, 0x0078, 0x4135,
+ 0x2009, 0x0004, 0x1078, 0x4147, 0x007c, 0x2009, 0x0001, 0x6010,
+ 0xa0ec, 0xf000, 0x0040, 0x416b, 0x2068, 0x6952, 0x6800, 0x6012,
+ 0xa186, 0x0001, 0x00c0, 0x4165, 0x694c, 0xa18c, 0x8100, 0xa18e,
+ 0x8100, 0x00c0, 0x4165, 0x0c7e, 0x6944, 0x1078, 0x40c4, 0x6204,
+ 0x8210, 0x0048, 0x4164, 0x6206, 0x0c7f, 0x1078, 0x35c4, 0x6010,
+ 0xa06d, 0x10c0, 0x40cd, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010,
+ 0x2061, 0x6e54, 0x6000, 0x81ff, 0x0040, 0x4179, 0xa205, 0x0078,
+ 0x417a, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x4172, 0x0c7f,
+ 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x418a, 0x8001, 0x680a,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x6db0,
+ 0x127f, 0x0d7e, 0x2069, 0x6db0, 0x6803, 0x0005, 0x2069, 0x0004,
+ 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027,
+ 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x41a6, 0x41b0, 0x41d5,
+ 0x4224, 0x41b6, 0x41d5, 0x41ae, 0x41ae, 0x41ae, 0x1078, 0x126a,
+ 0x1078, 0x40a3, 0x1078, 0x4713, 0x0c7f, 0x007c, 0x62c0, 0x82ff,
+ 0x00c0, 0x41bc, 0x0c7f, 0x007c, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0x7828, 0xa092, 0x0002, 0x00c8, 0x41cb, 0x8000, 0x782a, 0x1078,
+ 0x30c0, 0x0078, 0x41ba, 0x1078, 0x308c, 0x7807, 0x0003, 0x7827,
+ 0x0000, 0x782b, 0x0000, 0x0078, 0x41ba, 0x1078, 0x40a3, 0x62c0,
+ 0x82ff, 0x00c0, 0x41e7, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040,
+ 0x126a, 0x2009, 0x0013, 0x1078, 0x544c, 0x0c7f, 0x007c, 0x3900,
+ 0xa082, 0x6ef4, 0x00c8, 0x41ee, 0x1078, 0x5397, 0x0c7e, 0x7824,
+ 0xa065, 0x1040, 0x126a, 0x7804, 0xa086, 0x0004, 0x0040, 0x4262,
+ 0x7828, 0xa092, 0x2710, 0x00c8, 0x4204, 0x8000, 0x782a, 0x0c7f,
+ 0x1078, 0x4e09, 0x0078, 0x41e5, 0x6104, 0xa186, 0x0003, 0x00c0,
+ 0x421b, 0x0e7e, 0x2071, 0x6c00, 0x70b4, 0x0e7f, 0xd08c, 0x0040,
+ 0x421b, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x6c00, 0x1078,
+ 0x30c9, 0x0e7f, 0x0c7f, 0x1078, 0x6b90, 0x2009, 0x0014, 0x1078,
+ 0x544c, 0x0c7f, 0x0078, 0x41e5, 0x2001, 0x6dcc, 0x2003, 0x0000,
+ 0x62c0, 0x82ff, 0x00c0, 0x4238, 0x782b, 0x0000, 0x7824, 0xa065,
+ 0x1040, 0x126a, 0x2009, 0x0013, 0x1078, 0x5499, 0x0c7f, 0x007c,
+ 0x0c7e, 0x0d7e, 0x7824, 0xa005, 0x1040, 0x126a, 0x781c, 0xa06d,
+ 0x1040, 0x126a, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078,
+ 0x5425, 0x693c, 0x81ff, 0x1040, 0x126a, 0x8109, 0x693e, 0x6854,
+ 0xa015, 0x0040, 0x4256, 0x7a1e, 0x0078, 0x4258, 0x7918, 0x791e,
+ 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x4713,
+ 0x0078, 0x4236, 0x6104, 0xa186, 0x0002, 0x0040, 0x426d, 0xa186,
+ 0x0004, 0x0040, 0x426d, 0x0078, 0x41f8, 0x7808, 0xac06, 0x0040,
+ 0x41f8, 0x1078, 0x461a, 0x1078, 0x4311, 0x0c7f, 0x1078, 0x4713,
+ 0x0078, 0x41e5, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x6dcf, 0x2013,
+ 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x4294, 0x62c4, 0x82ff, 0x00c0,
+ 0x4294, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x4292, 0x2009, 0x0049,
+ 0x1078, 0x544c, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x6ef4, 0x00c8,
+ 0x429b, 0x1078, 0x5397, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040,
+ 0x4292, 0x7944, 0xa192, 0x2710, 0x00c8, 0x42ba, 0x8108, 0x7946,
+ 0x1078, 0x40a8, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006,
+ 0x00c0, 0x42b6, 0x6017, 0x0012, 0x0078, 0x4292, 0x6017, 0x0016,
+ 0x0078, 0x4292, 0x1078, 0x6b90, 0x793c, 0x2160, 0x2009, 0x004a,
+ 0x1078, 0x544c, 0x0078, 0x4292, 0x007e, 0x017e, 0x0c7e, 0x127e,
+ 0x600f, 0x0000, 0x2c08, 0x2061, 0x6db0, 0x2091, 0x8000, 0x6020,
+ 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, 0x42df, 0xa080, 0x0003,
+ 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116,
+ 0x6112, 0x0078, 0x42da, 0x0d7e, 0x2069, 0x6db0, 0x6000, 0xd0d4,
+ 0x0040, 0x42f8, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0,
+ 0x42f3, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x471b,
+ 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040, 0x430a, 0x6056, 0x605b,
+ 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x6db0,
+ 0x0078, 0x42ea, 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078,
+ 0x42ea, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f,
+ 0x0000, 0x2c08, 0x2061, 0x6db0, 0x6020, 0x8000, 0x6022, 0x6008,
+ 0xa005, 0x0040, 0x432c, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f,
+ 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x4327,
+ 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x6db0, 0x6034, 0xa005,
+ 0x0040, 0x4340, 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c,
+ 0x613a, 0x6136, 0x0078, 0x433e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x067e, 0x027e, 0x007e, 0x127e, 0x2071, 0x6db0, 0x7638, 0x2660,
+ 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x43a4, 0x6018, 0xa080,
+ 0x0028, 0x2004, 0xa206, 0x00c0, 0x439f, 0x703c, 0xac06, 0x00c0,
+ 0x4366, 0x6003, 0x000a, 0x630a, 0x0078, 0x439f, 0x7038, 0xac36,
+ 0x00c0, 0x436c, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x437a,
+ 0x2c00, 0xaf36, 0x0040, 0x4378, 0x2f00, 0x7036, 0x0078, 0x437a,
+ 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x4383,
+ 0x7e0e, 0x0078, 0x4384, 0x2678, 0x600f, 0x0000, 0x1078, 0x5fcd,
+ 0x0040, 0x439a, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x43ad, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4,
+ 0x1078, 0x60db, 0x1078, 0x60e8, 0x0c7f, 0x0078, 0x4353, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x4353, 0x127f, 0x007f, 0x027f, 0x067f,
0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x462f, 0x1078, 0x6e8b, 0x0078, 0x463a, 0x007e, 0x067e,
+ 0x00c0, 0x4391, 0x1078, 0x6ac6, 0x0078, 0x439a, 0x007e, 0x067e,
0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, 0x8000,
- 0x2079, 0x71b6, 0x7838, 0xa065, 0x0040, 0x468d, 0x600c, 0x007e,
- 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4674, 0x6003, 0x000a,
- 0x630a, 0x2c30, 0x0078, 0x468a, 0x1078, 0x6336, 0x0040, 0x4688,
- 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4696, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x1078, 0x6457, 0x007f, 0x0078, 0x4663, 0x7e3a, 0x7e36, 0x127f,
+ 0x2079, 0x6db0, 0x7838, 0xa065, 0x0040, 0x43ed, 0x600c, 0x007e,
+ 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x43d4, 0x6003, 0x000a,
+ 0x630a, 0x2c30, 0x0078, 0x43ea, 0x1078, 0x5fcd, 0x0040, 0x43e8,
+ 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x43f6, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x007f, 0x0078, 0x43c3, 0x7e3a, 0x7e36, 0x127f,
0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x467f, 0x1078, 0x6e8b, 0x0078, 0x4688, 0x027e,
- 0x1078, 0x46b3, 0x1078, 0x474c, 0x027f, 0x007c, 0x0f7e, 0x127e,
- 0x2079, 0x71b6, 0x2091, 0x8000, 0x1078, 0x47e3, 0x1078, 0x484b,
+ 0x0006, 0x00c0, 0x43df, 0x1078, 0x6ac6, 0x0078, 0x43e8, 0x027e,
+ 0x1078, 0x4413, 0x1078, 0x44aa, 0x027f, 0x007c, 0x0f7e, 0x127e,
+ 0x2079, 0x6db0, 0x2091, 0x8000, 0x1078, 0x453f, 0x1078, 0x45a7,
0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
- 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6, 0x7614, 0x2660,
- 0x2678, 0x8cff, 0x0040, 0x473b, 0x6018, 0xa080, 0x0028, 0x2004,
- 0xa206, 0x00c0, 0x4736, 0x7024, 0xac06, 0x00c0, 0x46f9, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x46f4, 0x1078, 0x50b0, 0x68c3,
- 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x46e9, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x46f1, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x46f9, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x4736, 0x7014, 0xac36, 0x00c0, 0x46ff, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x470d, 0x2c00, 0xaf36, 0x0040, 0x470b, 0x2f00,
- 0x7012, 0x0078, 0x470d, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x4716, 0x7e0e, 0x0078, 0x4717, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x472f, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x4743, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840, 0x1078, 0x644a, 0x1078,
- 0x6457, 0x1078, 0x53f5, 0x0c7f, 0x0078, 0x46c1, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x46c1, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4724,
- 0x1078, 0x6e8b, 0x0078, 0x472f, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0xa280, 0x7120, 0x2004, 0xa065, 0x0040, 0x47df, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x71b6, 0x6654, 0x7018, 0xac06,
- 0x00c0, 0x4763, 0x761a, 0x701c, 0xac06, 0x00c0, 0x476f, 0x86ff,
- 0x00c0, 0x476e, 0x7018, 0x701e, 0x0078, 0x476f, 0x761e, 0x6058,
- 0xa07d, 0x0040, 0x4774, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x477a,
- 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4,
- 0xc0dc, 0x6002, 0x1078, 0x3473, 0x0040, 0x47db, 0x7624, 0x86ff,
- 0x0040, 0x47cb, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x47cb,
- 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x47c2, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x47ab, 0x6803,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0, 0x7614, 0x2660,
+ 0x2678, 0x8cff, 0x0040, 0x4499, 0x6018, 0xa080, 0x0028, 0x2004,
+ 0xa206, 0x00c0, 0x4494, 0x7024, 0xac06, 0x00c0, 0x4459, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4454, 0x1078, 0x4e17, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4449, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4451, 0x6827,
+ 0x0001, 0x037f, 0x0078, 0x4459, 0x6003, 0x0009, 0x630a, 0x0078,
+ 0x4494, 0x7014, 0xac36, 0x00c0, 0x445f, 0x660c, 0x7616, 0x7010,
+ 0xac36, 0x00c0, 0x446d, 0x2c00, 0xaf36, 0x0040, 0x446b, 0x2f00,
+ 0x7012, 0x0078, 0x446d, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
+ 0xaf06, 0x0040, 0x4476, 0x7e0e, 0x0078, 0x4477, 0x2678, 0x600f,
+ 0x0000, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x448d, 0x601c,
+ 0xa086, 0x0003, 0x00c0, 0x44a1, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db, 0x1078, 0x60e8, 0x1078,
+ 0x516d, 0x0c7f, 0x0078, 0x4421, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x4421, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4484, 0x1078, 0x6ac6,
+ 0x0078, 0x448d, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280,
+ 0x6d20, 0x2004, 0xa065, 0x0040, 0x453b, 0x0f7e, 0x0e7e, 0x0d7e,
+ 0x067e, 0x2071, 0x6db0, 0x6654, 0x7018, 0xac06, 0x00c0, 0x44c1,
+ 0x761a, 0x701c, 0xac06, 0x00c0, 0x44cd, 0x86ff, 0x00c0, 0x44cc,
+ 0x7018, 0x701e, 0x0078, 0x44cd, 0x761e, 0x6058, 0xa07d, 0x0040,
+ 0x44d2, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x44d8, 0x2f00, 0x685a,
+ 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002,
+ 0x1078, 0x32e7, 0x0040, 0x4537, 0x7624, 0x86ff, 0x0040, 0x4529,
+ 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4529, 0x0d7e, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4520, 0x1078, 0x4e17, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4509, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4511, 0x6827,
+ 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x451a,
+ 0x8001, 0x603e, 0x2660, 0x1078, 0x60e8, 0x0c7f, 0x0078, 0x4529,
+ 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078,
+ 0x44e0, 0x8dff, 0x0040, 0x4533, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x35c4, 0x1078, 0x516d, 0x0078, 0x44e0, 0x067f,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040,
+ 0x4597, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0,
+ 0x457c, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4576, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x529d, 0x7827, 0x0000, 0x037e,
+ 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x456b, 0x6803,
0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x47b3, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005,
- 0x0040, 0x47bc, 0x8001, 0x603e, 0x2660, 0x1078, 0x6457, 0x0c7f,
- 0x0078, 0x47cb, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a,
- 0x0c7f, 0x0078, 0x4782, 0x8dff, 0x0040, 0x47d7, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840, 0x1078,
- 0x53f5, 0x0078, 0x4782, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f,
- 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031,
- 0x0000, 0x7814, 0xa065, 0x0040, 0x483b, 0x600c, 0x007e, 0x600f,
- 0x0000, 0x7824, 0xac06, 0x00c0, 0x4820, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x481a, 0x1078, 0x50b0, 0x68c3, 0x0000, 0x1078,
- 0x5525, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x480f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x4817, 0x6827, 0x0001, 0x037f,
- 0x0078, 0x4820, 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x4838,
- 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x4834, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4842, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x3840, 0x1078, 0x644a, 0x1078, 0x6457, 0x1078, 0x53f5,
- 0x007f, 0x0078, 0x47ea, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x482b, 0x1078,
- 0x6e8b, 0x0078, 0x4834, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818,
- 0xa065, 0x0040, 0x48b7, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b,
- 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3473, 0x0040,
- 0x48b4, 0x7e24, 0x86ff, 0x0040, 0x48a6, 0xa680, 0x0004, 0x2004,
- 0xad06, 0x00c0, 0x48a6, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005,
- 0x0040, 0x489d, 0x1078, 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525,
- 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
- 0x0040, 0x4886, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
- 0x6824, 0xd084, 0x0040, 0x488e, 0x6827, 0x0001, 0x037f, 0x0d7f,
- 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4897, 0x8001, 0x603e, 0x2660,
- 0x1078, 0x6457, 0x0c7f, 0x0078, 0x48a6, 0x0d7f, 0x0c7e, 0x2660,
- 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x485d, 0x8dff, 0x0040,
- 0x48b0, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840,
- 0x1078, 0x53f5, 0x0078, 0x485d, 0x007f, 0x0078, 0x4850, 0x781e,
- 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e,
- 0x2071, 0x71b6, 0x7004, 0xa084, 0x0007, 0x0079, 0x48c7, 0x48d1,
- 0x48d4, 0x48ed, 0x4909, 0x494e, 0x48d1, 0x48d1, 0x48cf, 0x1078,
- 0x1288, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x48e2,
- 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040, 0x48e9, 0x7216,
- 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
- 0x007c, 0x7216, 0x7212, 0x0078, 0x48e2, 0x6018, 0x2060, 0x1078,
- 0x3473, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0040,
- 0x48fe, 0x6054, 0xa015, 0x0040, 0x4905, 0x721e, 0x7007, 0x0000,
- 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078,
- 0x48fe, 0x7024, 0xa065, 0x0040, 0x494b, 0x700c, 0xac06, 0x00c0,
- 0x4920, 0x1078, 0x53f5, 0x600c, 0xa015, 0x0040, 0x491c, 0x720e,
- 0x600f, 0x0000, 0x0078, 0x4949, 0x720e, 0x720a, 0x0078, 0x4949,
- 0x7014, 0xac06, 0x00c0, 0x4933, 0x1078, 0x53f5, 0x600c, 0xa015,
- 0x0040, 0x492f, 0x7216, 0x600f, 0x0000, 0x0078, 0x4949, 0x7216,
- 0x7212, 0x0078, 0x4949, 0x6018, 0x2060, 0x1078, 0x3473, 0x6000,
- 0xc0dc, 0x6002, 0x1078, 0x53f5, 0x701c, 0xa065, 0x0040, 0x4949,
- 0x6054, 0xa015, 0x0040, 0x4947, 0x721e, 0x0078, 0x4949, 0x7218,
- 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065,
- 0x0040, 0x495b, 0x1078, 0x53f5, 0x600c, 0xa015, 0x0040, 0x4962,
- 0x720e, 0x600f, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x495b, 0x0d7e, 0x2069,
- 0x71b6, 0x6830, 0xa084, 0x0003, 0x0079, 0x496e, 0x4974, 0x4976,
- 0x499c, 0x4974, 0x1078, 0x1288, 0x0d7f, 0x007c, 0x0c7e, 0x6840,
- 0xa086, 0x0001, 0x0040, 0x4992, 0x683c, 0xa065, 0x0040, 0x4987,
- 0x600c, 0xa015, 0x0040, 0x498e, 0x6a3a, 0x600f, 0x0000, 0x6833,
- 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836,
- 0x0078, 0x4987, 0x6843, 0x0000, 0x6838, 0xa065, 0x0040, 0x4987,
- 0x6003, 0x0003, 0x0078, 0x4987, 0x0c7e, 0x6843, 0x0000, 0x6847,
- 0x0000, 0x683c, 0xa065, 0x0040, 0x49b4, 0x600c, 0xa015, 0x0040,
- 0x49b0, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0078, 0x49b4,
- 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e,
- 0x2069, 0x71b6, 0x6804, 0xa084, 0x0007, 0x0079, 0x49bf, 0x49c9,
- 0x4a56, 0x4a56, 0x4a56, 0x4a56, 0x4a58, 0x4a56, 0x49c7, 0x1078,
- 0x1288, 0x6820, 0xa005, 0x00c0, 0x49cf, 0x0d7f, 0x007c, 0x0c7e,
- 0x680c, 0xa065, 0x0040, 0x49de, 0x6807, 0x0004, 0x6826, 0x682b,
- 0x0000, 0x1078, 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065,
- 0x0040, 0x49ec, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x1078,
- 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5,
- 0x0000, 0x0040, 0x4a51, 0x704c, 0xa00d, 0x0040, 0x49fb, 0x7088,
- 0xa005, 0x0040, 0x4a13, 0x7054, 0xa075, 0x0040, 0x4a04, 0xa20e,
- 0x0040, 0x4a51, 0x0078, 0x4a09, 0x6818, 0xa20e, 0x0040, 0x4a51,
- 0x2070, 0x704c, 0xa00d, 0x0040, 0x49fb, 0x7088, 0xa005, 0x00c0,
- 0x49fb, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8, 0x49fb,
- 0x1078, 0x56c4, 0x0040, 0x4a51, 0x8318, 0x733e, 0x6112, 0x2e10,
- 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048, 0x4a2a,
- 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
- 0x0f7e, 0x2c78, 0x71a0, 0xa1e0, 0x2207, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0x1078, 0x4db8, 0x7300, 0xc3dd, 0x7302,
- 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003,
- 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f,
- 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4a4f, 0x0d7f, 0x007c,
- 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4a64, 0x6807, 0x0004, 0x6826,
- 0x682b, 0x0000, 0x1078, 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0d7e, 0x2069, 0x71b6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x4a85,
- 0x6838, 0xa07d, 0x0040, 0x4a85, 0x6833, 0x0001, 0x683e, 0x6847,
- 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078, 0x19b3,
- 0x00c0, 0x4a88, 0x127f, 0x1078, 0x4fe3, 0x0d7f, 0x0f7f, 0x007c,
- 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0040,
- 0x4a9a, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000,
- 0x0078, 0x4a85, 0x683a, 0x6836, 0x0078, 0x4a94, 0x601c, 0xa084,
- 0x0007, 0x1079, 0x4aa4, 0x007c, 0x4aac, 0x4ab1, 0x4cf0, 0x4d88,
- 0x4ab1, 0x4cf0, 0x4d88, 0x4aac, 0x1078, 0x48be, 0x1078, 0x49b7,
- 0x007c, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x1288, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2207,
- 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079,
- 0x4acf, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x4b01,
- 0x4b39, 0x4b51, 0x4b8a, 0x4bb7, 0x4bbf, 0x4be0, 0x4bf1, 0x4c02,
- 0x4c0a, 0x4c1b, 0x4c0a, 0x4c63, 0x4bf1, 0x4c84, 0x4c8c, 0x4c02,
- 0x4c8c, 0x4c9d, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff,
- 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x516c, 0x5181,
- 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4be0, 0x4c0a, 0x4aff, 0x4b51,
- 0x4b8a, 0x4aff, 0x563f, 0x4c0a, 0x4aff, 0x5662, 0x4c0a, 0x1078,
- 0x1288, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x5200, 0x20a3,
- 0x0000, 0x0d7e, 0x2069, 0x7051, 0x6804, 0xd084, 0x0040, 0x4b1b,
- 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078, 0x1feb, 0x21a2, 0x017f,
- 0x0d7f, 0x0078, 0x4b20, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a9, 0x0004, 0x2099, 0x7005, 0x53a6, 0x20a9, 0x0004, 0x2099,
- 0x7001, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x0500, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9,
- 0x0004, 0x2099, 0x7005, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x0300, 0x20a3,
- 0x0000, 0x2099, 0x71a0, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0004,
- 0x2099, 0x7005, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7001, 0x53a6,
- 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4b6a, 0x20a9, 0x0008,
- 0x20a3, 0x0000, 0x00f0, 0x4b70, 0x2099, 0x71a8, 0x20a9, 0x0008,
- 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4b7b, 0x20a9,
- 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4b81, 0x60c3, 0x0074, 0x1078,
- 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x2010,
- 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7051, 0x7904,
- 0x0f7f, 0xd1ac, 0x00c0, 0x4ba6, 0xa085, 0x0020, 0xd1a4, 0x0040,
- 0x4bab, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x509c, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x5000, 0x0078, 0x4b57, 0x20a1,
- 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x509c, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078,
- 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200,
- 0x0078, 0x4b57, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100,
- 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008,
- 0x1078, 0x509c, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068,
- 0x6894, 0xa086, 0x0014, 0x00c0, 0x4c41, 0x6998, 0xa184, 0xc000,
- 0x00c0, 0x4c3d, 0xd1ec, 0x0040, 0x4c39, 0x20a3, 0x2100, 0x0078,
- 0x4c43, 0x20a3, 0x0100, 0x0078, 0x4c43, 0x20a3, 0x0400, 0x0078,
- 0x4c43, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x20a2, 0x0f7e, 0x2079, 0x7051, 0x7904, 0x0f7f, 0xd1ac, 0x00c0,
- 0x4c53, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4c58, 0xa085, 0x0010,
- 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x1078,
- 0x509c, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3,
- 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3,
+ 0x4573, 0x6827, 0x0001, 0x037f, 0x0078, 0x457c, 0x6003, 0x0009,
+ 0x630a, 0x2c30, 0x0078, 0x4594, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x4590, 0x601c, 0xa086, 0x0003, 0x00c0, 0x459e, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x1078, 0x516d, 0x007f, 0x0078, 0x4546, 0x7e16,
+ 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x4587, 0x1078, 0x6ac6, 0x0078, 0x4590, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4613, 0x6054,
+ 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc,
+ 0x6002, 0x1078, 0x32e7, 0x0040, 0x4610, 0x7e24, 0x86ff, 0x0040,
+ 0x4602, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4602, 0x0d7e,
+ 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x45f9, 0x1078, 0x4e17,
+ 0x68c3, 0x0000, 0x1078, 0x529d, 0x7827, 0x0000, 0x037e, 0x2069,
+ 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x45e2, 0x6803, 0x0100,
+ 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x45ea,
+ 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040,
+ 0x45f3, 0x8001, 0x603e, 0x2660, 0x1078, 0x60e8, 0x0c7f, 0x0078,
+ 0x4602, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f,
+ 0x0078, 0x45b9, 0x8dff, 0x0040, 0x460c, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x516d, 0x0078, 0x45b9,
+ 0x007f, 0x0078, 0x45ac, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f,
+ 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x6db0, 0x7004, 0xa084,
+ 0x0007, 0x0079, 0x4623, 0x462d, 0x4630, 0x4649, 0x4665, 0x46aa,
+ 0x462d, 0x462d, 0x462b, 0x1078, 0x126a, 0x0c7f, 0x0e7f, 0x007c,
+ 0x7024, 0xa065, 0x0040, 0x463e, 0x7020, 0x8001, 0x7022, 0x600c,
+ 0xa015, 0x0040, 0x4645, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000,
+ 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078,
+ 0x463e, 0x6018, 0x2060, 0x1078, 0x32e7, 0x6000, 0xc0dc, 0x6002,
+ 0x7020, 0x8001, 0x7022, 0x0040, 0x465a, 0x6054, 0xa015, 0x0040,
+ 0x4661, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
+ 0x007c, 0x7218, 0x721e, 0x0078, 0x465a, 0x7024, 0xa065, 0x0040,
+ 0x46a7, 0x700c, 0xac06, 0x00c0, 0x467c, 0x1078, 0x516d, 0x600c,
+ 0xa015, 0x0040, 0x4678, 0x720e, 0x600f, 0x0000, 0x0078, 0x46a5,
+ 0x720e, 0x720a, 0x0078, 0x46a5, 0x7014, 0xac06, 0x00c0, 0x468f,
+ 0x1078, 0x516d, 0x600c, 0xa015, 0x0040, 0x468b, 0x7216, 0x600f,
+ 0x0000, 0x0078, 0x46a5, 0x7216, 0x7212, 0x0078, 0x46a5, 0x6018,
+ 0x2060, 0x1078, 0x32e7, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x516d,
+ 0x701c, 0xa065, 0x0040, 0x46a5, 0x6054, 0xa015, 0x0040, 0x46a3,
+ 0x721e, 0x0078, 0x46a5, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f,
+ 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x46b7, 0x1078, 0x516d,
+ 0x600c, 0xa015, 0x0040, 0x46be, 0x720e, 0x600f, 0x0000, 0x1078,
+ 0x529d, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a,
+ 0x0078, 0x46b7, 0x0d7e, 0x2069, 0x6db0, 0x6830, 0xa084, 0x0003,
+ 0x0079, 0x46ca, 0x46d0, 0x46d2, 0x46f8, 0x46d0, 0x1078, 0x126a,
+ 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x46ee,
+ 0x683c, 0xa065, 0x0040, 0x46e3, 0x600c, 0xa015, 0x0040, 0x46ea,
+ 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f,
+ 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x46e3, 0x6843, 0x0000,
+ 0x6838, 0xa065, 0x0040, 0x46e3, 0x6003, 0x0003, 0x0078, 0x46e3,
+ 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040,
+ 0x4710, 0x600c, 0xa015, 0x0040, 0x470c, 0x6a3a, 0x600f, 0x0000,
+ 0x683f, 0x0000, 0x0078, 0x4710, 0x683f, 0x0000, 0x683a, 0x6836,
+ 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x6db0, 0x6804, 0xa084,
+ 0x0007, 0x0079, 0x471b, 0x4725, 0x47b2, 0x47b2, 0x47b2, 0x47b2,
+ 0x47b4, 0x47b2, 0x4723, 0x1078, 0x126a, 0x6820, 0xa005, 0x00c0,
+ 0x472b, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x473a,
+ 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa, 0x0c7f,
+ 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4748, 0x6807, 0x0001,
+ 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa, 0x0c7f, 0x0d7f, 0x007c,
+ 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x47ad, 0x704c,
+ 0xa00d, 0x0040, 0x4757, 0x7088, 0xa005, 0x0040, 0x476f, 0x7054,
+ 0xa075, 0x0040, 0x4760, 0xa20e, 0x0040, 0x47ad, 0x0078, 0x4765,
+ 0x6818, 0xa20e, 0x0040, 0x47ad, 0x2070, 0x704c, 0xa00d, 0x0040,
+ 0x4757, 0x7088, 0xa005, 0x00c0, 0x4757, 0x2e00, 0x681e, 0x733c,
+ 0x7038, 0xa302, 0x00c8, 0x4757, 0x1078, 0x53f4, 0x0040, 0x47ad,
+ 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004,
+ 0xa08a, 0x199a, 0x0048, 0x4786, 0x2001, 0x1999, 0x8003, 0x801b,
+ 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xa1e0,
+ 0x2154, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
+ 0x4b1d, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
+ 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
+ 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
+ 0x0078, 0x47ab, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
+ 0x47c0, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa,
+ 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x6db0, 0x6830,
+ 0xa086, 0x0000, 0x00c0, 0x47e1, 0x6838, 0xa07d, 0x0040, 0x47e1,
+ 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091,
+ 0x2200, 0x027f, 0x1078, 0x1952, 0x00c0, 0x47e4, 0x127f, 0x1078,
+ 0x4d4a, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803,
+ 0x0002, 0x780c, 0xa015, 0x0040, 0x47f6, 0x6a3a, 0x780f, 0x0000,
+ 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x47e1, 0x683a, 0x6836,
+ 0x0078, 0x47f0, 0x601c, 0xa084, 0x0007, 0x1079, 0x4800, 0x007c,
+ 0x4808, 0x480a, 0x4a59, 0x4aed, 0x480a, 0x4a59, 0x4aed, 0x4808,
+ 0x1078, 0x126a, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004,
+ 0xa08a, 0x002a, 0x10c8, 0x126a, 0x6118, 0x2178, 0x79a0, 0xa1f8,
+ 0x2154, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
+ 0x1079, 0x4828, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c,
+ 0x4854, 0x4893, 0x48ab, 0x48e4, 0x4911, 0x4919, 0x493a, 0x494b,
+ 0x495c, 0x4964, 0x4975, 0x4964, 0x49bd, 0x494b, 0x49ed, 0x49f5,
+ 0x495c, 0x49f5, 0x4a06, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852,
+ 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4eea,
+ 0x4eff, 0x4852, 0x4852, 0x4852, 0x4852, 0x493a, 0x4964, 0x4852,
+ 0x48ab, 0x48e4, 0x1078, 0x126a, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6c51, 0x6804,
+ 0xd084, 0x0040, 0x4875, 0x6828, 0x017e, 0x2069, 0x6c00, 0x694c,
+ 0xa106, 0x017f, 0x00c0, 0x4875, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x0d7f, 0x0078, 0x487a, 0x0d7f, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x20a9,
+ 0x0004, 0x2099, 0x6c01, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3,
+ 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff,
+ 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x60c3, 0x0010,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3,
+ 0x0300, 0x20a3, 0x0000, 0x2099, 0x6da0, 0x20a9, 0x0008, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x20a9, 0x0004, 0x2099,
+ 0x6c01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x48c4,
+ 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x48ca, 0x2099, 0x6da8,
+ 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x48d5, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x48db, 0x60c3,
+ 0x0074, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079,
+ 0x6c51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4900, 0xa085, 0x0020,
+ 0xd1a4, 0x0040, 0x4905, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4e03,
+ 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3, 0x5000, 0x0078,
+ 0x48b1, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3, 0x2110, 0x20a3,
+ 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0x20a3, 0x0000, 0x20a3,
0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0200, 0x0078, 0x4b07, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
- 0x60c3, 0x0008, 0x1078, 0x509c, 0x007c, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x1078,
- 0x509c, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0129, 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000,
- 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x2300,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0198,
- 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08,
- 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
- 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a,
- 0x008c, 0x10c8, 0x1288, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2207,
- 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0085, 0x1079, 0x4d0e, 0x0f7f, 0x0c7f, 0x007c, 0x4d17, 0x4d22,
- 0x4d3c, 0x4d15, 0x4d15, 0x4d15, 0x4d17, 0x1078, 0x1288, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4d4f, 0x60c3, 0x0000, 0x1078, 0x509c,
- 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4d62, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c,
- 0x1078, 0x509c, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x4d75, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0004, 0x1078, 0x509c, 0x147f, 0x007c, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8100, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000,
- 0x0078, 0x4cc3, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4ce2, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4ce2,
- 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x1288,
- 0xa08a, 0x0050, 0x10c8, 0x1288, 0x7918, 0x2160, 0x61a0, 0xa1e0,
- 0x2207, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0040, 0x1079, 0x4da6, 0x0f7f, 0x0c7f, 0x007c, 0x4db8, 0x4e68,
- 0x4e29, 0x4f77, 0x4db6, 0x4db6, 0x4db6, 0x4db6, 0x4db6, 0x4db6,
- 0x4db6, 0x530e, 0x531f, 0x5330, 0x5341, 0x4db6, 0x1078, 0x1288,
- 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7910,
- 0x2168, 0x6948, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c,
- 0xa184, 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4dd3, 0x20a3,
- 0x0002, 0x0078, 0x4ddf, 0xd1b4, 0x0040, 0x4dda, 0x20a3, 0x0001,
- 0x0078, 0x4ddf, 0x20a3, 0x0000, 0x2230, 0x0078, 0x4de1, 0x6a80,
- 0x6e7c, 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2,
- 0x8000, 0x00f0, 0x4de5, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1,
- 0x9080, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001,
- 0x71d2, 0x2003, 0x07d0, 0x2001, 0x71d1, 0x2003, 0x0009, 0x2001,
- 0x71d7, 0x2003, 0x0002, 0x1078, 0x14b7, 0x147f, 0x157f, 0x0d7f,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023,
- 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3,
- 0x0600, 0x6198, 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829,
- 0x20a2, 0x22a2, 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2,
- 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x4e49, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880,
- 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x60c3, 0x000c, 0x1078, 0x509c, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889,
- 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08,
- 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
- 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4f58,
- 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x7810, 0xa084, 0xf000, 0x00c0, 0x4e85, 0x7810, 0xa084, 0x0700,
- 0x8007, 0x1079, 0x4e8d, 0x0078, 0x4e88, 0xa006, 0x1079, 0x4e8d,
- 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4e97, 0x4ef9, 0x4efd,
- 0x4f20, 0x4f2d, 0x4f3f, 0x4f43, 0x4e95, 0x1078, 0x1288, 0x017e,
- 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4eaa,
- 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f,
- 0x0078, 0x4f24, 0xa186, 0x0001, 0x00c0, 0x4ef4, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2,
- 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4ef3,
- 0xd3c4, 0x0040, 0x4ec5, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4eca,
- 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c,
- 0x831f, 0x23a2, 0x8000, 0x00f0, 0x4ecf, 0x157f, 0x22a2, 0x22a2,
- 0x22a2, 0xa184, 0x0003, 0x0040, 0x4ef3, 0x20a1, 0x020b, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x508b,
- 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x509c,
- 0x007c, 0x20a3, 0x0008, 0x0078, 0x4f22, 0x20a3, 0x0302, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2,
- 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x509c, 0x007c,
- 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0018, 0x1078, 0x509c, 0x007c, 0x20a3, 0x0100, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x509c, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x4f22, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812,
- 0xa384, 0x00ff, 0x8001, 0x00c0, 0x4f51, 0x22a2, 0x037f, 0x0078,
- 0x4f22, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4f24,
- 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298,
- 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3,
- 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
+ 0x0022, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0200,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3,
+ 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
+ 0x0008, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a,
+ 0x20a3, 0x0200, 0x0078, 0x48b1, 0x20a1, 0x020b, 0x1078, 0x4a3a,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4e03, 0x007c, 0x0d7e, 0x20a1, 0x020b,
+ 0x1078, 0x4a3a, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800,
+ 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x499b, 0x6998,
+ 0xa184, 0xc000, 0x00c0, 0x4997, 0xd1ec, 0x0040, 0x4993, 0x20a3,
+ 0x2100, 0x0078, 0x499d, 0x20a3, 0x0100, 0x0078, 0x499d, 0x20a3,
+ 0x0400, 0x0078, 0x499d, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6c51, 0x7904, 0x0f7f,
+ 0xd1ac, 0x00c0, 0x49ad, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x49b2,
+ 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x0014, 0x1078, 0x4e03, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x6018,
+ 0x0d7e, 0x2068, 0x6804, 0x0d7f, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x0040, 0x49d6, 0x20a3, 0x0400, 0x0078, 0x49d8, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0200, 0x0078, 0x485a, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
+ 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4e03, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008,
+ 0x1078, 0x4e03, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3,
+ 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0198, 0x20a3, 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000,
+ 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
+ 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x126a,
+ 0xa08a, 0x008c, 0x10c8, 0x126a, 0x6118, 0x2178, 0x79a0, 0xa1f8,
+ 0x2154, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
+ 0xa082, 0x0085, 0x1079, 0x4a77, 0x0f7f, 0x0c7f, 0x007c, 0x4a80,
+ 0x4a8b, 0x4aa5, 0x4a7e, 0x4a7e, 0x4a7e, 0x4a80, 0x1078, 0x126a,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ab4, 0x60c3, 0x0000, 0x1078,
+ 0x4e03, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ac7,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x000c, 0x1078, 0x4e03, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4ada, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x60c3, 0x0004,
+ 0x1078, 0x4e03, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x4a2c, 0x027e,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2,
+ 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000,
+ 0x0078, 0x4a4b, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4a4b, 0x0c7e, 0x0f7e, 0x2c78,
+ 0x7804, 0xa08a, 0x0040, 0x1048, 0x126a, 0xa08a, 0x0050, 0x10c8,
+ 0x126a, 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2154, 0x2c0c, 0xa18c,
+ 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4b0b,
+ 0x0f7f, 0x0c7f, 0x007c, 0x4b1d, 0x4bcf, 0x4b90, 0x4cde, 0x4b1b,
+ 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x5086, 0x5097,
+ 0x50a8, 0x50b9, 0x4b1b, 0x1078, 0x126a, 0x0d7e, 0x157e, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7910, 0x2168, 0x6944, 0xa18c,
+ 0x00ff, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184,
+ 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4b3a, 0x20a3, 0x0002,
+ 0x0078, 0x4b46, 0xd1b4, 0x0040, 0x4b41, 0x20a3, 0x0001, 0x0078,
+ 0x4b46, 0x20a3, 0x0000, 0x2230, 0x0078, 0x4b48, 0x6a80, 0x6e7c,
+ 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000,
+ 0x00f0, 0x4b4c, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080,
+ 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x6dcc,
+ 0x2003, 0x07d0, 0x2001, 0x6dcb, 0x2003, 0x0009, 0x2001, 0x6dd1,
+ 0x2003, 0x0002, 0x1078, 0x1497, 0x147f, 0x157f, 0x0d7f, 0x007c,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014,
+ 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600,
+ 0x6198, 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2,
+ 0x22a2, 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4bb0,
+ 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2,
+ 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x000c, 0x1078, 0x4e03, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3,
+ 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e,
- 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700,
- 0x8007, 0x1079, 0x4f8a, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f,
- 0x0d7f, 0x007c, 0x4f92, 0x4f92, 0x4f94, 0x4f92, 0x4f92, 0x4f92,
- 0x4fb9, 0x4f92, 0x1078, 0x1288, 0x7910, 0xa18c, 0xf8ff, 0xa18d,
- 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4fc3,
- 0x0d7e, 0x2069, 0x7051, 0x6804, 0xd0bc, 0x0040, 0x4fae, 0x682c,
- 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4fb0, 0x20a3, 0x3f00,
- 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4fc3, 0x20a3,
- 0x7f00, 0x0078, 0x4fb1, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x508b, 0x22a2,
- 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100,
- 0x2071, 0x7000, 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2207,
- 0x2014, 0xa294, 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x502a,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810,
- 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008,
+ 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cbf, 0x7810,
+ 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810,
+ 0xa084, 0xf000, 0x00c0, 0x4bec, 0x7810, 0xa084, 0x0700, 0x8007,
+ 0x1079, 0x4bf4, 0x0078, 0x4bef, 0xa006, 0x1079, 0x4bf4, 0x147f,
+ 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4bfe, 0x4c60, 0x4c64, 0x4c87,
+ 0x4c94, 0x4ca6, 0x4caa, 0x4bfc, 0x1078, 0x126a, 0x017e, 0x037e,
+ 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4c11, 0x6b78,
+ 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078,
+ 0x4c8b, 0xa186, 0x0001, 0x00c0, 0x4c5b, 0x6b78, 0x23a2, 0x6868,
+ 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c,
+ 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4c5a, 0xd3c4,
+ 0x0040, 0x4c2c, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4c31, 0x6874,
+ 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f,
+ 0x23a2, 0x8000, 0x00f0, 0x4c36, 0x157f, 0x22a2, 0x22a2, 0x22a2,
+ 0xa184, 0x0003, 0x0040, 0x4c5a, 0x20a1, 0x020b, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4df2, 0x22a2,
+ 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4e03, 0x007c,
+ 0x20a3, 0x0008, 0x0078, 0x4c89, 0x20a3, 0x0302, 0x22a2, 0x22a2,
+ 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3,
+ 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4e03, 0x007c, 0x20a3,
+ 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
+ 0x0018, 0x1078, 0x4e03, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x60c3, 0x0020, 0x1078, 0x4e03, 0x007c, 0x20a3, 0x0008,
+ 0x0078, 0x4c89, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384,
+ 0x00ff, 0x8001, 0x00c0, 0x4cb8, 0x22a2, 0x037f, 0x0078, 0x4c89,
+ 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4c8b, 0x027e,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2,
+ 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000,
+ 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
+ 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007,
+ 0x1079, 0x4cf1, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f,
+ 0x007c, 0x4cf9, 0x4cf9, 0x4cfb, 0x4cf9, 0x4cf9, 0x4cf9, 0x4d20,
+ 0x4cf9, 0x1078, 0x126a, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600,
+ 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4d2a, 0x0d7e,
+ 0x2069, 0x6c51, 0x6804, 0xd0bc, 0x0040, 0x4d15, 0x682c, 0xa084,
+ 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4d17, 0x20a3, 0x3f00, 0x0d7f,
+ 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4e03, 0x007c,
+ 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4d2a, 0x20a3, 0x7f00,
+ 0x0078, 0x4d18, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x4df2, 0x22a2, 0x20a3,
+ 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071,
+ 0x6c00, 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2154, 0x2014,
+ 0xa294, 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x4d91, 0x6063,
+ 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077,
+ 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
+ 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070,
+ 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca,
+ 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
+ 0x629e, 0x6017, 0x0016, 0x1078, 0x40a8, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002,
+ 0x0040, 0x4dc6, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e,
+ 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff,
+ 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808,
+ 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c,
0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
- 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, 0x432c, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x0040, 0x505f, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000,
- 0x616e, 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084,
- 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
- 0x7808, 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6,
- 0x707c, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
- 0x60d7, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x5024, 0x6063,
- 0x0700, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077,
- 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
- 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a,
- 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce,
- 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017,
- 0x0016, 0x0078, 0x5024, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x71b6,
- 0x6843, 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056,
- 0x60a7, 0x9575, 0x1078, 0x50a7, 0x1078, 0x431c, 0x007c, 0x007e,
- 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c,
- 0x007e, 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085,
- 0x0008, 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e,
- 0x027e, 0x1078, 0x4327, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
- 0xa194, 0x4000, 0x0040, 0x50fa, 0x1078, 0x50b0, 0x6803, 0x1000,
- 0x6803, 0x0000, 0x0c7e, 0x2061, 0x71b6, 0x6128, 0xa192, 0x0002,
- 0x00c8, 0x50e7, 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040,
- 0x50f5, 0x1078, 0x431c, 0x1078, 0x50a7, 0x0078, 0x50f5, 0x6124,
- 0xa1e5, 0x0000, 0x0040, 0x50f2, 0x1078, 0x6f55, 0x2009, 0x0014,
- 0x1078, 0x571c, 0x0c7f, 0x0078, 0x50f5, 0x027f, 0x017f, 0x0d7f,
- 0x0c7f, 0x007c, 0x1078, 0x3247, 0x0078, 0x50f5, 0x0c7e, 0x0d7e,
- 0x0e7e, 0x017e, 0x027e, 0x1078, 0x4335, 0x2071, 0x71b6, 0x713c,
- 0x81ff, 0x0040, 0x5128, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
- 0xa194, 0x4000, 0x0040, 0x512e, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x037f, 0x713c, 0x2160,
- 0x1078, 0x6f55, 0x2009, 0x004a, 0x1078, 0x571c, 0x0078, 0x5128,
- 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192,
- 0x0002, 0x00c8, 0x5118, 0x8108, 0x7146, 0x1078, 0x432c, 0x0078,
- 0x5128, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x71b6,
- 0x7018, 0x2068, 0x8dff, 0x0040, 0x5163, 0x68a0, 0xa406, 0x0040,
- 0x5155, 0x6854, 0x2068, 0x0078, 0x514a, 0x6010, 0x2060, 0x643c,
- 0x6540, 0x6e48, 0x2d60, 0x1078, 0x363f, 0x0040, 0x5163, 0x1078,
- 0x53f5, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x4cb2, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x509c, 0x147f, 0x157f,
- 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3,
- 0x0200, 0x20a3, 0x0000, 0x20a9, 0x0006, 0x2011, 0x7040, 0x2019,
- 0x7041, 0x23a6, 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0,
- 0x5191, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
- 0x509c, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x71b6, 0x700c, 0x2060, 0x8cff, 0x0040,
- 0x51c0, 0x1078, 0x6484, 0x00c0, 0x51b7, 0x1078, 0x58f2, 0x600c,
- 0x007e, 0x1078, 0x56f5, 0x1078, 0x53f5, 0x0c7f, 0x0078, 0x51ae,
+ 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x4d8b, 0x6063, 0x0700,
+ 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
+ 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
+ 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
+ 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
+ 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016,
+ 0x0078, 0x4d8b, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
+ 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x6db0, 0x6843,
+ 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7,
+ 0x9575, 0x1078, 0x4e0e, 0x1078, 0x4098, 0x007c, 0x007e, 0x6014,
+ 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e,
+ 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008,
+ 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e,
+ 0x1078, 0x40a3, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194,
+ 0x4000, 0x0040, 0x4e6c, 0x1078, 0x4e17, 0x6803, 0x1000, 0x6803,
+ 0x0000, 0x0c7e, 0x2061, 0x6db0, 0x6128, 0xa192, 0x0002, 0x00c8,
+ 0x4e59, 0x8108, 0x612a, 0x613c, 0x0c7f, 0x81ff, 0x0040, 0x4e67,
+ 0x1078, 0x4098, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x4e55, 0x6017, 0x0012, 0x0078, 0x4e67, 0x1078, 0x4e0e, 0x0078,
+ 0x4e67, 0x6124, 0xa1e5, 0x0000, 0x0040, 0x4e64, 0x1078, 0x6b90,
+ 0x2009, 0x0014, 0x1078, 0x544c, 0x0c7f, 0x0078, 0x4e67, 0x027f,
+ 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, 0x30c9, 0x0078, 0x4e67,
+ 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x40b1, 0x2071,
+ 0x6db0, 0x713c, 0x81ff, 0x0040, 0x4eab, 0x2061, 0x0100, 0x2069,
+ 0x0140, 0x6904, 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x4eb1,
+ 0x6017, 0x0010, 0x7144, 0xa192, 0x0002, 0x00c8, 0x4ea3, 0x8108,
+ 0x7146, 0x1078, 0x40a8, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e,
+ 0x0006, 0x00c0, 0x4e9f, 0x6017, 0x0012, 0x0078, 0x4eab, 0x6017,
+ 0x0016, 0x0078, 0x4eab, 0x1078, 0x6b90, 0x2009, 0x004a, 0x1078,
+ 0x544c, 0x0078, 0x4eab, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x1078, 0x40a8, 0x0078, 0x4eab, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018,
+ 0x2068, 0x6ca0, 0x2071, 0x6db0, 0x7018, 0x2068, 0x8dff, 0x0040,
+ 0x4ee1, 0x68a0, 0xa406, 0x0040, 0x4ed1, 0x6854, 0x2068, 0x0078,
+ 0x4ec6, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f,
+ 0x2d60, 0x1078, 0x3445, 0x0040, 0x4ee1, 0x1078, 0x516d, 0xa085,
+ 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4e03, 0x147f, 0x157f, 0x007c, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0200, 0x20a3,
+ 0x0000, 0x20a9, 0x0006, 0x2011, 0x6c40, 0x2019, 0x6c41, 0x23a6,
+ 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x4f0f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x4e03, 0x147f,
+ 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6db0, 0x700c, 0x2060, 0x8cff, 0x0040, 0x4f38, 0x600c,
+ 0x007e, 0x1078, 0x5425, 0x1078, 0x516d, 0x0c7f, 0x0078, 0x4f2c,
0x700f, 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f,
0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e,
0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140,
- 0x2071, 0x71b6, 0x7024, 0x2060, 0x8cff, 0x0040, 0x5219, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x4327, 0x2009, 0x0013, 0x1078,
- 0x571c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x51fc, 0x6827,
- 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x520e, 0x7803, 0x1000,
- 0x7803, 0x0000, 0x0078, 0x520e, 0xd084, 0x0040, 0x5203, 0x6827,
- 0x0001, 0x0078, 0x5205, 0x00f0, 0x51eb, 0x7804, 0xa084, 0x1000,
- 0x0040, 0x520e, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
+ 0x2071, 0x6db0, 0x7024, 0x2060, 0x8cff, 0x0040, 0x4f91, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x40a3, 0x2009, 0x0013, 0x1078,
+ 0x544c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x4f74, 0x6827,
+ 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x4f86, 0x7803, 0x1000,
+ 0x7803, 0x0000, 0x0078, 0x4f86, 0xd084, 0x0040, 0x4f7b, 0x6827,
+ 0x0001, 0x0078, 0x4f7d, 0x00f0, 0x4f63, 0x7804, 0xa084, 0x1000,
+ 0x0040, 0x4f86, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f,
- 0x007c, 0x2001, 0x7000, 0x2004, 0xa096, 0x0001, 0x0040, 0x5251,
- 0xa096, 0x0004, 0x0040, 0x5251, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0x20a9, 0x01f4, 0x6824, 0xd094,
- 0x0040, 0x523f, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
- 0x5251, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5251, 0xd084,
- 0x0040, 0x5246, 0x6827, 0x0001, 0x0078, 0x5248, 0x00f0, 0x522e,
- 0x7804, 0xa084, 0x1000, 0x0040, 0x5251, 0x7803, 0x0100, 0x7803,
+ 0x007c, 0x2001, 0x6c00, 0x2004, 0xa096, 0x0001, 0x0040, 0x4fc9,
+ 0xa096, 0x0004, 0x0040, 0x4fc9, 0x6817, 0x0008, 0x68c3, 0x0000,
+ 0x2011, 0x308c, 0x1078, 0x4026, 0x20a9, 0x01f4, 0x6824, 0xd094,
+ 0x0040, 0x4fb7, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
+ 0x4fc9, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x4fc9, 0xd084,
+ 0x0040, 0x4fbe, 0x6827, 0x0001, 0x0078, 0x4fc0, 0x00f0, 0x4fa6,
+ 0x7804, 0xa084, 0x1000, 0x0040, 0x4fc9, 0x7803, 0x0100, 0x7803,
0x0000, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e,
0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100,
- 0x2079, 0x0140, 0x2071, 0x71b6, 0x703c, 0x2060, 0x8cff, 0x0040,
- 0x52a9, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
- 0x4335, 0x1078, 0x1b80, 0xa39d, 0x0000, 0x00c0, 0x5283, 0x2009,
- 0x0049, 0x1078, 0x571c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
- 0x5296, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x52a8,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x52a8, 0xd094, 0x0040,
- 0x529d, 0x6827, 0x0002, 0x0078, 0x529f, 0x00f0, 0x5285, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x52a8, 0x7803, 0x0100, 0x7803, 0x0000,
+ 0x2079, 0x0140, 0x2071, 0x6db0, 0x703c, 0x2060, 0x8cff, 0x0040,
+ 0x5021, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
+ 0x40b1, 0x1078, 0x1b1f, 0xa39d, 0x0000, 0x00c0, 0x4ffb, 0x2009,
+ 0x0049, 0x1078, 0x544c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
+ 0x500e, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5020,
+ 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5020, 0xd094, 0x0040,
+ 0x5015, 0x6827, 0x0002, 0x0078, 0x5017, 0x00f0, 0x4ffd, 0x7804,
+ 0xa084, 0x1000, 0x0040, 0x5020, 0x7803, 0x0100, 0x7803, 0x0000,
0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
0x157f, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069,
- 0x71b6, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
- 0x8000, 0x2069, 0x71b6, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x71b6, 0x7614,
- 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5307, 0x601c,
- 0xa206, 0x00c0, 0x5302, 0x7014, 0xac36, 0x00c0, 0x52e1, 0x660c,
- 0x7616, 0x7010, 0xac36, 0x00c0, 0x52ef, 0x2c00, 0xaf36, 0x0040,
- 0x52ed, 0x2f00, 0x7012, 0x0078, 0x52ef, 0x7013, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x52f8, 0x7e0e, 0x0078, 0x52f9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6457, 0x1078, 0x53f5, 0x0c7f,
- 0x0078, 0x52d4, 0x2c78, 0x600c, 0x2060, 0x0078, 0x52d4, 0x127f,
+ 0x6db0, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
+ 0x8000, 0x2069, 0x6db0, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x6db0, 0x7614,
+ 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x507f, 0x601c,
+ 0xa206, 0x00c0, 0x507a, 0x7014, 0xac36, 0x00c0, 0x5059, 0x660c,
+ 0x7616, 0x7010, 0xac36, 0x00c0, 0x5067, 0x2c00, 0xaf36, 0x0040,
+ 0x5065, 0x2f00, 0x7012, 0x0078, 0x5067, 0x7013, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5070, 0x7e0e, 0x0078, 0x5071,
+ 0x2678, 0x600f, 0x0000, 0x1078, 0x60e8, 0x1078, 0x516d, 0x0c7f,
+ 0x0078, 0x504c, 0x2c78, 0x600c, 0x2060, 0x0078, 0x504c, 0x127f,
0x007f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x5350, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x5350,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2,
+ 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x50c8, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2, 0xa006,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x50c8,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2,
0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078,
- 0x5350, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810,
+ 0x50c8, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810,
0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
- 0x1078, 0x5400, 0x60c3, 0x0020, 0x1078, 0x509c, 0x147f, 0x157f,
+ 0x1078, 0x5178, 0x60c3, 0x0020, 0x1078, 0x4e03, 0x147f, 0x157f,
0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120,
- 0xd1b4, 0x00c0, 0x5368, 0xd1bc, 0x00c0, 0x53b2, 0x0078, 0x53f2,
+ 0xd1b4, 0x00c0, 0x50e0, 0xd1bc, 0x00c0, 0x512a, 0x0078, 0x516a,
0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x53a9, 0x6020, 0xd0b4, 0x0040, 0x53a9, 0x6024, 0xd094,
- 0x00c0, 0x53a9, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
- 0x53a9, 0x00f0, 0x5375, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
+ 0x0040, 0x5121, 0x6020, 0xd0b4, 0x0040, 0x5121, 0x6024, 0xd094,
+ 0x00c0, 0x5121, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
+ 0x5121, 0x00f0, 0x50ed, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b,
0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024,
- 0xd094, 0x00c0, 0x53a8, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x539f,
+ 0xd094, 0x00c0, 0x5120, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x5117,
0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
- 0x0078, 0x53f2, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
+ 0x0078, 0x516a, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x53eb, 0x6020, 0xd0bc, 0x0040, 0x53eb,
- 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x53eb, 0x00f0,
- 0x53bf, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
+ 0xa084, 0x4000, 0x0040, 0x5163, 0x6020, 0xd0bc, 0x0040, 0x5163,
+ 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5163, 0x00f0,
+ 0x5137, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043,
0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000,
- 0x00c0, 0x53e5, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
- 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x71b6,
- 0x7020, 0xa005, 0x0040, 0x53fe, 0x8001, 0x7022, 0x0e7f, 0x007c,
- 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x5402, 0x20a2, 0x20a2, 0x007c,
+ 0x00c0, 0x515d, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
+ 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x6db0,
+ 0x7020, 0xa005, 0x0040, 0x5176, 0x8001, 0x7022, 0x0e7f, 0x007c,
+ 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x517a, 0x20a2, 0x20a2, 0x007c,
0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x71b6, 0x7614, 0x2660, 0x2678, 0x2039,
- 0x0001, 0x87ff, 0x0040, 0x5498, 0x8cff, 0x0040, 0x5498, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x5493, 0x88ff, 0x0040, 0x542f, 0x2800,
- 0xac06, 0x00c0, 0x5493, 0x2039, 0x0000, 0x0078, 0x5433, 0x6018,
- 0xa206, 0x00c0, 0x5493, 0x7024, 0xac06, 0x00c0, 0x5461, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x545c, 0x6817, 0x0008, 0x68c3,
- 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x5451, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5459, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x5461, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x5493, 0x7014, 0xac36, 0x00c0, 0x5467, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x5475, 0x2c00, 0xaf36, 0x0040, 0x5473, 0x2f00,
- 0x7012, 0x0078, 0x5475, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x547e, 0x7e0e, 0x0078, 0x547f, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x5489, 0x1078,
- 0x6e8b, 0x1078, 0x6457, 0x1078, 0x53f5, 0x88ff, 0x00c0, 0x54a2,
- 0x0c7f, 0x0078, 0x5419, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5419,
+ 0x2091, 0x8000, 0x2071, 0x6db0, 0x7614, 0x2660, 0x2678, 0x2039,
+ 0x0001, 0x87ff, 0x0040, 0x5210, 0x8cff, 0x0040, 0x5210, 0x601c,
+ 0xa086, 0x0006, 0x00c0, 0x520b, 0x88ff, 0x0040, 0x51a7, 0x2800,
+ 0xac06, 0x00c0, 0x520b, 0x2039, 0x0000, 0x0078, 0x51ab, 0x6018,
+ 0xa206, 0x00c0, 0x520b, 0x7024, 0xac06, 0x00c0, 0x51d9, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x51d4, 0x6817, 0x0008, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x51c9, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x51d1, 0x6827,
+ 0x0001, 0x037f, 0x0078, 0x51d9, 0x6003, 0x0009, 0x630a, 0x0078,
+ 0x520b, 0x7014, 0xac36, 0x00c0, 0x51df, 0x660c, 0x7616, 0x7010,
+ 0xac36, 0x00c0, 0x51ed, 0x2c00, 0xaf36, 0x0040, 0x51eb, 0x2f00,
+ 0x7012, 0x0078, 0x51ed, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
+ 0xaf06, 0x0040, 0x51f6, 0x7e0e, 0x0078, 0x51f7, 0x2678, 0x600f,
+ 0x0000, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x5201, 0x1078,
+ 0x6ac6, 0x1078, 0x60e8, 0x1078, 0x516d, 0x88ff, 0x00c0, 0x521a,
+ 0x0c7f, 0x0078, 0x5191, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5191,
0xa006, 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f,
0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
- 0x5499, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6, 0x7638, 0x2660, 0x2678,
- 0x8cff, 0x0040, 0x5514, 0x601c, 0xa086, 0x0006, 0x00c0, 0x550f,
- 0x88ff, 0x0040, 0x54c9, 0x2800, 0xac06, 0x00c0, 0x550f, 0x0078,
- 0x54cd, 0x6018, 0xa206, 0x00c0, 0x550f, 0x703c, 0xac06, 0x00c0,
- 0x54df, 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x7033, 0x0000,
+ 0x5211, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0, 0x7638, 0x2660, 0x2678,
+ 0x8cff, 0x0040, 0x528c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5287,
+ 0x88ff, 0x0040, 0x5241, 0x2800, 0xac06, 0x00c0, 0x5287, 0x0078,
+ 0x5245, 0x6018, 0xa206, 0x00c0, 0x5287, 0x703c, 0xac06, 0x00c0,
+ 0x5257, 0x037e, 0x2019, 0x0001, 0x1078, 0x4fd3, 0x7033, 0x0000,
0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038,
- 0xac36, 0x00c0, 0x54e5, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
- 0x54f3, 0x2c00, 0xaf36, 0x0040, 0x54f1, 0x2f00, 0x7036, 0x0078,
- 0x54f3, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
- 0x54fc, 0x7e0e, 0x0078, 0x54fd, 0x2678, 0x600f, 0x0000, 0x6010,
- 0x2068, 0x1078, 0x6336, 0x0040, 0x5507, 0x1078, 0x6e8b, 0x1078,
- 0x6457, 0x88ff, 0x00c0, 0x551e, 0x0c7f, 0x0078, 0x54b8, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x54b8, 0xa006, 0x127f, 0x007f, 0x027f,
+ 0xac36, 0x00c0, 0x525d, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
+ 0x526b, 0x2c00, 0xaf36, 0x0040, 0x5269, 0x2f00, 0x7036, 0x0078,
+ 0x526b, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x5274, 0x7e0e, 0x0078, 0x5275, 0x2678, 0x600f, 0x0000, 0x6010,
+ 0x2068, 0x1078, 0x5fcd, 0x0040, 0x527f, 0x1078, 0x6ac6, 0x1078,
+ 0x60e8, 0x88ff, 0x00c0, 0x5296, 0x0c7f, 0x0078, 0x5230, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x5230, 0xa006, 0x127f, 0x007f, 0x027f,
0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
- 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5515, 0x0e7e, 0x2071, 0x71b6,
- 0x2001, 0x7000, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5533, 0x7007,
- 0x0005, 0x0078, 0x5535, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
+ 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x528d, 0x0e7e, 0x2071, 0x6db0,
+ 0x2001, 0x6c00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x52ab, 0x7007,
+ 0x0005, 0x0078, 0x52ad, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x71b6, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x5575, 0x2200, 0xac06, 0x00c0, 0x5570, 0x7038, 0xac36, 0x00c0,
- 0x5553, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5561, 0x2c00,
- 0xaf36, 0x0040, 0x555f, 0x2f00, 0x7036, 0x0078, 0x5561, 0x7037,
- 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5569, 0x7e0e, 0x0078,
- 0x556a, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5575,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5546, 0x127f, 0x007f, 0x027f,
+ 0x2071, 0x6db0, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
+ 0x52ed, 0x2200, 0xac06, 0x00c0, 0x52e8, 0x7038, 0xac36, 0x00c0,
+ 0x52cb, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x52d9, 0x2c00,
+ 0xaf36, 0x0040, 0x52d7, 0x2f00, 0x7036, 0x0078, 0x52d9, 0x7037,
+ 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x52e1, 0x7e0e, 0x0078,
+ 0x52e2, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x52ed,
+ 0x2c78, 0x600c, 0x2060, 0x0078, 0x52be, 0x127f, 0x007f, 0x027f,
0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6,
- 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x560e, 0x6018, 0xa080,
- 0x0028, 0x2004, 0xa206, 0x00c0, 0x5609, 0x7024, 0xac06, 0x00c0,
- 0x55bc, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x55bc, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x55b3, 0x6803,
+ 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0,
+ 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5386, 0x6018, 0xa080,
+ 0x0028, 0x2004, 0xa206, 0x00c0, 0x5381, 0x7024, 0xac06, 0x00c0,
+ 0x5334, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5334, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e,
+ 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x532b, 0x6803,
0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x55bb, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x55c2,
- 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x55d0, 0x2c00, 0xaf36,
- 0x0040, 0x55ce, 0x2f00, 0x700a, 0x0078, 0x55d0, 0x700b, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x55d9, 0x7e0e, 0x0078,
- 0x55da, 0x2678, 0x600f, 0x0000, 0x1078, 0x6470, 0x00c0, 0x55e4,
- 0x1078, 0x21c6, 0x0078, 0x5600, 0x1078, 0x6484, 0x00c0, 0x55ec,
- 0x1078, 0x58f2, 0x0078, 0x5600, 0x6010, 0x2068, 0x1078, 0x6336,
- 0x0040, 0x5600, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5616, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x6003, 0x0000, 0x1078, 0x6457, 0x1078, 0x53f5, 0x0c7f, 0x0078,
- 0x558b, 0x2c78, 0x600c, 0x2060, 0x0078, 0x558b, 0x127f, 0x007f,
+ 0x5333, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x533a,
+ 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x5348, 0x2c00, 0xaf36,
+ 0x0040, 0x5346, 0x2f00, 0x700a, 0x0078, 0x5348, 0x700b, 0x0000,
+ 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5351, 0x7e0e, 0x0078,
+ 0x5352, 0x2678, 0x600f, 0x0000, 0x1078, 0x6101, 0x00c0, 0x535c,
+ 0x1078, 0x2143, 0x0078, 0x5378, 0x1078, 0x6115, 0x00c0, 0x5364,
+ 0x1078, 0x5614, 0x0078, 0x5378, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x5378, 0x601c, 0xa086, 0x0003, 0x00c0, 0x538e, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x6003, 0x0000, 0x1078, 0x60e8, 0x1078, 0x516d, 0x0c7f, 0x0078,
+ 0x5303, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5303, 0x127f, 0x007f,
0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x55f7, 0x1078, 0x6e8b, 0x0078, 0x5600, 0x037e,
+ 0x0006, 0x00c0, 0x536f, 0x1078, 0x6ac6, 0x0078, 0x5378, 0x037e,
0x157e, 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c,
- 0xa39e, 0x20a0, 0x00c0, 0x5630, 0x8210, 0x8000, 0x0078, 0x5627,
- 0xa005, 0x0040, 0x563a, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
- 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200, 0x20a3, 0x0014,
- 0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c,
- 0x20a3, 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004,
- 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x509c,
- 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0210,
- 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x509c, 0x007c, 0x2061,
- 0x7600, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7600, 0x007c, 0x0e7e,
- 0x127e, 0x2071, 0x7000, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
- 0x0048, 0x56c1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x56ad, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x56a9, 0x0078,
- 0x569c, 0x2061, 0x7600, 0x0078, 0x569c, 0x6003, 0x0008, 0x8529,
- 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x56bd, 0x754a,
- 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7600, 0x0078,
- 0x56b8, 0xa006, 0x0078, 0x56ba, 0x0e7e, 0x2071, 0x7000, 0x7544,
- 0xa582, 0x0001, 0x0048, 0x56f2, 0x7048, 0x2060, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x56df, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
- 0x56db, 0x0078, 0x56ce, 0x2061, 0x7600, 0x0078, 0x56ce, 0x6003,
+ 0xa39e, 0x201d, 0x00c0, 0x53a8, 0x8210, 0x8000, 0x0078, 0x539f,
+ 0xa005, 0x0040, 0x53b2, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
+ 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x2061,
+ 0x7200, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7200, 0x007c, 0x0e7e,
+ 0x127e, 0x2071, 0x6c00, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
+ 0x0048, 0x53f1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x53dd, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x53d9, 0x0078,
+ 0x53cc, 0x2061, 0x7200, 0x0078, 0x53cc, 0x6003, 0x0008, 0x8529,
+ 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x53ed, 0x754a,
+ 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7200, 0x0078,
+ 0x53e8, 0xa006, 0x0078, 0x53ea, 0x0e7e, 0x2071, 0x6c00, 0x7544,
+ 0xa582, 0x0001, 0x0048, 0x5422, 0x7048, 0x2060, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x540f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x540b, 0x0078, 0x53fe, 0x2061, 0x7200, 0x0078, 0x53fe, 0x6003,
0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8,
- 0x56ee, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7600,
- 0x0078, 0x56ea, 0xa006, 0x0078, 0x56ec, 0xac82, 0x7600, 0x1048,
- 0x1288, 0x2001, 0x7015, 0x2004, 0xac02, 0x10c8, 0x1288, 0xa006,
+ 0x541e, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7200,
+ 0x0078, 0x541a, 0xa006, 0x0078, 0x541c, 0xac82, 0x7200, 0x1048,
+ 0x126a, 0x2001, 0x6c15, 0x2004, 0xac02, 0x10c8, 0x126a, 0xa006,
0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
- 0x6003, 0x0000, 0x2061, 0x7000, 0x6044, 0x8000, 0x6046, 0xa086,
- 0x0001, 0x0040, 0x5714, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x49b7, 0x127f, 0x0078, 0x5713, 0x601c, 0xa084, 0x0007, 0x0079,
- 0x5721, 0x5729, 0x5731, 0x574d, 0x5769, 0x6501, 0x651d, 0x6539,
- 0x5729, 0xa18e, 0x0047, 0x00c0, 0x5730, 0xa016, 0x1078, 0x1525,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x573b, 0x067f, 0x007c, 0x574b, 0x5816, 0x5901, 0x574b, 0x574b,
- 0x574b, 0x574b, 0x574b, 0x57c5, 0x5b83, 0x574b, 0x574b, 0x574b,
- 0x574b, 0x574b, 0x574b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x5757, 0x067f, 0x007c, 0x5767,
- 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5ff3,
- 0x60b9, 0x5767, 0x600c, 0x6065, 0x600c, 0x6065, 0x5767, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x5773, 0x067f, 0x007c, 0x5783, 0x5bc1, 0x5c67, 0x5d29, 0x5e7d,
- 0x5783, 0x5783, 0x5783, 0x5b9f, 0x5fa8, 0x5fac, 0x5783, 0x5783,
- 0x5783, 0x5783, 0x5fd2, 0x1078, 0x1288, 0x20a9, 0x000e, 0x2e98,
+ 0x6003, 0x0000, 0x2061, 0x6c00, 0x6044, 0x8000, 0x6046, 0xa086,
+ 0x0001, 0x0040, 0x5444, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x0078, 0x5443, 0x601c, 0xa084, 0x0007, 0x0079,
+ 0x5451, 0x5459, 0x5461, 0x547d, 0x5499, 0x6186, 0x61a2, 0x61be,
+ 0x5459, 0xa18e, 0x0047, 0x00c0, 0x5460, 0xa016, 0x1078, 0x1505,
+ 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079,
+ 0x546b, 0x067f, 0x007c, 0x547b, 0x5540, 0x5623, 0x547b, 0x547b,
+ 0x547b, 0x547b, 0x547b, 0x54f5, 0x58a5, 0x547b, 0x547b, 0x547b,
+ 0x547b, 0x547b, 0x547b, 0x1078, 0x126a, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x126a, 0x1079, 0x5487, 0x067f, 0x007c, 0x5497,
+ 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5c9f,
+ 0x5d63, 0x5497, 0x5cb8, 0x5d11, 0x5cb8, 0x5d11, 0x5497, 0x1078,
+ 0x126a, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079,
+ 0x54a3, 0x067f, 0x007c, 0x54b3, 0x58e3, 0x5969, 0x5a2b, 0x5b54,
+ 0x54b3, 0x54b3, 0x54b3, 0x58c1, 0x5c54, 0x5c58, 0x54b3, 0x54b3,
+ 0x54b3, 0x54b3, 0x5c7e, 0x1078, 0x126a, 0x20a9, 0x000e, 0x2e98,
0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5793, 0x0e7e,
- 0x1078, 0x6336, 0x0040, 0x57aa, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x0d7e, 0x20a9,
+ 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x54c3, 0x0e7e,
+ 0x1078, 0x5fcd, 0x0040, 0x54da, 0x6010, 0x2070, 0x7007, 0x0000,
+ 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5425, 0x007c, 0x0d7e, 0x20a9,
0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0,
- 0x57c2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
- 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x579f, 0x2100, 0xa1b2, 0x0030,
- 0x10c8, 0x1288, 0x0079, 0x57cc, 0x57fe, 0x580a, 0x57fe, 0x57fe,
- 0x57fe, 0x57fe, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fe, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fe, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x1078, 0x1288, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x45af, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x45af, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f, 0x007c, 0x6004, 0xa0b2,
- 0x0030, 0x10c8, 0x1288, 0xa1b6, 0x0013, 0x00c0, 0x5822, 0x2008,
- 0x0079, 0x587a, 0xa1b6, 0x0027, 0x00c0, 0x5860, 0x1078, 0x48be,
- 0x6004, 0x1078, 0x6470, 0x0040, 0x5833, 0x1078, 0x6484, 0x0040,
- 0x585c, 0x0078, 0x5857, 0x1078, 0x21c6, 0x2001, 0x0007, 0x1078,
- 0x34a2, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x469f, 0x1078, 0x45e2, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x584e, 0x1078, 0x36e4, 0x0c7f, 0x2c08,
- 0x1078, 0x6d09, 0x037f, 0x027f, 0x017f, 0x1078, 0x34e2, 0x1078,
- 0x56f5, 0x1078, 0x49b7, 0x007c, 0x1078, 0x58f2, 0x0078, 0x5857,
- 0xa186, 0x0014, 0x00c0, 0x585b, 0x1078, 0x48be, 0x1078, 0x21a8,
- 0x1078, 0x6470, 0x00c0, 0x5870, 0x1078, 0x21c6, 0x0078, 0x5857,
- 0x1078, 0x6484, 0x00c0, 0x5878, 0x1078, 0x58f2, 0x0078, 0x5857,
- 0x0078, 0x5857, 0x58ac, 0x58ae, 0x58b2, 0x58b6, 0x58ba, 0x58be,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58c2, 0x58c8, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58c8, 0x58c8, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x1078, 0x1288, 0x0078, 0x58c8, 0x2001, 0x000b,
- 0x0078, 0x58d1, 0x2001, 0x0003, 0x0078, 0x58d1, 0x2001, 0x0005,
- 0x0078, 0x58d1, 0x2001, 0x0001, 0x0078, 0x58d1, 0x2001, 0x0009,
- 0x0078, 0x58d1, 0x1078, 0x1288, 0x0078, 0x58d0, 0x1078, 0x34a2,
- 0x1078, 0x48be, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x49b7,
- 0x007c, 0x1078, 0x34a2, 0x1078, 0x48be, 0x6003, 0x0002, 0x037e,
- 0x2019, 0x705c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x58e3, 0x2019,
- 0x0028, 0x0078, 0x58ec, 0x8007, 0xa09a, 0x0004, 0x0048, 0x58df,
- 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x49b7,
- 0x0078, 0x58d0, 0x0e7e, 0x1078, 0x6336, 0x0040, 0x58ff, 0x6010,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f,
- 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x1288, 0x6604, 0xa6b6, 0x0028, 0x00c0,
- 0x5915, 0x1078, 0x64b9, 0x0078, 0x593e, 0x6604, 0xa6b6, 0x0029,
- 0x00c0, 0x591e, 0x1078, 0x64d3, 0x0078, 0x593e, 0x6604, 0xa6b6,
- 0x001f, 0x00c0, 0x5927, 0x1078, 0x5785, 0x0078, 0x593e, 0x6604,
- 0xa6b6, 0x0000, 0x00c0, 0x5930, 0x1078, 0x57ae, 0x0078, 0x593e,
- 0xa1b6, 0x0015, 0x00c0, 0x5938, 0x1079, 0x5943, 0x0078, 0x593e,
- 0xa1b6, 0x0016, 0x00c0, 0x593f, 0x1079, 0x5a0c, 0x007c, 0x1078,
- 0x5729, 0x0078, 0x593e, 0x594f, 0x5952, 0x594f, 0x5993, 0x594f,
- 0x59bb, 0x594f, 0x594f, 0x594f, 0x59e4, 0x594f, 0x59fa, 0x0005,
- 0x0005, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x7070, 0xa086, 0x0074,
- 0x00c0, 0x597c, 0x1078, 0x6ce1, 0x00c0, 0x596e, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x5980, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x34a2,
- 0x1078, 0x21c6, 0x1078, 0x56f5, 0x0078, 0x597e, 0x2001, 0x000a,
- 0x1078, 0x34a2, 0x1078, 0x21c6, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x45af, 0x0078, 0x597e, 0x1078, 0x59ab, 0x0e7f, 0x007c,
- 0x6800, 0xd084, 0x0040, 0x5992, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2069, 0x7051, 0x6804, 0xd0a4, 0x0040, 0x5992, 0x2001, 0x0006,
- 0x1078, 0x34b0, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086, 0x0074,
- 0x00c0, 0x59a8, 0x1078, 0x5ad5, 0x2001, 0x0004, 0x1078, 0x34a2,
- 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x45af, 0x0078, 0x59aa,
- 0x1078, 0x59ab, 0x007c, 0x2001, 0x7000, 0x2004, 0xa086, 0x0003,
- 0x0040, 0x59b6, 0x2001, 0x0007, 0x1078, 0x34a2, 0x1078, 0x56f5,
- 0x1078, 0x21c6, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x59e0, 0x7000, 0xa086, 0x0003, 0x00c0, 0x59ca,
- 0x1078, 0x2a92, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3576, 0x1078,
- 0x5980, 0x0d7f, 0x1078, 0x5adf, 0x00c0, 0x59e0, 0x2001, 0x0006,
- 0x1078, 0x34a2, 0x1078, 0x56f5, 0x1078, 0x21c6, 0x0078, 0x59e2,
- 0x1078, 0x59ab, 0x0e7f, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x59f7, 0x2001, 0x0002, 0x1078, 0x34a2, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x59f9, 0x1078,
- 0x59ab, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x5a09, 0x2001, 0x0007, 0x1078, 0x34a2, 0x1078, 0x56f5, 0x0078,
- 0x5a0b, 0x1078, 0x59ab, 0x007c, 0x594f, 0x5a18, 0x594f, 0x5a3e,
- 0x594f, 0x5a8a, 0x594f, 0x594f, 0x594f, 0x5a9d, 0x594f, 0x5ab0,
- 0x0c7e, 0x1078, 0x5ac3, 0x00c0, 0x5a2d, 0x2001, 0x0000, 0x1078,
- 0x348e, 0x2001, 0x0002, 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x45af, 0x0078, 0x5a3c, 0x2009, 0x748f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5a3a, 0x1078, 0x56f5,
- 0x0078, 0x5a3c, 0x1078, 0x59ab, 0x0c7f, 0x007c, 0x1078, 0x5ad2,
- 0x00c0, 0x5a52, 0x2001, 0x0000, 0x1078, 0x348e, 0x2001, 0x0002,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af,
- 0x0078, 0x5a72, 0x2009, 0x748e, 0x2134, 0xa6b4, 0x00ff, 0xa686,
- 0x0005, 0x0040, 0x5a73, 0x2009, 0x748f, 0x2104, 0xa084, 0xff00,
- 0xa086, 0x1900, 0x00c0, 0x5a70, 0xa686, 0x0009, 0x0040, 0x5a73,
- 0x2001, 0x0004, 0x1078, 0x34a2, 0x1078, 0x56f5, 0x0078, 0x5a72,
- 0x1078, 0x59ab, 0x007c, 0x0d7e, 0x6018, 0x2068, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x5a85, 0x8001, 0x6842, 0x6017, 0x000a,
- 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5a72, 0x1078, 0x21a8, 0x0d7f,
- 0x0078, 0x5a70, 0x1078, 0x5ad2, 0x00c0, 0x5a9a, 0x2001, 0x0004,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x45af,
- 0x0078, 0x5a9c, 0x1078, 0x59ab, 0x007c, 0x1078, 0x5ad2, 0x00c0,
- 0x5aad, 0x2001, 0x0008, 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007,
- 0x0005, 0x1078, 0x45af, 0x0078, 0x5aaf, 0x1078, 0x59ab, 0x007c,
- 0x1078, 0x5ad2, 0x00c0, 0x5ac0, 0x2001, 0x000a, 0x1078, 0x34a2,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x5ac2,
- 0x1078, 0x59ab, 0x007c, 0x2009, 0x748e, 0x2104, 0xa086, 0x0003,
- 0x00c0, 0x5ad1, 0x2009, 0x748f, 0x2104, 0xa084, 0xff00, 0xa086,
- 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88,
- 0x0006, 0x2164, 0x1078, 0x350c, 0x017f, 0x0c7f, 0x007c, 0x0e7e,
- 0x2071, 0x748c, 0x7004, 0xa086, 0x0014, 0x00c0, 0x5b02, 0x7008,
- 0xa086, 0x0800, 0x00c0, 0x5b02, 0x700c, 0xd0ec, 0x0040, 0x5b00,
- 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x5b00, 0x7024, 0xd0a4,
- 0x0040, 0x5b00, 0xd08c, 0x0040, 0x5b00, 0xa006, 0x0078, 0x5b02,
- 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e,
- 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2029,
- 0x71bf, 0x252c, 0x2021, 0x71c5, 0x2424, 0x2061, 0x7600, 0x2071,
- 0x7000, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5b59, 0x1078, 0x6ee7,
- 0x0040, 0x5b51, 0x671c, 0xa786, 0x0001, 0x0040, 0x5b51, 0xa786,
- 0x0007, 0x0040, 0x5b51, 0x2500, 0xac06, 0x0040, 0x5b51, 0x2400,
- 0xac06, 0x0040, 0x5b51, 0x0c7e, 0x6000, 0xa086, 0x0004, 0x00c0,
- 0x5b3b, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x5b4e, 0xa786, 0x0003, 0x00c0, 0x5b63, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a, 0x1078, 0x6457,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b59, 0x0078,
- 0x5b19, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, 0x077f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x5b45, 0x1078,
- 0x6e8b, 0x0078, 0x5b4e, 0x220c, 0x2304, 0xa106, 0x00c0, 0x5b76,
- 0x8210, 0x8318, 0x00f0, 0x5b6b, 0xa006, 0x007c, 0x2304, 0xa102,
- 0x0048, 0x5b7e, 0x2001, 0x0001, 0x0078, 0x5b80, 0x2001, 0x0000,
- 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288,
- 0x1078, 0x6470, 0x0040, 0x5b92, 0x1078, 0x6484, 0x0040, 0x5b9b,
- 0x0078, 0x5b94, 0x1078, 0x21c6, 0x1078, 0x48be, 0x1078, 0x56f5,
- 0x1078, 0x49b7, 0x007c, 0x1078, 0x58f2, 0x0078, 0x5b94, 0xa182,
- 0x0040, 0x0079, 0x5ba3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3,
- 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb5, 0x5bb5,
- 0x5bb5, 0x5bb5, 0x5bb3, 0x1078, 0x1288, 0x6003, 0x0001, 0x6106,
- 0x1078, 0x4562, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f,
- 0x007c, 0xa186, 0x0013, 0x00c0, 0x5bca, 0x6004, 0xa082, 0x0040,
- 0x0079, 0x5c40, 0xa186, 0x0027, 0x00c0, 0x5be7, 0x1078, 0x48be,
- 0x1078, 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6336, 0x0040,
- 0x5be1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3840, 0x1078,
- 0x644a, 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0xa186,
- 0x0014, 0x00c0, 0x5bf0, 0x6004, 0xa082, 0x0040, 0x0079, 0x5c10,
- 0xa186, 0x0047, 0x10c0, 0x1288, 0x2001, 0x0109, 0x2004, 0xd084,
- 0x0040, 0x5c0d, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e,
- 0x1078, 0x4423, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x5c0d, 0x0078, 0x5c67, 0x1078, 0x5729, 0x007c,
- 0x5c22, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20,
- 0x5c20, 0x5c20, 0x5c20, 0x5c39, 0x5c39, 0x5c39, 0x5c39, 0x5c20,
- 0x1078, 0x1288, 0x1078, 0x48be, 0x0d7e, 0x6110, 0x2168, 0x1078,
- 0x6336, 0x0040, 0x5c33, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
- 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x49b7,
- 0x007c, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c,
- 0x5c52, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50,
- 0x5c50, 0x5c50, 0x5c50, 0x5c60, 0x5c60, 0x5c60, 0x5c60, 0x5c50,
- 0x1078, 0x1288, 0x1078, 0x48be, 0x6003, 0x0002, 0x1078, 0x49b7,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c,
- 0x1078, 0x48be, 0x6003, 0x000f, 0x1078, 0x49b7, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x5c6b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b,
- 0x5c7d, 0x5d06, 0x5d1e, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b,
- 0x5c7b, 0x5c7b, 0x5c7b, 0x1078, 0x1288, 0x0e7e, 0x0d7e, 0x2071,
- 0x748c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040,
- 0x5cea, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5caf, 0xa186,
- 0x0028, 0x00c0, 0x5c99, 0x1078, 0x645e, 0x684b, 0x001c, 0x0078,
- 0x5cb1, 0xd6dc, 0x0040, 0x5ca4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5cb1, 0xd6d4, 0x0040, 0x5caf, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5cb1, 0x684b,
- 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5cc4,
- 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7498, 0xad90,
- 0x0019, 0x1078, 0x6128, 0x037f, 0xd6cc, 0x0040, 0x5cfa, 0x7124,
- 0x695a, 0xa192, 0x0021, 0x00c8, 0x5cd8, 0x2071, 0x7498, 0x831c,
- 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6128, 0x0078, 0x5cfa,
- 0x6838, 0xd0fc, 0x0040, 0x5ce1, 0x2009, 0x0020, 0x695a, 0x0078,
- 0x5ccd, 0x0f7e, 0x2d78, 0x1078, 0x60c0, 0x0f7f, 0x1078, 0x6115,
- 0x0078, 0x5cfc, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c,
- 0xd0ac, 0x0040, 0x5cfa, 0x6810, 0x6914, 0xa115, 0x0040, 0x5cfa,
- 0x1078, 0x5e6e, 0x1078, 0x3840, 0x6218, 0x2268, 0x6a3c, 0x8211,
- 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x748c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x45ce, 0x1078, 0x4a67, 0x007c, 0x6003, 0x0004,
- 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x5d2d, 0x5d3d, 0x5d3d, 0x5d3d,
- 0x5d3d, 0x5d3d, 0x5d3f, 0x5dd6, 0x5d3d, 0x5d3d, 0x5dec, 0x5e4e,
- 0x5d3d, 0x5d3d, 0x5d3d, 0x5d3d, 0x5e55, 0x1078, 0x1288, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x748c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5dd1, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x5d60, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x5dd1, 0x1078, 0x12e2, 0x1040, 0x1288,
- 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838,
- 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x5d9a, 0xa186, 0x0028, 0x00c0, 0x5d84,
- 0x684b, 0x001c, 0x0078, 0x5d9c, 0xd6dc, 0x0040, 0x5d8f, 0x684b,
- 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d9c, 0xd6d4,
- 0x0040, 0x5d9a, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e,
- 0x0078, 0x5d9c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
- 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5db1, 0x7328, 0x732c, 0x6b56,
- 0x037e, 0x2308, 0x2019, 0x7498, 0xad90, 0x0019, 0x1078, 0x6128,
- 0x037f, 0xd6cc, 0x0040, 0x5dd1, 0x7124, 0x695a, 0xa192, 0x0021,
- 0x00c8, 0x5dc5, 0x2071, 0x7498, 0x831c, 0x2300, 0xae18, 0xad90,
- 0x001d, 0x1078, 0x6128, 0x0078, 0x5dd1, 0x7838, 0xd0fc, 0x0040,
- 0x5dce, 0x2009, 0x0020, 0x695a, 0x0078, 0x5dba, 0x2d78, 0x1078,
- 0x60c0, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x748c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x5095, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
- 0x4966, 0x1078, 0x4a67, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
- 0x5e4c, 0xd1cc, 0x0040, 0x5e27, 0x6948, 0x6838, 0xd0fc, 0x0040,
- 0x5e1f, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d,
- 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012,
- 0x8318, 0x8210, 0x00f0, 0x5e0e, 0x157f, 0x007f, 0x6852, 0x007f,
- 0x684e, 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5e4a, 0x017e,
- 0x1078, 0x130b, 0x0d7f, 0x1078, 0x6115, 0x0078, 0x5e4a, 0x6837,
- 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5e46,
- 0xa086, 0x0028, 0x00c0, 0x5e38, 0x684b, 0x001c, 0x0078, 0x5e48,
- 0xd1dc, 0x0040, 0x5e3f, 0x684b, 0x0015, 0x0078, 0x5e48, 0xd1d4,
- 0x0040, 0x5e46, 0x684b, 0x0007, 0x0078, 0x5e48, 0x684b, 0x0000,
- 0x1078, 0x3840, 0x1078, 0x56f5, 0x0d7f, 0x007c, 0x6003, 0x0002,
- 0x1078, 0x4966, 0x1078, 0x4a67, 0x007c, 0x1078, 0x4966, 0x1078,
- 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6336, 0x0040, 0x5e68,
- 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x4a67, 0x007c, 0x684b, 0x0015,
- 0xd1fc, 0x0040, 0x5e7a, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a,
- 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x5e81, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e93, 0x5e91,
- 0x5f37, 0x5f3f, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91,
- 0x5e91, 0x1078, 0x1288, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x748c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x5f29, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5eb4,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5f26,
- 0x1078, 0x12e2, 0x1040, 0x1288, 0x2d00, 0x784a, 0x7f4c, 0xa7bd,
- 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e,
- 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
- 0x5eef, 0xa186, 0x0028, 0x00c0, 0x5ed9, 0x684b, 0x001c, 0x0078,
- 0x5ef1, 0xd6dc, 0x0040, 0x5ee4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5ef1, 0xd6d4, 0x0040, 0x5eef, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5ef1, 0x684b,
- 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4,
- 0x0040, 0x5f06, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
- 0x7498, 0xad90, 0x0019, 0x1078, 0x6128, 0x037f, 0xd6cc, 0x0040,
- 0x5f26, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5f1a, 0x2071,
- 0x7498, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6128,
- 0x0078, 0x5f26, 0x7838, 0xd0fc, 0x0040, 0x5f23, 0x2009, 0x0020,
- 0x695a, 0x0078, 0x5f0f, 0x2d78, 0x1078, 0x60c0, 0xd6dc, 0x00c0,
- 0x5f2c, 0xa006, 0x0078, 0x5f30, 0x2001, 0x0001, 0x7218, 0x731c,
- 0x1078, 0x1569, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0x0d7e,
- 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5fa6,
- 0xd1cc, 0x0040, 0x5f76, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x5f6e,
- 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198,
- 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x5f5d, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e,
- 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5fa4, 0x017e, 0x1078,
- 0x130b, 0x0d7f, 0x1078, 0x6115, 0x0078, 0x5fa4, 0x6837, 0x0103,
- 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5f95, 0xa086,
- 0x0028, 0x00c0, 0x5f87, 0x684b, 0x001c, 0x0078, 0x5fa2, 0xd1dc,
- 0x0040, 0x5f8e, 0x684b, 0x0015, 0x0078, 0x5fa2, 0xd1d4, 0x0040,
- 0x5f95, 0x684b, 0x0007, 0x0078, 0x5fa2, 0x684b, 0x0000, 0x684c,
- 0xd0ac, 0x0040, 0x5fa2, 0x6810, 0x6914, 0xa115, 0x0040, 0x5fa2,
- 0x1078, 0x5e6e, 0x1078, 0x3840, 0x1078, 0x56f5, 0x0d7f, 0x007c,
- 0x1078, 0x48be, 0x0078, 0x5fae, 0x1078, 0x4966, 0x1078, 0x6336,
- 0x0040, 0x5fc5, 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009,
- 0x700c, 0x210c, 0xd18c, 0x00c0, 0x5fce, 0xd184, 0x00c0, 0x5fca,
- 0x6108, 0x694a, 0x1078, 0x3840, 0x0d7f, 0x1078, 0x56f5, 0x1078,
- 0x49b7, 0x007c, 0x684b, 0x0004, 0x0078, 0x5fc2, 0x684b, 0x0004,
- 0x0078, 0x5fc2, 0xa182, 0x0040, 0x0079, 0x5fd6, 0x5fe6, 0x5fe6,
- 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe8, 0x5fe6, 0x5feb, 0x5fe6, 0x5fe6,
- 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x1078, 0x1288,
- 0x1078, 0x56f5, 0x007c, 0x007e, 0x027e, 0xa016, 0x1078, 0x1525,
- 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, 0x5ff7, 0x6000,
- 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x1078, 0x1288,
- 0x6003, 0x0001, 0x6106, 0x1078, 0x4562, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x49b7, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6016,
- 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x604a, 0xa186, 0x0027,
- 0x00c0, 0x6037, 0x1078, 0x48be, 0x1078, 0x21a8, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6336, 0x0040, 0x602d, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5,
- 0x1078, 0x49b7, 0x007c, 0x1078, 0x5729, 0x0078, 0x6032, 0xa186,
- 0x0014, 0x00c0, 0x6033, 0x1078, 0x48be, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6336, 0x0040, 0x602d, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x0078, 0x6029, 0x6053, 0x6051, 0x6051, 0x6051, 0x6051, 0x6051,
- 0x605c, 0x1078, 0x1288, 0x1078, 0x48be, 0x6017, 0x0014, 0x6003,
- 0x000c, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be, 0x6017, 0x0014,
- 0x6003, 0x000e, 0x1078, 0x49b7, 0x007c, 0xa182, 0x008c, 0x00c8,
- 0x606f, 0xa182, 0x0085, 0x0048, 0x606f, 0x0079, 0x6072, 0x1078,
- 0x5729, 0x007c, 0x6079, 0x6079, 0x6079, 0x6079, 0x607b, 0x609a,
- 0x6079, 0x1078, 0x1288, 0x0d7e, 0x1078, 0x644a, 0x1078, 0x6336,
- 0x0040, 0x6096, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4,
- 0x0040, 0x608e, 0x684b, 0x0006, 0x0078, 0x6092, 0x684b, 0x0005,
- 0x1078, 0x64fd, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x56f5,
- 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x60b5, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x60ab, 0x684b,
- 0x0006, 0x0078, 0x60af, 0x684b, 0x0005, 0x1078, 0x64fd, 0x6847,
- 0x0000, 0x1078, 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5,
- 0x007c, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c,
- 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, 0x0101,
- 0x00c8, 0x60cc, 0x0078, 0x60ce, 0x2009, 0x0100, 0x2130, 0x2069,
- 0x7498, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d,
- 0x1078, 0x6128, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, 0x60e2,
- 0x1078, 0x130b, 0x1078, 0x12e2, 0x0040, 0x610c, 0x8528, 0x6837,
- 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x00c8,
- 0x60f8, 0x2608, 0xad90, 0x000f, 0x1078, 0x6128, 0x0078, 0x610c,
- 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, 0x1078,
- 0x6128, 0x0078, 0x60e2, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36,
- 0xa5ac, 0x0000, 0x0078, 0x6111, 0x0f7f, 0x852f, 0xa5ad, 0x0003,
- 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, 0x0040,
- 0x6126, 0x6804, 0xa07d, 0x0040, 0x6124, 0x6807, 0x0000, 0x1078,
- 0x3840, 0x2f68, 0x0078, 0x6119, 0x1078, 0x3840, 0x0f7f, 0x007c,
- 0x157e, 0xa184, 0x0001, 0x0040, 0x612e, 0x8108, 0x810c, 0x21a8,
- 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6130, 0x157f,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6143, 0x127f, 0x007c, 0x6152, 0x614b, 0x614d, 0x616b, 0x614b,
- 0x614d, 0x614d, 0x614d, 0x1078, 0x1288, 0xa006, 0x007c, 0xa085,
- 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x6168, 0xa00e, 0x2001, 0x0005, 0x1078, 0x38d0, 0x1078, 0x64fd,
- 0x1078, 0x3840, 0x1078, 0x56f5, 0xa085, 0x0001, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x6166, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288,
- 0x1079, 0x6173, 0x007c, 0x6183, 0x61a0, 0x6185, 0x61b1, 0x619c,
- 0x6183, 0x614d, 0x6152, 0x6152, 0x614d, 0x614d, 0x614d, 0x614d,
- 0x614d, 0x614d, 0x614d, 0x1078, 0x1288, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6336, 0x0040, 0x618e, 0x1078, 0x64fd, 0x0d7f, 0x6007,
- 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x4562, 0x1078,
- 0x49b7, 0xa085, 0x0001, 0x007c, 0x1078, 0x1629, 0x0078, 0x6185,
- 0x0e7e, 0x2071, 0x71b6, 0x7024, 0xac06, 0x00c0, 0x61a9, 0x1078,
- 0x51c9, 0x1078, 0x5139, 0x0e7f, 0x00c0, 0x6185, 0x1078, 0x614d,
- 0x007c, 0x037e, 0x0e7e, 0x2071, 0x71b6, 0x703c, 0xac06, 0x00c0,
- 0x61c1, 0x2019, 0x0000, 0x1078, 0x525b, 0x0e7f, 0x037f, 0x0078,
- 0x6185, 0x1078, 0x5537, 0x0e7f, 0x037f, 0x00c0, 0x6185, 0x1078,
- 0x614d, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x61d2,
- 0x0c7f, 0x007c, 0x61e0, 0x623d, 0x62da, 0x61e4, 0x61e0, 0x61e0,
- 0x6b6f, 0x56f5, 0x1078, 0x6484, 0x00c0, 0x61e0, 0x1078, 0x58f2,
+ 0x54f2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
+ 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x54cf, 0x2100, 0xa1b2, 0x002a,
+ 0x10c8, 0x126a, 0x0079, 0x54fc, 0x5528, 0x5534, 0x5528, 0x5528,
+ 0x5528, 0x5528, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5528, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5528, 0x5526, 0x1078, 0x126a,
+ 0x6003, 0x0001, 0x6106, 0x1078, 0x4311, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x4713, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x4311, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c,
+ 0x6004, 0xa0b2, 0x002a, 0x10c8, 0x126a, 0xa1b6, 0x0013, 0x00c0,
+ 0x554c, 0x2008, 0x0079, 0x55a2, 0xa1b6, 0x0027, 0x00c0, 0x558a,
+ 0x1078, 0x461a, 0x6004, 0x1078, 0x6101, 0x0040, 0x555d, 0x1078,
+ 0x6115, 0x0040, 0x5586, 0x0078, 0x5581, 0x1078, 0x2143, 0x2001,
+ 0x0007, 0x1078, 0x3316, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e,
+ 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x5578, 0x1078, 0x34f2,
+ 0x0c7f, 0x2c08, 0x1078, 0x6946, 0x037f, 0x027f, 0x017f, 0x1078,
+ 0x3352, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078, 0x5614,
+ 0x0078, 0x5581, 0xa186, 0x0014, 0x1078, 0x461a, 0x1078, 0x2125,
+ 0x1078, 0x6101, 0x00c0, 0x5598, 0x1078, 0x2143, 0x0078, 0x5581,
+ 0x1078, 0x6115, 0x00c0, 0x55a0, 0x1078, 0x5614, 0x0078, 0x5581,
+ 0x0078, 0x5581, 0x55ce, 0x55d0, 0x55d4, 0x55d8, 0x55dc, 0x55e0,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55e4, 0x55ea, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55ea, 0x55ea, 0x1078, 0x126a, 0x0078, 0x55ea,
+ 0x2001, 0x000b, 0x0078, 0x55f3, 0x2001, 0x0003, 0x0078, 0x55f3,
+ 0x2001, 0x0005, 0x0078, 0x55f3, 0x2001, 0x0001, 0x0078, 0x55f3,
+ 0x2001, 0x0009, 0x0078, 0x55f3, 0x1078, 0x126a, 0x0078, 0x55f2,
+ 0x1078, 0x3316, 0x1078, 0x461a, 0x6003, 0x0002, 0x6017, 0x0028,
+ 0x1078, 0x4713, 0x007c, 0x1078, 0x3316, 0x1078, 0x461a, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6c5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x5605, 0x2019, 0x0028, 0x0078, 0x560e, 0x8007, 0xa09a, 0x0004,
+ 0x0048, 0x5601, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
+ 0x1078, 0x4713, 0x0078, 0x55f2, 0x0e7e, 0x1078, 0x5fcd, 0x0040,
+ 0x5621, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0100, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
+ 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x126a, 0x6604, 0xa6b6,
+ 0x0028, 0x00c0, 0x5637, 0x1078, 0x614a, 0x0078, 0x5660, 0x6604,
+ 0xa6b6, 0x0029, 0x00c0, 0x5640, 0x1078, 0x6164, 0x0078, 0x5660,
+ 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5649, 0x1078, 0x54b5, 0x0078,
+ 0x5660, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5652, 0x1078, 0x54de,
+ 0x0078, 0x5660, 0xa1b6, 0x0015, 0x00c0, 0x565a, 0x1079, 0x5665,
+ 0x0078, 0x5660, 0xa1b6, 0x0016, 0x00c0, 0x5661, 0x1079, 0x572e,
+ 0x007c, 0x1078, 0x5459, 0x0078, 0x5660, 0x5671, 0x5674, 0x5671,
+ 0x56b5, 0x5671, 0x56dd, 0x5671, 0x5671, 0x5671, 0x5706, 0x5671,
+ 0x571c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6c00, 0x7070,
+ 0xa086, 0x0074, 0x00c0, 0x569e, 0x1078, 0x691e, 0x00c0, 0x5690,
+ 0x0d7e, 0x6018, 0x2068, 0x1078, 0x56a2, 0x0d7f, 0x2001, 0x0006,
+ 0x1078, 0x3316, 0x1078, 0x2143, 0x1078, 0x5425, 0x0078, 0x56a0,
+ 0x2001, 0x000a, 0x1078, 0x3316, 0x1078, 0x2143, 0x6003, 0x0001,
+ 0x6007, 0x0001, 0x1078, 0x4311, 0x0078, 0x56a0, 0x1078, 0x56cd,
+ 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x56b4, 0x2001, 0x0000,
+ 0x1078, 0x3302, 0x2069, 0x6c51, 0x6804, 0xd0a4, 0x0040, 0x56b4,
+ 0x2001, 0x0006, 0x1078, 0x3324, 0x007c, 0x2011, 0x6c1c, 0x2204,
+ 0xa086, 0x0074, 0x00c0, 0x56ca, 0x1078, 0x57f7, 0x2001, 0x0004,
+ 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4311,
+ 0x0078, 0x56cc, 0x1078, 0x56cd, 0x007c, 0x2001, 0x6c00, 0x2004,
+ 0xa086, 0x0003, 0x0040, 0x56d8, 0x2001, 0x0007, 0x1078, 0x3316,
+ 0x1078, 0x5425, 0x1078, 0x2143, 0x007c, 0x0e7e, 0x2071, 0x6c00,
+ 0x7070, 0xa086, 0x0014, 0x00c0, 0x5702, 0x7000, 0xa086, 0x0003,
+ 0x00c0, 0x56ec, 0x1078, 0x29a0, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x33ed, 0x1078, 0x56a2, 0x0d7f, 0x1078, 0x5801, 0x00c0, 0x5702,
+ 0x2001, 0x0006, 0x1078, 0x3316, 0x1078, 0x5425, 0x1078, 0x2143,
+ 0x0078, 0x5704, 0x1078, 0x56cd, 0x0e7f, 0x007c, 0x2011, 0x6c1c,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x5719, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311, 0x0078,
+ 0x571b, 0x1078, 0x56cd, 0x007c, 0x2011, 0x6c1c, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x572b, 0x2001, 0x0007, 0x1078, 0x3316, 0x1078,
+ 0x5425, 0x0078, 0x572d, 0x1078, 0x56cd, 0x007c, 0x5671, 0x573a,
+ 0x5671, 0x5760, 0x5671, 0x57ac, 0x5671, 0x5671, 0x5671, 0x57bf,
+ 0x5671, 0x57d2, 0x0c7e, 0x1078, 0x57e5, 0x00c0, 0x574f, 0x2001,
+ 0x0000, 0x1078, 0x3302, 0x2001, 0x0002, 0x1078, 0x3316, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x0078, 0x575e, 0x2009,
+ 0x708f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x575c,
+ 0x1078, 0x5425, 0x0078, 0x575e, 0x1078, 0x56cd, 0x0c7f, 0x007c,
+ 0x1078, 0x57f4, 0x00c0, 0x5774, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x2001, 0x0002, 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4311, 0x0078, 0x5794, 0x2009, 0x708e, 0x2134, 0xa6b4,
+ 0x00ff, 0xa686, 0x0005, 0x0040, 0x5795, 0x2009, 0x708f, 0x2104,
+ 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5792, 0xa686, 0x0009,
+ 0x0040, 0x5795, 0x2001, 0x0004, 0x1078, 0x3316, 0x1078, 0x5425,
+ 0x0078, 0x5794, 0x1078, 0x56cd, 0x007c, 0x0d7e, 0x6018, 0x2068,
+ 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x57a7, 0x8001, 0x6842,
+ 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5794, 0x1078,
+ 0x2125, 0x0d7f, 0x0078, 0x5792, 0x1078, 0x57f4, 0x00c0, 0x57bc,
+ 0x2001, 0x0004, 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0003,
+ 0x1078, 0x4311, 0x0078, 0x57be, 0x1078, 0x56cd, 0x007c, 0x1078,
+ 0x57f4, 0x00c0, 0x57cf, 0x2001, 0x0008, 0x1078, 0x3316, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4311, 0x0078, 0x57d1, 0x1078,
+ 0x56cd, 0x007c, 0x1078, 0x57f4, 0x00c0, 0x57e2, 0x2001, 0x000a,
+ 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311,
+ 0x0078, 0x57e4, 0x1078, 0x56cd, 0x007c, 0x2009, 0x708e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x57f3, 0x2009, 0x708f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x337c, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x708c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x5824, 0x7008, 0xa086, 0x0800, 0x00c0, 0x5824, 0x700c, 0xd0ec,
+ 0x0040, 0x5822, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x5822,
+ 0x7024, 0xd0a4, 0x0040, 0x5822, 0xd08c, 0x0040, 0x5822, 0xa006,
+ 0x0078, 0x5824, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6db9, 0x252c, 0x2021, 0x6dbf, 0x2424, 0x2061,
+ 0x7200, 0x2071, 0x6c00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x587b,
+ 0x1078, 0x6b22, 0x0040, 0x5873, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x5873, 0xa786, 0x0007, 0x0040, 0x5873, 0x2500, 0xac06, 0x0040,
+ 0x5873, 0x2400, 0xac06, 0x0040, 0x5873, 0x0c7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x585d, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x5870, 0xa786, 0x0003, 0x00c0, 0x5885, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x587b, 0x0078, 0x583b, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x5867, 0x1078, 0x6ac6, 0x0078, 0x5870, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5898, 0x8210, 0x8318, 0x00f0, 0x588d, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x58a0, 0x2001, 0x0001, 0x0078, 0x58a2,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x002a,
+ 0x10c8, 0x126a, 0x1078, 0x6101, 0x0040, 0x58b4, 0x1078, 0x6115,
+ 0x0040, 0x58bd, 0x0078, 0x58b6, 0x1078, 0x2143, 0x1078, 0x461a,
+ 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078, 0x5614, 0x0078,
+ 0x58b6, 0xa182, 0x0040, 0x0079, 0x58c5, 0x58d5, 0x58d5, 0x58d5,
+ 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5,
+ 0x58d7, 0x58d7, 0x58d7, 0x58d7, 0x58d5, 0x1078, 0x126a, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x58ec, 0x6004,
+ 0xa082, 0x0040, 0x0079, 0x5942, 0xa186, 0x0027, 0x00c0, 0x5909,
+ 0x1078, 0x461a, 0x1078, 0x2125, 0x0d7e, 0x6110, 0x2168, 0x1078,
+ 0x5fcd, 0x0040, 0x5903, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078,
+ 0x35c4, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713,
+ 0x007c, 0xa186, 0x0014, 0x10c0, 0x126a, 0x6004, 0xa082, 0x0040,
+ 0x0079, 0x5912, 0x5924, 0x5922, 0x5922, 0x5922, 0x5922, 0x5922,
+ 0x5922, 0x5922, 0x5922, 0x5922, 0x5922, 0x593b, 0x593b, 0x593b,
+ 0x593b, 0x5922, 0x1078, 0x126a, 0x1078, 0x461a, 0x0d7e, 0x6110,
+ 0x2168, 0x1078, 0x5fcd, 0x0040, 0x5935, 0x6837, 0x0103, 0x684b,
+ 0x0006, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x5425,
+ 0x1078, 0x4713, 0x007c, 0x1078, 0x461a, 0x1078, 0x5425, 0x1078,
+ 0x4713, 0x007c, 0x5954, 0x5952, 0x5952, 0x5952, 0x5952, 0x5952,
+ 0x5952, 0x5952, 0x5952, 0x5952, 0x5952, 0x5962, 0x5962, 0x5962,
+ 0x5962, 0x5952, 0x1078, 0x126a, 0x1078, 0x461a, 0x6003, 0x0002,
+ 0x1078, 0x4713, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x007c, 0x1078, 0x461a, 0x6003, 0x000f, 0x1078, 0x4713,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x596d, 0x597d, 0x597d, 0x597d,
+ 0x597d, 0x597d, 0x597f, 0x5a08, 0x5a20, 0x597d, 0x597d, 0x597d,
+ 0x597d, 0x597d, 0x597d, 0x597d, 0x597d, 0x1078, 0x126a, 0x0e7e,
+ 0x0d7e, 0x2071, 0x708c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff,
+ 0x86ff, 0x0040, 0x59ec, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x59b1, 0xa186, 0x0028, 0x00c0, 0x599b, 0x1078, 0x60ef, 0x684b,
+ 0x001c, 0x0078, 0x59b3, 0xd6dc, 0x0040, 0x59a6, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x59b3, 0xd6d4, 0x0040,
+ 0x59b1, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x59b3, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4,
+ 0x0040, 0x59c6, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
+ 0x7098, 0xad90, 0x0019, 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040,
+ 0x59fc, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x59da, 0x2071,
+ 0x7098, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2,
+ 0x0078, 0x59fc, 0x6838, 0xd0fc, 0x0040, 0x59e3, 0x2009, 0x0020,
+ 0x695a, 0x0078, 0x59cf, 0x0f7e, 0x2d78, 0x1078, 0x5d6a, 0x0f7f,
+ 0x1078, 0x5dbf, 0x0078, 0x59fe, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x59fc, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x59fc, 0x1078, 0x5b45, 0x1078, 0x35c4, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x5425, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x708c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x18d5, 0x1078, 0x4330, 0x1078, 0x47c3, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1505, 0x007c, 0xa182, 0x0040, 0x0079, 0x5a2f, 0x5a3f,
+ 0x5a3f, 0x5a3f, 0x5a3f, 0x5a3f, 0x5a41, 0x5acf, 0x5a3f, 0x5a3f,
+ 0x5ae5, 0x5b25, 0x5a3f, 0x5a3f, 0x5a3f, 0x5a3f, 0x5b2c, 0x1078,
+ 0x126a, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x708c, 0x6110,
+ 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+ 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5aca,
+ 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5a62, 0x7018, 0x7862,
+ 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5aca, 0x1078, 0x12c2,
+ 0x1040, 0x126a, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837,
+ 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46,
+ 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5a9c, 0xa186, 0x0028,
+ 0x00c0, 0x5a86, 0x684b, 0x001c, 0x0078, 0x5a9e, 0xd6dc, 0x0040,
+ 0x5a91, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5a9e, 0xd6d4, 0x0040, 0x5a9c, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5a9e, 0x684b, 0x0000, 0x6f4e, 0x7850,
+ 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5ab3, 0x7328,
+ 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7098, 0xad90, 0x0019,
+ 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040, 0x5aca, 0x7124, 0x695a,
+ 0xa192, 0x0021, 0x00c8, 0x5ac7, 0x2071, 0x7098, 0x831c, 0x2300,
+ 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2, 0x0078, 0x5aca, 0x2d78,
+ 0x1078, 0x5d6a, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e,
+ 0x6003, 0x0003, 0x2079, 0x708c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+ 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10,
+ 0x1078, 0x18d5, 0x1078, 0x4dfc, 0x007c, 0x0d7e, 0x6003, 0x0002,
+ 0x1078, 0x46c2, 0x1078, 0x47c3, 0x6110, 0x2168, 0x694c, 0xd1e4,
+ 0x0040, 0x5b23, 0xd1cc, 0x0040, 0x5afe, 0x6948, 0x017e, 0x1078,
+ 0x12eb, 0x0d7f, 0x1078, 0x5dbf, 0x0078, 0x5b21, 0x6837, 0x0103,
+ 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5b1d, 0xa086,
+ 0x0028, 0x00c0, 0x5b0f, 0x684b, 0x001c, 0x0078, 0x5b1f, 0xd1dc,
+ 0x0040, 0x5b16, 0x684b, 0x0015, 0x0078, 0x5b1f, 0xd1d4, 0x0040,
+ 0x5b1d, 0x684b, 0x0007, 0x0078, 0x5b1f, 0x684b, 0x0000, 0x1078,
+ 0x35c4, 0x1078, 0x5425, 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078,
+ 0x46c2, 0x1078, 0x47c3, 0x007c, 0x1078, 0x46c2, 0x1078, 0x2125,
+ 0x0d7e, 0x6110, 0x2168, 0x1078, 0x5fcd, 0x0040, 0x5b3f, 0x6837,
+ 0x0103, 0x684b, 0x0029, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f,
+ 0x1078, 0x5425, 0x1078, 0x47c3, 0x007c, 0x684b, 0x0015, 0xd1fc,
+ 0x0040, 0x5b51, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189,
+ 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x5b58,
+ 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b6a, 0x5b68, 0x5c05,
+ 0x5c0d, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68,
+ 0x1078, 0x126a, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x708c,
+ 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5,
+ 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040,
+ 0x5bf7, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5b8b, 0x7018,
+ 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5bf4, 0x1078,
+ 0x12c2, 0x1040, 0x126a, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200,
+ 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
+ 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5bc6,
+ 0xa186, 0x0028, 0x00c0, 0x5bb0, 0x684b, 0x001c, 0x0078, 0x5bc8,
+ 0xd6dc, 0x0040, 0x5bbb, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5bc8, 0xd6d4, 0x0040, 0x5bc6, 0x684b, 0x0007,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5bc8, 0x684b, 0x0000,
+ 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
+ 0x5bdd, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7098,
+ 0xad90, 0x0019, 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040, 0x5bf4,
+ 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5bf1, 0x2071, 0x7098,
+ 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2, 0x0078,
+ 0x5bf4, 0x2d78, 0x1078, 0x5d6a, 0xd6dc, 0x00c0, 0x5bfa, 0xa006,
+ 0x0078, 0x5bfe, 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x1542,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18,
+ 0x3e20, 0x2c10, 0x1078, 0x1505, 0x007c, 0x0d7e, 0x6003, 0x0002,
+ 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5c52, 0xd1cc, 0x0040,
+ 0x5c22, 0x6948, 0x017e, 0x1078, 0x12eb, 0x0d7f, 0x1078, 0x5dbf,
+ 0x0078, 0x5c50, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
+ 0x0002, 0x0040, 0x5c41, 0xa086, 0x0028, 0x00c0, 0x5c33, 0x684b,
+ 0x001c, 0x0078, 0x5c4e, 0xd1dc, 0x0040, 0x5c3a, 0x684b, 0x0015,
+ 0x0078, 0x5c4e, 0xd1d4, 0x0040, 0x5c41, 0x684b, 0x0007, 0x0078,
+ 0x5c4e, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x5c4e, 0x6810,
+ 0x6914, 0xa115, 0x0040, 0x5c4e, 0x1078, 0x5b45, 0x1078, 0x35c4,
+ 0x1078, 0x5425, 0x0d7f, 0x007c, 0x1078, 0x461a, 0x0078, 0x5c5a,
+ 0x1078, 0x46c2, 0x1078, 0x5fcd, 0x0040, 0x5c71, 0x0d7e, 0x6110,
+ 0x2168, 0x6837, 0x0103, 0x2009, 0x6c0c, 0x210c, 0xd18c, 0x00c0,
+ 0x5c7a, 0xd184, 0x00c0, 0x5c76, 0x6108, 0x694a, 0x1078, 0x35c4,
+ 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x684b, 0x0004,
+ 0x0078, 0x5c6e, 0x684b, 0x0004, 0x0078, 0x5c6e, 0xa182, 0x0040,
+ 0x0079, 0x5c82, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c94,
+ 0x5c92, 0x5c97, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92,
+ 0x5c92, 0x5c92, 0x1078, 0x126a, 0x1078, 0x5425, 0x007c, 0x007e,
+ 0x027e, 0xa016, 0x1078, 0x1505, 0x027f, 0x007f, 0x007c, 0xa182,
+ 0x0085, 0x0079, 0x5ca3, 0x5cac, 0x5caa, 0x5caa, 0x5caa, 0x5caa,
+ 0x5caa, 0x5caa, 0x1078, 0x126a, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c,
+ 0xa186, 0x0013, 0x00c0, 0x5cc2, 0x6004, 0xa082, 0x0085, 0x2008,
+ 0x0079, 0x5cf6, 0xa186, 0x0027, 0x00c0, 0x5ce3, 0x1078, 0x461a,
+ 0x1078, 0x2125, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040,
+ 0x5cd9, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x35c4, 0x1078,
+ 0x60db, 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078,
+ 0x5459, 0x0078, 0x5cde, 0xa186, 0x0014, 0x00c0, 0x5cdf, 0x1078,
+ 0x461a, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x5cd9,
+ 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x5cd5, 0x5cff, 0x5cfd,
+ 0x5cfd, 0x5cfd, 0x5cfd, 0x5cfd, 0x5d08, 0x1078, 0x126a, 0x1078,
+ 0x461a, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4713, 0x007c,
+ 0x1078, 0x461a, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4713,
+ 0x007c, 0xa182, 0x008c, 0x00c8, 0x5d1b, 0xa182, 0x0085, 0x0048,
+ 0x5d1b, 0x0079, 0x5d1e, 0x1078, 0x5459, 0x007c, 0x5d25, 0x5d25,
+ 0x5d25, 0x5d25, 0x5d27, 0x5d45, 0x5d25, 0x1078, 0x126a, 0x0d7e,
+ 0x1078, 0x60db, 0x1078, 0x5fcd, 0x0040, 0x5d41, 0x6010, 0x2068,
+ 0x6837, 0x0103, 0x6850, 0xa084, 0x0040, 0x0040, 0x5d3b, 0x684b,
+ 0x0006, 0x0078, 0x5d3d, 0x684b, 0x0005, 0x6847, 0x0000, 0x1078,
+ 0x35c4, 0x1078, 0x5425, 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068,
+ 0x1078, 0x5fcd, 0x0040, 0x5d5f, 0x6837, 0x0103, 0x6850, 0xa084,
+ 0x0040, 0x0040, 0x5d57, 0x684b, 0x0006, 0x0078, 0x5d59, 0x684b,
+ 0x0005, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f,
+ 0x1078, 0x5425, 0x007c, 0x1078, 0x461a, 0x1078, 0x5425, 0x1078,
+ 0x4713, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001,
+ 0xa182, 0x0101, 0x00c8, 0x5d76, 0x0078, 0x5d78, 0x2009, 0x0100,
+ 0x2130, 0x2069, 0x7098, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
+ 0xaf90, 0x001d, 0x1078, 0x5dd2, 0xa6b2, 0x0020, 0x7804, 0xa06d,
+ 0x0040, 0x5d8c, 0x1078, 0x12eb, 0x1078, 0x12c2, 0x0040, 0x5db6,
+ 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a,
+ 0x003d, 0x00c8, 0x5da2, 0x2608, 0xad90, 0x000f, 0x1078, 0x5dd2,
+ 0x0078, 0x5db6, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90,
+ 0x000f, 0x1078, 0x5dd2, 0x0078, 0x5d8c, 0x0f7f, 0x852f, 0xa5ad,
+ 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5dbb, 0x0f7f, 0x852f,
+ 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e,
+ 0x8dff, 0x0040, 0x5dd0, 0x6804, 0xa07d, 0x0040, 0x5dce, 0x6807,
+ 0x0000, 0x1078, 0x35c4, 0x2f68, 0x0078, 0x5dc3, 0x1078, 0x35c4,
+ 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x5dd8, 0x8108,
+ 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0,
+ 0x5dda, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084,
+ 0x0007, 0x1079, 0x5ded, 0x127f, 0x007c, 0x5dfc, 0x5df5, 0x5df7,
+ 0x5e13, 0x5df5, 0x5df7, 0x5df7, 0x5df7, 0x1078, 0x126a, 0xa006,
+ 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x5e10, 0xa00e, 0x2001, 0x0005, 0x1078, 0x3654,
+ 0x1078, 0x35c4, 0x1078, 0x5425, 0xa085, 0x0001, 0x0d7f, 0x007c,
+ 0xa006, 0x0078, 0x5e0e, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a,
+ 0x1079, 0x5e1b, 0x007c, 0x5e2b, 0x5e4a, 0x5e2d, 0x5e5b, 0x5e46,
+ 0x5e2b, 0x5df7, 0x5dfc, 0x5dfc, 0x5df7, 0x5df7, 0x5df7, 0x5df7,
+ 0x5df7, 0x5df7, 0x5df7, 0x1078, 0x126a, 0x0d7e, 0x6010, 0x2068,
+ 0x1078, 0x5fcd, 0x0040, 0x5e38, 0x6850, 0xa085, 0x0005, 0x6852,
+ 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0xa085, 0x0001, 0x007c, 0x1078, 0x15fc,
+ 0x0078, 0x5e2d, 0x0e7e, 0x2071, 0x6db0, 0x7024, 0xac06, 0x00c0,
+ 0x5e53, 0x1078, 0x4f41, 0x1078, 0x4eb5, 0x0e7f, 0x00c0, 0x5e2d,
+ 0x1078, 0x5df7, 0x007c, 0x037e, 0x0e7e, 0x2071, 0x6db0, 0x703c,
+ 0xac06, 0x00c0, 0x5e67, 0x2019, 0x0000, 0x1078, 0x4fd3, 0x1078,
+ 0x52af, 0x0e7f, 0x037f, 0x00c0, 0x5e2d, 0x1078, 0x5df7, 0x007c,
+ 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x5e78, 0x0c7f, 0x007c,
+ 0x5e80, 0x5ee0, 0x5f71, 0x5e84, 0x5e80, 0x5e80, 0x67ac, 0x5425,
0x007c, 0x6017, 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8,
- 0x1288, 0x1079, 0x61ec, 0x007c, 0x61fc, 0x61fe, 0x621e, 0x6230,
- 0x6230, 0x61fc, 0x61e0, 0x61e0, 0x61e0, 0x6230, 0x6230, 0x61fc,
- 0x61fc, 0x61fc, 0x61fc, 0x623a, 0x1078, 0x1288, 0x0e7e, 0x6010,
- 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0x71b6, 0x7024, 0xac06,
- 0x0040, 0x621a, 0x1078, 0x5139, 0x6007, 0x0085, 0x6003, 0x000b,
- 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x4562, 0x1078, 0x49b7,
- 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x6218, 0x0d7e, 0x6010,
- 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003,
- 0x000b, 0x601f, 0x0002, 0x1078, 0x4562, 0x1078, 0x49b7, 0x007c,
- 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852,
- 0x0d7f, 0x007c, 0x1078, 0x56f5, 0x007c, 0x6000, 0xa08a, 0x0010,
- 0x10c8, 0x1288, 0x1079, 0x6245, 0x007c, 0x6255, 0x61e1, 0x6257,
- 0x6255, 0x6255, 0x6255, 0x6255, 0x6255, 0x61da, 0x61da, 0x6255,
- 0x6255, 0x6255, 0x6255, 0x6255, 0x6255, 0x1078, 0x1288, 0x0d7e,
- 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c,
- 0x10c8, 0x1288, 0x1079, 0x6265, 0x007c, 0x6271, 0x628c, 0x6271,
- 0x628c, 0x6271, 0x628c, 0x6273, 0x627c, 0x6271, 0x628c, 0x6271,
- 0x6281, 0x1078, 0x1288, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6283,
- 0xa08e, 0x0002, 0x0040, 0x6283, 0x6004, 0x1078, 0x6484, 0x0040,
- 0x62d6, 0x1078, 0x21a8, 0x1078, 0x6484, 0x00c0, 0x6289, 0x1078,
- 0x58f2, 0x1078, 0x56f5, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186,
- 0x0016, 0x0040, 0x62c6, 0xa186, 0x0002, 0x00c0, 0x62b1, 0x6018,
- 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x62b1, 0x8001,
- 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078,
- 0x568f, 0x0040, 0x62b1, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078,
- 0x62c6, 0x0d7f, 0x0c7f, 0x1078, 0x6484, 0x00c0, 0x62b9, 0x1078,
- 0x58f2, 0x1078, 0x21a8, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x21c6, 0x127f, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x2001, 0x0002,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af,
- 0x1078, 0x49b7, 0x0d7f, 0x0c7f, 0x0078, 0x62c5, 0x1078, 0x58f2,
- 0x0078, 0x6289, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x62e2, 0x007c, 0x62f2, 0x62f2, 0x62f2, 0x62f2, 0x62f2, 0x62f2,
- 0x62f2, 0x62f2, 0x62f2, 0x61e0, 0x62f2, 0x61e1, 0x62f4, 0x61e1,
- 0x62fd, 0x62f2, 0x1078, 0x1288, 0x6007, 0x008b, 0x6003, 0x000d,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x007c, 0x1078, 0x644a, 0x1078,
- 0x6336, 0x0040, 0x631f, 0x1078, 0x21a8, 0x0d7e, 0x1078, 0x6336,
- 0x0040, 0x6312, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x1078, 0x3840, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
- 0x0001, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0078, 0x6321, 0x1078,
- 0x56f5, 0x007c, 0xa284, 0x0007, 0x00c0, 0x6333, 0xa282, 0x7600,
- 0x0048, 0x6333, 0x2001, 0x7015, 0x2004, 0xa202, 0x00c8, 0x6333,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x6332, 0x027e, 0x0e7e,
- 0x2071, 0x7000, 0x6210, 0x7058, 0xa202, 0x0048, 0x6348, 0x705c,
- 0xa202, 0x00c8, 0x6348, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c,
- 0xa006, 0x0078, 0x6345, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x7600, 0x2071, 0x7000, 0x7344, 0x7060,
- 0xa302, 0x00c8, 0x6371, 0x601c, 0xa206, 0x00c0, 0x6369, 0x1078,
- 0x6484, 0x00c0, 0x6365, 0x1078, 0x58f2, 0x0c7e, 0x1078, 0x56f5,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6371, 0x0078,
- 0x6356, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
- 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x568f, 0x057f,
- 0x0040, 0x6390, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x638c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
- 0x62a0, 0x0c7e, 0x1078, 0x568f, 0x057f, 0x0040, 0x63ba, 0x6013,
- 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x36e4,
- 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x2009, 0x004c, 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f,
- 0x0c7f, 0x007c, 0xa006, 0x0078, 0x63b6, 0x0c7e, 0x057e, 0x127e,
- 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x568f, 0x057f, 0x0040,
- 0x63e5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
- 0x2560, 0x1078, 0x36e4, 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2,
- 0x2c08, 0x1078, 0x6d09, 0x2009, 0x004d, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x63e1,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078,
- 0x568f, 0x057f, 0x0040, 0x6410, 0x6612, 0x651a, 0x601f, 0x0003,
- 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x36e4, 0x0c7f, 0x1078,
- 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09, 0x2009, 0x004e,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x640c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
- 0x1078, 0x568f, 0x017f, 0x0040, 0x642c, 0x660a, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6429, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x6447, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
- 0x0078, 0x6444, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff,
- 0x0040, 0x6454, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013,
- 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e,
- 0x0d7e, 0x2031, 0x7052, 0x2634, 0xd6e4, 0x0040, 0x646c, 0x6618,
- 0x2660, 0x6e48, 0x1078, 0x35f0, 0x0d7f, 0x0c7f, 0x067f, 0x007c,
- 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6481, 0xa08e,
- 0x0003, 0x0040, 0x6481, 0xa08e, 0x0004, 0x0040, 0x6481, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e,
- 0x0000, 0x0040, 0x6499, 0xa08e, 0x001f, 0x0040, 0x6499, 0xa08e,
- 0x0028, 0x0040, 0x6499, 0xa08e, 0x0029, 0x0040, 0x6499, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040, 0x64b6, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x1078, 0x21a8, 0x2009, 0x0028, 0x1078,
- 0x571c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x64b3, 0xa186, 0x0015, 0x00c0, 0x64ce, 0x2011, 0x701c, 0x2204,
- 0xa086, 0x0074, 0x00c0, 0x64ce, 0x1078, 0x5ad5, 0x6003, 0x0001,
- 0x6007, 0x0029, 0x1078, 0x45af, 0x0078, 0x64d2, 0x1078, 0x58f2,
- 0x1078, 0x56f5, 0x007c, 0xa186, 0x0015, 0x00c0, 0x64f0, 0x2011,
- 0x701c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x64f0, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x3576, 0x0d7f, 0x1078, 0x5adf, 0x00c0, 0x64f0,
- 0x2001, 0x0006, 0x1078, 0x34a2, 0x1078, 0x579f, 0x0078, 0x64f4,
- 0x1078, 0x58f2, 0x1078, 0x56f5, 0x007c, 0x6848, 0xa086, 0x0005,
- 0x00c0, 0x64fc, 0x1078, 0x64fd, 0x007c, 0x6850, 0xc0ad, 0x6852,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x650b, 0x067f, 0x007c, 0x651b, 0x66eb, 0x67cc, 0x651b, 0x651b,
- 0x651b, 0x651b, 0x651b, 0x6555, 0x6832, 0x651b, 0x651b, 0x651b,
- 0x651b, 0x651b, 0x651b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x6527, 0x067f, 0x007c, 0x6537,
- 0x6b1e, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6af9,
- 0x6b68, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x6543, 0x067f, 0x007c, 0x6553, 0x696a, 0x69dc, 0x69fe, 0x6a4a,
- 0x6553, 0x6553, 0x6aa4, 0x683e, 0x6ae1, 0x6ae5, 0x6553, 0x6553,
- 0x6553, 0x6553, 0x6553, 0x1078, 0x1288, 0xa1b2, 0x0030, 0x10c8,
- 0x1288, 0x2100, 0x0079, 0x655c, 0x658c, 0x6669, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658e, 0x65bd, 0x65c8, 0x65f0, 0x65f6,
- 0x662a, 0x6662, 0x658c, 0x658c, 0x6671, 0x658c, 0x658c, 0x658c,
- 0x6678, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x6695, 0x658c,
- 0x658c, 0x66a0, 0x658c, 0x658c, 0x1078, 0x1288, 0x1078, 0x37ec,
- 0x6618, 0x0c7e, 0x2660, 0x1078, 0x350c, 0x0c7f, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x65af, 0x1078,
- 0x6c48, 0x00c0, 0x65ea, 0x1078, 0x6be6, 0x00c0, 0x65ab, 0x6007,
- 0x0008, 0x0078, 0x6664, 0x6007, 0x0009, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x65b9, 0x1078, 0x6c48, 0x0040, 0x65a3, 0x0078,
- 0x65ea, 0x6013, 0x1900, 0x0078, 0x65ab, 0x6106, 0x1078, 0x6ba9,
- 0x6007, 0x0006, 0x0078, 0x6664, 0x6007, 0x0007, 0x0078, 0x6664,
- 0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x65da, 0xa686, 0x0004, 0x0040, 0x65da, 0x0d7f,
- 0x0078, 0x65ea, 0x1078, 0x6ca6, 0x00c0, 0x65e5, 0x1078, 0x3576,
- 0x6007, 0x000a, 0x0d7f, 0x0078, 0x6664, 0x6007, 0x000b, 0x0d7f,
- 0x0078, 0x6664, 0x1078, 0x21a8, 0x6007, 0x0001, 0x0078, 0x6664,
- 0x1078, 0x21a8, 0x6007, 0x000c, 0x0078, 0x6664, 0x1078, 0x37ec,
- 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006,
- 0x0048, 0x6617, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
- 0x65ea, 0x1078, 0x6cb5, 0x00c0, 0x6611, 0x6007, 0x000e, 0x0078,
- 0x6664, 0x1078, 0x21a8, 0x6007, 0x000f, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x6624, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6609, 0x0078, 0x65ea, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6664, 0x1078, 0x37ec, 0x6618, 0xa6b0, 0x0001, 0x2634,
- 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x664f, 0xa6b4, 0xff00,
- 0x8637, 0xa686, 0x0006, 0x00c0, 0x65ea, 0x1078, 0x6ce1, 0x00c0,
- 0x6649, 0x1078, 0x6be6, 0x00c0, 0x6649, 0x6007, 0x0010, 0x0078,
- 0x6664, 0x1078, 0x21a8, 0x6007, 0x0011, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x665c, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x663d, 0x0078, 0x65ea, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6664, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x45af,
- 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x45af, 0x0078,
- 0x6668, 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x45af, 0x007c,
- 0x017e, 0x027e, 0x2011, 0x7488, 0x2214, 0x2c08, 0x1078, 0x6ea2,
- 0x00c0, 0x6689, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078,
- 0x668e, 0x1078, 0x56f5, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001,
- 0x1078, 0x45af, 0x027f, 0x017f, 0x007c, 0x6106, 0x1078, 0x66a7,
- 0x6007, 0x002b, 0x0078, 0x6664, 0x6007, 0x002c, 0x0078, 0x6664,
- 0x6106, 0x1078, 0x66ac, 0x6007, 0x002e, 0x0078, 0x6664, 0x0d7e,
- 0x1078, 0x66d2, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x66e1, 0x00c0,
- 0x66cb, 0x680c, 0xa08c, 0xff00, 0x6824, 0xa084, 0x00ff, 0xa115,
- 0x6212, 0xd1e4, 0x0040, 0x66c0, 0x2009, 0x0001, 0x0078, 0x66c7,
- 0xd1ec, 0x0040, 0x66cb, 0x2009, 0x0000, 0xa294, 0x00ff, 0x1078,
- 0x21d7, 0x0078, 0x66cf, 0xa085, 0x0001, 0x0078, 0x66d0, 0xa006,
- 0x0d7f, 0x007c, 0x2069, 0x748d, 0x6800, 0xa082, 0x0010, 0x00c8,
- 0x66df, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x66e0, 0xa006,
- 0x007c, 0x6013, 0x0000, 0x2069, 0x748c, 0x6808, 0xa084, 0xff00,
- 0xa086, 0x0800, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1288,
- 0xa1b6, 0x0013, 0x00c0, 0x66f7, 0x2008, 0x0079, 0x670a, 0xa1b6,
- 0x0027, 0x0040, 0x66ff, 0xa1b6, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078,
- 0x49b7, 0x007c, 0x673a, 0x673c, 0x673a, 0x673a, 0x673a, 0x673c,
- 0x6744, 0x67a7, 0x676a, 0x67a7, 0x677e, 0x67a7, 0x6744, 0x67a7,
- 0x679f, 0x67a7, 0x679f, 0x67a7, 0x67a7, 0x673a, 0x673a, 0x673a,
- 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a,
- 0x673a, 0x673a, 0x67a7, 0x673a, 0x673a, 0x673a, 0x673a, 0x67a7,
- 0x67a7, 0x673a, 0x673a, 0x673a, 0x673a, 0x67a7, 0x67a7, 0x673a,
- 0x67a7, 0x67a7, 0x1078, 0x1288, 0x1078, 0x48be, 0x6003, 0x0002,
- 0x1078, 0x49b7, 0x0078, 0x67ad, 0x0f7e, 0x2079, 0x7051, 0x7804,
- 0x0f7f, 0xd0ac, 0x00c0, 0x67a7, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2001, 0x0002, 0x1078, 0x34a2, 0x1078, 0x48be, 0x601f, 0x0001,
- 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af, 0x1078, 0x49b7,
- 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x42b7, 0x0c7f,
- 0x0078, 0x67ad, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x67a7, 0xa686, 0x0004,
- 0x0040, 0x67a7, 0x2001, 0x0004, 0x0078, 0x67a5, 0x2001, 0x7000,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x6787, 0x1078, 0x2a92, 0x2001,
- 0x0006, 0x1078, 0x67ae, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x67a7, 0x2001,
- 0x0006, 0x0078, 0x67a5, 0x2001, 0x0004, 0x0078, 0x67a5, 0x2001,
- 0x0006, 0x1078, 0x67ae, 0x0078, 0x67a7, 0x1078, 0x34b0, 0x1078,
- 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0x017e, 0x0d7e,
- 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x67c9, 0x6104, 0xa18e,
- 0x000a, 0x00c0, 0x67c1, 0x699c, 0xd1a4, 0x00c0, 0x67c1, 0x2001,
- 0x0007, 0x1078, 0x34a2, 0x2001, 0x0000, 0x1078, 0x348e, 0x1078,
- 0x21c6, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1288,
- 0xa1b6, 0x0015, 0x00c0, 0x67e0, 0x1079, 0x67e7, 0x0078, 0x67e6,
- 0xa1b6, 0x0016, 0x10c0, 0x1288, 0x1079, 0x6817, 0x007c, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x67f3, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x0f7e, 0x2079, 0x7051, 0x7804, 0x0f7f,
- 0xd0ac, 0x00c0, 0x680f, 0x2001, 0x0000, 0x1078, 0x348e, 0x2001,
- 0x0002, 0x1078, 0x34a2, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0078, 0x6816, 0x2011,
- 0x7483, 0x220c, 0x1078, 0x32ed, 0x1078, 0x56f5, 0x007c, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x6823, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x1078, 0x5ad2, 0x00c0, 0x682f, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x6831, 0x1078,
- 0x56f5, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x1078,
- 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6842, 0x6852, 0x6852, 0x6852, 0x6852, 0x6854, 0x6852,
- 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852,
- 0x6852, 0x6852, 0x1078, 0x1288, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e,
- 0x047e, 0x027e, 0x6106, 0x2071, 0x7480, 0x7444, 0xa4a4, 0xe600,
- 0x0040, 0x68b8, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x4348, 0x2c68,
- 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6923, 0x1078, 0x4407,
- 0x0040, 0x694e, 0xa295, 0x0200, 0x6a02, 0x0078, 0x687d, 0x2009,
- 0x0001, 0x2011, 0x0200, 0x1078, 0x43f1, 0x1078, 0x12e2, 0x1040,
- 0x1288, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000,
- 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0,
- 0x8007, 0x7130, 0x694a, 0xa084, 0xff00, 0x6846, 0x684f, 0x0000,
- 0x6857, 0x0036, 0x1078, 0x3840, 0xa486, 0x2000, 0x00c0, 0x68a6,
- 0x2019, 0x0017, 0x1078, 0x6e67, 0x0078, 0x6910, 0xa486, 0x0400,
- 0x00c0, 0x68b0, 0x2019, 0x0002, 0x1078, 0x6e67, 0x0078, 0x6910,
- 0xa486, 0x0200, 0x00c0, 0x68b6, 0x1078, 0x6e58, 0x0078, 0x6910,
- 0x2009, 0x0000, 0x0c7e, 0x1078, 0x4348, 0x2c68, 0x0c7f, 0x6a00,
- 0xa284, 0x0001, 0x0040, 0x6966, 0xa284, 0x0300, 0x00c0, 0x695e,
- 0x6804, 0xa005, 0x0040, 0x694e, 0x8001, 0x6806, 0x6003, 0x0007,
- 0x1078, 0x12c7, 0x0040, 0x6917, 0x6013, 0x0000, 0x6803, 0x0000,
+ 0x126a, 0x1079, 0x5e8c, 0x007c, 0x5e9c, 0x5e9e, 0x5ebf, 0x5ed2,
+ 0x5ed2, 0x5e9c, 0x5e80, 0x5e80, 0x5e80, 0x5ed2, 0x5ed2, 0x5e9c,
+ 0x5e9c, 0x5e9c, 0x5e9c, 0x5edd, 0x1078, 0x126a, 0x0e7e, 0x6010,
+ 0x2070, 0x7050, 0xa085, 0x0040, 0x7052, 0x2071, 0x6db0, 0x7024,
+ 0xac06, 0x0040, 0x5ebb, 0x1078, 0x4eb5, 0x6007, 0x0085, 0x6003,
+ 0x000b, 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x42c4, 0x1078,
+ 0x4713, 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x5eb9, 0x0d7e,
+ 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, 0x6852, 0x0d7f, 0x6007,
+ 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x42c4, 0x1078,
+ 0x4713, 0x007c, 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850,
+ 0xa085, 0x0040, 0x6852, 0x0d7f, 0x007c, 0x1078, 0x5425, 0x007c,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a, 0x1079, 0x5ee8, 0x007c,
+ 0x5ef8, 0x5e81, 0x5efa, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8,
+ 0x5e80, 0x5e80, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8,
+ 0x1078, 0x126a, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff,
+ 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x126a, 0x1079, 0x5f08, 0x007c,
+ 0x5f14, 0x5f29, 0x5f14, 0x5f29, 0x5f14, 0x5f29, 0x5f16, 0x5f1f,
+ 0x5f14, 0x5f29, 0x5f14, 0x5f24, 0x1078, 0x126a, 0x6004, 0xa08e,
+ 0x0004, 0x0040, 0x5f26, 0xa08e, 0x0002, 0x0040, 0x5f26, 0x6004,
+ 0x1078, 0x6115, 0x0040, 0x5f6d, 0x1078, 0x2125, 0x1078, 0x5425,
+ 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040, 0x5f5d,
+ 0xa186, 0x0002, 0x00c0, 0x5f4e, 0x6018, 0x2068, 0x6840, 0xa084,
+ 0x00ff, 0xa005, 0x0040, 0x5f4e, 0x8001, 0x6842, 0x6013, 0x0000,
+ 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x53bf, 0x0040, 0x5f4e,
+ 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x5f5d, 0x0d7f, 0x0c7f,
+ 0x1078, 0x2125, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x2143,
+ 0x127f, 0x0e7f, 0x1078, 0x5425, 0x007c, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x1078,
+ 0x4713, 0x0d7f, 0x0c7f, 0x0078, 0x5f5c, 0x1078, 0x5614, 0x0078,
+ 0x5f26, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a, 0x1079, 0x5f79,
+ 0x007c, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89,
+ 0x5f89, 0x5f89, 0x5e80, 0x5f89, 0x5e81, 0x5f8b, 0x5e81, 0x5f94,
+ 0x5f89, 0x1078, 0x126a, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0x007c, 0x1078, 0x60db, 0x1078, 0x5fcd,
+ 0x0040, 0x5fb6, 0x1078, 0x2125, 0x0d7e, 0x1078, 0x5fcd, 0x0040,
+ 0x5fa9, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
+ 0x35c4, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+ 0x1078, 0x4311, 0x1078, 0x4713, 0x0078, 0x5fb8, 0x1078, 0x5425,
+ 0x007c, 0xa284, 0x0007, 0x00c0, 0x5fca, 0xa282, 0x7200, 0x0048,
+ 0x5fca, 0x2001, 0x6c15, 0x2004, 0xa202, 0x00c8, 0x5fca, 0xa085,
+ 0x0001, 0x007c, 0xa006, 0x0078, 0x5fc9, 0x027e, 0x0e7e, 0x2071,
+ 0x6c00, 0x6210, 0x7058, 0xa202, 0x0048, 0x5fdf, 0x705c, 0xa202,
+ 0x00c8, 0x5fdf, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006,
+ 0x0078, 0x5fdc, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2061, 0x7200, 0x2071, 0x6c00, 0x7344, 0x7060, 0xa302,
+ 0x00c8, 0x6002, 0x601c, 0xa206, 0x00c0, 0x5ffa, 0x0c7e, 0x1078,
+ 0x5425, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6002,
+ 0x0078, 0x5fed, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c,
+ 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x53bf,
+ 0x057f, 0x0040, 0x6021, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
+ 0x004b, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
+ 0x007c, 0xa006, 0x0078, 0x601d, 0x0c7e, 0x057e, 0x127e, 0x2091,
+ 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x53bf, 0x057f, 0x0040, 0x604b,
+ 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
+ 0x34f2, 0x0c7f, 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078,
+ 0x6946, 0x2009, 0x004c, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f,
+ 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6047, 0x0c7e, 0x057e,
+ 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x53bf, 0x057f,
+ 0x0040, 0x6076, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
+ 0x0c7e, 0x2560, 0x1078, 0x34f2, 0x0c7f, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x2c08, 0x1078, 0x6946, 0x2009, 0x004d, 0x1078, 0x544c,
+ 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
+ 0x6072, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
+ 0x1078, 0x53bf, 0x057f, 0x0040, 0x60a1, 0x6612, 0x651a, 0x601f,
+ 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x34f2, 0x0c7f,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x2009,
+ 0x004e, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
+ 0x007c, 0xa006, 0x0078, 0x609d, 0x0c7e, 0x127e, 0x2091, 0x8000,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x60bd, 0x660a, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x544c,
+ 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x60ba,
+ 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x53bf, 0x017f,
+ 0x0040, 0x60d8, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+ 0x0000, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x60d5, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c,
+ 0x82ff, 0x0040, 0x60e5, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c,
+ 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e,
+ 0x0c7e, 0x0d7e, 0x2031, 0x6c52, 0x2634, 0xd6e4, 0x0040, 0x60fd,
+ 0x6618, 0x2660, 0x6e44, 0x1078, 0x342a, 0x0d7f, 0x0c7f, 0x067f,
+ 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6112,
+ 0xa08e, 0x0003, 0x0040, 0x6112, 0xa08e, 0x0004, 0x0040, 0x6112,
+ 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004,
+ 0xa08e, 0x0000, 0x0040, 0x612a, 0xa08e, 0x001f, 0x0040, 0x612a,
+ 0xa08e, 0x0028, 0x0040, 0x612a, 0xa08e, 0x0029, 0x0040, 0x612a,
+ 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x6147, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x1078, 0x2125, 0x2009, 0x0028,
+ 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
+ 0x0078, 0x6144, 0xa186, 0x0015, 0x00c0, 0x615f, 0x2011, 0x6c1c,
+ 0x2204, 0xa086, 0x0074, 0x00c0, 0x615f, 0x1078, 0x57f7, 0x6003,
+ 0x0001, 0x6007, 0x0029, 0x1078, 0x4311, 0x0078, 0x6163, 0x1078,
+ 0x5614, 0x1078, 0x5425, 0x007c, 0xa186, 0x0015, 0x00c0, 0x6181,
+ 0x2011, 0x6c1c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x6181, 0x0d7e,
+ 0x6018, 0x2068, 0x1078, 0x33ed, 0x0d7f, 0x1078, 0x5801, 0x00c0,
+ 0x6181, 0x2001, 0x0006, 0x1078, 0x3316, 0x1078, 0x54cf, 0x0078,
+ 0x6185, 0x1078, 0x5614, 0x1078, 0x5425, 0x007c, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079, 0x6190, 0x067f, 0x007c,
+ 0x61a0, 0x6312, 0x63ed, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0,
+ 0x61da, 0x6453, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0,
+ 0x1078, 0x126a, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a,
+ 0x1079, 0x61ac, 0x067f, 0x007c, 0x61bc, 0x675b, 0x61bc, 0x61bc,
+ 0x61bc, 0x61bc, 0x61bc, 0x61bc, 0x6736, 0x67a5, 0x61bc, 0x61bc,
+ 0x61bc, 0x61bc, 0x61bc, 0x61bc, 0x1078, 0x126a, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079, 0x61c8, 0x067f, 0x007c,
+ 0x61d8, 0x65a5, 0x6617, 0x6639, 0x6687, 0x61d8, 0x61d8, 0x66e1,
+ 0x645f, 0x671e, 0x6722, 0x61d8, 0x61d8, 0x61d8, 0x61d8, 0x61d8,
+ 0x1078, 0x126a, 0xa1b2, 0x002a, 0x10c8, 0x126a, 0x2100, 0x0079,
+ 0x61e1, 0x620b, 0x62e8, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620d, 0x623c, 0x6247, 0x626f, 0x6275, 0x62a9, 0x62e1, 0x620b,
+ 0x620b, 0x62f0, 0x620b, 0x620b, 0x620b, 0x62f7, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x1078, 0x126a, 0x1078, 0x3570, 0x6618,
+ 0x0c7e, 0x2660, 0x1078, 0x337c, 0x0c7f, 0xa6b0, 0x0001, 0x2634,
+ 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x622e, 0x1078, 0x6885,
+ 0x00c0, 0x6269, 0x1078, 0x6823, 0x00c0, 0x622a, 0x6007, 0x0008,
+ 0x0078, 0x62e3, 0x6007, 0x0009, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x6238, 0x1078, 0x6885, 0x0040, 0x6222, 0x0078, 0x6269,
+ 0x6013, 0x1900, 0x0078, 0x622a, 0x6106, 0x1078, 0x67e6, 0x6007,
+ 0x0006, 0x0078, 0x62e3, 0x6007, 0x0007, 0x0078, 0x62e3, 0x0d7e,
+ 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
+ 0x0040, 0x6259, 0xa686, 0x0004, 0x0040, 0x6259, 0x0d7f, 0x0078,
+ 0x6269, 0x1078, 0x68e3, 0x00c0, 0x6264, 0x1078, 0x33ed, 0x6007,
+ 0x000a, 0x0d7f, 0x0078, 0x62e3, 0x6007, 0x000b, 0x0d7f, 0x0078,
+ 0x62e3, 0x1078, 0x2125, 0x6007, 0x0001, 0x0078, 0x62e3, 0x1078,
+ 0x2125, 0x6007, 0x000c, 0x0078, 0x62e3, 0x1078, 0x3570, 0x6618,
+ 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048,
+ 0x6296, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6269,
+ 0x1078, 0x68f2, 0x00c0, 0x6290, 0x6007, 0x000e, 0x0078, 0x62e3,
+ 0x1078, 0x2125, 0x6007, 0x000f, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x62a3, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x6288, 0x0078, 0x6269, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078,
+ 0x62e3, 0x1078, 0x3570, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684,
+ 0x00ff, 0xa082, 0x0006, 0x0048, 0x62ce, 0xa6b4, 0xff00, 0x8637,
+ 0xa686, 0x0006, 0x00c0, 0x6269, 0x1078, 0x691e, 0x00c0, 0x62c8,
+ 0x1078, 0x6823, 0x00c0, 0x62c8, 0x6007, 0x0010, 0x0078, 0x62e3,
+ 0x1078, 0x2125, 0x6007, 0x0011, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x62db, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x62bc, 0x0078, 0x6269, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078,
+ 0x62e3, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x4311, 0x007c,
+ 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4311, 0x0078, 0x62e7,
+ 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x4311, 0x007c, 0x017e,
+ 0x027e, 0x2011, 0x7088, 0x2214, 0x2c08, 0x1078, 0x6add, 0x00c0,
+ 0x6308, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078, 0x630b,
+ 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4311, 0x027f,
+ 0x017f, 0x007c, 0x6004, 0xa0b2, 0x002a, 0x10c8, 0x126a, 0xa1b6,
+ 0x0013, 0x00c0, 0x631e, 0x2008, 0x0079, 0x6331, 0xa1b6, 0x0027,
+ 0x0040, 0x6326, 0xa1b6, 0x0014, 0x10c0, 0x126a, 0x2001, 0x0007,
+ 0x1078, 0x3324, 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713,
+ 0x007c, 0x635b, 0x635d, 0x635b, 0x635b, 0x635b, 0x635d, 0x6365,
+ 0x63c8, 0x638b, 0x63c8, 0x639f, 0x63c8, 0x6365, 0x63c8, 0x63c0,
+ 0x63c8, 0x63c0, 0x63c8, 0x63c8, 0x635b, 0x635b, 0x635b, 0x635b,
+ 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b,
+ 0x635b, 0x63c8, 0x635b, 0x635b, 0x635b, 0x635b, 0x63c8, 0x63c8,
+ 0x635b, 0x635b, 0x635b, 0x1078, 0x126a, 0x1078, 0x461a, 0x6003,
+ 0x0002, 0x1078, 0x4713, 0x0078, 0x63ce, 0x0f7e, 0x2079, 0x6c51,
+ 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x63c8, 0x2001, 0x0000, 0x1078,
+ 0x3302, 0x2001, 0x0002, 0x1078, 0x3316, 0x1078, 0x461a, 0x601f,
+ 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x1078,
+ 0x4713, 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x4033,
+ 0x0c7f, 0x0078, 0x63ce, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c8, 0xa686,
+ 0x0004, 0x0040, 0x63c8, 0x2001, 0x0004, 0x0078, 0x63c6, 0x2001,
+ 0x6c00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x63a8, 0x1078, 0x29a0,
+ 0x2001, 0x0006, 0x1078, 0x63cf, 0x6618, 0x0d7e, 0x2668, 0x6e04,
+ 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c8,
+ 0x2001, 0x0006, 0x0078, 0x63c6, 0x2001, 0x0004, 0x0078, 0x63c6,
+ 0x2001, 0x0006, 0x1078, 0x63cf, 0x0078, 0x63c8, 0x1078, 0x3324,
+ 0x1078, 0x461a, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x017e,
+ 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x63ea, 0x6104,
+ 0xa18e, 0x000a, 0x00c0, 0x63e2, 0x699c, 0xd1a4, 0x00c0, 0x63e2,
+ 0x2001, 0x0007, 0x1078, 0x3316, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x1078, 0x2143, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668,
+ 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8,
+ 0x126a, 0xa1b6, 0x0015, 0x00c0, 0x6401, 0x1079, 0x6408, 0x0078,
+ 0x6407, 0xa1b6, 0x0016, 0x10c0, 0x126a, 0x1079, 0x6438, 0x007c,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x6414,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x0f7e, 0x2079, 0x6c51, 0x7804,
+ 0x0f7f, 0xd0ac, 0x00c0, 0x6430, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x2001, 0x0002, 0x1078, 0x3316, 0x601f, 0x0001, 0x6003, 0x0001,
+ 0x6007, 0x0002, 0x1078, 0x4311, 0x1078, 0x4713, 0x0078, 0x6437,
+ 0x2011, 0x7083, 0x220c, 0x1078, 0x316e, 0x1078, 0x5425, 0x007c,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x6444,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x1078, 0x57f4, 0x00c0, 0x6450,
+ 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311, 0x0078, 0x6452,
+ 0x1078, 0x5425, 0x007c, 0x6004, 0xa08a, 0x002a, 0x10c8, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182,
+ 0x0040, 0x0079, 0x6463, 0x6473, 0x6473, 0x6473, 0x6473, 0x6475,
+ 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473,
+ 0x6473, 0x6473, 0x6473, 0x1078, 0x126a, 0x0d7e, 0x0e7e, 0x0f7e,
+ 0x157e, 0x047e, 0x027e, 0x2071, 0x7080, 0x7444, 0xa4a4, 0xe600,
+ 0x0040, 0x64e6, 0xa486, 0x2000, 0x0040, 0x64a4, 0xa486, 0x0400,
+ 0x0040, 0x64a4, 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
+ 0x6579, 0x0c7e, 0x1078, 0x40c4, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
+ 0x0001, 0x0040, 0x655a, 0x1078, 0x4182, 0x0040, 0x6585, 0xa295,
+ 0x0200, 0x6a02, 0x0078, 0x64aa, 0x2009, 0x0001, 0x2011, 0x0200,
+ 0x1078, 0x416c, 0x1078, 0x12c2, 0x1040, 0x126a, 0x6003, 0x0007,
+ 0x6106, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000,
+ 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130,
+ 0xa18c, 0x00ff, 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036,
+ 0x1078, 0x35c4, 0xa486, 0x2000, 0x00c0, 0x64d4, 0x2019, 0x0017,
+ 0x1078, 0x6aa2, 0x0078, 0x6547, 0xa486, 0x0400, 0x00c0, 0x64de,
+ 0x2019, 0x0002, 0x1078, 0x6aa2, 0x0078, 0x6547, 0xa486, 0x0200,
+ 0x00c0, 0x64e4, 0x1078, 0x6a93, 0x0078, 0x6547, 0x7130, 0xa184,
+ 0xff00, 0x00c0, 0x659d, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
+ 0x659d, 0x0c7e, 0x1078, 0x40c4, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
+ 0x0001, 0x0040, 0x65a1, 0xa284, 0x0300, 0x00c0, 0x6599, 0x6804,
+ 0xa005, 0x0040, 0x6585, 0x8001, 0x6806, 0x6003, 0x0007, 0x6106,
+ 0x1078, 0x12a7, 0x0040, 0x654e, 0x6013, 0x0000, 0x6803, 0x0000,
0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a, 0x6018, 0x2078,
- 0x78a0, 0x8007, 0x7130, 0x6986, 0x6846, 0x6853, 0x003d, 0x7044,
- 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x68f2, 0x684f, 0x0040,
- 0x0078, 0x68fc, 0xa086, 0x0001, 0x00c0, 0x68fa, 0x684f, 0x0080,
- 0x0078, 0x68fc, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, 0x7490,
- 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0,
- 0x6902, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, 0x3840,
- 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013,
- 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4562, 0x1078,
- 0x49b7, 0x0078, 0x6910, 0x2069, 0x7492, 0x2d04, 0xa084, 0xff00,
- 0xa086, 0x1200, 0x00c0, 0x6942, 0x2069, 0x7480, 0x686c, 0xa084,
- 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f,
- 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x4562, 0x1078, 0x49b7,
- 0x0078, 0x6910, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x0078, 0x6910, 0x6013, 0x0300,
- 0x0078, 0x6954, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x0078, 0x6910, 0x6013, 0x0500,
- 0x0078, 0x6954, 0x6013, 0x0600, 0x0078, 0x6923, 0x6013, 0x0200,
- 0x0078, 0x6923, 0xa186, 0x0013, 0x00c0, 0x697c, 0x6004, 0xa08a,
- 0x0040, 0x1048, 0x1288, 0xa08a, 0x0050, 0x10c8, 0x1288, 0xa082,
- 0x0040, 0x2008, 0x0079, 0x69ad, 0xa186, 0x0047, 0x00c0, 0x6982,
- 0x0078, 0x69dc, 0xa186, 0x0027, 0x0040, 0x698a, 0xa186, 0x0014,
- 0x10c0, 0x1288, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079, 0x6990,
- 0x69a0, 0x69a2, 0x69a2, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0,
- 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0,
- 0x1078, 0x1288, 0x2001, 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be,
- 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0x69bd, 0x69cd, 0x69c6,
- 0x69d6, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd,
- 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x1078, 0x1288, 0x6010,
- 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x48be,
- 0x6003, 0x0002, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be, 0x1078,
- 0x43c9, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be,
- 0x2009, 0x0041, 0x0078, 0x6aa4, 0xa182, 0x0040, 0x0079, 0x69e0,
- 0x69f0, 0x69f2, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f3,
- 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0,
- 0x1078, 0x1288, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005,
- 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6a02, 0x6a12, 0x6a12, 0x6a12, 0x6a12, 0x6a12, 0x6a12,
- 0x6a12, 0x6a12, 0x6a12, 0x6a14, 0x6a37, 0x6a12, 0x6a12, 0x6a12,
- 0x6a12, 0x6a37, 0x1078, 0x1288, 0x1078, 0x4966, 0x1078, 0x4a67,
- 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x6a2a, 0xa08c,
- 0x0003, 0xa18e, 0x0002, 0x0040, 0x6a30, 0x2009, 0x0041, 0x0d7f,
- 0x0078, 0x6aa4, 0x6003, 0x0007, 0x1078, 0x43c9, 0x0d7f, 0x007c,
- 0x1078, 0x43c9, 0x1078, 0x56f5, 0x0d7f, 0x0078, 0x6a2f, 0x037e,
- 0x1078, 0x4966, 0x1078, 0x4a67, 0x6010, 0x0d7e, 0x2068, 0x2019,
- 0x0004, 0x1078, 0x6e8b, 0x1078, 0x6457, 0x6017, 0x0028, 0x0d7f,
- 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6a58, 0x6004, 0xa086,
- 0x0042, 0x10c0, 0x1288, 0x1078, 0x48be, 0x1078, 0x49b7, 0x007c,
- 0xa186, 0x0027, 0x0040, 0x6a60, 0xa186, 0x0014, 0x00c0, 0x6a70,
- 0x6004, 0xa086, 0x0042, 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078,
- 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c,
- 0xa182, 0x0040, 0x0079, 0x6a74, 0x6a84, 0x6a84, 0x6a84, 0x6a84,
- 0x6a84, 0x6a84, 0x6a84, 0x6a86, 0x6a92, 0x6a84, 0x6a84, 0x6a84,
- 0x6a84, 0x6a84, 0x6a84, 0x6a84, 0x1078, 0x1288, 0x037e, 0x047e,
- 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x047f,
- 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040,
- 0x6a9e, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6aa4, 0x6003, 0x0007,
- 0x1078, 0x43c9, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079, 0x6aa8,
- 0x6ab8, 0x6aba, 0x6ac6, 0x6ad2, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8,
- 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8,
- 0x1078, 0x1288, 0x6003, 0x0001, 0x6106, 0x1078, 0x4562, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4562, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7,
- 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, 0x1936,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x45ce, 0x1078, 0x4a67, 0x127f,
- 0x007c, 0x1078, 0x48be, 0x0078, 0x6ae7, 0x1078, 0x4966, 0x6110,
- 0x81ff, 0x0040, 0x6af4, 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029,
- 0x1078, 0x6e8b, 0x037f, 0x0d7f, 0x1078, 0x6457, 0x1078, 0x49b7,
- 0x007c, 0xa182, 0x0085, 0x0079, 0x6afd, 0x6b04, 0x6b04, 0x6b04,
- 0x6b06, 0x6b04, 0x6b04, 0x6b04, 0x1078, 0x1288, 0x027e, 0x0e7e,
- 0x2071, 0x7480, 0x7220, 0x1078, 0x6da5, 0x0040, 0x6b13, 0x6007,
- 0x0086, 0x0078, 0x6b15, 0x6007, 0x0087, 0x6003, 0x0001, 0x1078,
- 0x4562, 0x1078, 0x49b7, 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013,
- 0x00c0, 0x6b2f, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a,
- 0x008c, 0x10c8, 0x1288, 0xa082, 0x0085, 0x0079, 0x6b42, 0xa186,
- 0x0027, 0x0040, 0x6b37, 0xa186, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078,
- 0x49b7, 0x007c, 0x6b49, 0x6b4b, 0x6b4b, 0x6b49, 0x6b49, 0x6b49,
- 0x6b49, 0x1078, 0x1288, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078,
- 0x49b7, 0x007c, 0xa182, 0x0085, 0x1048, 0x1288, 0xa182, 0x008c,
- 0x10c8, 0x1288, 0xa182, 0x0085, 0x0079, 0x6b5e, 0x6b65, 0x6b65,
- 0x6b65, 0x6b67, 0x6b65, 0x6b65, 0x6b65, 0x1078, 0x1288, 0x007c,
- 0x1078, 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0x037e,
- 0x2019, 0x000b, 0x1078, 0x6b78, 0x601f, 0x0006, 0x037f, 0x007c,
- 0x127e, 0x037e, 0x087e, 0x2091, 0x8000, 0x2c40, 0x1078, 0x5408,
- 0x00c0, 0x6ba5, 0x1078, 0x54a9, 0x00c0, 0x6ba5, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x6ba5, 0x601c, 0xa086, 0x0007, 0x0040, 0x6ba5,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6b98, 0x1078, 0x1629,
- 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6ba0, 0x1078, 0x6e8b,
- 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f, 0x127f,
- 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7480, 0x7838,
- 0xa084, 0x00ff, 0xa005, 0x00c0, 0x6be1, 0x783c, 0x1078, 0x1fe4,
- 0x017e, 0x0c7e, 0x1078, 0x34fa, 0x00c0, 0x6bdf, 0x2011, 0x7490,
- 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6bdf,
- 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078, 0x557d,
- 0x1078, 0x469f, 0x1078, 0x45e2, 0x017f, 0x1078, 0x6d09, 0x1078,
- 0x36e4, 0x017f, 0x1078, 0x32ed, 0xa006, 0x0078, 0x6be1, 0x0c7f,
- 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e,
- 0x017e, 0x2009, 0x701c, 0x2104, 0xa086, 0x0074, 0x00c0, 0x6c3d,
- 0x2069, 0x748e, 0x690c, 0xa182, 0x0100, 0x0048, 0x6c2d, 0x6908,
- 0xa184, 0x8000, 0x0040, 0x6c39, 0xa184, 0x0800, 0x0040, 0x6c39,
- 0x6910, 0xa18a, 0x0001, 0x0048, 0x6c31, 0x6914, 0x2069, 0x74ae,
- 0x6904, 0x81ff, 0x00c0, 0x6c25, 0x690c, 0xa182, 0x0100, 0x0048,
- 0x6c2d, 0x6908, 0x81ff, 0x00c0, 0x6c29, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x6c31, 0x6918, 0xa18a, 0x0001, 0x0048, 0x6c39, 0x0078,
- 0x6c43, 0x6013, 0x0100, 0x0078, 0x6c3f, 0x6013, 0x0300, 0x0078,
- 0x6c3f, 0x6013, 0x0500, 0x0078, 0x6c3f, 0x6013, 0x0700, 0x0078,
- 0x6c3f, 0x6013, 0x0900, 0x0078, 0x6c3f, 0x6013, 0x0b00, 0x0078,
- 0x6c3f, 0x6013, 0x0f00, 0x0078, 0x6c3f, 0x6013, 0x2d00, 0xa085,
- 0x0001, 0x0078, 0x6c44, 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04,
- 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x6c6c, 0xa286, 0x0004,
- 0x0040, 0x6c6c, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006, 0x0040,
- 0x6c6c, 0xa286, 0x0004, 0x0040, 0x6c6c, 0x0c7e, 0x2d60, 0x1078,
- 0x350c, 0x0c7f, 0x0078, 0x6c9f, 0x2011, 0x7496, 0xad98, 0x000a,
- 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6ca0, 0x2011, 0x749a,
- 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6ca0,
- 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009,
- 0x7052, 0x210c, 0xd1a4, 0x0040, 0x6c94, 0x2009, 0x0029, 0x1078,
- 0x6ecf, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078, 0x469f,
- 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09, 0x017f, 0x047f, 0xa006,
- 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069,
- 0x748e, 0x6800, 0xa086, 0x0800, 0x0040, 0x6cb2, 0x6013, 0x0000,
- 0x0078, 0x6cb3, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e,
- 0x027e, 0x037e, 0x157e, 0x2079, 0x748c, 0x7830, 0xa00d, 0x00c0,
- 0x6cda, 0x7834, 0x1078, 0x1fe4, 0x1078, 0x34fa, 0x00c0, 0x6cda,
- 0x2011, 0x7490, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b,
- 0x00c0, 0x6cda, 0x2011, 0x7494, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x5b6b, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f,
- 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2011,
- 0x7483, 0x2204, 0x1078, 0x1fe4, 0x1078, 0x34fa, 0x00c0, 0x6d02,
- 0x2011, 0x7496, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b,
- 0x00c0, 0x6d02, 0x2011, 0x749a, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x5b6b, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f,
- 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x71bf, 0x252c, 0x2021, 0x71c5,
- 0x2424, 0x2061, 0x7600, 0x2071, 0x7000, 0x7644, 0x7060, 0x8001,
- 0xa602, 0x00c8, 0x6d6e, 0x2100, 0xac06, 0x0040, 0x6d64, 0x1078,
- 0x6ee7, 0x0040, 0x6d64, 0x671c, 0xa786, 0x0001, 0x0040, 0x6d83,
- 0xa786, 0x0007, 0x0040, 0x6d64, 0x2500, 0xac06, 0x0040, 0x6d64,
- 0x2400, 0xac06, 0x0040, 0x6d64, 0x1078, 0x6efb, 0x00c0, 0x6d64,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6d4a, 0x017e, 0x1078,
- 0x1629, 0x017f, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6d61,
- 0xa786, 0x0003, 0x00c0, 0x6d77, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x017e, 0x1078, 0x64f5, 0x1078, 0x3840, 0x017f, 0x1078,
- 0x644a, 0x0d7f, 0x1078, 0x6457, 0xace0, 0x0008, 0x2001, 0x7015,
- 0x2004, 0xac02, 0x00c8, 0x6d6e, 0x0078, 0x6d1b, 0x127f, 0x027f,
- 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x6d54, 0xa386, 0x0005, 0x0040, 0x6d64, 0x1078,
- 0x6e8b, 0x0078, 0x6d61, 0x1078, 0x6efb, 0x00c0, 0x6d64, 0xa180,
- 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x6d64, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x6d64, 0x1078, 0x6470, 0x0040, 0x6d9f, 0x1078,
- 0x6484, 0x00c0, 0x6d64, 0x1078, 0x58f2, 0x0078, 0x6da1, 0x1078,
- 0x21c6, 0x1078, 0x6457, 0x0078, 0x6d64, 0x0c7e, 0x0e7e, 0x017e,
- 0x2c08, 0x2170, 0x1078, 0x6ea2, 0x017f, 0x0040, 0x6db4, 0x601c,
- 0xa084, 0x0007, 0x1079, 0x6db7, 0x0e7f, 0x0c7f, 0x007c, 0x6dbf,
- 0x6dbf, 0x6dbf, 0x6dbf, 0x6dbf, 0x6dbf, 0x6dc1, 0x6dbf, 0xa006,
- 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4,
- 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x6ecf, 0x017f,
- 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x6b78, 0x037f, 0xa085,
- 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x348e, 0x157e, 0x017e,
- 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x7005, 0x2011, 0x7496,
- 0x1078, 0x5b6b, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
- 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7600, 0x2079, 0x0001, 0x8fff, 0x0040, 0x6e4b,
- 0x2071, 0x7000, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6e4b,
- 0x88ff, 0x0040, 0x6e11, 0x2800, 0xac06, 0x00c0, 0x6e41, 0x2079,
- 0x0000, 0x1078, 0x6ee7, 0x0040, 0x6e41, 0x2400, 0xac06, 0x0040,
- 0x6e41, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6e41, 0xa786, 0x0007,
- 0x0040, 0x6e41, 0x88ff, 0x00c0, 0x6e29, 0x6018, 0xa206, 0x00c0,
- 0x6e41, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6e31, 0x1078,
- 0x1629, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6e3b, 0x047e,
- 0x1078, 0x6e8b, 0x047f, 0x0d7f, 0x1078, 0x6457, 0x88ff, 0x00c0,
- 0x6e54, 0xace0, 0x0008, 0x2001, 0x7015, 0x2004, 0xac02, 0x00c8,
- 0x6e4b, 0x0078, 0x6dfd, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6e4c,
- 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
- 0x5408, 0x1078, 0x54a9, 0x1078, 0x6df0, 0x087f, 0x007c, 0x027e,
- 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007e, 0x2009,
- 0x0000, 0x017e, 0x037e, 0x1078, 0x34fa, 0x00c0, 0x6e80, 0x2c10,
- 0x2041, 0x0000, 0x1078, 0x5408, 0x1078, 0x54a9, 0x1078, 0x6df0,
- 0x037f, 0x017f, 0x8108, 0x00f0, 0x6e71, 0x157f, 0x0c7f, 0x087f,
- 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6e9f,
- 0x6800, 0xa07d, 0x0040, 0x6e9c, 0x6803, 0x0000, 0x6b52, 0x1078,
- 0x3840, 0x2f68, 0x0078, 0x6e90, 0x6b52, 0x1078, 0x3840, 0x0f7f,
- 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7600, 0x2071,
- 0x7000, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6eca, 0x2100,
- 0xac06, 0x0040, 0x6ebc, 0x6000, 0xa086, 0x0000, 0x0040, 0x6ebc,
- 0x6008, 0xa206, 0x0040, 0x6ec6, 0xace0, 0x0008, 0x2001, 0x7015,
- 0x2004, 0xac02, 0x00c8, 0x6eca, 0x0078, 0x6ea7, 0xa085, 0x0001,
- 0x0078, 0x6ecb, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
- 0x007e, 0x1078, 0x12e2, 0x007f, 0x1040, 0x1288, 0x6837, 0x010d,
- 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
- 0x6c46, 0x684f, 0x0000, 0x1078, 0x3840, 0x0d7f, 0x007c, 0x6700,
- 0xa786, 0x0000, 0x0040, 0x6efa, 0xa786, 0x0001, 0x0040, 0x6efa,
- 0xa786, 0x000a, 0x0040, 0x6efa, 0xa786, 0x0009, 0x0040, 0x6efa,
- 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206,
- 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
- 0x7040, 0xd5a4, 0x0040, 0x6f0f, 0x7034, 0x8000, 0x7036, 0xd5b4,
- 0x0040, 0x6f15, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6f1c,
- 0x2071, 0x704a, 0x1078, 0x6f4b, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7040, 0xd5a4,
- 0x0040, 0x6f2d, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6f33,
- 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6f3a, 0x2071, 0x704a,
- 0x1078, 0x6f4b, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e,
- 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7042, 0x1078, 0x6f4b, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, 0x6f54,
- 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7040,
- 0x1078, 0x6f4b, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7044, 0x1078,
- 0x6f4b, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010,
- 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000,
- 0x2000, 0x4000, 0x8000, 0xd13b
+ 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d, 0x7044, 0xa084,
+ 0x0003, 0xa086, 0x0002, 0x00c0, 0x6529, 0x684f, 0x0040, 0x0078,
+ 0x6533, 0xa086, 0x0001, 0x00c0, 0x6531, 0x684f, 0x0080, 0x0078,
+ 0x6533, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, 0x7090, 0xad90,
+ 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x6539,
+ 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, 0x35c4, 0x027f,
+ 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100,
+ 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x42c4, 0x1078, 0x4713,
+ 0x0078, 0x6547, 0x2069, 0x7092, 0x2d04, 0xa084, 0xff00, 0xa086,
+ 0x1200, 0x00c0, 0x6579, 0x2069, 0x7080, 0x686c, 0xa084, 0x00ff,
+ 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003,
+ 0x0001, 0x6007, 0x0043, 0x1078, 0x42c4, 0x1078, 0x4713, 0x0078,
+ 0x6547, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0x0078, 0x6547, 0xa284, 0x0004, 0x00c0,
+ 0x658d, 0x6013, 0x0300, 0x0078, 0x658f, 0x6013, 0x0100, 0x6003,
+ 0x0001, 0x6007, 0x0041, 0x1078, 0x42c4, 0x1078, 0x4713, 0x0078,
+ 0x6547, 0x6013, 0x0500, 0x0078, 0x658f, 0x6013, 0x0600, 0x0078,
+ 0x655a, 0x6013, 0x0200, 0x0078, 0x655a, 0xa186, 0x0013, 0x00c0,
+ 0x65b7, 0x6004, 0xa08a, 0x0040, 0x1048, 0x126a, 0xa08a, 0x0050,
+ 0x10c8, 0x126a, 0xa082, 0x0040, 0x2008, 0x0079, 0x65e8, 0xa186,
+ 0x0047, 0x00c0, 0x65bd, 0x0078, 0x6617, 0xa186, 0x0027, 0x0040,
+ 0x65c5, 0xa186, 0x0014, 0x10c0, 0x126a, 0x6004, 0xa082, 0x0040,
+ 0x2008, 0x0079, 0x65cb, 0x65db, 0x65dd, 0x65dd, 0x65db, 0x65db,
+ 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db,
+ 0x65db, 0x65db, 0x65db, 0x1078, 0x126a, 0x2001, 0x0007, 0x1078,
+ 0x3324, 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c,
+ 0x65f8, 0x6608, 0x6601, 0x6611, 0x65f8, 0x65f8, 0x65f8, 0x65f8,
+ 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8,
+ 0x1078, 0x126a, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x1078, 0x461a, 0x6003, 0x0002, 0x1078, 0x4713, 0x007c,
+ 0x1078, 0x461a, 0x1078, 0x4145, 0x1078, 0x5425, 0x1078, 0x4713,
+ 0x007c, 0x1078, 0x461a, 0x2009, 0x0041, 0x0078, 0x66e1, 0xa182,
+ 0x0040, 0x0079, 0x661b, 0x662b, 0x662d, 0x662b, 0x662b, 0x662b,
+ 0x662b, 0x662b, 0x662e, 0x662b, 0x662b, 0x662b, 0x662b, 0x662b,
+ 0x662b, 0x662b, 0x662b, 0x1078, 0x126a, 0x007c, 0x6003, 0x0004,
+ 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1505,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x663d, 0x664d, 0x664d, 0x664d,
+ 0x664d, 0x664d, 0x664d, 0x664d, 0x664d, 0x664d, 0x664f, 0x6672,
+ 0x664d, 0x664d, 0x664d, 0x664d, 0x6672, 0x1078, 0x126a, 0x1078,
+ 0x46c2, 0x1078, 0x47c3, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc,
+ 0x0040, 0x6665, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040, 0x666b,
+ 0x2009, 0x0041, 0x0d7f, 0x0078, 0x66e1, 0x6003, 0x0007, 0x1078,
+ 0x4145, 0x0d7f, 0x007c, 0x1078, 0x4145, 0x1078, 0x5425, 0x0d7f,
+ 0x0078, 0x666a, 0x2001, 0x0007, 0x1078, 0x3324, 0x1078, 0x46c2,
+ 0x1078, 0x47c3, 0x6010, 0x0d7e, 0x2068, 0x037e, 0x2019, 0x0004,
+ 0x1078, 0x6ac6, 0x037f, 0x1078, 0x60e8, 0x0d7f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x6695, 0x6004, 0xa086, 0x0042, 0x10c0, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x4713, 0x007c, 0xa186, 0x0027, 0x0040,
+ 0x669d, 0xa186, 0x0014, 0x00c0, 0x66ad, 0x6004, 0xa086, 0x0042,
+ 0x10c0, 0x126a, 0x2001, 0x0007, 0x1078, 0x3324, 0x1078, 0x461a,
+ 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x66b1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1,
+ 0x66c3, 0x66cf, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1,
+ 0x66c1, 0x1078, 0x126a, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18,
+ 0x3e20, 0x2c10, 0x1078, 0x1505, 0x047f, 0x037f, 0x007c, 0x6010,
+ 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x66db, 0x2009, 0x0041,
+ 0x0d7f, 0x0078, 0x66e1, 0x6003, 0x0007, 0x1078, 0x4145, 0x0d7f,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x66e5, 0x66f5, 0x66f7, 0x6703,
+ 0x670f, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5,
+ 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x1078, 0x126a, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x42c4,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c, 0x6003,
+ 0x0003, 0x6106, 0x2c10, 0x1078, 0x18d5, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x4330, 0x1078, 0x47c3, 0x127f, 0x007c, 0x1078, 0x461a,
+ 0x0078, 0x6724, 0x1078, 0x46c2, 0x6110, 0x81ff, 0x0040, 0x6731,
+ 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x6ac6, 0x037f,
+ 0x0d7f, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182, 0x0085,
+ 0x0079, 0x673a, 0x6741, 0x6741, 0x6741, 0x6743, 0x6741, 0x6741,
+ 0x6741, 0x1078, 0x126a, 0x027e, 0x0e7e, 0x2071, 0x7080, 0x7220,
+ 0x1078, 0x69e0, 0x0040, 0x6750, 0x6007, 0x0086, 0x0078, 0x6752,
+ 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, 0x42c4, 0x1078, 0x4713,
+ 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x676c, 0x6004,
+ 0xa08a, 0x0085, 0x1048, 0x126a, 0xa08a, 0x008c, 0x10c8, 0x126a,
+ 0xa082, 0x0085, 0x0079, 0x677f, 0xa186, 0x0027, 0x0040, 0x6774,
+ 0xa186, 0x0014, 0x10c0, 0x126a, 0x2001, 0x0007, 0x1078, 0x3324,
+ 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0x6786,
+ 0x6788, 0x6788, 0x6786, 0x6786, 0x6786, 0x6786, 0x1078, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0xa182,
+ 0x0085, 0x1048, 0x126a, 0xa182, 0x008c, 0x10c8, 0x126a, 0xa182,
+ 0x0085, 0x0079, 0x679b, 0x67a2, 0x67a2, 0x67a2, 0x67a4, 0x67a2,
+ 0x67a2, 0x67a2, 0x1078, 0x126a, 0x007c, 0x1078, 0x461a, 0x1078,
+ 0x60e8, 0x1078, 0x4713, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078,
+ 0x67b5, 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e,
+ 0x2091, 0x8000, 0x2c40, 0x1078, 0x5180, 0x00c0, 0x67e2, 0x1078,
+ 0x5221, 0x00c0, 0x67e2, 0x6000, 0xa086, 0x0000, 0x0040, 0x67e2,
+ 0x601c, 0xa086, 0x0007, 0x0040, 0x67e2, 0x0d7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x67d5, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x67dd, 0x1078, 0x6ac6, 0x0d7f, 0x6013, 0x0000,
+ 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e,
+ 0x037e, 0x157e, 0x2079, 0x7080, 0x7838, 0xa084, 0x00ff, 0xa005,
+ 0x00c0, 0x681e, 0x783c, 0x1078, 0x1f61, 0x017e, 0x0c7e, 0x1078,
+ 0x336a, 0x00c0, 0x681c, 0x2011, 0x7090, 0xac98, 0x000a, 0x20a9,
+ 0x0004, 0x1078, 0x588d, 0x00c0, 0x681c, 0x017f, 0x027f, 0x027e,
+ 0x017e, 0x2019, 0x0029, 0x1078, 0x52f5, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x017f, 0x1078, 0x6946, 0x1078, 0x34f2, 0x017f, 0x1078,
+ 0x316e, 0xa006, 0x0078, 0x681e, 0x0c7f, 0x017f, 0x157f, 0x037f,
+ 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6c1c,
+ 0x2104, 0xa086, 0x0074, 0x00c0, 0x687a, 0x2069, 0x708e, 0x690c,
+ 0xa182, 0x0100, 0x0048, 0x686a, 0x6908, 0xa184, 0x8000, 0x0040,
+ 0x6876, 0xa184, 0x0800, 0x0040, 0x6876, 0x6910, 0xa18a, 0x0001,
+ 0x0048, 0x686e, 0x6914, 0x2069, 0x70ae, 0x6904, 0x81ff, 0x00c0,
+ 0x6862, 0x690c, 0xa182, 0x0100, 0x0048, 0x686a, 0x6908, 0x81ff,
+ 0x00c0, 0x6866, 0x6910, 0xa18a, 0x0001, 0x0048, 0x686e, 0x6918,
+ 0xa18a, 0x0001, 0x0048, 0x6876, 0x0078, 0x6880, 0x6013, 0x0100,
+ 0x0078, 0x687c, 0x6013, 0x0300, 0x0078, 0x687c, 0x6013, 0x0500,
+ 0x0078, 0x687c, 0x6013, 0x0700, 0x0078, 0x687c, 0x6013, 0x0900,
+ 0x0078, 0x687c, 0x6013, 0x0b00, 0x0078, 0x687c, 0x6013, 0x0f00,
+ 0x0078, 0x687c, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x6881,
+ 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
+ 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
+ 0x0006, 0x0040, 0x68a9, 0xa286, 0x0004, 0x0040, 0x68a9, 0xa394,
+ 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x68a9, 0xa286, 0x0004,
+ 0x0040, 0x68a9, 0x0c7e, 0x2d60, 0x1078, 0x337c, 0x0c7f, 0x0078,
+ 0x68dc, 0x2011, 0x7096, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x588d, 0x00c0, 0x68dd, 0x2011, 0x709a, 0xad98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x588d, 0x00c0, 0x68dd, 0x047e, 0x017e, 0x6aa0,
+ 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x6c52, 0x210c, 0xd1a4,
+ 0x0040, 0x68d1, 0x2009, 0x0029, 0x1078, 0x6b0a, 0x6800, 0xc0e5,
+ 0x6802, 0x2019, 0x0029, 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08,
+ 0x1078, 0x6946, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
+ 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x708e, 0x6800, 0xa086,
+ 0x0800, 0x0040, 0x68ef, 0x6013, 0x0000, 0x0078, 0x68f0, 0xa006,
+ 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
+ 0x2079, 0x708c, 0x7830, 0xa00d, 0x00c0, 0x6917, 0x7834, 0x1078,
+ 0x1f61, 0x1078, 0x336a, 0x00c0, 0x6917, 0x2011, 0x7090, 0xac98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x588d, 0x00c0, 0x6917, 0x2011,
+ 0x7094, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x588d, 0x157f,
+ 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e,
+ 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0x7083, 0x2204, 0x1078,
+ 0x1f61, 0x1078, 0x336a, 0x00c0, 0x693f, 0x2011, 0x7096, 0xac98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x588d, 0x00c0, 0x693f, 0x2011,
+ 0x709a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x588d, 0x157f,
+ 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
+ 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
+ 0x2029, 0x6db9, 0x252c, 0x2021, 0x6dbf, 0x2424, 0x2061, 0x7200,
+ 0x2071, 0x6c00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x69a9,
+ 0x2100, 0xac06, 0x0040, 0x699f, 0x1078, 0x6b22, 0x0040, 0x699f,
+ 0x671c, 0xa786, 0x0001, 0x0040, 0x69be, 0xa786, 0x0007, 0x0040,
+ 0x699f, 0x2500, 0xac06, 0x0040, 0x699f, 0x2400, 0xac06, 0x0040,
+ 0x699f, 0x1078, 0x6b36, 0x00c0, 0x699f, 0x0d7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x6987, 0x017e, 0x1078, 0x15fc, 0x017f, 0x6010,
+ 0x2068, 0x1078, 0x5fcd, 0x0040, 0x699c, 0xa786, 0x0003, 0x00c0,
+ 0x69b2, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
+ 0x35c4, 0x017f, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x60e8, 0xace0,
+ 0x0008, 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x69a9, 0x0078,
+ 0x6958, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f,
+ 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x6991, 0xa386, 0x0005,
+ 0x0040, 0x699f, 0x1078, 0x6ac6, 0x0078, 0x699c, 0x1078, 0x6b36,
+ 0x00c0, 0x699f, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0,
+ 0x699f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x699f, 0x1078, 0x6101,
+ 0x0040, 0x69da, 0x1078, 0x6115, 0x00c0, 0x699f, 0x1078, 0x5614,
+ 0x0078, 0x69dc, 0x1078, 0x2143, 0x1078, 0x60e8, 0x0078, 0x699f,
+ 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x6add, 0x017f,
+ 0x0040, 0x69ef, 0x601c, 0xa084, 0x0007, 0x1079, 0x69f2, 0x0e7f,
+ 0x0c7f, 0x007c, 0x69fa, 0x69fa, 0x69fa, 0x69fa, 0x69fa, 0x69fa,
+ 0x69fc, 0x69fa, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080,
+ 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020,
+ 0x1078, 0x6b0a, 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078,
+ 0x67b5, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078,
+ 0x3302, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019,
+ 0x6c05, 0x2011, 0x7096, 0x1078, 0x588d, 0x037f, 0x027f, 0x017f,
+ 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e,
+ 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7200, 0x2079, 0x0001,
+ 0x8fff, 0x0040, 0x6a86, 0x2071, 0x6c00, 0x7644, 0x7060, 0x8001,
+ 0xa602, 0x00c8, 0x6a86, 0x88ff, 0x0040, 0x6a4c, 0x2800, 0xac06,
+ 0x00c0, 0x6a7c, 0x2079, 0x0000, 0x1078, 0x6b22, 0x0040, 0x6a7c,
+ 0x2400, 0xac06, 0x0040, 0x6a7c, 0x671c, 0xa786, 0x0006, 0x00c0,
+ 0x6a7c, 0xa786, 0x0007, 0x0040, 0x6a7c, 0x88ff, 0x00c0, 0x6a64,
+ 0x6018, 0xa206, 0x00c0, 0x6a7c, 0x0d7e, 0x6000, 0xa086, 0x0004,
+ 0x00c0, 0x6a6c, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x6a76, 0x047e, 0x1078, 0x6ac6, 0x047f, 0x0d7f, 0x1078,
+ 0x60e8, 0x88ff, 0x00c0, 0x6a8f, 0xace0, 0x0008, 0x2001, 0x6c15,
+ 0x2004, 0xac02, 0x00c8, 0x6a86, 0x0078, 0x6a38, 0xa006, 0x127f,
+ 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5,
+ 0x0001, 0x0078, 0x6a87, 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019,
+ 0x0002, 0x6218, 0x1078, 0x5180, 0x1078, 0x5221, 0x1078, 0x6a2b,
+ 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20,
+ 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x336a,
+ 0x00c0, 0x6abb, 0x2c10, 0x2041, 0x0000, 0x1078, 0x5180, 0x1078,
+ 0x5221, 0x1078, 0x6a2b, 0x037f, 0x017f, 0x8108, 0x00f0, 0x6aac,
+ 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e,
+ 0x8dff, 0x0040, 0x6ada, 0x6800, 0xa07d, 0x0040, 0x6ad7, 0x6803,
+ 0x0000, 0x6b52, 0x1078, 0x35c4, 0x2f68, 0x0078, 0x6acb, 0x6b52,
+ 0x1078, 0x35c4, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e,
+ 0x2061, 0x7200, 0x2071, 0x6c00, 0x7444, 0x7060, 0x8001, 0xa402,
+ 0x00c8, 0x6b05, 0x2100, 0xac06, 0x0040, 0x6af7, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x6af7, 0x6008, 0xa206, 0x0040, 0x6b01, 0xace0,
+ 0x0008, 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x6b05, 0x0078,
+ 0x6ae2, 0xa085, 0x0001, 0x0078, 0x6b06, 0xa006, 0x037f, 0x047f,
+ 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x12c2, 0x007f, 0x1040,
+ 0x126a, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b,
+ 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000, 0x1078, 0x35c4,
+ 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040, 0x6b35, 0xa786,
+ 0x0001, 0x0040, 0x6b35, 0xa786, 0x000a, 0x0040, 0x6b35, 0xa786,
+ 0x0009, 0x0040, 0x6b35, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018,
+ 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e,
+ 0x2091, 0x8000, 0x2071, 0x6c40, 0xd5a4, 0x0040, 0x6b4a, 0x7034,
+ 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6b50, 0x7030, 0x8000, 0x7032,
+ 0xd5ac, 0x0040, 0x6b57, 0x2071, 0x6c4a, 0x1078, 0x6b86, 0x0e7f,
+ 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6c40, 0xd5a4, 0x0040, 0x6b68, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6b6e, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6b75, 0x2071, 0x6c4a, 0x1078, 0x6b86, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6c42,
+ 0x1078, 0x6b86, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000,
+ 0x2072, 0x00c8, 0x6b8f, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c,
+ 0x0e7e, 0x2071, 0x6c40, 0x1078, 0x6b86, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6c44, 0x1078, 0x6b86, 0x0e7f, 0x007c, 0x0001, 0x0002,
+ 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
+ 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x3cfe
};
-#define ISP2100_CODE_LENGTH 0x5f74
+#define ISP2100_CODE_LENGTH 0x5baf
#endif
-#if defined(ISP2100_FABRIC) && !defined(ISP2100_SCCLUN)
+#if 1
/************************************************************************
* *
- * --- ISP2100 Fabric Initiator/Target Firmware --- *
+ * --- ISP2100 Initiator/Target Firmware --- *
* *
* *
************************************************************************
@@ -8141,618 +9209,580 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
************************************************************************
*/
/*
- * Firmware Version 1.15.07 (14:45 Oct 13, 1998)
+ * Firmware Version 1.15.00 (12:09 Sep 10, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+15
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x6591, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5e35, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x7591, 0x2009, 0x0000, 0x20a9,
- 0x076f, 0x41a4, 0x3400, 0x20c9, 0x7aff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x2074, 0x2051, 0x7600,
- 0x2a70, 0x705b, 0x9500, 0x705f, 0xffff, 0x7057, 0x94f9, 0x7063,
- 0x0300, 0x1078, 0x1282, 0x20a1, 0x7d00, 0x715c, 0x810d, 0x810d,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6e35, 0x2009, 0x0000, 0x20a9,
+ 0x06cb, 0x41a4, 0x3400, 0x20c9, 0x72ff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1fbd, 0x2051, 0x6f00,
+ 0x2a70, 0x705b, 0x8d00, 0x705f, 0xffff, 0x7057, 0x8cf9, 0x7063,
+ 0x0300, 0x1078, 0x1233, 0x20a1, 0x7500, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1249, 0x1078, 0x136e, 0x1078, 0x14f3, 0x1078, 0x19a0,
- 0x1078, 0x35cf, 0x1078, 0x5b46, 0x1078, 0x12f9, 0x1078, 0x2403,
- 0x1078, 0x3c08, 0x1078, 0x39e0, 0x1078, 0x4446, 0x1078, 0x1e2f,
- 0x1078, 0x4685, 0x1078, 0x4126, 0x1078, 0x1d4e, 0x1078, 0x1e0e,
+ 0x1078, 0x11fe, 0x1078, 0x131f, 0x1078, 0x14a4, 0x1078, 0x1915,
+ 0x1078, 0x328f, 0x1078, 0x5533, 0x1078, 0x12aa, 0x1078, 0x22c3,
+ 0x1078, 0x38c8, 0x1078, 0x36a0, 0x1078, 0x4079, 0x1078, 0x1d9b,
+ 0x1078, 0x42b8, 0x1078, 0x3de6, 0x1078, 0x1cc3, 0x1078, 0x1d7a,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2d45, 0x1078, 0x242b, 0x1078, 0x3c58,
- 0x1078, 0x3acb, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x445e, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5818, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x114b,
- 0x10cd, 0x11c6, 0x1246, 0x1247, 0x1248, 0x1078, 0x12d5, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2e6a, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x113c, 0x2011, 0x34fc, 0x1078, 0x4520,
+ 0x00c0, 0x10bd, 0x1078, 0x2a07, 0x1078, 0x22eb, 0x1078, 0x3918,
+ 0x1078, 0x378b, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x4091, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x5205, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
+ 0x10cd, 0x117d, 0x11fb, 0x11fc, 0x11fd, 0x1078, 0x1286, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b2a, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x31bc, 0x1078, 0x4153,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b8, 0x1078, 0x2d02, 0x1078, 0x5663, 0x2011, 0x0004, 0x1078,
- 0x68f8, 0x1078, 0x397a, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
- 0x0000, 0x1078, 0x113f, 0x2011, 0x0000, 0x2079, 0x7651, 0x7804,
- 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
- 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
- 0x1078, 0x68f8, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x0f7f, 0x1078, 0x2124, 0x2011, 0x0005, 0x1078, 0x5772, 0x1078,
- 0x4c2c, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
- 0x0078, 0x113e, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x2011, 0x0005, 0x1078, 0x5772, 0x1078, 0x4c2c, 0x0c7e, 0x2061,
- 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f, 0x127f, 0x007c, 0x0c7e,
- 0x20a9, 0x0082, 0x2009, 0x007e, 0x1078, 0x37bf, 0x8108, 0x00f0,
- 0x1144, 0x0c7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086,
- 0xffff, 0x0040, 0x1159, 0x1078, 0x2124, 0x1078, 0x4c2c, 0x0078,
- 0x11c4, 0x70bc, 0xd09c, 0x0040, 0x1181, 0xd084, 0x0040, 0x1181,
- 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
- 0x0040, 0x1181, 0x70c0, 0xa086, 0xffff, 0x0040, 0x117d, 0x1078,
- 0x2219, 0x1078, 0x4c2c, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078,
- 0x2251, 0x1078, 0x4c2c, 0x0078, 0x11c4, 0x70c4, 0xa005, 0x00c0,
- 0x11c4, 0x7088, 0xa005, 0x00c0, 0x11c4, 0x2001, 0x7652, 0x2004,
- 0xd0ac, 0x0040, 0x11a7, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x1078, 0x37d7, 0x00c0, 0x119a, 0x6000, 0xd0ec,
- 0x00c0, 0x11a2, 0x017f, 0x8108, 0x00f0, 0x1191, 0x0c7f, 0x157f,
- 0x0078, 0x11a7, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x11c4, 0x7003,
- 0x0003, 0x708f, 0xffff, 0x2001, 0x0000, 0x1078, 0x1fff, 0x1078,
- 0x2d80, 0x2001, 0x7837, 0x2004, 0xa086, 0x0005, 0x00c0, 0x11bc,
- 0x2011, 0x0000, 0x1078, 0x5772, 0x2011, 0x0000, 0x1078, 0x577c,
- 0x1078, 0x4c2c, 0x1078, 0x4cec, 0x127f, 0x007c, 0x017e, 0x0f7e,
- 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010,
- 0x7942, 0x7924, 0xd1b4, 0x0040, 0x11d7, 0x7827, 0x0040, 0xd19c,
- 0x0040, 0x11dc, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900,
- 0xa18a, 0x0003, 0x0050, 0x1202, 0x7954, 0xd1ac, 0x00c0, 0x1202,
- 0x2009, 0x00f8, 0x1078, 0x359e, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11fa, 0x7824, 0xd0ac,
- 0x00c0, 0x1236, 0x00f0, 0x11f2, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x0078, 0x123f, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008,
- 0x00e0, 0x1208, 0x2091, 0x6000, 0x00f0, 0x1208, 0x7853, 0x0400,
- 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x359e, 0x20a9, 0x000e,
- 0x0005, 0x00f0, 0x1218, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843,
- 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040,
- 0x122d, 0x7824, 0xd0ac, 0x00c0, 0x1236, 0x8319, 0x00c0, 0x1223,
- 0x2001, 0x0001, 0x1078, 0x1fff, 0x0078, 0x123d, 0x7828, 0xc09d,
- 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f,
- 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c,
- 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x1255, 0x704f, 0xffff, 0x0078, 0x1257, 0x704f, 0x0000, 0x7053,
- 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, 0x7820, 0x6003,
- 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
- 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
- 0x7828, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
- 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
- 0x0000, 0x007c, 0x1078, 0x12a8, 0x2011, 0x0000, 0x81ff, 0x0040,
- 0x12a7, 0xa186, 0x0001, 0x00c0, 0x1297, 0x705f, 0x8fff, 0x7057,
- 0x8501, 0x7063, 0x0100, 0x705b, 0x8500, 0x0078, 0x12a5, 0xa186,
- 0x0002, 0x00c0, 0x129f, 0x2011, 0x0000, 0x0078, 0x12a5, 0xa186,
- 0x0005, 0x00c0, 0x12a5, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c,
- 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12cf, 0x2019, 0xaaaa,
- 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406,
- 0x0040, 0x12bd, 0xc18d, 0x0078, 0x12ca, 0xc185, 0x2011, 0x0001,
- 0x1078, 0x12cf, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0,
- 0x12ca, 0xc195, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, 0x3800,
- 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068,
- 0x12d7, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084, 0x0000,
- 0x00c0, 0x12dd, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f, 0x7826,
- 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2079, 0x7600, 0x7803, 0x0005, 0x0078, 0x12f6,
- 0x007c, 0x2071, 0x7600, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
- 0x002d, 0xa298, 0x002d, 0x0048, 0x130f, 0x705c, 0xa302, 0x00c8,
- 0x130f, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x1301, 0x200b,
- 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7600, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1322, 0xa06e,
- 0x0078, 0x132c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
- 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x7600, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
- 0x133c, 0xa06e, 0x0078, 0x1345, 0x70a2, 0x702c, 0x2068, 0x2d04,
+ 0x73b0, 0x1078, 0x29c6, 0x1078, 0x5050, 0x2011, 0x0004, 0x1078,
+ 0x61f1, 0x1078, 0x363a, 0x2079, 0x6f51, 0x7804, 0xd0ac, 0x00c0,
+ 0x1115, 0x2011, 0x0001, 0x1078, 0x61f1, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x206d, 0x2011, 0x0005,
+ 0x1078, 0x515f, 0x1078, 0x484d, 0x0c7e, 0x2061, 0x0100, 0x60e3,
+ 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x515f, 0x1078,
+ 0x484d, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
+ 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
+ 0x0040, 0x1138, 0x1078, 0x206d, 0x1078, 0x484d, 0x0078, 0x117b,
+ 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x6f52, 0x2004, 0xd0ac,
+ 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
+ 0x017e, 0x1078, 0x3497, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
+ 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
+ 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
+ 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f5e, 0x1078, 0x2a40,
+ 0x2001, 0x70b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
+ 0x0000, 0x1078, 0x515f, 0x2011, 0x0000, 0x1078, 0x5169, 0x1078,
+ 0x484d, 0x1078, 0x48fd, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0100, 0x7843, 0x0000, 0x7924, 0xd1b4,
+ 0x0040, 0x118c, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1191, 0x7827,
+ 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a, 0x0003, 0x0050,
+ 0x11b7, 0x7954, 0xd1ac, 0x00c0, 0x11b7, 0x2009, 0x00f8, 0x1078,
+ 0x325e, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820,
+ 0xd09c, 0x00c0, 0x11af, 0x7824, 0xd0ac, 0x00c0, 0x11eb, 0x00f0,
+ 0x11a7, 0x2001, 0x0001, 0x1078, 0x1f5e, 0x0078, 0x11f4, 0x7853,
+ 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0, 0x11bd, 0x2091,
+ 0x6000, 0x00f0, 0x11bd, 0x7853, 0x0400, 0x782f, 0x0000, 0x2009,
+ 0x00f8, 0x1078, 0x325e, 0x20a9, 0x000e, 0x0005, 0x00f0, 0x11cd,
+ 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010, 0x2019, 0x61a8,
+ 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e2, 0x7824, 0xd0ac,
+ 0x00c0, 0x11eb, 0x8319, 0x00c0, 0x11d8, 0x2001, 0x0001, 0x1078,
+ 0x1f5e, 0x0078, 0x11f2, 0x7828, 0xc09d, 0x782a, 0x7827, 0x0008,
+ 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f, 0x127f,
+ 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70, 0x2009,
+ 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120a, 0x704f, 0xffff,
+ 0x0078, 0x120c, 0x704f, 0x0000, 0x7053, 0xffff, 0x2061, 0x70a0,
+ 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200,
+ 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0,
+ 0x2061, 0x70a8, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000,
+ 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001,
+ 0x601f, 0x0000, 0x007c, 0x1078, 0x1259, 0x2011, 0x0000, 0x81ff,
+ 0x0040, 0x1258, 0xa186, 0x0001, 0x00c0, 0x1248, 0x705f, 0x8fff,
+ 0x7057, 0x7d01, 0x7063, 0x0100, 0x705b, 0x7d00, 0x0078, 0x1256,
+ 0xa186, 0x0002, 0x00c0, 0x1250, 0x2011, 0x0000, 0x0078, 0x1256,
+ 0xa186, 0x0005, 0x00c0, 0x1256, 0x2011, 0x0001, 0x1078, 0x1280,
+ 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x1280, 0x2019,
+ 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04,
+ 0xa406, 0x0040, 0x126e, 0xc18d, 0x0078, 0x127b, 0xc185, 0x2011,
+ 0x0001, 0x1078, 0x1280, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306,
+ 0x00c0, 0x127b, 0xc195, 0x2011, 0x0001, 0x1078, 0x1280, 0x007c,
+ 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000,
+ 0x0068, 0x1288, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084,
+ 0x0000, 0x00c0, 0x128e, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f,
+ 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091,
+ 0x5000, 0x2091, 0x4080, 0x2079, 0x6f00, 0x7803, 0x0005, 0x0078,
+ 0x12a7, 0x007c, 0x2071, 0x6f00, 0x7158, 0x712e, 0x2021, 0x0001,
+ 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c0, 0x705c, 0xa302,
+ 0x00c8, 0x12c0, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x12b2,
+ 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f00, 0x7098, 0xa0ea, 0x0010, 0x00c8, 0x12d3,
+ 0xa06e, 0x0078, 0x12dd, 0x8001, 0x709a, 0x702c, 0x2068, 0x2d04,
0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
- 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7600, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
- 0x8dff, 0x0040, 0x1364, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
- 0x1348, 0x0d7f, 0x0078, 0x1358, 0x007c, 0x0e7e, 0x2071, 0x7600,
- 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
- 0x7859, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
- 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
- 0x2270, 0x700b, 0x0000, 0x2071, 0x7859, 0x7018, 0xa088, 0x7862,
- 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
- 0x1397, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7859, 0x7004, 0xa005, 0x00c0, 0x13a6,
- 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, 0x007c,
- 0x7000, 0x0079, 0x13ab, 0x13af, 0x1419, 0x1436, 0x1436, 0x7018,
- 0x711c, 0xa106, 0x00c0, 0x13b7, 0x7007, 0x0000, 0x007c, 0x0d7e,
- 0xa180, 0x7862, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
- 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
- 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
- 0x0d7f, 0xd084, 0x0040, 0x13d9, 0x7007, 0x0001, 0x1078, 0x13de,
- 0x007c, 0x7007, 0x0002, 0x1078, 0x13f4, 0x007c, 0x017e, 0x027e,
- 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e9, 0x2110,
- 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
- 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
- 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1408, 0x2110, 0xa006,
- 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x76e5, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
- 0x76e0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
- 0x157e, 0x2001, 0x7714, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
- 0x2001, 0x7715, 0x20ac, 0x53a6, 0x2099, 0x7716, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
- 0x7711, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
- 0x2071, 0x7859, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
- 0xd1fc, 0x0040, 0x1479, 0xa18c, 0x0700, 0x0040, 0x1476, 0x7008,
- 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1479, 0x7004, 0x1079,
- 0x147d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13a8, 0x1485, 0x14a7,
- 0x14c1, 0x14ea, 0x1483, 0x0078, 0x1483, 0x137e, 0x147e, 0x157e,
- 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
- 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
- 0x0040, 0x14ae, 0x1078, 0x13de, 0x007c, 0x7008, 0xa080, 0x0002,
- 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x13a8, 0x007c, 0x700c,
- 0xa005, 0x0040, 0x14ae, 0x1078, 0x13f4, 0x007c, 0x0d7e, 0x7008,
- 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
- 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x13a8,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x76e3, 0x2004, 0xa080,
- 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
- 0x53a5, 0x2001, 0x76e5, 0x2004, 0xd0bc, 0x0040, 0x14e0, 0x2001,
- 0x76ee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
- 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x3d01, 0x1078,
- 0x13a8, 0x007c, 0x2001, 0x7713, 0x2003, 0x0100, 0x7007, 0x0000,
- 0x1078, 0x13a8, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
- 0x2071, 0x786a, 0x7003, 0x0000, 0x700f, 0x7870, 0x7013, 0x7870,
- 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
- 0x1509, 0x1511, 0x1557, 0x1511, 0x1511, 0x1511, 0x153c, 0x1520,
- 0x1515, 0xa085, 0x0001, 0x0078, 0x1571, 0x684c, 0xd0bc, 0x0040,
- 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x155f,
- 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1511, 0x684c, 0xd0bc,
- 0x0040, 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0x6858, 0x0078, 0x1567, 0xa18c, 0x00ff, 0xa186, 0x0015,
- 0x00c0, 0x1511, 0x684c, 0xd0ac, 0x0040, 0x1511, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1567, 0x684c,
- 0xd0ac, 0x0040, 0x1511, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c,
- 0x000f, 0xa188, 0x1c5c, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826,
- 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a,
- 0x2004, 0x82ff, 0x0040, 0x158c, 0xa280, 0x0004, 0x0d7e, 0x206c,
- 0x684c, 0xd0dc, 0x00c0, 0x1588, 0x1078, 0x1504, 0x10c0, 0x12d5,
- 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e,
- 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0,
- 0x15a0, 0x7206, 0x2001, 0x15b4, 0x007e, 0x2260, 0x0078, 0x16cc,
- 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
- 0x788b, 0x0048, 0x15ad, 0x2009, 0x7870, 0x710e, 0x7000, 0xa005,
- 0x00c0, 0x15b4, 0x1078, 0x16b5, 0x127f, 0x007c, 0x127e, 0x027e,
- 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f,
- 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e,
- 0xa005, 0x0040, 0x1608, 0x6808, 0xa005, 0x0040, 0x166e, 0x7000,
- 0xa005, 0x00c0, 0x15d5, 0x0078, 0x1602, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x1672, 0x7004, 0xa406, 0x00c0, 0x1602, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15eb, 0x047e, 0x1078, 0x17a5, 0x047f,
- 0x2460, 0x0078, 0x15cb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15de, 0x7804, 0xa084, 0x6000, 0x0040, 0x15fc, 0xa086, 0x6000,
- 0x0040, 0x15fc, 0x0078, 0x15de, 0x7803, 0x0004, 0x7003, 0x0000,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x0078, 0x1672,
- 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, 0xa005, 0x00c0, 0x1612,
- 0x0078, 0x166e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x161b, 0x7004,
- 0xa406, 0x00c0, 0x166e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040,
- 0x1628, 0x047e, 0x1078, 0x17a5, 0x047f, 0x2460, 0x0078, 0x1608,
- 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x161b, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x00c0, 0x1621, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x163f, 0xa086, 0x6000, 0x0040, 0x163f, 0x0078, 0x161b, 0x7007,
- 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x1660,
- 0xa08e, 0x0002, 0x00c0, 0x166e, 0x0c7e, 0x0e7e, 0x6818, 0x2060,
- 0x1078, 0x1c31, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x165c,
- 0x7308, 0x720c, 0x0078, 0x165e, 0x7310, 0x7214, 0x0e7f, 0x0c7f,
- 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814,
- 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048,
- 0x1078, 0x5bdb, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
- 0x2071, 0x786a, 0x7000, 0xa086, 0x0000, 0x0040, 0x16b2, 0x7004,
- 0xac06, 0x00c0, 0x16a3, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0,
- 0x169f, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1685, 0x7803,
- 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1691, 0x7803, 0x0002, 0x7803,
- 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x16a3, 0x1078,
- 0x17a5, 0x0078, 0x167a, 0x157e, 0x20a9, 0x0009, 0x2009, 0x7870,
- 0x2104, 0xac06, 0x00c0, 0x16ad, 0x200a, 0xa188, 0x0003, 0x00f0,
- 0x16a8, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x16bd, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060,
- 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x788b, 0x0048,
- 0x16cb, 0x2009, 0x7870, 0x7112, 0x8cff, 0x00c0, 0x16eb, 0x7908,
- 0xd1ec, 0x00c0, 0x16df, 0x1078, 0x197e, 0x0040, 0x16df, 0x7803,
- 0x0009, 0x7904, 0xd1fc, 0x0040, 0x16d9, 0x7803, 0x0006, 0x7007,
- 0x0000, 0x1078, 0x197e, 0x0040, 0x1712, 0x7803, 0x0019, 0x7003,
- 0x0003, 0x0078, 0x1712, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406,
- 0x00c0, 0x16f6, 0x682c, 0xa306, 0x0040, 0x16fa, 0x1078, 0x1c7c,
- 0x00c0, 0x16cf, 0x684c, 0xd0f4, 0x00c0, 0x16cf, 0x6824, 0x2050,
- 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009,
- 0x0011, 0x1078, 0x1713, 0x0040, 0x1711, 0x2009, 0x0001, 0x1078,
- 0x1713, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x17a0, 0xa03e, 0x2730,
- 0x6850, 0xd0fc, 0x00c0, 0x1732, 0x0d7e, 0x2804, 0xac68, 0x2900,
- 0x0079, 0x1722, 0x1782, 0x1742, 0x1742, 0x1782, 0x1782, 0x177a,
- 0x1782, 0x1742, 0x1782, 0x1748, 0x1748, 0x1782, 0x1782, 0x1782,
- 0x1771, 0x1748, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20,
- 0x0d7e, 0xd99c, 0x0040, 0x1785, 0x2804, 0xac68, 0x6f08, 0x6e0c,
- 0x0078, 0x1785, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1785,
- 0x7b0c, 0xd3bc, 0x0040, 0x1769, 0x7004, 0x0e7e, 0x2070, 0x701c,
- 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1769, 0x7b08, 0xa39c, 0x0fff,
- 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, 0x00c0, 0x1764, 0x6810,
- 0xa302, 0x0048, 0x1764, 0x6b10, 0x2011, 0x0000, 0x2468, 0x0078,
- 0x176b, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
- 0x1785, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
- 0x00c0, 0x1782, 0x0d7f, 0x1078, 0x1c18, 0x00c0, 0x1713, 0xa00e,
- 0x0078, 0x17a0, 0x0d7f, 0x1078, 0x12d5, 0x7b22, 0x7a26, 0x7d32,
+ 0x0e7e, 0x2071, 0x6f00, 0x127e, 0x2091, 0x8000, 0x7098, 0x8001,
+ 0x00c8, 0x12ed, 0xa06e, 0x0078, 0x12f6, 0x709a, 0x702c, 0x2068,
+ 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00, 0x702c,
+ 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x127f, 0x0e7f,
+ 0x007c, 0x8dff, 0x0040, 0x1315, 0x6804, 0x6807, 0x0000, 0x007e,
+ 0x1078, 0x12f9, 0x0d7f, 0x0078, 0x1309, 0x007c, 0x0e7e, 0x2071,
+ 0x6f00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x70d9, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000,
+ 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c,
+ 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x70d9, 0x7018, 0xa088,
+ 0x70e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005,
+ 0x00c0, 0x1348, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1359, 0x0f7f,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7004, 0xa005, 0x00c0,
+ 0x1357, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1359, 0x0f7f, 0x0e7f,
+ 0x007c, 0x7000, 0x0079, 0x135c, 0x1360, 0x13ca, 0x13e7, 0x13e7,
+ 0x7018, 0x711c, 0xa106, 0x00c0, 0x1368, 0x7007, 0x0000, 0x007c,
+ 0x0d7e, 0xa180, 0x70e2, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c,
+ 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836,
+ 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016,
+ 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138a, 0x7007, 0x0001, 0x1078,
+ 0x138f, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a5, 0x007c, 0x017e,
+ 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x139a,
+ 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020,
+ 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e,
+ 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026,
+ 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13b9, 0x2110,
+ 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020,
+ 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f,
+ 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x6fe5, 0x20a1,
+ 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091,
+ 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002,
+ 0x700b, 0x6fe0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e,
+ 0x147e, 0x157e, 0x2001, 0x7014, 0x209c, 0x20a1, 0x0014, 0x7803,
+ 0x0026, 0x2001, 0x7015, 0x20ac, 0x53a6, 0x2099, 0x7016, 0x20a1,
+ 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091,
+ 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002,
+ 0x700b, 0x7011, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e,
+ 0x0e7e, 0x2071, 0x70d9, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803,
+ 0x0002, 0xd1fc, 0x0040, 0x142a, 0xa18c, 0x0700, 0x0040, 0x1427,
+ 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x142a, 0x7004,
+ 0x1079, 0x142e, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1359, 0x1436,
+ 0x1458, 0x1472, 0x149b, 0x1434, 0x0078, 0x1434, 0x137e, 0x147e,
+ 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010,
+ 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c,
+ 0xa005, 0x0040, 0x145f, 0x1078, 0x138f, 0x007c, 0x7008, 0xa080,
+ 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1359, 0x007c,
+ 0x700c, 0xa005, 0x0040, 0x145f, 0x1078, 0x13a5, 0x007c, 0x0d7e,
+ 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e,
+ 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078,
+ 0x1359, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6fe3, 0x2004,
+ 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9,
+ 0x0020, 0x53a5, 0x2001, 0x6fe5, 0x2004, 0xd0bc, 0x0040, 0x1491,
+ 0x2001, 0x6fee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020,
+ 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x39c1,
+ 0x1078, 0x1359, 0x007c, 0x2001, 0x7013, 0x2003, 0x0100, 0x7007,
+ 0x0000, 0x1078, 0x1359, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079,
+ 0x0030, 0x2071, 0x70ea, 0x7003, 0x0000, 0x700f, 0x70f0, 0x7013,
+ 0x70f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007,
+ 0x0079, 0x14ba, 0x14c2, 0x1508, 0x14c2, 0x14c2, 0x14c2, 0x14ed,
+ 0x14d1, 0x14c6, 0xa085, 0x0001, 0x0078, 0x1522, 0x684c, 0xd0bc,
+ 0x0040, 0x14c2, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078,
+ 0x1510, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x14c2, 0x684c,
+ 0xd0bc, 0x0040, 0x14c2, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804,
+ 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1bd1,
+ 0x2004, 0x6832, 0x6858, 0x0078, 0x1518, 0xa18c, 0x00ff, 0xa186,
+ 0x0015, 0x00c0, 0x14c2, 0x684c, 0xd0ac, 0x0040, 0x14c2, 0x6804,
+ 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1bd1,
+ 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1518,
+ 0x684c, 0xd0ac, 0x0040, 0x14c2, 0xa006, 0x682e, 0x682a, 0x6858,
+ 0xa18c, 0x000f, 0xa188, 0x1bd1, 0x210c, 0x6932, 0x2d08, 0x691a,
+ 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912,
+ 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001,
+ 0x020a, 0x2004, 0x82ff, 0x0040, 0x153d, 0xa280, 0x0004, 0x0d7e,
+ 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1539, 0x1078, 0x14b5, 0x10c0,
+ 0x1286, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e,
+ 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005,
+ 0x00c0, 0x1551, 0x7206, 0x2001, 0x1565, 0x007e, 0x2260, 0x0078,
+ 0x167d, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108,
+ 0xa182, 0x710b, 0x0048, 0x155e, 0x2009, 0x70f0, 0x710e, 0x7000,
+ 0xa005, 0x00c0, 0x1565, 0x1078, 0x1666, 0x127f, 0x007c, 0x127e,
+ 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f,
+ 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62,
+ 0x6b5e, 0xa005, 0x0040, 0x15b9, 0x6808, 0xa005, 0x0040, 0x161f,
+ 0x7000, 0xa005, 0x00c0, 0x1586, 0x0078, 0x15b3, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x1623, 0x7004, 0xa406, 0x00c0, 0x15b3, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x0040, 0x159c, 0x047e, 0x1078, 0x1735,
+ 0x047f, 0x2460, 0x0078, 0x157c, 0x2001, 0x0207, 0x2004, 0xd09c,
+ 0x00c0, 0x158f, 0x7804, 0xa084, 0x6000, 0x0040, 0x15ad, 0xa086,
+ 0x6000, 0x0040, 0x15ad, 0x0078, 0x158f, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x55c8, 0x0078,
+ 0x1623, 0x6808, 0xa005, 0x0040, 0x161f, 0x7000, 0xa005, 0x00c0,
+ 0x15c3, 0x0078, 0x161f, 0x700c, 0x7110, 0xa106, 0x00c0, 0x15cc,
+ 0x7004, 0xa406, 0x00c0, 0x161f, 0x2001, 0x0005, 0x2004, 0xd08c,
+ 0x0040, 0x15d9, 0x047e, 0x1078, 0x1735, 0x047f, 0x2460, 0x0078,
+ 0x15b9, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x15cc, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d2, 0x7804, 0xa084, 0x6000,
+ 0x0040, 0x15f0, 0xa086, 0x6000, 0x0040, 0x15f0, 0x0078, 0x15cc,
+ 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040,
+ 0x1611, 0xa08e, 0x0002, 0x00c0, 0x161f, 0x0c7e, 0x0e7e, 0x6818,
+ 0x2060, 0x1078, 0x1ba6, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0,
+ 0x160d, 0x7308, 0x720c, 0x0078, 0x160f, 0x7310, 0x7214, 0x0e7f,
+ 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812,
+ 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009,
+ 0x0048, 0x1078, 0x55c8, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x2071, 0x70ea, 0x7000, 0xa086, 0x0000, 0x0040, 0x1663,
+ 0x7004, 0xac06, 0x00c0, 0x1654, 0x2079, 0x0030, 0x7804, 0xd0fc,
+ 0x00c0, 0x1650, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1636,
+ 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1642, 0x7803, 0x0002,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x1654,
+ 0x1078, 0x1735, 0x0078, 0x162b, 0x157e, 0x20a9, 0x0009, 0x2009,
+ 0x70f0, 0x2104, 0xac06, 0x00c0, 0x165e, 0x200a, 0xa188, 0x0003,
+ 0x00f0, 0x1659, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x166e, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006,
+ 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x710b,
+ 0x0048, 0x167c, 0x2009, 0x70f0, 0x7112, 0x8cff, 0x00c0, 0x169c,
+ 0x7908, 0xd1ec, 0x00c0, 0x1690, 0x1078, 0x18f3, 0x0040, 0x1690,
+ 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168a, 0x7803, 0x0006,
+ 0x7007, 0x0000, 0x1078, 0x18f3, 0x0040, 0x16c3, 0x7803, 0x0019,
+ 0x7003, 0x0003, 0x0078, 0x16c3, 0x6010, 0x2068, 0x2d58, 0x6828,
+ 0xa406, 0x00c0, 0x16a7, 0x682c, 0xa306, 0x0040, 0x16ab, 0x1078,
+ 0x1bf1, 0x00c0, 0x1680, 0x684c, 0xd0f4, 0x00c0, 0x1680, 0x6824,
+ 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f,
+ 0x2009, 0x0011, 0x1078, 0x16c4, 0x0040, 0x16c2, 0x2009, 0x0001,
+ 0x1078, 0x16c4, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x1730, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e3, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x16d3, 0x1712, 0x16f3, 0x16f3, 0x1712, 0x1712,
+ 0x170a, 0x1712, 0x16f3, 0x1712, 0x16f9, 0x16f9, 0x1712, 0x1712,
+ 0x1712, 0x1701, 0x16f9, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1715, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x1715, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x1715, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
+ 0x1715, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
+ 0x00c0, 0x1712, 0x0d7f, 0x1078, 0x1b8d, 0x00c0, 0x16c4, 0xa00e,
+ 0x0078, 0x1730, 0x0d7f, 0x1078, 0x1286, 0x7b22, 0x7a26, 0x7d32,
0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10,
- 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1c18,
- 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, 0x127e, 0x2091, 0x2100,
+ 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1b8d,
+ 0x007c, 0x1078, 0x1286, 0x1078, 0x1286, 0x127e, 0x2091, 0x2100,
0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
- 0xa184, 0x0700, 0x00c0, 0x17a3, 0xa184, 0x0003, 0xa086, 0x0003,
- 0x0040, 0x17a3, 0x7000, 0x0079, 0x17bd, 0x17c5, 0x17c7, 0x189b,
- 0x18ff, 0x1916, 0x17c5, 0x17c5, 0x17c5, 0x1078, 0x12d5, 0x8001,
- 0x7002, 0xa184, 0x0880, 0x00c0, 0x17dc, 0x8aff, 0x0040, 0x183b,
- 0x2009, 0x0001, 0x1078, 0x1713, 0x0040, 0x1928, 0x2009, 0x0001,
- 0x1078, 0x1713, 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000,
- 0xd1dc, 0x0040, 0x1827, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
+ 0xa184, 0x0700, 0x00c0, 0x1733, 0xa184, 0x0003, 0xa086, 0x0003,
+ 0x0040, 0x1733, 0x7000, 0x0079, 0x174d, 0x1755, 0x1757, 0x1826,
+ 0x1888, 0x189f, 0x1755, 0x1755, 0x1755, 0x1078, 0x1286, 0x8001,
+ 0x7002, 0xa184, 0x0880, 0x00c0, 0x176c, 0x8aff, 0x0040, 0x17c6,
+ 0x2009, 0x0001, 0x1078, 0x16c4, 0x0040, 0x18b1, 0x2009, 0x0001,
+ 0x1078, 0x16c4, 0x0078, 0x18b1, 0x7803, 0x0004, 0x7003, 0x0000,
+ 0xd1dc, 0x0040, 0x17b7, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820,
0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x037f,
- 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1c31, 0x2a00,
+ 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1ba6, 0x2a00,
0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x6850,
- 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1819, 0x684c,
- 0xd0e4, 0x0040, 0x1819, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x5bdb, 0x7808, 0xd0ec, 0x00c0, 0x1823, 0x7803, 0x0009, 0x7003,
- 0x0004, 0x0078, 0x1928, 0x1078, 0x16b5, 0x0078, 0x1928, 0x057e,
- 0x7d0c, 0xd5bc, 0x00c0, 0x182e, 0x1078, 0x753d, 0x057f, 0x1078,
- 0x192c, 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
- 0x00c0, 0x1853, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x184f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x1078,
- 0x16b5, 0x0078, 0x1928, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
- 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
- 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
- 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x195b, 0x7803, 0x0004,
- 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1874,
- 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
- 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x1078, 0x197e,
- 0x0040, 0x184f, 0x7908, 0xd1ec, 0x00c0, 0x1892, 0x2009, 0x0009,
- 0x0078, 0x1894, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x8001, 0x7002, 0xd194, 0x0040, 0x18ad,
- 0x7804, 0xd0fc, 0x00c0, 0x17ad, 0x8aff, 0x0040, 0x1928, 0x2009,
- 0x0001, 0x1078, 0x1713, 0x0078, 0x1928, 0xa184, 0x0880, 0x00c0,
- 0x18ba, 0x8aff, 0x0040, 0x1928, 0x2009, 0x0001, 0x1078, 0x1713,
- 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
- 0x18ee, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1c31, 0x0d7e,
- 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x18de,
- 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
- 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x18ea, 0x6810, 0x2008,
- 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
- 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x17e7, 0x057e, 0x7d0c,
- 0x1078, 0x753d, 0x057f, 0x1078, 0x192c, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1928, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x1912, 0x6808,
- 0x8001, 0x680a, 0x00c0, 0x1912, 0x7004, 0x2060, 0x2009, 0x0048,
- 0x1078, 0x5bdb, 0x1078, 0x16b5, 0x0078, 0x1928, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1912,
- 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x16cc,
- 0x017f, 0x007f, 0x127f, 0x007c, 0x1078, 0x193d, 0x20e1, 0x9028,
- 0x700f, 0x7870, 0x7013, 0x7870, 0x2001, 0x015d, 0x200c, 0x810a,
- 0x2102, 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014,
- 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc,
- 0x00c0, 0x195a, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0,
- 0x195a, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x195a, 0x8421,
- 0x00c0, 0x1944, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200,
- 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x193d, 0x20e1, 0x7000,
- 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f,
- 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001,
- 0x0138, 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e,
- 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x198b, 0xa085,
- 0x0001, 0x0078, 0x199d, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1996,
- 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000,
- 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c,
- 0x0e7e, 0x2071, 0x788b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e,
- 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1a22, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x19b4, 0x19bc, 0x1a0d, 0x19bc, 0x19bc,
- 0x19bc, 0x19f2, 0x19cf, 0x19be, 0x1078, 0x12d5, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1a15, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x19bc, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0x0078, 0x1a1e, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1a22,
- 0x684c, 0xd0b4, 0x0040, 0x1b24, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0xa006, 0x682e, 0x682a, 0x0078, 0x1a1e, 0x684c, 0xd0b4, 0x0040,
- 0x17a1, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834,
- 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6926, 0x684c,
- 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804,
- 0xd0fc, 0x10c0, 0x1b28, 0x0e7e, 0x0d7e, 0x2071, 0x788b, 0x7000,
- 0xa005, 0x00c0, 0x1a9e, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c,
- 0x7004, 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890,
- 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100,
- 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818,
- 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184,
- 0x0007, 0x0040, 0x1a60, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f,
- 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e,
- 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106,
- 0x00c0, 0x1a77, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a84, 0x037e,
- 0x047e, 0x6b14, 0x6c10, 0x1078, 0x1c7c, 0x047f, 0x037f, 0x0040,
- 0x1a84, 0x0c7f, 0x0078, 0x1a9e, 0x8aff, 0x00c0, 0x1a8c, 0x0c7f,
- 0xa085, 0x0001, 0x0078, 0x1a9e, 0x127e, 0x2091, 0x8000, 0x2079,
- 0x0020, 0x2009, 0x0001, 0x1078, 0x1aa2, 0x0040, 0x1a9b, 0x2009,
- 0x0001, 0x1078, 0x1aa2, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e,
- 0x8aff, 0x0040, 0x1b1d, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218,
- 0xa203, 0x0048, 0x1b1c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0,
- 0x1acf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1abf, 0x1afe,
- 0x1adf, 0x1adf, 0x1afe, 0x1afe, 0x1af6, 0x1afe, 0x1adf, 0x1afe,
- 0x1ae5, 0x1ae5, 0x1afe, 0x1afe, 0x1afe, 0x1aed, 0x1ae5, 0xc0fc,
- 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1b02,
- 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x6b08,
- 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1b01, 0x6b10, 0x6a14, 0x6d00,
- 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x0d7f, 0x0d7e, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1afe, 0x0d7f, 0x1078,
- 0x1c18, 0x00c0, 0x1aa8, 0xa00e, 0x0078, 0x1b1d, 0x0d7f, 0x1078,
- 0x12d5, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
- 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c,
- 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012,
- 0x1078, 0x1c18, 0x0078, 0x1b1d, 0xa006, 0x027f, 0x037f, 0x047f,
- 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x2079, 0x0020, 0x2071, 0x788b, 0x2b68, 0x6818, 0x2060,
- 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1b26, 0x7000,
- 0x0079, 0x1b42, 0x1be9, 0x1b46, 0x1bb6, 0x1be7, 0x8001, 0x7002,
- 0xd19c, 0x00c0, 0x1b5a, 0x8aff, 0x0040, 0x1b79, 0x2009, 0x0001,
- 0x1078, 0x1aa2, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078, 0x1aa2,
- 0x0078, 0x1be9, 0x7803, 0x0004, 0xd194, 0x0040, 0x1b6a, 0x6850,
- 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1b6f, 0x684c, 0xc0f5, 0x684e,
- 0x0078, 0x1b6f, 0x1078, 0x1c31, 0x6850, 0xc0fd, 0x6852, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078,
- 0x1be9, 0x711c, 0x81ff, 0x0040, 0x1b8f, 0x7918, 0x7922, 0x7827,
- 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
- 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1be9, 0x0f7e,
- 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
- 0x1b9d, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
- 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
- 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1be9, 0x8001, 0x7002,
- 0xd194, 0x0040, 0x1bcb, 0x7804, 0xd0fc, 0x00c0, 0x1b38, 0xd19c,
- 0x00c0, 0x1be5, 0x8aff, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078,
- 0x1aa2, 0x0078, 0x1be9, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
- 0x1c31, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1bde,
- 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1be2, 0x6810, 0xa31a,
- 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1b6a, 0x0078, 0x1b6a, 0x1078,
- 0x12d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x788b, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1c15, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc,
- 0x0040, 0x1bfc, 0x1078, 0x1b28, 0x7000, 0xa086, 0x0000, 0x00c0,
- 0x1bfc, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1c0b, 0x20e1,
- 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c,
- 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c2c, 0x6004, 0xa005, 0x0040,
- 0x1c2e, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c5c,
- 0x2044, 0x88ff, 0x1040, 0x12d5, 0x8a51, 0x007c, 0x2051, 0x0000,
- 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1c4b, 0x2c00,
- 0xad06, 0x0040, 0x1c40, 0x6000, 0xa005, 0x00c0, 0x1c40, 0x2d00,
- 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c6c, 0x2044,
- 0x88ff, 0x1040, 0x12d5, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019,
- 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b,
- 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x1c51, 0x1c4d, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c51, 0x0000, 0x1c58, 0x1c55, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c58, 0x0000, 0x1c53, 0x1c53, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c53, 0x0000, 0x1c59, 0x1c59, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c59, 0x0a7e, 0x097e, 0x087e, 0x6858,
- 0xa055, 0x0040, 0x1d19, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
- 0x1c5c, 0xa986, 0x0007, 0x0040, 0x1c95, 0xa986, 0x000e, 0x0040,
- 0x1c95, 0xa986, 0x000f, 0x00c0, 0x1c99, 0x605c, 0xa422, 0x6060,
- 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ca7, 0x0050, 0x1ca1, 0x0078,
- 0x1d19, 0x6004, 0xa065, 0x0040, 0x1d19, 0x0078, 0x1c84, 0x2804,
- 0xa005, 0x0040, 0x1cc5, 0xac68, 0xd99c, 0x00c0, 0x1cb5, 0x6808,
- 0xa422, 0x680c, 0xa31b, 0x0078, 0x1cb9, 0x6810, 0xa422, 0x6814,
- 0xa31b, 0x0048, 0x1ce4, 0x2300, 0xa405, 0x0040, 0x1ccb, 0x8a51,
- 0x0040, 0x1d19, 0x8840, 0x0078, 0x1ca7, 0x6004, 0xa065, 0x0040,
- 0x1d19, 0x0078, 0x1c84, 0x8a51, 0x0040, 0x1d19, 0x8840, 0x2804,
- 0xa005, 0x00c0, 0x1cde, 0x6004, 0xa065, 0x0040, 0x1d19, 0x6034,
- 0xa0cc, 0x000f, 0xa9c0, 0x1c5c, 0x2804, 0x2040, 0x2b68, 0x6850,
- 0xc0fc, 0x6852, 0x0078, 0x1d11, 0x8422, 0x8420, 0x831a, 0xa399,
- 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0,
- 0x1cff, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048,
- 0x12d5, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1d0b, 0x6910,
- 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12d5, 0x6800,
- 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd,
- 0x6852, 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078,
- 0x1d1e, 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0005, 0x2004, 0xa084, 0x0007, 0x0079, 0x1d26, 0x1d2e, 0x1d2f,
- 0x1d32, 0x1d35, 0x1d3a, 0x1d3d, 0x1d42, 0x1d47, 0x007c, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x17a5, 0x007c, 0x1078, 0x17a5, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x145e, 0x007c, 0x1078, 0x1b28, 0x1078,
- 0x145e, 0x007c, 0x1078, 0x17a5, 0x1078, 0x145e, 0x007c, 0x1078,
- 0x17a5, 0x1078, 0x1b28, 0x1078, 0x145e, 0x007c, 0x127e, 0x2091,
- 0x2300, 0x2079, 0x0200, 0x2071, 0x7b80, 0x2069, 0x7600, 0x2009,
- 0x0004, 0x7912, 0x7817, 0x0004, 0x1078, 0x202c, 0x781b, 0x0002,
- 0x20e1, 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c,
- 0xa084, 0x0007, 0x0079, 0x1d6c, 0x1d90, 0x1d74, 0x1d78, 0x1d7c,
- 0x1d82, 0x1d86, 0x1d8a, 0x1d8e, 0x1078, 0x412f, 0x0078, 0x1d90,
- 0x1078, 0x415e, 0x0078, 0x1d90, 0x1078, 0x412f, 0x1078, 0x415e,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x127f, 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003,
- 0x0040, 0x1d9c, 0x1078, 0x12d5, 0xa184, 0x0030, 0x0040, 0x1dad,
- 0x6a00, 0xa286, 0x0003, 0x00c0, 0x1da7, 0x1078, 0x12d5, 0x1078,
- 0x3535, 0x20e1, 0x9010, 0x0078, 0x1db9, 0xa184, 0x00c0, 0x0040,
- 0x1db3, 0x1078, 0x12d5, 0xa184, 0x0300, 0x0040, 0x1db9, 0x20e1,
- 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e,
- 0x0f7e, 0x2071, 0x7600, 0x7128, 0x2001, 0x7823, 0x2102, 0x2001,
- 0x782b, 0x2102, 0xa182, 0x0211, 0x00c8, 0x1dd2, 0x2009, 0x0008,
- 0x0078, 0x1dfc, 0xa182, 0x0259, 0x00c8, 0x1dda, 0x2009, 0x0007,
- 0x0078, 0x1dfc, 0xa182, 0x02c1, 0x00c8, 0x1de2, 0x2009, 0x0006,
- 0x0078, 0x1dfc, 0xa182, 0x0349, 0x00c8, 0x1dea, 0x2009, 0x0005,
- 0x0078, 0x1dfc, 0xa182, 0x0421, 0x00c8, 0x1df2, 0x2009, 0x0004,
- 0x0078, 0x1dfc, 0xa182, 0x0581, 0x00c8, 0x1dfa, 0x2009, 0x0003,
- 0x0078, 0x1dfc, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182,
- 0x0005, 0x00c8, 0x1e06, 0x7916, 0x0078, 0x1e08, 0x7817, 0x0004,
- 0x1078, 0x202c, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091,
- 0x2200, 0x2061, 0x0100, 0x2071, 0x7600, 0x6024, 0x6026, 0x6033,
- 0x00ef, 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b,
- 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007,
- 0x0caf, 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001,
- 0x762d, 0x2003, 0x0000, 0x2001, 0x762c, 0x2003, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184,
- 0x002c, 0x00c0, 0x1e47, 0xa184, 0x0007, 0x0079, 0x1e4d, 0xa195,
- 0x0004, 0xa284, 0x0007, 0x0079, 0x1e4d, 0x1e79, 0x1e55, 0x1e59,
- 0x1e5d, 0x1e63, 0x1e67, 0x1e6d, 0x1e73, 0x1078, 0x4698, 0x0078,
- 0x1e79, 0x1078, 0x4787, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078,
- 0x4698, 0x0078, 0x1e79, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078,
- 0x4698, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078,
- 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078, 0x4698, 0x1078,
- 0x1e7e, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040,
- 0x1f32, 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00,
- 0xa196, 0xff00, 0x0040, 0x1ead, 0x6030, 0xa084, 0x00ff, 0x810f,
- 0xa116, 0x0040, 0x1ead, 0x7130, 0xd18c, 0x00c0, 0x1ead, 0x2011,
- 0x7652, 0x2214, 0xd2ec, 0x0040, 0x1ea1, 0xc18d, 0x7132, 0x0078,
- 0x1ead, 0x6240, 0xa294, 0x0010, 0x0040, 0x1eef, 0x6248, 0xa294,
- 0xff00, 0xa296, 0xff00, 0x00c0, 0x1eef, 0x037e, 0x73b8, 0x2011,
- 0x8013, 0x1078, 0x2d02, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011,
- 0x7652, 0x220c, 0xd1a4, 0x0040, 0x1ed7, 0x017e, 0x2009, 0x0001,
- 0x2011, 0x0100, 0x1078, 0x4666, 0x2019, 0x000e, 0x1078, 0x7484,
- 0xa484, 0x00ff, 0xa080, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f,
- 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x74ec, 0x017f, 0xd1ac,
- 0x00c0, 0x1ee0, 0x2019, 0x0004, 0x1078, 0x226d, 0x0078, 0x1eef,
- 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078, 0x37d7, 0x00c0,
- 0x1eeb, 0x1078, 0x35db, 0x8108, 0x00f0, 0x1ee5, 0x157f, 0x0c7f,
- 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7, 0x1078, 0x359e, 0x0f7e,
- 0x2079, 0x7849, 0x783c, 0xa086, 0x0000, 0x0040, 0x1f07, 0x6027,
- 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f,
- 0x2011, 0x0003, 0x1078, 0x5772, 0x2011, 0x0002, 0x1078, 0x577c,
- 0x1078, 0x5688, 0x1078, 0x459d, 0x037e, 0x2019, 0x0000, 0x1078,
- 0x571a, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0x7600, 0x2014,
- 0xa296, 0x0004, 0x00c0, 0x1f2a, 0xd19c, 0x00c0, 0x1f2a, 0x6228,
- 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x7620, 0x2003, 0x0000,
- 0x6027, 0x0020, 0xd194, 0x0040, 0x1fd3, 0x0f7e, 0x2079, 0x7849,
- 0x783c, 0xa086, 0x0001, 0x00c0, 0x1f56, 0x017e, 0x6027, 0x0004,
- 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000,
- 0x2079, 0x7836, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4c2c,
- 0x1078, 0x4cec, 0x017f, 0x0f7f, 0x0078, 0x1fd3, 0x0f7f, 0x017e,
- 0x6220, 0xd2b4, 0x0040, 0x1f8b, 0x1078, 0x459d, 0x1078, 0x5534,
- 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x1f6e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
- 0x2061, 0x7836, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1f7e, 0x8000,
- 0x602a, 0x0c7f, 0x1078, 0x5526, 0x0078, 0x1fd2, 0x2019, 0x783f,
- 0x2304, 0xa065, 0x0040, 0x1f88, 0x2009, 0x0027, 0x1078, 0x5bdb,
- 0x0c7f, 0x0078, 0x1fd2, 0xd2bc, 0x0040, 0x1fd2, 0x1078, 0x45ab,
- 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x1fa0, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0d7f, 0x0c7e, 0x2061, 0x7836, 0x6044, 0xa09a, 0x0002, 0x00c8,
- 0x1fc1, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1fd2,
- 0x1078, 0x45a2, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
- 0x1fbd, 0x6017, 0x0012, 0x0078, 0x1fd2, 0x6017, 0x0016, 0x0078,
- 0x1fd2, 0x037e, 0x2019, 0x0001, 0x1078, 0x571a, 0x037f, 0x2019,
- 0x7845, 0x2304, 0xa065, 0x0040, 0x1fd1, 0x2009, 0x004f, 0x1078,
- 0x5bdb, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1ffb, 0x017e, 0x6028,
- 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5772, 0x2011, 0x0002,
- 0x1078, 0x577c, 0x1078, 0x5688, 0x1078, 0x459d, 0x037e, 0x2019,
- 0x0000, 0x1078, 0x571a, 0x037f, 0x60e3, 0x0000, 0x1078, 0x755b,
- 0x1078, 0x7579, 0x2001, 0x7600, 0x2003, 0x0004, 0x6027, 0x0008,
- 0x1078, 0x11c6, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
- 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7600, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x2025, 0x81ff, 0x0040,
- 0x2017, 0x2011, 0x8011, 0x1078, 0x2d02, 0x0078, 0x2025, 0x2011,
- 0x8012, 0x1078, 0x2d02, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
- 0x0028, 0x1078, 0x226d, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
- 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
- 0x2061, 0x0100, 0xa190, 0x2047, 0x2204, 0x60f2, 0xa192, 0x0005,
- 0x00c8, 0x203e, 0xa190, 0x2050, 0x0078, 0x2040, 0x2011, 0x2054,
- 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840,
- 0x0840, 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
- 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
- 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0, 0x2062, 0x81ff,
- 0x0040, 0x2066, 0x1078, 0x42e2, 0x0078, 0x206d, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0x00ff, 0x007c, 0x2094, 0x2098, 0x209c, 0x20a2,
- 0x20a8, 0x20ae, 0x20b4, 0x20bc, 0x20c4, 0x20ca, 0x20d0, 0x20d8,
- 0x20e0, 0x20e8, 0x20f0, 0x20fa, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x107e, 0x007e, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f,
- 0x1078, 0x1d64, 0x0078, 0x211d, 0x0005, 0x0078, 0x2104, 0xb084,
- 0x003c, 0x8004, 0x8004, 0x0079, 0x210d, 0x211d, 0x209a, 0x209e,
- 0x20a4, 0x20aa, 0x20b0, 0x20b6, 0x20be, 0x20c6, 0x20cc, 0x20d2,
- 0x20da, 0x20e2, 0x20ea, 0x20f2, 0x20fc, 0x0008, 0x2107, 0x007f,
- 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2041, 0x007e,
- 0x70bc, 0xd09c, 0x0040, 0x212e, 0x2041, 0x007f, 0x2001, 0x010c,
- 0x203c, 0x727c, 0x82ff, 0x0040, 0x2179, 0x037e, 0x738c, 0xa38e,
- 0xffff, 0x00c0, 0x213d, 0x2019, 0x0001, 0x8314, 0xa2e0, 0x7cc0,
- 0x2c04, 0xa38c, 0x0001, 0x0040, 0x214a, 0xa084, 0xff00, 0x8007,
- 0x0078, 0x214c, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x216e, 0xa08e,
- 0x00ff, 0x0040, 0x2174, 0x2009, 0x0000, 0x1078, 0x2059, 0x1078,
- 0x37a0, 0x00c0, 0x2171, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2168, 0x1078, 0x21cb, 0x0040, 0x2171, 0x0078, 0x216e,
- 0x1078, 0x22cf, 0x1078, 0x21f2, 0x0040, 0x2171, 0x8318, 0x0078,
- 0x213d, 0x738e, 0x0078, 0x2176, 0x708f, 0xffff, 0x037f, 0x0078,
- 0x21c8, 0xa780, 0x2303, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x708c,
- 0xa096, 0xffff, 0x0040, 0x218b, 0xa812, 0x00c8, 0x219b, 0x708f,
- 0xffff, 0x0078, 0x21c5, 0x2009, 0x0000, 0x70bc, 0xd09c, 0x0040,
- 0x2196, 0xd094, 0x0040, 0x2196, 0x2009, 0x007e, 0x2100, 0xa802,
- 0x20a8, 0x0078, 0x219f, 0x2008, 0x2810, 0xa202, 0x20a8, 0x2700,
- 0x157e, 0x017e, 0xa106, 0x0040, 0x21bc, 0x1078, 0x37a0, 0x00c0,
- 0x21c5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x21b6,
- 0x1078, 0x21cb, 0x0040, 0x21c5, 0x0078, 0x21bc, 0x1078, 0x22cf,
- 0x1078, 0x21f2, 0x0040, 0x21c5, 0x017f, 0x8108, 0x157f, 0x00f0,
- 0x219f, 0x708f, 0xffff, 0x0078, 0x21c8, 0x017f, 0x157f, 0x718e,
- 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
- 0x1078, 0x5b4e, 0x0040, 0x21ed, 0x2d00, 0x601a, 0x601f, 0x0001,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0000, 0x1078, 0x3783,
- 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009,
- 0x0004, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
- 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5b4e, 0x0040, 0x2214, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x37a0, 0x00c0,
- 0x2227, 0x1078, 0x222a, 0x0040, 0x2227, 0x70c3, 0xffff, 0x027f,
- 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5b4e, 0x0040, 0x224c, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078, 0x37a0, 0x00c0,
- 0x226a, 0x2c68, 0x1078, 0x5b4e, 0x0040, 0x226a, 0x2d00, 0x601a,
- 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, 0x1078, 0x5bdb,
- 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e,
- 0x037e, 0x027e, 0x1078, 0x491b, 0x1078, 0x48cb, 0x1078, 0x60a8,
- 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x37d7, 0x00c0,
- 0x2285, 0x1078, 0x3958, 0x1078, 0x35db, 0x017f, 0x8108, 0x00f0,
- 0x227c, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e,
- 0x2019, 0x0029, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x017f, 0x2e60, 0x1078, 0x3958, 0xa186, 0x007f, 0x0040,
- 0x22ab, 0x1078, 0x35db, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x00c0, 0x22c5, 0x2071, 0x7600, 0x7088, 0xa005, 0x0040, 0x22c2,
- 0x8001, 0x708a, 0x007f, 0x0e7f, 0x007c, 0x2071, 0x7600, 0x70c4,
- 0xa005, 0x0040, 0x22c2, 0x8001, 0x70c6, 0x0078, 0x22c2, 0x6000,
+ 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17a9, 0x684c,
+ 0xd0e4, 0x0040, 0x17a9, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x55c8, 0x7808, 0xd0ec, 0x00c0, 0x17b3, 0x7803, 0x0009, 0x7003,
+ 0x0004, 0x0078, 0x18b1, 0x1078, 0x1666, 0x0078, 0x18b1, 0x057e,
+ 0x7d0c, 0x1078, 0x6de1, 0x057f, 0x697c, 0x6912, 0x6980, 0x6916,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1, 0x684c, 0xc0f5,
+ 0x684e, 0x7814, 0xa005, 0x00c0, 0x17de, 0x7003, 0x0000, 0x6808,
+ 0x8001, 0x680a, 0x00c0, 0x17da, 0x7004, 0x2060, 0x2009, 0x0048,
+ 0x1078, 0x55c8, 0x1078, 0x1666, 0x0078, 0x18b1, 0x7814, 0x6910,
+ 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, 0x6816, 0x7814, 0x7908,
+ 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a,
+ 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078,
+ 0x18b5, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804,
+ 0xd0fc, 0x0040, 0x17ff, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f,
+ 0x0070, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x55c8, 0x1078, 0x18f3, 0x0040, 0x17da, 0x7908, 0xd1ec, 0x00c0,
+ 0x181d, 0x2009, 0x0009, 0x0078, 0x181f, 0x2009, 0x0019, 0x7902,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1, 0x8001, 0x7002,
+ 0xd194, 0x0040, 0x1838, 0x7804, 0xd0fc, 0x00c0, 0x173d, 0x8aff,
+ 0x0040, 0x18b1, 0x2009, 0x0001, 0x1078, 0x16c4, 0x0078, 0x18b1,
+ 0xa184, 0x0880, 0x00c0, 0x1845, 0x8aff, 0x0040, 0x18b1, 0x2009,
+ 0x0001, 0x1078, 0x16c4, 0x0078, 0x18b1, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0xd1dc, 0x0040, 0x1879, 0x027e, 0x037e, 0x6b28, 0x6a2c,
+ 0x1078, 0x1ba6, 0x0d7e, 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034,
+ 0xd09c, 0x00c0, 0x1869, 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213,
+ 0x7810, 0xa100, 0x7812, 0x690c, 0x7814, 0xa101, 0x7816, 0x0078,
+ 0x1875, 0x6810, 0x2008, 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100,
+ 0x7812, 0x6914, 0x7814, 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078,
+ 0x1777, 0x057e, 0x7d0c, 0x1078, 0x6de1, 0x057f, 0x697c, 0x6912,
+ 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x189b,
+ 0x6808, 0x8001, 0x680a, 0x00c0, 0x189b, 0x7004, 0x2060, 0x2009,
+ 0x0048, 0x1078, 0x55c8, 0x1078, 0x1666, 0x0078, 0x18b1, 0x7803,
+ 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040,
+ 0x189b, 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078,
+ 0x167d, 0x017f, 0x007f, 0x127f, 0x007c, 0x3c00, 0x007e, 0x0e7e,
+ 0x2071, 0x0200, 0x7808, 0xa084, 0xf000, 0xa10d, 0x2001, 0x0138,
+ 0x2014, 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c,
+ 0xd3dc, 0x00c0, 0x18db, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048,
+ 0x00c0, 0x18db, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18db,
+ 0x8421, 0x00c0, 0x18c5, 0x20e1, 0x7000, 0x7324, 0x7420, 0x7028,
+ 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f, 0x0100,
+ 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202, 0x0e7f,
+ 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908, 0xa18c, 0x0fff,
+ 0xa182, 0x0009, 0x0048, 0x1900, 0xa085, 0x0001, 0x0078, 0x1912,
+ 0x2001, 0x020a, 0x81ff, 0x0040, 0x190b, 0x20e1, 0x6000, 0x200c,
+ 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c, 0x200c, 0x7003,
+ 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e, 0x2071, 0x710b,
+ 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004, 0x206c,
+ 0x694c, 0xd1dc, 0x00c0, 0x1997, 0x6934, 0xa184, 0x0007, 0x0079,
+ 0x1929, 0x1931, 0x1982, 0x1931, 0x1931, 0x1931, 0x1967, 0x1944,
+ 0x1933, 0x1078, 0x1286, 0x684c, 0xd0b4, 0x0040, 0x1a99, 0x6860,
+ 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880,
+ 0x680e, 0x6958, 0x0078, 0x198a, 0x6834, 0xa084, 0x00ff, 0xa086,
+ 0x001e, 0x00c0, 0x1931, 0x684c, 0xd0b4, 0x0040, 0x1a99, 0x6860,
+ 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880,
+ 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1bd1, 0x2004, 0x6832, 0x6958, 0x0078, 0x1993, 0xa18c,
+ 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1997, 0x684c, 0xd0b4, 0x0040,
+ 0x1a99, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1bd1, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a,
+ 0x0078, 0x1993, 0x684c, 0xd0b4, 0x0040, 0x1731, 0x6958, 0xa006,
+ 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080,
+ 0x1bd1, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f,
+ 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1a9d,
+ 0x0e7e, 0x0d7e, 0x2071, 0x710b, 0x7000, 0xa005, 0x00c0, 0x1a13,
+ 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x6818,
+ 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040,
+ 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f,
+ 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040,
+ 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040, 0x19d5,
+ 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116,
+ 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e,
+ 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x19ec, 0x6928,
+ 0x6810, 0xa106, 0x0040, 0x19f9, 0x037e, 0x047e, 0x6b14, 0x6c10,
+ 0x1078, 0x1bf1, 0x047f, 0x037f, 0x0040, 0x19f9, 0x0c7f, 0x0078,
+ 0x1a13, 0x8aff, 0x00c0, 0x1a01, 0x0c7f, 0xa085, 0x0001, 0x0078,
+ 0x1a13, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001,
+ 0x1078, 0x1a17, 0x0040, 0x1a10, 0x2009, 0x0001, 0x1078, 0x1a17,
+ 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e,
+ 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1a92,
+ 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048, 0x1a91,
+ 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a44, 0x0d7e, 0x2804,
+ 0xac68, 0x2900, 0x0079, 0x1a34, 0x1a73, 0x1a54, 0x1a54, 0x1a73,
+ 0x1a73, 0x1a6b, 0x1a73, 0x1a54, 0x1a73, 0x1a5a, 0x1a5a, 0x1a73,
+ 0x1a73, 0x1a73, 0x1a62, 0x1a5a, 0xc0fc, 0x6852, 0x6b6c, 0x6a70,
+ 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a77, 0x0d7e, 0x2804, 0xac68,
+ 0x6f08, 0x6e0c, 0x0078, 0x1a76, 0x6b08, 0x6a0c, 0x6d00, 0x6c04,
+ 0x0078, 0x1a76, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
+ 0x0078, 0x1a76, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086,
+ 0x001e, 0x00c0, 0x1a73, 0x0d7f, 0x1078, 0x1b8d, 0x00c0, 0x1a1d,
+ 0xa00e, 0x0078, 0x1a92, 0x0d7f, 0x1078, 0x1286, 0x0d7f, 0x7b22,
+ 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
+ 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c,
+ 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x1b8d, 0x0078,
+ 0x1a92, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f,
+ 0x007c, 0x1078, 0x1286, 0x1078, 0x1286, 0x127e, 0x2091, 0x2200,
+ 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020,
+ 0x2071, 0x710b, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
+ 0xa184, 0x0700, 0x00c0, 0x1a9b, 0x7000, 0x0079, 0x1ab7, 0x1b5e,
+ 0x1abb, 0x1b2b, 0x1b5c, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1acf,
+ 0x8aff, 0x0040, 0x1aee, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0040,
+ 0x1b5e, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0078, 0x1b5e, 0x7803,
+ 0x0004, 0xd194, 0x0040, 0x1adf, 0x6850, 0xc0fc, 0x6852, 0x8aff,
+ 0x00c0, 0x1ae4, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1ae4, 0x1078,
+ 0x1ba6, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a,
+ 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b5e, 0x711c, 0x81ff,
+ 0x0040, 0x1b04, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803, 0x0001,
+ 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010, 0xa081,
+ 0x0000, 0x7012, 0x0078, 0x1b5e, 0x0f7e, 0x027e, 0x781c, 0x007e,
+ 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085,
+ 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b12, 0x79c8, 0x007f,
+ 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6, 0xa284, 0x0004,
+ 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008, 0x7003,
+ 0x0000, 0x0078, 0x1b5e, 0x8001, 0x7002, 0xd194, 0x0040, 0x1b40,
+ 0x7804, 0xd0fc, 0x00c0, 0x1aad, 0xd19c, 0x00c0, 0x1b5a, 0x8aff,
+ 0x0040, 0x1b5e, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0078, 0x1b5e,
+ 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1ba6, 0x0d7e, 0x2804,
+ 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b53, 0x6808, 0xa31a, 0x680c,
+ 0xa213, 0x0078, 0x1b57, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f,
+ 0x0078, 0x1adf, 0x0078, 0x1adf, 0x1078, 0x1286, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x2071, 0x710b, 0x7000, 0xa086, 0x0000, 0x0040, 0x1b8a, 0x2079,
+ 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040, 0x1b71, 0x1078,
+ 0x1a9d, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b71, 0x7803, 0x0004,
+ 0x7804, 0xd0ac, 0x00c0, 0x1b80, 0x20e1, 0x9040, 0x7803, 0x0002,
+ 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840, 0x2804, 0xa005,
+ 0x00c0, 0x1ba1, 0x6004, 0xa005, 0x0040, 0x1ba3, 0x681a, 0x2060,
+ 0x6034, 0xa084, 0x000f, 0xa080, 0x1bd1, 0x2044, 0x88ff, 0x1040,
+ 0x1286, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8841,
+ 0x2804, 0xa005, 0x00c0, 0x1bc0, 0x2c00, 0xad06, 0x0040, 0x1bb5,
+ 0x6000, 0xa005, 0x00c0, 0x1bb5, 0x2d00, 0x2060, 0x681a, 0x6034,
+ 0xa084, 0x000f, 0xa080, 0x1be1, 0x2044, 0x88ff, 0x1040, 0x1286,
+ 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021, 0x0025,
+ 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027, 0x0000,
+ 0x0000, 0x0000, 0x1bc6, 0x1bc2, 0x0000, 0x0000, 0x1bd0, 0x0000,
+ 0x1bc6, 0x0000, 0x1bcd, 0x1bca, 0x0000, 0x0000, 0x0000, 0x1bd0,
+ 0x1bcd, 0x0000, 0x1bc8, 0x1bc8, 0x0000, 0x0000, 0x1bd0, 0x0000,
+ 0x1bc8, 0x0000, 0x1bce, 0x1bce, 0x0000, 0x0000, 0x0000, 0x1bd0,
+ 0x1bce, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040, 0x1c8e,
+ 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1bd1, 0xa986, 0x0007,
+ 0x0040, 0x1c0a, 0xa986, 0x000e, 0x0040, 0x1c0a, 0xa986, 0x000f,
+ 0x00c0, 0x1c0e, 0x605c, 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045,
+ 0x00c0, 0x1c1c, 0x0050, 0x1c16, 0x0078, 0x1c8e, 0x6004, 0xa065,
+ 0x0040, 0x1c8e, 0x0078, 0x1bf9, 0x2804, 0xa005, 0x0040, 0x1c3a,
+ 0xac68, 0xd99c, 0x00c0, 0x1c2a, 0x6808, 0xa422, 0x680c, 0xa31b,
+ 0x0078, 0x1c2e, 0x6810, 0xa422, 0x6814, 0xa31b, 0x0048, 0x1c59,
+ 0x2300, 0xa405, 0x0040, 0x1c40, 0x8a51, 0x0040, 0x1c8e, 0x8840,
+ 0x0078, 0x1c1c, 0x6004, 0xa065, 0x0040, 0x1c8e, 0x0078, 0x1bf9,
+ 0x8a51, 0x0040, 0x1c8e, 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c53,
+ 0x6004, 0xa065, 0x0040, 0x1c8e, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
+ 0x1bd1, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852, 0x0078,
+ 0x1c86, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e, 0x2b68,
+ 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c74, 0x6908, 0x2400,
+ 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1286, 0x6800, 0xa420,
+ 0x6804, 0xa319, 0x0078, 0x1c80, 0x6910, 0x2400, 0xa122, 0x6914,
+ 0x2300, 0xa11b, 0x1048, 0x1286, 0x6800, 0xa420, 0x6804, 0xa319,
+ 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00, 0x681a,
+ 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1c93, 0x087f, 0x097f,
+ 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004, 0xa084,
+ 0x0007, 0x0079, 0x1c9b, 0x1ca3, 0x1ca4, 0x1ca7, 0x1caa, 0x1caf,
+ 0x1cb2, 0x1cb7, 0x1cbc, 0x007c, 0x1078, 0x1a9d, 0x007c, 0x1078,
+ 0x1735, 0x007c, 0x1078, 0x1735, 0x1078, 0x1a9d, 0x007c, 0x1078,
+ 0x140f, 0x007c, 0x1078, 0x1a9d, 0x1078, 0x140f, 0x007c, 0x1078,
+ 0x1735, 0x1078, 0x140f, 0x007c, 0x1078, 0x1735, 0x1078, 0x1a9d,
+ 0x1078, 0x140f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079, 0x0200,
+ 0x2071, 0x7380, 0x2069, 0x6f00, 0x2009, 0x0004, 0x7912, 0x7916,
+ 0x1078, 0x1f8b, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f, 0x007c,
+ 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079, 0x1ce0,
+ 0x1d04, 0x1ce8, 0x1cec, 0x1cf0, 0x1cf6, 0x1cfa, 0x1cfe, 0x1d02,
+ 0x1078, 0x3def, 0x0078, 0x1d04, 0x1078, 0x3e1e, 0x0078, 0x1d04,
+ 0x1078, 0x3def, 0x1078, 0x3e1e, 0x0078, 0x1d04, 0x1078, 0x1d06,
+ 0x0078, 0x1d04, 0x1078, 0x1d06, 0x0078, 0x1d04, 0x1078, 0x1d06,
+ 0x0078, 0x1d04, 0x1078, 0x1d06, 0x127f, 0x007c, 0x007e, 0x017e,
+ 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1d10, 0x1078, 0x1286,
+ 0xa184, 0x0030, 0x0040, 0x1d21, 0x6a00, 0xa286, 0x0003, 0x00c0,
+ 0x1d1b, 0x1078, 0x1286, 0x1078, 0x31f5, 0x20e1, 0x9010, 0x0078,
+ 0x1d2d, 0xa184, 0x00c0, 0x0040, 0x1d27, 0x1078, 0x1286, 0xa184,
+ 0x0300, 0x0040, 0x1d2d, 0x20e1, 0x9020, 0x7932, 0x027f, 0x017f,
+ 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0x6f00, 0x7128,
+ 0x2001, 0x70a3, 0x2102, 0x2001, 0x70ab, 0x2102, 0xa182, 0x0211,
+ 0x00c8, 0x1d46, 0x2009, 0x0008, 0x0078, 0x1d70, 0xa182, 0x0259,
+ 0x00c8, 0x1d4e, 0x2009, 0x0007, 0x0078, 0x1d70, 0xa182, 0x02c1,
+ 0x00c8, 0x1d56, 0x2009, 0x0006, 0x0078, 0x1d70, 0xa182, 0x0349,
+ 0x00c8, 0x1d5e, 0x2009, 0x0005, 0x0078, 0x1d70, 0xa182, 0x0421,
+ 0x00c8, 0x1d66, 0x2009, 0x0004, 0x0078, 0x1d70, 0xa182, 0x0581,
+ 0x00c8, 0x1d6e, 0x2009, 0x0003, 0x0078, 0x1d70, 0x2009, 0x0002,
+ 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1f8b, 0x0f7f, 0x0e7f,
+ 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, 0x0100, 0x2071,
+ 0x6f00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, 0x0000, 0x60eb,
+ 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
+ 0x0080, 0x602f, 0x0000, 0x6007, 0x00af, 0x600f, 0x00ff, 0x602b,
+ 0x002f, 0x127f, 0x007c, 0x2001, 0x6f2b, 0x2003, 0x0000, 0x2001,
+ 0x6f2a, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x007e,
+ 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x1db3, 0xa184,
+ 0x0007, 0x0079, 0x1db9, 0xa195, 0x0004, 0xa284, 0x0007, 0x0079,
+ 0x1db9, 0x1de5, 0x1dc1, 0x1dc5, 0x1dc9, 0x1dcf, 0x1dd3, 0x1dd9,
+ 0x1ddf, 0x1078, 0x42cb, 0x0078, 0x1de5, 0x1078, 0x43ae, 0x0078,
+ 0x1de5, 0x1078, 0x43ae, 0x1078, 0x42cb, 0x0078, 0x1de5, 0x1078,
+ 0x1dea, 0x0078, 0x1de5, 0x1078, 0x42cb, 0x1078, 0x1dea, 0x0078,
+ 0x1de5, 0x1078, 0x43ae, 0x1078, 0x1dea, 0x0078, 0x1de5, 0x1078,
+ 0x43ae, 0x1078, 0x42cb, 0x1078, 0x1dea, 0x027f, 0x017f, 0x007f,
+ 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1e97, 0x017e, 0x047e, 0x0c7e,
+ 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196, 0xff00, 0x0040, 0x1e19,
+ 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x1e19, 0x7130,
+ 0xd18c, 0x00c0, 0x1e19, 0x2011, 0x6f52, 0x2214, 0xd2ec, 0x0040,
+ 0x1e0d, 0xc18d, 0x7132, 0x0078, 0x1e19, 0x6240, 0xa294, 0x0010,
+ 0x0040, 0x1e54, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00, 0x00c0,
+ 0x1e54, 0x2011, 0x8013, 0x1078, 0x29c6, 0x7130, 0xc185, 0x7132,
+ 0x2011, 0x6f52, 0x220c, 0xd1a4, 0x0040, 0x1e3c, 0x017e, 0x2009,
+ 0x0001, 0x2011, 0x0100, 0x1078, 0x4299, 0x2019, 0x000e, 0x1078,
+ 0x6d28, 0xa484, 0x00ff, 0x1078, 0x1fb0, 0x8127, 0xa006, 0x2009,
+ 0x000e, 0x1078, 0x6d90, 0x017f, 0xd1ac, 0x00c0, 0x1e45, 0x2019,
+ 0x0004, 0x1078, 0x2152, 0x0078, 0x1e54, 0x157e, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x1078, 0x3497, 0x00c0, 0x1e50, 0x1078, 0x329b,
+ 0x8108, 0x00f0, 0x1e4a, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000,
+ 0x2009, 0x00f7, 0x1078, 0x325e, 0x0f7e, 0x2079, 0x70c9, 0x783c,
+ 0xa086, 0x0000, 0x0040, 0x1e6c, 0x6027, 0x0004, 0x783f, 0x0000,
+ 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078,
+ 0x515f, 0x2011, 0x0002, 0x1078, 0x5169, 0x1078, 0x5075, 0x1078,
+ 0x41d0, 0x037e, 0x2019, 0x0000, 0x1078, 0x5107, 0x037f, 0x60e3,
+ 0x0000, 0x017f, 0x2001, 0x6f00, 0x2014, 0xa296, 0x0004, 0x00c0,
+ 0x1e8f, 0xd19c, 0x00c0, 0x1e8f, 0x6228, 0xc29d, 0x622a, 0x2003,
+ 0x0001, 0x2001, 0x6f1e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194,
+ 0x0040, 0x1f32, 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0001,
+ 0x00c0, 0x1ebb, 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079,
+ 0x0140, 0x7803, 0x1000, 0x7803, 0x0000, 0x2079, 0x70b6, 0x7807,
+ 0x0000, 0x7833, 0x0000, 0x1078, 0x484d, 0x1078, 0x48fd, 0x017f,
+ 0x0f7f, 0x0078, 0x1f32, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040,
+ 0x1ef0, 0x1078, 0x41d0, 0x1078, 0x4f45, 0x6027, 0x0004, 0x0d7e,
+ 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1ed3, 0x6803,
+ 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6028,
+ 0xa09a, 0x0002, 0x00c8, 0x1ee3, 0x8000, 0x602a, 0x0c7f, 0x1078,
+ 0x4f37, 0x0078, 0x1f31, 0x2019, 0x70bf, 0x2304, 0xa065, 0x0040,
+ 0x1eed, 0x2009, 0x0027, 0x1078, 0x55c8, 0x0c7f, 0x0078, 0x1f31,
+ 0xd2bc, 0x0040, 0x1f31, 0x1078, 0x41de, 0x6017, 0x0010, 0x6027,
+ 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x1f05, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061,
+ 0x70b6, 0x6044, 0xa09a, 0x0002, 0x00c8, 0x1f26, 0x8000, 0x6046,
+ 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1f31, 0x1078, 0x41d5, 0xa080,
+ 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x1f22, 0x6017, 0x0012,
+ 0x0078, 0x1f31, 0x6017, 0x0016, 0x0078, 0x1f31, 0x2019, 0x70c5,
+ 0x2304, 0xa065, 0x0040, 0x1f30, 0x2009, 0x004f, 0x1078, 0x55c8,
+ 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1f5a, 0x017e, 0x6028, 0xc09c,
+ 0x602a, 0x2011, 0x0003, 0x1078, 0x515f, 0x2011, 0x0002, 0x1078,
+ 0x5169, 0x1078, 0x5075, 0x1078, 0x41d0, 0x037e, 0x2019, 0x0000,
+ 0x1078, 0x5107, 0x037f, 0x60e3, 0x0000, 0x1078, 0x6dff, 0x1078,
+ 0x6e1d, 0x2001, 0x6f00, 0x2003, 0x0004, 0x6027, 0x0008, 0x1078,
+ 0x117d, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e, 0x017e,
+ 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00,
+ 0x71a8, 0x70aa, 0xa116, 0x0040, 0x1f84, 0x81ff, 0x0040, 0x1f76,
+ 0x2011, 0x8011, 0x1078, 0x29c6, 0x0078, 0x1f84, 0x2011, 0x8012,
+ 0x1078, 0x29c6, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019, 0x0028,
+ 0x1078, 0x2152, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f, 0x027f,
+ 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e, 0x2061,
+ 0x0100, 0xa190, 0x1f9e, 0x2204, 0x60f2, 0xa190, 0x1fa7, 0x2204,
+ 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840, 0x0840,
+ 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8,
+ 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0,
+ 0xa080, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f, 0x007c, 0xa080,
+ 0x21d3, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1fdd, 0x1fe1, 0x1fe5,
+ 0x1feb, 0x1ff1, 0x1ff7, 0x1ffd, 0x2005, 0x200d, 0x2013, 0x2019,
+ 0x2021, 0x2029, 0x2031, 0x2039, 0x2043, 0x204d, 0x204d, 0x204d,
+ 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d,
+ 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x107e, 0x007e, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e,
+ 0x007e, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1cd8, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1c94, 0x1078,
+ 0x1cd8, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078,
+ 0x1c94, 0x1078, 0x1cd8, 0x0078, 0x2066, 0x0005, 0x0078, 0x204d,
+ 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x2056, 0x2066, 0x1fe3,
+ 0x1fe7, 0x1fed, 0x1ff3, 0x1ff9, 0x1fff, 0x2007, 0x200f, 0x2015,
+ 0x201b, 0x2023, 0x202b, 0x2033, 0x203b, 0x2045, 0x0008, 0x2050,
+ 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2001,
+ 0x010c, 0x203c, 0x7274, 0x82ff, 0x0040, 0x20bc, 0x037e, 0x7384,
+ 0xa38e, 0xffff, 0x00c0, 0x207e, 0x2019, 0x0001, 0x8314, 0xa2e0,
+ 0x74c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x208b, 0xa084, 0xff00,
+ 0x8007, 0x0078, 0x208d, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x20b1,
+ 0xa08e, 0x0000, 0x0040, 0x20b1, 0xa08e, 0x00ff, 0x0040, 0x20b7,
+ 0x1078, 0x1fb0, 0x1078, 0x3460, 0x00c0, 0x20b4, 0x6004, 0xa084,
+ 0x00ff, 0xa086, 0x0006, 0x00c0, 0x20ab, 0x1078, 0x2104, 0x0040,
+ 0x20b4, 0x0078, 0x20b1, 0x1078, 0x219f, 0x1078, 0x212b, 0x0040,
+ 0x20b4, 0x8318, 0x0078, 0x207e, 0x7386, 0x0078, 0x20b9, 0x7087,
+ 0xffff, 0x037f, 0x0078, 0x2101, 0xa780, 0x21d3, 0x203c, 0xa7bc,
+ 0xff00, 0x873f, 0x20a9, 0x007e, 0x2009, 0x0000, 0x7084, 0xa096,
+ 0xffff, 0x0040, 0x20d8, 0xa092, 0x007e, 0x0048, 0x20d3, 0x7087,
+ 0xffff, 0x0078, 0x20fe, 0x2008, 0x2011, 0x007e, 0xa202, 0x20a8,
+ 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x20f5, 0x1078, 0x3460,
+ 0x00c0, 0x20fe, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x20ef, 0x1078, 0x2104, 0x0040, 0x20fe, 0x0078, 0x20f5, 0x1078,
+ 0x219f, 0x1078, 0x212b, 0x0040, 0x20fe, 0x017f, 0x8108, 0x157f,
+ 0x00f0, 0x20d8, 0x7087, 0xffff, 0x0078, 0x2101, 0x017f, 0x157f,
+ 0x7186, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x553b, 0x0040, 0x2126, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0000, 0x1078,
+ 0x3443, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f,
+ 0x2009, 0x0004, 0x1078, 0x55c8, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
+ 0x1078, 0x553b, 0x0040, 0x214d, 0x2d00, 0x601a, 0x601f, 0x0001,
+ 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f, 0x2009,
+ 0x0002, 0x1078, 0x55c8, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
+ 0x017f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078,
+ 0x453c, 0x1078, 0x44ec, 0x1078, 0x59ae, 0x20a9, 0x007e, 0x2009,
+ 0x0000, 0x017e, 0x1078, 0x3497, 0x00c0, 0x216a, 0x1078, 0x3618,
+ 0x1078, 0x329b, 0x017f, 0x8108, 0x00f0, 0x2161, 0x027f, 0x037f,
+ 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e,
+ 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x017f, 0x2e60,
+ 0x1078, 0x3618, 0x1078, 0x329b, 0x017f, 0x027f, 0x037f, 0x0c7f,
+ 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6f00, 0x7080, 0xa005,
+ 0x0040, 0x219c, 0x8001, 0x7082, 0x007f, 0x0e7f, 0x007c, 0x6000,
0xc08c, 0x6002, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e,
- 0x157e, 0x81ff, 0x00c0, 0x22e0, 0x20a9, 0x0001, 0x0078, 0x22e4,
- 0x20a9, 0x007f, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7720, 0x2c64,
- 0x8cff, 0x0040, 0x22f6, 0x2019, 0x0029, 0x1078, 0x4914, 0x1078,
- 0x4857, 0x2c08, 0x1078, 0x7326, 0x1078, 0x3958, 0x027f, 0x8210,
- 0x00f0, 0x22e4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
+ 0x157e, 0x81ff, 0x00c0, 0x21b0, 0x20a9, 0x0001, 0x0078, 0x21b4,
+ 0x20a9, 0x007e, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7020, 0x2c64,
+ 0x8cff, 0x0040, 0x21c6, 0x2019, 0x0029, 0x1078, 0x4535, 0x1078,
+ 0x4478, 0x2c08, 0x1078, 0x6bca, 0x1078, 0x3618, 0x027f, 0x8210,
+ 0x00f0, 0x21b4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
0x0c7f, 0x0e7f, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
@@ -8783,582 +9813,516 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x2071, 0x766d, 0x7003, 0x0002, 0xa006,
- 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x767d, 0x7037, 0x767d,
- 0x7007, 0x0001, 0x2061, 0x76bd, 0x6003, 0x0002, 0x007c, 0x0090,
- 0x242a, 0x0068, 0x242a, 0x2071, 0x766d, 0x2b78, 0x7818, 0xd084,
- 0x00c0, 0x242a, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x2511,
- 0x0079, 0x24ae, 0x007c, 0x2071, 0x766d, 0x7004, 0x0079, 0x2430,
- 0x2434, 0x2435, 0x243f, 0x2451, 0x007c, 0x0090, 0x243e, 0x0068,
- 0x243e, 0x2b78, 0x7818, 0xd084, 0x0040, 0x245d, 0x007c, 0x2b78,
- 0x2061, 0x76bd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x244c, 0xa086,
- 0x0200, 0x0040, 0x2509, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
- 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2459,
+ 0x8000, 0x8000, 0x0000, 0x2071, 0x6f6d, 0x7003, 0x0002, 0xa006,
+ 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x6f7d, 0x7037, 0x6f7d,
+ 0x7007, 0x0001, 0x2061, 0x6fbd, 0x6003, 0x0002, 0x007c, 0x0090,
+ 0x22ea, 0x0068, 0x22ea, 0x2071, 0x6f6d, 0x2b78, 0x7818, 0xd084,
+ 0x00c0, 0x22ea, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x23d1,
+ 0x0079, 0x236e, 0x007c, 0x2071, 0x6f6d, 0x7004, 0x0079, 0x22f0,
+ 0x22f4, 0x22f5, 0x22ff, 0x2311, 0x007c, 0x0090, 0x22fe, 0x0068,
+ 0x22fe, 0x2b78, 0x7818, 0xd084, 0x0040, 0x231d, 0x007c, 0x2b78,
+ 0x2061, 0x6fbd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x230c, 0xa086,
+ 0x0200, 0x0040, 0x23c9, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
+ 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2319,
0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a,
- 0x0040, 0x00c8, 0x2466, 0x61b0, 0x0079, 0x246e, 0x2100, 0xa08a,
- 0x0036, 0x00c8, 0x2505, 0x61b0, 0x0079, 0x24ae, 0x24e7, 0x2519,
- 0x2521, 0x2525, 0x252d, 0x2533, 0x2537, 0x2540, 0x2544, 0x254c,
- 0x2550, 0x2505, 0x2505, 0x2505, 0x2554, 0x2505, 0x2564, 0x257b,
- 0x2592, 0x260e, 0x2613, 0x2640, 0x268d, 0x269c, 0x26bd, 0x26f3,
- 0x26fd, 0x270a, 0x271d, 0x2735, 0x273e, 0x277b, 0x2781, 0x2505,
- 0x2791, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2795, 0x279b,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x27a3, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27b0, 0x27b6,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x254c, 0x2550,
- 0x2505, 0x2505, 0x27c8, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2815, 0x28e2,
- 0x28f6, 0x28fd, 0x2960, 0x29bb, 0x29c6, 0x2a08, 0x2a15, 0x2a22,
- 0x2a25, 0x27cc, 0x2a4e, 0x2a95, 0x2aa2, 0x2b94, 0x2c7a, 0x2ca1,
- 0x2d8d, 0x2d9b, 0x2da8, 0x2de2, 0x713c, 0x0078, 0x24e7, 0x2021,
- 0x4000, 0x1078, 0x2cdc, 0x127e, 0x2091, 0x8000, 0x0068, 0x24f4,
- 0x7818, 0xd084, 0x0040, 0x24f7, 0x127f, 0x0078, 0x24eb, 0x781b,
+ 0x0040, 0x00c8, 0x2326, 0x61a8, 0x0079, 0x232e, 0x2100, 0xa08a,
+ 0x0036, 0x00c8, 0x23c5, 0x61a8, 0x0079, 0x236e, 0x23a7, 0x23d9,
+ 0x23e1, 0x23e5, 0x23ed, 0x23f3, 0x23f7, 0x2400, 0x2404, 0x240c,
+ 0x2410, 0x23c5, 0x23c5, 0x23c5, 0x2414, 0x23c5, 0x2424, 0x243b,
+ 0x2452, 0x24ce, 0x24d3, 0x2500, 0x254d, 0x255c, 0x257d, 0x25b3,
+ 0x25bd, 0x25ca, 0x25dd, 0x25f5, 0x25fe, 0x263b, 0x2641, 0x23c5,
+ 0x264c, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x2650, 0x2656,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x265e, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x266b, 0x2671,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x240c, 0x2410,
+ 0x23c5, 0x23c5, 0x2683, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x26d0, 0x279d,
+ 0x27b1, 0x27b8, 0x281b, 0x286c, 0x2877, 0x28b9, 0x28c6, 0x28d3,
+ 0x28d6, 0x2687, 0x28ff, 0x2946, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x2a4d, 0x2a5b, 0x2a68, 0x2aa2, 0x713c, 0x0078, 0x23a7, 0x2021,
+ 0x4000, 0x1078, 0x29a0, 0x127e, 0x2091, 0x8000, 0x0068, 0x23b4,
+ 0x7818, 0xd084, 0x0040, 0x23b7, 0x127f, 0x0078, 0x23ab, 0x781b,
0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
- 0x24e9, 0x2021, 0x4002, 0x0078, 0x24e9, 0x2021, 0x4003, 0x0078,
- 0x24e9, 0x2021, 0x4005, 0x0078, 0x24e9, 0x2021, 0x4006, 0x0078,
- 0x24e9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2ceb, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2cef, 0x7924, 0x7828, 0x2114,
- 0x200a, 0x0078, 0x24e7, 0x7924, 0x2114, 0x0078, 0x24e7, 0x2099,
- 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x24e7,
- 0x7824, 0x2060, 0x0078, 0x2556, 0x2009, 0x0001, 0x2011, 0x000f,
- 0x2019, 0x0007, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x251b,
- 0x7d38, 0x7c3c, 0x0078, 0x2527, 0x2061, 0x1000, 0x610c, 0xa006,
- 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2558, 0x2010, 0xa005,
- 0x0040, 0x24e7, 0x0078, 0x250d, 0x2061, 0x7651, 0x7824, 0x7930,
- 0xa11a, 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604a, 0x6142,
+ 0x23a9, 0x2021, 0x4002, 0x0078, 0x23a9, 0x2021, 0x4003, 0x0078,
+ 0x23a9, 0x2021, 0x4005, 0x0078, 0x23a9, 0x2021, 0x4006, 0x0078,
+ 0x23a9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
+ 0x29af, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
+ 0x7a2c, 0x7824, 0x7930, 0x0078, 0x29b3, 0x7924, 0x7828, 0x2114,
+ 0x200a, 0x0078, 0x23a7, 0x7924, 0x2114, 0x0078, 0x23a7, 0x2099,
+ 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x23a7,
+ 0x7824, 0x2060, 0x0078, 0x2416, 0x2009, 0x0001, 0x2011, 0x000f,
+ 0x2019, 0x0000, 0x0078, 0x23a7, 0x7d38, 0x7c3c, 0x0078, 0x23db,
+ 0x7d38, 0x7c3c, 0x0078, 0x23e7, 0x2061, 0x1000, 0x610c, 0xa006,
+ 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2418, 0x2010, 0xa005,
+ 0x0040, 0x23a7, 0x0078, 0x23cd, 0x2061, 0x6f51, 0x7824, 0x7930,
+ 0xa11a, 0x00c8, 0x23d5, 0x8019, 0x0040, 0x23d5, 0x604a, 0x6142,
0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
- 0x3c23, 0x0078, 0x24e7, 0x2061, 0x7651, 0x7824, 0x7930, 0xa11a,
- 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604e, 0x6146, 0x782c,
- 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x39f9,
- 0x0078, 0x24e7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x7674, 0x41a1, 0x1078,
- 0x2cb3, 0x0040, 0x2511, 0x2009, 0x0020, 0x1078, 0x2ceb, 0x701b,
- 0x25aa, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
- 0x0040, 0x25b6, 0xa096, 0x0019, 0x00c0, 0x2511, 0x810f, 0xa18c,
- 0x00ff, 0x0040, 0x2511, 0x710e, 0x700c, 0x8001, 0x0040, 0x25e7,
- 0x700e, 0x1078, 0x2cb3, 0x0040, 0x2511, 0x2009, 0x0020, 0x2061,
- 0x76bd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
- 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x2ceb, 0x701b,
- 0x25da, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
- 0x25e5, 0xa096, 0x000a, 0x00c0, 0x2511, 0x0078, 0x25bc, 0x7010,
- 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x36d4, 0x00c0, 0x25f5,
- 0x7007, 0x0003, 0x701b, 0x25f7, 0x007c, 0x1078, 0x3abc, 0x127e,
- 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x7674, 0x530a, 0x2100,
+ 0x38e3, 0x0078, 0x23a7, 0x2061, 0x6f51, 0x7824, 0x7930, 0xa11a,
+ 0x00c8, 0x23d5, 0x8019, 0x0040, 0x23d5, 0x604e, 0x6146, 0x782c,
+ 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x36b9,
+ 0x0078, 0x23a7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x23d1, 0x7924,
+ 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x6f74, 0x41a1, 0x1078,
+ 0x2977, 0x0040, 0x23d1, 0x2009, 0x0020, 0x1078, 0x29af, 0x701b,
+ 0x246a, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
+ 0x0040, 0x2476, 0xa096, 0x0019, 0x00c0, 0x23d1, 0x810f, 0xa18c,
+ 0x00ff, 0x0040, 0x23d1, 0x710e, 0x700c, 0x8001, 0x0040, 0x24a7,
+ 0x700e, 0x1078, 0x2977, 0x0040, 0x23d1, 0x2009, 0x0020, 0x2061,
+ 0x6fbd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
+ 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x29af, 0x701b,
+ 0x249a, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
+ 0x24a5, 0xa096, 0x000a, 0x00c0, 0x23d1, 0x0078, 0x247c, 0x7010,
+ 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x3394, 0x00c0, 0x24b5,
+ 0x7007, 0x0003, 0x701b, 0x24b7, 0x007c, 0x1078, 0x377c, 0x127e,
+ 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x6f74, 0x530a, 0x2100,
0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
- 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2cef, 0x6198, 0x7824,
- 0x609a, 0x0078, 0x24e7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
+ 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x29b3, 0x6190, 0x7824,
+ 0x6092, 0x0078, 0x23a7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x7c28,
- 0x7d2c, 0x1078, 0x391b, 0xd28c, 0x00c0, 0x2652, 0x1078, 0x38ab,
- 0x0078, 0x2654, 0x1078, 0x38e7, 0x00c0, 0x267e, 0x2061, 0x7d00,
- 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x266c,
- 0x6010, 0xa06d, 0x0040, 0x266c, 0x683c, 0xa406, 0x00c0, 0x266c,
- 0x6840, 0xa506, 0x0040, 0x2677, 0x127f, 0xace0, 0x0008, 0x2001,
- 0x7615, 0x2004, 0xac02, 0x00c8, 0x2511, 0x0078, 0x2658, 0x1078,
- 0x66dd, 0x127f, 0x0040, 0x2511, 0x0078, 0x24e7, 0xa00e, 0x2001,
- 0x0005, 0x1078, 0x3abc, 0x127e, 0x2091, 0x8000, 0x1078, 0x6af2,
- 0x1078, 0x3a2c, 0x127f, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3860, 0x1078, 0x392c,
- 0x0040, 0x2511, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078,
- 0x2ccb, 0x0040, 0x2515, 0x2031, 0x000f, 0x1078, 0x3860, 0x8631,
- 0x00c8, 0x26a5, 0x2019, 0x0005, 0x1078, 0x394d, 0x0040, 0x2511,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x452d, 0x0078, 0x24e7, 0x127e, 0x2091, 0x8000,
- 0x81ff, 0x00c0, 0x26ed, 0x2029, 0x00ff, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x26e7, 0x2508, 0x1078, 0x37d7, 0x00c0, 0x26e7, 0x2031,
- 0x000f, 0x1078, 0x3860, 0x8631, 0x00c8, 0x26d1, 0x2019, 0x0004,
- 0x1078, 0x394d, 0x0040, 0x26ed, 0x7824, 0xa08a, 0x1000, 0x00c8,
- 0x26f0, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x452d, 0x8529,
- 0x00c8, 0x26c6, 0x127f, 0x0078, 0x24e7, 0x127f, 0x0078, 0x2511,
- 0x127f, 0x0078, 0x2515, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078,
- 0x3890, 0x1078, 0x391b, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3879, 0x1078, 0x391b,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x38ea, 0x0040, 0x2511, 0x1078, 0x371c, 0x1078,
- 0x38a4, 0x1078, 0x391b, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x3860, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078,
- 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x1078, 0x391b, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x391b, 0x2208, 0x0078, 0x24e7, 0x157e, 0x0d7e,
- 0x0e7e, 0x2069, 0x76ff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x274a,
+ 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x7c28,
+ 0x7d2c, 0x1078, 0x35db, 0xd28c, 0x00c0, 0x2512, 0x1078, 0x356b,
+ 0x0078, 0x2514, 0x1078, 0x35a7, 0x00c0, 0x253e, 0x2061, 0x7500,
+ 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x252c,
+ 0x6010, 0xa06d, 0x0040, 0x252c, 0x683c, 0xa406, 0x00c0, 0x252c,
+ 0x6840, 0xa506, 0x0040, 0x2537, 0x127f, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x23d1, 0x0078, 0x2518, 0x1078,
+ 0x5fe3, 0x127f, 0x0040, 0x23d1, 0x0078, 0x23a7, 0xa00e, 0x2001,
+ 0x0005, 0x1078, 0x377c, 0x127e, 0x2091, 0x8000, 0x1078, 0x63a3,
+ 0x1078, 0x36ec, 0x127f, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3520, 0x1078, 0x35ec,
+ 0x0040, 0x23d1, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x2031, 0x000f, 0x1078, 0x3520, 0x8631,
+ 0x00c8, 0x2565, 0x2019, 0x0005, 0x1078, 0x360d, 0x0040, 0x23d1,
+ 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x8003, 0x800b, 0x810b,
+ 0xa108, 0x1078, 0x4160, 0x0078, 0x23a7, 0x127e, 0x2091, 0x8000,
+ 0x81ff, 0x00c0, 0x25ad, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506,
+ 0x0040, 0x25a7, 0x2508, 0x1078, 0x3497, 0x00c0, 0x25a7, 0x2031,
+ 0x000f, 0x1078, 0x3520, 0x8631, 0x00c8, 0x2591, 0x2019, 0x0004,
+ 0x1078, 0x360d, 0x0040, 0x25ad, 0x7824, 0xa08a, 0x1000, 0x00c8,
+ 0x25b0, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4160, 0x8529,
+ 0x00c8, 0x2586, 0x127f, 0x0078, 0x23a7, 0x127f, 0x0078, 0x23d1,
+ 0x127f, 0x0078, 0x23d5, 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078,
+ 0x3550, 0x1078, 0x35db, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3539, 0x1078, 0x35db,
+ 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x35aa, 0x0040, 0x23d1, 0x1078, 0x33dc, 0x1078,
+ 0x3564, 0x1078, 0x35db, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x3520, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078,
+ 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078,
+ 0x6bca, 0x1078, 0x35db, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x35db, 0x2208, 0x0078, 0x23a7, 0x157e, 0x0d7e,
+ 0x0e7e, 0x2069, 0x6fff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x260a,
0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9,
- 0x007e, 0x2069, 0x7720, 0x2d04, 0xa075, 0x0040, 0x275f, 0x704c,
- 0x1078, 0x2769, 0xa210, 0x7080, 0x1078, 0x2769, 0xa318, 0x8d68,
- 0x00f0, 0x2753, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078,
- 0x24e7, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2778, 0x2001, 0x0000,
- 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2778, 0x2178, 0x0078, 0x2770,
- 0x017f, 0x0f7f, 0x007c, 0x2069, 0x76ff, 0x6910, 0x629c, 0x0078,
- 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x614c, 0xa190, 0x2303, 0x2214,
- 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00, 0xa215, 0x6364, 0x0078,
- 0x24e7, 0x613c, 0x6240, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x6244,
- 0x6338, 0x0078, 0x24e7, 0x613c, 0x6240, 0x7824, 0x603e, 0x7b28,
- 0x6342, 0x2069, 0x7651, 0x831f, 0xa305, 0x6816, 0x0078, 0x24e7,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x7828, 0xa00d, 0x0040, 0x2515, 0x782c, 0xa005,
- 0x0040, 0x2515, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, 0x24e7,
- 0x7d38, 0x7c3c, 0x0078, 0x2594, 0x7824, 0xa09c, 0x00ff, 0xa39a,
- 0x0003, 0x00c8, 0x2511, 0x624c, 0xa084, 0xff00, 0x8007, 0xa206,
- 0x00c0, 0x27e4, 0x2001, 0x7640, 0x2009, 0x000c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0, 0x2511, 0x1078,
- 0x2ccb, 0x0040, 0x2515, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2511, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f, 0x0040, 0x2511,
- 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x69ec, 0x0040,
- 0x2511, 0x7007, 0x0003, 0x701b, 0x2806, 0x007c, 0x6830, 0xa086,
- 0x0100, 0x0040, 0x2511, 0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c,
- 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x1078, 0x2cb3, 0x0040,
- 0x2511, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078,
- 0x2ceb, 0x701b, 0x2824, 0x007c, 0xade8, 0x000d, 0x6800, 0xa005,
- 0x0040, 0x2515, 0x6804, 0xd0ac, 0x0040, 0x2831, 0xd0a4, 0x0040,
- 0x2515, 0xd094, 0x0040, 0x283c, 0x0c7e, 0x2061, 0x0100, 0x6104,
- 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2847, 0x0c7e,
- 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009,
- 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x285c, 0xd084, 0x0040,
- 0x285c, 0x6a28, 0xa28a, 0x007f, 0x00c8, 0x2515, 0xa288, 0x2303,
- 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x2865, 0x6828,
- 0xa08a, 0x007f, 0x00c8, 0x2515, 0x604e, 0x6808, 0xa08a, 0x0100,
- 0x0048, 0x2515, 0xa08a, 0x0841, 0x00c8, 0x2515, 0xa084, 0x0007,
- 0x00c0, 0x2515, 0x680c, 0xa005, 0x0040, 0x2515, 0x6810, 0xa005,
- 0x0040, 0x2515, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x2515, 0x8001,
- 0x0040, 0x2515, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x2515, 0x8001,
- 0x0040, 0x2515, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x7651, 0x2da0,
- 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff,
- 0x6042, 0x1078, 0x3c23, 0x1078, 0x39f9, 0x6000, 0xa086, 0x0000,
- 0x00c0, 0x28e0, 0x6808, 0x602a, 0x1078, 0x1dbe, 0x6818, 0x691c,
- 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a,
- 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x28c0, 0x6830, 0x6934,
- 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x28c2,
- 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x45b9,
- 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f,
- 0x60b4, 0xa005, 0x0040, 0x28dc, 0x6003, 0x0001, 0x2091, 0x301d,
- 0x1078, 0x3535, 0x0078, 0x28e0, 0x6003, 0x0004, 0x2091, 0x301d,
- 0x0078, 0x24e7, 0x6000, 0xa086, 0x0000, 0x0040, 0x2511, 0x2069,
- 0x7651, 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00, 0x2009, 0x001c,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x3535, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x617c, 0x81ff, 0x0040, 0x2917, 0x703f, 0x0000, 0x2001, 0x7cc0,
- 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x2cef, 0x701b, 0x24e4, 0x127f, 0x007c, 0x703f,
- 0x0001, 0x0d7e, 0x2069, 0x7cc0, 0x20a9, 0x0040, 0x20a1, 0x7cc0,
- 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2303, 0x210c, 0xa18c,
- 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040,
- 0x2949, 0x1078, 0x37d7, 0x00c0, 0x2949, 0x6014, 0x821c, 0x0048,
- 0x2941, 0xa398, 0x7cc0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078,
- 0x2948, 0xa398, 0x7cc0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a,
- 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, 0x2950, 0x0078, 0x292d,
- 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040,
- 0x20a1, 0x7cc0, 0x2099, 0x7cc0, 0x1078, 0x357e, 0x0078, 0x2906,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f,
- 0x0040, 0x2511, 0x2001, 0x7652, 0x2004, 0xd0b4, 0x0040, 0x298d,
- 0x6000, 0xd08c, 0x00c0, 0x298d, 0x6004, 0xa084, 0x00ff, 0xa086,
- 0x0006, 0x00c0, 0x298d, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6a24, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2989,
- 0x007c, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x20a9, 0x0029, 0x2c98,
- 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0002, 0xac80, 0x0004,
- 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078, 0x357e, 0x20a9, 0x0004,
- 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x357e,
- 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0,
- 0x1078, 0x357e, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x1078, 0x3937, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x2031, 0x000f, 0x1078, 0x3860, 0x8631, 0x00c8,
- 0x29d4, 0x2019, 0x0004, 0x1078, 0x394d, 0x7924, 0x810f, 0x7a28,
- 0x1078, 0x29e4, 0x0078, 0x24e7, 0xa186, 0x00ff, 0x0040, 0x29ec,
- 0x1078, 0x29fc, 0x0078, 0x29fb, 0x2029, 0x007e, 0x2061, 0x7600,
- 0x644c, 0x2400, 0xa506, 0x0040, 0x29f8, 0x2508, 0x1078, 0x29fc,
- 0x8529, 0x00c8, 0x29f1, 0x007c, 0x1078, 0x37d7, 0x00c0, 0x2a07,
- 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x452d, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078,
- 0x3860, 0x1078, 0x3942, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3860, 0x1078, 0x392c,
- 0x0078, 0x24e7, 0x6100, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x6004, 0xa086, 0x0707, 0x0040, 0x2515, 0x2001, 0x7600,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x2511, 0x0d7e, 0xace8, 0x000a,
- 0x7924, 0xd184, 0x0040, 0x2a3e, 0xace8, 0x0006, 0x680c, 0x8007,
- 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217,
- 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x24e7, 0x7824, 0xa084,
- 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2a58, 0x81ff, 0x00c0, 0x2511,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0xa186, 0x00ff, 0x0040, 0x2a6c, 0xa182, 0x007f, 0x00c8,
- 0x2515, 0x2100, 0x1078, 0x206e, 0x027e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7849, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061,
- 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043,
- 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x355a, 0x1078,
- 0x45b0, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078, 0x29e4,
- 0x127f, 0x0c7f, 0x027f, 0x0078, 0x24e7, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0x0c7e, 0x1078, 0x37a0, 0x2c08, 0x0c7f, 0x00c0, 0x2515,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x60bc, 0xd09c, 0x0040,
- 0x2511, 0x1078, 0x2cb3, 0x0040, 0x2511, 0x6823, 0x0000, 0x7924,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2ceb, 0x701b, 0x2ab9,
- 0x007c, 0x2009, 0x0080, 0x1078, 0x37d7, 0x00c0, 0x2ac6, 0x6004,
- 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x2aca, 0x2021, 0x400a,
- 0x0078, 0x24e9, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c,
- 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, 0x2b3c,
- 0xa0be, 0x0112, 0x0040, 0x2b3c, 0xa0be, 0x0113, 0x0040, 0x2b3c,
- 0xa0be, 0x0114, 0x0040, 0x2b3c, 0xa0be, 0x0117, 0x0040, 0x2b3c,
- 0xa0be, 0x011a, 0x0040, 0x2b3c, 0xa0be, 0x0121, 0x0040, 0x2b32,
- 0xa0be, 0x0131, 0x0040, 0x2b32, 0xa0be, 0x0171, 0x0040, 0x2b3c,
- 0xa0be, 0x0173, 0x0040, 0x2b3c, 0xa0be, 0x01a1, 0x00c0, 0x2b05,
- 0x6830, 0x8007, 0x6832, 0x0078, 0x2b42, 0xa0be, 0x0212, 0x0040,
- 0x2b38, 0xa0be, 0x0213, 0x0040, 0x2b38, 0xa0be, 0x0214, 0x0040,
- 0x2b2a, 0xa0be, 0x0217, 0x0040, 0x2b24, 0xa0be, 0x021a, 0x00c0,
- 0x2b1e, 0x6838, 0x8007, 0x683a, 0x0078, 0x2b3c, 0xa0be, 0x0300,
- 0x0040, 0x2b3c, 0x0078, 0x2511, 0xad80, 0x0010, 0x20a9, 0x0007,
- 0x1078, 0x2b70, 0xad80, 0x000e, 0x20a9, 0x0001, 0x1078, 0x2b70,
- 0x0078, 0x2b3c, 0xad80, 0x000c, 0x1078, 0x2b7e, 0x0078, 0x2b42,
- 0xad80, 0x000e, 0x1078, 0x2b7e, 0xad80, 0x000c, 0x20a9, 0x0001,
- 0x1078, 0x2b70, 0x0c7e, 0x1078, 0x2cb3, 0x0040, 0x2b65, 0x6837,
- 0x0119, 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e, 0x6883,
- 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b, 0x0000,
- 0x0c7f, 0x0d7f, 0x6837, 0x0000, 0x1078, 0x6a08, 0x0040, 0x2511,
- 0x7007, 0x0003, 0x701b, 0x2b69, 0x007c, 0x0c7f, 0x0d7f, 0x0078,
- 0x2511, 0x6820, 0xa086, 0x8001, 0x0040, 0x2511, 0x0078, 0x24e7,
- 0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108,
- 0x280a, 0x8108, 0x00f0, 0x2b72, 0x017f, 0x007c, 0x017e, 0x0a7e,
- 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000,
- 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a,
- 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x2140, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048, 0x2515,
- 0xa182, 0x00ff, 0x00c8, 0x2515, 0x7a2c, 0x7b28, 0x6064, 0xa306,
- 0x00c0, 0x2bb5, 0x6068, 0xa246, 0xa8c4, 0xff00, 0x0040, 0x2515,
- 0xa206, 0x00c0, 0x2bb5, 0x0078, 0x2515, 0x0c7e, 0x1078, 0x2c1e,
- 0x2c68, 0x0c7f, 0x0040, 0x2bdc, 0xa0c6, 0x4000, 0x00c0, 0x2bc2,
- 0x0078, 0x2bd9, 0xa0c6, 0x4007, 0x00c0, 0x2bc9, 0x2408, 0x0078,
- 0x2bd9, 0xa0c6, 0x4008, 0x00c0, 0x2bd1, 0x2708, 0x2610, 0x0078,
- 0x2bd9, 0xa0c6, 0x4009, 0x00c0, 0x2bd7, 0x0078, 0x2bd9, 0x2001,
- 0x4006, 0x2020, 0x0078, 0x24e9, 0x017e, 0x0b7e, 0x0c7e, 0x0e7e,
- 0x2c70, 0x1078, 0x5b4e, 0x0040, 0x2c0c, 0x2d00, 0x601a, 0x2e58,
- 0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f, 0x2b70, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x2d00, 0x6012, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f,
- 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2c17, 0x007c, 0x6830,
- 0xa086, 0x0100, 0x00c0, 0x24e7, 0x0078, 0x2511, 0x0e7e, 0x0d7e,
- 0x2029, 0x0000, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0x77a0,
- 0x2e04, 0xa005, 0x00c0, 0x2c32, 0x2100, 0xa406, 0x0040, 0x2c6f,
- 0x0078, 0x2c63, 0x2068, 0x6f10, 0x2700, 0xa306, 0x00c0, 0x2c54,
- 0x6e14, 0x2600, 0xa206, 0x00c0, 0x2c54, 0x2400, 0xa106, 0x00c0,
- 0x2c50, 0x2d60, 0xd884, 0x0040, 0x2c75, 0x6004, 0xa084, 0x00ff,
- 0xa086, 0x0006, 0x00c0, 0x2c75, 0x2001, 0x4000, 0x0078, 0x2c76,
- 0x2001, 0x4007, 0x0078, 0x2c76, 0x2400, 0xa106, 0x00c0, 0x2c63,
- 0x6e14, 0x87ff, 0x00c0, 0x2c5f, 0x86ff, 0x0040, 0x2c6f, 0x2001,
- 0x4008, 0x0078, 0x2c76, 0x8420, 0x8e70, 0x00f0, 0x2c28, 0x2001,
- 0x4009, 0x0078, 0x2c76, 0x2001, 0x0001, 0x0078, 0x2c76, 0x1078,
- 0x37a0, 0x00c0, 0x2c6b, 0x6312, 0x6216, 0xa006, 0xa005, 0x0d7f,
- 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cb3, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x7824, 0xa005, 0x0040, 0x2515, 0xa096,
- 0x00ff, 0x0040, 0x2c8f, 0xa092, 0x0004, 0x00c8, 0x2515, 0x2010,
- 0x2d18, 0x1078, 0x2251, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b,
- 0x2c9a, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0x0078,
- 0x24e7, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048,
- 0x2515, 0xa182, 0x00ff, 0x00c8, 0x2515, 0x1078, 0x6924, 0x1078,
- 0x37bf, 0x0078, 0x24e7, 0x1078, 0x1314, 0x0040, 0x2cca, 0xa006,
- 0x6802, 0x7010, 0xa005, 0x00c0, 0x2cc2, 0x2d00, 0x7012, 0x7016,
- 0x0078, 0x2cc8, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016,
- 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078,
- 0x37d7, 0x00c0, 0x2cd9, 0xa6b4, 0x00ff, 0xa682, 0x0010, 0x0048,
- 0x2cda, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040,
- 0x2ce7, 0x2168, 0x6904, 0x1078, 0x1348, 0x0078, 0x2cde, 0x7112,
- 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2cf1, 0x2031,
- 0x0000, 0x2061, 0x76bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b,
- 0x24e7, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000,
- 0x2001, 0x767b, 0x2004, 0xa005, 0x00c0, 0x2d1d, 0x0068, 0x2d1d,
- 0x7818, 0xd084, 0x00c0, 0x2d1d, 0x781b, 0x0001, 0x7a22, 0x7b26,
- 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2d42, 0x017e, 0x0c7e, 0x0e7e,
- 0x2071, 0x766d, 0x7138, 0xa182, 0x0008, 0x0048, 0x2d2b, 0x7030,
- 0x2060, 0x0078, 0x2d3c, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x76bd,
- 0x0048, 0x2d34, 0x2061, 0x767d, 0x2c00, 0x7032, 0x81ff, 0x00c0,
- 0x2d3a, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f,
- 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x766d,
- 0x7038, 0xa005, 0x0040, 0x2d7e, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x2d7d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2d7c,
- 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004,
- 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
- 0xa005, 0x00c0, 0x2d72, 0x7033, 0x767d, 0x7037, 0x767d, 0x0c7f,
- 0x0078, 0x2d7c, 0xac80, 0x0008, 0xa0fa, 0x76bd, 0x0048, 0x2d7a,
- 0x2001, 0x767d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
- 0x027e, 0x2001, 0x7652, 0x2004, 0xd0c4, 0x0040, 0x2d8b, 0x2011,
- 0x8014, 0x1078, 0x2d02, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2511,
- 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x3535,
- 0x127f, 0x0078, 0x24e7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
- 0x2da6, 0x61c8, 0xa10d, 0x61ca, 0x0078, 0x24e7, 0x0078, 0x2515,
- 0x81ff, 0x00c0, 0x2511, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2511,
- 0x2001, 0x7652, 0x2004, 0xd0a4, 0x00c0, 0x2511, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x2dc5, 0x7828, 0xa005, 0x0040, 0x24e7, 0x0c7e, 0x1078, 0x2cb3,
- 0x0c7f, 0x0040, 0x2511, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
- 0xc0fd, 0x683a, 0x1078, 0x6a91, 0x0040, 0x2511, 0x7007, 0x0003,
- 0x701b, 0x2ddb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511,
- 0x0078, 0x24e7, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x2511, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2cb3,
- 0x0040, 0x2511, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000,
- 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x37d7,
- 0x00c0, 0x2e28, 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2e28, 0xa084,
- 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2e28, 0x87ff, 0x0040, 0x2e1b,
+ 0x007d, 0x2069, 0x7020, 0x2d04, 0xa075, 0x0040, 0x261f, 0x704c,
+ 0x1078, 0x2629, 0xa210, 0x7080, 0x1078, 0x2629, 0xa318, 0x8d68,
+ 0x00f0, 0x2613, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078,
+ 0x23a7, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2638, 0x2001, 0x0000,
+ 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2638, 0x2178, 0x0078, 0x2630,
+ 0x017f, 0x0f7f, 0x007c, 0x2069, 0x6fff, 0x6910, 0x6294, 0x0078,
+ 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x614c, 0xa190, 0x21d3, 0x2214,
+ 0xa294, 0x00ff, 0x0078, 0x23a7, 0x613c, 0x6240, 0x0078, 0x23a7,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x0078, 0x23a7, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6244, 0x6338, 0x0078, 0x23a7, 0x613c, 0x6240,
+ 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0x6f51, 0x831f, 0xa305,
+ 0x6816, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040, 0x23d5, 0x0078,
+ 0x23a7, 0x1078, 0x298f, 0x0040, 0x23d5, 0x7828, 0xa00d, 0x0040,
+ 0x23d5, 0x782c, 0xa005, 0x0040, 0x23d5, 0x6244, 0x6146, 0x6338,
+ 0x603a, 0x0078, 0x23a7, 0x7d38, 0x7c3c, 0x0078, 0x2454, 0x7824,
+ 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x23d1, 0x624c, 0xa084,
+ 0xff00, 0x8007, 0xa206, 0x00c0, 0x269f, 0x2001, 0x6f40, 0x2009,
+ 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29b3, 0x81ff,
+ 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x6004, 0xa084,
+ 0x00ff, 0xa086, 0x0006, 0x00c0, 0x23d1, 0x0c7e, 0x1078, 0x2977,
+ 0x0c7f, 0x0040, 0x23d1, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
+ 0x1078, 0x62b9, 0x0040, 0x23d1, 0x7007, 0x0003, 0x701b, 0x26c1,
+ 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x23d1, 0xad80, 0x000e,
+ 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29b3,
+ 0x1078, 0x2977, 0x0040, 0x23d1, 0x2009, 0x001c, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x1078, 0x29af, 0x701b, 0x26df, 0x007c, 0xade8,
+ 0x000d, 0x6800, 0xa005, 0x0040, 0x23d5, 0x6804, 0xd0ac, 0x0040,
+ 0x26ec, 0xd0a4, 0x0040, 0x23d5, 0xd094, 0x0040, 0x26f7, 0x0c7e,
+ 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c,
+ 0x0040, 0x2702, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010,
+ 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048,
+ 0x2717, 0xd084, 0x0040, 0x2717, 0x6a28, 0xa28a, 0x007e, 0x00c8,
+ 0x23d5, 0xa288, 0x21d3, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc,
+ 0x0040, 0x2720, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x23d5, 0x604e,
+ 0x6808, 0xa08a, 0x0100, 0x0048, 0x23d5, 0xa08a, 0x0841, 0x00c8,
+ 0x23d5, 0xa084, 0x0007, 0x00c0, 0x23d5, 0x680c, 0xa005, 0x0040,
+ 0x23d5, 0x6810, 0xa005, 0x0040, 0x23d5, 0x6848, 0x6940, 0xa10a,
+ 0x00c8, 0x23d5, 0x8001, 0x0040, 0x23d5, 0x684c, 0x6944, 0xa10a,
+ 0x00c8, 0x23d5, 0x8001, 0x0040, 0x23d5, 0x20a9, 0x001c, 0x2d98,
+ 0x2069, 0x6f51, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
+ 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x38e3, 0x1078, 0x36b9,
+ 0x6000, 0xa086, 0x0000, 0x00c0, 0x279b, 0x6808, 0x602a, 0x1078,
+ 0x1d32, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
+ 0x277b, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x0078, 0x277d, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x41ec, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x2797, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x31f5, 0x0078, 0x279b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x23a7, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x23d1, 0x2069, 0x6f51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x29b3, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x31f5, 0x0078, 0x23a7,
+ 0x81ff, 0x00c0, 0x23d1, 0x6174, 0x81ff, 0x0040, 0x27d2, 0x703f,
+ 0x0000, 0x2001, 0x74c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x29b3, 0x701b, 0x23a4,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x74c0, 0x20a9,
+ 0x0040, 0x20a1, 0x74c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x21d3, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x2804, 0x1078, 0x3497, 0x00c0, 0x2804,
+ 0x6014, 0x821c, 0x0048, 0x27fc, 0xa398, 0x74c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x2803, 0xa398, 0x74c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8,
+ 0x280b, 0x0078, 0x27e8, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2099, 0x74c0, 0x1078,
+ 0x323e, 0x0078, 0x27c1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x0c7e,
+ 0x1078, 0x2977, 0x0c7f, 0x0040, 0x23d1, 0x2001, 0x6f52, 0x2004,
+ 0xd0b4, 0x0040, 0x2848, 0x6000, 0xd08c, 0x00c0, 0x2848, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2848, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x62d5, 0x0040, 0x23d1, 0x7007,
+ 0x0003, 0x701b, 0x2844, 0x007c, 0x1078, 0x298f, 0x0040, 0x23d5,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078,
+ 0x323e, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a,
+ 0x20a0, 0x1078, 0x323e, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x0078, 0x29b3, 0x81ff, 0x00c0, 0x23d1, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x1078, 0x35f7, 0x0078, 0x23a7, 0x81ff,
+ 0x00c0, 0x23d1, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x2031, 0x000f, 0x1078, 0x3520, 0x8631,
+ 0x00c8, 0x2885, 0x2019, 0x0004, 0x1078, 0x360d, 0x7924, 0x810f,
+ 0x7a28, 0x1078, 0x2895, 0x0078, 0x23a7, 0xa186, 0x00ff, 0x0040,
+ 0x289d, 0x1078, 0x28ad, 0x0078, 0x28ac, 0x2029, 0x007d, 0x2061,
+ 0x6f00, 0x644c, 0x2400, 0xa506, 0x0040, 0x28a9, 0x2508, 0x1078,
+ 0x28ad, 0x8529, 0x00c8, 0x28a2, 0x007c, 0x1078, 0x3497, 0x00c0,
+ 0x28b8, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4160,
+ 0x007c, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5,
+ 0x1078, 0x3520, 0x1078, 0x3602, 0x0078, 0x23a7, 0x81ff, 0x00c0,
+ 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3520, 0x1078,
+ 0x35ec, 0x0078, 0x23a7, 0x6100, 0x0078, 0x23a7, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6004, 0xa086, 0x0707, 0x0040, 0x23d5, 0x2001,
+ 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x23d1, 0x0d7e, 0xace8,
+ 0x000a, 0x7924, 0xd184, 0x0040, 0x28ef, 0xace8, 0x0006, 0x680c,
+ 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00,
+ 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x23a7, 0x7824,
+ 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2909, 0x81ff, 0x00c0,
+ 0x23d1, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x291d, 0xa182, 0x007e,
+ 0x00c8, 0x23d5, 0x2100, 0x1078, 0x1fb7, 0x027e, 0x0c7e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x70c9, 0x601b, 0x0000, 0x601f, 0x0000,
+ 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a,
+ 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x321a,
+ 0x1078, 0x41e3, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078,
+ 0x2895, 0x127f, 0x0c7f, 0x027f, 0x0078, 0x23a7, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0x0c7e, 0x1078, 0x3460, 0x2c08, 0x0c7f, 0x00c0,
+ 0x23d5, 0x0078, 0x23a7, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c,
+ 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2955, 0x017f,
+ 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c,
+ 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108,
+ 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x1078,
+ 0x12c5, 0x0040, 0x298e, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
+ 0x2986, 0x2d00, 0x7012, 0x7016, 0x0078, 0x298c, 0x7014, 0x6802,
+ 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24,
+ 0x860f, 0xa18c, 0x00ff, 0x1078, 0x3497, 0x00c0, 0x299d, 0xa6b4,
+ 0x00ff, 0xa682, 0x0010, 0x0048, 0x299e, 0xa066, 0x8cff, 0x007c,
+ 0x017e, 0x7110, 0x81ff, 0x0040, 0x29ab, 0x2168, 0x6904, 0x1078,
+ 0x12f9, 0x0078, 0x29a2, 0x7112, 0x7116, 0x017f, 0x007c, 0x2031,
+ 0x0001, 0x0078, 0x29b5, 0x2031, 0x0000, 0x2061, 0x6fbd, 0x6606,
+ 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
+ 0x1330, 0x7007, 0x0002, 0x701b, 0x23a7, 0x007c, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x6f7b, 0x2004, 0xa005,
+ 0x00c0, 0x29e0, 0x0068, 0x29e0, 0x7818, 0xd084, 0x00c0, 0x29e0,
+ 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080, 0x0078, 0x2a04,
+ 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x6f6d, 0x7138, 0xa182, 0x0008,
+ 0x0048, 0x29ee, 0x7030, 0x2060, 0x0078, 0x29ff, 0x7030, 0xa0e0,
+ 0x0008, 0xac82, 0x6fbd, 0x0048, 0x29f7, 0x2061, 0x6f7d, 0x2c00,
+ 0x7032, 0x81ff, 0x00c0, 0x29fd, 0x7036, 0x8108, 0x713a, 0x2262,
+ 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6f6d, 0x7038, 0xa005, 0x0040, 0x2a3e, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x2a3d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084,
+ 0x00c0, 0x2a3c, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04,
+ 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
+ 0xa005, 0x00c0, 0x2a32, 0x7033, 0x6f7d, 0x7037, 0x6f7d, 0x0c7f,
+ 0x0078, 0x2a3c, 0xac80, 0x0008, 0xa0fa, 0x6fbd, 0x0048, 0x2a3a,
+ 0x2001, 0x6f7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
+ 0x027e, 0x2001, 0x6f52, 0x2004, 0xd0c4, 0x0040, 0x2a4b, 0x2011,
+ 0x8014, 0x1078, 0x29c6, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x23d1,
+ 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x31f5,
+ 0x127f, 0x0078, 0x23a7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
+ 0x2a66, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x23a7, 0x0078, 0x23d5,
+ 0x81ff, 0x00c0, 0x23d1, 0x6000, 0xa086, 0x0003, 0x00c0, 0x23d1,
+ 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x00c0, 0x23d1, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x2a85, 0x7828, 0xa005, 0x0040, 0x23a7, 0x0c7e, 0x1078, 0x2977,
+ 0x0c7f, 0x0040, 0x23d1, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+ 0xc0fd, 0x683a, 0x1078, 0x6342, 0x0040, 0x23d1, 0x7007, 0x0003,
+ 0x701b, 0x2a9b, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x23d1,
+ 0x0078, 0x23a7, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0,
+ 0x23d1, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2977,
+ 0x0040, 0x23d1, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000,
+ 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x3497,
+ 0x00c0, 0x2ae8, 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2ae8, 0xa084,
+ 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2ae8, 0x87ff, 0x0040, 0x2adb,
0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078,
- 0x2b7e, 0x0078, 0x2e24, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9,
- 0x0004, 0x53a3, 0x1078, 0x2b7e, 0x21a2, 0x94a0, 0xa6b0, 0x0005,
- 0x8108, 0xa186, 0x007e, 0x0040, 0x2e33, 0xa686, 0x0028, 0x0040,
- 0x2e3c, 0x0078, 0x2dfe, 0x86ff, 0x00c0, 0x2e3a, 0x7120, 0x810b,
- 0x0078, 0x24e7, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022,
- 0x772a, 0x2061, 0x76bd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e,
- 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007,
- 0x0002, 0x701b, 0x2e54, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2e66,
- 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x76bd,
- 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2dfe, 0x7120, 0x810b,
- 0x0078, 0x24e7, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
- 0x7600, 0x6044, 0xd0a4, 0x00c0, 0x2e93, 0xd084, 0x0040, 0x2e7c,
- 0x1078, 0x2fba, 0x0078, 0x2e8f, 0xd08c, 0x0040, 0x2e83, 0x1078,
- 0x2ed1, 0x0078, 0x2e8f, 0xd094, 0x0040, 0x2e8a, 0x1078, 0x2eb4,
- 0x0078, 0x2e8f, 0xd09c, 0x0040, 0x2e8f, 0x1078, 0x2e9d, 0x0e7f,
- 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2e9a,
- 0xc19d, 0x612a, 0x017f, 0x0078, 0x2e8f, 0x6043, 0x0040, 0x6043,
- 0x0000, 0x706f, 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009,
- 0x7cc0, 0x200b, 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011,
- 0x34f5, 0x1078, 0x45b0, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2ed0,
- 0x2011, 0x34f5, 0x1078, 0x4520, 0x6043, 0x0020, 0x6043, 0x0000,
- 0x6044, 0xd08c, 0x00c0, 0x2ecc, 0x7083, 0x0000, 0x6043, 0x0090,
- 0x6043, 0x0010, 0x0078, 0x2ed0, 0x7077, 0x0000, 0x0078, 0x2ed0,
- 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2eda, 0x1079, 0x2edd,
- 0x0078, 0x2edc, 0x1078, 0x12d5, 0x007c, 0x2ee0, 0x2f2f, 0x2fb9,
- 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
- 0x1dbe, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7b00, 0x207b,
+ 0x2961, 0x0078, 0x2ae4, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9,
+ 0x0004, 0x53a3, 0x1078, 0x2961, 0x21a2, 0x94a0, 0xa6b0, 0x0005,
+ 0x8108, 0xa186, 0x007e, 0x0040, 0x2af3, 0xa686, 0x0028, 0x0040,
+ 0x2afc, 0x0078, 0x2abe, 0x86ff, 0x00c0, 0x2afa, 0x7120, 0x810b,
+ 0x0078, 0x23a7, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022,
+ 0x772a, 0x2061, 0x6fbd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e,
+ 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x1330, 0x7007,
+ 0x0002, 0x701b, 0x2b14, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2b26,
+ 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x6fbd,
+ 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2abe, 0x7120, 0x810b,
+ 0x0078, 0x23a7, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
+ 0x6f00, 0x6044, 0xd0a4, 0x00c0, 0x2b53, 0xd084, 0x0040, 0x2b3c,
+ 0x1078, 0x2c7a, 0x0078, 0x2b4f, 0xd08c, 0x0040, 0x2b43, 0x1078,
+ 0x2b91, 0x0078, 0x2b4f, 0xd094, 0x0040, 0x2b4a, 0x1078, 0x2b74,
+ 0x0078, 0x2b4f, 0xd09c, 0x0040, 0x2b4f, 0x1078, 0x2b5d, 0x0e7f,
+ 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2b5a,
+ 0xc19d, 0x612a, 0x017f, 0x0078, 0x2b4f, 0x6043, 0x0040, 0x6043,
+ 0x0000, 0x7067, 0x0000, 0x707f, 0x0001, 0x709f, 0x0000, 0x2009,
+ 0x74c0, 0x200b, 0x0000, 0x706b, 0x000f, 0x2009, 0x000f, 0x2011,
+ 0x31b5, 0x1078, 0x41e3, 0x007c, 0x7068, 0xa005, 0x00c0, 0x2b90,
+ 0x2011, 0x31b5, 0x1078, 0x4153, 0x6043, 0x0020, 0x6043, 0x0000,
+ 0x6044, 0xd08c, 0x00c0, 0x2b8c, 0x707b, 0x0000, 0x6043, 0x0090,
+ 0x6043, 0x0010, 0x0078, 0x2b90, 0x706f, 0x0000, 0x0078, 0x2b90,
+ 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2b9a, 0x1079, 0x2b9d,
+ 0x0078, 0x2b9c, 0x1078, 0x1286, 0x007c, 0x2ba0, 0x2bef, 0x2c79,
+ 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
+ 0x1d32, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7300, 0x207b,
0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813,
0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823,
0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079,
- 0x7b0c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x7605, 0x20a1,
- 0x7b0e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7b12, 0x207b, 0x0000,
- 0x7807, 0x0000, 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x0014,
- 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x351c, 0x0f7f,
- 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
- 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2fa3, 0x6020, 0xd0b4,
- 0x00c0, 0x2fa1, 0x7184, 0x81ff, 0x0040, 0x2f8a, 0xa486, 0x000c,
- 0x00c0, 0x2f95, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7b80,
- 0x2019, 0x7b00, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2f61, 0x8210,
- 0x8318, 0x00f0, 0x2f4a, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
- 0xf0f0, 0x6043, 0x0006, 0x7077, 0x0002, 0x7083, 0x0002, 0x0078,
- 0x2fa1, 0x2069, 0x7b80, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2f95,
- 0x6834, 0xa005, 0x00c0, 0x2f95, 0x6900, 0xa18c, 0x00ff, 0x00c0,
- 0x2f75, 0x6804, 0xa005, 0x0040, 0x2f8a, 0x2011, 0x7b8e, 0x2019,
- 0x7605, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2f88,
- 0x00c0, 0x2f95, 0x8210, 0x8318, 0x00f0, 0x2f7b, 0x0078, 0x2f95,
- 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
+ 0x730c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x6f05, 0x20a1,
+ 0x730e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7312, 0x207b, 0x0000,
+ 0x7807, 0x0000, 0x2099, 0x7300, 0x20a1, 0x020b, 0x20a9, 0x0014,
+ 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x31dc, 0x0f7f,
+ 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
+ 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2c63, 0x6020, 0xd0b4,
+ 0x00c0, 0x2c61, 0x717c, 0x81ff, 0x0040, 0x2c4a, 0xa486, 0x000c,
+ 0x00c0, 0x2c55, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7380,
+ 0x2019, 0x7300, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2c21, 0x8210,
+ 0x8318, 0x00f0, 0x2c0a, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
+ 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b, 0x0002, 0x0078,
+ 0x2c61, 0x2069, 0x7380, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2c55,
+ 0x6834, 0xa005, 0x00c0, 0x2c55, 0x6900, 0xa18c, 0x00ff, 0x00c0,
+ 0x2c35, 0x6804, 0xa005, 0x0040, 0x2c4a, 0x2011, 0x738e, 0x2019,
+ 0x6f05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2c48,
+ 0x00c0, 0x2c55, 0x8210, 0x8318, 0x00f0, 0x2c3b, 0x0078, 0x2c55,
+ 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043,
- 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2fa1, 0x60c3, 0x000c, 0x1078,
- 0x351c, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2fa1, 0x60c3,
- 0x000c, 0x2011, 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x20e1,
- 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b, 0x0078,
- 0x2fa1, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8, 0x2fc3, 0x1079,
- 0x2fc6, 0x0078, 0x2fc5, 0x1078, 0x12d5, 0x007c, 0x2fea, 0x2ff9,
- 0x302a, 0x303f, 0x306f, 0x3097, 0x30c7, 0x30f1, 0x3121, 0x3147,
- 0x3192, 0x31b4, 0x31d8, 0x31ee, 0x3214, 0x3227, 0x3230, 0x3249,
- 0x3277, 0x329f, 0x32cd, 0x32f7, 0x333c, 0x3371, 0x3393, 0x33d1,
- 0x33f5, 0x340e, 0x341b, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2c61, 0x60c3, 0x000c, 0x1078,
+ 0x31dc, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2c61, 0x60c3,
+ 0x000c, 0x2011, 0x70c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x20e1,
+ 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4f3c, 0x0078,
+ 0x2c61, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8, 0x2c83, 0x1079,
+ 0x2c86, 0x0078, 0x2c85, 0x1078, 0x1286, 0x007c, 0x2caa, 0x2cb9,
+ 0x2cea, 0x2cff, 0x2d2f, 0x2d57, 0x2d87, 0x2db1, 0x2de1, 0x2e07,
+ 0x2e52, 0x2e74, 0x2e98, 0x2eae, 0x2ed4, 0x2ee7, 0x2ef0, 0x2f09,
+ 0x2f37, 0x2f5f, 0x2f8d, 0x2fb7, 0x2ffc, 0x3031, 0x3053, 0x3091,
+ 0x30b5, 0x30ce, 0x30db, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002,
- 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078, 0x4513,
- 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0, 0x3028, 0x6043,
- 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3028, 0x2079, 0x7b80, 0x7a30,
- 0xa296, 0x1102, 0x00c0, 0x3026, 0x7834, 0xa005, 0x00c0, 0x3026,
- 0x7a38, 0xd2fc, 0x0040, 0x301c, 0x70a4, 0xa005, 0x00c0, 0x301c,
- 0x1078, 0x35b5, 0x70a7, 0x0001, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0x7083, 0x0010, 0x1078, 0x3230, 0x0078, 0x3028, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x0003, 0x6043, 0x0004, 0x1078, 0x3586,
+ 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078, 0x4146,
+ 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0, 0x2ce8, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2ce8, 0x2079, 0x7380, 0x7a30,
+ 0xa296, 0x1102, 0x00c0, 0x2ce6, 0x7834, 0xa005, 0x00c0, 0x2ce6,
+ 0x7a38, 0xd2fc, 0x0040, 0x2cdc, 0x709c, 0xa005, 0x00c0, 0x2cdc,
+ 0x1078, 0x3275, 0x709f, 0x0001, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0x707b, 0x0010, 0x1078, 0x2ef0, 0x0078, 0x2ce8, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004, 0x1078, 0x3246,
0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000,
- 0x00f0, 0x3036, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x306d, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x3069, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1102, 0x00c0, 0x3069, 0x7834, 0xa005, 0x00c0, 0x3069, 0x7a38,
- 0xd2fc, 0x0040, 0x3063, 0x70a4, 0xa005, 0x00c0, 0x3063, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0004, 0x1078, 0x306f, 0x0078,
- 0x306d, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0005, 0x1078, 0x3586, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x3089, 0x714c, 0xa186,
- 0xffff, 0x0040, 0x3089, 0x1078, 0x34c0, 0x0040, 0x3089, 0x1078,
- 0x35b5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x30c5, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x30c1, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1103, 0x00c0, 0x30c1, 0x7834, 0xa005, 0x00c0, 0x30c1, 0x7a38,
- 0xd2fc, 0x0040, 0x30bb, 0x70a4, 0xa005, 0x00c0, 0x30bb, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078, 0x30c7, 0x0078,
- 0x30c5, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0007, 0x1078, 0x3586, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x30e3, 0x7150, 0xa186,
- 0xffff, 0x0040, 0x30e3, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00,
- 0x810f, 0x1078, 0x34c0, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x311f, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0014, 0x00c0, 0x311b, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1104, 0x00c0, 0x311b, 0x7834, 0xa005, 0x00c0,
- 0x311b, 0x7a38, 0xd2fc, 0x0040, 0x3115, 0x70a4, 0xa005, 0x00c0,
- 0x3115, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0008, 0x1078,
- 0x3121, 0x0078, 0x311f, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f,
- 0x007c, 0x7083, 0x0009, 0x1078, 0x3586, 0x20a3, 0x1105, 0x20a3,
- 0x0100, 0x3430, 0x706c, 0xa005, 0x00c0, 0x3134, 0x1078, 0x342a,
- 0x0040, 0x3144, 0x0078, 0x313e, 0x20a9, 0x0008, 0x2099, 0x7b8e,
+ 0x00f0, 0x2cf6, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d2d, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2d29, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1102, 0x00c0, 0x2d29, 0x7834, 0xa005, 0x00c0, 0x2d29, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d23, 0x709c, 0xa005, 0x00c0, 0x2d23, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078, 0x2d2f, 0x0078,
+ 0x2d2d, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0005, 0x1078, 0x3246, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2d49, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2d49, 0x1078, 0x3180, 0x0040, 0x2d49, 0x1078,
+ 0x3275, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d85, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2d81, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2d81, 0x7834, 0xa005, 0x00c0, 0x2d81, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d7b, 0x709c, 0xa005, 0x00c0, 0x2d7b, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078, 0x2d87, 0x0078,
+ 0x2d85, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0007, 0x1078, 0x3246, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2da3, 0x7150, 0xa186,
+ 0xffff, 0x0040, 0x2da3, 0xa180, 0x21d3, 0x200c, 0xa18c, 0xff00,
+ 0x810f, 0x1078, 0x3180, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2ddf, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0014, 0x00c0, 0x2ddb, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2ddb, 0x7834, 0xa005, 0x00c0,
+ 0x2ddb, 0x7a38, 0xd2fc, 0x0040, 0x2dd5, 0x709c, 0xa005, 0x00c0,
+ 0x2dd5, 0x1078, 0x3275, 0x709f, 0x0001, 0x707b, 0x0008, 0x1078,
+ 0x2de1, 0x0078, 0x2ddf, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
+ 0x007c, 0x707b, 0x0009, 0x1078, 0x3246, 0x20a3, 0x1105, 0x20a3,
+ 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2df4, 0x1078, 0x30ea,
+ 0x0040, 0x2e04, 0x0078, 0x2dfe, 0x20a9, 0x0008, 0x2099, 0x738e,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x351c, 0x0078, 0x3146, 0x1078, 0x2fe3, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3190, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x318c, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1105, 0x00c0, 0x318c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
- 0x3175, 0x7a38, 0xd2fc, 0x0040, 0x316d, 0x70a4, 0xa005, 0x00c0,
- 0x316d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083,
- 0x000a, 0x1078, 0x3192, 0x0078, 0x3190, 0xa005, 0x00c0, 0x318c,
- 0x7a38, 0xd2fc, 0x0040, 0x3184, 0x70a4, 0xa005, 0x00c0, 0x3184,
- 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e,
- 0x1078, 0x3214, 0x0078, 0x3190, 0x7083, 0x0002, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x7b0e, 0x22a0, 0x20a9,
+ 0x1078, 0x31dc, 0x0078, 0x2e06, 0x1078, 0x2ca3, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2e50, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2e4c, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2e4c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2e35, 0x7a38, 0xd2fc, 0x0040, 0x2e2d, 0x709c, 0xa005, 0x00c0,
+ 0x2e2d, 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0001, 0x707b,
+ 0x000a, 0x1078, 0x2e52, 0x0078, 0x2e50, 0xa005, 0x00c0, 0x2e4c,
+ 0x7a38, 0xd2fc, 0x0040, 0x2e44, 0x709c, 0xa005, 0x00c0, 0x2e44,
+ 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x000e,
+ 0x1078, 0x2ed4, 0x0078, 0x2e50, 0x707b, 0x0002, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x730e, 0x22a0, 0x20a9,
0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
- 0x41a4, 0x1078, 0x3586, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0x41a4, 0x1078, 0x3246, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
- 0x0084, 0x1078, 0x351c, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
- 0x31d6, 0x2011, 0x34fc, 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0,
- 0x31d2, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x31d2,
- 0x7834, 0xa005, 0x00c0, 0x31d2, 0x7083, 0x000c, 0x1078, 0x31d8,
- 0x0078, 0x31d6, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x000d, 0x1078, 0x3586, 0x20a3, 0x1107, 0x20a3, 0x0000,
- 0x2099, 0x7b8e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0084, 0x1078, 0x351c, 0x007c, 0x0f7e, 0x7078,
- 0xa005, 0x0040, 0x3212, 0x2011, 0x34fc, 0x1078, 0x4520, 0xa086,
- 0x0084, 0x00c0, 0x320e, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1107,
- 0x00c0, 0x320e, 0x7834, 0xa005, 0x00c0, 0x320e, 0x1078, 0x3578,
- 0x7083, 0x000e, 0x1078, 0x3214, 0x0078, 0x3212, 0x7083, 0x0002,
- 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000,
+ 0x0084, 0x1078, 0x31dc, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040,
+ 0x2e96, 0x2011, 0x31bc, 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0,
+ 0x2e92, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2e92,
+ 0x7834, 0xa005, 0x00c0, 0x2e92, 0x707b, 0x000c, 0x1078, 0x2e98,
+ 0x0078, 0x2e96, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
+ 0x707b, 0x000d, 0x1078, 0x3246, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x738e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x31dc, 0x007c, 0x0f7e, 0x7070,
+ 0xa005, 0x0040, 0x2ed2, 0x2011, 0x31bc, 0x1078, 0x4153, 0xa086,
+ 0x0084, 0x00c0, 0x2ece, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2ece, 0x7834, 0xa005, 0x00c0, 0x2ece, 0x1078, 0x3238,
+ 0x707b, 0x000e, 0x1078, 0x2ed4, 0x0078, 0x2ed2, 0x707b, 0x0002,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f, 0x7073, 0x0000,
0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
- 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078, 0x4513, 0x007c, 0x7078,
- 0xa005, 0x0040, 0x322f, 0x2011, 0x34fc, 0x1078, 0x4520, 0x007c,
- 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
- 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
- 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3275, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0014, 0x00c0, 0x3273, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1103, 0x00c0, 0x3273, 0x7834, 0xa005, 0x00c0,
- 0x3273, 0x7a38, 0xd2fc, 0x0040, 0x326d, 0x70a4, 0xa005, 0x00c0,
- 0x326d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0012, 0x1078,
- 0x3277, 0x0078, 0x3275, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0013, 0x1078, 0x3592, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x3291, 0x714c, 0xa186,
- 0xffff, 0x0040, 0x3291, 0x1078, 0x34c0, 0x0040, 0x3291, 0x1078,
- 0x35b5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x32cb, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x32c9, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1104, 0x00c0, 0x32c9, 0x7834, 0xa005, 0x00c0, 0x32c9, 0x7a38,
- 0xd2fc, 0x0040, 0x32c3, 0x70a4, 0xa005, 0x00c0, 0x32c3, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0014, 0x1078, 0x32cd, 0x0078,
- 0x32cb, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078,
- 0x3592, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7b8e,
- 0x706c, 0xa006, 0x00c0, 0x32e9, 0x7150, 0xa186, 0xffff, 0x0040,
- 0x32e9, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34c0, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x333a, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x3338, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1105, 0x00c0, 0x3338, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
- 0x3321, 0x7a38, 0xd2fc, 0x0040, 0x331d, 0x70a4, 0xa005, 0x00c0,
- 0x331d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078,
- 0x3332, 0xa005, 0x00c0, 0x3338, 0x7a38, 0xd2fc, 0x0040, 0x3330,
- 0x70a4, 0xa005, 0x00c0, 0x3330, 0x1078, 0x35b5, 0x70a7, 0x0001,
- 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x333c, 0x0078, 0x333a,
- 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7b80, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
- 0x2011, 0x7b8e, 0x707c, 0xa005, 0x0040, 0x3352, 0x7083, 0x0017,
- 0x0078, 0x3354, 0x7083, 0x001b, 0x706c, 0xa005, 0x00c0, 0x335e,
- 0x1078, 0x342a, 0x0040, 0x336e, 0x0078, 0x3368, 0x20a9, 0x0008,
- 0x2099, 0x7b8e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x351c, 0x0078, 0x3370, 0x1078, 0x2fe3,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3391, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0, 0x338f, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1106, 0x00c0, 0x338f, 0x7834, 0xa005, 0x00c0,
- 0x338f, 0x7083, 0x0018, 0x1078, 0x3393, 0x0078, 0x3391, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0019, 0x1078, 0x3592, 0x20a3,
- 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x7b8e, 0x2039, 0x7b0e,
+ 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078, 0x4146, 0x007c, 0x7070,
+ 0xa005, 0x0040, 0x2eef, 0x2011, 0x31bc, 0x1078, 0x4153, 0x007c,
+ 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
+ 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f35, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0014, 0x00c0, 0x2f33, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2f33, 0x7834, 0xa005, 0x00c0,
+ 0x2f33, 0x7a38, 0xd2fc, 0x0040, 0x2f2d, 0x709c, 0xa005, 0x00c0,
+ 0x2f2d, 0x1078, 0x3275, 0x709f, 0x0001, 0x707b, 0x0012, 0x1078,
+ 0x2f37, 0x0078, 0x2f35, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0013, 0x1078, 0x3252, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2f51, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2f51, 0x1078, 0x3180, 0x0040, 0x2f51, 0x1078,
+ 0x3275, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2f8b, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2f89, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1104, 0x00c0, 0x2f89, 0x7834, 0xa005, 0x00c0, 0x2f89, 0x7a38,
+ 0xd2fc, 0x0040, 0x2f83, 0x709c, 0xa005, 0x00c0, 0x2f83, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078, 0x2f8d, 0x0078,
+ 0x2f8b, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0015, 0x1078,
+ 0x3252, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e,
+ 0x7064, 0xa006, 0x00c0, 0x2fa9, 0x7150, 0xa186, 0xffff, 0x0040,
+ 0x2fa9, 0xa180, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3180, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2ffa, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2ff8, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2ff8, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2fe1, 0x7a38, 0xd2fc, 0x0040, 0x2fdd, 0x709c, 0xa005, 0x00c0,
+ 0x2fdd, 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0001, 0x0078,
+ 0x2ff2, 0xa005, 0x00c0, 0x2ff8, 0x7a38, 0xd2fc, 0x0040, 0x2ff0,
+ 0x709c, 0xa005, 0x00c0, 0x2ff0, 0x1078, 0x3275, 0x709f, 0x0001,
+ 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x2ffc, 0x0078, 0x2ffa,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
+ 0x2011, 0x738e, 0x7074, 0xa005, 0x0040, 0x3012, 0x707b, 0x0017,
+ 0x0078, 0x3014, 0x707b, 0x001b, 0x7064, 0xa005, 0x00c0, 0x301e,
+ 0x1078, 0x30ea, 0x0040, 0x302e, 0x0078, 0x3028, 0x20a9, 0x0008,
+ 0x2099, 0x738e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x31dc, 0x0078, 0x3030, 0x1078, 0x2ca3,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x3051, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0, 0x304f, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1106, 0x00c0, 0x304f, 0x7834, 0xa005, 0x00c0,
+ 0x304f, 0x707b, 0x0018, 0x1078, 0x3053, 0x0078, 0x3051, 0x7073,
+ 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078, 0x3252, 0x20a3,
+ 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x738e, 0x2039, 0x730e,
0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084,
0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a,
- 0x6030, 0x2310, 0x8214, 0xa2a0, 0x7b0e, 0x2414, 0xa38c, 0x0001,
- 0x0040, 0x33be, 0xa294, 0xff00, 0x0078, 0x33c1, 0xa294, 0x00ff,
+ 0x6030, 0x2310, 0x8214, 0xa2a0, 0x730e, 0x2414, 0xa38c, 0x0001,
+ 0x0040, 0x307e, 0xa294, 0xff00, 0x0078, 0x3081, 0xa294, 0x00ff,
0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x33f3, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0, 0x33f1, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1107, 0x00c0, 0x33f1, 0x7834, 0xa005, 0x00c0,
- 0x33f1, 0x1078, 0x3578, 0x7083, 0x001a, 0x1078, 0x33f5, 0x0078,
- 0x33f3, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x001b, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80, 0x20a1, 0x020b, 0x7478,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x30b3, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0, 0x30b1, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1107, 0x00c0, 0x30b1, 0x7834, 0xa005, 0x00c0,
+ 0x30b1, 0x1078, 0x3238, 0x707b, 0x001a, 0x1078, 0x30b5, 0x0078,
+ 0x30b3, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x001b, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x7470,
0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8,
- 0x53a6, 0x60c3, 0x0084, 0x1078, 0x351c, 0x007c, 0x7078, 0xa005,
- 0x0040, 0x341a, 0x2011, 0x34fc, 0x1078, 0x4520, 0x7083, 0x001c,
- 0x1078, 0x341b, 0x007c, 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f,
- 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078,
- 0x4513, 0x007c, 0x087e, 0x097e, 0x2029, 0x7652, 0x252c, 0x20a9,
- 0x0008, 0x2041, 0x7b0e, 0x28a0, 0x2099, 0x7b8e, 0x53a3, 0x20a9,
- 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3440, 0x2011, 0x0000,
- 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3452, 0xd5d4,
- 0x0040, 0x344d, 0x8210, 0x0078, 0x344e, 0x8211, 0x00f0, 0x3440,
- 0x0078, 0x34b7, 0x82ff, 0x00c0, 0x3464, 0xd5d4, 0x0040, 0x345e,
- 0xa1a6, 0x3fff, 0x0040, 0x344a, 0x0078, 0x3462, 0xa1a6, 0x3fff,
- 0x0040, 0x34b7, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
- 0xd5d4, 0x0040, 0x346d, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
- 0x3474, 0x8423, 0x0078, 0x3475, 0x8424, 0x00c8, 0x3482, 0xd5d4,
- 0x0040, 0x347d, 0x8319, 0x0078, 0x347e, 0x8318, 0x00f0, 0x346e,
- 0x0078, 0x34b7, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
- 0x3486, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x349a, 0x007e,
+ 0x53a6, 0x60c3, 0x0084, 0x1078, 0x31dc, 0x007c, 0x7070, 0xa005,
+ 0x0040, 0x30da, 0x2011, 0x31bc, 0x1078, 0x4153, 0x707b, 0x001c,
+ 0x1078, 0x30db, 0x007c, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f,
+ 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078,
+ 0x4146, 0x007c, 0x087e, 0x097e, 0x2029, 0x6f52, 0x252c, 0x20a9,
+ 0x0008, 0x2041, 0x730e, 0x28a0, 0x2099, 0x738e, 0x53a3, 0x20a9,
+ 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3100, 0x2011, 0x0000,
+ 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3112, 0xd5d4,
+ 0x0040, 0x310d, 0x8210, 0x0078, 0x310e, 0x8211, 0x00f0, 0x3100,
+ 0x0078, 0x3177, 0x82ff, 0x00c0, 0x3124, 0xd5d4, 0x0040, 0x311e,
+ 0xa1a6, 0x3fff, 0x0040, 0x310a, 0x0078, 0x3122, 0xa1a6, 0x3fff,
+ 0x0040, 0x3177, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
+ 0xd5d4, 0x0040, 0x312d, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
+ 0x3134, 0x8423, 0x0078, 0x3135, 0x8424, 0x00c8, 0x3142, 0xd5d4,
+ 0x0040, 0x313d, 0x8319, 0x0078, 0x313e, 0x8318, 0x00f0, 0x312e,
+ 0x0078, 0x3177, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
+ 0x3146, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x315a, 0x007e,
0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010,
- 0x00f0, 0x3496, 0x754e, 0xa5c8, 0x2303, 0x292c, 0xa5ac, 0x00ff,
+ 0x00f0, 0x3156, 0x754e, 0xa5c8, 0x21d3, 0x292c, 0xa5ac, 0x00ff,
0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a,
- 0x706f, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x34bd, 0xa006,
- 0x0078, 0x34bd, 0xa006, 0x1078, 0x12d5, 0x097f, 0x087f, 0x007c,
+ 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x317d, 0xa006,
+ 0x0078, 0x317d, 0xa006, 0x1078, 0x1286, 0x097f, 0x087f, 0x007c,
0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048,
- 0x34cd, 0x8420, 0x8001, 0x0078, 0x34c5, 0x2118, 0x84ff, 0x0040,
- 0x34d6, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x34d1, 0x2021, 0x0001,
- 0x83ff, 0x0040, 0x34df, 0x8423, 0x8319, 0x00c0, 0x34db, 0xa238,
- 0x2704, 0xa42c, 0x00c0, 0x34f4, 0xa405, 0x203a, 0x714e, 0xa1a0,
- 0x2303, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
- 0x706f, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7600,
- 0x7073, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
- 0x2071, 0x0140, 0x1078, 0x5534, 0x7004, 0xa084, 0x4000, 0x0040,
- 0x350d, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7620, 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010,
+ 0x318d, 0x8420, 0x8001, 0x0078, 0x3185, 0x2118, 0x84ff, 0x0040,
+ 0x3196, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3191, 0x2021, 0x0001,
+ 0x83ff, 0x0040, 0x319f, 0x8423, 0x8319, 0x00c0, 0x319b, 0xa238,
+ 0x2704, 0xa42c, 0x00c0, 0x31b4, 0xa405, 0x203a, 0x714e, 0xa1a0,
+ 0x21d3, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
+ 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6f00,
+ 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
+ 0x2071, 0x0140, 0x1078, 0x4f45, 0x7004, 0xa084, 0x4000, 0x0040,
+ 0x31cd, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6f1e, 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010,
0x127f, 0x0f7f, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011,
- 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080,
- 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b, 0x2009, 0x07d0,
- 0x2011, 0x34fc, 0x1078, 0x45b0, 0x007c, 0x017e, 0x027e, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078, 0x359e, 0x2061,
- 0x7849, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x7600, 0x6003,
+ 0x70c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x127f, 0x20e1, 0x9080,
+ 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4f3c, 0x2009, 0x07d0,
+ 0x2011, 0x31bc, 0x1078, 0x41e3, 0x007c, 0x017e, 0x027e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078, 0x325e, 0x2061,
+ 0x70c9, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x6f00, 0x6003,
0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
- 0x001e, 0x2011, 0x355a, 0x1078, 0x4513, 0x127f, 0x0c7f, 0x027f,
+ 0x001e, 0x2011, 0x321a, 0x1078, 0x4146, 0x127f, 0x0c7f, 0x027f,
0x017f, 0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x0100, 0x1078, 0x5534, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000,
- 0x0040, 0x356e, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001,
- 0x1078, 0x1fff, 0x1078, 0x3535, 0x127f, 0x007f, 0x0e7f, 0x007c,
- 0x20a9, 0x0040, 0x20a1, 0x7cc0, 0x2099, 0x7b8e, 0x3304, 0x8007,
- 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x357e, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x000c,
- 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
+ 0x0100, 0x1078, 0x4f45, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000,
+ 0x0040, 0x322e, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001,
+ 0x1078, 0x1f5e, 0x1078, 0x31f5, 0x127f, 0x007f, 0x0e7f, 0x007c,
+ 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2099, 0x738e, 0x3304, 0x8007,
+ 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x323e, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x2099, 0x7300, 0x20a1, 0x020b, 0x20a9, 0x000c,
+ 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e,
- 0x2061, 0x0100, 0x810f, 0x2001, 0x762c, 0x2004, 0xa005, 0x00c0,
- 0x35af, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x35b1, 0xa185,
+ 0x2061, 0x0100, 0x810f, 0x2001, 0x6f2a, 0x2004, 0xa005, 0x00c0,
+ 0x326f, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x3271, 0xa185,
0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001,
- 0x7652, 0x2004, 0xd0a4, 0x0040, 0x35c8, 0xa006, 0x2020, 0x2009,
- 0x002a, 0x1078, 0x74ec, 0x2001, 0x760c, 0x200c, 0xc195, 0x2102,
- 0x2019, 0x002a, 0x1078, 0x226d, 0x047f, 0x017f, 0x007c, 0x157e,
- 0x20a9, 0x00ff, 0x2009, 0x7720, 0xa006, 0x200a, 0x8108, 0x00f0,
- 0x35d5, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e,
- 0x2069, 0x7651, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e,
- 0x6012, 0xa198, 0x2303, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9,
+ 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3288, 0xa006, 0x2020, 0x2009,
+ 0x002a, 0x1078, 0x6d90, 0x2001, 0x6f0c, 0x200c, 0xc195, 0x2102,
+ 0x2019, 0x002a, 0x1078, 0x2152, 0x047f, 0x017f, 0x007c, 0x157e,
+ 0x20a9, 0x007d, 0x2009, 0x7020, 0xa006, 0x200a, 0x8108, 0x00f0,
+ 0x3295, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e,
+ 0x2069, 0x6f51, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e,
+ 0x6012, 0xa198, 0x21d3, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9,
0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98,
0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056,
0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076,
@@ -9366,5354 +10330,1904 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
0x609a, 0x609e, 0x61a2, 0x604a, 0x6810, 0x603a, 0x680c, 0x6046,
0x6814, 0xa084, 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f, 0x037f,
0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff,
- 0xa682, 0x0010, 0x00c8, 0x36c7, 0xa18c, 0xff00, 0x810f, 0xa182,
- 0x00ff, 0x00c8, 0x36cd, 0x2001, 0x760c, 0x2004, 0xa084, 0x0003,
- 0x00c0, 0x36b0, 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x36a6,
- 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x36ac, 0x6078,
- 0xa00d, 0x0040, 0x3651, 0xa680, 0x7580, 0x2004, 0xa10c, 0x00c0,
- 0x36a0, 0x607c, 0xa00d, 0x0040, 0x366d, 0xa680, 0x7580, 0x2004,
- 0xa10c, 0x0040, 0x366d, 0x694c, 0xd1fc, 0x00c0, 0x3663, 0x1078,
- 0x3760, 0x0078, 0x369b, 0x1078, 0x3731, 0x694c, 0xd1ec, 0x00c0,
- 0x369b, 0x1078, 0x3879, 0x0078, 0x369b, 0x694c, 0xa184, 0xa000,
- 0x0040, 0x368b, 0xd1ec, 0x0040, 0x3684, 0xd1fc, 0x0040, 0x367c,
- 0x1078, 0x3890, 0x0078, 0x3687, 0xa680, 0x7580, 0x200c, 0x607c,
- 0xa105, 0x607e, 0x0078, 0x368b, 0xd1fc, 0x0040, 0x368b, 0x1078,
- 0x3731, 0x0078, 0x369b, 0x6050, 0xa00d, 0x0040, 0x3696, 0x2d00,
- 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x369b, 0x2d00, 0x6052,
- 0x604e, 0x6803, 0x0000, 0x1078, 0x47f6, 0xa006, 0x127f, 0x007c,
- 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001, 0x0028,
- 0x2009, 0x0000, 0x0078, 0x36d1, 0xa082, 0x0006, 0x0048, 0x3647,
- 0x2009, 0x760c, 0x210c, 0xd18c, 0x0040, 0x36ba, 0x2001, 0x0004,
- 0x0078, 0x36c3, 0xd184, 0x0040, 0x36c1, 0x2001, 0x0004, 0x0078,
- 0x36c3, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001, 0x0029, 0x2009,
+ 0xa682, 0x0010, 0x00c8, 0x3387, 0xa18c, 0xff00, 0x810f, 0xa182,
+ 0x007e, 0x00c8, 0x338d, 0x2001, 0x6f0c, 0x2004, 0xa084, 0x0003,
+ 0x00c0, 0x3370, 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x3366,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x336c, 0x6078,
+ 0xa00d, 0x0040, 0x3311, 0xa680, 0x6e24, 0x2004, 0xa10c, 0x00c0,
+ 0x3360, 0x607c, 0xa00d, 0x0040, 0x332d, 0xa680, 0x6e24, 0x2004,
+ 0xa10c, 0x0040, 0x332d, 0x694c, 0xd1fc, 0x00c0, 0x3323, 0x1078,
+ 0x3420, 0x0078, 0x335b, 0x1078, 0x33f1, 0x694c, 0xd1ec, 0x00c0,
+ 0x335b, 0x1078, 0x3539, 0x0078, 0x335b, 0x694c, 0xa184, 0xa000,
+ 0x0040, 0x334b, 0xd1ec, 0x0040, 0x3344, 0xd1fc, 0x0040, 0x333c,
+ 0x1078, 0x3550, 0x0078, 0x3347, 0xa680, 0x6e24, 0x200c, 0x607c,
+ 0xa105, 0x607e, 0x0078, 0x334b, 0xd1fc, 0x0040, 0x334b, 0x1078,
+ 0x33f1, 0x0078, 0x335b, 0x6050, 0xa00d, 0x0040, 0x3356, 0x2d00,
+ 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x335b, 0x2d00, 0x6052,
+ 0x604e, 0x6803, 0x0000, 0x1078, 0x4417, 0xa006, 0x127f, 0x007c,
+ 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x3391, 0xa082, 0x0006, 0x0048, 0x3307,
+ 0x2009, 0x6f0c, 0x210c, 0xd18c, 0x0040, 0x337a, 0x2001, 0x0004,
+ 0x0078, 0x3383, 0xd184, 0x0040, 0x3381, 0x2001, 0x0004, 0x0078,
+ 0x3383, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001,
+ 0x0029, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001, 0x0029, 0x2009,
0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682,
- 0x0010, 0x00c8, 0x3716, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
- 0x00c8, 0x3706, 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x3706,
- 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x370c, 0x684c,
- 0xd0ec, 0x0040, 0x36f9, 0x1078, 0x3890, 0x1078, 0x3731, 0x0078,
- 0x3701, 0x1078, 0x3731, 0x684c, 0xd0fc, 0x0040, 0x3701, 0x1078,
- 0x3879, 0x1078, 0x38a4, 0xa006, 0x0078, 0x371a, 0x2001, 0x0028,
- 0x2009, 0x0000, 0x0078, 0x371a, 0xa082, 0x0006, 0x0048, 0x36ef,
- 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x371a, 0x2001, 0x0029,
+ 0x0010, 0x00c8, 0x33d6, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e,
+ 0x00c8, 0x33c6, 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x33c6,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x33cc, 0x684c,
+ 0xd0ec, 0x0040, 0x33b9, 0x1078, 0x3550, 0x1078, 0x33f1, 0x0078,
+ 0x33c1, 0x1078, 0x33f1, 0x684c, 0xd0fc, 0x0040, 0x33c1, 0x1078,
+ 0x3539, 0x1078, 0x3564, 0xa006, 0x0078, 0x33da, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x33da, 0xa082, 0x0006, 0x0048, 0x33af,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x33da, 0x2001, 0x0029,
0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050,
- 0xa00d, 0x0040, 0x372a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+ 0xa00d, 0x0040, 0x33ea, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078,
- 0x3728, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x373d,
+ 0x33e8, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x33fd,
0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
- 0x6803, 0x0000, 0x0078, 0x373b, 0x127e, 0x2091, 0x8000, 0x604c,
- 0xa06d, 0x0040, 0x3752, 0x6800, 0xa005, 0x00c0, 0x3750, 0x6052,
- 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x375f,
- 0x6800, 0xa005, 0x00c0, 0x375d, 0x6052, 0x604e, 0xad05, 0x007c,
- 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x376a, 0x2d00, 0x200a,
- 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3769, 0x127e,
+ 0x6803, 0x0000, 0x0078, 0x33fb, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa06d, 0x0040, 0x3412, 0x6800, 0xa005, 0x00c0, 0x3410, 0x6052,
+ 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x341f,
+ 0x6800, 0xa005, 0x00c0, 0x341d, 0x6052, 0x604e, 0xad05, 0x007c,
+ 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x342a, 0x2d00, 0x200a,
+ 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3429, 0x127e,
0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005,
- 0x0040, 0x377d, 0xc285, 0x0078, 0x377e, 0xc284, 0x6202, 0x027f,
+ 0x0040, 0x343d, 0xc285, 0x0078, 0x343e, 0xc284, 0x6202, 0x027f,
0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218,
0x2260, 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f,
0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204,
0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
- 0x027e, 0xa182, 0x00ff, 0x0048, 0x37a9, 0xa085, 0x0001, 0x0078,
- 0x37bd, 0xa190, 0x7720, 0x2204, 0xa065, 0x00c0, 0x37bc, 0x017e,
- 0x0d7e, 0x1078, 0x1314, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x37a5,
- 0x2c00, 0x2012, 0x1078, 0x35db, 0xa006, 0x027f, 0x007c, 0x027e,
- 0xa182, 0x00ff, 0x0048, 0x37c8, 0xa085, 0x0001, 0x0078, 0x37d5,
- 0x0d7e, 0xa190, 0x7720, 0x2204, 0xa06d, 0x0040, 0x37d3, 0x2013,
- 0x0000, 0x1078, 0x1348, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
- 0xa182, 0x00ff, 0x0048, 0x37e0, 0xa085, 0x0001, 0x0078, 0x37e7,
- 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x37dc, 0xa006, 0x017f,
+ 0x027e, 0xa182, 0x007e, 0x0048, 0x3469, 0xa085, 0x0001, 0x0078,
+ 0x347d, 0xa190, 0x7020, 0x2204, 0xa065, 0x00c0, 0x347c, 0x017e,
+ 0x0d7e, 0x1078, 0x12c5, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x3465,
+ 0x2c00, 0x2012, 0x1078, 0x329b, 0xa006, 0x027f, 0x007c, 0x027e,
+ 0xa182, 0x007e, 0x0048, 0x3488, 0xa085, 0x0001, 0x0078, 0x3495,
+ 0x0d7e, 0xa190, 0x7020, 0x2204, 0xa06d, 0x0040, 0x3493, 0x2013,
+ 0x0000, 0x1078, 0x12f9, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
+ 0xa182, 0x007e, 0x0048, 0x34a0, 0xa085, 0x0001, 0x0078, 0x34a7,
+ 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x349c, 0xa006, 0x017f,
0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f,
- 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x7b8e, 0x6808, 0x605e,
- 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x37ff, 0x603a, 0x6814,
- 0x6066, 0x2099, 0x7b96, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
- 0x53a3, 0x2099, 0x7b9a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
- 0x53a3, 0x2069, 0x7bae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810,
- 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x3823, 0x2009,
- 0x0008, 0x0078, 0x384d, 0xa182, 0x0259, 0x00c8, 0x382b, 0x2009,
- 0x0007, 0x0078, 0x384d, 0xa182, 0x02c1, 0x00c8, 0x3833, 0x2009,
- 0x0006, 0x0078, 0x384d, 0xa182, 0x0349, 0x00c8, 0x383b, 0x2009,
- 0x0005, 0x0078, 0x384d, 0xa182, 0x0421, 0x00c8, 0x3843, 0x2009,
- 0x0004, 0x0078, 0x384d, 0xa182, 0x0581, 0x00c8, 0x384b, 0x2009,
- 0x0003, 0x0078, 0x384d, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x7b8d, 0x2e04, 0x6896,
- 0x2071, 0x7b8e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c,
- 0x2001, 0x7580, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178,
- 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x7580, 0xa600, 0x2004,
+ 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x738e, 0x6808, 0x605e,
+ 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x34bf, 0x603a, 0x6814,
+ 0x6066, 0x2099, 0x7396, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2099, 0x739a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2069, 0x73ae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810,
+ 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x34e3, 0x2009,
+ 0x0008, 0x0078, 0x350d, 0xa182, 0x0259, 0x00c8, 0x34eb, 0x2009,
+ 0x0007, 0x0078, 0x350d, 0xa182, 0x02c1, 0x00c8, 0x34f3, 0x2009,
+ 0x0006, 0x0078, 0x350d, 0xa182, 0x0349, 0x00c8, 0x34fb, 0x2009,
+ 0x0005, 0x0078, 0x350d, 0xa182, 0x0421, 0x00c8, 0x3503, 0x2009,
+ 0x0004, 0x0078, 0x350d, 0xa182, 0x0581, 0x00c8, 0x350b, 0x2009,
+ 0x0003, 0x0078, 0x350d, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f,
+ 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x738d, 0x2e04, 0x6896,
+ 0x2071, 0x738e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c,
+ 0x2001, 0x6e24, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178,
+ 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004,
0x8002, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f,
- 0x007c, 0x2001, 0x7580, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091,
- 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3889, 0x1078,
- 0x371c, 0x1078, 0x38ea, 0x00c0, 0x3887, 0x1078, 0x38a4, 0x007c,
- 0x2001, 0x7580, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c,
- 0xa10d, 0x617e, 0x127f, 0x0078, 0x389f, 0x1078, 0x3760, 0x1078,
- 0x38ae, 0x00c0, 0x389d, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x47f6, 0x127f, 0x007c, 0xa01e, 0x0078, 0x38b0, 0x2019, 0x0001,
+ 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091,
+ 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3549, 0x1078,
+ 0x33dc, 0x1078, 0x35aa, 0x00c0, 0x3547, 0x1078, 0x3564, 0x007c,
+ 0x2001, 0x6e24, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c,
+ 0xa10d, 0x617e, 0x127f, 0x0078, 0x355f, 0x1078, 0x3420, 0x1078,
+ 0x356e, 0x00c0, 0x355d, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4417, 0x127f, 0x007c, 0xa01e, 0x0078, 0x3570, 0x2019, 0x0001,
0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc,
- 0x00c0, 0x38d0, 0x8dff, 0x0040, 0x38e5, 0x83ff, 0x0040, 0x38c8,
- 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x38d5, 0x0078, 0x38d0,
- 0x683c, 0xa406, 0x00c0, 0x38d0, 0x6840, 0xa506, 0x0040, 0x38d5,
- 0x2d08, 0x6800, 0x2068, 0x0078, 0x38ba, 0x6a00, 0x604c, 0xad06,
- 0x00c0, 0x38dd, 0x624e, 0x0078, 0x38e0, 0xa180, 0x0000, 0x2202,
- 0x82ff, 0x00c0, 0x38e5, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x38ec, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff,
- 0x0040, 0x391a, 0x83ff, 0x0040, 0x38fd, 0x6844, 0xa084, 0x00ff,
- 0xa606, 0x0040, 0x390a, 0x0078, 0x3905, 0x683c, 0xa406, 0x00c0,
- 0x3905, 0x6840, 0xa506, 0x0040, 0x390a, 0x2d08, 0x6800, 0x2068,
- 0x0078, 0x38ef, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3912, 0x6282,
- 0x0078, 0x3915, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x391a,
- 0x6186, 0x8dff, 0x007c, 0x2001, 0x7580, 0xa600, 0x2004, 0x6178,
- 0xa10c, 0x0040, 0x3925, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040,
- 0x392b, 0xa295, 0x0002, 0x007c, 0x1078, 0x3977, 0x0040, 0x3934,
- 0x1078, 0x69c1, 0x0078, 0x3936, 0xa085, 0x0001, 0x007c, 0x1078,
- 0x3977, 0x0040, 0x393f, 0x1078, 0x6950, 0x0078, 0x3941, 0xa085,
- 0x0001, 0x007c, 0x1078, 0x3977, 0x0040, 0x394a, 0x1078, 0x6996,
- 0x0078, 0x394c, 0xa085, 0x0001, 0x007c, 0x1078, 0x3977, 0x0040,
- 0x3955, 0x1078, 0x696c, 0x0078, 0x3957, 0xa085, 0x0001, 0x007c,
+ 0x00c0, 0x3590, 0x8dff, 0x0040, 0x35a5, 0x83ff, 0x0040, 0x3588,
+ 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x3595, 0x0078, 0x3590,
+ 0x683c, 0xa406, 0x00c0, 0x3590, 0x6840, 0xa506, 0x0040, 0x3595,
+ 0x2d08, 0x6800, 0x2068, 0x0078, 0x357a, 0x6a00, 0x604c, 0xad06,
+ 0x00c0, 0x359d, 0x624e, 0x0078, 0x35a0, 0xa180, 0x0000, 0x2202,
+ 0x82ff, 0x00c0, 0x35a5, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e,
+ 0x0078, 0x35ac, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff,
+ 0x0040, 0x35da, 0x83ff, 0x0040, 0x35bd, 0x6844, 0xa084, 0x00ff,
+ 0xa606, 0x0040, 0x35ca, 0x0078, 0x35c5, 0x683c, 0xa406, 0x00c0,
+ 0x35c5, 0x6840, 0xa506, 0x0040, 0x35ca, 0x2d08, 0x6800, 0x2068,
+ 0x0078, 0x35af, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x35d2, 0x6282,
+ 0x0078, 0x35d5, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x35da,
+ 0x6186, 0x8dff, 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004, 0x6178,
+ 0xa10c, 0x0040, 0x35e5, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040,
+ 0x35eb, 0xa295, 0x0002, 0x007c, 0x1078, 0x3637, 0x0040, 0x35f4,
+ 0x1078, 0x628e, 0x0078, 0x35f6, 0xa085, 0x0001, 0x007c, 0x1078,
+ 0x3637, 0x0040, 0x35ff, 0x1078, 0x621d, 0x0078, 0x3601, 0xa085,
+ 0x0001, 0x007c, 0x1078, 0x3637, 0x0040, 0x360a, 0x1078, 0x6263,
+ 0x0078, 0x360c, 0xa085, 0x0001, 0x007c, 0x1078, 0x3637, 0x0040,
+ 0x3615, 0x1078, 0x6239, 0x0078, 0x3617, 0xa085, 0x0001, 0x007c,
0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040,
- 0x396f, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x007f, 0x0078, 0x395e, 0x6083,
+ 0x362f, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x1078, 0x639b, 0x1078, 0x36ec, 0x007f, 0x0078, 0x361e, 0x6083,
0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c,
- 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x7651, 0x7804, 0xd0a4, 0x0040,
- 0x39a3, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x37d7, 0x00c0, 0x3997, 0x6004, 0xa084, 0xff00, 0x8007,
- 0xa086, 0x0006, 0x00c0, 0x3997, 0x6000, 0xc0ed, 0x6002, 0x017f,
- 0x8108, 0x00f0, 0x3987, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
- 0x39a5, 0x1078, 0x45b0, 0x0f7f, 0x007c, 0x2011, 0x39a5, 0x1078,
- 0x4520, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x37d7, 0x00c0, 0x39d1, 0x6000, 0xd0ec, 0x0040, 0x39d1,
+ 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x6f51, 0x7804, 0xd0a4, 0x0040,
+ 0x3663, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x3497, 0x00c0, 0x3657, 0x6004, 0xa084, 0xff00, 0x8007,
+ 0xa086, 0x0006, 0x00c0, 0x3657, 0x6000, 0xc0ed, 0x6002, 0x017f,
+ 0x8108, 0x00f0, 0x3647, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
+ 0x3665, 0x1078, 0x41e3, 0x0f7f, 0x007c, 0x2011, 0x3665, 0x1078,
+ 0x4153, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x3497, 0x00c0, 0x3691, 0x6000, 0xd0ec, 0x0040, 0x3691,
0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
- 0x1078, 0x74ec, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2009, 0x0000, 0x1078, 0x7326,
- 0x047f, 0x017f, 0x8108, 0x00f0, 0x39af, 0x0c7f, 0x157f, 0x007c,
+ 0x1078, 0x6d90, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
+ 0x1078, 0x4535, 0x1078, 0x4478, 0x2009, 0x0000, 0x1078, 0x6bca,
+ 0x047f, 0x017f, 0x8108, 0x00f0, 0x366f, 0x0c7f, 0x157f, 0x007c,
0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
- 0x2071, 0x76ff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
+ 0x2071, 0x6fff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x76ff, 0x684c, 0xa005, 0x00c0, 0x3a07,
- 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x3a2a, 0x6a60,
+ 0x007c, 0x0e7e, 0x2071, 0x6fff, 0x684c, 0xa005, 0x00c0, 0x36c7,
+ 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x36ea, 0x6a60,
0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
- 0x3a7d, 0x6804, 0xa00d, 0x0040, 0x3a4b, 0x0d7e, 0x0e7e, 0x2071,
- 0x7600, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
- 0x2d00, 0x81ff, 0x00c0, 0x3a3c, 0x702e, 0x70a0, 0xa200, 0x70a2,
- 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x76ff, 0x701c, 0xa005, 0x00c0,
- 0x3a8e, 0x0068, 0x3a8c, 0x2071, 0x7651, 0x7004, 0xd09c, 0x0040,
- 0x3a8c, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3a9f, 0x6948, 0x6844,
- 0xa105, 0x00c0, 0x3a7f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
- 0xd084, 0x00c0, 0x3a8c, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
- 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x7600, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844,
- 0xa086, 0x0100, 0x00c0, 0x3a8c, 0x6868, 0xa005, 0x00c0, 0x3a8c,
- 0x2009, 0x8020, 0x0078, 0x3a65, 0x2071, 0x76ff, 0x2d08, 0x206b,
+ 0x373d, 0x6804, 0xa00d, 0x0040, 0x370b, 0x0d7e, 0x0e7e, 0x2071,
+ 0x6f00, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
+ 0x2d00, 0x81ff, 0x00c0, 0x36fc, 0x702e, 0x7098, 0xa200, 0x709a,
+ 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x6fff, 0x701c, 0xa005, 0x00c0,
+ 0x374e, 0x0068, 0x374c, 0x2071, 0x6f51, 0x7004, 0xd09c, 0x0040,
+ 0x374c, 0x6934, 0xa186, 0x0103, 0x00c0, 0x375f, 0x6948, 0x6844,
+ 0xa105, 0x00c0, 0x373f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
+ 0xd084, 0x00c0, 0x374c, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
+ 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x6f00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x0e7f, 0x007c, 0x6844,
+ 0xa086, 0x0100, 0x00c0, 0x374c, 0x6868, 0xa005, 0x00c0, 0x374c,
+ 0x2009, 0x8020, 0x0078, 0x3725, 0x2071, 0x6fff, 0x2d08, 0x206b,
0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
- 0x3a9c, 0x6902, 0x0078, 0x3a9d, 0x711e, 0x0078, 0x3a7d, 0xa18c,
- 0x00ff, 0xa186, 0x0017, 0x0040, 0x3aad, 0xa186, 0x001e, 0x0040,
- 0x3aad, 0xa18e, 0x001f, 0x00c0, 0x3a8c, 0x684c, 0xd0cc, 0x0040,
- 0x3a8c, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3a8c,
- 0x2009, 0x8021, 0x0078, 0x3a65, 0x007e, 0x6837, 0x0103, 0x20a9,
+ 0x375c, 0x6902, 0x0078, 0x375d, 0x711e, 0x0078, 0x373d, 0xa18c,
+ 0x00ff, 0xa186, 0x0017, 0x0040, 0x376d, 0xa186, 0x001e, 0x0040,
+ 0x376d, 0xa18e, 0x001f, 0x00c0, 0x374c, 0x684c, 0xd0cc, 0x0040,
+ 0x374c, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x374c,
+ 0x2009, 0x8021, 0x0078, 0x3725, 0x007e, 0x6837, 0x0103, 0x20a9,
0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
- 0x684a, 0x6952, 0x007c, 0x2071, 0x76ff, 0x7004, 0x0079, 0x3ad0,
- 0x3ad8, 0x3ae7, 0x3b77, 0x3b78, 0x3b88, 0x3b8e, 0x3ad9, 0x3b65,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3ae6, 0x2009, 0x000d,
+ 0x684a, 0x6952, 0x007c, 0x2071, 0x6fff, 0x7004, 0x0079, 0x3790,
+ 0x3798, 0x37a7, 0x3837, 0x3838, 0x3848, 0x384e, 0x3799, 0x3825,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x37a6, 0x2009, 0x000d,
0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
- 0xa06d, 0x0040, 0x3b64, 0x0e7e, 0x2071, 0x7651, 0x7004, 0xd09c,
- 0x0040, 0x3b46, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3b1c, 0x6948,
- 0x6844, 0xa105, 0x00c0, 0x3b39, 0x2009, 0x8020, 0x127e, 0x2091,
- 0x8000, 0x0068, 0x3b18, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
- 0x3b18, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3bc1, 0x0078, 0x3b64,
- 0x127f, 0x0e7f, 0x0078, 0x3b64, 0xa18c, 0x00ff, 0xa186, 0x0017,
- 0x0040, 0x3b2a, 0xa186, 0x001e, 0x0040, 0x3b2a, 0xa18e, 0x001f,
- 0x00c0, 0x3b46, 0x684c, 0xd0cc, 0x0040, 0x3b46, 0x6850, 0xa084,
- 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3b46, 0x2009, 0x8021, 0x0078,
- 0x3afe, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3b46, 0x6868, 0xa005,
- 0x00c0, 0x3b46, 0x2009, 0x8020, 0x0078, 0x3afe, 0x0e7f, 0x1078,
- 0x3bd5, 0x0040, 0x3b64, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
- 0xa086, 0x0003, 0x00c0, 0x3b5b, 0x810f, 0xa18c, 0x00ff, 0x8101,
- 0x0040, 0x3b5b, 0x710e, 0x7007, 0x0003, 0x1078, 0x3bf5, 0x7050,
- 0xa086, 0x0100, 0x0040, 0x3b78, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x3b76, 0x1078, 0x3bd5, 0x0040, 0x3b76, 0x7007, 0x0003, 0x1078,
- 0x3bf5, 0x7050, 0xa086, 0x0100, 0x0040, 0x3b78, 0x007c, 0x007c,
- 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3b81, 0x7007, 0x0004, 0x0078,
- 0x3b88, 0xa086, 0x0200, 0x00c0, 0x3b87, 0x7007, 0x0005, 0x007c,
- 0x1078, 0x3b8f, 0x7006, 0x1078, 0x3bc1, 0x007c, 0x007c, 0x702c,
- 0x7130, 0x8108, 0xa102, 0x0048, 0x3b9c, 0xa00e, 0x7034, 0x706e,
- 0x7038, 0x7072, 0x0078, 0x3ba6, 0x706c, 0xa080, 0x0040, 0x706e,
- 0x00c8, 0x3ba6, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x3bba, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x3bbd, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
+ 0xa06d, 0x0040, 0x3824, 0x0e7e, 0x2071, 0x6f51, 0x7004, 0xd09c,
+ 0x0040, 0x3806, 0x6934, 0xa186, 0x0103, 0x00c0, 0x37dc, 0x6948,
+ 0x6844, 0xa105, 0x00c0, 0x37f9, 0x2009, 0x8020, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x37d8, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
+ 0x37d8, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
+ 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3881, 0x0078, 0x3824,
+ 0x127f, 0x0e7f, 0x0078, 0x3824, 0xa18c, 0x00ff, 0xa186, 0x0017,
+ 0x0040, 0x37ea, 0xa186, 0x001e, 0x0040, 0x37ea, 0xa18e, 0x001f,
+ 0x00c0, 0x3806, 0x684c, 0xd0cc, 0x0040, 0x3806, 0x6850, 0xa084,
+ 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3806, 0x2009, 0x8021, 0x0078,
+ 0x37be, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3806, 0x6868, 0xa005,
+ 0x00c0, 0x3806, 0x2009, 0x8020, 0x0078, 0x37be, 0x0e7f, 0x1078,
+ 0x3895, 0x0040, 0x3824, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
+ 0xa086, 0x0003, 0x00c0, 0x381b, 0x810f, 0xa18c, 0x00ff, 0x8101,
+ 0x0040, 0x381b, 0x710e, 0x7007, 0x0003, 0x1078, 0x38b5, 0x7050,
+ 0xa086, 0x0100, 0x0040, 0x3838, 0x007c, 0x701c, 0xa06d, 0x0040,
+ 0x3836, 0x1078, 0x3895, 0x0040, 0x3836, 0x7007, 0x0003, 0x1078,
+ 0x38b5, 0x7050, 0xa086, 0x0100, 0x0040, 0x3838, 0x007c, 0x007c,
+ 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3841, 0x7007, 0x0004, 0x0078,
+ 0x3848, 0xa086, 0x0200, 0x00c0, 0x3847, 0x7007, 0x0005, 0x007c,
+ 0x1078, 0x384f, 0x7006, 0x1078, 0x3881, 0x007c, 0x007c, 0x702c,
+ 0x7130, 0x8108, 0xa102, 0x0048, 0x385c, 0xa00e, 0x7034, 0x706e,
+ 0x7038, 0x7072, 0x0078, 0x3866, 0x706c, 0xa080, 0x0040, 0x706e,
+ 0x00c8, 0x3866, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x387a, 0x127e, 0x2091, 0x8000, 0x0068,
+ 0x387d, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x3bd4, 0x127e, 0x2091, 0x8000,
- 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3bd1,
- 0x701a, 0x127f, 0x1078, 0x1348, 0x007c, 0x2019, 0x000d, 0x2304,
- 0x230c, 0xa10e, 0x0040, 0x3be4, 0x2304, 0x230c, 0xa10e, 0x0040,
- 0x3be4, 0xa006, 0x0078, 0x3bf4, 0x732c, 0x8319, 0x7130, 0xa102,
- 0x00c0, 0x3bee, 0x2300, 0xa005, 0x0078, 0x3bf4, 0x0048, 0x3bf3,
- 0xa302, 0x0078, 0x3bf4, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
+ 0x007c, 0x701c, 0xa06d, 0x0040, 0x3894, 0x127e, 0x2091, 0x8000,
+ 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3891,
+ 0x701a, 0x127f, 0x1078, 0x12f9, 0x007c, 0x2019, 0x000d, 0x2304,
+ 0x230c, 0xa10e, 0x0040, 0x38a4, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x38a4, 0xa006, 0x0078, 0x38b4, 0x732c, 0x8319, 0x7130, 0xa102,
+ 0x00c0, 0x38ae, 0x2300, 0xa005, 0x0078, 0x38b4, 0x0048, 0x38b3,
+ 0xa302, 0x0078, 0x38b4, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x7859, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x2071, 0x76cd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
+ 0x70d9, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x134a, 0x007c,
+ 0x2071, 0x6fcd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
- 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x76cd, 0x6848, 0xa005,
- 0x00c0, 0x3c31, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
- 0x3c56, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
+ 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6fcd, 0x6848, 0xa005,
+ 0x00c0, 0x38f1, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
+ 0x3916, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
- 0x2b78, 0x2071, 0x76cd, 0x7004, 0x1079, 0x3cb6, 0x700c, 0x0079,
- 0x3c61, 0x3c66, 0x3c5b, 0x3c5b, 0x3c5b, 0x3c5b, 0x007c, 0x700c,
- 0x0079, 0x3c6a, 0x3c6f, 0x3cb4, 0x3cb4, 0x3cb5, 0x3cb5, 0x7830,
- 0x7930, 0xa106, 0x0040, 0x3c79, 0x7830, 0x7930, 0xa106, 0x00c0,
- 0x3c9f, 0x7030, 0xa10a, 0x0040, 0x3c9f, 0x00c8, 0x3c81, 0x712c,
- 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3ca0, 0x1078, 0x1314, 0x0040,
- 0x3c9f, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
- 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x7859, 0x2104,
- 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x1078, 0x1314, 0x0040, 0x3c9f, 0x2d00, 0x705a, 0x1078, 0x1314,
- 0x00c0, 0x3cac, 0x0078, 0x3c8b, 0x2d00, 0x7086, 0x7063, 0x0080,
- 0x2001, 0x0004, 0x0078, 0x3c8f, 0x007c, 0x007c, 0x3cc7, 0x3cc8,
- 0x3cff, 0x3d00, 0x3cb4, 0x3d36, 0x3d3b, 0x3d72, 0x3d73, 0x3d8e,
- 0x3d8f, 0x3d90, 0x3d91, 0x3d92, 0x3d93, 0x3dfc, 0x3e26, 0x007c,
- 0x700c, 0x0079, 0x3ccb, 0x3cd0, 0x3cd3, 0x3ce3, 0x3cfe, 0x3cfe,
- 0x1078, 0x3c67, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
- 0x1078, 0x4105, 0x0040, 0x3ce0, 0x2091, 0x8000, 0x1078, 0x3c67,
- 0x0d7f, 0x0078, 0x3cec, 0x127e, 0x8001, 0x700e, 0x1078, 0x4105,
+ 0x2b78, 0x2071, 0x6fcd, 0x7004, 0x1079, 0x3976, 0x700c, 0x0079,
+ 0x3921, 0x3926, 0x391b, 0x391b, 0x391b, 0x391b, 0x007c, 0x700c,
+ 0x0079, 0x392a, 0x392f, 0x3974, 0x3974, 0x3975, 0x3975, 0x7830,
+ 0x7930, 0xa106, 0x0040, 0x3939, 0x7830, 0x7930, 0xa106, 0x00c0,
+ 0x395f, 0x7030, 0xa10a, 0x0040, 0x395f, 0x00c8, 0x3941, 0x712c,
+ 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3960, 0x1078, 0x12c5, 0x0040,
+ 0x395f, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
+ 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x70d9, 0x2104,
+ 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x134a, 0x007c,
+ 0x1078, 0x12c5, 0x0040, 0x395f, 0x2d00, 0x705a, 0x1078, 0x12c5,
+ 0x00c0, 0x396c, 0x0078, 0x394b, 0x2d00, 0x7086, 0x7063, 0x0080,
+ 0x2001, 0x0004, 0x0078, 0x394f, 0x007c, 0x007c, 0x3987, 0x3988,
+ 0x39bf, 0x39c0, 0x3974, 0x39f6, 0x39fb, 0x3a32, 0x3a33, 0x3a4e,
+ 0x3a4f, 0x3a50, 0x3a51, 0x3a52, 0x3a53, 0x3abc, 0x3ae6, 0x007c,
+ 0x700c, 0x0079, 0x398b, 0x3990, 0x3993, 0x39a3, 0x39be, 0x39be,
+ 0x1078, 0x3927, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3dc5, 0x0040, 0x39a0, 0x2091, 0x8000, 0x1078, 0x3927,
+ 0x0d7f, 0x0078, 0x39ac, 0x127e, 0x8001, 0x700e, 0x1078, 0x3dc5,
0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
- 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3cfb, 0x1079,
- 0x3d16, 0x127f, 0x007c, 0x127f, 0x1078, 0x3d94, 0x007c, 0x007c,
- 0x007c, 0x0e7e, 0x2071, 0x76cd, 0x700c, 0x0079, 0x3d07, 0x3d0c,
- 0x3d0c, 0x3d0c, 0x3d0e, 0x3d12, 0x0e7f, 0x007c, 0x700f, 0x0001,
- 0x0078, 0x3d14, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3d94, 0x3d94,
- 0x3db0, 0x3d94, 0x3e9b, 0x3d94, 0x3d94, 0x3d94, 0x3d94, 0x3d94,
- 0x3db0, 0x3ee0, 0x3f29, 0x3f81, 0x3f94, 0x3d94, 0x3d94, 0x3dcc,
- 0x3db0, 0x3d94, 0x3d94, 0x3de2, 0x401b, 0x4038, 0x3d94, 0x3dcc,
- 0x3d94, 0x3d94, 0x3d94, 0x3d94, 0x3de2, 0x4038, 0x7020, 0x2068,
- 0x1078, 0x1348, 0x007c, 0x700c, 0x0079, 0x3d3e, 0x3d43, 0x3d46,
- 0x3d56, 0x3d71, 0x3d71, 0x1078, 0x3c67, 0x007c, 0x127e, 0x8001,
- 0x700e, 0x7058, 0x007e, 0x1078, 0x4105, 0x0040, 0x3d53, 0x2091,
- 0x8000, 0x1078, 0x3c67, 0x0d7f, 0x0078, 0x3d5f, 0x127e, 0x8001,
- 0x700e, 0x1078, 0x4105, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x39bb, 0x1079,
+ 0x39d6, 0x127f, 0x007c, 0x127f, 0x1078, 0x3a54, 0x007c, 0x007c,
+ 0x007c, 0x0e7e, 0x2071, 0x6fcd, 0x700c, 0x0079, 0x39c7, 0x39cc,
+ 0x39cc, 0x39cc, 0x39ce, 0x39d2, 0x0e7f, 0x007c, 0x700f, 0x0001,
+ 0x0078, 0x39d4, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3a54, 0x3a54,
+ 0x3a70, 0x3a54, 0x3b5b, 0x3a54, 0x3a54, 0x3a54, 0x3a54, 0x3a54,
+ 0x3a70, 0x3ba0, 0x3be9, 0x3c41, 0x3c54, 0x3a54, 0x3a54, 0x3a8c,
+ 0x3a70, 0x3a54, 0x3a54, 0x3aa2, 0x3cdb, 0x3cf8, 0x3a54, 0x3a8c,
+ 0x3a54, 0x3a54, 0x3a54, 0x3a54, 0x3aa2, 0x3cf8, 0x7020, 0x2068,
+ 0x1078, 0x12f9, 0x007c, 0x700c, 0x0079, 0x39fe, 0x3a03, 0x3a06,
+ 0x3a16, 0x3a31, 0x3a31, 0x1078, 0x3927, 0x007c, 0x127e, 0x8001,
+ 0x700e, 0x7058, 0x007e, 0x1078, 0x3dc5, 0x0040, 0x3a13, 0x2091,
+ 0x8000, 0x1078, 0x3927, 0x0d7f, 0x0078, 0x3a1f, 0x127e, 0x8001,
+ 0x700e, 0x1078, 0x3dc5, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
- 0x00c8, 0x3d6e, 0x1079, 0x3d74, 0x127f, 0x007c, 0x127f, 0x1078,
- 0x3d94, 0x007c, 0x007c, 0x007c, 0x3d94, 0x3db0, 0x3e85, 0x3d94,
- 0x3db0, 0x3d94, 0x3db0, 0x3db0, 0x3d94, 0x3db0, 0x3e85, 0x3db0,
- 0x3db0, 0x3db0, 0x3db0, 0x3db0, 0x3d94, 0x3db0, 0x3e85, 0x3d94,
- 0x3d94, 0x3db0, 0x3d94, 0x3d94, 0x3d94, 0x3db0, 0x007c, 0x007c,
+ 0x00c8, 0x3a2e, 0x1079, 0x3a34, 0x127f, 0x007c, 0x127f, 0x1078,
+ 0x3a54, 0x007c, 0x007c, 0x007c, 0x3a54, 0x3a70, 0x3b45, 0x3a54,
+ 0x3a70, 0x3a54, 0x3a70, 0x3a70, 0x3a54, 0x3a70, 0x3b45, 0x3a70,
+ 0x3a70, 0x3a70, 0x3a70, 0x3a70, 0x3a54, 0x3a70, 0x3b45, 0x3a54,
+ 0x3a54, 0x3a70, 0x3a54, 0x3a54, 0x3a54, 0x3a70, 0x007c, 0x007c,
0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a2c,
+ 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36ec,
0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a2c, 0x127f, 0x007c,
+ 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36ec, 0x127f, 0x007c,
0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3a2c, 0x127f, 0x007c, 0x7007, 0x0001,
+ 0x2091, 0x8000, 0x1078, 0x36ec, 0x127f, 0x007c, 0x7007, 0x0001,
0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3a2c, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3da2, 0x8001, 0x00c0, 0x3dd9, 0x7007, 0x0001, 0x0078,
- 0x3e62, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
- 0x3e62, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
- 0x0024, 0x2098, 0x20a1, 0x76f8, 0x53a3, 0x6858, 0x7012, 0xa082,
- 0x0401, 0x00c8, 0x3dbe, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3dbe,
- 0xa080, 0x3e53, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3e46,
- 0x1078, 0x1314, 0x00c0, 0x3e07, 0x7007, 0x000f, 0x007c, 0x2d00,
+ 0x1078, 0x36ec, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
+ 0x0040, 0x3a62, 0x8001, 0x00c0, 0x3a99, 0x7007, 0x0001, 0x0078,
+ 0x3b22, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
+ 0x3b22, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
+ 0x0024, 0x2098, 0x20a1, 0x6ff8, 0x53a3, 0x6858, 0x7012, 0xa082,
+ 0x0401, 0x00c8, 0x3a7e, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3a7e,
+ 0xa080, 0x3b13, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3b06,
+ 0x1078, 0x12c5, 0x00c0, 0x3ac7, 0x7007, 0x000f, 0x007c, 0x2d00,
0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
- 0x6008, 0xa20a, 0x00c8, 0x3e16, 0xa00e, 0x2200, 0x7112, 0x620c,
- 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3e1f, 0xa108, 0x719a,
- 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x137f, 0x7090, 0xa08e,
- 0x0100, 0x0040, 0x3e3a, 0xa086, 0x0200, 0x0040, 0x3e32, 0x7007,
- 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x1348, 0x7014, 0x2068,
- 0x0078, 0x3dbe, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
- 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3dfc, 0x7014, 0x2068,
+ 0x6008, 0xa20a, 0x00c8, 0x3ad6, 0xa00e, 0x2200, 0x7112, 0x620c,
+ 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3adf, 0xa108, 0x719a,
+ 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x1330, 0x7090, 0xa08e,
+ 0x0100, 0x0040, 0x3afa, 0xa086, 0x0200, 0x0040, 0x3af2, 0x7007,
+ 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x12f9, 0x7014, 0x2068,
+ 0x0078, 0x3a7e, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
+ 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3abc, 0x7014, 0x2068,
0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
- 0x4055, 0x0078, 0x3e62, 0x3e56, 0x3e5a, 0x3e5e, 0x0002, 0x0011,
+ 0x3d15, 0x0078, 0x3b22, 0x3b16, 0x3b1a, 0x3b1e, 0x0002, 0x0011,
0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
- 0x0005, 0x0006, 0x2009, 0x762c, 0x210c, 0x81ff, 0x00c0, 0x3e7f,
- 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3622,
- 0x00c0, 0x3e73, 0x007c, 0x1078, 0x3abc, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x127f, 0x0078, 0x3e72, 0x2001,
- 0x0028, 0x2009, 0x0000, 0x0078, 0x3e73, 0x7018, 0x6802, 0x2d08,
- 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3e94,
- 0x7007, 0x0006, 0x0078, 0x3e9a, 0x7014, 0x2068, 0x7007, 0x0001,
+ 0x0005, 0x0006, 0x2009, 0x6f2a, 0x210c, 0x81ff, 0x00c0, 0x3b3f,
+ 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x32e2,
+ 0x00c0, 0x3b33, 0x007c, 0x1078, 0x377c, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x639b, 0x1078, 0x36ec, 0x127f, 0x0078, 0x3b32, 0x2001,
+ 0x0028, 0x2009, 0x0000, 0x0078, 0x3b33, 0x7018, 0x6802, 0x2d08,
+ 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3b54,
+ 0x7007, 0x0006, 0x0078, 0x3b5a, 0x7014, 0x2068, 0x7007, 0x0001,
0x7048, 0x107a, 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c,
0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001,
- 0x0040, 0x3ec6, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
- 0x0040, 0x3ec6, 0xa005, 0x00c0, 0x3edd, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x1078, 0x37d7, 0x00c0, 0x3edd, 0x067e, 0x6e44, 0xa6b4,
- 0x000f, 0x1078, 0x386c, 0x067f, 0x0078, 0x3edd, 0x047e, 0x2011,
- 0x760c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078,
- 0x37d7, 0x00c0, 0x3ed9, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091,
- 0x8001, 0x8108, 0x00f0, 0x3ecf, 0x0c7f, 0x1078, 0x1348, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7652, 0x2004,
- 0xd0a4, 0x0040, 0x3f20, 0x6944, 0x1078, 0x4121, 0x6100, 0xd184,
- 0x0040, 0x3f05, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3f23, 0x6000,
- 0xd084, 0x0040, 0x3f20, 0x6004, 0xa005, 0x00c0, 0x3f26, 0x6003,
- 0x0000, 0x600b, 0x0000, 0x0078, 0x3f1d, 0x2011, 0x0001, 0x6860,
- 0xa005, 0x00c0, 0x3f0d, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858,
- 0xa084, 0x00ff, 0x0040, 0x3f20, 0x6006, 0x6858, 0x8007, 0xa084,
- 0x00ff, 0x0040, 0x3f20, 0x600a, 0x6202, 0x127f, 0x0078, 0x40f4,
- 0x127f, 0x0078, 0x40ec, 0x127f, 0x0078, 0x40e4, 0x127f, 0x0078,
- 0x40e8, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7652,
- 0x2004, 0xd0a4, 0x0040, 0x3f7e, 0x6944, 0x1078, 0x4121, 0x6000,
- 0xa084, 0x0001, 0x0040, 0x3f7e, 0x6204, 0x6308, 0x6c48, 0xa484,
- 0x0003, 0x0040, 0x3f56, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
- 0x3f4f, 0x2100, 0xa210, 0x0048, 0x3f7b, 0x0078, 0x3f56, 0x8001,
- 0x00c0, 0x3f7b, 0x2100, 0xa212, 0x0048, 0x3f7b, 0xa484, 0x000c,
- 0x0040, 0x3f70, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
- 0x00c0, 0x3f68, 0x2100, 0xa318, 0x0048, 0x3f7b, 0x0078, 0x3f70,
- 0xa082, 0x0004, 0x00c0, 0x3f7b, 0x2100, 0xa31a, 0x0048, 0x3f7b,
- 0x6860, 0xa005, 0x0040, 0x3f76, 0x8000, 0x6016, 0x6206, 0x630a,
- 0x127f, 0x0078, 0x40f4, 0x127f, 0x0078, 0x40f0, 0x127f, 0x0078,
- 0x40ec, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078,
- 0x4121, 0x6308, 0x8318, 0x0048, 0x3f91, 0x630a, 0x127f, 0x0078,
- 0x4102, 0x127f, 0x0078, 0x40f0, 0x127e, 0x0c7e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3fa8, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfcff, 0x1078, 0x4666, 0x027f, 0x0078, 0x3fde,
- 0x6858, 0xa005, 0x0040, 0x3ff2, 0x685c, 0xa065, 0x0040, 0x3fee,
- 0x2001, 0x762c, 0x2004, 0xa005, 0x0040, 0x3fba, 0x1078, 0x6a4c,
- 0x0078, 0x3fc0, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x5bdb,
- 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x3fd6, 0xa186,
- 0x0400, 0x0040, 0x3fd6, 0x6944, 0x0c7e, 0x1078, 0x45be, 0x6000,
- 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x3fde, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfdff, 0x1078, 0x4666, 0x027f, 0x684c, 0xd0c4,
- 0x0040, 0x3fea, 0x6944, 0x1078, 0x45be, 0x6008, 0x8000, 0x0048,
- 0x3fea, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x40f4, 0x0c7f, 0x127f,
- 0x0078, 0x40ec, 0x6954, 0xa186, 0x002a, 0x00c0, 0x3ffe, 0x2001,
- 0x760c, 0x200c, 0xc194, 0x2102, 0x0078, 0x3fde, 0xa186, 0x0020,
- 0x0040, 0x4013, 0xa186, 0x0029, 0x00c0, 0x3fee, 0x6944, 0xa18c,
- 0xff00, 0x810f, 0x1078, 0x37d7, 0x00c0, 0x3fde, 0x6000, 0xc0e4,
- 0x6002, 0x0078, 0x3fde, 0x685c, 0xa065, 0x0040, 0x3fee, 0x6017,
- 0x0014, 0x0078, 0x3fde, 0x6944, 0x1078, 0x4121, 0x6000, 0xa084,
- 0x0001, 0x0040, 0x4034, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048,
- 0x402e, 0x6206, 0x2091, 0x8001, 0x0078, 0x4102, 0x2091, 0x8001,
- 0x6853, 0x0016, 0x0078, 0x40fb, 0x6853, 0x0007, 0x0078, 0x40fb,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x4042, 0x1078, 0x3da2,
- 0x0078, 0x4054, 0x2030, 0x8001, 0x00c0, 0x404c, 0x7007, 0x0001,
- 0x1078, 0x4055, 0x0078, 0x4054, 0x7007, 0x0006, 0x7012, 0x2d00,
- 0x7016, 0x701a, 0x704b, 0x4055, 0x007c, 0x0e7e, 0x2009, 0x762c,
- 0x210c, 0x81ff, 0x00c0, 0x40d6, 0x2009, 0x760c, 0x210c, 0xd194,
- 0x00c0, 0x40e0, 0x6848, 0x2070, 0xae82, 0x7d00, 0x0048, 0x40c5,
- 0x2001, 0x7615, 0x2004, 0xae02, 0x00c8, 0x40c5, 0x6944, 0x1078,
- 0x4121, 0x6100, 0xa184, 0x0001, 0x0040, 0x40ab, 0xa184, 0x0100,
- 0x00c0, 0x40c9, 0xa184, 0x0200, 0x00c0, 0x40cd, 0x601c, 0xa005,
- 0x00c0, 0x40d1, 0x711c, 0xa186, 0x0006, 0x00c0, 0x40b0, 0x6853,
+ 0x0040, 0x3b86, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
+ 0x0040, 0x3b86, 0xa005, 0x00c0, 0x3b9d, 0x6944, 0x810f, 0xa18c,
+ 0x00ff, 0x1078, 0x3497, 0x00c0, 0x3b9d, 0x067e, 0x6e44, 0xa6b4,
+ 0x000f, 0x1078, 0x352c, 0x067f, 0x0078, 0x3b9d, 0x047e, 0x2011,
+ 0x6f0c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078,
+ 0x3497, 0x00c0, 0x3b99, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091,
+ 0x8001, 0x8108, 0x00f0, 0x3b8f, 0x0c7f, 0x1078, 0x12f9, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6f52, 0x2004,
+ 0xd0a4, 0x0040, 0x3be0, 0x6944, 0x1078, 0x3de1, 0x6100, 0xd184,
+ 0x0040, 0x3bc5, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3be3, 0x6000,
+ 0xd084, 0x0040, 0x3be0, 0x6004, 0xa005, 0x00c0, 0x3be6, 0x6003,
+ 0x0000, 0x600b, 0x0000, 0x0078, 0x3bdd, 0x2011, 0x0001, 0x6860,
+ 0xa005, 0x00c0, 0x3bcd, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858,
+ 0xa084, 0x00ff, 0x0040, 0x3be0, 0x6006, 0x6858, 0x8007, 0xa084,
+ 0x00ff, 0x0040, 0x3be0, 0x600a, 0x6202, 0x127f, 0x0078, 0x3db4,
+ 0x127f, 0x0078, 0x3dac, 0x127f, 0x0078, 0x3da4, 0x127f, 0x0078,
+ 0x3da8, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6f52,
+ 0x2004, 0xd0a4, 0x0040, 0x3c3e, 0x6944, 0x1078, 0x3de1, 0x6000,
+ 0xa084, 0x0001, 0x0040, 0x3c3e, 0x6204, 0x6308, 0x6c48, 0xa484,
+ 0x0003, 0x0040, 0x3c16, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
+ 0x3c0f, 0x2100, 0xa210, 0x0048, 0x3c3b, 0x0078, 0x3c16, 0x8001,
+ 0x00c0, 0x3c3b, 0x2100, 0xa212, 0x0048, 0x3c3b, 0xa484, 0x000c,
+ 0x0040, 0x3c30, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
+ 0x00c0, 0x3c28, 0x2100, 0xa318, 0x0048, 0x3c3b, 0x0078, 0x3c30,
+ 0xa082, 0x0004, 0x00c0, 0x3c3b, 0x2100, 0xa31a, 0x0048, 0x3c3b,
+ 0x6860, 0xa005, 0x0040, 0x3c36, 0x8000, 0x6016, 0x6206, 0x630a,
+ 0x127f, 0x0078, 0x3db4, 0x127f, 0x0078, 0x3db0, 0x127f, 0x0078,
+ 0x3dac, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078,
+ 0x3de1, 0x6308, 0x8318, 0x0048, 0x3c51, 0x630a, 0x127f, 0x0078,
+ 0x3dc2, 0x127f, 0x0078, 0x3db0, 0x127e, 0x0c7e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3c68, 0x027e, 0x2009,
+ 0x0000, 0x2011, 0xfcff, 0x1078, 0x4299, 0x027f, 0x0078, 0x3c9e,
+ 0x6858, 0xa005, 0x0040, 0x3cb2, 0x685c, 0xa065, 0x0040, 0x3cae,
+ 0x2001, 0x6f2a, 0x2004, 0xa005, 0x0040, 0x3c7a, 0x1078, 0x62fd,
+ 0x0078, 0x3c80, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x55c8,
+ 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x3c96, 0xa186,
+ 0x0400, 0x0040, 0x3c96, 0x6944, 0x0c7e, 0x1078, 0x41f1, 0x6000,
+ 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x3c9e, 0x027e, 0x2009,
+ 0x0000, 0x2011, 0xfdff, 0x1078, 0x4299, 0x027f, 0x684c, 0xd0c4,
+ 0x0040, 0x3caa, 0x6944, 0x1078, 0x41f1, 0x6008, 0x8000, 0x0048,
+ 0x3caa, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x3db4, 0x0c7f, 0x127f,
+ 0x0078, 0x3dac, 0x6954, 0xa186, 0x002a, 0x00c0, 0x3cbe, 0x2001,
+ 0x6f0c, 0x200c, 0xc194, 0x2102, 0x0078, 0x3c9e, 0xa186, 0x0020,
+ 0x0040, 0x3cd3, 0xa186, 0x0029, 0x00c0, 0x3cae, 0x6944, 0xa18c,
+ 0xff00, 0x810f, 0x1078, 0x3497, 0x00c0, 0x3c9e, 0x6000, 0xc0e4,
+ 0x6002, 0x0078, 0x3c9e, 0x685c, 0xa065, 0x0040, 0x3cae, 0x6017,
+ 0x0014, 0x0078, 0x3c9e, 0x6944, 0x1078, 0x3de1, 0x6000, 0xa084,
+ 0x0001, 0x0040, 0x3cf4, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048,
+ 0x3cee, 0x6206, 0x2091, 0x8001, 0x0078, 0x3dc2, 0x2091, 0x8001,
+ 0x6853, 0x0016, 0x0078, 0x3dbb, 0x6853, 0x0007, 0x0078, 0x3dbb,
+ 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x3d02, 0x1078, 0x3a62,
+ 0x0078, 0x3d14, 0x2030, 0x8001, 0x00c0, 0x3d0c, 0x7007, 0x0001,
+ 0x1078, 0x3d15, 0x0078, 0x3d14, 0x7007, 0x0006, 0x7012, 0x2d00,
+ 0x7016, 0x701a, 0x704b, 0x3d15, 0x007c, 0x0e7e, 0x2009, 0x6f2a,
+ 0x210c, 0x81ff, 0x00c0, 0x3d96, 0x2009, 0x6f0c, 0x210c, 0xd194,
+ 0x00c0, 0x3da0, 0x6848, 0x2070, 0xae82, 0x7500, 0x0048, 0x3d85,
+ 0x2001, 0x6f15, 0x2004, 0xae02, 0x00c8, 0x3d85, 0x6944, 0x1078,
+ 0x3de1, 0x6100, 0xa184, 0x0001, 0x0040, 0x3d6b, 0xa184, 0x0100,
+ 0x00c0, 0x3d89, 0xa184, 0x0200, 0x00c0, 0x3d8d, 0x601c, 0xa005,
+ 0x00c0, 0x3d91, 0x711c, 0xa186, 0x0006, 0x00c0, 0x3d70, 0x6853,
0x0000, 0x6803, 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010,
- 0xa005, 0x00c0, 0x40a2, 0x7112, 0x7018, 0xa065, 0x0040, 0x40d5,
- 0x6000, 0xd0e4, 0x00c0, 0x40da, 0x2e60, 0x1078, 0x45c7, 0x127f,
- 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x40a2, 0x6902,
- 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x40fb,
- 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x37d7, 0x00c0, 0x40db,
- 0x6000, 0xd0e4, 0x00c0, 0x40db, 0x711c, 0xa186, 0x0007, 0x00c0,
- 0x40c5, 0x6853, 0x0002, 0x0078, 0x40dd, 0x6853, 0x0008, 0x0078,
- 0x40dd, 0x6853, 0x000e, 0x0078, 0x40dd, 0x6853, 0x0017, 0x0078,
- 0x40dd, 0x6853, 0x0035, 0x0078, 0x40dd, 0x127f, 0x6853, 0x0028,
- 0x0078, 0x40dd, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x40fb,
- 0x6853, 0x002a, 0x0078, 0x40dd, 0x2009, 0x003e, 0x0078, 0x40f6,
- 0x2009, 0x0004, 0x0078, 0x40f6, 0x2009, 0x0006, 0x0078, 0x40f6,
- 0x2009, 0x0016, 0x0078, 0x40f6, 0x2009, 0x0001, 0x6854, 0xa084,
- 0xff00, 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x3a2c, 0x2091,
- 0x8001, 0x007c, 0x1078, 0x1348, 0x007c, 0x702c, 0x7130, 0x8108,
- 0xa102, 0x0048, 0x4112, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076,
- 0x0078, 0x411e, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x411e,
+ 0xa005, 0x00c0, 0x3d62, 0x7112, 0x7018, 0xa065, 0x0040, 0x3d95,
+ 0x6000, 0xd0e4, 0x00c0, 0x3d9a, 0x2e60, 0x1078, 0x41fa, 0x127f,
+ 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x3d62, 0x6902,
+ 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3dbb,
+ 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x3497, 0x00c0, 0x3d9b,
+ 0x6000, 0xd0e4, 0x00c0, 0x3d9b, 0x711c, 0xa186, 0x0007, 0x00c0,
+ 0x3d85, 0x6853, 0x0002, 0x0078, 0x3d9d, 0x6853, 0x0008, 0x0078,
+ 0x3d9d, 0x6853, 0x000e, 0x0078, 0x3d9d, 0x6853, 0x0017, 0x0078,
+ 0x3d9d, 0x6853, 0x0035, 0x0078, 0x3d9d, 0x127f, 0x6853, 0x0028,
+ 0x0078, 0x3d9d, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3dbb,
+ 0x6853, 0x002a, 0x0078, 0x3d9d, 0x2009, 0x003e, 0x0078, 0x3db6,
+ 0x2009, 0x0004, 0x0078, 0x3db6, 0x2009, 0x0006, 0x0078, 0x3db6,
+ 0x2009, 0x0016, 0x0078, 0x3db6, 0x2009, 0x0001, 0x6854, 0xa084,
+ 0xff00, 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x36ec, 0x2091,
+ 0x8001, 0x007c, 0x1078, 0x12f9, 0x007c, 0x702c, 0x7130, 0x8108,
+ 0xa102, 0x0048, 0x3dd2, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076,
+ 0x0078, 0x3dde, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3dde,
0x7074, 0xa081, 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132,
- 0x007c, 0x0d7e, 0x1078, 0x45be, 0x0d7f, 0x007c, 0x0d7e, 0x2011,
+ 0x007c, 0x0d7e, 0x1078, 0x41f1, 0x0d7f, 0x007c, 0x0d7e, 0x2011,
0x0004, 0x2204, 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1,
0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040,
- 0x413d, 0xa086, 0x1000, 0x00c0, 0x4159, 0x20e1, 0x0004, 0x3d60,
- 0xd1bc, 0x00c0, 0x4144, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x4159,
- 0xac82, 0x7d00, 0x0048, 0x4159, 0x6854, 0xac02, 0x00c8, 0x4159,
- 0x2009, 0x0047, 0x1078, 0x5bdb, 0x7a1c, 0xd284, 0x00c0, 0x412f,
- 0x007c, 0xa016, 0x1078, 0x1572, 0x0078, 0x4154, 0x157e, 0x137e,
+ 0x3dfd, 0xa086, 0x1000, 0x00c0, 0x3e19, 0x20e1, 0x0004, 0x3d60,
+ 0xd1bc, 0x00c0, 0x3e04, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3e19,
+ 0xac82, 0x7500, 0x0048, 0x3e19, 0x6854, 0xac02, 0x00c8, 0x3e19,
+ 0x2009, 0x0047, 0x1078, 0x55c8, 0x7a1c, 0xd284, 0x00c0, 0x3def,
+ 0x007c, 0xa016, 0x1078, 0x1523, 0x0078, 0x3e14, 0x157e, 0x137e,
0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0070, 0x00c0,
- 0x4187, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x4187, 0x1078,
- 0x4194, 0x0040, 0x4187, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078,
- 0x41b2, 0x147f, 0x137f, 0x157f, 0x2009, 0x783e, 0x2104, 0xa005,
- 0x00c0, 0x4183, 0x007c, 0x1078, 0x4c2c, 0x0078, 0x4182, 0x1078,
- 0x751f, 0x1078, 0x4194, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f,
- 0x137f, 0x157f, 0x0078, 0x4182, 0xa484, 0x01ff, 0x687a, 0xa005,
- 0x0040, 0x41a6, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1,
+ 0x3e47, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x3e47, 0x1078,
+ 0x3e54, 0x0040, 0x3e47, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078,
+ 0x3e72, 0x147f, 0x137f, 0x157f, 0x2009, 0x70be, 0x2104, 0xa005,
+ 0x00c0, 0x3e43, 0x007c, 0x1078, 0x484d, 0x0078, 0x3e42, 0x1078,
+ 0x6dc3, 0x1078, 0x3e54, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f,
+ 0x137f, 0x157f, 0x0078, 0x3e42, 0xa484, 0x01ff, 0x6872, 0xa005,
+ 0x0040, 0x3e66, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1,
0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c,
0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001,
- 0x0078, 0x41a5, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
- 0xa196, 0x0000, 0x00c0, 0x41bf, 0x0078, 0x4333, 0x007c, 0xa196,
- 0x2000, 0x00c0, 0x41d0, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x41cc,
- 0x1078, 0x2e6a, 0x0078, 0x41be, 0x1078, 0x41d8, 0x0078, 0x41be,
- 0xa196, 0x8000, 0x00c0, 0x41be, 0x1078, 0x43b9, 0x0078, 0x41be,
+ 0x0078, 0x3e65, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
+ 0xa196, 0x0000, 0x00c0, 0x3e7f, 0x0078, 0x3f6b, 0x007c, 0xa196,
+ 0x2000, 0x00c0, 0x3e90, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x3e8c,
+ 0x1078, 0x2b2a, 0x0078, 0x3e7e, 0x1078, 0x3e98, 0x0078, 0x3e7e,
+ 0xa196, 0x8000, 0x00c0, 0x3e7e, 0x1078, 0x3ff1, 0x0078, 0x3e7e,
0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040,
- 0x41e5, 0xa196, 0x0023, 0x00c0, 0x42da, 0xa08e, 0x0023, 0x00c0,
- 0x4216, 0x1078, 0x4430, 0x0040, 0x42da, 0x7124, 0x610a, 0x7030,
- 0xa08e, 0x0200, 0x00c0, 0x41fe, 0x7034, 0xa005, 0x00c0, 0x42da,
- 0x2009, 0x0015, 0x1078, 0x5bdb, 0x0078, 0x42da, 0xa08e, 0x0210,
- 0x00c0, 0x4208, 0x2009, 0x0015, 0x1078, 0x5bdb, 0x0078, 0x42da,
- 0xa08e, 0x0100, 0x00c0, 0x42da, 0x7034, 0xa005, 0x00c0, 0x42da,
- 0x2009, 0x0016, 0x1078, 0x5bdb, 0x0078, 0x42da, 0xa08e, 0x0022,
- 0x00c0, 0x42da, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x4227, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x0017, 0x0078, 0x42a6, 0xa08e,
- 0x0500, 0x00c0, 0x4233, 0x7034, 0xa005, 0x00c0, 0x42da, 0x2009,
- 0x0018, 0x0078, 0x42a6, 0xa08e, 0x2010, 0x00c0, 0x423b, 0x2009,
- 0x0019, 0x0078, 0x42a6, 0xa08e, 0x2110, 0x00c0, 0x4243, 0x2009,
- 0x001a, 0x0078, 0x42a6, 0xa08e, 0x5200, 0x00c0, 0x424f, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x001b, 0x0078, 0x42a6, 0xa08e,
- 0x5000, 0x00c0, 0x425b, 0x7034, 0xa005, 0x00c0, 0x42da, 0x2009,
- 0x001c, 0x0078, 0x42a6, 0xa08e, 0x1200, 0x00c0, 0x4267, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x0024, 0x0078, 0x42a6, 0xa08c,
- 0xff00, 0xa18e, 0x2400, 0x00c0, 0x4271, 0x2009, 0x002d, 0x0078,
- 0x42a6, 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x427b, 0x2009,
- 0x002a, 0x0078, 0x42a6, 0xa08e, 0x0f00, 0x00c0, 0x4283, 0x2009,
- 0x0020, 0x0078, 0x42a6, 0xa08e, 0x5300, 0x00c0, 0x4289, 0x0078,
- 0x42a4, 0xa08e, 0x6104, 0x00c0, 0x42a4, 0x2011, 0x7b8d, 0x8208,
- 0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015,
- 0x211c, 0x8108, 0x2124, 0x1078, 0x2d02, 0x8108, 0x00f0, 0x4296,
- 0x2009, 0x0023, 0x0078, 0x42a6, 0x2009, 0x001d, 0x017e, 0x2011,
- 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0, 0x42dc,
- 0x1078, 0x37a0, 0x00c0, 0x42dc, 0x6612, 0x6516, 0x86ff, 0x0040,
- 0x42cc, 0x017f, 0x017e, 0xa186, 0x0017, 0x00c0, 0x42cc, 0x6864,
- 0xa606, 0x00c0, 0x42cc, 0x6868, 0xa506, 0xa084, 0xff00, 0x00c0,
- 0x42cc, 0x6000, 0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x5b4e, 0x0040,
- 0x42df, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f,
- 0x1078, 0x5bdb, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x42da, 0x0c7f,
- 0x0078, 0x42dc, 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff,
- 0x00c0, 0x4302, 0xa596, 0xfffd, 0x00c0, 0x42f2, 0x2009, 0x007f,
- 0x0078, 0x432f, 0xa596, 0xfffe, 0x00c0, 0x42fa, 0x2009, 0x007e,
- 0x0078, 0x432f, 0xa596, 0xfffc, 0x00c0, 0x4302, 0x2009, 0x0080,
- 0x0078, 0x432f, 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082,
- 0x2071, 0x779e, 0x2e1c, 0x83ff, 0x00c0, 0x4314, 0x82ff, 0x00c0,
- 0x4323, 0x2410, 0x0078, 0x4323, 0x2368, 0x6b10, 0x007e, 0x2100,
- 0xa31e, 0x007f, 0x00c0, 0x4323, 0x6b14, 0xa31e, 0x00c0, 0x4323,
- 0x2408, 0x0078, 0x432f, 0x8420, 0x8e70, 0x00f0, 0x430a, 0x82ff,
- 0x00c0, 0x432e, 0xa085, 0x0001, 0x0078, 0x4330, 0x2208, 0xa006,
- 0x0d7f, 0x0e7f, 0x007c, 0xa084, 0x0007, 0x0079, 0x4338, 0x007c,
- 0x4340, 0x4340, 0x4340, 0x4340, 0x4340, 0x4341, 0x435a, 0x43a2,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4359, 0x7120, 0x2160, 0xac8c,
- 0x0007, 0x00c0, 0x4359, 0xac8a, 0x7d00, 0x0048, 0x4359, 0x6854,
- 0xac02, 0x00c8, 0x4359, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078,
- 0x5bdb, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x43a0, 0x2011,
- 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0, 0x43a0,
- 0x1078, 0x37d7, 0x00c0, 0x43a0, 0x6204, 0xa294, 0xff00, 0x8217,
- 0xa286, 0x0006, 0x00c0, 0x4385, 0x0c7e, 0x1078, 0x5b4e, 0x017f,
- 0x0040, 0x43a0, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009,
- 0x0044, 0x1078, 0x5bdb, 0x0078, 0x43a0, 0x0c7e, 0x1078, 0x5b4e,
- 0x017f, 0x0040, 0x43a0, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
- 0xa286, 0x0004, 0x00c0, 0x4398, 0x6007, 0x0005, 0x0078, 0x439a,
- 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4824, 0x1078, 0x4c2c,
- 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x43b8, 0x7020, 0x2060,
- 0xac84, 0x0007, 0x00c0, 0x43b8, 0xac82, 0x7d00, 0x0048, 0x43b8,
- 0x6854, 0xac02, 0x00c8, 0x43b8, 0x2009, 0x0045, 0x1078, 0x5bdb,
+ 0x3ea5, 0xa196, 0x0023, 0x00c0, 0x3f63, 0xa08e, 0x0023, 0x00c0,
+ 0x3ed6, 0x1078, 0x4063, 0x0040, 0x3f63, 0x7124, 0x610a, 0x7030,
+ 0xa08e, 0x0200, 0x00c0, 0x3ebe, 0x7034, 0xa005, 0x00c0, 0x3f63,
+ 0x2009, 0x0015, 0x1078, 0x55c8, 0x0078, 0x3f63, 0xa08e, 0x0210,
+ 0x00c0, 0x3ec8, 0x2009, 0x0015, 0x1078, 0x55c8, 0x0078, 0x3f63,
+ 0xa08e, 0x0100, 0x00c0, 0x3f63, 0x7034, 0xa005, 0x00c0, 0x3f63,
+ 0x2009, 0x0016, 0x1078, 0x55c8, 0x0078, 0x3f63, 0xa08e, 0x0022,
+ 0x00c0, 0x3f63, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x3ee7, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x0017, 0x0078, 0x3f4b, 0xa08e,
+ 0x0500, 0x00c0, 0x3ef3, 0x7034, 0xa005, 0x00c0, 0x3f63, 0x2009,
+ 0x0018, 0x0078, 0x3f4b, 0xa08e, 0x2010, 0x00c0, 0x3efb, 0x2009,
+ 0x0019, 0x0078, 0x3f4b, 0xa08e, 0x2110, 0x00c0, 0x3f03, 0x2009,
+ 0x001a, 0x0078, 0x3f4b, 0xa08e, 0x5200, 0x00c0, 0x3f0f, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x001b, 0x0078, 0x3f4b, 0xa08e,
+ 0x5000, 0x00c0, 0x3f1b, 0x7034, 0xa005, 0x00c0, 0x3f63, 0x2009,
+ 0x001c, 0x0078, 0x3f4b, 0xa08e, 0x1200, 0x00c0, 0x3f27, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x0024, 0x0078, 0x3f4b, 0xa08c,
+ 0xff00, 0xa18e, 0x2400, 0x00c0, 0x3f31, 0x2009, 0x002d, 0x0078,
+ 0x3f4b, 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x3f3b, 0x2009,
+ 0x002a, 0x0078, 0x3f4b, 0xa08e, 0x0f00, 0x00c0, 0x3f43, 0x2009,
+ 0x0020, 0x0078, 0x3f4b, 0xa08e, 0x5300, 0x00c0, 0x3f49, 0x0078,
+ 0x3f49, 0x2009, 0x001d, 0x017e, 0x2011, 0x7383, 0x2204, 0x1078,
+ 0x1fb0, 0x1078, 0x3460, 0x00c0, 0x3f65, 0x0c7e, 0x1078, 0x553b,
+ 0x0040, 0x3f68, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0x017f, 0x1078, 0x55c8, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x3f63,
+ 0x0c7f, 0x0078, 0x3f65, 0xa084, 0x0007, 0x0079, 0x3f70, 0x007c,
+ 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f79, 0x3f92, 0x3fda,
+ 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3f91, 0x7120, 0x2160, 0xac8c,
+ 0x0007, 0x00c0, 0x3f91, 0xac8a, 0x7500, 0x0048, 0x3f91, 0x6854,
+ 0xac02, 0x00c8, 0x3f91, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078,
+ 0x55c8, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x3fd8, 0x2011,
+ 0x7383, 0x2204, 0xa080, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x3497, 0x00c0, 0x3fd8, 0x6204, 0xa294, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x00c0, 0x3fbd, 0x0c7e, 0x1078, 0x553b, 0x017f,
+ 0x0040, 0x3fd8, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009,
+ 0x0044, 0x1078, 0x55c8, 0x0078, 0x3fd8, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x3fd8, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0xa286, 0x0004, 0x00c0, 0x3fd0, 0x6007, 0x0005, 0x0078, 0x3fd2,
+ 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4445, 0x1078, 0x484d,
+ 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3ff0, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x3ff0, 0xac82, 0x7500, 0x0048, 0x3ff0,
+ 0x6854, 0xac02, 0x00c8, 0x3ff0, 0x2009, 0x0045, 0x1078, 0x55c8,
0x007c, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0,
- 0x43c9, 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12d5, 0x1079,
- 0x43ca, 0x007c, 0x43d0, 0x43d1, 0x43d0, 0x43d0, 0x4412, 0x4421,
- 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4411, 0x700c, 0x7108, 0x1078,
- 0x2059, 0x00c0, 0x4411, 0x1078, 0x37a0, 0x00c0, 0x4411, 0x6612,
- 0x6516, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0,
- 0x43fa, 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x4411, 0x611a,
- 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x5bdb,
- 0x0078, 0x4411, 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x4411,
- 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0,
- 0x440d, 0x2009, 0x0005, 0x0078, 0x440f, 0x2009, 0x0001, 0x1078,
- 0x5bdb, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4420, 0x1078, 0x4430,
- 0x0040, 0x4420, 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x5bdb,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x442f, 0x1078, 0x4430, 0x0040,
- 0x442f, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078, 0x5bdb, 0x007c,
- 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x4443, 0xac82, 0x7d00,
- 0x0048, 0x4443, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x4443,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x4442, 0x2071, 0x7849,
- 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017,
- 0x7d00, 0x7007, 0x0000, 0x7026, 0x702b, 0x5541, 0x7032, 0x7037,
- 0x5582, 0x703b, 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x7849,
- 0x00e0, 0x450d, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0,
- 0x44d6, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000,
- 0x7138, 0x8109, 0x713a, 0x00c0, 0x44d4, 0x703b, 0x0002, 0x2009,
- 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8, 0x44d4, 0x703c, 0xa086,
- 0x0001, 0x00c0, 0x44b1, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x448f, 0x6803, 0x1000, 0x0078, 0x4496, 0x6804,
- 0xa084, 0x1000, 0x0040, 0x4496, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x703f, 0x0000, 0x2069, 0x7836, 0x6804, 0xa082, 0x0006, 0x00c0,
- 0x44a3, 0x6807, 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x44aa,
- 0x6833, 0x0000, 0x1078, 0x4c2c, 0x1078, 0x4cec, 0x0d7f, 0x0078,
- 0x44d4, 0x0d7e, 0x2069, 0x7600, 0x6944, 0x6860, 0xa102, 0x00c8,
- 0x44d3, 0x2069, 0x7836, 0x6804, 0xa086, 0x0000, 0x00c0, 0x44d3,
- 0x6830, 0xa086, 0x0000, 0x00c0, 0x44d3, 0x703f, 0x0001, 0x6807,
- 0x0006, 0x6833, 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069,
- 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078, 0x44d9, 0x127e, 0x2091,
- 0x8000, 0x7024, 0xa00d, 0x0040, 0x44ea, 0x7020, 0x8001, 0x7022,
- 0x00c0, 0x44ea, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x44ea,
- 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x44fb, 0x702c, 0x8001,
- 0x702e, 0x00c0, 0x44fb, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0,
- 0x44fb, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x450c, 0x7008,
- 0x8001, 0x700a, 0x00c0, 0x450c, 0x700b, 0x0009, 0x8109, 0x711a,
- 0x00c0, 0x450c, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4510,
- 0x4537, 0x4538, 0x4554, 0x0e7e, 0x2071, 0x7849, 0x7018, 0xa005,
- 0x00c0, 0x451e, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
- 0x0e7e, 0x007e, 0x2071, 0x7849, 0x701c, 0xa206, 0x00c0, 0x452a,
- 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7849,
- 0x6088, 0xa102, 0x0048, 0x4535, 0x618a, 0x0e7f, 0x007c, 0x007c,
- 0x7110, 0x1078, 0x37d7, 0x00c0, 0x454a, 0x6088, 0x8001, 0x0048,
- 0x454a, 0x608a, 0x00c0, 0x454a, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4c2c, 0x127f, 0x8108, 0xa182, 0x00ff, 0x0048, 0x4552, 0xa00e,
- 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091,
- 0x8000, 0x6014, 0xa005, 0x0040, 0x4583, 0x8001, 0x6016, 0x00c0,
- 0x4583, 0x611c, 0xa186, 0x0003, 0x0040, 0x456a, 0xa186, 0x0006,
- 0x00c0, 0x4581, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048,
- 0x4581, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x457a,
- 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078,
- 0x4583, 0x1078, 0x676e, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001,
- 0x7616, 0x2004, 0xa102, 0x0048, 0x4591, 0x7017, 0x7d00, 0x7007,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7849, 0x7027, 0x07d0, 0x7023,
- 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001, 0x7852, 0x2003,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7849, 0x7033, 0x07d0, 0x702f,
- 0x0009, 0x0e7f, 0x007c, 0x2011, 0x7855, 0x2013, 0x0000, 0x007c,
- 0x0e7e, 0x2071, 0x7849, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f,
- 0x007c, 0x0c7e, 0x2061, 0x78da, 0x0c7f, 0x007c, 0xa184, 0x000f,
- 0x8003, 0x8003, 0x8003, 0xa080, 0x78da, 0x2060, 0x007c, 0x6854,
- 0xa08a, 0x199a, 0x0048, 0x45ce, 0x2001, 0x1999, 0xa005, 0x00c0,
- 0x45de, 0x6944, 0x0c7e, 0x1078, 0x45be, 0x6014, 0x0c7f, 0xa005,
- 0x00c0, 0x45e3, 0x2001, 0x001e, 0x0078, 0x45e3, 0xa08e, 0xffff,
- 0x00c0, 0x45e3, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116,
- 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x461e, 0xd0b4,
- 0x00c0, 0x45fa, 0xd0bc, 0x00c0, 0x460c, 0x2009, 0x0006, 0x1078,
- 0x4641, 0x007c, 0xd0fc, 0x0040, 0x4607, 0xa084, 0x0003, 0xa08e,
- 0x0003, 0x0040, 0x463a, 0xa08e, 0x0000, 0x00c0, 0x463a, 0x2009,
- 0x0043, 0x1078, 0x5bdb, 0x007c, 0xd0fc, 0x0040, 0x4619, 0xa084,
- 0x0003, 0xa08e, 0x0003, 0x0040, 0x463a, 0xa08e, 0x0000, 0x00c0,
- 0x463a, 0x2009, 0x0042, 0x1078, 0x5bdb, 0x007c, 0xd0fc, 0x0040,
- 0x4630, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x463a, 0xa08e,
- 0x0002, 0x0040, 0x4634, 0x2009, 0x0041, 0x1078, 0x5bdb, 0x007c,
- 0x1078, 0x463f, 0x0078, 0x462f, 0x2009, 0x0043, 0x1078, 0x5bdb,
- 0x0078, 0x462f, 0x2009, 0x0004, 0x1078, 0x4641, 0x007c, 0x2009,
- 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040, 0x4665, 0x2068, 0x6952,
- 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0, 0x465f, 0x694c, 0xa18c,
- 0x8100, 0xa18e, 0x8100, 0x00c0, 0x465f, 0x0c7e, 0x6944, 0x1078,
- 0x45be, 0x6204, 0x8210, 0x0048, 0x465e, 0x6206, 0x0c7f, 0x1078,
- 0x3a2c, 0x6010, 0xa06d, 0x10c0, 0x45c7, 0x007c, 0x157e, 0x0c7e,
- 0x20a9, 0x0010, 0x2061, 0x78da, 0x6000, 0x81ff, 0x0040, 0x4673,
- 0xa205, 0x0078, 0x4674, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0,
- 0x466c, 0x0c7f, 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x4684,
- 0x8001, 0x680a, 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2079, 0x7836, 0x127f, 0x0d7e, 0x2069, 0x7836, 0x6803, 0x0005,
- 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c,
- 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x46a0,
- 0x46aa, 0x46cf, 0x472a, 0x46b0, 0x46cf, 0x46a8, 0x46a8, 0x46a8,
- 0x1078, 0x12d5, 0x1078, 0x459d, 0x1078, 0x4c2c, 0x0c7f, 0x007c,
- 0x62c0, 0x82ff, 0x00c0, 0x46b6, 0x0c7f, 0x007c, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0x7828, 0xa092, 0x0002, 0x00c8, 0x46c5, 0x8000,
- 0x782a, 0x1078, 0x352c, 0x0078, 0x46b4, 0x1078, 0x34fc, 0x7807,
- 0x0003, 0x7827, 0x0000, 0x782b, 0x0000, 0x0078, 0x46b4, 0x1078,
- 0x459d, 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214,
- 0x007f, 0x20e0, 0x82ff, 0x0040, 0x46ed, 0x62c0, 0x82ff, 0x00c0,
- 0x46ed, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009,
- 0x0013, 0x1078, 0x5bdb, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x797a,
- 0x00c8, 0x46f4, 0x1078, 0x5ade, 0x0c7e, 0x7824, 0xa065, 0x1040,
- 0x12d5, 0x7804, 0xa086, 0x0004, 0x0040, 0x476f, 0x7828, 0xa092,
- 0x2710, 0x00c8, 0x470a, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x5526,
- 0x0078, 0x46eb, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4721, 0x0e7e,
- 0x2071, 0x7600, 0x70c8, 0x0e7f, 0xd08c, 0x0040, 0x4721, 0x0c7e,
- 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7600, 0x1078, 0x3535, 0x0e7f,
- 0x0c7f, 0x1078, 0x7572, 0x2009, 0x0014, 0x1078, 0x5bdb, 0x0c7f,
- 0x0078, 0x46eb, 0x2001, 0x7852, 0x2003, 0x0000, 0x62c0, 0x82ff,
- 0x00c0, 0x473e, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5,
- 0x2009, 0x0013, 0x1078, 0x5c29, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e,
- 0x3900, 0xa082, 0x797a, 0x00c8, 0x4747, 0x1078, 0x5ade, 0x7824,
- 0xa005, 0x1040, 0x12d5, 0x781c, 0xa06d, 0x1040, 0x12d5, 0x6800,
- 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078, 0x5bb4, 0x693c, 0x81ff,
- 0x1040, 0x12d5, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x4763,
- 0x7a1e, 0x0078, 0x4765, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827,
- 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x4c2c, 0x0078, 0x473c, 0x6104,
- 0xa186, 0x0002, 0x0040, 0x477a, 0xa186, 0x0004, 0x0040, 0x477a,
- 0x0078, 0x46fe, 0x7808, 0xac06, 0x0040, 0x46fe, 0x1078, 0x4b33,
- 0x1078, 0x4824, 0x0c7f, 0x1078, 0x4c2c, 0x0078, 0x46eb, 0x0c7e,
- 0x6027, 0x0002, 0x2011, 0x7855, 0x2013, 0x0000, 0x62c8, 0x82ff,
- 0x00c0, 0x47a1, 0x62c4, 0x82ff, 0x00c0, 0x47a1, 0x793c, 0xa1e5,
- 0x0000, 0x0040, 0x479f, 0x2009, 0x0049, 0x1078, 0x5bdb, 0x0c7f,
- 0x007c, 0x3908, 0xa192, 0x797a, 0x00c8, 0x47a8, 0x1078, 0x5ade,
- 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040, 0x479f, 0x7944, 0xa192,
- 0x7530, 0x00c8, 0x47c7, 0x8108, 0x7946, 0x1078, 0x45a2, 0x793c,
- 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x47c3, 0x6017,
- 0x0012, 0x0078, 0x479f, 0x6017, 0x0016, 0x0078, 0x479f, 0x037e,
- 0x2019, 0x0001, 0x1078, 0x571a, 0x037f, 0x1078, 0x7572, 0x793c,
- 0x2160, 0x2009, 0x004a, 0x1078, 0x5bdb, 0x0078, 0x479f, 0x007e,
- 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
- 0x2061, 0x7836, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040,
- 0x47f2, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f,
- 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x47ed, 0x0d7e, 0x2069,
- 0x7836, 0x6000, 0xd0d4, 0x0040, 0x480b, 0x6820, 0x8000, 0x6822,
- 0xa086, 0x0001, 0x00c0, 0x4806, 0x2c00, 0x681e, 0x6804, 0xa084,
- 0x0007, 0x0079, 0x4c34, 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040,
- 0x481d, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f,
- 0x685a, 0x2069, 0x7836, 0x0078, 0x47fd, 0x6056, 0x605a, 0x2c00,
- 0x681a, 0x681e, 0x0078, 0x47fd, 0x007e, 0x017e, 0x0c7e, 0x127e,
- 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7836, 0x6020,
- 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x483f, 0xa080, 0x0003,
- 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e,
- 0x610a, 0x0078, 0x483a, 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061,
- 0x7836, 0x6034, 0xa005, 0x0040, 0x4853, 0xa080, 0x0003, 0x2102,
- 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x4851, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2071,
- 0x7836, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040,
- 0x48b9, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x48b4,
- 0x703c, 0xac06, 0x00c0, 0x4879, 0x6003, 0x000a, 0x630a, 0x0078,
- 0x48b4, 0x7038, 0xac36, 0x00c0, 0x487f, 0x660c, 0x763a, 0x7034,
- 0xac36, 0x00c0, 0x488d, 0x2c00, 0xaf36, 0x0040, 0x488b, 0x2f00,
- 0x7036, 0x0078, 0x488d, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x4896, 0x7e0e, 0x0078, 0x4897, 0x2678, 0x600f,
- 0x0000, 0x1078, 0x68e3, 0x0040, 0x48af, 0x6010, 0x2068, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x48c2, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078,
- 0x6a4c, 0x0c7f, 0x0078, 0x4866, 0x2c78, 0x600c, 0x2060, 0x0078,
- 0x4866, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x48a4, 0x1078,
- 0x74a8, 0x0078, 0x48af, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e,
- 0x2031, 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x7836, 0x7838,
- 0xa065, 0x0040, 0x4902, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c,
- 0xac06, 0x00c0, 0x48e9, 0x6003, 0x000a, 0x630a, 0x2c30, 0x0078,
- 0x48ff, 0x1078, 0x68e3, 0x0040, 0x48fd, 0x6010, 0x2068, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x490b, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x007f,
- 0x0078, 0x48d8, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x48f4,
- 0x1078, 0x74a8, 0x0078, 0x48fd, 0x027e, 0x1078, 0x4928, 0x1078,
- 0x49c1, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x7836, 0x2091,
- 0x8000, 0x1078, 0x4a58, 0x1078, 0x4ac0, 0x127f, 0x0f7f, 0x007c,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x49b0, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x49ab,
- 0x7024, 0xac06, 0x00c0, 0x496e, 0x2069, 0x0100, 0x68c0, 0xa005,
- 0x0040, 0x4969, 0x1078, 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4,
- 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
- 0x0040, 0x495e, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
- 0x6824, 0xd084, 0x0040, 0x4966, 0x6827, 0x0001, 0x037f, 0x0078,
- 0x496e, 0x6003, 0x0009, 0x630a, 0x0078, 0x49ab, 0x7014, 0xac36,
- 0x00c0, 0x4974, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x4982,
- 0x2c00, 0xaf36, 0x0040, 0x4980, 0x2f00, 0x7012, 0x0078, 0x4982,
- 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x498b,
- 0x7e0e, 0x0078, 0x498c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x49a4, 0x601c, 0xa086, 0x0003, 0x00c0,
- 0x49b8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6aea,
- 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x1078, 0x58b4,
- 0x0c7f, 0x0078, 0x4936, 0x2c78, 0x600c, 0x2060, 0x0078, 0x4936,
- 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c,
- 0x601c, 0xa086, 0x0006, 0x00c0, 0x4999, 0x1078, 0x74a8, 0x0078,
- 0x49a4, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x7720,
- 0x2004, 0xa065, 0x0040, 0x4a54, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e,
- 0x2071, 0x7836, 0x6654, 0x7018, 0xac06, 0x00c0, 0x49d8, 0x761a,
- 0x701c, 0xac06, 0x00c0, 0x49e4, 0x86ff, 0x00c0, 0x49e3, 0x7018,
- 0x701e, 0x0078, 0x49e4, 0x761e, 0x6058, 0xa07d, 0x0040, 0x49e9,
- 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x49ef, 0x2f00, 0x685a, 0x6057,
- 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078,
- 0x3754, 0x0040, 0x4a50, 0x7624, 0x86ff, 0x0040, 0x4a40, 0xa680,
- 0x0004, 0x2004, 0xad06, 0x00c0, 0x4a40, 0x0d7e, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x4a37, 0x1078, 0x5534, 0x68c3, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x4a20, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4a28, 0x6827, 0x0001,
- 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4a31, 0x8001,
- 0x603e, 0x2660, 0x1078, 0x6a4c, 0x0c7f, 0x0078, 0x4a40, 0x0d7f,
- 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x49f7,
- 0x8dff, 0x0040, 0x4a4c, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x1078, 0x58b4, 0x0078, 0x49f7,
- 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c,
- 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065,
- 0x0040, 0x4ab0, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06,
- 0x00c0, 0x4a95, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4a8f,
- 0x1078, 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7827, 0x0000,
- 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4a84,
+ 0x4001, 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x1286, 0x1079,
+ 0x4002, 0x007c, 0x4008, 0x4009, 0x4008, 0x4008, 0x4045, 0x4054,
+ 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4044, 0x700c, 0x1078, 0x1fb0,
+ 0x1078, 0x3460, 0x00c0, 0x4044, 0x6204, 0xa294, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x00c0, 0x402d, 0x0c7e, 0x1078, 0x553b, 0x017f,
+ 0x0040, 0x4044, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009,
+ 0x0088, 0x1078, 0x55c8, 0x0078, 0x4044, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x4044, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0xa286, 0x0004, 0x00c0, 0x4040, 0x2009, 0x0005, 0x0078, 0x4042,
+ 0x2009, 0x0001, 0x1078, 0x55c8, 0x007c, 0x7110, 0xd1bc, 0x0040,
+ 0x4053, 0x1078, 0x4063, 0x0040, 0x4053, 0x7124, 0x610a, 0x2009,
+ 0x0089, 0x1078, 0x55c8, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4062,
+ 0x1078, 0x4063, 0x0040, 0x4062, 0x7124, 0x610a, 0x2009, 0x008a,
+ 0x1078, 0x55c8, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0,
+ 0x4076, 0xac82, 0x7500, 0x0048, 0x4076, 0x2001, 0x6f15, 0x2004,
+ 0xac02, 0x00c8, 0x4076, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078,
+ 0x4075, 0x2071, 0x70c9, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006,
+ 0x701a, 0x7012, 0x7017, 0x7500, 0x7007, 0x0000, 0x7026, 0x702b,
+ 0x4f52, 0x7032, 0x7037, 0x4f9e, 0x703b, 0x0002, 0x703f, 0x0000,
+ 0x007c, 0x2071, 0x70c9, 0x00e0, 0x4140, 0x2091, 0x6000, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x4109, 0x700f, 0x0361, 0x7007, 0x0001,
+ 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x4107,
+ 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8,
+ 0x4107, 0x703c, 0xa086, 0x0001, 0x00c0, 0x40e4, 0x0d7e, 0x2069,
+ 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x40c2, 0x6803, 0x1000,
+ 0x0078, 0x40c9, 0x6804, 0xa084, 0x1000, 0x0040, 0x40c9, 0x6803,
+ 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x70b6, 0x6804,
+ 0xa082, 0x0006, 0x00c0, 0x40d6, 0x6807, 0x0000, 0x6830, 0xa082,
+ 0x0003, 0x00c0, 0x40dd, 0x6833, 0x0000, 0x1078, 0x484d, 0x1078,
+ 0x48fd, 0x0d7f, 0x0078, 0x4107, 0x0d7e, 0x2069, 0x6f00, 0x6944,
+ 0x6860, 0xa102, 0x00c8, 0x4106, 0x2069, 0x70b6, 0x6804, 0xa086,
+ 0x0000, 0x00c0, 0x4106, 0x6830, 0xa086, 0x0000, 0x00c0, 0x4106,
+ 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100,
+ 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078,
+ 0x410c, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x411d,
+ 0x7020, 0x8001, 0x7022, 0x00c0, 0x411d, 0x7023, 0x0009, 0x8109,
+ 0x7126, 0x00c0, 0x411d, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040,
+ 0x412e, 0x702c, 0x8001, 0x702e, 0x00c0, 0x412e, 0x702f, 0x0009,
+ 0x8109, 0x7132, 0x00c0, 0x412e, 0x7034, 0x107a, 0x7018, 0xa00d,
+ 0x0040, 0x413f, 0x7008, 0x8001, 0x700a, 0x00c0, 0x413f, 0x700b,
+ 0x0009, 0x8109, 0x711a, 0x00c0, 0x413f, 0x701c, 0x107a, 0x127f,
+ 0x7004, 0x0079, 0x4143, 0x416a, 0x416b, 0x4187, 0x0e7e, 0x2071,
+ 0x70c9, 0x7018, 0xa005, 0x00c0, 0x4151, 0x711a, 0x721e, 0x700b,
+ 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x70c9, 0x701c,
+ 0xa206, 0x00c0, 0x415d, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c,
+ 0x0e7e, 0x2071, 0x70c9, 0x6088, 0xa102, 0x0048, 0x4168, 0x618a,
+ 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x3497, 0x00c0, 0x417d,
+ 0x6088, 0x8001, 0x0048, 0x417d, 0x608a, 0x00c0, 0x417d, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x8108, 0xa182, 0x007e,
+ 0x0048, 0x4185, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014,
+ 0x2060, 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x41b6,
+ 0x8001, 0x6016, 0x00c0, 0x41b6, 0x611c, 0xa186, 0x0003, 0x0040,
+ 0x419d, 0xa186, 0x0006, 0x00c0, 0x41b4, 0x6010, 0x2068, 0x6854,
+ 0xa08a, 0x199a, 0x0048, 0x41b4, 0xa082, 0x1999, 0x6856, 0xa08a,
+ 0x199a, 0x0048, 0x41ad, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
+ 0xa108, 0x6116, 0x0078, 0x41b6, 0x1078, 0x6070, 0x127f, 0xac88,
+ 0x0008, 0x7116, 0x2001, 0x6f16, 0x2004, 0xa102, 0x0048, 0x41c4,
+ 0x7017, 0x7500, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9,
+ 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c,
+ 0x2001, 0x70d2, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9,
+ 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x70d5,
+ 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x711a, 0x721e,
+ 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x715a, 0x0c7f,
+ 0x007c, 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x715a,
+ 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4201, 0x2001,
+ 0x1999, 0xa005, 0x00c0, 0x4211, 0x6944, 0x0c7e, 0x1078, 0x41f1,
+ 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x4216, 0x2001, 0x001e, 0x0078,
+ 0x4216, 0xa08e, 0xffff, 0x00c0, 0x4216, 0xa006, 0x8003, 0x800b,
+ 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0,
+ 0x0040, 0x4251, 0xd0b4, 0x00c0, 0x422d, 0xd0bc, 0x00c0, 0x423f,
+ 0x2009, 0x0006, 0x1078, 0x4274, 0x007c, 0xd0fc, 0x0040, 0x423a,
+ 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x426d, 0xa08e, 0x0000,
+ 0x00c0, 0x426d, 0x2009, 0x0043, 0x1078, 0x55c8, 0x007c, 0xd0fc,
+ 0x0040, 0x424c, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x426d,
+ 0xa08e, 0x0000, 0x00c0, 0x426d, 0x2009, 0x0042, 0x1078, 0x55c8,
+ 0x007c, 0xd0fc, 0x0040, 0x4263, 0xa084, 0x0003, 0xa08e, 0x0003,
+ 0x0040, 0x426d, 0xa08e, 0x0002, 0x0040, 0x4267, 0x2009, 0x0041,
+ 0x1078, 0x55c8, 0x007c, 0x1078, 0x4272, 0x0078, 0x4262, 0x2009,
+ 0x0043, 0x1078, 0x55c8, 0x0078, 0x4262, 0x2009, 0x0004, 0x1078,
+ 0x4274, 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040,
+ 0x4298, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
+ 0x4292, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x4292,
+ 0x0c7e, 0x6944, 0x1078, 0x41f1, 0x6204, 0x8210, 0x0048, 0x4291,
+ 0x6206, 0x0c7f, 0x1078, 0x36ec, 0x6010, 0xa06d, 0x10c0, 0x41fa,
+ 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x715a, 0x6000,
+ 0x81ff, 0x0040, 0x42a6, 0xa205, 0x0078, 0x42a7, 0xa204, 0x6002,
+ 0xace0, 0x0008, 0x00f0, 0x429f, 0x0c7f, 0x157f, 0x007c, 0x6808,
+ 0xa005, 0x0040, 0x42b7, 0x8001, 0x680a, 0xa085, 0x0001, 0x007c,
+ 0x127e, 0x2091, 0x2200, 0x2079, 0x70b6, 0x127f, 0x0d7e, 0x2069,
+ 0x70b6, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001,
+ 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084,
+ 0x0007, 0x0079, 0x42d3, 0x42dd, 0x4302, 0x4351, 0x42e3, 0x4302,
+ 0x42db, 0x42db, 0x42db, 0x1078, 0x1286, 0x1078, 0x41d0, 0x1078,
+ 0x484d, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x42e9, 0x0c7f,
+ 0x007c, 0x2011, 0x31bc, 0x1078, 0x4153, 0x7828, 0xa092, 0x0002,
+ 0x00c8, 0x42f8, 0x8000, 0x782a, 0x1078, 0x31ec, 0x0078, 0x42e7,
+ 0x1078, 0x31bc, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
+ 0x0078, 0x42e7, 0x1078, 0x41d0, 0x62c0, 0x82ff, 0x00c0, 0x4314,
+ 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1286, 0x2009, 0x0013,
+ 0x1078, 0x55c8, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x71fa, 0x00c8,
+ 0x431b, 0x1078, 0x54cb, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x1286,
+ 0x7804, 0xa086, 0x0004, 0x0040, 0x4396, 0x7828, 0xa092, 0x2710,
+ 0x00c8, 0x4331, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x4f37, 0x0078,
+ 0x4312, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4348, 0x0e7e, 0x2071,
+ 0x6f00, 0x70b4, 0x0e7f, 0xd08c, 0x0040, 0x4348, 0x0c7e, 0x0e7e,
+ 0x2061, 0x0100, 0x2071, 0x6f00, 0x1078, 0x31f5, 0x0e7f, 0x0c7f,
+ 0x1078, 0x6e16, 0x2009, 0x0014, 0x1078, 0x55c8, 0x0c7f, 0x0078,
+ 0x4312, 0x2001, 0x70d2, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0,
+ 0x4365, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1286, 0x2009,
+ 0x0013, 0x1078, 0x5615, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900,
+ 0xa082, 0x71fa, 0x00c8, 0x436e, 0x1078, 0x54cb, 0x7824, 0xa005,
+ 0x1040, 0x1286, 0x781c, 0xa06d, 0x1040, 0x1286, 0x6800, 0xc0dc,
+ 0x6802, 0x7924, 0x2160, 0x1078, 0x55a1, 0x693c, 0x81ff, 0x1040,
+ 0x1286, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x438a, 0x7a1e,
+ 0x0078, 0x438c, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000,
+ 0x0d7f, 0x0c7f, 0x1078, 0x484d, 0x0078, 0x4363, 0x6104, 0xa186,
+ 0x0002, 0x0040, 0x43a1, 0xa186, 0x0004, 0x0040, 0x43a1, 0x0078,
+ 0x4325, 0x7808, 0xac06, 0x0040, 0x4325, 0x1078, 0x4754, 0x1078,
+ 0x4445, 0x0c7f, 0x1078, 0x484d, 0x0078, 0x4312, 0x0c7e, 0x6027,
+ 0x0002, 0x2011, 0x70d5, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0,
+ 0x43c8, 0x62c4, 0x82ff, 0x00c0, 0x43c8, 0x793c, 0xa1e5, 0x0000,
+ 0x0040, 0x43c6, 0x2009, 0x0049, 0x1078, 0x55c8, 0x0c7f, 0x007c,
+ 0x3908, 0xa192, 0x71fa, 0x00c8, 0x43cf, 0x1078, 0x54cb, 0x6017,
+ 0x0010, 0x793c, 0x81ff, 0x0040, 0x43c6, 0x7944, 0xa192, 0x2710,
+ 0x00c8, 0x43ee, 0x8108, 0x7946, 0x1078, 0x41d5, 0x793c, 0xa188,
+ 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x43ea, 0x6017, 0x0012,
+ 0x0078, 0x43c6, 0x6017, 0x0016, 0x0078, 0x43c6, 0x1078, 0x6e16,
+ 0x793c, 0x2160, 0x2009, 0x004a, 0x1078, 0x55c8, 0x0078, 0x43c6,
+ 0x007e, 0x017e, 0x0c7e, 0x127e, 0x600f, 0x0000, 0x2c08, 0x2061,
+ 0x70b6, 0x2091, 0x8000, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005,
+ 0x0040, 0x4413, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f,
+ 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x440e, 0x0d7e,
+ 0x2069, 0x70b6, 0x6000, 0xd0d4, 0x0040, 0x442c, 0x6820, 0x8000,
+ 0x6822, 0xa086, 0x0001, 0x00c0, 0x4427, 0x2c00, 0x681e, 0x6804,
+ 0xa084, 0x0007, 0x0079, 0x4855, 0xc0d5, 0x6002, 0x6818, 0xa005,
+ 0x0040, 0x443e, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a,
+ 0x0d7f, 0x685a, 0x2069, 0x70b6, 0x0078, 0x441e, 0x6056, 0x605a,
+ 0x2c00, 0x681a, 0x681e, 0x0078, 0x441e, 0x007e, 0x017e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6,
+ 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x4460, 0xa080,
+ 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c,
+ 0x610e, 0x610a, 0x0078, 0x445b, 0x0c7e, 0x600f, 0x0000, 0x2c08,
+ 0x2061, 0x70b6, 0x6034, 0xa005, 0x0040, 0x4474, 0xa080, 0x0003,
+ 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x4472,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
+ 0x2071, 0x70b6, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
+ 0x0040, 0x44da, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x44d5, 0x703c, 0xac06, 0x00c0, 0x449a, 0x6003, 0x000a, 0x630a,
+ 0x0078, 0x44d5, 0x7038, 0xac36, 0x00c0, 0x44a0, 0x660c, 0x763a,
+ 0x7034, 0xac36, 0x00c0, 0x44ae, 0x2c00, 0xaf36, 0x0040, 0x44ac,
+ 0x2f00, 0x7036, 0x0078, 0x44ae, 0x7037, 0x0000, 0x660c, 0x067e,
+ 0x2c00, 0xaf06, 0x0040, 0x44b7, 0x7e0e, 0x0078, 0x44b8, 0x2678,
+ 0x600f, 0x0000, 0x1078, 0x61dc, 0x0040, 0x44d0, 0x6010, 0x2068,
+ 0x601c, 0xa086, 0x0003, 0x00c0, 0x44e3, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x639b, 0x1078, 0x36ec, 0x1078, 0x62f0,
+ 0x1078, 0x62fd, 0x0c7f, 0x0078, 0x4487, 0x2c78, 0x600c, 0x2060,
+ 0x0078, 0x4487, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x44c5,
+ 0x1078, 0x6d4c, 0x0078, 0x44d0, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
+ 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x70b6,
+ 0x7838, 0xa065, 0x0040, 0x4523, 0x600c, 0x007e, 0x600f, 0x0000,
+ 0x783c, 0xac06, 0x00c0, 0x450a, 0x6003, 0x000a, 0x630a, 0x2c30,
+ 0x0078, 0x4520, 0x1078, 0x61dc, 0x0040, 0x451e, 0x6010, 0x2068,
+ 0x601c, 0xa086, 0x0003, 0x00c0, 0x452c, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x1078, 0x62fd,
+ 0x007f, 0x0078, 0x44f9, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f,
+ 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0,
+ 0x4515, 0x1078, 0x6d4c, 0x0078, 0x451e, 0x027e, 0x1078, 0x4549,
+ 0x1078, 0x45e2, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x70b6,
+ 0x2091, 0x8000, 0x1078, 0x4679, 0x1078, 0x46e1, 0x127f, 0x0f7f,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x45d1, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x45cc, 0x7024, 0xac06, 0x00c0, 0x458f, 0x2069, 0x0100, 0x68c0,
+ 0xa005, 0x0040, 0x458a, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
+ 0x1000, 0x0040, 0x457f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
+ 0x0100, 0x6824, 0xd084, 0x0040, 0x4587, 0x6827, 0x0001, 0x037f,
+ 0x0078, 0x458f, 0x6003, 0x0009, 0x630a, 0x0078, 0x45cc, 0x7014,
+ 0xac36, 0x00c0, 0x4595, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0,
+ 0x45a3, 0x2c00, 0xaf36, 0x0040, 0x45a1, 0x2f00, 0x7012, 0x0078,
+ 0x45a3, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x45ac, 0x7e0e, 0x0078, 0x45ad, 0x2678, 0x600f, 0x0000, 0x6010,
+ 0x2068, 0x1078, 0x61dc, 0x0040, 0x45c5, 0x601c, 0xa086, 0x0003,
+ 0x00c0, 0x45d9, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x639b, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x1078, 0x62fd, 0x1078,
+ 0x52a1, 0x0c7f, 0x0078, 0x4557, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x4557, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x45ba, 0x1078, 0x6d4c,
+ 0x0078, 0x45c5, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280,
+ 0x7020, 0x2004, 0xa065, 0x0040, 0x4675, 0x0f7e, 0x0e7e, 0x0d7e,
+ 0x067e, 0x2071, 0x70b6, 0x6654, 0x7018, 0xac06, 0x00c0, 0x45f9,
+ 0x761a, 0x701c, 0xac06, 0x00c0, 0x4605, 0x86ff, 0x00c0, 0x4604,
+ 0x7018, 0x701e, 0x0078, 0x4605, 0x761e, 0x6058, 0xa07d, 0x0040,
+ 0x460a, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x4610, 0x2f00, 0x685a,
+ 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002,
+ 0x1078, 0x3414, 0x0040, 0x4671, 0x7624, 0x86ff, 0x0040, 0x4661,
+ 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4661, 0x0d7e, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4658, 0x1078, 0x4f45, 0x68c3,
+ 0x0000, 0x1078, 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4641, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4649, 0x6827,
+ 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4652,
+ 0x8001, 0x603e, 0x2660, 0x1078, 0x62fd, 0x0c7f, 0x0078, 0x4661,
+ 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078,
+ 0x4618, 0x8dff, 0x0040, 0x466d, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x639b, 0x1078, 0x36ec, 0x1078, 0x52a1, 0x0078,
+ 0x4618, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f,
+ 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814,
+ 0xa065, 0x0040, 0x46d1, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824,
+ 0xac06, 0x00c0, 0x46b6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x46b0, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7827,
+ 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
+ 0x46a5, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+ 0xd084, 0x0040, 0x46ad, 0x6827, 0x0001, 0x037f, 0x0078, 0x46b6,
+ 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x46ce, 0x6010, 0x2068,
+ 0x1078, 0x61dc, 0x0040, 0x46ca, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x46d8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec,
+ 0x1078, 0x62f0, 0x1078, 0x62fd, 0x1078, 0x52a1, 0x007f, 0x0078,
+ 0x4680, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c,
+ 0x601c, 0xa086, 0x0006, 0x00c0, 0x46c1, 0x1078, 0x6d4c, 0x0078,
+ 0x46ca, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040,
+ 0x474d, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
+ 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3414, 0x0040, 0x474a, 0x7e24,
+ 0x86ff, 0x0040, 0x473c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
+ 0x473c, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4733,
+ 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7827, 0x0000,
+ 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x471c,
0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
- 0x0040, 0x4a8c, 0x6827, 0x0001, 0x037f, 0x0078, 0x4a95, 0x6003,
- 0x0009, 0x630a, 0x2c30, 0x0078, 0x4aad, 0x6010, 0x2068, 0x1078,
- 0x68e3, 0x0040, 0x4aa9, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4ab7,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x007f, 0x0078, 0x4a5f,
- 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4aa0, 0x1078, 0x74a8, 0x0078, 0x4aa9,
- 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4b2c,
- 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4,
- 0xc0dc, 0x6002, 0x1078, 0x3754, 0x0040, 0x4b29, 0x7e24, 0x86ff,
- 0x0040, 0x4b1b, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4b1b,
- 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4b12, 0x1078,
- 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7827, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4afb, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x4b03, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005,
- 0x0040, 0x4b0c, 0x8001, 0x603e, 0x2660, 0x1078, 0x6a4c, 0x0c7f,
- 0x0078, 0x4b1b, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a,
- 0x0c7f, 0x0078, 0x4ad2, 0x8dff, 0x0040, 0x4b25, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x58b4, 0x0078,
- 0x4ad2, 0x007f, 0x0078, 0x4ac5, 0x781e, 0x781a, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x7836, 0x7004,
- 0xa084, 0x0007, 0x0079, 0x4b3c, 0x4b46, 0x4b49, 0x4b62, 0x4b7e,
- 0x4bc3, 0x4b46, 0x4b46, 0x4b44, 0x1078, 0x12d5, 0x0c7f, 0x0e7f,
- 0x007c, 0x7024, 0xa065, 0x0040, 0x4b57, 0x7020, 0x8001, 0x7022,
- 0x600c, 0xa015, 0x0040, 0x4b5e, 0x7216, 0x600f, 0x0000, 0x7007,
- 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212,
- 0x0078, 0x4b57, 0x6018, 0x2060, 0x1078, 0x3754, 0x6000, 0xc0dc,
- 0x6002, 0x7020, 0x8001, 0x7022, 0x0040, 0x4b73, 0x6054, 0xa015,
- 0x0040, 0x4b7a, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078, 0x4b73, 0x7024, 0xa065,
- 0x0040, 0x4bc0, 0x700c, 0xac06, 0x00c0, 0x4b95, 0x1078, 0x58b4,
- 0x600c, 0xa015, 0x0040, 0x4b91, 0x720e, 0x600f, 0x0000, 0x0078,
- 0x4bbe, 0x720e, 0x720a, 0x0078, 0x4bbe, 0x7014, 0xac06, 0x00c0,
- 0x4ba8, 0x1078, 0x58b4, 0x600c, 0xa015, 0x0040, 0x4ba4, 0x7216,
- 0x600f, 0x0000, 0x0078, 0x4bbe, 0x7216, 0x7212, 0x0078, 0x4bbe,
- 0x6018, 0x2060, 0x1078, 0x3754, 0x6000, 0xc0dc, 0x6002, 0x1078,
- 0x58b4, 0x701c, 0xa065, 0x0040, 0x4bbe, 0x6054, 0xa015, 0x0040,
- 0x4bbc, 0x721e, 0x0078, 0x4bbe, 0x7218, 0x721e, 0x7027, 0x0000,
- 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4bd0, 0x1078,
- 0x58b4, 0x600c, 0xa015, 0x0040, 0x4bd7, 0x720e, 0x600f, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e,
- 0x720a, 0x0078, 0x4bd0, 0x0d7e, 0x2069, 0x7836, 0x6830, 0xa084,
- 0x0003, 0x0079, 0x4be3, 0x4be9, 0x4beb, 0x4c11, 0x4be9, 0x1078,
- 0x12d5, 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040,
- 0x4c07, 0x683c, 0xa065, 0x0040, 0x4bfc, 0x600c, 0xa015, 0x0040,
- 0x4c03, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000,
- 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x4bfc, 0x6843,
- 0x0000, 0x6838, 0xa065, 0x0040, 0x4bfc, 0x6003, 0x0003, 0x0078,
- 0x4bfc, 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065,
- 0x0040, 0x4c29, 0x600c, 0xa015, 0x0040, 0x4c25, 0x6a3a, 0x600f,
- 0x0000, 0x683f, 0x0000, 0x0078, 0x4c29, 0x683f, 0x0000, 0x683a,
- 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x7836, 0x6804,
- 0xa084, 0x0007, 0x0079, 0x4c34, 0x4c3e, 0x4cdb, 0x4cdb, 0x4cdb,
- 0x4cdb, 0x4cdd, 0x4cdb, 0x4c3c, 0x1078, 0x12d5, 0x6820, 0xa005,
- 0x00c0, 0x4c44, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
- 0x4c53, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d23,
- 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4c61, 0x6807,
- 0x0001, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d23, 0x0c7f, 0x0d7f,
- 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x4cd6,
- 0x704c, 0xa00d, 0x0040, 0x4c70, 0x7088, 0xa005, 0x0040, 0x4c88,
- 0x7054, 0xa075, 0x0040, 0x4c79, 0xa20e, 0x0040, 0x4cd6, 0x0078,
- 0x4c7e, 0x6818, 0xa20e, 0x0040, 0x4cd6, 0x2070, 0x704c, 0xa00d,
- 0x0040, 0x4c70, 0x7088, 0xa005, 0x00c0, 0x4c70, 0x2e00, 0x681e,
- 0x733c, 0x7038, 0xa302, 0x00c8, 0x4c70, 0x1078, 0x5b83, 0x0040,
- 0x4cd6, 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015,
- 0x2004, 0xa08a, 0x199a, 0x0048, 0x4c9f, 0x2001, 0x1999, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0,
- 0xd1bc, 0x0040, 0x4cb8, 0x7100, 0xd1f4, 0x0040, 0x4cb4, 0x7114,
- 0xa18c, 0x00ff, 0x0078, 0x4cbd, 0x2009, 0x0000, 0x0078, 0x4cbd,
- 0xa1e0, 0x2303, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a,
- 0x1078, 0x5174, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18,
- 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807,
- 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f,
- 0x0c7f, 0x0078, 0x4cd4, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065,
- 0x0040, 0x4ce9, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078,
- 0x4d23, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x7836,
- 0x6830, 0xa086, 0x0000, 0x00c0, 0x4d0a, 0x6838, 0xa07d, 0x0040,
- 0x4d0a, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e,
- 0x2091, 0x2200, 0x027f, 0x1078, 0x1a24, 0x00c0, 0x4d0d, 0x127f,
- 0x1078, 0x5409, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000,
- 0x7803, 0x0002, 0x780c, 0xa015, 0x0040, 0x4d1f, 0x6a3a, 0x780f,
- 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x4d0a, 0x683a,
- 0x6836, 0x0078, 0x4d19, 0x601c, 0xa084, 0x000f, 0x1079, 0x4d29,
- 0x007c, 0x4d32, 0x4d37, 0x503e, 0x5134, 0x4d37, 0x503e, 0x5134,
- 0x4d32, 0x4d37, 0x1078, 0x4b33, 0x1078, 0x4c2c, 0x007c, 0x157e,
- 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8,
- 0x12d5, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x4d54, 0x7900,
- 0xd1f4, 0x0040, 0x4d50, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x4d59,
- 0x2009, 0x0000, 0x0078, 0x4d59, 0xa1f8, 0x2303, 0x2f0c, 0xa18c,
- 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079, 0x4d65, 0x0f7f,
- 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x4d97, 0x4dcf, 0x4de7,
- 0x4e66, 0x4e93, 0x4e9b, 0x4ebc, 0x4ecd, 0x4ede, 0x4ee6, 0x4ef7,
- 0x4ee6, 0x4f3f, 0x4ecd, 0x4f60, 0x4f68, 0x4ede, 0x4f68, 0x4f79,
- 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95,
- 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x55f2, 0x5607, 0x562a, 0x564e,
- 0x4ebc, 0x4d95, 0x4ebc, 0x4ee6, 0x4d95, 0x4de7, 0x4e66, 0x4d95,
- 0x5afe, 0x4ee6, 0x4d95, 0x5b21, 0x4ee6, 0x1078, 0x12d5, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e,
- 0x2069, 0x7651, 0x6804, 0xd084, 0x0040, 0x4db1, 0x6828, 0x20a3,
- 0x0000, 0x017e, 0x1078, 0x206e, 0x21a2, 0x017f, 0x0d7f, 0x0078,
- 0x4db6, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004,
- 0x2099, 0x7605, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7601, 0x53a6,
- 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5520, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099,
- 0x7605, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x5520, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086,
- 0x007e, 0x00c0, 0x4dfa, 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e,
- 0x0078, 0x4dfc, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4e35, 0x2099, 0x7820,
- 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304, 0xa084, 0x3fff, 0x20a2,
- 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7601, 0x53a6, 0x20a9, 0x0010, 0x20a3, 0x0000,
- 0x00f0, 0x4e26, 0x2099, 0x7828, 0x33a6, 0x20a9, 0x0007, 0x20a3,
- 0x0000, 0x00f0, 0x4e2f, 0x0078, 0x4e55, 0x2099, 0x7820, 0x20a9,
- 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7601, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
- 0x00f0, 0x4e46, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4e4c,
- 0x2099, 0x7828, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3,
- 0x0000, 0x00f0, 0x4e57, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0,
- 0x4e5d, 0x60c3, 0x0074, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4f8e, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800,
- 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x0f7e, 0x2079, 0x7651, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4e82,
- 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4e87, 0xa085, 0x0010, 0xa085,
- 0x0002, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3,
- 0x5000, 0x0078, 0x4dfc, 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3,
- 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5005,
- 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0004, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
- 0x2a00, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x5005, 0x20a3, 0x0200, 0x0078, 0x4dfc, 0x20a1, 0x020b,
- 0x1078, 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003,
- 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3, 0x0014,
- 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0,
- 0x4f1d, 0x6998, 0xa184, 0xc000, 0x00c0, 0x4f19, 0xd1ec, 0x0040,
- 0x4f15, 0x20a3, 0x2100, 0x0078, 0x4f1f, 0x20a3, 0x0100, 0x0078,
- 0x4f1f, 0x20a3, 0x0400, 0x0078, 0x4f1f, 0x20a3, 0x0700, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7651,
- 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4f2f, 0xa085, 0x0020, 0xd1a4,
- 0x0040, 0x4f34, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2,
- 0x20a2, 0x60c3, 0x0014, 0x1078, 0x5520, 0x0d7f, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5520, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x0078, 0x4d9d,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x5520,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078,
- 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
- 0x0000, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286,
- 0x007e, 0x00c0, 0x4fa1, 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078,
- 0x4fcf, 0xa286, 0x007f, 0x00c0, 0x4fac, 0x0d7e, 0x20a3, 0x22ff,
- 0x20a3, 0xfffd, 0x0078, 0x4fc3, 0xd2bc, 0x0040, 0x4fcb, 0xa286,
- 0x0080, 0x0d7e, 0x00c0, 0x4fba, 0x20a3, 0x22ff, 0x20a3, 0xfffc,
- 0x0078, 0x4fc3, 0xa2e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x2200,
- 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6,
- 0x0d7f, 0x0078, 0x4fd3, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078,
- 0x550f, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e,
- 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029,
- 0x20a3, 0x0000, 0x0078, 0x4fd7, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0xfc02, 0x20a3, 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e,
- 0x0048, 0x5024, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085,
- 0x2300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x502c, 0x20a3, 0x2300, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000,
- 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e,
- 0x6004, 0xa08a, 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8,
- 0x12d5, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x505c, 0x7900,
- 0xd1f4, 0x0040, 0x5058, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x5061,
- 0x2009, 0x0000, 0x0078, 0x5061, 0xa1f8, 0x2303, 0x2f0c, 0xa18c,
- 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x1079,
- 0x506c, 0x0f7f, 0x0c7f, 0x007c, 0x5075, 0x5080, 0x509a, 0x5073,
- 0x5073, 0x5073, 0x5075, 0x1078, 0x12d5, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x50ad, 0x60c3, 0x0000, 0x1078, 0x5520, 0x147f, 0x007c,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x50da, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x5520,
- 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x5107, 0x20a3,
- 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0004, 0x1078, 0x5520, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e,
- 0x0048, 0x50cc, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085,
- 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x50d4, 0x20a3, 0x8100, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000,
- 0x0078, 0x4fd7, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x50f9, 0x0d7e,
- 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814,
- 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
- 0x5101, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x5030, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
- 0xa092, 0x007e, 0x0048, 0x5126, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c,
- 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619,
- 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x512e, 0x20a3, 0x8500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1,
- 0x20a3, 0x0000, 0x0078, 0x5030, 0x0c7e, 0x0f7e, 0x2c78, 0x7804,
- 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5,
- 0x7918, 0x2160, 0x61a0, 0xd1bc, 0x0040, 0x5153, 0x6100, 0xd1f4,
- 0x0040, 0x514f, 0x6114, 0xa18c, 0x00ff, 0x0078, 0x5158, 0x2009,
- 0x0000, 0x0078, 0x5158, 0xa1e0, 0x2303, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x5162, 0x0f7f,
- 0x0c7f, 0x007c, 0x5174, 0x525c, 0x5204, 0x5384, 0x5172, 0x5172,
- 0x5172, 0x5172, 0x5172, 0x5172, 0x5172, 0x57cd, 0x57de, 0x57ef,
- 0x5800, 0x5172, 0x1078, 0x12d5, 0x0d7e, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x51c7, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
- 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006,
- 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x5191, 0x20a3, 0x0002, 0x0078,
- 0x519d, 0xd1b4, 0x0040, 0x5198, 0x20a3, 0x0001, 0x0078, 0x519d,
- 0x20a3, 0x0000, 0x2230, 0x0078, 0x519f, 0x6a80, 0x6e7c, 0x20a9,
- 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0,
- 0x51a3, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
- 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x7852, 0x2003,
- 0x07d0, 0x2001, 0x7851, 0x2003, 0x0009, 0x2001, 0x7857, 0x2003,
- 0x0002, 0x1078, 0x1504, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004,
- 0xd0bc, 0x0040, 0x51ed, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810,
- 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6,
- 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x51f5, 0x20a3, 0x0600, 0x6198,
- 0x21a2, 0x20a3, 0x0000, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a3,
- 0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x5224, 0x7810, 0x2068, 0x6860, 0x20a2,
- 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078, 0x5520, 0x147f,
- 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x5242,
- 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x524a, 0x20a3, 0x0500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078, 0x550f,
- 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x534c, 0x7810, 0x2068, 0xa016, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000, 0x00c0,
- 0x5279, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x5281, 0x0078,
- 0x527c, 0xa006, 0x1079, 0x5281, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x528b, 0x52ed, 0x52f1, 0x5314, 0x5321, 0x5333, 0x5337,
- 0x5289, 0x1078, 0x12d5, 0x017e, 0x037e, 0x694c, 0xa18c, 0x0003,
- 0xa186, 0x0000, 0x00c0, 0x529e, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x5318, 0xa186, 0x0001,
- 0x00c0, 0x52e8, 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2,
- 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018,
- 0xa384, 0x0300, 0x0040, 0x52e7, 0xd3c4, 0x0040, 0x52b9, 0x687c,
- 0xa108, 0xd3cc, 0x0040, 0x52be, 0x6874, 0xa108, 0x157e, 0x20a9,
- 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0,
- 0x52c3, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040,
- 0x52e7, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0898, 0x20a2, 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000, 0x61c2,
- 0x037f, 0x017f, 0x1078, 0x5520, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x5316, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012,
- 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3,
- 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2,
- 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
- 0x0032, 0x1078, 0x5520, 0x007c, 0x20a3, 0x0028, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078, 0x5520,
- 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0020,
- 0x1078, 0x5520, 0x007c, 0x20a3, 0x0008, 0x0078, 0x5316, 0x037e,
- 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0,
- 0x5345, 0x22a2, 0x037f, 0x0078, 0x5316, 0x20a3, 0x0800, 0x22a2,
- 0x20a2, 0x037f, 0x0078, 0x5318, 0x027e, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x536a,
- 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x5372, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078, 0x550f,
+ 0x0040, 0x4724, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
+ 0xa005, 0x0040, 0x472d, 0x8001, 0x603e, 0x2660, 0x1078, 0x62fd,
+ 0x0c7f, 0x0078, 0x473c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
+ 0x630a, 0x0c7f, 0x0078, 0x46f3, 0x8dff, 0x0040, 0x4746, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x52a1,
+ 0x0078, 0x46f3, 0x007f, 0x0078, 0x46e6, 0x781e, 0x781a, 0x0d7f,
+ 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x70b6,
+ 0x7004, 0xa084, 0x0007, 0x0079, 0x475d, 0x4767, 0x476a, 0x4783,
+ 0x479f, 0x47e4, 0x4767, 0x4767, 0x4765, 0x1078, 0x1286, 0x0c7f,
+ 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4778, 0x7020, 0x8001,
+ 0x7022, 0x600c, 0xa015, 0x0040, 0x477f, 0x7216, 0x600f, 0x0000,
+ 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216,
+ 0x7212, 0x0078, 0x4778, 0x6018, 0x2060, 0x1078, 0x3414, 0x6000,
+ 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0040, 0x4794, 0x6054,
+ 0xa015, 0x0040, 0x479b, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000,
+ 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078, 0x4794, 0x7024,
+ 0xa065, 0x0040, 0x47e1, 0x700c, 0xac06, 0x00c0, 0x47b6, 0x1078,
+ 0x52a1, 0x600c, 0xa015, 0x0040, 0x47b2, 0x720e, 0x600f, 0x0000,
+ 0x0078, 0x47df, 0x720e, 0x720a, 0x0078, 0x47df, 0x7014, 0xac06,
+ 0x00c0, 0x47c9, 0x1078, 0x52a1, 0x600c, 0xa015, 0x0040, 0x47c5,
+ 0x7216, 0x600f, 0x0000, 0x0078, 0x47df, 0x7216, 0x7212, 0x0078,
+ 0x47df, 0x6018, 0x2060, 0x1078, 0x3414, 0x6000, 0xc0dc, 0x6002,
+ 0x1078, 0x52a1, 0x701c, 0xa065, 0x0040, 0x47df, 0x6054, 0xa015,
+ 0x0040, 0x47dd, 0x721e, 0x0078, 0x47df, 0x7218, 0x721e, 0x7027,
+ 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x47f1,
+ 0x1078, 0x52a1, 0x600c, 0xa015, 0x0040, 0x47f8, 0x720e, 0x600f,
+ 0x0000, 0x1078, 0x53d1, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
+ 0x720e, 0x720a, 0x0078, 0x47f1, 0x0d7e, 0x2069, 0x70b6, 0x6830,
+ 0xa084, 0x0003, 0x0079, 0x4804, 0x480a, 0x480c, 0x4832, 0x480a,
+ 0x1078, 0x1286, 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001,
+ 0x0040, 0x4828, 0x683c, 0xa065, 0x0040, 0x481d, 0x600c, 0xa015,
+ 0x0040, 0x4824, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f,
+ 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x481d,
+ 0x6843, 0x0000, 0x6838, 0xa065, 0x0040, 0x481d, 0x6003, 0x0003,
+ 0x0078, 0x481d, 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c,
+ 0xa065, 0x0040, 0x484a, 0x600c, 0xa015, 0x0040, 0x4846, 0x6a3a,
+ 0x600f, 0x0000, 0x683f, 0x0000, 0x0078, 0x484a, 0x683f, 0x0000,
+ 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x70b6,
+ 0x6804, 0xa084, 0x0007, 0x0079, 0x4855, 0x485f, 0x48ec, 0x48ec,
+ 0x48ec, 0x48ec, 0x48ee, 0x48ec, 0x485d, 0x1078, 0x1286, 0x6820,
+ 0xa005, 0x00c0, 0x4865, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065,
+ 0x0040, 0x4874, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078,
+ 0x4934, 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4882,
+ 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x1078, 0x4934, 0x0c7f,
+ 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040,
+ 0x48e7, 0x704c, 0xa00d, 0x0040, 0x4891, 0x7088, 0xa005, 0x0040,
+ 0x48a9, 0x7054, 0xa075, 0x0040, 0x489a, 0xa20e, 0x0040, 0x48e7,
+ 0x0078, 0x489f, 0x6818, 0xa20e, 0x0040, 0x48e7, 0x2070, 0x704c,
+ 0xa00d, 0x0040, 0x4891, 0x7088, 0xa005, 0x00c0, 0x4891, 0x2e00,
+ 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8, 0x4891, 0x1078, 0x5570,
+ 0x0040, 0x48e7, 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180,
+ 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048, 0x48c0, 0x2001, 0x1999,
+ 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78,
+ 0x71a0, 0xa1e0, 0x21d3, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100,
+ 0x619a, 0x1078, 0x4c4b, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002,
+ 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001,
+ 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f,
+ 0x0e7f, 0x0c7f, 0x0078, 0x48e5, 0x0d7f, 0x007c, 0x0c7e, 0x680c,
+ 0xa065, 0x0040, 0x48fa, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000,
+ 0x1078, 0x4934, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069,
+ 0x70b6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x491b, 0x6838, 0xa07d,
+ 0x0040, 0x491b, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e,
+ 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078, 0x1999, 0x00c0, 0x491e,
+ 0x127f, 0x1078, 0x4e78, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843,
+ 0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0040, 0x4930, 0x6a3a,
+ 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x491b,
+ 0x683a, 0x6836, 0x0078, 0x492a, 0x601c, 0xa084, 0x0007, 0x1079,
+ 0x493a, 0x007c, 0x4942, 0x4944, 0x4b83, 0x4c1b, 0x4944, 0x4b83,
+ 0x4c1b, 0x4942, 0x1078, 0x1286, 0x157e, 0x137e, 0x147e, 0x0c7e,
+ 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1286, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x21d3, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0x1079, 0x4962, 0x0f7f, 0x0c7f, 0x147f, 0x137f,
+ 0x157f, 0x007c, 0x4994, 0x49cc, 0x49e4, 0x4a1d, 0x4a4a, 0x4a52,
+ 0x4a73, 0x4a84, 0x4a95, 0x4a9d, 0x4aae, 0x4a9d, 0x4af6, 0x4a84,
+ 0x4b17, 0x4b1f, 0x4a95, 0x4b1f, 0x4b30, 0x4992, 0x4992, 0x4992,
+ 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992,
+ 0x4992, 0x5018, 0x502d, 0x4992, 0x4992, 0x4992, 0x4992, 0x4a73,
+ 0x4a9d, 0x4992, 0x49e4, 0x4a1d, 0x4992, 0x54eb, 0x4a9d, 0x4992,
+ 0x550e, 0x4a9d, 0x1078, 0x1286, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6f51, 0x6804,
+ 0xd084, 0x0040, 0x49ae, 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078,
+ 0x1fb7, 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x49b3, 0x0d7f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x001c, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x60c3,
+ 0x0010, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x0300, 0x20a3, 0x0000, 0x2099, 0x70a0, 0x20a9, 0x0008,
+ 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x20a9, 0x0004,
+ 0x2099, 0x6f01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x49fd, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4a03, 0x2099,
+ 0x70a8, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
+ 0x00f0, 0x4a0e, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4a14,
+ 0x60c3, 0x0074, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4b45, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3,
+ 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e,
+ 0x2079, 0x6f51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4a39, 0xa085,
+ 0x0020, 0xd1a4, 0x0040, 0x4a3e, 0xa085, 0x0010, 0xa085, 0x0002,
+ 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x5000,
+ 0x0078, 0x49ea, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x2110,
+ 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+ 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b64, 0x20a3,
+ 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x0004, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
+ 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4b64, 0x20a3, 0x0200, 0x0078, 0x49ea, 0x20a1, 0x020b, 0x1078,
+ 0x4b64, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810,
+ 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x0d7e, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
+ 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4ad4,
+ 0x6998, 0xa184, 0xc000, 0x00c0, 0x4ad0, 0xd1ec, 0x0040, 0x4acc,
+ 0x20a3, 0x2100, 0x0078, 0x4ad6, 0x20a3, 0x0100, 0x0078, 0x4ad6,
+ 0x20a3, 0x0400, 0x0078, 0x4ad6, 0x20a3, 0x0700, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6f51, 0x7904,
+ 0x0f7f, 0xd1ac, 0x00c0, 0x4ae6, 0xa085, 0x0020, 0xd1a4, 0x0040,
+ 0x4aeb, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2,
+ 0x60c3, 0x0014, 0x1078, 0x4f31, 0x0d7f, 0x007c, 0x20a1, 0x020b,
+ 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4f31, 0x007c, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0200, 0x0078, 0x499a, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3,
+ 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000,
+ 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4f20,
+ 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4f20, 0x22a2,
+ 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085,
+ 0x1048, 0x1286, 0xa08a, 0x008c, 0x10c8, 0x1286, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x21d3, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0085, 0x1079, 0x4ba1, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4baa, 0x4bb5, 0x4bcf, 0x4ba8, 0x4ba8, 0x4ba8, 0x4baa,
+ 0x1078, 0x1286, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4be2, 0x60c3,
+ 0x0000, 0x1078, 0x4f31, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4bf5, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x000c, 0x1078, 0x4f31, 0x147f, 0x007c, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4c08, 0x20a3, 0x0003, 0x20a3, 0x0300,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x4f31,
+ 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0009, 0x20a3, 0x0000, 0x0078, 0x4b56, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b75,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8500, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3,
+ 0x0000, 0x0078, 0x4b75, 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a,
+ 0x0040, 0x1048, 0x1286, 0xa08a, 0x0050, 0x10c8, 0x1286, 0x7918,
+ 0x2160, 0x61a0, 0xa1e0, 0x21d3, 0x2c0c, 0xa18c, 0x00ff, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c39, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4c4b, 0x4cfd, 0x4cbe, 0x4e0c, 0x4c49, 0x4c49, 0x4c49,
+ 0x4c49, 0x4c49, 0x4c49, 0x4c49, 0x51ba, 0x51cb, 0x51dc, 0x51ed,
+ 0x4c49, 0x1078, 0x1286, 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4c9e, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff, 0x21a2,
+ 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006, 0x8004,
+ 0x20a2, 0xd1ac, 0x0040, 0x4c68, 0x20a3, 0x0002, 0x0078, 0x4c74,
+ 0xd1b4, 0x0040, 0x4c6f, 0x20a3, 0x0001, 0x0078, 0x4c74, 0x20a3,
+ 0x0000, 0x2230, 0x0078, 0x4c76, 0x6a80, 0x6e7c, 0x20a9, 0x0008,
+ 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, 0x4c7a,
+ 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084,
+ 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x70d2, 0x2003, 0x07d0,
+ 0x2001, 0x70d1, 0x2003, 0x0009, 0x2001, 0x70d7, 0x2003, 0x0002,
+ 0x1078, 0x14b5, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
+ 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600, 0x6198, 0x21a2,
+ 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2, 0x22a2, 0x20a2,
+ 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c, 0x0d7e, 0x157e,
+ 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cde, 0x7810, 0x2068,
+ 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078,
+ 0x4f31, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298, 0x22a2, 0x20a3,
+ 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078,
+ 0x4f20, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ded, 0x7810, 0x2068, 0xa016,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000,
+ 0x00c0, 0x4d1a, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x4d22,
+ 0x0078, 0x4d1d, 0xa006, 0x1079, 0x4d22, 0x147f, 0x137f, 0x157f,
+ 0x0d7f, 0x007c, 0x4d2c, 0x4d8e, 0x4d92, 0x4db5, 0x4dc2, 0x4dd4,
+ 0x4dd8, 0x4d2a, 0x1078, 0x1286, 0x017e, 0x037e, 0x694c, 0xa18c,
+ 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d3f, 0x6b78, 0x23a2, 0x6868,
+ 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x4db9, 0xa186,
+ 0x0001, 0x00c0, 0x4d89, 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864,
+ 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009,
+ 0x0018, 0xa384, 0x0300, 0x0040, 0x4d88, 0xd3c4, 0x0040, 0x4d5a,
+ 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4d5f, 0x6874, 0xa108, 0x157e,
+ 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000,
+ 0x00f0, 0x4d64, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003,
+ 0x0040, 0x4d88, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4f20, 0x22a2, 0x20a3, 0x0000,
+ 0x61c2, 0x037f, 0x017f, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0008,
+ 0x0078, 0x4db7, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2, 0x20a3,
+ 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2,
+ 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x60c3, 0x0032, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0028, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078,
+ 0x4f31, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
+ 0x0020, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0008, 0x0078, 0x4db7,
+ 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001,
+ 0x00c0, 0x4de6, 0x22a2, 0x037f, 0x0078, 0x4db7, 0x20a3, 0x0800,
+ 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4db9, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078, 0x4f20,
0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x5397,
- 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x539f,
- 0x539f, 0x53a1, 0x539f, 0x539f, 0x539f, 0x53c6, 0x539f, 0x1078,
- 0x12d5, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1,
- 0x020b, 0x2009, 0x0003, 0x1078, 0x53d0, 0x0d7e, 0x2069, 0x7651,
- 0x6804, 0xd0bc, 0x0040, 0x53bb, 0x682c, 0xa084, 0x00ff, 0x8007,
- 0x20a2, 0x0078, 0x53bd, 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0001, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x2009, 0x0003, 0x1078, 0x53d0, 0x20a3, 0x7f00, 0x0078, 0x53be,
- 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
- 0x2004, 0xd0bc, 0x0040, 0x53ee, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c,
- 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619,
- 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x53f6, 0x20a3, 0x0100,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888,
- 0xa18d, 0x0008, 0x21a2, 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000,
- 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x057e, 0x047e, 0x037e, 0x2061,
- 0x0100, 0x2071, 0x7600, 0x6130, 0x7818, 0x2068, 0x68a0, 0x2028,
- 0xd0bc, 0x00c0, 0x5422, 0xa080, 0x2303, 0x2014, 0xa294, 0x00ff,
- 0x0078, 0x5426, 0x6910, 0x6a14, 0x7364, 0x7468, 0x781c, 0xa086,
- 0x0006, 0x0040, 0x547a, 0xd5bc, 0x0040, 0x5436, 0xa185, 0x0100,
- 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x543c, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014,
- 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582,
- 0x0080, 0x0048, 0x546e, 0x6a00, 0xd2f4, 0x0040, 0x546c, 0x6a14,
- 0xa294, 0x00ff, 0x0078, 0x546e, 0x2011, 0x0000, 0x629e, 0x6017,
- 0x0016, 0x1078, 0x45a2, 0x037f, 0x047f, 0x057f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x0040, 0x54c9, 0xd5bc, 0x0040, 0x548e, 0xa185, 0x0100,
- 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x5494, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060, 0x608a, 0x705c,
- 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c, 0x60ce, 0x60ab,
- 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
- 0x54c4, 0x6a00, 0xd2f4, 0x0040, 0x54c2, 0x6a14, 0xa294, 0x00ff,
- 0x0078, 0x54c4, 0x2011, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078,
- 0x5471, 0xd5bc, 0x0040, 0x54d4, 0xa185, 0x0700, 0x20a2, 0x6266,
- 0x636a, 0x646e, 0x0078, 0x54da, 0x6063, 0x0700, 0x6266, 0x606b,
+ 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x4e1f,
+ 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4e27,
+ 0x4e27, 0x4e29, 0x4e27, 0x4e27, 0x4e27, 0x4e4e, 0x4e27, 0x1078,
+ 0x1286, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1,
+ 0x020b, 0x2009, 0x0003, 0x1078, 0x4e58, 0x0d7e, 0x2069, 0x6f51,
+ 0x6804, 0xd0bc, 0x0040, 0x4e43, 0x682c, 0xa084, 0x00ff, 0x8007,
+ 0x20a2, 0x0078, 0x4e45, 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2,
+ 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b,
+ 0x2009, 0x0003, 0x1078, 0x4e58, 0x20a3, 0x7f00, 0x0078, 0x4e46,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0100, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d,
+ 0x0008, 0x21a2, 0x1078, 0x4f20, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071, 0x6f00, 0x6130,
+ 0x7818, 0x2068, 0x68a0, 0xa080, 0x21d3, 0x2014, 0xa294, 0x00ff,
+ 0x781c, 0xa086, 0x0006, 0x0040, 0x4ebf, 0x6063, 0x0100, 0x6266,
+ 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008, 0x688c,
+ 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000,
+ 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014, 0x608a,
+ 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce,
+ 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017,
+ 0x0016, 0x1078, 0x41d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810,
+ 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x4ef4,
+ 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880,
+ 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
+ 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060,
+ 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c,
+ 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e,
+ 0x6017, 0x0012, 0x0078, 0x4eb9, 0x6063, 0x0700, 0x6266, 0x606b,
0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000, 0x688c, 0x8000,
0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00,
0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c,
0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af,
- 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x550a, 0x6a00,
- 0xd2f4, 0x0040, 0x5508, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x550a,
- 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x5471, 0x7a18,
- 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217,
- 0x007c, 0x0d7e, 0x2069, 0x7836, 0x6843, 0x0001, 0x0d7f, 0x007c,
- 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b,
- 0x1078, 0x4592, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004, 0xa085,
- 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061, 0x0100,
- 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f, 0x007f,
- 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x459d, 0x2061,
- 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x557e,
- 0x1078, 0x5534, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e, 0x2061,
- 0x7836, 0x6128, 0xa192, 0x0002, 0x00c8, 0x556b, 0x8108, 0x612a,
- 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x5579, 0x1078, 0x4592, 0x1078,
- 0x552b, 0x0078, 0x5579, 0x6124, 0xa1e5, 0x0000, 0x0040, 0x5576,
- 0x1078, 0x7572, 0x2009, 0x0014, 0x1078, 0x5bdb, 0x0c7f, 0x0078,
- 0x5579, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, 0x3535,
- 0x0078, 0x5579, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078,
- 0x45ab, 0x2071, 0x7836, 0x713c, 0x81ff, 0x0040, 0x55ac, 0x2061,
- 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x55b2,
- 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x571a, 0x037f, 0x713c, 0x2160, 0x1078, 0x7572, 0x2009, 0x004a,
- 0x1078, 0x5bdb, 0x0078, 0x55ac, 0x027f, 0x017f, 0x0e7f, 0x0d7f,
- 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8, 0x559c, 0x8108,
- 0x7146, 0x1078, 0x45a2, 0x0078, 0x55ac, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018,
- 0x2068, 0x6ca0, 0x2071, 0x7836, 0x7018, 0x2068, 0x8dff, 0x0040,
- 0x55e9, 0x68a0, 0xa406, 0x0040, 0x55d9, 0x6854, 0x2068, 0x0078,
- 0x55ce, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f,
- 0x2d60, 0x1078, 0x38ab, 0x0040, 0x55e9, 0x1078, 0x58b4, 0xa085,
- 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4f8e,
- 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
- 0x60c3, 0x0008, 0x1078, 0x5520, 0x147f, 0x157f, 0x007c, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x20a3,
- 0x0000, 0x20a9, 0x0006, 0x2011, 0x7640, 0x2019, 0x7641, 0x23a6,
- 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x5617, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5520, 0x147f,
- 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
- 0x1078, 0x4fe5, 0x1078, 0x4ffc, 0x7810, 0x007e, 0xa080, 0x0015,
- 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004,
- 0x8003, 0x60c2, 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078,
- 0x5520, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x6200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5520,
- 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x700c, 0x2060, 0x8cff, 0x0040, 0x567f,
- 0x1078, 0x6a79, 0x00c0, 0x5676, 0x1078, 0x5e09, 0x600c, 0x007e,
- 0x1078, 0x5bb4, 0x1078, 0x58b4, 0x0c7f, 0x0078, 0x566d, 0x700f,
- 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
- 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
- 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
- 0x7836, 0x7024, 0x2060, 0x8cff, 0x0040, 0x56d8, 0x1078, 0x5534,
- 0x68c3, 0x0000, 0x1078, 0x459d, 0x2009, 0x0013, 0x1078, 0x5bdb,
- 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x56bb, 0x6827, 0x0004,
- 0x7804, 0xa084, 0x4000, 0x0040, 0x56cd, 0x7803, 0x1000, 0x7803,
- 0x0000, 0x0078, 0x56cd, 0xd084, 0x0040, 0x56c2, 0x6827, 0x0001,
- 0x0078, 0x56c4, 0x00f0, 0x56aa, 0x7804, 0xa084, 0x1000, 0x0040,
- 0x56cd, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
- 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
- 0x2001, 0x7600, 0x2004, 0xa096, 0x0001, 0x0040, 0x5710, 0xa096,
- 0x0004, 0x0040, 0x5710, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
- 0x34fc, 0x1078, 0x4520, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
- 0x56fe, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5710,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5710, 0xd084, 0x0040,
- 0x5705, 0x6827, 0x0001, 0x0078, 0x5707, 0x00f0, 0x56ed, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5710, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
- 0x0140, 0x2071, 0x7836, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5768,
- 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x45ab,
- 0x1078, 0x1bf1, 0xa39d, 0x0000, 0x00c0, 0x5742, 0x2009, 0x0049,
- 0x1078, 0x5bdb, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5755,
- 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5767, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x0078, 0x5767, 0xd094, 0x0040, 0x575c,
- 0x6827, 0x0002, 0x0078, 0x575e, 0x00f0, 0x5744, 0x7804, 0xa084,
- 0x1000, 0x0040, 0x5767, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7836,
- 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x2069, 0x7836, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x7836, 0x7614, 0x2660,
- 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x57c6, 0x601c, 0xa206,
- 0x00c0, 0x57c1, 0x7014, 0xac36, 0x00c0, 0x57a0, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x57ae, 0x2c00, 0xaf36, 0x0040, 0x57ac,
- 0x2f00, 0x7012, 0x0078, 0x57ae, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x57b7, 0x7e0e, 0x0078, 0x57b8, 0x2678,
- 0x600f, 0x0000, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x0c7f, 0x0078,
- 0x5793, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5793, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
- 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x580f, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x580f, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x580f,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
- 0x58bf, 0x60c3, 0x0020, 0x1078, 0x5520, 0x147f, 0x157f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
- 0x00c0, 0x5827, 0xd1bc, 0x00c0, 0x5871, 0x0078, 0x58b1, 0x2009,
- 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
- 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
- 0x5868, 0x6020, 0xd0b4, 0x0040, 0x5868, 0x6024, 0xd094, 0x00c0,
- 0x5868, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5868,
- 0x00f0, 0x5834, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
- 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
- 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
- 0x00c0, 0x5867, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x585e, 0x027f,
- 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
- 0x58b1, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
- 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x58aa, 0x6020, 0xd0bc, 0x0040, 0x58aa, 0x2104,
- 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x58aa, 0x00f0, 0x587e,
- 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
- 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
- 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
- 0x58a4, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
- 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x7836, 0x7020,
- 0xa005, 0x0040, 0x58bd, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
- 0x0008, 0x20a2, 0x00f0, 0x58c1, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
- 0x87ff, 0x0040, 0x5957, 0x8cff, 0x0040, 0x5957, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x5952, 0x88ff, 0x0040, 0x58ee, 0x2800, 0xac06,
- 0x00c0, 0x5952, 0x2039, 0x0000, 0x0078, 0x58f2, 0x6018, 0xa206,
- 0x00c0, 0x5952, 0x7024, 0xac06, 0x00c0, 0x5920, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x591b, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x5910, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5918, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x5920, 0x6003, 0x0009, 0x630a, 0x0078, 0x5952,
- 0x7014, 0xac36, 0x00c0, 0x5926, 0x660c, 0x7616, 0x7010, 0xac36,
- 0x00c0, 0x5934, 0x2c00, 0xaf36, 0x0040, 0x5932, 0x2f00, 0x7012,
- 0x0078, 0x5934, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x593d, 0x7e0e, 0x0078, 0x593e, 0x2678, 0x600f, 0x0000,
- 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x5948, 0x1078, 0x74a8,
- 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x88ff, 0x00c0, 0x5961, 0x0c7f,
- 0x0078, 0x58d8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x58d8, 0xa006,
- 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5958,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7836, 0x7638, 0x2660, 0x2678, 0x8cff,
- 0x0040, 0x59d3, 0x601c, 0xa086, 0x0006, 0x00c0, 0x59ce, 0x88ff,
- 0x0040, 0x5988, 0x2800, 0xac06, 0x00c0, 0x59ce, 0x0078, 0x598c,
- 0x6018, 0xa206, 0x00c0, 0x59ce, 0x703c, 0xac06, 0x00c0, 0x599e,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x571a, 0x7033, 0x0000, 0x703f,
- 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
- 0x00c0, 0x59a4, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x59b2,
- 0x2c00, 0xaf36, 0x0040, 0x59b0, 0x2f00, 0x7036, 0x0078, 0x59b2,
- 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x59bb,
- 0x7e0e, 0x0078, 0x59bc, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x59c6, 0x1078, 0x74a8, 0x1078, 0x6a4c,
- 0x88ff, 0x00c0, 0x59dd, 0x0c7f, 0x0078, 0x5977, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x5977, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
- 0xa8c5, 0x0001, 0x0078, 0x59d4, 0x0e7e, 0x2071, 0x7836, 0x2001,
- 0x7600, 0x2004, 0xa086, 0x0002, 0x00c0, 0x59f2, 0x7007, 0x0005,
- 0x0078, 0x59f4, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x4eb9,
+ 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202,
+ 0x8217, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6843, 0x0001, 0x0d7f,
+ 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4f3c, 0x1078, 0x41c5, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004,
+ 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061,
+ 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f,
+ 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x41d0,
+ 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040,
+ 0x4f9a, 0x1078, 0x4f45, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e,
+ 0x2061, 0x70b6, 0x6128, 0xa192, 0x0002, 0x00c8, 0x4f87, 0x8108,
+ 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x4f95, 0x1078, 0x41c5,
+ 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4f83, 0x6017,
+ 0x0012, 0x0078, 0x4f95, 0x1078, 0x4f3c, 0x0078, 0x4f95, 0x6124,
+ 0xa1e5, 0x0000, 0x0040, 0x4f92, 0x1078, 0x6e16, 0x2009, 0x0014,
+ 0x1078, 0x55c8, 0x0c7f, 0x0078, 0x4f95, 0x027f, 0x017f, 0x0d7f,
+ 0x0c7f, 0x007c, 0x1078, 0x31f5, 0x0078, 0x4f95, 0x0c7e, 0x0d7e,
+ 0x0e7e, 0x017e, 0x027e, 0x1078, 0x41de, 0x2071, 0x70b6, 0x713c,
+ 0x81ff, 0x0040, 0x4fd9, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
+ 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x4fdf, 0x6017, 0x0010,
+ 0x7144, 0xa192, 0x0002, 0x00c8, 0x4fd1, 0x8108, 0x7146, 0x1078,
+ 0x41d5, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x4fcd, 0x6017, 0x0012, 0x0078, 0x4fd9, 0x6017, 0x0016, 0x0078,
+ 0x4fd9, 0x1078, 0x6e16, 0x2009, 0x004a, 0x1078, 0x55c8, 0x0078,
+ 0x4fd9, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x1078,
+ 0x41d5, 0x0078, 0x4fd9, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e,
+ 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0,
+ 0x2071, 0x70b6, 0x7018, 0x2068, 0x8dff, 0x0040, 0x500f, 0x68a0,
+ 0xa406, 0x0040, 0x4fff, 0x6854, 0x2068, 0x0078, 0x4ff4, 0x6010,
+ 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f, 0x2d60, 0x1078,
+ 0x356b, 0x0040, 0x500f, 0x1078, 0x52a1, 0xa085, 0x0001, 0x127f,
+ 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x0f00,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008,
+ 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9,
+ 0x0006, 0x2011, 0x6f40, 0x2019, 0x6f41, 0x23a6, 0x22a6, 0xa398,
+ 0x0002, 0xa290, 0x0002, 0x00f0, 0x503d, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x001c, 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c,
+ 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
+ 0x700c, 0x2060, 0x8cff, 0x0040, 0x506c, 0x1078, 0x632a, 0x00c0,
+ 0x5063, 0x1078, 0x579c, 0x600c, 0x007e, 0x1078, 0x55a1, 0x1078,
+ 0x52a1, 0x0c7f, 0x0078, 0x505a, 0x700f, 0x0000, 0x700b, 0x0000,
+ 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x157e, 0x0f7e,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000,
+ 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x70b6, 0x7024, 0x2060,
+ 0x8cff, 0x0040, 0x50c5, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x41d0, 0x2009, 0x0013, 0x1078, 0x55c8, 0x20a9, 0x01f4, 0x6824,
+ 0xd094, 0x0040, 0x50a8, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000,
+ 0x0040, 0x50ba, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x50ba,
+ 0xd084, 0x0040, 0x50af, 0x6827, 0x0001, 0x0078, 0x50b1, 0x00f0,
+ 0x5097, 0x7804, 0xa084, 0x1000, 0x0040, 0x50ba, 0x7803, 0x0100,
+ 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x2001, 0x6f00, 0x2004,
+ 0xa096, 0x0001, 0x0040, 0x50fd, 0xa096, 0x0004, 0x0040, 0x50fd,
+ 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x50eb, 0x6827, 0x0004,
+ 0x7804, 0xa084, 0x4000, 0x0040, 0x50fd, 0x7803, 0x1000, 0x7803,
+ 0x0000, 0x0078, 0x50fd, 0xd084, 0x0040, 0x50f2, 0x6827, 0x0001,
+ 0x0078, 0x50f4, 0x00f0, 0x50da, 0x7804, 0xa084, 0x1000, 0x0040,
+ 0x50fd, 0x7803, 0x0100, 0x7803, 0x0000, 0x007f, 0x017f, 0x027f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x127e,
+ 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e,
+ 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x70b6,
+ 0x703c, 0x2060, 0x8cff, 0x0040, 0x5155, 0x6817, 0x0010, 0x68cb,
+ 0x0000, 0x68c7, 0x0000, 0x1078, 0x41de, 0x1078, 0x1b66, 0xa39d,
+ 0x0000, 0x00c0, 0x512f, 0x2009, 0x0049, 0x1078, 0x55c8, 0x20a9,
+ 0x03e8, 0x6824, 0xd094, 0x0040, 0x5142, 0x6827, 0x0004, 0x7804,
+ 0xa084, 0x4000, 0x0040, 0x5154, 0x7803, 0x1000, 0x7803, 0x0000,
+ 0x0078, 0x5154, 0xd094, 0x0040, 0x5149, 0x6827, 0x0002, 0x0078,
+ 0x514b, 0x00f0, 0x5131, 0x7804, 0xa084, 0x1000, 0x0040, 0x5154,
+ 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x0d7e,
+ 0x127e, 0x2091, 0x8000, 0x2069, 0x70b6, 0x6a06, 0x127f, 0x0d7f,
+ 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x70b6, 0x6a32,
+ 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x007e,
+ 0x127e, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x2091, 0x8000,
+ 0x8cff, 0x0040, 0x51b3, 0x601c, 0xa206, 0x00c0, 0x51ae, 0x7014,
+ 0xac36, 0x00c0, 0x518d, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0,
+ 0x519b, 0x2c00, 0xaf36, 0x0040, 0x5199, 0x2f00, 0x7012, 0x0078,
+ 0x519b, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x51a4, 0x7e0e, 0x0078, 0x51a5, 0x2678, 0x600f, 0x0000, 0x1078,
+ 0x62fd, 0x1078, 0x52a1, 0x0c7f, 0x0078, 0x5180, 0x2c78, 0x600c,
+ 0x2060, 0x0078, 0x5180, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c9e,
+ 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3,
+ 0x4000, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078,
+ 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
+ 0x20a3, 0x2000, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a3, 0x0400, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078, 0x52ac, 0x60c3, 0x0020,
+ 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c, 0x127e, 0x0c7e, 0x2091,
+ 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4, 0x00c0, 0x5214, 0xd1bc,
+ 0x00c0, 0x525e, 0x0078, 0x529e, 0x2009, 0x017f, 0x200b, 0x00a1,
+ 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009,
+ 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x5255, 0x6020, 0xd0b4,
+ 0x0040, 0x5255, 0x6024, 0xd094, 0x00c0, 0x5255, 0x2104, 0xa084,
+ 0x000f, 0xa086, 0x0004, 0x00c0, 0x5255, 0x00f0, 0x5221, 0x027e,
+ 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d,
+ 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91, 0x6043, 0x0001, 0x6043,
+ 0x0000, 0x608a, 0x628e, 0x6024, 0xd094, 0x00c0, 0x5254, 0x6a04,
+ 0xa294, 0x4000, 0x00c0, 0x524b, 0x027f, 0x0d7f, 0x007f, 0x157f,
+ 0x2009, 0x017f, 0x200b, 0x0000, 0x0078, 0x529e, 0x2009, 0x017f,
+ 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9,
+ 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x5297,
+ 0x6020, 0xd0bc, 0x0040, 0x5297, 0x2104, 0xa084, 0x000f, 0xa086,
+ 0x0004, 0x00c0, 0x5297, 0x00f0, 0x526b, 0x027e, 0x6164, 0xa18c,
+ 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c,
+ 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a,
+ 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x5291, 0x027f, 0x0d7f,
+ 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0c7f, 0x127f,
+ 0x007c, 0x0e7e, 0x2071, 0x70b6, 0x7020, 0xa005, 0x0040, 0x52aa,
+ 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9, 0x0008, 0x20a2, 0x00f0,
+ 0x52ae, 0x20a2, 0x20a2, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x077e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
+ 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0040, 0x5344,
+ 0x8cff, 0x0040, 0x5344, 0x601c, 0xa086, 0x0006, 0x00c0, 0x533f,
+ 0x88ff, 0x0040, 0x52db, 0x2800, 0xac06, 0x00c0, 0x533f, 0x2039,
+ 0x0000, 0x0078, 0x52df, 0x6018, 0xa206, 0x00c0, 0x533f, 0x7024,
+ 0xac06, 0x00c0, 0x530d, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x5308, 0x6817, 0x0008, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7027,
+ 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
+ 0x52fd, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+ 0xd084, 0x0040, 0x5305, 0x6827, 0x0001, 0x037f, 0x0078, 0x530d,
+ 0x6003, 0x0009, 0x630a, 0x0078, 0x533f, 0x7014, 0xac36, 0x00c0,
+ 0x5313, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x5321, 0x2c00,
+ 0xaf36, 0x0040, 0x531f, 0x2f00, 0x7012, 0x0078, 0x5321, 0x7013,
+ 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x532a, 0x7e0e,
+ 0x0078, 0x532b, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x5335, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x1078,
+ 0x52a1, 0x88ff, 0x00c0, 0x534e, 0x0c7f, 0x0078, 0x52c5, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x52c5, 0xa006, 0x127f, 0x007f, 0x067f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
+ 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5345, 0x0f7e, 0x0e7e, 0x0d7e,
0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7836, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5a34,
- 0x2200, 0xac06, 0x00c0, 0x5a2f, 0x7038, 0xac36, 0x00c0, 0x5a12,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5a20, 0x2c00, 0xaf36,
- 0x0040, 0x5a1e, 0x2f00, 0x7036, 0x0078, 0x5a20, 0x7037, 0x0000,
- 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5a28, 0x7e0e, 0x0078, 0x5a29,
- 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5a34, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5a05, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7836, 0x760c,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x5acd, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x5ac8, 0x7024, 0xac06, 0x00c0, 0x5a7b,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5a7b, 0x1078, 0x5534,
- 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5a72, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5a7a,
- 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x5a81, 0x660c,
- 0x760e, 0x7008, 0xac36, 0x00c0, 0x5a8f, 0x2c00, 0xaf36, 0x0040,
- 0x5a8d, 0x2f00, 0x700a, 0x0078, 0x5a8f, 0x700b, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5a98, 0x7e0e, 0x0078, 0x5a99,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6a65, 0x00c0, 0x5aa3, 0x1078,
- 0x22b1, 0x0078, 0x5abf, 0x1078, 0x6a79, 0x00c0, 0x5aab, 0x1078,
- 0x5e09, 0x0078, 0x5abf, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040,
- 0x5abf, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5ad5, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x6003,
- 0x0000, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x0c7f, 0x0078, 0x5a4a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5a4a, 0x127f, 0x007f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x5ab6, 0x1078, 0x74a8, 0x0078, 0x5abf, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e,
- 0x2123, 0x00c0, 0x5aef, 0x8210, 0x8000, 0x0078, 0x5ae6, 0xa005,
- 0x0040, 0x5af9, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8,
- 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1,
- 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3,
- 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3,
- 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3,
- 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x5520, 0x0d7f,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3,
- 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0018, 0x1078, 0x5520, 0x007c, 0x2061, 0x7d00,
- 0x2a70, 0x7060, 0x7046, 0x704b, 0x7d00, 0x007c, 0x0e7e, 0x127e,
- 0x2071, 0x7600, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048,
- 0x5b80, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5b6c,
- 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b68, 0x0078, 0x5b5b,
- 0x2061, 0x7d00, 0x0078, 0x5b5b, 0x6003, 0x0008, 0x8529, 0x7546,
- 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5b7c, 0x754a, 0xa085,
- 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078, 0x5b77,
- 0xa006, 0x0078, 0x5b79, 0x0e7e, 0x2071, 0x7600, 0x7544, 0xa582,
- 0x0001, 0x0048, 0x5bb1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x5b9e, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b9a,
- 0x0078, 0x5b8d, 0x2061, 0x7d00, 0x0078, 0x5b8d, 0x6003, 0x0008,
- 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5bad,
- 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078,
- 0x5ba9, 0xa006, 0x0078, 0x5bab, 0xac82, 0x7d00, 0x1048, 0x12d5,
- 0x2001, 0x7615, 0x2004, 0xac02, 0x10c8, 0x12d5, 0xa006, 0x6006,
- 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003,
- 0x0000, 0x2061, 0x7600, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001,
- 0x0040, 0x5bd3, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c,
- 0x127f, 0x0078, 0x5bd2, 0x601c, 0xa084, 0x000f, 0x0079, 0x5be0,
- 0x5be9, 0x5bf1, 0x5c0d, 0x5c29, 0x6af6, 0x6b12, 0x6b2e, 0x5be9,
- 0x5bf1, 0xa18e, 0x0047, 0x00c0, 0x5bf0, 0xa016, 0x1078, 0x1572,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5bfb, 0x067f, 0x007c, 0x5c0b, 0x5cf2, 0x5e24, 0x5c0b, 0x5e7b,
- 0x5c0b, 0x5c0b, 0x5c0b, 0x5ca1, 0x6127, 0x5c0b, 0x5c0b, 0x5c0b,
- 0x5c0b, 0x5c0b, 0x5c0b, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5c17, 0x067f, 0x007c, 0x5c27,
- 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x6597,
- 0x665d, 0x5c27, 0x65b0, 0x6609, 0x65b0, 0x6609, 0x5c27, 0x1078,
- 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5c33, 0x067f, 0x007c, 0x5c43, 0x6165, 0x620b, 0x62cd, 0x6421,
- 0x5c43, 0x5c43, 0x5c43, 0x6143, 0x654c, 0x6550, 0x5c43, 0x5c43,
- 0x5c43, 0x5c43, 0x6576, 0x1078, 0x12d5, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5c53, 0x0e7e,
- 0x1078, 0x68e3, 0x0040, 0x5c6a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5bb4, 0x007c, 0x0d7e, 0x037e,
- 0x7330, 0xa386, 0x0200, 0x00c0, 0x5c7b, 0x6018, 0x2068, 0x6813,
- 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x5c85, 0x2068,
- 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x5bb4, 0x037f,
- 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
- 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5c9e, 0x6018, 0x2068, 0x7038,
+ 0x70b6, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x53c0, 0x601c,
+ 0xa086, 0x0006, 0x00c0, 0x53bb, 0x88ff, 0x0040, 0x5375, 0x2800,
+ 0xac06, 0x00c0, 0x53bb, 0x0078, 0x5379, 0x6018, 0xa206, 0x00c0,
+ 0x53bb, 0x703c, 0xac06, 0x00c0, 0x538b, 0x037e, 0x2019, 0x0001,
+ 0x1078, 0x5107, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000,
+ 0x7047, 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x5391, 0x660c,
+ 0x763a, 0x7034, 0xac36, 0x00c0, 0x539f, 0x2c00, 0xaf36, 0x0040,
+ 0x539d, 0x2f00, 0x7036, 0x0078, 0x539f, 0x7037, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x53a8, 0x7e0e, 0x0078, 0x53a9,
+ 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040,
+ 0x53b3, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x88ff, 0x00c0, 0x53ca,
+ 0x0c7f, 0x0078, 0x5364, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5364,
+ 0xa006, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
+ 0x53c1, 0x0e7e, 0x2071, 0x70b6, 0x2001, 0x6f00, 0x2004, 0xa086,
+ 0x0002, 0x00c0, 0x53df, 0x7007, 0x0005, 0x0078, 0x53e1, 0x7007,
+ 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x027e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6, 0x2c10, 0x7638,
+ 0x2660, 0x2678, 0x8cff, 0x0040, 0x5421, 0x2200, 0xac06, 0x00c0,
+ 0x541c, 0x7038, 0xac36, 0x00c0, 0x53ff, 0x660c, 0x763a, 0x7034,
+ 0xac36, 0x00c0, 0x540d, 0x2c00, 0xaf36, 0x0040, 0x540b, 0x2f00,
+ 0x7036, 0x0078, 0x540d, 0x7037, 0x0000, 0x660c, 0x2c00, 0xaf06,
+ 0x0040, 0x5415, 0x7e0e, 0x0078, 0x5416, 0x2678, 0x600f, 0x0000,
+ 0xa085, 0x0001, 0x0078, 0x5421, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x53f2, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x70b6, 0x760c, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x54ba, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x54b5, 0x7024, 0xac06, 0x00c0, 0x5468, 0x2069, 0x0100, 0x68c0,
+ 0xa005, 0x0040, 0x5468, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
+ 0x1000, 0x0040, 0x545f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
+ 0x0100, 0x6824, 0xd084, 0x0040, 0x5467, 0x6827, 0x0001, 0x037f,
+ 0x700c, 0xac36, 0x00c0, 0x546e, 0x660c, 0x760e, 0x7008, 0xac36,
+ 0x00c0, 0x547c, 0x2c00, 0xaf36, 0x0040, 0x547a, 0x2f00, 0x700a,
+ 0x0078, 0x547c, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+ 0x0040, 0x5485, 0x7e0e, 0x0078, 0x5486, 0x2678, 0x600f, 0x0000,
+ 0x1078, 0x6316, 0x00c0, 0x5490, 0x1078, 0x2192, 0x0078, 0x54ac,
+ 0x1078, 0x632a, 0x00c0, 0x5498, 0x1078, 0x579c, 0x0078, 0x54ac,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x54ac, 0x601c, 0xa086,
+ 0x0003, 0x00c0, 0x54c2, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x1078, 0x36ec, 0x1078, 0x62f0, 0x6003, 0x0000, 0x1078, 0x62fd,
+ 0x1078, 0x52a1, 0x0c7f, 0x0078, 0x5437, 0x2c78, 0x600c, 0x2060,
+ 0x0078, 0x5437, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x54a3, 0x1078,
+ 0x6d4c, 0x0078, 0x54ac, 0x037e, 0x157e, 0x137e, 0x147e, 0x3908,
+ 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e, 0x206c, 0x00c0, 0x54dc,
+ 0x8210, 0x8000, 0x0078, 0x54d3, 0xa005, 0x0040, 0x54e6, 0x20a9,
+ 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8, 0x53a3, 0x147f, 0x137f,
+ 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3, 0x4f47, 0x20a3, 0x4943,
+ 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x1078, 0x4f31, 0x0d7f, 0x007c, 0x20a1, 0x020b,
+ 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0018, 0x20a3, 0x0800,
+ 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7810, 0xa084,
+ 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018,
+ 0x1078, 0x4f31, 0x007c, 0x2061, 0x7500, 0x2a70, 0x7060, 0x7046,
+ 0x704b, 0x7500, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x6f00, 0x2091,
+ 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x556d, 0x7048, 0x2060,
+ 0x6000, 0xa086, 0x0000, 0x0040, 0x5559, 0xace0, 0x0008, 0x7054,
+ 0xac02, 0x00c8, 0x5555, 0x0078, 0x5548, 0x2061, 0x7500, 0x0078,
+ 0x5548, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054,
+ 0xa502, 0x00c8, 0x5569, 0x754a, 0xa085, 0x0001, 0x127f, 0x0e7f,
+ 0x007c, 0x704b, 0x7500, 0x0078, 0x5564, 0xa006, 0x0078, 0x5566,
+ 0x0e7e, 0x2071, 0x6f00, 0x7544, 0xa582, 0x0001, 0x0048, 0x559e,
+ 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x558b, 0xace0,
+ 0x0008, 0x7054, 0xac02, 0x00c8, 0x5587, 0x0078, 0x557a, 0x2061,
+ 0x7500, 0x0078, 0x557a, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8,
+ 0x0008, 0x7054, 0xa502, 0x00c8, 0x559a, 0x754a, 0xa085, 0x0001,
+ 0x0e7f, 0x007c, 0x704b, 0x7500, 0x0078, 0x5596, 0xa006, 0x0078,
+ 0x5598, 0xac82, 0x7500, 0x1048, 0x1286, 0x2001, 0x6f15, 0x2004,
+ 0xac02, 0x10c8, 0x1286, 0xa006, 0x6006, 0x600a, 0x600e, 0x6012,
+ 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x2061, 0x6f00,
+ 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x55c0, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x0078, 0x55bf,
+ 0x601c, 0xa084, 0x0007, 0x0079, 0x55cd, 0x55d5, 0x55dd, 0x55f9,
+ 0x5615, 0x63a7, 0x63c3, 0x63df, 0x55d5, 0xa18e, 0x0047, 0x00c0,
+ 0x55dc, 0xa016, 0x1078, 0x1523, 0x007c, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x1286, 0x1079, 0x55e7, 0x067f, 0x007c, 0x55f7,
+ 0x56c2, 0x57ab, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x5671,
+ 0x5a2d, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x1078,
+ 0x1286, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079,
+ 0x5603, 0x067f, 0x007c, 0x5613, 0x5613, 0x5613, 0x5613, 0x5613,
+ 0x5613, 0x5613, 0x5613, 0x5e9d, 0x5f63, 0x5613, 0x5eb6, 0x5f0f,
+ 0x5eb6, 0x5f0f, 0x5613, 0x1078, 0x1286, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x1286, 0x1079, 0x561f, 0x067f, 0x007c, 0x562f,
+ 0x5a6b, 0x5b11, 0x5bd3, 0x5d27, 0x562f, 0x562f, 0x562f, 0x5a49,
+ 0x5e52, 0x5e56, 0x562f, 0x562f, 0x562f, 0x562f, 0x5e7c, 0x1078,
+ 0x1286, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9,
+ 0x0006, 0x3310, 0x3420, 0x9398, 0x94a0, 0x3318, 0x3428, 0x222e,
+ 0x2326, 0xa290, 0x0002, 0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0,
+ 0x0002, 0x00f0, 0x563f, 0x0e7e, 0x1078, 0x61dc, 0x0040, 0x5656,
+ 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078,
+ 0x55a1, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
+ 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x566e, 0x6018, 0x2068, 0x7038,
0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078,
- 0x5c5f, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x0079, 0x5ca8,
- 0x5cda, 0x5ce6, 0x5cda, 0x5cda, 0x5cda, 0x5cda, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cda,
- 0x5cd8, 0x5cda, 0x5cda, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cda, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x4824, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4824, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c,
- 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6,
- 0x0013, 0x00c0, 0x5cfe, 0x2008, 0x0079, 0x5d87, 0xa1b6, 0x0027,
- 0x00c0, 0x5d54, 0x1078, 0x4b33, 0x6004, 0x1078, 0x6a65, 0x0040,
- 0x5d17, 0x1078, 0x6a79, 0x0040, 0x5d4c, 0xa08e, 0x0021, 0x0040,
- 0x5d50, 0xa08e, 0x0022, 0x0040, 0x5d4c, 0x0078, 0x5d47, 0x1078,
- 0x22b1, 0x2001, 0x0007, 0x1078, 0x3783, 0x6018, 0xa080, 0x0028,
- 0x200c, 0x1078, 0x5e09, 0xa186, 0x007e, 0x00c0, 0x5d2d, 0x2001,
- 0x762f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x4914, 0x1078, 0x4857, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x5d3e, 0x1078, 0x3958, 0x0c7f, 0x2c08,
- 0x1078, 0x7326, 0x037f, 0x027f, 0x017f, 0x1078, 0x37bf, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x5e09, 0x0078, 0x5d47,
- 0x1078, 0x5e18, 0x0078, 0x5d47, 0xa186, 0x0014, 0x00c0, 0x5d4b,
- 0x1078, 0x4b33, 0x1078, 0x228f, 0x1078, 0x6a65, 0x00c0, 0x5d74,
- 0x1078, 0x22b1, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x5e09,
- 0xa186, 0x007e, 0x00c0, 0x5d72, 0x2001, 0x762f, 0x200c, 0xa18d,
- 0x0001, 0x2102, 0x0078, 0x5d47, 0x1078, 0x6a79, 0x00c0, 0x5d7c,
- 0x1078, 0x5e09, 0x0078, 0x5d47, 0x6004, 0xa08e, 0x0021, 0x0040,
- 0x5d78, 0xa08e, 0x0022, 0x1040, 0x5e18, 0x0078, 0x5d47, 0x5db9,
- 0x5dbb, 0x5dbf, 0x5dc3, 0x5dc7, 0x5dcb, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5dcf, 0x5dd5, 0x5db7,
- 0x5ddf, 0x5dd5, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5dd5,
- 0x5dd5, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x1078,
- 0x12d5, 0x0078, 0x5dd5, 0x2001, 0x000b, 0x0078, 0x5de8, 0x2001,
- 0x0003, 0x0078, 0x5de8, 0x2001, 0x0005, 0x0078, 0x5de8, 0x2001,
- 0x0001, 0x0078, 0x5de8, 0x2001, 0x0009, 0x0078, 0x5de8, 0x1078,
- 0x12d5, 0x0078, 0x5de7, 0x1078, 0x3783, 0x1078, 0x4b33, 0x6003,
- 0x0002, 0x6017, 0x0028, 0x1078, 0x4c2c, 0x0078, 0x5de7, 0x1078,
- 0x4b33, 0x6003, 0x0004, 0x6017, 0x0028, 0x1078, 0x4c2c, 0x007c,
- 0x1078, 0x3783, 0x1078, 0x4b33, 0x6003, 0x0002, 0x037e, 0x2019,
- 0x765c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x5dfa, 0x2019, 0x0028,
- 0x0078, 0x5e03, 0x8007, 0xa09a, 0x0004, 0x0048, 0x5df6, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4c2c, 0x0078,
- 0x5de7, 0x0e7e, 0x1078, 0x68e3, 0x0040, 0x5e16, 0x6010, 0x2070,
- 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c,
- 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103,
- 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0x6604,
- 0xa6b6, 0x0028, 0x00c0, 0x5e38, 0x1078, 0x6aae, 0x0078, 0x5e6a,
- 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x5e41, 0x1078, 0x6ac8, 0x0078,
- 0x5e6a, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5e4a, 0x1078, 0x5c45,
- 0x0078, 0x5e6a, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5e53, 0x1078,
- 0x5c8a, 0x0078, 0x5e6a, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x5e5c,
- 0x1078, 0x5c6e, 0x0078, 0x5e6a, 0xa1b6, 0x0015, 0x00c0, 0x5e64,
- 0x1079, 0x5e6f, 0x0078, 0x5e6a, 0xa1b6, 0x0016, 0x00c0, 0x5e6b,
- 0x1079, 0x5fac, 0x007c, 0x1078, 0x5be9, 0x0078, 0x5e6a, 0x5e93,
- 0x5e96, 0x5e93, 0x5ed7, 0x5e93, 0x5f48, 0x5e93, 0x5e93, 0x5e93,
- 0x5f84, 0x5e93, 0x5f9a, 0xa1b6, 0x0048, 0x0040, 0x5e87, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0e7e,
- 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f,
- 0x1078, 0x5bb4, 0x007c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071,
- 0x7600, 0x7078, 0xa086, 0x0074, 0x00c0, 0x5ec0, 0x1078, 0x72fa,
- 0x00c0, 0x5eb2, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x5ec4, 0x0d7f,
- 0x2001, 0x0006, 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4,
- 0x0078, 0x5ec2, 0x2001, 0x000a, 0x1078, 0x3783, 0x1078, 0x22b1,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4824, 0x0078, 0x5ec2,
- 0x1078, 0x5f38, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x5ed6,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2069, 0x7651, 0x6804, 0xd0a4,
- 0x0040, 0x5ed6, 0x2001, 0x0006, 0x1078, 0x3791, 0x007c, 0x0d7e,
- 0x2011, 0x761e, 0x2204, 0xa086, 0x0074, 0x00c0, 0x5f34, 0x1078,
- 0x6079, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e,
- 0x0040, 0x5eff, 0xa286, 0x0080, 0x00c0, 0x5f28, 0x6813, 0x00ff,
- 0x6817, 0xfffc, 0x6010, 0xa005, 0x0040, 0x5f1e, 0x2068, 0x6807,
- 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x0078, 0x5f1e, 0x0e7e,
- 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x762f, 0x2e04,
- 0xa085, 0x0003, 0x2072, 0x2071, 0x7b80, 0x2079, 0x0100, 0x2e04,
- 0xa084, 0x00ff, 0x2069, 0x7619, 0x206a, 0x78e6, 0x8e70, 0x2e04,
- 0x2069, 0x761a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, 0x0006,
- 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x0078, 0x5f36,
- 0x2001, 0x0004, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4824, 0x0078, 0x5f36, 0x1078, 0x5f38, 0x0d7f, 0x007c,
- 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x0040, 0x5f43, 0x2001,
- 0x0007, 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x007c,
- 0x0e7e, 0x2071, 0x7600, 0x7078, 0xa086, 0x0014, 0x00c0, 0x5f7e,
- 0x7000, 0xa086, 0x0003, 0x00c0, 0x5f5b, 0x6010, 0xa005, 0x00c0,
- 0x5f5b, 0x1078, 0x2d80, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3853,
- 0x1078, 0x5ec4, 0x0d7f, 0x1078, 0x6083, 0x00c0, 0x5f7e, 0x2001,
- 0x0006, 0x1078, 0x3783, 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5f77,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x0e7f,
- 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x0078, 0x5f82, 0x1078, 0x5e09,
- 0x1078, 0x5f38, 0x0e7f, 0x007c, 0x2011, 0x761e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x5f97, 0x2001, 0x0002, 0x1078, 0x3783, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x4824, 0x0078, 0x5f99, 0x1078,
- 0x5f38, 0x007c, 0x2011, 0x761e, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x5fa9, 0x2001, 0x0007, 0x1078, 0x3783, 0x1078, 0x5bb4, 0x0078,
- 0x5fab, 0x1078, 0x5f38, 0x007c, 0x5e93, 0x5fb8, 0x5e93, 0x5fde,
- 0x5e93, 0x602c, 0x5e93, 0x5e93, 0x5e93, 0x6041, 0x5e93, 0x6054,
- 0x0c7e, 0x1078, 0x6067, 0x00c0, 0x5fcd, 0x2001, 0x0000, 0x1078,
- 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x4824, 0x0078, 0x5fdc, 0x2009, 0x7b8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5fda, 0x1078, 0x5bb4,
- 0x0078, 0x5fdc, 0x1078, 0x5f38, 0x0c7f, 0x007c, 0x1078, 0x6076,
- 0x00c0, 0x5ff2, 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0002,
- 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4824,
- 0x0078, 0x6014, 0x1078, 0x5e09, 0x2009, 0x7b8e, 0x2134, 0xa6b4,
- 0x00ff, 0xa686, 0x0005, 0x0040, 0x6015, 0x2009, 0x7b8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x6012, 0xa686, 0x0009,
- 0x0040, 0x6015, 0x2001, 0x0004, 0x1078, 0x3783, 0x1078, 0x5bb4,
- 0x0078, 0x6014, 0x1078, 0x5f38, 0x007c, 0x0d7e, 0x6018, 0x2068,
- 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6027, 0x8001, 0x6842,
- 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x6014, 0x1078,
- 0x228f, 0x0d7f, 0x0078, 0x6012, 0x1078, 0x6076, 0x00c0, 0x603c,
- 0x2001, 0x0004, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4824, 0x0078, 0x6040, 0x1078, 0x5e09, 0x1078, 0x5f38,
- 0x007c, 0x1078, 0x6076, 0x00c0, 0x6051, 0x2001, 0x0008, 0x1078,
- 0x3783, 0x6003, 0x0001, 0x6007, 0x0005, 0x1078, 0x4824, 0x0078,
- 0x6053, 0x1078, 0x5f38, 0x007c, 0x1078, 0x6076, 0x00c0, 0x6064,
- 0x2001, 0x000a, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x4824, 0x0078, 0x6066, 0x1078, 0x5f38, 0x007c, 0x2009,
- 0x7b8e, 0x2104, 0xa086, 0x0003, 0x00c0, 0x6075, 0x2009, 0x7b8f,
- 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001,
- 0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x37e9,
- 0x017f, 0x0c7f, 0x007c, 0x0e7e, 0x2071, 0x7b8c, 0x7004, 0xa086,
- 0x0014, 0x00c0, 0x60a6, 0x7008, 0xa086, 0x0800, 0x00c0, 0x60a6,
- 0x700c, 0xd0ec, 0x0040, 0x60a4, 0xa084, 0x0f00, 0xa086, 0x0100,
- 0x00c0, 0x60a4, 0x7024, 0xd0a4, 0x0040, 0x60a4, 0xd08c, 0x0040,
- 0x60a4, 0xa006, 0x0078, 0x60a6, 0xa085, 0x0001, 0x0e7f, 0x007c,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x783f, 0x252c, 0x2021, 0x7845,
- 0x2424, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7244, 0x7060, 0xa202,
- 0x00c8, 0x60fd, 0x1078, 0x7504, 0x0040, 0x60f5, 0x671c, 0xa786,
- 0x0001, 0x0040, 0x60f5, 0xa786, 0x0007, 0x0040, 0x60f5, 0x2500,
- 0xac06, 0x0040, 0x60f5, 0x2400, 0xac06, 0x0040, 0x60f5, 0x0c7e,
- 0x6000, 0xa086, 0x0004, 0x00c0, 0x60df, 0x1078, 0x1676, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x60f2, 0xa786, 0x0003, 0x00c0,
- 0x6107, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c,
- 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x0c7f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x00c8, 0x60fd, 0x0078, 0x60bd, 0x127f, 0x007f, 0x027f,
- 0x047f, 0x057f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x60e9, 0x1078, 0x74a8, 0x0078, 0x60f2, 0x220c,
- 0x2304, 0xa106, 0x00c0, 0x611a, 0x8210, 0x8318, 0x00f0, 0x610f,
- 0xa006, 0x007c, 0x2304, 0xa102, 0x0048, 0x6122, 0x2001, 0x0001,
- 0x0078, 0x6124, 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004,
- 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x1078, 0x6a65, 0x0040, 0x6136,
- 0x1078, 0x6a79, 0x0040, 0x613f, 0x0078, 0x6138, 0x1078, 0x22b1,
- 0x1078, 0x4b33, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x5e09, 0x0078, 0x6138, 0xa182, 0x0040, 0x0079, 0x6147, 0x6157,
- 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157,
- 0x6157, 0x6157, 0x6159, 0x6159, 0x6159, 0x6159, 0x6157, 0x1078,
- 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x47d7, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0,
- 0x616e, 0x6004, 0xa082, 0x0040, 0x0079, 0x61e4, 0xa186, 0x0027,
- 0x00c0, 0x618b, 0x1078, 0x4b33, 0x1078, 0x228f, 0x0d7e, 0x6110,
- 0x2168, 0x1078, 0x68e3, 0x0040, 0x6185, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f, 0x1078, 0x5bb4,
- 0x1078, 0x4c2c, 0x007c, 0xa186, 0x0014, 0x00c0, 0x6194, 0x6004,
- 0xa082, 0x0040, 0x0079, 0x61b4, 0xa186, 0x0047, 0x10c0, 0x12d5,
- 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, 0x61b1, 0x127e, 0x2091,
- 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, 0x4698, 0x027f, 0x017f,
- 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x61b1, 0x0078,
- 0x620b, 0x1078, 0x5be9, 0x007c, 0x61c6, 0x61c4, 0x61c4, 0x61c4,
- 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61dd,
- 0x61dd, 0x61dd, 0x61dd, 0x61c4, 0x1078, 0x12d5, 0x1078, 0x4b33,
- 0x0d7e, 0x6110, 0x2168, 0x1078, 0x68e3, 0x0040, 0x61d7, 0x6837,
- 0x0103, 0x684b, 0x0006, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f,
- 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x4b33, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x61f6, 0x61f4, 0x61f4, 0x61f4,
- 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x6204,
- 0x6204, 0x6204, 0x6204, 0x61f4, 0x1078, 0x12d5, 0x1078, 0x4b33,
- 0x6003, 0x0002, 0x1078, 0x4c2c, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4b33, 0x6003, 0x000f,
- 0x1078, 0x4c2c, 0x007c, 0xa182, 0x0040, 0x0079, 0x620f, 0x621f,
- 0x621f, 0x621f, 0x621f, 0x621f, 0x6221, 0x62aa, 0x62c2, 0x621f,
- 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x1078,
- 0x12d5, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, 0x6110, 0x2168, 0x7614,
- 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x628e, 0xa68c, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6253, 0xa186, 0x0028, 0x00c0, 0x623d, 0x1078,
- 0x6a53, 0x684b, 0x001c, 0x0078, 0x6255, 0xd6dc, 0x0040, 0x6248,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6255,
- 0xd6d4, 0x0040, 0x6253, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6255, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46,
- 0xa01e, 0xd6c4, 0x0040, 0x6268, 0x7328, 0x732c, 0x6b56, 0x037e,
- 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, 0x1078, 0x66cc, 0x037f,
- 0xd6cc, 0x0040, 0x629e, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
- 0x627c, 0x2071, 0x7b98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
- 0x1078, 0x66cc, 0x0078, 0x629e, 0x6838, 0xd0fc, 0x0040, 0x6285,
- 0x2009, 0x0020, 0x695a, 0x0078, 0x6271, 0x0f7e, 0x2d78, 0x1078,
- 0x6664, 0x0f7f, 0x1078, 0x66b9, 0x0078, 0x62a0, 0x684b, 0x0000,
- 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x629e, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x629e, 0x1078, 0x6412, 0x1078, 0x3a2c,
- 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078,
- 0x5bb4, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7b8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x4843, 0x1078,
- 0x4cec, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x62d1, 0x62e1, 0x62e1, 0x62e1, 0x62e1, 0x62e1, 0x62e3, 0x637a,
- 0x62e1, 0x62e1, 0x6390, 0x63f2, 0x62e1, 0x62e1, 0x62e1, 0x62e1,
- 0x63f9, 0x1078, 0x12d5, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x7b8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x6375, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x6304,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x6375,
- 0x1078, 0x132f, 0x1040, 0x12d5, 0x2d00, 0x784a, 0x7f4c, 0xc7cd,
- 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
- 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x633e,
- 0xa186, 0x0028, 0x00c0, 0x6328, 0x684b, 0x001c, 0x0078, 0x6340,
- 0xd6dc, 0x0040, 0x6333, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6340, 0xd6d4, 0x0040, 0x633e, 0x684b, 0x0007,
- 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6340, 0x684b, 0x0000,
- 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
- 0x6355, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98,
- 0xad90, 0x0019, 0x1078, 0x66cc, 0x037f, 0xd6cc, 0x0040, 0x6375,
- 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x6369, 0x2071, 0x7b98,
- 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x66cc, 0x0078,
- 0x6375, 0x7838, 0xd0fc, 0x0040, 0x6372, 0x2009, 0x0020, 0x695a,
- 0x0078, 0x635e, 0x2d78, 0x1078, 0x6664, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7b8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x5519, 0x007c,
- 0x0d7e, 0x6003, 0x0002, 0x1078, 0x4bdb, 0x1078, 0x4cec, 0x6110,
- 0x2168, 0x694c, 0xd1e4, 0x0040, 0x63f0, 0xd1cc, 0x0040, 0x63cb,
- 0x6948, 0x6838, 0xd0fc, 0x0040, 0x63c3, 0x017e, 0x684c, 0x007e,
- 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020,
- 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x63b2,
- 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078,
- 0x1358, 0x0078, 0x63ee, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078,
- 0x66b9, 0x0078, 0x63ee, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x63ea, 0xa086, 0x0028, 0x00c0, 0x63dc,
- 0x684b, 0x001c, 0x0078, 0x63ec, 0xd1dc, 0x0040, 0x63e3, 0x684b,
- 0x0015, 0x0078, 0x63ec, 0xd1d4, 0x0040, 0x63ea, 0x684b, 0x0007,
- 0x0078, 0x63ec, 0x684b, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x5bb4,
- 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078, 0x4bdb, 0x1078, 0x4cec,
- 0x007c, 0x1078, 0x4bdb, 0x1078, 0x228f, 0x0d7e, 0x6110, 0x2168,
- 0x1078, 0x68e3, 0x0040, 0x640c, 0x6837, 0x0103, 0x684b, 0x0029,
- 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x1078,
- 0x4cec, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x641e, 0x684b,
- 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x6425, 0x6435, 0x6435, 0x6435,
- 0x6435, 0x6435, 0x6437, 0x6435, 0x64db, 0x64e3, 0x6435, 0x6435,
- 0x6435, 0x6435, 0x6435, 0x6435, 0x6435, 0x1078, 0x12d5, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x64cd, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x6458, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x64ca, 0x1078, 0x132f, 0x1040, 0x12d5,
- 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
- 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
- 0x00ff, 0xa186, 0x0002, 0x0040, 0x6493, 0xa186, 0x0028, 0x00c0,
- 0x647d, 0x684b, 0x001c, 0x0078, 0x6495, 0xd6dc, 0x0040, 0x6488,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6495,
- 0xd6d4, 0x0040, 0x6493, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6495, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
- 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x64aa, 0x7328, 0x732c,
- 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, 0x1078,
- 0x66cc, 0x037f, 0xd6cc, 0x0040, 0x64ca, 0x7124, 0x695a, 0xa192,
- 0x0021, 0x00c8, 0x64be, 0x2071, 0x7b98, 0x831c, 0x2300, 0xae18,
- 0xad90, 0x001d, 0x1078, 0x66cc, 0x0078, 0x64ca, 0x7838, 0xd0fc,
- 0x0040, 0x64c7, 0x2009, 0x0020, 0x695a, 0x0078, 0x64b3, 0x2d78,
- 0x1078, 0x6664, 0xd6dc, 0x00c0, 0x64d0, 0xa006, 0x0078, 0x64d4,
- 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x15b6, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1572, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168,
- 0x694c, 0xd1e4, 0x0040, 0x654a, 0xd1cc, 0x0040, 0x651a, 0x6948,
- 0x6838, 0xd0fc, 0x0040, 0x6512, 0x017e, 0x684c, 0x007e, 0x6850,
- 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e,
- 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6501, 0x157f,
- 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1358,
- 0x0078, 0x6548, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078, 0x66b9,
- 0x0078, 0x6548, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6539, 0xa086, 0x0028, 0x00c0, 0x652b, 0x684b,
- 0x001c, 0x0078, 0x6546, 0xd1dc, 0x0040, 0x6532, 0x684b, 0x0015,
- 0x0078, 0x6546, 0xd1d4, 0x0040, 0x6539, 0x684b, 0x0007, 0x0078,
- 0x6546, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x6546, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x6546, 0x1078, 0x6412, 0x1078, 0x3a2c,
- 0x1078, 0x5bb4, 0x0d7f, 0x007c, 0x1078, 0x4b33, 0x0078, 0x6552,
- 0x1078, 0x4bdb, 0x1078, 0x68e3, 0x0040, 0x6569, 0x0d7e, 0x6110,
- 0x2168, 0x6837, 0x0103, 0x2009, 0x760c, 0x210c, 0xd18c, 0x00c0,
- 0x6572, 0xd184, 0x00c0, 0x656e, 0x6108, 0x694a, 0x1078, 0x3a2c,
- 0x0d7f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x684b, 0x0004,
- 0x0078, 0x6566, 0x684b, 0x0004, 0x0078, 0x6566, 0xa182, 0x0040,
- 0x0079, 0x657a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658c,
- 0x658a, 0x658f, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a,
- 0x658a, 0x658a, 0x1078, 0x12d5, 0x1078, 0x5bb4, 0x007c, 0x007e,
- 0x027e, 0xa016, 0x1078, 0x1572, 0x027f, 0x007f, 0x007c, 0xa182,
- 0x0085, 0x0079, 0x659b, 0x65a4, 0x65a2, 0x65a2, 0x65a2, 0x65a2,
- 0x65a2, 0x65a2, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078,
- 0x47d7, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c,
- 0xa186, 0x0013, 0x00c0, 0x65ba, 0x6004, 0xa082, 0x0085, 0x2008,
- 0x0079, 0x65ee, 0xa186, 0x0027, 0x00c0, 0x65db, 0x1078, 0x4b33,
- 0x1078, 0x228f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040,
- 0x65d1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x5be9, 0x0078, 0x65d6, 0xa186, 0x0014, 0x00c0, 0x65d7, 0x1078,
- 0x4b33, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x65d1,
- 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x65cd, 0x65f7, 0x65f5,
- 0x65f5, 0x65f5, 0x65f5, 0x65f5, 0x6600, 0x1078, 0x12d5, 0x1078,
- 0x4b33, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4c2c, 0x007c,
- 0x1078, 0x4b33, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4c2c,
- 0x007c, 0xa182, 0x008c, 0x00c8, 0x6613, 0xa182, 0x0085, 0x0048,
- 0x6613, 0x0079, 0x6616, 0x1078, 0x5be9, 0x007c, 0x661d, 0x661d,
- 0x661d, 0x661d, 0x661f, 0x663e, 0x661d, 0x1078, 0x12d5, 0x0d7e,
- 0x1078, 0x6a3f, 0x1078, 0x68e3, 0x0040, 0x663a, 0x6010, 0x2068,
- 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x6632, 0x684b, 0x0006,
- 0x0078, 0x6636, 0x684b, 0x0005, 0x1078, 0x6af2, 0x6847, 0x0000,
- 0x1078, 0x3a2c, 0x1078, 0x5bb4, 0x0d7f, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x6659, 0x6837, 0x0103, 0x6850,
- 0xd0b4, 0x0040, 0x664f, 0x684b, 0x0006, 0x0078, 0x6653, 0x684b,
- 0x0005, 0x1078, 0x6af2, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x007c, 0x1078, 0x4b33, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
- 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x6670, 0x0078, 0x6672,
- 0x2009, 0x0100, 0x2130, 0x2069, 0x7b98, 0x831c, 0x2300, 0xad18,
- 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x66cc, 0xa6b2, 0x0020,
- 0x7804, 0xa06d, 0x0040, 0x6686, 0x1078, 0x1358, 0x1078, 0x132f,
- 0x0040, 0x66b0, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
- 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x669c, 0x2608, 0xad90, 0x000f,
- 0x1078, 0x66cc, 0x0078, 0x66b0, 0xa6b2, 0x003c, 0x2009, 0x003c,
- 0x2d78, 0xad90, 0x000f, 0x1078, 0x66cc, 0x0078, 0x6686, 0x0f7f,
- 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x66b5,
- 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
- 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x66ca, 0x6804, 0xa07d, 0x0040,
- 0x66c8, 0x6807, 0x0000, 0x1078, 0x3a2c, 0x2f68, 0x0078, 0x66bd,
- 0x1078, 0x3a2c, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
- 0x66d2, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x66d4, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x601c, 0xa084, 0x000f, 0x1079, 0x66e7, 0x127f, 0x007c, 0x66f6,
- 0x66ef, 0x66f1, 0x670f, 0x66ef, 0x66f1, 0x66f1, 0x66f1, 0x1078,
- 0x12d5, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x670c, 0xa00e, 0x2001, 0x0005,
- 0x1078, 0x3abc, 0x1078, 0x6af2, 0x1078, 0x3a2c, 0x1078, 0x5bb4,
- 0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x670a, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6717, 0x007c, 0x6727,
- 0x6744, 0x6729, 0x6755, 0x6740, 0x6727, 0x66f1, 0x66f6, 0x66f6,
- 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x1078,
- 0x12d5, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x6732,
- 0x1078, 0x6af2, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
- 0x0002, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0xa085, 0x0001, 0x007c,
- 0x1078, 0x1676, 0x0078, 0x6729, 0x0e7e, 0x2071, 0x7836, 0x7024,
- 0xac06, 0x00c0, 0x674d, 0x1078, 0x5688, 0x1078, 0x55bd, 0x0e7f,
- 0x00c0, 0x6729, 0x1078, 0x66f1, 0x007c, 0x037e, 0x0e7e, 0x2071,
- 0x7836, 0x703c, 0xac06, 0x00c0, 0x6765, 0x2019, 0x0000, 0x1078,
- 0x571a, 0x0e7f, 0x037f, 0x0078, 0x6729, 0x1078, 0x59f6, 0x0e7f,
- 0x037f, 0x00c0, 0x6729, 0x1078, 0x66f1, 0x007c, 0x0c7e, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x6776, 0x0c7f, 0x007c, 0x6785, 0x67e2,
- 0x6887, 0x6789, 0x6785, 0x6785, 0x7188, 0x5bb4, 0x67e2, 0x1078,
- 0x6a79, 0x00c0, 0x6785, 0x1078, 0x5e09, 0x007c, 0x6017, 0x0001,
- 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6791,
- 0x007c, 0x67a1, 0x67a3, 0x67c3, 0x67d5, 0x67d5, 0x67a1, 0x6785,
- 0x6785, 0x6785, 0x67d5, 0x67d5, 0x67a1, 0x67a1, 0x67a1, 0x67a1,
- 0x67df, 0x1078, 0x12d5, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5,
- 0x7052, 0x2071, 0x7836, 0x7024, 0xac06, 0x0040, 0x67bf, 0x1078,
- 0x55bd, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017,
- 0x0014, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0e7f, 0x007c, 0x6017,
- 0x0001, 0x0078, 0x67bd, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5,
- 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
- 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x007c, 0x0d7e, 0x6017, 0x0001,
- 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078,
- 0x5bb4, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x67ea, 0x007c, 0x67fa, 0x6786, 0x67fc, 0x67fa, 0x67fc, 0x67fa,
- 0x67fa, 0x67fa, 0x677f, 0x677f, 0x67fa, 0x67fa, 0x67fa, 0x67fa,
- 0x67fa, 0x67fa, 0x1078, 0x12d5, 0x0d7e, 0x6018, 0x2068, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12d5, 0x1079,
- 0x680a, 0x007c, 0x6816, 0x6835, 0x6816, 0x6835, 0x6816, 0x6835,
- 0x6818, 0x6821, 0x6816, 0x6835, 0x6816, 0x682e, 0x1078, 0x12d5,
- 0x6004, 0xa08e, 0x0004, 0x0040, 0x6830, 0xa08e, 0x0002, 0x0040,
- 0x6830, 0x6004, 0x1078, 0x6a79, 0x0040, 0x687f, 0xa08e, 0x0021,
- 0x0040, 0x6883, 0xa08e, 0x0022, 0x0040, 0x687f, 0x1078, 0x228f,
- 0x1078, 0x5e09, 0x1078, 0x5bb4, 0x007c, 0x0c7e, 0x0d7e, 0x6104,
- 0xa186, 0x0016, 0x0040, 0x686f, 0xa186, 0x0002, 0x00c0, 0x685e,
- 0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, 0x685e, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x685e, 0x8001, 0x6842, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x5b4e, 0x0040, 0x685e,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x686f, 0x0d7f, 0x0c7f,
- 0x1078, 0x5e09, 0x1078, 0x228f, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x22b1, 0x127f, 0x0e7f, 0x1078, 0x5bb4, 0x007c, 0x2001,
- 0x0002, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
- 0x4824, 0x1078, 0x4c2c, 0x0d7f, 0x0c7f, 0x0078, 0x686e, 0x1078,
- 0x5e09, 0x0078, 0x6832, 0x1078, 0x5e18, 0x0078, 0x6832, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x688f, 0x007c, 0x689f,
- 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f,
- 0x6785, 0x689f, 0x6786, 0x68a1, 0x6786, 0x68aa, 0x689f, 0x1078,
- 0x12d5, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x47d7, 0x1078,
- 0x4c2c, 0x007c, 0x1078, 0x6a3f, 0x1078, 0x68e3, 0x0040, 0x68cc,
- 0x1078, 0x228f, 0x0d7e, 0x1078, 0x68e3, 0x0040, 0x68bf, 0x6010,
- 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x3a2c, 0x0d7f,
- 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4824,
- 0x1078, 0x4c2c, 0x0078, 0x68ce, 0x1078, 0x5bb4, 0x007c, 0xa284,
- 0x0007, 0x00c0, 0x68e0, 0xa282, 0x7d00, 0x0048, 0x68e0, 0x2001,
- 0x7615, 0x2004, 0xa202, 0x00c8, 0x68e0, 0xa085, 0x0001, 0x007c,
- 0xa006, 0x0078, 0x68df, 0x027e, 0x0e7e, 0x2071, 0x7600, 0x6210,
- 0x7058, 0xa202, 0x0048, 0x68f5, 0x705c, 0xa202, 0x00c8, 0x68f5,
- 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078, 0x68f2,
- 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2061,
- 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, 0xa302, 0x00c8, 0x691e,
- 0x601c, 0xa206, 0x00c0, 0x6916, 0x1078, 0x6a79, 0x00c0, 0x6912,
- 0x1078, 0x5e09, 0x0c7e, 0x1078, 0x5bb4, 0x0c7f, 0xace0, 0x0008,
- 0x7054, 0xac02, 0x00c8, 0x691e, 0x0078, 0x6903, 0x127f, 0x007f,
- 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e,
- 0x2091, 0x8000, 0xa188, 0x7720, 0x210c, 0x81ff, 0x0040, 0x694b,
- 0x2061, 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, 0xa302, 0x00c8,
- 0x694b, 0x6018, 0xa106, 0x00c0, 0x6945, 0x1078, 0x228f, 0x017e,
- 0x0c7e, 0x1078, 0x5bb4, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x0048, 0x6939, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e,
- 0x057f, 0x0040, 0x6969, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
- 0x004b, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6965, 0x0c7e, 0x057e, 0x127e, 0x2091,
- 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5b4e, 0x057f, 0x0040, 0x6993,
- 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
- 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x2009, 0x004c, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f,
- 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x698f, 0x0c7e, 0x057e,
- 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5b4e, 0x057f,
- 0x0040, 0x69be, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
- 0x0c7e, 0x2560, 0x1078, 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078,
- 0x4857, 0x2c08, 0x1078, 0x7326, 0x2009, 0x004d, 0x1078, 0x5bdb,
+ 0x564b, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x1286, 0x0079, 0x5678,
+ 0x56aa, 0x56b6, 0x56aa, 0x56aa, 0x56aa, 0x56aa, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56aa,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56aa, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x4445, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0x6003, 0x0001,
+ 0x6106, 0x1078, 0x4445, 0x127e, 0x2091, 0x8000, 0x1078, 0x484d,
+ 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1286, 0xa1b6,
+ 0x0013, 0x00c0, 0x56ce, 0x2008, 0x0079, 0x5724, 0xa1b6, 0x0027,
+ 0x00c0, 0x570c, 0x1078, 0x4754, 0x6004, 0x1078, 0x6316, 0x0040,
+ 0x56df, 0x1078, 0x632a, 0x0040, 0x5708, 0x0078, 0x5703, 0x1078,
+ 0x2192, 0x2001, 0x0007, 0x1078, 0x3443, 0x6018, 0xa080, 0x0028,
+ 0x200c, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x56fa,
+ 0x1078, 0x3618, 0x0c7f, 0x2c08, 0x1078, 0x6bca, 0x037f, 0x027f,
+ 0x017f, 0x1078, 0x347f, 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c,
+ 0x1078, 0x579c, 0x0078, 0x5703, 0xa186, 0x0014, 0x1078, 0x4754,
+ 0x1078, 0x2174, 0x1078, 0x6316, 0x00c0, 0x571a, 0x1078, 0x2192,
+ 0x0078, 0x5703, 0x1078, 0x632a, 0x00c0, 0x5722, 0x1078, 0x579c,
+ 0x0078, 0x5703, 0x0078, 0x5703, 0x5756, 0x5758, 0x575c, 0x5760,
+ 0x5764, 0x5768, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x576c, 0x5772, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5772, 0x5772, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x1078, 0x1286, 0x0078, 0x5772,
+ 0x2001, 0x000b, 0x0078, 0x577b, 0x2001, 0x0003, 0x0078, 0x577b,
+ 0x2001, 0x0005, 0x0078, 0x577b, 0x2001, 0x0001, 0x0078, 0x577b,
+ 0x2001, 0x0009, 0x0078, 0x577b, 0x1078, 0x1286, 0x0078, 0x577a,
+ 0x1078, 0x3443, 0x1078, 0x4754, 0x6003, 0x0002, 0x6017, 0x0028,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x3443, 0x1078, 0x4754, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6f5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x578d, 0x2019, 0x0028, 0x0078, 0x5796, 0x8007, 0xa09a, 0x0004,
+ 0x0048, 0x5789, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
+ 0x1078, 0x484d, 0x0078, 0x577a, 0x0e7e, 0x1078, 0x61dc, 0x0040,
+ 0x57a9, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0100, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
+ 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1286, 0x6604, 0xa6b6,
+ 0x0028, 0x00c0, 0x57bf, 0x1078, 0x635f, 0x0078, 0x57e8, 0x6604,
+ 0xa6b6, 0x0029, 0x00c0, 0x57c8, 0x1078, 0x6379, 0x0078, 0x57e8,
+ 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x57d1, 0x1078, 0x5631, 0x0078,
+ 0x57e8, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x57da, 0x1078, 0x565a,
+ 0x0078, 0x57e8, 0xa1b6, 0x0015, 0x00c0, 0x57e2, 0x1079, 0x57ed,
+ 0x0078, 0x57e8, 0xa1b6, 0x0016, 0x00c0, 0x57e9, 0x1079, 0x58b6,
+ 0x007c, 0x1078, 0x55d5, 0x0078, 0x57e8, 0x57f9, 0x57fc, 0x57f9,
+ 0x583d, 0x57f9, 0x5865, 0x57f9, 0x57f9, 0x57f9, 0x588e, 0x57f9,
+ 0x58a4, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070,
+ 0xa086, 0x0074, 0x00c0, 0x5826, 0x1078, 0x6ba2, 0x00c0, 0x5818,
+ 0x0d7e, 0x6018, 0x2068, 0x1078, 0x582a, 0x0d7f, 0x2001, 0x0006,
+ 0x1078, 0x3443, 0x1078, 0x2192, 0x1078, 0x55a1, 0x0078, 0x5828,
+ 0x2001, 0x000a, 0x1078, 0x3443, 0x1078, 0x2192, 0x6003, 0x0001,
+ 0x6007, 0x0001, 0x1078, 0x4445, 0x0078, 0x5828, 0x1078, 0x5855,
+ 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x583c, 0x2001, 0x0000,
+ 0x1078, 0x342f, 0x2069, 0x6f51, 0x6804, 0xd0a4, 0x0040, 0x583c,
+ 0x2001, 0x0006, 0x1078, 0x3451, 0x007c, 0x2011, 0x6f1c, 0x2204,
+ 0xa086, 0x0074, 0x00c0, 0x5852, 0x1078, 0x597f, 0x2001, 0x0004,
+ 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4445,
+ 0x0078, 0x5854, 0x1078, 0x5855, 0x007c, 0x2001, 0x6f00, 0x2004,
+ 0xa086, 0x0003, 0x0040, 0x5860, 0x2001, 0x0007, 0x1078, 0x3443,
+ 0x1078, 0x55a1, 0x1078, 0x2192, 0x007c, 0x0e7e, 0x2071, 0x6f00,
+ 0x7070, 0xa086, 0x0014, 0x00c0, 0x588a, 0x7000, 0xa086, 0x0003,
+ 0x00c0, 0x5874, 0x1078, 0x2a40, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x3513, 0x1078, 0x582a, 0x0d7f, 0x1078, 0x5989, 0x00c0, 0x588a,
+ 0x2001, 0x0006, 0x1078, 0x3443, 0x1078, 0x55a1, 0x1078, 0x2192,
+ 0x0078, 0x588c, 0x1078, 0x5855, 0x0e7f, 0x007c, 0x2011, 0x6f1c,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x58a1, 0x2001, 0x0002, 0x1078,
+ 0x3443, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4445, 0x0078,
+ 0x58a3, 0x1078, 0x5855, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x58b3, 0x2001, 0x0007, 0x1078, 0x3443, 0x1078,
+ 0x55a1, 0x0078, 0x58b5, 0x1078, 0x5855, 0x007c, 0x57f9, 0x58c2,
+ 0x57f9, 0x58e8, 0x57f9, 0x5934, 0x57f9, 0x57f9, 0x57f9, 0x5947,
+ 0x57f9, 0x595a, 0x0c7e, 0x1078, 0x596d, 0x00c0, 0x58d7, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x0078, 0x58e6, 0x2009,
+ 0x738f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x58e4,
+ 0x1078, 0x55a1, 0x0078, 0x58e6, 0x1078, 0x5855, 0x0c7f, 0x007c,
+ 0x1078, 0x597c, 0x00c0, 0x58fc, 0x2001, 0x0000, 0x1078, 0x342f,
+ 0x2001, 0x0002, 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4445, 0x0078, 0x591c, 0x2009, 0x738e, 0x2134, 0xa6b4,
+ 0x00ff, 0xa686, 0x0005, 0x0040, 0x591d, 0x2009, 0x738f, 0x2104,
+ 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x591a, 0xa686, 0x0009,
+ 0x0040, 0x591d, 0x2001, 0x0004, 0x1078, 0x3443, 0x1078, 0x55a1,
+ 0x0078, 0x591c, 0x1078, 0x5855, 0x007c, 0x0d7e, 0x6018, 0x2068,
+ 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x592f, 0x8001, 0x6842,
+ 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x591c, 0x1078,
+ 0x2174, 0x0d7f, 0x0078, 0x591a, 0x1078, 0x597c, 0x00c0, 0x5944,
+ 0x2001, 0x0004, 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0003,
+ 0x1078, 0x4445, 0x0078, 0x5946, 0x1078, 0x5855, 0x007c, 0x1078,
+ 0x597c, 0x00c0, 0x5957, 0x2001, 0x0008, 0x1078, 0x3443, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4445, 0x0078, 0x5959, 0x1078,
+ 0x5855, 0x007c, 0x1078, 0x597c, 0x00c0, 0x596a, 0x2001, 0x000a,
+ 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4445,
+ 0x0078, 0x596c, 0x1078, 0x5855, 0x007c, 0x2009, 0x738e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x597b, 0x2009, 0x738f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x34a9, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x738c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x59ac, 0x7008, 0xa086, 0x0800, 0x00c0, 0x59ac, 0x700c, 0xd0ec,
+ 0x0040, 0x59aa, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59aa,
+ 0x7024, 0xd0a4, 0x0040, 0x59aa, 0xd08c, 0x0040, 0x59aa, 0xa006,
+ 0x0078, 0x59ac, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061,
+ 0x7500, 0x2071, 0x6f00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a03,
+ 0x1078, 0x6da8, 0x0040, 0x59fb, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x59fb, 0xa786, 0x0007, 0x0040, 0x59fb, 0x2500, 0xac06, 0x0040,
+ 0x59fb, 0x2400, 0xac06, 0x0040, 0x59fb, 0x0c7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x59e5, 0x1078, 0x1627, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x59f8, 0xa786, 0x0003, 0x00c0, 0x5a0d, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0,
+ 0x1078, 0x62fd, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x5a03, 0x0078, 0x59c3, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x59ef, 0x1078, 0x6d4c, 0x0078, 0x59f8, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5a20, 0x8210, 0x8318, 0x00f0, 0x5a15, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x5a28, 0x2001, 0x0001, 0x0078, 0x5a2a,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030,
+ 0x10c8, 0x1286, 0x1078, 0x6316, 0x0040, 0x5a3c, 0x1078, 0x632a,
+ 0x0040, 0x5a45, 0x0078, 0x5a3e, 0x1078, 0x2192, 0x1078, 0x4754,
+ 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c, 0x1078, 0x579c, 0x0078,
+ 0x5a3e, 0xa182, 0x0040, 0x0079, 0x5a4d, 0x5a5d, 0x5a5d, 0x5a5d,
+ 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d,
+ 0x5a5f, 0x5a5f, 0x5a5f, 0x5a5f, 0x5a5d, 0x1078, 0x1286, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x484d, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x5a74, 0x6004,
+ 0xa082, 0x0040, 0x0079, 0x5aea, 0xa186, 0x0027, 0x00c0, 0x5a91,
+ 0x1078, 0x4754, 0x1078, 0x2174, 0x0d7e, 0x6110, 0x2168, 0x1078,
+ 0x61dc, 0x0040, 0x5a8b, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078,
+ 0x36ec, 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1, 0x1078, 0x484d,
+ 0x007c, 0xa186, 0x0014, 0x00c0, 0x5a9a, 0x6004, 0xa082, 0x0040,
+ 0x0079, 0x5aba, 0xa186, 0x0047, 0x10c0, 0x1286, 0x2001, 0x0109,
+ 0x2004, 0xd084, 0x0040, 0x5ab7, 0x127e, 0x2091, 0x2200, 0x007e,
+ 0x017e, 0x027e, 0x1078, 0x42cb, 0x027f, 0x017f, 0x007f, 0x127f,
+ 0x6000, 0xa086, 0x0002, 0x00c0, 0x5ab7, 0x0078, 0x5b11, 0x1078,
+ 0x55d5, 0x007c, 0x5acc, 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5aca,
+ 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5ae3, 0x5ae3, 0x5ae3,
+ 0x5ae3, 0x5aca, 0x1078, 0x1286, 0x1078, 0x4754, 0x0d7e, 0x6110,
+ 0x2168, 0x1078, 0x61dc, 0x0040, 0x5add, 0x6837, 0x0103, 0x684b,
+ 0x0006, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x5afc, 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5afa,
+ 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5b0a, 0x5b0a, 0x5b0a,
+ 0x5b0a, 0x5afa, 0x1078, 0x1286, 0x1078, 0x4754, 0x6003, 0x0002,
+ 0x1078, 0x484d, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x007c, 0x1078, 0x4754, 0x6003, 0x000f, 0x1078, 0x484d,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x5b15, 0x5b25, 0x5b25, 0x5b25,
+ 0x5b25, 0x5b25, 0x5b27, 0x5bb0, 0x5bc8, 0x5b25, 0x5b25, 0x5b25,
+ 0x5b25, 0x5b25, 0x5b25, 0x5b25, 0x5b25, 0x1078, 0x1286, 0x0e7e,
+ 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff,
+ 0x86ff, 0x0040, 0x5b94, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x5b59, 0xa186, 0x0028, 0x00c0, 0x5b43, 0x1078, 0x6304, 0x684b,
+ 0x001c, 0x0078, 0x5b5b, 0xd6dc, 0x0040, 0x5b4e, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5b5b, 0xd6d4, 0x0040,
+ 0x5b59, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5b5b, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4,
+ 0x0040, 0x5b6e, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
+ 0x7398, 0xad90, 0x0019, 0x1078, 0x5fd2, 0x037f, 0xd6cc, 0x0040,
+ 0x5ba4, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5b82, 0x2071,
+ 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5fd2,
+ 0x0078, 0x5ba4, 0x6838, 0xd0fc, 0x0040, 0x5b8b, 0x2009, 0x0020,
+ 0x695a, 0x0078, 0x5b77, 0x0f7e, 0x2d78, 0x1078, 0x5f6a, 0x0f7f,
+ 0x1078, 0x5fbf, 0x0078, 0x5ba6, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x5ba4, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x5ba4, 0x1078, 0x5d18, 0x1078, 0x36ec, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x55a1, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x191c, 0x1078, 0x4464, 0x1078, 0x48fd, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1523, 0x007c, 0xa182, 0x0040, 0x0079, 0x5bd7, 0x5be7,
+ 0x5be7, 0x5be7, 0x5be7, 0x5be7, 0x5be9, 0x5c80, 0x5be7, 0x5be7,
+ 0x5c96, 0x5cf8, 0x5be7, 0x5be7, 0x5be7, 0x5be7, 0x5cff, 0x1078,
+ 0x1286, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x738c, 0x6110,
+ 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+ 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5c7b,
+ 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5c0a, 0x7018, 0x7862,
+ 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5c7b, 0x1078, 0x12e0,
+ 0x1040, 0x1286, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837,
+ 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46,
+ 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5c44, 0xa186, 0x0028,
+ 0x00c0, 0x5c2e, 0x684b, 0x001c, 0x0078, 0x5c46, 0xd6dc, 0x0040,
+ 0x5c39, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5c46, 0xd6d4, 0x0040, 0x5c44, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5c46, 0x684b, 0x0000, 0x6f4e, 0x7850,
+ 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c5b, 0x7328,
+ 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7398, 0xad90, 0x0019,
+ 0x1078, 0x5fd2, 0x037f, 0xd6cc, 0x0040, 0x5c7b, 0x7124, 0x695a,
+ 0xa192, 0x0021, 0x00c8, 0x5c6f, 0x2071, 0x7398, 0x831c, 0x2300,
+ 0xae18, 0xad90, 0x001d, 0x1078, 0x5fd2, 0x0078, 0x5c7b, 0x7838,
+ 0xd0fc, 0x0040, 0x5c78, 0x2009, 0x0020, 0x695a, 0x0078, 0x5c64,
+ 0x2d78, 0x1078, 0x5f6a, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x191c, 0x1078, 0x4f2a, 0x007c, 0x0d7e, 0x6003,
+ 0x0002, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6110, 0x2168, 0x694c,
+ 0xd1e4, 0x0040, 0x5cf6, 0xd1cc, 0x0040, 0x5cd1, 0x6948, 0x6838,
+ 0xd0fc, 0x0040, 0x5cc9, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e,
+ 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8,
+ 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x5cb8, 0x157f, 0x007f,
+ 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1309, 0x0078,
+ 0x5cf4, 0x017e, 0x1078, 0x1309, 0x0d7f, 0x1078, 0x5fbf, 0x0078,
+ 0x5cf4, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002,
+ 0x0040, 0x5cf0, 0xa086, 0x0028, 0x00c0, 0x5ce2, 0x684b, 0x001c,
+ 0x0078, 0x5cf2, 0xd1dc, 0x0040, 0x5ce9, 0x684b, 0x0015, 0x0078,
+ 0x5cf2, 0xd1d4, 0x0040, 0x5cf0, 0x684b, 0x0007, 0x0078, 0x5cf2,
+ 0x684b, 0x0000, 0x1078, 0x36ec, 0x1078, 0x55a1, 0x0d7f, 0x007c,
+ 0x6003, 0x0002, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x007c, 0x1078,
+ 0x47fc, 0x1078, 0x2174, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x61dc,
+ 0x0040, 0x5d12, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x36ec,
+ 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1, 0x1078, 0x48fd, 0x007c,
+ 0x684b, 0x0015, 0xd1fc, 0x0040, 0x5d24, 0x684b, 0x0007, 0x8002,
+ 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182,
+ 0x0040, 0x0079, 0x5d2b, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b,
+ 0x5d3d, 0x5d3b, 0x5de1, 0x5de9, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b,
+ 0x5d3b, 0x5d3b, 0x5d3b, 0x1078, 0x1286, 0x077e, 0x0f7e, 0x0e7e,
+ 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff,
+ 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211,
+ 0x6a3e, 0x86ff, 0x0040, 0x5dd3, 0xa694, 0xff00, 0xa284, 0x0c00,
+ 0x0040, 0x5d5e, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300,
+ 0x0040, 0x5dd0, 0x1078, 0x12e0, 0x1040, 0x1286, 0x2d00, 0x784a,
+ 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a,
+ 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186,
+ 0x0002, 0x0040, 0x5d99, 0xa186, 0x0028, 0x00c0, 0x5d83, 0x684b,
+ 0x001c, 0x0078, 0x5d9b, 0xd6dc, 0x0040, 0x5d8e, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d9b, 0xd6d4, 0x0040,
+ 0x5d99, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5d9b, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856,
+ 0xa01e, 0xd6c4, 0x0040, 0x5db0, 0x7328, 0x732c, 0x6b56, 0x037e,
+ 0x2308, 0x2019, 0x7398, 0xad90, 0x0019, 0x1078, 0x5fd2, 0x037f,
+ 0xd6cc, 0x0040, 0x5dd0, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
+ 0x5dc4, 0x2071, 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
+ 0x1078, 0x5fd2, 0x0078, 0x5dd0, 0x7838, 0xd0fc, 0x0040, 0x5dcd,
+ 0x2009, 0x0020, 0x695a, 0x0078, 0x5db9, 0x2d78, 0x1078, 0x5f6a,
+ 0xd6dc, 0x00c0, 0x5dd6, 0xa006, 0x0078, 0x5dda, 0x2001, 0x0001,
+ 0x7218, 0x731c, 0x1078, 0x1567, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f,
+ 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1523,
+ 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4,
+ 0x0040, 0x5e50, 0xd1cc, 0x0040, 0x5e20, 0x6948, 0x6838, 0xd0fc,
+ 0x0040, 0x5e18, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90,
+ 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304,
+ 0x2012, 0x8318, 0x8210, 0x00f0, 0x5e07, 0x157f, 0x007f, 0x6852,
+ 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1309, 0x0078, 0x5e4e,
+ 0x017e, 0x1078, 0x1309, 0x0d7f, 0x1078, 0x5fbf, 0x0078, 0x5e4e,
+ 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x5e3f, 0xa086, 0x0028, 0x00c0, 0x5e31, 0x684b, 0x001c, 0x0078,
+ 0x5e4c, 0xd1dc, 0x0040, 0x5e38, 0x684b, 0x0015, 0x0078, 0x5e4c,
+ 0xd1d4, 0x0040, 0x5e3f, 0x684b, 0x0007, 0x0078, 0x5e4c, 0x684b,
+ 0x0000, 0x684c, 0xd0ac, 0x0040, 0x5e4c, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x5e4c, 0x1078, 0x5d18, 0x1078, 0x36ec, 0x1078, 0x55a1,
+ 0x0d7f, 0x007c, 0x1078, 0x4754, 0x0078, 0x5e58, 0x1078, 0x47fc,
+ 0x1078, 0x61dc, 0x0040, 0x5e6f, 0x0d7e, 0x6110, 0x2168, 0x6837,
+ 0x0103, 0x2009, 0x6f0c, 0x210c, 0xd18c, 0x00c0, 0x5e78, 0xd184,
+ 0x00c0, 0x5e74, 0x6108, 0x694a, 0x1078, 0x36ec, 0x0d7f, 0x1078,
+ 0x55a1, 0x1078, 0x484d, 0x007c, 0x684b, 0x0004, 0x0078, 0x5e6c,
+ 0x684b, 0x0004, 0x0078, 0x5e6c, 0xa182, 0x0040, 0x0079, 0x5e80,
+ 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e92, 0x5e90, 0x5e95,
+ 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90,
+ 0x1078, 0x1286, 0x1078, 0x55a1, 0x007c, 0x007e, 0x027e, 0xa016,
+ 0x1078, 0x1523, 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079,
+ 0x5ea1, 0x5eaa, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8,
+ 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0xa186, 0x0013,
+ 0x00c0, 0x5ec0, 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x5ef4,
+ 0xa186, 0x0027, 0x00c0, 0x5ee1, 0x1078, 0x4754, 0x1078, 0x2174,
+ 0x0d7e, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x5ed7, 0x6837,
+ 0x0103, 0x684b, 0x0029, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f,
+ 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c, 0x1078, 0x55d5, 0x0078,
+ 0x5edc, 0xa186, 0x0014, 0x00c0, 0x5edd, 0x1078, 0x4754, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x5ed7, 0x6837, 0x0103,
+ 0x684b, 0x0006, 0x0078, 0x5ed3, 0x5efd, 0x5efb, 0x5efb, 0x5efb,
+ 0x5efb, 0x5efb, 0x5f06, 0x1078, 0x1286, 0x1078, 0x4754, 0x6017,
+ 0x0014, 0x6003, 0x000c, 0x1078, 0x484d, 0x007c, 0x1078, 0x4754,
+ 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x484d, 0x007c, 0xa182,
+ 0x008c, 0x00c8, 0x5f19, 0xa182, 0x0085, 0x0048, 0x5f19, 0x0079,
+ 0x5f1c, 0x1078, 0x55d5, 0x007c, 0x5f23, 0x5f23, 0x5f23, 0x5f23,
+ 0x5f25, 0x5f44, 0x5f23, 0x1078, 0x1286, 0x0d7e, 0x1078, 0x62f0,
+ 0x1078, 0x61dc, 0x0040, 0x5f40, 0x6010, 0x2068, 0x6837, 0x0103,
+ 0x6850, 0xd0b4, 0x0040, 0x5f38, 0x684b, 0x0006, 0x0078, 0x5f3c,
+ 0x684b, 0x0005, 0x1078, 0x63a3, 0x6847, 0x0000, 0x1078, 0x36ec,
+ 0x1078, 0x55a1, 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x5f5f, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040,
+ 0x5f55, 0x684b, 0x0006, 0x0078, 0x5f59, 0x684b, 0x0005, 0x1078,
+ 0x63a3, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f,
+ 0x1078, 0x55a1, 0x007c, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001,
+ 0xa182, 0x0101, 0x00c8, 0x5f76, 0x0078, 0x5f78, 0x2009, 0x0100,
+ 0x2130, 0x2069, 0x7398, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
+ 0xaf90, 0x001d, 0x1078, 0x5fd2, 0xa6b2, 0x0020, 0x7804, 0xa06d,
+ 0x0040, 0x5f8c, 0x1078, 0x1309, 0x1078, 0x12e0, 0x0040, 0x5fb6,
+ 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a,
+ 0x003d, 0x00c8, 0x5fa2, 0x2608, 0xad90, 0x000f, 0x1078, 0x5fd2,
+ 0x0078, 0x5fb6, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90,
+ 0x000f, 0x1078, 0x5fd2, 0x0078, 0x5f8c, 0x0f7f, 0x852f, 0xa5ad,
+ 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5fbb, 0x0f7f, 0x852f,
+ 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e,
+ 0x8dff, 0x0040, 0x5fd0, 0x6804, 0xa07d, 0x0040, 0x5fce, 0x6807,
+ 0x0000, 0x1078, 0x36ec, 0x2f68, 0x0078, 0x5fc3, 0x1078, 0x36ec,
+ 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x5fd8, 0x8108,
+ 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0,
+ 0x5fda, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084,
+ 0x0007, 0x1079, 0x5fed, 0x127f, 0x007c, 0x5ffc, 0x5ff5, 0x5ff7,
+ 0x6015, 0x5ff5, 0x5ff7, 0x5ff7, 0x5ff7, 0x1078, 0x1286, 0xa006,
+ 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x6012, 0xa00e, 0x2001, 0x0005, 0x1078, 0x377c,
+ 0x1078, 0x63a3, 0x1078, 0x36ec, 0x1078, 0x55a1, 0xa085, 0x0001,
+ 0x0d7f, 0x007c, 0xa006, 0x0078, 0x6010, 0x6000, 0xa08a, 0x0010,
+ 0x10c8, 0x1286, 0x1079, 0x601d, 0x007c, 0x602d, 0x604a, 0x602f,
+ 0x605b, 0x6046, 0x602d, 0x5ff7, 0x5ffc, 0x5ffc, 0x5ff7, 0x5ff7,
+ 0x5ff7, 0x5ff7, 0x5ff7, 0x5ff7, 0x5ff7, 0x1078, 0x1286, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6038, 0x1078, 0x63a3,
+ 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
+ 0x43f8, 0x1078, 0x484d, 0xa085, 0x0001, 0x007c, 0x1078, 0x1627,
+ 0x0078, 0x602f, 0x0e7e, 0x2071, 0x70b6, 0x7024, 0xac06, 0x00c0,
+ 0x6053, 0x1078, 0x5075, 0x1078, 0x4fe3, 0x0e7f, 0x00c0, 0x602f,
+ 0x1078, 0x5ff7, 0x007c, 0x037e, 0x0e7e, 0x2071, 0x70b6, 0x703c,
+ 0xac06, 0x00c0, 0x6067, 0x2019, 0x0000, 0x1078, 0x5107, 0x1078,
+ 0x53e3, 0x0e7f, 0x037f, 0x00c0, 0x602f, 0x1078, 0x5ff7, 0x007c,
+ 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x6078, 0x0c7f, 0x007c,
+ 0x6086, 0x60e3, 0x6180, 0x608a, 0x6086, 0x6086, 0x6a30, 0x55a1,
+ 0x1078, 0x632a, 0x00c0, 0x6086, 0x1078, 0x579c, 0x007c, 0x6017,
+ 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286, 0x1079,
+ 0x6092, 0x007c, 0x60a2, 0x60a4, 0x60c4, 0x60d6, 0x60d6, 0x60a2,
+ 0x6086, 0x6086, 0x6086, 0x60d6, 0x60d6, 0x60a2, 0x60a2, 0x60a2,
+ 0x60a2, 0x60e0, 0x1078, 0x1286, 0x0e7e, 0x6010, 0x2070, 0x7050,
+ 0xc0b5, 0x7052, 0x2071, 0x70b6, 0x7024, 0xac06, 0x0040, 0x60c0,
+ 0x1078, 0x4fe3, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
+ 0x6017, 0x0014, 0x1078, 0x43f8, 0x1078, 0x484d, 0x0e7f, 0x007c,
+ 0x6017, 0x0001, 0x0078, 0x60be, 0x0d7e, 0x6010, 0x2068, 0x6850,
+ 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
+ 0x0002, 0x1078, 0x43f8, 0x1078, 0x484d, 0x007c, 0x0d7e, 0x6017,
+ 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c,
+ 0x1078, 0x55a1, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286,
+ 0x1079, 0x60eb, 0x007c, 0x60fb, 0x6087, 0x60fd, 0x60fb, 0x60fb,
+ 0x60fb, 0x60fb, 0x60fb, 0x6080, 0x6080, 0x60fb, 0x60fb, 0x60fb,
+ 0x60fb, 0x60fb, 0x60fb, 0x1078, 0x1286, 0x0d7e, 0x6018, 0x2068,
+ 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x1286,
+ 0x1079, 0x610b, 0x007c, 0x6117, 0x6132, 0x6117, 0x6132, 0x6117,
+ 0x6132, 0x6119, 0x6122, 0x6117, 0x6132, 0x6117, 0x6127, 0x1078,
+ 0x1286, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6129, 0xa08e, 0x0002,
+ 0x0040, 0x6129, 0x6004, 0x1078, 0x632a, 0x0040, 0x617c, 0x1078,
+ 0x2174, 0x1078, 0x632a, 0x00c0, 0x612f, 0x1078, 0x579c, 0x1078,
+ 0x55a1, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040,
+ 0x616c, 0xa186, 0x0002, 0x00c0, 0x6157, 0x6018, 0x2068, 0x6840,
+ 0xa084, 0x00ff, 0xa005, 0x0040, 0x6157, 0x8001, 0x6842, 0x6013,
+ 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x553b, 0x0040,
+ 0x6157, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x616c, 0x0d7f,
+ 0x0c7f, 0x1078, 0x632a, 0x00c0, 0x615f, 0x1078, 0x579c, 0x1078,
+ 0x2174, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x2192, 0x127f,
+ 0x0e7f, 0x1078, 0x55a1, 0x007c, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x1078, 0x484d,
+ 0x0d7f, 0x0c7f, 0x0078, 0x616b, 0x1078, 0x579c, 0x0078, 0x612f,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286, 0x1079, 0x6188, 0x007c,
+ 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198,
+ 0x6198, 0x6086, 0x6198, 0x6087, 0x619a, 0x6087, 0x61a3, 0x6198,
+ 0x1078, 0x1286, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x43f8,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x62f0, 0x1078, 0x61dc, 0x0040,
+ 0x61c5, 0x1078, 0x2174, 0x0d7e, 0x1078, 0x61dc, 0x0040, 0x61b8,
+ 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x36ec,
+ 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
+ 0x4445, 0x1078, 0x484d, 0x0078, 0x61c7, 0x1078, 0x55a1, 0x007c,
+ 0xa284, 0x0007, 0x00c0, 0x61d9, 0xa282, 0x7500, 0x0048, 0x61d9,
+ 0x2001, 0x6f15, 0x2004, 0xa202, 0x00c8, 0x61d9, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x61d8, 0x027e, 0x0e7e, 0x2071, 0x6f00,
+ 0x6210, 0x7058, 0xa202, 0x0048, 0x61ee, 0x705c, 0xa202, 0x00c8,
+ 0x61ee, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078,
+ 0x61eb, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000,
+ 0x2061, 0x7500, 0x2071, 0x6f00, 0x7344, 0x7060, 0xa302, 0x00c8,
+ 0x6217, 0x601c, 0xa206, 0x00c0, 0x620f, 0x1078, 0x632a, 0x00c0,
+ 0x620b, 0x1078, 0x579c, 0x0c7e, 0x1078, 0x55a1, 0x0c7f, 0xace0,
+ 0x0008, 0x7054, 0xac02, 0x00c8, 0x6217, 0x0078, 0x61fc, 0x127f,
+ 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e,
+ 0x2091, 0x8000, 0x0c7e, 0x1078, 0x553b, 0x057f, 0x0040, 0x6236,
+ 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b, 0x1078, 0x55c8,
+ 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
+ 0x6232, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
+ 0x1078, 0x553b, 0x057f, 0x0040, 0x6260, 0x6013, 0x0000, 0x651a,
+ 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x3618, 0x0c7f, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x2009, 0x004c,
+ 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x625c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
+ 0x62a0, 0x0c7e, 0x1078, 0x553b, 0x057f, 0x0040, 0x628b, 0x6612,
+ 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078,
+ 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078,
+ 0x6bca, 0x2009, 0x004d, 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f,
+ 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6287, 0x0c7e, 0x057e,
+ 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x553b, 0x057f,
+ 0x0040, 0x62b6, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
+ 0x0c7e, 0x2560, 0x1078, 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078,
+ 0x4478, 0x2c08, 0x1078, 0x6bca, 0x2009, 0x004e, 0x1078, 0x55c8,
0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x69ba, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
- 0x1078, 0x5b4e, 0x057f, 0x0040, 0x69e9, 0x6612, 0x651a, 0x601f,
- 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x3958, 0x0c7f,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078, 0x7326, 0x2009,
- 0x004e, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x69e5, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x6a05, 0x660a, 0x611a,
- 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5bdb,
- 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a02,
- 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e, 0x017f,
- 0x0040, 0x6a21, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012,
- 0x2009, 0x0021, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6a1e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x6a3c, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5bdb, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a39, 0x027e,
- 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6a49, 0x8211,
- 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007,
- 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x7652,
- 0x2634, 0xd6e4, 0x0040, 0x6a61, 0x6618, 0x2660, 0x6e44, 0x1078,
- 0x3890, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e, 0x6004,
- 0xa08e, 0x0002, 0x0040, 0x6a76, 0xa08e, 0x0003, 0x0040, 0x6a76,
- 0xa08e, 0x0004, 0x0040, 0x6a76, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040, 0x6a8e,
- 0xa08e, 0x001f, 0x0040, 0x6a8e, 0xa08e, 0x0028, 0x0040, 0x6a8e,
- 0xa08e, 0x0029, 0x0040, 0x6a8e, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e,
- 0x017f, 0x0040, 0x6aab, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
- 0x1078, 0x228f, 0x2009, 0x0028, 0x1078, 0x5bdb, 0xa085, 0x0001,
- 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6aa8, 0xa186, 0x0015,
- 0x00c0, 0x6ac3, 0x2011, 0x761e, 0x2204, 0xa086, 0x0074, 0x00c0,
- 0x6ac3, 0x1078, 0x6079, 0x6003, 0x0001, 0x6007, 0x0029, 0x1078,
- 0x4824, 0x0078, 0x6ac7, 0x1078, 0x5e09, 0x1078, 0x5bb4, 0x007c,
- 0xa186, 0x0015, 0x00c0, 0x6ae5, 0x2011, 0x761e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x6ae5, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3853,
- 0x0d7f, 0x1078, 0x6083, 0x00c0, 0x6ae5, 0x2001, 0x0006, 0x1078,
- 0x3783, 0x1078, 0x5c5f, 0x0078, 0x6ae9, 0x1078, 0x5e09, 0x1078,
- 0x5bb4, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x6af1, 0x1078,
- 0x6af2, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6b00, 0x067f, 0x007c,
- 0x6b10, 0x6ce7, 0x6dc8, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10,
- 0x6b4a, 0x6e36, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10,
- 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5,
- 0x1079, 0x6b1c, 0x067f, 0x007c, 0x6b2c, 0x7137, 0x6b2c, 0x6b2c,
- 0x6b2c, 0x6b2c, 0x6b2c, 0x6b2c, 0x7112, 0x7181, 0x6b2c, 0x6b2c,
- 0x6b2c, 0x6b2c, 0x6b2c, 0x6b2c, 0x1078, 0x12d5, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6b38, 0x067f, 0x007c,
- 0x6b48, 0x6f83, 0x6ff5, 0x7017, 0x7063, 0x6b48, 0x6b48, 0x70bd,
- 0x6e42, 0x70fa, 0x70fe, 0x6b48, 0x6b48, 0x6b48, 0x6b48, 0x6b48,
- 0x1078, 0x12d5, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x2100, 0x0079,
- 0x6b51, 0x6b81, 0x6c5e, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b83, 0x6bb2, 0x6bbd, 0x6be5, 0x6beb, 0x6c1f, 0x6c57, 0x6b81,
- 0x6b81, 0x6c66, 0x6b81, 0x6b81, 0x6c6d, 0x6c74, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6c91, 0x6b81, 0x6b81, 0x6c9c, 0x6b81,
- 0x6b81, 0x1078, 0x12d5, 0x1078, 0x39d8, 0x6618, 0x0c7e, 0x2660,
- 0x1078, 0x37e9, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
- 0xa082, 0x0006, 0x0048, 0x6ba4, 0x1078, 0x7262, 0x00c0, 0x6bdf,
- 0x1078, 0x7200, 0x00c0, 0x6ba0, 0x6007, 0x0008, 0x0078, 0x6c59,
- 0x6007, 0x0009, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6bae,
- 0x1078, 0x7262, 0x0040, 0x6b98, 0x0078, 0x6bdf, 0x6013, 0x1900,
- 0x0078, 0x6ba0, 0x6106, 0x1078, 0x71c2, 0x6007, 0x0006, 0x0078,
- 0x6c59, 0x6007, 0x0007, 0x0078, 0x6c59, 0x0d7e, 0x6618, 0x2668,
- 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6bcf,
- 0xa686, 0x0004, 0x0040, 0x6bcf, 0x0d7f, 0x0078, 0x6bdf, 0x1078,
- 0x72c0, 0x00c0, 0x6bda, 0x1078, 0x3853, 0x6007, 0x000a, 0x0d7f,
- 0x0078, 0x6c59, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x6c59, 0x1078,
- 0x228f, 0x6007, 0x0001, 0x0078, 0x6c59, 0x1078, 0x228f, 0x6007,
- 0x000c, 0x0078, 0x6c59, 0x1078, 0x39d8, 0x6618, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x6c0c, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6bdf, 0x1078, 0x72cf,
- 0x00c0, 0x6c06, 0x6007, 0x000e, 0x0078, 0x6c59, 0x1078, 0x228f,
- 0x6007, 0x000f, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6c19,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6bfe, 0x0078,
- 0x6bdf, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6c59, 0x1078,
- 0x39d8, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082,
- 0x0006, 0x0048, 0x6c44, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x00c0, 0x6bdf, 0x1078, 0x72fa, 0x00c0, 0x6c3e, 0x1078, 0x7200,
- 0x00c0, 0x6c3e, 0x6007, 0x0010, 0x0078, 0x6c59, 0x1078, 0x228f,
- 0x6007, 0x0011, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6c51,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6c32, 0x0078,
- 0x6bdf, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6c59, 0x6007,
- 0x0012, 0x6003, 0x0001, 0x1078, 0x4824, 0x007c, 0x6007, 0x0001,
- 0x6003, 0x0001, 0x1078, 0x4824, 0x0078, 0x6c5d, 0x6007, 0x0020,
- 0x6003, 0x0001, 0x1078, 0x4824, 0x007c, 0x6007, 0x0023, 0x6003,
- 0x0001, 0x1078, 0x4824, 0x007c, 0x017e, 0x027e, 0x2011, 0x7b88,
- 0x2214, 0x2c08, 0x1078, 0x74bf, 0x00c0, 0x6c85, 0x2160, 0x6007,
- 0x0026, 0x6013, 0x1700, 0x0078, 0x6c8a, 0x1078, 0x5bb4, 0x2160,
- 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4824, 0x027f, 0x017f,
- 0x007c, 0x6106, 0x1078, 0x6ca3, 0x6007, 0x002b, 0x0078, 0x6c59,
- 0x6007, 0x002c, 0x0078, 0x6c59, 0x6106, 0x1078, 0x6ca8, 0x6007,
- 0x002e, 0x0078, 0x6c59, 0x0d7e, 0x1078, 0x6cce, 0x0d7f, 0x007c,
- 0x0d7e, 0x1078, 0x6cdd, 0x00c0, 0x6cc7, 0x680c, 0xa08c, 0xff00,
- 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6cbc,
- 0x2009, 0x0001, 0x0078, 0x6cc3, 0xd1ec, 0x0040, 0x6cc7, 0x2009,
- 0x0000, 0xa294, 0x00ff, 0x1078, 0x22d3, 0x0078, 0x6ccb, 0xa085,
- 0x0001, 0x0078, 0x6ccc, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x7b8d,
- 0x6800, 0xa082, 0x0010, 0x00c8, 0x6cdb, 0x6013, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x6cdc, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
- 0x7b8c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
- 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6, 0x0013, 0x00c0, 0x6cf3,
- 0x2008, 0x0079, 0x6d06, 0xa1b6, 0x0027, 0x0040, 0x6cfb, 0xa1b6,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x3791, 0x1078,
- 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c, 0x6d36, 0x6d38,
- 0x6d36, 0x6d36, 0x6d36, 0x6d38, 0x6d40, 0x6da3, 0x6d66, 0x6da3,
- 0x6d7a, 0x6da3, 0x6d40, 0x6da3, 0x6d9b, 0x6da3, 0x6d9b, 0x6da3,
- 0x6da3, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36,
- 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6da3, 0x6d36,
- 0x6d36, 0x6da3, 0x6d36, 0x6da3, 0x6da3, 0x6d36, 0x6d36, 0x6d36,
- 0x6d36, 0x6da3, 0x6da3, 0x6d36, 0x6da3, 0x6da3, 0x1078, 0x12d5,
- 0x1078, 0x4b33, 0x6003, 0x0002, 0x1078, 0x4c2c, 0x0078, 0x6da9,
- 0x0f7e, 0x2079, 0x7651, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6da3,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783,
- 0x1078, 0x4b33, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
- 0x1078, 0x4824, 0x1078, 0x4c2c, 0x0c7e, 0x6118, 0x2160, 0x2009,
- 0x0001, 0x1078, 0x452d, 0x0c7f, 0x0078, 0x6da9, 0x6618, 0x0d7e,
+ 0x62b2, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x62d2, 0x660a, 0x611a, 0x601f, 0x0001, 0x2d00,
+ 0x6012, 0x2009, 0x001f, 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f,
+ 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62cf, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x0c7e, 0x1078, 0x553b, 0x017f, 0x0040, 0x62ed, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x55c8,
+ 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62ea,
+ 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x62fa,
+ 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f,
+ 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031,
+ 0x6f52, 0x2634, 0xd6e4, 0x0040, 0x6312, 0x6618, 0x2660, 0x6e44,
+ 0x1078, 0x3550, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e,
+ 0x6004, 0xa08e, 0x0002, 0x0040, 0x6327, 0xa08e, 0x0003, 0x0040,
+ 0x6327, 0xa08e, 0x0004, 0x0040, 0x6327, 0xa085, 0x0001, 0x017f,
+ 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040,
+ 0x633f, 0xa08e, 0x001f, 0x0040, 0x633f, 0xa08e, 0x0028, 0x0040,
+ 0x633f, 0xa08e, 0x0029, 0x0040, 0x633f, 0xa085, 0x0001, 0x017f,
+ 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
+ 0x553b, 0x017f, 0x0040, 0x635c, 0x611a, 0x601f, 0x0001, 0x2d00,
+ 0x6012, 0x1078, 0x2174, 0x2009, 0x0028, 0x1078, 0x55c8, 0xa085,
+ 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6359, 0xa186,
+ 0x0015, 0x00c0, 0x6374, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0074,
+ 0x00c0, 0x6374, 0x1078, 0x597f, 0x6003, 0x0001, 0x6007, 0x0029,
+ 0x1078, 0x4445, 0x0078, 0x6378, 0x1078, 0x579c, 0x1078, 0x55a1,
+ 0x007c, 0xa186, 0x0015, 0x00c0, 0x6396, 0x2011, 0x6f1c, 0x2204,
+ 0xa086, 0x0014, 0x00c0, 0x6396, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x3513, 0x0d7f, 0x1078, 0x5989, 0x00c0, 0x6396, 0x2001, 0x0006,
+ 0x1078, 0x3443, 0x1078, 0x564b, 0x0078, 0x639a, 0x1078, 0x579c,
+ 0x1078, 0x55a1, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x63a2,
+ 0x1078, 0x63a3, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079, 0x63b1, 0x067f,
+ 0x007c, 0x63c1, 0x658f, 0x6670, 0x63c1, 0x63c1, 0x63c1, 0x63c1,
+ 0x63c1, 0x63fb, 0x66d6, 0x63c1, 0x63c1, 0x63c1, 0x63c1, 0x63c1,
+ 0x63c1, 0x1078, 0x1286, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+ 0x1286, 0x1079, 0x63cd, 0x067f, 0x007c, 0x63dd, 0x69df, 0x63dd,
+ 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x69ba, 0x6a29, 0x63dd,
+ 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x1078, 0x1286, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079, 0x63e9, 0x067f,
+ 0x007c, 0x63f9, 0x6827, 0x6899, 0x68bb, 0x690b, 0x63f9, 0x63f9,
+ 0x6965, 0x66e2, 0x69a2, 0x69a6, 0x63f9, 0x63f9, 0x63f9, 0x63f9,
+ 0x63f9, 0x1078, 0x1286, 0xa1b2, 0x0030, 0x10c8, 0x1286, 0x2100,
+ 0x0079, 0x6402, 0x6432, 0x650f, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6434, 0x6463, 0x646e, 0x6496, 0x649c, 0x64d0, 0x6508,
+ 0x6432, 0x6432, 0x6517, 0x6432, 0x6432, 0x6432, 0x651e, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6539, 0x6432, 0x6432, 0x6544,
+ 0x6432, 0x6432, 0x1078, 0x1286, 0x1078, 0x3698, 0x6618, 0x0c7e,
+ 0x2660, 0x1078, 0x34a9, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684,
+ 0x00ff, 0xa082, 0x0006, 0x0048, 0x6455, 0x1078, 0x6b09, 0x00c0,
+ 0x6490, 0x1078, 0x6aa7, 0x00c0, 0x6451, 0x6007, 0x0008, 0x0078,
+ 0x650a, 0x6007, 0x0009, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x645f, 0x1078, 0x6b09, 0x0040, 0x6449, 0x0078, 0x6490, 0x6013,
+ 0x1900, 0x0078, 0x6451, 0x6106, 0x1078, 0x6a6a, 0x6007, 0x0006,
+ 0x0078, 0x650a, 0x6007, 0x0007, 0x0078, 0x650a, 0x0d7e, 0x6618,
+ 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x6480, 0xa686, 0x0004, 0x0040, 0x6480, 0x0d7f, 0x0078, 0x6490,
+ 0x1078, 0x6b67, 0x00c0, 0x648b, 0x1078, 0x3513, 0x6007, 0x000a,
+ 0x0d7f, 0x0078, 0x650a, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x650a,
+ 0x1078, 0x2174, 0x6007, 0x0001, 0x0078, 0x650a, 0x1078, 0x2174,
+ 0x6007, 0x000c, 0x0078, 0x650a, 0x1078, 0x3698, 0x6618, 0xa6b0,
+ 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x64bd,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6490, 0x1078,
+ 0x6b76, 0x00c0, 0x64b7, 0x6007, 0x000e, 0x0078, 0x650a, 0x1078,
+ 0x2174, 0x6007, 0x000f, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x64ca, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af,
+ 0x0078, 0x6490, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x650a,
+ 0x1078, 0x3698, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
+ 0xa082, 0x0006, 0x0048, 0x64f5, 0xa6b4, 0xff00, 0x8637, 0xa686,
+ 0x0006, 0x00c0, 0x6490, 0x1078, 0x6ba2, 0x00c0, 0x64ef, 0x1078,
+ 0x6aa7, 0x00c0, 0x64ef, 0x6007, 0x0010, 0x0078, 0x650a, 0x1078,
+ 0x2174, 0x6007, 0x0011, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x6502, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64e3,
+ 0x0078, 0x6490, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x650a,
+ 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x4445, 0x007c, 0x6007,
+ 0x0001, 0x6003, 0x0001, 0x1078, 0x4445, 0x0078, 0x650e, 0x6007,
+ 0x0020, 0x6003, 0x0001, 0x1078, 0x4445, 0x007c, 0x017e, 0x027e,
+ 0x2011, 0x7388, 0x2214, 0x2c08, 0x1078, 0x6d63, 0x00c0, 0x652f,
+ 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078, 0x6532, 0x2160,
+ 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4445, 0x027f, 0x017f,
+ 0x007c, 0x6106, 0x1078, 0x654b, 0x6007, 0x002b, 0x0078, 0x650a,
+ 0x6007, 0x002c, 0x0078, 0x650a, 0x6106, 0x1078, 0x6550, 0x6007,
+ 0x002e, 0x0078, 0x650a, 0x0d7e, 0x1078, 0x6576, 0x0d7f, 0x007c,
+ 0x0d7e, 0x1078, 0x6585, 0x00c0, 0x656f, 0x680c, 0xa08c, 0xff00,
+ 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6564,
+ 0x2009, 0x0001, 0x0078, 0x656b, 0xd1ec, 0x0040, 0x656f, 0x2009,
+ 0x0000, 0xa294, 0x00ff, 0x1078, 0x21a3, 0x0078, 0x6573, 0xa085,
+ 0x0001, 0x0078, 0x6574, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x738d,
+ 0x6800, 0xa082, 0x0010, 0x00c8, 0x6583, 0x6013, 0x0000, 0xa085,
+ 0x0001, 0x0078, 0x6584, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
+ 0x738c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
+ 0xa0b2, 0x0030, 0x10c8, 0x1286, 0xa1b6, 0x0013, 0x00c0, 0x659b,
+ 0x2008, 0x0079, 0x65ae, 0xa1b6, 0x0027, 0x0040, 0x65a3, 0xa1b6,
+ 0x0014, 0x10c0, 0x1286, 0x2001, 0x0007, 0x1078, 0x3451, 0x1078,
+ 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d, 0x007c, 0x65de, 0x65e0,
+ 0x65de, 0x65de, 0x65de, 0x65e0, 0x65e8, 0x664b, 0x660e, 0x664b,
+ 0x6622, 0x664b, 0x65e8, 0x664b, 0x6643, 0x664b, 0x6643, 0x664b,
+ 0x664b, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de,
+ 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x664b, 0x65de,
+ 0x65de, 0x65de, 0x65de, 0x664b, 0x664b, 0x65de, 0x65de, 0x65de,
+ 0x65de, 0x664b, 0x664b, 0x65de, 0x664b, 0x664b, 0x1078, 0x1286,
+ 0x1078, 0x4754, 0x6003, 0x0002, 0x1078, 0x484d, 0x0078, 0x6651,
+ 0x0f7e, 0x2079, 0x6f51, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x664b,
+ 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x1078, 0x4754, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4445, 0x1078, 0x484d, 0x0c7e, 0x6118, 0x2160, 0x2009,
+ 0x0001, 0x1078, 0x4160, 0x0c7f, 0x0078, 0x6651, 0x6618, 0x0d7e,
0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6da3, 0xa686, 0x0004, 0x0040, 0x6da3, 0x2001, 0x0004,
- 0x0078, 0x6da1, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x6d83, 0x1078, 0x2d80, 0x2001, 0x0006, 0x1078, 0x6daa, 0x6618,
+ 0x0040, 0x664b, 0xa686, 0x0004, 0x0040, 0x664b, 0x2001, 0x0004,
+ 0x0078, 0x6649, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0,
+ 0x662b, 0x1078, 0x2a40, 0x2001, 0x0006, 0x1078, 0x6652, 0x6618,
0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x6da3, 0x2001, 0x0006, 0x0078, 0x6da1, 0x2001,
- 0x0004, 0x0078, 0x6da1, 0x2001, 0x0006, 0x1078, 0x6daa, 0x0078,
- 0x6da3, 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x5bb4, 0x1078,
- 0x4c2c, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
- 0x0040, 0x6dc5, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6dbd, 0x699c,
- 0xd1a4, 0x00c0, 0x6dbd, 0x2001, 0x0007, 0x1078, 0x3783, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x1078, 0x22b1, 0x0d7f, 0x017f, 0x007c,
+ 0x0006, 0x0040, 0x664b, 0x2001, 0x0006, 0x0078, 0x6649, 0x2001,
+ 0x0004, 0x0078, 0x6649, 0x2001, 0x0006, 0x1078, 0x6652, 0x0078,
+ 0x664b, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
+ 0x0040, 0x666d, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6665, 0x699c,
+ 0xd1a4, 0x00c0, 0x6665, 0x2001, 0x0007, 0x1078, 0x3443, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x1078, 0x2192, 0x0d7f, 0x017f, 0x007c,
0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0xa1b6, 0x0015, 0x00c0, 0x6ddc,
- 0x1079, 0x6de3, 0x0078, 0x6de2, 0xa1b6, 0x0016, 0x10c0, 0x12d5,
- 0x1079, 0x6e1b, 0x007c, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x5e93,
- 0x5e93, 0x5e93, 0x6def, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x0f7e,
- 0x2079, 0x7651, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6e0b, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x601f,
- 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4824, 0x1078,
- 0x4c2c, 0x0078, 0x6e1a, 0x2011, 0x7b83, 0x220c, 0x017e, 0x0c7e,
- 0x1078, 0x37d7, 0x00c0, 0x6e1a, 0x1078, 0x35db, 0x0c7f, 0x017f,
- 0x1078, 0x5bb4, 0x007c, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x5e93,
- 0x5e93, 0x5e93, 0x6e27, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x1078,
- 0x6076, 0x00c0, 0x6e33, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
- 0x4824, 0x0078, 0x6e35, 0x1078, 0x5bb4, 0x007c, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078,
- 0x4c2c, 0x007c, 0xa182, 0x0040, 0x0079, 0x6e46, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e58, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x1078, 0x12d5,
+ 0xa0b2, 0x000c, 0x10c8, 0x1286, 0xa1b6, 0x0015, 0x00c0, 0x6684,
+ 0x1079, 0x668b, 0x0078, 0x668a, 0xa1b6, 0x0016, 0x10c0, 0x1286,
+ 0x1079, 0x66bb, 0x007c, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x57f9,
+ 0x57f9, 0x57f9, 0x6697, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x0f7e,
+ 0x2079, 0x6f51, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x66b3, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443, 0x601f,
+ 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x1078,
+ 0x484d, 0x0078, 0x66ba, 0x2011, 0x7383, 0x220c, 0x1078, 0x329b,
+ 0x1078, 0x55a1, 0x007c, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x57f9,
+ 0x57f9, 0x57f9, 0x66c7, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x1078,
+ 0x597c, 0x00c0, 0x66d3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
+ 0x4445, 0x0078, 0x66d5, 0x1078, 0x55a1, 0x007c, 0x6004, 0xa08a,
+ 0x0030, 0x10c8, 0x1286, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0xa182, 0x0040, 0x0079, 0x66e6, 0x66f6, 0x66f6,
+ 0x66f6, 0x66f6, 0x66f8, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6,
+ 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x1078, 0x1286,
0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, 0x027e, 0x6106, 0x2071,
- 0x7b80, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6ec9, 0xa486, 0x2000,
- 0x0040, 0x6e88, 0xa486, 0x0400, 0x0040, 0x6e88, 0x7130, 0xa18c,
- 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6f5b, 0x0c7e, 0x1078, 0x45be,
- 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6f3c, 0x1078,
- 0x467c, 0x0040, 0x6f67, 0xa295, 0x0200, 0x6a02, 0x0078, 0x6e8e,
- 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x4666, 0x1078, 0x132f,
- 0x1040, 0x12d5, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803,
+ 0x7380, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6769, 0xa486, 0x2000,
+ 0x0040, 0x6728, 0xa486, 0x0400, 0x0040, 0x6728, 0x7130, 0xa18c,
+ 0x00ff, 0xa182, 0x0010, 0x00c8, 0x67fb, 0x0c7e, 0x1078, 0x41f1,
+ 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x67dc, 0x1078,
+ 0x42af, 0x0040, 0x6807, 0xa295, 0x0200, 0x6a02, 0x0078, 0x672e,
+ 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x4299, 0x1078, 0x12e0,
+ 0x1040, 0x1286, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803,
0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078,
0x78a0, 0x8007, 0x7130, 0xa18c, 0x00ff, 0xa10d, 0x6946, 0x684f,
- 0x0000, 0x6857, 0x0036, 0x1078, 0x3a2c, 0xa486, 0x2000, 0x00c0,
- 0x6eb7, 0x2019, 0x0017, 0x1078, 0x7484, 0x0078, 0x6f29, 0xa486,
- 0x0400, 0x00c0, 0x6ec1, 0x2019, 0x0002, 0x1078, 0x7484, 0x0078,
- 0x6f29, 0xa486, 0x0200, 0x00c0, 0x6ec7, 0x1078, 0x7475, 0x0078,
- 0x6f29, 0x7130, 0xa184, 0xff00, 0x00c0, 0x6f7b, 0xa18c, 0x00ff,
- 0xa182, 0x0010, 0x00c8, 0x6f7b, 0x0c7e, 0x1078, 0x45be, 0x2c68,
- 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6f7f, 0xa284, 0x0300,
- 0x00c0, 0x6f77, 0x6804, 0xa005, 0x0040, 0x6f67, 0x8001, 0x6806,
- 0x6003, 0x0007, 0x1078, 0x1314, 0x0040, 0x6f30, 0x6013, 0x0000,
+ 0x0000, 0x6857, 0x0036, 0x1078, 0x36ec, 0xa486, 0x2000, 0x00c0,
+ 0x6757, 0x2019, 0x0017, 0x1078, 0x6d28, 0x0078, 0x67c9, 0xa486,
+ 0x0400, 0x00c0, 0x6761, 0x2019, 0x0002, 0x1078, 0x6d28, 0x0078,
+ 0x67c9, 0xa486, 0x0200, 0x00c0, 0x6767, 0x1078, 0x6d19, 0x0078,
+ 0x67c9, 0x7130, 0xa184, 0xff00, 0x00c0, 0x681f, 0xa18c, 0x00ff,
+ 0xa182, 0x0010, 0x00c8, 0x681f, 0x0c7e, 0x1078, 0x41f1, 0x2c68,
+ 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6823, 0xa284, 0x0300,
+ 0x00c0, 0x681b, 0x6804, 0xa005, 0x0040, 0x6807, 0x8001, 0x6806,
+ 0x6003, 0x0007, 0x1078, 0x12c5, 0x0040, 0x67d0, 0x6013, 0x0000,
0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a,
0x6018, 0x2078, 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d,
- 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x6f0b, 0x684f,
- 0x0040, 0x0078, 0x6f15, 0xa086, 0x0001, 0x00c0, 0x6f13, 0x684f,
- 0x0080, 0x0078, 0x6f15, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
- 0x7b90, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
- 0x00f0, 0x6f1b, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
- 0x3a2c, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
- 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x47d7,
- 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x2069, 0x7b92, 0x2d04, 0xa084,
- 0xff00, 0xa086, 0x1200, 0x00c0, 0x6f5b, 0x2069, 0x7b80, 0x686c,
+ 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x67ab, 0x684f,
+ 0x0040, 0x0078, 0x67b5, 0xa086, 0x0001, 0x00c0, 0x67b3, 0x684f,
+ 0x0080, 0x0078, 0x67b5, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
+ 0x7390, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
+ 0x00f0, 0x67bb, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
+ 0x36ec, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
+ 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x43f8,
+ 0x1078, 0x484d, 0x0078, 0x67c9, 0x2069, 0x7392, 0x2d04, 0xa084,
+ 0xff00, 0xa086, 0x1200, 0x00c0, 0x67fb, 0x2069, 0x7380, 0x686c,
0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112,
- 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x47d7, 0x1078,
- 0x4c2c, 0x0078, 0x6f29, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x6013,
- 0x0300, 0x0078, 0x6f6d, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x6013,
- 0x0500, 0x0078, 0x6f6d, 0x6013, 0x0600, 0x0078, 0x6f3c, 0x6013,
- 0x0200, 0x0078, 0x6f3c, 0xa186, 0x0013, 0x00c0, 0x6f95, 0x6004,
- 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5,
- 0xa082, 0x0040, 0x2008, 0x0079, 0x6fc6, 0xa186, 0x0047, 0x00c0,
- 0x6f9b, 0x0078, 0x6ff5, 0xa186, 0x0027, 0x0040, 0x6fa3, 0xa186,
- 0x0014, 0x10c0, 0x12d5, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079,
- 0x6fa9, 0x6fb9, 0x6fbb, 0x6fbb, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9,
- 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9,
- 0x6fb9, 0x1078, 0x12d5, 0x2001, 0x0007, 0x1078, 0x3791, 0x1078,
- 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c, 0x6fd6, 0x6fe6,
- 0x6fdf, 0x6fef, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6,
- 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x1078, 0x12d5,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078,
- 0x4b33, 0x6003, 0x0002, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x4b33,
- 0x1078, 0x463f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x4b33, 0x2009, 0x0041, 0x0078, 0x70bd, 0xa182, 0x0040, 0x0079,
- 0x6ff9, 0x7009, 0x700b, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009,
- 0x700c, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009,
- 0x7009, 0x1078, 0x12d5, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x701b, 0x702b, 0x702b, 0x702b, 0x702b, 0x702b,
- 0x702b, 0x702b, 0x702b, 0x702b, 0x702d, 0x7050, 0x702b, 0x702b,
- 0x702b, 0x702b, 0x7050, 0x1078, 0x12d5, 0x1078, 0x4bdb, 0x1078,
- 0x4cec, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x7043,
- 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040, 0x7049, 0x2009, 0x0041,
- 0x0d7f, 0x0078, 0x70bd, 0x6003, 0x0007, 0x1078, 0x463f, 0x0d7f,
- 0x007c, 0x1078, 0x463f, 0x1078, 0x5bb4, 0x0d7f, 0x0078, 0x7048,
- 0x037e, 0x1078, 0x4bdb, 0x1078, 0x4cec, 0x6010, 0x0d7e, 0x2068,
- 0x2019, 0x0004, 0x1078, 0x74a8, 0x1078, 0x6a4c, 0x6017, 0x0028,
- 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7071, 0x6004,
- 0xa086, 0x0042, 0x10c0, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x4c2c,
- 0x007c, 0xa186, 0x0027, 0x0040, 0x7079, 0xa186, 0x0014, 0x00c0,
- 0x7089, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12d5, 0x2001, 0x0007,
- 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x708d, 0x709d, 0x709d, 0x709d,
- 0x709d, 0x709d, 0x709d, 0x709d, 0x709f, 0x70ab, 0x709d, 0x709d,
- 0x709d, 0x709d, 0x709d, 0x709d, 0x709d, 0x1078, 0x12d5, 0x037e,
- 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572,
+ 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x43f8, 0x1078,
+ 0x484d, 0x0078, 0x67c9, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
+ 0x0041, 0x1078, 0x43f8, 0x1078, 0x484d, 0x0078, 0x67c9, 0xa284,
+ 0x0004, 0x00c0, 0x680f, 0x6013, 0x0300, 0x0078, 0x6811, 0x6013,
+ 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x43f8, 0x1078,
+ 0x484d, 0x0078, 0x67c9, 0x6013, 0x0500, 0x0078, 0x6811, 0x6013,
+ 0x0600, 0x0078, 0x67dc, 0x6013, 0x0200, 0x0078, 0x67dc, 0xa186,
+ 0x0013, 0x00c0, 0x6839, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1286,
+ 0xa08a, 0x0050, 0x10c8, 0x1286, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x686a, 0xa186, 0x0047, 0x00c0, 0x683f, 0x0078, 0x6899, 0xa186,
+ 0x0027, 0x0040, 0x6847, 0xa186, 0x0014, 0x10c0, 0x1286, 0x6004,
+ 0xa082, 0x0040, 0x2008, 0x0079, 0x684d, 0x685d, 0x685f, 0x685f,
+ 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d,
+ 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x1078, 0x1286, 0x2001,
+ 0x0007, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0x687a, 0x688a, 0x6883, 0x6893, 0x687a, 0x687a,
+ 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a,
+ 0x687a, 0x687a, 0x1078, 0x1286, 0x6010, 0xa088, 0x0013, 0x2104,
+ 0xa085, 0x0400, 0x200a, 0x1078, 0x4754, 0x6003, 0x0002, 0x1078,
+ 0x484d, 0x007c, 0x1078, 0x4754, 0x1078, 0x4272, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x4754, 0x2009, 0x0041, 0x0078,
+ 0x6965, 0xa182, 0x0040, 0x0079, 0x689d, 0x68ad, 0x68af, 0x68ad,
+ 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x68b0, 0x68ad, 0x68ad, 0x68ad,
+ 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x1078, 0x1286, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1523, 0x007c, 0xa182, 0x0040, 0x0079, 0x68bf, 0x68cf,
+ 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf,
+ 0x68d1, 0x68f4, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68f4, 0x1078,
+ 0x1286, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6010, 0x0d7e, 0x2068,
+ 0x684c, 0xd0fc, 0x0040, 0x68e7, 0xa08c, 0x0003, 0xa18e, 0x0002,
+ 0x0040, 0x68ed, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6965, 0x6003,
+ 0x0007, 0x1078, 0x4272, 0x0d7f, 0x007c, 0x1078, 0x4272, 0x1078,
+ 0x55a1, 0x0d7f, 0x0078, 0x68ec, 0x037e, 0x2019, 0x0001, 0x1078,
+ 0x5107, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6010, 0x0d7e, 0x2068,
+ 0x2019, 0x0004, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x6017, 0x0028,
+ 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6919, 0x6004,
+ 0xa086, 0x0042, 0x10c0, 0x1286, 0x1078, 0x4754, 0x1078, 0x484d,
+ 0x007c, 0xa186, 0x0027, 0x0040, 0x6921, 0xa186, 0x0014, 0x00c0,
+ 0x6931, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1286, 0x2001, 0x0007,
+ 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x6935, 0x6945, 0x6945, 0x6945,
+ 0x6945, 0x6945, 0x6945, 0x6945, 0x6947, 0x6953, 0x6945, 0x6945,
+ 0x6945, 0x6945, 0x6945, 0x6945, 0x6945, 0x1078, 0x1286, 0x037e,
+ 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1523,
0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc,
- 0x0040, 0x70b7, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x70bd, 0x6003,
- 0x0007, 0x1078, 0x463f, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x70c1, 0x70d1, 0x70d3, 0x70df, 0x70eb, 0x70d1, 0x70d1, 0x70d1,
- 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1,
- 0x70d1, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x47d7,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0x6003,
- 0x0001, 0x6106, 0x1078, 0x47d7, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4c2c, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
- 0x19a7, 0x127e, 0x2091, 0x8000, 0x1078, 0x4843, 0x1078, 0x4cec,
- 0x127f, 0x007c, 0x1078, 0x4b33, 0x0078, 0x7100, 0x1078, 0x4bdb,
- 0x6110, 0x81ff, 0x0040, 0x710d, 0x0d7e, 0x2168, 0x037e, 0x2019,
- 0x0029, 0x1078, 0x74a8, 0x037f, 0x0d7f, 0x1078, 0x6a4c, 0x1078,
- 0x4c2c, 0x007c, 0xa182, 0x0085, 0x0079, 0x7116, 0x711d, 0x711d,
- 0x711d, 0x711f, 0x711d, 0x711d, 0x711d, 0x1078, 0x12d5, 0x027e,
- 0x0e7e, 0x2071, 0x7b80, 0x7220, 0x1078, 0x73c2, 0x0040, 0x712c,
- 0x6007, 0x0086, 0x0078, 0x712e, 0x6007, 0x0087, 0x6003, 0x0001,
- 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0e7f, 0x027f, 0x007c, 0xa186,
- 0x0013, 0x00c0, 0x7148, 0x6004, 0xa08a, 0x0085, 0x1048, 0x12d5,
- 0xa08a, 0x008c, 0x10c8, 0x12d5, 0xa082, 0x0085, 0x0079, 0x715b,
- 0xa186, 0x0027, 0x0040, 0x7150, 0xa186, 0x0014, 0x10c0, 0x12d5,
- 0x2001, 0x0007, 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x6a4c,
- 0x1078, 0x4c2c, 0x007c, 0x7162, 0x7164, 0x7164, 0x7162, 0x7162,
- 0x7162, 0x7162, 0x1078, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x5bb4,
- 0x1078, 0x4c2c, 0x007c, 0xa182, 0x0085, 0x1048, 0x12d5, 0xa182,
- 0x008c, 0x10c8, 0x12d5, 0xa182, 0x0085, 0x0079, 0x7177, 0x717e,
- 0x717e, 0x717e, 0x7180, 0x717e, 0x717e, 0x717e, 0x1078, 0x12d5,
- 0x007c, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c,
- 0x037e, 0x2019, 0x000b, 0x1078, 0x7191, 0x601f, 0x0006, 0x037f,
+ 0x0040, 0x695f, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6965, 0x6003,
+ 0x0007, 0x1078, 0x4272, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x6969, 0x6979, 0x697b, 0x6987, 0x6993, 0x6979, 0x6979, 0x6979,
+ 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
+ 0x6979, 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x43f8,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x484d, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
+ 0x191c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4464, 0x1078, 0x48fd,
+ 0x127f, 0x007c, 0x1078, 0x4754, 0x0078, 0x69a8, 0x1078, 0x47fc,
+ 0x6110, 0x81ff, 0x0040, 0x69b5, 0x0d7e, 0x2168, 0x037e, 0x2019,
+ 0x0029, 0x1078, 0x6d4c, 0x037f, 0x0d7f, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0xa182, 0x0085, 0x0079, 0x69be, 0x69c5, 0x69c5,
+ 0x69c5, 0x69c7, 0x69c5, 0x69c5, 0x69c5, 0x1078, 0x1286, 0x027e,
+ 0x0e7e, 0x2071, 0x7380, 0x7220, 0x1078, 0x6c66, 0x0040, 0x69d4,
+ 0x6007, 0x0086, 0x0078, 0x69d6, 0x6007, 0x0087, 0x6003, 0x0001,
+ 0x1078, 0x43f8, 0x1078, 0x484d, 0x0e7f, 0x027f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x69f0, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1286,
+ 0xa08a, 0x008c, 0x10c8, 0x1286, 0xa082, 0x0085, 0x0079, 0x6a03,
+ 0xa186, 0x0027, 0x0040, 0x69f8, 0xa186, 0x0014, 0x10c0, 0x1286,
+ 0x2001, 0x0007, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd,
+ 0x1078, 0x484d, 0x007c, 0x6a0a, 0x6a0c, 0x6a0c, 0x6a0a, 0x6a0a,
+ 0x6a0a, 0x6a0a, 0x1078, 0x1286, 0x1078, 0x4754, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0xa182, 0x0085, 0x1048, 0x1286, 0xa182,
+ 0x008c, 0x10c8, 0x1286, 0xa182, 0x0085, 0x0079, 0x6a1f, 0x6a26,
+ 0x6a26, 0x6a26, 0x6a28, 0x6a26, 0x6a26, 0x6a26, 0x1078, 0x1286,
+ 0x007c, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d, 0x007c,
+ 0x037e, 0x2019, 0x000b, 0x1078, 0x6a39, 0x601f, 0x0006, 0x037f,
0x007c, 0x127e, 0x037e, 0x087e, 0x2091, 0x8000, 0x2c40, 0x1078,
- 0x58c7, 0x00c0, 0x71be, 0x1078, 0x5968, 0x00c0, 0x71be, 0x6000,
- 0xa086, 0x0000, 0x0040, 0x71be, 0x601c, 0xa086, 0x0007, 0x0040,
- 0x71be, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x71b1, 0x1078,
- 0x1676, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x71b9, 0x1078,
- 0x74a8, 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f,
- 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7b80,
- 0x7838, 0xa08c, 0x00ff, 0x783c, 0x1078, 0x2059, 0x00c0, 0x71f9,
- 0x017e, 0x0c7e, 0x1078, 0x37d7, 0x00c0, 0x71f9, 0x2011, 0x7b90,
- 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x71f9,
- 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078, 0x5a3c,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x017f, 0x1078, 0x7326, 0x1078,
- 0x3958, 0x017f, 0x1078, 0x35db, 0x6612, 0x6516, 0xa006, 0x0078,
- 0x71fb, 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c,
- 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x761e, 0x2104, 0xa086, 0x0074,
- 0x00c0, 0x7257, 0x2069, 0x7b8e, 0x690c, 0xa182, 0x0100, 0x0048,
- 0x7247, 0x6908, 0xa184, 0x8000, 0x0040, 0x7253, 0xa184, 0x0800,
- 0x0040, 0x7253, 0x6910, 0xa18a, 0x0001, 0x0048, 0x724b, 0x6914,
- 0x2069, 0x7bae, 0x6904, 0x81ff, 0x00c0, 0x723f, 0x690c, 0xa182,
- 0x0100, 0x0048, 0x7247, 0x6908, 0x81ff, 0x00c0, 0x7243, 0x6910,
- 0xa18a, 0x0001, 0x0048, 0x724b, 0x6918, 0xa18a, 0x0001, 0x0048,
- 0x7253, 0x0078, 0x725d, 0x6013, 0x0100, 0x0078, 0x7259, 0x6013,
- 0x0300, 0x0078, 0x7259, 0x6013, 0x0500, 0x0078, 0x7259, 0x6013,
- 0x0700, 0x0078, 0x7259, 0x6013, 0x0900, 0x0078, 0x7259, 0x6013,
- 0x0b00, 0x0078, 0x7259, 0x6013, 0x0f00, 0x0078, 0x7259, 0x6013,
- 0x2d00, 0xa085, 0x0001, 0x0078, 0x725e, 0xa006, 0x017f, 0x0d7f,
- 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218,
- 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x7286,
- 0xa286, 0x0004, 0x0040, 0x7286, 0xa394, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x0040, 0x7286, 0xa286, 0x0004, 0x0040, 0x7286, 0x0c7e,
- 0x2d60, 0x1078, 0x37e9, 0x0c7f, 0x0078, 0x72b9, 0x2011, 0x7b96,
- 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x72ba,
- 0x2011, 0x7b9a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x610f,
- 0x00c0, 0x72ba, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227,
- 0xa006, 0x2009, 0x7652, 0x210c, 0xd1a4, 0x0040, 0x72ae, 0x2009,
- 0x0029, 0x1078, 0x74ec, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078, 0x7326, 0x017f,
- 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c,
- 0x0d7e, 0x2069, 0x7b8e, 0x6800, 0xa086, 0x0800, 0x0040, 0x72cc,
- 0x6013, 0x0000, 0x0078, 0x72cd, 0xa006, 0x0d7f, 0x007c, 0x0c7e,
- 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x7b8c, 0x7930,
- 0x7834, 0x1078, 0x2059, 0x00c0, 0x72f3, 0x1078, 0x37d7, 0x00c0,
- 0x72f3, 0x2011, 0x7b90, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x610f, 0x00c0, 0x72f3, 0x2011, 0x7b94, 0xac98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x610f, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f,
+ 0x52b4, 0x00c0, 0x6a66, 0x1078, 0x5355, 0x00c0, 0x6a66, 0x6000,
+ 0xa086, 0x0000, 0x0040, 0x6a66, 0x601c, 0xa086, 0x0007, 0x0040,
+ 0x6a66, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6a59, 0x1078,
+ 0x1627, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6a61, 0x1078,
+ 0x6d4c, 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f,
+ 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7380,
+ 0x7838, 0xa084, 0x00ff, 0xa005, 0x00c0, 0x6aa2, 0x783c, 0x1078,
+ 0x1fb0, 0x017e, 0x0c7e, 0x1078, 0x3497, 0x00c0, 0x6aa0, 0x2011,
+ 0x7390, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0,
+ 0x6aa0, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078,
+ 0x5429, 0x1078, 0x4535, 0x1078, 0x4478, 0x017f, 0x1078, 0x6bca,
+ 0x1078, 0x3618, 0x017f, 0x1078, 0x329b, 0xa006, 0x0078, 0x6aa2,
+ 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e,
+ 0x0d7e, 0x017e, 0x2009, 0x6f1c, 0x2104, 0xa086, 0x0074, 0x00c0,
+ 0x6afe, 0x2069, 0x738e, 0x690c, 0xa182, 0x0100, 0x0048, 0x6aee,
+ 0x6908, 0xa184, 0x8000, 0x0040, 0x6afa, 0xa184, 0x0800, 0x0040,
+ 0x6afa, 0x6910, 0xa18a, 0x0001, 0x0048, 0x6af2, 0x6914, 0x2069,
+ 0x73ae, 0x6904, 0x81ff, 0x00c0, 0x6ae6, 0x690c, 0xa182, 0x0100,
+ 0x0048, 0x6aee, 0x6908, 0x81ff, 0x00c0, 0x6aea, 0x6910, 0xa18a,
+ 0x0001, 0x0048, 0x6af2, 0x6918, 0xa18a, 0x0001, 0x0048, 0x6afa,
+ 0x0078, 0x6b04, 0x6013, 0x0100, 0x0078, 0x6b00, 0x6013, 0x0300,
+ 0x0078, 0x6b00, 0x6013, 0x0500, 0x0078, 0x6b00, 0x6013, 0x0700,
+ 0x0078, 0x6b00, 0x6013, 0x0900, 0x0078, 0x6b00, 0x6013, 0x0b00,
+ 0x0078, 0x6b00, 0x6013, 0x0f00, 0x0078, 0x6b00, 0x6013, 0x2d00,
+ 0xa085, 0x0001, 0x0078, 0x6b05, 0xa006, 0x017f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268,
+ 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x6b2d, 0xa286,
+ 0x0004, 0x0040, 0x6b2d, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006,
+ 0x0040, 0x6b2d, 0xa286, 0x0004, 0x0040, 0x6b2d, 0x0c7e, 0x2d60,
+ 0x1078, 0x34a9, 0x0c7f, 0x0078, 0x6b60, 0x2011, 0x7396, 0xad98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0, 0x6b61, 0x2011,
+ 0x739a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0,
+ 0x6b61, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006,
+ 0x2009, 0x6f52, 0x210c, 0xd1a4, 0x0040, 0x6b55, 0x2009, 0x0029,
+ 0x1078, 0x6d90, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x017f, 0x047f,
+ 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e,
+ 0x2069, 0x738e, 0x6800, 0xa086, 0x0800, 0x0040, 0x6b73, 0x6013,
+ 0x0000, 0x0078, 0x6b74, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e,
+ 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x738c, 0x7830, 0xa00d,
+ 0x00c0, 0x6b9b, 0x7834, 0x1078, 0x1fb0, 0x1078, 0x3497, 0x00c0,
+ 0x6b9b, 0x2011, 0x7390, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a15, 0x00c0, 0x6b9b, 0x2011, 0x7394, 0xac98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x5a15, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f,
0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2011, 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0,
- 0x731f, 0x1078, 0x37d7, 0x00c0, 0x731f, 0x2011, 0x7b96, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x731f, 0x2011,
- 0x7b9a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x610f, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
- 0x2029, 0x783f, 0x252c, 0x2021, 0x7845, 0x2424, 0x2061, 0x7d00,
- 0x2071, 0x7600, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x738b,
- 0x2100, 0xac06, 0x0040, 0x7381, 0x1078, 0x7504, 0x0040, 0x7381,
- 0x671c, 0xa786, 0x0001, 0x0040, 0x73a0, 0xa786, 0x0007, 0x0040,
- 0x7381, 0x2500, 0xac06, 0x0040, 0x7381, 0x2400, 0xac06, 0x0040,
- 0x7381, 0x1078, 0x7518, 0x00c0, 0x7381, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x7367, 0x017e, 0x1078, 0x1676, 0x017f, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x737e, 0xa786, 0x0003, 0x00c0,
- 0x7394, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
- 0x6aea, 0x1078, 0x3a2c, 0x017f, 0x1078, 0x6a3f, 0x0d7f, 0x1078,
- 0x6a4c, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8,
- 0x738b, 0x0078, 0x7338, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f,
- 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x7371,
- 0xa386, 0x0005, 0x0040, 0x7381, 0x1078, 0x74a8, 0x0078, 0x737e,
- 0x1078, 0x7518, 0x00c0, 0x7381, 0xa180, 0x0001, 0x2004, 0xa086,
- 0x0018, 0x00c0, 0x7381, 0x6000, 0xa086, 0x0002, 0x00c0, 0x7381,
- 0x1078, 0x6a65, 0x0040, 0x73bc, 0x1078, 0x6a79, 0x00c0, 0x7381,
- 0x1078, 0x5e09, 0x0078, 0x73be, 0x1078, 0x22b1, 0x1078, 0x6a4c,
- 0x0078, 0x7381, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078,
- 0x74bf, 0x017f, 0x0040, 0x73d1, 0x601c, 0xa084, 0x000f, 0x1079,
- 0x73d4, 0x0e7f, 0x0c7f, 0x007c, 0x73dc, 0x73dc, 0x73dc, 0x73dc,
- 0x73dc, 0x73dc, 0x73de, 0x73dc, 0xa006, 0x007c, 0x047e, 0x017e,
- 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00,
- 0x2009, 0x0020, 0x1078, 0x74ec, 0x017f, 0x047f, 0x037e, 0x2019,
- 0x0002, 0x1078, 0x7191, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0001, 0x1078, 0x376f, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
- 0x0004, 0x2019, 0x7605, 0x2011, 0x7b96, 0x1078, 0x610f, 0x037f,
- 0x027f, 0x017f, 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7d00,
- 0x2079, 0x0001, 0x8fff, 0x0040, 0x7468, 0x2071, 0x7600, 0x7644,
- 0x7060, 0x8001, 0xa602, 0x00c8, 0x7468, 0x88ff, 0x0040, 0x742e,
- 0x2800, 0xac06, 0x00c0, 0x745e, 0x2079, 0x0000, 0x1078, 0x7504,
- 0x0040, 0x745e, 0x2400, 0xac06, 0x0040, 0x745e, 0x671c, 0xa786,
- 0x0006, 0x00c0, 0x745e, 0xa786, 0x0007, 0x0040, 0x745e, 0x88ff,
- 0x00c0, 0x7446, 0x6018, 0xa206, 0x00c0, 0x745e, 0x0d7e, 0x6000,
- 0xa086, 0x0004, 0x00c0, 0x744e, 0x1078, 0x1676, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x7458, 0x047e, 0x1078, 0x74a8, 0x047f,
- 0x0d7f, 0x1078, 0x6a4c, 0x88ff, 0x00c0, 0x7471, 0xace0, 0x0008,
- 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x7468, 0x0078, 0x741a,
- 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f,
- 0x007c, 0xa8c5, 0x0001, 0x0078, 0x7469, 0x087e, 0x2041, 0x0000,
- 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078, 0x58c7, 0x1078, 0x5968,
- 0x1078, 0x740d, 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e,
- 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x037e,
- 0x1078, 0x37d7, 0x00c0, 0x749d, 0x2c10, 0x2041, 0x0000, 0x1078,
- 0x58c7, 0x1078, 0x5968, 0x1078, 0x740d, 0x037f, 0x017f, 0x8108,
- 0x00f0, 0x748e, 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c,
- 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x74bc, 0x6800, 0xa07d, 0x0040,
- 0x74b9, 0x6803, 0x0000, 0x6b52, 0x1078, 0x3a2c, 0x2f68, 0x0078,
- 0x74ad, 0x6b52, 0x1078, 0x3a2c, 0x0f7f, 0x017f, 0x007c, 0x0e7e,
- 0x047e, 0x037e, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7444, 0x7060,
- 0x8001, 0xa402, 0x00c8, 0x74e7, 0x2100, 0xac06, 0x0040, 0x74d9,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x74d9, 0x6008, 0xa206, 0x0040,
- 0x74e3, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8,
- 0x74e7, 0x0078, 0x74c4, 0xa085, 0x0001, 0x0078, 0x74e8, 0xa006,
- 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x132f,
- 0x007f, 0x1040, 0x12d5, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b,
- 0x0000, 0x685b, 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000,
- 0x1078, 0x3a2c, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040,
- 0x7517, 0xa786, 0x0001, 0x0040, 0x7517, 0xa786, 0x000a, 0x0040,
- 0x7517, 0xa786, 0x0009, 0x0040, 0x7517, 0xa085, 0x0001, 0x007c,
- 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e,
- 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7640, 0xd5a4, 0x0040,
- 0x752c, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x7532, 0x7030,
- 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7539, 0x2071, 0x764a, 0x1078,
- 0x7568, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e,
- 0x2091, 0x8000, 0x2071, 0x7640, 0xd5a4, 0x0040, 0x754a, 0x7034,
- 0x8000, 0x7036, 0xd5b4, 0x0040, 0x7550, 0x7030, 0x8000, 0x7032,
- 0xd5ac, 0x0040, 0x7557, 0x2071, 0x764a, 0x1078, 0x7568, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
- 0x2071, 0x7642, 0x1078, 0x7568, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x2e04, 0x8000, 0x2072, 0x00c8, 0x7571, 0x8e70, 0x2e04, 0x8000,
- 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7640, 0x1078, 0x7568, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7644, 0x1078, 0x7568, 0x0e7f, 0x007c,
- 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
- 0x59e7
-};
-#define ISP2100_CODE_LENGTH 0x6591
-#endif
-#if defined(ISP2100_FABRIC) && defined(ISP2100_SCCLUN)
-/************************************************************************
- * *
- * --- ISP2100 Initiator/Target Firmware --- *
- * with Fabric support (Public Loop) and *
- * with expanded LUN addressing. *
- * *
- * *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
-/*
- * Firmware Version 1.15.07 (14:40 Oct 13, 1998)
- */
-
-static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x669c, 0x0000, 0x2043, 0x4f50, 0x5952,
- 0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
- 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
- 0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x769c, 0x2009, 0x0000, 0x20a9,
- 0x0764, 0x41a4, 0x3400, 0x20c9, 0x7bff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x2074, 0x2051, 0x7700,
- 0x2a70, 0x705b, 0x9600, 0x705f, 0xffff, 0x7057, 0x95f9, 0x7063,
- 0x0300, 0x1078, 0x1282, 0x20a1, 0x7e00, 0x715c, 0x810d, 0x810d,
- 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
- 0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
- 0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1249, 0x1078, 0x136e, 0x1078, 0x14f3, 0x1078, 0x19a0,
- 0x1078, 0x35ed, 0x1078, 0x5c66, 0x1078, 0x12f9, 0x1078, 0x2403,
- 0x1078, 0x3d28, 0x1078, 0x3b00, 0x1078, 0x4569, 0x1078, 0x1e2f,
- 0x1078, 0x47a9, 0x1078, 0x4249, 0x1078, 0x1d4e, 0x1078, 0x1e0e,
- 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
- 0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
- 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2d63, 0x1078, 0x242b, 0x1078, 0x3d78,
- 0x1078, 0x3beb, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x4581, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5938, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x114b,
- 0x10cd, 0x11c6, 0x1246, 0x1247, 0x1248, 0x1078, 0x12d5, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2e88, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x113c, 0x2011, 0x351a, 0x1078, 0x4643,
- 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b8, 0x1078, 0x2d20, 0x1078, 0x5783, 0x2011, 0x0004, 0x1078,
- 0x6a18, 0x1078, 0x3a9a, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
- 0x0000, 0x1078, 0x113f, 0x2011, 0x0000, 0x2079, 0x7751, 0x7804,
- 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
- 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
- 0x1078, 0x6a18, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x0f7f, 0x1078, 0x2124, 0x2011, 0x0005, 0x1078, 0x5892, 0x1078,
- 0x4d50, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
- 0x0078, 0x113e, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x2011, 0x0005, 0x1078, 0x5892, 0x1078, 0x4d50, 0x0c7e, 0x2061,
- 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f, 0x127f, 0x007c, 0x0c7e,
- 0x20a9, 0x0082, 0x2009, 0x007e, 0x1078, 0x37ee, 0x8108, 0x00f0,
- 0x1144, 0x0c7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086,
- 0xffff, 0x0040, 0x1159, 0x1078, 0x2124, 0x1078, 0x4d50, 0x0078,
- 0x11c4, 0x70bc, 0xd09c, 0x0040, 0x1181, 0xd084, 0x0040, 0x1181,
- 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
- 0x0040, 0x1181, 0x70c0, 0xa086, 0xffff, 0x0040, 0x117d, 0x1078,
- 0x2219, 0x1078, 0x4d50, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078,
- 0x2251, 0x1078, 0x4d50, 0x0078, 0x11c4, 0x70c4, 0xa005, 0x00c0,
- 0x11c4, 0x7088, 0xa005, 0x00c0, 0x11c4, 0x2001, 0x7752, 0x2004,
- 0xd0ac, 0x0040, 0x11a7, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x1078, 0x3806, 0x00c0, 0x119a, 0x6000, 0xd0ec,
- 0x00c0, 0x11a2, 0x017f, 0x8108, 0x00f0, 0x1191, 0x0c7f, 0x157f,
- 0x0078, 0x11a7, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x11c4, 0x7003,
- 0x0003, 0x708f, 0xffff, 0x2001, 0x0000, 0x1078, 0x1fff, 0x1078,
- 0x2d9e, 0x2001, 0x7937, 0x2004, 0xa086, 0x0005, 0x00c0, 0x11bc,
- 0x2011, 0x0000, 0x1078, 0x5892, 0x2011, 0x0000, 0x1078, 0x589c,
- 0x1078, 0x4d50, 0x1078, 0x4e10, 0x127f, 0x007c, 0x017e, 0x0f7e,
- 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010,
- 0x7942, 0x7924, 0xd1b4, 0x0040, 0x11d7, 0x7827, 0x0040, 0xd19c,
- 0x0040, 0x11dc, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900,
- 0xa18a, 0x0003, 0x0050, 0x1202, 0x7954, 0xd1ac, 0x00c0, 0x1202,
- 0x2009, 0x00f8, 0x1078, 0x35bc, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11fa, 0x7824, 0xd0ac,
- 0x00c0, 0x1236, 0x00f0, 0x11f2, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x0078, 0x123f, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008,
- 0x00e0, 0x1208, 0x2091, 0x6000, 0x00f0, 0x1208, 0x7853, 0x0400,
- 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x35bc, 0x20a9, 0x000e,
- 0x0005, 0x00f0, 0x1218, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843,
- 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040,
- 0x122d, 0x7824, 0xd0ac, 0x00c0, 0x1236, 0x8319, 0x00c0, 0x1223,
- 0x2001, 0x0001, 0x1078, 0x1fff, 0x0078, 0x123d, 0x7828, 0xc09d,
- 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f,
- 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c,
- 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x1255, 0x704f, 0xffff, 0x0078, 0x1257, 0x704f, 0x0000, 0x7053,
- 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, 0x7920, 0x6003,
- 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
- 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
- 0x7928, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
- 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
- 0x0000, 0x007c, 0x1078, 0x12a8, 0x2011, 0x0000, 0x81ff, 0x0040,
- 0x12a7, 0xa186, 0x0001, 0x00c0, 0x1297, 0x705f, 0x8fff, 0x7057,
- 0x8601, 0x7063, 0x0100, 0x705b, 0x8600, 0x0078, 0x12a5, 0xa186,
- 0x0002, 0x00c0, 0x129f, 0x2011, 0x0000, 0x0078, 0x12a5, 0xa186,
- 0x0005, 0x00c0, 0x12a5, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c,
- 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12cf, 0x2019, 0xaaaa,
- 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406,
- 0x0040, 0x12bd, 0xc18d, 0x0078, 0x12ca, 0xc185, 0x2011, 0x0001,
- 0x1078, 0x12cf, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0,
- 0x12ca, 0xc195, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, 0x3800,
- 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068,
- 0x12d7, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084, 0x0000,
- 0x00c0, 0x12dd, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f, 0x7826,
- 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2079, 0x7700, 0x7803, 0x0005, 0x0078, 0x12f6,
- 0x007c, 0x2071, 0x7700, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
- 0x002d, 0xa298, 0x002d, 0x0048, 0x130f, 0x705c, 0xa302, 0x00c8,
- 0x130f, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x1301, 0x200b,
- 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7700, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1322, 0xa06e,
- 0x0078, 0x132c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
- 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x7700, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
- 0x133c, 0xa06e, 0x0078, 0x1345, 0x70a2, 0x702c, 0x2068, 0x2d04,
- 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
- 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7700, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
- 0x8dff, 0x0040, 0x1364, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
- 0x1348, 0x0d7f, 0x0078, 0x1358, 0x007c, 0x0e7e, 0x2071, 0x7700,
- 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
- 0x7959, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
- 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
- 0x2270, 0x700b, 0x0000, 0x2071, 0x7959, 0x7018, 0xa088, 0x7962,
- 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
- 0x1397, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7959, 0x7004, 0xa005, 0x00c0, 0x13a6,
- 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, 0x007c,
- 0x7000, 0x0079, 0x13ab, 0x13af, 0x1419, 0x1436, 0x1436, 0x7018,
- 0x711c, 0xa106, 0x00c0, 0x13b7, 0x7007, 0x0000, 0x007c, 0x0d7e,
- 0xa180, 0x7962, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
- 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
- 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
- 0x0d7f, 0xd084, 0x0040, 0x13d9, 0x7007, 0x0001, 0x1078, 0x13de,
- 0x007c, 0x7007, 0x0002, 0x1078, 0x13f4, 0x007c, 0x017e, 0x027e,
- 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e9, 0x2110,
- 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
- 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
- 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1408, 0x2110, 0xa006,
- 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x77e5, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
- 0x77e0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
- 0x157e, 0x2001, 0x7814, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
- 0x2001, 0x7815, 0x20ac, 0x53a6, 0x2099, 0x7816, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
- 0x7811, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
- 0x2071, 0x7959, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
- 0xd1fc, 0x0040, 0x1479, 0xa18c, 0x0700, 0x0040, 0x1476, 0x7008,
- 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1479, 0x7004, 0x1079,
- 0x147d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13a8, 0x1485, 0x14a7,
- 0x14c1, 0x14ea, 0x1483, 0x0078, 0x1483, 0x137e, 0x147e, 0x157e,
- 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
- 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
- 0x0040, 0x14ae, 0x1078, 0x13de, 0x007c, 0x7008, 0xa080, 0x0002,
- 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x13a8, 0x007c, 0x700c,
- 0xa005, 0x0040, 0x14ae, 0x1078, 0x13f4, 0x007c, 0x0d7e, 0x7008,
- 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
- 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x13a8,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x77e3, 0x2004, 0xa080,
- 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
- 0x53a5, 0x2001, 0x77e5, 0x2004, 0xd0bc, 0x0040, 0x14e0, 0x2001,
- 0x77ee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
- 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x3e21, 0x1078,
- 0x13a8, 0x007c, 0x2001, 0x7813, 0x2003, 0x0100, 0x7007, 0x0000,
- 0x1078, 0x13a8, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
- 0x2071, 0x796a, 0x7003, 0x0000, 0x700f, 0x7970, 0x7013, 0x7970,
- 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
- 0x1509, 0x1511, 0x1557, 0x1511, 0x1511, 0x1511, 0x153c, 0x1520,
- 0x1515, 0xa085, 0x0001, 0x0078, 0x1571, 0x684c, 0xd0bc, 0x0040,
- 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x155f,
- 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1511, 0x684c, 0xd0bc,
- 0x0040, 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0x6858, 0x0078, 0x1567, 0xa18c, 0x00ff, 0xa186, 0x0015,
- 0x00c0, 0x1511, 0x684c, 0xd0ac, 0x0040, 0x1511, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1567, 0x684c,
- 0xd0ac, 0x0040, 0x1511, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c,
- 0x000f, 0xa188, 0x1c5c, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826,
- 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a,
- 0x2004, 0x82ff, 0x0040, 0x158c, 0xa280, 0x0004, 0x0d7e, 0x206c,
- 0x684c, 0xd0dc, 0x00c0, 0x1588, 0x1078, 0x1504, 0x10c0, 0x12d5,
- 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e,
- 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0,
- 0x15a0, 0x7206, 0x2001, 0x15b4, 0x007e, 0x2260, 0x0078, 0x16cc,
- 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
- 0x798b, 0x0048, 0x15ad, 0x2009, 0x7970, 0x710e, 0x7000, 0xa005,
- 0x00c0, 0x15b4, 0x1078, 0x16b5, 0x127f, 0x007c, 0x127e, 0x027e,
- 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f,
- 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e,
- 0xa005, 0x0040, 0x1608, 0x6808, 0xa005, 0x0040, 0x166e, 0x7000,
- 0xa005, 0x00c0, 0x15d5, 0x0078, 0x1602, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x1672, 0x7004, 0xa406, 0x00c0, 0x1602, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15eb, 0x047e, 0x1078, 0x17a5, 0x047f,
- 0x2460, 0x0078, 0x15cb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15de, 0x7804, 0xa084, 0x6000, 0x0040, 0x15fc, 0xa086, 0x6000,
- 0x0040, 0x15fc, 0x0078, 0x15de, 0x7803, 0x0004, 0x7003, 0x0000,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x0078, 0x1672,
- 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, 0xa005, 0x00c0, 0x1612,
- 0x0078, 0x166e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x161b, 0x7004,
- 0xa406, 0x00c0, 0x166e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040,
- 0x1628, 0x047e, 0x1078, 0x17a5, 0x047f, 0x2460, 0x0078, 0x1608,
- 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x161b, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x00c0, 0x1621, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x163f, 0xa086, 0x6000, 0x0040, 0x163f, 0x0078, 0x161b, 0x7007,
- 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x1660,
- 0xa08e, 0x0002, 0x00c0, 0x166e, 0x0c7e, 0x0e7e, 0x6818, 0x2060,
- 0x1078, 0x1c31, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x165c,
- 0x7308, 0x720c, 0x0078, 0x165e, 0x7310, 0x7214, 0x0e7f, 0x0c7f,
- 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814,
- 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048,
- 0x1078, 0x5cfb, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
- 0x2071, 0x796a, 0x7000, 0xa086, 0x0000, 0x0040, 0x16b2, 0x7004,
- 0xac06, 0x00c0, 0x16a3, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0,
- 0x169f, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1685, 0x7803,
- 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1691, 0x7803, 0x0002, 0x7803,
- 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x16a3, 0x1078,
- 0x17a5, 0x0078, 0x167a, 0x157e, 0x20a9, 0x0009, 0x2009, 0x7970,
- 0x2104, 0xac06, 0x00c0, 0x16ad, 0x200a, 0xa188, 0x0003, 0x00f0,
- 0x16a8, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x16bd, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060,
- 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x798b, 0x0048,
- 0x16cb, 0x2009, 0x7970, 0x7112, 0x8cff, 0x00c0, 0x16eb, 0x7908,
- 0xd1ec, 0x00c0, 0x16df, 0x1078, 0x197e, 0x0040, 0x16df, 0x7803,
- 0x0009, 0x7904, 0xd1fc, 0x0040, 0x16d9, 0x7803, 0x0006, 0x7007,
- 0x0000, 0x1078, 0x197e, 0x0040, 0x1712, 0x7803, 0x0019, 0x7003,
- 0x0003, 0x0078, 0x1712, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406,
- 0x00c0, 0x16f6, 0x682c, 0xa306, 0x0040, 0x16fa, 0x1078, 0x1c7c,
- 0x00c0, 0x16cf, 0x684c, 0xd0f4, 0x00c0, 0x16cf, 0x6824, 0x2050,
- 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009,
- 0x0011, 0x1078, 0x1713, 0x0040, 0x1711, 0x2009, 0x0001, 0x1078,
- 0x1713, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x17a0, 0xa03e, 0x2730,
- 0x6850, 0xd0fc, 0x00c0, 0x1732, 0x0d7e, 0x2804, 0xac68, 0x2900,
- 0x0079, 0x1722, 0x1782, 0x1742, 0x1742, 0x1782, 0x1782, 0x177a,
- 0x1782, 0x1742, 0x1782, 0x1748, 0x1748, 0x1782, 0x1782, 0x1782,
- 0x1771, 0x1748, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20,
- 0x0d7e, 0xd99c, 0x0040, 0x1785, 0x2804, 0xac68, 0x6f08, 0x6e0c,
- 0x0078, 0x1785, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1785,
- 0x7b0c, 0xd3bc, 0x0040, 0x1769, 0x7004, 0x0e7e, 0x2070, 0x701c,
- 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1769, 0x7b08, 0xa39c, 0x0fff,
- 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, 0x00c0, 0x1764, 0x6810,
- 0xa302, 0x0048, 0x1764, 0x6b10, 0x2011, 0x0000, 0x2468, 0x0078,
- 0x176b, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
- 0x1785, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
- 0x00c0, 0x1782, 0x0d7f, 0x1078, 0x1c18, 0x00c0, 0x1713, 0xa00e,
- 0x0078, 0x17a0, 0x0d7f, 0x1078, 0x12d5, 0x7b22, 0x7a26, 0x7d32,
- 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
- 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10,
- 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1c18,
- 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, 0x127e, 0x2091, 0x2100,
- 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
- 0xa184, 0x0700, 0x00c0, 0x17a3, 0xa184, 0x0003, 0xa086, 0x0003,
- 0x0040, 0x17a3, 0x7000, 0x0079, 0x17bd, 0x17c5, 0x17c7, 0x189b,
- 0x18ff, 0x1916, 0x17c5, 0x17c5, 0x17c5, 0x1078, 0x12d5, 0x8001,
- 0x7002, 0xa184, 0x0880, 0x00c0, 0x17dc, 0x8aff, 0x0040, 0x183b,
- 0x2009, 0x0001, 0x1078, 0x1713, 0x0040, 0x1928, 0x2009, 0x0001,
- 0x1078, 0x1713, 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000,
- 0xd1dc, 0x0040, 0x1827, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
- 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820,
- 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x037f,
- 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1c31, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x6850,
- 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1819, 0x684c,
- 0xd0e4, 0x0040, 0x1819, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x5cfb, 0x7808, 0xd0ec, 0x00c0, 0x1823, 0x7803, 0x0009, 0x7003,
- 0x0004, 0x0078, 0x1928, 0x1078, 0x16b5, 0x0078, 0x1928, 0x057e,
- 0x7d0c, 0xd5bc, 0x00c0, 0x182e, 0x1078, 0x7648, 0x057f, 0x1078,
- 0x192c, 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
- 0x00c0, 0x1853, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x184f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x1078,
- 0x16b5, 0x0078, 0x1928, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
- 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
- 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
- 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x195b, 0x7803, 0x0004,
- 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1874,
- 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
- 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x1078, 0x197e,
- 0x0040, 0x184f, 0x7908, 0xd1ec, 0x00c0, 0x1892, 0x2009, 0x0009,
- 0x0078, 0x1894, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x8001, 0x7002, 0xd194, 0x0040, 0x18ad,
- 0x7804, 0xd0fc, 0x00c0, 0x17ad, 0x8aff, 0x0040, 0x1928, 0x2009,
- 0x0001, 0x1078, 0x1713, 0x0078, 0x1928, 0xa184, 0x0880, 0x00c0,
- 0x18ba, 0x8aff, 0x0040, 0x1928, 0x2009, 0x0001, 0x1078, 0x1713,
- 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
- 0x18ee, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1c31, 0x0d7e,
- 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x18de,
- 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
- 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x18ea, 0x6810, 0x2008,
- 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
- 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x17e7, 0x057e, 0x7d0c,
- 0x1078, 0x7648, 0x057f, 0x1078, 0x192c, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1928, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x1912, 0x6808,
- 0x8001, 0x680a, 0x00c0, 0x1912, 0x7004, 0x2060, 0x2009, 0x0048,
- 0x1078, 0x5cfb, 0x1078, 0x16b5, 0x0078, 0x1928, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1912,
- 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x16cc,
- 0x017f, 0x007f, 0x127f, 0x007c, 0x1078, 0x193d, 0x20e1, 0x9028,
- 0x700f, 0x7970, 0x7013, 0x7970, 0x2001, 0x015d, 0x200c, 0x810a,
- 0x2102, 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014,
- 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc,
- 0x00c0, 0x195a, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0,
- 0x195a, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x195a, 0x8421,
- 0x00c0, 0x1944, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200,
- 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x193d, 0x20e1, 0x7000,
- 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f,
- 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001,
- 0x0138, 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e,
- 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x198b, 0xa085,
- 0x0001, 0x0078, 0x199d, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1996,
- 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000,
- 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c,
- 0x0e7e, 0x2071, 0x798b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e,
- 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1a22, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x19b4, 0x19bc, 0x1a0d, 0x19bc, 0x19bc,
- 0x19bc, 0x19f2, 0x19cf, 0x19be, 0x1078, 0x12d5, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1a15, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x19bc, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0x0078, 0x1a1e, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1a22,
- 0x684c, 0xd0b4, 0x0040, 0x1b24, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0xa006, 0x682e, 0x682a, 0x0078, 0x1a1e, 0x684c, 0xd0b4, 0x0040,
- 0x17a1, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834,
- 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6926, 0x684c,
- 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804,
- 0xd0fc, 0x10c0, 0x1b28, 0x0e7e, 0x0d7e, 0x2071, 0x798b, 0x7000,
- 0xa005, 0x00c0, 0x1a9e, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c,
- 0x7004, 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890,
- 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100,
- 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818,
- 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184,
- 0x0007, 0x0040, 0x1a60, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f,
- 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e,
- 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106,
- 0x00c0, 0x1a77, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a84, 0x037e,
- 0x047e, 0x6b14, 0x6c10, 0x1078, 0x1c7c, 0x047f, 0x037f, 0x0040,
- 0x1a84, 0x0c7f, 0x0078, 0x1a9e, 0x8aff, 0x00c0, 0x1a8c, 0x0c7f,
- 0xa085, 0x0001, 0x0078, 0x1a9e, 0x127e, 0x2091, 0x8000, 0x2079,
- 0x0020, 0x2009, 0x0001, 0x1078, 0x1aa2, 0x0040, 0x1a9b, 0x2009,
- 0x0001, 0x1078, 0x1aa2, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e,
- 0x8aff, 0x0040, 0x1b1d, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218,
- 0xa203, 0x0048, 0x1b1c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0,
- 0x1acf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1abf, 0x1afe,
- 0x1adf, 0x1adf, 0x1afe, 0x1afe, 0x1af6, 0x1afe, 0x1adf, 0x1afe,
- 0x1ae5, 0x1ae5, 0x1afe, 0x1afe, 0x1afe, 0x1aed, 0x1ae5, 0xc0fc,
- 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1b02,
- 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x6b08,
- 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1b01, 0x6b10, 0x6a14, 0x6d00,
- 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x0d7f, 0x0d7e, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1afe, 0x0d7f, 0x1078,
- 0x1c18, 0x00c0, 0x1aa8, 0xa00e, 0x0078, 0x1b1d, 0x0d7f, 0x1078,
- 0x12d5, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
- 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c,
- 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012,
- 0x1078, 0x1c18, 0x0078, 0x1b1d, 0xa006, 0x027f, 0x037f, 0x047f,
- 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x2079, 0x0020, 0x2071, 0x798b, 0x2b68, 0x6818, 0x2060,
- 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1b26, 0x7000,
- 0x0079, 0x1b42, 0x1be9, 0x1b46, 0x1bb6, 0x1be7, 0x8001, 0x7002,
- 0xd19c, 0x00c0, 0x1b5a, 0x8aff, 0x0040, 0x1b79, 0x2009, 0x0001,
- 0x1078, 0x1aa2, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078, 0x1aa2,
- 0x0078, 0x1be9, 0x7803, 0x0004, 0xd194, 0x0040, 0x1b6a, 0x6850,
- 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1b6f, 0x684c, 0xc0f5, 0x684e,
- 0x0078, 0x1b6f, 0x1078, 0x1c31, 0x6850, 0xc0fd, 0x6852, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078,
- 0x1be9, 0x711c, 0x81ff, 0x0040, 0x1b8f, 0x7918, 0x7922, 0x7827,
- 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
- 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1be9, 0x0f7e,
- 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
- 0x1b9d, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
- 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
- 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1be9, 0x8001, 0x7002,
- 0xd194, 0x0040, 0x1bcb, 0x7804, 0xd0fc, 0x00c0, 0x1b38, 0xd19c,
- 0x00c0, 0x1be5, 0x8aff, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078,
- 0x1aa2, 0x0078, 0x1be9, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
- 0x1c31, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1bde,
- 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1be2, 0x6810, 0xa31a,
- 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1b6a, 0x0078, 0x1b6a, 0x1078,
- 0x12d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x798b, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1c15, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc,
- 0x0040, 0x1bfc, 0x1078, 0x1b28, 0x7000, 0xa086, 0x0000, 0x00c0,
- 0x1bfc, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1c0b, 0x20e1,
- 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c,
- 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c2c, 0x6004, 0xa005, 0x0040,
- 0x1c2e, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c5c,
- 0x2044, 0x88ff, 0x1040, 0x12d5, 0x8a51, 0x007c, 0x2051, 0x0000,
- 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1c4b, 0x2c00,
- 0xad06, 0x0040, 0x1c40, 0x6000, 0xa005, 0x00c0, 0x1c40, 0x2d00,
- 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c6c, 0x2044,
- 0x88ff, 0x1040, 0x12d5, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019,
- 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b,
- 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x1c51, 0x1c4d, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c51, 0x0000, 0x1c58, 0x1c55, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c58, 0x0000, 0x1c53, 0x1c53, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c53, 0x0000, 0x1c59, 0x1c59, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c59, 0x0a7e, 0x097e, 0x087e, 0x6858,
- 0xa055, 0x0040, 0x1d19, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
- 0x1c5c, 0xa986, 0x0007, 0x0040, 0x1c95, 0xa986, 0x000e, 0x0040,
- 0x1c95, 0xa986, 0x000f, 0x00c0, 0x1c99, 0x605c, 0xa422, 0x6060,
- 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ca7, 0x0050, 0x1ca1, 0x0078,
- 0x1d19, 0x6004, 0xa065, 0x0040, 0x1d19, 0x0078, 0x1c84, 0x2804,
- 0xa005, 0x0040, 0x1cc5, 0xac68, 0xd99c, 0x00c0, 0x1cb5, 0x6808,
- 0xa422, 0x680c, 0xa31b, 0x0078, 0x1cb9, 0x6810, 0xa422, 0x6814,
- 0xa31b, 0x0048, 0x1ce4, 0x2300, 0xa405, 0x0040, 0x1ccb, 0x8a51,
- 0x0040, 0x1d19, 0x8840, 0x0078, 0x1ca7, 0x6004, 0xa065, 0x0040,
- 0x1d19, 0x0078, 0x1c84, 0x8a51, 0x0040, 0x1d19, 0x8840, 0x2804,
- 0xa005, 0x00c0, 0x1cde, 0x6004, 0xa065, 0x0040, 0x1d19, 0x6034,
- 0xa0cc, 0x000f, 0xa9c0, 0x1c5c, 0x2804, 0x2040, 0x2b68, 0x6850,
- 0xc0fc, 0x6852, 0x0078, 0x1d11, 0x8422, 0x8420, 0x831a, 0xa399,
- 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0,
- 0x1cff, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048,
- 0x12d5, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1d0b, 0x6910,
- 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12d5, 0x6800,
- 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd,
- 0x6852, 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078,
- 0x1d1e, 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0005, 0x2004, 0xa084, 0x0007, 0x0079, 0x1d26, 0x1d2e, 0x1d2f,
- 0x1d32, 0x1d35, 0x1d3a, 0x1d3d, 0x1d42, 0x1d47, 0x007c, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x17a5, 0x007c, 0x1078, 0x17a5, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x145e, 0x007c, 0x1078, 0x1b28, 0x1078,
- 0x145e, 0x007c, 0x1078, 0x17a5, 0x1078, 0x145e, 0x007c, 0x1078,
- 0x17a5, 0x1078, 0x1b28, 0x1078, 0x145e, 0x007c, 0x127e, 0x2091,
- 0x2300, 0x2079, 0x0200, 0x2071, 0x7c80, 0x2069, 0x7700, 0x2009,
- 0x0004, 0x7912, 0x7817, 0x0004, 0x1078, 0x202c, 0x781b, 0x0002,
- 0x20e1, 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c,
- 0xa084, 0x0007, 0x0079, 0x1d6c, 0x1d90, 0x1d74, 0x1d78, 0x1d7c,
- 0x1d82, 0x1d86, 0x1d8a, 0x1d8e, 0x1078, 0x4252, 0x0078, 0x1d90,
- 0x1078, 0x4281, 0x0078, 0x1d90, 0x1078, 0x4252, 0x1078, 0x4281,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x127f, 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003,
- 0x0040, 0x1d9c, 0x1078, 0x12d5, 0xa184, 0x0030, 0x0040, 0x1dad,
- 0x6a00, 0xa286, 0x0003, 0x00c0, 0x1da7, 0x1078, 0x12d5, 0x1078,
- 0x3553, 0x20e1, 0x9010, 0x0078, 0x1db9, 0xa184, 0x00c0, 0x0040,
- 0x1db3, 0x1078, 0x12d5, 0xa184, 0x0300, 0x0040, 0x1db9, 0x20e1,
- 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e,
- 0x0f7e, 0x2071, 0x7700, 0x7128, 0x2001, 0x7923, 0x2102, 0x2001,
- 0x792b, 0x2102, 0xa182, 0x0211, 0x00c8, 0x1dd2, 0x2009, 0x0008,
- 0x0078, 0x1dfc, 0xa182, 0x0259, 0x00c8, 0x1dda, 0x2009, 0x0007,
- 0x0078, 0x1dfc, 0xa182, 0x02c1, 0x00c8, 0x1de2, 0x2009, 0x0006,
- 0x0078, 0x1dfc, 0xa182, 0x0349, 0x00c8, 0x1dea, 0x2009, 0x0005,
- 0x0078, 0x1dfc, 0xa182, 0x0421, 0x00c8, 0x1df2, 0x2009, 0x0004,
- 0x0078, 0x1dfc, 0xa182, 0x0581, 0x00c8, 0x1dfa, 0x2009, 0x0003,
- 0x0078, 0x1dfc, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182,
- 0x0005, 0x00c8, 0x1e06, 0x7916, 0x0078, 0x1e08, 0x7817, 0x0004,
- 0x1078, 0x202c, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091,
- 0x2200, 0x2061, 0x0100, 0x2071, 0x7700, 0x6024, 0x6026, 0x6033,
- 0x00ef, 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b,
- 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007,
- 0x0caf, 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001,
- 0x772d, 0x2003, 0x0000, 0x2001, 0x772c, 0x2003, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184,
- 0x002c, 0x00c0, 0x1e47, 0xa184, 0x0007, 0x0079, 0x1e4d, 0xa195,
- 0x0004, 0xa284, 0x0007, 0x0079, 0x1e4d, 0x1e79, 0x1e55, 0x1e59,
- 0x1e5d, 0x1e63, 0x1e67, 0x1e6d, 0x1e73, 0x1078, 0x47bc, 0x0078,
- 0x1e79, 0x1078, 0x48ab, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078,
- 0x47bc, 0x0078, 0x1e79, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078,
- 0x47bc, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078,
- 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078, 0x47bc, 0x1078,
- 0x1e7e, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040,
- 0x1f32, 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00,
- 0xa196, 0xff00, 0x0040, 0x1ead, 0x6030, 0xa084, 0x00ff, 0x810f,
- 0xa116, 0x0040, 0x1ead, 0x7130, 0xd18c, 0x00c0, 0x1ead, 0x2011,
- 0x7752, 0x2214, 0xd2ec, 0x0040, 0x1ea1, 0xc18d, 0x7132, 0x0078,
- 0x1ead, 0x6240, 0xa294, 0x0010, 0x0040, 0x1eef, 0x6248, 0xa294,
- 0xff00, 0xa296, 0xff00, 0x00c0, 0x1eef, 0x037e, 0x73b8, 0x2011,
- 0x8013, 0x1078, 0x2d20, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011,
- 0x7752, 0x220c, 0xd1a4, 0x0040, 0x1ed7, 0x017e, 0x2009, 0x0001,
- 0x2011, 0x0100, 0x1078, 0x478a, 0x2019, 0x000e, 0x1078, 0x758f,
- 0xa484, 0x00ff, 0xa080, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f,
- 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x75f7, 0x017f, 0xd1ac,
- 0x00c0, 0x1ee0, 0x2019, 0x0004, 0x1078, 0x226d, 0x0078, 0x1eef,
- 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078, 0x3806, 0x00c0,
- 0x1eeb, 0x1078, 0x35f9, 0x8108, 0x00f0, 0x1ee5, 0x157f, 0x0c7f,
- 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7, 0x1078, 0x35bc, 0x0f7e,
- 0x2079, 0x7949, 0x783c, 0xa086, 0x0000, 0x0040, 0x1f07, 0x6027,
- 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f,
- 0x2011, 0x0003, 0x1078, 0x5892, 0x2011, 0x0002, 0x1078, 0x589c,
- 0x1078, 0x57a8, 0x1078, 0x46c0, 0x037e, 0x2019, 0x0000, 0x1078,
- 0x583a, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0x7700, 0x2014,
- 0xa296, 0x0004, 0x00c0, 0x1f2a, 0xd19c, 0x00c0, 0x1f2a, 0x6228,
- 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x7720, 0x2003, 0x0000,
- 0x6027, 0x0020, 0xd194, 0x0040, 0x1fd3, 0x0f7e, 0x2079, 0x7949,
- 0x783c, 0xa086, 0x0001, 0x00c0, 0x1f56, 0x017e, 0x6027, 0x0004,
- 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000,
- 0x2079, 0x7936, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4d50,
- 0x1078, 0x4e10, 0x017f, 0x0f7f, 0x0078, 0x1fd3, 0x0f7f, 0x017e,
- 0x6220, 0xd2b4, 0x0040, 0x1f8b, 0x1078, 0x46c0, 0x1078, 0x5656,
- 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x1f6e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
- 0x2061, 0x7936, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1f7e, 0x8000,
- 0x602a, 0x0c7f, 0x1078, 0x5648, 0x0078, 0x1fd2, 0x2019, 0x793f,
- 0x2304, 0xa065, 0x0040, 0x1f88, 0x2009, 0x0027, 0x1078, 0x5cfb,
- 0x0c7f, 0x0078, 0x1fd2, 0xd2bc, 0x0040, 0x1fd2, 0x1078, 0x46ce,
- 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x1fa0, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0d7f, 0x0c7e, 0x2061, 0x7936, 0x6044, 0xa09a, 0x0002, 0x00c8,
- 0x1fc1, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1fd2,
- 0x1078, 0x46c5, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
- 0x1fbd, 0x6017, 0x0012, 0x0078, 0x1fd2, 0x6017, 0x0016, 0x0078,
- 0x1fd2, 0x037e, 0x2019, 0x0001, 0x1078, 0x583a, 0x037f, 0x2019,
- 0x7945, 0x2304, 0xa065, 0x0040, 0x1fd1, 0x2009, 0x004f, 0x1078,
- 0x5cfb, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1ffb, 0x017e, 0x6028,
- 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5892, 0x2011, 0x0002,
- 0x1078, 0x589c, 0x1078, 0x57a8, 0x1078, 0x46c0, 0x037e, 0x2019,
- 0x0000, 0x1078, 0x583a, 0x037f, 0x60e3, 0x0000, 0x1078, 0x7666,
- 0x1078, 0x7684, 0x2001, 0x7700, 0x2003, 0x0004, 0x6027, 0x0008,
- 0x1078, 0x11c6, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
- 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7700, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x2025, 0x81ff, 0x0040,
- 0x2017, 0x2011, 0x8011, 0x1078, 0x2d20, 0x0078, 0x2025, 0x2011,
- 0x8012, 0x1078, 0x2d20, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
- 0x0028, 0x1078, 0x226d, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
- 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
- 0x2061, 0x0100, 0xa190, 0x2047, 0x2204, 0x60f2, 0xa192, 0x0005,
- 0x00c8, 0x203e, 0xa190, 0x2050, 0x0078, 0x2040, 0x2011, 0x2054,
- 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840,
- 0x0840, 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
- 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
- 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0, 0x2062, 0x81ff,
- 0x0040, 0x2066, 0x1078, 0x4405, 0x0078, 0x206d, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0x00ff, 0x007c, 0x2094, 0x2098, 0x209c, 0x20a2,
- 0x20a8, 0x20ae, 0x20b4, 0x20bc, 0x20c4, 0x20ca, 0x20d0, 0x20d8,
- 0x20e0, 0x20e8, 0x20f0, 0x20fa, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x107e, 0x007e, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f,
- 0x1078, 0x1d64, 0x0078, 0x211d, 0x0005, 0x0078, 0x2104, 0xb084,
- 0x003c, 0x8004, 0x8004, 0x0079, 0x210d, 0x211d, 0x209a, 0x209e,
- 0x20a4, 0x20aa, 0x20b0, 0x20b6, 0x20be, 0x20c6, 0x20cc, 0x20d2,
- 0x20da, 0x20e2, 0x20ea, 0x20f2, 0x20fc, 0x0008, 0x2107, 0x007f,
- 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2041, 0x007e,
- 0x70bc, 0xd09c, 0x0040, 0x212e, 0x2041, 0x007f, 0x2001, 0x010c,
- 0x203c, 0x727c, 0x82ff, 0x0040, 0x2179, 0x037e, 0x738c, 0xa38e,
- 0xffff, 0x00c0, 0x213d, 0x2019, 0x0001, 0x8314, 0xa2e0, 0x7dc0,
- 0x2c04, 0xa38c, 0x0001, 0x0040, 0x214a, 0xa084, 0xff00, 0x8007,
- 0x0078, 0x214c, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x216e, 0xa08e,
- 0x00ff, 0x0040, 0x2174, 0x2009, 0x0000, 0x1078, 0x2059, 0x1078,
- 0x37cb, 0x00c0, 0x2171, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2168, 0x1078, 0x21cb, 0x0040, 0x2171, 0x0078, 0x216e,
- 0x1078, 0x22cf, 0x1078, 0x21f2, 0x0040, 0x2171, 0x8318, 0x0078,
- 0x213d, 0x738e, 0x0078, 0x2176, 0x708f, 0xffff, 0x037f, 0x0078,
- 0x21c8, 0xa780, 0x2303, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x708c,
- 0xa096, 0xffff, 0x0040, 0x218b, 0xa812, 0x00c8, 0x219b, 0x708f,
- 0xffff, 0x0078, 0x21c5, 0x2009, 0x0000, 0x70bc, 0xd09c, 0x0040,
- 0x2196, 0xd094, 0x0040, 0x2196, 0x2009, 0x007e, 0x2100, 0xa802,
- 0x20a8, 0x0078, 0x219f, 0x2008, 0x2810, 0xa202, 0x20a8, 0x2700,
- 0x157e, 0x017e, 0xa106, 0x0040, 0x21bc, 0x1078, 0x37cb, 0x00c0,
- 0x21c5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x21b6,
- 0x1078, 0x21cb, 0x0040, 0x21c5, 0x0078, 0x21bc, 0x1078, 0x22cf,
- 0x1078, 0x21f2, 0x0040, 0x21c5, 0x017f, 0x8108, 0x157f, 0x00f0,
- 0x219f, 0x708f, 0xffff, 0x0078, 0x21c8, 0x017f, 0x157f, 0x718e,
- 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
- 0x1078, 0x5c6e, 0x0040, 0x21ed, 0x2d00, 0x601a, 0x601f, 0x0001,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0000, 0x1078, 0x37ae,
- 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009,
- 0x0004, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
- 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5c6e, 0x0040, 0x2214, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x37cb, 0x00c0,
- 0x2227, 0x1078, 0x222a, 0x0040, 0x2227, 0x70c3, 0xffff, 0x027f,
- 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5c6e, 0x0040, 0x224c, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x127e,
- 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078, 0x37cb, 0x00c0,
- 0x226a, 0x2c68, 0x1078, 0x5c6e, 0x0040, 0x226a, 0x2d00, 0x601a,
- 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e,
- 0x037e, 0x027e, 0x1078, 0x4a3f, 0x1078, 0x49ef, 0x1078, 0x61c8,
- 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3806, 0x00c0,
- 0x2285, 0x1078, 0x39f0, 0x1078, 0x35f9, 0x017f, 0x8108, 0x00f0,
- 0x227c, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e,
- 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078,
- 0x7431, 0x017f, 0x2e60, 0x1078, 0x39f0, 0xa186, 0x007f, 0x0040,
- 0x22ab, 0x1078, 0x35f9, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x00c0, 0x22c5, 0x2071, 0x7700, 0x7088, 0xa005, 0x0040, 0x22c2,
- 0x8001, 0x708a, 0x007f, 0x0e7f, 0x007c, 0x2071, 0x7700, 0x70c4,
- 0xa005, 0x0040, 0x22c2, 0x8001, 0x70c6, 0x0078, 0x22c2, 0x6000,
- 0xc08c, 0x6002, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e,
- 0x157e, 0x81ff, 0x00c0, 0x22e0, 0x20a9, 0x0001, 0x0078, 0x22e4,
- 0x20a9, 0x007f, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7820, 0x2c64,
- 0x8cff, 0x0040, 0x22f6, 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x1078, 0x39f0, 0x027f, 0x8210,
- 0x00f0, 0x22e4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
- 0x0c7f, 0x0e7f, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
- 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
- 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
- 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6,
- 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac,
- 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f,
- 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488,
- 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76,
- 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c,
- 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c,
- 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151,
- 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46,
- 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034,
- 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a,
- 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d,
- 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902,
- 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500,
- 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000,
- 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000,
- 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400,
- 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00,
- 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000,
- 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100,
- 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00,
- 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
- 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
- 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x2071, 0x776d, 0x7003, 0x0002, 0xa006,
- 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x777d, 0x7037, 0x777d,
- 0x7007, 0x0001, 0x2061, 0x77bd, 0x6003, 0x0002, 0x007c, 0x0090,
- 0x242a, 0x0068, 0x242a, 0x2071, 0x776d, 0x2b78, 0x7818, 0xd084,
- 0x00c0, 0x242a, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x2511,
- 0x0079, 0x24ae, 0x007c, 0x2071, 0x776d, 0x7004, 0x0079, 0x2430,
- 0x2434, 0x2435, 0x243f, 0x2451, 0x007c, 0x0090, 0x243e, 0x0068,
- 0x243e, 0x2b78, 0x7818, 0xd084, 0x0040, 0x245d, 0x007c, 0x2b78,
- 0x2061, 0x77bd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x244c, 0xa086,
- 0x0200, 0x0040, 0x2509, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
- 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2459,
- 0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a,
- 0x0040, 0x00c8, 0x2466, 0x61b0, 0x0079, 0x246e, 0x2100, 0xa08a,
- 0x0036, 0x00c8, 0x2505, 0x61b0, 0x0079, 0x24ae, 0x24e7, 0x2519,
- 0x2521, 0x2525, 0x252d, 0x2533, 0x2537, 0x2540, 0x2544, 0x254c,
- 0x2550, 0x2505, 0x2505, 0x2505, 0x2554, 0x2505, 0x2564, 0x257b,
- 0x2592, 0x260e, 0x2613, 0x2640, 0x269a, 0x26ab, 0x26c9, 0x26fc,
- 0x2706, 0x2713, 0x2726, 0x2740, 0x2749, 0x2786, 0x278c, 0x2505,
- 0x279c, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27a0, 0x27a6,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x27ae, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27bb, 0x27c1,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x254c, 0x2550,
- 0x2505, 0x2505, 0x27d3, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2820, 0x28ed,
- 0x2901, 0x2908, 0x296b, 0x29c6, 0x29d1, 0x2a10, 0x2a1f, 0x2a2e,
- 0x2a31, 0x27d7, 0x2a5a, 0x2aa1, 0x2aae, 0x2ba0, 0x2c86, 0x2cad,
- 0x2dab, 0x2db9, 0x2dc6, 0x2e00, 0x713c, 0x0078, 0x24e7, 0x2021,
- 0x4000, 0x1078, 0x2cfa, 0x127e, 0x2091, 0x8000, 0x0068, 0x24f4,
- 0x7818, 0xd084, 0x0040, 0x24f7, 0x127f, 0x0078, 0x24eb, 0x781b,
- 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
- 0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
- 0x24e9, 0x2021, 0x4002, 0x0078, 0x24e9, 0x2021, 0x4003, 0x0078,
- 0x24e9, 0x2021, 0x4005, 0x0078, 0x24e9, 0x2021, 0x4006, 0x0078,
- 0x24e9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2d09, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2d0d, 0x7924, 0x7828, 0x2114,
- 0x200a, 0x0078, 0x24e7, 0x7924, 0x2114, 0x0078, 0x24e7, 0x2099,
- 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x24e7,
- 0x7824, 0x2060, 0x0078, 0x2556, 0x2009, 0x0001, 0x2011, 0x000f,
- 0x2019, 0x0007, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x251b,
- 0x7d38, 0x7c3c, 0x0078, 0x2527, 0x2061, 0x1000, 0x610c, 0xa006,
- 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2558, 0x2010, 0xa005,
- 0x0040, 0x24e7, 0x0078, 0x250d, 0x2061, 0x7751, 0x7824, 0x7930,
- 0xa11a, 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604a, 0x6142,
- 0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
- 0x3d43, 0x0078, 0x24e7, 0x2061, 0x7751, 0x7824, 0x7930, 0xa11a,
- 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604e, 0x6146, 0x782c,
- 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x3b19,
- 0x0078, 0x24e7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x7774, 0x41a1, 0x1078,
- 0x2cbf, 0x0040, 0x2511, 0x2009, 0x0020, 0x1078, 0x2d09, 0x701b,
- 0x25aa, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
- 0x0040, 0x25b6, 0xa096, 0x0019, 0x00c0, 0x2511, 0x810f, 0xa18c,
- 0x00ff, 0x0040, 0x2511, 0x710e, 0x700c, 0x8001, 0x0040, 0x25e7,
- 0x700e, 0x1078, 0x2cbf, 0x0040, 0x2511, 0x2009, 0x0020, 0x2061,
- 0x77bd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
- 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x2d09, 0x701b,
- 0x25da, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
- 0x25e5, 0xa096, 0x000a, 0x00c0, 0x2511, 0x0078, 0x25bc, 0x7010,
- 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x36fe, 0x00c0, 0x25f5,
- 0x7007, 0x0003, 0x701b, 0x25f7, 0x007c, 0x1078, 0x3bdc, 0x127e,
- 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x7774, 0x530a, 0x2100,
- 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
- 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2d0d, 0x6198, 0x7824,
- 0x609a, 0x0078, 0x24e7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
- 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
- 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
- 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
- 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
- 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
- 0x81ff, 0x00c0, 0x2511, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078,
- 0x3806, 0x00c0, 0x2515, 0x7e38, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x0048, 0x2654, 0x0078, 0x2515, 0x7c28, 0x7d2c, 0x1078, 0x39b7,
- 0xd28c, 0x00c0, 0x265f, 0x1078, 0x394b, 0x0078, 0x2661, 0x1078,
- 0x3985, 0x00c0, 0x268b, 0x2061, 0x7e00, 0x127e, 0x2091, 0x8000,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x2679, 0x6010, 0xa06d, 0x0040,
- 0x2679, 0x683c, 0xa406, 0x00c0, 0x2679, 0x6840, 0xa506, 0x0040,
- 0x2684, 0x127f, 0xace0, 0x0008, 0x2001, 0x7715, 0x2004, 0xac02,
- 0x00c8, 0x2511, 0x0078, 0x2665, 0x1078, 0x67fd, 0x127f, 0x0040,
- 0x2511, 0x0078, 0x24e7, 0xa00e, 0x2001, 0x0005, 0x1078, 0x3bdc,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x6c12, 0x1078, 0x3b4c, 0x127f,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040,
- 0x2515, 0x1078, 0x388f, 0x0040, 0x2511, 0x1078, 0x39c4, 0x0040,
- 0x2511, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ce9,
- 0x0040, 0x2515, 0x1078, 0x3a2b, 0x0040, 0x2511, 0x2019, 0x0005,
- 0x1078, 0x39e5, 0x0040, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650, 0x0078,
- 0x24e7, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0, 0x26f6, 0x2029,
- 0x00ff, 0x644c, 0x2400, 0xa506, 0x0040, 0x26f0, 0x2508, 0x1078,
- 0x3806, 0x00c0, 0x26f0, 0x1078, 0x3a2b, 0x0040, 0x2511, 0x2019,
- 0x0004, 0x1078, 0x39e5, 0x0040, 0x26f6, 0x7824, 0xa08a, 0x1000,
- 0x00c8, 0x26f9, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650,
- 0x8529, 0x00c8, 0x26d2, 0x127f, 0x0078, 0x24e7, 0x127f, 0x0078,
- 0x2511, 0x127f, 0x0078, 0x2515, 0x1078, 0x2cd7, 0x0040, 0x2515,
- 0x1078, 0x38fc, 0x1078, 0x39b7, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x38eb, 0x1078,
- 0x39b7, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7,
- 0x0040, 0x2515, 0x1078, 0x3988, 0x0040, 0x2511, 0x1078, 0x3747,
- 0x1078, 0x3944, 0x1078, 0x39b7, 0x0078, 0x24e7, 0x1078, 0x2cd7,
- 0x0040, 0x2515, 0x1078, 0x388f, 0x0040, 0x2511, 0x62a0, 0x2019,
- 0x0005, 0x0c7e, 0x1078, 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x1078, 0x39b7, 0x0078, 0x24e7,
- 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x39b7, 0x2208, 0x0078,
- 0x24e7, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0x77ff, 0x6810, 0x6914,
- 0xa10a, 0x00c8, 0x2755, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000,
- 0x2019, 0x0000, 0x20a9, 0x007e, 0x2069, 0x7820, 0x2d04, 0xa075,
- 0x0040, 0x276a, 0x704c, 0x1078, 0x2774, 0xa210, 0x7080, 0x1078,
- 0x2774, 0xa318, 0x8d68, 0x00f0, 0x275e, 0x2300, 0xa218, 0x0e7f,
- 0x0d7f, 0x157f, 0x0078, 0x24e7, 0x0f7e, 0x017e, 0xa07d, 0x0040,
- 0x2783, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2783,
- 0x2178, 0x0078, 0x277b, 0x017f, 0x0f7f, 0x007c, 0x2069, 0x77ff,
- 0x6910, 0x629c, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x614c,
- 0xa190, 0x2303, 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00,
- 0xa215, 0x6364, 0x0078, 0x24e7, 0x613c, 0x6240, 0x0078, 0x24e7,
- 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ce9,
- 0x0040, 0x2515, 0x6244, 0x6338, 0x0078, 0x24e7, 0x613c, 0x6240,
- 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0x7751, 0x831f, 0xa305,
- 0x6816, 0x0078, 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0078,
- 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x7828, 0xa00d, 0x0040,
- 0x2515, 0x782c, 0xa005, 0x0040, 0x2515, 0x6244, 0x6146, 0x6338,
- 0x603a, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x2594, 0x7824,
- 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2511, 0x624c, 0xa084,
- 0xff00, 0x8007, 0xa206, 0x00c0, 0x27ef, 0x2001, 0x7740, 0x2009,
- 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d, 0x81ff,
- 0x00c0, 0x2511, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2511, 0x0c7e, 0x1078, 0x2cbf,
- 0x0c7f, 0x0040, 0x2511, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6b0c, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2811,
- 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0xad80, 0x000e,
- 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d,
- 0x1078, 0x2cbf, 0x0040, 0x2511, 0x2009, 0x001c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x1078, 0x2d09, 0x701b, 0x282f, 0x007c, 0xade8,
- 0x000d, 0x6800, 0xa005, 0x0040, 0x2515, 0x6804, 0xd0ac, 0x0040,
- 0x283c, 0xd0a4, 0x0040, 0x2515, 0xd094, 0x0040, 0x2847, 0x0c7e,
- 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c,
- 0x0040, 0x2852, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010,
- 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048,
- 0x2867, 0xd084, 0x0040, 0x2867, 0x6a28, 0xa28a, 0x007f, 0x00c8,
- 0x2515, 0xa288, 0x2303, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc,
- 0x0040, 0x2870, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x2515, 0x604e,
- 0x6808, 0xa08a, 0x0100, 0x0048, 0x2515, 0xa08a, 0x0841, 0x00c8,
- 0x2515, 0xa084, 0x0007, 0x00c0, 0x2515, 0x680c, 0xa005, 0x0040,
- 0x2515, 0x6810, 0xa005, 0x0040, 0x2515, 0x6848, 0x6940, 0xa10a,
- 0x00c8, 0x2515, 0x8001, 0x0040, 0x2515, 0x684c, 0x6944, 0xa10a,
- 0x00c8, 0x2515, 0x8001, 0x0040, 0x2515, 0x20a9, 0x001c, 0x2d98,
- 0x2069, 0x7751, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
- 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x3d43, 0x1078, 0x3b19,
- 0x6000, 0xa086, 0x0000, 0x00c0, 0x28eb, 0x6808, 0x602a, 0x1078,
- 0x1dbe, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
- 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
- 0x28cb, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
- 0x831f, 0x0078, 0x28cd, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
- 0x6312, 0x1078, 0x46dc, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
- 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x28e7, 0x6003,
- 0x0001, 0x2091, 0x301d, 0x1078, 0x3553, 0x0078, 0x28eb, 0x6003,
- 0x0004, 0x2091, 0x301d, 0x0078, 0x24e7, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x2511, 0x2069, 0x7751, 0x7830, 0x6842, 0x7834, 0x6846,
- 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
- 0x2d0d, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x3553, 0x0078, 0x24e7,
- 0x81ff, 0x00c0, 0x2511, 0x617c, 0x81ff, 0x0040, 0x2922, 0x703f,
- 0x0000, 0x2001, 0x7dc0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2d0d, 0x701b, 0x24e4,
- 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x7dc0, 0x20a9,
- 0x0040, 0x20a1, 0x7dc0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
- 0x2303, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
- 0x2100, 0xa506, 0x0040, 0x2954, 0x1078, 0x3806, 0x00c0, 0x2954,
- 0x6014, 0x821c, 0x0048, 0x294c, 0xa398, 0x7dc0, 0xa085, 0xff00,
- 0x8007, 0x201a, 0x0078, 0x2953, 0xa398, 0x7dc0, 0x2324, 0xa4a4,
- 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8,
- 0x295b, 0x0078, 0x2938, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
- 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x7dc0, 0x2099, 0x7dc0, 0x1078,
- 0x359c, 0x0078, 0x2911, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0c7e,
- 0x1078, 0x2cbf, 0x0c7f, 0x0040, 0x2511, 0x2001, 0x7752, 0x2004,
- 0xd0b4, 0x0040, 0x2998, 0x6000, 0xd08c, 0x00c0, 0x2998, 0x6004,
- 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2998, 0x6837, 0x0000,
- 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6b44, 0x0040, 0x2511, 0x7007,
- 0x0003, 0x701b, 0x2994, 0x007c, 0x1078, 0x2ce9, 0x0040, 0x2515,
- 0x20a9, 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
- 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078,
- 0x359c, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006,
- 0x20a0, 0x1078, 0x359c, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098,
- 0xad80, 0x000a, 0x20a0, 0x1078, 0x359c, 0x2d00, 0x2009, 0x002b,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x39cf, 0x0078,
- 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x1078, 0x3a2b, 0x0040,
- 0x2511, 0x2019, 0x0004, 0x1078, 0x39e5, 0x7924, 0x810f, 0x7a28,
- 0x1078, 0x29ec, 0x0078, 0x24e7, 0xa186, 0x00ff, 0x0040, 0x29f4,
- 0x1078, 0x2a04, 0x0078, 0x2a03, 0x2029, 0x007e, 0x2061, 0x7700,
- 0x644c, 0x2400, 0xa506, 0x0040, 0x2a00, 0x2508, 0x1078, 0x2a04,
- 0x8529, 0x00c8, 0x29f9, 0x007c, 0x1078, 0x3806, 0x00c0, 0x2a0f,
- 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078,
- 0x388f, 0x0040, 0x2511, 0x1078, 0x39da, 0x0078, 0x24e7, 0x81ff,
- 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x388f,
- 0x0040, 0x2511, 0x1078, 0x39c4, 0x0078, 0x24e7, 0x6100, 0x0078,
- 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x6004, 0xa086, 0x0707,
- 0x0040, 0x2515, 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x2511, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x2a4a,
- 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a,
- 0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200,
- 0x0078, 0x24e7, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040,
- 0x2a64, 0x81ff, 0x00c0, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040,
- 0x2a78, 0xa182, 0x007f, 0x00c8, 0x2515, 0x2100, 0x1078, 0x206e,
- 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7949, 0x601b,
- 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff,
- 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
- 0x001e, 0x2011, 0x3578, 0x1078, 0x46d3, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0x7a28, 0x1078, 0x29ec, 0x127f, 0x0c7f, 0x027f, 0x0078,
- 0x24e7, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x37cb,
- 0x2c08, 0x0c7f, 0x00c0, 0x2515, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x60bc, 0xd09c, 0x0040, 0x2511, 0x1078, 0x2cbf, 0x0040,
- 0x2511, 0x6823, 0x0000, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x1078, 0x2d09, 0x701b, 0x2ac5, 0x007c, 0x2009, 0x0080, 0x1078,
- 0x3806, 0x00c0, 0x2ad2, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x0040, 0x2ad6, 0x2021, 0x400a, 0x0078, 0x24e9, 0x0d7e, 0xade8,
- 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820,
- 0xa0be, 0x0100, 0x0040, 0x2b48, 0xa0be, 0x0112, 0x0040, 0x2b48,
- 0xa0be, 0x0113, 0x0040, 0x2b48, 0xa0be, 0x0114, 0x0040, 0x2b48,
- 0xa0be, 0x0117, 0x0040, 0x2b48, 0xa0be, 0x011a, 0x0040, 0x2b48,
- 0xa0be, 0x0121, 0x0040, 0x2b3e, 0xa0be, 0x0131, 0x0040, 0x2b3e,
- 0xa0be, 0x0171, 0x0040, 0x2b48, 0xa0be, 0x0173, 0x0040, 0x2b48,
- 0xa0be, 0x01a1, 0x00c0, 0x2b11, 0x6830, 0x8007, 0x6832, 0x0078,
- 0x2b4e, 0xa0be, 0x0212, 0x0040, 0x2b44, 0xa0be, 0x0213, 0x0040,
- 0x2b44, 0xa0be, 0x0214, 0x0040, 0x2b36, 0xa0be, 0x0217, 0x0040,
- 0x2b30, 0xa0be, 0x021a, 0x00c0, 0x2b2a, 0x6838, 0x8007, 0x683a,
- 0x0078, 0x2b48, 0xa0be, 0x0300, 0x0040, 0x2b48, 0x0078, 0x2511,
- 0xad80, 0x0010, 0x20a9, 0x0007, 0x1078, 0x2b7c, 0xad80, 0x000e,
- 0x20a9, 0x0001, 0x1078, 0x2b7c, 0x0078, 0x2b48, 0xad80, 0x000c,
- 0x1078, 0x2b8a, 0x0078, 0x2b4e, 0xad80, 0x000e, 0x1078, 0x2b8a,
- 0xad80, 0x000c, 0x20a9, 0x0001, 0x1078, 0x2b7c, 0x0c7e, 0x1078,
- 0x2cbf, 0x0040, 0x2b71, 0x6837, 0x0119, 0x684f, 0x0020, 0x685b,
- 0x0001, 0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e,
- 0x6d92, 0x6996, 0x689b, 0x0000, 0x0c7f, 0x0d7f, 0x6837, 0x0000,
- 0x1078, 0x6b28, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2b75,
- 0x007c, 0x0c7f, 0x0d7f, 0x0078, 0x2511, 0x6820, 0xa086, 0x8001,
- 0x0040, 0x2511, 0x0078, 0x24e7, 0x017e, 0x2008, 0x2044, 0x8000,
- 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2b7e,
- 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000,
- 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a,
- 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f,
- 0xa182, 0x0080, 0x0048, 0x2515, 0xa182, 0x00ff, 0x00c8, 0x2515,
- 0x7a2c, 0x7b28, 0x6064, 0xa306, 0x00c0, 0x2bc1, 0x6068, 0xa246,
- 0xa8c4, 0xff00, 0x0040, 0x2515, 0xa206, 0x00c0, 0x2bc1, 0x0078,
- 0x2515, 0x0c7e, 0x1078, 0x2c2a, 0x2c68, 0x0c7f, 0x0040, 0x2be8,
- 0xa0c6, 0x4000, 0x00c0, 0x2bce, 0x0078, 0x2be5, 0xa0c6, 0x4007,
- 0x00c0, 0x2bd5, 0x2408, 0x0078, 0x2be5, 0xa0c6, 0x4008, 0x00c0,
- 0x2bdd, 0x2708, 0x2610, 0x0078, 0x2be5, 0xa0c6, 0x4009, 0x00c0,
- 0x2be3, 0x0078, 0x2be5, 0x2001, 0x4006, 0x2020, 0x0078, 0x24e9,
- 0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x5c6e, 0x0040,
- 0x2c18, 0x2d00, 0x601a, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e, 0x1078,
- 0x2cbf, 0x0c7f, 0x2b70, 0x0040, 0x2511, 0x6837, 0x0000, 0x2d00,
- 0x6012, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x379a, 0x2001,
- 0x0002, 0x1078, 0x37ae, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000,
- 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5cfb, 0xa085, 0x0001,
- 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x2511, 0x7007, 0x0003,
- 0x701b, 0x2c23, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0, 0x24e7,
- 0x0078, 0x2511, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021, 0x0080,
- 0x20a9, 0x007f, 0x2071, 0x78a0, 0x2e04, 0xa005, 0x00c0, 0x2c3e,
- 0x2100, 0xa406, 0x0040, 0x2c7b, 0x0078, 0x2c6f, 0x2068, 0x6f10,
- 0x2700, 0xa306, 0x00c0, 0x2c60, 0x6e14, 0x2600, 0xa206, 0x00c0,
- 0x2c60, 0x2400, 0xa106, 0x00c0, 0x2c5c, 0x2d60, 0xd884, 0x0040,
- 0x2c81, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2c81,
- 0x2001, 0x4000, 0x0078, 0x2c82, 0x2001, 0x4007, 0x0078, 0x2c82,
- 0x2400, 0xa106, 0x00c0, 0x2c6f, 0x6e14, 0x87ff, 0x00c0, 0x2c6b,
- 0x86ff, 0x0040, 0x2c7b, 0x2001, 0x4008, 0x0078, 0x2c82, 0x8420,
- 0x8e70, 0x00f0, 0x2c34, 0x2001, 0x4009, 0x0078, 0x2c82, 0x2001,
- 0x0001, 0x0078, 0x2c82, 0x1078, 0x37cb, 0x00c0, 0x2c77, 0x6312,
- 0x6216, 0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cbf, 0x0040, 0x2511, 0x6837, 0x0000, 0x7824,
- 0xa005, 0x0040, 0x2515, 0xa096, 0x00ff, 0x0040, 0x2c9b, 0xa092,
- 0x0004, 0x00c8, 0x2515, 0x2010, 0x2d18, 0x1078, 0x2251, 0x0040,
- 0x2511, 0x7007, 0x0003, 0x701b, 0x2ca6, 0x007c, 0x6830, 0xa086,
- 0x0100, 0x0040, 0x2511, 0x0078, 0x24e7, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x0080, 0x0048, 0x2515, 0xa182, 0x00ff, 0x00c8,
- 0x2515, 0x1078, 0x6a44, 0x1078, 0x37ee, 0x0078, 0x24e7, 0x1078,
- 0x1314, 0x0040, 0x2cd6, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
- 0x2cce, 0x2d00, 0x7012, 0x7016, 0x0078, 0x2cd4, 0x7014, 0x6802,
- 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x3806, 0x00c0, 0x2ce6, 0x7e28,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x2ce7, 0xa066, 0x8cff,
- 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x3806, 0x00c0,
- 0x2cf7, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x2cf8, 0xa066,
- 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x2d05, 0x2168,
- 0x6904, 0x1078, 0x1348, 0x0078, 0x2cfc, 0x7112, 0x7116, 0x017f,
- 0x007c, 0x2031, 0x0001, 0x0078, 0x2d0f, 0x2031, 0x0000, 0x2061,
- 0x77bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b, 0x24e7, 0x007c,
- 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x777b,
- 0x2004, 0xa005, 0x00c0, 0x2d3b, 0x0068, 0x2d3b, 0x7818, 0xd084,
- 0x00c0, 0x2d3b, 0x781b, 0x0001, 0x7a22, 0x7b26, 0x7c2a, 0x2091,
- 0x4080, 0x0078, 0x2d60, 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x776d,
- 0x7138, 0xa182, 0x0008, 0x0048, 0x2d49, 0x7030, 0x2060, 0x0078,
- 0x2d5a, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x77bd, 0x0048, 0x2d52,
- 0x2061, 0x777d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2d58, 0x7036,
- 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f, 0x0c7f, 0x017f,
- 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x776d, 0x7038, 0xa005,
- 0x0040, 0x2d9c, 0x127e, 0x2091, 0x8000, 0x0068, 0x2d9b, 0x0f7e,
- 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2d9a, 0x0c7e, 0x781b,
- 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x6008,
- 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, 0xa005, 0x00c0,
- 0x2d90, 0x7033, 0x777d, 0x7037, 0x777d, 0x0c7f, 0x0078, 0x2d9a,
- 0xac80, 0x0008, 0xa0fa, 0x77bd, 0x0048, 0x2d98, 0x2001, 0x777d,
- 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e, 0x2001,
- 0x7752, 0x2004, 0xd0c4, 0x0040, 0x2da9, 0x2011, 0x8014, 0x1078,
- 0x2d20, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x127e, 0x2091,
- 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x3553, 0x127f, 0x0078,
- 0x24e7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0, 0x2dc4, 0x61c8,
- 0xa10d, 0x61ca, 0x0078, 0x24e7, 0x0078, 0x2515, 0x81ff, 0x00c0,
- 0x2511, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2511, 0x2001, 0x7752,
- 0x2004, 0xd0a4, 0x00c0, 0x2511, 0x1078, 0x2ce9, 0x0040, 0x2515,
- 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2de3, 0x7828,
- 0xa005, 0x0040, 0x24e7, 0x0c7e, 0x1078, 0x2cbf, 0x0c7f, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6bb1, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2df9,
- 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0x0078, 0x24e7,
- 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2511, 0x7f24,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2cbf, 0x0040, 0x2511,
- 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000,
- 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x3806, 0x00c0, 0x2e46,
- 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2e46, 0xa084, 0x00ff, 0xa0c6,
- 0x0006, 0x00c0, 0x2e46, 0x87ff, 0x0040, 0x2e39, 0xac80, 0x0006,
- 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2b8a, 0x0078,
- 0x2e42, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3,
- 0x1078, 0x2b8a, 0x21a2, 0x94a0, 0xa6b0, 0x0005, 0x8108, 0xa186,
- 0x007e, 0x0040, 0x2e51, 0xa686, 0x0028, 0x0040, 0x2e5a, 0x0078,
- 0x2e1c, 0x86ff, 0x00c0, 0x2e58, 0x7120, 0x810b, 0x0078, 0x24e7,
- 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061,
- 0x77bd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b,
- 0x2e72, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2e84, 0x711c, 0x7024,
- 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x77bd, 0x6224, 0x6328,
- 0x642c, 0x6530, 0x0078, 0x2e1c, 0x7120, 0x810b, 0x0078, 0x24e7,
- 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7700, 0x6044,
- 0xd0a4, 0x00c0, 0x2eb1, 0xd084, 0x0040, 0x2e9a, 0x1078, 0x2fd8,
- 0x0078, 0x2ead, 0xd08c, 0x0040, 0x2ea1, 0x1078, 0x2eef, 0x0078,
- 0x2ead, 0xd094, 0x0040, 0x2ea8, 0x1078, 0x2ed2, 0x0078, 0x2ead,
- 0xd09c, 0x0040, 0x2ead, 0x1078, 0x2ebb, 0x0e7f, 0x0c7f, 0x127f,
- 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2eb8, 0xc19d, 0x612a,
- 0x017f, 0x0078, 0x2ead, 0x6043, 0x0040, 0x6043, 0x0000, 0x706f,
- 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009, 0x7dc0, 0x200b,
- 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011, 0x3513, 0x1078,
- 0x46d3, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2eee, 0x2011, 0x3513,
- 0x1078, 0x4643, 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c,
- 0x00c0, 0x2eea, 0x7083, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010,
- 0x0078, 0x2eee, 0x7077, 0x0000, 0x0078, 0x2eee, 0x007c, 0x7074,
- 0xa08a, 0x0003, 0x00c8, 0x2ef8, 0x1079, 0x2efb, 0x0078, 0x2efa,
- 0x1078, 0x12d5, 0x007c, 0x2efe, 0x2f4d, 0x2fd7, 0x0f7e, 0x7077,
- 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078, 0x1dbe, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x2079, 0x7c00, 0x207b, 0x2200, 0x7807,
- 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817,
- 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827,
- 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079, 0x7c0c, 0x207b,
- 0x1101, 0x7807, 0x0000, 0x2099, 0x7705, 0x20a1, 0x7c0e, 0x20a9,
- 0x0004, 0x53a3, 0x2079, 0x7c12, 0x207b, 0x0000, 0x7807, 0x0000,
- 0x2099, 0x7c00, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3,
- 0x000c, 0x600f, 0x0000, 0x1078, 0x353a, 0x0f7f, 0x707b, 0x0000,
- 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e, 0x7078, 0x707b,
- 0x0000, 0xa025, 0x0040, 0x2fc1, 0x6020, 0xd0b4, 0x00c0, 0x2fbf,
- 0x7184, 0x81ff, 0x0040, 0x2fa8, 0xa486, 0x000c, 0x00c0, 0x2fb3,
- 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7c80, 0x2019, 0x7c00,
- 0x220c, 0x2304, 0xa106, 0x00c0, 0x2f7f, 0x8210, 0x8318, 0x00f0,
- 0x2f68, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043,
- 0x0006, 0x7077, 0x0002, 0x7083, 0x0002, 0x0078, 0x2fbf, 0x2069,
- 0x7c80, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2fb3, 0x6834, 0xa005,
- 0x00c0, 0x2fb3, 0x6900, 0xa18c, 0x00ff, 0x00c0, 0x2f93, 0x6804,
- 0xa005, 0x0040, 0x2fa8, 0x2011, 0x7c8e, 0x2019, 0x7705, 0x20a9,
- 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2fa6, 0x00c0, 0x2fb3,
- 0x8210, 0x8318, 0x00f0, 0x2f99, 0x0078, 0x2fb3, 0x7087, 0x0000,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043, 0x0000, 0x6020,
- 0xd0b4, 0x00c0, 0x2fbf, 0x60c3, 0x000c, 0x1078, 0x353a, 0x0d7f,
- 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2fbf, 0x60c3, 0x000c, 0x2011,
- 0x7940, 0x2013, 0x0000, 0x707b, 0x0000, 0x20e1, 0x9080, 0x60a3,
- 0x0056, 0x60a7, 0x9575, 0x1078, 0x564d, 0x0078, 0x2fbf, 0x007c,
- 0x7080, 0xa08a, 0x001d, 0x00c8, 0x2fe1, 0x1079, 0x2fe4, 0x0078,
- 0x2fe3, 0x1078, 0x12d5, 0x007c, 0x3008, 0x3017, 0x3048, 0x305d,
- 0x308d, 0x30b5, 0x30e5, 0x310f, 0x313f, 0x3165, 0x31b0, 0x31d2,
- 0x31f6, 0x320c, 0x3232, 0x3245, 0x324e, 0x3267, 0x3295, 0x32bd,
- 0x32eb, 0x3315, 0x335a, 0x338f, 0x33b1, 0x33ef, 0x3413, 0x342c,
- 0x3439, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9, 0x6006, 0x007c,
- 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002, 0x7083, 0x0001,
- 0x2009, 0x07d0, 0x2011, 0x351a, 0x1078, 0x4636, 0x007c, 0x0f7e,
- 0x7078, 0xa086, 0x0014, 0x00c0, 0x3046, 0x6043, 0x0000, 0x6020,
- 0xd0b4, 0x00c0, 0x3046, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1102,
- 0x00c0, 0x3044, 0x7834, 0xa005, 0x00c0, 0x3044, 0x7a38, 0xd2fc,
- 0x0040, 0x303a, 0x70a4, 0xa005, 0x00c0, 0x303a, 0x1078, 0x35d3,
- 0x70a7, 0x0001, 0x2011, 0x351a, 0x1078, 0x4643, 0x7083, 0x0010,
- 0x1078, 0x324e, 0x0078, 0x3046, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x0003, 0x6043, 0x0004, 0x1078, 0x35a4, 0x20a3, 0x1102,
- 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x3054,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x308b, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x3087, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1102, 0x00c0,
- 0x3087, 0x7834, 0xa005, 0x00c0, 0x3087, 0x7a38, 0xd2fc, 0x0040,
- 0x3081, 0x70a4, 0xa005, 0x00c0, 0x3081, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0004, 0x1078, 0x308d, 0x0078, 0x308b, 0x7083,
- 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0005, 0x1078,
- 0x35a4, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x30a7, 0x714c, 0xa186, 0xffff, 0x0040,
- 0x30a7, 0x1078, 0x34de, 0x0040, 0x30a7, 0x1078, 0x35d3, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x30e3, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x30df, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1103, 0x00c0,
- 0x30df, 0x7834, 0xa005, 0x00c0, 0x30df, 0x7a38, 0xd2fc, 0x0040,
- 0x30d9, 0x70a4, 0xa005, 0x00c0, 0x30d9, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0006, 0x1078, 0x30e5, 0x0078, 0x30e3, 0x7083,
- 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0007, 0x1078,
- 0x35a4, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x3101, 0x7150, 0xa186, 0xffff, 0x0040,
- 0x3101, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34de, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x313d, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0014, 0x00c0, 0x3139, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1104, 0x00c0, 0x3139, 0x7834, 0xa005, 0x00c0, 0x3139, 0x7a38,
- 0xd2fc, 0x0040, 0x3133, 0x70a4, 0xa005, 0x00c0, 0x3133, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x7083, 0x0008, 0x1078, 0x313f, 0x0078,
- 0x313d, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0009, 0x1078, 0x35a4, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430,
- 0x706c, 0xa005, 0x00c0, 0x3152, 0x1078, 0x3448, 0x0040, 0x3162,
- 0x0078, 0x315c, 0x20a9, 0x0008, 0x2099, 0x7c8e, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x353a,
- 0x0078, 0x3164, 0x1078, 0x3001, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x31ae, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x31aa, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1105, 0x00c0,
- 0x31aa, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x3193, 0x7a38,
- 0xd2fc, 0x0040, 0x318b, 0x70a4, 0xa005, 0x00c0, 0x318b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083, 0x000a, 0x1078,
- 0x31b0, 0x0078, 0x31ae, 0xa005, 0x00c0, 0x31aa, 0x7a38, 0xd2fc,
- 0x0040, 0x31a2, 0x70a4, 0xa005, 0x00c0, 0x31a2, 0x1078, 0x35d3,
- 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e, 0x1078, 0x3232,
- 0x0078, 0x31ae, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x000b, 0x2011, 0x7c0e, 0x22a0, 0x20a9, 0x0040, 0x2019,
- 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000, 0x41a4, 0x1078,
- 0x35a4, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030, 0xa085, 0x0100,
- 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3, 0x0084, 0x1078,
- 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x31f4, 0x2011,
- 0x351a, 0x1078, 0x4643, 0xa086, 0x0084, 0x00c0, 0x31f0, 0x2079,
- 0x7c80, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x31f0, 0x7834, 0xa005,
- 0x00c0, 0x31f0, 0x7083, 0x000c, 0x1078, 0x31f6, 0x0078, 0x31f4,
- 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000d,
- 0x1078, 0x35a4, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0x7c8e,
- 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0084, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
- 0x3230, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0084, 0x00c0,
- 0x322c, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x322c,
- 0x7834, 0xa005, 0x00c0, 0x322c, 0x1078, 0x3596, 0x7083, 0x000e,
- 0x1078, 0x3232, 0x0078, 0x3230, 0x7083, 0x0002, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000, 0x608b, 0xbc85,
- 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
- 0x2011, 0x351a, 0x1078, 0x4636, 0x007c, 0x7078, 0xa005, 0x0040,
- 0x324d, 0x2011, 0x351a, 0x1078, 0x4643, 0x007c, 0x7083, 0x0011,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004,
- 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3293, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0014, 0x00c0, 0x3291, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1103, 0x00c0, 0x3291, 0x7834, 0xa005, 0x00c0, 0x3291, 0x7a38,
- 0xd2fc, 0x0040, 0x328b, 0x70a4, 0xa005, 0x00c0, 0x328b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x7083, 0x0012, 0x1078, 0x3295, 0x0078,
- 0x3293, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0013, 0x1078,
- 0x35b0, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x32af, 0x714c, 0xa186, 0xffff, 0x0040,
- 0x32af, 0x1078, 0x34de, 0x0040, 0x32af, 0x1078, 0x35d3, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x32e9, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x32e7, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1104, 0x00c0,
- 0x32e7, 0x7834, 0xa005, 0x00c0, 0x32e7, 0x7a38, 0xd2fc, 0x0040,
- 0x32e1, 0x70a4, 0xa005, 0x00c0, 0x32e1, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0014, 0x1078, 0x32eb, 0x0078, 0x32e9, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078, 0x35b0, 0x20a3,
- 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e, 0x706c, 0xa006,
- 0x00c0, 0x3307, 0x7150, 0xa186, 0xffff, 0x0040, 0x3307, 0xa180,
- 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34de, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x3358, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x3356, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1105, 0x00c0,
- 0x3356, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x333f, 0x7a38,
- 0xd2fc, 0x0040, 0x333b, 0x70a4, 0xa005, 0x00c0, 0x333b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078, 0x3350, 0xa005,
- 0x00c0, 0x3356, 0x7a38, 0xd2fc, 0x0040, 0x334e, 0x70a4, 0xa005,
- 0x00c0, 0x334e, 0x1078, 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0000,
- 0x7083, 0x0016, 0x1078, 0x335a, 0x0078, 0x3358, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80,
- 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0x7c8e,
- 0x707c, 0xa005, 0x0040, 0x3370, 0x7083, 0x0017, 0x0078, 0x3372,
- 0x7083, 0x001b, 0x706c, 0xa005, 0x00c0, 0x337c, 0x1078, 0x3448,
- 0x0040, 0x338c, 0x0078, 0x3386, 0x20a9, 0x0008, 0x2099, 0x7c8e,
- 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x353a, 0x0078, 0x338e, 0x1078, 0x3001, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x33af, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0084, 0x00c0, 0x33ad, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1106, 0x00c0, 0x33ad, 0x7834, 0xa005, 0x00c0, 0x33ad, 0x7083,
- 0x0018, 0x1078, 0x33b1, 0x0078, 0x33af, 0x707b, 0x0000, 0x0f7f,
- 0x007c, 0x7083, 0x0019, 0x1078, 0x35b0, 0x20a3, 0x1106, 0x20a3,
- 0x0000, 0x3430, 0x2099, 0x7c8e, 0x2039, 0x7c0e, 0x27a0, 0x20a9,
- 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000,
- 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, 0x2310,
- 0x8214, 0xa2a0, 0x7c0e, 0x2414, 0xa38c, 0x0001, 0x0040, 0x33dc,
- 0xa294, 0xff00, 0x0078, 0x33df, 0xa294, 0x00ff, 0x8007, 0xa215,
- 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3411, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0084, 0x00c0, 0x340f, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1107, 0x00c0, 0x340f, 0x7834, 0xa005, 0x00c0, 0x340f, 0x1078,
- 0x3596, 0x7083, 0x001a, 0x1078, 0x3413, 0x0078, 0x3411, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x001b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018,
- 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3,
- 0x0084, 0x1078, 0x353a, 0x007c, 0x7078, 0xa005, 0x0040, 0x3438,
- 0x2011, 0x351a, 0x1078, 0x4643, 0x7083, 0x001c, 0x1078, 0x3439,
- 0x007c, 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043,
- 0x0001, 0x2009, 0x07d0, 0x2011, 0x351a, 0x1078, 0x4636, 0x007c,
- 0x087e, 0x097e, 0x2029, 0x7752, 0x252c, 0x20a9, 0x0008, 0x2041,
- 0x7c0e, 0x28a0, 0x2099, 0x7c8e, 0x53a3, 0x20a9, 0x0008, 0x2011,
- 0x0007, 0xd5d4, 0x0040, 0x345e, 0x2011, 0x0000, 0x2800, 0xa200,
- 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3470, 0xd5d4, 0x0040, 0x346b,
- 0x8210, 0x0078, 0x346c, 0x8211, 0x00f0, 0x345e, 0x0078, 0x34d5,
- 0x82ff, 0x00c0, 0x3482, 0xd5d4, 0x0040, 0x347c, 0xa1a6, 0x3fff,
- 0x0040, 0x3468, 0x0078, 0x3480, 0xa1a6, 0x3fff, 0x0040, 0x34d5,
- 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0040,
- 0x348b, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040, 0x3492, 0x8423,
- 0x0078, 0x3493, 0x8424, 0x00c8, 0x34a0, 0xd5d4, 0x0040, 0x349b,
- 0x8319, 0x0078, 0x349c, 0x8318, 0x00f0, 0x348c, 0x0078, 0x34d5,
- 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0, 0x34a4, 0x2328,
- 0x8529, 0xa2be, 0x0007, 0x0040, 0x34b8, 0x007e, 0x2039, 0x0007,
- 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, 0x34b4,
- 0x754e, 0xa5c8, 0x2303, 0x292c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
- 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a, 0x706f, 0x0001,
- 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0xa085, 0x0001, 0x0078, 0x34db, 0xa006, 0x0078, 0x34db,
- 0xa006, 0x1078, 0x12d5, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021,
- 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048, 0x34eb, 0x8420,
- 0x8001, 0x0078, 0x34e3, 0x2118, 0x84ff, 0x0040, 0x34f4, 0xa39a,
- 0x0010, 0x8421, 0x00c0, 0x34ef, 0x2021, 0x0001, 0x83ff, 0x0040,
- 0x34fd, 0x8423, 0x8319, 0x00c0, 0x34f9, 0xa238, 0x2704, 0xa42c,
- 0x00c0, 0x3512, 0xa405, 0x203a, 0x714e, 0xa1a0, 0x2303, 0x242c,
- 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x706f, 0x0001,
- 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7700, 0x7073, 0x0000,
- 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100, 0x2071, 0x0140,
- 0x1078, 0x5656, 0x7004, 0xa084, 0x4000, 0x0040, 0x352b, 0x7003,
- 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0x7720,
- 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f,
- 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x7940, 0x2013,
- 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056,
- 0x60a7, 0x9575, 0x1078, 0x564d, 0x2009, 0x07d0, 0x2011, 0x351a,
- 0x1078, 0x46d3, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x2009, 0x00f7, 0x1078, 0x35bc, 0x2061, 0x7949, 0x601b,
- 0x0000, 0x601f, 0x0000, 0x2061, 0x7700, 0x6003, 0x0001, 0x2061,
- 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011,
- 0x3578, 0x1078, 0x4636, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c,
- 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078,
- 0x5656, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000, 0x0040, 0x358c,
- 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x1078, 0x3553, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040,
- 0x20a1, 0x7dc0, 0x2099, 0x7c8e, 0x3304, 0x8007, 0x20a2, 0x9398,
- 0x94a0, 0x00f0, 0x359c, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7c00, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100,
- 0x810f, 0x2001, 0x772c, 0x2004, 0xa005, 0x00c0, 0x35cd, 0x6030,
- 0xa084, 0x00ff, 0xa105, 0x0078, 0x35cf, 0xa185, 0x00f7, 0x604a,
- 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001, 0x7752, 0x2004,
- 0xd0a4, 0x0040, 0x35e6, 0xa006, 0x2020, 0x2009, 0x002a, 0x1078,
- 0x75f7, 0x2001, 0x770c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
- 0x1078, 0x226d, 0x047f, 0x017f, 0x007c, 0x157e, 0x20a9, 0x00ff,
- 0x2009, 0x7820, 0xa006, 0x200a, 0x8108, 0x00f0, 0x35f3, 0x157f,
- 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0x7751,
- 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198,
- 0x2303, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98,
- 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0,
- 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e,
- 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e,
- 0x6082, 0x6086, 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e,
- 0x61a2, 0x0d7e, 0x60a4, 0xa06d, 0x0040, 0x3638, 0x1078, 0x1348,
- 0x60a7, 0x0000, 0x60a8, 0xa06d, 0x0040, 0x3640, 0x1078, 0x1348,
- 0x60ab, 0x0000, 0x0d7f, 0xa006, 0x604a, 0x6810, 0x603a, 0x680c,
- 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f,
- 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0x6e48,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x36f1, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x00ff, 0x00c8, 0x36f7, 0x2001, 0x770c, 0x2004,
- 0xa084, 0x0003, 0x00c0, 0x36da, 0xa188, 0x7820, 0x2104, 0xa065,
- 0x0040, 0x36d0, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0,
- 0x36d6, 0x60a4, 0xa00d, 0x0040, 0x3681, 0x1078, 0x3a16, 0x0040,
- 0x36ca, 0x60a8, 0xa00d, 0x0040, 0x369b, 0x1078, 0x3a66, 0x00c0,
- 0x369b, 0x694c, 0xd1fc, 0x00c0, 0x3691, 0x1078, 0x378b, 0x0078,
- 0x36c5, 0x1078, 0x375c, 0x694c, 0xd1ec, 0x00c0, 0x36c5, 0x1078,
- 0x38eb, 0x0078, 0x36c5, 0x694c, 0xa184, 0xa000, 0x0040, 0x36b5,
- 0xd1ec, 0x0040, 0x36ae, 0xd1fc, 0x0040, 0x36aa, 0x1078, 0x38fc,
- 0x0078, 0x36b1, 0x1078, 0x38fc, 0x0078, 0x36b5, 0xd1fc, 0x0040,
- 0x36b5, 0x1078, 0x375c, 0x0078, 0x36c5, 0x6050, 0xa00d, 0x0040,
- 0x36c0, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x36c5,
- 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078, 0x491a, 0xa006,
- 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x36fb,
- 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x36fb, 0xa082, 0x0006,
- 0x0048, 0x3679, 0x2009, 0x770c, 0x210c, 0xd18c, 0x0040, 0x36e4,
- 0x2001, 0x0004, 0x0078, 0x36ed, 0xd184, 0x0040, 0x36eb, 0x2001,
- 0x0004, 0x0078, 0x36ed, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x36fb, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x36fb, 0x2001,
- 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0x6e48,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x3741, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x00ff, 0x00c8, 0x3731, 0xa188, 0x7820, 0x2104,
- 0xa065, 0x0040, 0x3731, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
- 0x00c0, 0x3737, 0x684c, 0xd0ec, 0x0040, 0x3724, 0x1078, 0x38fc,
- 0x1078, 0x375c, 0x0078, 0x372c, 0x1078, 0x375c, 0x684c, 0xd0fc,
- 0x0040, 0x372c, 0x1078, 0x38eb, 0x1078, 0x3944, 0xa006, 0x0078,
- 0x3745, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x3745, 0xa082,
- 0x0006, 0x0048, 0x371a, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x3745, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x3755, 0x2d00, 0x200a,
- 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
- 0x6803, 0x0000, 0x0078, 0x3753, 0x127e, 0x2091, 0x8000, 0x604c,
- 0xa005, 0x0040, 0x3768, 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c,
- 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x3766, 0x127e,
- 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x377d, 0x6800, 0xa005,
- 0x00c0, 0x377b, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c, 0x604c,
- 0xa06d, 0x0040, 0x378a, 0x6800, 0xa005, 0x00c0, 0x3788, 0x6052,
- 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040,
- 0x3795, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082,
- 0x0078, 0x3794, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218,
- 0x2260, 0x6200, 0xa005, 0x0040, 0x37a8, 0xc285, 0x0078, 0x37a9,
- 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e,
- 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00, 0xa215,
- 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000,
- 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206,
- 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x00ff, 0x0048, 0x37d4,
- 0xa085, 0x0001, 0x0078, 0x37ec, 0xa190, 0x7820, 0x2204, 0xa065,
- 0x00c0, 0x37eb, 0x017e, 0x0d7e, 0x1078, 0x1314, 0x2d60, 0x0d7f,
- 0x017f, 0x0040, 0x37d0, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab,
- 0x0000, 0x1078, 0x35f9, 0xa006, 0x027f, 0x007c, 0x027e, 0xa182,
- 0x00ff, 0x0048, 0x37f7, 0xa085, 0x0001, 0x0078, 0x3804, 0x0d7e,
- 0xa190, 0x7820, 0x2204, 0xa06d, 0x0040, 0x3802, 0x2013, 0x0000,
- 0x1078, 0x1348, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e, 0xa182,
- 0x00ff, 0x0048, 0x380f, 0xa085, 0x0001, 0x0078, 0x3816, 0xa188,
- 0x7820, 0x2104, 0xa065, 0x0040, 0x380b, 0xa006, 0x017f, 0x007c,
- 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f, 0x0000,
- 0x6000, 0xc08c, 0x6002, 0x2069, 0x7c8e, 0x6808, 0x605e, 0x6810,
- 0x6062, 0x6138, 0xa10a, 0x0048, 0x382e, 0x603a, 0x6814, 0x6066,
- 0x2099, 0x7c96, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3,
- 0x2099, 0x7c9a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3,
- 0x2069, 0x7cae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072,
- 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x3852, 0x2009, 0x0008,
- 0x0078, 0x387c, 0xa182, 0x0259, 0x00c8, 0x385a, 0x2009, 0x0007,
- 0x0078, 0x387c, 0xa182, 0x02c1, 0x00c8, 0x3862, 0x2009, 0x0006,
- 0x0078, 0x387c, 0xa182, 0x0349, 0x00c8, 0x386a, 0x2009, 0x0005,
- 0x0078, 0x387c, 0xa182, 0x0421, 0x00c8, 0x3872, 0x2009, 0x0004,
- 0x0078, 0x387c, 0xa182, 0x0581, 0x00c8, 0x387a, 0x2009, 0x0003,
- 0x0078, 0x387c, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f,
- 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x7c8d, 0x2e04, 0x6896, 0x2071,
- 0x7c8e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x0d7e,
- 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x38b3, 0x6900,
- 0x81ff, 0x00c0, 0x38c7, 0x6a04, 0xa282, 0x0010, 0x00c8, 0x38cc,
- 0xad88, 0x0004, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0040,
- 0x38ae, 0x8108, 0x00f0, 0x38a4, 0x1078, 0x12d5, 0x260a, 0x8210,
- 0x6a06, 0x0078, 0x38c7, 0x1078, 0x1314, 0x0040, 0x38cc, 0x2d00,
- 0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b,
- 0xffff, 0x8108, 0x00f0, 0x38bf, 0x6807, 0x0001, 0x6e12, 0xa085,
- 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x38c9, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3a0f, 0x00c0, 0x38e9, 0x200b, 0xffff,
- 0x0d7e, 0x60a4, 0x2068, 0x6804, 0xa08a, 0x0002, 0x0048, 0x38e4,
- 0x8001, 0x6806, 0x0078, 0x38e8, 0x1078, 0x1348, 0x60a7, 0x0000,
- 0x0d7f, 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a7b,
- 0x0078, 0x38f4, 0x1078, 0x3747, 0x1078, 0x3988, 0x00c0, 0x38f2,
- 0x1078, 0x3944, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x60a8, 0xa06d, 0x0040, 0x3920, 0x6950, 0x81ff, 0x00c0, 0x3934,
- 0x6a54, 0xa282, 0x0010, 0x00c8, 0x3941, 0xad88, 0x0018, 0x20a9,
- 0x0010, 0x2104, 0xa086, 0xffff, 0x0040, 0x391b, 0x8108, 0x00f0,
- 0x3911, 0x1078, 0x12d5, 0x260a, 0x8210, 0x6a56, 0x0078, 0x3934,
- 0x1078, 0x1314, 0x0040, 0x3941, 0x2d00, 0x60aa, 0x6853, 0x0000,
- 0xad88, 0x0018, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0,
- 0x392c, 0x6857, 0x0001, 0x6e62, 0x0078, 0x3938, 0x1078, 0x378b,
- 0x1078, 0x394e, 0x00c0, 0x3936, 0xa085, 0x0001, 0x127f, 0x0d7f,
- 0x007c, 0xa006, 0x0078, 0x393e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x491a, 0x127f, 0x007c, 0xa01e, 0x0078, 0x3950, 0x2019, 0x0001,
- 0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc,
- 0x00c0, 0x396e, 0x8dff, 0x0040, 0x3983, 0x83ff, 0x0040, 0x3966,
- 0x6848, 0xa606, 0x0040, 0x3973, 0x0078, 0x396e, 0x683c, 0xa406,
- 0x00c0, 0x396e, 0x6840, 0xa506, 0x0040, 0x3973, 0x2d08, 0x6800,
- 0x2068, 0x0078, 0x395a, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x397b,
- 0x624e, 0x0078, 0x397e, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0,
- 0x3983, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x398a,
- 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x39b6,
- 0x83ff, 0x0040, 0x3999, 0x6848, 0xa606, 0x0040, 0x39a6, 0x0078,
- 0x39a1, 0x683c, 0xa406, 0x00c0, 0x39a1, 0x6840, 0xa506, 0x0040,
- 0x39a6, 0x2d08, 0x6800, 0x2068, 0x0078, 0x398d, 0x6a00, 0x6080,
- 0xad06, 0x00c0, 0x39ae, 0x6282, 0x0078, 0x39b1, 0xa180, 0x0000,
- 0x2202, 0x82ff, 0x00c0, 0x39b6, 0x6186, 0x8dff, 0x007c, 0x1078,
- 0x3a0f, 0x00c0, 0x39bd, 0x2011, 0x0001, 0x1078, 0x3a5f, 0x00c0,
- 0x39c3, 0xa295, 0x0002, 0x007c, 0x1078, 0x3a97, 0x0040, 0x39cc,
- 0x1078, 0x6ae1, 0x0078, 0x39ce, 0xa085, 0x0001, 0x007c, 0x1078,
- 0x3a97, 0x0040, 0x39d7, 0x1078, 0x6a70, 0x0078, 0x39d9, 0xa085,
- 0x0001, 0x007c, 0x1078, 0x3a97, 0x0040, 0x39e2, 0x1078, 0x6ab6,
- 0x0078, 0x39e4, 0xa085, 0x0001, 0x007c, 0x1078, 0x3a97, 0x0040,
- 0x39ed, 0x1078, 0x6a8c, 0x0078, 0x39ef, 0xa085, 0x0001, 0x007c,
- 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040,
- 0x3a07, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x007f, 0x0078, 0x39f6, 0x6083,
- 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x60a4,
- 0xa00d, 0x00c0, 0x3a16, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2170,
- 0x7000, 0xa005, 0x00c0, 0x3a29, 0x20a9, 0x0010, 0xae88, 0x0004,
- 0x2104, 0xa606, 0x0040, 0x3a29, 0x8108, 0x00f0, 0x3a20, 0xa085,
- 0x0001, 0x0e7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4,
- 0xa06d, 0x00c0, 0x3a39, 0x1078, 0x1314, 0x0040, 0x3a4b, 0x2d00,
- 0x60a6, 0x6803, 0x0001, 0x6807, 0x0000, 0xad88, 0x0004, 0x20a9,
- 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x3a41, 0xa085, 0x0001,
- 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x3a48, 0x0d7e, 0x127e,
- 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x3a5c, 0x60a7, 0x0000,
- 0x1078, 0x1348, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0x60a8,
- 0xa00d, 0x00c0, 0x3a66, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2170,
- 0x7050, 0xa005, 0x00c0, 0x3a79, 0x20a9, 0x0010, 0xae88, 0x0018,
- 0x2104, 0xa606, 0x0040, 0x3a79, 0x8108, 0x00f0, 0x3a70, 0xa085,
- 0x0001, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a5f,
- 0x00c0, 0x3a95, 0x200b, 0xffff, 0x0d7e, 0x60a8, 0x2068, 0x6854,
- 0xa08a, 0x0002, 0x0048, 0x3a90, 0x8001, 0x6856, 0x0078, 0x3a94,
- 0x1078, 0x1348, 0x60ab, 0x0000, 0x0d7f, 0x127f, 0x007c, 0x609c,
- 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x7751, 0x7804, 0xd0a4, 0x0040,
- 0x3ac3, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x3806, 0x00c0, 0x3ab7, 0x6004, 0xa084, 0xff00, 0x8007,
- 0xa086, 0x0006, 0x00c0, 0x3ab7, 0x6000, 0xc0ed, 0x6002, 0x017f,
- 0x8108, 0x00f0, 0x3aa7, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
- 0x3ac5, 0x1078, 0x46d3, 0x0f7f, 0x007c, 0x2011, 0x3ac5, 0x1078,
- 0x4643, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x3806, 0x00c0, 0x3af1, 0x6000, 0xd0ec, 0x0040, 0x3af1,
- 0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
- 0x1078, 0x75f7, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
- 0x1078, 0x4a38, 0x1078, 0x497b, 0x2009, 0x0000, 0x1078, 0x7431,
- 0x047f, 0x017f, 0x8108, 0x00f0, 0x3acf, 0x0c7f, 0x157f, 0x007c,
- 0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
- 0x2071, 0x77ff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
- 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
- 0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x77ff, 0x684c, 0xa005, 0x00c0, 0x3b27,
- 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x3b4a, 0x6a60,
- 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
- 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
- 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
- 0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
- 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
- 0x3b9d, 0x6804, 0xa00d, 0x0040, 0x3b6b, 0x0d7e, 0x0e7e, 0x2071,
- 0x7700, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
- 0x2d00, 0x81ff, 0x00c0, 0x3b5c, 0x702e, 0x70a0, 0xa200, 0x70a2,
- 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x77ff, 0x701c, 0xa005, 0x00c0,
- 0x3bae, 0x0068, 0x3bac, 0x2071, 0x7751, 0x7004, 0xd09c, 0x0040,
- 0x3bac, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3bbf, 0x6948, 0x6844,
- 0xa105, 0x00c0, 0x3b9f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
- 0xd084, 0x00c0, 0x3bac, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
- 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x7700, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844,
- 0xa086, 0x0100, 0x00c0, 0x3bac, 0x6868, 0xa005, 0x00c0, 0x3bac,
- 0x2009, 0x8020, 0x0078, 0x3b85, 0x2071, 0x77ff, 0x2d08, 0x206b,
- 0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
- 0x3bbc, 0x6902, 0x0078, 0x3bbd, 0x711e, 0x0078, 0x3b9d, 0xa18c,
- 0x00ff, 0xa186, 0x0017, 0x0040, 0x3bcd, 0xa186, 0x001e, 0x0040,
- 0x3bcd, 0xa18e, 0x001f, 0x00c0, 0x3bac, 0x684c, 0xd0cc, 0x0040,
- 0x3bac, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3bac,
- 0x2009, 0x8021, 0x0078, 0x3b85, 0x007e, 0x6837, 0x0103, 0x20a9,
- 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
- 0x684a, 0x6952, 0x007c, 0x2071, 0x77ff, 0x7004, 0x0079, 0x3bf0,
- 0x3bf8, 0x3c07, 0x3c97, 0x3c98, 0x3ca8, 0x3cae, 0x3bf9, 0x3c85,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3c06, 0x2009, 0x000d,
- 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
- 0xa06d, 0x0040, 0x3c84, 0x0e7e, 0x2071, 0x7751, 0x7004, 0xd09c,
- 0x0040, 0x3c66, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3c3c, 0x6948,
- 0x6844, 0xa105, 0x00c0, 0x3c59, 0x2009, 0x8020, 0x127e, 0x2091,
- 0x8000, 0x0068, 0x3c38, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
- 0x3c38, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3ce1, 0x0078, 0x3c84,
- 0x127f, 0x0e7f, 0x0078, 0x3c84, 0xa18c, 0x00ff, 0xa186, 0x0017,
- 0x0040, 0x3c4a, 0xa186, 0x001e, 0x0040, 0x3c4a, 0xa18e, 0x001f,
- 0x00c0, 0x3c66, 0x684c, 0xd0cc, 0x0040, 0x3c66, 0x6850, 0xa084,
- 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3c66, 0x2009, 0x8021, 0x0078,
- 0x3c1e, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3c66, 0x6868, 0xa005,
- 0x00c0, 0x3c66, 0x2009, 0x8020, 0x0078, 0x3c1e, 0x0e7f, 0x1078,
- 0x3cf5, 0x0040, 0x3c84, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
- 0xa086, 0x0003, 0x00c0, 0x3c7b, 0x810f, 0xa18c, 0x00ff, 0x8101,
- 0x0040, 0x3c7b, 0x710e, 0x7007, 0x0003, 0x1078, 0x3d15, 0x7050,
- 0xa086, 0x0100, 0x0040, 0x3c98, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x3c96, 0x1078, 0x3cf5, 0x0040, 0x3c96, 0x7007, 0x0003, 0x1078,
- 0x3d15, 0x7050, 0xa086, 0x0100, 0x0040, 0x3c98, 0x007c, 0x007c,
- 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3ca1, 0x7007, 0x0004, 0x0078,
- 0x3ca8, 0xa086, 0x0200, 0x00c0, 0x3ca7, 0x7007, 0x0005, 0x007c,
- 0x1078, 0x3caf, 0x7006, 0x1078, 0x3ce1, 0x007c, 0x007c, 0x702c,
- 0x7130, 0x8108, 0xa102, 0x0048, 0x3cbc, 0xa00e, 0x7034, 0x706e,
- 0x7038, 0x7072, 0x0078, 0x3cc6, 0x706c, 0xa080, 0x0040, 0x706e,
- 0x00c8, 0x3cc6, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x3cda, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x3cdd, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
- 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x3cf4, 0x127e, 0x2091, 0x8000,
- 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3cf1,
- 0x701a, 0x127f, 0x1078, 0x1348, 0x007c, 0x2019, 0x000d, 0x2304,
- 0x230c, 0xa10e, 0x0040, 0x3d04, 0x2304, 0x230c, 0xa10e, 0x0040,
- 0x3d04, 0xa006, 0x0078, 0x3d14, 0x732c, 0x8319, 0x7130, 0xa102,
- 0x00c0, 0x3d0e, 0x2300, 0xa005, 0x0078, 0x3d14, 0x0048, 0x3d13,
- 0xa302, 0x0078, 0x3d14, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
- 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x7959, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x2071, 0x77cd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
- 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
- 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
- 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x77cd, 0x6848, 0xa005,
- 0x00c0, 0x3d51, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
- 0x3d76, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
- 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
- 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
- 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
- 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
- 0x2b78, 0x2071, 0x77cd, 0x7004, 0x1079, 0x3dd6, 0x700c, 0x0079,
- 0x3d81, 0x3d86, 0x3d7b, 0x3d7b, 0x3d7b, 0x3d7b, 0x007c, 0x700c,
- 0x0079, 0x3d8a, 0x3d8f, 0x3dd4, 0x3dd4, 0x3dd5, 0x3dd5, 0x7830,
- 0x7930, 0xa106, 0x0040, 0x3d99, 0x7830, 0x7930, 0xa106, 0x00c0,
- 0x3dbf, 0x7030, 0xa10a, 0x0040, 0x3dbf, 0x00c8, 0x3da1, 0x712c,
- 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3dc0, 0x1078, 0x1314, 0x0040,
- 0x3dbf, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
- 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x7959, 0x2104,
- 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x1078, 0x1314, 0x0040, 0x3dbf, 0x2d00, 0x705a, 0x1078, 0x1314,
- 0x00c0, 0x3dcc, 0x0078, 0x3dab, 0x2d00, 0x7086, 0x7063, 0x0080,
- 0x2001, 0x0004, 0x0078, 0x3daf, 0x007c, 0x007c, 0x3de7, 0x3de8,
- 0x3e1f, 0x3e20, 0x3dd4, 0x3e56, 0x3e5b, 0x3e92, 0x3e93, 0x3eae,
- 0x3eaf, 0x3eb0, 0x3eb1, 0x3eb2, 0x3eb3, 0x3f1c, 0x3f46, 0x007c,
- 0x700c, 0x0079, 0x3deb, 0x3df0, 0x3df3, 0x3e03, 0x3e1e, 0x3e1e,
- 0x1078, 0x3d87, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
- 0x1078, 0x4228, 0x0040, 0x3e00, 0x2091, 0x8000, 0x1078, 0x3d87,
- 0x0d7f, 0x0078, 0x3e0c, 0x127e, 0x8001, 0x700e, 0x1078, 0x4228,
- 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
- 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3e1b, 0x1079,
- 0x3e36, 0x127f, 0x007c, 0x127f, 0x1078, 0x3eb4, 0x007c, 0x007c,
- 0x007c, 0x0e7e, 0x2071, 0x77cd, 0x700c, 0x0079, 0x3e27, 0x3e2c,
- 0x3e2c, 0x3e2c, 0x3e2e, 0x3e32, 0x0e7f, 0x007c, 0x700f, 0x0001,
- 0x0078, 0x3e34, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3eb4, 0x3eb4,
- 0x3ed0, 0x3eb4, 0x3fbb, 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4,
- 0x3ed0, 0x3ffa, 0x4044, 0x409d, 0x40b1, 0x3eb4, 0x3eb4, 0x3eec,
- 0x3ed0, 0x3eb4, 0x3eb4, 0x3f02, 0x413c, 0x415a, 0x3eb4, 0x3eec,
- 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4, 0x3f02, 0x415a, 0x7020, 0x2068,
- 0x1078, 0x1348, 0x007c, 0x700c, 0x0079, 0x3e5e, 0x3e63, 0x3e66,
- 0x3e76, 0x3e91, 0x3e91, 0x1078, 0x3d87, 0x007c, 0x127e, 0x8001,
- 0x700e, 0x7058, 0x007e, 0x1078, 0x4228, 0x0040, 0x3e73, 0x2091,
- 0x8000, 0x1078, 0x3d87, 0x0d7f, 0x0078, 0x3e7f, 0x127e, 0x8001,
- 0x700e, 0x1078, 0x4228, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
- 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
- 0x00c8, 0x3e8e, 0x1079, 0x3e94, 0x127f, 0x007c, 0x127f, 0x1078,
- 0x3eb4, 0x007c, 0x007c, 0x007c, 0x3eb4, 0x3ed0, 0x3fa5, 0x3eb4,
- 0x3ed0, 0x3eb4, 0x3ed0, 0x3ed0, 0x3eb4, 0x3ed0, 0x3fa5, 0x3ed0,
- 0x3ed0, 0x3ed0, 0x3ed0, 0x3ed0, 0x3eb4, 0x3ed0, 0x3fa5, 0x3eb4,
- 0x3eb4, 0x3ed0, 0x3eb4, 0x3eb4, 0x3eb4, 0x3ed0, 0x007c, 0x007c,
- 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3b4c,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3b4c, 0x127f, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3b4c, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3b4c, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3ec2, 0x8001, 0x00c0, 0x3ef9, 0x7007, 0x0001, 0x0078,
- 0x3f82, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
- 0x3f82, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
- 0x0024, 0x2098, 0x20a1, 0x77f8, 0x53a3, 0x6858, 0x7012, 0xa082,
- 0x0401, 0x00c8, 0x3ede, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3ede,
- 0xa080, 0x3f73, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3f66,
- 0x1078, 0x1314, 0x00c0, 0x3f27, 0x7007, 0x000f, 0x007c, 0x2d00,
- 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
- 0x6008, 0xa20a, 0x00c8, 0x3f36, 0xa00e, 0x2200, 0x7112, 0x620c,
- 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3f3f, 0xa108, 0x719a,
- 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x137f, 0x7090, 0xa08e,
- 0x0100, 0x0040, 0x3f5a, 0xa086, 0x0200, 0x0040, 0x3f52, 0x7007,
- 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x1348, 0x7014, 0x2068,
- 0x0078, 0x3ede, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
- 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3f1c, 0x7014, 0x2068,
- 0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
- 0x4177, 0x0078, 0x3f82, 0x3f76, 0x3f7a, 0x3f7e, 0x0002, 0x0011,
- 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
- 0x0005, 0x0006, 0x2009, 0x772c, 0x210c, 0x81ff, 0x00c0, 0x3f9f,
- 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3653,
- 0x00c0, 0x3f93, 0x007c, 0x1078, 0x3bdc, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x127f, 0x0078, 0x3f92, 0x2001,
- 0x0028, 0x2009, 0x0000, 0x0078, 0x3f93, 0x7018, 0x6802, 0x2d08,
- 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3fb4,
- 0x7007, 0x0006, 0x0078, 0x3fba, 0x7014, 0x2068, 0x7007, 0x0001,
- 0x7048, 0x107a, 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001,
- 0x0040, 0x3fe4, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
- 0x0040, 0x3fe4, 0xa005, 0x00c0, 0x3ff7, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x1078, 0x3806, 0x00c0, 0x3ff7, 0x067e, 0x6e50, 0x1078,
- 0x38cf, 0x067f, 0x0078, 0x3ff7, 0x047e, 0x2011, 0x770c, 0x2224,
- 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3806, 0x00c0,
- 0x3ff3, 0x1078, 0x3a4e, 0x8108, 0x00f0, 0x3fed, 0x0c7f, 0x1078,
- 0x1348, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001,
- 0x7752, 0x2004, 0xd0a4, 0x0040, 0x403b, 0x2009, 0x0000, 0x1078,
- 0x4244, 0x6100, 0xd184, 0x0040, 0x4020, 0x6858, 0xa084, 0x00ff,
- 0x00c0, 0x403e, 0x6000, 0xd084, 0x0040, 0x403b, 0x6004, 0xa005,
- 0x00c0, 0x4041, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078, 0x4038,
- 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x4028, 0x2001, 0x001e,
- 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x403b, 0x6006,
- 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x403b, 0x600a, 0x6202,
- 0x127f, 0x0078, 0x4217, 0x127f, 0x0078, 0x420f, 0x127f, 0x0078,
- 0x4207, 0x127f, 0x0078, 0x420b, 0x127e, 0x2091, 0x8000, 0x7007,
- 0x0001, 0x2001, 0x7752, 0x2004, 0xd0a4, 0x0040, 0x409a, 0x2009,
- 0x0000, 0x1078, 0x4244, 0x6000, 0xa084, 0x0001, 0x0040, 0x409a,
- 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x4072, 0x6958,
- 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x406b, 0x2100, 0xa210, 0x0048,
- 0x4097, 0x0078, 0x4072, 0x8001, 0x00c0, 0x4097, 0x2100, 0xa212,
- 0x0048, 0x4097, 0xa484, 0x000c, 0x0040, 0x408c, 0x6958, 0x810f,
- 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x4084, 0x2100, 0xa318,
- 0x0048, 0x4097, 0x0078, 0x408c, 0xa082, 0x0004, 0x00c0, 0x4097,
- 0x2100, 0xa31a, 0x0048, 0x4097, 0x6860, 0xa005, 0x0040, 0x4092,
- 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x4217, 0x127f,
- 0x0078, 0x4213, 0x127f, 0x0078, 0x420f, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x2009, 0x0000, 0x1078, 0x4244, 0x6308, 0x8318,
- 0x0048, 0x40ae, 0x630a, 0x127f, 0x0078, 0x4225, 0x127f, 0x0078,
- 0x4213, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c,
- 0xd0ac, 0x0040, 0x40c7, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x46e1,
- 0x6000, 0x2001, 0xfcff, 0x6002, 0x0c7f, 0x0078, 0x40fe, 0x6858,
- 0xa005, 0x0040, 0x4113, 0x685c, 0xa065, 0x0040, 0x410f, 0x2001,
- 0x772c, 0x2004, 0xa005, 0x0040, 0x40d9, 0x1078, 0x6b6c, 0x0078,
- 0x40df, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x5cfb, 0x6958,
- 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x40f6, 0xa186, 0x0400,
- 0x0040, 0x40f6, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x46e1, 0x6000,
- 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x40fe, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfdff, 0x1078, 0x478a, 0x027f, 0x684c, 0xd0c4,
- 0x0040, 0x410b, 0x2009, 0x0000, 0x1078, 0x46e1, 0x6008, 0x8000,
- 0x0048, 0x410b, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x4217, 0x0c7f,
- 0x127f, 0x0078, 0x420f, 0x6954, 0xa186, 0x002a, 0x00c0, 0x411f,
- 0x2001, 0x770c, 0x200c, 0xc194, 0x2102, 0x0078, 0x40fe, 0xa186,
- 0x0020, 0x0040, 0x4134, 0xa186, 0x0029, 0x00c0, 0x410f, 0x6944,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x3806, 0x00c0, 0x40fe, 0x6000,
- 0xc0e4, 0x6002, 0x0078, 0x40fe, 0x685c, 0xa065, 0x0040, 0x410f,
- 0x6017, 0x0014, 0x0078, 0x40fe, 0x2009, 0x0000, 0x1078, 0x4244,
- 0x6000, 0xa084, 0x0001, 0x0040, 0x4156, 0x2091, 0x8000, 0x6204,
- 0x8210, 0x0048, 0x4150, 0x6206, 0x2091, 0x8001, 0x0078, 0x4225,
- 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x421e, 0x6853, 0x0007,
- 0x0078, 0x421e, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x4164,
- 0x1078, 0x3ec2, 0x0078, 0x4176, 0x2030, 0x8001, 0x00c0, 0x416e,
- 0x7007, 0x0001, 0x1078, 0x4177, 0x0078, 0x4176, 0x7007, 0x0006,
- 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x4177, 0x007c, 0x0e7e,
- 0x2009, 0x772c, 0x210c, 0x81ff, 0x00c0, 0x41f9, 0x2009, 0x770c,
- 0x210c, 0xd194, 0x00c0, 0x4203, 0x6848, 0x2070, 0xae82, 0x7e00,
- 0x0048, 0x41e8, 0x2001, 0x7715, 0x2004, 0xae02, 0x00c8, 0x41e8,
- 0x2009, 0x0000, 0x1078, 0x4244, 0x6100, 0xa184, 0x0001, 0x0040,
- 0x41ce, 0xa184, 0x0100, 0x00c0, 0x41ec, 0xa184, 0x0200, 0x00c0,
- 0x41f0, 0x601c, 0xa005, 0x00c0, 0x41f4, 0x711c, 0xa186, 0x0006,
- 0x00c0, 0x41d3, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x127e,
- 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x41c5, 0x7112, 0x7018,
- 0xa065, 0x0040, 0x41f8, 0x6000, 0xd0e4, 0x00c0, 0x41fd, 0x2e60,
- 0x1078, 0x46ea, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005,
- 0x00c0, 0x41c5, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853,
- 0x0006, 0x0078, 0x421e, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x3806, 0x00c0, 0x41fe, 0x6000, 0xd0e4, 0x00c0, 0x41fe, 0x711c,
- 0xa186, 0x0007, 0x00c0, 0x41e8, 0x6853, 0x0002, 0x0078, 0x4200,
- 0x6853, 0x0008, 0x0078, 0x4200, 0x6853, 0x000e, 0x0078, 0x4200,
- 0x6853, 0x0017, 0x0078, 0x4200, 0x6853, 0x0035, 0x0078, 0x4200,
- 0x127f, 0x6853, 0x0028, 0x0078, 0x4200, 0x127f, 0x6853, 0x0029,
- 0x0e7f, 0x0078, 0x421e, 0x6853, 0x002a, 0x0078, 0x4200, 0x2009,
- 0x003e, 0x0078, 0x4219, 0x2009, 0x0004, 0x0078, 0x4219, 0x2009,
- 0x0006, 0x0078, 0x4219, 0x2009, 0x0016, 0x0078, 0x4219, 0x2009,
- 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091, 0x8000,
- 0x1078, 0x3b4c, 0x2091, 0x8001, 0x007c, 0x1078, 0x1348, 0x007c,
- 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x4235, 0xa00e, 0x7034,
- 0x7072, 0x7038, 0x7076, 0x0078, 0x4241, 0x7070, 0xa080, 0x0040,
- 0x7072, 0x00c8, 0x4241, 0x7074, 0xa081, 0x0000, 0x7076, 0xa085,
- 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x46e1, 0x0d7f,
- 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002, 0x2012,
- 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00,
- 0xa084, 0x7000, 0x0040, 0x4260, 0xa086, 0x1000, 0x00c0, 0x427c,
- 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x4267, 0x3e60, 0xac84,
- 0x0007, 0x00c0, 0x427c, 0xac82, 0x7e00, 0x0048, 0x427c, 0x6854,
- 0xac02, 0x00c8, 0x427c, 0x2009, 0x0047, 0x1078, 0x5cfb, 0x7a1c,
- 0xd284, 0x00c0, 0x4252, 0x007c, 0xa016, 0x1078, 0x1572, 0x0078,
- 0x4277, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28,
- 0xa584, 0x0070, 0x00c0, 0x42aa, 0xa484, 0x7000, 0xa086, 0x1000,
- 0x00c0, 0x42aa, 0x1078, 0x42b7, 0x0040, 0x42aa, 0x20e1, 0x3000,
- 0x7828, 0x7828, 0x1078, 0x42d5, 0x147f, 0x137f, 0x157f, 0x2009,
- 0x793e, 0x2104, 0xa005, 0x00c0, 0x42a6, 0x007c, 0x1078, 0x4d50,
- 0x0078, 0x42a5, 0x1078, 0x762a, 0x1078, 0x42b7, 0x20e1, 0x3000,
- 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x42a5, 0xa484,
- 0x01ff, 0x687a, 0xa005, 0x0040, 0x42c9, 0xa080, 0x001f, 0xa084,
- 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
- 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
- 0x53a5, 0xa085, 0x0001, 0x0078, 0x42c8, 0x7000, 0xa084, 0xff00,
- 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x42e2, 0x0078,
- 0x4456, 0x007c, 0xa196, 0x2000, 0x00c0, 0x42f3, 0x6900, 0xa18e,
- 0x0001, 0x00c0, 0x42ef, 0x1078, 0x2e88, 0x0078, 0x42e1, 0x1078,
- 0x42fb, 0x0078, 0x42e1, 0xa196, 0x8000, 0x00c0, 0x42e1, 0x1078,
- 0x44dc, 0x0078, 0x42e1, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f,
- 0xa196, 0x0001, 0x0040, 0x4308, 0xa196, 0x0023, 0x00c0, 0x43fd,
- 0xa08e, 0x0023, 0x00c0, 0x4339, 0x1078, 0x4553, 0x0040, 0x43fd,
- 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x4321, 0x7034,
- 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0015, 0x1078, 0x5cfb, 0x0078,
- 0x43fd, 0xa08e, 0x0210, 0x00c0, 0x432b, 0x2009, 0x0015, 0x1078,
- 0x5cfb, 0x0078, 0x43fd, 0xa08e, 0x0100, 0x00c0, 0x43fd, 0x7034,
- 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0016, 0x1078, 0x5cfb, 0x0078,
- 0x43fd, 0xa08e, 0x0022, 0x00c0, 0x43fd, 0x7030, 0xa08e, 0x0300,
- 0x00c0, 0x434a, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0017,
- 0x0078, 0x43c9, 0xa08e, 0x0500, 0x00c0, 0x4356, 0x7034, 0xa005,
- 0x00c0, 0x43fd, 0x2009, 0x0018, 0x0078, 0x43c9, 0xa08e, 0x2010,
- 0x00c0, 0x435e, 0x2009, 0x0019, 0x0078, 0x43c9, 0xa08e, 0x2110,
- 0x00c0, 0x4366, 0x2009, 0x001a, 0x0078, 0x43c9, 0xa08e, 0x5200,
- 0x00c0, 0x4372, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x001b,
- 0x0078, 0x43c9, 0xa08e, 0x5000, 0x00c0, 0x437e, 0x7034, 0xa005,
- 0x00c0, 0x43fd, 0x2009, 0x001c, 0x0078, 0x43c9, 0xa08e, 0x1200,
- 0x00c0, 0x438a, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0024,
- 0x0078, 0x43c9, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0, 0x4394,
- 0x2009, 0x002d, 0x0078, 0x43c9, 0xa08c, 0xff00, 0xa18e, 0x5300,
- 0x00c0, 0x439e, 0x2009, 0x002a, 0x0078, 0x43c9, 0xa08e, 0x0f00,
- 0x00c0, 0x43a6, 0x2009, 0x0020, 0x0078, 0x43c9, 0xa08e, 0x5300,
- 0x00c0, 0x43ac, 0x0078, 0x43c7, 0xa08e, 0x6104, 0x00c0, 0x43c7,
- 0x2011, 0x7c8d, 0x8208, 0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac,
- 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, 0x2124, 0x1078, 0x2d20,
- 0x8108, 0x00f0, 0x43b9, 0x2009, 0x0023, 0x0078, 0x43c9, 0x2009,
- 0x001d, 0x017e, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c, 0x1078,
- 0x2059, 0x00c0, 0x43ff, 0x1078, 0x37cb, 0x00c0, 0x43ff, 0x6612,
- 0x6516, 0x86ff, 0x0040, 0x43ef, 0x017f, 0x017e, 0xa186, 0x0017,
- 0x00c0, 0x43ef, 0x6864, 0xa606, 0x00c0, 0x43ef, 0x6868, 0xa506,
- 0xa084, 0xff00, 0x00c0, 0x43ef, 0x6000, 0xc0f5, 0x6002, 0x0c7e,
- 0x1078, 0x5c6e, 0x0040, 0x4402, 0x017f, 0x611a, 0x601f, 0x0004,
- 0x7120, 0x610a, 0x017f, 0x1078, 0x5cfb, 0x0c7f, 0x007c, 0x017f,
- 0x0078, 0x43fd, 0x0c7f, 0x0078, 0x43ff, 0x0e7e, 0x0d7e, 0x2028,
- 0x2130, 0xa696, 0x00ff, 0x00c0, 0x4425, 0xa596, 0xfffd, 0x00c0,
- 0x4415, 0x2009, 0x007f, 0x0078, 0x4452, 0xa596, 0xfffe, 0x00c0,
- 0x441d, 0x2009, 0x007e, 0x0078, 0x4452, 0xa596, 0xfffc, 0x00c0,
- 0x4425, 0x2009, 0x0080, 0x0078, 0x4452, 0x2011, 0x0000, 0x2021,
- 0x007e, 0x20a9, 0x0082, 0x2071, 0x789e, 0x2e1c, 0x83ff, 0x00c0,
- 0x4437, 0x82ff, 0x00c0, 0x4446, 0x2410, 0x0078, 0x4446, 0x2368,
- 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f, 0x00c0, 0x4446, 0x6b14,
- 0xa31e, 0x00c0, 0x4446, 0x2408, 0x0078, 0x4452, 0x8420, 0x8e70,
- 0x00f0, 0x442d, 0x82ff, 0x00c0, 0x4451, 0xa085, 0x0001, 0x0078,
- 0x4453, 0x2208, 0xa006, 0x0d7f, 0x0e7f, 0x007c, 0xa084, 0x0007,
- 0x0079, 0x445b, 0x007c, 0x4463, 0x4463, 0x4463, 0x4463, 0x4463,
- 0x4464, 0x447d, 0x44c5, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x447c,
- 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x447c, 0xac8a, 0x7e00,
- 0x0048, 0x447c, 0x6854, 0xac02, 0x00c8, 0x447c, 0x7124, 0x610a,
- 0x2009, 0x0046, 0x1078, 0x5cfb, 0x007c, 0x0c7e, 0x7110, 0xd1bc,
- 0x00c0, 0x44c3, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c, 0x1078,
- 0x2059, 0x00c0, 0x44c3, 0x1078, 0x3806, 0x00c0, 0x44c3, 0x6204,
- 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x44a8, 0x0c7e,
- 0x1078, 0x5c6e, 0x017f, 0x0040, 0x44c3, 0x611a, 0x601f, 0x0006,
- 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x5cfb, 0x0078, 0x44c3,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x44c3, 0x611a, 0x601f,
- 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x44bb, 0x6007,
- 0x0005, 0x0078, 0x44bd, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
- 0x4948, 0x1078, 0x4d50, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x44db, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x44db, 0xac82,
- 0x7e00, 0x0048, 0x44db, 0x6854, 0xac02, 0x00c8, 0x44db, 0x2009,
- 0x0045, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f,
- 0xa18e, 0x0000, 0x00c0, 0x44ec, 0xa084, 0x000f, 0xa08a, 0x0006,
- 0x10c8, 0x12d5, 0x1079, 0x44ed, 0x007c, 0x44f3, 0x44f4, 0x44f3,
- 0x44f3, 0x4535, 0x4544, 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4534,
- 0x700c, 0x7108, 0x1078, 0x2059, 0x00c0, 0x4534, 0x1078, 0x37cb,
- 0x00c0, 0x4534, 0x6612, 0x6516, 0x6204, 0xa294, 0xff00, 0x8217,
- 0xa286, 0x0006, 0x00c0, 0x451d, 0x0c7e, 0x1078, 0x5c6e, 0x017f,
- 0x0040, 0x4534, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009,
- 0x0088, 0x1078, 0x5cfb, 0x0078, 0x4534, 0x0c7e, 0x1078, 0x5c6e,
- 0x017f, 0x0040, 0x4534, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
- 0xa286, 0x0004, 0x00c0, 0x4530, 0x2009, 0x0005, 0x0078, 0x4532,
- 0x2009, 0x0001, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x4543, 0x1078, 0x4553, 0x0040, 0x4543, 0x7124, 0x610a, 0x2009,
- 0x0089, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4552,
- 0x1078, 0x4553, 0x0040, 0x4552, 0x7124, 0x610a, 0x2009, 0x008a,
- 0x1078, 0x5cfb, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0,
- 0x4566, 0xac82, 0x7e00, 0x0048, 0x4566, 0x2001, 0x7715, 0x2004,
- 0xac02, 0x00c8, 0x4566, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078,
- 0x4565, 0x2071, 0x7949, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006,
- 0x701a, 0x7012, 0x7017, 0x7e00, 0x7007, 0x0000, 0x7026, 0x702b,
- 0x5663, 0x7032, 0x7037, 0x56a4, 0x703b, 0x0002, 0x703f, 0x0000,
- 0x007c, 0x2071, 0x7949, 0x00e0, 0x4630, 0x2091, 0x6000, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x45f9, 0x700f, 0x0361, 0x7007, 0x0001,
- 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x45f7,
- 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8,
- 0x45f7, 0x703c, 0xa086, 0x0001, 0x00c0, 0x45d4, 0x0d7e, 0x2069,
- 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x45b2, 0x6803, 0x1000,
- 0x0078, 0x45b9, 0x6804, 0xa084, 0x1000, 0x0040, 0x45b9, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x7936, 0x6804,
- 0xa082, 0x0006, 0x00c0, 0x45c6, 0x6807, 0x0000, 0x6830, 0xa082,
- 0x0003, 0x00c0, 0x45cd, 0x6833, 0x0000, 0x1078, 0x4d50, 0x1078,
- 0x4e10, 0x0d7f, 0x0078, 0x45f7, 0x0d7e, 0x2069, 0x7700, 0x6944,
- 0x6860, 0xa102, 0x00c8, 0x45f6, 0x2069, 0x7936, 0x6804, 0xa086,
- 0x0000, 0x00c0, 0x45f6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x45f6,
- 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100,
- 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078,
- 0x45fc, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x460d,
- 0x7020, 0x8001, 0x7022, 0x00c0, 0x460d, 0x7023, 0x0009, 0x8109,
- 0x7126, 0x00c0, 0x460d, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040,
- 0x461e, 0x702c, 0x8001, 0x702e, 0x00c0, 0x461e, 0x702f, 0x0009,
- 0x8109, 0x7132, 0x00c0, 0x461e, 0x7034, 0x107a, 0x7018, 0xa00d,
- 0x0040, 0x462f, 0x7008, 0x8001, 0x700a, 0x00c0, 0x462f, 0x700b,
- 0x0009, 0x8109, 0x711a, 0x00c0, 0x462f, 0x701c, 0x107a, 0x127f,
- 0x7004, 0x0079, 0x4633, 0x465a, 0x465b, 0x4677, 0x0e7e, 0x2071,
- 0x7949, 0x7018, 0xa005, 0x00c0, 0x4641, 0x711a, 0x721e, 0x700b,
- 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x7949, 0x701c,
- 0xa206, 0x00c0, 0x464d, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c,
- 0x0e7e, 0x2071, 0x7949, 0x6088, 0xa102, 0x0048, 0x4658, 0x618a,
- 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x3806, 0x00c0, 0x466d,
- 0x6088, 0x8001, 0x0048, 0x466d, 0x608a, 0x00c0, 0x466d, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x8108, 0xa182, 0x00ff,
- 0x0048, 0x4675, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014,
- 0x2060, 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x46a6,
- 0x8001, 0x6016, 0x00c0, 0x46a6, 0x611c, 0xa186, 0x0003, 0x0040,
- 0x468d, 0xa186, 0x0006, 0x00c0, 0x46a4, 0x6010, 0x2068, 0x6854,
- 0xa08a, 0x199a, 0x0048, 0x46a4, 0xa082, 0x1999, 0x6856, 0xa08a,
- 0x199a, 0x0048, 0x469d, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x6116, 0x0078, 0x46a6, 0x1078, 0x688e, 0x127f, 0xac88,
- 0x0008, 0x7116, 0x2001, 0x7716, 0x2004, 0xa102, 0x0048, 0x46b4,
- 0x7017, 0x7e00, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949,
- 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c,
- 0x2001, 0x7952, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949,
- 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x7955,
- 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949, 0x711a, 0x721e,
- 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x79da, 0x0c7f,
- 0x007c, 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x79da,
- 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x46f1, 0x2001,
- 0x1999, 0xa005, 0x00c0, 0x4701, 0x6944, 0x0c7e, 0x1078, 0x46e1,
- 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x4706, 0x2001, 0x001e, 0x0078,
- 0x4706, 0xa08e, 0xffff, 0x00c0, 0x4706, 0xa006, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0,
- 0x0040, 0x4741, 0xd0b4, 0x00c0, 0x471d, 0xd0bc, 0x00c0, 0x472f,
- 0x2009, 0x0006, 0x1078, 0x4764, 0x007c, 0xd0fc, 0x0040, 0x472a,
- 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x475d, 0xa08e, 0x0000,
- 0x00c0, 0x475d, 0x2009, 0x0043, 0x1078, 0x5cfb, 0x007c, 0xd0fc,
- 0x0040, 0x473c, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x475d,
- 0xa08e, 0x0000, 0x00c0, 0x475d, 0x2009, 0x0042, 0x1078, 0x5cfb,
- 0x007c, 0xd0fc, 0x0040, 0x4753, 0xa084, 0x0003, 0xa08e, 0x0003,
- 0x0040, 0x475d, 0xa08e, 0x0002, 0x0040, 0x4757, 0x2009, 0x0041,
- 0x1078, 0x5cfb, 0x007c, 0x1078, 0x4762, 0x0078, 0x4752, 0x2009,
- 0x0043, 0x1078, 0x5cfb, 0x0078, 0x4752, 0x2009, 0x0004, 0x1078,
- 0x4764, 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040,
- 0x4789, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
- 0x4783, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x4783,
- 0x0c7e, 0x2009, 0x0000, 0x1078, 0x46e1, 0x6204, 0x8210, 0x0048,
- 0x4782, 0x6206, 0x0c7f, 0x1078, 0x3b4c, 0x6010, 0xa06d, 0x10c0,
- 0x46ea, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x79da,
- 0x6000, 0x81ff, 0x0040, 0x4797, 0xa205, 0x0078, 0x4798, 0xa204,
- 0x6002, 0xace0, 0x0008, 0x00f0, 0x4790, 0x0c7f, 0x157f, 0x007c,
- 0x6808, 0xa005, 0x0040, 0x47a8, 0x8001, 0x680a, 0xa085, 0x0001,
- 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x7936, 0x127f, 0x0d7e,
- 0x2069, 0x7936, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085,
- 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804,
- 0xa084, 0x0007, 0x0079, 0x47c4, 0x47ce, 0x47f3, 0x484e, 0x47d4,
- 0x47f3, 0x47cc, 0x47cc, 0x47cc, 0x1078, 0x12d5, 0x1078, 0x46c0,
- 0x1078, 0x4d50, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x47da,
- 0x0c7f, 0x007c, 0x2011, 0x351a, 0x1078, 0x4643, 0x7828, 0xa092,
- 0x0002, 0x00c8, 0x47e9, 0x8000, 0x782a, 0x1078, 0x354a, 0x0078,
- 0x47d8, 0x1078, 0x351a, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
- 0x0000, 0x0078, 0x47d8, 0x1078, 0x46c0, 0x3c00, 0x007e, 0x2011,
- 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040,
- 0x4811, 0x62c0, 0x82ff, 0x00c0, 0x4811, 0x782b, 0x0000, 0x7824,
- 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, 0x1078, 0x5cfb, 0x0c7f,
- 0x007c, 0x3900, 0xa082, 0x7a7a, 0x00c8, 0x4818, 0x1078, 0x5bfe,
- 0x0c7e, 0x7824, 0xa065, 0x1040, 0x12d5, 0x7804, 0xa086, 0x0004,
- 0x0040, 0x4893, 0x7828, 0xa092, 0x2710, 0x00c8, 0x482e, 0x8000,
- 0x782a, 0x0c7f, 0x1078, 0x5648, 0x0078, 0x480f, 0x6104, 0xa186,
- 0x0003, 0x00c0, 0x4845, 0x0e7e, 0x2071, 0x7700, 0x70c8, 0x0e7f,
- 0xd08c, 0x0040, 0x4845, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
- 0x7700, 0x1078, 0x3553, 0x0e7f, 0x0c7f, 0x1078, 0x767d, 0x2009,
- 0x0014, 0x1078, 0x5cfb, 0x0c7f, 0x0078, 0x480f, 0x2001, 0x7952,
- 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x4862, 0x782b, 0x0000,
- 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, 0x1078, 0x5d49,
- 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082, 0x7a7a, 0x00c8,
- 0x486b, 0x1078, 0x5bfe, 0x7824, 0xa005, 0x1040, 0x12d5, 0x781c,
- 0xa06d, 0x1040, 0x12d5, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160,
- 0x1078, 0x5cd4, 0x693c, 0x81ff, 0x1040, 0x12d5, 0x8109, 0x693e,
- 0x6854, 0xa015, 0x0040, 0x4887, 0x7a1e, 0x0078, 0x4889, 0x7918,
- 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078,
- 0x4d50, 0x0078, 0x4860, 0x6104, 0xa186, 0x0002, 0x0040, 0x489e,
- 0xa186, 0x0004, 0x0040, 0x489e, 0x0078, 0x4822, 0x7808, 0xac06,
- 0x0040, 0x4822, 0x1078, 0x4c57, 0x1078, 0x4948, 0x0c7f, 0x1078,
- 0x4d50, 0x0078, 0x480f, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x7955,
- 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x48c5, 0x62c4, 0x82ff,
- 0x00c0, 0x48c5, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x48c3, 0x2009,
- 0x0049, 0x1078, 0x5cfb, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x7a7a,
- 0x00c8, 0x48cc, 0x1078, 0x5bfe, 0x6017, 0x0010, 0x793c, 0x81ff,
- 0x0040, 0x48c3, 0x7944, 0xa192, 0x7530, 0x00c8, 0x48eb, 0x8108,
- 0x7946, 0x1078, 0x46c5, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e,
- 0x0006, 0x00c0, 0x48e7, 0x6017, 0x0012, 0x0078, 0x48c3, 0x6017,
- 0x0016, 0x0078, 0x48c3, 0x037e, 0x2019, 0x0001, 0x1078, 0x583a,
- 0x037f, 0x1078, 0x767d, 0x793c, 0x2160, 0x2009, 0x004a, 0x1078,
- 0x5cfb, 0x0078, 0x48c3, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7936, 0x6020, 0x8000,
- 0x6022, 0x6010, 0xa005, 0x0040, 0x4916, 0xa080, 0x0003, 0x2102,
- 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116, 0x6112,
- 0x0078, 0x4911, 0x0d7e, 0x2069, 0x7936, 0x6000, 0xd0d4, 0x0040,
- 0x492f, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0, 0x492a,
- 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x4d58, 0xc0d5,
- 0x6002, 0x6818, 0xa005, 0x0040, 0x4941, 0x6056, 0x605b, 0x0000,
- 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x7936, 0x0078,
- 0x4921, 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x4921,
- 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000,
- 0x2c08, 0x2061, 0x7936, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005,
- 0x0040, 0x4963, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f,
- 0x017f, 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x495e, 0x0c7e,
- 0x600f, 0x0000, 0x2c08, 0x2061, 0x7936, 0x6034, 0xa005, 0x0040,
- 0x4977, 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a,
- 0x6136, 0x0078, 0x4975, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
- 0x027e, 0x007e, 0x127e, 0x2071, 0x7936, 0x7638, 0x2660, 0x2678,
- 0x2091, 0x8000, 0x8cff, 0x0040, 0x49dd, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x49d8, 0x703c, 0xac06, 0x00c0, 0x499d,
- 0x6003, 0x000a, 0x630a, 0x0078, 0x49d8, 0x7038, 0xac36, 0x00c0,
- 0x49a3, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x49b1, 0x2c00,
- 0xaf36, 0x0040, 0x49af, 0x2f00, 0x7036, 0x0078, 0x49b1, 0x7037,
- 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x49ba, 0x7e0e,
- 0x0078, 0x49bb, 0x2678, 0x600f, 0x0000, 0x1078, 0x6a03, 0x0040,
- 0x49d3, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x49e6,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078,
- 0x3b4c, 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x0c7f, 0x0078, 0x498a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x498a, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x49c8, 0x1078, 0x75b3, 0x0078, 0x49d3, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091,
- 0x8000, 0x2079, 0x7936, 0x7838, 0xa065, 0x0040, 0x4a26, 0x600c,
- 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4a0d, 0x6003,
- 0x000a, 0x630a, 0x2c30, 0x0078, 0x4a23, 0x1078, 0x6a03, 0x0040,
- 0x4a21, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4a2f,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x1078, 0x6b6c, 0x007f, 0x0078, 0x49fc, 0x7e3a, 0x7e36,
- 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4a18, 0x1078, 0x75b3, 0x0078, 0x4a21,
- 0x027e, 0x1078, 0x4a4c, 0x1078, 0x4ae5, 0x027f, 0x007c, 0x0f7e,
- 0x127e, 0x2079, 0x7936, 0x2091, 0x8000, 0x1078, 0x4b7c, 0x1078,
- 0x4be4, 0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7936, 0x7614,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x4ad4, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x4acf, 0x7024, 0xac06, 0x00c0, 0x4a92,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4a8d, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4a82, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4a8a,
- 0x6827, 0x0001, 0x037f, 0x0078, 0x4a92, 0x6003, 0x0009, 0x630a,
- 0x0078, 0x4acf, 0x7014, 0xac36, 0x00c0, 0x4a98, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x4aa6, 0x2c00, 0xaf36, 0x0040, 0x4aa4,
- 0x2f00, 0x7012, 0x0078, 0x4aa6, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x4aaf, 0x7e0e, 0x0078, 0x4ab0, 0x2678,
- 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x4ac8,
- 0x601c, 0xa086, 0x0003, 0x00c0, 0x4adc, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x1078, 0x6b5f,
- 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x4a5a, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x4a5a, 0x127f, 0x007f, 0x067f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0,
- 0x4abd, 0x1078, 0x75b3, 0x0078, 0x4ac8, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0xa280, 0x7820, 0x2004, 0xa065, 0x0040, 0x4b78,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x7936, 0x6654, 0x7018,
- 0xac06, 0x00c0, 0x4afc, 0x761a, 0x701c, 0xac06, 0x00c0, 0x4b08,
- 0x86ff, 0x00c0, 0x4b07, 0x7018, 0x701e, 0x0078, 0x4b08, 0x761e,
- 0x6058, 0xa07d, 0x0040, 0x4b0d, 0x7e56, 0xa6ed, 0x0000, 0x0040,
- 0x4b13, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
- 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x377f, 0x0040, 0x4b74, 0x7624,
- 0x86ff, 0x0040, 0x4b64, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
- 0x4b64, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4b5b,
- 0x1078, 0x5656, 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000,
- 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4b44,
- 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
- 0x0040, 0x4b4c, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
- 0xa005, 0x0040, 0x4b55, 0x8001, 0x603e, 0x2660, 0x1078, 0x6b6c,
- 0x0c7f, 0x0078, 0x4b64, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
- 0x630a, 0x0c7f, 0x0078, 0x4b1b, 0x8dff, 0x0040, 0x4b70, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078, 0x3b4c,
- 0x1078, 0x59d4, 0x0078, 0x4b1b, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
- 0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x4bd4, 0x600c, 0x007e,
- 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x4bb9, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x4bb3, 0x1078, 0x5656, 0x68c3, 0x0000,
- 0x1078, 0x5b04, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x4ba8, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4bb0, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x4bb9, 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078,
- 0x4bd1, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x4bcd, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x4bdb, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x1078,
- 0x59d4, 0x007f, 0x0078, 0x4b83, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4bc4,
- 0x1078, 0x75b3, 0x0078, 0x4bcd, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
- 0x7818, 0xa065, 0x0040, 0x4c50, 0x6054, 0x007e, 0x6057, 0x0000,
- 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x377f,
- 0x0040, 0x4c4d, 0x7e24, 0x86ff, 0x0040, 0x4c3f, 0xa680, 0x0004,
- 0x2004, 0xad06, 0x00c0, 0x4c3f, 0x0d7e, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x4c36, 0x1078, 0x5656, 0x68c3, 0x0000, 0x1078,
- 0x5b04, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x4c1f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x4c27, 0x6827, 0x0001, 0x037f,
- 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4c30, 0x8001, 0x603e,
- 0x2660, 0x1078, 0x6b6c, 0x0c7f, 0x0078, 0x4c3f, 0x0d7f, 0x0c7e,
- 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x4bf6, 0x8dff,
- 0x0040, 0x4c49, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
- 0x3b4c, 0x1078, 0x59d4, 0x0078, 0x4bf6, 0x007f, 0x0078, 0x4be9,
- 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e,
- 0x0c7e, 0x2071, 0x7936, 0x7004, 0xa084, 0x0007, 0x0079, 0x4c60,
- 0x4c6a, 0x4c6d, 0x4c86, 0x4ca2, 0x4ce7, 0x4c6a, 0x4c6a, 0x4c68,
- 0x1078, 0x12d5, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040,
- 0x4c7b, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040, 0x4c82,
- 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4c7b, 0x6018, 0x2060,
- 0x1078, 0x377f, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022,
- 0x0040, 0x4c97, 0x6054, 0xa015, 0x0040, 0x4c9e, 0x721e, 0x7007,
- 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e,
- 0x0078, 0x4c97, 0x7024, 0xa065, 0x0040, 0x4ce4, 0x700c, 0xac06,
- 0x00c0, 0x4cb9, 0x1078, 0x59d4, 0x600c, 0xa015, 0x0040, 0x4cb5,
- 0x720e, 0x600f, 0x0000, 0x0078, 0x4ce2, 0x720e, 0x720a, 0x0078,
- 0x4ce2, 0x7014, 0xac06, 0x00c0, 0x4ccc, 0x1078, 0x59d4, 0x600c,
- 0xa015, 0x0040, 0x4cc8, 0x7216, 0x600f, 0x0000, 0x0078, 0x4ce2,
- 0x7216, 0x7212, 0x0078, 0x4ce2, 0x6018, 0x2060, 0x1078, 0x377f,
- 0x6000, 0xc0dc, 0x6002, 0x1078, 0x59d4, 0x701c, 0xa065, 0x0040,
- 0x4ce2, 0x6054, 0xa015, 0x0040, 0x4ce0, 0x721e, 0x0078, 0x4ce2,
- 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024,
- 0xa065, 0x0040, 0x4cf4, 0x1078, 0x59d4, 0x600c, 0xa015, 0x0040,
- 0x4cfb, 0x720e, 0x600f, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000,
- 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x4cf4, 0x0d7e,
- 0x2069, 0x7936, 0x6830, 0xa084, 0x0003, 0x0079, 0x4d07, 0x4d0d,
- 0x4d0f, 0x4d35, 0x4d0d, 0x1078, 0x12d5, 0x0d7f, 0x007c, 0x0c7e,
- 0x6840, 0xa086, 0x0001, 0x0040, 0x4d2b, 0x683c, 0xa065, 0x0040,
- 0x4d20, 0x600c, 0xa015, 0x0040, 0x4d27, 0x6a3a, 0x600f, 0x0000,
- 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a,
- 0x6836, 0x0078, 0x4d20, 0x6843, 0x0000, 0x6838, 0xa065, 0x0040,
- 0x4d20, 0x6003, 0x0003, 0x0078, 0x4d20, 0x0c7e, 0x6843, 0x0000,
- 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4d4d, 0x600c, 0xa015,
- 0x0040, 0x4d49, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0078,
- 0x4d4d, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c,
- 0x0d7e, 0x2069, 0x7936, 0x6804, 0xa084, 0x0007, 0x0079, 0x4d58,
- 0x4d62, 0x4dff, 0x4dff, 0x4dff, 0x4dff, 0x4e01, 0x4dff, 0x4d60,
- 0x1078, 0x12d5, 0x6820, 0xa005, 0x00c0, 0x4d68, 0x0d7f, 0x007c,
- 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4d77, 0x6807, 0x0004, 0x6826,
- 0x682b, 0x0000, 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c, 0x6814,
- 0xa065, 0x0040, 0x4d85, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000,
- 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c,
- 0xa2f5, 0x0000, 0x0040, 0x4dfa, 0x704c, 0xa00d, 0x0040, 0x4d94,
- 0x7088, 0xa005, 0x0040, 0x4dac, 0x7054, 0xa075, 0x0040, 0x4d9d,
- 0xa20e, 0x0040, 0x4dfa, 0x0078, 0x4da2, 0x6818, 0xa20e, 0x0040,
- 0x4dfa, 0x2070, 0x704c, 0xa00d, 0x0040, 0x4d94, 0x7088, 0xa005,
- 0x00c0, 0x4d94, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8,
- 0x4d94, 0x1078, 0x5ca3, 0x0040, 0x4dfa, 0x8318, 0x733e, 0x6112,
- 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048,
- 0x4dc3, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316,
- 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, 0x0040, 0x4ddc, 0x7100,
- 0xd1f4, 0x0040, 0x4dd8, 0x7114, 0xa18c, 0x00ff, 0x0078, 0x4de1,
- 0x2009, 0x0000, 0x0078, 0x4de1, 0xa1e0, 0x2303, 0x2c0c, 0xa18c,
- 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x5298, 0x7300, 0xc3dd,
- 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f,
- 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f,
- 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4df8, 0x0d7f,
- 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4e0d, 0x6807, 0x0004,
- 0x6826, 0x682b, 0x0000, 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c,
- 0x0f7e, 0x0d7e, 0x2069, 0x7936, 0x6830, 0xa086, 0x0000, 0x00c0,
- 0x4e2e, 0x6838, 0xa07d, 0x0040, 0x4e2e, 0x6833, 0x0001, 0x683e,
- 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078,
- 0x1a24, 0x00c0, 0x4e31, 0x127f, 0x1078, 0x552b, 0x0d7f, 0x0f7f,
- 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0xa015,
- 0x0040, 0x4e43, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f,
- 0x0000, 0x0078, 0x4e2e, 0x683a, 0x6836, 0x0078, 0x4e3d, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x4e4d, 0x007c, 0x4e56, 0x4e5b, 0x5162,
- 0x5258, 0x4e5b, 0x5162, 0x5258, 0x4e56, 0x4e5b, 0x1078, 0x4c57,
- 0x1078, 0x4d50, 0x007c, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e,
- 0x6004, 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x6118, 0x2178, 0x79a0,
- 0xd1bc, 0x0040, 0x4e78, 0x7900, 0xd1f4, 0x0040, 0x4e74, 0x7914,
- 0xa18c, 0x00ff, 0x0078, 0x4e7d, 0x2009, 0x0000, 0x0078, 0x4e7d,
- 0xa1f8, 0x2303, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100,
- 0x619a, 0x1079, 0x4e89, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f,
- 0x007c, 0x4ebb, 0x4ef3, 0x4f0b, 0x4f8a, 0x4fb7, 0x4fbf, 0x4fe0,
- 0x4ff1, 0x5002, 0x500a, 0x501b, 0x500a, 0x5063, 0x4ff1, 0x5084,
- 0x508c, 0x5002, 0x508c, 0x509d, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9,
- 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9,
- 0x5712, 0x5727, 0x574a, 0x576e, 0x4fe0, 0x4eb9, 0x4fe0, 0x500a,
- 0x4eb9, 0x4f0b, 0x4f8a, 0x4eb9, 0x5c1e, 0x500a, 0x4eb9, 0x5c41,
- 0x500a, 0x1078, 0x12d5, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3,
- 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x7751, 0x6804, 0xd084,
- 0x0040, 0x4ed5, 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078, 0x206e,
- 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x4eda, 0x0d7f, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x7705, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7701, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084,
- 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c,
- 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3,
- 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff,
- 0x20a2, 0x20a9, 0x0004, 0x2099, 0x7705, 0x53a6, 0x60c3, 0x0010,
- 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4f1e, 0x20a3,
- 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4f20, 0x20a3, 0x0300,
- 0x20a3, 0x0000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e,
- 0x00c0, 0x4f59, 0x2099, 0x7920, 0x33a6, 0x9398, 0x33a6, 0x9398,
- 0x3304, 0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004,
- 0x2099, 0x7705, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7701, 0x53a6,
- 0x20a9, 0x0010, 0x20a3, 0x0000, 0x00f0, 0x4f4a, 0x2099, 0x7928,
- 0x33a6, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x00f0, 0x4f53, 0x0078,
- 0x4f79, 0x2099, 0x7920, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0004,
- 0x2099, 0x7705, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7701, 0x53a6,
- 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4f6a, 0x20a9, 0x0008,
- 0x20a3, 0x0000, 0x00f0, 0x4f70, 0x2099, 0x7928, 0x20a9, 0x0008,
- 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4f7b, 0x20a9,
- 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4f81, 0x60c3, 0x0074, 0x1078,
- 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3, 0x2010,
- 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7751, 0x7904,
- 0x0f7f, 0xd1ac, 0x00c0, 0x4fa6, 0xa085, 0x0020, 0xd1a4, 0x0040,
- 0x4fab, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5642, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x50b2, 0x20a3, 0x5000, 0x0078, 0x4f20, 0x20a1,
- 0x020b, 0x1078, 0x50b2, 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5642, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x5642,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078,
- 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200,
- 0x0078, 0x4f20, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100,
- 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008,
- 0x1078, 0x5642, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068,
- 0x6894, 0xa086, 0x0014, 0x00c0, 0x5041, 0x6998, 0xa184, 0xc000,
- 0x00c0, 0x503d, 0xd1ec, 0x0040, 0x5039, 0x20a3, 0x2100, 0x0078,
- 0x5043, 0x20a3, 0x0100, 0x0078, 0x5043, 0x20a3, 0x0400, 0x0078,
- 0x5043, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x20a2, 0x0f7e, 0x2079, 0x7751, 0x7904, 0x0f7f, 0xd1ac, 0x00c0,
- 0x5053, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x5058, 0xa085, 0x0010,
- 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x1078,
- 0x5642, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3,
- 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0200, 0x0078, 0x4ec1, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
- 0x60c3, 0x0008, 0x1078, 0x5642, 0x007c, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x1078,
- 0x5642, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, 0x50c5, 0x20a3,
- 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x50f3, 0xa286, 0x007f, 0x00c0,
- 0x50d0, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, 0x0078, 0x50e7,
- 0xd2bc, 0x0040, 0x50ef, 0xa286, 0x0080, 0x0d7e, 0x00c0, 0x50de,
- 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x50e7, 0xa2e8, 0x7820,
- 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, 0x20a2, 0x2069,
- 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x50f7, 0x20a3,
- 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0129, 0x20a3, 0x0000, 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000,
- 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff,
- 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, 0x50fb,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x5148, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5150,
- 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x5631, 0x22a2, 0x20a3,
- 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048,
- 0x12d5, 0xa08a, 0x008c, 0x10c8, 0x12d5, 0x6118, 0x2178, 0x79a0,
- 0xd1bc, 0x0040, 0x5180, 0x7900, 0xd1f4, 0x0040, 0x517c, 0x7914,
- 0xa18c, 0x00ff, 0x0078, 0x5185, 0x2009, 0x0000, 0x0078, 0x5185,
- 0xa1f8, 0x2303, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100,
- 0x619a, 0xa082, 0x0085, 0x1079, 0x5190, 0x0f7f, 0x0c7f, 0x007c,
- 0x5199, 0x51a4, 0x51be, 0x5197, 0x5197, 0x5197, 0x5199, 0x1078,
- 0x12d5, 0x147e, 0x20a1, 0x020b, 0x1078, 0x51d1, 0x60c3, 0x0000,
- 0x1078, 0x5642, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x51fe, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x000c, 0x1078, 0x5642, 0x147f, 0x007c, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x522b, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x5642, 0x147f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x51f0, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x51f8,
- 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x50fb, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
- 0x007e, 0x0048, 0x521d, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810,
- 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6,
- 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5225, 0x20a3, 0x8400, 0x6298,
- 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3,
- 0x0000, 0x0078, 0x5154, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x524a,
- 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x5252, 0x20a3, 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x5154,
- 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x12d5,
- 0xa08a, 0x0050, 0x10c8, 0x12d5, 0x7918, 0x2160, 0x61a0, 0xd1bc,
- 0x0040, 0x5277, 0x6100, 0xd1f4, 0x0040, 0x5273, 0x6114, 0xa18c,
- 0x00ff, 0x0078, 0x527c, 0x2009, 0x0000, 0x0078, 0x527c, 0xa1e0,
- 0x2303, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0040, 0x1079, 0x5286, 0x0f7f, 0x0c7f, 0x007c, 0x5298, 0x537e,
- 0x5326, 0x54a6, 0x5296, 0x5296, 0x5296, 0x5296, 0x5296, 0x5296,
- 0x5296, 0x58ed, 0x58fe, 0x590f, 0x5920, 0x5296, 0x1078, 0x12d5,
- 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7910,
- 0x2168, 0x6948, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c,
- 0xa184, 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x52b3, 0x20a3,
- 0x0002, 0x0078, 0x52bf, 0xd1b4, 0x0040, 0x52ba, 0x20a3, 0x0001,
- 0x0078, 0x52bf, 0x20a3, 0x0000, 0x2230, 0x0078, 0x52c1, 0x6a80,
- 0x6e7c, 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2,
- 0x8000, 0x00f0, 0x52c5, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1,
- 0x9080, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001,
- 0x7952, 0x2003, 0x07d0, 0x2001, 0x7951, 0x2003, 0x0009, 0x2001,
- 0x7957, 0x2003, 0x0002, 0x1078, 0x1504, 0x147f, 0x157f, 0x0d7f,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023,
- 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xd0bc, 0x0040, 0x530f, 0x0d7e, 0xa0e8, 0x7820,
- 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069,
- 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5317, 0x20a3,
- 0x0600, 0x6198, 0x21a2, 0x20a3, 0x0000, 0x6130, 0x21a2, 0x20a3,
- 0x0829, 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3,
- 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x5346, 0x7810, 0x2068,
- 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078,
- 0x5642, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x0040, 0x5364, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085,
- 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x536c, 0x20a3, 0x0500, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000,
- 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x546e, 0x7810, 0x2068,
- 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084,
- 0xf000, 0x00c0, 0x539b, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x53a3, 0x0078, 0x539e, 0xa006, 0x1079, 0x53a3, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x53ad, 0x540f, 0x5413, 0x5436, 0x5443,
- 0x5455, 0x5459, 0x53ab, 0x1078, 0x12d5, 0x017e, 0x037e, 0x694c,
- 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x53c0, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x543a,
- 0xa186, 0x0001, 0x00c0, 0x540a, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2,
- 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x5409, 0xd3c4, 0x0040,
- 0x53db, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x53e0, 0x6874, 0xa108,
- 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2,
- 0x8000, 0x00f0, 0x53e5, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184,
- 0x0003, 0x0040, 0x5409, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x5631, 0x22a2, 0x20a3,
- 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x5642, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x5438, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a,
- 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0032, 0x1078, 0x5642, 0x007c, 0x20a3, 0x0028,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018,
- 0x1078, 0x5642, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0020, 0x1078, 0x5642, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x5438, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff,
- 0x8001, 0x00c0, 0x5467, 0x22a2, 0x037f, 0x0078, 0x5438, 0x20a3,
- 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x543a, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x0040, 0x548c, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085,
- 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x5494, 0x20a3, 0x0700, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000,
- 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007,
- 0x1079, 0x54b9, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x54c1, 0x54c1, 0x54c3, 0x54c1, 0x54c1, 0x54c1, 0x54e8,
- 0x54c1, 0x1078, 0x12d5, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600,
- 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x54f2, 0x0d7e,
- 0x2069, 0x7751, 0x6804, 0xd0bc, 0x0040, 0x54dd, 0x682c, 0xa084,
- 0x00ff, 0x8007, 0x20a2, 0x0078, 0x54df, 0x20a3, 0x3f00, 0x0d7f,
- 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x5642, 0x007c,
- 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x54f2, 0x20a3, 0x7f00,
- 0x0078, 0x54e0, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x5510, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5518,
- 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x5631, 0x22a2,
- 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x057e, 0x047e,
- 0x037e, 0x2061, 0x0100, 0x2071, 0x7700, 0x6130, 0x7818, 0x2068,
- 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x5544, 0xa080, 0x2303, 0x2014,
- 0xa294, 0x00ff, 0x0078, 0x5548, 0x6910, 0x6a14, 0x7364, 0x7468,
- 0x781c, 0xa086, 0x0006, 0x0040, 0x559c, 0xd5bc, 0x0040, 0x5558,
- 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x555e,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810,
- 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008,
- 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
- 0x0000, 0xa582, 0x0080, 0x0048, 0x5590, 0x6a00, 0xd2f4, 0x0040,
- 0x558e, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x5590, 0x2011, 0x0000,
- 0x629e, 0x6017, 0x0016, 0x1078, 0x46c5, 0x037f, 0x047f, 0x057f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084,
- 0x0003, 0xa086, 0x0002, 0x0040, 0x55eb, 0xd5bc, 0x0040, 0x55b0,
- 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x55b6,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060,
- 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582,
- 0x0080, 0x0048, 0x55e6, 0x6a00, 0xd2f4, 0x0040, 0x55e4, 0x6a14,
- 0xa294, 0x00ff, 0x0078, 0x55e6, 0x2011, 0x0000, 0x629e, 0x6017,
- 0x0012, 0x0078, 0x5593, 0xd5bc, 0x0040, 0x55f6, 0xa185, 0x0700,
- 0x20a2, 0x6266, 0x636a, 0x646e, 0x0078, 0x55fc, 0x6063, 0x0700,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
- 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
- 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
- 0x562c, 0x6a00, 0xd2f4, 0x0040, 0x562a, 0x6a14, 0xa294, 0x00ff,
- 0x0078, 0x562c, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078,
- 0x5593, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff,
- 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x7936, 0x6843, 0x0001,
- 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x564d, 0x1078, 0x46b5, 0x007c, 0x007e, 0x6014, 0xa084,
- 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e,
- 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016,
- 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078,
- 0x46c0, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x56a0, 0x1078, 0x5656, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0c7e, 0x2061, 0x7936, 0x6128, 0xa192, 0x0002, 0x00c8, 0x568d,
- 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x569b, 0x1078,
- 0x46b5, 0x1078, 0x564d, 0x0078, 0x569b, 0x6124, 0xa1e5, 0x0000,
- 0x0040, 0x5698, 0x1078, 0x767d, 0x2009, 0x0014, 0x1078, 0x5cfb,
- 0x0c7f, 0x0078, 0x569b, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x1078, 0x3553, 0x0078, 0x569b, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e,
- 0x027e, 0x1078, 0x46ce, 0x2071, 0x7936, 0x713c, 0x81ff, 0x0040,
- 0x56ce, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x56d4, 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x583a, 0x037f, 0x713c, 0x2160, 0x1078, 0x767d,
- 0x2009, 0x004a, 0x1078, 0x5cfb, 0x0078, 0x56ce, 0x027f, 0x017f,
- 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8,
- 0x56be, 0x8108, 0x7146, 0x1078, 0x46c5, 0x0078, 0x56ce, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x7936, 0x7018, 0x2068,
- 0x8dff, 0x0040, 0x5709, 0x68a0, 0xa406, 0x0040, 0x56fb, 0x6854,
- 0x2068, 0x0078, 0x56f0, 0x6010, 0x2060, 0x643c, 0x6540, 0x6e48,
- 0x2d60, 0x1078, 0x394b, 0x0040, 0x5709, 0x1078, 0x59d4, 0xa085,
- 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x50b2,
- 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
- 0x60c3, 0x0008, 0x1078, 0x5642, 0x147f, 0x157f, 0x007c, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3,
- 0x0000, 0x20a9, 0x0006, 0x2011, 0x7740, 0x2019, 0x7741, 0x23a6,
- 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x5737, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5642, 0x147f,
- 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
- 0x1078, 0x5109, 0x1078, 0x5120, 0x7810, 0x007e, 0xa080, 0x0015,
- 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004,
- 0x8003, 0x60c2, 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078,
- 0x5642, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3, 0x6200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5642,
- 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7936, 0x700c, 0x2060, 0x8cff, 0x0040, 0x579f,
- 0x1078, 0x6b99, 0x00c0, 0x5796, 0x1078, 0x5f29, 0x600c, 0x007e,
- 0x1078, 0x5cd4, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x578d, 0x700f,
- 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
- 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
- 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
- 0x7936, 0x7024, 0x2060, 0x8cff, 0x0040, 0x57f8, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x46c0, 0x2009, 0x0013, 0x1078, 0x5cfb,
- 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x57db, 0x6827, 0x0004,
- 0x7804, 0xa084, 0x4000, 0x0040, 0x57ed, 0x7803, 0x1000, 0x7803,
- 0x0000, 0x0078, 0x57ed, 0xd084, 0x0040, 0x57e2, 0x6827, 0x0001,
- 0x0078, 0x57e4, 0x00f0, 0x57ca, 0x7804, 0xa084, 0x1000, 0x0040,
- 0x57ed, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
- 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
- 0x2001, 0x7700, 0x2004, 0xa096, 0x0001, 0x0040, 0x5830, 0xa096,
- 0x0004, 0x0040, 0x5830, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
- 0x351a, 0x1078, 0x4643, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
- 0x581e, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5830,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5830, 0xd084, 0x0040,
- 0x5825, 0x6827, 0x0001, 0x0078, 0x5827, 0x00f0, 0x580d, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5830, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
- 0x0140, 0x2071, 0x7936, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5888,
- 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x46ce,
- 0x1078, 0x1bf1, 0xa39d, 0x0000, 0x00c0, 0x5862, 0x2009, 0x0049,
- 0x1078, 0x5cfb, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5875,
- 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5887, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x0078, 0x5887, 0xd094, 0x0040, 0x587c,
- 0x6827, 0x0002, 0x0078, 0x587e, 0x00f0, 0x5864, 0x7804, 0xa084,
- 0x1000, 0x0040, 0x5887, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7936,
- 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x2069, 0x7936, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x7936, 0x7614, 0x2660,
- 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x58e6, 0x601c, 0xa206,
- 0x00c0, 0x58e1, 0x7014, 0xac36, 0x00c0, 0x58c0, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x58ce, 0x2c00, 0xaf36, 0x0040, 0x58cc,
- 0x2f00, 0x7012, 0x0078, 0x58ce, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x58d7, 0x7e0e, 0x0078, 0x58d8, 0x2678,
- 0x600f, 0x0000, 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078,
- 0x58b3, 0x2c78, 0x600c, 0x2060, 0x0078, 0x58b3, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
- 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x592f, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x592f, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x592f,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
- 0x59df, 0x60c3, 0x0020, 0x1078, 0x5642, 0x147f, 0x157f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
- 0x00c0, 0x5947, 0xd1bc, 0x00c0, 0x5991, 0x0078, 0x59d1, 0x2009,
- 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
- 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
- 0x5988, 0x6020, 0xd0b4, 0x0040, 0x5988, 0x6024, 0xd094, 0x00c0,
- 0x5988, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5988,
- 0x00f0, 0x5954, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
- 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
- 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
- 0x00c0, 0x5987, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x597e, 0x027f,
- 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
- 0x59d1, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
- 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x59ca, 0x6020, 0xd0bc, 0x0040, 0x59ca, 0x2104,
- 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x59ca, 0x00f0, 0x599e,
- 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
- 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
- 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
- 0x59c4, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
- 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x7936, 0x7020,
- 0xa005, 0x0040, 0x59dd, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
- 0x0008, 0x20a2, 0x00f0, 0x59e1, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7936, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
- 0x87ff, 0x0040, 0x5a77, 0x8cff, 0x0040, 0x5a77, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x5a72, 0x88ff, 0x0040, 0x5a0e, 0x2800, 0xac06,
- 0x00c0, 0x5a72, 0x2039, 0x0000, 0x0078, 0x5a12, 0x6018, 0xa206,
- 0x00c0, 0x5a72, 0x7024, 0xac06, 0x00c0, 0x5a40, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x5a3b, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x5a30, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5a38, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x5a40, 0x6003, 0x0009, 0x630a, 0x0078, 0x5a72,
- 0x7014, 0xac36, 0x00c0, 0x5a46, 0x660c, 0x7616, 0x7010, 0xac36,
- 0x00c0, 0x5a54, 0x2c00, 0xaf36, 0x0040, 0x5a52, 0x2f00, 0x7012,
- 0x0078, 0x5a54, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x5a5d, 0x7e0e, 0x0078, 0x5a5e, 0x2678, 0x600f, 0x0000,
- 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x5a68, 0x1078, 0x75b3,
- 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x88ff, 0x00c0, 0x5a81, 0x0c7f,
- 0x0078, 0x59f8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x59f8, 0xa006,
- 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5a78,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7936, 0x7638, 0x2660, 0x2678, 0x8cff,
- 0x0040, 0x5af3, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5aee, 0x88ff,
- 0x0040, 0x5aa8, 0x2800, 0xac06, 0x00c0, 0x5aee, 0x0078, 0x5aac,
- 0x6018, 0xa206, 0x00c0, 0x5aee, 0x703c, 0xac06, 0x00c0, 0x5abe,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x583a, 0x7033, 0x0000, 0x703f,
- 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
- 0x00c0, 0x5ac4, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5ad2,
- 0x2c00, 0xaf36, 0x0040, 0x5ad0, 0x2f00, 0x7036, 0x0078, 0x5ad2,
- 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5adb,
- 0x7e0e, 0x0078, 0x5adc, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x6a03, 0x0040, 0x5ae6, 0x1078, 0x75b3, 0x1078, 0x6b6c,
- 0x88ff, 0x00c0, 0x5afd, 0x0c7f, 0x0078, 0x5a97, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x5a97, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
- 0xa8c5, 0x0001, 0x0078, 0x5af4, 0x0e7e, 0x2071, 0x7936, 0x2001,
- 0x7700, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5b12, 0x7007, 0x0005,
- 0x0078, 0x5b14, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7936, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5b54,
- 0x2200, 0xac06, 0x00c0, 0x5b4f, 0x7038, 0xac36, 0x00c0, 0x5b32,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5b40, 0x2c00, 0xaf36,
- 0x0040, 0x5b3e, 0x2f00, 0x7036, 0x0078, 0x5b40, 0x7037, 0x0000,
- 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5b48, 0x7e0e, 0x0078, 0x5b49,
- 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5b54, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5b25, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7936, 0x760c,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x5bed, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x5be8, 0x7024, 0xac06, 0x00c0, 0x5b9b,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5b9b, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5b92, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5b9a,
- 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x5ba1, 0x660c,
- 0x760e, 0x7008, 0xac36, 0x00c0, 0x5baf, 0x2c00, 0xaf36, 0x0040,
- 0x5bad, 0x2f00, 0x700a, 0x0078, 0x5baf, 0x700b, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5bb8, 0x7e0e, 0x0078, 0x5bb9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6b85, 0x00c0, 0x5bc3, 0x1078,
- 0x22b1, 0x0078, 0x5bdf, 0x1078, 0x6b99, 0x00c0, 0x5bcb, 0x1078,
- 0x5f29, 0x0078, 0x5bdf, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040,
- 0x5bdf, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5bf5, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x6003,
- 0x0000, 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x5b6a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5b6a, 0x127f, 0x007f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x5bd6, 0x1078, 0x75b3, 0x0078, 0x5bdf, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e,
- 0x2123, 0x00c0, 0x5c0f, 0x8210, 0x8000, 0x0078, 0x5c06, 0xa005,
- 0x0040, 0x5c19, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8,
- 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1,
- 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3,
- 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3,
- 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3,
- 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x5642, 0x0d7f,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0210, 0x20a3,
- 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0018, 0x1078, 0x5642, 0x007c, 0x2061, 0x7e00,
- 0x2a70, 0x7060, 0x7046, 0x704b, 0x7e00, 0x007c, 0x0e7e, 0x127e,
- 0x2071, 0x7700, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048,
- 0x5ca0, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5c8c,
- 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5c88, 0x0078, 0x5c7b,
- 0x2061, 0x7e00, 0x0078, 0x5c7b, 0x6003, 0x0008, 0x8529, 0x7546,
- 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5c9c, 0x754a, 0xa085,
- 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7e00, 0x0078, 0x5c97,
- 0xa006, 0x0078, 0x5c99, 0x0e7e, 0x2071, 0x7700, 0x7544, 0xa582,
- 0x0001, 0x0048, 0x5cd1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x5cbe, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5cba,
- 0x0078, 0x5cad, 0x2061, 0x7e00, 0x0078, 0x5cad, 0x6003, 0x0008,
- 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5ccd,
- 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7e00, 0x0078,
- 0x5cc9, 0xa006, 0x0078, 0x5ccb, 0xac82, 0x7e00, 0x1048, 0x12d5,
- 0x2001, 0x7715, 0x2004, 0xac02, 0x10c8, 0x12d5, 0xa006, 0x6006,
- 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003,
- 0x0000, 0x2061, 0x7700, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001,
- 0x0040, 0x5cf3, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x0078, 0x5cf2, 0x601c, 0xa084, 0x000f, 0x0079, 0x5d00,
- 0x5d09, 0x5d11, 0x5d2d, 0x5d49, 0x6c16, 0x6c32, 0x6c4e, 0x5d09,
- 0x5d11, 0xa18e, 0x0047, 0x00c0, 0x5d10, 0xa016, 0x1078, 0x1572,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5d1b, 0x067f, 0x007c, 0x5d2b, 0x5e12, 0x5f44, 0x5d2b, 0x5f9b,
- 0x5d2b, 0x5d2b, 0x5d2b, 0x5dc1, 0x6247, 0x5d2b, 0x5d2b, 0x5d2b,
- 0x5d2b, 0x5d2b, 0x5d2b, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5d37, 0x067f, 0x007c, 0x5d47,
- 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x66b7,
- 0x677d, 0x5d47, 0x66d0, 0x6729, 0x66d0, 0x6729, 0x5d47, 0x1078,
- 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5d53, 0x067f, 0x007c, 0x5d63, 0x6285, 0x632b, 0x63ed, 0x6541,
- 0x5d63, 0x5d63, 0x5d63, 0x6263, 0x666c, 0x6670, 0x5d63, 0x5d63,
- 0x5d63, 0x5d63, 0x6696, 0x1078, 0x12d5, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5d73, 0x0e7e,
- 0x1078, 0x6a03, 0x0040, 0x5d8a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5cd4, 0x007c, 0x0d7e, 0x037e,
- 0x7330, 0xa386, 0x0200, 0x00c0, 0x5d9b, 0x6018, 0x2068, 0x6813,
- 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x5da5, 0x2068,
- 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x5cd4, 0x037f,
- 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
- 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5dbe, 0x6018, 0x2068, 0x7038,
- 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078,
- 0x5d7f, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x0079, 0x5dc8,
- 0x5dfa, 0x5e06, 0x5dfa, 0x5dfa, 0x5dfa, 0x5dfa, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5dfa,
- 0x5df8, 0x5dfa, 0x5dfa, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5dfa, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x4948, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4948, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6,
- 0x0013, 0x00c0, 0x5e1e, 0x2008, 0x0079, 0x5ea7, 0xa1b6, 0x0027,
- 0x00c0, 0x5e74, 0x1078, 0x4c57, 0x6004, 0x1078, 0x6b85, 0x0040,
- 0x5e37, 0x1078, 0x6b99, 0x0040, 0x5e6c, 0xa08e, 0x0021, 0x0040,
- 0x5e70, 0xa08e, 0x0022, 0x0040, 0x5e6c, 0x0078, 0x5e67, 0x1078,
- 0x22b1, 0x2001, 0x0007, 0x1078, 0x37ae, 0x6018, 0xa080, 0x0028,
- 0x200c, 0x1078, 0x5f29, 0xa186, 0x007e, 0x00c0, 0x5e4d, 0x2001,
- 0x772f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x4a38, 0x1078, 0x497b, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x5e5e, 0x1078, 0x39f0, 0x0c7f, 0x2c08,
- 0x1078, 0x7431, 0x037f, 0x027f, 0x017f, 0x1078, 0x37ee, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078, 0x5f29, 0x0078, 0x5e67,
- 0x1078, 0x5f38, 0x0078, 0x5e67, 0xa186, 0x0014, 0x00c0, 0x5e6b,
- 0x1078, 0x4c57, 0x1078, 0x228f, 0x1078, 0x6b85, 0x00c0, 0x5e94,
- 0x1078, 0x22b1, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x5f29,
- 0xa186, 0x007e, 0x00c0, 0x5e92, 0x2001, 0x772f, 0x200c, 0xa18d,
- 0x0001, 0x2102, 0x0078, 0x5e67, 0x1078, 0x6b99, 0x00c0, 0x5e9c,
- 0x1078, 0x5f29, 0x0078, 0x5e67, 0x6004, 0xa08e, 0x0021, 0x0040,
- 0x5e98, 0xa08e, 0x0022, 0x1040, 0x5f38, 0x0078, 0x5e67, 0x5ed9,
- 0x5edb, 0x5edf, 0x5ee3, 0x5ee7, 0x5eeb, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5eef, 0x5ef5, 0x5ed7,
- 0x5eff, 0x5ef5, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ef5,
- 0x5ef5, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x1078,
- 0x12d5, 0x0078, 0x5ef5, 0x2001, 0x000b, 0x0078, 0x5f08, 0x2001,
- 0x0003, 0x0078, 0x5f08, 0x2001, 0x0005, 0x0078, 0x5f08, 0x2001,
- 0x0001, 0x0078, 0x5f08, 0x2001, 0x0009, 0x0078, 0x5f08, 0x1078,
- 0x12d5, 0x0078, 0x5f07, 0x1078, 0x37ae, 0x1078, 0x4c57, 0x6003,
- 0x0002, 0x6017, 0x0028, 0x1078, 0x4d50, 0x0078, 0x5f07, 0x1078,
- 0x4c57, 0x6003, 0x0004, 0x6017, 0x0028, 0x1078, 0x4d50, 0x007c,
- 0x1078, 0x37ae, 0x1078, 0x4c57, 0x6003, 0x0002, 0x037e, 0x2019,
- 0x775c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x5f1a, 0x2019, 0x0028,
- 0x0078, 0x5f23, 0x8007, 0xa09a, 0x0004, 0x0048, 0x5f16, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4d50, 0x0078,
- 0x5f07, 0x0e7e, 0x1078, 0x6a03, 0x0040, 0x5f36, 0x6010, 0x2070,
- 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c,
- 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103,
- 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0x6604,
- 0xa6b6, 0x0028, 0x00c0, 0x5f58, 0x1078, 0x6bce, 0x0078, 0x5f8a,
- 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x5f61, 0x1078, 0x6be8, 0x0078,
- 0x5f8a, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5f6a, 0x1078, 0x5d65,
- 0x0078, 0x5f8a, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5f73, 0x1078,
- 0x5daa, 0x0078, 0x5f8a, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x5f7c,
- 0x1078, 0x5d8e, 0x0078, 0x5f8a, 0xa1b6, 0x0015, 0x00c0, 0x5f84,
- 0x1079, 0x5f8f, 0x0078, 0x5f8a, 0xa1b6, 0x0016, 0x00c0, 0x5f8b,
- 0x1079, 0x60cc, 0x007c, 0x1078, 0x5d09, 0x0078, 0x5f8a, 0x5fb3,
- 0x5fb6, 0x5fb3, 0x5ff7, 0x5fb3, 0x6068, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x60a4, 0x5fb3, 0x60ba, 0xa1b6, 0x0048, 0x0040, 0x5fa7, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0e7e,
- 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f,
- 0x1078, 0x5cd4, 0x007c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071,
- 0x7700, 0x7078, 0xa086, 0x0074, 0x00c0, 0x5fe0, 0x1078, 0x7405,
- 0x00c0, 0x5fd2, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x5fe4, 0x0d7f,
- 0x2001, 0x0006, 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4,
- 0x0078, 0x5fe2, 0x2001, 0x000a, 0x1078, 0x37ae, 0x1078, 0x22b1,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4948, 0x0078, 0x5fe2,
- 0x1078, 0x6058, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x5ff6,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2069, 0x7751, 0x6804, 0xd0a4,
- 0x0040, 0x5ff6, 0x2001, 0x0006, 0x1078, 0x37bc, 0x007c, 0x0d7e,
- 0x2011, 0x771e, 0x2204, 0xa086, 0x0074, 0x00c0, 0x6054, 0x1078,
- 0x6199, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e,
- 0x0040, 0x601f, 0xa286, 0x0080, 0x00c0, 0x6048, 0x6813, 0x00ff,
- 0x6817, 0xfffc, 0x6010, 0xa005, 0x0040, 0x603e, 0x2068, 0x6807,
- 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x0078, 0x603e, 0x0e7e,
- 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x772f, 0x2e04,
- 0xa085, 0x0003, 0x2072, 0x2071, 0x7c80, 0x2079, 0x0100, 0x2e04,
- 0xa084, 0x00ff, 0x2069, 0x7719, 0x206a, 0x78e6, 0x8e70, 0x2e04,
- 0x2069, 0x771a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, 0x0006,
- 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x0078, 0x6056,
- 0x2001, 0x0004, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4948, 0x0078, 0x6056, 0x1078, 0x6058, 0x0d7f, 0x007c,
- 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x0040, 0x6063, 0x2001,
- 0x0007, 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x007c,
- 0x0e7e, 0x2071, 0x7700, 0x7078, 0xa086, 0x0014, 0x00c0, 0x609e,
- 0x7000, 0xa086, 0x0003, 0x00c0, 0x607b, 0x6010, 0xa005, 0x00c0,
- 0x607b, 0x1078, 0x2d9e, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3882,
- 0x1078, 0x5fe4, 0x0d7f, 0x1078, 0x61a3, 0x00c0, 0x609e, 0x2001,
- 0x0006, 0x1078, 0x37ae, 0x0e7e, 0x6010, 0xa005, 0x0040, 0x6097,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x0e7f,
- 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x0078, 0x60a2, 0x1078, 0x5f29,
- 0x1078, 0x6058, 0x0e7f, 0x007c, 0x2011, 0x771e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x60b7, 0x2001, 0x0002, 0x1078, 0x37ae, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x4948, 0x0078, 0x60b9, 0x1078,
- 0x6058, 0x007c, 0x2011, 0x771e, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x60c9, 0x2001, 0x0007, 0x1078, 0x37ae, 0x1078, 0x5cd4, 0x0078,
- 0x60cb, 0x1078, 0x6058, 0x007c, 0x5fb3, 0x60d8, 0x5fb3, 0x60fe,
- 0x5fb3, 0x614c, 0x5fb3, 0x5fb3, 0x5fb3, 0x6161, 0x5fb3, 0x6174,
- 0x0c7e, 0x1078, 0x6187, 0x00c0, 0x60ed, 0x2001, 0x0000, 0x1078,
- 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x4948, 0x0078, 0x60fc, 0x2009, 0x7c8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x60fa, 0x1078, 0x5cd4,
- 0x0078, 0x60fc, 0x1078, 0x6058, 0x0c7f, 0x007c, 0x1078, 0x6196,
- 0x00c0, 0x6112, 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0002,
- 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4948,
- 0x0078, 0x6134, 0x1078, 0x5f29, 0x2009, 0x7c8e, 0x2134, 0xa6b4,
- 0x00ff, 0xa686, 0x0005, 0x0040, 0x6135, 0x2009, 0x7c8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x6132, 0xa686, 0x0009,
- 0x0040, 0x6135, 0x2001, 0x0004, 0x1078, 0x37ae, 0x1078, 0x5cd4,
- 0x0078, 0x6134, 0x1078, 0x6058, 0x007c, 0x0d7e, 0x6018, 0x2068,
- 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6147, 0x8001, 0x6842,
- 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x6134, 0x1078,
- 0x228f, 0x0d7f, 0x0078, 0x6132, 0x1078, 0x6196, 0x00c0, 0x615c,
- 0x2001, 0x0004, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4948, 0x0078, 0x6160, 0x1078, 0x5f29, 0x1078, 0x6058,
- 0x007c, 0x1078, 0x6196, 0x00c0, 0x6171, 0x2001, 0x0008, 0x1078,
- 0x37ae, 0x6003, 0x0001, 0x6007, 0x0005, 0x1078, 0x4948, 0x0078,
- 0x6173, 0x1078, 0x6058, 0x007c, 0x1078, 0x6196, 0x00c0, 0x6184,
- 0x2001, 0x000a, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x4948, 0x0078, 0x6186, 0x1078, 0x6058, 0x007c, 0x2009,
- 0x7c8e, 0x2104, 0xa086, 0x0003, 0x00c0, 0x6195, 0x2009, 0x7c8f,
- 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001,
- 0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x3818,
- 0x017f, 0x0c7f, 0x007c, 0x0e7e, 0x2071, 0x7c8c, 0x7004, 0xa086,
- 0x0014, 0x00c0, 0x61c6, 0x7008, 0xa086, 0x0800, 0x00c0, 0x61c6,
- 0x700c, 0xd0ec, 0x0040, 0x61c4, 0xa084, 0x0f00, 0xa086, 0x0100,
- 0x00c0, 0x61c4, 0x7024, 0xd0a4, 0x0040, 0x61c4, 0xd08c, 0x0040,
- 0x61c4, 0xa006, 0x0078, 0x61c6, 0xa085, 0x0001, 0x0e7f, 0x007c,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x793f, 0x252c, 0x2021, 0x7945,
- 0x2424, 0x2061, 0x7e00, 0x2071, 0x7700, 0x7244, 0x7060, 0xa202,
- 0x00c8, 0x621d, 0x1078, 0x760f, 0x0040, 0x6215, 0x671c, 0xa786,
- 0x0001, 0x0040, 0x6215, 0xa786, 0x0007, 0x0040, 0x6215, 0x2500,
- 0xac06, 0x0040, 0x6215, 0x2400, 0xac06, 0x0040, 0x6215, 0x0c7e,
- 0x6000, 0xa086, 0x0004, 0x00c0, 0x61ff, 0x1078, 0x1676, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x6212, 0xa786, 0x0003, 0x00c0,
- 0x6227, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c,
- 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x0c7f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x00c8, 0x621d, 0x0078, 0x61dd, 0x127f, 0x007f, 0x027f,
- 0x047f, 0x057f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x6209, 0x1078, 0x75b3, 0x0078, 0x6212, 0x220c,
- 0x2304, 0xa106, 0x00c0, 0x623a, 0x8210, 0x8318, 0x00f0, 0x622f,
- 0xa006, 0x007c, 0x2304, 0xa102, 0x0048, 0x6242, 0x2001, 0x0001,
- 0x0078, 0x6244, 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004,
- 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x1078, 0x6b85, 0x0040, 0x6256,
- 0x1078, 0x6b99, 0x0040, 0x625f, 0x0078, 0x6258, 0x1078, 0x22b1,
- 0x1078, 0x4c57, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078,
- 0x5f29, 0x0078, 0x6258, 0xa182, 0x0040, 0x0079, 0x6267, 0x6277,
- 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277,
- 0x6277, 0x6277, 0x6279, 0x6279, 0x6279, 0x6279, 0x6277, 0x1078,
- 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x48fb, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0,
- 0x628e, 0x6004, 0xa082, 0x0040, 0x0079, 0x6304, 0xa186, 0x0027,
- 0x00c0, 0x62ab, 0x1078, 0x4c57, 0x1078, 0x228f, 0x0d7e, 0x6110,
- 0x2168, 0x1078, 0x6a03, 0x0040, 0x62a5, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f, 0x1078, 0x5cd4,
- 0x1078, 0x4d50, 0x007c, 0xa186, 0x0014, 0x00c0, 0x62b4, 0x6004,
- 0xa082, 0x0040, 0x0079, 0x62d4, 0xa186, 0x0047, 0x10c0, 0x12d5,
- 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, 0x62d1, 0x127e, 0x2091,
- 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, 0x47bc, 0x027f, 0x017f,
- 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x62d1, 0x0078,
- 0x632b, 0x1078, 0x5d09, 0x007c, 0x62e6, 0x62e4, 0x62e4, 0x62e4,
- 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62fd,
- 0x62fd, 0x62fd, 0x62fd, 0x62e4, 0x1078, 0x12d5, 0x1078, 0x4c57,
- 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6a03, 0x0040, 0x62f7, 0x6837,
- 0x0103, 0x684b, 0x0006, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f,
- 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078, 0x4c57, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x6316, 0x6314, 0x6314, 0x6314,
- 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6324,
- 0x6324, 0x6324, 0x6324, 0x6314, 0x1078, 0x12d5, 0x1078, 0x4c57,
- 0x6003, 0x0002, 0x1078, 0x4d50, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4c57, 0x6003, 0x000f,
- 0x1078, 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x632f, 0x633f,
- 0x633f, 0x633f, 0x633f, 0x633f, 0x6341, 0x63ca, 0x63e2, 0x633f,
- 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x1078,
- 0x12d5, 0x0e7e, 0x0d7e, 0x2071, 0x7c8c, 0x6110, 0x2168, 0x7614,
- 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x63ae, 0xa68c, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6373, 0xa186, 0x0028, 0x00c0, 0x635d, 0x1078,
- 0x6b73, 0x684b, 0x001c, 0x0078, 0x6375, 0xd6dc, 0x0040, 0x6368,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6375,
- 0xd6d4, 0x0040, 0x6373, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6375, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46,
- 0xa01e, 0xd6c4, 0x0040, 0x6388, 0x7328, 0x732c, 0x6b56, 0x037e,
- 0x2308, 0x2019, 0x7c98, 0xad90, 0x0019, 0x1078, 0x67ec, 0x037f,
- 0xd6cc, 0x0040, 0x63be, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
- 0x639c, 0x2071, 0x7c98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
- 0x1078, 0x67ec, 0x0078, 0x63be, 0x6838, 0xd0fc, 0x0040, 0x63a5,
- 0x2009, 0x0020, 0x695a, 0x0078, 0x6391, 0x0f7e, 0x2d78, 0x1078,
- 0x6784, 0x0f7f, 0x1078, 0x67d9, 0x0078, 0x63c0, 0x684b, 0x0000,
- 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x63be, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x63be, 0x1078, 0x6532, 0x1078, 0x3b4c,
- 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078,
- 0x5cd4, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7c8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x4967, 0x1078,
- 0x4e10, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x63f1, 0x6401, 0x6401, 0x6401, 0x6401, 0x6401, 0x6403, 0x649a,
- 0x6401, 0x6401, 0x64b0, 0x6512, 0x6401, 0x6401, 0x6401, 0x6401,
- 0x6519, 0x1078, 0x12d5, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x7c8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x6495, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x6424,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x6495,
- 0x1078, 0x132f, 0x1040, 0x12d5, 0x2d00, 0x784a, 0x7f4c, 0xc7cd,
- 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
- 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x645e,
- 0xa186, 0x0028, 0x00c0, 0x6448, 0x684b, 0x001c, 0x0078, 0x6460,
- 0xd6dc, 0x0040, 0x6453, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6460, 0xd6d4, 0x0040, 0x645e, 0x684b, 0x0007,
- 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6460, 0x684b, 0x0000,
- 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
- 0x6475, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7c98,
- 0xad90, 0x0019, 0x1078, 0x67ec, 0x037f, 0xd6cc, 0x0040, 0x6495,
- 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x6489, 0x2071, 0x7c98,
- 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x67ec, 0x0078,
- 0x6495, 0x7838, 0xd0fc, 0x0040, 0x6492, 0x2009, 0x0020, 0x695a,
- 0x0078, 0x647e, 0x2d78, 0x1078, 0x6784, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7c8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x563b, 0x007c,
- 0x0d7e, 0x6003, 0x0002, 0x1078, 0x4cff, 0x1078, 0x4e10, 0x6110,
- 0x2168, 0x694c, 0xd1e4, 0x0040, 0x6510, 0xd1cc, 0x0040, 0x64eb,
- 0x6948, 0x6838, 0xd0fc, 0x0040, 0x64e3, 0x017e, 0x684c, 0x007e,
- 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020,
- 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x64d2,
- 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078,
- 0x1358, 0x0078, 0x650e, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078,
- 0x67d9, 0x0078, 0x650e, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x650a, 0xa086, 0x0028, 0x00c0, 0x64fc,
- 0x684b, 0x001c, 0x0078, 0x650c, 0xd1dc, 0x0040, 0x6503, 0x684b,
- 0x0015, 0x0078, 0x650c, 0xd1d4, 0x0040, 0x650a, 0x684b, 0x0007,
- 0x0078, 0x650c, 0x684b, 0x0000, 0x1078, 0x3b4c, 0x1078, 0x5cd4,
- 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078, 0x4cff, 0x1078, 0x4e10,
- 0x007c, 0x1078, 0x4cff, 0x1078, 0x228f, 0x0d7e, 0x6110, 0x2168,
- 0x1078, 0x6a03, 0x0040, 0x652c, 0x6837, 0x0103, 0x684b, 0x0029,
- 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x1078,
- 0x4e10, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x653e, 0x684b,
- 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x6545, 0x6555, 0x6555, 0x6555,
- 0x6555, 0x6555, 0x6557, 0x6555, 0x65fb, 0x6603, 0x6555, 0x6555,
- 0x6555, 0x6555, 0x6555, 0x6555, 0x6555, 0x1078, 0x12d5, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x7c8c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x65ed, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x6578, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x65ea, 0x1078, 0x132f, 0x1040, 0x12d5,
- 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
- 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
- 0x00ff, 0xa186, 0x0002, 0x0040, 0x65b3, 0xa186, 0x0028, 0x00c0,
- 0x659d, 0x684b, 0x001c, 0x0078, 0x65b5, 0xd6dc, 0x0040, 0x65a8,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x65b5,
- 0xd6d4, 0x0040, 0x65b3, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x65b5, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
- 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x65ca, 0x7328, 0x732c,
- 0x6b56, 0x037e, 0x2308, 0x2019, 0x7c98, 0xad90, 0x0019, 0x1078,
- 0x67ec, 0x037f, 0xd6cc, 0x0040, 0x65ea, 0x7124, 0x695a, 0xa192,
- 0x0021, 0x00c8, 0x65de, 0x2071, 0x7c98, 0x831c, 0x2300, 0xae18,
- 0xad90, 0x001d, 0x1078, 0x67ec, 0x0078, 0x65ea, 0x7838, 0xd0fc,
- 0x0040, 0x65e7, 0x2009, 0x0020, 0x695a, 0x0078, 0x65d3, 0x2d78,
- 0x1078, 0x6784, 0xd6dc, 0x00c0, 0x65f0, 0xa006, 0x0078, 0x65f4,
- 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x15b6, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1572, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168,
- 0x694c, 0xd1e4, 0x0040, 0x666a, 0xd1cc, 0x0040, 0x663a, 0x6948,
- 0x6838, 0xd0fc, 0x0040, 0x6632, 0x017e, 0x684c, 0x007e, 0x6850,
- 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e,
- 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6621, 0x157f,
- 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1358,
- 0x0078, 0x6668, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078, 0x67d9,
- 0x0078, 0x6668, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6659, 0xa086, 0x0028, 0x00c0, 0x664b, 0x684b,
- 0x001c, 0x0078, 0x6666, 0xd1dc, 0x0040, 0x6652, 0x684b, 0x0015,
- 0x0078, 0x6666, 0xd1d4, 0x0040, 0x6659, 0x684b, 0x0007, 0x0078,
- 0x6666, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x6666, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x6666, 0x1078, 0x6532, 0x1078, 0x3b4c,
- 0x1078, 0x5cd4, 0x0d7f, 0x007c, 0x1078, 0x4c57, 0x0078, 0x6672,
- 0x1078, 0x4cff, 0x1078, 0x6a03, 0x0040, 0x6689, 0x0d7e, 0x6110,
- 0x2168, 0x6837, 0x0103, 0x2009, 0x770c, 0x210c, 0xd18c, 0x00c0,
- 0x6692, 0xd184, 0x00c0, 0x668e, 0x6108, 0x694a, 0x1078, 0x3b4c,
- 0x0d7f, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x684b, 0x0004,
- 0x0078, 0x6686, 0x684b, 0x0004, 0x0078, 0x6686, 0xa182, 0x0040,
- 0x0079, 0x669a, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66ac,
- 0x66aa, 0x66af, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa,
- 0x66aa, 0x66aa, 0x1078, 0x12d5, 0x1078, 0x5cd4, 0x007c, 0x007e,
- 0x027e, 0xa016, 0x1078, 0x1572, 0x027f, 0x007f, 0x007c, 0xa182,
- 0x0085, 0x0079, 0x66bb, 0x66c4, 0x66c2, 0x66c2, 0x66c2, 0x66c2,
- 0x66c2, 0x66c2, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078,
- 0x48fb, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c,
- 0xa186, 0x0013, 0x00c0, 0x66da, 0x6004, 0xa082, 0x0085, 0x2008,
- 0x0079, 0x670e, 0xa186, 0x0027, 0x00c0, 0x66fb, 0x1078, 0x4c57,
- 0x1078, 0x228f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040,
- 0x66f1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078,
- 0x5d09, 0x0078, 0x66f6, 0xa186, 0x0014, 0x00c0, 0x66f7, 0x1078,
- 0x4c57, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x66f1,
- 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x66ed, 0x6717, 0x6715,
- 0x6715, 0x6715, 0x6715, 0x6715, 0x6720, 0x1078, 0x12d5, 0x1078,
- 0x4c57, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4d50, 0x007c,
- 0x1078, 0x4c57, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4d50,
- 0x007c, 0xa182, 0x008c, 0x00c8, 0x6733, 0xa182, 0x0085, 0x0048,
- 0x6733, 0x0079, 0x6736, 0x1078, 0x5d09, 0x007c, 0x673d, 0x673d,
- 0x673d, 0x673d, 0x673f, 0x675e, 0x673d, 0x1078, 0x12d5, 0x0d7e,
- 0x1078, 0x6b5f, 0x1078, 0x6a03, 0x0040, 0x675a, 0x6010, 0x2068,
- 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x6752, 0x684b, 0x0006,
- 0x0078, 0x6756, 0x684b, 0x0005, 0x1078, 0x6c12, 0x6847, 0x0000,
- 0x1078, 0x3b4c, 0x1078, 0x5cd4, 0x0d7f, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x6779, 0x6837, 0x0103, 0x6850,
- 0xd0b4, 0x0040, 0x676f, 0x684b, 0x0006, 0x0078, 0x6773, 0x684b,
- 0x0005, 0x1078, 0x6c12, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x007c, 0x1078, 0x4c57, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
- 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x6790, 0x0078, 0x6792,
- 0x2009, 0x0100, 0x2130, 0x2069, 0x7c98, 0x831c, 0x2300, 0xad18,
- 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x67ec, 0xa6b2, 0x0020,
- 0x7804, 0xa06d, 0x0040, 0x67a6, 0x1078, 0x1358, 0x1078, 0x132f,
- 0x0040, 0x67d0, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
- 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x67bc, 0x2608, 0xad90, 0x000f,
- 0x1078, 0x67ec, 0x0078, 0x67d0, 0xa6b2, 0x003c, 0x2009, 0x003c,
- 0x2d78, 0xad90, 0x000f, 0x1078, 0x67ec, 0x0078, 0x67a6, 0x0f7f,
- 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x67d5,
- 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
- 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x67ea, 0x6804, 0xa07d, 0x0040,
- 0x67e8, 0x6807, 0x0000, 0x1078, 0x3b4c, 0x2f68, 0x0078, 0x67dd,
- 0x1078, 0x3b4c, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
- 0x67f2, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x67f4, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x601c, 0xa084, 0x000f, 0x1079, 0x6807, 0x127f, 0x007c, 0x6816,
- 0x680f, 0x6811, 0x682f, 0x680f, 0x6811, 0x6811, 0x6811, 0x1078,
- 0x12d5, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x682c, 0xa00e, 0x2001, 0x0005,
- 0x1078, 0x3bdc, 0x1078, 0x6c12, 0x1078, 0x3b4c, 0x1078, 0x5cd4,
- 0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x682a, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6837, 0x007c, 0x6847,
- 0x6864, 0x6849, 0x6875, 0x6860, 0x6847, 0x6811, 0x6816, 0x6816,
- 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x1078,
- 0x12d5, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x6852,
- 0x1078, 0x6c12, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
- 0x0002, 0x1078, 0x48fb, 0x1078, 0x4d50, 0xa085, 0x0001, 0x007c,
- 0x1078, 0x1676, 0x0078, 0x6849, 0x0e7e, 0x2071, 0x7936, 0x7024,
- 0xac06, 0x00c0, 0x686d, 0x1078, 0x57a8, 0x1078, 0x56df, 0x0e7f,
- 0x00c0, 0x6849, 0x1078, 0x6811, 0x007c, 0x037e, 0x0e7e, 0x2071,
- 0x7936, 0x703c, 0xac06, 0x00c0, 0x6885, 0x2019, 0x0000, 0x1078,
- 0x583a, 0x0e7f, 0x037f, 0x0078, 0x6849, 0x1078, 0x5b16, 0x0e7f,
- 0x037f, 0x00c0, 0x6849, 0x1078, 0x6811, 0x007c, 0x0c7e, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x6896, 0x0c7f, 0x007c, 0x68a5, 0x6902,
- 0x69a7, 0x68a9, 0x68a5, 0x68a5, 0x7293, 0x5cd4, 0x6902, 0x1078,
- 0x6b99, 0x00c0, 0x68a5, 0x1078, 0x5f29, 0x007c, 0x6017, 0x0001,
- 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x68b1,
- 0x007c, 0x68c1, 0x68c3, 0x68e3, 0x68f5, 0x68f5, 0x68c1, 0x68a5,
- 0x68a5, 0x68a5, 0x68f5, 0x68f5, 0x68c1, 0x68c1, 0x68c1, 0x68c1,
- 0x68ff, 0x1078, 0x12d5, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5,
- 0x7052, 0x2071, 0x7936, 0x7024, 0xac06, 0x0040, 0x68df, 0x1078,
- 0x56df, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017,
- 0x0014, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0e7f, 0x007c, 0x6017,
- 0x0001, 0x0078, 0x68dd, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5,
- 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
- 0x1078, 0x48fb, 0x1078, 0x4d50, 0x007c, 0x0d7e, 0x6017, 0x0001,
- 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078,
- 0x5cd4, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x690a, 0x007c, 0x691a, 0x68a6, 0x691c, 0x691a, 0x691c, 0x691a,
- 0x691a, 0x691a, 0x689f, 0x689f, 0x691a, 0x691a, 0x691a, 0x691a,
- 0x691a, 0x691a, 0x1078, 0x12d5, 0x0d7e, 0x6018, 0x2068, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12d5, 0x1079,
- 0x692a, 0x007c, 0x6936, 0x6955, 0x6936, 0x6955, 0x6936, 0x6955,
- 0x6938, 0x6941, 0x6936, 0x6955, 0x6936, 0x694e, 0x1078, 0x12d5,
- 0x6004, 0xa08e, 0x0004, 0x0040, 0x6950, 0xa08e, 0x0002, 0x0040,
- 0x6950, 0x6004, 0x1078, 0x6b99, 0x0040, 0x699f, 0xa08e, 0x0021,
- 0x0040, 0x69a3, 0xa08e, 0x0022, 0x0040, 0x699f, 0x1078, 0x228f,
- 0x1078, 0x5f29, 0x1078, 0x5cd4, 0x007c, 0x0c7e, 0x0d7e, 0x6104,
- 0xa186, 0x0016, 0x0040, 0x698f, 0xa186, 0x0002, 0x00c0, 0x697e,
- 0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, 0x697e, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x697e, 0x8001, 0x6842, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x5c6e, 0x0040, 0x697e,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x698f, 0x0d7f, 0x0c7f,
- 0x1078, 0x5f29, 0x1078, 0x228f, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x22b1, 0x127f, 0x0e7f, 0x1078, 0x5cd4, 0x007c, 0x2001,
- 0x0002, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
- 0x4948, 0x1078, 0x4d50, 0x0d7f, 0x0c7f, 0x0078, 0x698e, 0x1078,
- 0x5f29, 0x0078, 0x6952, 0x1078, 0x5f38, 0x0078, 0x6952, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x69af, 0x007c, 0x69bf,
- 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf,
- 0x68a5, 0x69bf, 0x68a6, 0x69c1, 0x68a6, 0x69ca, 0x69bf, 0x1078,
- 0x12d5, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x48fb, 0x1078,
- 0x4d50, 0x007c, 0x1078, 0x6b5f, 0x1078, 0x6a03, 0x0040, 0x69ec,
- 0x1078, 0x228f, 0x0d7e, 0x1078, 0x6a03, 0x0040, 0x69df, 0x6010,
- 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x3b4c, 0x0d7f,
- 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4948,
- 0x1078, 0x4d50, 0x0078, 0x69ee, 0x1078, 0x5cd4, 0x007c, 0xa284,
- 0x0007, 0x00c0, 0x6a00, 0xa282, 0x7e00, 0x0048, 0x6a00, 0x2001,
- 0x7715, 0x2004, 0xa202, 0x00c8, 0x6a00, 0xa085, 0x0001, 0x007c,
- 0xa006, 0x0078, 0x69ff, 0x027e, 0x0e7e, 0x2071, 0x7700, 0x6210,
- 0x7058, 0xa202, 0x0048, 0x6a15, 0x705c, 0xa202, 0x00c8, 0x6a15,
- 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078, 0x6a12,
- 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2061,
- 0x7e00, 0x2071, 0x7700, 0x7344, 0x7060, 0xa302, 0x00c8, 0x6a3e,
- 0x601c, 0xa206, 0x00c0, 0x6a36, 0x1078, 0x6b99, 0x00c0, 0x6a32,
- 0x1078, 0x5f29, 0x0c7e, 0x1078, 0x5cd4, 0x0c7f, 0xace0, 0x0008,
- 0x7054, 0xac02, 0x00c8, 0x6a3e, 0x0078, 0x6a23, 0x127f, 0x007f,
- 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e,
- 0x2091, 0x8000, 0xa188, 0x7820, 0x210c, 0x81ff, 0x0040, 0x6a6b,
- 0x2061, 0x7e00, 0x2071, 0x7700, 0x7344, 0x7060, 0xa302, 0x00c8,
- 0x6a6b, 0x6018, 0xa106, 0x00c0, 0x6a65, 0x1078, 0x228f, 0x017e,
- 0x0c7e, 0x1078, 0x5cd4, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x0048, 0x6a59, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e,
- 0x057f, 0x0040, 0x6a89, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
- 0x004b, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6a85, 0x0c7e, 0x057e, 0x127e, 0x2091,
- 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5c6e, 0x057f, 0x0040, 0x6ab3,
- 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
- 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078,
- 0x7431, 0x2009, 0x004c, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f,
- 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6aaf, 0x0c7e, 0x057e,
- 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5c6e, 0x057f,
- 0x0040, 0x6ade, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
- 0x0c7e, 0x2560, 0x1078, 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x2009, 0x004d, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x6ada, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
- 0x1078, 0x5c6e, 0x057f, 0x0040, 0x6b09, 0x6612, 0x651a, 0x601f,
- 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x39f0, 0x0c7f,
- 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078, 0x7431, 0x2009,
- 0x004e, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6b05, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x6b25, 0x660a, 0x611a,
- 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6b22,
- 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e, 0x017f,
- 0x0040, 0x6b41, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012,
- 0x2009, 0x0021, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6b3e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x6b5c, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5cfb, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6b59, 0x027e,
- 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6b69, 0x8211,
- 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007,
- 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x7752,
- 0x2634, 0xd6e4, 0x0040, 0x6b81, 0x6618, 0x2660, 0x6e48, 0x1078,
- 0x38fc, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e, 0x6004,
- 0xa08e, 0x0002, 0x0040, 0x6b96, 0xa08e, 0x0003, 0x0040, 0x6b96,
- 0xa08e, 0x0004, 0x0040, 0x6b96, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040, 0x6bae,
- 0xa08e, 0x001f, 0x0040, 0x6bae, 0xa08e, 0x0028, 0x0040, 0x6bae,
- 0xa08e, 0x0029, 0x0040, 0x6bae, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e,
- 0x017f, 0x0040, 0x6bcb, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
- 0x1078, 0x228f, 0x2009, 0x0028, 0x1078, 0x5cfb, 0xa085, 0x0001,
- 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6bc8, 0xa186, 0x0015,
- 0x00c0, 0x6be3, 0x2011, 0x771e, 0x2204, 0xa086, 0x0074, 0x00c0,
- 0x6be3, 0x1078, 0x6199, 0x6003, 0x0001, 0x6007, 0x0029, 0x1078,
- 0x4948, 0x0078, 0x6be7, 0x1078, 0x5f29, 0x1078, 0x5cd4, 0x007c,
- 0xa186, 0x0015, 0x00c0, 0x6c05, 0x2011, 0x771e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x6c05, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3882,
- 0x0d7f, 0x1078, 0x61a3, 0x00c0, 0x6c05, 0x2001, 0x0006, 0x1078,
- 0x37ae, 0x1078, 0x5d7f, 0x0078, 0x6c09, 0x1078, 0x5f29, 0x1078,
- 0x5cd4, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x6c11, 0x1078,
- 0x6c12, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6c20, 0x067f, 0x007c,
- 0x6c30, 0x6e07, 0x6ee8, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30,
- 0x6c6a, 0x6f56, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30,
- 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5,
- 0x1079, 0x6c3c, 0x067f, 0x007c, 0x6c4c, 0x7242, 0x6c4c, 0x6c4c,
- 0x6c4c, 0x6c4c, 0x6c4c, 0x6c4c, 0x721d, 0x728c, 0x6c4c, 0x6c4c,
- 0x6c4c, 0x6c4c, 0x6c4c, 0x6c4c, 0x1078, 0x12d5, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6c58, 0x067f, 0x007c,
- 0x6c68, 0x708e, 0x7100, 0x7122, 0x716e, 0x6c68, 0x6c68, 0x71c8,
- 0x6f62, 0x7205, 0x7209, 0x6c68, 0x6c68, 0x6c68, 0x6c68, 0x6c68,
- 0x1078, 0x12d5, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x2100, 0x0079,
- 0x6c71, 0x6ca1, 0x6d7e, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca3, 0x6cd2, 0x6cdd, 0x6d05, 0x6d0b, 0x6d3f, 0x6d77, 0x6ca1,
- 0x6ca1, 0x6d86, 0x6ca1, 0x6ca1, 0x6d8d, 0x6d94, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6db1, 0x6ca1, 0x6ca1, 0x6dbc, 0x6ca1,
- 0x6ca1, 0x1078, 0x12d5, 0x1078, 0x3af8, 0x6618, 0x0c7e, 0x2660,
- 0x1078, 0x3818, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
- 0xa082, 0x0006, 0x0048, 0x6cc4, 0x1078, 0x736d, 0x00c0, 0x6cff,
- 0x1078, 0x730b, 0x00c0, 0x6cc0, 0x6007, 0x0008, 0x0078, 0x6d79,
- 0x6007, 0x0009, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6cce,
- 0x1078, 0x736d, 0x0040, 0x6cb8, 0x0078, 0x6cff, 0x6013, 0x1900,
- 0x0078, 0x6cc0, 0x6106, 0x1078, 0x72cd, 0x6007, 0x0006, 0x0078,
- 0x6d79, 0x6007, 0x0007, 0x0078, 0x6d79, 0x0d7e, 0x6618, 0x2668,
- 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6cef,
- 0xa686, 0x0004, 0x0040, 0x6cef, 0x0d7f, 0x0078, 0x6cff, 0x1078,
- 0x73cb, 0x00c0, 0x6cfa, 0x1078, 0x3882, 0x6007, 0x000a, 0x0d7f,
- 0x0078, 0x6d79, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x6d79, 0x1078,
- 0x228f, 0x6007, 0x0001, 0x0078, 0x6d79, 0x1078, 0x228f, 0x6007,
- 0x000c, 0x0078, 0x6d79, 0x1078, 0x3af8, 0x6618, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x6d2c, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6cff, 0x1078, 0x73da,
- 0x00c0, 0x6d26, 0x6007, 0x000e, 0x0078, 0x6d79, 0x1078, 0x228f,
- 0x6007, 0x000f, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6d39,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6d1e, 0x0078,
- 0x6cff, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6d79, 0x1078,
- 0x3af8, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082,
- 0x0006, 0x0048, 0x6d64, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x00c0, 0x6cff, 0x1078, 0x7405, 0x00c0, 0x6d5e, 0x1078, 0x730b,
- 0x00c0, 0x6d5e, 0x6007, 0x0010, 0x0078, 0x6d79, 0x1078, 0x228f,
- 0x6007, 0x0011, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6d71,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6d52, 0x0078,
- 0x6cff, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6d79, 0x6007,
- 0x0012, 0x6003, 0x0001, 0x1078, 0x4948, 0x007c, 0x6007, 0x0001,
- 0x6003, 0x0001, 0x1078, 0x4948, 0x0078, 0x6d7d, 0x6007, 0x0020,
- 0x6003, 0x0001, 0x1078, 0x4948, 0x007c, 0x6007, 0x0023, 0x6003,
- 0x0001, 0x1078, 0x4948, 0x007c, 0x017e, 0x027e, 0x2011, 0x7c88,
- 0x2214, 0x2c08, 0x1078, 0x75ca, 0x00c0, 0x6da5, 0x2160, 0x6007,
- 0x0026, 0x6013, 0x1700, 0x0078, 0x6daa, 0x1078, 0x5cd4, 0x2160,
- 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4948, 0x027f, 0x017f,
- 0x007c, 0x6106, 0x1078, 0x6dc3, 0x6007, 0x002b, 0x0078, 0x6d79,
- 0x6007, 0x002c, 0x0078, 0x6d79, 0x6106, 0x1078, 0x6dc8, 0x6007,
- 0x002e, 0x0078, 0x6d79, 0x0d7e, 0x1078, 0x6dee, 0x0d7f, 0x007c,
- 0x0d7e, 0x1078, 0x6dfd, 0x00c0, 0x6de7, 0x680c, 0xa08c, 0xff00,
- 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6ddc,
- 0x2009, 0x0001, 0x0078, 0x6de3, 0xd1ec, 0x0040, 0x6de7, 0x2009,
- 0x0000, 0xa294, 0x00ff, 0x1078, 0x22d3, 0x0078, 0x6deb, 0xa085,
- 0x0001, 0x0078, 0x6dec, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x7c8d,
- 0x6800, 0xa082, 0x0010, 0x00c8, 0x6dfb, 0x6013, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x6dfc, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
- 0x7c8c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
- 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6, 0x0013, 0x00c0, 0x6e13,
- 0x2008, 0x0079, 0x6e26, 0xa1b6, 0x0027, 0x0040, 0x6e1b, 0xa1b6,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078,
- 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0x6e56, 0x6e58,
- 0x6e56, 0x6e56, 0x6e56, 0x6e58, 0x6e60, 0x6ec3, 0x6e86, 0x6ec3,
- 0x6e9a, 0x6ec3, 0x6e60, 0x6ec3, 0x6ebb, 0x6ec3, 0x6ebb, 0x6ec3,
- 0x6ec3, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6ec3, 0x6e56,
- 0x6e56, 0x6ec3, 0x6e56, 0x6ec3, 0x6ec3, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6ec3, 0x6ec3, 0x6e56, 0x6ec3, 0x6ec3, 0x1078, 0x12d5,
- 0x1078, 0x4c57, 0x6003, 0x0002, 0x1078, 0x4d50, 0x0078, 0x6ec9,
- 0x0f7e, 0x2079, 0x7751, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6ec3,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae,
- 0x1078, 0x4c57, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
- 0x1078, 0x4948, 0x1078, 0x4d50, 0x0c7e, 0x6118, 0x2160, 0x2009,
- 0x0001, 0x1078, 0x4650, 0x0c7f, 0x0078, 0x6ec9, 0x6618, 0x0d7e,
- 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6ec3, 0xa686, 0x0004, 0x0040, 0x6ec3, 0x2001, 0x0004,
- 0x0078, 0x6ec1, 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x6ea3, 0x1078, 0x2d9e, 0x2001, 0x0006, 0x1078, 0x6eca, 0x6618,
- 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x6ec3, 0x2001, 0x0006, 0x0078, 0x6ec1, 0x2001,
- 0x0004, 0x0078, 0x6ec1, 0x2001, 0x0006, 0x1078, 0x6eca, 0x0078,
- 0x6ec3, 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078, 0x5cd4, 0x1078,
- 0x4d50, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
- 0x0040, 0x6ee5, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6edd, 0x699c,
- 0xd1a4, 0x00c0, 0x6edd, 0x2001, 0x0007, 0x1078, 0x37ae, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x1078, 0x22b1, 0x0d7f, 0x017f, 0x007c,
- 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0xa1b6, 0x0015, 0x00c0, 0x6efc,
- 0x1079, 0x6f03, 0x0078, 0x6f02, 0xa1b6, 0x0016, 0x10c0, 0x12d5,
- 0x1079, 0x6f3b, 0x007c, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x5fb3, 0x5fb3, 0x6f0f, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x0f7e,
- 0x2079, 0x7751, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6f2b, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x601f,
- 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4948, 0x1078,
- 0x4d50, 0x0078, 0x6f3a, 0x2011, 0x7c83, 0x220c, 0x017e, 0x0c7e,
- 0x1078, 0x3806, 0x00c0, 0x6f3a, 0x1078, 0x35f9, 0x0c7f, 0x017f,
- 0x1078, 0x5cd4, 0x007c, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x5fb3, 0x5fb3, 0x6f47, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x1078,
- 0x6196, 0x00c0, 0x6f53, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
- 0x4948, 0x0078, 0x6f55, 0x1078, 0x5cd4, 0x007c, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x12d5, 0x1078, 0x4c57, 0x1078, 0x6b6c, 0x1078,
- 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x6f66, 0x6f76, 0x6f76,
- 0x6f76, 0x6f76, 0x6f78, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76,
- 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x1078, 0x12d5,
- 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, 0x027e, 0x6106, 0x2071,
- 0x7c80, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6fdc, 0x2009, 0x0000,
- 0x0c7e, 0x1078, 0x46e1, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001,
- 0x0040, 0x7047, 0x1078, 0x47a0, 0x0040, 0x7072, 0xa295, 0x0200,
- 0x6a02, 0x0078, 0x6fa1, 0x2009, 0x0001, 0x2011, 0x0200, 0x1078,
- 0x478a, 0x1078, 0x132f, 0x1040, 0x12d5, 0x6003, 0x0007, 0x2d00,
- 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00,
- 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x694a, 0xa084,
- 0xff00, 0x6846, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x3b4c,
- 0xa486, 0x2000, 0x00c0, 0x6fca, 0x2019, 0x0017, 0x1078, 0x758f,
- 0x0078, 0x7034, 0xa486, 0x0400, 0x00c0, 0x6fd4, 0x2019, 0x0002,
- 0x1078, 0x758f, 0x0078, 0x7034, 0xa486, 0x0200, 0x00c0, 0x6fda,
- 0x1078, 0x7580, 0x0078, 0x7034, 0x2009, 0x0000, 0x0c7e, 0x1078,
- 0x46e1, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x708a,
- 0xa284, 0x0300, 0x00c0, 0x7082, 0x6804, 0xa005, 0x0040, 0x7072,
- 0x8001, 0x6806, 0x6003, 0x0007, 0x1078, 0x1314, 0x0040, 0x703b,
- 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000,
- 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x6986,
- 0x6846, 0x6853, 0x003d, 0x7044, 0xa084, 0x0003, 0xa086, 0x0002,
- 0x00c0, 0x7016, 0x684f, 0x0040, 0x0078, 0x7020, 0xa086, 0x0001,
- 0x00c0, 0x701e, 0x684f, 0x0080, 0x0078, 0x7020, 0x684f, 0x0000,
- 0x20a9, 0x000a, 0x2001, 0x7c90, 0xad90, 0x0015, 0x200c, 0x810f,
- 0x2112, 0x8000, 0x8210, 0x00f0, 0x7026, 0x200c, 0x6982, 0x8000,
- 0x200c, 0x697e, 0x1078, 0x3b4c, 0x027f, 0x047f, 0x157f, 0x0f7f,
- 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0078, 0x7034, 0x2069,
- 0x7c92, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0, 0x7066,
- 0x2069, 0x7c80, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c,
- 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007, 0x0043,
- 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0078, 0x7034, 0x6013, 0x0200,
- 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50,
- 0x0078, 0x7034, 0x6013, 0x0300, 0x0078, 0x7078, 0x6013, 0x0100,
- 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50,
- 0x0078, 0x7034, 0x6013, 0x0500, 0x0078, 0x7078, 0x6013, 0x0600,
- 0x0078, 0x7047, 0x6013, 0x0200, 0x0078, 0x7047, 0xa186, 0x0013,
- 0x00c0, 0x70a0, 0x6004, 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a,
- 0x0050, 0x10c8, 0x12d5, 0xa082, 0x0040, 0x2008, 0x0079, 0x70d1,
- 0xa186, 0x0047, 0x00c0, 0x70a6, 0x0078, 0x7100, 0xa186, 0x0027,
- 0x0040, 0x70ae, 0xa186, 0x0014, 0x10c0, 0x12d5, 0x6004, 0xa082,
- 0x0040, 0x2008, 0x0079, 0x70b4, 0x70c4, 0x70c6, 0x70c6, 0x70c4,
- 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4,
- 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x1078, 0x12d5, 0x2001, 0x0007,
- 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50,
- 0x007c, 0x70e1, 0x70f1, 0x70ea, 0x70fa, 0x70e1, 0x70e1, 0x70e1,
- 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1,
- 0x70e1, 0x1078, 0x12d5, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085,
- 0x0400, 0x200a, 0x1078, 0x4c57, 0x6003, 0x0002, 0x1078, 0x4d50,
- 0x007c, 0x1078, 0x4c57, 0x1078, 0x4762, 0x1078, 0x5cd4, 0x1078,
- 0x4d50, 0x007c, 0x1078, 0x4c57, 0x2009, 0x0041, 0x0078, 0x71c8,
- 0xa182, 0x0040, 0x0079, 0x7104, 0x7114, 0x7116, 0x7114, 0x7114,
- 0x7114, 0x7114, 0x7114, 0x7117, 0x7114, 0x7114, 0x7114, 0x7114,
- 0x7114, 0x7114, 0x7114, 0x7114, 0x1078, 0x12d5, 0x007c, 0x6003,
- 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
- 0x1572, 0x007c, 0xa182, 0x0040, 0x0079, 0x7126, 0x7136, 0x7136,
- 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7138,
- 0x715b, 0x7136, 0x7136, 0x7136, 0x7136, 0x715b, 0x1078, 0x12d5,
- 0x1078, 0x4cff, 0x1078, 0x4e10, 0x6010, 0x0d7e, 0x2068, 0x684c,
- 0xd0fc, 0x0040, 0x714e, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040,
- 0x7154, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x71c8, 0x6003, 0x0007,
- 0x1078, 0x4762, 0x0d7f, 0x007c, 0x1078, 0x4762, 0x1078, 0x5cd4,
- 0x0d7f, 0x0078, 0x7153, 0x037e, 0x1078, 0x4cff, 0x1078, 0x4e10,
- 0x6010, 0x0d7e, 0x2068, 0x2019, 0x0004, 0x1078, 0x75b3, 0x1078,
- 0x6b6c, 0x6017, 0x0028, 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013,
- 0x00c0, 0x717c, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12d5, 0x1078,
- 0x4c57, 0x1078, 0x4d50, 0x007c, 0xa186, 0x0027, 0x0040, 0x7184,
- 0xa186, 0x0014, 0x00c0, 0x7194, 0x6004, 0xa086, 0x0042, 0x10c0,
- 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078,
- 0x6b6c, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x7198,
- 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71aa,
- 0x71b6, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8,
- 0x1078, 0x12d5, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20,
- 0x2c10, 0x1078, 0x1572, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e,
- 0x2068, 0x684c, 0xd0fc, 0x0040, 0x71c2, 0x2009, 0x0041, 0x0d7f,
- 0x0078, 0x71c8, 0x6003, 0x0007, 0x1078, 0x4762, 0x0d7f, 0x007c,
- 0xa182, 0x0040, 0x0079, 0x71cc, 0x71dc, 0x71de, 0x71ea, 0x71f6,
- 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc,
- 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x1078, 0x12d5, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x48fb, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x48fb, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0x6003, 0x0003,
- 0x6106, 0x2c10, 0x1078, 0x19a7, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4967, 0x1078, 0x4e10, 0x127f, 0x007c, 0x1078, 0x4c57, 0x0078,
- 0x720b, 0x1078, 0x4cff, 0x6110, 0x81ff, 0x0040, 0x7218, 0x0d7e,
- 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x75b3, 0x037f, 0x0d7f,
- 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0085, 0x0079,
- 0x7221, 0x7228, 0x7228, 0x7228, 0x722a, 0x7228, 0x7228, 0x7228,
- 0x1078, 0x12d5, 0x027e, 0x0e7e, 0x2071, 0x7c80, 0x7220, 0x1078,
- 0x74cd, 0x0040, 0x7237, 0x6007, 0x0086, 0x0078, 0x7239, 0x6007,
- 0x0087, 0x6003, 0x0001, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0e7f,
- 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7253, 0x6004, 0xa08a,
- 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8, 0x12d5, 0xa082,
- 0x0085, 0x0079, 0x7266, 0xa186, 0x0027, 0x0040, 0x725b, 0xa186,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078,
- 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0x726d, 0x726f,
- 0x726f, 0x726d, 0x726d, 0x726d, 0x726d, 0x1078, 0x12d5, 0x1078,
- 0x4c57, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0085,
- 0x1048, 0x12d5, 0xa182, 0x008c, 0x10c8, 0x12d5, 0xa182, 0x0085,
- 0x0079, 0x7282, 0x7289, 0x7289, 0x7289, 0x728b, 0x7289, 0x7289,
- 0x7289, 0x1078, 0x12d5, 0x007c, 0x1078, 0x4c57, 0x1078, 0x6b6c,
- 0x1078, 0x4d50, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078, 0x729c,
- 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e, 0x2091,
- 0x8000, 0x2c40, 0x1078, 0x59e7, 0x00c0, 0x72c9, 0x1078, 0x5a88,
- 0x00c0, 0x72c9, 0x6000, 0xa086, 0x0000, 0x0040, 0x72c9, 0x601c,
- 0xa086, 0x0007, 0x0040, 0x72c9, 0x0d7e, 0x6000, 0xa086, 0x0004,
- 0x00c0, 0x72bc, 0x1078, 0x1676, 0x6010, 0x2068, 0x1078, 0x6a03,
- 0x0040, 0x72c4, 0x1078, 0x75b3, 0x0d7f, 0x6013, 0x0000, 0x601f,
- 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e,
- 0x157e, 0x2079, 0x7c80, 0x7838, 0xa08c, 0x00ff, 0x783c, 0x1078,
- 0x2059, 0x00c0, 0x7304, 0x017e, 0x0c7e, 0x1078, 0x3806, 0x00c0,
- 0x7304, 0x2011, 0x7c90, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x622f, 0x00c0, 0x7304, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019,
- 0x0029, 0x1078, 0x5b5c, 0x1078, 0x4a38, 0x1078, 0x497b, 0x017f,
- 0x1078, 0x7431, 0x1078, 0x39f0, 0x017f, 0x1078, 0x35f9, 0x6612,
- 0x6516, 0xa006, 0x0078, 0x7306, 0x0c7f, 0x017f, 0x157f, 0x037f,
- 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x771e,
- 0x2104, 0xa086, 0x0074, 0x00c0, 0x7362, 0x2069, 0x7c8e, 0x690c,
- 0xa182, 0x0100, 0x0048, 0x7352, 0x6908, 0xa184, 0x8000, 0x0040,
- 0x735e, 0xa184, 0x0800, 0x0040, 0x735e, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x7356, 0x6914, 0x2069, 0x7cae, 0x6904, 0x81ff, 0x00c0,
- 0x734a, 0x690c, 0xa182, 0x0100, 0x0048, 0x7352, 0x6908, 0x81ff,
- 0x00c0, 0x734e, 0x6910, 0xa18a, 0x0001, 0x0048, 0x7356, 0x6918,
- 0xa18a, 0x0001, 0x0048, 0x735e, 0x0078, 0x7368, 0x6013, 0x0100,
- 0x0078, 0x7364, 0x6013, 0x0300, 0x0078, 0x7364, 0x6013, 0x0500,
- 0x0078, 0x7364, 0x6013, 0x0700, 0x0078, 0x7364, 0x6013, 0x0900,
- 0x0078, 0x7364, 0x6013, 0x0b00, 0x0078, 0x7364, 0x6013, 0x0f00,
- 0x0078, 0x7364, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x7369,
- 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
- 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
- 0x0006, 0x0040, 0x7391, 0xa286, 0x0004, 0x0040, 0x7391, 0xa394,
- 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x7391, 0xa286, 0x0004,
- 0x0040, 0x7391, 0x0c7e, 0x2d60, 0x1078, 0x3818, 0x0c7f, 0x0078,
- 0x73c4, 0x2011, 0x7c96, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x622f, 0x00c0, 0x73c5, 0x2011, 0x7c9a, 0xad98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x622f, 0x00c0, 0x73c5, 0x047e, 0x017e, 0x6aa0,
- 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x7752, 0x210c, 0xd1a4,
- 0x0040, 0x73b9, 0x2009, 0x0029, 0x1078, 0x75f7, 0x6800, 0xc0e5,
- 0x6802, 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08,
- 0x1078, 0x7431, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
- 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x7c8e, 0x6800, 0xa086,
- 0x0800, 0x0040, 0x73d7, 0x6013, 0x0000, 0x0078, 0x73d8, 0xa006,
- 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2079, 0x7c8c, 0x7930, 0x7834, 0x1078, 0x2059, 0x00c0, 0x73fe,
- 0x1078, 0x3806, 0x00c0, 0x73fe, 0x2011, 0x7c90, 0xac98, 0x000a,
- 0x20a9, 0x0004, 0x1078, 0x622f, 0x00c0, 0x73fe, 0x2011, 0x7c94,
- 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x622f, 0x157f, 0x037f,
- 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e,
- 0x027e, 0x037e, 0x157e, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c,
- 0x1078, 0x2059, 0x00c0, 0x742a, 0x1078, 0x3806, 0x00c0, 0x742a,
- 0x2011, 0x7c96, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x622f,
- 0x00c0, 0x742a, 0x2011, 0x7c9a, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x622f, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f,
- 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x793f, 0x252c, 0x2021, 0x7945,
- 0x2424, 0x2061, 0x7e00, 0x2071, 0x7700, 0x7644, 0x7060, 0x8001,
- 0xa602, 0x00c8, 0x7496, 0x2100, 0xac06, 0x0040, 0x748c, 0x1078,
- 0x760f, 0x0040, 0x748c, 0x671c, 0xa786, 0x0001, 0x0040, 0x74ab,
- 0xa786, 0x0007, 0x0040, 0x748c, 0x2500, 0xac06, 0x0040, 0x748c,
- 0x2400, 0xac06, 0x0040, 0x748c, 0x1078, 0x7623, 0x00c0, 0x748c,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x7472, 0x017e, 0x1078,
- 0x1676, 0x017f, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x7489,
- 0xa786, 0x0003, 0x00c0, 0x749f, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x017e, 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x017f, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x6b6c, 0xace0, 0x0008, 0x2001, 0x7715,
- 0x2004, 0xac02, 0x00c8, 0x7496, 0x0078, 0x7443, 0x127f, 0x027f,
- 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x747c, 0xa386, 0x0005, 0x0040, 0x748c, 0x1078,
- 0x75b3, 0x0078, 0x7489, 0x1078, 0x7623, 0x00c0, 0x748c, 0xa180,
- 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x748c, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x748c, 0x1078, 0x6b85, 0x0040, 0x74c7, 0x1078,
- 0x6b99, 0x00c0, 0x748c, 0x1078, 0x5f29, 0x0078, 0x74c9, 0x1078,
- 0x22b1, 0x1078, 0x6b6c, 0x0078, 0x748c, 0x0c7e, 0x0e7e, 0x017e,
- 0x2c08, 0x2170, 0x1078, 0x75ca, 0x017f, 0x0040, 0x74dc, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x74df, 0x0e7f, 0x0c7f, 0x007c, 0x74e7,
- 0x74e7, 0x74e7, 0x74e7, 0x74e7, 0x74e7, 0x74e9, 0x74e7, 0xa006,
- 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4,
- 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x75f7, 0x017f,
- 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x729c, 0x037f, 0xa085,
- 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x379a, 0x157e, 0x017e,
- 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x7705, 0x2011, 0x7c96,
- 0x1078, 0x622f, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
- 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7e00, 0x2079, 0x0001, 0x8fff, 0x0040, 0x7573,
- 0x2071, 0x7700, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x7573,
- 0x88ff, 0x0040, 0x7539, 0x2800, 0xac06, 0x00c0, 0x7569, 0x2079,
- 0x0000, 0x1078, 0x760f, 0x0040, 0x7569, 0x2400, 0xac06, 0x0040,
- 0x7569, 0x671c, 0xa786, 0x0006, 0x00c0, 0x7569, 0xa786, 0x0007,
- 0x0040, 0x7569, 0x88ff, 0x00c0, 0x7551, 0x6018, 0xa206, 0x00c0,
- 0x7569, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x7559, 0x1078,
- 0x1676, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x7563, 0x047e,
- 0x1078, 0x75b3, 0x047f, 0x0d7f, 0x1078, 0x6b6c, 0x88ff, 0x00c0,
- 0x757c, 0xace0, 0x0008, 0x2001, 0x7715, 0x2004, 0xac02, 0x00c8,
- 0x7573, 0x0078, 0x7525, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x7574,
- 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
- 0x59e7, 0x1078, 0x5a88, 0x1078, 0x7518, 0x087f, 0x007c, 0x027e,
- 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x037e, 0x1078, 0x3806, 0x00c0, 0x75a8, 0x2c10,
- 0x2041, 0x0000, 0x1078, 0x59e7, 0x1078, 0x5a88, 0x1078, 0x7518,
- 0x037f, 0x017f, 0x8108, 0x00f0, 0x7599, 0x157f, 0x0c7f, 0x087f,
- 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x75c7,
- 0x6800, 0xa07d, 0x0040, 0x75c4, 0x6803, 0x0000, 0x6b52, 0x1078,
- 0x3b4c, 0x2f68, 0x0078, 0x75b8, 0x6b52, 0x1078, 0x3b4c, 0x0f7f,
- 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7e00, 0x2071,
- 0x7700, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x75f2, 0x2100,
- 0xac06, 0x0040, 0x75e4, 0x6000, 0xa086, 0x0000, 0x0040, 0x75e4,
- 0x6008, 0xa206, 0x0040, 0x75ee, 0xace0, 0x0008, 0x2001, 0x7715,
- 0x2004, 0xac02, 0x00c8, 0x75f2, 0x0078, 0x75cf, 0xa085, 0x0001,
- 0x0078, 0x75f3, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
- 0x007e, 0x1078, 0x132f, 0x007f, 0x1040, 0x12d5, 0x6837, 0x010d,
- 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
- 0x6c46, 0x684f, 0x0000, 0x1078, 0x3b4c, 0x0d7f, 0x007c, 0x6700,
- 0xa786, 0x0000, 0x0040, 0x7622, 0xa786, 0x0001, 0x0040, 0x7622,
- 0xa786, 0x000a, 0x0040, 0x7622, 0xa786, 0x0009, 0x0040, 0x7622,
- 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206,
- 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
- 0x7740, 0xd5a4, 0x0040, 0x7637, 0x7034, 0x8000, 0x7036, 0xd5b4,
- 0x0040, 0x763d, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7644,
- 0x2071, 0x774a, 0x1078, 0x7673, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7740, 0xd5a4,
- 0x0040, 0x7655, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x765b,
- 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7662, 0x2071, 0x774a,
- 0x1078, 0x7673, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e,
- 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7742, 0x1078, 0x7673, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, 0x767c,
- 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7740,
- 0x1078, 0x7673, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7744, 0x1078,
- 0x7673, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010,
- 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000,
- 0x2000, 0x4000, 0x8000, 0xb2be
+ 0x2011, 0x7383, 0x2204, 0x1078, 0x1fb0, 0x1078, 0x3497, 0x00c0,
+ 0x6bc3, 0x2011, 0x7396, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a15, 0x00c0, 0x6bc3, 0x2011, 0x739a, 0xac98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x5a15, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f,
+ 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e,
+ 0x027e, 0x127e, 0x2091, 0x8000, 0x2029, 0x70bf, 0x252c, 0x2021,
+ 0x70c5, 0x2424, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7644, 0x7060,
+ 0x8001, 0xa602, 0x00c8, 0x6c2f, 0x2100, 0xac06, 0x0040, 0x6c25,
+ 0x1078, 0x6da8, 0x0040, 0x6c25, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x6c44, 0xa786, 0x0007, 0x0040, 0x6c25, 0x2500, 0xac06, 0x0040,
+ 0x6c25, 0x2400, 0xac06, 0x0040, 0x6c25, 0x1078, 0x6dbc, 0x00c0,
+ 0x6c25, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6c0b, 0x017e,
+ 0x1078, 0x1627, 0x017f, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040,
+ 0x6c22, 0xa786, 0x0003, 0x00c0, 0x6c38, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x017e, 0x1078, 0x639b, 0x1078, 0x36ec, 0x017f,
+ 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x62fd, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6c2f, 0x0078, 0x6bdc, 0x127f,
+ 0x027f, 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c,
+ 0xa786, 0x0006, 0x00c0, 0x6c15, 0xa386, 0x0005, 0x0040, 0x6c25,
+ 0x1078, 0x6d4c, 0x0078, 0x6c22, 0x1078, 0x6dbc, 0x00c0, 0x6c25,
+ 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x6c25, 0x6000,
+ 0xa086, 0x0002, 0x00c0, 0x6c25, 0x1078, 0x6316, 0x0040, 0x6c60,
+ 0x1078, 0x632a, 0x00c0, 0x6c25, 0x1078, 0x579c, 0x0078, 0x6c62,
+ 0x1078, 0x2192, 0x1078, 0x62fd, 0x0078, 0x6c25, 0x0c7e, 0x0e7e,
+ 0x017e, 0x2c08, 0x2170, 0x1078, 0x6d63, 0x017f, 0x0040, 0x6c75,
+ 0x601c, 0xa084, 0x0007, 0x1079, 0x6c78, 0x0e7f, 0x0c7f, 0x007c,
+ 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c82, 0x6c80,
+ 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024,
+ 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x6d90,
+ 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x6a39, 0x037f,
+ 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x342f, 0x157e,
+ 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x6f05, 0x2011,
+ 0x7396, 0x1078, 0x5a15, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x7500, 0x2079, 0x0001, 0x8fff, 0x0040,
+ 0x6d0c, 0x2071, 0x6f00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8,
+ 0x6d0c, 0x88ff, 0x0040, 0x6cd2, 0x2800, 0xac06, 0x00c0, 0x6d02,
+ 0x2079, 0x0000, 0x1078, 0x6da8, 0x0040, 0x6d02, 0x2400, 0xac06,
+ 0x0040, 0x6d02, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6d02, 0xa786,
+ 0x0007, 0x0040, 0x6d02, 0x88ff, 0x00c0, 0x6cea, 0x6018, 0xa206,
+ 0x00c0, 0x6d02, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6cf2,
+ 0x1078, 0x1627, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6cfc,
+ 0x047e, 0x1078, 0x6d4c, 0x047f, 0x0d7f, 0x1078, 0x62fd, 0x88ff,
+ 0x00c0, 0x6d15, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02,
+ 0x00c8, 0x6d0c, 0x0078, 0x6cbe, 0xa006, 0x127f, 0x027f, 0x067f,
+ 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078,
+ 0x6d0d, 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218,
+ 0x1078, 0x52b4, 0x1078, 0x5355, 0x1078, 0x6cb1, 0x087f, 0x007c,
+ 0x027e, 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x3497, 0x00c0, 0x6d41,
+ 0x2c10, 0x2041, 0x0000, 0x1078, 0x52b4, 0x1078, 0x5355, 0x1078,
+ 0x6cb1, 0x037f, 0x017f, 0x8108, 0x00f0, 0x6d32, 0x157f, 0x0c7f,
+ 0x087f, 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040,
+ 0x6d60, 0x6800, 0xa07d, 0x0040, 0x6d5d, 0x6803, 0x0000, 0x6b52,
+ 0x1078, 0x36ec, 0x2f68, 0x0078, 0x6d51, 0x6b52, 0x1078, 0x36ec,
+ 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7500,
+ 0x2071, 0x6f00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6d8b,
+ 0x2100, 0xac06, 0x0040, 0x6d7d, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x6d7d, 0x6008, 0xa206, 0x0040, 0x6d87, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6d8b, 0x0078, 0x6d68, 0xa085,
+ 0x0001, 0x0078, 0x6d8c, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c,
+ 0x0d7e, 0x007e, 0x1078, 0x12e0, 0x007f, 0x1040, 0x1286, 0x6837,
+ 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e,
+ 0x6956, 0x6c46, 0x684f, 0x0000, 0x1078, 0x36ec, 0x0d7f, 0x007c,
+ 0x6700, 0xa786, 0x0000, 0x0040, 0x6dbb, 0xa786, 0x0001, 0x0040,
+ 0x6dbb, 0xa786, 0x000a, 0x0040, 0x6dbb, 0xa786, 0x0009, 0x0040,
+ 0x6dbb, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0,
+ 0xa206, 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6f40, 0xd5a4, 0x0040, 0x6dd0, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6dd6, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6ddd, 0x2071, 0x6f4a, 0x1078, 0x6e0c, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f40,
+ 0xd5a4, 0x0040, 0x6dee, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040,
+ 0x6df4, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6dfb, 0x2071,
+ 0x6f4a, 0x1078, 0x6e0c, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e,
+ 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f42, 0x1078, 0x6e0c,
+ 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8,
+ 0x6e15, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071,
+ 0x6f40, 0x1078, 0x6e0c, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6f44,
+ 0x1078, 0x6e0c, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800,
+ 0x1000, 0x2000, 0x4000, 0x8000, 0x40d5
};
-#define ISP2100_CODE_LENGTH 0x669c
+#define ISP2100_CODE_LENGTH 0x5e35
#endif
diff --git a/sys/dev/isp/asm_sbus.h b/sys/dev/isp/asm_sbus.h
index b5df5f5d2403..d81f3b9e4d84 100644
--- a/sys/dev/isp/asm_sbus.h
+++ b/sys/dev/isp/asm_sbus.h
@@ -1,14 +1,45 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: asm_sbus.h,v 1.2 1998/04/14 17:43:24 mjacob Exp $ */
/*
* SBus Qlogic Host Adapter Firmware Tables
- * Copyright (c) 1996, 1997, 1998 by Qlogic Corporation
*
+ *---------------------------------------
+ * Copyright (c) 1997, 1998 by Matthew Jacob
+ * NASA/Ames Research Center
+ * 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 immediately at the beginning of the file, without modification,
+ * 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.
+ *
+ * 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.
+ */
+
+/*
* Version 1.24 Initiator Firmware (Aug 8, 1996)
+ *
+ * [from Qlogic]
*/
#define ISP_CODE_ORG 0x1000
-#if 0
#define ISP_CODE_VERSION 1*1024+24
static const u_int16_t ISP_RISC_CODE[] = {
0x0078, 0x1030, 0x0000, 0x231f, 0x0000, 0x12ff, 0x2043, 0x4f50,
@@ -1137,1169 +1168,3 @@ static const u_int16_t ISP_RISC_CODE[] = {
0x331b, 0x2019, 0x2626, 0x7b22, 0x7b26, 0x007c, 0xae5b
};
#define ISP_CODE_LENGTH 0x231f
-#endif
-#if 1
-/*
- * Version 1.31.00 ISP1000 Initiator RISC firmware
- */
-#define ISP_CODE_VERSION 1*1024+31
-static const u_int16_t ISP_RISC_CODE[] = {
- 0x0078, 0x1030, 0xa5e3, 0x241a, 0x0001, 0x12ff, 0x2043, 0x4f50,
- 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932,
- 0x2c31, 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749,
- 0x4320, 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049,
- 0x5350, 0x3130, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520,
- 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3331, 0x2020,
- 0x2071, 0x0010, 0x70c3, 0x0004, 0x20c9, 0x3fff, 0x2089, 0x10ca,
- 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0001,
- 0x3f00, 0x70d6, 0x2031, 0x0030, 0x2079, 0x3500, 0x7863, 0x0000,
- 0x2fa0, 0x2009, 0x012b, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4,
- 0x8109, 0x00c0, 0x104d, 0x789b, 0x0101, 0x780b, 0x0002, 0x780f,
- 0x0002, 0x784f, 0x0bb8, 0x2069, 0x3540, 0x00a8, 0x106c, 0x681b,
- 0x003c, 0x2009, 0x1313, 0xa18c, 0xff00, 0x3700, 0xa084, 0x00ff,
- 0xa105, 0x20b8, 0x0078, 0x106e, 0x681b, 0x0028, 0x6807, 0x0007,
- 0x680b, 0x00fa, 0x680f, 0x0008, 0x6813, 0x0005, 0x681f, 0x0000,
- 0x6823, 0x0006, 0x6817, 0x0008, 0x6827, 0x0000, 0x2069, 0x3600,
- 0x2011, 0x0020, 0x2009, 0x0010, 0x680b, 0x0c19, 0x680f, 0x0019,
- 0x6803, 0xdd00, 0x6807, 0x001a, 0x6a1a, 0x2d00, 0xa0e8, 0x0008,
- 0xa290, 0x0004, 0x8109, 0x00c0, 0x1084, 0x2069, 0x3680, 0x20a9,
- 0x0080, 0x6837, 0x0000, 0x680b, 0x0040, 0x6817, 0x0064, 0x681f,
- 0x0002, 0xade8, 0x0010, 0x0070, 0x10a7, 0x0078, 0x1099, 0x1078,
- 0x1a42, 0x1078, 0x2f3d, 0x1078, 0x168b, 0x1078, 0x33bb, 0x3200,
- 0xa085, 0x000d, 0x2090, 0x70c3, 0x0000, 0x0090, 0x10be, 0x70c0,
- 0xa086, 0x0002, 0x00c0, 0x10be, 0x1078, 0x11be, 0x1078, 0x10ee,
- 0x1078, 0x1821, 0x1078, 0x19b2, 0x1078, 0x3280, 0x1078, 0x1787,
- 0x0078, 0x10be, 0x10d2, 0x10d4, 0x1b9f, 0x1b9f, 0x2f9b, 0x2f9b,
- 0x1b9f, 0x1b9f, 0x0078, 0x10d2, 0x0078, 0x10d4, 0x0078, 0x10d6,
- 0x0078, 0x10d8, 0x7008, 0x800c, 0x00c8, 0x10e9, 0x7007, 0x0002,
- 0xa08c, 0x000c, 0x00c0, 0x10ea, 0x8004, 0x8004, 0x00c8, 0x10e9,
- 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x11c1, 0x0068, 0x1133,
- 0x7814, 0xa005, 0x00c0, 0x10f8, 0x0010, 0x1134, 0x0078, 0x1133,
- 0x2009, 0x3568, 0x2104, 0xa005, 0x00c0, 0x1133, 0x7814, 0xa086,
- 0x0001, 0x00c0, 0x1105, 0x1078, 0x1540, 0x7817, 0x0000, 0x2009,
- 0x356f, 0x2104, 0xa065, 0x0040, 0x1121, 0x2009, 0x356a, 0x211c,
- 0x8108, 0x2114, 0x8108, 0x2104, 0xa210, 0xa399, 0x0000, 0x2009,
- 0x001c, 0x6083, 0x0103, 0x1078, 0x161b, 0x00c0, 0x112d, 0x1078,
- 0x1682, 0x2009, 0x356f, 0x200b, 0x0000, 0x2009, 0x3569, 0x2104,
- 0x200b, 0x0000, 0xa005, 0x0040, 0x1131, 0x2001, 0x4005, 0x0078,
- 0x11c0, 0x0078, 0x11be, 0x007c, 0x2061, 0x0000, 0x6018, 0xa084,
- 0x0001, 0x0040, 0x113c, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000,
- 0x70cb, 0x0000, 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0,
- 0x118c, 0x2038, 0x0079, 0x114c, 0x11be, 0x1209, 0x11d7, 0x1209,
- 0x125a, 0x125a, 0x11ce, 0x159a, 0x1265, 0x11ca, 0x11db, 0x11dd,
- 0x11df, 0x11e1, 0x159f, 0x11ca, 0x126b, 0x1287, 0x154e, 0x1594,
- 0x11e3, 0x1475, 0x1497, 0x14b1, 0x14da, 0x142e, 0x143c, 0x1450,
- 0x1464, 0x12f3, 0x11ca, 0x12a3, 0x12aa, 0x12af, 0x12b4, 0x12ba,
- 0x12bf, 0x12c4, 0x12c9, 0x12ce, 0x12d2, 0x12e7, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x12ff, 0x1308, 0x1317, 0x133d, 0x1347,
- 0x134e, 0x137a, 0x1389, 0x1398, 0x13aa, 0x1413, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x1423, 0xa0bc, 0xffa0, 0x00c0, 0x11ca,
- 0x2038, 0xa084, 0x001f, 0x0079, 0x1195, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x15f7,
- 0x1601, 0x1605, 0x1613, 0x11ca, 0x11ca, 0x72ca, 0x71c6, 0x2001,
- 0x4006, 0x0078, 0x11c0, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000,
- 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091,
- 0x4080, 0x007c, 0x70c3, 0x4001, 0x0078, 0x11c1, 0x2099, 0x0041,
- 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078, 0x11be, 0x70c4,
- 0x70c3, 0x0004, 0x007a, 0x0078, 0x11be, 0x0078, 0x11be, 0x0078,
- 0x11be, 0x0078, 0x11be, 0x2091, 0x8000, 0x70c3, 0x0000, 0x70c7,
- 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0001, 0x3f00,
- 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031, 0x0030, 0x2059,
- 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061, 0x0472, 0x20b9,
- 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091, 0x4080, 0x0078,
- 0x0455, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2098, 0x2031,
- 0x0030, 0x81ff, 0x0040, 0x11be, 0x7007, 0x0004, 0x731a, 0x721e,
- 0x2051, 0x0012, 0x2049, 0x1238, 0x2041, 0x11be, 0x7003, 0x0002,
- 0xa786, 0x0001, 0x00c0, 0x122a, 0x2049, 0x1246, 0x2041, 0x1252,
- 0x7003, 0x0003, 0x7017, 0x0000, 0x810b, 0x7112, 0x00c8, 0x1232,
- 0x7017, 0x0001, 0x7007, 0x0001, 0xa786, 0x0001, 0x0040, 0x1246,
- 0x700c, 0xa084, 0x007f, 0x8004, 0x2009, 0x0020, 0xa102, 0x0942,
- 0x094a, 0x20a8, 0x26a0, 0x53a6, 0x0078, 0x10da, 0x700c, 0xa084,
- 0x007f, 0x0040, 0x1246, 0x80ac, 0x0048, 0x1246, 0x2698, 0x53a5,
- 0x0078, 0x10da, 0x700c, 0xa084, 0x007f, 0x80ac, 0x2698, 0x53a5,
- 0x0078, 0x11be, 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0,
- 0x1262, 0x200a, 0x72ca, 0x0078, 0x11bd, 0x70c7, 0x0001, 0x70cb,
- 0x001f, 0x0078, 0x11be, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6,
- 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1281, 0x8001, 0x7872,
- 0x7a7a, 0x7b7e, 0x7c76, 0x7898, 0xa084, 0xfffc, 0x789a, 0x0078,
- 0x1285, 0x7898, 0xa085, 0x0001, 0x789a, 0x0078, 0x11be, 0x70c4,
- 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6, 0xa005,
- 0x0040, 0x129d, 0x8001, 0x7886, 0x7a8e, 0x7b92, 0x7c8a, 0x7898,
- 0xa084, 0xfcff, 0x789a, 0x0078, 0x12a1, 0x7898, 0xa085, 0x0100,
- 0x789a, 0x0078, 0x11be, 0x2009, 0x3559, 0x210c, 0x2011, 0x015c,
- 0x0078, 0x11bc, 0x2009, 0x3541, 0x210c, 0x0078, 0x11bd, 0x2009,
- 0x3542, 0x210c, 0x0078, 0x11bd, 0x2061, 0x3540, 0x610c, 0x6210,
- 0x0078, 0x11bc, 0x2009, 0x3545, 0x210c, 0x0078, 0x11bd, 0x2009,
- 0x3546, 0x210c, 0x0078, 0x11bd, 0x2009, 0x3547, 0x210c, 0x0078,
- 0x11bd, 0x2009, 0x3548, 0x210c, 0x0078, 0x11bd, 0x7908, 0x7a0c,
- 0x0078, 0x11bc, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa0e8, 0x3600, 0x6a00, 0x6804, 0xa084, 0x0008, 0x0040,
- 0x12e4, 0x6b08, 0x0078, 0x12e5, 0x6b0c, 0x0078, 0x11bb, 0x77c4,
- 0x1078, 0x169c, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001,
- 0x2708, 0x0078, 0x11bb, 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000,
- 0x6908, 0x6a18, 0x6b10, 0x2091, 0x8001, 0x0078, 0x11bb, 0x71c4,
- 0xa182, 0x0010, 0x00c8, 0x11b6, 0x1078, 0x1ac6, 0x0078, 0x11bb,
- 0x71c4, 0xa182, 0x0010, 0x00c8, 0x11b6, 0x2011, 0x3541, 0x2204,
- 0x007e, 0x2112, 0x1078, 0x1a7f, 0x017f, 0x0078, 0x11bd, 0x71c4,
- 0x2011, 0x1335, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0040, 0x1327,
- 0x8210, 0x0070, 0x1325, 0x0078, 0x131c, 0x0078, 0x11b6, 0xa292,
- 0x1335, 0x027e, 0x2011, 0x3542, 0x2204, 0x2112, 0x017f, 0x007e,
- 0x1078, 0x1a8b, 0x017f, 0x0078, 0x11bd, 0x03e8, 0x00fa, 0x01f4,
- 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x3540, 0x610c,
- 0x6210, 0x70c4, 0x600e, 0x70c8, 0x6012, 0x0078, 0x11bc, 0x2061,
- 0x3540, 0x6114, 0x70c4, 0x6016, 0x0078, 0x11bd, 0x71c4, 0x2011,
- 0x0004, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x1367, 0x2011,
- 0x0005, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040, 0x1367, 0x2011,
- 0x0006, 0x2019, 0x1313, 0xa186, 0x003c, 0x00c0, 0x11b6, 0x2061,
- 0x3540, 0x6018, 0x007e, 0x611a, 0xa39c, 0xff00, 0x3700, 0xa084,
- 0x00ff, 0xa305, 0x20b8, 0x1078, 0x1a9c, 0x1078, 0x33bb, 0x017f,
- 0x0078, 0x11bd, 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x11b6, 0x2011,
- 0x3547, 0x2204, 0x2112, 0x007e, 0x1078, 0x1abe, 0x017f, 0x0078,
- 0x11bd, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x11b6, 0x2011, 0x3548,
- 0x2204, 0x007e, 0x2112, 0x1078, 0x1aad, 0x017f, 0x0078, 0x11bd,
- 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x11b5, 0xa284, 0xfffd,
- 0x00c0, 0x11b5, 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e,
- 0x0078, 0x11bc, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa0e8, 0x3600, 0x2019, 0x0000, 0x72c8, 0x6800, 0x007e,
- 0xa226, 0x0040, 0x13d9, 0x6a02, 0xa484, 0x2000, 0x0040, 0x13c2,
- 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x13c8, 0xa39d, 0x0008,
- 0xa484, 0x4000, 0x0040, 0x13d9, 0x810f, 0xa284, 0x4000, 0x0040,
- 0x13d5, 0x1078, 0x1ae0, 0x0078, 0x13d9, 0x1078, 0x1ad2, 0x0078,
- 0x13d9, 0x72cc, 0x82ff, 0x0040, 0x140b, 0x6808, 0xa206, 0x0040,
- 0x140b, 0xa2a4, 0x00ff, 0x2061, 0x3540, 0x6118, 0xa186, 0x0028,
- 0x0040, 0x13f2, 0xa186, 0x0032, 0x0040, 0x13f8, 0xa186, 0x003c,
- 0x0040, 0x13fe, 0xa482, 0x0064, 0x0048, 0x1408, 0x0078, 0x1402,
- 0xa482, 0x0050, 0x0048, 0x1408, 0x0078, 0x1402, 0xa482, 0x0043,
- 0x0048, 0x1408, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x11b7,
- 0x6a0a, 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c,
- 0x71c4, 0x0078, 0x11bb, 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000,
- 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e,
- 0x2708, 0x0078, 0x11bb, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010,
- 0x00c8, 0x11b6, 0x1078, 0x1aee, 0x0078, 0x11bb, 0x77c4, 0x1078,
- 0x169c, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0002, 0x6a0a, 0x2091,
- 0x8001, 0x2708, 0x0078, 0x11bc, 0x77c4, 0x1078, 0x169c, 0x2091,
- 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040,
- 0x144b, 0x1078, 0x1a23, 0x2091, 0x8001, 0x2708, 0x0078, 0x11bc,
- 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0004,
- 0x6a0a, 0x6804, 0xa005, 0x0040, 0x145f, 0x1078, 0x1a23, 0x2091,
- 0x8001, 0x2708, 0x0078, 0x11bc, 0x77c4, 0x2041, 0x0001, 0x2049,
- 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 0x16a9, 0x2091,
- 0x8001, 0x2708, 0x6a08, 0x0078, 0x11bc, 0x77c4, 0x72c8, 0x73cc,
- 0x77c6, 0x72ca, 0x73ce, 0x1078, 0x1722, 0x00c0, 0x1493, 0x6818,
- 0xa005, 0x0040, 0x148d, 0x2708, 0x1078, 0x1afe, 0x00c0, 0x148d,
- 0x7817, 0xffff, 0x2091, 0x8001, 0x007c, 0x2091, 0x8001, 0x2001,
- 0x4005, 0x0078, 0x11c0, 0x2091, 0x8001, 0x0078, 0x11be, 0x77c4,
- 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091,
- 0x8000, 0x1078, 0x16a9, 0x2061, 0x3540, 0x60a3, 0x0003, 0x67b6,
- 0x60a7, 0x0000, 0x7817, 0xffff, 0x2091, 0x8001, 0x1078, 0x1a23,
- 0x007c, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091,
- 0x8000, 0x2061, 0x3540, 0x60a3, 0x0002, 0x60a7, 0x0000, 0x67b6,
- 0x7817, 0xffff, 0x1078, 0x1a23, 0x2091, 0x8001, 0x2041, 0x0021,
- 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000, 0x1078, 0x16a9,
- 0x70c8, 0x6836, 0x8738, 0xa784, 0x0007, 0x00c0, 0x14ce, 0x2091,
- 0x8001, 0x007c, 0x7898, 0xa084, 0x0003, 0x00c0, 0x14fe, 0x2039,
- 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078,
- 0x169c, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a, 0x2091, 0x8001,
- 0x8738, 0xa784, 0x0007, 0x00c0, 0x14e7, 0xa7bc, 0xff00, 0x873f,
- 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x14e7, 0x2091, 0x8000,
- 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040, 0x1527, 0x684b,
- 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x1514,
- 0x0070, 0x1514, 0x0078, 0x150b, 0x684b, 0x0009, 0x20a9, 0x0014,
- 0x6848, 0xa084, 0x0001, 0x0040, 0x1521, 0x0070, 0x1521, 0x0078,
- 0x1518, 0x20a9, 0x00fa, 0x0070, 0x1527, 0x0078, 0x1523, 0x2079,
- 0x3500, 0x7817, 0x0001, 0x2061, 0x3540, 0x60a3, 0x0001, 0x60a7,
- 0x0000, 0x60c3, 0x000f, 0x7898, 0xa085, 0x0002, 0x789a, 0x6808,
- 0xa084, 0xfffd, 0x680a, 0x681b, 0x0046, 0x2091, 0x8001, 0x007c,
- 0x7898, 0xa084, 0xfffd, 0x789a, 0xa084, 0x0001, 0x00c0, 0x154a,
- 0x1078, 0x176a, 0x71c4, 0x71c6, 0x794a, 0x007c, 0x74c4, 0x73c8,
- 0x72cc, 0x74c6, 0x73ca, 0x72ce, 0x2079, 0x3500, 0x2009, 0x0040,
- 0x1078, 0x1679, 0x0040, 0x1590, 0x1078, 0x1649, 0x0040, 0x1564,
- 0x1078, 0x1682, 0x0078, 0x1590, 0x6010, 0x2091, 0x8001, 0x7817,
- 0xffff, 0x2009, 0x3568, 0x200b, 0x0005, 0x8108, 0x200b, 0x0000,
- 0x8108, 0x230a, 0x8108, 0x220a, 0x8108, 0x240a, 0x8108, 0x200a,
- 0x8108, 0x200b, 0x0000, 0x8108, 0x2c0a, 0xa02e, 0x2530, 0x0e7e,
- 0x1078, 0x2f16, 0x0e7f, 0x6592, 0x65a2, 0x6696, 0x66a6, 0x60ab,
- 0x0000, 0x60af, 0x0000, 0x2091, 0x8001, 0x1078, 0x1a23, 0x007c,
- 0x70c3, 0x4005, 0x0078, 0x11c1, 0x71c4, 0x70c7, 0x0000, 0x7906,
- 0x0078, 0x11be, 0x71c4, 0x71c6, 0x2168, 0x0078, 0x15a1, 0x2069,
- 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0,
- 0x15a3, 0xa285, 0x0000, 0x00c0, 0x15b1, 0x70c3, 0x4000, 0x0078,
- 0x15b3, 0x70c3, 0x4003, 0x70ca, 0x0078, 0x11c1, 0x71c4, 0x72c8,
- 0x73cc, 0x2100, 0xa184, 0xfffc, 0x00c0, 0x11ca, 0x2100, 0x0079,
- 0x15c1, 0x15d8, 0x15ed, 0x15ef, 0x15f1, 0x70c3, 0x4003, 0x71ce,
- 0x72d2, 0x73d6, 0x0078, 0x15d4, 0x70c3, 0x4000, 0x70cf, 0x0000,
- 0x70d3, 0x0000, 0x70d7, 0x0000, 0x77c6, 0x71ca, 0x0078, 0x11be,
- 0x2031, 0x15f3, 0x2624, 0x8630, 0x2412, 0x2204, 0xa446, 0x00c0,
- 0x15c5, 0xa484, 0xffff, 0x00c0, 0x15da, 0x2031, 0x15f3, 0x8210,
- 0x8319, 0xa384, 0xffff, 0x00c0, 0x15da, 0x0078, 0x15cc, 0x0078,
- 0x15cc, 0x0078, 0x15cc, 0x5555, 0xaaaa, 0xffff, 0x0000, 0x7960,
- 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x11b6, 0x7962, 0x0078,
- 0x11be, 0x7960, 0x71c6, 0x0078, 0x11be, 0x7954, 0x71c6, 0x71c4,
- 0x7956, 0x7958, 0x71ca, 0x71c8, 0x795a, 0x795c, 0x71ce, 0x71cc,
- 0x795e, 0x0078, 0x11be, 0x7954, 0x71c6, 0x7958, 0x71ca, 0x795c,
- 0x71ce, 0x0078, 0x11be, 0x700c, 0xa084, 0x007f, 0x0040, 0x1627,
- 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x1622, 0x7017,
- 0x0000, 0x7112, 0x721a, 0x731e, 0x8108, 0x810c, 0x81a9, 0x8c98,
- 0x20a1, 0x0030, 0x6080, 0x20a2, 0x53a6, 0x780c, 0xa085, 0x0000,
- 0x7002, 0x7007, 0x0001, 0x7108, 0x8104, 0x00c8, 0x163b, 0x7007,
- 0x0002, 0xa184, 0x000c, 0x710c, 0xa184, 0x0300, 0x7003, 0x0000,
- 0x007c, 0x700c, 0xa084, 0x007f, 0x0040, 0x1655, 0x7007, 0x0004,
- 0x7004, 0xa084, 0x0004, 0x00c0, 0x1650, 0x7017, 0x0000, 0x7112,
- 0x721a, 0x731e, 0x2099, 0x0030, 0x8108, 0x81ac, 0x780c, 0xa085,
- 0x0001, 0x7002, 0x7007, 0x0001, 0x7008, 0x800c, 0x00c8, 0x1664,
- 0x7007, 0x0002, 0xa08c, 0x000c, 0x00c0, 0x1676, 0x710c, 0xa184,
- 0x0300, 0x00c0, 0x1676, 0x2ca0, 0x53a5, 0xa006, 0x7003, 0x0000,
- 0x007c, 0x7850, 0xa065, 0x0040, 0x1681, 0x2c04, 0x7852, 0x2063,
- 0x0000, 0x007c, 0x0f7e, 0x2079, 0x3500, 0x7850, 0x2062, 0x2c00,
- 0x7852, 0x0f7f, 0x007c, 0x2011, 0x4000, 0x7a52, 0x2019, 0x015c,
- 0x8319, 0x0040, 0x1699, 0xa280, 0x002f, 0x2012, 0x2010, 0x0078,
- 0x1690, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
- 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8, 0x3680,
- 0x007c, 0x1078, 0x169c, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808,
- 0xa084, 0xffef, 0xa80d, 0x690a, 0x2009, 0x354f, 0x210c, 0x6804,
- 0xa005, 0x0040, 0x16c6, 0xa116, 0x00c0, 0x16c6, 0x2060, 0x6000,
- 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x16c9, 0x2009, 0x0000,
- 0x017e, 0x6804, 0xa065, 0x0040, 0x16d8, 0x6000, 0x6806, 0x1078,
- 0x16e9, 0x1078, 0x17d5, 0x6810, 0x8001, 0x6812, 0x00c0, 0x16c9,
- 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040, 0x16e8, 0x6098,
- 0x609b, 0x0000, 0x2008, 0x1078, 0x1682, 0x2100, 0x0078, 0x16dc,
- 0x007c, 0x6003, 0x0103, 0x20a9, 0x001c, 0xac80, 0x0004, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x6828, 0x6016, 0x682c, 0x601e, 0x007c,
- 0x0e7e, 0x2071, 0x3540, 0x7040, 0xa08c, 0x0080, 0x00c0, 0x1706,
- 0xa088, 0x3580, 0x2d0a, 0x8000, 0x7042, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x2071, 0x3540, 0x2009, 0x3580, 0x7240, 0x8221, 0x8211,
- 0x0048, 0x1720, 0x2104, 0x8108, 0xad06, 0x00c0, 0x170f, 0x8119,
- 0x211e, 0x8108, 0x8318, 0x8211, 0x00c8, 0x1718, 0x7442, 0xa006,
- 0x0e7f, 0x007c, 0x1078, 0x169c, 0x2091, 0x8000, 0x6804, 0x781e,
- 0xa065, 0x0040, 0x1769, 0x0078, 0x1733, 0x2c00, 0x781e, 0x6000,
- 0xa065, 0x0040, 0x1769, 0x600c, 0xa306, 0x00c0, 0x172d, 0x6008,
- 0xa206, 0x00c0, 0x172d, 0x2c28, 0x2001, 0x354f, 0x2004, 0xac06,
- 0x0040, 0x1769, 0x6804, 0xac06, 0x00c0, 0x1750, 0x6000, 0x2060,
- 0x6806, 0xa005, 0x00c0, 0x1750, 0x6803, 0x0000, 0x0078, 0x175a,
- 0x6400, 0x781c, 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x175a,
- 0x2c00, 0x6802, 0x2560, 0x1078, 0x16e9, 0x6017, 0x0005, 0x601f,
- 0x0020, 0x1078, 0x17d5, 0x6810, 0x8001, 0x6812, 0x2001, 0xffff,
- 0xa005, 0x007c, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004,
- 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x16a9, 0x8738, 0xa784,
- 0x0007, 0x00c0, 0x1774, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f,
- 0xa784, 0x0f00, 0x00c0, 0x1774, 0x2091, 0x8001, 0x007c, 0x2061,
- 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1794, 0x78ac, 0x78af,
- 0x0000, 0xa005, 0x00c0, 0x1795, 0x007c, 0xa08c, 0xfff0, 0x0040,
- 0x179b, 0x1078, 0x1b81, 0x0079, 0x179d, 0x17ad, 0x17af, 0x17b5,
- 0x17b9, 0x17ad, 0x17bd, 0x17ad, 0x17ad, 0x17ad, 0x17ad, 0x17c3,
- 0x17c7, 0x17ad, 0x17ad, 0x17ad, 0x17ad, 0x1078, 0x1b81, 0x1078,
- 0x176a, 0x2001, 0x8001, 0x0078, 0x17cd, 0x2001, 0x8003, 0x0078,
- 0x17cd, 0x2001, 0x8004, 0x0078, 0x17cd, 0x1078, 0x176a, 0x2001,
- 0x8006, 0x0078, 0x17cd, 0x2001, 0x800c, 0x0078, 0x17cd, 0x1078,
- 0x176a, 0x2001, 0x800d, 0x0078, 0x17cd, 0x70c2, 0x2061, 0x0000,
- 0x601b, 0x0001, 0x2091, 0x4080, 0x007c, 0x2c04, 0x6082, 0x2c08,
- 0x2063, 0x0000, 0x7864, 0x8000, 0x7866, 0x7868, 0xa005, 0x796a,
- 0x0040, 0x17e5, 0x2c02, 0x0078, 0x17e6, 0x796e, 0x007c, 0x0c7e,
- 0x2061, 0x3500, 0x6883, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6064,
- 0x8000, 0x6066, 0x6068, 0xa005, 0x616a, 0x0040, 0x17fa, 0x2d02,
- 0x0078, 0x17fb, 0x616e, 0x0c7f, 0x007c, 0x1078, 0x180e, 0x0040,
- 0x180d, 0x0c7e, 0x6098, 0xa065, 0x0040, 0x1808, 0x1078, 0x16dc,
- 0x0c7f, 0x609b, 0x0000, 0x1078, 0x1682, 0x007c, 0x786c, 0xa065,
- 0x0040, 0x1820, 0x2091, 0x8000, 0x7864, 0x8001, 0x7866, 0x2c04,
- 0x786e, 0xa005, 0x00c0, 0x181e, 0x786a, 0x8000, 0x2091, 0x8001,
- 0x007c, 0x7898, 0xa005, 0x00c0, 0x186f, 0x7974, 0x70d0, 0x0005,
- 0x0005, 0x72d0, 0xa206, 0x00c0, 0x1826, 0x2200, 0xa106, 0x00c0,
- 0x183d, 0x7804, 0xa005, 0x0040, 0x186f, 0x7807, 0x0000, 0x0068,
- 0x186f, 0x2091, 0x4080, 0x0078, 0x186f, 0x1078, 0x1679, 0x0040,
- 0x186f, 0x7a7c, 0x7b78, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
- 0x0000, 0x2009, 0x0040, 0x1078, 0x1649, 0x0040, 0x1866, 0x1078,
- 0x1682, 0x7880, 0x8000, 0x7882, 0xa086, 0x0002, 0x00c0, 0x186f,
- 0x2091, 0x8000, 0x78af, 0x0002, 0x7883, 0x0000, 0x7898, 0xa085,
- 0x0003, 0x789a, 0x2091, 0x8001, 0x0078, 0x186f, 0x7883, 0x0000,
- 0x1078, 0x199c, 0x6000, 0xa084, 0x0007, 0x0079, 0x1870, 0x007c,
- 0x1878, 0x1887, 0x18a7, 0x1878, 0x18b9, 0x1878, 0x1878, 0x1878,
- 0x2039, 0x0400, 0x78a8, 0xa705, 0x78aa, 0x6004, 0xa705, 0x6006,
- 0x1078, 0x18f7, 0x6018, 0x78a6, 0x1078, 0x1984, 0x007c, 0x78a8,
- 0xa084, 0x0100, 0x0040, 0x188e, 0x0078, 0x1878, 0x78ab, 0x0000,
- 0x6000, 0x8007, 0xa084, 0x00ff, 0x789e, 0x8001, 0x609b, 0x0000,
- 0x0040, 0x18a4, 0x1078, 0x18f7, 0x0040, 0x18a4, 0x78a8, 0xa085,
- 0x0100, 0x78aa, 0x0078, 0x18a6, 0x1078, 0x191b, 0x007c, 0x78a8,
- 0xa08c, 0x0e00, 0x00c0, 0x18b0, 0xa084, 0x0100, 0x00c0, 0x18b2,
- 0x0078, 0x1878, 0x1078, 0x18f7, 0x00c0, 0x18b8, 0x1078, 0x191b,
- 0x007c, 0x78a8, 0xa084, 0x0100, 0x0040, 0x18c0, 0x0078, 0x1878,
- 0x78ab, 0x0000, 0x6710, 0x20a9, 0x0001, 0x6014, 0xa084, 0x00ff,
- 0xa005, 0x0040, 0x18dd, 0xa7bc, 0xff00, 0x20a9, 0x0008, 0xa08e,
- 0x0001, 0x0040, 0x18dd, 0x2039, 0x0000, 0x20a9, 0x0080, 0xa08e,
- 0x0002, 0x0040, 0x18dd, 0x0078, 0x18f4, 0x1078, 0x169c, 0x2d00,
- 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084,
- 0xffde, 0x680a, 0x2d00, 0xa080, 0x0010, 0x2068, 0x2091, 0x8001,
- 0x0070, 0x18f4, 0x0078, 0x18e0, 0x1078, 0x1682, 0x007c, 0x78a0,
- 0xa06d, 0x00c0, 0x1902, 0x2c00, 0x78a2, 0x78a6, 0x609b, 0x0000,
- 0x0078, 0x190e, 0x2c00, 0x689a, 0x609b, 0x0000, 0x78a2, 0x2d00,
- 0x6002, 0x78a4, 0xad06, 0x00c0, 0x190e, 0x6002, 0x789c, 0x8001,
- 0x789e, 0x00c0, 0x191a, 0x78a8, 0xa084, 0x0000, 0x78aa, 0x78a4,
- 0x2060, 0xa006, 0x007c, 0xa02e, 0x2530, 0x6118, 0xa184, 0x0060,
- 0x619e, 0x0040, 0x1927, 0x0e7e, 0x1078, 0x2f16, 0x0e7f, 0x6592,
- 0x65a2, 0x6696, 0x66a6, 0x60ab, 0x0000, 0x60af, 0x0000, 0x6710,
- 0x1078, 0x169c, 0x2091, 0x8000, 0x6808, 0xa084, 0x0001, 0x0040,
- 0x1949, 0x2091, 0x8001, 0x1078, 0x16e9, 0x2091, 0x8000, 0x1078,
- 0x17d5, 0x2091, 0x8001, 0x78a3, 0x0000, 0x78a7, 0x0000, 0x0078,
- 0x1983, 0x6020, 0xa096, 0x0001, 0x00c0, 0x1950, 0x8000, 0x6022,
- 0x6a10, 0x6814, 0x2091, 0x8001, 0xa202, 0x0048, 0x195f, 0x0040,
- 0x195f, 0x2039, 0x0200, 0x1078, 0x1984, 0x0078, 0x1983, 0x2c08,
- 0x2091, 0x8000, 0x6800, 0xa065, 0x0040, 0x1967, 0x6102, 0x6902,
- 0x00c0, 0x196b, 0x6906, 0x2160, 0x6003, 0x0000, 0x6810, 0x8000,
- 0x6812, 0x2091, 0x8001, 0x6808, 0xa08c, 0x0040, 0x0040, 0x197d,
- 0xa086, 0x0040, 0x680a, 0x1078, 0x16f8, 0x1078, 0x1a23, 0x78a7,
- 0x0000, 0x78a3, 0x0000, 0x007c, 0x6004, 0xa705, 0x6006, 0x2091,
- 0x8000, 0x1078, 0x17d5, 0x2091, 0x8001, 0x78a4, 0xa065, 0x0040,
- 0x1997, 0x6098, 0x78a6, 0x609b, 0x0000, 0x0078, 0x1987, 0x78a3,
- 0x0000, 0x78a7, 0x0000, 0x007c, 0x7970, 0x7874, 0x8000, 0xa10a,
- 0x00c8, 0x19a3, 0xa006, 0x7876, 0x70d2, 0x7804, 0xa005, 0x0040,
- 0x19b1, 0x8001, 0x7806, 0x00c0, 0x19b1, 0x0068, 0x19b1, 0x2091,
- 0x4080, 0x007c, 0x0068, 0x19cc, 0x2029, 0x0000, 0x786c, 0xa065,
- 0x0040, 0x19c7, 0x1078, 0x19cd, 0x0040, 0x19c7, 0x057e, 0x1078,
- 0x19e3, 0x057f, 0x00c0, 0x19c7, 0x8528, 0x0078, 0x19b6, 0x85ff,
- 0x0040, 0x19cc, 0x2091, 0x4080, 0x007c, 0x7b84, 0x7988, 0x72d4,
- 0x0005, 0x0005, 0x70d4, 0xa206, 0x00c0, 0x19cf, 0x2200, 0xa102,
- 0x00c0, 0x19dd, 0x2300, 0xa005, 0x007c, 0x0048, 0x19e1, 0xa302,
- 0x007c, 0x8002, 0x007c, 0x1078, 0x1a15, 0x2009, 0x001c, 0x6024,
- 0xa005, 0x0040, 0x19ed, 0x2009, 0x0040, 0x1078, 0x161b, 0x0040,
- 0x1a06, 0x7894, 0x8000, 0x7896, 0xa086, 0x0002, 0x00c0, 0x1a14,
- 0x2091, 0x8000, 0x78af, 0x0003, 0x7897, 0x0000, 0x7898, 0xa085,
- 0x0300, 0x789a, 0x2091, 0x8001, 0x0078, 0x1a14, 0x7897, 0x0000,
- 0x1078, 0x17fd, 0x7984, 0x7888, 0x8000, 0xa10a, 0x00c8, 0x1a11,
- 0xa006, 0x788a, 0x70d6, 0xa006, 0x007c, 0x8107, 0x8004, 0x8004,
- 0x7a90, 0x7b8c, 0xa210, 0xa399, 0x0000, 0x007c, 0x2009, 0x3568,
- 0x2091, 0x8000, 0x200a, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3540,
- 0x2091, 0x8000, 0x2104, 0xa086, 0x0000, 0x00c0, 0x1a3e, 0x2009,
- 0x3512, 0x2104, 0xa005, 0x00c0, 0x1a3e, 0x7830, 0xa084, 0x00c0,
- 0x00c0, 0x1a3e, 0x0018, 0x1a3e, 0x781b, 0x0044, 0x2091, 0x8001,
- 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, 0x3540, 0x2079,
- 0x0100, 0x2019, 0x2ddb, 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040,
- 0x1a5a, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318,
- 0x0078, 0x1a4d, 0x789b, 0x0020, 0x20a9, 0x0010, 0x78af, 0x0000,
- 0x78af, 0x0220, 0x0070, 0x1a66, 0x0078, 0x1a5e, 0x7003, 0x0000,
- 0x1078, 0x1b65, 0x7004, 0xa084, 0x000f, 0xa085, 0x6280, 0x7806,
- 0x780f, 0x9200, 0x7843, 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008,
- 0x7047, 0x357f, 0x7043, 0x0000, 0x127f, 0x2000, 0x007c, 0xa18c,
- 0x000f, 0x2011, 0x0101, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012,
- 0x1078, 0x1b65, 0x007c, 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b,
- 0x0070, 0x1a94, 0x0078, 0x1a8f, 0xa18c, 0x0e00, 0x2204, 0xa084,
- 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009, 0x0101, 0x20a9, 0x0005,
- 0x8213, 0x0070, 0x1aa5, 0x0078, 0x1aa0, 0xa294, 0x00e0, 0x2104,
- 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c, 0x2011, 0x0101, 0x20a9,
- 0x000c, 0x810b, 0x0070, 0x1ab6, 0x0078, 0x1ab1, 0xa18c, 0xf000,
- 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x007c, 0x2011, 0x0102,
- 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x8103, 0x8003,
- 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x62ac, 0x63ac,
- 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061,
- 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c,
- 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a,
- 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003,
- 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0x62ae,
- 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f, 0x007c, 0x2091, 0x8000,
- 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040, 0x1b43, 0x2061, 0x3f80,
- 0x1078, 0x1b4b, 0x0040, 0x1b31, 0x20a9, 0x0000, 0x2061, 0x3e80,
- 0x0c7e, 0x1078, 0x1b4b, 0x0040, 0x1b1d, 0x0c7f, 0x8c60, 0x0070,
- 0x1b1b, 0x0078, 0x1b10, 0x0078, 0x1b43, 0x007f, 0xa082, 0x3e80,
- 0x2071, 0x3540, 0x70ba, 0x601c, 0xa085, 0x0800, 0x601e, 0x71b6,
- 0x60a7, 0x0000, 0x2001, 0x0004, 0x70a2, 0x1078, 0x1a1e, 0x0078,
- 0x1b3f, 0x2071, 0x3540, 0x601c, 0xa085, 0x0800, 0x601e, 0x71b6,
- 0x60a7, 0x0000, 0x2001, 0x0006, 0x70a2, 0x1078, 0x1a1e, 0x2001,
- 0x0000, 0x0078, 0x1b45, 0x2001, 0x0001, 0x2091, 0x8001, 0xa005,
- 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 0x1b62, 0x2060,
- 0x600c, 0xa306, 0x00c0, 0x1b5f, 0x6008, 0xa206, 0x00c0, 0x1b5f,
- 0x6010, 0xa106, 0x00c0, 0x1b5f, 0xa006, 0x0078, 0x1b64, 0x6000,
- 0x0078, 0x1b4c, 0xa085, 0x0001, 0x007c, 0x2011, 0x3541, 0x220c,
- 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, 0x0100, 0x0040,
- 0x1b80, 0x2019, 0x0112, 0x201b, 0x1000, 0x2021, 0x013a, 0x2122,
- 0x2013, 0x0080, 0x2013, 0x008c, 0x2013, 0x0000, 0x201b, 0x0000,
- 0x007c, 0x0068, 0x1b81, 0x007e, 0x2071, 0x0000, 0x7018, 0xa084,
- 0x0001, 0x00c0, 0x1b86, 0x007f, 0x2e08, 0x2071, 0x0010, 0x70ca,
- 0x007f, 0x70c6, 0x70c3, 0x8002, 0x2071, 0x0000, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x007f, 0x2070, 0x007f, 0x0078, 0x1b9d, 0x107e,
- 0x007e, 0x127e, 0x2091, 0x2300, 0x7f3c, 0x7e58, 0x7c30, 0x7d38,
- 0xa594, 0x003f, 0xa484, 0x4000, 0x0040, 0x1bb4, 0xa784, 0x007c,
- 0x00c0, 0x2da7, 0x1078, 0x1b81, 0xa49c, 0x000f, 0xa382, 0x0004,
- 0x0050, 0x1bbc, 0x1078, 0x1b81, 0x8507, 0xa084, 0x000f, 0x0079,
- 0x1bc1, 0x1fed, 0x209d, 0x20c3, 0x22e9, 0x2576, 0x25be, 0x25f5,
- 0x2670, 0x26ca, 0x274f, 0x1be7, 0x1bd1, 0x1e56, 0x1f20, 0x2555,
- 0x1bd1, 0x1078, 0x1b81, 0x0018, 0x1ba4, 0x127f, 0x2091, 0x8001,
- 0x007f, 0x107f, 0x007c, 0x7003, 0x0000, 0x703f, 0x0000, 0x7030,
- 0xa005, 0x0040, 0x1be5, 0x7033, 0x0000, 0x0018, 0x1ba4, 0x705c,
- 0xa005, 0x00c0, 0x1ca5, 0x70a0, 0xa084, 0x0007, 0x0079, 0x1bf0,
- 0x1cd1, 0x1bf8, 0x1c06, 0x1c27, 0x1c4d, 0x1c79, 0x1c77, 0x1bf8,
- 0x7808, 0xa084, 0xfffd, 0x780a, 0x2009, 0x0046, 0x1078, 0x241b,
- 0x00c0, 0x1c04, 0x7003, 0x0004, 0x0078, 0x1bd3, 0x1078, 0x2d69,
- 0x00c0, 0x1c25, 0x70b4, 0x8007, 0x789b, 0x007e, 0x78aa, 0x789b,
- 0x0010, 0x78ab, 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b,
- 0x0004, 0x2009, 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c25, 0x7003,
- 0x0004, 0x70c3, 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x1078,
- 0x2d69, 0x00c0, 0x1c4b, 0x71b4, 0x8107, 0x789b, 0x007e, 0x78aa,
- 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
- 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
- 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c4b, 0x7003, 0x0004, 0x70c3,
- 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x1078, 0x2d69, 0x00c0,
- 0x1c75, 0x71b4, 0x8107, 0x789b, 0x007e, 0x78aa, 0x789b, 0x0010,
- 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x71b8,
- 0x79aa, 0x78ab, 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b,
- 0x0004, 0x2009, 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c75, 0x7003,
- 0x0004, 0x70c3, 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x0078,
- 0x1c27, 0x1078, 0x2d69, 0x00c0, 0x1bd3, 0x70bc, 0x2068, 0x789b,
- 0x0010, 0x6f10, 0x1078, 0x2cac, 0x2c50, 0x6810, 0x007e, 0x8007,
- 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3600, 0x2048,
- 0x0c7e, 0x2060, 0x704a, 0x6000, 0x704e, 0x6004, 0x7052, 0x0c7f,
- 0x007f, 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x6e18, 0x2041,
- 0x0001, 0x2001, 0x0004, 0x0078, 0x1dcc, 0x1078, 0x2d69, 0x00c0,
- 0x1bd3, 0x789b, 0x0010, 0x705c, 0x2068, 0x6f10, 0x1078, 0x2cac,
- 0x2c50, 0x6008, 0xa085, 0x0010, 0x600a, 0x6820, 0xa005, 0x0040,
- 0x1cc1, 0xa082, 0x0006, 0x0048, 0x1cbf, 0x0078, 0x1cc1, 0x6823,
- 0x0005, 0x6810, 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x2031,
- 0x0020, 0x2041, 0x0001, 0x1078, 0x2dc8, 0x2001, 0x0003, 0x0078,
- 0x1dcc, 0x0018, 0x1ba4, 0x7440, 0xa485, 0x0000, 0x0040, 0x1ceb,
- 0xa080, 0x3580, 0x2030, 0x7144, 0x8108, 0xa12a, 0x0048, 0x1ce2,
- 0x2009, 0x3580, 0x2164, 0x6504, 0x85ff, 0x00c0, 0x1cf8, 0x8421,
- 0x00c0, 0x1cdc, 0x7146, 0x7003, 0x0000, 0x703f, 0x0000, 0x0078,
- 0x1bd3, 0x7640, 0xa6b0, 0x3580, 0x7144, 0x2600, 0x0078, 0x1ce7,
- 0x7146, 0x2568, 0x2558, 0x753e, 0x2c50, 0x6034, 0xa085, 0x0000,
- 0x00c0, 0x1cf5, 0x6708, 0x7736, 0xa784, 0x013f, 0x0040, 0x1d2a,
- 0xa784, 0x0021, 0x00c0, 0x1cf5, 0xa784, 0x0002, 0x0040, 0x1d17,
- 0xa784, 0x0004, 0x0040, 0x1cf5, 0xa7bc, 0xfffb, 0x670a, 0xa784,
- 0x0008, 0x00c0, 0x1cf5, 0xa784, 0x0010, 0x00c0, 0x1cf5, 0xa784,
- 0x0100, 0x0040, 0x1d2a, 0x6018, 0xa005, 0x00c0, 0x1cf5, 0xa7bc,
- 0xfeff, 0x670a, 0x681f, 0x0000, 0x6e18, 0xa684, 0x000e, 0x6118,
- 0x0040, 0x1d3a, 0x601c, 0xa102, 0x0048, 0x1d3d, 0x0040, 0x1d3d,
- 0x0078, 0x1cf1, 0x81ff, 0x00c0, 0x1cf1, 0xa784, 0x0080, 0x00c0,
- 0x1d43, 0x700c, 0x6022, 0xa7bc, 0xff7f, 0x670a, 0x6b10, 0x8307,
- 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3600, 0x2060,
- 0x2048, 0x704a, 0x6000, 0x704e, 0x6004, 0x7052, 0x2a60, 0x0018,
- 0x1ba4, 0x789b, 0x0010, 0xa046, 0x1078, 0x2d69, 0x00c0, 0x1bd3,
- 0x6b10, 0xa39c, 0x0007, 0xa39d, 0x00c0, 0x704c, 0xa084, 0x8000,
- 0x0040, 0x1d6e, 0xa684, 0x0001, 0x0040, 0x1d74, 0xa39c, 0xffbf,
- 0xa684, 0x000e, 0x00c0, 0x2901, 0xa684, 0x0010, 0x0040, 0x1d7e,
- 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2907, 0x7baa, 0x8840,
- 0xa684, 0x000e, 0x00c0, 0x1d89, 0xa7bd, 0x0010, 0x670a, 0x0078,
- 0x1dca, 0x714c, 0xa18c, 0x0800, 0x0040, 0x290d, 0x2011, 0x0021,
- 0x8004, 0x8004, 0x0048, 0x1da0, 0x2011, 0x0022, 0x8004, 0x0048,
- 0x1da0, 0x2011, 0x0020, 0x8004, 0x0048, 0x1da0, 0x0040, 0x1dca,
- 0x7aaa, 0x8840, 0x1078, 0x2d82, 0x6a10, 0x610c, 0x8108, 0xa18c,
- 0x00ff, 0xa1e0, 0x3e80, 0x2c64, 0x8cff, 0x0040, 0x1dc1, 0x6010,
- 0xa206, 0x00c0, 0x1dab, 0x60b4, 0x8001, 0x60b6, 0x00c0, 0x1da6,
- 0x0c7e, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078,
- 0x1cd1, 0x1078, 0x2d69, 0x00c0, 0x1bd3, 0x2a60, 0x610e, 0x79aa,
- 0x8840, 0x712e, 0x2001, 0x0001, 0x007e, 0x7150, 0xa184, 0x0018,
- 0x0040, 0x1de0, 0xa184, 0x0010, 0x0040, 0x1dda, 0x1078, 0x2ad7,
- 0x00c0, 0x1de0, 0xa184, 0x0008, 0x0040, 0x1de0, 0x1078, 0x29f1,
- 0x007f, 0x7002, 0xa68c, 0x0060, 0x88ff, 0x0040, 0x1de9, 0xa18d,
- 0x0004, 0x795a, 0x69b2, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b,
- 0x0061, 0x6814, 0xa085, 0x8000, 0x6816, 0x78aa, 0x157e, 0x137e,
- 0x147e, 0x20a1, 0x012c, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80,
- 0x000a, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6810, 0x8007,
- 0x789b, 0x007e, 0x78aa, 0x6d90, 0x7dd6, 0x7dde, 0x6e94, 0x7ed2,
- 0x7eda, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1e18, 0x0098, 0x1e20,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2d82, 0x0078, 0x1bdb,
- 0x7200, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1e2d, 0x781b,
- 0x0049, 0x1078, 0x2d82, 0x0078, 0x1e3e, 0x6ab0, 0xa295, 0x2000,
- 0x7a5a, 0x781b, 0x0049, 0x1078, 0x2d82, 0x7200, 0x2500, 0xa605,
- 0x0040, 0x1e3e, 0xa284, 0x0007, 0x1079, 0x1e4c, 0xad80, 0x0008,
- 0x7032, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1e4a, 0x6018,
- 0x8000, 0x601a, 0x0078, 0x1bd3, 0x1e54, 0x30f3, 0x30f3, 0x30e2,
- 0x30f3, 0x1e54, 0x1e54, 0x1e54, 0x1078, 0x1b81, 0x7808, 0xa084,
- 0xfffd, 0x780a, 0x0f7e, 0x2079, 0x3500, 0x7898, 0x0f7f, 0xa084,
- 0x0001, 0x0040, 0x1e7c, 0x70a0, 0xa086, 0x0001, 0x00c0, 0x1e6b,
- 0x70a2, 0x0078, 0x1f04, 0x70a0, 0xa086, 0x0005, 0x00c0, 0x1e7a,
- 0x70bc, 0x2068, 0x6817, 0x0004, 0x6813, 0x0000, 0x681c, 0xa085,
- 0x0008, 0x681e, 0x70a3, 0x0000, 0x157e, 0x2011, 0x0004, 0x71a0,
- 0xa186, 0x0001, 0x0040, 0x1e9e, 0xa186, 0x0007, 0x00c0, 0x1e8e,
- 0x2009, 0x352b, 0x200b, 0x0005, 0x0078, 0x1e9e, 0x2009, 0x3513,
- 0x2104, 0x2009, 0x3512, 0x200a, 0x2009, 0x352b, 0x200b, 0x0001,
- 0x70a3, 0x0000, 0x70a7, 0x0001, 0x0078, 0x1ea0, 0x70a3, 0x0000,
- 0x1078, 0x2eca, 0x20a9, 0x0010, 0x2039, 0x0000, 0x1078, 0x2bb1,
- 0xa7b8, 0x0100, 0x0070, 0x1eae, 0x0078, 0x1ea6, 0x7000, 0x2020,
- 0x0079, 0x1eb2, 0x1ee0, 0x1ec9, 0x1ec9, 0x1ebc, 0x1ee0, 0x1ee0,
- 0x1eba, 0x1eba, 0x1078, 0x1b81, 0x2021, 0x3557, 0x2404, 0xa005,
- 0x0040, 0x1ec9, 0xad06, 0x00c0, 0x1ec9, 0x6800, 0x2022, 0x0078,
- 0x1ed9, 0x681c, 0xa084, 0x0001, 0x00c0, 0x1ed5, 0x6f10, 0x1078,
- 0x2cac, 0x1078, 0x28e4, 0x0078, 0x1ed9, 0x7054, 0x2060, 0x6800,
- 0x6002, 0x6a16, 0x681c, 0xa085, 0x0008, 0x681e, 0x1078, 0x17e7,
- 0x2021, 0x3f80, 0x1078, 0x1f0a, 0x2021, 0x3557, 0x1078, 0x1f0a,
- 0x20a9, 0x0000, 0x2021, 0x3e80, 0x1078, 0x1f0a, 0x8420, 0x0070,
- 0x1ef3, 0x0078, 0x1eec, 0x20a9, 0x0080, 0x2061, 0x3680, 0x6018,
- 0x6110, 0xa102, 0x6012, 0x601b, 0x0000, 0xace0, 0x0010, 0x0070,
- 0x1f03, 0x0078, 0x1ef7, 0x157f, 0x7003, 0x0000, 0x703f, 0x0000,
- 0x0078, 0x1bd3, 0x047e, 0x2404, 0xa005, 0x0040, 0x1f1c, 0x2068,
- 0x6800, 0x007e, 0x6a16, 0x681c, 0xa085, 0x0008, 0x681e, 0x1078,
- 0x17e7, 0x007f, 0x0078, 0x1f0c, 0x047f, 0x2023, 0x0000, 0x007c,
- 0xa282, 0x0003, 0x0050, 0x1f26, 0x1078, 0x1b81, 0x2300, 0x0079,
- 0x1f29, 0x1f2c, 0x1f9f, 0x1fad, 0xa282, 0x0002, 0x0040, 0x1f32,
- 0x1078, 0x1b81, 0x70a0, 0x70a3, 0x0000, 0x70c3, 0x0000, 0x0079,
- 0x1f39, 0x1f41, 0x1f41, 0x1f43, 0x1f77, 0x2913, 0x1f41, 0x1f77,
- 0x1f41, 0x1078, 0x1b81, 0x77b4, 0x1078, 0x2bb1, 0x77b4, 0xa7bc,
- 0x0f00, 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x1f6e, 0x2021,
- 0x3f80, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x0040,
- 0x1f6e, 0x157e, 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009,
- 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x1f6d,
- 0x8420, 0x0070, 0x1f6d, 0x0078, 0x1f5e, 0x157f, 0x8738, 0xa784,
- 0x0007, 0x00c0, 0x1f49, 0x0078, 0x1bdb, 0x0078, 0x1bdb, 0x77b4,
- 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x1f9d, 0x2021, 0x3f80,
- 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x1fc8, 0x0040, 0x1f9d,
- 0x157e, 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009, 0x0005,
- 0x2011, 0x0020, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x1f9c, 0x8420,
- 0x0070, 0x1f9c, 0x0078, 0x1f8d, 0x157f, 0x0078, 0x1bdb, 0x2200,
- 0x0079, 0x1fa2, 0x1fa5, 0x1fa7, 0x1fa7, 0x1078, 0x1b81, 0x70a3,
- 0x0000, 0x70a7, 0x0001, 0x0078, 0x1bd3, 0x2200, 0x0079, 0x1fb0,
- 0x1fb5, 0x1fa7, 0x1fb3, 0x1078, 0x1b81, 0x1078, 0x2428, 0x7000,
- 0xa086, 0x0001, 0x00c0, 0x28ba, 0x1078, 0x28fa, 0x6008, 0xa084,
- 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x28ba, 0x0078, 0x1cd1,
- 0x2404, 0xa005, 0x0040, 0x1fe9, 0x2068, 0x2d04, 0x007e, 0x6810,
- 0xa706, 0x0040, 0x1fd7, 0x2d20, 0x007f, 0x0078, 0x1fc9, 0x007f,
- 0x2022, 0x6916, 0x681c, 0xa205, 0x681e, 0x1078, 0x17e7, 0x6010,
- 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28fa,
- 0x007c, 0xa085, 0x0001, 0x0078, 0x1fe8, 0x2300, 0x0079, 0x1ff0,
- 0x1ff5, 0x1ff3, 0x2038, 0x1078, 0x1b81, 0x78e4, 0xa005, 0x00d0,
- 0x2018, 0x0018, 0x2018, 0x2008, 0xa084, 0x0030, 0x00c0, 0x2004,
- 0x781b, 0x0049, 0x0078, 0x1bd3, 0x78ec, 0xa084, 0x0003, 0x0040,
- 0x2000, 0x2100, 0xa084, 0x0007, 0x0079, 0x200e, 0x2026, 0x202c,
- 0x2020, 0x2016, 0x2d63, 0x2d63, 0x2016, 0x2032, 0x1078, 0x1b81,
- 0x7000, 0xa005, 0x0040, 0x1bdb, 0x2001, 0x0003, 0x0078, 0x22fd,
- 0x1078, 0x2b94, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x1078, 0x2b94,
- 0x781b, 0x00dc, 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x00e3,
- 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x009d, 0x0078, 0x1bd3,
- 0xa584, 0x000f, 0x00c0, 0x2062, 0x1078, 0x2428, 0x7000, 0x0079,
- 0x2041, 0x2049, 0x2056, 0x2049, 0x28ba, 0x204b, 0x28ba, 0x2049,
- 0x2049, 0x1078, 0x1b81, 0x71a0, 0x70a3, 0x0000, 0xa186, 0x0004,
- 0x00c0, 0x2054, 0x0078, 0x2913, 0x0078, 0x28ba, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x28ba,
- 0x0078, 0x1cd1, 0x78e4, 0xa005, 0x00d0, 0x2018, 0x0018, 0x2018,
- 0x2008, 0xa084, 0x0030, 0x00c0, 0x2071, 0x781b, 0x0049, 0x0078,
- 0x1bd3, 0x78ec, 0xa084, 0x0003, 0x0040, 0x206d, 0x2100, 0xa184,
- 0x0007, 0x0079, 0x207b, 0x208b, 0x2091, 0x2085, 0x2083, 0x2d63,
- 0x2d63, 0x2083, 0x2d5b, 0x1078, 0x1b81, 0x1078, 0x2b9c, 0x781b,
- 0x0055, 0x0078, 0x1bd3, 0x1078, 0x2b9c, 0x781b, 0x00dc, 0x0078,
- 0x1bd3, 0x1078, 0x2b9c, 0x781b, 0x00e3, 0x0078, 0x1bd3, 0x1078,
- 0x2b9c, 0x781b, 0x009d, 0x0078, 0x1bd3, 0x2300, 0x0079, 0x20a0,
- 0x20a5, 0x20a3, 0x20a7, 0x1078, 0x1b81, 0x0078, 0x2670, 0x6817,
- 0x0008, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x2670,
- 0x78ec, 0xa084, 0x0003, 0x0040, 0x2670, 0xa184, 0x0007, 0x0079,
- 0x20b9, 0x2026, 0x202c, 0x2020, 0x2d3b, 0x2d63, 0x2d63, 0x20c1,
- 0x2d5b, 0x1078, 0x1b81, 0xa282, 0x0005, 0x0050, 0x20c9, 0x1078,
- 0x1b81, 0x2300, 0x0079, 0x20cc, 0x20cf, 0x22d1, 0x22dd, 0x2200,
- 0x0079, 0x20d2, 0x20d7, 0x20d9, 0x20ec, 0x20d7, 0x22b6, 0x1078,
- 0x1b81, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020,
- 0x0048, 0x2b75, 0xa08a, 0x0004, 0x00c8, 0x2b75, 0x0079, 0x20e8,
- 0x2b75, 0x2b75, 0x2b75, 0x2b17, 0x789b, 0x0018, 0x79a8, 0xa184,
- 0x0080, 0x0040, 0x2101, 0xa184, 0x0018, 0x0040, 0x20fd, 0x0078,
- 0x2b75, 0x7000, 0xa005, 0x00c0, 0x20f7, 0x2011, 0x0003, 0x0078,
- 0x275d, 0xa184, 0x00ff, 0xa08a, 0x0010, 0x00c8, 0x2b75, 0x0079,
- 0x2109, 0x211b, 0x2119, 0x2131, 0x2133, 0x21c5, 0x2b75, 0x2b75,
- 0x21c7, 0x2b75, 0x2b75, 0x22b2, 0x22b2, 0x2b75, 0x2b75, 0x2b75,
- 0x22b4, 0x1078, 0x1b81, 0xa684, 0x1000, 0x0040, 0x2128, 0x2001,
- 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, 0x009a, 0x0078, 0x1bd3,
- 0x6814, 0xa084, 0x8000, 0x0040, 0x212f, 0x6817, 0x0003, 0x0078,
- 0x2d3b, 0x1078, 0x1b81, 0x691c, 0x691e, 0xa684, 0x1800, 0x00c0,
- 0x214d, 0x681c, 0xa084, 0x0001, 0x00c0, 0x2155, 0x6814, 0xa086,
- 0x0008, 0x00c0, 0x2145, 0x6817, 0x0000, 0xa684, 0x0400, 0x0040,
- 0x21c1, 0x781b, 0x0058, 0x0078, 0x1bd3, 0xa684, 0x1000, 0x0040,
- 0x2155, 0x781b, 0x0058, 0x0078, 0x1bd3, 0xa684, 0x0060, 0x0040,
- 0x21bd, 0xa684, 0x0800, 0x0040, 0x21bd, 0xa684, 0x8000, 0x00c0,
- 0x2163, 0x0078, 0x217d, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb2, 0x789b,
- 0x0074, 0x7aac, 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2170, 0x8000,
- 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, 0xa302,
- 0x68ae, 0x6b90, 0x2200, 0xa303, 0x68aa, 0xa684, 0x4000, 0x0040,
- 0x2185, 0xa6b4, 0xbfff, 0x7e5a, 0x6eb2, 0x7000, 0xa086, 0x0003,
- 0x00c0, 0x2192, 0x1078, 0x2f3d, 0x1078, 0x30e2, 0x781b, 0x0067,
- 0x0078, 0x1bd3, 0xa006, 0x1078, 0x3197, 0x6aac, 0x69a8, 0x6c94,
- 0x6b90, 0x2200, 0xa105, 0x0040, 0x21a1, 0x2200, 0xa422, 0x2100,
- 0xa31b, 0x7cd2, 0x7bd6, 0x2300, 0xa405, 0x00c0, 0x21af, 0xa6b5,
- 0x4000, 0x7e5a, 0x6eb2, 0x781b, 0x0067, 0x0078, 0x1bd3, 0x781b,
- 0x0067, 0x2200, 0xa115, 0x00c0, 0x21b9, 0x1078, 0x30f3, 0x0078,
- 0x1bd3, 0x1078, 0x3120, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078,
- 0x1bd3, 0x781b, 0x0058, 0x0078, 0x1bd3, 0x1078, 0x1b81, 0x0078,
- 0x2224, 0x691c, 0xa184, 0x0100, 0x0040, 0x21df, 0xa18c, 0xfeff,
- 0x691e, 0x0c7e, 0x7048, 0x2060, 0x6000, 0xa084, 0xefff, 0x6002,
- 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x2213, 0xa184,
- 0x0200, 0x0040, 0x2213, 0xa18c, 0xfdff, 0x691e, 0x0c7e, 0x7048,
- 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef,
- 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2213,
- 0x1078, 0x2ca8, 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2213, 0x789b,
- 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
- 0x0400, 0x00c0, 0x220f, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x221c,
- 0x781b, 0x0058, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3,
- 0x0078, 0x2b7b, 0x0078, 0x2b7b, 0x2019, 0x0000, 0x7990, 0xa18c,
- 0x0007, 0x0040, 0x2222, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff,
- 0xa286, 0x0001, 0x00c0, 0x2247, 0x2300, 0x7ca8, 0xa400, 0x2018,
- 0xa102, 0x0040, 0x223f, 0x0048, 0x223f, 0x0078, 0x2241, 0x0078,
- 0x21c9, 0x24a8, 0x7aa8, 0x00f0, 0x2241, 0x0078, 0x222d, 0xa284,
- 0x00f0, 0xa086, 0x0020, 0x00c0, 0x22a3, 0x8318, 0x8318, 0x2300,
- 0xa102, 0x0040, 0x2257, 0x0048, 0x2257, 0x0078, 0x22a0, 0xa286,
- 0x0023, 0x0040, 0x2222, 0x6818, 0xa084, 0xfff1, 0x681a, 0x7e58,
- 0xa684, 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085,
- 0x0010, 0x600a, 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48,
- 0x0c7f, 0xa184, 0x0010, 0x0040, 0x227b, 0x1078, 0x2ca8, 0x1078,
- 0x2ad7, 0x0078, 0x228a, 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008,
- 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2213, 0x1078, 0x2ca8,
- 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2213, 0x789b, 0x0060, 0x2800,
- 0x78aa, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x229c,
- 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b, 0x0069, 0x0078, 0x1bd3,
- 0x7aa8, 0x0078, 0x222d, 0x8318, 0x2300, 0xa102, 0x0040, 0x22ac,
- 0x0048, 0x22ac, 0x0078, 0x222d, 0xa284, 0x0080, 0x00c0, 0x2b81,
- 0x0078, 0x2b7b, 0x0078, 0x2b81, 0x0078, 0x2b75, 0x789b, 0x0018,
- 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0040, 0x22c1, 0x1078,
- 0x1b81, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a,
- 0x0004, 0x00c8, 0x2b75, 0x0079, 0x22cd, 0x2b75, 0x2944, 0x2b75,
- 0x2a72, 0xa282, 0x0000, 0x00c0, 0x22d7, 0x1078, 0x1b81, 0x1078,
- 0x2b94, 0x781b, 0x0069, 0x0078, 0x1bd3, 0xa282, 0x0003, 0x00c0,
- 0x22e3, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0xa282, 0x0004, 0x0050, 0x22ef, 0x1078, 0x1b81, 0x2300,
- 0x0079, 0x22f2, 0x22f5, 0x23d2, 0x2403, 0xa286, 0x0003, 0x0040,
- 0x22fb, 0x1078, 0x1b81, 0x2001, 0x0000, 0x703a, 0x7000, 0xa084,
- 0x0007, 0x0079, 0x2303, 0x230b, 0x230d, 0x230d, 0x2513, 0x253b,
- 0x24dd, 0x230b, 0x230b, 0x1078, 0x1b81, 0xa684, 0x1000, 0x00c0,
- 0x2315, 0x1078, 0x2eca, 0x0040, 0x23ac, 0x7868, 0xa08c, 0x00ff,
- 0x0040, 0x235d, 0xa186, 0x0008, 0x00c0, 0x232c, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x235d,
- 0x1078, 0x2eca, 0x0078, 0x2344, 0xa186, 0x0028, 0x00c0, 0x235d,
- 0x1078, 0x2eca, 0x6008, 0xa084, 0xffef, 0x600a, 0x6018, 0xa005,
- 0x0040, 0x2344, 0x8001, 0x601a, 0xa005, 0x0040, 0x2344, 0x8001,
- 0xa005, 0x0040, 0x2344, 0x601e, 0x681c, 0xa084, 0x0001, 0x0040,
- 0x1bdb, 0x681c, 0xa084, 0xfffe, 0x681e, 0x7054, 0x0c7e, 0x2060,
- 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, 0x2d00, 0x00c0,
- 0x235a, 0x6002, 0x6006, 0x0078, 0x1bdb, 0x017e, 0x1078, 0x2428,
- 0x017f, 0xa684, 0xdf00, 0x681a, 0x6827, 0x0000, 0x6f10, 0x81ff,
- 0x0040, 0x23ac, 0xa186, 0x0002, 0x00c0, 0x23a4, 0xa684, 0x0800,
- 0x00c0, 0x237a, 0xa684, 0x0060, 0x0040, 0x237a, 0x78d8, 0x7adc,
- 0x682e, 0x6a2a, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213,
- 0xa290, 0x3600, 0xa290, 0x0000, 0x221c, 0xa384, 0x0100, 0x00c0,
- 0x238b, 0x0078, 0x2391, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012,
- 0x8211, 0xa384, 0x0400, 0x0040, 0x239e, 0x689c, 0xa084, 0x0100,
- 0x00c0, 0x239e, 0x1078, 0x249c, 0x0078, 0x1bdb, 0x6008, 0xa085,
- 0x0002, 0x600a, 0x0078, 0x23ac, 0xa186, 0x0018, 0x0040, 0x23ac,
- 0xa186, 0x0014, 0x0040, 0x1bdb, 0x6912, 0x6814, 0xa084, 0x8000,
- 0x0040, 0x23b4, 0x7038, 0x6816, 0xa68c, 0xdf00, 0x691a, 0x1078,
- 0x28eb, 0x1078, 0x28fa, 0x00c0, 0x23c1, 0x6008, 0xa084, 0xffef,
- 0x600a, 0x681c, 0xa084, 0x0001, 0x00c0, 0x23ca, 0x1078, 0x28e4,
- 0x0078, 0x23ce, 0x7054, 0x2060, 0x6800, 0x6002, 0x1078, 0x17e7,
- 0x0078, 0x1bdb, 0xa282, 0x0004, 0x0048, 0x23d8, 0x1078, 0x1b81,
- 0x2200, 0x0079, 0x23db, 0x23df, 0x23e1, 0x23ee, 0x23e1, 0x1078,
- 0x1b81, 0x7000, 0xa086, 0x0005, 0x0040, 0x23ea, 0x1078, 0x2b94,
- 0x781b, 0x0069, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x7890, 0x8007,
- 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c,
- 0x00ff, 0xa186, 0x0003, 0x0040, 0x23ff, 0x0078, 0x2b75, 0x781b,
- 0x006a, 0x0078, 0x1bd3, 0x681c, 0xa085, 0x0004, 0x681e, 0x82ff,
- 0x00c0, 0x240e, 0x1078, 0x2b94, 0x0078, 0x2415, 0x8211, 0x0040,
- 0x2413, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x1078, 0x2d82, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2425,
- 0x0018, 0x2425, 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c,
- 0xa684, 0x0060, 0x00c0, 0x2432, 0x682f, 0x0000, 0x682b, 0x0000,
- 0x0078, 0x249b, 0xa684, 0x0800, 0x00c0, 0x2441, 0x68b0, 0xa084,
- 0x4800, 0xa635, 0xa684, 0x0800, 0x00c0, 0x2441, 0x1078, 0x2eca,
- 0x007c, 0xa684, 0x0020, 0x0040, 0x246d, 0x78d0, 0x8003, 0x00c8,
- 0x244f, 0xa006, 0x1078, 0x3197, 0x78d4, 0x1078, 0x31fc, 0xa684,
- 0x4000, 0x0040, 0x2459, 0x682f, 0x0000, 0x682b, 0x0000, 0x0078,
- 0x243e, 0x68b0, 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0,
- 0x2453, 0x7038, 0xa005, 0x00c0, 0x2467, 0x703b, 0x0007, 0x79d8,
- 0x7adc, 0x692e, 0x6a2a, 0x0078, 0x243e, 0xa684, 0x4000, 0x0040,
- 0x2477, 0x682f, 0x0000, 0x682b, 0x0000, 0x0078, 0x243e, 0x68b0,
- 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2471, 0x7038,
- 0xa005, 0x00c0, 0x2485, 0x703b, 0x0007, 0x79d8, 0x7adc, 0x78d0,
- 0x80f3, 0x00c8, 0x248c, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
- 0x0000, 0x692e, 0x6a2a, 0x2100, 0xa205, 0x00c0, 0x2499, 0x0078,
- 0x243e, 0x1078, 0x3197, 0x007c, 0xa384, 0x0200, 0x0040, 0x24a4,
- 0x6008, 0xa085, 0x0002, 0x600a, 0x6817, 0x0006, 0x6a28, 0x692c,
- 0x6a3a, 0x693e, 0x682b, 0x0300, 0x682f, 0x0000, 0x6833, 0x2000,
- 0x6893, 0x0000, 0x6897, 0x0020, 0x7000, 0x0079, 0x24b7, 0x24bf,
- 0x24c1, 0x24ca, 0x24bf, 0x24bf, 0x24bf, 0x24bf, 0x24bf, 0x1078,
- 0x1b81, 0x681c, 0xa084, 0x0001, 0x00c0, 0x24ca, 0x1078, 0x28e4,
- 0x0078, 0x24d0, 0x7054, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60,
- 0x2021, 0x3557, 0x2404, 0xa005, 0x0040, 0x24d9, 0x2020, 0x0078,
- 0x24d2, 0x2d22, 0x206b, 0x0000, 0x007c, 0x77b4, 0x1078, 0x2bb1,
- 0xa7bc, 0x0f00, 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x250c,
- 0x0d7e, 0x2001, 0x3f90, 0x2068, 0x0d7f, 0x2021, 0x3f80, 0x2009,
- 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x0040, 0x250c, 0x157e,
- 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009, 0x0004, 0x2011,
- 0x0010, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x250b, 0x8420, 0x0070,
- 0x250b, 0x0078, 0x24fc, 0x157f, 0x8738, 0xa784, 0x0007, 0x00c0,
- 0x24e2, 0x0078, 0x1bdb, 0x1078, 0x28eb, 0x1078, 0x28fa, 0x6827,
- 0x0000, 0x789b, 0x000e, 0x6f10, 0x6813, 0x0002, 0x1078, 0x31cd,
- 0xa684, 0x0800, 0x0040, 0x2528, 0x6918, 0xa18d, 0x2000, 0x691a,
- 0x6814, 0xa084, 0x8000, 0x0040, 0x252f, 0x6817, 0x0000, 0x2021,
- 0x3557, 0x6800, 0x2022, 0x6a38, 0x693c, 0x6a2a, 0x692e, 0x1078,
- 0x17e7, 0x0078, 0x1bdb, 0x1078, 0x2428, 0x6827, 0x0000, 0x789b,
- 0x000e, 0x6f10, 0x1078, 0x2d87, 0xa08c, 0x00ff, 0x6912, 0x6814,
- 0xa084, 0x8000, 0x0040, 0x254e, 0x7038, 0x6816, 0xa68c, 0xdf00,
- 0x691a, 0x70a3, 0x0000, 0x0078, 0x1bdb, 0xa006, 0x1078, 0x2eca,
- 0x6813, 0x0000, 0x6817, 0x0001, 0xa68c, 0xdf00, 0x691a, 0x6827,
- 0x0000, 0x7000, 0x0079, 0x2564, 0x256c, 0x256e, 0x256e, 0x2570,
- 0x2570, 0x2570, 0x256c, 0x256c, 0x1078, 0x1b81, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x28c5, 0x2300, 0x0079,
- 0x2579, 0x257c, 0x257e, 0x25bc, 0x1078, 0x1b81, 0x7000, 0x0079,
- 0x2581, 0x2589, 0x258b, 0x258b, 0x2596, 0x258b, 0x259d, 0x2589,
- 0x2589, 0x1078, 0x1b81, 0xa684, 0x2000, 0x00c0, 0x2596, 0xa6b5,
- 0x2000, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2d3b, 0x6814, 0xa084,
- 0x8000, 0x0040, 0x259d, 0x6817, 0x0007, 0x2009, 0x3518, 0x210c,
- 0xa186, 0x0000, 0x0040, 0x25b2, 0xa186, 0x0001, 0x0040, 0x25b6,
- 0x2009, 0x352b, 0x200b, 0x000b, 0x70a3, 0x0001, 0x781b, 0x0046,
- 0x0078, 0x1bd3, 0x781b, 0x00dd, 0x0078, 0x1bd3, 0x2009, 0x352b,
- 0x200b, 0x000a, 0x0078, 0x1bd3, 0x1078, 0x1b81, 0x2300, 0x0079,
- 0x25c1, 0x25c4, 0x25c6, 0x25e9, 0x1078, 0x1b81, 0x7000, 0x0079,
- 0x25c9, 0x25d1, 0x25d3, 0x25d3, 0x25de, 0x25d3, 0x25e5, 0x25d1,
- 0x25d1, 0x1078, 0x1b81, 0xa684, 0x2000, 0x00c0, 0x25de, 0xa6b5,
- 0x2000, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2d3b, 0x6814, 0xa084,
- 0x8000, 0x0040, 0x25e5, 0x6817, 0x0007, 0x781b, 0x00e4, 0x0078,
- 0x1bd3, 0x681c, 0xa085, 0x0004, 0x681e, 0xa6b5, 0x0800, 0x1078,
- 0x2b94, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x2300, 0x0079, 0x25f8,
- 0x25fb, 0x25fd, 0x25ff, 0x1078, 0x1b81, 0x1078, 0x1b81, 0xa684,
- 0x0400, 0x00c0, 0x261e, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xa184, 0x0020, 0x0040,
- 0x2616, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x261a, 0x2001, 0x0014,
- 0x0078, 0x22fd, 0xa184, 0x0007, 0x0079, 0x2656, 0x7a90, 0xa294,
- 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x2654, 0x789b,
- 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x2645, 0x7ba8, 0x7ba8,
- 0xa386, 0x0001, 0x00c0, 0x2638, 0x2009, 0xfff7, 0x0078, 0x263e,
- 0xa386, 0x0003, 0x00c0, 0x2645, 0x2009, 0xffef, 0x0c7e, 0x7048,
- 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x691c, 0xa18c,
- 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d3b, 0x2026, 0x202c,
- 0x2660, 0x2668, 0x265e, 0x265e, 0x265e, 0x2d3b, 0x1078, 0x1b81,
- 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d43,
- 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d3b,
- 0x79e4, 0xa184, 0x0030, 0x0040, 0x267a, 0x78ec, 0xa084, 0x0003,
- 0x00c0, 0x2682, 0x6814, 0xa085, 0x8000, 0x6816, 0x2001, 0x0014,
- 0x0078, 0x22fd, 0xa184, 0x0007, 0x0079, 0x2686, 0x2d3b, 0x2d3b,
- 0x268e, 0x2d3b, 0x2d63, 0x2d63, 0x2d3b, 0x2d3b, 0xa684, 0x0400,
- 0x00c0, 0x26bf, 0x681c, 0xa084, 0x0001, 0x0040, 0x2d43, 0xa68c,
- 0x2060, 0xa18c, 0xfffb, 0x795a, 0x69b2, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0x789b, 0x0061, 0x6814, 0xa085, 0x8000, 0x6816, 0x78aa,
- 0x157e, 0x137e, 0x147e, 0x20a1, 0x012c, 0x789b, 0x0000, 0x8000,
- 0x80ac, 0xad80, 0x000a, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f,
- 0x6810, 0x8007, 0x789b, 0x007e, 0x78aa, 0x0078, 0x2d43, 0x6814,
- 0xa084, 0x8000, 0x0040, 0x26c6, 0x6817, 0x0008, 0x781b, 0x00d8,
- 0x0078, 0x1bd3, 0x2300, 0x0079, 0x26cd, 0x26d2, 0x274d, 0x26d0,
- 0x1078, 0x1b81, 0x7000, 0xa084, 0x0007, 0x0079, 0x26d7, 0x26df,
- 0x26e1, 0x26fd, 0x26df, 0x26df, 0x24dd, 0x26df, 0x26df, 0x1078,
- 0x1b81, 0x691c, 0xa18d, 0x0001, 0x691e, 0x6800, 0x6006, 0xa005,
- 0x00c0, 0x26eb, 0x6002, 0x6818, 0xa084, 0x000e, 0x0040, 0x26f7,
- 0x7014, 0x68b6, 0x712c, 0xa188, 0x3e80, 0x0078, 0x26f9, 0x2009,
- 0x3f80, 0x2104, 0x6802, 0x2d0a, 0x7156, 0x6eb2, 0xa684, 0x0060,
- 0x0040, 0x274b, 0xa684, 0x0800, 0x00c0, 0x270f, 0xa684, 0x7fff,
- 0x68b2, 0x6890, 0x6894, 0x1078, 0x2eca, 0x0078, 0x274b, 0xa684,
- 0x0020, 0x0040, 0x2721, 0xa006, 0x1078, 0x3197, 0x78d0, 0x8003,
- 0x00c8, 0x271d, 0x78d4, 0x1078, 0x31fc, 0x79d8, 0x7adc, 0x0078,
- 0x2725, 0x1078, 0x2cb9, 0x1078, 0x3197, 0xa684, 0x8000, 0x0040,
- 0x274b, 0xa684, 0x7fff, 0x68b2, 0x789b, 0x0074, 0x1078, 0x2d87,
- 0x2010, 0x1078, 0x2d87, 0x2008, 0xa684, 0x0020, 0x00c0, 0x2743,
- 0x1078, 0x2d87, 0x801b, 0x00c8, 0x273e, 0x8000, 0xa084, 0x003f,
- 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, 0xa302, 0x68ae, 0x6b90,
- 0x2200, 0xa303, 0x68aa, 0x0078, 0x1bdb, 0x0078, 0x2b81, 0x7033,
- 0x0000, 0xa282, 0x0005, 0x0050, 0x2757, 0x1078, 0x1b81, 0x2300,
- 0x0079, 0x275a, 0x275d, 0x2767, 0x278a, 0x2200, 0x0079, 0x2760,
- 0x2765, 0x2b81, 0x2765, 0x27b3, 0x2804, 0x1078, 0x1b81, 0x7000,
- 0xa086, 0x0001, 0x00c0, 0x2774, 0x1078, 0x28fa, 0x1078, 0x2eca,
- 0x7034, 0x600a, 0x0078, 0x2779, 0x7000, 0xa086, 0x0003, 0x0040,
- 0x276e, 0x7003, 0x0005, 0x2001, 0x3f90, 0x2068, 0x703e, 0x7032,
- 0x2200, 0x0079, 0x2783, 0x2b81, 0x2788, 0x27b3, 0x2788, 0x2b81,
- 0x1078, 0x1b81, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2797, 0x1078,
- 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078, 0x279c, 0x7000,
- 0xa086, 0x0003, 0x0040, 0x2791, 0x7003, 0x0005, 0x2001, 0x3f90,
- 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, 0x27a6, 0x27ad, 0x27ab,
- 0x27ad, 0x27ab, 0x27ad, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x7000, 0xa086, 0x0001, 0x00c0, 0x27c0,
- 0x1078, 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078, 0x27c5,
- 0x7000, 0xa086, 0x0003, 0x0040, 0x27ba, 0x7003, 0x0002, 0x7a80,
- 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007, 0xa215,
- 0x2069, 0x3f80, 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040,
- 0x27e0, 0x6810, 0xa206, 0x0040, 0x27f9, 0x6800, 0x0078, 0x27d3,
- 0x7003, 0x0005, 0x2001, 0x3f90, 0x2068, 0x703e, 0x7032, 0x157e,
- 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070, 0x27f1, 0x0078,
- 0x27ea, 0x157f, 0x6a12, 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823,
- 0x0003, 0x6eb0, 0x7e5a, 0x681c, 0xa084, 0x0c00, 0x0040, 0x285a,
- 0x1078, 0x2b9c, 0x0078, 0x285a, 0x7000, 0xa086, 0x0001, 0x00c0,
- 0x2811, 0x1078, 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078,
- 0x2816, 0x7000, 0xa086, 0x0003, 0x0040, 0x280b, 0x7003, 0x0002,
- 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007,
- 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8, 0x3e80, 0x2d04,
- 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040, 0x2835, 0x6810, 0xa206,
- 0x0040, 0x284e, 0x6800, 0x0078, 0x2828, 0x7003, 0x0005, 0x2001,
- 0x3f90, 0x2068, 0x703e, 0x7032, 0x157e, 0x20a9, 0x002f, 0x2003,
- 0x0000, 0x8000, 0x0070, 0x2846, 0x0078, 0x283f, 0x157f, 0x6a12,
- 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823, 0x0003, 0x6eb0, 0x7e5a,
- 0x681c, 0xa084, 0x0c00, 0x0040, 0x285a, 0x1078, 0x2b98, 0x7e58,
- 0x0078, 0x285a, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa080, 0x3600, 0x2060, 0x704a, 0x6000, 0x704e, 0x6004,
- 0x7052, 0xa684, 0x0060, 0x0040, 0x2891, 0x6b94, 0x6c90, 0x69a8,
- 0x68ac, 0xa105, 0x00c0, 0x287f, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde,
- 0xa6b4, 0xb7ff, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2891, 0x68ac,
- 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040, 0x2891, 0x7bd2,
- 0x7bda, 0x7cd6, 0x7cde, 0x68ac, 0xa6b4, 0xbfff, 0x7e5a, 0x1078,
- 0x3120, 0x077f, 0x1078, 0x2cac, 0x2009, 0x006a, 0xa684, 0x0008,
- 0x0040, 0x289c, 0x2009, 0x0069, 0xa6b5, 0x2000, 0x7e5a, 0x791a,
- 0x2d00, 0x703e, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
- 0xa080, 0x3600, 0x2048, 0x0078, 0x1bd3, 0x6020, 0xa005, 0x0040,
- 0x28b9, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, 0x7010,
- 0x6026, 0x007c, 0xa006, 0x1078, 0x2eca, 0x6813, 0x0000, 0x6817,
- 0x0001, 0x681f, 0x0040, 0x681b, 0x0100, 0x7000, 0xa084, 0x0007,
- 0x0079, 0x28ca, 0x28d2, 0x28d4, 0x28d4, 0x28e0, 0x28dc, 0x28d2,
- 0x28d2, 0x28d2, 0x1078, 0x1b81, 0x1078, 0x28eb, 0x1078, 0x28e4,
- 0x1078, 0x17e7, 0x0078, 0x1bdb, 0x70a3, 0x0000, 0x0078, 0x1bdb,
- 0x6817, 0x0000, 0x0078, 0x2513, 0x6800, 0xa005, 0x00c0, 0x28e9,
- 0x6002, 0x6006, 0x007c, 0x6010, 0xa005, 0x0040, 0x28f4, 0x8001,
- 0x00d0, 0x28f4, 0x1078, 0x1b81, 0x6012, 0x6008, 0xa084, 0xffef,
- 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x2900, 0x8001, 0x601a,
- 0x007c, 0x1078, 0x2d82, 0x6817, 0x0018, 0x0078, 0x2931, 0x1078,
- 0x2d82, 0x6817, 0x0019, 0x0078, 0x2931, 0x1078, 0x2d82, 0x6817,
- 0x001a, 0x0078, 0x2931, 0x77b4, 0x1078, 0x2cac, 0x71b8, 0xa18c,
- 0x00ff, 0xa1e8, 0x3e80, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0,
- 0x2923, 0x0078, 0x1bdb, 0x6810, 0x72b4, 0xa206, 0x0040, 0x292b,
- 0x6800, 0x0078, 0x291c, 0x6800, 0x200a, 0x6817, 0x0005, 0x70bf,
- 0x0000, 0x1078, 0x28eb, 0x681c, 0xa084, 0x0001, 0x00c0, 0x293a,
- 0x1078, 0x28e4, 0x1078, 0x28fa, 0x681b, 0x0000, 0x681f, 0x0020,
- 0x1078, 0x17e7, 0x0078, 0x1bdb, 0xa282, 0x0003, 0x00c0, 0x2b75,
- 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x691c, 0xa18d,
- 0x0080, 0x691e, 0xa184, 0x0100, 0x0040, 0x29a4, 0xa18c, 0xfeff,
- 0x691e, 0xa6b4, 0x00ff, 0x0040, 0x298e, 0xa682, 0x000f, 0x0048,
- 0x2965, 0x0040, 0x2965, 0x2031, 0x000f, 0x852b, 0x852b, 0x1078,
- 0x2c2f, 0x0040, 0x296f, 0x1078, 0x2a3e, 0x0078, 0x2997, 0x1078,
- 0x2bea, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078,
- 0x2a62, 0x0c7f, 0x691c, 0xa18d, 0x0100, 0x691e, 0x7e58, 0xa6b5,
- 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x298a, 0x781b, 0x0055,
- 0x0078, 0x1bd3, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x0c7e, 0x2960,
- 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x2a62, 0x0c7f, 0x7e58,
- 0xa684, 0x0400, 0x00c0, 0x29a0, 0x781b, 0x0058, 0x0078, 0x1bd3,
- 0x781b, 0x006a, 0x0078, 0x1bd3, 0x0c7e, 0x7048, 0x2060, 0x6100,
- 0xa18c, 0x1000, 0x0040, 0x29e4, 0x6208, 0x8217, 0xa294, 0x00ff,
- 0xa282, 0x000f, 0x0048, 0x29b8, 0x0040, 0x29b8, 0x2011, 0x000f,
- 0x2600, 0xa202, 0x00c8, 0x29bd, 0x2230, 0x6208, 0xa294, 0x00ff,
- 0x7018, 0xa086, 0x0028, 0x00c0, 0x29cd, 0xa282, 0x0019, 0x00c8,
- 0x29d3, 0x2011, 0x0019, 0x0078, 0x29d3, 0xa282, 0x000c, 0x00c8,
- 0x29d3, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x29d8, 0x2228,
- 0x1078, 0x2bee, 0x852b, 0x852b, 0x1078, 0x2c2f, 0x0040, 0x29e4,
- 0x1078, 0x2a3e, 0x0078, 0x29e8, 0x1078, 0x2bea, 0x1078, 0x2a62,
- 0x7858, 0xa085, 0x0004, 0x785a, 0x0c7f, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x0c7e, 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x2a0c,
- 0x6010, 0xa084, 0x000f, 0x00c0, 0x2a06, 0xa18c, 0x0002, 0x00c0,
- 0x2a06, 0xa18c, 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032,
- 0x2019, 0x0000, 0x0078, 0x2a2e, 0x6208, 0xa294, 0x00ff, 0x7018,
- 0xa086, 0x0028, 0x00c0, 0x2a1c, 0xa282, 0x0019, 0x00c8, 0x2a22,
- 0x2011, 0x0019, 0x0078, 0x2a22, 0xa282, 0x000c, 0x00c8, 0x2a22,
- 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000f,
- 0x0048, 0x2a2e, 0x0040, 0x2a2e, 0x2019, 0x000f, 0x78ab, 0x0001,
- 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
- 0x681c, 0xa085, 0x0100, 0x681e, 0x0c7f, 0x007c, 0x0c7e, 0x7148,
- 0x2160, 0x2008, 0xa084, 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a,
- 0x7eae, 0x6612, 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105,
- 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, 0x8637, 0x8204, 0x8004,
- 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006,
- 0x0c7f, 0x007c, 0x0c7e, 0x7048, 0x2060, 0x6018, 0x789a, 0x78a4,
- 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886,
- 0x0c7f, 0x007c, 0xa282, 0x0002, 0x00c0, 0x2b75, 0x7aa8, 0x691c,
- 0xa18d, 0x0080, 0x691e, 0xa184, 0x0200, 0x0040, 0x2ab7, 0xa18c,
- 0xfdff, 0x691e, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8, 0x2b75,
- 0x1078, 0x2afe, 0x1078, 0x2a62, 0xa980, 0x0001, 0x200c, 0x1078,
- 0x2ca8, 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2aaa, 0x789b, 0x0060,
- 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400,
- 0x00c0, 0x2aa6, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b, 0x0069,
- 0x0078, 0x1bd3, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2ab3, 0x781b,
- 0x0058, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3, 0xa282,
- 0x0002, 0x00c8, 0x2abf, 0xa284, 0x0001, 0x0040, 0x2ac9, 0x7148,
- 0xa188, 0x0000, 0x210c, 0xa18c, 0x2000, 0x00c0, 0x2ac9, 0x2011,
- 0x0000, 0x1078, 0x2bdc, 0x1078, 0x2afe, 0x1078, 0x2a62, 0x7858,
- 0xa085, 0x0004, 0x785a, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x0c7e,
- 0x027e, 0x2960, 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0,
- 0x2aee, 0x6014, 0xa084, 0x0040, 0x00c0, 0x2aec, 0xa18c, 0xffef,
- 0x6106, 0xa006, 0x0078, 0x2afb, 0x2011, 0x0000, 0x78ab, 0x0001,
- 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x681c,
- 0xa085, 0x0200, 0x681e, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7048,
- 0x2060, 0x82ff, 0x0040, 0x2b06, 0x2011, 0x0040, 0x6018, 0xa080,
- 0x0002, 0x789a, 0x78a4, 0xa084, 0xffbf, 0xa205, 0x78a6, 0x6016,
- 0x788a, 0x6004, 0xa084, 0xffef, 0x6006, 0x0c7f, 0x007c, 0x007e,
- 0x7000, 0xa086, 0x0003, 0x0040, 0x2b20, 0x007f, 0x0078, 0x2b23,
- 0x007f, 0x0078, 0x2b71, 0xa684, 0x0020, 0x0040, 0x2b71, 0x7888,
- 0xa084, 0x0040, 0x0040, 0x2b71, 0x78a8, 0x8001, 0x0040, 0x2b30,
- 0x7bb8, 0xa384, 0x003f, 0x831b, 0x00c8, 0x2b37, 0x8000, 0xa005,
- 0x0040, 0x2b58, 0x831b, 0x00c8, 0x2b40, 0x8001, 0x0040, 0x2b6d,
- 0xa006, 0x1078, 0x3197, 0x78b4, 0x1078, 0x31fc, 0x0078, 0x2b71,
- 0xa684, 0x4000, 0x0040, 0x2b58, 0x78b8, 0x801b, 0x00c8, 0x2b51,
- 0x8000, 0xa084, 0x003f, 0x00c0, 0x2b6d, 0xa6b4, 0xbfff, 0x7e5a,
- 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108, 0x00c8, 0x2b61, 0xa291,
- 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x3197, 0x781b,
- 0x0067, 0x1078, 0x3061, 0x0078, 0x1bd3, 0x781b, 0x0067, 0x0078,
- 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x1078, 0x2ba8, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x6823, 0x0002, 0x1078, 0x2b9c, 0x691c, 0xa18d, 0x0020,
- 0x691e, 0x6814, 0xa084, 0x8000, 0x0040, 0x2b90, 0x6817, 0x0005,
- 0x781b, 0x0069, 0x0078, 0x1bd3, 0x2001, 0x0005, 0x0078, 0x2baa,
- 0x2001, 0x000c, 0x0078, 0x2baa, 0x2001, 0x0006, 0x0078, 0x2baa,
- 0x2001, 0x000d, 0x0078, 0x2baa, 0x2001, 0x0009, 0x0078, 0x2baa,
- 0x2001, 0x0007, 0x789b, 0x007f, 0x78aa, 0xa6b5, 0x0008, 0x7e5a,
- 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703,
- 0xa0e0, 0x3600, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f,
- 0x0040, 0x2bca, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085,
- 0x0008, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040,
- 0x0040, 0x2bda, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085,
- 0x0010, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001,
- 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab,
- 0x0004, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 0x0010,
- 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7eaa,
- 0x789b, 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 0xa084,
- 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c,
- 0xfff0, 0x2001, 0x3546, 0x2004, 0xa082, 0x0028, 0x0040, 0x2c18,
- 0x2021, 0x2c8f, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x2c1e,
- 0x2021, 0x2c9b, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064,
- 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 0x2c2d, 0x8420, 0x2300,
- 0xa210, 0x0070, 0x2c2d, 0x0078, 0x2c20, 0x157f, 0x007c, 0x157e,
- 0x2011, 0x3546, 0x2214, 0xa282, 0x0032, 0x0048, 0x2c43, 0x0040,
- 0x2c47, 0x2021, 0x2c81, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011,
- 0x0032, 0x0078, 0x2c57, 0xa282, 0x0028, 0x0040, 0x2c4f, 0x2021,
- 0x2c8f, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x2c55, 0x2021,
- 0x2c9b, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2200,
- 0xa502, 0x0040, 0x2c67, 0x0048, 0x2c67, 0x8420, 0x2300, 0xa210,
- 0x0070, 0x2c64, 0x0078, 0x2c57, 0x157f, 0xa006, 0x007c, 0x157f,
- 0xa582, 0x0064, 0x00c8, 0x2c70, 0x7808, 0xa085, 0x0070, 0x780a,
- 0x78ec, 0xa084, 0x0300, 0x0040, 0x2c7e, 0x2404, 0xa09e, 0x1201,
- 0x00c0, 0x2c7e, 0x2001, 0x2101, 0x0078, 0x2c7f, 0x2404, 0xa005,
- 0x007c, 0x1201, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404, 0x5604,
- 0x6605, 0x6805, 0x7806, 0x7a06, 0x0a07, 0x0c07, 0x0e07, 0x3202,
- 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 0x7605, 0x7805, 0x7a05,
- 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 0x4202, 0x5202, 0x5404,
- 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 0x7c04, 0x7e04, 0x7f04,
- 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
- 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e0, 0x3680,
- 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 0x00c8, 0x2cc0, 0x8000,
- 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x007c, 0x0f7e, 0x2079,
- 0x0100, 0x2009, 0x3540, 0x2091, 0x8000, 0x2104, 0x0079, 0x2cd0,
- 0x2d02, 0x2cda, 0x2cda, 0x2cda, 0x2cda, 0x2cda, 0x2cd8, 0x2cd8,
- 0x1078, 0x1b81, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 0x00c0,
- 0x2cdc, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0, 0x2ce3,
- 0x68b0, 0xa085, 0x4000, 0x68b2, 0x7858, 0xa085, 0x4000, 0x785a,
- 0x7830, 0xa084, 0x0080, 0x00c0, 0x2d02, 0x0018, 0x2d02, 0x6818,
- 0xa084, 0x0020, 0x00c0, 0x2d00, 0x781b, 0x00dd, 0x0078, 0x2d02,
- 0x781b, 0x00e4, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x0c7e, 0x6810,
- 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 0x3600,
- 0x6004, 0xa084, 0x000a, 0x00c0, 0x2d39, 0x6108, 0xa194, 0xff00,
- 0x0040, 0x2d39, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106, 0x0040,
- 0x2d28, 0x2001, 0x0032, 0xa106, 0x0040, 0x2d2c, 0x0078, 0x2d30,
- 0x2009, 0x0020, 0x0078, 0x2d32, 0x2009, 0x003f, 0x0078, 0x2d32,
- 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002,
- 0x6006, 0x0c7f, 0x007c, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x781b, 0x0058, 0x0078, 0x1bd3, 0x781b,
- 0x0055, 0x0078, 0x1bd3, 0x781b, 0x00dd, 0x0078, 0x1bd3, 0x781b,
- 0x00dc, 0x0078, 0x1bd3, 0x781b, 0x00e4, 0x0078, 0x1bd3, 0x781b,
- 0x00e3, 0x0078, 0x1bd3, 0x781b, 0x009e, 0x0078, 0x1bd3, 0x781b,
- 0x009d, 0x0078, 0x1bd3, 0x70a3, 0x0001, 0x781b, 0x0046, 0x0078,
- 0x1bd3, 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2d80, 0x7808,
- 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec,
- 0xa084, 0x0021, 0x0040, 0x2d80, 0x7808, 0xa085, 0x0002, 0x780a,
- 0x007f, 0x007c, 0x7808, 0xa085, 0x0002, 0x780a, 0x007c, 0x7830,
- 0xa084, 0x0040, 0x00c0, 0x2d87, 0x0098, 0x2d90, 0x78ac, 0x007c,
- 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
- 0x78ec, 0xa084, 0x0021, 0x0040, 0x2d9f, 0x0098, 0x2d9d, 0x78ac,
- 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784,
- 0x0070, 0x0040, 0x2dab, 0x6817, 0x0003, 0x7858, 0xa084, 0x3f00,
- 0x681a, 0x682f, 0x0000, 0x682b, 0x0000, 0x784b, 0x0008, 0x78e4,
- 0xa005, 0x00d0, 0x2018, 0xa084, 0x0020, 0x0040, 0x2018, 0x78ec,
- 0xa084, 0x0003, 0x0040, 0x2018, 0x0018, 0x2018, 0x0078, 0x2b7b,
- 0x0c7e, 0x6810, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
- 0xa080, 0x3600, 0x2060, 0x2048, 0x704a, 0x6000, 0x704e, 0x6004,
- 0x7052, 0x0c7f, 0x007c, 0x0020, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, 0x0009, 0x0014,
- 0x0014, 0x9847, 0x0014, 0x0014, 0x98f5, 0x98e7, 0x0014, 0x0014,
- 0x0080, 0x00bf, 0x0100, 0x0402, 0x2008, 0xf880, 0xa20a, 0x0014,
- 0x300b, 0xa20c, 0x0014, 0xa200, 0x8838, 0x817e, 0x842a, 0x84a0,
- 0x3806, 0x8839, 0x28c2, 0x9cc3, 0xa805, 0x0864, 0xa83b, 0x3008,
- 0x28c1, 0x9cc3, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000,
- 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9ca0, 0xa8f3, 0x0864,
- 0xa829, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9ca0, 0x280d, 0xa204,
- 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677,
- 0xa80f, 0x786e, 0x883e, 0xa80c, 0x282b, 0xa205, 0x64a0, 0x67a0,
- 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677, 0xa801, 0x883e,
- 0x2069, 0x28c1, 0x9cc3, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8dc,
- 0xa207, 0x0014, 0xa203, 0x8000, 0x84a8, 0x85a4, 0x1872, 0x849a,
- 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, 0x866f, 0x0704, 0x3008,
- 0x9ca0, 0x0014, 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8, 0x19e2,
- 0xf848, 0x8174, 0x86eb, 0x85eb, 0x872e, 0x87a9, 0x883f, 0x08e6,
- 0xa8f1, 0xf861, 0xa8e8, 0xf801, 0x0014, 0xf881, 0x0016, 0x85b2,
- 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221, 0x0014,
- 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0xa206, 0x6865, 0x817f,
- 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, 0x8008, 0xa8fa, 0x8000,
- 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, 0x84a8, 0x1dc6, 0x20d7,
- 0x8822, 0x0016, 0x8000, 0x2848, 0x1011, 0xa8fc, 0x3008, 0x8000,
- 0xa000, 0x2802, 0x1011, 0xa8fd, 0xa887, 0x3008, 0x283d, 0x1011,
- 0xa8fd, 0xa209, 0x0017, 0x300c, 0x8000, 0x85a4, 0x1de2, 0xdac1,
- 0x0014, 0x26e0, 0x873a, 0xfaa2, 0x19f2, 0x1fe2, 0x0014, 0xa20b,
- 0x0014, 0xa20d, 0x817e, 0x842a, 0x84a0, 0x3806, 0x0210, 0x9ccd,
- 0x0704, 0x0000, 0x127e, 0x2091, 0x2200, 0x2049, 0x2eca, 0x7000,
- 0x7204, 0xa205, 0x720c, 0xa215, 0x7008, 0xa084, 0xfffd, 0xa205,
- 0x0040, 0x2edc, 0x0078, 0x2ee1, 0x7003, 0x0000, 0x127f, 0x2000,
- 0x007c, 0x7000, 0xa084, 0x0001, 0x00c0, 0x2f0f, 0x7108, 0x8104,
- 0x00c8, 0x2eee, 0x1078, 0x2fab, 0x0078, 0x2ee6, 0x700c, 0xa08c,
- 0x007f, 0x0040, 0x2f0f, 0x7004, 0x8004, 0x00c8, 0x2f06, 0x7014,
- 0xa005, 0x00c0, 0x2f02, 0x7010, 0xa005, 0x0040, 0x2f06, 0xa102,
- 0x00c8, 0x2ee6, 0x7007, 0x0010, 0x0078, 0x2f0f, 0x8aff, 0x0040,
- 0x2f0f, 0x1078, 0x316e, 0x00c0, 0x2f09, 0x0040, 0x2ee6, 0x1078,
- 0x2f59, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x6424, 0x84ff,
- 0x0040, 0x2f33, 0x2c70, 0x2039, 0x2f38, 0x2704, 0xae68, 0x680c,
- 0xa630, 0x6808, 0xa529, 0x8421, 0x0040, 0x2f33, 0x8738, 0x2704,
- 0xa005, 0x00c0, 0x2f1e, 0x7098, 0xa075, 0x0040, 0x2f33, 0x2039,
- 0x2f35, 0x0078, 0x2f1d, 0x007c, 0x0000, 0x0004, 0x0008, 0x000c,
- 0x0010, 0x0014, 0x0018, 0x001c, 0x0000, 0x127e, 0x2091, 0x2200,
- 0x2079, 0x3500, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, 0x0002,
- 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007, 0x0002,
- 0x7003, 0x0000, 0x2049, 0x0000, 0x78b3, 0x0000, 0x127f, 0x2000,
- 0x007c, 0x2049, 0x2f59, 0x7004, 0x8004, 0x00c8, 0x2f85, 0x7007,
- 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, 0x2f61, 0xa184, 0x0030,
- 0x0040, 0x2f6e, 0xa086, 0x0030, 0x00c0, 0x2f61, 0x7000, 0xa084,
- 0x0001, 0x00c0, 0x2f85, 0x7008, 0xa084, 0x000c, 0x00c0, 0x2f83,
- 0x710c, 0xa184, 0x0300, 0x00c0, 0x2f83, 0xa184, 0x007f, 0x00c0,
- 0x2f59, 0x0078, 0x2f85, 0x6817, 0x0003, 0x7007, 0x0012, 0x7007,
- 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x2f89, 0x7007, 0x0012,
- 0x7108, 0x8104, 0x0048, 0x2f8e, 0x78b3, 0x0000, 0x7003, 0x0000,
- 0x2049, 0x0000, 0x007c, 0x107e, 0x007e, 0x127e, 0x157e, 0x2091,
- 0x2200, 0x7108, 0x1078, 0x2fab, 0x157f, 0x127f, 0x2091, 0x8001,
- 0x007f, 0x107f, 0x007c, 0x7204, 0x2118, 0x7108, 0x700c, 0xa084,
- 0x0300, 0x00c0, 0x2fed, 0xa184, 0x000c, 0x00c0, 0x2fed, 0x8213,
- 0x8213, 0x8213, 0x8213, 0xa284, 0x0100, 0xa10d, 0x810b, 0x810b,
- 0x810f, 0xa184, 0x0007, 0x0079, 0x2fc5, 0x2fcf, 0x2fdf, 0x2fed,
- 0x2fdf, 0x3001, 0x3001, 0x2fed, 0x2fff, 0x1078, 0x1b81, 0x7007,
- 0x0002, 0x8aff, 0x00c0, 0x2fd8, 0x2049, 0x0000, 0x0078, 0x2fdc,
- 0x1078, 0x316e, 0x00c0, 0x2fd8, 0x78b3, 0x0000, 0x007c, 0x7007,
- 0x0002, 0x8aff, 0x00c0, 0x2fe6, 0x0078, 0x2fea, 0x1078, 0x316e,
- 0x00c0, 0x2fe6, 0x78b3, 0x0000, 0x007c, 0x7007, 0x0002, 0x1078,
- 0x2f59, 0x1078, 0x2cc6, 0x6814, 0xa084, 0x8000, 0x0040, 0x2ffa,
- 0x6817, 0x0002, 0x007c, 0x1078, 0x1b81, 0x1078, 0x1b81, 0x1078,
- 0x3053, 0x7210, 0x7114, 0x700c, 0xa09c, 0x007f, 0x2800, 0xa300,
- 0xa211, 0xa189, 0x0000, 0x78b0, 0xa005, 0x0040, 0x3013, 0x78b3,
- 0x0000, 0x0078, 0x3036, 0x1078, 0x3053, 0x2704, 0x2c58, 0xac60,
- 0x630c, 0x2200, 0xa322, 0x6308, 0x2100, 0xa31b, 0x2400, 0xa305,
- 0x0040, 0x302c, 0x00c8, 0x302c, 0x8412, 0x8210, 0x830a, 0xa189,
- 0x0000, 0x2b60, 0x0078, 0x3013, 0x2b60, 0x8a07, 0xa7ba, 0x2f35,
- 0xa73d, 0x2c00, 0x6882, 0x6f86, 0x6c8e, 0x6b8a, 0x7007, 0x0012,
- 0x1078, 0x2f59, 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x3047,
- 0x6098, 0xa005, 0x0040, 0x3050, 0x2060, 0x2039, 0x2f35, 0x8a51,
- 0x0040, 0x304f, 0x7008, 0xa084, 0x00c0, 0xa086, 0x00c0, 0x007c,
- 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0,
- 0x3060, 0x2039, 0x2f3b, 0x6000, 0xa064, 0x00c0, 0x3060, 0x2d60,
- 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6880, 0x2060,
- 0x6884, 0x6b88, 0x6c8c, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff,
- 0xa0b8, 0x2f35, 0x7e08, 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040,
- 0x0040, 0x307c, 0xa6b5, 0x0001, 0x0f7e, 0x2079, 0x0100, 0x7858,
- 0x0f7f, 0xa084, 0x0040, 0x0040, 0x308b, 0xa684, 0x0001, 0x00c0,
- 0x308b, 0xa6b5, 0x0001, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x308d, 0x7000, 0xa005, 0x0040, 0x3098, 0x1078, 0x1b81,
- 0x2400, 0xa305, 0x00c0, 0x309e, 0x0078, 0x30db, 0x2c58, 0x2704,
- 0xac60, 0x6004, 0xa400, 0x007e, 0x701a, 0x6000, 0xa301, 0x701e,
- 0x2009, 0x04fd, 0x2104, 0xa086, 0x04fd, 0x007f, 0x00c0, 0x30cb,
- 0xa084, 0x0001, 0x0040, 0x30cb, 0xa684, 0x0001, 0x00c0, 0x30cb,
- 0x7013, 0x0001, 0x7017, 0x0000, 0x7602, 0x7007, 0x0001, 0x78b3,
- 0x0001, 0xa4a0, 0x0001, 0xa399, 0x0000, 0x6004, 0xa400, 0x701a,
- 0x6000, 0xa301, 0x701e, 0x620c, 0x2400, 0xa202, 0x7012, 0x6208,
- 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078,
- 0x303b, 0x0078, 0x30dd, 0x1078, 0x316e, 0x00c0, 0x30db, 0x127f,
- 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007,
- 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x30e9, 0x7003, 0x0008,
- 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f,
- 0x2049, 0x30f3, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
- 0x30fc, 0x7000, 0xa005, 0x0040, 0x3107, 0x1078, 0x1b81, 0x7e08,
- 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040, 0x0040, 0x3111, 0xa6b5,
- 0x0001, 0x6824, 0xa005, 0x0040, 0x311d, 0x2050, 0x2039, 0x2f38,
- 0x2d60, 0x1078, 0x316e, 0x00c0, 0x3119, 0x127f, 0x2000, 0x007c,
- 0x127e, 0x007e, 0x017e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f,
- 0x047f, 0x7e08, 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040, 0x0040,
- 0x3133, 0xa6b5, 0x0001, 0x2049, 0x3120, 0x6824, 0xa055, 0x0040,
- 0x316b, 0x2d70, 0x2e60, 0x2039, 0x2f38, 0x2704, 0xae68, 0x680c,
- 0xa422, 0x6808, 0xa31b, 0x0048, 0x3158, 0x8a51, 0x00c0, 0x314a,
- 0x1078, 0x1b81, 0x8738, 0x2704, 0xa005, 0x00c0, 0x313e, 0x7098,
- 0xa075, 0x2060, 0x0040, 0x316b, 0x2039, 0x2f35, 0x0078, 0x313d,
- 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x690c, 0x2400, 0xa122,
- 0x6908, 0x2300, 0xa11b, 0x00c8, 0x3167, 0x1078, 0x1b81, 0x2071,
- 0x0020, 0x0078, 0x308b, 0x127f, 0x2000, 0x007c, 0x7008, 0xa084,
- 0x00c0, 0xa086, 0x00c0, 0x0040, 0x3196, 0x2704, 0xac08, 0x2104,
- 0x701e, 0x8108, 0x2104, 0x701a, 0x8108, 0x2104, 0x7016, 0x8108,
- 0x2104, 0x7012, 0x0f7e, 0x2079, 0x0100, 0x7858, 0x0f7f, 0xa084,
- 0x0040, 0x0040, 0x3191, 0xa684, 0x0001, 0x00c0, 0x3191, 0xa6b5,
- 0x0001, 0x7602, 0x7007, 0x0001, 0x1078, 0x303b, 0x007c, 0x127e,
- 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x3197, 0x0d7f, 0x087f,
- 0x7108, 0xa184, 0x00c0, 0x00c0, 0x31ad, 0x6824, 0xa005, 0x0040,
- 0x31bd, 0x0078, 0x2ee1, 0x0078, 0x31bd, 0x7108, 0x8104, 0x00c8,
- 0x31b5, 0x1078, 0x2fab, 0x0078, 0x31a0, 0x7007, 0x0010, 0x7108,
- 0x8104, 0x00c8, 0x31b7, 0x1078, 0x2fab, 0x7008, 0xa086, 0x0002,
- 0x00c0, 0x31a0, 0x7000, 0xa005, 0x00c0, 0x31a0, 0x7003, 0x0000,
- 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e,
- 0x157e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x31cd, 0xad80,
- 0x0010, 0x20a0, 0x2099, 0x0031, 0x700c, 0xa084, 0x007f, 0x6826,
- 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 0x31eb,
- 0x8000, 0x80ac, 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x31ed, 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f,
- 0x147f, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x2200, 0x0d7f, 0x2049, 0x31fc, 0x6880, 0x2060, 0x6884, 0x6b88,
- 0x6c8c, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0xa0b8, 0x2f35,
- 0x7e08, 0xa6b5, 0x0004, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x3215, 0x2c58, 0x2704, 0xac60, 0x6004, 0xa400, 0x701a,
- 0x6000, 0xa301, 0x701e, 0x7013, 0x0001, 0x7017, 0x0000, 0x7602,
- 0x7007, 0x0001, 0x007f, 0x8007, 0x2009, 0x0031, 0x200a, 0x00a0,
- 0x322f, 0x7108, 0x7007, 0x0002, 0x810c, 0x00c8, 0x322f, 0x810c,
- 0x0048, 0x323c, 0x0078, 0x2fed, 0xa4a0, 0x0001, 0xa399, 0x0000,
- 0x6b8a, 0x6c8e, 0x7007, 0x0004, 0x2049, 0x0000, 0x7003, 0x0000,
- 0x127f, 0x2000, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086,
- 0x818e, 0x00c8, 0x3254, 0xa200, 0x00f0, 0x324f, 0x8086, 0x818e,
- 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x327a, 0xa11a,
- 0x00c8, 0x327a, 0x8213, 0x818d, 0x0048, 0x326d, 0xa11a, 0x00c8,
- 0x326e, 0x00f0, 0x3262, 0x0078, 0x3272, 0xa11a, 0x2308, 0x8210,
- 0x00f0, 0x3262, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f,
- 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x3276,
- 0x00e0, 0x32c2, 0x2091, 0x6000, 0x7820, 0x8001, 0x7822, 0x00c0,
- 0x32bc, 0x7824, 0x7822, 0x2091, 0x8000, 0x2069, 0x3540, 0x6800,
- 0xa084, 0x0007, 0x0040, 0x32a4, 0xa086, 0x0002, 0x0040, 0x32a4,
- 0x6830, 0xa00d, 0x0040, 0x32a4, 0x2104, 0xa005, 0x0040, 0x32a4,
- 0x8001, 0x200a, 0x0040, 0x3372, 0x2061, 0x3680, 0x20a9, 0x0080,
- 0x6034, 0xa005, 0x0040, 0x32b6, 0x8001, 0x6036, 0x00c0, 0x32b6,
- 0x6010, 0xa005, 0x0040, 0x32b6, 0x1078, 0x1a23, 0xace0, 0x0010,
- 0x0070, 0x32bc, 0x0078, 0x32a8, 0x1078, 0x32d7, 0x1078, 0x32c5,
- 0x1078, 0x32fc, 0x2091, 0x8001, 0x007c, 0x783c, 0x8001, 0x783e,
- 0x00c0, 0x32d6, 0x7840, 0x783e, 0x7848, 0xa005, 0x0040, 0x32d6,
- 0x8001, 0x784a, 0x00c0, 0x32d6, 0x1078, 0x1a23, 0x007c, 0x7834,
- 0x8001, 0x7836, 0x00c0, 0x32fb, 0x7838, 0x7836, 0x2091, 0x8000,
- 0x7844, 0xa005, 0x00c0, 0x32e6, 0x2001, 0x0101, 0x8001, 0x7846,
- 0xa080, 0x3e80, 0x2040, 0x2004, 0xa065, 0x0040, 0x32fb, 0x6020,
- 0xa005, 0x0040, 0x32f7, 0x8001, 0x6022, 0x0040, 0x332b, 0x6000,
- 0x2c40, 0x0078, 0x32ec, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0,
- 0x332a, 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x3309, 0x2001,
- 0x0080, 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090,
- 0x3680, 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x332a,
- 0xa290, 0x0009, 0x2204, 0xa005, 0x0040, 0x3322, 0x8001, 0x2012,
- 0x00c0, 0x332a, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a,
- 0x1078, 0x1a23, 0x007c, 0x2069, 0x3540, 0x6800, 0xa005, 0x0040,
- 0x3335, 0x683c, 0xac06, 0x0040, 0x3372, 0x6017, 0x0006, 0x60b0,
- 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff, 0xa085, 0x0060,
- 0x601e, 0x6000, 0x2042, 0x6710, 0x6fb6, 0x1078, 0x169c, 0x6818,
- 0xa005, 0x0040, 0x334d, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef,
- 0x680a, 0x6810, 0x8001, 0x00d0, 0x3357, 0x1078, 0x1b81, 0x6812,
- 0x602f, 0x0000, 0x602b, 0x0000, 0x2c68, 0x1078, 0x17e7, 0x2069,
- 0x3540, 0x2001, 0x0006, 0x68a2, 0x7944, 0xa184, 0x0100, 0x00c0,
- 0x336d, 0x69ba, 0x2001, 0x0004, 0x68a2, 0x1078, 0x1a1e, 0x2091,
- 0x8001, 0x007c, 0x2009, 0x354f, 0x2164, 0x2069, 0x0100, 0x6017,
- 0x0006, 0x6858, 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff,
- 0xa085, 0x0048, 0x601e, 0x602f, 0x0000, 0x602b, 0x0000, 0x6830,
- 0xa084, 0x0040, 0x0040, 0x33ac, 0x684b, 0x0004, 0x20a9, 0x0014,
- 0x6848, 0xa084, 0x0004, 0x0040, 0x3399, 0x0070, 0x3399, 0x0078,
- 0x3390, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001,
- 0x0040, 0x33a6, 0x0070, 0x33a6, 0x0078, 0x339d, 0x20a9, 0x00fa,
- 0x0070, 0x33ac, 0x0078, 0x33a8, 0x6808, 0xa084, 0xfffd, 0x680a,
- 0x681b, 0x0046, 0x2009, 0x3568, 0x200b, 0x0007, 0x784c, 0x784a,
- 0x2091, 0x8001, 0x007c, 0x2079, 0x3500, 0x1078, 0x3404, 0x1078,
- 0x33cc, 0x1078, 0x33e1, 0x1078, 0x33f6, 0x7833, 0x0000, 0x7847,
- 0x0000, 0x784b, 0x0000, 0x007c, 0x2019, 0x000a, 0x2011, 0x3546,
- 0x2204, 0xa086, 0x0032, 0x0040, 0x33de, 0x2019, 0x000c, 0x2204,
- 0xa086, 0x003c, 0x0040, 0x33de, 0x2019, 0x0008, 0x7b2a, 0x7b2e,
- 0x007c, 0x2019, 0x0030, 0x2011, 0x3546, 0x2204, 0xa086, 0x0032,
- 0x0040, 0x33f3, 0x2019, 0x0039, 0x2204, 0xa086, 0x003c, 0x0040,
- 0x33f3, 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019, 0x000d,
- 0x2011, 0x3546, 0x2204, 0xa086, 0x003c, 0x0040, 0x3401, 0x2019,
- 0x000a, 0x7b3e, 0x7b42, 0x007c, 0x2019, 0x2faf, 0x2011, 0x3546,
- 0x2204, 0xa086, 0x0032, 0x0040, 0x3416, 0x2019, 0x3971, 0x2204,
- 0xa086, 0x003c, 0x0040, 0x3416, 0x2019, 0x2626, 0x7b22, 0x7b26,
- 0x007c, 0xda3e
-};
-#define ISP_CODE_LENGTH 0x241a
-#endif
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index 1b8b9d893a7e..b93775007e83 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -1,5 +1,4 @@
-/* $Id: isp.c,v 1.10 1999/01/10 02:55:10 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Machine and OS Independent (well, as best as possible)
* code for the Qlogic ISP SCSI adapters.
@@ -52,7 +51,7 @@
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __linux__
-#include "isp_linux.h"
+#include <isp_linux.h>
#endif
/*
@@ -64,7 +63,7 @@
/*
* Local static data
*/
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
static const char tgtiqd[36] = {
0x03, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x51, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x20, 0x20,
@@ -89,16 +88,11 @@ static const char tgtiqd[36] = {
/*
* Local function prototypes.
*/
-static int isp_parse_async __P((struct ispsoftc *, int));
+static int isp_parse_async __P((struct ispsoftc *, u_int16_t));
static int isp_handle_other_response
__P((struct ispsoftc *, ispstatusreq_t *, u_int8_t *));
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
static int isp_modify_lun __P((struct ispsoftc *, int, int, int));
-static void isp_notify_ack __P((struct ispsoftc *, void *));
-static void isp_handle_atio __P((struct ispsoftc *, void *));
-static void isp_handle_atio2 __P((struct ispsoftc *, void *));
-static void isp_handle_ctio __P((struct ispsoftc *, void *));
-static void isp_handle_ctio2 __P((struct ispsoftc *, void *));
#endif
static void isp_parse_status
__P((struct ispsoftc *, ispstatusreq_t *, ISP_SCSI_XFER_T *));
@@ -107,7 +101,7 @@ static void isp_fw_state __P((struct ispsoftc *));
static void isp_dumpregs __P((struct ispsoftc *, const char *));
static void isp_dumpxflist __P((struct ispsoftc *));
static void isp_prtstst __P((ispstatusreq_t *));
-static char *isp2100_fw_statename __P((int));
+static char *isp2100_fw_statename __P((u_int8_t));
static void isp_mboxcmd __P((struct ispsoftc *, mbreg_t *));
static void isp_update __P((struct ispsoftc *));
@@ -128,7 +122,7 @@ isp_reset(isp)
{
static char once = 1;
mbreg_t mbs;
- int loops, i, dodnld = 1, deadchip;
+ int loops, i, dodnld = 1;
char *revname;
isp->isp_state = ISP_NILSTATE;
@@ -139,26 +133,16 @@ isp_reset(isp)
* here.
*/
isp->isp_dblev = DFLT_DBLEVEL;
- deadchip = ISP_READ(isp, HCCR) & HCCR_RESET;
- if (deadchip) {
- ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
- if (ISP_READ(isp, HCCR) & HCCR_RESET) {
- isp_dumpregs(isp, "still reset after release");
- SYS_DELAY(1000);
- } else {
- deadchip = 1;
- }
- }
-
if (isp->isp_type & ISP_HA_FC) {
revname = "2100";
} else {
sdparam *sdp = isp->isp_param;
- i = ISP_READ(isp, BIU_CONF0) & BIU_CONF0_HW_MASK;
- switch (i) {
+
+ int rev = ISP_READ(isp, BIU_CONF0) & BIU_CONF0_HW_MASK;
+ switch (rev) {
default:
PRINTF("%s: unknown chip rev. 0x%x- assuming a 1020\n",
- isp->isp_name, i);
+ isp->isp_name, rev);
/* FALLTHROUGH */
case 1:
revname = "1020";
@@ -195,20 +179,16 @@ isp_reset(isp)
* Try and figure out if we're connected to a differential bus.
* You have to pause the RISC processor to read SXP registers.
*/
- if (deadchip == 0) {
- ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE);
- i = 100;
- while ((ISP_READ(isp, HCCR) & HCCR_PAUSE) == 0) {
- SYS_DELAY(20);
- if (--i == 0) {
- isp_dumpregs(isp,
- "cannot stop RISC processor");
- i = -1;
- break;
- }
+ ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE);
+ i = 100;
+ while ((ISP_READ(isp, HCCR) & HCCR_PAUSE) == 0) {
+ SYS_DELAY(20);
+ if (--i == 0) {
+ PRINTF("%s: unable to pause RISC processor\n",
+ isp->isp_name);
+ i = -1;
+ break;
}
- } else {
- i = 0;
}
if (i > 0) {
if (isp->isp_bustype != ISP_BT_SBUS) {
@@ -243,10 +223,9 @@ isp_reset(isp)
sdp->isp_clock = 40;
}
/*
- * Restart processor, if necessary.
+ * Restart processor
*/
- if (deadchip == 0)
- ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
+ ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
}
/*
* Machine dependent clock (if set) overrides
@@ -264,7 +243,7 @@ isp_reset(isp)
*/
ISP_RESET0(isp);
- if (once == 1 && deadchip == 0) {
+ if (once == 1) {
once = 0;
/*
* Get the current running firmware revision out of the
@@ -285,7 +264,6 @@ isp_reset(isp)
}
}
-
/*
* Hit the chip over the head with hammer,
* and give the ISP a chance to recover.
@@ -353,21 +331,9 @@ isp_reset(isp)
ISP_WRITE(isp, HCCR, HCCR_CMD_RESET);
SYS_DELAY(100);
- /*
- * Establish some initial burst rate thingies
- * (only for the 1XX0 boards). This really should
- * be done later after fetching from NVRAM.
- */
if (isp->isp_type & ISP_HA_SCSI) {
- u_int16_t conf1 = isp->isp_mdvec->dv_conf1;
- /*
- * Busted FIFO. Turn off all but burst enables.
- */
- if (isp->isp_type == ISP_HA_SCSI_1040A) {
- conf1 &= BIU_BURST_ENABLE;
- }
- ISP_SETBITS(isp, BIU_CONF1, conf1);
- if (conf1 & BIU_BURST_ENABLE) {
+ ISP_SETBITS(isp, BIU_CONF1, isp->isp_mdvec->dv_conf1);
+ if (isp->isp_mdvec->dv_conf1 & BIU_BURST_ENABLE) {
ISP_SETBITS(isp, CDMA_CONF, DMA_ENABLE_BURST);
ISP_SETBITS(isp, DDMA_CONF, DMA_ENABLE_BURST);
}
@@ -740,7 +706,7 @@ isp_fibre_init(isp)
fcparam *fcp;
isp_icb_t *icbp;
mbreg_t mbs;
- int count, loopid;
+ int count;
u_int8_t lwfs;
fcp = isp->isp_param;
@@ -749,41 +715,16 @@ isp_fibre_init(isp)
PRINTF("%s: can't setup DMA for mailboxes\n", isp->isp_name);
return;
}
- /*
- * For systems that don't have BIOS methods for which
- * we can easily change the NVRAM based loopid, we'll
- * override that here. Note that when we initialize
- * the firmware we may get back a different loopid than
- * we asked for anyway. XXX This is probably not the
- * best way to figure this out XXX
- */
-#ifndef __i386__
- loopid = DEFAULT_LOOPID;
-#else
- loopid = fcp->isp_loopid;
-#endif
-
icbp = (isp_icb_t *) fcp->isp_scratch;
- MEMZERO(icbp, sizeof (*icbp));
+ bzero(icbp, sizeof (*icbp));
icbp->icb_version = ICB_VERSION1;
-#ifdef ISP_TARGET_MODE
- fcp->isp_fwoptions = ICBOPT_TGT_ENABLE|ICBOPT_INI_TGTTYPE;
-#else
+
fcp->isp_fwoptions = 0;
-#endif
- fcp->isp_fwoptions |= ICBOPT_INI_ADISC|ICBOPT_FAIRNESS;
- fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE;
- fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS;
-#ifdef CHECKME
- fcp->isp_fwoptions |= ICBOPT_USE_PORTNAME;
-#endif
-#ifdef THIS_WORKED
- /*
- * This has unhappiness in target mode
- */
- fcp->isp_fwoptions |= ICBOPT_FULL_LOGIN;
+#ifdef ISP2100_TARGET_MODE
+ fcp->isp_fwoptions |= ICBOPT_TGT_ENABLE | ICBOPT_INI_TGTTYPE;
+ icbp->icb_iqdevtype = 0x23; /* DPQ_SUPPORTED/PROCESSOR */
#endif
icbp->icb_fwoptions = fcp->isp_fwoptions;
icbp->icb_maxfrmlen = fcp->isp_maxfrmlen;
@@ -796,13 +737,9 @@ isp_fibre_init(isp)
icbp->icb_execthrottle = fcp->isp_execthrottle;
icbp->icb_retry_delay = fcp->isp_retry_delay;
icbp->icb_retry_count = fcp->isp_retry_count;
- icbp->icb_hardaddr = loopid;
MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, fcp->isp_wwn);
- if (icbp->icb_fwoptions & ICBOPT_USE_PORTNAME) {
- u_int64_t portname = fcp->isp_wwn | (2LL << 56);
- MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, portname);
- }
+
icbp->icb_rqstqlen = RQUEST_QUEUE_LEN;
icbp->icb_rsltqlen = RESULT_QUEUE_LEN;
icbp->icb_rqstaddr[RQRSP_ADDR0015] =
@@ -851,15 +788,24 @@ isp_fibre_init(isp)
isp->isp_residx = 0;
/*
- * Wait up to 5 seconds for FW to go to READY state.
+ * Wait up to 12 seconds for FW to go to READY state.
+ * This used to be 3 seconds, but that lost.
+ *
+ * This is all very much not right. The problem here
+ * is that the cable may not be plugged in, or there
+ * may be many many members of the loop that haven't
+ * been logged into.
+ *
+ * This model of doing things doesn't support dynamic
+ * attachment, so we just plain lose (for now).
*/
lwfs = FW_CONFIG_WAIT;
for (count = 0; count < 12000; count++) {
isp_fw_state(isp);
if (lwfs != fcp->isp_fwstate) {
PRINTF("%s: Firmware State %s -> %s\n",
- isp->isp_name, isp2100_fw_statename((int)lwfs),
- isp2100_fw_statename((int)fcp->isp_fwstate));
+ isp->isp_name, isp2100_fw_statename(lwfs),
+ isp2100_fw_statename(fcp->isp_fwstate));
lwfs = fcp->isp_fwstate;
}
if (fcp->isp_fwstate == FW_READY) {
@@ -882,14 +828,16 @@ isp_fibre_init(isp)
}
fcp->isp_loopid = mbs.param[1];
fcp->isp_alpa = mbs.param[2];
- PRINTF("%s: Loop ID %d, ALPA 0x%x\n", isp->isp_name,
+ PRINTF("%s: Loop ID 0x%x, ALPA 0x%x\n", isp->isp_name,
fcp->isp_loopid, fcp->isp_alpa);
isp->isp_state = ISP_INITSTATE;
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
DISABLE_INTS(isp);
- if (isp_modify_lun(isp, 0, 1, 1)) {
- PRINTF("%s: failed to enable target mode\n",
- isp->isp_name);
+ if (isp->isp_fwrev >= ISP_FW_REV(1, 13)) {
+ if (isp_modify_lun(isp, 0, 1, 1)) {
+ PRINTF("%s: failed to establish target mode\n",
+ isp->isp_name);
+ }
}
ENABLE_INTS(isp);
#endif
@@ -900,6 +848,29 @@ isp_fibre_init(isp)
}
/*
+ * Free any associated resources prior to decommissioning and
+ * set the card to a known state (so it doesn't wake up and kick
+ * us when we aren't expecting it to).
+ *
+ * Locks are held before coming here.
+ */
+void
+isp_uninit(isp)
+ struct ispsoftc *isp;
+{
+ /*
+ * Leave with interrupts disabled.
+ */
+ DISABLE_INTS(isp);
+
+ /*
+ * Stop the watchdog timer (if started).
+ */
+ STOP_WATCHDOG(isp_watch, isp);
+}
+
+
+/*
* Start a command. Locking is assumed done in the caller.
*/
@@ -964,7 +935,7 @@ ispscsicmd(xs)
u_int8_t niptr;
ispmarkreq_t *marker = (ispmarkreq_t *) reqp;
- MEMZERO((void *) marker, sizeof (*marker));
+ bzero((void *) marker, sizeof (*marker));
marker->req_header.rqs_entry_count = 1;
marker->req_header.rqs_entry_type = RQSTYPE_MARKER;
marker->req_modifier = SYNC_ALL;
@@ -991,7 +962,7 @@ ispscsicmd(xs)
iptr = niptr;
}
- MEMZERO((void *) reqp, UZSIZE);
+ bzero((void *) reqp, UZSIZE);
reqp->req_header.rqs_entry_count = 1;
if (isp->isp_type & ISP_HA_FC) {
reqp->req_header.rqs_entry_type = RQSTYPE_T2RQS;
@@ -1046,19 +1017,12 @@ ispscsicmd(xs)
reqp->req_flags = 0;
}
}
+ reqp->req_lun_trn = XS_LUN(xs);
reqp->req_target = XS_TGT(xs);
if (isp->isp_type & ISP_HA_SCSI) {
- reqp->req_lun_trn = XS_LUN(xs);
reqp->req_cdblen = XS_CDBLEN(xs);
- } else {
-#ifdef SCCLUN
- reqp->req_scclun = XS_LUN(xs);
-#else
- reqp->req_lun_trn = XS_LUN(xs);
-#endif
-
}
- MEMCPY(reqp->req_cdb, XS_CDBP(xs), XS_CDBLEN(xs));
+ bcopy((void *)XS_CDBP(xs), reqp->req_cdb, XS_CDBLEN(xs));
IDPRINTF(5, ("%s(%d.%d): START%d cmd 0x%x datalen %d\n", isp->isp_name,
XS_TGT(xs), XS_LUN(xs), reqp->req_header.rqs_seqno,
@@ -1158,18 +1122,7 @@ isp_control(isp, ctl, arg)
break;
}
mbs.param[0] = MBOX_ABORT;
-#ifdef SCCLUN
- if (isp->isp_type & ISP_HA_FC) {
- mbs.param[1] = XS_TGT(xs) << 8;
- mbs.param[4] = 0;
- mbs.param[5] = 0;
- mbs.param[6] = XS_LUN(xs);
- } else {
- mbs.param[1] = XS_TGT(xs) << 8 | XS_LUN(xs);
- }
-#else
- mbs.param[1] = XS_TGT(xs) << 8 | XS_LUN(xs);
-#endif
+ mbs.param[1] = XS_TGT(xs) | XS_LUN(xs);
mbs.param[2] = (i+1) >> 16;
mbs.param[3] = (i+1) & 0xffff;
isp_mboxcmd(isp, &mbs);
@@ -1227,7 +1180,7 @@ isp_intr(arg)
if (ISP_READ(isp, BIU_SEMA) & 1) {
u_int16_t mbox = ISP_READ(isp, OUTMAILBOX0);
- if (isp_parse_async(isp, (int) mbox))
+ if (isp_parse_async(isp, mbox))
return (1);
ISP_WRITE(isp, BIU_SEMA, 0);
}
@@ -1319,14 +1272,14 @@ isp_intr(arg)
XS_STS(xs) = sp->req_scsi_status & 0xff;
if (isp->isp_type & ISP_HA_SCSI) {
if (sp->req_state_flags & RQSF_GOT_SENSE) {
- MEMCPY(XS_SNSP(xs), sp->req_sense_data,
+ bcopy(sp->req_sense_data, XS_SNSP(xs),
XS_SNSLEN(xs));
XS_SNS_IS_VALID(xs);
}
} else {
if (XS_STS(xs) == SCSI_CHECK) {
XS_SNS_IS_VALID(xs);
- MEMCPY(XS_SNSP(xs), sp->req_sense_data,
+ bcopy(sp->req_sense_data, XS_SNSP(xs),
XS_SNSLEN(xs));
sp->req_state_flags |= RQSF_GOT_SENSE;
}
@@ -1346,9 +1299,8 @@ isp_intr(arg)
} else {
PRINTF("%s: unknown return %x\n", isp->isp_name,
sp->req_header.rqs_entry_type);
- if (XS_NOERR(xs)) {
+ if (XS_NOERR(xs))
XS_SETERR(xs, HBA_BOTCH);
- }
}
if (isp->isp_type & ISP_HA_SCSI) {
XS_RESID(xs) = sp->req_resid;
@@ -1368,8 +1320,7 @@ isp_intr(arg)
*/
if (XS_STS(xs) == SCSI_CHECK && !(XS_IS_SNS_VALID(xs))) {
if (XS_NOERR(xs)) {
- PRINTF("%s: ARQ failure for target %d lun %d\n",
- isp->isp_name, XS_TGT(xs), XS_LUN(xs));
+ PRINTF("%s: ARQ Failure\n", isp->isp_name);
XS_SETERR(xs, HBA_ARQFAIL);
}
}
@@ -1389,8 +1340,9 @@ isp_intr(arg)
}
ISP_WRITE(isp, INMAILBOX5, optr);
- if (isp->isp_nactive > 0)
- isp->isp_nactive--;
+ isp->isp_nactive--;
+ if (isp->isp_nactive < 0)
+ isp->isp_nactive = 0;
complist[ndone++] = xs; /* defer completion call until later */
}
/*
@@ -1417,15 +1369,12 @@ isp_intr(arg)
static int
isp_parse_async(isp, mbox)
struct ispsoftc *isp;
- int mbox;
+ u_int16_t mbox;
{
switch (mbox) {
case ASYNC_BUS_RESET:
PRINTF("%s: SCSI bus reset detected\n", isp->isp_name);
isp->isp_sendmarker = 1;
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
case ASYNC_SYSTEM_ERROR:
@@ -1452,16 +1401,10 @@ isp_parse_async(isp, mbox)
case ASYNC_TIMEOUT_RESET:
PRINTF("%s: timeout initiated SCSI bus reset\n", isp->isp_name);
isp->isp_sendmarker = 1;
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
- case ASYNC_DEVICE_RESET:
- PRINTF("%s: device reset\n", isp->isp_name);
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
+ case ASYNC_UNSPEC_TMODE:
+ PRINTF("%s: mystery async target completion\n", isp->isp_name);
break;
case ASYNC_EXTMSG_UNDERRUN:
@@ -1497,7 +1440,6 @@ isp_parse_async(isp, mbox)
break;
case ASYNC_CTIO_DONE:
- /* Should only occur when Fast Posting Set for 2100s */
PRINTF("%s: CTIO done\n", isp->isp_name);
break;
@@ -1515,9 +1457,6 @@ isp_parse_async(isp, mbox)
case ASYNC_LOOP_RESET:
PRINTF("%s: Loop RESET\n", isp->isp_name);
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
case ASYNC_PDB_CHANGED:
@@ -1544,122 +1483,62 @@ isp_handle_other_response(isp, sp, optrp)
u_int8_t iptr, optr;
int reqsize = 0;
void *ireqp = NULL;
-#ifdef ISP_TARGET_MODE
- union {
- at_entry_t *atio;
- at2_entry_t *at2io;
- ct_entry_t *ctio;
- ct2_entry_t *ct2io;
- lun_entry_t *lunen;
- in_entry_t *inot;
- in_fcentry_t *inot_fc;
- na_entry_t *nack;
- na_fcentry_t *nack_fc;
- void *voidp;
-#define atio un.atio
-#define at2io un.at2io
-#define ctio un.ctio
-#define ct2io un.ct2io
-#define lunen un.lunen
-#define inot un.inot
-#define inot_fc un.inot_fc
-#define nack un.nack
-#define nack_fc un.nack_fc
- } un;
-
- un.voidp = sp;
-#endif
-
switch (sp->req_header.rqs_entry_type) {
case RQSTYPE_REQUEST:
return (-1);
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
case RQSTYPE_NOTIFY_ACK:
{
- static const char *f =
- "%s: Notify Ack Status 0x%x Sequence Id 0x%x\n"
- /*
- * The ISP is acknowleding our ack of an Immediate Notify.
- */
- if (isp->isp_type & ISP_HA_FC) {
- PRINTF(f, isp->isp_name,
- nack_fc->na-status, nack_fc->na_seqid);
- } else {
- PRINTF(f, isp->isp_name,
- nack->na_status, nack->na_seqid);
- }
+ ispnotify_t *spx = (ispnotify_t *) sp;
+ PRINTF("%s: Immediate Notify Ack %d.%d Status 0x%x Sequence "
+ "0x%x\n", isp->isp_name, spx->req_initiator, spx->req_lun,
+ spx->req_status, spx->req_sequence);
break;
}
case RQSTYPE_NOTIFY:
{
- u_int16_t seqid, status;
-
- /*
- * Either the ISP received a SCSI message it cannot handle
- * or some other out of band condition (e.g., Port Logout)
- * or it is returning an Immediate Notify entry we sent.
- */
- if (isp->isp_type & ISP_HA_FC) {
- status = inot_fc->status;
- seqid = inot_fc->in_seqid;
- } else {
- status = inot->status;
- seqid = inot->seqid & 0xff;
- }
- PRINTF("%s: Immediate Notify Status 0x%x Sequence Id 0x%x\n",
- isp->isp_name, status, seqid);
-
- switch (status) {
- case IN_MSG_RECEIVED:
- case IN_IDE_RECEIVED:
- ptisp_got_msg(ptp, &inot);
- break;
- case IN_RSRC_UNAVAIL:
- PRINTF("%s: Firmware out of ATIOs\n", isp->isp_name);
- break;
- case IN_ABORT_TASK:
- PRINTF("%s: Abort Task iid %d rx_id 0x%x\n",
- inot_fc->in_iid, seqid);
- break;
- case IN_PORT_LOGOUT:
- PRINTF("%s: Port Logout for Initiator %d\n",
- isp->isp_name, inot_fc->in_iid);
- break;
- default:
- PRINTF("%s: bad status (0x%x) in Immediate Notify\n",
- isp->isp_name, status);
- break;
-
- }
- isp_notify_ack(isp, un.voidp);
- reqsize = 0;
+ ispnotify_t *spx = (ispnotify_t *) sp;
+
+ PRINTF("%s: Notify loopid %d to lun %d req_status 0x%x "
+ "req_task_flags 0x%x seq 0x%x\n", isp->isp_name, spx->req_initiator, spx->req_lun, spx->req_status,
+ spx->req_task_flags, spx->req_sequence);
+ reqsize = sizeof (*spx);
+ spx->req_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
+ spx->req_header.rqs_entry_count = 1;
+ spx->req_header.rqs_flags = 0;
+ spx->req_header.rqs_seqno = isp->isp_seqno++;
+ spx->req_handle = (spx->req_initiator<<16) | RQSTYPE_NOTIFY_ACK;
+ if (spx->req_status == IN_RSRC_UNAVAIL)
+ spx->req_flags = LUN_INCR_CMD;
+ else if (spx->req_status == IN_NOCAP)
+ spx->req_flags = LUN_INCR_IMMED;
+ else {
+ reqsize = 0;
+ }
+ ireqp = spx;
break;
}
case RQSTYPE_ENABLE_LUN:
- case RQSTYPE_MODIFY_LUN:
- if (lunen->req_status != 1) {
- PRINTF("%s: ENABLE/MODIFY LUN returned status 0x%x\n",
- isp->isp_name, lunen->req_status);
+ {
+ isplun_t *ip = (isplun_t *) sp;
+ if (ip->req_status != 1) {
+ PRINTF("%s: ENABLE LUN returned status 0x%x\n",
+ isp->isp_name, ip->req_status);
}
break;
+ }
case RQSTYPE_ATIO2:
{
fcparam *fcp = isp->isp_param;
ispctiot2_t local, *ct2 = NULL;
ispatiot2_t *at2 = (ispatiot2_t *) sp;
- int s, lun;
+ int s;
-#ifdef SCCLUN
- lun = at2->req_scclun;
-#else
- lun = at2->req_lun;
-#endif
- PRINTF("%s: atio2 loopid %d for lun %d rxid 0x%x flags0x%x "
- "tflags0x%x ecodes0x%x rqstatus0x%x\n", isp->isp_name,
- at2->req_initiator, lun, at2->req_rxid,
- at2->req_flags, at2->req_taskflags, at2->req_execodes,
- at2->req_status);
+ PRINTF("%s: atio2 loopid %d for lun %d rxid 0x%x flags 0x%x "
+ "task flags 0x%x exec codes 0x%x\n", isp->isp_name,
+ at2->req_initiator, at2->req_lun, at2->req_rxid,
+ at2->req_flags, at2->req_taskflags, at2->req_execodes);
switch (at2->req_status & ~ATIO_SENSEVALID) {
case ATIO_PATH_INVALID:
@@ -1692,15 +1571,13 @@ isp_handle_other_response(isp, sp, optrp)
}
PRINTF("%s: datalen %d cdb0=0x%x\n", isp->isp_name,
at2->req_datalen, at2->req_cdb[0]);
- MEMZERO((void *) ct2, sizeof (*ct2));
+ bzero ((void *) ct2, sizeof (*ct2));
ct2->req_header.rqs_entry_type = RQSTYPE_CTIO2;
ct2->req_header.rqs_entry_count = 1;
ct2->req_header.rqs_flags = 0;
ct2->req_header.rqs_seqno = isp->isp_seqno++;
- ct2->req_handle = (at2->req_initiator << 16) | lun;
-#ifndef SCCLUN
- ct2->req_lun = lun;
-#endif
+ ct2->req_handle = (at2->req_initiator << 16) | at2->req_lun;
+ ct2->req_lun = at2->req_lun;
ct2->req_initiator = at2->req_initiator;
ct2->req_rxid = at2->req_rxid;
@@ -1718,16 +1595,16 @@ isp_handle_other_response(isp, sp, optrp)
ct2->req_seg_count = 1;
if (at2->req_cdb[0] == 0x12) {
s = sizeof(tgtiqd);
- MEMCPY(fcp->isp_scratch, tgtiqd, s);
+ bcopy((void *)tgtiqd, fcp->isp_scratch, s);
} else {
s = at2->req_datalen;
- MEMZERO(fcp->isp_scratch, s);
+ bzero(fcp->isp_scratch, s);
}
ct2->req_m.mode0.req_dataseg[0].ds_base =
fcp->isp_scdma;
ct2->req_m.mode0.req_dataseg[0].ds_count = s;
ct2->req_m.mode0.req_datalen = s;
-#if 1
+#if 0
if (at2->req_datalen < s) {
ct2->req_m.mode1.req_scsi_status |=
CTIO2_RESP_VALID|CTIO2_RSPOVERUN;
@@ -1741,7 +1618,7 @@ isp_handle_other_response(isp, sp, optrp)
default: /* ALL OTHERS */
ct2->req_flags |= CTIO_NODATA | CTIO2_SMODE1;
ct2->req_m.mode1.req_scsi_status = 0;
-#if 1
+#if 0
if (at2->req_datalen) {
ct2->req_m.mode1.req_scsi_status |=
CTIO2_RSPUNDERUN;
@@ -1773,8 +1650,9 @@ isp_handle_other_response(isp, sp, optrp)
ct2->req_m.mode1.req_sense_len = 18;
ct2->req_m.mode1.req_scsi_status |=
at2->req_scsi_status;
- MEMCPY(ct2->req_m.mode1.req_response,
- at2->req_sense, sizeof (at2->req_sense));
+ bcopy((void *)at2->req_sense,
+ (void *)ct2->req_m.mode1.req_response,
+ sizeof (at2->req_sense));
}
break;
}
@@ -1801,15 +1679,6 @@ isp_handle_other_response(isp, sp, optrp)
ireqp = at2;
break;
}
-#undef atio
-#undef at2io
-#undef ctio
-#undef ct2io
-#undef lunen
-#undef inot
-#undef inot_fc
-#undef nack
-#undef nack_fc
#endif
default:
PRINTF("%s: other response type %x\n", isp->isp_name,
@@ -1826,7 +1695,7 @@ isp_handle_other_response(isp, sp, optrp)
PRINTF("%s: Request Queue Overflow other response\n",
isp->isp_name);
} else {
- MEMCPY(reqp, ireqp, reqsize);
+ bcopy(ireqp, reqp, reqsize);
ISP_WRITE(isp, INMAILBOX4, iptr);
isp->isp_reqidx = iptr;
}
@@ -1834,37 +1703,7 @@ isp_handle_other_response(isp, sp, optrp)
return (0);
}
-#ifdef ISP_TARGET_MODE
-
-static void isp_tmd_newcmd_dflt __P((void *, tmd_cmd_t *));
-static void isp_tmd_event_dflt __P((void *, int));
-static void isp_tmd_notify_dflt __P((void *, tmd_notify_t *));
-
-static void isp_tgt_data_xfer __P ((tmd_cmd_t *));
-static void isp_tgt_endcmd __P ((tmd_cmd_t *, u_int8_t));
-static void isp_tgt_done __P ((tmd_cmd_t *));
-
-static void
-isp_tmd_newcmd_dflt(arg0, cmdp)
- void *arg0;
- tmd_cmd_t *cmdp;
-{
-}
-
-static void
-isp_tmd_event_dflt(arg0, event)
- void *arg0;
- int event;
-{
-}
-
-static void
-isp_tmd_notify_dflt(arg0, npt)
- void *arg0;
- tmd_notify_t *npt;
-{
-}
-
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
/*
* Locks held, and ints disabled (if FC).
*
@@ -1890,14 +1729,13 @@ isp_modify_lun(isp, lun, icnt, ccnt)
return (-1);
}
- MEMZERO((void *) ip, sizeof (*ip));
+ bzero((void *) ip, sizeof (*ip));
ip->req_header.rqs_entry_type = RQSTYPE_ENABLE_LUN;
ip->req_header.rqs_entry_count = 1;
+ ip->req_header.rqs_flags = 0;
ip->req_header.rqs_seqno = isp->isp_seqno++;
ip->req_handle = RQSTYPE_ENABLE_LUN;
- if (isp->isp_type & ISP_HA_SCSI) {
- ip->req_lun = lun;
- }
+ ip->req_lun = lun;
ip->req_cmdcount = ccnt;
ip->req_imcount = icnt;
ip->req_timeout = 0; /* default 30 seconds */
@@ -1905,263 +1743,6 @@ isp_modify_lun(isp, lun, icnt, ccnt)
isp->isp_reqidx = iptr;
return (0);
}
-
-static void
-isp_notify_ack(isp, ptrp)
- struct ispsoftc *isp;
- void *ptrp;
-{
- void *reqp;
- u_int8_t iptr, optr;
- union {
- na_fcentry_t _naf;
- na_entry_t _nas;
- } un;
-
- MEMZERO((caddr_t)&un, sizeof (un));
- un._nas.na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
- un._nas.na_header.rqs_entry_count = 1;
-
- if (isp->isp_type & ISP_HA_FC) {
- na_fcentry_t *na = &un._nas;
- if (ptrp) {
- in_fcentry_t *inp = ptrp;
- na->na_iid = inp->in_iid;
- na->na_lun = inp->in_lun;
- na->na_task_flags = inp->in_task_flags;
- na->na_seqid = inp->in_seqid;
- na->na_status = inp->in_status;
- } else {
- na->na_flags = NAFC_RST_CLRD;
- }
- } else {
- na_entry_t *na = &un._nas;
- if (ptrp) {
- in_entry_t *inp = ptrp;
- na->na_iid = inp->in_iid;
- na->na_lun = inp->in_lun;
- na->na_tgt = inp->in_tgt;
- na->na_seqid = inp->in_seqid;
- } else {
- na->na_flags = NA_RST_CLRD;
- }
- }
- optr = isp->isp_reqodx = ISP_READ(isp, OUTMAILBOX4);
- iptr = isp->isp_reqidx;
- reqp = (void *) ISP_QUEUE_ENTRY(isp->isp_rquest, iptr);
- iptr = ISP_NXT_QENTRY(iptr, RQUEST_QUEUE_LEN);
- if (iptr == optr) {
- PRINTF("%s: Request Queue Overflow For isp_notify_ack\n",
- isp->isp_name);
- } else {
- MEMCPY(reqp, ireqp, sizeof (un));
- ISP_WRITE(isp, INMAILBOX4, iptr);
- isp->isp_reqidx = iptr;
- }
-}
-
-/*
- * These are dummy stubs for now until the outside framework is plugged in.
- */
-
-static void
-isp_handle_atio (isp, aep)
- struct ispsoftc *isp;
- at_entry_t *aep;
-{
- int status, connected;
- tmd_cmd_t local, *cdp = &local;
-
- /*
- * Get the ATIO status and see if we're still connected.
- */
- status = aep->at_status;
- connected = ((aep->at_flags & AT_NODISC) != 0);
-
- PRINTF("%s: ATIO status=0x%x, connected=%d\n", isp->isp_name,
- status, connected);
-
- /*
- * The firmware status (except for the SenseValid bit) indicates
- * why this ATIO was sent to us.
- * If SenseValid is set, the firware has recommended Sense Data.
- * If the Disconnects Disabled bit is set in the flags field,
- * we're still connected on the SCSI bus - i.e. the initiator
- * did not set DiscPriv in the identify message. We don't care
- * about this so it's ignored.
- */
- switch(status & ~TGTSVALID) {
- case AT_PATH_INVALID:
- /*
- * ATIO rejected by the firmware due to disabled lun.
- */
- PRINTF("%s: Firmware rejected ATIO for disabled lun %d\n",
- isp->isp_name, aep->at_lun);
- break;
-
- case AT_PHASE_ERROR:
- /*
- * Bus Pase Sequence error.
- *
- * The firmware should have filled in the correct
- * sense data.
- */
-
-
- if (status & TGTSVALID) {
- MEMCPY(&cdp->cd_sensedata, aep->at_sense,
- sizeof (cdp->cd_sensedata));
- PRINTF("%s: Bus Phase Sequence error key 0x%x\n",
- isp->isp_name, cdp->cd_sensedata[2] & 0xf);
- } else {
- PRINTF("%s: Bus Phase Sequence With No Sense\n",
- isp->isp_name);
- }
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- case AT_NOCAP:
- /*
- * Requested Capability not available
- * We sent an ATIO that overflowed the firmware's
- * command resource count.
- */
- PRINTF("%s: Firmware rejected ATIO, command count overflow\n",
- isp->isp_name);
- break;
-
- case AT_BDR_MSG:
- /*
- * If we send an ATIO to the firmware to increment
- * its command resource count, and the firmware is
- * recovering from a Bus Device Reset, it returns
- * the ATIO with this status.
- */
- PRINTF("%s: ATIO returned with BDR received\n", isp->isp_name);
- break;
-
- case AT_CDB:
- /*
- * New CDB
- */
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cd_tagtype = aep->at_tag_type;
- cdp->cd_tagval = aep->at_tag_val;
- MEMCPY(cdp->cd_cdb, aep->at_cdb, 16);
- PRINTF("%s: CDB 0x%x itl %d/%d/%d\n", isp->isp_name,
- cdp->cd_cdb[0], cdp->cd_iid, cdp->cd_tgt, cdp->cd_lun);
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- default:
- PRINTF("%s: Unknown status (0x%x) in ATIO\n",
- isp->isp_name, status);
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cd_tagtype = aep->at_tag_type;
- cdp->cd_tagval = aep->at_tag_val;
- isp_tgtcmd_done(cdp);
- break;
- }
-}
-
-static void
-isp_handle_atio2(isp, aep)
- struct ispsoftc *isp;
- at2_entry_t *aep;
-{
- int status;
- tmd_cmd_t local, *cdp = &local;
-
- /*
- * Get the ATIO2 status.
- */
- status = aep->at_status;
- PRINTD("%s: ATIO2 status=0x%x\n", status);
-
- /*
- * The firmware status (except for the SenseValid bit) indicates
- * why this ATIO was sent to us.
- * If SenseValid is set, the firware has recommended Sense Data.
- */
- switch(status & ~TGTSVALID) {
- case AT_PATH_INVALID:
- /*
- * ATIO rejected by the firmware due to disabled lun.
- */
- PRINTF("%s: Firmware rejected ATIO2 for disabled lun %d\n",
- isp->isp_name, aep->at_lun);
- break;
-
- case AT_NOCAP:
- /*
- * Requested Capability not available
- * We sent an ATIO that overflowed the firmware's
- * command resource count.
- */
- PRINTF("%s: Firmware rejected ATIO2, command count overflow\n",
- isp->isp_name);
- break;
-
- case AT_BDR_MSG:
- /*
- * If we send an ATIO to the firmware to increment
- * its command resource count, and the firmware is
- * recovering from a Bus Device Reset, it returns
- * the ATIO with this status.
- */
- PRINTF("%s: ATIO2 returned with BDR rcvd\n", isp->isp_name);
- break;
-
- case AT_CDB:
- /*
- * New CDB
- */
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = 0;
- cdp->cd_lun = aep->at_lun;
- MEMCPY(cdp->cd_cdb, aep->at_cdb, 16);
- cdp->cd_rxid = aep->at_rxid;
- cdp->cp_origdlen = aep->at_datalen;
- cdp->cp_totbytes = 0;
- PRINTF("%s: CDB 0x%x rx_id 0x%x itl %d/%d/%d dlen %d\n",
- isp->isp_name, cdp->cd_cdb[0], cdp->cd_tagval, cdp->cd_iid,
- cdp->cd_tgt, cdp->cd_lun, aep->at_datalen);
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- default:
- PRINTF("%s: Unknown status (0x%x) in ATIO2\n",
- isp->isp_name, status);
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cp_rxid = aep->at_rxid;
- isp_tgtcmd_done(cdp);
- break;
- }
-}
-
-static void
-isp_handle_ctio(isp, cep)
- struct ispsoftc *isp;
- ct_entry_t *aep;
-{
-}
-
-static void
-isp_handle_ctio2(isp, cep)
- struct ispsoftc *isp;
- at2_entry_t *aep;
-{
-}
#endif
static void
@@ -2288,7 +1869,7 @@ isp_parse_status(isp, sp, xs)
break;
case RQCS_UNEXP_BUS_FREE:
- PRINTF("%s: target %d lun %d had an unexpected bus free\n",
+ PRINTF("%s: target %d lun %d had unexeptected bus free\n",
isp->isp_name, XS_TGT(xs), XS_LUN(xs));
break;
@@ -2323,17 +1904,8 @@ isp_parse_status(isp, sp, xs)
break;
case RQCS_QUEUE_FULL:
- PRINTF("%s: internal queues full for target %d lun %d "
- "status 0x%x\n", isp->isp_name, XS_TGT(xs), XS_LUN(xs),
- XS_STS(xs));
- /*
- * If QFULL or some other status byte is set, then this
- * isn't an error, per se.
- */
- if (XS_STS(xs) != 0) {
- XS_SETERR(xs, HBA_NOERROR);
- return;
- }
+ PRINTF("%s: internal queues full for target %d lun %d\n",
+ isp->isp_name, XS_TGT(xs), XS_LUN(xs));
break;
case RQCS_PHASE_SKIPPED:
@@ -2556,29 +2128,6 @@ isp_mboxcmd(isp, mbp)
}
- /*
- * Check for variants
- */
-#ifdef SCCLUN
- if (isp->isp_type & ISP_HA_FC) {
- switch (mbp->param[0]) {
- case MBOX_ABORT:
- inparam = 7;
- break;
- case MBOX_ABORT_DEVICE:
- case MBOX_START_QUEUE:
- case MBOX_STOP_QUEUE:
- case MBOX_SINGLE_STEP_QUEUE:
- case MBOX_ABORT_QUEUE:
- case MBOX_GET_DEV_QUEUE_STATUS:
- inparam = 3;
- break;
- default:
- break;
- }
- }
-#endif
-
command_known:
/*
@@ -2597,7 +2146,7 @@ command_known:
isp->isp_name, ISP_READ(isp, BIU_ISR));
if (ISP_READ(isp, BIU_SEMA) & 1) {
u_int16_t mbox = ISP_READ(isp, OUTMAILBOX0);
- if (isp_parse_async(isp, (int) mbox))
+ if (isp_parse_async(isp, mbox))
return;
ISP_WRITE(isp, BIU_SEMA, 0);
}
@@ -2726,13 +2275,8 @@ command_known:
isp->isp_name, opcode);
break;
- /*
- * Be silent about these...
- */
-
case ASYNC_LOOP_UP:
case ASYNC_LIP_OCCURRED:
- case ASYNC_PDB_CHANGED:
break;
default:
@@ -2850,7 +2394,6 @@ again:
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
if (mbs.param[0] == ASYNC_LIP_OCCURRED ||
- mbs.param[0] == ASYNC_PDB_CHANGED ||
mbs.param[0] == ASYNC_LOOP_UP) {
if (once++ < 2) {
goto again;
@@ -3106,14 +2649,59 @@ isp_restart(isp)
if (XS_NULL(xs)) {
continue;
}
- if (isp->isp_nactive > 0)
- isp->isp_nactive--;
+ isp->isp_nactive--;
+ if (isp->isp_nactive < 0) {
+ isp->isp_nactive = 0;
+ }
XS_RESID(xs) = XS_XFRLEN(xs);
XS_SETERR(xs, HBA_BUSRESET);
XS_CMD_DONE(xs);
}
}
+void
+isp_watch(arg)
+ void *arg;
+{
+ int i;
+ struct ispsoftc *isp = arg;
+ ISP_SCSI_XFER_T *xs;
+ ISP_LOCKVAL_DECL;
+
+ /*
+ * Look for completely dead commands (but not polled ones).
+ */
+ ISP_ILOCK(isp);
+ for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
+ if ((xs = (ISP_SCSI_XFER_T *) isp->isp_xflist[i]) == NULL) {
+ continue;
+ }
+ if (XS_TIME(xs) == 0) {
+ continue;
+ }
+ XS_TIME(xs) -= (WATCH_INTERVAL * 1000);
+ /*
+ * Avoid later thinking that this
+ * transaction is not being timed.
+ * Then give ourselves to watchdog
+ * periods of grace.
+ */
+ if (XS_TIME(xs) == 0)
+ XS_TIME(xs) = 1;
+ else if (XS_TIME(xs) > -(2 * WATCH_INTERVAL * 1000)) {
+ continue;
+ }
+ if (isp_control(isp, ISPCTL_ABORT_CMD, xs)) {
+ PRINTF("%s: isp_watch failed to abort command\n",
+ isp->isp_name);
+ isp_restart(isp);
+ break;
+ }
+ }
+ ISP_IUNLOCK(isp);
+ RESTART_WATCHDOG(isp_watch, isp);
+}
+
/*
* Miscellaneous debug statements.
*/
@@ -3159,7 +2747,7 @@ isp_prtstst(sp)
static char *
isp2100_fw_statename(state)
- int state;
+ u_int8_t state;
{
switch(state) {
case FW_CONFIG_WAIT: return "Config Wait";
@@ -3232,9 +2820,9 @@ isp_read_nvram(isp)
if (isp->isp_type & ISP_HA_SCSI) {
sdparam *sdp = (sdparam *) isp->isp_param;
+ /* XXX CHECK THIS FOR SANITY XXX */
sdp->isp_fifo_threshold =
- ISP_NVRAM_FIFO_THRESHOLD(nvram_data) |
- (ISP_NVRAM_FIFO_THRESHOLD_128(nvram_data) << 2);
+ ISP_NVRAM_FIFO_THRESHOLD(nvram_data);
sdp->isp_initiator_id =
ISP_NVRAM_INITIATOR_ID(nvram_data);
@@ -3276,6 +2864,8 @@ isp_read_nvram(isp)
sdp->isp_tag_aging =
ISP_NVRAM_TAG_AGE_LIMIT(nvram_data);
+ /* XXX ISP_NVRAM_FIFO_THRESHOLD_128 XXX */
+
sdp->isp_selection_timeout =
ISP_NVRAM_SELECTION_TIMEOUT(nvram_data);
@@ -3284,12 +2874,6 @@ isp_read_nvram(isp)
sdp->isp_fast_mttr = ISP_NVRAM_FAST_MTTR_ENABLE(nvram_data);
-#if 0
- PRINTF("%s: fifo_threshold = 0x%x cbena%d dbena%d\n",
- isp->isp_name, sdp->isp_fifo_threshold,
- sdp->isp_cmd_dma_burst_enable,
- sdp->isp_data_dma_burst_enabl);
-#endif
for (i = 0; i < 16; i++) {
sdp->isp_devparam[i].dev_enable =
ISP_NVRAM_TGT_DEVICE_ENABLE(nvram_data, i);
@@ -3364,9 +2948,8 @@ isp_read_nvram(isp)
fcp->isp_wwn = wwnstore.full64;
wwnstore.full64 = ISP2100_NVRAM_BOOT_NODE_NAME(nvram_data);
if (wwnstore.full64 != 0) {
- PRINTF("%s: BOOT DEVICE WWN 0x%08x%08x\n",
- isp->isp_name, wwnstore.wds.hi32,
- wwnstore.wds.lo32);
+ PRINTF("%s: BOOT DEVICE WWN 0x%08x%08x\n", isp->isp_name,
+ wwnstore.wds.hi32, wwnstore.wds.lo32);
}
fcp->isp_maxalloc =
ISP2100_NVRAM_MAXIOCBALLOCATION(nvram_data);
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index 21d1acd172b9..654c17cc90e8 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $FreeBSD$ */
/*
* Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
*
@@ -42,7 +41,8 @@ static void isp_poll __P((struct cam_sim *));
static void isp_action __P((struct cam_sim *, union ccb *));
void
-isp_attach(struct ispsoftc *isp)
+isp_attach(isp)
+ struct ispsoftc *isp;
{
struct ccb_setasync csa;
struct cam_devq *devq;
@@ -96,7 +96,11 @@ isp_attach(struct ispsoftc *isp)
}
static void
-isp_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
+isp_async(cbarg, code, path, arg)
+ void *cbarg;
+ u_int32_t code;
+ struct cam_path *path;
+ void *arg;
{
struct cam_sim *sim;
struct ispsoftc *isp;
@@ -130,14 +134,17 @@ isp_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
}
static void
-isp_poll(struct cam_sim *sim)
+isp_poll(sim)
+ struct cam_sim *sim;
{
isp_intr((struct ispsoftc *) cam_sim_softc(sim));
}
static void
-isp_action(struct cam_sim *sim, union ccb *ccb)
+isp_action(sim, ccb)
+ struct cam_sim *sim;
+ union ccb *ccb;
{
int s, tgt, error;
struct ispsoftc *isp;
@@ -188,13 +195,8 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
} else {
if (ccb->ccb_h.target_id > (MAX_FC_TARG-1)) {
ccb->ccb_h.status = CAM_PATH_INVALID;
-#ifdef SCCLUN
} else if (ccb->ccb_h.target_lun > 15) {
ccb->ccb_h.status = CAM_PATH_INVALID;
-#else
- } else if (ccb->ccb_h.target_lun > 65535) {
- ccb->ccb_h.status = CAM_PATH_INVALID;
-#endif
}
}
if (ccb->ccb_h.status == CAM_PATH_INVALID) {
@@ -205,14 +207,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
}
- CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_INFO,
- ("cdb[0]=0x%x dlen%d\n",
- (ccb->ccb_h.flags & CAM_CDB_POINTER)?
- ccb->csio.cdb_io.cdb_ptr[0]:
- ccb->csio.cdb_io.cdb_bytes[0], ccb->csio.dxfer_len));
-
s = splcam();
- DISABLE_INTS(isp);
switch (ispscsicmd((ISP_SCSI_XFER_T *) ccb)) {
case CMD_QUEUED:
ccb->ccb_h.status |= CAM_SIM_QUEUED;
@@ -240,7 +235,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
xpt_done(ccb);
break;
}
- ENABLE_INTS(isp);
splx(s);
break;
@@ -484,26 +478,28 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
cpi->max_target = MAX_FC_TARG-1;
cpi->initiator_id =
((fcparam *)isp->isp_param)->isp_loopid;
-#ifdef SCCLUN
- cpi->max_lun = (1 << 16) - 1;
-#else
- cpi->max_lun = (1 << 4) - 1;
-#endif
+ /*
+ * XXX: actually, this is not right if we have
+ * XXX: 1.14 F/W and the second level lun addressing
+ * XXX: in place. It's also probably not right
+ * XXX: even for 1.13 f/w.
+ */
+ cpi->max_lun = 15;
} else {
cpi->initiator_id =
((sdparam *)isp->isp_param)->isp_initiator_id;
cpi->max_target = MAX_TARGETS-1;
if (isp->isp_fwrev >= ISP_FW_REV(7, 55)) {
-#if 0
/*
* Too much breakage.
*/
- cpi->max_lun = (1 << 5) - 1;
+#if 0
+ cpi->max_lun = 31;
#else
- cpi->max_lun = (1 << 3) - 1;
+ cpi->max_lun = 7;
#endif
} else {
- cpi->max_lun = (1 << 3) - 1;
+ cpi->max_lun = 7;
}
}
@@ -522,50 +518,11 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
}
}
-
-#define ISPDDB (CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB)
-void
-isp_done(struct ccb_scsiio *sccb)
-{
- struct ispsoftc *isp = XS_ISP(sccb);
-
- if (XS_NOERR(sccb))
- XS_SETERR(sccb, CAM_REQ_CMP);
- sccb->ccb_h.status &= ~CAM_STATUS_MASK;
- sccb->ccb_h.status |= sccb->ccb_h.spriv_field0;
- if ((sccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP &&
- (sccb->scsi_status != SCSI_STATUS_OK)) {
- sccb->ccb_h.status &= ~CAM_STATUS_MASK;
- sccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
- }
- if ((sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
- IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",
- isp->isp_name, sccb->ccb_h.target_id,
- sccb->ccb_h.target_lun, sccb->ccb_h.status));
- xpt_freeze_devq(sccb->ccb_h.path, 1);
- sccb->ccb_h.status |= CAM_DEV_QFRZN;
- }
- }
- if (isp->isp_osinfo.simqfrozen) {
- sccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- isp->isp_osinfo.simqfrozen = 0;
- }
- sccb->ccb_h.status &= ~CAM_SIM_QUEUED;
- if (CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB) &&
- (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- xpt_print_path(sccb->ccb_h.path);
- printf("cam completion status 0x%x\n", sccb->ccb_h.status);
- }
- xpt_done((union ccb *) sccb);
-}
-
#else
static void ispminphys __P((struct buf *));
static u_int32_t isp_adapter_info __P((int));
static int ispcmd __P((ISP_SCSI_XFER_T *));
-static void isp_watch __P((void *arg));
static struct scsi_adapter isp_switch = {
ispcmd, ispminphys, 0, 0, isp_adapter_info, "isp", { 0, 0 }
@@ -580,7 +537,8 @@ static int isp_poll __P((struct ispsoftc *, ISP_SCSI_XFER_T *, int));
* Complete attachment of hardware, include subdevices.
*/
void
-isp_attach(struct ispsoftc *isp)
+isp_attach(isp)
+ struct ispsoftc *isp;
{
struct scsibus_data *scbus;
@@ -589,7 +547,6 @@ isp_attach(struct ispsoftc *isp)
return;
}
isp->isp_state = ISP_RUNSTATE;
- START_WATCHDOG(isp);
isp->isp_osinfo._link.adapter_unit = isp->isp_osinfo.unit;
isp->isp_osinfo._link.adapter_softc = isp;
@@ -626,7 +583,8 @@ isp_attach(struct ispsoftc *isp)
*/
static void
-ispminphys(struct buf *bp)
+ispminphys(bp)
+ struct buf *bp;
{
/*
* Only the 10X0 has a 24 bit limit.
@@ -637,7 +595,8 @@ ispminphys(struct buf *bp)
}
static u_int32_t
-isp_adapter_info(int unit)
+isp_adapter_info(unit)
+ int unit;
{
/*
* XXX: FIND ISP BASED UPON UNIT AND GET REAL QUEUE LIMIT FROM THAT
@@ -646,7 +605,8 @@ isp_adapter_info(int unit)
}
static int
-ispcmd(ISP_SCSI_XFER_T *xs)
+ispcmd(xs)
+ ISP_SCSI_XFER_T *xs;
{
struct ispsoftc *isp;
int r;
@@ -683,7 +643,10 @@ ispcmd(ISP_SCSI_XFER_T *xs)
}
static int
-isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
+isp_poll(isp, xs, mswait)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *xs;
+ int mswait;
{
while (mswait) {
@@ -698,74 +661,4 @@ isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
}
return (1);
}
-
-static void
-isp_watch(void *arg)
-{
- int i;
- struct ispsoftc *isp = arg;
- ISP_SCSI_XFER_T *xs;
- ISP_ILOCKVAL_DECL;
-
- /*
- * Look for completely dead commands (but not polled ones).
- */
- ISP_ILOCK(isp);
- for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
- if ((xs = (ISP_SCSI_XFER_T *) isp->isp_xflist[i]) == NULL) {
- continue;
- }
- if (XS_TIME(xs) == 0) {
- continue;
- }
- XS_TIME(xs) -= (WATCH_INTERVAL * 1000);
- /*
- * Avoid later thinking that this
- * transaction is not being timed.
- * Then give ourselves to watchdog
- * periods of grace.
- */
- if (XS_TIME(xs) == 0)
- XS_TIME(xs) = 1;
- else if (XS_TIME(xs) > -(2 * WATCH_INTERVAL * 1000)) {
- continue;
- }
- if (isp_control(isp, ISPCTL_ABORT_CMD, xs)) {
- printf("%s: isp_watch failed to abort command\n",
- isp->isp_name);
- isp_restart(isp);
- break;
- }
- }
- RESTART_WATCHDOG(isp_watch, arg);
- ISP_IUNLOCK(isp);
-}
#endif
-
-/*
- * Free any associated resources prior to decommissioning and
- * set the card to a known state (so it doesn't wake up and kick
- * us when we aren't expecting it to).
- *
- * Locks are held before coming here.
- */
-void
-isp_uninit(struct ispsoftc *isp)
-{
- ISP_ILOCKVAL_DECL;
- ISP_ILOCK(isp);
- /*
- * Leave with interrupts disabled.
- */
- DISABLE_INTS(isp);
-
- /*
- * Turn off the watchdog (if active).
- */
- STOP_WATCHDOG(isp_watch, isp);
-
- /*
- * And out...
- */
- ISP_IUNLOCK(isp);
-}
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 3e2e84328fc7..6677b7c29bf9 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -1,5 +1,4 @@
-/* $Id: isp_freebsd.h,v 1.8 1999/01/10 02:51:06 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions (non CAM version)
*---------------------------------------
@@ -36,7 +35,7 @@
#define _ISP_FREEBSD_H
#define ISP_PLATFORM_VERSION_MAJOR 0
-#define ISP_PLATFORM_VERSION_MINOR 98
+#define ISP_PLATFORM_VERSION_MINOR 97
#include <sys/param.h>
@@ -80,11 +79,7 @@ struct isposinfo {
#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
#define DFLT_DBLEVEL 1
-#define MEMZERO BZERO
-#define MEMCPY(dst, src, amt) bcopy((src), (dst), (amt))
-
#define ISP_LOCKVAL_DECL int isp_spl_save
-#define ISP_ILOCKVAL_DECL ISP_LOCKVAL_DECL
#define ISP_UNLOCK(isp) (void) splx(isp_spl_save)
#define ISP_LOCK(isp) isp_spl_save = splbio()
#define ISP_ILOCK(isp) ISP_LOCK(isp)
@@ -103,7 +98,7 @@ struct isposinfo {
#define XS_STS(xs) (xs)->status
#define XS_TIME(xs) (xs)->timeout
#define XS_SNSP(xs) (&(xs)->sense)
-#define XS_SNSLEN(xs) (sizeof((xs)->sense))
+#define XS_SNSLEN(xs) (sizeof (xs)->sense)
#define XS_SNSKEY(xs) ((xs)->sense.ext.extended.flags)
#define HBA_NOERROR XS_NOERROR
@@ -135,15 +130,18 @@ struct isposinfo {
/*
* Our default tag
*/
-#define XS_KINDOF_TAG(xs) REQFLAG_STAG
+#define XS_KINDOF_TAG(xs) REQFLAG_OTAG
#define CMD_COMPLETE COMPLETE
#define CMD_EAGAIN TRY_AGAIN_LATER
#define CMD_QUEUED SUCCESSFULLY_QUEUED
+
+
#define isp_name isp_osinfo.name
+
#define SYS_DELAY(x) DELAY(x)
#define WATCH_INTERVAL 30
@@ -161,7 +159,6 @@ struct isposinfo {
#define RESTART_WATCHDOG(f, s) START_WATCHDOG(f, s)
extern void isp_attach __P((struct ispsoftc *));
-extern void isp_uninit __P((struct ispsoftc *));
#define PVS "Qlogic ISP Driver, FreeBSD Non-Cam"
diff --git a/sys/dev/isp/isp_freebsd_cam.h b/sys/dev/isp/isp_freebsd_cam.h
index 7649a15511a1..383b0078f7d1 100644
--- a/sys/dev/isp/isp_freebsd_cam.h
+++ b/sys/dev/isp/isp_freebsd_cam.h
@@ -1,5 +1,4 @@
-/* $Id: isp_freebsd_cam.h,v 1.11 1999/01/10 02:51:06 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions (CAM version)
*---------------------------------------
@@ -69,6 +68,7 @@ struct isposinfo {
int unit;
struct cam_sim *sim;
struct cam_path *path;
+ struct callout_handle watchid;
volatile char simqfrozen;
};
@@ -89,9 +89,6 @@ struct isposinfo {
#define PRINTF printf
#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
-#define MEMZERO bzero
-#define MEMCPY(dst, src, amt) bcopy((src), (dst), (amt))
-
#ifdef CAMDEBUG
#define DFLT_DBLEVEL 2
#else
@@ -99,7 +96,6 @@ struct isposinfo {
#endif
#define ISP_LOCKVAL_DECL int isp_spl_save
-#define ISP_ILOCKVAL_DECL ISP_LOCKVAL_DECL
#define ISP_UNLOCK(isp) (void) splx(isp_spl_save)
#define ISP_LOCK(isp) isp_spl_save = splcam()
#define ISP_ILOCK(isp) ISP_LOCK(isp)
@@ -119,7 +115,7 @@ struct isposinfo {
#define XS_STS(ccb) (ccb)->scsi_status
#define XS_TIME(ccb) (ccb)->ccb_h.timeout
#define XS_SNSP(ccb) (&(ccb)->sense_data)
-#define XS_SNSLEN(ccb) imin((sizeof((ccb)->sense_data)), ccb->sense_len)
+#define XS_SNSLEN(ccb) imin((sizeof (ccb)->sense_data), ccb->sense_len)
#define XS_SNSKEY(ccb) ((ccb)->sense_data.flags & 0xf)
/*
@@ -148,8 +144,32 @@ struct isposinfo {
#define XS_NOERR(ccb) \
((ccb)->ccb_h.spriv_field0 == CAM_REQ_INPROG)
-extern void isp_done(struct ccb_scsiio *);
-#define XS_CMD_DONE(sccb) isp_done(sccb)
+#define XS_CMD_DONE(sccb) \
+ if (XS_NOERR((sccb))) \
+ XS_SETERR((sccb), CAM_REQ_CMP); \
+ (sccb)->ccb_h.status &= ~CAM_STATUS_MASK; \
+ (sccb)->ccb_h.status |= (sccb)->ccb_h.spriv_field0; \
+ if (((sccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP && \
+ (sccb)->scsi_status != SCSI_STATUS_OK) { \
+ (sccb)->ccb_h.status &= ~CAM_STATUS_MASK; \
+ (sccb)->ccb_h.status |= CAM_SCSI_STATUS_ERROR; \
+ } \
+ if (((sccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { \
+ if (((sccb)->ccb_h.status & CAM_DEV_QFRZN) == 0) { \
+ struct ispsoftc *isp = XS_ISP((sccb)); \
+ IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",\
+ isp->isp_name, (sccb)->ccb_h.target_id, \
+ (sccb)->ccb_h.target_lun, (sccb)->ccb_h.status)); \
+ xpt_freeze_devq((sccb)->ccb_h.path, 1); \
+ (sccb)->ccb_h.status |= CAM_DEV_QFRZN; \
+ } \
+ } \
+ if ((XS_ISP((sccb)))->isp_osinfo.simqfrozen) { \
+ (sccb)->ccb_h.status |= CAM_RELEASE_SIMQ; \
+ (XS_ISP((sccb)))->isp_osinfo.simqfrozen = 0; \
+ } \
+ (sccb)->ccb_h.status &= ~CAM_SIM_QUEUED; \
+ xpt_done((union ccb *)(sccb))
#define XS_IS_CMD_DONE(ccb) \
(((ccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG)
@@ -174,8 +194,14 @@ extern void isp_done(struct ccb_scsiio *);
#define CMD_QUEUED 2
#define SYS_DELAY(x) DELAY(x)
-#define STOP_WATCHDOG(f, s)
+
+#define WATCH_INTERVAL 30
+#define START_WATCHDOG(f, s) \
+ (s)->isp_osinfo.watchid = timeout(f, s, WATCH_INTERVAL * hz), \
+ s->isp_dogactive = 1
+#define STOP_WATCHDOG(f, s) untimeout(f, s, (s)->isp_osinfo.watchid),\
+ (s)->isp_dogactive = 0
+#define RESTART_WATCHDOG(f, s) START_WATCHDOG(f, s)
extern void isp_attach __P((struct ispsoftc *));
-extern void isp_uninit __P((struct ispsoftc *));
#endif /* _ISP_FREEBSD_CAM_H */
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h
index 24de5aebf94c..b3f82a7821d5 100644
--- a/sys/dev/isp/ispmbox.h
+++ b/sys/dev/isp/ispmbox.h
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: ispmbox.h,v 1.7 1998/09/14 23:23:26 mjacob Exp $ */
/*
* Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
*
@@ -154,7 +153,7 @@ typedef struct {
#define ASYNC_RSP_XFER_ERR 0x8004
#define ASYNC_QWAKEUP 0x8005
#define ASYNC_TIMEOUT_RESET 0x8006
-#define ASYNC_DEVICE_RESET 0x8007
+#define ASYNC_UNSPEC_TMODE 0x8007
#define ASYNC_EXTMSG_UNDERRUN 0x800A
#define ASYNC_SCAM_INT 0x800B
#define ASYNC_HUNG_SCSI 0x800C
@@ -168,7 +167,7 @@ typedef struct {
#define ASYNC_LOOP_UP 0x8011
#define ASYNC_LOOP_DOWN 0x8012
#define ASYNC_LOOP_RESET 0x8013
-#define ASYNC_PDB_CHANGED 0x8014
+#define ASYNC_PDB_CHANGED 0x8014 /* Port Database Changed */
#define ASYNC_CHANGE_NOTIFY 0x8015
/*
@@ -242,7 +241,7 @@ typedef struct {
u_int16_t req_cdblen;
#define req_modifier req_cdblen /* marker packet */
u_int16_t req_flags;
- u_int16_t req_reserved;
+ u_int16_t _res1;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[12];
@@ -260,7 +259,7 @@ typedef struct {
u_int8_t req_lun_trn;
u_int8_t req_target;
#endif
- u_int16_t req_scclun;
+ u_int16_t _res1;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
@@ -425,7 +424,169 @@ typedef struct {
#define RQSTF_NEGOTIATION 0x0080
/*
- * FC (ISP2100) specific initialization data structures
+ * Target Mode Structures
+ */
+/*
+ * Used for Enable LUN and Modify Lun types.
+ * (for FC, pre-1.14 FW layout revision).
+ */
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t _reserved0;
+ u_int8_t req_lun; /* HOST->FW: LUN to enable */
+#else
+ u_int8_t req_lun; /* HOST->FW: LUN to enable */
+ u_int8_t _reserved0;
+#endif
+ u_int16_t _reserved1[3];
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t _reserved2;
+ u_int8_t req_status; /* FW->HOST: Status of Request */
+ u_int8_t req_imcount; /* HOST->FW: Immediate Notify Count */
+ u_int8_t req_cmdcount; /* HOST->FW: ATIO Count */
+#else
+ u_int8_t req_status; /* FW->HOST: Status of Request */
+ u_int8_t _reserved2;
+ u_int8_t req_cmdcount; /* HOST->FW: ATIO Count */
+ u_int8_t req_imcount; /* HOST->FW: Immediate Notify Count */
+#endif
+ u_int16_t _reserved3;
+ u_int16_t req_timeout; /* HOST->FW: Lun timeout value */
+} isplun_t;
+/* inbound status */
+#define LUN_OKAY 0x01
+#define LUN_ERR 0x04
+#define LUN_NOCAP 0x16
+#define LUN_ENABLED 0x3e
+/* outbound flags */
+#define LUN_INCR_CMD 0x0001
+#define LUN_DECR_CMD 0x0002
+#define LUN_INCR_IMMED 0x0100
+#define LUN_DECR_IMMED 0x0200
+
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_flags; /* NOTIFY_ACK only */
+ u_int16_t _reserved1[2];
+ u_int16_t req_status;
+ u_int16_t req_task_flags;
+ u_int16_t req_sequence;
+} ispnotify_t;
+
+#define IN_NOCAP 0x16
+#define IN_IDE_RECEIVED 0x33
+#define IN_RSRC_UNAVAIL 0x34
+#define IN_MSG_RECEIVED 0x36
+
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_rxid;
+ u_int16_t req_flags;
+ u_int16_t req_status;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_taskcodes;
+ u_int8_t _reserved0;
+ u_int8_t req_execodes;
+ u_int8_t req_taskflags;
+#else
+ u_int8_t _reserved0;
+ u_int8_t req_taskcodes;
+ u_int8_t req_taskflags;
+ u_int8_t req_execodes;
+#endif
+ u_int8_t req_cdb[16];
+ u_int32_t req_datalen;
+ u_int16_t req_scclun;
+ u_int16_t _reserved1;;
+ u_int16_t req_scsi_status;
+ u_int8_t req_sense[18];
+} ispatiot2_t;
+
+#define ATIO_PATH_INVALID 0x07
+#define ATIO_PHASE_ERROR 0x14
+#define ATIO_NOCAP 0x16
+#define ATIO_BDR_MSG 0x17
+#define ATIO_CDB_RECEIVED 0x3d
+
+#define ATIO_SENSEVALID 0x80
+
+/*
+ * Continue Target I/O, type 2
+ */
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_rxid;
+ u_int16_t req_flags;
+ u_int16_t req_status;
+ u_int16_t req_timeout;
+ u_int16_t req_seg_count; /* data segment count */
+ u_int8_t req_reloff[4]; /* relative offset */
+ u_int8_t req_resid[4]; /* residual */
+ u_int8_t _reserved0[4];
+ union { /* should be offset 0x20 */
+ struct {
+ u_int16_t _reserved0;
+ u_int16_t req_scsi_status;
+ u_int32_t req_datalen;
+ ispds_t req_dataseg[ISP_RQDSEG_T2];
+ } mode0;
+ struct {
+ u_int16_t req_sense_len;
+ u_int16_t req_scsi_status;
+ u_int32_t req_response_length;
+ u_int8_t req_response[26];
+ } mode1;
+ struct {
+ u_int16_t _reserved0[2];
+ u_int32_t req_datalen;
+ ispds_t req_fcpiudata;
+ } mode2;
+ } req_m;
+} ispctiot2_t;
+
+#define CTIO_SEND_STATUS 0x8000
+#define CTIO_SEND_DATA 0x0040 /* To initiator */
+#define CTIO_RECV_DATA 0x0080
+#define CTIO_NODATA 0x00C0
+
+#define CTIO2_SMODE0 0x0000
+#define CTIO2_SMODE1 0x0001
+#define CTIO2_SMODE2 0x0002
+
+#define CTIO2_RESP_VALID 0x0100
+#define CTIO2_STATUS_VALID 0x0200
+#define CTIO2_RSPOVERUN 0x0400
+#define CTIO2_RSPUNDERUN 0x0800
+
+
+/*
+ * FC (ISP2100) specific data structures
*/
/*
@@ -498,6 +659,16 @@ typedef struct {
#define RQRSP_ADDR4863 3
+#if BYTE_ORDER == BIG_ENDIAN
+#define ICB_NNM0 6
+#define ICB_NNM1 7
+#define ICB_NNM2 4
+#define ICB_NNM3 5
+#define ICB_NNM4 2
+#define ICB_NNM5 3
+#define ICB_NNM6 0
+#define ICB_NNM7 1
+#else
#define ICB_NNM0 7
#define ICB_NNM1 6
#define ICB_NNM2 5
@@ -506,6 +677,7 @@ typedef struct {
#define ICB_NNM5 2
#define ICB_NNM6 1
#define ICB_NNM7 0
+#endif
#define MAKE_NODE_NAME_FROM_WWN(array, wwn) \
array[ICB_NNM0] = (u_int8_t) ((wwn >> 0) & 0xff), \
@@ -517,425 +689,4 @@ typedef struct {
array[ICB_NNM6] = (u_int8_t) ((wwn >> 48) & 0xff), \
array[ICB_NNM7] = (u_int8_t) ((wwn >> 56) & 0xff)
-/*
- * Target Mode Structures
- */
-#define TGTSVALID 0x80 /* scsi status & sense data valid */
-#define SUGGSENSELEN 18
-
-/*
- * Structure for Enable Lun and Modify Lun queue entries
- */
-typedef struct {
- isphdr_t le_header;
- u_int32_t le_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t le_lun;
- u_int8_t le_rsvd;
- u_int8_t le_ops; /* Modify LUN only */
- u_int8_t le_tgt; /* Not for FC */
-#endif
- u_int32_t le_flags; /* Not for FC */
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t le_status;
- u_int8_t le_rsvd2;
- u_int8_t le_cmd_count;
- u_int8_t le_in_count;
- u_int8_t le_cdb6len; /* Not for FC */
- u_int8_t le_cdb7len; /* Not for FC */
-#endif
- u_int16_t le_timeout;
- u_int16_t le_reserved[20];
-} lun_entry_t;
-
-/*
- * le_flags values
- */
-#define LUN_TQAE 0x00000001 /* Tagged Queue Action Enable */
-#define LUN_DSSM 0x01000000 /* Disable Sending SDP Message */
-#define LUN_DM 0x40000000 /* Disconnects Mandatory */
-
-/*
- * le_ops values
- */
-#define LUN_CCINCR 0x01 /* increment command count */
-#define LUN_CCDECR 0x02 /* decrement command count */
-#define LUN_ININCR 0x40 /* increment immed. notify count */
-#define LUN_INDECR 0x80 /* decrement immed. notify count */
-
-/*
- * le_status values
- */
-#define LUN_ERR 0x04 /* request completed with error */
-#define LUN_INVAL 0x06 /* invalid request */
-#define LUN_NOCAP 0x16 /* can't provide requested capability */
-#define LUN_ENABLED 0x3E /* LUN already enabled */
-
-/*
- * Immediate Notify Entry structure
- */
-#define IN_MSGLEN 8 /* 8 bytes */
-#define IN_RSVDLEN 8 /* 8 words */
-typedef struct {
- isphdr_t in_header;
- u_int32_t in_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_lun; /* lun */
- u_int8_t in_iid; /* initiator */
- u_int8_t in_rsvd;
- u_int8_t in_tgt; /* target */
-#endif
- u_int32_t in_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_status;
- u_int8_t in_rsvd2;
- u_int8_t in_tag_val; /* tag value */
- u_int8_t in_tag_type; /* tag type */
-#endif
- u_int16_t in_seqid; /* sequence id */
- u_int8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
- u_int16_t in_reserved[IN_RSVDLEN];
- u_int8_t in_sense[SUGGSENSELEN]; /* suggested sense data */
-} in_entry_t;
-
-typedef struct {
- isphdr_t in_header;
- u_int32_t in_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_lun; /* lun */
- u_int8_t in_iid; /* initiator */
-#endif
- u_int16_t in_rsvd;
- u_int32_t in_rsvd2;
- u_int16_t in_status;
- u_int16_t in_task_flags;
- u_int16_t in_seqid; /* sequence id */
-} in_fcentry_t;
-
-/*
- * Values for the in_status field
- */
-#define IN_NO_RCAP 0x16 /* requested capability not available */
-#define IN_IDE_RECEIVED 0x33 /* Initiator Detected Error msg received */
-#define IN_RSRC_UNAVAIL 0x34 /* resource unavailable */
-#define IN_MSG_RECEIVED 0x36 /* SCSI message received */
-#define IN_PORT_LOGOUT 0x29 /* port has logged out (FC) */
-#define IN_ABORT_TASK 0x20 /* task named in RX_ID is being aborted (FC) */
-
-/*
- * Notify Acknowledge Entry structure
- */
-#define NA_RSVDLEN 22
-typedef struct {
- isphdr_t na_header;
- u_int32_t na_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_lun; /* lun */
- u_int8_t na_iid; /* initiator */
- u_int8_t na_rsvd;
- u_int8_t na_tgt; /* target */
-#endif
- u_int32_t na_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_status;
- u_int8_t na_event;
-#endif
- u_int16_t na_seqid; /* sequence id */
- u_int16_t na_reserved[NA_RSVDLEN];
-} na_entry_t;
-
-/*
- * Value for the na_event field
- */
-#define NA_RST_CLRD 0x80 /* Clear an async event notification */
-
-#define NA2_RSVDLEN 21
-typedef struct {
- isphdr_t na_header;
- u_int32_t na_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_lun; /* lun */
- u_int8_t na_iid; /* initiator */
-#endif
- u_int16_t na_rsvd;
- u_int16_t na_flags;
- u_int16_t na_rsvd2;
- u_int16_t na_status;
- u_int16_t na_task_flags;
- u_int16_t na_seqid; /* sequence id */
- u_int16_t na_reserved[NA2_RSVDLEN];
-} na_fcentry_t;
-#define NAFC_RST_CLRD 0x40
-
-/*
- * Value for the na_event field
- */
-#define NA_RST_CLRD 0x80 /* Clear an async event notification */
-/*
- * Accept Target I/O Entry structure
- */
-#define ATIO_CDBLEN 26
-
-typedef struct {
- isphdr_t at_header;
- u_int32_t at_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_lun; /* lun */
- u_int8_t at_iid; /* initiator */
- u_int8_t at_cdblen; /* cdb length */
- u_int8_t at_tgt; /* target */
-#endif
- u_int32_t at_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_status; /* firmware status */
- u_int8_t at_scsi_status; /* scsi status */
- u_int8_t at_tag_val; /* tag value */
- u_int8_t at_tag_type; /* tag type */
-#endif
- u_int8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
- u_int8_t at_sense[SUGGSENSELEN]; /* suggested sense data */
-} at_entry_t;
-
-/*
- * at_flags values
- */
-#define AT_NODISC 0x00008000 /* disconnect disabled */
-#define AT_TQAE 0x00000001 /* Tagged Queue Action enabled */
-
-/*
- * at_status values
- */
-#define AT_PATH_INVALID 0x07 /* ATIO sent to firmware for disabled lun */
-#define AT_PHASE_ERROR 0x14 /* Bus phase sequence error */
-#define AT_NOCAP 0x16 /* Requested capability not available */
-#define AT_BDR_MSG 0x17 /* Bus Device Reset msg received */
-#define AT_CDB 0x3D /* CDB received */
-
-/*
- * Accept Target I/O Entry structure, Type 2
- */
-#define ATIO2_CDBLEN 16
-
-typedef struct {
- isphdr_t at_header;
- u_int32_t at_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_lun; /* lun */
- u_int8_t at_iid; /* initiator */
-#endif
- u_int16_t at_rxid; /* response ID */
- u_int16_t at_flags;
- u_int16_t at_status; /* firmware status */
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_reserved1;
- u_int8_t at_taskcodes;
- u_int8_t at_taskflags;
- u_int8_t at_execodes;
-#endif
- u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
- u_int32_t at_datalen; /* allocated data len */
- u_int16_t at_scclun;
- u_int16_t at_reserved3;
- u_int16_t at_scsi_status;
- u_int8_t at_sense[SUGGSENSELEN]; /* suggested sense data */
-} at2_entry_t;
-
-#define ATIO2_TC_ATTR_MASK 0x7
-#define ATIO2_TC_ATTR_SIMPLEQ 0
-#define ATIO2_TC_ATTR_HEADOFQ 1
-#define ATIO2_TC_ATTR_ORDERED 2
-#define ATIO2_TC_ATTR_ACAQ 4
-#define ATIO2_TC_ATTR_UNTAGGED 5
-#define TC2TT(code) \
- (((code) == ATIO2_TC_ATTR_SIMPLEQ)? 0x20 : \
- (((code) == ATIO2_TC_ATTR_HEADOFQ)? 0x21 : \
- (((code) == ATIO2_TC_ATTR_ORDERED)? 0x22 : \
- (((code) == ATIO2_TC_ATTR_ACAQ)? 0x24 : 0))))
-
-
-/*
- * Continue Target I/O Entry structure
- * Request from driver. The response from the
- * ISP firmware is the same except that the last 18
- * bytes are overwritten by suggested sense data if
- * the 'autosense valid' bit is set in the status byte.
- */
-typedef struct {
- isphdr_t ct_header;
- u_int32_t ct_reserved;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_lun; /* lun */
- u_int8_t ct_iid; /* initiator id */
- u_int8_t ct_rsvd;
- u_int8_t ct_tgt; /* our target id */
-#endif
- u_int32_t ct_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_status; /* isp status */
- u_int8_t ct_scsi_status; /* scsi status */
- u_int8_t ct_tag_val; /* tag value */
- u_int8_t ct_tag_type; /* tag type */
-#endif
- u_int32_t ct_xfrlen; /* transfer length */
- u_int32_t ct_resid; /* residual length */
- u_int16_t ct_timeout;
- u_int16_t ct_seg_count;
- ispds_t ct_dataseg[ISP_RQDSEG];
-} ct_entry_t;
-
-/*
- * ct_flags values
- */
-#define CT_TQAE 0x00000001 /* Tagged Queue Action enable */
-#define CT_DATA_IN 0x00000040 /* Data direction */
-#define CT_DATA_OUT 0x00000080 /* Data direction */
-#define CT_NO_DATA 0x000000C0 /* Data direction */
-#define CT_DATAMASK 0x000000C0 /* Data direction */
-#define CT_NODISC 0x00008000 /* Disconnects disabled */
-#define CT_DSDP 0x01000000 /* Disable Save Data Pointers */
-#define CT_SENDRDP 0x04000000 /* Send Restore Pointers msg */
-#define CT_SENDSTATUS 0x80000000 /* Send SCSI status byte */
-
-/*
- * ct_status values
- * - set by the firmware when it returns the CTIO
- */
-#define CT_OK 0x01 /* completed without error */
-#define CT_ABORTED 0x02 /* aborted by host */
-#define CT_ERR 0x04 /* see sense data for error */
-#define CT_INVAL 0x06 /* request for disabled lun */
-#define CT_NOPATH 0x07 /* invalid ITL nexus */
-#define CT_INVRXID 0x08 /* (FC only) Invalid RX_ID */
-#define CT_RSELTMO 0x0A /* reselection timeout after 2 tries */
-#define CT_TIMEOUT 0x0B /* timed out */
-#define CT_RESET 0x0E /* SCSI Bus Reset occurred */
-#define CT_PHASE_ERROR 0x14 /* Bus phase sequence error */
-#define CT_BDR_MSG 0x17 /* Bus Device Reset msg received */
-#define CT_TERMINATED 0x19 /* due to Terminate Transfer mbox cmd */
-#define CT_LOGOUT 0x29 /* port logout not acknowledged yet */
-#define CT_NOACK 0x35 /* Outstanding Immed. Notify. entry */
-
-/*
- * When the firmware returns a CTIO entry, it may overwrite the last
- * part of the structure with sense data. This starts at offset 0x2E
- * into the entry, which is in the middle of ct_dataseg[1]. Rather
- * than define a new struct for this, I'm just using the sense data
- * offset.
- */
-#define CTIO_SENSE_OFFSET 0x2E
-
-/*
- * Entry length in u_longs. All entries are the same size so
- * any one will do as the numerator.
- */
-#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(u_int32_t))
-
-/*
- * QLA2100 CTIO (type 2) entry
- */
-#define MAXRESPLEN 26
-typedef struct {
- isphdr_t ct_header;
- u_int32_t ct_reserved;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_lun; /* lun */
- u_int8_t ct_iid; /* initiator id */
-#endif
- u_int16_t ct_rxid; /* response ID */
- u_int16_t ct_flags;
- u_int16_t ct_status; /* isp status */
- u_int16_t ct_timeout;
- u_int16_t ct_seg_count;
- u_int32_t ct_reloff; /* relative offset */
- u_int32_t ct_resid; /* residual length */
- union {
- /*
- * The three different modes that the target driver
- * can set the CTIO2 up as.
- *
- * The first is for sending FCP_DATA_IUs as well as
- * (optionally) sending a terminal SCSI status FCP_RSP_IU.
- *
- * The second is for sending SCSI sense data in an FCP_RSP_IU.
- * Note that no FCP_DATA_IUs will be sent.
- *
- * The third is for sending FCP_RSP_IUs as built specifically
- * in system memory as located by the isp_dataseg.
- */
- struct {
- u_int32_t _reserved;
- u_int16_t _reserved2;
- u_int16_t ct_scsi_status;
- u_int32_t ct_xfrlen;
- ispds_t ct_dataseg[ISP_RQDSEG_T2];
- } m0;
- struct {
- u_int16_t _reserved;
- u_int16_t _reserved2;
- u_int16_t ct_senselen;
- u_int16_t ct_scsi_status;
- u_int16_t ct_resplen;
- u_int8_t ct_resp[MAXRESPLEN];
- } m1;
- struct {
- u_int32_t _reserved;
- u_int16_t _reserved2;
- u_int16_t _reserved3;
- u_int32_t ct_datalen;
- ispds_t ct_fcp_rsp_iudata;
- } m2;
- /*
- * CTIO2 returned from F/W...
- */
- struct {
- u_int32_t _reserved[4];
- u_int16_t ct_scsi_status;
- u_int8_t ct_sense[SUGGSENSELEN];
- } fw;
- } rsp;
-} ct2_entry_t;
-/*
- * ct_flags values for CTIO2
- */
-#define CT2_FLAG_MMASK 0x0003
-#define CT2_FLAG_MODE0 0x0000
-#define CT2_FLAG_MODE1 0x0001
-#define CT2_FLAG_MODE2 0x0002
-#define CT2_DATA_IN CT_DATA_IN
-#define CT2_DATA_OUT CT_DATA_OUT
-#define CT2_NO_DATA CT_NO_DATA
-#define CT2_DATAMASK CT_DATA_MASK
-#define CT2_CCINCR 0x0100
-#define CT2_FASTPOST 0x0200
-#define CT2_SENDSTATUS 0x8000
-
-/*
- * ct_status values are (mostly) the same as that for ct_entry.
- */
-
-/*
- * ct_scsi_status values- the low 8 bits are the normal SCSI status
- * we know and love. The upper 8 bits are validity markers for FCP_RSP_IU
- * fields.
- */
-#define CT2_RSPLEN_VALID 0x0100
-#define CT2_SNSLEN_VALID 0x0200
-#define CT2_DATA_OVER 0x0400
-#define CT2_DATA_UNDER 0x0800
-
#endif /* _ISPMBOX_H */
diff --git a/sys/dev/isp/ispreg.h b/sys/dev/isp/ispreg.h
index 122a2976db1b..a953bc189654 100644
--- a/sys/dev/isp/ispreg.h
+++ b/sys/dev/isp/ispreg.h
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: ispreg.h,v 1.6 1998/09/08 01:09:46 mjacob Exp $ */
/*
* Machine Independent (well, as best as possible) register
* definitions for Qlogic ISP SCSI adapters.
@@ -671,7 +670,7 @@
(((u_int64_t)(c)[23]) << 16) | \
(((u_int64_t)(c)[24]) << 8) | \
(((u_int64_t)(c)[25]) << 0))
-#define ISP2100_NVRAM_HARDLOOPID(c) (c)[26]
+#define ISP2100_NVRAM_HARDLOOPID(c) (c)[24]
#define ISP2100_NVRAM_HBA_DISABLE(c) ISPBSMX(c, 70, 0, 0x01)
#define ISP2100_NVRAM_BIOS_DISABLE(c) ISPBSMX(c, 70, 1, 0x01)
diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h
index 222f77e9e905..d1aeade78e4c 100644
--- a/sys/dev/isp/ispvar.h
+++ b/sys/dev/isp/ispvar.h
@@ -1,5 +1,4 @@
-/* $Id: ispvar.h,v 1.7 1998/12/28 19:22:27 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Soft Definitions for for Qlogic ISP SCSI adapters.
*
@@ -44,11 +43,11 @@
#include <dev/isp/ispmbox.h>
#endif
#ifdef __linux__
-#include "ispmbox.h"
+#include <ispmbox.h>
#endif
#define ISP_CORE_VERSION_MAJOR 1
-#define ISP_CORE_VERSION_MINOR 5
+#define ISP_CORE_VERSION_MINOR 3
/*
* Vector for MD code to provide specific services.
@@ -78,7 +77,6 @@ struct ispmdvec {
#define MAX_TARGETS 16
#define MAX_FC_TARG 126
-#define DEFAULT_LOOPID 113
/* queue length must be a power of two */
#define QENTRY_LEN 64
@@ -99,7 +97,7 @@ typedef struct {
isp_data_line_active_neg: 1,
isp_cmd_dma_burst_enable: 1,
isp_data_dma_burst_enabl: 1,
- isp_fifo_threshold : 3,
+ isp_fifo_threshold : 2,
isp_diffmode : 1,
isp_fast_mttr : 1,
isp_initiator_id : 4,
@@ -177,42 +175,6 @@ typedef struct {
#define FW_REINIT 0x0006
#define FW_NON_PART 0x0007
-#ifdef ISP_TARGET_MODE
-/*
- * Some temporary Target Mode definitions
- */
-typedef struct tmd_cmd {
- u_int8_t cd_iid; /* initiator */
- u_int8_t cd_tgt; /* target */
- u_int8_t cd_lun; /* LUN for this command */
- u_int8_t cd_state;
- u_int8_t cd_cdb[16]; /* command bytes */
- u_int8_t cd_sensedata[20];
- u_int16_t cd_rxid;
- u_int32_t cd_datalen;
- u_int32_t cd_totbytes;
- void * cd_hba;
-} tmd_cmd_t;
-
-/*
- * Async Target Mode Event Definitions
- */
-#define TMD_BUS_RESET 0
-#define TMD_BDR 1
-
-/*
- * Immediate Notify data structure.
- */
-#define NOTIFY_MSGLEN 5
-typedef struct {
- u_int8_t nt_iid; /* initiator */
- u_int8_t nt_tgt; /* target */
- u_int8_t nt_lun; /* LUN for this command */
- u_int8_t nt_msg[NOTIFY_MSGLEN]; /* SCSI message byte(s) */
-} tmd_notify_t;
-
-#endif
-
/*
* Soft Structure per host adapter
*/
@@ -228,7 +190,7 @@ struct ispsoftc {
struct ispmdvec * isp_mdvec;
/*
- * Mostly nonvolatile state, debugging, etc..
+ * State, debugging, etc..
*/
u_int : 8,
@@ -281,28 +243,6 @@ struct ispsoftc {
volatile caddr_t isp_result;
u_int32_t isp_rquest_dma;
u_int32_t isp_result_dma;
-
-#ifdef ISP_TARGET_MODE
- /*
- * Vectors for handling target mode support.
- *
- * isp_tmd_newcmd is for feeding a newly arrived command to some
- * upper layer.
- *
- * isp_tmd_event is for notifying some upper layer that an event has
- * occurred that is not necessarily tied to any target (e.g., a SCSI
- * Bus Reset).
- *
- * isp_tmd_notify is for notifying some upper layer that some
- * event is now occurring that is either pertinent for a specific
- * device or for a specific command (e.g., BDR or ABORT TAG).
- *
- * It is left undefined (for now) how pools of commands are managed.
- */
- void (*isp_tmd_newcmd) __P((void *, tmd_cmd_t *));
- void (*isp_tmd_event) __P((void *, int));
- void (*isp_tmd_notify) __P((void *, tmd_notify_t *));
-#endif
};
/*
@@ -388,6 +328,11 @@ void isp_reset __P((struct ispsoftc *));
void isp_init __P((struct ispsoftc *));
/*
+ * Free any associated resources prior to decommissioning.
+ */
+void isp_uninit __P((struct ispsoftc *));
+
+/*
* Reset the ISP and call completion for any orphaned commands.
*/
void isp_restart __P((struct ispsoftc *));
@@ -398,6 +343,11 @@ void isp_restart __P((struct ispsoftc *));
int isp_intr __P((void *));
/*
+ * Watchdog Routine
+ */
+void isp_watch __P((void *));
+
+/*
* Command Entry Point
*/
int32_t ispscsicmd __P((ISP_SCSI_XFER_T *));
diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c
deleted file mode 100644
index 653e2955ffee..000000000000
--- a/sys/dev/kbd/atkbd.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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 AUTHORS ``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 AUTHORS 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.
- *
- * $Id: atkbd.c,v 1.2 1999/01/13 11:19:19 yokota Exp $
- */
-
-#include "atkbd.h"
-#include "opt_kbd.h"
-#include "opt_devfs.h"
-
-#if NATKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/fcntl.h>
-#include <sys/malloc.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdreg.h>
-#include <dev/kbd/atkbdcreg.h>
-
-#ifndef __i386__
-
-#include <isa/isareg.h>
-
-#define ATKBD_SOFTC(unit) \
- ((atkbd_softc_t *)devclass_get_softc(atkbd_devclass, unit))
-
-#else /* __i386__ */
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-extern struct isa_driver atkbddriver; /* XXX: a kludge; see below */
-
-static atkbd_softc_t *atkbd_softc[NATKBD];
-
-#define ATKBD_SOFTC(unit) atkbd_softc[(unit)]
-
-#endif /* __i386__ */
-
-static timeout_t atkbd_timeout;
-
-#ifdef KBD_INSTALL_CDEV
-
-static d_open_t atkbdopen;
-static d_close_t atkbdclose;
-static d_read_t atkbdread;
-static d_ioctl_t atkbdioctl;
-static d_poll_t atkbdpoll;
-
-static struct cdevsw atkbd_cdevsw = {
- atkbdopen, atkbdclose, atkbdread, nowrite,
- atkbdioctl, nostop, nullreset, nodevtotty,
- atkbdpoll, nommap, NULL, ATKBD_DRIVER_NAME,
- NULL, -1,
-};
-
-#endif /* KBD_INSTALL_CDEV */
-
-#ifdef __i386__
-
-atkbd_softc_t
-*atkbd_get_softc(int unit)
-{
- atkbd_softc_t *sc;
-
- if (unit >= sizeof(atkbd_softc)/sizeof(atkbd_softc[0]))
- return NULL;
- sc = atkbd_softc[unit];
- if (sc == NULL) {
- sc = atkbd_softc[unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return NULL;
- bzero(sc, sizeof(*sc));
- }
- return sc;
-}
-
-#endif /* __i386__ */
-
-int
-atkbd_probe_unit(int unit, atkbd_softc_t *sc, int port, int irq, int flags)
-{
- keyboard_switch_t *sw;
- int args[2];
-
- if (sc->flags & ATKBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(ATKBD_DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- args[0] = port;
- args[1] = irq;
- return (*sw->probe)(unit, &sc->kbd, args, flags);
-}
-
-int
-atkbd_attach_unit(int unit, atkbd_softc_t *sc)
-{
- keyboard_switch_t *sw;
- int error;
-
- if (sc->flags & ATKBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(ATKBD_DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- /* reset, initialize and enable the device */
- error = (*sw->init)(sc->kbd);
- if (error)
- return ENXIO;
- (*sw->enable)(sc->kbd);
-
-#ifdef KBD_INSTALL_CDEV
- /* attach a virtual keyboard cdev */
- error = kbd_attach(makedev(0, ATKBD_MKMINOR(unit)), sc->kbd,
- &atkbd_cdevsw);
- if (error)
- return error;
-#endif
-
- /*
- * This is a kludge to compensate for lost keyboard interrupts.
- * A similar code used to be in syscons. See below. XXX
- */
- atkbd_timeout(sc->kbd);
-
- if (bootverbose)
- (*sw->diag)(sc->kbd, bootverbose);
-
- sc->flags |= ATKBD_ATTACHED;
- return 0;
-}
-
-static void
-atkbd_timeout(void *arg)
-{
- keyboard_t *kbd;
- int s;
-
- /* The following comments are extracted from syscons.c (1.287) */
- /*
- * With release 2.1 of the Xaccel server, the keyboard is left
- * hanging pretty often. Apparently an interrupt from the
- * keyboard is lost, and I don't know why (yet).
- * This ugly hack calls scintr if input is ready for the keyboard
- * and conveniently hides the problem. XXX
- */
- /*
- * Try removing anything stuck in the keyboard controller; whether
- * it's a keyboard scan code or mouse data. `scintr()' doesn't
- * read the mouse data directly, but `kbdio' routines will, as a
- * side effect.
- */
- s = spltty();
- kbd = (keyboard_t *)arg;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
- /*
- * We have seen the lock flag is not set. Let's reset
- * the flag early, otherwise the LED update routine fails
- * which may want the lock during the interrupt routine.
- */
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check_char)(kbd))
- (*kbdsw[kbd->kb_index]->intr)(kbd);
- }
- splx(s);
- timeout(atkbd_timeout, arg, hz/10);
-}
-
-/* cdev driver functions */
-
-#ifdef KBD_INSTALL_CDEV
-
-static int
-atkbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- atkbd_softc_t *sc;
- int unit;
-
- unit = ATKBD_UNIT(dev);
- if ((unit >= NATKBD) || ((sc = ATKBD_SOFTC(unit)) == NULL))
- return ENXIO;
- if (mode & (FWRITE | O_CREAT | O_APPEND | O_TRUNC))
- return ENODEV;
-
- /* FIXME: set the initial input mode (K_XLATE?) and lock state? */
- return genkbdopen(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-atkbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdclose(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-atkbdread(dev_t dev, struct uio *uio, int flag)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdread(&sc->gensc, sc->kbd, uio, flag);
-}
-
-static int
-atkbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdioctl(&sc->gensc, sc->kbd, cmd, arg, flag, p);
-}
-
-static int
-atkbdpoll(dev_t dev, int event, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdpoll(&sc->gensc, sc->kbd, event, p);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* LOW-LEVEL */
-
-#include <machine/limits.h>
-#include <machine/console.h>
-#include <machine/clock.h>
-
-#define ATKBD_DEFAULT 0
-
-typedef struct atkbd_state {
- KBDC kbdc; /* keyboard controller */
- /* XXX: don't move this field; pcvt
- * expects `kbdc' to be the first
- * field in this structure. */
- int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
- int ks_flags; /* flags */
-#define COMPOSE (1 << 0)
- int ks_state; /* shift/lock key state */
- int ks_accents; /* accent key index (> 0) */
- u_int ks_composed_char; /* composed char code (> 0) */
- u_char ks_prefix; /* AT scan code prefix */
-} atkbd_state_t;
-
-/* keyboard driver declaration */
-static int atkbd_configure(int flags);
-static kbd_probe_t atkbd_probe;
-static kbd_init_t atkbd_init;
-static kbd_term_t atkbd_term;
-static kbd_intr_t atkbd_intr;
-static kbd_test_if_t atkbd_test_if;
-static kbd_enable_t atkbd_enable;
-static kbd_disable_t atkbd_disable;
-static kbd_read_t atkbd_read;
-static kbd_check_t atkbd_check;
-static kbd_read_char_t atkbd_read_char;
-static kbd_check_char_t atkbd_check_char;
-static kbd_ioctl_t atkbd_ioctl;
-static kbd_lock_t atkbd_lock;
-static kbd_clear_state_t atkbd_clear_state;
-static kbd_get_state_t atkbd_get_state;
-static kbd_set_state_t atkbd_set_state;
-
-keyboard_switch_t atkbdsw = {
- atkbd_probe,
- atkbd_init,
- atkbd_term,
- atkbd_intr,
- atkbd_test_if,
- atkbd_enable,
- atkbd_disable,
- atkbd_read,
- atkbd_check,
- atkbd_read_char,
- atkbd_check_char,
- atkbd_ioctl,
- atkbd_lock,
- atkbd_clear_state,
- atkbd_get_state,
- atkbd_set_state,
- genkbd_get_fkeystr,
- genkbd_diag,
-};
-
-KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure);
-
-/* local functions */
-static int setup_kbd_port(KBDC kbdc, int port, int intr);
-static int get_kbd_echo(KBDC kbdc);
-static int probe_keyboard(KBDC kbdc, int flags);
-static int init_keyboard(KBDC kbdc, int *type, int flags);
-static int write_kbd(KBDC kbdc, int command, int data);
-static int get_kbd_id(KBDC kbdc);
-
-/* local variables */
-
-/* the initial key map, accent map and fkey strings */
-#include <dev/kbd/kbdtables.h>
-
-/* structures for the default keyboard */
-static keyboard_t default_kbd;
-static atkbd_state_t default_kbd_state;
-static keymap_t default_keymap;
-static accentmap_t default_accentmap;
-static fkeytab_t default_fkeytab[NUM_FKEYS];
-
-/*
- * The back door to the keyboard driver!
- * This function is called by the console driver, via the kbdio module,
- * to tickle keyboard drivers when the low-level console is being initialized.
- * Almost nothing in the kernel has been initialied yet. Try to probe
- * keyboards if possible.
- * NOTE: because of the way the low-level conole is initialized, this routine
- * may be called more than once!!
- */
-static int
-atkbd_configure(int flags)
-{
- keyboard_t *kbd;
- KBDC kbdc;
- int arg[2];
-#ifdef __i386__
- struct isa_device *dev;
-
- /* XXX: a kludge to obtain the device configuration flags */
- dev = find_isadev(isa_devtab_tty, &atkbddriver, 0);
- if (dev != NULL)
- flags |= dev->id_flags;
-#endif
-
- /* probe the keyboard controller */
- atkbdc_configure();
-
- /* probe the default keyboard */
- arg[0] = -1;
- arg[1] = -1;
- if (atkbd_probe(ATKBD_DEFAULT, &kbd, arg, flags))
- return 0;
-
- /* initialize it */
- kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc;
- if (!(flags & KB_CONF_PROBE_ONLY) && !KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, flags)
- && (flags & KB_CONF_FAIL_IF_NO_KBD))
- return 0;
- KBD_INIT_DONE(kbd);
- }
-
- /* and register */
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return 0;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 1; /* return the number of found keyboards */
-}
-
-/* low-level functions */
-
-/* initialize the keyboard_t structure and try to detect a keyboard */
-static int
-atkbd_probe(int unit, keyboard_t **kbdp, void *arg, int flags)
-{
- keyboard_t *kbd;
- atkbd_state_t *state;
- keymap_t *keymap;
- accentmap_t *accmap;
- fkeytab_t *fkeymap;
- int fkeymap_size;
- KBDC kbdc;
- int *data = (int *)arg;
-
- /* XXX */
- if (unit == ATKBD_DEFAULT) {
- *kbdp = kbd = &default_kbd;
- if (KBD_IS_PROBED(kbd))
- return 0;
- state = &default_kbd_state;
- keymap = &default_keymap;
- accmap = &default_accentmap;
- fkeymap = default_fkeytab;
- fkeymap_size =
- sizeof(default_fkeytab)/sizeof(default_fkeytab[0]);
- } else if (*kbdp == NULL) {
- *kbdp = kbd = malloc(sizeof(*kbd), M_DEVBUF, M_NOWAIT);
- if (kbd == NULL)
- return ENOMEM;
- bzero(kbd, sizeof(*kbd));
- state = malloc(sizeof(*state), M_DEVBUF, M_NOWAIT);
- keymap = malloc(sizeof(key_map), M_DEVBUF, M_NOWAIT);
- accmap = malloc(sizeof(accent_map), M_DEVBUF, M_NOWAIT);
- fkeymap = malloc(sizeof(fkey_tab), M_DEVBUF, M_NOWAIT);
- fkeymap_size = sizeof(fkey_tab)/sizeof(fkey_tab[0]);
- if ((state == NULL) || (keymap == NULL) || (accmap == NULL)
- || (fkeymap == NULL)) {
- if (state != NULL)
- free(state, M_DEVBUF);
- if (keymap != NULL)
- free(keymap, M_DEVBUF);
- if (accmap != NULL)
- free(accmap, M_DEVBUF);
- if (fkeymap != NULL)
- free(fkeymap, M_DEVBUF);
- free(kbd, M_DEVBUF);
- return ENOMEM;
- }
- bzero(state, sizeof(*state));
- } else if (KBD_IS_PROBED(*kbdp)) {
- return 0;
- } else {
- kbd = *kbdp;
- state = (atkbd_state_t *)kbd->kb_data;
- bzero(state, sizeof(*state));
- keymap = kbd->kb_keymap;
- accmap = kbd->kb_accentmap;
- fkeymap = kbd->kb_fkeytab;
- fkeymap_size = kbd->kb_fkeytab_size;
- }
-
- state->kbdc = kbdc = kbdc_open(data[0]);
- if (kbdc == NULL)
- return ENXIO;
- kbd_init_struct(kbd, ATKBD_DRIVER_NAME, KB_OTHER, unit, flags, data[0],
- IO_KBDSIZE);
- bcopy(&key_map, keymap, sizeof(key_map));
- bcopy(&accent_map, accmap, sizeof(accent_map));
- bcopy(fkey_tab, fkeymap,
- imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab)));
- kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
- kbd->kb_data = (void *)state;
-
- if (probe_keyboard(kbdc, flags)) {
- if (flags & KB_CONF_FAIL_IF_NO_KBD)
- return ENXIO;
- } else {
- KBD_FOUND_DEVICE(kbd);
- }
- atkbd_clear_state(kbd);
- state->ks_mode = K_XLATE;
- /*
- * FIXME: set the initial value for lock keys in ks_state
- * according to the BIOS data?
- */
-
- KBD_PROBE_DONE(kbd);
- return 0;
-}
-
-/* reset and initialize the device */
-static int
-atkbd_init(keyboard_t *kbd)
-{
- KBDC kbdc;
-
- if ((kbd == NULL) || !KBD_IS_PROBED(kbd))
- return ENXIO; /* shouldn't happen */
- kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc;
- if (kbdc == NULL)
- return ENXIO; /* shouldn't happen */
-
- if (!KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, kbd->kb_config)
- && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD))
- return ENXIO;
- atkbd_ioctl(kbd, KDSETLED,
- (caddr_t)&((atkbd_state_t *)(kbd->kb_data))->ks_state);
- KBD_INIT_DONE(kbd);
- }
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return ENXIO;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 0;
-}
-
-/* finish using this keyboard */
-static int
-atkbd_term(keyboard_t *kbd)
-{
- kbd_unregister(kbd);
- return 0;
-}
-
-/* keyboard interrupt routine */
-static int
-atkbd_intr(keyboard_t *kbd)
-{
- atkbd_state_t *state;
- int c;
-
- if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
- /* let the callback function to process the input */
- (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
- kbd->kb_callback.kc_arg);
- } else {
- /* read and discard the input; no one is waiting for input */
- do {
- c = atkbd_read_char(kbd, FALSE);
- } while (c != NOKEY);
-
- if (!KBD_HAS_DEVICE(kbd)) {
- /*
- * The keyboard was not detected before;
- * it must have been reconnected!
- */
- state = (atkbd_state_t *)kbd->kb_data;
- init_keyboard(state->kbdc, &kbd->kb_type,
- kbd->kb_config);
- atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
- KBD_FOUND_DEVICE(kbd);
- }
- }
- return 0;
-}
-
-/* test the interface to the device */
-static int
-atkbd_test_if(keyboard_t *kbd)
-{
- int error;
- int s;
-
- error = 0;
- empty_both_buffers(((atkbd_state_t *)kbd->kb_data)->kbdc, 10);
- s = spltty();
- if (!test_controller(((atkbd_state_t *)kbd->kb_data)->kbdc))
- error = EIO;
- else if (test_kbd_port(((atkbd_state_t *)kbd->kb_data)->kbdc) != 0)
- error = EIO;
- splx(s);
-
- return error;
-}
-
-/*
- * Enable the access to the device; until this function is called,
- * the client cannot read from the keyboard.
- */
-static int
-atkbd_enable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_ACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* disallow the access to the device */
-static int
-atkbd_disable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_DEACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* read one byte from the keyboard if it's allowed */
-static int
-atkbd_read(keyboard_t *kbd, int wait)
-{
- int c;
-
- if (wait)
- c = read_kbd_data(((atkbd_state_t *)kbd->kb_data)->kbdc);
- else
- c = read_kbd_data_no_wait(((atkbd_state_t *)kbd->kb_data)->kbdc);
- return (KBD_IS_ACTIVE(kbd) ? c : -1);
-}
-
-/* check if data is waiting */
-static int
-atkbd_check(keyboard_t *kbd)
-{
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- return kbdc_data_ready(((atkbd_state_t *)kbd->kb_data)->kbdc);
-}
-
-/* read char from the keyboard */
-static u_int
-atkbd_read_char(keyboard_t *kbd, int wait)
-{
- atkbd_state_t *state;
- u_int action;
- int scancode;
- int keycode;
-
- state = (atkbd_state_t *)kbd->kb_data;
-next_code:
- /* do we have a composed char to return? */
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) {
- action = state->ks_composed_char;
- state->ks_composed_char = 0;
- if (action > UCHAR_MAX)
- return ERRKEY;
- return action;
- }
-
- /* see if there is something in the keyboard port */
- if (wait) {
- do {
- scancode = read_kbd_data(state->kbdc);
- } while (scancode == -1);
- } else {
- scancode = read_kbd_data_no_wait(state->kbdc);
- if (scancode == -1)
- return NOKEY;
- }
-
- /* return the byte as is for the K_RAW mode */
- if (state->ks_mode == K_RAW)
- return scancode;
-
- /* translate the scan code into a keycode */
- keycode = scancode & 0x7F;
- switch (state->ks_prefix) {
- case 0x00: /* normal scancode */
- switch(scancode) {
- case 0xB8: /* left alt (compose key) released */
- if (state->ks_flags & COMPOSE) {
- state->ks_flags &= ~COMPOSE;
- if (state->ks_composed_char > UCHAR_MAX)
- state->ks_composed_char = 0;
- }
- break;
- case 0x38: /* left alt (compose key) pressed */
- if (!(state->ks_flags & COMPOSE)) {
- state->ks_flags |= COMPOSE;
- state->ks_composed_char = 0;
- }
- break;
- case 0xE0:
- case 0xE1:
- state->ks_prefix = scancode;
- goto next_code;
- }
- break;
- case 0xE0: /* 0xE0 prefix */
- state->ks_prefix = 0;
- switch (keycode) {
- case 0x1C: /* right enter key */
- keycode = 0x59;
- break;
- case 0x1D: /* right ctrl key */
- keycode = 0x5A;
- break;
- case 0x35: /* keypad divide key */
- keycode = 0x5B;
- break;
- case 0x37: /* print scrn key */
- keycode = 0x5C;
- break;
- case 0x38: /* right alt key (alt gr) */
- keycode = 0x5D;
- break;
- case 0x47: /* grey home key */
- keycode = 0x5E;
- break;
- case 0x48: /* grey up arrow key */
- keycode = 0x5F;
- break;
- case 0x49: /* grey page up key */
- keycode = 0x60;
- break;
- case 0x4B: /* grey left arrow key */
- keycode = 0x61;
- break;
- case 0x4D: /* grey right arrow key */
- keycode = 0x62;
- break;
- case 0x4F: /* grey end key */
- keycode = 0x63;
- break;
- case 0x50: /* grey down arrow key */
- keycode = 0x64;
- break;
- case 0x51: /* grey page down key */
- keycode = 0x65;
- break;
- case 0x52: /* grey insert key */
- keycode = 0x66;
- break;
- case 0x53: /* grey delete key */
- keycode = 0x67;
- break;
- /* the following 3 are only used on the MS "Natural" keyboard */
- case 0x5b: /* left Window key */
- keycode = 0x69;
- break;
- case 0x5c: /* right Window key */
- keycode = 0x6a;
- break;
- case 0x5d: /* menu key */
- keycode = 0x6b;
- break;
- default: /* ignore everything else */
- goto next_code;
- }
- break;
- case 0xE1: /* 0xE1 prefix */
- state->ks_prefix = 0;
- if (keycode == 0x1D)
- state->ks_prefix = 0x1D;
- goto next_code;
- /* NOT REACHED */
- case 0x1D: /* pause / break */
- state->ks_prefix = 0;
- if (keycode != 0x45)
- goto next_code;
- keycode = 0x68;
- break;
- }
-
- /* return the key code in the K_CODE mode */
- if (state->ks_mode == K_CODE)
- return (keycode | (scancode & 0x80));
-
- /* compose a character code */
- if (state->ks_flags & COMPOSE) {
- switch (scancode) {
- /* key pressed, process it */
- case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x40;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x47;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x4E;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x52: /* keypad 0 */
- state->ks_composed_char *= 10;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
-
- /* key released, no interest here */
- case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
- case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
- case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
- case 0xD2: /* keypad 0 */
- goto next_code;
-
- case 0x38: /* left alt key */
- break;
-
- default:
- if (state->ks_composed_char > 0) {
- state->ks_flags &= ~COMPOSE;
- state->ks_composed_char = 0;
- return ERRKEY;
- }
- break;
- }
- }
-
- /* keycode to key action */
- action = genkbd_keyaction(kbd, keycode, scancode & 0x80,
- &state->ks_state, &state->ks_accents);
- if (action == NOKEY)
- goto next_code;
- else
- return action;
-}
-
-/* check if char is waiting */
-static int
-atkbd_check_char(keyboard_t *kbd)
-{
- atkbd_state_t *state;
-
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- state = (atkbd_state_t *)kbd->kb_data;
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
- return TRUE;
- return kbdc_data_ready(state->kbdc);
-}
-
-/* some useful control functions */
-static int
-atkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- /* trasnlate LED_XXX bits into the device specific bits */
- static u_char ledmap[8] = {
- 0, 4, 2, 6, 1, 5, 3, 7,
- };
- atkbd_state_t *state = kbd->kb_data;
- int error;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBMODE: /* get keyboard mode */
- *(int *)arg = state->ks_mode;
- break;
- case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)arg) {
- case K_XLATE:
- if (state->ks_mode != K_XLATE) {
- /* make lock key state and LED state match */
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= KBD_LED_VAL(kbd);
- }
- /* FALL THROUGH */
- case K_RAW:
- case K_CODE:
- if (state->ks_mode != *(int *)arg) {
- atkbd_clear_state(kbd);
- state->ks_mode = *(int *)arg;
- }
- break;
- default:
- splx(s);
- return EINVAL;
- }
- break;
-
- case KDGETLED: /* get keyboard LED */
- *(int *)arg = KBD_LED_VAL(kbd);
- break;
- case KDSETLED: /* set keyboard LED */
- /* NOTE: lock key state in ks_state won't be changed */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- i = *(int *)arg;
- /* replace CAPS LED with ALTGR LED for ALTGR keyboards */
- if (kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
- if (i & ALKED)
- i |= CLKED;
- else
- i &= ~CLKED;
- }
- if (KBD_HAS_DEVICE(kbd)) {
- error = write_kbd(state->kbdc, KBDC_SET_LEDS,
- ledmap[i & LED_MASK]);
- if (error) {
- splx(s);
- return error;
- }
- }
- KBD_LED_VAL(kbd) = *(int *)arg;
- break;
-
- case KDGKBSTATE: /* get lock key state */
- *(int *)arg = state->ks_state & LOCK_MASK;
- break;
- case KDSKBSTATE: /* set lock key state */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= *(int *)arg;
- splx(s);
- /* set LEDs and quit */
- return atkbd_ioctl(kbd, KDSETLED, arg);
-
- case KDSETRAD: /* set keyboard repeat rate */
- splx(s);
- if (!KBD_HAS_DEVICE(kbd))
- return 0;
- return write_kbd(state->kbdc, KBDC_SET_TYPEMATIC,
- *(int *)arg);
-
- case PIO_KEYMAP: /* set keyboard translation table */
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- state->ks_accents = 0;
- /* FALL THROUGH */
- default:
- splx(s);
- return genkbd_commonioctl(kbd, cmd, arg);
- }
-
- splx(s);
- return 0;
-}
-
-/* lock the access to the keyboard */
-static int
-atkbd_lock(keyboard_t *kbd, int lock)
-{
- return kbdc_lock(((atkbd_state_t *)kbd->kb_data)->kbdc, lock);
-}
-
-/* clear the internal state of the keyboard */
-static void
-atkbd_clear_state(keyboard_t *kbd)
-{
- atkbd_state_t *state;
-
- state = (atkbd_state_t *)kbd->kb_data;
- state->ks_flags = 0;
- state->ks_state &= LOCK_MASK; /* preserve locking key state */
- state->ks_accents = 0;
- state->ks_composed_char = 0;
-#if 0
- state->ks_prefix = 0; /* XXX */
-#endif
-}
-
-/* save the internal state */
-static int
-atkbd_get_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len == 0)
- return sizeof(atkbd_state_t);
- if (len < sizeof(atkbd_state_t))
- return -1;
- bcopy(kbd->kb_data, buf, sizeof(atkbd_state_t));
- return 0;
-}
-
-/* set the internal state */
-static int
-atkbd_set_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len < sizeof(atkbd_state_t))
- return ENOMEM;
- if (((atkbd_state_t *)kbd->kb_data)->kbdc
- != ((atkbd_state_t *)buf)->kbdc)
- return ENOMEM;
- bcopy(buf, kbd->kb_data, sizeof(atkbd_state_t));
- return 0;
-}
-
-/* local functions */
-
-static int
-setup_kbd_port(KBDC kbdc, int port, int intr)
-{
- if (!set_controller_command_byte(kbdc,
- KBD_KBD_CONTROL_BITS,
- ((port) ? KBD_ENABLE_KBD_PORT : KBD_DISABLE_KBD_PORT)
- | ((intr) ? KBD_ENABLE_KBD_INT : KBD_DISABLE_KBD_INT)))
- return 1;
- return 0;
-}
-
-static int
-get_kbd_echo(KBDC kbdc)
-{
- /* enable the keyboard port, but disable the keyboard intr. */
- if (setup_kbd_port(kbdc, TRUE, FALSE))
- /* CONTROLLER ERROR: there is very little we can do... */
- return ENXIO;
-
- /* see if something is present */
- write_kbd_command(kbdc, KBDC_ECHO);
- if (read_kbd_data(kbdc) != KBD_ECHO) {
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- return ENXIO;
- }
-
- /* enable the keyboard port and intr. */
- if (setup_kbd_port(kbdc, TRUE, TRUE)) {
- /*
- * CONTROLLER ERROR
- * This is serious; the keyboard intr is left disabled!
- */
- return ENXIO;
- }
-
- return 0;
-}
-
-static int
-probe_keyboard(KBDC kbdc, int flags)
-{
- /*
- * Don't try to print anything in this function. The low-level
- * console may not have been initialized yet...
- */
- int err;
- int c;
- int m;
-
- if (!kbdc_lock(kbdc, TRUE)) {
- /* driver error? */
- return ENXIO;
- }
-
- /* flush any noise in the buffer */
- empty_both_buffers(kbdc, 10);
-
- /* save the current keyboard controller command byte */
- m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS;
- c = get_controller_command_byte(kbdc);
- if (c == -1) {
- /* CONTROLLER ERROR */
- kbdc_set_device_mask(kbdc, m);
- kbdc_lock(kbdc, FALSE);
- return ENXIO;
- }
-
- /*
- * The keyboard may have been screwed up by the boot block.
- * We may just be able to recover from error by testing the controller
- * and the keyboard port. The controller command byte needs to be
- * saved before this recovery operation, as some controllers seem
- * to set the command byte to particular values.
- */
- test_controller(kbdc);
- test_kbd_port(kbdc);
-
- err = get_kbd_echo(kbdc);
- if (err == 0) {
- kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS);
- } else {
- if (c != -1)
- /* try to restore the command byte as before */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_set_device_mask(kbdc, m);
- }
-
- kbdc_lock(kbdc, FALSE);
- return err;
-}
-
-static int
-init_keyboard(KBDC kbdc, int *type, int flags)
-{
- int codeset;
- int id;
- int c;
-
- if (!kbdc_lock(kbdc, TRUE)) {
- /* driver error? */
- return EIO;
- }
-
- /* save the current controller command byte */
- empty_both_buffers(kbdc, 10);
- c = get_controller_command_byte(kbdc);
- if (c == -1) {
- /* CONTROLLER ERROR */
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to get the current command byte value.\n");
- return EIO;
- }
- if (bootverbose)
- printf("atkbd: the current kbd controller command byte %04x\n",
- c);
-#if 0
- /* override the keyboard lock switch */
- c |= KBD_OVERRIDE_KBD_LOCK;
-#endif
-
- /* enable the keyboard port, but disable the keyboard intr. */
- if (setup_kbd_port(kbdc, TRUE, FALSE)) {
- /* CONTROLLER ERROR: there is very little we can do... */
- printf("atkbd: unable to set the command byte.\n");
- kbdc_lock(kbdc, FALSE);
- return EIO;
- }
-
- /*
- * Check if we have an XT keyboard before we attempt to reset it.
- * The procedure assumes that the keyboard and the controller have
- * been set up properly by BIOS and have not been messed up
- * during the boot process.
- */
- codeset = -1;
- if (flags & KB_CONF_ALT_SCANCODESET)
- /* the user says there is a XT keyboard */
- codeset = 1;
-#ifdef KBD_DETECT_XT_KEYBOARD
- else if ((c & KBD_TRANSLATION) == 0) {
- /* SET_SCANCODE_SET is not always supported; ignore error */
- if (send_kbd_command_and_data(kbdc, KBDC_SET_SCANCODE_SET, 0)
- == KBD_ACK)
- codeset = read_kbd_data(kbdc);
- }
- if (bootverbose)
- printf("atkbd: scancode set %d\n", codeset);
-#endif /* KBD_DETECT_XT_KEYBOARD */
-
- *type = KB_OTHER;
- id = get_kbd_id(kbdc);
- switch(id) {
- case 0x41ab:
- case 0x83ab:
- *type = KB_101;
- break;
- case -1: /* AT 84 keyboard doesn't return ID */
- *type = KB_84;
- break;
- default:
- break;
- }
- if (bootverbose)
- printf("atkbd: keyboard ID 0x%x (%d)\n", id, *type);
-
- /* reset keyboard hardware */
- if (!(flags & KB_CONF_NO_RESET) && !reset_kbd(kbdc)) {
- /*
- * KEYBOARD ERROR
- * Keyboard reset may fail either because the keyboard
- * doen't exist, or because the keyboard doesn't pass
- * the self-test, or the keyboard controller on the
- * motherboard and the keyboard somehow fail to shake hands.
- * It is just possible, particularly in the last case,
- * that the keyoard controller may be left in a hung state.
- * test_controller() and test_kbd_port() appear to bring
- * the keyboard controller back (I don't know why and how,
- * though.)
- */
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- /*
- * We could disable the keyboard port and interrupt... but,
- * the keyboard may still exist (see above).
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- if (bootverbose)
- printf("atkbd: failed to reset the keyboard.\n");
- return EIO;
- }
-
- /*
- * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
- * such as those on the IBM ThinkPad laptop computers can be used
- * with the standard console driver.
- */
- if (codeset == 1) {
- if (send_kbd_command_and_data(kbdc,
- KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
- /* XT kbd doesn't need scan code translation */
- c &= ~KBD_TRANSLATION;
- } else {
- /*
- * KEYBOARD ERROR
- * The XT kbd isn't usable unless the proper scan
- * code set is selected.
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to set the XT keyboard mode.\n");
- return EIO;
- }
- }
-
-#ifdef __alpha__
- if (send_kbd_command_and_data(
- kbdc, KBDC_SET_SCANCODE_SET, 2) != KBD_ACK) {
- printf("atkbd: can't set translation.\n");
-
- }
- c |= KBD_TRANSLATION;
-#endif
-
- /* enable the keyboard port and intr. */
- if (!set_controller_command_byte(kbdc,
- KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
- (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
- | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
- /*
- * CONTROLLER ERROR
- * This is serious; we are left with the disabled
- * keyboard intr.
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to enable the keyboard port and intr.\n");
- return EIO;
- }
-
- kbdc_lock(kbdc, FALSE);
- return 0;
-}
-
-static int
-write_kbd(KBDC kbdc, int command, int data)
-{
- int s;
-
- /* prevent the timeout routine from polling the keyboard */
- if (!kbdc_lock(kbdc, TRUE))
- return EBUSY;
-
- /* disable the keyboard and mouse interrupt */
- s = spltty();
-#if 0
- c = get_controller_command_byte(kbdc);
- if ((c == -1)
- || !set_controller_command_byte(kbdc,
- kbdc_get_device_mask(kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- kbdc_lock(kbdc, FALSE);
- splx(s);
- return EIO;
- }
- /*
- * Now that the keyboard controller is told not to generate
- * the keyboard and mouse interrupts, call `splx()' to allow
- * the other tty interrupts. The clock interrupt may also occur,
- * but the timeout routine (`scrn_timer()') will be blocked
- * by the lock flag set via `kbdc_lock()'
- */
- splx(s);
-#endif
-
- if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
- send_kbd_command(kbdc, KBDC_ENABLE_KBD);
-
-#if 0
- /* restore the interrupts */
- if (!set_controller_command_byte(kbdc,
- kbdc_get_device_mask(kbdc),
- c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
- /* CONTROLLER ERROR */
- }
-#else
- splx(s);
-#endif
- kbdc_lock(kbdc, FALSE);
-
- return 0;
-}
-
-static int
-get_kbd_id(KBDC kbdc)
-{
- int id1, id2;
-
- empty_both_buffers(kbdc, 10);
- id1 = id2 = -1;
- if (send_kbd_command(kbdc, KBDC_SEND_DEV_ID) != KBD_ACK)
- return -1;
-
- DELAY(10000); /* 10 msec delay */
- id1 = read_kbd_data(kbdc);
- if (id1 != -1)
- id2 = read_kbd_data(kbdc);
-
- if ((id1 == -1) || (id2 == -1)) {
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- return -1;
- }
- return ((id2 << 8) | id1);
-}
-
-#endif /* NATKBD > 0 */
diff --git a/sys/dev/kbd/atkbdc.c b/sys/dev/kbd/atkbdc.c
deleted file mode 100644
index 0f61835f0763..000000000000
--- a/sys/dev/kbd/atkbdc.c
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*-
- * Copyright (c) 1996-1999
- * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
- * 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.
- *
- * 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.
- *
- * $Id: $
- * from kbdio.c,v 1.13 1998/09/25 11:55:46 yokota Exp
- */
-
-#include "atkbdc.h"
-#include "opt_kbd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/syslog.h>
-
-#include <machine/clock.h>
-
-#include <dev/kbd/atkbdcreg.h>
-
-#ifndef __i386__
-#include <isa/isareg.h>
-#else
-#include <i386/isa/isa.h>
-#endif
-
-/* constants */
-
-#define MAXKBDC MAX(NATKBDC, 1)
-
-/* macros */
-
-#ifndef MAX
-#define MAX(x, y) ((x) > (y) ? (x) : (y))
-#endif
-
-#define kbdcp(p) ((atkbdc_softc_t *)(p))
-#define nextq(i) (((i) + 1) % KBDQ_BUFSIZE)
-#define availq(q) ((q)->head != (q)->tail)
-#if KBDIO_DEBUG >= 2
-#define emptyq(q) ((q)->tail = (q)->head = (q)->qcount = 0)
-#else
-#define emptyq(q) ((q)->tail = (q)->head = 0)
-#endif
-
-/* local variables */
-
-/*
- * We always need at least one copy of the kbdc_softc struct for the
- * low-level console. As the low-level console accesses the keyboard
- * controller before kbdc, and all other devices, is probed, we
- * statically allocate one entry. XXX
- */
-static atkbdc_softc_t default_kbdc;
-static atkbdc_softc_t *atkbdc_softc[MAXKBDC] = { &default_kbdc };
-
-static int verbose = KBDIO_DEBUG;
-
-/* function prototypes */
-
-static int atkbdc_setup(atkbdc_softc_t *sc, int port);
-static int addq(kqueue *q, int c);
-static int removeq(kqueue *q);
-static int wait_while_controller_busy(atkbdc_softc_t *kbdc);
-static int wait_for_data(atkbdc_softc_t *kbdc);
-static int wait_for_kbd_data(atkbdc_softc_t *kbdc);
-static int wait_for_kbd_ack(atkbdc_softc_t *kbdc);
-static int wait_for_aux_data(atkbdc_softc_t *kbdc);
-static int wait_for_aux_ack(atkbdc_softc_t *kbdc);
-
-#if NATKBDC > 0
-
-atkbdc_softc_t
-*atkbdc_get_softc(int unit)
-{
- atkbdc_softc_t *sc;
-
- if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]))
- return NULL;
- sc = atkbdc_softc[unit];
- if (sc == NULL) {
- sc = atkbdc_softc[unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return NULL;
- bzero(sc, sizeof(*sc));
- sc->port = -1; /* XXX */
- }
- return sc;
-}
-
-int
-atkbdc_probe_unit(atkbdc_softc_t *sc, int unit, int port)
-{
- return atkbdc_setup(sc, port);
-}
-
-#endif /* NATKBDC > 0 */
-
-/* the backdoor to the keyboard controller! XXX */
-int
-atkbdc_configure(void)
-{
- return atkbdc_setup(atkbdc_softc[0], -1);
-}
-
-static int
-atkbdc_setup(atkbdc_softc_t *sc, int port)
-{
- if (port <= 0)
- port = IO_KBD;
-
- if (sc->port <= 0) {
- sc->command_byte = -1;
- sc->command_mask = 0;
- sc->lock = FALSE;
- sc->kbd.head = sc->kbd.tail = 0;
- sc->aux.head = sc->aux.tail = 0;
-#if KBDIO_DEBUG >= 2
- sc->kbd.call_count = 0;
- sc->kbd.qcount = sc->kbd.max_qcount = 0;
- sc->aux.call_count = 0;
- sc->aux.qcount = sc->aux.max_qcount = 0;
-#endif
- }
- sc->port = port; /* may override the previous value */
- return 0;
-}
-
-/* associate a port number with a KBDC */
-
-KBDC
-kbdc_open(int port)
-{
- int s;
- int i;
-
- if (port <= 0)
- port = IO_KBD;
-
- s = spltty();
- for (i = 0; i < sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]); ++i) {
- if (atkbdc_softc[i] == NULL)
- continue;
- if (atkbdc_softc[i]->port == port) {
- splx(s);
- return (KBDC)atkbdc_softc[i];
- }
- if (atkbdc_softc[i]->port <= 0) {
- if (atkbdc_setup(atkbdc_softc[i], port))
- break;
- splx(s);
- return (KBDC)atkbdc_softc[i];
- }
- }
- splx(s);
- return NULL;
-}
-
-/*
- * I/O access arbitration in `kbdio'
- *
- * The `kbdio' module uses a simplistic convention to arbitrate
- * I/O access to the controller/keyboard/mouse. The convention requires
- * close cooperation of the calling device driver.
- *
- * The device driver which utilizes the `kbdio' module are assumed to
- * have the following set of routines.
- * a. An interrupt handler (the bottom half of the driver).
- * b. Timeout routines which may briefly polls the keyboard controller.
- * c. Routines outside interrupt context (the top half of the driver).
- * They should follow the rules below:
- * 1. The interrupt handler may assume that it always has full access
- * to the controller/keyboard/mouse.
- * 2. The other routines must issue `spltty()' if they wish to
- * prevent the interrupt handler from accessing
- * the controller/keyboard/mouse.
- * 3. The timeout routines and the top half routines of the device driver
- * arbitrate I/O access by observing the lock flag in `kbdio'.
- * The flag is manipulated via `kbdc_lock()'; when one wants to
- * perform I/O, call `kbdc_lock(kbdc, TRUE)' and proceed only if
- * the call returns with TRUE. Otherwise the caller must back off.
- * Call `kbdc_lock(kbdc, FALSE)' when necessary I/O operaion
- * is finished. This mechanism does not prevent the interrupt
- * handler from being invoked at any time and carrying out I/O.
- * Therefore, `spltty()' must be strategically placed in the device
- * driver code. Also note that the timeout routine may interrupt
- * `kbdc_lock()' called by the top half of the driver, but this
- * interruption is OK so long as the timeout routine observes the
- * the rule 4 below.
- * 4. The interrupt and timeout routines should not extend I/O operation
- * across more than one interrupt or timeout; they must complete
- * necessary I/O operation within one invokation of the routine.
- * This measns that if the timeout routine acquires the lock flag,
- * it must reset the flag to FALSE before it returns.
- */
-
-/* set/reset polling lock */
-int
-kbdc_lock(KBDC p, int lock)
-{
- int prevlock;
-
- prevlock = kbdcp(p)->lock;
- kbdcp(p)->lock = lock;
-
- return (prevlock != lock);
-}
-
-/* check if any data is waiting to be processed */
-int
-kbdc_data_ready(KBDC p)
-{
- return (availq(&kbdcp(p)->kbd) || availq(&kbdcp(p)->aux)
- || (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL));
-}
-
-/* queuing functions */
-
-static int
-addq(kqueue *q, int c)
-{
- if (nextq(q->tail) != q->head) {
- q->q[q->tail] = c;
- q->tail = nextq(q->tail);
-#if KBDIO_DEBUG >= 2
- ++q->call_count;
- ++q->qcount;
- if (q->qcount > q->max_qcount)
- q->max_qcount = q->qcount;
-#endif
- return TRUE;
- }
- return FALSE;
-}
-
-static int
-removeq(kqueue *q)
-{
- int c;
-
- if (q->tail != q->head) {
- c = q->q[q->head];
- q->head = nextq(q->head);
-#if KBDIO_DEBUG >= 2
- --q->qcount;
-#endif
- return c;
- }
- return -1;
-}
-
-/*
- * device I/O routines
- */
-static int
-wait_while_controller_busy(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 100msec at most */
- int retry = 5000;
- int port = kbdc->port;
- int f;
-
- while ((f = inb(port + KBD_STATUS_PORT)) & KBDS_INPUT_BUFFER_FULL) {
- if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdc->kbd, inb(port + KBD_DATA_PORT));
- } else if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdc->aux, inb(port + KBD_DATA_PORT));
- }
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * wait for any data; whether it's from the controller,
- * the keyboard, or the aux device.
- */
-static int
-wait_for_data(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
- int f;
-
- while ((f = inb(port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL) == 0) {
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return 0;
- }
- DELAY(KBDD_DELAYTIME);
- return f;
-}
-
-/* wait for data from the keyboard */
-static int
-wait_for_kbd_data(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
- int f;
-
- while ((f = inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)
- != KBDS_KBD_BUFFER_FULL) {
- if (f == KBDS_AUX_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdc->aux, inb(port + KBD_DATA_PORT));
- }
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return 0;
- }
- DELAY(KBDD_DELAYTIME);
- return f;
-}
-
-/*
- * wait for an ACK(FAh), RESEND(FEh), or RESET_FAIL(FCh) from the keyboard.
- * queue anything else.
- */
-static int
-wait_for_kbd_ack(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
- int f;
- int b;
-
- while (retry-- > 0) {
- if ((f = inb(port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- b = inb(port + KBD_DATA_PORT);
- if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
- if ((b == KBD_ACK) || (b == KBD_RESEND)
- || (b == KBD_RESET_FAIL))
- return b;
- addq(&kbdc->kbd, b);
- } else if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
- addq(&kbdc->aux, b);
- }
- }
- DELAY(KBDC_DELAYTIME);
- }
- return -1;
-}
-
-/* wait for data from the aux device */
-static int
-wait_for_aux_data(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
- int f;
-
- while ((f = inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)
- != KBDS_AUX_BUFFER_FULL) {
- if (f == KBDS_KBD_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdc->kbd, inb(port + KBD_DATA_PORT));
- }
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return 0;
- }
- DELAY(KBDD_DELAYTIME);
- return f;
-}
-
-/*
- * wait for an ACK(FAh), RESEND(FEh), or RESET_FAIL(FCh) from the aux device.
- * queue anything else.
- */
-static int
-wait_for_aux_ack(struct atkbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
- int f;
- int b;
-
- while (retry-- > 0) {
- if ((f = inb(port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- b = inb(port + KBD_DATA_PORT);
- if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
- if ((b == PSM_ACK) || (b == PSM_RESEND)
- || (b == PSM_RESET_FAIL))
- return b;
- addq(&kbdc->aux, b);
- } else if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
- addq(&kbdc->kbd, b);
- }
- }
- DELAY(KBDC_DELAYTIME);
- }
- return -1;
-}
-
-/* write a one byte command to the controller */
-int
-write_controller_command(KBDC p, int c)
-{
- if (!wait_while_controller_busy(kbdcp(p)))
- return FALSE;
- outb(kbdcp(p)->port + KBD_COMMAND_PORT, c);
- return TRUE;
-}
-
-/* write a one byte data to the controller */
-int
-write_controller_data(KBDC p, int c)
-{
- if (!wait_while_controller_busy(kbdcp(p)))
- return FALSE;
- outb(kbdcp(p)->port + KBD_DATA_PORT, c);
- return TRUE;
-}
-
-/* write a one byte keyboard command */
-int
-write_kbd_command(KBDC p, int c)
-{
- if (!wait_while_controller_busy(kbdcp(p)))
- return FALSE;
- outb(kbdcp(p)->port + KBD_DATA_PORT, c);
- return TRUE;
-}
-
-/* write a one byte auxiliary device command */
-int
-write_aux_command(KBDC p, int c)
-{
- if (!write_controller_command(p, KBDC_WRITE_TO_AUX))
- return FALSE;
- return write_controller_data(p, c);
-}
-
-/* send a command to the keyboard and wait for ACK */
-int
-send_kbd_command(KBDC p, int c)
-{
- int retry = KBD_MAXRETRY;
- int res = -1;
-
- while (retry-- > 0) {
- if (!write_kbd_command(p, c))
- continue;
- res = wait_for_kbd_ack(kbdcp(p));
- if (res == KBD_ACK)
- break;
- }
- return res;
-}
-
-/* send a command to the auxiliary device and wait for ACK */
-int
-send_aux_command(KBDC p, int c)
-{
- int retry = KBD_MAXRETRY;
- int res = -1;
-
- while (retry-- > 0) {
- if (!write_aux_command(p, c))
- continue;
- /*
- * FIXME: XXX
- * The aux device may have already sent one or two bytes of
- * status data, when a command is received. It will immediately
- * stop data transmission, thus, leaving an incomplete data
- * packet in our buffer. We have to discard any unprocessed
- * data in order to remove such packets. Well, we may remove
- * unprocessed, but necessary data byte as well...
- */
- emptyq(&kbdcp(p)->aux);
- res = wait_for_aux_ack(kbdcp(p));
- if (res == PSM_ACK)
- break;
- }
- return res;
-}
-
-/* send a command and a data to the keyboard, wait for ACKs */
-int
-send_kbd_command_and_data(KBDC p, int c, int d)
-{
- int retry;
- int res = -1;
-
- for (retry = KBD_MAXRETRY; retry > 0; --retry) {
- if (!write_kbd_command(p, c))
- continue;
- res = wait_for_kbd_ack(kbdcp(p));
- if (res == KBD_ACK)
- break;
- else if (res != KBD_RESEND)
- return res;
- }
- if (retry <= 0)
- return res;
-
- for (retry = KBD_MAXRETRY, res = -1; retry > 0; --retry) {
- if (!write_kbd_command(p, d))
- continue;
- res = wait_for_kbd_ack(kbdcp(p));
- if (res != KBD_RESEND)
- break;
- }
- return res;
-}
-
-/* send a command and a data to the auxiliary device, wait for ACKs */
-int
-send_aux_command_and_data(KBDC p, int c, int d)
-{
- int retry;
- int res = -1;
-
- for (retry = KBD_MAXRETRY; retry > 0; --retry) {
- if (!write_aux_command(p, c))
- continue;
- emptyq(&kbdcp(p)->aux);
- res = wait_for_aux_ack(kbdcp(p));
- if (res == PSM_ACK)
- break;
- else if (res != PSM_RESEND)
- return res;
- }
- if (retry <= 0)
- return res;
-
- for (retry = KBD_MAXRETRY, res = -1; retry > 0; --retry) {
- if (!write_aux_command(p, d))
- continue;
- res = wait_for_aux_ack(kbdcp(p));
- if (res != PSM_RESEND)
- break;
- }
- return res;
-}
-
-/*
- * read one byte from any source; whether from the controller,
- * the keyboard, or the aux device
- */
-int
-read_controller_data(KBDC p)
-{
- if (availq(&kbdcp(p)->kbd))
- return removeq(&kbdcp(p)->kbd);
- if (availq(&kbdcp(p)->aux))
- return removeq(&kbdcp(p)->aux);
- if (!wait_for_data(kbdcp(p)))
- return -1; /* timeout */
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
-}
-
-#if KBDIO_DEBUG >= 2
-static int call = 0;
-#endif
-
-/* read one byte from the keyboard */
-int
-read_kbd_data(KBDC p)
-{
-#if KBDIO_DEBUG >= 2
- if (++call > 2000) {
- call = 0;
- log(LOG_DEBUG, "kbdc: kbd q: %d calls, max %d chars, "
- "aux q: %d calls, max %d chars\n",
- kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
- kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
- }
-#endif
-
- if (availq(&kbdcp(p)->kbd))
- return removeq(&kbdcp(p)->kbd);
- if (!wait_for_kbd_data(kbdcp(p)))
- return -1; /* timeout */
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
-}
-
-/* read one byte from the keyboard, but return immediately if
- * no data is waiting
- */
-int
-read_kbd_data_no_wait(KBDC p)
-{
- int f;
-
-#if KBDIO_DEBUG >= 2
- if (++call > 2000) {
- call = 0;
- log(LOG_DEBUG, "kbdc: kbd q: %d calls, max %d chars, "
- "aux q: %d calls, max %d chars\n",
- kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
- kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
- }
-#endif
-
- if (availq(&kbdcp(p)->kbd))
- return removeq(&kbdcp(p)->kbd);
- f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
- if (f == KBDS_AUX_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdcp(p)->aux, inb(kbdcp(p)->port + KBD_DATA_PORT));
- f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
- }
- if (f == KBDS_KBD_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
- }
- return -1; /* no data */
-}
-
-/* read one byte from the aux device */
-int
-read_aux_data(KBDC p)
-{
- if (availq(&kbdcp(p)->aux))
- return removeq(&kbdcp(p)->aux);
- if (!wait_for_aux_data(kbdcp(p)))
- return -1; /* timeout */
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
-}
-
-/* read one byte from the aux device, but return immediately if
- * no data is waiting
- */
-int
-read_aux_data_no_wait(KBDC p)
-{
- int f;
-
- if (availq(&kbdcp(p)->aux))
- return removeq(&kbdcp(p)->aux);
- f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
- if (f == KBDS_KBD_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- addq(&kbdcp(p)->kbd, inb(kbdcp(p)->port + KBD_DATA_PORT));
- f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
- }
- if (f == KBDS_AUX_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
- }
- return -1; /* no data */
-}
-
-/* discard data from the keyboard */
-void
-empty_kbd_buffer(KBDC p, int wait)
-{
- int t;
- int b;
- int f;
-#if KBDIO_DEBUG >= 2
- int c1 = 0;
- int c2 = 0;
-#endif
- int delta = 2;
-
- for (t = wait; t > 0; ) {
- if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- b = inb(kbdcp(p)->port + KBD_DATA_PORT);
- if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
- addq(&kbdcp(p)->aux, b);
-#if KBDIO_DEBUG >= 2
- ++c2;
- } else {
- ++c1;
-#endif
- }
- t = wait;
- } else {
- t -= delta;
- }
- DELAY(delta*1000);
- }
-#if KBDIO_DEBUG >= 2
- if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_kbd_buffer)\n", c1, c2);
-#endif
-
- emptyq(&kbdcp(p)->kbd);
-}
-
-/* discard data from the aux device */
-void
-empty_aux_buffer(KBDC p, int wait)
-{
- int t;
- int b;
- int f;
-#if KBDIO_DEBUG >= 2
- int c1 = 0;
- int c2 = 0;
-#endif
- int delta = 2;
-
- for (t = wait; t > 0; ) {
- if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- b = inb(kbdcp(p)->port + KBD_DATA_PORT);
- if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
- addq(&kbdcp(p)->kbd, b);
-#if KBDIO_DEBUG >= 2
- ++c1;
- } else {
- ++c2;
-#endif
- }
- t = wait;
- } else {
- t -= delta;
- }
- DELAY(delta*1000);
- }
-#if KBDIO_DEBUG >= 2
- if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_aux_buffer)\n", c1, c2);
-#endif
-
- emptyq(&kbdcp(p)->aux);
-}
-
-/* discard any data from the keyboard or the aux device */
-void
-empty_both_buffers(KBDC p, int wait)
-{
- int t;
- int f;
-#if KBDIO_DEBUG >= 2
- int c1 = 0;
- int c2 = 0;
-#endif
- int delta = 2;
-
- for (t = wait; t > 0; ) {
- if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- (void)inb(kbdcp(p)->port + KBD_DATA_PORT);
-#if KBDIO_DEBUG >= 2
- if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL)
- ++c1;
- else
- ++c2;
-#endif
- t = wait;
- } else {
- t -= delta;
- }
- DELAY(delta*1000);
- }
-#if KBDIO_DEBUG >= 2
- if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_both_buffers)\n", c1, c2);
-#endif
-
- emptyq(&kbdcp(p)->kbd);
- emptyq(&kbdcp(p)->aux);
-}
-
-/* keyboard and mouse device control */
-
-/* NOTE: enable the keyboard port but disable the keyboard
- * interrupt before calling "reset_kbd()".
- */
-int
-reset_kbd(KBDC p)
-{
- int retry = KBD_MAXRETRY;
- int again = KBD_MAXWAIT;
- int c = KBD_RESEND; /* keep the compiler happy */
-
- while (retry-- > 0) {
- empty_both_buffers(p, 10);
- if (!write_kbd_command(p, KBDC_RESET_KBD))
- continue;
- emptyq(&kbdcp(p)->kbd);
- c = read_controller_data(p);
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_KBD return code:%04x\n", c);
- if (c == KBD_ACK) /* keyboard has agreed to reset itself... */
- break;
- }
- if (retry < 0)
- return FALSE;
-
- while (again-- > 0) {
- /* wait awhile, well, in fact we must wait quite loooooooooooong */
- DELAY(KBD_RESETDELAY*1000);
- c = read_controller_data(p); /* RESET_DONE/RESET_FAIL */
- if (c != -1) /* wait again if the controller is not ready */
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_KBD status:%04x\n", c);
- if (c != KBD_RESET_DONE)
- return FALSE;
- return TRUE;
-}
-
-/* NOTE: enable the aux port but disable the aux interrupt
- * before calling `reset_aux_dev()'.
- */
-int
-reset_aux_dev(KBDC p)
-{
- int retry = KBD_MAXRETRY;
- int again = KBD_MAXWAIT;
- int c = PSM_RESEND; /* keep the compiler happy */
-
- while (retry-- > 0) {
- empty_both_buffers(p, 10);
- if (!write_aux_command(p, PSMC_RESET_DEV))
- continue;
- emptyq(&kbdcp(p)->aux);
- /* NOTE: Compaq Armada laptops require extra delay here. XXX */
- for (again = KBD_MAXWAIT; again > 0; --again) {
- DELAY(KBD_RESETDELAY*1000);
- c = read_aux_data_no_wait(p);
- if (c != -1)
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX return code:%04x\n", c);
- if (c == PSM_ACK) /* aux dev is about to reset... */
- break;
- }
- if (retry < 0)
- return FALSE;
-
- for (again = KBD_MAXWAIT; again > 0; --again) {
- /* wait awhile, well, quite looooooooooooong */
- DELAY(KBD_RESETDELAY*1000);
- c = read_aux_data_no_wait(p); /* RESET_DONE/RESET_FAIL */
- if (c != -1) /* wait again if the controller is not ready */
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX status:%04x\n", c);
- if (c != PSM_RESET_DONE) /* reset status */
- return FALSE;
-
- c = read_aux_data(p); /* device ID */
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX ID:%04x\n", c);
- /* NOTE: we could check the device ID now, but leave it later... */
- return TRUE;
-}
-
-/* controller diagnostics and setup */
-
-int
-test_controller(KBDC p)
-{
- int retry = KBD_MAXRETRY;
- int again = KBD_MAXWAIT;
- int c = KBD_DIAG_FAIL;
-
- while (retry-- > 0) {
- empty_both_buffers(p, 10);
- if (write_controller_command(p, KBDC_DIAGNOSE))
- break;
- }
- if (retry < 0)
- return FALSE;
-
- emptyq(&kbdcp(p)->kbd);
- while (again-- > 0) {
- /* wait awhile */
- DELAY(KBD_RESETDELAY*1000);
- c = read_controller_data(p); /* DIAG_DONE/DIAG_FAIL */
- if (c != -1) /* wait again if the controller is not ready */
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: DIAGNOSE status:%04x\n", c);
- return (c == KBD_DIAG_DONE);
-}
-
-int
-test_kbd_port(KBDC p)
-{
- int retry = KBD_MAXRETRY;
- int again = KBD_MAXWAIT;
- int c = -1;
-
- while (retry-- > 0) {
- empty_both_buffers(p, 10);
- if (write_controller_command(p, KBDC_TEST_KBD_PORT))
- break;
- }
- if (retry < 0)
- return FALSE;
-
- emptyq(&kbdcp(p)->kbd);
- while (again-- > 0) {
- c = read_controller_data(p);
- if (c != -1) /* try again if the controller is not ready */
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: TEST_KBD_PORT status:%04x\n", c);
- return c;
-}
-
-int
-test_aux_port(KBDC p)
-{
- int retry = KBD_MAXRETRY;
- int again = KBD_MAXWAIT;
- int c = -1;
-
- while (retry-- > 0) {
- empty_both_buffers(p, 10);
- if (write_controller_command(p, KBDC_TEST_AUX_PORT))
- break;
- }
- if (retry < 0)
- return FALSE;
-
- emptyq(&kbdcp(p)->kbd);
- while (again-- > 0) {
- c = read_controller_data(p);
- if (c != -1) /* try again if the controller is not ready */
- break;
- }
- if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: TEST_AUX_PORT status:%04x\n", c);
- return c;
-}
-
-int
-kbdc_get_device_mask(KBDC p)
-{
- return kbdcp(p)->command_mask;
-}
-
-void
-kbdc_set_device_mask(KBDC p, int mask)
-{
- kbdcp(p)->command_mask =
- mask & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS);
-}
-
-int
-get_controller_command_byte(KBDC p)
-{
- if (kbdcp(p)->command_byte != -1)
- return kbdcp(p)->command_byte;
- if (!write_controller_command(p, KBDC_GET_COMMAND_BYTE))
- return -1;
- emptyq(&kbdcp(p)->kbd);
- kbdcp(p)->command_byte = read_controller_data(p);
- return kbdcp(p)->command_byte;
-}
-
-int
-set_controller_command_byte(KBDC p, int mask, int command)
-{
- if (get_controller_command_byte(p) == -1)
- return FALSE;
-
- command = (kbdcp(p)->command_byte & ~mask) | (command & mask);
- if (command & KBD_DISABLE_KBD_PORT) {
- if (!write_controller_command(p, KBDC_DISABLE_KBD_PORT))
- return FALSE;
- }
- if (!write_controller_command(p, KBDC_SET_COMMAND_BYTE))
- return FALSE;
- if (!write_controller_data(p, command))
- return FALSE;
- kbdcp(p)->command_byte = command;
-
- if (verbose)
- log(LOG_DEBUG, "kbdc: new command byte:%04x (set_controller...)\n",
- command);
-
- return TRUE;
-}
diff --git a/sys/dev/kbd/atkbdcreg.h b/sys/dev/kbd/atkbdcreg.h
deleted file mode 100644
index 81b0ad35dce9..000000000000
--- a/sys/dev/kbd/atkbdcreg.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * Copyright (c) 1996-1999
- * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
- * 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.
- *
- * 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.
- *
- * $Id: $
- * from kbdio.h,v 1.8 1998/09/25 11:55:46 yokota Exp
- */
-
-#ifndef _DEV_KBD_ATKBDCREG_H_
-#define _DEV_KBD_ATKBDCREG_H_
-
-/* constants */
-
-/* I/O ports */
-#define KBD_STATUS_PORT 4 /* status port, read */
-#define KBD_COMMAND_PORT 4 /* controller command port, write */
-#define KBD_DATA_PORT 0 /* data port, read/write
- * also used as keyboard command
- * and mouse command port
- */
-
-/* controller commands (sent to KBD_COMMAND_PORT) */
-#define KBDC_SET_COMMAND_BYTE 0x0060
-#define KBDC_GET_COMMAND_BYTE 0x0020
-#define KBDC_WRITE_TO_AUX 0x00d4
-#define KBDC_DISABLE_AUX_PORT 0x00a7
-#define KBDC_ENABLE_AUX_PORT 0x00a8
-#define KBDC_TEST_AUX_PORT 0x00a9
-#define KBDC_DIAGNOSE 0x00aa
-#define KBDC_TEST_KBD_PORT 0x00ab
-#define KBDC_DISABLE_KBD_PORT 0x00ad
-#define KBDC_ENABLE_KBD_PORT 0x00ae
-
-/* controller command byte (set by KBDC_SET_COMMAND_BYTE) */
-#define KBD_TRANSLATION 0x0040
-#define KBD_RESERVED_BITS 0x0004
-#define KBD_OVERRIDE_KBD_LOCK 0x0008
-#define KBD_ENABLE_KBD_PORT 0x0000
-#define KBD_DISABLE_KBD_PORT 0x0010
-#define KBD_ENABLE_AUX_PORT 0x0000
-#define KBD_DISABLE_AUX_PORT 0x0020
-#define KBD_ENABLE_AUX_INT 0x0002
-#define KBD_DISABLE_AUX_INT 0x0000
-#define KBD_ENABLE_KBD_INT 0x0001
-#define KBD_DISABLE_KBD_INT 0x0000
-#define KBD_KBD_CONTROL_BITS (KBD_DISABLE_KBD_PORT | KBD_ENABLE_KBD_INT)
-#define KBD_AUX_CONTROL_BITS (KBD_DISABLE_AUX_PORT | KBD_ENABLE_AUX_INT)
-
-/* keyboard device commands (sent to KBD_DATA_PORT) */
-#define KBDC_RESET_KBD 0x00ff
-#define KBDC_ENABLE_KBD 0x00f4
-#define KBDC_DISABLE_KBD 0x00f5
-#define KBDC_SET_DEFAULTS 0x00f6
-#define KBDC_SEND_DEV_ID 0x00f2
-#define KBDC_SET_LEDS 0x00ed
-#define KBDC_ECHO 0x00ee
-#define KBDC_SET_SCANCODE_SET 0x00f0
-#define KBDC_SET_TYPEMATIC 0x00f3
-
-/* aux device commands (sent to KBD_DATA_PORT) */
-#define PSMC_RESET_DEV 0x00ff
-#define PSMC_ENABLE_DEV 0x00f4
-#define PSMC_DISABLE_DEV 0x00f5
-#define PSMC_SET_DEFAULTS 0x00f6
-#define PSMC_SEND_DEV_ID 0x00f2
-#define PSMC_SEND_DEV_STATUS 0x00e9
-#define PSMC_SEND_DEV_DATA 0x00eb
-#define PSMC_SET_SCALING11 0x00e6
-#define PSMC_SET_SCALING21 0x00e7
-#define PSMC_SET_RESOLUTION 0x00e8
-#define PSMC_SET_STREAM_MODE 0x00ea
-#define PSMC_SET_REMOTE_MODE 0x00f0
-#define PSMC_SET_SAMPLING_RATE 0x00f3
-
-/* PSMC_SET_RESOLUTION argument */
-#define PSMD_RES_LOW 0 /* typically 25ppi */
-#define PSMD_RES_MEDIUM_LOW 1 /* typically 50ppi */
-#define PSMD_RES_MEDIUM_HIGH 2 /* typically 100ppi (default) */
-#define PSMD_RES_HIGH 3 /* typically 200ppi */
-#define PSMD_MAX_RESOLUTION PSMD_RES_HIGH
-
-/* PSMC_SET_SAMPLING_RATE */
-#define PSMD_MAX_RATE 255 /* FIXME: not sure if it's possible */
-
-/* status bits (KBD_STATUS_PORT) */
-#define KBDS_BUFFER_FULL 0x0021
-#define KBDS_ANY_BUFFER_FULL 0x0001
-#define KBDS_KBD_BUFFER_FULL 0x0001
-#define KBDS_AUX_BUFFER_FULL 0x0021
-#define KBDS_INPUT_BUFFER_FULL 0x0002
-
-/* return code */
-#define KBD_ACK 0x00fa
-#define KBD_RESEND 0x00fe
-#define KBD_RESET_DONE 0x00aa
-#define KBD_RESET_FAIL 0x00fc
-#define KBD_DIAG_DONE 0x0055
-#define KBD_DIAG_FAIL 0x00fd
-#define KBD_ECHO 0x00ee
-
-#define PSM_ACK 0x00fa
-#define PSM_RESEND 0x00fe
-#define PSM_RESET_DONE 0x00aa
-#define PSM_RESET_FAIL 0x00fc
-
-/* aux device ID */
-#define PSM_MOUSE_ID 0
-#define PSM_BALLPOINT_ID 2
-#define PSM_INTELLI_ID 3
-
-#ifdef KERNEL
-
-#define ATKBDC_DRIVER_NAME "atkbdc"
-
-/*
- * driver specific options: the following options may be set by
- * `options' statements in the kernel configuration file.
- */
-
-/* retry count */
-#ifndef KBD_MAXRETRY
-#define KBD_MAXRETRY 3
-#endif
-
-/* timing parameters */
-#ifndef KBD_RESETDELAY
-#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
-#endif
-#ifndef KBD_MAXWAIT
-#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
-#endif
-
-/* I/O recovery time */
-#define KBDC_DELAYTIME 20
-#define KBDD_DELAYTIME 7
-
-/* debug option */
-#ifndef KBDIO_DEBUG
-#define KBDIO_DEBUG 0
-#endif
-
-/* end of driver specific options */
-
-/* types/structures */
-
-#define KBDQ_BUFSIZE 32
-
-typedef struct _kqueue {
- int head;
- int tail;
- unsigned char q[KBDQ_BUFSIZE];
-#if KBDIO_DEBUG >= 2
- int call_count;
- int qcount;
- int max_qcount;
-#endif
-} kqueue;
-
-typedef struct atkbdc_softc {
- int port; /* base port address */
- int command_byte; /* current command byte value */
- int command_mask; /* command byte mask bits for kbd/aux devices */
- int lock; /* FIXME: XXX not quite a semaphore... */
- kqueue kbd; /* keyboard data queue */
- kqueue aux; /* auxiliary data queue */
-} atkbdc_softc_t;
-
-enum kbdc_device_ivar {
- KBDC_IVAR_PORT,
- KBDC_IVAR_IRQ,
- KBDC_IVAR_FLAGS,
-};
-
-typedef caddr_t KBDC;
-
-/* function prototypes */
-
-atkbdc_softc_t *atkbdc_get_softc(int unit);
-int atkbdc_probe_unit(atkbdc_softc_t *sc, int unit, int port);
-int atkbdc_configure(void);
-
-KBDC kbdc_open(int port);
-int kbdc_lock(KBDC kbdc, int lock);
-int kbdc_data_ready(KBDC kbdc);
-
-int write_controller_command(KBDC kbdc,int c);
-int write_controller_data(KBDC kbdc,int c);
-
-int write_kbd_command(KBDC kbdc,int c);
-int write_aux_command(KBDC kbdc,int c);
-int send_kbd_command(KBDC kbdc,int c);
-int send_aux_command(KBDC kbdc,int c);
-int send_kbd_command_and_data(KBDC kbdc,int c,int d);
-int send_aux_command_and_data(KBDC kbdc,int c,int d);
-
-int read_controller_data(KBDC kbdc);
-int read_kbd_data(KBDC kbdc);
-int read_kbd_data_no_wait(KBDC kbdc);
-int read_aux_data(KBDC kbdc);
-int read_aux_data_no_wait(KBDC kbdc);
-
-void empty_kbd_buffer(KBDC kbdc, int t);
-void empty_aux_buffer(KBDC kbdc, int t);
-void empty_both_buffers(KBDC kbdc, int t);
-
-int reset_kbd(KBDC kbdc);
-int reset_aux_dev(KBDC kbdc);
-
-int test_controller(KBDC kbdc);
-int test_kbd_port(KBDC kbdc);
-int test_aux_port(KBDC kbdc);
-
-int kbdc_get_device_mask(KBDC kbdc);
-void kbdc_set_device_mask(KBDC kbdc, int mask);
-
-int get_controller_command_byte(KBDC kbdc);
-int set_controller_command_byte(KBDC kbdc, int command, int flag);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_KBD_ATKBDCREG_H_ */
diff --git a/sys/dev/kbd/atkbdreg.h b/sys/dev/kbd/atkbdreg.h
deleted file mode 100644
index 9f20eeea5f3d..000000000000
--- a/sys/dev/kbd/atkbdreg.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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 AUTHORS ``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 AUTHORS 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.
- *
- * $Id: $
- */
-
-#ifndef _DEV_KBD_ATKBDREG_H_
-#define _DEV_KBD_ATKBDREG_H_
-
-#define ATKBD_DRIVER_NAME "atkbd"
-#define ATKBD_UNIT(dev) minor(dev)
-#define ATKBD_MKMINOR(unit) (unit)
-
-/* device configuration flags (atkbdprobe, atkbdattach) */
-#define KB_CONF_FAIL_IF_NO_KBD (1 << 0) /* don't install if no kbd is found */
-#define KB_CONF_NO_RESET (1 << 1) /* don't reset the keyboard */
-#define KB_CONF_ALT_SCANCODESET (1 << 2) /* assume the XT type keyboard */
-
-#ifdef KERNEL
-
-typedef struct atkbd_softc {
- short flags;
-#define ATKBD_ATTACHED (1 << 0)
- keyboard_t *kbd;
-#ifdef KBD_INSTALL_CDEV
- genkbd_softc_t gensc;
-#endif
-} atkbd_softc_t;
-
-#ifdef __i386__
-atkbd_softc_t *atkbd_get_softc(int unit);
-#endif
-int atkbd_probe_unit(int unit, atkbd_softc_t *sc,
- int port, int irq, int flags);
-int atkbd_attach_unit(int unit, atkbd_softc_t *sc);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_KBD_ATKBDREG_H_ */
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c
deleted file mode 100644
index e8c638327f90..000000000000
--- a/sys/dev/kbd/kbd.c
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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 AUTHORS ``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 AUTHORS 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.
- *
- * $Id: kbd.c,v 1.2 1999/01/12 10:35:58 yokota Exp $
- */
-
-#include "kbd.h"
-#include "opt_kbd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/poll.h>
-#include <sys/vnode.h>
-#include <sys/uio.h>
-
-#include <machine/console.h>
-
-#include <dev/kbd/kbdreg.h>
-
-/* local arrays */
-
-/*
- * We need at least one entry each in order to initialize a keyboard
- * for the kernel console. The arrays will be increased dynamically
- * when necessary.
- */
-
-static int keyboards = 1;
-static keyboard_t *kbd_ini;
-static keyboard_t **keyboard = &kbd_ini;
-static keyboard_switch_t *kbdsw_ini;
- keyboard_switch_t **kbdsw = &kbdsw_ini;
-
-#ifdef KBD_INSTALL_CDEV
-
-#define ARRAY_DELTA 4
-
-static struct cdevsw *kbdcdevsw_ini;
-static struct cdevsw **kbdcdevsw = &kbdcdevsw_ini;
-
-static void
-kbd_realloc_array(void)
-{
- keyboard_t **new_kbd;
- keyboard_switch_t **new_kbdsw;
- struct cdevsw **new_cdevsw;
- int newsize;
- int s;
-
- s = spltty();
- newsize = ((keyboards + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA;
- new_kbd = malloc(sizeof(*new_kbd)*newsize, M_DEVBUF, M_NOWAIT);
- new_kbdsw = malloc(sizeof(*new_kbdsw)*newsize, M_DEVBUF, M_NOWAIT);
- new_cdevsw = malloc(sizeof(*new_cdevsw)*newsize, M_DEVBUF, M_NOWAIT);
- bzero(new_kbd, sizeof(*new_kbd)*newsize);
- bzero(new_kbdsw, sizeof(*new_kbdsw)*newsize);
- bzero(new_cdevsw, sizeof(*new_cdevsw)*newsize);
- bcopy(keyboard, new_kbd, sizeof(*keyboard)*keyboards);
- bcopy(kbdsw, new_kbdsw, sizeof(*kbdsw)*keyboards);
- bcopy(kbdcdevsw, new_cdevsw, sizeof(*kbdcdevsw)*keyboards);
- if (keyboards > 1) {
- free(keyboard, M_DEVBUF);
- free(kbdsw, M_DEVBUF);
- free(kbdcdevsw, M_DEVBUF);
- }
- keyboard = new_kbd;
- kbdsw = new_kbdsw;
- kbdcdevsw = new_cdevsw;
- keyboards = newsize;
- splx(s);
-
- if (bootverbose)
- printf("kbd: new array size %d\n", keyboards);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/*
- * Low-level keyboard driver functions
- * Keyboard subdrivers, such as the AT keyboard driver and the USB keyboard
- * driver, call these functions to initialize the keyboard_t structure
- * and register it to the virtual keyboard driver `kbd'.
- */
-
-/* initialize the keyboard_t structure */
-void
-kbd_init_struct(keyboard_t *kbd, char *name, int type, int unit, int config,
- int port, int port_size)
-{
- kbd->kb_flags = KB_NO_DEVICE; /* device has not been found */
- kbd->kb_name = name;
- kbd->kb_type = type;
- kbd->kb_unit = unit;
- kbd->kb_config = config;
- kbd->kb_led = 0; /* unknown */
- kbd->kb_io_base = port;
- kbd->kb_io_size = port_size;
- kbd->kb_data = NULL;
- kbd->kb_keymap = NULL;
- kbd->kb_accentmap = NULL;
- kbd->kb_fkeytab = NULL;
- kbd->kb_fkeytab_size = 0;
-}
-
-void
-kbd_set_maps(keyboard_t *kbd, keymap_t *keymap, accentmap_t *accmap,
- fkeytab_t *fkeymap, int fkeymap_size)
-{
- kbd->kb_keymap = keymap;
- kbd->kb_accentmap = accmap;
- kbd->kb_fkeytab = fkeymap;
- kbd->kb_fkeytab_size = fkeymap_size;
-}
-
-/* register a keyboard and associate it with a function table */
-int
-kbd_register(keyboard_t *kbd)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
- int index;
-
- for (index = 0; index < keyboards; ++index) {
- if (keyboard[index] == NULL)
- break;
- }
- if (index >= keyboards)
- return -1;
-
- kbd->kb_index = index;
- KBD_UNBUSY(kbd);
- KBD_VALID(kbd);
- kbd->kb_active = 0; /* disabled until someone calls kbd_enable() */
- kbd->kb_token = NULL;
- kbd->kb_callback.kc_func = NULL;
- kbd->kb_callback.kc_arg = NULL;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, kbd->kb_name) == 0) {
- keyboard[index] = kbd;
- kbdsw[index] = p->kbdsw;
- return index;
- }
- }
-
- return -1;
-}
-
-int
-kbd_unregister(keyboard_t *kbd)
-{
- int error;
- int s;
-
- if ((kbd->kb_index < 0) || (kbd->kb_index >= keyboards))
- return ENOENT;
- if (keyboard[kbd->kb_index] != kbd)
- return ENOENT;
-
- s = spltty();
- if (KBD_IS_BUSY(kbd)) {
- error = (*kbd->kb_callback.kc_func)(kbd, KBDIO_UNLOADING,
- kbd->kb_callback.kc_arg);
- if (error) {
- splx(s);
- return error;
- }
- if (KBD_IS_BUSY(kbd)) {
- splx(s);
- return EBUSY;
- }
- }
- KBD_INVALID(kbd);
- keyboard[kbd->kb_index] = NULL;
- kbdsw[kbd->kb_index] = NULL;
-
- splx(s);
- return 0;
-}
-
-/* find a funciton table by the driver name */
-keyboard_switch_t
-*kbd_get_switch(char *driver)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, driver) == 0)
- return p->kbdsw;
- }
-
- return NULL;
-}
-
-/*
- * Keyboard client functions
- * Keyboard clients, such as the console driver `syscons' and the keyboard
- * cdev driver, use these functions to claim and release a keyboard for
- * exclusive use.
- */
-
-/* find the keyboard specified by a driver name and a unit number */
-int
-kbd_find_keyboard(char *driver, int unit)
-{
- int i;
-
- for (i = 0; i < keyboards; ++i) {
- if (keyboard[i] == NULL)
- continue;
- if (!KBD_IS_VALID(keyboard[i]))
- continue;
- if (strcmp("*", driver) && strcmp(keyboard[i]->kb_name, driver))
- continue;
- if ((unit != -1) && (keyboard[i]->kb_unit != unit))
- continue;
- return i;
- }
- return -1;
-}
-
-/* allocate a keyboard */
-int
-kbd_allocate(char *driver, int unit, void *id, kbd_callback_func_t *func,
- void *arg)
-{
- int index;
- int s;
-
- if (func == NULL)
- return -1;
-
- s = spltty();
- index = kbd_find_keyboard(driver, unit);
- if (index >= 0) {
- if (KBD_IS_BUSY(keyboard[index])) {
- splx(s);
- return -1;
- }
- keyboard[index]->kb_token = id;
- KBD_BUSY(keyboard[index]);
- keyboard[index]->kb_callback.kc_func = func;
- keyboard[index]->kb_callback.kc_arg = arg;
- (*kbdsw[index]->clear_state)(keyboard[index]);
- }
- splx(s);
- return index;
-}
-
-int
-kbd_release(keyboard_t *kbd, void *id)
-{
- int error;
- int s;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd) || !KBD_IS_BUSY(kbd)) {
- error = EINVAL;
- } else if (kbd->kb_token != id) {
- error = EPERM;
- } else {
- kbd->kb_token = NULL;
- KBD_UNBUSY(kbd);
- kbd->kb_callback.kc_func = NULL;
- kbd->kb_callback.kc_arg = NULL;
- (*kbdsw[kbd->kb_index]->clear_state)(kbd);
- error = 0;
- }
- splx(s);
- return error;
-}
-
-int
-kbd_change_callback(keyboard_t *kbd, void *id, kbd_callback_func_t *func,
- void *arg)
-{
- int error;
- int s;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd) || !KBD_IS_BUSY(kbd)) {
- error = EINVAL;
- } else if (kbd->kb_token != id) {
- error = EPERM;
- } else if (func == NULL) {
- error = EINVAL;
- } else {
- kbd->kb_callback.kc_func = func;
- kbd->kb_callback.kc_arg = arg;
- error = 0;
- }
- splx(s);
- return error;
-}
-
-/* get a keyboard structure */
-keyboard_t
-*kbd_get_keyboard(int index)
-{
- if ((index < 0) || (index >= keyboards))
- return NULL;
- if (!KBD_IS_VALID(keyboard[index]))
- return NULL;
- return keyboard[index];
-}
-
-/*
- * The back door for the console driver; configure keyboards
- * This function is for the kernel console to initialize keyboards
- * at very early stage.
- */
-
-int
-kbd_configure(int flags)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (p->configure != NULL)
- (*p->configure)(flags);
- }
-
- return 0;
-}
-
-#ifdef KBD_INSTALL_CDEV
-
-/*
- * Virtual keyboard cdev driver functions
- * The virtual keyboard driver dispatches driver functions to
- * appropriate subdrivers.
- */
-
-#define KBD_UNIT(dev) minor(dev)
-
-static d_open_t kbdopen;
-static d_close_t kbdclose;
-static d_read_t kbdread;
-static d_write_t kbdwrite;
-static d_ioctl_t kbdioctl;
-static d_reset_t kbdreset;
-static d_devtotty_t kbddevtotty;
-static d_poll_t kbdpoll;
-static d_mmap_t kbdmmap;
-
-#define CDEV_MAJOR 112
-
-static struct cdevsw kbd_cdevsw = {
- kbdopen, kbdclose, kbdread, kbdwrite, /* ??? */
- kbdioctl, nullstop, kbdreset, kbddevtotty,
- kbdpoll, kbdmmap, nostrategy, "kbd",
- NULL, -1, nodump, nopsize,
-};
-
-static void
-vkbdattach(void *arg)
-{
- static int kbd_devsw_installed = FALSE;
- dev_t dev;
-
- if (!kbd_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &kbd_cdevsw, NULL);
- kbd_devsw_installed = TRUE;
- }
-}
-
-PSEUDO_SET(vkbdattach, kbd);
-
-int
-kbd_attach(dev_t dev, keyboard_t *kbd, struct cdevsw *cdevsw)
-{
- int s;
-
- if (kbd->kb_index >= keyboards)
- return EINVAL;
- if (keyboard[kbd->kb_index] != kbd)
- return EINVAL;
-
- s = spltty();
- kbd->kb_minor = minor(dev);
- kbdcdevsw[kbd->kb_index] = cdevsw;
- splx(s);
-
- /* XXX: DEVFS? */
-
- if (kbd->kb_index + 1 >= keyboards)
- kbd_realloc_array();
-
- printf("kbd%d at %s%d\n", kbd->kb_index, kbd->kb_name, kbd->kb_unit);
- return 0;
-}
-
-int
-kbd_detach(dev_t dev, keyboard_t *kbd, struct cdevsw *cdevsw)
-{
- int s;
-
- if (kbd->kb_index >= keyboards)
- return EINVAL;
- if (keyboard[kbd->kb_index] != kbd)
- return EINVAL;
- if (kbdcdevsw[kbd->kb_index] != cdevsw)
- return EINVAL;
-
- s = spltty();
- (*kbdsw[kbd->kb_index]->term)(kbd);
- kbdcdevsw[kbd->kb_index] = NULL;
- splx(s);
- return 0;
-}
-
-static int
-kbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (unit >= keyboards)
- return ENXIO;
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- if (KBD_IS_BUSY(keyboard[unit]))
- return EBUSY;
- return (*kbdcdevsw[unit]->d_open)(makedev(0, keyboard[unit]->kb_minor),
- flag, mode, p);
-}
-
-static int
-kbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_close)(makedev(0, keyboard[unit]->kb_minor),
- flag, mode, p);
-}
-
-static int
-kbdread(dev_t dev, struct uio *uio, int flag)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_read)(makedev(0, keyboard[unit]->kb_minor),
- uio, flag);
-}
-
-static int
-kbdwrite(dev_t dev, struct uio *uio, int flag)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_write)(makedev(0, keyboard[unit]->kb_minor),
- uio, flag);
-}
-
-static int
-kbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_ioctl)(makedev(0, keyboard[unit]->kb_minor),
- cmd, arg, flag, p);
-}
-
-static int
-kbdreset(dev_t dev)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_reset)(makedev(0, keyboard[unit]->kb_minor));
-}
-
-static struct tty
-*kbddevtotty(dev_t dev)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return NULL;
- return (*kbdcdevsw[unit]->d_devtotty)(makedev(0, keyboard[unit]->kb_minor));
-}
-
-static int
-kbdpoll(dev_t dev, int event, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_poll)(makedev(0, keyboard[unit]->kb_minor),
- event, p);
-}
-
-static int
-kbdmmap(dev_t dev, vm_offset_t offset, int nprot)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_mmap)(makedev(0, keyboard[unit]->kb_minor),
- offset, nprot);
-}
-
-/*
- * Generic keyboard cdev driver functions
- * Keyboard subdrivers may call these functions to implement common
- * driver functions.
- */
-
-#define KB_QSIZE 512
-#define KB_BUFSIZE 64
-
-static kbd_callback_func_t genkbd_event;
-
-int
-genkbdopen(genkbd_softc_t *sc, keyboard_t *kbd, int mode, int flag,
- struct proc *p)
-{
- int s;
- int i;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd)) {
- splx(s);
- return ENXIO;
- }
- i = kbd_allocate(kbd->kb_name, kbd->kb_unit, sc,
- genkbd_event, (void *)sc);
- if (i < 0) {
- splx(s);
- return EBUSY;
- }
- /* assert(i == kbd->kb_index) */
- /* assert(kbd == kbd_get_keyboard(i)) */
-
- /*
- * NOTE: even when we have successfully claimed a keyboard,
- * the device may still be missing (!KBD_HAS_DEVICE(kbd)).
- */
-
-#if 0
- bzero(&sc->gkb_q, sizeof(sc->gkb_q));
-#endif
- clist_alloc_cblocks(&sc->gkb_q, KB_QSIZE, KB_QSIZE/2); /* XXX */
- sc->gkb_rsel.si_flags = 0;
- sc->gkb_rsel.si_pid = 0;
- splx(s);
-
- return 0;
-}
-
-int
-genkbdclose(genkbd_softc_t *sc, keyboard_t *kbd, int mode, int flag,
- struct proc *p)
-{
- int s;
-
- /*
- * NOTE: the device may have already become invalid.
- * !KBD_IS_VALID(kbd)
- */
- s = spltty();
- kbd_release(kbd, (void *)sc);
-#if 0
- clist_free_cblocks(&sc->gkb_q);
-#endif
- splx(s);
-
- return 0;
-}
-
-int
-genkbdread(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio, int flag)
-{
- u_char buffer[KB_BUFSIZE];
- int len;
- int error;
- int s;
-
- /* wait for input */
- s = spltty();
- while (sc->gkb_q.c_cc == 0) {
- if (!KBD_IS_VALID(kbd)) {
- splx(s);
- return EIO;
- }
- if (flag & IO_NDELAY) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->gkb_flags |= KB_ASLEEP;
- error = tsleep((caddr_t)sc, PZERO | PCATCH, "kbdrea", 0);
- if (error) {
- sc->gkb_flags &= ~KB_ASLEEP;
- splx(s);
- return error;
- }
- }
- splx(s);
-
- /* copy as much input as possible */
- error = 0;
- while (uio->uio_resid > 0) {
- len = imin(uio->uio_resid, sizeof(buffer));
- len = q_to_b(&sc->gkb_q, buffer, len);
- if (len <= 0)
- break;
- error = uiomove(buffer, len, uio);
- if (error)
- break;
- }
-
- return error;
-}
-
-int
-genkbdwrite(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio, int flag)
-{
- if (!KBD_IS_VALID(kbd))
- return ENXIO;
- return ENODEV;
-}
-
-int
-genkbdioctl(genkbd_softc_t *sc, keyboard_t *kbd, u_long cmd, caddr_t arg,
- int flag, struct proc *p)
-{
- int error;
-
- if (kbd == NULL) /* XXX */
- return ENXIO;
- if (!KBD_IS_VALID(kbd))
- return ENXIO;
- error = (*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, arg);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-}
-
-int
-genkbdpoll(genkbd_softc_t *sc, keyboard_t *kbd, int events, struct proc *p)
-{
- int revents;
- int s;
-
- revents = 0;
- s = spltty();
- if (events & (POLLIN | POLLRDNORM)) {
- if ((sc->gkb_q.c_cc > 0) || !KBD_IS_VALID(kbd))
- revents |= (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->gkb_rsel);
- }
- splx(s);
- return revents;
-}
-
-static int
-genkbd_event(keyboard_t *kbd, int event, void *arg)
-{
- genkbd_softc_t *sc;
- size_t len;
- u_char *cp;
- int mode;
- int c;
-
- /* assert(KBD_IS_VALID(kbd)) */
- sc = (genkbd_softc_t *)arg;
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- /* the keyboard is going... */
- kbd_release(kbd, (void *)sc);
- return 0;
- default:
- return EINVAL;
- }
-
- /* obtain the current key input mode */
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDGKBMODE, (caddr_t)&mode))
- mode = K_XLATE;
-
- /* read all pending input */
- while ((*kbdsw[kbd->kb_index]->check_char)(kbd)) {
- c = (*kbdsw[kbd->kb_index]->read_char)(kbd, FALSE);
- if (c == NOKEY)
- continue;
- if (c == ERRKEY) /* XXX: ring bell? */
- continue;
- if (!KBD_IS_BUSY(kbd))
- /* the device is not open, discard the input */
- continue;
-
- /* store the byte as is for K_RAW and K_CODE modes */
- if (mode != K_XLATE) {
- putc(KEYCHAR(c), &sc->gkb_q);
- continue;
- }
-
- /* K_XLATE */
- if (c & RELKEY) /* key release is ignored */
- continue;
-
- /* process special keys; most of them are just ignored... */
- if (c & SPCLKEY) {
- switch (KEYCHAR(c)) {
- /* locking keys */
- case NLK: case CLK: case SLK: case ALK:
- /* shift keys */
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
- /* other special keys */
- case NOP: case SPSC: case RBT: case SUSP:
- case STBY: case DBG: case NEXT:
- /* ignore them... */
- continue;
- case BTAB: /* a backtab: ESC [ Z */
- putc(0x1b, &sc->gkb_q);
- putc('[', &sc->gkb_q);
- putc('Z', &sc->gkb_q);
- continue;
- }
- }
-
- /* normal chars, normal chars with the META, function keys */
- switch (KEYFLAGS(c)) {
- case 0: /* a normal char */
- putc(KEYCHAR(c), &sc->gkb_q);
- break;
- case MKEY: /* the META flag: prepend ESC */
- putc(0x1b, &sc->gkb_q);
- putc(KEYCHAR(c), &sc->gkb_q);
- break;
- case FKEY | SPCLKEY: /* a function key, return string */
- cp = (*kbdsw[kbd->kb_index]->get_fkeystr)(kbd,
- KEYCHAR(c), &len);
- if (cp != NULL) {
- while (len-- > 0)
- putc(*cp++, &sc->gkb_q);
- }
- break;
- }
- }
-
- /* wake up sleeping/polling processes */
- if (sc->gkb_q.c_cc > 0) {
- if (sc->gkb_flags & KB_ASLEEP) {
- sc->gkb_flags &= ~KB_ASLEEP;
- wakeup((caddr_t)sc);
- }
- selwakeup(&sc->gkb_rsel);
- }
-
- return 0;
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/*
- * Generic low-level keyboard functions
- * The low-level functions in the keyboard subdriver may use these
- * functions.
- */
-
-int
-genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- keyarg_t *keyp;
- fkeyarg_t *fkeyp;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBINFO: /* get keyboard information */
- ((keyboard_info_t *)arg)->kb_index = kbd->kb_index;
- i = imin(strlen(kbd->kb_name) + 1,
- sizeof(((keyboard_info_t *)arg)->kb_name));
- bcopy(kbd->kb_name, ((keyboard_info_t *)arg)->kb_name, i);
- ((keyboard_info_t *)arg)->kb_unit = kbd->kb_unit;
- ((keyboard_info_t *)arg)->kb_type = kbd->kb_type;
- ((keyboard_info_t *)arg)->kb_config = kbd->kb_config;
- ((keyboard_info_t *)arg)->kb_flags = kbd->kb_flags;
- break;
-
- case KDGKBTYPE: /* get keyboard type */
- *(int *)arg = kbd->kb_type;
- break;
-
- case GIO_KEYMAP: /* get keyboard translation table */
- bcopy(kbd->kb_keymap, arg, sizeof(*kbd->kb_keymap));
- break;
- case PIO_KEYMAP: /* set keyboard translation table */
- bzero(kbd->kb_accentmap, sizeof(*kbd->kb_accentmap));
- bcopy(arg, kbd->kb_keymap, sizeof(*kbd->kb_keymap));
- break;
-
- case GIO_KEYMAPENT: /* get keyboard translation table entry */
- keyp = (keyarg_t *)arg;
- if (keyp->keynum >= sizeof(kbd->kb_keymap->key)
- /sizeof(kbd->kb_keymap->key[0])) {
- splx(s);
- return EINVAL;
- }
- bcopy(&kbd->kb_keymap->key[keyp->keynum], &keyp->key,
- sizeof(keyp->key));
- break;
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- keyp = (keyarg_t *)arg;
- if (keyp->keynum >= sizeof(kbd->kb_keymap->key)
- /sizeof(kbd->kb_keymap->key[0])) {
- splx(s);
- return EINVAL;
- }
- bcopy(&keyp->key, &kbd->kb_keymap->key[keyp->keynum],
- sizeof(keyp->key));
- break;
-
- case GIO_DEADKEYMAP: /* get accent key translation table */
- bcopy(kbd->kb_accentmap, arg, sizeof(*kbd->kb_accentmap));
- break;
- case PIO_DEADKEYMAP: /* set accent key translation table */
- bcopy(arg, kbd->kb_accentmap, sizeof(*kbd->kb_accentmap));
- break;
-
- case GETFKEY: /* get functionkey string */
- fkeyp = (fkeyarg_t *)arg;
- if (fkeyp->keynum >= kbd->kb_fkeytab_size) {
- splx(s);
- return EINVAL;
- }
- bcopy(kbd->kb_fkeytab[fkeyp->keynum].str, fkeyp->keydef,
- kbd->kb_fkeytab[fkeyp->keynum].len);
- fkeyp->flen = kbd->kb_fkeytab[fkeyp->keynum].len;
- break;
- case SETFKEY: /* set functionkey string */
- fkeyp = (fkeyarg_t *)arg;
- if (fkeyp->keynum >= kbd->kb_fkeytab_size) {
- splx(s);
- return EINVAL;
- }
- kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
- bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
- kbd->kb_fkeytab[fkeyp->keynum].len);
- break;
-
- default:
- splx(s);
- return ENOIOCTL;
- }
-
- splx(s);
- return 0;
-}
-
-/* get a pointer to the string associated with the given function key */
-u_char
-*genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len)
-{
- if (kbd == NULL)
- return NULL;
- fkey -= F_FN;
- if (fkey > kbd->kb_fkeytab_size)
- return NULL;
- *len = kbd->kb_fkeytab[fkey].len;
- return kbd->kb_fkeytab[fkey].str;
-}
-
-/* diagnostic dump */
-static char
-*get_kbd_type_name(int type)
-{
- static struct {
- int type;
- char *name;
- } name_table[] = {
- { KB_84, "AT 84" },
- { KB_101, "AT 101/102" },
- { KB_OTHER, "generic" },
- };
- int i;
-
- for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
- if (type == name_table[i].type)
- return name_table[i].name;
- }
- return "unknown";
-}
-
-void
-genkbd_diag(keyboard_t *kbd, int level)
-{
- if (level > 0) {
- printf("kbd%d: %s%d, %s (%d), config:0x%x, flags:0x%x",
- kbd->kb_index, kbd->kb_name, kbd->kb_unit,
- get_kbd_type_name(kbd->kb_type), kbd->kb_type,
- kbd->kb_config, kbd->kb_flags);
- if (kbd->kb_io_base > 0)
- printf(", port:0x%x-0x%x", kbd->kb_io_base,
- kbd->kb_io_base + kbd->kb_io_size - 1);
- printf("\n");
- }
-}
-
-#define set_lockkey_state(k, s, l) \
- if (!((s) & l ## DOWN)) { \
- int i; \
- (s) |= l ## DOWN; \
- (s) ^= l ## ED; \
- i = (s) & LOCK_MASK; \
- (*kbdsw[(k)->kb_index]->ioctl)((k), KDSETLED, (caddr_t)&i); \
- }
-
-static u_int
-save_accent_key(keyboard_t *kbd, u_int key, int *accents)
-{
- int i;
-
- /* make an index into the accent map */
- i = key - F_ACC + 1;
- if ((i > kbd->kb_accentmap->n_accs)
- || (kbd->kb_accentmap->acc[i - 1].accchar == 0)) {
- /* the index is out of range or pointing to an empty entry */
- *accents = 0;
- return ERRKEY;
- }
-
- /*
- * If the same accent key has been hit twice, produce the accent char
- * itself.
- */
- if (i == *accents) {
- key = kbd->kb_accentmap->acc[i - 1].accchar;
- *accents = 0;
- return key;
- }
-
- /* remember the index and wait for the next key */
- *accents = i;
- return NOKEY;
-}
-
-static u_int
-make_accent_char(keyboard_t *kbd, u_int ch, int *accents)
-{
- struct acc_t *acc;
- int i;
-
- acc = &kbd->kb_accentmap->acc[*accents - 1];
- *accents = 0;
-
- /*
- * If the accent key is followed by the space key,
- * produce the accent char itself.
- */
- if (ch == ' ')
- return acc->accchar;
-
- /* scan the accent map */
- for (i = 0; i < NUM_ACCENTCHARS; ++i) {
- if (acc->map[i][0] == 0) /* end of table */
- break;
- if (acc->map[i][0] == ch)
- return acc->map[i][1];
- }
- /* this char cannot be accented... */
- return ERRKEY;
-}
-
-int
-genkbd_keyaction(keyboard_t *kbd, int keycode, int up, int *shiftstate,
- int *accents)
-{
- struct keyent_t *key;
- int state = *shiftstate;
- int action;
- int f;
- int i;
-
- f = state & (AGRS | ALKED);
- if ((f == AGRS1) || (f == AGRS2) || (f == ALKED))
- keycode += ALTGR_OFFSET;
- key = &kbd->kb_keymap->key[keycode];
- i = ((state & SHIFTS) ? 1 : 0)
- | ((state & CTLS) ? 2 : 0)
- | ((state & ALTS) ? 4 : 0);
- if (((key->flgs & FLAG_LOCK_C) && (state & CLKED))
- || ((key->flgs & FLAG_LOCK_N) && (state & NLKED)) )
- i ^= 1;
-
- action = key->map[i];
- if (up) { /* break: key released */
- if (key->spcl & (0x80 >> i)) {
- /* special keys */
- switch (action) {
- case LSH:
- state &= ~SHIFTS1;
- break;
- case RSH:
- state &= ~SHIFTS2;
- break;
- case LCTR:
- state &= ~CTLS1;
- break;
- case RCTR:
- state &= ~CTLS2;
- break;
- case LALT:
- state &= ~ALTS1;
- break;
- case RALT:
- state &= ~ALTS2;
- break;
- case ASH:
- state &= ~AGRS1;
- break;
- case META:
- state &= ~METAS1;
- break;
- case NLK:
- state &= ~NLKDOWN;
- break;
- case CLK:
-#ifndef PC98
- state &= ~CLKDOWN;
-#else
- state &= ~CLKED;
- i = state & LOCK_MASK;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&i);
-#endif
- break;
- case SLK:
- state &= ~SLKDOWN;
- break;
- case ALK:
- state &= ~ALKDOWN;
- break;
- }
- *shiftstate = state;
- return (SPCLKEY | RELKEY | action);
- }
- /* release events of regular keys are not reported */
- return NOKEY;
- } else { /* make: key pressed */
- if (key->spcl & (0x80 >> i)) {
- /* special keys */
- switch (action) {
- /* LOCKING KEYS */
- case NLK:
- set_lockkey_state(kbd, state, NLK);
- break;
- case CLK:
-#ifndef PC98
- set_lockkey_state(kbd, state, CLK);
-#else
- state |= CLKED;
- i = state & LOCK_MASK;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&i);
-#endif
- break;
- case SLK:
- set_lockkey_state(kbd, state, SLK);
- break;
- case ALK:
- set_lockkey_state(kbd, state, ALK);
- break;
- /* NON-LOCKING KEYS */
- case SPSC: case RBT: case SUSP: case STBY:
- case DBG: case NEXT:
- *accents = 0;
- break;
- case BTAB:
- *accents = 0;
- action |= BKEY;
- break;
- case LSH:
- state |= SHIFTS1;
- break;
- case RSH:
- state |= SHIFTS2;
- break;
- case LCTR:
- state |= CTLS1;
- break;
- case RCTR:
- state |= CTLS2;
- break;
- case LALT:
- state |= ALTS1;
- break;
- case RALT:
- state |= ALTS2;
- break;
- case ASH:
- state |= AGRS1;
- break;
- case META:
- state |= METAS1;
- break;
- default:
- /* is this an accent (dead) key? */
- if (action >= F_ACC && action <= L_ACC) {
- action = save_accent_key(kbd, action,
- accents);
- switch (action) {
- case NOKEY:
- case ERRKEY:
- return action;
- default:
- if (state & METAS)
- return (action | MKEY);
- else
- return action;
- }
- /* NOT REACHED */
- }
- /* other special keys */
- if (*accents > 0) {
- *accents = 0;
- return ERRKEY;
- }
- if (action >= F_FN && action <= L_FN)
- action |= FKEY;
- /* XXX: return fkey string for the FKEY? */
- }
- *shiftstate = state;
- return (SPCLKEY | action);
- } else {
- /* regular keys */
- if (*accents > 0) {
- /* make an accented char */
- action = make_accent_char(kbd, action, accents);
- if (action == ERRKEY)
- return action;
- }
- if (state & METAS)
- action |= MKEY;
- return action;
- }
- }
- /* NOT REACHED */
-}
diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h
deleted file mode 100644
index d5920196507d..000000000000
--- a/sys/dev/kbd/kbdreg.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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 AUTHORS ``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 AUTHORS 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.
- *
- * $Id: kbdreg.h,v 1.1 1999/01/09 02:44:50 yokota Exp $
- */
-
-#ifndef _DEV_KBD_KBDREG_H_
-#define _DEV_KBD_KBDREG_H_
-
-/* forward declarations */
-typedef struct keyboard keyboard_t;
-struct keymap;
-struct accentmap;
-struct fkeytab;
-
-/* call back funcion */
-typedef int kbd_callback_func_t(keyboard_t *kbd, int event,
- void *arg);
-/* event types */
-#define KBDIO_KEYINPUT 0
-#define KBDIO_UNLOADING 1
-
-typedef struct keyboard_callback {
- kbd_callback_func_t *kc_func;
- void *kc_arg;
-} keyboard_callback_t;
-
-/* keyboard */
-struct keyboard {
- /* the following fields are managed by kbdio */
- int kb_index; /* kbdio index# */
- int kb_minor; /* minor number of the sub-device */
- int kb_flags; /* internal flags */
-#define KB_VALID (1 << 16) /* this entry is valid */
-#define KB_NO_DEVICE (1 << 17) /* device not present */
-#define KB_PROBED (1 << 18) /* device probed */
-#define KB_INITIALIZED (1 << 19) /* device initialized */
-#define KB_REGISTERED (1 << 20) /* device registered to kbdio */
-#define KB_BUSY (1 << 21) /* device used by a client */
- int kb_active; /* 0: inactive */
- void *kb_token; /* id of the current client */
- keyboard_callback_t kb_callback;/* callback function */
-
- /*
- * Device configuration flags:
- * The upper 16 bits are common between various keyboard devices.
- * The lower 16 bits are device-specific.
- */
- int kb_config;
-#define KB_CONF_PROBE_ONLY (1 << 16) /* probe only, don't initialize */
-
- /* the following fields are set up by the driver */
- char *kb_name; /* driver name */
- int kb_unit; /* unit # */
- int kb_type; /* KB_84, KB_101, KB_OTHER,... */
- int kb_io_base; /* port# if any */
- int kb_io_size; /* # of occupied port */
- int kb_led; /* LED status */
- struct keymap *kb_keymap; /* key map */
- struct accentmap *kb_accentmap; /* accent map */
- struct fkeytab *kb_fkeytab; /* function key strings */
- int kb_fkeytab_size;/* # of function key strings */
- void *kb_data; /* the driver's private data */
-};
-
-#define KBD_IS_VALID(k) ((k)->kb_flags & KB_VALID)
-#define KBD_VALID(k) ((k)->kb_flags |= KB_VALID)
-#define KBD_INVALID(k) ((k)->kb_flags &= ~KB_VALID)
-#define KBD_HAS_DEVICE(k) (!((k)->kb_flags & KB_NO_DEVICE))
-#define KBD_FOUND_DEVICE(k) ((k)->kb_flags &= ~KB_NO_DEVICE)
-#define KBD_IS_PROBED(k) ((k)->kb_flags & KB_PROBED)
-#define KBD_PROBE_DONE(k) ((k)->kb_flags |= KB_PROBED)
-#define KBD_IS_INITIALIZED(k) ((k)->kb_flags & KB_INITIALIZED)
-#define KBD_INIT_DONE(k) ((k)->kb_flags |= KB_INITIALIZED)
-#define KBD_IS_CONFIGURED(k) ((k)->kb_flags & KB_REGISTERED)
-#define KBD_CONFIG_DONE(k) ((k)->kb_flags |= KB_REGISTERED)
-#define KBD_IS_BUSY(k) ((k)->kb_flags & KB_BUSY)
-#define KBD_BUSY(k) ((k)->kb_flags |= KB_BUSY)
-#define KBD_UNBUSY(k) ((k)->kb_flags &= ~KB_BUSY)
-#define KBD_IS_ACTIVE(k) ((k)->kb_active)
-#define KBD_ACTIVATE(k) (++(k)->kb_active)
-#define KBD_DEACTIVATE(k) (--(k)->kb_active)
-#define KBD_LED_VAL(k) ((k)->kb_led)
-
-/* keyboard function table */
-typedef int kbd_probe_t(int unit, keyboard_t **kbdp, void *arg,
- int flags);
-typedef int kbd_init_t(keyboard_t *kbd);
-typedef int kbd_term_t(keyboard_t *kbd);
-typedef int kbd_intr_t(keyboard_t *kbd);
-typedef int kbd_test_if_t(keyboard_t *kbd);
-typedef int kbd_enable_t(keyboard_t *kbd);
-typedef int kbd_disable_t(keyboard_t *kbd);
-typedef int kbd_read_t(keyboard_t *kbd, int wait);
-typedef int kbd_check_t(keyboard_t *kbd);
-typedef u_int kbd_read_char_t(keyboard_t *kbd, int wait);
-typedef int kbd_check_char_t(keyboard_t *kbd);
-typedef int kbd_ioctl_t(keyboard_t *kbd, u_long cmd, caddr_t data);
-typedef int kbd_lock_t(keyboard_t *kbd, int lock);
-typedef void kbd_clear_state_t(keyboard_t *kbd);
-typedef int kbd_get_state_t(keyboard_t *kbd, void *buf, size_t len);
-typedef int kbd_set_state_t(keyboard_t *kbd, void *buf, size_t len);
-typedef u_char *kbd_get_fkeystr_t(keyboard_t *kbd, int fkey,
- size_t *len);
-typedef void kbd_diag_t(keyboard_t *kbd, int level);
-
-typedef struct keyboard_switch {
- kbd_probe_t *probe;
- kbd_init_t *init;
- kbd_term_t *term;
- kbd_intr_t *intr;
- kbd_test_if_t *test_if;
- kbd_enable_t *enable;
- kbd_disable_t *disable;
- kbd_read_t *read;
- kbd_check_t *check;
- kbd_read_char_t *read_char;
- kbd_check_char_t *check_char;
- kbd_ioctl_t *ioctl;
- kbd_lock_t *lock;
- kbd_clear_state_t *clear_state;
- kbd_get_state_t *get_state;
- kbd_set_state_t *set_state;
- kbd_get_fkeystr_t *get_fkeystr;
- kbd_diag_t *diag;
-} keyboard_switch_t;
-
-/* keyboard driver */
-typedef struct keyboard_driver {
- char *name;
- keyboard_switch_t *kbdsw;
- int (*configure)(int); /* backdoor for the console driver */
-} keyboard_driver_t;
-
-#ifdef KERNEL
-
-#define KEYBOARD_DRIVER(name, sw, config) \
- static struct keyboard_driver name##_driver = { \
- #name, &sw, config \
- }; \
- DATA_SET(kbddriver_set, name##_driver);
-
-/* global variables */
-extern keyboard_switch_t **kbdsw;
-extern struct linker_set kbddriver_set;
-
-/* functions for the keyboard driver */
-int kbd_register(keyboard_t *kbd);
-int kbd_unregister(keyboard_t *kbd);
-keyboard_switch_t *kbd_get_switch(char *driver);
-void kbd_init_struct(keyboard_t *kbd, char *name, int type,
- int unit, int config, int port,
- int port_size);
-void kbd_set_maps(keyboard_t *kbd, struct keymap *keymap,
- struct accentmap *accmap,
- struct fkeytab *fkeymap, int fkeymap_size);
-
-/* functions for the keyboard client */
-int kbd_allocate(char *driver, int unit, void *id,
- kbd_callback_func_t *func, void *arg);
-int kbd_release(keyboard_t *kbd, void *id);
-int kbd_change_callback(keyboard_t *kbd, void *id,
- kbd_callback_func_t *func, void *arg);
-int kbd_find_keyboard(char *driver, int unit);
-keyboard_t *kbd_get_keyboard(int index);
-
-/* a back door for the console driver to tickle the keyboard driver XXX */
-int kbd_configure(int flags);
- /* see `kb_config' above for flag bit definitions */
-
-#ifdef KBD_INSTALL_CDEV
-
-/* virtual keyboard cdev driver functions */
-
-int kbd_attach(dev_t dev, keyboard_t *kbd,
- struct cdevsw *sw);
-int kbd_detach(dev_t dev, keyboard_t *kbd,
- struct cdevsw *sw);
-
-/* generic keyboard cdev driver functions */
-
-typedef struct genkbd_softc {
- int gkb_flags; /* flag/status bits */
-#define KB_ASLEEP (1 << 0)
- struct clist gkb_q; /* input queue */
- struct selinfo gkb_rsel;
-} genkbd_softc_t;
-
-int genkbdopen(genkbd_softc_t *sc, keyboard_t *kbd, int flag, int mode,
- struct proc *p);
-int genkbdclose(genkbd_softc_t *sc, keyboard_t *kbd, int flag, int mode,
- struct proc *p);
-int genkbdread(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio,
- int flag);
-int genkbdwrite(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio,
- int flag);
-int genkbdioctl(genkbd_softc_t *sc, keyboard_t *kbd, u_long cmd,
- caddr_t arg, int flag, struct proc *p);
-int genkbdpoll(genkbd_softc_t *sc, keyboard_t *kbd, int event,
- struct proc *p);
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* generic low-level keyboard functions */
-
-/* shift key state */
-#define SHIFTS1 (1 << 16)
-#define SHIFTS2 (1 << 17)
-#define SHIFTS (SHIFTS1 | SHIFTS2)
-#define CTLS1 (1 << 18)
-#define CTLS2 (1 << 19)
-#define CTLS (CTLS1 | CTLS2)
-#define ALTS1 (1 << 20)
-#define ALTS2 (1 << 21)
-#define ALTS (ALTS1 | ALTS2)
-#define AGRS1 (1 << 22)
-#define AGRS2 (1 << 23)
-#define AGRS (AGRS1 | AGRS2)
-#define METAS1 (1 << 24)
-#define METAS2 (1 << 25)
-#define METAS (METAS1 | METAS2)
-#define NLKDOWN (1 << 26)
-#define SLKDOWN (1 << 27)
-#define CLKDOWN (1 << 28)
-#define ALKDOWN (1 << 29)
-/* lock key state (defined in machine/console.h) */
-/*
-#define CLKED LED_CAP
-#define NLKED LED_NUM
-#define SLKED LED_SCR
-#define ALKED (1 << 3)
-#define LOCK_MASK (CLKED | NLKED | SLKED | ALKED)
-#define LED_CAP (1 << 0)
-#define LED_NUM (1 << 1)
-#define LED_SCR (1 << 2)
-#define LED_MASK (LED_CAP | LED_NUM | LED_SCR)
-*/
-
-kbd_get_fkeystr_t genkbd_get_fkeystr;
-kbd_diag_t genkbd_diag;
-
-int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg);
-int genkbd_keyaction(keyboard_t *kbd, int keycode, int down,
- int *shiftstate, int *accents);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_KBD_KBDREG_H_ */
diff --git a/sys/dev/kbd/kbdtables.h b/sys/dev/kbd/kbdtables.h
deleted file mode 100644
index c0d4663a6eac..000000000000
--- a/sys/dev/kbd/kbdtables.h
+++ /dev/null
@@ -1,1332 +0,0 @@
-/*-
- * Copyright (c) 1992-1998 Søren Schmidt
- * 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, immediately at the beginning of the file.
- * 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.
- *
- * 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.
- *
- * $Id: kbdtables.h,v 1.41 1998/09/15 18:16:37 sos Exp $
- */
-
-#define SET8 0x80 /* set eight bit on */
-
-#ifdef PC98
-#define NO_ACCENTCHARS
-/* PC-9801 keymap by kuribo@isl.melco.co.jp */
-static keymap_t key_map = { 0x80, /* PC98 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=01 */ '1', '!', '!', '!', '1', '!', '!', '!', 0x00, 0x00,
-/* sc=02 */ '2', '\"', 0x1A, 0x1A, '2', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=03 */ '3', '#', 0x1B, 0x1B, '3', '#', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=04 */ '4', '$', 0x1C, 0x1C, '4', '$', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=05 */ '5', '%', 0x1D, 0x1D, '5', '%', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=06 */ '6', '&', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=07 */ '7', '\'', 0x1F, 0x1F, '7', '&', '&', '&', 0x00, 0x00,
-/* sc=08 */ '8', '(', 0x7F, 0x7F, '8', '*', 0x08, 0x08, 0x00, 0x00,
-/* sc=09 */ '9', ')', '9', '9', '9', '(', '(', '(', 0x00, 0x00,
-/* sc=0a */ '0', NOP, '0', '0', '0', ')', ')', ')', 0x40, 0x00,
-/* sc=0b */ '-', '=', '-', '-', '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0c */ '^', '`', 0x1E, 0x1E, '=', '+', '+', '+', 0x00, 0x00,
-/* sc=0d */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
-/* sc=0f */ '\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t', 0x00, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '@', '~', 0x00, 0x00, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ '[', '{', 0x1B, 0x1B, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ '\r', '\r', '\n', '\n', '\r', '\r', '\n', '\n', 0x00, 0x00,
-/* sc=1d */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1e */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=1f */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=20 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=21 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=22 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=23 */ 'j', 'J', '\n', '\n', 'j', 'J', '\n', '\n', 0x00, 0x01,
-/* sc=24 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=25 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=26 */ ';', '+', ';', ';', ';', ':', ';', ';', 0x00, 0x00,
-/* sc=27 */ ':', '*', ':', ':', '\'', '\"', '\'', '\'', 0x00, 0x00,
-/* sc=28 */ ']', '}', 0x1D, 0x1D, '`', '~', '~', '~', 0x00, 0x00,
-/* sc=29 */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2a */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2b */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2c */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=2d */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=2e */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=2f */ 'm', 'M', '\r', '\r', 'm', 'M', '\r', '\r', 0x00, 0x01,
-/* sc=30 */ ',', '<', '<', '<', ',', '<', '<', '<', 0x00, 0x00,
-/* sc=31 */ '.', '>', '>', '>', '.', '>', '>', '>', 0x00, 0x00,
-/* sc=32 */ '/', '?', 0x7F, 0x7F, '/', '?', 0x7F, 0x7F, 0x00, 0x00,
-/* sc=33 */ NOP, '_', 0x1F, 0x1F, '\\', '|', 0x1C, 0x1C, 0x80, 0x00,
-/* sc=34 */ ' ', ' ', 0x00, 0x00, ' ', ' ', 0x00, 0x00, 0x00, 0x00,
-/* sc=35 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=36 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=37 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=38 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=39 */ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, RBT, RBT, 0x03, 0x02,
-/* sc=3a */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=3b */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=3c */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=3d */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=3e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=3f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=40 */ '-', '-', '-', '-', '-', '-', '-', '-', 0x00, 0x00,
-/* sc=41 */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=42 */ '7', '7', '7', '7', '7', '7', '7', '7', 0x00, 0x00,
-/* sc=43 */ '8', '8', '8', '8', '8', '8', '8', '8', 0x00, 0x00,
-/* sc=44 */ '9', '9', '9', '9', '9', '9', '9', '9', 0x00, 0x00,
-/* sc=45 */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x00,
-/* sc=46 */ '4', '4', '4', '4', '4', '4', '4', '4', 0x00, 0x00,
-/* sc=47 */ '5', '5', '5', '5', '5', '5', '5', '5', 0x00, 0x00,
-/* sc=48 */ '6', '6', '6', '6', '6', '6', '6', '6', 0x00, 0x00,
-/* sc=49 */ '+', '+', '+', '+', '+', '+', '+', '+', 0x00, 0x00,
-/* sc=4a */ '1', '1', '1', '1', '1', '1', '1', '1', 0x00, 0x00,
-/* sc=4b */ '2', '2', '2', '2', '2', '2', '2', '2', 0x00, 0x00,
-/* sc=4c */ '3', '3', '3', '3', '3', '3', '3', '3', 0x00, 0x00,
-/* sc=4d */ '=', '=', '=', '=', '=', '=', '=', '=', 0x00, 0x00,
-/* sc=4e */ '0', '0', '0', '0', '0', '0', '0', '0', 0x00, 0x00,
-/* sc=4f */ ',', ',', ',', ',', ',', ',', ',', ',', 0x00, 0x00,
-/* sc=50 */ '.', '.', '.', '.', '.', '.', '.', '.', 0x00, 0x00,
-/* sc=51 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=52 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=53 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=54 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=58 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=59 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=60 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=61 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=62 */ F( 1), F(13), F(25), F(37), S( 1), S( 1), S( 1), S( 1), 0xFF, 0x00,
-/* sc=63 */ F( 2), F(14), F(26), F(38), S( 2), S( 2), S( 2), S( 2), 0xFF, 0x00,
-/* sc=64 */ F( 3), F(15), F(27), F(39), S( 3), S( 3), S( 3), S( 3), 0xFF, 0x00,
-/* sc=65 */ F( 4), F(16), F(28), F(40), S( 4), S( 4), S( 4), S( 4), 0xFF, 0x00,
-/* sc=66 */ F( 5), F(17), F(29), F(41), S( 5), S( 5), S( 5), S( 5), 0xFF, 0x00,
-/* sc=67 */ F( 6), F(18), F(30), F(42), S( 6), S( 6), S( 6), S( 6), 0xFF, 0x00,
-/* sc=68 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=69 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=6a */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=6b */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=6c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=70 */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=71 */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=72 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=73 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=74 */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=75 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=76 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=77 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=78 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=79 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-};
-#endif
-
-#ifdef DKKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* DK iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '1', '!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0x9E, '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', 0xA4, NOP, NOP, '$', 0xA4, NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, '6', '&', NOP, NOP, 0x33, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', '/', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '(', 0x1B, 0x1B, '[', '(', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, ']', ')', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', '=', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '+', '?', NOP, NOP, '+', '?', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ '\'', '`', NOP, NOP, '|', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xE5, 0xC5, NOP, NOP, 0x86, 0x8F, NOP, NOP, 0x33, 0x01,
-/* sc=1b */ '"', '^', 0x1E, 0x1E, '~', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xE6, 0xC6, NOP, NOP, 0x91, 0x92, NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xF8, 0xD8, NOP, NOP, 0x9B, 0x9D, NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xBD, 0xA7, NOP, NOP, 0xBD, 0xA7, NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\'', '*', NOP, NOP, '\'', '*', NOP, NOP, 0x33, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', 0x1C, 0x1C, '\\', '>', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x00, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef UKKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* uk iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '`', '`', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xA3, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, '^', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, '[', '[', 0x1B, 0x1B, 0x30, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, '8', '*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, ']', ']', 0x1D, 0x1D, 0x30, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, '{', '{', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, '|', '|', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, '}', '}', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, ';', ':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '@', 0x00, 0x00, '\'', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=29 */ '\\', '|', 0x1C, 0x1C, '\\', '\\', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '#', '~', NOP, NOP, '~', '~', NOP, NOP, 0x33, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, ',', '<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, '.', '>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, '/', '?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef GRKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* german iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '`', '`', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xA7, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', 0x1E, 0x1E, '^', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '/', 0x1B, 0x1B, '[', '[', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '8', '(', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, ']', ']', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '{', '{', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ 0xDF, '?', NOP, NOP, '|', '|', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ 0x92, 0x93, NOP, NOP, '\'', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xFC, 0xDC, 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x01,
-/* sc=1b */ '+', '*', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF6, 0xD6, NOP, NOP, 0xF6, 0xD6, NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xE4, 0xC4, NOP, NOP, 0xE4, 0xC4, NOP, NOP, 0x33, 0x01,
-/* sc=29 */ '<', '>', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '#', '^', 0x1E, 0x1E, '`', '~', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=2c */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef SWKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* swedish iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0xA3, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, 0xA4, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '[', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0a */ '9', ')', NOP, NOP, ']', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0c */ '+', '?', NOP, NOP, '\\', NOP, 0x1C, NOP, 0x35, 0x00,
-/* sc=0d */ 0x180, '`', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xE5, 0xC5, NOP, NOP, '}', ']', NOP, NOP, 0x33, 0x01,
-/* sc=1b */ 0xA8, '^', NOP, NOP, '~', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF6, 0xD6, NOP, NOP, '|', '\\', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xE4, 0xC4, NOP, NOP, '{', '[', NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xA7, 0xBD, NOP, NOP, '\\', '|', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\'', '*', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, NOP, '<', NOP, NOP, 0x3B, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, NOP, '>', NOP, NOP, 0x3B, 0x00,
-/* sc=35 */ '-', '_', 0x1F, NOP, '/', '?', NOP, NOP, 0x13, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', NOP, NOP, '|', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef RUKEYMAP
-#define NO_ACCENTCHARS
-static keymap_t key_map = { 0xEC, /* keys number */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * -------------------------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, NOP, NOP, SET8|0x1B, SET8|0x1B, DBG, NOP, 0x33, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, SET8|'1', SET8|'!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '@', 0x00, 0x00, SET8|'2', SET8|'@', SET8|0x00, SET8|0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, SET8|'3', SET8|'#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, SET8|'4', SET8|'$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, SET8|'5', SET8|'%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, SET8|'6', SET8|'^', SET8|0x1E, SET8|0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, SET8|'7', SET8|'&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, SET8|'8', SET8|'*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, SET8|'9', SET8|'(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, SET8|'0', SET8|')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, SET8|'-', SET8|'_', SET8|0x1F, SET8|0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, SET8|'=', SET8|'+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, SET8|0x08, SET8|0x08, SET8|0x7F, SET8|0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, SET8|0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, SET8|'q', SET8|'Q', SET8|0x11, SET8|0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, SET8|'w', SET8|'W', SET8|0x17, SET8|0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, SET8|'e', SET8|'E', SET8|0x05, SET8|0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, SET8|'r', SET8|'R', SET8|0x12, SET8|0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, SET8|'t', SET8|'T', SET8|0x14, SET8|0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, SET8|'y', SET8|'Y', SET8|0x19, SET8|0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, SET8|'u', SET8|'U', SET8|0x15, SET8|0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, SET8|'i', SET8|'I', SET8|0x09, SET8|0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, SET8|'o', SET8|'O', SET8|0x0F, SET8|0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, SET8|'p', SET8|'P', SET8|0x10, SET8|0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, SET8|'[', SET8|'{', SET8|0x1B, SET8|0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, SET8|']', SET8|'}', SET8|0x1D, SET8|0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, SET8|'a', SET8|'A', SET8|0x01, SET8|0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, SET8|'s', SET8|'S', SET8|0x13, SET8|0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, SET8|'d', SET8|'D', SET8|0x04, SET8|0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, SET8|'f', SET8|'F', SET8|0x06, SET8|0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, SET8|'g', SET8|'G', SET8|0x07, SET8|0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, SET8|'h', SET8|'H', SET8|0x08, SET8|0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, SET8|'j', SET8|'J', SET8|0x0A, SET8|0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, SET8|'k', SET8|'K', SET8|0x0B, SET8|0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, SET8|'l', SET8|'L', SET8|0x0C, SET8|0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, SET8|';', SET8|':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '"', NOP, NOP, SET8|'\'', SET8|'"', NOP, NOP, 0x33, 0x00,
-/* sc=29 */ '`', '~', NOP, NOP, SET8|'`', SET8|'~', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, SET8|'\\', SET8|'|', SET8|0x1C, SET8|0x1C, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, SET8|'z', SET8|'Z', SET8|0x1A, SET8|0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, SET8|'x', SET8|'X', SET8|0x18, SET8|0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, SET8|'c', SET8|'C', SET8|0x03, SET8|0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, SET8|'v', SET8|'V', SET8|0x16, SET8|0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, SET8|'b', SET8|'B', SET8|0x02, SET8|0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, SET8|'n', SET8|'N', SET8|0x0E, SET8|0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, SET8|'m', SET8|'M', SET8|0x0D, SET8|0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, SET8|',', SET8|'<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, SET8|'.', SET8|'>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, SET8|'/', SET8|'?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, SET8|'*', SET8|'*', SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', SET8|' ', SET8|' ', SUSP, SET8|' ', 0x00, 0x00,
-/* sc=3a */ ALK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', SET8|'7', SET8|'7', SET8|'7', SET8|'7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', SET8|'8', SET8|'8', SET8|'8', SET8|'8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', SET8|'9', SET8|'9', SET8|'9', SET8|'9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', SET8|'-', SET8|'-', SET8|'-', SET8|'-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', SET8|'4', SET8|'4', SET8|'4', SET8|'4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', SET8|'5', SET8|'5', SET8|'5', SET8|'5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', SET8|'6', SET8|'6', SET8|'6', SET8|'6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', SET8|'+', SET8|'+', SET8|'+', SET8|'+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', SET8|'1', SET8|'1', SET8|'1', SET8|'1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', SET8|'2', SET8|'2', SET8|'2', SET8|'2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', SET8|'3', SET8|'3', SET8|'3', SET8|'3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', SET8|'0', SET8|'0', SET8|'0', SET8|'0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', SET8|'.', SET8|'.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ ALK, ALK, ALK, ALK, ALK, ALK, ALK, ALK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', NOP, NOP, SET8|'/', SET8|'/', NOP, NOP, 0x33, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-/* sc=6c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=70 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=71 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=72 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=73 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=74 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=75 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=76 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=77 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=78 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=79 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* extended (ALTGR LOCK keys) */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, NOP, NOP, SET8|0x1B, SET8|0x1B, DBG, NOP, 0x33, 0x00,
-/* sc=02 */ '!', '1', NOP, NOP, SET8|'1', SET8|'!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '"', '2', 0x00, 0x00, SET8|'2', SET8|'@', SET8|0x00, SET8|0x00, 0x00, 0x00,
-/* sc=04 */ '\'', '3', NOP, NOP, SET8|'3', SET8|'#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '*', '4', NOP, NOP, SET8|'4', SET8|'$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ ':', '5', NOP, NOP, SET8|'5', SET8|'%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ ',', '6', 0x1E, 0x1E, SET8|'6', SET8|'^', SET8|0x1E, SET8|0x1E, 0x00, 0x00,
-/* sc=08 */ '.', '7', NOP, NOP, SET8|'7', SET8|'&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ ';', '8', NOP, NOP, SET8|'8', SET8|'*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '(', '9', NOP, NOP, SET8|'9', SET8|'(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ ')', '0', NOP, NOP, SET8|'0', SET8|')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, SET8|'-', SET8|'_', SET8|0x1F, SET8|0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, SET8|'=', SET8|'+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, SET8|0x08, SET8|0x08, SET8|0x7F, SET8|0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, SET8|0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 0xca, 0xea, 0x11, 0x11, SET8|'q', SET8|'Q', SET8|0x11, SET8|0x11, 0x00, 0x01,
-/* sc=11 */ 0xc3, 0xe3, 0x17, 0x17, SET8|'w', SET8|'W', SET8|0x17, SET8|0x17, 0x00, 0x01,
-/* sc=12 */ 0xd5, 0xf5, 0x05, 0x05, SET8|'e', SET8|'E', SET8|0x05, SET8|0x05, 0x00, 0x01,
-/* sc=13 */ 0xcb, 0xeb, 0x12, 0x12, SET8|'r', SET8|'R', SET8|0x12, SET8|0x12, 0x00, 0x01,
-/* sc=14 */ 0xc5, 0xe5, 0x14, 0x14, SET8|'t', SET8|'T', SET8|0x14, SET8|0x14, 0x00, 0x01,
-/* sc=15 */ 0xce, 0xee, 0x19, 0x19, SET8|'y', SET8|'Y', SET8|0x19, SET8|0x19, 0x00, 0x01,
-/* sc=16 */ 0xc7, 0xe7, 0x15, 0x15, SET8|'u', SET8|'U', SET8|0x15, SET8|0x15, 0x00, 0x01,
-/* sc=17 */ 0xdb, 0xfb, 0x09, 0x09, SET8|'i', SET8|'I', SET8|0x09, SET8|0x09, 0x00, 0x01,
-/* sc=18 */ 0xdd, 0xfd, 0x0F, 0x0F, SET8|'o', SET8|'O', SET8|0x0F, SET8|0x0F, 0x00, 0x01,
-/* sc=19 */ 0xda, 0xfa, 0x10, 0x10, SET8|'p', SET8|'P', SET8|0x10, SET8|0x10, 0x00, 0x01,
-/* sc=1a */ 0xc8, 0xe8, 0x1B, 0x1B, SET8|'[', SET8|'{', SET8|0x1B, SET8|0x1B, 0x00, 0x01,
-/* sc=1b */ 0xdf, 0xff, 0x1D, 0x1D, SET8|']', SET8|'}', SET8|0x1D, SET8|0x1D, 0x00, 0x01,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 0xc6, 0xe6, 0x01, 0x01, SET8|'a', SET8|'A', SET8|0x01, SET8|0x01, 0x00, 0x01,
-/* sc=1f */ 0xd9, 0xf9, 0x13, 0x13, SET8|'s', SET8|'S', SET8|0x13, SET8|0x13, 0x00, 0x01,
-/* sc=20 */ 0xd7, 0xf7, 0x04, 0x04, SET8|'d', SET8|'D', SET8|0x04, SET8|0x04, 0x00, 0x01,
-/* sc=21 */ 0xc1, 0xe1, 0x06, 0x06, SET8|'f', SET8|'F', SET8|0x06, SET8|0x06, 0x00, 0x01,
-/* sc=22 */ 0xd0, 0xf0, 0x07, 0x07, SET8|'g', SET8|'G', SET8|0x07, SET8|0x07, 0x00, 0x01,
-/* sc=23 */ 0xd2, 0xf2, 0x08, 0x08, SET8|'h', SET8|'H', SET8|0x08, SET8|0x08, 0x00, 0x01,
-/* sc=24 */ 0xcf, 0xef, 0x0A, 0x0A, SET8|'j', SET8|'J', SET8|0x0A, SET8|0x0A, 0x00, 0x01,
-/* sc=25 */ 0xcc, 0xec, 0x0B, 0x0B, SET8|'k', SET8|'K', SET8|0x0B, SET8|0x0B, 0x00, 0x01,
-/* sc=26 */ 0xc4, 0xe4, 0x0C, 0x0C, SET8|'l', SET8|'L', SET8|0x0C, SET8|0x0C, 0x00, 0x01,
-/* sc=27 */ 0xd6, 0xf6, NOP, NOP, SET8|';', SET8|':', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xdc, 0xfc, NOP, NOP, SET8|'\'', SET8|'"', NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xa3, 0xb3, NOP, NOP, SET8|'`', SET8|'~', NOP, NOP, 0x33, 0x01,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, SET8|'\\', SET8|'|', SET8|0x1C, SET8|0x1C, 0x00, 0x00,
-/* sc=2c */ 0xd1, 0xf1, 0x1A, 0x1A, SET8|'z', SET8|'Z', SET8|0x1A, SET8|0x1A, 0x00, 0x01,
-/* sc=2d */ 0xde, 0xfe, 0x18, 0x18, SET8|'x', SET8|'X', SET8|0x18, SET8|0x18, 0x00, 0x01,
-/* sc=2e */ 0xd3, 0xf3, 0x03, 0x03, SET8|'c', SET8|'C', SET8|0x03, SET8|0x03, 0x00, 0x01,
-/* sc=2f */ 0xcd, 0xed, 0x16, 0x16, SET8|'v', SET8|'V', SET8|0x16, SET8|0x16, 0x00, 0x01,
-/* sc=30 */ 0xc9, 0xe9, 0x02, 0x02, SET8|'b', SET8|'B', SET8|0x02, SET8|0x02, 0x00, 0x01,
-/* sc=31 */ 0xd4, 0xf4, 0x0E, 0x0E, SET8|'n', SET8|'N', SET8|0x0E, SET8|0x0E, 0x00, 0x01,
-/* sc=32 */ 0xd8, 0xf8, 0x0D, 0x0D, SET8|'m', SET8|'M', SET8|0x0D, SET8|0x0D, 0x00, 0x01,
-/* sc=33 */ 0xc2, 0xe2, NOP, NOP, SET8|',', SET8|'<', NOP, NOP, 0x33, 0x01,
-/* sc=34 */ 0xc0, 0xe0, NOP, NOP, SET8|'.', SET8|'>', NOP, NOP, 0x33, 0x01,
-/* sc=35 */ '/', '?', NOP, NOP, SET8|'/', SET8|'?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, SET8|'*', SET8|'*', SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', SET8|' ', SET8|' ', SUSP, SET8|' ', 0x00, 0x00,
-/* sc=3a */ ALK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', SET8|'7', SET8|'7', SET8|'7', SET8|'7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', SET8|'8', SET8|'8', SET8|'8', SET8|'8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', SET8|'9', SET8|'9', SET8|'9', SET8|'9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', SET8|'-', SET8|'-', SET8|'-', SET8|'-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', SET8|'4', SET8|'4', SET8|'4', SET8|'4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', SET8|'5', SET8|'5', SET8|'5', SET8|'5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', SET8|'6', SET8|'6', SET8|'6', SET8|'6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', SET8|'+', SET8|'+', SET8|'+', SET8|'+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', SET8|'1', SET8|'1', SET8|'1', SET8|'1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', SET8|'2', SET8|'2', SET8|'2', SET8|'2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', SET8|'3', SET8|'3', SET8|'3', SET8|'3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', SET8|'0', SET8|'0', SET8|'0', SET8|'0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', SET8|'.', SET8|'.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ ALK, ALK, ALK, ALK, ALK, ALK, ALK, ALK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', NOP, NOP, SET8|'/', SET8|'/', NOP, NOP, 0x33, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-
-#endif
-
-#ifdef ESKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x69, /* spanish iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x00, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '|', '|', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xB7, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '4', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '5', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', 0x1E, 0x1E, 0xAC, 0xAC, 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '/', 0x1B, 0x1B, '7', '7', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '8', '8', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, '8', '8', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '9', '9', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '\'', '?', NOP, NOP, '\'', '\'', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ 0xA1, 0xBF, NOP, NOP, '\'', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 0xE9, 0xC9, 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 0xFA, 0xDA, 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 0xED, 0xCD, 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 0xF3, 0xD3, 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ DGRA, DCIR, 0x1B, 0x1B, '[', '[', 0x1B, 0x1B, 0xC0, 0x01,
-/* sc=1b */ '+', '*', 0x1D, 0x1D, ']', '[', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 0xE1, 0xC1, 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF1, 0xD1, NOP, NOP, '~', NOP, NOP, NOP, 0x37, 0x01,
-/* sc=28 */ DACU, DUML, NOP, NOP, '{', '}', NOP, NOP, 0xF3, 0x01,
-/* sc=29 */ 0xBA, 0xAA, 0x1C, 0x1C, '\\', '\\', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ 0xE7, 0xC7, 0x1E, 0x1E, '}', '}', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x19, 0x19, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', NEXT, NEXT, '*', '*', NEXT, NEXT, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x00, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', 0x1C, 0x1C, '\\', '>', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x02,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(54), F(54), F(54), F(54), F(54), F(54), RBT, F(54), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-};
-#endif
-
-#ifdef ISKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* icelandic iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, NOP, NOP, 0x00, 0x00, 0x0C, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0xA3, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, 0xA4, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '[', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0a */ '9', ')', NOP, NOP, ']', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0c */ 0xF6, 0xD6, NOP, NOP, '\\', NOP, 0x1C, NOP, 0x35, 0x00,
-/* sc=0d */ '-', '_', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, '@', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xF0, 0xD0, NOP, NOP, '}', ']', NOP, NOP, 0x33, 0x01,
-/* sc=1b */ '\'', '?', NOP, NOP, '~', NOP, NOP, NOP, 0x00, 0x01,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 0xDF, 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xE6, 0xC6, NOP, NOP, '|', '\\', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ DACU, DACU, NOP, NOP, DTIL, '[', NOP, NOP, 0xFB, 0x01,
-/* sc=29 */ DRIN, DDIA, NOP, NOP, DCIR, '*', NOP, NOP, 0xFB, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '+', '*', NOP, NOP, '`', '*', NOP, NOP, 0x00, 0x01,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, NOP, '<', NOP, NOP, 0x3B, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, NOP, '>', NOP, NOP, 0x3B, 0x00,
-/* sc=35 */ 0xFE, 0xDE, 0x1F, NOP, '/', '?', NOP, NOP, 0x13, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', NOP, NOP, '|', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#if !defined(DKKEYMAP) && !defined(UKKEYMAP) && !defined(GRKEYMAP) && !defined(SWKEYMAP) && !defined(RUKEYMAP) && !defined(ISKEYMAP) && !defined(ESKEYMAP) && !defined(PC98)
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* US iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '1', '!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '@', 0x00, 0x00, '2', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, '3', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, '7', '&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, '8', '*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, '9', '(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, '0', ')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, '=', '+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, ';', ':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '"', NOP, NOP, '\'', '"', NOP, NOP, 0x33, 0x00,
-/* sc=29 */ '`', '~', NOP, NOP, '`', '~', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, ',', '<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, '.', '>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, '/', '?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#if defined(NO_ACCENTCHARS)
-static accentmap_t accent_map = { 0, /* empty accent map */
- {
- { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
- { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
- }
-};
-#endif
-
-#if defined(ISO_ACCENTCHARS)
-static accentmap_t accent_map = { 15, /* iso8859 accent map */
- {
- /* dgra=0 */
- { '`', { { 'a',0xe0 }, { 'A',0xc0 }, { 'e',0xe8 }, { 'E',0xc8 },
- { 'i',0xec }, { 'I',0xcc }, { 'o',0xf2 }, { 'O',0xd2 },
- { 'u',0xf9 }, { 'U',0xd9 }, }, },
- /* dacu=1 */
- { 0xb4, { { 'a',0xe1 }, { 'A',0xc1 }, { 'e',0xe9 }, { 'E',0xc9 },
- { 'i',0xed }, { 'I',0xcd }, { 'o',0xf3 }, { 'O',0xd3 },
- { 'u',0xfa }, { 'U',0xda }, { 'y',0xfd }, { 'Y',0xdd }, }, },
- /* dcir=2 */
- { '^', { { 'a',0xe2 }, { 'A',0xc2 }, { 'e',0xea }, { 'E',0xca },
- { 'i',0xee }, { 'I',0xce }, { 'o',0xf4 }, { 'O',0xd4 },
- { 'u',0xfb }, { 'U',0xdb }, }, },
- /* dtil=3 */
- { '~', { { 'a',0xe3 }, { 'A',0xc3 }, { 'n',0xf1 }, { 'N',0xd1 },
- { 'o',0xf5 }, { 'O',0xd5 }, }, },
- /* dmac=4 */
- { 0 },
- /* dbre=5 */
- { 0 },
- /* ddot=6 */
- { 0 },
- /* duml=7 */
- { 0xa8, { { 'a',0xe4 }, { 'A',0xc4 }, { 'e',0xeb }, { 'E',0xcb },
- { 'i',0xef }, { 'I',0xcf }, { 'o',0xf6 }, { 'O',0xd6 },
- { 'u',0xfc }, { 'U',0xdc }, { 'y',0xff }, }, },
- /* dsla=8 */
- { 0 },
- /* drin=9 */
- { 0xb0, { { 'a',0xe5 }, { 'A',0xc5 }, }, },
- /* dced=10 */
- { 0xb8, { { 'c',0xe7 }, { 'C',0xc7 }, }, },
- /* dapo=11 */
- { 0 },
- /* ddac=12 */
- { 0 },
- /* dogo=13 */
- { 0 },
- /* dcar=14 */
- { 0 },
- }
-};
-#endif /* ISO_ACCENTCHARS */
-
-static fkeytab_t fkey_tab[96] = {
-/* 01-04 */ {"\033[M", 3}, {"\033[N", 3}, {"\033[O", 3}, {"\033[P", 3},
-/* 05-08 */ {"\033[Q", 3}, {"\033[R", 3}, {"\033[S", 3}, {"\033[T", 3},
-/* 09-12 */ {"\033[U", 3}, {"\033[V", 3}, {"\033[W", 3}, {"\033[X", 3},
-/* 13-16 */ {"\033[Y", 3}, {"\033[Z", 3}, {"\033[a", 3}, {"\033[b", 3},
-/* 17-20 */ {"\033[c", 3}, {"\033[d", 3}, {"\033[e", 3}, {"\033[f", 3},
-/* 21-24 */ {"\033[g", 3}, {"\033[h", 3}, {"\033[i", 3}, {"\033[j", 3},
-/* 25-28 */ {"\033[k", 3}, {"\033[l", 3}, {"\033[m", 3}, {"\033[n", 3},
-/* 29-32 */ {"\033[o", 3}, {"\033[p", 3}, {"\033[q", 3}, {"\033[r", 3},
-/* 33-36 */ {"\033[s", 3}, {"\033[t", 3}, {"\033[u", 3}, {"\033[v", 3},
-/* 37-40 */ {"\033[w", 3}, {"\033[x", 3}, {"\033[y", 3}, {"\033[z", 3},
-/* 41-44 */ {"\033[@", 3}, {"\033[[", 3}, {"\033[\\",3}, {"\033[]", 3},
-/* 45-48 */ {"\033[^", 3}, {"\033[_", 3}, {"\033[`", 3}, {"\033[{", 3},
-/* 49-52 */ {"\033[H", 3}, {"\033[A", 3}, {"\033[I", 3}, {"-" , 1},
-/* 53-56 */ {"\033[D", 3}, {"\033[E", 3}, {"\033[C", 3}, {"+" , 1},
-/* 57-60 */ {"\033[F", 3}, {"\033[B", 3}, {"\033[G", 3}, {"\033[L", 3},
-/* 61-64 */ {"\177", 1}, {"\033[J", 3}, {"\033[~", 3}, {"\033[}", 3},
-/* 65-68 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 69-72 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 73-76 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 77-80 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 81-84 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 85-88 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 89-92 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 93-96 */ {"", 0} , {"", 0} , {"", 0} , {"", 0}
-};
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
deleted file mode 100644
index ece467c1a5aa..000000000000
--- a/sys/dev/pci/ohci_pci.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * USB Open Host Controller driver.
- *
- * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-
-#define PCI_CLASS_SERIALBUS 0x0c000000
-#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_FIREWIRE 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_ACCESS 0x00010000
-#define PCI_SUBCLASS_SERIALBUS_SSA 0x00020000
-#define PCI_SUBCLASS_SERIALBUS_USB 0x00030000
-#define PCI_SUBCLASS_SERIALBUS_FIBER 0x00040000
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/ohcireg.h>
-#include <dev/usb/ohcivar.h>
-
-#define PCI_INTERFACE(d) (((d) >> 8) & 0xff)
-#define PCI_SUBCLASS(d) ((d) & PCI_SUBCLASS_MASK)
-#define PCI_CLASS(d) ((d) & PCI_CLASS_MASK)
-
-#define PCI_VENDOR(d) ((d) & 0xffff)
-#define PCI_DEVICE(d) (((d) >> 8) & 0xffff)
-
-#define PCI_OHCI_VENDORID_ALI 0x10b9
-#define PCI_OHCI_VENDORID_SIS 0x1039
-
-#define PCI_OHCI_DEVICEID_ALADDIN_V 0x523710b9
-static const char ohci_device_aladdin_v[] = "AcerLabs M5237 (Aladdin-V) USB Host Controller";
-static const char ohci_device_generic[] = "OHCI USB Host Controller (generic)";
-
-#define PCI_OHCI_BASE_REG 0x10
-
-static const char *ohci_pci_probe __P((pcici_t, pcidi_t));
-static void ohci_pci_attach __P((pcici_t, int));
-
-u_long ohci_count = 0; /* global counter for nr. of devices found */
-
-static struct pci_device ohci_pci_device = {
- "ohci",
- ohci_pci_probe,
- ohci_pci_attach,
- &ohci_count,
- NULL
-};
-
-DATA_SET(pcidevice_set, ohci_pci_device);
-
-static const char *
-ohci_pci_probe(pcici_t config_id, pcidi_t device_id)
-{
- u_int32_t class;
-
- if (device_id == PCI_OHCI_DEVICEID_ALADDIN_V) {
- return (ohci_device_aladdin_v);
- } else {
- class = pci_conf_read(config_id, PCI_CLASS_REG);
- if ( (PCI_CLASS(class) == PCI_CLASS_SERIALBUS)
- && (PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB)
- && (PCI_INTERFACE(class) == PCI_INTERFACE_OHCI)) {
- return(ohci_device_generic);
- }
- }
-
- return NULL; /* dunno */
-}
-
-static void
-ohci_pci_attach(pcici_t config_id, int unit)
-{
- int id;
- usbd_status r;
- ohci_softc_t *sc = NULL;
- vm_offset_t pbase;
-
- sc = malloc(sizeof(ohci_softc_t), M_DEVBUF, M_NOWAIT);
- /* Do not free it below, intr might use the sc */
- if ( sc == NULL ) {
- printf("usb%d: could not allocate memory", unit);
- return;
- }
- memset(sc, 0, sizeof(ohci_softc_t));
-
- if(!pci_map_mem(config_id, PCI_CBMEM,
- (vm_offset_t *)&sc->sc_iobase, &pbase)) {
- printf("usb%d: could not map memory\n", unit);
- return;
- }
- sc->unit = unit;
-
- if ( !pci_map_int(config_id, (pci_inthand_t *)ohci_intr,
- (void *) sc, &bio_imask)) {
- printf("usb%d: could not map irq\n", unit);
- return;
- }
-
- /* Figure out vendor for root hub descriptor. */
- id = pci_conf_read(config_id, PCI_ID_REG);
- if (PCI_VENDOR(id) == PCI_OHCI_VENDORID_ALI)
- sprintf(sc->sc_vendor, "AcerLabs");
- else if (PCI_VENDOR(id) == PCI_OHCI_VENDORID_SIS)
- sprintf(sc->sc_vendor, "SiS");
- else
- sprintf(sc->sc_vendor, "(0x%04x)", PCI_VENDOR(id));
-
- /* We add a child to the root bus. After PCI configuration
- * has completed the root bus will start to probe and
- * attach all the devices attached to it, including our new
- * kid.
- *
- * FIXME Sometime in the future the UHCI controller itself will
- * become a kid of PCI device and this device add will no longer
- * be necessary.
- *
- * See README for an elaborate description of the bus
- * structure in spe.
- */
- sc->sc_bus.bdev = device_add_child(root_bus, "usb", unit, sc);
- if (!sc->sc_bus.bdev) {
- printf("%s%d: could not add USB device to root bus\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev));
- return;
- }
-
- r = ohci_init(sc);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("usb%d: init failed, error=%d\n", unit, r);
- device_delete_child(root_bus, sc->sc_bus.bdev);
- return;
- }
-
- switch(id) {
- case PCI_OHCI_DEVICEID_ALADDIN_V:
- device_set_desc(sc->sc_bus.bdev, ohci_device_aladdin_v);
- break;
- default:
- printf("(New OHCI DeviceId=0x%08x)\n", id);
- device_set_desc(sc->sc_bus.bdev, ohci_device_generic);
- }
-
- return;
-}
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c
deleted file mode 100644
index 083540f4b792..000000000000
--- a/sys/dev/pci/uhci_pci.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* FreeBSD $Id: uhci_pci.c,v 1.7 1999/01/06 19:55:49 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-
-#define PCI_CLASS_SERIALBUS 0x0c000000
-#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_FIREWIRE 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_ACCESS 0x00010000
-#define PCI_SUBCLASS_SERIALBUS_SSA 0x00020000
-#define PCI_SUBCLASS_SERIALBUS_USB 0x00030000
-#define PCI_SUBCLASS_SERIALBUS_FIBER 0x00040000
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/uhcireg.h>
-#include <dev/usb/uhcivar.h>
-
-#define PCI_INTERFACE(d) (((d)>>8)&0xff)
-#define PCI_SUBCLASS(d) ((d)&PCI_SUBCLASS_MASK)
-#define PCI_CLASS(d) ((d)&PCI_CLASS_MASK)
-
-#define PCI_VENDOR(d) ((d)&0xffff)
-#define PCI_DEVICE(d) (((d)>>8)&0xffff)
-
-#define PCI_UHCI_VENDORID_INTEL 0x8086
-#define PCI_UHCI_VENDORID_VIA 0x1106
-
-#define PCI_UHCI_DEVICEID_PIIX3 0x70208086ul
-static const char *uhci_device_piix3 = "Intel 82371SB USB Host Controller";
-#define PCI_UHCI_DEVICEID_PIIX4 0x71128086ul
-#define PCI_UHCI_DEVICEID_PIIX4E 0x71128086ul /* no separate step */
-static const char *uhci_device_piix4 = "Intel 82371AB/EB USB Host Controller";
-#define PCI_UHCI_DEVICEID_VT83C572 0x30381106ul
-static const char *uhci_device_vt83c572 = "VIA 83C572 USB Host Controller";
-static const char *uhci_device_generic = "UHCI USB Controller (generic)";
-
-#define PCI_UHCI_BASE_REG 0x20
-
-static const char *uhci_pci_probe __P((pcici_t, pcidi_t));
-static void uhci_pci_attach __P((pcici_t, int));
-
-u_long uhci_count = 0; /* global counter for nr. of devices found */
-
-static struct pci_device uhci_pci_device = {
- "uhci",
- uhci_pci_probe,
- uhci_pci_attach,
- &uhci_count,
- NULL
-};
-
-DATA_SET(pcidevice_set, uhci_pci_device);
-
-
-static const char *
-uhci_pci_probe(pcici_t config_id, pcidi_t device_id)
-{
- u_int32_t class;
-
- if (device_id == PCI_UHCI_DEVICEID_PIIX3) {
- return (uhci_device_piix3);
- } else if (device_id == PCI_UHCI_DEVICEID_PIIX4) {
- return (uhci_device_piix4);
- } else if (device_id == PCI_UHCI_DEVICEID_VT83C572) {
- return (uhci_device_vt83c572);
- } else {
- class = pci_conf_read(config_id, PCI_CLASS_REG);
- if ( PCI_CLASS(class) == PCI_CLASS_SERIALBUS
- && PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB
- && PCI_INTERFACE(class) == PCI_INTERFACE_UHCI) {
- return (uhci_device_generic);
- }
- }
-
- return NULL; /* dunno... */
-}
-
-static void
-uhci_pci_attach(pcici_t config_id, int unit)
-{
- int id;
- char *typestr;
- usbd_status r;
- uhci_softc_t *sc = NULL;
-
- sc = malloc(sizeof(uhci_softc_t), M_DEVBUF, M_NOWAIT);
- /* Do not free it below, intr might use the sc */
- if ( sc == NULL ) {
- printf("usb%d: could not allocate memory", unit);
- return;
- }
- memset(sc, 0, sizeof(uhci_softc_t));
-
- sc->sc_iobase = pci_conf_read(config_id,PCI_UHCI_BASE_REG) & 0xffe0;
- sc->unit = unit;
-
- if ( !pci_map_int(config_id, (pci_inthand_t *)uhci_intr,
- (void *) sc, &bio_imask)) {
- printf("usb%d: could not map irq\n", unit);
- return;
- }
-
-#ifndef USBVERBOSE
- if (bootverbose)
-#endif
- {
- switch(pci_conf_read(config_id, PCI_USBREV) & PCI_USBREV_MASK) {
- case PCI_USBREV_PRE_1_0:
- typestr = "pre 1.0";
- break;
- case PCI_USBREV_1_0:
- typestr = "1.0";
- break;
- default:
- typestr = "unknown";
- break;
- }
- printf("usb%d: USB version %s, interrupting at %d\n", unit,
- typestr,
- (int)pci_conf_read(config_id,PCI_INTERRUPT_REG) & 0xff);
- }
-
- /* Figure out vendor for root hub descriptor. */
- id = pci_conf_read(config_id, PCI_ID_REG);
- if (PCI_VENDOR(id) == PCI_UHCI_VENDORID_INTEL)
- sprintf(sc->sc_vendor, "Intel");
- else if (PCI_VENDOR(id) == PCI_UHCI_VENDORID_VIA)
- sprintf(sc->sc_vendor, "VIA");
- else
- sprintf(sc->sc_vendor, "(0x%04x)", PCI_VENDOR(id));
-
- /* We add a child to the root bus. After PCI configuration
- * has completed the root bus will start to probe and
- * attach all the devices attached to it, including our new
- * kid.
- *
- * FIXME Sometime in the future the UHCI controller itself will
- * become a kid of PCI device and this device add will no longer
- * be necessary.
- *
- * See README for an elaborate description of the bus
- * structure in spe.
- */
- sc->sc_bus.bdev = device_add_child(root_bus, "usb", unit, sc);
- if (!sc->sc_bus.bdev) {
- printf("%s%d: could not add USB device to root bus\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev));
- return;
- }
-
- r = uhci_init(sc);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s%d: init failed, error=%d\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev),
- r);
- device_delete_child(root_bus, sc->sc_bus.bdev);
- return;
- }
-
- switch (id) {
- case PCI_UHCI_DEVICEID_PIIX3:
- device_set_desc(sc->sc_bus.bdev, uhci_device_piix3);
- break;
- case PCI_UHCI_DEVICEID_PIIX4:
- device_set_desc(sc->sc_bus.bdev, uhci_device_piix4);
- break;
- case PCI_UHCI_DEVICEID_VT83C572:
- device_set_desc(sc->sc_bus.bdev, uhci_device_vt83c572);
- break;
- default:
- printf("(New UHCI DeviceId=0x%08x)\n", id);
- device_set_desc(sc->sc_bus.bdev, uhci_device_generic);
- }
-
- return;
-}
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 7d64cd24fef6..4bee255fd5a6 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
- * $Id: if_plip.c,v 1.6 1998/11/07 14:35:41 nsouch Exp $
+ * $Id: if_plip.c,v 1.3 1998/08/17 01:05:23 bde Exp $
*/
/*
@@ -129,9 +129,7 @@
#define LPIPTBLSIZE 256 /* Size of octet translation table */
-#ifndef DEBUG
#define DEBUG
-#endif
#ifndef DEBUG
#define lprintf (void)
@@ -336,16 +334,17 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
}
if (((ifp->if_flags & IFF_UP)) && (!(ifp->if_flags & IFF_RUNNING))) {
- /* XXX
+ /*
+ * Try to allocate the ppbus as soon as possible
+ * With ppbus allocation, interrupts are enabled
+ * Now IFF_UP means that we own the bus
+ *
+ * XXX
* Should the request be interruptible?
*/
if ((error = ppb_request_bus(&sc->lp_dev, PPB_WAIT|PPB_INTR)))
return (error);
- /* Now IFF_UP means that we own the bus */
-
- ppb_set_mode(&sc->lp_dev, PPB_COMPATIBLE);
-
if (lpinittables()) {
ppb_release_bus(&sc->lp_dev);
return ENOBUFS;
@@ -394,13 +393,6 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
}
break;
- case SIOCGIFMEDIA:
- /*
- * No ifmedia support at this stage; maybe use it
- * in future for eg. protocol selection.
- */
- return EINVAL;
-
default:
lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
@@ -427,7 +419,7 @@ clpoutbyte (u_char byte, int spin, struct ppb_device *dev)
static __inline int
clpinbyte (int spin, struct ppb_device *dev)
{
- u_char c, cl;
+ int c, cl;
while((ppb_rstr(dev) & CLPIP_SHAKE))
if(!--spin) {
diff --git a/sys/dev/ppbus/immio.c b/sys/dev/ppbus/immio.c
index 67054f79bea2..630707cb0ad0 100644
--- a/sys/dev/ppbus/immio.c
+++ b/sys/dev/ppbus/immio.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: immio.c,v 1.4 1998/10/31 11:35:21 nsouch Exp $
+ * $Id: immio.c,v 1.2 1998/09/20 14:41:54 nsouch Exp $
*
*/
@@ -47,8 +47,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_msq.h>
#include <dev/ppbus/vpoio.h>
@@ -288,13 +286,9 @@ imm_disconnect(struct vpoio_data *vpo, int *connected, int release_bus)
ppb_MS_microseq(&vpo->vpo_dev, cpp_microseq, &ret);
- if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x38)) {
- if (bootverbose)
- printf("imm%d: (disconnect) s1=0x%x s2=0x%x, s3=0x%x\n",
- vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff);
- if (connected)
- *connected = VP0_ECONNECT;
- }
+ if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x38) &&
+ connected)
+ *connected = VP0_ECONNECT;
if (release_bus)
return (ppb_release_bus(&vpo->vpo_dev));
@@ -340,13 +334,9 @@ imm_connect(struct vpoio_data *vpo, int how, int *disconnected, int request_bus)
ppb_MS_microseq(&vpo->vpo_dev, cpp_microseq, &ret);
- if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x30)) {
- if (bootverbose)
- printf("imm%d: (connect) s1=0x%x s2=0x%x, s3=0x%x\n",
- vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff);
- if (disconnected)
- *disconnected = VP0_ECONNECT;
- }
+ if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x30)
+ && disconnected)
+ *disconnected = VP0_ECONNECT;
return (0);
}
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
deleted file mode 100644
index cd8ff244a0c6..000000000000
--- a/sys/dev/ppbus/lpbb.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
- * 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.
- *
- * $Id: lpbb.c,v 1.3 1998/12/07 21:58:16 archie Exp $
- *
- */
-
-/*
- * I2C Bit-Banging over parallel port
- *
- * See the Official Philips interface description in lpbb(4)
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <dev/ppbus/ppbconf.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include "iicbb_if.h"
-
-/* iicbus softc */
-struct lpbb_softc {
-
- struct ppb_device lpbb_dev;
-};
-
-static int lpbb_detect(struct lpbb_softc *);
-
-static int lpbb_probe(device_t);
-static int lpbb_attach(device_t);
-static void lpbb_print_child(device_t, device_t);
-
-static int lpbb_callback(device_t, int, caddr_t *);
-static void lpbb_setlines(device_t, int, int);
-static int lpbb_getdataline(device_t);
-static int lpbb_reset(device_t, u_char, u_char, u_char *);
-
-static devclass_t lpbb_devclass;
-
-static device_method_t lpbb_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, lpbb_probe),
- DEVMETHOD(device_attach, lpbb_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, lpbb_print_child),
-
- /* iicbb interface */
- DEVMETHOD(iicbb_callback, lpbb_callback),
- DEVMETHOD(iicbb_setlines, lpbb_setlines),
- DEVMETHOD(iicbb_getdataline, lpbb_getdataline),
- DEVMETHOD(iicbb_reset, lpbb_reset),
-
- { 0, 0 }
-};
-
-static driver_t lpbb_driver = {
- "lpbb",
- lpbb_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct lpbb_softc),
-};
-
-/*
- * Make ourselves visible as a ppbus driver
- */
-static struct ppb_device *lpbb_ppb_probe(struct ppb_data *ppb);
-static int lpbb_ppb_attach(struct ppb_device *dev);
-
-#define MAXLPBB 8 /* XXX not much better! */
-static struct lpbb_softc *lpbbdata[MAXLPBB];
-static int nlpbb = 0;
-
-#ifdef KERNEL
-
-static struct ppb_driver lpbbdriver = {
- lpbb_ppb_probe, lpbb_ppb_attach, "lpbb"
-};
-DATA_SET(ppbdriver_set, lpbbdriver);
-
-#endif /* KERNEL */
-
-static int
-lpbb_probe(device_t dev)
-{
- struct lpbb_softc *sc = lpbbdata[device_get_unit(dev)];
- struct lpbb_softc *scdst = (struct lpbb_softc *)device_get_softc(dev);
-
- /* XXX copy softc. Yet, ppbus device is sc->lpbb_dev, but will be
- * dev->parent when ppbus will be ported to the new bus architecture */
- bcopy(sc, scdst, sizeof(struct lpbb_softc));
-
- device_set_desc(dev, "parallel I2C bit-banging interface");
-
- /* probe done by ppbus initialization */
- return (0);
-}
-
-static int
-lpbb_attach(device_t dev)
-{
- device_t bitbang, iicbus;
-
- /* add generic bit-banging code */
- bitbang = device_add_child(dev, "iicbb", -1, NULL);
-
- /* add the iicbus to the tree */
- iicbus = iicbus_alloc_bus(bitbang);
-
- device_probe_and_attach(bitbang);
-
- /* XXX should be in iicbb_attach! */
- device_probe_and_attach(iicbus);
-
- return (0);
-}
-
-/*
- * lppbb_ppb_probe()
- */
-static struct ppb_device *
-lpbb_ppb_probe(struct ppb_data *ppb)
-{
- struct lpbb_softc *sc;
-
- sc = (struct lpbb_softc *) malloc(sizeof(struct lpbb_softc),
- M_TEMP, M_NOWAIT);
- if (!sc) {
- printf("lpbb: cannot malloc!\n");
- return (0);
- }
- bzero(sc, sizeof(struct lpbb_softc));
-
- lpbbdata[nlpbb] = sc;
-
- /*
- * ppbus dependent initialisation.
- */
- sc->lpbb_dev.id_unit = nlpbb;
- sc->lpbb_dev.name = lpbbdriver.name;
- sc->lpbb_dev.ppb = ppb;
- sc->lpbb_dev.intr = 0;
-
- if (!lpbb_detect(sc)) {
- free(sc, M_TEMP);
- return (NULL);
- }
-
- /* Ok, go to next device on next probe */
- nlpbb ++;
-
- /* XXX wrong according to new bus architecture. ppbus needs to be
- * ported
- */
- return (&sc->lpbb_dev);
-}
-
-static int
-lpbb_ppb_attach(struct ppb_device *dev)
-{
- /* add the parallel port I2C interface to the bus tree */
- if (!device_add_child(root_bus, "lpbb", dev->id_unit, NULL))
- return (0);
-
- return (1);
-}
-
-static int
-lpbb_callback(device_t dev, int index, caddr_t *data)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- switch (index) {
- case IIC_REQUEST_BUS:
- /* request the ppbus */
- how = *(int *)data;
- error = ppb_request_bus(&sc->lpbb_dev, how);
- break;
-
- case IIC_RELEASE_BUS:
- /* release the ppbus */
- error = ppb_release_bus(&sc->lpbb_dev);
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-#define SDA_out 0x80
-#define SCL_out 0x08
-#define SDA_in 0x80
-#define SCL_in 0x08
-#define ALIM 0x20
-#define I2CKEY 0x50
-
-static int getSDA(struct lpbb_softc *sc)
-{
-if((ppb_rstr(&sc->lpbb_dev)&SDA_in)==SDA_in)
- return 1;
-else
- return 0;
-}
-
-static void setSDA(struct lpbb_softc *sc, char val)
-{
-if(val==0)
- ppb_wdtr(&sc->lpbb_dev, (u_char)SDA_out);
-else
- ppb_wdtr(&sc->lpbb_dev, (u_char)~SDA_out);
-}
-
-static void setSCL(struct lpbb_softc *sc, unsigned char val)
-{
-if(val==0)
- ppb_wctr(&sc->lpbb_dev, (u_char)(ppb_rctr(&sc->lpbb_dev)&~SCL_out));
-else
- ppb_wctr(&sc->lpbb_dev, (u_char)(ppb_rctr(&sc->lpbb_dev)|SCL_out));
-}
-
-static int lpbb_detect(struct lpbb_softc *sc)
-{
- if (ppb_request_bus(&sc->lpbb_dev, PPB_DONTWAIT)) {
- printf("lpbb: can't allocate ppbus\n");
- return (0);
- }
-
- /* reset bus */
- setSDA(sc, 1);
- setSCL(sc, 1);
-
- if ((ppb_rstr(&sc->lpbb_dev) & I2CKEY) ||
- ((ppb_rstr(&sc->lpbb_dev) & ALIM) != ALIM)) {
-
- ppb_release_bus(&sc->lpbb_dev);
- return (0);
- }
-
- ppb_release_bus(&sc->lpbb_dev);
-
- return (1);
-}
-
-static int
-lpbb_reset(device_t dev, u_char speed, u_char addr, u_char * oldaddr)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- /* reset bus */
- setSDA(sc, 1);
- setSCL(sc, 1);
-
- return (IIC_ENOADDR);
-}
-
-static void
-lpbb_setlines(device_t dev, int ctrl, int data)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- setSCL(sc, ctrl);
- setSDA(sc, data);
-}
-
-static int
-lpbb_getdataline(device_t dev)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- return (getSDA(sc));
-}
-
-static void
-lpbb_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
-DRIVER_MODULE(lpbb, root, lpbb_driver, lpbb_devclass, 0, 0);
diff --git a/sys/dev/ppbus/nlpt.c b/sys/dev/ppbus/nlpt.c
index 89d6c7f5a5a3..2a48eb4a2b76 100644
--- a/sys/dev/ppbus/nlpt.c
+++ b/sys/dev/ppbus/nlpt.c
@@ -47,7 +47,7 @@
*
* from: unknown origin, 386BSD 0.1
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
- * $Id: nlpt.c,v 1.11 1998/12/04 22:00:33 archie Exp $
+ * $Id: nlpt.c,v 1.9 1998/08/03 19:14:31 msmith Exp $
*/
/*
@@ -81,19 +81,12 @@
#endif /*KERNEL*/
#include <dev/ppbus/ppbconf.h>
-#include <dev/ppbus/ppb_1284.h>
#include <dev/ppbus/nlpt.h>
-#include "opt_nlpt.h"
-
#ifndef NLPT_DEBUG
-#define nlprintf(args)
+#define nlprintf (void)
#else
-#define nlprintf(args) \
- do { \
- if (nlptflag) \
- printf args; \
- } while (0)
+#define nlprintf if (nlptflag) printf
static int volatile nlptflag = 1;
#endif
@@ -102,7 +95,6 @@ static int volatile nlptflag = 1;
#define LPTOUTMAX 1 /* maximal timeout 1 s */
#define LPPRI (PZERO+8)
#define BUFSIZE 1024
-#define BUFSTATSIZE 32
#define LPTUNIT(s) ((s)&0x03)
#define LPTFLAGS(s) ((s)&0xfc)
@@ -167,12 +159,11 @@ DATA_SET(ppbdriver_set, nlptdriver);
static d_open_t nlptopen;
static d_close_t nlptclose;
static d_write_t nlptwrite;
-static d_read_t nlptread;
static d_ioctl_t nlptioctl;
#define CDEV_MAJOR 16
static struct cdevsw nlpt_cdevsw =
- { nlptopen, nlptclose, nlptread, nlptwrite, /*16*/
+ { nlptopen, nlptclose, noread, nlptwrite, /*16*/
nlptioctl, nullstop, nullreset, nodevtotty, /* lpt */
seltrue, nommap, nostrat, LPT_NAME, NULL, -1 };
@@ -181,9 +172,6 @@ lpt_request_ppbus(struct lpt_data *sc, int how)
{
int error;
- if (sc->sc_state & HAVEBUS)
- return (0);
-
/* we have the bus only if the request succeded */
if ((error = ppb_request_bus(&sc->lpt_dev, how)) == 0)
sc->sc_state |= HAVEBUS;
@@ -194,10 +182,13 @@ lpt_request_ppbus(struct lpt_data *sc, int how)
static int
lpt_release_ppbus(struct lpt_data *sc)
{
- ppb_release_bus(&sc->lpt_dev);
- sc->sc_state &= ~HAVEBUS;
+ int error;
+
+ /* we do not have the bus only if the request succeeded */
+ if ((error = ppb_release_bus(&sc->lpt_dev)) == 0)
+ sc->sc_state &= ~HAVEBUS;
- return (0);
+ return (error);
}
/*
@@ -216,7 +207,7 @@ nlpt_port_test(struct lpt_data *sc, u_char data, u_char mask)
temp = ppb_rdtr(&sc->lpt_dev) & mask;
}
while (temp != data && --timeout);
- nlprintf(("out=%x\tin=%x\ttout=%d\n", data, temp, timeout));
+ nlprintf("out=%x\tin=%x\ttout=%d\n", data, temp, timeout);
return (temp == data);
}
@@ -377,15 +368,15 @@ nlptattach(struct ppb_device *dev)
ppb_wctr(&sc->lpt_dev, LPC_NINIT);
/* check if we can use interrupt, should be done by ppc stuff */
- nlprintf(("oldirq %x\n", sc->sc_irq));
+ nlprintf("oldirq %x\n", sc->sc_irq);
if (ppb_get_irq(&sc->lpt_dev)) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf(LPT_NAME "%d: Interrupt-driven port\n", dev->id_unit);
} else {
sc->sc_irq = 0;
- nlprintf((LPT_NAME "%d: Polled port\n", dev->id_unit));
+ nlprintf(LPT_NAME "%d: Polled port\n", dev->id_unit);
}
- nlprintf(("irq %x\n", sc->sc_irq));
+ nlprintf("irq %x\n", sc->sc_irq);
lpt_release_ppbus(sc);
@@ -407,7 +398,7 @@ nlptout(void *arg)
struct lpt_data *sc = arg;
int pl;
- nlprintf(("T %x ", ppb_rstr(&sc->lpt_dev)));
+ nlprintf ("T %x ", ppb_rstr(&sc->lpt_dev));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -444,7 +435,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
struct lpt_data *sc;
int s;
- int trys, err;
+ int trys;
u_int unit = LPTUNIT(minor(dev));
if ((unit >= nlpt))
@@ -453,7 +444,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
sc = lptdata[unit];
if (sc->sc_state) {
- nlprintf((LPT_NAME ": still open %x\n", sc->sc_state));
+ nlprintf(LPT_NAME ": still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= LPTINIT;
@@ -467,11 +458,12 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
}
/* request the ppbus only if we don't have it already */
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
- return (err);
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ return (EINTR);
s = spltty();
- nlprintf((LPT_NAME " flags 0x%x\n", sc->sc_flags));
+ nlprintf(LPT_NAME " flags 0x%x\n", sc->sc_flags);
/* set IRQ status according to ENABLE_IRQ flag */
if (sc->sc_irq & LP_ENABLE_IRQ)
@@ -497,7 +489,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- nlprintf(("status %x\n", ppb_rstr(&sc->lpt_dev)));
+ nlprintf ("status %x\n", ppb_rstr(&sc->lpt_dev) );
lpt_release_ppbus(sc);
return (EBUSY);
@@ -530,7 +522,6 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
sc->sc_state = OPEN;
sc->sc_inbuf = geteblk(BUFSIZE);
- sc->sc_statbuf = geteblk(BUFSTATSIZE);
sc->sc_xfercnt = 0;
splx(s);
@@ -538,14 +529,14 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
lpt_release_ppbus(sc);
/* only use timeout if using interrupt */
- nlprintf(("irq %x\n", sc->sc_irq));
+ nlprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout(nlptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- nlprintf(("opened.\n"));
+ nlprintf("opened.\n");
return(0);
}
@@ -564,7 +555,8 @@ nlptclose(dev_t dev, int flags, int fmt, struct proc *p)
if(sc->sc_flags & LP_BYPASS)
goto end_close;
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR)))
return (err);
sc->sc_state &= ~OPEN;
@@ -581,7 +573,6 @@ nlptclose(dev_t dev, int flags, int fmt, struct proc *p)
ppb_wctr(&sc->lpt_dev, LPC_NINIT);
brelse(sc->sc_inbuf);
- brelse(sc->sc_statbuf);
end_close:
/* release the bus anyway */
@@ -589,7 +580,7 @@ end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- nlprintf(("closed.\n"));
+ nlprintf("closed.\n");
return(0);
}
@@ -607,7 +598,7 @@ nlpt_pushbytes(struct lpt_data *sc)
int spin, err, tic;
char ch;
- nlprintf(("p"));
+ nlprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -654,40 +645,6 @@ nlpt_pushbytes(struct lpt_data *sc)
}
/*
- * nlptread --retrieve printer status in IEEE1284 NIBBLE mode
- */
-
-static int
-nlptread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct lpt_data *sc = lptdata[LPTUNIT(minor(dev))];
- int error = 0, len;
-
- if ((error = ppb_1284_negociate(&sc->lpt_dev, PPB_NIBBLE, 0)))
- return (error);
-
- /* read data in an other buffer, read/write may be simultaneous */
- len = 0;
- while (uio->uio_resid) {
- if ((error = ppb_1284_read(&sc->lpt_dev, PPB_NIBBLE,
- sc->sc_statbuf->b_data, min(BUFSTATSIZE,
- uio->uio_resid), &len))) {
- goto error;
- }
-
- if (!len)
- goto error; /* no more data */
-
- if ((error = uiomove(sc->sc_statbuf->b_data, len, uio)))
- goto error;
- }
-
-error:
- ppb_1284_terminate(&sc->lpt_dev);
- return (error);
-}
-
-/*
* nlptwrite --copy a line from user space to a local buffer, then call
* putc to get the chars moved to the output queue.
*
@@ -699,7 +656,6 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
{
register unsigned n;
int pl, err;
- u_int unit = LPTUNIT(minor(dev));
struct lpt_data *sc = lptdata[LPTUNIT(minor(dev))];
if(sc->sc_flags & LP_BYPASS) {
@@ -708,46 +664,26 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
}
/* request the ppbus only if we don't have it already */
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
- return (err);
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ return (EINTR);
sc->sc_state &= ~INTERRUPTED;
while ((n = min(BUFSIZE, uio->uio_resid)) != 0) {
sc->sc_cp = sc->sc_inbuf->b_data ;
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
-
- if (sc->sc_irq & LP_ENABLE_EXT) {
- /* try any extended mode */
- err = ppb_write(&sc->lpt_dev, sc->sc_cp,
- sc->sc_xfercnt, 0);
- switch (err) {
- case 0:
- /* if not all data was sent, we could rely
- * on polling for the last bytes */
- sc->sc_xfercnt = 0;
- break;
- case EINTR:
- sc->sc_state |= INTERRUPTED;
- return(err);
- case EINVAL:
- /* advanced mode not avail */
- log(LOG_NOTICE, LPT_NAME "%d: advanced mode not avail, polling\n", unit);
- break;
- default:
- return(err);
- }
- } else while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- nlprintf(("i"));
+ while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
+ nlprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- nlprintf(("\nC %d. ", sc->sc_xfercnt));
+ nlprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
nlpt_intr(sc->lpt_unit);
(void) splx(pl);
}
- nlprintf(("W "));
+ nlprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep((caddr_t)sc,
LPPRI|PCATCH, LPT_NAME "write", 0))) {
@@ -755,10 +691,9 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
return(err);
}
}
-
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- nlprintf(("p"));
+ nlprintf("p");
err = nlpt_pushbytes(sc);
@@ -806,7 +741,7 @@ nlpt_intr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*nlprintf(("%x ", *sc->sc_cp)); */
+ /*nlprintf("%x ", *sc->sc_cp); */
ppb_wdtr(&sc->lpt_dev, *sc->sc_cp++) ;
ppb_wctr(&sc->lpt_dev, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -824,7 +759,7 @@ nlpt_intr(int unit)
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- nlprintf(("w "));
+ nlprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -832,7 +767,7 @@ nlpt_intr(int unit)
sc->sc_state |= EERROR;
/* nlptout() will jump in and try to restart. */
}
- nlprintf(("sts %x ", sts));
+ nlprintf("sts %x ", sts);
}
static void
@@ -870,35 +805,15 @@ nlptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
* this gets syslog'd.
*/
old_sc_irq = sc->sc_irq;
- switch(*(int*)data) {
- case 0:
+ if(*(int*)data == 0)
sc->sc_irq &= (~LP_ENABLE_IRQ);
- break;
- case 1:
- sc->sc_irq &= (~LP_ENABLE_EXT);
+ else
sc->sc_irq |= LP_ENABLE_IRQ;
- break;
- case 2:
- /* classic irq based transfer and advanced
- * modes are in conflict
- */
- sc->sc_irq &= (~LP_ENABLE_IRQ);
- sc->sc_irq |= LP_ENABLE_EXT;
- break;
- case 3:
- sc->sc_irq &= (~LP_ENABLE_EXT);
- break;
- default:
- break;
- }
-
if (old_sc_irq != sc->sc_irq )
- log(LOG_NOTICE, LPT_NAME "%d: switched to %s %s mode\n",
+ log(LOG_NOTICE, LPT_NAME "%d: switched to %s mode\n",
unit,
(sc->sc_irq & LP_ENABLE_IRQ)?
- "interrupt-driven":"polled",
- (sc->sc_irq & LP_ENABLE_EXT)?
- "extended":"standard");
+ "interrupt-driven":"polled");
} else /* polled port */
error = EOPNOTSUPP;
break;
diff --git a/sys/dev/ppbus/nlpt.h b/sys/dev/ppbus/nlpt.h
index 31292b9f7ed7..b0b3df6457a7 100644
--- a/sys/dev/ppbus/nlpt.h
+++ b/sys/dev/ppbus/nlpt.h
@@ -27,7 +27,7 @@
* @(#)lptreg.h 1.1 (Berkeley) 12/19/90
* Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp
*
- * $Id: nlpt.h,v 1.2 1997/08/16 14:05:32 msmith Exp $
+ * $Id: nlpt.h,v 1.1 1997/08/14 13:57:40 msmith Exp $
*/
#ifndef __NLPT_H
#define __NLPT_H
@@ -61,15 +61,13 @@ struct lpt_data {
#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
#define LP_BYPASS 0x80 /* bypass printer ready checks */
struct buf *sc_inbuf;
- struct buf *sc_statbuf;
short sc_xfercnt ;
char sc_primed;
char *sc_cp ;
- u_short sc_irq ; /* IRQ status of port */
+ u_char sc_irq ; /* IRQ status of port */
#define LP_HAS_IRQ 0x01 /* we have an irq available */
#define LP_USE_IRQ 0x02 /* we are using our irq */
#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
-#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
u_char sc_backoff ; /* time to call lptout() again */
#ifdef DEVFS
diff --git a/sys/dev/ppbus/ppb_1284.c b/sys/dev/ppbus/ppb_1284.c
index 5da5fa3eac3a..56524d1052e7 100644
--- a/sys/dev/ppbus/ppb_1284.c
+++ b/sys/dev/ppbus/ppb_1284.c
@@ -23,15 +23,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_1284.c,v 1.7 1999/01/10 12:04:54 nsouch Exp $
+ * $Id: ppb_1284.c,v 1.5 1998/09/13 18:26:26 nsouch Exp $
*
*/
-/*
- * General purpose routines for the IEEE1284-1994 Standard
- */
-
-#include "opt_ppb_1284.h"
+#include "opt_debug_1284.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -46,414 +42,24 @@
*
* Wait for the peripherial up to 40ms
*/
-static int
-do_1284_wait(struct ppb_device *dev, char mask, char status)
-{
- return (ppb_poll_device(dev, 4, mask, status, PPB_NOINTR | PPB_POLL));
-}
-
-static int
-do_peripheral_wait(struct ppb_device *dev, char mask, char status)
-{
- return (ppb_poll_device(dev, 100, mask, status, PPB_NOINTR | PPB_POLL));
-}
-
-#define nibble2char(s) (((s & ~nACK) >> 3) | (~s & nBUSY) >> 4)
-
-/*
- * ppb_1284_reset_error()
- *
- * Unconditionaly reset the error field
- */
-static int
-ppb_1284_reset_error(struct ppb_device *dev, int state)
-{
- dev->ppb->error = PPB_NO_ERROR;
- dev->ppb->state = state;
-
- return (0);
-}
-
-/*
- * ppb_1284_get_state()
- *
- * Get IEEE1284 state
- */
-static int
-ppb_1284_get_state(struct ppb_device *dev)
-{
- return (dev->ppb->state);
-}
-
-/*
- * ppb_1284_set_state()
- *
- * Change IEEE1284 state if no error occured
- */
-static int
-ppb_1284_set_state(struct ppb_device *dev, int state)
-{
- /* call ppb_1284_reset_error() if you absolutly want to change
- * the state from PPB_ERROR to another */
- if ((dev->ppb->state != PPB_ERROR) &&
- (dev->ppb->error == PPB_NO_ERROR)) {
- dev->ppb->state = state;
- dev->ppb->error = PPB_NO_ERROR;
- }
-
- return (0);
-}
-
-static int
-ppb_1284_set_error(struct ppb_device *dev, int error, int event)
-{
- /* do not accumulate errors */
- if ((dev->ppb->error == PPB_NO_ERROR) &&
- (dev->ppb->state != PPB_ERROR)) {
- dev->ppb->error = error;
- dev->ppb->state = PPB_ERROR;
- }
-
-#ifdef DEBUG_1284
- printf("ppb1284: error=%d status=0x%x event=%d\n", error,
- ppb_rstr(dev) & 0xff, event);
-#endif
-
- return (0);
-}
-
-/*
- * ppb_request_mode()
- *
- * Converts mode+options into ext. value
- */
-static int
-ppb_request_mode(int mode, int options)
-{
- int request_mode = 0;
-
- if (options & PPB_EXTENSIBILITY_LINK) {
- request_mode = EXT_LINK_1284_NORMAL;
-
- } else {
- switch (mode) {
- case PPB_NIBBLE:
- request_mode = (options & PPB_REQUEST_ID) ?
- NIBBLE_1284_REQUEST_ID :
- NIBBLE_1284_NORMAL;
- break;
- case PPB_PS2:
- request_mode = (options & PPB_REQUEST_ID) ?
- BYTE_1284_REQUEST_ID :
- BYTE_1284_NORMAL;
- break;
- case PPB_ECP:
- if (options & PPB_USE_RLE)
- request_mode = (options & PPB_REQUEST_ID) ?
- ECP_1284_RLE_REQUEST_ID :
- ECP_1284_RLE;
- else
- request_mode = (options & PPB_REQUEST_ID) ?
- ECP_1284_REQUEST_ID :
- ECP_1284_NORMAL;
- break;
- case PPB_EPP:
- request_mode = EPP_1284_NORMAL;
- break;
- default:
- panic("%s: unsupported mode %d\n", __FUNCTION__, mode);
- }
- }
-
- return (request_mode);
-}
-
-/*
- * ppb_peripheral_negociate()
- *
- * Negociate the peripheral side
- */
-int
-ppb_peripheral_negociate(struct ppb_device *dev, int mode, int options)
-{
- int spin, request_mode, error = 0;
- char r;
-
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_PERIPHERAL_NEGOCIATION);
-
- /* compute ext. value */
- request_mode = ppb_request_mode(mode, options);
-
- /* wait host */
- spin = 10;
- while (spin-- && (ppb_rstr(dev) & nBUSY))
- DELAY(1);
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT) || !spin) {
- error = ENODEV;
- goto error;
- }
-
- /* Event 4 - read ext. value */
- r = ppb_rdtr(dev);
-
- /* nibble mode is not supported */
- if ((r == (char)request_mode) ||
- (r == NIBBLE_1284_NORMAL)) {
-
- /* Event 5 - restore direction bit, no data avail */
- ppb_wctr(dev, (STROBE | nINIT) & ~(SELECTIN));
- DELAY(1);
-
- /* Event 6 */
- ppb_wctr(dev, (nINIT) & ~(SELECTIN | STROBE));
-
- if (r == NIBBLE_1284_NORMAL) {
-#ifdef DEBUG_1284
- printf("R");
-#endif
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 4);
- error = EINVAL;
- goto error;
- } else {
- ppb_1284_set_state(dev, PPB_PERIPHERAL_IDLE);
- switch (r) {
- case BYTE_1284_NORMAL:
- ppb_set_mode(dev, PPB_BYTE);
- break;
- default:
- break;
- }
-#ifdef DEBUG_1284
- printf("A");
-#endif
- /* negociation succeeds */
- }
- } else {
- /* Event 5 - mode not supported */
- ppb_wctr(dev, SELECTIN);
- DELAY(1);
-
- /* Event 6 */
- ppb_wctr(dev, (SELECTIN) & ~(STROBE | nINIT));
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 4);
-
-#ifdef DEBUG_1284
- printf("r");
-#endif
- error = EINVAL;
- goto error;
- }
-
- return (0);
-
-error:
- ppb_peripheral_terminate(dev, PPB_WAIT);
- return (error);
-}
-
-/*
- * ppb_peripheral_terminate()
- *
- * Terminate peripheral transfer side
- *
- * Always return 0 in compatible mode
- */
-int
-ppb_peripheral_terminate(struct ppb_device *dev, int how)
-{
- int error = 0;
-
-#ifdef DEBUG_1284
- printf("t");
-#endif
-
- ppb_1284_set_state(dev, PPB_PERIPHERAL_TERMINATION);
-
- /* Event 22 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, SELECT | nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 22);
- goto error;
- }
-
- /* Event 24 */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
-
- /* Event 25 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, nBUSY, nBUSY))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 25);
- goto error;
- }
-
- /* Event 26 */
- ppb_wctr(dev, (SELECTIN | nINIT | STROBE) & ~(AUTOFEED));
- DELAY(1);
- /* Event 27 */
- ppb_wctr(dev, (SELECTIN | nINIT) & ~(STROBE | AUTOFEED));
-
- /* Event 28 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 28);
- goto error;
- }
-
-error:
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_FORWARD_IDLE);
-
- return (0);
-}
-
-/*
- * byte_peripheral_outbyte()
- *
- * Write 1 byte in BYTE mode
- */
-static int
-byte_peripheral_outbyte(struct ppb_device *dev, char *buffer, int last)
-{
- int error = 0;
-
- /* Event 7 */
- if ((error = do_1284_wait(dev, nBUSY, nBUSY))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 7);
- goto error;
- }
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT)) {
- ppb_peripheral_terminate(dev, PPB_WAIT);
- goto error;
- }
-
- /* Event 15 - put byte on data lines */
-#ifdef DEBUG_1284
- printf("B");
-#endif
- ppb_wdtr(dev, *buffer);
-
- /* Event 9 */
- ppb_wctr(dev, (AUTOFEED | STROBE) & ~(nINIT | SELECTIN));
-
- /* Event 10 - wait data read */
- if ((error = do_peripheral_wait(dev, nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 16);
- goto error;
- }
-
- /* Event 11 */
- if (!last) {
- ppb_wctr(dev, (AUTOFEED) & ~(nINIT | STROBE | SELECTIN));
- } else {
- ppb_wctr(dev, (nINIT) & ~(STROBE | SELECTIN | AUTOFEED));
- }
-
-#if 0
- /* Event 16 - wait strobe */
- if ((error = do_peripheral_wait(dev, nACK | nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 16);
- goto error;
- }
-#endif
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT)) {
- ppb_peripheral_terminate(dev, PPB_WAIT);
- goto error;
- }
-
-error:
- return (error);
-}
-
-/*
- * byte_peripheral_write()
- *
- * Write n bytes in BYTE mode
- */
int
-byte_peripheral_write(struct ppb_device *dev, char *buffer, int len, int *sent)
+do_1284_wait(struct ppb_device *dev, char mask, char status)
{
- int error = 0, i;
+ int i;
char r;
- ppb_1284_set_state(dev, PPB_PERIPHERAL_TRANSFER);
-
- /* wait forever, the remote host is master and should initiate
- * termination
- */
- for (i=0; i<len; i++) {
- /* force remote nFAULT low to release the remote waiting
- * process, if any
- */
- r = ppb_rctr(dev);
- ppb_wctr(dev, r & ~nINIT);
-
-#ifdef DEBUG_1284
- printf("y");
-#endif
- /* Event 7 */
- error = ppb_poll_device(dev, PPB_FOREVER, nBUSY, nBUSY,
- PPB_INTR);
-
- if (error && error != EWOULDBLOCK)
- goto error;
-
-#ifdef DEBUG_1284
- printf("b");
-#endif
- if ((error = byte_peripheral_outbyte(dev, buffer+i, (i == len-1))))
- goto error;
+ /* try up to 5ms */
+ for (i = 0; i < 20; i++) {
+ r = ppb_rstr(dev);
+ DELAY(25);
+ if ((r & mask) == status)
+ return (0);
}
-error:
- if (!error)
- ppb_1284_set_state(dev, PPB_PERIPHERAL_IDLE);
- *sent = i;
- return (error);
+ return (ppb_poll_device(dev, 4, mask, status, PPB_NOINTR));
}
-/*
- * byte_1284_inbyte()
- *
- * Read 1 byte in BYTE mode
- */
-int
-byte_1284_inbyte(struct ppb_device *dev, char *buffer)
-{
- int error = 0;
-
- /* Event 7 - ready to take data (nAUTO low) */
- ppb_wctr(dev, (PCD | nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-
- /* Event 9 - peripheral set nAck low */
- if ((error = do_1284_wait(dev, nACK, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 9);
- goto error;
- }
-
- /* read the byte */
- *buffer = ppb_rdtr(dev);
-
- /* Event 10 - data received, can't accept more */
- ppb_wctr(dev, (nINIT) & ~(AUTOFEED | STROBE | SELECTIN));
-
- /* Event 11 - peripheral ack */
- if ((error = do_1284_wait(dev, nACK, nACK))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 11);
- goto error;
- }
-
- /* Event 16 - strobe */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
- DELAY(3);
- ppb_wctr(dev, (nINIT) & ~(AUTOFEED | STROBE | SELECTIN));
-
-error:
- return (error);
-}
+#define nibble2char(s) (((s & ~nACK) >> 3) | (~s & nBUSY) >> 4)
/*
* nibble_1284_inbyte()
@@ -467,379 +73,126 @@ nibble_1284_inbyte(struct ppb_device *dev, char *buffer)
int i, error;
for (i = 0; i < 2; i++) {
+ /* ready to take data (nAUTO low) */
+ ppb_wctr(dev, AUTOFEED & ~(STROBE | SELECTIN));
- /* Event 7 - ready to take data (nAUTO low) */
- ppb_wctr(dev, (nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-
- /* Event 8 - peripheral writes the first nibble */
-
- /* Event 9 - peripheral set nAck low */
- if ((error = do_1284_wait(dev, nACK, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 9);
- goto error;
- }
+ if ((error = do_1284_wait(dev, nACK, 0)))
+ return (error);
/* read nibble */
nibble[i] = ppb_rstr(dev);
- /* Event 10 - ack, nibble received */
- ppb_wctr(dev, nINIT & ~(AUTOFEED | STROBE | SELECTIN));
+ /* ack, not ready for another nibble */
+ ppb_wctr(dev, 0 & ~(AUTOFEED | STROBE | SELECTIN));
- /* Event 11 - wait ack from peripherial */
- if ((error = do_1284_wait(dev, nACK, nACK))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 11);
- goto error;
- }
+ /* wait ack from peripherial */
+ if ((error = do_1284_wait(dev, nACK, nACK)))
+ return (error);
}
*buffer = ((nibble2char(nibble[1]) << 4) & 0xf0) |
(nibble2char(nibble[0]) & 0x0f);
-error:
- return (error);
-}
-
-/*
- * spp_1284_read()
- *
- * Read in IEEE1284 NIBBLE/BYTE mode
- */
-int
-spp_1284_read(struct ppb_device *dev, int mode, char *buffer, int max, int *read)
-{
- int error = 0, len = 0;
- int terminate_after_transfer = 1;
- int state;
-
- *read = len = 0;
-
- state = ppb_1284_get_state(dev);
-
- switch (state) {
- case PPB_FORWARD_IDLE:
- if ((error = ppb_1284_negociate(dev, mode, 0)))
- return (error);
- break;
-
- case PPB_REVERSE_IDLE:
- terminate_after_transfer = 0;
- break;
-
- default:
- ppb_1284_terminate(dev);
- if ((error = ppb_1284_negociate(dev, mode, 0)))
- return (error);
- break;
- }
-
- while ((len < max) && !(ppb_rstr(dev) & (nFAULT))) {
-
- ppb_1284_set_state(dev, PPB_REVERSE_TRANSFER);
-
-#ifdef DEBUG_1284
- printf("B");
-#endif
-
- switch (mode) {
- case PPB_NIBBLE:
- /* read a byte, error means no more data */
- if (nibble_1284_inbyte(dev, buffer+len))
- goto end_while;
- break;
- case PPB_BYTE:
- if (byte_1284_inbyte(dev, buffer+len))
- goto end_while;
- break;
- default:
- error = EINVAL;
- goto end_while;
- }
- len ++;
- }
-end_while:
-
- if (!error)
- ppb_1284_set_state(dev, PPB_REVERSE_IDLE);
-
- *read = len;
-
- if (terminate_after_transfer || error)
- ppb_1284_terminate(dev);
-
- return (error);
+ return (0);
}
/*
- * ppb_1284_read_id()
- *
+ * nibble_1284_sync()
*/
-int
-ppb_1284_read_id(struct ppb_device *dev, int mode, char *buffer,
- int max, int *read)
+void
+nibble_1284_sync(struct ppb_device *dev)
{
- int error = 0;
+ char ctr;
- /* fill the buffer with 0s */
- bzero(buffer, max);
+ ctr = ppb_rctr(dev);
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_ECP:
- if ((error = ppb_1284_negociate(dev, PPB_NIBBLE, PPB_REQUEST_ID)))
- return (error);
- error = spp_1284_read(dev, PPB_NIBBLE, buffer, max, read);
- break;
- case PPB_BYTE:
- if ((error = ppb_1284_negociate(dev, PPB_BYTE, PPB_REQUEST_ID)))
- return (error);
- error = spp_1284_read(dev, PPB_BYTE, buffer, max, read);
- break;
- default:
- panic("%s: unsupported mode %d\n", __FUNCTION__, mode);
- }
+ ppb_wctr(dev, (ctr & ~AUTOFEED) | SELECTIN);
+ if (do_1284_wait(dev, nACK, 0))
+ return;
- ppb_1284_terminate(dev);
- return (error);
-}
+ ppb_wctr(dev, ctr | AUTOFEED);
+ do_1284_wait(dev, nACK, nACK);
-/*
- * ppb_1284_read()
- *
- * IEEE1284 read
- */
-int
-ppb_1284_read(struct ppb_device *dev, int mode, char *buffer,
- int max, int *read)
-{
- int error = 0;
+ ppb_wctr(dev, (ctr & ~AUTOFEED) | SELECTIN);
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_BYTE:
- error = spp_1284_read(dev, mode, buffer, max, read);
- break;
- default:
- return (EINVAL);
- }
-
- return (error);
+ return;
}
/*
* ppb_1284_negociate()
*
- * IEEE1284 negociation phase
- *
* Normal nibble mode or request device id mode (see ppb_1284.h)
- *
- * After negociation, nFAULT is low if data is available
*/
int
-ppb_1284_negociate(struct ppb_device *dev, int mode, int options)
+ppb_1284_negociate(struct ppb_device *dev, int mode)
{
int error;
- int request_mode;
+ int phase = 0;
-#ifdef DEBUG_1284
- printf("n");
-#endif
-
- if (ppb_1284_get_state(dev) >= PPB_PERIPHERAL_NEGOCIATION)
- ppb_peripheral_terminate(dev, PPB_WAIT);
-
- if (ppb_1284_get_state(dev) != PPB_FORWARD_IDLE)
- ppb_1284_terminate(dev);
-
-#ifdef DEBUG_1284
- printf("%d", mode);
-#endif
-
- /* ensure the host is in compatible mode */
- ppb_set_mode(dev, PPB_COMPATIBLE);
-
- /* reset error to catch the actual negociation error */
- ppb_1284_reset_error(dev, PPB_FORWARD_IDLE);
-
- /* calculate ext. value */
- request_mode = ppb_request_mode(mode, options);
-
- /* default state */
ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
DELAY(1);
- /* enter negociation phase */
- ppb_1284_set_state(dev, PPB_NEGOCIATION);
-
- /* Event 0 - put the exten. value on the data lines */
- ppb_wdtr(dev, request_mode);
-
-#ifdef PERIPH_1284
- /* request remote host attention */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
- DELAY(1);
- ppb_wctr(dev, (nINIT) & ~(STROBE | AUTOFEED | SELECTIN));
-#else
+ ppb_wdtr(dev, mode);
DELAY(1);
-#endif /* !PERIPH_1284 */
-
- /* Event 1 - enter IEEE1284 mode */
ppb_wctr(dev, (nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-#ifdef PERIPH_1284
- /* ignore the PError line, wait a bit more, remote host's
- * interrupts don't respond fast enough */
- if (ppb_poll_device(dev, 40, nACK | SELECT | nFAULT,
- SELECT | nFAULT, PPB_NOINTR | PPB_POLL)) {
- ppb_1284_set_error(dev, PPB_NOT_IEEE1284, 2);
- error = ENODEV;
- goto error;
- }
-#else
- /* Event 2 - trying IEEE1284 dialog */
- if (do_1284_wait(dev, nACK | PERROR | SELECT | nFAULT,
- PERROR | SELECT | nFAULT)) {
- ppb_1284_set_error(dev, PPB_NOT_IEEE1284, 2);
- error = ENODEV;
+ if ((error = do_1284_wait(dev, nACK | PERROR | SELECT | nFAULT,
+ PERROR | SELECT | nFAULT)))
goto error;
- }
-#endif /* !PERIPH_1284 */
- /* Event 3 - latch the ext. value to the peripheral */
+ phase = 1;
+
ppb_wctr(dev, (nINIT | STROBE | AUTOFEED) & ~SELECTIN);
- DELAY(1);
+ DELAY(5);
- /* Event 4 - IEEE1284 device recognized */
ppb_wctr(dev, nINIT & ~(SELECTIN | AUTOFEED | STROBE));
- /* Event 6 - waiting for status lines */
- if (do_1284_wait(dev, nACK, nACK)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 6);
- error = EBUSY;
+#if 0 /* not respected by most devices */
+ if ((error = do_1284_wait(dev, nACK, nACK)))
goto error;
- }
-
- /* Event 7 - quering result consider nACK not to misunderstand
- * a remote computer terminate sequence */
- if (options & PPB_EXTENSIBILITY_LINK) {
-
- /* XXX not fully supported yet */
- ppb_1284_terminate(dev);
- return (0);
- }
- if (request_mode == NIBBLE_1284_NORMAL) {
- if (do_1284_wait(dev, nACK | SELECT, nACK)) {
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 7);
- error = ENODEV;
- goto error;
- }
- } else {
- if (do_1284_wait(dev, nACK | SELECT, SELECT | nACK)) {
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 7);
- error = ENODEV;
+ if (mode == 0)
+ if ((error = do_1284_wait(dev, SELECT, 0)))
goto error;
- }
- }
-
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_PS2:
- /* enter reverse idle phase */
- ppb_1284_set_state(dev, PPB_REVERSE_IDLE);
- break;
- case PPB_ECP:
- /* negociation ok, now setup the communication */
- ppb_1284_set_state(dev, PPB_SETUP);
- ppb_wctr(dev, (nINIT | AUTOFEED) & ~(SELECTIN | STROBE));
-
-#ifdef PERIPH_1284
- /* ignore PError line */
- if (do_1284_wait(dev, nACK | SELECT | nBUSY,
- nACK | SELECT | nBUSY)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 30);
- error = ENODEV;
- goto error;
- }
-#else
- if (do_1284_wait(dev, nACK | SELECT | PERROR | nBUSY,
- nACK | SELECT | PERROR | nBUSY)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 30);
- error = ENODEV;
+ else
+ if ((error = do_1284_wait(dev, SELECT, SELECT)))
goto error;
- }
-#endif /* !PERIPH_1284 */
-
- /* ok, the host enters the ForwardIdle state */
- ppb_1284_set_state(dev, PPB_ECP_FORWARD_IDLE);
- break;
- case PPB_EPP:
- ppb_1284_set_state(dev, PPB_EPP_IDLE);
- break;
-
- default:
- panic("%s: unknown mode (%d)!", __FUNCTION__, mode);
- }
- ppb_set_mode(dev, mode);
+#endif
return (0);
error:
- ppb_1284_terminate(dev);
+ if (bootverbose)
+ printf("%s: status=0x%x %d\n", __FUNCTION__, ppb_rstr(dev), phase);
return (error);
}
-/*
- * ppb_1284_terminate()
- *
- * IEEE1284 termination phase, return code should ignored since the host
- * is _always_ in compatible mode after ppb_1284_terminate()
- */
int
-ppb_1284_terminate(struct ppb_device *dev)
+ppb_1284_terminate(struct ppb_device *dev, int how)
{
+ int error;
-#ifdef DEBUG_1284
- printf("T");
-#endif
-
- /* do not reset error here to keep the error that
- * may occured before the ppb_1284_terminate() call */
- ppb_1284_set_state(dev, PPB_TERMINATION);
+ switch (how) {
+ case VALID_STATE:
-#ifdef PERIPH_1284
- /* request remote host attention */
- ppb_wctr(dev, (nINIT | STROBE | SELECTIN) & ~(AUTOFEED));
- DELAY(1);
-#endif /* PERIPH_1284 */
+ ppb_wctr(dev, SELECTIN & ~(STROBE | AUTOFEED));
- /* Event 22 - set nSelectin low and nAutoFeed high */
- ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
+ if ((error = do_1284_wait(dev, nACK | nBUSY | nFAULT, nFAULT)))
+ return (error);
- /* Event 24 - waiting for peripheral, Xflag ignored */
- if (do_1284_wait(dev, nACK | nBUSY | nFAULT, nFAULT)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 24);
- goto error;
- }
+ ppb_wctr(dev, (SELECTIN | AUTOFEED) & ~STROBE);
- /* Event 25 - set nAutoFd low */
- ppb_wctr(dev, (nINIT | SELECTIN | AUTOFEED) & ~STROBE);
+ if ((error = do_1284_wait(dev, nACK, nACK)))
+ return (error);
- /* Event 26 - compatible mode status is set */
+ ppb_wctr(dev, SELECTIN & ~(STROBE | AUTOFEED));
+ break;
- /* Event 27 - peripheral set nAck high */
- if (do_1284_wait(dev, nACK, nACK)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 27);
+ default:
+ return (EINVAL);
}
- /* Event 28 - end termination, return to idle phase */
- ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
-
-error:
- /* return to compatible mode */
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_FORWARD_IDLE);
-
return (0);
}
diff --git a/sys/dev/ppbus/ppb_1284.h b/sys/dev/ppbus/ppb_1284.h
index ea009b7d381d..1cc98d4614a5 100644
--- a/sys/dev/ppbus/ppb_1284.h
+++ b/sys/dev/ppbus/ppb_1284.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_1284.h,v 1.3 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_1284.h,v 1.2 1998/08/03 19:14:31 msmith Exp $
*
*/
#ifndef __1284_H
@@ -66,59 +66,20 @@
#define Intr nACK
/* request mode values */
-#define NIBBLE_1284_NORMAL 0x0
-#define NIBBLE_1284_REQUEST_ID 0x4
-#define BYTE_1284_NORMAL 0x1
-#define BYTE_1284_REQUEST_ID 0x5
-#define ECP_1284_NORMAL 0x10
-#define ECP_1284_REQUEST_ID 0x14
-#define ECP_1284_RLE 0x30
-#define ECP_1284_RLE_REQUEST_ID 0x34
-#define EPP_1284_NORMAL 0x40
-#define EXT_LINK_1284_NORMAL 0x80
-
-/* ieee1284 mode options */
-#define PPB_REQUEST_ID 0x1
-#define PPB_USE_RLE 0x2
-#define PPB_EXTENSIBILITY_LINK 0x4
-
-/* ieee1284 errors */
-#define PPB_NO_ERROR 0
-#define PPB_MODE_UNSUPPORTED 1 /* mode not supported by peripheral */
-#define PPB_NOT_IEEE1284 2 /* not an IEEE1284 compliant periph. */
-#define PPB_TIMEOUT 3 /* timeout */
-#define PPB_INVALID_MODE 4 /* current mode is incorrect */
-
-/* ieee1284 host side states */
-#define PPB_ERROR 0
-#define PPB_FORWARD_IDLE 1
-#define PPB_NEGOCIATION 2
-#define PPB_SETUP 3
-#define PPB_ECP_FORWARD_IDLE 4
-#define PPB_FWD_TO_REVERSE 5
-#define PPB_REVERSE_IDLE 6
-#define PPB_REVERSE_TRANSFER 7
-#define PPB_REVERSE_TO_FWD 8
-#define PPB_EPP_IDLE 9
-#define PPB_TERMINATION 10
-
-/* peripheral side states */
-#define PPB_PERIPHERAL_NEGOCIATION 11
-#define PPB_PERIPHERAL_IDLE 12
-#define PPB_PERIPHERAL_TRANSFER 13
-#define PPB_PERIPHERAL_TERMINATION 14
+#define NIBBLE_1284_NORMAL 0
+#define NIBBLE_1284_REQUEST_ID 4
-extern int nibble_1284_inbyte(struct ppb_device *, char *);
-extern int byte_1284_inbyte(struct ppb_device *, char *);
-extern int spp_1284_read(struct ppb_device *, int, char *, int, int *);
+/* how to terminate */
+#define VALID_STATE 0
+#define IMMEDIATE 1
+
+extern int do_1284_wait(struct ppb_device *, char, char);
-extern int ppb_1284_negociate(struct ppb_device *, int, int);
-extern int ppb_1284_terminate(struct ppb_device *);
-extern int ppb_1284_read_id(struct ppb_device *, int, char *, int, int *);
-extern int ppb_1284_read(struct ppb_device *, int, char *, int, int *);
+extern int nibble_1284_inbyte(struct ppb_device *, char *);
+extern void nibble_1284_sync(struct ppb_device *);
+extern int nibble_1284_mode(struct ppb_device *, int);
-extern int ppb_peripheral_terminate(struct ppb_device *, int);
-extern int ppb_peripheral_negociate(struct ppb_device *, int, int);
-extern int byte_peripheral_write(struct ppb_device *, char *, int, int *);
+extern int ppb_1284_negociate(struct ppb_device *, int);
+extern int ppb_1284_terminate(struct ppb_device *, int how);
#endif
diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c
index 83fc26ef0294..7555b24f752e 100644
--- a/sys/dev/ppbus/ppb_base.c
+++ b/sys/dev/ppbus/ppb_base.c
@@ -23,13 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_base.c,v 1.5 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_base.c,v 1.4 1998/08/03 19:14:31 msmith Exp $
*
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <machine/clock.h>
#include <dev/ppbus/ppbconf.h>
@@ -71,39 +70,28 @@ int
ppb_poll_device(struct ppb_device *dev, int max,
char mask, char status, int how)
{
- int i, j, error;
- char r;
-
- /* try at least up to 10ms */
- for (j = 0; j < ((how & PPB_POLL) ? max : 1); j++) {
- for (i = 0; i < 10000; i++) {
- r = ppb_rstr(dev);
- DELAY(1);
- if ((r & mask) == status)
- return (0);
- }
- }
+ int i, error;
- if (!(how & PPB_POLL)) {
- for (i = 0; max == PPB_FOREVER || i < max-1; i++) {
+ for (i = 0; i < max; i++) {
if ((ppb_rstr(dev) & mask) == status)
return (0);
switch (how) {
case PPB_NOINTR:
/* wait 10 ms */
- tsleep((caddr_t)dev, PPBPRI, "ppbpoll", hz/100);
+ if ((error = tsleep((caddr_t)dev, PPBPRI,
+ "ppbpoll", hz/100)))
+ return (error);
break;
case PPB_INTR:
default:
/* wait 10 ms */
if ((error = tsleep((caddr_t)dev, PPBPRI | PCATCH,
- "ppbpoll", hz/100)) != EWOULDBLOCK)
+ "ppbpoll", hz/100)))
return (error);
break;
}
- }
}
return (EWOULDBLOCK);
@@ -120,31 +108,16 @@ ppb_set_mode(struct ppb_device *dev, int mode)
struct ppb_data *ppb = dev->ppb;
int old_mode = ppb_get_mode(dev);
- if ((*ppb->ppb_link->adapter->setmode)(
- ppb->ppb_link->adapter_unit, mode))
+ if ((*ppb->ppb_link->adapter->setmode)(dev->id_unit, mode))
return (-1);
/* XXX yet device mode = ppbus mode = chipset mode */
- dev->mode = ppb->mode = (mode & PPB_MASK);
+ dev->mode = ppb->mode = mode;
return (old_mode);
}
/*
- * ppb_write()
- *
- * Write charaters to the port
- */
-int
-ppb_write(struct ppb_device *dev, char *buf, int len, int how)
-{
- struct ppb_data *ppb = dev->ppb;
-
- return (ppb->ppb_link->adapter->write(ppb->ppb_link->adapter_unit,
- buf, len, how));
-}
-
-/*
* ppb_reset_epp_timeout()
*
* Reset the EPP timeout bit in the status register
@@ -157,7 +130,7 @@ ppb_reset_epp_timeout(struct ppb_device *dev)
if (ppb->ppb_owner != dev)
return (EACCES);
- (*ppb->ppb_link->adapter->reset_epp_timeout)(ppb->ppb_link->adapter_unit);
+ (*ppb->ppb_link->adapter->reset_epp_timeout)(dev->id_unit);
return (0);
}
@@ -175,7 +148,7 @@ ppb_ecp_sync(struct ppb_device *dev)
if (ppb->ppb_owner != dev)
return (EACCES);
- (*ppb->ppb_link->adapter->ecp_sync)(ppb->ppb_link->adapter_unit);
+ (*ppb->ppb_link->adapter->ecp_sync)(dev->id_unit);
return (0);
}
diff --git a/sys/dev/ppbus/ppb_msq.c b/sys/dev/ppbus/ppb_msq.c
index addcf041ab48..7e631e494521 100644
--- a/sys/dev/ppbus/ppb_msq.c
+++ b/sys/dev/ppbus/ppb_msq.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_msq.c,v 1.3 1998/09/20 14:41:54 nsouch Exp $
+ * $Id: ppb_msq.c,v 1.2 1998/09/13 18:26:26 nsouch Exp $
*
*/
#include <machine/stdarg.h>
@@ -272,19 +272,9 @@ ppb_MS_microseq(struct ppb_device *dev, struct ppb_microseq *msq, int *ret)
xfer = mode2xfer(dev, mi->opcode);
/* figure out if we should use ieee1284 code */
- if (!xfer->loop) {
- if (mi->opcode == MS_OP_PUT) {
- if ((error = ppb->ppb_link->adapter->write(
- ppb->ppb_link->adapter_unit,
- (char *)mi->arg[0].p,
- mi->arg[1].i, 0)))
- goto error;
-
- INCR_PC;
- goto next;
- } else
- panic("%s: IEEE1284 read not supported", __FUNCTION__);
- }
+ if (!xfer->loop)
+ panic("%s: IEEE1284 code not supported",
+ __FUNCTION__);
/* XXX should use ppb_MS_init_msq() */
initxfer[0].arg[0].p = mi->arg[0].p;
@@ -319,12 +309,10 @@ ppb_MS_microseq(struct ppb_device *dev, struct ppb_microseq *msq, int *ret)
* is unknown here
*/
if ((error = ppb->ppb_link->adapter->exec_microseq(
- ppb->ppb_link->adapter_unit,
- &mi)))
+ dev->id_unit, &mi)))
goto error;
break;
}
- next:
}
error:
return (error);
diff --git a/sys/dev/ppbus/ppb_msq.h b/sys/dev/ppbus/ppb_msq.h
index 4bba2997ac25..cdc815408d7f 100644
--- a/sys/dev/ppbus/ppb_msq.h
+++ b/sys/dev/ppbus/ppb_msq.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_msq.h,v 1.2 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_msq.h,v 1.1.2.7 1998/06/20 19:03:47 son Exp $
*
*/
#ifndef __PPB_MSQ_H
@@ -34,7 +34,7 @@
*/
/* microsequence parameter descriptor */
-#define MS_INS_MASK 0x00ff /* mask to retrieve the instruction position < 256 XXX */
+#define MS_INS_MASK 0x00ff /* mask to retrieve the instruction position */
#define MS_ARG_MASK 0x0f00 /* mask to retrieve the argument number */
#define MS_TYP_MASK 0xf000 /* mask to retrieve the type of the param */
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c
index 01ac663a2252..86ebe024e606 100644
--- a/sys/dev/ppbus/ppbconf.c
+++ b/sys/dev/ppbus/ppbconf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1997, 1998, 1999 Nicolas Souchu
+ * Copyright (c) 1997, 1998 Nicolas Souchu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppbconf.c,v 1.12 1999/01/11 21:22:41 nsouch Exp $
+ * $Id: ppbconf.c,v 1.7 1998/09/13 18:26:26 nsouch Exp $
*
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
#include <vm/vm.h>
@@ -37,8 +37,6 @@
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_1284.h>
-#include "opt_ppb_1284.h"
-
LIST_HEAD(, ppb_data) ppbdata; /* list of existing ppbus */
/*
@@ -82,30 +80,15 @@ ppb_alloc_bus(void)
return(ppb);
}
-#define PPB_PNP_PRINTER 0
-#define PPB_PNP_MODEM 1
-#define PPB_PNP_NET 2
-#define PPB_PNP_HDC 3
-#define PPB_PNP_PCMCIA 4
-#define PPB_PNP_MEDIA 5
-#define PPB_PNP_FDC 6
-#define PPB_PNP_PORTS 7
-#define PPB_PNP_SCANNER 8
-#define PPB_PNP_DIGICAM 9
-
-#ifndef DONTPROBE_1284
-
static char *pnp_tokens[] = {
"PRINTER", "MODEM", "NET", "HDC", "PCMCIA", "MEDIA",
"FDC", "PORTS", "SCANNER", "DIGICAM", "", NULL };
-#if 0
static char *pnp_classes[] = {
"printer", "modem", "network device",
"hard disk", "PCMCIA", "multimedia device",
"floppy disk", "ports", "scanner",
"digital camera", "unknown device", NULL };
-#endif
/*
* search_token()
@@ -151,40 +134,75 @@ search_token(char *str, int slen, char *token)
* Returns the class id. of the peripherial, -1 otherwise
*/
static int
-ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
+ppb_pnp_detect(struct ppb_data *ppb)
{
- char *token, *class = 0;
+ char *token, *q, *class = 0;
int i, len, error;
int class_id = -1;
char str[PPB_PnP_STRING_SIZE+1];
+ struct ppb_device pnpdev; /* temporary device to perform I/O */
- printf("Probing for PnP devices on ppbus%d:\n",
+ /* initialize the pnpdev structure for future use */
+ bzero(&pnpdev, sizeof(pnpdev));
+
+ pnpdev.ppb = ppb;
+
+ if (bootverbose)
+ printf("ppb: <PnP> probing devices on ppbus %d...\n",
ppb->ppb_link->adapter_unit);
-
- if ((error = ppb_1284_read_id(pnpdev, PPB_NIBBLE, str,
- PPB_PnP_STRING_SIZE, &len)))
+
+ if (ppb_request_bus(&pnpdev, PPB_DONTWAIT)) {
+ if (bootverbose)
+ printf("ppb: <PnP> cannot allocate ppbus!\n");
+ return (-1);
+ }
+
+ if ((error = ppb_1284_negociate(&pnpdev, NIBBLE_1284_REQUEST_ID))) {
+ if (bootverbose)
+ printf("ppb: <PnP> ppb_1284_negociate()=%d\n", error);
+
goto end_detect;
+ }
+
+ len = 0;
+ for (q=str; !(ppb_rstr(&pnpdev) & PERROR); q++) {
+ if ((error = nibble_1284_inbyte(&pnpdev, q))) {
+ if (bootverbose) {
+ *q = '\0';
+ printf("ppb: <PnP> len=%d, %s\n", len, str);
+ printf("ppb: <PnP> nibble_1284_inbyte()=%d\n",
+ error);
+ }
+ goto end_detect;
+ }
-#ifdef DEBUG_1284
- printf("ppb: <PnP> %d characters: ", len);
- for (i = 0; i < len; i++)
- printf("%c(0x%x) ", str[i], str[i]);
- printf("\n");
-#endif
+ if (len++ >= PPB_PnP_STRING_SIZE) {
+ printf("ppb: <PnP> not space left!\n");
+ goto end_detect;
+ }
+ }
+ *q = '\0';
+
+ nibble_1284_sync(&pnpdev);
+
+ if (bootverbose) {
+ printf("ppb: <PnP> %d characters: ", len);
+ for (i = 0; i < len; i++)
+ printf("0x%x ", str[i]);
+ printf("\n");
+ }
/* replace ';' characters by '\0' */
for (i = 0; i < len; i++)
str[i] = (str[i] == ';') ? '\0' : str[i];
- if ((token = search_token(str, len, "MFG")) != NULL ||
- (token = search_token(str, len, "MANUFACTURER")) != NULL)
+ if ((token = search_token(str, len, "MFG")) != NULL)
printf("ppbus%d: <%s", ppb->ppb_link->adapter_unit,
search_token(token, UNKNOWN_LENGTH, ":") + 1);
else
printf("ppbus%d: <unknown", ppb->ppb_link->adapter_unit);
- if ((token = search_token(str, len, "MDL")) != NULL ||
- (token = search_token(str, len, "MODEL")) != NULL)
+ if ((token = search_token(str, len, "MDL")) != NULL)
printf(" %s",
search_token(token, UNKNOWN_LENGTH, ":") + 1);
else
@@ -205,8 +223,7 @@ ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
printf(" %s", class);
}
- if ((token = search_token(str, len, "CMD")) != NULL ||
- (token = search_token(str, len, "COMMAND")) != NULL)
+ if ((token = search_token(str, len, "CMD")) != NULL)
printf(" %s",
search_token(token, UNKNOWN_LENGTH, ":") + 1);
@@ -224,120 +241,13 @@ ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
class_id = PPB_PnP_UNKNOWN;
end_detect:
- return (class_id);
-}
-
-/*
- * ppb_scan_bus()
- *
- * Scan the ppbus for IEEE1284 compliant devices
- */
-static int
-ppb_scan_bus(struct ppb_data *ppb)
-{
- struct ppb_device pnpdev; /* temporary device to perform I/O */
- int error = 0;
-
- /* initialize the pnpdev structure for future use */
- bzero(&pnpdev, sizeof(pnpdev));
- pnpdev.ppb = ppb;
-
- if ((error = ppb_request_bus(&pnpdev, PPB_DONTWAIT))) {
- if (bootverbose)
- printf("ppb: cannot allocate ppbus!\n");
-
- return (error);
- }
-
- /* try all IEEE1284 modes, for one device only
- *
- * XXX We should implement the IEEE1284.3 standard to detect
- * daisy chained devices
- */
-
- error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE, PPB_REQUEST_ID);
+ if ((error = ppb_1284_terminate(&pnpdev, VALID_STATE)) && bootverbose)
+ printf("ppb: ppb_1284_terminate()=%d\n", error);
- if ((ppb->state == PPB_ERROR) && (ppb->error == PPB_NOT_IEEE1284))
- goto end_scan;
-
- ppb_1284_terminate(&pnpdev);
-
- printf("ppb%d: IEEE1284 device found ", ppb->ppb_link->adapter_unit);
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE, 0))) {
- printf("/NIBBLE");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_PS2, 0))) {
- printf("/PS2");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP, 0))) {
- printf("/ECP");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP, PPB_USE_RLE))) {
- printf("/ECP_RLE");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_EPP, 0))) {
- printf("/EPP");
- ppb_1284_terminate(&pnpdev);
- }
-
- /* try more IEEE1284 modes */
- if (bootverbose) {
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE,
- PPB_REQUEST_ID))) {
- printf("/NIBBLE_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_PS2,
- PPB_REQUEST_ID))) {
- printf("/PS2_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP,
- PPB_REQUEST_ID))) {
- printf("/ECP_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP,
- PPB_REQUEST_ID | PPB_USE_RLE))) {
- printf("/ECP_RLE_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_COMPATIBLE,
- PPB_EXTENSIBILITY_LINK))) {
- printf("/Extensibility Link");
- ppb_1284_terminate(&pnpdev);
- }
- }
-
- printf("\n");
-
- /* detect PnP devices */
- ppb->class_id = ppb_pnp_detect(ppb, &pnpdev);
-
- ppb_release_bus(&pnpdev);
-
- return (0);
-
-end_scan:
ppb_release_bus(&pnpdev);
- return (error);
+ return (class_id);
}
-#endif /* !DONTPROBE_1284 */
-
/*
* ppb_attachdevs()
*
@@ -347,16 +257,18 @@ end_scan:
int
ppb_attachdevs(struct ppb_data *ppb)
{
+ int error;
struct ppb_device *dev;
struct ppb_driver **p_drvpp, *p_drvp;
LIST_INIT(&ppb->ppb_devs); /* initialise device/driver list */
p_drvpp = (struct ppb_driver **)ppbdriver_set.ls_items;
-#ifndef DONTPROBE_1284
- /* detect IEEE1284 compliant devices */
- ppb_scan_bus(ppb);
-#endif /* !DONTPROBE_1284 */
+/* XXX wait for ieee1284 good support */
+#if 0
+ /* detect PnP devices */
+ ppb->class_id = ppb_pnp_detect(ppb);
+#endif
/*
* Blindly try all probes here. Later we should look at
diff --git a/sys/dev/ppbus/ppbconf.h b/sys/dev/ppbus/ppbconf.h
index c47e4ab7d04d..80efe282a62b 100644
--- a/sys/dev/ppbus/ppbconf.h
+++ b/sys/dev/ppbus/ppbconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppbconf.h,v 1.10 1999/01/10 12:04:55 nsouch Exp $
+ * $Id: ppbconf.h,v 1.8 1998/09/13 18:26:26 nsouch Exp $
*
*/
#ifndef __PPBCONF_H
@@ -47,12 +47,7 @@
#define PPB_EPP 0x4 /* EPP mode, 32 bit */
#define PPB_ECP 0x8 /* ECP mode */
-/* mode aliases */
-#define PPB_SPP PPB_NIBBLE|PPB_PS2
-#define PPB_BYTE PPB_PS2
-
-#define PPB_MASK 0x0f
-#define PPB_OPTIONS_MASK 0xf0
+#define PPB_SPP PPB_NIBBLE|PPB_PS2
#define PPB_IS_EPP(mode) (mode & PPB_EPP)
#define PPB_IN_EPP_MODE(dev) (PPB_IS_EPP (ppb_get_mode (dev)))
@@ -108,8 +103,6 @@ struct ppb_status {
#define PPB_NOINTR 0
#define PPB_WAIT 0x1
#define PPB_INTR 0x2
-#define PPB_POLL 0x4
-#define PPB_FOREVER -1
/*
* Microsequence stuff.
@@ -151,14 +144,14 @@ struct ppb_context {
struct microseq *curmsq; /* currently executed microseqence */
};
+
struct ppb_device {
int id_unit; /* unit of the device */
char *name; /* name of the device */
ushort mode; /* current mode of the device */
- ushort avm; /* available IEEE1284 modes of
- * the device */
+ ushort avm; /* available modes of the device */
struct ppb_context ctx; /* context of the device */
@@ -191,8 +184,6 @@ struct ppb_adapter {
int (*exec_microseq)(int, struct ppb_microseq **);
int (*setmode)(int, int);
- int (*read)(int, char *, int, int);
- int (*write)(int, char *, int, int);
void (*outsb_epp)(int, char *, int);
void (*outsw_epp)(int, char *, int);
@@ -201,12 +192,12 @@ struct ppb_adapter {
void (*insw_epp)(int, char *, int);
void (*insl_epp)(int, char *, int);
- u_char (*r_dtr)(int);
- u_char (*r_str)(int);
- u_char (*r_ctr)(int);
- u_char (*r_epp)(int);
- u_char (*r_ecr)(int);
- u_char (*r_fifo)(int);
+ char (*r_dtr)(int);
+ char (*r_str)(int);
+ char (*r_ctr)(int);
+ char (*r_epp)(int);
+ char (*r_ecr)(int);
+ char (*r_fifo)(int);
void (*w_dtr)(int, char);
void (*w_str)(int, char);
@@ -239,7 +230,7 @@ struct ppb_link {
/*
* Maximum size of the PnP info string
*/
-#define PPB_PnP_STRING_SIZE 256 /* XXX */
+#define PPB_PnP_STRING_SIZE 128 /* XXX */
/*
* Parallel Port Bus structure.
@@ -259,11 +250,10 @@ struct ppb_data {
#define PPB_PnP_UNKNOWN 10
int class_id; /* not a PnP device if class_id < 0 */
- int state; /* current IEEE1284 state */
- int error; /* last IEEE1284 error */
-
ushort mode; /* IEEE 1284-1994 mode
* NIBBLE, PS2, EPP or ECP */
+ ushort avm; /* IEEE 1284-1994 available
+ * modes */
struct ppb_link *ppb_link; /* link to the adapter */
struct ppb_device *ppb_owner; /* device which owns the bus */
@@ -304,7 +294,6 @@ extern int ppb_ecp_sync(struct ppb_device *);
extern int ppb_get_status(struct ppb_device *, struct ppb_status *);
extern int ppb_set_mode(struct ppb_device *, int);
-extern int ppb_write(struct ppb_device *, char *, int, int);
/*
* These are defined as macros for speedup.
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index e0072f3e4cda..f742e4b56fae 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppi.c,v 1.8 1998/12/07 21:58:16 archie Exp $
+ * $Id: ppi.c,v 1.6 1998/01/02 09:30:39 msmith Exp $
*
*/
#include "ppi.h"
@@ -34,35 +34,18 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/uio.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
-#include <machine/clock.h>
-
#include <dev/ppbus/ppbconf.h>
-#include <dev/ppbus/ppb_msq.h>
-
-#include "opt_ppb_1284.h"
-
-#ifdef PERIPH_1284
-#include <dev/ppbus/ppb_1284.h>
-#endif
-
#include <dev/ppbus/ppi.h>
-#define BUFSIZE 512
struct ppi_data {
int ppi_unit;
int ppi_flags;
#define HAVE_PPBUS (1<<0)
-#define HAD_PPBUS (1<<1)
-
- int ppi_count;
- int ppi_mode; /* IEEE1284 mode */
- char ppi_buffer[BUFSIZE];
struct ppb_device ppi_dev;
};
@@ -87,41 +70,13 @@ DATA_SET(ppbdriver_set, ppidriver);
static d_open_t ppiopen;
static d_close_t ppiclose;
static d_ioctl_t ppiioctl;
-static d_write_t ppiwrite;
-static d_read_t ppiread;
#define CDEV_MAJOR 82
static struct cdevsw ppi_cdevsw =
- { ppiopen, ppiclose, ppiread, ppiwrite, /* 82 */
+ { ppiopen, ppiclose, noread, nowrite, /* 82 */
ppiioctl, nullstop, nullreset, nodevtotty,
seltrue, nommap, nostrat, "ppi", NULL, -1 };
-#ifdef PERIPH_1284
-
-static void
-ppi_enable_intr(struct ppi_data *ppi)
-{
- char r;
-
- r = ppb_rctr(&ppi->ppi_dev);
- ppb_wctr(&ppi->ppi_dev, r | IRQENABLE);
-
- return;
-}
-
-static void
-ppi_disable_intr(struct ppi_data *ppi)
-{
- char r;
-
- r = ppb_rctr(&ppi->ppi_dev);
- ppb_wctr(&ppi->ppi_dev, r & ~IRQENABLE);
-
- return;
-}
-
-#endif /* PERIPH_1284 */
-
/*
* ppiprobe()
*/
@@ -161,6 +116,8 @@ ppiprobe(struct ppb_data *ppb)
static int
ppiattach(struct ppb_device *dev)
{
+ struct ppi_data *ppi = ppidata[dev->id_unit];
+
/*
* Report ourselves
*/
@@ -170,72 +127,9 @@ ppiattach(struct ppb_device *dev)
return (1);
}
-/*
- * Cable
- * -----
- *
- * Use an IEEE1284 compliant (DB25/DB25) cable with the following tricks:
- *
- * nStrobe <-> nAck 1 <-> 10
- * nAutofd <-> Busy 11 <-> 14
- * nSelectin <-> Select 17 <-> 13
- * nInit <-> nFault 15 <-> 16
- *
- */
static void
ppiintr(int unit)
{
-#ifdef PERIPH_1284
- struct ppi_data *ppi = ppidata[unit];
-
- ppi_disable_intr(ppi);
-
- switch (ppi->ppi_dev.ppb->state) {
-
- /* accept IEEE1284 negociation then wakeup an waiting process to
- * continue negociation at process level */
- case PPB_FORWARD_IDLE:
- /* Event 1 */
- if ((ppb_rstr(&ppi->ppi_dev) & (SELECT | nBUSY)) ==
- (SELECT | nBUSY)) {
- /* IEEE1284 negociation */
-#ifdef DEBUG_1284
- printf("N");
-#endif
-
- /* Event 2 - prepare for reading the ext. value */
- ppb_wctr(&ppi->ppi_dev, (PCD | STROBE | nINIT) & ~SELECTIN);
-
- ppi->ppi_dev.ppb->state = PPB_NEGOCIATION;
-
- } else {
-#ifdef DEBUG_1284
- printf("0x%x", ppb_rstr(&ppi->ppi_dev));
-#endif
- ppb_peripheral_terminate(&ppi->ppi_dev, PPB_DONTWAIT);
- break;
- }
-
- /* wake up any process waiting for negociation from
- * remote master host */
-
- /* XXX should set a variable to warn the process about
- * the interrupt */
-
- wakeup(ppi);
- break;
- default:
-#ifdef DEBUG_1284
- printf("?%d", ppi->ppi_dev.ppb->state);
-#endif
- ppi->ppi_dev.ppb->state = PPB_FORWARD_IDLE;
- ppb_set_mode(&ppi->ppi_dev, PPB_COMPATIBLE);
- break;
- }
-
- ppi_enable_intr(ppi);
-#endif /* PERIPH_1284 */
-
return;
}
@@ -249,16 +143,11 @@ ppiopen(dev_t dev, int flags, int fmt, struct proc *p)
if (unit >= nppi)
return (ENXIO);
- if (!(ppi->ppi_flags & HAVE_PPBUS)) {
- if ((res = ppb_request_bus(&ppi->ppi_dev,
- (flags & O_NONBLOCK) ? PPB_DONTWAIT :
- (PPB_WAIT | PPB_INTR))))
+ if (!(ppi->ppi_flags & HAVE_PPBUS))
+ if ((res = ppb_request_bus(&ppi->ppi_dev, (flags & O_NONBLOCK) ? PPB_DONTWAIT : (PPB_WAIT | PPB_INTR))))
return (res);
- ppi->ppi_flags |= HAVE_PPBUS;
- }
- ppi->ppi_count += 1;
-
+ ppi->ppi_flags |= HAVE_PPBUS;
return (0);
}
@@ -268,206 +157,12 @@ ppiclose(dev_t dev, int flags, int fmt, struct proc *p)
u_int unit = minor(dev);
struct ppi_data *ppi = ppidata[unit];
- ppi->ppi_count --;
- if (!ppi->ppi_count) {
-
-#ifdef PERIPH_1284
- switch (ppi->ppi_dev.ppb->state) {
- case PPB_PERIPHERAL_IDLE:
- ppb_peripheral_terminate(&ppi->ppi_dev, 0);
- break;
- case PPB_REVERSE_IDLE:
- case PPB_EPP_IDLE:
- case PPB_ECP_FORWARD_IDLE:
- default:
- ppb_1284_terminate(&ppi->ppi_dev);
- break;
- }
-#endif /* PERIPH_1284 */
-
+ if (ppi->ppi_flags & HAVE_PPBUS)
ppb_release_bus(&ppi->ppi_dev);
- ppi->ppi_flags &= ~HAVE_PPBUS;
- }
-
+ ppi->ppi_flags &= ~HAVE_PPBUS;
return (0);
}
-/*
- * ppiread()
- *
- * IEEE1284 compliant read.
- *
- * First, try negociation to BYTE then NIBBLE mode
- * If no data is available, wait for it otherwise transfer as much as possible
- */
-static int
-ppiread(dev_t dev, struct uio *uio, int ioflag)
-{
-#ifdef PERIPH_1284
- u_int unit = minor(dev);
- struct ppi_data *ppi = ppidata[unit];
- int len, error = 0;
-
- switch (ppi->ppi_dev.ppb->state) {
- case PPB_PERIPHERAL_IDLE:
- ppb_peripheral_terminate(&ppi->ppi_dev, 0);
- /* fall throught */
-
- case PPB_FORWARD_IDLE:
- /* if can't negociate NIBBLE mode then try BYTE mode,
- * the peripheral may be a computer
- */
- if ((ppb_1284_negociate(&ppi->ppi_dev,
- ppi->ppi_mode = PPB_NIBBLE, 0))) {
-
- /* XXX Wait 2 seconds to let the remote host some
- * time to terminate its interrupt
- */
- tsleep(ppi, PPBPRI, "ppiread", 2*hz);
-
- if ((error = ppb_1284_negociate(&ppi->ppi_dev,
- ppi->ppi_mode = PPB_BYTE, 0)))
- return (error);
- }
- break;
-
- case PPB_REVERSE_IDLE:
- case PPB_EPP_IDLE:
- case PPB_ECP_FORWARD_IDLE:
- default:
- break;
- }
-
-#ifdef DEBUG_1284
- printf("N");
-#endif
- /* read data */
- len = 0;
- while (uio->uio_resid) {
- if ((error = ppb_1284_read(&ppi->ppi_dev, ppi->ppi_mode,
- ppi->ppi_buffer, min(BUFSIZE, uio->uio_resid),
- &len))) {
- goto error;
- }
-
- if (!len)
- goto error; /* no more data */
-
-#ifdef DEBUG_1284
- printf("d");
-#endif
- if ((error = uiomove(ppi->ppi_buffer, len, uio)))
- goto error;
- }
-
-error:
-
-#else /* PERIPH_1284 */
- int error = ENODEV;
-#endif
-
- return (error);
-}
-
-/*
- * ppiwrite()
- *
- * IEEE1284 compliant write
- *
- * Actually, this is the peripheral side of a remote IEEE1284 read
- *
- * The first part of the negociation (IEEE1284 device detection) is
- * done at interrupt level, then the remaining is done by the writing
- * process
- *
- * Once negociation done, transfer data
- */
-static int
-ppiwrite(dev_t dev, struct uio *uio, int ioflag)
-{
-#ifdef PERIPH_1284
- u_int unit = minor(dev);
- struct ppi_data *ppi = ppidata[unit];
- struct ppb_data *ppb = ppi->ppi_dev.ppb;
- int len, error = 0, sent;
-
-#if 0
- int ret;
-
- #define ADDRESS MS_PARAM(0, 0, MS_TYP_PTR)
- #define LENGTH MS_PARAM(0, 1, MS_TYP_INT)
-
- struct ppb_microseq msq[] = {
- { MS_OP_PUT, { MS_UNKNOWN, MS_UNKNOWN, MS_UNKNOWN } },
- MS_RET(0)
- };
-
- /* negociate ECP mode */
- if (ppb_1284_negociate(&ppi->ppi_dev, PPB_ECP, 0)) {
- printf("ppiwrite: ECP negociation failed\n");
- }
-
- while (!error && (len = min(uio->uio_resid, BUFSIZE))) {
- uiomove(ppi->ppi_buffer, len, uio);
-
- ppb_MS_init_msq(msq, 2, ADDRESS, ppi->ppi_buffer, LENGTH, len);
-
- error = ppb_MS_microseq(&ppi->ppi_dev, msq, &ret);
- }
-#endif
-
- /* we have to be peripheral to be able to send data, so
- * wait for the appropriate state
- */
- if (ppb->state < PPB_PERIPHERAL_NEGOCIATION)
- ppb_1284_terminate(&ppi->ppi_dev);
-
- while (ppb->state != PPB_PERIPHERAL_IDLE) {
- /* XXX should check a variable before sleeping */
-#ifdef DEBUG_1284
- printf("s");
-#endif
-
- ppi_enable_intr(ppi);
-
- /* sleep until IEEE1284 negociation starts */
- error = tsleep(ppi, PCATCH | PPBPRI, "ppiwrite", 0);
-
- switch (error) {
- case 0:
- /* negociate peripheral side with BYTE mode */
- ppb_peripheral_negociate(&ppi->ppi_dev, PPB_BYTE, 0);
- break;
- case EWOULDBLOCK:
- break;
- default:
- goto error;
- }
- }
-#ifdef DEBUG_1284
- printf("N");
-#endif
-
- /* negociation done, write bytes to master host */
- while (len = min(uio->uio_resid, BUFSIZE)) {
- uiomove(ppi->ppi_buffer, len, uio);
- if ((error = byte_peripheral_write(&ppi->ppi_dev,
- ppi->ppi_buffer, len, &sent)))
- goto error;
-#ifdef DEBUG_1284
- printf("d");
-#endif
- }
-
-error:
-
-#else /* PERIPH_1284 */
- int error = ENODEV;
-#endif
-
- return (error);
-}
-
static int
ppiioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
@@ -515,6 +210,7 @@ ppiioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
case PPISFIFO: /* write FIFO */
ppb_wfifo(&ppi->ppi_dev, *val);
break;
+
default:
error = ENOTTY;
break;
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index 95b255cb1bb3..9d1f20d9e04b 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: pps.c,v 1.11 1998/08/24 16:31:27 phk Exp $
+ * $Id: pps.c,v 1.10 1998/08/03 19:14:31 msmith Exp $
*
* This driver implements a draft-mogul-pps-api-02.txt PPS source.
*
@@ -153,6 +153,7 @@ ppsintr(int unit)
{
struct pps_data *sc = softc[unit];
struct timespec tc;
+ struct timeval tv;
nanotime(&tc);
if (!(ppb_rstr(&sc->pps_dev) & nACK))
@@ -170,8 +171,6 @@ ppsintr(int unit)
sc->ppsinfo.assert_sequence++;
#ifdef PPS_SYNC
if (sc->ppsparam.mode & PPS_HARDPPSONASSERT) {
- struct timeval tv;
-
tv.tv_sec = tc.tv_sec;
tv.tv_usec = tc.tv_nsec / 1000;
hardpps(&tv, tv.tv_usec);
diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c
index 17b67c5f632d..0585a497cd9b 100644
--- a/sys/dev/ppbus/vpo.c
+++ b/sys/dev/ppbus/vpo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vpo.c,v 1.10 1999/01/09 18:05:46 nsouch Exp $
+ * $Id: vpo.c,v 1.4 1997/09/01 00:51:52 bde Exp $
*
*/
@@ -51,8 +51,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/vpoio.h>
@@ -159,6 +157,7 @@ vpoprobe(struct ppb_data *ppb)
static int
vpoattach(struct ppb_device *dev)
{
+ struct scsibus_data *scbus;
struct vpo_data *vpo = vpodata[dev->id_unit];
struct cam_devq *devq;
@@ -212,11 +211,9 @@ vpoattach(struct ppb_device *dev)
static void
vpo_intr(struct vpo_data *vpo, struct ccb_scsiio *csio)
{
- int errno; /* error in errno.h */
+
+ int i, errno; /* error in errno.h */
int s;
-#ifdef VP0_DEBUG
- int i;
-#endif
s = splcam();
@@ -413,10 +410,6 @@ vpo_action(struct cam_sim *sim, union ccb *ccb)
printf("vpo%d: XPT_PATH_INQ request\n", vpo->vpo_unit);
#endif
cpi->version_num = 1; /* XXX??? */
- cpi->hba_inquiry = 0;
- cpi->target_sprt = 0;
- cpi->hba_misc = 0;
- cpi->hba_eng_cnt = 0;
cpi->max_target = 7;
cpi->max_lun = 0;
cpi->initiator_id = VP0_INITIATOR;
diff --git a/sys/dev/ppbus/vpoio.c b/sys/dev/ppbus/vpoio.c
index 54791ee44dcc..a416efefb8ef 100644
--- a/sys/dev/ppbus/vpoio.c
+++ b/sys/dev/ppbus/vpoio.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vpoio.c,v 1.4 1998/12/07 21:58:16 archie Exp $
+ * $Id: vpoio.c,v 1.2 1998/09/13 18:26:26 nsouch Exp $
*
*/
@@ -41,8 +41,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_msq.h>
#include <dev/ppbus/vpoio.h>
@@ -286,13 +284,8 @@ vpoio_connect(struct vpoio_data *vpo, int how)
int error;
int ret;
- if ((error = ppb_request_bus(&vpo->vpo_dev, how))) {
-
-#ifdef VP0_DEBUG
- printf("%s: can't request bus!\n", __FUNCTION__);
-#endif
+ if ((error = ppb_request_bus(&vpo->vpo_dev, how)))
return error;
- }
if (PPB_IN_EPP_MODE(&vpo->vpo_dev))
ppb_MS_microseq(&vpo->vpo_dev, connect_epp_microseq, &ret);
@@ -444,8 +437,8 @@ vpoio_outstr(struct vpoio_data *vpo, char *buffer, int size)
ppb_wctr(&vpo->vpo_dev,
H_AUTO | H_nSELIN | H_INIT | H_STROBE);
}
+ /* ppb_ecp_sync(&vpo->vpo_dev); */
#endif
- ppb_ecp_sync(&vpo->vpo_dev);
return (error);
}
@@ -456,7 +449,10 @@ vpoio_outstr(struct vpoio_data *vpo, char *buffer, int size)
static int
vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
{
+
+ register int k;
int error = 0;
+ int r, mode, epp;
ppb_MS_exec(&vpo->vpo_dev, MS_OP_GET, buffer, size, MS_UNKNOWN, &error);
@@ -483,8 +479,8 @@ vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
ppb_wctr(&vpo->vpo_dev, PCD |
H_AUTO | H_nSELIN | H_INIT | H_STROBE);
}
+ /* ppb_ecp_sync(&vpo->vpo_dev); */
#endif
- ppb_ecp_sync(&vpo->vpo_dev);
return (error);
}
@@ -492,6 +488,7 @@ vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
static char
vpoio_select(struct vpoio_data *vpo, int initiator, int target)
{
+ register int k;
int ret;
struct ppb_microseq select_microseq[] = {
@@ -708,10 +705,6 @@ vpoio_reset_bus(struct vpoio_data *vpo)
{
/* first, connect to the drive */
if (vpoio_connect(vpo, PPB_WAIT|PPB_INTR) || !vpoio_in_disk_mode(vpo)) {
-
-#ifdef VP0_DEBUG
- printf("%s: not in disk mode!\n", __FUNCTION__);
-#endif
/* release ppbus */
vpoio_disconnect(vpo);
return (1);
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index b5d29194430e..94719fb83ad6 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smb.c,v 1.5 1999/01/09 18:08:23 nsouch Exp $
+ * $Id: smb.c,v 1.2 1998/09/04 17:53:42 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -119,6 +119,8 @@ smb_probe(device_t dev)
static int
smb_attach(device_t dev)
{
+ struct smb_softc *sc = (struct smb_softc *)device_get_softc(dev);
+
return (0);
}
@@ -157,9 +159,24 @@ smbclose(dev_t dev, int flags, int fmt, struct proc *p)
static int
smbwrite(dev_t dev, struct uio * uio, int ioflag)
{
- /* not supported */
+ device_t smbdev = IIC_DEVICE(minor(dev));
+ struct smb_softc *sc = IIC_SOFTC(minor(dev));
+ int error, count;
- return (EINVAL);
+ if (!sc || !smbdev)
+ return (EINVAL);
+
+ if (sc->sc_count == 0)
+ return (EINVAL);
+
+ count = min(uio->uio_resid, BUFSIZE);
+ uiomove(sc->sc_buffer, count, uio);
+
+ /* we consider the command char as the first character to send */
+ smbus_bwrite(device_get_parent(smbdev), sc->sc_addr,
+ sc->sc_buffer[0], count-1, sc->sc_buffer+1);
+
+ return (0);
}
static int
@@ -180,62 +197,65 @@ smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
int error = 0;
struct smbcmd *s = (struct smbcmd *)data;
- if (!sc || !s)
+ if (!sc)
return (EINVAL);
switch (cmd) {
case SMB_QUICK_WRITE:
- error=smbus_quick(parent, s->slave, SMB_QWRITE);
+ smbus_quick(parent, sc->sc_addr, SMB_QWRITE);
goto end;
case SMB_QUICK_READ:
- error=smbus_quick(parent, s->slave, SMB_QREAD);
+ smbus_quick(parent, sc->sc_addr, SMB_QREAD);
goto end;
};
+ if (!s)
+ return (EINVAL);
+
switch (cmd) {
case SMB_SENDB:
- error=smbus_sendb(parent, s->slave, s->cmd);
+ smbus_sendb(parent, sc->sc_addr, s->cmd);
break;
case SMB_RECVB:
- error=smbus_recvb(parent, s->slave, &s->cmd);
+ smbus_recvb(parent, sc->sc_addr, &s->cmd);
break;
case SMB_WRITEB:
- error=smbus_writeb(parent, s->slave, s->cmd, s->data.byte);
+ smbus_writeb(parent, sc->sc_addr, s->cmd, s->data.byte);
break;
case SMB_WRITEW:
- error=smbus_writew(parent, s->slave, s->cmd, s->data.word);
+ smbus_writew(parent, sc->sc_addr, s->cmd, s->data.word);
break;
case SMB_READB:
if (s->data.byte_ptr)
- error=smbus_readb(parent, s->slave, s->cmd,
+ smbus_readb(parent, sc->sc_addr, s->cmd,
s->data.byte_ptr);
break;
case SMB_READW:
if (s->data.word_ptr)
- error=smbus_readw(parent, s->slave, s->cmd, s->data.word_ptr);
+ smbus_readw(parent, sc->sc_addr, s->cmd, s->data.word_ptr);
break;
case SMB_PCALL:
if (s->data.process.rdata)
- error=smbus_pcall(parent, s->slave, s->cmd,
+ smbus_pcall(parent, sc->sc_addr, s->cmd,
s->data.process.sdata, s->data.process.rdata);
break;
case SMB_BWRITE:
if (s->count && s->data.byte_ptr)
- error=smbus_bwrite(parent, s->slave, s->cmd, s->count,
+ smbus_bwrite(parent, sc->sc_addr, s->cmd, s->count,
s->data.byte_ptr);
break;
case SMB_BREAD:
if (s->count && s->data.byte_ptr)
- error=smbus_bread(parent, s->slave, s->cmd, s->count,
+ smbus_bread(parent, sc->sc_addr, s->cmd, s->count,
s->data.byte_ptr);
break;
diff --git a/sys/dev/smbus/smbconf.c b/sys/dev/smbus/smbconf.c
index 458916f8e8e8..60798f5c82dd 100644
--- a/sys/dev/smbus/smbconf.c
+++ b/sys/dev/smbus/smbconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
+ * $Id: smbconf.c,v 1.1.1.2 1998/08/13 15:16:57 son Exp $
*
*/
#include <sys/param.h>
@@ -65,29 +65,10 @@ smbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "smbus", -1, NULL);
- return (child);
-}
-
-static int
-smbus_poll(struct smbus_softc *sc, int how)
-{
- int error;
-
- switch (how) {
- case (SMB_WAIT | SMB_INTR):
- error = tsleep(sc, SMBPRI|PCATCH, "smbreq", 0);
- break;
-
- case (SMB_WAIT | SMB_NOINTR):
- error = tsleep(sc, SMBPRI, "smbreq", 0);
- break;
-
- default:
- return (EWOULDBLOCK);
- break;
- }
+ if (child)
+ device_set_desc(child, "System Management Bus");
- return (error);
+ return (child);
}
/*
@@ -103,20 +84,25 @@ smbus_request_bus(device_t bus, device_t dev, int how)
struct smbus_softc *sc = (struct smbus_softc *)device_get_softc(bus);
int s, error = 0;
- /* first, ask the underlying layers if the request is ok */
- do {
- error = SMBUS_CALLBACK(device_get_parent(bus),
- SMB_REQUEST_BUS, (caddr_t)&how);
- if (error)
- error = smbus_poll(sc, how);
- } while (error);
-
while (!error) {
s = splhigh();
if (sc->owner) {
splx(s);
- error = smbus_poll(sc, how);
+ switch (how) {
+ case (SMB_WAIT | SMB_INTR):
+ error = tsleep(sc, SMBPRI|PCATCH, "smbreq", 0);
+ break;
+
+ case (SMB_WAIT | SMB_NOINTR):
+ error = tsleep(sc, SMBPRI, "smbreq", 0);
+ break;
+
+ default:
+ return (EWOULDBLOCK);
+ break;
+ }
+
} else {
sc->owner = dev;
@@ -137,13 +123,7 @@ int
smbus_release_bus(device_t bus, device_t dev)
{
struct smbus_softc *sc = (struct smbus_softc *)device_get_softc(bus);
- int s, error;
-
- /* first, ask the underlying layers if the release is ok */
- error = SMBUS_CALLBACK(device_get_parent(bus), SMB_RELEASE_BUS, NULL);
-
- if (error)
- return (error);
+ int s;
s = splhigh();
if (sc->owner != dev) {
@@ -168,7 +148,7 @@ smbus_release_bus(device_t bus, device_t dev)
u_char
smbus_get_addr(device_t dev)
{
- uintptr_t addr;
+ u_long addr;
device_t parent = device_get_parent(dev);
BUS_READ_IVAR(parent, dev, SMBUS_IVAR_ADDR, &addr);
diff --git a/sys/dev/smbus/smbconf.h b/sys/dev/smbus/smbconf.h
index 0a442ec9633a..10fc3bcb011c 100644
--- a/sys/dev/smbus/smbconf.h
+++ b/sys/dev/smbus/smbconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbconf.h,v 1.1.1.1 1998/09/03 20:52:54 nsouch Exp $
+ * $Id: smbconf.h,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
*/
#ifndef __SMBONF_H
#define __SMBONF_H
@@ -43,18 +43,10 @@
#define SMB_INTR 0x2
/*
- * callback index
- */
-#define SMB_REQUEST_BUS 0x1
-#define SMB_RELEASE_BUS 0x2
-
-/*
* SMB bus errors
*/
#define SMB_ENOERR 0x0
#define SMB_EBUSERR 0x1
-#define SMB_ENOTSUPP 0x2
-#define SMB_ENOACK 0x3
/*
* How Quick command is executed
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index ca067103c43e..f9f787d3a471 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbus.c,v 1.6 1998/12/28 19:07:51 nsouch Exp $
+ * $Id: smbus.c,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
*
*/
#include <sys/param.h>
@@ -46,6 +46,7 @@
*/
struct smbus_device {
const char *smbd_name; /* device name */
+ const u_char smbd_addr; /* address of the device */
const char *smbd_desc; /* device descriptor */
};
@@ -53,7 +54,7 @@ struct smbus_device {
* list of known devices
*/
struct smbus_device smbus_children[] = {
- { "smb", "SMBus general purpose I/O" },
+ { "smb", 0, "General Call" },
{ NULL, 0 }
};
@@ -65,10 +66,7 @@ static devclass_t smbus_devclass;
static int smbus_probe(device_t);
static int smbus_attach(device_t);
static void smbus_print_child(device_t, device_t);
-
-#if 0
static int smbus_read_ivar(device_t , device_t, int, u_long *);
-#endif
static device_method_t smbus_methods[] = {
/* device interface */
@@ -79,8 +77,10 @@ static device_method_t smbus_methods[] = {
/* bus interface */
DEVMETHOD(bus_print_child, smbus_print_child),
- DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
+ DEVMETHOD(bus_read_ivar, smbus_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -100,7 +100,14 @@ static driver_t smbus_driver = {
static int
smbus_probe(device_t dev)
{
- device_set_desc(dev, "System Management Bus");
+ struct smbus_device *smbdev;
+ device_t child;
+
+ for (smbdev = smbus_children; smbdev->smbd_name; smbdev++) {
+
+ child = device_add_child(dev, smbdev->smbd_name, -1, smbdev);
+ device_set_desc(child, smbdev->smbd_desc);
+ }
return (0);
}
@@ -108,20 +115,10 @@ smbus_probe(device_t dev)
static int
smbus_attach(device_t dev)
{
- struct smbus_device *smbdev;
+ struct smbus_softc *sc = device_get_softc(dev);
+ device_t parent = device_get_parent(dev);
- /* add known devices */
- for (smbdev = smbus_children; smbdev->smbd_name; smbdev++) {
- device_t child;
-
- if (devclass_find(smbdev->smbd_name)) {
- child = device_add_child(dev, smbdev->smbd_name,
- -1, smbdev);
- device_set_desc(child, smbdev->smbd_desc);
- } else if (bootverbose)
- printf("smbus: %s devclass not found\n",
- smbdev->smbd_name);
- }
+ printf("Probing for devices on the SMB bus:\n");
bus_generic_attach(dev);
return (0);
@@ -136,27 +133,25 @@ smbus_generic_intr(device_t dev, u_char devaddr, char low, char high)
static void
smbus_print_child(device_t bus, device_t dev)
{
+ struct smbus_device* smbdev = DEVTOSMBUS(dev);
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
+ printf(" on %s%d addr 0x%x", device_get_name(bus),
+ device_get_unit(bus), smbdev->smbd_addr);
return;
}
-#if 0
static int
smbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
{
struct smbus_device* smbdev = DEVTOSMBUS(dev);
switch (index) {
- default:
+ case SMBUS_IVAR_ADDR:
+ *result = smbdev->smbd_addr;
break;
}
return (ENOENT);
}
-#endif
DRIVER_MODULE(smbus, iicsmb, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, bti2c, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, smbv, smbus_driver, smbus_devclass, 0, 0);
diff --git a/sys/dev/smbus/smbus_if.m b/sys/dev/smbus/smbus_if.m
index 3e118811b5b0..3c9ee5a0ecc1 100644
--- a/sys/dev/smbus/smbus_if.m
+++ b/sys/dev/smbus/smbus_if.m
@@ -23,13 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: smbus_if.m,v 1.3 1998/11/07 14:56:04 nsouch Exp $
+# $Id: smbus_if.m,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
#
-INTERFACE smbus;
+INTERFACE smbus
#
-# Interpret interrupt
+# Interprete interrupt
#
METHOD void intr {
device_t dev;
@@ -40,15 +40,6 @@ METHOD void intr {
};
#
-# smbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
# Quick command
#
METHOD int quick {
@@ -129,7 +120,7 @@ METHOD int pcall {
#
# Block Write command
#
-METHOD int bwrite {
+METHODE int bwrite {
device_t dev;
u_char slave;
char cmd;
@@ -140,7 +131,7 @@ METHOD int bwrite {
#
# Block Read command
#
-METHOD int bread {
+METHODE int bread {
device_t dev;
u_char slave;
char cmd;
diff --git a/sys/dev/syscons/scvesactl.c b/sys/dev/syscons/scvesactl.c
deleted file mode 100644
index 6f48630e276c..000000000000
--- a/sys/dev/syscons/scvesactl.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: $
- */
-
-#include "sc.h"
-#include "vga.h"
-#include "opt_syscons.h"
-#include "opt_vga.h"
-#include "opt_vesa.h"
-#include "opt_vm86.h"
-
-#ifdef VGA_NO_MODE_CHANGE
-#undef VESA
-#endif
-
-#if (NSC > 0 && NVGA > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-
-#include <machine/apm_bios.h>
-#include <machine/console.h>
-#include <machine/pc/vesa.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/syscons/syscons.h>
-
-static d_ioctl_t *prev_user_ioctl;
-
-static int
-vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- scr_stat *scp;
- struct tty *tp;
- int mode;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
-
- switch (cmd) {
-
- /* generic text modes */
- case SW_TEXT_132x25: case SW_TEXT_132x30:
- case SW_TEXT_132x43: case SW_TEXT_132x50:
- case SW_TEXT_132x60:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
-
- /* text modes */
- case SW_VESA_C80x60:
- case SW_VESA_C132x25:
- case SW_VESA_C132x43:
- case SW_VESA_C132x50:
- case SW_VESA_C132x60:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- mode = (cmd & 0xff) + M_VESA_BASE;
- return sc_set_text_mode(scp, tp, mode, 0, 0, 0);
-
- /* graphics modes */
- case SW_VESA_32K_320: case SW_VESA_64K_320:
- case SW_VESA_FULL_320:
-
- case SW_VESA_CG640x400:
-
- case SW_VESA_CG640x480:
- case SW_VESA_32K_640: case SW_VESA_64K_640:
- case SW_VESA_FULL_640:
-
- case SW_VESA_800x600: case SW_VESA_CG800x600:
- case SW_VESA_32K_800: case SW_VESA_64K_800:
- case SW_VESA_FULL_800:
-
- case SW_VESA_1024x768: case SW_VESA_CG1024x768:
- case SW_VESA_32K_1024: case SW_VESA_64K_1024:
- case SW_VESA_FULL_1024:
-
- case SW_VESA_1280x1024: case SW_VESA_CG1280x1024:
- case SW_VESA_32K_1280: case SW_VESA_64K_1280:
- case SW_VESA_FULL_1280:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- mode = (cmd & 0xff) + M_VESA_BASE;
- return sc_set_graphics_mode(scp, tp, mode);
- }
-
- if (prev_user_ioctl)
- return (*prev_user_ioctl)(dev, cmd, data, flag, p);
- else
- return ENOIOCTL;
-}
-
-int
-vesa_load_ioctl(void)
-{
- if (prev_user_ioctl)
- return EBUSY;
- prev_user_ioctl = sc_user_ioctl;
- sc_user_ioctl = vesa_ioctl;
- return 0;
-}
-
-int
-vesa_unload_ioctl(void)
-{
- if (sc_user_ioctl != vesa_ioctl)
- return EBUSY;
- sc_user_ioctl = prev_user_ioctl;
- prev_user_ioctl = NULL;
- return 0;
-}
-
-#endif /* (NSC > 0 && NVGA > 0 && VESA && VM86) || KLD_MODULE */
diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c
deleted file mode 100644
index 837402897470..000000000000
--- a/sys/dev/syscons/scvidctl.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*-
- * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: scvidctl.c,v 1.6 1999/01/11 03:18:26 yokota Exp $
- */
-
-#include "sc.h"
-#include "opt_syscons.h"
-
-#if NSC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-
-#ifdef __i386__
-#include <machine/apm_bios.h>
-#endif
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/syscons/syscons.h>
-
-/* for compatibility with previous versions */
-typedef struct old_video_adapter {
- int va_index;
- int va_type;
- int va_flags;
-#define V_ADP_COLOR (1<<0)
-#define V_ADP_MODECHANGE (1<<1)
-#define V_ADP_STATESAVE (1<<2)
-#define V_ADP_STATELOAD (1<<3)
-#define V_ADP_FONT (1<<4)
-#define V_ADP_PALETTE (1<<5)
-#define V_ADP_BORDER (1<<6)
-#define V_ADP_VESA (1<<7)
- int va_crtc_addr;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
-} old_video_adapter_t;
-
-#define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
-
-/* variables */
-extern scr_stat *cur_console;
-extern int fonts_loaded;
-extern int sc_history_size;
-extern u_char palette[];
-
-int
-sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* adjust argument values */
- if (fontsize <= 0)
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if ((xsize <= 0) || (xsize > info.vi_width))
- xsize = info.vi_width;
- if ((ysize <= 0) || (ysize > info.vi_height))
- ysize = info.vi_height;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- /*
- * This is a kludge to fend off scrn_update() while we
- * muck around with scp. XXX
- */
- scp->status |= UNKNOWN_MODE;
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->mode = mode;
- scp->font_size = fontsize;
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*fontsize;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
-{
- video_info_t info;
- int error;
- int s;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE);
- scp->status &= ~PIXEL_MODE;
- scp->mode = mode;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- /* clear_graphics();*/
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_xpixel != scp->xpixel
- || tp->t_winsize.ws_ypixel != scp->ypixel) {
- tp->t_winsize.ws_xpixel = scp->xpixel;
- tp->t_winsize.ws_ypixel = scp->ypixel;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return ENODEV; /* this shouldn't happen */
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- }
-#endif
-
- /* adjust argument values */
- if ((fontsize <= 0) || (fontsize == FONT_NONE))
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if (xsize <= 0)
- xsize = info.vi_width/8;
- if (ysize <= 0)
- ysize = info.vi_height/fontsize;
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- printf("set_pixel_mode(): window:%x, %dx%d, xoff:%d, yoff:%d\n",
- scp->adp->va_window, info.vi_width, info.vi_height,
- (info.vi_width/8 - xsize)/2,
- (info.vi_height/fontsize - ysize)/2);
- }
-#endif
-
- if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
- return EINVAL;
-
- /* only 16 color, 4 plane modes are supported XXX */
- if ((info.vi_depth != 4) || (info.vi_planes != 4))
- return ENODEV;
-
- /*
- * set_pixel_mode() currently does not support video modes whose
- * memory size is larger than 64K. Because such modes require
- * bank switching to access the entire screen. XXX
- */
- if (info.vi_width*info.vi_height/8 > info.vi_window_size)
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | MOUSE_ENABLED);
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->font_size = fontsize;
- scp->xoff = (scp->xpixel/8 - xsize)/2;
- scp->yoff = (scp->ypixel/fontsize - ysize)/2;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_border(scp, scp->border);
-
- scp->status &= ~UNKNOWN_MODE;
-
-#ifdef SC_VIDEO_DEBUG
- printf("set_pixel_mode(): status:%x\n", scp->status);
-#endif
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- scr_stat *scp;
- int error;
- int s;
-
- scp = sc_get_scr_stat(tp->t_dev);
-
- switch (cmd) {
-
- case CONS_CURRENT: /* get current adapter type */
- if (scp->adp == NULL)
- return ENODEV;
- *(int *)data = scp->adp->va_type;
- return 0;
-
- case CONS_CURRENTADP: /* get current adapter index */
- *(int *)data = scp->ad;
- return 0;
-
- case OLD_CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((old_video_adapter_t *)data)->va_index = scp->adp->va_index;
- ((old_video_adapter_t *)data)->va_type = scp->adp->va_type;
- ((old_video_adapter_t *)data)->va_flags = scp->adp->va_flags;
- ((old_video_adapter_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((old_video_adapter_t *)data)->va_window = scp->adp->va_window;
- ((old_video_adapter_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((old_video_adapter_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((old_video_adapter_t *)data)->va_buffer = scp->adp->va_buffer;
- ((old_video_adapter_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((old_video_adapter_t *)data)->va_mode = scp->adp->va_mode;
- ((old_video_adapter_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((old_video_adapter_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((video_adapter_info_t *)data)->va_index = scp->adp->va_index;
- ((video_adapter_info_t *)data)->va_type = scp->adp->va_type;
- bcopy(scp->adp->va_name, ((video_adapter_info_t *)data)->va_name,
- imin(strlen(scp->adp->va_name) + 1,
- sizeof(((video_adapter_info_t *)data)->va_name)));
- ((video_adapter_info_t *)data)->va_unit = scp->adp->va_unit;
- ((video_adapter_info_t *)data)->va_flags = scp->adp->va_flags;
- ((video_adapter_info_t *)data)->va_io_base = scp->adp->va_io_base;
- ((video_adapter_info_t *)data)->va_io_size = scp->adp->va_io_size;
- ((video_adapter_info_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((video_adapter_info_t *)data)->va_mem_base = scp->adp->va_mem_base;
- ((video_adapter_info_t *)data)->va_mem_size = scp->adp->va_mem_size;
- ((video_adapter_info_t *)data)->va_window = scp->adp->va_window;
- ((video_adapter_info_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((video_adapter_info_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((video_adapter_info_t *)data)->va_buffer = scp->adp->va_buffer;
- ((video_adapter_info_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((video_adapter_info_t *)data)->va_mode = scp->adp->va_mode;
- ((video_adapter_info_t *)data)->va_mode_flags = scp->adp->va_mode_flags;
- ((video_adapter_info_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((video_adapter_info_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_GET: /* get current video mode */
- *(int *)data = scp->mode;
- return 0;
-
- case CONS_MODEINFO: /* get mode information */
- return ((*vidsw[scp->ad]->get_info)(scp->adp,
- ((video_info_t *)data)->vi_mode, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_FINDMODE: /* find a matching video mode */
- return ((*vidsw[scp->ad]->query_mode)(scp->adp, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_SETWINORG:
- return ((*vidsw[scp->ad]->set_win_org)(scp->adp, *(u_int *)data)
- ? ENODEV : 0);
-
- /* generic text modes */
- case SW_TEXT_80x25: case SW_TEXT_80x30:
- case SW_TEXT_80x43: case SW_TEXT_80x50:
- case SW_TEXT_80x60:
- /* FALL THROUGH */
-
- /* VGA TEXT MODES */
- case SW_VGA_C40x25:
- case SW_VGA_C80x25: case SW_VGA_M80x25:
- case SW_VGA_C80x30: case SW_VGA_M80x30:
- case SW_VGA_C80x50: case SW_VGA_M80x50:
- case SW_VGA_C80x60: case SW_VGA_M80x60:
- case SW_B40x25: case SW_C40x25:
- case SW_B80x25: case SW_C80x25:
- case SW_ENH_B40x25: case SW_ENH_C40x25:
- case SW_ENH_B80x25: case SW_ENH_C80x25:
- case SW_ENH_B80x43: case SW_ENH_C80x43:
- case SW_EGAMONO80x25:
-
-#ifdef PC98
- /* PC98 TEXT MODES */
- case SW_PC98_80x25:
- case SW_PC98_80x30:
-#endif
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
-
- /* GRAPHICS MODES */
- case SW_BG320: case SW_BG640:
- case SW_CG320: case SW_CG320_D: case SW_CG640_E:
- case SW_CG640x350: case SW_ENH_CG640:
- case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
- case SW_VGA_MODEX:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_graphics_mode(scp, tp, cmd & 0xff);
-
- case KDSETMODE: /* set current mode of this (virtual) console */
- switch (*(int *)data) {
- case KD_TEXT: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- /* restore fonts & palette ! */
-#if 0
- if (ISFONTAVAIL(scp->adp->va_flags)
- && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- /*
- * FONT KLUDGE
- * Don't load fonts for now... XXX
- */
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- }
-#endif
- load_palette(scp->adp, palette);
-
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-
- /* FALL THROUGH */
-
- case KD_TEXT1: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text/pixel mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-#ifndef PC98
- scp->status |= UNKNOWN_MODE;
- splx(s);
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
-#else /* PC98 */
- scp->status &= ~UNKNOWN_MODE;
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- splx(s);
-#endif /* PC98 */
- return 0;
-
- case KD_PIXEL: /* pixel (raster) display */
- if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return EINVAL;
- if (scp->status & GRAPHICS_MODE)
- return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
- scp->font_size);
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- splx(s);
- if (scp == cur_console) {
- set_mode(scp);
- load_palette(scp->adp, palette);
- }
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
- return 0;
-
- case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= UNKNOWN_MODE;
- splx(s);
-#ifdef PC98
- if (scp == cur_console)
- set_mode(scp);
-#endif
- return 0;
-
- default:
- return EINVAL;
- }
- /* NOT REACHED */
-
- case KDRASTER: /* set pixel (raster) display mode */
- if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
- return ENODEV;
- return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
- ((int *)data)[2]);
-
- case KDGETMODE: /* get current mode of this (virtual) console */
- /*
- * From the user program's point of view, KD_PIXEL is the same
- * as KD_TEXT...
- */
- *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
- return 0;
-
- case KDSBORDER: /* set border color of this (virtual) console */
- scp->border = *data;
- if (scp == cur_console)
- set_border(scp, scp->border);
- return 0;
- }
-
- return ENOIOCTL;
-}
-
-#endif /* NSC > 0 */
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
deleted file mode 100644
index ce71733f1584..000000000000
--- a/sys/dev/syscons/syscons.c
+++ /dev/null
@@ -1,4529 +0,0 @@
-/*-
- * Copyright (c) 1992-1998 Søren Schmidt
- * 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, immediately at the beginning of the file.
- * 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.
- *
- * 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.
- *
- * $Id: syscons.c,v 1.292 1999/01/17 14:23:15 yokota Exp $
- */
-
-#include "sc.h"
-#include "splash.h"
-#ifdef __i386__
-#include "apm.h"
-#endif
-#include "opt_ddb.h"
-#include "opt_devfs.h"
-#ifdef __i386__
-#include "opt_vesa.h"
-#include "opt_vm86.h"
-#endif
-#include "opt_syscons.h"
-
-#if NSC > 0
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/reboot.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/signalvar.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#include <machine/bootinfo.h>
-#include <machine/clock.h>
-#include <machine/cons.h>
-#include <machine/console.h>
-#include <machine/mouse.h>
-#include <machine/md_var.h>
-#include <machine/psl.h>
-#include <machine/frame.h>
-#include <machine/pc/display.h>
-#ifdef __i386__
-#include <machine/pc/vesa.h>
-#include <machine/apm_bios.h>
-#include <machine/random.h>
-#endif
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
-#include <dev/fb/splashreg.h>
-#include <dev/syscons/syscons.h>
-
-#ifndef __i386__
-#include <isa/isareg.h>
-#else
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/timerreg.h>
-#endif
-
-#if !defined(MAXCONS)
-#define MAXCONS 16
-#endif
-
-#if !defined(SC_MAX_HISTORY_SIZE)
-#define SC_MAX_HISTORY_SIZE (1000 * MAXCONS)
-#endif
-
-#if !defined(SC_HISTORY_SIZE)
-#define SC_HISTORY_SIZE (ROW * 4)
-#endif
-
-#if (SC_HISTORY_SIZE * MAXCONS) > SC_MAX_HISTORY_SIZE
-#undef SC_MAX_HISTORY_SIZE
-#define SC_MAX_HISTORY_SIZE (SC_HISTORY_SIZE * MAXCONS)
-#endif
-
-#if !defined(SC_MOUSE_CHAR)
-#define SC_MOUSE_CHAR (0xd0)
-#endif
-
-#define COLD 0
-#define WARM 1
-
-#define DEFAULT_BLANKTIME (5*60) /* 5 minutes */
-#define MAX_BLANKTIME (7*24*60*60) /* 7 days!? */
-
-/* for backward compatibility */
-#define OLD_CONS_MOUSECTL _IOWR('c', 10, old_mouse_info_t)
-
-typedef struct old_mouse_data {
- int x;
- int y;
- int buttons;
-} old_mouse_data_t;
-
-typedef struct old_mouse_info {
- int operation;
- union {
- struct old_mouse_data data;
- struct mouse_mode mode;
- } u;
-} old_mouse_info_t;
-
-static default_attr user_default = {
- (FG_LIGHTGREY | BG_BLACK) << 8,
- (FG_BLACK | BG_LIGHTGREY) << 8
-};
-
-static default_attr kernel_default = {
- (FG_WHITE | BG_BLACK) << 8,
- (FG_BLACK | BG_LIGHTGREY) << 8
-};
-
-static scr_stat main_console;
-static scr_stat *console[MAXCONS];
-#ifdef DEVFS
-static void *sc_devfs_token[MAXCONS];
-static void *sc_mouse_devfs_token;
-static void *sc_console_devfs_token;
-#endif
- scr_stat *cur_console;
-static scr_stat *new_scp, *old_scp;
-static term_stat kernel_console;
-static default_attr *current_default;
-static int sc_flags;
-static char init_done = COLD;
-static u_short sc_buffer[ROW*COL];
-static char shutdown_in_progress = FALSE;
-static char font_loading_in_progress = FALSE;
-static char switch_in_progress = FALSE;
-static char write_in_progress = FALSE;
-static char blink_in_progress = FALSE;
-static int blinkrate = 0;
-static int adapter = -1;
-static int keyboard = -1;
-static keyboard_t *kbd;
-static int delayed_next_scr = FALSE;
-static long scrn_blank_time = 0; /* screen saver timeout value */
-static int scrn_blanked = FALSE; /* screen saver active flag */
-static long scrn_time_stamp;
-static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
-static int run_scrn_saver = FALSE; /* should run the saver? */
-static int scrn_idle = FALSE; /* about to run the saver */
-static int scrn_saver_failed;
- u_char scr_map[256];
- u_char scr_rmap[256];
-static int initial_video_mode; /* initial video mode # */
- int fonts_loaded = 0
-#ifdef STD8X16FONT
- | FONT_16
-#endif
- ;
-
- u_char font_8[256*8];
- u_char font_14[256*14];
-#ifdef STD8X16FONT
-extern
-#endif
- u_char font_16[256*16];
- u_char palette[256*3];
-static u_char *cut_buffer;
-static int cut_buffer_size;
-static int mouse_level; /* sysmouse protocol level */
-static mousestatus_t mouse_status = { 0, 0, 0, 0, 0, 0 };
-static u_short mouse_and_mask[16] = {
- 0xc000, 0xe000, 0xf000, 0xf800,
- 0xfc00, 0xfe00, 0xff00, 0xff80,
- 0xfe00, 0x1e00, 0x1f00, 0x0f00,
- 0x0f00, 0x0000, 0x0000, 0x0000
- };
-static u_short mouse_or_mask[16] = {
- 0x0000, 0x4000, 0x6000, 0x7000,
- 0x7800, 0x7c00, 0x7e00, 0x6800,
- 0x0c00, 0x0c00, 0x0600, 0x0600,
- 0x0000, 0x0000, 0x0000, 0x0000
- };
-
- int sc_history_size = SC_HISTORY_SIZE;
-static int extra_history_size =
- SC_MAX_HISTORY_SIZE - SC_HISTORY_SIZE * MAXCONS;
-
-static void none_saver(int blank) { }
-static void (*current_saver)(int blank) = none_saver;
- d_ioctl_t *sc_user_ioctl;
-
-static int sticky_splash = FALSE;
-static struct {
- u_int8_t cursor_start;
- u_int8_t cursor_end;
- u_int8_t shift_state;
- } bios_value;
-
-/* OS specific stuff */
-#ifdef not_yet_done
-#define VIRTUAL_TTY(x) (sccons[x] = ttymalloc(sccons[x]))
-struct CONSOLE_TTY (sccons[MAXCONS] = ttymalloc(sccons[MAXCONS]))
-struct MOUSE_TTY (sccons[MAXCONS+1] = ttymalloc(sccons[MAXCONS+1]))
-struct tty *sccons[MAXCONS+2];
-#else
-#define VIRTUAL_TTY(x) &sccons[x]
-#define CONSOLE_TTY &sccons[MAXCONS]
-#define MOUSE_TTY &sccons[MAXCONS+1]
-static struct tty sccons[MAXCONS+2];
-#endif
-#define SC_MOUSE 128
-#define SC_CONSOLE 255
-vm_offset_t Crtat;
-static const int nsccons = MAXCONS+2;
-
-#define WRAPHIST(scp, pointer, offset)\
- ((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \
- + (offset)) % (scp)->history_size))
-#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-
-/* some useful macros */
-#define kbd_read_char(kbd, wait) \
- (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait))
-#define kbd_check_char(kbd) \
- (*kbdsw[(kbd)->kb_index]->check_char)((kbd))
-#define kbd_enable(kbd) \
- (*kbdsw[(kbd)->kb_index]->enable)((kbd))
-#define kbd_disable(kbd) \
- (*kbdsw[(kbd)->kb_index]->disable)((kbd))
-#define kbd_lock(kbd, lockf) \
- (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf))
-#define kbd_ioctl(kbd, cmd, arg) \
- (((kbd) == NULL) ? \
- ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg)))
-#define kbd_clear_state(kbd) \
- (*kbdsw[(kbd)->kb_index]->clear_state)((kbd))
-#define kbd_get_fkeystr(kbd, fkey, len) \
- (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len))
-
-/* prototypes */
-static kbd_callback_func_t sckbdevent;
-static int scparam(struct tty *tp, struct termios *t);
-static int scvidprobe(int unit, int flags, int cons);
-static int sckbdprobe(int unit, int flags, int cons);
-static void scstart(struct tty *tp);
-static void scmousestart(struct tty *tp);
-static void scinit(void);
-static void scshutdown(int howto, void *arg);
-static u_int scgetc(keyboard_t *kbd, u_int flags);
-#define SCGETC_CN 1
-#define SCGETC_NONBLOCK 2
-static int sccngetch(int flags);
-static void sccnupdate(scr_stat *scp);
-static scr_stat *alloc_scp(void);
-static void init_scp(scr_stat *scp);
-static void get_bios_values(void);
-static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
-static int get_scr_num(void);
-static timeout_t scrn_timer;
-static void scrn_update(scr_stat *scp, int show_cursor);
-#if NSPLASH > 0
-static int scsplash_callback(int);
-static void scsplash_saver(int show);
-static int add_scrn_saver(void (*this_saver)(int));
-static int remove_scrn_saver(void (*this_saver)(int));
-static int set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border);
-static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
-static void stop_scrn_saver(void (*saver)(int));
-static int wait_scrn_saver_stop(void);
-#define scsplash_stick(stick) (sticky_splash = (stick))
-#else /* !NSPLASH */
-#define stop_scrn_saver(saver)
-#define wait_scrn_saver_stop() 0
-#define scsplash_stick(stick)
-#endif /* NSPLASH */
-static int switch_scr(scr_stat *scp, u_int next_scr);
-static void exchange_scr(void);
-static void scan_esc(scr_stat *scp, u_char c);
-static void ansi_put(scr_stat *scp, u_char *buf, int len);
-static void draw_cursor_image(scr_stat *scp);
-static void remove_cursor_image(scr_stat *scp);
-static void move_crsr(scr_stat *scp, int x, int y);
-static void history_to_screen(scr_stat *scp);
-static int history_up_line(scr_stat *scp);
-static int history_down_line(scr_stat *scp);
-static int mask2attr(struct term_stat *term);
-static int save_kbd_state(scr_stat *scp);
-static int update_kbd_state(int state, int mask);
-static int update_kbd_leds(int which);
-static void set_destructive_cursor(scr_stat *scp);
-static void set_mouse_pos(scr_stat *scp);
-static int skip_spc_right(scr_stat *scp, u_short *p);
-static int skip_spc_left(scr_stat *scp, u_short *p);
-static void mouse_cut(scr_stat *scp);
-static void mouse_cut_start(scr_stat *scp);
-static void mouse_cut_end(scr_stat *scp);
-static void mouse_cut_word(scr_stat *scp);
-static void mouse_cut_line(scr_stat *scp);
-static void mouse_cut_extend(scr_stat *scp);
-static void mouse_paste(scr_stat *scp);
-static void draw_mouse_image(scr_stat *scp);
-static void remove_mouse_image(scr_stat *scp);
-static void draw_cutmarking(scr_stat *scp);
-static void remove_cutmarking(scr_stat *scp);
-static void do_bell(scr_stat *scp, int pitch, int duration);
-static timeout_t blink_screen;
-
-#define CDEV_MAJOR 12
-
-#ifdef __i386__
-
-static cn_probe_t sccnprobe;
-static cn_init_t sccninit;
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-CONS_DRIVER(sc, sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc);
-
-#else /* !__i386__ */
-
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-struct consdev sc_cons = {
- NULL, NULL, sccngetc, sccncheckc, sccnputc,
- NULL, makedev(CDEV_MAJOR, 0), CN_NORMAL,
-};
-
-#endif /* __i386__ */
-
-static d_open_t scopen;
-static d_close_t scclose;
-static d_read_t scread;
-static d_write_t scwrite;
-static d_ioctl_t scioctl;
-static d_mmap_t scmmap;
-
-struct cdevsw sc_cdevsw = {
- scopen, scclose, scread, scwrite,
- scioctl, nullstop, noreset, scdevtotty,
- ttpoll, scmmap, nostrategy, "sc",
- NULL, -1, nodump, nopsize,
- D_TTY,
-};
-
-#ifdef __i386__
-
-#define fillw_io(p, b, c) fillw((p), (void *)(b), (c))
-
-#endif
-
-#ifdef __alpha__
-
-static void
-fillw(int pat, void *base, size_t cnt)
-{
- u_short *sp = base;
- while (cnt--)
- *sp++ = pat;
-}
-
-static void
-fillw_io(int pat, u_int32_t base, size_t cnt)
-{
- while (cnt--) {
- writew(base, pat);
- base += 2;
- }
-}
-
-#endif
-
-static void
-draw_cursor_image(scr_stat *scp)
-{
- u_short cursor_image;
- vm_offset_t ptr;
- u_short prev_image;
-
- if (ISPIXELSC(scp)) {
- sc_bcopy(scp, scp->scr_buf, scp->cursor_pos - scp->scr_buf,
- scp->cursor_pos - scp->scr_buf, 1);
- return;
- }
-
- ptr = scp->adp->va_window + 2*(scp->cursor_pos - scp->scr_buf);
-
- /* do we have a destructive cursor ? */
- if (sc_flags & CHAR_CURSOR) {
- prev_image = scp->cursor_saveunder;
- cursor_image = readw(ptr) & 0x00ff;
- if (cursor_image == DEAD_CHAR)
- cursor_image = prev_image & 0x00ff;
- cursor_image |= *(scp->cursor_pos) & 0xff00;
- scp->cursor_saveunder = cursor_image;
- /* update the cursor bitmap if the char under the cursor has changed */
- if (prev_image != cursor_image)
- set_destructive_cursor(scp);
- /* modify cursor_image */
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
- /*
- * When the mouse pointer is at the same position as the cursor,
- * the cursor bitmap needs to be updated even if the char under
- * the cursor hasn't changed, because the mouse pionter may
- * have moved by a few dots within the cursor cel.
- */
- if ((prev_image == cursor_image)
- && (cursor_image != *(scp->cursor_pos)))
- set_destructive_cursor(scp);
- cursor_image &= 0xff00;
- cursor_image |= DEAD_CHAR;
- }
- } else {
- cursor_image = (readw(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
- scp->cursor_saveunder = cursor_image;
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
- if ((cursor_image & 0x7000) == 0x7000) {
- cursor_image &= 0x8fff;
- if(!(cursor_image & 0x0700))
- cursor_image |= 0x0700;
- } else {
- cursor_image |= 0x7000;
- if ((cursor_image & 0x0700) == 0x0700)
- cursor_image &= 0xf0ff;
- }
- }
- }
- writew(ptr, cursor_image);
-}
-
-static void
-remove_cursor_image(scr_stat *scp)
-{
- if (ISPIXELSC(scp))
- sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
- scp->cursor_oldpos - scp->scr_buf, 0);
- else
- writew(scp->adp->va_window + 2*(scp->cursor_oldpos - scp->scr_buf),
- scp->cursor_saveunder);
-}
-
-static void
-move_crsr(scr_stat *scp, int x, int y)
-{
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- if (x >= scp->xsize)
- x = scp->xsize-1;
- if (y >= scp->ysize)
- y = scp->ysize-1;
- scp->xpos = x;
- scp->ypos = y;
- scp->cursor_pos = scp->scr_buf + scp->ypos * scp->xsize + scp->xpos;
-}
-
-int
-sc_probe_unit(int unit, int flags)
-{
- if (!scvidprobe(unit, flags, FALSE)) {
- if (bootverbose)
- printf("sc%d: no video adapter is found.\n", unit);
- return ENXIO;
- }
-
- return ((sckbdprobe(unit, flags, FALSE)) ? 0 : ENXIO);
-}
-
-/* probe video adapters, return TRUE if found */
-static int
-scvidprobe(int unit, int flags, int cons)
-{
- video_adapter_t *adp;
-
- /*
- * Access the video adapter driver through the back door!
- * Video adapter drivers need to be configured before syscons.
- * However, when syscons is being probed as the low-level console,
- * they have not been initialized yet. We force them to initialize
- * themselves here. XXX
- */
- vid_configure(cons ? VIO_PROBE_ONLY : 0);
-
- /* allocate a frame buffer */
- if (adapter < 0) {
- adapter = vid_allocate("*", -1, (void *)&adapter);
- if (adapter < 0)
- return FALSE;
- }
- adp = vid_get_adapter(adapter); /* shouldn't fail */
-
- Crtat = adp->va_window;
- initial_video_mode = adp->va_initial_mode;
-
- return TRUE;
-}
-
-/* probe the keyboard, return TRUE if found */
-static int
-sckbdprobe(int unit, int flags, int cons)
-{
- /* access the keyboard driver through the backdoor! */
- kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
-
- /* allocate a keyboard and register the keyboard event handler */
- if (keyboard < 0) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard, sckbdevent, NULL);
- if (keyboard < 0)
- return FALSE;
- }
- kbd = kbd_get_keyboard(keyboard); /* shouldn't fail */
-
- return TRUE;
-}
-
-#if NAPM > 0
-static int
-scresume(void *dummy)
-{
- if (kbd != NULL)
- kbd_clear_state(kbd);
- return 0;
-}
-#endif
-
-int
-sc_attach_unit(int unit, int flags)
-{
- scr_stat *scp;
-#if defined(VESA) && defined(VM86)
- video_info_t info;
-#endif
- dev_t cdev = makedev(CDEV_MAJOR, 0);
-#ifdef DEVFS
- int vc;
-#endif
-
- scinit();
- scp = console[0];
- sc_flags = flags;
- if (!ISFONTAVAIL(scp->adp->va_flags))
- sc_flags &= ~CHAR_CURSOR;
-
- /* copy temporary buffer to final buffer */
- scp->scr_buf = NULL;
- sc_alloc_scr_buffer(scp, FALSE, FALSE);
- bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
-
- /* cut buffer is available only when the mouse pointer is used */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
-
- /* initialize history buffer & pointers */
- sc_alloc_history_buffer(scp, sc_history_size, 0, FALSE);
-
-#if defined(VESA) && defined(VM86)
- if ((sc_flags & VESA800X600)
- && ((*vidsw[scp->ad]->get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
-#if NSPLASH > 0
- splash_term(scp->adp);
-#endif
- sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
- sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
- initial_video_mode = M_VESA_800x600;
-#if NSPLASH > 0
- /* put up the splash again! */
- splash_init(scp->adp, scsplash_callback);
-#endif
- }
-#endif /* VESA && VM86 */
-
- /* initialize cursor stuff */
- if (!ISGRAPHSC(scp))
- draw_cursor_image(scp);
-
- /* get screen update going */
- scrn_timer((void *)TRUE);
-
- /* set up the keyboard */
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
- update_kbd_state(scp->status, LOCK_MASK);
-
- if (bootverbose) {
- printf("sc%d:", unit);
- if (adapter >= 0)
- printf(" fb%d", adapter);
- if (keyboard >= 0)
- printf(" kbd%d", keyboard);
- printf("\n");
- }
- printf("sc%d: ", unit);
- switch(scp->adp->va_type) {
- case KD_VGA:
- printf("VGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
- break;
- case KD_EGA:
- printf("EGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
- break;
- case KD_CGA:
- printf("CGA");
- break;
- case KD_MONO:
- case KD_HERCULES:
- default:
- printf("MDA/Hercules");
- break;
- }
- printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, sc_flags);
-
-#if NAPM > 0
- scp->r_hook.ah_fun = scresume;
- scp->r_hook.ah_arg = NULL;
- scp->r_hook.ah_name = "system keyboard";
- scp->r_hook.ah_order = APM_MID_ORDER;
- apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
-#endif
-
- at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
-
- cdevsw_add(&cdev, &sc_cdevsw, NULL);
-
-#ifdef DEVFS
- for (vc = 0; vc < MAXCONS; vc++)
- sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
- sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, "sysmouse");
- sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600, "consolectl");
-#endif
- return 0;
-}
-
-struct tty
-*scdevtotty(dev_t dev)
-{
- int unit = minor(dev);
-
- if (init_done == COLD)
- return(NULL);
- if (unit == SC_CONSOLE)
- return CONSOLE_TTY;
- if (unit == SC_MOUSE)
- return MOUSE_TTY;
- if (unit >= MAXCONS || unit < 0)
- return(NULL);
- return VIRTUAL_TTY(unit);
-}
-
-int
-scopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- struct tty *tp = scdevtotty(dev);
- keyarg_t key;
- int s;
-
- if (!tp)
- return(ENXIO);
-
- tp->t_oproc = (minor(dev) == SC_MOUSE) ? scmousestart : scstart;
- tp->t_param = scparam;
- tp->t_dev = dev;
- if (!(tp->t_state & TS_ISOPEN)) {
- ttychars(tp);
- /* Use the current setting of the <-- key as default VERASE. */
- /* If the Delete key is preferable, an stty is necessary */
- key.keynum = 0x0e; /* how do we know this magic number... XXX */
- kbd_ioctl(kbd, GIO_KEYMAPENT, (caddr_t)&key);
- tp->t_cc[VERASE] = key.key.map[0];
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_cflag = TTYDEF_CFLAG;
- tp->t_lflag = TTYDEF_LFLAG;
- tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
- scparam(tp, &tp->t_termios);
- (*linesw[tp->t_line].l_modem)(tp, 1);
- if (minor(dev) == SC_MOUSE)
- mouse_level = 0; /* XXX */
- if (minor(dev) < MAXCONS && console[minor(dev)]) {
- s = spltty();
- sc_clean_up(console[minor(dev)]);
- splx(s);
- }
- }
- else
- if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
- return(EBUSY);
- if (minor(dev) < MAXCONS && !console[minor(dev)]) {
- console[minor(dev)] = alloc_scp();
- if (ISGRAPHSC(console[minor(dev)]))
- sc_set_pixel_mode(console[minor(dev)], NULL, COL, ROW, 16);
- }
- if (minor(dev)<MAXCONS && !tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
- tp->t_winsize.ws_col = console[minor(dev)]->xsize;
- tp->t_winsize.ws_row = console[minor(dev)]->ysize;
- }
- return ((*linesw[tp->t_line].l_open)(dev, tp));
-}
-
-int
-scclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- struct tty *tp = scdevtotty(dev);
- struct scr_stat *scp;
-
- if (!tp)
- return(ENXIO);
- if (minor(dev) < MAXCONS) {
- scp = sc_get_scr_stat(tp->t_dev);
- if (scp->status & SWITCH_WAIT_ACQ)
- wakeup((caddr_t)&scp->smode);
-#if not_yet_done
- if (scp == &main_console) {
- scp->pid = 0;
- scp->proc = NULL;
- scp->smode.mode = VT_AUTO;
- }
- else {
- free(scp->scr_buf, M_DEVBUF);
- if (scp->history != NULL) {
- free(scp->history, M_DEVBUF);
- if (scp->history_size / scp->xsize
- > imax(sc_history_size, scp->ysize))
- extra_history_size += scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize);
- }
- free(scp, M_DEVBUF);
- console[minor(dev)] = NULL;
- }
-#else
- scp->pid = 0;
- scp->proc = NULL;
- scp->smode.mode = VT_AUTO;
-#endif
- }
- spltty();
- (*linesw[tp->t_line].l_close)(tp, flag);
- ttyclose(tp);
- spl0();
- return(0);
-}
-
-int
-scread(dev_t dev, struct uio *uio, int flag)
-{
- struct tty *tp = scdevtotty(dev);
-
- if (!tp)
- return(ENXIO);
- return((*linesw[tp->t_line].l_read)(tp, uio, flag));
-}
-
-int
-scwrite(dev_t dev, struct uio *uio, int flag)
-{
- struct tty *tp = scdevtotty(dev);
-
- if (!tp)
- return(ENXIO);
- return((*linesw[tp->t_line].l_write)(tp, uio, flag));
-}
-
-static int
-sckbdevent(keyboard_t *thiskbd, int event, void *arg)
-{
- static struct tty *cur_tty;
- int c;
- size_t len;
- u_char *cp;
-
- /* assert(thiskbd == kbd) */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- kbd = NULL;
- kbd_release(thiskbd, (void *)&keyboard);
- return 0;
- default:
- return EINVAL;
- }
-
- /*
- * Loop while there is still input to get from the keyboard.
- * I don't think this is nessesary, and it doesn't fix
- * the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
- */
- while ((c = scgetc(thiskbd, SCGETC_NONBLOCK)) != NOKEY) {
-
- cur_tty = VIRTUAL_TTY(get_scr_num());
- if (!(cur_tty->t_state & TS_ISOPEN))
- if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
- continue;
-
- switch (KEYFLAGS(c)) {
- case 0x0000: /* normal key */
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
- break;
- case FKEY: /* function key, return string */
- cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
- if (cp != NULL) {
- while (len-- > 0)
- (*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
- }
- break;
- case MKEY: /* meta is active, prepend ESC */
- (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
- break;
- case BKEY: /* backtab fixed sequence (esc [ Z) */
- (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
- (*linesw[cur_tty->t_line].l_rint)('[', cur_tty);
- (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty);
- break;
- }
- }
-
- if (cur_console->status & MOUSE_VISIBLE) {
- remove_mouse_image(cur_console);
- cur_console->status &= ~MOUSE_VISIBLE;
- }
-
- return 0;
-}
-
-static int
-scparam(struct tty *tp, struct termios *t)
-{
- tp->t_ispeed = t->c_ispeed;
- tp->t_ospeed = t->c_ospeed;
- tp->t_cflag = t->c_cflag;
- return 0;
-}
-
-int
-scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- u_int delta_ehs;
- int error;
- int i;
- struct tty *tp;
- scr_stat *scp;
- int s;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
-
- /* If there is a user_ioctl function call that first */
- if (sc_user_ioctl) {
- error = (*sc_user_ioctl)(dev, cmd, data, flag, p);
- if (error != ENOIOCTL)
- return error;
- }
-
- error = sc_vid_ioctl(tp, cmd, data, flag, p);
- if (error != ENOIOCTL)
- return error;
-
- switch (cmd) { /* process console hardware related ioctl's */
-
- case GIO_ATTR: /* get current attributes */
- *(int*)data = (scp->term.cur_attr >> 8) & 0xFF;
- return 0;
-
- case GIO_COLOR: /* is this a color console ? */
- *(int *)data = (scp->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
- return 0;
-
- case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
- if (*(int *)data < 0 || *(int *)data > MAX_BLANKTIME)
- return EINVAL;
- s = spltty();
- scrn_blank_time = *(int *)data;
- run_scrn_saver = (scrn_blank_time != 0);
- splx(s);
- return 0;
-
- case CONS_CURSORTYPE: /* set cursor type blink/noblink */
- if ((*(int*)data) & 0x01)
- sc_flags |= BLINK_CURSOR;
- else
- sc_flags &= ~BLINK_CURSOR;
- if ((*(int*)data) & 0x02) {
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- sc_flags |= CHAR_CURSOR;
- } else
- sc_flags &= ~CHAR_CURSOR;
- /*
- * The cursor shape is global property; all virtual consoles
- * are affected. Update the cursor in the current console...
- */
- if (!ISGRAPHSC(cur_console)) {
- s = spltty();
- remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
- set_destructive_cursor(cur_console);
- draw_cursor_image(cur_console);
- splx(s);
- }
- return 0;
-
- case CONS_BELLTYPE: /* set bell type sound/visual */
- if ((*(int *)data) & 0x01)
- sc_flags |= VISUAL_BELL;
- else
- sc_flags &= ~VISUAL_BELL;
- if ((*(int *)data) & 0x02)
- sc_flags |= QUIET_BELL;
- else
- sc_flags &= ~QUIET_BELL;
- return 0;
-
- case CONS_HISTORY: /* set history size */
- if (*(int *)data > 0) {
- int lines; /* buffer size to allocate */
- int lines0; /* current buffer size */
-
- lines = imax(*(int *)data, scp->ysize);
- lines0 = (scp->history != NULL) ?
- scp->history_size / scp->xsize : scp->ysize;
- if (lines0 > imax(sc_history_size, scp->ysize))
- delta_ehs = lines0 - imax(sc_history_size, scp->ysize);
- else
- delta_ehs = 0;
- /*
- * syscons unconditionally allocates buffers upto SC_HISTORY_SIZE
- * lines or scp->ysize lines, whichever is larger. A value
- * greater than that is allowed, subject to extra_history_size.
- */
- if (lines > imax(sc_history_size, scp->ysize))
- if (lines - imax(sc_history_size, scp->ysize) >
- extra_history_size + delta_ehs)
- return EINVAL;
- if (cur_console->status & BUFFER_SAVED)
- return EBUSY;
- sc_alloc_history_buffer(scp, lines, delta_ehs, TRUE);
- return 0;
- }
- else
- return EINVAL;
-
- case CONS_MOUSECTL: /* control mouse arrow */
- case OLD_CONS_MOUSECTL:
- {
- /* MOUSE_BUTTON?DOWN -> MOUSE_MSC_BUTTON?UP */
- static int butmap[8] = {
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON1UP,
- 0,
- };
- mouse_info_t *mouse = (mouse_info_t*)data;
- mouse_info_t buf;
-
- /* FIXME: */
- if (!ISMOUSEAVAIL(scp->adp->va_flags))
- return ENODEV;
-
- if (cmd == OLD_CONS_MOUSECTL) {
- static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
- old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
-
- mouse = &buf;
- mouse->operation = old_mouse->operation;
- switch (mouse->operation) {
- case MOUSE_MODE:
- mouse->u.mode = old_mouse->u.mode;
- break;
- case MOUSE_SHOW:
- case MOUSE_HIDE:
- break;
- case MOUSE_MOVEABS:
- case MOUSE_MOVEREL:
- case MOUSE_ACTION:
- mouse->u.data.x = old_mouse->u.data.x;
- mouse->u.data.y = old_mouse->u.data.y;
- mouse->u.data.z = 0;
- mouse->u.data.buttons = swapb[old_mouse->u.data.buttons & 0x7];
- break;
- case MOUSE_GETINFO:
- old_mouse->u.data.x = scp->mouse_xpos;
- old_mouse->u.data.y = scp->mouse_ypos;
- old_mouse->u.data.buttons = swapb[scp->mouse_buttons & 0x7];
- break;
- default:
- return EINVAL;
- }
- }
-
- switch (mouse->operation) {
- case MOUSE_MODE:
- if (ISSIGVALID(mouse->u.mode.signal)) {
- scp->mouse_signal = mouse->u.mode.signal;
- scp->mouse_proc = p;
- scp->mouse_pid = p->p_pid;
- }
- else {
- scp->mouse_signal = 0;
- scp->mouse_proc = NULL;
- scp->mouse_pid = 0;
- }
- return 0;
-
- case MOUSE_SHOW:
- if (ISTEXTSC(scp) && !(scp->status & MOUSE_ENABLED)) {
- scp->status |= (MOUSE_ENABLED | MOUSE_VISIBLE);
- scp->mouse_oldpos = scp->mouse_pos;
- mark_all(scp);
- return 0;
- }
- else
- return EINVAL;
- break;
-
- case MOUSE_HIDE:
- if (ISTEXTSC(scp) && (scp->status & MOUSE_ENABLED)) {
- scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE);
- mark_all(scp);
- return 0;
- }
- else
- return EINVAL;
- break;
-
- case MOUSE_MOVEABS:
- scp->mouse_xpos = mouse->u.data.x;
- scp->mouse_ypos = mouse->u.data.y;
- set_mouse_pos(scp);
- break;
-
- case MOUSE_MOVEREL:
- scp->mouse_xpos += mouse->u.data.x;
- scp->mouse_ypos += mouse->u.data.y;
- set_mouse_pos(scp);
- break;
-
- case MOUSE_GETINFO:
- mouse->u.data.x = scp->mouse_xpos;
- mouse->u.data.y = scp->mouse_ypos;
- mouse->u.data.z = 0;
- mouse->u.data.buttons = scp->mouse_buttons;
- return 0;
-
- case MOUSE_ACTION:
- case MOUSE_MOTION_EVENT:
- /* this should maybe only be settable from /dev/consolectl SOS */
- /* send out mouse event on /dev/sysmouse */
-
- mouse_status.dx += mouse->u.data.x;
- mouse_status.dy += mouse->u.data.y;
- mouse_status.dz += mouse->u.data.z;
- if (mouse->operation == MOUSE_ACTION)
- mouse_status.button = mouse->u.data.buttons;
- mouse_status.flags |=
- ((mouse->u.data.x || mouse->u.data.y || mouse->u.data.z) ?
- MOUSE_POSCHANGED : 0)
- | (mouse_status.obutton ^ mouse_status.button);
- if (mouse_status.flags == 0)
- return 0;
-
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
- cur_console->status |= MOUSE_VISIBLE;
-
- if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
- u_char buf[MOUSE_SYS_PACKETSIZE];
- int j;
-
- /* the first five bytes are compatible with MouseSystems' */
- buf[0] = MOUSE_MSC_SYNC
- | butmap[mouse_status.button & MOUSE_STDBUTTONS];
- j = imax(imin(mouse->u.data.x, 255), -256);
- buf[1] = j >> 1;
- buf[3] = j - buf[1];
- j = -imax(imin(mouse->u.data.y, 255), -256);
- buf[2] = j >> 1;
- buf[4] = j - buf[2];
- for (j = 0; j < MOUSE_MSC_PACKETSIZE; j++)
- (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
- if (mouse_level >= 1) { /* extended part */
- j = imax(imin(mouse->u.data.z, 127), -128);
- buf[5] = (j >> 1) & 0x7f;
- buf[6] = (j - (j >> 1)) & 0x7f;
- /* buttons 4-10 */
- buf[7] = (~mouse_status.button >> 3) & 0x7f;
- for (j = MOUSE_MSC_PACKETSIZE;
- j < MOUSE_SYS_PACKETSIZE; j++)
- (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
- }
- }
-
- if (cur_console->mouse_signal) {
- cur_console->mouse_buttons = mouse->u.data.buttons;
- /* has controlling process died? */
- if (cur_console->mouse_proc &&
- (cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
- cur_console->mouse_signal = 0;
- cur_console->mouse_proc = NULL;
- cur_console->mouse_pid = 0;
- }
- else
- psignal(cur_console->mouse_proc, cur_console->mouse_signal);
- }
- else if (mouse->operation == MOUSE_ACTION && cut_buffer != NULL) {
- /* process button presses */
- if ((cur_console->mouse_buttons ^ mouse->u.data.buttons) &&
- ISTEXTSC(cur_console)) {
- cur_console->mouse_buttons = mouse->u.data.buttons;
- if (cur_console->mouse_buttons & MOUSE_BUTTON1DOWN)
- mouse_cut_start(cur_console);
- else
- mouse_cut_end(cur_console);
- if (cur_console->mouse_buttons & MOUSE_BUTTON2DOWN ||
- cur_console->mouse_buttons & MOUSE_BUTTON3DOWN)
- mouse_paste(cur_console);
- }
- }
-
- if (mouse->u.data.x != 0 || mouse->u.data.y != 0) {
- cur_console->mouse_xpos += mouse->u.data.x;
- cur_console->mouse_ypos += mouse->u.data.y;
- set_mouse_pos(cur_console);
- }
-
- break;
-
- case MOUSE_BUTTON_EVENT:
- if ((mouse->u.event.id & MOUSE_BUTTONS) == 0)
- return EINVAL;
- if (mouse->u.event.value < 0)
- return EINVAL;
-
- if (mouse->u.event.value > 0) {
- cur_console->mouse_buttons |= mouse->u.event.id;
- mouse_status.button |= mouse->u.event.id;
- } else {
- cur_console->mouse_buttons &= ~mouse->u.event.id;
- mouse_status.button &= ~mouse->u.event.id;
- }
- mouse_status.flags |= mouse_status.obutton ^ mouse_status.button;
- if (mouse_status.flags == 0)
- return 0;
-
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
- cur_console->status |= MOUSE_VISIBLE;
-
- if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
- u_char buf[8];
- int i;
-
- buf[0] = MOUSE_MSC_SYNC
- | butmap[mouse_status.button & MOUSE_STDBUTTONS];
- buf[7] = (~mouse_status.button >> 3) & 0x7f;
- buf[1] = buf[2] = buf[3] = buf[4] = buf[5] = buf[6] = 0;
- for (i = 0;
- i < ((mouse_level >= 1) ? MOUSE_SYS_PACKETSIZE
- : MOUSE_MSC_PACKETSIZE); i++)
- (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[i],MOUSE_TTY);
- }
-
- if (cur_console->mouse_signal) {
- if (cur_console->mouse_proc &&
- (cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
- cur_console->mouse_signal = 0;
- cur_console->mouse_proc = NULL;
- cur_console->mouse_pid = 0;
- }
- else
- psignal(cur_console->mouse_proc, cur_console->mouse_signal);
- break;
- }
-
- if (!ISTEXTSC(cur_console) || (cut_buffer == NULL))
- break;
-
- switch (mouse->u.event.id) {
- case MOUSE_BUTTON1DOWN:
- switch (mouse->u.event.value % 4) {
- case 0: /* up */
- mouse_cut_end(cur_console);
- break;
- case 1:
- mouse_cut_start(cur_console);
- break;
- case 2:
- mouse_cut_word(cur_console);
- break;
- case 3:
- mouse_cut_line(cur_console);
- break;
- }
- break;
- case MOUSE_BUTTON2DOWN:
- switch (mouse->u.event.value) {
- case 0: /* up */
- break;
- default:
- mouse_paste(cur_console);
- break;
- }
- break;
- case MOUSE_BUTTON3DOWN:
- switch (mouse->u.event.value) {
- case 0: /* up */
- if (!(cur_console->mouse_buttons & MOUSE_BUTTON1DOWN))
- mouse_cut_end(cur_console);
- break;
- default:
- mouse_cut_extend(cur_console);
- break;
- }
- break;
- }
- break;
-
- default:
- return EINVAL;
- }
- /* make screensaver happy */
- sc_touch_scrn_saver();
- return 0;
- }
-
- /* MOUSE_XXX: /dev/sysmouse ioctls */
- case MOUSE_GETHWINFO: /* get device information */
- {
- mousehw_t *hw = (mousehw_t *)data;
-
- if (tp != MOUSE_TTY)
- return ENOTTY;
- hw->buttons = 10; /* XXX unknown */
- hw->iftype = MOUSE_IF_SYSMOUSE;
- hw->type = MOUSE_MOUSE;
- hw->model = MOUSE_MODEL_GENERIC;
- hw->hwid = 0;
- return 0;
- }
-
- case MOUSE_GETMODE: /* get protocol/mode */
- {
- mousemode_t *mode = (mousemode_t *)data;
-
- if (tp != MOUSE_TTY)
- return ENOTTY;
- mode->level = mouse_level;
- switch (mode->level) {
- case 0:
- /* at this level, sysmouse emulates MouseSystems protocol */
- mode->protocol = MOUSE_PROTO_MSC;
- mode->rate = -1; /* unknown */
- mode->resolution = -1; /* unknown */
- mode->accelfactor = 0; /* disabled */
- mode->packetsize = MOUSE_MSC_PACKETSIZE;
- mode->syncmask[0] = MOUSE_MSC_SYNCMASK;
- mode->syncmask[1] = MOUSE_MSC_SYNC;
- break;
-
- case 1:
- /* at this level, sysmouse uses its own protocol */
- mode->protocol = MOUSE_PROTO_SYSMOUSE;
- mode->rate = -1;
- mode->resolution = -1;
- mode->accelfactor = 0;
- mode->packetsize = MOUSE_SYS_PACKETSIZE;
- mode->syncmask[0] = MOUSE_SYS_SYNCMASK;
- mode->syncmask[1] = MOUSE_SYS_SYNC;
- break;
- }
- return 0;
- }
-
- case MOUSE_SETMODE: /* set protocol/mode */
- {
- mousemode_t *mode = (mousemode_t *)data;
-
- if (tp != MOUSE_TTY)
- return ENOTTY;
- if ((mode->level < 0) || (mode->level > 1))
- return EINVAL;
- mouse_level = mode->level;
- return 0;
- }
-
- case MOUSE_GETLEVEL: /* get operation level */
- if (tp != MOUSE_TTY)
- return ENOTTY;
- *(int *)data = mouse_level;
- return 0;
-
- case MOUSE_SETLEVEL: /* set operation level */
- if (tp != MOUSE_TTY)
- return ENOTTY;
- if ((*(int *)data < 0) || (*(int *)data > 1))
- return EINVAL;
- mouse_level = *(int *)data;
- return 0;
-
- case MOUSE_GETSTATUS: /* get accumulated mouse events */
- if (tp != MOUSE_TTY)
- return ENOTTY;
- s = spltty();
- *(mousestatus_t *)data = mouse_status;
- mouse_status.flags = 0;
- mouse_status.obutton = mouse_status.button;
- mouse_status.dx = 0;
- mouse_status.dy = 0;
- mouse_status.dz = 0;
- splx(s);
- return 0;
-
-#if notyet
- case MOUSE_GETVARS: /* get internal mouse variables */
- case MOUSE_SETVARS: /* set internal mouse variables */
- if (tp != MOUSE_TTY)
- return ENOTTY;
- return ENODEV;
-#endif
-
- case MOUSE_READSTATE: /* read status from the device */
- case MOUSE_READDATA: /* read data from the device */
- if (tp != MOUSE_TTY)
- return ENOTTY;
- return ENODEV;
-
- case CONS_GETINFO: /* get current (virtual) console info */
- {
- vid_info_t *ptr = (vid_info_t*)data;
- if (ptr->size == sizeof(struct vid_info)) {
- ptr->m_num = get_scr_num();
- ptr->mv_col = scp->xpos;
- ptr->mv_row = scp->ypos;
- ptr->mv_csz = scp->xsize;
- ptr->mv_rsz = scp->ysize;
- ptr->mv_norm.fore = (scp->term.std_color & 0x0f00)>>8;
- ptr->mv_norm.back = (scp->term.std_color & 0xf000)>>12;
- ptr->mv_rev.fore = (scp->term.rev_color & 0x0f00)>>8;
- ptr->mv_rev.back = (scp->term.rev_color & 0xf000)>>12;
- ptr->mv_grfc.fore = 0; /* not supported */
- ptr->mv_grfc.back = 0; /* not supported */
- ptr->mv_ovscan = scp->border;
- if (scp == cur_console)
- save_kbd_state(scp);
- ptr->mk_keylock = scp->status & LOCK_MASK;
- return 0;
- }
- return EINVAL;
- }
-
- case CONS_GETVERS: /* get version number */
- *(int*)data = 0x200; /* version 2.0 */
- return 0;
-
- case CONS_IDLE: /* see if the screen has been idle */
- /*
- * When the screen is in the GRAPHICS_MODE or UNKNOWN_MODE,
- * the user process may have been writing something on the
- * screen and syscons is not aware of it. Declare the screen
- * is NOT idle if it is in one of these modes. But there is
- * an exception to it; if a screen saver is running in the
- * graphics mode in the current screen, we should say that the
- * screen has been idle.
- */
- *(int *)data = scrn_idle
- && (!ISGRAPHSC(cur_console)
- || (cur_console->status & SAVER_RUNNING));
- return 0;
-
- case CONS_SAVERMODE: /* set saver mode */
- switch(*(int *)data) {
- case CONS_USR_SAVER:
- /* if a LKM screen saver is running, stop it first. */
- scsplash_stick(FALSE);
- saver_mode = *(int *)data;
- s = spltty();
- if ((error = wait_scrn_saver_stop())) {
- splx(s);
- return error;
- }
- scp->status |= SAVER_RUNNING;
- scsplash_stick(TRUE);
- splx(s);
- break;
- case CONS_LKM_SAVER:
- s = spltty();
- if ((saver_mode == CONS_USR_SAVER) && (scp->status & SAVER_RUNNING))
- scp->status &= ~SAVER_RUNNING;
- saver_mode = *(int *)data;
- splx(s);
- break;
- default:
- return EINVAL;
- }
- return 0;
-
- case CONS_SAVERSTART: /* immediately start/stop the screen saver */
- /*
- * Note that this ioctl does not guarantee the screen saver
- * actually starts or stops. It merely attempts to do so...
- */
- s = spltty();
- run_scrn_saver = (*(int *)data != 0);
- if (run_scrn_saver)
- scrn_time_stamp -= scrn_blank_time;
- splx(s);
- return 0;
-
- case VT_SETMODE: /* set screen switcher mode */
- {
- struct vt_mode *mode;
-
- mode = (struct vt_mode *)data;
- if (ISSIGVALID(mode->relsig) && ISSIGVALID(mode->acqsig) &&
- ISSIGVALID(mode->frsig)) {
- bcopy(data, &scp->smode, sizeof(struct vt_mode));
- if (scp->smode.mode == VT_PROCESS) {
- scp->proc = p;
- scp->pid = scp->proc->p_pid;
- }
- return 0;
- } else
- return EINVAL;
- }
-
- case VT_GETMODE: /* get screen switcher mode */
- bcopy(&scp->smode, data, sizeof(struct vt_mode));
- return 0;
-
- case VT_RELDISP: /* screen switcher ioctl */
- switch(*(int *)data) {
- case VT_FALSE: /* user refuses to release screen, abort */
- if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
- old_scp->status &= ~SWITCH_WAIT_REL;
- switch_in_progress = FALSE;
- return 0;
- }
- return EINVAL;
-
- case VT_TRUE: /* user has released screen, go on */
- if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
- scp->status &= ~SWITCH_WAIT_REL;
- exchange_scr();
- if (new_scp->smode.mode == VT_PROCESS) {
- new_scp->status |= SWITCH_WAIT_ACQ;
- psignal(new_scp->proc, new_scp->smode.acqsig);
- }
- else
- switch_in_progress = FALSE;
- return 0;
- }
- return EINVAL;
-
- case VT_ACKACQ: /* acquire acknowledged, switch completed */
- if (scp == new_scp && (scp->status & SWITCH_WAIT_ACQ)) {
- scp->status &= ~SWITCH_WAIT_ACQ;
- switch_in_progress = FALSE;
- return 0;
- }
- return EINVAL;
-
- default:
- return EINVAL;
- }
- /* NOT REACHED */
-
- case VT_OPENQRY: /* return free virtual console */
- for (i = 0; i < MAXCONS; i++) {
- tp = VIRTUAL_TTY(i);
- if (!(tp->t_state & TS_ISOPEN)) {
- *(int *)data = i + 1;
- return 0;
- }
- }
- return EINVAL;
-
- case VT_ACTIVATE: /* switch to screen *data */
- s = spltty();
- sc_clean_up(cur_console);
- splx(s);
- return switch_scr(scp, *(int *)data - 1);
-
- case VT_WAITACTIVE: /* wait for switch to occur */
- if (*(int *)data > MAXCONS || *(int *)data < 0)
- return EINVAL;
- s = spltty();
- error = sc_clean_up(cur_console);
- splx(s);
- if (error)
- return error;
- if (minor(dev) == *(int *)data - 1)
- return 0;
- if (*(int *)data == 0) {
- if (scp == cur_console)
- return 0;
- }
- else
- scp = console[*(int *)data - 1];
- while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
- "waitvt", 0)) == ERESTART) ;
- return error;
-
- case VT_GETACTIVE:
- *(int *)data = get_scr_num()+1;
- return 0;
-
- case KDENABIO: /* allow io operations */
- error = suser(p->p_ucred, &p->p_acflag);
- if (error != 0)
- return error;
- if (securelevel > 0)
- return EPERM;
-#ifdef __i386__
- p->p_md.md_regs->tf_eflags |= PSL_IOPL;
-#endif
- return 0;
-
- case KDDISABIO: /* disallow io operations (default) */
-#ifdef __i386__
- p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
-#endif
- return 0;
-
- case KDSKBSTATE: /* set keyboard state (locks) */
- if (*(int *)data & ~LOCK_MASK)
- return EINVAL;
- scp->status &= ~LOCK_MASK;
- scp->status |= *(int *)data;
- if (scp == cur_console)
- update_kbd_state(scp->status, LOCK_MASK);
- return 0;
-
- case KDGKBSTATE: /* get keyboard state (locks) */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LOCK_MASK;
- return 0;
-
- case KDSETRAD: /* set keyboard repeat & delay rates */
- if (*(int *)data & ~0x7f)
- return EINVAL;
- error = kbd_ioctl(kbd, KDSETRAD, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
- case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)data) {
- case K_XLATE: /* switch to XLT ascii mode */
- case K_RAW: /* switch to RAW scancode mode */
- case K_CODE: /* switch to CODE mode */
- scp->kbd_mode = *(int *)data;
- if (scp == cur_console)
- kbd_ioctl(kbd, cmd, data);
- return 0;
- default:
- return EINVAL;
- }
- /* NOT REACHED */
-
- case KDGKBMODE: /* get keyboard mode */
- *(int *)data = scp->kbd_mode;
- return 0;
-
- case KDGKBINFO:
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
- case KDMKTONE: /* sound the bell */
- if (*(int*)data)
- do_bell(scp, (*(int*)data)&0xffff,
- (((*(int*)data)>>16)&0xffff)*hz/1000);
- else
- do_bell(scp, scp->bell_pitch, scp->bell_duration);
- return 0;
-
- case KIOCSOUND: /* make tone (*data) hz */
-#ifdef __i386__
- if (scp == cur_console) {
- if (*(int*)data) {
- int pitch = timer_freq / *(int*)data;
-
- /* set command for counter 2, 2 byte write */
- if (acquire_timer2(TIMER_16BIT|TIMER_SQWAVE))
- return EBUSY;
-
- /* set pitch */
- outb(TIMER_CNTR2, pitch);
- outb(TIMER_CNTR2, (pitch>>8));
-
- /* enable counter 2 output to speaker */
- outb(IO_PPI, inb(IO_PPI) | 3);
- }
- else {
- /* disable counter 2 output to speaker */
- outb(IO_PPI, inb(IO_PPI) & 0xFC);
- release_timer2();
- }
- }
-#endif /* __i386__ */
- return 0;
-
- case KDGKBTYPE: /* get keyboard type */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL) {
- /* always return something? XXX */
- *(int *)data = 0;
- }
- return 0;
-
- case KDSETLED: /* set keyboard LED status */
- if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
- return EINVAL;
- scp->status &= ~LED_MASK;
- scp->status |= *(int *)data;
- if (scp == cur_console)
- update_kbd_leds(scp->status);
- return 0;
-
- case KDGETLED: /* get keyboard LED status */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LED_MASK;
- return 0;
-
- case CONS_SETKBD: /* set the new keyboard */
- {
- keyboard_t *newkbd;
-
- s = spltty();
- newkbd = kbd_get_keyboard(*(int *)data);
- if (newkbd == NULL) {
- splx(s);
- return EINVAL;
- }
- error = 0;
- if (kbd != newkbd) {
- i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
- (void *)&keyboard, sckbdevent, NULL);
- /* i == newkbd->kb_index */
- if (i >= 0) {
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- kbd_release(kbd, (void *)&keyboard);
- }
- kbd = kbd_get_keyboard(i); /* kbd == newkbd */
- keyboard = i;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- } else {
- error = EPERM; /* XXX */
- }
- }
- splx(s);
- return error;
- }
-
- case CONS_RELKBD: /* release the current keyboard */
- s = spltty();
- error = 0;
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- error = kbd_release(kbd, (void *)&keyboard);
- if (error == 0) {
- kbd = NULL;
- keyboard = -1;
- }
- }
- splx(s);
- return error;
-
- case GIO_SCRNMAP: /* get output translation table */
- bcopy(&scr_map, data, sizeof(scr_map));
- return 0;
-
- case PIO_SCRNMAP: /* set output translation table */
- bcopy(data, &scr_map, sizeof(scr_map));
- for (i=0; i<sizeof(scr_map); i++)
- scr_rmap[scr_map[i]] = i;
- return 0;
-
- case GIO_KEYMAP: /* get keyboard translation table */
- case PIO_KEYMAP: /* set keyboard translation table */
- case GIO_DEADKEYMAP: /* get accent key translation table */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- case GETFKEY: /* get function key string */
- case SETFKEY: /* set function key string */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
- case PIO_FONT8x8: /* set 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- bcopy(data, font_8, 8*256);
- fonts_loaded |= FONT_8;
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- * Don't load if the current font size is not 8x8.
- */
- if (ISTEXTSC(cur_console) && (cur_console->font_size < 14))
- copy_font(cur_console, LOAD, 8, font_8);
- return 0;
-
- case GIO_FONT8x8: /* get 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- if (fonts_loaded & FONT_8) {
- bcopy(font_8, data, 8*256);
- return 0;
- }
- else
- return ENXIO;
-
- case PIO_FONT8x14: /* set 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- bcopy(data, font_14, 14*256);
- fonts_loaded |= FONT_14;
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- * Don't load if the current font size is not 8x14.
- */
- if (ISTEXTSC(cur_console)
- && (cur_console->font_size >= 14) && (cur_console->font_size < 16))
- copy_font(cur_console, LOAD, 14, font_14);
- return 0;
-
- case GIO_FONT8x14: /* get 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- if (fonts_loaded & FONT_14) {
- bcopy(font_14, data, 14*256);
- return 0;
- }
- else
- return ENXIO;
-
- case PIO_FONT8x16: /* set 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- bcopy(data, font_16, 16*256);
- fonts_loaded |= FONT_16;
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- * Don't load if the current font size is not 8x16.
- */
- if (ISTEXTSC(cur_console) && (cur_console->font_size >= 16))
- copy_font(cur_console, LOAD, 16, font_16);
- return 0;
-
- case GIO_FONT8x16: /* get 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
- return ENXIO;
- if (fonts_loaded & FONT_16) {
- bcopy(font_16, data, 16*256);
- return 0;
- }
- else
- return ENXIO;
- default:
- break;
- }
-
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
- if (error != ENOIOCTL)
- return(error);
- error = ttioctl(tp, cmd, data, flag);
- if (error != ENOIOCTL)
- return(error);
- return(ENOTTY);
-}
-
-static void
-scstart(struct tty *tp)
-{
- struct clist *rbp;
- int s, len;
- u_char buf[PCBURST];
- scr_stat *scp = sc_get_scr_stat(tp->t_dev);
-
- if (scp->status & SLKED || blink_in_progress)
- return; /* XXX who repeats the call when the above flags are cleared? */
- s = spltty();
- if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
- tp->t_state |= TS_BUSY;
- rbp = &tp->t_outq;
- while (rbp->c_cc) {
- len = q_to_b(rbp, buf, PCBURST);
- splx(s);
- ansi_put(scp, buf, len);
- s = spltty();
- }
- tp->t_state &= ~TS_BUSY;
- ttwwakeup(tp);
- }
- splx(s);
-}
-
-static void
-scmousestart(struct tty *tp)
-{
- struct clist *rbp;
- int s;
- u_char buf[PCBURST];
-
- s = spltty();
- if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
- tp->t_state |= TS_BUSY;
- rbp = &tp->t_outq;
- while (rbp->c_cc) {
- q_to_b(rbp, buf, PCBURST);
- }
- tp->t_state &= ~TS_BUSY;
- ttwwakeup(tp);
- }
- splx(s);
-}
-
-#if __i386__
-
-/* XXX kludge! */
-extern struct isa_driver scdriver;
-
-static void
-sccnprobe(struct consdev *cp)
-{
- struct isa_device *dvp;
-
- /*
- * Take control if we are the highest priority enabled display device.
- */
- dvp = find_display();
- if (dvp == NULL || dvp->id_driver != &scdriver) {
- cp->cn_pri = CN_DEAD;
- return;
- }
-
- if (!scvidprobe(dvp->id_unit, dvp->id_flags, TRUE)) {
- cp->cn_pri = CN_DEAD;
- return;
- }
- sckbdprobe(dvp->id_unit, dvp->id_flags, TRUE);
-
- /* initialize required fields */
- cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
- cp->cn_pri = CN_INTERNAL;
-}
-
-static void
-sccninit(struct consdev *cp)
-{
- scinit();
-}
-
-#else /* !__i386__ */
-
-extern struct consdev *cn_tab;
-
-void
-sccnattach(void)
-{
- if (!scvidprobe(0, 0, TRUE) || !sckbdprobe(0, 0, TRUE)) {
- return;
- }
-
- scinit();
- cn_tab = &sc_cons;
-}
-
-#endif /* __i386__ */
-
-static void
-sccnputc(dev_t dev, int c)
-{
- u_char buf[1];
- scr_stat *scp = console[0];
- term_stat save = scp->term;
- u_short *p;
- int s;
- int i;
-
- if (scp == cur_console && scp->status & SLKED) {
- scp->status &= ~SLKED;
- update_kbd_state(scp->status, SLKED);
- if (cur_console->status & BUFFER_SAVED) {
- p = cur_console->history_save;
- for (i = 0; i < cur_console->ysize; ++i) {
- bcopy(p, cur_console->scr_buf + (cur_console->xsize*i),
- cur_console->xsize*sizeof(u_short));
- p += cur_console->xsize;
- if (p + cur_console->xsize
- > cur_console->history + cur_console->history_size)
- p = cur_console->history;
- }
- cur_console->status &= ~BUFFER_SAVED;
- cur_console->history_head = cur_console->history_save;
- cur_console->status |= CURSOR_ENABLED;
- mark_all(cur_console);
- }
-#if 1 /* XXX */
- scstart(VIRTUAL_TTY(get_scr_num()));
-#endif
- }
-
- scp->term = kernel_console;
- current_default = &kernel_default;
- if (scp == cur_console && !ISGRAPHSC(scp))
- remove_cursor_image(scp);
- buf[0] = c;
- ansi_put(scp, buf, 1);
- kernel_console = scp->term;
- current_default = &user_default;
- scp->term = save;
-
- s = spltty(); /* block sckbdevent and scrn_timer */
- sccnupdate(scp);
- splx(s);
-}
-
-static int
-sccngetc(dev_t dev)
-{
- return sccngetch(0);
-}
-
-static int
-sccncheckc(dev_t dev)
-{
- return sccngetch(SCGETC_NONBLOCK);
-}
-
-static int
-sccngetch(int flags)
-{
- int cur_mode;
- int s = spltty(); /* block sckbdevent and scrn_timer while we poll */
- int c;
-
- /*
- * Stop the screen saver and update the screen if necessary.
- * What if we have been running in the screen saver code... XXX
- */
- sc_touch_scrn_saver();
- sccnupdate(cur_console);
-
- if (kbd == NULL) {
- splx(s);
- return -1;
- }
-
- /*
- * Make sure the keyboard is accessible even when the kbd device
- * driver is disabled.
- */
- kbd_enable(kbd);
-
- /* we shall always use the keyboard in the XLATE mode here */
- cur_mode = cur_console->kbd_mode;
- cur_console->kbd_mode = K_XLATE;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
-
- c = scgetc(kbd, SCGETC_CN | flags);
-
- cur_console->kbd_mode = cur_mode;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- kbd_disable(kbd);
- splx(s);
-
- switch (KEYFLAGS(c)) {
- case 0: /* normal char */
- return KEYCHAR(c);
- case FKEY: /* function key */
- return c; /* XXX */
- case NOKEY:
- case ERRKEY:
- default:
- return -1;
- }
- /* NOT REACHED */
-}
-
-static void
-sccnupdate(scr_stat *scp)
-{
- /* this is a cut-down version of scrn_timer()... */
-
- if (font_loading_in_progress)
- return;
-
- if (panicstr || shutdown_in_progress) {
- sc_touch_scrn_saver();
- } else if (scp != cur_console) {
- return;
- }
-
- if (!run_scrn_saver)
- scrn_idle = FALSE;
- if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
- stop_scrn_saver(current_saver);
-
- if (scp != cur_console || blink_in_progress || switch_in_progress)
- return;
-
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
- scrn_update(scp, TRUE);
-}
-
-scr_stat
-*sc_get_scr_stat(dev_t dev)
-{
- int unit = minor(dev);
-
- if (unit == SC_CONSOLE)
- return console[0];
- if (unit >= MAXCONS || unit < 0)
- return(NULL);
- return console[unit];
-}
-
-static int
-get_scr_num()
-{
- int i = 0;
-
- while ((i < MAXCONS) && (cur_console != console[i]))
- i++;
- return i < MAXCONS ? i : 0;
-}
-
-static void
-scrn_timer(void *arg)
-{
- static int kbd_interval = 0;
- struct timeval tv;
- scr_stat *scp;
- int s;
-
- /* don't do anything when we are touching font */
- if (font_loading_in_progress) {
- if (arg)
- timeout(scrn_timer, (void *)TRUE, hz / 10);
- return;
- }
- s = spltty();
-
- if ((kbd == NULL) && (sc_flags & AUTODETECT_KBD)) {
- /* try to allocate a keyboard automatically */
- if (++kbd_interval >= 25) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard,
- sckbdevent, NULL);
- if (keyboard >= 0) {
- kbd = kbd_get_keyboard(keyboard);
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- }
- kbd_interval = 0;
- }
- }
-
- /* should we stop the screen saver? */
- getmicrouptime(&tv);
- if (panicstr || shutdown_in_progress)
- sc_touch_scrn_saver();
- if (run_scrn_saver) {
- scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
- } else {
- scrn_time_stamp = tv.tv_sec;
- scrn_idle = FALSE;
- if (scrn_blank_time > 0)
- run_scrn_saver = TRUE;
- }
- if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
- stop_scrn_saver(current_saver);
-
- /* should we just return ? */
- if (blink_in_progress || switch_in_progress) {
- if (arg)
- timeout(scrn_timer, (void *)TRUE, hz / 10);
- splx(s);
- return;
- }
-
- /* Update the screen */
- scp = cur_console;
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
- scrn_update(scp, TRUE);
-
- /* should we activate the screen saver? */
- if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
- if (!ISGRAPHSC(scp) || scrn_blanked)
- (*current_saver)(TRUE);
-
- if (arg)
- timeout(scrn_timer, (void *)TRUE, hz / 25);
- splx(s);
-}
-
-static void
-scrn_update(scr_stat *scp, int show_cursor)
-{
- /* update screen image */
- if (scp->start <= scp->end)
- sc_bcopy(scp, scp->scr_buf, scp->start, scp->end, 0);
-
- /* we are not to show the cursor and the mouse pointer... */
- if (!show_cursor) {
- scp->end = 0;
- scp->start = scp->xsize*scp->ysize - 1;
- return;
- }
-
- /* update "pseudo" mouse pointer image */
- if (scp->status & MOUSE_VISIBLE) {
- /* did mouse move since last time ? */
- if (scp->status & MOUSE_MOVED) {
- /* do we need to remove old mouse pointer image ? */
- if (scp->mouse_cut_start != NULL ||
- (scp->mouse_pos-scp->scr_buf) <= scp->start ||
- (scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->end) {
- remove_mouse_image(scp);
- }
- scp->status &= ~MOUSE_MOVED;
- draw_mouse_image(scp);
- }
- else {
- /* mouse didn't move, has it been overwritten ? */
- if ((scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->start &&
- (scp->mouse_pos - scp->scr_buf) <= scp->end) {
- draw_mouse_image(scp);
- }
- }
- }
-
- /* update cursor image */
- if (scp->status & CURSOR_ENABLED) {
- /* did cursor move since last time ? */
- if (scp->cursor_pos != scp->cursor_oldpos) {
- /* do we need to remove old cursor image ? */
- if ((scp->cursor_oldpos - scp->scr_buf) < scp->start ||
- ((scp->cursor_oldpos - scp->scr_buf) > scp->end)) {
- remove_cursor_image(scp);
- }
- scp->cursor_oldpos = scp->cursor_pos;
- draw_cursor_image(scp);
- }
- else {
- /* cursor didn't move, has it been overwritten ? */
- if (scp->cursor_pos - scp->scr_buf >= scp->start &&
- scp->cursor_pos - scp->scr_buf <= scp->end) {
- draw_cursor_image(scp);
- } else {
- /* if its a blinking cursor, we may have to update it */
- if (sc_flags & BLINK_CURSOR)
- draw_cursor_image(scp);
- }
- }
- blinkrate++;
- }
-
- if (scp->mouse_cut_start != NULL)
- draw_cutmarking(scp);
-
- scp->end = 0;
- scp->start = scp->xsize*scp->ysize - 1;
-}
-
-#if NSPLASH > 0
-
-static int
-scsplash_callback(int event)
-{
- int error;
-
- switch (event) {
- case SPLASH_INIT:
- scrn_saver_failed = FALSE;
- if (add_scrn_saver(scsplash_saver) == 0) {
- run_scrn_saver = TRUE;
- if (cold && !(boothowto & (RB_VERBOSE | RB_CONFIG))) {
- scsplash_stick(TRUE);
- (*current_saver)(TRUE);
- }
- }
- return 0;
-
- case SPLASH_TERM:
- if (current_saver == scsplash_saver) {
- scsplash_stick(FALSE);
- error = remove_scrn_saver(scsplash_saver);
- if (error)
- return error;
- }
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-static void
-scsplash_saver(int show)
-{
- static int busy = FALSE;
- scr_stat *scp;
-
- if (busy)
- return;
- busy = TRUE;
-
- scp = cur_console;
- if (show) {
- if (!scrn_saver_failed) {
- if (!scrn_blanked)
- set_scrn_saver_mode(scp, -1, NULL, 0);
- switch (splash(scp->adp, TRUE)) {
- case 0: /* succeeded */
- scrn_blanked = TRUE;
- break;
- case EAGAIN: /* try later */
- restore_scrn_saver_mode(scp, FALSE);
- break;
- default:
- scrn_saver_failed = TRUE;
- scsplash_stick(FALSE);
- printf("scsplash_saver(): failed to put up the image\n");
- restore_scrn_saver_mode(scp, TRUE);
- break;
- }
- }
- } else if (!sticky_splash) {
- if (scrn_blanked && (splash(scp->adp, FALSE) == 0)) {
- restore_scrn_saver_mode(scp, TRUE);
- scrn_blanked = FALSE;
- }
- }
- busy = FALSE;
-}
-
-static int
-add_scrn_saver(void (*this_saver)(int))
-{
- int error;
-
- if (current_saver != none_saver) {
- error = remove_scrn_saver(current_saver);
- if (error)
- return error;
- }
-
- run_scrn_saver = FALSE;
- saver_mode = CONS_LKM_SAVER;
- current_saver = this_saver;
- return 0;
-}
-
-static int
-remove_scrn_saver(void (*this_saver)(int))
-{
- if (current_saver != this_saver)
- return EINVAL;
-
- /*
- * In order to prevent `current_saver' from being called by
- * the timeout routine `scrn_timer()' while we manipulate
- * the saver list, we shall set `current_saver' to `none_saver'
- * before stopping the current saver, rather than blocking by `splXX()'.
- */
- current_saver = none_saver;
- if (scrn_blanked)
- stop_scrn_saver(this_saver);
-
- return (scrn_blanked ? EBUSY : 0);
-}
-
-static int
-set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
-{
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- scp->splash_save_mode = scp->mode;
- scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
- splx(s);
- if (mode < 0)
- return 0;
- scp->mode = mode;
- if (set_mode(scp) == 0) {
- if (scp->adp->va_mode_flags & V_INFO_GRAPHICS)
- scp->status |= GRAPHICS_MODE;
- if (pal != NULL)
- load_palette(scp->adp, pal);
- set_border(scp, border);
- return 0;
- } else {
- s = spltty();
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- splx(s);
- return 1;
- }
-}
-
-static int
-restore_scrn_saver_mode(scr_stat *scp, int changemode)
-{
- int mode;
- int status;
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- mode = scp->mode;
- status = scp->status;
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- if (!changemode) {
- splx(s);
- return 0;
- }
- if (set_mode(scp) == 0) {
- load_palette(scp->adp, palette);
- splx(s);
- return 0;
- } else {
- scp->mode = mode;
- scp->status = status;
- splx(s);
- return 1;
- }
-}
-
-static void
-stop_scrn_saver(void (*saver)(int))
-{
- (*saver)(FALSE);
- run_scrn_saver = FALSE;
- /* the screen saver may have chosen not to stop after all... */
- if (scrn_blanked)
- return;
-
- mark_all(cur_console);
- if (delayed_next_scr)
- switch_scr(cur_console, delayed_next_scr - 1);
- wakeup((caddr_t)&scrn_blanked);
-}
-
-static int
-wait_scrn_saver_stop(void)
-{
- int error = 0;
-
- while (scrn_blanked) {
- run_scrn_saver = FALSE;
- error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
- run_scrn_saver = FALSE;
- if (error != ERESTART)
- break;
- }
- return error;
-}
-
-#endif /* NSPLASH */
-
-void
-sc_touch_scrn_saver(void)
-{
- scsplash_stick(FALSE);
- run_scrn_saver = FALSE;
-}
-
-void
-sc_clear_screen(scr_stat *scp)
-{
- move_crsr(scp, 0, 0);
- scp->cursor_oldpos = scp->cursor_pos;
- fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
- scp->xsize * scp->ysize);
- mark_all(scp);
- remove_cutmarking(scp);
-}
-
-static int
-switch_scr(scr_stat *scp, u_int next_scr)
-{
- /* delay switch if actively updating screen */
- if (scrn_blanked || write_in_progress || blink_in_progress) {
- delayed_next_scr = next_scr+1;
- sc_touch_scrn_saver();
- return 0;
- }
-
- if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid)))
- switch_in_progress = FALSE;
-
- if (next_scr >= MAXCONS || switch_in_progress ||
- (cur_console->smode.mode == VT_AUTO && ISGRAPHSC(cur_console))) {
- do_bell(scp, BELL_PITCH, BELL_DURATION);
- return EINVAL;
- }
-
- /* is the wanted virtual console open ? */
- if (next_scr) {
- struct tty *tp = VIRTUAL_TTY(next_scr);
- if (!(tp->t_state & TS_ISOPEN)) {
- do_bell(scp, BELL_PITCH, BELL_DURATION);
- return EINVAL;
- }
- }
-
- switch_in_progress = TRUE;
- old_scp = cur_console;
- new_scp = console[next_scr];
- wakeup((caddr_t)&new_scp->smode);
- if (new_scp == old_scp) {
- switch_in_progress = FALSE;
- delayed_next_scr = FALSE;
- return 0;
- }
-
- /* has controlling process died? */
- if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid)))
- old_scp->smode.mode = VT_AUTO;
- if (new_scp->proc && (new_scp->proc != pfind(new_scp->pid)))
- new_scp->smode.mode = VT_AUTO;
-
- /* check the modes and switch appropriately */
- if (old_scp->smode.mode == VT_PROCESS) {
- old_scp->status |= SWITCH_WAIT_REL;
- psignal(old_scp->proc, old_scp->smode.relsig);
- }
- else {
- exchange_scr();
- if (new_scp->smode.mode == VT_PROCESS) {
- new_scp->status |= SWITCH_WAIT_ACQ;
- psignal(new_scp->proc, new_scp->smode.acqsig);
- }
- else
- switch_in_progress = FALSE;
- }
- return 0;
-}
-
-static void
-exchange_scr(void)
-{
- /* save the current state of video and keyboard */
- move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
- if (old_scp->kbd_mode == K_XLATE)
- save_kbd_state(old_scp);
-
- /* set up the video for the new screen */
- cur_console = new_scp;
- if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
- set_mode(new_scp);
- move_crsr(new_scp, new_scp->xpos, new_scp->ypos);
- if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
- set_destructive_cursor(new_scp);
- if (ISGRAPHSC(old_scp))
- load_palette(new_scp->adp, palette);
- set_border(new_scp, new_scp->border);
-
- /* set up the keyboard for the new screen */
- if (old_scp->kbd_mode != new_scp->kbd_mode)
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&new_scp->kbd_mode);
- update_kbd_state(new_scp->status, LOCK_MASK);
-
- delayed_next_scr = FALSE;
- mark_all(new_scp);
-}
-
-static void
-scan_esc(scr_stat *scp, u_char c)
-{
- static u_char ansi_col[16] =
- {0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15};
- int i, n;
- u_short *src, *dst, count;
-
- if (scp->term.esc == 1) { /* seen ESC */
- switch (c) {
-
- case '7': /* Save cursor position */
- scp->saved_xpos = scp->xpos;
- scp->saved_ypos = scp->ypos;
- break;
-
- case '8': /* Restore saved cursor position */
- if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
- move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
- break;
-
- case '[': /* Start ESC [ sequence */
- scp->term.esc = 2;
- scp->term.last_param = -1;
- for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
- scp->term.param[i] = 1;
- scp->term.num_param = 0;
- return;
-
- case 'M': /* Move cursor up 1 line, scroll if at top */
- if (scp->ypos > 0)
- move_crsr(scp, scp->xpos, scp->ypos - 1);
- else {
- bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
- (scp->ysize - 1) * scp->xsize * sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->scr_buf, scp->xsize);
- mark_all(scp);
- }
- break;
-#if notyet
- case 'Q':
- scp->term.esc = 4;
- return;
-#endif
- case 'c': /* Clear screen & home */
- sc_clear_screen(scp);
- break;
-
- case '(': /* iso-2022: designate 94 character set to G0 */
- scp->term.esc = 5;
- return;
- }
- }
- else if (scp->term.esc == 2) { /* seen ESC [ */
- if (c >= '0' && c <= '9') {
- if (scp->term.num_param < MAX_ESC_PAR) {
- if (scp->term.last_param != scp->term.num_param) {
- scp->term.last_param = scp->term.num_param;
- scp->term.param[scp->term.num_param] = 0;
- }
- else
- scp->term.param[scp->term.num_param] *= 10;
- scp->term.param[scp->term.num_param] += c - '0';
- return;
- }
- }
- scp->term.num_param = scp->term.last_param + 1;
- switch (c) {
-
- case ';':
- if (scp->term.num_param < MAX_ESC_PAR)
- return;
- break;
-
- case '=':
- scp->term.esc = 3;
- scp->term.last_param = -1;
- for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
- scp->term.param[i] = 1;
- scp->term.num_param = 0;
- return;
-
- case 'A': /* up n rows */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos, scp->ypos - n);
- break;
-
- case 'B': /* down n rows */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos, scp->ypos + n);
- break;
-
- case 'C': /* right n columns */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos + n, scp->ypos);
- break;
-
- case 'D': /* left n columns */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos - n, scp->ypos);
- break;
-
- case 'E': /* cursor to start of line n lines down */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, 0, scp->ypos + n);
- break;
-
- case 'F': /* cursor to start of line n lines up */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, 0, scp->ypos - n);
- break;
-
- case 'f': /* Cursor move */
- case 'H':
- if (scp->term.num_param == 0)
- move_crsr(scp, 0, 0);
- else if (scp->term.num_param == 2)
- move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1);
- break;
-
- case 'J': /* Clear all or part of display */
- if (scp->term.num_param == 0)
- n = 0;
- else
- n = scp->term.param[0];
- switch (n) {
- case 0: /* clear form cursor to end of display */
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->cursor_pos,
- scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
- remove_cutmarking(scp);
- break;
- case 1: /* clear from beginning of display to cursor */
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->scr_buf,
- scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, 0);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- remove_cutmarking(scp);
- break;
- case 2: /* clear entire display */
- fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
- scp->xsize * scp->ysize);
- mark_all(scp);
- remove_cutmarking(scp);
- break;
- }
- break;
-
- case 'K': /* Clear all or part of line */
- if (scp->term.num_param == 0)
- n = 0;
- else
- n = scp->term.param[0];
- switch (n) {
- case 0: /* clear form cursor to end of line */
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->cursor_pos,
- scp->xsize - scp->xpos);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf +
- scp->xsize - 1 - scp->xpos);
- break;
- case 1: /* clear from beginning of line to cursor */
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->cursor_pos - scp->xpos,
- scp->xpos + 1);
- mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- break;
- case 2: /* clear entire line */
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->cursor_pos - scp->xpos,
- scp->xsize);
- mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
- break;
- }
- break;
-
- case 'L': /* Insert n lines */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->ysize - scp->ypos)
- n = scp->ysize - scp->ypos;
- src = scp->scr_buf + scp->ypos * scp->xsize;
- dst = src + n * scp->xsize;
- count = scp->ysize - (scp->ypos + n);
- bcopy(src, dst, count * scp->xsize * sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20], src,
- n * scp->xsize);
- mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
- break;
-
- case 'M': /* Delete n lines */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->ysize - scp->ypos)
- n = scp->ysize - scp->ypos;
- dst = scp->scr_buf + scp->ypos * scp->xsize;
- src = dst + n * scp->xsize;
- count = scp->ysize - (scp->ypos + n);
- bcopy(src, dst, count * scp->xsize * sizeof(u_short));
- src = dst + count * scp->xsize;
- fillw(scp->term.cur_color | scr_map[0x20], src,
- n * scp->xsize);
- mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
- break;
-
- case 'P': /* Delete n chars */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->xsize - scp->xpos)
- n = scp->xsize - scp->xpos;
- dst = scp->cursor_pos;
- src = dst + n;
- count = scp->xsize - (scp->xpos + n);
- bcopy(src, dst, count * sizeof(u_short));
- src = dst + count;
- fillw(scp->term.cur_color | scr_map[0x20], src, n);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
- break;
-
- case '@': /* Insert n chars */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->xsize - scp->xpos)
- n = scp->xsize - scp->xpos;
- src = scp->cursor_pos;
- dst = src + n;
- count = scp->xsize - (scp->xpos + n);
- bcopy(src, dst, count * sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20], src, n);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
- break;
-
- case 'S': /* scroll up n lines */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->ysize)
- n = scp->ysize;
- bcopy(scp->scr_buf + (scp->xsize * n),
- scp->scr_buf,
- scp->xsize * (scp->ysize - n) * sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->scr_buf + scp->xsize * (scp->ysize - n),
- scp->xsize * n);
- mark_all(scp);
- break;
-
- case 'T': /* scroll down n lines */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->ysize)
- n = scp->ysize;
- bcopy(scp->scr_buf,
- scp->scr_buf + (scp->xsize * n),
- scp->xsize * (scp->ysize - n) *
- sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->scr_buf, scp->xsize * n);
- mark_all(scp);
- break;
-
- case 'X': /* erase n characters in line */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if (n > scp->xsize - scp->xpos)
- n = scp->xsize - scp->xpos;
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->cursor_pos, n);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n - 1);
- break;
-
- case 'Z': /* move n tabs backwards */
- n = scp->term.param[0]; if (n < 1) n = 1;
- if ((i = scp->xpos & 0xf8) == scp->xpos)
- i -= 8*n;
- else
- i -= 8*(n-1);
- if (i < 0)
- i = 0;
- move_crsr(scp, i, scp->ypos);
- break;
-
- case '`': /* move cursor to column n */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, n - 1, scp->ypos);
- break;
-
- case 'a': /* move cursor n columns to the right */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos + n, scp->ypos);
- break;
-
- case 'd': /* move cursor to row n */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos, n - 1);
- break;
-
- case 'e': /* move cursor n rows down */
- n = scp->term.param[0]; if (n < 1) n = 1;
- move_crsr(scp, scp->xpos, scp->ypos + n);
- break;
-
- case 'm': /* change attribute */
- if (scp->term.num_param == 0) {
- scp->term.attr_mask = NORMAL_ATTR;
- scp->term.cur_attr =
- scp->term.cur_color = scp->term.std_color;
- break;
- }
- for (i = 0; i < scp->term.num_param; i++) {
- switch (n = scp->term.param[i]) {
- case 0: /* back to normal */
- scp->term.attr_mask = NORMAL_ATTR;
- scp->term.cur_attr =
- scp->term.cur_color = scp->term.std_color;
- break;
- case 1: /* bold */
- scp->term.attr_mask |= BOLD_ATTR;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 4: /* underline */
- scp->term.attr_mask |= UNDERLINE_ATTR;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 5: /* blink */
- scp->term.attr_mask |= BLINK_ATTR;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 7: /* reverse video */
- scp->term.attr_mask |= REVERSE_ATTR;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 30: case 31: /* set fg color */
- case 32: case 33: case 34:
- case 35: case 36: case 37:
- scp->term.attr_mask |= FOREGROUND_CHANGED;
- scp->term.cur_color =
- (scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 40: case 41: /* set bg color */
- case 42: case 43: case 44:
- case 45: case 46: case 47:
- scp->term.attr_mask |= BACKGROUND_CHANGED;
- scp->term.cur_color =
- (scp->term.cur_color&0x0F00) | (ansi_col[(n-40)&7]<<12);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- }
- }
- break;
-
- case 's': /* Save cursor position */
- scp->saved_xpos = scp->xpos;
- scp->saved_ypos = scp->ypos;
- break;
-
- case 'u': /* Restore saved cursor position */
- if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
- move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
- break;
-
- case 'x':
- if (scp->term.num_param == 0)
- n = 0;
- else
- n = scp->term.param[0];
- switch (n) {
- case 0: /* reset attributes */
- scp->term.attr_mask = NORMAL_ATTR;
- scp->term.cur_attr =
- scp->term.cur_color = scp->term.std_color =
- current_default->std_color;
- scp->term.rev_color = current_default->rev_color;
- break;
- case 1: /* set ansi background */
- scp->term.attr_mask &= ~BACKGROUND_CHANGED;
- scp->term.cur_color = scp->term.std_color =
- (scp->term.std_color & 0x0F00) |
- (ansi_col[(scp->term.param[1])&0x0F]<<12);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 2: /* set ansi foreground */
- scp->term.attr_mask &= ~FOREGROUND_CHANGED;
- scp->term.cur_color = scp->term.std_color =
- (scp->term.std_color & 0xF000) |
- (ansi_col[(scp->term.param[1])&0x0F]<<8);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 3: /* set ansi attribute directly */
- scp->term.attr_mask &= ~(FOREGROUND_CHANGED|BACKGROUND_CHANGED);
- scp->term.cur_color = scp->term.std_color =
- (scp->term.param[1]&0xFF)<<8;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 5: /* set ansi reverse video background */
- scp->term.rev_color =
- (scp->term.rev_color & 0x0F00) |
- (ansi_col[(scp->term.param[1])&0x0F]<<12);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 6: /* set ansi reverse video foreground */
- scp->term.rev_color =
- (scp->term.rev_color & 0xF000) |
- (ansi_col[(scp->term.param[1])&0x0F]<<8);
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- case 7: /* set ansi reverse video directly */
- scp->term.rev_color =
- (scp->term.param[1]&0xFF)<<8;
- scp->term.cur_attr = mask2attr(&scp->term);
- break;
- }
- break;
-
- case 'z': /* switch to (virtual) console n */
- if (scp->term.num_param == 1)
- switch_scr(scp, scp->term.param[0]);
- break;
- }
- }
- else if (scp->term.esc == 3) { /* seen ESC [0-9]+ = */
- if (c >= '0' && c <= '9') {
- if (scp->term.num_param < MAX_ESC_PAR) {
- if (scp->term.last_param != scp->term.num_param) {
- scp->term.last_param = scp->term.num_param;
- scp->term.param[scp->term.num_param] = 0;
- }
- else
- scp->term.param[scp->term.num_param] *= 10;
- scp->term.param[scp->term.num_param] += c - '0';
- return;
- }
- }
- scp->term.num_param = scp->term.last_param + 1;
- switch (c) {
-
- case ';':
- if (scp->term.num_param < MAX_ESC_PAR)
- return;
- break;
-
- case 'A': /* set display border color */
- if (scp->term.num_param == 1) {
- scp->border=scp->term.param[0] & 0xff;
- if (scp == cur_console)
- set_border(cur_console, scp->border);
- }
- break;
-
- case 'B': /* set bell pitch and duration */
- if (scp->term.num_param == 2) {
- scp->bell_pitch = scp->term.param[0];
- scp->bell_duration = scp->term.param[1];
- }
- break;
-
- case 'C': /* set cursor type & shape */
- if (scp->term.num_param == 1) {
- if (scp->term.param[0] & 0x01)
- sc_flags |= BLINK_CURSOR;
- else
- sc_flags &= ~BLINK_CURSOR;
- if ((scp->term.param[0] & 0x02)
- && ISFONTAVAIL(scp->adp->va_flags))
- sc_flags |= CHAR_CURSOR;
- else
- sc_flags &= ~CHAR_CURSOR;
- }
- else if (scp->term.num_param == 2) {
- scp->cursor_start = scp->term.param[0] & 0x1F;
- scp->cursor_end = scp->term.param[1] & 0x1F;
- }
- /*
- * The cursor shape is global property; all virtual consoles
- * are affected. Update the cursor in the current console...
- */
- if (!ISGRAPHSC(cur_console)) {
- i = spltty();
- remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
- set_destructive_cursor(cur_console);
- draw_cursor_image(cur_console);
- splx(i);
- }
- break;
-
- case 'F': /* set ansi foreground */
- if (scp->term.num_param == 1) {
- scp->term.attr_mask &= ~FOREGROUND_CHANGED;
- scp->term.cur_color = scp->term.std_color =
- (scp->term.std_color & 0xF000)
- | ((scp->term.param[0] & 0x0F) << 8);
- scp->term.cur_attr = mask2attr(&scp->term);
- }
- break;
-
- case 'G': /* set ansi background */
- if (scp->term.num_param == 1) {
- scp->term.attr_mask &= ~BACKGROUND_CHANGED;
- scp->term.cur_color = scp->term.std_color =
- (scp->term.std_color & 0x0F00)
- | ((scp->term.param[0] & 0x0F) << 12);
- scp->term.cur_attr = mask2attr(&scp->term);
- }
- break;
-
- case 'H': /* set ansi reverse video foreground */
- if (scp->term.num_param == 1) {
- scp->term.rev_color =
- (scp->term.rev_color & 0xF000)
- | ((scp->term.param[0] & 0x0F) << 8);
- scp->term.cur_attr = mask2attr(&scp->term);
- }
- break;
-
- case 'I': /* set ansi reverse video background */
- if (scp->term.num_param == 1) {
- scp->term.rev_color =
- (scp->term.rev_color & 0x0F00)
- | ((scp->term.param[0] & 0x0F) << 12);
- scp->term.cur_attr = mask2attr(&scp->term);
- }
- break;
- }
- }
-#if notyet
- else if (scp->term.esc == 4) { /* seen ESC Q */
- /* to be filled */
- }
-#endif
- else if (scp->term.esc == 5) { /* seen ESC ( */
- switch (c) {
- case 'B': /* iso-2022: desginate ASCII into G0 */
- break;
- /* other items to be filled */
- default:
- break;
- }
- }
- scp->term.esc = 0;
-}
-
-static void
-ansi_put(scr_stat *scp, u_char *buf, int len)
-{
- u_char *ptr = buf;
-
- /* make screensaver happy */
- if (!sticky_splash && scp == cur_console)
- run_scrn_saver = FALSE;
-
- write_in_progress++;
-outloop:
- if (scp->term.esc) {
- scan_esc(scp, *ptr++);
- len--;
- }
- else if (PRINTABLE(*ptr)) { /* Print only printables */
- int cnt = len <= (scp->xsize-scp->xpos) ? len : (scp->xsize-scp->xpos);
- u_short cur_attr = scp->term.cur_attr;
- u_short *cursor_pos = scp->cursor_pos;
- do {
- /*
- * gcc-2.6.3 generates poor (un)sign extension code. Casting the
- * pointers in the following to volatile should have no effect,
- * but in fact speeds up this inner loop from 26 to 18 cycles
- * (+ cache misses) on i486's.
- */
-#define UCVP(ucp) ((u_char volatile *)(ucp))
- *cursor_pos++ = UCVP(scr_map)[*UCVP(ptr)] | cur_attr;
- ptr++;
- cnt--;
- } while (cnt && PRINTABLE(*ptr));
- len -= (cursor_pos - scp->cursor_pos);
- scp->xpos += (cursor_pos - scp->cursor_pos);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- mark_for_update(scp, cursor_pos - scp->scr_buf);
- scp->cursor_pos = cursor_pos;
- if (scp->xpos >= scp->xsize) {
- scp->xpos = 0;
- scp->ypos++;
- }
- }
- else {
- switch(*ptr) {
- case 0x07:
- do_bell(scp, scp->bell_pitch, scp->bell_duration);
- break;
-
- case 0x08: /* non-destructive backspace */
- if (scp->cursor_pos > scp->scr_buf) {
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->cursor_pos--;
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- if (scp->xpos > 0)
- scp->xpos--;
- else {
- scp->xpos += scp->xsize - 1;
- scp->ypos--;
- }
- }
- break;
-
- case 0x09: /* non-destructive tab */
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->cursor_pos += (8 - scp->xpos % 8u);
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) {
- scp->xpos = 0;
- scp->ypos++;
- }
- break;
-
- case 0x0a: /* newline, same pos */
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->cursor_pos += scp->xsize;
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->ypos++;
- break;
-
- case 0x0c: /* form feed, clears screen */
- sc_clear_screen(scp);
- break;
-
- case 0x0d: /* return, return to pos 0 */
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->cursor_pos -= scp->xpos;
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
- scp->xpos = 0;
- break;
-
- case 0x1b: /* start escape sequence */
- scp->term.esc = 1;
- scp->term.num_param = 0;
- break;
- }
- ptr++; len--;
- }
- /* do we have to scroll ?? */
- if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
- remove_cutmarking(scp);
- if (scp->history != NULL) {
- bcopy(scp->scr_buf, scp->history_head,
- scp->xsize * sizeof(u_short));
- scp->history_head += scp->xsize;
- if (scp->history_head + scp->xsize >
- scp->history + scp->history_size)
- scp->history_head = scp->history;
- }
- bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
- scp->xsize * (scp->ysize - 1) * sizeof(u_short));
- fillw(scp->term.cur_color | scr_map[0x20],
- scp->scr_buf + scp->xsize * (scp->ysize - 1),
- scp->xsize);
- scp->cursor_pos -= scp->xsize;
- scp->ypos--;
- mark_all(scp);
- }
- if (len)
- goto outloop;
- write_in_progress--;
- if (delayed_next_scr)
- switch_scr(scp, delayed_next_scr - 1);
-}
-
-static void
-scinit(void)
-{
- video_adapter_t *adp;
- int col;
- int row;
- u_int i;
-
- if (init_done != COLD)
- return;
- init_done = WARM;
-
- get_bios_values();
-
- /* extract the hardware cursor location and hide the cursor for now */
- adp = vid_get_adapter(adapter);
- (*vidsw[adapter]->read_hw_cursor)(adp, &col, &row);
- (*vidsw[adapter]->set_hw_cursor)(adp, -1, -1);
-
- /* set up the first console */
- current_default = &user_default;
- console[0] = &main_console;
- init_scp(console[0]);
- cur_console = console[0];
-
- /* copy screen to temporary buffer */
- if (ISTEXTSC(console[0]))
- bcopy_fromio(console[0]->adp->va_window, sc_buffer,
- console[0]->xsize * console[0]->ysize * sizeof(u_short));
-
- console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
- = sc_buffer;
- if (col >= console[0]->xsize)
- col = 0;
- if (row >= console[0]->ysize)
- row = console[0]->ysize - 1;
- console[0]->xpos = col;
- console[0]->ypos = row;
- console[0]->cursor_pos = console[0]->cursor_oldpos =
- sc_buffer + row*console[0]->xsize + col;
- console[0]->cursor_saveunder = *console[0]->cursor_pos;
- for (i=1; i<MAXCONS; i++)
- console[i] = NULL;
- kernel_console.esc = 0;
- kernel_console.attr_mask = NORMAL_ATTR;
- kernel_console.cur_attr =
- kernel_console.cur_color = kernel_console.std_color =
- kernel_default.std_color;
- kernel_console.rev_color = kernel_default.rev_color;
-
- /* initialize mapscrn arrays to a one to one map */
- for (i=0; i<sizeof(scr_map); i++) {
- scr_map[i] = scr_rmap[i] = i;
- }
-
- /* Save font and palette */
- if (ISFONTAVAIL(cur_console->adp->va_flags)) {
- if (fonts_loaded & FONT_16) {
- copy_font(cur_console, LOAD, 16, font_16);
- } else {
- copy_font(cur_console, SAVE, 16, font_16);
- fonts_loaded = FONT_16;
- set_destructive_cursor(cur_console);
- }
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- */
- (*vidsw[cur_console->ad]->show_font)(cur_console->adp, 0);
- }
- save_palette(cur_console->adp, palette);
-
-#if NSPLASH > 0
- /* we are ready to put up the splash image! */
- splash_init(cur_console->adp, scsplash_callback);
-#endif
-}
-
-static void
-scshutdown(int howto, void *arg)
-{
- sc_touch_scrn_saver();
- if (!cold && cur_console->smode.mode == VT_AUTO
- && console[0]->smode.mode == VT_AUTO)
- switch_scr(cur_console, 0);
- shutdown_in_progress = TRUE;
-}
-
-int
-sc_clean_up(scr_stat *scp)
-{
- int error;
-
- sc_touch_scrn_saver();
- if ((error = wait_scrn_saver_stop()))
- return error;
- scp->status &= ~MOUSE_VISIBLE;
- remove_cutmarking(scp);
- return 0;
-}
-
-void
-sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear)
-{
- if (scp->scr_buf)
- free(scp->scr_buf, M_DEVBUF);
- scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
-
- if (clear) {
- /* clear the screen and move the text cursor to the top-left position */
- sc_clear_screen(scp);
- } else {
- /* retain the current cursor position, but adjust pointers */
- move_crsr(scp, scp->xpos, scp->ypos);
- scp->cursor_oldpos = scp->cursor_pos;
- }
-
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
-}
-
-void
-sc_alloc_cut_buffer(scr_stat *scp, int wait)
-{
- if ((cut_buffer == NULL)
- || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
- if (cut_buffer != NULL)
- free(cut_buffer, M_DEVBUF);
- cut_buffer_size = scp->xsize * scp->ysize + 1;
- cut_buffer = (u_char *)malloc(cut_buffer_size,
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (cut_buffer != NULL)
- cut_buffer[0] = '\0';
- }
-}
-
-void
-sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait)
-{
- u_short *usp;
-
- if (lines < scp->ysize)
- lines = scp->ysize;
-
- usp = scp->history;
- scp->history = NULL;
- if (usp != NULL) {
- free(usp, M_DEVBUF);
- if (extra > 0)
- extra_history_size += extra;
- }
-
- scp->history_size = lines * scp->xsize;
- if (lines > imax(sc_history_size, scp->ysize))
- extra_history_size -= lines - imax(sc_history_size, scp->ysize);
- usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (usp != NULL)
- bzero(usp, scp->history_size * sizeof(u_short));
- scp->history_head = scp->history_pos = usp;
- scp->history = usp;
-}
-
-static scr_stat
-*alloc_scp()
-{
- scr_stat *scp;
-
- scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
- init_scp(scp);
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, TRUE);
- sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
-/* SOS
- if (scp->adp->va_flags & V_ADP_MODECHANGE)
- set_mode(scp);
-*/
- sc_clear_screen(scp);
- scp->cursor_saveunder = *scp->cursor_pos;
- return scp;
-}
-
-static void
-init_scp(scr_stat *scp)
-{
- video_info_t info;
-
- scp->ad = adapter;
- scp->adp = vid_get_adapter(scp->ad);
- (*vidsw[scp->ad]->get_info)(scp->adp, initial_video_mode, &info);
-
- scp->status = 0;
- scp->mode = initial_video_mode;
- scp->scr_buf = NULL;
- if (info.vi_flags & V_INFO_GRAPHICS) {
- scp->status |= GRAPHICS_MODE;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- } else {
- scp->xsize = info.vi_width;
- scp->ysize = info.vi_height;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*info.vi_cheight;
- scp->font_size = info.vi_cheight;
- }
- scp->xoff = scp->yoff = 0;
- scp->xpos = scp->ypos = 0;
- scp->saved_xpos = scp->saved_ypos = -1;
- scp->start = scp->xsize * scp->ysize;
- scp->end = 0;
- scp->term.esc = 0;
- scp->term.attr_mask = NORMAL_ATTR;
- scp->term.cur_attr =
- scp->term.cur_color = scp->term.std_color =
- current_default->std_color;
- scp->term.rev_color = current_default->rev_color;
- scp->border = BG_BLACK;
- scp->cursor_start = bios_value.cursor_start;
- scp->cursor_end = bios_value.cursor_end;
- scp->mouse_xpos = scp->xsize*8/2;
- scp->mouse_ypos = scp->ysize*scp->font_size/2;
- scp->mouse_cut_start = scp->mouse_cut_end = NULL;
- scp->mouse_signal = 0;
- scp->mouse_pid = 0;
- scp->mouse_proc = NULL;
- scp->kbd_mode = K_XLATE;
- scp->bell_pitch = BELL_PITCH;
- scp->bell_duration = BELL_DURATION;
- scp->status |= (bios_value.shift_state & 0x20) ? NLKED : 0;
- scp->status |= CURSOR_ENABLED;
- scp->pid = 0;
- scp->proc = NULL;
- scp->smode.mode = VT_AUTO;
- scp->history_head = scp->history_pos = scp->history = NULL;
- scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
-}
-
-static void
-get_bios_values(void)
-{
- bios_value.cursor_start = *(u_int8_t *)pa_to_va(0x461);
- bios_value.cursor_end = *(u_int8_t *)pa_to_va(0x460);
- bios_value.shift_state = *(u_int8_t *)pa_to_va(0x417);
-}
-
-static void
-history_to_screen(scr_stat *scp)
-{
- int i;
-
- for (i=0; i<scp->ysize; i++)
- bcopy(scp->history + (((scp->history_pos - scp->history) +
- scp->history_size-((i+1)*scp->xsize))%scp->history_size),
- scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
- scp->xsize * sizeof(u_short));
- mark_all(scp);
-}
-
-static int
-history_up_line(scr_stat *scp)
-{
- if (WRAPHIST(scp, scp->history_pos, -(scp->xsize*scp->ysize)) !=
- scp->history_head) {
- scp->history_pos = WRAPHIST(scp, scp->history_pos, -scp->xsize);
- history_to_screen(scp);
- return 0;
- }
- else
- return -1;
-}
-
-static int
-history_down_line(scr_stat *scp)
-{
- if (scp->history_pos != scp->history_head) {
- scp->history_pos = WRAPHIST(scp, scp->history_pos, scp->xsize);
- history_to_screen(scp);
- return 0;
- }
- else
- return -1;
-}
-
-/*
- * scgetc(flags) - get character from keyboard.
- * If flags & SCGETC_CN, then avoid harmful side effects.
- * If flags & SCGETC_NONBLOCK, then wait until a key is pressed, else
- * return NOKEY if there is nothing there.
- */
-static u_int
-scgetc(keyboard_t *kbd, u_int flags)
-{
- u_int c;
- int this_scr;
- int f;
- int i;
-
- if (kbd == NULL)
- return NOKEY;
-
-next_code:
- /* I don't like this, but... XXX */
- if (flags & SCGETC_CN)
- sccnupdate(cur_console);
- /* first see if there is something in the keyboard port */
- for (;;) {
- c = kbd_read_char(kbd, !(flags & SCGETC_NONBLOCK));
- if (c == ERRKEY) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- } else if (c == NOKEY)
- return c;
- else
- break;
- }
-
- /* make screensaver happy */
- if (!(c & RELKEY))
- sc_touch_scrn_saver();
-
-#ifdef __i386__
- if (!(flags & SCGETC_CN))
- /* do the /dev/random device a favour */
- add_keyboard_randomness(c);
-#endif
-
- if (cur_console->kbd_mode != K_XLATE)
- return KEYCHAR(c);
-
- /* if scroll-lock pressed allow history browsing */
- if (!ISGRAPHSC(cur_console) && cur_console->history
- && cur_console->status & SLKED) {
-
- cur_console->status &= ~CURSOR_ENABLED;
- if (!(cur_console->status & BUFFER_SAVED)) {
- cur_console->status |= BUFFER_SAVED;
- cur_console->history_save = cur_console->history_head;
-
- /* copy screen into top of history buffer */
- for (i=0; i<cur_console->ysize; i++) {
- bcopy(cur_console->scr_buf + (cur_console->xsize * i),
- cur_console->history_head,
- cur_console->xsize * sizeof(u_short));
- cur_console->history_head += cur_console->xsize;
- if (cur_console->history_head + cur_console->xsize >
- cur_console->history + cur_console->history_size)
- cur_console->history_head=cur_console->history;
- }
- cur_console->history_pos = cur_console->history_head;
- history_to_screen(cur_console);
- }
- switch (c) {
- /* FIXME: key codes */
- case SPCLKEY | FKEY | F(49): /* home key */
- remove_cutmarking(cur_console);
- cur_console->history_pos = cur_console->history_head;
- history_to_screen(cur_console);
- goto next_code;
-
- case SPCLKEY | FKEY | F(57): /* end key */
- remove_cutmarking(cur_console);
- cur_console->history_pos =
- WRAPHIST(cur_console, cur_console->history_head,
- cur_console->xsize*cur_console->ysize);
- history_to_screen(cur_console);
- goto next_code;
-
- case SPCLKEY | FKEY | F(50): /* up arrow key */
- remove_cutmarking(cur_console);
- if (history_up_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- goto next_code;
-
- case SPCLKEY | FKEY | F(58): /* down arrow key */
- remove_cutmarking(cur_console);
- if (history_down_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- goto next_code;
-
- case SPCLKEY | FKEY | F(51): /* page up key */
- remove_cutmarking(cur_console);
- for (i=0; i<cur_console->ysize; i++)
- if (history_up_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- break;
- }
- goto next_code;
-
- case SPCLKEY | FKEY | F(59): /* page down key */
- remove_cutmarking(cur_console);
- for (i=0; i<cur_console->ysize; i++)
- if (history_down_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- break;
- }
- goto next_code;
- }
- }
-
- /*
- * Process and consume special keys here. Return a plain char code
- * or a char code with the META flag or a function key code.
- */
- if (c & RELKEY) {
- /* key released */
- /* goto next_code */
- } else {
- /* key pressed */
- if (c & SPCLKEY) {
- c &= ~SPCLKEY;
- switch (KEYCHAR(c)) {
- /* LOCKING KEYS */
- case NLK: case CLK: case ALK:
- break;
- case SLK:
- kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&f);
- if (f & SLKED) {
- cur_console->status |= SLKED;
- } else {
- if (cur_console->status & SLKED) {
- cur_console->status &= ~SLKED;
- if (cur_console->status & BUFFER_SAVED) {
- int i;
- u_short *ptr = cur_console->history_save;
-
- for (i=0; i<cur_console->ysize; i++) {
- bcopy(ptr,
- cur_console->scr_buf +
- (cur_console->xsize*i),
- cur_console->xsize * sizeof(u_short));
- ptr += cur_console->xsize;
- if (ptr + cur_console->xsize >
- cur_console->history +
- cur_console->history_size)
- ptr = cur_console->history;
- }
- cur_console->status &= ~BUFFER_SAVED;
- cur_console->history_head=cur_console->history_save;
- cur_console->status |= CURSOR_ENABLED;
- mark_all(cur_console);
- }
- scstart(VIRTUAL_TTY(get_scr_num()));
- }
- }
- break;
-
- /* NON-LOCKING KEYS */
- case NOP:
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
- break;
-
- case BTAB:
- return c;
-
- case SPSC:
- /* force activatation/deactivation of the screen saver */
- if (!scrn_blanked) {
- run_scrn_saver = TRUE;
- scrn_time_stamp -= scrn_blank_time;
- }
-#if NSPLASH > 0
- if (cold) {
- /*
- * While devices are being probed, the screen saver need
- * to be invoked explictly. XXX
- */
- if (scrn_blanked) {
- scsplash_stick(FALSE);
- stop_scrn_saver(current_saver);
- } else {
- if (!ISGRAPHSC(cur_console)) {
- scsplash_stick(TRUE);
- (*current_saver)(TRUE);
- }
- }
- }
-#endif /* NSPLASH */
- break;
-
- case RBT:
-#ifndef SC_DISABLE_REBOOT
- shutdown_nice();
-#endif
- break;
-
-#if NAPM > 0
- case SUSP:
- apm_suspend(PMST_SUSPEND);
- break;
- case STBY:
- apm_suspend(PMST_STANDBY);
- break;
-#else
- case SUSP:
- case STBY:
- break;
-#endif
-
- case DBG:
-#ifdef DDB /* try to switch to console 0 */
- /*
- * TRY to make sure the screen saver is stopped,
- * and the screen is updated before switching to
- * the vty0.
- */
- scrn_timer((void *)FALSE);
- if (cur_console->smode.mode == VT_AUTO &&
- console[0]->smode.mode == VT_AUTO)
- switch_scr(cur_console, 0);
- Debugger("manual escape to debugger");
-#else
- printf("No debugger in kernel\n");
-#endif
- break;
-
- case NEXT:
- this_scr = get_scr_num();
- for (i = this_scr + 1; i != this_scr; i = (i + 1)%MAXCONS) {
- struct tty *tp = VIRTUAL_TTY(i);
- if (tp->t_state & TS_ISOPEN) {
- switch_scr(cur_console, i);
- break;
- }
- }
- break;
-
- default:
- if (KEYCHAR(c) >= F_SCR && KEYCHAR(c) <= L_SCR) {
- switch_scr(cur_console, KEYCHAR(c) - F_SCR);
- break;
- }
- /* assert(c & FKEY) */
- return c;
- }
- /* goto next_code */
- } else {
- /* regular keys (maybe MKEY is set) */
- return c;
- }
- }
-
- goto next_code;
-}
-
-int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
-{
- struct tty *tp;
- struct scr_stat *scp;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
- return (*vidsw[scp->ad]->mmap)(scp->adp, offset);
-}
-
-/*
- * Calculate hardware attributes word using logical attributes mask and
- * hardware colors
- */
-
-static int
-mask2attr(struct term_stat *term)
-{
- int attr, mask = term->attr_mask;
-
- if (mask & REVERSE_ATTR) {
- attr = ((mask & FOREGROUND_CHANGED) ?
- ((term->cur_color & 0xF000) >> 4) :
- (term->rev_color & 0x0F00)) |
- ((mask & BACKGROUND_CHANGED) ?
- ((term->cur_color & 0x0F00) << 4) :
- (term->rev_color & 0xF000));
- } else
- attr = term->cur_color;
-
- /* XXX: underline mapping for Hercules adapter can be better */
- if (mask & (BOLD_ATTR | UNDERLINE_ATTR))
- attr ^= 0x0800;
- if (mask & BLINK_ATTR)
- attr ^= 0x8000;
-
- return attr;
-}
-
-static int
-save_kbd_state(scr_stat *scp)
-{
- int state;
- int error;
-
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error == 0) {
- scp->status &= ~LOCK_MASK;
- scp->status |= state;
- }
- return error;
-}
-
-static int
-update_kbd_state(int new_bits, int mask)
-{
- int state;
- int error;
-
- if (mask != LOCK_MASK) {
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error)
- return error;
- state &= ~mask;
- state |= new_bits & mask;
- } else {
- state = new_bits & LOCK_MASK;
- }
- error = kbd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-}
-
-static int
-update_kbd_leds(int which)
-{
- int error;
-
- which &= LOCK_MASK;
- error = kbd_ioctl(kbd, KDSETLED, (caddr_t)&which);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-}
-
-int
-set_mode(scr_stat *scp)
-{
- video_info_t info;
-
- /* reject unsupported mode */
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return 1;
-
- /* if this vty is not currently showing, do nothing */
- if (scp != cur_console)
- return 0;
-
- /* setup video hardware for the given mode */
- (*vidsw[scp->ad]->set_mode)(scp->adp, scp->mode);
- Crtat = scp->adp->va_window;
-
- if (!(scp->status & GRAPHICS_MODE)) {
- /* load appropriate font */
- if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) {
- if (scp->font_size < 14) {
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- } else if (scp->font_size >= 16) {
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- } else {
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- }
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
- (*vidsw[scp->ad]->show_font)(scp->adp, 0);
- }
- mark_all(scp);
- }
-
- if (scp->status & PIXEL_MODE)
- bzero_io(scp->adp->va_window, scp->xpixel*scp->ypixel/8);
-
- set_border(scp, scp->border);
-
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-
- return 0;
-}
-
-void
-set_border(scr_stat *scp, int color)
-{
- vm_offset_t p;
- int xoff;
- int yoff;
- int xlen;
- int ylen;
- int i;
-
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
-
- if (scp->status & PIXEL_MODE) {
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
- p = scp->adp->va_window;
- xoff = scp->xoff;
- yoff = scp->yoff*scp->font_size;
- xlen = scp->xpixel/8;
- ylen = scp->ysize*scp->font_size;
- if (yoff > 0) {
- bzero_io(p, xlen*yoff);
- bzero_io(p + xlen*(yoff + ylen),
- xlen*scp->ypixel - xlen*(yoff + ylen));
- }
- if (xoff > 0) {
- for (i = 0; i < ylen; ++i) {
- bzero_io(p + xlen*(yoff + i), xoff);
- bzero_io(p + xlen*(yoff + i) + xoff + scp->xsize,
- xlen - xoff - scp->xsize);
- }
- }
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
- }
-}
-
-void
-copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
-{
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
- font_loading_in_progress = TRUE;
- if (operation == LOAD) {
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, buf, 0, 256);
- if (sc_flags & CHAR_CURSOR)
- set_destructive_cursor(scp);
- } else if (operation == SAVE) {
- (*vidsw[scp->ad]->save_font)(scp->adp, 0, font_size, buf, 0, 256);
- }
- font_loading_in_progress = FALSE;
-}
-
-static void
-set_destructive_cursor(scr_stat *scp)
-{
- u_char cursor[32];
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
- int i;
-
- if (!ISFONTAVAIL(scp->adp->va_flags)
- || (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return;
-
- if (scp->font_size < 14) {
- font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
- font_buffer = font_16;
- font_size = 16;
- } else {
- font_buffer = font_14;
- font_size = 14;
- }
-
- if (scp->status & MOUSE_VISIBLE) {
- if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR)
- bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 1)
- bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 2)
- bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 3)
- bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
- else
- bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
- cursor, scp->font_size);
- }
- else
- bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
- cursor, scp->font_size);
- for (i=0; i<32; i++)
- if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
- (scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
- cursor[i] |= 0xff;
-#if 1
- crtc_addr = scp->adp->va_crtc_addr;
- while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
-#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
- font_loading_in_progress = FALSE;
-}
-
-void
-sc_move_mouse(scr_stat *scp, int x, int y)
-{
- scp->mouse_xpos = x;
- scp->mouse_ypos = y;
- scp->mouse_pos = scp->mouse_oldpos =
- scp->scr_buf + (y / scp->font_size) * scp->xsize + x / 8;
-}
-
-static void
-set_mouse_pos(scr_stat *scp)
-{
- static int last_xpos = -1, last_ypos = -1;
-
- if (scp->mouse_xpos < 0)
- scp->mouse_xpos = 0;
- if (scp->mouse_ypos < 0)
- scp->mouse_ypos = 0;
- if (!ISTEXTSC(scp)) {
- if (scp->mouse_xpos > scp->xpixel-1)
- scp->mouse_xpos = scp->xpixel-1;
- if (scp->mouse_ypos > scp->ypixel-1)
- scp->mouse_ypos = scp->ypixel-1;
- return;
- }
- if (scp->mouse_xpos > (scp->xsize*8)-1)
- scp->mouse_xpos = (scp->xsize*8)-1;
- if (scp->mouse_ypos > (scp->ysize*scp->font_size)-1)
- scp->mouse_ypos = (scp->ysize*scp->font_size)-1;
-
- if (scp->mouse_xpos != last_xpos || scp->mouse_ypos != last_ypos) {
- scp->status |= MOUSE_MOVED;
-
- scp->mouse_pos = scp->scr_buf +
- ((scp->mouse_ypos/scp->font_size)*scp->xsize + scp->mouse_xpos/8);
-
- if ((scp->status & MOUSE_VISIBLE) && (scp->status & MOUSE_CUTTING))
- mouse_cut(scp);
- }
-}
-
-#define isspace(c) (((c) & 0xff) == ' ')
-
-static int
-skip_spc_right(scr_stat *scp, u_short *p)
-{
- int i;
-
- for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
- if (!isspace(*p))
- break;
- ++p;
- }
- return i;
-}
-
-static int
-skip_spc_left(scr_stat *scp, u_short *p)
-{
- int i;
-
- for (i = (p-- - scp->scr_buf) % scp->xsize - 1; i >= 0; --i) {
- if (!isspace(*p))
- break;
- --p;
- }
- return i;
-}
-
-static void
-mouse_cut(scr_stat *scp)
-{
- u_short *end;
- u_short *p;
- int i = 0;
- int j = 0;
-
- scp->mouse_cut_end = (scp->mouse_pos >= scp->mouse_cut_start) ?
- scp->mouse_pos + 1 : scp->mouse_pos;
- end = (scp->mouse_cut_start > scp->mouse_cut_end) ?
- scp->mouse_cut_start : scp->mouse_cut_end;
- for (p = (scp->mouse_cut_start > scp->mouse_cut_end) ?
- scp->mouse_cut_end : scp->mouse_cut_start; p < end; ++p) {
- cut_buffer[i] = *p & 0xff;
- /* remember the position of the last non-space char */
- if (!isspace(cut_buffer[i++]))
- j = i;
- /* trim trailing blank when crossing lines */
- if (((p - scp->scr_buf) % scp->xsize) == (scp->xsize - 1)) {
- cut_buffer[j++] = '\r';
- i = j;
- }
- }
- cut_buffer[i] = '\0';
-
- /* scan towards the end of the last line */
- --p;
- for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
- if (!isspace(*p))
- break;
- ++p;
- }
- /* if there is nothing but blank chars, trim them, but mark towards eol */
- if (i >= scp->xsize) {
- if (scp->mouse_cut_start > scp->mouse_cut_end)
- scp->mouse_cut_start = p;
- else
- scp->mouse_cut_end = p;
- cut_buffer[j++] = '\r';
- cut_buffer[j] = '\0';
- }
-
- mark_for_update(scp, scp->mouse_cut_start - scp->scr_buf);
- mark_for_update(scp, scp->mouse_cut_end - scp->scr_buf);
-}
-
-static void
-mouse_cut_start(scr_stat *scp)
-{
- int i;
-
- if (scp->status & MOUSE_VISIBLE) {
- if (scp->mouse_pos == scp->mouse_cut_start &&
- scp->mouse_cut_start == scp->mouse_cut_end - 1) {
- cut_buffer[0] = '\0';
- remove_cutmarking(scp);
- } else if (skip_spc_right(scp, scp->mouse_pos) >= scp->xsize) {
- /* if the pointer is on trailing blank chars, mark towards eol */
- i = skip_spc_left(scp, scp->mouse_pos) + 1;
- scp->mouse_cut_start = scp->scr_buf +
- ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize + i;
- scp->mouse_cut_end = scp->scr_buf +
- ((scp->mouse_pos - scp->scr_buf) / scp->xsize + 1) * scp->xsize;
- cut_buffer[0] = '\r';
- cut_buffer[1] = '\0';
- scp->status |= MOUSE_CUTTING;
- } else {
- scp->mouse_cut_start = scp->mouse_pos;
- scp->mouse_cut_end = scp->mouse_cut_start + 1;
- cut_buffer[0] = *scp->mouse_cut_start & 0xff;
- cut_buffer[1] = '\0';
- scp->status |= MOUSE_CUTTING;
- }
- mark_all(scp);
- /* delete all other screens cut markings */
- for (i=0; i<MAXCONS; i++) {
- if (console[i] == NULL || console[i] == scp)
- continue;
- remove_cutmarking(console[i]);
- }
- }
-}
-
-static void
-mouse_cut_end(scr_stat *scp)
-{
- if (scp->status & MOUSE_VISIBLE) {
- scp->status &= ~MOUSE_CUTTING;
- }
-}
-
-static void
-mouse_cut_word(scr_stat *scp)
-{
- u_short *p;
- u_short *sol;
- u_short *eol;
- int i;
-
- /*
- * Because we don't have locale information in the kernel,
- * we only distinguish space char and non-space chars. Punctuation
- * chars, symbols and other regular chars are all treated alike.
- */
- if (scp->status & MOUSE_VISIBLE) {
- sol = scp->scr_buf
- + ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
- eol = sol + scp->xsize;
- if (isspace(*scp->mouse_pos)) {
- for (p = scp->mouse_pos; p >= sol; --p)
- if (!isspace(*p))
- break;
- scp->mouse_cut_start = ++p;
- for (p = scp->mouse_pos; p < eol; ++p)
- if (!isspace(*p))
- break;
- scp->mouse_cut_end = p;
- } else {
- for (p = scp->mouse_pos; p >= sol; --p)
- if (isspace(*p))
- break;
- scp->mouse_cut_start = ++p;
- for (p = scp->mouse_pos; p < eol; ++p)
- if (isspace(*p))
- break;
- scp->mouse_cut_end = p;
- }
- for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
- cut_buffer[i++] = *p & 0xff;
- cut_buffer[i] = '\0';
- scp->status |= MOUSE_CUTTING;
- }
-}
-
-static void
-mouse_cut_line(scr_stat *scp)
-{
- u_short *p;
- int i;
-
- if (scp->status & MOUSE_VISIBLE) {
- scp->mouse_cut_start = scp->scr_buf
- + ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
- scp->mouse_cut_end = scp->mouse_cut_start + scp->xsize;
- for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
- cut_buffer[i++] = *p & 0xff;
- cut_buffer[i++] = '\r';
- cut_buffer[i] = '\0';
- scp->status |= MOUSE_CUTTING;
- }
-}
-
-static void
-mouse_cut_extend(scr_stat *scp)
-{
- if ((scp->status & MOUSE_VISIBLE) && !(scp->status & MOUSE_CUTTING)
- && (scp->mouse_cut_start != NULL)) {
- mouse_cut(scp);
- scp->status |= MOUSE_CUTTING;
- }
-}
-
-static void
-mouse_paste(scr_stat *scp)
-{
- if (scp->status & MOUSE_VISIBLE) {
- struct tty *tp;
- u_char *ptr = cut_buffer;
-
- tp = VIRTUAL_TTY(get_scr_num());
- while (*ptr)
- (*linesw[tp->t_line].l_rint)(scr_rmap[*ptr++], tp);
- }
-}
-
-static void
-draw_mouse_image(scr_stat *scp)
-{
- u_short buffer[32];
- u_short xoffset, yoffset;
- vm_offset_t crt_pos = scp->adp->va_window + 2*(scp->mouse_pos - scp->scr_buf);
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
- int i;
-
- if (scp->font_size < 14) {
- font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
- font_buffer = font_16;
- font_size = 16;
- } else {
- font_buffer = font_14;
- font_size = 14;
- }
-
- xoffset = scp->mouse_xpos % 8;
- yoffset = scp->mouse_ypos % scp->font_size;
-
- /* prepare mousepointer char's bitmaps */
- bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
- &scp->mouse_cursor[0], font_size);
- bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
- &scp->mouse_cursor[32], font_size);
- bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
- &scp->mouse_cursor[64], font_size);
- bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
- &scp->mouse_cursor[96], font_size);
- for (i=0; i<font_size; i++) {
- buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];
- buffer[i+font_size]=scp->mouse_cursor[i+64]<<8|scp->mouse_cursor[i+96];
- }
-
- /* now and-or in the mousepointer image */
- for (i=0; i<16; i++) {
- buffer[i+yoffset] =
- ( buffer[i+yoffset] & ~(mouse_and_mask[i] >> xoffset))
- | (mouse_or_mask[i] >> xoffset);
- }
- for (i=0; i<font_size; i++) {
- scp->mouse_cursor[i] = (buffer[i] & 0xff00) >> 8;
- scp->mouse_cursor[i+32] = buffer[i] & 0xff;
- scp->mouse_cursor[i+64] = (buffer[i+font_size] & 0xff00) >> 8;
- scp->mouse_cursor[i+96] = buffer[i+font_size] & 0xff;
- }
-
- scp->mouse_oldpos = scp->mouse_pos;
-
-#if 1
- /* wait for vertical retrace to avoid jitter on some videocards */
- crtc_addr = scp->adp->va_crtc_addr;
- while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
-#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor,
- SC_MOUSE_CHAR, 4);
- font_loading_in_progress = FALSE;
-
- writew(crt_pos, (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR);
- writew(crt_pos+2*scp->xsize,
- (*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2));
- if (scp->mouse_xpos < (scp->xsize-1)*8) {
- writew(crt_pos + 2, (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1));
- writew(crt_pos+2*scp->xsize + 2,
- (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3));
- }
- mark_for_update(scp, scp->mouse_pos - scp->scr_buf);
- mark_for_update(scp, scp->mouse_pos + scp->xsize + 1 - scp->scr_buf);
-}
-
-static void
-remove_mouse_image(scr_stat *scp)
-{
- vm_offset_t crt_pos;
-
- if (!ISTEXTSC(scp))
- return;
-
- crt_pos = scp->adp->va_window + 2*(scp->mouse_oldpos - scp->scr_buf);
- writew(crt_pos, *(scp->mouse_oldpos));
- writew(crt_pos+2, *(scp->mouse_oldpos+1));
- writew(crt_pos+2*scp->xsize, *(scp->mouse_oldpos+scp->xsize));
- writew(crt_pos+2*scp->xsize+2, *(scp->mouse_oldpos+scp->xsize+1));
- mark_for_update(scp, scp->mouse_oldpos - scp->scr_buf);
- mark_for_update(scp, scp->mouse_oldpos + scp->xsize + 1 - scp->scr_buf);
-}
-
-static void
-draw_cutmarking(scr_stat *scp)
-{
- vm_offset_t crt_pos;
- u_short *ptr;
- u_short och, nch;
-
- crt_pos = scp->adp->va_window;
- for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
- nch = och = readw(crt_pos + 2*(ptr - scp->scr_buf));
- /* are we outside the selected area ? */
- if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
- scp->mouse_cut_end : scp->mouse_cut_start) ||
- ptr >= (scp->mouse_cut_start > scp->mouse_cut_end ?
- scp->mouse_cut_start : scp->mouse_cut_end)) {
- if (ptr != scp->cursor_pos)
- nch = (och & 0xff) | (*ptr & 0xff00);
- }
- else {
- /* are we clear of the cursor image ? */
- if (ptr != scp->cursor_pos)
- nch = (och & 0x88ff) | (*ptr & 0x7000)>>4 | (*ptr & 0x0700)<<4;
- else {
- if (sc_flags & CHAR_CURSOR)
- nch = (och & 0x88ff)|(*ptr & 0x7000)>>4|(*ptr & 0x0700)<<4;
- else
- if (!(sc_flags & BLINK_CURSOR))
- nch = (och & 0xff) | (*ptr & 0xff00);
- }
- }
- if (nch != och)
- writew(crt_pos + 2*(ptr - scp->scr_buf), nch);
- }
-}
-
-static void
-remove_cutmarking(scr_stat *scp)
-{
- scp->mouse_cut_start = scp->mouse_cut_end = NULL;
- scp->status &= ~MOUSE_CUTTING;
- mark_all(scp);
-}
-
-static void
-do_bell(scr_stat *scp, int pitch, int duration)
-{
- if (cold || shutdown_in_progress)
- return;
-
- if (scp != cur_console && (sc_flags & QUIET_BELL))
- return;
-
- if (sc_flags & VISUAL_BELL) {
- if (blink_in_progress)
- return;
- blink_in_progress = 4;
- if (scp != cur_console)
- blink_in_progress += 2;
- blink_screen(cur_console);
- } else {
- if (scp != cur_console)
- pitch *= 2;
- sysbeep(pitch, duration);
- }
-}
-
-static void
-blink_screen(void *arg)
-{
- scr_stat *scp = arg;
-
- if (!ISTEXTSC(scp) || (blink_in_progress <= 1)) {
- blink_in_progress = FALSE;
- mark_all(scp);
- if (delayed_next_scr)
- switch_scr(scp, delayed_next_scr - 1);
- }
- else {
- if (blink_in_progress & 1)
- fillw_io(kernel_default.std_color | scr_map[0x20],
- scp->adp->va_window,
- scp->xsize * scp->ysize);
- else
- fillw_io(kernel_default.rev_color | scr_map[0x20],
- scp->adp->va_window,
- scp->xsize * scp->ysize);
- blink_in_progress--;
- timeout(blink_screen, scp, hz / 10);
- }
-}
-
-void
-sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
-{
- u_char *font;
- vm_offset_t d;
- vm_offset_t e;
- u_char *f;
- int font_size;
- int line_length;
- int xsize;
- u_short bg;
- int i, j;
- u_char c;
-
- if (ISTEXTSC(scp)) {
- bcopy_toio(p + from, scp->adp->va_window + 2*from,
- (to - from + 1)*sizeof(u_short));
- } else /* if ISPIXELSC(scp) */ {
- if (mark)
- mark = 255;
- font_size = scp->font_size;
- if (font_size < 14)
- font = font_8;
- else if (font_size >= 16)
- font = font_16;
- else
- font = font_14;
- line_length = scp->xpixel/8;
- xsize = scp->xsize;
- d = scp->adp->va_window
- + scp->xoff + scp->yoff*font_size*line_length
- + (from%xsize) + font_size*line_length*(from/xsize);
-
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- bg = -1;
- for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- outw(GDCIDX, 0xff08); /* bit mask */
- writeb(d, 0);
- c = readb(d); /* set the background color in the latch */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
- writeb(e, 0);
- e += line_length;
- }
- d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
- }
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
-
-#if 0 /* VGA only */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- bg = -1;
- for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- *d = 0;
- c = *d; /* set the background color in the latch */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = (u_char *)d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- *e = *f^mark;
- e += line_length;
- }
- d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
- }
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
-#endif /* 0 */
- }
-}
-
-#endif /* NSC */
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
deleted file mode 100644
index 1a88a8c7b5ae..000000000000
--- a/sys/dev/syscons/syscons.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/*-
- * Copyright (c) 1995-1998 Søren Schmidt
- * 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, immediately at the beginning of the file.
- * 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.
- *
- * 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.
- *
- * $Id: syscons.h,v 1.45 1999/01/11 03:18:29 yokota Exp $
- */
-
-#ifndef _DEV_SYSCONS_SYSCONS_H_
-#define _DEV_SYSCONS_SYSCONS_H_
-
-/* vm things */
-#define ISMAPPED(pa, width) \
- (((pa) <= (u_long)0x1000 - (width)) \
- || ((pa) >= 0xa0000 && (pa) <= 0x100000 - (width)))
-#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
-
-/* printable chars */
-#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
- || (ch) < 0x07)
-
-/* macros for "intelligent" screen update */
-#define mark_for_update(scp, x) {\
- if ((x) < scp->start) scp->start = (x);\
- else if ((x) > scp->end) scp->end = (x);\
- }
-#define mark_all(scp) {\
- scp->start = 0;\
- scp->end = scp->xsize * scp->ysize - 1;\
- }
-
-/* status flags */
-#define UNKNOWN_MODE 0x00010
-#define SWITCH_WAIT_REL 0x00080
-#define SWITCH_WAIT_ACQ 0x00100
-#define BUFFER_SAVED 0x00200
-#define CURSOR_ENABLED 0x00400
-#define MOUSE_ENABLED 0x00800
-#define MOUSE_MOVED 0x01000
-#define MOUSE_CUTTING 0x02000
-#define MOUSE_VISIBLE 0x04000
-#define GRAPHICS_MODE 0x08000
-#define PIXEL_MODE 0x10000
-#define SAVER_RUNNING 0x20000
-
-/* configuration flags */
-#define VISUAL_BELL 0x00001
-#define BLINK_CURSOR 0x00002
-#define CHAR_CURSOR 0x00004
-/* these options are now obsolete; use corresponding options for kbd driver */
-#if 0
-#define DETECT_KBD 0x00008
-#define XT_KEYBD 0x00010
-#define KBD_NORESET 0x00020
-#endif
-#define QUIET_BELL 0x00040
-#define VESA800X600 0x00080
-#define AUTODETECT_KBD 0x00100
-
-/* attribute flags */
-#define NORMAL_ATTR 0x00
-#define BLINK_ATTR 0x01
-#define BOLD_ATTR 0x02
-#define UNDERLINE_ATTR 0x04
-#define REVERSE_ATTR 0x08
-#define FOREGROUND_CHANGED 0x10
-#define BACKGROUND_CHANGED 0x20
-
-/* misc defines */
-#define FALSE 0
-#define TRUE 1
-#define MAX_ESC_PAR 5
-#define LOAD 1
-#define SAVE 0
-#define COL 80
-#define ROW 25
-#define BELL_DURATION 5
-#define BELL_PITCH 800
-#define CONSOLE_BUFSIZE 1024
-#define PCBURST 128
-#define FONT_NONE 1
-#define FONT_8 2
-#define FONT_14 4
-#define FONT_16 8
-
-/* special characters */
-#define cntlc 0x03
-#define cntld 0x04
-#define bs 0x08
-#define lf 0x0a
-#define cr 0x0d
-#define del 0x7f
-
-#define DEAD_CHAR 0x07 /* char used for cursor */
-
-typedef struct term_stat {
- int esc; /* processing escape sequence */
- int num_param; /* # of parameters to ESC */
- int last_param; /* last parameter # */
- int param[MAX_ESC_PAR]; /* contains ESC parameters */
- int cur_attr; /* current hardware attr word */
- int attr_mask; /* current logical attr mask */
- int cur_color; /* current hardware color */
- int std_color; /* normal hardware color */
- int rev_color; /* reverse hardware color */
-} term_stat;
-
-typedef struct scr_stat {
- int ad; /* video adapter index */
- video_adapter_t *adp; /* video adapter structure */
- u_short *scr_buf; /* buffer when off screen */
- int xpos; /* current X position */
- int ypos; /* current Y position */
- int saved_xpos; /* saved X position */
- int saved_ypos; /* saved Y position */
- int xsize; /* X text size */
- int ysize; /* Y text size */
- int xpixel; /* X graphics size */
- int ypixel; /* Y graphics size */
- int xoff; /* X offset in pixel mode */
- int yoff; /* Y offset in pixel mode */
- int font_size; /* fontsize in Y direction */
- int start; /* modified area start */
- int end; /* modified area end */
- term_stat term; /* terminal emulation stuff */
- int status; /* status (bitfield) */
- int kbd_mode; /* keyboard I/O mode */
- u_short *cursor_pos; /* cursor buffer position */
- u_short *cursor_oldpos; /* cursor old buffer position */
- u_short cursor_saveunder; /* saved chars under cursor */
- char cursor_start; /* cursor start line # */
- char cursor_end; /* cursor end line # */
- u_short *mouse_pos; /* mouse buffer position */
- u_short *mouse_oldpos; /* mouse old buffer position */
- short mouse_xpos; /* mouse x coordinate */
- short mouse_ypos; /* mouse y coordinate */
- short mouse_buttons; /* mouse buttons */
- u_char mouse_cursor[128]; /* mouse cursor bitmap store */
- u_short *mouse_cut_start; /* mouse cut start pos */
- u_short *mouse_cut_end; /* mouse cut end pos */
- struct proc *mouse_proc; /* proc* of controlling proc */
- pid_t mouse_pid; /* pid of controlling proc */
- int mouse_signal; /* signal # to report with */
- u_short bell_duration;
- u_short bell_pitch;
- u_char border; /* border color */
- int mode; /* mode */
- pid_t pid; /* pid of controlling proc */
- struct proc *proc; /* proc* of controlling proc */
- struct vt_mode smode; /* switch mode */
- u_short *history; /* circular history buffer */
- u_short *history_head; /* current head position */
- u_short *history_pos; /* position shown on screen */
- u_short *history_save; /* save area index */
- int history_size; /* size of history buffer */
-#ifdef __i386__
- struct apmhook r_hook; /* reconfiguration support */
-#endif
- int splash_save_mode; /* saved mode for splash screen */
- int splash_save_status; /* saved status for splash screen */
-} scr_stat;
-
-typedef struct default_attr {
- int std_color; /* normal hardware color */
- int rev_color; /* reverse hardware color */
-} default_attr;
-
-
-#define ISTEXTSC(scp) (!((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE)))
-#define ISGRAPHSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE)))
-#define ISPIXELSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\
- == PIXEL_MODE)
-#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
-
-#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
-#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
-#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
-
-/* misc prototypes used by different syscons related LKM's */
-
-/* syscons.c */
-int sc_probe_unit(int unit, int flags);
-int sc_attach_unit(int unit, int flags);
-
-extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data, int flag,
- struct proc *p);
-
-int set_mode(scr_stat *scp);
-scr_stat *sc_get_scr_stat(dev_t dev);
-
-void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
-void set_border(scr_stat *scp, int color);
-#define save_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
-#define load_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
-
-void sc_touch_scrn_saver(void);
-void sc_clear_screen(scr_stat *scp);
-void sc_move_mouse(scr_stat *scp, int x, int y);
-int sc_clean_up(scr_stat *scp);
-void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear);
-void sc_alloc_cut_buffer(scr_stat *scp, int wait);
-void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait);
-struct tty *scdevtotty(dev_t dev);
-
-/* scvidctl.c */
-int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode,
- int xsize, int ysize, int fontsize);
-int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode);
-int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
- int xsize, int ysize, int fontsize);
-int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
- struct proc *p);
-
-#endif /* !_DEV_SYSCONS_SYSCONS_H_ */
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
deleted file mode 100644
index ea04a05b67e5..000000000000
--- a/sys/dev/usb/hid.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* $NetBSD: hid.c,v 1.7 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: hid.c,v 1.5 1999/01/07 23:31:29 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/hid.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static void hid_clear_local __P((struct hid_item *));
-
-#define MAXUSAGE 100
-struct hid_data {
- u_char *start;
- u_char *end;
- u_char *p;
- struct hid_item cur;
- int32_t usages[MAXUSAGE];
- int nu;
- int minset;
- int multi;
- int multimax;
- int kindset;
-};
-
-static void
-hid_clear_local(c)
- struct hid_item *c;
-{
- c->usage = 0;
- c->usage_minimum = 0;
- c->usage_maximum = 0;
- c->designator_index = 0;
- c->designator_minimum = 0;
- c->designator_maximum = 0;
- c->string_index = 0;
- c->string_minimum = 0;
- c->string_maximum = 0;
- c->set_delimiter = 0;
-}
-
-struct hid_data *
-hid_start_parse(d, len, kindset)
- void *d;
- int len;
- int kindset;
-{
- struct hid_data *s;
-
- s = malloc(sizeof *s, M_TEMP, M_WAITOK);
- memset(s, 0, sizeof *s);
- s->start = s->p = d;
- s->end = (char *)d + len;
- s->kindset = kindset;
- return (s);
-}
-
-void
-hid_end_parse(s)
- struct hid_data *s;
-{
- while (s->cur.next) {
- struct hid_item *hi = s->cur.next->next;
- free(s->cur.next, M_TEMP);
- s->cur.next = hi;
- }
- free(s, M_TEMP);
-}
-
-int
-hid_get_item(s, h)
- struct hid_data *s;
- struct hid_item *h;
-{
- struct hid_item *c = &s->cur;
- int bTag, bType, bSize;
- u_char *data;
- int32_t dval;
- u_char *p;
- struct hid_item *hi;
- int i;
-
- top:
- if (s->multimax) {
- if (s->multi < s->multimax) {
- c->usage = s->usages[min(s->multi, s->nu-1)];
- s->multi++;
- *h = *c;
- c->loc.pos += c->loc.size;
- h->next = 0;
- return (1);
- } else {
- c->loc.count = s->multimax;
- s->multimax = 0;
- s->nu = 0;
- hid_clear_local(c);
- }
- }
- for (;;) {
- p = s->p;
- if (p >= s->end)
- return (0);
-
- bSize = *p++;
- if (bSize == 0xfe) {
- /* long item */
- bSize = *p++;
- bSize |= *p++ << 8;
- bTag = *p++;
- data = p;
- p += bSize;
- bType = 0xff; /* XXX what should it be */
- } else {
- /* short item */
- bTag = bSize >> 4;
- bType = (bSize >> 2) & 3;
- bSize &= 3;
- if (bSize == 3) bSize = 4;
- data = p;
- p += bSize;
- }
- s->p = p;
- switch(bSize) {
- case 0:
- dval = 0;
- break;
- case 1:
- dval = (int8_t)*data++;
- break;
- case 2:
- dval = *data++;
- dval |= *data++ << 8;
- dval = (int16_t)dval;
- break;
- case 4:
- dval = *data++;
- dval |= *data++ << 8;
- dval |= *data++ << 16;
- dval |= *data++ << 24;
- break;
- default:
- printf("BAD LENGTH %d\n", bSize);
- continue;
- }
-
- switch (bType) {
- case 0: /* Main */
- switch (bTag) {
- case 8: /* Input */
- if (!(s->kindset & (1 << hid_input)))
- continue;
- c->kind = hid_input;
- c->flags = dval;
- ret:
- if (c->flags & HIO_VARIABLE) {
- s->multimax = c->loc.count;
- s->multi = 0;
- c->loc.count = 1;
- if (s->minset) {
- for (i = c->usage_minimum;
- i <= c->usage_maximum;
- i++) {
- s->usages[s->nu] = i;
- if (s->nu < MAXUSAGE-1)
- s->nu++;
- }
- s->minset = 0;
- }
- goto top;
- } else {
- *h = *c;
- h->next = 0;
- c->loc.pos +=
- c->loc.size * c->loc.count;
- hid_clear_local(c);
- s->minset = 0;
- return (1);
- }
- case 9: /* Output */
- if (!(s->kindset & (1 << hid_output)))
- continue;
- c->kind = hid_output;
- c->flags = dval;
- goto ret;
- case 10: /* Collection */
- c->kind = hid_collection;
- c->collection = dval;
- c->collevel++;
- *h = *c;
- hid_clear_local(c);
- s->nu = 0;
- return (1);
- case 11: /* Feature */
- if (!(s->kindset & (1 << hid_feature)))
- continue;
- c->kind = hid_feature;
- c->flags = dval;
- goto ret;
- case 12: /* End collection */
- c->kind = hid_endcollection;
- c->collevel--;
- *h = *c;
- hid_clear_local(c);
- s->nu = 0;
- return (1);
- default:
- printf("Main bTag=%d\n", bTag);
- break;
- }
- break;
- case 1: /* Global */
- switch (bTag) {
- case 0:
- c->_usage_page = dval << 16;
- break;
- case 1:
- c->logical_minimum = dval;
- break;
- case 2:
- c->logical_maximum = dval;
- break;
- case 3:
- c->physical_maximum = dval;
- break;
- case 4:
- c->physical_maximum = dval;
- break;
- case 5:
- c->unit_exponent = dval;
- break;
- case 6:
- c->unit = dval;
- break;
- case 7:
- c->loc.size = dval;
- break;
- case 8:
- c->report_ID = dval;
- break;
- case 9:
- c->loc.count = dval;
- break;
- case 10: /* Push */
- hi = malloc(sizeof *hi, M_TEMP, M_WAITOK);
- *hi = s->cur;
- c->next = hi;
- break;
- case 11: /* Pop */
- hi = c->next;
- s->cur = *hi;
- free(hi, M_TEMP);
- break;
- default:
- printf("Global bTag=%d\n", bTag);
- break;
- }
- break;
- case 2: /* Local */
- switch (bTag) {
- case 0:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage = dval;
- if (s->nu < MAXUSAGE)
- s->usages[s->nu++] = dval;
- /* else XXX */
- break;
- case 1:
- s->minset = 1;
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_minimum = dval;
- break;
- case 2:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_maximum = dval;
- break;
- case 3:
- c->designator_index = dval;
- break;
- case 4:
- c->designator_minimum = dval;
- break;
- case 5:
- c->designator_maximum = dval;
- break;
- case 7:
- c->string_index = dval;
- break;
- case 8:
- c->string_minimum = dval;
- break;
- case 9:
- c->string_maximum = dval;
- break;
- case 10:
- c->set_delimiter = dval;
- break;
- default:
- printf("Local bTag=%d\n", bTag);
- break;
- }
- break;
- default:
- printf("default bType=%d\n", bType);
- break;
- }
- }
-}
-
-int
-hid_report_size(buf, len, k, idp)
- void *buf;
- int len;
- enum hid_kind k;
- u_int8_t *idp;
-{
- struct hid_data *d;
- struct hid_item h;
- int size, id;
-
- id = 0;
- for (d = hid_start_parse(buf, len, 1<<k); hid_get_item(d, &h); )
- if (h.report_ID)
- id = h.report_ID;
- hid_end_parse(d);
- size = h.loc.pos;
- if (id) {
- size += 8;
- *idp = id; /* XXX wrong */
- } else
- *idp = 0;
- return ((size + 7) / 8);
-}
-
-int
-hid_locate(desc, size, u, k, loc, flags)
- void *desc;
- int size;
- u_int32_t u;
- enum hid_kind k;
- struct hid_location *loc;
- u_int32_t *flags;
-{
- struct hid_data *d;
- struct hid_item h;
-
- for (d = hid_start_parse(desc, size, 1<<k); hid_get_item(d, &h); ) {
- if (h.kind == k && !(h.flags & HIO_CONST) && h.usage == u) {
- if (loc)
- *loc = h.loc;
- if (flags)
- *flags = h.flags;
- hid_end_parse(d);
- return (1);
- }
- }
- hid_end_parse(d);
- loc->size = 0;
- return (0);
-}
-
-u_long
-hid_get_data(buf, loc)
- u_char *buf;
- struct hid_location *loc;
-{
- u_int hpos = loc->pos;
- u_int hsize = loc->size;
- u_int32_t data;
- int i, s;
-
- DPRINTFN(10, ("hid_get_data: loc %d/%d\n", hpos, hsize));
-
- if (hsize == 0)
- return (0);
-
- data = 0;
- s = hpos / 8;
- for (i = hpos; i < hpos+hsize; i += 8)
- data |= buf[i / 8] << ((i / 8 - s) * 8);
- data >>= hpos % 8;
- data &= (1 << hsize) - 1;
- hsize = 32 - hsize;
- /* Sign extend */
- data = ((int32_t)data << hsize) >> hsize;
- DPRINTFN(10,("hid_get_data: loc %d/%d = %lu\n",
- loc->pos, loc->size, (long)data));
- return (data);
-}
-
-int
-hid_is_collection(desc, size, usage)
- void *desc;
- int size;
- u_int32_t usage;
-{
- struct hid_data *hd;
- struct hid_item hi;
- int r;
-
- hd = hid_start_parse(desc, size, hid_input);
- if (!hd)
- return (0);
-
- r = hid_get_item(hd, &hi) &&
- hi.kind == hid_collection &&
- hi.usage == usage;
- hid_end_parse(hd);
- return (r);
-}
diff --git a/sys/dev/usb/hid.h b/sys/dev/usb/hid.h
deleted file mode 100644
index 0529701d72a2..000000000000
--- a/sys/dev/usb/hid.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $NetBSD: hid.h,v 1.3 1998/11/25 22:32:04 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-enum hid_kind {
- hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
-};
-
-struct hid_location {
- u_int32_t size;
- u_int32_t count;
- u_int32_t pos;
-};
-
-struct hid_item {
- /* Global */
- int32_t _usage_page;
- int32_t logical_minimum;
- int32_t logical_maximum;
- int32_t physical_minimum;
- int32_t physical_maximum;
- int32_t unit_exponent;
- int32_t unit;
- int32_t report_ID;
- /* Local */
- int32_t usage;
- int32_t usage_minimum;
- int32_t usage_maximum;
- int32_t designator_index;
- int32_t designator_minimum;
- int32_t designator_maximum;
- int32_t string_index;
- int32_t string_minimum;
- int32_t string_maximum;
- int32_t set_delimiter;
- /* Misc */
- int32_t collection;
- int collevel;
- enum hid_kind kind;
- u_int32_t flags;
- /* Location */
- struct hid_location loc;
- /* */
- struct hid_item *next;
-};
-
-struct hid_data *hid_start_parse __P((void *d, int len, int kindset));
-void hid_end_parse __P((struct hid_data *s));
-int hid_get_item __P((struct hid_data *s, struct hid_item *h));
-int hid_report_size __P((void *buf, int len, enum hid_kind k, u_int8_t *id));
-int hid_locate __P((void *desc, int size, u_int32_t usage,
- enum hid_kind kind, struct hid_location *loc,
- u_int32_t *flags));
-u_long hid_get_data __P((u_char *buf, struct hid_location *loc));
-int hid_is_collection __P((void *desc, int size, u_int32_t usage));
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
deleted file mode 100644
index 1cb64b33769a..000000000000
--- a/sys/dev/usb/ohci.c
+++ /dev/null
@@ -1,2228 +0,0 @@
-/* $NetBSD: ohci.c,v 1.23 1999/01/07 02:06:05 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * USB Open Host Controller driver.
- *
- * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/select.h>
-
-#include <machine/bus.h>
-#include <machine/endian.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/ohcireg.h>
-#include <dev/usb/ohcivar.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-
-#define delay(d) DELAY(d)
-
-#endif
-
-/*
- * The OHCI controller is little endian, so on big endian machines
- * the data strored in memory needs to be swapped.
- */
-#if BYTE_ORDER == BIG_ENDIAN
-#define LE(x) (bswap32(x))
-#else
-#define LE(x) (x)
-#endif
-
-struct ohci_pipe;
-
-ohci_soft_ed_t *ohci_alloc_sed __P((ohci_softc_t *));
-void ohci_free_sed __P((ohci_softc_t *, ohci_soft_ed_t *));
-
-ohci_soft_td_t *ohci_alloc_std __P((ohci_softc_t *));
-void ohci_free_std __P((ohci_softc_t *, ohci_soft_td_t *));
-
-usbd_status ohci_open __P((usbd_pipe_handle));
-void ohci_poll __P((struct usbd_bus *));
-void ohci_waitintr __P((ohci_softc_t *, usbd_request_handle));
-void ohci_rhsc __P((ohci_softc_t *, usbd_request_handle));
-void ohci_process_done __P((ohci_softc_t *, ohci_physaddr_t));
-void ohci_ii_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_ctrl_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_intr_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_bulk_done __P((ohci_softc_t *, usbd_request_handle));
-
-usbd_status ohci_device_request __P((usbd_request_handle reqh));
-void ohci_add_ed __P((ohci_soft_ed_t *, ohci_soft_ed_t *));
-void ohci_rem_ed __P((ohci_soft_ed_t *, ohci_soft_ed_t *));
-void ohci_hash_add_td __P((ohci_softc_t *, ohci_soft_td_t *));
-void ohci_hash_rem_td __P((ohci_softc_t *, ohci_soft_td_t *));
-ohci_soft_td_t *ohci_hash_find_td __P((ohci_softc_t *, ohci_physaddr_t));
-
-usbd_status ohci_root_ctrl_transfer __P((usbd_request_handle));
-usbd_status ohci_root_ctrl_start __P((usbd_request_handle));
-void ohci_root_ctrl_abort __P((usbd_request_handle));
-void ohci_root_ctrl_close __P((usbd_pipe_handle));
-
-usbd_status ohci_root_intr_transfer __P((usbd_request_handle));
-usbd_status ohci_root_intr_start __P((usbd_request_handle));
-void ohci_root_intr_abort __P((usbd_request_handle));
-void ohci_root_intr_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_ctrl_transfer __P((usbd_request_handle));
-usbd_status ohci_device_ctrl_start __P((usbd_request_handle));
-void ohci_device_ctrl_abort __P((usbd_request_handle));
-void ohci_device_ctrl_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_bulk_transfer __P((usbd_request_handle));
-usbd_status ohci_device_bulk_start __P((usbd_request_handle));
-void ohci_device_bulk_abort __P((usbd_request_handle));
-void ohci_device_bulk_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_intr_transfer __P((usbd_request_handle));
-usbd_status ohci_device_intr_start __P((usbd_request_handle));
-void ohci_device_intr_abort __P((usbd_request_handle));
-void ohci_device_intr_close __P((usbd_pipe_handle));
-usbd_status ohci_device_setintr __P((ohci_softc_t *sc,
- struct ohci_pipe *pipe, int ival));
-
-int ohci_str __P((usb_string_descriptor_t *, int, char *));
-
-void ohci_timeout __P((void *));
-void ohci_rhsc_able __P((ohci_softc_t *, int));
-
-#ifdef USB_DEBUG
-ohci_softc_t *thesc;
-void ohci_dumpregs __P((ohci_softc_t *));
-void ohci_dump_tds __P((ohci_soft_td_t *));
-void ohci_dump_td __P((ohci_soft_td_t *));
-void ohci_dump_ed __P((ohci_soft_ed_t *));
-#endif
-
-#if defined(__NetBSD__)
-#define OWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
-#define OREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))
-#define OREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
-#elif defined(__FreeBSD__)
-#define OWRITE4(sc, r, x) *(u_int32_t *) ((sc)->sc_iobase + (r)) = x
-#define OREAD4(sc, r) (*(u_int32_t *) ((sc)->sc_iobase + (r)))
-#define OREAD2(sc, r) (*(u_int16_t *) ((sc)->sc_iobase + (r)))
-#endif
-
-/* Reverse the bits in a value 0 .. 31 */
-static u_int8_t revbits[OHCI_NO_INTRS] =
- { 0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0c, 0x1c,
- 0x02, 0x12, 0x0a, 0x1a, 0x06, 0x16, 0x0e, 0x1e,
- 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d,
- 0x03, 0x13, 0x0b, 0x1b, 0x07, 0x17, 0x0f, 0x1f };
-
-struct ohci_pipe {
- struct usbd_pipe pipe;
- ohci_soft_ed_t *sed;
- ohci_soft_td_t *tail;
- /* Info needed for different pipe kinds. */
- union {
- /* Control pipe */
- struct {
- usb_dma_t datadma;
- usb_dma_t reqdma;
- u_int length;
- ohci_soft_td_t *setup, *xfer, *stat;
- } ctl;
- /* Interrupt pipe */
- struct {
- usb_dma_t datadma;
- int nslots;
- int pos;
- } intr;
- /* Bulk pipe */
- struct {
- usb_dma_t datadma;
- u_int length;
- } bulk;
- } u;
-};
-
-#define OHCI_INTR_ENDPT 1
-
-struct usbd_methods ohci_root_ctrl_methods = {
- ohci_root_ctrl_transfer,
- ohci_root_ctrl_start,
- ohci_root_ctrl_abort,
- ohci_root_ctrl_close,
- 0,
-};
-
-struct usbd_methods ohci_root_intr_methods = {
- ohci_root_intr_transfer,
- ohci_root_intr_start,
- ohci_root_intr_abort,
- ohci_root_intr_close,
- 0,
-};
-
-struct usbd_methods ohci_device_ctrl_methods = {
- ohci_device_ctrl_transfer,
- ohci_device_ctrl_start,
- ohci_device_ctrl_abort,
- ohci_device_ctrl_close,
- 0,
-};
-
-struct usbd_methods ohci_device_intr_methods = {
- ohci_device_intr_transfer,
- ohci_device_intr_start,
- ohci_device_intr_abort,
- ohci_device_intr_close,
-};
-
-struct usbd_methods ohci_device_bulk_methods = {
- ohci_device_bulk_transfer,
- ohci_device_bulk_start,
- ohci_device_bulk_abort,
- ohci_device_bulk_close,
- 0,
-};
-
-ohci_soft_ed_t *
-ohci_alloc_sed(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_ed_t *sed;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freeeds) {
- DPRINTFN(2, ("ohci_alloc_sed: allocating chunk\n"));
- sed = malloc(sizeof(ohci_soft_ed_t) * OHCI_ED_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!sed)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, OHCI_ED_SIZE * OHCI_ED_CHUNK,
- OHCI_ED_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sed, M_USBDEV);
- return 0;
- }
- for(i = 0; i < OHCI_ED_CHUNK; i++, sed++) {
- offs = i * OHCI_ED_SIZE;
- sed->physaddr = DMAADDR(&dma) + offs;
- sed->ed = (ohci_ed_t *)
- ((char *)KERNADDR(&dma) + offs);
- sed->next = sc->sc_freeeds;
- sc->sc_freeeds = sed;
- }
- }
- sed = sc->sc_freeeds;
- sc->sc_freeeds = sed->next;
- memset(sed->ed, 0, OHCI_ED_SIZE);
- sed->next = 0;
- return sed;
-}
-
-void
-ohci_free_sed(sc, sed)
- ohci_softc_t *sc;
- ohci_soft_ed_t *sed;
-{
- sed->next = sc->sc_freeeds;
- sc->sc_freeeds = sed;
-}
-
-ohci_soft_td_t *
-ohci_alloc_std(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_td_t *std;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freetds) {
- DPRINTFN(2, ("ohci_alloc_std: allocating chunk\n"));
- std = malloc(sizeof(ohci_soft_td_t) * OHCI_TD_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!std)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, OHCI_TD_SIZE * OHCI_TD_CHUNK,
- OHCI_TD_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(std, M_USBDEV);
- return 0;
- }
- for(i = 0; i < OHCI_TD_CHUNK; i++, std++) {
- offs = i * OHCI_TD_SIZE;
- std->physaddr = DMAADDR(&dma) + offs;
- std->td = (ohci_td_t *)
- ((char *)KERNADDR(&dma) + offs);
- std->nexttd = sc->sc_freetds;
- sc->sc_freetds = std;
- }
- }
- std = sc->sc_freetds;
- sc->sc_freetds = std->nexttd;
- memset(std->td, 0, OHCI_TD_SIZE);
- std->nexttd = 0;
- return (std);
-}
-
-void
-ohci_free_std(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- std->nexttd = sc->sc_freetds;
- sc->sc_freetds = std;
-}
-
-usbd_status
-ohci_init(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_ed_t *sed, *psed;
- usbd_status r;
- int rev;
- int i;
- u_int32_t s, ctl, ival, hcr, fm, per;
-
- DPRINTF(("ohci_init: start\n"));
- rev = OREAD4(sc, OHCI_REVISION);
- printf("%s: OHCI version %d.%d%s\n", USBDEVNAME(sc->sc_bus.bdev),
- OHCI_REV_HI(rev), OHCI_REV_LO(rev),
- OHCI_REV_LEGACY(rev) ? ", legacy support" : "");
- if (OHCI_REV_HI(rev) != 1 || OHCI_REV_LO(rev) != 0) {
- printf("%s: unsupported OHCI revision\n",
- USBDEVNAME(sc->sc_bus.bdev));
- return (USBD_INVAL);
- }
-
- for (i = 0; i < OHCI_HASH_SIZE; i++)
- LIST_INIT(&sc->sc_hash_tds[i]);
-
- /* Allocate the HCCA area. */
- r = usb_allocmem(sc->sc_dmatag, OHCI_HCCA_SIZE,
- OHCI_HCCA_ALIGN, &sc->sc_hccadma);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_hcca = (struct ohci_hcca *)KERNADDR(&sc->sc_hccadma);
- memset(sc->sc_hcca, 0, OHCI_HCCA_SIZE);
-
- sc->sc_eintrs = OHCI_NORMAL_INTRS;
-
- sc->sc_ctrl_head = ohci_alloc_sed(sc);
- if (!sc->sc_ctrl_head) {
- r = USBD_NOMEM;
- goto bad1;
- }
- sc->sc_ctrl_head->ed->ed_flags |= LE(OHCI_ED_SKIP);
- sc->sc_bulk_head = ohci_alloc_sed(sc);
- if (!sc->sc_bulk_head) {
- r = USBD_NOMEM;
- goto bad2;
- }
- sc->sc_bulk_head->ed->ed_flags |= LE(OHCI_ED_SKIP);
-
- /* Allocate all the dummy EDs that make up the interrupt tree. */
- for (i = 0; i < OHCI_NO_EDS; i++) {
- sed = ohci_alloc_sed(sc);
- if (!sed) {
- while (--i >= 0)
- ohci_free_sed(sc, sc->sc_eds[i]);
- r = USBD_NOMEM;
- goto bad3;
- }
- /* All ED fields are set to 0. */
- sc->sc_eds[i] = sed;
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if (i != 0) {
- psed = sc->sc_eds[(i-1) / 2];
- sed->next = psed;
- sed->ed->ed_nexted = LE(psed->physaddr);
- }
- }
- /*
- * Fill HCCA interrupt table. The bit reversal is to get
- * the tree set up properly to spread the interrupts.
- */
- for (i = 0; i < OHCI_NO_INTRS; i++)
- sc->sc_hcca->hcca_interrupt_table[revbits[i]] =
- LE(sc->sc_eds[OHCI_NO_EDS-OHCI_NO_INTRS+i]->physaddr);
-
- /* Determine in what context we are running. */
- ctl = OREAD4(sc, OHCI_CONTROL);
- if (ctl & OHCI_IR) {
- /* SMM active, request change */
- DPRINTF(("ohci_init: SMM active, request owner change\n"));
- s = OREAD4(sc, OHCI_COMMAND_STATUS);
- OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR);
- for (i = 0; i < 100 && (ctl & OHCI_IR); i++) {
- delay(1000);
- ctl = OREAD4(sc, OHCI_CONTROL);
- }
- if ((ctl & OHCI_IR) == 0) {
- printf("%s: SMM does not respond, resetting\n",
- USBDEVNAME(sc->sc_bus.bdev));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- goto reset;
- }
- } else if ((ctl & OHCI_HCFS_MASK) != OHCI_HCFS_RESET) {
- /* BIOS started controller. */
- DPRINTF(("ohci_init: BIOS active\n"));
- if ((ctl & OHCI_HCFS_MASK) != OHCI_HCFS_OPERATIONAL) {
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_OPERATIONAL);
- delay(USB_RESUME_DELAY * 1000);
- }
- } else {
- DPRINTF(("ohci_init: cold started\n"));
- reset:
- /* Controller was cold started. */
- delay(USB_BUS_RESET_DELAY * 1000);
- }
-
- /*
- * This reset should not be necessary according to the OHCI spec, but
- * without it some controllers do not start.
- */
- DPRINTF(("%s: resetting\n", USBDEVNAME(sc->sc_bus.bdev)));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- delay(USB_BUS_RESET_DELAY * 1000);
-
- /* We now own the host controller and the bus has been reset. */
- ival = OHCI_GET_IVAL(OREAD4(sc, OHCI_FM_INTERVAL));
-
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_HCR); /* Reset HC */
- /* Nominal time for a reset is 10 us. */
- for (i = 0; i < 10; i++) {
- delay(10);
- hcr = OREAD4(sc, OHCI_COMMAND_STATUS) & OHCI_HCR;
- if (!hcr)
- break;
- }
- if (hcr) {
- printf("%s: reset timeout\n", USBDEVNAME(sc->sc_bus.bdev));
- r = USBD_IOERROR;
- goto bad3;
- }
-#ifdef USB_DEBUG
- thesc = sc;
- if (ohcidebug > 15)
- ohci_dumpregs(sc);
-#endif
-
- /* The controller is now in suspend state, we have 2ms to finish. */
-
- /* Set up HC registers. */
- OWRITE4(sc, OHCI_HCCA, DMAADDR(&sc->sc_hccadma));
- OWRITE4(sc, OHCI_CONTROL_HEAD_ED, sc->sc_ctrl_head->physaddr);
- OWRITE4(sc, OHCI_BULK_HEAD_ED, sc->sc_bulk_head->physaddr);
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
- OWRITE4(sc, OHCI_INTERRUPT_ENABLE, sc->sc_eintrs | OHCI_MIE);
- ctl = OREAD4(sc, OHCI_CONTROL);
- ctl &= ~(OHCI_CBSR_MASK | OHCI_LES | OHCI_HCFS_MASK | OHCI_IR);
- ctl |= OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE |
- OHCI_RATIO_1_4 | OHCI_HCFS_OPERATIONAL;
- /* And finally start it! */
- OWRITE4(sc, OHCI_CONTROL, ctl);
-
- /*
- * The controller is now OPERATIONAL. Set a some final
- * registers that should be set earlier, but that the
- * controller ignores when in the SUSPEND state.
- */
- fm = (OREAD4(sc, OHCI_FM_INTERVAL) & OHCI_FIT) ^ OHCI_FIT;
- fm |= OHCI_FSMPS(ival) | ival;
- OWRITE4(sc, OHCI_FM_INTERVAL, fm);
- per = OHCI_PERIODIC(ival); /* 90% periodic */
- OWRITE4(sc, OHCI_PERIODIC_START, per);
-
- OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
-
- sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
-
-#ifdef USB_DEBUG
- if (ohcidebug > 5)
- ohci_dumpregs(sc);
-#endif
-
- /* Set up the bus struct. */
- sc->sc_bus.open_pipe = ohci_open;
- sc->sc_bus.pipe_size = sizeof(struct ohci_pipe);
- sc->sc_bus.do_poll = ohci_poll;
-
- return (USBD_NORMAL_COMPLETION);
-
- bad3:
- ohci_free_sed(sc, sc->sc_ctrl_head);
- bad2:
- ohci_free_sed(sc, sc->sc_bulk_head);
- bad1:
- usb_freemem(sc->sc_dmatag, &sc->sc_hccadma);
- return (r);
-}
-
-#ifdef USB_DEBUG
-void ohcidump(void);
-void ohcidump(void) { ohci_dumpregs(thesc); }
-
-void
-ohci_dumpregs(sc)
- ohci_softc_t *sc;
-{
- printf("ohci_dumpregs: rev=0x%08x control=0x%08x command=0x%08x\n",
- OREAD4(sc, OHCI_REVISION),
- OREAD4(sc, OHCI_CONTROL),
- OREAD4(sc, OHCI_COMMAND_STATUS));
- printf(" intrstat=0x%08x intre=0x%08x intrd=0x%08x\n",
- OREAD4(sc, OHCI_INTERRUPT_STATUS),
- OREAD4(sc, OHCI_INTERRUPT_ENABLE),
- OREAD4(sc, OHCI_INTERRUPT_DISABLE));
- printf(" hcca=0x%08x percur=0x%08x ctrlhd=0x%08x\n",
- OREAD4(sc, OHCI_HCCA),
- OREAD4(sc, OHCI_PERIOD_CURRENT_ED),
- OREAD4(sc, OHCI_CONTROL_HEAD_ED));
- printf(" ctrlcur=0x%08x bulkhd=0x%08x bulkcur=0x%08x\n",
- OREAD4(sc, OHCI_CONTROL_CURRENT_ED),
- OREAD4(sc, OHCI_BULK_HEAD_ED),
- OREAD4(sc, OHCI_BULK_CURRENT_ED));
- printf(" done=0x%08x fmival=0x%08x fmrem=0x%08x\n",
- OREAD4(sc, OHCI_DONE_HEAD),
- OREAD4(sc, OHCI_FM_INTERVAL),
- OREAD4(sc, OHCI_FM_REMAINING));
- printf(" fmnum=0x%08x perst=0x%08x lsthrs=0x%08x\n",
- OREAD4(sc, OHCI_FM_NUMBER),
- OREAD4(sc, OHCI_PERIODIC_START),
- OREAD4(sc, OHCI_LS_THRESHOLD));
- printf(" desca=0x%08x descb=0x%08x stat=0x%08x\n",
- OREAD4(sc, OHCI_RH_DESCRIPTOR_A),
- OREAD4(sc, OHCI_RH_DESCRIPTOR_B),
- OREAD4(sc, OHCI_RH_STATUS));
- printf(" port1=0x%08x port2=0x%08x\n",
- OREAD4(sc, OHCI_RH_PORT_STATUS(1)),
- OREAD4(sc, OHCI_RH_PORT_STATUS(2)));
- printf(" HCCA: frame_number=0x%04x done_head=0x%08x\n",
- LE(sc->sc_hcca->hcca_frame_number),
- LE(sc->sc_hcca->hcca_done_head));
-}
-#endif
-
-int
-ohci_intr(p)
- void *p;
-{
- ohci_softc_t *sc = p;
- u_int32_t intrs = 0, eintrs;
- ohci_physaddr_t done;
-
- /* In case the interrupt occurs before initialization has completed. */
- if (sc == NULL || sc->sc_hcca == NULL) { /* NWH added sc==0 */
-#ifdef DIAGNOSTIC
- printf("ohci_intr: sc->sc_hcca == NULL\n");
-#endif
- return (0);
- }
-
- done = LE(sc->sc_hcca->hcca_done_head);
- if (done != 0) {
- sc->sc_hcca->hcca_done_head = 0;
- if (done & ~OHCI_DONE_INTRS)
- intrs = OHCI_WDH;
- if (done & OHCI_DONE_INTRS)
- intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS);
- } else
- intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS);
- if (!intrs)
- return (0);
- intrs &= ~OHCI_MIE;
- OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs); /* Acknowledge */
- eintrs = intrs & sc->sc_eintrs;
- if (!eintrs)
- return (0);
-
- sc->sc_intrs++;
- DPRINTFN(7, ("ohci_intr: sc=%p intrs=%x(%x) eintr=%x\n",
- sc, (u_int)intrs, OREAD4(sc, OHCI_INTERRUPT_STATUS),
- (u_int)eintrs));
-
- if (eintrs & OHCI_SO) {
- printf("%s: scheduling overrun\n",USBDEVNAME(sc->sc_bus.bdev));
- /* XXX do what */
- intrs &= ~OHCI_SO;
- }
- if (eintrs & OHCI_WDH) {
- ohci_process_done(sc, done &~ OHCI_DONE_INTRS);
- intrs &= ~OHCI_WDH;
- }
- if (eintrs & OHCI_RD) {
- /* XXX process resume detect */
- }
- if (eintrs & OHCI_UE) {
- printf("%s: unrecoverable error, controller halted\n",
- USBDEVNAME(sc->sc_bus.bdev));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- /* XXX what else */
- }
- if (eintrs & OHCI_RHSC) {
- ohci_rhsc(sc, sc->sc_intrreqh);
- intrs &= ~OHCI_RHSC;
-
- /*
- * Disable RHSC interrupt for now, because it will be
- * on until the port has been reset.
- */
- ohci_rhsc_able(sc, 0);
- }
-
- /* Block unprocessed interrupts. XXX */
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, intrs);
- sc->sc_eintrs &= ~intrs;
-
- return (1);
-}
-
-void
-ohci_rhsc_able(sc, on)
- ohci_softc_t *sc;
- int on;
-{
- DPRINTFN(4, ("ohci_rhsc_able: on=%d\n", on));
- if (on) {
- sc->sc_eintrs |= OHCI_RHSC;
- OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_RHSC);
- } else {
- sc->sc_eintrs &= ~OHCI_RHSC;
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_RHSC);
- }
-}
-
-#ifdef USB_DEBUG
-char *ohci_cc_strs[] = {
- "NO_ERROR",
- "CRC",
- "BIT_STUFFING",
- "DATA_TOGGLE_MISMATCH",
- "STALL",
- "DEVICE_NOT_RESPONDING",
- "PID_CHECK_FAILURE",
- "UNEXPECTED_PID",
- "DATA_OVERRUN",
- "DATA_UNDERRUN",
- "BUFFER_OVERRUN",
- "BUFFER_UNDERRUN",
- "NOT_ACCESSED",
-};
-#endif
-
-void
-ohci_process_done(sc, done)
- ohci_softc_t *sc;
- ohci_physaddr_t done;
-{
- ohci_soft_td_t *std = NULL, *sdone;
- usbd_request_handle reqh;
- int len, cc;
-
- DPRINTFN(10,("ohci_process_done: done=0x%08lx\n", (u_long)done));
-
- /* Reverse the done list. */
- for (sdone = 0; done; done = LE(std->td->td_nexttd)) {
- std = ohci_hash_find_td(sc, done);
- std->dnext = sdone;
- sdone = std;
- }
-
-#ifdef USB_DEBUG
- if (ohcidebug > 10) {
- printf("ohci_process_done: TD done:\n");
- ohci_dump_tds(sdone);
- }
-#endif
-
- for (std = sdone; std; std = std->dnext) {
- reqh = std->reqh;
- DPRINTFN(10, ("ohci_process_done: std=%p reqh=%p hcpriv=%p\n",
- std, reqh, reqh->hcpriv));
- cc = OHCI_TD_GET_CC(LE(std->td->td_flags));
- if (cc == OHCI_CC_NO_ERROR) {
- if (std->td->td_cbp == 0)
- len = std->len;
- else
- len = LE(std->td->td_be) -
- LE(std->td->td_cbp) + 1;
- /*
- * Only do a callback on the last stage of a transfer.
- * Others have hcpriv = 0.
- */
- if ((reqh->pipe->endpoint->edesc->bmAttributes &
- UE_XFERTYPE) == UE_CONTROL) {
- /* For a control transfer the length is in
- * the xfer stage */
- if (reqh->hcpriv == std) {
- reqh->status = USBD_NORMAL_COMPLETION;
- ohci_ii_done(sc, reqh);
- } else
- reqh->actlen = len;
- } else {
- if (reqh->hcpriv == std) {
- reqh->actlen = len;
- reqh->status = USBD_NORMAL_COMPLETION;
- ohci_ii_done(sc, reqh);
- }
- }
- } else {
- ohci_soft_td_t *p, *n;
- struct ohci_pipe *opipe =
- (struct ohci_pipe *)reqh->pipe;
- DPRINTFN(-1,("ohci_process_done: error cc=%d (%s)\n",
- OHCI_TD_GET_CC(LE(std->td->td_flags)),
- ohci_cc_strs[OHCI_TD_GET_CC(LE(std->td->td_flags))]));
- /*
- * Endpoint is halted. First unlink all the TDs
- * belonging to the failed transfer, and then restart
- * the endpoint.
- */
- for (p = std->nexttd; p->reqh == reqh; p = n) {
- n = p->nexttd;
- ohci_hash_rem_td(sc, p);
- ohci_free_std(sc, p);
- }
- /* clear halt */
- opipe->sed->ed->ed_headp = LE(p->physaddr);
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
-
- if (cc == OHCI_CC_STALL)
- reqh->status = USBD_STALLED;
- else
- reqh->status = USBD_IOERROR;
- ohci_ii_done(sc, reqh);
- }
- ohci_hash_rem_td(sc, std);
- ohci_free_std(sc, std);
- }
-}
-
-void
-ohci_ii_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- switch (reqh->pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- ohci_ctrl_done(sc, reqh);
- usb_start_next(reqh->pipe);
- break;
- case UE_INTERRUPT:
- ohci_intr_done(sc, reqh);
- break;
- case UE_BULK:
- ohci_bulk_done(sc, reqh);
- usb_start_next(reqh->pipe);
- break;
- case UE_ISOCHRONOUS:
- printf("ohci_process_done: ISO done?\n");
- usb_start_next(reqh->pipe);
- break;
- }
-
- /* And finally execute callback. */
- reqh->xfercb(reqh);
-}
-
-void
-ohci_ctrl_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- u_int len = opipe->u.ctl.length;
- usb_dma_t *dma;
-
- DPRINTFN(10,("ohci_ctrl_done: reqh=%p\n", reqh));
-
- if (!reqh->isreq) {
- panic("ohci_ctrl_done: not a request\n");
- return;
- }
-
- if (len != 0) {
- dma = &opipe->u.ctl.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- usb_freemem(sc->sc_dmatag, dma);
- }
- usb_untimeout(ohci_timeout, reqh, reqh->timo_handle);
-}
-
-void
-ohci_intr_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_dma_t *dma;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *xfer, *tail;
-
-
- DPRINTFN(10,("ohci_intr_done: reqh=%p, actlen=%d\n",
- reqh, reqh->actlen));
-
- dma = &opipe->u.intr.datadma;
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
-
- if (reqh->pipe->intrreqh == reqh) {
- xfer = opipe->tail;
- tail = ohci_alloc_std(sc); /* XXX should reuse TD */
- if (!tail) {
- reqh->status = USBD_NOMEM;
- return;
- }
- tail->reqh = 0;
-
- xfer->td->td_flags = LE(
- OHCI_TD_IN | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY);
- if (reqh->flags & USBD_SHORT_XFER_OK)
- xfer->td->td_flags |= LE(OHCI_TD_R);
- xfer->td->td_cbp = LE(DMAADDR(dma));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + reqh->length - 1);
- xfer->len = reqh->length;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- } else {
- usb_freemem(sc->sc_dmatag, dma);
- usb_start_next(reqh->pipe);
- }
-}
-
-void
-ohci_bulk_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_dma_t *dma;
-
-
- DPRINTFN(10,("ohci_bulk_done: reqh=%p, actlen=%d\n",
- reqh, reqh->actlen));
-
- dma = &opipe->u.bulk.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
- usb_freemem(sc->sc_dmatag, dma);
- usb_untimeout(ohci_timeout, reqh, reqh->timo_handle);
-}
-
-void
-ohci_rhsc(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe;
- struct ohci_pipe *opipe;
- u_char *p;
- int i, m;
- int hstatus;
-
- hstatus = OREAD4(sc, OHCI_RH_STATUS);
- DPRINTF(("ohci_rhsc: sc=%p reqh=%p hstatus=0x%08x\n",
- sc, reqh, hstatus));
-
- if (reqh == 0) {
- /* Just ignore the change. */
- return;
- }
-
- pipe = reqh->pipe;
- opipe = (struct ohci_pipe *)pipe;
-
- p = KERNADDR(&opipe->u.intr.datadma);
- m = min(sc->sc_noport, reqh->length * 8 - 1);
- memset(p, 0, reqh->length);
- for (i = 1; i <= m; i++) {
- if (OREAD4(sc, OHCI_RH_PORT_STATUS(i)) >> 16)
- p[i/8] |= 1 << (i%8);
- }
- DPRINTF(("ohci_rhsc: change=0x%02x\n", *p));
- reqh->actlen = reqh->length;
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->xfercb(reqh);
-
- if (reqh->pipe->intrreqh != reqh) {
- sc->sc_intrreqh = 0;
- usb_freemem(sc->sc_dmatag, &opipe->u.intr.datadma);
- usb_start_next(reqh->pipe);
- }
-}
-
-/*
- * Wait here until controller claims to have an interrupt.
- * Then call ohci_intr and return. Use timeout to avoid waiting
- * too long.
- */
-void
-ohci_waitintr(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- int timo = reqh->timeout;
- int usecs;
- u_int32_t intrs;
-
- reqh->status = USBD_IN_PROGRESS;
- for (usecs = timo * 1000000 / hz; usecs > 0; usecs -= 1000) {
- usb_delay_ms(&sc->sc_bus, 1);
- intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs;
- DPRINTFN(15,("ohci_waitintr: 0x%04x\n", intrs));
-#ifdef USB_DEBUG
- if (ohcidebug > 15)
- ohci_dumpregs(sc);
-#endif
- if (intrs) {
- ohci_intr(sc);
- if (reqh->status != USBD_IN_PROGRESS)
- return;
- }
- }
-
- /* Timeout */
- DPRINTF(("ohci_waitintr: timeout\n"));
- reqh->status = USBD_TIMEOUT;
- ohci_ii_done(sc, reqh);
- /* XXX should free TD */
-}
-
-void
-ohci_poll(bus)
- struct usbd_bus *bus;
-{
- ohci_softc_t *sc = (ohci_softc_t *)bus;
-
- if (OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs)
- ohci_intr(sc);
-}
-
-usbd_status
-ohci_device_request(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_device_request_t *req = &reqh->request;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int addr = dev->address;
- ohci_soft_td_t *setup, *xfer = 0, *stat, *next, *tail;
- ohci_soft_ed_t *sed;
- usb_dma_t *dmap;
- int isread;
- int len;
- usbd_status r;
- int s;
-
- isread = req->bmRequestType & UT_READ;
- len = UGETW(req->wLength);
-
- DPRINTFN(3,("ohci_device_control type=0x%02x, request=0x%02x, "
- "wValue=0x%04x, wIndex=0x%04x len=%d, addr=%d, endpt=%d\n",
- req->bmRequestType, req->bRequest, UGETW(req->wValue),
- UGETW(req->wIndex), len, addr,
- opipe->pipe.endpoint->edesc->bEndpointAddress));
-
- setup = opipe->tail;
- stat = ohci_alloc_std(sc);
- if (!stat) {
- r = USBD_NOMEM;
- goto bad1;
- }
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto bad2;
- }
- tail->reqh = 0;
-
- sed = opipe->sed;
- dmap = &opipe->u.ctl.datadma;
- opipe->u.ctl.length = len;
-
- /* Update device address and length since they may have changed. */
- /* XXX This only needs to be done once, but it's too early in open. */
- sed->ed->ed_flags = LE(
- (LE(sed->ed->ed_flags) & ~(OHCI_ED_ADDRMASK | OHCI_ED_MAXPMASK)) |
- OHCI_ED_SET_FA(addr) |
- OHCI_ED_SET_MAXP(UGETW(opipe->pipe.endpoint->edesc->wMaxPacketSize)));
-
- /* Set up data transaction */
- if (len != 0) {
- xfer = ohci_alloc_std(sc);
- if (!xfer) {
- r = USBD_NOMEM;
- goto bad3;
- }
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad4;
- xfer->td->td_flags = LE(
- (isread ? OHCI_TD_IN : OHCI_TD_OUT) | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_1 | OHCI_TD_NOINTR |
- (reqh->flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0));
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = stat;
- xfer->td->td_nexttd = LE(stat->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- next = xfer;
- } else
- next = stat;
-
- memcpy(KERNADDR(&opipe->u.ctl.reqdma), req, sizeof *req);
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- setup->td->td_flags = LE(OHCI_TD_SETUP | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_0 | OHCI_TD_NOINTR);
- setup->td->td_cbp = LE(DMAADDR(&opipe->u.ctl.reqdma));
- setup->nexttd = next;
- setup->td->td_nexttd = LE(next->physaddr);
- setup->td->td_be = LE(LE(setup->td->td_cbp) + sizeof *req - 1);
- setup->len = 0; /* XXX The number of byte we count */
- setup->reqh = reqh;
-
- stat->td->td_flags = LE(
- (isread ? OHCI_TD_OUT : OHCI_TD_IN) | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_1 | OHCI_TD_SET_DI(1));
- stat->td->td_cbp = 0;
- stat->nexttd = tail;
- stat->td->td_nexttd = LE(tail->physaddr);
- stat->td->td_be = 0;
- stat->len = 0;
- stat->reqh = reqh;
-
- reqh->hcpriv = stat;
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- printf("ohci_device_request:\n");
- ohci_dump_ed(sed);
- ohci_dump_tds(setup);
- }
-#endif
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, setup);
- if (len != 0)
- ohci_hash_add_td(sc, xfer);
- ohci_hash_add_td(sc, stat);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
- splx(s);
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- delay(5000);
- printf("ohci_device_request: status=%x\n",
- OREAD4(sc, OHCI_COMMAND_STATUS));
- ohci_dump_ed(sed);
- ohci_dump_tds(setup);
- }
-#endif
-
- return (USBD_NORMAL_COMPLETION);
-
- bad4:
- ohci_free_std(sc, xfer);
- bad3:
- ohci_free_std(sc, tail);
- bad2:
- ohci_free_std(sc, stat);
- bad1:
- return (r);
-}
-
-/*
- * Add an ED to the schedule. Called at splusb().
- */
-void
-ohci_add_ed(sed, head)
- ohci_soft_ed_t *sed;
- ohci_soft_ed_t *head;
-{
- sed->next = head->next;
- sed->ed->ed_nexted = head->ed->ed_nexted;
- head->next = sed;
- head->ed->ed_nexted = LE(sed->physaddr);
-}
-
-/*
- * Remove an ED from the schedule. Called at splusb().
- */
-void
-ohci_rem_ed(sed, head)
- ohci_soft_ed_t *sed;
- ohci_soft_ed_t *head;
-{
- ohci_soft_ed_t *p;
-
- /* XXX */
- for (p = head; p && p->next != sed; p = p->next)
- ;
- if (!p)
- panic("ohci_rem_ed: ED not found\n");
- p->next = sed->next;
- p->ed->ed_nexted = sed->ed->ed_nexted;
-}
-
-/*
- * When a transfer is completed the TD is added to the done queue by
- * the host controller. This queue is the processed by software.
- * Unfortunately the queue contains the physical address of the TD
- * and we have no simple way to translate this back to a kernel address.
- * To make the translation possible (and fast) we use a hash table of
- * TDs currently in the schedule. The physical address is used as the
- * hash value.
- */
-
-#define HASH(a) (((a) >> 4) % OHCI_HASH_SIZE)
-/* Called at splusb() */
-void
-ohci_hash_add_td(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- int h = HASH(std->physaddr);
-
- LIST_INSERT_HEAD(&sc->sc_hash_tds[h], std, hnext);
-}
-
-/* Called at splusb() */
-void
-ohci_hash_rem_td(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- LIST_REMOVE(std, hnext);
-}
-
-ohci_soft_td_t *
-ohci_hash_find_td(sc, a)
- ohci_softc_t *sc;
- ohci_physaddr_t a;
-{
- int h = HASH(a);
- ohci_soft_td_t *std;
-
- for (std = LIST_FIRST(&sc->sc_hash_tds[h]);
- std != 0;
- std = LIST_NEXT(std, hnext))
- if (std->physaddr == a)
- return (std);
- panic("ohci_hash_find_td: addr 0x%08lx not found\n", (u_long)a);
-}
-
-void
-ohci_timeout(addr)
- void *addr;
-{
-#if 0
- usbd_request_handle *reqh = addr;
- int s;
-
- DPRINTF(("ohci_timeout: reqh=%p\n", reqh));
- s = splusb();
- /* XXX need to inactivate TD before calling interrupt routine */
- ohci_XXX_done(reqh);
- splx(s);
-#endif
-}
-
-#ifdef USB_DEBUG
-void
-ohci_dump_tds(std)
- ohci_soft_td_t *std;
-{
- for (; std; std = std->nexttd)
- ohci_dump_td(std);
-}
-
-void
-ohci_dump_td(std)
- ohci_soft_td_t *std;
-{
- printf("TD(%p) at %08lx: %b delay=%d ec=%d cc=%d\ncbp=0x%08lx "
- "nexttd=0x%08lx be=0x%08lx\n",
- std, (u_long)std->physaddr,
- (int)LE(std->td->td_flags),
- "\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
- OHCI_TD_GET_DI(LE(std->td->td_flags)),
- OHCI_TD_GET_EC(LE(std->td->td_flags)),
- OHCI_TD_GET_CC(LE(std->td->td_flags)),
- (u_long)LE(std->td->td_cbp),
- (u_long)LE(std->td->td_nexttd), (u_long)LE(std->td->td_be));
-}
-
-void
-ohci_dump_ed(sed)
- ohci_soft_ed_t *sed;
-{
- printf("ED(%p) at %08lx: addr=%d endpt=%d maxp=%d %b\ntailp=0x%08lx "
- "headp=%b nexted=0x%08lx\n",
- sed, (u_long)sed->physaddr,
- OHCI_ED_GET_FA(LE(sed->ed->ed_flags)),
- OHCI_ED_GET_EN(LE(sed->ed->ed_flags)),
- OHCI_ED_GET_MAXP(LE(sed->ed->ed_flags)),
- (int)LE(sed->ed->ed_flags),
- "\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
- (u_long)LE(sed->ed->ed_tailp),
- (int)LE(sed->ed->ed_headp), "\20\1HALT\2CARRY",
- (u_long)LE(sed->ed->ed_nexted));
-}
-#endif
-
-usbd_status
-ohci_open(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- u_int8_t addr = dev->address;
- ohci_soft_ed_t *sed;
- ohci_soft_td_t *std;
- usbd_status r;
- int s;
-
- DPRINTFN(1, ("ohci_open: pipe=%p, addr=%d, endpt=%d (%d)\n",
- pipe, addr, ed->bEndpointAddress, sc->sc_addr));
- if (addr == sc->sc_addr) {
- switch (ed->bEndpointAddress) {
- case USB_CONTROL_ENDPOINT:
- pipe->methods = &ohci_root_ctrl_methods;
- break;
- case UE_IN | OHCI_INTR_ENDPT:
- pipe->methods = &ohci_root_intr_methods;
- break;
- default:
- return (USBD_INVAL);
- }
- } else {
- sed = ohci_alloc_sed(sc);
- if (sed == 0)
- goto bad0;
- std = ohci_alloc_std(sc);
- if (std == 0)
- goto bad1;
- opipe->sed = sed;
- opipe->tail = std;
- sed->ed->ed_flags = LE(
- OHCI_ED_SET_FA(addr) |
- OHCI_ED_SET_EN(ed->bEndpointAddress) |
- OHCI_ED_DIR_TD |
- (dev->lowspeed ? OHCI_ED_SPEED : 0) |
- ((ed->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS ?
- OHCI_ED_FORMAT_ISO : OHCI_ED_FORMAT_GEN) |
- OHCI_ED_SET_MAXP(UGETW(ed->wMaxPacketSize)));
- sed->ed->ed_headp = sed->ed->ed_tailp = LE(std->physaddr);
-
- switch (ed->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- pipe->methods = &ohci_device_ctrl_methods;
- r = usb_allocmem(sc->sc_dmatag,
- sizeof(usb_device_request_t),
- 0, &opipe->u.ctl.reqdma);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- s = splusb();
- ohci_add_ed(sed, sc->sc_ctrl_head);
- splx(s);
- break;
- case UE_INTERRUPT:
- pipe->methods = &ohci_device_intr_methods;
- return (ohci_device_setintr(sc, opipe, ed->bInterval));
- case UE_ISOCHRONOUS:
- printf("ohci_open: open iso unimplemented\n");
- return (USBD_XXX);
- case UE_BULK:
- pipe->methods = &ohci_device_bulk_methods;
- s = splusb();
- ohci_add_ed(sed, sc->sc_bulk_head);
- splx(s);
- break;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- ohci_free_std(sc, std);
- bad1:
- ohci_free_sed(sc, sed);
- bad0:
- return (USBD_NOMEM);
-
-}
-
-/*
- * Data structures and routines to emulate the root hub.
- */
-usb_device_descriptor_t ohci_devd = {
- USB_DEVICE_DESCRIPTOR_SIZE,
- UDESC_DEVICE, /* type */
- {0x00, 0x01}, /* USB version */
- UCLASS_HUB, /* class */
- USUBCLASS_HUB, /* subclass */
- 0, /* protocol */
- 64, /* max packet */
- {0},{0},{0x00,0x01}, /* device id */
- 1,2,0, /* string indicies */
- 1 /* # of configurations */
-};
-
-usb_config_descriptor_t ohci_confd = {
- USB_CONFIG_DESCRIPTOR_SIZE,
- UDESC_CONFIG,
- {USB_CONFIG_DESCRIPTOR_SIZE +
- USB_INTERFACE_DESCRIPTOR_SIZE +
- USB_ENDPOINT_DESCRIPTOR_SIZE},
- 1,
- 1,
- 0,
- UC_SELF_POWERED,
- 0 /* max power */
-};
-
-usb_interface_descriptor_t ohci_ifcd = {
- USB_INTERFACE_DESCRIPTOR_SIZE,
- UDESC_INTERFACE,
- 0,
- 0,
- 1,
- UCLASS_HUB,
- USUBCLASS_HUB,
- 0,
- 0
-};
-
-usb_endpoint_descriptor_t ohci_endpd = {
- USB_ENDPOINT_DESCRIPTOR_SIZE,
- UDESC_ENDPOINT,
- UE_IN | OHCI_INTR_ENDPT,
- UE_INTERRUPT,
- {8, 0}, /* max packet */
- 255
-};
-
-usb_hub_descriptor_t ohci_hubd = {
- USB_HUB_DESCRIPTOR_SIZE,
- UDESC_HUB,
- 0,
- {0,0},
- 0,
- 0,
- {0},
-};
-
-int
-ohci_str(p, l, s)
- usb_string_descriptor_t *p;
- int l;
- char *s;
-{
- int i;
-
- if (l == 0)
- return (0);
- p->bLength = 2 * strlen(s) + 2;
- if (l == 1)
- return (1);
- p->bDescriptorType = UDESC_STRING;
- l -= 2;
- for (i = 0; s[i] && l > 1; i++, l -= 2)
- USETW2(p->bString[i], 0, s[i]);
- return (2*i+2);
-}
-
-/*
- * Simulate a hardware hub by handling all the necessary requests.
- */
-usbd_status
-ohci_root_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_root_ctrl_start(reqh));
-}
-
-usbd_status
-ohci_root_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- ohci_softc_t *sc = (ohci_softc_t *)reqh->pipe->device->bus;
- usb_device_request_t *req;
- void *buf;
- int port, i;
- int len, value, index, l, totlen = 0;
- usb_port_status_t ps;
- usb_hub_descriptor_t hubd;
- usbd_status r;
- u_int32_t v;
-
- if (!reqh->isreq)
- /* XXX panic */
- return (USBD_INVAL);
- req = &reqh->request;
- buf = reqh->buffer;
-
- DPRINTFN(4,("ohci_root_ctrl_control type=0x%02x request=%02x\n",
- req->bmRequestType, req->bRequest));
-
- len = UGETW(req->wLength);
- value = UGETW(req->wValue);
- index = UGETW(req->wIndex);
-#define C(x,y) ((x) | ((y) << 8))
- switch(C(req->bRequest, req->bmRequestType)) {
- case C(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
- /*
- * DEVICE_REMOTE_WAKEUP and ENDPOINT_HALT are no-ops
- * for the integrated root hub.
- */
- break;
- case C(UR_GET_CONFIG, UT_READ_DEVICE):
- if (len > 0) {
- *(u_int8_t *)buf = sc->sc_conf;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
- DPRINTFN(8,("ohci_root_ctrl_control wValue=0x%04x\n", value));
- switch(value >> 8) {
- case UDESC_DEVICE:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_DEVICE_DESCRIPTOR_SIZE);
- memcpy(buf, &ohci_devd, l);
- break;
- case UDESC_CONFIG:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_CONFIG_DESCRIPTOR_SIZE);
- memcpy(buf, &ohci_confd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_INTERFACE_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &ohci_ifcd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &ohci_endpd, l);
- break;
- case UDESC_STRING:
- if (len == 0)
- break;
- *(u_int8_t *)buf = 0;
- totlen = 1;
- switch (value & 0xff) {
- case 1: /* Vendor */
- totlen = ohci_str(buf, len, sc->sc_vendor);
- break;
- case 2: /* Product */
- totlen = ohci_str(buf, len, "OHCI root hub");
- break;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_INTERFACE, UT_READ_INTERFACE):
- if (len > 0) {
- *(u_int8_t *)buf = 0;
- totlen = 1;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_DEVICE):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus,UDS_SELF_POWERED);
- totlen = 2;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_INTERFACE):
- case C(UR_GET_STATUS, UT_READ_ENDPOINT):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus, 0);
- totlen = 2;
- }
- break;
- case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
- if (value >= USB_MAX_DEVICES) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_addr = value;
- break;
- case C(UR_SET_CONFIG, UT_WRITE_DEVICE):
- if (value != 0 && value != 1) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_conf = value;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_DEVICE):
- case C(UR_SET_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
- break;
- case C(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
- break;
- /* Hub requests */
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER):
- DPRINTFN(8, ("ohci_root_ctrl_control: UR_CLEAR_PORT_FEATURE "
- "port=%d feature=%d\n",
- index, value));
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- port = OHCI_RH_PORT_STATUS(index);
- switch(value) {
- case UHF_PORT_ENABLE:
- OWRITE4(sc, port, UPS_CURRENT_CONNECT_STATUS);
- break;
- case UHF_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_OVERCURRENT_INDICATOR);
- break;
- case UHF_PORT_POWER:
- OWRITE4(sc, port, UPS_LOW_SPEED);
- break;
- case UHF_C_PORT_CONNECTION:
- OWRITE4(sc, port, UPS_C_CONNECT_STATUS << 16);
- break;
- case UHF_C_PORT_ENABLE:
- OWRITE4(sc, port, UPS_C_PORT_ENABLED << 16);
- break;
- case UHF_C_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_C_SUSPEND << 16);
- break;
- case UHF_C_PORT_OVER_CURRENT:
- OWRITE4(sc, port, UPS_C_OVERCURRENT_INDICATOR << 16);
- break;
- case UHF_C_PORT_RESET:
- OWRITE4(sc, port, UPS_C_PORT_RESET << 16);
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_C_PORT_CONNECTION:
- case UHF_C_PORT_ENABLE:
- case UHF_C_PORT_SUSPEND:
- case UHF_C_PORT_OVER_CURRENT:
- case UHF_C_PORT_RESET:
- /* Enable RHSC interrupt if condition is cleared. */
- if ((OREAD4(sc, port) >> 16) == 0)
- ohci_rhsc_able(sc, 1);
- break;
- default:
- break;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- v = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
- hubd = ohci_hubd;
- hubd.bNbrPorts = sc->sc_noport;
- USETW(hubd.wHubCharacteristics,
- (v & OHCI_NPS ? UHD_PWR_NO_SWITCH :
- v & OHCI_PSM ? UHD_PWR_GANGED : UHD_PWR_INDIVIDUAL)
- /* XXX overcurrent */
- );
- hubd.bPwrOn2PwrGood = OHCI_GET_POTPGT(v);
- v = OREAD4(sc, OHCI_RH_DESCRIPTOR_B);
- for (i = 0, l = sc->sc_noport; l > 0; i++, l -= 8, v >>= 8)
- hubd.DeviceRemovable[i++] = (u_int8_t)v;
- hubd.bDescLength = USB_HUB_DESCRIPTOR_SIZE + i;
- l = min(len, hubd.bDescLength);
- totlen = l;
- memcpy(buf, &hubd, l);
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- memset(buf, 0, len); /* ? XXX */
- totlen = len;
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
- DPRINTFN(8,("ohci_root_ctrl_transfer: get port status i=%d\n",
- index));
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- v = OREAD4(sc, OHCI_RH_PORT_STATUS(index));
- DPRINTFN(8,("ohci_root_ctrl_transfer: port status=0x%04x\n",
- v));
- USETW(ps.wPortStatus, v);
- USETW(ps.wPortChange, v >> 16);
- l = min(len, sizeof ps);
- memcpy(buf, &ps, l);
- totlen = l;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_CLASS_DEVICE):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER):
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- port = OHCI_RH_PORT_STATUS(index);
- switch(value) {
- case UHF_PORT_ENABLE:
- OWRITE4(sc, port, UPS_PORT_ENABLED);
- break;
- case UHF_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_SUSPEND);
- break;
- case UHF_PORT_RESET:
- DPRINTFN(5,("ohci_root_ctrl_transfer: reset port %d\n",
- index));
- OWRITE4(sc, port, UPS_RESET);
- for (i = 0; i < 10; i++) {
- usb_delay_ms(&sc->sc_bus, 10);
- if ((OREAD4(sc, port) & UPS_RESET) == 0)
- break;
- }
- DPRINTFN(8,("ohci port %d reset, status = 0x%04x\n",
- index, OREAD4(sc, port)));
- break;
- case UHF_PORT_POWER:
- DPRINTFN(2,("ohci_root_ctrl_transfer: set port power "
- "%d\n", index));
- OWRITE4(sc, port, UPS_PORT_POWER);
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- reqh->actlen = totlen;
- r = USBD_NORMAL_COMPLETION;
- ret:
- reqh->status = r;
- reqh->xfercb(reqh);
- usb_start_next(reqh->pipe);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root control request. */
-void
-ohci_root_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* Nothing to do, all transfers are synchronous. */
-}
-
-/* Close the root pipe. */
-void
-ohci_root_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- DPRINTF(("ohci_root_ctrl_close\n"));
-}
-
-usbd_status
-ohci_root_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_root_intr_start(reqh));
-}
-
-usbd_status
-ohci_root_intr_start(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- struct ohci_pipe *upipe = (struct ohci_pipe *)pipe;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_intrreqh = reqh;
-
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root interrupt request. */
-void
-ohci_root_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- /* No need to abort. */
-}
-
-/* Close the root pipe. */
-void
-ohci_root_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- sc->sc_intrreqh = 0;
-
- DPRINTF(("ohci_root_intr_close\n"));
-}
-
-/************************/
-
-usbd_status
-ohci_device_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_ctrl_start(reqh));
-}
-
-usbd_status
-ohci_device_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- ohci_softc_t *sc = (ohci_softc_t *)reqh->pipe->device->bus;
- usbd_status r;
-
- if (!reqh->isreq) {
- /* XXX panic */
- printf("ohci_device_ctrl_transfer: not a request\n");
- return (USBD_INVAL);
- }
-
- r = ohci_device_request(reqh);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- if (sc->sc_bus.use_polling)
- ohci_waitintr(sc, reqh);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a device control request. */
-void
-ohci_device_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is donw */
- /* XXX call done */
-}
-
-/* Close a device control pipe. */
-void
-ohci_device_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- int s;
-
- s = splusb();
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((LE(sed->ed->ed_tailp) & OHCI_TAILMASK) != LE(sed->ed->ed_headp))
- usb_delay_ms(&sc->sc_bus, 2);
- ohci_rem_ed(sed, sc->sc_ctrl_head);
- splx(s);
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-/************************/
-
-usbd_status
-ohci_device_bulk_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_bulk_start(reqh));
-}
-
-usbd_status
-ohci_device_bulk_start(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int addr = dev->address;
- ohci_soft_td_t *xfer, *tail;
- ohci_soft_ed_t *sed;
- usb_dma_t *dmap;
- usbd_status r;
- int s, len, isread;
-
- if (reqh->isreq) {
- /* XXX panic */
- printf("ohci_device_bulk_transfer: a request\n");
- return (USBD_INVAL);
- }
-
- len = reqh->length;
- dmap = &opipe->u.bulk.datadma;
- isread = reqh->pipe->endpoint->edesc->bEndpointAddress & UE_IN;
- sed = opipe->sed;
-
- opipe->u.bulk.length = len;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
-
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto ret2;
- }
- tail->reqh = 0;
-
- /* Update device address */
- sed->ed->ed_flags = LE(
- (LE(sed->ed->ed_flags) & ~OHCI_ED_ADDRMASK) |
- OHCI_ED_SET_FA(addr));
-
- /* Set up data transaction */
- xfer = opipe->tail;
- xfer->td->td_flags = LE(
- (isread ? OHCI_TD_IN : OHCI_TD_OUT) | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY |
- (reqh->flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0));
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
- if (!isread)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
- splx(s);
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device bulk request. */
-void
-ohci_device_bulk_abort(reqh)
- usbd_request_handle reqh;
-{
-#if 0
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((LE(sed->ed->ed_tailp) & OHCI_TAILMASK) != LE(sed->ed->ed_headp))
- usb_delay_ms(reqh->pipe->device->bus, 2);
-#endif
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device bulk pipe. */
-void
-ohci_device_bulk_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int s;
-
- s = splusb();
- ohci_rem_ed(opipe->sed, sc->sc_bulk_head);
- splx(s);
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-/************************/
-
-usbd_status
-ohci_device_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_intr_start(reqh));
-}
-
-usbd_status
-ohci_device_intr_start(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *xfer, *tail;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
- int s;
-
- DPRINTFN(3, ("ohci_device_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d priv=%p\n",
- reqh, reqh->buffer, reqh->length, reqh->flags, reqh->priv));
-
- if (reqh->isreq)
- panic("ohci_device_intr_transfer: a request\n");
-
- len = reqh->length;
- dmap = &opipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- xfer = opipe->tail;
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto ret1;
- }
- tail->reqh = 0;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
-
- xfer->td->td_flags = LE(
- OHCI_TD_IN | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY);
- if (reqh->flags & USBD_SHORT_XFER_OK)
- xfer->td->td_flags |= LE(OHCI_TD_R);
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- printf("ohci_device_intr_transfer:\n");
- ohci_dump_ed(sed);
- ohci_dump_tds(xfer);
- }
-#endif
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
-#if 0
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
-#endif
- sed->ed->ed_flags &= LE(~OHCI_ED_SKIP);
-
-#ifdef USB_DEBUG
- if (ohcidebug > 5) {
- delay(5000);
- printf("ohci_device_intr_transfer: status=%x\n",
- OREAD4(sc, OHCI_COMMAND_STATUS));
- ohci_dump_ed(sed);
- ohci_dump_tds(xfer);
- }
-#endif
- /* moved splx(s) because of indefinite printing of TD's */
- splx(s);
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- ohci_free_std(sc, xfer);
- ret1:
- return (r);
-}
-
-/* Abort a device control request. */
-void
-ohci_device_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- if (reqh->pipe->intrreqh == reqh) {
- DPRINTF(("ohci_device_intr_abort: remove\n"));
- reqh->pipe->intrreqh = 0;
- ohci_intr_done((ohci_softc_t *)reqh->pipe->device->bus, reqh);
- }
-}
-
-/* Close a device interrupt pipe. */
-void
-ohci_device_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- int nslots = opipe->u.intr.nslots;
- int pos = opipe->u.intr.pos;
- int j;
- ohci_soft_ed_t *p, *sed = opipe->sed;
- int s;
-
- DPRINTFN(1,("ohci_device_intr_close: pipe=%p nslots=%d pos=%d\n",
- pipe, nslots, pos));
- s = splusb();
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((sed->ed->ed_tailp & LE(OHCI_TAILMASK)) != sed->ed->ed_headp)
- usb_delay_ms(&sc->sc_bus, 2);
-
- for (p = sc->sc_eds[pos]; p && p->next != sed; p = p->next)
- ;
- if (!p)
- panic("ohci_device_intr_close: ED not found\n");
- p->next = sed->next;
- p->ed->ed_nexted = sed->ed->ed_nexted;
- splx(s);
-
- for (j = 0; j < nslots; j++)
- --sc->sc_bws[pos * nslots + j];
-
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-usbd_status
-ohci_device_setintr(sc, opipe, ival)
- ohci_softc_t *sc;
- struct ohci_pipe *opipe;
- int ival;
-{
- int i, j, s, best;
- u_int npoll, slow, shigh, nslots;
- u_int bestbw, bw;
- ohci_soft_ed_t *hsed, *sed = opipe->sed;
-
- DPRINTFN(2, ("ohci_setintr: pipe=%p\n", opipe));
- if (ival == 0) {
- printf("ohci_setintr: 0 interval\n");
- return (USBD_INVAL);
- }
-
- npoll = OHCI_NO_INTRS;
- while (npoll > ival)
- npoll /= 2;
- DPRINTFN(2, ("ohci_setintr: ival=%d npoll=%d\n", ival, npoll));
-
- /*
- * We now know which level in the tree the ED must go into.
- * Figure out which slot has most bandwidth left over.
- * Slots to examine:
- * npoll
- * 1 0
- * 2 1 2
- * 4 3 4 5 6
- * 8 7 8 9 10 11 12 13 14
- * N (N-1) .. (N-1+N-1)
- */
- slow = npoll-1;
- shigh = slow + npoll;
- nslots = OHCI_NO_INTRS / npoll;
- for (best = i = slow, bestbw = ~0; i < shigh; i++) {
- bw = 0;
- for (j = 0; j < nslots; j++)
- bw += sc->sc_bws[i * nslots + j];
- if (bw < bestbw) {
- best = i;
- bestbw = bw;
- }
- }
- DPRINTFN(2, ("ohci_setintr: best=%d(%d..%d) bestbw=%d\n",
- best, slow, shigh, bestbw));
-
- s = splusb();
- hsed = sc->sc_eds[best];
- sed->next = hsed->next;
- sed->ed->ed_nexted = hsed->ed->ed_nexted;
- hsed->next = sed;
- hsed->ed->ed_nexted = LE(sed->physaddr);
- splx(s);
-
- for (j = 0; j < nslots; j++)
- ++sc->sc_bws[best * nslots + j];
- opipe->u.intr.nslots = nslots;
- opipe->u.intr.pos = best;
-
- DPRINTFN(5, ("ohci_setintr: returns %p\n", opipe));
- return (USBD_NORMAL_COMPLETION);
-}
-
diff --git a/sys/dev/usb/ohcireg.h b/sys/dev/usb/ohcireg.h
deleted file mode 100644
index bd44e8be4071..000000000000
--- a/sys/dev/usb/ohcireg.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/* $NetBSD: ohcireg.h,v 1.7 1998/12/10 23:16:47 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 _DEV_PCI_OHCIREG_H_
-#define _DEV_PCI_OHCIREG_H_
-
-/*** PCI config registers ***/
-
-#define PCI_CBMEM 0x10 /* configuration base memory */
-
-#define PCI_INTERFACE_OHCI 0x10
-
-/*** OHCI registers */
-
-#define OHCI_REVISION 0x00 /* OHCI revision # */
-#define OHCI_REV_LO(rev) ((rev)&0xf)
-#define OHCI_REV_HI(rev) (((rev)>>4)&0xf)
-#define OHCI_REV_LEGACY(rev) ((rev) & 0x100)
-
-#define OHCI_CONTROL 0x04
-#define OHCI_CBSR_MASK 0x00000003 /* Control/Bulk Service Ratio */
-#define OHCI_RATIO_1_1 0x00000000
-#define OHCI_RATIO_1_2 0x00000001
-#define OHCI_RATIO_1_3 0x00000002
-#define OHCI_RATIO_1_4 0x00000003
-#define OHCI_PLE 0x00000004 /* Periodic List Enable */
-#define OHCI_IE 0x00000008 /* Isochronous Enable */
-#define OHCI_CLE 0x00000010 /* Control List Enable */
-#define OHCI_BLE 0x00000020 /* Bulk List Enable */
-#define OHCI_HCFS_MASK 0x000000c0 /* HostControllerFunctionalState */
-#define OHCI_HCFS_RESET 0x00000000
-#define OHCI_HCFS_RESUME 0x00000040
-#define OHCI_HCFS_OPERATIONAL 0x00000080
-#define OHCI_HCFS_SUSPEND 0x000000c0
-#define OHCI_IR 0x00000100 /* Interrupt Routing */
-#define OHCI_RWC 0x00000200 /* Remote Wakeup Connected */
-#define OHCI_RWE 0x00000400 /* Remote Wakeup Enabled */
-#define OHCI_COMMAND_STATUS 0x08
-#define OHCI_HCR 0x00000001 /* Host Controller Reset */
-#define OHCI_CLF 0x00000002 /* Control List Filled */
-#define OHCI_BLF 0x00000004 /* Bulk List Filled */
-#define OHCI_OCR 0x00000008 /* Ownership Change Request */
-#define OHCI_SOC_MASK 0x00030000 /* Scheduling Overrun Count */
-#define OHCI_INTERRUPT_STATUS 0x0c
-#define OHCI_SO 0x00000001 /* Scheduling Overrun */
-#define OHCI_WDH 0x00000002 /* Writeback Done Head */
-#define OHCI_SF 0x00000004 /* Start of Frame */
-#define OHCI_RD 0x00000008 /* Resume Detected */
-#define OHCI_UE 0x00000010 /* Unrecoverable Error */
-#define OHCI_FNO 0x00000020 /* Frame Number Overflow */
-#define OHCI_RHSC 0x00000040 /* Root Hub Status Change */
-#define OHCI_OC 0x40000000 /* Ownership Change */
-#define OHCI_MIE 0x80000000 /* Master Interrupt Enable */
-#define OHCI_INTERRUPT_ENABLE 0x10
-#define OHCI_INTERRUPT_DISABLE 0x14
-#define OHCI_HCCA 0x18
-#define OHCI_PERIOD_CURRENT_ED 0x1c
-#define OHCI_CONTROL_HEAD_ED 0x20
-#define OHCI_CONTROL_CURRENT_ED 0x24
-#define OHCI_BULK_HEAD_ED 0x28
-#define OHCI_BULK_CURRENT_ED 0x2c
-#define OHCI_DONE_HEAD 0x30
-#define OHCI_FM_INTERVAL 0x34
-#define OHCI_GET_IVAL(s) ((s) & 0x3fff)
-#define OHCI_GET_FSMPS(s) (((s) >> 16) & 0x7fff)
-#define OHCI_FIT 0x80000000
-#define OHCI_FM_REMAINING 0x38
-#define OHCI_FM_NUMBER 0x3c
-#define OHCI_PERIODIC_START 0x40
-#define OHCI_LS_THRESHOLD 0x44
-#define OHCI_RH_DESCRIPTOR_A 0x48
-#define OHCI_GET_NDP(s) ((s) & 0xff)
-#define OHCI_PSM 0x0100 /* Power Switching Mode */
-#define OHCI_NPS 0x0200 /* No Power Switching */
-#define OHCI_GET_POTPGT(s) ((s) >> 24)
-#define OHCI_RH_DESCRIPTOR_B 0x4c
-#define OHCI_RH_STATUS 0x50
-#define OHCI_LPS 0x00000001 /* Local Power Status */
-#define OHCI_OCI 0x00000002 /* OverCurrent Indicator */
-#define OHCI_DRWE 0x00008000 /* Device Remote Wakeup Enable */
-#define OHCI_LPSC 0x00010000 /* Local Power Status Change */
-#define OHCI_CCIC 0x00020000 /* OverCurrent Indicator Change */
-#define OHCI_CRWE 0x80000000 /* Clear Remote Wakeup Enable */
-#define OHCI_RH_PORT_STATUS(n) (0x50 + (n)*4) /* 1 based indexing */
-
-#define OHCI_LES (OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE)
-#define OHCI_ALL_INTRS (OHCI_SO | OHCI_WDH | OHCI_SF | OHCI_RD | OHCI_UE | \
- OHCI_FNO | OHCI_RHSC | OHCI_OC)
-#define OHCI_NORMAL_INTRS (OHCI_SO | OHCI_WDH | OHCI_RD | OHCI_UE | OHCI_RHSC)
-
-#define OHCI_FSMPS(i) (((i-210)*6/7) << 16)
-#define OHCI_PERIODIC(i) ((i)*9/10)
-
-typedef u_int32_t ohci_physaddr_t;
-
-#define OHCI_NO_INTRS 32
-struct ohci_hcca {
- ohci_physaddr_t hcca_interrupt_table[OHCI_NO_INTRS];
- u_int32_t hcca_frame_number;
- ohci_physaddr_t hcca_done_head;
-#define OHCI_DONE_INTRS 1
-};
-#define OHCI_HCCA_SIZE 256
-#define OHCI_HCCA_ALIGN 256
-
-typedef struct {
- u_int32_t ed_flags;
-#define OHCI_ED_GET_FA(s) ((s) & 0x7f)
-#define OHCI_ED_ADDRMASK 0x0000007f
-#define OHCI_ED_SET_FA(s) (s)
-#define OHCI_ED_GET_EN(s) (((s) >> 7) & 0xf)
-#define OHCI_ED_SET_EN(s) ((s) << 7)
-#define OHCI_ED_DIR_MASK 0x00001800
-#define OHCI_ED_DIR_TD 0x00000000
-#define OHCI_ED_DIR_OUT 0x00000800
-#define OHCI_ED_DIR_IN 0x00001000
-#define OHCI_ED_SPEED 0x00002000
-#define OHCI_ED_SKIP 0x00004000
-#define OHCI_ED_FORMAT_GEN 0x00000000
-#define OHCI_ED_FORMAT_ISO 0x00008000
-#define OHCI_ED_GET_MAXP(s) (((s) >> 16) & 0x07ff)
-#define OHCI_ED_SET_MAXP(s) ((s) << 16)
-#define OHCI_ED_MAXPMASK (0x7ff << 16)
- ohci_physaddr_t ed_tailp;
-#define OHCI_HALTED 0x00000002
-#define OHCI_TOGGLECARRY 0x00000001
-#define OHCI_TAILMASK 0xfffffffc
- ohci_physaddr_t ed_headp;
- ohci_physaddr_t ed_nexted;
-} ohci_ed_t;
-#define OHCI_ED_SIZE 16
-#define OHCI_ED_ALIGN 16
-
-typedef struct {
- u_int32_t td_flags;
-#define OHCI_TD_R 0x00040000 /* Buffer Rounding */
-#define OHCI_TD_DP_MASK 0x00180000 /* Direction / PID */
-#define OHCI_TD_SETUP 0x00000000
-#define OHCI_TD_OUT 0x00080000
-#define OHCI_TD_IN 0x00100000
-#define OHCI_TD_GET_DI(x) (((x) >> 21) & 7) /* Delay Interrupt */
-#define OHCI_TD_SET_DI(x) ((x) << 21)
-#define OHCI_TD_NOINTR 0x00e00000
-#define OHCI_TD_TOGGLE_CARRY 0x00000000
-#define OHCI_TD_TOGGLE_0 0x02000000
-#define OHCI_TD_TOGGLE_1 0x03000000
-#define OHCI_TD_GET_EC(x) (((x) >> 26) & 3) /* Error Count */
-#define OHCI_TD_GET_CC(x) ((x) >> 28) /* Condition Code */
-#define OHCI_TD_NOCC 0xf0000000
- ohci_physaddr_t td_cbp; /* Current Buffer Pointer */
- ohci_physaddr_t td_nexttd; /* Next TD */
- ohci_physaddr_t td_be; /* Buffer End */
-} ohci_td_t;
-#define OHCI_TD_SIZE 16
-#define OHCI_TD_ALIGN 16
-
-#define OHCI_CC_NO_ERROR 0
-#define OHCI_CC_CRC 1
-#define OHCI_CC_BIT_STUFFING 2
-#define OHCI_CC_DATA_TOGGLE_MISMATCH 3
-#define OHCI_CC_STALL 4
-#define OHCI_CC_DEVICE_NOT_RESPONDING 5
-#define OHCI_CC_PID_CHECK_FAILURE 6
-#define OHCI_CC_UNEXPECTED_PID 7
-#define OHCI_CC_DATA_OVERRUN 8
-#define OHCI_CC_DATA_UNDERRUN 9
-#define OHCI_CC_BUFFER_OVERRUN 12
-#define OHCI_CC_BUFFER_UNDERRUN 13
-#define OHCI_CC_NOT_ACCESSED 15
-
-#endif /* _DEV_PCI_OHCIREG_H_ */
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
deleted file mode 100644
index db8631f7976e..000000000000
--- a/sys/dev/usb/ohcivar.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $NetBSD: ohcivar.h,v 1.4 1998/12/26 12:53:01 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-typedef struct ohci_soft_ed {
- ohci_ed_t *ed;
- struct ohci_soft_ed *next;
- ohci_physaddr_t physaddr;
-} ohci_soft_ed_t;
-#define OHCI_ED_CHUNK 256
-
-typedef struct ohci_soft_td {
- ohci_td_t *td;
- struct ohci_soft_td *nexttd; /* mirrors nexttd in TD */
- struct ohci_soft_td *dnext; /* next in done list */
- ohci_physaddr_t physaddr;
- LIST_ENTRY(ohci_soft_td) hnext;
- /*ohci_soft_ed_t *sed;*/
- usbd_request_handle reqh;
- u_int16_t len;
-} ohci_soft_td_t;
-#define OHCI_TD_CHUNK 256
-
-#define OHCI_NO_EDS (2*OHCI_NO_INTRS-1)
-
-#define OHCI_HASH_SIZE 128
-
-typedef struct ohci_softc {
- struct usbd_bus sc_bus; /* base device */
-#if defined(__NetBSD__)
- void *sc_ih; /* interrupt vectoring */
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
-
- bus_dma_tag_t sc_dmatag; /* DMA tag */
- /* XXX should keep track of all DMA memory */
-
-#elif defined(__FreeBSD__)
- int sc_iobase;
- int unit;
-#endif /* __FreeBSD__ */
-
- usb_dma_t sc_hccadma;
- struct ohci_hcca *sc_hcca;
- ohci_soft_ed_t *sc_eds[OHCI_NO_EDS];
- u_int sc_bws[OHCI_NO_INTRS];
-
- u_int32_t sc_eintrs;
- ohci_soft_ed_t *sc_ctrl_head;
- ohci_soft_ed_t *sc_bulk_head;
-
- LIST_HEAD(, ohci_soft_td) sc_hash_tds[OHCI_HASH_SIZE];
-
- int sc_noport;
- u_int8_t sc_addr; /* device address */
- u_int8_t sc_conf; /* device configuration */
-
- ohci_soft_ed_t *sc_freeeds;
- ohci_soft_td_t *sc_freetds;
-
- usbd_request_handle sc_intrreqh;
-
- int sc_intrs;
- char sc_vendor[16];
-} ohci_softc_t;
-
-usbd_status ohci_init __P((ohci_softc_t *));
-int ohci_intr __P((void *));
-
-#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ohcidebug) printf x
-#define DPRINTFN(n,x) if (ohcidebug>(n)) printf x
-extern int ohcidebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
deleted file mode 100644
index 749cad455f3f..000000000000
--- a/sys/dev/usb/ucom.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* $NetBSD: ucom.c,v 1.6 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 <dev/usb/usb_port.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ucomdebug) printf x
-#define DPRINTFN(n,x) if (ucomdebug>(n)) printf x
-int ucomdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct ucom_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
-};
-
-void ucom_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ucom_disco __P((void *));
-
-USB_DECLARE_DRIVER(ucom);
-
-USB_MATCH(ucom)
-{
- USB_MATCH_START(ucom, uaa);
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (id &&
- id->bInterfaceClass != UCLASS_CDC ||
- id->bInterfaceSubClass != USUBCLASS_ABSTRACT_CONTROL_MODEL)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS);
-}
-
-USB_ATTACH(ucom)
-{
- USB_ATTACH_START(ucom, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- char devinfo[1024];
-
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-ucom_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-#endif
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(ucom, uhub, ucom_driver, ucom_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
deleted file mode 100644
index f739b4b642c9..000000000000
--- a/sys/dev/usb/ugen.c
+++ /dev/null
@@ -1,985 +0,0 @@
-/* $NetBSD: ugen.c,v 1.11 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
-#include <sys/filio.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ugendebug) printf x
-#define DPRINTFN(n,x) if (ugendebug>(n)) printf x
-int ugendebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct ugen_endpoint {
- struct ugen_softc *sc;
- usb_endpoint_descriptor_t *edesc;
- usbd_interface_handle iface;
- int state;
-#define UGEN_OPEN 0x01 /* device is open */
-#define UGEN_ASLP 0x02 /* waiting for data */
-#define UGEN_SHORT_OK 0x04 /* short xfers are OK */
- usbd_pipe_handle pipeh;
- struct clist q;
- struct selinfo rsel;
- void *ibuf;
-};
-
-#define UGEN_CHUNK 128 /* chunk size for read */
-#define UGEN_IBSIZE 1020 /* buffer size */
-#define UGEN_BBSIZE 1024
-
-struct ugen_softc {
- bdevice sc_dev; /* base device */
- struct usbd_device *sc_udev;
-
- struct ugen_endpoint sc_endpoints[USB_MAX_ENDPOINTS][2];
-#define OUT 0 /* index order is important, from UE_OUT */
-#define IN 1 /* from UE_IN */
-
- int sc_disconnected; /* device is gone */
-};
-
-int ugenopen __P((dev_t, int, int, struct proc *));
-int ugenclose __P((dev_t, int, int, struct proc *p));
-int ugenread __P((dev_t, struct uio *uio, int));
-int ugenwrite __P((dev_t, struct uio *uio, int));
-int ugenioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int ugenpoll __P((dev_t, int, struct proc *));
-void ugenintr __P((usbd_request_handle reqh, usbd_private_handle addr,
- usbd_status status));
-void ugen_disco __P((void *));
-
-#define UGEN_CDEV_MAJOR 114
-
-int ugen_set_config __P((struct ugen_softc *sc, int configno));
-usb_config_descriptor_t *ugen_get_cdesc __P((struct ugen_softc *sc, int index,
- int *lenp));
-usbd_status ugen_set_interface __P((struct ugen_softc *, int, int));
-int ugen_get_alt_index __P((struct ugen_softc *sc, int ifaceidx));
-
-#define UGENUNIT(n) (((n) >> 4) & 0xf)
-#define UGENENDPOINT(n) ((n) & 0xf)
-
-USB_DECLARE_DRIVER(ugen);
-
-USB_MATCH(ugen)
-{
- USB_MATCH_START(ugen, uaa);
-
- if (uaa->usegeneric)
- return (UMATCH_GENERIC);
- else
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(ugen)
-{
- USB_ATTACH_START(ugen, sc, uaa);
- char devinfo[1024];
- usbd_status r;
- int conf;
-
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
-
- sc->sc_udev = uaa->device;
- conf = 1; /* XXX should not hard code 1 */
- r = ugen_set_config(sc, conf);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: setting configuration %d failed\n",
- USBDEVNAME(sc->sc_dev), conf);
- sc->sc_disconnected = 1;
- USB_ATTACH_ERROR_RETURN;
- }
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-int
-ugen_set_config(sc, configno)
- struct ugen_softc *sc;
- int configno;
-{
- usbd_device_handle dev = sc->sc_udev;
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
- struct ugen_endpoint *sce;
- u_int8_t niface, nendpt;
- int ifaceno, endptno, endpt;
- usbd_status r;
-
- DPRINTFN(1,("ugen_set_config: %s to configno %d, sc=%p\n",
- USBDEVNAME(sc->sc_dev), configno, sc));
- if (usbd_get_config_descriptor(dev)->bConfigurationValue != configno) {
- /* Avoid setting the current value. */
- r = usbd_set_config_no(dev, configno, 0);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- }
-
- r = usbd_interface_count(dev, &niface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- memset(sc->sc_endpoints, 0, sizeof sc->sc_endpoints);
- for (ifaceno = 0; ifaceno < niface; ifaceno++) {
- DPRINTFN(1,("ugen_set_config: ifaceno %d\n", ifaceno));
- r = usbd_device2interface_handle(dev, ifaceno, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)]
- [UE_GET_IN(endpt)];
- DPRINTFN(1,("ugen_set_config: endptno %d, endpt=0x%02x"
- "(%d,%d), sce=%p\n",
- endptno, endpt, UE_GET_ADDR(endpt),
- UE_GET_IN(endpt), sce));
- sce->sc = sc;
- sce->edesc = ed;
- sce->iface = iface;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-ugen_disco(p)
- void *p;
-{
- struct ugen_softc *sc = p;
- sc->sc_disconnected = 1;
-}
-
-int
-ugenopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- int unit = UGENUNIT(dev);
- int endpt = UGENENDPOINT(dev);
- usb_endpoint_descriptor_t *edesc;
- struct ugen_endpoint *sce;
- int dir, isize;
- usbd_status r;
-
- USB_GET_SC_OPEN(ugen, unit, sc);
- DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
- flag, mode, unit, endpt));
-
- if (sc->sc_disconnected)
- return (EIO);
-
- if (endpt == USB_CONTROL_ENDPOINT) {
- /*if ((flag & (FWRITE|FREAD)) != (FWRITE|FREAD))
- return (EACCES);*/
- sce = &sc->sc_endpoints[USB_CONTROL_ENDPOINT][OUT];
- if (sce->state & UGEN_OPEN)
- return (EBUSY);
- } else {
- switch (flag & (FWRITE|FREAD)) {
- case FWRITE:
- dir = OUT;
- break;
- case FREAD:
- dir = IN;
- break;
- default:
- return (EACCES);
- }
- sce = &sc->sc_endpoints[endpt][dir];
- DPRINTFN(5, ("ugenopen: sc=%p, endpt=%d, dir=%d, sce=%p\n",
- sc, endpt, dir, sce));
- if (sce->state & UGEN_OPEN)
- return (EBUSY);
- edesc = sce->edesc;
- if (!edesc)
- return (ENXIO);
- switch (edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- isize = UGETW(edesc->wMaxPacketSize);
- if (isize == 0) /* shouldn't happen */
- return (EINVAL);
- sce->ibuf = malloc(isize, M_USB, M_WAITOK);
- DPRINTFN(5, ("ugenopen: intr endpt=%d,isize=%d\n",
- endpt, isize));
-#if defined(__NetBSD__)
- if (clalloc(&sce->q, UGEN_IBSIZE, 0) == -1)
- return (ENOMEM);
-#elif defined(__FreeBSD__)
- clist_alloc_cblocks(&sce->q, UGEN_IBSIZE, 0);
-#endif
- r = usbd_open_pipe_intr(sce->iface,
- edesc->bEndpointAddress,
- USBD_SHORT_XFER_OK, &sce->pipeh, sce,
- sce->ibuf, isize, ugenintr);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sce->ibuf, M_USB);
-#if defined(__NetBSD__)
- clfree(&sce->q);
-#elif defined(__FreeBSD__)
- clist_free_cblocks(&sce->q);
-#endif
- return (EIO);
- }
- usbd_set_disco(sce->pipeh, ugen_disco, sc);
- DPRINTFN(5, ("ugenopen: interrupt open done\n"));
- break;
- case UE_BULK:
- r = usbd_open_pipe(sce->iface,
- edesc->bEndpointAddress, 0,
- &sce->pipeh);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
- case UE_CONTROL:
- case UE_ISOCHRONOUS:
- return (EINVAL);
- }
- }
- sce->state |= UGEN_OPEN;
- return (0);
-}
-
-int
-ugenclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce;
- int dir;
-
- DPRINTFN(5, ("ugenclose: flag=%d, mode=%d\n", flag, mode));
- if (sc->sc_disconnected)
- return (EIO);
-
- if (endpt == USB_CONTROL_ENDPOINT) {
- DPRINTFN(5, ("ugenclose: close control\n"));
- sc->sc_endpoints[endpt][OUT].state = 0;
- return (0);
- }
-
- flag = FWRITE | FREAD; /* XXX bug if generic open/close */
-
- /* The open modes have been joined, so check for both modes. */
- for (dir = OUT; dir <= IN; dir++) {
- if (flag & (dir == OUT ? FWRITE : FREAD)) {
- sce = &sc->sc_endpoints[endpt][dir];
- if (!sce || !sce->pipeh) /* XXX */
- continue; /* XXX */
- DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n",
- endpt, dir, sce));
- sce->state = 0;
-
- usbd_abort_pipe(sce->pipeh);
- usbd_close_pipe(sce->pipeh);
- sce->pipeh = 0;
-
- if (sce->ibuf) {
- free(sce->ibuf, M_USB);
- sce->ibuf = 0;
- }
- }
- }
-
- return (0);
-}
-
-int
-ugenread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][IN];
- u_int32_t n, tn;
- char buf[UGEN_BBSIZE];
- usbd_request_handle reqh;
- usbd_status r;
- int s;
- int error = 0;
- u_char buffer[UGEN_CHUNK];
-
- DPRINTFN(5, ("ugenread: %d:%d\n", UGENUNIT(dev), UGENENDPOINT(dev)));
- if (sc->sc_disconnected)
- return (EIO);
-
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenread: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenread: no pipe\n");
- return (EIO);
- }
-#endif
-
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- /* Block until activity occured. */
- s = splusb();
- while (sce->q.c_cc == 0) {
- if (flag & IO_NDELAY) {
- splx(s);
- return (EWOULDBLOCK);
- }
- sce->state |= UGEN_ASLP;
- DPRINTFN(5, ("ugenread: sleep on %p\n", sc));
- error = tsleep((caddr_t)sce, PZERO | PCATCH,
- "ugenri", 0);
- DPRINTFN(5, ("ugenread: woke, error=%d\n", error));
- if (error) {
- sce->state &= ~UGEN_ASLP;
- splx(s);
- return (error);
- }
- }
- splx(s);
-
- /* Transfer as many chunks as possible. */
- while (sce->q.c_cc > 0 && uio->uio_resid > 0) {
- n = min(sce->q.c_cc, uio->uio_resid);
- if (n > sizeof(buffer))
- n = sizeof(buffer);
-
- /* Remove a small chunk from the input queue. */
- q_to_b(&sce->q, buffer, n);
- DPRINTFN(5, ("ugenread: got %d chars\n", n));
-
- /* Copy the data to the user process. */
- error = uiomove(buffer, n, uio);
- if (error)
- break;
- }
- break;
- case UE_BULK:
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (ENOMEM);
- while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) {
- DPRINTFN(1, ("ugenread: start transfer %d bytes\n", n));
- tn = n;
- r = usbd_bulk_transfer(reqh, sce->pipeh, 0, buf,
- &tn, "ugenrb");
- if (r != USBD_NORMAL_COMPLETION) {
- if (r == USBD_INTERRUPTED)
- error = EINTR;
- else
- error = EIO;
- break;
- }
- DPRINTFN(1, ("ugenread: got %d bytes\n", tn));
- error = uiomove(buf, tn, uio);
- if (error || tn < n)
- break;
- }
- usbd_free_request(reqh);
- break;
- default:
- return (ENXIO);
- }
-
- return (error);
-}
-
-int
-ugenwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][OUT];
- size_t n;
- int error = 0;
- char buf[UGEN_BBSIZE];
- usbd_request_handle reqh;
- usbd_status r;
-
- if (sc->sc_disconnected)
- return (EIO);
-
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenwrite: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenwrite: no pipe\n");
- return (EIO);
- }
-#endif
-
- DPRINTF(("ugenwrite\n"));
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_BULK:
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (EIO);
- while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) {
- error = uiomove(buf, n, uio);
- if (error)
- break;
- DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
- r = usbd_bulk_transfer(reqh, sce->pipeh, 0, buf,
- &n, "ugenwb");
- if (r != USBD_NORMAL_COMPLETION) {
- if (r == USBD_INTERRUPTED)
- error = EINTR;
- else
- error = EIO;
- break;
- }
- }
- usbd_free_request(reqh);
- break;
- default:
- return (ENXIO);
- }
- return (error);
-}
-
-
-void
-ugenintr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ugen_endpoint *sce = addr;
- /*struct ugen_softc *sc = sce->sc;*/
- usbd_private_handle priv;
- void *buffer;
- u_int32_t count;
- usbd_status xstatus;
- u_char *ibuf;
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ugenintr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sce->pipeh);
- return;
- }
-
- (void)usbd_get_request_status(reqh, &priv, &buffer, &count, &xstatus);
- ibuf = sce->ibuf;
-
- DPRINTFN(5, ("ugenintr: reqh=%p status=%d count=%d\n",
- reqh, xstatus, count));
- DPRINTFN(5, (" data = %02x %02x %02x\n",
- ibuf[0], ibuf[1], ibuf[2]));
-
- (void)b_to_q(ibuf, count, &sce->q);
-
- if (sce->state & UGEN_ASLP) {
- sce->state &= ~UGEN_ASLP;
- DPRINTFN(5, ("ugen_intr: waking %p\n", sce));
- wakeup((caddr_t)sce);
- }
- selwakeup(&sce->rsel);
-}
-
-usbd_status
-ugen_set_interface(sc, ifaceidx, altno)
- struct ugen_softc *sc;
- int ifaceidx, altno;
-{
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
- struct ugen_endpoint *sce;
- u_int8_t niface, nendpt, endptno, endpt;
-
- DPRINTFN(15, ("ugen_set_interface %d %d\n", ifaceidx, altno));
-
- r = usbd_interface_count(sc->sc_udev, &niface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (ifaceidx < 0 || ifaceidx >= niface)
- return (USBD_INVAL);
-
- r = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][UE_GET_IN(endpt)];
- sce->sc = 0;
- sce->edesc = 0;
- sce->iface = 0;
- }
-
- /* change setting */
- r = usbd_set_interface(iface, altno);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][UE_GET_IN(endpt)];
- sce->sc = sc;
- sce->edesc = ed;
- sce->iface = iface;
- }
- return (0);
-}
-
-/* Retrieve a complete descriptor for a certain device and index. */
-usb_config_descriptor_t *
-ugen_get_cdesc(sc, index, lenp)
- struct ugen_softc *sc;
- int index;
- int *lenp;
-{
- usb_config_descriptor_t *cdesc, *tdesc, cdescr;
- int len;
- usbd_status r;
-
- if (index == USB_CURRENT_CONFIG_INDEX) {
- tdesc = usbd_get_config_descriptor(sc->sc_udev);
- len = UGETW(tdesc->wTotalLength);
- if (lenp)
- *lenp = len;
- cdesc = malloc(len, M_TEMP, M_WAITOK);
- memcpy(cdesc, tdesc, len);
- DPRINTFN(5,("ugen_get_cdesc: current, len=%d\n", len));
- } else {
- r = usbd_get_config_desc(sc->sc_udev, index, &cdescr);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- len = UGETW(cdescr.wTotalLength);
- DPRINTFN(5,("ugen_get_cdesc: index=%d, len=%d\n", index, len));
- if (lenp)
- *lenp = len;
- cdesc = malloc(len, M_TEMP, M_WAITOK);
- r = usbd_get_config_desc_full(sc->sc_udev, index, cdesc, len);
- if (r != USBD_NORMAL_COMPLETION) {
- free(cdesc, M_TEMP);
- return (0);
- }
- }
- return (cdesc);
-}
-
-int
-ugen_get_alt_index(sc, ifaceidx)
- struct ugen_softc *sc;
- int ifaceidx;
-{
- usbd_interface_handle iface;
- usbd_status r;
-
- r = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (-1);
- return (usbd_get_interface_altindex(iface));
-}
-
-int
-ugenioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce;
- usbd_status r;
- usbd_interface_handle iface;
- struct usb_config_desc *cd;
- usb_config_descriptor_t *cdesc;
- struct usb_interface_desc *id;
- usb_interface_descriptor_t *idesc;
- struct usb_endpoint_desc *ed;
- usb_endpoint_descriptor_t *edesc;
- struct usb_alt_interface *ai;
- struct usb_string_desc *si;
- u_int8_t conf, alt;
-
- DPRINTFN(5, ("ugenioctl: cmd=%08lx\n", cmd));
- if (sc->sc_disconnected)
- return (EIO);
-
- switch (cmd) {
- case FIONBIO:
- /* All handled in the upper FS layer. */
- return (0);
- case USB_SET_SHORT_XFER:
- /* This flag only affects read */
- sce = &sc->sc_endpoints[endpt][IN];
-#ifdef DIAGNOSTIC
- if (!sce->pipeh) {
- printf("ugenioctl: no pipe\n");
- return (EIO);
- }
-#endif
- if (*(int *)addr)
- sce->state |= UGEN_SHORT_OK;
- else
- sce->state &= ~UGEN_SHORT_OK;
- return (0);
- default:
- break;
- }
-
- if (endpt != USB_CONTROL_ENDPOINT)
- return (EINVAL);
-
- switch (cmd) {
-#ifdef USB_DEBUG
- case USB_SETDEBUG:
- ugendebug = *(int *)addr;
- break;
-#endif
- case USB_GET_CONFIG:
- r = usbd_get_config(sc->sc_udev, &conf);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- *(int *)addr = conf;
- break;
- case USB_SET_CONFIG:
- if (!(flag & FWRITE))
- return (EPERM);
- r = ugen_set_config(sc, *(int *)addr);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
- case USB_GET_ALTINTERFACE:
- ai = (struct usb_alt_interface *)addr;
- r = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- idesc = usbd_get_interface_descriptor(iface);
- if (!idesc)
- return (EIO);
- ai->alt_no = idesc->bAlternateSetting;
- break;
- case USB_SET_ALTINTERFACE:
- if (!(flag & FWRITE))
- return (EPERM);
- ai = (struct usb_alt_interface *)addr;
- r = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- r = ugen_set_interface(sc, ai->interface_index, ai->alt_no);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- break;
- case USB_GET_NO_ALT:
- ai = (struct usb_alt_interface *)addr;
- cdesc = ugen_get_cdesc(sc, ai->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- idesc = usbd_find_idesc(cdesc, ai->interface_index, 0);
- if (!idesc)
- return (EINVAL);
- ai->alt_no = usbd_get_no_alts(cdesc, idesc->bInterfaceNumber);
- break;
- case USB_GET_DEVICE_DESC:
- *(usb_device_descriptor_t *)addr =
- *usbd_get_device_descriptor(sc->sc_udev);
- break;
- case USB_GET_CONFIG_DESC:
- cd = (struct usb_config_desc *)addr;
- cdesc = ugen_get_cdesc(sc, cd->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- cd->desc = *cdesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_INTERFACE_DESC:
- id = (struct usb_interface_desc *)addr;
- cdesc = ugen_get_cdesc(sc, id->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- if (id->config_index == USB_CURRENT_CONFIG_INDEX &&
- id->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, id->interface_index);
- else
- alt = id->alt_index;
- idesc = usbd_find_idesc(cdesc, id->interface_index, alt);
- if (!idesc) {
- free(cdesc, M_TEMP);
- return (EINVAL);
- }
- id->desc = *idesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_ENDPOINT_DESC:
- ed = (struct usb_endpoint_desc *)addr;
- cdesc = ugen_get_cdesc(sc, ed->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- if (ed->config_index == USB_CURRENT_CONFIG_INDEX &&
- ed->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, ed->interface_index);
- else
- alt = ed->alt_index;
- edesc = usbd_find_edesc(cdesc, ed->interface_index,
- alt, ed->endpoint_index);
- if (!edesc) {
- free(cdesc, M_TEMP);
- return (EINVAL);
- }
- ed->desc = *edesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_FULL_DESC:
- {
- int len;
- struct iovec iov;
- struct uio uio;
- struct usb_full_desc *fd = (struct usb_full_desc *)addr;
- int error;
-
- cdesc = ugen_get_cdesc(sc, fd->config_index, &len);
- if (len > fd->size)
- len = fd->size;
- iov.iov_base = (caddr_t)fd->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw = UIO_READ;
- uio.uio_procp = p;
- error = uiomove((caddr_t)cdesc, len, &uio);
- free(cdesc, M_TEMP);
- return (error);
- }
- case USB_GET_STRING_DESC:
- si = (struct usb_string_desc *)addr;
- r = usbd_get_string_desc(sc->sc_udev, si->string_index,
- si->language_id, &si->desc);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- break;
- case USB_DO_REQUEST:
- {
- struct usb_ctl_request *ur = (void *)addr;
- int len = UGETW(ur->request.wLength);
- struct iovec iov;
- struct uio uio;
- void *ptr = 0;
- usbd_status r;
- int error = 0;
-
- if (!(flag & FWRITE))
- return (EPERM);
- /* Avoid requests that would damage the bus integrity. */
- if ((ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_ADDRESS) ||
- (ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_CONFIG) ||
- (ur->request.bmRequestType == UT_WRITE_INTERFACE &&
- ur->request.bRequest == UR_SET_INTERFACE))
- return (EINVAL);
-
- if (len < 0 || len > 32767)
- return (EINVAL);
- if (len != 0) {
- iov.iov_base = (caddr_t)ur->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw =
- ur->request.bmRequestType & UT_READ ?
- UIO_READ : UIO_WRITE;
- uio.uio_procp = p;
- ptr = malloc(len, M_TEMP, M_WAITOK);
- if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- r = usbd_do_request_flags(sc->sc_udev, &ur->request,
- ptr, ur->flags, &ur->actlen);
- if (r) {
- error = EIO;
- goto ret;
- }
- if (len != 0) {
- if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- ret:
- if (ptr)
- free(ptr, M_TEMP);
- return (error);
- }
- case USB_GET_DEVICEINFO:
- usbd_fill_deviceinfo(sc->sc_udev,
- (struct usb_device_info *)addr);
- break;
- default:
- return (EINVAL);
- }
- return (0);
-}
-
-int
-ugenpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- /* XXX */
- struct ugen_endpoint *sce;
- int revents = 0;
- int s;
-
- if (sc->sc_disconnected)
- return (EIO);
-
- sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenwrite: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenpoll: no pipe\n");
- return (EIO);
- }
-#endif
- s = splusb();
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- if (events & (POLLIN | POLLRDNORM)) {
- if (sce->q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sce->rsel);
- }
- break;
- case UE_BULK:
- /*
- * We have no easy way of determining if a read will
- * yield any data or a write will happen.
- * Pretend they will.
- */
- revents |= events &
- (POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM);
- break;
- default:
- break;
- }
- splx(s);
- return (revents);
-}
-
-#if defined(__FreeBSD__)
-static int
-ugen_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-
-DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
deleted file mode 100644
index 707bfe3795ba..000000000000
--- a/sys/dev/usb/uhci.c
+++ /dev/null
@@ -1,2620 +0,0 @@
-/* $NetBSD: uhci.c,v 1.22 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: uhci.c,v 1.6 1999/01/07 23:31:33 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * USB Universal Host Controller driver.
- * Handles PIIX3 and PIIX4.
- *
- * Data sheets: ftp://download.intel.com/design/intarch/datashts/29055002.pdf
- * ftp://download.intel.com/design/intarch/datashts/29056201.pdf
- * UHCI spec: http://www.intel.com/design/usb/uhci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/select.h>
-
-#include <machine/bus.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-#include <dev/usb/usb_quirks.h>
-
-#include <dev/usb/uhcireg.h>
-#include <dev/usb/uhcivar.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-
-#define delay(d) DELAY(d)
-#endif
-
-#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
-
-struct uhci_pipe {
- struct usbd_pipe pipe;
- uhci_intr_info_t *iinfo;
- int newtoggle;
- /* Info needed for different pipe kinds. */
- union {
- /* Control pipe */
- struct {
- uhci_soft_qh_t *sqh;
- usb_dma_t reqdma;
- usb_dma_t datadma;
- uhci_soft_td_t *setup, *stat;
- u_int length;
- } ctl;
- /* Interrupt pipe */
- struct {
- usb_dma_t datadma;
- int npoll;
- uhci_soft_qh_t **qhs;
- } intr;
- /* Bulk pipe */
- struct {
- uhci_soft_qh_t *sqh;
- usb_dma_t datadma;
- u_int length;
- int isread;
- } bulk;
- /* Iso pipe */
- struct iso {
- u_int bufsize;
- u_int nbuf;
- usb_dma_t *bufs;
- uhci_soft_td_t **stds;
- } iso;
- } u;
-};
-
-/*
- * The uhci_intr_info free list can be global since they contain
- * no dma specific data. The other free lists do.
- */
-LIST_HEAD(, uhci_intr_info) uhci_ii_free;
-
-void uhci_busreset __P((uhci_softc_t *));
-usbd_status uhci_run __P((uhci_softc_t *, int run));
-uhci_soft_td_t *uhci_alloc_std __P((uhci_softc_t *));
-void uhci_free_std __P((uhci_softc_t *, uhci_soft_td_t *));
-uhci_soft_qh_t *uhci_alloc_sqh __P((uhci_softc_t *));
-void uhci_free_sqh __P((uhci_softc_t *, uhci_soft_qh_t *));
-uhci_intr_info_t *uhci_alloc_intr_info __P((uhci_softc_t *));
-void uhci_free_intr_info __P((uhci_intr_info_t *ii));
-#if 0
-void uhci_enter_ctl_q __P((uhci_softc_t *, uhci_soft_qh_t *,
- uhci_intr_info_t *));
-void uhci_exit_ctl_q __P((uhci_softc_t *, uhci_soft_qh_t *));
-#endif
-
-void uhci_free_std_chain __P((uhci_softc_t *,
- uhci_soft_td_t *, uhci_soft_td_t *));
-usbd_status uhci_alloc_std_chain __P((struct uhci_pipe *, uhci_softc_t *,
- int, int, int, usb_dma_t *,
- uhci_soft_td_t **,
- uhci_soft_td_t **));
-void uhci_timo __P((void *));
-void uhci_waitintr __P((uhci_softc_t *, usbd_request_handle));
-void uhci_check_intr __P((uhci_softc_t *, uhci_intr_info_t *));
-void uhci_ii_done __P((uhci_intr_info_t *, int));
-void uhci_timeout __P((void *));
-void uhci_wakeup_ctrl __P((void *, int, int, void *, int));
-void uhci_lock_frames __P((uhci_softc_t *));
-void uhci_unlock_frames __P((uhci_softc_t *));
-void uhci_add_ctrl __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_add_bulk __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_remove_ctrl __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_remove_bulk __P((uhci_softc_t *, uhci_soft_qh_t *));
-int uhci_str __P((usb_string_descriptor_t *, int, char *));
-
-void uhci_wakeup_cb __P((usbd_request_handle reqh));
-
-usbd_status uhci_device_ctrl_transfer __P((usbd_request_handle));
-usbd_status uhci_device_ctrl_start __P((usbd_request_handle));
-void uhci_device_ctrl_abort __P((usbd_request_handle));
-void uhci_device_ctrl_close __P((usbd_pipe_handle));
-usbd_status uhci_device_intr_transfer __P((usbd_request_handle));
-usbd_status uhci_device_intr_start __P((usbd_request_handle));
-void uhci_device_intr_abort __P((usbd_request_handle));
-void uhci_device_intr_close __P((usbd_pipe_handle));
-usbd_status uhci_device_bulk_transfer __P((usbd_request_handle));
-usbd_status uhci_device_bulk_start __P((usbd_request_handle));
-void uhci_device_bulk_abort __P((usbd_request_handle));
-void uhci_device_bulk_close __P((usbd_pipe_handle));
-usbd_status uhci_device_isoc_transfer __P((usbd_request_handle));
-usbd_status uhci_device_isoc_start __P((usbd_request_handle));
-void uhci_device_isoc_abort __P((usbd_request_handle));
-void uhci_device_isoc_close __P((usbd_pipe_handle));
-usbd_status uhci_device_isoc_setbuf __P((usbd_pipe_handle, u_int, u_int));
-
-usbd_status uhci_root_ctrl_transfer __P((usbd_request_handle));
-usbd_status uhci_root_ctrl_start __P((usbd_request_handle));
-void uhci_root_ctrl_abort __P((usbd_request_handle));
-void uhci_root_ctrl_close __P((usbd_pipe_handle));
-usbd_status uhci_root_intr_transfer __P((usbd_request_handle));
-usbd_status uhci_root_intr_start __P((usbd_request_handle));
-void uhci_root_intr_abort __P((usbd_request_handle));
-void uhci_root_intr_close __P((usbd_pipe_handle));
-
-usbd_status uhci_open __P((usbd_pipe_handle));
-void uhci_poll __P((struct usbd_bus *));
-
-usbd_status uhci_device_request __P((usbd_request_handle reqh));
-void uhci_ctrl_done __P((uhci_intr_info_t *ii));
-void uhci_bulk_done __P((uhci_intr_info_t *ii));
-
-void uhci_add_intr __P((uhci_softc_t *, int, uhci_soft_qh_t *));
-void uhci_remove_intr __P((uhci_softc_t *, int, uhci_soft_qh_t *));
-usbd_status uhci_device_setintr __P((uhci_softc_t *sc,
- struct uhci_pipe *pipe, int ival));
-void uhci_intr_done __P((uhci_intr_info_t *ii));
-void uhci_isoc_done __P((uhci_intr_info_t *ii));
-
-#ifdef USB_DEBUG
-static void uhci_dumpregs __P((uhci_softc_t *));
-void uhci_dump_tds __P((uhci_soft_td_t *));
-void uhci_dump_qh __P((uhci_soft_qh_t *));
-void uhci_dump __P((void));
-void uhci_dump_td __P((uhci_soft_td_t *));
-#endif
-
-#if defined(__NetBSD__)
-#define UWRITE2(sc, r, x) bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x))
-#define UWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
-#define UREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
-#define UREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))
-#elif defined(__FreeBSD__)
-#define UWRITE2(sc,r,x) outw((sc)->sc_iobase + (r), (x))
-#define UWRITE4(sc,r,x) outl((sc)->sc_iobase + (r), (x))
-#define UREAD2(sc,r) inw((sc)->sc_iobase + (r))
-#define UREAD4(sc,r) inl((sc)->sc_iobase + (r))
-#endif
-
-#define UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd)
-#define UHCISTS(sc) UREAD2(sc, UHCI_STS)
-
-#define UHCI_RESET_TIMEOUT 100 /* reset timeout */
-
-#define UHCI_CURFRAME(sc) (UREAD2(sc, UHCI_FRNUM) & UHCI_FRNUM_MASK)
-
-#define UHCI_INTR_ENDPT 1
-
-struct usbd_methods uhci_root_ctrl_methods = {
- uhci_root_ctrl_transfer,
- uhci_root_ctrl_start,
- uhci_root_ctrl_abort,
- uhci_root_ctrl_close,
- 0,
-};
-
-struct usbd_methods uhci_root_intr_methods = {
- uhci_root_intr_transfer,
- uhci_root_intr_start,
- uhci_root_intr_abort,
- uhci_root_intr_close,
- 0,
-};
-
-struct usbd_methods uhci_device_ctrl_methods = {
- uhci_device_ctrl_transfer,
- uhci_device_ctrl_start,
- uhci_device_ctrl_abort,
- uhci_device_ctrl_close,
- 0,
-};
-
-struct usbd_methods uhci_device_intr_methods = {
- uhci_device_intr_transfer,
- uhci_device_intr_start,
- uhci_device_intr_abort,
- uhci_device_intr_close,
- 0,
-};
-
-struct usbd_methods uhci_device_bulk_methods = {
- uhci_device_bulk_transfer,
- uhci_device_bulk_start,
- uhci_device_bulk_abort,
- uhci_device_bulk_close,
- 0,
-};
-
-struct usbd_methods uhci_device_isoc_methods = {
- uhci_device_isoc_transfer,
- uhci_device_isoc_start,
- uhci_device_isoc_abort,
- uhci_device_isoc_close,
- uhci_device_isoc_setbuf,
-};
-
-void
-uhci_busreset(sc)
- uhci_softc_t *sc;
-{
- UHCICMD(sc, UHCI_CMD_GRESET); /* global reset */
- usb_delay_ms(&sc->sc_bus, USB_BUS_RESET_DELAY); /* wait a little */
- UHCICMD(sc, 0); /* do nothing */
-}
-
-usbd_status
-uhci_init(sc)
- uhci_softc_t *sc;
-{
- usbd_status r;
- int i, j;
- uhci_soft_qh_t *csqh, *bsqh, *sqh;
- uhci_soft_td_t *std;
- usb_dma_t dma;
- static int uhci_global_init_done = 0;
-
- DPRINTFN(1,("uhci_init: start\n"));
-
- if (!uhci_global_init_done) {
- uhci_global_init_done = 1;
- LIST_INIT(&uhci_ii_free);
- }
-
-#if defined(USB_DEBUG)
- if (uhcidebug > 2)
- uhci_dumpregs(sc);
-#endif
-
- uhci_run(sc, 0); /* stop the controller */
- UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */
-
- /* Allocate and initialize real frame array. */
- r = usb_allocmem(sc->sc_dmatag,
- UHCI_FRAMELIST_COUNT * sizeof(uhci_physaddr_t),
- UHCI_FRAMELIST_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_pframes = KERNADDR(&dma);
- UWRITE2(sc, UHCI_FRNUM, 0); /* set frame number to 0 */
- UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&dma)); /* set frame list */
-
- uhci_busreset(sc);
-
- /* Allocate the dummy QH where bulk traffic will be queued. */
- bsqh = uhci_alloc_sqh(sc);
- if (!bsqh)
- return (USBD_NOMEM);
- bsqh->qh->qh_hlink = UHCI_PTR_T; /* end of QH chain */
- bsqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_bulk_start = sc->sc_bulk_end = bsqh;
-
- /* Allocate the dummy QH where control traffic will be queued. */
- csqh = uhci_alloc_sqh(sc);
- if (!csqh)
- return (USBD_NOMEM);
- csqh->qh->hlink = bsqh;
- csqh->qh->qh_hlink = bsqh->physaddr | UHCI_PTR_Q;
- csqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_ctl_start = sc->sc_ctl_end = csqh;
-
- /*
- * Make all (virtual) frame list pointers point to the interrupt
- * queue heads and the interrupt queue heads at the control
- * queue head and point the physical frame list to the virtual.
- */
- for(i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- std = uhci_alloc_std(sc);
- sqh = uhci_alloc_sqh(sc);
- if (!std || !sqh)
- return (USBD_NOMEM);
- std->td->link.sqh = sqh;
- std->td->td_link = sqh->physaddr | UHCI_PTR_Q;
- std->td->td_status = UHCI_TD_IOS; /* iso, inactive */
- std->td->td_token = 0;
- std->td->td_buffer = 0;
- sqh->qh->hlink = csqh;
- sqh->qh->qh_hlink = csqh->physaddr | UHCI_PTR_Q;
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_vframes[i].htd = std;
- sc->sc_vframes[i].etd = std;
- sc->sc_vframes[i].hqh = sqh;
- sc->sc_vframes[i].eqh = sqh;
- for (j = i;
- j < UHCI_FRAMELIST_COUNT;
- j += UHCI_VFRAMELIST_COUNT)
- sc->sc_pframes[j] = std->physaddr;
- }
-
- LIST_INIT(&sc->sc_intrhead);
-
- /* Set up the bus struct. */
- sc->sc_bus.open_pipe = uhci_open;
- sc->sc_bus.pipe_size = sizeof(struct uhci_pipe);
- sc->sc_bus.do_poll = uhci_poll;
-
- DPRINTFN(1,("uhci_init: enabling\n"));
- UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | UHCI_INTR_RIE |
- UHCI_INTR_IOCE | UHCI_INTR_SPIE); /* enable interrupts */
-
- return (uhci_run(sc, 1)); /* and here we go... */
-}
-
-#ifdef USB_DEBUG
-static void
-uhci_dumpregs(sc)
- uhci_softc_t *sc;
-{
- printf("%s; regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, "
- "flbase=%08x, sof=%04x, portsc1=%04x, portsc2=%04x\n",
- USBDEVNAME(sc->sc_bus.bdev),
- UREAD2(sc, UHCI_CMD),
- UREAD2(sc, UHCI_STS),
- UREAD2(sc, UHCI_INTR),
- UREAD2(sc, UHCI_FRNUM),
- UREAD2(sc, UHCI_FLBASEADDR),
- UREAD2(sc, UHCI_SOF),
- UREAD2(sc, UHCI_PORTSC1),
- UREAD2(sc, UHCI_PORTSC2));
-}
-
-int uhci_longtd = 1;
-
-void
-uhci_dump_td(p)
- uhci_soft_td_t *p;
-{
- printf("TD(%p) at %08lx = 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n",
- p, (long)p->physaddr,
- (long)p->td->td_link,
- (long)p->td->td_status,
- (long)p->td->td_token,
- (long)p->td->td_buffer);
- if (uhci_longtd)
- printf(" %b %b,errcnt=%d,actlen=%d pid=%02x,addr=%d,endpt=%d,"
- "D=%d,maxlen=%d\n",
- (int)p->td->td_link,
- "\20\1T\2Q\3VF",
- (int)p->td->td_status,
- "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
- "STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
- UHCI_TD_GET_ERRCNT(p->td->td_status),
- UHCI_TD_GET_ACTLEN(p->td->td_status),
- UHCI_TD_GET_PID(p->td->td_token),
- UHCI_TD_GET_DEVADDR(p->td->td_token),
- UHCI_TD_GET_ENDPT(p->td->td_token),
- UHCI_TD_GET_DT(p->td->td_token),
- UHCI_TD_GET_MAXLEN(p->td->td_token));
-}
-
-void
-uhci_dump_qh(p)
- uhci_soft_qh_t *p;
-{
- printf("QH(%p) at %08x: hlink=%08x elink=%08x\n", p, (int)p->physaddr,
- p->qh->qh_hlink, p->qh->qh_elink);
-}
-
-
-#if 0
-void
-uhci_dump()
-{
- uhci_softc_t *sc = uhci;
-
- uhci_dumpregs(sc);
- printf("intrs=%d\n", sc->sc_intrs);
- printf("framelist[i].link = %08x\n", sc->sc_framelist[0].link);
- uhci_dump_qh(sc->sc_ctl_start->qh->hlink);
-}
-#endif
-
-void
-uhci_dump_tds(std)
- uhci_soft_td_t *std;
-{
- uhci_soft_td_t *p;
-
- for(p = std; p; p = p->td->link.std)
- uhci_dump_td(p);
-}
-#endif
-
-/*
- * This routine is executed periodically and simulates interrupts
- * from the root controller interrupt pipe for port status change.
- */
-void
-uhci_timo(addr)
- void *addr;
-{
- usbd_request_handle reqh = addr;
- usbd_pipe_handle pipe = reqh->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- int s;
- u_char *p;
-
- DPRINTFN(15, ("uhci_timo\n"));
-
- p = KERNADDR(&upipe->u.intr.datadma);
- p[0] = 0;
- if (UREAD2(sc, UHCI_PORTSC1) & (UHCI_PORTSC_CSC|UHCI_PORTSC_OCIC))
- p[0] |= 1<<1;
- if (UREAD2(sc, UHCI_PORTSC2) & (UHCI_PORTSC_CSC|UHCI_PORTSC_OCIC))
- p[0] |= 1<<2;
- s = splusb();
- if (p[0] != 0) {
- reqh->actlen = 1;
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->xfercb(reqh);
- }
- if (reqh->pipe->intrreqh == reqh) {
- usb_timeout(uhci_timo, reqh, sc->sc_ival, reqh->timo_handle);
- } else {
- usb_freemem(sc->sc_dmatag, &upipe->u.intr.datadma);
- usb_start_next(reqh->pipe);
- }
- splx(s);
-}
-
-
-void
-uhci_lock_frames(sc)
- uhci_softc_t *sc;
-{
- int s = splusb();
- while (sc->sc_vflock) {
- sc->sc_vflock |= UHCI_WANT_LOCK;
- tsleep(&sc->sc_vflock, PRIBIO, "uhcqhl", 0);
- }
- sc->sc_vflock = UHCI_HAS_LOCK;
- splx(s);
-}
-
-void
-uhci_unlock_frames(sc)
- uhci_softc_t *sc;
-{
- int s = splusb();
- sc->sc_vflock &= ~UHCI_HAS_LOCK;
- if (sc->sc_vflock & UHCI_WANT_LOCK)
- wakeup(&sc->sc_vflock);
- splx(s);
-}
-
-/*
- * Allocate an interrupt information struct. A free list is kept
- * for fast allocation.
- */
-uhci_intr_info_t *
-uhci_alloc_intr_info(sc)
- uhci_softc_t *sc;
-{
- uhci_intr_info_t *ii;
-
- ii = LIST_FIRST(&uhci_ii_free);
- if (ii)
- LIST_REMOVE(ii, list);
- else {
- ii = malloc(sizeof(uhci_intr_info_t), M_USBDEV, M_NOWAIT);
- }
- ii->sc = sc;
- return ii;
-}
-
-void
-uhci_free_intr_info(ii)
- uhci_intr_info_t *ii;
-{
- LIST_INSERT_HEAD(&uhci_ii_free, ii, list); /* and put on free list */
-}
-
-/* Add control QH, called at splusb(). */
-void
-uhci_add_ctrl(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_qh_t *eqh;
-
- DPRINTFN(10, ("uhci_add_ctrl: sqh=%p\n", sqh));
- eqh = sc->sc_ctl_end->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- sc->sc_ctl_end = sqh;
-}
-
-/* Remove control QH, called at splusb(). */
-void
-uhci_remove_ctrl(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(10, ("uhci_remove_ctrl: sqh=%p\n", sqh));
- for (pqh = sc->sc_ctl_start; pqh->qh->hlink != sqh; pqh=pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_ctrl: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (sc->sc_ctl_end == sqh)
- sc->sc_ctl_end = pqh;
-}
-
-/* Add bulk QH, called at splusb(). */
-void
-uhci_add_bulk(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_qh_t *eqh;
-
- DPRINTFN(10, ("uhci_add_bulk: sqh=%p\n", sqh));
- eqh = sc->sc_bulk_end->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- sc->sc_bulk_end = sqh;
-}
-
-/* Remove bulk QH, called at splusb(). */
-void
-uhci_remove_bulk(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(10, ("uhci_remove_bulk: sqh=%p\n", sqh));
- for (pqh = sc->sc_bulk_start;
- pqh->qh->hlink != sqh;
- pqh = pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_bulk: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (sc->sc_bulk_end == sqh)
- sc->sc_bulk_end = pqh;
-}
-
-int
-uhci_intr(p)
- void *p;
-{
- uhci_softc_t *sc = p;
- int status, ret;
- uhci_intr_info_t *ii;
-
- sc->sc_intrs++;
-#if defined(USB_DEBUG)
- if (uhcidebug > 9) {
- printf("uhci_intr %p\n", sc);
- uhci_dumpregs(sc);
- }
-#endif
- status = UREAD2(sc, UHCI_STS);
- ret = 0;
- if (status & UHCI_STS_USBINT) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_USBINT); /* acknowledge */
- ret = 1;
- }
- if (status & UHCI_STS_USBEI) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_USBEI); /* acknowledge */
- ret = 1;
- }
- if (status & UHCI_STS_RD) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_RD); /* acknowledge */
- printf("%s: resume detect\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HSE) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_HSE); /* acknowledge */
- printf("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HCPE) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_HCPE); /* acknowledge */
- printf("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HCH)
- printf("%s: controller halted\n", USBDEVNAME(sc->sc_bus.bdev));
- if (!ret)
- return 0;
-
- /*
- * Interrupts on UHCI really suck. When the host controller
- * interrupts because a transfer is completed there is no
- * way of knowing which transfer it was. You can scan down
- * the TDs and QHs of the previous frame to limit the search,
- * but that assumes that the interrupt was not delayed by more
- * than 1 ms, which may not always be true (e.g. after debug
- * output on a slow console).
- * We scan all interrupt descriptors to see if any have
- * completed.
- */
- for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = LIST_NEXT(ii, list))
- uhci_check_intr(sc, ii);
-
- DPRINTFN(10, ("uhci_intr: exit\n"));
- return 1;
-}
-
-/* Check for an interrupt. */
-void
-uhci_check_intr(sc, ii)
- uhci_softc_t *sc;
- uhci_intr_info_t *ii;
-{
- struct uhci_pipe *upipe;
- uhci_soft_td_t *std, *lstd;
- u_int32_t status;
-
- DPRINTFN(15, ("uhci_check_intr: ii=%p\n", ii));
-#ifdef DIAGNOSTIC
- if (!ii) {
- printf("uhci_check_intr: no ii? %p\n", ii);
- return;
- }
-#endif
- if (!ii->stdstart)
- return;
- lstd = ii->stdend;
-#ifdef DIAGNOSTIC
- if (!lstd) {
- printf("uhci_check_intr: std==0\n");
- return;
- }
-#endif
- /* If the last TD is still active the whole transfer probably is. */
- if (lstd->td->td_status & UHCI_TD_ACTIVE) {
- DPRINTFN(15, ("uhci_check_intr: active ii=%p\n", ii));
- for (std = ii->stdstart; std != lstd; std = std->td->link.std){
- status = std->td->td_status;
- if ((status & UHCI_TD_STALLED) ||
- (status & (UHCI_TD_SPD | UHCI_TD_ACTIVE)) ==
- UHCI_TD_SPD)
- goto done;
- }
- DPRINTFN(15, ("uhci_check_intr: ii=%p std=%p still active\n",
- ii, ii->stdstart));
- return;
- }
- done:
- upipe = (struct uhci_pipe *)ii->reqh->pipe;
- upipe->pipe.endpoint->toggle = upipe->newtoggle;
- uhci_ii_done(ii, 0);
- usb_untimeout(uhci_timeout, ii, ii->timeout_handle);
-}
-
-void
-uhci_ii_done(ii, timo)
- uhci_intr_info_t *ii;
- int timo;
-{
- usbd_request_handle reqh = ii->reqh;
- uhci_soft_td_t *std;
- u_int32_t tst;
- int len, status, attr;
-
- DPRINTFN(10, ("uhci_ii_done: ii=%p ready %d\n", ii, timo));
-
-#ifdef DIAGNOSTIC
- {
- int s = splhigh();
- if (ii->isdone) {
- printf("uhci_ii_done: is done!\n");
- splx(s);
- return;
- }
- ii->isdone = 1;
- splx(s);
- }
-#endif
-
- /* The transfer is done, compute length and status. */
- /* XXX Should stop at first inactive to get toggle right. */
- /* XXX Is this correct for control xfers? */
- for (len = status = 0, std = ii->stdstart;
- std != 0;
- std = std->td->link.std) {
- tst = std->td->td_status;
- status |= tst;
-#ifdef USB_DEBUG
- if ((tst & UHCI_TD_ERROR) && uhcidebug) {
- printf("uhci_ii_done: intr error TD:\n");
- uhci_dump_td(std);
- }
-#endif
- if (UHCI_TD_GET_PID(std->td->td_token) != UHCI_TD_PID_SETUP)
- len += UHCI_TD_GET_ACTLEN(tst);
- }
- status &= UHCI_TD_ERROR;
- DPRINTFN(10, ("uhci_check_intr: len=%d, status=0x%x\n", len, status));
- if (status != 0) {
- DPRINTFN(-1+(status==UHCI_TD_STALLED),
- ("uhci_ii_done: error, addr=%d, endpt=0x%02x, "
- "status 0x%b\n",
- reqh->pipe->device->address,
- reqh->pipe->endpoint->edesc->bEndpointAddress,
- (int)status,
- "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
- "STALLED\30ACTIVE"));
- if (status == UHCI_TD_STALLED)
- reqh->status = USBD_STALLED;
- else
- reqh->status = USBD_IOERROR; /* more info XXX */
- reqh->actlen = 0;
- } else {
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->actlen = len;
- }
- if (timo) {
- /* We got a timeout. Make sure transaction is not active. */
- reqh->status = USBD_TIMEOUT;
- for (std = ii->stdstart; std != 0; std = std->td->link.std)
- std->td->td_status &= ~UHCI_TD_ACTIVE;
- /* XXX should we wait 1 ms */
- }
- DPRINTFN(5, ("uhci_ii_done: calling handler ii=%p\n", ii));
-
- attr = reqh->pipe->endpoint->edesc->bmAttributes;
- switch (attr & UE_XFERTYPE) {
- case UE_CONTROL:
- uhci_ctrl_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_ISOCHRONOUS:
- uhci_isoc_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_BULK:
- uhci_bulk_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_INTERRUPT:
- uhci_intr_done(ii);
- break;
- }
-
- /* And finally execute callback. */
- reqh->xfercb(reqh);
-}
-
-/*
- * Called when a request does not complete.
- */
-void
-uhci_timeout(addr)
- void *addr;
-{
- uhci_intr_info_t *ii = addr;
- int s;
-
- DPRINTF(("uhci_timeout: ii=%p\n", ii));
- s = splusb();
- uhci_ii_done(ii, 1);
- splx(s);
-}
-
-/*
- * Wait here until controller claims to have an interrupt.
- * Then call uhci_intr and return. Use timeout to avoid waiting
- * too long.
- * Only used during boot when interrupts are not enabled yet.
- */
-void
-uhci_waitintr(sc, reqh)
- uhci_softc_t *sc;
- usbd_request_handle reqh;
-{
- int timo = reqh->timeout;
- int usecs;
- uhci_intr_info_t *ii;
-
- DPRINTFN(10,("uhci_waitintr: timeout = %ds\n", timo));
-
- reqh->status = USBD_IN_PROGRESS;
- for (usecs = timo * 1000000 / hz; usecs > 0; usecs -= 1000) {
- usb_delay_ms(&sc->sc_bus, 1);
- DPRINTFN(10,("uhci_waitintr: 0x%04x\n", UREAD2(sc, UHCI_STS)));
- if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT) {
- uhci_intr(sc);
- if (reqh->status != USBD_IN_PROGRESS)
- return;
- }
- }
-
- /* Timeout */
- DPRINTF(("uhci_waitintr: timeout\n"));
- for (ii = LIST_FIRST(&sc->sc_intrhead);
- ii && ii->reqh != reqh;
- ii = LIST_NEXT(ii, list))
- ;
- if (ii)
- uhci_ii_done(ii, 1);
- else
- panic("uhci_waitintr: lost intr_info\n");
-}
-
-void
-uhci_poll(bus)
- struct usbd_bus *bus;
-{
- uhci_softc_t *sc = (uhci_softc_t *)bus;
-
- if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT)
- uhci_intr(sc);
-}
-
-#if 0
-void
-uhci_reset(p)
- void *p;
-{
- uhci_softc_t *sc = p;
- int n;
-
- UHCICMD(sc, UHCI_CMD_HCRESET);
- /* The reset bit goes low when the controller is done. */
- for (n = 0; n < UHCI_RESET_TIMEOUT &&
- (UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET); n++)
- delay(100);
- if (n >= UHCI_RESET_TIMEOUT)
- printf("%s: controller did not reset\n",
- USBDEVNAME(sc->sc_bus.bdev));
-}
-#endif
-
-usbd_status
-uhci_run(sc, run)
- uhci_softc_t *sc;
- int run;
-{
- int s, n, running;
-
- run = run != 0;
- s = splusb();
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
- if (run == running) {
- splx(s);
- return (USBD_NORMAL_COMPLETION);
- }
- UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0);
- for(n = 0; n < 10; n++) {
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
- /* return when we've entered the state we want */
- if (run == running) {
- splx(s);
- return (USBD_NORMAL_COMPLETION);
- }
- usb_delay_ms(&sc->sc_bus, 1);
- }
- splx(s);
- printf("%s: cannot %s\n", USBDEVNAME(sc->sc_bus.bdev),
- run ? "start" : "stop");
- return (USBD_IOERROR);
-}
-
-/*
- * Memory management routines.
- * uhci_alloc_std allocates TDs
- * uhci_alloc_sqh allocates QHs
- * These two routines do their own free list management,
- * partly for speed, partly because allocating DMAable memory
- * has page size granularaity so much memory would be wasted if
- * only one TD/QH (32 bytes) was placed in each allocated chunk.
- */
-
-uhci_soft_td_t *
-uhci_alloc_std(sc)
- uhci_softc_t *sc;
-{
- uhci_soft_td_t *std;
- usbd_status r;
- int i;
- usb_dma_t dma;
-
- if (!sc->sc_freetds) {
- DPRINTFN(2,("uhci_alloc_std: allocating chunk\n"));
- std = malloc(sizeof(uhci_soft_td_t) * UHCI_TD_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!std)
- return (0);
- r = usb_allocmem(sc->sc_dmatag, UHCI_TD_SIZE * UHCI_TD_CHUNK,
- UHCI_TD_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(std, M_USBDEV);
- return (0);
- }
- for(i = 0; i < UHCI_TD_CHUNK; i++, std++) {
- std->physaddr = DMAADDR(&dma) + i * UHCI_TD_SIZE;
- std->td = (uhci_td_t *)
- ((char *)KERNADDR(&dma) + i * UHCI_TD_SIZE);
- std->td->link.std = sc->sc_freetds;
- sc->sc_freetds = std;
- }
- }
- std = sc->sc_freetds;
- sc->sc_freetds = std->td->link.std;
- memset(std->td, 0, UHCI_TD_SIZE);
- return std;
-}
-
-void
-uhci_free_std(sc, std)
- uhci_softc_t *sc;
- uhci_soft_td_t *std;
-{
-#ifdef DIAGNOSTIC
-#define TD_IS_FREE 0x12345678
- if (std->td->td_token == TD_IS_FREE) {
- printf("uhci_free_std: freeing free TD %p\n", std);
- return;
- }
- std->td->td_token = TD_IS_FREE;
-#endif
- std->td->link.std = sc->sc_freetds;
- sc->sc_freetds = std;
-}
-
-uhci_soft_qh_t *
-uhci_alloc_sqh(sc)
- uhci_softc_t *sc;
-{
- uhci_soft_qh_t *sqh;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freeqhs) {
- DPRINTFN(2, ("uhci_alloc_sqh: allocating chunk\n"));
- sqh = malloc(sizeof(uhci_soft_qh_t) * UHCI_QH_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!sqh)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, UHCI_QH_SIZE * UHCI_QH_CHUNK,
- UHCI_QH_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sqh, M_USBDEV);
- return 0;
- }
- for(i = 0; i < UHCI_QH_CHUNK; i++, sqh++) {
- offs = i * UHCI_QH_SIZE;
- sqh->physaddr = DMAADDR(&dma) + offs;
- sqh->qh = (uhci_qh_t *)
- ((char *)KERNADDR(&dma) + offs);
- sqh->qh->hlink = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh;
- }
- }
- sqh = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh->qh->hlink;
- memset(sqh->qh, 0, UHCI_QH_SIZE);
- return (sqh);
-}
-
-void
-uhci_free_sqh(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- sqh->qh->hlink = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh;
-}
-
-#if 0
-/*
- * Enter a list of transfers onto a control queue.
- * Called at splusb()
- */
-void
-uhci_enter_ctl_q(sc, sqh, ii)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
- uhci_intr_info_t *ii;
-{
- DPRINTFN(5, ("uhci_enter_ctl_q: sqh=%p\n", sqh));
-
-}
-#endif
-
-void
-uhci_free_std_chain(sc, std, stdend)
- uhci_softc_t *sc;
- uhci_soft_td_t *std;
- uhci_soft_td_t *stdend;
-{
- uhci_soft_td_t *p;
-
- for (; std != stdend; std = p) {
- p = std->td->link.std;
- uhci_free_std(sc, std);
- }
-}
-
-usbd_status
-uhci_alloc_std_chain(upipe, sc, len, rd, spd, dma, sp, ep)
- struct uhci_pipe *upipe;
- uhci_softc_t *sc;
- int len, rd, spd;
- usb_dma_t *dma;
- uhci_soft_td_t **sp, **ep;
-{
- uhci_soft_td_t *p, *lastp;
- uhci_physaddr_t lastlink;
- int i, ntd, l, tog, maxp;
- u_int32_t status;
- int addr = upipe->pipe.device->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
-
- DPRINTFN(15, ("uhci_alloc_std_chain: addr=%d endpt=%d len=%d ls=%d "
- "spd=%d\n", addr, endpt, len,
- upipe->pipe.device->lowspeed, spd));
- if (len == 0) {
- *sp = *ep = 0;
- DPRINTFN(-1,("uhci_alloc_std_chain: len=0\n"));
- return (USBD_NORMAL_COMPLETION);
- }
- maxp = UGETW(upipe->pipe.endpoint->edesc->wMaxPacketSize);
- if (maxp == 0) {
- printf("uhci_alloc_std_chain: maxp=0\n");
- return (USBD_INVAL);
- }
- ntd = (len + maxp - 1) / maxp;
- tog = upipe->pipe.endpoint->toggle;
- if (ntd % 2 == 0)
- tog ^= 1;
- upipe->newtoggle = tog ^ 1;
- lastp = 0;
- lastlink = UHCI_PTR_T;
- ntd--;
- status = UHCI_TD_SET_ERRCNT(2) | UHCI_TD_ACTIVE;
- if (upipe->pipe.device->lowspeed)
- status |= UHCI_TD_LS;
- if (spd)
- status |= UHCI_TD_SPD;
- for (i = ntd; i >= 0; i--) {
- p = uhci_alloc_std(sc);
- if (!p) {
- uhci_free_std_chain(sc, lastp, 0);
- return (USBD_NOMEM);
- }
- p->td->link.std = lastp;
- p->td->td_link = lastlink;
- lastp = p;
- lastlink = p->physaddr;
- p->td->td_status = status;
- if (i == ntd) {
- /* last TD */
- l = len % maxp;
- if (l == 0) l = maxp;
- *ep = p;
- } else
- l = maxp;
- p->td->td_token =
- rd ? UHCI_TD_IN (l, endpt, addr, tog) :
- UHCI_TD_OUT(l, endpt, addr, tog);
- p->td->td_buffer = DMAADDR(dma) + i * maxp;
- tog ^= 1;
- }
- *sp = lastp;
- /*upipe->pipe.endpoint->toggle = tog;*/
- DPRINTFN(10, ("uhci_alloc_std_chain: oldtog=%d newtog=%d\n",
- upipe->pipe.endpoint->toggle, upipe->newtoggle));
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-uhci_device_bulk_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_bulk_start(reqh));
-}
-
-usbd_status
-uhci_device_bulk_start(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *xfer, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- usbd_status r;
- int len, isread;
- int s;
-
- DPRINTFN(3, ("uhci_device_bulk_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- if (reqh->isreq)
- panic("uhci_device_bulk_transfer: a request\n");
-
- len = reqh->length;
- dmap = &upipe->u.bulk.datadma;
- isread = reqh->pipe->endpoint->edesc->bEndpointAddress & UE_IN;
- sqh = upipe->u.bulk.sqh;
-
- upipe->u.bulk.isread = isread;
- upipe->u.bulk.length = len;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- r = uhci_alloc_std_chain(upipe, sc, len, isread,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- xferend->td->td_status |= UHCI_TD_IOC;
-
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_bulk_transfer: xfer(1)\n");
- uhci_dump_tds(xfer);
- }
-#endif
-
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- sqh->intr_info = ii;
-
- s = splusb();
- uhci_add_bulk(sc, sqh);
- LIST_INSERT_HEAD(&sc->sc_intrhead, ii, list);
-
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(uhci_timeout, ii,
- MS_TO_TICKS(reqh->timeout), ii->timeout_handle);
- }
- splx(s);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_bulk_transfer: xfer(2)\n");
- uhci_dump_tds(xfer);
- }
-#endif
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device bulk request. */
-void
-uhci_device_bulk_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1);/* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device bulk pipe. */
-void
-uhci_device_bulk_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
-
- uhci_free_sqh(sc, upipe->u.bulk.sqh);
- uhci_free_intr_info(upipe->iinfo);
- /* XXX free other resources */
-}
-
-usbd_status
-uhci_device_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_ctrl_start(reqh));
-}
-
-usbd_status
-uhci_device_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- uhci_softc_t *sc = (uhci_softc_t *)reqh->pipe->device->bus;
- usbd_status r;
-
- if (!reqh->isreq)
- panic("uhci_device_ctrl_transfer: not a request\n");
-
- r = uhci_device_request(reqh);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- if (sc->sc_bus.use_polling)
- uhci_waitintr(sc, reqh);
- return (USBD_IN_PROGRESS);
-}
-
-usbd_status
-uhci_device_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_intr_start(reqh));
-}
-
-usbd_status
-uhci_device_intr_start(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *xfer, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- usbd_status r;
- int len, i;
- int s;
-
- DPRINTFN(3, ("uhci_device_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- if (reqh->isreq)
- panic("uhci_device_intr_transfer: a request\n");
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- r = uhci_alloc_std_chain(upipe, sc, len, 1,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- xferend->td->td_status |= UHCI_TD_IOC;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_transfer: xfer(1)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- s = splusb();
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- DPRINTFN(10,("uhci_device_intr_transfer: qhs[0]=%p\n",
- upipe->u.intr.qhs[0]));
- for (i = 0; i < upipe->u.intr.npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- }
- splx(s);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_transfer: xfer(2)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device control request. */
-void
-uhci_device_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device control pipe. */
-void
-uhci_device_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
-
- uhci_free_intr_info(upipe->iinfo);
- /* XXX free other resources */
-}
-
-/* Abort a device interrupt request. */
-void
-uhci_device_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe;
-
- DPRINTFN(1, ("uhci_device_intr_abort: reqh=%p\n", reqh));
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 2); /* make sure it is done */
- if (reqh->pipe->intrreqh == reqh) {
- DPRINTF(("uhci_device_intr_abort: remove\n"));
- reqh->pipe->intrreqh = 0;
- upipe = (struct uhci_pipe *)reqh->pipe;
- uhci_intr_done(upipe->u.intr.qhs[0]->intr_info);
- }
-}
-
-/* Close a device interrupt pipe. */
-void
-uhci_device_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- int i, s, npoll;
-
- upipe->iinfo->stdstart = 0; /* inactive */
-
- /* Unlink descriptors from controller data structures. */
- npoll = upipe->u.intr.npoll;
- uhci_lock_frames(sc);
- for (i = 0; i < npoll; i++)
- uhci_remove_intr(sc, upipe->u.intr.qhs[i]->pos,
- upipe->u.intr.qhs[i]);
- uhci_unlock_frames(sc);
-
- /*
- * We now have to wait for any activity on the physical
- * descriptors to stop.
- */
- usb_delay_ms(&sc->sc_bus, 2);
-
- for(i = 0; i < npoll; i++)
- uhci_free_sqh(sc, upipe->u.intr.qhs[i]);
- free(upipe->u.intr.qhs, M_USB);
-
- s = splusb();
- LIST_REMOVE(upipe->iinfo, list); /* remove from active list */
- splx(s);
- uhci_free_intr_info(upipe->iinfo);
-
- /* XXX free other resources */
-}
-
-usbd_status
-uhci_device_request(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usb_device_request_t *req = &reqh->request;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- int addr = dev->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *setup, *xfer, *stat, *next, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- int len;
- u_int32_t ls;
- usbd_status r;
- int isread;
- int s;
-
- DPRINTFN(3,("uhci_device_control type=0x%02x, request=0x%02x, "
- "wValue=0x%04x, wIndex=0x%04x len=%d, addr=%d, endpt=%d\n",
- req->bmRequestType, req->bRequest, UGETW(req->wValue),
- UGETW(req->wIndex), UGETW(req->wLength),
- addr, endpt));
-
- ls = dev->lowspeed ? UHCI_TD_LS : 0;
- isread = req->bmRequestType & UT_READ;
- len = UGETW(req->wLength);
-
- setup = upipe->u.ctl.setup;
- stat = upipe->u.ctl.stat;
- sqh = upipe->u.ctl.sqh;
- dmap = &upipe->u.ctl.datadma;
-
- /* Set up data transaction */
- if (len != 0) {
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- upipe->pipe.endpoint->toggle = 1;
- r = uhci_alloc_std_chain(upipe, sc, len, isread,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- next = xfer;
- xferend->td->link.std = stat;
- xferend->td->td_link = stat->physaddr;
- } else {
- next = stat;
- }
- upipe->u.ctl.length = len;
-
- memcpy(KERNADDR(&upipe->u.ctl.reqdma), req, sizeof *req);
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- setup->td->link.std = next;
- setup->td->td_link = next->physaddr;
- setup->td->td_status = UHCI_TD_SET_ERRCNT(2) | ls | UHCI_TD_ACTIVE;
- setup->td->td_token = UHCI_TD_SETUP(sizeof *req, endpt, addr);
- setup->td->td_buffer = DMAADDR(&upipe->u.ctl.reqdma);
-
- stat->td->link.std = 0;
- stat->td->td_link = UHCI_PTR_T;
- stat->td->td_status = UHCI_TD_SET_ERRCNT(2) | ls |
- UHCI_TD_ACTIVE | UHCI_TD_IOC;
- stat->td->td_token =
- isread ? UHCI_TD_OUT(0, endpt, addr, 1) :
- UHCI_TD_IN (0, endpt, addr, 1);
- stat->td->td_buffer = 0;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 20) {
- printf("uhci_device_request: setup\n");
- uhci_dump_td(setup);
- printf("uhci_device_request: stat\n");
- uhci_dump_td(stat);
- }
-#endif
-
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = setup;
- ii->stdend = stat;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- sqh->qh->elink = setup;
- sqh->qh->qh_elink = setup->physaddr;
- sqh->intr_info = ii;
-
- s = splusb();
- uhci_add_ctrl(sc, sqh);
- LIST_INSERT_HEAD(&sc->sc_intrhead, ii, list);
-#ifdef USB_DEBUG
- if (uhcidebug > 12) {
- uhci_soft_td_t *std;
- uhci_soft_qh_t *xqh;
- uhci_soft_qh_t *sxqh;
- int maxqh = 0;
- uhci_physaddr_t link;
- printf("uhci_enter_ctl_q: follow from [0]\n");
- for (std = sc->sc_vframes[0].htd, link = 0;
- (link & UHCI_PTR_Q) == 0;
- std = std->td->link.std) {
- link = std->td->td_link;
- uhci_dump_td(std);
- }
- for (sxqh = xqh = (uhci_soft_qh_t *)std;
- xqh;
- xqh = (maxqh++ == 5 || xqh->qh->hlink==sxqh ||
- xqh->qh->hlink==xqh ? NULL : xqh->qh->hlink)) {
- uhci_dump_qh(xqh);
- uhci_dump_qh(sxqh);
- }
- printf("Enqueued QH:\n");
- uhci_dump_qh(sqh);
- uhci_dump_tds(sqh->qh->elink);
- }
-#endif
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(uhci_timeout, ii,
- MS_TO_TICKS(reqh->timeout), ii->timeout_handle);
- }
- splx(s);
-
- return (USBD_NORMAL_COMPLETION);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-usbd_status
-uhci_device_isoc_transfer(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
-#ifdef USB_DEBUG
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
-#endif
-
- DPRINTFN(1,("uhci_device_isoc_transfer: sc=%p\n", sc));
- if (upipe->u.iso.bufsize == 0)
- return (USBD_INVAL);
-
- /* XXX copy data */
- return (USBD_XXX);
-}
-
-usbd_status
-uhci_device_isoc_start(reqh)
- usbd_request_handle reqh;
-{
- return (USBD_XXX);
-}
-
-void
-uhci_device_isoc_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX Can't abort a single request. */
-}
-
-void
-uhci_device_isoc_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- struct iso *iso;
- int i;
-
- /*
- * Make sure all TDs are marked as inactive.
- * Wait for completion.
- * Unschedule.
- * Deallocate.
- */
- iso = &upipe->u.iso;
-
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++)
- iso->stds[i]->td->td_status &= ~UHCI_TD_ACTIVE;
- usb_delay_ms(&sc->sc_bus, 2); /* wait for completion */
-
- uhci_lock_frames(sc);
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- uhci_soft_td_t *std, *vstd;
-
- std = iso->stds[i];
- for (vstd = sc->sc_vframes[i % UHCI_VFRAMELIST_COUNT].htd;
- vstd && vstd->td->link.std != std;
- vstd = vstd->td->link.std)
- ;
- if (!vstd) {
- /*panic*/
- printf("uhci_device_isoc_close: %p not found\n", std);
- uhci_unlock_frames(sc);
- return;
- }
- vstd->td->link = std->td->link;
- vstd->td->td_link = std->td->td_link;
- uhci_free_std(sc, std);
- }
- uhci_unlock_frames(sc);
-
- for (i = 0; i < iso->nbuf; i++)
- usb_freemem(sc->sc_dmatag, &iso->bufs[i]);
- free(iso->stds, M_USB);
- free(iso->bufs, M_USB);
-
- /* XXX what else? */
-}
-
-usbd_status
-uhci_device_isoc_setbuf(pipe, bufsize, nbuf)
- usbd_pipe_handle pipe;
- u_int bufsize;
- u_int nbuf;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- int addr = upipe->pipe.device->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
- int rd = upipe->pipe.endpoint->edesc->bEndpointAddress & UE_IN;
- struct iso *iso;
- int i;
- usbd_status r;
-
- /*
- * For simplicity the number of buffers must fit nicely in the frame
- * list.
- */
- if (UHCI_VFRAMELIST_COUNT % nbuf != 0)
- return (USBD_INVAL);
-
- iso = &upipe->u.iso;
- iso->bufsize = bufsize;
- iso->nbuf = nbuf;
-
- /* Allocate memory for buffers. */
- iso->bufs = malloc(nbuf * sizeof(usb_dma_t), M_USB, M_WAITOK);
- iso->stds = malloc(UHCI_VFRAMELIST_COUNT * sizeof (uhci_soft_td_t *),
- M_USB, M_WAITOK);
-
- for (i = 0; i < nbuf; i++) {
- r = usb_allocmem(sc->sc_dmatag, bufsize, 0, &iso->bufs[i]);
- if (r != USBD_NORMAL_COMPLETION) {
- nbuf = i;
- goto bad1;
- }
- }
-
- /* Allocate the TDs. */
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- iso->stds[i] = uhci_alloc_std(sc);
- if (iso->stds[i] == 0)
- goto bad2;
- }
-
- /* XXX check schedule */
-
- /* XXX interrupts */
-
- /* Insert TDs into schedule, all marked inactive. */
- uhci_lock_frames(sc);
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- uhci_soft_td_t *std, *vstd;
-
- std = iso->stds[i];
- std->td->td_status = UHCI_TD_IOS; /* iso, inactive */
- std->td->td_token =
- rd ? UHCI_TD_IN (0, endpt, addr, 0) :
- UHCI_TD_OUT(0, endpt, addr, 0);
- std->td->td_buffer = DMAADDR(&iso->bufs[i % nbuf]);
-
- vstd = sc->sc_vframes[i % UHCI_VFRAMELIST_COUNT].htd;
- std->td->link = vstd->td->link;
- std->td->td_link = vstd->td->td_link;
- vstd->td->link.std = std;
- vstd->td->td_link = std->physaddr;
- }
- uhci_unlock_frames(sc);
-
- return (USBD_NORMAL_COMPLETION);
-
- bad2:
- while (--i >= 0)
- uhci_free_std(sc, iso->stds[i]);
- bad1:
- for (i = 0; i < nbuf; i++)
- usb_freemem(sc->sc_dmatag, &iso->bufs[i]);
- free(iso->stds, M_USB);
- free(iso->bufs, M_USB);
- return (USBD_NOMEM);
-}
-
-void
-uhci_isoc_done(ii)
- uhci_intr_info_t *ii;
-{
-}
-
-void
-uhci_intr_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usb_dma_t *dma;
- uhci_soft_qh_t *sqh;
- int i, npoll;
-
- DPRINTFN(5, ("uhci_intr_done: length=%d\n", reqh->actlen));
-
- dma = &upipe->u.intr.datadma;
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
- npoll = upipe->u.intr.npoll;
- for(i = 0; i < npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- }
- uhci_free_std_chain(sc, ii->stdstart, 0);
-
- /* XXX Wasteful. */
- if (reqh->pipe->intrreqh == reqh) {
- uhci_soft_td_t *xfer, *xferend;
-
- /* This alloc cannot fail since we freed the chain above. */
- uhci_alloc_std_chain(upipe, sc, reqh->length, 1,
- reqh->flags & USBD_SHORT_XFER_OK,
- dma, &xfer, &xferend);
- xferend->td->td_status |= UHCI_TD_IOC;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_done: xfer(1)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
- for (i = 0; i < npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- }
- } else {
- usb_freemem(sc->sc_dmatag, dma);
- ii->stdstart = 0; /* mark as inactive */
- usb_start_next(reqh->pipe);
- }
-}
-
-/* Deallocate request data structures */
-void
-uhci_ctrl_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- u_int len = upipe->u.ctl.length;
- usb_dma_t *dma;
- uhci_td_t *htd = ii->stdstart->td;
-
-#ifdef DIAGNOSTIC
- if (!reqh->isreq)
- panic("uhci_ctrl_done: not a request\n");
-#endif
-
- LIST_REMOVE(ii, list); /* remove from active list */
-
- uhci_remove_ctrl(sc, upipe->u.ctl.sqh);
-
- if (len != 0) {
- dma = &upipe->u.ctl.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- uhci_free_std_chain(sc, htd->link.std, ii->stdend);
- usb_freemem(sc->sc_dmatag, dma);
- }
- DPRINTFN(5, ("uhci_ctrl_done: length=%d\n", reqh->actlen));
-}
-
-/* Deallocate request data structures */
-void
-uhci_bulk_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- u_int len = upipe->u.bulk.length;
- usb_dma_t *dma;
- uhci_td_t *htd = ii->stdstart->td;
-
- LIST_REMOVE(ii, list); /* remove from active list */
-
- uhci_remove_bulk(sc, upipe->u.bulk.sqh);
-
- if (len != 0) {
- dma = &upipe->u.bulk.datadma;
- if (upipe->u.bulk.isread && len != 0)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- uhci_free_std_chain(sc, htd->link.std, 0);
- usb_freemem(sc->sc_dmatag, dma);
- }
- DPRINTFN(4, ("uhci_bulk_done: length=%d\n", reqh->actlen));
- /* XXX compute new toggle */
-}
-
-/* Add interrupt QH, called with vflock. */
-void
-uhci_add_intr(sc, n, sqh)
- uhci_softc_t *sc;
- int n;
- uhci_soft_qh_t *sqh;
-{
- struct uhci_vframe *vf = &sc->sc_vframes[n];
- uhci_qh_t *eqh;
-
- DPRINTFN(4, ("uhci_add_intr: n=%d sqh=%p\n", n, sqh));
- eqh = vf->eqh->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- vf->eqh = sqh;
- vf->bandwidth++;
-}
-
-/* Remove interrupt QH, called with vflock. */
-void
-uhci_remove_intr(sc, n, sqh)
- uhci_softc_t *sc;
- int n;
- uhci_soft_qh_t *sqh;
-{
- struct uhci_vframe *vf = &sc->sc_vframes[n];
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(4, ("uhci_remove_intr: n=%d sqh=%p\n", n, sqh));
-
- for (pqh = vf->hqh; pqh->qh->hlink != sqh; pqh = pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_intr: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (vf->eqh == sqh)
- vf->eqh = pqh;
- vf->bandwidth--;
-}
-
-usbd_status
-uhci_device_setintr(sc, upipe, ival)
- uhci_softc_t *sc;
- struct uhci_pipe *upipe;
- int ival;
-{
- uhci_soft_qh_t *sqh;
- int i, npoll, s;
- u_int bestbw, bw, bestoffs, offs;
-
- DPRINTFN(2, ("uhci_setintr: pipe=%p\n", upipe));
- if (ival == 0) {
- printf("uhci_setintr: 0 interval\n");
- return (USBD_INVAL);
- }
-
- if (ival > UHCI_VFRAMELIST_COUNT)
- ival = UHCI_VFRAMELIST_COUNT;
- npoll = (UHCI_VFRAMELIST_COUNT + ival - 1) / ival;
- DPRINTFN(2, ("uhci_setintr: ival=%d npoll=%d\n", ival, npoll));
-
- upipe->u.intr.npoll = npoll;
- upipe->u.intr.qhs =
- malloc(npoll * sizeof(uhci_soft_qh_t *), M_USB, M_WAITOK);
-
- /*
- * Figure out which offset in the schedule that has most
- * bandwidth left over.
- */
-#define MOD(i) ((i) & (UHCI_VFRAMELIST_COUNT-1))
- for (bestoffs = offs = 0, bestbw = ~0; offs < ival; offs++) {
- for (bw = i = 0; i < npoll; i++)
- bw += sc->sc_vframes[MOD(i * ival + offs)].bandwidth;
- if (bw < bestbw) {
- bestbw = bw;
- bestoffs = offs;
- }
- }
- DPRINTFN(1, ("uhci_setintr: bw=%d offs=%d\n", bestbw, bestoffs));
-
- upipe->iinfo->stdstart = 0;
- for(i = 0; i < npoll; i++) {
- upipe->u.intr.qhs[i] = sqh = uhci_alloc_sqh(sc);
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- sqh->pos = MOD(i * ival + bestoffs);
- sqh->intr_info = upipe->iinfo;
- }
-#undef MOD
-
- s = splusb();
- LIST_INSERT_HEAD(&sc->sc_intrhead, upipe->iinfo, list);
- splx(s);
-
- uhci_lock_frames(sc);
- /* Enter QHs into the controller data structures. */
- for(i = 0; i < npoll; i++)
- uhci_add_intr(sc, upipe->u.intr.qhs[i]->pos,
- upipe->u.intr.qhs[i]);
- uhci_unlock_frames(sc);
-
- DPRINTFN(5, ("uhci_setintr: returns %p\n", upipe));
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Open a new pipe. */
-usbd_status
-uhci_open(pipe)
- usbd_pipe_handle pipe;
-{
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
- usbd_status r;
-
- DPRINTFN(1, ("uhci_open: pipe=%p, addr=%d, endpt=%d (%d)\n",
- pipe, pipe->device->address,
- ed->bEndpointAddress, sc->sc_addr));
- if (pipe->device->address == sc->sc_addr) {
- switch (ed->bEndpointAddress) {
- case USB_CONTROL_ENDPOINT:
- pipe->methods = &uhci_root_ctrl_methods;
- break;
- case UE_IN | UHCI_INTR_ENDPT:
- pipe->methods = &uhci_root_intr_methods;
- break;
- default:
- return (USBD_INVAL);
- }
- } else {
- upipe->iinfo = uhci_alloc_intr_info(sc);
- if (upipe->iinfo == 0)
- return (USBD_NOMEM);
- switch (ed->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- pipe->methods = &uhci_device_ctrl_methods;
- upipe->u.ctl.sqh = uhci_alloc_sqh(sc);
- if (upipe->u.ctl.sqh == 0)
- goto bad;
- upipe->u.ctl.setup = uhci_alloc_std(sc);
- if (upipe->u.ctl.setup == 0) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- goto bad;
- }
- upipe->u.ctl.stat = uhci_alloc_std(sc);
- if (upipe->u.ctl.stat == 0) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- uhci_free_std(sc, upipe->u.ctl.setup);
- goto bad;
- }
- r = usb_allocmem(sc->sc_dmatag,
- sizeof(usb_device_request_t),
- 0, &upipe->u.ctl.reqdma);
- if (r != USBD_NORMAL_COMPLETION) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- uhci_free_std(sc, upipe->u.ctl.setup);
- uhci_free_std(sc, upipe->u.ctl.stat);
- goto bad;
- }
- break;
- case UE_INTERRUPT:
- pipe->methods = &uhci_device_intr_methods;
- return (uhci_device_setintr(sc, upipe, ed->bInterval));
- case UE_ISOCHRONOUS:
- pipe->methods = &uhci_device_isoc_methods;
- upipe->u.iso.nbuf = 0;
- return (USBD_NORMAL_COMPLETION);
- case UE_BULK:
- pipe->methods = &uhci_device_bulk_methods;
- upipe->u.bulk.sqh = uhci_alloc_sqh(sc);
- if (upipe->u.bulk.sqh == 0)
- goto bad;
- break;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- uhci_free_intr_info(upipe->iinfo);
- return (USBD_NOMEM);
-}
-
-/*
- * Data structures and routines to emulate the root hub.
- */
-usb_device_descriptor_t uhci_devd = {
- USB_DEVICE_DESCRIPTOR_SIZE,
- UDESC_DEVICE, /* type */
- {0x00, 0x01}, /* USB version */
- UCLASS_HUB, /* class */
- USUBCLASS_HUB, /* subclass */
- 0, /* protocol */
- 64, /* max packet */
- {0},{0},{0x00,0x01}, /* device id */
- 1,2,0, /* string indicies */
- 1 /* # of configurations */
-};
-
-usb_config_descriptor_t uhci_confd = {
- USB_CONFIG_DESCRIPTOR_SIZE,
- UDESC_CONFIG,
- {USB_CONFIG_DESCRIPTOR_SIZE +
- USB_INTERFACE_DESCRIPTOR_SIZE +
- USB_ENDPOINT_DESCRIPTOR_SIZE},
- 1,
- 1,
- 0,
- UC_SELF_POWERED,
- 0 /* max power */
-};
-
-usb_interface_descriptor_t uhci_ifcd = {
- USB_INTERFACE_DESCRIPTOR_SIZE,
- UDESC_INTERFACE,
- 0,
- 0,
- 1,
- UCLASS_HUB,
- USUBCLASS_HUB,
- 0,
- 0
-};
-
-usb_endpoint_descriptor_t uhci_endpd = {
- USB_ENDPOINT_DESCRIPTOR_SIZE,
- UDESC_ENDPOINT,
- UE_IN | UHCI_INTR_ENDPT,
- UE_INTERRUPT,
- {8},
- 255
-};
-
-usb_hub_descriptor_t uhci_hubd_piix = {
- USB_HUB_DESCRIPTOR_SIZE,
- UDESC_HUB,
- 2,
- { UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0 },
- 50, /* power on to power good */
- 0,
- { 0x00 }, /* both ports are removable */
-};
-
-int
-uhci_str(p, l, s)
- usb_string_descriptor_t *p;
- int l;
- char *s;
-{
- int i;
-
- if (l == 0)
- return (0);
- p->bLength = 2 * strlen(s) + 2;
- if (l == 1)
- return (1);
- p->bDescriptorType = UDESC_STRING;
- l -= 2;
- for (i = 0; s[i] && l > 1; i++, l -= 2)
- USETW2(p->bString[i], 0, s[i]);
- return (2*i+2);
-}
-
-/*
- * Simulate a hardware hub by handling all the necessary requests.
- */
-usbd_status
-uhci_root_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_root_ctrl_start(reqh));
-}
-
-usbd_status
-uhci_root_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- uhci_softc_t *sc = (uhci_softc_t *)reqh->pipe->device->bus;
- usb_device_request_t *req;
- void *buf;
- int port, x;
- int len, value, index, status, change, l, totlen = 0;
- usb_port_status_t ps;
- usbd_status r;
-
- if (!reqh->isreq)
- panic("uhci_root_ctrl_transfer: not a request\n");
- req = &reqh->request;
- buf = reqh->buffer;
-
- DPRINTFN(2,("uhci_root_ctrl_control type=0x%02x request=%02x\n",
- req->bmRequestType, req->bRequest));
-
- len = UGETW(req->wLength);
- value = UGETW(req->wValue);
- index = UGETW(req->wIndex);
-#define C(x,y) ((x) | ((y) << 8))
- switch(C(req->bRequest, req->bmRequestType)) {
- case C(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
- /*
- * DEVICE_REMOTE_WAKEUP and ENDPOINT_HALT are no-ops
- * for the integrated root hub.
- */
- break;
- case C(UR_GET_CONFIG, UT_READ_DEVICE):
- if (len > 0) {
- *(u_int8_t *)buf = sc->sc_conf;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
- DPRINTFN(2,("uhci_root_ctrl_control wValue=0x%04x\n", value));
- switch(value >> 8) {
- case UDESC_DEVICE:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_DEVICE_DESCRIPTOR_SIZE);
- memcpy(buf, &uhci_devd, l);
- break;
- case UDESC_CONFIG:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_CONFIG_DESCRIPTOR_SIZE);
- memcpy(buf, &uhci_confd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_INTERFACE_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &uhci_ifcd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &uhci_endpd, l);
- break;
- case UDESC_STRING:
- if (len == 0)
- break;
- *(u_int8_t *)buf = 0;
- totlen = 1;
- switch (value & 0xff) {
- case 1: /* Vendor */
- totlen = uhci_str(buf, len, sc->sc_vendor);
- break;
- case 2: /* Product */
- totlen = uhci_str(buf, len, "UHCI root hub");
- break;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_INTERFACE, UT_READ_INTERFACE):
- if (len > 0) {
- *(u_int8_t *)buf = 0;
- totlen = 1;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_DEVICE):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus,UDS_SELF_POWERED);
- totlen = 2;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_INTERFACE):
- case C(UR_GET_STATUS, UT_READ_ENDPOINT):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus, 0);
- totlen = 2;
- }
- break;
- case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
- if (value >= USB_MAX_DEVICES) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_addr = value;
- break;
- case C(UR_SET_CONFIG, UT_WRITE_DEVICE):
- if (value != 0 && value != 1) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_conf = value;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_DEVICE):
- case C(UR_SET_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
- break;
- case C(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
- break;
- /* Hub requests */
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER):
- DPRINTFN(3, ("uhci_root_ctrl_control: UR_CLEAR_PORT_FEATURE "
- "port=%d feature=%d\n",
- index, value));
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PE);
- break;
- case UHF_PORT_SUSPEND:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_SUSP);
- break;
- case UHF_PORT_RESET:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PR);
- break;
- case UHF_C_PORT_CONNECTION:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_CSC);
- break;
- case UHF_C_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_POEDC);
- break;
- case UHF_C_PORT_OVER_CURRENT:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_OCIC);
- break;
- case UHF_C_PORT_RESET:
- sc->sc_isreset = 0;
- r = USBD_NORMAL_COMPLETION;
- goto ret;
- case UHF_PORT_CONNECTION:
- case UHF_PORT_OVER_CURRENT:
- case UHF_PORT_POWER:
- case UHF_PORT_LOW_SPEED:
- case UHF_C_PORT_SUSPEND:
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_BUS_STATE, UT_READ_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len > 0) {
- *(u_int8_t *)buf =
- (UREAD2(sc, port) & UHCI_PORTSC_LS) >>
- UHCI_PORTSC_LS_SHIFT;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- l = min(len, USB_HUB_DESCRIPTOR_SIZE);
- totlen = l;
- memcpy(buf, &uhci_hubd_piix, l);
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- memset(buf, 0, len);
- totlen = len;
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- x = UREAD2(sc, port);
- status = change = 0;
- if (x & UHCI_PORTSC_CCS )
- status |= UPS_CURRENT_CONNECT_STATUS;
- if (x & UHCI_PORTSC_CSC )
- change |= UPS_C_CONNECT_STATUS;
- if (x & UHCI_PORTSC_PE )
- status |= UPS_PORT_ENABLED;
- if (x & UHCI_PORTSC_POEDC)
- change |= UPS_C_PORT_ENABLED;
- if (x & UHCI_PORTSC_OCI )
- status |= UPS_OVERCURRENT_INDICATOR;
- if (x & UHCI_PORTSC_OCIC )
- change |= UPS_C_OVERCURRENT_INDICATOR;
- if (x & UHCI_PORTSC_SUSP )
- status |= UPS_SUSPEND;
- if (x & UHCI_PORTSC_LSDA )
- status |= UPS_LOW_SPEED;
- status |= UPS_PORT_POWER;
- if (sc->sc_isreset)
- change |= UPS_C_PORT_RESET;
- USETW(ps.wPortStatus, status);
- USETW(ps.wPortChange, change);
- l = min(len, sizeof ps);
- memcpy(buf, &ps, l);
- totlen = l;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_CLASS_DEVICE):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PE);
- break;
- case UHF_PORT_SUSPEND:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_SUSP);
- break;
- case UHF_PORT_RESET:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PR);
- usb_delay_ms(&sc->sc_bus, 10);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PR);
- delay(100);
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PE);
- delay(100);
- DPRINTFN(3,("uhci port %d reset, status = 0x%04x\n",
- index, UREAD2(sc, port)));
- sc->sc_isreset = 1;
- break;
- case UHF_C_PORT_CONNECTION:
- case UHF_C_PORT_ENABLE:
- case UHF_C_PORT_OVER_CURRENT:
- case UHF_PORT_CONNECTION:
- case UHF_PORT_OVER_CURRENT:
- case UHF_PORT_POWER:
- case UHF_PORT_LOW_SPEED:
- case UHF_C_PORT_SUSPEND:
- case UHF_C_PORT_RESET:
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- reqh->actlen = totlen;
- r = USBD_NORMAL_COMPLETION;
- ret:
- reqh->status = r;
- reqh->xfercb(reqh);
- usb_start_next(reqh->pipe);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root control request. */
-void
-uhci_root_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* Nothing to do, all transfers are syncronous. */
-}
-
-/* Close the root pipe. */
-void
-uhci_root_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- usb_untimeout(uhci_timo, pipe->intrreqh, pipe->intrreqh->timo_handle);
- DPRINTF(("uhci_root_ctrl_close\n"));
-}
-
-/* Abort a root interrupt request. */
-void
-uhci_root_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- usb_untimeout(uhci_timo, reqh, reqh->timo_handle);
-}
-
-usbd_status
-uhci_root_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_root_intr_start(reqh));
-}
-
-/* Start a transfer on the root interrupt pipe */
-usbd_status
-uhci_root_intr_start(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
-
- DPRINTFN(3, ("uhci_root_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- sc->sc_ival = MS_TO_TICKS(reqh->pipe->endpoint->edesc->bInterval);
- usb_timeout(uhci_timo, reqh, sc->sc_ival, reqh->timo_handle);
- return (USBD_IN_PROGRESS);
-}
-
-/* Close the root interrupt pipe. */
-void
-uhci_root_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- usb_untimeout(uhci_timo, pipe->intrreqh, pipe->intrreqh->timo_handle);
- DPRINTF(("uhci_root_intr_close\n"));
-}
diff --git a/sys/dev/usb/uhcireg.h b/sys/dev/usb/uhcireg.h
deleted file mode 100644
index 9c8ef008b2b7..000000000000
--- a/sys/dev/usb/uhcireg.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* $NetBSD: uhcireg.h,v 1.5 1998/12/27 23:40:52 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 _DEV_PCI_UHCIREG_H_
-#define _DEV_PCI_UHCIREG_H_
-
-/*** PCI config registers ***/
-
-#define PCI_USBREV 0x60 /* USB protocol revision */
-#define PCI_USBREV_MASK 0xff
-#define PCI_USBREV_PRE_1_0 0x00
-#define PCI_USBREV_1_0 0x10
-
-#define PCI_CBIO 0x20 /* configuration base IO */
-
-#define PCI_INTERFACE_UHCI 0x00
-
-/*** UHCI registers ***/
-
-#define UHCI_CMD 0x00
-#define UHCI_CMD_RS 0x0001
-#define UHCI_CMD_HCRESET 0x0002
-#define UHCI_CMD_GRESET 0x0004
-#define UHCI_CMD_EGSM 0x0008
-#define UHCI_CMD_FGR 0x0010
-#define UHCI_CMD_SWDBG 0x0020
-#define UHCI_CMD_CF 0x0040
-#define UHCI_CMD_MAXP 0x0080
-
-#define UHCI_STS 0x02
-#define UHCI_STS_USBINT 0x0001
-#define UHCI_STS_USBEI 0x0002
-#define UHCI_STS_RD 0x0004
-#define UHCI_STS_HSE 0x0008
-#define UHCI_STS_HCPE 0x0010
-#define UHCI_STS_HCH 0x0020
-
-#define UHCI_INTR 0x04
-#define UHCI_INTR_TOCRCIE 0x0001
-#define UHCI_INTR_RIE 0x0002
-#define UHCI_INTR_IOCE 0x0004
-#define UHCI_INTR_SPIE 0x0008
-
-#define UHCI_FRNUM 0x06
-#define UHCI_FRNUM_MASK 0x03ff
-
-
-#define UHCI_FLBASEADDR 0x08
-
-#define UHCI_SOF 0x0c
-#define UHCI_SOF_MASK 0x7f
-
-#define UHCI_PORTSC1 0x010
-#define UHCI_PORTSC2 0x012
-#define UHCI_PORTSC_CCS 0x0001
-#define UHCI_PORTSC_CSC 0x0002
-#define UHCI_PORTSC_PE 0x0004
-#define UHCI_PORTSC_POEDC 0x0008
-#define UHCI_PORTSC_LS 0x0030
-#define UHCI_PORTSC_LS_SHIFT 4
-#define UHCI_PORTSC_RD 0x0040
-#define UHCI_PORTSC_LSDA 0x0100
-#define UHCI_PORTSC_PR 0x0200
-#define UHCI_PORTSC_OCI 0x0400
-#define UHCI_PORTSC_OCIC 0x0800
-#define UHCI_PORTSC_SUSP 0x1000
-
-#define UHCI_FRAMELIST_COUNT 1024
-#define UHCI_FRAMELIST_ALIGN 4096
-
-#define UHCI_TD_ALIGN 16
-#define UHCI_QH_ALIGN 16
-
-typedef u_int32_t uhci_physaddr_t;
-#define UHCI_PTR_T 0x00000001
-#define UHCI_PTR_Q 0x00000002
-#define UHCI_PTR_VF 0x00000004
-
-typedef union {
- struct uhci_soft_qh *sqh;
- struct uhci_soft_td *std;
-} uhci_soft_td_qh_t;
-
-/*
- * The Queue Heads and Transfer Descriptors and accessed
- * by both the CPU and the USB controller which runs
- * concurrently. This means that they have to be accessed
- * with great care. As long as the data structures are
- * not linked into the controller's frame list they cannot
- * be accessed by it and anything goes. As soon as a
- * TD is accessible by the controller it "owns" the td_status
- * field; it will not be written by the CPU. Similarly
- * the controller "owns" the qh_elink field.
- */
-
-typedef struct {
- uhci_physaddr_t td_link;
- u_int32_t td_status;
-#define UHCI_TD_GET_ACTLEN(s) (((s) + 1) & 0x3ff)
-#define UHCI_TD_ZERO_ACTLEN(t) ((t) | 0x3ff)
-#define UHCI_TD_BITSTUFF 0x00020000
-#define UHCI_TD_CRCTO 0x00040000
-#define UHCI_TD_NAK 0x00080000
-#define UHCI_TD_BABBLE 0x00100000
-#define UHCI_TD_DBUFFER 0x00200000
-#define UHCI_TD_STALLED 0x00400000
-#define UHCI_TD_ACTIVE 0x00800000
-#define UHCI_TD_IOC 0x01000000
-#define UHCI_TD_IOS 0x02000000
-#define UHCI_TD_LS 0x04000000
-#define UHCI_TD_GET_ERRCNT(s) (((s) >> 27) & 3)
-#define UHCI_TD_SET_ERRCNT(n) ((n) << 27)
-#define UHCI_TD_SPD 0x20000000
- u_int32_t td_token;
-#define UHCI_TD_PID_IN 0x00000069
-#define UHCI_TD_PID_OUT 0x000000e1
-#define UHCI_TD_PID_SETUP 0x0000002d
-#define UHCI_TD_GET_PID(s) ((s) & 0xff)
-#define UHCI_TD_SET_DEVADDR(a) ((a) << 8)
-#define UHCI_TD_GET_DEVADDR(s) (((s) >> 8) & 0x7f)
-#define UHCI_TD_SET_ENDPT(e) (((e)&0xf) << 15)
-#define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf)
-#define UHCI_TD_SET_DT(t) ((t) << 19)
-#define UHCI_TD_GET_DT(s) (((s) >> 19) & 1)
-#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21)
-#define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff)
-#define UHCI_TD_MAXLEN_MASK 0xffe00000
- u_int32_t td_buffer;
- uhci_soft_td_qh_t link; /* soft version of the td_link field */
- /* padding to 32 bytes */
-} uhci_td_t;
-#define UHCI_TD_SIZE 32
-
-#define UHCI_TD_ERROR (UHCI_TD_BITSTUFF|UHCI_TD_CRCTO|UHCI_TD_BABBLE|UHCI_TD_DBUFFER|UHCI_TD_STALLED)
-
-#define UHCI_TD_SETUP(len, endp, dev) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | UHCI_TD_PID_SETUP)
-#define UHCI_TD_OUT(len, endp, dev, dt) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | \
- UHCI_TD_PID_OUT | UHCI_TD_SET_DT(dt))
-#define UHCI_TD_IN(len, endp, dev, dt) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | UHCI_TD_PID_IN | \
- UHCI_TD_SET_DT(dt))
-
-typedef struct {
- uhci_physaddr_t qh_hlink;
- uhci_physaddr_t qh_elink;
- struct uhci_soft_qh *hlink; /* soft version of qh_hlink */
- struct uhci_soft_td *elink; /* soft version of qh_elink */
- /* padding to 32 bytes */
-} uhci_qh_t;
-#define UHCI_QH_SIZE 32
-
-#endif /* _DEV_PCI_UHCIREG_H_ */
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
deleted file mode 100644
index 7143c42fbf0d..000000000000
--- a/sys/dev/usb/uhcivar.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* $NetBSD: uhcivar.h,v 1.5 1998/12/26 12:53:02 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * To avoid having 1024 TDs for each isochronous transfer we introduce
- * a virtual frame list. Every UHCI_VFRAMELIST_COUNT entries in the real
- * frame list points to a non-active TD. These, in turn, which form the
- * starts of the virtual frame list. This also has the advantage that it
- * simplifies linking in/out TD/QH in the schedule.
- * Furthermore, initially each of the inactive TDs point to an inactive
- * QH that forms the start of the interrupt traffic for that slot.
- * Each of these QHs point to the same QH that is the start of control
- * traffic.
- *
- * UHCI_VFRAMELIST_COUNT should be a power of 2 and <= UHCI_FRAMELIST_COUNT.
- */
-#define UHCI_VFRAMELIST_COUNT 128
-
-typedef struct uhci_soft_qh uhci_soft_qh_t;
-typedef struct uhci_soft_td uhci_soft_td_t;
-
-/*
- * An interrupt info struct contains the information needed to
- * execute a requested routine when the controller generates an
- * interrupt. Since we cannot know which transfer generated
- * the interrupt all structs are linked together so they can be
- * searched at interrupt time.
- */
-typedef struct uhci_intr_info {
- struct uhci_softc *sc;
- usbd_request_handle reqh;
- uhci_soft_td_t *stdstart;
- uhci_soft_td_t *stdend;
- LIST_ENTRY(uhci_intr_info) list;
-#if defined(__FreeBSD__)
- struct callout_handle timeout_handle;
-#endif /* defined(__FreeBSD__) */
-#ifdef DIAGNOSTIC
- int isdone;
-#endif
-} uhci_intr_info_t;
-
-/*
- * Extra information that we need for a TD.
- */
-struct uhci_soft_td {
- uhci_td_t *td; /* The real TD */
- uhci_physaddr_t physaddr; /* and its physical address. */
-};
-#define UHCI_TD_CHUNK 128 /*(PAGE_SIZE / UHCI_TD_SIZE)*/
-
-/*
- * Extra information that we need for a QH.
- */
-struct uhci_soft_qh {
- uhci_qh_t *qh; /* The real QH */
- uhci_physaddr_t physaddr; /* and its physical address. */
- int pos; /* Timeslot position */
- uhci_intr_info_t *intr_info; /* Who to call on completion. */
-};
-#define UHCI_QH_CHUNK 128 /*(PAGE_SIZE / UHCI_QH_SIZE)*/
-
-/* Only used for buffer free list. */
-struct uhci_buffer {
- struct uhci_buffer *next;
-};
-#define UHCI_BUFFER_SIZE 64
-#define UHCI_BUFFER_CHUNK 64 /*(PAGE_SIZE / UHCI_BUFFER_SIZE)*/
-
-/*
- * Information about an entry in the virtial frame list.
- */
-struct uhci_vframe {
- uhci_soft_td_t *htd; /* pointer to dummy TD */
- uhci_soft_td_t *etd; /* pointer to last TD */
- uhci_soft_qh_t *hqh; /* pointer to dummy QH */
- uhci_soft_qh_t *eqh; /* pointer to last QH */
- u_int bandwidth; /* max bandwidth used by this frame */
-};
-
-typedef struct uhci_softc {
- struct usbd_bus sc_bus; /* base device */
-#if defined(__NetBSD__)
- void *sc_ih; /* interrupt vectoring */
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
-
- bus_dma_tag_t sc_dmatag; /* DMA tag */
- /* XXX should keep track of all DMA memory */
-#elif defined(__FreeBSD__)
- int sc_iobase;
- int unit;
-#endif /* defined(__FreeBSD__) */
-
- uhci_physaddr_t *sc_pframes;
- struct uhci_vframe sc_vframes[UHCI_VFRAMELIST_COUNT];
-
- uhci_soft_qh_t *sc_ctl_start; /* dummy QH for control */
- uhci_soft_qh_t *sc_ctl_end; /* last control QH */
- uhci_soft_qh_t *sc_bulk_start; /* dummy QH for bulk */
- uhci_soft_qh_t *sc_bulk_end; /* last bulk transfer */
-
- uhci_soft_td_t *sc_freetds;
- uhci_soft_qh_t *sc_freeqhs;
- struct uhci_buffer *sc_freebuffers;
-
- u_int8_t sc_addr; /* device address */
- u_int8_t sc_conf; /* device configuration */
-
- char sc_isreset;
-
- int sc_intrs;
- LIST_HEAD(, uhci_intr_info) sc_intrhead;
-
- /* Info for the root hub interrupt channel. */
- int sc_ival;
-
- char sc_vflock;
-#define UHCI_HAS_LOCK 1
-#define UHCI_WANT_LOCK 2
-
-#if defined(__NetBSD__)
- usb_dma_t *sc_mallocs;
-#endif
-
- char sc_vendor[16];
-} uhci_softc_t;
-
-usbd_status uhci_init __P((uhci_softc_t *));
-int uhci_intr __P((void *));
-#if 0
-void uhci_reset __P((void *));
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (uhcidebug) printf x
-#define DPRINTFN(n,x) if (uhcidebug>(n)) printf x
-extern int uhcidebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
deleted file mode 100644
index 26c0e5b5b20f..000000000000
--- a/sys/dev/usb/uhid.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/* $NetBSD: uhid.c,v 1.14 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/filio.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/hid.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (uhiddebug) printf x
-#define DPRINTFN(n,x) if (uhiddebug>(n)) printf x
-int uhiddebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct uhid_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- int sc_isize;
- int sc_osize;
- int sc_fsize;
- u_int8_t sc_iid;
- u_int8_t sc_oid;
- u_int8_t sc_fid;
-
- char *sc_ibuf;
- char *sc_obuf;
-
- void *sc_repdesc;
- int sc_repdesc_size;
-
- struct clist sc_q;
- struct selinfo sc_rsel;
- u_char sc_state; /* driver state */
-#define UHID_OPEN 0x01 /* device is open */
-#define UHID_ASLP 0x02 /* waiting for device data */
-#define UHID_NEEDCLEAR 0x04 /* needs clearing endpoint stall */
-#define UHID_IMMED 0x08 /* return read data immediately */
- int sc_disconnected; /* device is gone */
-};
-
-#define UHIDUNIT(dev) (minor(dev))
-#define UHID_CHUNK 128 /* chunk size for read */
-#define UHID_BSIZE 1020 /* buffer size */
-
-int uhidopen __P((dev_t, int, int, struct proc *));
-int uhidclose __P((dev_t, int, int, struct proc *p));
-int uhidread __P((dev_t, struct uio *uio, int));
-int uhidwrite __P((dev_t, struct uio *uio, int));
-int uhidioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int uhidpoll __P((dev_t, int, struct proc *));
-void uhid_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void uhid_disco __P((void *));
-
-USB_DECLARE_DRIVER(uhid);
-
-USB_MATCH(uhid)
-{
- USB_MATCH_START(uhid, uaa);
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id || id->bInterfaceClass != UCLASS_HID)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_GENERIC);
-}
-
-USB_ATTACH(uhid)
-{
- USB_ATTACH_START(uhid, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
- int size;
- void *desc;
- usbd_status r;
- char devinfo[1024];
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("uhid_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USB);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- (void)usbd_set_idle(iface, 0, 0);
-
- sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
- sc->sc_osize = hid_report_size(desc, size, hid_output, &sc->sc_oid);
- sc->sc_fsize = hid_report_size(desc, size, hid_feature, &sc->sc_fid);
-
- sc->sc_repdesc = desc;
- sc->sc_repdesc_size = size;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-uhid_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-#endif
-
-void
-uhid_disco(p)
- void *p;
-{
- struct uhid_softc *sc = p;
-
- DPRINTF(("ums_hid: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-void
-uhid_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct uhid_softc *sc = addr;
-
- DPRINTFN(5, ("uhid_intr: status=%d\n", status));
- DPRINTFN(5, ("uhid_intr: data = %02x %02x %02x\n",
- sc->sc_ibuf[0], sc->sc_ibuf[1], sc->sc_ibuf[2]));
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhid_intr: status=%d\n", status));
- sc->sc_state |= UHID_NEEDCLEAR;
- return;
- }
-
- (void) b_to_q(sc->sc_ibuf, sc->sc_isize, &sc->sc_q);
-
- if (sc->sc_state & UHID_ASLP) {
- sc->sc_state &= ~UHID_ASLP;
- DPRINTFN(5, ("uhid_intr: waking %p\n", sc));
- wakeup((caddr_t)sc);
- }
- selwakeup(&sc->sc_rsel);
-}
-
-int
-uhidopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- usbd_status r;
- USB_GET_SC_OPEN(uhid, UHIDUNIT(dev), sc);
-
- if (!sc)
- return (ENXIO);
-
- DPRINTF(("uhidopen: sc=%p, disco=%d\n", sc, sc->sc_disconnected));
-
- if (sc->sc_disconnected)
- return (EIO);
-
- if (sc->sc_state & UHID_OPEN)
- return (EBUSY);
-
-#if defined(__NetBSD__)
- if (clalloc(&sc->sc_q, UHID_BSIZE, 0) == -1)
- return (ENOMEM);
-#elif defined(__FreeBSD__)
- clist_alloc_cblocks(&sc->sc_q, UHID_BSIZE, 0);
-#endif
-
- sc->sc_state |= UHID_OPEN;
- sc->sc_state &= ~UHID_IMMED;
-
- sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_WAITOK);
- sc->sc_obuf = malloc(sc->sc_osize, M_USB, M_WAITOK);
-
- /* Set up interrupt pipe. */
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK,
- &sc->sc_intrpipe, sc, sc->sc_ibuf,
- sc->sc_isize, uhid_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhidopen: usbd_open_pipe_intr failed, "
- "error=%d\n",r));
- sc->sc_state &= ~UHID_OPEN;
- return (EIO);
- }
- usbd_set_disco(sc->sc_intrpipe, uhid_disco, sc);
-
- return (0);
-}
-
-int
-uhidclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTF(("uhidclose: sc=%p\n", sc));
-
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_state &= ~UHID_OPEN;
-
-#if defined(__NetBSD__)
- clfree(&sc->sc_q);
-#elif defined(__FreeBSD__)
- clist_free_cblocks(&sc->sc_q);
-#endif
-
- free(sc->sc_ibuf, M_USB);
- free(sc->sc_obuf, M_USB);
-
- return (0);
-}
-
-int
-uhidread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- int s;
- int error = 0;
- size_t length;
- u_char buffer[UHID_CHUNK];
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(1, ("uhidread\n"));
- if (sc->sc_state & UHID_IMMED) {
- DPRINTFN(1, ("uhidread immed\n"));
-
- r = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
- sc->sc_iid, sc->sc_ibuf, sc->sc_isize);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- return (uiomove(buffer, sc->sc_isize, uio));
- }
-
- s = splusb();
- while (sc->sc_q.c_cc == 0) {
- if (flag & IO_NDELAY) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->sc_state |= UHID_ASLP;
- DPRINTFN(5, ("uhidread: sleep on %p\n", sc));
- error = tsleep((caddr_t)sc, PZERO | PCATCH, "uhidrea", 0);
- DPRINTFN(5, ("uhidread: woke, error=%d\n", error));
- if (error) {
- sc->sc_state &= ~UHID_ASLP;
- splx(s);
- return (error);
- }
- if (sc->sc_state & UHID_NEEDCLEAR) {
- DPRINTFN(-1,("uhidread: clearing stall\n"));
- sc->sc_state &= ~UHID_NEEDCLEAR;
- usbd_clear_endpoint_stall(sc->sc_intrpipe);
- }
- }
- splx(s);
-
- /* Transfer as many chunks as possible. */
- while (sc->sc_q.c_cc > 0 && uio->uio_resid > 0) {
- length = min(sc->sc_q.c_cc, uio->uio_resid);
- if (length > sizeof(buffer))
- length = sizeof(buffer);
-
- /* Remove a small chunk from the input queue. */
- (void) q_to_b(&sc->sc_q, buffer, length);
- DPRINTFN(5, ("uhidread: got %d chars\n", length));
-
- /* Copy the data to the user process. */
- if ((error = uiomove(buffer, length, uio)) != 0)
- break;
- }
-
- return (error);
-}
-
-int
-uhidwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- int error;
- int size;
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(1, ("uhidwrite\n"));
-
- size = sc->sc_osize;
- error = 0;
- while (uio->uio_resid > 0) {
- if (uio->uio_resid != size)
- return (0);
- if ((error = uiomove(sc->sc_obuf, size, uio)) != 0)
- break;
- if (sc->sc_oid)
- r = usbd_set_report(sc->sc_iface, UHID_OUTPUT_REPORT,
- sc->sc_obuf[0],
- sc->sc_obuf+1, size-1);
- else
- r = usbd_set_report(sc->sc_iface, UHID_OUTPUT_REPORT,
- 0, sc->sc_obuf, size);
- if (r != USBD_NORMAL_COMPLETION) {
- error = EIO;
- break;
- }
- }
- return (error);
-}
-
-int
-uhidioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
-{
- struct usb_ctl_report_desc *rd;
- struct usb_ctl_report *re;
- int size, id;
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(2, ("uhidioctl: cmd=%lx\n", cmd));
- switch (cmd) {
- case FIONBIO:
- /* All handled in the upper FS layer. */
- break;
-
- case USB_GET_REPORT_DESC:
- rd = (struct usb_ctl_report_desc *)addr;
- size = min(sc->sc_repdesc_size, sizeof rd->data);
- rd->size = size;
- memcpy(rd->data, sc->sc_repdesc, size);
- break;
-
- case USB_SET_IMMED:
- if (*(int *)addr) {
- /* XXX should read into ibuf, but does it matter */
- r = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
- sc->sc_iid, sc->sc_ibuf,
- sc->sc_isize);
- if (r != USBD_NORMAL_COMPLETION)
- return (EOPNOTSUPP);
-
- sc->sc_state |= UHID_IMMED;
- } else
- sc->sc_state &= ~UHID_IMMED;
- break;
-
- case USB_GET_REPORT:
- re = (struct usb_ctl_report *)addr;
- switch (re->report) {
- case UHID_INPUT_REPORT:
- size = sc->sc_isize;
- id = sc->sc_iid;
- break;
- case UHID_OUTPUT_REPORT:
- size = sc->sc_osize;
- id = sc->sc_oid;
- break;
- case UHID_FEATURE_REPORT:
- size = sc->sc_fsize;
- id = sc->sc_fid;
- break;
- default:
- return (EINVAL);
- }
- r = usbd_get_report(sc->sc_iface, re->report, id,
- re->data, size);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
-
- default:
- return (EINVAL);
- }
- return (0);
-}
-
-int
-uhidpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- int revents = 0;
- int s;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- s = splusb();
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->sc_q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->sc_rsel);
- }
-
- splx(s);
- return (revents);
-}
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
deleted file mode 100644
index 40ff36317add..000000000000
--- a/sys/dev/usb/uhub.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/* $NetBSD: uhub.c,v 1.14 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-extern char *usbd_error_strs[];
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct uhub_softc {
- bdevice sc_dev; /* base device */
- usbd_device_handle sc_hub; /* USB device */
- usbd_pipe_handle sc_ipipe; /* interrupt pipe */
- u_int8_t sc_status[1]; /* XXX more ports */
- u_char sc_running;
-};
-
-usbd_status uhub_init_port __P((struct usbd_port *));
-void uhub_disconnect __P((struct usbd_port *up));
-usbd_status uhub_explore __P((usbd_device_handle hub));
-void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-
-/*void uhub_disco __P((void *));*/
-
-USB_DECLARE_DRIVER(uhub);
-
-#if defined(__FreeBSD__)
-devclass_t uhubroot_devclass;
-
-static device_method_t uhubroot_methods[] = {
- DEVMETHOD(device_probe, uhub_match),
- DEVMETHOD(device_attach, uhub_attach),
- /* detach is not allowed for a root hub */
- {0,0}
-};
-
-static driver_t uhubroot_driver = {
- "uhub",
- uhubroot_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct uhub_softc)
-};
-#endif
-
-#if defined(__NetBSD__)
-struct cfattach uhub_uhub_ca = {
- sizeof(struct uhub_softc), uhub_match, uhub_attach
-};
-#endif
-
-USB_MATCH(uhub)
-{
- USB_MATCH_START(uhub, uaa);
- usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device);
-
- DPRINTFN(5,("uhub_match, dd=%p\n", dd));
- /*
- * The subclass for hubs seems to be 0 for some and 1 for others,
- * so we just ignore the subclass.
- */
- if (uaa->iface == 0 && dd->bDeviceClass == UCLASS_HUB)
- return (UMATCH_DEVCLASS_DEVSUBCLASS);
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(uhub)
-{
- USB_ATTACH_START(uhub, sc, uaa);
- usbd_device_handle dev = uaa->device;
- char devinfo[1024];
- usbd_status r;
- struct usbd_hub *hub;
- usb_device_request_t req;
- usb_hub_descriptor_t hubdesc;
- int p, port, nports, nremov;
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
-
- DPRINTFN(1,("uhub_attach\n"));
- sc->sc_hub = dev;
- usbd_devinfo(dev, 1, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
-
- r = usbd_set_config_index(dev, 0, 1);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("%s: configuration failed, error=%d(%s)\n",
- USBDEVNAME(sc->sc_dev), r, usbd_error_strs[r]));
- USB_ATTACH_ERROR_RETURN;
- }
-
- if (dev->depth > USB_HUB_MAX_DEPTH) {
- printf("%s: hub depth (%d) exceeded, hub ignored\n",
- USBDEVNAME(sc->sc_dev), USB_HUB_MAX_DEPTH);
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Get hub descriptor. */
- req.bmRequestType = UT_READ_CLASS_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE);
- DPRINTFN(1,("usb_init_hub: getting hub descriptor\n"));
- r = usbd_do_request(dev, &req, &hubdesc);
- nports = hubdesc.bNbrPorts;
- if (r == USBD_NORMAL_COMPLETION && nports > 7) {
- USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE + (nports+1) / 8);
- r = usbd_do_request(dev, &req, &hubdesc);
- }
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("%s: getting hub descriptor failed, error=%d(%s)\n",
- USBDEVNAME(sc->sc_dev), r, usbd_error_strs[r]));
- USB_ATTACH_ERROR_RETURN;
- }
-
- for (nremov = 0, port = 1; port <= nports; port++)
- if (!UHD_NOT_REMOV(&hubdesc, port))
- nremov++;
- printf("%s: %d port%s with %d removable, %s powered\n",
- USBDEVNAME(sc->sc_dev), nports, nports != 1 ? "s" : "",
- nremov, dev->self_powered ? "self" : "bus");
-
-
- hub = malloc(sizeof(*hub) + (nports-1) * sizeof(struct usbd_port),
- M_USB, M_NOWAIT);
- if (hub == 0)
- USB_ATTACH_ERROR_RETURN;
- dev->hub = hub;
- dev->hub->hubsoftc = sc;
- hub->explore = uhub_explore;
- hub->hubdesc = hubdesc;
-
- DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, "
- "parent->selfpowered=%d\n",
- dev->self_powered, dev->powersrc->parent,
- dev->powersrc->parent ?
- dev->powersrc->parent->self_powered : 0));
- if (!dev->self_powered && dev->powersrc->parent &&
- !dev->powersrc->parent->self_powered) {
- printf("%s: bus powered hub connected to bus powered hub, "
- "ignored\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Set up interrupt pipe. */
- r = usbd_device2interface_handle(dev, 0, &iface);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: no interface handle\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (ed == 0) {
- printf("%s: no endpoint descriptor\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: bad interrupt endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- r = usbd_open_pipe_intr(iface, ed->bEndpointAddress,USBD_SHORT_XFER_OK,
- &sc->sc_ipipe, sc, sc->sc_status,
- sizeof(sc->sc_status),
- uhub_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: cannot open interrupt pipe\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Wait with power off for a while. */
- usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
-
- for (p = 0; p < nports; p++) {
- struct usbd_port *up = &hub->ports[p];
- up->device = 0;
- up->parent = dev;
- up->portno = p+1;
- r = uhub_init_port(up);
- if (r != USBD_NORMAL_COMPLETION)
- printf("%s: init of port %d failed\n",
- USBDEVNAME(sc->sc_dev), up->portno);
- }
- sc->sc_running = 1;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-uhub_detach(device_t self)
-{
- struct uhub_softc *sc = device_get_softc(self);
- int nports = sc->sc_hub->hub->hubdesc.bNbrPorts;
- int p;
-
- for (p = 0; p < nports; p++) {
- struct usbd_port *up = &sc->sc_hub->hub->ports[p];
- if (up->device)
- uhub_disconnect(up);
- }
-
- free(sc->sc_hub->hub, M_USB);
-
- return 0;
-}
-#endif
-
-usbd_status
-uhub_init_port(up)
- struct usbd_port *up;
-{
- int port = up->portno;
- usbd_device_handle dev = up->parent;
- usbd_status r;
- u_int16_t pstatus;
-
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- pstatus = UGETW(up->status.wPortStatus);
- DPRINTF(("usbd_init_port: adding hub port=%d status=0x%04x "
- "change=0x%04x\n",
- port, pstatus, UGETW(up->status.wPortChange)));
- if ((pstatus & UPS_PORT_POWER) == 0) {
- /* Port lacks power, turn it on */
-
- /* First let the device go through a good power cycle, */
- usbd_delay_ms(dev, USB_PORT_POWER_DOWN_TIME);
-
- /* then turn the power on. */
- r = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- DPRINTF(("usb_init_port: turn on port %d power status=0x%04x "
- "change=0x%04x\n",
- port, UGETW(up->status.wPortStatus),
- UGETW(up->status.wPortChange)));
- /* Wait for stable power. */
- usbd_delay_ms(dev, dev->hub->hubdesc.bPwrOn2PwrGood *
- UHD_PWRON_FACTOR);
- }
- if (dev->self_powered)
- /* Self powered hub, give ports maximum current. */
- up->power = USB_MAX_POWER;
- else
- up->power = USB_MIN_POWER;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-uhub_explore(dev)
- usbd_device_handle dev;
-{
- usb_hub_descriptor_t *hd = &dev->hub->hubdesc;
- struct uhub_softc *sc = dev->hub->hubsoftc;
- struct usbd_port *up;
- usbd_status r;
- int port;
- int change, status;
-
- DPRINTFN(10, ("uhub_explore dev=%p addr=%d\n", dev, dev->address));
-
- if (!sc->sc_running)
- return (USBD_NOT_STARTED);
-
- /* Ignore hubs that are too deep. */
- if (dev->depth > USB_HUB_MAX_DEPTH)
- return (USBD_TOO_DEEP);
-
- for(port = 1; port <= hd->bNbrPorts; port++) {
- up = &dev->hub->ports[port-1];
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhub_explore: get port status failed, "
- "error=%d(%s)\n",
- r, usbd_error_strs[r]));
- continue;
- }
- status = UGETW(up->status.wPortStatus);
- change = UGETW(up->status.wPortChange);
- DPRINTFN(5, ("uhub_explore: port %d status 0x%04x 0x%04x\n",
- port, status, change));
- if (change & UPS_C_PORT_ENABLED) {
- usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);
- if (status & UPS_PORT_ENABLED) {
- printf("%s: illegal enable change, port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- } else {
- /* Port error condition. */
- if (up->restartcnt++ < USBD_RESTART_MAX) {
- printf("%s: port error, restarting "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- goto disco;
- } else {
- printf("%s: port error, giving up "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- }
- }
- }
- if (!(change & UPS_C_CONNECT_STATUS)) {
- /* No status change, just do recursive explore. */
- if (up->device && up->device->hub)
- up->device->hub->explore(up->device);
- continue;
- }
- DPRINTF(("uhub_explore: status change hub=%d port=%d\n",
- dev->address, port));
- usbd_clear_port_feature(dev, port, UHF_C_PORT_CONNECTION);
- usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);
- /*
- * If there is already a device on the port the change status
- * must mean that is has disconnected. Looking at the
- * current connect status is not enough to figure this out
- * since a new unit may have been connected before we handle
- * the disconnect.
- */
- disco:
- if (up->device) {
- /* Disconnected */
- DPRINTF(("uhub_explore: device %d disappeared "
- "on port %d\n",
- up->device->address, port));
- uhub_disconnect(up);
- usbd_clear_port_feature(dev, port,
- UHF_C_PORT_CONNECTION);
- }
- if (!(status & UPS_CURRENT_CONNECT_STATUS))
- continue;
-
- /* Connected */
- up->restartcnt = 0;
-
- /* Wait for maximum device power up time. */
- usbd_delay_ms(dev, USB_PORT_POWERUP_DELAY);
-
- /* Reset port, which implies enabling it. */
- if (usbd_reset_port(dev, port, &up->status) !=
- USBD_NORMAL_COMPLETION)
- continue;
-
- /* Get device info and set its address. */
- r = usbd_new_device(&sc->sc_dev, dev->bus,
- dev->depth + 1, status & UPS_LOW_SPEED,
- port, up);
- /* XXX retry a few times? */
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("uhub_explore: usb_new_device failed, "
- "error=%d(%s)\n", r, usbd_error_strs[r]));
- /* Avoid addressing problems by disabling. */
- /* usbd_reset_port(dev, port, &up->status); */
-/* XXX
- * What should we do. The device may or may not be at its
- * assigned address. In any case we'd like to ignore it.
- * Maybe the port should be disabled until the device is
- * disconnected.
- */
- if (r == USBD_SET_ADDR_FAILED || 1) {/* XXX */
- /* The unit refused to accept a new
- * address, and since we cannot leave
- * at 0 we have to disable the port
- * instead. */
- printf("%s: device problem, disabling "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- usbd_clear_port_feature(dev, port,
- UHF_PORT_ENABLE);
- /* Make sure we don't try to restart it. */
- up->restartcnt = USBD_RESTART_MAX;
- }
- } else {
- if (up->device->hub)
- up->device->hub->explore(up->device);
- }
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-uhub_disconnect(up)
- struct usbd_port *up;
-{
- usbd_device_handle dev = up->device;
- usbd_pipe_handle p, n;
- int i;
- struct softc { bdevice sc_dev; }; /* all softc begin like this */
-
- DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
- up, dev, up->portno));
-
- printf("%s: at %s port %d (addr %d) disconnected\n",
- USBDEVNAME(((struct softc *)dev->softc)->sc_dev),
- USBDEVNAME(((struct uhub_softc *)up->parent->softc)->sc_dev),
- up->portno, dev->address);
-
- if (!dev->cdesc) {
- /* Partially attached device, just drop it. */
- dev->bus->devices[dev->address] = 0;
- up->device = 0;
- return;
- }
-
- for (i = 0; i < dev->cdesc->bNumInterface; i++) {
- for (p = LIST_FIRST(&dev->ifaces[i].pipes); p; p = n) {
- n = LIST_NEXT(p, next);
- if (p->disco)
- p->disco(p->discoarg);
- usbd_abort_pipe(p);
- usbd_close_pipe(p);
- }
- }
-
- /* XXX Free all data structures and disable further I/O. */
- if (dev->hub) {
- struct usbd_port *rup;
- int p, nports;
-
- DPRINTFN(3,("usb_disconnect: hub, recursing\n"));
- nports = dev->hub->hubdesc.bNbrPorts;
- for(p = 0; p < nports; p++) {
- rup = &dev->hub->ports[p];
- if (rup->device)
- uhub_disconnect(rup);
- }
- }
-
- dev->bus->devices[dev->address] = 0;
- up->device = 0;
- /* XXX free */
-#if defined(__FreeBSD__)
- device_delete_child(
- device_get_parent(((struct softc *)dev->softc)->sc_dev),
- ((struct softc *)dev->softc)->sc_dev);
-#endif
-}
-
-void
-uhub_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct uhub_softc *sc = addr;
-
- DPRINTFN(5,("uhub_intr: sc=%p\n", sc));
- if (status != USBD_NORMAL_COMPLETION)
- usbd_clear_endpoint_stall_async(sc->sc_ipipe);
- else
- usb_needs_explore(sc->sc_hub->bus);
-}
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(uhub, usb, uhubroot_driver, uhubroot_devclass, 0, 0);
-DRIVER_MODULE(uhub, uhub, uhub_driver, uhub_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
deleted file mode 100644
index 0d54e01f3ac1..000000000000
--- a/sys/dev/usb/ukbd.c
+++ /dev/null
@@ -1,680 +0,0 @@
-/* $NetBSD: ukbd.c,v 1.22 1999/01/09 12:10:36 drochner Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * Information about USB keyboard can be found in the USB HID spec.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <machine/clock.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#if defined(__NetBSD__)
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
-#include <dev/wscons/wskbdmap_mfii.h>
-
-#include "opt_pckbd_layout.h"
-#include "opt_wsdisplay_compat.h"
-
-#elif defined(__FreeBSD__)
-#include <machine/clock.h>
-#define delay(d) DELAY(d)
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ukbddebug) printf x
-#define DPRINTFN(n,x) if (ukbddebug>(n)) printf x
-int ukbddebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UPROTO_BOOT_KEYBOARD 1
-
-#define NKEYCODE 6
-
-#define NUM_LOCK 0x01
-#define CAPS_LOCK 0x02
-#define SCROLL_LOCK 0x04
-
-struct ukbd_data {
- u_int8_t modifiers;
-#define MOD_CONTROL_L 0x01
-#define MOD_CONTROL_R 0x10
-#define MOD_SHIFT_L 0x02
-#define MOD_SHIFT_R 0x20
-#define MOD_ALT_L 0x04
-#define MOD_ALT_R 0x40
-#define MOD_WIN_L 0x08
-#define MOD_WIN_R 0x80
- u_int8_t reserved;
- u_int8_t keycode[NKEYCODE];
-};
-
-#define PRESS 0
-#define RELEASE 0x100
-
-#define NMOD 6
-static struct {
- int mask, key;
-} ukbd_mods[NMOD] = {
- { MOD_CONTROL_L, 29 },
- { MOD_CONTROL_R, 58 },
- { MOD_SHIFT_L, 42 },
- { MOD_SHIFT_R, 54 },
- { MOD_ALT_L, 56 },
- { MOD_ALT_R, 184 },
-};
-
-#define NN 0 /* no translation */
-/*
- * Translate USB keycodes to US keyboard AT scancodes.
- * Scancodes >= 128 represent EXTENDED keycodes.
- */
-static u_int8_t ukbd_trtab[256] = {
- 0, 0, 0, 0, 30, 48, 46, 32, /* 00 - 07 */
- 18, 33, 34, 35, 23, 36, 37, 38, /* 08 - 0F */
- 50, 49, 24, 25, 16, 19, 31, 20, /* 10 - 17 */
- 22, 47, 17, 45, 21, 44, 2, 3, /* 18 - 1F */
- 4, 5, 6, 7, 8, 9, 10, 11, /* 20 - 27 */
- 28, 1, 14, 15, 57, 12, 13, 26, /* 28 - 2F */
- 27, 43, NN, 39, 40, 41, 51, 52, /* 30 - 37 */
- 53, 58, 59, 60, 61, 62, 63, 64, /* 38 - 3F */
- 65, 66, 67, 68, 87, 88, 170, 70, /* 40 - 47 */
- 127, 210, 199, 201, 211, 207, 209, 205, /* 48 - 4F */
- 203, 208, 200, 69, 181, 55, 74, 78, /* 50 - 57 */
- 156, 79, 80, 81, 75, 76, 77, 71, /* 58 - 5F */
- 72, 73, 82, 83, NN, NN, NN, NN, /* 60 - 67 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 68 - 6F */
- NN, NN, NN, NN, NN, NN, 221, NN, /* 70 - 77 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 78 - 7F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 80 - 87 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 88 - 8F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 90 - 97 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 98 - 9F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* A0 - A7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* A8 - AF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* B0 - B7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* B8 - BF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* C0 - C7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* C8 - CF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* D0 - D7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* D8 - DF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* E0 - E7 */
- NN, NN, NN, 219, NN, NN, NN, 220, /* E8 - EF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* F0 - F7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* F8 - FF */
-};
-
-#define KEY_ERROR 0x01
-
-#define MAXKEYS (NMOD+2*NKEYCODE)
-
-struct ukbd_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- struct ukbd_data sc_ndata;
- struct ukbd_data sc_odata;
-
- char sc_enabled;
- char sc_disconnected; /* device is gone */
-
- int sc_leds;
-#if defined(__NetBSD__)
- struct device *sc_wskbddev;
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-#define REP_DELAY1 400
-#define REP_DELAYN 100
- int sc_rawkbd;
- int sc_nrep;
- char sc_rep[MAXKEYS];
-#endif
-
- int sc_polling;
- int sc_pollchar;
-#endif
-};
-
-#define UKBDUNIT(dev) (minor(dev))
-#define UKBD_CHUNK 128 /* chunk size for read */
-#define UKBD_BSIZE 1020 /* buffer size */
-
-void ukbd_cngetc __P((void *, u_int *, int *));
-void ukbd_cnpollc __P((void *, int));
-
-#if defined(__NetBSD__)
-const struct wskbd_consops ukbd_consops = {
- ukbd_cngetc,
- ukbd_cnpollc,
-};
-#endif
-
-void ukbd_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ukbd_disco __P((void *));
-
-int ukbd_enable __P((void *, int));
-void ukbd_set_leds __P((void *, int));
-#if defined(__NetBSD__)
-int ukbd_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
-int ukbd_cnattach __P((void *v));
-void ukbd_rawrepeat __P((void *v));
-
-const struct wskbd_accessops ukbd_accessops = {
- ukbd_enable,
- ukbd_set_leds,
- ukbd_ioctl,
-#if 0
- ukbd_cnattach,
-#endif
-};
-
-const struct wskbd_mapdata ukbd_keymapdata = {
- pckbd_keydesctab,
-#ifdef PCKBD_LAYOUT
- PCKBD_LAYOUT,
-#else
- KB_US,
-#endif
-};
-#endif
-
-USB_DECLARE_DRIVER(ukbd);
-
-USB_MATCH(ukbd)
-{
- USB_MATCH_START(ukbd, uaa);
- usb_interface_descriptor_t *id;
-
- /* Check that this is a keyboard that speaks the boot protocol. */
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id ||
- id->bInterfaceClass != UCLASS_HID ||
- id->bInterfaceSubClass != USUBCLASS_BOOT ||
- id->bInterfaceProtocol != UPROTO_BOOT_KEYBOARD)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
-}
-
-USB_ATTACH(ukbd)
-{
- USB_ATTACH_START(ukbd, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
- char devinfo[1024];
-#if defined(__NetBSD__)
- struct wskbddev_attach_args a;
-#endif
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("ukbd_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- if ((usbd_get_quirks(uaa->device)->uq_flags & UQ_NO_SET_PROTO) == 0) {
- r = usbd_set_protocol(iface, 0);
- DPRINTFN(5, ("ukbd_attach: protocol set\n"));
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: set protocol failed\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- }
-
- /* Ignore if SETIDLE fails since it is not crucial. */
- usbd_set_idle(iface, 0, 0);
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
-
-#if defined(__NetBSD__)
- a.console = 0;
-
- a.keymap = &ukbd_keymapdata;
-
- a.accessops = &ukbd_accessops;
- a.accesscookie = sc;
-
- /* Flash the leds; no real purpose, just shows we're alive. */
- ukbd_set_leds(sc, WSKBD_LED_SCROLL | WSKBD_LED_NUM | WSKBD_LED_CAPS);
- usbd_delay_ms(uaa->device, 300);
- ukbd_set_leds(sc, 0);
-
- sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
-
-#elif defined(__FreeBSD__)
- /* XXX why waste CPU in delay() ? */
- /* It's alive! IT'S ALIVE! Do a little song and dance. */
- ukbd_set_leds(sc, NUM_LOCK);
- delay(15000);
- ukbd_set_leds(sc, CAPS_LOCK);
- delay(20000);
- ukbd_set_leds(sc, SCROLL_LOCK);
- delay(30000);
- ukbd_set_leds(sc, CAPS_LOCK);
- delay(50000);
- ukbd_set_leds(sc, NUM_LOCK);
-
- ukbd_enable(sc, 1);
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-int
-ukbd_detach(device_t self)
-{
- struct ukbd_softc *sc = device_get_softc(self);
- char *devinfo = (char *) device_get_desc(self);
-
- if (sc->sc_enabled)
- return (ENXIO);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return (0);
-}
-#endif
-
-void
-ukbd_disco(p)
- void *p;
-{
- struct ukbd_softc *sc = p;
-
- DPRINTF(("ukbd_disco: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-int
-ukbd_enable(v, on)
- void *v;
- int on;
-{
- struct ukbd_softc *sc = v;
- usbd_status r;
-
- if (on) {
- /* Set up interrupt pipe. */
- if (sc->sc_enabled)
- return (EBUSY);
-
- sc->sc_enabled = 1;
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK,
- &sc->sc_intrpipe, sc, &sc->sc_ndata,
- sizeof(sc->sc_ndata), ukbd_intr);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- usbd_set_disco(sc->sc_intrpipe, ukbd_disco, sc);
- } else {
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_enabled = 0;
- }
-
- return (0);
-}
-
-void
-ukbd_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ukbd_softc *sc = addr;
- struct ukbd_data *ud = &sc->sc_ndata;
- int mod, omod;
- int ibuf[MAXKEYS]; /* chars events */
- int nkeys, i, j;
- int key, c;
-#define ADDKEY(c) ibuf[nkeys++] = (c)
-
- DPRINTFN(5, ("ukbd_intr: status=%d\n", status));
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ukbd_intr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
- return;
- }
-
- DPRINTFN(5, (" mod=0x%02x key0=0x%02x key1=0x%02x\n",
- ud->modifiers, ud->keycode[0], ud->keycode[1]));
-
- if (ud->keycode[0] == KEY_ERROR)
- return; /* ignore */
- nkeys = 0;
- mod = ud->modifiers;
- omod = sc->sc_odata.modifiers;
- if (mod != omod)
- for (i = 0; i < NMOD; i++)
- if (( mod & ukbd_mods[i].mask) !=
- (omod & ukbd_mods[i].mask))
- ADDKEY(ukbd_mods[i].key |
- (mod & ukbd_mods[i].mask
- ? PRESS : RELEASE));
- if (memcmp(ud->keycode, sc->sc_odata.keycode, NKEYCODE) != 0) {
- /* Check for released keys. */
- for (i = 0; i < NKEYCODE; i++) {
- key = sc->sc_odata.keycode[i];
- if (key == 0)
- continue;
- for (j = 0; j < NKEYCODE; j++)
- if (key == ud->keycode[j])
- goto rfound;
- c = ukbd_trtab[key];
- if (c)
- ADDKEY(c | RELEASE);
- rfound:
- ;
- }
-
- /* Check for pressed keys. */
- for (i = 0; i < NKEYCODE; i++) {
- key = ud->keycode[i];
- if (key == 0)
- continue;
- for (j = 0; j < NKEYCODE; j++)
- if (key == sc->sc_odata.keycode[j])
- goto pfound;
- c = ukbd_trtab[key];
- DPRINTFN(2,("ukbd_intr: press key=0x%02x -> 0x%02x\n",
- key, c));
- if (c)
- ADDKEY(c | PRESS);
- pfound:
- ;
- }
- }
- sc->sc_odata = *ud;
-
- if (nkeys == 0)
- return;
-
-#if defined(__NetBSD__)
- if (sc->sc_polling) {
- DPRINTFN(1,("ukbd_intr: pollchar = 0x%02x\n", ibuf[0]));
- if (nkeys > 0)
- sc->sc_pollchar = ibuf[0]; /* XXX lost keys? */
- return;
- }
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (sc->sc_rawkbd) {
- char cbuf[MAXKEYS * 2];
- int npress;
-
- for (npress = i = j = 0; i < nkeys; i++, j++) {
- c = ibuf[i];
- if (c & 0x80)
- cbuf[j++] = 0xe0;
- cbuf[j] = c & 0x7f;
- if (c & RELEASE)
- cbuf[j] |= 0x80;
- else {
- /* remember keys for autorepeat */
- if (c & 0x80)
- sc->sc_rep[npress++] = 0xe0;
- sc->sc_rep[npress++] = c & 0x7f;
- }
- }
- wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
- untimeout(ukbd_rawrepeat, sc);
- if (npress != 0) {
- sc->sc_nrep = npress;
- timeout(ukbd_rawrepeat, sc, hz * REP_DELAY1 / 1000);
- }
- return;
- }
-#endif
-
- for (i = 0; i < nkeys; i++) {
- c = ibuf[i];
- wskbd_input(sc->sc_wskbddev,
- c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN,
- c & 0xff);
- }
-#elif defined(__FreeBSD__)
- /* XXX shouldn't the keys be used? */
- for (i = 0; i < nkeys; i++) {
- c = ibuf[i];
- printf("%c (%d) %s ",
- ((c&0xff) < 32 || (c&0xff) > 126? '.':(c&0xff)), c,
- (c&RELEASE? "released":"pressed"));
- if (ud->modifiers)
- printf("mod = 0x%04x ", ud->modifiers);
- for (i = 0; i < NKEYCODE; i++)
- if (ud->keycode[i])
- printf("%d ", ud->keycode[i]);
- printf("\n");
- }
-#endif
-}
-
-void
-ukbd_set_leds(v, leds)
- void *v;
- int leds;
-{
- struct ukbd_softc *sc = v;
- u_int8_t res;
-
- DPRINTF(("ukbd_set_leds: sc=%p leds=%d\n", sc, leds));
-
- sc->sc_leds = leds;
-#if defined(__NetBSD__)
- res = 0;
- if (leds & WSKBD_LED_SCROLL)
- res |= SCROLL_LOCK;
- if (leds & WSKBD_LED_NUM)
- res |= NUM_LOCK;
- if (leds & WSKBD_LED_CAPS)
- res |= CAPS_LOCK;
-#elif defined(__FreeBSD__)
- res = leds;
-#endif
- usbd_set_report_async(sc->sc_iface, UHID_OUTPUT_REPORT, 0, &res, 1);
-}
-
-#if defined(__NetBSD__)
-
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-void
-ukbd_rawrepeat(v)
- void *v;
-{
- struct ukbd_softc *sc = v;
-
- wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep);
- timeout(ukbd_rawrepeat, sc, hz * REP_DELAYN / 1000);
-}
-#endif
-
-int
-ukbd_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct ukbd_softc *sc = v;
-
- switch (cmd) {
- case WSKBDIO_GTYPE:
- *(int *)data = WSKBD_TYPE_USB;
- return (0);
- case WSKBDIO_SETLEDS:
- ukbd_set_leds(v, *(int *)data);
- return (0);
- case WSKBDIO_GETLEDS:
- *(int *)data = sc->sc_leds;
- return (0);
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- case WSKBDIO_SETMODE:
- DPRINTF(("ukbd_ioctl: set raw = %d\n", *(int *)data));
- sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
- untimeout(ukbd_rawrepeat, sc);
- return (0);
-#endif
- }
- return (-1);
-}
-
-/* Console interface. */
-void
-ukbd_cngetc(v, type, data)
- void *v;
- u_int *type;
- int *data;
-{
- struct ukbd_softc *sc = v;
- usbd_lock_token s;
- int c;
-
- DPRINTFN(1,("ukbd_cngetc: enter\n"));
- s = usbd_lock();
- sc->sc_polling = 1;
- sc->sc_pollchar = -1;
- while(sc->sc_pollchar == -1)
- usbd_dopoll(sc->sc_iface);
- sc->sc_polling = 0;
- c = sc->sc_pollchar;
- *type = c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- *data = c & 0xff;
- usbd_unlock(s);
- DPRINTFN(1,("ukbd_cngetc: return 0x%02x\n", c));
-}
-
-void
-ukbd_cnpollc(v, on)
- void *v;
- int on;
-{
- struct ukbd_softc *sc = v;
-
- DPRINTFN(2,("ukbd_cnpollc: sc=%p on=%d\n", v, on));
-
- usbd_set_polling(sc->sc_iface, on);
-}
-
-int
-ukbd_cnattach(v)
- void *v;
-{
- struct ukbd_softc *sc = v;
-
- DPRINTF(("ukbd_cnattach: sc=%p\n", sc));
- wskbd_cnattach(&ukbd_consops, sc, &ukbd_keymapdata);
- return (0);
-}
-
-#endif /* NetBSD */
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
deleted file mode 100644
index 074fe0489333..000000000000
--- a/sys/dev/usb/ulpt.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/* $NetBSD: ulpt.c,v 1.10 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/syslog.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */
-#define STEP hz/4
-
-#define LPTPRI (PZERO+8)
-#define ULPT_BSIZE 1024
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ulptdebug) printf x
-#define DPRINTFN(n,x) if (ulptdebug>(n)) printf x
-int ulptdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UR_GET_DEVICE_ID 0
-#define UR_GET_PORT_STATUS 1
-#define UR_SOFT_RESET 2
-
-#define LPS_NERR 0x08 /* printer no error */
-#define LPS_SELECT 0x10 /* printer selected */
-#define LPS_NOPAPER 0x20 /* printer out of paper */
-#define LPS_INVERT (LPS_SELECT|LPS_NERR)
-#define LPS_MASK (LPS_SELECT|LPS_NERR|LPS_NOPAPER)
-
-struct ulpt_softc {
- bdevice sc_dev;
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
- int sc_ifaceno;
- usbd_pipe_handle sc_bulkpipe; /* bulk pipe */
- int sc_bulk;
-
- u_char sc_state;
-#define ULPT_OPEN 0x01 /* device is open */
-#define ULPT_OBUSY 0x02 /* printer is busy doing output */
-#define ULPT_INIT 0x04 /* waiting to initialize for open */
- u_char sc_flags;
-#if defined(__NetBSD__)
-#define ULPT_NOPRIME 0x40 /* don't prime on open */
-#elif defined(__FreeBSD__)
-/* values taken from i386/isa/lpt.c */
-#define ULPT_POS_INIT 0x04 /* if we are a postive init signal */
-#define ULPT_POS_ACK 0x08 /* if we are a positive going ack */
-#define ULPT_NOPRIME 0x10 /* don't prime the printer at all */
-#define ULPT_PRIMEOPEN 0x20 /* prime on every open */
-#define ULPT_AUTOLF 0x40 /* tell printer to do an automatic lf */
-#define ULPT_BYPASS 0x80 /* bypass printer ready checks */
-#endif
- u_char sc_laststatus;
-};
-
-#if defined(__NetBSD__)
-int ulptopen __P((dev_t, int, int, struct proc *));
-int ulptclose __P((dev_t, int, int, struct proc *p));
-int ulptwrite __P((dev_t, struct uio *uio, int));
-int ulptioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-#elif defined(__FreeBSD__)
-static d_open_t ulptopen;
-static d_close_t ulptclose;
-static d_write_t ulptwrite;
-static d_ioctl_t ulptioctl;
-
-#define ULPT_CDEV_MAJOR 113
-
-static struct cdevsw ulpt_cdevsw = {
- ulptopen, ulptclose, noread, ulptwrite,
- ulptioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, nostrat,
- "ulpt", NULL, -1
-};
-#endif
-
-int ulpt_status __P((struct ulpt_softc *));
-void ulpt_reset __P((struct ulpt_softc *));
-int ulpt_statusmsg __P((u_char, struct ulpt_softc *));
-
-#if defined(__NetBSD__)
-#define ULPTUNIT(s) (minor(s) & 0x1f)
-#define ULPTFLAGS(s) (minor(s) & 0xe0)
-#elif defined(__FreeBSD__)
-/* defines taken from i386/isa/lpt.c */
-#define ULPTUNIT(s) (minor(s) & 0x03)
-#define ULPTFLAGS(s) (minor(s) & 0xfc)
-#endif
-
-USB_DECLARE_DRIVER(ulpt);
-
-USB_MATCH(ulpt)
-{
- USB_MATCH_START(ulpt, uaa);
- usb_interface_descriptor_t *id;
-
- DPRINTFN(10,("ulpt_match\n"));
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (id &&
- id->bInterfaceClass == UCLASS_PRINTER &&
- id->bInterfaceSubClass == USUBCLASS_PRINTER &&
- (id->bInterfaceProtocol == UPROTO_PRINTER_UNI ||
- id->bInterfaceProtocol == UPROTO_PRINTER_BI))
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(ulpt)
-{
- USB_ATTACH_START(ulpt, sc, uaa);
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
-#if 0
- usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev);
- usb_device_request_t req;
-#endif
- char devinfo[1024];
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
-
- DPRINTFN(10,("ulpt_attach: sc=%p\n", sc));
- usbd_devinfo(dev, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- /* Figure out which endpoint is the bulk out endpoint. */
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed)
- goto nobulk;
- if ((ed->bEndpointAddress & UE_IN) != UE_OUT ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_BULK) {
- /* In case we are using a bidir protocol... */
- ed = usbd_interface2endpoint_descriptor(iface, 1);
- if (!ed)
- goto nobulk;
- if ((ed->bEndpointAddress & UE_IN) != UE_OUT ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_BULK)
- goto nobulk;
- }
- sc->sc_bulk = ed->bEndpointAddress;
- DPRINTFN(10, ("ulpt_attach: bulk=%d\n", sc->sc_bulk));
-
- sc->sc_iface = iface;
- r = usbd_interface2device_handle(iface, &sc->sc_udev);
- if (r != USBD_NORMAL_COMPLETION)
- USB_ATTACH_ERROR_RETURN;
- sc->sc_ifaceno = id->bInterfaceNumber;
-
-#if 0
-XXX needs a different way to read the id string since the length
-is unknown. usbd_do_request() returns error on a short transfer.
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_DEVICE_ID;
- USETW(req.wValue, cd->bConfigurationValue);
- USETW2(req.wIndex, id->bInterfaceNumber, id->bAlternateSetting);
- USETW(req.wLength, sizeof devinfo - 1);
- r = usbd_do_request(dev, &req, devinfo);
- if (r == USBD_NORMAL_COMPLETION) {
- int len;
- char *idstr;
- len = (devinfo[0] << 8) | (devinfo[1] & 0xff);
- /* devinfo now contains an IEEE-1284 device ID */
- idstr = devinfo+2;
- idstr[len] = 0;
- printf("%s: device id <%s>\n", USBDEVNAME(sc->sc_dev), idstr);
- } else {
- printf("%s: cannot get device id\n", USBDEVNAME(sc->sc_dev));
- }
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-
- nobulk:
- printf("%s: could not find bulk endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
-}
-
-int
-ulpt_status(sc)
- struct ulpt_softc *sc;
-{
- usb_device_request_t req;
- usbd_status r;
- u_char status;
-
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_PORT_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, sc->sc_ifaceno);
- USETW(req.wLength, 1);
- r = usbd_do_request(sc->sc_udev, &req, &status);
- DPRINTFN(1, ("ulpt_status: status=0x%02x r=%d\n", status, r));
- if (r == USBD_NORMAL_COMPLETION)
- return (status);
- else
- return (0);
-}
-
-void
-ulpt_reset(sc)
- struct ulpt_softc *sc;
-{
- usb_device_request_t req;
-
- DPRINTFN(1, ("ulpt_reset\n"));
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SOFT_RESET;
- USETW(req.wValue, 0);
- USETW(req.wIndex, sc->sc_ifaceno);
- USETW(req.wLength, 0);
- (void)usbd_do_request(sc->sc_udev, &req, 0);
-}
-
-/*
- * Reset the printer, then wait until it's selected and not busy.
- */
-int
-ulptopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- u_char flags = ULPTFLAGS(dev);
- usbd_status r;
- int spin, error;
- USB_GET_SC_OPEN(ulpt, ULPTUNIT(dev), sc);
-
- if (!sc || !sc->sc_iface)
- return ENXIO;
-
- if (sc->sc_state)
- return EBUSY;
-
- sc->sc_state = ULPT_INIT;
- sc->sc_flags = flags;
- DPRINTF(("ulptopen: flags=0x%x\n", (unsigned)flags));
-
-#if USB_DEBUG && defined(__FreeBSD__)
- /* Ignoring these flags might not be a good idea */
- if ((flags ^ ULPT_NOPRIME) != 0)
- DPRINTF(("flags ignored: %b\n", flags,
- "\20\3POS_INIT\4POS_ACK\6PRIME_OPEN\7AUTOLF\10BYPASS"));
-#endif
- if ((flags & ULPT_NOPRIME) == 0)
- ulpt_reset(sc);
-
- for (spin = 0; (ulpt_status(sc) & LPS_SELECT) == 0; spin += STEP) {
- if (spin >= TIMEOUT) {
- sc->sc_state = 0;
- return EBUSY;
- }
-
- /* wait 1/4 second, give up if we get a signal */
- error = tsleep((caddr_t)sc, LPTPRI | PCATCH, "ulptop", STEP);
- if (error != EWOULDBLOCK) {
- sc->sc_state = 0;
- return error;
- }
- }
-
- r = usbd_open_pipe(sc->sc_iface, sc->sc_bulk, 0, &sc->sc_bulkpipe);
- if (r != USBD_NORMAL_COMPLETION) {
- sc->sc_state = 0;
- return (EIO);
- }
-
- sc->sc_state = ULPT_OPEN;
-
- DPRINTF(("ulptopen: done\n"));
- return (0);
-}
-
-int
-ulpt_statusmsg(status, sc)
- u_char status;
- struct ulpt_softc *sc;
-{
- u_char new;
-
- status = (status ^ LPS_INVERT) & LPS_MASK;
- new = status & ~sc->sc_laststatus;
- sc->sc_laststatus = status;
-
- if (new & LPS_SELECT)
- log(LOG_NOTICE, "%s: offline\n", USBDEVNAME(sc->sc_dev));
- else if (new & LPS_NOPAPER)
- log(LOG_NOTICE, "%s: out of paper\n", USBDEVNAME(sc->sc_dev));
- else if (new & LPS_NERR)
- log(LOG_NOTICE, "%s: output error\n", USBDEVNAME(sc->sc_dev));
-
- return status;
-}
-
-int
-ulptclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
-
- usbd_close_pipe(sc->sc_bulkpipe);
-
- sc->sc_state = 0;
-
- DPRINTF(("ulptclose: closed\n"));
- return (0);
-}
-
-int
-ulptwrite(dev, uio, flags)
- dev_t dev;
- struct uio *uio;
- int flags;
-{
- size_t n;
- int error = 0;
- char buf[ULPT_BSIZE];
- usbd_request_handle reqh;
- usbd_status r;
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
-
- DPRINTF(("ulptwrite\n"));
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (ENOMEM);
- while ((n = min(ULPT_BSIZE, uio->uio_resid)) != 0) {
- ulpt_statusmsg(ulpt_status(sc), sc);
- error = uiomove(buf, n, uio);
- if (error)
- break;
- /* XXX use callback to enable interrupt? */
- r = usbd_setup_request(reqh, sc->sc_bulkpipe, 0, buf, n,
- 0, USBD_NO_TIMEOUT, 0);
- if (r != USBD_NORMAL_COMPLETION) {
- error = EIO;
- break;
- }
- DPRINTFN(1, ("ulptwrite: transfer %d bytes\n", n));
- r = usbd_sync_transfer(reqh);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ulptwrite: error=%d\n", r));
- usbd_clear_endpoint_stall(sc->sc_bulkpipe);
- error = EIO;
- break;
- }
- }
- usbd_free_request(reqh);
- return (error);
-}
-
-int
-ulptioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- int error = 0;
-
- switch (cmd) {
- default:
- error = ENODEV;
- }
-
- return error;
-}
-
-#if defined(__FreeBSD__)
-static int
-ulpt_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-
-CDEV_DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass,
- ULPT_CDEV_MAJOR, ulpt_cdevsw, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
deleted file mode 100644
index 16bfae25ae16..000000000000
--- a/sys/dev/usb/umodem.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $NetBSD: umodem.c,v 1.5 1999/01/08 11:58:25 augustss Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/device.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbcdc.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (umodemdebug) printf x
-#define DPRINTFN(n,x) if (umodemdebug>(n)) printf x
-int umodemdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct umodem_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_ctl; /* control interface */
- usbd_interface_handle sc_data; /* data interface */
- uByte cmCaps;
- uByte acmCaps;
-};
-
-void umodem_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void umodem_disco __P((void *));
-
-USB_DECLARE_DRIVER(umodem);
-
-USB_MATCH(umodem)
-{
- USB_MATCH_START(umodem, uaa);
-
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id ||
- id->bInterfaceClass != UCLASS_CDC ||
- id->bInterfaceSubClass != USUBCLASS_ABSTRACT_CONTROL_MODEL ||
- id->bInterfaceProtocol != UPROTO_CDC_AT)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
-}
-
-USB_ATTACH(umodem)
-{
- USB_ATTACH_START(umodem, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- char devinfo[1024];
-
- sc->sc_ctl = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-umodem_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return 0;
-}
-#endif
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(umodem, uhub, umodem_driver, umodem_devclass, usbd_driver_load,0);
-#endif
-
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
deleted file mode 100644
index e92d027ec0db..000000000000
--- a/sys/dev/usb/ums.c
+++ /dev/null
@@ -1,720 +0,0 @@
-/* $NetBSD: ums.c,v 1.19 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#if defined(__NetBSD__)
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsmousevar.h>
-#elif defined(__FreeBSD__)
-#include <machine/mouse.h>
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (umsdebug) printf x
-#define DPRINTFN(n,x) if (umsdebug>(n)) printf x
-int umsdebug = 6;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UMSUNIT(s) (minor(s)&0x1f)
-
-#define PS2LBUTMASK x01
-#define PS2RBUTMASK x02
-#define PS2MBUTMASK x04
-#define PS2BUTMASK 0x0f
-
-#define QUEUE_BUFSIZE 240 /* MUST be divisible by 3 _and_ 4 */
-
-struct ums_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- u_char *sc_ibuf;
- u_int8_t sc_iid;
- int sc_isize;
- struct hid_location sc_loc_x, sc_loc_y, sc_loc_z;
- struct hid_location *sc_loc_btn;
-
- int sc_enabled;
- int sc_disconnected; /* device is gone */
-
- int flags; /* device configuration */
-#define UMS_Z 0x01 /* z direction available */
- int nbuttons;
-#define MAX_BUTTONS 7 /* chosen because sc_buttons is u_char */
-
-#if defined(__NetBSD__)
- u_char sc_buttons; /* mouse button status */
- struct device *sc_wsmousedev;
-#elif defined(__FreeBSD__)
- u_char qbuf[QUEUE_BUFSIZE]; /* must be divisable by 3&4 */
- u_char dummy[100]; /* XXX just for safety and for now */
- int qcount, qhead, qtail;
- mousehw_t hw;
- mousemode_t mode;
- mousestatus_t status;
-
- int state;
-# define UMS_ASLEEP 0x01 /* readFromDevice is waiting */
-# define UMS_SELECT 0x02 /* select is waiting */
- struct selinfo rsel; /* process waiting in select */
-#endif
-};
-
-#define MOUSE_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)
-#define MOUSE_FLAGS (HIO_RELATIVE)
-
-void ums_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ums_disco __P((void *));
-
-static int ums_enable __P((void *));
-static void ums_disable __P((void *));
-
-#if defined(__NetBSD__)
-static int ums_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
-
-const struct wsmouse_accessops ums_accessops = {
- ums_enable,
- ums_ioctl,
- ums_disable,
-};
-
-#elif defined(__FreeBSD__)
-static d_open_t ums_open;
-static d_close_t ums_close;
-static d_read_t ums_read;
-static d_ioctl_t ums_ioctl;
-static d_poll_t ums_poll;
-
-#define UMS_CDEV_MAJOR 111
-
-static struct cdevsw ums_cdevsw = {
- ums_open, ums_close, ums_read, nowrite,
- ums_ioctl, nostop, nullreset, nodevtotty,
- ums_poll, nommap, nostrat,
- "ums", NULL, -1
-};
-#endif
-
-USB_DECLARE_DRIVER(ums);
-
-USB_MATCH(ums)
-{
- USB_MATCH_START(ums, uaa);
- usb_interface_descriptor_t *id;
- int size, ret;
- void *desc;
- usbd_status r;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id || id->bInterfaceClass != UCLASS_HID)
- return (UMATCH_NONE);
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
- if (r != USBD_NORMAL_COMPLETION)
- return (UMATCH_NONE);
-
- if (hid_is_collection(desc, size,
- HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
- ret = UMATCH_IFACECLASS;
- else
- ret = UMATCH_NONE;
-
- free(desc, M_TEMP);
- return (ret);
-}
-
-USB_ATTACH(ums)
-{
- USB_ATTACH_START(ums, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
-#if defined(__NetBSD__)
- struct wsmousedev_attach_args a;
-#endif
- int size;
- void *desc;
- usbd_status r;
- char devinfo[1024];
- u_int32_t flags;
- int i;
- struct hid_location loc_btn;
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
- if (r != USBD_NORMAL_COMPLETION)
- USB_ATTACH_ERROR_RETURN;
-
- if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
- hid_input, &sc->sc_loc_x, &flags)) {
- printf("%s: mouse has no X report\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- printf("%s: X report 0x%04x not supported\n",
- USBDEVNAME(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
- }
-
- if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
- hid_input, &sc->sc_loc_y, &flags)) {
- printf("%s: mouse has no Y report\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- printf("%s: Y report 0x%04x not supported\n",
- USBDEVNAME(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* try to guess the Z activator: first check Z, then WHEEL */
- if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
- hid_input, &sc->sc_loc_z, &flags) ||
- hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
- hid_input, &sc->sc_loc_z, &flags)) {
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- sc->sc_loc_z.size = 0; /* Bad Z coord, ignore it */
- } else {
-#if defined(__FreeBSD__)
-#ifdef USBVERBOSE
- printf("%s: Z dir. ignored due to bugs in ums.c\n",
- USBDEVNAME(sc->sc_dev));
-#endif
-#else
- sc->flags |= UMS_Z;
-#endif
- }
- }
-
- /* figure out the number of buttons */
- for (i = 1; i <= MAX_BUTTONS; i++)
- if (!hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
- hid_input, &loc_btn, 0))
- break;
- sc->nbuttons = i - 1;
- sc->sc_loc_btn = malloc(sizeof(struct hid_location)*sc->nbuttons,
- M_USBDEV, M_NOWAIT);
- if (!sc->sc_loc_btn)
- USB_ATTACH_ERROR_RETURN;
-
- printf("%s: %d buttons%s\n", USBDEVNAME(sc->sc_dev),
- sc->nbuttons, (sc->flags & UMS_Z? " and Z dir." : ""));
-
- for (i = 1; i <= sc->nbuttons; i++)
- hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
- hid_input, &sc->sc_loc_btn[i-1], 0);
-
- sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
- sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT);
- if (!sc->sc_ibuf) {
- free(sc->sc_loc_btn, M_USB);
- USB_ATTACH_ERROR_RETURN;
- }
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
- free(desc, M_TEMP);
-
-#ifdef USB_DEBUG
- DPRINTF(("ums_attach: sc=%p\n", sc));
- DPRINTF(("ums_attach: X\t%d/%d\n",
- sc->sc_loc_x.pos, sc->sc_loc_x.size));
- DPRINTF(("ums_attach: Y\t%d/%d\n",
- sc->sc_loc_x.pos, sc->sc_loc_x.size));
- if (sc->flags & UMS_Z)
- DPRINTF(("ums_attach: Z\t%d/%d\n",
- sc->sc_loc_z.pos, sc->sc_loc_z.size));
- for (i = 1; i <= sc->nbuttons; i++) {
- DPRINTF(("ums_attach: B%d\t%d/%d\n",
- i, sc->sc_loc_btn[i-1].pos,sc->sc_loc_btn[i-1].size));
- }
- DPRINTF(("ums_attach: size=%d, id=%d\n", sc->sc_isize, sc->sc_iid));
-#endif
-
-#if defined(__NetBSD__)
- a.accessops = &ums_accessops;
- a.accesscookie = sc;
-
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
-#elif defined(__FreeBSD__)
- sc->hw.buttons = 2; /* XXX hw&mode values are bogus */
- sc->hw.iftype = MOUSE_IF_PS2;
- sc->hw.type = MOUSE_MOUSE;
- if (sc->flags & UMS_Z)
- sc->hw.model = MOUSE_MODEL_INTELLI;
- else
- sc->hw.model = MOUSE_MODEL_GENERIC;
- sc->hw.hwid = 0;
- sc->mode.protocol = MOUSE_PROTO_PS2;
- sc->mode.rate = -1;
- sc->mode.resolution = MOUSE_RES_DEFAULT;
- sc->mode.accelfactor = 1;
- sc->mode.level = 0;
- if (sc->flags & UMS_Z) {
- sc->mode.packetsize = MOUSE_INTELLI_PACKETSIZE;
- sc->mode.syncmask[0] = 0xc8;
- } else {
- sc->mode.packetsize = MOUSE_PS2_PACKETSIZE;
- sc->mode.syncmask[0] = 0xc0;
- }
- sc->mode.syncmask[1] = 0;
-
- sc->status.flags = 0;
- sc->status.button = sc->status.obutton = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
-
- sc->rsel.si_flags = 0;
- sc->rsel.si_pid = 0;
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-
-#if defined(__FreeBSD__)
-static int
-ums_detach(device_t self)
-{
- struct ums_softc *sc = device_get_softc(self);
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- free(sc->sc_loc_btn, M_USB);
- free(sc->sc_ibuf, M_USB);
-
- return 0;
-}
-#endif
-
-void
-ums_disco(p)
- void *p;
-{
- struct ums_softc *sc = p;
-
- DPRINTF(("ums_disco: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-void
-ums_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ums_softc *sc = addr;
- u_char *ibuf;
- int dx, dy, dz;
- u_char buttons = 0;
- int i;
-
-#if defined(__NetBSD__)
-#define UMS_BUT(i) ((i) == 1 || (i) == 2 ? 3 - (i) : i)
-#elif defined(__FreeBSD__)
-#define UMS_BUT(i) (i)
-#endif
-
- DPRINTFN(5, ("ums_intr: sc=%p status=%d\n", sc, status));
- DPRINTFN(5, ("ums_intr: data = %02x %02x %02x\n",
- sc->sc_ibuf[0], sc->sc_ibuf[1], sc->sc_ibuf[2]));
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ums_intr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
- return;
- }
-
- ibuf = sc->sc_ibuf;
- if (sc->sc_iid) {
- if (*ibuf++ != sc->sc_iid)
- return;
- }
-
- dx = hid_get_data(ibuf, &sc->sc_loc_x);
- dy = -hid_get_data(ibuf, &sc->sc_loc_y);
- dz = hid_get_data(ibuf, &sc->sc_loc_z);
- for (i = 0; i < sc->nbuttons; i++)
- if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
- buttons |= (1 << UMS_BUT(i));
-
-#if defined(__NetBSD__)
- if (dx || dy || buttons != sc->sc_buttons) {
- DPRINTFN(10, ("ums_intr: x:%d y:%d z:%d buttons:0x%x\n",
- dx, dy, dz, buttons));
- sc->sc_buttons = buttons;
- if (sc->sc_wsmousedev)
- wsmouse_input(sc->sc_wsmousedev, buttons, dx, dy, dz);
-#elif defined(__FreeBSD__)
- if (dx || dy || (sc->flags & UMS_Z && dz)
- || buttons != sc->status.button) {
- DPRINTFN(5, ("ums_intr: x:%d y:%d z:%d buttons:0x%x\n",
- dx, dy, dz, buttons));
-
- sc->status.button = buttons;
- sc->status.dx += dx;
- sc->status.dy += dy;
- sc->status.dz += dz;
-
- /* Discard data in case of full buffer */
- if (sc->qcount == sizeof(sc->qbuf)) {
- DPRINTF(("Buffer full, discarded packet"));
- return;
- }
-
- sc->qbuf[sc->qhead] = MOUSE_PS2_SYNC;
- if (dx < 0)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_XNEG;
- if (dx > 255 || dx < -255)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_XOVERFLOW;
- if (dy < 0)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_YNEG;
- if (dy > 255 || dy < -255)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_YOVERFLOW;
- sc->qbuf[sc->qhead++] |= buttons;
- sc->qbuf[sc->qhead++] = dx;
- sc->qbuf[sc->qhead++] = dy;
- sc->qcount += 3;
- if (sc->flags & UMS_Z) {
- sc->qbuf[sc->qhead++] = dz;
- sc->qcount++;
- }
-#ifdef USB_DEBUG
- if (sc->qhead > sizeof(sc->qbuf))
- DPRINTF(("Buffer overrun! %d %d\n",
- sc->qhead, sizeof(sc->qbuf)));
-#endif
- /* wrap round at end of buffer */
- if (sc->qhead >= sizeof(sc->qbuf))
- sc->qhead = 0;
-
- /* someone waiting for data */
- if (sc->state & UMS_ASLEEP) {
- DPRINTF(("Waking up %p\n", sc));
- wakeup(sc);
- }
- if (sc->state & UMS_SELECT) {
- DPRINTF(("Waking up select %p\n", &sc->rsel));
- selwakeup(&sc->rsel);
- }
-#endif
- }
-}
-
-
-static int
-ums_enable(v)
- void *v;
-{
- struct ums_softc *sc = v;
-
- usbd_status r;
-
- if (sc->sc_enabled)
- return EBUSY;
-
- sc->sc_enabled = 1;
-#if defined(__NetBSD__)
- sc->sc_buttons = 0;
-#elif defined(__FreeBSD__)
- sc->qcount = 0;
- sc->qhead = sc->qtail = 0;
- sc->status.flags = 0;
- sc->status.button = sc->status.obutton = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
-#endif
-
- /* Set up interrupt pipe. */
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc,
- sc->sc_ibuf, sc->sc_isize, ums_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ums_enable: usbd_open_pipe_intr failed, error=%d\n",
- r));
- sc->sc_enabled = 0;
- return (EIO);
- }
- usbd_set_disco(sc->sc_intrpipe, ums_disco, sc);
- return (0);
-}
-
-static void
-ums_disable(v)
- void *v;
-{
- struct ums_softc *sc = v;
-
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_enabled = 0;
-
-#if defined(USBVERBOSE) && defined(__FreeBSD__)
- if (sc->qcount != 0)
- DPRINTF(("Discarded %d bytes in queue\n", sc->qcount));
-#endif
-}
-
-#if defined(__NetBSD__)
-static int
-ums_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-
-{
- switch (cmd) {
- case WSMOUSEIO_GTYPE:
- *(u_int *)data = WSMOUSE_TYPE_USB;
- return (0);
- }
-
- return (-1);
-}
-
-#elif defined(__FreeBSD__)
-static int
-ums_open(dev_t dev, int flag, int fmt, struct proc *p)
-{
- USB_GET_SC_OPEN(ums, UMSUNIT(dev), sc);
-
- return ums_enable(sc);
-}
-
-static int
-ums_close(dev_t dev, int flag, int fmt, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
-
- if (sc->sc_enabled)
- ums_disable(sc);
-
- return 0;
-}
-
-static int
-ums_read(dev_t dev, struct uio *uio, int flag)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int s;
- char buf[sizeof(sc->qbuf)];
- int l = 0;
- int error;
-
- s = splusb();
- while (sc->qcount == 0 ) {
- /* NWH XXX non blocking I/O ??
- if (non blocking I/O ) {
- splx(s);
- return EWOULDBLOCK;
- } else {
- */
- sc->state |= UMS_ASLEEP;
- error = tsleep(sc, PZERO | PCATCH, "umsrea", 0);
- sc->state &= ~UMS_ASLEEP;
- if (error) {
- splx(s);
- return error;
- }
- }
-
- while ((sc->qcount > 0) && (uio->uio_resid > 0)) {
- l = (sc->qcount < uio->uio_resid? sc->qcount:uio->uio_resid);
- if (l > sizeof(buf))
- l = sizeof(buf);
- if (l > sizeof(sc->qbuf) - sc->qtail) /* transfer till end of buf */
- l = sizeof(sc->qbuf) - sc->qtail;
-
- splx(s);
- uiomove(&sc->qbuf[sc->qtail], l, uio);
- s = splusb();
-
- if ( sc->qcount - l < 0 ) {
- DPRINTF(("qcount below 0, count=%d l=%d\n", sc->qcount, l));
- sc->qcount = l;
- }
- sc->qcount -= l; /* remove the bytes from the buffer */
- sc->qtail = (sc->qtail + l) % sizeof(sc->qbuf);
- }
- splx(s);
-
- return 0;
-}
-
-static int
-ums_poll(dev_t dev, int events, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int revents = 0;
- int s;
-
- s = splusb();
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->qcount) {
- revents = events & (POLLIN | POLLRDNORM);
- } else {
- sc->state |= UMS_SELECT;
- selrecord(p, &sc->rsel);
- sc->state &= ~UMS_SELECT;
- }
- }
- splx(s);
-
- return revents;
-}
-
-int
-ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int error = 0;
- int s;
-
- switch(cmd) {
- case MOUSE_GETHWINFO:
- *(mousehw_t *)addr = sc->hw;
- break;
- case MOUSE_GETMODE:
- *(mousemode_t *)addr = sc->mode;
- break;
- case MOUSE_GETLEVEL:
- *(int *)addr = sc->mode.level;
- break;
- case MOUSE_GETSTATUS: {
- mousestatus_t *status = (mousestatus_t *) addr;
-
- s = splusb();
- *status = sc->status;
- sc->status.obutton = sc->status.button;
- sc->status.button = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
- splx(s);
-
- if (status->dx || status->dy || status->dz)
- status->flags |= MOUSE_POSCHANGED;
- if (status->button != status->obutton)
- status->flags |= MOUSE_BUTTONSCHANGED;
- break;
- }
- default:
- error = ENOTTY;
- }
-
- return error;
-}
-#endif
-
-#if defined(__FreeBSD__)
-CDEV_DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass,
- UMS_CDEV_MAJOR, ums_cdevsw, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
deleted file mode 100644
index 70c75166b266..000000000000
--- a/sys/dev/usb/usb.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/* $NetBSD: usb.c,v 1.11 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * USB specifications and other documentation can be found at
- * http://www.usb.org/developers/data/ and
- * http://www.usb.org/developers/index.html .
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#endif
-#include <sys/poll.h>
-#include <sys/proc.h>
-#include <sys/select.h>
-
-#include <dev/usb/usb.h>
-
-#if defined(__FreeBSD__)
-MALLOC_DEFINE(M_USB, "USB", "USB");
-MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device");
-
-#include "usb_if.h"
-#endif /* defined(__FreeBSD__) */
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-int usbdebug = 1;
-int uhcidebug = 1;
-int ohcidebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define USBUNIT(dev) (minor(dev))
-
-struct usb_softc {
- bdevice sc_dev; /* base device */
- usbd_bus_handle sc_bus; /* USB controller */
- struct usbd_port sc_port; /* dummy port for root hub */
- char sc_running;
- char sc_exploring;
- struct selinfo sc_consel; /* waiting for connect change */
-};
-
-#if defined(__NetBSD__)
-int usbopen __P((dev_t, int, int, struct proc *));
-int usbclose __P((dev_t, int, int, struct proc *));
-int usbioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int usbpoll __P((dev_t, int, struct proc *));
-
-#elif defined(__FreeBSD__)
-d_open_t usbopen;
-d_close_t usbclose;
-d_ioctl_t usbioctl;
-int usbpoll __P((dev_t, int, struct proc *));
-
-struct cdevsw usb_cdevsw = {
- usbopen, usbclose, noread, nowrite,
- usbioctl, nullstop, nullreset, nodevtotty,
- usbpoll, nommap, nostrat,
- "usb", NULL, -1
-};
-#endif
-
-usbd_status usb_discover __P((struct usb_softc *));
-
-USB_DECLARE_DRIVER_INIT(usb, DEVMETHOD(bus_print_child, usbd_print_child));
-
-USB_MATCH(usb)
-{
- DPRINTF(("usbd_match\n"));
- return (UMATCH_GENERIC);
-}
-
-USB_ATTACH(usb)
-{
-#if defined(__NetBSD__)
- struct usb_softc *sc = (struct usb_softc *)self;
-#elif defined(__FreeBSD__)
- struct usb_softc *sc = device_get_softc(self);
- void *aux = device_get_ivars(self);
-#endif
- usbd_device_handle dev;
- usbd_status r;
-
-#if defined(__NetBSD__)
- printf("\n");
-#elif defined(__FreeBSD__)
- sc->sc_dev = self;
-#endif
-
- DPRINTF(("usbd_attach\n"));
- usbd_init();
- sc->sc_bus = aux;
- sc->sc_bus->usbctl = sc;
- sc->sc_running = 1;
- sc->sc_bus->use_polling = 1;
- sc->sc_port.power = USB_MAX_POWER;
- r = usbd_new_device(&sc->sc_dev, sc->sc_bus, 0, 0, 0, &sc->sc_port);
-
- if (r == USBD_NORMAL_COMPLETION) {
- dev = sc->sc_port.device;
- if (!dev->hub) {
- sc->sc_running = 0;
- printf("%s: root device is not a hub\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- sc->sc_bus->root_hub = dev;
- dev->hub->explore(sc->sc_bus->root_hub);
- } else {
- printf("%s: root hub problem, error=%d\n",
- USBDEVNAME(sc->sc_dev), r);
- sc->sc_running = 0;
- }
- sc->sc_bus->use_polling = 0;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__NetBSD__)
-int
-usbctlprint(aux, pnp)
- void *aux;
- const char *pnp;
-{
- /* only "usb"es can attach to host controllers */
- if (pnp)
- printf("usb at %s", pnp);
-
- return (UNCONF);
-}
-#endif
-
-int
-usbopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- USB_GET_SC_OPEN(usb, USBUNIT(dev), sc);
-
- if (sc == 0 || !sc->sc_running)
- return (ENXIO);
-
- return (0);
-}
-
-int
-usbclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- return (0);
-}
-
-int
-usbioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- USB_GET_SC(usb, USBUNIT(dev), sc);
-
- if (sc == 0 || !sc->sc_running)
- return (ENXIO);
- switch (cmd) {
-#ifdef USB_DEBUG
- case USB_SETDEBUG:
- usbdebug = uhcidebug = ohcidebug = *(int *)data;
- break;
-#endif
- case USB_DISCOVER:
- usb_discover(sc);
- break;
- case USB_REQUEST:
- {
- struct usb_ctl_request *ur = (void *)data;
- int len = UGETW(ur->request.wLength);
- struct iovec iov;
- struct uio uio;
- void *ptr = 0;
- int addr = ur->addr;
- usbd_status r;
- int error = 0;
-
- DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%d\n", addr, len));
- if (len < 0 || len > 32768)
- return (EINVAL);
- if (addr < 0 || addr >= USB_MAX_DEVICES ||
- sc->sc_bus->devices[addr] == 0)
- return (EINVAL);
- if (len != 0) {
- iov.iov_base = (caddr_t)ur->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw =
- ur->request.bmRequestType & UT_READ ?
- UIO_READ : UIO_WRITE;
- uio.uio_procp = p;
- ptr = malloc(len, M_TEMP, M_WAITOK);
- if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- r = usbd_do_request_flags(sc->sc_bus->devices[addr],
- &ur->request, ptr,
- ur->flags, &ur->actlen);
- if (r) {
- error = EIO;
- goto ret;
- }
- if (len != 0) {
- if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- ret:
- if (ptr)
- free(ptr, M_TEMP);
- return (error);
- }
-
- case USB_DEVICEINFO:
- {
- struct usb_device_info *di = (void *)data;
- int addr = di->addr;
- usbd_device_handle dev;
-
- if (addr < 1 || addr >= USB_MAX_DEVICES)
- return (EINVAL);
- dev = sc->sc_bus->devices[addr];
- if (dev == 0)
- return (ENXIO);
- usbd_fill_deviceinfo(dev, di);
- break;
- }
-
- case USB_DEVICESTATS:
- *(struct usb_device_stats *)data = sc->sc_bus->stats;
- break;
-
- default:
- return (ENXIO);
- }
- return (0);
-}
-
-int
-usbpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- int revents, s;
- USB_GET_SC(usb, USBUNIT(dev), sc);
-
- DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events));
- s = splusb();
- revents = 0;
- if (events & (POLLOUT | POLLWRNORM))
- if (sc->sc_bus->needs_explore)
- revents |= events & (POLLOUT | POLLWRNORM);
- DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents));
- if (revents == 0) {
- if (events & (POLLOUT | POLLWRNORM)) {
- DPRINTFN(2, ("usbpoll: selrecord\n"));
- selrecord(p, &sc->sc_consel);
- }
- }
- splx(s);
- return (revents);
-}
-
-#if 0
-int
-usb_bus_count()
-{
- int i, n;
-
- for (i = n = 0; i < usb_cd.cd_ndevs; i++)
- if (usb_cd.cd_devs[i])
- n++;
- return (n);
-}
-#endif
-
-#if defined(__NetBSD__)
-usbd_status
-usb_get_bus_handle(n, h)
- int n;
- usbd_bus_handle *h;
-{
- int i;
-
- for (i = 0; i < usb_cd.cd_ndevs; i++)
- if (usb_cd.cd_devs[i] && n-- == 0) {
- *h = usb_cd.cd_devs[i];
- return (USBD_NORMAL_COMPLETION);
- }
- return (USBD_INVAL);
-}
-#endif
-
-usbd_status
-usb_discover(sc)
- struct usb_softc *sc;
-{
- int s;
-
- /* Explore device tree from the root */
- /* We need mutual exclusion while traversing the device tree. */
- s = splusb();
- while (sc->sc_exploring)
- tsleep(&sc->sc_exploring, PRIBIO, "usbdis", 0);
- sc->sc_exploring = 1;
- sc->sc_bus->needs_explore = 0;
- splx(s);
-
- sc->sc_bus->root_hub->hub->explore(sc->sc_bus->root_hub);
-
- s = splusb();
- sc->sc_exploring = 0;
- wakeup(&sc->sc_exploring);
- splx(s);
- /* XXX should we start over if sc_needsexplore is set again? */
- return (0);
-}
-
-void
-usb_needs_explore(bus)
- usbd_bus_handle bus;
-{
- bus->needs_explore = 1;
- selwakeup(&bus->usbctl->sc_consel);
-}
-
-#if defined(__FreeBSD__)
-int
-usb_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return (0);
-}
-
-DRIVER_MODULE(usb, root, usb_driver, usb_devclass, 0, 0);
-#endif
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
deleted file mode 100644
index 17f0f0eeed71..000000000000
--- a/sys/dev/usb/usb.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/* $NetBSD: usb.h,v 1.17 1999/01/03 01:09:18 augustss Exp $ */
-/* FreeBSD $Id: usb.h,v 1.6 1999/01/07 23:31:37 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 _USB_H_
-#define _USB_H_
-
-#include <sys/types.h>
-#if defined(__NetBSD__)
-#include <sys/ioctl.h>
-#endif
-
-#if defined(__NetBSD__)
-#if defined(_KERNEL)
-#include <dev/usb/usb_port.h>
-#endif /* _KERNEL */
-
-#elif defined(__FreeBSD__)
-#include <sys/malloc.h>
-
-#if defined(KERNEL)
-MALLOC_DECLARE(M_USB);
-MALLOC_DECLARE(M_USBDEV);
-
-#include <dev/usb/usb_port.h>
-#endif /* KERNEL */
-#endif /* __FreeBSD__ */
-
-
-#define USB_MAX_DEVICES 128
-#define USB_START_ADDR 0
-
-#define USB_CONTROL_ENDPOINT 0
-#define USB_MAX_ENDPOINTS 16
-
-#define USB_FRAMES_PER_SECOND 1000
-
-/*
- * The USB records contain some unaligned little-endian word
- * components. The U[SG]ETW macros take care of both the alignment
- * and endian problem and should always be used to access 16 bit
- * values.
- */
-typedef u_int8_t uByte;
-typedef u_int8_t uWord[2];
-#define UGETW(w) ((w)[0] | ((w)[1] << 8))
-#define USETW(w,v) ((w)[0] = (u_int8_t)(v), (w)[1] = (u_int8_t)((v) >> 8))
-#define USETW2(w,h,l) ((w)[0] = (u_int8_t)(l), (w)[1] = (u_int8_t)(h))
-typedef u_int8_t uDWord[4];
-#define UGETDW(w) ((w)[0] | ((w)[1] << 8) | ((w)[2] << 16) | ((w)[3] << 24))
-#define USETDW(w,v) ((w)[0] = (u_int8_t)(v), \
- (w)[1] = (u_int8_t)((v) >> 8), \
- (w)[2] = (u_int8_t)((v) >> 16), \
- (w)[3] = (u_int8_t)((v) >> 24))
-/*
- * On little-endian machines that can handle unanliged accesses
- * (e.g. i386) these macros can be replaced by the following.
- */
-#if 0
-#define UGETW(w) (*(u_int16_t *)(w))
-#define USETW(w,v) (*(u_int16_t *)(w) = (v))
-#endif
-
-typedef struct {
- uByte bmRequestType;
- uByte bRequest;
- uWord wValue;
- uWord wIndex;
- uWord wLength;
-} usb_device_request_t;
-
-#define UT_WRITE 0x00
-#define UT_READ 0x80
-#define UT_STANDARD 0x00
-#define UT_CLASS 0x20
-#define UT_VENDOR 0x40
-#define UT_DEVICE 0x00
-#define UT_INTERFACE 0x01
-#define UT_ENDPOINT 0x02
-#define UT_OTHER 0x03
-
-#define UT_READ_DEVICE (UT_READ | UT_STANDARD | UT_DEVICE)
-#define UT_READ_INTERFACE (UT_READ | UT_STANDARD | UT_INTERFACE)
-#define UT_READ_ENDPOINT (UT_READ | UT_STANDARD | UT_ENDPOINT)
-#define UT_WRITE_DEVICE (UT_WRITE | UT_STANDARD | UT_DEVICE)
-#define UT_WRITE_INTERFACE (UT_WRITE | UT_STANDARD | UT_INTERFACE)
-#define UT_WRITE_ENDPOINT (UT_WRITE | UT_STANDARD | UT_ENDPOINT)
-#define UT_READ_CLASS_DEVICE (UT_READ | UT_CLASS | UT_DEVICE)
-#define UT_READ_CLASS_INTERFACE (UT_READ | UT_CLASS | UT_INTERFACE)
-#define UT_READ_CLASS_OTHER (UT_READ | UT_CLASS | UT_OTHER)
-#define UT_WRITE_CLASS_DEVICE (UT_WRITE | UT_CLASS | UT_DEVICE)
-#define UT_WRITE_CLASS_INTERFACE (UT_WRITE | UT_CLASS | UT_INTERFACE)
-#define UT_WRITE_CLASS_OTHER (UT_WRITE | UT_CLASS | UT_OTHER)
-#define UT_READ_VENDOR_DEVICE (UT_READ | UT_VENDOR | UT_DEVICE)
-#define UT_READ_VENDOR_INTERFACE (UT_READ | UT_VENDOR | UT_INTERFACE)
-#define UT_READ_VENDOR_OTHER (UT_READ | UT_VENDOR | UT_OTHER)
-#define UT_WRITE_VENDOR_DEVICE (UT_WRITE | UT_VENDOR | UT_DEVICE)
-#define UT_WRITE_VENDOR_INTERFACE (UT_WRITE | UT_VENDOR | UT_INTERFACE)
-#define UT_WRITE_VENDOR_OTHER (UT_WRITE | UT_VENDOR | UT_OTHER)
-
-/* Requests */
-#define UR_GET_STATUS 0x00
-#define UR_CLEAR_FEATURE 0x01
-#define UR_SET_FEATURE 0x03
-#define UR_SET_ADDRESS 0x05
-#define UR_GET_DESCRIPTOR 0x06
-#define UDESC_DEVICE 1
-#define UDESC_CONFIG 2
-#define UDESC_STRING 3
-#define UDESC_INTERFACE 4
-#define UDESC_ENDPOINT 5
-#define UR_SET_DESCRIPTOR 0x07
-#define UR_GET_CONFIG 0x08
-#define UR_SET_CONFIG 0x09
-#define UR_GET_INTERFACE 0x0a
-#define UR_SET_INTERFACE 0x0b
-#define UR_SYNCH_FRAME 0x0c
-
-/* Feature numbers */
-#define UF_ENDPOINT_HALT 0
-#define UF_DEVICE_REMOTE_WAKEUP 1
-
-#define USB_MAX_IPACKET 8 /* maximum size of the initial packet */
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
-} usb_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord bcdUSB;
- uByte bDeviceClass;
- uByte bDeviceSubClass;
- uByte bDeviceProtocol;
- uByte bMaxPacketSize;
- /* The fields below are not part of the initial descriptor. */
- uWord idVendor;
- uWord idProduct;
- uWord bcdDevice;
- uByte iManufacturer;
- uByte iProduct;
- uByte iSerialNumber;
- uByte bNumConfigurations;
-} usb_device_descriptor_t;
-#define USB_DEVICE_DESCRIPTOR_SIZE 18
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord wTotalLength;
- uByte bNumInterface;
- uByte bConfigurationValue;
- uByte iConfiguration;
- uByte bmAttributes;
-#define UC_BUS_POWERED 0x80
-#define UC_SELF_POWERED 0x40
-#define UC_REMOTE_WAKEUP 0x20
- uByte bMaxPower; /* max current in 2 mA units */
-#define UC_POWER_FACTOR 2
-} usb_config_descriptor_t;
-#define USB_CONFIG_DESCRIPTOR_SIZE 9
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bInterfaceNumber;
- uByte bAlternateSetting;
- uByte bNumEndpoints;
- uByte bInterfaceClass;
- uByte bInterfaceSubClass;
- uByte bInterfaceProtocol;
- uByte iInterface;
-} usb_interface_descriptor_t;
-#define USB_INTERFACE_DESCRIPTOR_SIZE 9
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bEndpointAddress;
-#define UE_IN 0x80
-#define UE_OUT 0x00
-#define UE_ADDR 0x0f
-#define UE_GET_ADDR(a) ((a) & UE_ADDR)
-#define UE_GET_IN(a) (((a) >> 7) & 1)
- uByte bmAttributes;
-#define UE_XFERTYPE 0x03
-#define UE_CONTROL 0x00
-#define UE_ISOCHRONOUS 0x01
-#define UE_BULK 0x02
-#define UE_INTERRUPT 0x03
-#define UE_ISO_TYPE 0x0c
-#define UE_ISO_ASYNC 0x04
-#define UE_ISO_ADAPT 0x08
-#define UE_ISO_SYNC 0x0c
- uWord wMaxPacketSize;
- uByte bInterval;
-} usb_endpoint_descriptor_t;
-#define USB_ENDPOINT_DESCRIPTOR_SIZE 7
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord bString[127];
-} usb_string_descriptor_t;
-#define USB_MAX_STRING_LEN 128
-#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
-
-/* Hub specific request */
-#define UR_GET_BUS_STATE 0x02
-
-/* Hub features */
-#define UHF_C_HUB_LOCAL_POWER 0
-#define UHF_C_HUB_OVER_CURRENT 1
-#define UHF_PORT_CONNECTION 0
-#define UHF_PORT_ENABLE 1
-#define UHF_PORT_SUSPEND 2
-#define UHF_PORT_OVER_CURRENT 3
-#define UHF_PORT_RESET 4
-#define UHF_PORT_POWER 8
-#define UHF_PORT_LOW_SPEED 9
-#define UHF_C_PORT_CONNECTION 16
-#define UHF_C_PORT_ENABLE 17
-#define UHF_C_PORT_SUSPEND 18
-#define UHF_C_PORT_OVER_CURRENT 19
-#define UHF_C_PORT_RESET 20
-
-typedef struct {
- uByte bDescLength;
- uByte bDescriptorType;
- uByte bNbrPorts;
- uWord wHubCharacteristics;
-#define UHD_PWR 0x03
-#define UHD_PWR_GANGED 0x00
-#define UHD_PWR_INDIVIDUAL 0x01
-#define UHD_PWR_NO_SWITCH 0x02
-#define UHD_COMPOUND 0x04
-#define UHD_OC 0x18
-#define UHD_OC_GLOBAL 0x00
-#define UHD_OC_INDIVIDUAL 0x08
-#define UHD_OC_NONE 0x10
- uByte bPwrOn2PwrGood; /* delay in 2 ms units */
-#define UHD_PWRON_FACTOR 2
- uByte bHubContrCurrent;
- uByte DeviceRemovable[32]; /* max 255 ports */
-#define UHD_NOT_REMOV(desc, i) \
- (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1)
- /* deprecated uByte PortPowerCtrlMask[]; */
-} usb_hub_descriptor_t;
-#define USB_HUB_DESCRIPTOR_SIZE 8
-
-typedef struct {
- uWord wStatus;
-/* Device status flags */
-#define UDS_SELF_POWERED 0x0001
-#define UDS_REMOTE_WAKEUP 0x0002
-/* Endpoint status flags */
-#define UES_HALT 0x0001
-} usb_status_t;
-
-typedef struct {
- uWord wHubStatus;
-#define UHS_LOCAL_POWER 0x0001
-#define UHS_OVER_CURRENT 0x0002
- uWord wHubChange;
-} usb_hub_status_t;
-
-typedef struct {
- uWord wPortStatus;
-#define UPS_CURRENT_CONNECT_STATUS 0x0001
-#define UPS_PORT_ENABLED 0x0002
-#define UPS_SUSPEND 0x0004
-#define UPS_OVERCURRENT_INDICATOR 0x0008
-#define UPS_RESET 0x0010
-#define UPS_PORT_POWER 0x0100
-#define UPS_LOW_SPEED 0x0200
- uWord wPortChange;
-#define UPS_C_CONNECT_STATUS 0x0001
-#define UPS_C_PORT_ENABLED 0x0002
-#define UPS_C_SUSPEND 0x0004
-#define UPS_C_OVERCURRENT_INDICATOR 0x0008
-#define UPS_C_PORT_RESET 0x0010
-} usb_port_status_t;
-
-#define UDESC_CS_DEVICE 0x21
-#define UDESC_CS_CONFIG 0x22
-#define UDESC_CS_STRING 0x23
-#define UDESC_CS_INTERFACE 0x24
-#define UDESC_CS_ENDPOINT 0x25
-
-#define UDESC_HUB 0x29
-
-#define UCLASS_UNSPEC 0
-#define UCLASS_AUDIO 1
-#define USUBCLASS_AUDIOCONTROL 1
-#define USUBCLASS_AUDIOSTREAM 2
-#define UCLASS_CDC 2 /* communication */
-#define USUBCLASS_ABSTRACT_CONTROL_MODEL 2
-#define UPROTO_CDC_AT 1
-#define UCLASS_HID 3
-#define USUBCLASS_BOOT 1
-#define UCLASS_PRINTER 7
-#define USUBCLASS_PRINTER 1
-#define UPROTO_PRINTER_UNI 1
-#define UPROTO_PRINTER_BI 2
-#define UCLASS_HUB 9
-#define USUBCLASS_HUB 0
-#define UCLASS_DATA 10
-
-#define USB_HUB_MAX_DEPTH 5
-
-/*
- * Minimum time a device needs to be powered down to go through
- * a power cycle. XXX Are these time in the spec?
- */
-#define USB_POWER_DOWN_TIME 200 /* ms */
-#define USB_PORT_POWER_DOWN_TIME 100 /* ms */
-
-#if 0
-/* These are the values from the spec. */
-#define USB_PORT_RESET_DELAY 10 /* ms */
-#define USB_PORT_RESET_SETTLE 10 /* ms */
-#define USB_PORT_POWERUP_DELAY 100 /* ms */
-#define USB_SET_ADDRESS_SETTLE 2 /* ms */
-#else
-/* Allow for marginal (i.e. non-conforming) devices. */
-#define USB_PORT_RESET_DELAY 20 /* ms */
-#define USB_PORT_RESET_RECOVERY 50 /* ms */
-#define USB_PORT_POWERUP_DELAY 200 /* ms */
-#define USB_SET_ADDRESS_SETTLE 10 /* ms */
-#endif
-
-#define USB_MIN_POWER 100 /* mA */
-#define USB_MAX_POWER 500 /* mA */
-
-
-#define USB_BUS_RESET_DELAY 100 /* ms XXX?*/
-#define USB_RESUME_DELAY 10 /* ms XXX?*/
-
-/*** ioctl() related stuff ***/
-
-struct usb_ctl_request {
- int addr;
- usb_device_request_t request;
- void *data;
- int flags;
-/* XXX must match flags in usbdi.h */
-#define USBD_SHORT_XFER_OK 0x04
- int actlen; /* actual length transferred */
-};
-
-struct usb_alt_interface {
- int config_index;
- int interface_index;
- int alt_no;
-};
-
-#define USB_CURRENT_CONFIG_INDEX (-1)
-#define USB_CURRENT_ALT_INDEX (-1)
-
-struct usb_config_desc {
- int config_index;
- usb_config_descriptor_t desc;
-};
-
-struct usb_interface_desc {
- int config_index;
- int interface_index;
- int alt_index;
- usb_interface_descriptor_t desc;
-};
-
-struct usb_endpoint_desc {
- int config_index;
- int interface_index;
- int alt_index;
- int endpoint_index;
- usb_endpoint_descriptor_t desc;
-};
-
-struct usb_full_desc {
- int config_index;
- u_int size;
- u_char *data;
-};
-
-struct usb_string_desc {
- int string_index;
- int language_id;
- usb_string_descriptor_t desc;
-};
-
-struct usb_ctl_report_desc {
- int size;
- u_char data[1024]; /* filled data size will vary */
-};
-
-struct usb_device_info {
- u_int8_t addr; /* device address */
- char product[USB_MAX_STRING_LEN];
- char vendor[USB_MAX_STRING_LEN];
- char revision[8];
- u_int16_t productNo;
- u_int16_t vendorNo;
- u_int8_t class;
- u_int8_t config;
- u_int8_t lowspeed;
- int power; /* power consumption in mA, 0 if selfpowered */
- int nports;
- u_int8_t ports[16];/* hub only: addresses of devices on ports */
-#define USB_PORT_ENABLED 0xff
-#define USB_PORT_SUSPENDED 0xfe
-#define USB_PORT_POWERED 0xfd
-#define USB_PORT_DISABLED 0xfc
-};
-
-struct usb_ctl_report {
- int report;
- u_char data[1024]; /* filled data size will vary */
-};
-
-struct usb_device_stats {
- u_long requests[4]; /* indexed by transfer type UE_* */
-};
-
-/* USB controller */
-#define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request)
-#define USB_SETDEBUG _IOW ('U', 2, int)
-#define USB_DISCOVER _IO ('U', 3)
-#define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info)
-#define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats)
-
-/* Generic HID device */
-#define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc)
-#define USB_SET_IMMED _IOW ('U', 22, int)
-#define USB_GET_REPORT _IOWR('U', 23, struct usb_ctl_report)
-
-/* Generic USB device */
-#define USB_GET_CONFIG _IOR ('U', 100, int)
-#define USB_SET_CONFIG _IOW ('U', 101, int)
-#define USB_GET_ALTINTERFACE _IOWR('U', 102, struct usb_alt_interface)
-#define USB_SET_ALTINTERFACE _IOWR('U', 103, struct usb_alt_interface)
-#define USB_GET_NO_ALT _IOWR('U', 104, struct usb_alt_interface)
-#define USB_GET_DEVICE_DESC _IOR ('U', 105, usb_device_descriptor_t)
-#define USB_GET_CONFIG_DESC _IOWR('U', 106, struct usb_config_desc)
-#define USB_GET_INTERFACE_DESC _IOWR('U', 107, struct usb_interface_desc)
-#define USB_GET_ENDPOINT_DESC _IOWR('U', 108, struct usb_endpoint_desc)
-#define USB_GET_FULL_DESC _IOWR('U', 109, struct usb_full_desc)
-#define USB_GET_STRING_DESC _IOWR('U', 110, struct usb_string_desc)
-#define USB_DO_REQUEST _IOWR('U', 111, struct usb_ctl_request)
-#define USB_GET_DEVICEINFO _IOR ('U', 112, struct usb_device_info)
-#define USB_SET_SHORT_XFER _IOW ('U', 113, int)
-
-#endif /* _USB_H_ */
diff --git a/sys/dev/usb/usb_if.m b/sys/dev/usb/usb_if.m
deleted file mode 100644
index fa5649c555da..000000000000
--- a/sys/dev/usb/usb_if.m
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (c) 1992-1998 Nick Hibma <hibma@skylink.it>
-# 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, immediately at the beginning of the file.
-# 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.
-#
-# 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.
-#
-# $Id$
-#
-
-# USB interface description
-#
-
-INTERFACE usb;
-
-# The device should start probing for new children again
-#
-METHOD int reconfigure {
- device_t dev;
-};
-
diff --git a/sys/dev/usb/usb_mem.h b/sys/dev/usb/usb_mem.h
deleted file mode 100644
index f6ffb9687945..000000000000
--- a/sys/dev/usb/usb_mem.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $NetBSD: usb_mem.h,v 1.4 1999/01/09 12:16:54 augustss Exp $ */
-/* FreeBSD $Id: usb_mem.h,v 1.4 1999/01/07 23:31:38 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-#if defined(__NetBSD__)
-typedef struct usb_block_dma {
- bus_dma_tag_t tag;
- bus_dmamap_t map;
- caddr_t kaddr;
- bus_dma_segment_t segs[1];
- int nsegs;
- size_t size;
- size_t align;
- int fullblock;
- LIST_ENTRY(usb_block_dma) next;
-} usb_dma_block_t;
-
-typedef struct {
- usb_dma_block_t *block;
- u_int offs;
-} usb_dma_t;
-
-#define DMAADDR(dma) ((dma)->block->segs[0].ds_addr + (dma)->offs)
-#define KERNADDR(dma) ((void *)((dma)->block->kaddr + (dma)->offs))
-
-usbd_status usb_allocmem __P((bus_dma_tag_t, size_t, size_t, usb_dma_t *));
-void usb_freemem __P((bus_dma_tag_t, usb_dma_t *));
-
-#elif defined(__FreeBSD__)
-
-/*
- * FreeBSD does not have special functions for dma memory, so let's keep it
- * simple for now.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/pmap.h> /* for vtophys */
-
-typedef void * usb_dma_t;
-
-#define usb_allocmem(t,s,a,p) (*(p) = malloc(s, M_USB, M_NOWAIT), (*(p) == NULL? USBD_NOMEM: USBD_NORMAL_COMPLETION))
-#define usb_freemem(t,p) (free(*(p), M_USB))
-
-#define DMAADDR(dma) (vtophys(*(dma)))
-#define KERNADDR(dma) ((void *) *(dma))
-#endif
-
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
deleted file mode 100644
index d7bd4f0040dd..000000000000
--- a/sys/dev/usb/usb_port.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $NetBSD: usb_port.h,v 1.5 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-
-/*
- * Macro's to cope with the differences between operating systems.
- */
-
-/*
- * NetBSD
- */
-
-#if defined(__NetBSD__)
-#include "opt_usbverbose.h"
-
-#define USBDEVNAME(bdev) ((bdev).dv_xname)
-
-typedef struct device bdevice; /* base device */
-
-#define usb_timeout(f, d, t, h) timeout((f), (d), (t))
-#define usb_untimeout(f, d, h) untimeout((f), (d))
-
-#define USB_DECLARE_DRIVER_INIT(dname, _2) \
-int __CONCAT(dname,_match) __P((struct device *, struct cfdata *, void *)); \
-void __CONCAT(dname,_attach) __P((struct device *, struct device *, void *)); \
-\
-extern struct cfdriver __CONCAT(dname,_cd); \
-\
-struct cfattach __CONCAT(dname,_ca) = { \
- sizeof(struct __CONCAT(dname,_softc)), \
- __CONCAT(dname,_match), \
- __CONCAT(dname,_attach) \
-}
-
-#define USB_MATCH(dname) \
-int \
-__CONCAT(dname,_match)(parent, match, aux) \
- struct device *parent; \
- struct cfdata *match; \
- void *aux;
-
-#define USB_MATCH_START(dname, uaa) \
- struct usb_attach_arg *uaa = aux
-
-#define USB_ATTACH(dname) \
-void \
-__CONCAT(dname,_attach)(parent, self, aux) \
- struct device *parent; \
- struct device *self; \
- void *aux;
-
-#define USB_ATTACH_START(dname, sc, uaa) \
- struct __CONCAT(dname,_softc) *sc = \
- (struct __CONCAT(dname,_softc) *)self; \
- struct usb_attach_arg *uaa = aux
-
-/* Returns from attach */
-#define USB_ATTACH_ERROR_RETURN return
-#define USB_ATTACH_SUCCESS_RETURN return
-
-#define USB_ATTACH_SETUP printf("\n")
-
-#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc; \
- if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
- return (ENXIO); \
- sc = __CONCAT(dname,_cd).cd_devs[unit]; \
- if (!sc) \
- return (ENXIO)
-
-#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = __CONCAT(dname,_cd).cd_devs[unit]
-
-#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
- ((dev)->softc = config_found_sm(parent, args, print, sub))
-
-
-
-
-#elif defined(__FreeBSD__)
-/*
- * FreeBSD
- */
-
-#include "opt_usb.h"
-/*
- * The following is not a type def to avoid error messages
- * because of includes in the wrong order.
- */
-#define bdevice device_t
-#define USBDEVNAME(bdev) usbd_devname(&bdev)
-
-/* XXX Change this when FreeBSD has memset
- */
-#define memset(d, v, s) \
- do{ \
- if ((v) == 0) \
- bzero((d), (s)); \
- else \
- panic("Non zero filler for memset, cannot handle!"); \
- } while (0)
-
-
-#define usb_timeout(f, d, t, h) ((h) = timeout((f), (d), (t)))
-#define usb_untimeout(f, d, h) untimeout((f), (d), (h))
-
-#define USB_DECLARE_DRIVER_INIT(dname, init...) \
-static device_probe_t __CONCAT(dname,_match); \
-static device_attach_t __CONCAT(dname,_attach); \
-static device_detach_t __CONCAT(dname,_detach); \
-\
-static devclass_t __CONCAT(dname,_devclass); \
-\
-static device_method_t __CONCAT(dname,_methods)[] = { \
- DEVMETHOD(device_probe, __CONCAT(dname,_match)), \
- DEVMETHOD(device_attach, __CONCAT(dname,_attach)), \
- DEVMETHOD(device_detach, __CONCAT(dname,_detach)), \
- init, \
- {0,0} \
-}; \
-\
-static driver_t __CONCAT(dname,_driver) = { \
- #dname, \
- __CONCAT(dname,_methods), \
- DRIVER_TYPE_MISC, \
- sizeof(struct __CONCAT(dname,_softc)) \
-}
-
-#define USB_MATCH(dname) \
-static int \
-__CONCAT(dname,_match)(device_t device)
-
-#define USB_MATCH_START(dname, uaa) \
- struct usb_attach_arg *uaa = device_get_ivars(device)
-
-#define USB_ATTACH(dname) \
-static int \
-__CONCAT(dname,_attach)(device_t self)
-
-#define USB_ATTACH_START(dname, sc, uaa) \
- struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
- struct usb_attach_arg *uaa = device_get_ivars(self)
-
-/* Returns from attach */
-#define USB_ATTACH_ERROR_RETURN return ENXIO
-#define USB_ATTACH_SUCCESS_RETURN return 0
-
-#define USB_ATTACH_SETUP \
- usbd_device_set_desc(self, devinfo); \
- sc->sc_dev = self
-
-#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit); \
- if (!sc) \
- return (ENXIO)
-
-#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit)
-
-#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
- (device_probe_and_attach((bdev)) == 0 ? ((dev)->softc = (bdev)) : 0)
-
-/* conversion from one type of queue to the other */
-#define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD_UNTIL
-#define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
-#define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
-#define SIMPLEQ_NEXT STAILQ_NEXT
-#define SIMPLEQ_FIRST STAILQ_FIRST
-#define SIMPLEQ_HEAD STAILQ_HEAD
-#define SIMPLEQ_INIT STAILQ_INIT
-#define SIMPLEQ_ENTRY STAILQ_ENTRY
-
-#endif /* __FreeBSD__ */
-
-
-
-#define USB_DECLARE_DRIVER(dname) \
- USB_DECLARE_DRIVER_INIT(dname, {0,0} )
diff --git a/sys/dev/usb/usb_quirks.c b/sys/dev/usb/usb_quirks.c
deleted file mode 100644
index e7c8208abce1..000000000000
--- a/sys/dev/usb/usb_quirks.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $NetBSD: usb_quirks.c,v 1.8 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: usb_quirks.c,v 1.5 1999/01/07 23:31:39 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-extern int usbdebug;
-#endif
-
-struct usbd_quirk_entry {
- u_int16_t idVendor;
- u_int16_t idProduct;
- u_int16_t bcdDevice;
- struct usbd_quirks quirks;
-} quirks[] = {
- { USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_NICHE, 0x100, { UQ_NO_SET_PROTO}},
- { USB_VENDOR_INSIDEOUT,USB_PRODUCT_INSIDEOUT_EDGEPORT4,
- 0x094, { UQ_SWAP_UNICODE}},
- { USB_VENDOR_UNIXTAR, USB_PRODUCT_UNIXTAR_UTUSB41, 0x100, { UQ_HUB_POWER }},
- { USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932, 0x100, { UQ_NO_STRINGS }},
- { USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET, 0x002, { UQ_NO_STRINGS }},
- { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1, 0x101, { UQ_NO_STRINGS }},
- { USB_VENDOR_JAZZ, USB_PRODUCT_JAZZ_J6502, 0x0a2, { UQ_BAD_ADC }},
- { 0, 0, 0, { 0 } }
-};
-
-struct usbd_quirks usbd_no_quirk = { 0 };
-
-struct usbd_quirks *
-usbd_find_quirk(d)
- usb_device_descriptor_t *d;
-{
- struct usbd_quirk_entry *t;
-
- for (t = quirks; t->idVendor != 0; t++) {
- if (t->idVendor == UGETW(d->idVendor) &&
- t->idProduct == UGETW(d->idProduct) &&
- t->bcdDevice == UGETW(d->bcdDevice))
- break;
- }
-#ifdef USB_DEBUG
- if (usbdebug && t->quirks.uq_flags)
- printf("usbd_find_quirk 0x%04x/0x%04x/%x: %d\n",
- UGETW(d->idVendor), UGETW(d->idProduct),
- UGETW(d->bcdDevice), t->quirks.uq_flags);
-#endif
- return (&t->quirks);
-}
diff --git a/sys/dev/usb/usb_quirks.h b/sys/dev/usb/usb_quirks.h
deleted file mode 100644
index 07935d58143f..000000000000
--- a/sys/dev/usb/usb_quirks.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $NetBSD: usb_quirks.h,v 1.5 1998/12/29 15:23:59 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-struct usbd_quirks {
- u_int32_t uq_flags; /* Device problems: */
-#define UQ_NO_SET_PROTO 0x01 /* cannot handle SET PROTOCOL. */
-#define UQ_SWAP_UNICODE 0x02 /* has some Unicode strings swapped. */
-#define UQ_HUB_POWER 0x04 /* does not respond correctly to get
- device status; use get hub status. */
-#define UQ_NO_STRINGS 0x08 /* string descriptors are broken. */
-#define UQ_BAD_ADC 0x10 /* bad audio spec version number. */
-};
-
-extern struct usbd_quirks usbd_no_quirk;
-
-struct usbd_quirks *usbd_find_quirk __P((usb_device_descriptor_t *));
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
deleted file mode 100644
index d903c0795164..000000000000
--- a/sys/dev/usb/usb_subr.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/* $NetBSD: usb_subr.c,v 1.27 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: usb_subr.c,v 1.6 1999/01/07 23:31:40 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/select.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-#define delay(d) DELAY(d)
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static usbd_status usbd_set_config __P((usbd_device_handle, int));
-char *usbd_get_string __P((usbd_device_handle, int, char *));
-int usbd_getnewaddr __P((usbd_bus_handle bus));
-#if defined(__NetBSD__)
-int usbd_print __P((void *aux, const char *pnp));
-int usbd_submatch __P((bdevice *, struct cfdata *cf, void *));
-#endif
-void usbd_free_iface_data __P((usbd_device_handle dev, int ifcno));
-void usbd_kill_pipe __P((usbd_pipe_handle));
-usbd_status usbd_probe_and_attach
- __P((bdevice *parent, usbd_device_handle dev, int port, int addr));
-
-
-#ifdef USBVERBOSE
-typedef u_int16_t usb_vendor_id_t;
-typedef u_int16_t usb_product_id_t;
-
-/*
- * Descriptions of of known vendors and devices ("products").
- */
-struct usb_knowndev {
- usb_vendor_id_t vendor;
- usb_product_id_t product;
- int flags;
- char *vendorname, *productname;
-};
-#define USB_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
-
-#include <dev/usb/usbdevs_data.h>
-#endif /* USBVERBOSE */
-
-#ifdef USB_DEBUG
-char *usbd_error_strs[] = {
- "NORMAL_COMPLETION",
- "IN_PROGRESS",
- "PENDING_REQUESTS",
- "NOT_STARTED",
- "INVAL",
- "IS_IDLE",
- "NOMEM",
- "CANCELLED",
- "BAD_ADDRESS",
- "IN_USE",
- "INTERFACE_NOT_ACTIVE",
- "NO_ADDR",
- "SET_ADDR_FAILED",
- "NO_POWER",
- "TOO_DEEP",
- "IOERROR",
- "NOT_CONFIGURED",
- "TIMEOUT",
- "SHORT_XFER",
- "STALLED",
- "XXX",
-};
-#endif
-
-usbd_status
-usbd_get_string_desc(dev, sindex, langid, sdesc)
- usbd_device_handle dev;
- int sindex;
- int langid;
- usb_string_descriptor_t *sdesc;
-{
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, UDESC_STRING, sindex);
- USETW(req.wIndex, langid);
- USETW(req.wLength, 1); /* only size byte first */
- r = usbd_do_request(dev, &req, sdesc);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- USETW(req.wLength, sdesc->bLength); /* the whole string */
- return (usbd_do_request(dev, &req, sdesc));
-}
-
-char *
-usbd_get_string(dev, si, buf)
- usbd_device_handle dev;
- int si;
- char *buf;
-{
- int swap = dev->quirks->uq_flags & UQ_SWAP_UNICODE;
- usb_string_descriptor_t us;
- char *s;
- int i, n;
- u_int16_t c;
- usbd_status r;
-
- if (si == 0)
- return (0);
- if (dev->quirks->uq_flags & UQ_NO_STRINGS)
- return (0);
- if (dev->langid == USBD_NOLANG) {
- /* Set up default language */
- r = usbd_get_string_desc(dev, USB_LANGUAGE_TABLE, 0, &us);
- if (r != USBD_NORMAL_COMPLETION || us.bLength < 4) {
- dev->langid = 0; /* Well, just pick English then */
- } else {
- /* Pick the first language as the default. */
- dev->langid = UGETW(us.bString[0]);
- }
- }
- r = usbd_get_string_desc(dev, si, dev->langid, &us);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- s = buf;
- n = us.bLength / 2 - 1;
- for (i = 0; i < n; i++) {
- c = UGETW(us.bString[i]);
- /* Convert from Unicode, handle buggy strings. */
- if ((c & 0xff00) == 0)
- *s++ = c;
- else if ((c & 0x00ff) == 0 && swap)
- *s++ = c >> 8;
- else
- *s++ = '?';
- }
- *s++ = 0;
- return buf;
-}
-
-void
-usbd_devinfo_vp(dev, v, p)
- usbd_device_handle dev;
- char *v, *p;
-{
- usb_device_descriptor_t *udd = &dev->ddesc;
- char *vendor = 0, *product = 0;
-#ifdef USBVERBOSE
- struct usb_knowndev *kdp;
-#endif
-
- vendor = usbd_get_string(dev, udd->iManufacturer, v);
- product = usbd_get_string(dev, udd->iProduct, p);
-#ifdef USBVERBOSE
- if (!vendor) {
- for(kdp = usb_knowndevs;
- kdp->vendorname != NULL;
- kdp++) {
- if (kdp->vendor == UGETW(udd->idVendor) &&
- (kdp->product == UGETW(udd->idProduct) ||
- (kdp->flags & USB_KNOWNDEV_NOPROD) != 0))
- break;
- }
- if (kdp->vendorname == NULL)
- vendor = product = NULL;
- else {
- vendor = kdp->vendorname;
- product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ?
- kdp->productname : NULL;
- }
- }
-#endif
- if (vendor)
- strcpy(v, vendor);
- else
- sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor));
- if (product)
- strcpy(p, product);
- else
- sprintf(p, "product 0x%04x", UGETW(udd->idProduct));
-}
-
-int
-usbd_printBCD(cp, bcd)
- char *cp;
- int bcd;
-{
- return (sprintf(cp, "%x.%02x", bcd >> 8, bcd & 0xff));
-}
-
-void
-usbd_devinfo(dev, showclass, cp)
- usbd_device_handle dev;
- int showclass;
- char *cp;
-{
- usb_device_descriptor_t *udd = &dev->ddesc;
- char vendor[USB_MAX_STRING_LEN];
- char product[USB_MAX_STRING_LEN];
- int bcdDevice, bcdUSB;
-
- usbd_devinfo_vp(dev, vendor, product);
- cp += sprintf(cp, "%s %s", vendor, product);
- if (showclass)
- cp += sprintf(cp, ", class %d/%d",
- udd->bDeviceClass, udd->bDeviceSubClass);
- bcdUSB = UGETW(udd->bcdUSB);
- bcdDevice = UGETW(udd->bcdDevice);
- cp += sprintf(cp, ", rev ");
- cp += usbd_printBCD(cp, bcdUSB);
- *cp++ = '/';
- cp += usbd_printBCD(cp, bcdDevice);
- cp += sprintf(cp, ", addr %d", dev->address);
- *cp = 0;
-}
-
-/* Delay for a certain number of ms */
-void
-usb_delay_ms(bus, ms)
- usbd_bus_handle bus;
- u_int ms;
-{
- /* Wait at least two clock ticks so we know the time has passed. */
- if (bus->use_polling)
- delay((ms+1) * 1000);
- else
- tsleep(&ms, PRIBIO, "usbdly", (ms*hz+999)/1000 + 1);
-}
-
-/* Delay given a device handle. */
-void
-usbd_delay_ms(dev, ms)
- usbd_device_handle dev;
- u_int ms;
-{
- usb_delay_ms(dev->bus, ms);
-}
-
-usbd_status
-usbd_reset_port(dev, port, ps)
- usbd_device_handle dev;
- int port;
- usb_port_status_t *ps;
-{
- usb_device_request_t req;
- usbd_status r;
- int n;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SET_FEATURE;
- USETW(req.wValue, UHF_PORT_RESET);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- r = usbd_do_request(dev, &req, 0);
- DPRINTFN(1,("usbd_reset_port: port %d reset done, error=%d(%s)\n",
- port, r, usbd_error_strs[r]));
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- n = 10;
- do {
- /* Wait for device to recover from reset. */
- usbd_delay_ms(dev, USB_PORT_RESET_DELAY);
- r = usbd_get_port_status(dev, port, ps);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_reset_port: get status failed %d\n",r));
- return (r);
- }
- } while ((UGETW(ps->wPortChange) & UPS_C_PORT_RESET) == 0 && --n > 0);
- if (n == 0) {
- printf("usbd_reset_port: timeout\n");
- return (USBD_IOERROR);
- }
- r = usbd_clear_port_feature(dev, port, UHF_C_PORT_RESET);
-#ifdef USB_DEBUG
- if (r != USBD_NORMAL_COMPLETION)
- DPRINTF(("usbd_reset_port: clear port feature failed %d\n",r));
-#endif
-
- /* Wait for the device to recover from reset. */
- usbd_delay_ms(dev, USB_PORT_RESET_RECOVERY);
- return (r);
-}
-
-usb_interface_descriptor_t *
-usbd_find_idesc(cd, ifaceidx, altidx)
- usb_config_descriptor_t *cd;
- int ifaceidx;
- int altidx;
-{
- char *p = (char *)cd;
- char *end = p + UGETW(cd->wTotalLength);
- usb_interface_descriptor_t *d;
- int curidx, lastidx, curaidx = 0;
-
- for (curidx = lastidx = -1; p < end; ) {
- d = (usb_interface_descriptor_t *)p;
- DPRINTFN(4,("usbd_find_idesc: idx=%d(%d) altidx=%d(%d) len=%d "
- "type=%d\n",
- ifaceidx, curidx, altidx, curaidx,
- d->bLength, d->bDescriptorType));
- if (d->bLength == 0) /* bad descriptor */
- break;
- p += d->bLength;
- if (p <= end && d->bDescriptorType == UDESC_INTERFACE) {
- if (d->bInterfaceNumber != lastidx) {
- lastidx = d->bInterfaceNumber;
- curidx++;
- curaidx = 0;
- } else
- curaidx++;
- if (ifaceidx == curidx && altidx == curaidx)
- return (d);
- }
- }
- return (0);
-}
-
-usb_endpoint_descriptor_t *
-usbd_find_edesc(cd, ifaceidx, altidx, endptidx)
- usb_config_descriptor_t *cd;
- int ifaceidx;
- int altidx;
- int endptidx;
-{
- char *p = (char *)cd;
- char *end = p + UGETW(cd->wTotalLength);
- usb_interface_descriptor_t *d;
- usb_endpoint_descriptor_t *e;
- int curidx;
-
- d = usbd_find_idesc(cd, ifaceidx, altidx);
- if (!d)
- return (0);
- if (endptidx >= d->bNumEndpoints) /* quick exit */
- return (0);
-
- curidx = -1;
- for (p = (char *)d + d->bLength; p < end; ) {
- e = (usb_endpoint_descriptor_t *)p;
- if (e->bLength == 0) /* bad descriptor */
- break;
- p += e->bLength;
- if (p <= end && e->bDescriptorType == UDESC_INTERFACE)
- return (0);
- if (p <= end && e->bDescriptorType == UDESC_ENDPOINT) {
- curidx++;
- if (curidx == endptidx)
- return (e);
- }
- }
- return (0);
-}
-
-usbd_status
-usbd_fill_iface_data(dev, ifaceidx, altidx)
- usbd_device_handle dev;
- int ifaceidx;
- int altidx;
-{
- usbd_interface_handle ifc = &dev->ifaces[ifaceidx];
- char *p, *end;
- int endpt, nendpt;
-
- DPRINTFN(4,("usbd_fill_iface_data: ifaceidx=%d altidx=%d\n",
- ifaceidx, altidx));
- ifc->device = dev;
- ifc->idesc = usbd_find_idesc(dev->cdesc, ifaceidx, altidx);
- if (ifc->idesc == 0)
- return (USBD_INVAL);
- ifc->index = ifaceidx;
- ifc->altindex = altidx;
- nendpt = ifc->idesc->bNumEndpoints;
- DPRINTFN(10,("usbd_fill_iface_data: found idesc n=%d\n", nendpt));
- if (nendpt != 0) {
- ifc->endpoints = malloc(nendpt * sizeof(struct usbd_endpoint),
- M_USB, M_NOWAIT);
- if (ifc->endpoints == 0)
- return (USBD_NOMEM);
- } else
- ifc->endpoints = 0;
- ifc->priv = 0;
- p = (char *)ifc->idesc + ifc->idesc->bLength;
- end = (char *)dev->cdesc + UGETW(dev->cdesc->wTotalLength);
-#define ed ((usb_endpoint_descriptor_t *)p)
- for (endpt = 0; endpt < nendpt; endpt++) {
- DPRINTFN(10,("usbd_fill_iface_data: endpt=%d\n", endpt));
- for (; p < end; p += ed->bLength) {
- ed = (usb_endpoint_descriptor_t *)p;
- DPRINTFN(10,("usbd_fill_iface_data: p=%p end=%p "
- "len=%d type=%d\n",
- p, end, ed->bLength, ed->bDescriptorType));
- if (p + ed->bLength <= end && ed->bLength != 0 &&
- ed->bDescriptorType == UDESC_ENDPOINT)
- goto found;
- if (ed->bDescriptorType == UDESC_INTERFACE ||
- ed->bLength == 0)
- break;
- }
- /* passed end, or bad desc */
- goto bad;
- found:
- ifc->endpoints[endpt].edesc = ed;
- ifc->endpoints[endpt].state = USBD_ENDPOINT_ACTIVE;
- ifc->endpoints[endpt].refcnt = 0;
- ifc->endpoints[endpt].toggle = 0;
- p += ed->bLength;
- }
-#undef ed
- LIST_INIT(&ifc->pipes);
- ifc->state = USBD_INTERFACE_ACTIVE;
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- free(ifc->endpoints, M_USB);
- return (USBD_INVAL);
-}
-
-void
-usbd_free_iface_data(dev, ifcno)
- usbd_device_handle dev;
- int ifcno;
-{
- usbd_interface_handle ifc = &dev->ifaces[ifcno];
- if (ifc->endpoints)
- free(ifc->endpoints, M_USB);
-}
-
-static usbd_status
-usbd_set_config(dev, conf)
- usbd_device_handle dev;
- int conf;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_DEVICE;
- req.bRequest = UR_SET_CONFIG;
- USETW(req.wValue, conf);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_config_no(dev, no, msg)
- usbd_device_handle dev;
- int no;
- int msg;
-{
- int index;
- usb_config_descriptor_t cd;
- usbd_status r;
-
- DPRINTFN(5,("usbd_set_config_no: %d\n", no));
- /* Figure out what config index to use. */
- for (index = 0; index < dev->ddesc.bNumConfigurations; index++) {
- r = usbd_get_config_desc(dev, index, &cd);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (cd.bConfigurationValue == no)
- return (usbd_set_config_index(dev, index, msg));
- }
- return (USBD_INVAL);
-}
-
-usbd_status
-usbd_set_config_index(dev, index, msg)
- usbd_device_handle dev;
- int index;
- int msg;
-{
- usb_status_t ds;
- usb_hub_status_t hs;
- usb_config_descriptor_t cd, *cdp;
- usbd_status r;
- int ifcidx, nifc, len, selfpowered, power;
-
- DPRINTFN(5,("usbd_set_config_index: dev=%p index=%d\n", dev, index));
-
- /* XXX check that all interfaces are idle */
- if (dev->config != 0) {
- DPRINTF(("usbd_set_config_index: free old config\n"));
- /* Free all configuration data structures. */
- nifc = dev->cdesc->bNumInterface;
- for (ifcidx = 0; ifcidx < nifc; ifcidx++)
- usbd_free_iface_data(dev, ifcidx);
- free(dev->ifaces, M_USB);
- free(dev->cdesc, M_USB);
- dev->ifaces = 0;
- dev->cdesc = 0;
- dev->config = 0;
- dev->state = USBD_DEVICE_ADDRESSED;
- }
-
- /* Figure out what config number to use. */
- r = usbd_get_config_desc(dev, index, &cd);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- len = UGETW(cd.wTotalLength);
- cdp = malloc(len, M_USB, M_NOWAIT);
- if (cdp == 0)
- return (USBD_NOMEM);
- r = usbd_get_desc(dev, UDESC_CONFIG, index, len, cdp);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- if (cdp->bDescriptorType != UDESC_CONFIG) {
- DPRINTFN(-1,("usbd_set_config_index: bad desc %d\n",
- cdp->bDescriptorType));
- r = USBD_INVAL;
- goto bad;
- }
- selfpowered = 0;
- if (cdp->bmAttributes & UC_SELF_POWERED) {
- /* May be self powered. */
- if (cdp->bmAttributes & UC_BUS_POWERED) {
- /* Must ask device. */
- if (dev->quirks->uq_flags & UQ_HUB_POWER) {
- /* Buggy hub, use hub descriptor. */
- r = usbd_get_hub_status(dev, &hs);
- if (r == USBD_NORMAL_COMPLETION &&
- !(UGETW(hs.wHubStatus) & UHS_LOCAL_POWER))
- selfpowered = 1;
- } else {
- r = usbd_get_device_status(dev, &ds);
- if (r == USBD_NORMAL_COMPLETION &&
- (UGETW(ds.wStatus) & UDS_SELF_POWERED))
- selfpowered = 1;
- }
- DPRINTF(("usbd_set_config_index: status=0x%04x, "
- "error=%d(%s)\n",
- UGETW(ds.wStatus), r, usbd_error_strs[r]));
- } else
- selfpowered = 1;
- }
- DPRINTF(("usbd_set_config_index: (addr %d) attr=0x%02x, "
- "selfpowered=%d, power=%d, powerquirk=%x\n",
- dev->address, cdp->bmAttributes,
- selfpowered, cdp->bMaxPower * 2,
- dev->quirks->uq_flags & UQ_HUB_POWER));
-#ifdef USB_DEBUG
- if (!dev->powersrc) {
- printf("usbd_set_config_index: No power source?\n");
- return (USBD_IOERROR);
- }
-#endif
- power = cdp->bMaxPower * 2;
- if (power > dev->powersrc->power) {
- /* XXX print nicer message. */
- if (msg)
- printf("%s: device addr %d (config %d) exceeds power "
- "budget, %d mA > %d mA\n",
- USBDEVNAME(dev->bus->bdev), dev->address,
- cdp->bConfigurationValue,
- power, dev->powersrc->power);
- r = USBD_NO_POWER;
- goto bad;
- }
- dev->power = power;
- dev->self_powered = selfpowered;
-
- DPRINTF(("usbd_set_config_index: set config %d\n",
- cdp->bConfigurationValue));
- r = usbd_set_config(dev, cdp->bConfigurationValue);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_set_config_index: setting config=%d failed, "
- "error=%d(%s)\n",
- cdp->bConfigurationValue, r, usbd_error_strs[r]));
- goto bad;
- }
- DPRINTF(("usbd_set_config_index: setting new config %d\n",
- cdp->bConfigurationValue));
- nifc = cdp->bNumInterface;
- dev->ifaces = malloc(nifc * sizeof(struct usbd_interface),
- M_USB, M_NOWAIT);
- if (dev->ifaces == 0) {
- r = USBD_NOMEM;
- goto bad;
- }
- DPRINTFN(5,("usbd_set_config_index: dev=%p cdesc=%p\n", dev, cdp));
- dev->cdesc = cdp;
- dev->config = cdp->bConfigurationValue;
- dev->state = USBD_DEVICE_CONFIGURED;
- for (ifcidx = 0; ifcidx < nifc; ifcidx++) {
- r = usbd_fill_iface_data(dev, ifcidx, 0);
- if (r != USBD_NORMAL_COMPLETION) {
- while (--ifcidx >= 0)
- usbd_free_iface_data(dev, ifcidx);
- goto bad;
- }
- }
-
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- free(cdp, M_USB);
- return (r);
-}
-
-/* XXX add function for alternate settings */
-
-usbd_status
-usbd_setup_pipe(dev, iface, ep, pipe)
- usbd_device_handle dev;
- usbd_interface_handle iface;
- struct usbd_endpoint *ep;
- usbd_pipe_handle *pipe;
-{
- usbd_pipe_handle p;
- usbd_status r;
-
- DPRINTFN(1,("usbd_setup_pipe: dev=%p iface=%p ep=%p pipe=%p\n",
- dev, iface, ep, pipe));
- p = malloc(dev->bus->pipe_size, M_USB, M_NOWAIT);
- if (p == 0)
- return (USBD_NOMEM);
- p->device = dev;
- p->iface = iface;
- p->state = USBD_PIPE_ACTIVE;
- p->endpoint = ep;
- ep->refcnt++;
- p->refcnt = 1;
- p->intrreqh = 0;
- p->running = 0;
- SIMPLEQ_INIT(&p->queue);
- r = dev->bus->open_pipe(p);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("usbd_setup_pipe: endpoint=0x%x failed, error=%d"
- "(%s)\n",
- ep->edesc->bEndpointAddress, r, usbd_error_strs[r]));
- free(p, M_USB);
- return (r);
- }
- *pipe = p;
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Abort the device control pipe. */
-void
-usbd_kill_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->methods->close(pipe);
- pipe->endpoint->refcnt--;
- free(pipe, M_USB);
-}
-
-int
-usbd_getnewaddr(bus)
- usbd_bus_handle bus;
-{
- int addr;
-
- for (addr = 1; addr < USB_MAX_DEVICES; addr++)
- if (bus->devices[addr] == 0)
- return (addr);
- return (-1);
-}
-
-
-usbd_status
-usbd_probe_and_attach(parent, dev, port, addr)
- bdevice *parent;
- usbd_device_handle dev;
- int port;
- int addr;
-{
- struct usb_attach_arg uaa;
- usb_device_descriptor_t *dd = &dev->ddesc;
- int r, found, i, confi, nifaces;
- usbd_interface_handle ifaces[256]; /* 256 is the absolute max */
-
-#if defined(__FreeBSD__)
-/* XXX uaa is a static var. Not a problem as it _should_ be used only
- * during probe and attach. Should be changed however
- */
- bdevice bdev;
- bdev = device_add_child(*parent, NULL, -1, &uaa);
- if (!bdev) {
- printf("%s: Device creation failed\n", USBDEVNAME(dev->bus->bdev));
- return (USBD_INVAL);
- }
-#endif
-
- uaa.device = dev;
- uaa.iface = 0;
- uaa.ifaces = 0;
- uaa.nifaces = 0;
- uaa.usegeneric = 0;
- uaa.port = port;
- uaa.configno = UHUB_UNK_CONFIGURATION;
- uaa.ifaceno = UHUB_UNK_INTERFACE;
-
- /* First try with device specific drivers. */
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch))
- return (USBD_NORMAL_COMPLETION);
-
- DPRINTF(("usbd_probe_and_attach: no device specific driver found\n"));
-
- /* Next try with interface drivers. */
- for (confi = 0; confi < dd->bNumConfigurations; confi++) {
- DPRINTFN(1,("usbd_probe_and_attach: trying config idx=%d\n",
- confi));
- r = usbd_set_config_index(dev, confi, 1);
- if (r != USBD_NORMAL_COMPLETION) {
-#ifdef USB_DEBUG
- DPRINTF(("%s: port %d, set config at addr %d failed, "
- "error=%d(%s)\n", USBDEVNAME(*parent), port,
- addr, r, usbd_error_strs[r]));
-#else
- printf("%s: port %d, set config at addr %d failed\n",
- USBDEVNAME(*parent), port, addr);
-#endif
-#if defined(__FreeBSD__)
- device_delete_child(*parent, bdev);
-#endif
- return (r);
- }
- nifaces = dev->cdesc->bNumInterface;
- uaa.configno = dev->cdesc->bConfigurationValue;
- for (i = 0; i < nifaces; i++)
- ifaces[i] = &dev->ifaces[i];
- uaa.ifaces = ifaces;
- uaa.nifaces = nifaces;
- for (found = i = 0; i < nifaces; i++) {
- if (!ifaces[i])
- continue; /* interface already claimed */
- uaa.iface = ifaces[i];
- uaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print,
- usbd_submatch)) {
- found++;
- ifaces[i] = 0; /* consumed */
- }
- }
- if (found != 0)
- return (USBD_NORMAL_COMPLETION);
- }
- /* No interfaces were attached in any of the configurations. */
- if (dd->bNumConfigurations > 1)/* don't change if only 1 config */
- usbd_set_config_index(dev, 0, 0);
-
- DPRINTF(("usbd_probe_and_attach: no interface drivers found\n"));
-
- /* Finally try the generic driver. */
- uaa.iface = 0;
- uaa.usegeneric = 1;
- uaa.configno = UHUB_UNK_CONFIGURATION;
- uaa.ifaceno = UHUB_UNK_INTERFACE;
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch))
- return (USBD_NORMAL_COMPLETION);
-
- /*
- * The generic attach failed, but leave the device as it is.
- * We just did not find any drivers, that's all. The device is
- * fully operational and not harming anyone.
- */
- DPRINTF(("usbd_probe_and_attach: generic attach failed\n"));
-#if defined(__FreeBSD__)
-/*
- * XXX should we delete the child again? Left for now to avoid dangling
- * references.
- device_delete_child(*parent, bdev);
-*/
-#endif
- return (USBD_NORMAL_COMPLETION);
-}
-
-
-
-/*
- * Called when a new device has been put in the powered state,
- * but not yet in the addressed state.
- * Get initial descriptor, set the address, get full descriptor,
- * and attach a driver.
- */
-usbd_status
-usbd_new_device(parent, bus, depth, lowspeed, port, up)
- bdevice *parent;
- usbd_bus_handle bus;
- int depth;
- int lowspeed;
- int port;
- struct usbd_port *up;
-{
- usbd_device_handle dev;
- usb_device_descriptor_t *dd;
- usbd_status r;
- int addr;
- int i;
-
- DPRINTF(("usbd_new_device bus=%p depth=%d lowspeed=%d\n",
- bus, depth, lowspeed));
- addr = usbd_getnewaddr(bus);
- if (addr < 0) {
- printf("%s: No free USB addresses, new device ignored.\n",
- USBDEVNAME(bus->bdev));
- return (USBD_NO_ADDR);
- }
-
- dev = malloc(sizeof *dev, M_USB, M_NOWAIT);
- if (dev == 0)
- return (USBD_NOMEM);
- memset(dev, 0, sizeof(*dev));
-
- dev->bus = bus;
-
- /* Set up default endpoint handle. */
- dev->def_ep.edesc = &dev->def_ep_desc;
- dev->def_ep.state = USBD_ENDPOINT_ACTIVE;
-
- /* Set up default endpoint descriptor. */
- dev->def_ep_desc.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE;
- dev->def_ep_desc.bDescriptorType = UDESC_ENDPOINT;
- dev->def_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT;
- dev->def_ep_desc.bmAttributes = UE_CONTROL;
- USETW(dev->def_ep_desc.wMaxPacketSize, USB_MAX_IPACKET);
- dev->def_ep_desc.bInterval = 0;
-
- dev->state = USBD_DEVICE_DEFAULT;
- dev->quirks = &usbd_no_quirk;
- dev->address = USB_START_ADDR;
- dev->ddesc.bMaxPacketSize = 0;
- dev->lowspeed = lowspeed != 0;
- dev->depth = depth;
- dev->powersrc = up;
- dev->langid = USBD_NOLANG;
-
- /* Establish the the default pipe. */
- r = usbd_setup_pipe(dev, 0, &dev->def_ep, &dev->default_pipe);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_remove_device(dev, up);
- return (r);
- }
-
- up->device = dev;
- dd = &dev->ddesc;
- /* Try a few times in case the device is slow (i.e. outside specs.) */
- for (i = 0; i < 5; i++) {
- /* Get the first 8 bytes of the device descriptor. */
- r = usbd_get_desc(dev, UDESC_DEVICE, 0, USB_MAX_IPACKET, dd);
- if (r == USBD_NORMAL_COMPLETION)
- break;
- usbd_delay_ms(dev, 200);
- }
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc "
- "failed\n",
- addr));
- usbd_remove_device(dev, up);
- return (r);
- }
-
- if (dd->bDescriptorType != UDESC_DEVICE) {
- /* Illegal device descriptor */
- DPRINTFN(-1,("usbd_new_device: illegal descriptor %d\n",
- dd->bDescriptorType));
- usbd_remove_device(dev, up);
- return (USBD_INVAL);
- }
-
- DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, "
- "subclass=%d, protocol=%d, maxpacket=%d, ls=%d\n",
- addr,UGETW(dd->bcdUSB), dd->bDeviceClass, dd->bDeviceSubClass,
- dd->bDeviceProtocol, dd->bMaxPacketSize, dev->lowspeed));
-
- USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);
-
- /* Get the full device descriptor. */
- r = usbd_get_device_desc(dev, dd);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
- "failed\n", addr));
- usbd_remove_device(dev, up);
- return (r);
- }
-
- /* Figure out what's wrong with this device. */
- dev->quirks = usbd_find_quirk(dd);
-
- /* Set the address */
- r = usbd_set_address(dev, addr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("usb_new_device: set address %d failed\n",addr));
- r = USBD_SET_ADDR_FAILED;
- usbd_remove_device(dev, up);
- return (r);
- }
- /* Allow device time to set new address */
- usbd_delay_ms(dev, USB_SET_ADDRESS_SETTLE);
-
- dev->address = addr; /* New device address now */
- dev->state = USBD_DEVICE_ADDRESSED;
- bus->devices[addr] = dev;
-
- /* Assume 100mA bus powered for now. Changed when configured. */
- dev->power = USB_MIN_POWER;
- dev->self_powered = 0;
-
- DPRINTF(("usbd_new_device: new dev (addr %d), dev=%p, parent=%p\n",
- addr, dev, parent));
-
- r = usbd_probe_and_attach(parent, dev, port, addr);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_remove_device(dev, up);
- return (r);
- }
-
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-usbd_remove_device(dev, up)
- usbd_device_handle dev;
- struct usbd_port *up;
-{
- DPRINTF(("usbd_remove_device: %p\n", dev));
-
- if (dev->default_pipe)
- usbd_kill_pipe(dev->default_pipe);
- up->device = 0;
- dev->bus->devices[dev->address] = 0;
-
- free(dev, M_USB);
-}
-
-#if defined(__NetBSD__)
-int
-usbd_print(aux, pnp)
- void *aux;
- const char *pnp;
-{
- struct usb_attach_arg *uaa = aux;
- char devinfo[1024];
-
- DPRINTFN(15, ("usbd_print dev=%p\n", uaa->device));
- if (pnp) {
- if (!uaa->usegeneric)
- return (QUIET);
- usbd_devinfo(uaa->device, 1, devinfo);
- printf("%s, %s", devinfo, pnp);
- }
- if (uaa->port != 0)
- printf(" port %d", uaa->port);
- if (uaa->configno != UHUB_UNK_CONFIGURATION)
- printf(" configuration %d", uaa->configno);
- if (uaa->ifaceno != UHUB_UNK_INTERFACE)
- printf(" interface %d", uaa->ifaceno);
- return (UNCONF);
-}
-
-int
-usbd_submatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct usb_attach_arg *uaa = aux;
-
- if ((uaa->port != 0 &&
- cf->uhubcf_port != UHUB_UNK_PORT &&
- cf->uhubcf_port != uaa->port) ||
- (uaa->configno != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != uaa->configno) ||
- (uaa->ifaceno != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != uaa->ifaceno))
- return 0;
- return ((*cf->cf_attach->ca_match)(parent, cf, aux));
-}
-#endif
-
-usbd_status
-usb_insert_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- usbd_interface_handle iface = pipe->iface;
-
- if (pipe->state == USBD_PIPE_IDLE ||
- (iface && iface->state == USBD_INTERFACE_IDLE))
- return (USBD_IS_IDLE);
- SIMPLEQ_INSERT_TAIL(&pipe->queue, reqh, next);
- if (pipe->state != USBD_PIPE_ACTIVE ||
- (iface && iface->state != USBD_INTERFACE_ACTIVE))
- return (USBD_NOT_STARTED);
- if (pipe->running)
- return (USBD_IN_PROGRESS);
- pipe->running = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-usb_start_next(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
-#ifdef DIAGNOSTIC
- if (SIMPLEQ_FIRST(&pipe->queue) == 0) {
- printf("usb_start_next: empty\n");
- return;
- }
-#endif
-
- /* First remove remove old */
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, SIMPLEQ_FIRST(&pipe->queue), next);
- if (pipe->state != USBD_PIPE_ACTIVE) {
- pipe->running = 0;
- return;
- }
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- DPRINTFN(5, ("usb_start_next: start reqh=%p\n", reqh));
- if (!reqh)
- pipe->running = 0;
- else {
- r = pipe->methods->start(reqh);
- if (r != USBD_IN_PROGRESS) {
- printf("usb_start_next: error=%d\n", r);
- pipe->running = 0;
- /* XXX do what? */
- }
- }
-}
-
-void
-usbd_fill_deviceinfo(dev, di)
- usbd_device_handle dev;
- struct usb_device_info *di;
-{
- struct usbd_port *p;
- int i, r, s;
-
- di->config = dev->config;
- usbd_devinfo_vp(dev, di->vendor, di->product);
- usbd_printBCD(di->revision, UGETW(dev->ddesc.bcdDevice));
- di->vendorNo = UGETW(dev->ddesc.idVendor);
- di->productNo = UGETW(dev->ddesc.idProduct);
- di->class = dev->ddesc.bDeviceClass;
- di->power = dev->self_powered ? 0 : dev->power;
- di->lowspeed = dev->lowspeed;
- di->addr = dev->address;
- if (dev->hub) {
- for (i = 0;
- i < sizeof(di->ports) / sizeof(di->ports[0]) &&
- i < dev->hub->hubdesc.bNbrPorts;
- i++) {
- p = &dev->hub->ports[i];
- if (p->device)
- r = p->device->address;
- else {
- s = UGETW(p->status.wPortStatus);
- if (s & UPS_PORT_ENABLED)
- r = USB_PORT_ENABLED;
- else if (s & UPS_SUSPEND)
- r = USB_PORT_SUSPENDED;
- else if (s & UPS_PORT_POWER)
- r = USB_PORT_POWERED;
- else
- r = USB_PORT_DISABLED;
- }
- di->ports[i] = r;
- }
- di->nports = dev->hub->hubdesc.bNbrPorts;
- } else
- di->nports = 0;
-}
diff --git a/sys/dev/usb/usbcdc.h b/sys/dev/usb/usbcdc.h
deleted file mode 100644
index 3d3eb818f1b2..000000000000
--- a/sys/dev/usb/usbcdc.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $NetBSD: usbcdc.h,v 1.3 1999/01/03 01:09:18 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 _USBCDC_H_
-#define _USBCDC_H_
-
-#define UDESCSUB_CDC_HEADER 0
-#define UDESCSUB_CDC_CM 1 /* Call Management */
-#define UDESCSUB_CDC_ACM 2 /* Abstract Control Model */
-#define UDESCSUB_CDC_DLM 3 /* Direct Line Management */
-#define UDESCSUB_CDC_TRF 4 /* Telephone Ringer */
-#define UDESCSUB_CDC_TCLSR 5 /* Telephone Call ... */
-#define UDESCSUB_CDC_UNION 6
-#define UDESCSUB_CDC_CS 7 /* Country Selection */
-#define UDESCSUB_CDC_TOM 8 /* Telephone Operational Modes */
-#define UDESCSUB_CDC_USBT 9 /* USB Terminal */
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uWord bcdCDC;
-} usb_cdc_header_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bmCapabilities;
-#define USB_CDC_CM_DOES_CM 0x01
-#define USB_CDC_CM_CM_OVER_DATA 0x02
- uByte bDataInterface;
-} usb_cdc_cm_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bmCapabilities;
-#define USB_CDC_ACM_HAS_FEATURE 0x01
-#define USB_CDC_ACM_HAS_LINE 0x02
-#define USB_CDC_ACM_HAS_BREAK 0x04
-#define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
-} usb_cdc_acm_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bMasterInterface;
- uByte bSlaveInterface[1];
-} usb_cdc_union_descriptor_t;
-
-#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
-#define UCDC_GET_ENCAPSULATED_RESPONSE 0x01
-#define UCDC_SET_COMM_FEATURE 0x02
-#define UCDC_GET_COMM_FEATURE 0x03
-#define UCDC_ABSTRACT_STATE 0x01
-#define UCDC_COUNTRY_SETTING 0x02
-#define UCDC_CLEAR_COMM_FEATURE 0x04
-#define UCDC_SET_LINE_CODING 0x20
-#define UCDC_GET_LINE_CODING 0x21
-
-typedef struct {
- uWord wState;
-#define UCDC_IDLE_SETTING 0x0001
-#define UCDC_DATA_MULTIPLEXED 0x0002
-} usb_cdc_abstract_state_t;
-
-typedef struct {
- uDWord dwDTERate;
- uByte bCharFormat;
-#define UCDC_STOP_BIT_1 0
-#define UCDC_STOP_BIT_1_5 1
-#define UCDC_STOP_BIT_2 2
- uByte bParityType;
-#define UCDC_PARITY_NONE 0
-#define UCDC_PARITY_ODD 1
-#define UCDC_PARITY_EVEN 2
-#define UCDC_PARITY_MARK 3
-#define UCDC_PARITY_SPACE 4
- uByte bDataBits;
-} usb_cdc_line_state_t;
-
-typedef struct {
- uByte bmRequestType;
-#define UCDC_NOTIFICATION 0xa1
- uByte bNotification;
-#define UCDC_N_NETWORK_CONNECTION 0x00
-#define UCDC_N_RESPONSE_AVAILABLE 0x01
-#define UCDC_N_AUX_JACK_HOOK_STATE 0x08
-#define UCDC_N_RING_DETECT 0x09
-#define UCDC_N_SERIAL_STATE 0x20
-#define UCDC_N_CALL_STATE_CHANGED 0x28
-#define UCDC_N_LINE_STATE_CHANGED 0x29
-#define UCDC_N_CONNECTION_SPEED_CHANGE 0x2a
- uWord wValue;
- uWord wIndex;
- uWord wLength;
- uByte data[16];
-} usb_cdc_notification_t;
-#define UCDC_NOTIFICATION_LENGTH 8
-
-#endif /* _USBCDC_H_ */
diff --git a/sys/dev/usb/usbdevs.h b/sys/dev/usb/usbdevs.h
deleted file mode 100644
index 24398066a8c9..000000000000
--- a/sys/dev/usb/usbdevs.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- *
- * generated from:
- * NetBSD: usbdevs,v 1.19 1999/01/08 11:18:38 augustss Exp
- */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-/*
- * List of known USB vendors
- */
-
-#define USB_VENDOR_NEC 0x0409 /* NEC */
-#define USB_VENDOR_KODAK 0x040a /* Eastman Kodak */
-/* Computer Access Technology Corporation */
-#define USB_VENDOR_CATC 0x0423 /* CATC */
-#define USB_VENDOR_NANAO 0x0440 /* Nanao */
-#define USB_VENDOR_UNIXTAR 0x0451 /* Unixtar */
-#define USB_VENDOR_GENIUS 0x0458 /* Genius */
-#define USB_VENDOR_MICROSOFT 0x045e /* Microsoft */
-#define USB_VENDOR_KENSINGTON 0x0461 /* Kensington */
-#define USB_VENDOR_CHERRY 0x046a /* Cherry */
-/* Behavior Technology Corporation */
-#define USB_VENDOR_BTC 0x046e /* BTC */
-#define USB_VENDOR_PHILIPS 0x0471 /* Philips */
-#define USB_VENDOR_CONNECTIX 0x0478 /* Connectix */
-#define USB_VENDOR_ACER 0x04a5 /* Acer Peripherals */
-#define USB_VENDOR_CYPRESS 0x04b4 /* Cypress Semiconductor */
-#define USB_VENDOR_3COM 0x04c1 /* 3Com */
-#define USB_VENDOR_SHUTTLE 0x04e6 /* Shuttle Technology */
-#define USB_VENDOR_JAZZ 0x04fa /* Jazz */
-#define USB_VENDOR_ATEN 0x0557 /* ATen */
-#define USB_VENDOR_PERACOM 0x0565 /* Peracom */
-#define USB_VENDOR_EIZO 0x056d /* EIZO */
-#define USB_VENDOR_AGILER 0x056e /* Agiler */
-#define USB_VENDOR_BELKIN 0x05ab /* Belkin */
-#define USB_VENDOR_LOGITECH 0x05ac /* Logitech */
-#define USB_VENDOR_EIZONANAO 0x05e7 /* EIZO Nanao */
-#define USB_VENDOR_CHIC 0x05fe /* Chic Technology */
-#define USB_VENDOR_ADS 0x06e1 /* ADS Technologies */
-#define USB_VENDOR_PLX 0x10b5 /* PLX */
-#define USB_VENDOR_ENTREGA 0x1645 /* Entrega */
-#define USB_VENDOR_INSIDEOUT 0x1608 /* Inside Out Networks */
-#define USB_VENDOR_INTEL 0x8086 /* Intel */
-
-/*
- * List of known products. Grouped by vendor.
- */
-
-/* NEC products */
-#define USB_PRODUCT_NEC_HUB 0x55aa /* hub */
-#define USB_PRODUCT_NEC_HUB_B 0x55ab /* hub */
-
-/* Kodak products */
-#define USB_PRODUCT_KODAK_DC260 0x0110 /* Digital Science DC260 */
-
-/* CATC products */
-#define USB_PRODUCT_CATC_ANDROMEDA 0x1237 /* Andromeda hub */
-
-/* Unixtar products */
-#define USB_PRODUCT_UNIXTAR_UTUSB41 0x1446 /* UT-USB41 hub */
-
-/* Genius products */
-#define USB_PRODUCT_GENIUS_NICHE 0x0001 /* Niche mouse */
-#define USB_PRODUCT_GENIUS_FLIGHT2000 0x1004 /* Flight 2000 joystick */
-
-/* Microsoft products */
-#define USB_PRODUCT_MICROSOFT_INTELLIMOUSE 0x0009 /* IntelliMouse */
-
-/* Kensington products */
-#define USB_PRODUCT_KENSINGTON_MOUSEINABOX 0x4d02 /* Mouse-in-a-Box */
-
-/* Cherry products */
-#define USB_PRODUCT_CHERRY_MY3000KBD 0x0001 /* My3000 keyboard */
-#define USB_PRODUCT_CHERRY_MY3000HUB 0x0003 /* My3000 hub */
-
-/* Behavior Technology Corporation products */
-#define USB_PRODUCT_BTC_BTC7932 0x6782 /* Keyboard with mouse port */
-
-/* Philips products */
-#define USB_PRODUCT_PHILIPS_DSS 0x0101 /* DSS 350 Digital Speaker System */
-#define USB_PRODUCT_PHILIPS_HUB 0x0201 /* hub */
-
-/* Connectix products */
-#define USB_PRODUCT_CONNECTIX_QUICKCAM 0x0001 /* QuickCam */
-
-/* Acer products */
-#define USB_PRODUCT_ACER_ACERSCAN_C310U 0x12a6 /* Acerscan C310U */
-
-/* Cypress Semiconduuctor products */
-#define USB_PRODUCT_CYPRESS_MOUSE 0x0001 /* mouse */
-
-/* 3Com products */
-#define USB_PRODUCT_3COM_USR56K 0x3021 /* U.S.Robotics 56000 Voice USB Modem */
-
-/* Shuttle Technology products */
-#define USB_PRODUCT_SHUTTLE_EUSB 0x0001 /* E-USB Bridge */
-
-/* Jazz products */
-#define USB_PRODUCT_JAZZ_J6502 0x4201 /* J-6502 speakers */
-
-/* ATen products */
-#define USB_PRODUCT_ATEN_UC1284 0x2001 /* Parallel printer adapter */
-
-/* Peracom products */
-#define USB_PRODUCT_PERACOM_SERIAL1 0x0001 /* Serial Converter */
-
-/* EIZO products */
-#define USB_PRODUCT_EIZO_HUB 0x0000 /* hub */
-#define USB_PRODUCT_EIZO_MONITOR 0x0001 /* monitor */
-
-/* Agiler products */
-#define USB_PRODUCT_AGILER_MOUSE29UO 0x0002 /* mouse 29UO */
-
-/* Belkin products */
-#define USB_PRODUCT_BELKIN_F5U002 0x0002 /* Parallel printer adapter */
-
-/* Logitech products */
-#define USB_PRODUCT_LOGITECH_M2452 0x0203 /* M2452 keyboard */
-#define USB_PRODUCT_LOGITECH_M4848 0x0301 /* M4848 mouse */
-
-/* Chic Technology products */
-#define USB_PRODUCT_CHIC_MOUSE1 0x0001 /* mouse */
-
-/* ADS products */
-#define USB_PRODUCT_ADS_ENET 0x0008 /* Ethernet adapter */
-
-/* PLX products */
-#define USB_PRODUCT_PLX_TESTBOARD 0x9060 /* test board */
-
-#define USB_PRODUCT_ENTREGA_CENTRONICS 0x0006 /* Centronics connector */
-#define USB_PRODUCT_ENTREGA_SERIAL 0x8001 /* DB25 Serial connector */
-
-/* Inside Out Networks products */
-#define USB_PRODUCT_INSIDEOUT_EDGEPORT4 0x0001 /* EdgePort/4 serial ports */
-
-/* Intel products */
-#define USB_PRODUCT_INTEL_TESTBOARD 0x9890 /* 82930 test board */
diff --git a/sys/dev/usb/usbdevs_data.h b/sys/dev/usb/usbdevs_data.h
deleted file mode 100644
index a6815eb6c9da..000000000000
--- a/sys/dev/usb/usbdevs_data.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- *
- * generated from:
- * NetBSD: usbdevs,v 1.19 1999/01/08 11:18:38 augustss Exp
- */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-struct usb_knowndev usb_knowndevs[] = {
- {
- USB_VENDOR_NEC, USB_PRODUCT_NEC_HUB,
- 0,
- "NEC",
- "hub",
- },
- {
- USB_VENDOR_NEC, USB_PRODUCT_NEC_HUB_B,
- 0,
- "NEC",
- "hub",
- },
- {
- USB_VENDOR_KODAK, USB_PRODUCT_KODAK_DC260,
- 0,
- "Eastman Kodak",
- "Digital Science DC260",
- },
- {
- USB_VENDOR_CATC, USB_PRODUCT_CATC_ANDROMEDA,
- 0,
- "CATC",
- "Andromeda hub",
- },
- {
- USB_VENDOR_UNIXTAR, USB_PRODUCT_UNIXTAR_UTUSB41,
- 0,
- "Unixtar",
- "UT-USB41 hub",
- },
- {
- USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_NICHE,
- 0,
- "Genius",
- "Niche mouse",
- },
- {
- USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_FLIGHT2000,
- 0,
- "Genius",
- "Flight 2000 joystick",
- },
- {
- USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_INTELLIMOUSE,
- 0,
- "Microsoft",
- "IntelliMouse",
- },
- {
- USB_VENDOR_KENSINGTON, USB_PRODUCT_KENSINGTON_MOUSEINABOX,
- 0,
- "Kensington",
- "Mouse-in-a-Box",
- },
- {
- USB_VENDOR_CHERRY, USB_PRODUCT_CHERRY_MY3000KBD,
- 0,
- "Cherry",
- "My3000 keyboard",
- },
- {
- USB_VENDOR_CHERRY, USB_PRODUCT_CHERRY_MY3000HUB,
- 0,
- "Cherry",
- "My3000 hub",
- },
- {
- USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932,
- 0,
- "BTC",
- "Keyboard with mouse port",
- },
- {
- USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DSS,
- 0,
- "Philips",
- "DSS 350 Digital Speaker System",
- },
- {
- USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_HUB,
- 0,
- "Philips",
- "hub",
- },
- {
- USB_VENDOR_CONNECTIX, USB_PRODUCT_CONNECTIX_QUICKCAM,
- 0,
- "Connectix",
- "QuickCam",
- },
- {
- USB_VENDOR_ACER, USB_PRODUCT_ACER_ACERSCAN_C310U,
- 0,
- "Acer Peripherals",
- "Acerscan C310U",
- },
- {
- USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_MOUSE,
- 0,
- "Cypress Semiconductor",
- "mouse",
- },
- {
- USB_VENDOR_3COM, USB_PRODUCT_3COM_USR56K,
- 0,
- "3Com",
- "U.S.Robotics 56000 Voice USB Modem",
- },
- {
- USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB,
- 0,
- "Shuttle Technology",
- "E-USB Bridge",
- },
- {
- USB_VENDOR_JAZZ, USB_PRODUCT_JAZZ_J6502,
- 0,
- "Jazz",
- "J-6502 speakers",
- },
- {
- USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC1284,
- 0,
- "ATen",
- "Parallel printer adapter",
- },
- {
- USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1,
- 0,
- "Peracom",
- "Serial Converter",
- },
- {
- USB_VENDOR_EIZO, USB_PRODUCT_EIZO_HUB,
- 0,
- "EIZO",
- "hub",
- },
- {
- USB_VENDOR_EIZO, USB_PRODUCT_EIZO_MONITOR,
- 0,
- "EIZO",
- "monitor",
- },
- {
- USB_VENDOR_AGILER, USB_PRODUCT_AGILER_MOUSE29UO,
- 0,
- "Agiler",
- "mouse 29UO",
- },
- {
- USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U002,
- 0,
- "Belkin",
- "Parallel printer adapter",
- },
- {
- USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_M2452,
- 0,
- "Logitech",
- "M2452 keyboard",
- },
- {
- USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_M4848,
- 0,
- "Logitech",
- "M4848 mouse",
- },
- {
- USB_VENDOR_CHIC, USB_PRODUCT_CHIC_MOUSE1,
- 0,
- "Chic Technology",
- "mouse",
- },
- {
- USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET,
- 0,
- "ADS Technologies",
- "Ethernet adapter",
- },
- {
- USB_VENDOR_PLX, USB_PRODUCT_PLX_TESTBOARD,
- 0,
- "PLX",
- "test board",
- },
- {
- USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_CENTRONICS,
- 0,
- "Entrega",
- "Centronics connector",
- },
- {
- USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_SERIAL,
- 0,
- "Entrega",
- "DB25 Serial connector",
- },
- {
- USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4,
- 0,
- "Inside Out Networks",
- "EdgePort/4 serial ports",
- },
- {
- USB_VENDOR_INTEL, USB_PRODUCT_INTEL_TESTBOARD,
- 0,
- "Intel",
- "82930 test board",
- },
- {
- USB_VENDOR_NEC, 0,
- USB_KNOWNDEV_NOPROD,
- "NEC",
- NULL,
- },
- {
- USB_VENDOR_KODAK, 0,
- USB_KNOWNDEV_NOPROD,
- "Eastman Kodak",
- NULL,
- },
- {
- USB_VENDOR_CATC, 0,
- USB_KNOWNDEV_NOPROD,
- "CATC",
- NULL,
- },
- {
- USB_VENDOR_NANAO, 0,
- USB_KNOWNDEV_NOPROD,
- "Nanao",
- NULL,
- },
- {
- USB_VENDOR_UNIXTAR, 0,
- USB_KNOWNDEV_NOPROD,
- "Unixtar",
- NULL,
- },
- {
- USB_VENDOR_GENIUS, 0,
- USB_KNOWNDEV_NOPROD,
- "Genius",
- NULL,
- },
- {
- USB_VENDOR_MICROSOFT, 0,
- USB_KNOWNDEV_NOPROD,
- "Microsoft",
- NULL,
- },
- {
- USB_VENDOR_KENSINGTON, 0,
- USB_KNOWNDEV_NOPROD,
- "Kensington",
- NULL,
- },
- {
- USB_VENDOR_CHERRY, 0,
- USB_KNOWNDEV_NOPROD,
- "Cherry",
- NULL,
- },
- {
- USB_VENDOR_BTC, 0,
- USB_KNOWNDEV_NOPROD,
- "BTC",
- NULL,
- },
- {
- USB_VENDOR_PHILIPS, 0,
- USB_KNOWNDEV_NOPROD,
- "Philips",
- NULL,
- },
- {
- USB_VENDOR_CONNECTIX, 0,
- USB_KNOWNDEV_NOPROD,
- "Connectix",
- NULL,
- },
- {
- USB_VENDOR_ACER, 0,
- USB_KNOWNDEV_NOPROD,
- "Acer Peripherals",
- NULL,
- },
- {
- USB_VENDOR_CYPRESS, 0,
- USB_KNOWNDEV_NOPROD,
- "Cypress Semiconductor",
- NULL,
- },
- {
- USB_VENDOR_3COM, 0,
- USB_KNOWNDEV_NOPROD,
- "3Com",
- NULL,
- },
- {
- USB_VENDOR_SHUTTLE, 0,
- USB_KNOWNDEV_NOPROD,
- "Shuttle Technology",
- NULL,
- },
- {
- USB_VENDOR_JAZZ, 0,
- USB_KNOWNDEV_NOPROD,
- "Jazz",
- NULL,
- },
- {
- USB_VENDOR_ATEN, 0,
- USB_KNOWNDEV_NOPROD,
- "ATen",
- NULL,
- },
- {
- USB_VENDOR_PERACOM, 0,
- USB_KNOWNDEV_NOPROD,
- "Peracom",
- NULL,
- },
- {
- USB_VENDOR_EIZO, 0,
- USB_KNOWNDEV_NOPROD,
- "EIZO",
- NULL,
- },
- {
- USB_VENDOR_AGILER, 0,
- USB_KNOWNDEV_NOPROD,
- "Agiler",
- NULL,
- },
- {
- USB_VENDOR_BELKIN, 0,
- USB_KNOWNDEV_NOPROD,
- "Belkin",
- NULL,
- },
- {
- USB_VENDOR_LOGITECH, 0,
- USB_KNOWNDEV_NOPROD,
- "Logitech",
- NULL,
- },
- {
- USB_VENDOR_EIZONANAO, 0,
- USB_KNOWNDEV_NOPROD,
- "EIZO Nanao",
- NULL,
- },
- {
- USB_VENDOR_CHIC, 0,
- USB_KNOWNDEV_NOPROD,
- "Chic Technology",
- NULL,
- },
- {
- USB_VENDOR_ADS, 0,
- USB_KNOWNDEV_NOPROD,
- "ADS Technologies",
- NULL,
- },
- {
- USB_VENDOR_PLX, 0,
- USB_KNOWNDEV_NOPROD,
- "PLX",
- NULL,
- },
- {
- USB_VENDOR_ENTREGA, 0,
- USB_KNOWNDEV_NOPROD,
- "Entrega",
- NULL,
- },
- {
- USB_VENDOR_INSIDEOUT, 0,
- USB_KNOWNDEV_NOPROD,
- "Inside Out Networks",
- NULL,
- },
- {
- USB_VENDOR_INTEL, 0,
- USB_KNOWNDEV_NOPROD,
- "Intel",
- NULL,
- },
- { 0, 0, 0, NULL, NULL, }
-};
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
deleted file mode 100644
index e1ed20a0f8a7..000000000000
--- a/sys/dev/usb/usbdi.c
+++ /dev/null
@@ -1,1294 +0,0 @@
-/* $NetBSD: usbdi.c,v 1.20 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi.c,v 1.7 1999/01/07 23:31:42 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#else
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#endif
-#include <sys/malloc.h>
-#include <sys/proc.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-
-#if defined(__FreeBSD__)
-#include "usb_if.h"
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static usbd_status usbd_ar_pipe __P((usbd_pipe_handle pipe));
-static usbd_status usbd_ar_iface __P((usbd_interface_handle iface));
-static void usbd_transfer_cb __P((usbd_request_handle reqh));
-static void usbd_sync_transfer_cb __P((usbd_request_handle reqh));
-static usbd_status usbd_do_transfer __P((usbd_request_handle reqh));
-void usbd_do_request_async_cb
- __P((usbd_request_handle, usbd_private_handle, usbd_status));
-
-static SIMPLEQ_HEAD(, usbd_request) usbd_free_requests;
-
-#if defined(__FreeBSD__)
-#define USB_CDEV_MAJOR 108
-
-extern struct cdevsw usb_cdevsw;
-#endif
-
-usbd_status
-usbd_open_pipe(iface, address, flags, pipe)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
-{
- usbd_pipe_handle p;
- struct usbd_endpoint *ep;
- usbd_status r;
- int i;
-
- if (iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- for (i = 0; i < iface->idesc->bNumEndpoints; i++) {
- ep = &iface->endpoints[i];
- if (ep->edesc->bEndpointAddress == address)
- goto found;
- }
- return (USBD_BAD_ADDRESS);
- found:
- if ((flags & USBD_EXCLUSIVE_USE) &&
- ep->refcnt != 0)
- return (USBD_IN_USE);
- r = usbd_setup_pipe(iface->device, iface, ep, &p);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- LIST_INSERT_HEAD(&iface->pipes, p, next);
- *pipe = p;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_open_pipe_intr(iface, address, flags, pipe, priv, buffer, length, cb)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
- usbd_private_handle priv;
- void *buffer;
- u_int32_t length;
- usbd_callback cb;
-{
- usbd_status r;
- usbd_request_handle reqh;
- usbd_pipe_handle ipipe;
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_open_pipe(iface, address, USBD_EXCLUSIVE_USE, &ipipe);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad1;
- r = usbd_setup_request(reqh, ipipe, priv, buffer, length,
- USBD_XFER_IN | flags, USBD_NO_TIMEOUT, cb);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad2;
- ipipe->intrreqh = reqh;
- r = usbd_transfer(reqh);
- *pipe = ipipe;
- if (r != USBD_IN_PROGRESS)
- goto bad3;
- return (USBD_NORMAL_COMPLETION);
-
- bad3:
- ipipe->intrreqh = 0;
- bad2:
- usbd_close_pipe(ipipe);
- bad1:
- usbd_free_request(reqh);
- return r;
-}
-
-usbd_status
-usbd_open_pipe_iso(iface, address, flags, pipe, priv, bufsize, nbuf, cb)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
- usbd_private_handle priv;
- u_int32_t bufsize;
- u_int32_t nbuf;
- usbd_callback cb;
-{
- usbd_status r;
- usbd_pipe_handle p;
-
- r = usbd_open_pipe(iface, address, USBD_EXCLUSIVE_USE, &p);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!p->methods->isobuf) {
- usbd_close_pipe(p);
- return (USBD_INVAL);
- }
- r = p->methods->isobuf(p, bufsize, nbuf);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_close_pipe(p);
- return (r);
- }
- *pipe = p;
- return r;
-}
-
-usbd_status
-usbd_close_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- if (--pipe->refcnt != 0)
- return (USBD_NORMAL_COMPLETION);
- if (SIMPLEQ_FIRST(&pipe->queue) != 0)
- return (USBD_PENDING_REQUESTS);
- LIST_REMOVE(pipe, next);
- pipe->endpoint->refcnt--;
- pipe->methods->close(pipe);
- if (pipe->intrreqh)
- usbd_free_request(pipe->intrreqh);
- free(pipe, M_USB);
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_transfer(reqh)
- usbd_request_handle reqh;
-{
- reqh->xfercb = usbd_transfer_cb;
- return (usbd_do_transfer(reqh));
-}
-
-static usbd_status
-usbd_do_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
-
- DPRINTFN(10,("usbd_do_transfer: reqh=%p\n", reqh));
- reqh->done = 0;
- return (pipe->methods->transfer(reqh));
-}
-
-usbd_request_handle
-usbd_alloc_request()
-{
- usbd_request_handle reqh;
-
- reqh = SIMPLEQ_FIRST(&usbd_free_requests);
- if (reqh)
- SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, reqh, next);
- else
- reqh = malloc(sizeof(*reqh), M_USB, M_NOWAIT);
- if (!reqh)
- return (0);
- memset(reqh, 0, sizeof *reqh);
- return (reqh);
-}
-
-usbd_status
-usbd_free_request(reqh)
- usbd_request_handle reqh;
-{
- SIMPLEQ_INSERT_HEAD(&usbd_free_requests, reqh, next);
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_request(reqh, pipe, priv, buffer, length, flags, timeout, callback)
- usbd_request_handle reqh;
- usbd_pipe_handle pipe;
- usbd_private_handle priv;
- void *buffer;
- u_int32_t length;
- u_int16_t flags;
- u_int32_t timeout;
- void (*callback) __P((usbd_request_handle,
- usbd_private_handle,
- usbd_status));
-{
- reqh->pipe = pipe;
- reqh->isreq = 0;
- reqh->priv = priv;
- reqh->buffer = buffer;
- reqh->length = length;
- reqh->actlen = 0;
- reqh->flags = flags;
- reqh->callback = callback;
- reqh->status = USBD_NOT_STARTED;
- reqh->retries = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_device_request(reqh, req)
- usbd_request_handle reqh;
- usb_device_request_t *req;
-{
- reqh->isreq = 1;
- reqh->request = *req;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_default_request(reqh, dev, priv, timeout, req, buffer,
- length, flags, callback)
- usbd_request_handle reqh;
- usbd_device_handle dev;
- usbd_private_handle priv;
- u_int32_t timeout;
- usb_device_request_t *req;
- void *buffer;
- u_int32_t length;
- u_int16_t flags;
- void (*callback) __P((usbd_request_handle,
- usbd_private_handle,
- usbd_status));
-{
- reqh->pipe = dev->default_pipe;
- reqh->priv = priv;
- reqh->buffer = buffer;
- reqh->length = length;
- reqh->actlen = 0;
- reqh->flags = flags;
- reqh->timeout = timeout;
- reqh->status = USBD_NOT_STARTED;
- reqh->callback = callback;
- reqh->request = *req;
- reqh->isreq = 1;
- reqh->retries = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_request_timeout(reqh, timeout)
- usbd_request_handle reqh;
- u_int32_t timeout;
-{
- reqh->timeout = timeout;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_request_status(reqh, priv, buffer, count, status)
- usbd_request_handle reqh;
- usbd_private_handle *priv;
- void **buffer;
- u_int32_t *count;
- usbd_status *status;
-{
- *priv = reqh->priv;
- *buffer = reqh->buffer;
- *count = reqh->actlen;
- *status = reqh->status;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_request_device_data(reqh, req)
- usbd_request_handle reqh;
- usb_device_request_t *req;
-{
- if (!reqh->isreq)
- return (USBD_INVAL);
- *req = reqh->request;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-usb_descriptor_t *
-usbd_get_descriptor(iface, desc_type)
- usbd_interface_handle *iface;
- u_int8_t desc_type;
-XX
-#endif
-
-usb_config_descriptor_t *
-usbd_get_config_descriptor(dev)
- usbd_device_handle dev;
-{
- return (dev->cdesc);
-}
-
-usb_interface_descriptor_t *
-usbd_get_interface_descriptor(iface)
- usbd_interface_handle iface;
-{
- return (iface->idesc);
-}
-
-usb_device_descriptor_t *
-usbd_get_device_descriptor(dev)
- usbd_device_handle dev;
-{
- return (&dev->ddesc);
-}
-
-usb_endpoint_descriptor_t *
-usbd_interface2endpoint_descriptor(iface, index)
- usbd_interface_handle iface;
- u_int8_t index;
-{
- if (index >= iface->idesc->bNumEndpoints)
- return (0);
- return (iface->endpoints[index].edesc);
-}
-
-usbd_status
-usbd_set_configuration(dev, conf)
- usbd_device_handle dev;
- u_int8_t conf;
-{
- return usbd_set_config_no(dev, conf, 0);
-}
-
-usbd_status
-usbd_retry_request(reqh, retry_count)
- usbd_request_handle reqh;
- u_int32_t retry_count;
-{
- usbd_status r;
-
- r = usbd_set_pipe_state(reqh->pipe, USBD_PIPE_ACTIVE);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- reqh->retries = retry_count;
- return (usbd_transfer(reqh));
-}
-
-usbd_status
-usbd_abort_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_status r;
- int s, st;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- s = splusb();
- st = pipe->state;
- r = usbd_ar_pipe(pipe);
- pipe->state = st;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_abort_interface(iface)
- usbd_interface_handle iface;
-{
- usbd_status r;
- int s, st;
-
- s = splusb();
- st = iface->state;
- r = usbd_ar_iface(iface);
- iface->state = st;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_reset_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_status r;
- int s;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- s = splusb();
- r = usbd_ar_pipe(pipe);
- /* XXX anything else */
- pipe->state = USBD_PIPE_ACTIVE;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_reset_interface(iface)
- usbd_interface_handle iface;
-{
- usbd_status r;
- int s;
-
- s = splusb();
- r = usbd_ar_iface(iface);
- /* XXX anything else */
- iface->state = USBD_INTERFACE_ACTIVE;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_clear_endpoint_stall(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_WRITE_ENDPOINT;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, UF_ENDPOINT_HALT);
- USETW(req.wIndex, pipe->endpoint->edesc->bEndpointAddress);
- USETW(req.wLength, 0);
- r = usbd_do_request(dev, &req, 0);
-#if 0
-XXX should we do this?
- if (r == USBD_NORMAL_COMPLETION) {
- pipe->state = USBD_PIPE_ACTIVE;
- /* XXX activate pipe */
- }
-#endif
- return (r);
-}
-
-usbd_status
-usbd_clear_endpoint_stall_async(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_WRITE_ENDPOINT;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, UF_ENDPOINT_HALT);
- USETW(req.wIndex, pipe->endpoint->edesc->bEndpointAddress);
- USETW(req.wLength, 0);
- r = usbd_do_request_async(dev, &req, 0);
- return (r);
-}
-
-usbd_status
-usbd_set_pipe_state(pipe, state)
- usbd_pipe_handle pipe;
- usbd_pipe_state state;
-{
- int s;
- usbd_status r;
- usbd_request_handle reqh;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- if (state != USBD_PIPE_ACTIVE &&
- state != USBD_PIPE_STALLED &&
- state != USBD_PIPE_IDLE)
- return (USBD_INVAL);
- pipe->state = state;
- r = USBD_NORMAL_COMPLETION;
- if (state == USBD_PIPE_ACTIVE) {
- s = splusb();
- if (!pipe->running) {
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- if (reqh != 0) {
- pipe->running = 1;
- splx(s);
- r = pipe->methods->start(reqh);
- } else
- splx(s);
- } else
- splx(s);
- }
- return (r);
-}
-
-usbd_status
-usbd_get_pipe_state(pipe, state, endpoint_state, request_count)
- usbd_pipe_handle pipe;
- usbd_pipe_state *state;
- u_int32_t *endpoint_state;
- u_int32_t *request_count;
-{
- int n;
- usbd_request_handle r;
-
- *state = pipe->state;
- *endpoint_state = pipe->endpoint->state;
- for (r = SIMPLEQ_FIRST(&pipe->queue), n = 0;
- r != 0;
- r = SIMPLEQ_NEXT(r, next), n++)
- ;
- *request_count = n;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_interface_state(iface, state)
- usbd_interface_handle iface;
- usbd_interface_state state;
-{
- int ps;
- usbd_pipe_handle p;
-
- if (state == USBD_INTERFACE_ACTIVE)
- ps = USBD_PIPE_ACTIVE;
- else if (state == USBD_INTERFACE_STALLED)
- ps = USBD_PIPE_STALLED;
- else if (state == USBD_INTERFACE_IDLE)
- ps = USBD_PIPE_IDLE;
- else
- return (USBD_INVAL);
- iface->state = USBD_INTERFACE_ACTIVE; /* to allow setting the pipe */
- for (p = LIST_FIRST(&iface->pipes); p != 0; p = LIST_NEXT(p, next))
- usbd_set_pipe_state(p, ps);
- iface->state = state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_interface_state(iface, state)
- usbd_interface_handle iface;
- usbd_interface_state *state;
-{
- *state = iface->state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_device_state(dev, state)
- usbd_device_handle dev;
- usbd_device_state *state;
-{
- *state = dev->state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-usbd_status
-usbd_set_device_state(dev, state)
- usbd_device_handle dev;
- usbd_device_state state;
-X
-#endif
-
-usbd_status
-usbd_device_address(dev, address)
- usbd_device_handle dev;
- u_int8_t *address;
-{
- *address = dev->address;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_endpoint_address(pipe, address)
- usbd_pipe_handle pipe;
- u_int8_t *address;
-{
- *address = pipe->endpoint->edesc->bEndpointAddress;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_endpoint_count(iface, count)
- usbd_interface_handle iface;
- u_int8_t *count;
-{
- *count = iface->idesc->bNumEndpoints;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_interface_count(dev, count)
- usbd_device_handle dev;
- u_int8_t *count;
-{
- if (!dev->cdesc)
- return (USBD_NOT_CONFIGURED);
- *count = dev->cdesc->bNumInterface;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-u_int8_t
-usbd_bus_count()
-{
- return (usb_bus_count());
-}
-#endif
-
-#if defined(__NetBSD__)
-usbd_status
-usbd_get_bus_handle(index, bus)
- u_int8_t index;
- usbd_bus_handle *bus;
-{
- return (usb_get_bus_handle(index, bus));
-}
-#endif
-
-usbd_status
-usbd_get_root_hub(bus, dev)
- usbd_bus_handle bus;
- usbd_device_handle *dev;
-{
- *dev = bus->root_hub;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_port_count(dev, nports)
- usbd_device_handle dev;
- u_int8_t *nports;
-{
- if (dev->hub == 0)
- return (USBD_INVAL);
- *nports = dev->hub->hubdesc.bNbrPorts;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_hub2device_handle(dev, port, devp)
- usbd_device_handle dev;
- u_int8_t port;
- usbd_device_handle *devp;
-{
- if (dev->hub == 0 || port >= dev->hub->hubdesc.bNbrPorts ||
- dev->hub->ports[port].device == 0)
- return (USBD_INVAL);
- *devp = dev->hub->ports[port].device;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_request2pipe_handle(reqh, pipe)
- usbd_request_handle reqh;
- usbd_pipe_handle *pipe;
-{
- *pipe = reqh->pipe;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_pipe2interface_handle(pipe, iface)
- usbd_pipe_handle pipe;
- usbd_interface_handle *iface;
-{
- *iface = pipe->iface;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_interface2device_handle(iface, dev)
- usbd_interface_handle iface;
- usbd_device_handle *dev;
-{
- *dev = iface->device;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_device2bus_handle(dev, bus)
- usbd_device_handle dev;
- usbd_bus_handle *bus;
-{
- *bus = dev->bus;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_device2interface_handle(dev, ifaceno, iface)
- usbd_device_handle dev;
- u_int8_t ifaceno;
- usbd_interface_handle *iface;
-{
- if (!dev->cdesc)
- return (USBD_NOT_CONFIGURED);
- if (ifaceno >= dev->cdesc->bNumInterface)
- return (USBD_INVAL);
- *iface = &dev->ifaces[ifaceno];
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_interface_private_handle(iface, priv)
- usbd_interface_handle iface;
- usbd_private_handle priv;
-{
- iface->priv = priv;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_interface_private_handle(iface, priv)
- usbd_interface_handle iface;
- usbd_private_handle *priv;
-{
- *priv = iface->priv;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_reference_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->refcnt++;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_dereference_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->refcnt--;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_lock_token
-usbd_lock()
-{
- return (splusb());
-}
-
-void
-usbd_unlock(tok)
- usbd_lock_token tok;
-{
- splx(tok);
-}
-
-/* XXXX use altno */
-usbd_status
-usbd_set_interface(iface, altidx)
- usbd_interface_handle iface;
- int altidx;
-{
- usb_device_request_t req;
- usbd_status r;
-
- if (LIST_FIRST(&iface->pipes) != 0)
- return (USBD_IN_USE);
-
- if (iface->endpoints)
- free(iface->endpoints, M_USB);
- iface->endpoints = 0;
- iface->idesc = 0;
- iface->state = USBD_INTERFACE_IDLE;
-
- r = usbd_fill_iface_data(iface->device, iface->index, altidx);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- req.bmRequestType = UT_WRITE_INTERFACE;
- req.bRequest = UR_SET_INTERFACE;
- USETW(req.wValue, iface->idesc->bAlternateSetting);
- USETW(req.wIndex, iface->idesc->bInterfaceNumber);
- USETW(req.wLength, 0);
- return usbd_do_request(iface->device, &req, 0);
-}
-
-int
-usbd_get_no_alts(cdesc, ifaceno)
- usb_config_descriptor_t *cdesc;
- int ifaceno;
-{
- char *p = (char *)cdesc;
- char *end = p + UGETW(cdesc->wTotalLength);
- usb_interface_descriptor_t *d;
- int n;
-
- for (n = 0; p < end; p += d->bLength) {
- d = (usb_interface_descriptor_t *)p;
- if (p + d->bLength <= end &&
- d->bDescriptorType == UDESC_INTERFACE &&
- d->bInterfaceNumber == ifaceno)
- n++;
- }
- return (n);
-}
-
-int
-usbd_get_interface_altindex(iface)
- usbd_interface_handle iface;
-{
- return (iface->altindex);
-}
-
-usbd_status
-usbd_get_interface(iface, aiface)
- usbd_interface_handle iface;
- u_int8_t *aiface;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_INTERFACE;
- req.bRequest = UR_GET_INTERFACE;
- USETW(req.wValue, 0);
- USETW(req.wIndex, iface->idesc->bInterfaceNumber);
- USETW(req.wLength, 1);
- return usbd_do_request(iface->device, &req, aiface);
-}
-
-/*** Internal routines ***/
-
-/* Dequeue all pipe operations, called at splusb(). */
-static usbd_status
-usbd_ar_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_request_handle reqh;
-
-#if 0
- for (;;) {
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- if (reqh == 0)
- break;
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
- reqh->status = USBD_CANCELLED;
- if (reqh->callback)
- reqh->callback(reqh, reqh->priv, reqh->status);
- }
-#else
- while ((reqh = SIMPLEQ_FIRST(&pipe->queue))) {
- pipe->methods->abort(reqh);
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
- }
-#endif
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Dequeue all interface operations, called at splusb(). */
-static usbd_status
-usbd_ar_iface(iface)
- usbd_interface_handle iface;
-{
- usbd_pipe_handle p;
- usbd_status r, ret = USBD_NORMAL_COMPLETION;
-
- for (p = LIST_FIRST(&iface->pipes); p != 0; p = LIST_NEXT(p, next)) {
- r = usbd_ar_pipe(p);
- if (r != USBD_NORMAL_COMPLETION)
- ret = r;
- }
- return (ret);
-}
-
-static int usbd_global_init_done = 0;
-
-void
-usbd_init()
-{
-#if defined(__FreeBSD__)
- dev_t dev;
-#endif
-
- if (!usbd_global_init_done) {
- usbd_global_init_done = 1;
- SIMPLEQ_INIT(&usbd_free_requests);
-
-#if defined(__FreeBSD__)
- dev = makedev(USB_CDEV_MAJOR, 0);
- cdevsw_add(&dev, &usb_cdevsw, NULL);
-#endif
- }
-}
-
-static void
-usbd_transfer_cb(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
-
- /* Count completed transfers. */
- ++pipe->device->bus->stats.requests
- [pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE];
-
- /* XXX check retry count */
- reqh->done = 1;
- if (reqh->status == USBD_NORMAL_COMPLETION &&
- reqh->actlen < reqh->length &&
- !(reqh->flags & USBD_SHORT_XFER_OK)) {
- DPRINTFN(-1, ("usbd_transfer_cb: short xfer %d<%d (bytes)\n",
- reqh->actlen, reqh->length));
- reqh->status = USBD_SHORT_XFER;
- }
- if (reqh->callback)
- reqh->callback(reqh, reqh->priv, reqh->status);
-}
-
-static void
-usbd_sync_transfer_cb(reqh)
- usbd_request_handle reqh;
-{
- usbd_transfer_cb(reqh);
- if (!reqh->pipe->device->bus->use_polling)
- wakeup(reqh);
-}
-
-/* Like usbd_transfer(), but waits for completion. */
-usbd_status
-usbd_sync_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_status r;
- int s;
-
- reqh->xfercb = usbd_sync_transfer_cb;
- r = usbd_do_transfer(reqh);
- if (r != USBD_IN_PROGRESS)
- return (r);
- s = splusb();
- if (!reqh->done) {
- if (reqh->pipe->device->bus->use_polling)
- panic("usbd_sync_transfer: not done\n");
- tsleep(reqh, PRIBIO, "usbsyn", 0);
- }
- splx(s);
- return (reqh->status);
-}
-
-usbd_status
-usbd_do_request(dev, req, data)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
-{
- return (usbd_do_request_flags(dev, req, data, 0, 0));
-}
-
-usbd_status
-usbd_do_request_flags(dev, req, data, flags, actlen)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
- u_int16_t flags;
- int *actlen;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
-#ifdef DIAGNOSTIC
- if (!curproc) {
- printf("usbd_do_request: not in process context\n");
- return (USBD_XXX);
- }
-#endif
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, req, data,
- UGETW(req->wLength), flags, 0);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- r = usbd_sync_transfer(reqh);
-#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
- if (reqh->actlen > reqh->length)
- printf("usbd_do_request: overrun addr=%d type=0x%02x req=0x"
- "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
- dev->address, reqh->request.bmRequestType,
- reqh->request.bRequest, UGETW(reqh->request.wValue),
- UGETW(reqh->request.wIndex),
- UGETW(reqh->request.wLength),
- reqh->length, reqh->actlen);
-#endif
- if (actlen)
- *actlen = reqh->actlen;
- if (r == USBD_STALLED) {
- /*
- * The control endpoint has stalled. Control endpoints
- * should not halt, but some may do so anyway so clear
- * any halt condition.
- */
- usb_device_request_t treq;
- usb_status_t status;
- u_int16_t s;
- usbd_status nr;
-
- treq.bmRequestType = UT_READ_ENDPOINT;
- treq.bRequest = UR_GET_STATUS;
- USETW(treq.wValue, 0);
- USETW(treq.wIndex, 0);
- USETW(treq.wLength, sizeof(usb_status_t));
- nr = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, &treq, &status,
- sizeof(usb_status_t), 0, 0);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- nr = usbd_sync_transfer(reqh);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- s = UGETW(status.wStatus);
- DPRINTF(("usbd_do_request: status = 0x%04x\n", s));
- if (!(s & UES_HALT))
- goto bad;
- treq.bmRequestType = UT_WRITE_ENDPOINT;
- treq.bRequest = UR_CLEAR_FEATURE;
- USETW(treq.wValue, UF_ENDPOINT_HALT);
- USETW(treq.wIndex, 0);
- USETW(treq.wLength, 0);
- nr = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, &treq, &status,
- 0, 0, 0);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- nr = usbd_sync_transfer(reqh);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- }
-
- bad:
- usbd_free_request(reqh);
- return (r);
-}
-
-void
-usbd_do_request_async_cb(reqh, priv, status)
- usbd_request_handle reqh;
- usbd_private_handle priv;
- usbd_status status;
-{
-#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
- if (reqh->actlen > reqh->length)
- printf("usbd_do_request: overrun addr=%d type=0x%02x req=0x"
- "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
- reqh->pipe->device->address,
- reqh->request.bmRequestType,
- reqh->request.bRequest, UGETW(reqh->request.wValue),
- UGETW(reqh->request.wIndex),
- UGETW(reqh->request.wLength),
- reqh->length, reqh->actlen);
-#endif
- usbd_free_request(reqh);
-}
-
-/*
- * Execute a request without waiting for completion.
- * Can be used from interrupt context.
- */
-usbd_status
-usbd_do_request_async(dev, req, data)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, req, data,
- UGETW(req->wLength), 0, usbd_do_request_async_cb);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_free_request(reqh);
- return (r);
- }
- r = usbd_transfer(reqh);
- if (r != USBD_IN_PROGRESS)
- return (r);
- return (USBD_NORMAL_COMPLETION);
-}
-
-struct usbd_quirks *
-usbd_get_quirks(dev)
- usbd_device_handle dev;
-{
- return (dev->quirks);
-}
-
-void
-usbd_set_disco(p, hdl, data)
- usbd_pipe_handle p;
- void (*hdl) __P((void *));
- void *data;
-{
- p->disco = hdl;
- p->discoarg = data;
-}
-
-/* XXX do periodic free() of free list */
-
-/*
- * Called from keyboard driver when in polling mode.
- */
-void
-usbd_dopoll(iface)
- usbd_interface_handle iface;
-{
- iface->device->bus->do_poll(iface->device->bus);
-}
-
-void
-usbd_set_polling(iface, on)
- usbd_interface_handle iface;
- int on;
-{
- iface->device->bus->use_polling = on;
-}
-
-
-usb_endpoint_descriptor_t *
-usbd_get_endpoint_descriptor(iface, address)
- usbd_interface_handle iface;
- u_int8_t address;
-{
- struct usbd_endpoint *ep;
- int i;
-
- for (i = 0; i < iface->idesc->bNumEndpoints; i++) {
- ep = &iface->endpoints[i];
- if (ep->edesc->bEndpointAddress == address)
- return (iface->endpoints[i].edesc);
- }
- return (0);
-}
-
-#if defined(__FreeBSD__)
-void
-usbd_print_child(device_t parent, device_t child)
-{
- /*
- struct usb_softc *sc = device_get_softc(child);
- */
-
- printf(" at %s%d", device_get_name(parent), device_get_unit(parent));
-
- /* XXX How do we get to the usbd_device_handle???
- usbd_device_handle dev = invalidadosch;
-
- printf(" addr %d", dev->addr);
-
- if (bootverbose) {
- if (dev->lowspeed)
- printf(", lowspeed");
- if (dev->self_powered)
- printf(", self powered");
- else
- printf(", %dmA", dev->power);
- printf(", config %d", dev->config);
- }
- */
-}
-
-/* Reconfigure all the USB busses in the system. */
-int
-usbd_driver_load(module_t mod, int what, void *arg)
-{
- devclass_t usb_devclass = devclass_find("usb");
- devclass_t ugen_devclass = devclass_find("ugen");
- device_t *devlist;
- int devcount;
- int error;
-
- switch (what) {
- case MOD_LOAD:
- case MOD_UNLOAD:
- if (!usb_devclass)
- return 0; /* just ignore call */
-
- if (ugen_devclass) {
- /* detach devices from generic driver if possible */
- error = devclass_get_devices(ugen_devclass, &devlist,
- &devcount);
- if (!error)
- for (devcount--; devcount >= 0; devcount--)
- (void)DEVICE_DETACH(devlist[devcount]);
- }
-
- error = devclass_get_devices(usb_devclass, &devlist, &devcount);
- if (error)
- return 0; /* XXX maybe transient, or error? */
-
- for (devcount--; devcount >= 0; devcount--)
- USB_RECONFIGURE(devlist[devcount]);
-
- free(devlist, M_TEMP);
- return 0;
- }
-
- return 0; /* nothing to do by us */
-}
-
-/* Set the description of the device including a malloc and copy. */
-void
-usbd_device_set_desc(device_t device, char *devinfo)
-{
- size_t l;
- char *desc;
-
- if ( devinfo ) {
- l = strlen(devinfo);
- desc = malloc(l+1, M_USB, M_NOWAIT);
- if (desc)
- memcpy(desc, devinfo, l+1);
- } else
- desc = NULL;
-
- device_set_desc(device, desc);
-}
-
-char *
-usbd_devname(bdevice *bdev)
-{
- static char buf[20];
- /* XXX a static buffer is not exactly a good idea, but the only
- * thing that goes wrong is the string that is being printed
- */
-
- sprintf(buf, "%s%d", device_get_name(*bdev), device_get_unit(*bdev));
- return (buf);
-}
-
-#endif
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
deleted file mode 100644
index 88db91f8cb00..000000000000
--- a/sys/dev/usb/usbdi.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/* $NetBSD: usbdi.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi.h,v 1.4 1999/01/07 23:31:43 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-typedef struct usbd_bus *usbd_bus_handle;
-typedef struct usbd_device *usbd_device_handle;
-typedef struct usbd_interface *usbd_interface_handle;
-typedef struct usbd_pipe *usbd_pipe_handle;
-typedef struct usbd_request *usbd_request_handle;
-typedef void *usbd_private_handle;
-
-typedef enum {
- USBD_ENDPOINT_ACTIVE,
- USBD_ENDPOINT_STALLED,
-} usbd_endpoint_state;
-
-typedef enum {
- USBD_PIPE_ACTIVE,
- USBD_PIPE_STALLED,
- USBD_PIPE_IDLE,
-} usbd_pipe_state;
-
-typedef enum {
- USBD_INTERFACE_ACTIVE,
- USBD_INTERFACE_STALLED,
- USBD_INTERFACE_IDLE,
-} usbd_interface_state;
-
-typedef enum {
- USBD_DEVICE_ATTACHED,
- USBD_DEVICE_POWERED,
- USBD_DEVICE_DEFAULT,
- USBD_DEVICE_ADDRESSED,
- USBD_DEVICE_CONFIGURED,
- USBD_DEVICE_SUSPENDED,
-} usbd_device_state;
-
-typedef enum {
- USBD_NORMAL_COMPLETION = 0,
- USBD_IN_PROGRESS,
- /* errors */
- USBD_PENDING_REQUESTS,
- USBD_NOT_STARTED,
- USBD_INVAL,
- USBD_IS_IDLE,
- USBD_NOMEM,
- USBD_CANCELLED,
- USBD_BAD_ADDRESS,
- USBD_IN_USE,
- USBD_INTERFACE_NOT_ACTIVE,
- USBD_NO_ADDR,
- USBD_SET_ADDR_FAILED,
- USBD_NO_POWER,
- USBD_TOO_DEEP,
- USBD_IOERROR,
- USBD_NOT_CONFIGURED,
- USBD_TIMEOUT,
- USBD_SHORT_XFER,
- USBD_STALLED,
- USBD_INTERRUPTED,
-
- USBD_XXX,
-} usbd_status;
-
-typedef int usbd_lock_token;
-
-typedef void (*usbd_callback) __P((usbd_request_handle, usbd_private_handle,
- usbd_status));
-
-/* Open flags */
-#define USBD_EXCLUSIVE_USE 0x01
-
-/* Request flags */
-#define USBD_XFER_OUT 0x01
-#define USBD_XFER_IN 0x02
-#define USBD_SHORT_XFER_OK 0x04
-
-#define USBD_NO_TIMEOUT 0
-#define USBD_DEFAULT_TIMEOUT 5000 /* ms = 5 s */
-
-usbd_status usbd_open_pipe
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe));
-usbd_status usbd_close_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_transfer __P((usbd_request_handle req));
-usbd_request_handle usbd_alloc_request __P((void));
-usbd_status usbd_free_request __P((usbd_request_handle reqh));
-usbd_status usbd_setup_request
- __P((usbd_request_handle reqh, usbd_pipe_handle pipe,
- usbd_private_handle priv, void *buffer,
- u_int32_t length, u_int16_t flags, u_int32_t timeout,
- usbd_callback));
-usbd_status usbd_setup_device_request
- __P((usbd_request_handle reqh, usb_device_request_t *req));
-usbd_status usbd_setup_default_request
- __P((usbd_request_handle reqh, usbd_device_handle dev,
- usbd_private_handle priv, u_int32_t timeout,
- usb_device_request_t *req, void *buffer,
- u_int32_t length, u_int16_t flags, usbd_callback));
-usbd_status usbd_set_request_timeout
- __P((usbd_request_handle reqh, u_int32_t timeout));
-usbd_status usbd_get_request_status
- __P((usbd_request_handle reqh, usbd_private_handle *priv,
- void **buffer, u_int32_t *count, usbd_status *status));
-usbd_status usbd_request_device_data
- __P((usbd_request_handle reqh, usb_device_request_t *req));
-usb_descriptor_t *usbd_get_descriptor
- __P((usbd_interface_handle *iface, u_int8_t desc_type));
-usb_endpoint_descriptor_t *usbd_interface2endpoint_descriptor
- __P((usbd_interface_handle iface, u_int8_t address));
-usbd_status usbd_set_configuration
- __P((usbd_device_handle dev, u_int8_t conf));
-usbd_status usbd_retry_request
- __P((usbd_request_handle reqh, u_int32_t retry_count));
-usbd_status usbd_abort_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_abort_interface __P((usbd_interface_handle iface));
-usbd_status usbd_reset_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_reset_interface __P((usbd_interface_handle iface));
-usbd_status usbd_clear_endpoint_stall __P((usbd_pipe_handle pipe));
-usbd_status usbd_clear_endpoint_stall_async __P((usbd_pipe_handle pipe));
-usbd_status usbd_set_pipe_state
- __P((usbd_pipe_handle pipe, usbd_pipe_state state));
-usbd_status usbd_get_pipe_state
- __P((usbd_pipe_handle pipe, usbd_pipe_state *state,
- u_int32_t *endpoint_state, u_int32_t *request_count));
-usbd_status usbd_set_interface_state
- __P((usbd_interface_handle iface, usbd_interface_state state));
-usbd_status usbd_get_interface_state
- __P((usbd_interface_handle iface, usbd_interface_state *state));
-usbd_status usbd_get_device_state
- __P((usbd_device_handle dev, usbd_device_state *state));
-usbd_status usbd_set_device_state
- __P((usbd_device_handle dev, usbd_device_state state));
-usbd_status usbd_device_address
- __P((usbd_device_handle dev, u_int8_t *address));
-usbd_status usbd_endpoint_address
- __P((usbd_pipe_handle dev, u_int8_t *address));
-usbd_status usbd_endpoint_count
- __P((usbd_interface_handle dev, u_int8_t *count));
-usbd_status usbd_interface_count
- __P((usbd_device_handle dev, u_int8_t *count));
-#if 0
-u_int8_t usbd_bus_count __P((void));
-#endif
-usbd_status usbd_get_bus_handle __P((u_int8_t index, usbd_bus_handle *bus));
-usbd_status usbd_get_root_hub
- __P((usbd_bus_handle bus, usbd_device_handle *dev));
-usbd_status usbd_port_count __P((usbd_device_handle hub, u_int8_t *nports));
-usbd_status usbd_hub2device_handle
- __P((usbd_device_handle hub, u_int8_t port, usbd_device_handle *dev));
-usbd_status usbd_request2pipe_handle
- __P((usbd_request_handle reqh, usbd_pipe_handle *pipe));
-usbd_status usbd_pipe2interface_handle
- __P((usbd_pipe_handle pipe, usbd_interface_handle *iface));
-usbd_status usbd_interface2device_handle
- __P((usbd_interface_handle iface, usbd_device_handle *dev));
-usbd_status usbd_device2bus_handle
- __P((usbd_device_handle dev, usbd_bus_handle *bus));
-usbd_status usbd_device2interface_handle
- __P((usbd_device_handle dev, u_int8_t ifaceno,
- usbd_interface_handle *iface));
-usbd_status usbd_set_interface_private_handle
- __P((usbd_interface_handle iface, usbd_private_handle priv));
-usbd_status usbd_get_interface_private_handle
- __P((usbd_interface_handle iface, usbd_private_handle *priv));
-usbd_status usbd_reference_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_dereference_pipe __P((usbd_pipe_handle pipe));
-usbd_lock_token usbd_lock __P((void));
-void usbd_unlock __P((usbd_lock_token tok));
-
-/* Non-standard */
-usbd_status usbd_sync_transfer __P((usbd_request_handle req));
-usbd_status usbd_open_pipe_intr
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe,
- usbd_private_handle priv, void *buffer,
- u_int32_t length, usbd_callback));
-usbd_status usbd_open_pipe_iso
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe,
- usbd_private_handle priv, u_int32_t bufsize, u_int32_t nbuf,
- usbd_callback));
-usbd_status usbd_do_request
- __P((usbd_device_handle pipe, usb_device_request_t *req, void *data));
-usbd_status usbd_do_request_async
- __P((usbd_device_handle pipe, usb_device_request_t *req, void *data));
-usbd_status usbd_do_request_flags
- __P((usbd_device_handle pipe, usb_device_request_t *req,
- void *data, u_int16_t flags, int *));
-usb_interface_descriptor_t *usbd_get_interface_descriptor
- __P((usbd_interface_handle iface));
-usb_config_descriptor_t *usbd_get_config_descriptor
- __P((usbd_device_handle dev));
-usb_device_descriptor_t *usbd_get_device_descriptor
- __P((usbd_device_handle dev));
-usbd_status usbd_set_interface __P((usbd_interface_handle, int));
-int usbd_get_no_alts __P((usb_config_descriptor_t *, int));
-usbd_status usbd_get_interface
- __P((usbd_interface_handle iface, u_int8_t *aiface));
-void usbd_fill_deviceinfo
- __P((usbd_device_handle dev, struct usb_device_info *di));
-int usbd_get_interface_altindex __P((usbd_interface_handle iface));
-
-usb_interface_descriptor_t *usbd_find_idesc
- __P((usb_config_descriptor_t *cd, int iindex, int ano));
-usb_endpoint_descriptor_t *usbd_find_edesc
- __P((usb_config_descriptor_t *cd, int ifaceidx, int altidx,
- int endptidx));
-
-void usbd_dopoll __P((usbd_interface_handle));
-void usbd_set_polling __P((usbd_interface_handle iface, int on));
-
-/* NetBSD attachment information */
-
-/* Attach data */
-struct usb_attach_arg {
- int port;
- int configno;
- int ifaceno;
- usbd_device_handle device; /* current device */
- usbd_interface_handle iface; /* current interface */
- int usegeneric;
- usbd_interface_handle *ifaces; /* all interfaces */
- int nifaces; /* number of interfaces */
-};
-
-#if defined(__NetBSD__)
-/* Match codes. */
-/* First five codes is for a whole device. */
-#define UMATCH_VENDOR_PRODUCT_REV 14
-#define UMATCH_VENDOR_PRODUCT 13
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO 12
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO 11
-#define UMATCH_DEVCLASS_DEVSUBCLASS 10
-/* Next six codes are for interfaces. */
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE 9
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE 8
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO 7
-#define UMATCH_VENDOR_IFACESUBCLASS 6
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO 5
-#define UMATCH_IFACECLASS_IFACESUBCLASS 4
-#define UMATCH_IFACECLASS 3
-#define UMATCH_IFACECLASS_GENERIC 2
-/* Generic driver */
-#define UMATCH_GENERIC 1
-/* No match */
-#define UMATCH_NONE 0
-
-#elif defined(__FreeBSD__)
-/* FreeBSD needs values less than zero */
-/* for the moment disabled
-#define UMATCH_VENDOR_PRODUCT_REV -14
-#define UMATCH_VENDOR_PRODUCT -13
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO -12
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO -11
-#define UMATCH_DEVCLASS_DEVSUBCLASS -10
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE -9
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE -8
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO -7
-#define UMATCH_VENDOR_IFACESUBCLASS -6
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO -5
-#define UMATCH_IFACECLASS_IFACESUBCLASS -4
-#define UMATCH_IFACECLASS -3
-#define UMATCH_IFACECLASS_GENERIC -2
-#define UMATCH_GENERIC -1
-#define UMATCH_NONE ENXIO
-
-* For the moment we use Yes/No answers with appropriate
-* sorting in the config file
-*/
-#define UMATCH_VENDOR_PRODUCT_REV 0
-#define UMATCH_VENDOR_PRODUCT 0
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO 0
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO 0
-#define UMATCH_DEVCLASS_DEVSUBCLASS 0
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE 0
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE 0
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO 0
-#define UMATCH_VENDOR_IFACESUBCLASS 0
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO 0
-#define UMATCH_IFACECLASS_IFACESUBCLASS 0
-#define UMATCH_IFACECLASS 0
-#define UMATCH_IFACECLASS_GENERIC 0
-#define UMATCH_GENERIC 0
-#define UMATCH_NONE ENXIO
-
-
-#endif
-
-void usbd_devinfo __P((usbd_device_handle, int, char *));
-struct usbd_quirks *usbd_get_quirks __P((usbd_device_handle));
-void usbd_set_disco __P((usbd_pipe_handle, void (*)(void *), void *));
-usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor
- __P((usbd_interface_handle iface, u_int8_t address));
-
-#if defined(__FreeBSD__)
-int usbd_driver_load __P((module_t mod, int what, void *arg));
-void usbd_device_set_desc __P((device_t device, char *devinfo));
-char *usbd_devname(bdevice *bdev);
-bus_print_child_t usbd_print_child;
-#endif
-
-/* XXX */
-#define splusb splbio
-#define IPL_USB IPL_BIO
-/* XXX */
-
diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c
deleted file mode 100644
index fbb7a809ef40..000000000000
--- a/sys/dev/usb/usbdi_util.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/* $NetBSD: usbdi_util.c,v 1.13 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi_util.c,v 1.5 1999/01/07 23:31:43 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-usbd_status
-usbd_get_desc(dev, type, index, len, desc)
- usbd_device_handle dev;
- int type, index;
- int len;
- void *desc;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, type, index);
- USETW(req.wIndex, 0);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, desc));
-}
-
-usbd_status
-usbd_get_config_desc(dev, conf, d)
- usbd_device_handle dev;
- int conf;
- usb_config_descriptor_t *d;
-{
- usbd_status r;
-
- DPRINTFN(3,("usbd_get_config_desc: conf=%d\n", conf));
- r = usbd_get_desc(dev, UDESC_CONFIG, conf,
- USB_CONFIG_DESCRIPTOR_SIZE, d);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (d->bDescriptorType != UDESC_CONFIG) {
- DPRINTFN(-1,("usbd_get_config_desc: conf %d, bad desc %d\n",
- conf, d->bDescriptorType));
- return (USBD_INVAL);
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_config_desc_full(dev, conf, d, size)
- usbd_device_handle dev;
- int conf;
- void *d;
- int size;
-{
- DPRINTFN(3,("usbd_get_config_desc_full: conf=%d\n", conf));
- return (usbd_get_desc(dev, UDESC_CONFIG, conf, size, d));
-}
-
-usbd_status
-usbd_get_device_desc(dev, d)
- usbd_device_handle dev;
- usb_device_descriptor_t *d;
-{
- DPRINTFN(3,("usbd_get_device_desc:\n"));
- return (usbd_get_desc(dev, UDESC_DEVICE,
- 0, USB_DEVICE_DESCRIPTOR_SIZE, d));
-}
-
-usbd_status
-usbd_get_device_status(dev, st)
- usbd_device_handle dev;
- usb_status_t *st;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, sizeof(usb_status_t));
- return (usbd_do_request(dev, &req, st));
-}
-
-usbd_status
-usbd_get_hub_status(dev, st)
- usbd_device_handle dev;
- usb_hub_status_t *st;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_CLASS_DEVICE;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, sizeof(usb_hub_status_t));
- return (usbd_do_request(dev, &req, st));
-}
-
-usbd_status
-usbd_set_address(dev, addr)
- usbd_device_handle dev;
- int addr;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_DEVICE;
- req.bRequest = UR_SET_ADDRESS;
- USETW(req.wValue, addr);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 0);
- return usbd_do_request(dev, &req, 0);
-}
-
-usbd_status
-usbd_get_port_status(dev, port, ps)
- usbd_device_handle dev;
- int port;
- usb_port_status_t *ps;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_CLASS_OTHER;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, port);
- USETW(req.wLength, sizeof *ps);
- return (usbd_do_request(dev, &req, ps));
-}
-
-usbd_status
-usbd_clear_port_feature(dev, port, sel)
- usbd_device_handle dev;
- int port, sel;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, sel);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_port_feature(dev, port, sel)
- usbd_device_handle dev;
- int port, sel;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SET_FEATURE;
- USETW(req.wValue, sel);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-
-usbd_status
-usbd_set_protocol(iface, report)
- usbd_interface_handle iface;
- int report;
-{
- usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_protocol: iface=%p, report=%d, endpt=%d\n",
- iface, report, id->bInterfaceNumber));
- if (!id)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!id)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_PROTOCOL;
- USETW(req.wValue, report);
- USETW(req.wIndex, id->bInterfaceNumber);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_report(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, data));
-}
-
-usbd_status
-usbd_set_report_async(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report_async: len=%d\n", len));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request_async(dev, &req, data));
-}
-
-usbd_status
-usbd_get_report(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
- if (!id)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, data));
-}
-
-usbd_status
-usbd_set_idle(iface, duration, id)
- usbd_interface_handle iface;
- int duration;
- int id;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_idle: %d %d\n", duration, id));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_IDLE;
- USETW2(req.wValue, duration, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_get_report_descriptor(dev, ifcno, repid, size, d)
- usbd_device_handle dev;
- int ifcno;
- int repid;
- int size;
- void *d;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_INTERFACE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, UDESC_REPORT, repid);
- USETW(req.wIndex, ifcno);
- USETW(req.wLength, size);
- return (usbd_do_request(dev, &req, d));
-}
-
-usb_hid_descriptor_t *
-usbd_get_hid_descriptor(ifc)
- usbd_interface_handle ifc;
-{
- usb_interface_descriptor_t *idesc = usbd_get_interface_descriptor(ifc);
- usbd_device_handle dev;
- usb_config_descriptor_t *cdesc;
- usb_hid_descriptor_t *hd;
- char *p, *end;
- usbd_status r;
-
- if (!idesc)
- return (0);
- r = usbd_interface2device_handle(ifc, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- cdesc = usbd_get_config_descriptor(dev);
-
- p = (char *)idesc + idesc->bLength;
- end = (char *)cdesc + UGETW(cdesc->wTotalLength);
-
- for (; p < end; p += hd->bLength) {
- hd = (usb_hid_descriptor_t *)p;
- if (p + hd->bLength <= end && hd->bDescriptorType == UDESC_HID)
- return (hd);
- if (hd->bDescriptorType == UDESC_INTERFACE)
- break;
- }
- return (0);
-}
-
-usbd_status
-usbd_alloc_report_desc(ifc, descp, sizep, mem)
- usbd_interface_handle ifc;
- void **descp;
- int *sizep;
-#if defined(__NetBSD__)
- int mem;
-#elif defined(__FreeBSD__)
- struct malloc_type *mem;
-#endif
-
-{
- usb_interface_descriptor_t *id;
- usb_hid_descriptor_t *hid;
- usbd_device_handle dev;
- usbd_status r;
-
- r = usbd_interface2device_handle(ifc, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- id = usbd_get_interface_descriptor(ifc);
- if (!id)
- return (USBD_INVAL);
- hid = usbd_get_hid_descriptor(ifc);
- if (!hid)
- return (USBD_IOERROR);
- *sizep = UGETW(hid->descrs[0].wDescriptorLength);
- *descp = malloc(*sizep, mem, M_NOWAIT);
- if (!*descp)
- return (USBD_NOMEM);
- /* XXX should not use 0 Report ID */
- r = usbd_get_report_descriptor(dev, id->bInterfaceNumber, 0,
- *sizep, *descp);
- if (r != USBD_NORMAL_COMPLETION) {
- free(*descp, mem);
- return (r);
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_config(dev, conf)
- usbd_device_handle dev;
- u_int8_t *conf;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_CONFIG;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 1);
- return (usbd_do_request(dev, &req, conf));
-}
-
-static void usbd_bulk_transfer_cb __P((usbd_request_handle reqh,
- usbd_private_handle priv, usbd_status status));
-static void
-usbd_bulk_transfer_cb(reqh, priv, status)
- usbd_request_handle reqh;
- usbd_private_handle priv;
- usbd_status status;
-{
- wakeup(reqh);
-}
-
-usbd_status
-usbd_bulk_transfer(reqh, pipe, flags, buf, size, lbl)
- usbd_request_handle reqh;
- usbd_pipe_handle pipe;
- u_int16_t flags;
- void *buf;
- u_int32_t *size;
- char *lbl;
-{
- usbd_private_handle priv;
- void *buffer;
- usbd_status r;
- int s, error;
-
- r = usbd_setup_request(reqh, pipe, 0, buf, *size,
- flags, USBD_NO_TIMEOUT, usbd_bulk_transfer_cb);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- DPRINTFN(1, ("usbd_bulk_transfer: start transfer %d bytes\n", *size));
- s = splusb(); /* don't want callback until tsleep() */
- r = usbd_transfer(reqh);
- if (r != USBD_IN_PROGRESS) {
- splx(s);
- return (r);
- }
- error = tsleep((caddr_t)reqh, PZERO | PCATCH, lbl, 0);
- splx(s);
- if (error) {
- usbd_abort_pipe(pipe);
- return (USBD_INTERRUPTED);
- }
- usbd_get_request_status(reqh, &priv, &buffer, size, &r);
- DPRINTFN(1,("usbd_bulk_transfer: transferred %d\n", *size));
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_bulk_transfer: error=%d\n", r));
- usbd_clear_endpoint_stall(pipe);
- }
- return (r);
-}
-
diff --git a/sys/dev/usb/usbdi_util.h b/sys/dev/usb/usbdi_util.h
deleted file mode 100644
index f5d700d1d91c..000000000000
--- a/sys/dev/usb/usbdi_util.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $NetBSD: usbdi_util.h,v 1.12 1999/01/01 15:25:57 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-usbd_status usbd_get_desc __P((usbd_device_handle dev, int type,
- int index, int len, void *desc));
-usbd_status usbd_get_config_desc __P((usbd_device_handle, int,
- usb_config_descriptor_t *));
-usbd_status usbd_get_config_desc_full __P((usbd_device_handle, int,
- void *, int));
-usbd_status usbd_get_device_desc __P((usbd_device_handle dev,
- usb_device_descriptor_t *d));
-usbd_status usbd_set_address __P((usbd_device_handle dev, int addr));
-usbd_status usbd_get_port_status __P((usbd_device_handle,
- int, usb_port_status_t *));
-usbd_status usbd_set_port_feature __P((usbd_device_handle dev, int, int));
-usbd_status usbd_clear_port_feature __P((usbd_device_handle, int, int));
-usbd_status usbd_get_device_status __P((usbd_device_handle,usb_status_t*));
-usbd_status usbd_get_hub_status __P((usbd_device_handle dev,
- usb_hub_status_t *st));
-usbd_status usbd_set_protocol __P((usbd_interface_handle dev, int report));
-usbd_status usbd_get_report_descriptor
- __P((usbd_device_handle dev, int ifcno, int repid, int size, void *d));
-struct usb_hid_descriptor *usbd_get_hid_descriptor
- __P((usbd_interface_handle ifc));
-usbd_status usbd_set_report
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_set_report_async
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_get_report
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_set_idle
- __P((usbd_interface_handle iface, int duration, int id));
-#if defined(__NetBSD__)
-usbd_status usbd_alloc_report_desc
- __P((usbd_interface_handle ifc, void **descp, int *sizep, int mem));
-#elif defined(__FreeBSD__)
-usbd_status usbd_alloc_report_desc
- __P((usbd_interface_handle ifc, void **descp, int *sizep, struct malloc_type * mem));
-#endif
-usbd_status usbd_get_config
- __P((usbd_device_handle dev, u_int8_t *conf));
-usbd_status usbd_get_string_desc
- __P((usbd_device_handle dev, int sindex, int langid,
- usb_string_descriptor_t *sdesc));
-void usbd_delay_ms __P((usbd_device_handle, u_int));
-
-
-usbd_status usbd_set_config_no
- __P((usbd_device_handle dev, int no, int msg));
-usbd_status usbd_set_config_index
- __P((usbd_device_handle dev, int index, int msg));
-
-usbd_status usbd_bulk_transfer
- __P((usbd_request_handle reqh, usbd_pipe_handle pipe, u_int16_t flags,
- void *buf, u_int32_t *size, char *lbl));
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
deleted file mode 100644
index 7c89b777e3d0..000000000000
--- a/sys/dev/usb/usbdivar.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* $NetBSD: usbdivar.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdivar.h,v 1.6 1999/01/07 23:31:45 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-struct usbd_request;
-struct usbd_pipe;
-
-struct usbd_endpoint {
- usb_endpoint_descriptor_t *edesc;
- usbd_endpoint_state state;
- int refcnt;
- int toggle; /* XXX */
-};
-
-typedef void (*usbd_xfercb)__P((usbd_request_handle req));
-
-struct usbd_methods {
- usbd_status (*transfer)__P((usbd_request_handle reqh));
- usbd_status (*start)__P((usbd_request_handle reqh));
- void (*abort)__P((usbd_request_handle reqh));
- void (*close)__P((usbd_pipe_handle pipe));
- usbd_status (*isobuf)__P((usbd_pipe_handle pipe,
- u_int32_t bufsize,u_int32_t nbuf));
-};
-
-struct usbd_port {
- usb_port_status_t status;
- u_int16_t power; /* mA of current on port */
- u_int8_t portno;
- u_int8_t restartcnt;
-#define USBD_RESTART_MAX 5
- struct usbd_device *device;
- struct usbd_device *parent; /* The ports hub */
-};
-
-struct usbd_hub {
- usbd_status (*explore)__P((usbd_device_handle hub));
- void *hubsoftc;
- usb_hub_descriptor_t hubdesc;
- struct usbd_port ports[1];
-};
-
-struct usb_softc;
-
-/*****/
-
-struct usbd_bus {
- /* Filled by HC driver */
- bdevice bdev; /* base device, host adapter */
- usbd_status (*open_pipe)__P((struct usbd_pipe *pipe));
- u_int32_t pipe_size; /* size of a pipe struct */
- void (*do_poll)__P((struct usbd_bus *));
- /* Filled by usb driver */
- struct usbd_device *root_hub;
- usbd_device_handle devices[USB_MAX_DEVICES];
- char needs_explore;/* a hub a signalled a change */
- char use_polling;
- struct usb_softc *usbctl;
- struct usb_device_stats stats;
-};
-
-struct usbd_device {
- struct usbd_bus *bus;
- usbd_device_state state;
- struct usbd_pipe *default_pipe;
- u_int8_t address;
- u_int8_t depth;
- u_int8_t lowspeed;
- u_int16_t power;
- u_int8_t self_powered;
- int config;
- int langid; /* language to use for strings */
-#define USBD_NOLANG (-1)
- struct usbd_port *powersrc;
- struct usbd_endpoint def_ep; /* for pipe 0 */
- usb_endpoint_descriptor_t def_ep_desc; /* for pipe 0 */
- struct usbd_interface *ifaces;
- usb_device_descriptor_t ddesc;
- usb_config_descriptor_t *cdesc; /* full config descr */
- struct usbd_quirks *quirks;
- struct usbd_hub *hub; /* only if this is a hub */
- void *softc; /* device softc if attached */
-};
-
-struct usbd_interface {
- struct usbd_device *device;
- usbd_interface_state state;
- usb_interface_descriptor_t *idesc;
- int index;
- int altindex;
- struct usbd_endpoint *endpoints;
- void *priv;
- LIST_HEAD(, usbd_pipe) pipes;
-};
-
-struct usbd_pipe {
- struct usbd_interface *iface;
- struct usbd_device *device;
- struct usbd_endpoint *endpoint;
- usbd_pipe_state state;
- int32_t refcnt;
- char running;
- SIMPLEQ_HEAD(, usbd_request) queue;
- LIST_ENTRY(usbd_pipe) next;
-
- void (*disco) __P((void *));
- void *discoarg;
-
- usbd_request_handle intrreqh; /* used for repeating requests */
-
- /* Filled by HC driver. */
- struct usbd_methods *methods;
-};
-
-struct usbd_request {
- struct usbd_pipe *pipe;
- void *priv;
- void *buffer;
- u_int32_t length;
- u_int32_t actlen;
- u_int16_t flags;
- u_int32_t timeout;
- usbd_status status;
- usbd_callback callback;
- usbd_xfercb xfercb;
- u_int32_t retries;
- char done;
-
- usb_device_request_t request;
- u_int8_t isreq;
-
- SIMPLEQ_ENTRY(usbd_request) next;
-
- void *hcpriv; /* XXX private use by the HC driver */
-
-#if defined(__FreeBSD__)
- struct callout_handle timo_handle;
-#endif
-};
-
-void usbd_init __P((void));
-
-/* Routines from usb_subr.c */
-int usbctlprint __P((void *, const char *));
-void usb_delay_ms __P((usbd_bus_handle, u_int));
-void usbd_devinfo_vp __P((usbd_device_handle, char *, char *));
-usbd_status usbd_reset_port __P((usbd_device_handle dev,
- int port, usb_port_status_t *ps));
-usbd_status usbd_setup_pipe __P((usbd_device_handle dev,
- usbd_interface_handle iface,
- struct usbd_endpoint *,
- usbd_pipe_handle *pipe));
-usbd_status usbd_new_device __P((bdevice *parent,
- usbd_bus_handle bus, int depth,
- int lowspeed, int port,
- struct usbd_port *));
-void usbd_remove_device __P((usbd_device_handle,
- struct usbd_port *));
-int usbd_printBCD __P((char *cp, int bcd));
-usbd_status usb_insert_transfer __P((usbd_request_handle reqh));
-void usb_start_next __P((usbd_pipe_handle pipe));
-usbd_status usbd_fill_iface_data __P((usbd_device_handle dev,
- int i, int a));
-
-/* Routines from usb.c */
-int usb_bus_count __P((void));
-usbd_status usb_get_bus_handle __P((int, usbd_bus_handle *));
-void usb_needs_explore __P((usbd_bus_handle));
-
-/* Locator stuff. */
-
-#if defined(__NetBSD__)
-#include "locators.h"
-#elif defined(__FreeBSD__)
-/* XXX these values are used to statically bind some elements in the USB tree
- * to specific driver instances. This should be somehow emulated in FreeBSD
- * but can be done later on.
- * The values are copied from the files.usb file in the NetBSD sources.
- */
-#define UHUBCF_PORT_DEFAULT -1
-#define UHUBCF_CONFIGURATION_DEFAULT -1
-#define UHUBCF_INTERFACE_DEFAULT -1
-#endif
-
-#define uhubcf_port cf_loc[UHUBCF_PORT]
-#define uhubcf_configuration cf_loc[UHUBCF_CONFIGURATION]
-#define uhubcf_interface cf_loc[UHUBCF_INTERFACE]
-#define UHUB_UNK_PORT UHUBCF_PORT_DEFAULT /* wildcarded 'port' */
-#define UHUB_UNK_CONFIGURATION UHUBCF_CONFIGURATION_DEFAULT /* wildcarded 'configuration' */
-#define UHUB_UNK_INTERFACE UHUBCF_INTERFACE_DEFAULT /* wildcarded 'interface' */
-
diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h
deleted file mode 100644
index edec4130e147..000000000000
--- a/sys/dev/usb/usbhid.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $NetBSD: usbhid.h,v 1.3 1998/12/26 12:53:04 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * 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 _USBHID_H_
-#define _USBHID_H_
-
-#define UR_GET_HID_DESCRIPTOR 0x06
-#define UDESC_HID 0x21
-#define UDESC_REPORT 0x22
-#define UDESC_PHYSICAL 0x23
-#define UR_SET_HID_DESCRIPTOR 0x07
-#define UR_GET_REPORT 0x01
-#define UR_SET_REPORT 0x09
-#define UR_GET_IDLE 0x02
-#define UR_SET_IDLE 0x0a
-#define UR_GET_PROTOCOL 0x03
-#define UR_SET_PROTOCOL 0x0b
-
-typedef struct usb_hid_descriptor {
- uByte bLength;
- uByte bDescriptorType;
- uWord bcdHID;
- uByte bCountryCode;
- uByte bNumDescriptors;
- struct {
- uByte bDescriptorType;
- uWord wDescriptorLength;
- } descrs[1];
-} usb_hid_descriptor_t;
-#define USB_HID_DESCRIPTOR_SIZE(n) (9+(n)*3)
-
-/* Usage pages */
-#define HUP_GENERIC_DESKTOP 0x0001
-#define HUP_SIMULATION 0x0002
-#define HUP_LEDS 0x0008
-#define HUP_BUTTON 0x0009
-
-/* Usages, generic desktop */
-#define HUG_POINTER 0x0001
-#define HUG_MOUSE 0x0002
-#define HUG_JOYSTICK 0x0004
-#define HUG_GAME_PAD 0x0005
-#define HUG_KEYBOARD 0x0006
-#define HUG_KEYPAD 0x0007
-#define HUG_X 0x0030
-#define HUG_Y 0x0031
-#define HUG_Z 0x0032
-#define HUG_RX 0x0033
-#define HUG_RY 0x0034
-#define HUG_RZ 0x0035
-#define HUG_SLIDER 0x0036
-#define HUG_DIAL 0x0037
-#define HUG_WHEEL 0x0038
-#define HUG_HAT_SWITCH 0x0039
-#define HUG_COUNTED_BUFFER 0x003a
-#define HUG_BYTE_COUNT 0x003b
-#define HUG_MOTION_WAKEUP 0x003c
-#define HUG_VX 0x0040
-#define HUG_VY 0x0041
-#define HUG_VZ 0x0042
-#define HUG_VBRX 0x0043
-#define HUG_VBRY 0x0044
-#define HUG_VBRZ 0x0045
-#define HUG_VNO 0x0046
-#define HUG_SYSTEM_CONTROL 0x0080
-#define HUG_SYSTEM_POWER_DOWN 0x0081
-#define HUG_SYSTEM_SLEEP 0x0082
-#define HUG_SYSTEM_WAKEUP 0x0083
-#define HUG_SYSTEM_CONTEXT_MENU 0x0084
-#define HUG_SYSTEM_MAIN_MENU 0x0085
-#define HUG_SYSTEM_APP_MENU 0x0086
-#define HUG_SYSTEM_MENU_HELP 0x0087
-#define HUG_SYSTEM_MENU_EXIT 0x0088
-#define HUG_SYSTEM_MENU_SELECT 0x0089
-#define HUG_SYSTEM_MENU_RIGHT 0x008a
-#define HUG_SYSTEM_MENU_LEFT 0x008b
-#define HUG_SYSTEM_MENU_UP 0x008c
-#define HUG_SYSTEM_MENU_DOWN 0x008d
-
-#define HID_USAGE2(p,u) (((p) << 16) | u)
-
-#define UHID_INPUT_REPORT 0x01
-#define UHID_OUTPUT_REPORT 0x02
-#define UHID_FEATURE_REPORT 0x03
-
-/* Bits in the input/output/feature items */
-#define HIO_CONST 0x001
-#define HIO_VARIABLE 0x002
-#define HIO_RELATIVE 0x004
-#define HIO_WRAP 0x008
-#define HIO_NONLINEAR 0x010
-#define HIO_NOPREF 0x020
-#define HIO_NULLSTATE 0x040
-#define HIO_VOLATILE 0x080
-#define HIO_BUFBYTES 0x100
-
-#endif /* _USBHID_H_ */
diff --git a/sys/dev/vinum/COPYRIGHT b/sys/dev/vinum/COPYRIGHT
deleted file mode 100644
index ed43ff1f54eb..000000000000
--- a/sys/dev/vinum/COPYRIGHT
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: COPYRIGHT,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
- */
diff --git a/sys/dev/vinum/Makefile b/sys/dev/vinum/Makefile
deleted file mode 100644
index 363aa7a1e1b5..000000000000
--- a/sys/dev/vinum/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $Id: Makefile,v 1.4 1998/12/28 04:56:22 peter Exp $
-
-.PATH: ${.CURDIR}/../../sys/dev/ccd
-KMOD= vinum_mod
-SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
- state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
- vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
-NOMAN=
-PSEUDO_LKM=
-CFLAGS = -I${.CURDIR} -O -g -DVINUMDEBUG -Wall -Wno-unused -Wno-parentheses
-
-CLEANFILES+= vinum.h vnode_if.h vnode_if.c
-
-all:
-
-# We don't need this, but the Makefile wants it
-vinum.h:
- touch $@
-
-state.h: maketabs vinumstate.h
- ./maketabs >state.h
-
-maketabs: maketabs.c
- ${CC} -g -o maketabs maketabs.c
-
-.include <bsd.kmod.mk>
diff --git a/sys/dev/vinum/makestatetext b/sys/dev/vinum/makestatetext
deleted file mode 100755
index 02a927e4e308..000000000000
--- a/sys/dev/vinum/makestatetext
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-# Make statetexts.h from vinumstate.h
-# $Id: makestatetext,v 1.5 1999/01/15 07:30:45 grog Exp grog $
-infile=vinumstate.h
-ofile=statetexts.h
-cat > $ofile <<FOO
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called \`\`Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 \`\`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 company 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.
- *
- */
-
-FOO
-
-echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
-echo >>$ofile
-echo >>$ofile "/* Drive state texts */"
-echo >>$ofile "char *drivestatetext [] =
- { "
-egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Subdisk state texts */
-char *sdstatetext [] =
- {
-FOO
-egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Plex state texts */
-char *plexstatetext [] =
- {
-FOO
-egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Volume state texts */
-char *volstatetext [] =
- {
-FOO
-egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-FOO
diff --git a/sys/dev/vinum/request.h b/sys/dev/vinum/request.h
deleted file mode 100644
index dfeb19604ca2..000000000000
--- a/sys/dev/vinum/request.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: request.h,v 1.13 1999/01/14 05:46:22 grog Exp grog $
- */
-
-/* Information needed to set up a transfer */
-
-enum xferinfo {
- XFR_NORMAL_READ = 1,
- XFR_NORMAL_WRITE = 2, /* write request in normal mode */
- XFR_RECOVERY_READ = 4,
- XFR_DEGRADED_WRITE = 8,
- XFR_PARITYLESS_WRITE = 0x10,
- XFR_NO_PARITY_STRIPE = 0x20, /* parity stripe is not available */
- XFR_DATA_BLOCK = 0x40, /* data block in request */
- XFR_PARITY_BLOCK = 0x80, /* parity block in request */
- XFR_BAD_SUBDISK = 0x100, /* this subdisk is dead */
- XFR_MALLOCED = 0x200, /* this buffer is malloced */
-#if VINUMDEBUG
- XFR_PHASE2 = 0x800, /* documentation only: 2nd phase write */
-#endif
- XFR_REVIVECONFLICT = 0x1000, /* possible conflict with a revive operation */
- /* operations that need a parity block */
- XFR_PARITYOP = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE),
- /* operations that use the group parameters */
- XFR_GROUPOP = (XFR_DEGRADED_WRITE | XFR_RECOVERY_READ),
- /* operations that that use the data parameters */
- XFR_DATAOP = (XFR_NORMAL_READ | XFR_NORMAL_WRITE | XFR_PARITYLESS_WRITE),
- /* operations requiring read before write */
- XFR_RBW = (XFR_NORMAL_WRITE | XFR_DEGRADED_WRITE),
- /* operations that need a malloced buffer */
- XFR_NEEDS_MALLOC = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE)
-};
-
-/* Describe one low-level request, part
- * of a high-level request. This is an
- * extended struct buf buffer, and the first
- * element *must* be a struct buf. We pass this structure
- * to the I/O routines instead of a struct buf in oder
- * to be able to locate the high-level request when it
- * completes.
- *
- * All offsets and lengths are in "blocks", i.e. sectors */
-struct rqelement {
- struct buf b; /* buf structure */
- struct rqgroup *rqg; /* pointer to our group */
- /* Information about the transfer */
- daddr_t sdoffset; /* offset in subdisk */
- int useroffset; /* offset in user buffer of normal data */
- /* dataoffset and datalen refer to "individual"
- * data transfers (normal read, parityless write)
- * and also degraded write.
- *
- * groupoffset and grouplen refer to the other
- * "group" operations (normal write, recovery read)
- * Both the offsets are relative to the start of the
- * local buffer */
- int dataoffset; /* offset in buffer of the normal data */
- int groupoffset; /* offset in buffer of group data */
- short datalen; /* length of normal data (sectors) */
- short grouplen; /* length of group data (sectors) */
- short buflen; /* total buffer length to allocate */
- short flags; /* really enum xferinfo (see above) */
- /* Ways to find other components */
- short sdno; /* subdisk number */
- short driveno; /* drive number */
-};
-
-/* A group of requests built to satisfy a certain
- * component of a user request */
-struct rqgroup {
- struct rqgroup *next; /* pointer to next group */
- struct request *rq; /* pointer to the request */
- short count; /* number of requests in this group */
- short active; /* and number active */
- short plexno; /* index of plex */
- int badsdno; /* index of bad subdisk or -1 */
- enum xferinfo flags; /* description of transfer */
- struct rqelement rqe[0]; /* and the elements of this request */
-};
-
-/* Describe one high-level request and the
- * work we have to do to satisfy it */
-struct request {
- struct buf *bp; /* pointer to the high-level request */
- enum xferinfo flags;
- union {
- int volno; /* volume index */
- int plexno; /* or plex index */
- } volplex;
- int error; /* current error indication */
- int sdno; /* reviving subdisk (XFR_REVIVECONFLICT) */
- short isplex; /* set if this is a plex request */
- short active; /* number of subrequests still active */
- struct rqgroup *rqg; /* pointer to the first group of requests */
- struct rqgroup *lrqg; /* and to the last group of requests */
- struct request *next; /* link of waiting requests */
-};
-
-/* Extended buffer header for subdisk I/O. Includes
- * a pointer to the user I/O request. */
-struct sdbuf {
- struct buf b; /* our buffer */
- struct buf *bp; /* and pointer to parent */
- short driveno; /* drive index */
- short sdno; /* and subdisk index */
-};
-
-/* Values returned by rqe and friends.
- * Be careful with these: they are in order of increasing
- * seriousness. Some routines check for > REQUEST_RECOVERED
- * to indicate a completely failed request. */
-enum requeststatus {
- REQUEST_OK, /* request built OK */
- REQUEST_RECOVERED, /* request OK, but involves RAID5 recovery */
- REQUEST_EOF, /* request failed: outside plex */
- REQUEST_DOWN, /* request failed: subdisk down */
- REQUEST_ENOMEM /* ran out of memory */
-};
-
-#ifdef VINUMDEBUG
-/* Trace entry for request info (DEBUG_LASTREQS) */
-enum rqinfo_type {
- loginfo_unused, /* never been used */
- loginfo_user_bp, /* this is the bp when strategy is called */
- loginfo_user_bpl, /* and this is the bp at launch time */
- loginfo_rqe, /* user RQE */
- loginfo_iodone, /* iodone */
- loginfo_raid5_data, /* write RAID-5 data block */
- loginfo_raid5_parity /* write RAID-5 parity block */
-};
-
-union rqinfou { /* info to pass to logrq */
- struct buf *bp;
- struct rqelement *rqe; /* address of request, for correlation */
-};
-
-struct rqinfo {
- enum rqinfo_type type; /* kind of event */
- struct timeval timestamp; /* time it happened */
- struct buf *bp; /* point to user buffer */
- union {
- struct buf b; /* yup, the *whole* buffer header */
- struct rqelement rqe; /* and the whole rqe */
- } info;
-};
-
-#define RQINFO_SIZE 128 /* number of info slots in buffer */
-
-void logrq(enum rqinfo_type type, union rqinfou info, struct buf *ubp);
-#endif
-
-/* Structures for the daemon */
-
-/* types of request to the daemon */
-enum daemonrq {
- daemonrq_none, /* dummy to catch bugs */
- daemonrq_ioerror, /* error occurred on I/O */
- daemonrq_saveconfig, /* save configuration */
- daemonrq_return, /* return to userland */
- daemonrq_ping, /* show sign of life */
- daemonrq_init, /* initialize a plex */
- daemonrq_revive, /* revive a subdisk */
-};
-
-/* info field for daemon requests */
-union daemoninfo { /* and the request information */
- struct request *rq; /* for daemonrq_ioerror */
- struct sd *sd; /* for daemonrq_revive */
- struct plex *plex; /* for daemonrq_init */
-};
-
-struct daemonq {
- struct daemonq *next; /* pointer to next element in queue */
- enum daemonrq type; /* type of request */
- union daemoninfo info; /* and the request information */
-};
-
-void queue_daemon_request(enum daemonrq type, union daemoninfo info);
-
-extern int daemon_options;
-
-enum daemon_option {
- daemon_verbose = 1, /* talk about what we're doing */
- daemon_stopped = 2,
- daemon_noupdate = 4, /* don't update the disk config, for recovery */
-};
diff --git a/sys/dev/vinum/statetexts.h b/sys/dev/vinum/statetexts.h
deleted file mode 100644
index 1388400b46ee..000000000000
--- a/sys/dev/vinum/statetexts.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- */
-
-/* Created by ./makestatetext on Wed Jan 20 16:30:10 CST 1999. Do not edit */
-
-/* Drive state texts */
-char *drivestatetext[] =
-{
- "unallocated",
- "uninit",
- "down",
- "up",
-};
-
-/* Subdisk state texts */
-char *sdstatetext[] =
-{
- "unallocated",
- "uninit",
- "init",
- "empty",
- "initializing",
- "obsolete",
- "stale",
- "crashed",
- "down",
- "reviving",
- "reborn",
- "up",
-};
-
-/* Plex state texts */
-char *plexstatetext[] =
-{
- "unallocated",
- "init",
- "faulty",
- "down",
- "initializing",
- "corrupt",
- "degraded",
- "flaky",
- "up",
-};
-
-/* Volume state texts */
-char *volstatetext[] =
-{
- "unallocated",
- "uninit",
- "down",
- "up",
-};
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
deleted file mode 100644
index 5d0dad245559..000000000000
--- a/sys/dev/vinum/vinum.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinum.c,v 1.23 1999/01/15 05:03:15 grog Exp grog $
- */
-
-#define STATIC /* nothing while we're testing XXX */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <sys/sysproto.h> /* for sync(2) */
-#ifdef VINUMDEBUG
-#include <sys/reboot.h>
-int debug = 0;
-#endif
-#include <dev/vinum/request.h>
-
-STATIC struct cdevsw vinum_cdevsw =
-{
- vinumopen, vinumclose, vinumread, vinumwrite,
- vinumioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, vinumstrategy, "vinum",
- NULL, -1, vinumdump, vinumsize,
- D_DISK, 0, -1
-};
-
-/* Called by main() during pseudo-device attachment. */
-STATIC void vinumattach(void *);
-
-STATIC void vinumgetdisklabel(dev_t);
-int vinum_inactive(void);
-void free_vinum(int);
-
-#ifndef ACTUALLY_LKM_NOT_KERNEL
-STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
-#endif
-
-/* Why aren't these declared anywhere? XXX */
-int setjmp(jmp_buf);
-void longjmp(jmp_buf, int);
-
-extern jmp_buf command_fail; /* return here if config fails */
-
-struct _vinum_conf vinum_conf; /* configuration information */
-
-STATIC int vinum_devsw_installed = 0;
-
-/*
- * Called by main() during pseudo-device attachment. All we need
- * to do is allocate enough space for devices to be configured later, and
- * add devsw entries.
- */
-void
-vinumattach(void *dummy)
-{
- char *buf; /* pointer to temporary buffer */
- struct _ioctl_reply *ioctl_reply; /* struct to return */
- struct uio uio;
- struct iovec iovec;
-
- /* modload should prevent multiple loads, so this is worth a panic */
- if ((vinum_conf.flags & VF_LOADED) != NULL)
- panic("vinum: already loaded");
-
- printf("vinum: loaded\n");
- vinum_conf.flags |= VF_LOADED; /* we're loaded now */
-
- daemonq = NULL; /* initialize daemon's work queue */
- dqend = NULL;
-
- cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_cdevsw);
-#ifdef DEVFS
-#error DEVFS not finished yet
-#endif
-
- uio.uio_iov = &iovec;
- uio.uio_iovcnt = 1; /* just one buffer */
- uio.uio_offset = 0; /* start at the beginning */
- uio.uio_resid = 512; /* one sector */
- uio.uio_segflg = UIO_SYSSPACE; /* we're in system space */
- uio.uio_rw = UIO_READ; /* do we need this? */
- uio.uio_procp = curproc; /* do it for our own process */
-
- iovec.iov_len = 512;
- buf = (char *) Malloc(iovec.iov_len); /* get a buffer */
- CHECKALLOC(buf, "vinum: no memory\n"); /* can't get 512 bytes? */
- iovec.iov_base = buf; /* read into buf */
-
- /* allocate space: drives... */
- DRIVE = (struct drive *) Malloc(sizeof(struct drive) * INITIAL_DRIVES);
- CHECKALLOC(DRIVE, "vinum: no memory\n");
- vinum_conf.drives_allocated = INITIAL_DRIVES; /* number of drive slots allocated */
- vinum_conf.drives_used = 0; /* and number in use */
-
- /* volumes, ... */
- VOL = (struct volume *) Malloc(sizeof(struct volume) * INITIAL_VOLUMES);
- CHECKALLOC(VOL, "vinum: no memory\n");
- vinum_conf.volumes_allocated = INITIAL_VOLUMES; /* number of volume slots allocated */
- vinum_conf.volumes_used = 0; /* and number in use */
-
- /* plexes, ... */
- PLEX = (struct plex *) Malloc(sizeof(struct plex) * INITIAL_PLEXES);
- CHECKALLOC(PLEX, "vinum: no memory\n");
- vinum_conf.plexes_allocated = INITIAL_PLEXES; /* number of plex slots allocated */
- vinum_conf.plexes_used = 0; /* and number in use */
-
- /* and subdisks */
- SD = (struct sd *) Malloc(sizeof(struct sd) * INITIAL_SUBDISKS);
- CHECKALLOC(SD, "vinum: no memory\n");
- vinum_conf.subdisks_allocated = INITIAL_SUBDISKS; /* number of sd slots allocated */
- vinum_conf.subdisks_used = 0; /* and number in use */
-
- ioctl_reply = NULL; /* no reply on longjmp */
-}
-
-/* Check if we have anything open. If so, return 0 (not inactive),
- * otherwise 1 (inactive) */
-int
-vinum_inactive(void)
-{
- int i;
- int can_do = 1; /* assume we can do it */
-
- lock_config();
- for (i = 0; i < vinum_conf.volumes_used; i++) {
- if (VOL[i].opencount != 0) { /* volume is open */
- can_do = 0;
- break;
- }
- }
- unlock_config();
- return can_do;
-}
-
-/* Free all structures.
- * If cleardrive is 0, save the configuration; otherwise
- * remove the configuration from the drive.
- *
- * Before coming here, ensure that no volumes are open.
- */
-void
-free_vinum(int cleardrive)
-{
- int i;
-
- if (cleardrive) {
- for (i = 0; i < vinum_conf.drives_used; i++)
- remove_drive(i); /* remove the drive */
- } else { /* keep the config */
- save_config();
- if (DRIVE != NULL) {
- for (i = 0; i < vinum_conf.drives_used; i++)
- free_drive(&DRIVE[i]); /* close files and things */
- Free(DRIVE);
- }
- }
- queue_daemon_request(daemonrq_return, NULL); /* tell daemon to stop */
- if (SD != NULL)
- Free(SD);
- if (PLEX != NULL) {
- for (i = 0; i < vinum_conf.plexes_used; i++) {
- struct plex *plex = &vinum_conf.plex[i];
-
- if (plex->state != plex_unallocated) { /* we have real data there */
- if (plex->sdnos)
- Free(plex->sdnos);
- }
- }
- Free(PLEX);
- }
- if (VOL != NULL)
- Free(VOL);
- bzero(&vinum_conf, sizeof(vinum_conf));
- while ((daemon_options & daemon_stopped) == 0) /* daemon hasn't stopped yet, */
- tsleep(&vinum_daemon, PRIBIO, "vdaemn", 10 * hz); /* wait for it to stop */
- tsleep(&vinum_daemon, PRIBIO, "diedie", 3 * hz); /* and wait another 3 secs XXX */
-}
-
-#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
-
-MOD_MISC(vinum);
-
-/*
- * Function called when loading the driver.
- */
-
-STATIC int
-vinum_load(struct lkm_table *lkmtp, int cmd)
-{
- vinumattach(NULL);
- return 0; /* OK */
-}
-
-/*
- * Function called when unloading the driver.
- */
-STATIC int
-vinum_unload(struct lkm_table *lkmtp, int cmd)
-{
- if (vinum_inactive()) { /* is anything open? */
- struct sync_args dummyarg =
- {0};
-
- printf("vinum: unloaded\n");
- sync(curproc, &dummyarg); /* write out buffers */
- free_vinum(0); /* no: clean up */
- cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
- return 0;
- } else
- return EBUSY;
-}
-
-/*
- * Dispatcher function for the module (load/unload/stat).
- */
-int
-vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
-{
- MOD_DISPATCH(vinum, /* module name */
- lkmtp, /* LKM table */
- cmd, /* command */
- ver,
- vinum_load, /* load with this function */
- vinum_unload, /* and unload with this */
- lkm_nullcmd);
-}
-
-#else /* not LKM */
-
-STATIC int
-vinum_modevent(module_t mod, modeventtype_t type, void *unused)
-{
- struct sync_args dummyarg =
- {0};
-
- switch (type) {
- case MOD_LOAD:
- vinumattach(NULL);
- return 0; /* OK */
- case MOD_UNLOAD:
- if (!vinum_inactive()) /* is anything open? */
- return EBUSY;
- sync(curproc, &dummyarg); /* write out buffers */
- free_vinum(0); /* no: clean up */
- cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
- return 0;
- default:
- break;
- }
- return 0;
-}
-
-moduledata_t vinum_mod =
-{
- "vinum",
- vinum_modevent,
- 0
-};
-DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-
-#endif /* LKM */
-
-/* ARGSUSED */
-/* Open a vinum object
- * At the moment, we only open volumes and the
- * super device. It's a nice concept to be
- * able to open drives, subdisks and plexes, but
- * I can't think what good it could be */
-int
-vinumopen(dev_t dev,
- int flags,
- int fmt,
- struct proc *p)
-{
- int s; /* spl */
- int error;
- unsigned int index;
- struct volume *vol;
- struct plex *plex;
- struct sd *sd;
- struct devcode *device;
-
- device = (struct devcode *) &dev;
-
- error = 0;
- /* First, decide what we're looking at */
- switch (device->type) {
- case VINUM_VOLUME_TYPE:
- index = Volno(dev);
- if (index >= vinum_conf.volumes_used)
- return ENXIO; /* no such device */
- vol = &VOL[index];
-
- switch (vol->state) {
- case volume_unallocated:
- case volume_uninit:
- return ENXIO;
-
- case volume_up:
- vol->opencount = 1;
- vol->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
- return 0;
-
- case volume_down:
- return EIO;
-
- default:
- return EINVAL;
- }
-
- case VINUM_PLEX_TYPE:
- if (Volno(dev) >= vinum_conf.volumes_used)
- return ENXIO;
- index = Plexno(dev); /* get plex index in vinum_conf */
- if (index >= vinum_conf.plexes_used)
- return ENXIO; /* no such device */
- plex = &PLEX[index];
-
- switch (plex->state) {
- case plex_unallocated:
- return EINVAL;
-
- default:
- s = splhigh();
- if (plex->pid /* it's open already */
- && (plex->pid != p->p_pid)) { /* and not by us, */
- splx(s);
- return EBUSY; /* one at a time, please */
- }
- plex->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
- splx(s);
- return 0;
- }
-
- case VINUM_SD_TYPE:
- if ((Volno(dev) >= vinum_conf.volumes_used) || /* no such volume */
- (Plexno(dev) >= vinum_conf.plexes_used)) /* or no such plex */
- return ENXIO; /* no such device */
- index = Sdno(dev); /* get the subdisk number */
- if (index >= vinum_conf.subdisks_used)
- return ENXIO; /* no such device */
- sd = &SD[index];
-
- /* Opening a subdisk is always a special operation, so we
- * ignore the state as long as it represents a real subdisk */
- switch (sd->state) {
- case sd_unallocated:
- case sd_uninit:
- return EINVAL;
-
- default:
- s = splhigh();
- if (sd->pid /* it's open already */
- && (sd->pid != p->p_pid)) { /* and not by us, */
- splx(s);
- return EBUSY; /* one at a time, please */
- }
- sd->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
- splx(s);
- return 0;
- }
-
- case VINUM_DRIVE_TYPE:
- default:
- return ENODEV; /* don't know what to do with these */
-
- case VINUM_SUPERDEV_TYPE:
- if (p->p_ucred->cr_uid == 0) { /* root calling, */
- vinum_conf.opencount = 1; /* we're open */
- return 0; /* no worries opening super dev */
- } else
- return EPERM; /* you can't do that! */
- }
-}
-
-/* ARGSUSED */
-int
-vinumclose(dev_t dev,
- int flags,
- int fmt,
- struct proc *p)
-{
- unsigned int index;
- struct volume *vol;
- struct plex *plex;
- struct sd *sd;
- struct devcode *device = (struct devcode *) &dev;
-
- index = Volno(dev);
- /* First, decide what we're looking at */
- switch (device->type) {
- case VINUM_VOLUME_TYPE:
- if (index >= vinum_conf.volumes_used)
- return ENXIO; /* no such device */
- vol = &VOL[index];
-
- switch (vol->state) {
- case volume_unallocated:
- case volume_uninit:
- return ENXIO;
-
- case volume_up:
- vol->opencount = 0; /* reset our flags */
- vol->pid = NULL; /* and forget who owned us */
- return 0;
-
- case volume_down:
- return EIO;
-
- default:
- return EINVAL;
- }
-
- case VINUM_PLEX_TYPE:
- if (Volno(dev) >= vinum_conf.volumes_used)
- return ENXIO;
- index = Plexno(dev); /* get plex index in vinum_conf */
- if (index >= vinum_conf.plexes_used)
- return ENXIO; /* no such device */
- plex = &PLEX[index];
- plex->pid = 0;
- return 0;
-
- case VINUM_SD_TYPE:
- if ((Volno(dev) >= vinum_conf.volumes_used) || /* no such volume */
- (Plexno(dev) >= vinum_conf.plexes_used)) /* or no such plex */
- return ENXIO; /* no such device */
- index = Sdno(dev); /* get the subdisk number */
- if (index >= vinum_conf.subdisks_used)
- return ENXIO; /* no such device */
- sd = &SD[index];
- sd->pid = 0;
- return 0;
-
- case VINUM_SUPERDEV_TYPE:
- if (p->p_ucred->cr_uid == 0) /* root calling, */
- vinum_conf.opencount = 0; /* no longer open */
- return 0; /* no worries closing super dev */
-
- case VINUM_DRIVE_TYPE:
- default:
- return ENODEV; /* don't know what to do with these */
- }
-}
-
-/* size routine */
-int
-vinumsize(dev_t dev)
-{
- struct volume *vol;
- int size;
-
- vol = &VOL[Volno(dev)];
-
- if (vol->state == volume_up)
- size = vol->size;
- else
- return 0; /* err on the size of conservatism */
-
- return size;
-}
-
-int
-vinumdump(dev_t dev)
-{
- /* Not implemented. */
- return ENXIO;
-}
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
deleted file mode 100644
index 32e56b925056..000000000000
--- a/sys/dev/vinum/vinumconfig.c
+++ /dev/null
@@ -1,1730 +0,0 @@
-/* To do:
-
- * Don't store drive configuration on the config DB: read each drive's header
- * to decide where it is.
- *
- * Accept any old crap in the config_<foo> functions, and complain when
- * we try to bring it up.
- *
- * When trying to bring volumes up, check that the complete address range
- * is covered.
- */
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumconfig.c,v 1.22 1998/12/30 05:07:24 grog Exp grog $
- */
-
-#define STATIC /* nothing while we're testing XXX */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-
-extern jmp_buf command_fail; /* return on a failed command */
-
-/* Why aren't these declared anywhere? XXX */
-void longjmp(jmp_buf, int);
-
-#define MAXTOKEN 64 /* maximum number of tokens in a line */
-
-/* We can afford the luxury of global variables here,
- * since start_config ensures that these functions
- * are single-threaded. */
-
-/* These are indices in vinum_conf of the last-mentioned of each kind of object */
-static int current_drive = -1; /* note the last drive we mention, for
- * some defaults */
-static int current_plex = -1; /* and the same for the last plex */
-static int current_volume = -1; /* and the last volme */
-static struct _ioctl_reply *ioctl_reply; /* struct to return via ioctl */
-
-
-/* These values are used by most of these routines, so set them as globals */
-static char *token[MAXTOKEN]; /* pointers to individual tokens */
-static int tokens; /* number of tokens */
-
-#define TOCONS 0x01
-#define TOTTY 0x02
-#define TOLOG 0x04
-
-struct putchar_arg {
- int flags;
- struct tty *tty;
-};
-
-#define MSG_MAX 1024 /* maximum length of a formatted message */
-/* Format an error message and return to the user in the reply.
- * CARE: This routine is designed to be called only from the
- * configuration routines, so it assumes it's the owner of
- * the configuration lock, and unlocks it on exit */
-void
-throw_rude_remark(int error, char *msg,...)
-{
- int retval;
- va_list ap;
- char *text;
- static int finishing; /* don't recurse */
- int was_finishing;
-
- va_start(ap, msg);
- if ((ioctl_reply != NULL) /* we're called from the user */
- &&(!(vinum_conf.flags & VF_KERNELOP))) { /* and we're not doing kernel things: return msg */
- /* XXX We can't just format to ioctl_reply, since it
- * may contain our input parameters */
- text = Malloc(MSG_MAX);
- if (text == NULL) {
- printf("vinum: can't allocate error message buffer");
- printf("vinum: ");
- vprintf(msg, ap); /* print to the console */
- printf("\n");
- } else {
- retval = kvprintf(msg, NULL, (void *) text, 10, ap);
- text[retval] = '\0'; /* delimit */
- strcpy(ioctl_reply->msg, text);
- ioctl_reply->error = error; /* first byte is the error number */
- Free(text);
- }
- } else {
- printf("vinum: ");
- vprintf(msg, ap); /* print to the console */
- printf("\n");
- }
- va_end(ap);
-
- if (vinum_conf.flags & VF_READING_CONFIG) /* go through to the bitter end, */
- return;
- /* We have a problem here: we want to unlock the
- * configuration, which implies tidying up, but
- * if we find an error while tidying up, we could
- * recurse for ever. Use this kludge to only try
- * once */
- was_finishing = finishing;
- finishing = 1;
- finish_config(was_finishing); /* unlock anything we may be holding */
- finishing = was_finishing;
- longjmp(command_fail, error);
-}
-
-/* Function declarations */
-int atoi(char *); /* no atoi in the kernel */
-
-/* Minimal version of atoi */
-int
-atoi(char *s)
-{ /* no atoi in the kernel */
- int r = 0;
- int sign = 1;
-
- while (((*s >= '0') && (*s <= '9')) || (*s == '-')) {
- if (*s == '-')
- sign = -sign;
- else
- r = r * 10 + (*s - '0');
- }
- return r;
-}
-
-/* Find index of volume in vinum_conf. Return the index
- * if found, or -1 if not */
-int
-volume_index(struct volume *vol)
-{
- int i;
-
- for (i = 0; i < vinum_conf.volumes_used; i++)
- if (&VOL[i] == vol)
- return i;
- return -1;
-}
-
-/* Find index of plex in vinum_conf. Return the index
- * if found, or -1 if not */
-int
-plex_index(struct plex *plex)
-{
- int i;
-
- for (i = 0; i < vinum_conf.plexes_used; i++)
- if (&PLEX[i] == plex)
- return i;
- return -1;
-}
-
-/* Find index of subdisk in vinum_conf. Return the index
- * if found, or -1 if not */
-int
-sd_index(struct sd *sd)
-{
- int i;
-
- for (i = 0; i < vinum_conf.subdisks_used; i++)
- if (&SD[i] == sd)
- return i;
- return -1;
-}
-
-/* Find index of drive in vinum_conf. Return the index
- * if found, or -1 if not */
-int
-drive_index(struct drive *drive)
-{
- int i;
-
- for (i = 0; i < vinum_conf.drives_used; i++)
- if (&DRIVE[i] == drive)
- return i;
- return -1;
-}
-
-/* Check a volume to see if the plex is already assigned to it.
- * Return index in volume->plex, or -1 if not assigned */
-int
-my_plex(int volno, int plexno)
-{
- int i;
- struct volume *vol;
-
- vol = &VOL[volno]; /* point to volno */
- for (i = 0; i < vol->plexes; i++)
- if (vol->plex[i] == plexno)
- return i;
- return -1; /* not found */
-}
-
-/* Check a plex to see if the subdisk is already assigned to it.
- * Return index in plex->sd, or -1 if not assigned */
-int
-my_sd(int plexno, int sdno)
-{
- int i;
- struct plex *plex;
-
- plex = &PLEX[plexno];
- for (i = 0; i < plex->subdisks; i++)
- if (plex->sdnos[i] == sdno)
- return i;
- return -1; /* not found */
-}
-
-/* Check that this operation is being done in the kernel.
- * longjmp out if not. op the name of the operation. */
-void
-checkkernel(char *op)
-{
- if (vinum_conf.flags & VF_KERNELOP == 0)
- throw_rude_remark(EPERM, "Can't perform '%s' from user space", op);
-}
-
-/* Add plex to the volume if possible */
-int
-give_plex_to_volume(int volno, int plexno)
-{
- struct volume *vol;
-
- /* XXX It's not an error for the plex to already
- * belong to the volume, but we need to check a
- * number of things to make sure it's done right.
- * Some day. */
- if (my_plex(volno, plexno) >= 0)
- return plexno; /* that's it */
-
- vol = &VOL[volno]; /* point to volume */
- if (vol->plexes == MAXPLEX) /* all plexes allocated */
- throw_rude_remark(ENOSPC,
- "Too many plexes for volume %s",
- vol->name);
- else if ((vol->plexes > 0) /* we have other plexes */
- &&(vol->flags & VF_CONFIG_SETUPSTATE == 0)) /* and we're not setting up state */
- invalidate_subdisks(&PLEX[plexno], sd_stale); /* make the subdisks invalid */
- vol->plex[vol->plexes] = plexno; /* this one */
- vol->plexes++; /* add another plex */
- PLEX[plexno].volno = volno; /* note the number of our volume */
-
- return vol->plexes - 1; /* and return its index */
-}
-
-/* Add subdisk to a plex if possible */
-int
-give_sd_to_plex(int plexno, int sdno)
-{
- int i;
- struct plex *plex;
- struct sd *sd;
-
- /* XXX It's not an error for the sd to already
- * belong to the plex, but we need to check a
- * number of things to make sure it's done right.
- * Some day. */
- i = my_sd(plexno, sdno);
- if (i >= 0) /* does it already belong to us? */
- return i; /* that's it */
-
- plex = &PLEX[plexno]; /* point to the plex */
- sd = &SD[sdno]; /* and the subdisk */
-
- /* Do we have an offset? Otherwise put it after the last one */
- if (sd->plexoffset < 0) { /* no offset specified */
- if (plex->subdisks > 0) {
- struct sd *lastsd = &SD[plex->sdnos[plex->subdisks - 1]]; /* last subdisk */
-
- if (plex->organization == plex_concat) /* concat, */
- sd->plexoffset = lastsd->sectors + lastsd->plexoffset; /* starts here */
- else /* striped or RAID-5, */
- sd->plexoffset = plex->stripesize * plex->subdisks; /* starts here */
- } else /* first subdisk */
- sd->plexoffset = 0; /* start at the beginning */
- }
- if (plex->subdisks == MAXSD) /* we already have our maximum */
- throw_rude_remark(ENOSPC, /* crap out */
- "Can't add %s to %s: plex full\n",
- sd->name,
- plex->name);
-
- plex->subdisks++; /* another entry */
- if (plex->subdisks >= plex->subdisks_allocated) /* need more space */
- EXPAND(plex->sdnos, int, plex->subdisks_allocated, INITIAL_SUBDISKS_IN_PLEX);
-
- /* Adjust size of plex and volume. */
- plex->length += sd->sectors; /* plex gets this much bigger */
- if (plex->volno >= 0) /* we have a volume */
- VOL[plex->volno].size = max(VOL[plex->volno].size, plex->length); /* adjust its size */
-
- /* We need to check that the subdisks don't overlap,
- * but we can't do that until a point where we *must*
- * know the size of all the subdisks. That's not
- * here. But we need to sort them by offset */
- for (i = 0; i < plex->subdisks - 1; i++) {
- if (sd->plexoffset < SD[plex->sdnos[i]].plexoffset) { /* it fits before this one */
- /* First move any remaining subdisks by one */
- int j;
-
- for (j = plex->subdisks - 1; j > i; j--) /* move up one at a time */
- plex->sdnos[j] = plex->sdnos[j - 1];
- plex->sdnos[i] = sdno;
- sd->plexsdno = i; /* note where we are in the subdisk */
- return i;
- }
- }
-
- /* The plex doesn't have any subdisk with a larger
- * offset. Insert it */
- plex->sdnos[i] = sdno;
- sd->plexsdno = i; /* note where we are in the subdisk */
- return i;
-}
-
-/* Add a subdisk to drive if possible. The pointer to the drive
- * must already be stored in the sd structure, but the drive
- * doesn't know about the subdisk yet. */
-static void
-give_sd_to_drive(int sdno)
-{
- struct sd *sd; /* pointer to subdisk */
- struct drive *drive; /* and drive */
- int fe; /* index in free list */
-
- sd = &SD[sdno]; /* point to sd */
- drive = &DRIVE[sd->driveno]; /* and drive */
-
- if (drive->state != drive_up)
- update_sd_state(sdno); /* that crashes the subdisk */
- if (sd->sectors > drive->sectors_available) { /* too big, */
- sd->driveoffset = -1; /* don't be confusing */
- throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
- }
- drive->subdisks_used++; /* one more subdisk */
-
- /* no offset specified, find one */
- if (sd->driveoffset < 0) {
- for (fe = 0; fe < drive->freelist_entries; fe++) {
- if (drive->freelist[fe].sectors >= sd->sectors) { /* it'll fit here */
- sd->driveoffset = drive->freelist[fe].offset;
- if (sd->sectors == drive->freelist[fe].sectors) { /* used up the entire entry */
- if (fe < (drive->freelist_entries - 1)) /* not the last one, */
- bcopy(&drive->freelist[fe + 1],
- &drive->freelist[fe],
- (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
- drive->freelist_entries--; /* one less entry */
- } else {
- drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
- drive->freelist[fe].offset += sd->sectors; /* this much further on */
- }
- drive->sectors_available -= sd->sectors; /* and note how much less space we have */
- break;
- }
- }
- if (fe == drive->freelist_entries)
- /* Didn't find anything. Although the drive has
- * enough space, it's too fragmented */
- {
- sd->driveoffset = -1; /* don't be confusing */
- throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
- }
- } else { /* specific offset */
- /* For a specific offset to work, the space must be
- * entirely in a single freelist entry. Look for it. */
- u_int64_t sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
- for (fe = 0; fe < drive->freelist_entries; fe++) {
- u_int64_t dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of entry */
- if (dend >= sdend) { /* fits before here */
- if (drive->freelist[fe].offset > sd->driveoffset) /* starts after the beginning of sd area */
- throw_rude_remark(ENOSPC,
- "No space for subdisk %s on drive %s at offset %qd\n",
- sd->name,
- drive->label.name);
-
- /* We've found the space, and we can allocate it.
- * We don't need to say that to the subdisk, which
- * already knows about it. We need to tell it to
- * the free list, though. We have four possibilities:
- *
- * 1. The subdisk exactly eats up the entry. That's the
- * same as above.
- * 2. The subdisk starts at the beginning and leaves space
- * at the end.
- * 3. The subdisk starts after the beginning and leaves
- * space at the end as well: we end up with another
- * fragment.
- * 4. The subdisk leaves space at the beginning and finishes
- * at the end.
- */
- drive->sectors_available -= sd->sectors; /* note how much less space we have */
- if (sd->driveoffset == drive->freelist[fe].offset) { /* 1 or 2 */
- if (sd->sectors == drive->freelist[fe].sectors) { /* 1: used up the entire entry */
- if (fe < (drive->freelist_entries - 1)) /* not the last one, */
- bcopy(&drive->freelist[fe + 1],
- &drive->freelist[fe],
- (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
- drive->freelist_entries--; /* one less entry */
- } else { /* 2: space at the end */
- drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
- drive->freelist[fe].offset += sd->sectors; /* this much further on */
- }
- } else { /* 3 or 4 */
- drive->freelist[fe].sectors = sd->driveoffset - drive->freelist[fe].offset;
- if (dend > sdend) { /* 3: space at the end as well */
- if (fe < (drive->freelist_entries - 1)) /* not the last one */
- bcopy(&drive->freelist[fe], /* move the rest down */
- &drive->freelist[fe + 1],
- (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
- drive->freelist_entries++; /* one less entry */
- drive->freelist[fe + 1].offset = sdend; /* second entry starts after sd */
- drive->freelist[fe + 1].sectors = dend - sdend; /* and is this long */
- }
- }
- break;
- }
- }
- }
- drive->opencount++; /* one more subdisk attached */
-}
-
-/* Get an empty drive entry from the drive table */
-int
-get_empty_drive(void)
-{
- int driveno;
- struct drive *drive;
-
- /* first see if we have one which has been deallocated */
- for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
- if (DRIVE[driveno].state == drive_unallocated) /* bingo */
- break;
- }
-
- if (driveno >= vinum_conf.drives_used)
- /* Couldn't find a deallocated drive. Allocate a new one */
- {
- vinum_conf.drives_used++;
- if (vinum_conf.drives_used > vinum_conf.drives_allocated) /* we've used all our allocation */
- EXPAND(DRIVE, struct drive, vinum_conf.drives_allocated, INITIAL_DRIVES);
- }
- /* got a drive entry. Make it pretty */
- drive = &DRIVE[driveno];
- bzero(drive, sizeof(struct drive));
- drive->driveno = driveno; /* put number in structure */
- return driveno; /* return the index */
-}
-
-/* Find the named drive in vinum_conf.drive, return a pointer
- * return the index in vinum_conf.drive.
- * Don't mark the drive as allocated (XXX SMP)
- * If create != 0, create an entry if it doesn't exist
- */
-/* XXX check if we have it open from attach */
-int
-find_drive(const char *name, int create)
-{
- int driveno;
- struct drive *drive;
-
- if (name != NULL) {
- for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
- drive = &DRIVE[driveno]; /* point to drive */
- if ((drive->label.name[0] != '\0') /* it has a name */
- &&(strcmp(drive->label.name, name) == 0)) /* and it's this one: found */
- return driveno;
- }
- }
- /* the drive isn't in the list. Add it if he wants */
- if (create == 0) /* don't want to create */
- return -1; /* give up */
-
- driveno = get_empty_drive();
- drive = &DRIVE[driveno];
- if (name != NULL)
- bcopy(name, /* put in its name */
- drive->label.name,
- min(sizeof(drive->label.name),
- strlen(name)));
- drive->state = drive_uninit; /* in use, nothing worthwhile there */
- drive->flags |= VF_NEWBORN; /* newly born drive */
- return driveno; /* return the index */
-}
-
-/* Find a drive given its device name.
- * devname must be valid.
- * Otherwise the same as find_drive above */
-int
-find_drive_by_dev(const char *devname, int create)
-{
- int driveno;
- struct drive *drive;
-
- for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
- drive = &DRIVE[driveno]; /* point to drive */
- if ((drive->label.name[0] != '\0') /* it has a name */
- &&(strcmp(drive->devicename, devname) == 0)) /* and it's this one: found */
- return driveno;
- }
-
- /* the drive isn't in the list. Add it if he wants */
- if (create == 0) /* don't want to create */
- return -1; /* give up */
-
- driveno = get_empty_drive();
- drive = &DRIVE[driveno];
- bcopy(devname, /* put in its name */
- drive->devicename,
- min(sizeof(drive->devicename),
- strlen(devname)));
- drive->state = drive_uninit; /* in use, nothing worthwhile there */
- drive->flags |= VF_NEWBORN; /* newly born drive */
- return driveno; /* return the index */
-}
-
-/* Find an empty subdisk in the subdisk table */
-int
-get_empty_sd(void)
-{
- int sdno;
- struct sd *sd;
-
- /* first see if we have one which has been deallocated */
- for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
- if (SD[sdno].state == sd_unallocated) /* bingo */
- break;
- }
-
- if (sdno >= vinum_conf.subdisks_used) { /* No unused sd found. Allocate a new one */
- vinum_conf.subdisks_used++;
- if (vinum_conf.subdisks_used > vinum_conf.subdisks_allocated)
- EXPAND(SD, struct sd, vinum_conf.subdisks_allocated, INITIAL_SUBDISKS);
- }
- /* initialize some things */
- sd = &SD[sdno]; /* point to it */
- bzero(sd, sizeof(struct sd)); /* initialize */
- sd->plexno = -1; /* no plex */
- sd->driveno = -1; /* and no drive */
- sd->plexoffset = -1; /* and no offsets */
- sd->driveoffset = -1;
- return sdno; /* return the index */
-}
-
-/* return a drive to the free pool */
-void
-free_drive(struct drive *drive)
-{
- lockdrive(drive);
- if (drive->vp != NULL) /* device open */
- vn_close(drive->vp, FREAD | FWRITE, FSCRED, drive->p);
- bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
- vinum_conf.drives_used--; /* one less drive */
- unlockdrive(drive);
-}
-
-/* Find the named subdisk in vinum_conf.sd.
-
- * If create != 0, create an entry if it doesn't exist
- *
- * Return index in vinum_conf.sd
- */
-int
-find_subdisk(const char *name, int create)
-{
- int sdno;
- struct sd *sd;
-
- for (sdno = 0; sdno < vinum_conf.subdisks_allocated; sdno++) {
- if (strcmp(SD[sdno].name, name) == 0) /* found it */
- return sdno;
- }
-
- /* the subdisk isn't in the list. Add it if he wants */
- if (create == 0) /* don't want to create */
- return -1; /* give up */
-
- /* Allocate one and insert the name */
- sdno = get_empty_sd();
- sd = &SD[sdno];
- bcopy(name, sd->name, min(sizeof(sd->name), strlen(name))); /* put in its name */
- sd->flags |= VF_NEWBORN; /* newly born subdisk */
- return sdno; /* return the pointer */
-}
-
-/* Free an allocated sd entry
- * This performs memory management only. remove()
- * is responsible for checking relationships.
- */
-void
-free_sd(int sdno)
-{
- struct sd *sd;
- struct drive *drive;
- int fe; /* free list entry */
- u_int64_t sdend; /* end of our subdisk */
- u_int64_t dend; /* end of our freelist entry */
-
- sd = &SD[sdno];
- if ((sd->driveno >= 0) /* we have a drive, */
- &&(sd->sectors > 0)) { /* and some space on it */
- drive = &DRIVE[sd->driveno];
- sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
-
- /* Look for where to return the sd address space */
- for (fe = 0;
- (fe < drive->freelist_entries) && (drive->freelist[fe].offset < sd->driveoffset);
- fe++);
- /* Now we are pointing to the last entry, the first
- * with a higher offset than the subdisk, or both. */
- if ((fe > 1) /* not the first entry */
- &&((fe == drive->freelist_entries) /* gone past the end */
- ||(drive->freelist[fe].offset > sd->driveoffset))) /* or past the block were looking for */
- fe--; /* point to the block before */
- dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of the entry */
-
- /* At this point, we are pointing to the correct
- * place in the free list. A number of possibilities
- * exist:
- *
- * 1. The block to be freed immediately follows
- * the block to which we are pointing. Just
- * enlarge it.
- * 2. The block to be freed starts at the end of
- * the current block and ends at the beginning
- * of the following block. Merge the three
- * areas into a single block.
- * 3. The block to be freed starts after the end
- * of the block and ends before the start of
- * the following block. Create a new free block.
- * 4. The block to be freed starts after the end
- * of the block, but ends at the start of the
- * following block. Enlarge the following block
- * downwards.
- *
- */
- if (sd->driveoffset == dend) { /* it starts after the end of this block */
- if ((fe < drive->freelist_entries - 1) /* we're not the last block in the free list */
- &&(sdend == drive->freelist[fe + 1].offset)) { /* and the subdisk ends at the start of the
- * next block */
- drive->freelist[fe].sectors = drive->freelist[fe + 1].sectors; /* 2: merge all three blocks */
- if (fe < drive->freelist_entries - 2) /* still more blocks after next */
- bcopy(&drive->freelist[fe + 2], /* move down one */
- &drive->freelist[fe + 1],
- (drive->freelist_entries - 2 - fe) * sizeof(struct drive_freelist));
- drive->freelist_entries--; /* one less entry in the free list */
- } else /* 1: just enlarge this block */
- drive->freelist[fe].sectors += sd->sectors;
- } else {
- if (sd->driveoffset > dend) /* it starts after this block */
- fe++; /* so look at the next block */
- if ((fe < drive->freelist_entries) /* we're not the last block in the free list */
- &&(sdend == drive->freelist[fe].offset)) { /* and the subdisk ends at the start of
- * this block: case 4 */
- drive->freelist[fe].offset = sd->driveoffset; /* it starts where the sd was */
- drive->freelist[fe].sectors += sd->sectors; /* and it's this much bigger */
- } else { /* case 3: non-contiguous */
- if (fe < drive->freelist_entries) /* not after the last block, */
- bcopy(&drive->freelist[fe], /* move the rest up one entry */
- &drive->freelist[fe + 1],
- (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
- drive->freelist_entries++; /* one less entry */
- drive->freelist[fe].offset = sd->driveoffset; /* this entry represents the sd */
- drive->freelist[fe].sectors = sd->sectors;
- }
- }
- drive->opencount--; /* one less subdisk attached */
- }
- bzero(sd, sizeof(struct sd)); /* and clear it out */
- sd->state = sd_unallocated;
- vinum_conf.subdisks_used--; /* one less sd */
-}
-
-/* Find an empty plex in the plex table */
-int
-get_empty_plex(void)
-{
- int plexno;
- struct plex *plex; /* if we allocate one */
-
- /* first see if we have one which has been deallocated */
- for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++) {
- if (PLEX[plexno].state == plex_unallocated) /* bingo */
- break; /* and get out of here */
- }
-
- if (plexno >= vinum_conf.plexes_used) {
- /* Couldn't find a deallocated plex. Allocate a new one */
- vinum_conf.plexes_used++;
- if (vinum_conf.plexes_used > vinum_conf.plexes_allocated)
- EXPAND(PLEX, struct plex, vinum_conf.plexes_allocated, INITIAL_PLEXES);
- }
- /* Found a plex. Give it an sd structure */
- plex = &PLEX[plexno]; /* this one is ours */
- bzero(plex, sizeof(struct plex)); /* polish it up */
- plex->sdnos = (int *) Malloc(sizeof(int) * INITIAL_SUBDISKS_IN_PLEX); /* allocate sd table */
- CHECKALLOC(plex->sdnos, "vinum: Can't allocate plex subdisk table");
- bzero(plex->sdnos, (sizeof(int) * INITIAL_SUBDISKS_IN_PLEX)); /* do we need this? */
- plex->subdisks = 0; /* no subdisks in use */
- plex->subdisks_allocated = INITIAL_SUBDISKS_IN_PLEX; /* and we have space for this many */
- plex->organization = plex_disorg; /* and it's not organized */
- plex->volno = -1; /* no volume yet */
- return plexno; /* return the index */
-}
-
-/* Find the named plex in vinum_conf.plex
-
- * If create != 0, create an entry if it doesn't exist
- * return index in vinum_conf.plex
- */
-int
-find_plex(const char *name, int create)
-{
- int plexno;
- struct plex *plex;
-
- for (plexno = 0; plexno < vinum_conf.plexes_allocated; plexno++) {
- if (strcmp(PLEX[plexno].name, name) == 0) /* found it */
- return plexno;
- }
-
- /* the plex isn't in the list. Add it if he wants */
- if (create == 0) /* don't want to create */
- return -1; /* give up */
-
- /* Allocate one and insert the name */
- plexno = get_empty_plex();
- plex = &PLEX[plexno]; /* point to it */
- bcopy(name, plex->name, min(sizeof(plex->name), strlen(name))); /* put in its name */
- plex->flags |= VF_NEWBORN; /* newly born plex */
- return plexno; /* return the pointer */
-}
-
-/* Free an allocated plex entry
- * and its associated memory areas */
-void
-free_plex(int plexno)
-{
- struct plex *plex;
-
- plex = &PLEX[plexno];
- if (plex->sdnos)
- Free(plex->sdnos);
- if (plex->lock)
- Free(plex->lock);
- bzero(plex, sizeof(struct plex)); /* and clear it out */
- plex->state = plex_unallocated;
- vinum_conf.plexes_used--; /* one less plex */
-}
-
-/* Find an empty volume in the volume table */
-int
-get_empty_volume(void)
-{
- int volno;
- struct volume *vol;
-
- /* first see if we have one which has been deallocated */
- for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
- if (VOL[volno].state == volume_unallocated) /* bingo */
- break;
- }
-
- if (volno >= vinum_conf.volumes_used)
- /* Couldn't find a deallocated volume. Allocate a new one */
- {
- vinum_conf.volumes_used++;
- if (vinum_conf.volumes_used > vinum_conf.volumes_allocated)
- EXPAND(VOL, struct volume, vinum_conf.volumes_allocated, INITIAL_VOLUMES);
- }
- /* Now initialize fields */
- vol = &VOL[volno];
- bzero(vol, sizeof(struct volume));
- vol->preferred_plex = -1; /* default to round robin */
- vol->preferred_plex = ROUND_ROBIN_READPOL; /* round robin */
-
- return volno; /* return the index */
-}
-
-/* Find the named volume in vinum_conf.volume.
-
- * If create != 0, create an entry if it doesn't exist
- * return the index in vinum_conf
- */
-int
-find_volume(const char *name, int create)
-{
- int volno;
- struct volume *vol;
-
- for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
- if (strcmp(VOL[volno].name, name) == 0) /* found it */
- return volno;
- }
-
- /* the volume isn't in the list. Add it if he wants */
- if (create == 0) /* don't want to create */
- return -1; /* give up */
-
- /* Allocate one and insert the name */
- volno = get_empty_volume();
- vol = &VOL[volno];
- bcopy(name, vol->name, min(sizeof(vol->name), strlen(name))); /* put in its name */
- vol->blocksize = DEV_BSIZE; /* block size of this volume */
- vol->flags |= VF_NEWBORN; /* newly born volume */
- return volno; /* return the pointer */
-}
-
-/* Free an allocated volume entry
- * and its associated memory areas */
-void
-free_volume(int volno)
-{
- struct volume *vol;
-
- vol = &VOL[volno];
- bzero(vol, sizeof(struct volume)); /* and clear it out */
- vol->state = volume_unallocated;
- vinum_conf.volumes_used--; /* one less volume */
-}
-
-/* Handle a drive definition. We store the information in the global variable
- * drive, so we don't need to allocate.
- *
- * If we find an error, print a message and return
- */
-void
-config_drive(int update)
-{
- enum drive_label_info partition_status; /* info about the partition */
- int parameter;
- int driveno; /* index of drive in vinum_conf */
- struct drive *drive; /* and pointer to it */
-
- if (tokens < 2) /* not enough tokens */
- throw_rude_remark(EINVAL, "Drive has no name");
- driveno = find_drive(token[1], 1); /* allocate a drive to initialize */
- drive = &DRIVE[driveno]; /* and get a pointer */
- if (update && ((drive->flags & VF_NEWBORN) == 0)) /* this drive exists already */
- return; /* don't do anything */
- drive->flags &= ~VF_NEWBORN; /* no longer newly born */
-
- if (drive->state != drive_uninit) { /* we already know this drive */
- /* XXX Check which definition is more up-to-date. Give
- * preference for the definition on its own drive */
- return; /* XXX */
- }
- for (parameter = 2; parameter < tokens; parameter++) { /* look at the other tokens */
- switch (get_keyword(token[parameter], &keyword_set)) {
- case kw_device:
- parameter++;
- if (drive->devicename[0] != '\0') { /* we know this drive... */
- if (strcmp(drive->devicename, token[parameter])) /* different name */
- close_drive(drive); /* close it if it's open */
- else /* no change */
- break;
- }
- /* open the device and get the configuration */
- bcopy(token[parameter], /* insert device information */
- drive->devicename,
- min(sizeof(drive->devicename),
- strlen(token[parameter])));
- partition_status = read_drive_label(drive, 1);
- switch (partition_status) {
- case DL_CANT_OPEN: /* not our kind */
- close_drive(drive);
- if (drive->lasterror == EFTYPE) /* wrong kind of partition */
- throw_rude_remark(drive->lasterror,
- "Drive %s has invalid partition type",
- drive->label.name);
- else /* I/O error of some kind */
- throw_rude_remark(drive->lasterror,
- "Can't initialize drive %s",
- drive->label.name);
- break;
-
- case DL_WRONG_DRIVE: /* valid drive, not the name we expected */
- close_drive(drive);
- throw_rude_remark(drive->lasterror,
- "Incorrect drive name %s specified for drive %s",
- token[1],
- drive->label.name);
- break;
-
- case DL_DELETED_LABEL: /* it was a drive, but we deleted it */
- break;
-
- case DL_NOT_OURS: /* nothing to do with the rest */
- case DL_OURS:
- break;
- }
- /* read_drive_label overwrites the device name.
- * If we get here, we can have the drive,
- * so put it back again */
- bcopy(token[parameter],
- drive->devicename,
- min(sizeof(drive->devicename),
- strlen(token[parameter])));
- break;
-
- case kw_state:
- checkkernel(token[++parameter]); /* must be a kernel user */
- drive->state = DriveState(token[parameter]); /* set the state */
- break;
-
- default:
- close_drive(drive);
- throw_rude_remark(EINVAL,
- "Drive %s, invalid keyword: %s",
- token[1],
- token[parameter]);
- }
- }
-
- if (drive->devicename[0] == '\0') {
- drive->state = drive_unallocated; /* deallocate the drive */
- throw_rude_remark(EINVAL, "No device name for %s", drive->label.name);
- }
-}
-
-/* Handle a subdisk definition. We store the information in the global variable
- * sd, so we don't need to allocate.
- *
- * If we find an error, print a message and return
- */
-void
-config_subdisk(int update)
-{
- int parameter;
- int sdno; /* index of sd in vinum_conf */
- struct sd *sd; /* and pointer to it */
- u_int64_t size;
- int detached = 0; /* set to 1 if this is a detached subdisk */
- int sdindex = -1; /* index in plexes subdisk table */
- int namedsdno;
- enum sdstate state = sd_unallocated; /* state to set, if specified */
-
- sdno = get_empty_sd(); /* allocate an SD to initialize */
- sd = &SD[sdno]; /* and get a pointer */
-
- for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
- switch (get_keyword(token[parameter], &keyword_set)) {
- case kw_detached:
- detached = 1;
- break;
-
- case kw_plexoffset:
- size = sizespec(token[++parameter]);
- if ((size % DEV_BSIZE) != 0)
- throw_rude_remark(EINVAL, "sd %s, bad plex offset alignment: %qd", sd->name, size);
- else
- sd->plexoffset = size / DEV_BSIZE;
- break;
-
- case kw_driveoffset:
- size = sizespec(token[++parameter]);
- if ((size % DEV_BSIZE) != 0)
- throw_rude_remark(EINVAL, "sd %s, bad drive offset alignment: %qd", sd->name, size);
- else
- sd->driveoffset = size / DEV_BSIZE;
- break;
-
- case kw_name:
- namedsdno = find_subdisk(token[++parameter], 0); /* find an existing sd with this name */
- if (namedsdno >= 0) { /* got one */
- if (update) /* are we updating? */
- return; /* that's OK, nothing more to do */
- else
- throw_rude_remark(EINVAL, "Duplicate subdisk %s", token[parameter]);
- }
- bcopy(token[parameter],
- sd->name,
- min(sizeof(sd->name), strlen(token[parameter])));
- break;
-
- case kw_len:
- size = sizespec(token[++parameter]);
- if ((size % DEV_BSIZE) != 0)
- throw_rude_remark(EINVAL, "sd %s, length %d not multiple of sector size", sd->name, size);
- else
- sd->sectors = size / DEV_BSIZE;
- break;
-
- case kw_drive:
- sd->driveno = find_drive(token[++parameter], 1); /* insert drive information */
- break;
-
- case kw_plex:
- sd->plexno = find_plex(token[++parameter], 1); /* insert plex information */
- break;
-
- /* Set the state. We can't do this directly,
- * because give_sd_to_plex may change it */
- case kw_state:
- checkkernel(token[++parameter]); /* must be a kernel user */
- state = SdState(token[parameter]); /* set the state */
- break;
-
- default:
- throw_rude_remark(EINVAL, "sd %s, invalid keyword: %s", sd->name, token[parameter]);
- }
- }
-
- /* Check we have a drive name */
- if (sd->driveno < 0) { /* didn't specify a drive */
- sd->driveno = current_drive; /* set to the current drive */
- if (sd->driveno < 0) /* no current drive? */
- throw_rude_remark(EINVAL, "Subdisk %s is not associated with a drive", sd->name);
- }
- /* Check for a plex name */
- if ((sd->plexno < 0) /* didn't specify a plex */
- &&(!detached)) /* and didn't say not to, */
- sd->plexno = current_plex; /* set to the current plex */
-
- if (sd->plexno >= 0)
- sdindex = give_sd_to_plex(sd->plexno, sdno); /* now tell the plex that it has this sd */
-
- sd->sdno = sdno; /* point to our entry in the table */
-
- /* Does the subdisk have a name? If not, give it one */
- if (sd->name[0] == '\0') { /* no name */
- char sdsuffix[8]; /* form sd name suffix here */
-
- /* Do we have a plex name? */
- if (sdindex >= 0) /* we have a plex */
- strcpy(sd->name, PLEX[sd->plexno].name); /* take it from there */
- else /* no way */
- throw_rude_remark(EINVAL, "Unnamed sd is not associated with a plex");
- sprintf(sdsuffix, ".s%d", sdindex); /* form the suffix */
- strcat(sd->name, sdsuffix); /* and add it to the name */
- }
- /* do we have complete info for this subdisk? */
- if (sd->sectors == 0)
- throw_rude_remark(EINVAL, "sd %s has no length spec", sd->name);
-
- if (state != sd_unallocated) /* we had a specific state to set */
- sd->state = state; /* do it now */
- else if (sd->state == sd_unallocated) /* no, nothing set yet, */
- sd->state = sd_up; /* must be up */
-
- /* register the subdisk with the drive. This action
- * will have the side effect of setting the offset if
- * we haven't specified one, and causing an error
- * message if it overlaps with another subdisk. */
- give_sd_to_drive(sdno);
-}
-
-/* Handle a plex definition.
- */
-void
-config_plex(int update)
-{
- int parameter;
- int plexno; /* index of plex in vinum_conf */
- struct plex *plex; /* and pointer to it */
- int pindex = MAXPLEX; /* index in volume's plex list */
- int detached = 0; /* don't give it to a volume */
- int namedplexno;
-
- current_plex = -1; /* forget the previous plex */
- plexno = get_empty_plex(); /* allocate a plex */
- plex = &PLEX[plexno]; /* and point to it */
- plex->plexno = plexno; /* and back to the config */
-
- for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
- switch (get_keyword(token[parameter], &keyword_set)) {
- case kw_detached:
- detached = 1;
- break;
-
- case kw_name:
- namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */
- if (namedplexno >= 0) { /* plex exists already, */
- if (update) /* are we updating? */
- return; /* yes: that's OK, just return */
- else
- throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]);
- }
- bcopy(token[parameter], /* put in the name */
- plex->name,
- min(MAXPLEXNAME, strlen(token[parameter])));
- break;
-
- case kw_org: /* plex organization */
- switch (get_keyword(token[++parameter], &keyword_set)) {
- case kw_concat:
- plex->organization = plex_concat;
- break;
-
- case kw_striped:
- {
- int stripesize = sizespec(token[++parameter]);
-
- plex->organization = plex_striped;
- if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */
- throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size",
- plex->name,
- stripesize);
- else
- plex->stripesize = stripesize / DEV_BSIZE;
- break;
- }
-
-
- default:
- throw_rude_remark(EINVAL, "Invalid plex organization");
- }
- if (((plex->organization == plex_striped)
- )
- && (plex->stripesize == 0)) /* didn't specify a valid stripe size */
- throw_rude_remark(EINVAL, "Need a stripe size parameter");
- break;
-
- case kw_volume:
- plex->volno = find_volume(token[++parameter], 1); /* insert a pointer to the volume */
- break;
-
- case kw_sd: /* add a subdisk */
- {
- int sdno;
-
- sdno = find_subdisk(token[++parameter], 1); /* find a subdisk */
- SD[sdno].plexoffset = sizespec(token[++parameter]); /* get the offset */
- give_sd_to_plex(plexno, sdno); /* and insert it there */
- break;
- }
-
- case kw_state:
- checkkernel(token[++parameter]); /* only for kernel use */
- plex->state = PlexState(token[parameter]); /* set the state */
- break;
-
- default:
- throw_rude_remark(EINVAL, "plex %s, invalid keyword: %s",
- plex->name,
- token[parameter]);
- }
- }
-
- if ((plex->volno < 0) /* we don't have a volume */
- &&(!detached)) /* and we wouldn't object */
- plex->volno = current_volume;
-
- if (plex->volno >= 0)
- pindex = give_plex_to_volume(plex->volno, plexno); /* Now tell the volume that it has this plex */
-
- /* Does the plex have a name? If not, give it one */
- if (plex->name[0] == '\0') { /* no name */
- char plexsuffix[8]; /* form plex name suffix here */
- /* Do we have a volume name? */
- if (plex->volno >= 0) /* we have a volume */
- strcpy(plex->name, /* take it from there */
- VOL[plex->volno].name);
- else /* no way */
- throw_rude_remark(EINVAL, "Unnamed plex is not associated with a volume");
- sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */
- strcat(plex->name, plexsuffix); /* and add it to the name */
- }
- /* Note the last plex we configured */
- current_plex = plexno;
- if (plex->state == plex_unallocated) /* we haven't changed the state, */
- plex->state = plex_init; /* we're initialized now */
-}
-
-/* Handle a volume definition.
- * If we find an error, print a message, deallocate the nascent volume, and return
- */
-void
-config_volume(int update)
-{
- int parameter;
- int volno;
- struct volume *vol; /* collect volume info here */
- int i;
-
- if (tokens < 2) /* not enough tokens */
- throw_rude_remark(EINVAL, "Volume has no name");
- current_volume = -1; /* forget the previous volume */
- volno = find_volume(token[1], 1); /* allocate a volume to initialize */
- vol = &VOL[volno]; /* and get a pointer */
- if (update && ((vol->flags & VF_NEWBORN) == 0)) /* this volume exists already */
- return; /* don't do anything */
- vol->flags &= ~VF_NEWBORN; /* no longer newly born */
-
- for (parameter = 2; parameter < tokens; parameter++) { /* look at all tokens */
- switch (get_keyword(token[parameter], &keyword_set)) {
- case kw_plex:
- {
- int plexno; /* index of this plex */
-
- plexno = find_plex(token[++parameter], 1); /* find a plex */
- if (plexno < 0) /* couldn't */
- break; /* we've already had an error message */
- plexno = my_plex(volno, plexno); /* does it already belong to us? */
- if (plexno > 0) /* yes, shouldn't get it again */
- throw_rude_remark(EINVAL,
- "Plex %s already belongs to volume %s",
- token[parameter],
- vol->name);
- else if (++vol->plexes > 8) /* another entry */
- throw_rude_remark(EINVAL,
- "Too many plexes for volume %s",
- vol->name);
- vol->plex[vol->plexes - 1] = plexno;
- }
- break;
-
- case kw_readpol:
- switch (get_keyword(token[++parameter], &keyword_set)) { /* decide what to do */
- case kw_round:
- vol->preferred_plex = ROUND_ROBIN_READPOL; /* default */
- break;
-
- case kw_prefer:
- {
- int myplexno; /* index of this plex */
-
- myplexno = find_plex(token[++parameter], 1); /* find a plex */
- if (myplexno < 0) /* couldn't */
- break; /* we've already had an error message */
- myplexno = my_plex(volno, myplexno); /* does it already belong to us? */
- if (myplexno > 0) /* yes */
- vol->preferred_plex = myplexno; /* just note the index */
- else if (++vol->plexes > 8) /* another entry */
- throw_rude_remark(EINVAL, "Too many plexes");
- else { /* space for the new plex */
- vol->plex[vol->plexes - 1] = myplexno; /* add it to our list */
- vol->preferred_plex = vol->plexes - 1; /* and note the index */
- }
- }
- break;
-
- default:
- throw_rude_remark(EINVAL, "Invalid read policy");
- }
-
- case kw_setupstate:
- vol->flags |= VF_CONFIG_SETUPSTATE; /* set the volume up later on */
- break;
-
- case kw_state:
- checkkernel(token[++parameter]); /* must be a kernel user */
- vol->state = VolState(token[parameter]); /* set the state */
- break;
-
- /* XXX experimental ideas. These are not
- * documented, and will not be until I
- * decide they're worth keeping */
- case kw_writethrough: /* set writethrough mode */
- vol->flags |= VF_WRITETHROUGH;
- break;
-
- case kw_writeback: /* set writeback mode */
- vol->flags &= ~VF_WRITETHROUGH;
- break;
-
- case kw_raw:
- vol->flags |= VF_RAW; /* raw volume (no label) */
- break;
-
- default:
- throw_rude_remark(EINVAL, "volume %s, invalid keyword: %s",
- vol->name,
- token[parameter]);
- }
- }
-
- current_volume = volno; /* note last referred volume */
- vol->devno = VINUMBDEV(volno, 0, 0, VINUM_VOLUME_TYPE); /* also note device number */
-
- /* Before we can actually use the volume, we need
- * a volume label. We could start to fake one here,
- * but it will be a lot easier when we have some
- * to copy from the drives, so defer it until we
- * set up the configuration. XXX */
- if (vol->state == volume_unallocated)
- vol->state = volume_down; /* now ready to bring up at the end */
-
- /* Find out how big our volume is */
- for (i = 0; i < vol->plexes; i++)
- vol->size = max(vol->size, PLEX[vol->plex[i]].length);
-}
-
-/* Parse a config entry. CARE! This destroys the original contents of the
- * config entry, which we don't really need after this. More specifically, it
- * places \0 characters at the end of each token.
- *
- * Return 0 if all is well, otherwise EINVAL */
-int
-parse_config(char *cptr, struct keywordset *keyset, int update)
-{
- int status;
-
- status = 0; /* until proven otherwise */
- tokens = tokenize(cptr, token); /* chop up into tokens */
-
- if (tokens <= 0) /* screwed up or empty line */
- return tokens; /* give up */
-
- if (token[0][0] == '#') /* comment line */
- return 0;
-
- switch (get_keyword(token[0], keyset)) { /* decide what to do */
- case kw_read: /* read config from a specified drive */
- vinum_scandisk(&token[1], tokens - 1); /* read the config from disk */
- break;
-
- case kw_drive:
- config_drive(update);
- break;
-
- case kw_subdisk:
- config_subdisk(update);
- break;
-
- case kw_plex:
- config_plex(update);
- break;
-
- case kw_volume:
- config_volume(update);
- break;
-
- /* Anything else is invalid in this context */
- default:
- throw_rude_remark(EINVAL, /* should we die? */
- "Invalid configuration information: %s",
- token[0]);
- }
- return status;
-}
-
-/* parse a line handed in from userland via ioctl.
- * This differs only by the error reporting mechanism:
- * we return the error indication in the reply to the
- * ioctl, so we need to set a global static pointer in
- * this file. This technique works because we have
- * ensured that configuration is performed in a single-
- * threaded manner */
-int
-parse_user_config(char *cptr, struct keywordset *keyset)
-{
- int status;
-
- ioctl_reply = (struct _ioctl_reply *) cptr;
- status = parse_config(cptr, keyset, 0);
- ioctl_reply = NULL; /* don't do this again */
- return status;
-}
-
-/* Remove an object */
-void
-remove(struct vinum_ioctl_msg *msg)
-{
- struct vinum_ioctl_msg message = *msg; /* make a copy to hand on */
-
- ioctl_reply = (struct _ioctl_reply *) msg; /* reinstate the address to reply to */
- ioctl_reply->error = 0; /* no error, */
- ioctl_reply->msg[0] = '\0'; /* no message */
-
- switch (message.type) {
- case drive_object:
- remove_drive_entry(message.index, message.force, message.recurse);
- updateconfig(0);
- return;
-
- case sd_object:
- remove_sd_entry(message.index, message.force, message.recurse);
- updateconfig(0);
- return;
-
- case plex_object:
- remove_plex_entry(message.index, message.force, message.recurse);
- updateconfig(0);
- return;
-
- case volume_object:
- remove_volume_entry(message.index, message.force, message.recurse);
- updateconfig(0);
- return;
-
- default:
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "Invalid object type");
- }
-}
-
-/* Remove a drive. */
-void
-remove_drive_entry(int driveno, int force, int recurse)
-{
- struct drive *drive = &DRIVE[driveno];
-
- if ((driveno > vinum_conf.drives_used) /* not a valid drive */
- ||(drive->state == drive_unallocated)) { /* or nothing there */
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "No such drive");
- } else if (drive->opencount > 0) { /* we have subdisks */
- if (force) { /* do it at any cost */
- int sdno;
- struct vinum_ioctl_msg sdmsg;
-
- for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
- if ((SD[sdno].state != sd_unallocated) /* subdisk is allocated */
- &&(SD[sdno].driveno == driveno)) { /* and it belongs to this drive */
- sdmsg.index = sdno;
- sdmsg.type = sd_object;
- sdmsg.recurse = 1;
- sdmsg.force = force;
- remove(&sdmsg); /* remove the subdisk by force */
- }
- }
- remove_drive(driveno); /* now remove it */
- } else
- ioctl_reply->error = EBUSY; /* can't do that */
- } else
- remove_drive(driveno); /* just remove it */
-}
-
-/* remove a subdisk */
-void
-remove_sd_entry(int sdno, int force, int recurse)
-{
- struct sd *sd = &SD[sdno];
-
- if ((sdno > vinum_conf.subdisks_used) /* not a valid sd */
- ||(sd->state == sd_unallocated)) { /* or nothing there */
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "No such subdisk");
- } else if (sd->plexno >= 0) { /* we have a plex */
- if (force) { /* do it at any cost */
- struct plex *plex = &PLEX[sd->plexno]; /* point to our plex */
- int mysdno;
-
- for (mysdno = 0; /* look for ourselves */
- mysdno < plex->subdisks && &SD[plex->sdnos[mysdno]] != sd;
- mysdno++);
- if (mysdno == plex->subdisks) /* didn't find it */
- throw_rude_remark(ENOENT, "plex %s does not contain subdisk %s", plex->name, sd->name);
- if (mysdno < (plex->subdisks - 1)) /* not the last subdisk */
- bcopy(&plex->sdnos[mysdno + 1],
- &plex->sdnos[mysdno],
- (plex->subdisks - 1 - mysdno) * sizeof(int));
- plex->subdisks--;
- /* removing a subdisk from a striped or
- * RAID-5 plex really tears the hell out
- * of the structure, and it needs to be
- * reinitialized */
- /* XXX Think about this. Maybe we should just
- * leave a hole */
- if (plex->organization != plex_concat) /* not concatenated, */
- set_plex_state(plex->plexno, plex_faulty, setstate_force); /* need to reinitialize */
- printf("vinum: removing %s\n", sd->name);
- free_sd(sdno);
- } else
- ioctl_reply->error = EBUSY; /* can't do that */
- } else {
- printf("vinum: removing %s\n", sd->name);
- free_sd(sdno);
- }
-}
-
-/* remove a plex */
-void
-remove_plex_entry(int plexno, int force, int recurse)
-{
- struct plex *plex = &PLEX[plexno];
- int sdno;
-
- if ((plexno > vinum_conf.plexes_used) /* not a valid plex */
- ||(plex->state == plex_unallocated)) { /* or nothing there */
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "No such plex");
- } else if (plex->pid) { /* we're open */
- ioctl_reply->error = EBUSY; /* no getting around that */
- return;
- }
- if (plex->subdisks) {
- if (force) { /* do it anyway */
- if (recurse) { /* remove all below */
- for (sdno = 0; sdno < plex->subdisks; sdno++)
- free_sd(plex->sdnos[sdno]); /* free all subdisks */
- } else { /* just tear them out */
- for (sdno = 0; sdno < plex->subdisks; sdno++)
- SD[plex->sdnos[sdno]].plexno = -1; /* no plex any more */
- }
- } else { /* can't do it without force */
- ioctl_reply->error = EBUSY; /* can't do that */
- return;
- }
- }
- if (plex->volno >= 0) { /* we are part of a volume */
- /* XXX This should be more intelligent. We should
- * be able to remove a plex as long as the volume
- * does not lose any data, which is normally the
- * case when it has more than one plex. To do it
- * right we must compare the completeness of the
- * mapping of all the plexes in the volume */
- if (force) { /* do it at any cost */
- struct volume *vol = &VOL[plex->volno];
- int myplexno;
-
- for (myplexno = 0; myplexno < vol->plexes; myplexno++)
- if (vol->plex[myplexno] == plexno) /* found it */
- break;
- if (myplexno == vol->plexes) /* didn't find it. Huh? */
- throw_rude_remark(ENOENT, "volume %s does not contain plex %s", vol->name, plex->name);
- if (myplexno < (vol->plexes - 1)) /* not the last plex in the list */
- bcopy(&vol->plex[myplexno + 1], &vol->plex[myplexno], vol->plexes - 1 - myplexno);
- vol->plexes--;
- } else {
- ioctl_reply->error = EBUSY; /* can't do that */
- return;
- }
- }
- printf("vinum: removing %s\n", plex->name);
- free_plex(plexno);
-}
-
-/* remove a volume */
-void
-remove_volume_entry(int volno, int force, int recurse)
-{
- struct volume *vol = &VOL[volno];
- int plexno;
-
- if ((volno > vinum_conf.volumes_used) /* not a valid volume */
- ||(vol->state == volume_unallocated)) { /* or nothing there */
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "No such volume");
- } else if (vol->opencount) /* we're open */
- ioctl_reply->error = EBUSY; /* no getting around that */
- else if (vol->plexes) {
- if (recurse && force) { /* remove all below */
- struct vinum_ioctl_msg plexmsg;
-
- plexmsg.type = plex_object;
- plexmsg.recurse = 1;
- plexmsg.force = force;
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- plexmsg.index = vol->plex[plexno]; /* plex number */
- remove(&plexmsg);
- }
- printf("vinum: removing %s\n", vol->name);
- free_volume(volno);
- } else
- ioctl_reply->error = EBUSY; /* can't do that */
- } else {
- printf("vinum: removing %s\n", vol->name);
- free_volume(volno);
- }
-}
-
-void
-update_sd_config(int sdno, int kernelstate)
-{
- if (!kernelstate)
- set_sd_state(sdno, sd_up, setstate_configuring);
-}
-
-void
-update_plex_config(int plexno, int kernelstate)
-{
- int error = 0;
- u_int64_t size;
- int sdno;
- struct plex *plex = &PLEX[plexno];
- enum plexstate state = plex_up; /* state we want the plex in */
-
- /* XXX Insert checks here for sparse plexes and volumes */
-
- /* Check that our subdisks make sense. For
- * striped and RAID5 plexes, we need at least
- * two subdisks, and they must all be the same
- * size */
- if (((plex->organization == plex_striped)
- )
- && (plex->subdisks < 2)) {
- error = 1;
- printf("vinum: plex %s does not have at least 2 subdisks\n", plex->name);
- if (!kernelstate)
- set_plex_state(plexno, plex_down, setstate_force | setstate_configuring);
- }
- size = 0;
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- if (((plex->organization == plex_striped)
- )
- && (sdno > 0)
- && (SD[plex->sdnos[sdno]].sectors != SD[plex->sdnos[sdno - 1]].sectors)) {
- error = 1;
- printf("vinum: %s must have equal sized subdisks\n", plex->name);
- set_plex_state(plexno, plex_down, setstate_force | setstate_configuring);
- }
- size += SD[plex->sdnos[sdno]].sectors;
- }
-
- if (plex->subdisks) { /* plex has subdisks, calculate size */
- /* XXX We shouldn't need to calculate the size any
- * more. Check this some time */
- if (plex->length != size)
- printf("Correcting length of %s: was %qd, is %qd\n", plex->name, plex->length, size);
- plex->length = size;
- } else { /* no subdisks, */
- plex->length = 0; /* no size */
- state = plex_down; /* take it down */
- }
- if (!(kernelstate || error))
- set_plex_state(plexno, state, setstate_none | setstate_configuring);
-}
-
-void
-update_volume_config(int volno, int kernelstate)
-{
- struct volume *vol = &VOL[volno];
- struct plex *plex;
- int plexno;
-
- if (vol->state != volume_unallocated)
- /* Recalculate the size of the volume */
- {
- vol->size = 0;
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- plex = &PLEX[vol->plex[plexno]];
- vol->size = max(plex->length, vol->size); /* maximum size */
- plex->volplexno = plexno; /* note it in the plex */
- }
- }
- if (!kernelstate) /* try to bring it up */
- set_volume_state(volno, volume_up, setstate_configuring);
-}
-
-/* Update the global configuration.
- * kernelstate is != 0 if we're reading in a config
- * from disk. In this case, we don't try to
- * bring the devices up, though we will bring
- * them down if there's some error which got
- * missed when writing to disk.
- */
-void
-updateconfig(int kernelstate)
-{
- int plexno;
- int volno;
-
-
- for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++)
- update_plex_config(plexno, kernelstate);
-
- for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
- VOL[volno].flags &= ~VF_CONFIG_SETUPSTATE; /* no more setupstate */
- set_volume_state(volno, volume_up, setstate_configuring);
- }
- save_config();
-}
-
-/* Start manual changes to the configuration and lock out
- * others who may wish to do so.
- * XXX why do we need this and lock_config too? */
-int
-start_config(void)
-{
- int error;
-
- while ((vinum_conf.flags & VF_CONFIGURING) != 0) {
- vinum_conf.flags |= VF_WILL_CONFIGURE;
- if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
- return error;
- }
- /* We need two flags here: VF_CONFIGURING
- * tells other processes to hold off (this
- * function), and VF_CONFIG_INCOMPLETE
- * tells the state change routines not to
- * propagate incrememntal state changes */
- vinum_conf.flags |= VF_CONFIGURING | VF_CONFIG_INCOMPLETE;
- current_drive = -1; /* reset the defaults */
- current_plex = -1; /* and the same for the last plex */
- current_volume = -1; /* and the last volme */
- return 0;
-}
-
-/* Update the config if update is 1, and unlock
- * it. We won't update the configuration if we
- * are called in a recursive loop via throw_rude_remark.
- */
-void
-finish_config(int update)
-{
- vinum_conf.flags &= ~VF_CONFIG_INCOMPLETE; /* we've finished our config */
- if (update)
- updateconfig(0); /* so update things */
- else
- updateconfig(1); /* do some updates only */
- vinum_conf.flags &= ~VF_CONFIGURING; /* and now other people can take a turn */
- if ((vinum_conf.flags & VF_WILL_CONFIGURE) != 0) {
- vinum_conf.flags &= ~VF_WILL_CONFIGURE;
- wakeup(&vinum_conf);
- }
-}
diff --git a/sys/dev/vinum/vinumdaemon.c b/sys/dev/vinum/vinumdaemon.c
deleted file mode 100644
index 23f3213f4cec..000000000000
--- a/sys/dev/vinum/vinumdaemon.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* daemon.c: kernel part of Vinum daemon */
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumdaemon.c,v 1.3 1999/01/18 04:32:50 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "vinumhdr.h"
-#include "request.h"
-
-#ifdef VINUMDEBUG
-#include <sys/reboot.h>
-#endif
-
-/* declarations */
-void recover_io(struct request *rq);
-
-struct daemonq *daemonq; /* daemon's work queue */
-struct daemonq *dqend; /* and the end of the queue */
-int daemon_options = 0; /* options */
-
-void
-vinum_daemon(void)
-{
- struct daemonq *request;
- int s;
-
- daemon_save_config(); /* start by saving the configuration */
- while (1) {
- tsleep(&vinum_daemon, PRIBIO, "vinum", 0); /* wait for something to happen */
-
- while (daemonq != NULL) { /* we have work to do, */
- s = splhigh(); /* don't get interrupted here */
- request = daemonq; /* get the request */
- daemonq = daemonq->next; /* and detach it */
- if (daemonq == NULL) /* got to the end, */
- dqend = NULL; /* no end any more */
- splx(s);
-
- switch (request->type) {
- /* We had an I/O error on a request. Go through the
- * request and try to salvage it */
- case daemonrq_ioerror:
- if (daemon_options & daemon_verbose) {
- struct request *rq = request->info.rq;
-
- printf("vinumd: recovering I/O request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount);
- }
- recover_io(request->info.rq); /* the failed request */
- break;
-
- /* Write the config to disk. We could end up with
- * quite a few of these in a row. Only honour the
- * last one */
- case daemonrq_saveconfig:
- if ((daemonq == NULL) /* no more requests */
- ||(daemonq->type != daemonrq_saveconfig)) { /* or the next isn't the same */
- if ((daemon_options & daemon_noupdate) == 0) { /* we can do it */
- if (daemon_options & daemon_verbose)
- printf("vinumd: saving config\n");
- daemon_save_config(); /* save it */
- }
- }
- break;
-
- case daemonrq_return: /* been told to stop */
- if (daemon_options & daemon_verbose)
- printf("vinumd: stopping\n");
- daemon_options |= daemon_stopped; /* note that we've stopped */
- wakeup(vinum_daemon); /* in case somebody's waiting for us to stop */
- return;
- break;
-
- case daemonrq_ping: /* tell the caller we're here */
- if (daemon_options & daemon_verbose)
- printf("vinumd: ping reply\n");
- wakeup(&vinum_finddaemon); /* wake up the caller */
- break;
-
- case daemonrq_init: /* initialize a plex */
- /* XXX */
- case daemonrq_revive: /* revive a subdisk */
- /* XXX */
- default:
- printf("Invalid request\n");
- break;
- }
- Free(request);
- }
- }
-}
-
-/* Recover a failed I/O operation.
-
- * The correct way to do this is to examine the request and determine
- * how to recover each individual failure. In the case of a write,
- * this could be as simple as doing nothing: the defective drives may
- * already be down, and there may be nothing else to do. In case of
- * a read, it will be necessary to retry if there are alternative
- * copies of the data.
- *
- * The easy way (here) is just to reissue the request. This will take
- * a little longer, but nothing like as long as the failure will have
- * taken.
- *
- */
-void
-recover_io(struct request *rq)
-{
- vinumstrategy(rq->bp); /* reissue the command */
-}
-
-/* Functions called to interface with the daemon */
-
-/* queue a request for the daemon */
-void
-queue_daemon_request(enum daemonrq type, union daemoninfo info)
-{
- int s;
-
- struct daemonq *qelt = (struct daemonq *) Malloc(sizeof(struct daemonq));
- qelt->next = NULL; /* end of the chain */
- qelt->type = type;
- qelt->info = info;
- s = splhigh();
- if (daemonq) { /* something queued already */
- dqend->next = qelt;
- dqend = qelt;
- } else { /* queue is empty, */
- daemonq = qelt; /* this is the whole queue */
- dqend = qelt;
- }
- splx(s);
- wakeup(&vinum_daemon); /* and give the dæmon a kick */
-}
-
-/* see if the daemon is running. Return 0 (no error)
- * if it is, ESRCH otherwise */
-
-int
-vinum_finddaemon()
-{
- int result;
-
- int i;
-
- for (i = 0; i < 2; i++) { /* try twice */
- queue_daemon_request(daemonrq_ping, NULL); /* queue a ping */
- do
- result = tsleep(&vinum_finddaemon, PUSER, "recolte", 20 * hz);
- while (result == ERESTART); /* let it finish */
- }
-
- if (result) /* will be EWOULDBLOCK or EINTR */
- return ESRCH; /* no process */
- return 0;
-}
-
-int
-vinum_setdaemonopts(int options)
-{
- daemon_options = options;
- return 0;
-}
diff --git a/sys/dev/vinum/vinumext.h b/sys/dev/vinum/vinumext.h
deleted file mode 100644
index 40ffbbbd3eeb..000000000000
--- a/sys/dev/vinum/vinumext.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumext.h,v 1.18 1999/01/15 02:41:16 grog Exp grog $
- */
-
-/* vinumext.h: external definitions */
-
-extern struct _vinum_conf vinum_conf; /* configuration information */
-
-#ifdef VINUMDEBUG
-extern debug; /* debug flags */
-#endif
-
-#define CHECKALLOC(ptr, msg) \
- if (ptr == NULL) \
- { \
- printf (msg); \
- longjmp (command_fail, -1); \
- }
-#ifndef KERNEL
-struct vnode;
-struct proc;
-#endif
-
-#ifdef KERNEL
-int give_sd_to_plex(int plexno, int sdno);
-int give_plex_to_volume(int volno, int plexno);
-struct drive *check_drive(char *);
-enum drive_label_info read_drive_label(struct drive *, int);
-int parse_config(char *, struct keywordset *, int);
-int parse_user_config(char *cptr, struct keywordset *keyset);
-u_int64_t sizespec(char *spec);
-int volume_index(struct volume *volume);
-int plex_index(struct plex *plex);
-int sd_index(struct sd *sd);
-int drive_index(struct drive *drive);
-int my_plex(int volno, int plexno);
-int my_sd(int plexno, int sdno);
-int get_empty_drive(void);
-int find_drive(const char *name, int create);
-int find_drive_by_dev(const char *devname, int create);
-int get_empty_sd(void);
-int find_subdisk(const char *name, int create);
-void free_sd(int sdno);
-void free_volume(int volno);
-int get_empty_plex(void);
-int find_plex(const char *name, int create);
-void free_plex(int plexno);
-int get_empty_volume(void);
-int find_volume(const char *name, int create);
-void config_subdisk(int);
-void config_plex(int);
-void config_volume(int);
-void config_drive(int);
-void updateconfig(int);
-void update_sd_config(int sdno, int kernelstate);
-void update_plex_config(int plexno, int kernelstate);
-void update_volume_config(int volno, int kernelstate);
-void update_config(void);
-void drive_io_done(struct buf *);
-void save_config(void);
-void daemon_save_config(void);
-void write_config(char *, int);
-int start_config(void);
-void finish_config(int);
-void remove(struct vinum_ioctl_msg *msg);
-void remove_drive_entry(int driveno, int force, int recurse);
-void remove_sd_entry(int sdno, int force, int recurse);
-void remove_plex_entry(int plexno, int force, int recurse);
-void remove_volume_entry(int volno, int force, int recurse);
-
-void checkernel(char *);
-int open_drive(struct drive *, struct proc *, int);
-void close_drive(struct drive *drive);
-int driveio(struct drive *, char *, size_t, off_t, int);
-/* #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
- #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE) */
-int set_drive_parms(struct drive *drive);
-int init_drive(struct drive *, int);
-/* void throw_rude_remark (int, struct _ioctl_reply *, char *, ...); XXX */
-void throw_rude_remark(int, char *,...);
-
-/* XXX die die */
-int read_drive(struct drive *drive, void *buf, size_t length, off_t offset);
-int write_drive(struct drive *drive, void *buf, size_t length, off_t offset);
-void format_config(char *config, int len);
-void checkkernel(char *op);
-void free_drive(struct drive *drive);
-void down_drive(struct drive *drive);
-void remove_drive(int driveno);
-
-void vinum_scandisk(char *drivename[], int drives);
-
-/* I/O */
-d_open_t vinumopen;
-d_close_t vinumclose;
-d_strategy_t vinumstrategy;
-d_ioctl_t vinumioctl;
-d_dump_t vinumdump;
-d_psize_t vinumsize;
-d_read_t vinumread;
-d_write_t vinumwrite;
-
-int vinumstart(struct buf *bp, int reviveok);
-int launch_requests(struct request *rq, int reviveok);
-void sdio(struct buf *bp);
-
-/* XXX Do we need this? */
-int vinumpart(dev_t);
-
-#ifdef VINUMDEBUG
-/* Memory allocation and request tracing */
-void vinum_meminfo(caddr_t data);
-int vinum_mallocinfo(caddr_t data);
-int vinum_rqinfo(caddr_t data);
-#endif
-
-void expand_table(void **, int, int);
-
-struct request;
-struct rqgroup *allocrqg(struct request *rq, int elements);
-void deallocrqg(struct rqgroup *rqg);
-
-/* Device number decoding */
-int Volno(dev_t x);
-int Plexno(dev_t x);
-int Sdno(dev_t x);
-
-/* State transitions */
-int set_drive_state(int driveno, enum drivestate state, enum setstateflags flags);
-int set_sd_state(int sdno, enum sdstate state, enum setstateflags flags);
-enum requeststatus checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend);
-int set_plex_state(int plexno, enum plexstate state, enum setstateflags flags);
-int set_volume_state(int volumeno, enum volumestate state, enum setstateflags flags);
-void update_sd_state(int sdno);
-void update_plex_state(int plexno);
-void update_volume_state(int volno);
-void invalidate_subdisks(struct plex *, enum sdstate);
-void get_volume_label(struct volume *vol, struct disklabel *lp);
-int write_volume_label(int);
-void start_object(struct vinum_ioctl_msg *);
-void stop_object(struct vinum_ioctl_msg *);
-void setstate(struct vinum_ioctl_msg *msg);
-void vinum_label(int);
-int vinum_writedisklabel(struct volume *, struct disklabel *);
-int initsd(int);
-
-int restart_plex(int plexno);
-int revive_read(struct sd *sd);
-int revive_block(int sdno);
-
-/* Auxiliary functions */
-enum sdstates sdstatemap(struct plex *plex);
-enum volplexstate vpstate(struct plex *plex);
-#endif
-
-enum keyword get_keyword(char *, struct keywordset *);
-void listconfig(void);
-char *drive_state(enum drivestate);
-char *volume_state(enum volumestate);
-char *plex_state(enum plexstate);
-char *plex_org(enum plexorg);
-char *sd_state(enum sdstate);
-enum drivestate DriveState(char *text);
-enum sdstate SdState(char *text);
-enum plexstate PlexState(char *text);
-enum volumestate VolState(char *text);
-struct drive *validdrive(int driveno, struct _ioctl_reply *);
-struct sd *validsd(int sdno, struct _ioctl_reply *);
-struct plex *validplex(int plexno, struct _ioctl_reply *);
-struct volume *validvol(int volno, struct _ioctl_reply *);
-int tokenize(char *, char *[]);
-void resetstats(struct vinum_ioctl_msg *msg);
-
-/* Locking */
-int lockdrive(struct drive *drive);
-void unlockdrive(struct drive *drive);
-int lockvol(struct volume *vol);
-void unlockvol(struct volume *vol);
-int lockplex(struct plex *plex);
-void unlockplex(struct plex *plex);
-int lockrange(struct plex *plex, off_t first, off_t last);
-void unlockrange(struct plex *plex, off_t first, off_t last);
-int lock_config(void);
-void unlock_config(void);
-
-/* Dæmon */
-
-void vinum_daemon(void);
-int vinum_finddaemon(void);
-int vinum_setdaemonopts(int);
-extern struct daemonq *daemonq; /* daemon's work queue */
-extern struct daemonq *dqend; /* and the end of the queue */
diff --git a/sys/dev/vinum/vinumhdr.h b/sys/dev/vinum/vinumhdr.h
deleted file mode 100644
index c913665cc30c..000000000000
--- a/sys/dev/vinum/vinumhdr.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- */
-
-/* Header files used by all modules */
-/* $Id: vinumhdr.h,v 1.11 1998/12/30 05:11:15 grog Exp grog $ */
-
-#ifdef KERNEL
-#define REALLYKERNEL
-#endif
-#include <sys/param.h>
-#ifdef REALLYKERNEL
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#endif
-#ifdef DEVFS
-#error "DEVFS code not complete yet"
-#include <sys/devfsext.h>
-#endif /*DEVFS */
-#include <sys/proc.h>
-#include <sys/errno.h>
-#include <sys/dkstat.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-#include <sys/namei.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/disklabel.h>
-#include <ufs/ffs/fs.h>
-#include <sys/mount.h>
-#include <sys/device.h>
-#undef KERNEL /* XXX */
-#include <sys/disk.h>
-#ifdef REALLYKERNEL
-#define KERNEL
-#endif
-#include <sys/syslog.h>
-#include <sys/fcntl.h>
-#include <sys/vnode.h>
-#include <sys/dkbad.h>
-#include <sys/queue.h>
-#ifdef KERNEL
-#include <machine/setjmp.h>
-#include <machine/stdarg.h>
-#else
-#include <setjmp.h>
-#include <stdarg.h>
-#endif
-#include <vm/vm.h>
-#include <dev/vinum/vinumvar.h>
-#include <dev/vinum/vinumio.h>
-#include <dev/vinum/vinumkw.h>
-#include <dev/vinum/vinumext.h>
-
-#undef Free /* defined in some funny net stuff */
-#ifdef REALLYKERNEL
-#ifdef VINUMDEBUG
-#define Malloc(x) MMalloc ((x), __FILE__, __LINE__) /* show where we came from */
-#define Free(x) FFree ((x), __FILE__, __LINE__) /* show where we came from */
-caddr_t MMalloc (int size, char *, int);
-void FFree (void *mem, char *, int);
-#else
-#define Malloc(x) malloc((x), M_DEVBUF, M_WAITOK)
-#define Free(x) free((x), M_DEVBUF)
-#endif
-#else
-#define Malloc(x) malloc ((x)) /* just the size */
-#define Free(x) free ((x)) /* just the address */
-#endif
-
diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c
deleted file mode 100644
index 073ee7635c77..000000000000
--- a/sys/dev/vinum/vinuminterrupt.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* interrupt.c: bottom half of the driver */
-
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinuminterrupt.c,v 1.4 1999/01/12 04:30:12 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-#include <miscfs/specfs/specdev.h>
-#include <sys/resourcevar.h>
-
-void complete_raid5_write(struct rqelement *);
-void freerq(struct request *rq);
-void free_rqg(struct rqgroup *rqg);
-void complete_rqe(struct buf *bp);
-void sdio_done(struct buf *bp);
-
-/* Take a completed buffer, transfer the data back if
- * it's a read, and complete the high-level request
- * if this is the last subrequest.
- *
- * The bp parameter is in fact a struct rqelement, which
- * includes a couple of extras at the end.
- */
-void
-complete_rqe(struct buf *bp)
-{
- struct rqelement *rqe;
- struct request *rq;
- struct rqgroup *rqg;
- struct buf *ubp; /* user buffer */
-
- rqe = (struct rqelement *) bp; /* point to the element element that completed */
- rqg = rqe->rqg; /* and the request group */
- rq = rqg->rq; /* and the complete request */
- ubp = rq->bp; /* user buffer */
-
-#ifdef VINUMDEBUG
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_iodone, rqe, ubp);
-#endif
- if ((bp->b_flags & B_ERROR) != 0) { /* transfer in error */
- if (bp->b_error != 0) /* did it return a number? */
- rq->error = bp->b_error; /* yes, put it in. */
- else if (rq->error == 0) /* no: do we have one already? */
- rq->error = EIO; /* no: catchall "I/O error" */
- SD[rqe->sdno].lasterror = rq->error;
- if (bp->b_flags & B_READ) {
- printf("%s: fatal read I/O error\n", SD[rqe->sdno].name);
- set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* subdisk is crashed */
- } else { /* write operation */
- printf("%s: fatal write I/O error\n", SD[rqe->sdno].name);
- set_sd_state(rqe->sdno, sd_stale, setstate_force); /* subdisk is stale */
- }
- if (rq->error == ENXIO) { /* the drive's down too */
- printf("%s: fatal drive I/O error\n", DRIVE[rqe->driveno].label.name);
- DRIVE[rqe->driveno].lasterror = rq->error;
- set_drive_state(rqe->driveno, /* take the drive down */
- drive_down,
- setstate_force);
- }
- }
- /* Now update the statistics */
- if (bp->b_flags & B_READ) { /* read operation */
- DRIVE[rqe->driveno].reads++;
- DRIVE[rqe->driveno].bytes_read += bp->b_bcount;
- SD[rqe->sdno].reads++;
- SD[rqe->sdno].bytes_read += bp->b_bcount;
- PLEX[rqe->rqg->plexno].reads++;
- PLEX[rqe->rqg->plexno].bytes_read += bp->b_bcount;
- } else { /* write operation */
- DRIVE[rqe->driveno].writes++;
- DRIVE[rqe->driveno].bytes_written += bp->b_bcount;
- SD[rqe->sdno].writes++;
- SD[rqe->sdno].bytes_written += bp->b_bcount;
- PLEX[rqe->rqg->plexno].writes++;
- PLEX[rqe->rqg->plexno].bytes_written += bp->b_bcount;
- }
- rqg->active--; /* one less request active */
- if (rqg->active == 0) /* request group finished, */
- rq->active--; /* one less */
- if (rq->active == 0) { /* request finished, */
-#if VINUMDEBUG
- if (debug & DEBUG_RESID) {
- if (ubp->b_resid != 0) /* still something to transfer? */
- Debugger("resid");
-
- {
- int i;
- for (i = 0; i < ubp->b_bcount; i += 512) /* XXX debug */
- if (((char *) ubp->b_data)[i] != '<') { /* and not what we expected */
- printf("At 0x%x (offset 0x%x): '%c' (0x%x)\n",
- (int) (&((char *) ubp->b_data)[i]),
- i,
- ((char *) ubp->b_data)[i],
- ((char *) ubp->b_data)[i]);
- Debugger("complete_request checksum");
- }
- }
- }
-#endif
-
- if (rq->error) { /* did we have an error? */
- if (rq->isplex) { /* plex operation, */
- ubp->b_flags |= B_ERROR; /* yes, propagate to user */
- ubp->b_error = rq->error;
- } else /* try to recover */
- queue_daemon_request(daemonrq_ioerror, rq); /* let the daemon complete */
- } else {
- ubp->b_resid = 0; /* completed our transfer */
- if (rq->isplex == 0) /* volume request, */
- VOL[rq->volplex.volno].active--; /* another request finished */
- biodone(ubp); /* top level buffer completed */
- freerq(rq); /* return the request storage */
- }
- }
-}
-
-
-/* Free a request block and anything hanging off it */
-void
-freerq(struct request *rq)
-{
- struct rqgroup *rqg;
- struct rqgroup *nrqg; /* next in chain */
- int rqno;
-
- for (rqg = rq->rqg; rqg != NULL; rqg = nrqg) { /* through the whole request chain */
- for (rqno = 0; rqno < rqg->count; rqno++)
- if ((rqg->rqe[rqno].flags & XFR_MALLOCED) /* data buffer was malloced, */
- &&rqg->rqe[rqno].b.b_data) /* and the allocation succeeded */
- Free(rqg->rqe[rqno].b.b_data); /* free it */
- nrqg = rqg->next; /* note the next one */
- Free(rqg); /* and free this one */
- }
- Free(rq); /* free the request itself */
-}
-
-void
-free_rqg(struct rqgroup *rqg)
-{
- if ((rqg->flags & XFR_GROUPOP) /* RAID 5 request */
- &&(rqg->rqe) /* got a buffer structure */
- &&(rqg->rqe->b.b_data)) /* and it has a buffer allocated */
- Free(rqg->rqe->b.b_data); /* free it */
-}
-
-/* I/O on subdisk completed */
-void
-sdio_done(struct buf *bp)
-{
- struct sdbuf *sbp;
-
- sbp = (struct sdbuf *) bp;
- if (sbp->b.b_flags & B_ERROR) { /* had an error */
- bp->b_flags |= B_ERROR;
- bp->b_error = sbp->b.b_error;
- }
- bp->b_resid = sbp->b.b_resid;
- biodone(sbp->bp); /* complete the caller's I/O */
- /* Now update the statistics */
- if (bp->b_flags & B_READ) { /* read operation */
- DRIVE[sbp->driveno].reads++;
- DRIVE[sbp->driveno].bytes_read += bp->b_bcount;
- SD[sbp->sdno].reads++;
- SD[sbp->sdno].bytes_read += bp->b_bcount;
- } else { /* write operation */
- DRIVE[sbp->driveno].writes++;
- DRIVE[sbp->driveno].bytes_written += bp->b_bcount;
- SD[sbp->sdno].writes++;
- SD[sbp->sdno].bytes_written += bp->b_bcount;
- }
- Free(sbp);
-}
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
deleted file mode 100644
index 331debfa643c..000000000000
--- a/sys/dev/vinum/vinumio.c
+++ /dev/null
@@ -1,1032 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumio.c,v 1.21 1998/12/30 06:04:31 grog Exp grog $
- */
-
-#define STATIC /* nothing while we're testing XXX */
-
-#include "opt_vinum.h"
-
-#define REALLYKERNEL
-#include "vinumhdr.h"
-#include "request.h"
-#include <miscfs/specfs/specdev.h>
-
-extern jmp_buf command_fail; /* return on a failed command */
-struct _ioctl_reply *ioctl_reply; /* data pointer, for returning error messages */
-
-/* Why aren't these declared anywhere? XXX */
-int setjmp(jmp_buf);
-void longjmp(jmp_buf, int);
-
-static char *sappend(char *txt, char *s);
-static int drivecmp(const void *va, const void *vb);
-
-/* Open the device associated with the drive, and set drive's vp.
- * Return an error number */
-int
-open_drive(struct drive *drive, struct proc *p, int verbose)
-{
- struct nameidata nd;
- struct vattr va;
- int error;
-
- if (drive->devicename[0] == '\0') /* no device name */
- sprintf(drive->devicename, "/dev/%s", drive->label.name); /* get it from the drive name */
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, drive->devicename, p);
- error = vn_open(&nd, FREAD | FWRITE, 0); /* open the device */
- if (error != 0) { /* can't open? */
- set_drive_state(drive->driveno, drive_down, setstate_force);
- drive->lasterror = error;
- if (verbose)
- printf("vinum open_drive %s: failed with error %d\n", drive->devicename, error); /* XXX */
- return error;
- }
- drive->vp = nd.ni_vp;
- drive->p = p;
-
- if (drive->vp->v_usecount > 1) { /* already in use? */
- if (verbose)
- printf("open_drive %s: use count %d, ignoring\n", /* XXX where does this come from? */
- drive->devicename,
- drive->vp->v_usecount);
- drive->vp->v_usecount = 1; /* will this work? */
- }
- error = VOP_GETATTR(drive->vp, &va, NOCRED, drive->p);
- if (error) {
- VOP_UNLOCK(drive->vp, 0, drive->p);
- close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force);
- drive->lasterror = error;
- if (verbose)
- printf("vinum open_drive %s: GETAATTR returns error %d\n", drive->devicename, error); /* XXX */
- return error;
- }
- drive->dev = va.va_rdev; /* device */
-
- if (va.va_type != VBLK) { /* only consider block devices */
- VOP_UNLOCK(drive->vp, 0, drive->p);
- close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force); /* this also closes the drive */
- drive->lasterror = ENOTBLK;
- if (verbose)
- printf("vinum open_drive %s: Not a block device\n", drive->devicename); /* XXX */
- return ENOTBLK;
- }
- drive->vp->v_numoutput = 0;
- VOP_UNLOCK(drive->vp, 0, drive->p);
- return 0;
-}
-
-/* Set some variables in the drive struct
- * in more convenient form. Return error indication */
-int
-set_drive_parms(struct drive *drive)
-{
- drive->blocksize = BLKDEV_IOSIZE; /* XXX do we need this? */
- drive->secsperblock = drive->blocksize /* number of sectors per block */
- / drive->partinfo.disklab->d_secsize;
-
- /* Now update the label part */
- bcopy(hostname, drive->label.sysname, VINUMHOSTNAMELEN); /* put in host name */
- getmicrotime(&drive->label.date_of_birth); /* and current time */
- drive->label.drive_size = ((u_int64_t) drive->partinfo.part->p_size) /* size of the drive in bytes */
- *((u_int64_t) drive->partinfo.disklab->d_secsize);
-
- /* number of sectors available for subdisks */
- drive->sectors_available = drive->label.drive_size / DEV_BSIZE - DATASTART;
-
- /* XXX Bug in 3.0 as of January 1998: you can open
- * non-existent slices. They have a length of 0 */
- if (drive->label.drive_size < MINVINUMSLICE) { /* too small to worry about */
- set_drive_state(drive->driveno, drive_down, setstate_force);
- drive->lasterror = ENOSPC;
- return ENOSPC;
- }
- drive->freelist_size = INITIAL_DRIVE_FREELIST; /* initial number of entries */
- drive->freelist = (struct drive_freelist *)
- Malloc(INITIAL_DRIVE_FREELIST * sizeof(struct drive_freelist));
- if (drive->freelist == NULL) /* can't malloc, dammit */
- return ENOSPC;
- drive->freelist_entries = 1; /* just (almost) the complete drive */
- drive->freelist[0].offset = DATASTART; /* starts here */
- drive->freelist[0].sectors = (drive->label.drive_size >> DEV_BSHIFT) - DATASTART; /* and it's this long */
- if (drive->label.name[0] != '\0') /* got a name */
- set_drive_state(drive->driveno, drive_up, setstate_force); /* our drive is accessible */
- else /* we know about it, but that's all */
- drive->state = drive_uninit;
- return 0;
-}
-
-/* Initialize a drive: open the device and add device
- * information */
-int
-init_drive(struct drive *drive, int verbose)
-{
- int error;
-
- if (drive->devicename[0] == '\0') { /* no device name yet, default to drive name */
- drive->lasterror = EINVAL;
- /* This is a bug if it happens internally,
- * so print a message regardless */
- printf("vinum: Can't open drive without drive name\n"); /* XXX */
- return EINVAL;
- }
- error = open_drive(drive, curproc, verbose); /* open the drive */
- if (error)
- return error;
-
- error = VOP_IOCTL(drive->vp, /* get the partition information */
- DIOCGPART,
- (caddr_t) & drive->partinfo,
- FREAD,
- NOCRED,
- curproc);
- if (error) {
- if (verbose)
- printf("vinum open_drive %s: Can't get partition information, error %d\n",
- drive->devicename,
- error); /* XXX */
- close_drive(drive);
- drive->lasterror = error;
- set_drive_state(drive->driveno, drive_down, setstate_force);
- return error;
- }
- if (drive->partinfo.part->p_fstype != 0) { /* not plain */
- drive->lasterror = EFTYPE;
- if (verbose)
- printf("vinum open_drive %s: Wrong partition type for vinum\n", drive->devicename); /* XXX */
- close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force);
- return EFTYPE;
- }
- return set_drive_parms(drive); /* set various odds and ends */
-}
-
-/* Close a drive if it's open. No errors */
-void
-close_drive(struct drive *drive)
-{
- if (drive->vp) {
- lockdrive(drive); /* keep the daemon out */
- vn_close(drive->vp, FREAD | FWRITE, NOCRED, drive->p);
- if (drive->vp->v_usecount) { /* XXX shouldn't happen */
- printf("close_drive %s: use count still %d\n", drive->devicename, drive->vp->v_usecount);
- drive->vp->v_usecount = 0; /* will this work? */
- }
- drive->vp = NULL;
- unlockdrive(drive);
- }
-}
-
-/* Remove drive from the configuration.
- * Caller must ensure that it isn't active
- */
-void
-remove_drive(int driveno)
-{
- struct drive *drive = &vinum_conf.drive[driveno];
- long long int nomagic = VINUM_NOMAGIC; /* no magic number */
-
- write_drive(drive, /* obliterate the magic, but leave a hint */
- (char *) &nomagic,
- 8,
- VINUM_LABEL_OFFSET);
- free_drive(drive); /* close it and free resources */
- save_config(); /* and save the updated configuration */
-}
-
-/* Transfer drive data. Usually called from one of these defines;
- * #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
- * #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE)
- *
- * length and offset are in bytes, but must be multiples of sector
- * size. The function *does not check* for this condition, and
- * truncates ruthlessly.
- * Return error number
- */
-int
-driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag)
-{
- int error;
- struct buf *bp;
- char foo[40];
-
- error = 0; /* to keep the compiler happy */
- while (length) { /* divide into small enough blocks */
- int len = min(length, MAXBSIZE); /* maximum block device transfer is MAXBSIZE */
-
- bp = geteblk(len); /* get a buffer header */
- bp->b_flags = B_BUSY | flag; /* get busy */
- bp->b_proc = curproc; /* process */
- bp->b_dev = drive->vp->v_un.vu_specinfo->si_rdev; /* device */
- bp->b_blkno = offset / drive->partinfo.disklab->d_secsize; /* block number */
- bp->b_data = buf;
- bp->b_bcount = len;
- bp->b_bufsize = len;
-
- (*bdevsw[major(bp->b_dev)]->d_strategy) (bp); /* initiate the transfer */
-
- error = biowait(bp);
- printf("driveio: %s dev 0x%x, block 0x%x, len 0x%lx, error %d\n", /* XXX */
- flag ? "read" : "write",
- bp->b_dev,
- bp->b_blkno,
- bp->b_bcount,
- error);
- bcopy(buf, foo, 40);
- foo[39] = '\0';
- printf("---> %s\n", foo); /* XXXXXX */
- bp->b_flags |= B_INVAL | B_AGE;
- brelse(bp);
- if (error)
- break;
- length -= len; /* update pointers */
- buf += len;
- offset += len;
- }
- return error;
-}
-
-/* Read data from a drive
-
- * Return error number
- */
-int
-read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
-{
- int error;
- struct buf *bp;
- daddr_t nextbn;
- long bscale;
-
- struct uio uio;
- struct iovec iov;
- daddr_t blocknum; /* block number */
- int blockoff; /* offset in block */
- int count; /* amount to transfer */
-
- iov.iov_base = buf;
- iov.iov_len = length;
-
- uio.uio_iov = &iov;
- uio.uio_iovcnt = length;
- uio.uio_offset = offset;
- uio.uio_resid = length;
- uio.uio_segflg = UIO_SYSSPACE;
- uio.uio_rw = UIO_READ;
- uio.uio_procp = curproc;
-
- bscale = btodb(drive->blocksize); /* mask off offset from block number */
- do {
- blocknum = btodb(uio.uio_offset) & ~(bscale - 1); /* get the block number */
- blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
- count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
- uio.uio_resid);
-
- /* XXX Check this. I think the test is wrong */
- if (drive->vp->v_lastr + bscale == blocknum) { /* did our last read finish in this block? */
- nextbn = blocknum + bscale; /* note the end of the transfer */
- error = breadn(drive->vp, /* and read with read-ahead */
- blocknum,
- (int) drive->blocksize,
- &nextbn,
- (int *) &drive->blocksize,
- 1,
- NOCRED,
- &bp);
- } else /* random read: just read this block */
- error = bread(drive->vp, blocknum, (int) drive->blocksize, NOCRED, &bp);
- drive->vp->v_lastr = blocknum; /* note the last block we read */
- count = min(count, drive->blocksize - bp->b_resid);
- if (error) {
- brelse(bp);
- return error;
- }
- error = uiomove((char *) bp->b_data + blockoff, count, &uio); /* move the data */
- brelse(bp);
- }
- while (error == 0 && uio.uio_resid > 0 && count != 0);
- return error;
-}
-
-/* Write data to a drive
-
- * Return error number
- */
-int
-write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
-{
- int error;
- struct buf *bp;
- struct uio uio;
- struct iovec iov;
- daddr_t blocknum; /* block number */
- int blockoff; /* offset in block */
- int count; /* amount to transfer */
- int blockshift;
-
- if (drive->state == drive_down) /* currently down */
- return 0; /* ignore */
- if (drive->vp == NULL) {
- drive->lasterror = ENODEV;
- return ENODEV; /* not configured yet */
- }
- iov.iov_base = buf;
- iov.iov_len = length;
-
- uio.uio_iov = &iov;
- uio.uio_iovcnt = length;
- uio.uio_offset = offset;
- uio.uio_resid = length;
- uio.uio_segflg = UIO_SYSSPACE;
- uio.uio_rw = UIO_WRITE;
- uio.uio_procp = curproc;
-
- error = 0;
- blockshift = btodb(drive->blocksize) - 1; /* amount to shift block number
- * to get sector number */
- do {
- blocknum = btodb(uio.uio_offset) & ~blockshift; /* get the block number */
- blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
- count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
- uio.uio_resid);
- if (count == drive->blocksize) /* the whole block */
- bp = getblk(drive->vp, blocknum, drive->blocksize, 0, 0); /* just transfer it */
- else /* partial block: */
- error = bread(drive->vp, /* read it first */
- blocknum,
- drive->blocksize,
- NOCRED,
- &bp);
- count = min(count, drive->blocksize - bp->b_resid); /* how much will we transfer now? */
- if (error == 0)
- error = uiomove((char *) bp->b_data + blockoff, /* move the data to the block */
- count,
- &uio);
- if (error) {
- brelse(bp);
- drive->lasterror = error;
- switch (error) {
- case EIO:
- set_drive_state(drive->driveno, drive_down, setstate_force);
- break;
-
- /* XXX Add other possibilities here */
- default:
- }
- return error;
- }
- if (count + blockoff == drive->blocksize)
- /* The transfer goes to the end of the block. There's
- * no need to wait for any more data to arrive. */
- bawrite(bp); /* start the write now */
- else
- bdwrite(bp); /* do a delayed write */
- }
- while (error == 0 && uio.uio_resid > 0 && count != 0);
- if (error)
- drive->lasterror = error;
- return error; /* OK */
-}
-
-/* Wake up on completion */
-void
-drive_io_done(struct buf *bp)
-{
- wakeup((caddr_t) bp); /* Wachet auf! */
- bp->b_flags &= ~B_CALL; /* don't do this again */
-}
-
-/* Check a drive for a vinum header. If found,
- * update the drive information. We come here
- * with a partially populated drive structure
- * which includes the device name.
- *
- * Return information on what we found.
- *
- * This function is called from two places: check_drive,
- * which wants to find out whether the drive is a
- * Vinum drive, and config_drive, which asserts that
- * it is a vinum drive. In the first case, we don't
- * print error messages (verbose==0), in the second
- * we do (verbose==1).
- */
-enum drive_label_info
-read_drive_label(struct drive *drive, int verbose)
-{
- int error;
- int result; /* result of our search */
- struct vinum_hdr *vhdr; /* and as header */
-
- error = init_drive(drive, 0); /* find the drive */
- if (error) /* find the drive */
- return DL_CANT_OPEN; /* not ours */
-
- vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* allocate buffers */
- CHECKALLOC(vhdr, "Can't allocate memory");
-
- error = read_drive(drive, (void *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
- if (vhdr->magic == VINUM_MAGIC) { /* ours! */
- if (drive->label.name[0] /* we have a name for this drive */
- &&(strcmp(drive->label.name, vhdr->label.name))) { /* but it doesn't match the real name */
- drive->lasterror = EINVAL;
- result = DL_WRONG_DRIVE; /* it's the wrong drive */
- } else {
- drive->state = drive_up; /* it's OK by us */
- result = DL_OURS;
- }
- /* We copy the drive anyway so that we have
- * the correct name in the drive info. This
- * may not be the name specified */
- drive->label = vhdr->label; /* put in the label information */
- } else if (vhdr->magic == VINUM_NOMAGIC) /* was ours, but we gave it away */
- result = DL_DELETED_LABEL;
- else
- result = DL_NOT_OURS; /* we could have it, but we don't yet */
- Free(vhdr); /* that's all. */
- return result;
-}
-
-/* Check a drive for a vinum header. If found,
- * read configuration information from the drive and
- * incorporate the data into the configuration.
- *
- * Return
- */
-struct drive *
-check_drive(char *drivename)
-{
- int driveno;
- struct drive *drive;
-
- driveno = find_drive_by_dev(drivename, 1); /* entry doesn't exist, create it */
- drive = &vinum_conf.drive[driveno]; /* and get a pointer */
-
- if (read_drive_label(drive, 0) != DL_OURS) { /* not ours */
- if (drive->lasterror == 0)
- drive->lasterror = ENODEV;
- set_drive_state(drive->driveno, drive_down, setstate_force);
- }
- return drive;
-}
-
-static char *
-sappend(char *txt, char *s)
-{
- while (*s++ = *txt++);
- return s - 1;
-}
-
-/* Kludge: kernel printf doesn't handle quads */
-static char *lltoa (long long l, char *s);
-
-static char *lltoa (long long l, char *s)
-{
- if (l < 0)
- {
- *s++ = '-';
- l = -l;
- }
- if (l > 9)
- {
- s = lltoa (l / 10, s);
- l %= 10;
- }
- *s++ = l + '0';
- return s;
- }
-/* Format the configuration in text form into the buffer
- * at config. Don't go beyond len bytes
- * XXX this stinks. Fix soon. */
-void format_config (char *config, int len)
-{
-#if __FreeBSD__ == 2
- BROKEN_GDB
-#endif
- int i;
- int j;
- char *s = config;
-
- bzero (config, len);
-
-#if 0 /* XXX die, die */
- /* First write the drive configuration */
- for (i = 0; i < vinum_conf.drives_used; i++)
- {
- struct drive *drive;
-
- drive = &vinum_conf.drive [i];
- if (drive->state != drive_unallocated)
- {
- sprintf (s,
- "drive %s state %s device %s\n",
- drive->label.name,
- drive_state (drive->state),
- drive->devicename);
- while (*s)
- s++; /* find the end */
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
- }
- }
- }
-#endif
-
- /* Then the volume configuration */
- for (i = 0; i < vinum_conf.volumes_used; i++)
- {
- struct volume *vol;
-
- vol = &vinum_conf.volume [i];
- if (vol->state != volume_unallocated)
- {
- if (vol->preferred_plex >= 0) /* preferences, */
- sprintf (s,
- "volume %s state %s readpol prefer %s",
- vol->name,
- volume_state (vol->state),
- vinum_conf.plex [vol->preferred_plex].name);
- else /* default round-robin */
- sprintf (s,
- "volume %s state %s",
- vol->name,
- volume_state (vol->state));
- while (*s)
- s++; /* find the end */
-#if 0
- /* Do we need to state the plexes? */
- for (j = 0; j < vol->plexes; j++)
- {
- sprintf (s, " plex %s", vinum_conf.plex [vol->plex [j]].name);
- while (*s)
- s++; /* find the end */
- }
-#endif
- s = sappend ("\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
- }
- }
- }
-
- /* Then the plex configuration */
- for (i = 0; i < vinum_conf.plexes_used; i++)
- {
- struct plex *plex;
-
- plex = &vinum_conf.plex [i];
- if (plex->state != plex_unallocated)
- {
- sprintf (s, "plex name %s state %s org %s ",
- plex->name,
- plex_state (plex->state),
- plex_org (plex->organization) );
- while (*s)
- s++; /* find the end */
- if ((plex->organization == plex_striped)
-#ifdef RAID5
- || (plex->organization == plex_raid5)
-#endif
- )
- {
- sprintf (s, "%db ", (int) plex->stripesize);
- while (*s)
- s++; /* find the end */
- }
- if (plex->volno >= 0) /* we have a volume */
- sprintf (s, "vol %s ", vinum_conf.volume [plex->volno].name);
- while (*s)
- s++; /* find the end */
- for (j = 0; j < plex->subdisks; j++)
- {
- sprintf (s, " sd %s", vinum_conf.sd [plex->sdnos [j]].name);
- }
- s = sappend ("\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
- }
- }
- }
-
- /* And finally the subdisk configuration */
- for (i = 0; i < vinum_conf.subdisks_used; i++)
- {
- struct sd *sd = &vinum_conf.sd [i]; /* XXX */
- if (vinum_conf.sd [i].state != sd_unallocated)
- {
- sprintf (s,
- "sd name %s drive %s plex %s state %s len ",
- sd->name,
- vinum_conf.drive [sd->driveno].label.name,
- vinum_conf.plex [sd->plexno].name,
- sd_state (sd->state) );
- while (*s)
- s++; /* find the end */
- s = lltoa (sd->sectors, s);
- s = sappend ("b driveoffset ", s);
- s = lltoa (sd->driveoffset, s);
- s = sappend ("b plexoffset ", s);
- s = lltoa (sd->plexoffset, s);
- s = sappend ("b\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
- }
- }
- }
- }
-
-/* issue a save config request to the dæmon. The actual work
- * is done in process context by daemon_save_config */
-void
-save_config(void)
-{
- queue_daemon_request(daemonrq_saveconfig, NULL);
-}
-
-/* Write the configuration to all vinum slices. This
- * is performed by the dæmon only */
-void
-daemon_save_config(void)
-{
- int error;
- int written_config; /* set when we first write the config to disk */
- int driveno;
- struct drive *drive; /* point to current drive info */
- struct vinum_hdr *vhdr; /* and as header */
- char *config; /* point to config data */
- int wlabel_on; /* to set writing label on/off */
-
- /* don't save the configuration while we're still working on it */
- if (vinum_conf.flags & VF_CONFIGURING)
- return;
- written_config = 0; /* no config written yet */
- /* Build a volume header */
- vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* get space for the config data */
- CHECKALLOC(vhdr, "Can't allocate config data");
- vhdr->magic = VINUM_MAGIC; /* magic number */
- vhdr->config_length = MAXCONFIG; /* length of following config info */
-
- config = Malloc(MAXCONFIG); /* get space for the config data */
- CHECKALLOC(config, "Can't allocate config data");
-
- format_config(config, MAXCONFIG);
- error = 0; /* no errors yet */
- for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
- drive = &vinum_conf.drive[driveno]; /* point to drive */
- lockdrive(drive); /* don't let it change */
-
- /* First, do some drive consistency checks. Some
- * of these are kludges, others require a process
- * context and couldn't be done before */
- if ((drive->devicename[0] == '\0') /* XXX we keep getting these nameless drives */
- ||(drive->label.name[0] == '\0')) { /* XXX we keep getting these nameless drives */
- unlockdrive(drive);
- printf("Removing incomplete drive, index %d\n", driveno);
- if (drive->vp) /* how can it be open without a name? */
- close_drive(drive);
- free_drive(drive); /* get rid of it */
- break;
- }
- if ((drive->vp == NULL) /* drive not open */
- &&(drive->state > drive_down)) { /* and it thinks it's not down */
- unlockdrive(drive);
- set_drive_state(driveno, drive_down, setstate_force); /* tell it what's what */
- }
- if ((drive->state == drive_down) /* it's down */
- &&(drive->vp != NULL)) { /* but open, */
- unlockdrive(drive);
- close_drive(drive); /* close it */
- } else if (drive->state > drive_down) {
- getmicrotime(&drive->label.last_update); /* time of last update is now */
- bcopy((char *) &drive->label, /* and the label info from the drive structure */
- (char *) &vhdr->label,
- sizeof(vhdr->label));
- if ((drive->state != drive_unallocated)
- && (drive->state != drive_uninit)) {
- wlabel_on = 1; /* enable writing the label */
- error = VOP_IOCTL(drive->vp, /* make the label writeable */
- DIOCWLABEL,
- (caddr_t) & wlabel_on,
- FWRITE,
- NOCRED,
- curproc);
- if (error == 0)
- error = write_drive(drive, (char *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
- if (error == 0)
- error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET); /* first config copy */
- if (error == 0)
- error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET + MAXCONFIG); /* second copy */
- wlabel_on = 0; /* enable writing the label */
- if (error == 0)
- VOP_IOCTL(drive->vp, /* make the label non-writeable again */
- DIOCWLABEL,
- (caddr_t) & wlabel_on,
- FWRITE,
- NOCRED,
- curproc);
- unlockdrive(drive);
- if (error) {
- printf("vinum: Can't write config to %s, error %d\n", drive->devicename, error);
- set_drive_state(drive->driveno, drive_down, setstate_force);
- } else
- written_config = 1; /* we've written it on at least one drive */
- }
- }
- }
- Free(vhdr);
- Free(config);
-}
-
-/* Disk labels are a mess. The correct way to access them
- * is with the DIOC[GSW]DINFO ioctls, but some programs, such
- * as newfs, access the disk directly, so we have to write
- * things there. We do this only on request. If a user
- * request tries to read it directly, we fake up one on the fly.
- */
-
-/* get_volume_label returns a label structure to lp, which
- * is allocated by the caller */
-void
-get_volume_label(struct volume *vol, struct disklabel *lp)
-{
- bzero(lp, sizeof(struct disklabel));
-
- strncpy(lp->d_typename, "vinum", sizeof(lp->d_typename));
- lp->d_type = DTYPE_VINUM;
- strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
- lp->d_rpm = 14400 * vol->plexes; /* to keep them guessing */
- lp->d_interleave = 1;
- lp->d_flags = 0;
-
- /* Fitting unto the vine, a vinum has a single
- * track with all its sectors */
- lp->d_secsize = DEV_BSIZE; /* bytes per sector */
- lp->d_nsectors = vol->size; /* data sectors per track */
- lp->d_ntracks = 1; /* tracks per cylinder */
- lp->d_ncylinders = 1; /* data cylinders per unit */
- lp->d_secpercyl = vol->size; /* data sectors per cylinder */
- lp->d_secperunit = vol->size; /* data sectors per unit */
-
- lp->d_bbsize = BBSIZE;
- lp->d_sbsize = SBSIZE;
-
- lp->d_magic = DISKMAGIC;
- lp->d_magic2 = DISKMAGIC;
-
- /* Set up partitions a, b and c to be identical
- * and the size of the volume. a is UFS, b is
- * swap, c is nothing */
- lp->d_partitions[0].p_size = vol->size;
- lp->d_partitions[0].p_fsize = 1024;
- lp->d_partitions[0].p_fstype = FS_BSDFFS; /* FreeBSD File System :-) */
- lp->d_partitions[0].p_fsize = 1024; /* FS fragment size */
- lp->d_partitions[0].p_frag = 8; /* and fragments per block */
- lp->d_partitions[SWAP_PART].p_size = vol->size;
- lp->d_partitions[SWAP_PART].p_fstype = FS_SWAP; /* swap partition */
- lp->d_partitions[LABEL_PART].p_size = vol->size;
- lp->d_npartitions = LABEL_PART + 1;
- strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
- lp->d_checksum = dkcksum(lp);
-}
-
-/* Write a volume label. This implements the VINUM_LABEL ioctl. */
-int
-write_volume_label(int volno)
-{
- struct disklabel *lp;
- struct buf *bp;
- struct disklabel *dlp;
- struct volume *vol;
- int error;
-
- lp = (struct disklabel *) Malloc((sizeof(struct disklabel) + (DEV_BSIZE - 1)) & (DEV_BSIZE - 1));
- if (lp == 0)
- return ENOMEM;
-
- if ((unsigned) (volno) >= (unsigned) vinum_conf.volumes_used) /* invalid volume */
- return ENOENT;
-
- vol = &VOL[volno]; /* volume in question */
- if (vol->state == volume_unallocated) /* nothing there */
- return ENOENT;
-
- get_volume_label(vol, lp); /* get the label */
-
- /* Now write to disk. This code is derived from the
- * system writedisklabel (), which does silly things
- * like reading the label and refusing to write
- * unless it's already there. */
- bp = geteblk((int) lp->d_secsize); /* get a buffer */
- bp->b_dev = minor(vol->devno) | (CDEV_MAJOR << MAJORDEV_SHIFT); /* our own raw volume */
- bp->b_blkno = LABELSECTOR * ((int) lp->d_secsize / DEV_BSIZE);
- bp->b_bcount = lp->d_secsize;
- bzero(bp->b_data, lp->d_secsize);
- dlp = (struct disklabel *) bp->b_data;
- *dlp = *lp;
- bp->b_flags &= ~B_INVAL;
- bp->b_flags |= B_BUSY | B_WRITE;
- vinumstrategy(bp); /* write it out */
- error = biowait(bp);
- bp->b_flags |= B_INVAL | B_AGE;
- brelse(bp);
- return error;
-}
-
-/* Initialize a subdisk */
-int
-initsd(int sdno)
-{
- return 0;
-}
-
-/* Look at all disks on the system for vinum slices */
-void
-vinum_scandisk(char *drivename[], int drives)
-{
- struct drive *volatile drive;
- volatile int driveno;
- int firstdrive; /* first drive in this list */
- volatile int gooddrives; /* number of usable drives found */
- int firsttime; /* set if we have never configured before */
- int error;
- struct nameidata nd; /* mount point credentials */
- char *config_text; /* read the config info from disk into here */
- char *volatile cptr; /* pointer into config information */
- char *eptr; /* end pointer into config information */
- char *config_line; /* copy the config line to */
- volatile int status;
- struct drive **volatile drivelist;
-#define DRIVENAMELEN 64
-#define DRIVEPARTS 35 /* max partitions per drive, excluding c */
- char partname[DRIVENAMELEN]; /* for creating partition names */
-
- status = 0; /* success indication */
- vinum_conf.flags |= VF_KERNELOP | VF_READING_CONFIG; /* kernel operation: reading config */
-
- gooddrives = 0; /* number of usable drives found */
- firstdrive = vinum_conf.drives_used; /* the first drive */
- firsttime = vinum_conf.drives_used == 0; /* are we a virgin? */
-
-
- /* allocate a drive pointer list */
- drivelist = (struct drive **) Malloc(drives * DRIVEPARTS * sizeof(struct drive *));
- CHECKALLOC(drivelist, "Can't allocate memory");
-
- /* Open all drives and find which was modified most recently */
- for (driveno = 0; driveno < drives; driveno++) {
- char part; /* UNIX partition */
-
- for (part = 'a'; part < 'i'; part++)
- if (part != 'c') { /* don't do the c partition */
- snprintf(partname, /* /dev/sd0a */
- DRIVENAMELEN,
- "%s%c",
- drivename[driveno],
- part);
- drive = check_drive(partname); /* try to open it */
- if (drive->lasterror != 0) /* didn't work, */
- free_drive(drive); /* get rid of it */
- else if (drive->flags & VF_CONFIGURED) /* already read this config, */
- printf("vinum: already read config from %s\n", /* say so */
- drive->label.name);
- else {
- drivelist[gooddrives] = drive; /* keep a pointer to the drive */
- drive->flags &= ~VF_NEWBORN; /* which is no longer newly born */
- gooddrives++;
- }
- }
- }
-
- if (gooddrives == 0) {
- printf("vinum: no drives found\n");
- return;
- }
- /* We now have at least one drive
- * open. Sort them in order of config time
- * and merge the config info with what we
- * have already */
- qsort(drivelist, gooddrives, sizeof(struct drive *), drivecmp);
- config_text = (char *) Malloc(MAXCONFIG * 2); /* allocate buffers */
- CHECKALLOC(config_text, "Can't allocate memory");
- config_line = (char *) Malloc(MAXCONFIGLINE * 2); /* allocate buffers */
- CHECKALLOC(config_line, "Can't allocate memory");
- for (driveno = 0; driveno < gooddrives; driveno++) { /* now include the config */
- drive = drivelist[driveno];
-
- if (firsttime && (driveno == 0)) /* we've never configured before, */
- printf("vinum: reading configuration from %s\n", drive->devicename);
- else
- printf("vinum: updating configuration from %s\n", drive->devicename);
-
- /* Read in both copies of the configuration information */
- error = read_drive(drive, config_text, MAXCONFIG * 2, VINUM_CONFIG_OFFSET);
-
- if (error != 0) {
- printf("vinum: Can't read device %s, error %d\n", drive->devicename, error);
- Free(config_text);
- Free(config_line);
- free_drive(drive); /* give it back */
- status = error;
- }
- /* XXX At this point, check that the two copies are the same, and do something useful if not.
- * In particular, consider which is newer, and what this means for the integrity of the
- * data on the drive */
-
- else {
- /* Parse the configuration, and add it to the global configuration */
- for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */
- volatile int parse_status; /* return value from parse_config */
-
- for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */
- *eptr++ = *cptr++;
- *eptr = '\0'; /* and delimit */
- if (setjmp(command_fail) == 0) { /* come back here on error and continue */
- parse_status = parse_config(config_line, &keyword_set, 1); /* parse the config line */
- if (parse_status < 0) { /* error in config */
- /* This config should have been parsed in user
- * space. If we run into problems here, something
- * serious is afoot. Complain and let the user
- * snarf the config to see what's wrong */
- printf("vinum: Config error on drive %s, aborting integration\n", nd.ni_dirp);
- Free(config_text);
- Free(config_line);
- free_drive(drive); /* give it back */
- status = EINVAL;
- }
- }
- while (*cptr == '\n')
- cptr++; /* skip to next line */
- }
- }
- drive->flags |= VF_CONFIGURED; /* read this drive's configuration */
- }
-
- Free(config_text);
- Free(drivelist);
- vinum_conf.flags &= ~(VF_KERNELOP | VF_READING_CONFIG);
- if (status != 0)
- throw_rude_remark(status, "Couldn't read configuration");
- updateconfig(VF_KERNELOP); /* update from kernel space */
-}
-
-/* Compare the modification dates of the drives, for qsort.
- * Return 1 if a < b, 0 if a == b, 01 if a > b: in other
- * words, sort backwards */
-int
-drivecmp(const void *va, const void *vb)
-{
- struct drive *a = *(struct drive **) va;
- struct drive *b = *(struct drive **) vb;
-
- if ((a->label.last_update.tv_sec == b->label.last_update.tv_sec)
- && (a->label.last_update.tv_usec == b->label.last_update.tv_usec))
- return 0;
- else if ((a->label.last_update.tv_sec > b->label.last_update.tv_sec)
- || ((a->label.last_update.tv_sec == b->label.last_update.tv_sec)
- && (a->label.last_update.tv_usec > b->label.last_update.tv_usec)))
- return -1;
- else
- return 1;
-}
diff --git a/sys/dev/vinum/vinumio.h b/sys/dev/vinum/vinumio.h
deleted file mode 100644
index fe1c09b09606..000000000000
--- a/sys/dev/vinum/vinumio.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumio.h,v 1.14 1999/01/18 05:00:30 grog Exp grog $
- */
-
-#ifdef VINUMDEBUG
-#define MAX_IOCTL_REPLY 4096
-#else
-#define MAX_IOCTL_REPLY 256
-#endif
-
-#define L 'F' /* ID letter of our ioctls */
-/* VINUM_CREATE returns a buffer of this kind */
-struct _ioctl_reply {
- int error;
- char msg[MAX_IOCTL_REPLY];
-};
-
-/* ioctl requests */
-#define BUFSIZE 1024 /* size of buffer, including continuations */
-#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
-#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
-#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
-#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
-#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
-#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
-#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
-#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
-#define VINUM_SAVECONFIG _IOC(0, L, 72, 0) /* release locks, update, write config to disk */
-#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
-#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
-#ifdef VINUMDEBUG
-
-struct debuginfo {
- int changeit;
- int param;
-};
-
-#define VINUM_DEBUG _IOWR(L, 75, struct debuginfo) /* call the debugger from ioctl () */
-#endif
-
-enum objecttype {
- drive_object,
- sd_object,
- plex_object,
- volume_object,
- invalid_object
-};
-
-/* Start an object. Pass two integers:
- * msg [0] index in vinum_conf.<object>
- * msg [1] type of object (see below)
- *
- * Return ioctl_reply
- */
-#define VINUM_SETSTATE _IOC(IOC_IN | IOC_OUT, L, 76, MAX_IOCTL_REPLY) /* start an object */
-
-/* The state to set with VINUM_SETSTATE. Since
- * each object has a different set of states, we
- * need to translate later */
-enum objectstate {
- object_down,
- object_initializing,
- object_up
-};
-
-/* This structure is used for modifying objects
- * (VINUM_SETSTATE, VINUM_REMOVE, VINUM_RESETSTATS, VINUM_ATTACH,
- * VINUM_DETACH, VINUM_REPLACE
- */
-struct vinum_ioctl_msg {
- int index;
- enum objecttype type;
- enum objectstate state; /* state to set (VINUM_SETSTATE) */
- int force; /* do it even if it doesn't make sense */
- int recurse; /* recurse (VINUM_REMOVE) */
- int otherobject; /* superordinate object (attach),
- * replacement object (replace) */
- int rename; /* rename object (attach) */
- int64_t offset; /* offset of subdisk (for attach) */
-};
-
-#define VINUM_RELEASECONFIG _IOC(0, L, 77, 0) /* release locks and write config to disk */
-#define VINUM_STARTCONFIG _IOC(0, L, 78, 0) /* start a configuration operation */
-#define VINUM_MEMINFO _IOR(L, 79, struct meminfo) /* get memory usage summary */
-#define VINUM_MALLOCINFO _IOWR(L, 80, struct mc) /* get specific malloc information [i] */
-#define VINUM_LABEL _IOC(IOC_IN | IOC_OUT, L, 81, MAX_IOCTL_REPLY) /* label a volume */
-#define VINUM_INITSD _IOW(L, 82, int) /* initialize a subdisk */
-#define VINUM_REMOVE _IOC(IOC_IN | IOC_OUT, L, 83, MAX_IOCTL_REPLY) /* remove an object */
-/* 84, 85 going begging */
-#define VINUM_RESETSTATS _IOC(IOC_IN | IOC_OUT, L, 86, MAX_IOCTL_REPLY) /* reset object stats */
-#define VINUM_ATTACH _IOC(IOC_IN | IOC_OUT, L, 87, MAX_IOCTL_REPLY) /* reset object stats */
-#define VINUM_DETACH _IOC(IOC_IN | IOC_OUT, L, 88, MAX_IOCTL_REPLY) /* reset object stats */
-
-struct vinum_rename_msg {
- int index;
- int recurse; /* rename subordinate objects too */
- enum objecttype type;
- char newname[MAXNAME]; /* new name to give to object */
-};
-
-#define VINUM_RENAME _IOC(IOC_IN | IOC_OUT, L, 89, MAX_IOCTL_REPLY) /* reset object stats */
-#define VINUM_REPLACE _IOC(IOC_IN | IOC_OUT, L, 90, MAX_IOCTL_REPLY) /* reset object stats */
-
-#ifdef VINUMDEBUG
-#define VINUM_RQINFO _IOWR(L, 91, struct rqinfo) /* get request info [i] from trace buffer */
-#endif
-
-#define VINUM_DAEMON _IOC(0, L, 92, 0) /* perform the kernel part of Vinum daemon */
-#define VINUM_FINDDAEMON _IOC(0, L, 93, 0) /* check for presence of Vinum daemon */
-#define VINUM_SETDAEMON _IOW(L, 94, int) /* set daemon flags */
-#define VINUM_GETDAEMON _IOR(L, 95, int) /* get daemon flags */
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
deleted file mode 100644
index a2052b87c1d2..000000000000
--- a/sys/dev/vinum/vinumioctl.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/* XXX replace all the checks on object validity with
- * calls to valid<object> */
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumioctl.c,v 1.7 1999/01/18 03:36:17 grog Exp grog $
- */
-
-#define STATIC /* nothing while we're testing XXX */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <sys/sysproto.h> /* for sync(2) */
-#ifdef VINUMDEBUG
-#include <sys/reboot.h>
-#include <dev/vinum/request.h>
-#endif
-
-jmp_buf command_fail; /* return on a failed command */
-
-/* Why aren't these declared anywhere? XXX */
-int setjmp(jmp_buf);
-void longjmp(jmp_buf, int);
-
-int vinum_inactive(void);
-void free_vinum(int);
-void attachobject(struct vinum_ioctl_msg *);
-void detachobject(struct vinum_ioctl_msg *);
-void renameobject(struct vinum_rename_msg *);
-void replaceobject(struct vinum_ioctl_msg *);
-
-/* ioctl routine */
-int
-vinumioctl(dev_t dev,
- u_long cmd,
- caddr_t data,
- int flag,
- struct proc *p)
-{
- unsigned int objno;
- int error = 0;
- struct volume *vol;
- unsigned int index; /* for transferring config info */
- unsigned int sdno; /* for transferring config info */
- int fe; /* free list element number */
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* struct to return */
-
- struct devcode *device = (struct devcode *) &dev;
-
- /* First, decide what we're looking at */
- switch (device->type) {
- case VINUM_SUPERDEV_TYPE:
- ioctl_reply = (struct _ioctl_reply *) data; /* save the address to reply to */
- error = setjmp(command_fail); /* come back here on error */
- if (error) /* bombed out */
- return 0; /* the reply will contain meaningful info */
- switch (cmd) {
-#ifdef VINUMDEBUG
- case VINUM_DEBUG:
- if (((struct debuginfo *) data)->changeit) /* change debug settings */
- debug = (((struct debuginfo *) data)->param);
- else {
- if (debug & DEBUG_REMOTEGDB)
- boothowto |= RB_GDB; /* serial debug line */
- else
- boothowto &= ~RB_GDB; /* local ddb */
- Debugger("vinum debug");
- }
- ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
- ioctl_reply->error = 0;
- return 0;
-#endif
-
- case VINUM_CREATE: /* create a vinum object */
- error = lock_config(); /* get the config for us alone */
- if (error) /* can't do it, */
- return error; /* give up */
- error = setjmp(command_fail); /* come back here on error */
- if (error == 0) { /* first time, */
- parse_user_config((char *) data, &keyword_set); /* update the config */
- ioctl_reply->error = 0; /* no error if we make it here */
- } else if (ioctl_reply->error == 0) { /* longjmp, but no error status */
- ioctl_reply->error = EINVAL; /* note that something's up */
- ioctl_reply->msg[0] = '\0'; /* no message? */
- }
- unlock_config();
- return 0; /* must be 0 to return the real error info */
-
- case VINUM_GETCONFIG: /* get the configuration information */
- bcopy(&vinum_conf, data, sizeof(vinum_conf));
- return 0;
-
- /* start configuring the subsystem */
- case VINUM_STARTCONFIG:
- return start_config(); /* just lock it */
-
- /* Move the individual parts of the config to user space.
-
- * Specify the index of the object in the first word of data,
- * and return the object there
- */
- case VINUM_DRIVECONFIG:
- index = *(int *) data; /* get the index */
- if (index >= (unsigned) vinum_conf.drives_used) /* can't do it */
- return EFAULT; /* bang */
- bcopy(&DRIVE[index], data, sizeof(struct drive)); /* copy the config item out */
- return 0;
-
- case VINUM_SDCONFIG:
- index = *(int *) data; /* get the index */
- if (index >= (unsigned) vinum_conf.subdisks_used) /* can't do it */
- return EFAULT; /* bang */
- bcopy(&SD[index], data, sizeof(struct sd)); /* copy the config item out */
- return 0;
-
- case VINUM_PLEXCONFIG:
- index = *(int *) data; /* get the index */
- if (index >= (unsigned) vinum_conf.plexes_used) /* can't do it */
- return EFAULT; /* bang */
- bcopy(&PLEX[index], data, sizeof(struct plex)); /* copy the config item out */
- return 0;
-
- case VINUM_VOLCONFIG:
- index = *(int *) data; /* get the index */
- if (index >= (unsigned) vinum_conf.volumes_used) /* can't do it */
- return EFAULT; /* bang */
- bcopy(&VOL[index], data, sizeof(struct volume)); /* copy the config item out */
- return 0;
-
- case VINUM_PLEXSDCONFIG:
- index = *(int *) data; /* get the plex index */
- sdno = ((int *) data)[1]; /* and the sd index */
- if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
- ||(sdno >= PLEX[index].subdisks)) /* or it doesn't have this many subdisks */
- return EFAULT; /* bang */
- bcopy(&SD[PLEX[index].sdnos[sdno]], /* copy the config item out */
- data,
- sizeof(struct sd));
- return 0;
-
- case VINUM_SAVECONFIG:
- if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
- finish_config(1); /* finish the configuration and update it */
- save_config(); /* save configuration to disk */
- } else
- error = EINVAL; /* queue up for this one, please */
- return error;
-
- case VINUM_RELEASECONFIG: /* release the config */
- if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
- finish_config(0); /* finish the configuration, don't change it */
- save_config(); /* save configuration to disk */
- } else
- error = EINVAL; /* release what config? */
- return error;
-
- case VINUM_INIT:
- ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
- ioctl_reply->error = 0;
- return 0;
-
- case VINUM_RESETCONFIG:
- if (vinum_inactive() && (vinum_conf.opencount < 2)) { /* if we're not active */
- /* Note the open count. We may be called from v, so we'll be open.
- * Keep the count so we don't underflow */
- int oc = vinum_conf.opencount;
- free_vinum(1); /* clean up everything */
- printf("vinum: CONFIGURATION OBLITERATED\n");
- vinum_conf.opencount = oc;
- ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
- ioctl_reply->error = 0;
- return 0;
- }
- return EBUSY;
-
- case VINUM_SETSTATE:
- setstate((struct vinum_ioctl_msg *) data); /* set an object state */
- return 0;
-
-#ifdef VINUMDEBUG
- case VINUM_MEMINFO:
- vinum_meminfo(data);
- return 0;
-
- case VINUM_MALLOCINFO:
- return vinum_mallocinfo(data);
-
- case VINUM_RQINFO:
- return vinum_rqinfo(data);
-#endif
-
- case VINUM_LABEL: /* label a volume */
- ioctl_reply->error = write_volume_label(*(int *) data); /* index of the volume to label */
- ioctl_reply->msg[0] = '\0'; /* no message */
- return 0;
-
- case VINUM_REMOVE:
- remove((struct vinum_ioctl_msg *) data); /* remove an object */
- return 0;
-
- case VINUM_GETFREELIST: /* get a drive free list element */
- index = *(int *) data; /* get the drive index */
- fe = ((int *) data)[1]; /* and the free list element */
- if ((index >= (unsigned) vinum_conf.drives_used) /* plex doesn't exist */
- ||(DRIVE[index].state == drive_unallocated))
- return ENODEV;
- if (fe >= DRIVE[index].freelist_entries) /* no such entry */
- return ENOENT;
- bcopy(&DRIVE[index].freelist[fe],
- data,
- sizeof(struct drive_freelist));
- return 0;
-
- case VINUM_RESETSTATS:
- resetstats((struct vinum_ioctl_msg *) data); /* reset object stats */
- return 0;
-
- /* attach an object to a superordinate object */
- case VINUM_ATTACH:
- attachobject((struct vinum_ioctl_msg *) data);
- return 0;
-
- /* detach an object from a superordinate object */
- case VINUM_DETACH:
- detachobject((struct vinum_ioctl_msg *) data);
- return 0;
-
- /* rename an object */
- case VINUM_RENAME:
- renameobject((struct vinum_rename_msg *) data);
- return 0;
-
- /* replace an object */
- case VINUM_REPLACE:
- replaceobject((struct vinum_ioctl_msg *) data);
- return 0;
-
- case VINUM_DAEMON:
- vinum_daemon(); /* perform the daemon */
- return 0;
-
- case VINUM_FINDDAEMON: /* check for presence of daemon */
- return vinum_finddaemon();
- return 0;
-
- case VINUM_SETDAEMON: /* set daemon flags */
- return vinum_setdaemonopts(*(int *) data);
-
- case VINUM_GETDAEMON: /* get daemon flags */
- *(int *) data = daemon_options;
- return 0;
-
- default:
- /* FALLTHROUGH */
- }
-
- default:
- printf("vinumioctl: invalid ioctl from process %d (%s): %lx\n",
- curproc->p_pid,
- curproc->p_comm,
- cmd); /* XXX */
- return EINVAL;
-
- case VINUM_DRIVE_TYPE:
- case VINUM_PLEX_TYPE:
- return EAGAIN; /* try again next week */
-
- case VINUM_SD_TYPE:
- objno = Sdno(dev);
-
- switch (cmd) {
- case VINUM_INITSD: /* initialize subdisk */
- return initsd(objno);
-
- default:
- return EINVAL;
- }
- break;
-
- case VINUM_VOLUME_TYPE:
- objno = Volno(dev);
-
- if ((unsigned) objno >= (unsigned) vinum_conf.volumes_used) /* not a valid volume */
- return ENXIO;
- vol = &VOL[objno];
- if (vol->state != volume_up) /* not up, */
- return EIO; /* I/O error */
-
- switch (cmd) {
- case DIOCGDINFO: /* get disk label */
- get_volume_label(vol, (struct disklabel *) data);
- break;
-
- /* Care! DIOCGPART returns *pointers* to
- * the caller, so we need to store this crap as well.
- * And yes, we need it. */
- case DIOCGPART: /* get partition information */
- get_volume_label(vol, &vol->label);
- ((struct partinfo *) data)->disklab = &vol->label;
- ((struct partinfo *) data)->part = &vol->label.d_partitions[0];
- break;
-
- /* We don't have this stuff on hardware,
- * so just pretend to do it so that
- * utilities don't get upset. */
- case DIOCWDINFO: /* write partition info */
- case DIOCSDINFO: /* set partition info */
- return 0; /* not a titty */
-
- case DIOCWLABEL: /* set or reset label writeable */
- if ((flag & FWRITE) == 0) /* not writeable? */
- return EACCES; /* no, die */
- if (*(int *) data != 0) /* set it? */
- vol->flags |= VF_WLABEL; /* yes */
- else
- vol->flags &= ~VF_WLABEL; /* no, reset */
- break;
-
- default:
- return ENOTTY; /* not my kind of ioctl */
- }
- break;
- }
- return 0; /* XXX */
-}
-
-/* The following four functions check the supplied
- * object index and return a pointer to the object
- * if it exists. Otherwise they longjump out via
- * throw_rude_remark */
-struct drive *
-validdrive(int driveno, struct _ioctl_reply *reply)
-{
- if ((driveno < vinum_conf.drives_used)
- && (DRIVE[driveno].state != drive_unallocated))
- return &DRIVE[driveno];
- strcpy(reply->msg, "No such drive");
- reply->error = ENOENT;
- return NULL;
-}
-
-struct sd *
-validsd(int sdno, struct _ioctl_reply *reply)
-{
- if ((sdno < vinum_conf.subdisks_used)
- && (SD[sdno].state != sd_unallocated))
- return &SD[sdno];
- strcpy(reply->msg, "No such subdisk");
- reply->error = ENOENT;
- return NULL;
-}
-
-struct plex *
-validplex(int plexno, struct _ioctl_reply *reply)
-{
- if ((plexno < vinum_conf.plexes_used)
- && (PLEX[plexno].state != plex_unallocated))
- return &PLEX[plexno];
- strcpy(reply->msg, "No such plex");
- reply->error = ENOENT;
- return NULL;
-}
-
-struct volume *
-validvol(int volno, struct _ioctl_reply *reply)
-{
- if ((volno < vinum_conf.volumes_used)
- && (VOL[volno].state != volume_unallocated))
- return &VOL[volno];
- strcpy(reply->msg, "No such volume");
- reply->error = ENOENT;
- return NULL;
-}
-
-/* reset an object's stats */
-void
-resetstats(struct vinum_ioctl_msg *msg)
-{
- struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
-
- switch (msg->type) {
- case drive_object:
- if (msg->index < vinum_conf.drives_used) {
- struct drive *drive = &DRIVE[msg->index];
- if (drive->state != drive_unallocated) {
- drive->reads = 0; /* number of reads on this drive */
- drive->writes = 0; /* number of writes on this drive */
- drive->bytes_read = 0; /* number of bytes read */
- drive->bytes_written = 0; /* number of bytes written */
- reply->error = 0;
- return;
- }
- reply->error = EINVAL;
- return;
- }
- case sd_object:
- if (msg->index < vinum_conf.subdisks_used) {
- struct sd *sd = &SD[msg->index];
- if (sd->state != sd_unallocated) {
- sd->reads = 0; /* number of reads on this subdisk */
- sd->writes = 0; /* number of writes on this subdisk */
- sd->bytes_read = 0; /* number of bytes read */
- sd->bytes_written = 0; /* number of bytes written */
- reply->error = 0;
- return;
- }
- reply->error = EINVAL;
- return;
- }
- break;
-
- case plex_object:
- if (msg->index < vinum_conf.plexes_used) {
- struct plex *plex = &PLEX[msg->index];
- if (plex->state != plex_unallocated) {
- plex->reads = 0;
- plex->writes = 0; /* number of writes on this plex */
- plex->bytes_read = 0; /* number of bytes read */
- plex->bytes_written = 0; /* number of bytes written */
- plex->multiblock = 0; /* requests that needed more than one block */
- plex->multistripe = 0; /* requests that needed more than one stripe */
- reply->error = 0;
- return;
- }
- reply->error = EINVAL;
- return;
- }
- break;
-
- case volume_object:
- if (msg->index < vinum_conf.volumes_used) {
- struct volume *vol = &VOL[msg->index];
- if (vol->state != volume_unallocated) {
- vol->bytes_read = 0; /* number of bytes read */
- vol->bytes_written = 0; /* number of bytes written */
- vol->reads = 0; /* number of reads on this volume */
- vol->writes = 0; /* number of writes on this volume */
- vol->recovered_reads = 0; /* reads recovered from another plex */
- reply->error = 0;
- return;
- }
- reply->error = EINVAL;
- return;
- }
- case invalid_object: /* can't get this */
- reply->error = EINVAL;
- return;
- }
-}
-
-/* attach an object to a superior object */
-void
-attachobject(struct vinum_ioctl_msg *msg)
-{
- struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
- int sdno;
- struct sd *sd;
- struct plex *plex;
- struct volume *vol;
-
- switch (msg->type) {
- case drive_object: /* you can't attach a drive to anything */
- case volume_object: /* nor a volume */
- case invalid_object: /* "this can't happen" */
- reply->error = EINVAL;
- reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
- return;
-
- case sd_object:
- sd = validsd(msg->index, reply);
- if (sd == NULL) /* not a valid subdisk */
- return;
- plex = validplex(msg->otherobject, reply);
- if (plex) {
- if (sd->plexno >= 0) { /* already belong to a plex */
- reply->error = EBUSY; /* no message, the user should check */
- reply->msg[0] = '\0';
- return;
- }
- sd->plexoffset = msg->offset; /* this is where we want it */
- set_sd_state(sd->sdno, sd_stale, setstate_force); /* make sure it's stale */
- give_sd_to_plex(plex->plexno, sd->sdno); /* and give it to the plex */
- update_sd_config(sd->sdno, 0);
- save_config();
- reply->error = 0;
- }
- if (sd->state == sd_reviving)
- reply->error = EAGAIN; /* need to revive it */
- else
- reply->error = 0;
- break;
-
- case plex_object:
- plex = validplex(msg->index, reply); /* get plex */
- if (plex == NULL)
- return;
- if (plex->organization != plex_concat) { /* can't attach to striped and raid-5 */
- reply->error = EINVAL; /* no message, the user should check */
- reply->msg[0] = '\0';
- return;
- }
- vol = validvol(msg->otherobject, reply); /* and volume information */
- if (vol) {
- if ((vol->plexes == MAXPLEX) /* we have too many already */
- ||(plex->volno >= 0)) { /* or the plex has an owner */
- reply->error = EINVAL; /* no message, the user should check */
- reply->msg[0] = '\0';
- return;
- }
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]];
-
- if (sd->state > sd_down) /* real subdisk, vaguely accessible */
- set_sd_state(plex->sdnos[sdno], sd_stale, setstate_force); /* make it stale */
- }
- set_plex_state(plex->plexno, plex_up, setstate_none); /* update plex state */
- give_plex_to_volume(msg->otherobject, msg->index); /* and give it to the volume */
- update_plex_config(plex->plexno, 0);
- save_config();
- }
- }
-}
-
-/* detach an object from a superior object */
-void
-detachobject(struct vinum_ioctl_msg *msg)
-{
- struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
- struct sd *sd;
- struct plex *plex;
- struct volume *vol;
- int sdno;
- int plexno;
-
- switch (msg->type) {
- case drive_object: /* you can't detach a drive from anything */
- case volume_object: /* nor a volume */
- case invalid_object: /* "this can't happen" */
- reply->error = EINVAL;
- reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
- return;
-
- case sd_object:
- sd = validsd(msg->index, reply);
- if (sd == NULL)
- return;
- if (sd->plexno < 0) { /* doesn't belong to a plex */
- reply->error = ENOENT;
- strcpy(reply->msg, "Subdisk is not attached");
- return;
- } else { /* valid plex number */
- plex = &PLEX[sd->plexno];
- if ((!msg->force) /* don't force things */
- &&((plex->state == plex_up) /* and the plex is up */
- ||((plex->state == plex_flaky) && sd->state == sd_up))) { /* or flaky with this sd up */
- reply->error = EBUSY; /* we need this sd */
- reply->msg[0] = '\0';
- return;
- }
- sd->plexno = -1; /* anonymous sd */
- if (plex->subdisks == 1) { /* this was the only subdisk */
- Free(plex->sdnos); /* free the subdisk array */
- plex->sdnos = NULL; /* and note the fact */
- plex->subdisks_allocated = 0; /* no subdisk space */
- } else {
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- if (plex->sdnos[sdno] == msg->index) /* found our subdisk */
- break;
- }
- if (sdno < (plex->subdisks - 1)) /* not the last one, compact */
- bcopy(&plex->sdnos[sdno + 1],
- &plex->sdnos[sdno],
- (plex->subdisks - 1 - sdno) * sizeof(int));
- }
- plex->subdisks--;
- if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* this subdisk is named after the plex */
- bcopy(sd->name,
- &sd->name[3],
- min(strlen(sd->name), MAXSDNAME - 3));
- bcopy("ex-", sd->name, 3);
- sd->name[MAXSDNAME - 1] = '\0';
- }
- update_plex_config(plex->plexno, 0);
- if ((plex->organization == plex_striped) /* we've just mutilated our plex, */
- )
- set_plex_state(plex->plexno,
- plex_down,
- setstate_force | setstate_configuring);
- update_sd_config(sd->sdno, 0);
- save_config();
- reply->error = 0;
- }
- return;
-
- case plex_object:
- plex = validplex(msg->index, reply); /* get plex */
- if (plex == NULL)
- return;
- if (plex->volno >= 0) {
- int volno = plex->volno;
-
- vol = &VOL[volno];
- if ((!msg->force) /* don't force things */
- &&((vol->state == volume_up) /* and the volume is up */
- &&(vol->plexes == 1))) { /* and this is the last plex */
- /* XXX As elsewhere, check whether we will lose
- * mapping by removing this plex */
- reply->error = EBUSY; /* we need this plex */
- reply->msg[0] = '\0';
- return;
- }
- plex->volno = -1; /* anonymous plex */
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- if (vol->plex[plexno] == msg->index) /* found our plex */
- break;
- }
- if (plexno < (vol->plexes - 1)) /* not the last one, compact */
- bcopy(&vol[plexno + 1], &vol[plexno], (vol->plexes - 1 - plexno) * sizeof(int));
- vol->plexes--;
- if (!bcmp(vol->name, plex->name, strlen(vol->name))) { /* this plex is named after the volume */
- /* First, check if the subdisks are the same */
- if (msg->recurse) {
- int sdno;
-
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- struct sd *sd = &SD[plex->sdnos[sdno]];
-
- if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* subdisk is named after the plex */
- bcopy(sd->name, &sd->name[3], min(strlen(sd->name), MAXSDNAME - 3));
- bcopy("ex-", sd->name, 3);
- sd->name[MAXSDNAME - 1] = '\0';
- }
- }
- }
- bcopy(plex->name, &plex->name[3], min(strlen(plex->name), MAXPLEXNAME - 3));
- bcopy("ex-", plex->name, 3);
- plex->name[MAXPLEXNAME - 1] = '\0';
- }
- update_plex_config(plex->plexno, 0);
- update_volume_config(volno, 0);
- save_config();
- reply->error = 0;
- } else {
- reply->error = ENOENT;
- strcpy(reply->msg, "Plex is not attached");
- }
- }
-}
-
-void
-renameobject(struct vinum_rename_msg *msg)
-{
- struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
- struct drive *drive;
- struct sd *sd;
- struct plex *plex;
- struct volume *vol;
-
- switch (msg->type) {
- case drive_object: /* you can't attach a drive to anything */
- if (find_drive(msg->newname, 0) >= 0) { /* we have that name already, */
- reply->error = EEXIST;
- reply->msg[0] = '\0';
- return;
- }
- drive = validdrive(msg->index, reply);
- if (drive) {
- bcopy(msg->newname, drive->label.name, MAXDRIVENAME);
- save_config();
- reply->error = 0;
- }
- return;
-
- case sd_object: /* you can't attach a subdisk to anything */
- if (find_subdisk(msg->newname, 0) >= 0) { /* we have that name already, */
- reply->error = EEXIST;
- reply->msg[0] = '\0';
- return;
- }
- sd = validsd(msg->index, reply);
- if (sd) {
- bcopy(msg->newname, sd->name, MAXSDNAME);
- update_sd_config(sd->sdno, 0);
- save_config();
- reply->error = 0;
- }
- return;
-
- case plex_object: /* you can't attach a plex to anything */
- if (find_plex(msg->newname, 0) >= 0) { /* we have that name already, */
- reply->error = EEXIST;
- reply->msg[0] = '\0';
- return;
- }
- plex = validplex(msg->index, reply);
- if (plex) {
- bcopy(msg->newname, plex->name, MAXPLEXNAME);
- update_plex_config(plex->plexno, 0);
- save_config();
- reply->error = 0;
- }
- return;
-
- case volume_object: /* you can't attach a volume to anything */
- if (find_volume(msg->newname, 0) >= 0) { /* we have that name already, */
- reply->error = EEXIST;
- reply->msg[0] = '\0';
- return;
- }
- vol = validvol(msg->index, reply);
- if (vol) {
- bcopy(msg->newname, vol->name, MAXVOLNAME);
- update_volume_config(msg->index, 0);
- save_config();
- reply->error = 0;
- }
- return;
-
- case invalid_object:
- reply->error = EINVAL;
- reply->msg[0] = '\0';
- }
-}
-
-/* Replace one object with another */
-void
-replaceobject(struct vinum_ioctl_msg *msg)
-{
- struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
-
- reply->error = ENODEV; /* until I know how to do this */
- strcpy(reply->msg, "replace not implemented yet");
-/* save_config (); */
-}
diff --git a/sys/dev/vinum/vinumkw.h b/sys/dev/vinum/vinumkw.h
deleted file mode 100644
index 25dbced2fc28..000000000000
--- a/sys/dev/vinum/vinumkw.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumkw.h,v 1.11 1999/01/18 03:32:10 grog Exp grog $
- */
-
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-
-/* Command keywords that vinum knows. These include both user-level
- * and kernel-level stuff */
-
-/* Our complete vocabulary. The names of the commands are
- * the same as the identifier without the kw_ at the beginning
- * (i.e. kw_create defines the "create" keyword). Preprocessor
- * magic in parser.c does the rest. */
-enum keyword {
- kw_create,
- kw_modify,
- kw_list,
- kw_l = kw_list,
- kw_ld, /* list drive */
- kw_ls, /* list subdisk */
- kw_lp, /* list plex */
- kw_lv, /* list volume */
- kw_set,
- kw_rm,
- kw_start,
- kw_stop,
- kw_makedev, /* make /dev/vinum devices */
- kw_setdaemon, /* set daemon flags */
- kw_getdaemon, /* set daemon flags */
- kw_help,
- kw_drive,
- kw_sd,
- kw_subdisk = kw_sd,
- kw_plex,
- kw_volume,
- kw_vol = kw_volume,
- kw_read,
- kw_readpol,
- kw_org,
- kw_name,
- kw_concat,
- kw_striped,
- kw_raid5,
- kw_driveoffset,
- kw_plexoffset,
- kw_len,
- kw_length = kw_len,
- kw_state,
- kw_setupstate,
- kw_d, /* flag names */
- kw_f,
- kw_r,
- kw_s,
- kw_v,
- kw_round, /* round robin */
- kw_prefer, /* prefer plex */
- kw_device,
- kw_init,
- kw_label,
- kw_resetconfig,
- kw_writethrough,
- kw_writeback,
- kw_raw,
- kw_resetstats,
- kw_attach,
- kw_detach,
- kw_rename,
- kw_printconfig,
- kw_replace,
- kw_detached,
-#ifdef VINUMDEBUG
- kw_debug, /* go into debugger */
-#endif
- kw_info,
- kw_quit,
- kw_invalid_keyword = -1
-};
-
-struct _keywords {
- char *name;
- enum keyword keyword;
-};
-
-struct keywordset {
- int size;
- struct _keywords *k;
-};
-
-extern struct _keywords keywords[];
-extern struct _keywords flag_keywords[];
-
-extern struct keywordset keyword_set;
-extern struct keywordset flag_set;
diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c
deleted file mode 100644
index b367dc57a50f..000000000000
--- a/sys/dev/vinum/vinumlock.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumlock.c,v 1.8 1999/01/14 02:52:13 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-
-/* Lock routines. Currently, we lock either an individual volume
- * or the global configuration. I don't think tsleep and
- * wakeup are SMP safe. FIXME XXX */
-
-/* Lock a drive, wait if it's in use */
-int
-lockdrive(struct drive *drive)
-{
- int error;
-
- /* XXX get rid of drive->flags |= VF_LOCKING; */
- while ((drive->flags & VF_LOCKED) != 0) {
- /* There are problems sleeping on a unique identifier,
- * since the drive structure can move, and the unlock
- * function can be called after killing the drive.
- * Solve this by waiting on this function; the number
- * of conflicts is negligible */
- if ((error = tsleep(&lockdrive,
- PRIBIO | PCATCH,
- "vindrv",
- 0)) != 0)
- return error;
- }
- drive->flags |= VF_LOCKED;
- drive->pid = curproc->p_pid; /* it's a panic error if curproc is null */
- return 0;
-}
-
-/* Unlock a drive and let the next one at it */
-void
-unlockdrive(struct drive *drive)
-{
- drive->flags &= ~VF_LOCKED;
- /* we don't reset pid: it's of hysterical interest */
- wakeup(&lockdrive);
-}
-
-/* Lock a volume, wait if it's in use */
-int
-lockvol(struct volume *vol)
-{
- int error;
-
- while ((vol->flags & VF_LOCKED) != 0) {
- vol->flags |= VF_LOCKING;
- /* It would seem to make more sense to sleep on
- * the address 'vol'. Unfortuntaly we can't
- * guarantee that this address won't change due to
- * table expansion. The address we choose won't change. */
- if ((error = tsleep(&vinum_conf.volume + vol->devno,
- PRIBIO | PCATCH,
- "volock",
- 0)) != 0)
- return error;
- }
- vol->flags |= VF_LOCKED;
- return 0;
-}
-
-/* Unlock a volume and let the next one at it */
-void
-unlockvol(struct volume *vol)
-{
- vol->flags &= ~VF_LOCKED;
- if ((vol->flags & VF_LOCKING) != 0) {
- vol->flags &= ~VF_LOCKING;
- wakeup(&vinum_conf.volume + vol->devno);
- }
-}
-
-/* Lock a plex, wait if it's in use */
-int
-lockplex(struct plex *plex)
-{
- int error;
-
- while ((plex->flags & VF_LOCKED) != 0) {
- plex->flags |= VF_LOCKING;
- /* It would seem to make more sense to sleep on
- * the address 'plex'. Unfortunately we can't
- * guarantee that this address won't change due to
- * table expansion. The address we choose won't change. */
- if ((error = tsleep(&vinum_conf.plex + plex->sdnos[0],
- PRIBIO | PCATCH,
- "plexlk",
- 0)) != 0)
- return error;
- }
- plex->flags |= VF_LOCKED;
- return 0;
-}
-
-/* Unlock a plex and let the next one at it */
-void
-unlockplex(struct plex *plex)
-{
- plex->flags &= ~VF_LOCKED;
- if ((plex->flags & VF_LOCKING) != 0) {
- plex->flags &= ~VF_LOCKING;
- wakeup(&vinum_conf.plex + plex->plexno);
- }
-}
-
-
-/* Get a lock for the global config, wait if it's not available */
-int
-lock_config(void)
-{
- int error;
-
- while ((vinum_conf.flags & VF_LOCKED) != 0) {
- vinum_conf.flags |= VF_LOCKING;
- if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
- return error;
- }
- vinum_conf.flags |= VF_LOCKED;
- return 0;
-}
-
-/* Unlock and wake up any waiters */
-void
-unlock_config(void)
-{
- vinum_conf.flags &= ~VF_LOCKED;
- if ((vinum_conf.flags & VF_LOCKING) != 0) {
- vinum_conf.flags &= ~VF_LOCKING;
- wakeup(&vinum_conf);
- }
-}
diff --git a/sys/dev/vinum/vinummemory.c b/sys/dev/vinum/vinummemory.c
deleted file mode 100644
index c06bd9abd4db..000000000000
--- a/sys/dev/vinum/vinummemory.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinummemory.c,v 1.19 1998/12/30 06:22:26 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-
-extern jmp_buf command_fail; /* return on a failed command */
-
-#ifdef VINUMDEBUG
-#include <dev/vinum/request.h>
-extern struct rqinfo rqinfo[];
-extern struct rqinfo *rqip;
-#endif
-
-/* Why aren't these declared anywhere? XXX */
-int setjmp(jmp_buf);
-void longjmp(jmp_buf, int);
-
-void freedatabuf(struct mc *me);
-caddr_t allocdatabuf(struct mc *me);
-
-void
-expand_table(void **table, int oldsize, int newsize)
-{
- if (newsize > oldsize) {
- int *temp;
-
- temp = (int *) Malloc(newsize); /* allocate a new table */
- CHECKALLOC(temp, "vinum: Can't expand table\n");
- if (*table != NULL) { /* already something there, */
- bcopy((char *) *table, (char *) temp, oldsize); /* copy it to the old table */
- Free(*table);
- }
- *table = temp;
- }
-}
-
-#if VINUMDEBUG /* XXX debug */
-#define MALLOCENTRIES 16384
-int malloccount = 0;
-int highwater = 0; /* highest index ever allocated */
-static struct mc malloced[MALLOCENTRIES];
-
-static total_malloced;
-
-caddr_t
-MMalloc(int size, char *file, int line)
-{
- caddr_t result;
- int i;
- static int seq = 0;
- int s;
- struct mc me; /* information to pass to allocdatabuf */
-
- if (malloccount >= MALLOCENTRIES) { /* too many */
- printf("vinum: can't allocate table space to trace memory allocation");
- return 0; /* can't continue */
- }
- result = malloc(size, M_DEVBUF, M_WAITOK); /* use malloc for smaller and irregular stuff */
- if (result == NULL)
- printf("vinum: can't allocate %d bytes from %s:%d\n", size, file, line);
- else {
- me.flags = 0; /* allocation via malloc */
- s = splhigh();
- for (i = 0; i < malloccount; i++) {
- if (((result + size) > malloced[i].address)
- && (result < malloced[i].address + malloced[i].size)) /* overlap */
- Debugger("Malloc overlap");
- }
- if (result) {
- char *f = rindex(file, '/'); /* chop off dirname if present */
-
- if (f == NULL)
- f = file;
- else
- f++; /* skip the / */
- i = malloccount++;
- total_malloced += size;
- malloced[i].address = result;
- malloced[i].size = size;
- malloced[i].line = line;
- malloced[i].seq = seq++;
- malloced[i].flags = me.flags;
- malloced[i].databuf = me.databuf; /* only used with kva alloc */
- bcopy(f, malloced[i].file, min(strlen(f) + 1, 16));
- }
- if (malloccount > highwater)
- highwater = malloccount;
- splx(s);
- }
- return result;
-}
-
-void
-FFree(void *mem, char *file, int line)
-{
- int i;
- int s;
-
- s = splhigh();
- for (i = 0; i < malloccount; i++) {
- if ((caddr_t) mem == malloced[i].address) { /* found it */
- bzero(mem, malloced[i].size); /* XXX */
- free(mem, M_DEVBUF);
- malloccount--;
- total_malloced -= malloced[i].size;
- if (i < malloccount) /* more coming after */
- bcopy(&malloced[i + 1], &malloced[i], (malloccount - i) * sizeof(struct mc));
- splx(s);
- return;
- }
- }
- splx(s);
- printf("Freeing unallocated data at 0x%08x from %s, line %d\n", (int) mem, file, line);
- Debugger("Free");
-}
-
-void
-vinum_meminfo(caddr_t data)
-{
- struct meminfo *m = (struct meminfo *) data;
-
- m->mallocs = malloccount;
- m->total_malloced = total_malloced;
- m->malloced = malloced;
- m->highwater = highwater;
-}
-
-int
-vinum_mallocinfo(caddr_t data)
-{
- struct mc *m = (struct mc *) data;
- unsigned int ent = *(int *) data; /* 1st word is index */
-
- if (ent >= malloccount)
- return ENOENT;
- m->address = malloced[ent].address;
- m->size = malloced[ent].size;
- m->line = malloced[ent].line;
- m->seq = malloced[ent].seq;
- bcopy(malloced[ent].file, m->file, 16);
- return 0;
-}
-
-/* return the nth request trace buffer entry. This
- * is indexed back from the current entry (which
- * has index 0) */
-int
-vinum_rqinfo(caddr_t data)
-{
- struct rqinfo *rq = (struct rqinfo *) data;
- int ent = *(int *) data; /* 1st word is index */
- int lastent = rqip - rqinfo; /* entry number of current entry */
-
- if (ent >= RQINFO_SIZE) /* out of the table */
- return ENOENT;
- if ((ent = lastent - ent - 1) < 0)
- ent += RQINFO_SIZE; /* roll over backwards */
- bcopy(&rqinfo[ent], rq, sizeof(struct rqinfo));
- return 0;
-}
-#endif
diff --git a/sys/dev/vinum/vinumparser.c b/sys/dev/vinum/vinumparser.c
deleted file mode 100644
index 7812f64bbd8b..000000000000
--- a/sys/dev/vinum/vinumparser.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumparser.c,v 1.14 1999/01/18 03:30:07 grog Exp grog $
- */
-
-/* This file contains the parser for the configuration routines. It's used
- * both in the kernel and in the user interface program, thus the separate file. */
-
-/* Go through a text and split up into text tokens. These are either non-blank
- * sequences, or any sequence (except \0) enclosed in ' or ". Embedded ' or
- * " characters may be escaped by \, which otherwise has no special meaning.
- *
- * Delimit by following with a \0, and return pointers to the starts at token [].
- * Return the number of tokens found as the return value.
- *
- * This method has the restriction that a closing " or ' must be followed by
- * grey space.
- *
- * Error conditions are end of line before end of quote, or no space after
- * a closing quote. In this case, tokenize() returns -1. */
-
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-
-#include <sys/param.h>
-#ifdef KERNEL
-#undef KERNEL /* XXX */
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#else
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#endif
-/* All this mess for a single struct definition */
-#include <sys/uio.h>
-#include <sys/namei.h>
-#include <sys/disklabel.h>
-#include <sys/mount.h>
-#include <sys/device.h>
-#include <sys/disk.h>
-#include <sys/buf.h>
-
-#include <dev/vinum/vinumvar.h>
-#include <dev/vinum/vinumkw.h>
-#include <dev/vinum/vinumio.h>
-#include <dev/vinum/vinumext.h>
-
-#ifdef REALLYKERNEL
-#define isspace(c) ((c == ' ') || (c == '\t')) /* check for white space */
-#else /* get it from the headers */
-#include <ctype.h>
-#endif
-
-/* enum keyword is defined in vinumvar.h */
-
-#define keypair(x) { #x, kw_##x } /* create pair "foo", kw_foo */
-#define flagkeypair(x) { "-"#x, kw_##x } /* create pair "-foo", kw_foo */
-#define KEYWORDSET(x) {sizeof (x) / sizeof (struct _keywords), x}
-
-/* Normal keywords. These are all the words that vinum knows. */
-struct _keywords keywords[] =
-{keypair(drive),
- keypair(sd),
- keypair(subdisk),
- keypair(plex),
- keypair(volume),
- keypair(vol),
- keypair(setupstate),
- keypair(readpol),
- keypair(org),
- keypair(name),
- keypair(writethrough),
- keypair(writeback),
- keypair(raw),
- keypair(device),
- keypair(concat),
- keypair(raid5),
- keypair(striped),
- keypair(plexoffset),
- keypair(driveoffset),
- keypair(length),
- keypair(len),
- keypair(state),
- keypair(round),
- keypair(prefer),
- keypair(rename),
- keypair(detached),
-#ifndef KERNEL /* for vinum(8) only */
-#ifdef VINUMDEBUG
- keypair(debug),
-#endif
- keypair(attach),
- keypair(detach),
- keypair(printconfig),
- keypair(replace),
- keypair(create),
- keypair(read),
- keypair(modify),
- keypair(list),
- keypair(l),
- keypair(ld),
- keypair(ls),
- keypair(lp),
- keypair(lv),
- keypair(info),
- keypair(set),
- keypair(rm),
- keypair(init),
- keypair(label),
- keypair(resetconfig),
- keypair(start),
- keypair(stop),
- keypair(makedev),
- keypair(help),
- keypair(quit),
- keypair(setdaemon),
- keypair(getdaemon),
- keypair(resetstats)
-#endif
-};
-struct keywordset keyword_set = KEYWORDSET(keywords);
-
-#ifndef KERNEL
-struct _keywords flag_keywords[] =
-{flagkeypair(f),
- flagkeypair(d),
- flagkeypair(v),
- flagkeypair(s),
- flagkeypair(r)
-};
-struct keywordset flag_set = KEYWORDSET(flag_keywords);
-
-#endif
-
-int
-tokenize(char *cptr, char *token[])
-{
- char delim; /* delimiter for searching for the partner */
- int tokennr; /* index of this token */
- tokennr = 0; /* none found yet */
-
- for (;;) {
- while (isspace(*cptr))
- cptr++; /* skip initial white space */
- if ((*cptr == '\0') || (*cptr == '\n') || (*cptr == '#')) /* end of line */
- return tokennr; /* return number of tokens found */
- delim = *cptr;
- token[tokennr] = cptr; /* point to it */
- tokennr++; /* one more */
- /* XXX this is broken. It leaves superfluous \\ characters in the text */
- if ((delim == '\'') || (delim == '"')) { /* delimitered */
- for (;;) {
- cptr++;
- if ((*cptr == delim) && (cptr[-1] != '\\')) { /* found the partner */
- cptr++; /* move on past */
- if (!isspace(*cptr)) /* error, no space after closing quote */
- return -1;
- *cptr++ = '\0'; /* delimit */
- } else if ((*cptr == '\0') || (*cptr == '\n')) /* end of line */
- return -1;
- }
- } else { /* not quoted */
- while ((*cptr != '\0') && (!isspace(*cptr)) && (*cptr != '\n'))
- cptr++;
- if (*cptr != '\0') /* not end of the line, */
- *cptr++ = '\0'; /* delimit and move to the next */
- }
- }
-}
-
-/* Find a keyword and return an index */
-enum keyword
-get_keyword(char *name, struct keywordset *keywordset)
-{
- int i;
- struct _keywords *keywords = keywordset->k; /* point to the keywords */
- for (i = 0; i < keywordset->size; i++)
- if (!strcmp(name, keywords[i].name))
- return (enum keyword) keywords[i].keyword;
- return kw_invalid_keyword;
-}
diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c
deleted file mode 100644
index 91f6e15dd9e3..000000000000
--- a/sys/dev/vinum/vinumrequest.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/* XXX to do:
-
- * Decide where we need splbio ()
- */
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumrequest.c,v 1.22 1999/01/17 06:15:46 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-#include <miscfs/specfs/specdev.h>
-#include <sys/resourcevar.h>
-
-enum requeststatus bre(struct request *rq,
- int plexno,
- daddr_t * diskstart,
- daddr_t diskend);
-enum requeststatus bre5(struct request *rq,
- int plexno,
- daddr_t * diskstart,
- daddr_t diskend);
-enum requeststatus build_read_request(struct request *rq, int volplexno);
-enum requeststatus build_write_request(struct request *rq);
-enum requeststatus build_rq_buffer(struct rqelement *rqe, struct plex *plex);
-void freerq(struct request *rq);
-void free_rqg(struct rqgroup *rqg);
-int find_alternate_sd(struct request *rq);
-int check_range_covered(struct request *);
-void complete_rqe(struct buf *bp);
-void complete_raid5_write(struct rqelement *);
-int abortrequest(struct request *rq, int error);
-void sdio_done(struct buf *bp);
-int vinum_bounds_check(struct buf *bp, struct volume *vol);
-caddr_t allocdatabuf(struct rqelement *rqe);
-void freedatabuf(struct rqelement *rqe);
-
-#ifdef VINUMDEBUG
-struct rqinfo rqinfo[RQINFO_SIZE];
-struct rqinfo *rqip = rqinfo;
-
-void
-logrq(enum rqinfo_type type, union rqinfou info, struct buf *ubp)
-{
- int s = splhigh();
-
- microtime(&rqip->timestamp); /* when did this happen? */
- rqip->type = type;
- rqip->bp = ubp; /* user buffer */
- switch (type) {
- case loginfo_user_bp:
- case loginfo_user_bpl:
- bcopy(info.bp, &rqip->info.b, sizeof(struct buf));
- break;
-
- case loginfo_iodone:
- case loginfo_rqe:
- case loginfo_raid5_data:
- case loginfo_raid5_parity:
- bcopy(info.rqe, &rqip->info.rqe, sizeof(struct rqelement));
- break;
-
- case loginfo_unused:
- break;
- }
- rqip++;
- if (rqip >= &rqinfo[RQINFO_SIZE]) /* wrap around */
- rqip = rqinfo;
- splx(s);
-}
-
-#endif
-
-void
-vinumstrategy(struct buf *bp)
-{
- int volno;
- struct volume *vol = NULL;
- struct devcode *device = (struct devcode *) &bp->b_dev; /* decode device number */
-
- switch (device->type) {
- case VINUM_SD_TYPE:
- case VINUM_RAWSD_TYPE:
- sdio(bp);
- return;
-
- /* In fact, vinum doesn't handle drives: they're
- * handled directly by the disk drivers */
- case VINUM_DRIVE_TYPE:
- default:
- bp->b_error = EIO; /* I/O error */
- bp->b_flags |= B_ERROR;
- biodone(bp);
- return;
-
- case VINUM_VOLUME_TYPE: /* volume I/O */
- volno = Volno(bp->b_dev);
- vol = &VOL[volno];
- if (vol->state != volume_up) { /* can't access this volume */
- bp->b_error = EIO; /* I/O error */
- bp->b_flags |= B_ERROR;
- biodone(bp);
- return;
- }
- if (vinum_bounds_check(bp, vol) <= 0) { /* don't like them bounds */
- biodone(bp); /* have nothing to do with this */
- return;
- }
- /* FALLTHROUGH */
- /* Plex I/O is pretty much the same as volume I/O
- * for a single plex. Indicate this by passing a NULL
- * pointer (set above) for the volume */
- case VINUM_PLEX_TYPE:
- case VINUM_RAWPLEX_TYPE:
- bp->b_resid = bp->b_bcount; /* transfer everything */
- vinumstart(bp, 0);
- return;
- }
-}
-
-/* Start a transfer. Return -1 on error,
- * 0 if OK, 1 if we need to retry.
- * Parameter reviveok is set when doing
- * transfers for revives: it allows transfers to
- * be started immediately when a revive is in
- * progress. During revive, normal transfers
- * are queued if they share address space with
- * a currently active revive operation. */
-int
-vinumstart(struct buf *bp, int reviveok)
-{
- int plexno;
- int maxplex; /* maximum number of plexes to handle */
- struct volume *vol;
- struct request *rq; /* build up our request here */
- enum requeststatus status;
-
-#if VINUMDEBUG
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_user_bp, bp, bp);
-#endif
-
- /* XXX In these routines, we're assuming that
- * we will always be called with bp->b_bcount
- * which is a multiple of the sector size. This
- * is a reasonable assumption, since we are only
- * called from system routines. Should we check
- * anyway? */
-
- if ((bp->b_bcount % DEV_BSIZE) != 0) { /* bad length */
- bp->b_error = EINVAL; /* invalid size */
- bp->b_flags |= B_ERROR;
- biodone(bp);
- return -1;
- }
- rq = (struct request *) Malloc(sizeof(struct request)); /* allocate a request struct */
- if (rq == NULL) { /* can't do it */
- bp->b_error = ENOMEM; /* can't get memory */
- bp->b_flags |= B_ERROR;
- biodone(bp);
- return -1;
- }
- bzero(rq, sizeof(struct request));
-
- /* Note the volume ID. This can be NULL, which
- * the request building functions use as an
- * indication for single plex I/O */
- rq->bp = bp; /* and the user buffer struct */
-
- if (DEVTYPE(bp->b_dev) == VINUM_VOLUME_TYPE) { /* it's a volume, */
- rq->volplex.volno = Volno(bp->b_dev); /* get the volume number */
- vol = &VOL[rq->volplex.volno]; /* and point to it */
- vol->active++; /* one more active request */
- maxplex = vol->plexes; /* consider all its plexes */
- } else {
- vol = NULL; /* no volume */
- rq->volplex.plexno = Plexno(bp->b_dev); /* point to the plex */
- rq->isplex = 1; /* note that it's a plex */
- maxplex = 1; /* just the one plex */
- }
-
- if (bp->b_flags & B_READ) {
- /* This is a read request. Decide
- * which plex to read from.
- *
- * There's a potential race condition here,
- * since we're not locked, and we could end
- * up multiply incrementing the round-robin
- * counter. This doesn't have any serious
- * effects, however. */
- if (vol != NULL) {
- vol->reads++;
- vol->bytes_read += bp->b_bcount;
- plexno = vol->preferred_plex; /* get the plex to use */
- if (plexno < 0) { /* round robin */
- plexno = vol->last_plex_read;
- vol->last_plex_read++;
- if (vol->last_plex_read == vol->plexes) /* got the the end? */
- vol->last_plex_read = 0; /* wrap around */
- }
- status = build_read_request(rq, plexno); /* build a request */
- } else {
- daddr_t diskaddr = bp->b_blkno; /* start offset of transfer */
- status = bre(rq, /* build a request list */
- rq->volplex.plexno,
- &diskaddr,
- diskaddr + (bp->b_bcount / DEV_BSIZE));
- }
-
- if ((status > REQUEST_RECOVERED) /* can't satisfy it */
- ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
- if (status == REQUEST_DOWN) { /* not enough subdisks */
- bp->b_error = EIO; /* I/O error */
- bp->b_flags |= B_ERROR;
- }
- biodone(bp);
- freerq(rq);
- return -1;
- } { /* XXX */
- int result;
- int s = splhigh();
- result = launch_requests(rq, reviveok); /* now start the requests if we can */
- splx(s);
- return result;
- }
- } else
- /* This is a write operation. We write to all
- * plexes. If this is a RAID 5 plex, we must also
- * update the parity stripe. */
- {
- if (vol != NULL) {
- vol->writes++;
- vol->bytes_written += bp->b_bcount;
- status = build_write_request(rq); /* Not all the subdisks are up */
- } else { /* plex I/O */
- daddr_t diskstart;
-
- diskstart = bp->b_blkno; /* start offset of transfer */
- status = bre(rq,
- Plexno(bp->b_dev),
- &diskstart,
- bp->b_blkno + (bp->b_bcount / DEV_BSIZE)); /* build requests for the plex */
- }
- if ((status > REQUEST_RECOVERED) /* can't satisfy it */
- ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
- if (status == REQUEST_DOWN) { /* not enough subdisks */
- bp->b_error = EIO; /* I/O error */
- bp->b_flags |= B_ERROR;
- }
- if ((bp->b_flags & B_DONE) == 0)
- biodone(bp);
- freerq(rq);
- return -1;
- }
- return launch_requests(rq, reviveok); /* now start the requests if we can */
- }
-}
-
-/* Call the low-level strategy routines to
- * perform the requests in a struct request */
-int
-launch_requests(struct request *rq, int reviveok)
-{
- struct rqgroup *rqg;
- int rqno; /* loop index */
- struct rqelement *rqe; /* current element */
- int s;
-
- /* First find out whether we're reviving, and the
- * request contains a conflict. If so, we hang
- * the request off plex->waitlist of the first
- * plex we find which is reviving */
- if ((rq->flags & XFR_REVIVECONFLICT) /* possible revive conflict */
- &&(!reviveok)) { /* and we don't want to do it now, */
- struct sd *sd;
- struct request *waitlist; /* point to the waitlist */
-
- sd = &SD[rq->sdno];
- if (sd->waitlist != NULL) { /* something there already, */
- waitlist = sd->waitlist;
- while (waitlist->next != NULL) /* find the end */
- waitlist = waitlist->next;
- waitlist->next = rq; /* hook our request there */
- } else
- sd->waitlist = rq; /* hook our request at the front */
-
-#if VINUMDEBUG
- if (debug & DEBUG_REVIVECONFLICT)
- printf("Revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- rq->sdno,
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount); /* XXX */
-#endif
- return 0; /* and get out of here */
- }
- rq->active = 0; /* nothing yet */
- /* XXX This is probably due to a bug */
- if (rq->rqg == NULL) { /* no request */
- printf("vinum: null rqg");
- abortrequest(rq, EINVAL);
- return -1;
- }
-#if VINUMDEBUG
- if (debug & DEBUG_ADDRESSES)
- printf("Request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount); /* XXX */
- vinum_conf.lastrq = (int) rq;
- vinum_conf.lastbuf = rq->bp;
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_user_bpl, rq->bp, rq->bp);
-#endif
- for (rqg = rq->rqg; rqg != NULL; rqg = rqg->next) { /* through the whole request chain */
- rqg->active = rqg->count; /* they're all active */
- rq->active++; /* one more active request group */
- for (rqno = 0; rqno < rqg->count; rqno++) {
- rqe = &rqg->rqe[rqno];
- if (rqe->flags & XFR_BAD_SUBDISK) /* this subdisk is bad, */
- rqg->active--; /* one less active request */
- else {
- if ((rqe->b.b_flags & B_READ) == 0)
- rqe->b.b_vp->v_numoutput++; /* one more output going */
- rqe->b.b_flags |= B_ORDERED; /* XXX chase SCSI driver */
-#if VINUMDEBUG
- if (debug & DEBUG_ADDRESSES)
- printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
- rqe->b.b_flags & B_READ ? "Read" : "Write",
- rqe->b.b_dev,
- rqe->sdno,
- (u_int) (rqe->b.b_blkno - SD[rqe->sdno].driveoffset),
- rqe->b.b_blkno,
- rqe->b.b_bcount); /* XXX */
- if (debug & DEBUG_NUMOUTPUT)
- printf(" vinumstart sd %d numoutput %ld\n",
- rqe->sdno,
- rqe->b.b_vp->v_numoutput);
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_rqe, rqe, rq->bp);
-#endif
- /* fire off the request */
- s = splbio();
- (*bdevsw[major(rqe->b.b_dev)]->d_strategy) (&rqe->b);
- splx(s);
- }
- /* XXX Do we need caching? Think about this more */
- }
- }
- return 0;
-}
-
-/* define the low-level requests needed to perform a
- * high-level I/O operation for a specific plex 'plexno'.
- *
- * Return 0 if all subdisks involved in the request are up, 1 if some
- * subdisks are not up, and -1 if the request is at least partially
- * outside the bounds of the subdisks.
- *
- * Modify the pointer *diskstart to point to the end address. On
- * read, return on the first bad subdisk, so that the caller
- * (build_read_request) can try alternatives.
- *
- * On entry to this routine, the rqg structures are not assigned. The
- * assignment is performed by expandrq(). Strictly speaking, the
- * elements rqe->sdno of all entries should be set to -1, since 0
- * (from bzero) is a valid subdisk number. We avoid this problem by
- * initializing the ones we use, and not looking at the others (index
- * >= rqg->requests).
- */
-enum requeststatus
-bre(struct request *rq,
- int plexno,
- daddr_t * diskaddr,
- daddr_t diskend)
-{
- int sdno;
- struct sd *sd;
- struct rqgroup *rqg;
- struct buf *bp; /* user's bp */
- struct plex *plex;
- enum requeststatus status; /* return value */
- daddr_t plexoffset; /* offset of transfer in plex */
- daddr_t stripebase; /* base address of stripe (1st subdisk) */
- daddr_t stripeoffset; /* offset in stripe */
- daddr_t blockoffset; /* offset in stripe on subdisk */
- struct rqelement *rqe; /* point to this request information */
- daddr_t diskstart = *diskaddr; /* remember where this transfer starts */
-
- bp = rq->bp; /* buffer pointer */
- status = REQUEST_OK; /* return value: OK until proven otherwise */
- plex = &PLEX[plexno]; /* point to the plex */
-
- switch (plex->organization) {
- case plex_concat:
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]];
- if ((*diskaddr < (sd->plexoffset + sd->sectors)) /* The request starts before the end of this */
- &&(diskend > sd->plexoffset)) { /* subdisk and ends after the start of this sd */
- if (sd->state != sd_up) {
- enum requeststatus s;
-
- s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
- if (s)
- return s; /* XXX get this right */
- }
- rqg = allocrqg(rq, 1); /* space for the request */
- if (rqg == NULL) { /* malloc failed */
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOMEM;
- biodone(bp);
- return REQUEST_ENOMEM;
- }
- rqg->plexno = plexno;
-
- rqe = &rqg->rqe[0]; /* point to the element */
- rqe->rqg = rqg; /* group */
- rqe->sdno = sd->sdno; /* put in the subdisk number */
- plexoffset = max(sd->plexoffset, *diskaddr); /* start offset in plex */
- rqe->sdoffset = plexoffset - sd->plexoffset; /* start offset in subdisk */
- rqe->useroffset = plexoffset - diskstart; /* start offset in user buffer */
- rqe->dataoffset = 0;
- rqe->datalen = min(diskend - *diskaddr, /* number of sectors to transfer in this sd */
- sd->sectors - rqe->sdoffset);
- rqe->groupoffset = 0; /* no groups for concatenated plexes */
- rqe->grouplen = 0;
- rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
- rqe->flags = 0;
- rqe->driveno = sd->driveno;
- *diskaddr += rqe->datalen; /* bump the address */
- if (build_rq_buffer(rqe, plex)) { /* build the buffer */
- deallocrqg(rqg);
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOMEM;
- biodone(bp);
- return REQUEST_ENOMEM; /* can't do it */
- }
- }
- if (*diskaddr > diskend) /* we're finished, */
- break; /* get out of here */
- }
- break;
-
- case plex_striped:
- {
- while (*diskaddr < diskend) { /* until we get it all sorted out */
- /* The offset of the start address from
- * the start of the stripe */
- stripeoffset = *diskaddr % (plex->stripesize * plex->subdisks);
-
- /* The plex-relative address of the
- * start of the stripe */
- stripebase = *diskaddr - stripeoffset;
-
- /* The number of the subdisk in which
- * the start is located */
- sdno = stripeoffset / plex->stripesize;
-
- /* The offset from the beginning of the stripe
- * on this subdisk */
- blockoffset = stripeoffset % plex->stripesize;
-
- sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */
- if (sd->state != sd_up) {
- enum requeststatus s;
-
- s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
- if (s) /* give up? */
- return s; /* yup */
- }
- rqg = allocrqg(rq, 1); /* space for the request */
- if (rqg == NULL) { /* malloc failed */
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOMEM;
- biodone(bp);
- return REQUEST_ENOMEM;
- }
- rqg->plexno = plexno;
-
- rqe = &rqg->rqe[0]; /* point to the element */
- rqe->rqg = rqg;
- rqe->sdoffset = stripebase / plex->subdisks + blockoffset; /* start offset in this subdisk */
- rqe->useroffset = *diskaddr - diskstart; /* The offset of the start in the user buffer */
- rqe->dataoffset = 0;
- rqe->datalen = min(diskend - *diskaddr, /* the amount remaining to transfer */
- plex->stripesize - blockoffset); /* and the amount left in this stripe */
- rqe->groupoffset = 0; /* no groups for striped plexes */
- rqe->grouplen = 0;
- rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
- rqe->flags = 0;
- rqe->sdno = sd->sdno; /* put in the subdisk number */
- rqe->driveno = sd->driveno;
-
- if (rqe->sdoffset >= sd->sectors) { /* starts beyond the end of the subdisk? */
- deallocrqg(rqg);
- return REQUEST_EOF;
- } else if (rqe->sdoffset + rqe->datalen > sd->sectors) /* ends beyond the end of the subdisk? */
- rqe->datalen = sd->sectors - rqe->sdoffset; /* yes, truncate */
-
- if (build_rq_buffer(rqe, plex)) { /* build the buffer */
- deallocrqg(rqg);
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOMEM;
- biodone(bp);
- return REQUEST_ENOMEM; /* can't do it */
- }
- *diskaddr += rqe->datalen; /* look at the remainder */
- if (*diskaddr < diskend) { /* didn't finish the request on this stripe */
- plex->multiblock++; /* count another one */
- if (sdno == plex->subdisks - 1) /* last subdisk, */
- plex->multistripe++; /* another stripe as well */
- }
- }
- }
- break;
-
-
- default:
- printf("vinum: invalid plex type in bre");
- }
-
- return status;
-}
-
-/* Build up a request structure for reading volumes.
- * This function is not needed for plex reads, since there's
- * no recovery if a plex read can't be satisified. */
-enum requeststatus
-build_read_request(struct request *rq, /* request */
- int plexindex)
-{ /* index in the volume's plex table */
- struct buf *bp;
- daddr_t startaddr; /* offset of previous part of transfer */
- daddr_t diskaddr; /* offset of current part of transfer */
- daddr_t diskend; /* and end offset of transfer */
- int plexno; /* plex index in vinum_conf */
- struct rqgroup *rqg; /* point to the request we're working on */
- struct volume *vol; /* volume in question */
- off_t oldstart; /* note where we started */
- int recovered = 0; /* set if we recover a read */
- enum requeststatus status = REQUEST_OK;
-
- bp = rq->bp; /* buffer pointer */
- diskaddr = bp->b_blkno; /* start offset of transfer */
- diskend = diskaddr + (bp->b_bcount / DEV_BSIZE); /* and end offset of transfer */
- rqg = &rq->rqg[plexindex]; /* plex request */
- vol = &VOL[rq->volplex.volno]; /* point to volume */
-
- while (diskaddr < diskend) { /* build up request components */
- startaddr = diskaddr;
- status = bre(rq, vol->plex[plexindex], &diskaddr, diskend); /* build up a request */
- switch (status) {
- case REQUEST_OK:
- continue;
-
- case REQUEST_RECOVERED:
- recovered = 1;
- break;
-
- case REQUEST_EOF:
- case REQUEST_ENOMEM:
- return status;
-
- /* if we get here, we have either had a failure or
- * a RAID 5 recovery. We don't want to use the
- * recovery, because it's expensive, so first we
- * check if we have alternatives */
- case REQUEST_DOWN: /* can't access the plex */
- if (vol != NULL) { /* and this is volume I/O */
- /* Try to satisfy the request
- * from another plex */
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- diskaddr = startaddr; /* start at the beginning again */
- oldstart = startaddr; /* and note where that was */
- if (plexno != plexindex) { /* don't try this plex again */
- bre(rq, vol->plex[plexno], &diskaddr, diskend); /* try a request */
- if (diskaddr > oldstart) { /* we satisfied another part */
- recovered = 1; /* we recovered from the problem */
- status = REQUEST_OK; /* don't complain about it */
- break;
- }
- }
- if (plexno == (vol->plexes - 1)) /* couldn't satisfy the request */
- return REQUEST_DOWN; /* failed */
- }
- } else
- return REQUEST_DOWN; /* bad luck */
- }
- if (recovered)
- vol->recovered_reads += recovered; /* adjust our recovery count */
- }
- return status;
-}
-
-/* Build up a request structure for writes.
- * Return 0 if all subdisks involved in the request are up, 1 if some
- * subdisks are not up, and -1 if the request is at least partially
- * outside the bounds of the subdisks. */
-enum requeststatus
-build_write_request(struct request *rq)
-{ /* request */
- struct buf *bp;
- daddr_t diskstart; /* offset of current part of transfer */
- daddr_t diskend; /* and end offset of transfer */
- int plexno; /* plex index in vinum_conf */
- struct volume *vol; /* volume in question */
- enum requeststatus status;
-
- bp = rq->bp; /* buffer pointer */
- vol = &VOL[rq->volplex.volno]; /* point to volume */
- diskend = bp->b_blkno + (bp->b_bcount / DEV_BSIZE); /* end offset of transfer */
- status = REQUEST_OK;
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- diskstart = bp->b_blkno; /* start offset of transfer */
- status = max(status, bre(rq, /* build requests for the plex */
- vol->plex[plexno],
- &diskstart,
- diskend));
- }
- return status;
-}
-
-/* Fill in the struct buf part of a request element. */
-enum requeststatus
-build_rq_buffer(struct rqelement *rqe, struct plex *plex)
-{
- struct sd *sd; /* point to subdisk */
- struct volume *vol;
- struct buf *bp;
- struct buf *ubp; /* user (high level) buffer header */
-
- vol = &VOL[rqe->rqg->rq->volplex.volno];
- sd = &SD[rqe->sdno]; /* point to subdisk */
- bp = &rqe->b;
- ubp = rqe->rqg->rq->bp; /* pointer to user buffer header */
-
- /* Initialize the buf struct */
- bzero(&rqe->b, sizeof(struct buf));
- bp->b_proc = ubp->b_proc; /* process pointer */
- bp->b_flags = ubp->b_flags & (B_NOCACHE | B_READ | B_ASYNC); /* copy these flags from user bp */
- bp->b_flags |= B_CALL | B_BUSY; /* inform us when it's done */
- /* XXX Should we check for reviving plexes here, and
- * set B_ORDERED if so? */
- bp->b_iodone = complete_rqe; /* by calling us here */
- bp->b_dev = DRIVE[rqe->driveno].dev; /* drive device */
- bp->b_blkno = rqe->sdoffset + sd->driveoffset; /* start address */
- bp->b_bcount = rqe->buflen << DEV_BSHIFT; /* number of bytes to transfer */
- bp->b_resid = bp->b_bcount; /* and it's still all waiting */
- bp->b_bufsize = bp->b_bcount; /* and buffer size */
- bp->b_vp = DRIVE[rqe->driveno].vp; /* drive vnode */
- bp->b_rcred = FSCRED; /* we have the file system credentials */
- bp->b_wcred = FSCRED; /* we have the file system credentials */
-
- if (rqe->flags & XFR_MALLOCED) { /* this operation requires a malloced buffer */
- bp->b_data = Malloc(bp->b_bcount); /* get a buffer to put it in */
- if (bp->b_data == NULL) { /* failed */
- Debugger("XXX");
- abortrequest(rqe->rqg->rq, ENOMEM);
- return REQUEST_ENOMEM; /* no memory */
- }
- } else
- /* Point directly to user buffer data. This means
- * that we don't need to do anything when we have
- * finished the transfer */
- bp->b_data = ubp->b_data + rqe->useroffset * DEV_BSIZE;
- return 0;
-}
-/* Abort a request: free resources and complete the
- * user request with the specified error */
-int
-abortrequest(struct request *rq, int error)
-{
- struct buf *bp = rq->bp; /* user buffer */
-
- bp->b_flags |= B_ERROR;
- bp->b_error = error;
- freerq(rq); /* free everything we're doing */
- biodone(bp);
- return error; /* and give up */
-}
-
-/* Check that our transfer will cover the
- * complete address space of the user request.
- *
- * Return 1 if it can, otherwise 0 */
-int
-check_range_covered(struct request *rq)
-{
- /* XXX */
- return 1;
-}
-
-/* Perform I/O on a subdisk */
-void
-sdio(struct buf *bp)
-{
- int s; /* spl */
- struct sd *sd;
- struct sdbuf *sbp;
- daddr_t endoffset;
- struct drive *drive;
-
- sd = &SD[Sdno(bp->b_dev)]; /* point to the subdisk */
- drive = &DRIVE[sd->driveno];
-
- if (drive->state != drive_up) { /* XXX until we get the states fixed */
- if (bp->b_flags & B_WRITE) /* writing, */
- set_sd_state(Sdno(bp->b_dev), sd_stale, setstate_force);
- else
- set_sd_state(Sdno(bp->b_dev), sd_crashed, setstate_force);
- bp->b_flags |= B_ERROR;
- bp->b_error = EIO;
- biodone(bp);
- return;
- }
- if (sd->state < sd_empty) { /* nothing to talk to, */
- bp->b_flags |= B_ERROR;
- bp->b_flags = EIO;
- if (bp->b_flags & B_BUSY) /* XXX why isn't this always the case? */
- biodone(bp);
- return;
- }
- /* Get a buffer */
- sbp = (struct sdbuf *) Malloc(sizeof(struct sdbuf));
- if (sbp == NULL) {
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOMEM;
- biodone(bp);
- return;
- }
- bcopy(bp, &sbp->b, sizeof(struct buf)); /* start with the user's buffer */
- sbp->b.b_flags |= B_CALL; /* tell us when it's done */
- sbp->b.b_iodone = sdio_done; /* here */
- sbp->b.b_dev = DRIVE[sd->driveno].dev; /* device */
- sbp->b.b_vp = DRIVE[sd->driveno].vp; /* vnode */
- sbp->b.b_blkno += sd->driveoffset;
- sbp->bp = bp; /* note the address of the original header */
- sbp->sdno = sd->sdno; /* note for statistics */
- sbp->driveno = sd->driveno;
- endoffset = bp->b_blkno + sbp->b.b_bcount / DEV_BSIZE; /* final sector offset */
- if (endoffset > sd->sectors) { /* beyond the end */
- sbp->b.b_bcount -= (endoffset - sd->sectors) * DEV_BSIZE; /* trim */
- if (sbp->b.b_bcount <= 0) { /* nothing to transfer */
- bp->b_resid = bp->b_bcount; /* nothing transferred */
- /* XXX Grrr. This doesn't seem to work. Return
- * an error after all */
- bp->b_flags |= B_ERROR;
- bp->b_error = ENOSPC;
- biodone(bp);
- Free(sbp);
- return;
- }
- }
- if ((sbp->b.b_flags & B_READ) == 0) /* write */
- sbp->b.b_vp->v_numoutput++; /* one more output going */
-#if VINUMDEBUG
- if (debug & DEBUG_ADDRESSES)
- printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
- sbp->b.b_flags & B_READ ? "Read" : "Write",
- sbp->b.b_dev,
- sbp->sdno,
- (u_int) (sbp->b.b_blkno - SD[sbp->sdno].driveoffset),
- (int) sbp->b.b_blkno,
- sbp->b.b_bcount); /* XXX */
- if (debug & DEBUG_NUMOUTPUT)
- printf(" vinumstart sd %d numoutput %ld\n",
- sbp->sdno,
- sbp->b.b_vp->v_numoutput);
-#endif
- s = splbio();
- (*bdevsw[major(sbp->b.b_dev)]->d_strategy) (&sbp->b);
- splx(s);
-}
-
-/* Simplified version of bounds_check_with_label
- * Determine the size of the transfer, and make sure it is
- * within the boundaries of the partition. Adjust transfer
- * if needed, and signal errors or early completion.
- *
- * Volumes are simpler than disk slices: they only contain
- * one component (though we call them a, b and c to make
- * system utilities happy), and they always take up the
- * complete space of the "partition".
- *
- * I'm still not happy with this: why should the label be
- * protected? If it weren't so damned difficult to write
- * one in the first pleace (because it's protected), it wouldn't
- * be a problem.
- */
-int
-vinum_bounds_check(struct buf *bp, struct volume *vol)
-{
- int maxsize = vol->size; /* size of the partition (sectors) */
- int size = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; /* size of this request (sectors) */
-
- /* Would this transfer overwrite the disk label? */
- if (bp->b_blkno <= LABELSECTOR /* starts before or at the label */
-#if LABELSECTOR != 0
- && bp->b_blkno + size > LABELSECTOR /* and finishes after */
-#endif
- && (!(vol->flags & VF_RAW)) /* and it's not raw */
- &&major(bp->b_dev) == BDEV_MAJOR /* and it's the block device */
- && (bp->b_flags & B_READ) == 0 /* and it's a write */
- && (!vol->flags & (VF_WLABEL | VF_LABELLING))) { /* and we're not allowed to write the label */
- bp->b_error = EROFS; /* read-only */
- bp->b_flags |= B_ERROR;
- return -1;
- }
- if (size == 0) /* no transfer specified, */
- return 0; /* treat as EOF */
- /* beyond partition? */
- if (bp->b_blkno < 0 /* negative start */
- || bp->b_blkno + size > maxsize) { /* or goes beyond the end of the partition */
- /* if exactly at end of disk, return an EOF */
- if (bp->b_blkno == maxsize) {
- bp->b_resid = bp->b_bcount;
- return 0;
- }
- /* or truncate if part of it fits */
- size = maxsize - bp->b_blkno;
- if (size <= 0) { /* nothing to transfer */
- bp->b_error = EINVAL;
- bp->b_flags |= B_ERROR;
- return -1;
- }
- bp->b_bcount = size << DEV_BSHIFT;
- }
- bp->b_pblkno = bp->b_blkno;
- return 1;
-}
-
-/* Allocate a request group and hook
- * it in in the list for rq */
-struct rqgroup *
-allocrqg(struct request *rq, int elements)
-{
- struct rqgroup *rqg; /* the one we're going to allocate */
- int size = sizeof(struct rqgroup) + elements * sizeof(struct rqelement);
-
- rqg = (struct rqgroup *) Malloc(size);
- if (rqg != NULL) { /* malloc OK, */
- if (rq->rqg) /* we already have requests */
- rq->lrqg->next = rqg; /* hang it off the end */
- else /* first request */
- rq->rqg = rqg; /* at the start */
- rq->lrqg = rqg; /* this one is the last in the list */
-
- bzero(rqg, size); /* no old junk */
- rqg->rq = rq; /* point back to the parent request */
- rqg->count = elements; /* number of requests in the group */
- } else
- Debugger("XXX");
- return rqg;
-}
-
-/* Deallocate a request group out of a chain. We do
- * this by linear search: the chain is short, this
- * almost never happens, and currently it can only
- * happen to the first member of the chain. */
-void
-deallocrqg(struct rqgroup *rqg)
-{
- struct rqgroup *rqgc = rqg->rq->rqg; /* point to the request chain */
-
- if (rqg->rq->rqg == rqg) /* we're first in line */
- rqg->rq->rqg = rqg->next; /* unhook ourselves */
- else {
- while (rqgc->next != rqg) /* find the group */
- rqgc = rqgc->next;
- rqgc->next = rqg->next;
- }
- Free(rqgc);
-}
-
-/* Character device interface */
-int
-vinumread(dev_t dev, struct uio *uio, int ioflag)
-{
- return (physio(vinumstrategy, NULL, dev, 1, minphys, uio));
-}
-
-int
-vinumwrite(dev_t dev, struct uio *uio, int ioflag)
-{
- return (physio(vinumstrategy, NULL, dev, 0, minphys, uio));
-}
diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c
deleted file mode 100644
index e7cc3dd33a4d..000000000000
--- a/sys/dev/vinum/vinumrevive.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumrevive.c,v 1.6 1999/01/17 06:20:44 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-
-/* revive a block of a subdisk. Return an error
- * indication. EAGAIN means successful copy, but
- * that more blocks remain to be copied. EINVAL means
- * that the subdisk isn't associated with a plex (which
- * means a programming error if we get here at all;
- * FIXME)
- * XXX We should specify a block size here. At the moment,
- * just take a default value. FIXME */
-int
-revive_block(int sdno)
-{
- struct sd *sd;
- struct plex *plex;
- struct volume *vol;
- struct buf *bp;
- int error = EAGAIN;
- int size; /* size of revive block, bytes */
- int s; /* priority level */
- daddr_t plexblkno; /* lblkno in plex */
-
- plexblkno = 0; /* to keep the compiler happy */
- sd = &SD[sdno];
- if (sd->plexno < 0) /* no plex? */
- return EINVAL;
- plex = &PLEX[sd->plexno]; /* point to plex */
- if (plex->volno >= 0)
- vol = &VOL[plex->volno];
- else
- vol = NULL;
-
- if (sd->revive_blocksize == 0) {
- if (plex->stripesize != 0) /* we're striped, don't revive more than */
- sd->revive_blocksize = min(DEFAULT_REVIVE_BLOCKSIZE, /* one block at a time */
- plex->stripesize << DEV_BSHIFT);
- else
- sd->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
- }
- size = min(sd->revive_blocksize >> DEV_BSHIFT, sd->sectors - sd->revived) << DEV_BSHIFT;
-
- s = splbio();
-
- bp = geteblk(size); /* Get a buffer */
- if (bp == NULL) {
- splx(s);
- return ENOMEM;
- }
- if (bp->b_qindex != 0) /* on a queue, */
- bremfree(bp); /* remove it XXX how can this happen? */
- splx(s);
-
- /* Amount to transfer: block size, unless it
- * would overlap the end */
- bp->b_bufsize = size;
- bp->b_bcount = bp->b_bufsize;
- bp->b_resid = 0;
-
- /* Now decide where to read from */
-
- switch (plex->organization) {
- daddr_t stripeoffset; /* offset in stripe */
-
- case plex_concat:
- plexblkno = sd->revived + sd->plexoffset; /* corresponding address in plex */
- break;
-
- case plex_striped:
- stripeoffset = sd->revived % plex->stripesize; /* offset from beginning of stripe */
- plexblkno = sd->plexoffset /* base */
- + (sd->revived - stripeoffset) * plex->subdisks /* offset to beginning of stripe */
- + sd->revived % plex->stripesize; /* offset from beginning of stripe */
- break;
-
- case plex_raid5:
- case plex_disorg: /* to keep the compiler happy */
- }
-
- {
- bp->b_blkno = plexblkno; /* start here */
- if (vol != NULL) /* it's part of a volume, */
- /* First, read the data from the volume. We don't
- * care which plex, that's bre's job */
- bp->b_dev = VINUMBDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
- else /* it's an unattached plex */
- bp->b_dev = VINUMRBDEV(sd->plexno, VINUM_RAWPLEX_TYPE); /* create the device number */
-
- bp->b_flags = B_BUSY | B_READ; /* either way, read it */
- vinumstart(bp, 1);
- biowait(bp);
- }
- if (bp->b_flags & B_ERROR)
- error = bp->b_error;
- else
- /* Now write to the subdisk */
- {
- s = splbio();
- if (bp->b_qindex != 0) /* on a queue, */
- bremfree(bp); /* remove it */
- splx(s);
-
- bp->b_dev = VINUMRBDEV(sdno, VINUM_RAWSD_TYPE); /* create the device number */
- bp->b_flags = B_BUSY | B_ORDERED; /* and make this an ordered write */
- bp->b_resid = 0x0;
- bp->b_blkno = sd->revived; /* write it to here */
- sdio(bp); /* perform the I/O */
- biowait(bp);
- if (bp->b_flags & B_ERROR)
- error = bp->b_error;
- else {
- sd->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */
- if (sd->revived >= sd->sectors) { /* finished */
- sd->revived = 0;
- set_sd_state(sdno, sd_up, setstate_force); /* bring the sd up */
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state));
- save_config(); /* and save the updated configuration */
- error = 0; /* we're done */
- }
- }
- while (sd->waitlist) { /* we have waiting requests */
-#if VINUMDEBUG
- struct request *rq = sd->waitlist;
-
- if (debug & DEBUG_REVIVECONFLICT)
- printf("Relaunch revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- rq->sdno,
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount);
-#endif
- launch_requests(sd->waitlist, 1); /* do them now */
- sd->waitlist = sd->waitlist->next; /* and move on to the next */
- }
- }
- if (bp->b_qindex == 0) /* not on a queue, */
- brelse(bp); /* is this kosher? */
- return error;
-}
diff --git a/sys/dev/vinum/vinumstate.c b/sys/dev/vinum/vinumstate.c
deleted file mode 100644
index 8d44fecfcdf2..000000000000
--- a/sys/dev/vinum/vinumstate.c
+++ /dev/null
@@ -1,843 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumstate.c,v 2.10 1999/01/17 06:19:23 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-
-/* Update drive state */
-/* Return 1 if the state changes, otherwise 0 */
-int
-set_drive_state(int driveno, enum drivestate newstate, enum setstateflags flags)
-{
- struct drive *drive = &DRIVE[driveno];
- int oldstate = drive->state;
- int sdno;
-
- if (drive->state == drive_unallocated) /* no drive to do anything with, */
- return 0;
-
- if (newstate != oldstate) { /* don't change it if it's not different */
- if ((newstate == drive_down) /* the drive's going down */
- &&(!(flags & setstate_force))
- && (drive->opencount != 0)) /* we can't do it */
- return 0; /* don't do it */
- drive->state = newstate; /* set the state */
- if (drive->label.name[0] != '\0') /* we have a name, */
- printf("vinum: drive %s is %s\n", drive->label.name, drive_state(drive->state));
- if ((drive->state == drive_up)
- && (drive->vp == NULL)) /* should be open, but we're not */
- init_drive(drive, 1); /* which changes the state again */
- if (newstate != oldstate) { /* state has changed */
- for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) { /* find this drive's subdisks */
- if (SD[sdno].driveno == driveno) /* belongs to this drive */
- update_sd_state(sdno); /* update the state */
- }
- }
- if ((flags & setstate_configuring) == 0) /* configuring? */
- save_config(); /* no: save the updated configuration now */
- return 1;
- }
- return 0;
-}
-
-/* Try to set the subdisk state. Return 1 if state changed to
- * what we wanted, -1 if it changed to something else, and 0
- * if no change.
- *
- * This routine is called both from the user (up, down states
- * only) and internally.
- */
-int
-set_sd_state(int sdno, enum sdstate newstate, enum setstateflags flags)
-{
- struct sd *sd = &SD[sdno];
- struct plex *plex;
- struct volume *vol;
- int oldstate = sd->state;
- int status = 1; /* status to return */
-
- if ((newstate == oldstate)
- || (sd->state == sd_unallocated)) /* no subdisk to do anything with, */
- return 0;
-
- if (sd->driveoffset < 0) { /* not allocated space */
- sd->state = sd_down;
- if (newstate != sd_down) {
- if (sd->plexno >= 0)
- sdstatemap(&PLEX[sd->plexno]); /* count up subdisks */
- return -1;
- }
- } else { /* space allocated */
- switch (newstate) {
- case sd_down:
- if ((!flags & setstate_force) /* but gently */
- &&(sd->plexno >= 0)) /* and we're attached to a plex, */
- return 0; /* don't do it */
- break;
-
- case sd_up:
- if (DRIVE[sd->driveno].state != drive_up) /* can't bring the sd up if the drive isn't, */
- return 0; /* not even by force */
- switch (sd->state) {
- case sd_crashed:
- case sd_down: /* been down, no data lost */
- if ((sd->plexno >= 0) /* we're associated with a plex */
- &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
- ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
- break; /* do it */
- /* XXX Get this right: make sure that other plexes in
- * the volume cover this address space, otherwise
- * we make this one sd_up.
- *
- * Do we even want this any more?
- */
- sd->state = sd_reborn; /* here it is again */
- printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(newstate));
- status = -1;
- break;
-
- case sd_init: /* brand new */
- if (flags & setstate_configuring) /* we're doing this while configuring */
- break;
- /* otherwise it's like being empty */
- /* FALLTHROUGH */
-
- case sd_empty:
- if ((sd->plexno >= 0) /* we're associated with a plex */
- &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
- ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
- break;
- /* Otherwise it's just out of date */
- /* FALLTHROUGH */
-
- case sd_stale: /* out of date info, need reviving */
- case sd_obsolete:
- /* 1. If the subdisk is not part of a plex, bring it up, don't revive.
-
- * 2. If the subdisk is part of a one-plex volume or an unattached plex,
- * and it's not RAID-5, we *can't revive*. The subdisk doesn't
- * change its state.
- *
- * 3. If the subdisk is part of a one-plex volume or an unattached plex,
- * and it's RAID-5, but more than one subdisk is down, we *still
- * can't revive*. The subdisk doesn't change its state.
- *
- * 4. If the subdisk is part of a multi-plex volume, we'll change to
- * reviving and let the revive routines find out whether it will work
- * or not. If they don't, the revive stops with an error message,
- * but the state doesn't change (FWIW).*/
- if (sd->plexno < 0) /* no plex associated, */
- break; /* bring it up */
- plex = &PLEX[sd->plexno];
- if (plex->volno >= 0) /* have a volume */
- vol = &VOL[plex->volno];
- else
- vol = NULL;
- if (((vol == NULL) /* no volume */ ||(vol->plexes == 1)) /* or only one plex in volume */
- &&((plex->organization != plex_raid5) /* or it's a RAID-5 plex */
- ||(plex->sddowncount > 1))) /* with more than one subdisk down, */
- return 0; /* can't do it */
- sd->state = sd_reviving; /* put in reviving state */
- sd->revived = 0; /* nothing done yet */
- status = EAGAIN; /* need to repeat */
- break;
-
- /* XXX This is silly. We need to be able to
- * bring the subdisk up when it's finished
- * initializing, but not from the user. We
- * use the same ioctl in each case, but Vinum(8)
- * doesn't supply the -f flag, so we use that
- * to decide whether to do it or not */
- case sd_initializing:
- if (flags & setstate_force)
- break; /* do it if we have to */
- return 0; /* no */
-
- case sd_reviving:
- if (flags & setstate_force) /* insist, */
- break;
- return EAGAIN; /* no, try again */
-
- default: /* can't do it */
- /* There's no way to bring subdisks up directly from
- * other states. First they need to be initialized
- * or revived */
- return 0;
- }
- break;
-
- default: /* other ones, only internal with force */
- if (flags & setstate_force == 0) /* no force? What's this? */
- return 0; /* don't do it */
- }
- }
- if (status == 1) { /* we can do it, */
- sd->state = newstate;
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state));
- } else /* we don't get here with status 0 */
- printf("vinum: %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(newstate));
- if (sd->plexno >= 0) /* we belong to a plex */
- update_plex_state(sd->plexno); /* update plex state */
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config();
- return status;
-}
-
-/* Set the state of a plex dependent on its subdisks.
- * This time round, we'll let plex state just reflect
- * aggregate subdisk state, so this becomes an order of
- * magnitude less complicated. In particular, ignore
- * the requested state.
- */
-int
-set_plex_state(int plexno, enum plexstate state, enum setstateflags flags)
-{
- struct plex *plex; /* point to our plex */
- enum plexstate oldstate;
- enum volplexstate vps; /* how do we compare with the other plexes? */
-
- plex = &PLEX[plexno]; /* point to our plex */
- oldstate = plex->state;
-
- if ((plex->state == plex_unallocated) /* or no plex to do anything with, */
- ||((state == oldstate) /* or we're already there */
- &&(state != plex_up))) /* and it's not up */
- return 0;
-
- vps = vpstate(plex); /* how do we compare with the other plexes? */
-
- switch (state) {
- /* We can't bring the plex up, even by force,
- * unless it's ready. update_plex_state
- * checks that */
- case plex_up: /* bring the plex up */
- update_plex_state(plex->plexno); /* it'll come up if it can */
- break;
-
- case plex_down: /* want to take it down */
- if (((vps == volplex_onlyus) /* we're the only one up */
- ||(vps == volplex_onlyusup)) /* we're the only one up */
- &&(!(flags & setstate_force))) /* and we don't want to use force */
- return 0; /* can't do it */
- plex->state = state; /* do it */
- invalidate_subdisks(plex, sd_down); /* and down all up subdisks */
- break;
-
- /* This is only requested internally.
- * Trust ourselves */
- case plex_faulty:
- plex->state = state; /* do it */
- invalidate_subdisks(plex, sd_crashed); /* and crash all up subdisks */
- break;
-
- case plex_initializing:
- /* XXX consider what safeguards we need here */
- if ((flags & setstate_force) == 0)
- return 0;
- plex->state = state; /* do it */
- break;
-
- /* What's this? */
- default:
- return 0;
- }
- if (plex->state != oldstate) /* we've changed, */
- printf("vinum: %s is %s\n", plex->name, plex_state(plex->state)); /* tell them about it */
- /* Now see what we have left, and whether
- * we're taking the volume down */
- if (plex->volno >= 0) /* we have a volume */
- update_volume_state(plex->volno); /* update its state */
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config(); /* yes: save the updated configuration */
- return 1;
-}
-
-/* Update the state of a plex dependent on its plexes. */
-int
-set_volume_state(int volno, enum volumestate state, enum setstateflags flags)
-{
- struct volume *vol = &VOL[volno]; /* point to our volume */
-
- if ((vol->state == state) /* we're there already */
- ||(vol->state == volume_unallocated)) /* or no volume to do anything with, */
- return 0;
-
- if (state == volume_up) /* want to come up */
- update_volume_state(volno);
- else if (state == volume_down) { /* want to go down */
- if ((vol->opencount == 0) /* not open */
- ||((flags & setstate_force) != 0)) { /* or we're forcing */
- vol->state = volume_down;
- printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config(); /* yes: save the updated configuration */
- return 1;
- }
- }
- return 0; /* no change */
-}
-
-/* Set the state of a subdisk based on its environment */
-void
-update_sd_state(int sdno)
-{
- struct sd *sd;
- struct drive *drive;
- enum sdstate oldstate;
-
- sd = &SD[sdno];
- oldstate = sd->state;
- drive = &DRIVE[sd->driveno];
-
- if (drive->state == drive_up) {
- switch (sd->state) {
- case sd_down:
- case sd_crashed:
- sd->state = sd_reborn; /* back up again with no loss */
- break;
-
- default:
- break;
- }
- } else { /* down or worse */
- switch (sd->state) {
- case sd_up:
- case sd_reborn:
- case sd_reviving:
- sd->state = sd_crashed; /* lost our drive */
- break;
-
- default:
- break;
- }
- }
- if (sd->state != oldstate) /* state has changed, */
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state)); /* say so */
- if (sd->plexno >= 0) /* we're part of a plex, */
- update_plex_state(sd->plexno); /* update its state */
-}
-
-/* Set the state of a plex based on its environment */
-void
-update_plex_state(int plexno)
-{
- struct plex *plex; /* point to our plex */
- enum plexstate oldstate;
- enum volplexstate vps; /* how do we compare with the other plexes? */
- enum sdstates statemap; /* get a map of the subdisk states */
-
- plex = &PLEX[plexno]; /* point to our plex */
- oldstate = plex->state;
-
- vps = vpstate(plex); /* how do we compare with the other plexes? */
- statemap = sdstatemap(plex); /* get a map of the subdisk states */
-
- if (statemap == sd_upstate) /* all subdisks ready for action */
- /* All the subdisks are up. This also means that
- * they are consistent, so we can just bring
- * the plex up */
- plex->state = plex_up; /* go for it */
- else if (statemap == sd_emptystate) { /* nothing done yet */
- if (((vps & (volplex_otherup | volplex_onlyus)) == 0) /* nothing is up */ &&(plex->state == plex_init) /* we're brand spanking new */
- &&(plex->volno >= 0) /* and we have a volume */
- &&(VOL[plex->volno].flags & VF_CONFIG_SETUPSTATE)) { /* and we consider that up */
- /* Conceptually, an empty plex does not contain valid data,
- * but normally we'll see this state when we have just
- * created a plex, and it's either consistent from earlier,
- * or we don't care about the previous contents (we're going
- * to create a file system or use it for swap).
- *
- * We need to do this in one swell foop: on the next call
- * we will no longer be just empty.
- *
- * This code assumes that all the other plexes are also
- * capable of coming up (i.e. all the sds are up), but
- * that's OK: we'll come back to this function for the remaining
- * plexes in the volume. */
- struct volume *vol = &VOL[plex->volno];
- int plexno;
-
- for (plexno = 0; plexno < vol->plexes; plexno++)
- PLEX[vol->plex[plexno]].state = plex_up;
- } else if (vps & volplex_otherup == 0) { /* no other plexes up */
- int sdno;
-
- plex->state = plex_up; /* we can call that up */
- for (sdno = 0; sdno < plex->subdisks; sdno++) { /* change the subdisks to up state */
- SD[plex->sdnos[sdno]].state = sd_up;
- printf("vinum: %s is up\n", SD[plex->sdnos[sdno]].name); /* tell them about it */
- }
- } else
- plex->state = plex_faulty; /* no, it's down */
- } else if (statemap & (sd_upstate | sd_rebornstate) == statemap) /* all up or reborn */
- plex->state = plex_flaky;
- else if (statemap & (sd_upstate | sd_rebornstate)) /* some up or reborn */
- plex->state = plex_corrupt; /* corrupt */
- else if (statemap & sd_initstate) /* some subdisks initializing */
- plex->state = plex_initializing;
- else /* nothing at all up */
- plex->state = plex_faulty;
-
- if (plex->state != oldstate) /* state has changed, */
- printf("vinum: %s is %s\n", plex->name, plex_state(plex->state)); /* tell them about it */
- if (plex->volno >= 0) /* we're part of a volume, */
- update_volume_state(plex->volno); /* update its state */
-}
-
-/* Set volume state based on its components */
-void
-update_volume_state(int volno)
-{
- struct volume *vol; /* our volume */
- int plexno;
- enum volumestate oldstate;
-
- vol = &VOL[volno]; /* point to our volume */
- oldstate = vol->state;
-
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- struct plex *plex = &PLEX[vol->plex[plexno]]; /* point to the plex */
- if (plex->state >= plex_corrupt) { /* something accessible, */
- vol->state = volume_up;
- break;
- }
- }
- if (plexno == vol->plexes) /* didn't find an up plex */
- vol->state = volume_down;
-
- if (vol->state != oldstate) { /* state changed */
- printf("vinum: %s is %s\n", vol->name, volume_state(vol->state));
- save_config(); /* save the updated configuration */
- }
-}
-
-/* Called from request routines when they find
- * a subdisk which is not kosher. Decide whether
- * it warrants changing the state. Return
- * REQUEST_DOWN if we can't use the subdisk,
- * REQUEST_OK if we can. */
-/* A prior version of this function checked the plex
- * state as well. At the moment, consider plex states
- * information for the user only. We'll ignore them
- * and use the subdisk state only. The last version of
- * this file with the old logic was 2.7. XXX */
-enum requeststatus
-checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend)
-{
- struct plex *plex = &PLEX[sd->plexno];
- int writeop = (rq->bp->b_flags & B_READ) == 0; /* note if we're writing */
-
- switch (sd->state) {
- /* We shouldn't get called if the subdisk is up */
- case sd_up:
- return REQUEST_OK;
-
- case sd_reviving:
- /* Access to a reviving subdisk depends on the
- * organization of the plex:
-
- * - If it's concatenated, access the subdisk up to its current
- * revive point. If we want to write to the subdisk overlapping the
- * current revive block, set the conflict flag in the request, asking
- * the caller to put the request on the wait list, which will be
- * attended to by revive_block when it's done.
- * - if it's striped, we can't do it (we could do some hairy
- * calculations, but it's unlikely to work).
- * - if it's RAID-5, we can do it as long as only one
- * subdisk is down */
- if (plex->state == plex_striped) /* plex is striped, */
- return REQUEST_DOWN; /* can't access it now */
- if (diskaddr > (sd->revived
- + sd->plexoffset
- + (sd->revive_blocksize >> DEV_BSHIFT))) /* we're beyond the end */
- return REQUEST_DOWN; /* don't take the sd down again... */
- else if (diskend > (sd->revived + sd->plexoffset)) { /* we finish beyond the end */
- if (writeop) {
- rq->flags |= XFR_REVIVECONFLICT; /* note a potential conflict */
- rq->sdno = sd->sdno; /* and which sd last caused it */
- } else
- return REQUEST_DOWN; /* can't read this yet */
- }
- return REQUEST_OK;
-
- case sd_reborn:
- if (writeop)
- return REQUEST_OK; /* always write to a reborn disk */
- else /* don't allow a read */
- /* Handle the mapping. We don't want to reject
- * a read request to a reborn subdisk if that's
- * all we have. XXX */
- return REQUEST_DOWN;
-
- case sd_down:
- if (writeop) /* writing to a consistent down disk */
- set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
- return REQUEST_DOWN; /* and it's down one way or another */
-
- case sd_crashed:
- if (writeop) /* writing to a consistent down disk */
- set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
- return REQUEST_DOWN; /* and it's down one way or another */
-
- default:
- return REQUEST_DOWN;
- }
-}
-
-/* return a state map for the subdisks of a plex */
-enum sdstates
-sdstatemap(struct plex *plex)
-{
- int sdno;
- enum sdstates statemap = 0; /* note the states we find */
-
- plex->sddowncount = 0; /* no subdisks down yet */
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
-
- switch (sd->state) {
- case sd_empty:
- statemap |= sd_emptystate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_init:
- statemap |= sd_initstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_down:
- statemap |= sd_downstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_crashed:
- statemap |= sd_crashedstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_obsolete:
- statemap |= sd_obsolete;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_stale:
- statemap |= sd_stalestate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_reborn:
- statemap |= sd_rebornstate;
- break;
-
- case sd_up:
- statemap |= sd_upstate;
- break;
-
- case sd_initializing:
- statemap |= sd_initstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_unallocated:
- case sd_uninit:
- case sd_reviving:
- statemap |= sd_otherstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- }
- }
- return statemap;
-}
-
-/* determine the state of the volume relative to this plex */
-enum volplexstate
-vpstate(struct plex *plex)
-{
- struct volume *vol;
- enum volplexstate state = volplex_onlyusdown; /* state to return */
- int plexno;
-
- if (plex->volno < 0) /* not associated with a volume */
- return volplex_onlyusdown; /* assume the worst */
-
- vol = &VOL[plex->volno]; /* point to our volume */
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- if (&PLEX[vol->plex[plexno]] == plex) { /* us */
-#if RAID5
- if (PLEX[vol->plex[plexno]].state >= plex_degraded) /* are we up? */
- state |= volplex_onlyus; /* yes */
-#else
- if (PLEX[vol->plex[plexno]].state >= plex_flaky) /* are we up? */
- state |= volplex_onlyus; /* yes */
-#endif
- } else {
-#if RAID5
- if (PLEX[vol->plex[plexno]].state >= plex_degraded) /* not us */
- state |= volplex_otherup; /* and when they were up, they were up */
- else
- state |= volplex_alldown; /* and when they were down, they were down */
-#else
- if (PLEX[vol->plex[plexno]].state >= plex_flaky) /* not us */
- state |= volplex_otherup; /* and when they were up, they were up */
- else
- state |= volplex_alldown; /* and when they were down, they were down */
-#endif
- }
- }
- return state; /* and when they were only halfway up */
-} /* they were neither up nor down */
-
-/* Check if all bits b are set in a */
-int allset(int a, int b);
-
-int
-allset(int a, int b)
-{
- return (a & b) == b;
-}
-
-/* Invalidate the subdisks belonging to a plex */
-void
-invalidate_subdisks(struct plex *plex, enum sdstate state)
-{
- int sdno;
-
- for (sdno = 0; sdno < plex->subdisks; sdno++) { /* for each subdisk */
- struct sd *sd = &SD[plex->sdnos[sdno]];
-
- switch (sd->state) {
- case sd_unallocated:
- case sd_uninit:
- case sd_init:
- case sd_initializing:
- case sd_empty:
- case sd_obsolete:
- case sd_stale:
- case sd_crashed:
- case sd_down:
- break;
-
- case sd_reviving:
- case sd_reborn:
- case sd_up:
- set_sd_state(plex->sdnos[sdno], state, setstate_force);
- }
- }
-}
-
-/* Start an object, in other words do what we can to get it up.
- * This is called from vinumioctl (VINUMSTART).
- * Return error indications via ioctl_reply
- */
-void
-start_object(struct vinum_ioctl_msg *data)
-{
- int status;
- int objindex = data->index; /* data gets overwritten */
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
- enum setstateflags flags;
-
- if (data->force != 0) /* are we going to use force? */
- flags = setstate_force; /* yes */
- else
- flags = setstate_none; /* no */
-
- switch (data->type) {
- case drive_object:
- status = set_drive_state(objindex, drive_up, flags);
- if (DRIVE[objindex].state != drive_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- case sd_object:
- if (SD[objindex].state == sd_reviving) { /* reviving, */
- ioctl_reply->error = revive_block(objindex); /* revive another block */
- ioctl_reply->msg[0] = '\0'; /* no comment */
- return;
- }
- status = set_sd_state(objindex, sd_up, flags); /* set state */
- if (status == EAGAIN) { /* first revive, */
- ioctl_reply->error = revive_block(objindex); /* revive the first block */
- ioctl_reply->error = EAGAIN;
- } else {
- if (SD[objindex].state != sd_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- }
- break;
-
- case plex_object:
- status = set_plex_state(objindex, plex_up, flags);
- if (PLEX[objindex].state != plex_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- case volume_object:
- status = set_volume_state(objindex, volume_up, flags);
- if (VOL[objindex].state != volume_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- default:
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "Invalid object type");
- return;
- }
- /* There's no point in saying anything here:
- * the userland program does it better */
- ioctl_reply->msg[0] = '\0';
-}
-
-/* Stop an object, in other words do what we can to get it down
- * This is called from vinumioctl (VINUMSTOP).
- * Return error indications via ioctl_reply.
- */
-void
-stop_object(struct vinum_ioctl_msg *data)
-{
- int status = 1;
- int objindex = data->index; /* save the number from change */
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
-
- switch (data->type) {
- case drive_object:
- status = set_drive_state(objindex, drive_down, data->force);
- break;
-
- case sd_object:
- status = set_sd_state(objindex, sd_down, data->force);
- break;
-
- case plex_object:
- status = set_plex_state(objindex, plex_down, data->force);
- break;
-
- case volume_object:
- status = set_volume_state(objindex, volume_down, data->force);
- break;
-
- default:
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "Invalid object type");
- return;
- }
- ioctl_reply->msg[0] = '\0';
- if (status == 0) /* couldn't do it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
-}
-
-/* VINUM_SETSTATE ioctl: set an object state
- * msg is the message passed by the user */
-void
-setstate(struct vinum_ioctl_msg *msg)
-{
- int sdno;
- struct sd *sd;
- struct plex *plex;
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) msg; /* format for returning replies */
-
- switch (msg->state) {
- case object_down:
- stop_object(msg);
- break;
-
- case object_initializing:
- switch (msg->type) {
- case sd_object:
- sd = &SD[msg->index];
- if ((msg->index >= vinum_conf.subdisks_used)
- || (sd->state == sd_unallocated)) {
- sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
- ioctl_reply->error = EFAULT;
- return;
- }
- set_sd_state(msg->index, sd_initializing, msg->force);
- if (sd->state != sd_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- } else
- ioctl_reply->error = 0;
- break;
-
- case plex_object:
- plex = &PLEX[msg->index];
- if ((msg->index >= vinum_conf.plexes_used)
- || (plex->state == plex_unallocated)) {
- sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
- ioctl_reply->error = EFAULT;
- return;
- }
- set_plex_state(msg->index, plex_initializing, msg->force);
- if (plex->state != plex_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- } else {
- ioctl_reply->error = 0;
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]];
- set_sd_state(plex->sdnos[sdno], sd_initializing, msg->force);
- if (sd->state != sd_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- break;
- }
- }
- }
- break;
-
- default:
- strcpy(ioctl_reply->msg, "Invalid object");
- ioctl_reply->error = EINVAL;
- }
- break;
-
- case object_up:
- start_object(msg);
- }
-}
diff --git a/sys/dev/vinum/vinumstate.h b/sys/dev/vinum/vinumstate.h
deleted file mode 100644
index 267626949069..000000000000
--- a/sys/dev/vinum/vinumstate.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumstate.h,v 1.12 1998/12/30 01:31:52 grog Exp grog $
- */
-
-/* This file gets read by makestatetext to create text files
- * with the names of the states, so don't change the file
- * format */
-
-enum volumestate {
- volume_unallocated,
- /* present but unused. Must be 0 */
-
- volume_uninit,
- /* mentioned elsewhere but not defined */
-
- volume_down,
-
- /* The volume is up and functional, but not all plexes may be available */
- volume_up,
- volume_laststate = volume_up /* last value, for table dimensions */
-};
-
-enum plexstate {
- /* An empty entry, not a plex at all. */
- plex_unallocated,
-
- /* The plex has been allocated, but there configuration
- * is not complete */
- plex_init,
-
- /* A plex which has gone completely down because of
- * I/O errors. */
- plex_faulty,
-
- /* A plex which has been taken down by the
- * administrator. */
- plex_down,
-
- /* A plex which is being initialized */
- plex_initializing,
-
- /* *** The remaining states represent plexes which are
- * at least partially up. Keep these separate so that
- * they can be checked more easily. */
-
- /* A plex entry which is at least partially up. Not
- * all subdisks are available, and an inconsistency
- * has occurred. If no other plex is uncorrupted,
- * the volume is no longer consistent. */
- plex_corrupt,
-
- plex_firstup = plex_corrupt, /* first "up" state */
-
- /* A RAID-5 plex entry which is accessible, but one
- * subdisk is down, requiring recovery for many
- * I/O requests. */
- plex_degraded,
-
- /* A plex which is really up, but which has a reborn
- * subdisk which we don't completely trust, and
- * which we don't want to read if we can avoid it */
- plex_flaky,
-
- /* A plex entry which is completely up. All subdisks
- * are up. */
- plex_up,
-
- plex_laststate = plex_up /* last value, for table dimensions */
-};
-
-/* subdisk states */
-enum sdstate {
- /* An empty entry, not a subdisk at all. */
- sd_unallocated,
-
- /* A subdisk entry which has not been created
- * completely. Some fields may be empty.
- */
- sd_uninit,
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, but the disk hasn't
- * been updated.
- */
- sd_init,
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, and the disk has been
- * updated, but there is no data on the disk.
- */
- sd_empty,
-
- /* A subdisk entry which has been created completely and
- * which is currently being initialized */
- sd_initializing,
-
- /* *** The following states represent invalid data */
- /* A subdisk entry which has been created completely.
- * All fields are correct, the config on disk has been
- * updated, and the data was valid, but since then the
- * drive has been taken down, and as a result updates
- * have been missed.
- */
- sd_obsolete,
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, the disk has been updated,
- * and the data was valid, but since then the drive
- * has been crashed and updates have been lost.
- */
- sd_stale,
-
- /* *** The following states represent valid, inaccessible data */
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, the disk has been updated,
- * and the data was valid, but since then the drive
- * has gone down. No attempt has been made to write
- * to the subdisk since the crash, so the data is valid.
- */
- sd_crashed,
-
- /* A subdisk entry which was up, which contained
- * valid data, and which was taken down by the
- * administrator. The data is valid. */
- sd_down,
-
- /* *** This is invalid data (the subdisk previously had
- * a numerically lower state), but it is currently in the
- * process of being revived. We can write but not read. */
- sd_reviving,
-
- /* *** The following states represent accessible subdisks
- * with valid data */
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, the disk has been updated,
- * and the data was valid, but since then the drive
- * has gone down and up again. No updates were lost,
- * but it is possible that the subdisk has been
- * damaged. We won't read from this subdisk if we
- * have a choice. If this is the only subdisk which
- * covers this address space in the plex, we set its
- * state to sd_up under these circumstances, so this
- * status implies that there is another subdisk to
- * fulfil the request. */
- sd_reborn,
-
- /* A subdisk entry which has been created completely.
- * All fields are correct, the disk has been updated,
- * and the data is valid.
- */
- sd_up,
-
- sd_laststate = sd_up /* last value, for table dimensions */
-};
-
-enum drivestate {
- drive_unallocated,
- /* present but unused. Must be 0 */
-
- drive_uninit,
- /* just mentioned in some other config entry */
-
- drive_down,
- /* not accessible */
-
- drive_up,
- /* up and running */
-
- drive_laststate = drive_up /* last value, for table dimensions */
-};
diff --git a/sys/dev/vinum/vinumutil.c b/sys/dev/vinum/vinumutil.c
deleted file mode 100644
index 22d8be8431dd..000000000000
--- a/sys/dev/vinum/vinumutil.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumutil.c,v 1.10 1999/01/02 00:39:04 grog Exp grog $
- */
-
-/* This file contains utility routines used both in kernel and user context */
-
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/statetexts.h>
-#ifndef REALLYKERNEL
-#include <stdio.h>
-extern jmp_buf command_fail; /* return on a failed command */
-#endif
-
-static char numeric_state[32]; /* temporary buffer for ASCII conversions */
-#define STATECOUNT(x) (sizeof (x##statetext) / sizeof (char *))
-/* Return drive state as a string */
-char *
-drive_state(enum drivestate state)
-{
- if (((unsigned) state) >= STATECOUNT(drive)) {
- sprintf(numeric_state, "Invalid state %d", (int) state);
- return numeric_state;
- } else
- return drivestatetext[state];
-}
-
-/* Return volume state as a string */
-char *
-volume_state(enum volumestate state)
-{
- if (((unsigned) state) >= STATECOUNT(vol)) {
- sprintf(numeric_state, "Invalid state %d", (int) state);
- return numeric_state;
- } else
- return volstatetext[state];
-}
-
-/* Return plex state as a string */
-char *
-plex_state(enum plexstate state)
-{
- if (((unsigned) state) >= STATECOUNT(plex)) {
- sprintf(numeric_state, "Invalid state %d", (int) state);
- return numeric_state;
- } else
- return plexstatetext[state];
-}
-
-/* Return plex organization as a string */
-char *
-plex_org(enum plexorg org)
-{
- switch (org) {
- case plex_disorg: /* disorganized */
- return "disorg";
- break;
-
- case plex_concat: /* concatenated plex */
- return "concat";
- break;
-
- case plex_striped: /* striped plex */
- return "striped";
- break;
-
- case plex_raid5: /* RAID5 plex */
- return "raid5";
- break;
-
- default:
- sprintf(numeric_state, "Invalid org %d", (int) org);
- return numeric_state;
- }
-}
-
-/* Return sd state as a string */
-char *
-sd_state(enum sdstate state)
-{
- if (((unsigned) state) >= STATECOUNT(sd)) {
- sprintf(numeric_state, "Invalid state %d", (int) state);
- return numeric_state;
- } else
- return sdstatetext[state];
-}
-
-/* Now convert in the other direction */
-/* These are currently used only internally,
- * so we don't do too much error checking */
-enum drivestate
-DriveState(char *text)
-{
- int i;
- for (i = 0; i < STATECOUNT(drive); i++)
- if (strcmp(text, drivestatetext[i]) == 0) /* found it */
- return (enum drivestate) i;
- return -1;
-}
-
-enum sdstate
-SdState(char *text)
-{
- int i;
- for (i = 0; i < STATECOUNT(sd); i++)
- if (strcmp(text, sdstatetext[i]) == 0) /* found it */
- return (enum sdstate) i;
- return -1;
-}
-
-enum plexstate
-PlexState(char *text)
-{
- int i;
- for (i = 0; i < STATECOUNT(plex); i++)
- if (strcmp(text, plexstatetext[i]) == 0) /* found it */
- return (enum plexstate) i;
- return -1;
-}
-
-enum volumestate
-VolState(char *text)
-{
- int i;
- for (i = 0; i < STATECOUNT(vol); i++)
- if (strcmp(text, volstatetext[i]) == 0) /* found it */
- return (enum volstate) i;
- return -1;
-}
-
-/* Take a number with an optional scale factor and convert
- * it to a number of bytes.
- *
- * The scale factors are:
- *
- * b blocks (of 512 bytes)
- * k kilobytes (1024 bytes)
- * m megabytes (of 1024 * 1024 bytes)
- * g gigabytes (of 1024 * 1024 * 1024 bytes)
- */
-u_int64_t
-sizespec(char *spec)
-{
- u_int64_t size;
- char *s;
-
- size = 0;
- s = spec;
- if ((*s >= '0') && (*s <= '9')) { /* it's numeric */
- while ((*s >= '0') && (*s <= '9')) /* it's numeric */
- size = size * 10 + *s++ - '0'; /* convert it */
- switch (*s) {
- case '\0':
- return size;
-
- case 'B':
- case 'b':
- return size * 512;
-
- case 'K':
- case 'k':
- return size * 1024;
-
- case 'M':
- case 'm':
- return size * 1024 * 1024;
-
- case 'G':
- case 'g':
- return size * 1024 * 1024 * 1024;
- }
- }
-#ifdef REALLYKERNEL
- throw_rude_remark(EINVAL, "Invalid length specification: %s", spec);
-#else
- fprintf(stderr, "Invalid length specification: %s", spec);
- longjmp(command_fail, -1);
-#endif
- /* NOTREACHED */
- return -1;
-}
-
-/* Extract the volume number from a device number.
- * Perform no checking. */
-int
-Volno(dev_t dev)
-{
- int x = (int) dev;
- return (x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT;
-}
-
-/* Extract a plex number from a device number.
- * Don't check the major number, but check the
- * type. Return -1 for invalid types. */
-int
-Plexno(dev_t dev)
-{
- int x = (int) dev;
-
- switch (DEVTYPE(dev)) {
- case VINUM_VOLUME_TYPE:
- case VINUM_DRIVE_TYPE:
- case VINUM_SUPERDEV_TYPE:
- case VINUM_RAWSD_TYPE:
- return -1;
-
- case VINUM_PLEX_TYPE:
- case VINUM_SD_TYPE:
- return VOL[Volno(x)].plex[(x >> VINUM_PLEX_SHIFT) & (MASK(VINUM_PLEX_WIDTH))];
-
- case VINUM_RAWPLEX_TYPE:
- return ((x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT) /* low order 8 bits */
- |((x >> VINUM_RAWPLEX_SHIFT)
- & (MASK(VINUM_RAWPLEX_WIDTH)
- << (VINUM_VOL_SHIFT + VINUM_VOL_WIDTH))); /* upper 12 bits */
- }
- return 0; /* compiler paranoia */
-}
-
-/* Extract a subdisk number from a device number.
- * Don't check the major number, but check the
- * type. Return -1 for invalid types. */
-int
-Sdno(dev_t dev)
-{
- int x = (int) dev;
-
- switch (DEVTYPE(dev)) {
- case VINUM_VOLUME_TYPE:
- case VINUM_DRIVE_TYPE:
- case VINUM_SUPERDEV_TYPE:
- case VINUM_PLEX_TYPE:
- case VINUM_RAWPLEX_TYPE:
- return -1;
-
- case VINUM_SD_TYPE:
- return PLEX[Plexno(x)].sdnos[(x >> VINUM_SD_SHIFT) & (MASK(VINUM_SD_WIDTH))];
-
- case VINUM_RAWSD_TYPE:
- return ((x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT) /* low order 8 bits */
- |((x >> VINUM_RAWPLEX_SHIFT) & (MASK(VINUM_RAWPLEX_WIDTH) << (VINUM_VOL_SHIFT + VINUM_VOL_WIDTH))); /* upper 12 bits */
- }
- return -1; /* compiler paranoia */
-}
diff --git a/sys/dev/vinum/vinumvar.h b/sys/dev/vinum/vinumvar.h
deleted file mode 100644
index df579fad5366..000000000000
--- a/sys/dev/vinum/vinumvar.h
+++ /dev/null
@@ -1,528 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * 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 Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company 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 ``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 company 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.
- *
- * $Id: vinumvar.h,v 1.18 1999/01/15 06:00:24 grog Exp grog $
- */
-
-#include <sys/time.h>
-#include <dev/vinum/vinumstate.h>
-/* Some configuration maxima. They're an enum because
- * we can't define global constants. Sorry about that.
- *
- * These aren't as bad as they look: most of them are soft limits.
- */
-
-enum constants {
- VINUM_HEADER = 512, /* size of header on disk */
- MAXCONFIGLINE = 1024, /* maximum size of a single config line */
- /* XXX Do we still need this? */
- MINVINUMSLICE = 1048576, /* minimum size of a slice */
-
- CDEV_MAJOR = 91, /* major number for character device */
- BDEV_MAJOR = 25, /* and block device */
-
- ROUND_ROBIN_READPOL = -1, /* round robin read policy */
-
- /* type field in minor number */
- VINUM_VOLUME_TYPE = 0,
- VINUM_PLEX_TYPE = 1,
- VINUM_SD_TYPE = 2,
- VINUM_DRIVE_TYPE = 3,
- VINUM_SUPERDEV_TYPE = 4, /* super device. */
- VINUM_RAWPLEX_TYPE = 5, /* anonymous plex */
- VINUM_RAWSD_TYPE = 6, /* anonymous subdisk */
-
- /* Shifts for the individual fields in the device */
- VINUM_TYPE_SHIFT = 28,
- VINUM_VOL_SHIFT = 0,
- VINUM_PLEX_SHIFT = 16,
- VINUM_SD_SHIFT = 20,
- VINUM_VOL_WIDTH = 8,
- VINUM_PLEX_WIDTH = 3,
- VINUM_SD_WIDTH = 8,
-
- /* Shifts for the second half of raw plex and
- * subdisk numbers */
- VINUM_RAWPLEX_SHIFT = 8, /* shift the second half this much */
- VINUM_RAWPLEX_WIDTH = 12, /* width of second half */
-
- MAJORDEV_SHIFT = 8,
-
- MAXPLEX = 8, /* maximum number of plexes in a volume */
- MAXSD = 256, /* maximum number of subdisks in a plex */
- MAXDRIVENAME = 32, /* maximum length of a device name */
- MAXSDNAME = 64, /* maximum length of a subdisk name */
- MAXPLEXNAME = 64, /* maximum length of a plex name */
- MAXVOLNAME = 64, /* maximum length of a volume name */
- MAXNAME = 64, /* maximum length of any name */
-
-
-/* Create a block device number */
-#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
- | (v << VINUM_VOL_SHIFT) \
- | (p << VINUM_PLEX_SHIFT) \
- | (s << VINUM_SD_SHIFT) \
- | (t << VINUM_TYPE_SHIFT) )
-
-/* Create a bit mask for x bits */
-#define MASK(x) ((1 << (x)) - 1)
-
-/* Create a raw block device number */
-#define VINUMRBDEV(d,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
- | ((d & MASK (VINUM_VOL_WIDTH)) << VINUM_VOL_SHIFT) \
- | ((d & ~MASK (VINUM_VOL_WIDTH)) \
- << (VINUM_PLEX_SHIFT + VINUM_VOL_WIDTH)) \
- | (t << VINUM_TYPE_SHIFT) )
-
-/* And a character device number */
-#define VINUMCDEV(v,p,s,t) ((CDEV_MAJOR << MAJORDEV_SHIFT) \
- | (v << VINUM_VOL_SHIFT) \
- | (p << VINUM_PLEX_SHIFT) \
- | (s << VINUM_SD_SHIFT) \
- | (t << VINUM_TYPE_SHIFT) )
-
-/* extract device type */
-#define DEVTYPE(x) ((x >> VINUM_TYPE_SHIFT) & 7)
-
- VINUM_SUPERDEV = VINUMBDEV(0, 0, 0, VINUM_SUPERDEV_TYPE), /* superdevice number */
-
-/* the number of object entries to cater for initially, and also the
- * value by which they are incremented. It doesn't take long
- * to extend them, so theoretically we could start with 1 of each, but
- * it's untidy to allocate such small areas. These values are
- * probably too small.
- */
-
- INITIAL_DRIVES = 4,
- INITIAL_VOLUMES = 4,
- INITIAL_PLEXES = 8,
- INITIAL_SUBDISKS = 16,
- INITIAL_SUBDISKS_IN_PLEX = 4, /* number of subdisks to allocate to a plex */
- INITIAL_SUBDISKS_IN_DRIVE = 4, /* number of subdisks to allocate to a drive */
- INITIAL_DRIVE_FREELIST = 16, /* number of entries in drive freelist */
- PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
- INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
- DEFAULT_REVIVE_BLOCKSIZE = 65536, /* size of block to transfer in one op */
- VINUMHOSTNAMELEN = 32, /* host name field in label */
-};
-
-/* device numbers */
-
-/*
- * 31 30 28 27 20 19 18 16 15 8 7 0
- * |-----------------------------------------------------------------------------------------------|
- * |X | Type | Subdisk number | X| Plex | Major number | volume number |
- * |-----------------------------------------------------------------------------------------------|
- *
- * 0x2 03 1 19 06
- *
- * The fields in the minor number are interpreted as follows:
- *
- * Volume: Only type and volume number are relevant
- * Plex in volume: type, plex number in volume and volume number are relevant
- * raw plex: type, plex number is made of bits 27-16 and 7-0
- * raw subdisk: type, subdisk number is made of bits 27-16 and 7-0
- */
-
-struct devcode {
-/* CARE. These fields assume a big-endian word. On a
- * little-endian system, they're the wrong way around */
- unsigned volume:8; /* up to 256 volumes */
- unsigned major:8; /* this is where the major number fits */
- unsigned plex:3; /* up to 8 plexes per volume */
- unsigned unused:1; /* up for grabs */
- unsigned sd:8; /* up to 256 subdisks per plex */
- unsigned type:3; /* type of object */
- /* type field
- VINUM_VOLUME = 0,
- VINUM_PLEX = 1,
- VINUM_SUBDISK = 2,
- VINUM_DRIVE = 3,
- VINUM_SUPERDEV = 4,
- VINUM_RAWPLEX = 5,
- VINUM_RAWSD = 6 */
- unsigned signbit:1; /* to make 32 bits */
-};
-
-#define VINUM_DIR "/dev/vinum"
-#define VINUM_RDIR "/dev/rvinum"
-#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
-
-/* Flags for all objects. Most of them only apply to
- * specific objects, but we have space for all in any
- * 32 bit flags word. */
-enum objflags {
- VF_LOCKED = 1, /* somebody has locked access to this object */
- VF_LOCKING = 2, /* we want access to this object */
- VF_WRITETHROUGH = 8, /* volume: write through */
- VF_INITED = 0x10, /* unit has been initialized */
- VF_WLABEL = 0x20, /* label area is writable */
- VF_LABELLING = 0x40, /* unit is currently being labelled */
- VF_WANTED = 0x80, /* someone is waiting to obtain a lock */
- VF_RAW = 0x100, /* raw volume (no file system) */
- VF_LOADED = 0x200, /* module is loaded */
- VF_CONFIGURING = 0x400, /* somebody is changing the config */
- VF_WILL_CONFIGURE = 0x800, /* somebody wants to change the config */
- VF_CONFIG_INCOMPLETE = 0x1000, /* haven't finished changing the config */
- VF_CONFIG_SETUPSTATE = 0x2000, /* set a volume up if all plexes are empty */
- VF_READING_CONFIG = 0x4000, /* we're reading config database from disk */
- VF_KERNELOP = 0x8000, /* we're performing ops from kernel space */
- VF_NEWBORN = 0x10000, /* for objects: we've just created it */
- VF_CONFIGURED = 0x20000, /* for drives: we read the config */
-};
-
-/* Global configuration information for the vinum subsystem */
-struct _vinum_conf {
- /* Pointers to vinum structures */
- struct drive *drive;
- struct sd *sd;
- struct plex *plex;
- struct volume *volume;
-
- /* the number allocated */
- int drives_allocated;
- int subdisks_allocated;
- int plexes_allocated;
- int volumes_allocated;
-
- /* and the number currently in use */
- int drives_used;
- int subdisks_used;
- int plexes_used;
- int volumes_used;
-
- int flags;
- int opencount; /* number of times we've been opened */
-#if VINUMDEBUG
- int lastrq;
- struct buf *lastbuf;
- struct rqinfo **rqipp;
- struct rqinfo *rqinfop;
-#endif
-};
-
-/* Use these defines to simplify code */
-#define DRIVE vinum_conf.drive
-#define SD vinum_conf.sd
-#define PLEX vinum_conf.plex
-#define VOL vinum_conf.volume
-#define VFLAGS vinum_conf.flags
-
-/* Slice header
-
- * Vinum drives start with this structure:
- *
- *\ Sector
- * |--------------------------------------|
- * | PDP-11 memorial boot block | 0
- * |--------------------------------------|
- * | Disk label, maybe | 1
- * |--------------------------------------|
- * | Slice definition (vinum_hdr) | 2
- * |--------------------------------------|
- * | |
- * | Configuration info, first copy | 3
- * | |
- * |--------------------------------------|
- * | |
- * | Configuration info, second copy | 3 + size of config
- * | |
- * |--------------------------------------|
- */
-
-/* Sizes and offsets of our information */
-enum {
- VINUM_LABEL_OFFSET = 4096, /* offset of vinum label */
- VINUMHEADERLEN = 512, /* size of vinum label */
- VINUM_CONFIG_OFFSET = 4608, /* offset of first config copy */
- MAXCONFIG = 65536, /* and size of config copy */
- DATASTART = (MAXCONFIG * 2 + VINUM_CONFIG_OFFSET) / DEV_BSIZE /* this is where the data starts */
-};
-
-/* hostname is 256 bytes long, but we don't need to shlep
- * multiple copies in vinum. We use the host name just
- * to identify this system, and 32 bytes should be ample
- * for that purpose */
-
-struct vinum_label {
- char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
- char name[MAXDRIVENAME]; /* our name of the drive */
- struct timeval date_of_birth; /* the time it was created */
- struct timeval last_update; /* and the time of last update */
- off_t drive_size; /* total size in bytes of the drive.
- * This value includes the headers */
-};
-
-struct vinum_hdr {
- long long magic; /* we're long on magic numbers */
- /* XXX Get these right for big-endian */
-#define VINUM_MAGIC 22322600044678729LL /* should be this */
-#define VINUM_NOMAGIC 22322600044678990LL /* becomes this after obliteration */
- int config_length; /* size in bytes of each copy of the
- * configuration info.
- * This must be a multiple of the sector size. */
-
- struct vinum_label label; /* unique label */
-};
-
-/* Information returned from read_drive_label */
-enum drive_label_info {
- DL_CANT_OPEN, /* invalid partition */
- DL_NOT_OURS, /* valid partition, but no vinum label */
- DL_DELETED_LABEL, /* valid partition, deleted label found */
- DL_WRONG_DRIVE, /* drive name doesn't match */
- DL_OURS /* valid partition and label found */
-};
-
-/*** Drive definitions ***/
-/* A drive corresponds to a disk slice. We use a different term to show
- * the difference in usage: it doesn't have to be a slice, and could
- * theroretically be a complete, unpartitioned disk */
-
-struct drive {
- enum drivestate state; /* current state */
- int flags; /* flags */
- int subdisks_allocated; /* number of entries in sd */
- int subdisks_used; /* and the number used */
- int blocksize; /* size of fs blocks */
- int pid; /* of locker */
- u_int64_t sectors_available; /* number of sectors still available */
- int secsperblock;
- int lasterror; /* last error on drive */
- int driveno; /* index of drive in vinum_conf */
- int opencount; /* number of up subdisks */
- u_int64_t reads; /* number of reads on this drive */
- u_int64_t writes; /* number of writes on this drive */
- u_int64_t bytes_read; /* number of bytes read */
- u_int64_t bytes_written; /* number of bytes written */
- dev_t dev; /* and device number */
- char devicename[MAXDRIVENAME]; /* name of the slice it's on */
- struct vnode *vp; /* vnode pointer */
- struct proc *p;
- struct vinum_label label; /* and the label information */
- struct partinfo partinfo; /* partition information */
- int freelist_size; /* number of entries alloced in free list */
- int freelist_entries; /* number of entries used in free list */
- struct drive_freelist { /* sorted list of free space on drive */
- u_int64_t offset;
- long sectors;
- } *freelist;
-};
-
-/*** Subdisk definitions ***/
-
-struct sd {
- enum sdstate state; /* state */
- int flags;
- int lasterror; /* last error occurred */
- /* offsets in blocks */
- int64_t driveoffset; /* offset on drive */
- /* plexoffset is the offset from the beginning of the
- * plex to the very first part of the subdisk, in
- * sectors. For striped and RAID-5 plexes, only
- * the first stripe is located at this offset */
- int64_t plexoffset; /* offset in plex */
- u_int64_t sectors; /* and length in sectors */
- int plexno; /* index of plex, if it belongs */
- int driveno; /* index of the drive on which it is located */
- int sdno; /* our index in vinum_conf */
- int plexsdno; /* and our number in our plex
- * (undefined if no plex) */
- int pid; /* pid of process which opened us */
- u_int64_t reads; /* number of reads on this subdisk */
- u_int64_t writes; /* number of writes on this subdisk */
- u_int64_t bytes_read; /* number of bytes read */
- u_int64_t bytes_written; /* number of bytes written */
- /* revive parameters */
- u_int64_t revived; /* block number of current revive request */
- int revive_blocksize; /* revive block size (bytes) */
- int revive_interval; /* and time to wait between transfers */
- struct request *waitlist; /* list of requests waiting on revive op */
- char name[MAXSDNAME]; /* name of subdisk */
-};
-
-/*** Plex definitions ***/
-
-/* kinds of plex organization */
-enum plexorg {
- plex_disorg, /* disorganized */
- plex_concat, /* concatenated plex */
- plex_striped, /* striped plex */
- plex_raid5 /* RAID5 plex */
-};
-
-struct plex {
- enum plexorg organization; /* Plex organization */
- enum plexstate state; /* and current state */
- u_int64_t length; /* total length of plex (max offset, in blocks) */
- int flags;
- int stripesize; /* size of stripe or raid band, in sectors */
- int subdisks; /* number of associated subdisks */
- int subdisks_allocated; /* number of subdisks allocated space for */
- int *sdnos; /* list of component subdisks */
- int plexno; /* index of plex in vinum_conf */
- int volno; /* index of volume */
- int volplexno; /* number of plex in volume */
- int pid; /* pid of process which opened us */
- /* Lock information */
- int locks; /* number of locks used */
- int alloclocks; /* number of locks allocated */
- struct rangelock *lock; /* ranges of locked addresses */
- /* Statistics */
- u_int64_t reads; /* number of reads on this plex */
- u_int64_t writes; /* number of writes on this plex */
- u_int64_t bytes_read; /* number of bytes read */
- u_int64_t bytes_written; /* number of bytes written */
- u_int64_t multiblock; /* requests that needed more than one block */
- u_int64_t multistripe; /* requests that needed more than one stripe */
- int sddowncount; /* number of subdisks down */
- char name[MAXPLEXNAME]; /* name of plex */
-};
-
-/*** Volume definitions ***/
-
-
-struct volume {
- enum volumestate state; /* current state */
- int plexes; /* number of plexes */
- int preferred_plex; /* plex to read from, -1 for round-robin */
- int last_plex_read; /* index of plex used for last read,
- * for round-robin */
- dev_t devno; /* device number */
- int flags; /* status and configuration flags */
- int opencount; /* number of opens (all the same process) */
- int openflags; /* flags supplied to last open(2) */
- u_int64_t size; /* size of volume */
- int disk; /* disk index */
- int blocksize; /* logical block size */
- int active; /* number of outstanding requests active */
- int subops; /* and the number of suboperations */
- pid_t pid; /* pid of locker */
- /* Statistics */
- u_int64_t bytes_read; /* number of bytes read */
- u_int64_t bytes_written; /* number of bytes written */
- u_int64_t reads; /* number of reads on this volume */
- u_int64_t writes; /* number of writes on this volume */
- u_int64_t recovered_reads; /* reads recovered from another plex */
- /* Unlike subdisks in the plex, space for the plex pointers is static */
- int plex[MAXPLEX]; /* index of plexes */
- char name[MAXVOLNAME]; /* name of volume */
- struct disklabel label; /* for DIOCGPART */
-};
-
-/* Table expansion. Expand table, which contains oldcount
- * entries of type element, by increment entries, and change
- * oldcount accordingly */
-#define EXPAND(table, element, oldcount, increment) \
-{ \
- expand_table ((void **) &table, \
- oldcount * sizeof (element), \
- (oldcount + increment) * sizeof (element) ); \
- oldcount += increment; \
- }
-
-/* Information on vinum's memory usage */
-struct meminfo {
- int mallocs; /* number of malloced blocks */
- int total_malloced; /* total amount malloced */
- int highwater; /* maximum number of mallocs */
- struct mc *malloced; /* pointer to kernel table */
-};
-
-struct mc {
- int seq;
- int size;
- short line;
- short flags;
-#define ALLOC_KVA 1 /* allocated via kva calls */
- int *databuf; /* really vm_object_t */
- caddr_t address;
- char file[16];
-};
-
-/* These enums are used by the state transition
- * routines. They're in bit map format:
- *
- * Bit 0: Other plexes in the volume are down
- * Bit 1: Other plexes in the volume are up
- * Bit 2: The current plex is up
- * Maybe they should be local to
- * state.c */
-enum volplexstate {
- volplex_onlyusdown = 0, /* we're the only plex, and we're down */
- volplex_alldown, /* 1: another plex is down, and so are we */
- volplex_otherup, /* 2: another plex is up */
- volplex_otherupdown, /* other plexes are up and down */
- volplex_onlyus, /* 4: we're up and alone */
- volplex_onlyusup, /* only we are up, others are down */
- volplex_allup, /* all plexes are up */
- volplex_someup /* some plexes are up, including us */
-};
-
-/* state map for plex */
-enum sdstates {
- sd_emptystate = 1,
- sd_downstate = 2, /* found an SD which is down */
- sd_crashedstate = 4, /* found an SD which is crashed */
- sd_obsoletestate = 8, /* found an SD which is obsolete */
- sd_stalestate = 16, /* found an SD which is stale */
- sd_rebornstate = 32, /* found an SD which is reborn */
- sd_upstate = 64, /* found an SD which is up */
- sd_initstate = 128, /* found an SD which is init */
- sd_otherstate = 256 /* found an SD in some other state */
-};
-
-/* This is really just a parameter to pass to
- * set_<foo>_state, but since it needs to be known
- * in the external definitions, we need to define
- * it here */
-enum setstateflags {
- setstate_none = 0, /* no flags */
- setstate_force = 1, /* force the state change */
- setstate_configuring = 2, /* we're currently configuring, don't save */
-};
-
-#ifdef VINUMDEBUG
-/* Debugging stuff */
-enum debugflags {
- DEBUG_ADDRESSES = 1, /* show buffer information during requests */
- DEBUG_NUMOUTPUT = 2, /* show the value of vp->v_numoutput */
- DEBUG_RESID = 4, /* go into debugger in complete_rqe */
- DEBUG_LASTREQS = 8, /* keep a circular buffer of last requests */
- DEBUG_REVIVECONFLICT = 16, /* print info about revive conflicts */
- DEBUG_REMOTEGDB = 256, /* go into remote gdb */
-};
-
-#endif
diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c
index b1d056fc8ba5..df8a606578de 100644
--- a/sys/dev/vx/if_vx.c
+++ b/sys/dev/vx/if_vx.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_vx.c,v 1.18 1998/07/13 09:52:53 bde Exp $
+ * $Id: if_vx.c,v 1.17 1998/06/07 17:09:51 dfr Exp $
*
*/
@@ -131,6 +131,7 @@ static void vxsetfilter __P((struct vx_softc *));
static void vxgetlink __P((struct vx_softc *));
static void vxsetlink __P((struct vx_softc *));
/* int vxbusyeeprom __P((struct vx_softc *)); */
+/* void vxintr __P((void *)); */
struct vx_softc *
vxalloc(unit)
@@ -639,11 +640,10 @@ vxtxstat(sc)
}
void
-vxintr(voidsc)
- void *voidsc;
+vxintr(sc)
+ struct vx_softc *sc;
{
register short status;
- struct vx_softc *sc = voidsc;
struct ifnet *ifp = &sc->arpcom.ac_if;
for (;;) {
diff --git a/sys/dev/vx/if_vxreg.h b/sys/dev/vx/if_vxreg.h
index 688da0374649..99708af18509 100644
--- a/sys/dev/vx/if_vxreg.h
+++ b/sys/dev/vx/if_vxreg.h
@@ -452,5 +452,5 @@ extern struct vx_softc *vxalloc __P((int));
extern void vxfree __P((struct vx_softc *));
extern int vxattach __P((struct vx_softc *));
extern void vxstop __P((struct vx_softc *));
-extern void vxintr __P((void *));
+extern void vxintr __P((struct vx_softc *));
extern int vxbusyeeprom __P((struct vx_softc *));
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c
index 0d4dfe3621fc..21b9165542b6 100644
--- a/sys/gnu/ext2fs/ext2_alloc.c
+++ b/sys/gnu/ext2fs/ext2_alloc.c
@@ -232,6 +232,7 @@ return ENOSPC;
daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
int i, len, start_lvl, end_lvl, pref, ssize;
+ struct timeval tv;
vp = ap->a_vp;
ip = VTOI(vp);
@@ -338,8 +339,10 @@ return ENOSPC;
bwrite(sbp);
} else {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- if (!doasyncfree)
- UFS_UPDATE(vp, 1);
+ if (!doasyncfree) {
+ gettime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, MNT_WAIT);
+ }
}
if (ssize < len)
if (doasyncfree)
diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h
index 317f540af1e1..0afd890403a1 100644
--- a/sys/gnu/ext2fs/ext2_extern.h
+++ b/sys/gnu/ext2fs/ext2_extern.h
@@ -62,7 +62,7 @@ int ext2_reallocblks __P((struct vop_reallocblks_args *));
int ext2_reclaim __P((struct vop_reclaim_args *));
void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t));
int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
-int ext2_update __P((struct vnode *, int));
+int ext2_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ext2_vfree __P((struct vnode *, ino_t, int));
int ext2_lookup __P((struct vop_cachedlookup_args *));
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index b287c1648857..4699d4d51dc0 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -80,8 +80,10 @@ ext2_init(struct vfsconf *vfsp)
* set, then wait for the write to complete.
*/
int
-ext2_update(vp, waitfor)
+ext2_update(vp, access, modify, waitfor)
struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
int waitfor;
{
register struct ext2_sb_info *fs;
@@ -140,7 +142,8 @@ ext2_truncate(vp, length, flags, cred, p)
register struct ext2_sb_info *fs;
struct buf *bp;
int offset, size, level;
- long count, nblocks, blocksreleased = 0;
+ long count, nblocks, vflags, blocksreleased = 0;
+ struct timeval tv;
register int i;
int aflags, error, allerror;
off_t osize;
@@ -154,6 +157,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return EFBIG;
oip = VTOI(ovp);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
oip->i_size < ovp->v_mount->mnt_maxsymlinklen) {
#if DIAGNOSTIC
@@ -163,11 +167,11 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#if QUOTA
if (error = getinoquota(oip))
@@ -197,7 +201,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -253,8 +257,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- allerror = UFS_UPDATE(ovp, 1);
-
+ if (error = UFS_UPDATE(ovp, &tv, &tv, MNT_WAIT))
+ allerror = error;
/*
* Having written the new inode to disk, save its new configuration
* and put back the old block pointers long enough to process them.
@@ -264,9 +268,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks);
oip->i_size = osize;
- error = vtruncbuf(ovp, cred, p, length, (int)fs->s_blocksize);
- if (error && (allerror == 0))
- allerror = error;
+ vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
+ allerror = vinvalbuf(ovp, vflags, cred, p, 0, 0);
/*
* Indirect blocks first.
@@ -345,8 +348,8 @@ done:
for (i = 0; i < NDADDR; i++)
if (newblks[i] != oip->i_db[i])
panic("itrunc2");
- if (length == 0 && (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) ||
- !TAILQ_EMPTY(&ovp->v_cleanblkhd)))
+ if (length == 0 &&
+ (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first))
panic("itrunc3");
#endif /* DIAGNOSTIC */
/*
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index d5881e2e6f49..7efe39afe4a0 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -173,6 +173,7 @@ WRITE(ap)
daddr_t lbn;
off_t osize;
int blkoffset, error, flags, ioflag, resid, size, xfersize;
+ struct timeval tv;
ioflag = ap->a_ioflag;
uio = ap->a_uio;
@@ -288,7 +289,9 @@ WRITE(ap)
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- } else if (resid > uio->uio_resid && (ioflag & IO_SYNC))
- error = UFS_UPDATE(vp, 1);
+ } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
+ }
return (error);
}
diff --git a/sys/gnu/ext2fs/ext2_subr.c b/sys/gnu/ext2fs/ext2_subr.c
index ed48acf46734..30da6a7300cb 100644
--- a/sys/gnu/ext2fs/ext2_subr.c
+++ b/sys/gnu/ext2fs/ext2_subr.c
@@ -52,11 +52,7 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
-#include "opt_ddb.h"
-
-#ifdef DDB
-void ext2_checkoverlap __P((struct buf *, struct inode *));
-#endif
+static void ext2_checkoverlap __P((struct buf *, struct inode *));
/*
* Return buffer with the contents of block "offset" from the beginning of
@@ -92,8 +88,9 @@ ext2_blkatoff(vp, offset, res, bpp)
return (0);
}
+#include "opt_ddb.h"
#ifdef DDB
-void
+static void
ext2_checkoverlap(bp, ip)
struct buf *bp;
struct inode *ip;
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index ea756b5a6ddd..11045341bdf9 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -276,8 +276,7 @@ ext2_mount(mp, path, data, ndp, p)
vrele(devvp);
return (ENOTBLK);
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return (ENXIO);
}
@@ -893,6 +892,7 @@ ext2_sync(mp, waitfor, cred, p)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct ext2_sb_info *fs;
+ struct timeval tv;
int error, allerror = 0;
fs = ump->um_e2fs;
@@ -918,7 +918,8 @@ loop:
if (vp->v_type == VNON ||
(ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) {
+ (vp->v_dirtyblkhd.lh_first == NULL ||
+ waitfor == MNT_LAZY)) {
simple_unlock(&vp->v_interlock);
continue;
}
@@ -1170,7 +1171,7 @@ ext2_sbupdate(mp, waitfor)
register struct ext2_sb_info *fs = mp->um_e2fs;
register struct ext2_super_block *es = fs->s_es;
register struct buf *bp;
- int error = 0;
+ int i, error = 0;
/*
printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
*/
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index f3b9bcc17109..07e94b84ef9f 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -182,6 +182,7 @@ ext2_fsync(ap)
{
register struct vnode *vp = ap->a_vp;
register struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s;
@@ -196,8 +197,8 @@ ext2_fsync(ap)
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -221,14 +222,15 @@ loop:
tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0);
}
#if DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("ext2_fsync: dirty", vp);
goto loop;
}
#endif
}
splx(s);
- return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
/*
@@ -318,6 +320,7 @@ ext2_link(ap)
struct componentname *cnp = ap->a_cnp;
struct proc *p = cnp->cn_proc;
struct inode *ip;
+ struct timeval tv;
int error;
#ifdef DIAGNOSTIC
@@ -346,7 +349,8 @@ ext2_link(ap)
}
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(vp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
if (!error)
error = ext2_direnter(ip, tdvp, cnp);
if (error) {
@@ -385,6 +389,7 @@ ext2_rename(ap)
struct proc *p = fcnp->cn_proc;
struct inode *ip, *xp, *dp;
struct dirtemplate dirbuf;
+ struct timeval tv;
int doingdirectory = 0, oldparent = 0, newparent = 0;
int error = 0;
u_char namlen;
@@ -522,7 +527,8 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -583,7 +589,7 @@ abortit:
}
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(tdvp, 1);
+ error = UFS_UPDATE(tdvp, &tv, &tv, 1);
if (error)
goto bad;
}
@@ -592,7 +598,7 @@ abortit:
if (doingdirectory && newparent) {
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -801,6 +807,7 @@ ext2_mkdir(ap)
register struct inode *ip, *dp;
struct vnode *tvp;
struct dirtemplate dirtemplate, *dtp;
+ struct timeval tv;
int error, dmode;
#ifdef DIAGNOSTIC
@@ -889,7 +896,8 @@ ext2_mkdir(ap)
ip->i_nlink = 2;
if (cnp->cn_flags & ISWHITEOUT)
ip->i_flags |= UF_OPAQUE;
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
/*
* Bump link count in parent directory
@@ -899,7 +907,7 @@ ext2_mkdir(ap)
*/
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(dvp, 1);
+ error = UFS_UPDATE(dvp, &tv, &tv, 1);
if (error)
goto bad;
@@ -1069,6 +1077,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
struct componentname *cnp;
{
register struct inode *ip, *pdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -1161,7 +1170,8 @@ ext2_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
if (error)
goto bad;
error = ext2_direnter(ip, dvp, cnp);
diff --git a/sys/gnu/i386/fpemul/fpu_entry.c b/sys/gnu/i386/fpemul/fpu_entry.c
index 0db5288e4c1e..bde2ef6dc977 100644
--- a/sys/gnu/i386/fpemul/fpu_entry.c
+++ b/sys/gnu/i386/fpemul/fpu_entry.c
@@ -55,7 +55,7 @@
*
* W. Metzenthen June 1994.
*
- * $Id: fpu_entry.c,v 1.18 1998/11/15 15:33:50 bde Exp $
+ * $Id: fpu_entry.c,v 1.14 1998/08/16 01:21:48 bde Exp $
*
*/
@@ -483,18 +483,48 @@ if (--lookahead_limit)
return (0); /* --pink-- */
}
+#ifdef LKM
+MOD_MISC(gnufpu);
static int
-gnufpu_modevent(module_t mod, int type, void *unused)
+gnufpu_load(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate) {
+ printf("Math emulator already present\n");
+ return EBUSY;
+ }
+ pmath_emulate = math_emulate;
+ return 0;
+}
+
+static int
+gnufpu_unload(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate != math_emulate) {
+ printf("Cannot unload another math emulator\n");
+ return EACCES;
+ }
+ pmath_emulate = 0;
+ return 0;
+}
+
+int
+gnufpu_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(gnufpu, lkmtp, cmd, ver, gnufpu_load, gnufpu_unload,
+ lkm_nullcmd);
+}
+#else /* !LKM */
+
+static int
+gnufpu_modevent(module_t mod, modeventtype_t type, void *unused)
{
switch (type) {
case MOD_LOAD:
if (pmath_emulate) {
printf("Another Math emulator already present\n");
return EACCES;
- }
- pmath_emulate = math_emulate;
- if (bootverbose)
- printf("GPL Math emulator present\n");
+ } else
+ pmath_emulate = math_emulate;
break;
case MOD_UNLOAD:
if (pmath_emulate != math_emulate) {
@@ -502,8 +532,6 @@ gnufpu_modevent(module_t mod, int type, void *unused)
return EACCES;
}
pmath_emulate = 0;
- if (bootverbose)
- printf("GPL Math emulator unloaded\n");
break;
default:
break;
@@ -516,4 +544,6 @@ moduledata_t gnufpumod = {
gnufpu_modevent,
0
};
-DECLARE_MODULE(gnufpu, gnufpumod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+DECLARE_MODULE(gnufpu, gnufpu_modevent, SI_SUB_PSEUDO, SI_ORDER_ANY);
+
+#endif /* LKM */
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c
index 7aeb2583bf0d..aac272582aa2 100644
--- a/sys/gnu/i386/isa/dgb.c
+++ b/sys/gnu/i386/isa/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.40 1998/08/23 08:26:39 bde Exp $
+ * dgb.c $Id: dgb.c,v 1.39 1998/08/16 01:21:49 bde Exp $
*
* Digiboard driver.
*
@@ -407,8 +407,10 @@ dgbprobe(dev)
struct isa_device *dev;
{
struct dgb_softc *sc= &dgb_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
u_long win_size; /* size of vizible memory window */
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -523,6 +525,7 @@ dgbattach(dev)
int addr;
struct dgb_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
int nfails;
ushort *pstat;
@@ -1280,6 +1283,7 @@ dgbpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1508,6 +1512,7 @@ dgbpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1952,6 +1957,7 @@ dgbparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgb_softc *sc=&dgb_softc[unit];
@@ -1962,7 +1968,7 @@ dgbparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -2164,6 +2170,7 @@ dgbstop(tp, rw)
struct dgb_p *port;
struct dgb_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c
index 8b0ca1ff4e78..eca931ae8639 100644
--- a/sys/gnu/i386/isa/dgm.c
+++ b/sys/gnu/i386/isa/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.5 1998/08/23 08:26:40 bde Exp $
+ * $Id: dgm.c,v 1.4 1998/08/16 01:21:49 bde Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -381,7 +381,9 @@ dgmprobe(dev)
struct isa_device *dev;
{
struct dgm_softc *sc= &dgm_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -447,9 +449,14 @@ dgmattach(dev)
int addr;
struct dgm_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
+ int nfails;
+ ushort *pstat;
int lowwater;
static int nports=0;
+ char ch;
+ int stuff;
if(sc->status!=ENABLED) {
DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit);
@@ -1080,6 +1087,7 @@ dgmpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1308,6 +1316,7 @@ dgmpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1752,6 +1761,7 @@ dgmparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgm_softc *sc=&dgm_softc[unit];
@@ -1762,7 +1772,7 @@ dgmparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -1965,6 +1975,7 @@ dgmstop(tp, rw)
struct dgm_p *port;
struct dgm_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/sound/awe_wave.c b/sys/gnu/i386/isa/sound/awe_wave.c
index 1bffbf5a4654..3dc591e635cd 100644
--- a/sys/gnu/i386/isa/sound/awe_wave.c
+++ b/sys/gnu/i386/isa/sound/awe_wave.c
@@ -74,11 +74,11 @@
static int debug_mode = 0;
#ifdef AWE_DEBUG_ON
-#define AWE_DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
+#define DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
#define ERRMSG(XXX) {if (debug_mode) { XXX; }}
#define FATALERR(XXX) XXX
#else
-#define AWE_DEBUG(LVL,XXX) /**/
+#define DEBUG(LVL,XXX) /**/
#define ERRMSG(XXX) XXX
#define FATALERR(XXX) XXX
#endif
@@ -578,7 +578,7 @@ int attach_awe(void)
/* intialize AWE32 hardware */
awe_initialize();
- snprintf(awe_info.name, sizeof(awe_info.name), "AWE32-%s (RAM%dk)",
+ sprintf(awe_info.name, "AWE32-%s (RAM%dk)",
AWEDRV_VERSION, awe_mem_size/1024);
#ifdef __FreeBSD__
printk("awe0: <SoundBlaster EMU8000 MIDI (RAM%dk)>", awe_mem_size/1024);
@@ -806,7 +806,7 @@ awe_release_region(void)
static void
awe_initialize(void)
{
- AWE_DEBUG(0,printk("AWE32: initializing..\n"));
+ DEBUG(0,printk("AWE32: initializing..\n"));
/* initialize hardware configuration */
awe_poke(AWE_HWCF1, 0x0059);
@@ -1300,7 +1300,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_CHORUS, vp->parm.chorus);
temp = (temp <<24) | (unsigned int)addr;
awe_poke_dw(AWE_CSL(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
+ DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
/* Q & current address (Q 4bit value, MSB) */
addr = vp->start - 1;
@@ -1309,7 +1309,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_FILTERQ, vp->parm.filterQ);
temp = (temp<<28) | (unsigned int)addr;
awe_poke_dw(AWE_CCCA(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
+ DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
/* reset volume */
awe_poke_dw(AWE_VTFT(voice), 0x0000FFFF);
@@ -1385,7 +1385,7 @@ awe_exclusive_off(int voice)
if (i != voice && IS_PLAYING(i) &&
voices[i].sample && voices[i].ch == voices[voice].ch &&
voices[i].sample->exclusiveClass == exclass) {
- AWE_DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
+ DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
awe_terminate(i);
awe_voice_init(i, TRUE);
}
@@ -1403,7 +1403,7 @@ awe_set_pitch(int voice, int forced)
{
if (IS_NO_EFFECT(voice) && !forced) return;
awe_poke(AWE_IP(voice), voices[voice].apitch);
- AWE_DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
+ DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
}
/* calculate & change pitch */
@@ -1486,7 +1486,7 @@ awe_set_pan(int voice, int forced)
temp = (temp<<24) | (unsigned int)addr;
awe_poke_dw(AWE_PSST(voice), temp);
voices[voice].apan = temp;
- AWE_DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
+ DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
}
}
@@ -1584,26 +1584,26 @@ awe_calc_pitch(int voice)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
/* calculate offset */
if (ap->fixkey >= 0) {
- AWE_DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
+ DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
offset = (ap->fixkey - ap->root) * 4096 / 12;
} else {
- AWE_DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
+ DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
offset = (vp->note - ap->root) * 4096 / 12;
- AWE_DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
}
offset = (offset * ap->scaleTuning) / 100;
- AWE_DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
offset += ap->tune * 4096 / 1200;
- AWE_DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
if (cp->bender != 0) {
- AWE_DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
+ DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
/* (819200: 1 semitone) ==> (4096: 12 semitones) */
offset += cp->bender * cp->bender_range / 2400;
}
@@ -1616,7 +1616,7 @@ awe_calc_pitch(int voice)
/* 0xe000: root pitch */
vp->apitch = 0xe000 + ap->rate_offset + offset;
- AWE_DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
+ DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
if (vp->apitch > 0xffff)
vp->apitch = 0xffff;
if (vp->apitch < 0)
@@ -1643,7 +1643,7 @@ awe_calc_pitch_from_freq(int voice, int freq)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1696,7 +1696,7 @@ awe_calc_volume(int voice)
ap = vp->sample;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1714,7 +1714,7 @@ awe_calc_volume(int voice)
if (vol > 255) vol = 255;
vp->avol = vol;
- AWE_DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
+ DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
}
@@ -1985,7 +1985,7 @@ awe_kill_note(int dev, int voice, int note, int velocity)
{
int i, v2, key;
- AWE_DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2044,7 +2044,7 @@ awe_start_note(int dev, int voice, int note, int velocity)
{
int i, key, state, volonly;
- AWE_DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2171,7 +2171,7 @@ awe_set_instr(int dev, int voice, int instr_no)
cinfo->def_vrec = awe_search_instr(misc_modes[AWE_MD_DEF_BANK], instr_no);
if (cinfo->vrec < 0 && cinfo->def_vrec < 0) {
- AWE_DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
+ DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
}
cinfo->instr = instr_no;
@@ -2346,7 +2346,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_REMOVE_LAST_SAMPLES:
- AWE_DEBUG(0,printk("AWE32: remove last samples\n"));
+ DEBUG(0,printk("AWE32: remove last samples\n"));
if (locked_sf_id > 0)
awe_remove_samples(locked_sf_id);
break;
@@ -2368,7 +2368,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
if (p1 & 0x80) i = FX_FLAG_ADD;
p1 &= 0x3f;
if (p1 < AWE_FX_END) {
- AWE_DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
+ DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
if (i == FX_FLAG_SET)
FX_SET(fx, p1, p2);
else if (i == FX_FLAG_ADD)
@@ -2376,7 +2376,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
else
FX_UNSET(fx, p1);
if (i != FX_FLAG_OFF && parm_defs[p1].realtime) {
- AWE_DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
+ DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
awe_voice_change(voice, parm_defs[p1].realtime);
}
}
@@ -2402,7 +2402,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_INITIAL_VOLUME:
- AWE_DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
+ DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
if (p2 == 0) /* absolute value */
init_atten = (short)p1;
else /* relative value */
@@ -2422,18 +2422,18 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_CHANNEL_MODE:
- AWE_DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
+ DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
playing_mode = p1;
awe_reset(0);
break;
case _AWE_DRUM_CHANNELS:
- AWE_DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
+ DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
drum_flags = *(unsigned int*)&event[4];
break;
case _AWE_MISC_MODE:
- AWE_DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
+ DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
if (p1 > AWE_MD_VERSION && p1 < AWE_MD_END)
misc_modes[p1] = p2;
break;
@@ -2443,7 +2443,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
default:
- AWE_DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
+ DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
break;
}
}
@@ -2455,7 +2455,7 @@ awe_aftertouch(int dev, int voice, int pressure)
{
int note;
- AWE_DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
+ DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
if (! voice_in_range(voice))
return;
@@ -2492,7 +2492,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
switch (ctrl_num) {
case CTL_BANK_SELECT: /* MIDI control #0 */
- AWE_DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
if (MULTI_LAYER_MODE() && IS_DRUM_CHANNEL(voice) &&
!misc_modes[AWE_MD_TOGGLE_DRUM_BANK])
break;
@@ -2505,7 +2505,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTL_MODWHEEL: /* MIDI control #1 */
- AWE_DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
i = value * misc_modes[AWE_MD_MOD_SENSE] / 1200;
FX_ADD(&cinfo->fx, AWE_FX_LFO1_PITCH, i);
awe_voice_change(voice, awe_fx_fmmod);
@@ -2514,14 +2514,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTRL_PITCH_BENDER: /* SEQ1 V2 contorl */
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
/* zero centered */
cinfo->bender = value;
awe_voice_change(voice, awe_set_voice_pitch);
break;
case CTRL_PITCH_BENDER_RANGE: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
/* value = sense x 100 */
cinfo->bender_range = value;
/* no audible pitch change yet.. */
@@ -2531,14 +2531,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value /= 128;
case CTRL_EXPRESSION: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->expression_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_PAN: /* MIDI control #10 */
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
/* (0-127) -> signed 8bit */
cinfo->panning = value * 2 - 128;
if (misc_modes[AWE_MD_REALTIME_PAN])
@@ -2549,19 +2549,19 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value = (value * 100) / 16383;
case CTRL_MAIN_VOLUME: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->main_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_EXT_EFF_DEPTH: /* reverb effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_REVERB, value * 2);
break;
case CTL_CHORUS_DEPTH: /* chorus effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_CHORUS, value * 2);
break;
@@ -2588,7 +2588,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
default:
- AWE_DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
+ DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
voice, ctrl_num, value));
break;
}
@@ -2612,7 +2612,7 @@ awe_panning(int dev, int voice, int value)
cinfo = &channels[voice];
cinfo->panning = value;
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
if (misc_modes[AWE_MD_REALTIME_PAN])
awe_voice_change(voice, awe_set_pan);
}
@@ -2623,7 +2623,7 @@ static void
awe_volume_method(int dev, int mode)
{
/* not impremented */
- AWE_DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
+ DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
}
@@ -2656,7 +2656,7 @@ awe_bender(int dev, int voice, int value)
/* convert to zero centered value */
cinfo = &channels[voice];
cinfo->bender = value - 8192;
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
awe_voice_change(voice, awe_set_voice_pitch);
}
@@ -3341,7 +3341,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_LOOP_BACK)
smp->mode_flags |= AWE_SAMPLE_REVERSE_LOOP;
- AWE_DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
+ DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
if (patch.mode & WAVE_16_BITS) {
/* convert to word offsets */
smp->size /= 2;
@@ -3369,7 +3369,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->tune = -(note % 100);
rec->low = freq_to_note(patch.low_note) / 100;
rec->high = freq_to_note(patch.high_note) / 100;
- AWE_DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
+ DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
rec->rate_offset, note,
rec->low, rec->high,
patch.low_note, patch.high_note));
@@ -3402,7 +3402,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->parm.voldcysus = (calc_gus_sustain(patch.env_offset[2]) << 8) |
calc_parm_decay(decay);
rec->parm.volrelease = 0x8000 | calc_parm_decay(release);
- AWE_DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
+ DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
rec->attenuation = calc_gus_attenuation(patch.env_offset[0]);
}
@@ -3410,7 +3410,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_TREMOLO) {
int rate = (patch.tremolo_rate * 1000 / 38) / 42;
rec->parm.tremfrq = ((patch.tremolo_depth / 2) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3418,7 +3418,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_VIBRATO) {
int rate = (patch.vibrato_rate * 1000 / 38) / 42;
rec->parm.fm2frq2 = ((patch.vibrato_depth / 6) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3806,7 +3806,7 @@ awe_setup_voice(int dev, int voice, int chn)
if (voice < 0 || voice >= awe_max_voices)
return;
- AWE_DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
+ DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
channels[chn].expression_vol = info->controllers[CTL_EXPRESSION];
channels[chn].main_vol = info->controllers[CTL_MAIN_VOLUME];
channels[chn].panning =
@@ -3841,7 +3841,7 @@ awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
level = (int)IOCTL_IN(arg);
level = ((level & 0xff) + (level >> 8)) / 2;
- AWE_DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
+ DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
if (IO_WRITE_CHECK(cmd)) {
switch (cmd & 0xff) {
@@ -4121,7 +4121,7 @@ awe_init_fm(void)
if (awe_mem_size <= 0)
return;
#endif
- AWE_DEBUG(3,printk("AWE32: initializing FM\n"));
+ DEBUG(3,printk("AWE32: initializing FM\n"));
/* Initialize the last two channels for DRAM refresh and producing
the reverb and chorus effects for Yamaha OPL-3 synthesizer */
@@ -4280,7 +4280,7 @@ awe_detect_base(int addr)
return 0;
if ((awe_peek(AWE_HWCF2) & 0x0003) != 0x0003)
return 0;
- AWE_DEBUG(0,printk("AWE32 found at %x\n", awe_base));
+ DEBUG(0,printk("AWE32 found at %x\n", awe_base));
return 1;
}
@@ -4292,7 +4292,7 @@ awe_detect(void)
for (base = 0x620; base <= 0x680; base += 0x20)
if (awe_detect_base(base))
return 1;
- AWE_DEBUG(0,printk("AWE32 not found\n"));
+ DEBUG(0,printk("AWE32 not found\n"));
return 0;
}
return 1;
@@ -4351,7 +4351,7 @@ awe_check_dram(void)
}
awe_close_dram();
- AWE_DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
+ DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
/* convert to Kbytes */
awe_mem_size *= 1024;
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index 42515c8d5cf3..c871151c7ae0 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/apm.c
@@ -15,7 +15,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.76 1998/12/04 21:28:39 archie Exp $
+ * $Id: apm.c,v 1.73 1998/07/06 06:29:03 imp Exp $
*/
#include "opt_devfs.h"
@@ -29,7 +29,6 @@
#endif /*DEVFS*/
#include <sys/systm.h>
#include <sys/time.h>
-#include <sys/reboot.h>
#include <i386/isa/isa_device.h>
#include <machine/apm_bios.h>
#include <machine/segments.h>
@@ -246,13 +245,12 @@ apm_display(int newstate)
/*
* Turn off the entire system.
*/
-static void
-apm_power_off(int howto, void *junk)
+void
+apm_power_off(void)
{
u_long eax, ebx, ecx, edx;
- /* Not halting powering off, or not active */
- if (!(howto & RB_POWEROFF) || !apm_softc.active)
+ if (!apm_softc.active)
return;
eax = (APM_BIOS << 8) | APM_SETPWSTATE;
ebx = PMDV_ALLDEV;
@@ -795,7 +793,7 @@ apmattach(struct isa_device *dvp)
sc->ds_base = (apm_ds_base << 4) + APM_KERNBASE;
sc->cs32_limit = apm_cs32_limit - 1;
if (apm_cs16_limit == 0)
- apm_cs16_limit = apm_cs32_limit;
+ apm_cs16_limit == apm_cs32_limit;
sc->cs16_limit = apm_cs16_limit - 1;
sc->ds_limit = apm_ds_limit - 1;
sc->cs_entry = apm_cs_entry;
@@ -905,9 +903,6 @@ apmattach(struct isa_device *dvp)
apm_event_enable();
- /* Power the system off using APM */
- at_shutdown_pri(apm_power_off, NULL, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST);
-
sc->initialized = 1;
#ifdef DEVFS
diff --git a/sys/i386/boot/Makefile b/sys/i386/boot/Makefile
index dc8ad32a5f6a..a075627ba249 100644
--- a/sys/i386/boot/Makefile
+++ b/sys/i386/boot/Makefile
@@ -1,5 +1,5 @@
-# $Id: Makefile,v 1.29 1997/07/10 21:58:43 joerg Exp $
+# $Id: Makefile,v 1.28 1997/02/22 09:29:58 peter Exp $
-SUBDIR= cdboot dosboot kzipboot netboot rawboot
+SUBDIR= biosboot cdboot dosboot kzipboot netboot rawboot
.include <bsd.subdir.mk>
diff --git a/sys/i386/boot/Makefile.inc b/sys/i386/boot/Makefile.inc
index 520458a2126b..2b92805e7977 100644
--- a/sys/i386/boot/Makefile.inc
+++ b/sys/i386/boot/Makefile.inc
@@ -1,7 +1,5 @@
-# $Id: Makefile.inc,v 1.3 1998/12/30 10:05:56 bde Exp $
+# $Id$
-BINDIR?= /usr/mdec
-CFLAGS+= -aout
.if exists(${.CURDIR}/../../../../include)
CFLAGS+= -nostdinc -I${.CURDIR}/../../../../include
.endif
diff --git a/sys/i386/boot/biosboot/Makefile b/sys/i386/boot/biosboot/Makefile
index e4feaf98de98..cf517706cdb9 100644
--- a/sys/i386/boot/biosboot/Makefile
+++ b/sys/i386/boot/biosboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.67 1998/11/21 21:07:17 ache Exp $
+# $Id: Makefile,v 1.65 1998/09/15 09:59:57 gibbs Exp $
#
PROG= boot
@@ -6,6 +6,7 @@ PROG= boot
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
SRCS+= probe_keyboard.c io.c disk.c sys.c
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -59,8 +60,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
@@ -81,11 +82,19 @@ boot2: boot.nohdr
all: boot1 boot2
install:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- boot1 boot2 ${DESTDIR}${BINDIR}/
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot1 ${DESTDIR}${BINDIR}/boot1
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot2 ${DESTDIR}${BINDIR}/boot2
+ for i in da fd wd od vn wfd ; do \
+ ( cd ${DESTDIR}${BINDIR} ; \
+ rm -f boot$${i} $${i}boot ; \
+ ln -s boot1 $${i}boot ; \
+ ln -s boot2 boot$${i} ; ) \
+ done
install-boothelp:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
${.CURDIR}/boot.help ${DESTDIR}/
.include <bsd.kern.mk>
diff --git a/sys/i386/boot/biosboot/README.serial b/sys/i386/boot/biosboot/README.serial
index 732e4787e35c..f00d7d0f2d11 100644
--- a/sys/i386/boot/biosboot/README.serial
+++ b/sys/i386/boot/biosboot/README.serial
@@ -105,7 +105,7 @@ To boot FreeBSD in serial console mode, you must do the following:
higher priority console). This replaces the COMCONSOLE option.
Example:
- device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
If the flags were not set, you need to run UserConfig (on a different
console) or recompile the kernel.
@@ -185,7 +185,7 @@ CAVEATS:
`flags' for the serial port you want to use. For example, if you
want to make COM2 the console:
- device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3
+ device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3 vector siointr
The console flags for the other serial ports should not be set.
o Recompile both the boot blocks and the kernel.
@@ -193,4 +193,4 @@ CAVEATS:
from the new kernel.
-$Id: README.serial,v 1.9 1997/06/16 06:32:51 charnier Exp $
+$Id: README.serial,v 1.8 1997/06/09 05:10:54 bde Exp $
diff --git a/sys/i386/boot/biosboot/probe_keyboard.c b/sys/i386/boot/biosboot/probe_keyboard.c
index 7856d586a58f..951d92bcc57f 100644
--- a/sys/i386/boot/biosboot/probe_keyboard.c
+++ b/sys/i386/boot/biosboot/probe_keyboard.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp $
+ * $Id:$
*/
#include <sys/types.h>
@@ -31,8 +31,7 @@
#include <machine/cpufunc.h>
#include <i386/isa/isa.h>
-
-#include <dev/kbd/atkbdcreg.h>
+#include <i386/isa/kbdio.h>
#include "boot.h"
diff --git a/sys/i386/boot/cdboot/Makefile b/sys/i386/boot/cdboot/Makefile
index b59e851fd870..4c01c44b3373 100644
--- a/sys/i386/boot/cdboot/Makefile
+++ b/sys/i386/boot/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 1998/03/12 12:26:47 bde Exp $
+# $Id: Makefile,v 1.3 1997/07/21 16:12:52 bde Exp $
#
PROG= boot
@@ -8,6 +8,7 @@ SRCS+= probe_keyboard.c io.c cdrom.c malloc.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -46,6 +47,10 @@ CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
CLEANFILES+= boot.img boot.nohdr boot.strip
LDFLAGS+= -N -T 0 -nostdlib
+#LINKS= ${BINDIR}/sdboot ${BINDIR}/wdboot\
+# ${BINDIR}/sdboot ${BINDIR}/fdboot\
+# ${BINDIR}/bootsd ${BINDIR}/bootwd\
+# ${BINDIR}/bootsd ${BINDIR}/bootfd
NOSHARED= YES
NOMAN=
STRIP=
@@ -63,8 +68,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/i386/boot/dosboot/Makefile b/sys/i386/boot/dosboot/Makefile
index 26c0d0bf04aa..d73363f3eb52 100644
--- a/sys/i386/boot/dosboot/Makefile
+++ b/sys/i386/boot/dosboot/Makefile
@@ -1,8 +1,9 @@
-# $Id: Makefile,v 1.4 1997/02/22 09:30:28 peter Exp $
+# $Id$
#
MPROG= fbsdboot.exe
CLEANFILES+= ${MPROG}
+BINDIR= /usr/mdec
BINMODE= 444
NOMAN=
STRIP=
diff --git a/sys/i386/boot/dosboot/disklabe.h b/sys/i386/boot/dosboot/disklabe.h
index 81a7c06af6d6..d550d47bcc1f 100644
--- a/sys/i386/boot/dosboot/disklabe.h
+++ b/sys/i386/boot/dosboot/disklabe.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)disklabel.h 8.1 (Berkeley) 6/2/93
- * $Id: disklabe.h,v 1.4 1997/02/22 09:30:46 peter Exp $
+ * $Id$
*/
#ifndef _SYS_DISKLABEL_H_
@@ -100,7 +100,7 @@ struct disklabel {
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
+ * as found in /usr/mdec. These are returned when using
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
#if defined(KERNEL) || defined(STANDALONE)
diff --git a/sys/i386/boot/kzipboot/Makefile b/sys/i386/boot/kzipboot/Makefile
index c1dc06009dad..74eb39347480 100644
--- a/sys/i386/boot/kzipboot/Makefile
+++ b/sys/i386/boot/kzipboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 1998/05/27 08:06:33 sos Exp $
+# $Id: Makefile,v 1.8 1998/03/07 10:48:10 eivind Exp $
PROG= kztail.o kzhead.o
BINMODE = 444 # target is a relocatable object
@@ -21,9 +21,9 @@ CFLAGS+= -DKADDR=$(KADDR) -DCSEG=$(CSEG)
CFLAGS+= -DKZIP -DCOMCONSOLE=0x3F8
kztail.o: ${OBJS_KZTAIL}
- $(LD) -aout -r -x -o kztail.o $(OBJS_KZTAIL)
+ $(LD) -r -x -o kztail.o $(OBJS_KZTAIL)
kzhead.o: ${OBJS_KZHEAD}
- $(LD) -aout -r -x -o kzhead.o $(OBJS_KZHEAD)
+ $(LD) -r -x -o kzhead.o $(OBJS_KZHEAD)
.include <bsd.prog.mk>
diff --git a/sys/i386/boot/kzipboot/malloc.c b/sys/i386/boot/kzipboot/malloc.c
index 052e5e357dbb..cf51be721a51 100644
--- a/sys/i386/boot/kzipboot/malloc.c
+++ b/sys/i386/boot/kzipboot/malloc.c
@@ -36,8 +36,9 @@
extern unsigned char *storage;
void *
-kzipmalloc(nbytes)
+malloc(nbytes, junk1, junk2) /* junk? not used */
size_t nbytes;
+ int junk1, junk2;
{
unsigned char *p = storage;
storage += nbytes;
@@ -50,7 +51,8 @@ kzipmalloc(nbytes)
}
void
-kzipfree(cp)
+free(cp, junk) /* junk not used */
void *cp;
+ int junk;
{
}
diff --git a/sys/i386/boot/netboot/Makefile b/sys/i386/boot/netboot/Makefile
index 2d50c65a58e7..ec81713c1d04 100644
--- a/sys/i386/boot/netboot/Makefile
+++ b/sys/i386/boot/netboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.21 1998/11/28 08:03:24 joerg Exp $
+# $Id: Makefile,v 1.18 1998/06/30 11:10:24 phk Exp $
#
# Makefile for NETBOOT
#
@@ -30,6 +30,7 @@ PROG= nb8390.com nb3c509.com nb8390.rom nb3c509.rom
# Order is very important on the SRCS line for this prog
SRCS= start2.S main.c misc.c bootmenu.c rpc.c
+BINDIR= /usr/mdec
BINMODE= 555
#CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} -DASK_BOOT
CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} # -DASK_BOOT
@@ -40,12 +41,10 @@ NS8390= -DINCLUDE_NE
#NS8390+= -DINCLUDE_3COM -D_3COM_BASE=0x300
CLEANFILES+= netboot.com
CLEANFILES+= makerom start2.ro 3c509.o ns8390.o
-ROMLDFLAGS= ${LDFLAGS} -aout -N -T ${RELOCADDR} -e _start -nostdlib
+ROMLDFLAGS= ${LDFLAGS} -N -T ${RELOCADDR} -e _start -nostdlib
NOSHARED= YES
MAN8= netboot.8
-SIZE= size -aout
STRIP=
-STRIPCMD= strip -aout
ROMSIZE=16384
RELOCADDR=0x90000
@@ -66,27 +65,27 @@ makerom: makerom.c
nb8390.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} ns8390.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb3c509.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} 3c509.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb8390.com: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} ns8390.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
nb3c509.com: start2.o ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} 3c509.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
diff --git a/sys/i386/boot/rawboot/Makefile b/sys/i386/boot/rawboot/Makefile
index 061b6959ecf7..5b2729f0a61a 100644
--- a/sys/i386/boot/rawboot/Makefile
+++ b/sys/i386/boot/rawboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/03/12 12:26:49 bde Exp $
+# $Id: Makefile,v 1.10 1998/03/07 10:48:15 eivind Exp $
#
PROG= boot
@@ -9,6 +9,7 @@ SRCS+= probe_keyboard.c io.c disk.c sys.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-DRAWBOOT \
@@ -62,8 +63,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index 76781f47b02a..1b64ab682db2 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.142 1999/01/09 18:12:07 wpaul Exp $
+# $Id: GENERIC,v 1.124 1998/10/10 08:13:58 jkh Exp $
machine "i386"
cpu "I386_CPU"
@@ -42,40 +42,36 @@ options VISUAL_USERCONFIG #visual boot -c editor
config kernel root on wd0
-# To make an SMP kernel, the next two are needed
-#options SMP # Symmetric MultiProcessor Kernel
-#options APIC_IO # Symmetric (APIC) I/O
-# Optionally these may need tweaked, (defaults shown):
-#options NCPU=2 # number of CPUs
-#options NBUS=4 # number of busses
-#options NAPIC=1 # number of IO APICs
-#options NINTR=24 # number of INTs
-
controller isa0
controller eisa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
options ATAPI #Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-device acd0 #IDE CD-ROM
+device wcd0 #IDE CD-ROM
device wfd0 #IDE Floppy (e.g. LS-120)
-# A single entry for any of these controllers (ncr, ahb, ahc) is
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
# sufficient for any number of installed devices.
controller ncr0
+#controller amd0
controller ahb0
controller ahc0
controller isp0
@@ -89,7 +85,11 @@ controller adv0 at isa? port ? cam irq ?
controller adw0
controller bt0 at isa? port ? cam irq ?
controller aha0 at isa? port ? cam irq ?
-#controller aic0 at isa? port 0x340 bio irq 11
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
controller scbus0
@@ -101,33 +101,23 @@ device pass0
device cd0 #Only need one of these, the code dynamically grows
-device wt0 at isa? port 0x300 bio irq 5 drq 1
-device mcd0 at isa? port 0x300 bio irq 10
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
controller matcd0 at isa? port 0x230 bio
device scd0 at isa? port 0x230 bio
-# atkbdc0 controlls both the keyboard and the PS/2 mouse
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device psm0 at isa? tty irq 12
-
-device vga0 at isa? port ? conflicts
-
-# splash screen/screen saver
-pseudo-device splash
-
# syscons is the default console driver, resembling an SCO console
-device sc0 at isa? tty
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
-#device vt0 at isa? tty
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
#options XSERVER # support for X server
#options FAT_CURSOR # start with block cursor
# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
#options PCVT_SCANSET=2 # IBM keyboards are non-std
-device npx0 at isa? port IO_NPX irq 13
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
#
# Laptop support (see LINT for more options)
@@ -139,40 +129,36 @@ device apm0 at isa? disable flags 0x31 # Advanced Power Management
#device pcic0 at card?
#device pcic1 at card?
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
-device sio1 at isa? port "IO_COM2" tty irq 3
-device sio2 at isa? disable port "IO_COM3" tty irq 5
-device sio3 at isa? disable port "IO_COM4" tty irq 9
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
-device lpt0 at isa? port? tty irq 7
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
-device ax0
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
device xl0
-device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000
-device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000
-device ep0 at isa? port 0x300 net irq 10
-device ex0 at isa? port? net irq?
-device fe0 at isa? port 0x300 net irq ?
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x280 net irq 10 drq 0
-device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000
-device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000
-device cs0 at isa? port 0x300 net irq ?
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
pseudo-device loop
pseudo-device ether
@@ -195,27 +181,4 @@ options SYSVSHM
# aware of the legal and administrative consequences of enabling this
# option. The number of devices determines the maximum number of
# simultaneous BPF clients programs runnable.
-#pseudo-device bpfilter 4 #Berkeley packet filter
-
-
-# USB support
-#controller uhci0
-#controller ohci0
-#controller usb0
-#
-# for the moment we have to specify the priorities of the device
-# drivers explicitly by the ordering in the list below. This will
-# be changed in the future.
-#
-#device ums0
-#device ukbd0
-#device ulpt0
-#device uhub0
-#device ucom0
-#device umodem0
-#device hid0
-#device ugen0
-
-#
-#options USB_DEBUG
-#options USBVERBOSE
+#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/i386/conf/GENERICupgrade b/sys/i386/conf/GENERICupgrade
new file mode 100644
index 000000000000..83e9619456c8
--- /dev/null
+++ b/sys/i386/conf/GENERICupgrade
@@ -0,0 +1,176 @@
+#
+# GENERICupgrade (a copy of GENERIC)
+#
+# This config file is used by the aout->elf transition build on systems
+# not running a 3.0-CURRENT kernel. Unless a kernel is built and installed
+# as part of the upgrade, the system will be hosed by the installation
+# of the 3.0 binaries and subsequent reboot. If the transition build is
+# being perfomed on a machine for which this config file is inappropriate,
+# it should be replaced with a suitable one prior to performing the upgrade.
+#
+# $Id: GENERICupgrade,v 1.2 1998/09/16 17:44:37 phk Exp $
+
+machine "i386"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident GENERIC
+maxusers 32
+
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller eisa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+disk wd1 at wdc0 drive 1
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+disk wd2 at wdc1 drive 0
+disk wd3 at wdc1 drive 1
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+device wfd0 #IDE Floppy (e.g. LS-120)
+
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
+# sufficient for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahb0
+controller ahc0
+controller isp0
+
+# This controller offers a number of configuration options, too many to
+# document here - see the LINT file in this directory and look up the
+# dpt0 entry there for much fuller documentation on this. The options
+# line following dpt0 here is also currently a *required* option for it.
+# controller dpt0
+# options DPT_MEASURE_PERFORMANCE
+
+controller adv0 at isa? port ? cam irq ?
+controller bt0 at isa? port ? cam irq ?
+controller aha0 at isa? port ? cam irq ?
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
+
+controller matcd0 at isa? port 0x230 bio
+
+device scd0 at isa? port 0x230 bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
+# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
+#options XSERVER # support for X server
+#options FAT_CURSOR # start with block cursor
+# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
+#options PCVT_SCANSET=2 # IBM keyboards are non-std
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+device lpt1 at isa? port? tty
+device mse0 at isa? port 0x23c tty irq 5 vector mseintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT
index 762e124d525a..db48f5f82bdd 100644
--- a/sys/i386/conf/LINT
+++ b/sys/i386/conf/LINT
@@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
-# $Id: LINT,v 1.538 1999/01/20 03:29:51 msmith Exp $
+# $Id: LINT,v 1.486 1998/10/10 09:25:12 obrien Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@@ -178,10 +178,6 @@ cpu "I686_CPU" # aka Pentium Pro(tm)
# executed. This should be included for ALL kernels that won't run
# on a Pentium.
#
-# NO_MEMORY_HOLE is an optimisation for systems with AMD K6 processors
-# which indicates that the 15-16MB range is *definitely* not being
-# occupied by an ISA memory hole.
-#
# NOTE 1: The options, CPU_BTB_EN, CPU_LOOP_EN, CPU_IORT,
# CPU_LOOP_ENand CPU_RSTK_EN should not be used becasue of CPU bugs.
# These options may crash your system.
@@ -232,12 +228,6 @@ options GPL_MATH_EMULATE #Support for x87 emulation via
options "COMPAT_43"
#
-# Statically compile in the i386 a.out LKM compatability support.
-# Also available as an KLD module.
-#
-options LKM
-
-#
# Allow user-mode programs to manipulate their local descriptor tables.
# This option is required for the WINE Windows(tm) emulator, and is
# not used by anything else (that we know of).
@@ -297,29 +287,12 @@ options GDB_REMOTE_CHAT
options KTRACE #kernel tracing
#
-# The INVARIANTS option is used in a number of source files to enable
+# The DIAGNOSTIC option is used in a number of source files to enable
# extra sanity checking of internal structures. This support is not
# enabled by default because of the extra time it would take to check
# for these conditions, which can only occur as a result of
# programming errors.
#
-options INVARIANTS
-
-#
-# The INVARIANT_SUPPORT option makes us compile in support for
-# verifying some of the internal structures. It is a prerequisite for
-# 'INVARIANTS', as enabling 'INVARIANTS' will make these functions be
-# called. The intent is that you can set 'INVARIANTS' for single
-# source files (by changing the source file or specifying it on the
-# command line) if you have 'INVARIANT_SUPPORT' enabled.
-#
-options INVARIANT_SUPPORT
-
-#
-# The DIAGNOSTIC option is used to enable extra debugging information
-# from some parts of the kernel. As this makes everything more noisy,
-# it is disabled by default.
-#
options DIAGNOSTIC
#
@@ -344,7 +317,7 @@ options UCONSOLE
# XXX - this doesn't belong here either
options USERCONFIG #boot -c editor
-options INTRO_USERCONFIG #imply -c and show intro screen
+options USERCONFIG_BOOT #imply -c and parse info area
options VISUAL_USERCONFIG #visual boot -c editor
#####################################################################
@@ -408,7 +381,7 @@ pseudo-device ether #Generic Ethernet
pseudo-device fddi #Generic FDDI
pseudo-device sppp #Generic Synchronous PPP
pseudo-device loop #Network loopback device
-pseudo-device bpfilter 4 #Berkeley packet filter
+pseudo-device bpfilter 4 #Berkeley packet filter
pseudo-device disc #Discard device
pseudo-device tun 1 #Tunnel driver (user process ppp(8))
pseudo-device sl 2 #Serial Line IP
@@ -460,7 +433,7 @@ options MROUTING # Multicast routing
options IPFIREWALL #firewall
options IPFIREWALL_VERBOSE #print information about
# dropped packets
-options IPFIREWALL_FORWARD #enable transparent proxy support
+options IPFIREWALL_FORWARD #enable xparent proxy support
options "IPFIREWALL_VERBOSE_LIMIT=100" #limit verbosity
options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default
options IPDIVERT #divert sockets
@@ -469,19 +442,6 @@ options IPFILTER_LOG #ipfilter logging
#options IPFILTER_LKM #kernel support for ip_fil.o LKM
options TCPDEBUG
-# ICMP_BANDLIM enables icmp error response bandwidth limiting. You
-# typically want this option as it will help protect the machine from
-# D.O.S. packet attacks.
-#
-options "ICMP_BANDLIM"
-
-# DUMMYNET enables the "dummynet" bandwidth limiter. You need
-# IPFIREWALL as well. See the dummynet(4) manpage for more info.
-# BRIDGE enables bridging between ethernet cards -- see bridge(4).
-# You can use IPFIREWALL and dummynet together with bridging.
-options DUMMYNET
-options BRIDGE
-
#
# ATM (HARP version) options
#
@@ -554,15 +514,14 @@ options NFS_ROOT #NFS usable as root device
# Also, 'options MFS' is currently incompatible with DEVFS.
options DEVFS #devices filesystem
-# Soft updates is technique for improving file system speed and
-# making abrupt shutdown less risky. It is not enabled by default due
-# to copyright restraints on the code that implement it.
-#
-# Read .../../ufs/ffs/README.softupdates to learn what you need to
-# do to enable this. ../../../contrib/sys/softupdates/README gives
-# more details on how they actually work.
-#
+# Allow the FFS to use Softupdates technology.
+# To do this you need to copy the two files
+# /sys/ufs/ffs/softdep.h and /sys/ufs/ffs/ffs_softdep.c
+# from /usr/src/contrib/sys/softupdates
+# and understand the licensing restrictions.
+# You should also check on the FreeBSD website for newer versions.
#options SOFTUPDATES
+# (we can't actually enable it because the files may not be present)
# Make space in the kernel for a MFS root filesystem. Define to the number
# of kilobytes to reserve for the filesystem.
@@ -768,8 +727,6 @@ pseudo-device gzip #Exec gzipped a.out's
pseudo-device vn #Vnode driver (turns a file into a device)
pseudo-device snp 3 #Snoop device - to look at pty/vty/etc..
pseudo-device ccd 4 #Concatenated disk driver
-pseudo-device vinum #Vinum concat/mirror/raid driver
-options VINUMDEBUG #enable Vinum debugging hooks
# These are only for watching for bitrot in old tty code.
# broken
@@ -835,55 +792,22 @@ options "TUNE_1542"
options PPS_SYNC
-# If you see the "calcru: negative time of %ld usec for pid %d (%s)\n"
-# message you probably have some broken sw/hw which disables interrupts
-# for too long. You can make the system more resistant to this by
-# choosing a high value for NTIMECOUNTER. The default is 5, there
-# is no upper limit but more than a couple of hundred are not productive.
-
-options "NTIMECOUNTER=20"
-
# Enable PnP support in the kernel. This allows you to automaticly
# attach to PnP cards for drivers that support it and allows you to
# configure cards from USERCONFIG. See pnp(4) for more info.
controller pnp0
-# The keyboard controller; it controlls the keyboard and the PS/2 mouse.
-controller atkbdc0 at isa? port IO_KBD tty
-
-# The AT keyboard
-device atkbd0 at isa? tty irq 1
-
-# `flags' for atkbd:
-# 0x01 Force detection of keyboard, else we always assume a keyboard
-# 0x02 Don't reset keyboard, useful for some newer ThinkPads
-# 0x04 Old-style (XT) keyboard support, useful for older ThinkPads
-
-# PS/2 mouse
-device psm0 at isa? tty irq 12
-
-# Options for psm:
-options PSM_HOOKAPM #hook the APM resume event, useful
- #for some laptops
-options PSM_RESETAFTERSUSPEND #reset the device at the resume event
-
-# The video card driver.
-device vga0 at isa? port ? conflicts
-
-# Splash screen at start up! Screen savers require this too.
-pseudo-device splash
-
# The pcvt console driver (vt220 compatible).
-device vt0 at isa? tty
+device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
options XSERVER # support for running an X server.
options FAT_CURSOR # start with block cursor
# This PCVT option is for keyboards such as those used on IBM ThinkPad laptops
options PCVT_SCANSET=2 # IBM keyboards are non-std
# The syscons console driver (sco color console compatible).
-device sc0 at isa? tty
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
options MAXCONS=16 # number of virtual consoles
-options VGA_SLOW_IOACCESS # do byte-wide i/o's to TS and GDC regs
+options SLOW_VGA # do byte-wide i/o's to TS and GDC regs
options "STD8X16FONT" # Compile font in
makeoptions "STD8X16FONT"="cp850"
options SC_HISTORY_SIZE=200 # number of history buffer lines
@@ -903,6 +827,9 @@ options VESA # needs VM86 defined too!!
# 0x02 Use a 'blink' cursor
# 0x04 Use a 'underline' cursor
# 0x06 Use a 'blinking underline' (destructive) cursor
+# 0x08 Force detection of keyboard, else we always assume a keyboard
+# 0x10 Old-style (XT) keyboard support, useful for older ThinkPads
+# 0x20 Don't reset keyboard, useful for some newer ThinkPads
# 0x40 Make the bell quiet if it is rung in the backgroud vty.
#
@@ -911,7 +838,7 @@ options VESA # needs VM86 defined too!!
# buggy. If it is not configured then you *must* configure math emulation
# (see above). If both npx0 and emulation are configured, then only npx0
# is used (provided it works).
-device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
+device npx0 at isa? port "IO_NPX" iosiz 0x0 flags 0x0 irq 13 vector npxintr
#
# `flags' for npx0:
@@ -945,7 +872,7 @@ device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
#
#
-# SCSI host adapters: `aha', `aic', `bt'
+# SCSI host adapters: `aha', `aic', `bt', `nca'
#
# adv: All Narrow SCSI bus AdvanSys controllers.
# adw: Second Generation AdvanSys controllers including the ADV940UW.
@@ -953,6 +880,10 @@ device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
# ahc: Adaptec 274x/284x/294x
# aic: Adaptec 152x and sound cards using the Adaptec AIC-6360 (slow!)
# bt: Most Buslogic controllers
+# nca: ProAudioSpectrum cards using the NCR 5380 or Trantor T130
+# uha: UltraStor ULTRA 14F/24F/34F
+# sea: Seagate ST01/02 8 bit controller (slow!)
+# wds: Western Digital WD7000 controller (no scatter/gather!).
#
# Note that the order is important in order for Buslogic cards to be
# probed correctly.
@@ -962,9 +893,17 @@ controller bt0 at isa? port "IO_BT0" cam irq ?
controller adv0 at isa? port ? cam irq ?
controller adw0
controller aha0 at isa? port ? cam irq ?
+#!CAM# controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
-#!CAM# controller aic0 at isa? port 0x340 bio irq 11
+#!CAM# controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#!CAM# controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#!CAM# controller nca1 at isa? port 0x1f84
+#!CAM# controller nca2 at isa? port 0x1f8c
+#!CAM# controller nca3 at isa? port 0x1e88
+#!CAM# controller nca4 at isa? port 0x350 bio irq 5 vector ncaintr
+#!CAM# controller sea0 at isa? bio irq 5 iomem 0xdc000 iosiz 0x2000 vector seaintr
+#!CAM# controller wds0 at isa? port 0x350 bio irq 15 drq 6 vector wdsintr
#
# ST-506, ESDI, and IDE hard disks: `wdc' and `wd'
@@ -988,7 +927,7 @@ controller aha0 at isa? port ? cam irq ?
# specification with the low 16 bits for drive 0, and the high 16 bits
# for drive 1.
# e.g.:
-#controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0x00ff8004
+#controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0x00ff8004 vector wdintr
#
# specifies that drive 0 will be allowed to probe for 32 bit transfers and
# a maximum multi-sector transfer of 4 sectors, and drive 1 will not be
@@ -999,11 +938,11 @@ controller aha0 at isa? port ? cam irq ?
# mode (for example, it is a 2nd IDE PCI interface), then use config line(s)
# such as:
#
-#controller wdc2 at isa? port "0" bio irq ? flags 0xa0ffa0ff
+#controller wdc2 at isa? port "0" bio irq ? flags 0xa0ffa0ff vector wdintr
#disk wd4 at wdc2 drive 0
#disk wd5 at wdc2 drive 1
#
-#controller wdc3 at isa? port "0" bio irq ? flags 0xa0ffa0ff
+#controller wdc3 at isa? port "0" bio irq ? flags 0xa0ffa0ff vector wdintr
#disk wd6 at wdc3 drive 0
#disk wd7 at wdc3 drive 1
#
@@ -1012,10 +951,10 @@ controller aha0 at isa? port ? cam irq ?
# entries. These are automatically filled in by the IDE/PCI support.
#
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
@@ -1033,17 +972,13 @@ options "CMD640" #Enable work around for CMD640 h/w bug
options ATAPI #Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-#
-# This option allow you to override the default probe time for IDE
-# devices, to get a faster probe. Setting this below 10000 violate
-# the IDE specs, but may still work for you (it will work for most
-# people).
-#
-options IDE_DELAY=8000 # Be optimistic about Joe IDE device
-
+# Use either the acd or the wcd device, not both!
# IDE CD-ROM & CD-R/RW driver - requires wdc controller and ATAPI option
device acd0
+# IDE CD-ROM driver - requires wdc controller and ATAPI option
+device wcd0
+
# IDE floppy driver - requires wdc controller and ATAPI option
device wfd0
@@ -1054,46 +989,49 @@ device wst0
#
# Standard floppy disk controllers and floppy tapes: `fdc', `fd', and `ft'
#
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
#
# FDC_DEBUG enables floppy debugging. Since the debug output is huge, you
# gotta turn it actually on by setting the variable fd_debug with DDB,
# however.
options FDC_DEBUG
-# FDC_YE enables support for the floppies used on the Libretto. This is a
-# pcmcia floppy. You will also need to add
-#card "Y-E DATA" "External FDD"
-# config 0x4 "fdc0" 10
-# to your pccard.conf file.
-options FDC_YE
# This option is undocumented on purpose.
options FDC_PRINT_BOGUS_CHIPTYPE
#
# Activate this line instead of the fdc0 line above if you happen to
# have an Insight floppy tape. Probing them proved to be dangerous
# for people with floppy disks only, so it's "hidden" behind a flag:
-#controller fdc0 at isa? port "IO_FD1" bio flags 1 irq 6 drq 2
+#controller fdc0 at isa? port "IO_FD1" bio flags 1 irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
+tape ft0 at fdc0 drive 2
+
#
-# Other standard PC hardware: `lpt', `mse', `sio', etc.
+# Other standard PC hardware: `lpt', `mse', `psm', `sio', etc.
#
# lpt: printer port
# lpt specials:
-# The port may be specified as ?. This will cause the
-# driver to scan the BIOS port list.
-# The irq clause may be omitted. This will force the port
-# into polling mode.
+# port can be specified as ?, this will cause the driver to scan
+# the BIOS port list;
+# the irq and vector clauses may be omitted, this
+# will force the port into polling mode.
# mse: Logitech and ATI InPort bus mouse ports
+# psm: PS/2 mouse port [note: conflicts with sc0/vt0, thus "conflicts" keywd]
# sio: serial ports (see sio(4))
-device lpt0 at isa? port? tty irq 7
-device lpt1 at isa? port "IO_LPT3" tty irq 5
-device mse0 at isa? port 0x23c tty irq 5
+device lpt0 at isa? port? tty irq 7 vector lptintr
+device lpt1 at isa? port "IO_LPT3" tty irq 5 vector lptintr
+device mse0 at isa? port 0x23c tty irq 5 vector mseintr
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
-device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+# Options for psm:
+options PSM_HOOKAPM #hook the APM resume event, useful
+ #for some laptops
+options PSM_RESETAFTERSUSPEND #reset the device at the resume event
+
+device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
#
# `flags' for serial drivers that support consoles (only for sio now):
@@ -1107,7 +1045,6 @@ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
# 0x20 force this unit to be the console (unless there is another
# higher priority console). This replaces the COMCONSOLE option.
# 0x40 reserve this unit for low level console operations. Do not
-# access the device in any normal way.
#
# PnP `flags' (set via userconfig using pnp x flags y)
# 0x1 disable probing of this device. Used to prevent your modem
@@ -1122,6 +1059,7 @@ options CONSPEED=9600 #default speed for serial console (default 9600)
# Options for sio:
options COM_ESP #code for Hayes ESP
options COM_MULTIPORT #code for some cards with shared IRQs
+options DSI_SOFT_MODEM #code for DSI Softmodems
options "EXTRA_SIO=2" #number of extra sio ports to allocate
# Other flags for sio that aren't documented in the man page.
@@ -1137,13 +1075,11 @@ options "EXTRA_SIO=2" #number of extra sio ports to allocate
# ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503
# el: 3Com 3C501 (slow!)
# ep: 3Com 3C509 (buggy)
-# ex: Intel EtherExpress Pro/10 and other i82595-based adapters
# fe: Fujitsu MB86960A/MB86965A Ethernet
# ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; Intel EtherExpress
# le: Digital Equipment EtherWorks 2 and EtherWorks 3 (DEPCA, DE100,
# DE101, DE200, DE201, DE202, DE203, DE204, DE205, DE422)
-# lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 & Am79C960)
-# rdp: RealTek RTL 8002-based pocket ethernet adapters
+# lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL)
# sr: RISCom/N2 hdlc sync 1/2 port V.35/X.21 serial driver (requires sppp)
# wl: Lucent Wavelan (ISA card only).
# ze: IBM/National Semiconductor PCMCIA ethernet controller.
@@ -1152,27 +1088,27 @@ options "EXTRA_SIO=2" #number of extra sio ports to allocate
# attribute memory)
#
-device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000
-device cs0 at isa? port 0x300 net irq ?
-device cx0 at isa? port 0x240 net irq 15 drq 7
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device el0 at isa? port 0x300 net irq 9
-device ep0 at isa? port 0x300 net irq 10
-device ex0 at isa? port? net irq?
-device fe0 at isa? port 0x300 net irq ?
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x280 net irq 10 drq 0
-device rdp0 at isa? port 0x378 net irq 7 flags 2
-device sr0 at isa? port 0x300 net irq 5 iomem 0xd0000
+device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector arintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+device cx0 at isa? port 0x240 net irq 15 drq 7 vector cxintr
+device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr
+device eg0 at isa? port 0x310 net irq 5 vector egintr
+device el0 at isa? port 0x300 net irq 9 vector elintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector ieintr
+device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x300 net irq 10 drq 0 vector lncintr
+device sr0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector srintr
options WLCACHE # enables the signal-strength cache
options WLDEBUG # enables verbose debugging output
-device wl0 at isa? port 0x300 net irq ?
+device wl0 at isa? port 0x300 net irq ? vector wlintr
# We can (bogusly) include both the dedicated PCCARD drivers and the generic
# support when COMPILING_LINT.
-device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000
-device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000
+device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
#
# ATM related options
@@ -1218,10 +1154,9 @@ options NATM #native ATM
#
# pcm: PCM audio through various sound cards.
#
-# This has support for a large number of new audio cards, based on
-# CS423x, OPTi931, Yamaha OPL-SAx, and also for SB16, GusPnP.
-# For more information about this driver and supported cards,
-# see the pcm.4 man page and /sys/i386/isa/snd/CARDS.
+# This is the work in progress from Luigi Rizzo. This has support for
+# CS423x based cards, OPTi931, SB16 PnP, GusPnP. For more information
+# about this driver, take a look at sys/i386/isa/snd/README.
#
# The flags of the device tells the device a bit more info about the
# device that normally is obtained through the PnP interface.
@@ -1259,30 +1194,30 @@ options NATM #native ATM
# below for an alternate which may work better for some cards.
#
controller snd0
-device pas0 at isa? port 0x388 irq 10 drq 6
-device sb0 at isa? port 0x220 irq 5 drq 1
+device pas0 at isa? port 0x388 irq 10 drq 6 vector pasintr
+device sb0 at isa? port 0x220 irq 5 drq 1 vector sbintr
device sbxvi0 at isa? drq 5
device sbmidi0 at isa? port 0x330
device awe0 at isa? port 0x620
-device gus0 at isa? port 0x220 irq 12 drq 1
-#device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3
-device mss0 at isa? port 0x530 irq 10 drq 1
-device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08
-device sscape0 at isa? port 0x330 irq 9 drq 0
-device trix0 at isa? port 0x330 irq 6 drq 0
-device sscape_mss0 at isa? port 0x534 irq 5 drq 1
+device gus0 at isa? port 0x220 irq 12 drq 1 vector gusintr
+#device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3 vector gusintr
+device mss0 at isa? port 0x530 irq 10 drq 1 vector adintr
+device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr
+device sscape0 at isa? port 0x330 irq 9 drq 0 vector sscapeintr
+device trix0 at isa? port 0x330 irq 6 drq 0 vector sscapeintr
+device sscape_mss0 at isa? port 0x534 irq 5 drq 1 vector sndintr
device opl0 at isa? port 0x388
device mpu0 at isa? port 0x330 irq 6 drq 0
-device uart0 at isa? port 0x330 irq 5
+device uart0 at isa? port 0x330 irq 5 vector "m6850intr"
# Luigi's snd code (use INSTEAD of snd0 and all VOXWARE drivers!).
# You may also wish to enable the pnp controller with this, for pnp
# sound cards.
#
-#device pcm0 at isa? port ? tty irq 10 drq 1 flags 0x0
+#device pcm0 at isa? port ? tty irq 10 drq 1 flags 0x0 vector pcmintr
# Not controlled by `snd'
-device pca0 at isa? port "IO_TIMER1" tty
+device pca0 at isa? port IO_TIMER1 tty
#
# Miscellaneous hardware:
@@ -1296,6 +1231,7 @@ device pca0 at isa? port "IO_TIMER1" tty
# spigot: The Creative Labs Video Spigot video-acquisition board
# meteor: Matrox Meteor video capture board
# bktr: Brooktree bt848/848a/849/878/879 family video capture and TV Tuner board
+# alog: Industrial Computer Source AIO8-P driver
# cy: Cyclades serial driver
# dgb: Digiboard PC/Xi and PC/Xe series driver (ALPHA QUALITY!)
# dgm: Digiboard PC/Xem driver
@@ -1389,33 +1325,34 @@ device pca0 at isa? port "IO_TIMER1" tty
# Brumby: flags 2 iosiz 0x4000
# Stallion: flags 1 iosiz 0x10000
-device mcd0 at isa? port 0x300 bio irq 10
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
# for the Sony CDU31/33A CDROM
device scd0 at isa? port 0x230 bio
# for the SoundBlaster 16 multicd - up to 4 devices
controller matcd0 at isa? port 0x230 bio
-device wt0 at isa? port 0x300 bio irq 5 drq 1
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
device ctx0 at isa? port 0x230 iomem 0xd0000
-device spigot0 at isa? port 0xad6 irq 15 iomem 0xee000
+device spigot0 at isa? port 0xad6 irq 15 iomem 0xee000 vector spigintr
device apm0 at isa?
device gp0 at isa? port 0x2c0 tty
device gsc0 at isa? port "IO_GSC1" tty drq 3
-device joy0 at isa? port IO_GAME
-device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
-options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared
+device joy0 at isa? port "IO_GAME"
+device alog0 at isa? port 0x260 tty irq 5 vector alogintr
+device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000 vector cyintr
device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? tty
device dgm0 at isa? port 0x104 iomem 0xd00000 iosiz ? tty
-device labpc0 at isa? port 0x260 tty irq 5
-device rc0 at isa? port 0x220 tty irq 12
+device labpc0 at isa? port 0x260 tty irq 5 vector labpcintr
+device rc0 at isa? port 0x220 tty irq 12 vector rcintr
device rp0 at isa? port 0x280 tty
# the port and irq for tw0 are fictitious
-device tw0 at isa? port 0x380 tty irq 11
+device tw0 at isa? port 0x380 tty irq 11 vector twintr
device si0 at isa? iomem 0xd0000 tty irq 12
-device asc0 at isa? port "IO_ASC1" tty drq 3 irq 10
-device stl0 at isa? port 0x2a0 tty irq 10
+device asc0 at isa? port IO_ASC1 tty drq 3 irq 10 vector ascintr
+device bqu0 at isa? port 0x150
+device stl0 at isa? port 0x2a0 tty irq 10 vector stlintr
device stli0 at isa? port 0x2a0 tty iomem 0xcc000 flags 23 iosiz 0x1000
# You are unlikely to have the hardware for loran0 <phk@FreeBSD.org>
-device loran0 at isa? port ? tty irq 5
+device loran0 at isa? port ? tty irq 5 vector loranintr
# HOT1 Xilinx 6200 card (www.vcc.com)
device xrpu0
@@ -1468,9 +1405,11 @@ options "EISA_SLOTS=12"
# nd 1040B PCI SCSI host adapters, as well as the Qlogic ISP 2100
# FC/AL Host Adapter.
#
-# The `ax' device provides support for PCI fast ethernet adapters
-# based on the ASIX Electronics AX88140A chip, including the Alfa
-# Inc. GFC2204.
+# The `amd' device provides support for the Tekram DC-390 and 390T
+# SCSI host adapters, but is expected to work with any AMD 53c974
+# PCI SCSI chip and the AMD Ethernet+SCSI Combo chip, after some
+# local patches were applied to the sources (that had originally
+# been written by Tekram and limited to work with their SCSI cards).
#
# The `de' device provides support for the Digital Equipment DC21040
# self-contained Ethernet adapter.
@@ -1478,22 +1417,6 @@ options "EISA_SLOTS=12"
# The `fxp' device provides support for the Intel EtherExpress Pro/100B
# PCI Fast Ethernet adapters.
#
-# The `mx' device provides support for various fast ethernet adapters
-# based on the Macronix 98713, 987615 ans 98725 series chips.
-#
-# The `pn' device provides support for various fast ethernet adapters
-# based on the Lite-On 82c168 and 82c169 PNIC chips, including the
-# LinkSys LNE100TX, the NetGear FA310TX rev. D1 and the Matrox
-# FastNIC 10/100.
-#
-# The 'rl' device provides support for PCI fast ethernet adapters based
-# on the RealTek 8129/8139 chipset. Note that the RealTek driver defaults
-# to useing programmed I/O to do register accesses because memory mapped
-# mode seems to cause severe lockups on SMP hardware. This driver also
-# supports the Accton EN1207D `Cheetah' adapter, which uses a chip called
-# the MPX 5030/5038, which is either a RealTek in disguise or a RealTek
-# workalike.
-#
# The 'tl' device provides support for the Texas Instruments TNETE100
# series 'ThunderLAN' cards and integrated ethernet controllers. This
# includes several Compaq Netelligent 10/100 cards and the built-in
@@ -1503,18 +1426,10 @@ options "EISA_SLOTS=12"
#
# The `tx' device provides support for the SMC 9432TX cards.
#
-# The `vr' device provides support for various fast ethernet adapters
-# based on the VIA Technologies VT3043 `Rhine I' and VT86C100A `Rhine II'
-# chips, including the D-Link DFE530TX.
-#
# The `vx' device provides support for the 3Com 3C590 and 3C595
# early support
#
-# The `wb' device provides support for various fast ethernet adapters
-# based on the Winbond W89C840F chip. Note: this is not the same as
-# the Winbond W89C940F, which is an NE2000 clone.
-#
-# The `xl' device provides support for the 3Com 3c900, 3c905 and
+# The `xl' driver provides support for the 3Com 3c900, 3c905 and
# 3c905B (Fast) Etherlink XL cards and integrated controllers. This
# includes the integrated 3c905B-TX chips in certain Dell Optiplex and
# Dell Precision desktop machines and the integrated 3c905-TX chips
@@ -1559,26 +1474,15 @@ controller pci0
controller ahc1
controller ncr0
controller isp0
-device ax0
+#!CAM# controller amd0
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
device xl0
device fpa0
device meteor0
-
-# Brooktree driver has been ported to the new I2C framework. Thus,
-# you'll need at least iicbus, iicbb and smbus. iic/smb are only needed if you
-# want to control other I2C slaves connected to the external connector of
-# some cards.
-#
device bktr0
#
@@ -1619,8 +1523,7 @@ options POWERFAIL_NMI # make it beep instead of panicing
# smb standard io
#
# Supported interfaces:
-# iicsmb I2C to SMB bridge with any iicbus interface
-# bktr brooktree848 I2C hardware interface
+# iicsmb I2C to SMB bridge
#
controller smbus0
@@ -1638,135 +1541,16 @@ device smb0 at smbus?
#
# Supported interfaces:
# pcf Philips PCF8584 ISA-bus controller
-# bktr brooktree848 I2C software interface
-#
-# Other:
-# iicbb generic I2C bit-banging code (needed by lpbb, bktr)
#
controller iicbus0
-controller iicbb0
device ic0 at iicbus?
device iic0 at iicbus?
device iicsmb0 at iicbus?
-controller pcf0 at isa? port 0x320 net irq 5
+controller pcf0 at isa? port 0x320 net irq 5 vector pcfintr
-# ISDN4BSD section
-
-# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver)
-# note that the ``options'' and ``device'' lines must BOTH be defined !
-#
-# Non-PnP Cards:
-# --------------
-#
-# Teles S0/8 or Niccy 1008
-options "TEL_S0_8"
-#device isic0 at isa? iomem 0xd0000 net irq 5 flags 1
-#
-# Teles S0/16 or Creatix ISDN-S0 or Niccy 1016
-options "TEL_S0_16"
-#device isic0 at isa? port 0xd80 iomem 0xd0000 net irq 5 flags 2
-#
-# Teles S0/16.3
-options "TEL_S0_16_3"
-#device isic0 at isa? port 0xd80 net irq 5 flags 3
-#
-# AVM A1 or AVM Fritz!Card
-options "AVM_A1"
-#device isic0 at isa? port 0x340 net irq 5 flags 4
-#
-# USRobotics Sportster ISDN TA intern
-options "USR_STI"
-#device isic0 at isa? port 0x268 net irq 5 flags 7
-#
-# ITK ix1 Micro
-options "ITKIX1"
-#device isic0 at isa? port 0x398 net irq 10 flags 18
-#
-# PnP-Cards:
-# ----------
-#
-# Teles S0/16.3 PnP
-options "TEL_S0_16_3_P"
-#device isic0 at isa? port ? net irq ?
-#
-# Creatix ISDN-S0 P&P
-options "CRTX_S0_P"
-#device isic0 at isa? port ? net irq ?
-#
-# Dr. Neuhaus Niccy Go@
-options "DRN_NGO"
-#device isic0 at isa? port ? net irq ?
-#
-# Sedlbauer Win Speed
-options "SEDLBAUER"
-#device isic0 at isa? port ? net irq ?
-#
-# Dynalink IS64PH
-options "DYNALINK"
-#device isic0 at isa? port ? net irq ?
-#
-# ELSA QuickStep 1000pro ISA
-options "ELSA_QS1ISA"
-#device isic0 at isa? port ? net irq ?
-#
-# PCI-Cards:
-# ----------
-#
-# ELSA QuickStep 1000pro PCI
-options "ELSA_QS1PCI"
-#device isic0
-#
-# PCMCIA-Cards:
-# -------------
#
-# AVM PCMCIA Fritz!Card
-options "AVM_A1_PCMCIA"
-device isic0 at isa? port 0x340 net irq 5 flags 10
-#
-# Active Cards:
-# -------------
-#
-# Stollmann Tina-dd control device
-device tina0 at isa? port 0x260 net irq 10
-#
-# ISDN Protocol Stack
-# -------------------
-#
-# Q.921 / layer 2 - i4b passive cards D channel handling
-pseudo-device "i4bq921"
-#
-# Q.931 / layer 3 - i4b passive cards D channel handling
-pseudo-device "i4bq931"
-#
-# layer 4 - i4b common passive and active card handling
-pseudo-device "i4b"
-#
-# ISDN devices
-# ------------
-#
-# userland driver to do ISDN tracing (for passive cards only)
-pseudo-device "i4btrc" 4
-#
-# userland driver to control the whole thing
-pseudo-device "i4bctl"
-#
-# userland driver for access to raw B channel
-pseudo-device "i4brbch" 4
-#
-# userland driver for telephony
-pseudo-device "i4btel" 2
-#
-# network driver for IP over raw HDLC ISDN
-pseudo-device "i4bipr" 4
-# enable VJ header compression detection for ipr i/f
-options IPR_VJ
-#
-# network driver for sync PPP over ISDN
-pseudo-device "i4bisppp" 4
-
-
# Parallel-Port Bus
#
# Parallel port bus support is provided by the `ppbus' device.
@@ -1781,7 +1565,6 @@ pseudo-device "i4bisppp" 4
# plip Parallel network interface
# ppi General-purpose I/O ("Geek Port")
# pps Pulse per second Timing Interface
-# lpbb Philips official parallel port I2C bit-banging interface
#
# Supported interfaces:
# ppc ISA-bus parallel port interfaces.
@@ -1792,9 +1575,8 @@ device nlpt0 at ppbus?
device plip0 at ppbus?
device ppi0 at ppbus?
device pps0 at ppbus?
-device lpbb0 at ppbus?
-controller ppc0 at isa? disable port ? tty irq 7
+controller ppc0 at isa? disable port ? tty irq 7 vector ppcintr
# Kernel BOOTP support
@@ -1837,21 +1619,6 @@ options "PMAP_SHPGPERPROC=201"
#
#options NO_SWAPPING
-# Set the number of sf_bufs to allocate. sf_bufs are virtual buffers
-# for sendfile(2) that are used to map file VM pages, and normally
-# default to a quantity that is roughly 16*MAXUSERS+512. You would
-# typically want about 4 of these for each simultaneous file send.
-#
-options "NSFBUFS=1024"
-
-#
-# Enable extra debugging code for locks. This include storing the
-# filename and line of whatever aquired the lock in the lock itself,
-# and changing a number of function calls to pass around the relevant
-# data. This is not at all useful unless you are debugging lock code.
-#
-options DEBUG_LOCKS
-
# More undocumented options for linting.
options CLK_CALIBRATION_LOOP
@@ -1861,7 +1628,6 @@ options CLUSTERDEBUG
options COMPAT_LINUX
options CPU_UPGRADE_HW_CACHE
options DEBUG
-options DEBUG_VFS_LOCKS
options "DEBUG_1284"
#options DISABLE_PSE
options "EXT2FS"
@@ -1918,7 +1684,6 @@ options SHMSEG=9
options SI_DEBUG
options SIMPLELOCK_DEBUG
options SPX_HACK
-options VFS_BIO_DEBUG
# The 'dpt' driver provides support for DPT controllers (http://www.dpt.com/).
# These have hardware RAID-{0,1,5} support, and do multi-initiator I/O.
@@ -1977,35 +1742,3 @@ options DPT_RESET_HBA
# Don't EVER set this without having talked to Simon Shapiro on the phone
# first.
options DPT_SHUTDOWN_SLEEP=500
-
-# USB support
-# UHCI controller
-controller uhci0
-# OHCI controller
-controller ohci0
-# General USB code (mandatory for USB)
-controller usb0
-#
-# for the moment we have to specify the priorities of the device
-# drivers explicitly by the ordering in the list below. This will
-# be changed in the future.
-#
-# USB mouse
-device ums0
-# USB keyboard
-device ukbd0
-# USB printer
-device ulpt0
-# USB hub (kind of mandatory, no other driver is available for the root hub)
-device uhub0
-# USB communications driver
-device ucom0
-# USB modem driver
-device umodem0
-# Human Interface Device (anything with buttons and dials)
-device hid0
-# Generic USB device driver
-device ugen0
-#
-options USB_DEBUG
-options USBVERBOSE
diff --git a/sys/i386/conf/LKM b/sys/i386/conf/LKM
index d29ac86e7884..4e123a617455 100644
--- a/sys/i386/conf/LKM
+++ b/sys/i386/conf/LKM
@@ -2,7 +2,7 @@
# LKM - verification kernel for LKMs. This is not intended to be run
# on any real hardware, only to make it possible to test-link LKMs.
#
-# $Id: LKM,v 1.2 1998/10/22 12:23:04 bde Exp $
+# $Id$
#
##
@@ -23,7 +23,7 @@ options FFS
# missing NPX...
controller isa0
# npx is mandated by config(8)
-device npx0 at isa? port IO_NPX irq 13
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
##
# Requirements for various LKMs
@@ -32,7 +32,7 @@ device npx0 at isa? port IO_NPX irq 13
#
# Options required for the ATAPI LKM
#
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
options ATAPI
@@ -59,13 +59,13 @@ controller card0
# Cascading requirement from card0 - any device that have a DATA_SET of
# pccarddrv_set
-device sio0 at isa? port "IO_COM1" tty irq 4
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
#
# For the screensavers
#
-device sc0 at isa? port IO_KBD tty irq 1
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
#
diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386
index 226f7475e625..449064d45cf2 100644
--- a/sys/i386/conf/Makefile.i386
+++ b/sys/i386/conf/Makefile.i386
@@ -1,7 +1,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.i386,v 1.135 1999/01/17 21:17:27 peter Exp $
+# $Id: Makefile.i386,v 1.125 1998/09/30 12:14:39 peter Exp $
#
# Makefile for FreeBSD
#
@@ -17,9 +17,9 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
-KERNFORMAT?= elf
+KERNFORMAT?= aout
STD8X16FONT?= iso
@@ -74,8 +74,8 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_S= ${CC} -c -x ${ASM_CFLAGS} $<
PROFILE_C= ${CC} -c ${CFLAGS} $<
-GEN_CFILES= ${I386}/i386/genassym.c
-# setdef0.c and setdef1.c are intentionally
+GEN_CFILES= ${I386}/i386/genassym.c ${I386}/i386/gensetdefs.c
+# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally
# omitted from SYSTEM_CFILES. They include setdefs.h, a header which
# is generated from all of ${OBJS}. We don't want to have to compile
# everything just to do a make depend.
@@ -86,7 +86,14 @@ SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS}
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET}
-.if ${KERNFORMAT} == aout || ${KERNFORMAT} == aoutkld
+.if ${KERNFORMAT} == aout
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
+SYSTEM_LD= @${LD} -aout -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL= @echo rearranging symbols; \
+ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \
+ size -aout ${.TARGET} ; chmod 755 ${.TARGET}
+.endif
+.if ${KERNFORMAT} == aoutkld
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
SYSTEM_LD= @${LD} -aout -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @echo rearranging symbols; \
@@ -94,8 +101,9 @@ SYSTEM_LD_TAIL= @echo rearranging symbols; \
size -aout ${.TARGET} ; chmod 755 ${.TARGET}
.endif
.if ${KERNFORMAT} == elf
+# kld compatable export of symbols.
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} -elf -Bdynamic -T $S/i386/conf/kernel.script \
-export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
@@ -117,14 +125,9 @@ SYSTEM_DEP+= $S/i386/conf/kernel.script
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
- rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \
- kernel linterrs makelinks param.c setdef[01].c setdefs.h \
- symbols.exclude symbols.sort tags \
+ rm -f *.o *.so *.ko *.s eddep errs genassym gensetdefs kernel linterrs \
+ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
vers.c vnode_if.c vnode_if.h ${CLEAN}
#lint: /tmp param.c
@@ -148,21 +151,26 @@ locore.o: ${I386}/i386/locore.s assym.s
# This is a hack. BFD "optimizes" away dynamic mode if there are no
# dynamic references. We could probably do a '-Bforcedynamic' mode like
# in the a.out ld. For now, this works.
-hack.So: Makefile
+hack.so: Makefile
touch hack.c
- ${CC} -elf -shared -nostdlib hack.c -o hack.So
+ ${CC} -elf -shared -nostdlib hack.c -o hack.so
rm -f hack.c
.endif
-setdef0.o: setdef0.c setdefs.h
+setdef0.o: ${I386}/i386/setdef0.c setdefs.h
${NORMAL_C}
-setdef1.o: setdef1.c setdefs.h
+setdef1.o: ${I386}/i386/setdef1.c setdefs.h
${NORMAL_C}
-setdef0.c setdef1.c setdefs.h: ${OBJS}
- @echo generating linker set emulation glue for ELF
- @gensetdefs ${OBJS}
+setdefs.h: gensetdefs ${OBJS}
+ ./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} ${GEN_CFLAGS} gensetdefs.o -o ${.TARGET}
+
+gensetdefs.o: ${I386}/i386/gensetdefs.c
+ ${CC} -c ${GEN_CFLAGS} ${I386}/i386/gensetdefs.c
# this rule stops ./assym.s in .depend from causing problems
./assym.s: assym.s
@@ -176,7 +184,7 @@ genassym.o: ${I386}/i386/genassym.c
genassym: genassym.o
${CC} ${GEN_CFLAGS} genassym.o -o ${.TARGET}
-${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
+${SYSTEM_OBJS} genassym.o gensetdefs.o vers.o: opt_global.h
# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical.
depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND}
@@ -207,16 +215,6 @@ install:
echo "You must first build your kernel before trying to install." ; \
exit 1 ; \
fi
-.if ${KERNFORMAT} == "elf" && !defined(FORCE)
- @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \
- echo "WARNING: You are about to install an ELF kernel for the first time!" ; \
- echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \
- echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \
- echo "http://www.freebsd.org/~peter/elfday.html for information." ; \
- echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \
- exit 1 ; \
- fi
-.endif
.if exists(${DESTDIR}/kernel)
chflags noschg ${DESTDIR}/kernel
mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old
diff --git a/sys/i386/conf/PCCARD b/sys/i386/conf/PCCARD
new file mode 100644
index 000000000000..ef0b6e7ae7fe
--- /dev/null
+++ b/sys/i386/conf/PCCARD
@@ -0,0 +1,114 @@
+#
+# PCCARD -- GENERIC laptop support
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: PCCARD,v 1.6 1998/09/25 17:34:48 peter Exp $
+
+machine "i386"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident PCCARD
+maxusers 10
+
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+#controller aic0 at isa? port 0x340 cam irq 11 vector aicintr
+
+#controller scbus0
+
+#device da0
+
+#device sa0
+
+#device cd0 #Only need one of these, the code dynamically grows
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+controller card0
+device pcic0 at card?
+device pcic1 at card?
+
+options PCIC_RESUME_RESET # reset after resume
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+options PSM_HOOKAPM #hook the APM resume event
+options PSM_RESETAFTERSUSPEND #reset the device at the resume event
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+# iijppp uses tun instead of ppp device
+#pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/i386/conf/SMP-GENERIC b/sys/i386/conf/SMP-GENERIC
new file mode 100644
index 000000000000..c31ed1cccb39
--- /dev/null
+++ b/sys/i386/conf/SMP-GENERIC
@@ -0,0 +1,201 @@
+#
+# SMP-GENERIC -- Smp machine with WD/AHx/NCR/BTx family disks
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: SMP-GENERIC,v 1.16 1998/09/25 17:34:48 peter Exp $
+
+machine "i386"
+# SMP does NOT support 386/486 CPUs.
+#cpu "I386_CPU"
+#cpu "I486_CPU"
+
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident SMP-GENERIC
+maxusers 32
+
+# Create a SMP capable kernel (mandatory options):
+options SMP # Symmetric MultiProcessor Kernel
+options APIC_IO # Symmetric (APIC) I/O
+
+# Optional, these are the defaults:
+#options NCPU=2 # number of CPUs
+#options NBUS=4 # number of busses
+#options NAPIC=1 # number of IO APICs
+#options NINTR=24 # number of INTs
+
+# Lets always enable the kernel debugger for SMP.
+options DDB
+
+# SMP shouldn't need x87 emulation, disable by default.
+#options MATH_EMULATE #Support for x87 emulation
+
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options FFS_ROOT #FFS usable as root device [keep this!]
+options MFS #Memory Filesystem
+options MFS_ROOT #MFS usable as root device, "MFS" req'ed
+options NFS #Network Filesystem
+options NFS_ROOT #NFS usable as root device, "NFS" req'ed
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root. "CD9660" req'ed
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller eisa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+disk wd1 at wdc0 drive 1
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+disk wd2 at wdc1 drive 0
+disk wd3 at wdc1 drive 1
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+device wfd0 #IDE Floppy (e.g. LS-120)
+
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
+# sufficient for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahb0
+controller ahc0
+controller isp0
+
+# This controller offers a number of configuration options, too many to
+# document here - see the LINT file in this directory and look up the
+# dpt0 entry there for much fuller documentation on this.
+controller dpt0
+
+controller adv0 at isa? port ? cam irq ?
+controller adw0
+controller bt0 at isa? port ? cam irq ?
+controller aha0 at isa? port ? cam irq ?
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
+
+controller matcd0 at isa? port 0x230 bio
+
+device scd0 at isa? port 0x230 bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
+# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
+#options XSERVER # support for X server
+#options FAT_CURSOR # start with block cursor
+# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
+#options PCVT_SCANSET=2 # IBM keyboards are non-std
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
+
+# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be
+# aware of the legal and administrative consequences of enabling this
+# option. The number of devices determines the maximum number of
+# simultaneous BPF clients programs runnable.
+#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/i386/conf/devices.i386 b/sys/i386/conf/devices.i386
index b8d866441c5f..ccba4ecc30b1 100644
--- a/sys/i386/conf/devices.i386
+++ b/sys/i386/conf/devices.i386
@@ -1,6 +1,6 @@
# This file tells what major numbers the various possible swap devices have.
#
-# $Id: devices.i386,v 1.14 1998/09/15 10:01:13 gibbs Exp $
+# $Id: devices.i386,v 1.13 1998/02/17 11:33:31 sos Exp $
#
wd 0
wfd 1
@@ -13,5 +13,5 @@ mcd 7
vn 15
scd 16
pcd 17
-acd 19
+wcd 19
wst 24
diff --git a/sys/i386/conf/files.i386 b/sys/i386/conf/files.i386
index 6993be0c5023..a343f19635fb 100644
--- a/sys/i386/conf/files.i386
+++ b/sys/i386/conf/files.i386
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $Id: files.i386,v 1.219 1999/01/19 11:31:22 yokota Exp $
+# $Id: files.i386,v 1.205 1998/09/20 06:04:55 bde Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -24,17 +24,6 @@ font8x16.o optional std8x16font \
no-implicit-rule before-depend \
clean "${STD8X16FONT}-8x16 font8x16.c"
#
-dev/fb/fb.c optional fb device-driver
-dev/fb/fb.c optional vga device-driver
-dev/fb/splash.c optional splash
-dev/kbd/atkbd.c optional atkbd device-driver
-dev/kbd/atkbdc.c optional atkbdc device-driver
-dev/kbd/kbd.c optional atkbd device-driver
-dev/kbd/kbd.c optional kbd device-driver
-#dev/kbd/kbd.c optional ukbd device-driver
-dev/syscons/syscons.c optional sc device-driver
-dev/syscons/scvidctl.c optional sc device-driver
-dev/syscons/scvesactl.c optional sc device-driver
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
i386/eisa/dpt_eisa.c optional eisa dpt device-driver
@@ -108,8 +97,8 @@ i386/isa/adv_isa.c optional adv device-driver
i386/isa/aha_isa.c optional aha device-driver
#i386/isa/aic6360.c optional aic device-driver
i386/isa/aic_isa.c optional aic device-driver
-i386/isa/atkbd_isa.c optional atkbd device-driver
-i386/isa/atkbdc_isa.c optional atkbdc device-driver
+i386/isa/alog.c optional alog device-driver
+i386/isa/b004.c optional bqu device-driver
i386/isa/bt_isa.c optional bt device-driver
i386/isa/clock.c standard
i386/isa/cronyx.c optional cx device-driver
@@ -120,6 +109,7 @@ i386/isa/diskslice_machdep.c standard
i386/isa/elink.c optional ep device-driver
i386/isa/elink.c optional ie device-driver
i386/isa/fd.c optional fd device-driver
+i386/isa/ft.c optional ft device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/asc.c optional asc device-driver
i386/isa/gsc.c optional gsc device-driver
@@ -127,6 +117,7 @@ i386/isa/if_ar.c optional ar device-driver
i386/isa/if_cs.c optional cs device-driver
i386/isa/if_cx.c optional cx device-driver
i386/isa/if_ed.c optional ed device-driver
+i386/isa/if_eg.c optional eg device-driver
i386/isa/if_el.c optional el device-driver
i386/isa/if_ep.c optional ep device-driver
i386/isa/if_ex.c optional ex device-driver
@@ -134,7 +125,6 @@ i386/isa/if_fe.c optional fe device-driver
i386/isa/if_ie.c optional ie device-driver
i386/isa/if_le.c optional le device-driver
i386/isa/if_lnc.c optional lnc device-driver
-i386/isa/if_rdp.c optional rdp device-driver
i386/isa/if_sr.c optional sr device-driver
i386/isa/if_wl.c optional wl device-driver
i386/isa/if_ze.c optional ze device-driver
@@ -145,11 +135,15 @@ i386/isa/intr_machdep.c standard
i386/isa/isa.c optional isa device-driver
i386/isa/istallion.c optional stli device-driver
i386/isa/joy.c optional joy device-driver
+i386/isa/kbdio.c optional psm device-driver
+i386/isa/kbdio.c optional sc device-driver
+i386/isa/kbdio.c optional vt device-driver
i386/isa/loran.c optional loran device-driver
i386/isa/lpt.c optional lpt device-driver
i386/isa/labpc.c optional labpc device-driver
i386/isa/mcd.c optional mcd device-driver
i386/isa/mse.c optional mse device-driver
+#i386/isa/ncr5380.c optional nca device-driver
i386/isa/npx.c mandatory npx device-driver
i386/isa/pcaudio.c optional pca device-driver
i386/isa/matcd/matcd.c optional matcd device-driver
@@ -171,6 +165,7 @@ i386/isa/random_machdep.c standard
i386/isa/rc.c optional rc device-driver
i386/isa/rp.c optional rp device-driver
i386/isa/scd.c optional scd device-driver
+#i386/isa/seagate.c optional sea device-driver
i386/isa/si.c optional si device-driver
i386/isa/si2_z280.c optional si device-driver
i386/isa/si3_t225.c optional si device-driver
@@ -244,16 +239,21 @@ i386/isa/sound/cs4232.c optional css device-driver
i386/isa/spigot.c optional spigot device-driver
i386/isa/spkr.c optional speaker device-driver
i386/isa/stallion.c optional stl device-driver
-i386/isa/syscons_isa.c optional sc device-driver
-i386/isa/vesa.c optional vga device-driver
-i386/isa/vga_isa.c optional vga device-driver
+i386/isa/syscons.c optional sc device-driver
+i386/isa/scvidctl.c optional sc device-driver
+i386/isa/scvesactl.c optional sc device-driver
+i386/isa/videoio.c optional sc device-driver
+i386/isa/vesa.c optional sc device-driver
i386/isa/tw.c optional tw device-driver
+#i386/isa/ultra14f.c optional uha device-driver
i386/isa/wd.c optional wdc device-driver
i386/isa/wd.c optional wd device-driver
i386/isa/atapi.c optional atapi device-driver
i386/isa/atapi-cd.c optional acd device-driver
+i386/isa/wcd.c optional wcd device-driver
i386/isa/wfd.c optional wfd device-driver
i386/isa/wst.c optional wst device-driver
+i386/isa/wd7000.c optional wds device-driver
i386/isa/wt.c optional wt device-driver
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
@@ -269,30 +269,6 @@ i386/linux/linux_stats.c optional compat_linux
i386/linux/linux_sysent.c optional compat_linux
i386/linux/linux_sysvec.c optional compat_linux
i386/linux/linux_util.c optional compat_linux
-i4b/layer1/i4b_isic.c optional isic device-driver
-i4b/layer1/i4b_isic_isa.c optional isic device-driver
-i4b/layer1/i4b_isic_pnp.c optional isic device-driver
-i4b/layer1/i4b_isic_pci.c optional isic device-driver
-i4b/layer1/i4b_isic_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_isac.c optional isic device-driver
-i4b/layer1/i4b_hscx.c optional isic device-driver
-i4b/layer1/i4b_l1.c optional isic device-driver
-i4b/layer1/i4b_l1fsm.c optional isic device-driver
-i4b/layer1/i4b_bchan.c optional isic device-driver
-i4b/layer1/i4b_tel_s08.c optional isic device-driver
-i4b/layer1/i4b_tel_s016.c optional isic device-driver
-i4b/layer1/i4b_tel_s0163.c optional isic device-driver
-i4b/layer1/i4b_tel_s0P.c optional isic device-driver
-i4b/layer1/i4b_ctx_s0P.c optional isic device-driver
-i4b/layer1/i4b_avm_a1.c optional isic device-driver
-i4b/layer1/i4b_avm_fritz_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_usr_sti.c optional isic device-driver
-i4b/layer1/i4b_itk_ix1.c optional isic device-driver
-i4b/layer1/i4b_drn_ngo.c optional isic device-driver
-i4b/layer1/i4b_sws.c optional isic device-driver
-i4b/layer1/i4b_dynalink.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1i.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1p.c optional isic device-driver
libkern/bcd.c standard
libkern/divdi3.c standard
libkern/inet_ntoa.c standard
@@ -347,5 +323,4 @@ gnu/i386/fpemul/wm_sqrt.s optional gpl_math_emulate
gnu/i386/isa/dgb.c optional dgb device-driver
gnu/i386/isa/dgm.c optional dgm device-driver
gnu/i386/isa/sound/awe_wave.c optional awe device-driver
-pci/es1370.c optional pcm device-driver
pci/ide_pci.c optional wd device-driver
diff --git a/sys/i386/conf/majors.i386 b/sys/i386/conf/majors.i386
index 822d908cf0b5..7b56d1d9cdc4 100644
--- a/sys/i386/conf/majors.i386
+++ b/sys/i386/conf/majors.i386
@@ -1,4 +1,4 @@
-$Id: majors.i386,v 1.64 1999/01/14 03:47:55 msmith Exp $
+$Id: majors.i386,v 1.49 1998/09/15 10:01:14 gibbs Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -32,7 +32,7 @@ blkdev name comments
16 scd Sony CDROM interface
17 matcd Matsushita/Panasonic/Creative(SB) CDROM interface
18 ata "device independent" ATA/IDE driver
-19 acdb ATAPI CDROM client of "ata"
+19 wcdb ATAPI CDROM client of "ata"
21 ccd concatenated disk
22 gd Geometry disk.
24 wstb ATAPI tape client of "ata"
@@ -40,9 +40,6 @@ blkdev name comments
26 sw VM internal swap device
27 myx Mylex RAID (ulf@alameda.net)
28 fla M-Systems DiskOnChip(r)
-29 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-100 ?? entries from 100-127 are reserved for local use
-127 ?? entries from 100-127 are reserved for local use
chrdev name comments
0 cn console
@@ -114,7 +111,7 @@ chrdev name comments
66 labpc National Instruments LabPC
67 meteor Matrox Meteor video capture
68 si Specialix SI/XIO (peter@freebsd.org)
-69 acd ATAPI CDROM client of "ata"
+69 wcd ATAPI CDROM client of "ata"
71 asc AmiScan driver
72 stl Stallion (cd1400 based) (gerg@stallion.oz.au)
73 ?? was qcam
@@ -128,9 +125,9 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
-86 alog Industrial Computer Source AIO8-P driver (deprecated)
+86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
88 dpt DPT RAID Controller <shimon@i-connect.net>
89 pps Pulse-Per-Second timing interface
@@ -152,12 +149,3 @@ chrdev name comments
105 iic I2C bus generic i/o
106 smb System Management Bus generic i/o
107 3dfx 3Dfx driver (shocking@prth.pgs.com)
-108 usb Universal Serial Bus (nick.hibma@jrc.it)
-109 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-111 ums USB Mouse (nick.hibma@jrc.it)
-112 kbd keyboard
-113 ulpt USB Printer (nick.hibma@jrc.it)
-114 ugen USB Generic device (nick.hibma@jrc.it)
-200 ?? entries from 200-255 are reserved for local use
-255 ?? entries from 200-255 are reserved for local use
diff --git a/sys/i386/conf/options.i386 b/sys/i386/conf/options.i386
index 2704d563788d..9cb9eb8c9e02 100644
--- a/sys/i386/conf/options.i386
+++ b/sys/i386/conf/options.i386
@@ -1,7 +1,6 @@
-# $Id: options.i386,v 1.102 1999/01/10 17:41:33 nsouch Exp $
+# $Id: options.i386,v 1.89 1998/09/25 17:34:48 peter Exp $
DISABLE_PSE
-IDE_DELAY
USER_LDT
MATH_EMULATE opt_math_emulate.h
GPL_MATH_EMULATE opt_math_emulate.h
@@ -14,8 +13,6 @@ LINUX opt_dontuse.h
DEBUG_LINUX opt_linux.h
-PPC_DEBUG opt_ppc.h
-
SHOW_BUSYBUFS
TUNE_1542
PANIC_REBOOT_WAIT_TIME opt_panic.h
@@ -28,13 +25,19 @@ BREAK_TO_DEBUGGER opt_comconsole.h
CONSPEED opt_comconsole.h
COM_ESP opt_sio.h
COM_MULTIPORT opt_sio.h
+DSI_SOFT_MODEM opt_sio.h
EXTRA_SIO opt_sio.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
-# i386 SMP options
+# These two SMP options have dramatic implications all over the kernel
+SMP opt_global.h
APIC_IO opt_global.h
+
+# Standard SMP options
+NCPU opt_smp.h
+NBUS opt_smp.h
NAPIC opt_smp.h
NINTR opt_smp.h
@@ -58,7 +61,6 @@ CPU_UPGRADE_HW_CACHE opt_cpu.h
CPU_WT_ALLOC opt_cpu.h
CYRIX_CACHE_WORKS opt_cpu.h
CYRIX_CACHE_REALLY_WORKS opt_cpu.h
-NO_MEMORY_HOLE opt_cpu.h
# The CPU type affects the endian conversion functions all over the kernel.
I386_CPU opt_global.h
@@ -66,26 +68,16 @@ I486_CPU opt_global.h
I586_CPU opt_global.h
I686_CPU opt_global.h
+SC_SPLASH_SCREEN opt_syscons.h
MAXCONS opt_syscons.h
-# obsolete, use VGA_SLOW_IOACCESS
-#SLOW_VGA opt_syscons.h
+SLOW_VGA opt_syscons.h
STD8X16FONT opt_syscons.h
SC_HISTORY_SIZE opt_syscons.h
SC_DISABLE_REBOOT opt_syscons.h
SC_MOUSE_CHAR opt_syscons.h
-# obsolete, use VGA_ALT_SEQACCESS
-#SC_ALT_SEQACCESS opt_syscons.h
-
-FB_INSTALL_CDEV opt_fb.h
-
-VGA_ALT_SEQACCESS opt_vga.h
-VGA_DEBUG opt_vga.h
-VGA_NO_FONT_LOADING opt_vga.h
-VGA_NO_MODE_CHANGE opt_vga.h
-VGA_SLOW_IOACCESS opt_vga.h
+SC_ALT_SEQACCESS opt_syscons.h
VESA opt_vesa.h
-VESA_DEBUG opt_vesa.h
PSM_HOOKAPM opt_psm.h
PSM_RESETAFTERSUSPEND opt_psm.h
@@ -93,11 +85,10 @@ PSM_DEBUG opt_psm.h
PCIC_RESUME_RESET opt_pcic.h
-KBD_INSTALL_CDEV opt_kbd.h
-KBD_MAXRETRY opt_kbd.h
-KBD_MAXWAIT opt_kbd.h
-KBD_RESETDELAY opt_kbd.h
-KBDIO_DEBUG opt_kbd.h
+KBD_RESETDELAY opt_kbdio.h
+KBD_MAXRETRY opt_kbdio.h
+KBD_MAXWAIT opt_kbdio.h
+KBDIO_DEBUG opt_kbdio.h
ATAPI opt_atapi.h
ATAPI_STATIC opt_atapi.h
@@ -106,13 +97,12 @@ CMD640 opt_wd.h
USERCONFIG opt_userconfig.h
VISUAL_USERCONFIG opt_userconfig.h
-INTRO_USERCONFIG opt_userconfig.h
+USERCONFIG_BOOT opt_userconfig.h
EISA_SLOTS opt_eisa.h
FDC_DEBUG opt_fdc.h
FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h
-FDC_YE opt_fdc.h
# pcvt(4) has a bunch of options
FAT_CURSOR opt_pcvt.h
@@ -136,39 +126,3 @@ GUS_IRQ opt_sound.h
# Video spigot
SPIGOT_UNSECURE opt_spigot.h
-# -------------------------------
-# isdn4bsd: passive ISA cards
-# -------------------------------
-TEL_S0_8 opt_i4b.h
-TEL_S0_16 opt_i4b.h
-TEL_S0_16_3 opt_i4b.h
-AVM_A1 opt_i4b.h
-USR_STI opt_i4b.h
-ITKIX1 opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive ISA PnP cards
-# -------------------------------
-CRTX_S0_P opt_i4b.h
-DRN_NGO opt_i4b.h
-TEL_S0_16_3_P opt_i4b.h
-SEDLBAUER opt_i4b.h
-DYNALINK opt_i4b.h
-ELSA_QS1ISA opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCMCIA cards
-# -------------------------------
-AVM_A1_PCMCIA opt_i4b.h
-# -------------------------------
-# isdn4bsd: misc options
-# -------------------------------
-# temporary workaround for SMP machines
-I4B_SMP_WORKAROUND opt_i4b.h
-# enable VJ compression code for ipr i/f
-IPR_VJ opt_i4b.h
-# -------------------------------
-# EOF
-# -------------------------------
diff --git a/sys/i386/eisa/adv_eisa.c b/sys/i386/eisa/adv_eisa.c
index 87ff8dd276fd..77b2a9268432 100644
--- a/sys/i386/eisa/adv_eisa.c
+++ b/sys/i386/eisa/adv_eisa.c
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_eisa.c,v 1.1 1998/09/15 07:05:39 gibbs Exp $
+ * $Id$
*/
#include "eisa.h"
@@ -76,9 +76,9 @@ static int adveisaattach(struct eisa_device *e_dev);
* The overrun buffer shared amongst all EISA adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
static struct eisa_driver adv_eisa_driver =
{
diff --git a/sys/i386/eisa/ahc_eisa.c b/sys/i386/eisa/ahc_eisa.c
index 039878da4bf0..d69159ecaca0 100644
--- a/sys/i386/eisa/ahc_eisa.c
+++ b/sys/i386/eisa/ahc_eisa.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_eisa.c,v 1.3 1998/10/15 18:21:50 gibbs Exp $
+ * $Id: ahc_eisa.c,v 1.2 1998/10/09 17:42:28 gibbs Exp $
*/
#include "eisa.h"
@@ -44,7 +44,6 @@
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
#include <cam/scsi/scsi_all.h>
#include <dev/aic7xxx/aic7xxx.h>
diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c
index e1eee615d141..11418e70bf67 100644
--- a/sys/i386/eisa/eisaconf.c
+++ b/sys/i386/eisa/eisaconf.c
@@ -28,14 +28,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: eisaconf.c,v 1.36 1998/12/04 22:54:46 archie Exp $
+ * $Id: eisaconf.c,v 1.34 1998/02/09 06:08:09 eivind Exp $
*/
#include "opt_eisa.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
#include <machine/limits.h>
@@ -350,7 +350,7 @@ eisa_reg_end(e_dev)
{
char string[25];
- snprintf(string, sizeof(string), " on %s0 slot %d",
+ sprintf(string, " on %s0 slot %d",
mainboard_drv.name,
e_dev->ioconf.slot);
eisa_reg_print(e_dev, string, NULL);
@@ -432,7 +432,7 @@ eisa_reg_intr(e_dev, irq, func, arg, maskptr, shared)
return EPERM;
}
- snprintf(string, sizeof(string), " irq %d", irq);
+ sprintf(string, " irq %d", irq);
eisa_reg_print(e_dev, string, reg_state.num_interrupts ?
&separator : NULL);
reg_state.num_interrupts++;
diff --git a/sys/i386/eisa/if_fea.c b/sys/i386/eisa/if_fea.c
index fd9447e2c009..4113b1ac7ca0 100644
--- a/sys/i386/eisa/if_fea.c
+++ b/sys/i386/eisa/if_fea.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_fea.c,v 1.12 1999/01/01 12:35:47 bde Exp $
+ * $Id: if_fea.c,v 1.9 1998/02/20 13:11:46 bde Exp $
*/
/*
@@ -205,9 +205,9 @@ pdq_eisa_attach(
irq = TAILQ_FIRST(&ed->ioconf.irqs)->irq_no;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
+ sc = (pdq_softc_t *) malloc(sizeof(*sc), M_DEVBUF, M_WAITOK);
if (sc == NULL) {
- printf("fea%ld: malloc failed!\n", ed->unit);
+ printf("fea%d: malloc failed!\n", sc->sc_if.if_unit);
return -1;
}
pdqs_eisa[ed->unit] = sc;
diff --git a/sys/i386/eisa/if_vx_eisa.c b/sys/i386/eisa/if_vx_eisa.c
index b46fc752b95e..fcee846452a2 100644
--- a/sys/i386/eisa/if_vx_eisa.c
+++ b/sys/i386/eisa/if_vx_eisa.c
@@ -159,7 +159,7 @@ vx_eisa_attach(e_dev)
level_intr = FALSE;
- if (eisa_reg_intr(e_dev, irq, vxintr, (void *) sc, &net_imask,
+ if (eisa_reg_intr(e_dev, irq, (void (*)(void *)) vxintr, (void *) sc, &net_imask,
/* shared == */ level_intr)) {
vxfree(sc);
return -1;
@@ -172,7 +172,7 @@ vx_eisa_attach(e_dev)
if (eisa_enable_intr(e_dev, irq)) {
vxfree(sc);
- eisa_release_intr(e_dev, irq, vxintr);
+ eisa_release_intr(e_dev, irq, (void (*)(void *)) vxintr);
return -1;
}
return 0;
diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c
index 528e27061277..dd97021f3667 100644
--- a/sys/i386/i386/autoconf.c
+++ b/sys/i386/i386/autoconf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.110 1998/10/26 07:05:34 bde Exp $
+ * $Id: autoconf.c,v 1.108 1998/10/05 21:09:21 obrien Exp $
*/
/*
@@ -92,24 +92,23 @@
#include <pci/pcivar.h>
#endif
+#include "card.h"
+#if NCARD > 0
+#include <pccard/driver.h>
+#endif
+
+#include "scbus.h"
+
#include <sys/bus.h>
-static void configure_first __P((void *));
static void configure __P((void *));
-static void configure_final __P((void *));
+SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL)
static void configure_finish __P((void));
static void configure_start __P((void));
static int setdumpdev __P((dev_t dev));
static void setroot __P((void));
-SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
-/* SI_ORDER_SECOND is hookable */
-SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
-/* SI_ORDER_MIDDLE is hookable */
-SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
-
-
#if defined(CD9660) || defined(CD9660_ROOT)
#include <sys/fcntl.h>
@@ -172,6 +171,8 @@ find_cdrom_root()
}
#endif /* CD9660 || CD9660_ROOT */
+extern void xpt_init __P((void));
+
#ifdef MFS_ROOT
extern u_char *mfs_getimage __P((void));
#endif
@@ -179,6 +180,9 @@ extern u_char *mfs_getimage __P((void));
static void
configure_start()
{
+#if NSCBUS > 0
+ xpt_init();
+#endif
}
static void
@@ -190,17 +194,12 @@ configure_finish()
* Determine i/o configuration for a machine.
*/
static void
-configure_first(dummy)
- void *dummy;
-{
-
- configure_start(); /* DDB hook? */
-}
-
-static void
configure(dummy)
void *dummy;
{
+ int i;
+
+ configure_start();
/* Allow all routines to decide for themselves if they want intrs */
/*
@@ -256,15 +255,13 @@ configure(dummy)
* at splhigh()), but we want at least bio interrupts to work.
*/
safepri = cpl;
-}
-static void
-configure_final(dummy)
- void *dummy;
-{
- int i;
+#if NCARD > 0
+ /* After everyone else has a chance at grabbing resources */
+ pccard_configure();
+#endif
- configure_finish(); /* DDB hook? */
+ configure_finish();
cninit_finish();
@@ -410,7 +407,9 @@ setdumpdev(dev)
return (0);
}
maj = major(dev);
- if (maj >= nblkdev || bdevsw[maj] == NULL)
+ if (maj >= nblkdev)
+ return (ENXIO);
+ if (bdevsw[maj] == NULL)
return (ENXIO); /* XXX is this right? */
if (bdevsw[maj]->d_psize == NULL)
return (ENXIO); /* XXX should be ENODEV ? */
@@ -453,7 +452,7 @@ setroot()
if (boothowto & RB_DFLTROOT || (bootdev & B_MAGICMASK) != B_DEVMAGIC)
return;
majdev = B_TYPE(bootdev);
- if (majdev >= nblkdev || bdevsw[majdev] == NULL)
+ if (bdevsw[majdev] == NULL)
return;
unit = B_UNIT(bootdev);
slice = B_SLICE(bootdev);
diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c
index 30571e558e15..d35967e18f44 100644
--- a/sys/i386/i386/busdma_machdep.c
+++ b/sys/i386/i386/busdma_machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: busdma_machdep.c,v 1.11 1998/10/13 08:24:33 dg Exp $
+ * $Id: busdma_machdep.c,v 1.10 1998/10/07 03:38:14 gibbs Exp $
*/
#include <sys/param.h>
@@ -435,45 +435,38 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
seg = 1;
sg->ds_len = 0;
- {
- /*
- * note: nextpaddr not used on first loop
- */
- vm_offset_t nextpaddr = 0;
+ do {
+ bus_size_t size;
+ vm_offset_t nextpaddr; /* GCC warning expected */
- do {
- bus_size_t size;
+ paddr = pmap_kextract(vaddr);
+ size = PAGE_SIZE - (paddr & PAGE_MASK);
+ if (size > buflen)
+ size = buflen;
- paddr = pmap_kextract(vaddr);
- size = PAGE_SIZE - (paddr & PAGE_MASK);
- if (size > buflen)
- size = buflen;
-
- if (map->pagesneeded != 0
- && run_filter(dmat, paddr)) {
- paddr = add_bounce_page(dmat, map,
- vaddr, size);
- }
+ if (map->pagesneeded != 0
+ && run_filter(dmat, paddr)) {
+ paddr = add_bounce_page(dmat, map, vaddr, size);
+ }
- if (sg->ds_len == 0) {
- sg->ds_addr = paddr;
- sg->ds_len = size;
- } else if (paddr == nextpaddr) {
- sg->ds_len += size;
- } else {
- /* Go to the next segment */
- sg++;
- seg++;
- if (seg > dmat->nsegments)
- break;
- sg->ds_addr = paddr;
- sg->ds_len = size;
- }
- vaddr += size;
- nextpaddr = paddr + size;
- buflen -= size;
- } while (buflen > 0);
- }
+ if (sg->ds_len == 0) {
+ sg->ds_addr = paddr;
+ sg->ds_len = size;
+ } else if (paddr == nextpaddr) {
+ sg->ds_len += size;
+ } else {
+ /* Go to the next segment */
+ sg++;
+ seg++;
+ if (seg > dmat->nsegments)
+ break;
+ sg->ds_addr = paddr;
+ sg->ds_len = size;
+ }
+ vaddr += size;
+ nextpaddr = paddr + size;
+ buflen -= size;
+ } while (buflen > 0);
if (buflen != 0) {
printf("bus_dmamap_load: Too many segs! buf_len = 0x%lx\n",
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 581ff3f9c1dd..1482c6185557 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.59 1998/08/23 08:26:40 bde Exp $
+ * $Id: cons.c,v 1.58 1998/06/07 17:09:58 dfr Exp $
*/
#include "opt_devfs.h"
@@ -57,6 +57,23 @@
#include <machine/cpu.h>
#include <machine/cons.h>
+/* XXX this should be config(8)ed. */
+#include "sc.h"
+#include "vt.h"
+#include "sio.h"
+static struct consdev constab[] = {
+#if NSC > 0
+ { sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc },
+#endif
+#if NVT > 0
+ { pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc },
+#endif
+#if NSIO > 0
+ { siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc },
+#endif
+ { 0 },
+};
+
static d_open_t cnopen;
static d_close_t cnclose;
static d_read_t cnread;
@@ -74,7 +91,7 @@ static struct cdevsw cn_cdevsw = {
};
static dev_t cn_dev_t; /* seems to be never really used */
-SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
+SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
static int cn_mute;
@@ -95,22 +112,16 @@ static struct tty *cn_tp; /* physical console tty struct */
static void *cn_devfs_token; /* represents the devfs entry */
#endif /* DEVFS */
-CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL);
-
void
cninit()
{
struct consdev *best_cp, *cp;
- struct consdev **list;
/*
* Find the first console with the highest priority.
*/
best_cp = NULL;
- list = (struct consdev **)cons_set.ls_items;
- while ((cp = *list++) != NULL) {
- if (cp->cn_probe == NULL)
- continue;
+ for (cp = constab; cp->cn_probe; cp++) {
(*cp->cn_probe)(cp);
if (cp->cn_pri > CN_DEAD &&
(best_cp == NULL || cp->cn_pri > best_cp->cn_pri))
diff --git a/sys/i386/i386/cons.h b/sys/i386/i386/cons.h
index 1656b1261d47..76bc0739faca 100644
--- a/sys/i386/i386/cons.h
+++ b/sys/i386/i386/cons.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
- * $Id: cons.h,v 1.18 1999/01/07 14:14:11 yokota Exp $
+ * $Id: cons.h,v 1.16 1997/04/01 16:13:31 bde Exp $
*/
#ifndef _MACHINE_CONS_H_
@@ -49,6 +49,30 @@ typedef int cn_getc_t __P((dev_t));
typedef int cn_checkc_t __P((dev_t));
typedef void cn_putc_t __P((dev_t, int));
+#ifdef KERNEL
+/*
+ * XXX public functions in drivers should be declared in headers produced
+ * by `config', not here.
+ */
+cn_probe_t pccnprobe;
+cn_init_t pccninit;
+cn_getc_t pccngetc;
+cn_checkc_t pccncheckc;
+cn_putc_t pccnputc;
+
+cn_probe_t sccnprobe;
+cn_init_t sccninit;
+cn_getc_t sccngetc;
+cn_checkc_t sccncheckc;
+cn_putc_t sccnputc;
+
+cn_probe_t siocnprobe;
+cn_init_t siocninit;
+cn_getc_t siocngetc;
+cn_checkc_t siocncheckc;
+cn_putc_t siocnputc;
+#endif /* KERNEL */
+
struct consdev {
cn_probe_t *cn_probe;
/* probe hardware and fill in consdev info */
@@ -72,15 +96,8 @@ struct consdev {
#define CN_REMOTE 3 /* serial interface with remote bit set */
#ifdef KERNEL
-extern struct linker_set cons_set;
extern int cons_unavail;
-#define CONS_DRIVER(name, probe, init, getc, checkc, putc) \
- static struct consdev name##_consdev = { \
- probe, init, getc, checkc, putc \
- }; \
- DATA_SET(cons_set, name##_consdev)
-
/* Other kernel entry points. */
int cncheckc __P((void));
int cngetc __P((void));
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index 7f01f1d735e6..3f5f893a677c 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_interface.c,v 1.42 1998/12/14 05:34:33 dillon Exp $
+ * $Id: db_interface.c,v 1.40 1998/06/08 08:43:20 dfr Exp $
*/
/*
@@ -69,7 +69,7 @@ kdb_trap(type, code, regs)
int type, code;
register struct i386_saved_state *regs;
{
- volatile int ddb_mode = !(boothowto & RB_GDB);
+ int ddb_mode = !(boothowto & RB_GDB);
/*
* XXX try to do nothing if the console is in graphics mode.
@@ -295,12 +295,11 @@ db_write_bytes(addr, size, data)
* Move this to machdep.c and allow it to be called if any debugger is
* installed.
*/
-volatile int in_Debugger = 0;
-
void
Debugger(msg)
const char *msg;
{
+ static volatile u_char in_Debugger;
/*
* XXX
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index aad9d89fa2b8..eae2f4fcbbb1 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: elf_machdep.c,v 1.3 1998/10/16 03:54:59 peter Exp $
+ * $Id: elf_machdep.c,v 1.2 1998/10/09 20:38:03 peter Exp $
*/
#include <sys/param.h>
@@ -42,7 +42,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
{
Elf_Addr relocbase = (Elf_Addr) lf->address;
Elf_Addr *where;
- Elf_Addr addr;
+ Elf_Addr addr, tmp_value;
Elf_Addr addend;
Elf_Word rtype;
const Elf_Rel *rel;
diff --git a/sys/i386/i386/gensetdefs.c b/sys/i386/i386/gensetdefs.c
new file mode 100644
index 000000000000..21029168d5aa
--- /dev/null
+++ b/sys/i386/i386/gensetdefs.c
@@ -0,0 +1,313 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra.
+ * 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.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <machine/elf.h>
+
+#include <err.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define HASHSIZE 1009u /* Number of hash chains. */
+#define PREFIX ".set." /* Section name prefix for linker sets. */
+
+/* One entry in the hash table. */
+typedef struct hashent {
+ struct hashent *next; /* Next entry with the same hash. */
+ char *name; /* Name of the linker set. */
+ size_t size; /* Size in bytes. */
+} hashent;
+
+/* Allocate storage for "count" objects of type "type". */
+#define NEW(type, count) ((type *) xmalloc((count) * sizeof(type)))
+
+static hashent *hashtab[HASHSIZE]; /* Hash chain heads. */
+
+static void enter(const char *, size_t);
+static int enter_sets(const char *);
+static unsigned int hash(const char *);
+static hashent *merge(void);
+static int my_byte_order(void);
+static void *xmalloc(size_t);
+static char *xstrdup(const char *);
+
+/*
+ * This is a special-purpose program to generate the linker set definitions
+ * needed when building an ELF kernel. Its arguments are the names of
+ * ELF object files. It scans the section names of the object files,
+ * building a table of those that begin with ".set.", which represent
+ * linker sets. Finally, for each set "foo" with "count" elements, it
+ * writes a line "DEFINE_SET(foo, count);" to the standard output.
+ */
+int
+main(int argc, char **argv)
+{
+ int i;
+ int status = EXIT_SUCCESS;
+ hashent *list;
+
+ for (i = 1; i < argc; i++)
+ if (enter_sets(argv[i]) == -1)
+ status = EXIT_FAILURE;
+
+ list = merge();
+ while (list != NULL) {
+ hashent *next;
+
+ printf("DEFINE_SET(%s, %lu);\n", list->name,
+ (unsigned long) (list->size / sizeof (void *)));
+ next = list->next;
+ free(list->name);
+ free(list);
+ list = next;
+ }
+
+ return (status);
+}
+
+/*
+ * Enter the given string into the hash table, if it is not already there.
+ * Each hash chain is kept sorted, so that it will be easy to merge the
+ * chains to get a single sorted list.
+ */
+static void
+enter(const char *name, size_t size)
+{
+ int c;
+ hashent *entp;
+ hashent **linkp;
+ hashent *newp;
+
+ linkp = &hashtab[hash(name) % HASHSIZE];
+ while ((entp = *linkp) != NULL && (c = strcmp(name, entp->name)) > 0)
+ linkp = &entp->next;
+
+ if (entp == NULL || c != 0) { /* Not found; create a new entry. */
+ newp = NEW(hashent, 1);
+ newp->name = xstrdup(name);
+ newp->size = 0;
+ newp->next = entp;
+ *linkp = newp;
+ entp = newp;
+ }
+
+ entp->size += size;
+}
+
+/*
+ * Return a hash value for the given string.
+ */
+static unsigned int
+hash(const char *s)
+{
+ unsigned char ch;
+ unsigned int h = 0;
+
+ while((ch = *s) != '\0') {
+ h = 9*h + ch;
+ s++;
+ }
+ return (h);
+}
+
+/*
+ * Enter the linker sets from the given ELF object file. Returns 0 on
+ * success, or -1 if an error occurred.
+ */
+static int
+enter_sets(const char *filename)
+{
+ int i;
+ FILE *iop;
+ Elf32_Shdr *shdr;
+ char *shstr;
+ Elf32_Ehdr ehdr;
+
+ if ((iop = fopen(filename, "rb")) == NULL) {
+ warn("%s", filename);
+ return (-1);
+ }
+ if (fread(&ehdr, sizeof ehdr, 1, iop) != 1 ||
+ ehdr.e_ident[EI_MAG0] != ELFMAG0 ||
+ ehdr.e_ident[EI_MAG1] != ELFMAG1 ||
+ ehdr.e_ident[EI_MAG2] != ELFMAG2 ||
+ ehdr.e_ident[EI_MAG3] != ELFMAG3) {
+ warnx("%s: not an ELF file", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_ident[EI_VERSION] != EV_CURRENT) {
+ warnx("%s: unsupported ELF version", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_ident[EI_DATA] != my_byte_order()) {
+ warnx("%s: unsupported byte order", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_shoff == 0) {
+ warnx("%s: no section table", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_shstrndx == SHN_UNDEF) {
+ warnx("%s: no section name string table", filename);
+ fclose(iop);
+ return (-1);
+ }
+
+ shdr = NEW(Elf32_Shdr, ehdr.e_shnum);
+ if (fseek(iop, ehdr.e_shoff, SEEK_SET) == -1) {
+ warn("%s", filename);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+ if (fread(shdr, sizeof *shdr, ehdr.e_shnum, iop) != ehdr.e_shnum) {
+ warnx("%s: truncated section table", filename);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+
+ shstr = NEW(char, shdr[ehdr.e_shstrndx].sh_size);
+ if (fseek(iop, shdr[ehdr.e_shstrndx].sh_offset, SEEK_SET) == -1) {
+ warn("%s", filename);
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+ if (fread(shstr, sizeof *shstr, shdr[ehdr.e_shstrndx].sh_size, iop) !=
+ shdr[ehdr.e_shstrndx].sh_size) {
+ warnx("%s: truncated section name string table", filename);
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+
+ for (i = 1; i < ehdr.e_shnum; i++) {
+ const char *name = shstr + shdr[i].sh_name;
+
+ if (strncmp(name, PREFIX, sizeof (PREFIX) - 1) == 0)
+ enter(name + sizeof (PREFIX) - 1, shdr[i].sh_size);
+ }
+
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (0);
+}
+
+/*
+ * Destructively merge all the sorted hash chains into a single sorted
+ * list, and return a pointer to its first element.
+ */
+static hashent *
+merge(void)
+{
+ unsigned int numchains = HASHSIZE;
+
+ while (numchains > 1) { /* More merging to do. */
+ unsigned int lo = 0;
+ /*
+ * Merge chains pairwise from the outside in, halving the
+ * number of chains.
+ */
+ while (numchains - lo >= 2) {
+ hashent **linkp = &hashtab[lo];
+ hashent *l1 = hashtab[lo++];
+ hashent *l2 = hashtab[--numchains];
+
+ while (l1 != NULL && l2 != NULL) {
+ if (strcmp(l1->name, l2->name) < 0) {
+ *linkp = l1;
+ linkp = &l1->next;
+ l1 = l1->next;
+ } else {
+ *linkp = l2;
+ linkp = &l2->next;
+ l2 = l2->next;
+ }
+ }
+ *linkp = l1==NULL ? l2 : l1;
+ }
+ }
+
+ return (hashtab[0]);
+}
+
+/*
+ * Determine the host byte order.
+ */
+static int
+my_byte_order(void)
+{
+ static unsigned short s = 0xbbaa;
+ int byte0;
+
+ byte0 = *(unsigned char *)&s;
+ if (byte0 == 0xaa)
+ return (ELFDATA2LSB);
+ else if (byte0 == 0xbb)
+ return (ELFDATA2MSB);
+ else
+ return (ELFDATANONE);
+}
+
+/*
+ * Allocate a chunk of memory and return a pointer to it. Die if the
+ * malloc fails.
+ */
+static void *
+xmalloc(size_t size)
+{
+ void *p;
+
+ p = malloc(size);
+ if (p == NULL)
+ err(EXIT_FAILURE, "malloc");
+ return (p);
+}
+
+/*
+ * Duplicate a string and return a pointer to the copy. Die if there is
+ * not enough memory.
+ */
+static char *
+xstrdup(const char *s)
+{
+ int size;
+
+ size = strlen(s) + 1;
+ return (memcpy(xmalloc(size), s, size));
+}
diff --git a/sys/i386/i386/i386-gdbstub.c b/sys/i386/i386/i386-gdbstub.c
index 25e283897da5..0c5f82bb4f61 100644
--- a/sys/i386/i386/i386-gdbstub.c
+++ b/sys/i386/i386/i386-gdbstub.c
@@ -153,9 +153,6 @@ strcpy (char *dst, const char *src)
/* XXX sio always uses its major with minor 0 no matter what we specify. */
#define REMOTE_DEV 0
-cn_getc_t siocngetc;
-cn_putc_t siocnputc;
-
static int
putDebugChar (int c) /* write a single character */
{
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 146db244a836..98b9edf708d0 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.56 1999/01/09 13:07:18 bde Exp $
+ * $Id: identcpu.c,v 1.51 1998/07/11 07:45:28 bde Exp $
*/
#include "opt_cpu.h"
@@ -59,17 +59,17 @@
#define IDENTBLUE_IBMCPU 1
#define IDENTBLUE_CYRIXM2 2
-/* XXX - should be in header file: */
-void printcpuinfo(void);
+/* XXX - should be in header file */
+void i486_bzero __P((void *buf, size_t len));
+
+void printcpuinfo(void); /* XXX should be in different header file */
void finishidentcpu(void);
void earlysetcpuclass(void);
#if defined(I586_CPU) && defined(CPU_WT_ALLOC)
void enable_K5_wt_alloc(void);
void enable_K6_wt_alloc(void);
-void enable_K6_2_wt_alloc(void);
#endif
void panicifcpuunsupported(void);
-
static void identifycyrix(void);
static void print_AMD_info(void);
static void print_AMD_assoc(int i);
@@ -106,13 +106,13 @@ do_cpuid(u_int ax, u_int *p)
{
__asm __volatile(
".byte 0x0f, 0xa2;"
- "movl %%eax, (%2);"
- "movl %%ebx, 4(%2);"
- "movl %%ecx, 8(%2);"
- "movl %%edx, 12(%2);"
- : "=a" (ax)
- : "0" (ax), "S" (p)
- : "bx", "cx", "dx"
+ "movl %%eax, (%%esi);"
+ "movl %%ebx, (4)(%%esi);"
+ "movl %%ecx, (8)(%%esi);"
+ "movl %%edx, (12)(%%esi);"
+ :
+ : "a" (ax), "S" (p)
+ : "ax", "bx", "cx", "dx"
);
}
@@ -291,13 +291,9 @@ printcpuinfo(void)
if ((cpu_id & 0xf00) == 0x500) {
if (((cpu_id & 0x0f0) > 0)
&& ((cpu_id & 0x0f0) < 0x60)
- && ((cpu_id & 0x00f) > 3))
+ && ((cpu_id & 0x00f) > 3)) {
enable_K5_wt_alloc();
- else if (((cpu_id & 0x0f0) > 0x80)
- || (((cpu_id & 0x0f0) == 0x80)
- && (cpu_id & 0x00f) > 0x07))
- enable_K6_2_wt_alloc();
- else if ((cpu_id & 0x0f0) > 0x50)
+ } else if ((cpu_id & 0x0f0) > 0x50)
enable_K6_wt_alloc();
}
#endif
@@ -843,7 +839,6 @@ static void
print_AMD_info(void)
{
u_int regs[4];
- quad_t amd_whcr;
do_cpuid(0x80000000, regs);
if (regs[0] >= 0x80000005) {
@@ -861,33 +856,4 @@ print_AMD_info(void)
printf(", %d lines/tag", (regs[3] >> 8) & 0xff);
print_AMD_assoc((regs[3] >> 16) & 0xff);
}
- if (((cpu_id & 0xf00) == 0x500)
- && (((cpu_id & 0x0f0) > 0x80)
- || (((cpu_id & 0x0f0) == 0x80)
- && (cpu_id & 0x00f) > 0x07))) {
- /* K6-2(new core [Stepping 8-F]), K6-3 or later */
- amd_whcr = rdmsr(0xc0000082);
- if (!(amd_whcr & (0x3ff << 22))) {
- printf("Write Allocate Disable\n");
- } else {
- printf("Write Allocate Enable Limit: %dM bytes\n",
- (u_int32_t)((amd_whcr & (0x3ff << 22)) >> 22) * 4);
- printf("Write Allocate 15-16M bytes: %s\n",
- (amd_whcr & (1 << 16)) ? "Enable" : "Disable");
- }
- } else if (((cpu_id & 0xf00) == 0x500)
- && ((cpu_id & 0x0f0) > 0x50)) {
- /* K6, K6-2(old core) */
- amd_whcr = rdmsr(0xc0000082);
- if (!(amd_whcr & (0x7f << 1))) {
- printf("Write Allocate Disable\n");
- } else {
- printf("Write Allocate Enable Limit: %dM bytes\n",
- (u_int32_t)((amd_whcr & (0x7f << 1)) >> 1) * 4);
- printf("Write Allocate 15-16M bytes: %s\n",
- (amd_whcr & 0x0001) ? "Enable" : "Disable");
- printf("Hardware Write Allocate Control: %s\n",
- (amd_whcr & 0x0100) ? "Enable" : "Disable");
- }
- }
}
diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c
index d64f4eefedd1..9f1f2a9b7190 100644
--- a/sys/i386/i386/initcpu.c
+++ b/sys/i386/i386/initcpu.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: initcpu.c,v 1.16 1998/12/27 23:23:26 msmith Exp $
+ * $Id: initcpu.c,v 1.13 1998/05/16 14:38:10 kato Exp $
*/
#include "opt_cpu.h"
@@ -44,7 +44,6 @@ void initializecpu(void);
#if defined(I586_CPU) && defined(CPU_WT_ALLOC)
void enable_K5_wt_alloc(void);
void enable_K6_wt_alloc(void);
-void enable_K6_2_wt_alloc(void);
#endif
#ifdef I486_CPU
@@ -617,18 +616,20 @@ enable_K6_wt_alloc(void)
#endif
/* Don't assume that memory size is aligned with 4M. */
if (Maxmem > 0)
- size = ((Maxmem >> 8) + 3) >> 2;
+ size = Maxmem / 256;
else
size = 0;
+ size = (size + 3) / 4;
/* Limit is 508M bytes. */
- if (size > 0x7f)
- size = 0x7f;
- whcr = (rdmsr(0xc0000082) & ~(0x7fLL << 1)) | (size << 1);
+ if (size > 127)
+ size = 127;
+ whcr = rdmsr(0xc0000082);
+ whcr &= ~0x00feLL;
+ whcr |= (size << 1);
-#if defined(PC98) || defined(NO_MEMORY_HOLE)
- if (whcr & (0x7fLL << 1)) {
#ifdef PC98
+ if (whcr & 0x00feLL) {
/*
* If bit 2 of port 0x43b is 0, disable wrte allocate for the
* 15-16M range.
@@ -636,7 +637,6 @@ enable_K6_wt_alloc(void)
if (!(inb(0x43b) & 4))
whcr &= ~0x0001LL;
else
-#endif
whcr |= 0x0001LL;
}
#else
@@ -644,69 +644,7 @@ enable_K6_wt_alloc(void)
* There is no way to know wheter 15-16M hole exists or not.
* Therefore, we disable write allocate for this range.
*/
- whcr &= ~0x0001LL;
-#endif
- wrmsr(0x0c0000082, whcr);
-
- write_eflags(eflags);
- enable_intr();
-}
-
-void
-enable_K6_2_wt_alloc(void)
-{
- quad_t size;
- u_int64_t whcr;
- u_long eflags;
-
- eflags = read_eflags();
- disable_intr();
- wbinvd();
-
-#ifdef CPU_DISABLE_CACHE
- /*
- * Certain K6-2 box becomes unstable when write allocation is
- * enabled.
- */
- /*
- * The AMD-K6 processer provides the 64-bit Test Register 12(TR12),
- * but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported.
- * All other bits in TR12 have no effect on the processer's operation.
- * The I/O Trap Restart function (bit 9 of TR12) is always enabled
- * on the AMD-K6.
- */
- wrmsr(0x0000000e, (u_int64_t)0x0008);
-#endif
- /* Don't assume that memory size is aligned with 4M. */
- if (Maxmem > 0)
- size = ((Maxmem >> 8) + 3) >> 2;
- else
- size = 0;
-
- /* Limit is 4092M bytes. */
- if (size > 0x3fff)
- size = 0x3ff;
- whcr = (rdmsr(0xc0000082) & ~(0x3ffLL << 22)) | (size << 22);
-
-#if defined(PC98) || defined(NO_MEMORY_HOLE)
- if (whcr & (0x3ffLL << 22)) {
-#ifdef PC98
- /*
- * If bit 2 of port 0x43b is 0, disable wrte allocate for the
- * 15-16M range.
- */
- if (!(inb(0x43b) & 4))
- whcr &= ~(1LL << 16);
- else
-#endif
- whcr |= 1LL << 16;
- }
-#else
- /*
- * There is no way to know wheter 15-16M hole exists or not.
- * Therefore, we disable write allocate for this range.
- */
- whcr &= ~(1LL << 16);
+ whcr &= 0x00feLL;
#endif
wrmsr(0x0c0000082, whcr);
@@ -723,8 +661,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg)
{
u_long eflags;
u_int cr0;
- u_char ccr1, ccr2, ccr3;
- u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0;
+ u_char ccr0, ccr1, ccr2, ccr3, ccr4, ccr5, pcr0;
cr0 = rcr0();
if (strcmp(cpu_vendor,"CyrixInstead") == 0) {
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index 42955056d423..f6f735d9f2ed 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
- * $Id: locore.s,v 1.117 1998/11/03 21:07:50 msmith Exp $
+ * $Id: locore.s,v 1.115 1998/10/09 23:36:25 peter Exp $
*
* originally from: locore.s, by William F. Jolitz
*
@@ -206,9 +206,9 @@ NON_GPROF_ENTRY(btext)
#ifdef PC98
jmp 1f
- .globl CNAME(pc98_system_parameter)
+ .globl _pc98_system_parameter
.org 0x400
-CNAME(pc98_system_parameter):
+_pc98_system_parameter:
.space 0x240 /* BIOS parameter block */
1:
/* save SYSTEM PARAMETER for resume (NS/T or other) */
@@ -599,6 +599,15 @@ olddiskboot:
movl 12(%ebp),%eax
movl %eax,R(_bootdev)
+#if defined(USERCONFIG_BOOT) && defined(USERCONFIG)
+ movl $0x10200, %esi
+ movl $R(_userconfig_from_boot),%edi
+ movl $512,%ecx
+ cld
+ rep
+ movsb
+#endif /* USERCONFIG_BOOT */
+
ret
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 1bd6f6c5f04a..06db0703bc20 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
+ * $Id: machdep.c,v 1.312 1998/10/09 00:31:06 msmith Exp $
*/
#include "apm.h"
@@ -109,6 +109,9 @@
#include <net/netisr.h>
#endif
+#if NAPM > 0
+#include <machine/apm_bios.h>
+#endif
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/clock.h>
@@ -159,9 +162,9 @@ SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count,
#endif
#ifdef PC98
-static int ispc98 = 1;
+int ispc98 = 1;
#else
-static int ispc98 = 0;
+int ispc98 = 0;
#endif
SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, "");
@@ -410,12 +413,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -439,8 +436,14 @@ again:
}
#if defined(USERCONFIG)
- userconfig();
- cninit(); /* the preferred console may have changed */
+#if defined(USERCONFIG_BOOT)
+ if (1) {
+#else
+ if (boothowto & RB_CONFIG) {
+#endif
+ userconfig();
+ cninit(); /* the preferred console may have changed */
+ }
#endif
printf("avail memory = %d (%dK bytes)\n", ptoa(cnt.v_free_count),
@@ -532,11 +535,7 @@ sendsig(catcher, sig, mask, code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof(struct sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -631,7 +630,7 @@ sendsig(catcher, sig, mask, code)
}
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
@@ -795,6 +794,17 @@ cpu_halt(void)
}
/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+#if NAPM > 0
+ apm_power_off();
+#endif
+}
+
+/*
* Clear registers on exec
*/
void
@@ -1235,7 +1245,7 @@ init386(first)
setidt(11, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(12, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(13, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
- setidt(14, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+ setidt(14, &IDTVEC(page), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(15, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(16, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(17, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -1626,7 +1636,7 @@ f00f_hack(void *unused) {
if (!has_f00f_bug)
return;
- printf("Intel Pentium detected, installing workaround for F00F bug\n");
+ printf("Intel Pentium F00F detected, installing workaround\n");
r_idt.rd_limit = sizeof(idt) - 1;
diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c
index a7077bd0df5d..df44b5f75182 100644
--- a/sys/i386/i386/math_emulate.c
+++ b/sys/i386/i386/math_emulate.c
@@ -6,7 +6,7 @@
* [expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj]
*
* from: 386BSD 0.1
- * $Id: math_emulate.c,v 1.31 1998/11/15 15:33:50 bde Exp $
+ * $Id: math_emulate.c,v 1.27 1998/07/15 09:01:18 bde Exp $
*/
/*
@@ -117,10 +117,7 @@ math_emulate(struct trapframe * info)
(u_long)oldeip);
panic("?Math emulation needed in kernel?");
}
- /* completely ignore an operand-size prefix */
- if (get_fs_byte((char *) info->tf_eip) == 0x66)
- info->tf_eip++;
- code = get_fs_word((unsigned short *) info->tf_eip);
+ code = get_fs_word((unsigned short *) oldeip);
bswapw(code);
code &= 0x7ff;
I387.fip = oldeip;
@@ -1543,18 +1540,46 @@ int_to_real(const temp_int * a, temp_real * b)
}
}
+#ifdef LKM
+MOD_MISC(fpu);
+static int
+fpu_load(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate) {
+ printf("Math emulator already present\n");
+ return EBUSY;
+ }
+ pmath_emulate = math_emulate;
+ return 0;
+}
+
+static int
+fpu_unload(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate != math_emulate) {
+ printf("Cannot unload another math emulator\n");
+ return EACCES;
+ }
+ pmath_emulate = 0;
+ return 0;
+}
+
+int
+fpu_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(fpu, lkmtp, cmd, ver, fpu_load, fpu_unload, lkm_nullcmd);
+}
+#else /* !LKM */
+
static int
-fpu_modevent(module_t mod, int type, void *unused)
+fpu_modevent(module_t mod, modeventtype_t type, void *unused)
{
switch (type) {
case MOD_LOAD:
- if (pmath_emulate) {
+ if (pmath_emulate)
printf("Another Math emulator already present\n");
- return EBUSY;
- }
- pmath_emulate = math_emulate;
- if (bootverbose)
- printf("Math emulator present\n");
+ else
+ pmath_emulate = math_emulate;
break;
case MOD_UNLOAD:
if (pmath_emulate != math_emulate) {
@@ -1562,9 +1587,6 @@ fpu_modevent(module_t mod, int type, void *unused)
return EACCES;
}
pmath_emulate = 0;
- if (bootverbose)
- printf("Math emulator unloaded\n");
- break;
default:
break;
}
@@ -1575,4 +1597,6 @@ moduledata_t fpumod = {
fpu_modevent,
0
};
-DECLARE_MODULE(fpu, fpumod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+DECLARE_MODULE(fpu, fpumod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+
+#endif /* LKM */
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index 1994f12ce538..d26b9ee5ebf5 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.52 1998/06/21 11:33:29 bde Exp $
+ * $Id: mem.c,v 1.51 1998/06/07 17:10:02 dfr Exp $
*/
/*
@@ -381,7 +381,7 @@ mmrw(dev, uio, flags)
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, int nprot)
+memmmap(dev_t dev, int offset, int nprot)
{
switch (minor(dev))
{
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 569f04baf659..adf5131b1d84 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.87 1999/01/12 00:19:31 eivind Exp $
+ * $Id: mp_machdep.c,v 1.82 1998/10/10 09:38:02 kato Exp $
*/
#include "opt_smp.h"
@@ -1009,8 +1009,8 @@ fix_mp_table(void)
{
int x;
int id;
- int bus_0 = 0; /* Stop GCC warning */
- int bus_pci = 0; /* Stop GCC warning */
+ int bus_0;
+ int bus_pci;
int num_pci_bus;
/*
@@ -1197,26 +1197,11 @@ lookup_bus_type(char *name)
static int
int_entry(int_entry_ptr entry, int intr)
{
- int apic;
-
io_apic_ints[intr].int_type = entry->int_type;
io_apic_ints[intr].int_flags = entry->int_flags;
io_apic_ints[intr].src_bus_id = entry->src_bus_id;
io_apic_ints[intr].src_bus_irq = entry->src_bus_irq;
- if (entry->dst_apic_id == 255) {
- /* This signal goes to all IO APICS. Select an IO APIC
- with sufficient number of interrupt pins */
- for (apic = 0; apic < mp_napics; apic++)
- if (((io_apic_read(apic, IOAPIC_VER) &
- IOART_VER_MAXREDIR) >> MAXREDIRSHIFT) >=
- entry->dst_apic_int)
- break;
- if (apic < mp_napics)
- io_apic_ints[intr].dst_apic_id = IO_TO_ID(apic);
- else
- io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
- } else
- io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
+ io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
io_apic_ints[intr].dst_apic_int = entry->dst_apic_int;
return 1;
@@ -1388,13 +1373,11 @@ int
undirect_isa_irq(int rirq)
{
#if defined(READY)
- if (bootverbose)
- printf("Freeing redirected ISA irq %d.\n", rirq);
+ printf("Freeing redirected ISA irq %d.\n", rirq);
/** FIXME: tickle the MB redirector chip */
return ???;
#else
- if (bootverbose)
- printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq);
+ printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq);
return 0;
#endif /* READY */
}
@@ -2200,12 +2183,12 @@ SYSCTL_INT(_machdep, OID_AUTO, forward_irq_enabled, CTLFLAG_RW,
&forward_irq_enabled, 0, "");
/* Enable forwarding of a signal to a process running on a different CPU */
-static int forward_signal_enabled = 1;
+int forward_signal_enabled = 1;
SYSCTL_INT(_machdep, OID_AUTO, forward_signal_enabled, CTLFLAG_RW,
&forward_signal_enabled, 0, "");
/* Enable forwarding of roundrobin to all other cpus */
-static int forward_roundrobin_enabled = 1;
+int forward_roundrobin_enabled = 1;
SYSCTL_INT(_machdep, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW,
&forward_roundrobin_enabled, 0, "");
@@ -2218,6 +2201,7 @@ void ap_init(void);
void
ap_init()
{
+ u_int temp;
u_int apic_id;
smp_cpus++;
diff --git a/sys/i386/i386/perfmon.c b/sys/i386/i386/perfmon.c
index 0720c62ea0f2..d79527e3d37c 100644
--- a/sys/i386/i386/perfmon.c
+++ b/sys/i386/i386/perfmon.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: perfmon.c,v 1.16 1998/12/07 21:58:18 archie Exp $
+ * $Id: perfmon.c,v 1.14 1997/12/28 17:33:01 phk Exp $
*/
#include <sys/param.h>
@@ -41,17 +41,13 @@
static int perfmon_inuse;
static int perfmon_cpuok;
-#ifndef SMP
static int msr_ctl[NPMC];
-#endif
static int msr_pmc[NPMC];
static unsigned int ctl_shadow[NPMC];
static quad_t pmc_shadow[NPMC]; /* used when ctr is stopped on P5 */
static int (*writectl)(int);
-#ifndef SMP
static int writectl5(int);
static int writectl6(int);
-#endif
/*
* Must be called after cpu_class is set up.
@@ -199,7 +195,6 @@ perfmon_reset(int pmc)
return EBUSY;
}
-#ifndef SMP
/*
* Unfortunately, the performance-monitoring registers are laid out
* differently in the P5 and P6. We keep everything in P6 format
@@ -250,7 +245,6 @@ writectl5(int pmc)
wrmsr(msr_ctl[0], newval);
return 0; /* XXX should check for unimplemented bits */
}
-#endif /* !SMP */
/*
* Now the user-mode interface, called from a subdevice of mem.c.
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 66c9b632f1c0..2be04c8eeabf 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.218 1999/01/09 21:41:22 dt Exp $
+ * $Id: pmap.c,v 1.208 1998/09/04 13:10:34 ache Exp $
*/
/*
@@ -184,14 +184,6 @@ static caddr_t CADDR2;
static pt_entry_t *msgbufmap;
struct msgbuf *msgbufp=0;
-/*
- * PPro_vmtrr
- */
-struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR];
-
-/* AIO support */
-extern struct vmspace *aiovmspace;
-
#ifdef SMP
extern char prv_CPAGE1[], prv_CPAGE2[], prv_CPAGE3[];
extern pt_entry_t *prv_CMAP1, *prv_CMAP2, *prv_CMAP3;
@@ -297,9 +289,7 @@ pmap_bootstrap(firstaddr, loadaddr)
{
vm_offset_t va;
pt_entry_t *pte;
-#ifdef SMP
int i, j;
-#endif
avail_start = firstaddr;
@@ -469,7 +459,7 @@ getmtrr()
{
int i;
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
for(i = 0; i < NPPROVMTRR; i++) {
PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2);
PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2);
@@ -482,7 +472,7 @@ putmtrr()
{
int i;
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
wbinvd();
for(i = 0; i < NPPROVMTRR; i++) {
wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base);
@@ -495,7 +485,7 @@ void
pmap_setvidram(void)
{
#if 0
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
wbinvd();
/*
* Set memory between 0-640K to be WB
@@ -518,7 +508,7 @@ pmap_setdevram(unsigned long long basea, vm_offset_t sizea)
unsigned long long base;
unsigned long long mask;
- if (cpu_class != CPUCLASS_686)
+ if (cpu != CPU_686)
return;
free = -1;
@@ -606,11 +596,6 @@ pmap_init(phys_start, phys_end)
int initial_pvs;
/*
- * object for kernel page table pages
- */
- kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
-
- /*
* calculate the number of pv_entries needed
*/
vm_first_phys = phys_avail[0];
@@ -644,6 +629,10 @@ pmap_init(phys_start, phys_end)
pvinit = (struct pv_entry *) kmem_alloc(kernel_map,
initial_pvs * sizeof (struct pv_entry));
zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit, pv_npg);
+ /*
+ * object for kernel page table pages
+ */
+ kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* Now it is safe to enable pv_table recording.
@@ -734,6 +723,19 @@ invltlb_1pg( vm_offset_t va) {
}
}
+static PMAP_INLINE void
+invltlb_2pg( vm_offset_t va1, vm_offset_t va2) {
+#if defined(I386_CPU)
+ if (cpu_class == CPUCLASS_386) {
+ invltlb();
+ } else
+#endif
+ {
+ invlpg(va1);
+ invlpg(va2);
+ }
+}
+
static unsigned *
get_ptbase(pmap)
pmap_t pmap;
@@ -1044,7 +1046,7 @@ pmap_dispose_proc(p)
*(ptek + i) = 0;
if ((oldpte & PG_G) || (cpu_class > CPUCLASS_386))
invlpg((vm_offset_t) p->p_addr + i * PAGE_SIZE);
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
vm_page_free(m);
}
@@ -1071,7 +1073,8 @@ pmap_swapout_proc(p)
if ((m = vm_page_lookup(upobj, i)) == NULL)
panic("pmap_swapout_proc: upage already missing???");
m->dirty = VM_PAGE_BITS_ALL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+ vm_page_deactivate(m);
pmap_kremove( (vm_offset_t) p->p_addr + PAGE_SIZE * i);
}
}
@@ -1121,6 +1124,7 @@ pmap_swapin_proc(p)
*/
static int
_pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m) {
+ int s;
while (vm_page_sleep(m, "pmuwpt", NULL));
@@ -1251,6 +1255,7 @@ pmap_pinit(pmap)
/*
* allocate the page directory page
*/
+retry:
ptdpg = vm_page_grab( pmap->pm_pteobj, PTDPTDI,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
@@ -1284,6 +1289,7 @@ pmap_release_free_page(pmap, p)
struct pmap *pmap;
vm_page_t p;
{
+ int s;
unsigned *pde = (unsigned *) pmap->pm_pdir;
/*
* This code optimizes the case of freeing non-busy
@@ -1322,8 +1328,6 @@ pmap_release_free_page(pmap, p)
if (pmap->pm_ptphint && (pmap->pm_ptphint->pindex == p->pindex))
pmap->pm_ptphint = NULL;
- p->wire_count--;
- cnt.v_wire_count--;
vm_page_free_zero(p);
return 1;
}
@@ -1558,10 +1562,6 @@ pmap_growkernel(vm_offset_t addr)
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
}
- if (aiovmspace != NULL) {
- pmap = &aiovmspace->vm_pmap;
- *pmap_pde(pmap, kernel_vm_end) = newpdir;
- }
*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
}
@@ -2426,6 +2426,7 @@ pmap_object_init_pt(pmap, addr, object, pindex, size, limit)
((addr & (NBPDR - 1)) == 0) &&
((size & (NBPDR - 1)) == 0) ) {
int i;
+ int s;
vm_page_t m[1];
unsigned int ptepindex;
int npdes;
@@ -2818,7 +2819,7 @@ pmap_zero_page(phys)
cpu_invlpg(&prv_CPAGE3);
#if defined(I686_CPU)
- if (cpu_class == CPUCLASS_686)
+ if (cpu == CPU_686)
i686_pagezero(&prv_CPAGE3);
else
#endif
@@ -2839,7 +2840,7 @@ pmap_zero_page(phys)
}
#if defined(I686_CPU)
- if (cpu_class == CPUCLASS_686)
+ if (cpu == CPU_686)
i686_pagezero(CADDR2);
else
#endif
@@ -3193,7 +3194,7 @@ pmap_phys_address(ppn)
int
pmap_ts_referenced(vm_offset_t pa)
{
- register pv_entry_t pv, pvf, pvn;
+ register pv_entry_t pv;
pv_table_t *ppv;
unsigned *pte;
int s;
@@ -3214,11 +3215,9 @@ pmap_ts_referenced(vm_offset_t pa)
/*
* Not found, check current mappings returning immediately if found.
*/
- pvf = 0;
- for (pv = TAILQ_FIRST(&ppv->pv_list); pv && pv != pvf; pv = pvn) {
- if (!pvf)
- pvf = pv;
- pvn = TAILQ_NEXT(pv, pv_list);
+ for (pv = TAILQ_FIRST(&ppv->pv_list);
+ pv;
+ pv = TAILQ_NEXT(pv, pv_list)) {
TAILQ_REMOVE(&ppv->pv_list, pv, pv_list);
/*
@@ -3493,7 +3492,7 @@ pmap_pid_dump(int pid) {
#if defined(DEBUG)
static void pads __P((pmap_t pm));
-void pmap_pvdump __P((vm_offset_t pa));
+static void pmap_pvdump __P((vm_offset_t pa));
/* print address space of pmap*/
static void
@@ -3520,7 +3519,7 @@ pads(pm)
}
-void
+static void
pmap_pvdump(pa)
vm_offset_t pa;
{
diff --git a/sys/i386/i386/setdef0.c b/sys/i386/i386/setdef0.c
new file mode 100644
index 000000000000..e57ce17f0515
--- /dev/null
+++ b/sys/i386/i386/setdef0.c
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * 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.
+ *
+ * $Id: setdef0.c,v 1.1 1997/04/22 06:55:28 jdp Exp $
+ */
+
+#ifdef __ELF__
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+
+/*
+ * DEFINE_SET creates the section and label for a set, and emits the
+ * count word at the front of it.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".globl " #set); \
+ __asm__(".type " #set ",@object"); \
+ __asm__(".p2align 2"); \
+ __asm__(#set ":"); \
+ __asm__(".long " #count); \
+ __asm__(".previous")
+
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
+
+#endif /* __ELF__ */
diff --git a/sys/i386/i386/setdef1.c b/sys/i386/i386/setdef1.c
new file mode 100644
index 000000000000..c9dd23458cdc
--- /dev/null
+++ b/sys/i386/i386/setdef1.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * 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.
+ *
+ * $Id: setdef1.c,v 1.1 1997/04/22 06:55:28 jdp Exp $
+ */
+
+#ifdef __ELF__
+
+/*
+ * DEFINE_SET emits the NULL terminator for a set.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".long 0"); \
+ __asm__(".previous")
+
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
+
+#endif /* __ELF__ */
diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s
index 5ed5780c6a83..d1e77c8a4413 100644
--- a/sys/i386/i386/support.s
+++ b/sys/i386/i386/support.s
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.59 1998/05/11 02:13:43 dyson Exp $
+ * $Id: support.s,v 1.58 1997/12/14 02:11:09 dyson Exp $
*/
#include "npx.h"
@@ -398,6 +398,7 @@ ENTRY(fillw)
ret
ENTRY(bcopyb)
+bcopyb:
pushl %esi
pushl %edi
movl 12(%esp),%esi
diff --git a/sys/i386/i386/swapgeneric.c b/sys/i386/i386/swapgeneric.c
index 7cc6e4b029cf..5575e6223f87 100644
--- a/sys/i386/i386/swapgeneric.c
+++ b/sys/i386/i386/swapgeneric.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
- * $Id: swapgeneric.c,v 1.24 1998/09/15 10:03:43 gibbs Exp $
+ * $Id: swapgeneric.c,v 1.23 1998/02/20 13:37:37 bde Exp $
*/
#include <sys/param.h>
@@ -138,8 +138,7 @@ bad:
unit = 0;
for (gc = genericconf; gc->gc_name; gc++) {
for (bd = 0; bd < nblkdev; bd++) {
- if (bdevsw[bd] != NULL &&
- strcmp(bdevsw[bd]->d_name, gc->gc_name) == 0) {
+ if (!strcmp(bdevsw[bd]->d_name, gc->gc_name)) {
printf("root on %s0\n", bdevsw[bd]->d_name);
goto found;
}
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 63804abe0d46..0f569f25f1a4 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
- * $Id: sys_machdep.c,v 1.37 1998/08/24 02:28:15 bde Exp $
+ * $Id: sys_machdep.c,v 1.36 1998/08/18 07:46:58 msmith Exp $
*
*/
@@ -124,6 +124,7 @@ i386_extend_pcb(struct proc *p)
int i, offset;
u_long *addr;
struct pcb_ext *ext;
+ struct segment_descriptor sd;
struct soft_segment_descriptor ssd = {
0, /* segment base address (overwritten) */
ctob(IOPAGES + 1) - 1, /* length */
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 42b0c85c2329..c4935d0160a7 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.132 1998/12/28 23:02:56 msmith Exp $
+ * $Id: trap.c,v 1.127 1998/04/28 18:15:04 eivind Exp $
*/
/*
@@ -93,10 +93,6 @@
#include <machine/vm86.h>
#endif
-#ifdef DDB
- extern int in_Debugger, debugger_on_panic;
-#endif
-
#include "isa.h"
#include "npx.h"
@@ -108,8 +104,8 @@ extern void trap __P((struct trapframe frame));
extern int trapwrite __P((unsigned addr));
extern void syscall __P((struct trapframe frame));
-static int trap_pfault __P((struct trapframe *, int, vm_offset_t));
-static void trap_fatal __P((struct trapframe *, vm_offset_t));
+static int trap_pfault __P((struct trapframe *, int));
+static void trap_fatal __P((struct trapframe *));
void dblfault_handler __P((void));
extern inthand_t IDTVEC(syscall);
@@ -220,46 +216,9 @@ trap(frame)
struct proc *p = curproc;
u_quad_t sticks = 0;
int i = 0, ucode = 0, type, code;
- vm_offset_t eva;
-
- if (!(frame.tf_eflags & PSL_I)) {
- /*
- * Buggy application or kernel code has disabled interrupts
- * and then trapped. Enabling interrupts now is wrong, but
- * it is better than running with interrupts disabled until
- * they are accidentally enabled later.
- */
- type = frame.tf_trapno;
- if (ISPL(frame.tf_cs) == SEL_UPL || (frame.tf_eflags & PSL_VM))
- printf(
- "pid %ld (%s): trap %d with interrupts disabled\n",
- (long)curproc->p_pid, curproc->p_comm, type);
- else if (type != T_BPTFLT && type != T_TRCTRAP)
- /*
- * XXX not quite right, since this may be for a
- * multiple fault in user mode.
- */
- printf("kernel trap %d with interrupts disabled\n",
- type);
- enable_intr();
- }
-
- eva = 0;
- if (frame.tf_trapno == T_PAGEFLT) {
- /*
- * For some Cyrix CPUs, %cr2 is clobbered by interrupts.
- * This problem is worked around by using an interrupt
- * gate for the pagefault handler. We are finally ready
- * to read %cr2 and then must reenable interrupts.
- *
- * XXX this should be in the switch statement, but the
- * NO_FOOF_HACK and VM86 goto and ifdefs obfuscate the
- * flow of control too much for this to be obviously
- * correct.
- */
- eva = rcr2();
- enable_intr();
- }
+#ifdef DEBUG
+ u_long eva;
+#endif
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
restart:
@@ -286,7 +245,7 @@ restart:
*/
case T_PROTFLT:
case T_SEGNPFLT:
- trap_fatal(&frame, eva);
+ trap_fatal(&frame);
return;
case T_TRCTRAP:
type = T_BPTFLT; /* kernel breakpoint */
@@ -355,7 +314,7 @@ restart:
break;
case T_PAGEFLT: /* page fault */
- i = trap_pfault(&frame, TRUE, eva);
+ i = trap_pfault(&frame, TRUE);
if (i == -1)
return;
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
@@ -434,7 +393,7 @@ kernel_trap:
switch (type) {
case T_PAGEFLT: /* page fault */
- (void) trap_pfault(&frame, FALSE, eva);
+ (void) trap_pfault(&frame, FALSE);
return;
case T_DNA:
@@ -582,7 +541,7 @@ kernel_trap:
#endif /* NISA > 0 */
}
- trap_fatal(&frame, eva);
+ trap_fatal(&frame);
return;
}
@@ -593,11 +552,12 @@ kernel_trap:
trapsignal(p, i, ucode);
#ifdef DEBUG
+ eva = rcr2();
if (type <= MAX_TRAP_MSG) {
uprintf("fatal process exception: %s",
trap_msg[type]);
if ((type == T_PAGEFLT) || (type == T_PROTFLT))
- uprintf(", fault VA = 0x%lx", (u_long)eva);
+ uprintf(", fault VA = 0x%lx", eva);
uprintf("\n");
}
#endif
@@ -615,16 +575,16 @@ out:
* debugging code.
*/
static int
-trap_pfault(frame, usermode, eva)
+trap_pfault(frame, usermode)
struct trapframe *frame;
int usermode;
- vm_offset_t eva;
{
vm_offset_t va;
struct vmspace *vm = NULL;
vm_map_t map = 0;
int rv = 0;
vm_prot_t ftype;
+ int eva;
struct proc *p = curproc;
if (frame->tf_err & PGEX_W)
@@ -632,7 +592,9 @@ trap_pfault(frame, usermode, eva)
else
ftype = VM_PROT_READ;
- va = trunc_page(eva);
+ eva = rcr2();
+ va = trunc_page((vm_offset_t)eva);
+
if (va < VM_MIN_KERNEL_ADDRESS) {
vm_offset_t v;
vm_page_t mpte;
@@ -641,7 +603,7 @@ trap_pfault(frame, usermode, eva)
(!usermode && va < VM_MAXUSER_ADDRESS &&
(intr_nesting_level != 0 || curpcb == NULL ||
curpcb->pcb_onfault == NULL))) {
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -665,8 +627,8 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
-#ifndef VM_STACK
- if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@@ -674,20 +636,6 @@ trap_pfault(frame, usermode, eva)
}
}
-#else
- /* grow_stack returns false only if va falls into
- * a growable stack region and the stack growth
- * fails. It returns true if va was not within
- * a growable stack region, or if the stack
- * growth succeeded.
- */
- if (!grow_stack (p, va)) {
- rv = KERN_FAILURE;
- --p->p_lock;
- goto nogo;
- }
-#endif
-
/* Fault in the user page: */
rv = vm_fault(map, va, ftype,
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
@@ -716,7 +664,7 @@ nogo:
frame->tf_eip = (int)curpcb->pcb_onfault;
return (0);
}
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -728,19 +676,21 @@ nogo:
#endif
int
-trap_pfault(frame, usermode, eva)
+trap_pfault(frame, usermode)
struct trapframe *frame;
int usermode;
- vm_offset_t eva;
{
vm_offset_t va;
struct vmspace *vm = NULL;
vm_map_t map = 0;
int rv = 0;
vm_prot_t ftype;
+ int eva;
struct proc *p = curproc;
- va = trunc_page(eva);
+ eva = rcr2();
+ va = trunc_page((vm_offset_t)eva);
+
if (va >= KERNBASE) {
/*
* Don't allow user-mode faults in kernel address space.
@@ -790,27 +740,14 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
-#ifndef VM_STACK
- if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
goto nogo;
}
}
-#else
- /* grow_stack returns false only if va falls into
- * a growable stack region and the stack growth
- * fails. It returns true if va was not within
- * a growable stack region, or if the stack
- * growth succeeded.
- */
- if (!grow_stack (p, va)) {
- rv = KERN_FAILURE;
- --p->p_lock;
- goto nogo;
- }
-#endif
/* Fault in the user page: */
rv = vm_fault(map, va, ftype,
@@ -832,7 +769,7 @@ nogo:
frame->tf_eip = (int)curpcb->pcb_onfault;
return (0);
}
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -843,15 +780,15 @@ nogo:
}
static void
-trap_fatal(frame, eva)
+trap_fatal(frame)
struct trapframe *frame;
- vm_offset_t eva;
{
- int code, type, ss, esp;
+ int code, type, eva, ss, esp;
struct soft_segment_descriptor softseg;
code = frame->tf_err;
type = frame->tf_trapno;
+ eva = rcr2();
sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg);
if (type <= MAX_TRAP_MSG)
@@ -934,7 +871,7 @@ trap_fatal(frame, eva)
return;
#endif
#ifdef DDB
- if ((debugger_on_panic || in_Debugger) && kdb_trap(type, 0, frame))
+ if (kdb_trap (type, 0, frame))
return;
#endif
printf("trap number = %d\n", type);
@@ -998,19 +935,13 @@ int trapwrite(addr)
++p->p_lock;
-#ifndef VM_STACK
- if ((caddr_t)va >= vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va >= vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
--p->p_lock;
return (1);
}
}
-#else
- if (!grow_stack (p, va)) {
- --p->p_lock;
- return (1);
- }
-#endif
/*
* fault the data page
diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c
index c505d71e0e79..a6361ebaf7b1 100644
--- a/sys/i386/i386/userconfig.c
+++ b/sys/i386/i386/userconfig.c
@@ -46,7 +46,7 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
- ** $Id: userconfig.c,v 1.125 1999/01/14 23:43:22 bde Exp $
+ ** $Id: userconfig.c,v 1.111 1998/10/06 07:34:26 msmith Exp $
**/
/**
@@ -113,8 +113,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
-#include <sys/linker.h>
-#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@@ -133,156 +131,36 @@ static MALLOC_DEFINE(M_DEVL, "isa_devlist", "isa_device lists in userconfig()");
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
+#ifdef USERCONFIG_BOOT
+char userconfig_from_boot[512] = "";
static int userconfig_boot_parsing; /* set if we are reading from the boot instructions */
-#define putchar(x) cnputc(x)
-
-static int
-sysctl_machdep_uc_devlist SYSCTL_HANDLER_ARGS
-{
- struct isa_device *id;
- int error=0;
- char name[8];
-
- if(!req->oldptr) {
- /* Only sizing */
- id=isa_devlist;
- while(id) {
- error+=sizeof(struct isa_device)+8;
- id=id->id_next;
- }
- return(SYSCTL_OUT(req,0,error));
- } else {
- /* Output the data. The buffer is filled with consecutive
- * struct isa_device and char buf[8], containing the name
- * (not guaranteed to end with '\0').
- */
- id=isa_devlist;
- while(id) {
- error=sysctl_handle_opaque(oidp,id,
- sizeof(struct isa_device),req);
- if(error) return(error);
- strncpy(name,id->id_driver->name,8);
- error=sysctl_handle_opaque(oidp,name,
- 8,req);
- if(error) return(error);
- id=id->id_next;
- }
- return(0);
- }
-}
-
-SYSCTL_PROC( _machdep, OID_AUTO, uc_devlist, CTLFLAG_RD,
- 0, 0, sysctl_machdep_uc_devlist, "A",
- "List of ISA devices changed in UserConfig");
-
-/*
-** Obtain command input.
-**
-** Initially, input is read from a possibly-loaded script.
-** At the end of the script, or if no script is supplied,
-** behaviour is determined by the RB_CONFIG (-c) flag. If
-** the flag is set, user input is read from the console; if
-** unset, the 'quit' command is invoked and userconfig
-** will exit.
-**
-** Note that quit commands encountered in the script will be
-** ignored if the RB_CONFIG flag is supplied.
-*/
static int
getchar(void)
{
- static const char *asp;
- static int assize; /* use of int for -ve magic value */
- static int autocheck = 0;
- caddr_t autoentry, autoattr;
- int c = 0;
- static int intro = 0;
-
- /* Look for loaded userconfig script */
- if (autocheck == 0)
- {
- autocheck = 1;
- autoentry = preload_search_by_type("userconfig_script");
- if (autoentry != NULL)
- {
- /* We have one, get size and data */
- assize = 0;
- if ((autoattr = preload_search_info(autoentry, MODINFO_SIZE)) != NULL)
- assize = (size_t)*(u_int32_t *)autoattr;
- asp = NULL;
- if ((autoattr = preload_search_info(autoentry, MODINFO_ADDR)) != NULL)
- asp = *(const char **)autoattr;
- /* sanity check */
- if ((assize == 0) || (asp == NULL)) {
- assize = 0;
- asp = NULL;
- }
- }
- }
+ static char *next = userconfig_from_boot;
- if (assize > 0)
- {
- /* Consume character from loaded userconfig script, display */
- userconfig_boot_parsing = 1;
- c = *asp;
- asp++;
- assize--;
-
- } else if (assize == 0) {
-
-#ifdef INTRO_USERCONFIG
- if (intro == 0)
- {
- /*
- * We don't want intro if we just executed a
- * script (userconfig_boot_parsing==1), otherwise
- * we would always block here waiting for user input.
- */
- intro = 1;
- if (userconfig_boot_parsing == 0)
- {
- /* userconfig_boot_parsing will be set to 1 on next pass,
- * which will allow using 'intro' in the middle of other
- * userconfig_script commands.
- */
- c = 'i';
- asp = "ntro\n";
- assize = strlen(asp);
- } else {
- userconfig_boot_parsing = 0;
- assize=-1;
- }
-#else
- userconfig_boot_parsing = 0;
- if (!(boothowto & RB_CONFIG))
- {
- /* don't want to drop to interpreter */
- c = 'q';
- asp = "uit\n";
- assize = strlen(asp);
-#endif
- userconfig_boot_parsing = 0;
+ if (next == userconfig_from_boot) {
+ if (strncmp(next, "USERCONFIG\n", 11)) {
+ next++;
+ strcpy(next, "intro\n");
} else {
- /* Only display signon banner if we are about to go interactive */
- if (!intro)
- printf("\nFreeBSD Kernel Configuration Utility - Version 1.2\n"
- " Type \"help\" for help"
-#ifdef VISUAL_USERCONFIG
- " or \"visual\" to go to the visual\n"
- " configuration interface (requires MGA/VGA display or\n"
- " serial terminal capable of displaying ANSI graphics)"
-#endif
- ".\n");
- assize = -1;
+ next += 11;
}
+ }
+ if (*next) {
+ userconfig_boot_parsing = 1;
+ return (*next++);
+ } else {
+ userconfig_boot_parsing = 0;
+ return cngetc();
}
- if (assize < 0) {
- /* No script, read from the keyboard */
- c = cngetc();
- }
- return(c);
}
+#else /* !USERCONFIG_BOOT */
+#define getchar() cngetc()
+#endif /* USERCONFIG_BOOT */
+
+#define putchar(x) cnputc(x)
#ifndef FALSE
#define FALSE (0)
@@ -392,16 +270,10 @@ static DEV_INFO device_info[] = {
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
-{"ax", "ASIC AX88140A ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"fpa", "DEC DEFPA PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
-{"rl", "RealTek 8129/8139 ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"mx", "Macronix PMAC ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"pn", "Lite-On 82c168/82c169 PNIC adapter", FLG_FIXED, CLS_NETWORK},
-{"tl", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"vr", "VIA Rhine/Rhine II ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"wb", "Winbond W89C840F ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"xl", "3COM 3C90x PCI ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"tlc", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"xl", "3COM 3C90x PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
{"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS},
{"cx", "Cronyx/Sigma multiport sync/async adapter",0, CLS_COMMS},
@@ -2066,17 +1938,15 @@ static void
helpscreen(void)
{
int topline = 0; /* where we are in the text */
- int c, delta = 1;
+ int line, c, delta = 1;
char prompt[80];
for (;;) /* loop until user quits */
{
- int line = 0;
-
/* display help text */
if (delta)
{
- clear(); /* remove everything else */
+ clear(); /* remove everything else */
for (line = topline;
(line < (topline + 24)) && (helptext[line]);
line++)
@@ -2516,7 +2386,7 @@ visuserconfig(void)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: userconfig.c,v 1.125 1999/01/14 23:43:22 bde Exp $
+ * $Id: userconfig.c,v 1.111 1998/10/06 07:34:26 msmith Exp $
*/
#include "scbus.h"
@@ -2569,7 +2439,7 @@ static int set_device_enable(CmdParm *);
static int set_device_disable(CmdParm *);
static int quitfunc(CmdParm *);
static int helpfunc(CmdParm *);
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
static int introfunc(CmdParm *);
#endif
@@ -2607,12 +2477,10 @@ static CmdParm dev_parms[] = {
{ -1, {} },
};
-#if NPNP > 0
static CmdParm string_arg[] = {
{ PARM_STRING, {} },
{ -1, {} },
};
-#endif
#if NEISA > 0
static CmdParm int_arg[] = {
@@ -2632,7 +2500,7 @@ static Cmd CmdList[] = {
{ "ex", quitfunc, NULL }, /* exit (quit) */
{ "f", set_device_flags, int_parms }, /* flags dev mask */
{ "h", helpfunc, NULL }, /* help */
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
{ "intro", introfunc, NULL }, /* intro screen */
#endif
{ "iom", set_device_mem, addr_parms }, /* iomem dev addr */
@@ -2661,6 +2529,16 @@ userconfig(void)
int rval;
Cmd *cmd;
+ printf("\nFreeBSD Kernel Configuration Utility - Version 1.1\n"
+ " Type \"help\" for help"
+#ifdef VISUAL_USERCONFIG
+ " or \"visual\" to go to the visual\n"
+ " configuration interface (requires MGA/VGA display or\n"
+ " serial terminal capable of displaying ANSI graphics)"
+#endif
+ ".\n");
+
+
while (1) {
printf("config> ");
cngets(input, 80);
@@ -2970,6 +2848,7 @@ set_num_eisa_slots(CmdParm *parms)
static int
quitfunc(CmdParm *parms)
{
+#ifdef USERCONFIG_BOOT
/*
* If kernel config supplied, and we are parsing it, and -c also supplied,
* ignore a quit command, This provides a safety mechanism to allow
@@ -2977,6 +2856,7 @@ quitfunc(CmdParm *parms)
*/
if ((boothowto & RB_CONFIG) && userconfig_boot_parsing)
return 0;
+#endif
return 1;
}
@@ -3019,7 +2899,7 @@ helpfunc(CmdParm *parms)
return 0;
}
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
#if defined (VISUAL_USERCONFIG)
static void
@@ -3153,10 +3033,7 @@ introfunc(CmdParm *parms)
return visuserconfig();
else {
putxy(0, 1, "Type \"help\" for help or \"quit\" to exit.");
- /* enable quitfunc */
- userconfig_boot_parsing=0;
move (0, 3);
- boothowto |= RB_CONFIG; /* force -c */
return 0;
}
break;
@@ -3185,14 +3062,12 @@ lspnp ()
"mem 0x%x 0x%x 0x%x 0x%x";
char buf[256];
if (lineno >= 23) {
- if (!userconfig_boot_parsing) {
- printf("<More> ");
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ printf("<More> ");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0 || first)
@@ -3238,13 +3113,11 @@ lsdevtab(struct isa_device *dt)
if (lineno >= 23) {
printf("<More> ");
- if (!userconfig_boot_parsing) {
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0) {
diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c
index 3a536e2d9a6a..eef835b18866 100644
--- a/sys/i386/i386/vm86.c
+++ b/sys/i386/i386/vm86.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm86.c,v 1.18 1998/09/29 22:06:33 ache Exp $
+ * $Id: vm86.c,v 1.17 1998/09/29 20:36:31 ache Exp $
*/
#include "opt_vm86.h"
@@ -359,6 +359,7 @@ vm86_initialize(void)
struct vm86_layout *vml = (struct vm86_layout *)vm86paddr;
struct pcb *pcb;
struct pcb_ext *ext;
+ struct segment_descriptor sd;
struct soft_segment_descriptor ssd = {
0, /* segment base address (overwritten) */
0, /* length (overwritten) */
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index d0bdc9393b55..de8b52cc466b 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.114 1998/12/16 15:21:51 bde Exp $
+ * $Id: vm_machdep.c,v 1.111 1998/09/28 03:34:39 tegge Exp $
*/
#include "npx.h"
@@ -507,7 +507,6 @@ cpu_reset_real()
while(1);
}
-#ifndef VM_STACK
/*
* Grow the user stack to allow for 'sp'. This version grows the stack in
* chunks of SGROWSIZ.
@@ -521,10 +520,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
- if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
- return (1);
+ if ((caddr_t)sp <= vm->vm_maxsaddr || (unsigned)sp >= (unsigned)USRSTACK)
+ return (1);
- nss = roundup(USRSTACK - sp, PAGE_SIZE);
+ nss = roundup(USRSTACK - (unsigned)sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);
@@ -560,27 +559,10 @@ grow(p, sp)
return (1);
}
-#else
-int
-grow_stack(p, sp)
- struct proc *p;
- u_int sp;
-{
- int rv;
-
- rv = vm_map_growstack (p, sp);
- if (rv != KERN_SUCCESS)
- return (0);
-
- return (1);
-}
-#endif
-
static int cnt_prezero;
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
+SYSCTL_INT(_machdep, OID_AUTO, cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
/*
* Implement the pre-zeroed page mechanism.
diff --git a/sys/i386/ibcs2/ibcs2_errno.c b/sys/i386/ibcs2/ibcs2_errno.c
index b2e78c9053b5..657985926ead 100644
--- a/sys/i386/ibcs2/ibcs2_errno.c
+++ b/sys/i386/ibcs2/ibcs2_errno.c
@@ -29,10 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/errno.h>
#include <i386/ibcs2/ibcs2_errno.h>
-int bsd_to_ibcs2_errno[ELAST + 1] = {
+int bsd_to_ibcs2_errno[] = {
0, /* 0 */
IBCS2_EPERM, /* 1 */
IBCS2_ENOENT, /* 2 */
@@ -117,8 +116,5 @@ int bsd_to_ibcs2_errno[ELAST + 1] = {
0, /* 81 */
IBCS2_EIDRM, /* 82 */
IBCS2_ENOMSG, /* 83 */
- IBCS2_EOVERFLOW, /* 84 */
- 0, /* 85 */
- IBCS2_EILSEQ, /* 86 */
};
diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c
index c7f109a3cb9d..e52bd2cdf742 100644
--- a/sys/i386/ibcs2/ibcs2_socksys.c
+++ b/sys/i386/ibcs2/ibcs2_socksys.c
@@ -146,7 +146,7 @@ ibcs2_getipdomainname(p, uap)
int len;
/* Get the domain name */
- snprintf(hname, sizeof(hname), "%s", hostname);
+ strcpy(hname, hostname);
dptr = index(hname, '.');
if ( dptr )
dptr++;
@@ -177,7 +177,7 @@ ibcs2_setipdomainname(p, uap)
return EINVAL;
/* Get the host's unqualified name (strip off the domain) */
- snprintf(hname, sizeof(hname), "%s", hostname);
+ strcpy(hname, hostname);
ptr = index(hname, '.');
if ( ptr != NULL ) {
ptr++;
diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c
index d3bf6ae077d2..febf4d2552d8 100644
--- a/sys/i386/ibcs2/ibcs2_stat.c
+++ b/sys/i386/ibcs2/ibcs2_stat.c
@@ -221,19 +221,20 @@ ibcs2_utssys(p, uap)
struct ibcs2_utsname sut;
bzero(&sut, ibcs2_utsname_len);
- strncpy(sut.sysname,
- IBCS2_UNAME_SYSNAME, sizeof(sut.sysname) - 1);
- strncpy(sut.release,
- IBCS2_UNAME_RELEASE, sizeof(sut.release) - 1);
- strncpy(sut.version,
- IBCS2_UNAME_VERSION, sizeof(sut.version) - 1);
- strncpy(machine_name, hostname, sizeof(machine_name) - 1);
- machine_name[sizeof(machine_name) - 1] = 0;
+ strncpy(sut.sysname, IBCS2_UNAME_SYSNAME, sizeof(sut.sysname));
+ strncpy(sut.release, IBCS2_UNAME_RELEASE, sizeof(sut.release));
+ strncpy(sut.version, IBCS2_UNAME_VERSION, sizeof(sut.version));
+ strncpy(machine_name, hostname, sizeof(machine_name));
p = index(machine_name, '.');
if ( p )
*p = '\0';
- strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1);
- strncpy(sut.machine, machine, sizeof(sut.machine) - 1);
+ strncpy(sut.nodename, machine_name, sizeof(sut.nodename));
+ strncpy(sut.machine, machine, sizeof(sut.machine));
+ sut.sysname[sizeof(sut.sysname)-1] = '\0';
+ sut.release[sizeof(sut.release)-1] = '\0';
+ sut.version[sizeof(sut.version)-1] = '\0';
+ sut.nodename[sizeof(sut.nodename)-1] = '\0';
+ sut.machine[sizeof(sut.machine)-1] = '\0';
DPRINTF(("IBCS2 uname: sys=%s rel=%s ver=%s node=%s mach=%s\n",
sut.sysname, sut.release, sut.version, sut.nodename,
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index bc0fa61e3bde..2a10b0e1eaae 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -27,12 +27,10 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ibcs2_sysvec.c,v 1.12 1998/12/14 18:53:47 dt Exp $
+ * $Id: ibcs2_sysvec.c,v 1.7 1998/04/28 18:15:05 eivind Exp $
*/
#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/sysent.h>
#include <sys/signalvar.h>
#include <i386/ibcs2/ibcs2_syscall.h>
@@ -49,7 +47,7 @@ struct sysentvec ibcs2_svr3_sysvec = {
0xFF,
NSIG,
bsd_to_ibcs2_sig,
- ELAST + 1,
+ ELAST,
bsd_to_ibcs2_errno,
0, /* trap-to-signal translation function */
0, /* fixup */
@@ -60,20 +58,3 @@ struct sysentvec ibcs2_svr3_sysvec = {
"IBCS2 COFF",
NULL /* we don't have a COFF coredump function */
};
-
-/*
- * Create an "ibcs2" module that does nothing but allow checking for
- * the presence of the subsystem.
- */
-static int
-ibcs2_modevent(module_t mod, int type, void *unused)
-{
- /* Do not care */
- return 0;
-}
-moduledata_t ibcs2_mod = {
- "ibcs2",
- ibcs2_modevent,
- 0
-};
-DECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
diff --git a/sys/i386/ibcs2/ibcs2_util.h b/sys/i386/ibcs2/ibcs2_util.h
index 4ef390f64ffb..e616234cb245 100644
--- a/sys/i386/ibcs2/ibcs2_util.h
+++ b/sys/i386/ibcs2/ibcs2_util.h
@@ -61,7 +61,7 @@ static __inline caddr_t
stackgap_init()
{
#define szsigcode (*(curproc->p_sysent->sv_szsigcode))
- return (caddr_t)(PS_STRINGS - szsigcode - SPARE_USRSPACE);
+ return (caddr_t)(((caddr_t)PS_STRINGS) - szsigcode - SPARE_USRSPACE);
}
static __inline void *
diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c
index 8ab55563384e..0677edec6a2f 100644
--- a/sys/i386/ibcs2/ibcs2_xenix.c
+++ b/sys/i386/ibcs2/ibcs2_xenix.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ibcs2_xenix.c,v 1.16 1998/08/16 01:21:49 bde Exp $
+ * $Id: ibcs2_xenix.c,v 1.15 1998/06/02 05:39:07 dyson Exp $
*/
#include <sys/param.h>
@@ -157,22 +157,14 @@ xenix_utsname(struct proc *p, struct xenix_utsname_args *uap)
DPRINTF(("IBCS2: 'xenix sco_utsname'\n"));
bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname));
- strncpy(ibcs2_sco_uname.sysname, ostype,
- sizeof(ibcs2_sco_uname.sysname) - 1);
- strncpy(ibcs2_sco_uname.nodename, hostname,
- sizeof(ibcs2_sco_uname.nodename) - 1);
- strncpy(ibcs2_sco_uname.release, osrelease,
- sizeof(ibcs2_sco_uname.release) - 1);
- strncpy(ibcs2_sco_uname.kernelid, version,
- sizeof(ibcs2_sco_uname.kernelid) - 1);
- strncpy(ibcs2_sco_uname.machine, machine,
- sizeof(ibcs2_sco_uname.machine) - 1);
- strncpy(ibcs2_sco_uname.bustype, "ISA/EISA",
- sizeof(ibcs2_sco_uname.bustype) - 1);
- strncpy(ibcs2_sco_uname.sysserial, "no charge",
- sizeof(ibcs2_sco_uname.sysserial) - 1);
- strncpy(ibcs2_sco_uname.numusers, "unlim",
- sizeof(ibcs2_sco_uname.numusers) - 1);
+ strncpy(ibcs2_sco_uname.sysname, ostype, 8);
+ strncpy(ibcs2_sco_uname.nodename, hostname, 8);
+ strncpy(ibcs2_sco_uname.release, osrelease, 15);
+ strncpy(ibcs2_sco_uname.kernelid, version, 19);
+ strncpy(ibcs2_sco_uname.machine, machine, 8);
+ bcopy("ISA/EISA", ibcs2_sco_uname.bustype, 8);
+ bcopy("no charge", ibcs2_sco_uname.sysserial, 9);
+ bcopy("unlim", ibcs2_sco_uname.numusers, 8);
ibcs2_sco_uname.sysorigin = 0xFFFF;
ibcs2_sco_uname.sysoem = 0xFFFF;
ibcs2_sco_uname.numcpu = 1;
diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c
index 3632b7415e3d..7793f4cc42a5 100644
--- a/sys/i386/ibcs2/imgact_coff.c
+++ b/sys/i386/ibcs2/imgact_coff.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_coff.c,v 1.33 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_coff.c,v 1.32 1998/10/13 08:24:36 dg Exp $
*/
#include <sys/param.h>
@@ -475,7 +475,7 @@ exec_coff_imgact(imgp)
/*
* Tell kern_execve.c about it, with a little help from the linker.
* Since `const' objects end up in the text segment, TEXT_SET is the
- * correct directive to use.
+ * correct directive to use. Do not staticize; used by coff LKM.
*/
-static const struct execsw coff_execsw = { exec_coff_imgact, "coff" };
+const struct execsw coff_execsw = { exec_coff_imgact, "coff" };
EXEC_SET(coff, coff_execsw);
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index 9d7494e0fc12..52dad0bf856d 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
- * $Id: ansi.h,v 1.15 1998/06/14 14:00:47 bde Exp $
+ * $Id: ansi.h,v 1.14 1998/01/08 00:27:30 alex Exp $
*/
#ifndef _MACHINE_ANSI_H_
@@ -54,6 +54,9 @@
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_TIME_T_ long /* time()... */
#define _BSD_TIMER_T_ int /* timer_gettime()... */
+#define _BSD_UINT8_T_ unsigned char /* unsigned exactly 8 bits */
+#define _BSD_UINT16_T_ unsigned short /* unsigned exactly 16 bits */
+#define _BSD_UINT32_T_ unsigned int /* unsigned exactly 32 bits */
#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
/*
@@ -106,18 +109,5 @@ typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
#endif
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-
-typedef int __intptr_t;
-typedef unsigned int __uintptr_t;
#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/i386/include/apm_bios.h b/sys/i386/include/apm_bios.h
index 43028b370113..616e36a2e894 100644
--- a/sys/i386/include/apm_bios.h
+++ b/sys/i386/include/apm_bios.h
@@ -12,7 +12,7 @@
*
* Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm_bios.h,v 1.20 1998/07/06 06:29:05 imp Exp $
+ * $Id: apm_bios.h,v 1.19 1997/11/12 04:12:51 jdp Exp $
*/
#ifndef _MACHINE_APM_BIOS_H_
@@ -160,6 +160,7 @@ struct apmhook *apm_hook_establish (int apmh, struct apmhook *);
void apm_hook_disestablish (int apmh, struct apmhook *);
void apm_cpu_idle(void);
void apm_cpu_busy(void);
+void apm_power_off(void);
#endif /* KERNEL */
diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h
index c79759c356bd..7f70bcaa052b 100644
--- a/sys/i386/include/console.h
+++ b/sys/i386/include/console.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: console.h,v 1.42 1999/01/01 14:38:28 des Exp $
+ * $Id: console.h,v 1.40 1998/09/23 09:58:45 yokota Exp $
*/
#ifndef _MACHINE_CONSOLE_H_
@@ -52,7 +52,6 @@
#define KDSETLED _IO('K', 66 /*, int */)
#define KDSETRAD _IO('K', 67 /*, int */)
#define KDRASTER _IOW('K', 100, scr_size_t)
-#define KDGKBINFO _IOR('K', 101, keyboard_info_t)
#define GETFKEY _IOWR('k', 0, fkeyarg_t)
#define SETFKEY _IOWR('k', 1, fkeyarg_t)
@@ -62,8 +61,6 @@
#define PIO_KEYMAP _IOW('k', 7, keymap_t)
#define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t)
#define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t)
-#define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t)
-#define PIO_KEYMAPENT _IOW('k', 11, keyarg_t)
#define GIO_ATTR _IOR('a', 0, int)
#define GIO_COLOR _IOR('c', 0, int)
@@ -89,14 +86,11 @@
#define CONS_GETINFO _IOWR('c', 73, vid_info_t)
#define CONS_GETVERS _IOR('c', 74, int)
#define CONS_CURRENTADP _IOR('c', 100, int)
-#define CONS_ADPINFO _IOWR('c', 101, video_adapter_info_t)
+#define CONS_ADPINFO _IOWR('c', 101, video_adapter_t)
#define CONS_MODEINFO _IOWR('c', 102, video_info_t)
#define CONS_FINDMODE _IOWR('c', 103, video_info_t)
#define CONS_SETWINORG _IO('c', 104 /* u_int */)
-#define CONS_SETKBD _IO('c', 110 /* int */)
-#define CONS_RELKBD _IO('c', 111)
-
/* CONS_SAVERMODE */
#define CONS_LKM_SAVER 0
#define CONS_USR_SAVER 1
@@ -195,11 +189,9 @@ struct mouse_info {
#define NLKED 2 /* Num locked */
#define SLKED 4 /* Scroll locked */
#define ALKED 8 /* AltGr locked */
-#define LOCK_MASK (CLKED | NLKED | SLKED | ALKED)
#define LED_CAP 1 /* Caps lock LED */
#define LED_NUM 2 /* Num lock LED */
#define LED_SCR 4 /* Scroll lock LED */
-#define LED_MASK (LED_CAP | LED_NUM | LED_SCR)
/* possible flag values */
#define FLAG_LOCK_O 0
@@ -212,7 +204,7 @@ struct mouse_info {
#ifndef _KEYMAP_DECLARED
#define _KEYMAP_DECLARED
-struct keyent_t {
+struct key_t {
u_char map[NUM_STATES];
u_char spcl;
u_char flgs;
@@ -220,17 +212,10 @@ struct keyent_t {
struct keymap {
u_short n_keys;
- struct keyent_t key[NUM_KEYS];
+ struct key_t key[NUM_KEYS];
};
typedef struct keymap keymap_t;
-
-struct keyarg {
- u_short keynum;
- struct keyent_t key;
-};
-
-typedef struct keyarg keyarg_t;
#endif /* !_KEYMAP_DECLARED */
#define NUM_DEADKEYS 15 /* number of accent keys */
@@ -289,9 +274,6 @@ struct ssaver {
struct video_adapter {
int va_index;
int va_type;
- char *va_name;
- int va_unit;
- int va_minor;
int va_flags;
#define V_ADP_COLOR (1<<0)
#define V_ADP_MODECHANGE (1<<1)
@@ -301,14 +283,7 @@ struct video_adapter {
#define V_ADP_PALETTE (1<<5)
#define V_ADP_BORDER (1<<6)
#define V_ADP_VESA (1<<7)
-#define V_ADP_PROBED (1<<16)
-#define V_ADP_INITIALIZED (1<<17)
-#define V_ADP_REGISTERED (1<<18)
- int va_io_base;
- int va_io_size;
int va_crtc_addr;
- int va_mem_base;
- int va_mem_size;
u_int va_window; /* virtual address */
size_t va_window_size;
size_t va_window_gran;
@@ -317,30 +292,6 @@ struct video_adapter {
int va_initial_mode;
int va_initial_bios_mode;
int va_mode;
- int va_mode_flags; /* copy of vi_flags */
- void *va_token;
-};
-
-struct video_adapter_info {
- int va_index;
- int va_type;
- char va_name[16];
- int va_unit;
- int va_flags;
- int va_io_base;
- int va_io_size;
- int va_crtc_addr;
- int va_mem_base;
- int va_mem_size;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
- int va_mode_flags;
};
#define V_ADP_PRIMARY 0
@@ -352,7 +303,7 @@ struct video_info {
int vi_flags;
#define V_INFO_COLOR (1<<0)
#define V_INFO_GRAPHICS (1<<1)
-#define V_INFO_LINEAR (1<<2)
+#define V_INFO_LENEAR (1<<2)
#define V_INFO_VESA (1<<3)
int vi_width;
int vi_height;
@@ -368,15 +319,6 @@ struct video_info {
/* XXX pixel format, memory model,... */
};
-struct keyboard_info {
- int kb_index; /* kbdio index# */
- char kb_name[16]; /* driver name */
- int kb_unit; /* unit# */
- int kb_type; /* KB_84, KB_101, KB_OTHER,... */
- int kb_config; /* device configuration flags */
- int kb_flags; /* internal flags */
-};
-
typedef struct accentmap accentmap_t;
typedef struct fkeytab fkeytab_t;
typedef struct fkeyarg fkeyarg_t;
@@ -388,9 +330,7 @@ typedef struct {char fnt8x14[14*256];} fnt14_t;
typedef struct {char fnt8x16[16*256];} fnt16_t;
typedef struct ssaver ssaver_t;
typedef struct video_adapter video_adapter_t;
-typedef struct video_adapter_info video_adapter_info_t;
typedef struct video_info video_info_t;
-typedef struct keyboard_info keyboard_info_t;
typedef struct {int scr_size[3];} scr_size_t;
/* defines for "special" keys (spcl bit set in keymap) */
@@ -448,13 +388,6 @@ typedef struct {int scr_size[3];} scr_size_t;
#define MKEY 0x400 /* meta key marker (prepend ESC)*/
#define BKEY 0x800 /* backtab (ESC [ Z) */
-#define SPCLKEY 0x8000 /* special key */
-#define RELKEY 0x4000 /* key released */
-#define ERRKEY 0x2000 /* error */
-
-#define KEYCHAR(c) ((c) & 0x00ff)
-#define KEYFLAGS(c) ((c) & ~0x00ff)
-
/* video mode definitions */
#define M_B40x25 0 /* black & white 40 columns */
#define M_C40x25 1 /* color 40 columns */
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index ce6bf0589001..977003cb5c23 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.84 1999/01/08 19:51:02 bde Exp $
+ * $Id: cpufunc.h,v 1.80 1998/07/11 04:58:25 bde Exp $
*/
/*
@@ -40,6 +40,15 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <machine/lock.h>
+
+#if defined(SWTCH_OPTIM_STATS)
+extern int tlb_flush_count;
+#endif
+
#define readb(va) (*(volatile u_int8_t *) (va))
#define readw(va) (*(volatile u_int16_t *) (va))
#define readl(va) (*(volatile u_int32_t *) (va))
@@ -50,14 +59,6 @@
#ifdef __GNUC__
-#ifdef SMP
-#include <machine/lock.h> /* XXX */
-#endif
-
-#ifdef SWTCH_OPTIM_STATS
-extern int tlb_flush_count; /* XXX */
-#endif
-
static __inline void
breakpoint(void)
{
@@ -68,17 +69,13 @@ static __inline void
disable_intr(void)
{
__asm __volatile("cli" : : : "memory");
-#ifdef SMP
MPINTR_LOCK();
-#endif
}
static __inline void
enable_intr(void)
{
-#ifdef SMP
MPINTR_UNLOCK();
-#endif
__asm __volatile("sti");
}
@@ -194,27 +191,24 @@ static __inline void
insb(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insb"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
insw(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insw"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
insl(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insl"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
@@ -223,11 +217,11 @@ invd(void)
__asm __volatile("invd");
}
-#if defined(SMP) && defined(KERNEL)
+#ifdef KERNEL
+#ifdef SMP
/*
- * When using APIC IPI's, invlpg() is not simply the invlpg instruction
- * (this is a bug) and the inlining cost is prohibitive since the call
+ * When using APIC IPI's, the inlining cost is prohibitive since the call
* executes into the IPI transmission system.
*/
void invlpg __P((u_int addr));
@@ -236,7 +230,7 @@ void invltlb __P((void));
static __inline void
cpu_invlpg(void *addr)
{
- __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
+ __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
}
static __inline void
@@ -253,15 +247,15 @@ cpu_invltlb(void)
++tlb_flush_count;
#endif
}
-
-#else /* !(SMP && KERNEL) */
+#else /* !SMP */
static __inline void
invlpg(u_int addr)
{
- __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
+ __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
}
+
static __inline void
invltlb(void)
{
@@ -272,12 +266,13 @@ invltlb(void)
*/
__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
: : "memory");
-#ifdef SWTCH_OPTIM_STATS
+#if defined(SWTCH_OPTIM_STATS)
++tlb_flush_count;
#endif
}
-#endif /* SMP && KERNEL */
+#endif /* SMP */
+#endif /* KERNEL */
static __inline u_short
inw(u_int port)
@@ -327,24 +322,24 @@ static __inline void
outsb(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsb"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
outsw(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsw"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
outsl(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsl"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
@@ -399,7 +394,7 @@ rdtsc(void)
}
static __inline void
-setbits(volatile u_int *addr, u_int bits)
+setbits(volatile unsigned *addr, u_int bits)
{
__asm __volatile(
#ifdef SMP
@@ -452,7 +447,7 @@ u_int64_t rdmsr __P((u_int msr));
u_int64_t rdpmc __P((u_int pmc));
u_int64_t rdtsc __P((void));
u_int read_eflags __P((void));
-void setbits __P((volatile u_int *addr, u_int bits));
+void setbits __P((volatile unsigned *addr, u_int bits));
void wbinvd __P((void));
void write_eflags __P((u_int ef));
void wrmsr __P((u_int msr, u_int64_t newval));
@@ -466,5 +461,6 @@ void ltr __P((u_short sel));
u_int rcr0 __P((void));
u_int rcr3 __P((void));
u_int rcr4 __P((void));
+void i686_pagezero __P((void *addr));
#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h
index 93f486bf2d02..5605b6fb3f84 100644
--- a/sys/i386/include/elf.h
+++ b/sys/i386/include/elf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elf.h,v 1.4 1998/09/14 20:30:12 jdp Exp $
+ * $Id: elf.h,v 1.3 1998/08/16 03:03:31 jdp Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -40,8 +40,6 @@
#define ELF_ARCH EM_386
-#define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486)
-
/*
* Auxiliary vector entries for passing information to the interpreter.
*
diff --git a/sys/i386/include/i4b_cause.h b/sys/i386/include/i4b_cause.h
deleted file mode 100644
index 439db4e2bcc4..000000000000
--- a/sys/i386/include/i4b_cause.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_cause.h - causes and cause handling for i4b
- * -----------------------------------------------
- *
- * $Id: i4b_cause.h,v 1.8 1998/12/05 18:05:55 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:30 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_CAUSE_H_
-#define _I4B_CAUSE_H_
-
-/*---------------------------------------------------------------------------*
- * ISDN4BSD internal causes specification
- *---------------------------------------------------------------------------*/
-
-#define CAUSE_VAL 0x000000ff /* cause value */
-#define CAUSE_TYPE 0x0000ff00 /* cause type */
-#define CAUSET_Q850 0 /* value coded according to Q.850 */
-#define CAUSET_I4B 1 /* i4b protocol independent causes*/
-
-#define GET_CAUSE_VAL(cause) ((cause) & 0xff)
-#define SET_CAUSE_VAL(dest, val) ((dest) = ((dest & 0xffffff00) | \
- (val & 0x000000ff)))
-
-#define GET_CAUSE_TYPE(cause) (((cause) >> 8) & 0xff)
-#define SET_CAUSE_TYPE(dest, type) ((dest) = ((dest & 0xffff00ff) | \
- ((type << 8) & 0x0000ff00)))
-
-#define SET_CAUSE_TV(dest, type, val) ((dest) = ((val & 0x000000ff) | \
- ((type << 8) & 0x0000ff00)))
-
-/* CAUSET_I4B - protocol independent cause values */
-
-#define CAUSE_I4B_NORMAL 0 /* normal call clearing */
-#define CAUSE_I4B_BUSY 1 /* user busy */
-#define CAUSE_I4B_NOCHAN 2 /* circuit/channel not available*/
-#define CAUSE_I4B_INCOMP 3 /* incompatible source/dest */
-#define CAUSE_I4B_REJECT 4 /* call rejected */
-#define CAUSE_I4B_OOO 5 /* destination out of order */
-#define CAUSE_I4B_TMPFAIL 6 /* temporary failure */
-#define CAUSE_I4B_L1ERROR 7 /* L1 error / persistent deact */
-#define CAUSE_I4B_MAX 8
-
-/* CAUSET_Q850 - causes defined in Q.850 */
-
-#define CAUSE_Q850_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_Q850_NUNALLC 0x01 /* Unallocated (unassigned) number */
-#define CAUSE_Q850_NRTTN 0x02 /* No route to specified transit network */
-#define CAUSE_Q850_NRTDST 0x03 /* No route to destination */
-#define CAUSE_Q850_SSINFTN 0x04 /* Send special information tone */
-#define CAUSE_Q850_MDIALTP 0x05 /* Misdialled trunk prefix */
-#define CAUSE_Q850_CHUNACC 0x06 /* Channel unacceptable */
-#define CAUSE_Q850_CALLAWD 0x07 /* Call awarded and being delivered in an established channel */
-#define CAUSE_Q850_PREEMPT 0x08 /* Preemption */
-#define CAUSE_Q850_PREECRR 0x09 /* Preemption - circuit reserved for reuse */
-#define CAUSE_Q850_NCCLR 0x10 /* Normal call clearing */
-#define CAUSE_Q850_USRBSY 0x11 /* User busy */
-#define CAUSE_Q850_NOUSRRSP 0x12 /* No user responding */
-#define CAUSE_Q850_NOANSWR 0x13 /* No answer from user (user alerted) */
-#define CAUSE_Q850_SUBSABS 0x14 /* Subscriber absent */
-#define CAUSE_Q850_CALLREJ 0x15 /* Call rejected */
-#define CAUSE_Q850_NUCHNG 0x16 /* Number changed */
-#define CAUSE_Q850_NONSELUC 0x1A /* Non-selected user clearing */
-#define CAUSE_Q850_DSTOOORDR 0x1B /* Destination out of order */
-#define CAUSE_Q850_INVNUFMT 0x1C /* Invalid number format */
-#define CAUSE_Q850_FACREJ 0x1D /* Facility rejected */
-#define CAUSE_Q850_STENQRSP 0x1E /* Response to STATUS ENQUIRY */
-#define CAUSE_Q850_NORMUNSP 0x1F /* Normal, unspecified */
-#define CAUSE_Q850_NOCAVAIL 0x22 /* No circuit / channel available */
-#define CAUSE_Q850_NETOOORDR 0x26 /* Network out of order */
-#define CAUSE_Q850_PFMCDOOSERV 0x27 /* Permanent frame mode connection out of service */
-#define CAUSE_Q850_PFMCOPER 0x28 /* Permanent frame mode connection operational */
-#define CAUSE_Q850_TMPFAIL 0x29 /* Temporary failure */
-#define CAUSE_Q850_SWEQCONG 0x2A /* Switching equipment congestion */
-#define CAUSE_Q850_ACCINFDIS 0x2B /* Access information discarded */
-#define CAUSE_Q850_REQCNOTAV 0x2C /* Requested circuit/channel not available */
-#define CAUSE_Q850_PRECALBLK 0x2E /* Precedence call blocked */
-#define CAUSE_Q850_RESUNAVAIL 0x2F /* Resources unavailable, unspecified */
-#define CAUSE_Q850_QOSUNAVAIL 0x31 /* Quality of service unavailable */
-#define CAUSE_Q850_REQSERVNS 0x32 /* Requested facility not subscribed */
-#define CAUSE_Q850_OCBARRCUG 0x35 /* Outgoing calls barred within CUG */
-#define CAUSE_Q850_ICBARRCUG 0x36 /* Incoming calls barred within CUG */
-#define CAUSE_Q850_BCAPNAUTH 0x39 /* Bearer capability not authorized */
-#define CAUSE_Q850_BCAPNAVAIL 0x3A /* Bearer capability not presently available */
-#define CAUSE_Q850_INCSTOACISC 0x3E /* Inconsistenciy in designated outgoing access information and subscriber class */
-#define CAUSE_Q850_SOONOTAVAIL 0x3F /* Service or option not available, unspecified */
-#define CAUSE_Q850_BCAPNOTIMPL 0x41 /* Bearer capability not implemented */
-#define CAUSE_Q850_CHTYPNIMPL 0x42 /* Channel type not implemented */
-#define CAUSE_Q850_REQFACNIMPL 0x45 /* Requested facility not implemented */
-#define CAUSE_Q850_ORDINBCAVL 0x46 /* Only restricted digital information bearer capability is available */
-#define CAUSE_Q850_SOONOTIMPL 0x4F /* Service or option not implemented, unspecified */
-#define CAUSE_Q850_INVCLRFVAL 0x51 /* Invalid call reference value */
-#define CAUSE_Q850_IDCHDNOEX 0x52 /* Identified channel does not exist */
-#define CAUSE_Q850_SUSCAEXIN 0x53 /* A suspended call exists, but this call identity does not */
-#define CAUSE_Q850_CLIDINUSE 0x54 /* Call identity in use */
-#define CAUSE_Q850_NOCLSUSP 0x55 /* No call suspended */
-#define CAUSE_Q850_CLIDCLRD 0x56 /* Call having the requested call identity has been cleared */
-#define CAUSE_Q850_UNOTMEMCUG 0x57 /* User not member of CUG */
-#define CAUSE_Q850_INCDEST 0x58 /* Incompatible destination */
-#define CAUSE_Q850_NONEXCUG 0x5A /* Non-existent CUG */
-#define CAUSE_Q850_INVNTWSEL 0x5B /* Invalid transit network selection */
-#define CAUSE_Q850_INVMSG 0x5F /* Invalid message, unspecified */
-#define CAUSE_Q850_MIEMISS 0x60 /* Mandatory information element is missing */
-#define CAUSE_Q850_MSGTNI 0x61 /* Message type non-existent or not implemented */
-#define CAUSE_Q850_MSGNCMPT 0x62 /* Message not compatible with call state or message type non-existent or not implemented */
-#define CAUSE_Q850_IENENI 0x63 /* Information element/parameter non-existent or not implemented */
-#define CAUSE_Q850_INVIEC 0x64 /* Invalid information element contents */
-#define CAUSE_Q850_MSGNCWCS 0x65 /* Message not compatible with call state */
-#define CAUSE_Q850_RECOTIMEXP 0x66 /* Recovery on timer expiry */
-#define CAUSE_Q850_PARMNENIPO 0x67 /* Parameter non-existent or not implemented, passed on */
-#define CAUSE_Q850_MSGUNRDPRM 0x6E /* Message with unrecognized parameter, discarded */
-#define CAUSE_Q850_PROTERR 0x6F /* Protocol error, unspecified */
-#define CAUSE_Q850_INTWRKU 0x7F /* Interworking, unspecified */
-
-#define CAUSE_Q850_MAX 128
-
-#endif /* _I4B_CAUSE_H_ */
diff --git a/sys/i386/include/i4b_debug.h b/sys/i386/include/i4b_debug.h
deleted file mode 100644
index 33e6315ba285..000000000000
--- a/sys/i386/include/i4b_debug.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_debug.h - i4b debug header file
- * -----------------------------------
- *
- * $Id: i4b_debug.h,v 1.14 1998/12/05 18:05:57 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:47 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#define DO_I4B_DEBUG /* enable debugging code inclusion */
-
-#undef DO_I4B_MAXDEBUG /* enable ALL debug messages by default */
-
-#ifdef DO_I4B_DEBUG
-
-extern unsigned int i4b_l1_debug;
-extern unsigned int i4b_l2_debug;
-extern unsigned int i4b_l3_debug;
-extern unsigned int i4b_l4_debug;
-
-#define DBGL1(bits, routine, what) \
- if(bits & i4b_l1_debug) \
- { \
- printf("i4b-L1-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL2(bits, routine, what) \
- if(bits & i4b_l2_debug) \
- { \
- printf("i4b-L2-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL3(bits, routine, what) \
- if(bits & i4b_l3_debug) \
- { \
- printf("i4b-L3-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL4(bits, routine, what) \
- if(bits & i4b_l4_debug) \
- { \
- printf("i4b-L4-%s: ", routine); \
- printf what ; \
- }
-#else /* !DO_I4B_DEBUG */
-
-#define DBGL1(bits, routine, what);
-#define DBGL2(bits, routine, what);
-#define DBGL3(bits, routine, what);
-#define DBGL4(bits, routine, what);
-
-#endif /* DO_I4B_DEBUG */
-
-/* Layer 1 */
-
-#define L1_ERROR 0x0001 /* general error message*/
-#define L1_PRIM 0x0002 /* interlayer primitives*/
-#define L1_BCHAN 0x0004 /* B channel action */
-#define L1_H_ERR 0x0008 /* HSCX errors */
-#define L1_H_IRQ 0x0010 /* HSCX IRQ messages */
-#define L1_I_ERR 0x0020 /* ISAC errors */
-#define L1_I_MSG 0x0040 /* ISAC messages */
-#define L1_I_SETUP 0x0080 /* ISAC setup messages */
-#define L1_F_MSG 0x0100 /* FSM messages */
-#define L1_F_ERR 0x0200 /* FSM error messages */
-#define L1_T_MSG 0x0400 /* Timer messages */
-#define L1_T_ERR 0x0800 /* Timer error messages */
-#define L1_H_XFRERR 0x1000 /* HSCX data xfer error */
-#define L1_I_CICO 0x2000 /* ISAC command in/out */
-
-#define L1_DEBUG_MAX 0x3fef /* all messages on except IRQ! */
-#define L1_DEBUG_ERR (L1_H_ERR | L1_I_ERR | L1_F_ERR | L1_T_ERR | L1_ERROR)
-
-#ifndef L1_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L1_DEBUG_DEFAULT L1_DEBUG_MAX
-#else
-#define L1_DEBUG_DEFAULT L1_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 2 */
-
-#define L2_ERROR 0x0001 /* general error message */
-#define L2_PRIM 0x0002 /* interlayer primitives */
-#define L2_U_MSG 0x0004 /* U frame messages */
-#define L2_U_ERR 0x0008 /* U frame error messages */
-#define L2_S_MSG 0x0010 /* S frame messages */
-#define L2_S_ERR 0x0020 /* S frame error messages */
-#define L2_I_MSG 0x0040 /* I frame messages */
-#define L2_I_ERR 0x0080 /* I frame error messages */
-#define L2_F_MSG 0x0100 /* FSM messages */
-#define L2_F_ERR 0x0200 /* FSM error messages */
-#define L2_T_MSG 0x0400 /* timer messages */
-#define L2_T_ERR 0x0800 /* timer error messages */
-#define L2_TEI_MSG 0x1000 /* TEI messages */
-#define L2_TEI_ERR 0x2000 /* TEI error messages */
-
-#define L2_DEBUG_MAX 0x3fff /* all messages on */
-#define L2_DEBUG_ERR (L2_ERROR | L2_I_ERR | L2_F_ERR | L2_T_ERR | L2_S_ERR | L2_TEI_ERR | L2_U_ERR )
-
-#ifndef L2_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L2_DEBUG_DEFAULT L2_DEBUG_MAX
-#else
-#define L2_DEBUG_DEFAULT L2_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 3 */
-
-#define L3_ERR 0x0001 /* general error message */
-#define L3_MSG 0x0002 /* general message */
-#define L3_F_MSG 0x0004 /* FSM messages */
-#define L3_F_ERR 0x0008 /* FSM error messages */
-#define L3_T_MSG 0x0010 /* timer messages */
-#define L3_T_ERR 0x0020 /* timer error messages */
-#define L3_P_MSG 0x0040 /* protocol messages */
-#define L3_P_ERR 0x0080 /* protocol error messages */
-#define L3_A_MSG 0x0100 /* AOC messages */
-#define L3_A_ERR 0x0200 /* AOC error messages */
-#define L3_PRIM 0x0400 /* messages exchanged */
-
-#define L3_DEBUG_MAX 0x07ff /* all messages on */
-#define L3_DEBUG_ERR (L3_ERR | L3_F_ERR | L3_T_ERR | L3_P_ERR | L3_A_ERR)
-
-#ifndef L3_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L3_DEBUG_DEFAULT L3_DEBUG_MAX
-#else
-#define L3_DEBUG_DEFAULT L3_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 4 */
-
-#define L4_ERR 0x0001 /* general error message */
-#define L4_MSG 0x0002 /* general message */
-#define L4_TIMO 0x0004 /* b channel idle timeout msgs */
-#define L4_DIALST 0x0008 /* network driver dial states */
-#define L4_IPRDBG 0x0010 /* ipr driver debug messages */
-#define L4_RBCHDBG 0x0020 /* rbch driver debug messages */
-
-#define L4_DEBUG_MAX 0x003f /* all messages on */
-#define L4_DEBUG_ERR (L4_ERR)
-
-#ifndef L4_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L4_DEBUG_DEFAULT L4_DEBUG_MAX
-#else
-#define L4_DEBUG_DEFAULT L4_DEBUG_ERR
-#endif
-#endif
-
-/*---------------------------------------------------------------------------*
- * ioctl via /dev/i4bctl:
- * get/set current debug bits settings
- *---------------------------------------------------------------------------*/
-
-typedef struct {
- unsigned int l1;
- unsigned int l2;
- unsigned int l3;
- unsigned int l4;
-} ctl_debug_t;
-
-#define I4B_CTL_GET_DEBUG _IOR('C', 0, ctl_debug_t)
-
-#define I4B_CTL_SET_DEBUG _IOW('C', 1, ctl_debug_t)
-
-/*---------------------------------------------------------------------------*
- * get hscx statistics
- *---------------------------------------------------------------------------*/
-
-typedef struct {
- int unit; /* controller number */
- int chan; /* channel number */
- int vfr;
- int rdo;
- int crc;
- int rab;
- int xdu;
- int rfo;
-} hscxstat_t;
-
-#define I4B_CTL_GET_HSCXSTAT _IOWR('C', 2, hscxstat_t)
-
-#define I4B_CTL_CLR_HSCXSTAT _IOW('C', 3, hscxstat_t)
-
-/* EOF */
diff --git a/sys/i386/include/i4b_ioctl.h b/sys/i386/include/i4b_ioctl.h
deleted file mode 100644
index 17e945f173ef..000000000000
--- a/sys/i386/include/i4b_ioctl.h
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ioctl.h - messages kernel <--> userland
- * -------------------------------------------
- *
- * $Id: i4b_ioctl.h,v 1.58 1998/12/22 19:48:24 hm Exp $
- *
- * last edit-date: [Tue Dec 22 20:33:46 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IOCTL_H_
-#define _I4B_IOCTL_H_
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#ifndef _MACHINE_TYPES_H_
-#include <machine/types.h>
-#endif /* _MACHINE_TYPES_H_ */
-#endif /* __FreeBSD__ */
-
-/*---------------------------------------------------------------------------*
- * version and release number for isdn4bsd package
- *---------------------------------------------------------------------------*/
-#define VERSION 0 /* version number */
-#define REL 70 /* release number */
-#define STEP 00 /* release step */
-
-/*---------------------------------------------------------------------------*
- * date/time format in i4b log messages
- * ------------------------------------
- * Being year 2000 clean is not easy with the current state of the
- * ANSI C library standard and it's implementation for some locales.
- * You might like to use the "%c" format of "strftime" sometimes,
- * but this breaks Y2K in some locales. Also the old standard logfile
- * format "%d.%m.%y %H:%M:%S" is non compliant.
- * NetBSD's current toolset warns about this problems, and we compile
- * with -Werror, so this problems need to be resolved.
- *---------------------------------------------------------------------------*/
-#define I4B_TIME_FORMAT "%d.%m.%Y %H:%M:%S"
-
-/*---------------------------------------------------------------------------*
- * max number of controllers in system
- *---------------------------------------------------------------------------*/
-#define MAX_CONTROLLERS 8 /* max number of controllers */
-
-/*---------------------------------------------------------------------------*
- * controller types
- *---------------------------------------------------------------------------*/
-#define CTRL_INVALID (-1) /* invalid, error */
-#define CTRL_UNKNOWN 0 /* unknown controller type */
-#define CTRL_PASSIVE 1 /* passive ISDN controller cards*/
-#define CTRL_DAIC 2 /* Diehl active controller cards*/
-#define CTRL_NUMTYPES 3 /* number of controller types */
-
-/*---------------------------------------------------------------------------*
- * card types for CTRL_PASSIVE
- *---------------------------------------------------------------------------*/
-#define CARD_TYPEP_INVAL (-1) /* invalid, error */
-#define CARD_TYPEP_UNK 0 /* unknown */
-#define CARD_TYPEP_8 1 /* Teles, S0/8 */
-#define CARD_TYPEP_16 2 /* Teles, S0/16 */
-#define CARD_TYPEP_16_3 3 /* Teles, S0/16.3 */
-#define CARD_TYPEP_AVMA1 4 /* AVM A1 or AVM Fritz!Card */
-#define CARD_TYPEP_163P 5 /* Teles, S0/16.3 PnP */
-#define CARD_TYPEP_CS0P 6 /* Creatix, S0 PnP */
-#define CARD_TYPEP_USRTA 7 /* US Robotics ISDN TA internal */
-#define CARD_TYPEP_DRNNGO 8 /* Dr. Neuhaus Niccy GO@ */
-#define CARD_TYPEP_SWS 9 /* Sedlbauer Win Speed */
-#define CARD_TYPEP_DYNALINK 10 /* Dynalink IS64PH */
-#define CARD_TYPEP_BLMASTER 11 /* ISDN Blaster / ISDN Master */
-#define CARD_TYPEP_PCFRITZ 12 /* AVM PCMCIA Fritz!Card */
-#define CARD_TYPEP_ELSAQS1ISA 13 /* ELSA QuickStep 1000pro ISA */
-#define CARD_TYPEP_ELSAQS1PCI 14 /* ELSA QuickStep 1000pro PCI */
-#define CARD_TYPEP_SIEMENSITALK 15 /* Siemens I-Talk */
-#define CARD_TYPEP_ELSAMLIMC 16 /* ELSA MicroLink ISDN/MC */
-#define CARD_TYPEP_ELSAMLMCALL 17 /* ELSA MicroLink MCall */
-#define CARD_TYPEP_ITKIX1 18 /* ITK ix1 micro */
-
-/*
- * in case you add support for more cards, please update:
- *
- * isdnd: support.c, name_of_controller()
- * diehl/diehlctl: main.c, listall()
- *
- * and adjust CARD_TYPEP_MAX below.
- */
-
-#define CARD_TYPEP_MAX 18 /* max type */
-
-/*---------------------------------------------------------------------------*
- * card types for CTRL_DAIC
- *---------------------------------------------------------------------------*/
-#define CARD_TYPEA_DAIC_UNK 0
-#define CARD_TYPEA_DAIC_S 1
-#define CARD_TYPEA_DAIC_SX 2
-#define CARD_TYPEA_DAIC_SCOM 3
-#define CARD_TYPEA_DAIC_QUAD 4
-
-/*---------------------------------------------------------------------------*
- * max length of some strings
- *---------------------------------------------------------------------------*/
-#define TELNO_MAX 41 /* max length of a telephone number (+ '\0') */
-#define DISPLAY_MAX 91 /* max length of display information (+ '\0') */
-#define DATETIME_MAX 21 /* max length of datetime information (+ '\0')*/
-
-/*---------------------------------------------------------------------------*
- * in case the src or dst telephone number is empty
- *---------------------------------------------------------------------------*/
-#define TELNO_EMPTY "NotAvailable"
-
-/*---------------------------------------------------------------------------*
- * B channel parameters
- *---------------------------------------------------------------------------*/
-#define BCH_MAX_DATALEN 2048 /* max length of a B channel frame */
-
-/*---------------------------------------------------------------------------*
- * userland driver types
- * ---------------------
- * a "driver" is defined here as a piece of software interfacing an
- * ISDN B channel with a userland service, such as IP, Telephony etc.
- *---------------------------------------------------------------------------*/
-#define BDRV_RBCH 0 /* raw b-channel interface driver */
-#define BDRV_TEL 1 /* telephone (speech) interface driver */
-#define BDRV_IPR 2 /* IP over raw HDLC interface driver */
-#define BDRV_ISPPP 3 /* sync Kernel PPP interface driver */
-
-/*---------------------------------------------------------------------------*
- * B channel protocol
- *---------------------------------------------------------------------------*/
-#define BPROT_NONE 0 /* no protocol at all, raw data */
-#define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */
-
-/*---------------------------------------------------------------------------*
- * causes data type
- *---------------------------------------------------------------------------*/
-typedef unsigned int cause_t; /* 32 bit unsigned int */
-
-/*---------------------------------------------------------------------------*
- * call descriptor id (cdid) definitions
- *---------------------------------------------------------------------------*/
-#define CDID_UNUSED 0 /* cdid is invalid and unused */
-#define CDID_MAX 99999 /* highest valid cdid, wraparound to 1 */
-
-
-/****************************************************************************
-
- outgoing call:
- --------------
-
- userland kernel
- -------- ------
-
- CDID_REQ ----------------->
-
- <------------------ cdid
-
- CONNECT_REQ -------------->
-
- <------------------ PROCEEDING_IND (if connect req ok)
-
- <------------------ CONNECT_ACTIVE_IND (if connection ok)
-
- or
-
- <------------------ DISCONNECT_IND (if connection failed)
-
-
-
- incoming call:
- --------------
-
- userland kernel
- -------- ------
-
- <------------------ CONNECT_IND
-
- CONNECT_RESP ------------->
-
- <------------------ CONNECT_ACTIVE_IND (if accepted)
-
-
-
- active disconnect:
- ------------------
-
- userland kernel
- -------- ------
-
- DISCONNECT_REQ ------------>
-
- <------------------ DISCONNECT_IND
-
-
- passive disconnect:
- -------------------
-
- userland kernel
- -------- ------
-
- <------------------ DISCONNECT_IND
-
-
-****************************************************************************/
-
-
-/*===========================================================================*
- *===========================================================================*
- * "read" messages from kernel -> userland
- *===========================================================================*
- *===========================================================================*/
-
-
-/*---------------------------------------------------------------------------*
- * message header, included in every message
- *---------------------------------------------------------------------------*/
-typedef struct {
- char type; /* message identifier */
-#define MSG_CONNECT_IND 'a'
-#define MSG_CONNECT_ACTIVE_IND 'b'
-#define MSG_DISCONNECT_IND 'c'
-#define MSG_DIALOUT_IND 'd'
-#define MSG_IDLE_TIMEOUT_IND 'e'
-#define MSG_ACCT_IND 'f'
-#define MSG_CHARGING_IND 'g'
-#define MSG_PROCEEDING_IND 'h'
-#define MSG_ALERT_IND 'i'
-#define MSG_DRVRDISC_REQ 'j'
-#define MSG_L12STAT_IND 'k'
-#define MSG_TEIASG_IND 'l'
-#define MSG_PDEACT_IND 'm'
-#define MSG_NEGCOMP_IND 'n'
-#define MSG_IFSTATE_CHANGED_IND 'o'
- int cdid; /* call descriptor id */
-} msg_hdr_t;
-
-/*---------------------------------------------------------------------------*
- * connect indication
- * indicates incoming connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number */
- int channel; /* channel number */
-#define CHAN_B1 0 /* this _must_ be 0, HSCX B1 is also 0 */
-#define CHAN_B2 1 /* this _must_ be 1, HSCX B2 is also 1 */
-#define CHAN_ANY (-1) /* outgoing, not possible for incoming */
-#define CHAN_NO (-2) /* call waiting (CW) for incoming */
- int bprot; /* b channel protocot, see BPROT_XXX */
- char dst_telno[TELNO_MAX]; /* destination telno */
- char src_telno[TELNO_MAX]; /* source telno */
- int scr_ind;/* screening indicator */
-#define SCR_NONE 0 /* no screening indicator transmitted */
-#define SCR_USR_NOSC 1 /* screening user provided, not screened*/
-#define SCR_USR_PASS 2 /* screening user provided, verified & passed */
-#define SCR_USR_FAIL 3 /* screening user provided, verified & failed */
-#define SCR_NET 4 /* screening network provided */
- char display[DISPLAY_MAX]; /* content of display IE*/
-} msg_connect_ind_t;
-
-/*---------------------------------------------------------------------------*
- * connect active indication
- * indicates active connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number actually used */
- int channel; /* channel number actually used */
- char datetime[DATETIME_MAX]; /* content of date/time IE */
-} msg_connect_active_ind_t;
-
-/*---------------------------------------------------------------------------*
- * disconnect indication
- * indicates a disconnect
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- cause_t cause; /* cause code */
-} msg_disconnect_ind_t;
-
-/*---------------------------------------------------------------------------*
- * negotiation complete
- * indicates an interface is completely up & running
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_negcomplete_ind_t;
-
-/*---------------------------------------------------------------------------*
- * interface changes internal state
- * indicates an interface has somehow switched its FSM
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int state; /* new interface state */
-} msg_ifstatechg_ind_t;
-
-/*---------------------------------------------------------------------------*
- * initiate a call to a remote site
- * i.e. the IP driver got a packet and wants a connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
-} msg_dialout_ind_t;
-
-/*---------------------------------------------------------------------------*
- * idle timeout disconnect sent indication
- * kernel has sent disconnect request because of b-ch idle
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_idle_timeout_ind_t;
-
-/*---------------------------------------------------------------------------*
- * accounting information from userland interface driver to daemon
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int accttype; /* accounting type */
-#define ACCT_DURING 0
-#define ACCT_FINAL 1
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
- int ioutbytes; /* ISDN # of bytes sent */
- int iinbytes; /* ISDN # of bytes received */
- int outbps; /* bytes per sec out */
- int inbps; /* bytes per sec in */
- int outbytes; /* driver # of bytes sent */
- int inbytes; /* driver # of bytes received */
-} msg_accounting_ind_t;
-
-/*---------------------------------------------------------------------------*
- * charging information from isdn driver to daemon
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int units; /* number of units */
- int units_type; /* type of units info */
-#define CHARGE_INVALID 0 /* invalid, unknown */
-#define CHARGE_AOCD 1 /* advice of charge during call */
-#define CHARGE_AOCE 2 /* advice of charge at end of call */
-#define CHARGE_CALC 3 /* locally calculated from rates information */
-} msg_charging_ind_t;
-
-/*---------------------------------------------------------------------------*
- * call proceeding indication
- * indicates outgoing SETUP has been acknowleged
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number actually used */
- int channel; /* channel number actually used */
-} msg_proceeding_ind_t;
-
-/*---------------------------------------------------------------------------*
- * alert indication
- * indicates remote user side "rings"
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_alert_ind_t;
-
-/*---------------------------------------------------------------------------*
- * driver requests to disconnect line
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
-} msg_drvrdisc_req_t;
-
-/*---------------------------------------------------------------------------*
- * state of layer 1/2
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int layer; /* layer number (1/2) */
-#define LAYER_ONE 1
-#define LAYER_TWO 2
- int state; /* state info */
-#define LAYER_IDLE 0
-#define LAYER_ACTIVE 1
-} msg_l12stat_ind_t;
-
-/*---------------------------------------------------------------------------*
- * TEI assignment messages
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int tei; /* TEI or -1 if invalid */
-} msg_teiasg_ind_t;
-
-/*---------------------------------------------------------------------------*
- * persistent deactivation state of stack
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int numactive; /* number of active connections */
-} msg_pdeact_ind_t;
-
-
-/*===========================================================================*
- *===========================================================================*
- * "ioctl" messages from userland -> kernel
- *===========================================================================*
- *===========================================================================*/
-
-
-/*---------------------------------------------------------------------------*
- * request a unique cdid (to setup an outgoing call)
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
-} msg_cdid_req_t;
-
-#define I4B_CDID_REQ _IOWR('4', 0, int)
-
-/*---------------------------------------------------------------------------*
- * connect request
- * requests an outgoing connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int controller; /* controller to use */
- int channel; /* channel to use */
- int txdelay; /* tx delay after connect */
- int bprot; /* b channel protocol */
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int unitlen_time; /* length of a charging unit */
- int idle_time; /* time without activity on b ch */
- int earlyhup_time; /* safety area at end of unit */
- int unitlen_method; /* how to calculate the unitlength */
-#define ULEN_METHOD_STATIC 0 /* use unitlen_time value (see above) */
-#define ULEN_METHOD_DYNAMIC 1 /* use AOCD */
- char dst_telno[TELNO_MAX]; /* destination telephone no */
- char src_telno[TELNO_MAX]; /* source telephone number */
-} msg_connect_req_t;
-
-#define I4B_CONNECT_REQ _IOW('4', 1, msg_connect_req_t)
-
-/*---------------------------------------------------------------------------*
- * connect response
- * this is the answer to an incoming connect indication
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int response; /* what to do with incoming call */
-#define SETUP_RESP_DNTCRE 0 /* dont care, call is not for me */
-#define SETUP_RESP_REJECT 1 /* reject call */
-#define SETUP_RESP_ACCEPT 2 /* accept call */
- cause_t cause; /* cause for case SETUP_RESP_REJECT */
- /* the following are only used for SETUP_RESP_ACCEPT !! */
- int txdelay; /* tx delay after connect */
- int bprot; /* B chan protocol */
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int max_idle_time; /* max time without activity on b ch */
-} msg_connect_resp_t;
-
-#define I4B_CONNECT_RESP _IOW('4', 2, msg_connect_resp_t)
-
-/*---------------------------------------------------------------------------*
- * disconnect request
- * active disconnect request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- cause_t cause; /* protocol independent cause */
-} msg_discon_req_t;
-
-#define I4B_DISCONNECT_REQ _IOW('4', 3, msg_discon_req_t)
-
-/*---------------------------------------------------------------------------*
- * controller info request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int controller; /* controller number */
- int ncontroller; /* number of controllers in system */
- int ctrl_type; /* controller type passive/active */
- int card_type; /* brand / version */
- int tei; /* tei controller probably has */
-} msg_ctrl_info_req_t;
-
-#define I4B_CTRL_INFO_REQ _IOWR('4', 4, msg_ctrl_info_req_t)
-
-/*---------------------------------------------------------------------------*
- * dialout response
- * status report to driver who requested a dialout
- *---------------------------------------------------------------------------*/
-typedef struct {
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int stat; /* state of dialout request */
-#define DSTAT_NONE 0
-#define DSTAT_TFAIL 1 /* transient failure */
-#define DSTAT_PFAIL 2 /* permanent failure */
-#define DSTAT_INONLY 3 /* no outgoing dials allowed */
-} msg_dialout_resp_t;
-
-#define I4B_DIALOUT_RESP _IOW('4', 5, msg_dialout_resp_t)
-
-/*---------------------------------------------------------------------------*
- * timeout value update
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int unitlen_time; /* length of a charging unit */
- int idle_time; /* time without activity on b ch */
- int earlyhup_time; /* safety area at end of unit */
-} msg_timeout_upd_t;
-
-#define I4B_TIMEOUT_UPD _IOW('4', 6, msg_timeout_upd_t)
-
-/*---------------------------------------------------------------------------*
- * soft enable/disable
- *---------------------------------------------------------------------------*/
-typedef struct {
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int updown; /* what to do */
-#define SOFT_ENA 0 /* enable interface */
-#define SOFT_DIS 1 /* disable interface */
-} msg_updown_ind_t;
-
-#define I4B_UPDOWN_IND _IOW('4', 7, msg_updown_ind_t)
-
-/*---------------------------------------------------------------------------*
- * send alert request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
-} msg_alert_req_t;
-
-#define I4B_ALERT_REQ _IOW('4', 8, msg_alert_req_t)
-
-/*---------------------------------------------------------------------------*
- * request version and release info from kernel part
- *---------------------------------------------------------------------------*/
-typedef struct {
- int version; /* version number */
- int release; /* release number */
- int step; /* release step number */
-} msg_vr_req_t;
-
-#define I4B_VR_REQ _IOR('4', 9, msg_vr_req_t)
-
-/*---------------------------------------------------------------------------*
- * Protocol download to active cards
- *---------------------------------------------------------------------------*/
-struct isdn_dr_prot {
- size_t bytecount; /* length of code */
- u_int8_t *microcode; /* pointer to microcode */
-};
-
-struct isdn_download_request {
- int controller; /* controller number */
- int numprotos; /* number of protocols in 'protocols' */
- struct isdn_dr_prot *protocols;
-};
-
-#define I4B_CTRL_DOWNLOAD _IOW('4', 100, struct isdn_download_request)
-
-/*---------------------------------------------------------------------------*
- * Generic diagnostic interface for active cards
- *---------------------------------------------------------------------------*/
-struct isdn_diagnostic_request {
- int controller; /* controller number */
- u_int32_t cmd; /* diagnostic command to execute */
- size_t in_param_len; /* length of additional input parameter */
- void *in_param; /* optional input parameter */
- size_t out_param_len; /* available output space */
- void *out_param; /* output data goes here */
-};
-
-#define I4B_ACTIVE_DIAGNOSTIC _IOW('4', 102, struct isdn_diagnostic_request)
-
-#endif /* _I4B_IOCTL_H_ */
diff --git a/sys/i386/include/i4b_tel_ioctl.h b/sys/i386/include/i4b_tel_ioctl.h
deleted file mode 100644
index b7f0f73cd92a..000000000000
--- a/sys/i386/include/i4b_tel_ioctl.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tel_ioctl.h telephony interface ioctls
- * ------------------------------------------
- *
- * $Id: i4b_tel_ioctl.h,v 1.5 1998/12/14 10:31:58 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:37:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TEL_IOCTL_H_
-#define _I4B_TEL_IOCTL_H_
-
-/* supported audio format conversions for /dev/i4btelXX devices */
-
-#define CVT_NONE 0 /* no format conversion */
-#define CVT_ALAW2ULAW 1 /* kernel A-law, userland mu-law */
-
-/*---------------------------------------------------------------------------*
- * get / set audio format
- *---------------------------------------------------------------------------*/
-
-#define I4B_TEL_GETAUDIOFMT _IOR('A', 0, int)
-#define I4B_TEL_SETAUDIOFMT _IOW('A', 1, int)
-#define I4B_TEL_EMPTYINPUTQUEUE _IOW('A', 2, int)
-
-#endif /* _I4B_TEL_IOCTL_H_ */
diff --git a/sys/i386/include/i4b_trace.h b/sys/i386/include/i4b_trace.h
deleted file mode 100644
index 07e08daa075c..000000000000
--- a/sys/i386/include/i4b_trace.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_trace.h - header file for trace data read device
- * ----------------------------------------------------
- *
- * $Id: i4b_trace.h,v 1.5 1998/12/05 18:06:01 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:37:49 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TRACE_H_
-#define _I4B_TRACE_H_
-
-/*---------------------------------------------------------------------------*
- * structure of the header at the beginning of every trace mbuf
- *---------------------------------------------------------------------------*/
-typedef struct {
- int length; /* length of the following mbuf */
- int unit; /* controller unit number */
- int type; /* type of channel */
-#define TRC_CH_I 0 /* Layer 1 INFO's */
-#define TRC_CH_D 1 /* D channel */
-#define TRC_CH_B1 2 /* B1 channel */
-#define TRC_CH_B2 3 /* B2 channel */
- int dir; /* direction */
-#define FROM_TE 0 /* user -> network */
-#define FROM_NT 1 /* network -> user */
- int trunc; /* # of truncated bytes (frame > MCLBYTES) */
- unsigned int count; /* frame count for this unit/type */
- struct timeval time; /* timestamp for this frame */
-} i4b_trace_hdr_t;
-
-#define INFO0 0 /* layer 1 */
-#define INFO1_8 1
-#define INFO1_10 2
-#define INFO2 3
-#define INFO3 4
-#define INFO4_8 5
-#define INFO4_10 6
-
-/*---------------------------------------------------------------------------*
- * ioctl via /dev/i4btrc device(s):
- * get/set current trace flag settings
- *---------------------------------------------------------------------------*/
-
-#define I4B_TRC_GET _IOR('T', 0, int) /* get trace settings */
-#define I4B_TRC_SET _IOW('T', 1, int) /* set trace settings */
-
-#define TRACE_OFF 0x00 /* tracing off */
-#define TRACE_I 0x01 /* trace L1 INFO's on */
-#define TRACE_D_TX 0x02 /* trace D channel on */
-#define TRACE_D_RX 0x04 /* trace D channel on */
-#define TRACE_B_TX 0x08 /* trace B channel on */
-#define TRACE_B_RX 0x10 /* trace B channel on */
-
-typedef struct {
- int rxunit; /* unit # for rx frames */
- int rxflags; /* d and/or b channel */
- int txunit; /* unit # for tx frames */
- int txflags; /* d and/or b channel */
-} i4b_trace_setupa_t;
-
-#define I4B_TRC_SETA _IOW('T', 2, i4b_trace_setupa_t) /* set analyze mode */
-#define I4B_TRC_RESETA _IOW('T', 3, int) /* reset analyze mode */
-
-#endif /* _I4B_TRACE_H_ */
diff --git a/sys/i386/include/iic.h b/sys/i386/include/iic.h
index 6649821e0240..174432611c0c 100644
--- a/sys/i386/include/iic.h
+++ b/sys/i386/include/iic.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iic.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $
+ * $Id: iic.h,v 1.1.2.1 1998/07/17 00:54:01 son Exp $
*
*/
#ifndef __IIC_H
@@ -31,17 +31,10 @@
#include <sys/ioccom.h>
-struct iiccmd {
- u_char slave;
- int count;
- int last;
- char *buf;
-};
-
-#define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */
-#define I2CSTOP _IO('i', 2) /* stop condition */
-#define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */
-#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */
-#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */
+#define I2CSTART _IO('i', 1) /* start condition */
+#define I2CSTOP _IO('i', 2) /* stop condition */
+#define I2CADDRESS _IOW('i', 3, long) /* address bus */
+#define I2CRSTCARD _IOW('i', 4, long) /* reset the card */
#endif
+
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index fd7bcfd2c661..a56526678345 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: md_var.h,v 1.27 1998/10/30 05:41:15 msmith Exp $
+ * $Id: md_var.h,v 1.25 1998/09/14 22:43:40 jdp Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -38,12 +38,7 @@
extern int Maxmem;
extern u_int atdevbase; /* offset in virtual memory of ISA io mem */
-extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
extern int busdma_swi_pending;
-extern int (*copyin_vector) __P((const void *udaddr, void *kaddr,
- size_t len));
-extern int (*copyout_vector) __P((const void *kaddr, void *udaddr,
- size_t len));
extern u_int cpu_feature;
extern u_int cpu_high;
extern u_int cpu_id;
@@ -56,7 +51,6 @@ extern int need_post_dma_flush;
#endif
extern void (*netisrs[32]) __P((void));
extern int nfs_diskless_valid;
-extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
extern char sigcode[];
extern int szsigcode;
@@ -68,6 +62,7 @@ struct fpreg;
void bcopyb __P((const void *from, void *to, size_t len));
void busdma_swi __P((void));
void cpu_halt __P((void));
+void cpu_power_down __P((void));
void cpu_reset __P((void));
void cpu_switch_load_fs __P((void)) __asm(__STRING(cpu_switch_load_fs));
void cpu_switch_load_gs __P((void)) __asm(__STRING(cpu_switch_load_gs));
@@ -80,12 +75,6 @@ void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
int fill_fpregs __P((struct proc *, struct fpreg *));
int fill_regs __P((struct proc *p, struct reg *regs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
-void i486_bzero __P((void *buf, size_t len));
-void i586_bcopy __P((const void *from, void *to, size_t len));
-void i586_bzero __P((void *buf, size_t len));
-int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
-int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
-void i686_pagezero __P((void *addr));
int is_physical_memory __P((vm_offset_t addr));
u_long kvtop __P((void *addr));
void setidt __P((int idx, alias_for_inthand_t *func, int typ, int dpl,
diff --git a/sys/i386/include/mouse.h b/sys/i386/include/mouse.h
index b6ecef777bee..27ec8e1fe94a 100644
--- a/sys/i386/include/mouse.h
+++ b/sys/i386/include/mouse.h
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mouse.h,v 1.10 1998/06/14 20:05:22 ahasty Exp $
+ * $Id: mouse.h,v 1.9 1997/12/07 08:08:50 yokota Exp $
*/
#ifndef _MACHINE_MOUSE_H_
@@ -113,7 +113,6 @@ typedef struct mousehw {
#define MOUSE_MODEL_THINK 5
#define MOUSE_MODEL_EASYSCROLL 6
#define MOUSE_MODEL_MOUSEMANPLUS 7
-#define MOUSE_MODEL_KIDSPAD 8
typedef struct mousemode {
int protocol; /* MOUSE_PROTO_XXX */
@@ -141,7 +140,6 @@ typedef struct mousemode {
#define MOUSE_PROTO_THINK 11 /* Kensignton Thinking Mouse, 3/4 bytes */
#define MOUSE_PROTO_SYSMOUSE 12 /* /dev/sysmouse */
#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */
-#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */
#define MOUSE_RES_UNKNOWN (-1)
#define MOUSE_RES_DEFAULT 0
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index ce0043945af6..e03b9ad66f7b 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
- * $Id: param.h,v 1.47 1998/10/13 08:24:37 dg Exp $
+ * $Id: param.h,v 1.46 1998/09/09 01:21:25 jdp Exp $
*/
#ifndef _MACHINE_PARAM_H_
@@ -54,7 +54,11 @@
* that are supported on the architecture.
*/
#define OBJFORMAT_NAMES "elf", "aout"
+#ifdef __ELF__
#define OBJFORMAT_DEFAULT "elf"
+#else
+#define OBJFORMAT_DEFAULT "aout"
+#endif
#ifdef SMP
#define NCPUS 2
diff --git a/sys/i386/include/pc/vesa.h b/sys/i386/include/pc/vesa.h
index 16b07098aad1..0f4dd6b93171 100644
--- a/sys/i386/include/pc/vesa.h
+++ b/sys/i386/include/pc/vesa.h
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vesa.h,v 1.3 1999/01/08 12:57:06 yokota Exp $
+ * $Id: vesa.h,v 1.1 1998/09/15 18:16:37 sos Exp $
*/
#ifndef _MACHINE_PC_VESA_H
@@ -115,6 +115,10 @@ struct vesa_mode
int vesa_load_ioctl(void);
int vesa_unload_ioctl(void);
+#ifndef VESA_MODULE
+int vesa_load(void);
+#endif
+
#endif /* KERNEL */
#endif /* !_MACHINE_PC_VESA_H */
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 5251be3890c7..25bfc624c8eb 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -42,7 +42,7 @@
*
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
- * $Id: pmap.h,v 1.56 1998/06/21 14:08:27 mckay Exp $
+ * $Id: pmap.h,v 1.55 1998/05/11 01:05:59 dyson Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -237,10 +237,9 @@ typedef struct pv_entry {
#define NPPROVMTRR 8
#define PPRO_VMTRRphysBase0 0x200
#define PPRO_VMTRRphysMask0 0x201
-struct ppro_vmtrr {
+struct {
u_int64_t base, mask;
-};
-extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR];
+} PPro_vmtrr[NPPROVMTRR];
extern caddr_t CADDR1;
extern pt_entry_t *CMAP1;
diff --git a/sys/i386/include/resource.h b/sys/i386/include/resource.h
deleted file mode 100644
index 030718221690..000000000000
--- a/sys/i386/include/resource.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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 _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
-
-/*
- * Definitions of resource types for Intel Architecture machines
- * with support for legacy ISA devices and drivers.
- */
-
-#define SYS_RES_IRQ 1
-#define SYS_RES_DRQ 2
-#define SYS_RES_MEMORY 3
-#define SYS_RES_IOPORT 4
-
-#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/i386/include/smb.h b/sys/i386/include/smb.h
index e0ebef8b2dd4..1338a15658b7 100644
--- a/sys/i386/include/smb.h
+++ b/sys/i386/include/smb.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smb.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $
+ * $Id: smb.h,v 1.1 1998/08/13 17:13:20 son Exp $
*
*/
#ifndef __SMB_H
@@ -34,7 +34,6 @@
struct smbcmd {
char cmd;
int count;
- u_char slave;
union {
char byte;
short word;
@@ -49,8 +48,8 @@ struct smbcmd {
} data;
};
-#define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd)
-#define SMB_QUICK_READ _IOW('i', 2, struct smbcmd)
+#define SMB_QUICK_WRITE _IO('i', 1)
+#define SMB_QUICK_READ _IO('i', 2)
#define SMB_SENDB _IOW('i', 3, struct smbcmd)
#define SMB_RECVB _IOW('i', 4, struct smbcmd)
#define SMB_WRITEB _IOW('i', 5, struct smbcmd)
diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h
index f28d633cbd3c..fa4d88f9cbc2 100644
--- a/sys/i386/include/types.h
+++ b/sys/i386/include/types.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
- * $Id: types.h,v 1.15 1998/07/14 05:09:43 bde Exp $
+ * $Id: types.h,v 1.14 1998/07/10 02:27:15 bde Exp $
*/
#ifndef _MACHINE_TYPES_H_
@@ -52,16 +52,33 @@ typedef __int64_t vm_ooffset_t;
typedef unsigned int vm_pindex_t;
typedef unsigned int vm_size_t;
-typedef __int32_t register_t;
+/*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+typedef __signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef __int64_t int64_t;
+typedef __uint64_t u_int64_t;
+
+typedef int32_t register_t;
+typedef int32_t ufs_daddr_t;
#ifdef KERNEL
typedef int intfptr_t;
typedef unsigned int uintfptr_t;
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+typedef __uint64_t uoff_t;
#endif
/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
+typedef u_int32_t intrmask_t;
/* Interrupt handler function type. */
typedef void inthand2_t __P((void *_cookie));
diff --git a/sys/i386/isa/README.le b/sys/i386/isa/README.le
index a8c33c194b3c..52e4df590588 100644
--- a/sys/i386/isa/README.le
+++ b/sys/i386/isa/README.le
@@ -1,4 +1,4 @@
-$Id: README.le,v 1.4 1997/02/22 09:35:49 peter Exp $
+$Id$
----------------
@@ -38,7 +38,7 @@ i386/conf/files.i386 file.
After that is done you will need to edit your config file (in
i386/conf) and a line similar to:
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
[The above line assumes the board is still at the factory defaults.]
Change the port, irq, and iomem value if needed to your configuration.
diff --git a/sys/i386/isa/README.stl b/sys/i386/isa/README.stl
index 84e8ab66dd90..20b62f701a91 100644
--- a/sys/i386/isa/README.stl
+++ b/sys/i386/isa/README.stl
@@ -328,7 +328,7 @@ i386/isa/stallion.c optional stl device-driver
- enter a line for each board that you want to use. For stallion.c
boards entries should look like:
-device stl0 at isa? port 0x2a0 tty irq 10
+device stl0 at isa? port 0x2a0 tty irq 10 vector stlintr
For istallion.c boards, the entries should look like:
diff --git a/sys/i386/isa/adv_isa.c b/sys/i386/isa/adv_isa.c
index 7e9b84de9481..09fe9f281926 100644
--- a/sys/i386/isa/adv_isa.c
+++ b/sys/i386/isa/adv_isa.c
@@ -44,7 +44,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_isa.c,v 1.7 1998/11/10 06:44:54 gibbs Exp $
+ * $Id: adv_isa.c,v 1.5 1998/10/10 00:44:12 imp Exp $
*/
#include <sys/param.h>
@@ -71,9 +71,9 @@
* The overrun buffer shared amongst all ISA/VL adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
/* Possible port addresses an ISA or VL adapter can live at */
u_int16_t adv_isa_ioports[] =
@@ -122,7 +122,7 @@ advisaprobe(struct isa_device *id)
if (id->id_iobase > 0) {
for (;port_index <= max_port_index; port_index++)
- if (id->id_iobase <= adv_isa_ioports[port_index])
+ if (id->id_iobase >= adv_isa_ioports[port_index])
break;
if ((port_index > max_port_index)
|| (id->id_iobase != adv_isa_ioports[port_index])) {
diff --git a/sys/i386/isa/aha_isa.c b/sys/i386/isa/aha_isa.c
index 94266790e87f..5f81ea183bda 100644
--- a/sys/i386/isa/aha_isa.c
+++ b/sys/i386/isa/aha_isa.c
@@ -28,14 +28,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aha_isa.c,v 1.5 1998/11/10 06:44:54 gibbs Exp $
+ * $Id: aha_isa.c,v 1.3 1998/10/10 00:44:12 imp Exp $
*/
-#include "pnp.h"
-
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <machine/bus_pio.h>
#include <machine/bus.h>
@@ -45,13 +42,9 @@
#include <cam/scsi/scsi_all.h>
-#if NPNP > 0
-#include <i386/isa/pnp.h>
-#endif
-
-static int aha_isa_probe(struct isa_device *dev);
-static int aha_isa_attach(struct isa_device *dev);
-static void aha_isa_intr(void *unit);
+static int aha_isa_probe __P((struct isa_device *dev));
+static int aha_isa_attach __P((struct isa_device *dev));
+static void aha_isa_intr __P((void *unit));
struct isa_driver ahadriver =
{
@@ -75,18 +68,41 @@ aha_isa_probe(dev)
*/
struct aha_softc *aha;
int port_index;
- int max_port_index;
+ int max_port_index;
- aha = NULL;
+ /*
+ * We ignore the unit number assigned by config to allow
+ * consistant numbering between PCI/EISA/ISA devices.
+ * This is a total kludge until we have a configuration
+ * manager.
+ */
+ dev->id_unit = aha_unit;
+ aha = NULL;
+ port_index = 0;
+ max_port_index = AHA_NUM_ISAPORTS - 1;
/*
* Bound our board search if the user has
* specified an exact port.
*/
- aha_find_probe_range(dev->id_iobase, &port_index, &max_port_index);
-
- if (port_index < 0)
- return 0;
+ if (dev->id_iobase > 0) {
+ for (;port_index <= max_port_index; port_index++)
+ if (dev->id_iobase >= aha_isa_ports[port_index].addr)
+ break;
+ if ((port_index > max_port_index)
+ || (dev->id_iobase != aha_isa_ports[port_index].addr)) {
+ printf("
+aha_isa_probe: Invalid baseport of 0x%x specified.
+aha_isa_probe: Nearest valid baseport is 0x%x.
+aha_isa_probe: Failing probe.\n",
+ dev->id_iobase,
+ (port_index <= max_port_index)
+ ? aha_isa_ports[port_index].addr
+ : aha_isa_ports[max_port_index].addr);
+ return 0;
+ }
+ max_port_index = port_index;
+ }
/* Attempt to find an adapter */
for (;port_index <= max_port_index; port_index++) {
@@ -94,7 +110,7 @@ aha_isa_probe(dev)
u_int ioport;
int error;
- ioport = aha_iop_from_bio(port_index);
+ ioport = aha_isa_ports[port_index].addr;
/*
* Ensure this port has not already been claimed already
@@ -102,7 +118,7 @@ aha_isa_probe(dev)
*/
if (aha_check_probed_iop(ioport) != 0)
continue;
- dev->id_iobase = ioport;
+ dev->id_iobase = aha_isa_ports[port_index].addr;
if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
continue;
@@ -125,7 +141,7 @@ aha_isa_probe(dev)
* Determine our IRQ, and DMA settings and
* export them to the configuration system.
*/
- error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
(u_int8_t*)&config_data, sizeof(config_data),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -150,7 +166,6 @@ aha_isa_probe(dev)
printf("aha_isa_probe: Invalid DMA setting "
"detected for adapter at 0x%x. "
"Failing probe\n", ioport);
- return (0);
}
dev->id_irq = (config_data.irq << 9);
dev->id_intr = aha_isa_intr;
@@ -213,79 +228,3 @@ aha_isa_intr(void *unit)
struct aha_softc* arg = aha_softcs[(int)unit];
aha_intr((void *)arg);
}
-
-/*
- * support PnP cards if we are using 'em
- */
-
-#if NPNP > 0
-
-static char *ahapnp_probe(u_long csn, u_long vend_id);
-static void ahapnp_attach(u_long csn, u_long vend_id, char *name,
- struct isa_device *dev);
-static u_long nahapnp = NAHA;
-
-static struct pnp_device ahapnp = {
- "ahapnp",
- ahapnp_probe,
- ahapnp_attach,
- &nahapnp,
- &bio_imask
-};
-DATA_SET (pnpdevice_set, ahapnp);
-
-static char *
-ahapnp_probe(u_long csn, u_long vend_id)
-{
- struct pnp_cinfo d;
- char *s = NULL;
-
- if (vend_id != AHA1542_PNP && vend_id != AHA1542_PNPCOMPAT)
- return (NULL);
-
- read_pnp_parms(&d, 0);
- if (d.enable == 0 || d.flags & 1) {
- printf("CSN %lu is disabled.\n", csn);
- return (NULL);
- }
- s = "Adaptec 1542CP";
-
- return (s);
-}
-
-static void
-ahapnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
-{
- struct pnp_cinfo d;
- struct isa_device *dvp;
-
- if (dev->id_unit >= NAHATOT)
- return;
-
- if (read_pnp_parms(&d, 0) == 0) {
- printf("failed to read pnp parms\n");
- return;
- }
-
- write_pnp_parms(&d, 0);
-
- enable_pnp_card();
-
- dev->id_iobase = d.port[0];
- dev->id_irq = (1 << d.irq[0]);
- dev->id_intr = aha_intr;
- dev->id_drq = d.drq[0];
-
- if (dev->id_driver == NULL) {
- dev->id_driver = &ahadriver;
- dvp = find_isadev(isa_devtab_tty, &ahadriver, 0);
- if (dvp != NULL)
- dev->id_id = dvp->id_id;
- }
-
- if ((dev->id_alive = aha_isa_probe(dev)) != 0)
- aha_isa_attach(dev);
- else
- printf("aha%d: probe failed\n", dev->id_unit);
-}
-#endif
diff --git a/sys/i386/isa/aic6360.c b/sys/i386/isa/aic6360.c
index e0f946d3d993..2b28abcebcd5 100644
--- a/sys/i386/isa/aic6360.c
+++ b/sys/i386/isa/aic6360.c
@@ -32,7 +32,7 @@
*/
/*
- * $Id: aic6360.c,v 1.42 1998/10/22 05:58:38 bde Exp $
+ * $Id: aic6360.c,v 1.40 1998/04/15 17:45:12 bde Exp $
*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@@ -663,7 +663,6 @@ static int aic_find __P((struct aic_data *));
static void aic_done __P((struct acb *));
static void aic_dataout __P((struct aic_data *aic));
static void aic_datain __P((struct aic_data *aic));
-static ointhand2_t aicintr;
static int32_t aic_scsi_cmd __P((struct scsi_xfer *));
static int aic_poll __P((struct aic_data *aic, struct acb *));
void aic_add_timeout __P((struct acb *, int));
@@ -715,7 +714,6 @@ static struct scsi_device aic_dev = {
#include "card.h"
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -723,7 +721,16 @@ static int aic_card_intr __P((struct pccard_devinfo *));
static int aicinit __P((struct pccard_devinfo *));
static void aicunload __P((struct pccard_devinfo *));
-PCCARD_MODULE(aic, aicinit, aicunload, aic_card_intr, 0, bio_imask);
+static struct pccard_device aic_info = {
+ "aic",
+ aicinit,
+ aicunload,
+ aic_card_intr,
+ 0, /* Attributes - presently unused */
+ &bio_imask
+};
+
+DATA_SET(pccarddrv_set, aic_info);
/*
* Initialize the device - called from Slot manager.
@@ -960,7 +967,6 @@ aicattach(dev)
struct scsibus_data *scbus;
AIC_TRACE(("aicattach\n"));
- dev->id_ointr = aicintr;
aic->state = 0;
aic_scsi_reset(aic);
aic_init(aic); /* Init chip and driver */
@@ -2129,7 +2135,7 @@ aic_datain(aic)
* 2) doesn't support synchronous transfers properly (yet)
*/
-static void
+void
aicintr(int unit)
{
struct aic_data *aic = aicdata[unit];
diff --git a/sys/i386/isa/alog.c b/sys/i386/isa/alog.c
new file mode 100644
index 000000000000..8fbe5768811a
--- /dev/null
+++ b/sys/i386/isa/alog.c
@@ -0,0 +1,663 @@
+/*
+ * Copyright (c) 1998 Scottibox
+ * 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
+ * in this position and unchanged.
+ * 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
+ *
+ * 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.
+ *
+ * Industrial Computer Source model AIO8-P
+ * 8 channel, moderate speed analog to digital converter board with
+ * 128 channel MUX capability via daisy chained AT-16P units
+ * alog.c, character device driver, last revised January 6 1998
+ * See http://www.scottibox.com
+ * http://www.indcompsrc.com/products/data/html/aio8g-p.html
+ * http://www.indcompsrc.com/products/data/html/at16-p.html
+ *
+ * Written by: Jamil J. Weatherbee <jamil@scottibox.com>
+ *
+ */
+
+
+/* Include Files */
+
+#include "alog.h"
+#if NALOG > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+#include <sys/malloc.h>
+#include <sys/poll.h>
+#include <sys/vnode.h>
+#include <sys/filio.h>
+#include <i386/isa/isa_device.h>
+#include <sys/alogio.h>
+#include <sys/dataacq.h>
+
+#include "opt_devfs.h"
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif
+
+/* Local Defines */
+
+/* Tests have shown that increasing the fifo size
+ * beyond 64 entries for this particular piece of hardware is
+ * unproductive */
+
+#ifdef ALOG_FIFOSIZE
+#define FIFOSIZE ALOG_FIFOSIZE
+#else
+#define FIFOSIZE 64
+#endif
+
+#ifdef ALOG_FIFO_TRIGGER
+#define DEFAULT_FIFO_TRIGGER ALOG_FIFO_TRIGGER
+#else
+#define DEFAULT_FIFO_TRIGGER 1
+#endif
+
+#ifdef ALOG_CHANNELS
+#define NUMCHANNELS ALOG_CHANNELS
+#else
+#define NUMCHANNELS 128
+#endif
+
+#ifdef ALOG_TIMO
+#define READTIMO ALOG_TIMO
+#else
+#define READTIMO (MAX_MICRO_PERIOD*NUMCHANNELS/500000*hz)
+#endif
+
+#define CDEV_MAJOR 86
+#define NUMPORTS 8
+#define MAXUNITS 2
+#define NUMIMUXES 8
+
+#define ADLOW 0x0
+#define ADHIGH 0x1
+#define STATUS 0x2
+#define CNTR0 0x4
+#define CNTR1 0x5
+#define CNTR2 0x6
+#define CNTRCNTRL 0x7
+
+#define DEVFORMAT "alog%d%c%d"
+#define CLOCK2FREQ 4.165
+#define MIN_MICRO_PERIOD 25
+#define MAX_MICRO_PERIOD (65535/CLOCK2FREQ*PRIMARY_STATES)
+#define DEFAULT_MICRO_PERIOD MAX_MICRO_PERIOD
+#define READMAXTRIG 0.75*FIFOSIZE
+#define ALOGPRI PRIBIO
+#define ALOGMSG "alogio"
+
+#define PRIMARY_STATES 2 /* Setup and conversion are clock tick consuming */
+#define STATE_SETUP 0
+#define STATE_CONVERT 1
+#define STATE_READ 2
+
+/* Notes on interrupt driven A/D conversion:
+ * On the AIO8-P, interrupt driven conversion (the only type supported by this
+ * driver) is facilitated through 8253 timer #2. In order for interrrupts to
+ * be generated you must connect line 6 to line 24 (counter 2 output to
+ * interrupt input) and line 23 to line 29 (counter 2 gate to +5VDC).
+ * Due to the design of the AIO8-P this precludes the use of programmable
+ * gain control.
+ */
+
+/* mode bits for the status register */
+
+#define EOC 0x80
+#define IEN 0x08
+#define IMUXMASK 0x07
+#define EMUXMASK 0xf0
+
+/* mode bits for counter controller */
+
+#define LD2MODE4 0xb8
+
+/* Minor allocations:
+ * UCCCCMMM
+ * U: board unit (0-1)
+ * CCCC: external multiplexer channel (0-15) (on AT-16P units)
+ * MMM: internal multiplexer channel (0-7) (on AIO8-P card)
+ */
+
+#define UNIT(dev) ((minor(dev) & 0x80) >> 7)
+#define CHANNEL(dev) (minor(dev) & 0x7f)
+#define EMUX(chan) ((chan & 0x78) >> 3)
+#define EMUXMAKE(chan) ((chan & 0x78) << 1)
+#define IMUX(chan) (chan & 0x07)
+#define LMINOR(unit, chan) ((unit << 7)+chan)
+
+/* port statuses */
+
+#define STATUS_UNUSED 0
+#define STATUS_INUSE 1
+#define STATUS_STOPPED 2
+#define STATUS_INIT 3
+
+/* Type definitions */
+
+typedef struct
+{
+ short status; /* the status of this chan */
+ struct selinfo readpoll; /* the poll() info */
+ u_short fifo[FIFOSIZE]; /* fifo for this chan */
+ int fifostart, fifoend; /* the ptrs showing where info is stored in fifo */
+ int fifosize, fifotrig; /* the current and trigger size of the fifo */
+ void *devfs_token; /* the devfs token for this chan */
+ int nextchan;
+} talog_chan;
+
+typedef struct
+{
+ struct isa_device *isaunit; /* ptr to isa device information */
+ talog_chan chan[NUMCHANNELS]; /* the device nodes */
+ int curchan; /* the current chan being intr handled */
+ int firstchan; /* the first chan to go to in list */
+ int state; /* is the node in setup or convert mode */
+ long microperiod; /* current microsecond period setting */
+ u_char perlo, perhi; /* current values to send to clock 2 after every intr */
+
+} talog_unit;
+
+/* Function Prototypes */
+
+static int alog_probe (struct isa_device *idp); /* Check for alog board */
+static int alog_attach (struct isa_device *idp); /* Take alog board */
+static int sync_clock2 (int unit, long period); /* setup clock 2 period */
+static int putfifo (talog_chan *pchan, u_short fifoent);
+static int alog_open (dev_t dev, int oflags, int devtype, struct proc *p);
+static int alog_close (dev_t dev, int fflag, int devtype, struct proc *p);
+static int alog_ioctl (dev_t dev, u_long cmd, caddr_t data,
+ int fflag, struct proc *p);
+static int alog_read (dev_t dev, struct uio *uio, int ioflag);
+static int alog_poll (dev_t dev, int events, struct proc *p);
+
+/* Global Data */
+
+static int alog_devsw_installed = 0; /* Protect against reinit multiunit */
+static talog_unit *alog_unit[NALOG]; /* data structs for each unit */
+
+/* Character device switching structure */
+static struct cdevsw alog_cdevsw = { alog_open, alog_close, alog_read,
+ nowrite, alog_ioctl, nostop, noreset,
+ nodevtotty, alog_poll, nommap,
+ nostrategy, "alog", NULL, -1 };
+
+/* Structure expected to tell how to probe and attach the driver
+ * Must be published externally (cannot be static) */
+struct isa_driver alogdriver = { alog_probe, alog_attach, "alog", 0 };
+
+
+/* handle the ioctls */
+static int alog_ioctl (dev_t dev, u_long cmd, caddr_t data,
+ int fflag, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+
+ switch (cmd)
+ {
+ case FIONBIO: return 0; /* this allows for non-blocking ioctls */
+
+ case AD_NCHANS_GET: *(int *)data = NUMCHANNELS;
+ return 0;
+ case AD_FIFOSIZE_GET: *(int *)data = FIFOSIZE;
+ return 0;
+
+ case AD_FIFO_TRIGGER_GET: s = spltty();
+ *(int *)data = info->chan[chan].fifotrig;
+ splx(s);
+ return 0;
+
+ case AD_FIFO_TRIGGER_SET:
+ s = spltty();
+ if ((*(int *)data < 1) || (*(int *)data > FIFOSIZE))
+ {
+ splx(s);
+ return EPERM;
+ }
+ info->chan[chan].fifotrig = *(int *)data;
+ splx(s);
+ return 0;
+
+ case AD_STOP: s = spltty();
+ info->chan[chan].status = STATUS_STOPPED;
+ splx(s);
+ return 0;
+
+ case AD_START: s = spltty();
+ info->chan[chan].status = STATUS_INUSE;
+ splx(s);
+ return 0;
+
+ case AD_MICRO_PERIOD_SET:
+ s = spltty();
+ if (sync_clock2 (unit, *(long *) data))
+ {
+ splx(s);
+ return EPERM;
+ }
+ splx(s);
+ return 0;
+
+ case AD_MICRO_PERIOD_GET: s = spltty();
+ *(long *)data = info->microperiod;
+ splx(s);
+ return 0;
+
+ }
+
+ return ENOTTY;
+}
+
+
+/* handle poll() based read polling */
+static int alog_poll (dev_t dev, int events, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+
+ s = spltty();
+ if (events & (POLLIN | POLLRDNORM)) /* if polling for any/normal data */
+ if (info->chan[chan].fifosize >= info->chan[chan].fifotrig)
+ {
+ splx(s);
+
+ return events & (POLLIN | POLLRDNORM); /* ready for any/read */
+ }
+ else
+ {
+ /* record this request */
+ selrecord (p, &(info->chan[chan].readpoll));
+ splx(s);
+ return 0; /* not ready, yet */
+ }
+
+ splx(s);
+ return 0; /* not ready (any I never will be) */
+}
+
+
+/* how to read from the board */
+static int alog_read (dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s, oldtrig, toread, err = 0;
+
+ s = spltty();
+
+ oldtrig = info->chan[chan].fifotrig; /* save official trigger value */
+ while (uio->uio_resid >= sizeof(u_short)) /* while uio has space */
+ {
+ if (!info->chan[chan].fifosize) /* if we have an empty fifo */
+ {
+ if (ioflag & IO_NDELAY) /* exit if we are non-blocking */
+ { err = EWOULDBLOCK;
+ break;
+ }
+ /* Start filling fifo on first blocking read */
+ if (info->chan[chan].status == STATUS_INIT)
+ info->chan[chan].status = STATUS_INUSE;
+ /* temporarily adjust the fifo trigger to be optimal size */
+ info->chan[chan].fifotrig =
+ min (READMAXTRIG, uio->uio_resid / sizeof(u_short));
+ /* lets sleep until we have some io available or timeout */
+ err = tsleep (&(info->chan[chan].fifo), ALOGPRI | PCATCH, ALOGMSG,
+ info->chan[chan].fifotrig*READTIMO);
+ if (err == EWOULDBLOCK)
+ { printf (DEVFORMAT ": read timeout\n", unit,
+ 'a'+EMUX(chan), IMUX(chan));
+ }
+ if (err == ERESTART) err = EINTR; /* don't know how to restart */
+ if (err) break; /* exit if any kind of error or signal */
+ }
+
+ /* ok, now if we got here there is something to read from the fifo */
+
+ /* calculate how many entries we can read out from the fifostart
+ * pointer */
+ toread = min (uio->uio_resid / sizeof(u_short),
+ min (info->chan[chan].fifosize,
+ FIFOSIZE - info->chan[chan].fifostart));
+ /* perform the move, if there is an error then exit */
+ if (err = uiomove((caddr_t)
+ &(info->chan[chan].fifo[info->chan[chan].fifostart]),
+ toread * sizeof(u_short), uio)) break;
+ info->chan[chan].fifosize -= toread; /* fifo this much smaller */
+ info->chan[chan].fifostart += toread; /* we got this many more */
+ if (info->chan[chan].fifostart == FIFOSIZE)
+ info->chan[chan].fifostart = 0; /* wrap around fifostart */
+
+ }
+ info->chan[chan].fifotrig = oldtrig; /* restore trigger changes */
+ splx(s);
+ return err;
+}
+
+
+/* open a channel */
+static int alog_open (dev_t dev, int oflags, int devtype, struct proc *p)
+{
+ int unit = UNIT(dev); /* get unit no */
+ int chan = CHANNEL(dev); /* get channel no */
+ talog_unit *info;
+ int s; /* priority */
+ int cur;
+
+ if ((unit >= NALOG) || (unit >= MAXUNITS) || (chan >= NUMCHANNELS))
+ return ENXIO; /* unit and channel no ok ? */
+ if (!alog_unit[unit]) return ENXIO; /* unit attached */
+ info = alog_unit[unit]; /* ok, this is valid now */
+
+ if (info->chan[chan].status) return EBUSY; /* channel busy */
+ if (oflags & FREAD)
+ {
+ s=spltty();
+ info->chan[chan].status = STATUS_INIT; /* channel open, read waiting */
+ info->chan[chan].fifostart = info->chan[chan].fifoend =
+ info->chan[chan].fifosize = 0;/* fifo empty */
+ info->chan[chan].fifotrig = DEFAULT_FIFO_TRIGGER;
+ if (info->firstchan < 0) /* if empty chain */
+ {
+ info->firstchan = info->curchan = chan; /* rev up the list */
+ info->chan[chan].nextchan = -1; /* end of the list */
+ }
+ else /* non empty list must insert */
+ {
+ if (chan < info->firstchan) /* this one must become first in list */
+ {
+ info->chan[chan].nextchan = info->firstchan;
+ info->firstchan = chan;
+ }
+ else /* insert this one as second - last in chan list */
+ {
+ cur = info->firstchan;
+
+ /* traverse list as long as cur is less than chan and cur is
+ * not last in list */
+ while ((info->chan[cur].nextchan < chan) &&
+ (info->chan[cur].nextchan >= 0))
+ cur = info->chan[cur].nextchan;
+
+ /* now cur should point to the entry right before yours */
+ info->chan[chan].nextchan = info->chan[cur].nextchan;
+ info->chan[cur].nextchan = chan; /* insert yours in */
+ }
+ }
+ splx(s);
+ return 0; /* open successful */
+ }
+ return EPERM; /* this is a read only device */
+}
+
+
+/* close a channel */
+static int alog_close (dev_t dev, int fflag, int devtype, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+ int cur;
+
+ s = spltty();
+ info->chan[chan].status = STATUS_UNUSED;
+
+ /* what if we are in the middle of a conversion ?
+ * then smoothly get us out of it: */
+ if (info->curchan == chan)
+ { /* if we are last in list set curchan to first in list */
+ if ((info->curchan = info->chan[chan].nextchan) < 0)
+ info->curchan = info->firstchan;
+
+ info->state = STATE_SETUP;
+ }
+
+ /* if this is the first channel, then make the second channel the first
+ * channel (note that if this is also the only channel firstchan becomes
+ * -1 and so the list is marked as empty */
+
+ if (chan == info->firstchan)
+ info->firstchan = info->chan[chan].nextchan;
+ else /* ok, so there must be at least 2 channels (and it is not the first) */
+ {
+ cur = info->firstchan;
+
+ /* find the entry before it (which must exist if you are closing) */
+ while (info->chan[cur].nextchan < chan)
+ cur = info->chan[cur].nextchan;
+ /* at this point we must have the entry before ours */
+ info->chan[cur].nextchan = info->chan[chan].nextchan; /* give our link */
+
+ }
+
+ splx(s);
+
+ return 0; /* close always successful */
+}
+
+
+/* The probing routine - returns number of bytes needed */
+static int alog_probe (struct isa_device *idp)
+{
+ int unit = idp->id_unit; /* this device unit number */
+ int iobase = idp->id_iobase; /* the base address of the unit */
+ int addr;
+
+ if ((unit < 0) || (unit >= NALOG) || (unit >= MAXUNITS))
+ {
+ printf ("alog: invalid unit number (%d)\n", unit);
+ return 0;
+ }
+
+ /* the unit number is ok, lets check if used */
+ if (alog_unit[unit])
+ {
+ printf ("alog: unit (%d) already attached\n", unit);
+ return 0;
+ }
+
+ if (inb (iobase+STATUS) & EOC) return 0; /* End of conv bit should be 0 */
+ for (addr=0; addr<NUMIMUXES; addr++)
+ {
+ outb (iobase+STATUS, EMUXMASK|addr);/* output ones to upper nibbl+addr */
+ /* get back a zero in MSB and the addr where you put it */
+ if ((inb (iobase+STATUS) & (EOC|IMUXMASK)) != addr) return 0;
+ }
+
+ return NUMPORTS; /* this device needs this many ports */
+}
+
+
+/* setup the info structure correctly for reloading clock 2 after interrupt */
+static int sync_clock2 (int unit, long period)
+{
+ int clockper;
+ talog_unit *info = alog_unit[unit];
+
+ if ((period > MAX_MICRO_PERIOD) || (period < MIN_MICRO_PERIOD))
+ return -1; /* error period too long */
+ info->microperiod = period; /* record the period */
+ clockper = (CLOCK2FREQ * period) / PRIMARY_STATES;
+ info->perlo = clockper & 0xff; /* least sig byte of clock period */
+ info->perhi = ((clockper & 0xff00) >> 8); /* most sig byte of clock period */
+ return 0;
+}
+
+
+/* The attachment routine - returns true on success */
+static int alog_attach (struct isa_device *idp)
+{
+ int unit = idp->id_unit; /* this device unit number */
+ int iobase = idp->id_iobase; /* the base address of the unit */
+ talog_unit *info; /* pointer to driver specific info for unit */
+ int chan; /* the channel used for creating devfs nodes */
+
+ if (!(info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT)))
+ {
+ printf ("alog%d: cannot allocate driver storage\n", unit);
+ return 0;
+ }
+ alog_unit[unit] = info; /* make sure to save the pointer */
+ bzero (info, sizeof(*info)); /* clear info structure to all false */
+ info->isaunit = idp; /* store ptr to isa device information */
+ sync_clock2 (unit, DEFAULT_MICRO_PERIOD); /* setup perlo and perhi */
+ info->firstchan = -1; /* channel lists are empty */
+
+ /* insert devfs nodes */
+
+#ifdef DEVFS
+ for (chan=0; chan<NUMCHANNELS; chan++)
+ info->chan[chan].devfs_token =
+ devfs_add_devswf(&alog_cdevsw, LMINOR(unit, chan), DV_CHR,
+ UID_ROOT, GID_WHEEL, 0400, DEVFORMAT,
+ unit, 'a'+EMUX(chan), IMUX(chan));
+#endif
+
+ printf ("alog%d: %d channels, %d bytes/FIFO, %d entry trigger\n",
+ unit, NUMCHANNELS, FIFOSIZE*sizeof(u_short),
+ DEFAULT_FIFO_TRIGGER);
+ alogintr (unit); /* start the periodic interrupting process */
+ return 1; /* obviously successful */
+}
+
+
+/* Unit interrupt handling routine (interrupts generated by clock 2) */
+void alogintr (int unit)
+{
+ talog_unit *info = alog_unit[unit];
+ int iobase = info->isaunit->id_iobase;
+ u_short fifoent;
+
+
+ if (info->firstchan >= 0) /* ? is there even a chan list to traverse */
+ switch (info->state)
+ {
+ case STATE_READ:
+ if (info->chan[info->curchan].status == STATUS_INUSE)
+ {
+ if (inb (iobase+STATUS) & EOC) /* check that conversion finished */
+ printf (DEVFORMAT ": incomplete conversion\n", unit,
+ 'a'+EMUX(info->curchan), IMUX(info->curchan));
+ else /* conversion is finished (should always be) */
+ {
+ fifoent = (inb (iobase+ADHIGH) << 8) +
+ inb (iobase+ADLOW);
+ if (putfifo(&(info->chan[info->curchan]), fifoent))
+ {
+ printf (DEVFORMAT ": fifo overflow\n", unit,
+ 'a'+EMUX(info->curchan), IMUX(info->curchan));
+ }
+ if (info->chan[info->curchan].fifosize >=
+ info->chan[info->curchan].fifotrig)
+ {
+ /* if we've reached trigger levels */
+ selwakeup (&(info->chan[info->curchan].readpoll));
+ wakeup (&(info->chan[info->curchan].fifo));
+ }
+ }
+ }
+ /* goto setup state for next channel on list */
+ if ((info->curchan = info->chan[info->curchan].nextchan) < 0)
+ info->curchan = info->firstchan;
+ /* notice lack of break here this implys a STATE_SETUP */
+ case STATE_SETUP: /* set the muxes and let them settle */
+#if NUMCHANNELS > NUMIMUXES /* only do this if using external muxes */
+ outb (iobase+STATUS,
+ EMUXMAKE(info->curchan) | IMUX(info->curchan) | IEN);
+ info->state = STATE_CONVERT;
+ break;
+#endif
+ case STATE_CONVERT:
+ outb (iobase+STATUS,
+ EMUXMAKE(info->curchan) | IMUX(info->curchan) | IEN);
+ outb (iobase+ADHIGH, 0); /* start the conversion */
+ info->state = STATE_READ;
+ break;
+ }
+ else /* this is kind of like an idle mode */
+ {
+ outb (iobase+STATUS, IEN); /* no list keep getting interrupts though */
+ /* since we have no open channels spin clock rate down to
+ * minimum to save interrupt overhead */
+ outb (iobase+CNTRCNTRL, LD2MODE4); /* counter 2 to mode 4 strobe */
+ outb (iobase+CNTR2, 0xff); /* longest period we can generate */
+ outb (iobase+CNTR2, 0xff);
+ return;
+ }
+ outb (iobase+CNTRCNTRL, LD2MODE4); /* counter 2 to mode 4 strobe */
+ outb (iobase+CNTR2, info->perlo); /* low part of the period count */
+ outb (iobase+CNTR2, info->perhi); /* high part of the period count */
+}
+
+
+/* this will put an entry in fifo, returns 1 if the first item in
+ * fifo was wiped (overflow) or 0 if everything went fine */
+static int putfifo (talog_chan *pchan, u_short fifoent)
+{
+ pchan->fifo[pchan->fifoend] = fifoent; /* insert the entry in */
+ pchan->fifoend++; /* one more in fifo */
+ if (pchan->fifoend == FIFOSIZE) pchan->fifoend = 0; /* wrap around */
+ /* note: I did intend to write over the oldest entry on overflow */
+ if (pchan->fifosize == FIFOSIZE) /* overflowing state already */
+ {
+ pchan->fifostart++;
+ if (pchan->fifostart == FIFOSIZE) pchan->fifostart = 0;
+ return 1; /* we overflowed */
+ }
+ pchan->fifosize++; /* actually one bigger, else same size */
+ return 0; /* went in just fine */
+}
+
+
+/* Driver initialization */
+static void alog_drvinit (void *unused)
+{
+ dev_t dev; /* Type for holding device major/minor numbers (int) */
+
+ if (!alog_devsw_installed)
+ {
+ dev = makedev (CDEV_MAJOR, 0); /* description of device major */
+ cdevsw_add (&dev, &alog_cdevsw, NULL); /* put driver in cdev table */
+ alog_devsw_installed=1;
+ }
+}
+
+/* System initialization call instance */
+
+SYSINIT (alogdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
+ alog_drvinit,NULL);
+
+#endif
diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c
index 1a801b08fa69..fe8dba69d73e 100644
--- a/sys/i386/isa/asc.c
+++ b/sys/i386/isa/asc.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
- * $Id: asc.c,v 1.31 1998/08/12 18:16:38 bde Exp $
+ * $Id: asc.c,v 1.30 1998/06/07 17:10:13 dfr Exp $
*/
#include "asc.h"
@@ -188,8 +188,6 @@ static int ascprobe (struct isa_device *isdp);
static int ascattach(struct isa_device *isdp);
struct isa_driver ascdriver = { ascprobe, ascattach, "asc" };
-static ointhand2_t ascintr;
-
static d_open_t ascopen;
static d_close_t ascclose;
static d_read_t ascread;
@@ -450,7 +448,6 @@ ascattach(struct isa_device *isdp)
int unit = isdp->id_unit;
struct asc_unit *scu = unittab + unit;
- isdp->id_ointr = ascintr;
scu->flags |= FLAG_DEBUG;
printf("asc%d: [GI1904/Trust Ami-Scan Grey/Color]\n", unit);
@@ -500,7 +497,7 @@ ascattach(struct isa_device *isdp)
*** ascintr
*** the interrupt routine, at the end of DMA...
***/
-static void
+void
ascintr(int unit)
{
struct asc_unit *scu = unittab + unit;
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index f475fa5083b8..62c168c8d2d3 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.6 1998/12/07 21:58:20 archie Exp $
+ * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $
*/
#include "wdc.h"
@@ -94,6 +94,7 @@ static void acd_done(struct acd *, struct buf *, int, struct atapires);
static int acd_read_toc(struct acd *);
static int acd_request_wait(struct acd *, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, char *, int);
static void acd_describe(struct acd *);
+static int acd_open(dev_t, int, int);
static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char);
static int acd_eject(struct acd *, int);
static void acd_select_slot(struct acd *);
@@ -261,11 +262,11 @@ acd_describe(struct acd *cdp)
printf("acd%d: drive speed ", cdp->lun);
if (cdp->cap.cur_speed != cdp->cap.max_speed)
printf("%d - ", cdp->cap.cur_speed * 1000 / 1024);
- printf("%dKB/sec", cdp->cap.max_speed * 1000 / 1024);
+ printf("%dKb/sec", cdp->cap.max_speed * 1000 / 1024);
if (cdp->cap.buf_size)
- printf(", %dKB cache\n", cdp->cap.buf_size);
+ printf(", %dKb cache\n", cdp->cap.buf_size);
- printf("acd%d: supported read types:", cdp->lun);
+ printf("acd%d: supported read types:", cdp->lun);
comma = 0;
if (cdp->cap.read_cdr) {
printf(" CD-R"); comma = 1;
@@ -442,12 +443,16 @@ acdclose(dev_t dev, int flags, int fmt, struct proc *p)
static int
acdread(dev_t dev, struct uio *uio, int ioflag)
{
+ struct acd *cdp = acdtab[dkunit(dev)];
+
return physio(acdstrategy, NULL, dev, 1, minphys, uio);
}
static int
acdwrite(dev_t dev, struct uio *uio, int ioflag)
{
+ struct acd *cdp = acdtab[dkunit(dev)];
+
return physio(acdstrategy, NULL, dev, 0, minphys, uio);
}
@@ -1147,7 +1152,7 @@ acd_read_toc(struct acd *cdp)
else
printf("%ld:%ld audio ", cdp->info.volsize / 75 / 60,
cdp->info.volsize / 75 % 60);
- printf("(%ld sectors (%ld bytes)), %d tracks\n",
+ printf("(%ld sectors (%d bytes)), %d tracks\n",
cdp->info.volsize, cdp->info.blksize,
cdp->toc.hdr.ending_track - cdp->toc.hdr.starting_track + 1);
}
@@ -1284,6 +1289,7 @@ acd_open_track(struct acd *cdp, struct wormio_prepare_track *ptp)
{
struct write_param param;
struct atapires result;
+ int error;
result = atapi_request_wait(cdp->ata, cdp->unit, ATAPI_MODE_SENSE,
0, 0x05, 0, 0, 0, 0,
@@ -1569,6 +1575,8 @@ static acd_devsw_installed = 0;
static void
acd_drvinit(void *unused)
{
+ dev_t dev;
+
if (!acd_devsw_installed) {
cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &acd_cdevsw);
acd_devsw_installed = 1;
diff --git a/sys/i386/isa/atapi.c b/sys/i386/isa/atapi.c
index 9b3090d8bd20..44cdc4e23501 100644
--- a/sys/i386/isa/atapi.c
+++ b/sys/i386/isa/atapi.c
@@ -88,7 +88,7 @@
* You will need to make at least three routines: open(), close(),
* strategy() and possibly ioctl().
* 2. Make attach() routine, which should allocate all the needed data
- * structures and print the device description string (see xxxattach()).
+ * structures and print the device description string (see wcdattach()).
* 3. Add an appropriate case to the switch in atapi_attach() routine,
* call attach() routine of the new driver here. Add the appropriate
* #include line at the top of attach.c.
@@ -104,6 +104,7 @@
#ifndef ATAPI_MODULE
# include "acd.h"
+# include "wcd.h"
# include "wfd.h"
# include "wst.h"
/* # include "wmd.h" -- add your driver here */
@@ -169,8 +170,11 @@ static int atapi_io (struct atapi *ata, struct atapicmd *ac);
static int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac);
static int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac);
+static void atapi_poll_dsc(struct atapi *ata);
+
extern int wdstart (int ctrlr);
extern int acdattach(struct atapi*, int, struct atapi_params*, int);
+extern int wcdattach(struct atapi*, int, struct atapi_params*, int);
extern int wfdattach(struct atapi*, int, struct atapi_params*, int);
extern int wstattach(struct atapi*, int, struct atapi_params*, int);
@@ -300,9 +304,17 @@ int atapi_attach (int ctlr, int unit, int port)
ata->attached[unit] = 1;
return (1);
#else
+#if NWCD > 0
+ /* ATAPI CD-ROM drives */
+ if (wcdattach (ata, unit, ap, ata->debug) < 0)
+ break;
+ ata->attached[unit] = 1;
+ return (1);
+#else
printf ("wdc%d: ATAPI CD-ROMs not configured\n", ctlr);
break;
#endif
+#endif
case AT_TYPE_TAPE: /* streaming tape */
#if NWST > 0
@@ -368,7 +380,7 @@ static char *cmdname (u_char cmd)
case 0xbd: return ("ATAPI_MECH_STATUS");
case 0xbe: return ("READ_CD");
}
- snprintf (buf, sizeof(buf), "[0x%x]", cmd);
+ sprintf (buf, "[0x%x]", cmd);
return (buf);
}
@@ -652,8 +664,8 @@ int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac)
*/
int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac)
{
- /* Wait for DRQ from 100 usec to 3 msec for slow devices */
- int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 100;
+ /* Wait for DRQ from 50 usec to 3 msec for slow devices */
+ int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50;
int ireason = 0, phase = 0;
/* Wait for command phase. */
diff --git a/sys/i386/isa/atapi.h b/sys/i386/isa/atapi.h
index 19733257f93c..dce85fbc883b 100644
--- a/sys/i386/isa/atapi.h
+++ b/sys/i386/isa/atapi.h
@@ -226,8 +226,8 @@ struct atapidrv { /* delayed attach info */
};
struct buf;
-struct dmy;
-typedef void atapi_callback_t(struct dmy *, struct buf *, int, struct atapires);
+struct wcd;
+typedef void atapi_callback_t(struct wcd *, struct buf *, int, struct atapires);
struct atapicmd { /* ATAPI command block */
struct atapicmd *next; /* next command in queue */
diff --git a/sys/i386/isa/atkbd_isa.c b/sys/i386/isa/atkbd_isa.c
deleted file mode 100644
index 9cd06297ef71..000000000000
--- a/sys/i386/isa/atkbd_isa.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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 AUTHORS ``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 AUTHORS 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.
- *
- * $Id: atkbd_isa.c,v 1.1 1999/01/09 02:44:40 yokota Exp $
- */
-
-#include "atkbd.h"
-#include "opt_kbd.h"
-
-#if NATKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/tty.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdreg.h>
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-static int atkbdprobe(struct isa_device *dev);
-static int atkbdattach(struct isa_device *dev);
-static ointhand2_t atkbd_isa_intr;
-
-struct isa_driver atkbddriver = {
- atkbdprobe,
- atkbdattach,
- ATKBD_DRIVER_NAME,
- 0,
-};
-
-static int
-atkbdprobe(struct isa_device *dev)
-{
- atkbd_softc_t *sc;
- int error;
-
- sc = atkbd_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- /* try to find a keyboard */
- error = atkbd_probe_unit(dev->id_unit, sc, dev->id_iobase,
- dev->id_irq, dev->id_flags);
- if (error)
- return 0;
-
- /* declare our interrupt handler */
- dev->id_ointr = atkbd_isa_intr;
-
- return -1;
-}
-
-static int
-atkbdattach(struct isa_device *dev)
-{
- atkbd_softc_t *sc;
-
- sc = atkbd_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- return ((atkbd_attach_unit(dev->id_unit, sc)) ? 0 : 1);
-}
-
-static void
-atkbd_isa_intr(int unit)
-{
- keyboard_t *kbd;
-
- kbd = atkbd_get_softc(unit)->kbd;
- (*kbdsw[kbd->kb_index]->intr)(kbd);
-}
-
-#endif /* NATKBD > 0 */
diff --git a/sys/i386/isa/atkbdc_isa.c b/sys/i386/isa/atkbdc_isa.c
deleted file mode 100644
index c547a405600b..000000000000
--- a/sys/i386/isa/atkbdc_isa.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
- * 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.
- *
- * 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.
- *
- * $Id: $
- */
-
-#include "atkbdc.h"
-#include "opt_kbd.h"
-
-#if NATKBDC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-
-#include <dev/kbd/atkbdcreg.h>
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-static int atkbdc_probe(struct isa_device *dev);
-static int atkbdc_attach(struct isa_device *dev);
-
-struct isa_driver atkbdcdriver = {
- atkbdc_probe,
- atkbdc_attach,
- ATKBDC_DRIVER_NAME,
- 0,
-};
-
-static int
-atkbdc_probe(struct isa_device *dev)
-{
- atkbdc_softc_t *sc;
- int error;
-
- sc = atkbdc_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- error = atkbdc_probe_unit(sc, dev->id_unit, dev->id_iobase);
- if (error)
- return 0;
- if (dev->id_iobase <= 0)
- dev->id_iobase = sc->port;
- return IO_KBDSIZE;
-}
-
-static int
-atkbdc_attach(struct isa_device *dev)
-{
- atkbdc_softc_t *sc;
-
- sc = atkbdc_get_softc(dev->id_unit);
- return ((sc == NULL) ? 0 : 1);
-}
-
-#endif /* NATKBDC > 0 */
diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c
new file mode 100644
index 000000000000..5a9357da471e
--- /dev/null
+++ b/sys/i386/isa/b004.c
@@ -0,0 +1,669 @@
+/*
+ * FreeBSD device driver for B004-compatible Transputer boards.
+ *
+ * based on Linux version Copyright (C) 1993 by Christoph Niemann
+ *
+ * Rewritten for FreeBSD by
+ * Luigi Rizzo (luigi@iet.unipi.it) and
+ * Lorenzo Vicisano (l.vicisano@iet.unipi.it)
+ * Dipartimento di Ingegneria dell'Informazione
+ * Universita` di Pisa
+ * via Diotisalvi 2, 56126 Pisa, ITALY
+ * 14 september 1994
+ *
+ * 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 Christoph Niemann,
+ * Luigi Rizzo and Lorenzo Vicisano - Dipartimento di Ingegneria
+ * dell'Informazione
+ * 4. The names of these contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 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.
+ *
+ * NOTE NOTE NOTE
+ * The assembler version is still under development.
+ */
+
+/* #define USE_ASM */
+
+#include "bqu.h"
+#if NBQU > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/uio.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+
+#include "opt_devfs.h"
+
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+
+#include <machine/clock.h>
+
+#include <i386/isa/b004.h>
+#include <i386/isa/isa_device.h>
+
+#define IOCTL_OUT(arg, ret) *(int*)arg = ret
+
+#define B004PRI (PZERO+8)
+
+#define B004_CHANCE 8
+
+/*
+ * Define these symbols if you want to debug the code.
+ */
+#undef B004_DEBUG
+#undef B004_DEBUG_2
+
+#ifdef B004_DEBUG
+static u_char d_inb(u_int port);
+static void d_outb(u_int port, u_char data);
+
+#define out(port,data) d_outb(port, data)
+#define in(a) d_inb(((u_int)a))
+#else
+#define out(port, data) outb(port,data)
+#define in(port) inb(((u_int)port))
+#endif B004_DEBUG
+
+#ifdef B004_DEBUG
+#define DEB(x) x
+#define NO_DEB(x) /* */
+#else
+#define DEB(x) /* */
+#define NO_DEB(x) x
+#endif
+
+#ifdef B004_DEBUG_2
+#define DEB2(x) x
+#else
+#define DEB2(x)
+#endif
+
+static int bquprobe(struct isa_device *idp);
+static int bquattach(struct isa_device *idp);
+
+
+struct isa_driver bqudriver = {
+ bquprobe, bquattach, "bqu"
+};
+
+static d_open_t bquopen;
+static d_close_t bquclose;
+static d_read_t bquread;
+static d_write_t bquwrite;
+static d_ioctl_t bquioctl;
+static d_poll_t bqupoll;
+
+#define CDEV_MAJOR 8
+static struct cdevsw bqu_cdevsw =
+ { bquopen, bquclose, bquread, bquwrite, /*8*/
+ bquioctl, nostop, nullreset, nodevtotty,/* tputer */
+ bqupoll, nommap, NULL, "bqu", NULL, -1 };
+
+static int b004_sleep; /* wait address */
+
+static struct b004_struct b004_table[NBQU];
+
+static int first_time=1;
+
+/*
+ * At these addresses the driver will search for B004-compatible boards
+ */
+static int
+b004_base_addresses[B004_CHANCE] = {
+ /* 0x150, 0x170, 0x190, 0x200, 0x300, 0x320, 0x340, 0x360 */
+ 0x150, 0x190, 0, 0, 0, 0, 0, 0
+};
+
+#ifdef B004_DEBUG
+static void
+d_outb(u_int port, u_char data)
+{
+
+ printf("OUT 0x%x TO 0x%x\n",data,port);
+ outb(port,data);
+}
+
+static u_char
+d_inb(u_int port)
+{
+u_char ap;
+ ap=inb(port);
+ printf("INPUT 0x%x FROM 0x%x\n",ap,port);
+ return(ap);
+}
+#endif
+
+static int
+detected(int base)
+{
+ int i;
+ for(i=0;i<NBQU;i++)
+ if ((B004_F(i) & B004_EXIST) && (B004_BASE(i)==base)) return 1;
+ return (0);
+}
+
+#define b004_delay(a) DELAY(10000)
+
+/*
+ * static void bqureset(): reset transputer network.
+ *
+ */
+
+static void
+bqureset( const int dev_min )
+{
+ DEB(printf("B004 resetting transputer at link %d.\n", dev_min);)
+ out(B004_BASE(dev_min)+B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_ASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ DEB(printf("B004 reset done.\n");)
+}
+
+/*
+ * static void bquanalyse(): switch transputer network to analyse mode.
+ *
+ */
+
+static void
+bquanalyse( const int dev_min )
+{
+ DEB(printf("B004 analysing transputer at link %d.\n", dev_min);)
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_ASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_ASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ DEB(printf("B004 switching to analyse-mode done.\n");)
+}
+
+
+/****************************************************************************
+ *
+ * int bquread() - read bytes from the link interface.
+ *
+ * At first, the driver checks if the link-interface is ready to send a byte
+ * to the PC. If not, this check is repeated up to B004_MAXTRY times.
+ * If the link-interface is not ready after this loop, the driver sleeps for
+ * an NO=1 ticks and then checks the link-interface again.
+ * If the interface is still not ready, repeats as above incrementing NO.
+ * Once almost one byte is read N0 is set to 1.
+ * If B004_TIMEOUT != 0 and the link-interface is not ready for more than
+ * B004_TIMEOUT ticks read aborts returnig with the number of bytes read
+ * or with an error if no byte was read.
+ *
+ * By default, B004_TIMEOUT is = 0 (read is blocking)
+ *
+ *****************************************************************************/
+
+static int
+bquread(dev_t dev, struct uio *uio, int flag)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ int timeout=B004_TIMEOUT(dev_min);
+ int Timeout=timeout;
+ int idr=B004_IDR(dev_min);
+ int isr=B004_ISR(dev_min);
+ char buffer[B004_MAX_BYTES];
+
+ if ( uio->uio_resid < 0) {
+ DEB(printf("B004: invalid count for reading = %d.\n", uio->uio_resid);)
+ return EINVAL;
+ }
+
+ while ( uio->uio_resid ) {
+ int sleep_ticks=0;
+ char *p, *last, *lim;
+ int i, end = min(B004_MAX_BYTES,uio->uio_resid);
+ lim= &buffer[end];
+ for (p= buffer; p<lim;) {
+ last=p;
+ /*** try to read as much as possible ***/
+#ifdef USE_ASM
+ /* assembly code uses a very tight loop, with
+ * BX= data port, DX= address port, CX=count, ES:DI=p, AL=data, AH=1
+ * SI=retry counter
+ */
+ __asm__ (
+ "movl %1, %%edx\n\t" /* isr */
+ "movl %2, %%ebx\n\t" /* idr */
+ "movl %3, %%edi\n" /* p */
+ "movl %4, %%ecx\n\t" /* lim */
+ "subl %%edi, %%ecx\n\t"
+
+ "push %%es\n\t"
+ "movw %%ss, %%ax\n\t" /** prepare ES, DF for transfer */
+ "movw %%ax, %%es\n\t"
+ "cld\n\t"
+ "movb $1, %%ah\n\t"
+
+ "1:\tinb %%dx, %%al\n\t"
+ "testb %%ah, %%al\n\t"
+ "jz 2f\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "insb\n\t"
+ "xchgl %%edx, %%ebx\n"
+ "2:\tloop 1b\n\t"
+
+ "pop %%es\n\t"
+ "movl %%edi, %0\n\t" /* store p */
+ : /* out */ "=g" (p)
+ : /* in */ "g" (isr), "g" (idr), "g" (p), "g" (lim)
+ : /* regs */ "eax", "ebx", "edx", "ecx", "edi");
+#else
+ for (i=lim - p; i-- ;)
+ if (inb(isr)&B004_READBYTE) *p++ =(char) inb(idr);
+#endif
+ if (last!=p) {
+ sleep_ticks = 0;
+ } else {
+ /*** no new data read, must sleep ***/
+ sleep_ticks= (sleep_ticks<20 ? sleep_ticks+1 : sleep_ticks);
+ if (Timeout) {
+ if (timeout <=0) {
+ DEB2(printf("Read : TIMEOUT OCCURRED XXXXXXXXXXX\n");)
+ break;
+ }
+ if (timeout < sleep_ticks) sleep_ticks=timeout;
+ timeout -= sleep_ticks;
+ }
+ DEB2(printf("Read: SLEEPING FOR %d TICKS XXXXX\n",sleep_ticks);)
+ if (tsleep((caddr_t)&b004_sleep, B004PRI | PCATCH,
+ "b004_rd", sleep_ticks)!=EWOULDBLOCK) return 1;
+ }
+ }
+ if (p != buffer) {
+ uiomove((caddr_t)buffer, p - buffer, uio);
+ }
+ if( (Timeout) && (timeout <= 0) )
+ break;
+ }
+ return 0;
+} /* bquread() */
+
+
+/*
+ * int bquwrite() - write to the link interface.
+ */
+
+static int
+bquwrite(dev_t dev, struct uio *uio, int flag)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ int i, end;
+ int timeout=B004_TIMEOUT(dev_min);
+ int Timeout=timeout;
+ int odr=B004_ODR(dev_min);
+ int osr=B004_OSR(dev_min);
+ char buffer[B004_MAX_BYTES];
+
+ if ( uio->uio_resid < 0) {
+ DEB(printf("B004 invalid argument for writing: count = %d.\n", uio->uio_resid);)
+ return EINVAL;
+ }
+
+ while ( uio->uio_resid ) {
+ int sleep_ticks=0;
+ char *p, *last, *lim;
+ end = min(B004_MAX_BYTES,uio->uio_resid);
+ uiomove((caddr_t)buffer, end, uio);
+
+ lim= &buffer[end];
+ for (p= &buffer[0]; p<lim;) {
+ last=p;
+#ifdef USE_ASM
+ /* assembly code uses a very tight loop, with
+ * BX= data port, DX= address port, CX=count, DS:SI=p, AL=data, AH=1
+ * DI= retry counter
+ * Unfortunately, C is almost as fast as this!
+ */
+ __asm__ (
+ "movl %1, %%edx\n\t" /* osr */
+ "movl %2, %%ebx\n\t" /* odr */
+ "movl %3, %%esi\n" /* p */
+ "movl %4, %%ecx\n\t" /* lim */
+ "subl %%esi, %%ecx\n\t"
+
+ "push %%ds\n\t"
+ "movw %%ss, %%ax\n\t" /** prepare DS, DF for transfer */
+ "movw %%ax, %%ds\n\t"
+ "cld\n\t"
+ "movb $1, %%ah\n\t"
+ "movw $100, %%di\n\t"
+
+ "1:\tinb %%dx, %%al\n\t"
+ "testb %%ah, %%al\n\t"
+ "jz 2f\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "outsb\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "loop 1b\n\t"
+ "jmp 3f\n"
+
+ "2:\tdec %%di\n\t"
+ "jnc 1b\n\t"
+
+ "3:\tpop %%ds\n"
+ "movl %%esi, %0\n\t" /* store p */
+ : /* out */ "=g" (p)
+ : /* in */ "g" (osr), "g" (odr), "g" (p), "g" (lim)
+ : /* regs */ "eax", "ebx", "edx", "ecx", "esi", "edi");
+#else
+ for (i=lim - p; i-- ; ) {
+ if (inb(osr)&B004_WRITEBYTE) outb(odr, *p++);
+ }
+#endif
+ if (p != last ) {
+ sleep_ticks=0;
+ } else {
+ sleep_ticks= (sleep_ticks<20 ? sleep_ticks+1 : sleep_ticks);
+ if (Timeout) {
+ if (timeout <=0) {
+ DEB2(printf("Write : TIMEOUT OCCURRED XXXXXXXXXXX\n");)
+ uio->uio_resid += (lim - p);
+ break;
+ }
+ if (timeout < sleep_ticks) sleep_ticks=timeout;
+ timeout -= sleep_ticks;
+ }
+ DEB2(printf("Write: SLEEPING FOR %d TICKS XXXXXXX\n",sleep_ticks);)
+ if (tsleep((caddr_t)&b004_sleep, B004PRI | PCATCH,
+ "b004_rd", sleep_ticks)!=EWOULDBLOCK) return 1;
+ }
+ }
+ if( (Timeout) && (timeout <= 0) )
+ break;
+ }
+ return 0;
+} /* bquwrite() */
+
+/*
+ * int bquopen() -- open the link-device.
+ *
+ */
+
+static int
+bquopen(dev_t dev, int flags, int fmt, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 not opened, minor number >= %d.\n", NBQU);)
+ return ENXIO;
+ }
+ if ((B004_F(dev_min) & B004_EXIST) == 0) {
+ DEB(printf("B004 not opened, board %d does not exist.\n", dev_min);)
+ return ENXIO;
+ }
+ if (B004_F(dev_min) & B004_BUSY) {
+ DEB(printf("B004 not opened, board busy (minor = %d).\n", dev_min);)
+ return EBUSY;
+ }
+ B004_F(dev_min) |= B004_BUSY;
+ B004_TIMEOUT(dev_min) = 0;
+ DEB(printf( "B004 opened, minor = %d.\n", dev_min );)
+ return 0;
+} /* bquopen() */
+
+
+/*
+ * int b004close() -- close the link device.
+ */
+
+static int
+bquclose(dev_t dev, int flags, int fmt, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 not released, minor number >= %d.\n", NBQU);)
+ return ENXIO;
+ }
+ B004_F(dev_min) &= ~B004_BUSY;
+ DEB(printf("B004(%d) released.\n", dev_min );)
+ return 0;
+}
+
+static int
+bqupoll(dev_t dev, int events, struct proc *p)
+{
+ /* still unimplemented */
+ return(seltrue(dev, events, p));
+}
+
+/*
+ * int bquioctl()
+ *
+ * Supported functions:
+ * - reset
+ * - analyse
+ * - test error flag
+ * - set timeout
+ */
+
+static int
+bquioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+ int result = 0;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 ioctl exit, minor >= %d.\n", NBQU );)
+ return ENODEV;
+ }
+
+ if ((B004_F(dev_min) & B004_EXIST) == 0) {
+ DEB(printf("B004 ioctl exit, (B004_F & B004_EXIST) == 0.\n" );)
+ return ENODEV;
+ }
+
+ switch ( cmd ) {
+ case B004RESET: /* reset transputer */
+ bqureset(dev_min);
+ DEB(printf("B004 ioctl B004RESET, done\n" );)
+ break;
+ case B004WRITEABLE: /* can we write a byte to the C012 ? */
+ IOCTL_OUT (addr, ((in(B004_OSR(dev_min))&B004_WRITEBYTE) != 0 ));
+ break;
+ case B004READABLE: /* can we read a byte from C012 ? */
+ IOCTL_OUT (addr, ((in(B004_ISR(dev_min)) & B004_READBYTE) != 0 ));
+ break;
+ case B004ANALYSE: /* switch transputer to analyse mode */
+ bquanalyse(dev_min);
+ break;
+ case B004ERROR: /* test error-flag */
+ IOCTL_OUT (addr,
+ ((inb(B004_BASE(dev_min)+B004_ERROR_OFFSET) &
+ B004_TEST_ERROR) ? 0 : 1));
+ break;
+ case B004TIMEOUT: /* set, retrieve timeout for writing & reading*/
+ B004_TIMEOUT(dev_min) = *((int *)addr);
+ break;
+ default: result = EINVAL;
+ }
+ return result;
+} /* bquioctl() */
+
+
+static int
+bquattach(struct isa_device *idp)
+{
+ int unit = idp->id_unit;
+ struct b004_struct *bp;
+ int i;
+
+#ifdef DEVFS
+#define BQU_UID 66
+#define BQU_GID 66
+#define BQU_PERM 0600
+ bp = &b004_table[unit];
+ for ( i = 0; i < 8; i++) {
+#ifdef NOTYET
+ /* if (we've done all the ports found) break; */
+#endif
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttyba%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+64, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybb%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+128, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybc%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+192, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybd%d", unit);
+ }
+#endif
+ return 1;
+}
+
+/*
+ * int bquprobe
+ *
+ * Initializes the driver. It tries to detect the hardware
+ * and sets up all relevant data-structures.
+ */
+
+static int
+bquprobe(struct isa_device *idp)
+{
+ unsigned int test;
+ unsigned int dev_min = idp->id_unit;
+ int i,found = 0;
+ /* After a reset it should be possible to write a byte to
+ the B004. So let'S do a reset and then test the output status
+ register
+ */
+#ifdef undef
+ printf(
+ "bquprobe::\nIOBASE 0x%x\nIRQ %d\nDRQ %d\nMSIZE %d\nUNIT %d\nFLAGS"
+ "x0%x\nALIVE %d\n",idp->id_iobase,idp->id_irq,
+ idp->id_drq,idp->id_msize,idp->id_unit,idp->id_flags,idp->id_alive);
+#endif
+ if(first_time){
+ for(i=0;i<NBQU;i++) B004_F(i) &= ~B004_EXIST;
+ first_time=0;
+ }
+
+ if(dev_min >= NBQU) return (0); /* No more descriptors */
+ if ((idp->id_iobase < 0x100) || (idp->id_iobase >= 0x1000))
+ idp->id_iobase=0; /* Dangerous isa addres ) */
+
+ for (test = 0; (test < B004_CHANCE); test++) {
+ if((idp->id_iobase==0)&&((!b004_base_addresses[test])||
+ detected(b004_base_addresses[test])))
+ continue;
+ idp->id_iobase=b004_base_addresses[test];
+
+ DEB(printf("Probing device %d at address 0x%x\n",dev_min,
+ idp->id_iobase);
+ )
+ b004_delay(test);
+ B004_F(dev_min) = 0;
+ B004_TIMEOUT(dev_min) = B004_INIT_TIMEOUT;
+ B004_BASE(dev_min) = idp->id_iobase;
+ B004_ODR(dev_min) = B004_BASE(dev_min) + B004_ODR_OFFSET;
+ B004_ISR(dev_min) = B004_BASE(dev_min) + B004_ISR_OFFSET;
+ B004_OSR(dev_min) = B004_BASE(dev_min) + B004_OSR_OFFSET;
+ bqureset(dev_min);
+
+ for (i = 0; i < B004_MAXTRY; i++)
+ if ( in(B004_OSR(dev_min)) == B004_WRITEBYTE) {
+ B004_F(dev_min) |= B004_EXIST;
+ out(B004_BASE(dev_min) + B008_INT_OFFSET, 0);
+ b004_delay(test);
+ if (in(B004_BASE(dev_min) + B008_INT_OFFSET) & 0x0f == 0)
+ B004_BOARDTYPE(dev_min) = B008;
+ else
+ B004_BOARDTYPE(dev_min) = B004;
+ printf("bqu%d at 0x0%x (polling) is a B00%s\n",
+ dev_min,B004_IDR(dev_min),
+ (B004_BOARDTYPE(dev_min) == B004) ? "4" : "8");
+ found = 1;
+ break;
+ }
+ if(!found) {
+ idp->id_iobase=0;
+ }
+ else break;
+
+ }
+
+ if (!found){
+ DEB(printf("b004probe(): no B004-board found.\n"));
+ return (0);
+ }
+
+ idp->id_maddr=NULL;
+ idp->id_irq=0;
+ if(B004_BOARDTYPE(dev_min) == B004)
+ return(18);
+ else
+ return(20);
+} /* bquprobe() */
+
+
+static bqu_devsw_installed = 0;
+
+static void
+bqu_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! bqu_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&bqu_cdevsw, NULL);
+ bqu_devsw_installed = 1;
+ }
+}
+
+SYSINIT(bqudev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bqu_drvinit,NULL)
+
+
+#endif /* NBQU */
diff --git a/sys/i386/isa/b004.h b/sys/i386/isa/b004.h
new file mode 100644
index 000000000000..8ae161f02527
--- /dev/null
+++ b/sys/i386/isa/b004.h
@@ -0,0 +1,154 @@
+/*
+ * b004.h
+ *
+ * Based on the Linux driver, by
+ * Christoph Niemann (niemann@swt.ruhr-uni-bochum.de)
+ *
+ * Ported to FreeBSD by Luigi Rizzo (luigi@iet.unipi.it)
+ * and Lorenzo Vicisano (l.vicisano@iet.unipi.it)
+ *
+ * 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 Christoph Niemann,
+ * Luigi Rizzo and Lorenzo Vicisano - Dipartimento di Ingegneria
+ * dell'Informazione
+ * 4. The names of these contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 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.
+ *
+ * Works for FreeBSD 1.1.5
+ */
+
+#ifndef _I386_ISA_B004_H_
+#define _I386_ISA_B004_H_
+
+#include <sys/ioccom.h>
+
+/*
+ * device status FLAGS
+ */
+#define B004_EXIST 0x0001 /* Is a B004-Board with at least one
+ Transputer present ? */
+#define B004_BUSY 0x0002 /* Is the B004-board in use ? */
+
+/*
+ * IOCTL numbers
+ */
+#define B004RESET _IO ('Q', 0)
+ /* Reset transputer(s) */
+#define B004WRITEABLE _IOR ('Q', 1, int)
+ /* Return C012 Output Ready */
+#define B004READABLE _IOR ('Q', 2, int)
+ /* Return C012 Data Present */
+#define B004ANALYSE _IO ('Q', 3)
+ /* Switch transputer(s) to ANALYSE mode */
+#define B004ERROR _IOR ('Q', 4, int)
+ /* Return 1 on ERROR set */
+#define B004TIMEOUT _IOW ('Q', 5, int)
+ /* Set TIMEOUT for subsequent writing or
+ reading call, value in ticks, initial
+ 0 = no timeout (read/write blocking)
+ "open" sets timeout to 0 */
+
+
+#define B004_INIT_TIMEOUT 0 /* No timeout yet */
+
+/*
+ * Registers DISPLACEMENT
+ */
+#define B004_IDR_OFFSET 0 /* Input Data Register */
+#define B004_ODR_OFFSET 1 /* Output Data Register */
+#define B004_ISR_OFFSET 2 /* Input Status Register */
+#define B004_OSR_OFFSET 3 /* Output Status Register */
+#define B004_RESET_OFFSET 16 /* Reset/Error Register */
+#define B004_ERROR_OFFSET B004_RESET_OFFSET
+#define B004_ANALYSE_OFFSET 17 /* Analyse Register */
+#define B008_DMA_OFFSET 18 /* B008: DMA request register */
+#define B008_INT_OFFSET 19 /* B008: Interrupt control reg */
+
+struct b004_struct {
+ int flags; /* various flags */
+ int idr; /* address of the input data register */
+ int odr; /* address if the output data register */
+ int isr; /* address of the input status register */
+ int osr; /* address of the output status register */
+ unsigned int timeout; /* timeout for writing/reading the link */
+ int boardtype; /* what kind of board is installed */
+ void *devfs_token[8][4]; /* tokens for 4 types for 8 ports */
+};
+
+/*
+ * Id's for the supported boards
+ */
+#define B004 1
+#define B008 2
+
+/*
+ * Defines for easier access to the b004_table.
+ */
+#define B004_F(minor) b004_table[minor].flags
+#define B004_TIMEOUT(minor) b004_table[minor].timeout
+#define B004_BASE(minor) B004_IDR(minor)
+#define B004_IDR(minor) b004_table[minor].idr
+#define B004_ODR(minor) b004_table[minor].odr
+#define B004_ISR(minor) b004_table[minor].isr
+#define B004_OSR(minor) b004_table[minor].osr
+#define B004_WAIT(minor) b004_table[minor].wait
+#define B004_BOARDTYPE(minor) b004_table[minor].boardtype
+
+/*
+ * Additional defines for B008-boards
+ */
+#define B008_DMA(minor) b004_table[minor].int
+#define B008_INT(minor) b004_table[minor].dma
+
+/*
+ * Number of tries to access isr or osr before reading or writing sleeps
+ */
+#define B004_MAXTRY 200
+
+/*
+ * Maximum number of bytes to transfer at once
+ */
+#define B004_MAX_BYTES 2048
+
+/*
+ * bit defines for C012 status ports at base + 2/3
+ * accessed with B004_IS, B004_OS, which gets the byte...
+ */
+#define B004_READBYTE 1
+#define B004_WRITEBYTE 1
+
+/*
+ * bit defines for C012 reset/error port at base + 16
+ */
+#define B004_ASSERT_RESET 0x01 /* resetting the transputer */
+#define B004_DEASSERT_RESET 0x00
+#define B004_TEST_ERROR 0x01 /* for testing the transputer's error flag */
+
+/*
+ * bit defines for C012 analyse port at base + 17
+ */
+#define B004_ASSERT_ANALYSE 0x01 /* switch transputer to analyse-mode */
+#define B004_DEASSERT_ANALYSE 0x00
+
+#endif /* !_I386_ISA_B004_H_ */
diff --git a/sys/i386/isa/bs/bs.c b/sys/i386/isa/bs/bs.c
index 1f9374640432..fc543851f09d 100644
--- a/sys/i386/isa/bs/bs.c
+++ b/sys/i386/isa/bs/bs.c
@@ -39,30 +39,21 @@
#include <i386/isa/bs/bsif.h>
#endif
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
/*****************************************************************
* Inline phase funcs
*****************************************************************/
/* static inline declare */
static BS_INLINE struct targ_info *bs_reselect __P((struct bs_softc *));
-static BS_INLINE void bs_sat_continue __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static BS_INLINE struct targ_info *bs_selected __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_sat_continue __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static BS_INLINE struct targ_info *bs_selected __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE u_int8_t bs_read_1byte __P((struct bs_softc *));
static BS_INLINE void bs_write_1byte __P((struct bs_softc *, u_int8_t));
-static BS_INLINE void bs_commandout __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_commandout __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE void bs_status_check __P((struct bs_softc *, struct targ_info *));
static BS_INLINE void bs_msgin __P((struct bs_softc *, struct targ_info *));
-static BS_INLINE void bs_msgout __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static BS_INLINE void bs_disconnect_phase __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static void bs_phase_error __P((struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_msgout __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static BS_INLINE void bs_disconnect_phase __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static void bs_phase_error __P((struct targ_info *, struct ccb *));
static int bs_scsi_cmd_poll_internal __P((struct targ_info *));
static int bs_xfer __P((struct bs_softc *, char *, int));
static void bs_io_xfer __P((struct targ_info *));
@@ -73,153 +64,99 @@ static void bs_msg_reject __P((struct targ_info *));
static void bshoststart __P((struct bs_softc *, struct targ_info *));
/*****************************************************************
- * SIM interface
+ * Julian scsi interface
*****************************************************************/
-void
-bs_scsi_cmd(struct cam_sim *sim, union ccb *ccb)
+XSBS_INT32T
+bs_scsi_cmd(xs)
+ struct scsi_xfer *xs;
{
- struct bs_softc *bsc = (struct bs_softc *) cam_sim_softc(sim);
- int s, target = (u_int) (ccb->ccb_h.target_id);
+ struct bs_softc *bsc = (struct bs_softc *) xs->sc_link->adapter_softc;
+ int s, target = (u_int) (xs->sc_link->target);
struct targ_info *ti;
- struct bsccb *cb;
-
- switch (ccb->ccb_h.func_code) {
- case XPT_SCSI_IO: /* Execute the requested I/O operation */
- ti = bsc->sc_ti[target];
- if ((cb = bs_get_ccb()) == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- xpt_done(ccb);
- return;
+ struct ccb *cb;
+ u_int flags = xs->flags;
+
+ if (xs->bp == NULL && (bsc->sc_openf & (1 << target)) == 0)
+ {
+ s = splbio();
+ xs->error = XS_DRIVER_STUFFUP;
+ xs->flags |= XSBS_ITSDONE;
+ scsi_done(xs);
+ splx(s);
+ return COMPLETE;
+ }
+
+ ti = bsc->sc_ti[target];
+ if ((cb = bs_get_ccb(flags & XSBS_SCSI_NOSLEEP)) == NULL)
+ return TRY_AGAIN_LATER;
+
+ /* make up ccb! */
+ cb->xs = xs;
+ cb->lun = xs->sc_link->lun;
+ cb->cmd = (u_int8_t *) xs->cmd;
+ cb->cmdlen = (int) xs->cmdlen;
+ cb->data = (u_int8_t *) xs->data;
+ cb->datalen = (int) xs->datalen;
+ cb->rcnt = 0;
+ cb->msgoutlen = 0;
+ cb->flags = (flags & XSBS_SCSI_POLL) ? BSFORCEIOPOLL : 0;
+ bs_targ_flags(ti, cb);
+ cb->tcmax = (xs->timeout >> 10);
+ if (cb->tcmax < BS_DEFAULT_TIMEOUT_SECOND)
+ cb->tcmax = BS_DEFAULT_TIMEOUT_SECOND;
+
+#ifdef BS_ADDRESS_CHECK
+ /* XXX:
+ * Sanity check, however this is critical!
+ * NetBSD 1.0: WRONG
+ * NetBSD 1.1: OK
+ * FreeBSD: WRONG
+ */
+ if ((caddr_t) cb->data < (caddr_t) KERNBASE)
+ {
+ u_int8_t *altbp;
+
+ altbp = (u_int8_t *) malloc(cb->datalen, M_DEVBUF, M_NOWAIT);
+ if (altbp == NULL)
+ {
+ bs_free_ccb(cb);
+ return TRY_AGAIN_LATER;
}
- /* make up ccb! */
- cb->ccb = ccb;
- cb->lun = ccb->ccb_h.target_lun;
- cb->cmd = ccb->csio.cdb_io.cdb_bytes;
- cb->cmdlen = (int) ccb->csio.cdb_len;
- cb->data = ccb->csio.data_ptr;
- cb->datalen = (int) ccb->csio.dxfer_len;
- cb->rcnt = 0;
- cb->msgoutlen = 0;
- cb->bsccb_flags = 0;
- bs_targ_flags(ti, cb);
- cb->tcmax = 0;/*(xs->timeout >> 10); default HN2*/
- if (cb->tcmax < BS_DEFAULT_TIMEOUT_SECOND)
- cb->tcmax = BS_DEFAULT_TIMEOUT_SECOND;
+ if (flags & SCSI_DATA_OUT)
+ bcopy(cb->data, altbp, cb->datalen);
+ else
+ bzero(altbp, cb->datalen);
- s = splbio();
+ cb->data = (u_int8_t *) altbp;
+ cb->flags |= BSALTBUF;
+ }
+#endif /* BS_ADDRESS_CHECK */
+
+ s = splbio();
- TAILQ_INSERT_TAIL(&ti->ti_ctab, cb, ccb_chain);
+ TAILQ_INSERT_TAIL(&ti->ti_ctab, cb, ccb_chain);
- if (ti->ti_phase == FREE) {
- if (ti->ti_state == BS_TARG_START)
+ if (ti->ti_phase == FREE)
+ {
+ if (ti->ti_state == BS_TARG_START)
+ {
+ if ((flags & XSBS_SCSI_POLL) == 0)
bs_start_syncmsg(ti, NULL, BS_SYNCMSG_ASSERT);
- bscmdstart(ti, BSCMDSTART);
}
+ bscmdstart(ti, BSCMDSTART);
+ }
+ if ((flags & XSBS_SCSI_POLL) == 0)
+ {
splx(s);
- break;
- case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
- case XPT_EN_LUN: /* Enable LUN as a target */
- case XPT_TARGET_IO: /* Execute target I/O request */
- case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */
- case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/
- case XPT_ABORT: /* Abort the specified CCB */
- /* XXX Implement */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
- case XPT_SET_TRAN_SETTINGS:
- /* XXX Implement */
- ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
- xpt_done(ccb);
- break;
- case XPT_GET_TRAN_SETTINGS: {
- struct ccb_trans_settings *cts;
- struct targ_info *ti;
- /*int s;*/
-
- cts = &ccb->cts;
- ti = bsc->sc_ti[ccb->ccb_h.target_id];
- /*s = splcam();*/
- if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
- if (ti->ti_cfgflags & BS_SCSI_DISC)
- cts->flags = CCB_TRANS_DISC_ENB;
- else
- cts->flags = 0;
- if (ti->ti_cfgflags & BS_SCSI_QTAG)
- cts->flags |= CCB_TRANS_TAG_ENB;
- cts->sync_period = ti->ti_syncnow.period;
- cts->sync_offset = ti->ti_syncnow.offset;
- cts->bus_width = 0;/*HN2*/
-
- cts->valid = CCB_TRANS_SYNC_RATE_VALID
- | CCB_TRANS_SYNC_OFFSET_VALID
- | CCB_TRANS_BUS_WIDTH_VALID
- | CCB_TRANS_DISC_VALID
- | CCB_TRANS_TQ_VALID;
- ccb->ccb_h.status = CAM_REQ_CMP;
- } else
- ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-
- /*splx(s);*/
- xpt_done(ccb);
- break;
- }
- case XPT_CALC_GEOMETRY: { /* not yet HN2 */
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
-
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
-
- ccg->heads = 8;
- ccg->secs_per_track = 34;
-
- secs_per_cylinder = ccg->heads * ccg->secs_per_track;
- ccg->cylinders = ccg->volume_size / secs_per_cylinder;
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- }
- case XPT_RESET_BUS: /* Reset the specified SCSI bus */
- bshw_chip_reset(bsc); /* XXX need perfect RESET? */
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- case XPT_TERM_IO: /* Terminate the I/O process */
- /* XXX Implement */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
- case XPT_PATH_INQ: { /* Path routing inquiry */
- struct ccb_pathinq *cpi = &ccb->cpi;
-
- cpi->version_num = 1; /* XXX??? */
- cpi->hba_inquiry = PI_SDTR_ABLE;
- cpi->target_sprt = 0;
- cpi->hba_misc = 0;
- cpi->hba_eng_cnt = 0;
- cpi->max_target = NTARGETS - 1;
- cpi->max_lun = 7;
- cpi->initiator_id = bsc->sc_hostid;
- cpi->bus_id = cam_sim_bus(sim);
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "NEC", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
- cpi->unit_number = cam_sim_unit(sim);
- cpi->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- }
- default:
-/*printf("bs: non support func_code = %d ", ccb->ccb_h.func_code);*/
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
+ return SUCCESSFULLY_QUEUED;
}
+
+ bs_scsi_cmd_poll(ti, cb);
+ splx(s);
+
+ return COMPLETE;
}
/**************************************************
@@ -233,7 +170,7 @@ bscmdstart(ti, flags)
struct targ_info *ti;
int flags;
{
- struct bsccb *cb;
+ struct ccb *cb;
struct bs_softc *bsc = ti->ti_bsc;
if ((cb = ti->ti_ctab.tqh_first) == NULL)
@@ -249,9 +186,9 @@ bscmdstart(ti, flags)
ti->ti_scsp.datalen = cb->datalen;
ti->ti_scsp.seglen = 0;
if (cb->rcnt)
- cb->bsccb_flags &= ~(BSSAT | BSLINK);
+ cb->flags &= ~(BSSAT | BSLINK);
ti->ti_flags &= ~BSCFLAGSMASK;
- ti->ti_flags |= cb->bsccb_flags & BSCFLAGSMASK;
+ ti->ti_flags |= cb->flags & BSCFLAGSMASK;
cb->tc = cb->tcmax;
/* GO GO */
@@ -274,13 +211,13 @@ bscmdstart(ti, flags)
return 1;
}
-struct bsccb *
+struct ccb *
bscmddone(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
- union ccb *ccb;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
+ struct scsi_xfer *xs;
int error;
if (ti->ti_state == BS_TARG_SYNCH)
@@ -296,12 +233,12 @@ bscmddone(ti)
do
{
- ccb = cb->ccb;
- error = CAM_REQ_CMP;
+ xs = cb->xs;
+ error = XS_NOERROR;
- if (cb->bsccb_flags & (BSITSDONE | BSSENSECCB | BSCASTAT))
+ if (cb->flags & (BSITSDONE | BSSENSECCB | BSCASTAT))
{
- if (cb->bsccb_flags & BSSENSECCB)
+ if (cb->flags & BSSENSECCB)
{
cb->error &= ~BSDMAABNORMAL;
if (cb->error == 0)
@@ -309,17 +246,18 @@ bscmddone(ti)
ti->ti_flags |= BSERROROK;
}
- else if (cb->bsccb_flags & BSCASTAT)
+ else if (cb->flags & BSCASTAT)
{
if (ti->ti_flags & BSCASTAT)
{
ti->ti_flags &= ~BSCASTAT;
- error = CAM_AUTOSNS_VALID|CAM_SCSI_STATUS_ERROR;
- if (ccb)
- ccb->csio.sense_data = ti->sense;/* XXX may not be csio.... */
+ error = XS_SENSE;
+ if (xs)
+ xs->sense = ti->sense;
}
else
- error = CAM_AUTOSENSE_FAIL;
+ error = XS_DRIVER_STUFFUP;
+
ti->ti_flags |= BSERROROK;
} else
bs_panic(bsc, "internal error");
@@ -333,11 +271,11 @@ bscmddone(ti)
if (cb->rcnt >= bsc->sc_retry || (cb->error & BSFATALIO))
{
if (cb->error & (BSSELTIMEOUT | BSTIMEOUT))
- error = CAM_CMD_TIMEOUT;
+ error = XS_TIMEOUT;
else if (cb->error & BSTARGETBUSY)
- error = CAM_SCSI_STATUS_ERROR;
+ error = XS_BUSY;
else
- error = CAM_REQ_CMP_ERR;
+ error = XS_DRIVER_STUFFUP;
break;
}
@@ -345,7 +283,7 @@ bscmddone(ti)
{
/* must clear the target's sense state */
cb->rcnt++;
- cb->bsccb_flags |= (BSITSDONE | BSCASTAT);
+ cb->flags |= (BSITSDONE | BSCASTAT);
cb->error &= ~BSREQSENSE;
return bs_request_sense(ti);
}
@@ -357,15 +295,16 @@ bscmddone(ti)
cb->error &= ~BSDMAABNORMAL;
continue;
}
- if (/*(xs && xs->bp) || can't know whether bufferd i/o or not */
- (cb->error & BSSELTIMEOUT) == 0)
+
+ if ((xs && xs->bp) || (cb->error & BSSELTIMEOUT) == 0)
bs_debug_print(bsc, ti);
+
cb->rcnt++;
return cb;
}
#ifdef BS_DIAG
- cb->bsccb_flags |= BSITSDONE;
+ cb->flags |= BSITSDONE;
#endif /* BS_DIAG */
if (bsc->sc_poll)
{
@@ -376,18 +315,28 @@ bscmddone(ti)
TAILQ_REMOVE(&ti->ti_ctab, cb, ccb_chain);
- if (ccb)
+ if (xs)
{
- ccb->ccb_h.status = error;
- ccb->csio.scsi_status = ti->ti_status;/*XXX*/
- xpt_done(ccb);
+#ifdef BS_ADDRESS_CHECK
+ if (cb->flags & BSALTBUF)
+ {
+ if (xs->flags & SCSI_DATA_IN)
+ bcopy(cb->data, xs->data, cb->datalen);
+ free(cb->data, M_DEVBUF);
+ }
+#endif /* BS_ADDRESS_CHECK */
+
+ if ((xs->error = error) == XS_NOERROR)
+ xs->resid = 0;
+ xs->flags |= XSBS_ITSDONE;
+ scsi_done(xs);
}
bs_free_ccb(cb);
cb = ti->ti_ctab.tqh_first;
}
- while (cb != NULL && (cb->bsccb_flags & BSITSDONE) != 0);
+ while (cb != NULL && (cb->flags & BSITSDONE) != 0);
/* complete */
return NULL;
@@ -404,7 +353,7 @@ bshoststart(bsc, ti)
struct bs_softc *bsc;
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
int s;
if (bsc->sc_flags & BSINACTIVE)
@@ -427,7 +376,7 @@ again:
}
#ifdef BS_DIAG
- if (cb->bsccb_flags & BSITSDONE)
+ if (cb->flags & BSITSDONE)
bs_panic(bsc, "bshoststart: already done");
if (bsc->sc_nexus || (ti->ti_flags & BSNEXUS))
@@ -546,7 +495,7 @@ static BS_INLINE struct targ_info *
bs_selected(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
if (bsc->sc_busstat != BSR_SELECTED)
@@ -638,7 +587,7 @@ static BS_INLINE void
bs_sat_continue(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
BS_SETUP_PHASE(SATRESEL);
@@ -771,7 +720,7 @@ static BS_INLINE void
bs_commandout(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int8_t scsi_cmd[16];
int len;
@@ -831,7 +780,7 @@ bs_quick_abort(ti, msg)
struct targ_info *ti;
u_int msg;
{
- struct bsccb *cb;
+ struct ccb *cb;
if ((cb = ti->ti_ctab.tqh_first) == NULL)
return;
@@ -867,7 +816,7 @@ bs_msgin_ext(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
int count;
u_int reqlen;
u_int32_t *ptr;
@@ -940,14 +889,14 @@ bs_msg_reject(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
char *s = "unexpected msg reject";
switch (ti->ti_ophase)
{
case CMDPHASE:
s = "cmd rejected";
- cb->bsccb_flags &= ~BSLINK;
+ cb->flags &= ~BSLINK;
BS_SETUP_MSGPHASE(IOCOMPLETED);
break;
@@ -955,7 +904,7 @@ bs_msg_reject(ti)
if (ti->ti_msgout & 0x80)
{
s = "identify msg rejected";
- cb->bsccb_flags &= ~BSDISC;
+ cb->flags &= ~BSDISC;
BS_SETUP_MSGPHASE(IOCOMPLETED);
}
else if (ti->ti_msgout == MSG_EXTEND)
@@ -1090,7 +1039,7 @@ static BS_INLINE void
bs_msgout(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int8_t msg[MAXMSGLEN + 1];
@@ -1165,7 +1114,7 @@ static BS_INLINE void
bs_disconnect_phase(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
switch (bsc->sc_msgphase)
@@ -1237,7 +1186,7 @@ struct bs_err bs_cmderr[] = {
static void
bs_phase_error(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
struct bs_softc *bsc = ti->ti_bsc;
struct bs_err *pep;
@@ -1293,13 +1242,13 @@ bs_phase_error(ti, cb)
/**************************************************
* ### SCSI PHASE SEQUENCER ###
**************************************************/
-static BS_INLINE void bs_ack_wait __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_ack_wait __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE void
bs_ack_wait(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
int wc = bsc->sc_wc;
@@ -1338,7 +1287,7 @@ bs_sequencer(bsc)
struct bs_softc *bsc;
{
register struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
/**************************************************
* Check reset
@@ -1423,7 +1372,7 @@ bs_sequencer(bsc)
default:
/* XXX:
- * check check check for safety !!
+ * check check check for safty !!
*/
if (bsc->sc_selwait)
{
@@ -1582,7 +1531,7 @@ bs_scsi_cmd_poll_internal(cti)
{
struct bs_softc *bsc = cti->ti_bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int i, waits, delay_count;
bsc->sc_poll++;
@@ -1601,7 +1550,7 @@ bs_scsi_cmd_poll_internal(cti)
{
ti->ti_flags |= BSFORCEIOPOLL;
if ((cb = ti->ti_ctab.tqh_first) != NULL)
- cb->bsccb_flags |= BSFORCEIOPOLL;
+ cb->flags |= BSFORCEIOPOLL;
}
}
@@ -1630,7 +1579,7 @@ bs_scsi_cmd_poll_internal(cti)
int
bs_scsi_cmd_poll(cti, targetcb)
struct targ_info *cti;
- struct bsccb *targetcb;
+ struct ccb *targetcb;
{
struct bs_softc *bsc = cti->ti_bsc;
struct targ_info *ti;
diff --git a/sys/i386/isa/bs/bs_isa.c b/sys/i386/isa/bs/bs_isa.c
index 644dc0e8a14f..7215de65cc48 100644
--- a/sys/i386/isa/bs/bs_isa.c
+++ b/sys/i386/isa/bs/bs_isa.c
@@ -59,8 +59,7 @@ bs_args_copy(bsc, ia, hw)
bsc->sm_offset = 0;
bsc->sc_cfgflags = DVCFG_MINOR(ia->ia_cfgflags);
- snprintf(bsc->sc_dvname, sizeof(bsc->sc_dvname),
- "%s", bsc->sc_dev.dv_xname);
+ strcpy(bsc->sc_dvname, bsc->sc_dev.dv_xname);
}
static int
diff --git a/sys/i386/isa/bs/bsfunc.c b/sys/i386/isa/bs/bsfunc.c
index c92b70676933..47dfe84788f8 100644
--- a/sys/i386/isa/bs/bsfunc.c
+++ b/sys/i386/isa/bs/bsfunc.c
@@ -51,7 +51,7 @@ int bs_debug_flag = 0;
static void bs_print_syncmsg __P((struct targ_info *, char*));
static void bs_timeout_target __P((struct targ_info *));
-static void bs_kill_msg __P((struct bsccb *cb));
+static void bs_kill_msg __P((struct ccb *cb));
static int bs_start_target __P((struct targ_info *));
static int bs_check_target __P((struct targ_info *));
@@ -59,8 +59,8 @@ static int bs_check_target __P((struct targ_info *));
/*************************************************************
* CCB
************************************************************/
-GENERIC_CCB_STATIC_ALLOC(bs, bsccb)
-GENERIC_CCB(bs, bsccb, ccb_chain)
+GENERIC_CCB_STATIC_ALLOC(bs, ccb)
+GENERIC_CCB(bs, ccb, ccb_chain)
/*************************************************************
* TIMEOUT
@@ -87,7 +87,7 @@ bstimeout(arg)
{
struct bs_softc *bsc = (struct bs_softc *) arg;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int s;
s = splbio();
@@ -126,7 +126,7 @@ bstimeout(arg)
*************************************************/
static u_int8_t cmd_unit_ready[6];
-struct bsccb *
+struct ccb *
bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
struct targ_info *ti;
u_int lun;
@@ -137,19 +137,19 @@ bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
u_int flags;
int timeout;
{
- struct bsccb *cb;
+ struct ccb *cb;
- if ((cb = bs_get_ccb()) == NULL)
+ if ((cb = bs_get_ccb(XSBS_SCSI_NOSLEEP)) == NULL)
bs_panic(ti->ti_bsc, "can not get ccb mem");
- cb->ccb = NULL;
+ cb->xs = NULL;
cb->lun = lun;
cb->cmd = (cmd ? cmd : cmd_unit_ready);
cb->cmdlen = (cmd ? cmdlen : sizeof(cmd_unit_ready));
cb->data = data;
cb->datalen = (data ? datalen : 0);
cb->msgoutlen = 0;
- cb->bsccb_flags = flags & BSCFLAGSMASK;
+ cb->flags = flags & BSCFLAGSMASK;
bs_targ_flags(ti, cb);
cb->rcnt = 0;
cb->tcmax = (timeout > BS_DEFAULT_TIMEOUT_SECOND ? timeout :
@@ -160,11 +160,11 @@ bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
return cb;
}
-struct bsccb *
+struct ccb *
bs_make_msg_ccb(ti, lun, cb, msg, timex)
struct targ_info *ti;
u_int lun;
- struct bsccb *cb;
+ struct ccb *cb;
struct msgbase *msg;
u_int timex;
{
@@ -175,7 +175,7 @@ bs_make_msg_ccb(ti, lun, cb, msg, timex)
cb = bs_make_internal_ccb(ti, lun, NULL, 0, NULL, 0,
flags, timex);
else
- cb->bsccb_flags |= flags & BSCFLAGSMASK;
+ cb->flags |= flags & BSCFLAGSMASK;
cb->msgoutlen = msg->msglen;
bcopy(msg->msg, cb->msgout, msg->msglen);
@@ -189,7 +189,7 @@ bs_send_msg(ti, lun, msg, timex)
struct msgbase *msg;
int timex;
{
- struct bsccb *cb;
+ struct ccb *cb;
cb = bs_make_msg_ccb(ti, lun, NULL, msg, timex);
bscmdstart(ti, BSCMDSTART);
@@ -198,7 +198,7 @@ bs_send_msg(ti, lun, msg, timex)
static void
bs_kill_msg(cb)
- struct bsccb *cb;
+ struct ccb *cb;
{
cb->msgoutlen = 0;
}
@@ -206,11 +206,11 @@ bs_kill_msg(cb)
/**************************************************
* MAKE SENSE CCB
**************************************************/
-struct bsccb *
+struct ccb *
bs_request_sense(ti)
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
bzero(ti->scsi_cmd, sizeof(struct scsi_sense));
bzero(&ti->sense, sizeof(struct scsi_sense_data));
@@ -223,7 +223,7 @@ bs_request_sense(ti)
sizeof(struct scsi_sense_data),
BSFORCEIOPOLL,
BS_DEFAULT_TIMEOUT_SECOND);
- cb->bsccb_flags |= BSSENSECCB;
+ cb->flags |= BSSENSECCB;
return cb;
}
@@ -234,7 +234,7 @@ bs_request_sense(ti)
int
bs_start_syncmsg(ti, cb, flag)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int flag;
{
struct syncdata *negp, *maxp;
@@ -308,7 +308,7 @@ bs_print_syncmsg(ti, s)
int
bs_analyze_syncmsg(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
struct bs_softc *bsc = ti->ti_bsc;
u_int8_t ans = ti->ti_syncnow.state;
@@ -411,13 +411,13 @@ bs_reset_device(ti)
}
/* send abort msg */
-struct bsccb *
+struct ccb *
bs_force_abort(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
struct msgbase msg;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
u_int lun;
if (cb)
@@ -523,7 +523,7 @@ bs_reset_nexus(bsc)
struct bs_softc *bsc;
{
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
bsc->sc_flags &= ~(BSRESET | BSUNDERRESET);
if (bsc->sc_poll)
@@ -575,7 +575,7 @@ bs_reset_nexus(bsc)
for ( ; cb; cb = cb->ccb_chain.tqe_next)
{
bs_kill_msg(cb);
- cb->bsccb_flags &= ~(BSITSDONE | BSCASTAT);
+ cb->flags &= ~(BSITSDONE | BSCASTAT);
cb->error = 0;
}
@@ -597,15 +597,19 @@ static int
bs_start_target(ti)
struct targ_info *ti;
{
- struct bsccb *cb;
- struct scsi_start_stop_unit cmd;
+ struct ccb *cb;
+ struct scsi_start_stop cmd;
- bzero(&cmd, sizeof(struct scsi_start_stop_unit));
+ bzero(&cmd, sizeof(struct scsi_start_stop));
+#ifdef __NetBSD__
cmd.opcode = START_STOP;
+#else
+ cmd.op_code = START_STOP;
+#endif
cmd.how = SSS_START;
ti->ti_lun = 0;
cb = bs_make_internal_ccb(ti, 0, (u_int8_t *) &cmd,
- sizeof(struct scsi_start_stop_unit),
+ sizeof(struct scsi_start_stop),
NULL, 0, BSFORCEIOPOLL, BS_MOTOR_TIMEOUT);
bscmdstart(ti, BSCMDSTART);
return bs_scsi_cmd_poll(ti, cb);
@@ -619,7 +623,7 @@ bs_check_target(ti)
struct bs_softc *bsc = ti->ti_bsc;
struct scsi_inquiry scsi_cmd;
struct scsi_inquiry_data scsi_inquiry_data;
- struct bsccb *cb;
+ struct ccb *cb;
int count, retry = bsc->sc_retry;
int s, error = COMPLETE;
@@ -629,7 +633,11 @@ bs_check_target(ti)
/* inquiry */
bzero(&scsi_cmd, sizeof(scsi_cmd));
+#ifdef __NetBSD__
scsi_cmd.opcode = INQUIRY;
+#else
+ scsi_cmd.op_code = INQUIRY;
+#endif
scsi_cmd.length = sizeof(struct scsi_inquiry_data);
cb = bs_make_internal_ccb(ti, 0,
(u_int8_t *) &scsi_cmd, sizeof(scsi_cmd),
@@ -654,7 +662,7 @@ bs_check_target(ti)
goto done;
}
- if (cb->bsccb_flags & BSCASTAT)
+ if (cb->flags & BSCASTAT)
bs_printf(ti, "check", "could not clear CA state");
ti->ti_error = 0;
@@ -889,7 +897,7 @@ bs_debug_print(bsc, ti)
struct bs_softc *bsc;
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
/* host stat */
printf("%s <DEBUG INFO> nexus %lx bs %lx bus status %lx \n",
@@ -913,7 +921,7 @@ bs_debug_print(bsc, ti)
sp->datalen, (u_long) sp->data, sp->seglen);
if (cb)
printf("odatalen %x flags %x\n",
- cb->datalen, cb->bsccb_flags);
+ cb->datalen, cb->flags);
else
printf("\n");
printf("error flags %b\n", ti->ti_error, BSERRORBITS);
diff --git a/sys/i386/isa/bs/bsfunc.h b/sys/i386/isa/bs/bsfunc.h
index 13c06868d04c..5658a27fd60a 100644
--- a/sys/i386/isa/bs/bsfunc.h
+++ b/sys/i386/isa/bs/bsfunc.h
@@ -44,22 +44,22 @@ struct targ_info *bs_init_target_info __P((struct bs_softc *, int));
/* msg op */
int bs_send_msg __P((struct targ_info *, u_int, struct msgbase *, int));
-struct bsccb *bs_request_sense __P((struct targ_info *));
+struct ccb *bs_request_sense __P((struct targ_info *));
/* sync msg op */
-int bs_start_syncmsg __P((struct targ_info *, struct bsccb *, int));
+int bs_start_syncmsg __P((struct targ_info *, struct ccb *, int));
int bs_send_syncmsg __P((struct targ_info *));
-int bs_analyze_syncmsg __P((struct targ_info *, struct bsccb *));
+int bs_analyze_syncmsg __P((struct targ_info *, struct ccb *));
/* reset device */
void bs_scsibus_start __P((struct bs_softc *));
void bs_reset_nexus __P((struct bs_softc *));
-struct bsccb *bs_force_abort __P((struct targ_info *));
+struct ccb *bs_force_abort __P((struct targ_info *));
void bs_reset_device __P((struct targ_info *));
/* ccb */
-struct bsccb *bs_make_internal_ccb __P((struct targ_info *, u_int, u_int8_t *, u_int, u_int8_t *, u_int, u_int, int));
-struct bsccb *bs_make_msg_ccb __P((struct targ_info *, u_int, struct bsccb *, struct msgbase *, u_int));
+struct ccb *bs_make_internal_ccb __P((struct targ_info *, u_int, u_int8_t *, u_int, u_int8_t *, u_int, u_int, int));
+struct ccb *bs_make_msg_ccb __P((struct targ_info *, u_int, struct ccb *, struct msgbase *, u_int));
/* misc funcs */
void bs_printf __P((struct targ_info *, char *, char *));
@@ -77,9 +77,9 @@ void bs_debug_print __P((struct bs_softc *, struct targ_info *));
static BS_INLINE int bs_check_sat __P((struct targ_info *));
static BS_INLINE int bs_check_smit __P((struct targ_info *));
static BS_INLINE int bs_check_disc __P((struct targ_info *));
-static BS_INLINE int bs_check_link __P((struct targ_info *, struct bsccb *));
+static BS_INLINE int bs_check_link __P((struct targ_info *, struct ccb *));
static BS_INLINE u_int8_t bs_identify_msg __P((struct targ_info *));
-static BS_INLINE void bs_targ_flags __P((struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_targ_flags __P((struct targ_info *, struct ccb *));
static BS_INLINE int
bs_check_disc(ti)
@@ -108,13 +108,13 @@ bs_check_smit(ti)
static BS_INLINE int
bs_check_link(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
- struct bsccb *nextcb;
+ struct ccb *nextcb;
return ((ti->ti_flags & BSLINK) &&
(nextcb = cb->ccb_chain.tqe_next) &&
- (nextcb->bsccb_flags & BSLINK));
+ (nextcb->flags & BSLINK));
}
static BS_INLINE u_int8_t
@@ -128,17 +128,17 @@ bs_identify_msg(ti)
static BS_INLINE void
bs_targ_flags(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int cmf = (u_int) bshw_cmd[cb->cmd[0]];
- cb->bsccb_flags |= ((cmf & (BSSAT | BSSMIT | BSLINK)) | BSDISC);
- cb->bsccb_flags &= ti->ti_mflags;
+ cb->flags |= ((cmf & (BSSAT | BSSMIT | BSLINK)) | BSDISC);
+ cb->flags &= ti->ti_mflags;
if (cb->datalen < DEV_BSIZE)
- cb->bsccb_flags &= ~BSSMIT;
- if (cb->bsccb_flags & BSFORCEIOPOLL)
- cb->bsccb_flags &= ~(BSLINK | BSSMIT | BSSAT | BSDISC);
+ cb->flags &= ~BSSMIT;
+ if (cb->flags & BSFORCEIOPOLL)
+ cb->flags &= ~(BSLINK | BSSMIT | BSSAT | BSDISC);
}
/**************************************************
diff --git a/sys/i386/isa/bs/bshw.c b/sys/i386/isa/bs/bshw.c
index 2cfe06472eae..9b6656916c0e 100644
--- a/sys/i386/isa/bs/bshw.c
+++ b/sys/i386/isa/bs/bshw.c
@@ -385,7 +385,7 @@ bshw_setup_ctrl_reg(bsc, flags)
void
bshw_issue_satcmd(bsc, cb, link)
struct bs_softc *bsc;
- struct bsccb *cb;
+ struct ccb *cb;
int link;
{
int i;
diff --git a/sys/i386/isa/bs/bshw.h b/sys/i386/isa/bs/bshw.h
index 8c698438a4ad..384cb0b0988a 100644
--- a/sys/i386/isa/bs/bshw.h
+++ b/sys/i386/isa/bs/bshw.h
@@ -97,7 +97,7 @@ int bshw_board_probe __P((struct bs_softc *, u_int *, u_int *));
void bshw_lock __P((struct bs_softc *));
void bshw_unlock __P((struct bs_softc *));
void bshw_get_syncreg __P((struct bs_softc *));
-void bshw_issue_satcmd __P((struct bs_softc *, struct bsccb *, int));
+void bshw_issue_satcmd __P((struct bs_softc *, struct ccb *, int));
void bshw_print_port __P((struct bs_softc *));
void bs_lc_smit_xfer __P((struct targ_info *, u_int));
diff --git a/sys/i386/isa/bs/bshw_dma.c b/sys/i386/isa/bs/bshw_dma.c
index 5b32de740493..b3683f6fb5fa 100644
--- a/sys/i386/isa/bs/bshw_dma.c
+++ b/sys/i386/isa/bs/bshw_dma.c
@@ -101,7 +101,7 @@ bs_dma_xfer(ti, direction)
/* setup segaddr */
sp->segaddr = (u_int8_t *) phys;
/* setup seglen */
- endva = (vm_offset_t)round_page((unsigned long)(sp->data + sp->datalen));
+ endva = (vm_offset_t)round_page(sp->data + sp->datalen);
for (va = (vm_offset_t) sp->data; ; phys = nphys)
{
if ((va += BSHW_NBPG) >= endva)
diff --git a/sys/i386/isa/bs/bsif.c b/sys/i386/isa/bs/bsif.c
index 948d3b61fec2..d9a8210c8231 100644
--- a/sys/i386/isa/bs/bsif.c
+++ b/sys/i386/isa/bs/bsif.c
@@ -42,15 +42,6 @@
#include <i386/isa/bs/bsif.h>
#endif /* __FreeBSD__ */
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
/**************************************************
* DEVICE DECLARE
**************************************************/
@@ -78,9 +69,7 @@ struct scsi_adapter pc98texa55bs = {
#ifdef __FreeBSD__
static int bsprobe __P((struct isa_device *));
-static void bs_poll(struct cam_sim *sim);
-static int bsattach(struct isa_device *);
-static ointhand2_t bsintr;
+static int bsattach __P((struct isa_device *));
static int bsprint __P((void *, const char *));
static void bs_scsi_minphys __P((struct buf *));
static int bs_dmarangecheck __P((caddr_t, unsigned));
@@ -90,7 +79,7 @@ struct isa_driver bsdriver = {
bsattach,
"bs"
};
-#if 0
+
struct scsi_device bs_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -99,14 +88,14 @@ struct scsi_device bs_dev = {
"bs",
0, {0, 0}
};
-#endif
+
u_int32_t
bs_adapter_info(unit)
int unit;
{
return (1);
}
-#if 0
+
static struct scsi_adapter pc98texa55bs = {
bs_scsi_cmd,
bs_scsi_minphys,
@@ -115,7 +104,7 @@ static struct scsi_adapter pc98texa55bs = {
bs_adapter_info,
"bs", {0, 0}
};
-#endif
+
static u_short pc98_irq_ball[16] = {
IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15
@@ -168,7 +157,7 @@ bsprobe(dev)
else
bsc->sm_offset = (u_long) 0;
- snprintf(bsc->sc_dvname, sizeof(bsc->sc_dvname), "bs%d", unit);
+ sprintf(bsc->sc_dvname, "bs%d", unit);
if (dev->id_iobase == 0)
{
@@ -223,12 +212,6 @@ bsprint(aux, name)
}
#ifdef __FreeBSD__
-static void
-bs_poll(struct cam_sim *sim)
-{
- bs_sequencer(cam_sim_softc(sim));
-}
-
static int
bsattach(dev)
struct isa_device *dev;
@@ -236,37 +219,27 @@ bsattach(dev)
int unit = dev->id_unit;
struct bs_softc *bsc = bscdata[unit];
struct scsibus_data *scbus;
- struct cam_devq *devq;
- dev->id_ointr = bsintr;
+ bsc->sc_link.adapter_unit = unit;
+ bsc->sc_link.adapter_targ = bsc->sc_hostid;
+ bsc->sc_link.flags = SDEV_BOUNCE;
+ bsc->sc_link.opennings = XSMAX;
+ bsc->sc_link.adapter_softc = bsc;
+ bsc->sc_link.adapter = &pc98texa55bs;
+ bsc->sc_link.device = &bs_dev;
/*
- * CAM support HN2 MAX_START, MAX_TAGS xxxx
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
*/
- devq = cam_simq_alloc(256/*MAX_START*/);
- if (devq == NULL)
- return 0;
-
- bsc->sim = cam_sim_alloc(bs_scsi_cmd, bs_poll, "bs",
- bsc, unit, 1, 32/*MAX_TAGS*/, devq);
- if (bsc->sim == NULL) {
- cam_simq_free(devq);
+ scbus = scsi_alloc_bus();
+ if (!scbus)
return 0;
- }
-
- if (xpt_bus_register(bsc->sim, 0) != CAM_SUCCESS) {
- free(bsc->sim, M_DEVBUF);
- return 0;
- }
-
- if (xpt_create_path(&bsc->path, /*periph*/NULL,
- cam_sim_path(bsc->sim), CAM_TARGET_WILDCARD,
- CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
- xpt_bus_deregister(cam_sim_path(bsc->sim));
- cam_sim_free(bsc->sim, /*free_simq*/TRUE);
- free(bsc->sim, M_DEVBUF);
- return 0;
- }
+ scbus->adapter_link = &bsc->sc_link;
+ /*
+ * ask the adapter what subunits are present
+ */
+ scsi_attachdevs(scbus);
bs_start_timeout(bsc);
return 1;
}
@@ -283,7 +256,7 @@ bsintr(arg)
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
-static void
+void
bsintr(unit)
int unit;
{
@@ -303,7 +276,7 @@ bs_scsi_minphys(bp)
bp->b_bcount = BSDMABUFSIZ;
minphys(bp);
}
-#if 0
+
XSBS_INT32T
bs_target_open(sc, cf)
struct scsi_link *sc;
@@ -323,7 +296,7 @@ bs_target_open(sc, cf)
bs_setup_ctrl(ti, (u_int)sc->quirks, flags);
return 0;
}
-#endif
+
/*****************************************************************
* BS MEMORY ALLOCATION INTERFACE
*****************************************************************/
@@ -386,7 +359,7 @@ static int bs_dmarangecheck(caddr_t va, unsigned length)
{
vm_offset_t phys, priorpage = 0, endva;
- endva = (vm_offset_t)round_page((unsigned long)(va+length));
+ endva = (vm_offset_t)round_page(va+length);
for (; va < (caddr_t)endva; va += PAGE_SIZE) {
phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va));
if (phys == 0)
diff --git a/sys/i386/isa/bs/bsif.h b/sys/i386/isa/bs/bsif.h
index 0c6347867656..478944fcaea3 100644
--- a/sys/i386/isa/bs/bsif.h
+++ b/sys/i386/isa/bs/bsif.h
@@ -117,11 +117,9 @@
#include <machine/ipl.h>
#include <machine/dvcfg.h>
-#include <cam/scsi/scsi_all.h>
-#if 0
-#include <cam/scsi/scsiconf.h>
-#endif
-#include <cam/scsi/scsi_da.h>
+#include <scsi/scsi_all.h>
+#include <scsi/scsiconf.h>
+#include <scsi/scsi_disk.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
@@ -175,8 +173,8 @@
* xs flags's abstraction (all currently used)
***************************************************/
#define XSBS_ITSDONE ITSDONE
-#ifdef __NetBSD__
#define XSBS_SCSI_NOSLEEP SCSI_NOSLEEP
+#ifdef __NetBSD__
#define XSBS_SCSI_POLL SCSI_POLL
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
@@ -184,17 +182,20 @@
#endif /* __FreeBSD__ */
/***************************************************
+ * Special operations
+ ***************************************************/
+#ifdef __FreeBSD__
+#define BS_ADDRESS_CHECK
+#endif /* __FreeBSD__ */
+
+/***************************************************
* declare
***************************************************/
/* (I) common declare */
void bs_alloc_buf __P((struct targ_info *));
-#ifdef __NetBSD__
XSBS_INT32T bs_target_open __P((struct scsi_link *, struct cfdata *));
XSBS_INT32T bs_scsi_cmd __P((struct scsi_xfer *));
-#endif
-#ifdef __FreeBSD__
-void bs_scsi_cmd(struct cam_sim *sim, union ccb *ccb);
-#endif
+
extern int delaycount;
/* (II) os depend declare */
diff --git a/sys/i386/isa/bs/bsvar.h b/sys/i386/isa/bs/bsvar.h
index 9eea57a6065a..9167c2d15618 100644
--- a/sys/i386/isa/bs/bsvar.h
+++ b/sys/i386/isa/bs/bsvar.h
@@ -92,7 +92,7 @@
* PARAMETER
**************************************************/
#define NTARGETS 8
-#define RETRIES 0 /* number of retries before giving up */
+#define RETRIES 4 /* number of retries before giving up */
#define HARDRETRIES 3
#define XSMAX 4
#define BSDMABUFSIZ 0x10000
@@ -240,7 +240,7 @@ struct sc_p {
#define BSERRORBITS "\020\014busy\013abnormal\012retry\011msgerr\010fatal\007seltimeout\006sense\005timeout\004statuserr\003parity\002cmderr\001dmaerr"
-/* bsccb bsccb_flags & targ_info flags & cmd flags*/
+/* ccb & targ_info flags & cmd flags*/
#define BSREAD 0x0001
#define BSSAT 0x0002
#define BSLINK 0x0004
@@ -258,14 +258,14 @@ struct sc_p {
#define BSCFLAGSMASK (0xffff)
-struct bsccb {
- TAILQ_ENTRY(bsccb) ccb_chain;
+struct ccb {
+ TAILQ_ENTRY(ccb) ccb_chain;
- union ccb *ccb; /* upper drivers info */
+ struct scsi_xfer *xs; /* upper drivers info */
u_int lun; /* lun */
- u_int bsccb_flags; /* control flags */
+ u_int flags; /* control flags */
int rcnt; /* retry counter of this ccb */
@@ -290,75 +290,75 @@ struct bsccb {
int tcmax;
};
-GENERIC_CCB_ASSERT(bs, bsccb)
+GENERIC_CCB_ASSERT(bs, ccb)
/* target info */
struct targ_info {
-/*0*/ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
+ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
-/*4*/ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
+ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
-/*8*/ struct bs_softc *ti_bsc; /* our controller */
-/*c*/ u_int ti_id; /* scsi id */
-/*10*/ u_int ti_lun; /* current lun */
+ struct bs_softc *ti_bsc; /* our controller */
+ u_int ti_id; /* scsi id */
+ u_int ti_lun; /* current lun */
-/*14*/ struct bsccbtab ti_ctab, ti_bctab; /* ccb */
+ struct ccbtab ti_ctab, ti_bctab; /* ccb */
#define BS_TARG_NULL 0
#define BS_TARG_CTRL 1
#define BS_TARG_START 2
#define BS_TARG_SYNCH 3
#define BS_TARG_RDY 4
-/*24*/ int ti_state; /* target state */
+ int ti_state; /* target state */
-/*28*/ u_int ti_cfgflags; /* target cfg flags */
+ u_int ti_cfgflags; /* target cfg flags */
-/*2c*/ u_int ti_flags; /* flags */
-/*30*/ u_int ti_mflags; /* flags masks */
+ u_int ti_flags; /* flags */
+ u_int ti_mflags; /* flags masks */
-/*34*/ u_int ti_error; /* error flags */
-/*38*/ u_int ti_herrcnt; /* hardware err retry counter */
+ u_int ti_error; /* error flags */
+ u_int ti_herrcnt; /* hardware err retry counter */
/*****************************************
* scsi phase data
*****************************************/
-/*3c*/ struct sc_p ti_scsp; /* saved scsi data pointer */
+ struct sc_p ti_scsp; /* saved scsi data pointer */
-/*50*/ enum scsi_phase ti_phase; /* scsi phase */
-/*54*/ enum scsi_phase ti_ophase; /* previous scsi phase */
+ enum scsi_phase ti_phase; /* scsi phase */
+ enum scsi_phase ti_ophase; /* previous scsi phase */
-/*58*/ u_int8_t ti_status; /* status in */
+ u_int8_t ti_status; /* status in */
-/*59*/ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
-/*64*/ int ti_msginptr;
+ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
+ int ti_msginptr;
-/*68*/ u_int8_t ti_msgout; /* last msgout byte */
-/*69*/ u_int8_t ti_emsgout; /* last msgout byte */
-/*6c*/ u_int ti_omsgoutlen; /* for retry msgout */
+ u_int8_t ti_msgout; /* last msgout byte */
+ u_int8_t ti_emsgout; /* last msgout byte */
+ u_int ti_omsgoutlen; /* for retry msgout */
-/*70*/ struct syncdata ti_syncmax; /* synch data (scsi) */
-/*72*/ struct syncdata ti_syncnow;
-/*74*/ u_int8_t ti_sync; /* synch val (chip) */
+ struct syncdata ti_syncmax; /* synch data (scsi) */
+ struct syncdata ti_syncnow;
+ u_int8_t ti_sync; /* synch val (chip) */
/*****************************************
* bounce buffer & smit data pointer
*****************************************/
-/*75*/ u_int8_t *bounce_phys;
-/*76*/ u_int8_t *bounce_addr;
-/*78*/ u_int bounce_size;
+ u_int8_t *bounce_phys;
+ u_int8_t *bounce_addr;
+ u_int bounce_size;
-/*7c*/ u_long sm_offset;
+ u_long sm_offset;
/*****************************************
* target inq data
*****************************************/
-/*79*/ u_int8_t targ_type;
-/*7a*/ u_int8_t targ_support;
+ u_int8_t targ_type;
+ u_int8_t targ_support;
/*****************************************
* generic scsi cmd buffer for this target
*****************************************/
-/*7b*/ u_int8_t scsi_cmd[12];
+ u_int8_t scsi_cmd[12];
struct scsi_sense_data sense;
};
@@ -371,6 +371,8 @@ struct bs_softc {
*****************************************/
OS_DEPEND_DEVICE_HEADER
+ OS_DEPEND_SCSI_HEADER
+
OS_DEPEND_MISC_HEADER
/*****************************************
@@ -431,7 +433,7 @@ struct bs_softc {
u_int sc_wc; /* weight count */
int sc_poll;
- struct bsccb *sc_outccb;
+ struct ccb *sc_outccb;
/*****************************************
* wd33c93 chip depend section
@@ -460,12 +462,6 @@ struct bs_softc {
*****************************************/
#define BS_DVNAME_LEN 16
u_char sc_dvname[BS_DVNAME_LEN];
-
- /*****************************************
- * CAM support
- *****************************************/
- struct cam_sim *sim;
- struct cam_path *path;
};
/*************************************************
@@ -500,10 +496,10 @@ extern int bs_debug_flag;
/*************************************************
* Function declare
*************************************************/
-int bs_scsi_cmd_internal __P((struct bsccb *, u_int));
-struct bsccb *bscmddone __P((struct targ_info *));
+int bs_scsi_cmd_internal __P((struct ccb *, u_int));
+struct ccb *bscmddone __P((struct targ_info *));
int bscmdstart __P((struct targ_info *, int));
-int bs_scsi_cmd_poll __P((struct targ_info *, struct bsccb *));
+int bs_scsi_cmd_poll __P((struct targ_info *, struct ccb *));
int bs_sequencer __P((struct bs_softc *));
void bs_poll_timeout __P((struct bs_softc *, char *));
@@ -511,9 +507,8 @@ void bs_poll_timeout __P((struct bs_softc *, char *));
* XXX
*************************************************/
/* misc error */
-#define COMPLETE 2
-#define NOTARGET (-2)
-#define HASERROR (-1)
+#define NOTARGET -2
+#define HASERROR -1
/* XXX: use scsi_message.h */
/* status */
diff --git a/sys/i386/isa/bt_isa.c b/sys/i386/isa/bt_isa.c
index f646f85bf158..8009a36569d8 100644
--- a/sys/i386/isa/bt_isa.c
+++ b/sys/i386/isa/bt_isa.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt_isa.c,v 1.4 1998/10/12 18:53:33 imp Exp $
+ * $Id: bt_isa.c,v 1.3 1998/10/10 00:44:12 imp Exp $
*/
#include <sys/param.h>
@@ -86,10 +86,24 @@ bt_isa_probe(dev)
* Bound our board search if the user has
* specified an exact port.
*/
- bt_find_probe_range(dev->id_iobase, &port_index, &max_port_index);
-
- if (port_index < 0)
- return 0;
+ if (dev->id_iobase > 0) {
+ for (;port_index <= max_port_index; port_index++)
+ if (dev->id_iobase >= bt_isa_ports[port_index].addr)
+ break;
+ if ((port_index > max_port_index)
+ || (dev->id_iobase != bt_isa_ports[port_index].addr)) {
+ printf("
+bt_isa_probe: Invalid baseport of 0x%x specified.
+bt_isa_probe: Nearest valid baseport is 0x%x.
+bt_isa_probe: Failing probe.\n",
+ dev->id_iobase,
+ (port_index <= max_port_index)
+ ? bt_isa_ports[port_index].addr
+ : bt_isa_ports[max_port_index].addr);
+ return 0;
+ }
+ max_port_index = port_index;
+ }
/* Attempt to find an adapter */
for (;port_index <= max_port_index; port_index++) {
@@ -97,7 +111,7 @@ bt_isa_probe(dev)
u_int ioport;
int error;
- ioport = bt_iop_from_bio(port_index);
+ ioport = bt_isa_ports[port_index].addr;
/*
* Ensure this port has not already been claimed already
@@ -105,7 +119,7 @@ bt_isa_probe(dev)
*/
if (bt_check_probed_iop(ioport) != 0)
continue;
- dev->id_iobase = ioport;
+ dev->id_iobase = bt_isa_ports[port_index].addr;
if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
continue;
@@ -155,7 +169,6 @@ bt_isa_probe(dev)
printf("bt_isa_probe: Invalid DMA setting "
"detected for adapter at 0x%x. "
"Failing probe\n", ioport);
- return (0);
}
} else {
/* VL DMA */
diff --git a/sys/i386/isa/ccbque.h b/sys/i386/isa/ccbque.h
index 0d9eeecb9f55..7530068d1395 100644
--- a/sys/i386/isa/ccbque.h
+++ b/sys/i386/isa/ccbque.h
@@ -36,6 +36,7 @@
#define _CCBQUE_H_
#define CCB_MWANTED 0x01
+#define CCB_WOK(fl) (((fl) == 0) ? M_WAITOK : M_NOWAIT)
/* (I) structure and prototype */
#define GENERIC_CCB_ASSERT(DEV, CCBTYPE) \
@@ -48,7 +49,7 @@ struct CCBTYPE##que { \
}; \
\
void DEV##_init_ccbque __P((int)); \
-struct CCBTYPE *DEV##_get_ccb __P((void)); \
+struct CCBTYPE *DEV##_get_ccb __P((int)); \
void DEV##_free_ccb __P((register struct CCBTYPE *));
/* (II) static allocated memory */
@@ -68,7 +69,8 @@ DEV##_init_ccbque(count) \
} \
\
struct CCBTYPE * \
-DEV##_get_ccb() \
+DEV##_get_ccb(flags) \
+ int flags; \
{ \
register struct CCBTYPE *cb; \
int s = splbio(); \
@@ -85,7 +87,7 @@ again: \
} \
else \
{ \
- cb = malloc(sizeof(*cb), M_DEVBUF, M_NOWAIT); \
+ cb = malloc(sizeof(*cb), M_DEVBUF, CCB_WOK(flags));\
if (cb != NULL) \
{ \
bzero(cb, sizeof(*cb)); \
@@ -95,6 +97,12 @@ again: \
CCBTYPE##que.count --; \
} \
\
+ if (flags == 0) \
+ { \
+ CCBTYPE##que.flags |= CCB_MWANTED; \
+ tsleep((caddr_t) &CCBTYPE##que.count, PRIBIO, "ccbwait", 0);\
+ goto again; \
+ } \
cb = NULL; \
\
out: \
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index d9bca71ad7c1..7515141cb1f6 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.128 1998/10/23 10:46:20 phk Exp $
+ * $Id: clock.c,v 1.126 1998/09/20 03:47:54 bde Exp $
*/
/*
@@ -126,7 +126,7 @@ static void setup_8254_mixed_mode __P((void));
*/
#define TIMER0_MAX_FREQ 20000
-int adjkerntz; /* local offset from GMT in seconds */
+int adjkerntz; /* local offset from GMT in seconds */
int disable_rtc_set; /* disable resettodr() if != 0 */
u_int idelayed;
int statclock_disable;
@@ -137,7 +137,7 @@ u_int stat_imask = SWI_CLOCK_MASK;
u_int timer_freq = TIMER_FREQ;
int timer0_max_count;
u_int tsc_freq;
-int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
static u_int clk_imask = HWI_MASK | SWI_MASK;
@@ -173,7 +173,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
static unsigned tsc_get_timecount __P((struct timecounter *tc));
static void set_timer_freq(u_int freq, int intr_freq);
-static struct timecounter tsc_timecounter = {
+static struct timecounter tsc_timecounter[3] = {
tsc_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -182,9 +182,9 @@ static struct timecounter tsc_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
- &tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
+ tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
-static struct timecounter i8254_timecounter = {
+static struct timecounter i8254_timecounter[3] = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -193,7 +193,7 @@ static struct timecounter i8254_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
- &i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
+ i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
static void
clkintr(struct clockframe frame)
@@ -751,8 +751,8 @@ startrtclock()
}
set_timer_freq(timer_freq, hz);
- i8254_timecounter.tc_frequency = timer_freq;
- init_timecounter(&i8254_timecounter);
+ i8254_timecounter[0].tc_frequency = timer_freq;
+ init_timecounter(i8254_timecounter);
#ifndef CLK_USE_TSC_CALIBRATION
if (tsc_freq != 0) {
@@ -801,16 +801,16 @@ startrtclock()
#endif /* NAPM > 0 */
if (tsc_present && tsc_freq != 0) {
- tsc_timecounter.tc_frequency = tsc_freq;
- init_timecounter(&tsc_timecounter);
+ tsc_timecounter[0].tc_frequency = tsc_freq;
+ init_timecounter(tsc_timecounter);
}
#endif /* !defined(SMP) */
}
/*
- * Initialize the time of day register, based on the time base which is, e.g.
- * from a filesystem.
+ * Initialize the time of day register, based on the time base which is, e.g.
+ * from a filesystem.
*/
void
inittodr(time_t base)
@@ -829,17 +829,17 @@ inittodr(time_t base)
splx(s);
}
- /* Look if we have a RTC present and the time is valid */
+ /* Look if we have a RTC present and the time is valid */
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
goto wrong_time;
- /* wait for time update to complete */
- /* If RTCSA_TUP is zero, we have at least 244us before next update */
+ /* wait for time update to complete */
+ /* If RTCSA_TUP is zero, we have at least 244us before next update */
while (rtcin(RTC_STATUSA) & RTCSA_TUP);
days = 0;
#ifdef USE_RTC_CENTURY
- year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
+ year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
#else
year = readrtc(RTC_YEAR) + 1900;
if (year < 1970)
@@ -847,21 +847,21 @@ inittodr(time_t base)
#endif
if (year < 1970)
goto wrong_time;
- month = readrtc(RTC_MONTH);
- for (m = 1; m < month; m++)
- days += daysinmonth[m-1];
- if ((month > 2) && LEAPYEAR(year))
+ month = readrtc(RTC_MONTH);
+ for (m = 1; m < month; m++)
+ days += daysinmonth[m-1];
+ if ((month > 2) && LEAPYEAR(year))
days ++;
- days += readrtc(RTC_DAY) - 1;
+ days += readrtc(RTC_DAY) - 1;
yd = days;
for (y = 1970; y < year; y++)
- days += DAYSPERYEAR + LEAPYEAR(y);
+ days += DAYSPERYEAR + LEAPYEAR(y);
sec = ((( days * 24 +
readrtc(RTC_HRS)) * 60 +
readrtc(RTC_MIN)) * 60 +
readrtc(RTC_SEC));
- /* sec now contains the number of seconds, since Jan 1 1970,
- in the local time zone */
+ /* sec now contains the number of seconds, since Jan 1 1970,
+ in the local time zone */
sec += tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -877,12 +877,12 @@ inittodr(time_t base)
return;
wrong_time:
- printf("Invalid time in real time clock.\n");
- printf("Check and reset the date immediately!\n");
+ printf("Invalid time in real time clock.\n");
+ printf("Check and reset the date immediately!\n");
}
/*
- * Write system time back to RTC
+ * Write system time back to RTC
*/
void
resettodr()
@@ -900,7 +900,7 @@ resettodr()
/* Disable RTC updates and interrupts. */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in RTC */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -908,7 +908,7 @@ resettodr()
writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */
writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
- /* We have now the days since 01-01-1970 in tm */
+ /* We have now the days since 01-01-1970 in tm */
writertc(RTC_WDAY, (tm+4)%7); /* Write back Weekday */
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
tm >= m;
@@ -1118,7 +1118,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
if (timer0_state != RELEASED)
return (EBUSY); /* too much trouble to handle */
set_timer_freq(freq, hz);
- i8254_timecounter.tc_frequency = freq;
+ i8254_timecounter[0].tc_frequency = freq;
}
return (error);
}
@@ -1138,7 +1138,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
if (error == 0 && req->newptr != NULL) {
tsc_freq = freq;
- tsc_timecounter.tc_frequency = tsc_freq;
+ tsc_timecounter[0].tc_frequency = tsc_freq;
}
return (error);
}
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index 413302d50471..3e094ee8a6b5 100644
--- a/sys/i386/isa/ctx.c
+++ b/sys/i386/isa/ctx.c
@@ -8,7 +8,7 @@
* of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: ctx.c,v 1.28 1998/06/14 10:52:52 bde Exp $
+ * $Id: ctx.c,v 1.27 1998/06/07 17:10:15 dfr Exp $
*/
/*
@@ -196,12 +196,12 @@ ctxattach(struct isa_device * devp)
sr->iobase = devp->id_iobase;
sr->maddr = devp->id_maddr;
sr->msize = devp->id_msize;
+ return (1);
#ifdef DEVFS
sr->devfs_token =
devfs_add_devswf(&ctx_cdevsw, 0, DV_CHR, 0, 0, 0600,
"ctx%d", devp->id_unit);
#endif /* DEVFS */
- return (1);
}
static int
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 9b00dabb8d63..b4fb32460fb7 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -417,8 +417,7 @@ int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case 8: o->iftype = c->board->if8type; break;
}
if (c->master != c->ifp)
- snprintf (o->master, sizeof(o->master),
- "%s%d", c->master->if_name,
+ sprintf (o->master, "%s%d", c->master->if_name,
c->master->if_unit);
else
*o->master = 0;
@@ -846,7 +845,7 @@ int cxrinta (cx_chan_t *c)
}
/* Discard exception characters. */
- if ((risr & RISA_SCMASK) && tp && (tp->t_iflag & IXON))
+ if ((risr & RISA_SCMASK) && (tp->t_iflag & IXON))
reoir |= REOI_DISCEXC;
/* Handle received data. */
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 794d4d690b92..3f765678f0c1 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.82 1998/12/24 14:17:57 bde Exp $
+ * $Id: cy.c,v 1.70 1998/08/20 05:21:50 bde Exp $
*/
#include "opt_compat.h"
@@ -37,6 +37,8 @@
/*
* TODO:
+ * Implement BREAK.
+ * Fix overflows when closing line.
* Atomic COR change.
* Consoles.
*/
@@ -86,9 +88,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <i386/isa/isa_device.h>
#include <i386/isa/cyreg.h>
@@ -153,16 +152,6 @@
#define CD1400_xIVR_CHAN_SHIFT 3
#define CD1400_xIVR_CHAN 0x1F
-/*
- * ETC states. com->etc may also contain a hardware ETC command value,
- * meaning that execution of that command is pending.
- */
-#define ETC_NONE 0 /* we depend on bzero() setting this */
-#define ETC_BREAK_STARTING 1
-#define ETC_BREAK_STARTED 2
-#define ETC_BREAK_ENDING 3
-#define ETC_BREAK_ENDED 4
-
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
#define RS_IBUFSIZE 256
@@ -211,7 +200,6 @@
#define CS_DTR_OFF 0x10 /* DTR held off */
#define CS_ODONE 4 /* output completed */
#define CS_RTS_IFLOW 8 /* use RTS input flow control */
-#define CSE_ODONE 1 /* output transmitted */
static char const * const error_desc[] = {
#define CE_OVERRUN 0
@@ -243,10 +231,6 @@ struct com_s {
bool_t active_out; /* nonzero if the callout device is open */
#if 0
u_char cfcr_image; /* copy of value written to CFCR */
-#endif
- u_char etc; /* pending Embedded Transmit Command */
- u_char extra_state; /* more flag bits, separate for order trick */
-#if 0
u_char fifo_image; /* copy of value written to FIFO */
#endif
u_char gfrcr_image; /* copy of value read from GFRCR */
@@ -321,7 +305,6 @@ struct com_s {
u_int start_count; /* no. of calls to comstart() */
u_int start_real; /* no. of calls that did something */
#endif
- u_char car; /* CD1400 CAR shadow (if first unit in cd) */
u_char channel_control;/* CD1400 CCR control command shadow */
u_char cor[3]; /* CD1400 COR1-3 shadows */
u_char intr_enable; /* CD1400 SRER shadow */
@@ -352,15 +335,10 @@ struct com_s {
/* PCI driver entry point. */
int cyattach_common __P((cy_addr cy_iobase, int cy_align));
-ointhand2_t siointr;
static int cy_units __P((cy_addr cy_iobase, int cy_align));
static int sioattach __P((struct isa_device *dev));
-static void cd1400_channel_cmd __P((struct com_s *com, int cmd));
-static void cd1400_channel_cmd_wait __P((struct com_s *com));
-static void cd_etc __P((struct com_s *com, int etc));
-static int cd_getreg __P((struct com_s *com, int reg));
-static void cd_setreg __P((struct com_s *com, int reg, int val));
+static void cd1400_channel_cmd __P((cy_addr iobase, int cmd, int cy_align));
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
#if 0
@@ -450,11 +428,11 @@ sioprobe(dev)
iobase = (cy_addr)dev->id_maddr;
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
- cy_inb(iobase, CY16_RESET, 0); /* XXX? */
+ cd_inb(iobase, CY16_RESET, 0); /* XXX? */
DELAY(500); /* wait for the board to get its act together */
/* this is needed to get the board out of reset */
- cy_outb(iobase, CY_CLEAR_INTR, 0, 0);
+ cd_outb(iobase, CY_CLEAR_INTR, 0, 0);
DELAY(500);
return (cy_units(iobase, 0) == 0 ? 0 : -1);
@@ -528,7 +506,6 @@ sioattach(isdp)
printf("cy%d: attached as cy%d\n", isdp->id_unit, adapter);
isdp->id_unit = adapter; /* XXX */
}
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
return (1);
}
@@ -601,7 +578,6 @@ cyattach_common(cy_iobase, cy_align)
com->cy_align = cy_align;
com->cy_iobase = cy_iobase;
com->iobase = iobase;
- com->car = ~CD1400_CAR_CHAN;
/*
* We don't use all the flags from <sys/ttydefaults.h> since they
@@ -664,7 +640,7 @@ cyattach_common(cy_iobase, cy_align)
}
/* ensure an edge for the next interrupt */
- cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
+ cd_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
return (adapter);
}
@@ -678,6 +654,7 @@ sioopen(dev, flag, mode, p)
{
struct com_s *com;
int error;
+ cy_addr iobase;
int mynor;
int s;
struct tty *tp;
@@ -747,25 +724,48 @@ open_top:
tp->t_ififosize = 2 * RS_IBUFSIZE;
tp->t_ispeedwat = (speed_t)-1;
tp->t_ospeedwat = (speed_t)-1;
-
- /* Encode per-board unit in LIVR for access in intr routines. */
- cd_setreg(com, CD1400_LIVR,
- (unit & CD1400_xIVR_CHAN) << CD1400_xIVR_CHAN_SHIFT);
-
- (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
#if 0
+ (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
com->poll = com->no_irq;
com->poll_output = com->loses_outints;
#endif
++com->wopeners;
+ iobase = com->iobase;
+
+ /* reset this channel */
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ unit & CD1400_CAR_CHAN);
+ cd1400_channel_cmd(iobase, CD1400_CCR_CMDRESET, com->cy_align);
+
+ /*
+ * Resetting disables the transmitter and receiver as well as
+ * flushing the fifos so some of our cached state becomes
+ * invalid. The documentation suggests that all registers
+ * for the current channel are reset to defaults, but
+ * apparently none are. We wouldn't want DTR cleared.
+ */
+ com->channel_control = 0;
+
+ /* Encode per-board unit in LIVR for access in intr routines. */
+ cd_outb(iobase, CD1400_LIVR, com->cy_align,
+ (unit & CD1400_xIVR_CHAN) << CD1400_xIVR_CHAN_SHIFT);
+
+ /*
+ * raise dtr and generally set things up correctly. this
+ * has the side-effect of selecting the appropriate cd1400
+ * channel, to help us with subsequent channel control stuff
+ */
error = comparam(tp, &tp->t_termios);
--com->wopeners;
if (error != 0)
goto out;
+ /*
+ * XXX we should goto open_top if comparam() slept.
+ */
#if 0
if (com->hasfifo) {
/*
- * (Re)enable and flush fifos.
+ * (Re)enable and drain fifos.
*
* Certain SMC chips cause problems if the fifos
* are enabled while input is ready. Turn off the
@@ -797,21 +797,14 @@ open_top:
| IER_EMSC);
enable_intr();
#else /* !0 */
- /*
- * Flush fifos. This requires a full channel reset which
- * also disables the transmitter and receiver. Recover
- * from this.
- */
- cd1400_channel_cmd(com,
- CD1400_CCR_CMDRESET | CD1400_CCR_CHANRESET);
- cd1400_channel_cmd(com, com->channel_control);
-
+ /* XXX raise RTS too */
+ (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
disable_intr();
com->prev_modem_status = com->last_modem_status
- = cd_getreg(com, CD1400_MSVR2);
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = CD1400_SRER_MDMCH | CD1400_SRER_RXDATA);
+ = cd_inb(iobase, CD1400_MSVR2, com->cy_align);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable
+ = CD1400_SRER_MDMCH | CD1400_SRER_RXDATA);
enable_intr();
#endif /* 0 */
/*
@@ -872,7 +865,6 @@ sioclose(dev, flag, mode, p)
com = com_addr(MINOR_TO_UNIT(mynor));
tp = com->tp;
s = spltty();
- cd_etc(com, CD1400_ETC_STOPBREAK);
(*linesw[tp->t_line].l_close)(tp, flag);
disc_optim(tp, &tp->t_termios, com);
siostop(tp, FREAD | FWRITE);
@@ -904,15 +896,9 @@ comhardclose(com)
com->poll_output = FALSE;
#endif
com->do_timestamp = 0;
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
#if 0
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#else
- /* XXX */
- disable_intr();
- com->etc = ETC_NONE;
- cd_setreg(com, CD1400_COR2, com->cor[1] &= ~CD1400_COR2_ETC);
- enable_intr();
- cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
#endif
{
@@ -920,7 +906,8 @@ comhardclose(com)
outb(iobase + com_ier, 0);
#else
disable_intr();
- cd_setreg(com, CD1400_SRER, com->intr_enable = 0);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable = 0);
enable_intr();
#endif
tp = com->tp;
@@ -942,9 +929,10 @@ comhardclose(com)
com->channel_control = CD1400_CCR_CMDCHANCTL
| CD1400_CCR_XMTEN
| CD1400_CCR_RCVDIS;
- cd1400_channel_cmd(com, com->channel_control);
+ cd1400_channel_cmd(iobase, com->channel_control,
+ com->cy_align);
- if (com->dtr_wait != 0 && !(com->state & CS_DTR_OFF)) {
+ if (com->dtr_wait != 0) {
timeout(siodtrwakeup, com, com->dtr_wait);
com->state |= CS_DTR_OFF;
}
@@ -1064,16 +1052,16 @@ siointr(unit)
u_char recv_data;
u_char serv_type;
#ifdef PollMode
+ u_char save_car;
u_char save_rir;
#endif
#ifdef PollMode
save_rir = cd_inb(iobase, CD1400_RIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter rx service */
cd_outb(iobase, CD1400_CAR, cy_align, save_rir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_rir & CD1400_CAR_CHAN;
serv_type = cd_inb(iobase, CD1400_RIVR, cy_align);
com = com_addr(baseu
@@ -1081,7 +1069,7 @@ siointr(unit)
& CD1400_xIVR_CHAN));
#else
/* ack receive service */
- serv_type = cy_inb(iobase, CY8_SVCACKR, cy_align);
+ serv_type = cy_inb(iobase, CY8_SVCACKR);
com = com_addr(baseu +
+ ((serv_type >> CD1400_xIVR_CHAN_SHIFT)
@@ -1229,6 +1217,7 @@ cont:
cd_outb(iobase, CD1400_RIR, cy_align,
save_rir
& ~(CD1400_RIR_RDIREQ | CD1400_RIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1237,6 +1226,7 @@ cont:
struct com_s *com;
u_char modem_status;
#ifdef PollMode
+ u_char save_car;
u_char save_mir;
#else
u_char vector;
@@ -1244,17 +1234,16 @@ cont:
#ifdef PollMode
save_mir = cd_inb(iobase, CD1400_MIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter modem service */
cd_outb(iobase, CD1400_CAR, cy_align, save_mir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_mir & CD1400_CAR_CHAN;
com = com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS
+ (save_mir & CD1400_MIR_CHAN));
#else
/* ack modem service */
- vector = cy_inb(iobase, CY8_SVCACKM, cy_align);
+ vector = cy_inb(iobase, CY8_SVCACKM);
com = com_addr(baseu
+ ((vector >> CD1400_xIVR_CHAN_SHIFT)
@@ -1293,9 +1282,7 @@ cont:
cd_outb(iobase, CD1400_SRER,
cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ |= CD1400_SRER_TXRDY);
} else {
com->state &= ~CS_ODEVREADY;
if (com->intr_enable
@@ -1303,9 +1290,7 @@ cont:
cd_outb(iobase, CD1400_SRER,
cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ &= ~CD1400_SRER_TXRDY);
}
}
#endif
@@ -1316,6 +1301,7 @@ cont:
cd_outb(iobase, CD1400_MIR, cy_align,
save_mir
& ~(CD1400_MIR_RDIREQ | CD1400_MIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1323,6 +1309,7 @@ cont:
if (status & CD1400_SVRR_TXRDY) {
struct com_s *com;
#ifdef PollMode
+ u_char save_car;
u_char save_tir;
#else
u_char vector;
@@ -1330,106 +1317,22 @@ cont:
#ifdef PollMode
save_tir = cd_inb(iobase, CD1400_TIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter tx service */
cd_outb(iobase, CD1400_CAR, cy_align, save_tir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_tir & CD1400_CAR_CHAN;
-
com = com_addr(baseu
+ cyu * CD1400_NO_OF_CHANNELS
+ (save_tir & CD1400_TIR_CHAN));
#else
/* ack transmit service */
- vector = cy_inb(iobase, CY8_SVCACKT, cy_align);
+ vector = cy_inb(iobase, CY8_SVCACKT);
com = com_addr(baseu
+ ((vector >> CD1400_xIVR_CHAN_SHIFT)
& CD1400_xIVR_CHAN));
#endif
- if (com->etc != ETC_NONE) {
- if (com->intr_enable & CD1400_SRER_TXRDY) {
- /*
- * Here due to sloppy SRER_TXRDY
- * enabling. Ignore. Come back when
- * tx is empty.
- */
- cd_outb(iobase, CD1400_SRER, cy_align,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
- goto terminate_tx_service;
- }
- switch (com->etc) {
- case CD1400_ETC_SENDBREAK:
- case CD1400_ETC_STOPBREAK:
- /*
- * Start the command. Come back on
- * next tx empty interrupt, hopefully
- * after command has been executed.
- */
- cd_outb(iobase, CD1400_COR2, cy_align,
- com->cor[1] |= CD1400_COR2_ETC);
- cd_outb(iobase, CD1400_TDR, cy_align,
- CD1400_ETC_CMD);
- cd_outb(iobase, CD1400_TDR, cy_align,
- com->etc);
- if (com->etc == CD1400_ETC_SENDBREAK)
- com->etc = ETC_BREAK_STARTING;
- else
- com->etc = ETC_BREAK_ENDING;
- goto terminate_tx_service;
- case ETC_BREAK_STARTING:
- /*
- * BREAK is now on. Continue with
- * SRER_TXMPTY processing, hopefully
- * don't come back.
- */
- com->etc = ETC_BREAK_STARTED;
- break;
- case ETC_BREAK_STARTED:
- /*
- * Came back due to sloppy SRER_TXMPTY
- * enabling. Hope again.
- */
- break;
- case ETC_BREAK_ENDING:
- /*
- * BREAK is now off. Continue with
- * SRER_TXMPTY processing and don't
- * come back. The SWI handler will
- * restart tx interrupts if necessary.
- */
- cd_outb(iobase, CD1400_COR2, cy_align,
- com->cor[1]
- &= ~CD1400_COR2_ETC);
- com->etc = ETC_BREAK_ENDED;
- if (!(com->state & CS_ODONE)) {
- com_events += LOTS_OF_EVENTS;
- com->state |= CS_ODONE;
- setsofttty();
- }
- break;
- case ETC_BREAK_ENDED:
- /*
- * Shouldn't get here. Hope again.
- */
- break;
- }
- }
- if (com->intr_enable & CD1400_SRER_TXMPTY) {
- if (!(com->extra_state & CSE_ODONE)) {
- com_events += LOTS_OF_EVENTS;
- com->extra_state |= CSE_ODONE;
- setsofttty();
- }
- cd_outb(iobase, CD1400_SRER, cy_align,
- com->intr_enable
- &= ~CD1400_SRER_TXMPTY);
- goto terminate_tx_service;
- }
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
u_char *ioptr;
u_int ocount;
@@ -1457,24 +1360,9 @@ cont:
} else {
/* output just completed */
com->state &= ~CS_BUSY;
-
- /*
- * The setting of CSE_ODONE may be
- * stale here. We currently only
- * use it when CS_BUSY is set, and
- * fixing it when we clear CS_BUSY
- * is easiest.
- */
- if (com->extra_state & CSE_ODONE) {
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- }
-
cd_outb(iobase, CD1400_SRER, cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ &= ~CD1400_SRER_TXRDY);
}
if (!(com->state & CS_ODONE)) {
com_events += LOTS_OF_EVENTS;
@@ -1487,11 +1375,11 @@ cont:
}
/* terminate service context */
-terminate_tx_service:
#ifdef PollMode
cd_outb(iobase, CD1400_TIR, cy_align,
save_tir
& ~(CD1400_TIR_RDIREQ | CD1400_TIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1499,7 +1387,7 @@ terminate_tx_service:
}
/* ensure an edge for the next interrupt */
- cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
+ cd_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
schedsofttty();
@@ -1524,6 +1412,7 @@ sioioctl(dev, cmd, data, flag, p)
{
struct com_s *com;
int error;
+ cy_addr iobase;
int mynor;
int s;
struct tty *tp;
@@ -1534,6 +1423,7 @@ sioioctl(dev, cmd, data, flag, p)
mynor = minor(dev);
com = com_addr(MINOR_TO_UNIT(mynor));
+ iobase = com->iobase;
if (mynor & CONTROL_MASK) {
struct termios *ct;
@@ -1609,21 +1499,17 @@ sioioctl(dev, cmd, data, flag, p)
splx(s);
return (error);
}
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ MINOR_TO_UNIT(mynor) & CD1400_CAR_CHAN);
switch (cmd) {
- case TIOCSBRK:
#if 0
+ case TIOCSBRK:
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
-#else
- cd_etc(com, CD1400_ETC_SENDBREAK);
-#endif
break;
case TIOCCBRK:
-#if 0
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#else
- cd_etc(com, CD1400_ETC_STOPBREAK);
-#endif
break;
+#endif /* 0 */
case TIOCSDTR:
(void)commctl(com, TIOCM_DTR, DMBIS);
break;
@@ -1689,6 +1575,7 @@ repeat:
u_char *buf;
struct com_s *com;
u_char *ibuf;
+ cy_addr iobase;
int incc;
struct tty *tp;
@@ -1747,8 +1634,11 @@ repeat:
outb(com->modem_ctl_port,
com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ iobase = com->iobase,
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ unit & CD1400_CAR_CHAN),
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
enable_intr();
com->ibuf = ibuf;
@@ -1768,25 +1658,12 @@ repeat:
(*linesw[tp->t_line].l_modem)
(tp, com->prev_modem_status & MSR_DCD);
}
- if (com->extra_state & CSE_ODONE) {
- disable_intr();
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- enable_intr();
- if (!(com->state & CS_BUSY)) {
- tp->t_state &= ~TS_BUSY;
- ttwwakeup(com->tp);
- }
- if (com->etc != ETC_NONE) {
- if (com->etc == ETC_BREAK_ENDED)
- com->etc = ETC_NONE;
- wakeup(&com->etc);
- }
- }
if (com->state & CS_ODONE) {
disable_intr();
com_events -= LOTS_OF_EVENTS;
com->state &= ~CS_ODONE;
+ if (!(com->state & CS_BUSY))
+ com->tp->t_state &= ~TS_BUSY;
enable_intr();
(*linesw[tp->t_line].l_start)(tp);
}
@@ -1858,6 +1735,7 @@ comparam(tp, t)
u_long cy_clock;
int idivisor;
int iflag;
+ cy_addr iobase;
int iprescaler;
int itimeout;
int odivisor;
@@ -1883,19 +1761,21 @@ comparam(tp, t)
return (EINVAL);
/* parameters are OK, convert them to the com struct and the device */
+ iobase = com->iobase;
s = spltty();
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
if (odivisor == 0)
(void)commctl(com, TIOCM_DTR, DMBIC); /* hang up line */
else
(void)commctl(com, TIOCM_DTR, DMBIS);
if (idivisor != 0) {
- cd_setreg(com, CD1400_RBPR, idivisor);
- cd_setreg(com, CD1400_RCOR, iprescaler);
+ cd_outb(iobase, CD1400_RBPR, com->cy_align, idivisor);
+ cd_outb(iobase, CD1400_RCOR, com->cy_align, iprescaler);
}
if (odivisor != 0) {
- cd_setreg(com, CD1400_TBPR, odivisor);
- cd_setreg(com, CD1400_TCOR, oprescaler);
+ cd_outb(iobase, CD1400_TBPR, com->cy_align, odivisor);
+ cd_outb(iobase, CD1400_TCOR, com->cy_align, oprescaler);
}
/*
@@ -1908,20 +1788,20 @@ comparam(tp, t)
| (cflag & CREAD ? CD1400_CCR_RCVEN : CD1400_CCR_RCVDIS);
if (opt != com->channel_control) {
com->channel_control = opt;
- cd1400_channel_cmd(com, opt);
+ cd1400_channel_cmd(iobase, opt, com->cy_align);
}
#ifdef Smarts
/* set special chars */
/* XXX if one is _POSIX_VDISABLE, can't use some others */
if (t->c_cc[VSTOP] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR1, t->c_cc[VSTOP]);
+ cd_outb(iobase, CD1400_SCHR1, com->cy_align, t->c_cc[VSTOP]);
if (t->c_cc[VSTART] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR2, t->c_cc[VSTART]);
+ cd_outb(iobase, CD1400_SCHR2, com->cy_align, t->c_cc[VSTART]);
if (t->c_cc[VINTR] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR3, t->c_cc[VINTR]);
+ cd_outb(iobase, CD1400_SCHR3, com->cy_align, t->c_cc[VINTR]);
if (t->c_cc[VSUSP] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR4, t->c_cc[VSUSP]);
+ cd_outb(iobase, CD1400_SCHR4, com->cy_align, t->c_cc[VSUSP]);
#endif
/*
@@ -1968,14 +1848,14 @@ comparam(tp, t)
cor_change = 0;
if (opt != com->cor[0]) {
cor_change |= CD1400_CCR_COR1;
- cd_setreg(com, CD1400_COR1, com->cor[0] = opt);
+ cd_outb(iobase, CD1400_COR1, com->cy_align, com->cor[0] = opt);
}
/*
* Set receive time-out period, normally to max(one char time, 5 ms).
*/
if (t->c_ispeed == 0)
- itimeout = cd_getreg(com, CD1400_RTPR);
+ itimeout = cd_inb(iobase, CD1400_RTPR, com->cy_align);
else {
itimeout = (1000 * bits + t->c_ispeed - 1) / t->c_ispeed;
#ifdef SOFT_HOTCHAR
@@ -1991,7 +1871,7 @@ comparam(tp, t)
itimeout = t->c_cc[VTIME] * 10;
if (itimeout > 255)
itimeout = 255;
- cd_setreg(com, CD1400_RTPR, itimeout);
+ cd_outb(iobase, CD1400_RTPR, com->cy_align, itimeout);
/*
* set channel option register 2 -
@@ -2008,12 +1888,10 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_COR2_CCTS_OFLOW;
#endif
- disable_intr();
if (opt != com->cor[1]) {
cor_change |= CD1400_CCR_COR2;
- cd_setreg(com, CD1400_COR2, com->cor[1] = opt);
+ cd_outb(iobase, CD1400_COR2, com->cy_align, com->cor[1] = opt);
}
- enable_intr();
/*
* set channel option register 3 -
@@ -2030,12 +1908,13 @@ comparam(tp, t)
#endif
if (opt != com->cor[2]) {
cor_change |= CD1400_CCR_COR3;
- cd_setreg(com, CD1400_COR3, com->cor[2] = opt);
+ cd_outb(iobase, CD1400_COR3, com->cy_align, com->cor[2] = opt);
}
/* notify the CD1400 if COR1-3 have changed */
if (cor_change)
- cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | cor_change);
+ cd1400_channel_cmd(iobase, CD1400_CCR_CMDCORCHG | cor_change,
+ com->cy_align);
/*
* set channel option register 4 -
@@ -2058,12 +1937,8 @@ comparam(tp, t)
opt |= CD1400_COR4_INLCR;
#endif
if (iflag & IGNBRK)
- opt |= CD1400_COR4_IGNBRK | CD1400_COR4_NOBRKINT;
- /*
- * The `-ignbrk -brkint parmrk' case is not handled by the hardware,
- * so only tell the hardware about -brkint if -parmrk.
- */
- if (!(iflag & (BRKINT | PARMRK)))
+ opt |= CD1400_COR4_IGNBRK;
+ if (!(iflag & BRKINT))
opt |= CD1400_COR4_NOBRKINT;
#if 0
/* XXX using this "intelligence" breaks reporting of overruns. */
@@ -2078,7 +1953,7 @@ comparam(tp, t)
#else
opt |= CD1400_COR4_PFO_EXCEPTION;
#endif
- cd_setreg(com, CD1400_COR4, opt);
+ cd_outb(iobase, CD1400_COR4, com->cy_align, opt);
/*
* set channel option register 5 -
@@ -2095,7 +1970,7 @@ comparam(tp, t)
if (t->c_oflag & OCRNL)
opt |= CD1400_COR5_OCRNL;
#endif
- cd_setreg(com, CD1400_COR5, opt);
+ cd_outb(iobase, CD1400_COR5, com->cy_align, opt);
/*
* We always generate modem status change interrupts for CD changes.
@@ -2117,7 +1992,7 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_MCOR1_CTSzd;
#endif
- cd_setreg(com, CD1400_MCOR1, opt);
+ cd_outb(iobase, CD1400_MCOR1, com->cy_align, opt);
/*
* set modem change option register 2
@@ -2128,7 +2003,7 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_MCOR2_CTSod;
#endif
- cd_setreg(com, CD1400_MCOR2, opt);
+ cd_outb(iobase, CD1400_MCOR2, com->cy_align, opt);
/*
* XXX should have done this long ago, but there is too much state
@@ -2156,8 +2031,8 @@ comparam(tp, t)
#if 0
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
}
@@ -2188,16 +2063,12 @@ comparam(tp, t)
#endif
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
if (!(com->intr_enable & CD1400_SRER_TXRDY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable |= CD1400_SRER_TXRDY);
} else {
if (com->intr_enable & CD1400_SRER_TXRDY)
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable &= ~CD1400_SRER_TXRDY);
}
enable_intr();
@@ -2211,6 +2082,7 @@ comstart(tp)
struct tty *tp;
{
struct com_s *com;
+ cy_addr iobase;
int s;
#ifdef CyDebug
bool_t started;
@@ -2219,6 +2091,7 @@ comstart(tp)
unit = DEV_TO_UNIT(tp->t_dev);
com = com_addr(unit);
+ iobase = com->iobase;
s = spltty();
#ifdef CyDebug
@@ -2227,29 +2100,26 @@ comstart(tp)
#endif
disable_intr();
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
if (tp->t_state & TS_TTSTOP) {
com->state &= ~CS_TTGO;
if (com->intr_enable & CD1400_SRER_TXRDY)
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable &= ~CD1400_SRER_TXRDY);
} else {
com->state |= CS_TTGO;
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)
&& !(com->intr_enable & CD1400_SRER_TXRDY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable |= CD1400_SRER_TXRDY);
}
if (tp->t_state & TS_TBLOCK) {
if (com->mcr_image & com->mcr_rts && com->state & CS_RTS_IFLOW)
#if 0
outb(com->modem_ctl_port, com->mcr_image &= ~MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image &= ~com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image &= ~com->mcr_rts);
#endif
} else {
if (!(com->mcr_image & com->mcr_rts)
@@ -2258,8 +2128,8 @@ comstart(tp)
#if 0
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
}
enable_intr();
@@ -2294,11 +2164,10 @@ comstart(tp)
com->state |= CS_BUSY;
if (com->state >= (CS_BUSY | CS_TTGO
| CS_ODEVREADY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER,
+ com->cy_align,
+ com->intr_enable
+ |= CD1400_SRER_TXRDY);
}
enable_intr();
}
@@ -2324,11 +2193,10 @@ comstart(tp)
com->state |= CS_BUSY;
if (com->state >= (CS_BUSY | CS_TTGO
| CS_ODEVREADY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER,
+ com->cy_align,
+ com->intr_enable
+ |= CD1400_SRER_TXRDY);
}
enable_intr();
}
@@ -2354,39 +2222,25 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
- bool_t wakeup_etc;
com = com_addr(DEV_TO_UNIT(tp->t_dev));
- wakeup_etc = FALSE;
disable_intr();
if (rw & FWRITE) {
com->obufs[0].l_queued = FALSE;
com->obufs[1].l_queued = FALSE;
- if (com->extra_state & CSE_ODONE) {
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- if (com->etc != ETC_NONE) {
- if (com->etc == ETC_BREAK_ENDED)
- com->etc = ETC_NONE;
- wakeup_etc = TRUE;
- }
- }
- com->tp->t_state &= ~TS_BUSY;
if (com->state & CS_ODONE)
com_events -= LOTS_OF_EVENTS;
com->state &= ~(CS_ODONE | CS_BUSY);
+ com->tp->t_state &= ~TS_BUSY;
}
if (rw & FREAD) {
- /* XXX no way to reset only input fifo. */
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
enable_intr();
- if (wakeup_etc)
- wakeup(&com->etc);
- if (rw & FWRITE && com->etc == ETC_NONE)
- cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
comstart(tp);
+
+ /* XXX should clear h/w fifos too. */
}
static struct tty *
@@ -2411,9 +2265,11 @@ commctl(com, bits, how)
int bits;
int how;
{
+ cy_addr iobase;
int mcr;
int msr;
+ iobase = com->iobase;
if (how == DMGET) {
if (com->channel_control & CD1400_CCR_RCVEN)
bits |= TIOCM_LE;
@@ -2432,7 +2288,7 @@ commctl(com, bits, how)
* reading the status register doesn't clear pending modem
* status change interrupts.
*/
- msr = cd_getreg(com, CD1400_MSVR2);
+ msr = cd_inb(iobase, CD1400_MSVR2, com->cy_align);
if (msr & MSR_CTS)
bits |= TIOCM_CTS;
@@ -2454,18 +2310,18 @@ commctl(com, bits, how)
switch (how) {
case DMSET:
com->mcr_image = mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
case DMBIS:
com->mcr_image = mcr = com->mcr_image | mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
case DMBIC:
com->mcr_image = mcr = com->mcr_image & ~mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
}
enable_intr();
@@ -2574,6 +2430,7 @@ disc_optim(tp, t, com)
struct com_s *com;
{
#ifndef SOFT_HOTCHAR
+ cy_addr iobase;
u_char opt;
#endif
@@ -2593,15 +2450,19 @@ disc_optim(tp, t, com)
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
com->hotchar = linesw[tp->t_line].l_hotchar;
#ifndef SOFT_HOTCHAR
+ iobase = com->iobase;
+ cd_outb(iobase, CD1400_CAR, com->cy_align, com->unit & CD1400_CAR_CHAN);
opt = com->cor[2] & ~CD1400_COR3_SCD34;
if (com->hotchar != 0) {
- cd_setreg(com, CD1400_SCHR3, com->hotchar);
- cd_setreg(com, CD1400_SCHR4, com->hotchar);
+ cd_outb(iobase, CD1400_SCHR3, com->cy_align, com->hotchar);
+ cd_outb(iobase, CD1400_SCHR4, com->cy_align, com->hotchar);
opt |= CD1400_COR3_SCD34;
}
if (opt != com->cor[2]) {
- cd_setreg(com, CD1400_COR3, com->cor[2] = opt);
- cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | CD1400_CCR_COR3);
+ cd_outb(iobase, CD1400_COR3, com->cy_align, com->cor[2] = opt);
+ cd1400_channel_cmd(com->iobase,
+ CD1400_CCR_CMDCORCHG | CD1400_CCR_COR3,
+ com->cy_align);
}
#endif
}
@@ -2668,129 +2529,27 @@ comspeed(speed, cy_clock, prescaler_io)
}
static void
-cd1400_channel_cmd(com, cmd)
- struct com_s *com;
- int cmd;
-{
- cd1400_channel_cmd_wait(com);
- cd_setreg(com, CD1400_CCR, cmd);
- cd1400_channel_cmd_wait(com);
-}
-
-static void
-cd1400_channel_cmd_wait(com)
- struct com_s *com;
-{
- struct timeval start;
- struct timeval tv;
- long usec;
-
- if (cd_getreg(com, CD1400_CCR) == 0)
- return;
- microtime(&start);
- for (;;) {
- if (cd_getreg(com, CD1400_CCR) == 0)
- return;
- microtime(&tv);
- usec = 1000000 * (tv.tv_sec - start.tv_sec) +
- tv.tv_usec - start.tv_usec;
- if (usec >= 5000) {
- log(LOG_ERR,
- "cy%d: channel command timeout (%ld usec)\n",
- com->unit, usec);
- return;
- }
- }
-}
-
-static void
-cd_etc(com, etc)
- struct com_s *com;
- int etc;
-{
- /*
- * We can't change the hardware's ETC state while there are any
- * characters in the tx fifo, since those characters would be
- * interpreted as commands! Unputting characters from the fifo
- * is difficult, so we wait up to 12 character times for the fifo
- * to drain. The command will be delayed for up to 2 character
- * times for the tx to become empty. Unputting characters from
- * the tx holding and shift registers is impossible, so we wait
- * for the tx to become empty so that the command is sure to be
- * executed soon after we issue it.
- */
- disable_intr();
- if (com->etc == etc) {
- enable_intr();
- goto wait;
- }
- if (etc == CD1400_ETC_SENDBREAK
- && (com->etc == ETC_BREAK_STARTING
- || com->etc == ETC_BREAK_STARTED)
- || etc == CD1400_ETC_STOPBREAK
- && (com->etc == ETC_BREAK_ENDING || com->etc == ETC_BREAK_ENDED
- || com->etc == ETC_NONE)) {
- enable_intr();
- return;
- }
- com->etc = etc;
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY | CD1400_SRER_TXMPTY);
- enable_intr();
-wait:
- while (com->etc == etc
- && tsleep(&com->etc, TTIPRI | PCATCH, "cyetc", 0) == 0)
- continue;
-}
-
-static int
-cd_getreg(com, reg)
- struct com_s *com;
- int reg;
-{
- struct com_s *basecom;
- u_char car;
- int cy_align;
- u_long ef;
+cd1400_channel_cmd(iobase, cmd, cy_align)
cy_addr iobase;
- int val;
-
- basecom = com_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1));
- car = com->unit & CD1400_CAR_CHAN;
- cy_align = com->cy_align;
- iobase = com->iobase;
- ef = read_eflags();
- disable_intr();
- if (basecom->car != car)
- cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car);
- val = cd_inb(iobase, reg, cy_align);
- write_eflags(ef);
- return (val);
-}
-
-static void
-cd_setreg(com, reg, val)
- struct com_s *com;
- int reg;
- int val;
-{
- struct com_s *basecom;
- u_char car;
+ int cmd;
int cy_align;
- u_long ef;
- cy_addr iobase;
-
- basecom = com_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1));
- car = com->unit & CD1400_CAR_CHAN;
- cy_align = com->cy_align;
- iobase = com->iobase;
- ef = read_eflags();
- disable_intr();
- if (basecom->car != car)
- cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car);
- cd_outb(iobase, reg, cy_align, val);
- write_eflags(ef);
+{
+ /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed,
+ as the card is probed every round? Replaced delaycount with 8k.
+ Either delaycount has to be implemented in FreeBSD or more sensible
+ way of doing these should be implemented. DELAY isn't enough here.
+ */
+ u_int maxwait = 5 * 8 * 1024; /* approx. 5 ms */
+
+ /* wait for processing of previous command to complete */
+ while (cd_inb(iobase, CD1400_CCR, cy_align) && maxwait--)
+ ;
+
+ if (!maxwait)
+ log(LOG_ERR, "cy: channel command timeout (%d loops) - arrgh\n",
+ 5 * 8 * 1024);
+
+ cd_outb(iobase, CD1400_CCR, cy_align, cmd);
}
#ifdef CyDebug
@@ -2814,15 +2573,17 @@ cystatus(unit)
iobase = com->iobase;
printf("\n");
printf("cd1400 base address:\\tt%p\n", iobase);
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
printf("saved channel_control:\t\t0x%02x\n", com->channel_control);
printf("saved cor1-3:\t\t\t0x%02x 0x%02x 0x%02x\n",
com->cor[0], com->cor[1], com->cor[2]);
printf("service request enable reg:\t0x%02x (0x%02x cached)\n",
- cd_getreg(com, CD1400_SRER), com->intr_enable);
+ cd_inb(iobase, CD1400_SRER, com->cy_align), com->intr_enable);
printf("service request register:\t0x%02x\n",
cd_inb(iobase, CD1400_SVRR, com->cy_align));
printf("modem status:\t\t\t0x%02x (0x%02x cached)\n",
- cd_getreg(com, CD1400_MSVR2), com->prev_modem_status);
+ cd_inb(iobase, CD1400_MSVR2, com->cy_align),
+ com->prev_modem_status);
printf("rx/tx/mdm interrupt registers:\t0x%02x 0x%02x 0x%02x\n",
cd_inb(iobase, CD1400_RIR, com->cy_align),
cd_inb(iobase, CD1400_TIR, com->cy_align),
diff --git a/sys/i386/isa/cyreg.h b/sys/i386/isa/cyreg.h
index baedda4175b2..d98cfd80ece0 100644
--- a/sys/i386/isa/cyreg.h
+++ b/sys/i386/isa/cyreg.h
@@ -26,50 +26,32 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cyreg.h,v 1.7 1998/08/13 19:03:22 bde Exp $
+ * $Id: cyreg.h,v 1.6 1998/08/13 13:54:10 bde Exp $
*/
/*
* Definitions for Cyclades Cyclom-Y serial boards.
*/
-/*
- * Cyclades register offsets. These are physical offsets for ISA boards
- * and physical offsets divided by 2 for PCI boards.
- */
-#define CY8_SVCACKR 0x100 /* (r) */
-#define CY8_SVCACKT 0x200 /* (r) */
-#define CY8_SVCACKM 0x300 /* (r) */
-#define CY16_RESET 0x1400 /* (r) */
-#define CY_CLEAR_INTR 0x1800 /* intr ack address (w) */
+#define CY8_SVCACKR 0x100
+#define CY8_SVCACKT 0x200
+#define CY8_SVCACKM 0x300
+#define CY16_RESET 0x0a00
+#define CY_CLEAR_INTR 0x0c00 /* intr ack address */
#define CY_MAX_CD1400s 8 /* for Cyclom-32Y */
#define CY_CLOCK(version) ((version) >= 0x48 ? 60000000 : 25000000)
#define CY_RTS_DTR_SWAPPED(version) ((version) >= 0x48)
-/*
- * The `cd' macros are for access to cd1400 registers. The `cy' macros
- * are for access to Cyclades registers. Both sets of macros scale the
- * register number to get an offset, but the scales are different for
- * mostly historical reasons.
- */
#ifdef CyDebug
-#define cd_inb(iobase, reg, cy_align) \
- (++cd_inbs, *((iobase) + (2 * (reg) << (cy_align))))
-#define cy_inb(iobase, reg, cy_align) \
- (++cy_inbs, *((iobase) + ((reg) << (cy_align))))
-#define cd_outb(iobase, reg, cy_align, val) \
- (++cd_outbs, (void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, cy_align, val) \
- (++cy_outbs, (void)(*((iobase) + ((reg) << (cy_align))) = (val)))
+#define cd_inb(iobase, reg, cy_align) (++cd_inbs, *((iobase) + ((reg)*2 << (cy_align))))
+#define cy_inb(iobase, reg) (++cy_inbs, *((iobase) + (reg)))
+#define cd_outb(iobase, reg, cy_align, val) (++cd_outbs, (void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, val) (++cy_outbs, (void)(*((iobase) + (reg)) = (val)))
#else
-#define cd_inb(iobase, reg, cy_align) \
- (*((iobase) + (2 * (reg) << (cy_align))))
-#define cy_inb(iobase, reg, cy_align) \
- (*((iobase) + ((reg) << (cy_align))))
-#define cd_outb(iobase, reg, cy_align, val) \
- ((void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, cy_align, val) \
- ((void)(*((iobase) + ((reg) << (cy_align))) = (val)))
+#define cd_inb(iobase, reg, cy_align) (*((iobase) + ((reg)*2 << (cy_align))))
+#define cy_inb(iobase, reg) (*((iobase) + (reg)))
+#define cd_outb(iobase, reg, cy_align, val) ((void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, val) ((void)(*((iobase) + (reg)) = (val)))
#endif
diff --git a/sys/i386/isa/diskslice_machdep.c b/sys/i386/isa/diskslice_machdep.c
index adfd39c52e94..ab9d4bac6948 100644
--- a/sys/i386/isa/diskslice_machdep.c
+++ b/sys/i386/isa/diskslice_machdep.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: diskslice_machdep.c,v 1.31 1998/08/10 07:22:14 phk Exp $
+ * $Id: diskslice_machdep.c,v 1.30 1998/07/25 16:35:06 bde Exp $
*/
#include <sys/param.h>
@@ -405,7 +405,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index 9972a38f5c35..d04f98a1f388 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.c
@@ -5,10 +5,6 @@
* This code is derived from software contributed to Berkeley by
* Don Ahn.
*
- * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)
- * aided by the Linux floppy driver modifications from David Bateman
- * (dbateman@eng.uts.edu.au).
- *
* Copyright (c) 1993, 1994 by
* jc@irbs.UUCP (John Capo)
* vak@zebub.msk.su (Serge Vakulenko)
@@ -47,10 +43,14 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.131 1999/01/15 09:15:27 bde Exp $
+ * $Id: fd.c,v 1.122 1998/09/15 08:15:28 gibbs Exp $
*
*/
+#include "ft.h"
+#if NFT < 1
+#undef NFDC
+#endif
#include "fd.h"
#include "opt_devfs.h"
#include "opt_fdc.h"
@@ -76,6 +76,10 @@
#include <i386/isa/fdc.h>
#include <i386/isa/rtc.h>
#include <machine/stdarg.h>
+#if NFT > 0
+#include <sys/ftape.h>
+#include <i386/isa/ftreg.h>
+#endif
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -85,10 +89,6 @@
/* configuration flags */
#define FDC_PRETEND_D0 (1 << 0) /* pretend drive 0 to be there */
-#ifdef FDC_YE
-#define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's
- a PCMCIA device */
-#endif
/* internally used only, not really from CMOS: */
#define RTCFDT_144M_PRETENDED 0x1000
@@ -190,9 +190,15 @@ static struct fd_data {
* fdsu is the floppy drive unit number on that controller. (sub-unit) *
\***********************************************************************/
-#ifdef FDC_YE
-#include "card.h"
-static int yeattach(struct isa_device *);
+#if NFT > 0
+int ftopen(dev_t, int);
+int ftintr(ftu_t ftu);
+int ftclose(dev_t, int);
+void ftstrategy(struct buf *);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftdump(dev_t);
+int ftsize(dev_t);
+int ftattach(struct isa_device *, struct isa_device *, int);
#endif
/* autoconfig functions */
@@ -215,7 +221,6 @@ static int fd_in(fdcu_t, int *);
static void fdstart(fdcu_t);
static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
-static ointhand2_t fdintr;
static int fdstate(fdcu_t, fdc_p);
static int retrier(fdcu_t);
static int fdformat(dev_t, struct fd_formb *, struct proc *);
@@ -238,9 +243,6 @@ static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
#define MOTORWAIT 10
#define IOTIMEDOUT 11
#define RESETCOMPLETE 12
-#ifdef FDC_YE
-#define PIOREAD 13
-#endif
#ifdef FDC_DEBUG
static char const * const fdstates[] =
@@ -258,9 +260,6 @@ static char const * const fdstates[] =
"MOTORWAIT",
"IOTIMEDOUT",
"RESETCOMPLETE",
-#ifdef FDC_YE
-"PIOREAD",
-#endif
};
/* CAUTION: fd_debug causes huge amounts of logging output */
@@ -272,91 +271,6 @@ static int volatile fd_debug = 0;
#define TRACE1(arg1, arg2)
#endif /* FDC_DEBUG */
-#ifdef FDC_YE
-#if NCARD > 0
-#include <sys/select.h>
-#include <sys/module.h>
-#include <pccard/cardinfo.h>
-#include <pccard/driver.h>
-#include <pccard/slot.h>
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int yeinit(struct pccard_devinfo *); /* init device */
-static void yeunload(struct pccard_devinfo *); /* Disable driver */
-static int yeintr(struct pccard_devinfo *); /* Interrupt handler */
-
-PCCARD_MODULE(fdc, yeinit, yeunload, yeintr, 0, bio_imask);
-
-/*
- * this is the secret PIO data port (offset from base)
- */
-#define FDC_YE_DATAPORT 6
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int yeinit(struct pccard_devinfo *devi)
-{
- fdc_p fdc = &fdc_data[devi->isahd.id_unit];
-
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFDC)
- return(ENODEV);
- fdc->baseport = devi->isahd.id_iobase;
- /*
- * reset controller
- */
- outb(fdc->baseport+FDOUT, 0);
- DELAY(100);
- outb(fdc->baseport+FDOUT, FDO_FRST);
-
- /*
- * wire into system
- */
- if (yeattach(&devi->isahd) == 0)
- return(ENXIO);
-
- return(0);
-}
-
-/*
- * yeunload - unload the driver and clear the table.
- * XXX TODO:
- * This is usually called when the card is ejected, but
- * can be caused by a modunload of a controller driver.
- * The idea is to reset the driver's view of the device
- * and ensure that any driver entry points such as
- * read and write do not hang.
- */
-static void yeunload(struct pccard_devinfo *devi)
-{
- if (fd_data[devi->isahd.id_unit].type == NO_TYPE)
- return;
-
- /*
- * this prevents Fdopen() and fdstrategy() from attempting
- * to access unloaded controller
- */
- fd_data[devi->isahd.id_unit].type = NO_TYPE;
-
- printf("fdc%d: unload\n", devi->isahd.id_unit);
-}
-
-/*
- * yeintr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int yeintr(struct pccard_devinfo *devi)
-{
- fdintr((fdcu_t)devi->isahd.id_unit);
- return(1);
-}
-#endif /* NCARD > 0 */
-#endif /* FDC_YE */
-
-
/* autoconfig structure */
struct isa_driver fdcdriver = {
@@ -395,7 +309,7 @@ fdc_err(fdcu_t fdcu, const char *s)
printf("fdc%d: %s", fdcu, s);
else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
printf("fdc%d: too many errors, not logging any more\n",
- fdcu);
+ fdcu);
}
return FD_FAILED;
@@ -425,7 +339,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (out_fdc(fdcu, va_arg(ap, int)) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %x failed at out byte %d of %d\n",
cmd, n + 1, n_out);
return fdc_err(fdcu, msg);
@@ -438,7 +352,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (fd_in(fdcu, ptr) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %02x failed at in byte %d of %d\n",
cmd, n + 1, n_in);
return fdc_err(fdcu, msg);
@@ -600,14 +514,6 @@ fdprobe(struct isa_device *dev)
{
return(0);
}
-#ifdef FDC_YE
- /*
- * don't succeed on probe; wait
- * for PCCARD subsystem to do it
- */
- if (dev->id_flags & FDC_IS_PCMCIA)
- return(0);
-#endif
return (IO_FDCSIZE);
}
@@ -623,6 +529,9 @@ fdattach(struct isa_device *dev)
fdc_p fdc = fdc_data + fdcu;
fd_p fd;
int fdsu, st0, st3, i;
+#if NFT > 0
+ int unithasfd;
+#endif
struct isa_device *fdup;
int ic_type = 0;
#ifdef DEVFS
@@ -631,7 +540,6 @@ fdattach(struct isa_device *dev)
int typesize;
#endif
- dev->id_ointr = fdintr;
fdc->fdcu = fdcu;
fdc->flags |= FDC_ATTACHED;
fdc->dmachan = dev->id_drq;
@@ -649,7 +557,7 @@ fdattach(struct isa_device *dev)
continue;
fdu = fdup->id_unit;
fd = &fd_data[fdu];
- if (fdu >= (NFD))
+ if (fdu >= (NFD+NFT))
continue;
fdsu = fdup->id_physid;
/* look up what bios thinks we have */
@@ -666,8 +574,26 @@ fdattach(struct isa_device *dev)
}
/* is there a unit? */
if ((fdt == RTCFDT_NONE)
+#if NFT > 0
+ || (fdsu >= DRVS_PER_CTLR)) {
+#else
) {
fd->type = NO_TYPE;
+#endif
+#if NFT > 0
+ /* If BIOS says no floppy, or > 2nd device */
+ /* Probe for and attach a floppy tape. */
+ /* Tell FT if there was already a disk */
+ /* with this unit number found. */
+
+ unithasfd = 0;
+ if (fdu < NFD && fd->type != NO_TYPE)
+ unithasfd = 1;
+ if (ftattach(dev, fdup, unithasfd))
+ continue;
+ if (fdsu < DRVS_PER_CTLR)
+ fd->type = NO_TYPE;
+#endif
continue;
}
@@ -713,7 +639,7 @@ fdattach(struct isa_device *dev)
enable_fifo(fdc) == 0) {
printf("fdc%d: FIFO enabled", fdcu);
printf(", %d bytes threshold\n",
- fifo_threshold);
+ fifo_threshold);
}
}
if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
@@ -856,10 +782,10 @@ fdattach(struct isa_device *dev)
}
for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
+ fd->bdevs[1 + NUMDENS + i] = devfs_link(fd->bdevs[0],
"fd%d%c", fdu, 'a' + i);
fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
+ devfs_link(fd->cdevs[0],
"rfd%d%c", fdu, 'a' + i);
}
#endif /* DEVFS */
@@ -878,138 +804,6 @@ fdattach(struct isa_device *dev)
-#ifdef FDC_YE
-/*
- * this is a subset of fdattach() optimized for the Y-E Data
- * PCMCIA floppy drive.
- */
-static int yeattach(struct isa_device *dev)
-{
- fdcu_t fdcu = dev->id_unit;
- fdc_p fdc = fdc_data + fdcu;
- fdsu_t fdsu = 0; /* assume 1 drive per YE controller */
- fdu_t fdu;
- fd_p fd;
- int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
- fdc->fdcu = fdcu;
- /*
- * the FDC_PCMCIA flag is used to to indicate special PIO is used
- * instead of DMA
- */
- fdc->flags = FDC_ATTACHED|FDC_PCMCIA;
- fdc->state = DEVIDLE;
- /* reset controller, turn motor off, clear fdout mirror reg */
- outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
- bufq_init(&fdc->head);
- /*
- * assume 2 drives/ "normal" controller
- */
- fdu = fdcu * 2;
- if (fdu >= NFD) {
- printf("fdu %d >= NFD\n",fdu);
- return(0);
- };
- fd = &fd_data[fdu];
-
- set_motor(fdcu, fdsu, TURNON);
- DELAY(1000000); /* 1 sec */
- fdc->fdct = FDC_NE765;
-
- if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
- (st3 & NE7_ST3_T0)) {
- /* if at track 0, first seek inwards */
- /* seek some steps: */
- (void)fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0);
- DELAY(300000); /* ...wait a moment... */
- (void)fd_sense_int(fdc, 0, 0); /* make ctrlr happy */
- }
-
- /* If we're at track 0 first seek inwards. */
- if ((fd_sense_drive_status(fdc, &st3) == 0) && (st3 & NE7_ST3_T0)) {
- /* Seek some steps... */
- if (fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0) == 0) {
- /* ...wait a moment... */
- DELAY(300000);
- /* make ctrlr happy: */
- (void)fd_sense_int(fdc, 0, 0);
- }
- }
-
- for(i = 0; i < 2; i++) {
- /*
- * we must recalibrate twice, just in case the
- * heads have been beyond cylinder 76, since most
- * FDCs still barf when attempting to recalibrate
- * more than 77 steps
- */
- /* go back to 0: */
- if (fd_cmd(fdcu, 2, NE7CMD_RECAL, fdsu, 0) == 0) {
- /* a second being enough for full stroke seek*/
- DELAY(i == 0? 1000000: 300000);
-
- /* anything responding? */
- if (fd_sense_int(fdc, &st0, 0) == 0 &&
- (st0 & NE7_ST0_EC) == 0)
- break; /* already probed succesfully */
- }
- }
-
- set_motor(fdcu, fdsu, TURNOFF);
-
- if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */
- return(0);
-
- fd->track = FD_NO_TRACK;
- fd->fdc = fdc;
- fd->fdsu = fdsu;
- fd->options = 0;
- printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
- fd->type = FD_1440;
-
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
- return (1);
-}
-#endif
-
/****************************************************************************/
/* motor control stuff */
/* remember to not deselect the drive we're working on */
@@ -1216,6 +1010,11 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p)
int type = FDTYPE(minor(dev));
fdc_p fdc;
+#if NFT > 0
+ /* check for a tape open */
+ if (type & F_TAPE_TYPE)
+ return(ftopen(dev, flags));
+#endif
/* check bounds */
if (fdu >= NFD)
return(ENXIO);
@@ -1289,6 +1088,12 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p)
{
fdu_t fdu = FDUNIT(minor(dev));
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ if (type & F_TAPE_TYPE)
+ return ftclose(dev, flags);
+#endif
fd_data[fdu].flags &= ~FD_OPEN;
fd_data[fdu].options &= ~FDOPT_NORETRY;
@@ -1326,18 +1131,21 @@ fdstrategy(struct buf *bp)
fd = &fd_data[fdu];
fdc = fd->fdc;
fdcu = fdc->fdcu;
-#ifdef FDC_YE
- if (fd->type == NO_TYPE) {
- bp->b_error = ENXIO;
+
+#if NFT > 0
+ if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) {
+ /* ft tapes do not (yet) support strategy i/o */
+ bp->b_error = ENODEV;
bp->b_flags |= B_ERROR;
- /*
- * I _refuse_ to use a goto
- */
- biodone(bp);
- return;
- };
+ goto bad;
+ }
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY) {
+ bp->b_error = EBUSY;
+ bp->b_flags |= B_ERROR;
+ goto bad;
+ }
#endif
-
fdblk = 128 << (fd->ft->secsize);
if (!(bp->b_flags & B_FORMAT)) {
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
@@ -1467,46 +1275,21 @@ fd_pseudointr(void *arg1)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
-static void
+void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
+#if NFT > 0
+ fdu_t fdu = fdc->fdu;
+
+ if (fdc->flags & FDC_TAPE_BUSY)
+ (ftintr(fdu));
+ else
+#endif
while(fdstate(fdcu, fdc))
;
}
-#ifdef FDC_YE
-/*
- * magic pseudo-DMA initialization for YE FDC. Sets count and
- * direction
- */
-#define SET_BCDR(wr,cnt,port) outb(port,(((cnt)-1) & 0xff)); \
- outb(port+1,((wr ? 0x80 : 0) | ((((cnt)-1) >> 8) & 0x7f)))
-
-/*
- * fdcpio(): perform programmed IO read/write for YE PCMCIA floppy
- */
-static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
-{
- u_char *cptr = (u_char *)addr;
- fdc_p fdc = &fdc_data[fdcu];
- int io = fdc->baseport;
-
- if (flags & B_READ) {
- if (fdc->state != PIOREAD) {
- fdc->state = PIOREAD;
- return(0);
- };
- SET_BCDR(0,count,io);
- insb(io+FDC_YE_DATAPORT,cptr,count);
- } else {
- outsb(io+FDC_YE_DATAPORT,cptr,count);
- SET_BCDR(0,count,io);
- };
- return(1);
-}
-#endif /* FDC_YE */
-
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
@@ -1514,6 +1297,7 @@ static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
static int
fdstate(fdcu_t fdcu, fdc_p fdc)
{
+ struct subdev *sd;
int read, format, head, i, sec = 0, sectrac, st0, cyl, st3;
unsigned blknum = 0, b_cylinder = 0;
fdu_t fdu = fdc->fdu;
@@ -1522,15 +1306,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
struct fd_formb *finfo = NULL;
size_t fdblk;
- bp = fdc->bp;
- if (bp == NULL) {
- bp = bufq_first(&fdc->head);
- if (bp != NULL) {
- bufq_remove(&fdc->head, bp);
- fdc->bp = bp;
- }
- }
- if (bp == NULL) {
+ bp = bufq_first(&fdc->head);
+ if(!bp) {
/***********************************************\
* nothing left for this controller to do *
* Force into the IDLE state, *
@@ -1704,11 +1481,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
fd->track = b_cylinder;
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
sectrac = fd->ft->sectrac;
sec = blknum % (sectrac * fd->ft->heads);
head = sec / sectrac;
@@ -1750,12 +1524,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
if(format)
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- bp->b_bcount);
-#endif
/* formatting */
if(fd_cmd(fdcu, 6,
NE7CMD_FORMAT,
@@ -1776,24 +1544,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
else
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA) {
- /*
- * this seems to be necessary even when
- * reading data
- */
- SET_BCDR(1,fdblk,fdc->baseport);
-
- /*
- * perform the write pseudo-DMA before
- * the WRITE command is sent
- */
- if (!read)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- fdblk);
- }
-#endif
if (fd_cmd(fdcu, 9,
(read ? NE7CMD_READ : NE7CMD_WRITE),
head << 2 | fdu, /* head & unit */
@@ -1814,37 +1564,9 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
return(retrier(fdcu));
}
}
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- /*
- * if this is a read, then simply await interrupt
- * before performing PIO
- */
- if (read && !fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,fdblk)) {
- fd->tohandle = timeout(fd_iotimeout,
- (caddr_t)fdcu, hz);
- return(0); /* will return later */
- };
-
- /*
- * write (or format) operation will fall through and
- * await completion interrupt
- */
-#endif
fdc->state = IOCOMPLETE;
fd->tohandle = timeout(fd_iotimeout, (caddr_t)fdcu, hz);
return(0); /* will return later */
-#ifdef FDC_YE
- case PIOREAD:
- /*
- * actually perform the PIO read. The IOCOMPLETE case
- * removes the timeout for us.
- */
- (void)fdcpio(fdcu,bp->b_flags,bp->b_data+fd->skip,fdblk);
- fdc->state = IOCOMPLETE;
- /* FALLTHROUGH */
-#endif
case IOCOMPLETE: /* IO DONE, post-analyze */
untimeout(fd_iotimeout, (caddr_t)fdcu, fd->tohandle);
@@ -1863,11 +1585,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
/* FALLTHROUGH */
case IOTIMEDOUT:
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
if (fdc->status[0] & NE7_ST0_IC)
{
if ((fdc->status[0] & NE7_ST0_IC) == NE7_ST0_IC_AT
@@ -1902,7 +1621,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
{
/* ALL DONE */
fd->skip = 0;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fd->device_stats,
bp->b_bcount - bp->b_resid,
@@ -2022,10 +1741,12 @@ static int
retrier(fdcu)
fdcu_t fdcu;
{
+ struct subdev *sd;
fdc_p fdc = fdc_data + fdcu;
register struct buf *bp;
+ int fdu;
- bp = fdc->bp;
+ bp = bufq_first(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -2069,7 +1790,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid += bp->b_bcount - fdc->fd->skip;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fdc->fd->device_stats,
@@ -2178,6 +1899,14 @@ fdioctl(dev, cmd, addr, flag, p)
char buffer[DEV_BSIZE];
int error = 0;
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ /* check for a tape ioctl */
+ if (type & F_TAPE_TYPE)
+ return ftioctl(dev, cmd, addr, flag, p);
+#endif
+
fdblk = 128 << fd->ft->secsize;
switch (cmd)
diff --git a/sys/i386/isa/fdc.h b/sys/i386/isa/fdc.h
index 43bf9f8f5f4c..fdaf694f8d35 100644
--- a/sys/i386/isa/fdc.h
+++ b/sys/i386/isa/fdc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fdc.h,v 1.12 1998/12/12 08:16:01 imp Exp $
+ * $Id: fdc.h,v 1.10 1998/07/11 06:35:39 bde Exp $
*
*/
@@ -56,10 +56,6 @@ struct fdc_data
#define FDC_STAT_VALID 0x08
#define FDC_HAS_FIFO 0x10
#define FDC_NEEDS_RESET 0x20
-#ifdef FDC_YE
-#define FDC_PCMCIA 0x40
-#define FDC_UNLOADED 0x80
-#endif
struct fd_data *fd;
int fdu; /* the active drive */
int state;
@@ -68,8 +64,7 @@ struct fdc_data
u_int status[7]; /* copy of the registers */
enum fdc_type fdct; /* chip version of FDC */
int fdc_errs; /* number of logged errors */
- struct buf_queue_head head;
- struct buf *bp; /* active buffer */
+ struct buf_queue_head head; /* Head of buf chain */
};
/***********************************************************************\
diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c
new file mode 100644
index 000000000000..2b7fd5fa90e8
--- /dev/null
+++ b/sys/i386/isa/ft.c
@@ -0,0 +1,2580 @@
+/*
+ * Copyright (c) 1993, 1994 Steve Gerakines
+ *
+ * This is freely redistributable software. You may do anything you
+ * wish with it, so long as the above notice stays intact.
+ *
+ * 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.
+ *
+ * ft.c - QIC-40/80 floppy tape driver
+ * $Id: ft.c,v 1.37 1998/04/17 22:36:32 des Exp $
+ *
+ * 01/19/95 ++sg
+ * Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
+ *
+ * 06/07/94 v0.9 ++sg
+ * Tape stuck on segment problem should be gone. Re-wrote buffering
+ * scheme. Added support for drives that do not automatically perform
+ * seek load point. Can handle more wakeup types now and should correctly
+ * report most manufacturer names. Fixed places where unit 0 was being
+ * sent to the fdc instead of the actual unit number. Added ioctl support
+ * for an in-core badmap.
+ *
+ * 01/26/94 v0.3b - Jim Babb
+ * Got rid of the hard coded device selection. Moved (some of) the
+ * static variables into a structure for support of multiple devices.
+ * ( still has a way to go for 2 controllers - but closer )
+ * Changed the interface with fd.c so we no longer 'steal' its
+ * driver routine vectors.
+ *
+ * 10/30/93 v0.3
+ * Fixed a couple more bugs. Reading was sometimes looping when an
+ * an error such as address-mark-missing was encountered. Both
+ * reading and writing was having more backup-and-retries than was
+ * necessary. Added support to get hardware info. Updated for use
+ * with FreeBSD.
+ *
+ * 09/15/93 v0.2 pl01
+ * Fixed a bunch of bugs: extra isa_dmadone() in async_write() (shouldn't
+ * matter), fixed double buffering in async_req(), changed tape_end() in
+ * set_fdcmode() to reduce unexpected interrupts, changed end of track
+ * processing in async_req(), protected more of ftreq_rw() with an
+ * splbio(). Changed some of the ftreq_*() functions so that they wait
+ * for inactivity and then go, instead of aborting immediately.
+ *
+ * 08/07/93 v0.2 release
+ * Shifted from ftstrat to ioctl support for I/O. Streaming is now much
+ * more reliable. Added internal support for error correction, QIC-40,
+ * and variable length tapes. Random access of segments greatly
+ * improved. Formatting and verification support is close but still
+ * incomplete.
+ *
+ * 06/03/93 v0.1 Alpha release
+ * Hopefully the last re-write. Many bugs fixed, many remain.
+ */
+
+#include "ft.h"
+#if NFT > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/disklabel.h> /* temp. for dkunit() in fdc.h */
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/ftape.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#ifdef PC98
+#include <pc98/pc98/fdreg.h>
+#else
+#include <i386/isa/fdreg.h>
+#endif
+#include <i386/isa/fdc.h>
+#include <i386/isa/ftreg.h>
+
+extern int ftintr __P((ftu_t ftu));
+
+/* Enable or disable debugging messages. */
+#define FTDBGALL 0 /* 1 if you want everything */
+/*#define DPRT(a) printf a */
+#define DPRT(a)
+
+/* Constants private to the driver */
+#define FTPRI (PRIBIO) /* sleep priority */
+#define FTNBUFF 9 /* 8 for buffering, 1 for header */
+
+/* The following items are needed from the fd driver. */
+extern int in_fdc(int); /* read fdc registers */
+extern int out_fdc(int, int); /* write fdc registers */
+
+/* Flags in isadev struct */
+#define FT_PROBE 0x1 /* allow for "dangerous" tape probes */
+
+/* Type of tape attached */
+/* use numbers that don't interfere with the possible floppy types */
+#define NO_TYPE 0 /* (same as NO_TYPE in fd.c) */
+
+/* F_TAPE_TYPE must match value in fd.c */
+#define F_TAPE_TYPE 0x020 /* bit for ft->types to indicate tape */
+#define FT_NONE (F_TAPE_TYPE | 0) /* no method required */
+#define FT_MOUNTAIN (F_TAPE_TYPE | 1) /* mountain */
+#define FT_COLORADO (F_TAPE_TYPE | 2) /* colorado */
+#define FT_INSIGHT (F_TAPE_TYPE | 3) /* insight */
+
+/* Mode FDC is currently in: tape or disk */
+enum { FDC_TAPE_MODE, FDC_DISK_MODE };
+
+/* Command we are awaiting completion of */
+enum { FTCMD_NONE, FTCMD_RESET, FTCMD_RECAL, FTCMD_SEEK, FTCMD_READID };
+
+/* Tape interrupt status of current request */
+enum { FTSTS_NONE, FTSTS_SNOOZE, FTSTS_INTERRUPT, FTSTS_TIMEOUT };
+
+/* Tape I/O status */
+enum {
+ FTIO_READY, /* No I/O activity */
+ FTIO_READING, /* Currently reading blocks */
+ FTIO_RDAHEAD, /* Currently reading ahead */
+ FTIO_WRITING /* Buffers are being written */
+};
+
+/* Current tape mode */
+enum {
+ FTM_PRIMARY, /* Primary mode */
+ FTM_VERIFY, /* Verify mode */
+ FTM_FORMAT, /* Format mode */
+ FTM_DIAG1, /* Diagnostic mode 1 */
+ FTM_DIAG2 /* Diagnostic mode 2 */
+};
+
+/* Tape geometries table */
+static QIC_Geom ftgtbl[] = {
+ { 0, 0, "Unformatted", "Unknown", 0, 0, 0, 0, 0 }, /* XXX */
+ { 1, 1, "QIC-40", "205/550", 20, 68, 2176, 128, 21760 },
+ { 1, 2, "QIC-40", "307.5/550", 20, 102, 3264, 128, 32640 },
+ { 1, 3, "QIC-40", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 1, 4, "QIC-40", "1100/550", 20, 365, 11680, 128, 32512 },
+ { 1, 5, "QIC-40", "1100/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 2, 1, "QIC-80", "205/550", 28, 100, 3200, 128, 19200 },
+ { 2, 2, "QIC-80", "307.5/550", 28, 150, 4800, 128, 19200 },
+ { 2, 3, "QIC-80", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 2, 4, "QIC-80", "1100/550", 28, 537, 17184, 128, 32512 },
+ { 2, 5, "QIC-80", "1100/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 1, "QIC-500", "205/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 2, "QIC-500", "307.5/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 3, "QIC-500", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 4, "QIC-500", "1100/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 5, "QIC-500", "1100/900", 0, 0, 0, 0, 0 } /* ??? */
+};
+#define NGEOM (sizeof(ftgtbl) / sizeof(QIC_Geom))
+
+static QIC_Geom *ftg = NULL; /* Current tape's geometry */
+
+/*
+ * things relating to asynchronous commands
+ */
+static int awr_state; /* state of async write */
+static int ard_state; /* state of async read */
+static int arq_state; /* state of async request */
+static int async_retries; /* retries, one per invocation */
+static int async_func; /* function to perform */
+static int async_state; /* state current function is at */
+static int async_arg0; /* up to 3 arguments for async cmds */
+static int async_arg1; /**/
+static int async_arg2; /**/
+static int async_ret; /* return value */
+static struct _astk {
+ int over_func;
+ int over_state;
+ int over_retries;
+ int over_arg0;
+ int over_arg1;
+ int over_arg2;
+} astk[10];
+static struct _astk *astk_ptr = &astk[0]; /* Pointer to stack position */
+
+/* List of valid async (interrupt driven) tape support functions. */
+enum {
+ ACMD_NONE, /* no command */
+ ACMD_SEEK, /* command seek */
+ ACMD_STATUS, /* report status */
+ ACMD_STATE, /* wait for state bits to be true */
+ ACMD_SEEKSTS, /* perform command and wait for status */
+ ACMD_READID, /* read id */
+ ACMD_RUNBLK /* ready tape for I/O on the given block */
+};
+
+/* Call another asyncronous command from within async_cmd(). */
+#define CALL_ACMD(r,f,a,b,c) \
+ astk_ptr->over_retries = async_retries; \
+ astk_ptr->over_func = async_func; \
+ astk_ptr->over_state = (r); \
+ astk_ptr->over_arg0 = async_arg0; \
+ astk_ptr->over_arg1 = async_arg1; \
+ astk_ptr->over_arg2 = async_arg2; \
+ async_func = (f); async_state = 0; async_retries = 0; \
+ async_arg0=(a); async_arg1=(b); async_arg2=(c); \
+ astk_ptr++; \
+ goto restate
+
+/* Perform an asyncronous command from outside async_cmd(). */
+#define ACMD_FUNC(r,f,a,b,c) over_async = (r); astk_ptr = &astk[0]; \
+ async_func = (f); async_state = 0; async_retries = 0; \
+ async_arg0=(a); async_arg1=(b); async_arg2=(c); \
+ async_cmd(ftu); \
+ return
+
+/* Various wait channels */
+static char *wc_buff_avail = "bavail";
+static char *wc_buff_done = "bdone";
+static char *wc_iosts_change = "iochg";
+static char *wc_long_delay = "ldelay";
+static char *wc_intr_wait = "intrw";
+#define ftsleep(wc,to) tsleep((caddr_t)(wc),FTPRI,(wc),(to))
+
+/***********************************************************************\
+* Per controller structure. *
+\***********************************************************************/
+extern struct fdc_data fdc_data[NFDC];
+
+/***********************************************************************\
+* Per tape drive structure. *
+\***********************************************************************/
+static struct ft_data {
+ struct fdc_data *fdc; /* pointer to controller structure */
+ int ftsu; /* this units number on this controller */
+ int type; /* Drive type (Mountain, Colorado) */
+/* QIC_Geom *ftg; */ /* pointer to Current tape's geometry */
+ int flags;
+ int cmd_wait; /* Command we are awaiting completion of */
+ int sts_wait; /* Tape interrupt status of current request */
+ int io_sts; /* Tape I/O status */
+ int mode;
+ int pcn; /* present cylinder number */
+ int attaching; /* true when ft is attaching */
+ unsigned char *xptr; /* pointer to buffer blk to xfer */
+ int xcnt; /* transfer count */
+ int xblk; /* block number to transfer */
+ int xseg; /* segment being transferred */
+ SegReq *segh; /* Current I/O request */
+ SegReq *segt; /* Tail of queued I/O requests */
+ SegReq *doneh; /* Completed I/O request queue */
+ SegReq *donet; /* Completed I/O request tail */
+ SegReq *segfree; /* Free segments */
+ SegReq *hdr; /* Current tape header */
+ int nsegq; /* Segments on request queue */
+ int ndoneq; /* Segments on completed queue */
+ int nfreelist; /* Segments on free list */
+
+ /* the next 3 should be defines in 'flags' */
+ int active; /* TRUE if transfer is active */
+ int rdonly; /* TRUE if tape is read-only */
+ int newcart; /* TRUE if new cartridge detected */
+ int laststs; /* last reported status code */
+ int lastcfg; /* last reported QIC config */
+ int lasterr; /* last QIC error code */
+ int lastpos; /* last known segment number */
+ int moving; /* TRUE if tape is moving */
+ int rid[7]; /* read_id return values */
+ struct callout_handle tohandle;
+} *ft_data[NFT];
+
+/***********************************************************************\
+* Throughout this file the following conventions will be used: *
+* ft is a pointer to the ft_data struct for the drive in question *
+* fdc is a pointer to the fdc_data struct for the controller *
+* ftu is the tape drive unit number *
+* fdcu is the floppy controller unit number *
+* ftsu is the tape drive unit number on that controller. (sub-unit) *
+\***********************************************************************/
+
+
+
+#define id_physid id_scsiid /* this biotab field doubles as a field */
+ /* for the physical unit number on the controller */
+
+int ftopen(dev_t, int);
+int ftclose(dev_t, int);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftattach(struct isa_device *, struct isa_device *, int);
+static timeout_t ft_timeout;
+static void async_cmd(ftu_t);
+static void async_req(ftu_t, int);
+static void async_read(ftu_t, int);
+static void async_write(ftu_t, int);
+static void tape_start(ftu_t, int);
+static void tape_end(ftu_t);
+static void tape_inactive(ftu_t);
+static int tape_cmd(ftu_t, int);
+static int tape_status(ftu_t);
+static int qic_status(ftu_t, int, int);
+static int ftreq_rewind(ftu_t);
+static int ftreq_hwinfo(ftu_t, QIC_HWInfo *);
+
+/*****************************************************************************/
+
+
+/*
+ * Allocate a segment I/O buffer from the free list.
+ */
+static SegReq *
+segio_alloc(ft_p ft)
+{
+ SegReq *r;
+
+ /* Grab first item from free list */
+ if ((r = ft->segfree) != NULL) {
+ ft->segfree = ft->segfree->next;
+ ft->nfreelist--;
+ }
+ DPRT(("segio_alloc: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ return(r);
+}
+
+
+/*
+ * Queue a segment I/O request.
+ */
+static void
+segio_queue(ft_p ft, SegReq *sp)
+{
+ /* Put request on in process queue. */
+ if (ft->segt == NULL)
+ ft->segh = sp;
+ else
+ ft->segt->next = sp;
+ sp->next = NULL;
+ ft->segt = sp;
+ ft->nsegq++;
+ DPRT(("segio_queue: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+}
+
+
+/*
+ * Segment I/O completed, place on correct queue.
+ */
+static void
+segio_done(ft_p ft, SegReq *sp)
+{
+ /* First remove from current I/O queue */
+ ft->segh = sp->next;
+ if (ft->segh == NULL) ft->segt = NULL;
+ ft->nsegq--;
+
+ if (sp->reqtype == FTIO_WRITING) {
+ /* Place on free list */
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ wakeup((caddr_t)wc_buff_avail);
+ DPRT(("segio_done: (w) nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ } else {
+ /* Put on completed I/O queue */
+ if (ft->donet == NULL)
+ ft->doneh = sp;
+ else
+ ft->donet->next = sp;
+ sp->next = NULL;
+ ft->donet = sp;
+ ft->ndoneq++;
+ wakeup((caddr_t)wc_buff_done);
+ DPRT(("segio_done: (r) nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ }
+}
+
+
+/*
+ * Take I/O request from finished queue to free queue.
+ */
+static void
+segio_free(ft_p ft, SegReq *sp)
+{
+ /* First remove from done queue */
+ ft->doneh = sp->next;
+ if (ft->doneh == NULL) ft->donet = NULL;
+ ft->ndoneq--;
+
+ /* Place on free list */
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ wakeup((caddr_t)wc_buff_avail);
+ DPRT(("segio_free: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+}
+
+/*
+ * Probe/attach floppy tapes.
+ */
+int
+ftattach(isadev, fdup, unithasfd)
+ struct isa_device *isadev, *fdup;
+ int unithasfd;
+{
+ fdcu_t fdcu = isadev->id_unit; /* fdc active unit */
+ fdc_p fdc = fdc_data + fdcu; /* pointer to controller structure */
+ ftu_t ftu = fdup->id_unit;
+ ft_p ft;
+ ftsu_t ftsu = fdup->id_physid;
+ QIC_HWInfo hw;
+ char *manu;
+
+ if (ftu >= NFT) return 0;
+ ft = ft_data[ftu] = malloc(sizeof *ft, M_DEVBUF, M_NOWAIT);
+ bzero(ft, sizeof *ft);
+ callout_handle_init(&ft->tohandle);
+
+ /* Probe for tape */
+ ft->attaching = 1;
+ ft->type = NO_TYPE;
+ ft->fdc = fdc;
+ ft->ftsu = ftsu;
+
+ /*
+ * FT_NONE - no method, just do it
+ */
+ tape_start(ftu, 0);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_NONE;
+ ftreq_hwinfo(ftu, &hw);
+ goto out;
+ }
+
+ /*
+ * FT_COLORADO - colorado style
+ */
+ tape_start(ftu, 0);
+ tape_cmd(ftu, QC_COL_ENABLE1);
+ tape_cmd(ftu, QC_COL_ENABLE2 + ftu);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_COLORADO;
+ ftreq_hwinfo(ftu, &hw);
+ tape_cmd(ftu, QC_COL_DISABLE);
+ goto out;
+ }
+
+ /*
+ * FT_MOUNTAIN - mountain style
+ */
+ tape_start(ftu, 0);
+ tape_cmd(ftu, QC_MTN_ENABLE1);
+ tape_cmd(ftu, QC_MTN_ENABLE2);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_MOUNTAIN;
+ ftreq_hwinfo(ftu, &hw);
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ goto out;
+ }
+
+ if(isadev->id_flags & FT_PROBE) {
+ /*
+ * Insight probe is dangerous, since it requires the motor being
+ * enabled and therefore risks attached floppy disk drives to jam.
+ * Probe only if explicitly requested by a flag 0x1 from config
+ */
+
+ /*
+ * FT_INSIGHT - insight style
+ *
+ * Since insight requires turning the drive motor on, we will not
+ * perform this probe if a floppy drive was already found with the
+ * the given unit and controller.
+ */
+ if (unithasfd) goto out;
+ tape_start(ftu, 1);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_INSIGHT;
+ ftreq_hwinfo(ftu, &hw);
+ goto out;
+ }
+ }
+
+out:
+ tape_end(ftu);
+ if (ft->type != NO_TYPE) {
+ fdc->flags |= FDC_HASFTAPE;
+ switch(hw.hw_make) {
+ case 0x0000:
+ if (ft->type == FT_COLORADO) {
+ manu = "Colorado";
+ } else if (ft->type == FT_INSIGHT) {
+ manu = "Insight";
+ } else if (ft->type == FT_MOUNTAIN && hw.hw_model == 0x05) {
+ manu = "Archive";
+ } else if (ft->type == FT_MOUNTAIN) {
+ manu = "Mountain";
+ } else {
+ manu = "Unknown";
+ }
+ break;
+ case 0x0001:
+ manu = "Colorado";
+ break;
+ case 0x0005:
+ if (hw.hw_model >= 0x09) {
+ manu = "Conner";
+ } else {
+ manu = "Archive";
+ }
+ break;
+ case 0x0006:
+ manu = "Mountain";
+ break;
+ case 0x0007:
+ manu = "Wangtek";
+ break;
+ case 0x0222:
+ manu = "IOMega";
+ break;
+ default:
+ manu = "Unknown";
+ break;
+ }
+ printf("ft%d: %s tape\n", fdup->id_unit, manu);
+ }
+ ft->attaching = 0;
+ return(ft->type);
+}
+
+
+/*
+ * Perform common commands asynchronously.
+ */
+static void
+async_cmd(ftu_t ftu) {
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu;
+ int cmd, i, st0, st3, pcn;
+ static int bitn, retval, retpos, nbits, newcn;
+ static int wanttrk, wantblk, wantdir;
+ static int curtrk, curblk, curdir, curdiff;
+ static int errcnt = 0;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_cmd state: func: %d state: %d\n", async_func, async_state));
+#endif
+ switch(async_func) {
+ case ACMD_SEEK:
+ /*
+ * Arguments:
+ * 0 - command to perform
+ */
+ switch (async_state) {
+ case 0:
+ cmd = async_arg0;
+#if FTDBGALL
+ DPRT(("===>async_seek cmd = %d\n", cmd));
+#endif
+ newcn = (cmd <= ft->pcn) ? ft->pcn - cmd : ft->pcn + cmd;
+ async_state = 1;
+ i = 0;
+ if (out_fdc(fdcu, NE7CMD_SEEK) < 0) i = 1;
+ if (!i && out_fdc(fdcu, ftu) < 0) i = 1;
+ if (!i && out_fdc(fdcu, newcn) < 0) i = 1;
+ if (i) {
+ if (++async_retries >= 10) {
+ DPRT(("ft%d: async_cmd command seek failed!!\n", ftu));
+ goto complete;
+ }
+ DPRT(("ft%d: async_cmd command seek retry...\n",ftu));
+ async_state = 0;
+ goto restate;
+ }
+ break;
+ case 1:
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ pcn = in_fdc(fdcu);
+ if (st0 < 0 || pcn < 0 || newcn != pcn) {
+ if (++async_retries >= 10) {
+ DPRT(("ft%d: async_cmd seek retries exceeded\n",ftu));
+ goto complete;
+ }
+ DPRT(("ft%d: async_cmd command bad st0=$%02x pcn=$%02x\n",
+ ftu, st0, pcn));
+ async_state = 0;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10);
+ break;
+ }
+ if (st0 & 0x20) { /* seek done */
+ ft->pcn = pcn;
+ }
+#if FTDBGALL
+ else
+ DPRT(("ft%d: async_seek error st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn));
+#endif
+ if (async_arg1) goto complete;
+ async_state = 2;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/50);
+ break;
+ case 2:
+ goto complete;
+ /* NOTREACHED */
+ }
+ break;
+
+ case ACMD_STATUS:
+ /*
+ * Arguments:
+ * 0 - command to issue report from
+ * 1 - number of bits
+ * modifies: bitn, retval, st3
+ */
+ switch (async_state) {
+ case 0:
+ bitn = 0;
+ retval = 0;
+ cmd = async_arg0;
+ nbits = async_arg1;
+ DPRT(("async_status got cmd = %d nbits = %d\n", cmd,nbits));
+ CALL_ACMD(5, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ /* NOTREACHED */
+ case 1:
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+ if (st3 < 0) {
+ DPRT(("ft%d: async_status timed out on bit %d r=$%02x\n",
+ ftu,bitn,retval));
+ async_ret = -1;
+ goto complete;
+ }
+ if ((st3 & 0x10) != 0) retval |= (1 << bitn);
+ bitn++;
+ if (bitn >= (nbits+2)) {
+ if ((retval & 1) && (retval & (1 << (nbits+1)))) {
+ async_ret = (retval & ~(1<<(nbits+1))) >> 1;
+ if (async_arg0 == QC_STATUS && async_arg2 == 0 &&
+ (async_ret & (QS_ERROR|QS_NEWCART))) {
+ async_state = 2;
+ goto restate;
+ }
+ DPRT(("async status got $%04x ($%04x)\n", async_ret,retval));
+ } else {
+ DPRT(("ft%d: async_status failed: retval=$%04x nbits=%d\n",
+ ftu, retval,nbits));
+ async_ret = -2;
+ }
+ goto complete;
+ }
+ CALL_ACMD(1, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ /* NOTREACHED */
+ case 2:
+ if (async_ret & QS_NEWCART) ft->newcart = 1;
+ CALL_ACMD(3, ACMD_STATUS, QC_ERRCODE, 16, 1);
+ case 3:
+ ft->lasterr = async_ret;
+ if ((ft->lasterr & QS_NEWCART) == 0 && ft->lasterr) {
+ DPRT(("ft%d: QIC error %d occurred on cmd %d\n",
+ ftu, ft->lasterr & 0xff, ft->lasterr >> 8));
+ }
+ cmd = async_arg0;
+ nbits = async_arg1;
+ CALL_ACMD(4, ACMD_STATUS, QC_STATUS, 8, 1);
+ case 4:
+ goto complete;
+ case 5:
+ CALL_ACMD(6, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 6:
+ CALL_ACMD(7, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 7:
+ CALL_ACMD(8, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 8:
+ cmd = async_arg0;
+ CALL_ACMD(1, ACMD_SEEK, cmd, 0, 0);
+ }
+ break;
+
+ case ACMD_STATE:
+ /*
+ * Arguments:
+ * 0 - status bits to check
+ */
+ switch(async_state) {
+ case 0:
+ CALL_ACMD(1, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 1:
+ if ((async_ret & async_arg0) != 0) goto complete;
+ async_state = 0;
+ if (++async_retries == 360) { /* 90 secs. */
+ DPRT(("ft%d: acmd_state exceeded retry count\n", ftu));
+ goto complete;
+ }
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
+ break;
+ }
+ break;
+
+ case ACMD_SEEKSTS:
+ /*
+ * Arguments:
+ * 0 - command to perform
+ * 1 - status bits to check
+ * 2 - (optional) seconds to wait until completion
+ */
+ switch(async_state) {
+ case 0:
+ cmd = async_arg0;
+ async_retries = (async_arg2) ? (async_arg2 * 4) : 10;
+ CALL_ACMD(1, ACMD_SEEK, cmd, 0, 0);
+ case 1:
+ CALL_ACMD(2, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 2:
+ if ((async_ret & async_arg1) != 0) goto complete;
+ if (--async_retries == 0) {
+ DPRT(("ft%d: acmd_seeksts retries exceeded\n", ftu));
+ goto complete;
+ }
+ async_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
+ break;
+ }
+ break;
+
+ case ACMD_READID:
+ /*
+ * Arguments: (none)
+ */
+ switch(async_state) {
+ case 0:
+ if (!ft->moving) {
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ /* NOTREACHED */
+ }
+ async_state = 1;
+ out_fdc(fdcu, 0x4a); /* READ_ID */
+ out_fdc(fdcu, ftu);
+ break;
+ case 1:
+ for (i = 0; i < 7; i++) ft->rid[i] = in_fdc(fdcu);
+ async_ret = (ft->rid[3]*ftg->g_fdtrk) +
+ (ft->rid[4]*ftg->g_fdside) + ft->rid[5] - 1;
+ DPRT(("readid st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d\n",
+ ft->rid[0], ft->rid[1], ft->rid[2], ft->rid[3],
+ ft->rid[4], ft->rid[5], async_ret));
+ if ((ft->rid[0] & 0xc0) != 0 || async_ret < 0) {
+ /*
+ * Method for retry:
+ * errcnt == 1 regular retry
+ * 2 microstep head 1
+ * 3 microstep head 2
+ * 4 microstep head back to 0
+ * 5 fail
+ */
+ if (++errcnt >= 5) {
+ DPRT(("ft%d: acmd_readid errcnt exceeded\n", fdcu));
+ async_ret = -2;
+ errcnt = 0;
+ goto complete;
+ }
+ if (errcnt == 1) {
+ ft->moving = 0;
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ } else {
+ ft->moving = 0;
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STPAUSE, QS_READY, 0);
+ }
+ DPRT(("readid retry %d...\n", errcnt));
+ async_state = 0;
+ goto restate;
+ }
+ if ((async_ret % ftg->g_blktrk) == (ftg->g_blktrk-1)) {
+ DPRT(("acmd_readid detected last block on track\n"));
+ retpos = async_ret;
+ CALL_ACMD(2, ACMD_STATE, QS_BOT|QS_EOT, 0, 0);
+ /* NOTREACHED */
+ }
+ ft->lastpos = async_ret;
+ errcnt = 0;
+ goto complete;
+ /* NOTREACHED */
+ case 2:
+ CALL_ACMD(3, ACMD_STATE, QS_READY, 0, 0);
+ case 3:
+ ft->moving = 0;
+ async_ret = retpos+1;
+ goto complete;
+ case 4:
+ CALL_ACMD(5, ACMD_SEEK, QC_FORWARD, 0, 0);
+ case 5:
+ ft->moving = 1;
+ async_state = 0;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+ }
+ break;
+
+ case ACMD_RUNBLK:
+ /*
+ * Arguments:
+ * 0 - block number I/O will be performed on
+ *
+ * modifies: curpos
+ */
+ switch (async_state) {
+ case 0:
+ wanttrk = async_arg0 / ftg->g_blktrk;
+ wantblk = async_arg0 % ftg->g_blktrk;
+ wantdir = wanttrk & 1;
+ ft->moving = 0;
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ case 1:
+ curtrk = wanttrk;
+ curdir = curtrk & 1;
+ DPRT(("Changing to track %d\n", wanttrk));
+ CALL_ACMD(2, ACMD_SEEK, QC_SEEKTRACK, 0, 0);
+ case 2:
+ cmd = wanttrk+2;
+ CALL_ACMD(3, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ case 3:
+ CALL_ACMD(4, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 4:
+ ft->laststs = async_ret;
+ if (wantblk == 0) {
+ curblk = 0;
+ cmd = (wantdir) ? QC_SEEKEND : QC_SEEKSTART;
+ CALL_ACMD(6, ACMD_SEEKSTS, cmd, QS_READY, 90);
+ }
+ if (ft->laststs & QS_BOT) {
+ DPRT(("Tape is at BOT\n"));
+ curblk = (wantdir) ? 4800 : 0;
+ async_state = 6;
+ goto restate;
+ }
+ if (ft->laststs & QS_EOT) {
+ DPRT(("Tape is at EOT\n"));
+ curblk = (wantdir) ? 0 : 4800;
+ async_state = 6;
+ goto restate;
+ }
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ case 5:
+ if (async_ret < 0) {
+ ft->moving = 0;
+ ft->lastpos = -2;
+ if (async_ret == -2) {
+ CALL_ACMD(9, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ curtrk = (async_ret+1) / ftg->g_blktrk;
+ curblk = (async_ret+1) % ftg->g_blktrk;
+ DPRT(("gotid: curtrk=%d wanttrk=%d curblk=%d wantblk=%d\n",
+ curtrk, wanttrk, curblk, wantblk));
+ if (curtrk != wanttrk) { /* oops! */
+ DPRT(("oops!! wrong track!\n"));
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ async_state = 6;
+ goto restate;
+ case 6:
+ DPRT(("curtrk = %d nextblk = %d\n", curtrk, curblk));
+ if (curblk == wantblk) {
+ ft->lastpos = curblk - 1;
+ async_ret = ft->lastpos;
+ if (ft->moving) goto complete;
+ CALL_ACMD(7, ACMD_STATE, QS_READY, 0, 0);
+ }
+ if (curblk > wantblk) { /* passed it */
+ ft->moving = 0;
+ CALL_ACMD(10, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ if ((wantblk - curblk) <= 256) { /* approaching it */
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ }
+ /* way up ahead */
+ ft->moving = 0;
+ CALL_ACMD(14, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ break;
+ case 7:
+ ft->moving = 1;
+ CALL_ACMD(8, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+ case 8:
+ async_state = 9;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+ case 9:
+ goto complete;
+ case 10:
+ curdiff = ((curblk - wantblk) / QCV_BLKSEG) + 2;
+ if (curdiff >= ftg->g_segtrk) curdiff = ftg->g_segtrk - 1;
+ DPRT(("pos %d past %d, reverse %d\n", curblk, wantblk, curdiff));
+ CALL_ACMD(11, ACMD_SEEK, QC_SEEKREV, 0, 0);
+ case 11:
+ DPRT(("reverse 1 done\n"));
+ CALL_ACMD(12, ACMD_SEEK, (curdiff & 0xf)+2, 0, 0);
+ case 12:
+ DPRT(("reverse 2 done\n"));
+ CALL_ACMD(13, ACMD_SEEKSTS, ((curdiff>>4)&0xf)+2, QS_READY, 90);
+ case 13:
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ case 14:
+ curdiff = ((wantblk - curblk) / QCV_BLKSEG) - 2;
+ if (curdiff < 0) curdiff = 0;
+ DPRT(("pos %d before %d, forward %d\n", curblk, wantblk, curdiff));
+ CALL_ACMD(15, ACMD_SEEK, QC_SEEKFWD, 0, 0);
+ case 15:
+ DPRT(("forward 1 done\n"));
+ CALL_ACMD(16, ACMD_SEEK, (curdiff & 0xf)+2, 0, 0);
+ case 16:
+ DPRT(("forward 2 done\n"));
+ CALL_ACMD(13, ACMD_SEEKSTS, ((curdiff>>4)&0xf)+2, QS_READY, 90);
+ }
+ break;
+ }
+
+ return;
+
+complete:
+ if (astk_ptr != &astk[0]) {
+ astk_ptr--;
+ async_retries = astk_ptr->over_retries;
+ async_func = astk_ptr->over_func;
+ async_state = astk_ptr->over_state;
+ async_arg0 = astk_ptr->over_arg0;
+ async_arg1 = astk_ptr->over_arg1;
+ async_arg2 = astk_ptr->over_arg2;
+ goto restate;
+ }
+ async_func = ACMD_NONE;
+ async_state = 0;
+ switch (ft->io_sts) {
+ case FTIO_READY:
+ async_req(ftu, 2);
+ break;
+ case FTIO_READING:
+ case FTIO_RDAHEAD:
+ async_read(ftu, 2);
+ break;
+ case FTIO_WRITING:
+ async_write(ftu, 2);
+ break;
+ default:
+ DPRT(("ft%d: bad async_cmd ending I/O state!\n", ftu));
+ break;
+ }
+}
+
+
+/*
+ * Entry point for the async request processor.
+ */
+static void
+async_req(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ SegReq *sp;
+ static int over_async, lastreq;
+ int cmd;
+
+ if (from == 2) arq_state = over_async;
+
+restate:
+ switch (arq_state) {
+ case 0: /* Process segment */
+ sp = ft->segh;
+ ft->io_sts = (sp == NULL) ? FTIO_READY : sp->reqtype;
+
+ if (ft->io_sts == FTIO_WRITING)
+ async_write(ftu, from);
+ else
+ async_read(ftu, from);
+ if (ft->io_sts != FTIO_READY) return;
+
+ /* Pull buffer from current I/O queue */
+ if (sp != NULL) {
+ lastreq = sp->reqtype;
+ segio_done(ft, sp);
+
+ /* If I/O cancelled, clear finished queue. */
+ if (sp->reqcan) {
+ while (ft->doneh != NULL)
+ segio_free(ft, ft->doneh);
+ lastreq = FTIO_READY;
+ }
+ } else
+ lastreq = FTIO_READY;
+
+ /* Detect end of track */
+ if (((ft->xblk / QCV_BLKSEG) % ftg->g_segtrk) == 0) {
+ ACMD_FUNC(2, ACMD_STATE, QS_BOT|QS_EOT, 0, 0);
+ }
+ arq_state = 1;
+ goto restate;
+
+ case 1: /* Next request */
+ /* If we have another request queued, start it running. */
+ if (ft->segh != NULL) {
+ sp = ft->segh;
+ sp->reqcrc = 0;
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ DPRT(("I/O reqblk = %d\n", ft->xblk));
+ goto restate;
+ }
+
+ /* If the last request was reading, do read ahead. */
+ if ((lastreq == FTIO_READING || lastreq == FTIO_RDAHEAD) &&
+ (sp = segio_alloc(ft)) != NULL) {
+ sp->reqtype = FTIO_RDAHEAD;
+ sp->reqblk = ft->xblk;
+ sp->reqseg = ft->xseg+1;
+ sp->reqcrc = 0;
+ sp->reqcan = 0;
+ segio_queue(ft, sp);
+ bzero(sp->buff, QCV_SEGSIZE);
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ DPRT(("Processing readahead reqblk = %d\n", ft->xblk));
+ goto restate;
+ }
+
+ if (ft->moving) {
+ DPRT(("No more I/O.. Stopping.\n"));
+ ft->moving = 0;
+ ACMD_FUNC(7, ACMD_SEEKSTS, QC_PAUSE, QS_READY, 0);
+ break;
+ }
+ arq_state = 7;
+ goto restate;
+
+ case 2: /* End of track */
+ ft->moving = 0;
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ break;
+
+ case 3:
+ DPRT(("async_req seek head to track %d\n", ft->xblk / ftg->g_blktrk));
+ ACMD_FUNC(4, ACMD_SEEK, QC_SEEKTRACK, 0, 0);
+ break;
+
+ case 4:
+ cmd = (ft->xblk / ftg->g_blktrk) + 2;
+ if (ft->segh != NULL) {
+ ACMD_FUNC(5, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ } else {
+ ACMD_FUNC(7, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ }
+ break;
+
+ case 5:
+ ft->moving = 1;
+ ACMD_FUNC(6, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 6:
+ arq_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ case 7:
+ /* Time to rest. */
+ ft->active = 0;
+ ft->lastpos = -2;
+
+ /* wakeup those who want an i/o chg */
+ wakeup((caddr_t)wc_iosts_change);
+ break;
+ }
+}
+
+
+/*
+ * Entry for async read.
+ */
+static void
+async_read(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int i, rddta[7];
+ int where;
+ static int over_async;
+ static int retries = 0;
+
+ if (from == 2) ard_state = over_async;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_read: state: %d from = %d\n", ard_state, from));
+#endif
+ switch (ard_state) {
+ case 0: /* Start off */
+ /* If tape is not at desired position, stop and locate */
+ if (ft->lastpos != (ft->xblk-1)) {
+ DPRT(("ft%d: position unknown: lastpos:%d ft->xblk:%d\n",
+ ftu, ft->lastpos, ft->xblk));
+ ACMD_FUNC(1, ACMD_RUNBLK, ft->xblk, 0, 0);
+ }
+
+ /* Tape is in position but stopped. */
+ if (!ft->moving) {
+ DPRT(("async_read ******STARTING TAPE\n"));
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ }
+ ard_state = 1;
+ goto restate;
+
+ case 1: /* Start DMA */
+ /* Tape is now moving and in position-- start DMA now! */
+ isa_dmastart(B_READ, ft->xptr, QCV_BLKSIZE, 2);
+ out_fdc(fdcu, 0x66); /* read */
+ out_fdc(fdcu, ftu); /* unit */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdside) / ftg->g_fdtrk); /* cylinder */
+ out_fdc(fdcu, ft->xblk / ftg->g_fdside); /* head */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* sector */
+ out_fdc(fdcu, 0x03); /* 1K sectors */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* count */
+ out_fdc(fdcu, 0x74); /* gap length */
+ out_fdc(fdcu, 0xff); /* transfer size */
+ ard_state = 2;
+ break;
+
+ case 2: /* DMA completed */
+ /* Transfer complete, get status */
+ for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
+ isa_dmadone(B_READ, ft->xptr, QCV_BLKSIZE, 2);
+
+#if FTDBGALL
+ /* Compute where the controller thinks we are */
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+
+ /* Check for errors */
+ if ((rddta[0] & 0xc0) != 0x00) {
+#if !FTDBGALL
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xd: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+ if ((rddta[1] & 0x04) == 0x04 && retries < 2) {
+ /* Probably wrong position */
+ DPRT(("async_read: doing retry %d\n", retries));
+ ft->lastpos = ft->xblk;
+ ard_state = 0;
+ retries++;
+ goto restate;
+ } else {
+ /* CRC/Address-mark/Data-mark, et. al. */
+ DPRT(("ft%d: CRC error on block %d\n", fdcu, ft->xblk));
+ ft->segh->reqcrc |= (1 << ft->xcnt);
+ }
+ }
+
+ /* Otherwise, transfer completed okay. */
+ retries = 0;
+ ft->lastpos = ft->xblk;
+ ft->xblk++;
+ ft->xcnt++;
+ ft->xptr += QCV_BLKSIZE;
+ if (ft->xcnt < QCV_BLKSEG && ft->segh->reqcan == 0) {
+ ard_state = 0;
+ goto restate;
+ }
+ DPRT(("Read done.. Cancel = %d\n", ft->segh->reqcan));
+ ft->io_sts = FTIO_READY;
+ break;
+
+ case 3:
+ ft->moving = 1;
+ ACMD_FUNC(4, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 4:
+ ard_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ default:
+ DPRT(("ft%d: bad async_read state %d!!\n", ftu, ard_state));
+ break;
+ }
+}
+
+
+/*
+ * Entry for async write. If from is 0, this came from the interrupt
+ * routine, if it's 1 then it was a timeout, if it's 2, then an
+ * async_cmd completed.
+ */
+static void
+async_write(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int i, rddta[7];
+ int where;
+ static int over_async;
+ static int retries = 0;
+
+ if (from == 2) awr_state = over_async;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_write: state: %d from = %d\n", awr_state, from));
+#endif
+ switch (awr_state) {
+ case 0: /* Start off */
+ /* If tape is not at desired position, stop and locate */
+ if (ft->lastpos != (ft->xblk-1)) {
+ DPRT(("ft%d: position unknown: lastpos:%d ft->xblk:%d\n",
+ ftu, ft->lastpos, ft->xblk));
+ ACMD_FUNC(1, ACMD_RUNBLK, ft->xblk, 0, 0);
+ }
+
+ /* Tape is in position but stopped. */
+ if (!ft->moving) {
+ DPRT(("async_write ******STARTING TAPE\n"));
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ }
+ awr_state = 1;
+ goto restate;
+
+ case 1: /* Start DMA */
+ /* Tape is now moving and in position-- start DMA now! */
+ isa_dmastart(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
+ out_fdc(fdcu, 0x45); /* write */
+ out_fdc(fdcu, ftu); /* unit */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdside) / ftg->g_fdtrk); /* cyl */
+ out_fdc(fdcu, ft->xblk / ftg->g_fdside); /* head */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* sector */
+ out_fdc(fdcu, 0x03); /* 1K sectors */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* count */
+ out_fdc(fdcu, 0x74); /* gap length */
+ out_fdc(fdcu, 0xff); /* transfer size */
+ awr_state = 2;
+ break;
+
+ case 2: /* DMA completed */
+ /* Transfer complete, get status */
+ for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
+ isa_dmadone(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
+
+#if FTDBGALL
+ /* Compute where the controller thinks we are */
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside) + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+
+ /* Check for errors */
+ if ((rddta[0] & 0xc0) != 0x00) {
+#if !FTDBGALL
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+ if (retries < 3) {
+ /* Something happened -- try again */
+ DPRT(("async_write: doing retry %d\n", retries));
+ ft->lastpos = ft->xblk;
+ awr_state = 0;
+ retries++;
+ goto restate;
+ } else {
+ /*
+ * Retries failed. Note the unrecoverable error.
+ * Marking the block as bad is useless right now.
+ */
+ printf("ft%d: unrecoverable write error on block %d\n",
+ ftu, ft->xblk);
+ ft->segh->reqcrc |= (1 << ft->xcnt);
+ }
+ }
+
+ /* Otherwise, transfer completed okay. */
+ retries = 0;
+ ft->lastpos = ft->xblk;
+ ft->xblk++;
+ ft->xcnt++;
+ ft->xptr += QCV_BLKSIZE;
+ if (ft->xcnt < QCV_BLKSEG) {
+ awr_state = 0; /* next block */
+ goto restate;
+ }
+#if FTDBGALL
+ DPRT(("Write done.\n"));
+#endif
+ ft->io_sts = FTIO_READY;
+ break;
+
+ case 3:
+ ft->moving = 1;
+ ACMD_FUNC(4, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 4:
+ awr_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ default:
+ DPRT(("ft%d: bad async_write state %d!!\n", ftu, awr_state));
+ break;
+ }
+}
+
+
+/*
+ * Interrupt handler for active tape. Bounced off of fdintr().
+ */
+int
+ftintr(ftu_t ftu)
+{
+ int st0, pcn, i;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int s = splbio();
+
+ st0 = 0;
+ pcn = 0;
+
+ /* I/O segment transfer completed */
+ if (ft->active) {
+ if (async_func != ACMD_NONE) {
+ async_cmd(ftu);
+ splx(s);
+ return(1);
+ }
+#if FTDBGALL
+ DPRT(("Got request interrupt\n"));
+#endif
+ async_req(ftu, 0);
+ splx(s);
+ return(1);
+ }
+
+ /* Get interrupt status */
+ if (ft->cmd_wait != FTCMD_READID) {
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ pcn = in_fdc(fdcu);
+ }
+
+ if (ft->cmd_wait == FTCMD_NONE || ft->sts_wait != FTSTS_SNOOZE) {
+huh_what:
+ printf("ft%d: unexpected interrupt; st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn);
+ splx(s);
+ return(1);
+ }
+
+ switch (ft->cmd_wait) {
+ case FTCMD_RESET:
+ ft->sts_wait = FTSTS_INTERRUPT;
+ wakeup((caddr_t)wc_intr_wait);
+ break;
+ case FTCMD_RECAL:
+ case FTCMD_SEEK:
+ if (st0 & 0x20) { /* seek done */
+ ft->sts_wait = FTSTS_INTERRUPT;
+ ft->pcn = pcn;
+ wakeup((caddr_t)wc_intr_wait);
+ }
+#if FTDBGALL
+ else
+ DPRT(("ft%d: seek error st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn));
+#endif
+ break;
+ case FTCMD_READID:
+ for (i = 0; i < 7; i++) ft->rid[i] = in_fdc(fdcu);
+ ft->sts_wait = FTSTS_INTERRUPT;
+ wakeup((caddr_t)wc_intr_wait);
+ break;
+
+ default:
+ goto huh_what;
+ }
+
+ splx(s);
+ return(1);
+}
+
+
+/*
+ * Interrupt timeout routine.
+ */
+static void
+ft_timeout(void *arg1)
+{
+ int s;
+ ftu_t ftu = (ftu_t)arg1;
+ ft_p ft = ft_data[ftu];
+
+ s = splbio();
+ if (ft->active) {
+ if (async_func != ACMD_NONE) {
+ async_cmd(ftu);
+ splx(s);
+ return;
+ }
+ async_req(ftu, 1);
+ } else {
+ ft->sts_wait = FTSTS_TIMEOUT;
+ wakeup((caddr_t)wc_intr_wait);
+ }
+ splx(s);
+}
+
+
+/*
+ * Wait for a particular interrupt to occur. ftintr() will wake us up
+ * if it sees what we want. Otherwise, time out and return error.
+ * Should always disable ints before trigger is sent and calling here.
+ */
+static int
+ftintr_wait(ftu_t ftu, int cmd, int ticks)
+{
+ int retries, st0, pcn;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ ft->cmd_wait = cmd;
+ ft->sts_wait = FTSTS_SNOOZE;
+
+ /* At attach time, we can't rely on having interrupts serviced */
+ if (ft->attaching) {
+ switch (cmd) {
+ case FTCMD_RESET:
+ DELAY(100);
+ ft->sts_wait = FTSTS_INTERRUPT;
+ goto intrdone;
+ case FTCMD_RECAL:
+ case FTCMD_SEEK:
+ for (retries = 0; retries < 10000; retries++) {
+ DELAY(150);
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ if ((st0 & 0xc0) == 0x80) continue;
+ pcn = in_fdc(fdcu);
+ if (st0 & 0x20) {
+ ft->sts_wait = FTSTS_INTERRUPT;
+ ft->pcn = pcn;
+ goto intrdone;
+ }
+ }
+ break;
+ }
+ ft->sts_wait = FTSTS_TIMEOUT;
+ goto intrdone;
+ }
+
+ ftsleep(wc_intr_wait, ticks);
+
+intrdone:
+ if (ft->sts_wait == FTSTS_TIMEOUT) { /* timeout */
+#if FTDBGALL
+ if (ft->cmd_wait != FTCMD_RESET)
+ DPRT(("ft%d: timeout on command %d\n", ftu, ft->cmd_wait));
+#endif
+ ft->cmd_wait = FTCMD_NONE;
+ ft->sts_wait = FTSTS_NONE;
+ return(1);
+ }
+
+ /* got interrupt */
+ if (ft->attaching == 0 && ticks)
+ untimeout(ft_timeout, (caddr_t)ftu, ft->tohandle);
+ ft->cmd_wait = FTCMD_NONE;
+ ft->sts_wait = FTSTS_NONE;
+ return(0);
+}
+
+
+/*
+ * Recalibrate tape drive. Parameter totape is true, if we should
+ * recalibrate to tape drive settings.
+ */
+static int
+tape_recal(ftu_t ftu, int totape)
+{
+ int s;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ DPRT(("tape_recal start\n"));
+
+#ifdef PC98
+ outb(0xbe, FDP_FDDEXC | FDP_PORTEXC);
+#endif
+ out_fdc(fdcu, NE7CMD_SPECIFY);
+#ifdef PC98
+ out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
+ out_fdc(fdcu, 0x02);
+#else
+ out_fdc(fdcu, (totape) ? 0xAD : 0xDF);
+ out_fdc(fdcu, 0x02);
+#endif
+
+ s = splbio();
+ out_fdc(fdcu, NE7CMD_RECAL);
+ out_fdc(fdcu, ftu);
+
+ if (ftintr_wait(ftu, FTCMD_RECAL, hz)) {
+ splx(s);
+ DPRT(("ft%d: recalibrate timeout\n", ftu));
+ return(1);
+ }
+ splx(s);
+
+ out_fdc(fdcu, NE7CMD_SPECIFY);
+#ifdef PC98
+ out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
+ out_fdc(fdcu, 0x02);
+#else
+ out_fdc(fdcu, (totape) ? 0xFD : 0xDF);
+ out_fdc(fdcu, 0x02);
+#endif
+
+ DPRT(("tape_recal end\n"));
+ return(0);
+}
+
+/*
+ * Wait for a particular tape status to be met. If all is TRUE, then
+ * all states must be met, otherwise any state can be met.
+ */
+static int
+tape_state(ftu_t ftu, int all, int mask, int seconds)
+{
+ int r, tries, maxtries;
+
+ maxtries = (seconds) ? (4 * seconds) : 1;
+ for (tries = 0; tries < maxtries; tries++) {
+ r = tape_status(ftu);
+ if (r >= 0) {
+ if (all && (r & mask) == mask) return(r);
+ if ((r & mask) != 0) return(r);
+ }
+ if (seconds) ftsleep(wc_long_delay, hz/4);
+ }
+ DPRT(("ft%d: tape_state failed on mask=$%02x maxtries=%d\n",
+ ftu, mask, maxtries));
+ return(-1);
+}
+
+
+/*
+ * Send a QIC command to tape drive, wait for completion.
+ */
+static int
+tape_cmd(ftu_t ftu, int cmd)
+{
+ int newcn;
+ int retries = 0;
+ int s;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ DPRT(("===> tape_cmd: %d\n",cmd));
+ newcn = (cmd <= ft->pcn) ? ft->pcn - cmd : ft->pcn + cmd;
+
+retry:
+
+ /* Perform seek */
+ s = splbio();
+ out_fdc(fdcu, NE7CMD_SEEK);
+ out_fdc(fdcu, ftu);
+ out_fdc(fdcu, newcn);
+
+ if (ftintr_wait(ftu, FTCMD_SEEK, hz)) {
+ DPRT(("ft%d: tape_cmd seek timeout\n", ftu));
+redo:
+ splx(s);
+ if (++retries < 5) goto retry;
+ DPRT(("ft%d: tape_cmd seek failed!\n", ftu));
+ return(1);
+ }
+ splx(s);
+
+ if (ft->pcn != newcn) {
+ DPRT(("ft%d: bad seek in tape_cmd; pcn = %d newcn = %d\n",
+ ftu, ft->pcn, newcn));
+ goto redo;
+ }
+ DELAY(2500);
+ return(0);
+}
+
+
+/*
+ * Return status of tape drive
+ */
+static int
+tape_status(ftu_t ftu)
+{
+ int r, err, tries;
+ ft_p ft = ft_data[ftu];
+ int max = (ft->attaching) ? 2 : 3;
+
+ for (r = -1, tries = 0; r < 0 && tries < max; tries++)
+ r = qic_status(ftu, QC_STATUS, 8);
+ if (tries == max) return(-1);
+
+recheck:
+ DPRT(("tape_status got $%04x\n",r));
+ ft->laststs = r;
+
+ if (r & (QS_ERROR|QS_NEWCART)) {
+ err = qic_status(ftu, QC_ERRCODE, 16);
+ ft->lasterr = err;
+ if (r & QS_NEWCART) {
+ ft->newcart = 1;
+ /* If tape not referenced, do a seek load point. */
+ if ((r & QS_FMTOK) == 0 && !ft->attaching) {
+ tape_cmd(ftu, QC_SEEKLP);
+ do {
+ ftsleep(wc_long_delay, hz);
+ } while ((r = qic_status(ftu, QC_STATUS, 8)) < 0 ||
+ (r & (QS_READY|QS_CART)) == QS_CART);
+ goto recheck;
+ }
+ } else if (err && !ft->attaching) {
+ DPRT(("ft%d: QIC error %d occurred on cmd %d\n",
+ ftu, err & 0xff, err >> 8));
+ }
+ r = qic_status(ftu, QC_STATUS, 8);
+ ft->laststs = r;
+ DPRT(("tape_status got error code $%04x new sts = $%02x\n",err,r));
+ }
+
+ ft->rdonly = (r & QS_RDONLY);
+ return(r);
+}
+
+
+/*
+ * Transfer control to tape drive.
+ */
+static void
+tape_start(ftu_t ftu, int motor)
+{
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ int s, mbits;
+#ifndef PC98
+ static int mbmotor[] = { FDO_MOEN0, FDO_MOEN1, FDO_MOEN2, FDO_MOEN3 };
+#endif
+
+ s = splbio();
+ DPRT(("tape_start start\n"));
+
+ /* reset, dma disable */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, 0x00);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ /* raise reset, enable DMA, motor on if needed */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
+#else
+ mbits = ftu & 3;
+ if (motor && ftu < 4)
+ mbits |= mbmotor[ftu];
+
+ outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN | mbits);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ splx(s);
+
+ tape_recal(ftu, 1);
+
+ /* set transfer speed */
+#ifndef PC98
+ outb(fdc->baseport+FDCTL, FDC_500KBPS);
+ DELAY(10);
+#endif
+
+ DPRT(("tape_start end\n"));
+}
+
+
+/*
+ * Transfer control back to floppy disks.
+ */
+static void
+tape_end(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ int s;
+
+ DPRT(("tape_end start\n"));
+ tape_recal(ftu, 0);
+
+ s = splbio();
+
+ /* reset, dma disable */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, 0x00);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ /* raise reset, enable DMA */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ splx(s);
+
+ /* set transfer speed */
+#ifndef PC98
+ outb(fdc->baseport+FDCTL, FDC_500KBPS);
+ DELAY(10);
+#endif
+ fdc->flags &= ~FDC_TAPE_BUSY;
+
+ DPRT(("tape_end end\n"));
+}
+
+
+/*
+ * Wait for the driver to go inactive, cancel readahead if necessary.
+ */
+static void
+tape_inactive(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+ int s = splbio();
+
+ if (ft->segh != NULL) {
+ if (ft->segh->reqtype == FTIO_RDAHEAD) {
+ /* cancel read-ahead */
+ ft->segh->reqcan = 1;
+ } else if (ft->segh->reqtype == FTIO_WRITING && !ft->active) {
+ /* flush out any remaining writes */
+ DPRT(("Flushing write I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = ft->segh->reqblk;
+ ft->xseg = ft->segh->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = ft->segh->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+ }
+ }
+ while (ft->active) ftsleep(wc_iosts_change, 0);
+ splx(s);
+}
+
+
+/*
+ * Get the geometry of the tape currently in the drive.
+ */
+static int
+ftgetgeom(ftu_t ftu)
+{
+ int r, i, tries;
+ int cfg, qic80, ext;
+ int sts, fmt, len;
+ ft_p ft = ft_data[ftu];
+
+ r = tape_status(ftu);
+
+ /* XXX fix me when format mode is finished */
+ if (r < 0 || (r & QS_CART) == 0 || (r & QS_FMTOK) == 0) {
+ DPRT(("ftgetgeom: no cart or not formatted 0x%04x\n",r));
+ ftg = NULL;
+ ft->newcart = 1;
+ return(0);
+ }
+
+ /* Report drive configuration */
+ for (cfg = -1, tries = 0; cfg < 0 && tries < 3; tries++)
+ cfg = qic_status(ftu, QC_CONFIG, 8);
+ if (tries == 3) {
+ DPRT(("ftgetgeom report config failed\n"));
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("ftgetgeom report config got $%04x\n", cfg));
+ ft->lastcfg = cfg;
+
+ qic80 = cfg & QCF_QIC80;
+ ext = cfg & QCF_EXTRA;
+
+/*
+ * XXX - This doesn't seem to work on my Colorado Jumbo 250...
+ * if it works on your drive, I'd sure like to hear about it.
+ */
+#if 0
+ /* Report drive status */
+ for (sts = -1, tries = 0; sts < 0 && tries < 3; tries++)
+ sts = qic_status(ftu, QC_TSTATUS, 8);
+ if (tries == 3) {
+ DPRT(("ftgetgeom report tape status failed\n"));
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("ftgetgeom report tape status got $%04x\n", sts));
+#else
+ /*
+ * XXX - Forge a fake tape status based upon the returned
+ * configuration, since the above command or code is broken
+ * for my drive and probably other older drives.
+ */
+ sts = 0;
+ sts = (qic80) ? QTS_QIC80 : QTS_QIC40;
+ sts |= (ext) ? QTS_LEN2 : QTS_LEN1;
+#endif
+
+ fmt = sts & QTS_FMMASK;
+ len = (sts & QTS_LNMASK) >> 4;
+
+ if (fmt > QCV_NFMT) {
+ ftg = NULL;
+ printf("ft%d: unsupported tape format\n", ftu);
+ return(-1);
+ }
+ if (len > QCV_NLEN) {
+ ftg = NULL;
+ printf("ft%d: unsupported tape length\n", ftu);
+ return(-1);
+ }
+
+ /* Look up geometry in the table */
+ for (i = 1; i < NGEOM; i++)
+ if (ftgtbl[i].g_fmtno == fmt && ftgtbl[i].g_lenno == len) break;
+ if (i == NGEOM) {
+ printf("ft%d: unknown tape geometry\n", ftu);
+ ftg = NULL;
+ return(-1);
+ }
+ ftg = &ftgtbl[i];
+ if (!ftg->g_trktape) {
+ printf("ft%d: unsupported format %s w/len %s\n",
+ ftu, ftg->g_fmtdesc, ftg->g_lendesc);
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("Tape format is %s, length is %s\n", ftg->g_fmtdesc, ftg->g_lendesc));
+ ft->newcart = 0;
+ return(0);
+}
+
+
+/*
+ * Switch between tape/floppy. This will send the tape enable/disable
+ * codes for this drive's manufacturer.
+ */
+static int
+set_fdcmode(dev_t dev, int newmode)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ static int havebufs = 0;
+ int i;
+ SegReq *sp, *rsp;
+
+ if (newmode == FDC_TAPE_MODE) {
+ /* Wake up the tape drive */
+ switch (ft->type) {
+ case NO_TYPE:
+ fdc->flags &= ~FDC_TAPE_BUSY;
+ return(ENXIO);
+ case FT_NONE:
+ tape_start(ftu, 0);
+ break;
+ case FT_COLORADO:
+ tape_start(ftu, 0);
+ if (tape_cmd(ftu, QC_COL_ENABLE1)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ if (tape_cmd(ftu, QC_COL_ENABLE2 + ftu)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ break;
+ case FT_MOUNTAIN:
+ tape_start(ftu, 0);
+ if (tape_cmd(ftu, QC_MTN_ENABLE1)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ if (tape_cmd(ftu, QC_MTN_ENABLE2)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ break;
+ case FT_INSIGHT:
+ tape_start(ftu, 1);
+ break;
+ default:
+ DPRT(("ft%d: bad tape type\n", ftu));
+ return(ENXIO);
+ }
+ if (tape_status(ftu) < 0) {
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ return(EIO);
+ }
+
+ /* Grab buffers from memory. */
+ if (!havebufs) {
+ ft->segh = ft->segt = NULL;
+ ft->doneh = ft->donet = NULL;
+ ft->segfree = NULL;
+ ft->hdr = NULL;
+ ft->nsegq = ft->ndoneq = ft->nfreelist = 0;
+ for (i = 0; i < FTNBUFF; i++) {
+ sp = malloc(sizeof(SegReq), M_DEVBUF, M_WAITOK);
+ if (sp == NULL) {
+ printf("ft%d: not enough memory for buffers\n", ftu);
+ for (sp=ft->segfree; sp != NULL; sp=sp->next)
+ free(sp, M_DEVBUF);
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ return(ENOMEM);
+ }
+ sp->reqtype = FTIO_READY;
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ }
+ /* take one buffer for header */
+ ft->hdr = ft->segfree;
+ ft->segfree = ft->segfree->next;
+ ft->nfreelist--;
+ havebufs = 1;
+ }
+ ft->io_sts = FTIO_READY; /* tape drive is ready */
+ ft->active = 0; /* interrupt driver not active */
+ ft->moving = 0; /* tape not moving */
+ ft->rdonly = 0; /* tape read only */
+ ft->newcart = 0; /* new cartridge flag */
+ ft->lastpos = -1; /* tape is rewound */
+ async_func = ACMD_NONE; /* No async function */
+ tape_state(ftu, 0, QS_READY, 60);
+ tape_cmd(ftu, QC_RATE);
+ tape_cmd(ftu, QCF_RT500+2); /* 500K bps */
+ tape_state(ftu, 0, QS_READY, 60);
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY); /* Make sure we're in primary mode */
+ tape_state(ftu, 0, QS_READY, 60);
+ ftg = NULL; /* No geometry yet */
+ ftgetgeom(ftu); /* Get tape geometry */
+ ftreq_rewind(ftu); /* Make sure tape is rewound */
+ } else {
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ ft->newcart = 0; /* clear new cartridge */
+ if (ft->hdr != NULL) free(ft->hdr, M_DEVBUF);
+ if (havebufs) {
+ for (sp = ft->segfree; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ for (sp = ft->segh; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ for (sp = ft->doneh; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ }
+ havebufs = 0;
+ }
+ return(0);
+}
+
+
+/*
+ * Perform a QIC status function.
+ */
+static int
+qic_status(ftu_t ftu, int cmd, int nbits)
+{
+ int st3, r, i;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ if (tape_cmd(ftu, cmd)) {
+ DPRT(("ft%d: QIC status timeout\n", ftu));
+ return(-1);
+ }
+
+ /* Sense drive status */
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+
+ if ((st3 & 0x10) == 0) { /* track 0 */
+ DPRT(("qic_status has dead drive... st3 = $%02x\n", st3));
+ return(-1);
+ }
+
+ for (i = r = 0; i <= nbits; i++) {
+ if (tape_cmd(ftu, QC_NEXTBIT)) {
+ DPRT(("ft%d: QIC status bit timed out on %d\n", ftu, i));
+ return(-1);
+ }
+
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+ if (st3 < 0) {
+ DPRT(("ft%d: controller timed out on bit %d r=$%02x\n",
+ ftu, i, r));
+ return(-1);
+ }
+
+ r >>= 1;
+ if (i < nbits)
+ r |= ((st3 & 0x10) ? 1 : 0) << nbits;
+ else if ((st3 & 0x10) == 0) {
+ DPRT(("ft%d: qic status stop bit missing at %d, st3=$%02x r=$%04x\n",
+ ftu,i,st3,r));
+ return(-1);
+ }
+ }
+
+ DPRT(("qic_status returned $%02x\n", r));
+ return(r);
+}
+
+
+/*
+ * Open tape drive for use. Bounced off of Fdopen if tape minor is
+ * detected.
+ */
+int
+ftopen(dev_t dev, int arg2) {
+ ftu_t ftu = FDUNIT(minor(dev));
+ fdc_p fdc;
+
+ /* check bounds */
+ if (ftu >= NFT)
+ return(ENXIO);
+ if (!ft_data[ftu])
+ return(ENXIO);
+ fdc = ft_data[ftu]->fdc;
+ if ((fdc == NULL) || (ft_data[ftu]->type == NO_TYPE))
+ return(ENXIO);
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY)
+ return(EBUSY);
+ /* make sure we found a tape when probed */
+ if (!(fdc->flags & FDC_HASFTAPE))
+ return(ENODEV);
+ fdc->fdu = ftu;
+ fdc->flags |= FDC_TAPE_BUSY;
+ return(set_fdcmode(dev, FDC_TAPE_MODE)); /* try to switch to tape */
+}
+
+
+/*
+ * Close tape and return floppy controller to disk mode.
+ */
+int
+ftclose(dev_t dev, int flags)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+ ft_p ft = ft_data[ftu];
+
+
+ /* Wait for any remaining I/O activity to complete. */
+ tape_inactive(ftu);
+
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY);
+ tape_state(ftu, 0, QS_READY, 60);
+ ftreq_rewind(ftu);
+ return(set_fdcmode(dev, FDC_DISK_MODE)); /* Otherwise, close tape */
+}
+
+/*
+ * Read or write a segment.
+ */
+static int
+ftreq_rw(ftu_t ftu, unsigned long cmd, QIC_Segment *sr, struct proc *p)
+{
+ int r, i;
+ SegReq *sp;
+ int s;
+ long blk, bad, seg;
+ unsigned char *cp, *cp2;
+ ft_p ft = ft_data[ftu];
+
+ if (!ft->active && ft->segh == NULL) {
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0)
+ return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0)
+ return(ENXIO); /* Not formatted */
+ tape_state(ftu, 0, QS_READY, 90);
+ }
+
+ if (ftg == NULL || ft->newcart) {
+ tape_inactive(ftu);
+ tape_state(ftu, 0, QS_READY, 90);
+ if (ftgetgeom(ftu) < 0)
+ return(ENXIO);
+ }
+
+ /* Write not allowed on a read-only tape. */
+ if (cmd == QIOWRITE && ft->rdonly)
+ return(EROFS);
+
+ /* Quick check of request and buffer. */
+ if (sr == NULL || sr->sg_data == NULL)
+ return(EINVAL);
+
+ /* Make sure requested track and segment is in range. */
+ if (sr->sg_trk >= ftg->g_trktape || sr->sg_seg >= ftg->g_segtrk)
+ return(EINVAL);
+
+ blk = sr->sg_trk * ftg->g_blktrk + sr->sg_seg * QCV_BLKSEG;
+ seg = sr->sg_trk * ftg->g_segtrk + sr->sg_seg;
+
+ s = splbio();
+ if (cmd == QIOREAD) {
+ /*
+ * See if the driver is reading ahead.
+ */
+ if (ft->doneh != NULL ||
+ (ft->segh != NULL && ft->segh->reqtype == FTIO_RDAHEAD)) {
+ /*
+ * Eat the completion queue and see if the request
+ * is already there.
+ */
+ while (ft->doneh != NULL) {
+ if (blk == ft->doneh->reqblk) {
+ sp = ft->doneh;
+ sp->reqtype = FTIO_READING;
+ sp->reqbad = sr->sg_badmap;
+ goto rddone;
+ }
+ segio_free(ft, ft->doneh);
+ }
+
+ /*
+ * Not on the completed queue, in progress maybe?
+ */
+ if (ft->segh != NULL && ft->segh->reqtype == FTIO_RDAHEAD &&
+ blk == ft->segh->reqblk) {
+ sp = ft->segh;
+ sp->reqtype = FTIO_READING;
+ sp->reqbad = sr->sg_badmap;
+ goto rdwait;
+ }
+ }
+
+ /* Wait until we're ready. */
+ tape_inactive(ftu);
+
+ /* Set up a new read request. */
+ sp = segio_alloc(ft);
+ sp->reqcrc = 0;
+ sp->reqbad = sr->sg_badmap;
+ sp->reqblk = blk;
+ sp->reqseg = seg;
+ sp->reqcan = 0;
+ sp->reqtype = FTIO_READING;
+ segio_queue(ft, sp);
+
+ /* Start the read request off. */
+ DPRT(("Starting read I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+
+rdwait:
+ ftsleep(wc_buff_done, 0);
+
+rddone:
+ bad = sp->reqbad;
+ sr->sg_crcmap = sp->reqcrc & ~bad;
+
+ /* Copy out segment and discard bad mapped blocks. */
+ cp = sp->buff; cp2 = sr->sg_data;
+ for (i = 0; i < QCV_BLKSEG; cp += QCV_BLKSIZE, i++) {
+ if (bad & (1 << i)) continue;
+ copyout(cp, cp2, QCV_BLKSIZE);
+ cp2 += QCV_BLKSIZE;
+ }
+ segio_free(ft, sp);
+ } else {
+ if (ft->segh != NULL && ft->segh->reqtype != FTIO_WRITING)
+ tape_inactive(ftu);
+
+ /* Allocate a buffer and start tape if we're running low. */
+ sp = segio_alloc(ft);
+ if (!ft->active && (sp == NULL || ft->nfreelist <= 1)) {
+ DPRT(("Starting write I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = ft->segh->reqblk;
+ ft->xseg = ft->segh->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = ft->segh->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+ }
+
+ /* Sleep until a buffer becomes available. */
+ while (sp == NULL) {
+ ftsleep(wc_buff_avail, 0);
+ sp = segio_alloc(ft);
+ }
+
+ /* Copy in segment and expand bad blocks. */
+ bad = sr->sg_badmap;
+ cp = sr->sg_data; cp2 = sp->buff;
+ for (i = 0; i < QCV_BLKSEG; cp2 += QCV_BLKSIZE, i++) {
+ if (bad & (1 << i)) continue;
+ copyin(cp, cp2, QCV_BLKSIZE);
+ cp += QCV_BLKSIZE;
+ }
+ sp->reqblk = blk;
+ sp->reqseg = seg;
+ sp->reqcan = 0;
+ sp->reqtype = FTIO_WRITING;
+ segio_queue(ft, sp);
+ }
+ splx(s);
+ return(0);
+}
+
+
+/*
+ * Rewind to beginning of tape
+ */
+static int
+ftreq_rewind(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_SEEKSTART);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_SEEKTRACK);
+ tape_cmd(ftu, 2);
+ tape_state(ftu, 0, QS_READY, 90);
+ ft->lastpos = -1;
+ ft->moving = 0;
+ return(0);
+}
+
+
+/*
+ * Move to logical beginning or end of track
+ */
+static int
+ftreq_trkpos(ftu_t ftu, int req)
+{
+ int curtrk, r, cmd;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0) return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+
+ if (ftg == NULL || ft->newcart) {
+ if (ftgetgeom(ftu) < 0) return(ENXIO);
+ }
+
+ curtrk = (ft->lastpos < 0) ? 0 : ft->lastpos / ftg->g_blktrk;
+ if (req == QIOBOT)
+ cmd = (curtrk & 1) ? QC_SEEKEND : QC_SEEKSTART;
+ else
+ cmd = (curtrk & 1) ? QC_SEEKSTART : QC_SEEKEND;
+ tape_cmd(ftu, cmd);
+ tape_state(ftu, 0, QS_READY, 90);
+ return(0);
+}
+
+
+/*
+ * Seek tape head to a particular track.
+ */
+static int
+ftreq_trkset(ftu_t ftu, int *trk)
+{
+ int r;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0) return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+ if (ftg == NULL || ft->newcart) {
+ if (ftgetgeom(ftu) < 0) return(ENXIO);
+ }
+
+ tape_cmd(ftu, QC_SEEKTRACK);
+ tape_cmd(ftu, *trk + 2);
+ tape_state(ftu, 0, QS_READY, 90);
+ return(0);
+}
+
+
+/*
+ * Start tape moving forward.
+ */
+static int
+ftreq_lfwd(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_FORWARD);
+ ft->moving = 1;
+ return(0);
+}
+
+
+/*
+ * Stop the tape
+ */
+static int
+ftreq_stop(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ ft->moving = 0;
+ return(0);
+}
+
+
+/*
+ * Set the particular mode the drive should be in.
+ */
+static int
+ftreq_setmode(ftu_t ftu, int cmd)
+{
+ int r;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ r = tape_status(ftu);
+
+ switch(cmd) {
+ case QIOPRIMARY:
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY);
+ break;
+ case QIOFORMAT:
+ if (r & QS_RDONLY) return(ENXIO);
+ if ((r & QS_BOT) == 0) return(ENXIO);
+ tape_cmd(ftu, QC_FORMAT);
+ break;
+ case QIOVERIFY:
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+ tape_cmd(ftu, QC_VERIFY);
+ break;
+ }
+ tape_state(ftu, 0, QS_READY, 60);
+ return(0);
+}
+
+
+/*
+ * Return drive status bits
+ */
+static int
+ftreq_status(ftu_t ftu, unsigned long cmd, int *sts, struct proc *p)
+{
+ ft_p ft = ft_data[ftu];
+
+ if (ft->active)
+ *sts = ft->laststs & ~QS_READY;
+ else
+ *sts = tape_status(ftu);
+ return(0);
+}
+
+
+/*
+ * Return drive configuration bits
+ */
+static int
+ftreq_config(ftu_t ftu, unsigned long cmd, int *cfg, struct proc *p)
+{
+ int r, tries;
+ ft_p ft = ft_data[ftu];
+
+ if (ft->active)
+ r = ft->lastcfg;
+ else {
+ for (r = -1, tries = 0; r < 0 && tries < 3; tries++)
+ r = qic_status(ftu, QC_CONFIG, 8);
+ if (tries == 3) return(ENXIO);
+ }
+ *cfg = r;
+ return(0);
+}
+
+
+/*
+ * Return current tape's geometry.
+ */
+static int
+ftreq_geom(ftu_t ftu, QIC_Geom *g)
+{
+ tape_inactive(ftu);
+ if (ftg == NULL && ftgetgeom(ftu) < 0) return(ENXIO);
+ bcopy(ftg, g, sizeof(QIC_Geom));
+ return(0);
+}
+
+
+/*
+ * Return drive hardware information
+ */
+static int
+ftreq_hwinfo(ftu_t ftu, QIC_HWInfo *hwp)
+{
+ int tries;
+ int rom, vend;
+
+ tape_inactive(ftu);
+ bzero(hwp, sizeof(QIC_HWInfo));
+
+ for (rom = -1, tries = 0; rom < 0 && tries < 3; tries++)
+ rom = qic_status(ftu, QC_VERSION, 8);
+ if (rom > 0) {
+ hwp->hw_rombeta = (rom >> 7) & 0x01;
+ hwp->hw_romid = rom & 0x7f;
+ }
+
+ for (vend = -1, tries = 0; vend < 0 && tries < 3; tries++)
+ vend = qic_status(ftu, QC_VENDORID, 16);
+ if (vend > 0) {
+ hwp->hw_make = (vend >> 6) & 0x3ff;
+ hwp->hw_model = vend & 0x3f;
+ }
+
+ return(0);
+}
+
+
+/*
+ * Receive or Send the in-core header segment.
+ */
+static int
+ftreq_hdr(ftu_t ftu, unsigned long cmd, QIC_Segment *sp)
+{
+ ft_p ft = ft_data[ftu];
+ QIC_Header *h = (QIC_Header *)ft->hdr->buff;
+
+ if (sp == NULL || sp->sg_data == NULL) return(EINVAL);
+ if (cmd == QIOSENDHDR) {
+ copyin(sp->sg_data, ft->hdr->buff, QCV_SEGSIZE);
+ } else {
+ if (h->qh_sig != QCV_HDRMAGIC) return(EIO);
+ copyout(ft->hdr->buff, sp->sg_data, QCV_SEGSIZE);
+ }
+ return(0);
+}
+
+/*
+ * I/O functions.
+ */
+int
+ftioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, struct proc *p)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+
+ switch(cmd) {
+ case QIOREAD: /* Request reading a segment from tape. */
+ case QIOWRITE: /* Request writing a segment to tape. */
+ return(ftreq_rw(ftu, cmd, (QIC_Segment *)data, p));
+
+ case QIOREWIND: /* Rewind tape. */
+ return(ftreq_rewind(ftu));
+
+ case QIOBOT: /* Seek to logical beginning of track. */
+ case QIOEOT: /* Seek to logical end of track. */
+ return(ftreq_trkpos(ftu, cmd));
+
+ case QIOTRACK: /* Seek tape head to specified track. */
+ return(ftreq_trkset(ftu, (int *)data));
+
+ case QIOSEEKLP: /* Seek load point. */
+ goto badreq;
+
+ case QIOFORWARD: /* Move tape in logical forward direction. */
+ return(ftreq_lfwd(ftu));
+
+ case QIOSTOP: /* Causes tape to stop. */
+ return(ftreq_stop(ftu));
+
+ case QIOPRIMARY: /* Enter primary mode. */
+ case QIOFORMAT: /* Enter format mode. */
+ case QIOVERIFY: /* Enter verify mode. */
+ return(ftreq_setmode(ftu, cmd));
+
+ case QIOWRREF: /* Write reference burst. */
+ goto badreq;
+
+ case QIOSTATUS: /* Get drive status. */
+ return(ftreq_status(ftu, cmd, (int *)data, p));
+
+ case QIOCONFIG: /* Get tape configuration. */
+ return(ftreq_config(ftu, cmd, (int *)data, p));
+
+ case QIOGEOM:
+ return(ftreq_geom(ftu, (QIC_Geom *)data));
+
+ case QIOHWINFO:
+ return(ftreq_hwinfo(ftu, (QIC_HWInfo *)data));
+
+ case QIOSENDHDR:
+ case QIORECVHDR:
+ return(ftreq_hdr(ftu, cmd, (QIC_Segment *)data));
+ }
+badreq:
+ DPRT(("ft%d: unknown ioctl(%#lx) request\n", ftu, cmd));
+ return(ENXIO);
+}
+
+#endif
diff --git a/sys/i386/isa/ftreg.h b/sys/i386/isa/ftreg.h
new file mode 100644
index 000000000000..eea78ec9ea5a
--- /dev/null
+++ b/sys/i386/isa/ftreg.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 1993, 1994 Steve Gerakines
+ *
+ * This is freely redistributable software. You may do anything you
+ * wish with it, so long as the above notice stays intact.
+ *
+ * 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.
+ *
+ * ftreg.h - QIC-40/80 floppy tape driver header
+ * 06/03/94 v0.9
+ * Changed seek load point to QC_SEEKLP, added reqseg to SegReq structure.
+ *
+ * 10/30/93 v0.3
+ * More things will end up here. QC_VENDORID and QC_VERSION now used.
+ *
+ * 08/07/93 v0.2 release
+ * Things that should've been here in the first place were moved.
+ * Tape geometry and segment request types were added.
+ *
+ * 06/03/93 v0.1 Alpha release
+ * Initial revision. Many more things should be moved here.
+ */
+
+/* QIC-117 command set. */
+#define QC_RESET 1 /* reset */
+#define QC_NEXTBIT 2 /* report next bit */
+#define QC_PAUSE 3 /* pause */
+#define QC_STPAUSE 4 /* step pause */
+#define QC_TIMEOUT 5 /* alt timeout */
+#define QC_STATUS 6 /* report status */
+#define QC_ERRCODE 7 /* report error code */
+#define QC_CONFIG 8 /* report config */
+#define QC_VERSION 9 /* report version */
+#define QC_FORWARD 10 /* logical forward */
+#define QC_SEEKSTART 11 /* seek to track start */
+#define QC_SEEKEND 12 /* seek to track end */
+#define QC_SEEKTRACK 13 /* seek head to track */
+#define QC_SEEKLP 14 /* seek load point */
+#define QC_FORMAT 15 /* format mode */
+#define QC_WRITEREF 16 /* write reference */
+#define QC_VERIFY 17 /* verify mode */
+#define QC_STOP 18 /* stop tape */
+#define QC_STEPUP 21 /* step head up */
+#define QC_STEPDOWN 22 /* step head down */
+#define QC_SEEKREV 25 /* seek reverse */
+#define QC_SEEKFWD 26 /* seek forward */
+#define QC_RATE 27 /* select data rate */
+#define QC_DIAG1 28 /* diagnostic mode 1 */
+#define QC_DIAG2 29 /* diagnostic mode 2 */
+#define QC_PRIMARY 30 /* primary mode */
+#define QC_VENDORID 32 /* vendor id */
+#define QC_TSTATUS 33 /* report tape status */
+#define QC_EXTREV 34 /* extended skip reverse */
+#define QC_EXTFWD 35 /* extended skip forward */
+
+/* Colorado enable/disable. */
+#define QC_COL_ENABLE1 46 /* enable */
+#define QC_COL_ENABLE2 2 /* unit+2 */
+#define QC_COL_DISABLE 47 /* disable */
+
+/* Mountain enable/disable. */
+#define QC_MTN_ENABLE1 23 /* enable 1 */
+#define QC_MTN_ENABLE2 20 /* enable 2 */
+#define QC_MTN_DISABLE 24 /* disable */
+
+/* Segment I/O request. */
+typedef struct segq {
+ unsigned char buff[QCV_SEGSIZE];/* Segment data; first for alignment */
+ int reqtype; /* Request type */
+ long reqcrc; /* CRC Errors found */
+ long reqbad; /* Bad sector map */
+ long reqblk; /* Block request starts at */
+ long reqseg; /* Segment request is at */
+ int reqcan; /* Cancel read-ahead */
+ struct segq *next; /* Next request */
+} SegReq;
+
+typedef int ftu_t;
+typedef int ftsu_t;
+typedef struct ft_data *ft_p;
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 1fa83761b853..44a97ea7c72e 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -71,13 +71,9 @@
#define DMA1_READY 0x08
#ifdef GSCDEBUG
-#define lprintf(args) \
- do { \
- if (scu->flags & FLAG_DEBUG) \
- printf args; \
- } while (0)
+#define lprintf if(scu->flags & FLAG_DEBUG) printf
#else
-#define lprintf(args)
+#define lprintf (void)
#endif
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -230,16 +226,16 @@ lookup_geometry(struct gsc_geom geom, const struct gsc_unit *scu)
( ( geom.g_res != INVALID ) && ( tab.g_res == geom.g_res ) ) ||
( ( geom.s_res != INVALID ) && ( tab.s_res == geom.s_res ) ) )
{
- lprintf(("gsc.lookup_geometry: "
+ lprintf("gsc.lookup_geometry: "
"geometry lookup found: %ddpi, %ddpl\n",
- tab.dpi, tab.dpl));
+ tab.dpi, tab.dpl);
return i;
}
}
- lprintf(("gsc.lookup_geometry: "
+ lprintf("gsc.lookup_geometry: "
"geometry lookup failed on {%d, %d, 0x%02x, 0x%02x}\n",
- geom.dpi, geom.dpl, geom.g_res, geom.s_res));
+ geom.dpi, geom.dpl, geom.g_res, geom.s_res);
return INVALID;
}
@@ -257,7 +253,7 @@ get_geometry(const struct gsc_unit *scu)
{
struct gsc_geom geom = NEW_GEOM;
- lprintf(("gsc.get_geometry: get geometry at 0x%03x\n", scu->stat));
+ lprintf("gsc.get_geometry: get geometry at 0x%03x\n", scu->stat);
if ( ( geom.g_res = inb(scu->stat) ) == FAIL )
return INVALID;
@@ -280,18 +276,18 @@ buffer_allocate(struct gsc_unit *scu)
size = scu->blen * geomtab[scu->geometry].dpl / 8;
- lprintf(("gsc.buffer_allocate: need 0x%x bytes\n", size));
+ lprintf("gsc.buffer_allocate: need 0x%x bytes\n", size);
if ( size > MAX_BUFSIZE )
{
- lprintf(("gsc.buffer_allocate: 0x%x bytes are too much\n", size));
+ lprintf("gsc.buffer_allocate: 0x%x bytes are too much\n", size);
return ENOMEM;
}
scu->sbuf.size = size;
scu->sbuf.poi = size;
- lprintf(("gsc.buffer_allocate: ok\n"));
+ lprintf("gsc.buffer_allocate: ok\n");
return SUCCESS;
}
@@ -311,11 +307,11 @@ buffer_read(struct gsc_unit *scu)
int sps;
int delay;
- lprintf(("gsc.buffer_read: begin\n"));
+ lprintf("gsc.buffer_read: begin\n");
if (scu->ctrl_byte == INVALID)
{
- lprintf(("gsc.buffer_read: invalid ctrl_byte\n"));
+ lprintf("gsc.buffer_read: invalid ctrl_byte\n");
return EIO;
}
@@ -334,7 +330,7 @@ buffer_read(struct gsc_unit *scu)
if(delay >= scu->btime)
{
splx(sps);
- lprintf(("gsc.buffer_read: timeout\n"));
+ lprintf("gsc.buffer_read: timeout\n");
res = EWOULDBLOCK;
break;
}
@@ -350,16 +346,16 @@ buffer_read(struct gsc_unit *scu)
if(res != SUCCESS)
{
- lprintf(("gsc.buffer_read: aborted with %d\n", res));
+ lprintf("gsc.buffer_read: aborted with %d\n", res);
return res;
}
- lprintf(("gsc.buffer_read: invert buffer\n"));
+ lprintf("gsc.buffer_read: invert buffer\n");
for(p = scu->sbuf.base + scu->sbuf.size - 1; p >= scu->sbuf.base; p--)
*p = ~*p;
scu->sbuf.poi = 0;
- lprintf(("gsc.buffer_read: ok\n"));
+ lprintf("gsc.buffer_read: ok\n");
return SUCCESS;
}
@@ -388,25 +384,25 @@ gscprobe (struct isa_device *isdp)
scu->flags = FLAG_DEBUG;
- lprintf(("gsc%d.probe "
- "on iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n",
+ lprintf("gsc%d.probe "
+ "on iobase 0x%03x, irq %d, drq %d, addr %d, size %d\n",
unit,
isdp->id_iobase,
isdp->id_irq,
isdp->id_drq,
isdp->id_maddr,
- isdp->id_msize));
+ isdp->id_msize);
if ( isdp->id_iobase < 0 )
{
- lprintf(("gsc%d.probe: no iobase given\n", unit));
+ lprintf("gsc%d.probe: no iobase given\n", unit);
return PROBE_FAIL;
}
stb = inb( GSC_STAT(isdp->id_iobase) );
if (stb == FAIL)
{
- lprintf(("gsc%d.probe: get status byte failed\n", unit));
+ lprintf("gsc%d.probe: get status byte failed\n", unit);
return PROBE_FAIL;
}
@@ -420,25 +416,25 @@ gscprobe (struct isa_device *isdp)
switch(stb & GSC_CNF_MASK) {
case GSC_CNF_DMA1:
- lprintf(("gsc%d.probe: DMA 1\n", unit));
+ lprintf("gsc%d.probe: DMA 1\n", unit);
scu->channel = 1;
break;
case GSC_CNF_DMA3:
- lprintf(("gsc%d.probe: DMA 3\n", unit));
+ lprintf("gsc%d.probe: DMA 3\n", unit);
scu->channel = 3;
break;
case GSC_CNF_IRQ3:
- lprintf(("gsc%d.probe: IRQ 3\n", unit));
+ lprintf("gsc%d.probe: IRQ 3\n", unit);
goto probe_noirq;
case GSC_CNF_IRQ5:
- lprintf(("gsc%d.probe: IRQ 5\n", unit));
+ lprintf("gsc%d.probe: IRQ 5\n", unit);
probe_noirq:
- lprintf(("gsc%d.probe: sorry, can't use IRQ yet\n", unit));
+ lprintf("gsc%d.probe: sorry, can't use IRQ yet\n", unit);
return PROBE_FAIL;
default:
- lprintf(("gsc%d.probe: invalid status byte 0x%02x\n", unit, (u_char) stb));
+ lprintf("gsc%d.probe: invalid status byte\n", unit, stb);
return PROBE_FAIL;
}
@@ -446,8 +442,8 @@ gscprobe (struct isa_device *isdp)
isdp->id_drq = scu->channel;
if (scu->channel != isdp->id_drq)
{
- lprintf(("gsc%d.probe: drq mismatch: config: %d; hardware: %d\n",
- unit, isdp->id_drq, scu->channel));
+ lprintf("gsc%d.probe: drq mismatch: config: %d; hardware: %d\n",
+ unit, isdp->id_drq, scu->channel);
return PROBE_FAIL;
}
@@ -455,7 +451,7 @@ gscprobe (struct isa_device *isdp)
scu->geometry = lookup_geometry(geom, scu);
if (scu->geometry == INVALID)
{
- lprintf(("gsc%d.probe: geometry lookup failed\n", unit));
+ lprintf("gsc%d.probe: geometry lookup failed\n", unit);
return PROBE_FAIL;
}
else
@@ -463,13 +459,13 @@ gscprobe (struct isa_device *isdp)
scu->ctrl_byte = geomtab[scu->geometry].s_res;
outb(scu->ctrl, scu->ctrl_byte | GSC_POWER_ON);
- lprintf(("gsc%d.probe: status 0x%02x, %ddpi\n",
- unit, stb, geomtab[scu->geometry].dpi));
+ lprintf("gsc%d.probe: status 0x%02x, %ddpi\n",
+ unit, stb, geomtab[scu->geometry].dpi);
outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON);
}
- lprintf(("gsc%d.probe: ok\n", unit));
+ lprintf("gsc%d.probe: ok\n", unit);
scu->flags &= ~FLAG_DEBUG;
@@ -492,14 +488,14 @@ gscattach(struct isa_device *isdp)
scu->flags |= FLAG_DEBUG;
- lprintf(("gsc%d.attach: "
- "iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n",
+ lprintf("gsc%d.attach: "
+ "iobase 0x%03x, irq %d, drq %d, addr %d, size %d\n",
unit,
isdp->id_iobase,
isdp->id_irq,
isdp->id_drq,
isdp->id_maddr,
- isdp->id_msize));
+ isdp->id_msize);
printf("gsc%d: GeniScan GS-4500 at %ddpi\n",
unit, geomtab[scu->geometry].dpi);
@@ -513,7 +509,7 @@ gscattach(struct isa_device *isdp)
0ul, 0xfffffful, 1ul, 0x10000ul);
if ( scu->sbuf.base == NULL )
{
- lprintf(("gsc%d.attach: buffer allocation failed\n", unit));
+ lprintf("gsc%d.attach: buffer allocation failed\n", unit);
return ATTACH_FAIL; /* XXX attach must not fail */
}
scu->sbuf.size = INVALID;
@@ -523,7 +519,7 @@ gscattach(struct isa_device *isdp)
scu->btime = TIMEOUT;
scu->flags |= ATTACHED;
- lprintf(("gsc%d.attach: ok\n", unit));
+ lprintf("gsc%d.attach: ok\n", unit);
scu->flags &= ~FLAG_DEBUG;
#ifdef DEVFS
#define GSC_UID 0
@@ -573,8 +569,8 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
scu = unittab + unit;
if ( !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.open: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.open: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -586,23 +582,23 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
switch(minor(dev) & FRMT_MASK) {
case FRMT_PBM:
scu->flags |= PBM_MODE;
- lprintf(("gsc%d.open: pbm mode\n", unit));
+ lprintf("gsc%d.open: pbm mode\n", unit);
break;
case FRMT_RAW:
- lprintf(("gsc%d.open: raw mode\n", unit));
+ lprintf("gsc%d.open: raw mode\n", unit);
scu->flags &= ~PBM_MODE;
break;
default:
- lprintf(("gsc%d.open: gray maps are not yet supported", unit));
+ lprintf("gsc%d.open: gray maps are not yet supported", unit);
return ENXIO;
}
- lprintf(("gsc%d.open: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.open: minor %d\n",
+ unit, minor(dev));
if ( scu->flags & OPEN )
{
- lprintf(("gsc%d.open: already open", unit));
+ lprintf("gsc%d.open: already open", unit);
return EBUSY;
}
@@ -628,13 +624,13 @@ gscclose (dev_t dev, int flags, int fmt, struct proc *p)
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
- lprintf(("gsc%d.close: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.close: minor %d\n",
+ unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.read: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -663,12 +659,12 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
size_t nbytes;
int res;
- lprintf(("gsc%d.read: minor %d\n", unit, minor(dev)));
+ lprintf("gsc%d.read: minor %d\n", unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.read: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -691,8 +687,8 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
sprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height);
scu->bcount = scu->height * width / 8;
- lprintf(("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n",
- unit, scu->sbuf.base, scu->bcount));
+ lprintf("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n",
+ unit, scu->sbuf.base, scu->bcount);
/* move header to end of sbuf */
for(p=scu->sbuf.base; *p; p++);
@@ -704,37 +700,37 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
}
}
- lprintf(("gsc%d.read(before buffer_read): "
+ lprintf("gsc%d.read(before buffer_read): "
"size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
if ( scu->sbuf.poi == scu->sbuf.size )
if ( (res = buffer_read(scu)) != SUCCESS )
return res;
- lprintf(("gsc%d.read(after buffer_read): "
+ lprintf("gsc%d.read(after buffer_read): "
"size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
nbytes = MIN( uio->uio_resid, scu->sbuf.size - scu->sbuf.poi );
if ( (scu->flags & PBM_MODE) )
nbytes = MIN( nbytes, scu->bcount );
- lprintf(("gsc%d.read: transferring 0x%x bytes", unit, nbytes));
+ lprintf("gsc%d.read: transferring 0x%x bytes", nbytes);
res = uiomove(scu->sbuf.base + scu->sbuf.poi, nbytes, uio);
if ( res != SUCCESS )
{
- lprintf(("gsc%d.read: uiomove failed %d", unit, res));
+ lprintf("gsc%d.read: uiomove failed %d", unit, res);
return res;
}
scu->sbuf.poi += nbytes;
if ( scu->flags & PBM_MODE ) scu->bcount -= nbytes;
- lprintf(("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ lprintf("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
return SUCCESS;
}
@@ -751,38 +747,38 @@ gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
- lprintf(("gsc%d.ioctl: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.ioctl: minor %d\n",
+ unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.ioctl: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.ioctl: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
switch(cmd) {
case GSC_SRESSW:
- lprintf(("gsc%d.ioctl:GSC_SRESSW\n", unit));
+ lprintf("gsc%d.ioctl:GSC_SRESSW\n", unit);
if ( scu->flags & READING )
{
- lprintf(("gsc%d:ioctl on already reading unit\n", unit));
+ lprintf("gsc%d:ioctl on already reading unit\n", unit);
return EBUSY;
}
scu->geometry = get_geometry(scu);
return SUCCESS;
case GSC_GRES:
*(int *)data=geomtab[scu->geometry].dpi;
- lprintf(("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data);
return SUCCESS;
case GSC_GWIDTH:
*(int *)data=geomtab[scu->geometry].dpl;
- lprintf(("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SRES:
case GSC_SWIDTH:
- lprintf(("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n",
- unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n",
+ unit, *(int *)data);
{ int g;
struct gsc_geom geom = NEW_GEOM;
if ( cmd == GSC_SRES )
@@ -796,37 +792,37 @@ gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
case GSC_GHEIGHT:
*(int *)data=scu->height;
- lprintf(("gsc%d.ioctl:GSC_GHEIGHT %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GHEIGHT %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SHEIGHT:
- lprintf(("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data);
if ( scu->flags & READING )
{
- lprintf(("gsc%d:ioctl on already reading unit\n", unit));
+ lprintf("gsc%d:ioctl on already reading unit\n", unit);
return EBUSY;
}
scu->height=*(int *)data;
return SUCCESS;
case GSC_GBLEN:
*(int *)data=scu->blen;
- lprintf(("gsc%d.ioctl:GSC_GBLEN %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GBLEN %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SBLEN:
- lprintf(("gsc%d.ioctl:GSC_SBLEN %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SBLEN %d\n", unit, *(int *)data);
if (*(int *)data * geomtab[scu->geometry].dpl / 8 > MAX_BUFSIZE)
{
- lprintf(("gsc%d:ioctl buffer size too high\n", unit));
+ lprintf("gsc%d:ioctl buffer size too high\n", unit);
return ENOMEM;
}
scu->blen=*(int *)data;
return SUCCESS;
case GSC_GBTIME:
*(int *)data = scu->btime / hz;
- lprintf(("gsc%d.ioctl:GSC_GBTIME %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GBTIME %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SBTIME:
scu->btime = *(int *)data * hz;
- lprintf(("gsc%d.ioctl:GSC_SBTIME %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SBTIME %d\n", unit, *(int *)data);
return SUCCESS;
default: return ENOTTY;
}
diff --git a/sys/i386/isa/ic/cd1400.h b/sys/i386/isa/ic/cd1400.h
index ee9b9f27a4dd..52081fe9b836 100644
--- a/sys/i386/isa/ic/cd1400.h
+++ b/sys/i386/isa/ic/cd1400.h
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cd1400.h,v 1.4 1997/02/22 09:37:59 peter Exp $
+ * $Id$
*/
/*
@@ -99,7 +99,6 @@
#define CD1400_CCR_CMDRESET (1<<7) /* enables following: */
#define CD1400_CCR_FTF (1<<1) /* flush tx fifo */
#define CD1400_CCR_FULLRESET (1<<0) /* full reset */
-#define CD1400_CCR_CHANRESET 0 /* current channel */
#define CD1400_CCR_CMDCORCHG (1<<6) /* enables following: */
#define CD1400_CCR_COR3 (1<<3) /* COR3 changed */
#define CD1400_CCR_COR2 (1<<2) /* COR2 changed */
@@ -134,10 +133,6 @@
#define CD1400_COR2_IXANY (1<<7) /* implied XON mode */
#define CD1400_COR2_IXOFF (1<<6) /* in-band tx flow control */
#define CD1400_COR2_ETC (1<<5) /* embedded tx command */
-#define CD1400_ETC_CMD 0x00 /* start an ETC */
-#define CD1400_ETC_SENDBREAK 0x81
-#define CD1400_ETC_INSERTDELAY 0x82
-#define CD1400_ETC_STOPBREAK 0x83
#define CD1400_COR2_LLM (1<<4) /* local loopback mode */
#define CD1400_COR2_RLM (1<<3) /* remote loopback mode */
#define CD1400_COR2_RTSAO (1<<2) /* RTS auto output */
diff --git a/sys/i386/isa/ic/esp.h b/sys/i386/isa/ic/esp.h
index cc74b0b67720..6621e6503917 100644
--- a/sys/i386/isa/ic/esp.h
+++ b/sys/i386/isa/ic/esp.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: esp.h,v 1.4 1999/01/03 05:03:46 kato Exp $
+ * $Id$
*/
#ifndef _IC_ESP_H_
@@ -59,9 +59,6 @@
#define ESP_SETFLOWTYPE 0x08 /* set type of flow-control (2 bytes) */
#define ESP_SETRXFLOW 0x0a /* set Rx FIFO flow control levels (4 bytes) */
#define ESP_SETMODE 0x10 /* set board mode (1 byte) */
-#ifdef PC98
-#define ESP_SETCLOCK 0x23 /* set UART clock prescaler */
-#endif
/* Mode bits (ESP_SETMODE). */
#define ESP_MODE_FIFO 0x02 /* act like a 16550 (compatibility mode) */
diff --git a/sys/i386/isa/ic/ncr53400.h b/sys/i386/isa/ic/ncr53400.h
new file mode 100644
index 000000000000..4a60f018826f
--- /dev/null
+++ b/sys/i386/isa/ic/ncr53400.h
@@ -0,0 +1,49 @@
+/*
+ * Definitions for 53C400 SCSI-controller chip.
+ *
+ * Derived from Linux NCR-5380 generic driver sources (by Drew Eckhardt).
+ *
+ * Copyright (C) 1994 Serge Vakulenko (vak@cronyx.ru)
+ *
+ * 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 DEVELOPERS ``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 DEVELOPERS 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 _IC_NCR_53C400_H_
+#define _IC_NCR_53C400_H_
+
+#define C400_CSR 0 /* rw - Control and Status Reg. */
+#define CSR_5380_ENABLE 0x80
+#define CSR_TRANSFER_DIRECTION 0x40
+#define CSR_TRANSFER_READY_INTR 0x20
+#define CSR_5380_INTR 0x10
+#define CSR_SHARED_INTR 0x08
+#define CSR_HOST_BUF_NOT_READY 0x04 /* read only */
+#define CSR_SCSI_BUF_READY 0x02 /* read only */
+#define CSR_5380_GATED_IRQ 0x01 /* read only */
+#define CSR_BITS "\20\1irq\2sbrdy\3hbrdy\4shintr\5intr\6tintr\7tdir\10enable"
+
+#define C400_CCR 1 /* rw - Clock Counter Reg. */
+#define C400_HBR 4 /* rw - Host Buffer Reg. */
+
+#define C400_5380_REG_OFFSET 8 /* Offset of 5380 registers. */
+
+#endif /* _IC_NCR_53C400_H_ */
diff --git a/sys/i386/isa/ic/ncr5380.h b/sys/i386/isa/ic/ncr5380.h
new file mode 100644
index 000000000000..ce14fec3da2f
--- /dev/null
+++ b/sys/i386/isa/ic/ncr5380.h
@@ -0,0 +1,90 @@
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ * Modified by Serge Vakulenko (vak@cronyx.ru)
+ *
+ * ncr_5380.h,v 1.2 1994/09/11 20:29:18 phk Exp
+ *
+ * Definitions for 5380 SCSI-controller chip.
+ *
+ * Derived from "NCR 53C80 Family SCSI Protocol Controller Data Manual"
+ */
+
+#ifndef _IC_NCR_5380_H_
+#define _IC_NCR_5380_H_
+
+#define C80_CSDR 0 /* ro - Current SCSI Data Reg. */
+#define C80_ODR 0 /* wo - Output Data Reg. */
+
+#define C80_ICR 1 /* rw - Initiator Command Reg. */
+#define ICR_ASSERT_RST 0x80
+#define ICR_ARBITRATION_IN_PROGRESS 0x40 /* read only */
+#define ICR_TRI_STATE_MODE 0x40 /* write only */
+#define ICR_LOST_ARBITRATION 0x20 /* read only */
+#define ICR_DIFF_ENABLE 0x20 /* write only */
+#define ICR_ASSERT_ACK 0x10
+#define ICR_ASSERT_BSY 0x08
+#define ICR_ASSERT_SEL 0x04
+#define ICR_ASSERT_ATN 0x02
+#define ICR_ASSERT_DATA_BUS 0x01
+#define ICR_BITS "\20\1dbus\2atn\3sel\4bsy\5ack\6arblost\7arb\10rst"
+
+/*
+ * The mask to use when doing read_modify_write on ICR.
+ */
+#define ICR_MASK (~(ICR_DIFF_ENABLE | ICR_TRI_STATE_MODE))
+
+#define C80_MR 2 /* rw - Mode Reg. */
+#define MR_BLOCK_MODE_DMA 0x80
+#define MR_TARGET_MODE 0x40
+#define MR_ENABLE_PARITY_CHECKING 0x20
+#define MR_ENABLE_PARITY_INTERRUPT 0x10
+#define MR_ENABLE_EOP_INTERRUPT 0x08
+#define MR_MONITOR_BUSY 0x04
+#define MR_DMA_MODE 0x02
+#define MR_ARBITRATE 0x01
+#define MR_BITS "\20\1arb\2dma\3mbusy\4eopintr\5parintr\6pcheck\7targ\10blk"
+
+#define C80_TCR 3 /* rw - Target Command Reg. */
+#define TCR_LAST_BYTE_SENT 0x80 /* read only */
+#define TCR_ASSERT_REQ 0x08
+#define TCR_ASSERT_MSG 0x04
+#define TCR_ASSERT_CD 0x02
+#define TCR_ASSERT_IO 0x01
+#define TCR_BITS "\20\1i/o\2c/d\3msg\4req\10lastbyte"
+
+#define C80_CSBR 4 /* ro - Current SCSI Bus Status Reg. */
+#define CSBR_RST 0x80
+#define CSBR_BSY 0x40
+#define CSBR_REQ 0x20
+#define CSBR_MSG 0x10
+#define CSBR_CD 0x08
+#define CSBR_IO 0x04
+#define CSBR_SEL 0x02
+#define CSBR_ACK 0x01
+#define CSBR_BITS "\20\1ack\2sel\3i/o\4c/d\5msg\6req\7bsy\10rst"
+
+#define C80_SER 4 /* wo - Select Enable Reg. */
+
+#define C80_BSR 5 /* ro - Bus and Status Reg. */
+#define BSR_END_OF_DMA_XFER 0x80
+#define BSR_DMA_REQUEST 0x40
+#define BSR_PARITY_ERROR 0x20
+#define BSR_INTERRUPT_REQUEST_ACTIVE 0x10
+#define BSR_PHASE_MISMATCH 0x08
+#define BSR_BUSY_ERROR 0x04
+#define BSR_ATN 0x02
+#define BSR_ACK 0x01
+#define BSR_BITS "\20\1ack\2atn\3busyerr\4pherr\5irq\6parerr\7drq\10dend"
+
+#define C80_SDSR 5 /* wo - Start DMA Send Reg. */
+#define C80_IDR 6 /* ro - Input Data Reg. */
+#define C80_SDTR 6 /* wo - Start DMA Target Receive Reg. */
+#define C80_RPIR 7 /* ro - Reset Parity/Interrupt Reg. */
+#define C80_SDIR 7 /* wo - Start DMA Initiator Receive Reg. */
+
+#endif /* _IC_NCR_5380_H_ */
diff --git a/sys/i386/isa/ic/ns16550.h b/sys/i386/isa/ic/ns16550.h
index b91f5fd2a839..ba338886c764 100644
--- a/sys/i386/isa/ic/ns16550.h
+++ b/sys/i386/isa/ic/ns16550.h
@@ -31,12 +31,25 @@
* SUCH DAMAGE.
*
* from: @(#)ns16550.h 7.1 (Berkeley) 5/9/91
- * $Id: ns16550.h,v 1.6 1999/01/03 05:03:46 kato Exp $
+ * $Id$
*/
/*
* NS16550 UART registers
*/
+#ifdef PC98
+#define com_data 0x000 /* data register (R/W) */
+#define com_dlbl 0x000 /* divisor latch low (W) */
+#define com_dlbh 0x100 /* divisor latch high (W) */
+#define com_ier 0x100 /* interrupt enable (W) */
+#define com_iir 0x200 /* interrupt identification (R) */
+#define com_fifo 0x200 /* FIFO control (W) */
+#define com_lctl 0x300 /* line control register (R/W) */
+#define com_cfcr 0x300 /* line control register (R/W) */
+#define com_mcr 0x400 /* modem control register (R/W) */
+#define com_lsr 0x500 /* line status register (R/W) */
+#define com_msr 0x600 /* modem status register (R/W) */
+#else /* IBM-PC */
#define com_data 0 /* data register (R/W) */
#define com_dlbl 0 /* divisor latch low (W) */
#define com_dlbh 1 /* divisor latch high (W) */
@@ -48,3 +61,4 @@
#define com_mcr 4 /* modem control register (R/W) */
#define com_lsr 5 /* line status register (R/W) */
#define com_msr 6 /* modem status register (R/W) */
+#endif /* PC98 */
diff --git a/sys/i386/isa/ic/rsa.h b/sys/i386/isa/ic/rsa.h
deleted file mode 100644
index e760e306cacc..000000000000
--- a/sys/i386/isa/ic/rsa.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-
- * Copyright (c) 1999 FreeBSD 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.
- *
- * $Id: $
- */
-
-/*
- * RSA Mode Driver Data Sheet
- *
- * <<Register Map>>
- * Base + 0x00
- * Mode Select Register(Read/Write)
- * bit4=interrupt type(1: level, 0: edge)
- * bit3=Auto RTS-CTS Flow Control Enable
- * bit2=External FIFO Enable
- * bit1=Reserved(Default 0)Don't Change!!
- * bit0=Swap Upper 8byte and Lower 8byte in 16byte space.
- *
- * Base + 0x01
- * Interrupt Enable Register(Read/Write)
- * bit4=Hardware Timer Interrupt Enable
- * bit3=Character Time-Out Interrupt Enable
- * bit2=Tx FIFO Empty Interrupt Enable
- * bit1=Tx FIFO Half Full Interrupt Enable
- * bit0=Rx FIFO Half Full Interrupt Enable
- *
- * Base + 0x02
- * Status Read Register(Read)
- * bit7=Hardware Time Out Interrupt Status(1: True, 0: False)
- * bit6=Character Time Out Interrupt Status
- * bit5=Rx FIFO Full Flag(0: True, 1: False)
- * bit4=Rx FIFO Half Full Flag
- * bit3=Rx FIFO Empty Flag
- * bit2=Tx FIFO Full Flag
- * bit1=Tx FIFO Half Full Flag
- * bit0=Tx FIFO Empty Flag
- *
- * Base + 0x02
- * FIFO Reset Register(Write)
- * Reset Extrnal FIFO
- *
- * Base + 0x03
- * Timer Interval Value Set Register(Read/Write)
- * Range of n: 1-255
- * Interval Value: n * 0.2ms
- *
- * Base + 0x04
- * Timer Control Register(Read/Write)
- * bit0=Timer Enable
- *
- * Base + 0x08 - 0x0f
- * Same as UART 16550
- *
- * Special Regisgter in RSA Mode
- * UART Data Register(Base + 0x08)
- * Data transfer between Extrnal FIFO
- *
- * UART MCR(Base + 0x0c)
- * bit3(OUT2[MCR_IENABLE])=1: Diable 16550 to Rx FIFO transfer
- * bit2(OUT1[MCR_DRS])=1: Diable Tx FIFO to 16550 transfer
- *
- * <<Intrrupt and Intrrupt Reset>>
- * o Reciver Line Status(from UART16550)
- * Reset: Read LSR
- *
- * o Modem Status(from UART16550)
- * Reset: Read MSR
- *
- * o Rx FIFO Half Full(from Extrnal FIFO)
- * Reset: Read Rx FIFO under Hall Full
- *
- * o Character Time Out(from Extrnal FIFO)
- * Reset: Read Rx FIFO or SRR
- *
- * o Tx FIFO Empty(from Extrnal FIFO)
- * Reset: Write Tx FIFO or Read SRR
- *
- * o Tx FIFO Half Full(from Extrnal FIFO)
- * Reset: Write Tx FIFO until Hall Full or Read SRR
- *
- * o Hardware Timer(from Extrnal FIFO)
- * Reset: Disable Timer in TCR
- * Notes: If you want to use Timer for next intrrupt,
- * you must enable Timer in TCR
- *
- * <<Used Setting>>
- * Auto RTS-CTS: Enable or Disable
- * External FIFO: Enable
- * Swap 8bytes: Disable
- * Haredware Timer: Disable
- * interrupt type: edge
- * interrupt source:
- * Hareware Timer
- * Character Time Out
- * Tx FIFO Empty
- * Rx FIFO Half Full
- *
- */
-
-/* I/O-DATA RSA Serise Exrension Register */
-#define rsa_msr 0 /* Mode Status Register (R/W) */
-#define rsa_ier 1 /* Interrupt Enable Register (R/W) */
-#define rsa_srr 2 /* Status Read Register (R) */
-#define rsa_frr 2 /* FIFO Reset Register (W) */
-#define rsa_tivsr 3 /* Timer Interval Value Set Register (R/W) */
-#define rsa_tcr 4 /* Timer Control Register (W) */
diff --git a/sys/i386/isa/if_ar.c b/sys/i386/isa/if_ar.c
index a3fa4a28b37d..adebd22e5489 100644
--- a/sys/i386/isa/if_ar.c
+++ b/sys/i386/isa/if_ar.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ar.c,v 1.23 1998/10/22 05:58:38 bde Exp $
+ * $Id: if_ar.c,v 1.21 1998/06/21 14:53:10 bde Exp $
*/
/*
@@ -178,7 +178,6 @@ static int irqtable[16] = {
struct isa_driver ardriver = {arprobe, arattach, "arc"};
-static ointhand2_t arintr;
static void ar_xmit(struct ar_softc *sc);
static void arstart(struct ifnet *ifp);
static int arioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
@@ -297,7 +296,6 @@ arattach(struct isa_device *id)
int unit;
char *iface;
- id->id_ointr = arintr;
switch(hc->interface) {
default: iface = "UNKNOWN"; break;
case AR_IFACE_EIA_232: iface = "EIA-232"; break;
@@ -357,6 +355,13 @@ arattach(struct isa_device *id)
sppp_attach((struct ifnet *)&sc->ifsppp);
if_attach(ifp);
+ /*
+ * Shortcut the sppp tls/tlf actions to up/down events
+ * since our lower layer is always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
+
#if NBPFILTER > 0
bpfattach(ifp, DLT_PPP, PPP_HEADER_LEN);
#endif
@@ -373,7 +378,7 @@ arattach(struct isa_device *id)
* See if there is other interrupts pending.
* Repeat until there is no more interrupts.
*/
-static void
+void
arintr(int unit)
{
struct ar_hardc *hc = &ar_hardc[unit];
diff --git a/sys/i386/isa/if_cs.c b/sys/i386/isa/if_cs.c
index 1ddfbca1888f..1d044deaa36d 100644
--- a/sys/i386/isa/if_cs.c
+++ b/sys/i386/isa/if_cs.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: if_cs.c,v 1.7 1998/12/07 21:58:21 archie Exp $
+ * $Id: if_cs.c,v 1.4 1998/08/27 22:41:18 msmith Exp $
*
* Device driver for Crystal Semiconductor CS8920 based ethernet
* adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997
@@ -100,9 +100,7 @@ static struct cs_softc {
} cs_softc[NCS];
-#if NPNP > 0
static u_long cs_unit = NCS;
-#endif
static int cs_recv_delay = 570;
SYSCTL_INT(_machdep, OID_AUTO, cs_recv_delay, CTLFLAG_RW, &cs_recv_delay, 0, "");
@@ -110,7 +108,6 @@ SYSCTL_INT(_machdep, OID_AUTO, cs_recv_delay, CTLFLAG_RW, &cs_recv_delay, 0, "")
static int cs_attach __P((struct cs_softc *, int, int));
static int cs_attach_isa __P((struct isa_device *));
static void cs_init __P((void *));
-static ointhand2_t csintr;
static int cs_ioctl __P((struct ifnet *, u_long, caddr_t));
static int cs_probe __P((struct isa_device *));
static int cs_cs89x0_probe __P((struct cs_softc *,
@@ -192,6 +189,7 @@ get_eeprom_cksum(int off, int len, int *buffer)
static int
wait_eeprom_ready(struct cs_softc *sc)
{
+ int timeout=1000;
DELAY ( 30000 ); /* XXX should we do some checks here ? */
return 0;
}
@@ -234,6 +232,7 @@ cs_duplex_auto(struct cs_softc *sc)
static int
enable_tp(struct cs_softc *sc)
{
+ int i;
int unit = sc->arpcom.ac_if.if_unit;
cs_writereg(sc->nic_addr, PP_LineCTL, sc->line_ctl & ~AUI_ONLY);
@@ -254,6 +253,7 @@ enable_tp(struct cs_softc *sc)
static int
send_test_pkt(struct cs_softc *sc)
{
+ int unit = sc->arpcom.ac_if.if_unit;
char test_packet[] = { 0,0,0,0,0,0, 0,0,0,0,0,0,
0, 46, /* A 46 in network order */
0, 0, /* DSAP=0 & SSAP=0 fields */
@@ -342,7 +342,7 @@ cs_cs89x0_probe(struct cs_softc *sc, u_int *dev_irq,
int *dev_drq, int iobase, int unit, int flags)
{
unsigned rev_type = 0;
- int i, irq=0;
+ int i, irq=0, result;
int eeprom_buff[CHKSUM_LEN];
int chip_type, pp_isaint, pp_isadma;
char chip_revision;
@@ -633,7 +633,6 @@ cs_attach_isa(struct isa_device *dev)
struct cs_softc *sc=&cs_softc[unit];
int flags=dev->id_flags;
- dev->id_ointr = csintr;
return cs_attach(sc, unit, flags);
}
@@ -645,7 +644,7 @@ cs_init(void *xsc)
{
struct cs_softc *sc=(struct cs_softc *)xsc;
struct ifnet *ifp = &sc->arpcom.ac_if;
- int i, s, rx_cfg;
+ int i, s, result, rx_cfg;
/* address not known */
if (TAILQ_EMPTY(&ifp->if_addrhead)) /* unlikely? XXX */
@@ -815,7 +814,7 @@ static void
csintr_sc(struct cs_softc *sc, int unit)
{
struct ifnet *ifp = &(sc->arpcom.ac_if);
- int status;
+ int status, s;
#ifdef CS_DEBUG
printf(CS_NAME"%1d: Interrupt.\n", unit);
@@ -872,7 +871,7 @@ csintr_sc(struct cs_softc *sc, int unit)
/*
* Handle interrupts
*/
-static void
+void
csintr(int unit)
{
struct cs_softc *sc = &cs_softc[unit];
@@ -1305,6 +1304,7 @@ csintr_pnp_add(struct cs_softc *sc, int unit)
static void
csintr_pnp(int unit)
{
+ struct cs_softc *sc;
struct csintr_list *intr;
for (intr=csintr_head; intr; intr=intr->next) {
@@ -1350,8 +1350,8 @@ cs_pnp_attach(u_long csn, u_long vend_id, char *name,
struct pnp_cinfo d;
int ldn = 0;
int iobase, unit, flags;
- u_int irq;
- int drq;
+ u_short irq;
+ short drq;
struct isa_device *dvp;
struct cs_softc *sc = malloc(sizeof *sc, M_DEVBUF, M_NOWAIT);
@@ -1367,7 +1367,7 @@ cs_pnp_attach(u_long csn, u_long vend_id, char *name,
irq = dev->id_irq = (1 << d.irq[0] );
drq = dev->id_drq = d.drq[0];
dev->id_maddr = 0;
- dev->id_ointr = csintr_pnp;
+ dev->id_intr = csintr_pnp;
flags = dev->id_flags = 0;
unit = dev->id_unit;
diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c
index d8e5999b97d5..ded05ec33979 100644
--- a/sys/i386/isa/if_cx.c
+++ b/sys/i386/isa/if_cx.c
@@ -62,7 +62,6 @@ static int cxattach __P((struct isa_device *id));
static void cxput __P((cx_chan_t *c, char b));
static void cxsend __P((cx_chan_t *c));
static void cxrinth __P((cx_chan_t *c));
-static ointhand2_t cxintr;
static int cxtinth __P((cx_chan_t *c));
#ifdef DEBUG
@@ -231,8 +230,6 @@ cxattach (struct isa_device *id)
int i;
struct sppp *sp;
- id->id_ointr = cxintr;
-
/* Initialize the board structure. */
cx_init (b, unit, iobase, ffs(irq)-1, drq);
@@ -284,7 +281,13 @@ cxattach (struct isa_device *id)
/* Init routine is never called by upper level? */
sppp_attach (c->ifp);
if_attach (c->ifp);
+ /*
+ * Shortcut the sppp tls/tlf actions to up/down
+ * events since our lower layer is always ready.
+ */
sp = (struct sppp*) c->ifp;
+ sp->pp_tls = sp->pp_up;
+ sp->pp_tlf = sp->pp_down;
#if NBPFILTER > 0
/* If BPF is in the kernel, call the attach for it. */
bpfattach (c->ifp, DLT_PPP, PPP_HEADER_LEN);
@@ -704,7 +707,7 @@ cxtinth (cx_chan_t *c)
return (teoir);
}
-static void
+void
cxintr (int bnum)
{
cx_board_t *b = cxboard + bnum;
diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c
index 9133a485e758..0fed19a15526 100644
--- a/sys/i386/isa/if_ed.c
+++ b/sys/i386/isa/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.147 1998/12/13 23:00:48 eivind Exp $
+ * $Id: if_ed.c,v 1.144 1998/08/24 02:28:15 bde Exp $
*/
/*
@@ -138,7 +138,6 @@ static int ed_attach __P((struct ed_softc *, int, int));
static int ed_attach_isa __P((struct isa_device *));
static void ed_init __P((void *));
-static ointhand2_t edintr;
static int ed_ioctl __P((struct ifnet *, u_long, caddr_t));
static int ed_probe __P((struct isa_device *));
static void ed_start __P((struct ifnet *));
@@ -194,7 +193,6 @@ static u_long ds_crc __P((u_char *ep));
#endif
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -205,7 +203,17 @@ static int edinit __P((struct pccard_devinfo *));
static void edunload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ed, edinit, edunload, card_intr, 0, net_imask);
+static struct pccard_device ed_info = {
+ "ed",
+ edinit,
+ edunload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, ed_info);
/*
* Initialize the device - called from Slot manager.
@@ -1731,7 +1739,6 @@ ed_attach_isa(isa_dev)
struct ed_softc *sc = &ed_softc[unit];
int flags = isa_dev->id_flags;
- isa_dev->id_ointr = edintr;
return ed_attach(sc, unit, flags);
}
@@ -2560,7 +2567,7 @@ edintr_sc(sc)
}
}
-static void
+void
edintr(unit)
int unit;
{
@@ -3459,7 +3466,7 @@ edpnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = edintr;
+ dev->id_intr = edintr;
dev->id_drq = -1;
if (dev->id_driver == NULL) {
diff --git a/sys/i386/isa/if_eg.c b/sys/i386/isa/if_eg.c
new file mode 100644
index 000000000000..7f68aa6429c7
--- /dev/null
+++ b/sys/i386/isa/if_eg.c
@@ -0,0 +1,789 @@
+/*
+ * Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Dean Huxley.
+ * 4. The name of Dean Huxley 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.
+ *
+ * $Id: if_eg.c,v 1.27 1998/03/28 13:23:56 bde Exp $
+ *
+ * Support for 3Com 3c505 Etherlink+ card.
+ */
+
+/* To do:
+ * - multicast
+ * - promiscuous
+ */
+#include "eg.h"
+#include "bpfilter.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/if_egreg.h>
+
+/* for debugging convenience */
+#ifdef EGDEBUG
+#define dprintf(x) printf x
+#else
+#define dprintf(x)
+#endif
+
+#define EG_INLEN 10
+#define EG_BUFLEN 0x0670
+
+/*
+ * Ethernet software status per interface.
+ */
+static struct eg_softc {
+ struct arpcom sc_arpcom; /* Ethernet common part */
+ int eg_cmd; /* Command register R/W */
+ int eg_ctl; /* Control register R/W (EG_CTL_*) */
+ int eg_stat; /* Status register R/O (EG_STAT_*) */
+ int eg_data; /* Data register R/W (16 bits) */
+ u_char eg_rom_major; /* Cards ROM version (major number) */
+ u_char eg_rom_minor; /* Cards ROM version (minor number) */
+ short eg_ram; /* Amount of RAM on the card */
+ u_char eg_pcb[64]; /* Primary Command Block buffer */
+ u_char eg_incount; /* Number of buffers currently used */
+ u_char *eg_inbuf; /* Incoming packet buffer */
+ u_char *eg_outbuf; /* Outgoing packet buffer */
+} eg_softc[NEG];
+
+static int egprobe (struct isa_device *);
+static int egattach (struct isa_device *);
+
+struct isa_driver egdriver = {
+ egprobe, egattach, "eg", 0
+};
+
+static void egprintpcb __P((struct eg_softc *sc));
+static void egprintstat __P((int b));
+static int egoutPCB __P((struct eg_softc *sc, int b));
+static int egreadPCBstat __P((struct eg_softc *sc, int statb));
+static int egreadPCBready __P((struct eg_softc *sc));
+static int egwritePCB __P((struct eg_softc *sc));
+static int egreadPCB __P((struct eg_softc *sc));
+static void eginit __P((struct eg_softc *sc));
+static int egioctl (struct ifnet *, u_long, caddr_t);
+static void egrecv(struct eg_softc *);
+static void egstart(struct ifnet *);
+static void egread __P((struct eg_softc *, caddr_t, int));
+static void egstop __P((struct eg_softc *));
+
+static void egwatchdog __P((struct ifnet *));
+static void egreset __P((struct eg_softc *));
+static struct mbuf *egget __P((struct eg_softc *, caddr_t, int));
+
+/*
+ * Support stuff
+ */
+
+static void
+egprintpcb(sc)
+ struct eg_softc *sc;
+{
+ int i;
+
+ for (i = 0; i < sc->eg_pcb[1] + 2; i++)
+ dprintf(("eg#: pcb[%2d] = %x\n", i, sc->eg_pcb[i]));
+}
+
+
+static void
+egprintstat(b)
+ u_char b;
+{
+ dprintf(("eg#: %s %s %s %s %s %s %s\n",
+ (b & EG_STAT_HCRE)?"HCRE":"",
+ (b & EG_STAT_ACRF)?"ACRF":"",
+ (b & EG_STAT_DIR )?"DIR ":"",
+ (b & EG_STAT_DONE)?"DONE":"",
+ (b & EG_STAT_ASF3)?"ASF3":"",
+ (b & EG_STAT_ASF2)?"ASF2":"",
+ (b & EG_STAT_ASF1)?"ASF1":""));
+}
+
+static int
+egoutPCB(sc, b)
+ struct eg_softc *sc;
+ u_char b;
+{
+ int i;
+
+ for (i=0; i < 4000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_HCRE) {
+ outb(sc->eg_cmd, b);
+ return 0;
+ }
+ DELAY(10);
+ }
+ dprintf(("eg#: egoutPCB failed\n"));
+ return 1;
+}
+
+static int
+egreadPCBstat(sc, statb)
+ struct eg_softc *sc;
+ u_char statb;
+{
+ int i;
+
+ for (i=0; i < 5000; i++) {
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) != EG_PCB_NULL)
+ break;
+ DELAY(10);
+ }
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) == statb)
+ return 0;
+ return 1;
+}
+
+static int
+egreadPCBready(sc)
+ struct eg_softc *sc;
+{
+ int i;
+
+ for (i=0; i < 10000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_ACRF)
+ return 0;
+ DELAY(5);
+ }
+ dprintf(("eg#: PCB read not ready\n"));
+ return 1;
+}
+
+static int
+egwritePCB(sc)
+ struct eg_softc *sc;
+{
+ int i;
+ u_char len;
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_NULL);
+
+ len = sc->eg_pcb[1] + 2;
+ for (i = 0; i < len; i++)
+ egoutPCB(sc, sc->eg_pcb[i]);
+
+ for (i=0; i < 4000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_HCRE)
+ break;
+ DELAY(10);
+ }
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_DONE);
+
+ egoutPCB(sc, len);
+
+ if (egreadPCBstat(sc, EG_PCB_ACCEPT))
+ return 1;
+ return 0;
+}
+
+static int
+egreadPCB(sc)
+ struct eg_softc *sc;
+{
+ int i;
+ u_char b;
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_NULL);
+
+ bzero(sc->eg_pcb, sizeof(sc->eg_pcb));
+
+ if (egreadPCBready(sc))
+ return 1;
+
+ sc->eg_pcb[0] = inb(sc->eg_cmd);
+
+ if (egreadPCBready(sc))
+ return 1;
+
+ sc->eg_pcb[1] = inb(sc->eg_cmd);
+
+ if (sc->eg_pcb[1] > 62) {
+ dprintf(("eg#: len %d too large\n", sc->eg_pcb[1]));
+ return 1;
+ }
+
+ for (i = 0; i < sc->eg_pcb[1]; i++) {
+ if (egreadPCBready(sc))
+ return 1;
+ sc->eg_pcb[2+i] = inb(sc->eg_cmd);
+ }
+ if (egreadPCBready(sc))
+ return 1;
+ if (egreadPCBstat(sc, EG_PCB_DONE))
+ return 1;
+ if ((b = inb(sc->eg_cmd)) != sc->eg_pcb[1] + 2) {
+ dprintf(("eg#: %d != %d\n", b, sc->eg_pcb[1] + 2));
+ return 1;
+ }
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_ACCEPT);
+
+ return 0;
+}
+
+/*
+ * Real stuff
+ */
+
+static int
+egprobe(struct isa_device * id)
+{
+ struct eg_softc *sc = &eg_softc[id->id_unit];
+ int i;
+
+ if (id->id_iobase & ~0x07f0 != 0) {
+ dprintf(("eg#: Weird iobase %x\n", ia->ia_iobase));
+ return 0;
+ }
+
+ sc->eg_cmd = id->id_iobase + EG_COMMAND;
+ sc->eg_ctl = id->id_iobase + EG_CONTROL;
+ sc->eg_stat = id->id_iobase + EG_STATUS;
+ sc->eg_data = id->id_iobase + EG_DATA;
+
+ /* hard reset card */
+ outb(sc->eg_ctl, EG_CTL_RESET);
+ outb(sc->eg_ctl, 0);
+ for (i = 0; i < 1600; i++) {
+ DELAY(10000);
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) == EG_PCB_NULL)
+ break;
+ }
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) != EG_PCB_NULL) {
+ dprintf(("eg#: eg: Reset failed\n"));
+ return 0;
+ }
+ sc->eg_pcb[0] = EG_CMD_GETINFO; /* Get Adapter Info */
+ sc->eg_pcb[1] = 0;
+ if (egwritePCB(sc) != 0)
+ return 0;
+
+ if (egreadPCB(sc) != 0) {
+ egprintpcb(sc);
+ return 0;
+ }
+
+ if (sc->eg_pcb[0] != EG_RSP_GETINFO || /* Get Adapter Info Response */
+ sc->eg_pcb[1] != 0x0a) {
+ egprintpcb(sc);
+ return 0;
+ }
+ sc->eg_rom_major = sc->eg_pcb[3];
+ sc->eg_rom_minor = sc->eg_pcb[2];
+ sc->eg_ram = sc->eg_pcb[6] | (sc->eg_pcb[7] << 8);
+
+ return 8;
+}
+
+static int
+egattach(struct isa_device *id)
+{
+ struct eg_softc *sc = &eg_softc[id->id_unit];
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ egstop(sc);
+
+ sc->eg_pcb[0] = EG_CMD_GETEADDR; /* Get Station address */
+ sc->eg_pcb[1] = 0;
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: write error\n"));
+ return 0;
+ }
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+
+ /* check Get station address response */
+ if (sc->eg_pcb[0] != EG_RSP_GETEADDR || sc->eg_pcb[1] != 0x06) {
+ dprintf(("eg#: parse error\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+ bcopy(&sc->eg_pcb[2], sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
+
+ printf("eg%d: address %6D, type=3COM 3c505 (v%d.%02d, %dk)\n",
+ id->id_unit, sc->sc_arpcom.ac_enaddr, ":",
+ sc->eg_rom_major, sc->eg_rom_minor, sc->eg_ram);
+
+ sc->eg_pcb[0] = EG_CMD_SETEADDR; /* Set station address */
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: write error2\n"));
+ return 0;
+ }
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error2\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+ if (sc->eg_pcb[0] != EG_RSP_SETEADDR || sc->eg_pcb[1] != 0x02 ||
+ sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0) {
+ dprintf(("eg#: parse error2\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+
+ /* Initialize ifnet structure. */
+ ifp->if_softc = sc;
+ ifp->if_unit = id->id_unit;
+ ifp->if_name = "eg";
+ ifp->if_output = ether_output;
+ ifp->if_start = egstart;
+ ifp->if_ioctl = egioctl;
+ ifp->if_init = (if_init_f_t*)eginit;
+ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
+ ifp->if_watchdog = egwatchdog;
+
+ /* Now we can attach the interface. */
+ if_attach(ifp);
+ ether_ifattach(ifp);
+
+#if NBPFILTER > 0
+ bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
+#endif
+
+ return 1;
+}
+
+static void
+eginit(struct eg_softc *sc)
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ /* soft reset the board */
+ outb(sc->eg_ctl, EG_CTL_FLSH);
+ DELAY(100);
+ outb(sc->eg_ctl, EG_CTL_ATTN);
+ DELAY(100);
+ outb(sc->eg_ctl, 0);
+ DELAY(200);
+
+ sc->eg_pcb[0] = EG_CMD_CONFIG82586; /* Configure 82586 */
+ sc->eg_pcb[1] = 2;
+ sc->eg_pcb[2] = 3; /* receive broadcast & multicast */
+ sc->eg_pcb[3] = 0;
+#ifdef EGDEBUG
+ if (egwritePCB(sc) != 0)
+ dprintf(("eg#: write error3\n"));
+#endif
+
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error\n"));
+ egprintpcb(sc);
+ } else if (sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0)
+ printf("eg%d: configure card command failed\n", ifp->if_unit);
+
+ if (sc->eg_inbuf == NULL)
+ sc->eg_inbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+ sc->eg_incount = 0;
+
+ if (sc->eg_outbuf == NULL)
+ sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+
+ outb(sc->eg_ctl, EG_CTL_CMDE);
+
+ sc->eg_incount = 0;
+ egrecv(sc);
+
+ /* Interface is now `running', with no output active. */
+ ifp->if_flags |= IFF_RUNNING;
+ ifp->if_flags &= ~IFF_OACTIVE;
+
+ /* Attempt to start output, if any. */
+ egstart(ifp);
+}
+
+static void
+egrecv(sc)
+ struct eg_softc *sc;
+{
+
+ while (sc->eg_incount < EG_INLEN) {
+ sc->eg_pcb[0] = EG_CMD_RECVPACKET;
+ sc->eg_pcb[1] = 0x08;
+ sc->eg_pcb[2] = 0; /* address not used.. we send zero */
+ sc->eg_pcb[3] = 0;
+ sc->eg_pcb[4] = 0;
+ sc->eg_pcb[5] = 0;
+ sc->eg_pcb[6] = EG_BUFLEN & 0xff; /* our buffer size */
+ sc->eg_pcb[7] = (EG_BUFLEN >> 8) & 0xff;
+ sc->eg_pcb[8] = 0; /* timeout, 0 == none */
+ sc->eg_pcb[9] = 0;
+ if (egwritePCB(sc) != 0)
+ break;
+ sc->eg_incount++;
+ }
+}
+
+static void
+egstart(ifp)
+ struct ifnet *ifp;
+{
+ register struct eg_softc *sc = ifp->if_softc;
+ struct mbuf *m0, *m;
+ caddr_t buffer;
+ int len;
+ u_short *ptr;
+
+ /* Don't transmit if interface is busy or not running */
+ if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING)
+ return;
+
+loop:
+ /* Dequeue the next datagram. */
+ IF_DEQUEUE(&ifp->if_snd, m0);
+ if (m0 == 0)
+ return;
+
+ ifp->if_flags |= IFF_OACTIVE;
+
+ /* We need to use m->m_pkthdr.len, so require the header */
+ if ((m0->m_flags & M_PKTHDR) == 0)
+ panic("egstart: no header mbuf");
+ len = max(m0->m_pkthdr.len, ETHER_MIN_LEN);
+
+#if NBPFILTER > 0
+ if (ifp->if_bpf)
+ bpf_mtap(ifp, m0);
+#endif
+
+ sc->eg_pcb[0] = EG_CMD_SENDPACKET;
+ sc->eg_pcb[1] = 0x06;
+ sc->eg_pcb[2] = 0; /* address not used, we send zero */
+ sc->eg_pcb[3] = 0;
+ sc->eg_pcb[4] = 0;
+ sc->eg_pcb[5] = 0;
+ sc->eg_pcb[6] = len; /* length of packet */
+ sc->eg_pcb[7] = len >> 8;
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: egwritePCB in egstart failed\n"));
+ ifp->if_oerrors++;
+ ifp->if_flags &= ~IFF_OACTIVE;
+ goto loop;
+ }
+
+ buffer = sc->eg_outbuf;
+ for (m = m0; m != 0; m = m->m_next) {
+ bcopy(mtod(m, caddr_t), buffer, m->m_len);
+ buffer += m->m_len;
+ }
+
+ /* set direction bit: host -> adapter */
+ outb(sc->eg_ctl, inb(sc->eg_ctl) & ~EG_CTL_DIR);
+
+ for (ptr = (u_short *) sc->eg_outbuf; len > 0; len -= 2) {
+ outw(sc->eg_data, *ptr++);
+ while (!(inb(sc->eg_stat) & EG_STAT_HRDY))
+ ; /* XXX need timeout here */
+ }
+
+ m_freem(m0);
+}
+
+void
+egintr(int unit)
+{
+ register struct eg_softc *sc = &eg_softc[unit];
+ int i, len;
+ u_short *ptr;
+
+ while (inb(sc->eg_stat) & EG_STAT_ACRF) {
+ egreadPCB(sc);
+ switch (sc->eg_pcb[0]) {
+ case EG_RSP_RECVPACKET:
+ len = sc->eg_pcb[6] | (sc->eg_pcb[7] << 8);
+
+ /* Set direction bit : Adapter -> host */
+ outb(sc->eg_ctl, inb(sc->eg_ctl) | EG_CTL_DIR);
+
+ for (ptr = (u_short *) sc->eg_inbuf; len > 0; len -= 2) {
+ while (!(inb(sc->eg_stat) & EG_STAT_HRDY))
+ ;
+ *ptr++ = inw(sc->eg_data);
+ }
+
+ len = sc->eg_pcb[8] | (sc->eg_pcb[9] << 8);
+ egread(sc, sc->eg_inbuf, len);
+
+ sc->eg_incount--;
+ egrecv(sc);
+ break;
+
+ case EG_RSP_SENDPACKET:
+ if (sc->eg_pcb[6] || sc->eg_pcb[7]) {
+ dprintf(("eg#: packet dropped\n"));
+ sc->sc_arpcom.ac_if.if_oerrors++;
+ } else
+ sc->sc_arpcom.ac_if.if_opackets++;
+ sc->sc_arpcom.ac_if.if_collisions += sc->eg_pcb[8] & 0xf;
+ sc->sc_arpcom.ac_if.if_flags &= ~IFF_OACTIVE;
+ egstart(&sc->sc_arpcom.ac_if);
+ break;
+
+ case EG_RSP_GETSTATS:
+ dprintf(("eg#: Card Statistics\n"));
+ bcopy(&sc->eg_pcb[2], &i, sizeof(i));
+ dprintf(("eg#: Receive Packets %d\n", i));
+ bcopy(&sc->eg_pcb[6], &i, sizeof(i));
+ dprintf(("eg#: Transmit Packets %d\n", i));
+ dprintf(("eg#: CRC errors %d\n", *(short*) &sc->eg_pcb[10]));
+ dprintf(("eg#: alignment errors %d\n", *(short*) &sc->eg_pcb[12]));
+ dprintf(("eg#: no resources errors %d\n", *(short*) &sc->eg_pcb[14]));
+ dprintf(("eg#: overrun errors %d\n", *(short*) &sc->eg_pcb[16]));
+ break;
+
+ default:
+ dprintf(("eg#: egintr: Unknown response %x??\n",
+ sc->eg_pcb[0]));
+ egprintpcb(sc);
+ break;
+ }
+ }
+
+ return;
+}
+
+/*
+ * Pass a packet up to the higher levels.
+ */
+static void
+egread(sc, buf, len)
+ struct eg_softc *sc;
+ caddr_t buf;
+ int len;
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf *m;
+ struct ether_header *eh;
+
+ if (len <= sizeof(struct ether_header) ||
+ len > ETHER_MAX_LEN) {
+ printf("eg#: invalid packet size %d; dropping\n", len);
+ ifp->if_ierrors++;
+ return;
+ }
+
+ /* Pull packet off interface. */
+ m = egget(sc, buf, len);
+ if (m == 0) {
+ ifp->if_ierrors++;
+ return;
+ }
+
+ ifp->if_ipackets++;
+
+ /* We assume the header fit entirely in one mbuf. */
+ eh = mtod(m, struct ether_header *);
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a BPF listener on this interface.
+ * If so, hand off the raw packet to BPF.
+ */
+ if (ifp->if_bpf) {
+ bpf_mtap(ifp, m);
+
+ /*
+ * Note that the interface cannot be in promiscuous mode if
+ * there are no BPF listeners. And if we are in promiscuous
+ * mode, we have to check if this packet is really ours.
+ */
+ if ((ifp->if_flags & IFF_PROMISC) &&
+ (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
+ bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
+ sizeof(eh->ether_dhost)) != 0) {
+ m_freem(m);
+ return;
+ }
+ }
+#endif
+
+ /* We assume the header fit entirely in one mbuf. */
+ m_adj(m, sizeof(struct ether_header));
+ ether_input(ifp, eh, m);
+}
+
+/*
+ * convert buf into mbufs
+ */
+static struct mbuf *
+egget(sc, buf, totlen)
+ struct eg_softc *sc;
+ caddr_t buf;
+ int totlen;
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf *top, **mp, *m;
+ int len;
+
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if (m == 0)
+ return 0;
+ m->m_pkthdr.rcvif = ifp;
+ m->m_pkthdr.len = totlen;
+ len = MHLEN;
+ top = 0;
+ mp = &top;
+
+ while (totlen > 0) {
+ if (top) {
+ MGET(m, M_DONTWAIT, MT_DATA);
+ if (m == 0) {
+ m_freem(top);
+ return 0;
+ }
+ len = MLEN;
+ }
+ if (totlen >= MINCLSIZE) {
+ MCLGET(m, M_DONTWAIT);
+ if (m->m_flags & M_EXT)
+ len = MCLBYTES;
+ }
+ m->m_len = len = min(totlen, len);
+ bcopy((caddr_t)buf, mtod(m, caddr_t), len);
+ buf += len;
+ totlen -= len;
+ *mp = m;
+ mp = &m->m_next;
+ }
+
+ return top;
+}
+
+static int
+egioctl(ifp, command, data)
+ register struct ifnet *ifp;
+ u_long command;
+ caddr_t data;
+{
+ struct eg_softc *sc = ifp->if_softc;
+ int s, error = 0;
+
+ s = splnet();
+
+ switch (command) {
+
+ case SIOCSIFADDR:
+ case SIOCGIFADDR:
+ case SIOCSIFMTU:
+ error = ether_ioctl(ifp, command, data);
+ break;
+
+ case SIOCSIFFLAGS:
+ if ((ifp->if_flags & IFF_UP) == 0 &&
+ (ifp->if_flags & IFF_RUNNING) != 0) {
+ /*
+ * If interface is marked down and it is running, then
+ * stop it.
+ */
+ egstop(sc);
+ ifp->if_flags &= ~IFF_RUNNING;
+ } else if ((ifp->if_flags & IFF_UP) != 0 &&
+ (ifp->if_flags & IFF_RUNNING) == 0) {
+ /*
+ * If interface is marked up and it is stopped, then
+ * start it.
+ */
+ eginit(sc);
+ } else {
+ sc->eg_pcb[0] = EG_CMD_GETSTATS;
+ sc->eg_pcb[1] = 0;
+#ifdef EGDEBUG
+ if (egwritePCB(sc) != 0)
+ dprintf(("eg#: write error\n"));
+#endif
+ /*
+ * XXX deal with flags changes:
+ * IFF_MULTICAST, IFF_PROMISC,
+ * IFF_LINK0, IFF_LINK1,
+ */
+ }
+ break;
+
+ default:
+ error = EINVAL;
+ break;
+ }
+
+ splx(s);
+ return error;
+}
+
+static void
+egreset(sc)
+ struct eg_softc *sc;
+{
+ int s;
+
+ dprintf(("eg#: egreset()\n"));
+ s = splnet();
+ egstop(sc);
+ eginit(sc);
+ splx(s);
+}
+
+static void
+egwatchdog(ifp)
+ struct ifnet *ifp;
+{
+ struct eg_softc *sc = ifp->if_softc;
+
+ log(LOG_ERR, "%s: device timeout\n", "eg#");
+ sc->sc_arpcom.ac_if.if_oerrors++;
+
+ egreset(sc);
+}
+
+static void
+egstop(sc)
+ register struct eg_softc *sc;
+{
+
+ outb(sc->eg_ctl, 0);
+}
diff --git a/sys/i386/isa/if_egreg.h b/sys/i386/isa/if_egreg.h
new file mode 100644
index 000000000000..9067a58383d9
--- /dev/null
+++ b/sys/i386/isa/if_egreg.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 1993 Dean Huxley (dean@fsa.ca)
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Dean Huxley.
+ * 4. The name of Dean Huxley 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.
+ */
+
+/*
+ * Register offsets from base.
+ */
+#define EG_COMMAND 0x00
+#define EG_STATUS 0x02
+#define EG_DATA 0x04
+#define EG_CONTROL 0x06
+
+/*
+ * Host Control Register bits
+ * EG_CTL_ATTN - does a soft reset
+ * EG_CTL_FLSH - flushes the data register
+ * EG_CTL_RESET - does a hard reset
+ * EG_CTL_DMAE - Used with DIR bit, enables DMA transfers to/from data reg.
+ * EG_CTL_DIR - if clear then host -> adapter, if set then adapter -> host
+ * EG_CTL_TCEN - terminal count enable. enables host interrupt after DMA.
+ * EG_CTL_CMDE - command reg interrupt enable. (when it is written)
+ * EG_CTL_HSF1 - Host status flag 1
+ * EG_CTL_HSF2 - Host status flag 2
+ */
+
+#define EG_CTL_ATTN 0x80
+#define EG_CTL_FLSH 0x40
+#define EG_CTL_RESET (EG_CTL_ATTN|EG_CTL_FLSH)
+#define EG_CTL_DMAE 0x20
+#define EG_CTL_DIR 0x10
+#define EG_CTL_TCEN 0x08
+#define EG_CTL_CMDE 0x04
+#define EG_CTL_HSF2 0x02
+#define EG_CTL_HSF1 0x01
+
+/*
+ * Host Status Register bits
+ * EG_STAT_HRDY - Data Register ready
+ * EG_STAT_HCRE - Host Command Register empty
+ * EG_STAT_ACRF - Adapter Command register full
+ * EG_STAT_DIR - Direction flag, 0 = host -> adapter, 1 = adapter -> host
+ * EG_STAT_DONE - DMA done
+ * EG_STAT_ASF1 - Adapter status flag 1
+ * EG_STAT_ASF2 - Adapter status flag 2
+ * EG_STAT_ASF3 - Adapter status flag 3
+ */
+
+#define EG_STAT_HRDY 0x80
+#define EG_STAT_HCRE 0x40
+#define EG_STAT_ACRF 0x20
+#define EG_STAT_DIR 0x10
+#define EG_STAT_DONE 0x08
+#define EG_STAT_ASF3 0x04
+#define EG_STAT_ASF2 0x02
+#define EG_STAT_ASF1 0x01
+
+#define EG_PCB_NULL 0x00
+#define EG_PCB_ACCEPT 0x01
+#define EG_PCB_REJECT 0x02
+#define EG_PCB_DONE 0x03
+#define EG_PCB_STAT 0x03
+
+#define EG_CMD_CONFIG82586 0x02
+#define EG_CMD_GETEADDR 0x03
+#define EG_CMD_RECVPACKET 0x08
+#define EG_CMD_SENDPACKET 0x09
+#define EG_CMD_GETSTATS 0x0a
+#define EG_CMD_SETEADDR 0x10
+#define EG_CMD_GETINFO 0x11
+
+#define EG_RSP_CONFIG82586 0x32
+#define EG_RSP_GETEADDR 0x33
+#define EG_RSP_RECVPACKET 0x38
+#define EG_RSP_SENDPACKET 0x39
+#define EG_RSP_GETSTATS 0x3a
+#define EG_RSP_SETEADDR 0x40
+#define EG_RSP_GETINFO 0x41
diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c
index f8aad8e4d020..6a3c32d1b83b 100644
--- a/sys/i386/isa/if_el.c
+++ b/sys/i386/isa/if_el.c
@@ -6,7 +6,7 @@
*
* Questions, comments, bug reports and fixes to kimmel@cs.umass.edu.
*
- * $Id: if_el.c,v 1.39 1998/12/07 21:58:21 archie Exp $
+ * $Id: if_el.c,v 1.36 1998/06/07 17:10:28 dfr Exp $
*/
/* Except of course for the portions of code lifted from other FreeBSD
* drivers (mainly elread, elget and el_ioctl)
@@ -82,7 +82,6 @@ static void el_watchdog(struct ifnet *);
static void el_stop(int);
static int el_xmit(struct el_softc *,int);
-static ointhand2_t elintr;
static __inline void elread(struct el_softc *,caddr_t,int);
static struct mbuf *elget(caddr_t,int,int,struct ifnet *);
static __inline void el_hardreset(int);
@@ -146,29 +145,6 @@ el_probe(struct isa_device *idev)
}
}
-/* Do a hardware reset of the 3c501. Do not call until after el_probe()! */
-static __inline void
-el_hardreset(int unit)
-{
- register struct el_softc *sc;
- register int base;
- register int j;
-
- sc = &el_softc[unit];
- base = sc->el_base;
-
- /* First reset the board */
- outb(base+EL_AC,EL_AC_RESET);
- DELAY(5);
- outb(base+EL_AC,0);
-
- /* Then give it back its ethernet address. Thanks to the mach
- * source code for this undocumented goodie...
- */
- for(j=0;j<ETHER_ADDR_LEN;j++)
- outb(base+j,sc->arpcom.ac_enaddr[j]);
-}
-
/* Attach the interface to the kernel data structures. By the time
* this is called, we know that the card exists at the given I/O address.
* We still assume that the IRQ given is correct.
@@ -178,12 +154,13 @@ el_attach(struct isa_device *idev)
{
struct el_softc *sc;
struct ifnet *ifp;
+ struct ifaddr *ifa;
+ struct sockaddr_dl *sdl;
u_short base;
dprintf(("Attaching el%d...\n",idev->id_unit));
/* Get things pointing to the right places. */
- idev->id_ointr = elintr;
sc = &el_softc[idev->id_unit];
ifp = &sc->arpcom.ac_if;
base = sc->el_base;
@@ -243,6 +220,28 @@ static void el_stop(int unit)
outb(sc->el_base+EL_AC,0);
}
+/* Do a hardware reset of the 3c501. Do not call until after el_probe()! */
+static __inline void el_hardreset(int unit)
+{
+ register struct el_softc *sc;
+ register int base;
+ register int j;
+
+ sc = &el_softc[unit];
+ base = sc->el_base;
+
+ /* First reset the board */
+ outb(base+EL_AC,EL_AC_RESET);
+ DELAY(5);
+ outb(base+EL_AC,0);
+
+ /* Then give it back its ethernet address. Thanks to the mach
+ * source code for this undocumented goodie...
+ */
+ for(j=0;j<ETHER_ADDR_LEN;j++)
+ outb(base+j,sc->arpcom.ac_enaddr[j]);
+}
+
/* Initialize interface. */
static void
el_init(int unit)
@@ -406,8 +405,7 @@ el_start(struct ifnet *ifp)
* to the board. Call at splimp or interrupt, after downloading data!
* Returns 0 on success, non-0 on failure
*/
-static int
-el_xmit(struct el_softc *sc,int len)
+static int el_xmit(struct el_softc *sc,int len)
{
int gpl;
int i;
@@ -429,53 +427,8 @@ el_xmit(struct el_softc *sc,int len)
return(0);
}
-/* Pass a packet up to the higher levels. */
-static __inline void
-elread(struct el_softc *sc,caddr_t buf,int len)
-{
- register struct ether_header *eh;
- struct mbuf *m;
-
- eh = (struct ether_header *)buf;
-
-#if NBPFILTER > 0
- /*
- * Check if there's a bpf filter listening on this interface.
- * If so, hand off the raw packet to bpf.
- */
- if(sc->arpcom.ac_if.if_bpf) {
- bpf_tap(&sc->arpcom.ac_if, buf,
- len + sizeof(struct ether_header));
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no bpf listeners. And if el are in promiscuous
- * mode, el have to check if this packet is really ours.
- *
- * This test does not support multicasts.
- */
- if((sc->arpcom.ac_if.if_flags & IFF_PROMISC)
- && bcmp(eh->ether_dhost,sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0
- && bcmp(eh->ether_dhost,etherbroadcastaddr,
- sizeof(eh->ether_dhost)) != 0)
- return;
- }
-#endif
-
- /*
- * Pull packet off interface.
- */
- m = elget(buf,len,0,&sc->arpcom.ac_if);
- if(m == 0)
- return;
-
- ether_input(&sc->arpcom.ac_if,eh,m);
-}
-
/* controller interrupt */
-static void
-elintr(int unit)
+void elintr(int unit)
{
register struct el_softc *sc;
register int base;
@@ -570,6 +523,49 @@ elintr(int unit)
return;
}
+/* Pass a packet up to the higher levels. */
+static __inline void elread(struct el_softc *sc,caddr_t buf,int len)
+{
+ register struct ether_header *eh;
+ struct mbuf *m;
+
+ eh = (struct ether_header *)buf;
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a bpf filter listening on this interface.
+ * If so, hand off the raw packet to bpf.
+ */
+ if(sc->arpcom.ac_if.if_bpf) {
+ bpf_tap(&sc->arpcom.ac_if, buf,
+ len + sizeof(struct ether_header));
+
+ /*
+ * Note that the interface cannot be in promiscuous mode if
+ * there are no bpf listeners. And if el are in promiscuous
+ * mode, el have to check if this packet is really ours.
+ *
+ * This test does not support multicasts.
+ */
+ if((sc->arpcom.ac_if.if_flags & IFF_PROMISC)
+ && bcmp(eh->ether_dhost,sc->arpcom.ac_enaddr,
+ sizeof(eh->ether_dhost)) != 0
+ && bcmp(eh->ether_dhost,etherbroadcastaddr,
+ sizeof(eh->ether_dhost)) != 0)
+ return;
+ }
+#endif
+
+ /*
+ * Pull packet off interface.
+ */
+ m = elget(buf,len,0,&sc->arpcom.ac_if);
+ if(m == 0)
+ return;
+
+ ether_input(&sc->arpcom.ac_if,eh,m);
+}
+
/*
* Pull read data off a interface.
* Len is length of data, with local net header stripped.
diff --git a/sys/i386/isa/if_ep.c b/sys/i386/isa/if_ep.c
index e325ada5b316..80b8db4c3ca2 100644
--- a/sys/i386/isa/if_ep.c
+++ b/sys/i386/isa/if_ep.c
@@ -38,7 +38,7 @@
*/
/*
- * $Id: if_ep.c,v 1.77 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ep.c,v 1.75 1998/06/07 17:10:28 dfr Exp $
*
* Promiscuous mode added and interrupt logic slightly changed
* to reduce the number of adapter failures. Transceiver select
@@ -118,7 +118,6 @@ static int ep_isa_attach __P((struct isa_device *));
static int epioctl __P((struct ifnet * ifp, u_long, caddr_t));
static void epinit __P((struct ep_softc *));
-static ointhand2_t epintr;
static void epread __P((struct ep_softc *));
void epreset __P((int));
static void epstart __P((struct ifnet *));
@@ -149,7 +148,6 @@ struct isa_driver epdriver = {
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -161,7 +159,16 @@ static int ep_pccard_attach __P((struct pccard_devinfo *));
static void ep_unload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ep, ep_pccard_init, ep_unload, card_intr, 0, net_imask);
+static struct pccard_device ep_info = {
+ "ep",
+ ep_pccard_init,
+ ep_unload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask
+};
+
+DATA_SET(pccarddrv_set, ep_info);
/*
* Initialize the device - called from Slot manager.
@@ -531,7 +538,6 @@ ep_isa_attach(is)
u_short config;
int irq;
- is->id_ointr = epintr;
sc->ep_connectors = 0;
config = inw(IS_BASE + EP_W0_CONFIG_CTRL);
if (config & IS_AUI) {
@@ -894,7 +900,7 @@ readcheck:
goto startagain;
}
-static void
+void
epintr(unit)
int unit;
{
diff --git a/sys/i386/isa/if_ex.c b/sys/i386/isa/if_ex.c
index 2508bd735e22..f64ef74269b4 100644
--- a/sys/i386/isa/if_ex.c
+++ b/sys/i386/isa/if_ex.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ex.c,v 1.12 1998/06/07 17:10:30 dfr Exp $
+ * $Id: if_ex.c,v 1.11 1998/03/28 13:24:06 bde Exp $
*/
/*
@@ -119,7 +119,6 @@ static int ex_attach __P((struct isa_device *));
static void ex_init __P((void *));
static void ex_start __P((struct ifnet *));
static void ex_stop __P((int));
-static ointhand2_t exintr;
static int ex_ioctl __P((struct ifnet *, u_long, caddr_t));
static void ex_reset __P((int));
static void ex_watchdog __P((struct ifnet *));
@@ -255,8 +254,6 @@ int ex_attach(struct isa_device *dev)
DODEBUG(Start_End, printf("ex_attach%d: start\n", unit););
- dev->id_ointr = exintr;
-
/*
* Initialize the ifnet structure.
*/
@@ -568,7 +565,7 @@ void ex_stop(int unit)
}
-static void exintr(int unit)
+void exintr(int unit)
{
struct ex_softc *sc = &ex_sc[unit];
struct ifnet *ifp = &sc->arpcom.ac_if;
diff --git a/sys/i386/isa/if_fe.c b/sys/i386/isa/if_fe.c
index 94e4bef13094..85e948d88d20 100644
--- a/sys/i386/isa/if_fe.c
+++ b/sys/i386/isa/if_fe.c
@@ -21,10 +21,10 @@
*/
/*
- * $Id: if_fe.c,v 1.47 1999/01/12 00:36:29 eivind Exp $
+ * $Id: if_fe.c,v 1.41 1998/06/07 17:10:31 dfr Exp $
*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
- * To be used with FreeBSD 3.x
+ * To be used with FreeBSD 2.x
* Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
*
* This version is intended to be a generic template for various
@@ -36,13 +36,12 @@
* other types of Ethernet cards, but the author is not sure whether
* they are useful.
*
- * This version also includes some alignments to support RE1000,
- * C-NET(98)P2 and so on. These cards are not for AT-compatibles,
- * but for NEC PC-98 bus -- a proprietary bus architecture available
- * only in Japan. Confusingly, it is different from the Microsoft's
- * PC98 architecture. :-{
- * Further work for PC-98 version will be available as a part of
- * FreeBSD(98) project.
+ * This version also includes some alignments for
+ * RE1000/RE1000+/ME1500 support. It is incomplete, however, since the
+ * cards are not for AT-compatibles. (They are for PC98 bus -- a
+ * proprietary bus architecture available only in Japan.) Further
+ * work for PC98 version will be available as a part of FreeBSD(98)
+ * project.
*
* This software is a derivative work of if_ed.c version 1.56 by David
* Greenman available as a part of FreeBSD 2.0 RELEASE source distribution.
@@ -59,14 +58,16 @@
/*
* TODO:
+ * o To support MBH10304 PC card. It is another MB8696x based
+ * PCMCIA Ethernet card by Fujitsu, which is not compatible with
+ * MBH10302.
+ * o To merge FreeBSD(98) efforts into a single source file.
* o To support ISA PnP auto configuration for FMV-183/184.
* o To reconsider mbuf usage.
* o To reconsider transmission buffer usage, including
* transmission buffer size (currently 4KB x 2) and pros-and-
* cons of multiple frame transmission.
* o To test IPX codes.
- * o To test FreeBSD3.0-current.
- * o To test BRIDGE codes.
*/
#include "fe.h"
@@ -79,12 +80,10 @@
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
+#include <sys/syslog.h>
#include <net/if.h>
#include <net/if_dl.h>
-#include <net/if_mib.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
#ifdef INET
#include <netinet/in.h>
@@ -113,10 +112,6 @@
#include <net/bpf.h>
#endif
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <machine/clock.h>
#include <i386/isa/isa_device.h>
@@ -127,7 +122,6 @@
#if NCARD > 0
#include <sys/kernel.h>
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -136,31 +130,36 @@
#include <i386/isa/if_fereg.h>
/*
- * Default settings for fe driver specific options.
- * They can be set in config file by "options" statements.
+ * This version of fe is an ISA device driver.
+ * Override the following macro to adapt it to another bus.
+ * (E.g., PC98.)
*/
+#define DEVICE struct isa_device
/*
- * Transmit just one packet per a "send" command to 86960.
- * This option is intended for performance test. An EXPERIMENTAL option.
+ * Default settings for fe driver specific options.
+ * They can be set in config file by "options" statements.
*/
-#ifndef FE_SINGLE_TRANSMISSION
-#define FE_SINGLE_TRANSMISSION 0
-#endif
/*
- * Maximum loops when interrupt.
- * This option prevents an infinite loop due to hardware failure.
- * (Some laptops make an infinite loop after PC-Card is ejected.)
+ * Debug control.
+ * 0: No debug at all. All debug specific codes are stripped off.
+ * 1: Silent. No debug messages are logged except emergent ones.
+ * 2: Brief. Lair events and/or important information are logged.
+ * 3: Detailed. Logs all information which *may* be useful for debugging.
+ * 4: Trace. All actions in the driver is logged. Super verbose.
*/
-#ifndef FE_MAX_LOOP
-#define FE_MAX_LOOP 0x800
+#ifndef FE_DEBUG
+#define FE_DEBUG 1
#endif
/*
- * If you define this option, 8-bit cards are also supported.
+ * Transmit just one packet per a "send" command to 86960.
+ * This option is intended for performance test. An EXPERIMENTAL option.
*/
-/*#define FE_8BIT_SUPPORT*/
+#ifndef FE_SINGLE_TRANSMISSION
+#define FE_SINGLE_TRANSMISSION 0
+#endif
/*
* Device configuration flags.
@@ -201,43 +200,32 @@ static struct fe_softc {
/* Used by config codes. */
/* Set by probe() and not modified in later phases. */
- char const * typestr; /* printable name of the interface. */
+ char * typestr; /* printable name of the interface. */
u_short iobase; /* base I/O address of the adapter. */
- u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of registers. */
+ u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of register. */
u_short txb_size; /* size of TX buffer, in bytes */
u_char proto_dlcr4; /* DLCR4 prototype. */
u_char proto_dlcr5; /* DLCR5 prototype. */
u_char proto_dlcr6; /* DLCR6 prototype. */
u_char proto_dlcr7; /* DLCR7 prototype. */
u_char proto_bmpr13; /* BMPR13 prototype. */
- u_char stability; /* How stable is this? */
- u_short priv_info; /* info specific to a vendor/model. */
- /* Vendor/model specific hooks. */
- void (*init)(struct fe_softc *); /* Just before fe_init(). */
- void (*stop)(struct fe_softc *); /* Just after fe_stop(). */
+ /* Vendor specific hooks. */
+ void ( * init )( struct fe_softc * ); /* Just before fe_init(). */
+ void ( * stop )( struct fe_softc * ); /* Just after fe_stop(). */
/* Transmission buffer management. */
u_short txb_free; /* free bytes in TX buffer */
u_char txb_count; /* number of packets in TX buffer */
u_char txb_sched; /* number of scheduled packets */
- /* Excessive collision counter (see fe_tint() for details.) */
+ /* Excessive collision counter (see fe_tint() for details. */
u_char tx_excolls; /* # of excessive collisions. */
/* Multicast address filter management. */
u_char filter_change; /* MARs must be changed ASAP. */
struct fe_filter filter;/* new filter value. */
- /* Network management. */
- struct ifmib_iso_8802_3 mibdata;
-
- /* Media information. */
- struct ifmedia media; /* used by if_media. */
- u_short mbitmap; /* bitmap for supported media; see bit2media */
- int defmedia; /* default media */
- void (* msel)(struct fe_softc *); /* media selector. */
-
} fe_softc[NFE];
#define sc_if arpcom.ac_if
@@ -247,40 +235,36 @@ static struct fe_softc {
/* Standard driver entry points. These can be static. */
static int fe_probe ( struct isa_device * );
static int fe_attach ( struct isa_device * );
-static void fe_init ( void * );
-static ointhand2_t feintr;
+static void fe_init ( int );
static int fe_ioctl ( struct ifnet *, u_long, caddr_t );
static void fe_start ( struct ifnet * );
+static void fe_reset ( int );
static void fe_watchdog ( struct ifnet * );
-static int fe_medchange ( struct ifnet * );
-static void fe_medstat ( struct ifnet *, struct ifmediareq * );
/* Local functions. Order of declaration is confused. FIXME. */
-static int fe_probe_ssi ( struct isa_device *, struct fe_softc * );
-static int fe_probe_jli ( struct isa_device *, struct fe_softc * );
-static int fe_probe_fmv ( struct isa_device *, struct fe_softc * );
-static int fe_probe_lnx ( struct isa_device *, struct fe_softc * );
-static int fe_probe_gwy ( struct isa_device *, struct fe_softc * );
-static int fe_probe_ubn ( struct isa_device *, struct fe_softc * );
-#ifdef PC98
-static int fe_probe_re1000 ( struct isa_device *, struct fe_softc * );
-static int fe_probe_cnet9ne( struct isa_device *, struct fe_softc * );
-#endif
+static int fe_probe_fmv ( DEVICE *, struct fe_softc * );
+static int fe_probe_ati ( DEVICE *, struct fe_softc * );
+static void fe_init_ati ( struct fe_softc * );
+static int fe_probe_gwy ( DEVICE *, struct fe_softc * );
#if NCARD > 0
-static int fe_probe_mbh ( struct isa_device *, struct fe_softc * );
-static int fe_probe_tdk ( struct isa_device *, struct fe_softc * );
+static int fe_probe_mbh ( DEVICE *, struct fe_softc * );
+static void fe_init_mbh ( struct fe_softc * );
+static int fe_probe_tdk ( DEVICE *, struct fe_softc * );
#endif
static int fe_get_packet ( struct fe_softc *, u_short );
-static void fe_stop ( struct fe_softc * );
+static void fe_stop ( int );
static void fe_tint ( struct fe_softc *, u_char );
static void fe_rint ( struct fe_softc *, u_char );
static void fe_xmit ( struct fe_softc * );
+static void fe_emptybuffer ( struct fe_softc * );
static void fe_write_mbufs ( struct fe_softc *, struct mbuf * );
+static struct fe_filter
+ fe_mcaf ( struct fe_softc * );
+static int fe_hash ( u_char * );
static void fe_setmode ( struct fe_softc * );
static void fe_loadmar ( struct fe_softc * );
-
-#ifdef DIAGNOSTIC
-static void fe_emptybuffer ( struct fe_softc * );
+#if FE_DEBUG >= 1
+static void fe_dump ( int, struct fe_softc *, char * );
#endif
/* Driver struct used in the config code. This must be public (external.) */
@@ -313,62 +297,6 @@ struct isa_driver fedriver =
*/
/*
- * Miscellaneous definitions not directly related to hardware.
- */
-
-/* Flags for stability. */
-#define UNSTABLE_IRQ 0x01 /* IRQ setting may be incorrect. */
-#define UNSTABLE_MAC 0x02 /* Probed MAC address may be incorrect. */
-#define UNSTABLE_TYPE 0x04 /* Probed vendor/model may be incorrect. */
-
-/* The following line must be delete when "net/if_media.h" support it. */
-#ifndef IFM_10_FL
-#define IFM_10_FL /* 13 */ IFM_10_5
-#endif
-
-#if 0
-/* Mapping between media bitmap (in fe_softc.mbitmap) and ifm_media. */
-static int const bit2media [] = {
-#define MB_HA 0x0001
- IFM_HDX | IFM_ETHER | IFM_AUTO,
-#define MB_HM 0x0002
- IFM_HDX | IFM_ETHER | IFM_MANUAL,
-#define MB_HT 0x0004
- IFM_HDX | IFM_ETHER | IFM_10_T,
-#define MB_H2 0x0008
- IFM_HDX | IFM_ETHER | IFM_10_2,
-#define MB_H5 0x0010
- IFM_HDX | IFM_ETHER | IFM_10_5,
-#define MB_HF 0x0020
- IFM_HDX | IFM_ETHER | IFM_10_FL,
-#define MB_FT 0x0040
- IFM_FDX | IFM_ETHER | IFM_10_T,
- /* More can be come here... */
- 0
-};
-#else
-/* Mapping between media bitmap (in fe_softc.mbitmap) and ifm_media. */
-static int const bit2media [] = {
-#define MB_HA 0x0001
- IFM_ETHER | IFM_AUTO,
-#define MB_HM 0x0002
- IFM_ETHER | IFM_MANUAL,
-#define MB_HT 0x0004
- IFM_ETHER | IFM_10_T,
-#define MB_H2 0x0008
- IFM_ETHER | IFM_10_2,
-#define MB_H5 0x0010
- IFM_ETHER | IFM_10_5,
-#define MB_HF 0x0020
- IFM_ETHER | IFM_10_FL,
-#define MB_FT 0x0040
- IFM_ETHER | IFM_10_T,
- /* More can be come here... */
- 0
-};
-#endif
-
-/*
* Routines to access contiguous I/O ports.
*/
@@ -393,50 +321,65 @@ outblk ( struct fe_softc * sc, int offs, u_char const * mem, int len )
/*
* PC-Card (PCMCIA) specific code.
*/
-static int feinit (struct pccard_devinfo *);
-static void feunload (struct pccard_devinfo *);
-static int fe_card_intr (struct pccard_devinfo *);
+static int feinit ( struct pccard_devinfo * );
+static void feunload ( struct pccard_devinfo * );
+static int fe_card_intr ( struct pccard_devinfo * );
-PCCARD_MODULE(fe, feinit, feunload, fe_card_intr, 0, net_imask);
+static struct pccard_device fe_info = {
+ "fe",
+ feinit,
+ feunload,
+ fe_card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* XXX - Should this also include tty_imask? */
+};
+
+DATA_SET(pccarddrv_set, fe_info);
/*
- * Initialize the device - called from Slot manager.
+ * Initialize the device - called from Slot manager.
*/
static int
feinit(struct pccard_devinfo *devi)
{
struct fe_softc *sc;
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFE) return ENODEV;
-
- /* Prepare for the device probe process. */
+ /* validate unit number. */
+ if (devi->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
+#if FE_DEBUG >= 2
+ printf("Start Probe\n");
+#endif
+ /* Initialize "minimum" parts of our softc. */
sc = &fe_softc[devi->isahd.id_unit];
sc->sc_unit = devi->isahd.id_unit;
sc->iobase = devi->isahd.id_iobase;
- /*
- * When the feinit() is called, the devi->misc holds a
- * six-byte value set by the pccard daemon. If the
- * corresponding entry in /etc/pccard.conf has an "ether"
- * keyword, the value is the Ethernet MAC address extracted
- * from CIS area of the card. If the entry has no "ether"
- * keyword, the daemon fills the field with binary zero,
- * instead. We passes the value (either MAC address or zero)
- * to model-specific sub-probe routines through sc->sc_enaddr
- * (it actually is sc->sc_arpcom.ar_enaddr, BTW) so that the
- * sub-probe routies can use that info.
- */
- bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Probe for supported cards. */
- if (fe_probe_mbh(&devi->isahd, sc) == 0
- && fe_probe_tdk(&devi->isahd, sc) == 0) return ENXIO;
+ /* Use Ethernet address got from CIS, if one is available. */
+ if ((devi->misc[0] & 0x03) == 0x00
+ && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
+ /* Yes, it looks like a valid Ether address. */
+ bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
+ } else {
+ /* Indicate we have no Ether address in CIS. */
+ bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
+ }
- /* We've got a supported card. Attach it, then. */
- if (fe_attach(&devi->isahd) == 0) return ENXIO;
+ /* Probe supported PC card models. */
+ if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
+ fe_probe_mbh(&devi->isahd, sc) == 0)
+ return (ENXIO);
+#if FE_DEBUG >= 2
+ printf("Start attach\n");
+#endif
+ if (fe_attach(&devi->isahd) == 0)
+ return (ENXIO);
- return 0;
+ return (0);
}
/*
@@ -452,9 +395,8 @@ static void
feunload(struct pccard_devinfo *devi)
{
struct fe_softc *sc = &fe_softc[devi->isahd.id_unit];
- printf("fe%d: unload\n", sc->sc_unit);
- fe_stop(sc);
- if_down(&sc->arpcom.ac_if);
+ printf("fe%d: unload\n", devi->isahd.id_unit);
+ fe_stop(devi->isahd.id_unit);
}
/*
@@ -472,58 +414,117 @@ fe_card_intr(struct pccard_devinfo *devi)
/*
* Hardware probe routines.
- *
- * In older versions of this driver, we provided an automatic I/O
- * address detection. The features is, however, removed from this
- * version, for simplicity. Any comments?
*/
+/* How and where to probe; to support automatic I/O address detection. */
+struct fe_probe_list
+{
+ int ( * probe ) ( DEVICE *, struct fe_softc * );
+ u_short const * addresses;
+};
+
+/* Lists of possible addresses. */
+static u_short const fe_fmv_addr [] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340, 0 };
+static u_short const fe_ati_addr [] =
+ { 0x240, 0x260, 0x280, 0x2A0, 0x300, 0x320, 0x340, 0x380, 0 };
+
+static struct fe_probe_list const fe_probe_list [] =
+{
+ { fe_probe_fmv, fe_fmv_addr },
+ { fe_probe_ati, fe_ati_addr },
+ { fe_probe_gwy, NULL }, /* GWYs cannot be auto detected. */
+ { NULL, NULL }
+};
+
+
/*
- * Determine if the device is present at a specified I/O address. The
- * main entry to the driver.
+ * Determine if the device is present
+ *
+ * on entry:
+ * a pointer to an isa_device struct
+ * on exit:
+ * zero if device not found
+ * or number of i/o addresses used (if found)
*/
static int
-fe_probe (struct isa_device * dev)
+fe_probe ( DEVICE * dev )
{
struct fe_softc * sc;
+ int u;
int nports;
+ struct fe_probe_list const * list;
+ u_short const * addr;
+ u_short single [ 2 ];
-#ifdef DIAGNOSTIC
- if (dev->id_unit >= NFE) {
- printf("fe%d: too large unit number for the current config\n",
- dev->id_unit);
- return 0;
- }
-#endif
-
- /* Prepare for the softc struct. */
- sc = &fe_softc[dev->id_unit];
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[ dev->id_unit ];
sc->sc_unit = dev->id_unit;
- sc->iobase = dev->id_iobase;
- /* Probe for supported boards. */
- nports = 0;
-#ifdef PC98
- if (!nports) nports = fe_probe_re1000(dev, sc);
- if (!nports) nports = fe_probe_cnet9ne(dev, sc);
+ /* Probe each possibility, one at a time. */
+ for ( list = fe_probe_list; list->probe != NULL; list++ ) {
+
+ if ( dev->id_iobase != NO_IOADDR ) {
+ /* Probe one specific address. */
+ single[ 0 ] = dev->id_iobase;
+ single[ 1 ] = 0;
+ addr = single;
+ } else if ( list->addresses != NULL ) {
+ /* Auto detect. */
+ addr = list->addresses;
+ } else {
+ /* We need a list of addresses to do auto detect. */
+ continue;
+ }
+
+ /* Probe all possible addresses for the board. */
+ while ( *addr != 0 ) {
+
+ /* See if the address is already in use. */
+ for ( u = 0; u < NFE; u++ ) {
+ if ( fe_softc[u].iobase == *addr ) break;
+ }
+
+#if FE_DEBUG >= 3
+ if ( u == NFE ) {
+ log( LOG_INFO, "fe%d: probing %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else if ( u == sc->sc_unit ) {
+ log( LOG_INFO, "fe%d: re-probing %d at 0x%x?\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else {
+ log( LOG_INFO, "fe%d: skipping %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ }
#endif
- if (!nports) nports = fe_probe_ssi(dev, sc);
- if (!nports) nports = fe_probe_jli(dev, sc);
- if (!nports) nports = fe_probe_fmv(dev, sc);
- if (!nports) nports = fe_probe_lnx(dev, sc);
- if (!nports) nports = fe_probe_ubn(dev, sc);
- if (!nports) nports = fe_probe_gwy(dev, sc);
-
- /* We found supported board. */
- return nports;
+
+ /* Probe the address if it is free. */
+ if ( u == NFE || u == sc->sc_unit ) {
+
+ /* Probe an address. */
+ sc->iobase = *addr;
+ nports = list->probe( dev, sc );
+ if ( nports > 0 ) {
+ /* Found. */
+ dev->id_iobase = *addr;
+ return ( nports );
+ }
+ sc->iobase = 0;
+ }
+
+ /* Try next. */
+ addr++;
+ }
+ }
+
+ /* Probe failed. */
+ return ( 0 );
}
/*
* Check for specific bits in specific registers have specific values.
- * A common utility function called from various sub-probe routines.
*/
-
struct fe_simple_probe_struct
{
u_char port; /* Offset from the base I/O address. */
@@ -538,11 +539,9 @@ fe_simple_probe ( struct fe_softc const * sc,
struct fe_simple_probe_struct const * p;
for ( p = sp; p->mask != 0; p++ ) {
-#ifdef FE_DEBUG
- unsigned a = sc->ioaddr[p->port];
- printf("fe%d: Probing %02x (%04x): %02x (%02x, %02x): %s\n",
- sc->sc_unit, p->port, a, inb(a), p->mask, p->bits,
- (inb(a) & p->mask) == p->bits ? "OK" : "NG");
+#if FE_DEBUG >=2
+ printf("Probe Port:%x,Value:%x,Mask:%x.Bits:%x\n",
+ p->port,inb(sc->ioaddr[ p->port]),p->mask,p->bits);
#endif
if ( ( inb( sc->ioaddr[ p->port ] ) & p->mask ) != p->bits )
{
@@ -552,167 +551,40 @@ fe_simple_probe ( struct fe_softc const * sc,
return ( 1 );
}
-/* Test if a given 6 byte value is a valid Ethernet station (MAC)
- address. "Vendor" is an expected vendor code (first three bytes,)
- or a zero when nothing expected. */
-static int
-valid_Ether_p (u_char const * addr, unsigned vendor)
-{
-#ifdef FE_DEBUG
- printf("fe?: validating %6D against %06x\n", addr, ":", vendor);
-#endif
-
- /* All zero is not allowed as a vendor code. */
- if (addr[0] == 0 && addr[1] == 0 && addr[2] == 0) return 0;
-
- switch (vendor) {
- case 0x000000:
- /* Legal Ethernet address (stored in ROM) must have
- its Group and Local bits cleared. */
- if ((addr[0] & 0x03) != 0) return 0;
- break;
- case 0x020000:
- /* Same as above, but a local address is allowed in
- this context. */
- if ((addr[0] & 0x01) != 0) return 0;
- break;
- default:
- /* Make sure the vendor part matches if one is given. */
- if ( addr[0] != ((vendor >> 16) & 0xFF)
- || addr[1] != ((vendor >> 8) & 0xFF)
- || addr[2] != ((vendor ) & 0xFF)) return 0;
- break;
- }
-
- /* Host part must not be all-zeros nor all-ones. */
- if (addr[3] == 0xFF && addr[4] == 0xFF && addr[5] == 0xFF) return 0;
- if (addr[3] == 0x00 && addr[4] == 0x00 && addr[5] == 0x00) return 0;
-
- /* Given addr looks like an Ethernet address. */
- return 1;
-}
-
-/* Fill our softc struct with default value. */
-static void
-fe_softc_defaults (struct fe_softc *sc)
-{
- int i;
-
- /* Initialize I/O address re-mapping table for the standard
- (contiguous) register layout. This routine doesn't use
- ioaddr[], so the caller can safely override it after
- calling fe_softc_defaults, if needed. */
- for (i = 0; i < MAXREGISTERS; i++) sc->ioaddr[i] = sc->iobase + i;
-
- /* Prepare for typical register prototypes. We assume a
- "typical" board has <32KB> of <fast> SRAM connected with a
- <byte-wide> data lines. */
- sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
- sc->proto_dlcr5 = 0;
- sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
- | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
- sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
- sc->proto_bmpr13 = 0;
-
- /* Assume the probe process (to be done later) is stable. */
- sc->stability = 0;
-
- /* A typical board needs no hooks. */
- sc->init = NULL;
- sc->stop = NULL;
-
- /* Assume the board has no software-controllable media selection. */
- sc->mbitmap = MB_HM;
- sc->defmedia = MB_HM;
- sc->msel = NULL;
-}
-
-/* Common error reporting routine used in probe routines for
- "soft configured IRQ"-type boards. */
-static void
-fe_irq_failure (char const *name, int unit, int irq, char const *list)
-{
- printf("fe%d: %s board is detected, but %s IRQ was given\n",
- unit, name, (irq == NO_IRQ ? "no" : "invalid"));
- if (list != NULL) {
- printf("fe%d: specify an IRQ from %s in kernel config\n",
- unit, list);
- }
-}
-
-/*
- * Hardware (vendor) specific probe routines and hooks.
- */
-
-/*
- * Machine independent routines.
- */
-
-/*
- * Generic media selection scheme for MB86965 based boards.
- */
-static void
-fe_msel_965 (struct fe_softc *sc)
-{
- u_char b13;
-
- /* Find the appropriate bits for BMPR13 tranceiver control. */
- switch (IFM_SUBTYPE(sc->media.ifm_media)) {
- case IFM_AUTO: b13 = FE_B13_PORT_AUTO | FE_B13_TPTYPE_UTP; break;
- case IFM_10_T: b13 = FE_B13_PORT_TP | FE_B13_TPTYPE_UTP; break;
- default: b13 = FE_B13_PORT_AUI; break;
- }
-
- /* Write it into the register. It takes effect immediately. */
- outb(sc->ioaddr[FE_BMPR13], sc->proto_bmpr13 | b13);
-}
-
-/*
- * Fujitsu MB86965 JLI mode support routines.
- */
-
-/* Datasheet for 86965 explicitly states that it only supports serial
- * EEPROM with 16 words (32 bytes) capacity. (I.e., 93C06.) However,
- * ones with 64 words (128 bytes) are available in the marked, namely
- * 93C46, and are also fully compatible with 86965. It is known that
- * some boards (e.g., ICL) actually have 93C46 on them and use extra
- * storage to keep various config info. */
-#define JLI_EEPROM_SIZE 128
-
/*
* Routines to read all bytes from the config EEPROM through MB86965A.
- * It is a MicroWire (3-wire) serial EEPROM with 6-bit address.
- * (93C06 or 93C46.)
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? (Or, why all similar codes I tried previously doesn't
+ * work.) FIXME.
*/
+
static void
-fe_strobe_eeprom_jli ( u_short bmpr16 )
+fe_strobe_eeprom ( u_short bmpr16 )
{
/*
- * We must guarantee 1us (or more) interval to access slow
+ * We must guarantee 800ns (or more) interval to access slow
* EEPROMs. The following redundant code provides enough
* delay with ISA timing. (Even if the bus clock is "tuned.")
* Some modification will be needed on faster busses.
*/
outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
}
static void
-fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
+fe_read_eeprom ( struct fe_softc * sc, u_char * data )
{
u_short bmpr16 = sc->ioaddr[ FE_BMPR16 ];
u_short bmpr17 = sc->ioaddr[ FE_BMPR17 ];
u_char n, val, bit;
- u_char save16, save17;
-
- /* Save the current value of the EEPROM interface registers. */
- save16 = inb(bmpr16);
- save17 = inb(bmpr17);
/* Read bytes from EEPROM; two bytes per an iteration. */
- for ( n = 0; n < JLI_EEPROM_SIZE / 2; n++ ) {
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
/* Reset the EEPROM interface. */
outb( bmpr16, 0x00 );
@@ -721,20 +593,20 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
/* Start EEPROM access. */
outb( bmpr16, FE_B16_SELECT );
outb( bmpr17, FE_B17_DATA );
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
- /* Pass the iteration count as well as a READ command. */
+ /* Pass the iteration count to the chip. */
val = 0x80 | n;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
outb( bmpr17, ( val & bit ) ? FE_B17_DATA : 0 );
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
}
outb( bmpr17, 0x00 );
/* Read a byte. */
val = 0;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
if ( inb( bmpr17 ) & FE_B17_DATA ) {
val |= bit;
}
@@ -744,7 +616,7 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
/* Read one more byte. */
val = 0;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
if ( inb( bmpr17 ) & FE_B17_DATA ) {
val |= bit;
}
@@ -752,476 +624,278 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
*data++ = val;
}
-#if 0
/* Reset the EEPROM interface, again. */
outb( bmpr16, 0x00 );
outb( bmpr17, 0x00 );
-#else
- /* Make sure to restore the original value of EEPROM interface
- registers, since we are not yet sure we have MB86965A on
- the address. */
- outb(bmpr17, save17);
- outb(bmpr16, save16);
-#endif
-#if 1
+#if FE_DEBUG >= 3
/* Report what we got. */
- if (bootverbose) {
- int i;
- data -= JLI_EEPROM_SIZE;
- for (i = 0; i < JLI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(JLI):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
- }
- }
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
#endif
}
-static void
-fe_init_jli (struct fe_softc * sc)
-{
- /* "Reset" by writing into a magic location. */
- DELAY(200);
- outb(sc->ioaddr[0x1E], inb(sc->ioaddr[0x1E]));
- DELAY(300);
-}
-
/*
- * SSi 78Q8377A support routines.
+ * Hardware (vendor) specific probe routines.
*/
-#define SSI_EEPROM_SIZE 512
-#define SSI_DIN 0x01
-#define SSI_DAT 0x01
-#define SSI_CSL 0x02
-#define SSI_CLK 0x04
-#define SSI_EEP 0x10
-
/*
- * Routines to read all bytes from the config EEPROM through 78Q8377A.
- * It is a MicroWire (3-wire) serial EEPROM with 8-bit address. (I.e.,
- * 93C56 or 93C66.)
- *
- * As I don't have SSi manuals, (hmm, an old song again!) I'm not exactly
- * sure the following code is correct... It is just stolen from the
- * C-NET(98)P2 support routine in FreeBSD(98).
+ * Probe and initialization for Fujitsu FMV-180 series boards
*/
-
-static void
-fe_read_eeprom_ssi (struct fe_softc *sc, u_char *data)
+static int
+fe_probe_fmv ( DEVICE * dev, struct fe_softc * sc )
{
- u_short bmpr12 = sc->ioaddr[FE_DLCR12];
- u_char val, bit;
- int n;
- u_char save6, save7, save12;
-
- /* Save the current value for the DLCR registers we are about
- to destroy. */
- save6 = inb(sc->ioaddr[FE_DLCR6]);
- save7 = inb(sc->ioaddr[FE_DLCR7]);
-
- /* Put the 78Q8377A into a state that we can access the EEPROM. */
- outb(sc->ioaddr[FE_DLCR6],
- FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_DLC_DISABLE);
- outb(sc->ioaddr[FE_DLCR7],
- FE_D7_BYTSWP_LH | FE_D7_RBS_BMPR | FE_D7_RDYPNS | FE_D7_POWER_UP);
-
- /* Save the current value for the BMPR12 register, too. */
- save12 = inb(bmpr12);
-
- /* Read bytes from EEPROM; two bytes per an iteration. */
- for ( n = 0; n < SSI_EEPROM_SIZE / 2; n++ ) {
-
- /* Start EEPROM access */
- outb(bmpr12, SSI_EEP);
- outb(bmpr12, SSI_EEP | SSI_CSL);
-
- /* Send the following four bits to the EEPROM in the
- specified order: a dummy bit, a start bit, and
- command bits (10) for READ. */
- outb(bmpr12, SSI_EEP | SSI_CSL );
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK ); /* 0 */
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_DAT);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | SSI_DAT); /* 1 */
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_DAT);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | SSI_DAT); /* 1 */
- outb(bmpr12, SSI_EEP | SSI_CSL );
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK ); /* 0 */
-
- /* Pass the iteration count to the chip. */
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- val = ( n & bit ) ? SSI_DAT : 0;
- outb(bmpr12, SSI_EEP | SSI_CSL | val);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | val);
- }
-
- /* Read a byte. */
- val = 0;
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- outb(bmpr12, SSI_EEP | SSI_CSL);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK);
- if (inb(bmpr12) & SSI_DIN) val |= bit;
- }
- *data++ = val;
-
- /* Read one more byte. */
- val = 0;
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- outb(bmpr12, SSI_EEP | SSI_CSL);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK);
- if (inb(bmpr12) & SSI_DIN) val |= bit;
- }
- *data++ = val;
-
- outb(bmpr12, SSI_EEP);
- }
+ int i, n;
- /* Reset the EEPROM interface. (For now.) */
- outb( bmpr12, 0x00 );
+ static u_short const baseaddr [ 8 ] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340 };
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ7, IRQ10, IRQ15 };
- /* Restore the saved register values, for the case that we
- didn't have 78Q8377A at the given address. */
- outb(sc->ioaddr[FE_BMPR12], save12);
- outb(sc->ioaddr[FE_DLCR7], save7);
- outb(sc->ioaddr[FE_DLCR6], save6);
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+ { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
+ { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/184 has 0x48 bits. */
+ { FE_FMV3, 0x7F, 0x00 },
#if 1
- /* Report what we got. */
- if (bootverbose) {
- int i;
- data -= SSI_EEPROM_SIZE;
- for (i = 0; i < SSI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(SSI):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
- }
- }
+ /*
+ * Test *vendor* part of the station address for Fujitsu.
+ * The test will gain reliability of probe process, but
+ * it rejects FMV-180 clone boards manufactured by other vendors.
+ * We have to turn the test off when such cards are made available.
+ */
+ { FE_FMV4, 0xFF, 0x00 },
+ { FE_FMV5, 0xFF, 0x00 },
+ { FE_FMV6, 0xFF, 0x0E },
+#else
+ /*
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "no multicast" and "no local" even for
+ * unknown vendors.
+ */
+ { FE_FMV4, 0x03, 0x00 },
#endif
-}
-
-#define FE_SSI_EEP_IRQ 9 /* Irq ??? */
-#define FE_SSI_EEP_ADDR 16 /* Station(MAC) address */
-#define FE_SSI_EEP_DUPLEX 25 /* Duplex mode ??? */
-
-/*
- * TDK/LANX boards support routines.
- */
-
-/* AX012/AX013 equips an X24C01 chip, which has 128 bytes of memory cells. */
-#define LNX_EEPROM_SIZE 128
-
-/* Bit assignments and command definitions for the serial EEPROM
- interface register in LANX ASIC. */
-#define LNX_SDA_HI 0x08 /* Drive SDA line high (logical 1.) */
-#define LNX_SDA_LO 0x00 /* Drive SDA line low (logical 0.) */
-#define LNX_SDA_FL 0x08 /* Float (don't drive) SDA line. */
-#define LNX_SDA_IN 0x01 /* Mask for reading SDA line. */
-#define LNX_CLK_HI 0x04 /* Drive clock line high (active.) */
-#define LNX_CLK_LO 0x00 /* Drive clock line low (inactive.) */
-
-/* It is assumed that the CLK line is low and SDA is high (float) upon entry. */
-#define LNX_PH(D,K,N) \
- ((LNX_SDA_##D | LNX_CLK_##K) << N)
-#define LNX_CYCLE(D1,D2,D3,D4,K1,K2,K3,K4) \
- (LNX_PH(D1,K1,0)|LNX_PH(D2,K2,8)|LNX_PH(D3,K3,16)|LNX_PH(D4,K4,24))
-
-#define LNX_CYCLE_START LNX_CYCLE(HI,LO,LO,HI, HI,HI,LO,LO)
-#define LNX_CYCLE_STOP LNX_CYCLE(LO,LO,HI,HI, LO,HI,HI,LO)
-#define LNX_CYCLE_HI LNX_CYCLE(HI,HI,HI,HI, LO,HI,LO,LO)
-#define LNX_CYCLE_LO LNX_CYCLE(LO,LO,LO,HI, LO,HI,LO,LO)
-#define LNX_CYCLE_INIT LNX_CYCLE(LO,HI,HI,HI, LO,LO,LO,LO)
-
-static void
-fe_eeprom_cycle_lnx (u_short reg20, u_long cycle)
-{
- outb(reg20, (cycle ) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 8) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 16) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 24) & 0xFF);
- DELAY(15);
-}
+ { 0 }
+ };
-static u_char
-fe_eeprom_receive_lnx (u_short reg20)
-{
- u_char dat;
-
- outb(reg20, LNX_CLK_HI | LNX_SDA_FL);
- DELAY(15);
- dat = inb(reg20);
- outb(reg20, LNX_CLK_LO | LNX_SDA_FL);
- DELAY(15);
- return (dat & LNX_SDA_IN);
-}
+ /* "Hardware revision ID" */
+ int revision;
-static void
-fe_read_eeprom_lnx (struct fe_softc *sc, u_char *data)
-{
- int i;
- u_char n, bit, val;
- u_char save20;
- u_short reg20 = sc->ioaddr[0x14];
+ /*
+ * See if the specified address is possible for FMV-180 series.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) return 0;
- save20 = inb(sc->ioaddr[0x14]);
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
- /* NOTE: DELAY() timing constants are approximately three
- times longer (slower) than the required minimum. This is
- to guarantee a reliable operation under some tough
- conditions... Fortunately, this routine is only called
- during the boot phase, so the speed is less important than
- stability. */
+ /* Simple probe. */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-#if 1
- /* Reset the X24C01's internal state machine and put it into
- the IDLE state. We usually don't need this, but *if*
- someone (e.g., probe routine of other driver) write some
- garbage into the register at 0x14, synchronization will be
- lost, and the normal EEPROM access protocol won't work.
- Moreover, as there are no easy way to reset, we need a
- _manoeuvre_ here. (It even lacks a reset pin, so pushing
- the RESET button on the PC doesn't help!) */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_INIT);
- for (i = 0; i < 10; i++) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_START);
- }
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_STOP);
- DELAY(10000);
+ /* Check if our I/O address matches config info. on EEPROM. */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IOS )
+ >> FE_FMV2_IOS_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) {
+#if 0
+ /* May not work on some revisions of the cards... FIXME. */
+ return 0;
+#else
+ /* Just log the fact and see what happens... FIXME. */
+ log( LOG_WARNING, "fe%d: strange I/O config?\n", sc->sc_unit );
#endif
+ }
- /* Issue a start condition. */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_START);
+ /* Find the "hardware revision." */
+ revision = inb( sc->ioaddr[ FE_FMV1 ] ) & FE_FMV1_REV;
- /* Send seven bits of the starting address (zero, in this
- case) and a command bit for READ. */
- val = 0x01;
- for (bit = 0x80; bit != 0x00; bit >>= 1) {
- if (val & bit) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_HI);
- } else {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_LO);
+ /* Determine the card type. */
+ sc->typestr = NULL;
+ switch ( inb( sc->ioaddr[ FE_FMV0 ] ) & FE_FMV0_MEDIA ) {
+ case 0:
+ /* No interface? This doesn't seem to be an FMV-180... */
+ return 0;
+ case FE_FMV0_MEDIUM_T:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-183";
+ break;
+ case 12:
+ sc->typestr = "FMV-183 (on-board)";
+ break;
}
- }
-
- /* Receive an ACK bit. */
- if (fe_eeprom_receive_lnx(reg20)) {
- /* ACK was not received. EEPROM is not present (i.e.,
- this board was not a TDK/LANX) or not working
- properly. */
- if (bootverbose) {
- printf("fe%d: no ACK received from EEPROM(LNX)\n",
- sc->sc_unit);
+ break;
+ case FE_FMV0_MEDIUM_T | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-181";
+ break;
+ case 1:
+ sc->typestr = "FMV-181A";
+ break;
}
- /* Clear the given buffer to indicate we could not get
- any info. and return. */
- bzero(data, LNX_EEPROM_SIZE);
- goto RET;
- }
-
- /* Read bytes from EEPROM. */
- for (n = 0; n < LNX_EEPROM_SIZE; n++) {
-
- /* Read a byte and store it into the buffer. */
- val = 0x00;
- for (bit = 0x80; bit != 0x00; bit >>= 1) {
- if (fe_eeprom_receive_lnx(reg20)) val |= bit;
+ break;
+ case FE_FMV0_MEDIUM_2:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 2)";
+ break;
}
- *data++ = val;
-
- /* Acknowledge if we have to read more. */
- if (n < LNX_EEPROM_SIZE - 1) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_LO);
+ break;
+ case FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 1)";
+ break;
}
- }
-
- /* Issue a STOP condition, de-activating the clock line.
- It will be safer to keep the clock line low than to leave
- it high. */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_STOP);
-
- RET:
- outb(sc->ioaddr[0x14], save20);
-
-#if 1
- /* Report what we got. */
- data -= LNX_EEPROM_SIZE;
- if (bootverbose) {
- for (i = 0; i < JLI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(LNX):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
+ break;
+ case FE_FMV0_MEDIUM_2 | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-182";
+ break;
+ case 1:
+ sc->typestr = "FMV-182A";
+ break;
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 3)";
+ break;
}
+ break;
+ }
+ if ( sc->typestr == NULL ) {
+ /* Unknown card type... Hope the driver works. */
+ sc->typestr = "unknown FMV-180 version";
+ log( LOG_WARNING, "fe%d: %s: %x-%x-%x-%x\n",
+ sc->sc_unit, sc->typestr,
+ inb( sc->ioaddr[ FE_FMV0 ] ),
+ inb( sc->ioaddr[ FE_FMV1 ] ),
+ inb( sc->ioaddr[ FE_FMV2 ] ),
+ inb( sc->ioaddr[ FE_FMV3 ] ) );
}
-#endif
-}
-
-static void
-fe_init_lnx ( struct fe_softc * sc )
-{
- /* Reset the 86960. Do we need this? FIXME. */
- outb(sc->ioaddr[0x12], 0x06);
- DELAY(100);
- outb(sc->ioaddr[0x12], 0x07);
- DELAY(100);
-
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[0x14], sc->priv_info);
-}
-
-/*
- * Ungermann-Bass boards support routine.
- */
-static void
-fe_init_ubn ( struct fe_softc * sc )
-{
- /* Do we need this? FIXME. */
- outb(sc->ioaddr[FE_DLCR7],
- sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP);
- outb(sc->ioaddr[0x18], 0x00);
- DELAY( 200 );
-
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[0x14], sc->priv_info);
-}
-
-/*
- * Machine dependent probe routines.
- */
-
-#ifdef PC98
-static int
-fe_probe_fmv ( struct isa_device * dev, struct fe_softc * sc )
-{
- /* PC-98 has no board of this architechture. */
- return 0;
-}
-
-/* ioaddr for RE1000/1000Plus - Very dirty! */
-static u_short ioaddr_re1000[MAXREGISTERS] = {
- 0x0000, 0x0001, 0x0200, 0x0201, 0x0400, 0x0401, 0x0600, 0x0601,
- 0x0800, 0x0801, 0x0a00, 0x0a01, 0x0c00, 0x0c01, 0x0e00, 0x0e01,
- 0x1000, 0x1200, 0x1400, 0x1600, 0x1800, 0x1a00, 0x1c00, 0x1e00,
- 0x1001, 0x1201, 0x1401, 0x1601, 0x1801, 0x1a01, 0x1c01, 0x1e01,
-};
-
-/*
- * Probe and initialization for Allied-Telesis RE1000 series.
- */
-static void
-fe_init_re1000 ( struct fe_softc * sc )
-{
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[FE_RE1000_IRQCONF], sc->priv_info);
-}
-
-static int
-fe_probe_re1000 ( struct isa_device * dev, struct fe_softc * sc )
-{
- int i, n;
- u_char sum;
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for RE1000. */
- /* [01]D[02468ACE] are allowed. */
- if ((sc->iobase & ~0x10E) != 0xD0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
- /* Re-map ioaddr for RE1000. */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr_re1000[i];
+ /*
+ * An FMV-180 has been proved.
+ * Determine which IRQ to be used.
+ *
+ * In this version, we give a priority to the kernel config file.
+ * If the EEPROM and config don't match, say it to the user for
+ * an attention.
+ */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
+ >> FE_FMV2_IRS_SHIFT;
+ if ( dev->id_irq == NO_IRQ ) {
+ /* Just use the probed value. */
+ dev->id_irq = irqmap[ n ];
+ } else if ( dev->id_irq != irqmap[ n ] ) {
+ /* Don't match. */
+ log( LOG_WARNING,
+ "fe%d: check IRQ in config; it may be incorrect\n",
+ sc->sc_unit );
+ }
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ /*
+ * Initialize constants in the per-line structure.
+ */
/* Get our station address from EEPROM. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
+ inblk( sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN );
- /* Make sure it is Allied-Telesis's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return 0;
-#if 1
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
- }
- if (sum != 0) return 0;
-#endif
- /* Setup the board type. */
- sc->typestr = "RE1000";
-
- /* This looks like an RE1000 board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: n = 0x10; break;
- case IRQ5: n = 0x20; break;
- case IRQ6: n = 0x40; break;
- case IRQ12: n = 0x80; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
- sc->priv_info = inb(sc->ioaddr[FE_RE1000_IRQCONF]) & 0x0f | n;
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_re1000;
+ /*
+ * Register values which (may) depend on board design.
+ *
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
- /* The I/O address range is fragmented in the RE1000.
- It occupies 2*16 I/O addresses, by the way. */
- return 2;
-}
+ /*
+ * Minimum initialization of the hardware.
+ * We write into registers; hope I/O ports have no
+ * overlap with other boards.
+ */
-/* JLI sub-probe for Allied-Telesis RE1000Plus/ME1500 series. */
-static u_short const *
-fe_probe_jli_re1000p (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmaps_re1000p [4] = { IRQ3, IRQ5, IRQ6, IRQ12 };
+ /* Initialize ASIC. */
+ outb( sc->ioaddr[ FE_FMV3 ], 0 );
+ outb( sc->ioaddr[ FE_FMV10 ], 0 );
- /* Make sure the EEPROM contains Allied-Telesis bit pattern. */
- if (eeprom[1] != 0xFF) return NULL;
- for (i = 2; i < 8; i++) if (eeprom[i] != 0xFF) return NULL;
- for (i = 14; i < 24; i++) if (eeprom[i] != 0xFF) return NULL;
+ /* Initialize 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
- /* Get our station address from EEPROM, and make sure the
- EEPROM contains Allied-Telesis's address. */
- bcopy(eeprom+8, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return NULL;
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
- /* I don't know any sub-model identification. */
- sc->typestr = "RE1000Plus/ME1500";
+ /* "Refresh" hardware configuration. FIXME. */
+ outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
+
+ /* Turn the "master interrupt control" flag of ASIC on. */
+ outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
- /* Returns the IRQ table for the RE1000Plus. */
- return irqmaps_re1000p;
+ /*
+ * That's all. FMV-180 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
}
/*
- * Probe for Allied-Telesis RE1000Plus/ME1500 series.
+ * Probe and initialization for Allied-Telesis AT1700/RE2000 series.
*/
static int
-fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
+fe_probe_ati ( DEVICE * dev, struct fe_softc * sc )
{
int i, n;
- int irq;
- u_char eeprom [JLI_EEPROM_SIZE];
- u_short const * irqmap;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+ u_char save16, save17;
- static u_short const baseaddr [8] =
- { 0x1D6, 0x1D8, 0x1DA, 0x1D4, 0x0D4, 0x0D2, 0x0D8, 0x0D0 };
+ static u_short const baseaddr [ 8 ] =
+ { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
+ static u_short const irqmaps [ 4 ][ 4 ] =
+ {
+ { IRQ3, IRQ4, IRQ5, IRQ9 },
+ { IRQ10, IRQ11, IRQ12, IRQ15 },
+ { IRQ3, IRQ11, IRQ5, IRQ15 },
+ { IRQ10, IRQ11, IRQ14, IRQ15 },
+ };
static struct fe_simple_probe_struct const probe_table [] = {
- /* { FE_DLCR1, 0x20, 0x00 }, Doesn't work. */
- { FE_DLCR2, 0x50, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
- /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+ { FE_DLCR5, 0x80, 0x00 },
#if 0
{ FE_BMPR16, 0x1B, 0x00 },
{ FE_BMPR17, 0x7F, 0x00 },
@@ -1229,20 +903,28 @@ fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
{ 0 }
};
+ /* Assume we have 86965 and no need to restore these. */
+ save16 = 0;
+ save17 = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for ATI\n",
+ sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
/*
* See if the specified address is possible for MB86965A JLI mode.
*/
- for (i = 0; i < 8; i++) {
- if (baseaddr[i] == sc->iobase) break;
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
}
- if (i == 8) return 0;
+ if ( i == 8 ) goto NOTFOUND;
- /* Fill the softc struct with reasonable default. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for RE1000Plus. */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr_re1000[i];
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
/*
* We should test if MB86965A is on the base address now.
@@ -1252,637 +934,35 @@ fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
* described in the Fujitsu document. On warm boot, however,
* we can predict almost nothing about register values.
*/
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ if ( !fe_simple_probe( sc, probe_table ) ) goto NOTFOUND;
/* Check if our I/O address matches config info on 86965. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_ADDR) >> FE_B19_ADDR_SHIFT;
- if (baseaddr[n] != sc->iobase) return 0;
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_ADDR )
+ >> FE_B19_ADDR_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) goto NOTFOUND;
/*
- * We are now almost sure we have an MB86965 at the given
- * address. So, read EEPROM through it. We have to write
+ * We are now almost sure we have an AT1700 at the given
+ * address. So, read EEPROM through 86965. We have to write
* into LSI registers to read from EEPROM. I want to avoid it
* at this stage, but I cannot test the presence of the chip
* any further without reading EEPROM. FIXME.
*/
- fe_read_eeprom_jli(sc, eeprom);
-
- /* Make sure that config info in EEPROM and 86965 agree. */
- if (eeprom[FE_EEPROM_CONF] != inb(sc->ioaddr[FE_BMPR19])) {
- return 0;
- }
-
- /* Use 86965 media selection scheme, unless othewise
- specified. It is "AUTO always" and "select with BMPR13".
- This behaviour covers most of the 86965 based board (as
- minimum requirements.) It is backward compatible with
- previous versions, also. */
- sc->mbitmap = MB_HA;
- sc->defmedia = MB_HA;
- sc->msel = fe_msel_965;
-
- /* Perform board-specific probe. */
- if ((irqmap = fe_probe_jli_re1000p(sc, eeprom)) == NULL) return 0;
-
- /* Find the IRQ read from EEPROM. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ) >> FE_B19_IRQ_SHIFT;
- irq = irqmap[n];
-
- /* Try to determine IRQ setting. */
- if (dev->id_irq == NO_IRQ && irq == NO_IRQ) {
- /* The device must be configured with an explicit IRQ. */
- printf("fe%d: IRQ auto-detection does not work\n",
- sc->sc_unit);
- return 0;
- } else if (dev->id_irq == NO_IRQ && irq != NO_IRQ) {
- /* Just use the probed IRQ value. */
- dev->id_irq = irq;
- } else if (dev->id_irq != NO_IRQ && irq == NO_IRQ) {
- /* No problem. Go ahead. */
- } else if (dev->id_irq == irq) {
- /* Good. Go ahead. */
- } else {
- /* User must be warned in this case. */
- sc->stability |= UNSTABLE_IRQ;
- }
-
- /* Setup a hook, which resets te 86965 when the driver is being
- initialized. This may solve a nasty bug. FIXME. */
- sc->init = fe_init_jli;
-
- /* The I/O address range is fragmented in the RE1000Plus.
- It occupies 2*16 I/O addresses, by the way. */
- return 2;
-}
-
-/*
- * Probe and initialization for Contec C-NET(9N)E series.
- */
-
-/* TODO: Should be in "if_fereg.h" */
-#define FE_CNET9NE_INTR 0x10 /* Interrupt Mask? */
-
-static void
-fe_init_cnet9ne ( struct fe_softc * sc )
-{
- /* Enable interrupt? FIXME. */
- outb(sc->ioaddr[FE_CNET9NE_INTR], 0x10);
-}
-
-static int
-fe_probe_cnet9ne ( struct isa_device * dev, struct fe_softc * sc )
-{
- int i;
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
- static u_short ioaddr[MAXREGISTERS - 16] = {
- /* 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, */
- /* 0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f, */
- 0x400, 0x402, 0x404, 0x406, 0x408, 0x40a, 0x40c, 0x40e,
- 0x401, 0x403, 0x405, 0x407, 0x409, 0x40b, 0x40d, 0x40f,
- };
-
- /* See if the specified I/O address is possible for C-NET(9N)E. */
- if (sc->iobase != 0x73D0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for C-NET(9N)E. */
- for (i = 16; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr[i - 16];
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address from EEPROM. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Make sure it is Contec's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x00804C)) return 0;
-
- /* Setup the board type. */
- sc->typestr = "C-NET(9N)E";
-
- /* C-NET(9N)E seems to work only IRQ5. FIXME. */
- if (dev->id_irq != IRQ5) {
- fe_irq_failure(sc->typestr, sc->sc_unit, dev->id_irq, "5");
- return 0;
- }
-
- /* We need an init hook to initialize ASIC before we start. */
- sc->init = fe_init_cnet9ne;
-
- /* C-NET(9N)E has 64KB SRAM. */
- sc->proto_dlcr6 = FE_D6_BUFSIZ_64KB | FE_D6_TXBSIZ_2x4KB
- | FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_SRAM;
-
- /* The I/O address range is fragmented in the C-NET(9N)E.
- This is the number of regs at iobase. */
- return 16;
-}
-
-/*
- * Probe for Contec C-NET(98)P2 series.
- * (Logitec LAN-98TP/LAN-98T25P - parhaps)
- */
-static int
-fe_probe_ssi (struct isa_device *dev, struct fe_softc *sc)
-{
- u_char eeprom [SSI_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x08, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
- static u_short const irqmap[] = {
- /* INT0 INT1 INT2 */
- NO_IRQ, NO_IRQ, NO_IRQ, IRQ3 , NO_IRQ, IRQ5 , IRQ6 , NO_IRQ,
- NO_IRQ, IRQ9 , IRQ10 , NO_IRQ, IRQ12 , IRQ13 , NO_IRQ, NO_IRQ,
- /* INT3 INT41 INT5 INT6 */
- };
-
- /* See if the specified I/O address is possible for 78Q8377A. */
- /* [0-D]3D0 are allowed. */
- if ((sc->iobase & 0xFFF) != 0x3D0) return 0; /* XXX */
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a C-NET(98)P2 board here.) Don't
- remember to select BMPRs bofore reading EEPROM, since other
- register bank may be selected before the probe() is called. */
- fe_read_eeprom_ssi(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of Contec's. */
- if (!valid_Ether_p(eeprom+FE_SSI_EEP_ADDR, 0x00804C)) return 0;
- bcopy(eeprom+FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Setup the board type. */
- sc->typestr = "C-NET(98)P2";
-
- /* Get IRQ configuration from EEPROM. */
- dev->id_irq = irqmap[eeprom[FE_SSI_EEP_IRQ]];
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/9/10/12/13");
- return 0;
- }
-
- /* Get Duplex-mode configuration from EEPROM. */
- sc->proto_dlcr4 |= (eeprom[FE_SSI_EEP_DUPLEX] & FE_D4_DSC);
-
- /* Fill softc struct accordingly. */
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
-
- /* We have 16 registers. */
- return 16;
-}
-
-/*
- * Probe for TDK LAC-98012/013/025/9N011 - parhaps.
- */
-static int
-fe_probe_lnx (struct isa_device *dev, struct fe_softc *sc)
-{
-#ifndef FE_8BIT_SUPPORT
- printf("fe%d: skip LAC-98012/013(only 16-bit cards are supported)\n",
- sc->sc_unit);
- return 0;
-#else
- int i;
- u_char eeprom [LNX_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for TDK/LANX boards. */
- /* 0D0, 4D0, 8D0, and CD0 are allowed. */
- if ((sc->iobase & ~0xC00) != 0xD0) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for LAC-98.
- * 0x000, 0x002, 0x004, 0x006, 0x008, 0x00a, 0x00c, 0x00e,
- * 0x100, 0x102, 0x104, 0x106, 0x108, 0x10a, 0x10c, 0x10e,
- * 0x200, 0x202, 0x204, 0x206, 0x208, 0x20a, 0x20c, 0x20e,
- * 0x300, 0x302, 0x304, 0x306, 0x308, 0x30a, 0x30c, 0x30e,
- */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ((i & 7) << 1) + ((i & 0x18) << 5);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAC-98012/98013 board here.) */
- fe_read_eeprom_lnx(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK/LANX's. */
- if (!valid_Ether_p(eeprom, 0x008098)) return 0;
- bcopy(eeprom, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Setup the board type. */
- sc->typestr = "LAC-98012/98013";
-
- /* This looks like a TDK/LANX board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3 : sc->priv_info = 0x10 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ5 : sc->priv_info = 0x20 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ6 : sc->priv_info = 0x40 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ12: sc->priv_info = 0x80 | LNX_CLK_LO | LNX_SDA_HI; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
-
- /* LAC-98's system bus width is 8-bit. */
- sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x2KB
- | FE_D6_BBW_BYTE | FE_D6_SBW_BYTE | FE_D6_SRAM_150ns;
-
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_lnx;
-
- /* The I/O address range is fragmented in the LAC-98.
- It occupies 16*4 I/O addresses, by the way. */
- return 16;
-#endif /* FE_8BIT_SUPPORT */
-}
-
-/*
- * Probe for Gateway Communications' old cards.
- * (both as Generic MB86960 probe routine)
- */
-static int
-fe_probe_gwy ( struct isa_device * dev, struct fe_softc * sc )
-{
- static struct fe_simple_probe_struct probe_table [] = {
- /* { FE_DLCR2, 0x70, 0x00 }, */
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* I'm not sure which address is possible, so accepts any. FIXME. */
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Does we need to re-map ioaddr? FIXME. */
-
- /* See if the card is on its address. */
- if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-
- /* Get our station address from EEPROM. */
- inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
- if (!valid_Ether_p(sc->sc_enaddr, 0x000000)) return 0;
-
- /* Determine the card type. */
- sc->typestr = "Generic MB86960 Ethernet";
- if (valid_Ether_p(sc->sc_enaddr, 0x000061))
- sc->typestr = "Gateway Ethernet (Fujitsu chipset)";
-
- /* Gateway's board requires an explicit IRQ to work, since it
- is not possible to probe the setting of jumpers. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure(sc->typestr, sc->sc_unit, NO_IRQ, NULL);
- return 0;
- }
-
- /* We should change return value when re-mapping ioaddr. FIXME. */
- return 32;
-}
-
-/*
- * Probe for Ungermann-Bass Access/PC N98C+(Model 85152).
- */
-static int
-fe_probe_ubn (struct isa_device * dev, struct fe_softc * sc)
-{
- u_char sum;
- int i;
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for Access/PC. */
- /* [01][048C]D0 are allowed. */
- if ((sc->iobase & ~0x1C00) != 0xD0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for Access/PC N98C+.
- * 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007,
- * 0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f,
- * 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207,
- * 0x208, 0x209, 0x20a, 0x20b, 0x20c, 0x20d, 0x20e, 0x20f,
- */
- for (i = 16; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + 0x200 - 16 + i;
-
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address form ID ROM and make sure it is UBN's. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00DD01)) return 0;
-#if 1
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
- }
- if (sum != 0) return 0;
-#endif
- /* Setup the board type. */
- sc->typestr = "Access/PC";
-
- /* This looks like an AccessPC/N98C+ board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x01; break;
- case IRQ5: sc->priv_info = 0x02; break;
- case IRQ6: sc->priv_info = 0x04; break;
- case IRQ12: sc->priv_info = 0x08; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
-
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_ubn;
-
- /* The I/O address range is fragmented in the Access/PC N98C+.
- This is the number of regs at iobase. */
- return 16;
-}
-
-#else /* !PC98 */
-/*
- * Probe and initialization for Fujitsu FMV-180 series boards
- */
+ save16 = inb( sc->ioaddr[ FE_BMPR16 ] );
+ save17 = inb( sc->ioaddr[ FE_BMPR17 ] );
+ fe_read_eeprom( sc, eeprom );
-static void
-fe_init_fmv (struct fe_softc *sc)
-{
- /* Initialize ASIC. */
- outb( sc->ioaddr[ FE_FMV3 ], 0 );
- outb( sc->ioaddr[ FE_FMV10 ], 0 );
+ /* Make sure the EEPROM is turned off. */
+ outb( sc->ioaddr[ FE_BMPR16 ], 0 );
+ outb( sc->ioaddr[ FE_BMPR17 ], 0 );
-#if 0
- /* "Refresh" hardware configuration. FIXME. */
- outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
-#endif
-
- /* Turn the "master interrupt control" flag of ASIC on. */
- outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
-}
-
-static void
-fe_msel_fmv184 (struct fe_softc *sc)
-{
- u_char port;
-
- /* FMV-184 has a special "register" to switch between AUI/BNC.
- Determine the value to write into the register, based on the
- user-specified media selection. */
- port = (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_2) ? 0x00 : 0x01;
-
- /* The register is #5 on exntesion register bank...
- (Details of the register layout is not yet discovered.) */
- outb(sc->ioaddr[0x1B], 0x46); /* ??? */
- outb(sc->ioaddr[0x1E], 0x04); /* select ex-reg #4. */
- outb(sc->ioaddr[0x1F], 0xC8); /* ??? */
- outb(sc->ioaddr[0x1E], 0x05); /* select ex-reg #5. */
- outb(sc->ioaddr[0x1F], port); /* Switch the media. */
- outb(sc->ioaddr[0x1E], 0x04); /* select ex-reg #4. */
- outb(sc->ioaddr[0x1F], 0x00); /* ??? */
- outb(sc->ioaddr[0x1B], 0x00); /* ??? */
-
- /* Make sure to select "external tranceiver" on MB86964. */
- outb(sc->ioaddr[FE_BMPR13], sc->proto_bmpr13 | FE_B13_PORT_AUI);
-}
-
-static int
-fe_probe_fmv ( struct isa_device * dev, struct fe_softc * sc )
-{
- int n;
-
- static u_short const irqmap [ 4 ] =
- { IRQ3, IRQ7, IRQ10, IRQ15 };
-
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x71, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
-
- { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
- { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/4 has 0x48 bits. */
- { FE_FMV3, 0x7F, 0x00 },
-
- { 0 }
- };
-
- /* Board subtypes; it lists known FMV-180 variants. */
- struct subtype {
- u_short mcode;
- u_short mbitmap;
- u_short defmedia;
- char const * str;
- };
- static struct subtype const typelist [] = {
- { 0x0005, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181" },
- { 0x0105, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181A" },
- { 0x0003, MB_HM, MB_HM, "FMV-182" },
- { 0x0103, MB_HM, MB_HM, "FMV-182A" },
- { 0x0804, MB_HT, MB_HT, "FMV-183" },
- { 0x0C04, MB_HT, MB_HT, "FMV-183 (on-board)" },
- { 0x0803, MB_H2|MB_H5, MB_H2, "FMV-184" },
- { 0, MB_HA, MB_HA, "unknown FMV-180 (?)" },
- };
- struct subtype const * type;
-
- /* Media indicator and "Hardware revision ID" */
- u_short mcode;
-
- /* See if the specified address is possible for FMV-180
- series. 220, 240, 260, 280, 2A0, 2C0, 300, and 340 are
- allowed for all boards, and 200, 2E0, 320, 360, 380, 3A0,
- 3C0, and 3E0 for PnP boards. */
- if ((sc->iobase & ~0x1E0) != 0x200) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address from EEPROM, and make sure it is
- Fujitsu's. */
- inblk(sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00000E)) return 0;
-
- /* Find the supported media and "hardware revision" to know
- the model identification. */
- mcode = (inb(sc->ioaddr[FE_FMV0]) & FE_FMV0_MEDIA)
- | ((inb(sc->ioaddr[FE_FMV1]) & FE_FMV1_REV) << 8);
-
- /* Determine the card type. */
- for (type = typelist; type->mcode != 0; type++) {
- if (type->mcode == mcode) break;
- }
- if (type->mcode == 0) {
- /* Unknown card type... Hope the driver works. */
- sc->stability |= UNSTABLE_TYPE;
- if (bootverbose) {
- printf("fe%d: unknown config: %x-%x-%x-%x\n",
- sc->sc_unit,
- inb(sc->ioaddr[FE_FMV0]),
- inb(sc->ioaddr[FE_FMV1]),
- inb(sc->ioaddr[FE_FMV2]),
- inb(sc->ioaddr[FE_FMV3]));
- }
- }
-
- /* Setup the board type and media information. */
- sc->typestr = type->str;
- sc->mbitmap = type->mbitmap;
- sc->defmedia = type->defmedia;
- sc->msel = fe_msel_965;
-
- if (type->mbitmap == (MB_H2 | MB_H5)) {
- /* FMV184 requires a special media selection procedure. */
- sc->msel = fe_msel_fmv184;
- }
-
- /*
- * An FMV-180 has been probed.
- * Determine which IRQ to be used.
- *
- * In this version, we give a priority to the kernel config file.
- * If the EEPROM and config don't match, say it to the user for
- * an attention.
- */
- n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
- >> FE_FMV2_IRS_SHIFT;
- if ( dev->id_irq == NO_IRQ ) {
- /* Just use the probed value. */
- dev->id_irq = irqmap[ n ];
- } else if ( dev->id_irq != irqmap[ n ] ) {
- /* Don't match. */
- sc->stability |= UNSTABLE_IRQ;
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[ FE_BMPR19 ] ) ) {
+ goto NOTFOUND;
}
- /* We need an init hook to initialize ASIC before we start. */
- sc->init = fe_init_fmv;
-
- /*
- * That's all. FMV-180 occupies 32 I/O addresses, by the way.
- */
- return 32;
-}
-
-/*
- * Fujitsu MB86965 JLI mode probe routines.
- *
- * 86965 has a special operating mode called JLI (mode 0), under which
- * the chip interfaces with ISA bus with a software-programmable
- * configuration. (The Fujitsu document calls the feature "Plug and
- * play," but it is not compatible with the ISA-PnP spec. designed by
- * Intel and Microsoft.) Ethernet cards designed to use JLI are
- * almost same, but there are two things which require board-specific
- * probe routines: EEPROM layout and IRQ pin connection.
- *
- * JLI provides a handy way to access EEPROM which should contains the
- * chip configuration information (such as I/O port address) as well
- * as Ethernet station (MAC) address. The chip configuration info. is
- * stored on a fixed location. However, the station address can be
- * located anywhere in the EEPROM; it is up to the board designer to
- * determine the location. (The manual just says "somewhere in the
- * EEPROM.") The fe driver must somehow find out the correct
- * location.
- *
- * Another problem resides in the IRQ pin connection. JLI provides a
- * user to choose an IRQ from up to four predefined IRQs. The 86965
- * chip has a register to select one out of the four possibilities.
- * However, the selection is against the four IRQ pins on the chip.
- * (So-called IRQ-A, -B, -C and -D.) It is (again) up to the board
- * designer to determine which pin to connect which IRQ line on the
- * ISA bus. We need a vendor (or model, for some vendor) specific IRQ
- * mapping table.
- *
- * The routine fe_probe_jli() provides all probe and initialization
- * processes which are common to all JLI implementation, and sub-probe
- * routines supply board-specific actions.
- *
- * JLI sub-probe routine has the following template:
- *
- * u_short const * func (struct fe_softc * sc, u_char const * eeprom);
- *
- * where eeprom is a pointer to an array of 32 byte data read from the
- * config EEPROM on the board. It retuns an IRQ mapping table for the
- * board, when the corresponding implementation is detected. It
- * returns a NULL otherwise.
- *
- * Primary purpose of the functin is to analize the config EEPROM,
- * determine if it matches with the pattern of that of supported card,
- * and extract necessary information from it. One of the information
- * expected to be extracted from EEPROM is the Ethernet station (MAC)
- * address, which must be set to the softc table of the interface by
- * the board-specific routine.
- */
-
-/* JLI sub-probe for Allied-Telesyn/Allied-Telesis AT1700/RE2000 series. */
-static u_short const *
-fe_probe_jli_ati (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmaps_ati [4][4] =
- {
- { IRQ3, IRQ4, IRQ5, IRQ9 },
- { IRQ10, IRQ11, IRQ12, IRQ15 },
- { IRQ3, IRQ11, IRQ5, IRQ15 },
- { IRQ10, IRQ11, IRQ14, IRQ15 },
- };
-
- /* Make sure the EEPROM contains Allied-Telesis/Allied-Telesyn
- bit pattern. */
- if (eeprom[1] != 0x00) return NULL;
- for (i = 2; i < 8; i++) if (eeprom[i] != 0xFF) return NULL;
- for (i = 14; i < 24; i++) if (eeprom[i] != 0xFF) return NULL;
-
- /* Get our station address from EEPROM, and make sure the
- EEPROM contains ATI's address. */
- bcopy(eeprom+8, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return NULL;
-
/*
- * The following model identification codes are stolen
+ * The following model identification codes are stolen from
* from the NetBSD port of the fe driver. My reviewers
* suggested minor revision.
*/
@@ -1891,604 +971,222 @@ fe_probe_jli_ati (struct fe_softc * sc, u_char const * eeprom)
switch (eeprom[FE_ATI_EEP_MODEL]) {
case FE_ATI_MODEL_AT1700T:
sc->typestr = "AT-1700T/RE2001";
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
break;
case FE_ATI_MODEL_AT1700BT:
sc->typestr = "AT-1700BT/RE2003";
- sc->mbitmap = MB_HA | MB_HT | MB_H2;
break;
case FE_ATI_MODEL_AT1700FT:
sc->typestr = "AT-1700FT/RE2009";
- sc->mbitmap = MB_HA | MB_HT | MB_HF;
break;
case FE_ATI_MODEL_AT1700AT:
sc->typestr = "AT-1700AT/RE2005";
- sc->mbitmap = MB_HA | MB_HT | MB_H5;
break;
default:
- sc->typestr = "unknown AT-1700/RE2000";
- sc->stability |= UNSTABLE_TYPE | UNSTABLE_IRQ;
+ sc->typestr = "unknown AT-1700/RE2000 ?";
break;
}
-#if 0
- /* Should we extract default media from eeprom? Linux driver
- for AT1700 does it, although previous releases of FreeBSD
- don't. FIXME. */
- /* Determine the default media selection from the config
- EEPROM. The byte at offset EEP_MEDIA is believed to
- contain BMPR13 value to be set. We just ignore STP bit or
- squelch bit, since we don't support those. (It is
- intentional.) */
- switch (eeprom[FE_ATI_EEP_MEDIA] & FE_B13_PORT) {
- case FE_B13_AUTO:
- sc->defmedia = MB_HA;
- break;
- case FE_B13_TP:
- sc->defmedia = MB_HT;
- break;
- case FE_B13_AUI:
- sc->defmedia = sc->mbitmap & (MB_H2|MB_H5|MB_H5); /*XXX*/
- break;
- default:
- sc->defmedia = MB_HA;
- break;
- }
-
- /* Make sure the default media is compatible with the supported
- ones. */
- if ((sc->defmedia & sc->mbitmap) == 0) {
- if (sc->defmedia == MB_HA) {
- sc->defmedia = MB_HT;
- } else {
- sc->defmedia = MB_HA;
- }
- }
-#endif
-
/*
* Try to determine IRQ settings.
* Different models use different ranges of IRQs.
*/
- switch ((eeprom[FE_ATI_EEP_REVISION] & 0xf0)
- |(eeprom[FE_ATI_EEP_MAGIC] & 0x04)) {
- case 0x30: case 0x34: return irqmaps_ati[3];
- case 0x10: case 0x14:
- case 0x50: case 0x54: return irqmaps_ati[2];
- case 0x44: case 0x64: return irqmaps_ati[1];
- default: return irqmaps_ati[0];
- }
-}
-
-/* JLI sub-probe and msel hook for ICL Ethernet. */
-
-static void
-fe_msel_icl (struct fe_softc *sc)
-{
- u_char d4;
-
- /* Switch between UTP and "external tranceiver" as always. */
- fe_msel_965(sc);
-
- /* The board needs one more bit (on DLCR4) be set appropriately. */
- if (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_5) {
- d4 = sc->proto_dlcr4 | FE_D4_CNTRL;
- } else {
- d4 = sc->proto_dlcr4 & ~FE_D4_CNTRL;
- }
- outb(sc->ioaddr[FE_DLCR4], d4);
-}
-
-static u_short const *
-fe_probe_jli_icl (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- u_short defmedia;
- u_char d6;
- static u_short const irqmap_icl [4] = { IRQ9, IRQ10, IRQ5, IRQ15 };
-
- /* Make sure the EEPROM contains ICL bit pattern. */
- for (i = 24; i < 39; i++) {
- if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL;
- }
- for (i = 112; i < 122; i++) {
- if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL;
- }
-
- /* Make sure the EEPROM contains ICL's permanent station
- address. If it isn't, probably this board is not an
- ICL's. */
- if (!valid_Ether_p(eeprom+122, 0x00004B)) return NULL;
-
- /* Check if the "configured" Ethernet address in the EEPROM is
- valid. Use it if it is, or use the "permanent" address instead. */
- if (valid_Ether_p(eeprom+4, 0x020000)) {
- /* The configured address is valid. Use it. */
- bcopy(eeprom+4, sc->sc_enaddr, ETHER_ADDR_LEN);
- } else {
- /* The configured address is invalid. Use permanent. */
- bcopy(eeprom+122, sc->sc_enaddr, ETHER_ADDR_LEN);
- }
-
- /* Determine model and supported media. */
- switch (eeprom[0x5E]) {
- case 0:
- sc->typestr = "EtherTeam16i/COMBO";
- sc->mbitmap = MB_HA | MB_HT | MB_H5 | MB_H2;
- break;
- case 1:
- sc->typestr = "EtherTeam16i/TP";
- sc->mbitmap = MB_HT;
- break;
- case 2:
- sc->typestr = "EtherTeam16i/ErgoPro";
- sc->mbitmap = MB_HA | MB_HT | MB_H5;
- break;
- case 4:
- sc->typestr = "EtherTeam16i/DUO";
- sc->mbitmap = MB_HA | MB_HT | MB_H2;
- break;
- default:
- sc->typestr = "EtherTeam16i";
- sc->stability |= UNSTABLE_TYPE;
- if (bootverbose) {
- printf("fe%d: unknown model code %02x for EtherTeam16i\n",
- sc->sc_unit, eeprom[0x5E]);
- }
- break;
- }
-
- /* I'm not sure the following msel hook is required by all
- models or COMBO only... FIXME. */
- sc->msel = fe_msel_icl;
-
- /* Make the configured media selection the default media. */
- switch (eeprom[0x28]) {
- case 0: defmedia = MB_HA; break;
- case 1: defmedia = MB_H5; break;
- case 2: defmedia = MB_HT; break;
- case 3: defmedia = MB_H2; break;
- default:
- if (bootverbose) {
- printf("fe%d: unknown default media: %02x\n",
- sc->sc_unit, eeprom[0x28]);
- }
- defmedia = MB_HA;
- break;
- }
-
- /* Make sure the default media is compatible with the
- supported media. */
- if ((defmedia & sc->mbitmap) == 0) {
- if (bootverbose) {
- printf("fe%d: default media adjusted\n", sc->sc_unit);
- }
- defmedia = sc->mbitmap;
- }
-
- /* Keep the determined default media. */
- sc->defmedia = defmedia;
-
- /* ICL has "fat" models. We have to program 86965 to properly
- reflect the hardware. */
- d6 = sc->proto_dlcr6 & ~(FE_D6_BUFSIZ | FE_D6_BBW);
- switch ((eeprom[0x61] << 8) | eeprom[0x60]) {
- case 0x2008: d6 |= FE_D6_BUFSIZ_32KB | FE_D6_BBW_BYTE; break;
- case 0x4010: d6 |= FE_D6_BUFSIZ_64KB | FE_D6_BBW_WORD; break;
- default:
- /* We can't support it, since we don't know which bits
- to set in DLCR6. */
- printf("fe%d: unknown SRAM config for ICL\n", sc->sc_unit);
- return NULL;
- }
- sc->proto_dlcr6 = d6;
-
- /* Returns the IRQ table for the ICL board. */
- return irqmap_icl;
-}
-
-/* JLI sub-probe for RATOC REX-5586/5587. */
-static u_short const *
-fe_probe_jli_rex (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmap_rex [4] = { IRQ3, IRQ4, IRQ5, NO_IRQ };
-
- /* Make sure the EEPROM contains RATOC's config pattern. */
- if (eeprom[1] != eeprom[0]) return NULL;
- for (i = 8; i < 32; i++) if (eeprom[i] != 0xFF) return NULL;
-
- /* Get our station address from EEPROM. Note that RATOC
- stores it "byte-swapped" in each word. (I don't know why.)
- So, we just can't use bcopy().*/
- sc->sc_enaddr[0] = eeprom[3];
- sc->sc_enaddr[1] = eeprom[2];
- sc->sc_enaddr[2] = eeprom[5];
- sc->sc_enaddr[3] = eeprom[4];
- sc->sc_enaddr[4] = eeprom[7];
- sc->sc_enaddr[5] = eeprom[6];
-
- /* Make sure the EEPROM contains RATOC's station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x00C0D0)) return NULL;
-
- /* I don't know any sub-model identification. */
- sc->typestr = "REX-5586/5587";
-
- /* Returns the IRQ for the RATOC board. */
- return irqmap_rex;
-}
-
-/* JLI sub-probe for Unknown board. */
-static u_short const *
-fe_probe_jli_unk (struct fe_softc * sc, u_char const * eeprom)
-{
- int i, n, romsize;
- static u_short const irqmap [4] = { NO_IRQ, NO_IRQ, NO_IRQ, NO_IRQ };
-
- /* The generic JLI probe considered this board has an 86965
- in JLI mode, but any other board-specific routines could
- not find the matching implementation. So, we "guess" the
- location by looking for a bit pattern which looks like a
- MAC address. */
-
- /* Determine how large the EEPROM is. */
- for (romsize = JLI_EEPROM_SIZE/2; romsize > 16; romsize >>= 1) {
- for (i = 0; i < romsize; i++) {
- if (eeprom[i] != eeprom[i+romsize]) break;
+ if ( dev->id_irq == NO_IRQ ) {
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_IRQ )
+ >> FE_B19_IRQ_SHIFT;
+ switch ( eeprom[ FE_ATI_EEP_REVISION ] & 0xf0 ) {
+ case 0x30:
+ dev->id_irq = irqmaps[ 3 ][ n ];
+ break;
+ case 0x10:
+ case 0x50:
+ dev->id_irq = irqmaps[ 2 ][ n ];
+ break;
+ case 0x40:
+ case 0x60:
+ if ( eeprom[ FE_ATI_EEP_MAGIC ] & 0x04 ) {
+ dev->id_irq = irqmaps[ 1 ][ n ];
+ } else {
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ }
+ break;
+ default:
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ break;
}
- if (i < romsize) break;
}
- romsize <<= 1;
-
- /* Look for a bit pattern which looks like a MAC address. */
- for (n = 2; n <= romsize - ETHER_ADDR_LEN; n += 2) {
- if (!valid_Ether_p(eeprom + n, 0x000000)) continue;
- }
-
- /* If no reasonable address was found, we can't go further. */
- if (n > romsize - ETHER_ADDR_LEN) return NULL;
- /* Extract our (guessed) station address. */
- bcopy(eeprom+n, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* We are not sure what type of board it is... */
- sc->typestr = "(unknown JLI)";
- sc->stability |= UNSTABLE_TYPE | UNSTABLE_MAC;
-
- /* Returns the totally unknown IRQ mapping table. */
- return irqmap;
-}
-
-/*
- * Probe and initialization for all JLI implementations.
- */
-
-static int
-fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
-{
- int i, n;
- int irq;
- u_char eeprom [JLI_EEPROM_SIZE];
- u_short const * irqmap;
-
- static u_short const baseaddr [8] =
- { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR1, 0x20, 0x00 },
- { FE_DLCR2, 0x50, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { FE_DLCR5, 0x80, 0x00 },
-#if 0
- { FE_BMPR16, 0x1B, 0x00 },
- { FE_BMPR17, 0x7F, 0x00 },
-#endif
- { 0 }
- };
/*
- * See if the specified address is possible for MB86965A JLI mode.
+ * Initialize constants in the per-line structure.
*/
- for (i = 0; i < 8; i++) {
- if (baseaddr[i] == sc->iobase) break;
- }
- if (i == 8) return 0;
- /* Fill the softc struct with reasonable default. */
- fe_softc_defaults(sc);
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+#if 1
/*
- * We should test if MB86965A is on the base address now.
- * Unfortunately, it is very hard to probe it reliably, since
- * we have no way to reset the chip under software control.
- * On cold boot, we could check the "signature" bit patterns
- * described in the Fujitsu document. On warm boot, however,
- * we can predict almost nothing about register values.
+ * This test doesn't work well for AT1700 look-alike by
+ * other vendors.
*/
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ /* Make sure the vendor part is for Allied-Telesis. */
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
- /* Check if our I/O address matches config info on 86965. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_ADDR) >> FE_B19_ADDR_SHIFT;
- if (baseaddr[n] != sc->iobase) return 0;
+#else
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+#endif
/*
- * We are now almost sure we have an MB86965 at the given
- * address. So, read EEPROM through it. We have to write
- * into LSI registers to read from EEPROM. I want to avoid it
- * at this stage, but I cannot test the presence of the chip
- * any further without reading EEPROM. FIXME.
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
*/
- fe_read_eeprom_jli(sc, eeprom);
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+#if 0 /* XXXX Should we use this? FIXME. */
+ sc->proto_bmpr13 = eeprom[ FE_ATI_EEP_MEDIA ];
+#else
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+#endif
- /* Make sure that config info in EEPROM and 86965 agree. */
- if (eeprom[FE_EEPROM_CONF] != inb(sc->ioaddr[FE_BMPR19])) {
- return 0;
- }
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "ATI found" );
+#endif
- /* Use 86965 media selection scheme, unless othewise
- specified. It is "AUTO always" and "select with BMPR13."
- This behaviour covers most of the 86965 based board (as
- minimum requirements.) It is backward compatible with
- previous versions, also. */
- sc->mbitmap = MB_HA;
- sc->defmedia = MB_HA;
- sc->msel = fe_msel_965;
-
- /* Perform board-specific probe, one by one. Note that the
- order of probe is important and should not be changed
- arbitrarily. */
- if ((irqmap = fe_probe_jli_ati(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_rex(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_icl(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_unk(sc, eeprom)) == NULL) return 0;
-
- /* Find the IRQ read from EEPROM. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ) >> FE_B19_IRQ_SHIFT;
- irq = irqmap[n];
-
- /* Try to determine IRQ setting. */
- if (dev->id_irq == NO_IRQ && irq == NO_IRQ) {
- /* The device must be configured with an explicit IRQ. */
- printf("fe%d: IRQ auto-detection does not work\n",
- sc->sc_unit);
- return 0;
- } else if (dev->id_irq == NO_IRQ && irq != NO_IRQ) {
- /* Just use the probed IRQ value. */
- dev->id_irq = irq;
- } else if (dev->id_irq != NO_IRQ && irq == NO_IRQ) {
- /* No problem. Go ahead. */
- } else if (dev->id_irq == irq) {
- /* Good. Go ahead. */
- } else {
- /* User must be warned in this case. */
- sc->stability |= UNSTABLE_IRQ;
- }
+ /* Setup hooks. This may solves a nasty bug. FIXME. */
+ sc->init = fe_init_ati;
- /* Setup a hook, which resets te 86965 when the driver is being
- initialized. This may solve a nasty bug. FIXME. */
- sc->init = fe_init_jli;
+ /* Initialize 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_ati()" );
+#endif
/*
- * That's all. 86965 JLI occupies 32 I/O addresses, by the way.
+ * That's all. AT1700 occupies 32 I/O addresses, by the way.
*/
return 32;
-}
-
-/* Probe for TDK LAK-AX031, which is an SSi 78Q8377A based board. */
-
-static int
-fe_probe_ssi (struct isa_device *dev, struct fe_softc *sc)
-{
- u_char eeprom [SSI_EEPROM_SIZE];
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x08, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for 78Q8377A. */
- if ((sc->iobase & ~0x3F0) != 0x000) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAK-AX031 board here.) Don't
- remember to select BMPRs bofore reading EEPROM, since other
- register bank may be selected before the probe() is called. */
- fe_read_eeprom_ssi(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK's. */
- if (!valid_Ether_p(eeprom+FE_SSI_EEP_ADDR, 0x008098)) return 0;
- bcopy(eeprom+FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* This looks like a TDK-AX031 board. It requires an explicit
- IRQ setting in config, since we currently don't know how we
- can find the IRQ value assigned by ISA PnP manager. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure("LAK-AX031", sc->sc_unit, dev->id_irq, NULL);
- return 0;
+ NOTFOUND:
+ /*
+ * We have no AT1700 at a given address.
+ * Restore BMPR16 and BMPR17 if we have destroyed them,
+ * hoping that the hardware on the address didn't get
+ * bad side effect.
+ */
+ if ( save16 != 0 | save17 != 0 ) {
+ outb( sc->ioaddr[ FE_BMPR16 ], save16 );
+ outb( sc->ioaddr[ FE_BMPR17 ], save17 );
}
-
- /* Fill softc struct accordingly. */
- sc->typestr = "LAK-AX031";
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
-
- /* We have 16 registers. */
- return 16;
+ return ( 0 );
}
-/*
- * Probe and initialization for TDK/LANX LAC-AX012/013 boards.
- */
-static int
-fe_probe_lnx (struct isa_device *dev, struct fe_softc *sc)
+/* ATI specific initialization routine. */
+static void
+fe_init_ati ( struct fe_softc * sc )
{
- u_char eeprom [LNX_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for TDK/LANX boards. */
- /* 300, 320, 340, and 360 are allowed. */
- if ((sc->iobase & ~0x060) != 0x300) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
+/*
+ * I've told that the following operation "Resets" the chip.
+ * Hope this solve a bug which hangs up the driver under
+ * heavy load... FIXME.
+ */
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAC-AX012/AX013 board here.) */
- fe_read_eeprom_lnx(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK/LANX's. */
- if (!valid_Ether_p(eeprom, 0x008098)) return 0;
- bcopy(eeprom, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* This looks like a TDK/LANX board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x40 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ4: sc->priv_info = 0x20 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ5: sc->priv_info = 0x10 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ9: sc->priv_info = 0x80 | LNX_CLK_LO | LNX_SDA_HI; break;
- default:
- fe_irq_failure("LAC-AX012/AX013",
- sc->sc_unit, dev->id_irq, "3/4/5/9");
- return 0;
- }
+ /* Minimal initialization of 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
- /* Fill softc struct accordingly. */
- sc->typestr = "LAC-AX012/AX013";
- sc->init = fe_init_lnx;
+ /* "Reset" by wrting into an undocument register location. */
+ outb( sc->ioaddr[ 0x1F ], 0 );
- /* We have 32 registers. */
- return 32;
+ /* How long do we have to wait after the reset? FIXME. */
+ DELAY( 300 );
}
/*
* Probe and initialization for Gateway Communications' old cards.
*/
static int
-fe_probe_gwy ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_gwy ( DEVICE * dev, struct fe_softc * sc )
{
+ int i;
+
static struct fe_simple_probe_struct probe_table [] = {
- /* { FE_DLCR2, 0x70, 0x00 }, */
- { FE_DLCR2, 0x58, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR7, 0xC0, 0x00 },
+ /*
+ * Test *vendor* part of the address for Gateway.
+ * This test is essential to identify Gateway's cards.
+ * We shuld define some symbolic names for the
+ * following offsets. FIXME.
+ */
+ { 0x18, 0xFF, 0x00 },
+ { 0x19, 0xFF, 0x00 },
+ { 0x1A, 0xFF, 0x61 },
{ 0 }
};
- /* See if the specified I/O address is possible for Gateway boards. */
- if ((sc->iobase & ~0x1E0) != 0x200) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-
- /* Get our station address from EEPROM. */
- inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
-
- /* Make sure it is Gateway Communication's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x000061)) return 0;
-
- /* Gateway's board requires an explicit IRQ to work, since it
- is not possible to probe the setting of jumpers. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure("Gateway Ethernet", sc->sc_unit, NO_IRQ, NULL);
- return 0;
+ /*
+ * We need explicit IRQ and supported address.
+ * I'm not sure which address and IRQ is possible for Gateway
+ * Ethernet family. The following accepts everything. FIXME.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
}
- /* Fill softc struct accordingly. */
- sc->typestr = "Gateway Ethernet (Fujitsu chipset)";
-
- /* That's all. The card occupies 32 I/O addresses, as always. */
- return 32;
-}
-
-/* Probe and initialization for Ungermann-Bass Network
- K.K. "Access/PC" boards. */
-static int
-fe_probe_ubn (struct isa_device * dev, struct fe_softc * sc)
-{
-#if 0
- u_char sum;
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
#endif
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for AccessPC/ISA. */
- if ((sc->iobase & ~0x0E0) != 0x300) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address form ID ROM and make sure it is UBN's. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00DD01)) return 0;
-#if 0
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
}
- if (sum != 0) return 0;
-#endif
- /* This looks like an AccessPC/ISA board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x02; break;
- case IRQ4: sc->priv_info = 0x04; break;
- case IRQ5: sc->priv_info = 0x08; break;
- case IRQ10: sc->priv_info = 0x10; break;
- default:
- fe_irq_failure("Access/PC",
- sc->sc_unit, dev->id_irq, "3/4/5/10");
+
+ /* See if the card is on its address. */
+ if ( !fe_simple_probe( sc, probe_table ) ) {
return 0;
}
- /* Fill softc struct accordingly. */
- sc->typestr = "Access/PC";
- sc->init = fe_init_ubn;
+ /* Determine the card type. */
+ sc->typestr = "Gateway Ethernet w/ Fujitsu chipset";
- /* We have 32 registers. */
- return 32;
-}
-#endif /* PC98 */
+ /* Get our station address from EEPROM. */
+ inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
-#if NCARD > 0
-/*
- * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
- * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
- */
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 16KB, 100ns, byte-wide access.
+ * Transmission buffer: 2KB x 2.
+ * System bus interface: 16 bits.
+ * Make sure to clear out ID bits in DLCR7
+ * (They actually are Encoder/Decoder control in NICE.)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_16KB | FE_D6_TXBSIZ_2x2KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = 0;
-static void
-fe_init_mbh ( struct fe_softc * sc )
-{
/* Minimal initialization of 86960. */
DELAY( 200 );
outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
@@ -2498,63 +1196,142 @@ fe_init_mbh ( struct fe_softc * sc )
outb( sc->ioaddr[ FE_DLCR2 ], 0 );
outb( sc->ioaddr[ FE_DLCR3 ], 0 );
- /* Enable master interrupt flag. */
- outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+ /* That's all. The card occupies 32 I/O addresses, as always. */
+ return 32;
}
+#if NCARD > 0
+/*
+ * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
+ * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
+ */
static int
-fe_probe_mbh ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_mbh ( DEVICE * dev, struct fe_softc * sc )
{
+ int i,type;
+
static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
+ { FE_DLCR0, 0x09, 0x00 },
+ { FE_DLCR2, 0x79, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
{ FE_DLCR6, 0xFF, 0xB6 },
+ /*
+ * The following location has the first byte of the card's
+ * Ethernet (MAC) address.
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "global" and "unicast" for any vendors'.
+ */
+ { FE_MBH10, 0x03, 0x00 },
+
+ /* Just a gap? Seems reliable, anyway. */
+ { 0x12, 0xFF, 0x00 },
+ { 0x13, 0xFF, 0x00 },
+ { 0x14, 0xFF, 0x00 },
+ { 0x15, 0xFF, 0x00 },
+ { 0x16, 0xFF, 0x00 },
+ { 0x17, 0xFF, 0x00 },
+#if 0
+ { 0x18, 0xFF, 0xFF },
+ { 0x19, 0xFF, 0xFF },
+#endif
+
{ 0 }
};
-#ifdef DIAGNOSTIC
- /* We need an explicit IRQ. */
- if (dev->id_irq == NO_IRQ) return 0;
+ /*
+ * We need explicit IRQ and supported address.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
#endif
- /* Ethernet MAC address should *NOT* have been given by pccardd,
- if this is a true MBH10302; i.e., Ethernet address must be
- "all-zero" upon entry. */
- if (sc->sc_enaddr[0] || sc->sc_enaddr[1] || sc->sc_enaddr[2] ||
- sc->sc_enaddr[3] || sc->sc_enaddr[4] || sc->sc_enaddr[5]) {
- return 0;
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
}
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
/*
* See if MBH10302 is on its address.
* I'm not sure the following probe code works. FIXME.
*/
if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+ /* Determine the card type. */
+ sc->typestr = "MBH10302 (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
/* Get our station address from EEPROM. */
inblk( sc, FE_MBH10, sc->sc_enaddr, ETHER_ADDR_LEN );
/* Make sure we got a valid station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0)) return 0;
+ if ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) return 0;
- /* Determine the card type. */
- sc->typestr = "MBH10302 (PCMCIA)";
-
- /* We seems to need our own IDENT bits... FIXME. */
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
/* Setup hooks. We need a special initialization procedure. */
sc->init = fe_init_mbh;
/*
+ * Minimum initialization.
+ */
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if 1 /* FIXME. */
+ /* Initialize system bus interface and encoder/decoder operation. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_DISABLE );
+#endif
+
+ /*
* That's all. MBH10302 occupies 32 I/O addresses, by the way.
*/
return 32;
}
+/* MBH specific initialization routine. */
+static void
+fe_init_mbh ( struct fe_softc * sc )
+{
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* Enable master interrupt flag. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+}
+
/*
* Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
* by MASUI Kenji <masui@cs.titech.ac.jp>
@@ -2562,24 +1339,41 @@ fe_probe_mbh ( struct isa_device * dev, struct fe_softc * sc )
* (Contec uses TDK Ethenet chip -- hosokawa)
*
* This version of fe_probe_tdk has been rewrote to handle
- * *generic* PC card implementation of Fujitsu MB8696x family. The
- * name _tdk is just for a historical reason. :-)
+ * *generic* PC card implementation of Fujitsu MB8696x and compatibles.
+ * The name _tdk is just for a historical reason. <seki> :-)
*/
static int
-fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_tdk ( DEVICE * dev, struct fe_softc * sc )
{
+ int i;
+
static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x50, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
/* { FE_DLCR5, 0x80, 0x00 }, Does not work well. */
{ 0 }
};
+ /* We need an IRQ. */
if ( dev->id_irq == NO_IRQ ) {
return ( 0 );
}
- fe_softc_defaults(sc);
+ /* Generic driver needs Ethernet address taken from CIS. */
+ if (sc->arpcom.ac_enaddr[0] == 0
+ && sc->arpcom.ac_enaddr[1] == 0
+ && sc->arpcom.ac_enaddr[2] == 0) {
+ return 0;
+ }
+
+ /* Setup an I/O address mapping table; we need only 16 ports. */
+ for (i = 0; i < 16; i++) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Fill unused slots with a safe address. */
+ for (i = 16; i < MAXREGISTERS; i++) {
+ sc->ioaddr[i] = sc->iobase;
+ }
/*
* See if C-NET(PC)C is on its address.
@@ -2588,19 +1382,56 @@ fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
if ( !fe_simple_probe( sc, probe_table ) ) return 0;
/* Determine the card type. */
- sc->typestr = "Generic MB8696x/78Q837x Ethernet (PCMCIA)";
+ sc->typestr = "Generic MB8696x Ethernet (PCMCIA)";
/*
* Initialize constants in the per-line structure.
*/
- /* Make sure we got a valid station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0)) return 0;
+ /* The station address *must*be* already in sc_enaddr;
+ Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
/*
- * That's all. C-NET(PC)C occupies 16 I/O addresses.
- * XXX: Are there any card with 32 I/O addresses? FIXME.
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we remove IDENT_NICE from DLCR7? Or,
+ * even add IDENT_EC instead? FIXME.
*/
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Minimul initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /*
+ * That's all. C-NET(PC)C occupies 16 I/O addresses.
+ *
+ * Some PC cards (e.g., TDK and Contec) have 16 I/O addresses,
+ * while some others (e.g., Fujitsu) have 32. Fortunately,
+ * this generic driver never accesses latter 16 ports in 32
+ * ports cards. So, we can assume the *generic* PC cards
+ * always have 16 ports.
+ *
+ * Moreover, PC card probe is isolated from ISA probe, and PC
+ * card probe routine doesn't use "# of ports" returned by this
+ * function. 16 v.s. 32 is not important now.
+ */
return 16;
}
#endif /* NCARD > 0 */
@@ -2609,15 +1440,12 @@ fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
* Install interface into kernel networking data structures
*/
static int
-fe_attach ( struct isa_device * dev )
+fe_attach ( DEVICE * dev )
{
#if NCARD > 0
static int already_ifattach[NFE];
#endif
struct fe_softc *sc = &fe_softc[dev->id_unit];
- int b;
-
- dev->id_ointr = feintr;
/*
* Initialize ifnet structure
@@ -2629,20 +1457,12 @@ fe_attach ( struct isa_device * dev )
sc->sc_if.if_start = fe_start;
sc->sc_if.if_ioctl = fe_ioctl;
sc->sc_if.if_watchdog = fe_watchdog;
- sc->sc_if.if_init = fe_init;
- sc->sc_if.if_linkmib = &sc->mibdata;
- sc->sc_if.if_linkmiblen = sizeof (sc->mibdata);
-
-#if 0 /* I'm not sure... */
- sc->mibdata.dot3Compliance = DOT3COMPLIANCE_COLLS;
-#endif
/*
- * Set fixed interface flags.
+ * Set default interface flags.
*/
sc->sc_if.if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-#if 1
/*
* Set maximum size of output queue, if it has not been set.
* It is done here as this driver may be started after the
@@ -2656,6 +1476,9 @@ fe_attach ( struct isa_device * dev )
if ( sc->sc_if.if_snd.ifq_maxlen == 0 ) {
sc->sc_if.if_snd.ifq_maxlen = ifqmaxlen;
}
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "attach()" );
#endif
#if FE_SINGLE_TRANSMISSION
@@ -2676,33 +1499,16 @@ fe_attach ( struct isa_device * dev )
case FE_D6_TXBSIZ_2x8KB: sc->txb_size = 8192; break;
default:
/* Oops, we can't work with single buffer configuration. */
- if (bootverbose) {
- printf("fe%d: strange TXBSIZ config; fixing\n",
- sc->sc_unit);
- }
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: strange TXBSIZ config; fixing\n",
+ sc->sc_unit );
+#endif
sc->proto_dlcr6 &= ~FE_D6_TXBSIZ;
sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
sc->txb_size = 2048;
break;
}
- /* Initialize the if_media interface. */
- ifmedia_init(&sc->media, 0, fe_medchange, fe_medstat );
- for (b = 0; bit2media[b] != 0; b++) {
- if (sc->mbitmap & (1 << b)) {
- ifmedia_add(&sc->media, bit2media[b], 0, NULL);
- }
- }
- for (b = 0; bit2media[b] != 0; b++) {
- if (sc->defmedia & (1 << b)) {
- ifmedia_set(&sc->media, bit2media[b]);
- break;
- }
- }
-#if 0 /* Turned off; this is called later, when the interface UPs. */
- fe_medchange(sc);
-#endif
-
/* Attach and stop the interface. */
#if NCARD > 0
if (already_ifattach[dev->id_unit] != 1) {
@@ -2712,14 +1518,14 @@ fe_attach ( struct isa_device * dev )
#else
if_attach(&sc->sc_if);
#endif
- fe_stop(sc);
+ fe_stop(sc->sc_unit); /* This changes the state to IDLE. */
ether_ifattach(&sc->sc_if);
/* Print additional info when attached. */
- printf("fe%d: address %6D, type %s%s\n", sc->sc_unit,
- sc->sc_enaddr, ":" , sc->typestr,
- (sc->proto_dlcr4 & FE_D4_DSC) ? ", full duplex" : "");
- if (bootverbose) {
+ printf( "fe%d: address %6D, type %s\n", sc->sc_unit,
+ sc->sc_enaddr, ":" , sc->typestr );
+#if FE_DEBUG >= 3
+ {
int buf, txb, bbw, sbw, ram;
buf = txb = bbw = sbw = ram = -1;
@@ -2746,42 +1552,29 @@ fe_attach ( struct isa_device * dev )
case FE_D6_SRAM_100ns: ram = 100; break;
case FE_D6_SRAM_150ns: ram = 150; break;
}
- printf("fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
- sc->sc_unit, buf, bbw, ram, txb, sbw);
- }
- if (sc->stability & UNSTABLE_IRQ) {
- printf("fe%d: warning: IRQ number may be incorrect\n",
- sc->sc_unit);
- }
- if (sc->stability & UNSTABLE_MAC) {
- printf("fe%d: warning: above MAC address may be incorrect\n",
- sc->sc_unit);
- }
- if (sc->stability & UNSTABLE_TYPE) {
- printf("fe%d: warning: hardware type was not validated\n",
- sc->sc_unit);
+ printf( "fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
+ sc->sc_unit, buf, bbw, ram, txb, sbw );
}
+#endif
#if NBPFILTER > 0
/* If BPF is in the kernel, call the attach for it. */
- bpfattach(&sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
+ bpfattach( &sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
#endif
return 1;
}
/*
- * Reset interface, after some (hardware) trouble is deteced.
+ * Reset interface.
*/
static void
-fe_reset (struct fe_softc *sc)
+fe_reset ( int unit )
{
- /* Record how many packets are lost by this accident. */
- sc->sc_if.if_oerrors += sc->txb_sched + sc->txb_count;
- sc->mibdata.dot3StatsInternalMacTransmitErrors++;
-
- /* Put the interface into known initial state. */
- fe_stop(sc);
- if (sc->sc_if.if_flags & IFF_UP) fe_init(sc);
+ /*
+ * Stop interface and re-initialize.
+ */
+ fe_stop(unit);
+ fe_init(unit);
}
/*
@@ -2791,12 +1584,17 @@ fe_reset (struct fe_softc *sc)
* if any, will be lost by stopping the interface.
*/
static void
-fe_stop (struct fe_softc *sc)
+fe_stop ( int unit )
{
+ struct fe_softc *sc = &fe_softc[unit];
int s;
s = splimp();
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "stop()" );
+#endif
+
/* Disable interrupts. */
outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
@@ -2825,9 +1623,15 @@ fe_stop (struct fe_softc *sc)
/* MAR loading can be delayed. */
sc->filter_change = 0;
- /* Call a device-specific hook. */
+ /* Update config status also. */
+
+ /* Call a hook. */
if ( sc->stop ) sc->stop( sc );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of stop()" );
+#endif
+
(void) splx(s);
}
@@ -2840,39 +1644,80 @@ fe_watchdog ( struct ifnet *ifp )
{
struct fe_softc *sc = (struct fe_softc *)ifp;
+#if FE_DEBUG >= 1
/* A "debug" message. */
- printf("fe%d: transmission timeout (%d+%d)%s\n",
- ifp->if_unit, sc->txb_sched, sc->txb_count,
- (ifp->if_flags & IFF_UP) ? "" : " when down");
+ log( LOG_ERR, "fe%d: transmission timeout (%d+%d)%s\n",
+ ifp->if_unit, sc->txb_sched, sc->txb_count,
+ ( ifp->if_flags & IFF_UP ) ? "" : " when down" );
if ( sc->sc_if.if_opackets == 0 && sc->sc_if.if_ipackets == 0 ) {
- printf("fe%d: wrong IRQ setting in config?\n", ifp->if_unit);
+ log( LOG_WARNING, "fe%d: wrong IRQ setting in config?\n",
+ ifp->if_unit );
+ }
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Record how many packets are lost by this accident. */
+ ifp->if_oerrors += sc->txb_sched + sc->txb_count;
+
+ /* Put the interface into known initial state. */
+ if ( ifp->if_flags & IFF_UP ) {
+ fe_reset( ifp->if_unit );
+ } else {
+ fe_stop( ifp->if_unit );
}
- fe_reset( sc );
}
/*
* Initialize device.
*/
static void
-fe_init (void * xsc)
+fe_init ( int unit )
{
- struct fe_softc *sc = xsc;
+ struct fe_softc *sc = &fe_softc[unit];
int s;
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init()" );
+#endif
+
/* We need an address. */
if (TAILQ_EMPTY(&sc->sc_if.if_addrhead)) { /* XXX unlikely */
-#ifdef DIAGNOSTIC
- printf("fe%d: init() without any address\n", sc->sc_unit);
+#if FE_DEBUG >= 1
+ log( LOG_ERR, "fe%d: init() without any address\n",
+ sc->sc_unit );
#endif
return;
}
+#if FE_DEBUG >= 1
+ /*
+ * Make sure we have a valid station address.
+ * The following test is applicable for any Ethernet interfaces.
+ * It can be done in somewhere common to all of them. FIXME.
+ */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x01 ) != 0
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) {
+ log( LOG_ERR, "fe%d: invalid station address (%6D)\n",
+ sc->sc_unit, sc->sc_enaddr, ":" );
+ return;
+ }
+#endif
+
/* Start initializing 86960. */
s = splimp();
- /* Call a hook before we start initializing the chip. */
+ /* Call a hook. */
if ( sc->init ) sc->init( sc );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after init hook" );
+#endif
+
/*
* Make sure to disable the chip, also.
* This may also help re-programming the chip after
@@ -2914,19 +1759,23 @@ fe_init (void * xsc)
outb( sc->ioaddr[ FE_BMPR14 ], 0x00 );
outb( sc->ioaddr[ FE_BMPR15 ], 0x00 );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just before enabling DLC" );
+#endif
+
/* Enable interrupts. */
outb( sc->ioaddr[ FE_DLCR2 ], FE_TMASK );
outb( sc->ioaddr[ FE_DLCR3 ], FE_RMASK );
- /* Select requested media, just before enabling DLC. */
- if (sc->msel) sc->msel(sc);
-
/* Enable transmitter and receiver. */
DELAY( 200 );
outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
DELAY( 200 );
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just after enabling DLC" );
+#endif
+
/*
* Make sure to empty the receive buffer.
*
@@ -2945,16 +1794,24 @@ fe_init (void * xsc)
* The following message helps discovering the fact. FIXME.
*/
if ( !( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) ) {
- printf("fe%d: receive buffer has some data after reset\n",
- sc->sc_unit);
+ log( LOG_WARNING,
+ "fe%d: receive buffer has some data after reset\n",
+ sc->sc_unit );
+
fe_emptybuffer( sc );
}
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after ERB loop" );
+#endif
+
/* Do we need this here? Actually, no. I must be paranoia. */
outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
-#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after FIXME" );
+#endif
/* Set 'running' flag, because we are now running. */
sc->sc_if.if_flags |= IFF_RUNNING;
@@ -2967,13 +1824,15 @@ fe_init (void * xsc)
*/
fe_setmode( sc );
-#if 0
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after setmode" );
+#endif
+
/* ...and attempt to start output queued packets. */
- /* TURNED OFF, because the semi-auto media prober wants to UP
- the interface keeping it idle. The upper layer will soon
- start the interface anyway, and there are no significant
- delay. */
fe_start( &sc->sc_if );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init() done" );
#endif
(void) splx(s);
@@ -3017,7 +1876,7 @@ fe_start ( struct ifnet *ifp )
struct fe_softc *sc = ifp->if_softc;
struct mbuf *m;
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 1
/* Just a sanity check. */
if ( ( sc->txb_count == 0 ) != ( sc->txb_free == sc->txb_size ) ) {
/*
@@ -3028,8 +1887,8 @@ fe_start ( struct ifnet *ifp )
* txb_count is zero if and only if txb_free is same
* as txb_size (which represents whole buffer.)
*/
- printf("fe%d: inconsistent txb variables (%d, %d)\n",
- sc->sc_unit, sc->txb_count, sc->txb_free);
+ log( LOG_ERR, "fe%d: inconsistent txb variables (%d, %d)\n",
+ sc->sc_unit, sc->txb_count, sc->txb_free );
/*
* So, what should I do, then?
*
@@ -3049,15 +1908,18 @@ fe_start ( struct ifnet *ifp )
}
#endif
+#if FE_DEBUG >= 1
/*
* First, see if there are buffered packets and an idle
* transmitter - should never happen at this point.
*/
if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
- printf("fe%d: transmitter idle with %d buffered packets\n",
- sc->sc_unit, sc->txb_count);
+ log( LOG_ERR,
+ "fe%d: transmitter idle with %d buffered packets\n",
+ sc->sc_unit, sc->txb_count );
fe_xmit( sc );
}
+#endif
/*
* Stop accepting more transmission packets temporarily, when
@@ -3179,41 +2041,17 @@ fe_droppacket ( struct fe_softc * sc, int len )
*/
if ( len > 12 ) {
/* Read 4 more bytes, and skip the rest of the packet. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- else
-#endif
- {
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
- outb( sc->ioaddr[ FE_BMPR14 ], FE_B14_SKIP );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ outb( sc->ioaddr[ FE_BMPR14 ], FE_B14_SKIP );
} else {
/* We should not come here unless receiving RUNTs. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- for ( i = 0; i < len; i++ ) {
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- }
- else
-#endif
- {
- for ( i = 0; i < len; i += 2 ) {
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+ for ( i = 0; i < len; i += 2 ) {
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
}
}
}
-#ifdef DIAGNOSTIC
/*
* Empty receiving buffer.
*/
@@ -3223,10 +2061,9 @@ fe_emptybuffer ( struct fe_softc * sc )
int i;
u_char saved_dlcr5;
-#ifdef FE_DEBUG
- printf("fe%d: emptying receive buffer\n", sc->sc_unit);
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: emptying receive buffer\n", sc->sc_unit );
#endif
-
/*
* Stop receiving packets, temporarily.
*/
@@ -3235,32 +2072,21 @@ fe_emptybuffer ( struct fe_softc * sc )
DELAY(1300);
/*
- * When we come here, the receive buffer management may
+ * When we come here, the receive buffer management should
* have been broken. So, we cannot use skip operation.
* Just discard everything in the buffer.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- for ( i = 0; i < 65536; i++ ) {
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- }
- else
-#endif
- {
- for ( i = 0; i < 65536; i += 2 ) {
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+ for (i = 0; i < 32768; i++) {
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
}
/*
* Double check.
*/
if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) {
- printf("fe%d: could not empty receive buffer\n", sc->sc_unit);
+ log( LOG_ERR, "fe%d: could not empty receive buffer\n",
+ sc->sc_unit );
/* Hmm. What should I do if this happens? FIXME. */
}
@@ -3269,7 +2095,6 @@ fe_emptybuffer ( struct fe_softc * sc )
*/
outb( sc->ioaddr[ FE_DLCR5 ], saved_dlcr5 );
}
-#endif
/*
* Transmission interrupt handler
@@ -3291,8 +2116,14 @@ fe_tint ( struct fe_softc * sc, u_char tstat )
* are left unsent in transmission buffer.
*/
left = inb( sc->ioaddr[ FE_BMPR10 ] );
- printf("fe%d: excessive collision (%d/%d)\n",
- sc->sc_unit, left, sc->txb_sched);
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: excessive collision (%d/%d)\n",
+ sc->sc_unit, left, sc->txb_sched );
+#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
/*
* Clear the collision flag (in 86960) here
@@ -3366,24 +2197,19 @@ fe_tint ( struct fe_softc * sc, u_char tstat )
col = 1;
}
sc->sc_if.if_collisions += col;
- if ( col == 1 ) {
- sc->mibdata.dot3StatsSingleCollisionFrames++;
- } else {
- sc->mibdata.dot3StatsMultipleCollisionFrames++;
- }
- sc->mibdata.dot3StatsCollFrequencies[col-1]++;
+#if FE_DEBUG >= 3
+ log( LOG_WARNING, "fe%d: %d collision(s) (%d)\n",
+ sc->sc_unit, col, sc->txb_sched );
+#endif
}
/*
* Update transmission statistics.
* Be sure to reflect number of excessive collisions.
*/
- col = sc->tx_excolls;
- sc->sc_if.if_opackets += sc->txb_sched - col;
- sc->sc_if.if_oerrors += col;
- sc->sc_if.if_collisions += col * 16;
- sc->mibdata.dot3StatsExcessiveCollisions += col;
- sc->mibdata.dot3StatsCollFrequencies[15] += col;
+ sc->sc_if.if_opackets += sc->txb_sched - sc->tx_excolls;
+ sc->sc_if.if_oerrors += sc->tx_excolls;
+ sc->sc_if.if_collisions += sc->tx_excolls * 16;
sc->txb_sched = 0;
/*
@@ -3415,28 +2241,18 @@ fe_rint ( struct fe_softc * sc, u_char rstat )
/*
* Update statistics if this interrupt is caused by an error.
- * Note that, when the system was not sufficiently fast, the
- * receive interrupt might not be acknowledged immediately. If
- * one or more errornous frames were received before this routine
- * was scheduled, they are ignored, and the following error stats
- * give less than real values.
*/
if ( rstat & ( FE_D1_OVRFLO | FE_D1_CRCERR
| FE_D1_ALGERR | FE_D1_SRTPKT ) ) {
- if ( rstat & FE_D1_OVRFLO )
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- if ( rstat & FE_D1_CRCERR )
- sc->mibdata.dot3StatsFCSErrors++;
- if ( rstat & FE_D1_ALGERR )
- sc->mibdata.dot3StatsAlignmentErrors++;
-#if 0
- /* The reference MAC receiver defined in 802.3
- silently ignores short frames (RUNTs) without
- notifying upper layer. RFC 1650 (dot3 MIB) is
- based on the 802.3, and it has no stats entry for
- RUNTs... */
- if ( rstat & FE_D1_SRTPKT )
- sc->mibdata.dot3StatsFrameTooShorts++; /* :-) */
+#if FE_DEBUG >= 2
+ log( LOG_WARNING,
+ "fe%d: receive error: %s%s%s%s(%02x)\n",
+ sc->sc_unit,
+ rstat & FE_D1_OVRFLO ? "OVR " : "",
+ rstat & FE_D1_CRCERR ? "CRC " : "",
+ rstat & FE_D1_ALGERR ? "ALG " : "",
+ rstat & FE_D1_SRTPKT ? "LEN " : "",
+ rstat );
#endif
sc->sc_if.if_ierrors++;
}
@@ -3449,109 +2265,147 @@ fe_rint ( struct fe_softc * sc, u_char rstat )
* We limit the number of iterations to avoid infinite-loop.
* The upper bound is set to unrealistic high value.
*/
- for ( i = 0; i < FE_MAX_RECV_COUNT * 2; i++ ) {
+ for (i = 0; i < FE_MAX_RECV_COUNT * 2; i++) {
/* Stop the iteration if 86960 indicates no packets. */
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) return;
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
/*
- * Extract a receive status byte.
+ * Extract A receive status byte.
* As our 86960 is in 16 bit bus access mode, we have to
* use inw() to get the status byte. The significant
* value is returned in lower 8 bits.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- status = inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void ) inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- else
+ status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: receive status = %04x\n",
+ sc->sc_unit, status );
#endif
- {
- status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
/*
* Extract the packet length.
* It is a sum of a header (14 bytes) and a payload.
* CRC has been stripped off by the 86960.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- len = inb( sc->ioaddr[ FE_BMPR8 ] );
- len |= ( inb( sc->ioaddr[ FE_BMPR8 ] ) << 8 );
+ len = inw( sc->ioaddr[ FE_BMPR8 ] );
+
+#if FE_DEBUG >= 1
+ /*
+ * If there was an error with the received packet, it
+ * must be an indication of out-of-sync on receive
+ * buffer, because we have programmed the 8696x to
+ * to discard errored packets, even when the interface
+ * is in promiscuous mode. We have to re-synchronize.
+ */
+ if (!(status & FE_RPH_GOOD)) {
+ log(LOG_ERR,
+ "fe%d: corrupted receive status byte (%02x)\n",
+ sc->arpcom.ac_if.if_unit, status);
+ sc->arpcom.ac_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
}
- else
#endif
- {
- len = inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+#if FE_DEBUG >= 1
/*
- * AS our 86960 is programed to ignore errored frame,
- * we must not see any error indication in the
- * receive buffer. So, any error condition is a
- * serious error, e.g., out-of-sync of the receive
- * buffer pointers.
+ * MB86960 checks the packet length and drop big packet
+ * before passing it to us. There are no chance we can
+ * get big packets through it, even if they are actually
+ * sent over a line. Hence, if the length exceeds
+ * the specified limit, it means some serious failure,
+ * such as out-of-sync on receive buffer management.
+ *
+ * Same for short packets, since we have programmed
+ * 86960 to drop short packets.
*/
- if ( ( status & 0xF0 ) != 0x20
- || len > ETHER_MAX_LEN - ETHER_CRC_LEN
- || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
- printf("fe%d: RX buffer out-of-sync\n", sc->sc_unit);
+ if ( len > ETHER_MAX_LEN - ETHER_CRC_LEN
+ || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ log( LOG_WARNING,
+ "fe%d: received a %s packet? (%u bytes)\n",
+ sc->sc_unit,
+ len < ETHER_MIN_LEN - ETHER_CRC_LEN
+ ? "partial" : "big",
+ len );
sc->sc_if.if_ierrors++;
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- fe_reset(sc);
- return;
+ fe_emptybuffer( sc );
+ break;
}
+#endif
/*
* Go get a packet.
*/
if ( fe_get_packet( sc, len ) < 0 ) {
- /*
- * Negative return from fe_get_packet()
- * indicates no available mbuf. We stop
- * receiving packets, even if there are more
- * in the buffer. We hope we can get more
- * mbuf next time.
- */
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "%s%d: out of mbuf;"
+ " dropping a packet (%u bytes)\n",
+ sc->sc_unit, len );
+#endif
+
+ /* Skip a packet, updating statistics. */
sc->sc_if.if_ierrors++;
- sc->mibdata.dot3StatsMissedFrames++;
fe_droppacket( sc, len );
- return;
+
+ /*
+ * Try extracting other packets, although they will
+ * cause out-of-mbuf error again. This is required
+ * to keep receiver interrupt comming.
+ * (Earlier versions had a bug on this point.)
+ */
+ continue;
}
/* Successfully received a packet. Update stat. */
sc->sc_if.if_ipackets++;
}
-
- /* Maximum number of frames has been received. Something
- strange is happening here... */
- printf("fe%d: unusual receive flood\n", sc->sc_unit);
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- fe_reset(sc);
}
/*
* Ethernet interface interrupt processor
*/
-static void
+void
feintr ( int unit )
{
struct fe_softc *sc = &fe_softc[unit];
u_char tstat, rstat;
- int loop_count = FE_MAX_LOOP;
- /* Loop until there are no more new interrupt conditions. */
- while (loop_count-- > 0) {
+ /*
+ * Loop until there are no more new interrupt conditions.
+ */
+ for (;;) {
+
+#if FE_DEBUG >= 4
+ fe_dump( LOG_INFO, sc, "intr()" );
+#endif
+
/*
* Get interrupt conditions, masking unneeded flags.
*/
tstat = inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_TMASK;
rstat = inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_RMASK;
- if ( tstat == 0 && rstat == 0 ) return;
+
+#if FE_DEBUG >= 1
+ /* Test for a "dead-lock" condition. */
+ if ((rstat & FE_D1_PKTRDY) == 0
+ && (inb(sc->ioaddr[FE_DLCR5]) & FE_D5_BUFEMP) == 0
+ && (inb(sc->ioaddr[FE_DLCR1]) & FE_D1_PKTRDY) == 0) {
+ /*
+ * PKTRDY is off, while receive buffer is not empty.
+ * We did a double check to avoid a race condition...
+ * So, we should have missed an interrupt.
+ */
+ log(LOG_WARNING,
+ "fe%d: missed a receiver interrupt?\n",
+ sc->arpcom.ac_if.if_unit);
+ /* Simulate the missed interrupt condition. */
+ rstat |= FE_D1_PKTRDY;
+ }
+#endif
+
+ /* Stop processing if there are no interrupts to handle. */
+ if ( tstat == 0 && rstat == 0 ) break;
/*
* Reset the conditions we are acknowledging.
@@ -3560,7 +2414,8 @@ feintr ( int unit )
outb( sc->ioaddr[ FE_DLCR1 ], rstat );
/*
- * Handle transmitter interrupts.
+ * Handle transmitter interrupts. Handle these first because
+ * the receiver will reset the board under some conditions.
*/
if ( tstat ) {
fe_tint( sc, tstat );
@@ -3605,9 +2460,6 @@ feintr ( int unit )
}
}
-
- printf("fe%d: too many loops\n", sc->sc_unit);
- return;
}
/*
@@ -3618,32 +2470,148 @@ static int
fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
{
struct fe_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *)data;
int s, error = 0;
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: ioctl(%x)\n", sc->sc_unit, command );
+#endif
+
s = splimp();
switch (command) {
case SIOCSIFADDR:
+ {
+ struct ifaddr * ifa = ( struct ifaddr * )data;
+
+ sc->sc_if.if_flags |= IFF_UP;
+
+ switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+ case AF_INET:
+ fe_init( sc->sc_unit ); /* before arp_ifinit */
+ arp_ifinit( &sc->arpcom, ifa );
+ break;
+#endif
+#ifdef IPX
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_IPX:
+ {
+ register struct ipx_addr *ina
+ = &(IA_SIPX(ifa)->sipx_addr);
+
+ if (ipx_nullhost(*ina))
+ ina->x_host =
+ *(union ipx_host *) (sc->sc_enaddr); else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+#ifdef INET6
+ case AF_INET6:
+ /* IPV6 added by shin 96.2.6 */
+ fe_init(sc->sc_unit);
+ ndp6_ifinit(&sc->arpcom, ifa);
+ break;
+#endif
+#ifdef NS
+
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_NS:
+ {
+ register struct ns_addr *ina
+ = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host =
+ *(union ns_host *) (sc->sc_enaddr);
+ else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+ default:
+ fe_init( sc->sc_unit );
+ break;
+ }
+ break;
+ }
+
+#ifdef SIOCGIFADDR
case SIOCGIFADDR:
- case SIOCSIFMTU:
- /* Just an ordinary action. */
- error = ether_ioctl(ifp, command, data);
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+ struct sockaddr * sa = ( struct sockaddr * )&ifr->ifr_data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)sa->sa_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef SIOCGIFPHYSADDR
+ case SIOCGIFPHYSADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)&ifr->ifr_data, ETHER_ADDR_LEN);
break;
+ }
+#endif
+#ifdef notdef
+#ifdef SIOCSIFPHYSADDR
+ case SIOCSIFPHYSADDR:
+ {
+ /*
+ * Set the physical (Ethernet) address of the interface.
+ * When and by whom is this command used? FIXME.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)&ifr->ifr_data,
+ (caddr_t)sc->sc_enaddr, ETHER_ADDR_LEN);
+ fe_setlinkaddr( sc );
+ break;
+ }
+#endif
+#endif /* notdef */
+
+#ifdef SIOCSIFFLAGS
case SIOCSIFFLAGS:
+ {
/*
* Switch interface state between "running" and
* "stopped", reflecting the UP flag.
*/
if ( sc->sc_if.if_flags & IFF_UP ) {
if ( ( sc->sc_if.if_flags & IFF_RUNNING ) == 0 ) {
- fe_init(sc);
+ fe_init( sc->sc_unit );
}
} else {
if ( ( sc->sc_if.if_flags & IFF_RUNNING ) != 0 ) {
- fe_stop(sc);
+ fe_stop( sc->sc_unit );
}
}
@@ -3653,28 +2621,47 @@ fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
*/
fe_setmode( sc );
- /* Done. */
+#if FE_DEBUG >= 1
+ /* "ifconfig fe0 debug" to print register dump. */
+ if ( sc->sc_if.if_flags & IFF_DEBUG ) {
+ fe_dump( LOG_DEBUG, sc, "SIOCSIFFLAGS(DEBUG)" );
+ }
+#endif
break;
+ }
+#endif
+#ifdef SIOCADDMULTI
case SIOCADDMULTI:
case SIOCDELMULTI:
+ /*
+ * Multicast list has changed; set the hardware filter
+ * accordingly.
+ */
+ fe_setmode( sc );
+ error = 0;
+ break;
+#endif
+
+#ifdef SIOCSIFMTU
+ case SIOCSIFMTU:
+ {
/*
- * Multicast list has changed; set the hardware filter
- * accordingly.
+ * Set the interface MTU.
*/
- fe_setmode( sc );
- break;
+ struct ifreq * ifr = ( struct ifreq * )data;
- case SIOCSIFMEDIA:
- case SIOCGIFMEDIA:
- /* Let if_media to handle these commands and to call
- us back. */
- error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
+ if ( ifr->ifr_mtu > ETHERMTU ) {
+ error = EINVAL;
+ } else {
+ sc->sc_if.if_mtu = ifr->ifr_mtu;
+ }
break;
+ }
+#endif
default:
error = EINVAL;
- break;
}
(void) splx(s);
@@ -3746,20 +2733,11 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
/* The following silliness is to make NFS happy */
m->m_data += NFS_MAGIC_OFFSET;
- /* Get (actually just point to) the header part. */
- eh = mtod(m, struct ether_header *);
-
/* Get a packet. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- insb( sc->ioaddr[ FE_BMPR8 ], eh, len );
- }
- else
-#endif
- {
- insw( sc->ioaddr[ FE_BMPR8 ], eh, ( len + 1 ) >> 1 );
- }
+ insw( sc->ioaddr[ FE_BMPR8 ], m->m_data, ( len + 1 ) >> 1 );
+
+ /* Get (actually just point to) the header part. */
+ eh = mtod( m, struct ether_header *);
#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
@@ -3773,26 +2751,6 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
}
#endif
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *ifp;
-
- ifp = bridge_in(m);
- if (ifp == BDG_DROP) {
- m_freem(m);
- return 0;
- }
- if (ifp != BDG_LOCAL)
- bdg_forward(&m, ifp); /* not local, need forwarding */
- if (ifp == BDG_LOCAL || ifp == BDG_BCAST || ifp == BDG_MCAST)
- goto getit;
- /* not local and not multicast, just drop it */
- if (m)
- m_freem(m);
- return 0;
- }
-#endif
-
/*
* Make sure this packet is (or may be) directed to us.
* That is, the packet is either unicasted to our address,
@@ -3815,9 +2773,22 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
return 0;
}
-#ifdef BRIDGE
-getit:
+#if FE_DEBUG >= 3
+ if ( !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * This packet was not for us. We can't be in promiscuous
+ * mode since the case was handled by above test.
+ * We found an error (of this driver.)
+ */
+ log( LOG_WARNING,
+ "fe%d: got an unwanted packet, dst = %6D\n",
+ sc->sc_unit, eh->ether_dhost , ":" );
+ m_freem( m );
+ return 0;
+ }
#endif
+
/* Strip off the Ethernet header. */
m->m_pkthdr.len -= sizeof ( struct ether_header );
m->m_len -= sizeof ( struct ether_header );
@@ -3849,23 +2820,26 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
static u_char padding [ ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_HDR_LEN ];
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 1
/* First, count up the total number of bytes to copy */
length = 0;
for ( mp = m; mp != NULL; mp = mp->m_next ) {
length += mp->m_len;
}
- /* Check if this matches the one in the packet header. */
- if ( length != m->m_pkthdr.len ) {
- printf("fe%d: packet length mismatch? (%d/%d)\n", sc->sc_unit,
- length, m->m_pkthdr.len);
- }
#else
/* Just use the length value in the packet header. */
length = m->m_pkthdr.len;
#endif
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 2
+ /* Check if this matches the one in the packet header. */
+ if ( length != m->m_pkthdr.len ) {
+ log( LOG_WARNING, "fe%d: packet length mismatch? (%d/%d)\n",
+ sc->sc_unit, length, m->m_pkthdr.len );
+ }
+#endif
+
+#if FE_DEBUG >= 1
/*
* Should never send big packets. If such a packet is passed,
* it should be a bug of upper layer. We just ignore it.
@@ -3873,10 +2847,10 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
*/
if ( length < ETHER_HDR_LEN
|| length > ETHER_MAX_LEN - ETHER_CRC_LEN ) {
- printf("fe%d: got an out-of-spec packet (%u bytes) to send\n",
- sc->sc_unit, length);
+ log( LOG_ERR,
+ "fe%d: got an out-of-spec packet (%u bytes) to send\n",
+ sc->sc_unit, length );
sc->sc_if.if_oerrors++;
- sc->mibdata.dot3StatsInternalMacTransmitErrors++;
return;
}
#endif
@@ -3889,29 +2863,13 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
* packet in the transmission buffer, we can skip the
* padding process. It may gain performance slightly. FIXME.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- len = max( length, ETHER_MIN_LEN - ETHER_CRC_LEN );
- outb( addr_bmpr8, len & 0x00ff );
- outb( addr_bmpr8, ( len & 0xff00 ) >> 8 );
- }
- else
-#endif
- {
- outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
- }
+ outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
/*
* Update buffer status now.
* Truncate the length up to an even number, since we use outw().
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_WORD)
-#endif
- {
- length = ( length + 1 ) & ~1;
- }
+ length = ( length + 1 ) & ~1;
sc->txb_free -= FE_DATA_LEN_LEN + max( length, ETHER_MIN_LEN - ETHER_CRC_LEN);
sc->txb_count++;
@@ -3921,69 +2879,45 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
* only words. So that we require some extra code to patch
* over odd-length mbufs.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- /* 8-bit cards are easy. */
- for ( mp = m; mp != 0; mp = mp->m_next ) {
- if ( mp->m_len ) {
- outsb( addr_bmpr8, mtod(mp, caddr_t), mp->m_len );
- }
- }
- }
- else
-#endif
- {
- /* 16-bit cards are a pain. */
- savebyte = NO_PENDING_BYTE;
- for ( mp = m; mp != 0; mp = mp->m_next ) {
-
- /* Ignore empty mbuf. */
- len = mp->m_len;
- if ( len == 0 ) continue;
-
- /* Find the actual data to send. */
- data = mtod(mp, caddr_t);
-
- /* Finish the last byte. */
- if ( savebyte != NO_PENDING_BYTE ) {
- outw( addr_bmpr8, savebyte | ( *data << 8 ) );
- data++;
- len--;
- savebyte = NO_PENDING_BYTE;
- }
+ savebyte = NO_PENDING_BYTE;
+ for ( mp = m; mp != 0; mp = mp->m_next ) {
- /* output contiguous words */
- if (len > 1) {
- outsw( addr_bmpr8, data, len >> 1);
- data += len & ~1;
- len &= 1;
- }
+ /* Ignore empty mbuf. */
+ len = mp->m_len;
+ if ( len == 0 ) continue;
- /* Save a remaining byte, if there is one. */
- if ( len > 0 ) {
- savebyte = *data;
- }
- }
+ /* Find the actual data to send. */
+ data = mtod(mp, caddr_t);
- /* Spit the last byte, if the length is odd. */
+ /* Finish the last byte. */
if ( savebyte != NO_PENDING_BYTE ) {
- outw( addr_bmpr8, savebyte );
+ outw( addr_bmpr8, savebyte | ( *data << 8 ) );
+ data++;
+ len--;
+ savebyte = NO_PENDING_BYTE;
}
+
+ /* output contiguous words */
+ if (len > 1) {
+ outsw( addr_bmpr8, data, len >> 1);
+ data += len & ~1;
+ len &= 1;
+ }
+
+ /* Save a remaining byte, if there is one. */
+ if ( len > 0 ) {
+ savebyte = *data;
+ }
+ }
+
+ /* Spit the last byte, if the length is odd. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte );
}
/* Pad to the Ethernet minimum length, if the packet is too short. */
if ( length < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- outsb( addr_bmpr8, padding, ETHER_MIN_LEN - ETHER_CRC_LEN - length );
- }
- else
-#endif
- {
- outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
- }
+ outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
}
}
@@ -4029,9 +2963,9 @@ fe_mcaf ( struct fe_softc *sc )
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-#ifdef FE_DEBUG
- printf("fe%d: hash(%6D) == %d\n",
- sc->sc_unit, enm->enm_addrlo , ":", index);
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: hash(%6D) == %d\n",
+ sc->sc_unit, enm->enm_addrlo , ":", index );
#endif
filter.data[index >> 3] |= 1 << (index & 7);
@@ -4078,6 +3012,10 @@ fe_setmode ( struct fe_softc *sc )
outb( sc->ioaddr[ FE_DLCR5 ],
sc->proto_dlcr5 | FE_D5_AFM0 | FE_D5_AFM1 );
sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: promiscuous mode\n", sc->sc_unit );
+#endif
return;
}
@@ -4088,14 +3026,23 @@ fe_setmode ( struct fe_softc *sc )
/*
* Find the new multicast filter value.
+ * I'm not sure we have to handle modes other than MULTICAST.
+ * Who sets ALLMULTI? Who turns MULTICAST off? FIXME.
*/
if ( flags & IFF_ALLMULTI ) {
sc->filter = fe_filter_all;
- } else {
+ } else if ( flags & IFF_MULTICAST ) {
sc->filter = fe_mcaf( sc );
+ } else {
+ sc->filter = fe_filter_nothing;
}
sc->filter_change = 1;
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter: [%8D]\n",
+ sc->sc_unit, sc->filter.data, " " );
+#endif
+
/*
* We have to update the multicast filter in the 86960, A.S.A.P.
*
@@ -4104,6 +3051,9 @@ fe_setmode ( struct fe_softc *sc )
* DLC trashes all packets in both transmission and receive
* buffers when stopped.
*
+ * ... Are the above sentences correct? I have to check the
+ * manual of the MB86960A. FIXME.
+ *
* To reduce the packet loss, we delay the filter update
* process until buffers are empty.
*/
@@ -4120,6 +3070,9 @@ fe_setmode ( struct fe_softc *sc )
* the MARs. The new filter will be loaded by feintr()
* later.
*/
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: filter change delayed\n", sc->sc_unit );
+#endif
}
}
@@ -4157,45 +3110,36 @@ fe_loadmar ( struct fe_softc * sc )
/* We have just updated the filter. */
sc->filter_change = 0;
-}
-
-/* Change the media selection. */
-static int
-fe_medchange (struct ifnet *ifp)
-{
- struct fe_softc *sc = (struct fe_softc *)ifp->if_softc;
-#ifdef DIAGNOSTIC
- /* If_media should not pass any request for a media which this
- interface doesn't support. */
- int b;
-
- for (b = 0; bit2media[b] != 0; b++) {
- if (bit2media[b] == sc->media.ifm_media) break;
- }
- if (((1 << b) & sc->mbitmap) == 0) {
- printf("fe%d: got an unsupported media request (0x%x)\n",
- sc->sc_unit, sc->media.ifm_media);
- return EINVAL;
- }
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter changed\n", sc->sc_unit );
#endif
-
- /* We don't actually change media when the interface is down.
- fe_init() will do the job, instead. Should we also wait
- until the transmission buffer being empty? Changing the
- media when we are sending a frame will cause two garbages
- on wires, one on old media and another on new. FIXME */
- if (sc->sc_if.if_flags & IFF_UP) {
- if (sc->msel) sc->msel(sc);
- }
-
- return 0;
}
-/* I don't know how I can support media status callback... FIXME. */
+#if FE_DEBUG >= 1
static void
-fe_medstat (struct ifnet *ifp, struct ifmediareq *ifmr)
-{
- (void)ifp;
- (void)ifmr;
+fe_dump ( int level, struct fe_softc * sc, char * message )
+{
+ log( level, "fe%d: %s,"
+ " DLCR = %02x %02x %02x %02x %02x %02x %02x %02x,"
+ " BMPR = xx xx %02x %02x %02x %02x %02x %02x,"
+ " asic = %02x %02x %02x %02x %02x %02x %02x %02x"
+ " + %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ sc->sc_unit, message ? message : "registers",
+ inb( sc->ioaddr[ FE_DLCR0 ] ), inb( sc->ioaddr[ FE_DLCR1 ] ),
+ inb( sc->ioaddr[ FE_DLCR2 ] ), inb( sc->ioaddr[ FE_DLCR3 ] ),
+ inb( sc->ioaddr[ FE_DLCR4 ] ), inb( sc->ioaddr[ FE_DLCR5 ] ),
+ inb( sc->ioaddr[ FE_DLCR6 ] ), inb( sc->ioaddr[ FE_DLCR7 ] ),
+ inb( sc->ioaddr[ FE_BMPR10 ] ), inb( sc->ioaddr[ FE_BMPR11 ] ),
+ inb( sc->ioaddr[ FE_BMPR12 ] ), inb( sc->ioaddr[ FE_BMPR13 ] ),
+ inb( sc->ioaddr[ FE_BMPR14 ] ), inb( sc->ioaddr[ FE_BMPR15 ] ),
+ inb( sc->ioaddr[ 0x10 ] ), inb( sc->ioaddr[ 0x11 ] ),
+ inb( sc->ioaddr[ 0x12 ] ), inb( sc->ioaddr[ 0x13 ] ),
+ inb( sc->ioaddr[ 0x14 ] ), inb( sc->ioaddr[ 0x15 ] ),
+ inb( sc->ioaddr[ 0x16 ] ), inb( sc->ioaddr[ 0x17 ] ),
+ inb( sc->ioaddr[ 0x18 ] ), inb( sc->ioaddr[ 0x19 ] ),
+ inb( sc->ioaddr[ 0x1A ] ), inb( sc->ioaddr[ 0x1B ] ),
+ inb( sc->ioaddr[ 0x1C ] ), inb( sc->ioaddr[ 0x1D ] ),
+ inb( sc->ioaddr[ 0x1E ] ), inb( sc->ioaddr[ 0x1F ] ) );
}
+#endif
diff --git a/sys/i386/isa/if_fereg.h b/sys/i386/isa/if_fereg.h
index d9b943c5febf..2a26cbea10f1 100644
--- a/sys/i386/isa/if_fereg.h
+++ b/sys/i386/isa/if_fereg.h
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: if_fereg.h,v 1.5 1997/02/22 09:36:28 peter Exp $ */
+/* $Id$ */
/*
* Registers on FMV-180 series' ISA bus interface ASIC.
@@ -116,3 +116,17 @@
/* IRQ configuration. */
#define FE_RE1000_IRQCONF 0x10
+#define FE_RE1000_IRQCONF_IRQ 0xf0
+#define FE_RE1000_IRQCONF_IRQSHIFT 4
+
+/* MAC (station) address. */
+#define FE_RE1000_MAC0 0x11
+#define FE_RE1000_MAC1 0x13
+#define FE_RE1000_MAC2 0x15
+#define FE_RE1000_MAC3 0x17
+#define FE_RE1000_MAC4 0x19
+#define FE_RE1000_MAC5 0x1B
+
+/* "Check sum" -- an xor of MAC0 through MAC5 */
+#define FE_RE1000_MACCHK 0x1D
+
diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c
index 4b22ae52bc6c..f894dc540754 100644
--- a/sys/i386/isa/if_ie.c
+++ b/sys/i386/isa/if_ie.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.57 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ie.c,v 1.55 1998/08/10 14:27:32 bde Exp $
*/
/*
@@ -176,7 +176,6 @@ static struct mbuf *last_not_for_us;
static int ieprobe(struct isa_device * dvp);
static int ieattach(struct isa_device * dvp);
-static ointhand2_t ieintr;
static int sl_probe(struct isa_device * dvp);
static int el_probe(struct isa_device * dvp);
static int ni_probe(struct isa_device * dvp);
@@ -790,8 +789,6 @@ ieattach(struct isa_device *dvp)
struct ifnet *ifp = &ie->arpcom.ac_if;
size_t allocsize;
- dvp->id_ointr = ieintr;
-
/*
* based on the amount of memory we have, allocate our tx and rx
* resources.
@@ -854,7 +851,7 @@ ieattach(struct isa_device *dvp)
/*
* What to do upon receipt of an interrupt.
*/
-static void
+void
ieintr(int unit)
{
register struct ie_softc *ie = &ie_softc[unit];
@@ -2261,9 +2258,7 @@ static int
ieioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
struct ifaddr *ifa = (struct ifaddr *) data;
-#if defined(IPX) || defined(NS)
struct ie_softc *ie = ifp->if_softc;
-#endif
struct ifreq *ifr = (struct ifreq *) data;
int s, error = 0;
diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c
index fb9492f38429..f6b89edf411f 100644
--- a/sys/i386/isa/if_le.c
+++ b/sys/i386/isa/if_le.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_le.c,v 1.48 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_le.c,v 1.46 1998/07/15 09:38:09 bde Exp $
*/
/*
@@ -236,7 +236,6 @@ struct le_softc {
static int le_probe(struct isa_device *dvp);
static int le_attach(struct isa_device *dvp);
-static ointhand2_t le_intr;
static int le_ioctl(struct ifnet *ifp, u_long command, caddr_t data);
static void le_input(le_softc_t *sc, caddr_t seg1, size_t total_len,
size_t len2, caddr_t seg2);
@@ -355,7 +354,6 @@ le_attach(
le_softc_t *sc = &le_softc[dvp->id_unit];
struct ifnet *ifp = &sc->le_if;
- dvp->id_ointr = le_intr;
ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU;
printf("%s%d: %s ethernet address %6D\n",
@@ -380,7 +378,7 @@ le_attach(
return 1;
}
-static void
+void
le_intr(
int unit)
{
@@ -1126,7 +1124,7 @@ lemac_start(
/*
* The first four bytes of each transmit buffer are for
* control information. The first byte is the control
- * byte, then the length (why not word aligned?), then
+ * byte, then the length (why not word aligned??), then
* the off to the buffer.
*/
diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c
index 0e74247596c1..e31c600c823f 100644
--- a/sys/i386/isa/if_lnc.c
+++ b/sys/i386/isa/if_lnc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994-1998
+ * Copyright (c) 1995, 1996
* Paul Richards. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_lnc.c,v 1.50 1998/11/26 00:57:32 paul Exp $
+ * $Id: if_lnc.c,v 1.45 1998/08/24 02:28:15 bde Exp $
*/
/*
@@ -177,15 +177,14 @@ static int pcnet_probe __P((struct lnc_softc *sc));
static int lnc_attach_sc __P((struct lnc_softc *sc, int unit));
static int lnc_attach __P((struct isa_device *isa_dev));
static void lnc_init __P((struct lnc_softc *sc));
-static ointhand2_t lncintr;
static __inline int mbuf_to_buffer __P((struct mbuf *m, char *buffer));
static __inline struct mbuf *chain_to_cluster __P((struct mbuf *m));
static void lnc_start __P((struct ifnet *ifp));
static int lnc_ioctl __P((struct ifnet *ifp, u_long command, caddr_t data));
static void lnc_watchdog __P((struct ifnet *ifp));
#ifdef DEBUG
-void lnc_dump_state __P((struct lnc_softc *sc));
-void mbuf_dump_chain __P((struct mbuf *m));
+static void lnc_dump_state __P((struct lnc_softc *sc));
+static void mbuf_dump_chain __P((struct mbuf *m));
#endif
#if NPCI > 0
@@ -560,14 +559,13 @@ lnc_rint(struct lnc_softc *sc)
log(LOG_ERR, "lnc%d: Receive overflow error \n", unit);
}
} else if (flags & ENP) {
- if ((sc->arpcom.ac_if.if_flags & IFF_PROMISC)==0) {
/*
* FRAM and CRC are valid only if ENP
* is set and OFLO is not.
*/
if (flags & FRAM) {
LNCSTATS(fram)
- log(LOG_ERR, "lnc%d: Framing error\n", unit);
+ log(LOG_ERR, "lnc%d: Framming error\n", unit);
/*
* FRAM is only set if there's a CRC
* error so avoid multiple messages
@@ -576,7 +574,6 @@ lnc_rint(struct lnc_softc *sc)
LNCSTATS(crc)
log(LOG_ERR, "lnc%d: Receive CRC error\n", unit);
}
- }
}
/* Drop packet */
@@ -1276,10 +1273,8 @@ lnc_attach(struct isa_device * isa_dev)
{
int unit = isa_dev->id_unit;
struct lnc_softc *sc = &lnc_softc[unit];
- int result;
- isa_dev->id_ointr = lncintr;
- result = lnc_attach_sc (sc, unit);
+ int result = lnc_attach_sc (sc, unit);
if (result == 0)
return (0);
@@ -1311,7 +1306,7 @@ lnc_attach_ne2100_pci(int unit, unsigned iobase)
sc->bdp = iobase + PCNET_BDP;
sc->nic.ic = pcnet_probe(sc);
- if (sc->nic.ic >= PCnet_32) {
+ if (sc->nic.ic >= PCnet_PCI) {
sc->nic.ident = NE2100;
sc->nic.mem_mode = DMA_FIXED;
@@ -1597,7 +1592,7 @@ lncintr_sc(struct lnc_softc *sc)
}
}
-static void
+void
lncintr(int unit)
{
struct lnc_softc *sc = &lnc_softc[unit];
@@ -1896,7 +1891,7 @@ lnc_watchdog(struct ifnet *ifp)
}
#ifdef DEBUG
-void
+static void
lnc_dump_state(struct lnc_softc *sc)
{
int i;
@@ -1951,7 +1946,7 @@ lnc_dump_state(struct lnc_softc *sc)
outw(sc->rap, CSR0);
}
-void
+static void
mbuf_dump_chain(struct mbuf * m)
{
diff --git a/sys/i386/isa/if_lnc.h b/sys/i386/isa/if_lnc.h
index f281eaf13ab4..8d9ffabdbdba 100644
--- a/sys/i386/isa/if_lnc.h
+++ b/sys/i386/isa/if_lnc.h
@@ -1,36 +1,11 @@
-/*-
- * Copyright (c) 1994-1998
- * Paul Richards. 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,
- * verbatim and that no modifications are made prior to this
- * point in the file.
- * 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 Paul Richards.
- * 4. The name Paul Richards may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY PAUL RICHARDS ``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 PAUL RICHARDS 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.
+/*
+ * Copyright (c) 1994, Paul Richards. This software may be used, modified,
+ * copied, distributed, and sold, in both source and binary form provided
+ * that the above copyright and these terms are retained. Under no
+ * circumstances is the author responsible for the proper functioning
+ * of this software, nor does the author assume any responsibility
+ * for damages incurred with its use.
*
- * $Id: $
*/
#include <i386/isa/ic/Am7990.h>
diff --git a/sys/i386/isa/if_rdp.c b/sys/i386/isa/if_rdp.c
deleted file mode 100644
index 0d29b0aba602..000000000000
--- a/sys/i386/isa/if_rdp.c
+++ /dev/null
@@ -1,1456 +0,0 @@
-/*
- * Copyright 1998, Joerg Wunsch
- * 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 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.
- *
- * $Id: if_rdp.c,v 1.2 1998/12/21 18:11:10 joerg Exp $
- */
-
-/*
- * Device driver for RealTek RTL 8002 (`REDP') based pocket-ethernet
- * adapters, hooked up to a printer port. `rdp' is a shorthand for
- * REDP since some tools like netstat work best if the interface name
- * has no more than three letters.
- *
- * Driver configuration flags so far:
- * flags 0x1 -- assume 74S288 EEPROM (default 94C46)
- * flags 0x2 -- use `slow' mode (mode 3 of the packet driver, default 0)
- *
- * Maybe this driver will some day also work with the successor, RTL
- * 8012 (`AREDP'), which is unfortunately not fully register-
- * compatible with the 8002. The 8012 offers support for faster
- * transfer modi like bidirectional SPP and EPP, 64 K x 4 buffer
- * memory as opposed to 16 K x 4 for the 8002, a multicast filter, and
- * a builtin multiplexer that allows chaining a printer behind the
- * ethernet adapter.
- *
- * About the only documentation i've been able to find about the RTL
- * 8002 was the packet driver source code at ftp.realtek.com.tw, so
- * this driver is somewhat based on the way the packet driver handles
- * the chip. The exact author of the packet driver is unknown, the
- * only name that i could find in the source was someone called Chiu,
- * supposedly an employee of RealTek. So credits to them for that
- * piece of code which has proven valuable to me.
- *
- * Later on, Leo kuo <leo@realtek.com.tw> has been very helpful to me
- * by sending me a readable (PDF) file documenting the RTL 8012, which
- * helped me to also understand the 8002, as well as by providing me
- * with the source code of the 8012 packet driver that i haven't been
- * able to find on the FTP site. A big Thanks! goes here to RealTek
- * for this kind of service.
- */
-
-#include "rdp.h"
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/ethernet.h>
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/if_dl.h>
-#include <net/if_mib.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <machine/clock.h>
-#include <machine/md_var.h>
-
-#include <i386/isa/isa_device.h>
-#include <i386/isa/icu.h>
-#include <i386/isa/if_rdpreg.h>
-#include <i386/isa/intr_machdep.h>
-
-#define IOCTL_CMD_T u_long
-
-/*
- * Debug levels (ORed together):
- * != 0 - general (bad packets etc.)
- * 2 - debug EEPROM IO
- * 4 - debug interrupt status
- */
-#undef DEBUG
-#define DEBUG 0
-
-/*
- * rdp_softc: per interface info and status
- */
-struct rdp_softc {
- struct arpcom arpcom; /*
- * Ethernet common, always goes first so
- * a rdp_softc * can be cast into an
- * arpcom * or into an ifnet *.
- */
-
- /*
- * local stuff, somewhat sorted by memory alignment class
- */
- u_short baseaddr; /* IO port address */
- u_short txsize; /* tx size for next (buffered) packet,
- * there's only one additional packet
- * we can buffer, thus a single variable
- * ought to be enough */
- int txbusy; /* tx is transmitting */
- int txbuffered; /* # of packets in tx buffer */
- int slow; /* use lpt_control to send data */
- u_char irqenbit; /* mirror of current Ctrl_IRQEN */
- /*
- * type of parameter EEPROM; device flags 0x1 selects 74S288
- */
- enum {
- EEPROM_93C46, EEPROM_74S288 /* or 82S123 */
- } eeprom;
-};
-
-static struct rdp_softc rdp_softc[NRDP];
-
-/*
- * Since there's no fixed location in the EEPROM about where to find
- * the ethernet hardware address, we drop a table of valid OUIs here,
- * and search through the EEPROM until we find a possible valid
- * Ethernet address. Only the first 16 bits of all possible OUIs are
- * recorded in the table (as obtained from
- * http://standards.ieee.org/regauth/oui/oui.txt).
- */
-
-static u_short allowed_ouis[] = {
- 0x0000, 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0010, 0x001C, 0x0020, 0x0040, 0x0050, 0x0060,
- 0x0070, 0x0080, 0x0090, 0x009D, 0x00A0, 0x00AA, 0x00BB,
- 0x00C0, 0x00CF, 0x00DD, 0x00E0, 0x00E6, 0x0207, 0x021C,
- 0x0260, 0x0270, 0x029D, 0x02AA, 0x02BB, 0x02C0, 0x02CF,
- 0x02E6, 0x040A, 0x04E0, 0x0800, 0x08BB, 0x1000, 0x1100,
- 0x8000, 0xAA00
-};
-
-/*
- * ISA bus support.
- */
-static int rdp_probe __P((struct isa_device *));
-static int rdp_attach __P((struct isa_device *));
-
-/*
- * Required entry points.
- */
-static void rdp_init(void *);
-static int rdp_ioctl(struct ifnet *, IOCTL_CMD_T, caddr_t);
-static void rdp_start(struct ifnet *);
-static void rdp_reset(struct ifnet *);
-static void rdp_watchdog(struct ifnet *);
-static void rdpintr(int);
-
-/*
- * REDP private functions.
- */
-
-static void rdp_stop(struct rdp_softc *);
-static void rdp_rint(struct rdp_softc *);
-static void rdp_get_packet(struct rdp_softc *, unsigned);
-static u_short rdp_write_mbufs(struct rdp_softc *, struct mbuf *);
-static int rdp_gethwaddr_93c46(struct rdp_softc *, u_char *);
-static void rdp_gethwaddr_74s288(struct rdp_softc *, u_char *);
-static void rdp_93c46_cmd(struct rdp_softc *, u_short, unsigned);
-static u_short rdp_93c46_read(struct rdp_softc *);
-
-struct isa_driver rdpdriver = {
- rdp_probe,
- rdp_attach,
- "rdp",
- 1 /* we wanna get a chance before lptN */
-};
-
-/*
- * REDP-specific functions.
- *
- * They are inlined, thus go first in this file. Together with gcc's
- * usual optimization, these functions probably come close to the
- * packet driver's hand-optimized code. ;-)
- *
- * Comments are partially obtained from the packet driver as well.
- * Some of the function names contain register names which don't make
- * much sense for us, but i've kept them for easier reference in
- * comparision to the packet driver.
- *
- * Some of the functions are currently not used by the driver; it's
- * not quite clear whether we ever need them at all. They are
- * supposedly even slower than what is currently implemented as `slow'
- * mode. Right now, `fast' (default) mode is what the packet driver
- * calls mode 0, slow mode is mode 3 (writing through lpt_control,
- * reading twice).
- *
- * We should autoprobe the modi, as opposed to making them dependent
- * on a kernel configuration flag.
- */
-
-/*
- * read a nibble from rreg; end-of-data cmd is not issued;
- * used for general register read.
- *
- * Unlike the packet driver's version, i'm shifting the result
- * by 3 here (as opposed to within the caller's code) for clarity.
- * -- Joerg
- */
-static __inline u_char
-RdNib(struct rdp_softc *sc, u_char rreg)
-{
-
- outb(sc->baseaddr + lpt_data, EOC + rreg);
- outb(sc->baseaddr + lpt_data, RdAddr + rreg); /* write addr */
- (void)inb(sc->baseaddr + lpt_status);
- return (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
-}
-
-#if 0
-/*
- * read a byte from MAR register through lpt_data; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 4 + 5
- */
-static __inline u_char
-RdByte(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-
-/*
- * read a byte from MAR register through lpt_data; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 6 + 7
- */
-static __inline u_char
-RdByte1(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */
- (void)inb(sc->baseaddr + lpt_status);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib);
- (void)inb(sc->baseaddr + lpt_status);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-#endif
-
-
-/*
- * read a byte from MAR register through lpt_control; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 0 + 1
- */
-static __inline u_char
-RdByteA1(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-
-/*
- * read a byte from MAR register through lpt_control; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 2 + 3
- */
-static __inline u_char
-RdByteA2(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- (void)inb(sc->baseaddr + lpt_status);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead);
- (void)inb(sc->baseaddr + lpt_status);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-/*
- * End-of-read cmd
- */
-static __inline void
-RdEnd(struct rdp_softc *sc, u_char rreg)
-{
-
- outb(sc->baseaddr + lpt_data, EOC + rreg);
-}
-
-/*
- * Write a nibble to a register; end-of-write is issued.
- * Used for general register write.
- */
-static __inline void
-WrNib(struct rdp_softc *sc, u_char wreg, u_char wdata)
-{
-
- /* prepare and write address */
- outb(sc->baseaddr + lpt_data, EOC + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- /* prepare and write data */
- outb(sc->baseaddr + lpt_data, WrAddr + wdata);
- outb(sc->baseaddr + lpt_data, wdata);
- outb(sc->baseaddr + lpt_data, wdata);
- /* end-of-write */
- outb(sc->baseaddr + lpt_data, EOC + wdata);
-}
-
-/*
- * Write a byte to a register; end-of-write is issued.
- * Used for general register write.
- */
-static __inline void
-WrByte(struct rdp_softc *sc, u_char wreg, u_char wdata)
-{
-
- /* prepare and write address */
- outb(sc->baseaddr + lpt_data, EOC + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- /* prepare and write low nibble */
- outb(sc->baseaddr + lpt_data, WrAddr + (wdata & 0x0F));
- outb(sc->baseaddr + lpt_data, (wdata & 0x0F));
- outb(sc->baseaddr + lpt_data, (wdata & 0x0F));
- /* prepare and write high nibble */
- wdata >>= 4;
- outb(sc->baseaddr + lpt_data, wdata);
- outb(sc->baseaddr + lpt_data, wdata + HNib);
- outb(sc->baseaddr + lpt_data, wdata + HNib);
- /* end-of-write */
- outb(sc->baseaddr + lpt_data, EOC + wdata + HNib);
-}
-
-/*
- * Write the byte to DRAM via lpt_data;
- * used for remote DMA write in mode 0 / 2 / 4
- */
-static __inline void
-WrByteALToDRAM(struct rdp_softc *sc, u_char val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_data, MkHi(val));
-}
-
-/*
- * Write the byte to DRAM via lpt_control;
- * used for remote DMA write in mode 1 / 3 / 5
- */
-static __inline void
-WrByteALToDRAMA(struct rdp_softc *sc, u_char val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- outb(sc->baseaddr + lpt_data, val >> 4);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
-}
-
-#if 0 /* they could be used for the RAM test */
-/*
- * Write the u_short to DRAM via lpt_data;
- * used for remote DMA write in mode 0 / 2 / 4
- */
-static __inline void
-WrWordbxToDRAM(struct rdp_softc *sc, u_short val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val + HNib);
-}
-
-
-/*
- * Write the u_short to DRAM via lpt_control;
- * used for remote DMA write in mode 1 / 3 / 5
- */
-static __inline void
-WrWordbxToDRAMA(struct rdp_softc *sc, u_short val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
-}
-#endif
-
-
-/*
- * Determine if the device is present
- *
- * on entry:
- * a pointer to an isa_device struct
- * on exit:
- * 0 if device not found
- * or # of i/o addresses used (if found)
- */
-static int
-rdp_probe(struct isa_device *isa_dev)
-{
- int unit = isa_dev->id_unit;
- struct rdp_softc *sc = &rdp_softc[unit];
- u_char b1, b2;
- intrmask_t irqmap[3];
- u_char sval[3];
-
- if (unit < 0 || unit >= NRDP)
- return 0;
-
- sc->baseaddr = isa_dev->id_iobase;
- if (isa_dev->id_flags & 1)
- sc->eeprom = EEPROM_74S288;
- /* else defaults to 93C46 */
- if (isa_dev->id_flags & 2)
- sc->slow = 1;
-
- /* let R/WB = A/DB = CSB = high to be ready for next r/w cycle */
- outb(sc->baseaddr + lpt_data, 0xFF);
- /* DIR = 0 for write mode, IRQEN=0, SLCT=INIT=AUTOFEED=STB=high */
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- /* software reset */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST));
- DELAY(2000);
- /* is EPLC alive? */
- b1 = RdNib(sc, CMR1);
- RdEnd(sc, CMR1);
- b2 = RdNib(sc, CMR2) & 0x0f;
- b2 |= RdNib(sc, CMR2 + HNib) << 4;
- RdEnd(sc, CMR2 + HNib);
- /*
- * After the reset, we expect CMR1 & 7 to be 1 (rx buffer empty),
- * and CMR2 & 0xf7 to be 0x20 (receive mode set to physical and
- * broadcasts).
- */
- if (bootverbose)
- printf("rdp%d: CMR1 = %#x, CMR2 = %#x\n", unit, b1, b2);
-
- if ((b1 & (CMR1_BUFE | CMR1_IRQ | CMR1_TRA)) != CMR1_BUFE
- || (b2 & ~CMR2_IRQINV) != CMR2_AM_PB)
- return 0;
-
- /*
- * We have found something that could be a RTL 80[01]2, now
- * see whether we can generate an interrupt.
- */
- disable_intr();
-
- /*
- * Test whether our configured IRQ is working.
- *
- * Set to no acception mode + IRQout, then enable RxE + TxE,
- * then cause RBER (by advancing the read pointer although
- * the read buffer is empty) to generate an interrupt.
- */
- WrByte(sc, CMR2, CMR2_IRQOUT);
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE));
- WrNib(sc, CMR1, CMR1_RDPAC);
- DELAY(1000);
-
- irqmap[0] = isa_irq_pending();
- sval[0] = inb(sc->baseaddr + lpt_status);
-
- /* allow IRQs to pass the parallel interface */
- outb(sc->baseaddr + lpt_control, Ctrl_IRQEN + Ctrl_SelData);
- DELAY(1000);
- /* generate interrupt */
- WrNib(sc, IMR + HNib, MkHi(ISR_RBER));
- DELAY(1000);
-
- irqmap[1] = isa_irq_pending();
- sval[1] = inb(sc->baseaddr + lpt_status);
-
- /* de-assert and disable IRQ */
- WrNib(sc, IMR + HNib, MkHi(0));
- (void)inb(sc->baseaddr + lpt_status); /* might be necessary to
- clear IRQ */
- DELAY(1000);
- irqmap[2] = isa_irq_pending();
- sval[2] = inb(sc->baseaddr + lpt_status);
-
- WrNib(sc, CMR1 + HNib, MkHi(0));
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR2, CMR2_IRQINV);
-
- enable_intr();
-
- if (bootverbose)
- printf("rdp%d: irq maps / lpt status "
- "%#x/%#x - %#x/%#x - %#x/%#x (id_irq %#x)\n",
- unit, irqmap[0], sval[0], irqmap[1], sval[1],
- irqmap[2], sval[2], isa_dev->id_irq);
-
- if ((irqmap[1] & isa_dev->id_irq) == 0) {
- printf("rdp%d: configured IRQ (%d) cannot be asserted "
- "by device",
- unit, ffs(isa_dev->id_irq) - 1);
- if (irqmap[1])
- printf(" (probable IRQ: %d)", ffs(irqmap[1]) - 1);
- printf("\n");
- return 0;
- }
-
- /*
- * XXX should do RAMtest here
- */
-
- switch (sc->eeprom) {
- case EEPROM_93C46:
- if (rdp_gethwaddr_93c46(sc, sc->arpcom.ac_enaddr) == 0) {
- printf("rdp%d: failed to find a valid hardware "
- "address in EEPROM\n",
- unit);
- return 0;
- }
- break;
-
- case EEPROM_74S288:
- rdp_gethwaddr_74s288(sc, sc->arpcom.ac_enaddr);
- break;
- }
-
- return lpt_control + 1;
-}
-
-/*
- * Install interface into kernel networking data structures
- */
-static int
-rdp_attach(struct isa_device *isa_dev)
-{
- int unit = isa_dev->id_unit;
- struct rdp_softc *sc = &rdp_softc[unit];
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- isa_dev->id_ointr = rdpintr;
-
- /*
- * Reset interface
- */
- rdp_stop(sc);
-
- if (!ifp->if_name) {
- /*
- * Initialize ifnet structure
- */
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "rdp";
- ifp->if_output = ether_output;
- ifp->if_start = rdp_start;
- ifp->if_ioctl = rdp_ioctl;
- ifp->if_watchdog = rdp_watchdog;
- ifp->if_init = rdp_init;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
-
- /*
- * Attach the interface
- */
- if_attach(ifp);
- ether_ifattach(ifp);
- }
-
- /*
- * Print additional info when attached
- */
- printf("%s%d: RealTek RTL%s pocket ethernet, EEPROM %s, %s mode\n",
- ifp->if_name, ifp->if_unit,
- "8002", /* hook for 8012 */
- sc->eeprom == EEPROM_93C46? "93C46": "74S288",
- sc->slow? "slow": "fast");
- printf("%s%d: address %6D\n", ifp->if_name, ifp->if_unit,
- sc->arpcom.ac_enaddr, ":");
-
- /*
- * If BPF is in the kernel, call the attach for it
- */
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- return 1;
-}
-
-/*
- * Reset interface.
- */
-static void
-rdp_reset(struct ifnet *ifp)
-{
- struct rdp_softc *sc = ifp->if_softc;
- int s;
-
- s = splimp();
-
- /*
- * Stop interface and re-initialize.
- */
- rdp_stop(sc);
- rdp_init(sc);
-
- (void) splx(s);
-}
-
-/*
- * Take interface offline.
- */
-static void
-rdp_stop(struct rdp_softc *sc)
-{
-
- sc->txbusy = sc->txbusy = 0;
-
- /* disable printer interface interrupts */
- sc->irqenbit = 0;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- outb(sc->baseaddr + lpt_data, 0xff);
-
- /* reset the RTL 8002 */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST));
- DELAY(100);
-}
-
-/*
- * Device timeout/watchdog routine. Entered if the device neglects to
- * generate an interrupt after a transmit has been started on it.
- */
-static void
-rdp_watchdog(struct ifnet *ifp)
-{
-
- log(LOG_ERR, "rdp%d: device timeout\n", ifp->if_unit);
- ifp->if_oerrors++;
-
- rdp_reset(ifp);
-}
-
-/*
- * Initialize device.
- */
-static void
-rdp_init(void *xsc)
-{
- struct rdp_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int i, s;
- u_char reg;
-
- /* address not known */
- if (TAILQ_EMPTY(&ifp->if_addrhead))
- return;
-
- s = splimp();
-
- ifp->if_timer = 0;
-
- /* program ethernet ID into the chip */
- for (i = 0, reg = IDR0; i < 6; i++, reg++)
- WrByte(sc, reg, sc->arpcom.ac_enaddr[i]);
-
- /* set accept mode */
- WrNib(sc, CMR2 + HNib,
- MkHi((ifp->if_flags & IFF_PROMISC)? CMR2_AM_ALL: CMR2_AM_PB));
-
- /* enable tx and rx */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE));
-
- /* allow interrupts to happen */
- WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV);
- WrNib(sc, IMR, ISR_TOK | ISR_TER | ISR_ROK | ISR_RER);
- WrNib(sc, IMR + HNib, MkHi(ISR_RBER));
-
- /* allow IRQs to pass the parallel interface */
- sc->irqenbit = Ctrl_IRQEN;
- outb(sc->baseaddr + lpt_control, sc->irqenbit + Ctrl_SelData);
-
- /* clear all flags */
- sc->txbusy = sc->txbuffered = 0;
-
- /*
- * Set 'running' flag, and clear output active flag.
- */
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /*
- * ...and attempt to start output
- */
- rdp_start(ifp);
-
- (void) splx(s);
-}
-
-/*
- * Start output on interface.
- * We make two assumptions here:
- * 1) that the current priority is set to splimp _before_ this code
- * is called *and* is returned to the appropriate priority after
- * return
- * 2) that the IFF_OACTIVE flag is checked before this code is called
- * (i.e. that the output part of the interface is idle)
- */
-static void
-rdp_start(struct ifnet *ifp)
-{
- struct rdp_softc *sc = ifp->if_softc;
- struct mbuf *m;
- int len;
-
-outloop:
-
- /*
- * See if there is room to put another packet in the buffer.
- */
- if (sc->txbuffered) {
- /*
- * No room. Indicate this to the outside world and exit.
- */
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
- IF_DEQUEUE(&ifp->if_snd, m);
- if (m == 0) {
- /*
- * We are using the !OACTIVE flag to indicate to the outside
- * world that we can accept an additional packet rather than
- * that the transmitter is _actually_ active. Indeed, the
- * transmitter may be active, but if we haven't filled all the
- * buffers with data then we still want to accept more.
- */
- ifp->if_flags &= ~IFF_OACTIVE;
- return;
- }
-
- /*
- * Copy the mbuf chain into the transmit buffer
- */
-
- len = rdp_write_mbufs(sc, m);
- if (len == 0)
- goto outloop;
-
- /* ensure minimal valid ethernet length */
- len = max(len, (ETHER_MIN_LEN-ETHER_CRC_LEN));
-
- /*
- * Actually start the transceiver. Set a timeout in case the
- * Tx interrupt never arrives.
- */
- if (!sc->txbusy) {
- WrNib(sc, TBCR1, len >> 8);
- WrByte(sc, TBCR0, len & 0xff);
- WrNib(sc, CMR1, CMR1_TRA);
- sc->txbusy = 1;
- ifp->if_timer = 2;
- } else {
- sc->txbuffered = 1;
- sc->txsize = len;
- }
-
- /*
- * Tap off here if there is a bpf listener.
- */
-#if NBPFILTER > 0
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- }
-#endif
-
- m_freem(m);
-
- /*
- * Loop back to the top to possibly buffer more packets
- */
- goto outloop;
-}
-
-/*
- * Process an ioctl request.
- */
-static int
-rdp_ioctl(struct ifnet *ifp, IOCTL_CMD_T command, caddr_t data)
-{
- struct rdp_softc *sc = ifp->if_softc;
- int s, error = 0;
-
- s = splimp();
-
- switch (command) {
-
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- /*
- * If the interface is marked up and stopped, then start it.
- * If it is marked down and running, then stop it.
- */
- if (ifp->if_flags & IFF_UP) {
- if ((ifp->if_flags & IFF_RUNNING) == 0)
- rdp_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING) {
- rdp_stop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
- }
- }
-
-#if NBPFILTER > 0
- /*
- * Promiscuous flag may have changed, propagage this
- * to the NIC.
- */
- if (ifp->if_flags & IFF_UP)
- WrNib(sc, CMR2 + HNib,
- MkHi((ifp->if_flags & IFF_PROMISC)?
- CMR2_AM_ALL: CMR2_AM_PB));
-
-#endif
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- /*
- * Multicast list has changed; we don't support it.
- */
- error = ENOTTY;
- break;
-
- default:
- error = EINVAL;
- }
- (void) splx(s);
- return (error);
-}
-
-/*
- * External interrupt service routine.
- */
-void
-rdpintr(int unit)
-{
- struct rdp_softc *sc = rdp_softc + unit;
- struct ifnet *ifp = (struct ifnet *)sc;
- u_char isr, tsr, rsr, colls;
-
- /* disable interrupts, so SD3 can be routed to the pin */
- sc->irqenbit = 0;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR2, CMR2_IRQINV);
- /*
- * loop until there are no more new interrupts
- */
- for (;;) {
- isr = RdNib(sc, ISR);
- isr |= RdNib(sc, ISR + HNib) << 4;
- RdEnd(sc, ISR + HNib);
-
- if (isr == 0)
- break;
-#if DEBUG & 4
- printf("rdp%d: ISR = %#x\n", unit, isr);
-#endif
-
- /*
- * Clear the pending interrupt bits.
- */
- WrNib(sc, ISR, isr & 0x0f);
- if (isr & 0xf0)
- WrNib(sc, ISR + HNib, MkHi(isr));
-
- /*
- * Handle transmitter interrupts.
- */
- if (isr & (ISR_TOK | ISR_TER)) {
- tsr = RdNib(sc, TSR);
- RdEnd(sc, TSR);
-#if DEBUG & 4
- if (isr & ISR_TER)
- printf("rdp%d: tsr %#x\n", unit, tsr);
-#endif
- if (tsr & TSR_TABT)
- ifp->if_oerrors++;
- else
- /*
- * Update total number of successfully
- * transmitted packets.
- */
- ifp->if_opackets++;
-
- if (tsr & TSR_COL) {
- colls = RdNib(sc, COLR);
- RdEnd(sc, COLR);
- ifp->if_collisions += colls;
- }
-
- /*
- * reset tx busy and output active flags
- */
- sc->txbusy = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /*
- * If we had already queued up another packet,
- * start sending it now.
- */
- if (sc->txbuffered) {
- WrNib(sc, TBCR1, sc->txsize >> 8);
- WrByte(sc, TBCR0, sc->txsize & 0xff);
- WrNib(sc, CMR1, CMR1_TRA);
- sc->txbusy = 1;
- sc->txbuffered = 0;
- ifp->if_timer = 2;
- } else {
- /*
- * clear watchdog timer
- */
- ifp->if_timer = 0;
- }
-
- }
-
- /*
- * Handle receiver interrupts
- */
- if (isr & (ISR_ROK | ISR_RER | ISR_RBER)) {
- rsr = RdNib(sc, RSR);
- rsr |= RdNib(sc, RSR + HNib) << 4;
- RdEnd(sc, RSR + HNib);
-#if DEBUG & 4
- if (isr & (ISR_RER | ISR_RBER))
- printf("rdp%d: rsr %#x\n", unit, rsr);
-#endif
-
- if (rsr & (RSR_PUN | RSR_POV)) {
- printf("rdp%d: rsr %#x, resetting\n",
- unit, rsr);
- rdp_reset(ifp);
- break;
- }
-
- if (rsr & RSR_BUFO)
- /*
- * CRC and FA errors are recorded in
- * rdp_rint() on a per-packet basis
- */
- ifp->if_ierrors++;
- if (isr & (ISR_ROK | ISR_RER))
- rdp_rint(sc);
- }
-
- /*
- * If it looks like the transmitter can take more data,
- * attempt to start output on the interface. This is done
- * after handling the receiver to give the receiver priority.
- */
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- rdp_start(ifp);
-
- }
- /* re-enable interrupts */
- WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV);
- sc->irqenbit = Ctrl_IRQEN;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData + sc->irqenbit);
-}
-
-/*
- * Ethernet interface receiver interrupt.
- */
-static void
-rdp_rint(struct rdp_softc *sc)
-{
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct rdphdr rh;
- u_short len;
- size_t i;
- u_char *packet_ptr, b, status;
- int excessive_bad_pkts = 0;
-
- /*
- * Fetch the packets from the NIC's buffer.
- */
- for (;;) {
- b = RdNib(sc, CMR1);
- RdEnd(sc, CMR1);
-
- if (b & CMR1_BUFE)
- /* no more packets */
- break;
-
- /* first, obtain the buffer header */
-
- outb(sc->baseaddr + lpt_data, MAR + EOC); /* prepare addr */
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- outb(sc->baseaddr + lpt_data, MAR + RdAddr + HNib);
-
- packet_ptr = (u_char *)&rh;
- if (sc->slow)
- for (i = 0; i < sizeof rh; i++, packet_ptr++)
- *packet_ptr = RdByteA2(sc);
- else
- for (i = 0; i < sizeof rh; i++, packet_ptr++)
- *packet_ptr = RdByteA1(sc);
-
- RdEnd(sc, MAR + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
-
- len = rh.pktlen - ETHER_CRC_LEN;
- status = rh.status;
-
- if ((status & (RSR_ROK | RSR_CRC | RSR_FA)) != RSR_ROK ||
- len > (ETHER_MAX_LEN - ETHER_CRC_LEN) ||
- len < (ETHER_MIN_LEN - ETHER_CRC_LEN) ||
- len > MCLBYTES) {
-#if DEBUG
- printf("rdp%d: bad packet in buffer, "
- "len %d, status %#x\n",
- ifp->if_unit, (int)len, (int)status);
-#endif
- ifp->if_ierrors++;
- /* rx jump packet */
- WrNib(sc, CMR1, CMR1_RDPAC);
- if (++excessive_bad_pkts > 5) {
- /*
- * the chip seems to be stuck, we are
- * probably seeing the same bad packet
- * over and over again
- */
-#if DEBUG
- printf("rdp%d: resetting due to an "
- "excessive number of bad packets\n",
- ifp->if_unit);
-#endif
- rdp_reset(ifp);
- return;
- }
- continue;
- }
-
- /*
- * Go get packet.
- */
- excessive_bad_pkts = 0;
- rdp_get_packet(sc, len);
- ifp->if_ipackets++;
- }
-}
-
-/*
- * Retreive packet from NIC memory and send to the next level up via
- * ether_input(). If there is a BPF listener, give a copy to BPF,
- * too.
- */
-static void
-rdp_get_packet(struct rdp_softc *sc, unsigned len)
-{
- struct ether_header *eh;
- struct mbuf *m;
- u_char *packet_ptr;
- size_t s;
-
- /* Allocate a header mbuf */
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
- return;
- m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
- m->m_pkthdr.len = m->m_len = len;
-
- /*
- * We always put the received packet in a single buffer -
- * either with just an mbuf header or in a cluster attached
- * to the header. The +2 is to compensate for the alignment
- * fixup below.
- */
- if ((len + 2) > MHLEN) {
- /* Attach an mbuf cluster */
- MCLGET(m, M_DONTWAIT);
-
- /* Insist on getting a cluster */
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return;
- }
- }
-
- /*
- * The +2 is to longword align the start of the real packet.
- * This is important for NFS.
- */
- m->m_data += 2;
- eh = mtod(m, struct ether_header *);
-
- /*
- * Get packet, including link layer address, from interface.
- */
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- outb(sc->baseaddr + lpt_data, RdAddr + MAR);
-
- packet_ptr = (u_char *)eh;
- if (sc->slow)
- for (s = 0; s < len; s++, packet_ptr++)
- *packet_ptr = RdByteA2(sc);
- else
- for (s = 0; s < len; s++, packet_ptr++)
- *packet_ptr = RdByteA1(sc);
-
- RdEnd(sc, MAR + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR1, CMR1_RDPAC);
-
-#if NBPFILTER > 0
-
- /*
- * Check if there's a BPF listener on this interface. If so, hand off
- * the raw packet to bpf.
- */
- if (sc->arpcom.ac_if.if_bpf) {
- bpf_mtap(&sc->arpcom.ac_if, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((sc->arpcom.ac_if.if_flags & IFF_PROMISC) &&
- bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
-#endif
-
- /*
- * Remove link layer address.
- */
- m->m_pkthdr.len = m->m_len = len - sizeof(struct ether_header);
- m->m_data += sizeof(struct ether_header);
-
- ether_input(&sc->arpcom.ac_if, eh, m);
- return;
-}
-
-/*
- * Write an mbuf chain to the NIC's tx buffer.
- */
-static u_short
-rdp_write_mbufs(struct rdp_softc *sc, struct mbuf *m)
-{
- u_short total_len;
- struct mbuf *mp;
- u_char *dp, b;
- int i;
-
- /* First, count up the total number of bytes to copy */
- for (total_len = 0, mp = m; mp; mp = mp->m_next)
- total_len += mp->m_len;
-
- if (total_len == 0)
- return 0;
-
- outb(sc->baseaddr + lpt_data, MAR | EOC);
-
- /*
- * Transfer the mbuf chain to the NIC memory.
- */
- if (sc->slow) {
- /* writing the first byte is complicated */
- outb(sc->baseaddr + lpt_control,
- Ctrl_LNibRead | sc->irqenbit);
- outb(sc->baseaddr + lpt_data, MAR | WrAddr);
- b = *(u_char *)m->m_data;
- outb(sc->baseaddr + lpt_data, (b & 0x0f) | 0x40);
- outb(sc->baseaddr + lpt_data, b & 0x0f);
- outb(sc->baseaddr + lpt_data, b >> 4);
- outb(sc->baseaddr + lpt_control,
- Ctrl_HNibRead | sc->irqenbit);
- /* advance the mbuf pointer */
- mp = m;
- m->m_len--;
- m->m_data++;
- /* write the remaining bytes */
- while (m) {
- for (i = 0, dp = (u_char *)m->m_data;
- i < m->m_len;
- i++, dp++)
- WrByteALToDRAMA(sc, *dp);
- m = m->m_next;
- }
- /*
- * restore old mbuf in case we have to hand it off to
- * BPF again
- */
- m = mp;
- m->m_len++;
- m->m_data--;
-
- /* the RTL 8002 requires an even byte-count remote DMA */
- if (total_len & 1)
- WrByteALToDRAMA(sc, 0);
- } else {
- outb(sc->baseaddr + lpt_data, MAR | WrAddr);
- while (m) {
- for (i = 0, dp = (u_char *)m->m_data;
- i < m->m_len;
- i++, dp++)
- WrByteALToDRAM(sc, *dp);
- m = m->m_next;
- }
-
- /* the RTL 8002 requires an even byte-count remote DMA */
- if (total_len & 1)
- WrByteALToDRAM(sc, 0);
- }
-
- outb(sc->baseaddr + lpt_data, 0xff);
- outb(sc->baseaddr + lpt_control,
- Ctrl_HNibRead | Ctrl_SelData | sc->irqenbit);
-
- return total_len;
-}
-
-/*
- * Read the designated ethernet hardware address out of a 93C46
- * (serial) EEPROM.
- * Note that the 93C46 uses 16-bit words in big-endian notation.
- */
-static int
-rdp_gethwaddr_93c46(struct rdp_softc *sc, u_char *etheraddr)
-{
- int i, magic;
- size_t j = 0;
- u_short w;
-
- WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */
-
- /*
- * The original RealTek packet driver had the ethernet address
- * starting at EEPROM address 0. Other vendors seem to have
- * gone `creative' here -- while they didn't do anything else
- * than changing a few strings in the entire driver, compared
- * to the RealTek version, they also moved out the ethernet
- * address to a different location in the EEPROM, so the
- * original RealTek driver won't work correctly with them, and
- * vice versa. Sounds pretty cool, eh? $@%&!
- *
- * Anyway, we walk through the EEPROM, until we find some
- * allowable value based upon our table of IEEE OUI assignments.
- */
- for (i = magic = 0; magic < 3 && i < 32; i++) {
- /* read cmd (+ 6 bit address) */
- rdp_93c46_cmd(sc, 0x180 + i, 10);
- w = rdp_93c46_read(sc);
- switch (magic) {
- case 0:
- for (j = 0;
- j < sizeof allowed_ouis / sizeof(u_short);
- j++)
- if (w == allowed_ouis[j]) {
- etheraddr[0] = (w >> 8) & 0xff;
- etheraddr[1] = w & 0xff;
- magic++;
- break;
- }
- break;
-
- case 1:
- /*
- * If the first two bytes have been 00:00, we
- * discard the match iff the next two bytes
- * are also 00:00, so we won't get fooled by
- * an EEPROM that has been filled with zeros.
- * This in theory would disallow 64 K of legal
- * addresses assigned to Xerox, but it's
- * almost certain that those addresses haven't
- * been used for RTL80[01]2 chips anyway.
- */
- if ((etheraddr[0] | etheraddr[1]) == 0 && w == 0) {
- magic--;
- break;
- }
-
- etheraddr[2] = (w >> 8) & 0xff;
- etheraddr[3] = w & 0xff;
- magic++;
- break;
-
- case 2:
- etheraddr[4] = (w >> 8) & 0xff;
- etheraddr[5] = w & 0xff;
- magic++;
- break;
- }
- }
-
- WrNib(sc, CMR2, CMR2_IRQINV); /* back to page 0 */
-
- return magic == 3;
-}
-
-/*
- * Read the designated ethernet hardware address out of a 74S288
- * EEPROM.
- *
- * This is untested, since i haven't seen any adapter actually using
- * a 74S288. In the RTL 8012, only the serial EEPROM (94C46) is
- * supported anymore.
- */
-static void
-rdp_gethwaddr_74s288(struct rdp_softc *sc, u_char *etheraddr)
-{
- int i;
- u_char b;
-
- WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */
-
- for (i = 0; i < 6; i++) {
- WrNib(sc, PCMR, i & 0x0f); /* lower 4 bit of addr */
- WrNib(sc, PCMR + HNib, HNib + 4); /* upper 2 bit addr + /CS */
- WrNib(sc, PCMR + HNib, HNib); /* latch data now */
- b = RdNib(sc, PDR) & 0x0f;
- b |= (RdNib(sc, PDR + HNib) & 0x0f) << 4;
- etheraddr[i] = b;
- }
-
- RdEnd(sc, PDR + HNib);
- WrNib(sc, CMR2, CMR2_IRQINV); /* reselect page 0 */
-}
-
-/*
- * Send nbits of data (starting with MSB) out to the 93c46 as a
- * command. Assumes register page 1 has already been selected.
- */
-static void
-rdp_93c46_cmd(struct rdp_softc *sc, u_short data, unsigned nbits)
-{
- u_short mask = 1 << (nbits - 1);
- unsigned i;
- u_char b;
-
-#if DEBUG & 2
- printf("rdp_93c46_cmd(): ");
-#endif
- for (i = 0; i < nbits; i++, mask >>= 1) {
- b = HNib + PCMR_SK + PCMR_CS;
- if (data & mask)
- b += PCMR_DO;
-#if DEBUG & 2
- printf("%d", b & 1);
-#endif
- WrNib(sc, PCMR + HNib, b);
- DELAY(1);
- WrNib(sc, PCMR + HNib, b & ~PCMR_SK);
- DELAY(1);
- }
-#if DEBUG & 2
- printf("\n");
-#endif
-}
-
-/*
- * Read one word of data from the 93c46. Actually, we have to read
- * 17 bits, and discard the very first bit. Assumes register page 1
- * to be selected as well.
- */
-static u_short
-rdp_93c46_read(struct rdp_softc *sc)
-{
- u_short data = 0;
- u_char b;
- int i;
-
-#if DEBUG & 2
- printf("rdp_93c46_read(): ");
-#endif
- for (i = 0; i < 17; i++) {
- WrNib(sc, PCMR + HNib, PCMR_SK + PCMR_CS + HNib);
- DELAY(1);
- WrNib(sc, PCMR + HNib, PCMR_CS + HNib);
- DELAY(1);
- b = RdNib(sc, PDR);
- data <<= 1;
- if (b & 1)
- data |= 1;
-#if DEBUG & 2
- printf("%d", b & 1);
-#endif
- RdEnd(sc, PDR);
- DELAY(1);
- }
-
-#if DEBUG & 2
- printf("\n");
-#endif
- /* end of cycle */
- WrNib(sc, PCMR + HNib, PCMR_SK + HNib);
- DELAY(1);
-
- return data;
-}
diff --git a/sys/i386/isa/if_rdpreg.h b/sys/i386/isa/if_rdpreg.h
deleted file mode 100644
index cab679a4bd3e..000000000000
--- a/sys/i386/isa/if_rdpreg.h
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef IF_RDPREG_H
-#define IF_RDPREG_H 1
-/*
- * Copyright (c) 1998 Joerg Wunsch
- *
- * 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 DEVELOPERS ``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 DEVELOPERS 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.
- *
- * $Id: if_rdpreg.h,v 1.1.1.1 1998/12/21 12:43:35 j Exp $
- */
-
-/*
- * Part of the definitions here has been copied over from the REDP
- * packet driver's REDPPD.INC file. This provides us with the same
- * set of acronyms as the packet driver is using.
- *
- * The packet driver had no copyright, and is believed to be in the
- * public domain. The author seems to be someone who calls himself
- * "Chiu", so that's the only acknowledgment i can give here.
- * Supposedly the author was someone from RealTek.
- */
-
-/*
- * We're hanging upon an LPT port, thus suck in the lpt defs as well.
- */
-#include <i386/isa/lptreg.h>
-
-struct rdphdr {
- /* RTL8002 header that is prepended to the actual packet */
- u_char unused2[2];
- u_short pktlen;
- u_char status; /* copy of RSR for this packet */
- u_char unused3[3];
-};
-
-/*
- *
- * 8 Data Modes are provided:
- *
- * +--------+---------------+-------------+
- * | Mode | Read | Write |
- * +--------+---------------+-------------+
- * | 0 | LptCtrl | LptData |
- * +--------+---------------+-------------+
- * | 1 | LptCtrl | LptCtrl |
- * +--------+---------------+-------------+
- * | 2 | LptCtrl*2 | LptData |
- * +--------+---------------+-------------+
- * | 3 | LptCtrl*2 | LptCtrl |
- * +--------+---------------+-------------+
- * | 4 | LptData | LptData |
- * +--------+---------------+-------------+
- * | 5 | LptData | LptCtrl |
- * +--------+---------------+-------------+
- * | 6 | LptData*2 | LptData |
- * +--------+---------------+-------------+
- * | 7 | LptData*2 | LptCtrl |
- * +--------+---------------+-------------+
- *
- * Right now, this driver only implements mode 0 (which ought to work
- * on any standard parallel interface).
- *
- */
-
-/*
- * Page 0 of EPLC registers
- */
-#define IDR0 0x00 /* Ethernet ID register (R/W) */
-#define IDR1 0x01
-#define IDR2 0x02
-#define IDR3 0x03
-#define IDR4 0x04
-#define IDR5 0x05
-#define TBCR0 0x06 /* transmit byte count (W), 11 bits valid */
-#define TBCR1 0x07
-#define TSR 0x08 /* transmit status (R), cleared upon next tx */
-# define TSR_TOK 1 /* transmit OK */
-# define TSR_TABT 2 /* transmit aborted (excessive collisions) */
-# define TSR_COL 4 /* collision detected */
-# define TSR_CDH 8 /* CD heartbeat detected */
-#define RSR 0x09 /*
- * receiver status (R), cleared upon next
- * received packet (but stored in rx buffer
- * header anyway)
- */
-# define RSR_ROK 1 /* receive OK */
-# define RSR_CRC 2 /* CRC error */
-# define RSR_FA 4 /* frame alignment error (not multiple of 8) */
-# define RSR_BUFO 0x10 /* rx buffer overflow, packet discarded */
-# define RSR_PUN 0x20 /* packet count underflow (jump command issued
- * but rx buffer was empty) */
-# define RSR_POV 0x40 /* packet count overflow (more than 254 (?)
- * packets still in buffer) */
-#define ISR 0x0A /* interrupt status register (R), writing
- * clears the written bits */
-# define ISR_TOK 1 /* transmission OK (~ TSR_TOK) */
-# define ISR_TER 2 /* transmitter error (~ TSR_TABT) */
-# define ISR_ROK 4 /* receive OK (~ RSR_ROK) */
-# define ISR_RER 8 /* receiver error (~ RSR_CRC|RSR_FA) */
-# define ISR_RBER 0x10 /* rx buffer overflow (POV|PUN|BUFO) */
-#define IMR 0x0B /* interrupt mask register (R/W), bit as ISR */
-#define CMR1 0x0C /* command register 1 (R/W) */
-# define CMR1_BUFE 1 /* (R) rx buffer empty */
-# define CMR1_IRQ 2 /* (R) interrupt request */
-# define CMR1_TRA 4 /* (R) transmission in progress */
- /* (W) transmit start */
-# define CMR1_TE 0x10 /* (R/W) transmitter enable */
-# define CMR1_RE 0x20 /* (R/W) receiver enable */
-# define CMR1_RST 0x40 /* (R/W) reset; sticks until reset completed */
-# define CMR1_RDPAC 1 /* (W) `rx jump packet', prepare for reading
- * next packet from ring buffer */
-# define CMR1_WRPAC 2 /* (W) `tx jump packet', packet in tx buffer
- * is complete and can be sent */
-# define CMR1_RETX 8 /* (W) retransmit (must be accomp'ed by TRA) */
-# define CMR1_MUX 0x80 /* (W) RTL8012: tell the printer MUX to
- * connect the output pins to the host */
-#define CMR2 0x0D /* command register 2 (R/W) */
-# define CMR2_IRQOUT 1 /* interrupt signal output enabled */
-# define CMR2_RAMTST 2 /* enable RAM test */
-# define CMR2_PAGE 4 /* select register page #1 */
-# define CMR2_IRQINV 8 /* make active IRQ `low' */
-# define CMR2_AMbits 0x30 /* address mode bits: */
-# define CMR2_AM_NONE 0x00 /* 0: accept nothing */
-# define CMR2_AM_PHYS 0x10 /* 1: only physical addr */
-# define CMR2_AM_PB 0x20 /* 2: phys + broadcast */
-# define CMR2_AM_ALL 0x30 /* 3: promiscuous */
-# define CMR2_LBK 0x40 /* enable loopback */
-# define CMR2_SER 0x80 /* save error packet */
-#define MAR 0x0E /* memory access register (?), used for
- * remote DMA to the 8002's buffer */
-#define PNR TBCR0 /* received packet number (R) */
-#define COLR TBCR1 /* collision count (R) (4 bit valid) */
-
-/*
- * Page 1 of EPLC registers -- EEPROM control
- */
-#define PCMR TBCR0 /* port command register */
-/* bits for 93C46 control -- add HNib */
-#define PCMR_SK 0x04 /* serial clock for EEPROM */
-#define PCMR_CS 0x02 /* chip select for EEPROM */
-#define PCMR_DO 0x01 /* DI to EEPROM */
-
-/* EEPROM data, nibbles for 74S288, bits for 93C46 */
-#define PDR TBCR1 /* DO from EEPROM, only bit 0 valid for
- * serial EEPROM */
-
-/*
- * The following definitionss define remote DMA command through LptCtrl
- */
-#define ATFD 3 /* ATFD bit in Lpt's Control register */
- /* -> ATFD bit is added for Xircom's MUX */
-#define Ctrl_LNibRead (0x08+ATFD) /* specify low nibble */
-#define Ctrl_HNibRead (0+ATFD) /* specify high nibble */
-#define Ctrl_SelData (0x04+ATFD) /* not through LptCtrl but through */
- /* LptData */
-#define Ctrl_IRQEN 0x10 /* set IRQEN of lpt control register */
-
-/* Here define constants to construct the required read/write commands */
-#define WrAddr 0x40 /* set address of EPLC write register */
-#define RdAddr 0x0C0 /* set address of EPLC read register */
-#define EOR 0x20 /* ORed to make 'end of read',set CSB=1 */
-#define EOW 0x0E0 /* end of write, R/WB=A/DB=CSB=1 */
-#define EOC 0x0E0 /* End Of r/w Command, R/WB=A/DB=CSB=1 */
-#define HNib 0x10
-
-#define MkHi(value) (((value) >> 4) | HNib)
-
-#endif /* IF_RDPREG_H */
diff --git a/sys/i386/isa/if_sr.c b/sys/i386/isa/if_sr.c
index b37e5633f387..236bb42f0d1d 100644
--- a/sys/i386/isa/if_sr.c
+++ b/sys/i386/isa/if_sr.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_sr.c,v 1.20 1999/01/18 21:23:47 julian Exp $
+ * $Id: if_sr.c,v 1.14 1998/06/17 13:54:56 bde Exp $
*/
/*
@@ -269,7 +269,6 @@ struct sr_hardc *srattach_pci(int unit, vm_offset_t plx_vaddr,
vm_offset_t sca_vaddr);
void srintr_hc(struct sr_hardc *hc);
-static ointhand2_t srintr;
static int srattach(struct sr_hardc *hc);
static void sr_xmit(struct sr_softc *sc);
static void srstart(struct ifnet *ifp);
@@ -572,8 +571,6 @@ srattach_isa(struct isa_device *id)
u_char mar;
struct sr_hardc *hc = &sr_hardc[id->id_unit];
- id->id_ointr = srintr;
-
outb(hc->iobase + SR_PCR, inb(hc->iobase + SR_PCR) | SR_PCR_SCARUN);
outb(hc->iobase + SR_PSR, inb(hc->iobase + SR_PSR) | SR_PSR_EN_SCA_DMA);
outb(hc->iobase + SR_MCR,
@@ -860,26 +857,24 @@ srattach(struct sr_hardc *hc)
}
/*
- * N2 Interrupt Service Routine.
- * Get the ISA interrupts.
- *
+ * N2 Interrupt Service Routine
+ *
* First figure out which SCA gave the interrupt.
- *
+ * Process it.
+ * See if there is other interrupts pending.
+ * Repeat until there no interrupts remain.
*/
-static void
+void
srintr(int unit)
-{
- struct sr_hardc *hc;
+{
+ struct sr_hardc *hc;
hc = &sr_hardc[unit];
srintr_hc(hc);
- return;
+ return;
}
-/*
- * PCI interrupts come straight here
- */
void
srintr_hc(struct sr_hardc *hc)
{
@@ -1315,6 +1310,13 @@ srioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
sc->ifsppp.pp_flags |= PP_KEEPALIVE;
sppp_attach(&sc->ifsppp.pp_if);
+ /*
+ * Shortcut the sppp tls/tlf actions to
+ * up/down events since our lower layer is
+ * always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
}
sc->attached = sc->protocol;
@@ -1499,6 +1501,13 @@ sr_up(struct sr_softc *sc)
sc->ifsppp.pp_flags |= PP_KEEPALIVE;
sppp_attach(&sc->ifsppp.pp_if);
+ /*
+ * Shortcut the sppp tls/tlf actions to
+ * up/down events since our lower layer is
+ * always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
}
sc->attached = sc->protocol;
diff --git a/sys/i386/isa/if_wl.c b/sys/i386/isa/if_wl.c
index 42fc0f91bf82..66dbffd40786 100644
--- a/sys/i386/isa/if_wl.c
+++ b/sys/i386/isa/if_wl.c
@@ -1,4 +1,4 @@
-/* $Id: if_wl.c,v 1.19 1998/12/09 03:30:51 eivind Exp $ */
+/* $Id: if_wl.c,v 1.14 1998/08/20 05:49:59 msmith Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -81,7 +81,7 @@
*
* sample config:
*
- * device wl0 at isa? port 0x300 net irq ?
+ * device wl0 at isa? port 0x300 net irq ? vector wlintr
*
* Ifdefs:
* 1. WLDEBUG. (off) - if turned on enables IFF_DEBUG set via ifconfig debug
@@ -302,7 +302,6 @@ static void wlstart(struct ifnet *ifp);
static void wlinit(void *xsc);
static int wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static timeout_t wlwatchdog;
-static ointhand2_t wlintr;
static void wlxmt(int unt, struct mbuf *m);
static int wldiag(int unt);
static int wlconfig(int unit);
@@ -311,6 +310,7 @@ static void wlmmcstat(int unit);
static u_short wlbldru(int unit);
static u_short wlmmcread(u_int base, u_short reg);
static void wlinitmmc(int unit);
+static void wlsetirq(int base, int irq);
static int wlhwrst(int unit);
static void wlrustrt(int unit);
static void wlbldcu(int unit);
@@ -331,7 +331,7 @@ static void wl_cache_store(int, int, struct ether_header *, struct mbuf *);
static void wl_cache_zero(int unit);
#endif
#ifdef MULTICAST
-# if defined(__FreeBSD__) && __FreeBSD_version < 300000
+# if __FreeBSD < 3
static int check_allmulti(int unit);
# endif
#endif
@@ -364,6 +364,7 @@ wlprobe(struct isa_device *id)
{
struct wl_softc *sc = &wl_softc[id->id_unit];
register short base = id->id_iobase;
+ int unit = id->id_unit;
char *str = "wl%d: board out of range [0..%d]\n";
u_char inbuf[100];
unsigned long oldpri;
@@ -442,7 +443,6 @@ wlattach(struct isa_device *id)
#ifdef WLDEBUG
printf("wlattach: base %x, unit %d\n", base, unit);
#endif
- id->id_ointr = wlintr;
sc->base = base;
sc->unit = unit;
sc->flags = 0;
@@ -494,7 +494,7 @@ wlattach(struct isa_device *id)
#endif
#if MULTICAST
ifp->if_flags |= IFF_MULTICAST;
-#endif /* MULTICAST */
+#endif MULTICAST
ifp->if_name = "wl";
ifp->if_unit = unit;
ifp->if_init = wlinit;
@@ -680,7 +680,7 @@ wlinit(void *xsc)
if (sc->wl_if.if_flags & IFF_DEBUG)
printf("wl%d: entered wlinit()\n",sc->unit);
#endif
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
if (ifp->if_addrhead.tqh_first == (struct ifaddr *)0) {
#else
if (ifp->if_addrlist == (struct ifaddr *)0) {
@@ -721,6 +721,8 @@ static int
wlhwrst(int unit)
{
register struct wl_softc *sc = WLSOFTC(unit);
+ int i;
+ short base = sc->base;
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
@@ -736,7 +738,7 @@ wlhwrst(int unit)
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
wlmmcstat(unit); /* Display MMC registers */
-#endif /* WLDEBUG */
+#endif WLDEBUG
wlbldcu(unit); /* set up command unit structures */
if (wldiag(unit) == 0)
@@ -1167,6 +1169,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
short base = sc->base;
short mode = 0;
int opri, error = 0;
+ u_short tmp;
struct proc *p = curproc; /* XXX */
int irq, irqval, i, isroot, size;
caddr_t up;
@@ -1254,7 +1257,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCADDMULTI:
case SIOCDELMULTI:
-#if defined(__FreeBSD__) && __FreeBSD_version < 300000
+#if __FreeBSD__ < 3
if (cmd == SIOCADDMULTI) {
error = ether_addmulti(ifr, &sc->wl_ac);
}
@@ -1284,7 +1287,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
#endif
break;
-#endif /* MULTICAST */
+#endif MULTICAST
/* DEVICE SPECIFIC */
@@ -1469,13 +1472,16 @@ wlwatchdog(void *vsc)
* output : either a packet is received, or a packet is transfered
*
*/
-static void
+void
wlintr(unit)
int unit;
{
register struct wl_softc *sc = &wl_softc[unit];
+ scb_t scb;
+ ac_t cb;
short base = sc->base;
- int ac_status;
+ int next, x, opri;
+ int i, ac_status;
u_short int_type, int_type1;
#ifdef WLDEBUG
@@ -1563,7 +1569,7 @@ int unit;
if (ac_status & TC_CARRIER) {
printf("wl%d: no carrier\n", unit);
}
-#endif /* notdef */
+#endif notdef
if (ac_status & TC_CLS) {
printf("wl%d: no CTS\n", unit);
}
@@ -1725,7 +1731,7 @@ wlrequeue(int unit, u_short fd_p)
#ifdef WLDEBUG
static int xmt_debug = 0;
-#endif /* WLDEBUG */
+#endif WLDEBUG
/*
* wlxmt:
@@ -1775,7 +1781,7 @@ wlxmt(int unit, struct mbuf *m)
printf("ether type %x\n", eh_p->ether_type);
}
}
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), OFFSET_TBD);
outw(PIOP0(base), 0); /* act_count */
outw(PIOR1(base), OFFSET_TBD + 4);
@@ -1830,13 +1836,13 @@ wlxmt(int unit, struct mbuf *m)
if (sc->wl_if.if_flags & IFF_DEBUG)
if (xmt_debug)
printf("mbuf+ L%d @%p ", count, (void *)mb_p);
-#endif /* WLDEBUG */
+#endif WLDEBUG
}
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
if (xmt_debug)
printf("CLEN = %d\n", clen);
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), tbd_p);
if (clen < ETHERMIN) {
outw(PIOP0(base), inw(PIOP0(base)) + ETHERMIN - clen);
@@ -1854,7 +1860,7 @@ wlxmt(int unit, struct mbuf *m)
printf("\n");
}
}
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), OFFSET_SCB + 2); /* address of scb_command */
/*
@@ -2031,7 +2037,7 @@ wlconfig(int unit)
short base = sc->base;
#if MULTICAST
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
struct ifmultiaddr *ifma;
u_char *addrp;
#else
@@ -2039,7 +2045,7 @@ wlconfig(int unit)
struct ether_multistep step;
#endif
int cnt = 0;
-#endif /* MULTICAST */
+#endif MULTICAST
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
@@ -2100,7 +2106,7 @@ wlconfig(int unit)
outw(PIOP1(base), 0); /* ac_status */
outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */
outw(PIOR1(base), OFFSET_CU + 8);
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
for (ifma = sc->wl_if.if_multiaddrs.lh_first; ifma;
ifma = ifma->ifma_link.le_next) {
if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -2151,7 +2157,7 @@ printf("mcast_addr[%d,%d,%d] %x %x %x %x %x %x\n", lo, hi, cnt,
outw(PIOP1(base), cnt * WAVELAN_ADDR_SIZE);
if(wlcmd(unit, "config()-mcaddress") == 0)
return 0;
-#endif /* MULTICAST */
+#endif MULTICAST
outw(PIOR1(base), OFFSET_CU);
outw(PIOP1(base), 0); /* ac_status */
@@ -2320,6 +2326,7 @@ static void
wlsftwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp, int unit)
{
struct mbuf *tm_p = *tm_pp;
+ u_char *mb_p = *mb_pp;
u_short count = 0;
u_char *cp = (u_char *) t_packet;
int len;
@@ -2378,6 +2385,10 @@ wlmmcread(u_int base, u_short reg)
static void
getsnr(int unit)
{
+ register struct wl_softc *sc = WLSOFTC(unit);
+ short base = sc->base;
+ register int s;
+
MMC_WRITE(MMC_FREEZE,1);
/*
* SNR retrieval procedure :
@@ -2549,7 +2560,7 @@ static
void wl_cache_store (int unit, int base, struct ether_header *eh,
struct mbuf *m)
{
- struct ip *ip = NULL; /* Avoid GCC warning */
+ struct ip *ip;
int i;
int signal, silence;
int w_insertcache; /* computed index for cache entry storage */
@@ -2671,7 +2682,7 @@ void wl_cache_store (int unit, int base, struct ether_header *eh,
*/
#ifdef MULTICAST
-#if defined(__FreeBSD__) && __FreeBSD_version < 300000 /* not required */
+#if __FreeBSD__ < 3 /* not required */
static int
check_allmulti(int unit)
{
diff --git a/sys/i386/isa/if_wl.h b/sys/i386/isa/if_wl.h
index 70d5d30cdb66..90801c38f8ab 100644
--- a/sys/i386/isa/if_wl.h
+++ b/sys/i386/isa/if_wl.h
@@ -116,5 +116,5 @@ typedef struct {
outw(MMCR(WLSOFTC(unit)->base), \
(u_short)(((u_short)(val) << 8) | ((cmd) << 1) | 1))
-#endif /* _IF_WL_H */
+#endif _IF_WL_H
diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c
index 3000e89eb8c9..2821470173de 100644
--- a/sys/i386/isa/if_ze.c
+++ b/sys/i386/isa/if_ze.c
@@ -47,7 +47,7 @@
*/
/*
- * $Id: if_ze.c,v 1.55 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ze.c,v 1.53 1998/06/07 17:10:39 dfr Exp $
*/
/* XXX don't mix different PCCARD support code. */
@@ -168,7 +168,6 @@ static void ze_init __P((int unit));
static __inline void ze_xmit __P((struct ifnet *ifp));
static void ze_start __P((struct ifnet *ifp));
static __inline void ze_rint __P((int unit));
-static ointhand2_t zeintr;
static int ze_ioctl __P((struct ifnet *ifp, u_long command, caddr_t data));
static void ze_get_packet __P((struct ze_softc *sc, char *buf, int len));
static __inline char *ze_ring_copy __P((struct ze_softc *sc, char *src,
@@ -587,8 +586,6 @@ ze_attach(isa_dev)
struct ifnet *ifp = &sc->arpcom.ac_if;
int pl;
- isa_dev->id_ointr = zeintr;
-
/* PCMCIA card can be offlined. Reconfiguration is required */
if (isa_dev->id_reconfig) {
ze_reset(isa_dev->id_unit);
@@ -726,9 +723,7 @@ ze_watchdog(ifp)
#if 1
struct ze_softc *sc = (struct ze_softc *)ifp;
u_char isr, imr;
-#ifndef SMP
u_int imask;
-#endif
if(!(ifp->if_flags & IFF_UP))
return;
@@ -1150,7 +1145,7 @@ ze_rint(unit)
/*
* Ethernet interface interrupt processor
*/
-static void
+void
zeintr(unit)
int unit;
{
diff --git a/sys/i386/isa/if_zp.c b/sys/i386/isa/if_zp.c
index 11e562c8b6a9..b2e9ad8d4626 100644
--- a/sys/i386/isa/if_zp.c
+++ b/sys/i386/isa/if_zp.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $
- * $Id: if_zp.c,v 1.48 1998/06/07 17:10:40 dfr Exp $
+ * $Id: if_zp.c,v 1.47 1998/05/26 02:28:18 jmb Exp $
*/
/*-
* TODO:
@@ -198,7 +198,6 @@ static int zpioctl __P((struct ifnet * ifp, u_long, caddr_t));
static u_short read_eeprom_data __P((int, int));
static void zpinit __P((int));
-static ointhand2_t zpintr;
static void zpmbuffill __P((void *));
static void zpmbufempty __P((struct zp_softc *));
static void zpread __P((struct zp_softc *));
@@ -485,8 +484,6 @@ zpattach(isa_dev)
u_short i;
int pl;
- isa_dev->id_ointr = zpintr;
-
/* PCMCIA card can be offlined. Reconfiguration is required */
if (isa_dev->id_reconfig) {
if (!isa_dev->id_alive && sc->last_alive) {
@@ -777,7 +774,7 @@ readcheck:
}
goto startagain;
}
-static void
+void
zpintr(unit)
int unit;
{
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index 0254195f5ddb..3f891f2af315 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -34,15 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.15 1998/12/04 22:54:46 archie Exp $
+ * $Id: intr_machdep.c,v 1.13 1998/06/18 16:08:46 bde Exp $
*/
#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
#include <sys/syslog.h>
#include <machine/ipl.h>
@@ -328,7 +325,7 @@ find_device_id(int irq)
char *cp;
int free_id, id;
- snprintf(buf, sizeof(buf), "pci irq%d", irq);
+ sprintf(buf, "pci irq%d", irq);
cp = intrnames;
/* default to 0, which corresponds to clk0 */
free_id = 0;
diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c
index 38b1945f7ac0..cd4628cad235 100644
--- a/sys/i386/isa/ipl_funcs.c
+++ b/sys/i386/isa/ipl_funcs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ipl_funcs.c,v 1.13 1998/02/01 22:04:58 bde Exp $
+ * $Id: ipl_funcs.c,v 1.12 1998/01/15 07:34:01 gibbs Exp $
*/
#include <sys/types.h>
@@ -379,10 +379,9 @@ splx(unsigned ipl)
intrmask_t
splq(intrmask_t mask)
{
- intrmask_t tmp;
-#ifdef INTR_SPL
- intrmask_t tmp2;
+ intrmask_t tmp, tmp2;
+#ifdef INTR_SPL
for (;;) {
IFCPL_LOCK();
tmp = tmp2 = cpl;
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index 177024d17d6b..eb280936bbfc 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.116 1998/10/22 05:58:39 bde Exp $
+ * $Id: isa.c,v 1.114 1998/10/12 13:12:45 bde Exp $
*/
/*
@@ -513,7 +513,7 @@ config_isadev_c(isdp, mp, reconfig)
printf("%s%d", dp->name, isdp->id_unit);
if (id_alive != -1) {
if (isdp->id_iobase == -1)
- printf(" at");
+ printf(" at ?");
else {
printf(" at 0x%x", isdp->id_iobase);
if (isdp->id_iobase + id_alive - 1 !=
@@ -557,10 +557,7 @@ config_isadev_c(isdp, mp, reconfig)
isdp->id_alive = id_alive;
}
(*dp->attach)(isdp);
- if (isdp->id_irq != 0 && isdp->id_intr == NULL)
- printf("%s%d: irq with no handler\n",
- dp->name, isdp->id_unit);
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
#ifdef APIC_IO
/*
* Some motherboards use upper IRQs for traditional
@@ -597,7 +594,7 @@ config_isadev_c(isdp, mp, reconfig)
} else {
#if 0
/* This code has not been tested.... */
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
icu_unset(ffs(isdp->id_irq) - 1,
isdp->id_intr);
if (mp)
diff --git a/sys/i386/isa/isa.h b/sys/i386/isa/isa.h
index ea25f20604ee..6ec3ae276d41 100644
--- a/sys/i386/isa/isa.h
+++ b/sys/i386/isa/isa.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isa.h,v 1.21 1997/02/22 09:36:41 peter Exp $
+ * $Id$
*/
#ifdef PC98
@@ -147,7 +147,7 @@
#define IO_ISASIZES
#define IO_ASCSIZE 5 /* AmiScan GI1904-based hand scanner */
-#define IO_CGASIZE 12 /* CGA controllers */
+#define IO_CGASIZE 16 /* CGA controllers */
#define IO_COMSIZE 8 /* 8250, 16x50 com controllers */
#define IO_DMASIZE 16 /* 8237 DMA controllers */
#define IO_DPGSIZE 32 /* 74LS612 DMA page registers */
@@ -158,10 +158,9 @@
#define IO_ICUSIZE 16 /* 8259A interrupt controllers */
#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */
#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */
-#define IO_MDASIZE 12 /* Monochrome display controllers */
+#define IO_MDASIZE 16 /* Monochrome display controllers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_PMPSIZE 2 /* 82347 power management peripheral */
-#define IO_PSMSIZE 5 /* 8042 Keyboard controllers */
#define IO_RTCSIZE 16 /* CMOS real time clock, NMI control */
#define IO_TMRSIZE 16 /* 8253 programmable timers */
#define IO_VGASIZE 16 /* VGA controllers */
diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h
index d23f701914e6..17aad1dd263d 100644
--- a/sys/i386/isa/isa_device.h
+++ b/sys/i386/isa/isa_device.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: isa_device.h,v 1.56 1998/10/22 05:58:39 bde Exp $
+ * $Id: isa_device.h,v 1.54 1998/09/15 10:04:08 gibbs Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
@@ -41,8 +41,6 @@
* ISA Bus Autoconfiguration
*/
-typedef void ointhand2_t __P((int unit));
-
/*
* Per device structure.
*
@@ -59,12 +57,7 @@ struct isa_device {
int id_drq; /* DMA request */
caddr_t id_maddr; /* physical i/o memory address on bus (if any)*/
int id_msize; /* size of i/o memory */
- union {
- inthand2_t *id_i;
- ointhand2_t *id_oi;
- } id_iu; /* interrupt interface routine */
-#define id_intr id_iu.id_i
-#define id_ointr id_iu.id_oi
+ inthand2_t *id_intr; /* interrupt interface routine */
int id_unit; /* unit number */
int id_flags; /* flags */
int id_scsiid; /* scsi id if needed */
@@ -130,6 +123,76 @@ int isa_dmastatus __P((int chan));
int isa_dmastop __P((int chan));
void reconfig_isadev __P((struct isa_device *isdp, u_int *mp));
+typedef void ointhand2_t __P((int unit));
+
+/*
+ * The "old" interrupt handlers really have type ointhand2_t although they
+ * appear to be declared as having type inthand2_t. However, if this
+ * header is included by ioconf.c, pretend that the handlers really have
+ * type inthand_t. Assume that `C' is defined only by ioconf.c.
+ */
+#ifndef C
+#define inthand2_t ointhand2_t
+#endif
+
+inthand2_t adintr;
+inthand2_t ahaintr;
+inthand2_t aicintr;
+inthand2_t alogintr;
+inthand2_t arintr;
+inthand2_t ascintr;
+#ifdef PC98
+inthand2_t bsintr;
+#endif
+inthand2_t csintr;
+inthand2_t cxintr;
+inthand2_t cyintr;
+inthand2_t edintr;
+inthand2_t egintr;
+inthand2_t elintr;
+inthand2_t epintr;
+inthand2_t exintr;
+inthand2_t fdintr;
+inthand2_t feintr;
+inthand2_t gusintr;
+inthand2_t ieintr;
+inthand2_t labpcintr;
+inthand2_t le_intr;
+inthand2_t lncintr;
+inthand2_t loranintr;
+inthand2_t lptintr;
+inthand2_t m6850intr;
+inthand2_t mcdintr;
+inthand2_t mseintr;
+inthand2_t ncaintr;
+inthand2_t npxintr;
+inthand2_t pasintr;
+inthand2_t pcmintr;
+inthand2_t pcrint;
+inthand2_t ppcintr;
+inthand2_t pcfintr;
+inthand2_t psmintr;
+inthand2_t rcintr;
+inthand2_t sbintr;
+inthand2_t scintr;
+inthand2_t seaintr;
+inthand2_t siointr;
+inthand2_t sndintr;
+inthand2_t spigintr;
+inthand2_t srintr;
+inthand2_t sscapeintr;
+inthand2_t stlintr;
+inthand2_t twintr;
+inthand2_t uhaintr;
+inthand2_t wdintr;
+inthand2_t wdsintr;
+inthand2_t wlintr;
+inthand2_t wtintr;
+inthand2_t zeintr;
+inthand2_t zpintr;
+
+#undef inthand2_t
+
#endif /* KERNEL */
#endif /* !_I386_ISA_ISA_DEVICE_H_ */
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index 51db908f9780..d0d172d66986 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: istallion.c,v 1.22 1998/08/23 09:57:09 bde Exp $
+ * $Id: istallion.c,v 1.21 1998/08/23 08:26:40 bde Exp $
*/
/*****************************************************************************/
@@ -540,6 +540,7 @@ struct tty *stlidevtotty(dev_t dev);
* Internal function prototypes.
*/
static stliport_t *stli_dev2port(dev_t dev);
+static int stli_chksharemem(void);
static int stli_isaprobe(struct isa_device *idp);
static int stli_eisaprobe(struct isa_device *idp);
static int stli_mcaprobe(struct isa_device *idp);
@@ -3547,7 +3548,6 @@ static int stli_brdattach(stlibrd_t *brdp)
* FIX: need to start this optimization somewhere...
*/
-#ifdef notdef
static int stli_chksharemem()
{
stlibrd_t *brdp, *nxtbrdp;
@@ -3597,7 +3597,6 @@ static int stli_chksharemem()
return(0);
}
-#endif /* notdef */
/*****************************************************************************/
diff --git a/sys/i386/isa/kbdio.c b/sys/i386/isa/kbdio.c
new file mode 100644
index 000000000000..71cde28278e1
--- /dev/null
+++ b/sys/i386/isa/kbdio.c
@@ -0,0 +1,1037 @@
+/*-
+ * Copyright (c) 1996 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: kbdio.c,v 1.12 1998/02/13 07:09:38 bde Exp $
+ */
+
+#include "sc.h"
+#include "vt.h"
+#include "psm.h"
+#include "opt_kbdio.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/syslog.h>
+#include <machine/clock.h>
+#include <i386/isa/kbdio.h>
+
+/*
+ * driver specific options: the following options may be set by
+ * `options' statements in the kernel configuration file.
+ */
+
+/* retry count */
+#ifndef KBD_MAXRETRY
+#define KBD_MAXRETRY 3
+#endif
+
+/* timing parameters */
+#ifndef KBD_RESETDELAY
+#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
+#endif
+#ifndef KBD_MAXWAIT
+#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
+#endif
+
+/* I/O recovery time */
+#ifdef PC98
+#define KBDC_DELAYTIME 37
+#define KBDD_DELAYTIME 37
+#else
+#define KBDC_DELAYTIME 20
+#define KBDD_DELAYTIME 7
+#endif
+
+/* debug option */
+#ifndef KBDIO_DEBUG
+#define KBDIO_DEBUG 0
+#endif
+
+/* end of driver specific options */
+
+/* constants */
+
+#define NKBDC MAX(MAX(NSC, NVT), NPSM)
+#define KBDQ_BUFSIZE 32
+
+/* macros */
+
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+#endif
+
+#define kbdcp(p) ((struct kbdc_softc *)(p))
+#define nextq(i) (((i) + 1) % KBDQ_BUFSIZE)
+#define availq(q) ((q)->head != (q)->tail)
+#if KBDIO_DEBUG >= 2
+#define emptyq(q) ((q)->tail = (q)->head = (q)->qcount = 0)
+#else
+#define emptyq(q) ((q)->tail = (q)->head = 0)
+#endif
+
+/* local variables */
+
+typedef struct _kqueue {
+ int head;
+ int tail;
+ unsigned char q[KBDQ_BUFSIZE];
+#if KBDIO_DEBUG >= 2
+ int call_count;
+ int qcount;
+ int max_qcount;
+#endif
+} kqueue;
+
+struct kbdc_softc {
+ int port; /* base port address */
+ int command_byte; /* current command byte value */
+ int command_mask; /* command byte mask bits for kbd/aux devices */
+ int lock; /* FIXME: XXX not quite a semaphore... */
+ kqueue kbd; /* keyboard data queue */
+ kqueue aux; /* auxiliary data queue */
+};
+
+static struct kbdc_softc kbdc_softc[NKBDC] = { { 0 }, };
+
+static int verbose = KBDIO_DEBUG;
+
+/* function prototypes */
+
+#ifndef PC98
+static int addq(kqueue *q, int c);
+static int removeq(kqueue *q);
+static int wait_while_controller_busy(struct kbdc_softc *kbdc);
+static int wait_for_data(struct kbdc_softc *kbdc);
+#endif
+static int wait_for_kbd_data(struct kbdc_softc *kbdc);
+#ifndef PC98
+static int wait_for_kbd_ack(struct kbdc_softc *kbdc);
+static int wait_for_aux_data(struct kbdc_softc *kbdc);
+static int wait_for_aux_ack(struct kbdc_softc *kbdc);
+#endif
+
+/* associate a port number with a KBDC */
+
+KBDC
+kbdc_open(int port)
+{
+#ifdef PC98
+ if (NKBDC) {
+ /* PC-98 has only one keyboard I/F */
+ kbdc_softc[0].port = port;
+ kbdc_softc[0].lock = FALSE;
+ return (KBDC)&kbdc_softc[0];
+ }
+ return NULL; /* You didn't include sc driver in your config file */
+#else
+ int s;
+ int i;
+
+ s = spltty();
+ for (i = 0; i < NKBDC; ++i) {
+ if (kbdc_softc[i].port == port) {
+ splx(s);
+ return (KBDC) &kbdc_softc[i];
+ }
+ if (kbdc_softc[i].port <= 0) {
+ kbdc_softc[i].port = port;
+ kbdc_softc[i].command_byte = -1;
+ kbdc_softc[i].command_mask = 0;
+ kbdc_softc[i].lock = FALSE;
+ kbdc_softc[i].kbd.head = kbdc_softc[i].kbd.tail = 0;
+ kbdc_softc[i].aux.head = kbdc_softc[i].aux.tail = 0;
+#if KBDIO_DEBUG >= 2
+ kbdc_softc[i].kbd.call_count = 0;
+ kbdc_softc[i].kbd.qcount = kbdc_softc[i].kbd.max_qcount = 0;
+ kbdc_softc[i].aux.call_count = 0;
+ kbdc_softc[i].aux.qcount = kbdc_softc[i].aux.max_qcount = 0;
+#endif
+ splx(s);
+ return (KBDC) &kbdc_softc[i];
+ }
+ }
+ splx(s);
+ return NULL;
+#endif
+}
+
+/*
+ * I/O access arbitration in `kbdio'
+ *
+ * The `kbdio' module uses a simplistic convention to arbitrate
+ * I/O access to the controller/keyboard/mouse. The convention requires
+ * close cooperation of the calling device driver.
+ *
+ * The device driver which utilizes the `kbdio' module are assumed to
+ * have the following set of routines.
+ * a. An interrupt handler (the bottom half of the driver).
+ * b. Timeout routines which may briefly polls the keyboard controller.
+ * c. Routines outside interrupt context (the top half of the driver).
+ * They should follow the rules below:
+ * 1. The interrupt handler may assume that it always has full access
+ * to the controller/keyboard/mouse.
+ * 2. The other routines must issue `spltty()' if they wish to
+ * prevent the interrupt handler from accessing
+ * the controller/keyboard/mouse.
+ * 3. The timeout routines and the top half routines of the device driver
+ * arbitrate I/O access by observing the lock flag in `kbdio'.
+ * The flag is manipulated via `kbdc_lock()'; when one wants to
+ * perform I/O, call `kbdc_lock(kbdc, TRUE)' and proceed only if
+ * the call returns with TRUE. Otherwise the caller must back off.
+ * Call `kbdc_lock(kbdc, FALSE)' when necessary I/O operaion
+ * is finished. This mechanism does not prevent the interrupt
+ * handler from being invoked at any time and carrying out I/O.
+ * Therefore, `spltty()' must be strategically placed in the device
+ * driver code. Also note that the timeout routine may interrupt
+ * `kbdc_lock()' called by the top half of the driver, but this
+ * interruption is OK so long as the timeout routine observes the
+ * the rule 4 below.
+ * 4. The interrupt and timeout routines should not extend I/O operation
+ * across more than one interrupt or timeout; they must complete
+ * necessary I/O operation within one invokation of the routine.
+ * This measns that if the timeout routine acquires the lock flag,
+ * it must reset the flag to FALSE before it returns.
+ */
+
+/* set/reset polling lock */
+int
+kbdc_lock(KBDC p, int lock)
+{
+ int prevlock;
+
+ prevlock = kbdcp(p)->lock;
+ kbdcp(p)->lock = lock;
+
+ return (prevlock != lock);
+}
+
+/* check if any data is waiting to be processed */
+int
+kbdc_data_ready(KBDC p)
+{
+#ifdef PC98
+ return (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL);
+#else
+ return (availq(&kbdcp(p)->kbd) || availq(&kbdcp(p)->aux)
+ || (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL));
+#endif
+}
+
+#ifndef PC98
+/* queuing functions */
+
+static int
+addq(kqueue *q, int c)
+{
+ if (nextq(q->tail) != q->head) {
+ q->q[q->tail] = c;
+ q->tail = nextq(q->tail);
+#if KBDIO_DEBUG >= 2
+ ++q->call_count;
+ ++q->qcount;
+ if (q->qcount > q->max_qcount)
+ q->max_qcount = q->qcount;
+#endif
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static int
+removeq(kqueue *q)
+{
+ int c;
+
+ if (q->tail != q->head) {
+ c = q->q[q->head];
+ q->head = nextq(q->head);
+#if KBDIO_DEBUG >= 2
+ --q->qcount;
+#endif
+ return c;
+ }
+ return -1;
+}
+
+/*
+ * device I/O routines
+ */
+static int
+wait_while_controller_busy(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 100msec at most */
+ int retry = 5000;
+ int port = kbdc->port;
+ int f;
+
+ while ((f = inb(port + KBD_STATUS_PORT)) & KBDS_INPUT_BUFFER_FULL) {
+ if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdc->kbd, inb(port + KBD_DATA_PORT));
+ } else if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdc->aux, inb(port + KBD_DATA_PORT));
+ }
+ DELAY(KBDC_DELAYTIME);
+ if (--retry < 0)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * wait for any data; whether it's from the controller,
+ * the keyboard, or the aux device.
+ */
+static int
+wait_for_data(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 200msec at most */
+ int retry = 10000;
+ int port = kbdc->port;
+ int f;
+
+ while ((f = inb(port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL) == 0) {
+ DELAY(KBDC_DELAYTIME);
+ if (--retry < 0)
+ return 0;
+ }
+ DELAY(KBDD_DELAYTIME);
+ return f;
+}
+#endif /* !PC98 */
+
+/* wait for data from the keyboard */
+static int
+wait_for_kbd_data(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 200msec at most */
+ int retry = 10000;
+ int port = kbdc->port;
+ int f;
+
+ while ((f = inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)
+ != KBDS_KBD_BUFFER_FULL) {
+#ifdef PC98
+ DELAY(KBDD_DELAYTIME);
+#else
+ if (f == KBDS_AUX_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdc->aux, inb(port + KBD_DATA_PORT));
+ }
+#endif
+ DELAY(KBDC_DELAYTIME);
+ if (--retry < 0)
+ return 0;
+ }
+ DELAY(KBDD_DELAYTIME);
+ return f;
+}
+
+#ifndef PC98
+/*
+ * wait for an ACK(FAh), RESEND(FEh), or RESET_FAIL(FCh) from the keyboard.
+ * queue anything else.
+ */
+static int
+wait_for_kbd_ack(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 200msec at most */
+ int retry = 10000;
+ int port = kbdc->port;
+ int f;
+ int b;
+
+ while (retry-- > 0) {
+ if ((f = inb(port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ b = inb(port + KBD_DATA_PORT);
+ if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
+ if ((b == KBD_ACK) || (b == KBD_RESEND)
+ || (b == KBD_RESET_FAIL))
+ return b;
+ addq(&kbdc->kbd, b);
+ } else if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
+ addq(&kbdc->aux, b);
+ }
+ }
+ DELAY(KBDC_DELAYTIME);
+ }
+ return -1;
+}
+
+/* wait for data from the aux device */
+static int
+wait_for_aux_data(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 200msec at most */
+ int retry = 10000;
+ int port = kbdc->port;
+ int f;
+
+ while ((f = inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)
+ != KBDS_AUX_BUFFER_FULL) {
+ if (f == KBDS_KBD_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdc->kbd, inb(port + KBD_DATA_PORT));
+ }
+ DELAY(KBDC_DELAYTIME);
+ if (--retry < 0)
+ return 0;
+ }
+ DELAY(KBDD_DELAYTIME);
+ return f;
+}
+
+/*
+ * wait for an ACK(FAh), RESEND(FEh), or RESET_FAIL(FCh) from the aux device.
+ * queue anything else.
+ */
+static int
+wait_for_aux_ack(struct kbdc_softc *kbdc)
+{
+ /* CPU will stay inside the loop for 200msec at most */
+ int retry = 10000;
+ int port = kbdc->port;
+ int f;
+ int b;
+
+ while (retry-- > 0) {
+ if ((f = inb(port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ b = inb(port + KBD_DATA_PORT);
+ if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
+ if ((b == PSM_ACK) || (b == PSM_RESEND)
+ || (b == PSM_RESET_FAIL))
+ return b;
+ addq(&kbdc->aux, b);
+ } else if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
+ addq(&kbdc->kbd, b);
+ }
+ }
+ DELAY(KBDC_DELAYTIME);
+ }
+ return -1;
+}
+
+/* write a one byte command to the controller */
+int
+write_controller_command(KBDC p, int c)
+{
+ if (!wait_while_controller_busy(kbdcp(p)))
+ return FALSE;
+ outb(kbdcp(p)->port + KBD_COMMAND_PORT, c);
+ return TRUE;
+}
+
+/* write a one byte data to the controller */
+int
+write_controller_data(KBDC p, int c)
+{
+ if (!wait_while_controller_busy(kbdcp(p)))
+ return FALSE;
+ outb(kbdcp(p)->port + KBD_DATA_PORT, c);
+ return TRUE;
+}
+
+/* write a one byte keyboard command */
+int
+write_kbd_command(KBDC p, int c)
+{
+ if (!wait_while_controller_busy(kbdcp(p)))
+ return FALSE;
+ outb(kbdcp(p)->port + KBD_DATA_PORT, c);
+ return TRUE;
+}
+
+/* write a one byte auxiliary device command */
+int
+write_aux_command(KBDC p, int c)
+{
+ if (!write_controller_command(p, KBDC_WRITE_TO_AUX))
+ return FALSE;
+ return write_controller_data(p, c);
+}
+
+/* send a command to the keyboard and wait for ACK */
+int
+send_kbd_command(KBDC p, int c)
+{
+ int retry = KBD_MAXRETRY;
+ int res = -1;
+
+ while (retry-- > 0) {
+ if (!write_kbd_command(p, c))
+ continue;
+ res = wait_for_kbd_ack(kbdcp(p));
+ if (res == KBD_ACK)
+ break;
+ }
+ return res;
+}
+
+/* send a command to the auxiliary device and wait for ACK */
+int
+send_aux_command(KBDC p, int c)
+{
+ int retry = KBD_MAXRETRY;
+ int res = -1;
+
+ while (retry-- > 0) {
+ if (!write_aux_command(p, c))
+ continue;
+ /*
+ * FIXME: XXX
+ * The aux device may have already sent one or two bytes of
+ * status data, when a command is received. It will immediately
+ * stop data transmission, thus, leaving an incomplete data
+ * packet in our buffer. We have to discard any unprocessed
+ * data in order to remove such packets. Well, we may remove
+ * unprocessed, but necessary data byte as well...
+ */
+ emptyq(&kbdcp(p)->aux);
+ res = wait_for_aux_ack(kbdcp(p));
+ if (res == PSM_ACK)
+ break;
+ }
+ return res;
+}
+
+/* send a command and a data to the keyboard, wait for ACKs */
+int
+send_kbd_command_and_data(KBDC p, int c, int d)
+{
+ int retry;
+ int res = -1;
+
+ for (retry = KBD_MAXRETRY; retry > 0; --retry) {
+ if (!write_kbd_command(p, c))
+ continue;
+ res = wait_for_kbd_ack(kbdcp(p));
+ if (res == KBD_ACK)
+ break;
+ else if (res != KBD_RESEND)
+ return res;
+ }
+ if (retry <= 0)
+ return res;
+
+ for (retry = KBD_MAXRETRY, res = -1; retry > 0; --retry) {
+ if (!write_kbd_command(p, d))
+ continue;
+ res = wait_for_kbd_ack(kbdcp(p));
+ if (res != KBD_RESEND)
+ break;
+ }
+ return res;
+}
+
+/* send a command and a data to the auxiliary device, wait for ACKs */
+int
+send_aux_command_and_data(KBDC p, int c, int d)
+{
+ int retry;
+ int res = -1;
+
+ for (retry = KBD_MAXRETRY; retry > 0; --retry) {
+ if (!write_aux_command(p, c))
+ continue;
+ emptyq(&kbdcp(p)->aux);
+ res = wait_for_aux_ack(kbdcp(p));
+ if (res == PSM_ACK)
+ break;
+ else if (res != PSM_RESEND)
+ return res;
+ }
+ if (retry <= 0)
+ return res;
+
+ for (retry = KBD_MAXRETRY, res = -1; retry > 0; --retry) {
+ if (!write_aux_command(p, d))
+ continue;
+ res = wait_for_aux_ack(kbdcp(p));
+ if (res != PSM_RESEND)
+ break;
+ }
+ return res;
+}
+
+/*
+ * read one byte from any source; whether from the controller,
+ * the keyboard, or the aux device
+ */
+int
+read_controller_data(KBDC p)
+{
+ if (availq(&kbdcp(p)->kbd))
+ return removeq(&kbdcp(p)->kbd);
+ if (availq(&kbdcp(p)->aux))
+ return removeq(&kbdcp(p)->aux);
+ if (!wait_for_data(kbdcp(p)))
+ return -1; /* timeout */
+ return inb(kbdcp(p)->port + KBD_DATA_PORT);
+}
+#endif /* !PC98 */
+
+#if KBDIO_DEBUG >= 2
+static int call = 0;
+#endif
+
+/* read one byte from the keyboard */
+int
+read_kbd_data(KBDC p)
+{
+#ifndef PC98
+#if KBDIO_DEBUG >= 2
+ if (++call > 2000) {
+ call = 0;
+ log(LOG_DEBUG, "KBDIO: kbd q: %d calls, max %d chars, "
+ "aux q: %d calls, max %d chars\n",
+ kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
+ kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
+ }
+#endif
+
+ if (availq(&kbdcp(p)->kbd))
+ return removeq(&kbdcp(p)->kbd);
+#endif /* !PC98 */
+ if (!wait_for_kbd_data(kbdcp(p)))
+ return -1; /* timeout */
+#ifdef PC98
+ DELAY(KBDC_DELAYTIME);
+#endif
+ return inb(kbdcp(p)->port + KBD_DATA_PORT);
+}
+
+/* read one byte from the keyboard, but return immediately if
+ * no data is waiting
+ */
+int
+read_kbd_data_no_wait(KBDC p)
+{
+ int f;
+
+#ifdef PC98
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+#else
+#if KBDIO_DEBUG >= 2
+ if (++call > 2000) {
+ call = 0;
+ log(LOG_DEBUG, "KBDIO: kbd q: %d calls, max %d chars, "
+ "aux q: %d calls, max %d chars\n",
+ kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
+ kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
+ }
+#endif
+
+ if (availq(&kbdcp(p)->kbd))
+ return removeq(&kbdcp(p)->kbd);
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+ if (f == KBDS_AUX_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdcp(p)->aux, inb(kbdcp(p)->port + KBD_DATA_PORT));
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+ }
+#endif /* PC98 */
+ if (f == KBDS_KBD_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ return inb(kbdcp(p)->port + KBD_DATA_PORT);
+ }
+ return -1; /* no data */
+}
+
+#ifndef PC98
+/* read one byte from the aux device */
+int
+read_aux_data(KBDC p)
+{
+ if (availq(&kbdcp(p)->aux))
+ return removeq(&kbdcp(p)->aux);
+ if (!wait_for_aux_data(kbdcp(p)))
+ return -1; /* timeout */
+ return inb(kbdcp(p)->port + KBD_DATA_PORT);
+}
+
+/* read one byte from the aux device, but return immediately if
+ * no data is waiting
+ */
+int
+read_aux_data_no_wait(KBDC p)
+{
+ int f;
+
+ if (availq(&kbdcp(p)->aux))
+ return removeq(&kbdcp(p)->aux);
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+ if (f == KBDS_KBD_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ addq(&kbdcp(p)->kbd, inb(kbdcp(p)->port + KBD_DATA_PORT));
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+ }
+ if (f == KBDS_AUX_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ return inb(kbdcp(p)->port + KBD_DATA_PORT);
+ }
+ return -1; /* no data */
+}
+
+/* discard data from the keyboard */
+void
+empty_kbd_buffer(KBDC p, int wait)
+{
+ int t;
+ int b;
+ int f;
+#if KBDIO_DEBUG >= 2
+ int c1 = 0;
+ int c2 = 0;
+#endif
+ int delta = 2;
+
+ for (t = wait; t > 0; ) {
+ if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ b = inb(kbdcp(p)->port + KBD_DATA_PORT);
+ if ((f & KBDS_BUFFER_FULL) == KBDS_AUX_BUFFER_FULL) {
+ addq(&kbdcp(p)->aux, b);
+#if KBDIO_DEBUG >= 2
+ ++c2;
+ } else {
+ ++c1;
+#endif
+ }
+ t = wait;
+ } else {
+ t -= delta;
+ }
+ DELAY(delta*1000);
+ }
+#if KBDIO_DEBUG >= 2
+ if ((c1 > 0) || (c2 > 0))
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_kbd_buffer)\n", c1, c2);
+#endif
+
+ emptyq(&kbdcp(p)->kbd);
+}
+
+/* discard data from the aux device */
+void
+empty_aux_buffer(KBDC p, int wait)
+{
+ int t;
+ int b;
+ int f;
+#if KBDIO_DEBUG >= 2
+ int c1 = 0;
+ int c2 = 0;
+#endif
+ int delta = 2;
+
+ for (t = wait; t > 0; ) {
+ if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ b = inb(kbdcp(p)->port + KBD_DATA_PORT);
+ if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) {
+ addq(&kbdcp(p)->kbd, b);
+#if KBDIO_DEBUG >= 2
+ ++c1;
+ } else {
+ ++c2;
+#endif
+ }
+ t = wait;
+ } else {
+ t -= delta;
+ }
+ DELAY(delta*1000);
+ }
+#if KBDIO_DEBUG >= 2
+ if ((c1 > 0) || (c2 > 0))
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_aux_buffer)\n", c1, c2);
+#endif
+
+ emptyq(&kbdcp(p)->aux);
+}
+
+/* discard any data from the keyboard or the aux device */
+void
+empty_both_buffers(KBDC p, int wait)
+{
+ int t;
+ int f;
+#if KBDIO_DEBUG >= 2
+ int c1 = 0;
+ int c2 = 0;
+#endif
+ int delta = 2;
+
+ for (t = wait; t > 0; ) {
+ if ((f = inb(kbdcp(p)->port + KBD_STATUS_PORT)) & KBDS_ANY_BUFFER_FULL) {
+ DELAY(KBDD_DELAYTIME);
+ (void)inb(kbdcp(p)->port + KBD_DATA_PORT);
+#if KBDIO_DEBUG >= 2
+ if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL)
+ ++c1;
+ else
+ ++c2;
+#endif
+ t = wait;
+ } else {
+ t -= delta;
+ }
+ DELAY(delta*1000);
+ }
+#if KBDIO_DEBUG >= 2
+ if ((c1 > 0) || (c2 > 0))
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_both_buffers)\n", c1, c2);
+#endif
+
+ emptyq(&kbdcp(p)->kbd);
+ emptyq(&kbdcp(p)->aux);
+}
+
+/* keyboard and mouse device control */
+
+/* NOTE: enable the keyboard port but disable the keyboard
+ * interrupt before calling "reset_kbd()".
+ */
+int
+reset_kbd(KBDC p)
+{
+ int retry = KBD_MAXRETRY;
+ int again = KBD_MAXWAIT;
+ int c = KBD_RESEND; /* keep the compiler happy */
+
+ while (retry-- > 0) {
+ empty_both_buffers(p, 10);
+ if (!write_kbd_command(p, KBDC_RESET_KBD))
+ continue;
+ emptyq(&kbdcp(p)->kbd);
+ c = read_controller_data(p);
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: RESET_KBD return code:%04x\n", c);
+ if (c == KBD_ACK) /* keyboard has agreed to reset itself... */
+ break;
+ }
+ if (retry < 0)
+ return FALSE;
+
+ while (again-- > 0) {
+ /* wait awhile, well, in fact we must wait quite loooooooooooong */
+ DELAY(KBD_RESETDELAY*1000);
+ c = read_controller_data(p); /* RESET_DONE/RESET_FAIL */
+ if (c != -1) /* wait again if the controller is not ready */
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: RESET_KBD status:%04x\n", c);
+ if (c != KBD_RESET_DONE)
+ return FALSE;
+ return TRUE;
+}
+
+/* NOTE: enable the aux port but disable the aux interrupt
+ * before calling `reset_aux_dev()'.
+ */
+int
+reset_aux_dev(KBDC p)
+{
+ int retry = KBD_MAXRETRY;
+ int again = KBD_MAXWAIT;
+ int c = PSM_RESEND; /* keep the compiler happy */
+
+ while (retry-- > 0) {
+ empty_both_buffers(p, 10);
+ if (!write_aux_command(p, PSMC_RESET_DEV))
+ continue;
+ emptyq(&kbdcp(p)->aux);
+ /* NOTE: Compaq Armada laptops require extra delay here. XXX */
+ for (again = KBD_MAXWAIT; again > 0; --again) {
+ DELAY(KBD_RESETDELAY*1000);
+ c = read_aux_data_no_wait(p);
+ if (c != -1)
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: RESET_AUX return code:%04x\n", c);
+ if (c == PSM_ACK) /* aux dev is about to reset... */
+ break;
+ }
+ if (retry < 0)
+ return FALSE;
+
+ for (again = KBD_MAXWAIT; again > 0; --again) {
+ /* wait awhile, well, quite looooooooooooong */
+ DELAY(KBD_RESETDELAY*1000);
+ c = read_aux_data_no_wait(p); /* RESET_DONE/RESET_FAIL */
+ if (c != -1) /* wait again if the controller is not ready */
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: RESET_AUX status:%04x\n", c);
+ if (c != PSM_RESET_DONE) /* reset status */
+ return FALSE;
+
+ c = read_aux_data(p); /* device ID */
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: RESET_AUX ID:%04x\n", c);
+ /* NOTE: we could check the device ID now, but leave it later... */
+ return TRUE;
+}
+
+/* controller diagnostics and setup */
+
+int
+test_controller(KBDC p)
+{
+ int retry = KBD_MAXRETRY;
+ int again = KBD_MAXWAIT;
+ int c = KBD_DIAG_FAIL;
+
+ while (retry-- > 0) {
+ empty_both_buffers(p, 10);
+ if (write_controller_command(p, KBDC_DIAGNOSE))
+ break;
+ }
+ if (retry < 0)
+ return FALSE;
+
+ emptyq(&kbdcp(p)->kbd);
+ while (again-- > 0) {
+ /* wait awhile */
+ DELAY(KBD_RESETDELAY*1000);
+ c = read_controller_data(p); /* DIAG_DONE/DIAG_FAIL */
+ if (c != -1) /* wait again if the controller is not ready */
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: DIAGNOSE status:%04x\n", c);
+ return (c == KBD_DIAG_DONE);
+}
+
+int
+test_kbd_port(KBDC p)
+{
+ int retry = KBD_MAXRETRY;
+ int again = KBD_MAXWAIT;
+ int c = -1;
+
+ while (retry-- > 0) {
+ empty_both_buffers(p, 10);
+ if (write_controller_command(p, KBDC_TEST_KBD_PORT))
+ break;
+ }
+ if (retry < 0)
+ return FALSE;
+
+ emptyq(&kbdcp(p)->kbd);
+ while (again-- > 0) {
+ c = read_controller_data(p);
+ if (c != -1) /* try again if the controller is not ready */
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: TEST_KBD_PORT status:%04x\n", c);
+ return c;
+}
+
+int
+test_aux_port(KBDC p)
+{
+ int retry = KBD_MAXRETRY;
+ int again = KBD_MAXWAIT;
+ int c = -1;
+
+ while (retry-- > 0) {
+ empty_both_buffers(p, 10);
+ if (write_controller_command(p, KBDC_TEST_AUX_PORT))
+ break;
+ }
+ if (retry < 0)
+ return FALSE;
+
+ emptyq(&kbdcp(p)->kbd);
+ while (again-- > 0) {
+ c = read_controller_data(p);
+ if (c != -1) /* try again if the controller is not ready */
+ break;
+ }
+ if (verbose || bootverbose)
+ log(LOG_DEBUG, "kbdio: TEST_AUX_PORT status:%04x\n", c);
+ return c;
+}
+
+int
+kbdc_get_device_mask(KBDC p)
+{
+ return kbdcp(p)->command_mask;
+}
+
+void
+kbdc_set_device_mask(KBDC p, int mask)
+{
+ kbdcp(p)->command_mask =
+ mask & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS);
+}
+
+int
+get_controller_command_byte(KBDC p)
+{
+ if (kbdcp(p)->command_byte != -1)
+ return kbdcp(p)->command_byte;
+ if (!write_controller_command(p, KBDC_GET_COMMAND_BYTE))
+ return -1;
+ emptyq(&kbdcp(p)->kbd);
+ kbdcp(p)->command_byte = read_controller_data(p);
+ return kbdcp(p)->command_byte;
+}
+
+int
+set_controller_command_byte(KBDC p, int mask, int command)
+{
+ if (get_controller_command_byte(p) == -1)
+ return FALSE;
+
+ command = (kbdcp(p)->command_byte & ~mask) | (command & mask);
+ if (command & KBD_DISABLE_KBD_PORT) {
+ if (!write_controller_command(p, KBDC_DISABLE_KBD_PORT))
+ return FALSE;
+ }
+ if (!write_controller_command(p, KBDC_SET_COMMAND_BYTE))
+ return FALSE;
+ if (!write_controller_data(p, command))
+ return FALSE;
+ kbdcp(p)->command_byte = command;
+
+ if (verbose)
+ log(LOG_DEBUG, "kbdio: new command byte:%04x (set_controller...)\n",
+ command);
+
+ return TRUE;
+}
+#endif /* !PC98 */
diff --git a/sys/i386/isa/kbdio.h b/sys/i386/isa/kbdio.h
new file mode 100644
index 000000000000..b544681f5d57
--- /dev/null
+++ b/sys/i386/isa/kbdio.h
@@ -0,0 +1,209 @@
+/*-
+ * Copyright (c) 1996 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: kbdio.h,v 1.7 1997/12/07 08:09:15 yokota Exp $
+ */
+
+#ifndef _I386_ISA_KBDIO_H_
+#define _I386_ISA_KBDIO_H_
+
+/* constants */
+
+/* I/O ports */
+#ifdef PC98
+#define KBD_STATUS_PORT 2 /* status port, read */
+#define KBD_COMMAND_PORT 2 /* controller command port, write */
+#define KBD_DATA_PORT 0 /* data port, read/write
+ * also used as keyboard command
+ * and mouse command port
+ */
+#else
+#define KBD_STATUS_PORT 4 /* status port, read */
+#define KBD_COMMAND_PORT 4 /* controller command port, write */
+#define KBD_DATA_PORT 0 /* data port, read/write
+ * also used as keyboard command
+ * and mouse command port
+ */
+#endif /* PC98 */
+
+/* FIXME: `IO_PSMSIZE' should really be in `isa.h'. */
+#define IO_PSMSIZE (KBD_COMMAND_PORT - KBD_DATA_PORT + 1) /* 5 */
+
+/* controller commands (sent to KBD_COMMAND_PORT) */
+#define KBDC_SET_COMMAND_BYTE 0x0060
+#define KBDC_GET_COMMAND_BYTE 0x0020
+#define KBDC_WRITE_TO_AUX 0x00d4
+#define KBDC_DISABLE_AUX_PORT 0x00a7
+#define KBDC_ENABLE_AUX_PORT 0x00a8
+#define KBDC_TEST_AUX_PORT 0x00a9
+#define KBDC_DIAGNOSE 0x00aa
+#define KBDC_TEST_KBD_PORT 0x00ab
+#define KBDC_DISABLE_KBD_PORT 0x00ad
+#define KBDC_ENABLE_KBD_PORT 0x00ae
+
+/* controller command byte (set by KBDC_SET_COMMAND_BYTE) */
+#define KBD_TRANSLATION 0x0040
+#define KBD_RESERVED_BITS 0x0004
+#define KBD_OVERRIDE_KBD_LOCK 0x0008
+#define KBD_ENABLE_KBD_PORT 0x0000
+#define KBD_DISABLE_KBD_PORT 0x0010
+#define KBD_ENABLE_AUX_PORT 0x0000
+#define KBD_DISABLE_AUX_PORT 0x0020
+#define KBD_ENABLE_AUX_INT 0x0002
+#define KBD_DISABLE_AUX_INT 0x0000
+#define KBD_ENABLE_KBD_INT 0x0001
+#define KBD_DISABLE_KBD_INT 0x0000
+#define KBD_KBD_CONTROL_BITS (KBD_DISABLE_KBD_PORT | KBD_ENABLE_KBD_INT)
+#define KBD_AUX_CONTROL_BITS (KBD_DISABLE_AUX_PORT | KBD_ENABLE_AUX_INT)
+
+/* keyboard device commands (sent to KBD_DATA_PORT) */
+#define KBDC_RESET_KBD 0x00ff
+#define KBDC_ENABLE_KBD 0x00f4
+#define KBDC_DISABLE_KBD 0x00f5
+#define KBDC_SET_DEFAULTS 0x00f6
+#define KBDC_SEND_DEV_ID 0x00f2
+#define KBDC_SET_LEDS 0x00ed
+#define KBDC_ECHO 0x00ee
+#define KBDC_SET_SCANCODE_SET 0x00f0
+#define KBDC_SET_TYPEMATIC 0x00f3
+
+/* aux device commands (sent to KBD_DATA_PORT) */
+#define PSMC_RESET_DEV 0x00ff
+#define PSMC_ENABLE_DEV 0x00f4
+#define PSMC_DISABLE_DEV 0x00f5
+#define PSMC_SET_DEFAULTS 0x00f6
+#define PSMC_SEND_DEV_ID 0x00f2
+#define PSMC_SEND_DEV_STATUS 0x00e9
+#define PSMC_SEND_DEV_DATA 0x00eb
+#define PSMC_SET_SCALING11 0x00e6
+#define PSMC_SET_SCALING21 0x00e7
+#define PSMC_SET_RESOLUTION 0x00e8
+#define PSMC_SET_STREAM_MODE 0x00ea
+#define PSMC_SET_REMOTE_MODE 0x00f0
+#define PSMC_SET_SAMPLING_RATE 0x00f3
+
+/* PSMC_SET_RESOLUTION argument */
+#define PSMD_RES_LOW 0 /* typically 25ppi */
+#define PSMD_RES_MEDIUM_LOW 1 /* typically 50ppi */
+#define PSMD_RES_MEDIUM_HIGH 2 /* typically 100ppi (default) */
+#define PSMD_RES_HIGH 3 /* typically 200ppi */
+#define PSMD_MAX_RESOLUTION PSMD_RES_HIGH
+
+/* PSMC_SET_SAMPLING_RATE */
+#define PSMD_MAX_RATE 255 /* FIXME: not sure if it's possible */
+
+/* status bits (KBD_STATUS_PORT) */
+#ifdef PC98
+#define KBDS_BUFFER_FULL 0x0002
+#define KBDS_ANY_BUFFER_FULL 0x0002
+#define KBDS_KBD_BUFFER_FULL 0x0002
+#define KBDS_AUX_BUFFER_FULL 0x0002
+#else
+#define KBDS_BUFFER_FULL 0x0021
+#define KBDS_ANY_BUFFER_FULL 0x0001
+#define KBDS_KBD_BUFFER_FULL 0x0001
+#define KBDS_AUX_BUFFER_FULL 0x0021
+#endif
+#define KBDS_INPUT_BUFFER_FULL 0x0002
+
+/* return code */
+#define KBD_ACK 0x00fa
+#define KBD_RESEND 0x00fe
+#define KBD_RESET_DONE 0x00aa
+#define KBD_RESET_FAIL 0x00fc
+#define KBD_DIAG_DONE 0x0055
+#define KBD_DIAG_FAIL 0x00fd
+#define KBD_ECHO 0x00ee
+
+#define PSM_ACK 0x00fa
+#define PSM_RESEND 0x00fe
+#define PSM_RESET_DONE 0x00aa
+#define PSM_RESET_FAIL 0x00fc
+
+/* aux device ID */
+#define PSM_MOUSE_ID 0
+#define PSM_BALLPOINT_ID 2
+#define PSM_INTELLI_ID 3
+
+#ifdef KERNEL
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/* types/structures */
+
+typedef caddr_t KBDC;
+
+/* function prototypes */
+
+KBDC kbdc_open __P((int port));
+
+int kbdc_lock __P((KBDC kbdc, int lock));
+
+int kbdc_data_ready __P((KBDC kbdc));
+
+int write_controller_command __P((KBDC kbdc,int c));
+int write_controller_data __P((KBDC kbdc,int c));
+
+int write_kbd_command __P((KBDC kbdc,int c));
+int write_aux_command __P((KBDC kbdc,int c));
+int send_kbd_command __P((KBDC kbdc,int c));
+int send_aux_command __P((KBDC kbdc,int c));
+int send_kbd_command_and_data __P((KBDC kbdc,int c,int d));
+int send_aux_command_and_data __P((KBDC kbdc,int c,int d));
+
+int read_controller_data __P((KBDC kbdc));
+int read_kbd_data __P((KBDC kbdc));
+int read_kbd_data_no_wait __P((KBDC kbdc));
+int read_aux_data __P((KBDC kbdc));
+int read_aux_data_no_wait __P((KBDC kbdc));
+
+void empty_kbd_buffer __P((KBDC kbdc, int t));
+void empty_aux_buffer __P((KBDC kbdc, int t));
+void empty_both_buffers __P((KBDC kbdc, int t));
+
+int reset_kbd __P((KBDC kbdc));
+int reset_aux_dev __P((KBDC kbdc));
+
+int test_controller __P((KBDC kbdc));
+int test_kbd_port __P((KBDC kbdc));
+int test_aux_port __P((KBDC kbdc));
+
+int kbdc_get_device_mask __P((KBDC kbdc));
+void kbdc_set_device_mask __P((KBDC kbdc, int mask));
+
+int get_controller_command_byte __P((KBDC kbdc));
+int set_controller_command_byte __P((KBDC kbdc, int command, int flag));
+
+#endif /* KERNEL */
+
+#endif /* !_I386_ISA_KBDIO_H_ */
diff --git a/sys/i386/isa/kbdtables.h b/sys/i386/isa/kbdtables.h
index c0d4663a6eac..61376f48b919 100644
--- a/sys/i386/isa/kbdtables.h
+++ b/sys/i386/isa/kbdtables.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kbdtables.h,v 1.41 1998/09/15 18:16:37 sos Exp $
+ * $Id$
*/
#define SET8 0x80 /* set eight bit on */
@@ -93,8 +93,8 @@ static keymap_t key_map = { 0x80, /* PC98 keymap */
/* sc=33 */ NOP, '_', 0x1F, 0x1F, '\\', '|', 0x1C, 0x1C, 0x80, 0x00,
/* sc=34 */ ' ', ' ', 0x00, 0x00, ' ', ' ', 0x00, 0x00, 0x00, 0x00,
/* sc=35 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=36 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=37 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
+/* sc=36 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
+/* sc=37 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
/* sc=38 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
/* sc=39 */ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, RBT, RBT, 0x03, 0x02,
/* sc=3a */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index e893a21fbd40..4e19b64b5658 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -57,9 +57,7 @@
#include <sys/devfsext.h>
#endif /*DEVFS*/
-#ifdef LOUTB
#include <machine/clock.h>
-#endif
#include <i386/isa/isa_device.h>
@@ -298,7 +296,6 @@ static struct cdevsw labpc_cdevsw =
labpcioctl, nostop, nullreset, nodevtotty,
seltrue, nommap, labpcstrategy, "labpc", NULL, -1 };
-static ointhand2_t labpcintr;
static void start(struct ctlr *ctlr);
static void
@@ -399,7 +396,7 @@ labpcinit(void)
labpcs = malloc(NLABPC * sizeof(struct ctlr *), M_DEVBUF, M_NOWAIT);
if (labpcs)
{
- bzero(labpcs, NLABPC * sizeof(struct ctlr *));
+ bzero(labpcs, NLABPC * sizeof(struct cltr *));
return 1;
}
return 0;
@@ -408,7 +405,7 @@ labpcinit(void)
static int
labpcprobe(struct isa_device *dev)
{
- static int unit;
+ static unit;
struct ctlr scratch, *ctlr;
u_char status;
@@ -476,7 +473,6 @@ labpcattach(struct isa_device *dev)
{
struct ctlr *ctlr = labpcs[dev->id_unit];
- dev->id_ointr = labpcintr;
callout_handle_init(&ctlr->ch);
ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERZ) + .50;
reset(ctlr);
@@ -696,7 +692,7 @@ static void ad_intr(struct ctlr *ctlr)
}
}
-static void labpcintr(int unit)
+void labpcintr(int unit)
{
struct ctlr *ctlr = labpcs[unit];
(*ctlr->intr)(ctlr);
@@ -1098,7 +1094,7 @@ labpcioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *p)
}
-static int labpc_devsw_installed = 0;
+static labpc_devsw_installed = 0;
static void labpc_drvinit(void *unused)
{
diff --git a/sys/i386/isa/loran.c b/sys/i386/isa/loran.c
index d4dca4d24ed4..e92d793c4fb9 100644
--- a/sys/i386/isa/loran.c
+++ b/sys/i386/isa/loran.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: loran.c,v 1.13 1998/12/07 21:58:22 archie Exp $
+ * $Id: loran.c,v 1.7 1998/08/17 18:47:36 bde Exp $
*
* This device-driver helps the userland controlprogram for a LORAN-C
* receiver avoid monopolizing the CPU.
@@ -32,13 +32,13 @@
#include <i386/isa/isa_device.h>
#endif /* KERNEL */
-typedef TAILQ_HEAD(, datapoint) dphead_t;
-
struct datapoint {
- /* Fields used by kernel */
+ void *ident;
+ int index;
u_int64_t scheduled;
+ u_int delay;
u_int code;
- u_int fri;
+ u_int gri;
u_int agc;
u_int phase;
u_int width;
@@ -47,24 +47,16 @@ struct datapoint {
u_int qsig;
u_int ssig;
u_int64_t epoch;
+ struct timespec actual;
TAILQ_ENTRY(datapoint) list;
- u_char status;
- int vco;
- int bounce;
- pid_t pid;
- struct timespec when;
-
- int priority;
- dphead_t *home;
-
- /* Fields used only in userland */
- void *ident;
- int index;
double ival;
double qval;
double sval;
double mval;
-
+ u_char status;
+ u_int vco;
+ int count;
+ int remain;
};
/*
@@ -85,21 +77,14 @@ struct datapoint {
#define EN5 0x40 /* enable counter 5 bit */
#define ENG 0x80 /* enable gri bit */
-#define VCO_SHIFT 8 /* bits of fraction on VCO value */
-#define VCO (2048 << VCO_SHIFT) /* initial vco dac (0 V)*/
-
-
-#define PGUARD 990 /* program guard time (cycle) (990!) */
-
+#define VCO 2048 /* initial vco dac (0 V)*/
#ifdef KERNEL
-#define NLORAN 10 /* Allow ten minor devices */
-
-#define NDUMMY 4 /* How many idlers we want */
#define PORT 0x0300 /* controller port address */
+#define PGUARD 990 /* program guard time (cycle) (990!) */
#define GRI 800 /* pulse-group gate (cycle) */
@@ -198,24 +183,25 @@ struct datapoint {
/**********************************************************************/
-dphead_t minors[NLORAN], working, holding;
+static TAILQ_HEAD(qhead, datapoint) qdone, qready;
-static struct datapoint dummy[NDUMMY];
+static struct datapoint dummy;
static u_int64_t ticker;
static u_char par;
+static struct datapoint *this, *next;
+
static MALLOC_DEFINE(M_LORAN, "Loran", "Loran datapoints");
static int loranerror;
static char lorantext[80];
-static u_int vco_is;
-static u_int vco_should;
-static u_int vco_want;
-static u_int64_t vco_when;
-static int64_t vco_error;
+static u_int vco_is;
+static u_int vco_should;
+
+static int lorantc_magic;
/**********************************************************************/
@@ -227,8 +213,7 @@ static d_open_t loranopen;
static d_close_t loranclose;
static d_read_t loranread;
static d_write_t loranwrite;
-static ointhand2_t loranintr;
-extern struct timecounter loran_timecounter;
+extern struct timecounter loran_timecounter[];
/**********************************************************************/
@@ -243,10 +228,10 @@ loranprobe(struct isa_device *dvp)
}
u_short tg_init[] = { /* stc initialization vector */
- 0x0562, 12, 13, /* counter 1 (p0) Mode J */
- 0x0262, PGUARD, GRI, /* counter 2 (gri) Mode J */
+ 0x0562, 12, 13, /* counter 1 (p0) */
+ 0x0262, PGUARD, GRI, /* counter 2 (gri) */
0x8562, PCX, 5000 - PCX, /* counter 3 (pcx) */
- 0xc562, 0, STROBE, /* counter 4 (stb) Mode L */
+ 0xc562, 0, STROBE, /* counter 4 (stb) */
0x052a, 0, 0 /* counter 5 (out) */
};
@@ -272,37 +257,31 @@ loranattach(struct isa_device *isdp)
{
int i;
- isdp->id_ointr = loranintr;
-
/* We need to be a "fast-intr" */
isdp->id_ri_flags |= RI_FAST;
printf("loran0: LORAN-C Receiver\n");
- vco_should = VCO;
- vco_is = vco_should >> VCO_SHIFT;
- LOAD_DAC(DACA, vco_is);
+ vco_is = VCO;
+ LOAD_DAC(DACA, VCO);
init_tgc();
- init_timecounter(&loran_timecounter);
+ init_timecounter(loran_timecounter);
- TAILQ_INIT(&working);
- TAILQ_INIT(&holding);
- for (i = 0; i < NLORAN; i++) {
- TAILQ_INIT(&minors[i]);
-
- }
+ TAILQ_INIT(&qdone);
+ TAILQ_INIT(&qready);
- for (i = 0; i < NDUMMY; i++) {
- dummy[i].agc = 4095;
- dummy[i].code = 0xac;
- dummy[i].fri = PGUARD;
- dummy[i].phase = 50;
- dummy[i].width = 50;
- dummy[i].priority = 9999;
- TAILQ_INSERT_TAIL(&working, &dummy[i], list);
- }
+ dummy.agc = 4095;
+ dummy.code = 0xac;
+ dummy.delay = PGUARD - GRI;
+ dummy.gri = PGUARD;
+ dummy.phase = 50;
+ dummy.width = 50;
+
+ TAILQ_INSERT_HEAD(&qready, &dummy, list);
+ this = &dummy;
+ next = &dummy;
inb(ADC); /* Flush any old result */
outb(ADC, ADC_S);
@@ -316,18 +295,28 @@ loranattach(struct isa_device *isdp)
static int
loranopen (dev_t dev, int flags, int fmt, struct proc *p)
{
- int idx;
-
- idx = minor(dev);
- if (idx >= NLORAN)
- return (ENODEV);
+ u_long ef;
+ struct datapoint *this;
+ while (!TAILQ_EMPTY(&qdone)) {
+ ef = read_eflags();
+ disable_intr();
+ this = TAILQ_FIRST(&qdone);
+ TAILQ_REMOVE(&qdone, this, list);
+ write_eflags(ef);
+ FREE(this, M_LORAN);
+ }
+ init_tgc();
+ loranerror = 0;
return(0);
}
static int
loranclose(dev_t dev, int flags, int fmt, struct proc *p)
{
+ /*
+ * Lower ENG
+ */
return(0);
}
@@ -337,22 +326,19 @@ loranread(dev_t dev, struct uio * uio, int ioflag)
u_long ef;
struct datapoint *this;
int err, c;
- int idx;
-
- idx = minor(dev);
if (loranerror) {
printf("Loran0: %s", lorantext);
return(EIO);
}
- if (TAILQ_EMPTY(&minors[idx]))
- tsleep ((caddr_t)&minors[idx], PZERO + 8 |PCATCH, "loranrd", hz*2);
- if (TAILQ_EMPTY(&minors[idx]))
+ if (TAILQ_EMPTY(&qdone))
+ tsleep ((caddr_t)&qdone, PZERO + 8 |PCATCH, "loranrd", hz*2);
+ if (TAILQ_EMPTY(&qdone))
return(0);
- this = TAILQ_FIRST(&minors[idx]);
+ this = TAILQ_FIRST(&qdone);
ef = read_eflags();
disable_intr();
- TAILQ_REMOVE(&minors[idx], this, list);
+ TAILQ_REMOVE(&qdone, this, list);
write_eflags(ef);
c = imin(uio->uio_resid, (int)sizeof *this);
@@ -362,146 +348,92 @@ loranread(dev_t dev, struct uio * uio, int ioflag)
}
static void
-loranenqueue(struct datapoint *dp)
+loranenqueue(struct datapoint *this)
{
- struct datapoint *dpp, *dpn;
-
- while(dp) {
- /*
- * The first two elements on "working" are sacred,
- * they're already partly setup in hardware, so the
- * earliest slot we can use is #3
- */
- dpp = TAILQ_FIRST(&working);
- dpp = TAILQ_NEXT(dpp, list);
- dpn = TAILQ_NEXT(dpp, list);
- while (1) {
- /*
- * We cannot bump "dpp", so if "dp" overlaps it
- * skip a beat.
- * XXX: should use better algorithm ?
- */
- if (dpp->scheduled + PGUARD > dp->scheduled) {
- dp->scheduled += dp->fri;
- continue;
- }
-
- /*
- * If "dpn" will be done before "dp" wants to go,
- * we must look further down the list.
- */
- if (dpn && dpn->scheduled + PGUARD < dp->scheduled) {
- dpp = dpn;
- dpn = TAILQ_NEXT(dpp, list);
- continue;
- }
-
- /*
- * If at end of list, put "dp" there
- */
- if (!dpn) {
- TAILQ_INSERT_AFTER(&working, dpp, dp, list);
- break;
- }
-
- /*
- * If "dp" fits before "dpn", insert it there
- */
- if (dpn->scheduled > dp->scheduled + PGUARD) {
- TAILQ_INSERT_AFTER(&working, dpp, dp, list);
- break;
- }
-
- /*
- * If "dpn" is less important, bump it.
- */
- if (dp->priority < dpn->priority) {
- TAILQ_REMOVE(&working, dpn, list);
- TAILQ_INSERT_TAIL(&holding, dpn, list);
- dpn = TAILQ_NEXT(dpp, list);
- continue;
- }
-
- /*
- * "dpn" was more or equally important, "dp" must
- * take yet turn.
- */
- dp->scheduled += dp->fri;
- }
+ struct datapoint *p, *q;
+ u_long ef;
+ u_int64_t x;
+
+ if (this->scheduled < ticker) {
+ x = (ticker - this->scheduled) / (2 * this->gri);
+ this->scheduled += x * 2 * this->gri;
+ }
+
+ ef = read_eflags();
+ disable_intr();
- do {
- /*
- * If anything was bumped, put it back as best we can
- */
- if (TAILQ_EMPTY(&holding)) {
- dp = 0;
- break;
- }
- dp = TAILQ_FIRST(&holding);
- TAILQ_REMOVE(&holding, dp, list);
- if (dp->home) {
- if (!--dp->bounce) {
- TAILQ_INSERT_TAIL(dp->home, dp, list);
- wakeup((caddr_t)dp->home);
- dp = 0;
- }
- }
- } while (!dp);
+ p = TAILQ_FIRST(&qready);
+ while (1) {
+ while (this->scheduled < p->scheduled + PGUARD)
+ this->scheduled += 2 * this->gri;
+ q = TAILQ_NEXT(p, list);
+ if (!q) {
+ this->delay = this->scheduled - p->scheduled - GRI;
+ TAILQ_INSERT_TAIL(&qready, this, list);
+ break;
+ }
+ if (this->scheduled + PGUARD < q->scheduled) {
+ this->delay = this->scheduled - p->scheduled - GRI;
+ TAILQ_INSERT_BEFORE(q, this, list);
+ q->delay = q->scheduled - this->scheduled - GRI;
+ break;
+ }
+ p = q;
}
+ write_eflags(ef);
}
static int
loranwrite(dev_t dev, struct uio * uio, int ioflag)
{
- u_long ef;
int err = 0, c;
struct datapoint *this;
- int idx;
- u_int64_t dt;
-
- idx = minor(dev);
MALLOC(this, struct datapoint *, sizeof *this, M_LORAN, M_WAITOK);
c = imin(uio->uio_resid, (int)sizeof *this);
err = uiomove((caddr_t)this, c, uio);
- if (!err && this->fri == 0)
+ if (!err && this->gri == 0)
err = EINVAL;
- /* XXX more checks */
- this->home = &minors[idx];
- this->priority = idx;
- if (ticker > this->scheduled) {
- dt = ticker - this->scheduled;
- dt -= dt % this->fri;
- this->scheduled += dt;
- }
if (!err) {
- ef = read_eflags();
- disable_intr();
loranenqueue(this);
- write_eflags(ef);
- if (this->vco >= 0)
- vco_want = this->vco;
+ vco_should = this->vco;
} else {
FREE(this, M_LORAN);
}
return(err);
}
-static void
+void
loranintr(int unit)
{
u_long ef;
int status = 0, count = 0, i;
- struct datapoint *this, *next;
- int delay;
ef = read_eflags();
disable_intr();
- this = TAILQ_FIRST(&working);
- TAILQ_REMOVE(&working, this, list);
+ if (this != &dummy) {
+ outb(TGC, DSABDPS);
+ outb(TGC, TG_LOADDP + 0x12); /* hold counter #2 */
+ this->remain = -1;
+ i = 2;
+ for (i = 0; i < 2; i++) {
+ count = this->remain;
+ do {
+ outb(TGC, TG_SAVE + 0x12);
+ this->remain = inb(TGD) & 0xff;
+ this->remain |= inb(TGD) << 8;
+ } while (count == this->remain);
+ }
+ lorantc_magic = 1;
+ nanotime(&this->actual);
+ lorantc_magic = 0;
+ outb(TGC, TG_LOADDP + 0x0a);
+ this->count = inb(TGD);
+ this->count |= inb(TGD) << 8;
+ LOAD_9513(0x12, GRI)
+ }
- nanotime(&this->when);
this->ssig = inb(ADC);
par &= ~(ENG | IEN);
@@ -522,20 +454,30 @@ loranintr(int unit)
outb(ADC, ADC_S);
this->epoch = ticker;
- this->vco = vco_is;
- if (this->home) {
- TAILQ_INSERT_TAIL(this->home, this, list);
- wakeup((caddr_t)this->home);
- } else {
- loranenqueue(this);
+ if (this != &dummy) {
+ TAILQ_INSERT_TAIL(&qdone, this, list);
+ wakeup((caddr_t)&qdone);
}
- this = TAILQ_FIRST(&working);
- next = TAILQ_NEXT(this, list);
-
- delay = next->scheduled - this->scheduled;
- delay -= GRI;
+ if (next != &dummy || TAILQ_NEXT(next, list))
+ TAILQ_REMOVE(&qready, next, list);
+
+ this = next;
+ ticker += GRI;
+ ticker += this->delay;
+
+ next = TAILQ_FIRST(&qready);
+ if (!next) {
+ next = &dummy;
+ TAILQ_INSERT_HEAD(&qready, next, list);
+ } else if (next->delay + GRI > PGUARD * 2) {
+ next->delay -= PGUARD;
+ next = &dummy;
+ TAILQ_INSERT_HEAD(&qready, next, list);
+ }
+ if (next == &dummy)
+ next->scheduled = ticker + GRI + next->delay;
/* load this->params */
par &= ~(INTEG|GATE);
@@ -545,7 +487,7 @@ loranintr(int unit)
outb(CODE, this->code);
- LOAD_9513(0x0a, delay);
+ LOAD_9513(0x0a, next->delay);
/*
* We need to load this from the opposite register * due to some
@@ -557,17 +499,10 @@ loranintr(int unit)
outb(TGC, TG_LOADARM + 0x08);
LOAD_9513(0x14, this->width);
- vco_error += ((vco_is << VCO_SHIFT) - vco_should) * (ticker - vco_when);
- vco_should = vco_want;
- i = vco_should >> VCO_SHIFT;
- if (vco_error < 0)
- i++;
-
- if (vco_is != i) {
- LOAD_DAC(DACA, i);
- vco_is = i;
+ if (vco_is != vco_should) {
+ LOAD_DAC(DACA, vco_should);
+ vco_is = vco_should;
}
- vco_when = ticker;
this->status = inb(TGC);
#if 1
@@ -587,13 +522,15 @@ loranintr(int unit)
outb(PAR, par);
if (status) {
- snprintf(lorantext, sizeof(lorantext),
- "Missed: %02x %d %d this:%p next:%p (dummy=%p)\n",
- status, count, delay, this, next, &dummy);
+ sprintf(lorantext, "Missed: %02x %d %d this:%p next:%p (dummy=%p)\n",
+ status, count, next->delay, this, next, &dummy);
+ loranerror = 1;
+ }
+ if (next->delay < PGUARD - GRI) {
+ sprintf(lorantext, "Bogus: %02x %d %d\n",
+ status, count, next->delay);
loranerror = 1;
}
-
- ticker = this->scheduled;
write_eflags(ef);
}
@@ -605,11 +542,13 @@ loran_get_timecount(struct timecounter *tc)
{
unsigned count;
u_long ef;
+ u_int high, low;
ef = read_eflags();
disable_intr();
- outb(TGC, TG_SAVE + 0x10); /* save counter #5 */
+ if (!lorantc_magic)
+ outb(TGC, TG_SAVE + 0x10); /* save counter #5 */
outb(TGC, TG_LOADDP +0x15); /* hold counter #5 */
count = inb(TGD);
count |= inb(TGD) << 8;
@@ -618,7 +557,7 @@ loran_get_timecount(struct timecounter *tc)
return (count);
}
-static struct timecounter loran_timecounter = {
+static struct timecounter loran_timecounter[3] = {
loran_get_timecount, /* get_timecount */
0, /* no pps_poll */
0xffff, /* counter_mask */
@@ -627,7 +566,7 @@ static struct timecounter loran_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, loran_timecounter, CTLFLAG_RD,
- &loran_timecounter, sizeof(loran_timecounter), "S,timecounter", "");
+ loran_timecounter, sizeof(loran_timecounter), "S,timecounter", "");
/**********************************************************************/
diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c
index 2b5615817eaf..d9e1592c9ade 100644
--- a/sys/i386/isa/lpt.c
+++ b/sys/i386/isa/lpt.c
@@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
- * $Id: lpt.c,v 1.71 1998/10/22 05:58:39 bde Exp $
+ * $Id: lpt.c,v 1.69 1998/06/07 17:10:44 dfr Exp $
*/
/*
@@ -189,12 +189,9 @@
#ifndef DEBUG
-#define lprintf(args)
+#define lprintf (void)
#else
-#define lprintf(args) do { \
- if (lptflag) \
- printf args; \
- } while (0)
+#define lprintf if (lptflag) printf
static int volatile lptflag = 1;
#endif
@@ -262,7 +259,6 @@ static struct lpt_softc {
static timeout_t lptout;
static int lptprobe (struct isa_device *dvp);
static int lptattach (struct isa_device *isdp);
-static ointhand2_t lptintr;
#ifdef INET
@@ -318,8 +314,8 @@ lpt_port_test (int port, u_char data, u_char mask)
temp = inb(port) & mask;
}
while (temp != data && --timeout);
- lprintf(("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
- port, data, temp, timeout));
+ lprintf("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
+ port, data, temp, timeout);
return (temp == data);
}
@@ -426,7 +422,6 @@ lptattach(struct isa_device *isdp)
struct lpt_softc *sc;
int unit;
- isdp->id_ointr = lptintr;
unit = isdp->id_unit;
sc = lpt_sc + unit;
sc->sc_port = isdp->id_iobase;
@@ -434,7 +429,7 @@ lptattach(struct isa_device *isdp)
outb(sc->sc_port+lpt_control, LPC_NINIT);
/* check if we can use interrupt */
- lprintf(("oldirq %x\n", sc->sc_irq));
+ lprintf("oldirq %x\n", sc->sc_irq);
if (isdp->id_irq) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf("lpt%d: Interrupt-driven port\n", unit);
@@ -443,9 +438,9 @@ lptattach(struct isa_device *isdp)
#endif
} else {
sc->sc_irq = 0;
- lprintf(("lpt%d: Polled port\n", unit));
+ lprintf("lpt%d: Polled port\n", unit);
}
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
#ifdef DEVFS
/* XXX what to do about the flags in the minor number? */
@@ -483,7 +478,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
#endif
if (sc->sc_state) {
- lprintf(("lp: still open %x\n", sc->sc_state));
+ lprintf("lp: still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= INIT;
@@ -497,7 +492,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
}
s = spltty();
- lprintf(("lp flags 0x%x\n", sc->sc_flags));
+ lprintf("lp flags 0x%x\n", sc->sc_flags);
port = sc->sc_port;
/* set IRQ status according to ENABLE_IRQ flag */
@@ -524,7 +519,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- lprintf(("status %x\n", inb(port+lpt_status)));
+ lprintf ("status %x\n", inb(port+lpt_status) );
return (EBUSY);
}
@@ -556,14 +551,14 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
splx(s);
/* only use timeout if using interrupt */
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- lprintf(("opened.\n"));
+ lprintf("opened.\n");
return(0);
}
@@ -573,7 +568,7 @@ lptout (void *arg)
struct lpt_softc *sc = arg;
int pl;
- lprintf(("T %x ", inb(sc->sc_port+lpt_status)));
+ lprintf ("T %x ", inb(sc->sc_port+lpt_status));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -630,7 +625,7 @@ lptclose(dev_t dev, int flags, int fmt, struct proc *p)
end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- lprintf(("closed.\n"));
+ lprintf("closed.\n");
return(0);
}
@@ -649,7 +644,7 @@ pushbytes(struct lpt_softc * sc)
char ch;
int port = sc->sc_port;
- lprintf(("p"));
+ lprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -720,16 +715,16 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- lprintf(("i"));
+ lprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- lprintf(("\nC %d. ", sc->sc_xfercnt));
+ lprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
lptintr(sc - lpt_sc);
(void) splx(pl);
}
- lprintf(("W "));
+ lprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep ((caddr_t)sc,
LPPRI|PCATCH, "lpwrite", 0))) {
@@ -739,7 +734,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
}
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- lprintf(("p"));
+ lprintf("p");
if((err = pushbytes(sc)))
return(err);
}
@@ -754,7 +749,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
* do checking for interrupted write call.
*/
-static void
+void
lptintr(int unit)
{
struct lpt_softc *sc = lpt_sc + unit;
@@ -784,7 +779,7 @@ lptintr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*lprintf(("%x ", *sc->sc_cp)); */
+ /*lprintf("%x ", *sc->sc_cp); */
outb(port+lpt_data, *sc->sc_cp++) ;
outb(port+lpt_control, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -801,7 +796,7 @@ lptintr(int unit)
sc->sc_state &= ~OBUSY;
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- lprintf(("w "));
+ lprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -809,7 +804,7 @@ lptintr(int unit)
sc->sc_state |= ERROR;
/* lptout() will jump in and try to restart. */
}
- lprintf(("sts %x ", sts));
+ lprintf("sts %x ", sts);
}
static int
@@ -992,7 +987,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- lprintf(("LP:ioctl(0x%lx)\n", cmd));
+ lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
}
return 0;
@@ -1089,7 +1084,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1138,7 +1133,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1160,7 +1155,7 @@ lpintr (int unit)
err:
outb(lpt_data_port, 0);
- lprintf(("R"));
+ lprintf("R");
sc->sc_if.if_ierrors++;
sc->sc_iferrs++;
@@ -1224,7 +1219,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (ifp->if_flags & IFF_LINK0) {
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1284,7 +1279,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
nend:
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1293,7 +1288,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
(void) splx(s);
@@ -1301,7 +1296,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
}
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1326,7 +1321,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1354,7 +1349,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
diff --git a/sys/i386/isa/matcd/audio.c b/sys/i386/isa/matcd/audio.c
index b395fb410645..a7891cb12362 100644
--- a/sys/i386/isa/matcd/audio.c
+++ b/sys/i386/isa/matcd/audio.c
@@ -213,7 +213,7 @@ static int matcd_pause(int ldrive, int cdrive, int controller, int action)
} /*<14>*/
unlockbus(controller, ldrive); /*<16>Release bus*/
- if ((z & MATCD_ST_AUDIOBSY) == 0 && /*<14>If drive is idle*/
+ if (z & MATCD_ST_AUDIOBSY==0 && /*<14>If drive is idle*/
cd->status==CD_AS_PLAY_IN_PROGRESS) { /*<14>but was playing*/
cd->status=CD_AS_PLAY_COMPLETED; /*<14>then its done*/
return(0);
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 4f1943a589f9..adc8f8f1b73c 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
/* The proceeding strings may not be changed*/
-/* $Id: matcd.c,v 1.36 1998/07/15 10:11:21 bde Exp $ */
+/* $Id: matcd.c,v 1.35 1998/07/04 22:30:20 julian Exp $ */
/*---------------------------------------------------------------------------
Include declarations
@@ -437,7 +437,7 @@ static struct matcd_data {
void *rlc_devfs_token;
void *la_devfs_token;
void *lc_devfs_token;
-#endif /* DEVFS */
+#endif DEVFS
} matcd_data[TOTALDRIVES];
@@ -2445,7 +2445,7 @@ static int matcd_toc_entries(int ldrive, int cdrive, int controller,
struct cd_toc_entry *to;
int len,trk,i,z,port;
unsigned char cmd[MAXCMDSIZ];
- unsigned char data[8];
+ unsigned char data[5];
cd=&matcd_data[ldrive];
port=cd->iobase;
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index a24a79fca7aa..0e3bd17eaae9 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.100 1998/07/13 09:53:01 bde Exp $
+ * $Id: mcd.c,v 1.99 1998/07/04 22:30:17 julian Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -178,7 +178,6 @@ static int mcd_send(int unit, int cmd,int nretrys);
static void hsg2msf(int hsg, bcd_t *msf);
static int msf2hsg(bcd_t *msf, int relative);
static int mcd_volinfo(int unit);
-static ointhand2_t mcdintr;
static int mcd_waitrdy(int port,int dly);
static timeout_t mcd_timeout;
static void mcd_doread(int state, struct mcd_mbx *mbxin);
@@ -250,7 +249,6 @@ int mcd_attach(struct isa_device *dev)
int unit = dev->id_unit;
struct mcd_data *cd = mcd_data + unit;
- dev->id_ointr = mcdintr;
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
@@ -979,7 +977,7 @@ mcd_volinfo(int unit)
return EINVAL;
}
-static void
+void
mcdintr(unit)
int unit;
{
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index 6579de2d6a2a..d907e4c0ac8e 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.38 1998/06/07 17:10:47 dfr Exp $
+ * $Id: mse.c,v 1.37 1998/01/24 02:54:22 eivind Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -87,7 +87,6 @@ static struct cdevsw mse_cdevsw =
mseioctl, nostop, nullreset, nodevtotty,/* mse */
msepoll, nommap, NULL, "mse", NULL, -1 };
-static ointhand2_t mseintr;
/*
* Software control structure for mouse. The sc_enablemouse(),
@@ -258,7 +257,6 @@ mseattach(idp)
int unit = idp->id_unit;
struct mse_softc *sc = &mse_sc[unit];
- idp->id_ointr = mseintr;
sc->sc_port = idp->id_iobase;
sc->mode.accelfactor = (idp->id_flags & MSE_CONFIG_ACCEL) >> 4;
#ifdef DEVFS
@@ -548,7 +546,7 @@ msepoll(dev, events, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
-static void
+void
mseintr(unit)
int unit;
{
diff --git a/sys/i386/isa/ncr5380.c b/sys/i386/isa/ncr5380.c
new file mode 100644
index 000000000000..e8978372bd01
--- /dev/null
+++ b/sys/i386/isa/ncr5380.c
@@ -0,0 +1,1536 @@
+/*
+ * FreeBSD generic NCR-5380/NCR-53C400 SCSI driver
+ *
+ * Copyright (C) 1994 Serge Vakulenko (vak@cronyx.ru)
+ *
+ * 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 DEVELOPERS ``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 DEVELOPERS 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.
+ */
+
+/*
+ * Tested on the following hardware:
+ * Adapter: Trantor T130
+ * Streamer: Archive Viper 150,
+ * CD-ROM: NEC CDR-25
+ */
+#undef DEBUG
+
+#include "nca.h"
+#if NNCA > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/ic/ncr5380.h>
+#include <i386/isa/ic/ncr53400.h>
+
+#include <scsi/scsiconf.h>
+
+#ifdef DEBUG
+# define PRINT(s) printf s
+#else
+# define PRINT(s) /*void*/
+#endif
+
+#define SCB_TABLE_SIZE 8 /* start with 8 scb entries in table */
+#define BLOCK_SIZE 512 /* size of READ/WRITE areas on SCSI card */
+#define HOST_SCSI_ADDR 7 /* address of the adapter on the SCSI bus */
+
+/*
+ * Defice config flags
+ */
+#define FLAG_NOPARITY 0x01 /* disable SCSI bus parity check */
+
+/*
+ * ProAudioSpectrum registers
+ */
+#define PAS16_DATA 8 /* Data Register */
+#define PAS16_STAT 9 /* Status Register */
+#define PAS16_STAT_DREQ 0x80 /* Pseudo-DMA ready bit */
+#define PAS16_REG(r) (((r) & 0xc) << 11 | ((r) & 3))
+
+static u_char pas16_irq_magic[] =
+ { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 };
+
+/*
+ * SCSI bus phases
+ */
+#define PHASE_MASK (CSBR_MSG | CSBR_CD | CSBR_IO)
+#define PHASE_DATAOUT 0
+#define PHASE_DATAIN CSBR_IO
+#define PHASE_CMDOUT CSBR_CD
+#define PHASE_STATIN (CSBR_CD | CSBR_IO)
+#define PHASE_MSGOUT (CSBR_MSG | CSBR_CD)
+#define PHASE_MSGIN (CSBR_MSG | CSBR_CD | CSBR_IO)
+#define PHASE_NAME(ph) phase_name[(ph)>>2]
+#define PHASE_TO_TCR(ph) ((ph) >> 2)
+
+static char *phase_name[] = {
+ "DATAOUT", "DATAIN", "CMDOUT", "STATIN",
+ "Phase4?", "Phase5?", "MSGOUT", "MSGIN",
+};
+
+/*
+ * SCSI message codes
+ */
+#define MSG_COMMAND_COMPLETE 0x00
+#define MSG_SAVE_POINTERS 0x02
+#define MSG_RESTORE_POINTERS 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_ABORT 0x06
+#define MSG_MESSAGE_REJECT 0x07
+#define MSG_NOP 0x08
+#define MSG_BUS_DEV_RESET 0x0c
+#define MSG_IDENTIFY(lun) (0xc0 | ((lun) & 0x7))
+#define MSG_ISIDENT(m) ((m) & 0x80)
+
+/*
+ * SCSI control block used to keep info about a scsi command
+ */
+typedef struct scb {
+ int flags; /* status of the instruction */
+#define SCB_FREE 0x00
+#define SCB_ACTIVE 0x01
+#define SCB_ABORTED 0x02
+#define SCB_TIMEOUT 0x04
+#define SCB_ERROR 0x08
+#define SCB_TIMECHK 0x10 /* we have set a timeout on this one */
+#define SCB_SENSE 0x20 /* sensed data available */
+#define SCB_TBUSY 0x40 /* target busy */
+ struct scb *next; /* in free list */
+ struct scsi_xfer *xfer; /* the scsi_xfer for this cmd */
+ u_char *data; /* position in data buffer so far */
+ int32_t datalen; /* bytes remaining to transfer */
+} scb_t;
+
+typedef enum {
+ CTLR_NONE,
+ CTLR_NCR_5380,
+ CTLR_NCR_53C400,
+ CTLR_PAS_16
+} ctlr_t;
+
+/*
+ * Data structure describing the target state.
+ */
+typedef struct {
+ u_char busy; /* mask of busy luns at device target */
+ u_long perrcnt; /* counter of target parity errors */
+} target_t;
+
+/*
+ * Data structure describing current status of the scsi bus. One for each
+ * controller card.
+ */
+typedef struct {
+ ctlr_t type; /* Seagate or Future Domain */
+ char *name; /* adapter name */
+
+ /* NCR-5380 controller registers */
+ u_short ODR; /* (wo-0) Output Data Register */
+ u_short CSDR; /* (ro-0) Current SCSI Data Register */
+ u_short ICR; /* (rw-1) Initiator Command Register */
+ u_short MR; /* (rw-2) Mode Register */
+ u_short TCR; /* (rw-3) Target Command Register */
+ u_short SER; /* (wo-4) Select Enable Register */
+ u_short CSBR; /* (ro-4) Current SCSI Bus Status Register */
+ u_short BSR; /* (ro-5) Bus and Status Register */
+ u_short SDSR; /* (wo-5) Start DMA Send Register */
+ u_short SDIR; /* (wo-7) Start DMA Initiator Receive Register */
+ u_short RPIR; /* (ro-7) Reset Parity/Interrupt Register */
+
+ /* NCR-53C400 controller registers */
+ u_short CSR; /* (rw-0) Control and Status Register */
+ u_short CCR; /* (rw-1) Clock Counter Register */
+ u_short HBR; /* (rw-4) Host Buffer Register */
+
+ /* ProAudioSpectrum controller registers */
+ u_short PDATA; /* (rw) Pseudo-DMA Data Register */
+ u_short PSTAT; /* (rw) Pseudo-DMA Status Register */
+
+ u_char scsi_addr; /* our scsi address, 0..7 */
+ u_char scsi_id; /* our scsi id mask */
+ u_char parity; /* parity flag: CMD_EN_PARITY or 0 */
+ u_char irq; /* IRQ number used or 0 if no IRQ */
+ u_int timeout_active : 1; /* timeout() active (requested) */
+
+ struct scsi_link sc_link; /* struct connecting different data */
+ scb_t *queue; /* waiting to be issued */
+ scb_t *disconnected_queue; /* waiting to reconnect */
+
+ int numscb; /* number of scsi control blocks */
+ scb_t *free_scb; /* free scb list */
+ scb_t scbs[SCB_TABLE_SIZE];
+
+ target_t target[8]; /* target state data */
+} adapter_t;
+
+static adapter_t ncadata[NNCA];
+
+#define IS_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &\
+ (1 << (b)->xfer->sc_link->lun))
+#define SET_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy |=\
+ (1 << (b)->xfer->sc_link->lun))
+#define CLEAR_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &=\
+ ~(1 << (b)->xfer->sc_link->lun))
+
+/*
+ * Wait for condition, given as an boolean expression.
+ * Print the message on timeout.
+ */
+#define WAITFOR(condition,count,message) {\
+ register u_long cnt = count; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("nca: %s timeout\n", _msg); }
+
+static int nca_probe (struct isa_device *dev);
+static int nca_attach (struct isa_device *dev);
+static int32_t nca_scsi_cmd (struct scsi_xfer *xs);
+static u_int32_t nca_adapter_info (int unit);
+static void nca_timeout (void *scb);
+static void ncaminphys (struct buf *bp);
+static void nca_done (adapter_t *z, scb_t *scb);
+static void nca_start (adapter_t *z);
+static void nca_information_transfer (adapter_t *z, scb_t *scb);
+static int nca_poll (adapter_t *z, scb_t *scb);
+static int nca_init (adapter_t *z);
+static int nca_reselect (adapter_t *z);
+static int nca_select (adapter_t *z, scb_t *scb);
+static int nca_abort (adapter_t *z, scb_t *scb);
+static void nca_send_abort (adapter_t *z);
+static u_char nca_msg_input (adapter_t *z);
+static void nca_tick (void *arg);
+static int nca_sense (adapter_t *z, scb_t *scb);
+static void nca_data_output (adapter_t *z, u_char **pdata, u_long *plen);
+static void nca_data_input (adapter_t *z, u_char **pdata, u_long *plen);
+static void nca_cmd_output (adapter_t *z, u_char *cmd, int cmdlen);
+static void nca_53400_dma_xfer (adapter_t *z, int r, u_char **dat, u_long *len);
+static void nca_pas_dma_xfer (adapter_t *z, int r, u_char **dat, u_long *len);
+
+static struct scsi_adapter nca_switch = {
+ nca_scsi_cmd, ncaminphys, 0, 0, nca_adapter_info, "nca", {0},
+};
+static struct scsi_device nca_dev = { NULL, NULL, NULL, NULL, "nca", 0, {0} };
+struct isa_driver ncadriver = { nca_probe, nca_attach, "nca" };
+
+/*
+ * Check if the device can be found at the port given and if so,
+ * detect the type of board. Set it up ready for further work.
+ * Takes the isa_dev structure from autoconf as an argument.
+ * Returns 1 if card recognized, 0 if errors.
+ */
+int nca_probe (struct isa_device *dev)
+{
+ adapter_t *z = &ncadata[dev->id_unit];
+ int i;
+
+ /* Init fields used by our routines */
+ z->parity = (dev->id_flags & FLAG_NOPARITY) ? 0 :
+ MR_ENABLE_PARITY_CHECKING;
+ z->scsi_addr = HOST_SCSI_ADDR;
+ z->scsi_id = 1 << z->scsi_addr;
+ z->irq = dev->id_irq ? ffs (dev->id_irq) - 1 : 0;
+ z->queue = 0;
+ z->disconnected_queue = 0;
+ for (i=0; i<8; i++)
+ z->target[i].busy = 0;
+
+ /* Link up the free list of scbs */
+ z->numscb = SCB_TABLE_SIZE;
+ z->free_scb = z->scbs;
+ for (i=1; i<SCB_TABLE_SIZE; i++)
+ z->scbs[i-1].next = z->scbs + i;
+ z->scbs[SCB_TABLE_SIZE-1].next = 0;
+
+ /* Try NCR 5380. */
+ z->type = CTLR_NCR_5380;
+ z->name = "NCR-5380";
+ z->ODR = dev->id_iobase + C80_ODR;
+ z->CSDR = dev->id_iobase + C80_CSDR;
+ z->ICR = dev->id_iobase + C80_ICR;
+ z->MR = dev->id_iobase + C80_MR;
+ z->TCR = dev->id_iobase + C80_TCR;
+ z->SER = dev->id_iobase + C80_SER;
+ z->CSBR = dev->id_iobase + C80_CSBR;
+ z->BSR = dev->id_iobase + C80_BSR;
+ z->SDSR = dev->id_iobase + C80_SDSR;
+ z->SDIR = dev->id_iobase + C80_SDIR;
+ z->RPIR = dev->id_iobase + C80_RPIR;
+ z->CSR = 0;
+ z->CCR = 0;
+ z->HBR = 0;
+ z->PDATA = 0;
+ z->PSTAT = 0;
+ if (nca_init (z) == 0)
+ return (8);
+
+ /* Try NCR 53C400. */
+ z->type = CTLR_NCR_53C400;
+ z->name = "NCR-53C400";
+ z->ODR = dev->id_iobase + C400_5380_REG_OFFSET + C80_ODR;
+ z->CSDR = dev->id_iobase + C400_5380_REG_OFFSET + C80_CSDR;
+ z->ICR = dev->id_iobase + C400_5380_REG_OFFSET + C80_ICR;
+ z->MR = dev->id_iobase + C400_5380_REG_OFFSET + C80_MR;
+ z->TCR = dev->id_iobase + C400_5380_REG_OFFSET + C80_TCR;
+ z->SER = dev->id_iobase + C400_5380_REG_OFFSET + C80_SER;
+ z->CSBR = dev->id_iobase + C400_5380_REG_OFFSET + C80_CSBR;
+ z->BSR = dev->id_iobase + C400_5380_REG_OFFSET + C80_BSR;
+ z->SDSR = dev->id_iobase + C400_5380_REG_OFFSET + C80_SDSR;
+ z->SDIR = dev->id_iobase + C400_5380_REG_OFFSET + C80_SDIR;
+ z->RPIR = dev->id_iobase + C400_5380_REG_OFFSET + C80_RPIR;
+ z->CSR = dev->id_iobase + C400_CSR;
+ z->CCR = dev->id_iobase + C400_CCR;
+ z->HBR = dev->id_iobase + C400_HBR;
+ z->PDATA = 0;
+ z->PSTAT = 0;
+ if (nca_init (z) == 0)
+ return (16);
+
+ /* Try ProAudioSpectrum-16. */
+ z->type = CTLR_PAS_16;
+ z->name = "ProAudioSpectrum"; /* changed later */
+ z->ODR = dev->id_iobase ^ PAS16_REG (C80_ODR);
+ z->CSDR = dev->id_iobase ^ PAS16_REG (C80_CSDR);
+ z->ICR = dev->id_iobase ^ PAS16_REG (C80_ICR);
+ z->MR = dev->id_iobase ^ PAS16_REG (C80_MR);
+ z->TCR = dev->id_iobase ^ PAS16_REG (C80_TCR);
+ z->SER = dev->id_iobase ^ PAS16_REG (C80_SER);
+ z->CSBR = dev->id_iobase ^ PAS16_REG (C80_CSBR);
+ z->BSR = dev->id_iobase ^ PAS16_REG (C80_BSR);
+ z->SDSR = dev->id_iobase ^ PAS16_REG (C80_SDSR);
+ z->SDIR = dev->id_iobase ^ PAS16_REG (C80_SDIR);
+ z->RPIR = dev->id_iobase ^ PAS16_REG (C80_RPIR);
+ z->CSR = 0;
+ z->CCR = 0;
+ z->HBR = 0;
+ z->PDATA = dev->id_iobase ^ PAS16_REG (PAS16_DATA);
+ z->PSTAT = dev->id_iobase ^ PAS16_REG (PAS16_STAT);
+ if (nca_init (z) == 0)
+ return (4);
+
+ bzero (z, sizeof (*z));
+ return (0);
+}
+
+/*
+ * Probe the adapter, and if found, reset the board and the scsi bus.
+ * Return 0 if the adapter found.
+ */
+int nca_init (adapter_t *z)
+{
+ int i, c;
+
+ if (z->type == CTLR_NCR_53C400) {
+ if (inb (z->CSR) == 0xFF)
+ return (100);
+
+ /* Reset 53C400. */
+ outb (z->CSR, CSR_5380_ENABLE);
+
+ /* Enable interrupts. */
+ outb (z->CSR, z->irq ? CSR_5380_INTR : 0);
+ }
+
+ if (z->type == CTLR_PAS_16) {
+ u_short base = z->PDATA & 0x3FF;
+
+ outb (0x9a01, 0xbc + (z-ncadata)); /* unit number */
+ outb (0x9a01, base >> 2);
+
+ if (inb (base^0x803) == 0xFF)
+ return (200);
+
+ if (inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF)
+ return (201);
+
+ i = inb (base^0x803);
+ outb (base^0x803, i ^ 0xE0);
+ c = inb (base^0x803);
+ outb (base^0x803, 1);
+ if (i != c)
+ return (202);
+
+ /* Various magic. */
+ outb (base^0x4000, 0x30); /* Timeout counter */
+ outb (base^0x4001, 0x01); /* Reset TC */
+ outb (base^0xbc00, 0x01); /* 1 Wait state */
+ outb (base^0x8003, 0x4d); /* sysconfig_4 */
+ i = pas16_irq_magic[z->irq];
+ if (!i) {
+ z->irq = 0;
+ } else {
+ outb (base^0xf002, i << 4);
+ outb (base^0x8003, 0x6d); /* sysconfig_4 */
+ }
+
+ switch (inb (base^0xEC03) & 0xF) {
+ case 6: z->name = "ProAudioSpectrum-Plus"; break;
+ case 12: z->name = "ProAudioSpectrum-16D"; break;
+ case 14: z->name = "ProAudioSpectrum-CDPC"; break;
+ case 15: z->name = "ProAudioSpectrum-16"; break;
+ default: return (203);
+ }
+ }
+
+ /* Read RPI port, resetting parity/interrupt state. */
+ inb (z->RPIR);
+
+ /* Test BSR: parity error, interrupt request and busy loss state
+ * should be cleared. */
+ if (inb (z->BSR) & (BSR_PARITY_ERROR |
+ BSR_INTERRUPT_REQUEST_ACTIVE | BSR_BUSY_ERROR)) {
+ PRINT (("nca: invalid bsr[0x%x]=%b\n", z->BSR,
+ inb (z->BSR), BSR_BITS));
+ return (1);
+ }
+
+ /* Reset the SCSI bus. */
+ outb (z->ICR, ICR_ASSERT_RST);
+ outb (z->ODR, 0);
+ /* Hold reset for at least 25 microseconds. */
+ DELAY (25);
+ /* Check that status cleared. */
+ if (inb (z->CSBR) != CSBR_RST) {
+ PRINT (("nca: invalid csbr[0x%x]=%b\n", z->CSBR,
+ inb (z->CSBR), CSBR_BITS));
+ outb (z->ICR, 0);
+ return (2);
+ }
+ /* Clear reset. */
+ outb (z->ICR, 0);
+ /* Wait a Bus Clear Delay (800 ns + bus free delay 800 ns). */
+ DELAY (2);
+
+ /* Enable data drivers. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+
+ /* Check that data register is writable. */
+ for (i=0; i<256; ++i) {
+ outb (z->ODR, i);
+ DELAY (1);
+ if (inb (z->CSDR) != i) {
+ PRINT (("nca: ODR[0x%x] not writable: 0x%x should be 0x%x\n",
+ z->ODR, inb (z->CSDR), i));
+ outb (z->ICR, 0);
+ return (3);
+ }
+ }
+
+ /* Disable data drivers. */
+ outb (z->ICR, 0);
+
+ /* Check that data register is NOT writable. */
+ c = inb (z->CSDR);
+ for (i=0; i<256; ++i) {
+ outb (z->ODR, i);
+ DELAY (1);
+ if (inb (z->CSDR) != c) {
+ PRINT (("nca: ODR[0x%x] writable: 0x%x should be 0x%x\n",
+ z->ODR, inb (z->CSDR), c));
+ return (4);
+ }
+ }
+
+ /* Initialize the controller. */
+ outb (z->MR, z->parity);
+ outb (z->TCR, 0);
+ outb (z->SER, z->scsi_id);
+ return (0);
+}
+
+/*
+ * Attach all sub-devices we can find.
+ */
+int nca_attach (struct isa_device *dev)
+{
+ int unit = dev->id_unit;
+ adapter_t *z = &ncadata[unit];
+ struct scsibus_data *scbus;
+
+ printf ("nca%d: type %s%s\n", unit, z->name,
+ (dev->id_flags & FLAG_NOPARITY) ? ", no parity" : "");
+
+ /* fill in the prototype scsi_link */
+ z->sc_link.adapter_unit = unit;
+ z->sc_link.adapter_targ = z->scsi_addr;
+ z->sc_link.adapter_softc = z;
+ z->sc_link.adapter = &nca_switch;
+ z->sc_link.device = &nca_dev;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &z->sc_link;
+
+ /* ask the adapter what subunits are present */
+ scsi_attachdevs (scbus);
+
+ return (1);
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities.
+ */
+u_int32_t nca_adapter_info (int unit)
+{
+ return (1);
+}
+
+void ncaminphys (struct buf *bp)
+{
+}
+
+/*
+ * Catch an interrupt from the adaptor.
+ */
+void ncaintr (int unit)
+{
+ adapter_t *z = &ncadata[unit];
+
+ PRINT (("nca%d: interrupt bsr=%b csbr=%b\n", unit,
+ inb (z->BSR), BSR_BITS, inb (z->CSBR), CSBR_BITS));
+ nca_start (z);
+ /* Reset interrupt state. */
+ inb (z->RPIR);
+}
+
+/*
+ * This routine is used in the case when we have no IRQ line (z->irq == 0).
+ * It is called every timer tick and polls for reconnect from target.
+ */
+void nca_tick (void *arg)
+{
+ adapter_t *z = arg;
+ int x = splbio ();
+
+ z->timeout_active = 0;
+ nca_start (z);
+ /* Reset interrupt state. */
+ inb (z->RPIR);
+ if (z->disconnected_queue && ! z->timeout_active) {
+ timeout (nca_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ splx (x);
+}
+
+/*
+ * Start a scsi operation given the command and the data address.
+ * Also needs the unit, target and lu. Get a free scb and set it up.
+ * Call send_scb. Either start timer or wait until done.
+ */
+int32_t nca_scsi_cmd (struct scsi_xfer *xs)
+{
+ int unit = xs->sc_link->adapter_unit, flags = xs->flags, x = 0;
+ adapter_t *z = (adapter_t *)xs->sc_link->adapter_softc;
+ scb_t *scb;
+
+ /* PRINT (("nca%d/%d/%d command 0x%x\n", unit, xs->sc_link->target,
+ xs->sc_link->lun, xs->cmd->opcode)); */
+ if (xs->bp)
+ flags |= SCSI_NOSLEEP;
+ if (flags & ITSDONE) {
+ printf ("nca%d: already done?", unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (! (flags & INUSE)) {
+ printf ("nca%d: not in use?", unit);
+ xs->flags |= INUSE;
+ }
+ if (flags & SCSI_RESET)
+ printf ("nca%d: SCSI_RESET not implemented\n", unit);
+
+ if (! (flags & SCSI_NOMASK))
+ x = splbio ();
+
+ /* Get a free scb.
+ * If we can and have to, sleep waiting for one to come free. */
+ while (! (scb = z->free_scb)) {
+ if (flags & SCSI_NOSLEEP) {
+ xs->error = XS_DRIVER_STUFFUP;
+ if (! (flags & SCSI_NOMASK))
+ splx (x);
+ return (TRY_AGAIN_LATER);
+ }
+ tsleep ((caddr_t)&z->free_scb, PRIBIO, "ncascb", 0);
+ }
+ /* Get scb from free list. */
+ z->free_scb = scb->next;
+ scb->next = 0;
+ scb->flags = SCB_ACTIVE;
+
+ /* Put all the arguments for the xfer in the scb */
+ scb->xfer = xs;
+ scb->datalen = xs->datalen;
+ scb->data = xs->data;
+
+ /* Setup the scb to contain necessary values.
+ * The interesting values can be read from the xs that is saved.
+ * I therefore think that the structure can be kept very small.
+ * The driver doesn't use DMA so the scatter/gather is not needed? */
+ if (! z->queue) {
+ scb->next = z->queue;
+ z->queue = scb;
+ } else {
+ scb_t *q;
+
+ for (q=z->queue; q->next; q=q->next)
+ continue;
+ q->next = scb;
+ scb->next = 0; /* placed at the end of the queue */
+ }
+
+ /* Try to send this command to the board. */
+ nca_start (z);
+
+ /* Usually return SUCCESSFULLY QUEUED. */
+ if (! (flags & SCSI_NOMASK)) {
+ splx (x);
+ if (xs->flags & ITSDONE)
+ /* Timeout timer not started, already finished.
+ * Tried to return COMPLETE but the machine hanged
+ * with this. */
+ return (SUCCESSFULLY_QUEUED);
+ xs->timeout_ch = timeout (nca_timeout, (caddr_t) scb,
+ (xs->timeout * hz) / 1000);
+ scb->flags |= SCB_TIMECHK;
+ PRINT (("nca%d/%d/%d command queued\n", unit,
+ xs->sc_link->target, xs->sc_link->lun));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /* If we can't use interrupts, poll on completion. */
+ if (! nca_poll (z, scb)) {
+ /* We timed out, so call the timeout handler manually,
+ * accounting for the fact that the clock is not running yet
+ * by taking out the clock queue entry it makes. */
+ nca_timeout ((void*) scb);
+
+ /* Because we are polling, take out the timeout entry
+ * nca_timeout made. */
+ untimeout (nca_timeout, (void*) scb, scb->xfer->timeout_ch);
+
+ if (! nca_poll (z, scb))
+ /* We timed out again... This is bad. Notice that
+ * this time there is no clock queue entry to remove. */
+ nca_timeout ((void*) scb);
+ }
+ /* PRINT (("nca%d/%d/%d command %s\n", unit,
+ xs->sc_link->target, xs->sc_link->lun,
+ xs->error ? "failed" : "done")); */
+ return (xs->error ? HAD_ERROR : COMPLETE);
+}
+
+/*
+ * Coroutine that runs as long as more work can be done.
+ * Both scsi_cmd() and intr() will try to start it in
+ * case it is not running.
+ * Always called with interrupts disabled.
+ */
+void nca_start (adapter_t *z)
+{
+ scb_t *q, *prev;
+again:
+ /* First check that if any device has tried
+ * a reconnect while we have done other things
+ * with interrupts disabled. */
+ if (nca_reselect (z))
+ goto again;
+
+ /* Search through the queue for a command
+ * destined for a target that's not busy. */
+ for (q=z->queue, prev=0; q; prev=q, q=q->next) {
+ /* Attempt to establish an I_T_L nexus here. */
+ if (IS_BUSY (z, q) || ! nca_select (z, q))
+ continue;
+
+ /* Remove the command from the issue queue. */
+ if (prev)
+ prev->next = q->next;
+ else
+ z->queue = q->next;
+ q->next = 0;
+
+ /* We are connected. Do the task. */
+ nca_information_transfer (z, q);
+ goto again;
+ }
+}
+
+void nca_timeout (void *arg)
+{
+ scb_t *scb = (scb_t*) arg;
+ int unit = scb->xfer->sc_link->adapter_unit;
+ adapter_t *z = (adapter_t *)scb->xfer->sc_link->adapter_softc;
+ int x = splbio ();
+
+ if (! (scb->xfer->flags & SCSI_NOMASK))
+ printf ("nca%d/%d/%d (%s%d) timed out\n", unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ scb->xfer->sc_link->device->name,
+ scb->xfer->sc_link->dev_unit);
+
+ /* If it has been through before, then a previous abort has failed,
+ * don't try abort again. */
+ if (! (scb->flags & SCB_ABORTED)) {
+ nca_abort (z, scb);
+ /* 2 seconds for the abort */
+ scb->xfer->timeout_ch = timeout (nca_timeout, (caddr_t)scb,
+ 2*hz);
+ scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
+ } else {
+ /* abort timed out */
+ scb->flags |= SCB_ABORTED;
+ scb->xfer->retries = 0;
+ nca_done (z, scb);
+ }
+ splx (x);
+}
+
+static __inline void nca_sendbyte (adapter_t *z, u_char data)
+{
+ outb (z->ODR, data);
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 10000, "sendbyte");
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+}
+
+static __inline u_char nca_recvbyte (adapter_t *z)
+{
+ u_char data;
+
+ data = inb (z->CSDR);
+ outb (z->ICR, ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 10000, "recvbyte");
+ outb (z->ICR, 0);
+ return (data);
+}
+
+/*
+ * Establish I_T_L or I_T_L_Q nexus for new or existing command
+ * including ARBITRATION, SELECTION, and initial message out
+ * for IDENTIFY and queue messages.
+ * Return 1 if selection succeded.
+ */
+int nca_select (adapter_t *z, scb_t *scb)
+{
+ /* Set the phase bits to 0, otherwise the NCR5380 won't drive the
+ * data bus during SELECTION. */
+ outb (z->TCR, 0);
+
+ /* Start arbitration. */
+ outb (z->ODR, z->scsi_id);
+ outb (z->MR, MR_ARBITRATE);
+
+ /* Wait for arbitration logic to complete (20 usec) */
+ WAITFOR (inb (z->ICR) & ICR_ARBITRATION_IN_PROGRESS, 200, 0);
+ if (! (inb (z->ICR) & ICR_ARBITRATION_IN_PROGRESS)) {
+ PRINT (("nca%d/%d/%d no arbitration progress, bsr=%b csbr=%b\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, inb (z->BSR), BSR_BITS,
+ inb (z->CSBR), CSBR_BITS));
+ outb (z->MR, z->parity);
+ return (0);
+ }
+ DELAY (3);
+
+ /* Check for lost arbitration. */
+ if ((inb (z->ICR) & ICR_LOST_ARBITRATION) ||
+ (inb (z->CSDR) >> 1 >> z->scsi_addr) ||
+ (inb (z->ICR) & ICR_LOST_ARBITRATION)) {
+ PRINT (("nca%d/%d/%d arbitration lost\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->MR, z->parity);
+ return (0);
+ }
+
+ outb (z->ICR, ICR_ASSERT_SEL);
+ if (inb (z->ICR) & ICR_LOST_ARBITRATION) {
+ PRINT (("nca%d/%d/%d arbitration lost after SEL\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->MR, z->parity);
+ return (0);
+ }
+ DELAY (2);
+
+ /* Start selection, asserting the host and target ID's on the bus. */
+ outb (z->SER, 0);
+ outb (z->ODR, z->scsi_id | (1 << scb->xfer->sc_link->target));
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_BSY |
+ ICR_ASSERT_SEL);
+
+ /* Finish arbitration, drop BSY. */
+ outb (z->MR, 0);
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_SEL |
+ ICR_ASSERT_ATN);
+ DELAY (1);
+
+ /* The SCSI specification calls for a 250 ms timeout for the actual
+ * selection. */
+ WAITFOR (inb (z->CSBR) & CSBR_BSY, 100000, 0);
+ if (! (inb (z->CSBR) & CSBR_BSY)) {
+ /* The target does not respond. Not an error, though. */
+ PRINT (("nca%d/%d/%d target does not respond\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_TIMEOUT;
+ return (0);
+ }
+
+ /* Clear SEL and SCSI id.
+ * Wait for start of REQ/ACK handshake. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_ATN);
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, 0);
+ if (! (inb (z->CSBR) & CSBR_REQ)) {
+ PRINT (("nca%d/%d/%d timeout waiting for REQ\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_ERROR;
+ return (0);
+ }
+
+ /* Check for phase mismatch. */
+ if ((inb (z->CSBR) & PHASE_MASK) != PHASE_MSGOUT) {
+ /* This should not be taken as an error, but more like
+ * an unsupported feature!
+ * Should set a flag indicating that the target don't support
+ * messages, and continue without failure.
+ * (THIS IS NOT AN ERROR!) */
+ PRINT (("nca%d/%d/%d waiting for MSGOUT: invalid phase %s\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ PHASE_NAME (inb (z->CSBR) & PHASE_MASK)));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_ERROR;
+ return (0);
+ }
+
+ /* Allow disconnects. */
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGOUT));
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, MSG_IDENTIFY (scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+
+ SET_BUSY (z, scb);
+ return (1);
+}
+
+int nca_reselect (adapter_t *z)
+{
+ scb_t *q = 0, *prev = 0;
+ u_char msg, target_mask, lun;
+again:
+ /* Wait for a device to win the reselection phase. */
+ /* Signals this by asserting the I/O signal. */
+ if ((inb (z->CSBR) & (CSBR_SEL | CSBR_IO | CSBR_BSY)) !=
+ (CSBR_SEL | CSBR_IO))
+ return (0);
+
+ /* The data bus contains original initiator id ORed with target id. */
+ /* See that we really are the initiator. */
+ target_mask = inb (z->CSDR);
+ if (! (target_mask & z->scsi_id)) {
+ PRINT (("nca%d reselect not for me: mask=0x%x, csbr=%b\n",
+ z->sc_link.adapter_unit, target_mask,
+ inb (z->CSBR), CSBR_BITS));
+ goto again;
+ }
+
+ /* Find target who won. */
+ /* Host responds by asserting the BSY signal. */
+ /* Target should respond by deasserting the SEL signal. */
+ target_mask &= ~z->scsi_id;
+ outb (z->ICR, ICR_ASSERT_BSY);
+ WAITFOR (! (inb (z->CSBR) & CSBR_SEL), 10000, "SEL deassert");
+
+ /* Remove the busy status. */
+ /* Target should set the MSGIN phase. */
+ outb (z->ICR, 0);
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 10000, "MSGIN");
+
+ /* Hope we get an IDENTIFY message. */
+ msg = nca_msg_input (z);
+ if (MSG_ISIDENT (msg)) {
+ /* Find the command corresponding to the I_T_L or I_T_L_Q
+ * nexus we just restablished, and remove it from
+ * the disconnected queue. */
+ lun = (msg & 7);
+ for (q=z->disconnected_queue; q; prev=q, q=q->next) {
+ if (target_mask != (1 << q->xfer->sc_link->target))
+ continue;
+ if (lun != q->xfer->sc_link->lun)
+ continue;
+ if (prev)
+ prev->next = q->next;
+ else
+ z->disconnected_queue = q->next;
+ q->next = 0;
+ PRINT (("nca%d/%d/%d reselect done\n",
+ z->sc_link.adapter_unit,
+ ffs (target_mask) - 1, lun));
+ nca_information_transfer (z, q);
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "reselect !busy");
+ return (1);
+ }
+ } else
+ printf ("nca%d reselect: expecting IDENTIFY, got 0x%x\n",
+ z->sc_link.adapter_unit, msg);
+
+ /* Since we have an established nexus that we can't
+ * do anything with, we must abort it. */
+ nca_send_abort (z);
+ PRINT (("nca%d reselect aborted\n", z->sc_link.adapter_unit));
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "reselect abort !busy");
+ goto again;
+}
+
+/*
+ * Send an abort to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int nca_abort (adapter_t *z, scb_t *scb)
+{
+ scb_t *q, **prev;
+
+ /* If the command hasn't been issued yet, we simply remove it
+ * from the issue queue. */
+ prev = &z->queue;
+ for (q=z->queue; q; q=q->next) {
+ if (scb == q) {
+ (*prev) = q->next;
+ q->next = 0;
+ return (1);
+ }
+ prev = &q->next;
+ }
+
+ /* If the command is currently disconnected from the bus,
+ * we reconnect the I_T_L or I_T_L_Q nexus associated with it,
+ * go into message out, and send an abort message. */
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb != q)
+ continue;
+
+ if (! nca_select (z, scb))
+ return (0);
+ nca_send_abort (z);
+
+ prev = &z->disconnected_queue;
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb == q) {
+ *prev = q->next;
+ q->next = 0;
+ /* Set some type of error result
+ * for the operation. */
+ return (1);
+ }
+ prev = &q->next;
+ }
+ }
+
+ /* Command not found in any queue. */
+ return (0);
+}
+
+/*
+ * The task accomplished, mark the i/o control block as done.
+ * Always called with interrupts disabled.
+ */
+void nca_done (adapter_t *z, scb_t *scb)
+{
+ struct scsi_xfer *xs = scb->xfer;
+
+ if (scb->flags & SCB_TIMECHK)
+ untimeout (nca_timeout, (caddr_t) scb, xs->timeout_ch);
+
+ /* How much of the buffer was not touched. */
+ xs->resid = scb->datalen;
+
+ if (scb->flags != SCB_ACTIVE && ! (xs->flags & SCSI_ERR_OK))
+ if (scb->flags & (SCB_TIMEOUT | SCB_ABORTED))
+ xs->error = XS_TIMEOUT;
+ else if (scb->flags & SCB_ERROR)
+ xs->error = XS_DRIVER_STUFFUP;
+ else if (scb->flags & SCB_TBUSY)
+ xs->error = XS_BUSY;
+ else if (scb->flags & SCB_SENSE)
+ xs->error = XS_SENSE;
+
+ xs->flags |= ITSDONE;
+
+ /* Free the control block. */
+ scb->next = z->free_scb;
+ z->free_scb = scb;
+ scb->flags = SCB_FREE;
+
+ /* If there were none, wake anybody waiting for one to come free,
+ * starting with queued entries. */
+ if (! scb->next)
+ wakeup ((caddr_t) &z->free_scb);
+
+ scsi_done (xs);
+}
+
+/*
+ * Wait for completion of command in polled mode.
+ * Always called with interrupts masked out.
+ */
+int nca_poll (adapter_t *z, scb_t *scb)
+{
+ int count;
+
+ for (count=0; count<30; ++count) {
+ DELAY (1000); /* delay for a while */
+ nca_start (z); /* retry operation */
+ if (scb->xfer->flags & ITSDONE)
+ return (1); /* all is done */
+ if (scb->flags & SCB_TIMEOUT)
+ return (0); /* no target present */
+ }
+ return (0);
+}
+
+/*
+ * Perform NCR-53C400 pseudo-dma data transfer.
+ */
+void nca_53400_dma_xfer (adapter_t *z, int read, u_char **pdata, u_long *plen)
+{
+ /* Set dma direction. */
+ outb (z->CSR, read ? CSR_TRANSFER_DIRECTION : 0);
+
+ /* Enable dma mode. */
+ outb (z->MR, MR_DMA_MODE | (read ? z->parity : 0));
+
+ /* Start dma transfer. */
+ outb (read ? z->SDIR : z->SDSR, 0);
+
+ /* Set up clock counter. */
+ outb (z->CCR, *plen/128);
+
+ for (; *plen>=128; *plen-=128, *pdata+=128) {
+ /* Wait for 53C400 host buffer ready. */
+ WAITFOR (! (inb (z->CSR) & CSR_HOST_BUF_NOT_READY), 100000, 0);
+ if (inb (z->CSR) & CSR_HOST_BUF_NOT_READY)
+ break;
+
+ /* Transfer 128 bytes of data. */
+ if (read)
+ insw (z->HBR, *pdata, 64);
+ else
+ outsw (z->HBR, *pdata, 64);
+ }
+
+ /* Wait for 5380 registers ready. */
+ WAITFOR (inb (z->CSR) & CSR_5380_ENABLE, 10000, 0);
+ if (! (inb (z->CSR) & CSR_5380_ENABLE)) {
+ /* Reset 53C400. */
+ PRINT (("nca%d: reset: pseudo-dma incomplete, csr=%b\n",
+ z->sc_link.adapter_unit, inb (z->CSR), CSR_BITS));
+ outb (z->CSR, CSR_5380_ENABLE);
+ outb (z->CSR, 0);
+ }
+
+ /* Wait for FIFO flush on write. */
+ if (! read)
+ WAITFOR (inb (z->TCR) & TCR_LAST_BYTE_SENT, 10000, "last byte");
+
+ /* Clear dma mode. */
+ outb (z->MR, z->parity);
+
+ /* Re-enable interrupts. */
+ outb (z->CSR, z->irq ? CSR_5380_INTR : 0);
+}
+
+/*
+ * Perform PAS-16 pseudo-dma data transfer.
+ */
+void nca_pas_dma_xfer (adapter_t *z, int read, u_char **pdata, u_long *plen)
+{
+ /* Enable dma mode. */
+ outb (z->MR, MR_DMA_MODE | (read ? z->parity : 0));
+
+ /* Start dma transfer. */
+ outb (read ? z->SDIR : z->SDSR, 0);
+
+ for (; *plen>=512; *plen-=512, *pdata+=512) {
+ /* Wait for pseudo-DMA request. */
+ WAITFOR (inb (z->PSTAT) & PAS16_STAT_DREQ, 10000, "pseudo-dma");
+ if (! (inb (z->PSTAT) & PAS16_STAT_DREQ))
+ break;
+
+ /* Transfer 512 bytes of data. */
+ if (read)
+ insb (z->PDATA, *pdata, 512);
+ else
+ outsb (z->PDATA, *pdata, 512);
+ }
+
+ /* Clear dma mode. */
+ outb (z->MR, z->parity);
+}
+
+/*
+ * Send data to the target.
+ */
+void nca_data_output (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ u_char *data = *pdata;
+ u_long len = *plen;
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ if (z->type == CTLR_NCR_53C400 && len%128 == 0)
+ /* Use NCR-53C400 pseudo-dma for data transfer. */
+ nca_53400_dma_xfer (z, 0, &data, &len);
+ else if (z->type == CTLR_PAS_16 && len%512 == 0)
+ /* Use PAS-16 pseudo-dma for data transfer. */
+ nca_pas_dma_xfer (z, 0, &data, &len);
+ else
+ for (;;) {
+ /* Check SCSI bus phase. */
+ u_char s = inb (z->CSBR) ^ (CSBR_BSY | PHASE_DATAOUT);
+ if (s & (CSBR_BSY | PHASE_MASK))
+ break;
+
+ /* Wait for REQ. */
+ if (! (s & CSBR_REQ))
+ continue;
+
+ /* Output data. */
+ outb (z->ODR, *data++);
+
+ /* Assert ACK and wait for REQ deassert,
+ * with irqs disabled. */
+ disable_intr ();
+ outb (z->ICR, ICR_ASSERT_ACK | ICR_ASSERT_DATA_BUS);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 1000, 0);
+ enable_intr ();
+
+ /* Deassert ACK. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ --len;
+ }
+ outb (z->ICR, 0);
+ PRINT (("nca (DATAOUT) send %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = data;
+}
+
+/*
+ * Receive data from the target.
+ */
+void nca_data_input (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ u_char *data = *pdata;
+ u_long len = *plen;
+
+ if (z->type == CTLR_NCR_53C400 && len%128 == 0)
+ /* Use NCR-53C400 pseudo-dma for data transfer. */
+ nca_53400_dma_xfer (z, 1, &data, &len);
+ else if (z->type == CTLR_PAS_16 && len%512 == 0)
+ /* Use PAS-16 pseudo-dma for data transfer. */
+ nca_pas_dma_xfer (z, 1, &data, &len);
+ else
+ for (;;) {
+ /* Check SCSI bus phase. */
+ u_char s = inb (z->CSBR) ^ (CSBR_BSY | PHASE_DATAIN);
+ if (s & (CSBR_BSY | PHASE_MASK))
+ break;
+
+ /* Wait for REQ. */
+ if (! (s & CSBR_REQ))
+ continue;
+
+ /* Input data. */
+ *data++ = inb (z->CSDR);
+
+ /* Assert ACK and wait for REQ deassert,
+ * with irqs disabled. */
+ disable_intr ();
+ outb (z->ICR, ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 1000, 0);
+ enable_intr ();
+
+ /* Deassert ACK. */
+ outb (z->ICR, 0);
+ --len;
+ }
+ PRINT (("nca (DATAIN) got %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = data;
+}
+
+/*
+ * Send the command to the target.
+ */
+void nca_cmd_output (adapter_t *z, u_char *cmd, int cmdlen)
+{
+ PRINT (("nca%d send command (%d bytes) ", z->sc_link.adapter_unit,
+ cmdlen));
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ while (cmdlen) {
+ /* Check for target disconnect. */
+ u_char sts = inb (z->CSBR);
+ if (! (sts & CSBR_BSY))
+ break;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_CMDOUT) {
+ printf ("nca: sending command: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ break;
+ }
+
+ /* Wait for REQ. */
+ if (! (sts & CSBR_REQ))
+ continue;
+
+ PRINT (("-%x", *cmd));
+ nca_sendbyte (z, *cmd++);
+ --cmdlen;
+ }
+ outb (z->ICR, 0);
+ PRINT (("\n"));
+}
+
+/*
+ * Send the message to the target.
+ */
+void nca_send_abort (adapter_t *z)
+{
+ u_char sts;
+
+ outb (z->ICR, ICR_ASSERT_ATN);
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 1000000, "abort message");
+ sts = inb (z->CSBR);
+ if (! (sts & CSBR_REQ))
+ goto ret;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_MSGOUT) {
+ printf ("nca: sending MSG_ABORT: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ goto ret;
+ }
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGOUT));
+ nca_sendbyte (z, MSG_ABORT);
+
+ PRINT (("nca%d send MSG_ABORT\n", z->sc_link.adapter_unit));
+ret: outb (z->ICR, 0);
+}
+
+/*
+ * Get the message from the target.
+ * Return the length of the received message.
+ */
+u_char nca_msg_input (adapter_t *z)
+{
+ u_char sts, msg;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 1000000, "message input");
+ sts = inb (z->CSBR);
+ if (! (sts & CSBR_REQ))
+ return (MSG_ABORT);
+
+ /* Check for phase mismatch.
+ * Reached if the target decides that it has finished the transfer. */
+ if ((sts & PHASE_MASK) != PHASE_MSGIN) {
+ printf ("nca: sending message: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return (MSG_ABORT);
+ }
+
+ /* Do actual transfer from SCSI bus to memory. */
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGIN));
+ msg = nca_recvbyte (z);
+ PRINT (("nca%d (MSG_INPUT) got 0x%x\n", z->sc_link.adapter_unit, msg));
+ return (msg);
+}
+
+/*
+ * Send request-sense op to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int nca_sense (adapter_t *z, scb_t *scb)
+{
+ u_char cmd[6], status, msg, *data;
+ u_long len;
+
+ /* Wait for target to disconnect. */
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "sense bus free");
+ if (inb (z->CSBR) & CSBR_BSY)
+ return (0);
+
+ /* Select the target again. */
+ if (! nca_select (z, scb))
+ return (0);
+
+ /* Wait for CMDOUT phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense CMDOUT");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_CMDOUT)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_CMDOUT));
+
+ /* Send command. */
+ len = sizeof (scb->xfer->sense);
+ cmd[0] = REQUEST_SENSE;
+ cmd[1] = scb->xfer->sc_link->lun << 5;
+ cmd[2] = 0;
+ cmd[3] = 0;
+ cmd[4] = len;
+ cmd[5] = 0;
+ nca_cmd_output (z, cmd, sizeof (cmd));
+
+ /* Wait for DATAIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense DATAIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_DATAIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_DATAIN));
+
+ data = (u_char*) &scb->xfer->sense;
+ nca_data_input (z, &data, &len);
+ PRINT (("nca%d sense %x-%x-%x-%x-%x-%x-%x-%x\n",
+ z->sc_link.adapter_unit, scb->xfer->sense.error_code,
+ scb->xfer->sense.ext.extended.segment,
+ scb->xfer->sense.ext.extended.flags,
+ scb->xfer->sense.ext.extended.info[0],
+ scb->xfer->sense.ext.extended.info[1],
+ scb->xfer->sense.ext.extended.info[2],
+ scb->xfer->sense.ext.extended.info[3],
+ scb->xfer->sense.ext.extended.extra_len));
+
+ /* Wait for STATIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense STATIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_STATIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_STATIN));
+
+ status = nca_recvbyte (z);
+
+ /* Wait for MSGIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense MSGIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_MSGIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGIN));
+
+ msg = nca_recvbyte (z);
+
+ if (status != 0 || msg != 0)
+ printf ("nca%d: bad sense status=0x%x, msg=0x%x\n",
+ z->sc_link.adapter_unit, status, msg);
+ return (1);
+}
+
+/*
+ * Do the transfer. We know we are connected. Update the flags,
+ * call nca_done when task accomplished. Dialog controlled by the target.
+ * Always called with interrupts disabled.
+ */
+void nca_information_transfer (adapter_t *z, scb_t *scb)
+{
+ u_char *data = scb->data; /* current data buffer */
+ u_long datalen = scb->datalen; /* current data transfer size */
+ register u_char sts;
+ u_char msg;
+
+ while ((sts = inb (z->CSBR)) & CSBR_BSY) {
+ /* We only have a valid SCSI phase when REQ is asserted. */
+ if (! (sts & CSBR_REQ))
+ continue;
+ if (inb (z->BSR) & BSR_PARITY_ERROR) {
+ int target = scb->xfer->sc_link->target;
+ if (++z->target[target].perrcnt <= 8)
+ printf ("nca%d/%d/%d parity error\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ if (z->target[target].perrcnt == 8)
+ printf ("nca%d/%d/%d too many parity errors, not logging any more\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ /* Clear parity error. */
+ inb (z->RPIR);
+ }
+ outb (z->TCR, PHASE_TO_TCR (sts & PHASE_MASK));
+ switch (sts & PHASE_MASK) {
+ case PHASE_DATAOUT:
+ if (datalen <= 0) {
+ printf ("nca%d/%d/%d data length underflow\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ /* send zero byte */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, 0);
+ outb (z->ICR, 0);
+ break;
+ }
+ nca_data_output (z, &data, &datalen);
+ break;
+ case PHASE_DATAIN:
+ if (datalen <= 0) {
+ /* Get extra data. Some devices (e.g. CDROMs)
+ * use fixed-length blocks (e.g. 2k),
+ * even if we need less. */
+ PRINT (("@"));
+ nca_recvbyte (z);
+ break;
+ }
+ nca_data_input (z, &data, &datalen);
+ break;
+ case PHASE_CMDOUT:
+ nca_cmd_output (z, (u_char*) scb->xfer->cmd,
+ scb->xfer->cmdlen);
+ break;
+ case PHASE_STATIN:
+ scb->xfer->status = nca_recvbyte (z);
+ PRINT (("nca%d/%d/%d (STATIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ (u_char) scb->xfer->status));
+ break;
+ case PHASE_MSGOUT:
+ /* Send no-op message. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, MSG_NOP);
+ outb (z->ICR, 0);
+ PRINT (("nca%d/%d/%d (MSGOUT) send NOP\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ break;
+ case PHASE_MSGIN:
+ /* Don't handle multi-byte messages here, because they
+ * should not be present here. */
+ msg = nca_recvbyte (z);
+ PRINT (("nca%d/%d/%d (MSGIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg));
+ switch (msg) {
+ case MSG_COMMAND_COMPLETE:
+ scb->data = data;
+ scb->datalen = datalen;
+ /* In the case of check-condition status,
+ * perform the request-sense op. */
+ switch (scb->xfer->status & 0x1e) {
+ case SCSI_CHECK:
+ if (nca_sense (z, scb))
+ scb->flags = SCB_SENSE;
+ break;
+ case SCSI_BUSY:
+ scb->flags = SCB_TBUSY;
+ break;
+ }
+ goto done;
+ case MSG_ABORT:
+ printf ("nca: command aborted by target\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_MESSAGE_REJECT:
+ printf ("nca: message rejected\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_DISCONNECT:
+ scb->next = z->disconnected_queue;
+ z->disconnected_queue = scb;
+ if (! z->irq && ! z->timeout_active) {
+ timeout (nca_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ PRINT (("nca%d/%d/%d disconnected\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ goto ret;
+ case MSG_SAVE_POINTERS:
+ scb->data = data;
+ scb->datalen = datalen;
+ break;
+ case MSG_RESTORE_POINTERS:
+ data = scb->data;
+ datalen = scb->datalen;
+ break;
+ default:
+ printf ("nca%d/%d/%d unknown message: 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg);
+ break;
+ }
+ break;
+ default:
+ printf ("nca: unknown phase: %b\n", sts, CSBR_BITS);
+ break;
+ }
+ }
+ printf ("nca%d/%d/%d unexpected target disconnect\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ scb->flags = SCB_ERROR;
+done:
+ CLEAR_BUSY (z, scb);
+ nca_done (z, scb);
+ret:
+ outb (z->ICR, 0);
+ outb (z->TCR, 0);
+ outb (z->SER, z->scsi_id);
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "xfer bus free");
+}
+#endif /* NNCA */
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 6bb4e0fa4d17..869111f5a708 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.64 1998/12/14 19:16:17 bde Exp $
+ * $Id: npx.c,v 1.60 1998/04/19 15:39:26 bde Exp $
*/
#include "npx.h"
@@ -58,7 +58,9 @@
#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/ipl.h>
+#ifndef SMP
#include <machine/md_var.h>
+#endif
#include <machine/pcb.h>
#include <machine/psl.h>
#ifndef SMP
@@ -84,7 +86,15 @@
#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
/* XXX - should be in header file. */
-ointhand2_t npxintr;
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+extern int (*copyin_vector) __P((const void *udaddr, void *kaddr, size_t len));
+extern int (*copyout_vector) __P((const void *kaddr, void *udaddr, size_t len));
+
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
+int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
+int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
#ifdef __GNUC__
@@ -135,17 +145,15 @@ SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
CTLFLAG_RD, &hw_float, 0,
"Floatingpoint instructions executed in hardware");
-#ifndef SMP
-static u_int npx0_imask = SWI_CLOCK_MASK;
-static struct gate_descriptor npx_idt_probeintr;
-static int npx_intrno;
-static volatile u_int npx_intrs_while_probing;
-static volatile u_int npx_traps_while_probing;
-#endif
+static u_int npx0_imask = SWI_CLOCK_MASK;
static bool_t npx_ex16;
static bool_t npx_exists;
+static struct gate_descriptor npx_idt_probeintr;
+static int npx_intrno;
+static volatile u_int npx_intrs_while_probing;
static bool_t npx_irq13;
+static volatile u_int npx_traps_while_probing;
#ifndef SMP
/*
@@ -240,10 +248,8 @@ static int
npxprobe1(dvp)
struct isa_device *dvp;
{
-#ifndef SMP
u_short control;
u_short status;
-#endif
/*
* Partially reset the coprocessor, if any. Some BIOS's don't reset
@@ -378,8 +384,6 @@ int
npxattach(dvp)
struct isa_device *dvp;
{
- dvp->id_ointr = npxintr;
-
/* The caller has printed "irq 13" for the npx_irq13 case. */
if (!npx_irq13) {
printf("npx%d: ", dvp->id_unit);
diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index 4f840619bf91..e2b0c6557835 100644
--- a/sys/i386/isa/pcaudio.c
+++ b/sys/i386/isa/pcaudio.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcaudio.c,v 1.44 1998/12/13 23:32:44 eivind Exp $
+ * $Id$
*/
#include "pca.h"
@@ -48,6 +48,11 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#define DSP_ULAW_NOT_WANTED
+#include <i386/isa/sound/ulaw.h>
+#define LINEAR_ALAW_NOT_WANTED
+#include <i386/isa/sound/alaw.h>
+
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -80,44 +85,6 @@ static char buffer2[BUF_SIZE];
static char buffer3[BUF_SIZE];
static char volume_table[256];
-#define DSP_ULAW_NOT_WANTED
-#include <i386/isa/snd/ulaw.h>
-
-static unsigned char alaw_linear[] = {
- 45, 214, 122, 133, 0, 255, 107, 149,
- 86, 171, 126, 129, 0, 255, 117, 138,
- 13, 246, 120, 135, 0, 255, 99, 157,
- 70, 187, 124, 131, 0, 255, 113, 142,
- 61, 198, 123, 132, 0, 255, 111, 145,
- 94, 163, 127, 128, 0, 255, 119, 136,
- 29, 230, 121, 134, 0, 255, 103, 153,
- 78, 179, 125, 130, 0, 255, 115, 140,
- 37, 222, 122, 133, 0, 255, 105, 151,
- 82, 175, 126, 129, 0, 255, 116, 139,
- 5, 254, 120, 135, 0, 255, 97, 159,
- 66, 191, 124, 131, 0, 255, 112, 143,
- 53, 206, 123, 132, 0, 255, 109, 147,
- 90, 167, 127, 128, 0, 255, 118, 137,
- 21, 238, 121, 134, 0, 255, 101, 155,
- 74, 183, 125, 130, 0, 255, 114, 141,
- 49, 210, 123, 133, 0, 255, 108, 148,
- 88, 169, 127, 129, 0, 255, 118, 138,
- 17, 242, 121, 135, 0, 255, 100, 156,
- 72, 185, 125, 131, 0, 255, 114, 142,
- 64, 194, 124, 132, 0, 255, 112, 144,
- 96, 161, 128, 128, 1, 255, 120, 136,
- 33, 226, 122, 134, 0, 255, 104, 152,
- 80, 177, 126, 130, 0, 255, 116, 140,
- 41, 218, 122, 133, 0, 255, 106, 150,
- 84, 173, 126, 129, 0, 255, 117, 139,
- 9, 250, 120, 135, 0, 255, 98, 158,
- 68, 189, 124, 131, 0, 255, 113, 143,
- 57, 202, 123, 132, 0, 255, 110, 146,
- 92, 165, 127, 128, 0, 255, 119, 137,
- 25, 234, 121, 134, 0, 255, 102, 154,
- 76, 181, 125, 130, 0, 255, 115, 141,
-};
-
#ifdef DEVFS
static void *pca_devfs_token;
static void *pcac_devfs_token;
@@ -194,7 +161,7 @@ pca_init(void)
pca_status.buf[1] = (unsigned char *)&buffer2[0];
pca_status.buf[2] = (unsigned char *)&buffer3[0];
pca_status.buffer = pca_status.buf[0];
- pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0;
+ pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[3] = 0;
pca_status.current = 0;
pca_status.sample_rate = SAMPLE_RATE;
pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE;
@@ -563,4 +530,5 @@ static void pca_drvinit(void *unused)
SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
+
#endif
diff --git a/sys/i386/isa/pcf.c b/sys/i386/isa/pcf.c
index b3e11d8093e4..7b498d7e0afb 100644
--- a/sys/i386/isa/pcf.c
+++ b/sys/i386/isa/pcf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcf.c,v 1.5 1998/11/04 22:09:17 nsouch Exp $
+ * $Id: pcf.c,v 1.1.1.17 1998/08/29 17:04:23 son Exp $
*
*/
#include <sys/param.h>
@@ -41,7 +41,7 @@
#include <dev/iicbus/iiconf.h>
#include "iicbus_if.h"
-#define TIMEOUT 9999 /* XXX */
+#define TIMEOUT 99999 /* XXX */
/* Status bits of S1 register (read only) */
#define nBB 0x01 /* busy when low set/reset by STOP/START*/
@@ -67,15 +67,13 @@
#define SLAVE_TRANSMITTER 0x1
#define SLAVE_RECEIVER 0x2
-#define PCF_DEFAULT_ADDR 0xaa
-
struct pcf_softc {
int pcf_base; /* isa port */
- u_char pcf_addr; /* interface I2C address */
+ int pcf_count;
+ int pcf_own_address; /* own address */
int pcf_slave_mode; /* receiver or transmitter */
- int pcf_started; /* 1 if start condition sent */
device_t iicbus; /* the corresponding iicbus */
};
@@ -105,13 +103,12 @@ static int pcf_probe(device_t);
static int pcf_attach(device_t);
static void pcf_print_child(device_t, device_t);
-static int pcf_repeated_start(device_t, u_char, int);
-static int pcf_start(device_t, u_char, int);
+static int pcf_repeated_start(device_t, u_char);
+static int pcf_start(device_t, u_char);
static int pcf_stop(device_t);
-static int pcf_write(device_t, char *, int, int *, int);
-static int pcf_read(device_t, char *, int, int *, int, int);
-static ointhand2_t pcfintr;
-static int pcf_rst_card(device_t, u_char, u_char, u_char *);
+static int pcf_write(device_t, char *, int, int *);
+static int pcf_read(device_t, char *, int, int *);
+static int pcf_rst_card(device_t, u_char);
static device_method_t pcf_methods[] = {
/* device interface */
@@ -122,7 +119,6 @@ static device_method_t pcf_methods[] = {
DEVMETHOD(bus_print_child, pcf_print_child),
/* iicbus interface */
- DEVMETHOD(iicbus_callback, iicbus_null_callback),
DEVMETHOD(iicbus_repeated_start, pcf_repeated_start),
DEVMETHOD(iicbus_start, pcf_start),
DEVMETHOD(iicbus_stop, pcf_stop),
@@ -149,6 +145,7 @@ pcfprobe_isa(struct isa_device *dvp)
{
device_t pcfdev;
struct pcf_isa_softc *pcf;
+ int error;
if (npcf >= MAXPCF)
return (0);
@@ -171,6 +168,7 @@ pcfprobe_isa(struct isa_device *dvp)
if (!pcfdev)
goto error;
+end_probe:
return (1);
error:
@@ -181,7 +179,6 @@ error:
static int
pcfattach_isa(struct isa_device *isdp)
{
- isdp->id_ointr = pcfintr;
return (1); /* ok */
}
@@ -189,21 +186,16 @@ static int
pcf_probe(device_t pcfdev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(pcfdev);
- int unit = device_get_unit(pcfdev);
-
- /* retrieve base address from isa initialization
- *
- * XXX should use ivars with isabus
- */
- pcf->pcf_base = pcfdata[unit]->pcf_base;
-
- /* reset the chip */
- pcf_rst_card(pcfdev, IIC_FASTEST, PCF_DEFAULT_ADDR, NULL);
/* XXX try do detect chipset */
device_set_desc(pcfdev, "PCF8584 I2C bus controller");
+ pcf->iicbus = iicbus_alloc_bus(pcfdev);
+
+ if (!pcf->iicbus)
+ return (EINVAL);
+
return (0);
}
@@ -211,8 +203,13 @@ static int
pcf_attach(device_t pcfdev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(pcfdev);
+ int unit = device_get_unit(pcfdev);
- pcf->iicbus = iicbus_alloc_bus(pcfdev);
+ /* retrieve base address from isa initialization
+ *
+ * XXX should use ivars with isabus
+ */
+ pcf->pcf_base = pcfdata[unit]->pcf_base;
/* probe and attach the iicbus */
device_probe_and_attach(pcf->iicbus);
@@ -223,10 +220,8 @@ pcf_attach(device_t pcfdev)
static void
pcf_print_child(device_t bus, device_t dev)
{
- struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus);
-
printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), (int)pcf->pcf_addr);
+ device_get_unit(bus), iicbus_get_own_address(dev));
return;
}
@@ -296,39 +291,13 @@ static int pcf_stop(device_t pcfdev)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
- /*
- * Send STOP condition iff the START condition was previously sent.
- * STOP is sent only once even if a iicbus_stop() is called after
- * an iicbus_read()... see pcf_read(): the pcf needs to send the stop
- * before the last char is read.
- */
- if (pcf->pcf_started) {
- /* set stop condition and enable IT */
- PCF_SET_S1(pcf, PIN|ES0|ENI|STO|ACK);
-
- pcf->pcf_started = 0;
- }
+ /* set stop condition and enable IT */
+ PCF_SET_S1(pcf, PIN|ES0|ENI|STO|ACK);
return (0);
}
-
-static int pcf_noack(struct pcf_softc *pcf, int timeout)
-{
- int noack;
- int k = timeout/10;
-
- do {
- noack = PCF_GET_S1(pcf) & LRB;
- if (!noack)
- break;
- DELAY(10); /* XXX wait 10 us */
- } while (k--);
-
- return (noack);
-}
-
-static int pcf_repeated_start(device_t pcfdev, u_char slave, int timeout)
+static int pcf_repeated_start(device_t pcfdev, u_char slave)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int error = 0;
@@ -344,8 +313,8 @@ static int pcf_repeated_start(device_t pcfdev, u_char slave, int timeout)
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check for ack */
- if (pcf_noack(pcf, timeout)) {
+ /* check ACK */
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -357,7 +326,7 @@ error:
return (error);
}
-static int pcf_start(device_t pcfdev, u_char slave, int timeout)
+static int pcf_start(device_t pcfdev, u_char slave)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int error = 0;
@@ -372,14 +341,12 @@ static int pcf_start(device_t pcfdev, u_char slave, int timeout)
/* START only */
PCF_SET_S1(pcf, PIN|ES0|STA|ACK);
- pcf->pcf_started = 1;
-
/* wait for address sent, polling */
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check for ACK */
- if (pcf_noack(pcf, timeout)) {
+ /* check ACK */
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -391,7 +358,7 @@ error:
return (error);
}
-static void
+void
pcfintr(unit)
{
struct pcf_softc *pcf =
@@ -499,23 +466,19 @@ error:
return;
}
-static int pcf_rst_card(device_t pcfdev, u_char speed, u_char addr, u_char *oldaddr)
+static int pcf_rst_card(device_t pcfdev, u_char speed)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
-
- if (oldaddr)
- *oldaddr = pcf->pcf_addr;
+ u_char ownaddr;
/* retrieve own address from bus level */
- if (!addr)
- pcf->pcf_addr = PCF_DEFAULT_ADDR;
- else
- pcf->pcf_addr = addr;
+ if ((ownaddr = iicbus_get_own_address(pcf->iicbus)) == 0)
+ ownaddr = 0xaa;
PCF_SET_S1(pcf, PIN); /* initialize S1 */
/* own address S'O<>0 */
- PCF_SET_S0(pcf, pcf->pcf_addr >> 1);
+ PCF_SET_S0(pcf, ownaddr >> 1);
/* select clock register */
PCF_SET_S1(pcf, PIN|ES1);
@@ -546,7 +509,7 @@ static int pcf_rst_card(device_t pcfdev, u_char speed, u_char addr, u_char *olda
}
static int
-pcf_write(device_t pcfdev, char *buf, int len, int *sent, int timeout /* us */)
+pcf_write(device_t pcfdev, char *buf, int len, int *sent)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int bytes, error = 0;
@@ -560,12 +523,10 @@ pcf_write(device_t pcfdev, char *buf, int len, int *sent, int timeout /* us */)
PCF_SET_S0(pcf, *buf++);
- /* wait for the byte to be send */
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check if ack received */
- if (pcf_noack(pcf, timeout)) {
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -586,8 +547,7 @@ error:
}
static int
-pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
- int delay /* us */)
+pcf_read(device_t pcfdev, char *buf, int len, int *read)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int bytes, error = 0;
@@ -598,7 +558,7 @@ pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
/* trig the bus to get the first data byte in S0 */
if (len) {
- if (len == 1 && last)
+ if (len == 1)
/* just one byte to read */
PCF_SET_S1(pcf, ES0); /* no ack */
@@ -608,25 +568,26 @@ pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
bytes = 0;
while (len) {
- /* XXX delay needed here */
-
- /* wait for trigged byte */
if ((error = pcf_wait_byte(pcf))) {
pcf_stop(pcfdev);
goto error;
}
- if (len == 1 && last)
- /* ok, last data byte already in S0, no I2C activity
- * on next PCF_GET_S0() */
+ if (len == 1) {
+
+ /* ok, last data byte already in S0 */
pcf_stop(pcfdev);
- else if (len == 2 && last)
- /* next trigged byte with no ack */
- PCF_SET_S1(pcf, ES0);
+ *buf = PCF_GET_S0(pcf);
- /* receive byte, trig next byte */
- *buf++ = PCF_GET_S0(pcf);
+ } else {
+ if (len == 2)
+ /* next trigged byte with no ack */
+ PCF_SET_S1(pcf, ES0);
+
+ /* read last data byte, trig for next data byte */
+ *buf++ = PCF_GET_S0(pcf);
+ }
len --;
bytes ++;
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index cb557e10a468..90758b2cf945 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -114,19 +114,6 @@ static void vgapelinit(void); /* read initial VGA DAC palette */
static int pcvt_xmode_set(int on, struct proc *p); /* initialize for X mode */
#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
-#ifdef _DEV_KBD_KBDREG_H_
-static void detect_kbd(void *arg);
-static kbd_callback_func_t pcevent;
-#endif
-
-static cn_probe_t pccnprobe;
-static cn_init_t pccninit;
-static cn_getc_t pccngetc;
-static cn_checkc_t pccncheckc;
-static cn_putc_t pccnputc;
-
-CONS_DRIVER(pc, pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc);
-
static d_open_t pcopen;
static d_close_t pcclose;
static d_read_t pcread;
@@ -166,18 +153,17 @@ pcprobe(struct isa_device *dev)
#endif /* PCVT_NETBSD > 9 */
#endif /* PCVT_NETBSD > 100 */
{
-#ifdef _DEV_KBD_KBDREG_H_
- int i;
+#ifdef _I386_ISA_KBDIO_H_
+ kbdc = kbdc_open(IO_KBD);
- if (kbd == NULL) {
+ if(kbdc == NULL)
+ {
reset_keyboard = 0;
- kbd_configure(KB_CONF_PROBE_ONLY);
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dev->id_unit);
- if ((i < 0) || ((kbd = kbd_get_keyboard(i)) == NULL))
- return (-1);
+ return 1;
}
+
reset_keyboard = 1; /* it's now safe to do kbd reset */
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
kbd_code_init();
@@ -185,9 +171,7 @@ pcprobe(struct isa_device *dev)
((struct isa_attach_args *)aux)->ia_iosize = 16;
return 1;
#else
-#ifdef _DEV_KBD_KBDREG_H_
- return (-1);
-#elif PCVT_NETBSD || PCVT_FREEBSD
+#if PCVT_NETBSD || PCVT_FREEBSD
return (16);
#else
return 1;
@@ -215,11 +199,6 @@ pcattach(struct isa_device *dev)
vt_coldmalloc(); /* allocate memory for screens */
-#ifdef _DEV_KBD_KBDREG_H_
- if (kbd == NULL)
- timeout(detect_kbd, (void *)dev->id_unit, hz*2);
-#endif /* _DEV_KBD_KBDREG_H_ */
-
#if PCVT_NETBSD || PCVT_FREEBSD
#if PCVT_NETBSD > 9
@@ -405,8 +384,6 @@ pcattach(struct isa_device *dev)
#else /* PCVT_NETBSD > 9 */
- dev->id_ointr = pcrint;
-
return 1;
#endif /* PCVT_NETBSD > 9 */
@@ -791,7 +768,7 @@ do_standard:
}
int
-pcmmap(Dev_t dev, vm_offset_t offset, int nprot)
+pcmmap(Dev_t dev, int offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;
@@ -862,51 +839,6 @@ pcvt_timeout(void *arg)
}
#endif
-#ifdef _DEV_KBD_KBDREG_H_
-static void
-detect_kbd(void *arg)
-{
- int unit = (int)arg;
- int i;
-
- if (kbd != NULL)
- return;
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)unit);
- if (i >= 0)
- kbd = kbd_get_keyboard(i);
- if (kbd != NULL)
- {
- reset_keyboard = 1; /* ok to reset the keyboard */
- kbd_code_init();
- return;
- }
- reset_keyboard = 0;
- timeout(detect_kbd, (void *)unit, hz*2);
-}
-
-int
-pcevent(keyboard_t *thiskbd, int event, void *arg)
-{
- int unit = (int)arg;
-
- if (thiskbd != kbd)
- return EINVAL; /* shouldn't happen */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- pcrint(unit);
- return 0;
- case KBDIO_UNLOADING:
- reset_keyboard = 0;
- kbd = NULL;
- kbd_release(thiskbd, (void *)&kbd);
- timeout(detect_kbd, (void *)unit, hz*4);
- return 0;
- default:
- return EINVAL;
- }
-}
-#endif /* _DEV_KBD_KBDREG_H_ */
void
pcrint(int unit)
@@ -920,7 +852,7 @@ pcrint(int unit)
int s;
# endif
-# ifdef _DEV_KBD_KBDREG_H_
+# ifdef _I386_ISA_KBDIO_H_
int c;
# endif
@@ -928,6 +860,25 @@ pcrint(int unit)
u_char *cp;
#endif /* PCVT_KBD_FIFO */
+ /*
+ * in case the keyboard was not plugged in while booting, kbdc
+ * was set to NULL at that time. When a keyboard IRQ occurs and
+ * kbdc is NULL, the keyboard was probably reconnected to the
+ * keyboard controller and we have to initialize the keyboard.
+ */
+
+ if(kbdc == NULL)
+ {
+ kbdc = kbdc_open(IO_KBD);
+ if(kbdc == NULL)
+ {
+ reset_keyboard = 0;
+ return;
+ }
+ reset_keyboard = 1;
+ kbd_code_init();
+ }
+
#if PCVT_SCREENSAVER
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */
@@ -939,7 +890,7 @@ pcrint(int unit)
return;
}
-# ifndef _DEV_KBD_KBDREG_H_
+# ifndef _I386_ISA_KBDIO_H_
while (inb(CONTROLLER_CTRL) & STATUS_OUTPBF) /* check 8042 buffer */
{
ret = 1; /* got something */
@@ -948,11 +899,11 @@ pcrint(int unit)
dt = inb(CONTROLLER_DATA); /* get it 8042 data */
# else
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) != -1)
+ while ((c = read_kbd_data_no_wait(kbdc)) != -1)
{
ret = 1; /* got something */
dt = c;
-# endif /* _DEV_KBD_KBDREG_H_ */
+# endif /* _I386_ISA_KBDIO_H_ */
if (pcvt_kbd_count >= PCVT_KBD_FIFO_SZ) /* fifo overflow ? */
{
@@ -1163,47 +1114,39 @@ consinit() /* init for kernel messages during boot */
#endif /* PCVT_NETBSD */
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
pccnprobe(struct consdev *cp)
{
struct isa_device *dvp;
- int i;
- /*
- * Take control if we are the highest priority enabled display device.
- */
- dvp = find_display();
- if (dvp == NULL || dvp->id_driver != &vtdriver) {
- cp->cn_pri = CN_DEAD;
- return;
- }
-
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
+ kbdc = kbdc_open(IO_KBD);
/*
* Don't reset the keyboard via `kbdio' just yet.
* The system clock has not been calibrated...
*/
reset_keyboard = 0;
- if (kbd == NULL) {
- kbd_configure(KB_CONF_PROBE_ONLY);
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dvp->id_unit);
- if (i >= 0)
- kbd = kbd_get_keyboard(i);
- }
-
#if PCVT_SCANSET == 2
/*
* Turn off scancode translation early so that UserConfig
* and DDB can read the keyboard.
*/
- empty_both_buffers(*(KBDC *)kbd->kb_data, 10);
- set_controller_command_byte(*(KBDC *)kbd->kb_data, KBD_TRANSLATION, 0);
+ empty_both_buffers(kbdc, 10);
+ set_controller_command_byte(kbdc, KBD_TRANSLATION, 0);
#endif /* PCVT_SCANSET == 2 */
+#endif /* _I386_ISA_KBDIO_H_ */
-#endif /* _DEV_KBD_KBDREG_H_ */
+ /*
+ * Take control if we are the highest priority enabled display device.
+ */
+ dvp = find_display();
+ if (dvp == NULL || dvp->id_driver != &vtdriver) {
+ cp->cn_pri = CN_DEAD;
+ return;
+ }
/* initialize required fields */
@@ -1226,7 +1169,7 @@ pccnprobe(struct consdev *cp)
}
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
@@ -1239,7 +1182,7 @@ pccninit(struct consdev *cp)
}
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
@@ -1273,7 +1216,7 @@ pccnputc(Dev_t dev, U_char c)
#endif
}
-static int
+int
pccngetc(Dev_t dev)
{
register int s;
@@ -1301,13 +1244,7 @@ pccngetc(Dev_t dev)
s = spltty(); /* block pcrint while we poll */
kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif
cp = sgetc(0);
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif
kbd_polling = 0;
splx(s);
c = *cp++;
@@ -1328,19 +1265,13 @@ pccngetc(Dev_t dev)
}
#if PCVT_FREEBSD >= 200
-static int
+int
pccncheckc(Dev_t dev)
{
char *cp;
int x = spltty();
kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif
cp = sgetc(1);
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif
kbd_polling = 0;
splx(x);
return (cp == NULL ? -1 : *cp);
@@ -1579,7 +1510,7 @@ pcvt_xmode_set(int on, struct proc *p)
vsp->Crtat = vsp->Memory; /* operate in memory now */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_SCANSET == 2
/* put keyboard to return ancient PC scan codes */
@@ -1593,15 +1524,15 @@ pcvt_xmode_set(int on, struct proc *p)
#endif /* PCVT_USEKBDSEC */
#endif /* PCVT_SCANSET == 2 */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET == 2
/* put keyboard to return ancient PC scan codes */
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
+ set_controller_command_byte(kbdc,
KBD_TRANSLATION, KBD_TRANSLATION);
#endif /* PCVT_SCANSET == 2 */
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_NETBSD > 9
fp->tf_eflags |= PSL_IOPL;
@@ -1638,7 +1569,7 @@ pcvt_xmode_set(int on, struct proc *p)
pcvt_set_scrnsv_tmo(saved_scrnsv_tmo);
#endif /* PCVT_SCREENSAVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_SCANSET == 2
kbc_8042cmd(CONTR_WRITE);
@@ -1651,14 +1582,13 @@ pcvt_xmode_set(int on, struct proc *p)
#endif /* PCVT_USEKBDSEC */
#endif /* PCVT_SCANSET == 2 */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET == 2
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
- KBD_TRANSLATION, 0);
+ set_controller_command_byte(kbdc, KBD_TRANSLATION, 0);
#endif /* PCVT_SCANSET == 2 */
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
if(adaptor_type == MDA_ADAPTOR)
{
diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h
index 2c9aac8a29c5..70c28919f438 100644
--- a/sys/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/i386/isa/pcvt/pcvt_hdr.h
@@ -107,9 +107,7 @@
#endif /* PCVT_FREEBSD >= 200 */
#include <i386/isa/pcvt/pcvt_conf.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdcreg.h>
+#include <i386/isa/kbdio.h>
#if PCVT_NETBSD > 9
#include "device.h"
@@ -170,14 +168,6 @@
#include <machine/clock.h>
#include <machine/md_var.h>
#endif
-/*
- * The following values are defined in machine/console.h, but the header
- * file is not included here due to conflicts with pcvt_ioctl.h.
- */
-#define KDGKBTYPE _IOR('K', 64, int)
-#define KB_84 1
-#define KB_101 2
-#define KB_OTHER 3
#else /* PCVT_FREEBSD >= 200 */
#include "machine/pc/display.h"
#endif /* PCVT_FREEBSD >= 200 */
@@ -270,7 +260,7 @@ in the config file"
* Keyboard and Keyboard Controller
*---------------------------------------------------------------------------*/
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#define CONTROLLER_CTRL 0x64 /* W - command, R - status */
#define CONTROLLER_DATA 0x60 /* R/W - data */
@@ -318,7 +308,7 @@ in the config file"
#define KEYB_C_ECHO 0xee /* diagnostic, echo 0xee */
#define KEYB_C_LEDS 0xed /* set/reset numlock,capslock & scroll lock */
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
/* responses from the KEYBOARD (via the 8042 controller on mainboard..) */
@@ -1010,10 +1000,10 @@ u_char chargen_access = 0; /* synchronize access */
u_char keyboard_type = KB_UNKNOWN; /* type of keyboard */
u_char keyboard_is_initialized = 0; /* for ddb sanity */
u_char kbd_polling = 0; /* keyboard is being polled */
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
u_char reset_keyboard = 0; /* OK to reset keyboard */
-keyboard_t *kbd = NULL;
-#endif /* _DEV_KBD_KBDREG_H_ */
+KBDC kbdc = NULL; /* keyboard controller */
+#endif /* _I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
u_char keyboard_show = 0; /* normal display */
@@ -1151,10 +1141,10 @@ extern u_char can_do_132col;
extern u_char vga_family;
extern u_char keyboard_is_initialized;
extern u_char kbd_polling;
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
extern u_char reset_keyboard;
-extern keyboard_t *kbd;
-#endif /* _DEV_KBD_KBDREG_H_ */
+extern KBDC kbdc;
+#endif /* _I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
extern u_char keyboard_show;
@@ -1233,7 +1223,6 @@ int pccncheckc ( Dev_t dev );
int pccnputc ( Dev_t dev, U_char c );
#endif
-ointhand2_t pcrint;
void pcstart ( struct tty *tp );
void pcstop ( struct tty *tp, int flag );
@@ -1278,10 +1267,10 @@ void fkl_on ( struct video_state *svsp );
struct tty *get_pccons ( Dev_t dev );
void init_sfkl ( struct video_state *svsp );
void init_ufkl ( struct video_state *svsp );
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int kbd_cmd ( int val );
int kbd_response ( void );
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
void kbd_code_init ( void );
void kbd_code_init1 ( void );
diff --git a/sys/i386/isa/pcvt/pcvt_kbd.c b/sys/i386/isa/pcvt/pcvt_kbd.c
index 50457dc16b5d..579c1a23abb5 100644
--- a/sys/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/i386/isa/pcvt/pcvt_kbd.c
@@ -91,9 +91,11 @@ static void doreset ( void );
static void ovlinit ( int force );
static void settpmrate ( int rate );
static void setlockkeys ( int snc );
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
static int kbc_8042cmd ( int val );
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#else
+static int set_keyboard_param( int command, int data );
+#endif /* !_I386_ISA_KBDIO_H_ */
static int getokeydef ( unsigned key, struct kbd_ovlkey *thisdef );
static int getckeydef ( unsigned key, struct kbd_ovlkey *thisdef );
static int rmkeydef ( int key );
@@ -168,7 +170,7 @@ do_vgapage(int page)
#define PCVT_UPDLED_LOSES_INTR 0 /* disabled for now */
-#if PCVT_UPDLED_LOSES_INTR || defined(_DEV_KBD_KBDREG_H_)
+#if PCVT_UPDLED_LOSES_INTR || defined(_I386_ISA_KBDIO_H_)
/*---------------------------------------------------------------------------*
* check for lost keyboard interrupts
@@ -201,7 +203,7 @@ static struct callout_handle lost_intr_ch =
static void
check_for_lost_intr (void *arg)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
lost_intr_timeout_queued = 0;
if (inb(CONTROLLER_CTRL) & STATUS_OUTPBF)
{
@@ -213,20 +215,19 @@ check_for_lost_intr (void *arg)
int opri;
lost_intr_timeout_queued = 0;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
+ if (kbdc_lock(kbdc, TRUE)) {
opri = spltty ();
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check)(kbd))
+ kbdc_lock(kbdc, FALSE);
+ if (kbdc_data_ready(kbdc))
pcrint (0);
splx (opri);
}
-
lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz);
lost_intr_timeout_queued = 1;
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
-#endif /* PCVT_UPDLED_LOSES_INTR || defined(_DEV_KBD_KBDREG_H_) */
+#endif /* PCVT_UPDLED_LOSES_INTR || defined(_I386_ISA_KBDIO_H_) */
/*---------------------------------------------------------------------------*
* update keyboard led's
@@ -238,23 +239,16 @@ update_led(void)
/* Don't update LED's unless necessary. */
- int opri, new_ledstate;
+ int opri, new_ledstate, response1, response2;
opri = spltty();
-#ifndef _DEV_KBD_KBDREG_H_
new_ledstate = (vsp->scroll_lock) |
(vsp->num_lock * 2) |
(vsp->caps_lock * 4);
-#else
- new_ledstate = ((vsp->scroll_lock) ? LED_SCR : 0) |
- ((vsp->num_lock) ? LED_NUM : 0) |
- ((vsp->caps_lock) ? LED_CAP : 0);
-#endif /* _DEV_KBD_KBDREG_H_ */
if (new_ledstate != ledstate)
{
-#ifndef _DEV_KBD_KBDREG_H_
- int response1, response2;
+#ifndef _I386_ISA_KBDIO_H_
ledstate = LEDSTATE_UPDATE_PENDING;
@@ -301,20 +295,19 @@ update_led(void)
printf(
"Keyboard LED command not ACKed (responses %#x %#x)\n",
response1, response2);
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
- if (kbd == NULL) {
+ if (kbdc == NULL) {
ledstate = new_ledstate;
splx(opri);
} else {
ledstate = LEDSTATE_UPDATE_PENDING;
splx(opri);
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&new_ledstate) == 0)
+ if (set_keyboard_param(KBDC_SET_LEDS, new_ledstate) == 0)
ledstate = new_ledstate;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_UPDLED_LOSES_INTR
if (lost_intr_timeout_queued)
@@ -326,7 +319,7 @@ update_led(void)
}
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
splx(opri);
#endif
@@ -339,22 +332,20 @@ update_led(void)
static void
settpmrate(int rate)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
tpmrate = rate & 0x7f;
if(kbd_cmd(KEYB_C_TYPEM) != 0)
printf("Keyboard TYPEMATIC command timeout\n");
else if(kbd_cmd(tpmrate) != 0)
printf("Keyboard TYPEMATIC data timeout\n");
#else
- if (kbd == NULL)
- return;
tpmrate = rate & 0x7f;
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETRAD, (caddr_t)&tpmrate))
+ if (set_keyboard_param(KBDC_SET_TYPEMATIC, tpmrate) != 0)
printf("pcvt: failed to set keyboard TYPEMATIC.\n");
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
/*---------------------------------------------------------------------------*
* Pass command to keyboard controller (8042)
*---------------------------------------------------------------------------*/
@@ -416,7 +407,62 @@ kbd_response(void)
return ch;
}
-#endif /* _DEV_KBD_KBDREG_H_ */
+#else
+static int
+set_keyboard_param(int command, int data)
+{
+ int s;
+ int c;
+
+ if (kbdc == NULL)
+ return 1;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(kbdc, TRUE))
+ return 1;
+
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(kbdc,
+ kbdc_get_device_mask(kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(kbdc, FALSE);
+ splx(s);
+ return 1;
+ }
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
+
+ if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
+ send_kbd_command(kbdc, KBDC_ENABLE_KBD);
+
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(kbdc,
+ kbdc_get_device_mask(kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
+ }
+#else
+ splx(s);
+#endif
+ kbdc_lock(kbdc, FALSE);
+
+ return 0;
+}
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET > 1
/*---------------------------------------------------------------------------*
@@ -425,7 +471,7 @@ kbd_response(void)
void
kbd_emulate_pc(int do_emulation)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int cmd, timeo = 10000;
cmd = COMMAND_SYSFLG|COMMAND_IRQEN; /* common base cmd */
@@ -443,9 +489,9 @@ kbd_emulate_pc(int do_emulation)
break;
outb(CONTROLLER_DATA, cmd);
#else
- set_controller_command_byte(*(KBDC *)kbd->kb_data, KBD_TRANSLATION,
+ set_controller_command_byte(kbdc, KBD_TRANSLATION,
(do_emulation) ? KBD_TRANSLATION : 0);
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
#endif /* PCVT_SCANSET > 1 */
@@ -461,7 +507,7 @@ kbd_emulate_pc(int do_emulation)
static
void doreset(void)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int again = 0;
int once = 0;
int response, opri;
@@ -622,8 +668,10 @@ r_entry:
#endif /* PCVT_KEYBDID */
-#else /* _DEV_KBD_KBDREG_H_ */
- int type;
+#else /* _I386_ISA_KBDIO_H_ */
+ int c;
+ int m;
+ int s;
if (!reset_keyboard) /* no, we are not ready to reset */
return;
@@ -633,11 +681,29 @@ r_entry:
lost_intr_timeout_queued = 0;
}
- if (kbd == NULL)
- return; /* shouldn't happen */
- (*kbdsw[kbd->kb_index]->init)(kbd);
+ if (kbdc == NULL)
+ kbdc = kbdc_open(IO_KBD);
- ledstate = LEDSTATE_UPDATE_PENDING;
+ if (!kbdc_lock(kbdc, TRUE)) /* strange, somebody got there first */
+ return;
+
+ /* remove any noise */
+ empty_both_buffers(kbdc, 10);
+
+ s = spltty();
+
+ /* save the current controller command byte */
+ m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ splx(s);
+ printf("pcvt: unable to get the command byte.\n");
+ return;
+ }
#if PCVT_USEKBDSEC /* security enabled */
@@ -657,33 +723,105 @@ r_entry:
#endif /* PCVT_USEKBDSEC */
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
- KBD_OVERRIDE_KBD_LOCK | KBD_TRANSLATION, KBDINITCMD);
-
- keyboard_type = KB_MFII; /* force it .. */
+ /* disable the keyboard interrupt and the aux port and interrupt */
+ if (!set_controller_command_byte(kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT | KBDINITCMD)) {
+ /* CONTROLLER ERROR: there is very little we can do... */
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ splx(s);
+ printf("pcvt: unable to set the command byte.\n");
+ return;
+ }
+ splx(s);
+
+ /* reset keyboard hardware */
+ ledstate = LEDSTATE_UPDATE_PENDING;
+ if (!reset_kbd(kbdc)) {
+ /* KEYBOARD ERROR */
+ empty_both_buffers(kbdc, 10);
+ test_controller(kbdc);
+ test_kbd_port(kbdc);
+ /*
+ * We could disable the keyboard port and interrupt now...
+ * but, the keyboard may still exist.
+ */
+ printf("pcvt: failed to reset the keyboard.\n");
+ /* try to restore the original command byte */
+ set_controller_command_byte(kbdc, 0xff, c);
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ return;
+ }
+
#if PCVT_KEYBDID
- type = KB_101;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDGKBTYPE, (caddr_t)&type);
- switch (type)
- {
- case KB_84:
- keyboard_type = KB_AT;
- break;
- case KB_101:
- keyboard_type = KB_MFII;
- break;
- default:
- keyboard_type = KB_UNKNOWN;
- break;
+
+ keyboard_type = KB_UNKNOWN;
+ if (send_kbd_command(kbdc, KBDC_SEND_DEV_ID) == KBD_ACK) {
+ DELAY(10000); /* 10msec delay */
+ switch (read_kbd_data(kbdc)) {
+ case KEYB_R_MF2ID1:
+ switch (read_kbd_data(kbdc)) {
+ case KEYB_R_MF2ID2:
+ case KEYB_R_MF2ID2HP:
+ keyboard_type = KB_MFII;
+ break;
+ case -1:
+ default:
+ break;
+ }
+ break;
+ case -1:
+ keyboard_type = KB_AT;
+ /* fall through */
+ default:
+ /* XXX: should we read the second byte? */
+ empty_both_buffers(kbdc, 10); /* XXX */
+ break;
+ }
+ } else {
+ /*
+ * The send ID command failed. This error is considered
+ * benign, but may need recovery.
+ */
+ empty_both_buffers(kbdc, 10);
+ test_controller(kbdc);
+ test_kbd_port(kbdc);
}
+
+#else /* PCVT_KEYBDID */
+
+ keyboard_type = KB_MFII; /* force it .. */
+
#endif /* PCVT_KEYBDID */
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled
+ * keyboard intr.
+ */
+ printf("pcvt: failed to enable the keyboard port and intr.\n");
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ return;
+ }
+
+ kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(kbdc, FALSE);
+
update_led();
lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz);
lost_intr_timeout_queued = 1;
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
/*---------------------------------------------------------------------------*
@@ -1105,15 +1243,15 @@ sgetc(int noblock)
static char keybuf[2] = {0}; /* the second 0 is a delimiter! */
#endif /* XSERVER */
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
int c;
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
loop:
#ifdef XSERVER
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_KBD_FIFO
@@ -1148,7 +1286,7 @@ loop:
#endif /* !PCVT_KBD_FIFO */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_KBD_FIFO
if (pcvt_kbd_count) {
@@ -1161,18 +1299,18 @@ loop:
} else
#endif /* PCVT_KBD_FIFO */
if (!noblock) {
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, TRUE)) == -1)
+ while ((c = read_kbd_data(kbdc)) == -1)
;
dt = c;
} else {
- if ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) == -1)
+ if ((c = read_kbd_data_no_wait(kbdc)) == -1)
return NULL;
dt = c;
}
{
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
/*
* If x mode is active, only care for locking keys, then
@@ -1450,7 +1588,7 @@ no_mouse_event:
#else /* !XSERVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
# if PCVT_KBD_FIFO
@@ -1487,7 +1625,7 @@ no_mouse_event:
#endif /* !PCVT_KBD_FIFO */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_KBD_FIFO
if (pcvt_kbd_count) {
@@ -1500,20 +1638,20 @@ no_mouse_event:
} else
#endif /* PCVT_KBD_FIFO */
if (!noblock) {
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, TRUE)) == -1)
+ while ((c = read_kbd_data(kbdc)) == -1)
;
dt = c;
} else {
- if ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) == -1)
+ if ((c = read_kbd_data_no_wait(kbdc)) == -1)
return NULL;
dt = c;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#endif /* !XSERVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
else
{
if(noblock)
@@ -1521,7 +1659,7 @@ no_mouse_event:
else
goto loop;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
showkey (' ', dt);
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c
index de7f938840e8..3b0019103258 100644
--- a/sys/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/i386/isa/pcvt/pcvt_sup.c
@@ -261,7 +261,7 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
static void
vgapcvtid(struct pcvtid *data)
{
- snprintf(data->name, sizeof(data->name), "%s", PCVTIDNAME);
+ strcpy(data->name, PCVTIDNAME);
data->rmajor = PCVTIDMAJOR;
data->rminor = PCVTIDMINOR;
}
diff --git a/sys/i386/isa/pnp.c b/sys/i386/isa/pnp.c
index a3635cb2449d..9b4bb5563374 100644
--- a/sys/i386/isa/pnp.c
+++ b/sys/i386/isa/pnp.c
@@ -23,12 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pnp.c,v 1.8 1998/11/21 01:54:50 archie Exp $
+ * $Id: pnp.c,v 1.5 1998/02/09 06:08:38 eivind Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h> /* for DATA_SET */
#include <sys/malloc.h>
#include <sys/interrupt.h>
#include <machine/clock.h>
@@ -373,9 +373,9 @@ config_pnp_device(pnp_id *p, int csn)
/* these are for autoconfigure a-la pci */
struct pnp_device *dvp, **dvpp;
- char *name = NULL;
+ char *name ;
- printf("CSN %d Vendor ID: %c%c%c%02x%02x [0x%08lx] Serial 0x%08lx Comp ID: %c%c%c%02x%02x [0x%08lx]\n",
+ printf("CSN %d Vendor ID: %c%c%c%02x%02x [0x%08x] Serial 0x%08x Comp ID: %c%c%c%02x%02x [0x%08x]\n",
csn,
((data[0] & 0x7c) >> 2) + '@',
(((data[0] & 0x03) << 3) | ((data[1] & 0xe0) >> 5)) + '@',
@@ -456,7 +456,7 @@ config_pnp_device(pnp_id *p, int csn)
nod->dev.id_driver->name ? nod->dev.id_driver->name : "unknown",
unit, dvp->pd_name, name, p->serial);
if (nod->dev.id_alive) {
- if (nod->dev.id_irq != 0 && nod->dev.id_intr != NULL) {
+ if (nod->dev.id_irq) {
/* the board uses interrupts. Register it. */
if (dvp->imask)
INTRMASK( *(dvp->imask), nod->dev.id_irq );
@@ -533,7 +533,7 @@ pnp_scan_resdata(pnp_id *p, int csn)
bcopy(resinfo, &p->comp_id, 4);
retval = TRUE;
if (bootverbose)
- printf("PnP: CSN %d COMP_DEVICE_ID = 0x%08lx\n", csn, p->comp_id);
+ printf("PnP: CSN %d COMP_DEVICE_ID = 0x%08x\n", csn, p->comp_id);
}
/*
* We found what we were looking for, or got an error from
diff --git a/sys/i386/isa/ppc.c b/sys/i386/isa/ppc.c
index bd6249b33a71..4dc6a44178d2 100644
--- a/sys/i386/isa/ppc.c
+++ b/sys/i386/isa/ppc.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppc.c,v 1.14 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppc.c,v 1.8 1998/09/13 20:57:06 nsouch Exp $
*
*/
#include "ppc.h"
@@ -49,11 +49,6 @@
#include <i386/isa/ppcreg.h>
-#include "opt_ppc.h"
-
-#define LOG_PPC(function, ppc, string) \
- if (bootverbose) printf("%s: %s\n", function, string)
-
static int ppcprobe(struct isa_device *);
static int ppcattach(struct isa_device *);
@@ -66,7 +61,7 @@ static int nppc = 0;
static char *ppc_types[] = {
"SMC-like", "SMC FDC37C665GT", "SMC FDC37C666GT", "PC87332", "PC87306",
- "82091AA", "Generic", "W83877F", "W83877AF", "Winbond", "PC87334", 0
+ "82091AA", "Generic", "W83877F", "W83877AF", "Winbond", 0
};
/* list of available modes */
@@ -113,12 +108,12 @@ static void ppc_insw_epp(int unit, char *addr, int cnt) {
static void ppc_insl_epp(int unit, char *addr, int cnt) {
insl(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
-static u_char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
-static u_char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
-static u_char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
-static u_char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
-static u_char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
-static u_char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
+static char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
+static char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
+static char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
+static char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
+static char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
+static char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
static void ppc_wdtr(int unit, char byte) { w_dtr(ppcdata[unit], byte); }
static void ppc_wstr(int unit, char byte) { w_str(ppcdata[unit], byte); }
@@ -129,15 +124,11 @@ static void ppc_wfifo(int unit, char byte) { w_fifo(ppcdata[unit], byte); }
static void ppc_reset_epp_timeout(int);
static void ppc_ecp_sync(int);
-static ointhand2_t ppcintr;
static int ppc_exec_microseq(int, struct ppb_microseq **);
static int ppc_generic_setmode(int, int);
static int ppc_smclike_setmode(int, int);
-static int ppc_read(int, char *, int, int);
-static int ppc_write(int, char *, int, int);
-
static struct ppb_adapter ppc_smclike_adapter = {
0, /* no intr handler, filled by chipset dependent code */
@@ -146,7 +137,7 @@ static struct ppb_adapter ppc_smclike_adapter = {
ppc_exec_microseq,
- ppc_smclike_setmode, ppc_read, ppc_write,
+ ppc_smclike_setmode,
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
@@ -163,7 +154,7 @@ static struct ppb_adapter ppc_generic_adapter = {
ppc_exec_microseq,
- ppc_generic_setmode, ppc_read, ppc_write,
+ ppc_generic_setmode,
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
@@ -181,11 +172,8 @@ ppc_ecp_sync(int unit) {
struct ppc_data *ppc = ppcdata[unit];
int i, r;
- if (!(ppc->ppc_avm & PPB_ECP))
- return;
-
r = r_ecr(ppc);
- if ((r & 0xe0) != PPC_ECR_EPP)
+ if ((r & 0xe0) != 0x80)
return;
for (i = 0; i < 100; i++) {
@@ -201,115 +189,13 @@ ppc_ecp_sync(int unit) {
return;
}
-/*
- * ppc_detect_fifo()
- *
- * Detect parallel port FIFO
- */
-static int
-ppc_detect_fifo(struct ppc_data *ppc)
+void
+ppcintr(int unit)
{
- char ecr_sav;
- char ctr_sav, ctr, cc;
- short i;
-
- /* save registers */
- ecr_sav = r_ecr(ppc);
- ctr_sav = r_ctr(ppc);
-
- /* enter ECP configuration mode, no interrupt, no DMA */
- w_ecr(ppc, 0xf4);
-
- /* read PWord size - transfers in FIFO mode must be PWord aligned */
- ppc->ppc_pword = (r_cnfgA(ppc) & PPC_PWORD_MASK);
-
- /* XXX 16 and 32 bits implementations not supported */
- if (ppc->ppc_pword != PPC_PWORD_8) {
- LOG_PPC(__FUNCTION__, ppc, "PWord not supported");
- goto error;
- }
-
- w_ecr(ppc, 0x34); /* byte mode, no interrupt, no DMA */
- ctr = r_ctr(ppc);
- w_ctr(ppc, ctr | PCD); /* set direction to 1 */
-
- /* enter ECP test mode, no interrupt, no DMA */
- w_ecr(ppc, 0xd4);
-
- /* flush the FIFO */
- for (i=0; i<1024; i++) {
- if (r_ecr(ppc) & PPC_FIFO_EMPTY)
- break;
- cc = r_fifo(ppc);
- }
-
- if (i >= 1024) {
- LOG_PPC(__FUNCTION__, ppc, "can't flush FIFO");
- goto error;
- }
-
- /* enable interrupts, no DMA */
- w_ecr(ppc, 0xd0);
-
- /* determine readIntrThreshold
- * fill the FIFO until serviceIntr is set
- */
- for (i=0; i<1024; i++) {
- w_fifo(ppc, (char)i);
- if (!ppc->ppc_rthr && (r_ecr(ppc) & PPC_SERVICE_INTR)) {
- /* readThreshold reached */
- ppc->ppc_rthr = i+1;
- }
- if (r_ecr(ppc) & PPC_FIFO_FULL) {
- ppc->ppc_fifo = i+1;
- break;
- }
- }
-
- if (i >= 1024) {
- LOG_PPC(__FUNCTION__, ppc, "can't fill FIFO");
- goto error;
- }
+ /* call directly upper code */
+ ppb_intr(&ppcdata[unit]->ppc_link);
- w_ecr(ppc, 0xd4); /* test mode, no interrupt, no DMA */
- w_ctr(ppc, ctr & ~PCD); /* set direction to 0 */
- w_ecr(ppc, 0xd0); /* enable interrupts */
-
- /* determine writeIntrThreshold
- * empty the FIFO until serviceIntr is set
- */
- for (i=ppc->ppc_fifo; i>0; i--) {
- if (r_fifo(ppc) != (char)(ppc->ppc_fifo-i)) {
- LOG_PPC(__FUNCTION__, ppc, "invalid data in FIFO");
- goto error;
- }
- if (r_ecr(ppc) & PPC_SERVICE_INTR) {
- /* writeIntrThreshold reached */
- ppc->ppc_wthr = ppc->ppc_fifo - i+1;
- }
- /* if FIFO empty before the last byte, error */
- if (i>1 && (r_ecr(ppc) & PPC_FIFO_EMPTY)) {
- LOG_PPC(__FUNCTION__, ppc, "data lost in FIFO");
- goto error;
- }
- }
-
- /* FIFO must be empty after the last byte */
- if (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
- LOG_PPC(__FUNCTION__, ppc, "can't empty the FIFO");
- goto error;
- }
-
- w_ctr(ppc, ctr_sav);
- w_ecr(ppc, ecr_sav);
-
- return (0);
-
-error:
- w_ctr(ppc, ctr_sav);
- w_ecr(ppc, ecr_sav);
-
- return (EINVAL);
+ return;
}
static int
@@ -318,7 +204,7 @@ ppc_detect_port(struct ppc_data *ppc)
w_ctr(ppc, 0x0c); /* To avoid missing PS2 ports */
w_dtr(ppc, 0xaa);
- if (r_dtr(ppc) != 0xaa)
+ if (r_dtr(ppc) != (char) 0xaa)
return (0);
return (1);
@@ -334,44 +220,27 @@ ppc_detect_port(struct ppc_data *ppc)
*/
static int pc873xx_basetab[] = {0x0398, 0x026e, 0x015c, 0x002e, 0};
static int pc873xx_porttab[] = {0x0378, 0x03bc, 0x0278, 0};
-static int pc873xx_irqtab[] = {5, 7, 5, 0};
-
-static int pc873xx_regstab[] = {
- PC873_FER, PC873_FAR, PC873_PTR,
- PC873_FCR, PC873_PCR, PC873_PMC,
- PC873_TUP, PC873_SID, PC873_PNP0,
- PC873_PNP1, PC873_LPTBA, -1
-};
-
-static char *pc873xx_rnametab[] = {
- "FER", "FAR", "PTR", "FCR", "PCR",
- "PMC", "TUP", "SID", "PNP0", "PNP1",
- "LPTBA", NULL
-};
static int
ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never forced */
{
static int index = 0;
- int idport, irq;
- int ptr, pcr, val, i;
+ int base, idport;
+ int val;
while ((idport = pc873xx_basetab[index++])) {
/* XXX should check first to see if this location is already claimed */
/*
- * Pull the 873xx through the power-on ID cycle (2.2,1.).
- * We can't use this to locate the chip as it may already have
- * been used by the BIOS.
+ * Pull the 873xx through the power-on ID cycle (2.2,1.). We can't use this
+ * to locate the chip as it may already have been used by the BIOS.
*/
- (void)inb(idport); (void)inb(idport);
- (void)inb(idport); (void)inb(idport);
+ (void)inb(idport); (void)inb(idport); (void)inb(idport); (void)inb(idport);
/*
* Read the SID byte. Possible values are :
*
- * 01010xxx PC87334
* 0001xxxx PC87332
* 01110xxx PC87306
*/
@@ -381,27 +250,14 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for
ppc->ppc_type = NS_PC87332;
} else if ((val & 0xf8) == 0x70) {
ppc->ppc_type = NS_PC87306;
- } else if ((val & 0xf8) == 0x50) {
- ppc->ppc_type = NS_PC87334;
} else {
if (bootverbose && (val != 0xff))
printf("PC873xx probe at 0x%x got unknown ID 0x%x\n", idport, val);
continue ; /* not recognised */
}
-
- /* print registers */
- if (bootverbose) {
- printf("PC873xx");
- for (i=0; pc873xx_regstab[i] != -1; i++) {
- outb(idport, pc873xx_regstab[i]);
- printf(" %s=0x%x", pc873xx_rnametab[i],
- inb(idport + 1) & 0xff);
- }
- printf("\n");
- }
/*
- * We think we have one. Is it enabled and where we want it to be?
+ * We think we have one. Is it enabled and where we want it to be?
*/
outb(idport, PC873_FER);
val = inb(idport + 1);
@@ -419,168 +275,96 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for
pc873xx_porttab[val], ppc->ppc_base);
continue;
}
-
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
-
- /* get irq settings */
- if (ppc->ppc_base == 0x378)
- irq = (ptr & PC873_LPTBIRQ7) ? 7 : 5;
- else
- irq = pc873xx_irqtab[val];
-
- if (bootverbose)
- printf("PC873xx irq %d at 0x%x\n", irq, ppc->ppc_base);
- /*
- * Check if irq settings are correct
+ /*
+ * This is the port we want. Can we dink with it to improve
+ * our chances?
*/
- if (irq != ppc->ppc_irq) {
- /*
- * If the chipset is not locked and base address is 0x378,
- * we have another chance
- */
- if (ppc->ppc_base == 0x378 && !(ptr & PC873_CFGLOCK)) {
- if (ppc->ppc_irq == 7) {
- outb(idport + 1, (ptr | PC873_LPTBIRQ7));
- outb(idport + 1, (ptr | PC873_LPTBIRQ7));
- } else {
- outb(idport + 1, (ptr & ~PC873_LPTBIRQ7));
- outb(idport + 1, (ptr & ~PC873_LPTBIRQ7));
- }
- if (bootverbose)
- printf("PC873xx irq set to %d\n", ppc->ppc_irq);
- } else {
- if (bootverbose)
- printf("PC873xx sorry, can't change irq setting\n");
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ if (val & PC873_CFGLOCK) {
+ if (bootverbose)
+ printf("PC873xx locked\n");
+
+ /* work out what mode we're in */
+ ppc->ppc_avm |= PPB_NIBBLE; /* worst case */
+
+ outb(idport, PC873_PCR);
+ val = inb(idport + 1);
+ if ((val & PC873_EPPEN) && (val & PC873_EPP19)) {
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ if (!(val & PC873_EPPRDIR)) {
+ ppc->ppc_avm |= PPB_EPP; /* As we would have done it anwyay */
}
+ } else if ((val & PC873_ECPEN) && (val & PC873_ECPCLK)) {
+ ppc->ppc_avm |= PPB_PS2; /* tolerable alternative */
+ }
} else {
- if (bootverbose)
- printf("PC873xx irq settings are correct\n");
- }
-
- outb(idport, PC873_PCR);
- pcr = inb(idport + 1);
-
- if ((ptr & PC873_CFGLOCK) || !chipset_mode) {
if (bootverbose)
- printf("PC873xx %s", (ptr & PC873_CFGLOCK)?"locked":"unlocked");
-
- ppc->ppc_avm |= PPB_NIBBLE;
- if (bootverbose)
- printf(", NIBBLE");
-
- if (pcr & PC873_EPPEN) {
- ppc->ppc_avm |= PPB_EPP;
-
+ printf("PC873xx unlocked, ");
+
+#if 0 /* broken */
+ /*
+ * Frob the zero-wait-state option if possible; it causes
+ * unreliable operation.
+ */
+ outb(idport, PC873_FCR);
+ val = inb(idport + 1);
+ if ((ppc->ppc_type == NS_PC87306) || /* we are a '306 */
+ !(val & PC873_ZWSPWDN)) { /* or pin _is_ ZWS */
+ val &= ~PC873_ZWS;
+ outb(idport + 1, val); /* must disable ZWS */
+ outb(idport + 1, val);
+
if (bootverbose)
- printf(", EPP");
-
- if (pcr & PC873_EPP19)
- ppc->ppc_epp = EPP_1_9;
- else
- ppc->ppc_epp = EPP_1_7;
+ printf("ZWS %s, ", (val & PC873_ZWS) ? "enabled" : "disabled");
+ }
- if ((ppc->ppc_type == NS_PC87332) && bootverbose) {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- if (ptr & PC873_EPPRDIR)
- printf(", Regular mode");
- else
- printf(", Automatic mode");
- }
- } else if (pcr & PC873_ECPEN) {
- ppc->ppc_avm |= PPB_ECP;
+#endif
+ if (bootverbose)
+ printf("reconfiguring for ");
+
+ /*
+ * if the chip is at 0x3bc, we can't use EPP as there's no room
+ * for the extra registers.
+ *
+ * XXX should we use ECP mode always and use the EPP submode?
+ */
+ if (ppc->ppc_base != 0x3bc) {
if (bootverbose)
- printf(", ECP");
+ printf("EPP 1.9\n");
+
+ /* configure for EPP 1.9 operation XXX should be configurable */
+ outb(idport, PC873_PCR);
+ val = inb(idport + 1);
+ val &= ~(PC873_ECPEN | PC873_ECPCLK); /* disable ECP */
+ val |= (PC873_EPPEN | PC873_EPP19); /* enable EPP */
+ outb(idport + 1, val);
+ outb(idport + 1, val);
+
+ /* enable automatic direction turnover */
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ val &= ~PC873_EPPRDIR; /* disable "regular" direction change */
+ outb(idport + 1, val);
+ outb(idport + 1, val);
- if (pcr & PC873_ECPCLK) { /* XXX */
- ppc->ppc_avm |= PPB_PS2;
- if (bootverbose)
- printf(", PS/2");
- }
+ /* we are an EPP-32 port */
+ ppc->ppc_avm |= PPB_EPP;
} else {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- if (ptr & PC873_EXTENDED) {
- ppc->ppc_avm |= PPB_SPP;
- if (bootverbose)
- printf(", SPP");
- }
- }
- } else {
if (bootverbose)
- printf("PC873xx unlocked");
-
- if (chipset_mode & PPB_ECP) {
- if ((chipset_mode & PPB_EPP) && bootverbose)
- printf(", ECP+EPP not supported");
-
- pcr &= ~PC873_EPPEN;
- pcr |= (PC873_ECPEN | PC873_ECPCLK); /* XXX */
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- if (bootverbose)
- printf(", ECP");
-
- } else if (chipset_mode & PPB_EPP) {
- pcr &= ~(PC873_ECPEN | PC873_ECPCLK);
- pcr |= (PC873_EPPEN | PC873_EPP19);
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- ppc->ppc_epp = EPP_1_9; /* XXX */
-
- if (bootverbose)
- printf(", EPP1.9");
-
- /* enable automatic direction turnover */
- if (ppc->ppc_type == NS_PC87332) {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- ptr &= ~PC873_EPPRDIR;
- outb(idport + 1, ptr);
- outb(idport + 1, ptr);
-
- if (bootverbose)
- printf(", Automatic mode");
- }
- } else {
- pcr &= ~(PC873_ECPEN | PC873_ECPCLK | PC873_EPPEN);
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- /* configure extended bit in PTR */
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
-
- if (chipset_mode & PPB_PS2) {
- ptr |= PC873_EXTENDED;
-
- if (bootverbose)
- printf(", PS/2");
-
- } else {
- /* default to NIBBLE mode */
- ptr &= ~PC873_EXTENDED;
-
- if (bootverbose)
- printf(", NIBBLE");
- }
- outb(idport + 1, ptr);
- outb(idport + 1, ptr);
- }
+ printf("ECP\n");
+
+ /* configure as an ECP port to get bidirectional operation for now */
+ outb(idport, PC873_PCR);
+ outb(idport + 1, inb(idport + 1) | PC873_ECPEN | PC873_ECPCLK);
- ppc->ppc_avm = chipset_mode;
+ /* we look like a PS/2 port */
+ ppc->ppc_avm |= PPB_PS2;
+ }
}
- if (bootverbose)
- printf("\n");
-
- ppc->ppc_link.adapter = &ppc_generic_adapter;
- ppc_generic_setmode(ppc->ppc_unit, chipset_mode);
-
return(chipset_mode);
}
return(-1);
@@ -767,13 +551,6 @@ config:
ppc->ppc_avm = chipset_mode;
}
- /* set FIFO threshold to 16 */
- if (ppc->ppc_avm & PPB_ECP) {
- /* select CRA */
- outb(csr, 0xa);
- outb(cio, 16);
- }
-
end_detect:
if (bootverbose)
@@ -821,7 +598,7 @@ static int w83877f_hefs[] = { WINB_HEFERE, WINB_HEFRAS, WINB_HEFERE | WINB_HEFRA
static int
ppc_w83877f_detect(struct ppc_data *ppc, int chipset_mode)
{
- int i, j, efer;
+ int i, j, efer, base;
unsigned char r, hefere, hefras;
for (i = 0; i < 4; i ++) {
@@ -996,6 +773,8 @@ found:
static int
ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
{
+ char save_control;
+
/* default to generic */
ppc->ppc_link.adapter = &ppc_generic_adapter;
@@ -1004,14 +783,14 @@ ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
if (!chipset_mode) {
/* first, check for ECP */
- w_ecr(ppc, PPC_ECR_PS2);
- if ((r_ecr(ppc) & 0xe0) == PPC_ECR_PS2) {
+ w_ecr(ppc, 0x20);
+ if ((r_ecr(ppc) & 0xe0) == 0x20) {
ppc->ppc_avm |= PPB_ECP | PPB_SPP;
if (bootverbose)
printf(" ECP SPP");
/* search for SMC style ECP+EPP mode */
- w_ecr(ppc, PPC_ECR_EPP);
+ w_ecr(ppc, 0x80);
}
/* try to reset EPP timeout bit */
@@ -1031,7 +810,7 @@ ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
}
} else {
/* restore to standard mode */
- w_ecr(ppc, PPC_ECR_STD);
+ w_ecr(ppc, 0x0);
}
/* XXX try to detect NIBBLE and PS2 modes */
@@ -1083,25 +862,13 @@ ppc_detect(struct ppc_data *ppc, int chipset_mode) {
*
* after detection, the port must support running in compatible mode
*/
- if (ppc->ppc_flags & 0x40) {
- if (bootverbose)
- printf("ppc: chipset forced to generic\n");
-
- ppc->ppc_mode = ppc_generic_detect(ppc, chipset_mode);
-
- } else {
- for (i=0; chipset_detect[i] != NULL; i++) {
- if ((mode = chipset_detect[i](ppc, chipset_mode)) != -1) {
- ppc->ppc_mode = mode;
- break;
- }
+ for (i=0; chipset_detect[i] != NULL; i++) {
+ if ((mode = chipset_detect[i](ppc, chipset_mode)) != -1) {
+ ppc->ppc_mode = mode;
+ break;
}
}
- /* configure/detect ECP FIFO */
- if ((ppc->ppc_avm & PPB_ECP) && !(ppc->ppc_flags & 0x80))
- ppc_detect_fifo(ppc);
-
return (0);
}
@@ -1128,7 +895,7 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
struct ppb_microseq *stack = 0;
/* microsequence registers are equivalent to PC-like port registers */
-#define r_reg(register,ppc) (inb((ppc)->ppc_base + register))
+#define r_reg(register,ppc) ((char)inb((ppc)->ppc_base + register))
#define w_reg(register,ppc,byte) outb((ppc)->ppc_base + register, byte)
#define INCR_PC (mi ++) /* increment program counter */
@@ -1326,244 +1093,6 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
/* unreached */
}
-static void
-ppcintr(int unit)
-{
- struct ppc_data *ppc = ppcdata[unit];
- char ctr, ecr;
-
- ctr = r_ctr(ppc);
- ecr = r_ecr(ppc);
-
-#ifdef PPC_DEBUG
- printf("!");
-#endif
-
- /* don't use ecp mode with IRQENABLE set */
- if (ctr & IRQENABLE) {
- /* call upper code */
- ppb_intr(&ppc->ppc_link);
- return;
- }
-
- if (ctr & nFAULT) {
- if (ppc->ppc_irqstat & PPC_IRQ_nFAULT) {
-
- w_ecr(ppc, ecr | PPC_nFAULT_INTR);
- ppc->ppc_irqstat &= ~PPC_IRQ_nFAULT;
- } else {
- /* call upper code */
- ppb_intr(&ppc->ppc_link);
- return;
- }
- }
-
- if (ppc->ppc_irqstat & PPC_IRQ_DMA) {
- /* disable interrupts (should be done by hardware though) */
- w_ecr(ppc, ecr | PPC_SERVICE_INTR);
- ppc->ppc_irqstat &= ~PPC_IRQ_DMA;
- ecr = r_ecr(ppc);
-
- /* check if DMA completed */
- if ((ppc->ppc_avm & PPB_ECP) && (ecr & PPC_ENABLE_DMA)) {
-#ifdef PPC_DEBUG
- printf("a");
-#endif
- /* stop DMA */
- w_ecr(ppc, ecr & ~PPC_ENABLE_DMA);
- ecr = r_ecr(ppc);
-
- if (ppc->ppc_dmastat == PPC_DMA_STARTED) {
-#ifdef PPC_DEBUG
- printf("d");
-#endif
- isa_dmadone(
- ppc->ppc_dmaflags,
- ppc->ppc_dmaddr,
- ppc->ppc_dmacnt,
- ppc->ppc_dmachan);
-
- ppc->ppc_dmastat = PPC_DMA_COMPLETE;
-
- /* wakeup the waiting process */
- wakeup((caddr_t)ppc);
- }
- }
- } else if (ppc->ppc_irqstat & PPC_IRQ_FIFO) {
-
- /* classic interrupt I/O */
- ppc->ppc_irqstat &= ~PPC_IRQ_FIFO;
-
- }
-
- return;
-}
-
-static int
-ppc_read(int unit, char *buf, int len, int mode)
-{
- return (EINVAL);
-}
-
-/*
- * Call this function if you want to send data in any advanced mode
- * of your parallel port: FIFO, DMA
- *
- * If what you want is not possible (no ECP, no DMA...),
- * EINVAL is returned
- */
-static int
-ppc_write(int unit, char *buf, int len, int how)
-{
- struct ppc_data *ppc = ppcdata[unit];
- char ecr, ecr_sav, ctr, ctr_sav;
- int s, error = 0;
- int spin;
-
-#ifdef PPC_DEBUG
- printf("w");
-#endif
-
- ecr_sav = r_ecr(ppc);
- ctr_sav = r_ctr(ppc);
-
- /*
- * Send buffer with DMA, FIFO and interrupts
- */
- if (ppc->ppc_avm & PPB_ECP) {
-
- if (ppc->ppc_dmachan >= 0) {
-
- /* byte mode, no intr, no DMA, dir=0, flush fifo
- */
- ecr = PPC_ECR_STD | PPC_DISABLE_INTR;
- w_ecr(ppc, ecr);
-
- /* disable nAck interrupts */
- ctr = r_ctr(ppc);
- ctr &= ~IRQENABLE;
- w_ctr(ppc, ctr);
-
- ppc->ppc_dmaflags = 0;
- ppc->ppc_dmaddr = (caddr_t)buf;
- ppc->ppc_dmacnt = (u_int)len;
-
- switch (ppc->ppc_mode) {
- case PPB_COMPATIBLE:
- /* compatible mode with FIFO, no intr, DMA, dir=0 */
- ecr = PPC_ECR_FIFO | PPC_DISABLE_INTR | PPC_ENABLE_DMA;
- break;
- case PPB_ECP:
- ecr = PPC_ECR_ECP | PPC_DISABLE_INTR | PPC_ENABLE_DMA;
- break;
- default:
- error = EINVAL;
- goto error;
- }
-
- w_ecr(ppc, ecr);
- ecr = r_ecr(ppc);
-
- /* enter splhigh() not to be preempted
- * by the dma interrupt, we may miss
- * the wakeup otherwise
- */
- s = splhigh();
-
- ppc->ppc_dmastat = PPC_DMA_INIT;
-
- /* enable interrupts */
- ecr &= ~PPC_SERVICE_INTR;
- ppc->ppc_irqstat = PPC_IRQ_DMA;
- w_ecr(ppc, ecr);
-
- isa_dmastart(
- ppc->ppc_dmaflags,
- ppc->ppc_dmaddr,
- ppc->ppc_dmacnt,
- ppc->ppc_dmachan);
-#ifdef PPC_DEBUG
- printf("s%d", ppc->ppc_dmacnt);
-#endif
- ppc->ppc_dmastat = PPC_DMA_STARTED;
-
- /* Wait for the DMA completed interrupt. We hope we won't
- * miss it, otherwise a signal will be necessary to unlock the
- * process.
- */
- do {
- /* release CPU */
- error = tsleep((caddr_t)ppc,
- PPBPRI | PCATCH, "ppcdma", 0);
-
- } while (error == EWOULDBLOCK);
-
- splx(s);
-
- if (error) {
-#ifdef PPC_DEBUG
- printf("i");
-#endif
- /* stop DMA */
- isa_dmadone(
- ppc->ppc_dmaflags, ppc->ppc_dmaddr,
- ppc->ppc_dmacnt, ppc->ppc_dmachan);
-
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;
- goto error;
- }
-
- /* wait for an empty fifo */
- while (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
-
- for (spin=100; spin; spin--)
- if (r_ecr(ppc) & PPC_FIFO_EMPTY)
- goto fifo_empty;
-#ifdef PPC_DEBUG
- printf("Z");
-#endif
- error = tsleep((caddr_t)ppc, PPBPRI | PCATCH, "ppcfifo", hz/100);
- if (error != EWOULDBLOCK) {
-#ifdef PPC_DEBUG
- printf("I");
-#endif
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;
- error = EINTR;
- goto error;
- }
- }
-
-fifo_empty:
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- } else
- error = EINVAL; /* XXX we should FIFO and
- * interrupts */
- } else
- error = EINVAL;
-
-error:
-
- /* PDRQ must be kept unasserted until nPDACK is
- * deasserted for a minimum of 350ns (SMC datasheet)
- *
- * Consequence may be a FIFO that never empty
- */
- DELAY(1);
-
- w_ecr(ppc, ecr_sav);
- w_ctr(ppc, ctr_sav);
-
- return (error);
-}
-
/*
* Configure current operating mode
*/
@@ -1571,34 +1100,32 @@ static int
ppc_generic_setmode(int unit, int mode)
{
struct ppc_data *ppc = ppcdata[unit];
- u_char ecr = 0;
+
+ /* back to compatible mode, XXX don't know yet what to do here */
+ if (mode == 0) {
+ ppc->ppc_mode = PPB_COMPATIBLE;
+ return (0);
+ }
/* check if mode is available */
- if (mode && !(ppc->ppc_avm & mode))
- return (EINVAL);
+ if (!(ppc->ppc_avm & mode))
+ return (EOPNOTSUPP);
/* if ECP mode, configure ecr register */
if (ppc->ppc_avm & PPB_ECP) {
- /* return to byte mode (keeping direction bit),
- * no interrupt, no DMA to be able to change to
- * ECP
- */
- w_ecr(ppc, PPC_ECR_RESET);
- ecr = PPC_DISABLE_INTR;
+ /* XXX disable DMA, enable interrupts */
if (mode & PPB_EPP)
- return (EINVAL);
- else if (mode & PPB_ECP)
- /* select ECP mode */
- ecr |= PPC_ECR_ECP;
+ return (EOPNOTSUPP);
else if (mode & PPB_PS2)
/* select PS2 mode with ECP */
- ecr |= PPC_ECR_PS2;
+ w_ecr(ppc, 0x20);
+ else if (mode & PPB_ECP)
+ /* select ECP mode */
+ w_ecr(ppc, 0x60);
else
- /* select COMPATIBLE/NIBBLE mode */
- ecr |= PPC_ECR_STD;
-
- w_ecr(ppc, ecr);
+ /* select standard parallel port mode */
+ w_ecr(ppc, 0x00);
}
ppc->ppc_mode = mode;
@@ -1606,50 +1133,42 @@ ppc_generic_setmode(int unit, int mode)
return (0);
}
-/*
- * The ppc driver is free to choose options like FIFO or DMA
- * if ECP mode is available.
- *
- * The 'RAW' option allows the upper drivers to force the ppc mode
- * even with FIFO, DMA available.
- */
int
ppc_smclike_setmode(int unit, int mode)
{
struct ppc_data *ppc = ppcdata[unit];
- u_char ecr = 0;
+
+ /* back to compatible mode, XXX don't know yet what to do here */
+ if (mode == 0) {
+ ppc->ppc_mode = PPB_COMPATIBLE;
+ return (0);
+ }
/* check if mode is available */
- if (mode && !(ppc->ppc_avm & mode))
- return (EINVAL);
+ if (!(ppc->ppc_avm & mode))
+ return (EOPNOTSUPP);
/* if ECP mode, configure ecr register */
if (ppc->ppc_avm & PPB_ECP) {
- /* return to byte mode (keeping direction bit),
- * no interrupt, no DMA to be able to change to
- * ECP or EPP mode
- */
- w_ecr(ppc, PPC_ECR_RESET);
- ecr = PPC_DISABLE_INTR;
+ /* XXX disable DMA, enable interrupts */
if (mode & PPB_EPP)
/* select EPP mode */
- ecr |= PPC_ECR_EPP;
- else if (mode & PPB_ECP)
- /* select ECP mode */
- ecr |= PPC_ECR_ECP;
+ w_ecr(ppc, 0x80);
else if (mode & PPB_PS2)
/* select PS2 mode with ECP */
- ecr |= PPC_ECR_PS2;
+ w_ecr(ppc, 0x20);
+ else if (mode & PPB_ECP)
+ /* select ECP mode */
+ w_ecr(ppc, 0x60);
else
- /* select COMPATIBLE/NIBBLE mode */
- ecr |= PPC_ECR_STD;
-
- w_ecr(ppc, ecr);
+ /* select standard parallel port mode */
+ w_ecr(ppc, 0x00);
}
ppc->ppc_mode = mode;
+
return (0);
}
@@ -1658,7 +1177,7 @@ ppc_smclike_setmode(int unit, int mode)
* Semantics of clearing EPP timeout bit.
* PC87332 - reading SPP_STR does it...
* SMC - write 1 to EPP timeout bit XXX
- * Others - (?) write 0 to EPP timeout bit
+ * Others - (???) write 0 to EPP timeout bit
*/
static void
ppc_reset_epp_timeout(int unit)
@@ -1678,6 +1197,7 @@ ppcprobe(struct isa_device *dvp)
{
static short next_bios_ppc = 0;
struct ppc_data *ppc;
+ int error;
/*
* If port not specified, use bios list.
@@ -1686,9 +1206,8 @@ ppcprobe(struct isa_device *dvp)
if((next_bios_ppc < BIOS_MAX_PPC) &&
(*(BIOS_PORTS+next_bios_ppc) != 0) ) {
dvp->id_iobase = *(BIOS_PORTS+next_bios_ppc++);
- if (bootverbose)
- printf("ppc: parallel port found at 0x%x\n",
- dvp->id_iobase);
+ printf("ppc: parallel port found at 0x%x\n",
+ dvp->id_iobase);
} else
return (0);
}
@@ -1712,9 +1231,6 @@ ppcprobe(struct isa_device *dvp)
ppc->ppc_unit = dvp->id_unit;
ppc->ppc_type = GENERIC;
- /* store boot flags */
- ppc->ppc_flags = dvp->id_flags;
-
ppc->ppc_mode = PPB_COMPATIBLE;
ppc->ppc_epp = (dvp->id_flags & 0x10) >> 4;
@@ -1722,9 +1238,7 @@ ppcprobe(struct isa_device *dvp)
* XXX Try and detect if interrupts are working
*/
if (!(dvp->id_flags & 0x20))
- ppc->ppc_irq = ffs(dvp->id_irq) - 1;
-
- ppc->ppc_dmachan = dvp->id_drq;
+ ppc->ppc_irq = (dvp->id_irq);
ppcdata[ppc->ppc_unit] = ppc;
nppc ++;
@@ -1742,6 +1256,8 @@ ppcprobe(struct isa_device *dvp)
if (ppc_detect(ppc, dvp->id_flags & 0xf))
goto error;
+end_probe:
+
return (1);
error:
@@ -1753,19 +1269,13 @@ ppcattach(struct isa_device *isdp)
{
struct ppc_data *ppc = ppcdata[isdp->id_unit];
struct ppb_data *ppbus;
+ char * mode;
printf("ppc%d: %s chipset (%s) in %s mode%s\n", ppc->ppc_unit,
ppc_types[ppc->ppc_type], ppc_avms[ppc->ppc_avm],
ppc_modes[ppc->ppc_mode], (PPB_IS_EPP(ppc->ppc_mode)) ?
ppc_epp_protocol[ppc->ppc_epp] : "");
- if (ppc->ppc_fifo)
- printf("ppc%d: FIFO with %d/%d/%d bytes threshold\n",
- ppc->ppc_unit, ppc->ppc_fifo, ppc->ppc_wthr,
- ppc->ppc_rthr);
-
- isdp->id_ointr = ppcintr;
-
/*
* Prepare ppbus data area for upper level code.
*/
@@ -1777,13 +1287,6 @@ ppcattach(struct isa_device *isdp)
ppc->ppc_link.ppbus = ppbus;
ppbus->ppb_link = &ppc->ppc_link;
- if ((ppc->ppc_avm & PPB_ECP) && (ppc->ppc_dmachan > 0)) {
-
- /* acquire the DMA channel forever */
- isa_dma_acquire(ppc->ppc_dmachan);
- isa_dmainit(ppc->ppc_dmachan, 1024); /* nlpt.BUFSIZE */
- }
-
/*
* Probe the ppbus and attach devices found.
*/
diff --git a/sys/i386/isa/ppcreg.h b/sys/i386/isa/ppcreg.h
index c847e6ccd218..fe7e72480fe5 100644
--- a/sys/i386/isa/ppcreg.h
+++ b/sys/i386/isa/ppcreg.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppcreg.h,v 1.6 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppcreg.h,v 1.3 1998/08/03 19:14:33 msmith Exp $
*
*/
#ifndef __PPCREG_H
@@ -32,17 +32,16 @@
/*
* Parallel Port Chipset type.
*/
-#define SMC_LIKE 0
-#define SMC_37C665GT 1
-#define SMC_37C666GT 2
-#define NS_PC87332 3
-#define NS_PC87306 4
-#define INTEL_820191AA 5 /* XXX not implemented */
-#define GENERIC 6
-#define WINB_W83877F 7
-#define WINB_W83877AF 8
-#define WINB_UNKNOWN 9
-#define NS_PC87334 10
+#define SMC_LIKE 0x0
+#define SMC_37C665GT 0x1
+#define SMC_37C666GT 0x2
+#define NS_PC87332 0x3
+#define NS_PC87306 0x4
+#define INTEL_820191AA 0x5 /* XXX not implemented */
+#define GENERIC 0x6
+#define WINB_W83877F 0x7
+#define WINB_W83877AF 0x8
+#define WINB_UNKNOWN 0x9
/*
* Generic structure to hold parallel port chipset info.
@@ -55,34 +54,6 @@ struct ppc_data {
int ppc_mode; /* chipset current mode */
int ppc_avm; /* chipset available modes */
-#define PPC_IRQ_NONE 0x0
-#define PPC_IRQ_nACK 0x1
-#define PPC_IRQ_DMA 0x2
-#define PPC_IRQ_FIFO 0x4
-#define PPC_IRQ_nFAULT 0x8
- int ppc_irqstat; /* remind irq settings */
-
-#define PPC_DMA_INIT 0x01
-#define PPC_DMA_STARTED 0x02
-#define PPC_DMA_COMPLETE 0x03
-#define PPC_DMA_INTERRUPTED 0x04
-#define PPC_DMA_ERROR 0x05
- int ppc_dmastat; /* dma state */
- int ppc_dmachan; /* dma channel */
- int ppc_dmaflags; /* dma transfer flags */
- caddr_t ppc_dmaddr; /* buffer address */
- u_int ppc_dmacnt; /* count of bytes sent with dma */
-
-#define PPC_PWORD_MASK 0x30
-#define PPC_PWORD_16 0x00
-#define PPC_PWORD_8 0x10
-#define PPC_PWORD_32 0x20
- char ppc_pword; /* PWord size */
- short ppc_fifo; /* FIFO threshold */
-
- short ppc_wthr; /* writeIntrThresold */
- short ppc_rthr; /* readIntrThresold */
-
#define ppc_base ppc_link.base
#define ppc_epp ppc_link.epp_protocol
#define ppc_irq ppc_link.id_irq
@@ -99,44 +70,25 @@ struct ppc_data {
* Parallel Port Chipset registers.
*/
#define PPC_SPP_DTR 0 /* SPP data register */
-#define PPC_ECP_A_FIFO 0 /* ECP Address fifo register */
#define PPC_SPP_STR 1 /* SPP status register */
#define PPC_SPP_CTR 2 /* SPP control register */
#define PPC_EPP_DATA 4 /* EPP data register (8, 16 or 32 bit) */
-#define PPC_ECP_D_FIFO 0x400 /* ECP Data fifo register */
-#define PPC_ECP_CNFGA 0x400 /* Configuration register A */
-#define PPC_ECP_CNFGB 0x401 /* Configuration register B */
+#define PPC_ECP_FIFO 0x400 /* ECP fifo register */
#define PPC_ECP_ECR 0x402 /* ECP extended control register */
-#define PPC_FIFO_EMPTY 0x1 /* ecr register - bit 0 */
-#define PPC_FIFO_FULL 0x2 /* ecr register - bit 1 */
-#define PPC_SERVICE_INTR 0x4 /* ecr register - bit 2 */
-#define PPC_ENABLE_DMA 0x8 /* ecr register - bit 3 */
-#define PPC_nFAULT_INTR 0x10 /* ecr register - bit 4 */
-#define PPC_ECR_STD 0x0
-#define PPC_ECR_PS2 0x20
-#define PPC_ECR_FIFO 0x40
-#define PPC_ECR_ECP 0x60
-#define PPC_ECR_EPP 0x80
-
-#define PPC_DISABLE_INTR (PPC_SERVICE_INTR | PPC_nFAULT_INTR)
-#define PPC_ECR_RESET (PPC_ECR_PS2 | PPC_DISABLE_INTR)
-
-#define r_dtr(ppc) (inb((ppc)->ppc_base + PPC_SPP_DTR))
-#define r_str(ppc) (inb((ppc)->ppc_base + PPC_SPP_STR))
-#define r_ctr(ppc) (inb((ppc)->ppc_base + PPC_SPP_CTR))
-#define r_epp(ppc) (inb((ppc)->ppc_base + PPC_EPP_DATA))
-#define r_cnfgA(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGA))
-#define r_cnfgB(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGB))
-#define r_ecr(ppc) (inb((ppc)->ppc_base + PPC_ECP_ECR))
-#define r_fifo(ppc) (inb((ppc)->ppc_base + PPC_ECP_D_FIFO))
+#define r_dtr(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_DTR))
+#define r_str(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_STR))
+#define r_ctr(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_CTR))
+#define r_epp(ppc) ((char)inb((ppc)->ppc_base + PPC_EPP_DATA))
+#define r_ecr(ppc) ((char)inb((ppc)->ppc_base + PPC_ECP_ECR))
+#define r_fifo(ppc) ((char)inb((ppc)->ppc_base + PPC_ECP_FIFO))
#define w_dtr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_DTR, byte)
#define w_str(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_STR, byte)
#define w_ctr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_CTR, byte)
#define w_epp(ppc,byte) outb((ppc)->ppc_base + PPC_EPP_DATA, byte)
#define w_ecr(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_ECR, byte)
-#define w_fifo(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_D_FIFO, byte)
+#define w_fifo(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_FIFO, byte)
/*
* Register defines for the PC873xx parts
@@ -148,8 +100,6 @@ struct ppc_data {
#define PC873_PTR 0x02
#define PC873_CFGLOCK (1<<6)
#define PC873_EPPRDIR (1<<7)
-#define PC873_EXTENDED (1<<7)
-#define PC873_LPTBIRQ7 (1<<3)
#define PC873_FCR 0x03
#define PC873_ZWS (1<<5)
#define PC873_ZWSPWDN (1<<6)
@@ -161,9 +111,6 @@ struct ppc_data {
#define PC873_PMC 0x06
#define PC873_TUP 0x07
#define PC873_SID 0x08
-#define PC873_PNP0 0x1b
-#define PC873_PNP1 0x1c
-#define PC873_LPTBA 0x19
/*
* Register defines for the SMC FDC37C66xGT parts
diff --git a/sys/i386/isa/prof_machdep.c b/sys/i386/isa/prof_machdep.c
index 60167ea8ae79..f2849ad1a9dd 100644
--- a/sys/i386/isa/prof_machdep.c
+++ b/sys/i386/isa/prof_machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: prof_machdep.c,v 1.10 1998/04/19 15:41:06 bde Exp $
+ * $Id: prof_machdep.c,v 1.9 1998/04/15 17:45:43 bde Exp $
*/
#ifdef GUPROF
@@ -171,8 +171,7 @@ cputime()
{
u_int count;
int delta;
-#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) && \
- defined(PERFMON) && defined(I586_PMC_GUPROF)
+#ifdef I586_PMC_GUPROF
u_quad_t event_count;
#endif
u_char high, low;
@@ -230,11 +229,9 @@ static int
sysctl_machdep_cputime_clock SYSCTL_HANDLER_ARGS
{
int clock;
- int error;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
int event;
+ int error;
struct pmc pmc;
-#endif
clock = cputime_clock;
#if defined(PERFMON) && defined(I586_PMC_GUPROF)
diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c
index ca85f57386d8..389b1b8828e2 100644
--- a/sys/i386/isa/psm.c
+++ b/sys/i386/isa/psm.c
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: psm.c,v 1.59 1999/01/11 03:18:23 yokota Exp $
+ * $Id: psm.c,v 1.54 1998/07/06 16:10:06 eivind Exp $
*/
/*
@@ -86,10 +86,8 @@
#include <machine/limits.h>
#include <machine/mouse.h>
-#include <dev/kbd/atkbdcreg.h>
-
-#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
+#include <i386/isa/kbdio.h>
/*
* Driver specific options: the following options may be set by
@@ -181,20 +179,20 @@ static struct psm_softc { /* Driver status information */
#define PSM_CONFIG_RESOLUTION 0x000f /* resolution */
#define PSM_CONFIG_ACCEL 0x00f0 /* acceleration factor */
#define PSM_CONFIG_NOCHECKSYNC 0x0100 /* disable sync. test */
-#define PSM_CONFIG_NOIDPROBE 0x0200 /* disable mouse model probe */
-#define PSM_CONFIG_NORESET 0x0400 /* don't reset the mouse */
-#define PSM_CONFIG_FORCETAP 0x0800 /* assume `tap' action exists */
-#define PSM_CONFIG_IGNPORTERROR 0x1000 /* ignore error in aux port test */
#define PSM_CONFIG_FLAGS (PSM_CONFIG_RESOLUTION \
| PSM_CONFIG_ACCEL \
- | PSM_CONFIG_NOCHECKSYNC \
- | PSM_CONFIG_NOIDPROBE \
- | PSM_CONFIG_NORESET \
- | PSM_CONFIG_FORCETAP \
- | PSM_CONFIG_IGNPORTERROR)
+ | PSM_CONFIG_NOCHECKSYNC)
/* other flags (flags) */
+/*
+ * Pass mouse data packet to the user land program `as is', even if
+ * the mouse has vendor-specific enhanced features and uses non-standard
+ * packet format. Otherwise manipulate the mouse data packet so that
+ * it can be recognized by the programs which can only understand
+ * the standard packet format.
+*/
+#define PSM_FLAGS_NATIVEMODE 0x0200
/* for backward compatibility */
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
@@ -240,19 +238,14 @@ static int get_aux_id __P((KBDC));
static int set_mouse_sampling_rate __P((KBDC, int));
static int set_mouse_scaling __P((KBDC, int));
static int set_mouse_resolution __P((KBDC, int));
-#ifdef PSM_RESETAFTERSUSPEND
static int set_mouse_mode __P((KBDC));
-#endif /* PSM_RESETAFTERSUSPEND */
static int get_mouse_buttons __P((KBDC));
static int is_a_mouse __P((int));
static void recover_from_error __P((KBDC));
static int restore_controller __P((KBDC, int));
-#ifdef PSM_RESETAFTERSUSPEND
static int reinitialize __P((int, mousemode_t *));
-#endif
static int doopen __P((int, int));
static char *model_name(int);
-static ointhand2_t psmintr;
/* vendor specific features */
typedef int probefunc_t __P((struct psm_softc *));
@@ -287,7 +280,6 @@ static struct {
{ MOUSE_MODEL_GENERIC,
0xc0, MOUSE_PS2_PACKETSIZE, NULL, },
};
-#define GENERIC_MOUSE_ENTRY 6
/* device driver declarateion */
struct isa_driver psmdriver = { psmprobe, psmattach, "psm", FALSE };
@@ -435,7 +427,6 @@ set_mouse_resolution(KBDC kbdc, int val)
return ((res == PSM_ACK) ? val : -1);
}
-#ifdef PSM_RESETAFTERSUSPEND
/*
* NOTE: once `set_mouse_mode()' is called, the mouse device must be
* re-enabled by calling `enable_aux_dev()'
@@ -451,8 +442,6 @@ set_mouse_mode(KBDC kbdc)
return (res == PSM_ACK);
}
-#endif /* PSM_RESETAFTERSUSPEND */
-
static int
get_mouse_buttons(KBDC kbdc)
@@ -570,7 +559,6 @@ restore_controller(KBDC kbdc, int command_byte)
}
}
-#ifdef PSM_RESETAFTERSUSPEND
/*
* Re-initialize the aux port and device. The aux port must be enabled
* and its interrupt must be disabled before calling this routine.
@@ -598,28 +586,19 @@ reinitialize(int unit, mousemode_t *mode)
case -1: /* time out */
default: /* error */
recover_from_error(kbdc);
- if (sc->config & PSM_CONFIG_IGNPORTERROR)
- break;
log(LOG_ERR, "psm%d: the aux port is not functioning (%d).\n",
unit, i);
return FALSE;
}
- if (sc->config & PSM_CONFIG_NORESET) {
- /*
- * Don't try to reset the pointing device. It may possibly be
- * left in the unknown state, though...
- */
- } else {
- /*
- * NOTE: some controllers appears to hang the `keyboard' when
- * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(kbdc)) {
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
- return FALSE;
- }
+ /*
+ * NOTE: some controllers appears to hang the `keyboard' when
+ * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
+ */
+ if (!reset_aux_dev(kbdc)) {
+ recover_from_error(kbdc);
+ log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
+ return FALSE;
}
/*
@@ -632,19 +611,15 @@ reinitialize(int unit, mousemode_t *mode)
}
empty_both_buffers(kbdc, 10); /* remove stray data if any */
- if (sc->config & PSM_CONFIG_NOIDPROBE) {
- i = GENERIC_MOUSE_ENTRY;
- } else {
- /* FIXME: hardware ID, mouse buttons? */
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- log(LOG_ERR, "psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
+ /* FIXME: hardware ID, mouse buttons? */
+
+ /* other parameters */
+ for (i = 0; vendortype[i].probefunc != NULL; ++i) {
+ if ((*vendortype[i].probefunc)(sc)) {
+ if (verbose >= 2)
+ log(LOG_ERR, "psm%d: found %s\n",
+ unit, model_name(vendortype[i].model));
+ break;
}
}
@@ -677,7 +652,6 @@ reinitialize(int unit, mousemode_t *mode)
return TRUE;
}
-#endif /* PSM_RESETAFTERSUSPEND */
static int
doopen(int unit, int command_byte)
@@ -818,7 +792,6 @@ psmprobe(struct isa_device *dvp)
printf("psm%d: unable to set the command byte.\n", unit);
endprobe(0);
}
- write_controller_command(sc->kbdc, KBDC_ENABLE_AUX_PORT);
/*
* NOTE: `test_aux_port()' is designed to return with zero if the aux
@@ -849,8 +822,6 @@ psmprobe(struct isa_device *dvp)
case -1: /* time out */
default: /* error */
recover_from_error(sc->kbdc);
- if (sc->config & PSM_CONFIG_IGNPORTERROR)
- break;
restore_controller(sc->kbdc, command_byte);
if (verbose)
printf("psm%d: the aux port is not functioning (%d).\n",
@@ -858,25 +829,17 @@ psmprobe(struct isa_device *dvp)
endprobe(0);
}
- if (sc->config & PSM_CONFIG_NORESET) {
- /*
- * Don't try to reset the pointing device. It may possibly be
- * left in the unknown state, though...
- */
- } else {
- /*
- * NOTE: some controllers appears to hang the `keyboard' when the aux
- * port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to reset the aux device.\n", unit);
- endprobe(0);
- }
+ /*
+ * NOTE: some controllers appears to hang the `keyboard' when the aux
+ * port doesn't exist and `PSMC_RESET_DEV' is issued.
+ */
+ if (!reset_aux_dev(sc->kbdc)) {
+ recover_from_error(sc->kbdc);
+ restore_controller(sc->kbdc, command_byte);
+ if (verbose)
+ printf("psm%d: failed to reset the aux device.\n", unit);
+ endprobe(0);
}
-
/*
* both the aux port and the aux device is functioning, see if the
* device can be enabled. NOTE: when enabled, the device will start
@@ -884,12 +847,11 @@ psmprobe(struct isa_device *dvp)
* the device can be enabled.
*/
if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR */
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to enable the aux device.\n", unit);
- endprobe(0);
+ /* MOUSE ERROR */
+ restore_controller(sc->kbdc, command_byte);
+ if (verbose)
+ printf("psm%d: failed to enable the aux device.\n", unit);
+ endprobe(0);
}
/* save the default values after reset */
@@ -925,21 +887,16 @@ psmprobe(struct isa_device *dvp)
break;
}
- if (sc->config & PSM_CONFIG_NOIDPROBE) {
- sc->hw.buttons = 2;
- i = GENERIC_MOUSE_ENTRY;
- } else {
- /* # of buttons */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- printf("psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
+ /* # of buttons */
+ sc->hw.buttons = get_mouse_buttons(sc->kbdc);
+
+ /* other parameters */
+ for (i = 0; vendortype[i].probefunc != NULL; ++i) {
+ if ((*vendortype[i].probefunc)(sc)) {
+ if (verbose >= 2)
+ printf("psm%d: found %s\n",
+ unit, model_name(vendortype[i].model));
+ break;
}
}
@@ -952,8 +909,6 @@ psmprobe(struct isa_device *dvp)
sc->dflt_mode.syncmask[0] = 0;
else
sc->dflt_mode.syncmask[0] = vendortype[i].syncmask;
- if (sc->config & PSM_CONFIG_FORCETAP)
- sc->mode.syncmask[0] &= ~MOUSE_PS2_TAP;
sc->dflt_mode.syncmask[1] = 0; /* syncbits */
sc->mode = sc->dflt_mode;
sc->mode.packetsize = vendortype[i].packetsize;
@@ -1013,7 +968,7 @@ psmprobe(struct isa_device *dvp)
psm_softc[unit] = sc;
kbdc_set_device_mask(sc->kbdc, mask | KBD_AUX_CONTROL_BITS);
kbdc_lock(sc->kbdc, FALSE);
- return ((dvp->id_iobase < 0) ? -1 : IO_PSMSIZE);
+ return (IO_PSMSIZE);
}
static int
@@ -1022,8 +977,6 @@ psmattach(struct isa_device *dvp)
int unit = dvp->id_unit;
struct psm_softc *sc = psm_softc[unit];
- dvp->id_ointr = psmintr;
-
if (sc == NULL) /* shouldn't happen */
return (0);
@@ -1709,7 +1662,7 @@ psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
return error;
}
-static void
+void
psmintr(int unit)
{
/*
@@ -1778,9 +1731,6 @@ psmintr(int unit)
z = 0;
ms.obutton = sc->button; /* previous button state */
ms.button = butmap[c & MOUSE_PS2_BUTTONS];
- /* `tapping' action */
- if (sc->config & PSM_CONFIG_FORCETAP)
- ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN;
switch (sc->hw.model) {
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index ae1108a8e1da..e946c5876ef3 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -172,7 +172,6 @@ static int rc_rcsrt[16] = {
};
/* Static prototypes */
-static ointhand2_t rcintr;
static void rc_hwreset __P((int, int, unsigned int));
static int rc_test __P((int, int));
static void rc_discard_output __P((struct rc_chans *));
@@ -232,8 +231,6 @@ rcattach(dvp)
static int rc_started = 0;
struct tty *tp;
- dvp->id_ointr = rcintr;
-
/* Thorooughly test the device */
if (rcb->rcb_probed != RC_PROBED)
return 0;
@@ -281,8 +278,7 @@ rcattach(dvp)
}
/* RC interrupt handling */
-static void
-rcintr(unit)
+void rcintr(unit)
int unit;
{
register struct rc_softc *rcb = &rc_softc[unit];
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index 28acaeec53bb..847660e70c92 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -768,7 +768,7 @@ void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags)
static int rpprobe __P((struct isa_device *));
static int rpattach __P((struct isa_device *));
-static const char* rp_pciprobe(pcici_t tag, pcidi_t type);
+static char* rp_pciprobe(pcici_t tag, pcidi_t type);
static void rp_pciattach(pcici_t tag, int unit);
static u_long rp_pcicount;
@@ -809,11 +809,10 @@ static struct cdevsw rp_cdevsw = {
static int rp_controller_port = 0;
static int rp_num_ports_open = 0;
+static int rp_timeout;
static int ndevs = 0;
static int minor_to_unit[128];
-#if 0
static struct tty rp_tty[128];
-#endif
static int rp_num_ports[4]; /* Number of ports on each controller */
@@ -859,7 +858,7 @@ static _INLINE_ void rp_do_receive(struct rp_port *rp, struct tty *tp,
{
int spl;
unsigned int CharNStat;
- int ToRecv, ch;
+ int ToRecv, wRecv, ch;
ToRecv = sGetRxCnt(cp);
if(ToRecv == 0)
@@ -925,7 +924,7 @@ static _INLINE_ void rp_handle_port(struct rp_port *rp)
CHANNEL_t *cp;
struct tty *tp;
unsigned int IntMask, ChanStatus;
- /* int oldcts; */
+ int oldcts, ToRecv;
if(!rp)
return;
@@ -1007,7 +1006,7 @@ static void rp_do_poll(void *not_used)
timeout(rp_do_poll, (void *)NULL, POLL_INTERVAL);
}
-static const char*
+static char*
rp_pciprobe(pcici_t tag, pcidi_t type)
{
int vendor_id;
@@ -1024,8 +1023,9 @@ int
rpprobe(dev)
struct isa_device *dev;
{
+ struct isa_device *idev;
int controller, unit;
- int aiop, num_aiops;
+ int i, aiop, num_aiops;
unsigned int aiopio[MAX_AIOPS_PER_BOARD];
CONTROLLER_t *ctlp;
@@ -1070,7 +1070,7 @@ static void
rp_pciattach(pcici_t tag, int unit)
{
dev_t rp_dev;
- int success, oldspl;
+ int success, rpmajor, oldspl;
u_short iobase;
int num_ports, num_chan, num_aiops;
int aiop, chan, port;
@@ -1079,6 +1079,7 @@ rp_pciattach(pcici_t tag, int unit)
struct rp_port *rp;
struct tty *tty;
CONTROLLER_t *ctlp;
+ char status;
success = pci_map_port(tag, 0x10, &iobase);
if(!success)
@@ -1182,7 +1183,7 @@ struct isa_device *dev;
{
struct isa_device *idev;
dev_t rp_dev;
- int iobase, unit, /*rpmajor,*/ oldspl;
+ int iobase, unit, rpmajor, oldspl;
int num_ports, num_chan, num_aiops;
int aiop, chan, port;
int ChanStatus, line, i, count;
@@ -1190,6 +1191,7 @@ struct isa_device *dev;
struct rp_port *rp;
struct tty *tty;
CONTROLLER_t *ctlp;
+ char status;
iobase = dev->id_iobase;
unit = dev->id_unit;
@@ -1301,7 +1303,7 @@ rpopen(dev, flag, mode, p)
struct proc *p;
{
struct rp_port *rp;
- int unit, port, mynor, umynor, flags; /* SG */
+ int unit, i, port, mynor, umynor, flags; /* SG */
struct tty *tp;
int oldspl, error;
unsigned int IntMask, ChanStatus;
@@ -1448,7 +1450,7 @@ rpclose(dev, flag, mode, p)
int flag, mode;
struct proc *p;
{
- int oldspl, unit, mynor, umynor, port; /* SG */
+ int oldspl, unit, mynor, umynor, port, status, i; /* SG */
struct rp_port *rp;
struct tty *tp;
CHANNEL_t *cp;
@@ -1481,7 +1483,7 @@ rpclose(dev, flag, mode, p)
static void
rphardclose(struct rp_port *rp)
{
- int mynor;
+ int status, oldspl, mynor;
struct tty *tp;
CHANNEL_t *cp;
@@ -1523,7 +1525,7 @@ rpread(dev, uio, flag)
{
struct rp_port *rp;
struct tty *tp;
- int unit, mynor, umynor, port, error = 0; /* SG */
+ int unit, i, mynor, umynor, port, error = 0; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
@@ -1547,7 +1549,7 @@ rpwrite(dev, uio, flag)
{
struct rp_port *rp;
struct tty *tp;
- int unit, mynor, port, umynor, error = 0; /* SG */
+ int unit, i, mynor, port, umynor, error = 0; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
@@ -1592,8 +1594,9 @@ rpioctl(dev, cmd, data, flag, p)
CHANNEL_t *cp;
struct tty *tp;
int unit, mynor, port, umynor; /* SG */
- int oldspl;
- int error = 0;
+ int oldspl, cflag, iflag, oflag, lflag;
+ int i, error = 0;
+ char status;
int arg, flags, result, ChanStatus;
int oldcmd;
struct termios term, *t;
@@ -1801,9 +1804,9 @@ rpparam(tp, t)
{
struct rp_port *rp;
CHANNEL_t *cp;
- int unit, mynor, port, umynor; /* SG */
+ int unit, i, mynor, port, umynor; /* SG */
int oldspl, cflag, iflag, oflag, lflag;
- int ospeed;
+ int ospeed, flags;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
@@ -1939,10 +1942,10 @@ rpstart(tp)
struct rp_port *rp;
CHANNEL_t *cp;
struct clist *qp;
- int unit, mynor, port, umynor; /* SG */
- char ch, flags;
+ int unit, i, mynor, port, umynor; /* SG */
+ char status, ch, flags;
int spl, xmit_fifo_room;
- int count;
+ int count, ToRecv;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
@@ -1999,8 +2002,11 @@ rpstop(tp, flag)
{
struct rp_port *rp;
CHANNEL_t *cp;
+ struct clist *qp;
int unit, mynor, port, umynor; /* SG */
- int spl;
+ char status, ch;
+ int spl, xmit_fifo_room;
+ int i, count;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
port = (minor(tp->t_dev) & 0x1f); /* SG */
@@ -2038,7 +2044,7 @@ struct tty *
rpdevtotty(dev_t dev)
{
struct rp_port *rp;
- int unit, port, mynor, umynor; /* SG */
+ int unit, i, port, mynor, umynor; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index 7eeca7b004c2..15ad25ed505c 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.40 1998/07/13 09:53:02 bde Exp $ */
+/* $Id: scd.c,v 1.39 1998/07/04 22:30:17 julian Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -201,8 +201,7 @@ static struct cdevsw scd_cdevsw = {
D_DISK, 0, -1 };
-static int
-scd_attach(struct isa_device *dev)
+int scd_attach(struct isa_device *dev)
{
int unit = dev->id_unit;
struct scd_data *cd = scd_data + unit;
@@ -695,13 +694,7 @@ scd_subchan(int unit, struct ioc_read_subchannel *sc)
return 0;
}
-static __inline void
-write_control(unsigned port, unsigned data)
-{
- outb(port + OREG_CONTROL, data);
-}
-
-static int
+int
scd_probe(struct isa_device *dev)
{
struct sony_drive_configuration drive_config;
@@ -1292,6 +1285,12 @@ read_toc(dev_t dev)
return 0;
}
+static __inline void
+write_control(unsigned port, unsigned data)
+{
+ outb(port + OREG_CONTROL, data);
+}
+
static void
init_drive(unsigned unit)
{
diff --git a/sys/i386/isa/scvesactl.c b/sys/i386/isa/scvesactl.c
new file mode 100644
index 000000000000..aabfe1901b56
--- /dev/null
+++ b/sys/i386/isa/scvesactl.c
@@ -0,0 +1,145 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * 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 as
+ * the first lines of this file unmodified.
+ * 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.
+ *
+ * $Id: scvesactl.c,v 1.5 1998/09/26 03:38:40 yokota Exp $
+ */
+
+#include "sc.h"
+#include "opt_vesa.h"
+#include "opt_vm86.h"
+
+#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/tty.h>
+#include <sys/kernel.h>
+
+#include <machine/apm_bios.h>
+#include <machine/console.h>
+#include <machine/pc/vesa.h>
+
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
+
+static d_ioctl_t *prev_user_ioctl;
+
+static int
+vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+{
+ scr_stat *scp;
+ struct tty *tp;
+ video_info_t info;
+ video_adapter_t *adp;
+ int mode;
+ int error;
+ int s;
+
+ tp = scdevtotty(dev);
+ if (!tp)
+ return ENXIO;
+ scp = sc_get_scr_stat(tp->t_dev);
+
+ switch (cmd) {
+
+ /* generic text modes */
+ case SW_TEXT_132x25: case SW_TEXT_132x30:
+ case SW_TEXT_132x43: case SW_TEXT_132x50:
+ case SW_TEXT_132x60:
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
+ return ENODEV;
+ return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
+
+ /* text modes */
+ case SW_VESA_C80x60:
+ case SW_VESA_C132x25:
+ case SW_VESA_C132x43:
+ case SW_VESA_C132x50:
+ case SW_VESA_C132x60:
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
+ return ENODEV;
+ mode = (cmd & 0xff) + M_VESA_BASE;
+vesa_text:
+ return sc_set_text_mode(scp, tp, mode, 0, 0, 0);
+
+ /* graphics modes */
+ case SW_VESA_32K_320: case SW_VESA_64K_320:
+ case SW_VESA_FULL_320:
+
+ case SW_VESA_CG640x400:
+
+ case SW_VESA_CG640x480:
+ case SW_VESA_32K_640: case SW_VESA_64K_640:
+ case SW_VESA_FULL_640:
+
+ case SW_VESA_800x600: case SW_VESA_CG800x600:
+ case SW_VESA_32K_800: case SW_VESA_64K_800:
+ case SW_VESA_FULL_800:
+
+ case SW_VESA_1024x768: case SW_VESA_CG1024x768:
+ case SW_VESA_32K_1024: case SW_VESA_64K_1024:
+ case SW_VESA_FULL_1024:
+
+ case SW_VESA_1280x1024: case SW_VESA_CG1280x1024:
+ case SW_VESA_32K_1280: case SW_VESA_64K_1280:
+ case SW_VESA_FULL_1280:
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
+ return ENODEV;
+ mode = (cmd & 0xff) + M_VESA_BASE;
+vesa_graphics:
+ return sc_set_graphics_mode(scp, tp, mode);
+ }
+
+ if (prev_user_ioctl)
+ return (*prev_user_ioctl)(dev, cmd, data, flag, p);
+ else
+ return ENOIOCTL;
+}
+
+int
+vesa_load_ioctl(void)
+{
+ if (prev_user_ioctl)
+ return EBUSY;
+ prev_user_ioctl = sc_user_ioctl;
+ sc_user_ioctl = vesa_ioctl;
+ return 0;
+}
+
+int
+vesa_unload_ioctl(void)
+{
+ if (sc_user_ioctl != vesa_ioctl)
+ return EBUSY;
+ sc_user_ioctl = prev_user_ioctl;
+ prev_user_ioctl = NULL;
+ return 0;
+}
+
+#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */
diff --git a/sys/i386/isa/scvidctl.c b/sys/i386/isa/scvidctl.c
new file mode 100644
index 000000000000..065dee28357a
--- /dev/null
+++ b/sys/i386/isa/scvidctl.c
@@ -0,0 +1,496 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * 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 as
+ * the first lines of this file unmodified.
+ * 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.
+ *
+ * $Id: scvidctl.c,v 1.4 1998/09/29 02:00:56 ache Exp $
+ */
+
+#include "sc.h"
+#include "opt_syscons.h"
+
+#if NSC > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
+#include <sys/tty.h>
+#include <sys/kernel.h>
+
+#include <machine/apm_bios.h>
+#include <machine/console.h>
+
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
+
+/* video ioctl */
+
+extern scr_stat *cur_console;
+extern int fonts_loaded;
+extern int sc_history_size;
+extern u_char palette[];
+
+int
+sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
+ int fontsize)
+{
+ video_adapter_t *adp;
+ video_info_t info;
+ int error;
+ int s;
+ int i;
+
+ if ((*biosvidsw.get_info)(scp->adp, mode, &info))
+ return ENODEV;
+ adp = get_adapter(scp);
+
+ /* adjust argument values */
+ if (fontsize <= 0)
+ fontsize = info.vi_cheight;
+ if (fontsize < 14) {
+ fontsize = 8;
+ if (!(fonts_loaded & FONT_8))
+ return EINVAL;
+ } else if (fontsize >= 16) {
+ fontsize = 16;
+ if (!(fonts_loaded & FONT_16))
+ return EINVAL;
+ } else {
+ fontsize = 14;
+ if (!(fonts_loaded & FONT_14))
+ return EINVAL;
+ }
+ if ((xsize <= 0) || (xsize > info.vi_width))
+ xsize = info.vi_width;
+ if ((ysize <= 0) || (ysize > info.vi_height))
+ ysize = info.vi_height;
+
+ /* stop screen saver, etc */
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+
+ /* set up scp */
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(sc_history_size, scp->ysize), 0);
+ else
+ i = 0;
+ /*
+ * This is a kludge to fend off scrn_update() while we
+ * muck around with scp. XXX
+ */
+ scp->status |= UNKNOWN_MODE;
+ scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
+ scp->mode = mode;
+ scp->font_size = fontsize;
+ scp->xsize = xsize;
+ scp->ysize = ysize;
+ scp->xpixel = scp->xsize*8;
+ scp->ypixel = scp->ysize*fontsize;
+
+ /* allocate buffers */
+ sc_alloc_scr_buffer(scp, TRUE, TRUE);
+ if (ISMOUSEAVAIL(adp->va_flags))
+ sc_alloc_cut_buffer(scp, FALSE);
+ sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ scp->status &= ~UNKNOWN_MODE;
+
+ if (tp == NULL)
+ return 0;
+ if (tp->t_winsize.ws_col != scp->xsize
+ || tp->t_winsize.ws_row != scp->ysize) {
+ tp->t_winsize.ws_col = scp->xsize;
+ tp->t_winsize.ws_row = scp->ysize;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+
+ return 0;
+}
+
+int
+sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
+{
+ video_adapter_t *adp;
+ video_info_t info;
+ int error;
+ int s;
+
+ if ((*biosvidsw.get_info)(scp->adp, mode, &info))
+ return ENODEV;
+ adp = get_adapter(scp);
+
+ /* stop screen saver, etc */
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+
+ /* set up scp */
+ scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE);
+ scp->status &= ~PIXEL_MODE;
+ scp->mode = mode;
+ scp->xpixel = info.vi_width;
+ scp->ypixel = info.vi_height;
+ scp->xsize = info.vi_width/8;
+ scp->ysize = info.vi_height/info.vi_cheight;
+ scp->font_size = FONT_NONE;
+ /* move the mouse cursor at the center of the screen */
+ sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ /* clear_graphics();*/
+ scp->status &= ~UNKNOWN_MODE;
+
+ if (tp == NULL)
+ return 0;
+ if (tp->t_winsize.ws_xpixel != scp->xpixel
+ || tp->t_winsize.ws_ypixel != scp->ypixel) {
+ tp->t_winsize.ws_xpixel = scp->xpixel;
+ tp->t_winsize.ws_ypixel = scp->ypixel;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+
+ return 0;
+}
+
+int
+sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
+ int fontsize)
+{
+ video_adapter_t *adp;
+ video_info_t info;
+ int error;
+ int s;
+ int i;
+
+ if ((*biosvidsw.get_info)(scp->adp, scp->mode, &info))
+ return ENODEV; /* this shouldn't happen */
+ adp = get_adapter(scp);
+
+#ifdef SC_VIDEO_DEBUG
+ if (scp->scr_buf != NULL) {
+ printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
+ scp->mode, xsize, ysize, fontsize);
+ }
+#endif
+
+ /* adjust argument values */
+ if ((fontsize <= 0) || (fontsize == FONT_NONE))
+ fontsize = info.vi_cheight;
+ if (fontsize < 14) {
+ fontsize = 8;
+ if (!(fonts_loaded & FONT_8))
+ return EINVAL;
+ } else if (fontsize >= 16) {
+ fontsize = 16;
+ if (!(fonts_loaded & FONT_16))
+ return EINVAL;
+ } else {
+ fontsize = 14;
+ if (!(fonts_loaded & FONT_14))
+ return EINVAL;
+ }
+ if (xsize <= 0)
+ xsize = info.vi_width/8;
+ if (ysize <= 0)
+ ysize = info.vi_height/fontsize;
+
+#ifdef SC_VIDEO_DEBUG
+ if (scp->scr_buf != NULL) {
+ printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
+ scp->mode, xsize, ysize, fontsize);
+ printf("set_pixel_mode(): window:%x, %dx%d, xoff:%d, yoff:%d\n",
+ adp->va_window, info.vi_width, info.vi_height,
+ (info.vi_width/8 - xsize)/2,
+ (info.vi_height/fontsize - ysize)/2);
+ }
+#endif
+
+ if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
+ return EINVAL;
+
+ /* only 16 color, 4 plane modes are supported XXX */
+ if ((info.vi_depth != 4) || (info.vi_planes != 4))
+ return ENODEV;
+
+ /*
+ * set_pixel_mode() currently does not support video modes whose
+ * memory size is larger than 64K. Because such modes require
+ * bank switching to access the entire screen. XXX
+ */
+ if (info.vi_width*info.vi_height/8 > info.vi_window_size)
+ return ENODEV;
+
+ /* stop screen saver, etc */
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+
+ /* set up scp */
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(sc_history_size, scp->ysize), 0);
+ else
+ i = 0;
+ scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
+ scp->status &= ~(GRAPHICS_MODE | MOUSE_ENABLED);
+ scp->xsize = xsize;
+ scp->ysize = ysize;
+ scp->font_size = fontsize;
+ scp->xoff = (scp->xpixel/8 - xsize)/2;
+ scp->yoff = (scp->ypixel/fontsize - ysize)/2;
+
+ /* allocate buffers */
+ sc_alloc_scr_buffer(scp, TRUE, TRUE);
+ if (ISMOUSEAVAIL(adp->va_flags))
+ sc_alloc_cut_buffer(scp, FALSE);
+ sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
+ splx(s);
+
+ if (scp == cur_console)
+ set_border(scp, scp->border);
+
+ scp->status &= ~UNKNOWN_MODE;
+
+#ifdef SC_VIDEO_DEBUG
+ printf("set_pixel_mode(): status:%x\n", scp->status);
+#endif
+
+ if (tp == NULL)
+ return 0;
+ if (tp->t_winsize.ws_col != scp->xsize
+ || tp->t_winsize.ws_row != scp->ysize) {
+ tp->t_winsize.ws_col = scp->xsize;
+ tp->t_winsize.ws_row = scp->ysize;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+
+ return 0;
+}
+
+int
+sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
+{
+ scr_stat *scp;
+ video_adapter_t *adp;
+ int error;
+ int s;
+
+ scp = sc_get_scr_stat(tp->t_dev);
+
+ switch (cmd) {
+
+ case CONS_CURRENT: /* get current adapter type */
+ adp = get_adapter(scp);
+ *(int *)data = adp->va_type;
+ return 0;
+
+ case CONS_CURRENTADP: /* get current adapter index */
+ *(int *)data = scp->adp;
+ return 0;
+
+ case CONS_ADPINFO: /* adapter information */
+ adp = (*biosvidsw.adapter)(((video_adapter_t *)data)->va_index);
+ if (adp == NULL)
+ return ENODEV;
+ bcopy(adp, data, sizeof(*adp));
+ return 0;
+
+ case CONS_GET: /* get current video mode */
+ *(int *)data = scp->mode;
+ return 0;
+
+ case CONS_MODEINFO: /* get mode information */
+ return ((*biosvidsw.get_info)(scp->adp,
+ ((video_info_t *)data)->vi_mode, (video_info_t *)data)
+ ? ENODEV : 0);
+
+ case CONS_FINDMODE: /* find a matching video mode */
+ return ((*biosvidsw.query_mode)(scp->adp, (video_info_t *)data)
+ ? ENODEV : 0);
+
+ case CONS_SETWINORG:
+ return ((*biosvidsw.set_win_org)(scp->adp, *(u_int *)data)
+ ? ENODEV : 0);
+
+ /* generic text modes */
+ case SW_TEXT_80x25: case SW_TEXT_80x30:
+ case SW_TEXT_80x43: case SW_TEXT_80x50:
+ case SW_TEXT_80x60:
+ /* FALL THROUGH */
+
+ /* VGA TEXT MODES */
+ case SW_VGA_C40x25:
+ case SW_VGA_C80x25: case SW_VGA_M80x25:
+ case SW_VGA_C80x30: case SW_VGA_M80x30:
+ case SW_VGA_C80x50: case SW_VGA_M80x50:
+ case SW_VGA_C80x60: case SW_VGA_M80x60:
+ case SW_B40x25: case SW_C40x25:
+ case SW_B80x25: case SW_C80x25:
+ case SW_ENH_B40x25: case SW_ENH_C40x25:
+ case SW_ENH_B80x25: case SW_ENH_C80x25:
+ case SW_ENH_B80x43: case SW_ENH_C80x43:
+ case SW_EGAMONO80x25:
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
+ return ENODEV;
+ return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
+
+ /* GRAPHICS MODES */
+ case SW_BG320: case SW_BG640:
+ case SW_CG320: case SW_CG320_D: case SW_CG640_E:
+ case SW_CG640x350: case SW_ENH_CG640:
+ case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
+ case SW_VGA_MODEX:
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
+ return ENODEV;
+ return sc_set_graphics_mode(scp, tp, cmd & 0xff);
+
+ case KDSETMODE: /* set current mode of this (virtual) console */
+ switch (*(int *)data) {
+ case KD_TEXT: /* switch to TEXT (known) mode */
+ /*
+ * If scp->mode is of graphics modes, we don't know which
+ * text mode to switch back to...
+ */
+ if (scp->status & GRAPHICS_MODE)
+ return EINVAL;
+ /* restore fonts & palette ! */
+#if 0
+ adp = get_adapter(scp);
+ if (ISFONTAVAIL(adp->va_flags)
+ && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
+ /*
+ * FONT KLUDGE
+ * Don't load fonts for now... XXX
+ */
+ if (fonts_loaded & FONT_8)
+ copy_font(scp, LOAD, 8, font_8);
+ if (fonts_loaded & FONT_14)
+ copy_font(scp, LOAD, 14, font_14);
+ if (fonts_loaded & FONT_16)
+ copy_font(scp, LOAD, 16, font_16);
+ }
+#endif
+ load_palette(scp, palette);
+
+ /* move hardware cursor out of the way */
+ (*biosvidsw.set_hw_cursor)(scp->adp, -1, -1);
+
+ /* FALL THROUGH */
+
+ case KD_TEXT1: /* switch to TEXT (known) mode */
+ /*
+ * If scp->mode is of graphics modes, we don't know which
+ * text/pixel mode to switch back to...
+ */
+ if (scp->status & GRAPHICS_MODE)
+ return EINVAL;
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+ scp->status |= UNKNOWN_MODE;
+ splx(s);
+ /* no restore fonts & palette */
+ if (scp == cur_console)
+ set_mode(scp);
+ sc_clear_screen(scp);
+ scp->status &= ~UNKNOWN_MODE;
+ return 0;
+
+ case KD_PIXEL: /* pixel (raster) display */
+ if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
+ return EINVAL;
+ if (scp->status & GRAPHICS_MODE)
+ return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
+ scp->font_size);
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+ scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
+ splx(s);
+ if (scp == cur_console) {
+ set_mode(scp);
+ load_palette(scp, palette);
+ }
+ sc_clear_screen(scp);
+ scp->status &= ~UNKNOWN_MODE;
+ return 0;
+
+ case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
+ s = spltty();
+ if ((error = sc_clean_up(scp))) {
+ splx(s);
+ return error;
+ }
+ scp->status |= UNKNOWN_MODE;
+ splx(s);
+ return 0;
+
+ default:
+ return EINVAL;
+ }
+ /* NOT REACHED */
+
+ case KDRASTER: /* set pixel (raster) display mode */
+ if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
+ return ENODEV;
+ return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
+ ((int *)data)[2]);
+
+ case KDGETMODE: /* get current mode of this (virtual) console */
+ /*
+ * From the user program's point of view, KD_PIXEL is the same
+ * as KD_TEXT...
+ */
+ *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
+ return 0;
+
+ case KDSBORDER: /* set border color of this (virtual) console */
+ scp->border = *data;
+ if (scp == cur_console)
+ set_border(cur_console, scp->border);
+ return 0;
+ }
+
+ return ENOIOCTL;
+}
+
+#endif /* NSC > 0 */
diff --git a/sys/i386/isa/seagate.c b/sys/i386/isa/seagate.c
new file mode 100644
index 000000000000..8b2be3ff63d5
--- /dev/null
+++ b/sys/i386/isa/seagate.c
@@ -0,0 +1,1506 @@
+/*
+ * (Free/Net/386)BSD ST01/02, Future Domain TMC-885, TMC-950 SCSI driver for
+ * Julians SCSI-code
+ *
+ * Copyright 1994, Kent Palmkvist (kentp@isy.liu.se)
+ * Copyright 1994, Robert Knier (rknier@qgraph.com)
+ * Copyright 1992, 1994 Drew Eckhardt (drew@colorado.edu)
+ * Copyright 1994, Julian Elischer (julian@tfs.com)
+ * Copyright 1994-1995, Serge Vakulenko (vak@cronyx.ru)
+ * Copyright 1995 Stephen Hocking (sysseh@devetir.qld.gov.au)
+ *
+ * Others that has contributed by example code is
+ * Glen Overby (overby@cray.com)
+ * Tatu Yllnen
+ * Brian E Litzinger
+ *
+ * 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 DEVELOPERS ``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 DEVELOPERS 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.
+ */
+
+/*
+ * kentp 940307 alpha version based on newscsi-03 version of Julians SCSI-code
+ * kentp 940314 Added possibility to not use messages
+ * rknier 940331 Added fast transfer code
+ * rknier 940407 Added assembler coded data transfers
+ * vak 941226 New probe algorithm, based on expected behaviour
+ * instead of BIOS signatures analysis, better timeout handling,
+ * new asm fragments for data input/output, target-dependent
+ * delays, device flags, polling mode, generic cleanup
+ * vak 950115 Added request-sense ops
+ * seh 950701 Fixed up Future Domain TMC-885 problems with disconnects,
+ * weird phases and the like. (we could probably investigate
+ * what the board's idea of the phases are, but that requires
+ * doco that I don't have). Note that it is slower than the
+ * 2.0R driver with both SEA_BLINDTRANSFER & SEA_ASSEMBLER
+ * defined by a factor of more than 2. I'll look at that later!
+ * seh 950712 The performance release 8^). Put in the blind transfer code
+ * from the 2.0R source. Don't use it by commenting out the
+ * SEA_BLINDTRANSFER below. Note that it only kicks in during
+ * DATAOUT or DATAIN and then only when the transfer is a
+ * multiple of BLOCK_SIZE bytes (512). Most devices fit into
+ * that category, with the possible exception of scanners and
+ * some of the older MO drives.
+ *
+ * $Id: seagate.c,v 1.30 1998/07/15 09:38:10 bde Exp $
+ */
+
+/*
+ * What should really be done:
+ *
+ * Restructure interrupt enable/disable code (runs too long with int disabled)
+ * Add code to handle Future Domain 840, 841, 880 and 881
+ * Add code to use tagged commands in SCSI2
+ * Add code to handle slow devices better (sleep if device not disconnecting)
+ * Fix unnecessary interrupts
+ */
+
+/* Note to users trying to share a disk between DOS and unix:
+ * The ST01/02 is a translating host-adapter. It is not giving DOS
+ * the same number of heads/tracks/sectors as specified by the disk.
+ * It is therefore important to look at what numbers DOS thinks the
+ * disk has. Use these to disklabel your disk in an appropriate manner
+ *
+ * About ST02+IDE coexistence: the original Seagate ST02
+ * BIOS cannot coexist with IDE or any other disk controller
+ * because it does not share BIOS disk drive numbers (80h, 81h)
+ * with others. New probing code allows using ST02 controller
+ * without BIOS: just unplug the ST02 BIOS chip from the board.
+ *
+ * Another problem is the floppy adapter on ST02 which could not be
+ * disabled by jumpers. I commonly use ST02 adapter as a cheap solution
+ * for atttaching the tape and CD-ROM drives, and an extra floppy controller
+ * is just a headache. I found a simple workaround: cutting off
+ * the AEN signal (A11 contact on ISA connector). AEN then goes high and
+ * disables the floppy adapter port address decoder.
+ *
+ * I also had a problem with ST02 conflicting with IDE during
+ * IDE data write phase. It seems than ST02 makes some noise
+ * on /IOW line. The /IOW line is used only for floppy controller
+ * part of ST02, and because I don't need it, I cut off the /IOW (contact B13)
+ * and it helped. (vak)
+ *
+ * Tested on the following hardware:
+ * Adapter: Seagate ST02
+ * Disk: HP D1686
+ * Streamers: Archive Viper 150, Wangtek 5525
+ * CD-ROMs: Toshiba XM-3401, NEC CDR-25
+ *
+ * Maximum data rate is about 270-280 kbytes/sec (on 386DX/40).
+ * (vak)
+ */
+#undef DEBUG
+
+#include "sea.h"
+#if NSEA > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+
+#include <scsi/scsiconf.h>
+
+#ifdef DEBUG
+# define PRINT(s) printf s
+#else
+# define PRINT(s) /*void*/
+#endif
+
+#define SCB_TABLE_SIZE 8 /* start with 8 scb entries in table */
+#define BLOCK_SIZE 512 /* size of READ/WRITE areas on SCSI card */
+#define HOST_SCSI_ADDR 7 /* address of the adapter on the SCSI bus */
+#define SEA_BLINDTRANSFER 1 /* for quicker than quick xfers */
+/*
+ * Define config flags
+ */
+#define FLAG_NOPARITY 0x01 /* disable SCSI bus parity check */
+
+/*
+ * Board CONTROL register
+ */
+#define CMD_RST 0x01 /* scsi reset */
+#define CMD_SEL 0x02 /* scsi select */
+#define CMD_BSY 0x04 /* scsi busy */
+#define CMD_ATTN 0x08 /* scsi attention */
+#define CMD_START_ARB 0x10 /* start arbitration bit */
+#define CMD_EN_PARITY 0x20 /* enable scsi parity generation */
+#define CMD_INTR 0x40 /* enable scsi interrupts */
+#define CMD_DRVR_ENABLE 0x80 /* scsi enable */
+
+/*
+ * Board STATUS register
+ */
+#define STAT_BSY 0x01 /* scsi busy */
+#define STAT_MSG 0x02 /* scsi msg */
+#define STAT_IO 0x04 /* scsi I/O */
+#define STAT_CD 0x08 /* scsi C/D */
+#define STAT_REQ 0x10 /* scsi req */
+#define STAT_SEL 0x20 /* scsi select */
+#define STAT_PARITY 0x40 /* parity error bit */
+#define STAT_ARB_CMPL 0x80 /* arbitration complete bit */
+#define STAT_BITS "\20\1bsy\2msg\3i/o\4c/d\5req\6sel\7parity\10arb"
+
+/*
+ * SCSI bus phases
+ */
+#define PHASE_MASK (STAT_MSG | STAT_CD | STAT_IO)
+#define PHASE_DATAOUT 0
+#define PHASE_DATAIN STAT_IO
+#define PHASE_CMDOUT STAT_CD
+#define PHASE_STATIN (STAT_CD | STAT_IO)
+#define PHASE_MSGOUT (STAT_MSG | STAT_CD)
+#define PHASE_MSGIN (STAT_MSG | STAT_CD | STAT_IO)
+#define PHASE_NAME(ph) phase_name[(ph)>>2]
+
+static char *phase_name[] = {
+ "DATAOUT", "Phase1?", "Phase2?", "Phase3?",
+ "DATAIN", "Phase5?", "Phase6?", "Phase7?",
+ "CMDOUT", "Phase9?", "MSGOUT", "Phase11?",
+ "STATIN", "Phase13?", "MSGIN", "Phase15?",
+};
+
+/*
+ * SCSI message codes
+ */
+#define MSG_COMMAND_COMPLETE 0x00
+#define MSG_SAVE_POINTERS 0x02
+#define MSG_RESTORE_POINTERS 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_ABORT 0x06
+#define MSG_MESSAGE_REJECT 0x07
+#define MSG_NOP 0x08
+#define MSG_BUS_DEV_RESET 0x0c
+#define MSG_IDENTIFY(lun) (0xc0 | ((lun) & 0x7))
+#define MSG_ISIDENT(m) ((m) & 0x80)
+
+/*
+ * SCSI control block used to keep info about a scsi command
+ */
+typedef struct scb {
+ int flags; /* status of the instruction */
+#define SCB_FREE 0x00
+#define SCB_ACTIVE 0x01
+#define SCB_ABORTED 0x02
+#define SCB_TIMEOUT 0x04
+#define SCB_ERROR 0x08
+#define SCB_TIMECHK 0x10 /* we have set a timeout on this one */
+#define SCB_SENSE 0x20 /* sensed data available */
+#define SCB_TBUSY 0x40 /* target busy */
+ struct scb *next; /* in free list */
+ struct scsi_xfer *xfer; /* the scsi_xfer for this cmd */
+ u_char *data; /* position in data buffer so far */
+ int32_t datalen; /* bytes remaining to transfer */
+} scb_t;
+
+typedef enum {
+ CTLR_NONE,
+ CTLR_SEAGATE,
+ CTLR_FUTURE_DOMAIN
+} ctlr_t;
+
+/*
+ * Flags for waiting for REQ deassert during some SCSI bus phases.
+ */
+typedef struct {
+ unsigned cmdout1 : 1; /* after CMDOUT[0] byte */
+ unsigned cmdout : 1; /* after CMDOUT[1..N] bytes */
+ unsigned msgout : 1; /* after MSGOUT byte */
+ unsigned statin : 1; /* after STATIN byte */
+} phase_t;
+
+/*
+ * Data structure describing the target state.
+ */
+typedef struct {
+ struct adapter *adapter; /* pointer to the adapter structure */
+ u_char busy; /* mask of busy luns at device target */
+ u_long perrcnt; /* counter of target parity errors */
+ phase_t ndelay; /* "don't delay" flags */
+ phase_t init; /* "initialized" flags */
+} target_t;
+
+/*
+ * Data structure describing current status of the scsi bus. One for each
+ * controller card.
+ */
+typedef struct adapter {
+ ctlr_t type; /* Seagate or Future Domain */
+ char *name; /* adapter name */
+ volatile u_char *addr; /* base address for card */
+
+ volatile u_char *CONTROL; /* address of control register */
+ volatile u_char *STATUS; /* address of status register */
+ volatile u_char *DATA; /* address of data register */
+
+ u_char scsi_addr; /* our scsi address, 0..7 */
+ u_char scsi_id; /* our scsi id mask */
+ u_char parity; /* parity flag: CMD_EN_PARITY or 0 */
+ u_char irq; /* IRQ number used or 0 if no IRQ */
+ u_int timeout_active : 1; /* timeout() active (requested) */
+
+ struct scsi_link sc_link; /* struct connecting different data */
+ scb_t *queue; /* waiting to be issued */
+ scb_t *disconnected_queue; /* waiting to reconnect */
+
+ int numscb; /* number of scsi control blocks */
+ scb_t *free_scb; /* free scb list */
+ scb_t scbs[SCB_TABLE_SIZE];
+
+ target_t target[8]; /* target state data */
+} adapter_t;
+
+static adapter_t seadata[NSEA];
+
+#define IS_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &\
+ (1 << (b)->xfer->sc_link->lun))
+#define SET_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy |=\
+ (1 << (b)->xfer->sc_link->lun))
+#define CLEAR_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &=\
+ ~(1 << (b)->xfer->sc_link->lun))
+
+/*
+ * Wait for condition, given as an boolean expression.
+ * Print the message on timeout.
+ */
+#define WAITFOR(condition,message) {\
+ register u_long cnt = 100000; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("sea: %s timeout\n", _msg); }
+
+#define WAITFOR10(condition,message) {\
+ register u_long cnt = 1000000; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("sea: %s timeout\n", _msg); }
+
+/*
+ * Seagate adapter does not support in hardware
+ * waiting for REQ deassert after transferring each data byte.
+ * We must do it in software.
+ * The problem is that some SCSI devices deassert REQ so fast that
+ * we can miss it. We the flag for each target sayind if we should (not)
+ * wait for REQ deassert. This flag is initialized when the first
+ * operation on the target is done.
+ * 1) Test if we don't need to wait for REQ deassert (`nodelay' flag).
+ * Initially the flag is off, i.e. wait. If the flag is set,
+ * go to the step 4.
+ * 2) Wait for REQ deassert (call sea_wait_for_req_deassert function).
+ * If REQ deassert got, go to the step 4. If REQ did not cleared
+ * during timeout period, go to the next step.
+ * 3) If `nodelay' flag did not initialized yet (`init' flag),
+ * then set `ndelay' flag.
+ * 4) Set `init' flag. Done.
+ */
+#define WAITREQ(t,op,cnt) {\
+ if (! (t)->ndelay.op &&\
+ ! sea_wait_for_req_deassert ((t)->adapter, cnt, #op) &&\
+ ! (t)->init.op)\
+ (t)->ndelay.op = 1;\
+ (t)->init.op = 1; }
+
+static int sea_probe (struct isa_device *dev);
+static int sea_detect (adapter_t *z, struct isa_device *dev);
+static int sea_attach (struct isa_device *dev);
+static int32_t sea_scsi_cmd (struct scsi_xfer *xs);
+static u_int32_t sea_adapter_info (int unit);
+static void sea_timeout (void *scb);
+static void seaminphys (struct buf *bp);
+static void sea_done (adapter_t *z, scb_t *scb);
+static void sea_start (adapter_t *z);
+static void sea_information_transfer (adapter_t *z, scb_t *scb);
+static int sea_poll (adapter_t *z, scb_t *scb);
+static int sea_init (adapter_t *z);
+static int sea_reselect (adapter_t *z);
+static int sea_select (volatile adapter_t *z, scb_t *scb);
+static int sea_abort (adapter_t *z, scb_t *scb);
+static void sea_send_abort (adapter_t *z);
+static u_char sea_msg_input (adapter_t *z);
+static void sea_tick (void *arg);
+static int sea_sense (adapter_t *z, scb_t *scb);
+static void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen);
+static void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen);
+static void sea_cmd_output (target_t *z, u_char *cmd, int cmdlen);
+
+static struct scsi_adapter sea_switch = {
+ sea_scsi_cmd, seaminphys, 0, 0, sea_adapter_info, "sea", {0},
+};
+static struct scsi_device sea_dev = { NULL, NULL, NULL, NULL, "sea", 0, {0} };
+struct isa_driver seadriver = { sea_probe, sea_attach, "sea" };
+
+/* FD TMC885's can't handle detach & re-attach */
+static int sea_select_cmd = CMD_DRVR_ENABLE | CMD_ATTN;
+
+/*
+ * Check if the device can be found at the port given and if so,
+ * detect the type of board. Set it up ready for further work.
+ * Takes the isa_dev structure from autoconf as an argument.
+ * Returns 1 if card recognized, 0 if errors.
+ */
+int sea_probe (struct isa_device *dev)
+{
+ adapter_t *z = &seadata[dev->id_unit];
+ static const int addrtab[] = {
+ 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000, 0,
+ };
+ int i;
+
+ /* Init fields used by our routines */
+ z->parity = (dev->id_flags & FLAG_NOPARITY) ? 0 : CMD_EN_PARITY;
+ z->scsi_addr = HOST_SCSI_ADDR;
+ z->scsi_id = 1 << z->scsi_addr;
+ z->irq = dev->id_irq ? ffs (dev->id_irq) - 1 : 0;
+ z->queue = 0;
+ z->disconnected_queue = 0;
+ for (i=0; i<8; i++) {
+ z->target[i].adapter = z;
+ z->target[i].busy = 0;
+ }
+
+ /* Link up the free list of scbs */
+ z->numscb = SCB_TABLE_SIZE;
+ z->free_scb = z->scbs;
+ for (i=1; i<SCB_TABLE_SIZE; i++)
+ z->scbs[i-1].next = z->scbs + i;
+ z->scbs[SCB_TABLE_SIZE-1].next = 0;
+
+ /* Detect the adapter. */
+ dev->id_msize = 0x4000;
+ if (! dev->id_maddr)
+ for (i=0; addrtab[i]; ++i) {
+ dev->id_maddr = (u_char*) KERNBASE + addrtab[i];
+ if (sea_detect (z, dev))
+ return (1);
+ }
+ else if (sea_detect (z, dev))
+ return (1);
+
+ bzero (z, sizeof (*z));
+ return (0);
+}
+
+int sea_detect (adapter_t *z, struct isa_device *dev)
+{
+ z->addr = dev->id_maddr;
+
+ /* Try Seagate. */
+ z->type = CTLR_SEAGATE;
+ z->name = "Seagate ST01/ST02";
+ z->CONTROL = z->addr + 0x1a00; /* ST01/ST02 register offsets */
+ z->STATUS = z->addr + 0x1a00;
+ z->DATA = z->addr + 0x1c00;
+ if (sea_init (z) == 0)
+ return (1);
+
+ /* Try Future Domain. */
+ z->type = CTLR_FUTURE_DOMAIN;
+ z->name = "Future Domain TMC-885/TMC-950";
+ z->CONTROL = z->addr + 0x1c00; /* TMC-885/TMC-950 reg. offsets */
+ z->STATUS = z->addr + 0x1c00;
+ z->DATA = z->addr + 0x1e00;
+ /* FD TMC885's can't handle detach & re-attach */
+ sea_select_cmd = CMD_DRVR_ENABLE;
+ /* FD TMC-885 is supposed to be at id 6. How strange. */
+ z->scsi_addr = HOST_SCSI_ADDR - 1;
+ z->scsi_id = 1 << z->scsi_addr;
+ if (sea_init (z) == 0)
+ return (1);
+
+ return (0);
+}
+
+/*
+ * Probe the adapter, and if found, reset the board and the scsi bus.
+ * Return 0 if the adapter found.
+ */
+int sea_init (adapter_t *z)
+{
+ volatile u_char *p;
+ int i, c;
+
+ /* Check that STATUS..STATUS+200h are equal. */
+ p = z->STATUS;
+ c = *p;
+ if (c == 0xff)
+ return (2);
+ while (++p < z->STATUS+0x200)
+ if (*p != c)
+ return (3);
+
+ /* Check that DATA..DATA+200h are equal. */
+ for (p=z->DATA, c= *p++; p<z->DATA+0x200; ++p)
+ if (*p != c)
+ return (4);
+
+ /* Check that addr..addr+1800h are not writable. */
+ for (p=z->addr; p<z->addr+0x1800; ++p) {
+ c = *p;
+ *p = ~c;
+ if (*p == ~c) {
+ *p = c;
+ return (5);
+ }
+ }
+
+ /* Check that addr+1800h..addr+1880h are writable. */
+ for (p=z->addr+0x1800; p<z->addr+0x1880; ++p) {
+ c = *p;
+ *p = 0x55;
+ if (*p != 0x55) {
+ *p = c;
+ return (6);
+ }
+ *p = 0xaa;
+ if (*p != 0xaa) {
+ *p = c;
+ return (7);
+ }
+ }
+
+ /* Reset the scsi bus (I don't know if this is needed). */
+ *z->CONTROL = CMD_RST | CMD_DRVR_ENABLE | z->parity | CMD_INTR;
+ /* Hold reset for at least 25 microseconds. */
+ DELAY (25);
+ /* Check that status cleared. */
+ if (*z->STATUS != 0) {
+ *z->CONTROL = 0;
+ return (8);
+ }
+
+ /* Check that DATA register is writable. */
+ for (i=0; i<256; ++i) {
+ *z->DATA = i;
+ if (*z->DATA != i) {
+ *z->CONTROL = 0;
+ return (9);
+ }
+ }
+
+ /* Enable the adapter. */
+ *z->CONTROL = CMD_INTR | z->parity;
+ /* Wait a Bus Clear Delay (800 ns + bus free delay 800 ns). */
+ DELAY (10);
+
+ /* Check that DATA register is NOT writable. */
+ c = *z->DATA;
+ for (i=0; i<256; ++i) {
+ *z->DATA = i;
+ if (*z->DATA != c) {
+ *z->CONTROL = 0;
+ return (10);
+ }
+ }
+
+ return (0);
+}
+
+/*
+ * Attach all sub-devices we can find.
+ */
+int sea_attach (struct isa_device *dev)
+{
+ int unit = dev->id_unit;
+ adapter_t *z = &seadata[unit];
+ struct scsibus_data *scbus;
+
+ printf ("\nsea%d: type %s%s\n", unit, z->name,
+ (dev->id_flags & FLAG_NOPARITY) ? ", no parity" : "");
+
+ /* fill in the prototype scsi_link */
+ z->sc_link.adapter_unit = unit;
+ z->sc_link.adapter_targ = z->scsi_addr;
+ z->sc_link.adapter_softc = z;
+ z->sc_link.adapter = &sea_switch;
+ z->sc_link.device = &sea_dev;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &z->sc_link;
+
+ /* ask the adapter what subunits are present */
+ scsi_attachdevs (scbus);
+
+ return (1);
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities.
+ */
+u_int32_t sea_adapter_info (int unit)
+{
+ return (1);
+}
+
+void seaminphys (struct buf *bp)
+{
+}
+
+/*
+ * Catch an interrupt from the adaptor.
+ */
+void seaintr (int unit)
+{
+ adapter_t *z = &seadata[unit];
+
+ PRINT (("sea%d: interrupt status=%b\n", unit, *z->STATUS, STAT_BITS));
+ sea_start (z);
+}
+
+/*
+ * This routine is used in the case when we have no IRQ line (z->irq == 0).
+ * It is called every timer tick and polls for reconnect from target.
+ */
+void sea_tick (void *arg)
+{
+ adapter_t *z = arg;
+ int x = splbio ();
+
+ z->timeout_active = 0;
+ sea_start (z);
+ if (z->disconnected_queue && ! z->timeout_active) {
+ timeout (sea_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ splx (x);
+}
+
+/*
+ * Start a scsi operation given the command and the data address.
+ * Also needs the unit, target and lu. Get a free scb and set it up.
+ * Call send_scb. Either start timer or wait until done.
+ */
+int32_t sea_scsi_cmd (struct scsi_xfer *xs)
+{
+ int flags = xs->flags, x = 0;
+ adapter_t *z = (adapter_t *)xs->sc_link->adapter_softc;
+ scb_t *scb;
+
+ PRINT (("sea%d/%d/%d command 0x%x\n", unit, xs->sc_link->target,
+ xs->sc_link->lun, xs->cmd->opcode));
+ if (xs->bp)
+ flags |= SCSI_NOSLEEP;
+ if (flags & ITSDONE) {
+ printf ("sea%d: already done?", xs->sc_link->adapter_unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (! (flags & INUSE)) {
+ printf ("sea%d: not in use?", xs->sc_link->adapter_unit);
+ xs->flags |= INUSE;
+ }
+ if (flags & SCSI_RESET)
+ printf ("sea%d: SCSI_RESET not implemented\n",
+ xs->sc_link->adapter_unit);
+
+ if (! (flags & SCSI_NOMASK))
+ x = splbio ();
+
+ /* Get a free scb.
+ * If we can and have to, sleep waiting for one to come free. */
+ while (! (scb = z->free_scb)) {
+ if (flags & SCSI_NOSLEEP) {
+ xs->error = XS_DRIVER_STUFFUP;
+ if (! (flags & SCSI_NOMASK))
+ splx (x);
+ return (TRY_AGAIN_LATER);
+ }
+ tsleep ((caddr_t)&z->free_scb, PRIBIO, "seascb", 0);
+ }
+ /* Get scb from free list. */
+ z->free_scb = scb->next;
+ scb->next = 0;
+ scb->flags = SCB_ACTIVE;
+
+ /* Put all the arguments for the xfer in the scb */
+ scb->xfer = xs;
+ scb->datalen = xs->datalen;
+ scb->data = xs->data;
+
+ /* Setup the scb to contain necessary values.
+ * The interesting values can be read from the xs that is saved.
+ * I therefore think that the structure can be kept very small.
+ * The driver doesn't use DMA so the scatter/gather is not needed? */
+ if (! z->queue) {
+ scb->next = z->queue;
+ z->queue = scb;
+ } else {
+ scb_t *q;
+
+ for (q=z->queue; q->next; q=q->next)
+ continue;
+ q->next = scb;
+ scb->next = 0; /* placed at the end of the queue */
+ }
+
+ /* Try to send this command to the board. */
+ sea_start (z);
+
+ /* Usually return SUCCESSFULLY QUEUED. */
+ if (! (flags & SCSI_NOMASK)) {
+ splx (x);
+ if (xs->flags & ITSDONE)
+ /* Timeout timer not started, already finished.
+ * Tried to return COMPLETE but the machine hanged
+ * with this. */
+ return (SUCCESSFULLY_QUEUED);
+ xs->timeout_ch = timeout (sea_timeout, (caddr_t) scb,
+ (xs->timeout * hz) / 1000);
+ scb->flags |= SCB_TIMECHK;
+ PRINT (("sea%d/%d/%d command queued\n",
+ xs->sc_link->adapter_unit,
+ xs->sc_link->target, xs->sc_link->lun));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /* If we can't use interrupts, poll on completion. */
+ if (! sea_poll (z, scb)) {
+ /* We timed out, so call the timeout handler manually,
+ * accounting for the fact that the clock is not running yet
+ * by taking out the clock queue entry it makes. */
+ sea_timeout ((void*) scb);
+
+ /* Because we are polling, take out the timeout entry
+ * sea_timeout made. */
+ untimeout (sea_timeout, (void*) scb, xs->timeout_ch);
+
+ if (! sea_poll (z, scb))
+ /* We timed out again... This is bad. Notice that
+ * this time there is no clock queue entry to remove. */
+ sea_timeout ((void*) scb);
+ }
+ PRINT (("sea%d/%d/%d command %s\n", xs->sc_link->adapter_unit,
+ xs->sc_link->target, xs->sc_link->lun,
+ xs->error ? "failed" : "done"));
+ return (xs->error ? HAD_ERROR : COMPLETE);
+}
+
+/*
+ * Coroutine that runs as long as more work can be done.
+ * Both scsi_cmd() and intr() will try to start it in
+ * case it is not running.
+ * Always called with interrupts disabled.
+ */
+void sea_start (adapter_t *z)
+{
+ scb_t *q, *prev;
+again:
+ /* First check that if any device has tried
+ * a reconnect while we have done other things
+ * with interrupts disabled. */
+ if (sea_reselect (z))
+ goto again;
+
+ /* Search through the queue for a command
+ * destined for a target that's not busy. */
+ for (q=z->queue, prev=0; q; prev=q, q=q->next) {
+ /* Attempt to establish an I_T_L nexus here. */
+ if (IS_BUSY (z, q) || ! sea_select (z, q))
+ continue;
+
+ /* Remove the command from the issue queue. */
+ if (prev)
+ prev->next = q->next;
+ else
+ z->queue = q->next;
+ q->next = 0;
+
+ /* We are connected. Do the task. */
+ sea_information_transfer (z, q);
+ goto again;
+ }
+}
+
+void sea_timeout (void *arg)
+{
+ scb_t *scb = (scb_t*) arg;
+ adapter_t *z = (adapter_t *)scb->xfer->sc_link->adapter_softc;
+ int x = splbio ();
+
+ if (! (scb->xfer->flags & SCSI_NOMASK))
+ printf ("sea%d/%d/%d (%s%d) timed out\n",
+ scb->xfer->sc_link->adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ scb->xfer->sc_link->device->name,
+ scb->xfer->sc_link->dev_unit);
+
+ /* If it has been through before, then a previous abort has failed,
+ * don't try abort again. */
+ if (! (scb->flags & SCB_ABORTED)) {
+ sea_abort (z, scb);
+ /* 2 seconds for the abort */
+ scb->xfer->timeout_ch = timeout (sea_timeout,
+ (caddr_t)scb, 2*hz);
+ scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
+ } else {
+ /* abort timed out */
+ scb->flags |= SCB_ABORTED;
+ scb->xfer->retries = 0;
+ sea_done (z, scb);
+ }
+ splx (x);
+}
+
+/*
+ * Wait until REQ goes down. This is needed for some devices (CDROMs)
+ * after every MSGOUT, MSGIN, CMDOUT, STATIN request.
+ * Return true if REQ deassert found.
+ */
+static __inline int sea_wait_for_req_deassert (adapter_t *z, int cnt, char *msg)
+{
+ __asm __volatile ("
+ 1: testb $0x10, %2
+ jz 2f
+ loop 1b
+ 2:"
+ : "=c" (cnt) /* output */
+ : "0" (cnt), "m" (*z->STATUS)); /* input */
+ if (! cnt) {
+ PRINT (("sea%d (%s) timeout waiting for !REQ\n",
+ z->sc_link.adapter_unit, msg));
+ return (0);
+ }
+ /* PRINT (("sea_wait_for_req_deassert %s count=%d\n", msg, cnt)); */
+ return (1);
+}
+
+/*
+ * Establish I_T_L or I_T_L_Q nexus for new or existing command
+ * including ARBITRATION, SELECTION, and initial message out
+ * for IDENTIFY and queue messages.
+ * Return 1 if selection succeded.
+ */
+int sea_select (volatile adapter_t *z, scb_t *scb)
+{
+ /* Start arbitration. */
+ *z->CONTROL = z->parity | CMD_INTR;
+ *z->DATA = z->scsi_id;
+ *z->CONTROL = CMD_START_ARB | z->parity;
+
+ /* Wait for arbitration to complete. */
+ WAITFOR (*z->STATUS & STAT_ARB_CMPL, "arbitration");
+ if (! (*z->STATUS & STAT_ARB_CMPL)) {
+ if (*z->STATUS & STAT_SEL) {
+ printf ("sea: arbitration lost\n");
+ scb->flags |= SCB_ERROR;
+ } else {
+ printf ("sea: arbitration timeout\n");
+ scb->flags |= SCB_TIMEOUT;
+ }
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+ DELAY (1);
+
+ *z->DATA = (1 << scb->xfer->sc_link->target) | z->scsi_id;
+ *z->CONTROL = sea_select_cmd | CMD_SEL | z->parity;
+ DELAY (2);
+
+ /* Wait for a bsy from target.
+ * If the target is not present on the bus, we get
+ * the timeout. Don't PRINT any message -- it's not an error. */
+ WAITFOR (*z->STATUS & STAT_BSY, 0);
+ if (! (*z->STATUS & STAT_BSY)) {
+ /* The target does not respond. Not an error, though. */
+ PRINT (("sea%d/%d/%d target does not respond\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ *z->CONTROL = CMD_INTR | z->parity;
+ scb->flags |= SCB_TIMEOUT;
+ return (0);
+ }
+
+ /* Try to make the target to take a message from us.
+ * Should start a MSGOUT phase. */
+ *z->CONTROL = sea_select_cmd | z->parity;
+ DELAY (15);
+ WAITFOR (*z->STATUS & STAT_REQ, 0);
+
+ if (z->type == CTLR_FUTURE_DOMAIN)
+ *z->CONTROL = CMD_INTR | z->parity | CMD_DRVR_ENABLE;
+
+ WAITFOR (*z->STATUS & STAT_REQ, 0);
+ if (! (*z->STATUS & STAT_REQ)) {
+ PRINT (("sea%d/%d/%d timeout waiting for REQ\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ scb->flags |= SCB_ERROR;
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+
+ /* Check for phase mismatch. FD 885 always seems to get this wrong! */
+ if ((*z->STATUS & PHASE_MASK) != PHASE_MSGOUT && z->type != CTLR_FUTURE_DOMAIN) {
+ PRINT (("sea%d/%d/%d waiting for MSGOUT: invalid phase %s\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ PHASE_NAME (*z->STATUS & PHASE_MASK)));
+ scb->flags |= SCB_ERROR;
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+
+ /* Allow disconnects. (except for FD controllers) */
+ if (z->type == CTLR_SEAGATE) {
+ *z->CONTROL = CMD_DRVR_ENABLE | z->parity;
+ *z->DATA = MSG_IDENTIFY (scb->xfer->sc_link->lun);
+ WAITREQ (&z->target[scb->xfer->sc_link->target], msgout, 1000);
+ }
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+
+ SET_BUSY (z, scb);
+ return (1);
+}
+
+int sea_reselect (adapter_t *z)
+{
+ scb_t *q = 0, *prev = 0;
+ u_char msg, target_mask, lun;
+again:
+ /* Wait for a device to win the reselection phase. */
+ /* Signals this by asserting the I/O signal. */
+ if ((*z->STATUS & (STAT_SEL | STAT_IO | STAT_BSY)) !=
+ (STAT_SEL | STAT_IO))
+ return (0);
+
+ /* The data bus contains original initiator id ORed with target id. */
+ /* See that we really are the initiator. */
+ target_mask = *z->DATA;
+ if (! (target_mask & z->scsi_id)) {
+ PRINT (("sea%d reselect not for me: mask=0x%x, status=%b\n",
+ z->sc_link.adapter_unit, target_mask,
+ *z->STATUS, STAT_BITS));
+ goto again;
+ }
+
+ /* Find target who won. */
+ /* Host responds by asserting the BSY signal. */
+ /* Target should respond by deasserting the SEL signal. */
+ target_mask &= ~z->scsi_id;
+ *z->CONTROL = CMD_DRVR_ENABLE | CMD_BSY | z->parity | CMD_INTR;
+ WAITFOR (! (*z->STATUS & STAT_SEL), "reselection acknowledge");
+
+ /* Remove the busy status. */
+ /* Target should set the MSGIN phase. */
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+ WAITFOR (*z->STATUS & STAT_REQ, "identify message");
+
+ /* Hope we get an IDENTIFY message. */
+ msg = sea_msg_input (z);
+ if (MSG_ISIDENT (msg)) {
+ /* Find the command corresponding to the I_T_L or I_T_L_Q
+ * nexus we just restablished, and remove it from
+ * the disconnected queue. */
+ lun = (msg & 7);
+ for (q=z->disconnected_queue; q; prev=q, q=q->next) {
+ if (target_mask != (1 << q->xfer->sc_link->target))
+ continue;
+ if (lun != q->xfer->sc_link->lun)
+ continue;
+ if (prev)
+ prev->next = q->next;
+ else
+ z->disconnected_queue = q->next;
+ q->next = 0;
+ PRINT (("sea%d/%d/%d reselect done\n",
+ z->sc_link.adapter_unit,
+ ffs (target_mask) - 1, lun));
+ sea_information_transfer (z, q);
+ WAITFOR (! (*z->STATUS & STAT_BSY), "reselect !busy");
+ return (1);
+ }
+ } else
+ printf ("sea%d reselect: expecting IDENTIFY, got 0x%x\n",
+ z->sc_link.adapter_unit, msg);
+
+ /* Since we have an established nexus that we can't
+ * do anything with, we must abort it. */
+ sea_send_abort (z);
+ PRINT (("sea%d reselect aborted\n", z->sc_link.adapter_unit));
+ WAITFOR (! (*z->STATUS & STAT_BSY), "bus free after reselect abort");
+ goto again;
+}
+
+/*
+ * Send an abort to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int sea_abort (adapter_t *z, scb_t *scb)
+{
+ scb_t *q, **prev;
+
+ /* If the command hasn't been issued yet, we simply remove it
+ * from the issue queue. */
+ prev = &z->queue;
+ for (q=z->queue; q; q=q->next) {
+ if (scb == q) {
+ (*prev) = q->next;
+ q->next = 0;
+ return (1);
+ }
+ prev = &q->next;
+ }
+
+ /* If the command is currently disconnected from the bus,
+ * we reconnect the I_T_L or I_T_L_Q nexus associated with it,
+ * go into message out, and send an abort message. */
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb != q)
+ continue;
+
+ if (! sea_select (z, scb))
+ return (0);
+ sea_send_abort (z);
+
+ prev = &z->disconnected_queue;
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb == q) {
+ *prev = q->next;
+ q->next = 0;
+ /* Set some type of error result
+ * for the operation. */
+ return (1);
+ }
+ prev = &q->next;
+ }
+ }
+
+ /* Command not found in any queue. */
+ return (0);
+}
+
+/*
+ * The task accomplished, mark the i/o control block as done.
+ * Always called with interrupts disabled.
+ */
+void sea_done (adapter_t *z, scb_t *scb)
+{
+ struct scsi_xfer *xs = scb->xfer;
+
+ if (scb->flags & SCB_TIMECHK)
+ untimeout (sea_timeout, (caddr_t) scb, xs->timeout_ch);
+
+ /* How much of the buffer was not touched. */
+ xs->resid = scb->datalen;
+
+ if (scb->flags != SCB_ACTIVE && ! (xs->flags & SCSI_ERR_OK))
+ if (scb->flags & (SCB_TIMEOUT | SCB_ABORTED))
+ xs->error = XS_TIMEOUT;
+ else if (scb->flags & SCB_ERROR)
+ xs->error = XS_DRIVER_STUFFUP;
+ else if (scb->flags & SCB_TBUSY)
+ xs->error = XS_BUSY;
+ else if (scb->flags & SCB_SENSE)
+ xs->error = XS_SENSE;
+
+ xs->flags |= ITSDONE;
+
+ /* Free the control block. */
+ scb->next = z->free_scb;
+ z->free_scb = scb;
+ scb->flags = SCB_FREE;
+
+ /* If there were none, wake anybody waiting for one to come free,
+ * starting with queued entries. */
+ if (! scb->next)
+ wakeup ((caddr_t) &z->free_scb);
+
+ scsi_done (xs);
+}
+
+/*
+ * Wait for completion of command in polled mode.
+ * Always called with interrupts masked out.
+ */
+int sea_poll (adapter_t *z, scb_t *scb)
+{
+ int count;
+
+ for (count=0; count<30; ++count) {
+ DELAY (1000); /* delay for a while */
+ sea_start (z); /* retry operation */
+ if (scb->xfer->flags & ITSDONE)
+ return (1); /* all is done */
+ if (scb->flags & SCB_TIMEOUT)
+ return (0); /* no target present */
+ }
+ return (0);
+}
+
+/*
+ * Send data to the target.
+ */
+void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ volatile u_char *data = *pdata;
+ volatile u_int len = *plen;
+
+#ifdef SEA_BLINDTRANSFER
+ if (len && !(len % BLOCK_SIZE)) {
+ while (len) {
+ WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read");
+ __asm __volatile ("
+ shr $2, %%ecx;
+ cld;
+ rep;
+ movsl; " : :
+ "D" (z->DATA), "S" (data), "c" (BLOCK_SIZE) :
+ "cx", "si", "di" );
+ data += BLOCK_SIZE;
+ len -= BLOCK_SIZE;
+ }
+ } else {
+#endif
+ __asm __volatile ("cld
+ 1: movb (%%ebx), %%al
+ xorb $1, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ lodsb
+ movb %%al, (%%edi)
+ loop 1b
+ 2:"
+ : "=S" (data), "=c" (len) /* output */
+ : "D" (z->DATA), "b" (z->STATUS), /* input */
+ "0" (data), "1" (len)
+ : "eax", "ebx", "edi"); /* clobbered */
+#ifdef SEA_BLINDTRANSFER
+ }
+#endif
+ PRINT (("sea (DATAOUT) send %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = (u_char *)data;
+}
+
+/*
+ * Receive data from the target.
+ */
+void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ volatile u_char *data = *pdata;
+ volatile u_int len = *plen;
+
+#ifdef SEA_BLINDTRANSFER
+ if (len && !(len % BLOCK_SIZE)) {
+ while (len) {
+ WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read");
+ __asm __volatile ("
+ shr $2, %%ecx;
+ cld;
+ rep;
+ movsl; " : :
+ "S" (z->DATA), "D" (data), "c" (BLOCK_SIZE) :
+ "cx", "si", "di" );
+ data += BLOCK_SIZE;
+ len -= BLOCK_SIZE;
+ }
+ } else {
+#endif
+ if (len >= 512) {
+ __asm __volatile (" cld
+ 1: movb (%%esi), %%al
+ xorb $5, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ movb (%%ebx), %%al
+ stosb
+ loop 1b
+ 2:"
+ : "=D" (data), "=c" (len) /* output */
+ : "b" (z->DATA), "S" (z->STATUS),
+ "0" (data), "1" (len) /* input */
+ : "eax", "ebx", "esi"); /* clobbered */
+ } else {
+ __asm __volatile (" cld
+ 1: movb (%%esi), %%al
+ xorb $5, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ movb (%%ebx), %%al
+ stosb
+ movb $1000, %%al
+ 3: testb $0x10, (%%esi)
+ jz 4f
+ dec %%al
+ jnz 3b
+ 4: loop 1b
+ 2:"
+ : "=D" (data), "=c" (len) /* output */
+ : "b" (z->DATA), "S" (z->STATUS),
+ "0" (data), "1" (len) /* input */
+ : "eax", "ebx", "esi"); /* clobbered */
+ }
+#ifdef SEA_BLINDTRANSFER
+ }
+#endif
+ PRINT (("sea (DATAIN) got %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = (u_char *)data;
+}
+
+/*
+ * Send the command to the target.
+ */
+void sea_cmd_output (target_t *t, u_char *cmd, int cmdlen)
+{
+ adapter_t *z = t->adapter;
+
+ PRINT (("sea%d send command (%d bytes) ", z->sc_link.adapter_unit,
+ cmdlen));
+
+ PRINT (("%x", *cmd));
+ *z->DATA = *cmd++;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, cmdout1, 10000);
+ --cmdlen;
+
+ while (cmdlen) {
+ /* Check for target disconnect. */
+ u_char sts = *z->STATUS;
+ if (! (sts & STAT_BSY))
+ break;
+
+ /* Check for phase mismatch. FD 885 seems to get this wrong! */
+ if ((sts & PHASE_MASK) != PHASE_CMDOUT && z->type != CTLR_FUTURE_DOMAIN) {
+ printf ("sea: sea_cmd_output: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return;
+ }
+
+ /* Wait for REQ. */
+ if (! (sts & STAT_REQ))
+ continue;
+
+ PRINT (("-%x", *cmd));
+ *z->DATA = *cmd++;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, cmdout, 1000);
+ --cmdlen;
+ }
+ PRINT (("\n"));
+}
+
+/*
+ * Send the message to the target.
+ */
+void sea_send_abort (adapter_t *z)
+{
+ u_char sts;
+
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | CMD_ATTN | z->parity;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (*z->STATUS & STAT_REQ, "abort message");
+ sts = *z->STATUS;
+ if (! (sts & STAT_REQ))
+ goto ret;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_MSGOUT) {
+ printf ("sea: sending MSG_ABORT: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ goto ret;
+ }
+
+ *z->DATA = MSG_ABORT;
+ sea_wait_for_req_deassert (z, 1000, "MSG_OUTPUT");
+ PRINT (("sea%d send abort message\n", z->sc_link.adapter_unit));
+ret:
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+}
+
+/*
+ * Get the message from the target.
+ * Return the length of the received message.
+ */
+u_char sea_msg_input (adapter_t *z)
+{
+ u_char sts, msg;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (*z->STATUS & STAT_REQ, "message input");
+ sts = *z->STATUS;
+ if (! (sts & STAT_REQ))
+ return (MSG_ABORT);
+
+ /* Check for phase mismatch.
+ * Reached if the target decides that it has finished the transfer. */
+ if ((sts & PHASE_MASK) != PHASE_MSGIN) {
+ printf ("sea: sea_msg_input: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return (MSG_ABORT);
+ }
+
+ /* Do actual transfer from SCSI bus to/from memory. */
+ msg = *z->DATA;
+ sea_wait_for_req_deassert (z, 1000, "MSG_INPUT");
+ PRINT (("sea%d (MSG_INPUT) got 0x%x\n", z->sc_link.adapter_unit, msg));
+ return (msg);
+}
+
+/*
+ * Send request-sense op to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int sea_sense (adapter_t *z, scb_t *scb)
+{
+ u_char cmd[6], status, msg, *data;
+ u_long len;
+
+ /* Wait for target to disconnect. */
+ WAITFOR (! (*z->STATUS & STAT_BSY), "sense bus free");
+ if (*z->STATUS & STAT_BSY)
+ return (0);
+
+ /* Select the target again. */
+ if (! sea_select (z, scb))
+ return (0);
+
+ /* Wait for CMDOUT phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense CMDOUT");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_CMDOUT)
+ return (0);
+
+ /* Send command. */
+ len = sizeof (scb->xfer->sense);
+ cmd[0] = REQUEST_SENSE;
+ cmd[1] = scb->xfer->sc_link->lun << 5;
+ cmd[2] = 0;
+ cmd[3] = 0;
+ cmd[4] = len;
+ cmd[5] = 0;
+ sea_cmd_output (&z->target[scb->xfer->sc_link->target],
+ cmd, sizeof (cmd));
+
+ /* Wait for DATAIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense DATAIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_DATAIN)
+ return (0);
+
+ data = (u_char*) &scb->xfer->sense;
+ sea_data_input (z, &data, &len);
+ PRINT (("sea%d sense %x-%x-%x-%x-%x-%x-%x-%x\n",
+ z->sc_link.adapter_unit, scb->xfer->sense.error_code,
+ scb->xfer->sense.ext.extended.segment,
+ scb->xfer->sense.ext.extended.flags,
+ scb->xfer->sense.ext.extended.info[0],
+ scb->xfer->sense.ext.extended.info[1],
+ scb->xfer->sense.ext.extended.info[2],
+ scb->xfer->sense.ext.extended.info[3],
+ scb->xfer->sense.ext.extended.extra_len));
+
+ /* Wait for STATIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense STATIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_STATIN)
+ return (0);
+
+ status = *z->DATA;
+
+ /* Wait for MSGIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense MSGIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_MSGIN)
+ return (0);
+
+ msg = *z->DATA;
+
+ if (status != 0 || msg != 0)
+ printf ("sea%d: bad sense status=0x%x, msg=0x%x\n",
+ z->sc_link.adapter_unit, status, msg);
+ return (1);
+}
+
+/*
+ * Do the transfer. We know we are connected. Update the flags,
+ * call sea_done when task accomplished. Dialog controlled by the target.
+ * Always called with interrupts disabled.
+ */
+void sea_information_transfer (adapter_t *z, scb_t *scb)
+{
+ u_char *data = scb->data; /* current data buffer */
+ u_long datalen = scb->datalen; /* current data transfer size */
+ target_t *t = &z->target[scb->xfer->sc_link->target];
+ register u_char sts;
+ u_char msg;
+
+ while ((sts = *z->STATUS) & STAT_BSY) {
+ /* We only have a valid SCSI phase when REQ is asserted. */
+ if (! (sts & STAT_REQ))
+ continue;
+ if (sts & STAT_PARITY) {
+ int target = scb->xfer->sc_link->target;
+ if (++z->target[target].perrcnt <= 8)
+ printf ("sea%d/%d/%d parity error\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ if (z->target[target].perrcnt == 8)
+ printf ("sea%d/%d/%d too many parity errors, not logging any more\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ }
+ switch (sts & PHASE_MASK) {
+ case PHASE_DATAOUT:
+ if (datalen <= 0) {
+ printf ("sea%d/%d/%d data length underflow\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ /* send zero byte */
+ *z->DATA = 0;
+ break;
+ }
+ sea_data_output (z, &data, &datalen);
+ break;
+ case PHASE_DATAIN:
+ if (datalen <= 0) {
+ /* Get extra data. Some devices (e.g. CDROMs)
+ * use fixed-length blocks (e.g. 2k),
+ * even if we need less. */
+ PRINT (("@"));
+ sts = *z->DATA;
+ break;
+ }
+ sea_data_input (z, &data, &datalen);
+ break;
+ case PHASE_CMDOUT:
+ sea_cmd_output (t, (u_char*) scb->xfer->cmd,
+ scb->xfer->cmdlen);
+ break;
+ case PHASE_STATIN:
+ scb->xfer->status = *z->DATA;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, statin, 2000);
+ PRINT (("sea%d/%d/%d (STATIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ (u_char) scb->xfer->status));
+ break;
+ case PHASE_MSGOUT:
+ /* Send no-op message. */
+ *z->DATA = MSG_NOP;
+ sea_wait_for_req_deassert (z, 1000, "MSGOUT");
+ PRINT (("sea%d/%d/%d (MSGOUT) send NOP\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ break;
+ case PHASE_MSGIN:
+ /* Don't handle multi-byte messages here, because they
+ * should not be present here. */
+ msg = *z->DATA;
+ sea_wait_for_req_deassert (z, 2000, "MSGIN");
+ PRINT (("sea%d/%d/%d (MSGIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg));
+ switch (msg) {
+ case MSG_COMMAND_COMPLETE:
+ scb->data = data;
+ scb->datalen = datalen;
+ /* In the case of check-condition status,
+ * perform the request-sense op. */
+ switch (scb->xfer->status & 0x1e) {
+ case SCSI_CHECK:
+ if (sea_sense (z, scb))
+ scb->flags = SCB_SENSE;
+ break;
+ case SCSI_BUSY:
+ scb->flags = SCB_TBUSY;
+ break;
+ }
+ goto done;
+ case MSG_ABORT:
+ printf ("sea: command aborted by target\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_MESSAGE_REJECT:
+ printf ("sea: message rejected\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_DISCONNECT:
+ scb->next = z->disconnected_queue;
+ z->disconnected_queue = scb;
+ if (! z->irq && ! z->timeout_active) {
+ timeout (sea_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ PRINT (("sea%d/%d/%d disconnected\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ goto ret;
+ case MSG_SAVE_POINTERS:
+ scb->data = data;
+ scb->datalen = datalen;
+ break;
+ case MSG_RESTORE_POINTERS:
+ data = scb->data;
+ datalen = scb->datalen;
+ break;
+ default:
+ printf ("sea%d/%d/%d unknown message: 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg);
+ break;
+ }
+ break;
+ default:
+ printf ("sea: unknown phase: %b\n", sts, STAT_BITS);
+ break;
+ }
+ }
+ printf ("sea%d/%d/%d unexpected target disconnect\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ scb->flags = SCB_ERROR;
+done:
+ CLEAR_BUSY (z, scb);
+ sea_done (z, scb);
+ret:
+ *z->CONTROL = CMD_INTR | z->parity;
+}
+#endif /* NSEA */
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index 230e38726761..4f91d8a44330 100644
--- a/sys/i386/isa/si.c
+++ b/sys/i386/isa/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.77 1998/08/23 10:12:12 bde Exp $
+ * $Id: si.c,v 1.76 1998/08/23 08:26:40 bde Exp $
*/
#ifndef lint
@@ -133,7 +133,7 @@ static u_long sipcieisacount = 0;
#if NPCI > 0
-static const char *sipciprobe __P((pcici_t, pcidi_t));
+static char *sipciprobe __P((pcici_t, pcidi_t));
static void sipciattach __P((pcici_t, int));
static struct pci_device sipcidev = {
@@ -316,7 +316,7 @@ static char *si_type[] = {
#if NPCI > 0
-static const char *
+static char *
sipciprobe(configid, deviceid)
pcici_t configid;
pcidi_t deviceid;
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index 7660965a930a..b0ad5fc67eea 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.223 1999/01/12 01:04:37 eivind Exp $
+ * $Id: sio.c,v 1.214 1998/08/23 10:16:26 bde Exp $
*/
#include "opt_comconsole.h"
@@ -70,9 +70,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
@@ -86,7 +83,6 @@
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -314,7 +310,6 @@ static int sioattach __P((struct isa_device *dev));
static timeout_t siobusycheck;
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
-static ointhand2_t siointr;
static void siointr1 __P((struct com_s *com));
static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
@@ -326,6 +321,9 @@ static timeout_t comwakeup;
static void disc_optim __P((struct tty *tp, struct termios *t,
struct com_s *com));
+#ifdef DSI_SOFT_MODEM
+static int LoadSoftModem __P((int unit,int base_io, u_long size, u_char *ptr));
+#endif /* DSI_SOFT_MODEM */
static char driver_name[] = "sio";
@@ -466,7 +464,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -873,7 +881,6 @@ sioattach(isdp)
int s;
int unit;
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
iobase = isdp->id_iobase;
unit = isdp->id_unit;
@@ -942,6 +949,12 @@ sioattach(isdp)
/* attempt to determine UART type */
printf("sio%d: type", unit);
+#ifdef DSI_SOFT_MODEM
+ if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) {
+ printf(" Digicom Systems, Inc. SoftModem");
+ goto determined_type;
+ }
+#endif /* DSI_SOFT_MODEM */
#ifdef COM_MULTIPORT
if (!COM_ISMULTIPORT(isdp) && !COM_IIR_TXRDYBUG(isdp))
@@ -1456,7 +1469,7 @@ siodtrwakeup(chan)
wakeup(&com->dtr_wait);
}
-static void
+void
siointr(unit)
int unit;
{
@@ -1506,6 +1519,7 @@ siointr1(com)
u_char modem_status;
u_char *ioptr;
u_char recv_data;
+ u_char int_ident;
u_char int_ctl;
u_char int_ctl_new;
@@ -1729,6 +1743,34 @@ sioioctl(dev, cmd, data, flag, p)
case TIOCGWINSZ:
bzero(data, sizeof(struct winsize));
return (0);
+#ifdef DSI_SOFT_MODEM
+ /*
+ * Download micro-code to Digicom modem.
+ */
+ case TIOCDSIMICROCODE:
+ {
+ u_long l;
+ u_char *p,*pi;
+
+ pi = (u_char*)(*(caddr_t*)data);
+ error = copyin(pi,&l,sizeof l);
+ if(error)
+ {return error;};
+ pi += sizeof l;
+
+ p = malloc(l,M_TEMP,M_NOWAIT);
+ if(!p)
+ {return ENOBUFS;}
+ error = copyin(pi,p,l);
+ if(error)
+ {free(p,M_TEMP); return error;};
+ if(error = LoadSoftModem(
+ MINOR_TO_UNIT(mynor),iobase,l,p))
+ {free(p,M_TEMP); return error;}
+ free(p,M_TEMP);
+ return(0);
+ }
+#endif /* DSI_SOFT_MODEM */
default:
return (ENOTTY);
}
@@ -1993,9 +2035,11 @@ comparam(tp, t)
int divisor;
u_char dlbh;
u_char dlbl;
+ int error;
Port_t iobase;
int s;
int unit;
+ int txtimeout;
/* do historical conversions */
if (t->c_ispeed == 0)
@@ -2061,8 +2105,54 @@ comparam(tp, t)
outb(iobase + com_fifo, com->fifo_image);
}
+ /*
+ * Some UARTs lock up if the divisor latch registers are selected
+ * while the UART is doing output (they refuse to transmit anything
+ * more until given a hard reset). Fix this by stopping filling
+ * the device buffers and waiting for them to drain. Reading the
+ * line status port outside of siointr1() might lose some receiver
+ * error bits, but that is acceptable here.
+ */
+ disable_intr();
+retry:
+ com->state &= ~CS_TTGO;
+ txtimeout = tp->t_timeout;
+ enable_intr();
+ while ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY)) {
+ tp->t_state |= TS_SO_OCOMPLETE;
+ error = ttysleep(tp, TSA_OCOMPLETE(tp), TTIPRI | PCATCH,
+ "siotx", hz / 100);
+ if ( txtimeout != 0
+ && (!error || error == EAGAIN)
+ && (txtimeout -= hz / 100) <= 0
+ )
+ error = EIO;
+ if (com->gone)
+ error = ENODEV;
+ if (error != 0 && error != EAGAIN) {
+ if (!(tp->t_state & TS_TTSTOP)) {
+ disable_intr();
+ com->state |= CS_TTGO;
+ enable_intr();
+ }
+ splx(s);
+ return (error);
+ }
+ }
+
disable_intr(); /* very important while com_data is hidden */
+ /*
+ * XXX - clearing CS_TTGO is not sufficient to stop further output,
+ * because siopoll() calls comstart() which usually sets it again
+ * because TS_TTSTOP is clear. Setting TS_TTSTOP would not be
+ * sufficient, for similar reasons.
+ */
+ if ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY))
+ goto retry;
+
if (divisor != 0) {
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
/*
@@ -2254,6 +2344,7 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_XMT_RST | com->fifo_image);
com->obufs[0].l_queued = FALSE;
@@ -2269,6 +2360,7 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_RCV_RST | com->fifo_image);
com_events -= (com->iptr - com->ibuf);
@@ -2479,18 +2571,6 @@ static void siocnclose __P((struct siocnstate *sp));
static void siocnopen __P((struct siocnstate *sp));
static void siocntxwait __P((void));
-/*
- * XXX: sciocnget() and sciocnputc() are not declared static, as they are
- * referred to from i386/i386/i386-gdbstub.c.
- */
-static cn_probe_t siocnprobe;
-static cn_init_t siocninit;
-static cn_checkc_t siocncheckc;
- cn_getc_t siocngetc;
- cn_putc_t siocnputc;
-
-CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
-
static void
siocntxwait()
{
@@ -2612,7 +2692,7 @@ siocnclose(sp)
outb(iobase + com_ier, sp->ier);
}
-static void
+void
siocnprobe(cp)
struct consdev *cp;
{
@@ -2678,14 +2758,14 @@ siocnprobe(cp)
}
}
-static void
+void
siocninit(cp)
struct consdev *cp;
{
comconsole = DEV_TO_UNIT(cp->cn_dev);
}
-static int
+int
siocncheckc(dev)
dev_t dev;
{
@@ -2743,6 +2823,126 @@ siocnputc(dev, c)
splx(s);
}
+#ifdef DSI_SOFT_MODEM
+/*
+ * The magic code to download microcode to a "Connection 14.4+Fax"
+ * modem from Digicom Systems Inc. Very magic.
+ */
+
+#define DSI_ERROR(str) { ptr = str; goto error; }
+static int
+LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr)
+{
+ int int_c,int_k;
+ int data_0188, data_0187;
+
+ /*
+ * First see if it is a DSI SoftModem
+ */
+ if(!((inb(base_io+7) ^ inb(base_io+7)) & 0x80))
+ return ENODEV;
+
+ data_0188 = inb(base_io+4);
+ data_0187 = inb(base_io+3);
+ outb(base_io+3,0x80);
+ outb(base_io+4,0x0C);
+ outb(base_io+0,0x31);
+ outb(base_io+1,0x8C);
+ outb(base_io+7,0x10);
+ outb(base_io+7,0x19);
+
+ if(0x18 != (inb(base_io+7) & 0x1A))
+ DSI_ERROR("dsp bus not granted");
+
+ if(0x01 != (inb(base_io+7) & 0x01)) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x01 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program mem not granted");
+ }
+
+ int_c = 0;
+
+ while(1) {
+ if(int_c >= 7 || size <= 0x1800)
+ break;
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+ int_c++;
+ }
+
+ if(size > 0x1800) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+
+ while(size > 0x1800) {
+ for(int_k = 0 ; int_k < 0xC00; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ size -= 0x1800;
+ }
+
+ if(size < 0x1800) {
+ for(int_k=0;int_k<size/2;int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+
+ } else if (size > 0) {
+ if(int_c == 7) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ } else {
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+ }
+ outb(base_io+7,0x11);
+ outb(base_io+7,3);
+
+ outb(base_io+4,data_0188 & 0xfb);
+
+ outb(base_io+3,data_0187);
+
+ return 0;
+error:
+ printf("sio%d: DSI SoftModem microcode load failed: <%s>\n",unit,ptr);
+ outb(base_io+7,0x00); \
+ outb(base_io+3,data_0187); \
+ outb(base_io+4,data_0188); \
+ return EIO;
+}
+#endif /* DSI_SOFT_MODEM */
/*
* support PnP cards if we are using 'em
@@ -2820,7 +3020,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = siointr;
+ dev->id_intr = siointr;
dev->id_ri_flags = RI_FAST;
dev->id_drq = -1;
diff --git a/sys/i386/isa/sioreg.h b/sys/i386/isa/sioreg.h
index bec807b0de42..4a0c4cf87d8e 100644
--- a/sys/i386/isa/sioreg.h
+++ b/sys/i386/isa/sioreg.h
@@ -31,15 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
- * $Id: sioreg.h,v 1.10 1997/06/04 16:25:15 pst Exp $
+ * $Id: sioreg.h,v 1.9 1997/06/04 04:52:40 pst Exp $
*/
/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
#define COMBRD(x) (1843200 / (16*(x)))
-#ifdef PC98
-#define COMBRD_RSA(x) (14745600 / (16*(x)))
-#endif
/* interrupt enable register */
#define IER_ERXRDY 0x1
@@ -109,16 +106,6 @@
#define MSR_DDSR 0x02
#define MSR_DCTS 0x01
-#ifdef PC98
-/* Hardware extension mode register for RSB-2000/3000. */
-#define EMR_EXBUFF 0x04
-#define EMR_CTSFLW 0x08
-#define EMR_DSRFLW 0x10
-#define EMR_RTSFLW 0x20
-#define EMR_DTRFLW 0x40
-#define EMR_EFMODE 0x80
-#endif
-
/* speed to initialize to during chip tests */
#define SIO_TEST_SPEED 9600
diff --git a/sys/i386/isa/snd/CARDS b/sys/i386/isa/snd/CARDS
index 5757be3f14c4..91ca79b68229 100644
--- a/sys/i386/isa/snd/CARDS
+++ b/sys/i386/isa/snd/CARDS
@@ -1,97 +1,37 @@
-In this file I will try to build a database of cards supported by
-this driver. I also include the command to use for manual configuration
-of the card in case your BIOS is not PnP-aware. Of course it is
-your responsibility to pick up free port ranges and irq and drq
-channels.
+In this file I will try to build a database of cards supported by this
+driver. I also include the command to use for manual configuration of
+the card in case your BIOS is not PnP-aware. Of course it is your
+responsibility to pick up free prot ranges and irq and drq channels.
For PnP cards, I also include the vendor_id and serial numbers of
-cards I have encountered. Underscores in the PnP id mean that
-(I believe) there is a large variety of values in those positions,
-and the code in the audio driver generally masks those bits.
+cards I have encountered. Underscores in the PnP id mean that there is
+a large variety of values in those positions.
Finally, where available, I have put the URL where you can find the
data sheets of the chip.
-To my knowledge, there are the following families of audio cards:
-
-* WSS (also called MSS) and clones:
- these are true full duplex cards, have a very nice architecture and
- are well documented. Chipsets implementing these functionalities
- are made from Crystal, Analog Devices, Yamaha, OPTI.
-
-* SB16 and clones:
- these cards have a higly asymmetric architecture, and are not very
- well suited to full duplex operation. Made by Creative, Realtek.
- There is no documentation on the newer codecs (Vibra16X and ALS100+),
- so they are not fully working.
-
-* ESS
- ESS builds cards that implement a superset of SB16. They are
- often capable of full duplex, but my driver does not support them
- other than in full duplex emulation. My fault, since documentation
- on these cards _is_ available.
-
-* PCI cards.
- There are a quite few PCI audio cards around based on a number of
- different chipsets. Some of them are documented (e.g. S3 Sonic
- Vibes, Ensoniq ES1370), some are not (e.g. Yamaha YMF724),
- work is in progress to support such cards. See the notes below.
- Note that CreativeLabs has recently (fall'97) acquired Ensoniq
- and the audio division of OPTI, both of which had a PCI audio
- chipset. I don't know if there are other manufacturers of PCI
- audio cards.
-
-Finally, some people wrote patches for the following chips:
-
- AD1816
- MAD16
- ESS
---------------------------
-CHIPSET:
- CS4235: PnP id 0x25__630e
- CS4236: PnP id 0x36__630e 0x35__630e
- CS4237: PnP id 0x37__630e
-MANUFACTURER:
- A/Open (or AcerOpen) AW32, AW35, AW37
- Also, integrated on the motherboard on some machines.
-
-DATA SHEETS:
+CS4236B: PnP id 0x35__630e
+CS4236: PnP id 0x36__630e
+CS4237: PnP id 0x37__630e
+
http://www.crystal.com/ 4237full.pdf
-PNP CONFIG:
pnp 1 0 os enable port0 0x534 port2 0x220 irq0 5 drq0 1 drq1 3
-COMMENTS:
- Work like a charm. All modes, including full duplex, supported in
+ work like a charm. All modes, including full duplex, supported in
MSS mode.
- Cards based on the 4237, and possibly the 4236 as well, connect
- the CD to AUX2. When used in MODE1/2 (as this driver does)
- there is no route in the input mixer from AUX2 to the ADC. So,
- to record directly from the CD, the only way is to set the
- input to SOUND_MASK_IMIX.
-
- Some machines with the cs4235 in non-pnp mode map the codec at 0x530
- instead of 0x534. For those machines you need an unusual config line
-
- device pcm0 at isa ? port 0x52C ...
+ NOTE: cards based on the 4237, and possibly the 4236 as well,
+ connect the CD to AUX2. When used in MODE1/2 (as this driver
+ does) there is no route in the input mixer from AUX2 to the
+ ADC. So, to record directly from the CD, the only way is
+ to set the input to SOUND_MASK_IMIX.
+CS4232: PnP id 0x3242630e
---------------------------
-CHIPSET:
- CS4232: PnP id 0x3242630e
-
-MANUFACTURER:
- ???
-
-DATA SHEETS:
- http://www.crystal.com/
-
-PNP CONFIG:
pnp 1 0 os enable port0 0x534 port2 0x220 irq0 5 drq0 1 drq1 3
-COMMENTS:
This chip is reported as broken in the OSS documentation. As a
matter of fact, on my Intel Zappa motherboard, I have problems in
make it use the secondary DMA channel. I have it working in
@@ -101,31 +41,10 @@ COMMENTS:
--------------------------
CHIPSET:
- AD1815/1816
-
-MANUFACTURER:
- Analog Devices
-
-DOCUMENTATION:
- http://www.analog.com
-
-COMMENTS:
- This is a chip for ISA-PnP cards, and so should be configured
- using the PnP interface. For full function configure port2,
- irq0, drq0 and drq1 of ldn0.
- The driver is contributed by German Tischler
-
-FORMATS:
- ALAW/ULAW/8bit/16bit(le)/16bit(be),8kHz-55.2kHz,full duplex
-
---------------------------
-CHIPSET:
OPTi931: PnP id 0x3109143e
- OPTi933: PnP id 0x3109143e (yes, it's the same)
MANUFACTURER:
ExpertColor MED931 (europe)
- Shuttle HOT-247 (uses the 933, $15 retail in the US)
DATA SHEETS:
http://www.opti.com/ opti931_21.pdf
@@ -171,7 +90,6 @@ MANUFACTURER:
DATA SHEETS:
http://www.creative.com sbhwpg.pdf or SBHWPG.EXE
- ftp://www.creaf.com/pub/creative/devinfo/ctsbhwpg.exe
PNP CONFIG:
pnp 1 0 os enable port0 0x220 irq0 5 drq0 1 drq1 5
@@ -238,8 +156,6 @@ MANUFACTURER:
DATA SHEETS:
http://www.yamaha.com ? YM711.pdf
- ftp://ftp.yamahayst.com/pub/Fax_Back_Doc/Sound
- http://www.imail.net.tw/qtronix/qumax_product_yamaha.htm
This is a huge file containing a few pages scanned and converted
to pdf. Not very detailed. Luckily, this chipset appears to do a
@@ -330,27 +246,11 @@ CHIPSET:
-------------------------
CHIPSET:
- es1370 (ensoniq)
- es1371 (ensoniq)
- used on SB64 PCI, Shuttle HOT-255, and maybe others
-
- A driver for this is in the works.
- see http://www.ensoniq.com/multimedia/semi_html/index.htm
- for documentation. See also http://alsa.jcu.cz/alsa/ for a Linux
- driver.
-
--------------------------
-CHIPSET:
- YMF724
- used on various Yamaha (WaveForce) and other cards.
-
- NOT SUPPORTED.
-
- There is no public docs on this card, the closest thing being
- http://www.imail.net.tw/qtronix/driver/qumax/yamaha/ds1e1110.pdf
- http://www.imail.net.tw/qtronix/qumax_product_yamaha.htm
- which however does not document how the card works in non-legacy
- mode and how to make it talk to the AC97 codec.
+ various PCI cards from Ensoniq, OPTI, CreativeLabs.
+ This code _cannot_ work on these cards as it is now, since I
+ don't think they can use the ISA DMA controller. As there are
+ no data sheets available for these PCI cards, none of them is
+ supported at the moment.
--------------------------------------------------------------------
diff --git a/sys/i386/isa/snd/README b/sys/i386/isa/snd/README
index e45bde7f2dbc..289f0442ad2e 100644
--- a/sys/i386/isa/snd/README
+++ b/sys/i386/isa/snd/README
@@ -38,7 +38,7 @@ CARDS:
The driver supports most clones of WSS, SB16 and SBPro cards.
This includes those based on the Crystal CS423x, OPTI931, GUSPnP,
Yamaha, SB16/32 (both plain ISA, PnP, and the various AWExx).
- Many PnP cards are directly recognized, for others you might need
+ Many PnP cards are directly recognised, for others you might need
manual configuration. See the file "CARDS" for more details.
APPLICATIONS:
@@ -69,7 +69,7 @@ APPLICATIONS:
controller pnp0 # this is required for PnP support
- device pcm0 at isa ? port? tty irq N drq D flags F
+ device pcm0 at isa ? port? tty irq N drq D flags F vector pcmintr
where
@@ -83,7 +83,7 @@ APPLICATIONS:
since this is unsupported at the moment...).
The code will probe for common port addresses (0x220, 0x240
- for SB and clones, 0x530 for WSS and clones), so you don't need
+ for SB and clonse, 0x530 for WSS and clones), so you don't need
to specify them if your system uses one of them. In case you
do, note that for WSS cards the code assumes that the board
occupies 8 IO addresses, the first four used to configure
@@ -95,13 +95,13 @@ APPLICATIONS:
You can use multiple sound cards, in which case you need more
lines like
- device pcm1 at isa ? port? tty irq N drq D flags F
- device pcm2 at isa ? port? tty irq N drq D flags F
+ device pcm1 at isa ? port? tty irq N drq D flags F vector pcmintr
+ device pcm2 at isa ? port? tty irq N drq D flags F vector pcmintr
...
EXAMPLES: a typical "device" line for the SB16 (full duplex) is
- device pcm0 at isa ? port? tty irq 5 drq 1 flags 0x15
+ device pcm0 at isa ? port? tty irq 5 drq 1 flags 0x15 vector pcmintr
The driver will check at the default addresses (or the one you
specify) which type of SoundBlaster you have (1.5, 2.0, 3.X
@@ -113,7 +113,7 @@ APPLICATIONS:
For a WSS-compatible codec (non PnP) working in full duplex using
dma channels 1 and 3, you can specify:
- device pcm0 at isa ? port 0x530 tty irq 7 drq 1 flags 0x13
+ device pcm0 at isa ? port 0x530 tty irq 7 drq 1 flags 0x13 vector pcmintr
(0x530 is a default if no port address is specified). The
"flags 0x13" specifies that you have a dual dma board with
@@ -130,9 +130,10 @@ APPLICATIONS:
For PnP cards, only the line for "pcm0" is needed (the code
will allocate entries for more cards if found), but IT MUST
- INCLUDE ALL FIELDS. You can use the following line:
+ INCLUDE ALL FIELDS, including "vector pcmintr". You can use
+ the following line:
- device pcm0 at isa ? port? tty irq 7 drq 1
+ device pcm0 at isa ? port? tty irq 7 drq 1 vector pcmintr
NOTE that:
- the parameters for the PnP device(s) will be read from the
@@ -199,7 +200,7 @@ Common mistakes:
expect. The mixer code still does not try to exploit the features of
each card, and it just provides basic functionalities.
---- ACKNOWLEDGMENTS ---
+--- ACKNWOLEDGEMENTS ---
Several people helped, directly or indirectly, in the development of
this driver. In particular I would like to thank:
@@ -213,12 +214,12 @@ this driver. In particular I would like to thank:
* Eric J. Schwertfeger for donating an ES1868 card for writing the
driver (which i haven't done yet...).
* and many people who had the patience to try the driver
- on their cards and report success/failure and useful
+ on their cards and report success/fauilure and useful
information.
It was certainly helpful to have the data sheets for some of the
devices I support available on the net, especially in the (unfortunately
-rare) cases where the data sheets matched the actual behavior of
+rare) cases where the data sheets matched the actual behaviour of
the product. Too bad that no one of the chip/card manufacturers I
have contacted by email regarding missing or inconsistent documentation
on their products did even care to reply to my messages.
diff --git a/sys/i386/isa/snd/ad1848.c b/sys/i386/isa/snd/ad1848.c
index 0284995397a4..16599d6ae136 100644
--- a/sys/i386/isa/snd/ad1848.c
+++ b/sys/i386/isa/snd/ad1848.c
@@ -56,7 +56,7 @@
static int mss_probe(struct isa_device *dev);
static int mss_attach(struct isa_device *dev);
-d_open_t mss_open; /* this is a generic full-duplex open routine */
+static d_open_t mss_open;
static d_close_t mss_close;
static d_ioctl_t mss_ioctl;
static irq_proc_t mss_intr;
@@ -79,27 +79,6 @@ static void ad_write(snddev_info *d, int reg, u_char data);
static void ad_write_cnt(snddev_info *d, int reg, u_short data);
static int ad_read(snddev_info *d, int reg);
-#if NPNP > 0 /* the ad1816 is pnp only */
-/* ad1816 prototypes */
-
-/* IO primitives */
-static int ad1816_wait_init(snddev_info * d, int x);
-static u_short ad1816_read(snddev_info * d, u_int reg);
-static void ad1816_write(snddev_info * d, u_int reg, u_short data);
-/* intr and callback functions */
-static irq_proc_t ad1816_intr;
-static snd_callback_t ad1816_callback;
-/* device specific ioctl calls */
-static d_ioctl_t ad1816_ioctl;
-/* parameter set functions */
-static void ad1816_reinit(snddev_info * d);
-static int ad1816_mixer_set(snddev_info * d, int dev, int value);
-static int ad1816_set_recsrc(snddev_info * d, int mask);
-static void ad1816_mixer_reset(snddev_info * d);
-
-/* ad1816 prototypes end */
-#endif
-
/*
* device descriptors for the boards supported by this module.
*/
@@ -204,33 +183,6 @@ mss_probe_end:
return mss_detect(dev) ? 8 : 0 ; /* mss uses 8 regs */
}
-#if NPNP > 0
-static int
-ad1816_attach(struct isa_device *dev)
-{
- snddev_info *d = &(pcm_info[dev->id_unit]);
-
- dev->id_alive = 16; /* number of io ports */
-
- if (FULL_DUPLEX(d))
- d->audio_fmt |= AFMT_FULLDUPLEX;
-
- ad1816_write(d, 1, 0x2);/* disable interrupts */
- ad1816_write(d, 32, 0x90F0); /* SoundSystem Mode, split format */
-
- ad1816_write(d, 5, 0x8080); /* FM volume mute */
- ad1816_write(d, 6, 0x8080); /* I2S1 volume mute */
- ad1816_write(d, 7, 0x8080); /* I2S0 volume mute */
- ad1816_write(d, 17, 0x8888); /* VID Volume mute */
- ad1816_write(d, 20, 0x5050); /* Source select Mic & auto gain ctrl
- * off */
- /* adc gain is set to 0 */
- ad1816_reinit(d);
- ad1816_mixer_reset(d);
- return 0 ;
-}
-#endif /* NPNP */
-
/*
* the address passed as io_base for mss_attach is also the old
* MSS base address (e.g. 0x530). The codec is four locations ahead.
@@ -247,10 +199,6 @@ mss_attach(struct isa_device *dev)
d->name, dev->id_unit,
d->io_base, d->irq, d->dbuf_out.chan, d->dbuf_in.chan, dev->id_flags);
-#if NPNP > 0
- if (d->bd_id == MD_AD1816)
- return ad1816_attach(dev);
-#endif
dev->id_alive = 8 ; /* number of io ports */
/* should be already set but just in case... */
@@ -322,7 +270,7 @@ mss_attach(struct isa_device *dev)
return 0;
}
-int
+static int
mss_open(dev_t dev, int flags, int mode, struct proc * p)
{
int unit;
@@ -426,11 +374,7 @@ mss_close(dev_t dev, int flags, int mode, struct proc * p)
d->flags |= SND_F_CLOSING ;
splx(s); /* is this ok here ? */
snd_flush(d);
- /* Clear interrupt status */
- if ( d->bd_id == MD_AD1816 )
- outb(ad1816_int(d), 0);
- else
- outb(io_Status(d), 0);
+ outb(io_Status(d), 0); /* Clear interrupt status */
d->flags = 0 ;
}
return 0 ;
@@ -698,14 +642,12 @@ gus_write(int io_base, u_char reg, u_char value)
outb(io_base + 5, value);
}
-#if 0
static void
gus_writew(int io_base, u_char reg, u_short value)
{
outb(io_base + 3, reg);
outb(io_base + 4, value);
}
-#endif
static u_char
gus_read(int io_base, u_char reg)
@@ -714,14 +656,13 @@ gus_read(int io_base, u_char reg)
return inb(io_base+5);
}
-#if 0
static u_short
gus_readw(int io_base, u_char reg)
{
outb(io_base+3, reg);
return inw(io_base+4);
}
-#endif
+
/*
* AD_WAIT_INIT waits if we are initializing the board and
@@ -888,6 +829,22 @@ mss_set_recsrc(snddev_info *d, int mask)
}
/*
+ * mixer conversion table: from 0..100 scale to codec values
+ *
+ * I don't understand what's this for... maybe achieve a log-scale
+ * volume control ?
+ */
+
+static char mix_cvt[101] = {
+ 0, 1, 3, 7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42,
+ 43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65,
+ 65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79,
+ 80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,
+ 91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99,
+ 100
+};
+
+/*
* there are differences in the mixer depending on the actual sound
* card.
*/
@@ -997,7 +954,7 @@ ad1848_mixer_reset(snddev_info *d)
case MD_YM0020:
/* set master volume to max */
- DDB(printf("set yamaha master volume to max\n"); )
+ DDB(printf("set yamaha master volume to max"); )
outb(0x370, 7) ;
outb(0x371, 0) ;
outb(0x370, 8) ;
@@ -1343,7 +1300,7 @@ mss_detect(struct isa_device *dev)
}
}
BVDDB(printf("mss_detect() - Detected %s\n", name));
- snprintf(d->name, sizeof(d->name), "%s", name);
+ strcpy(d->name, name);
dev->id_flags &= ~DV_F_DEV_MASK ;
dev->id_flags |= (d->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK ;
return 1;
@@ -1426,12 +1383,11 @@ mss_reinit(snddev_info *d)
#if NPNP > 0
static char * cs423x_probe(u_long csn, u_long vend_id);
-static void
-cs423x_attach(u_long csn, u_long vend_id, char *name,
+static void cs423x_attach(u_long csn, u_long vend_id, char *name,
struct isa_device *dev);
static struct pnp_device cs423x = {
- "CS423x/Yamaha/AD1816",
+ "CS423x/Yamaha",
cs423x_probe,
cs423x_attach,
&nsnd, /* use this for all sound cards */
@@ -1446,9 +1402,7 @@ cs423x_probe(u_long csn, u_long vend_id)
u_long id = vend_id & 0xff00ffff;
if ( id == 0x3700630e )
s = "CS4237" ;
- else if ( id == 0x2500630e )
- s = "CS4235" ;
- else if ( id == 0x3600630e )
+ else if ( id == 0x3500630e || id == 0x3600630e )
s = "CS4236" ;
else if ( id == 0x3500630e )
s = "CS4236B" ;
@@ -1458,14 +1412,10 @@ cs423x_probe(u_long csn, u_long vend_id)
s = "Yamaha SA2";
else if ( id == 0x3000a865)
s = "Yamaha SA3";
- else if ( id == 0x0000a865)
+ else if (vend_id == 0x0000a865)
s = "Yamaha YMF719 OPL-SA3";
else if (vend_id == 0x8140d315)
s = "SoundscapeVIVO";
- else if (vend_id == 0x1114b250)
- s = "Terratec Soundsystem BASE 1";
- else if (vend_id == 0x50719304)
- s = "Generic AD1815";
if (s) {
struct pnp_cinfo d;
read_pnp_parms(&d, 0);
@@ -1494,26 +1444,7 @@ cs423x_attach(u_long csn, u_long vend_id, char *name,
return ;
}
snddev_last_probed = &tmp_d;
-
- /* AD1816 */
- if (vend_id == 0x1114b250 || vend_id == 0x50719304) {
- dev->id_alive = 16; /* number of io ports ? */
-
- tmp_d = mss_op_desc; /* copy it */
-
- tmp_d.ioctl = ad1816_ioctl;
- tmp_d.isr = ad1816_intr;
- tmp_d.callback = ad1816_callback;
- tmp_d.audio_fmt = AFMT_STEREO | AFMT_U8 |
- AFMT_A_LAW | AFMT_MU_LAW |
- AFMT_S16_LE | AFMT_S16_BE;
-
- dev->id_iobase = d.port[2];
- tmp_d.alt_base = d.port[0]; /* soundblaster comp. but we don't
- * use that */
- tmp_d.bd_id = MD_AD1816;
- strcpy(tmp_d.name, name);
- } else if (d.flags & DV_PNP_SBCODEC) { /* use sb-compatible codec */
+ if (d.flags & DV_PNP_SBCODEC) { /*** use sb-compatible codec ***/
dev->id_alive = 16 ; /* number of io ports ? */
tmp_d = sb_op_desc ;
if (vend_id==0x2000a865 || vend_id==0x3000a865 ||
@@ -1554,24 +1485,18 @@ cs423x_attach(u_long csn, u_long vend_id, char *name,
tmp_d.bd_id = MD_CS4237 ;
break;
- case 0x2500630e: /* AOpen AW37, CS4235 */
- tmp_d.bd_id = MD_CS4237 ;
- break ;
-
case 0x3500630e: /* CS4236B */
case 0x3600630e: /* CS4236 */
tmp_d.bd_id = MD_CS4236 ;
break;
default:
- tmp_d.bd_id = MD_CS4232; /* to short-circuit the
- * detect routine */
+ tmp_d.bd_id = MD_CS4232 ; /* to short-circuit the detect routine */
break;
}
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
tmp_d.audio_fmt |= AFMT_FULLDUPLEX ;
}
-
write_pnp_parms( &d, ldn );
enable_pnp_card();
@@ -1643,7 +1568,7 @@ opti931_attach(u_long csn, u_long vend_id, char *name,
snddev_last_probed = &tmp_d;
tmp_d = d.flags & DV_PNP_SBCODEC ? sb_op_desc : mss_op_desc ;
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
/*
* My MED3931 v.1.0 allocates 3 bytes for the config space,
@@ -1761,9 +1686,7 @@ opti925_attach(u_long csn, u_long vend_id, char *name,
pcmattach(dev);
}
-#if 0
static void gus_mem_cfg(snddev_info *tmp);
-#endif
static char *guspnp_probe(u_long csn, u_long vend_id);
static void guspnp_attach(u_long csn, u_long vend_id, char *name,
@@ -1851,7 +1774,7 @@ guspnp_attach(u_long csn, u_long vend_id, char *name,
gus_write(tmp_d.conf_base, 0x5b , tmp | 1 );
BVDDB(printf("GUS: silicon rev %c\n", 'A' + ( ( tmp & 0xf ) >> 4) );)
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
pcmattach(dev);
}
@@ -1896,440 +1819,5 @@ gus_mem_cfg(snddev_info *d)
}
#endif /* gus mem cfg... */
-static int
-ad1816_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
-{
- snddev_info *d;
- int unit;
-
- dev = minor(dev);
- unit = dev >> 4;
- d = &pcm_info[unit];
-
- if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) {
- cmd &= 0xff;
- if (cmd == SOUND_MIXER_RECSRC)
- return ad1816_set_recsrc(d, *(int *) arg);
- else
- return ad1816_mixer_set(d, cmd, *(int *) arg);
- }
- switch (cmd) { /* driver specific ioctls other than mixer
- * calls */
- /* ad1816 has special features */
- case AIOGCAP: /* get capabilities */
- {
- snd_capabilities *p = (snd_capabilities *) arg;
- p->rate_min = 4000;
- p->rate_max = 55200;
- p->bufsize = d->bufsize;
- p->formats = d->audio_fmt;
- p->mixers = 1;
- p->inputs = d->mix_devs;
- p->left = p->right = 100;
- return 0;
- }
- default:
- {
- return ENOSYS; /* fallback to default */
- }
- break;
- }
-}
-
-static int
-ad1816_callback(snddev_info * d, int reason)
-{
- int wr, cnt;
-
- wr = reason & SND_CB_WR;
- reason &= SND_CB_REASON_MASK;
-
- switch (reason) {
- case SND_CB_INIT:
- ad1816_reinit(d);
- reset_dbuf(&(d->dbuf_in), SND_CHAN_RD);
- reset_dbuf(&(d->dbuf_out), SND_CHAN_WR);
- return 1;
- break;
-
- case SND_CB_START:
- cnt = wr ? d->dbuf_out.dl : d->dbuf_in.dl;
-
- cnt /= 4;
- cnt--;
-
- /* start only if not already running */
- if (wr && !(inb(ad1816_play(d)) & AD1816_ENABLE)) {
- /* set dma counter */
- ad1816_write(d, 8, cnt); /* playback count */
- /* int enable */
- ad1816_write(d, 1, ad1816_read(d, 1) | 0x8000);
- /* enable playback */
- outb(ad1816_play(d), (inb(ad1816_play(d)) | AD1816_ENABLE));
- /* check if we succeeded */
- if (!(inb(ad1816_play(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to start write (playback) DMA !\n");
- }
- } else if (!wr && !(inb(ad1816_capt(d)) & AD1816_ENABLE)) {
- /* same for capture */
- ad1816_write(d, 10, cnt); /* capture count */
- ad1816_write(d, 1, ad1816_read(d, 1) | 0x4000); /* int */
- outb(ad1816_capt(d), (inb(ad1816_capt(d)) | AD1816_ENABLE)); /* CEN */
- if (!(inb(ad1816_capt(d)) & AD1816_ENABLE)) { /* check */
- printf("ad1816: failed to start read (capture) DMA !\n");
- }
- }
- break;
-
- case SND_CB_STOP:
- case SND_CB_ABORT: /* XXX check this... */
- /* we don't test here if it is running... */
- if (wr) {
- ad1816_write(d, 1, ad1816_read(d, 1) & ~0x8000);
- /* disable int */
- outb(ad1816_play(d), (inb(ad1816_play(d)) & ~AD1816_ENABLE));
- /* disable playback */
- if ((inb(ad1816_play(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to stop write (playback) DMA !\n");
- }
- ad1816_write(d, 8, 0); /* reset base counter */
- ad1816_write(d, 9, 0); /* reset cur counter */
- } else {
- /* same for capture */
- ad1816_write(d, 1, ad1816_read(d, 1) & ~0x4000);
- outb(ad1816_capt(d), (inb(ad1816_capt(d)) & ~AD1816_ENABLE));
- if ((inb(ad1816_capt(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to stop read (capture) DMA !\n");
- }
- ad1816_write(d, 10, 0);
- ad1816_write(d, 11, 0);
- }
- break;
- }
-
- return 0;
-}
-
-static void
-ad1816_intr(int unit)
-{
- snddev_info *d = &pcm_info[unit];
- unsigned char c, served = 0;
-
- /* get interupt status */
- c = inb(ad1816_int(d));
-
- /* check for stray interupts */
- if (c & ~(AD1816_INTRCI | AD1816_INTRPI)) {
- printf("ad1816: Stray interrupt 0x%x.\n", c);
- c = c & (AD1816_INTRCI | AD1816_INTRPI);
- outb(ad1816_int(d), c); /* ack it anyway */
- }
- /* check for capture interupt */
- if (d->dbuf_in.dl && (c & AD1816_INTRCI)) {
- outb(ad1816_int(d), c & ~AD1816_INTRCI); /* ack it */
- if (inb(ad1816_int(d)) & AD1816_INTRCI)
- printf("ad1816: Failed to clear cp int !!!\n");
- dsp_rdintr(d);
- served |= AD1816_INTRCI; /* cp served */
- }
- /* check for playback interupt */
- if (d->dbuf_out.dl && (c & AD1816_INTRPI)) {
- outb(ad1816_int(d), c & ~AD1816_INTRPI); /* ack it */
- if (inb(ad1816_int(d)) & AD1816_INTRPI != 0)
- printf("ad1816: Failed to clear pb int !!!\n");
- dsp_wrintr(d);
- served |= AD1816_INTRPI; /* pb served */
- }
- if (served == 0) {
- /* this probably means this is not a (working) ad1816 chip, */
- /* or an error in dma handling */
- printf("ad1816: raised an interrupt without reason 0x%x.\n", c);
- outb(ad1816_int(d), 0); /* Clear interrupt status anyway */
- }
-}
-
-static int
-ad1816_wait_init(snddev_info * d, int x)
-{
- int n = 0; /* to shut up the compiler... */
-
- for (; x--;)
- if (((n = (inb(ad1816_ale(d)) & AD1816_BUSY))) == 0)
- DELAY(10);
- else
- return n;
- printf("ad1816_wait_init failed 0x%02x.\n", inb(ad1816_ale(d)));
- return n;
-}
-
-static unsigned short
-ad1816_read(snddev_info * d, unsigned int reg)
-{
- int flags;
- u_short x;
-
- /* we don't want to be blocked here */
- flags = spltty();
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_read: chip timeout before read.\n");
- return 0;
- }
- outb(ad1816_ale(d), (u_char) 0);
- outb(ad1816_ale(d), (u_char) (reg & AD1816_ALEMASK));
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_read: chip timeout during read.\n");
- return 0;
- }
- x = (inb(ad1816_high(d)) << 8) | inb(ad1816_low(d));
- splx(flags);
- return x;
-}
-
-static void
-ad1816_write(snddev_info * d, unsigned int reg, unsigned short data)
-{
- int flags;
-
- flags = spltty();
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_write: chip timeout before write.\n");
- return;
- }
- outb(ad1816_ale(d), (u_char) (reg & AD1816_ALEMASK));
- outb(ad1816_low(d), (u_char) (data & 0x000000ff));
- outb(ad1816_high(d), (u_char) ((data & 0x0000ff00) >> 8));
- splx(flags);
-}
-
-#if 0 /* unused right now..., and untested... */
-static void
-ad1816_mute(snddev_info * d)
-{
- ad1816_write(d, 14, ad1816_read(d, 14) | 0x8000 | 0x80);
-}
-
-static void
-ad1816_unmute(snddev_info * d)
-{
- ad1816_write(d, 14, ad1816_read(d, 14) & ~(0x8000 | 0x80));
-}
-#endif
-
-/* only one rec source is possible */
-
-static int
-ad1816_set_recsrc(snddev_info * d, int mask)
-{
- mask &= d->mix_rec_devs;
-
- switch (mask) {
- case SOUND_MASK_LINE:
- case SOUND_MASK_LINE3:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x0000);
- break;
-
- case SOUND_MASK_CD:
- case SOUND_MASK_LINE1:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x2020);
- break;
-
- case SOUND_MASK_MIC:
- default:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x5050);
- }
-
- d->mix_recsrc = mask;
-
- return 0; /* success */
-}
-
-#define AD1816_MUTE 31 /* value for mute */
-
-static int
-ad1816_mixer_set(snddev_info * d, int dev, int value)
-{
- u_char left = (value & 0x000000ff);
- u_char right = (value & 0x0000ff00) >> 8;
- u_short reg = 0;
-
- if (dev > 31)
- return EINVAL;
-
- if (!(d->mix_devs & (1 << dev)))
- return EINVAL;
-
- if (left > 100)
- left = 100;
- if (right > 100)
- right = 100;
-
- d->mix_levels[dev] = left | (right << 8);
-
- /* Scale volumes */
- left = AD1816_MUTE - (AD1816_MUTE * left) / 100;
- right = AD1816_MUTE - (AD1816_MUTE * right) / 100;
-
- reg = (left << 8) | right;
-
- /* do channel selective muting if volume is zero */
- if (left == AD1816_MUTE)
- reg |= 0x8000;
- if (right == AD1816_MUTE)
- reg |= 0x0080;
-
- switch (dev) {
- case SOUND_MIXER_VOLUME: /* Register 14 master volume */
- ad1816_write(d, 14, reg);
- break;
- case SOUND_MIXER_CD: /* Register 15 cd */
- case SOUND_MIXER_LINE1:
- ad1816_write(d, 15, reg);
- break;
- case SOUND_MIXER_SYNTH: /* Register 16 synth */
- ad1816_write(d, 16, reg);
- break;
- case SOUND_MIXER_PCM: /* Register 4 pcm */
- ad1816_write(d, 4, reg);
- break;
- case SOUND_MIXER_LINE:
- case SOUND_MIXER_LINE3: /* Register 18 line in */
- ad1816_write(d, 18, reg);
- break;
- case SOUND_MIXER_MIC: /* Register 19 mic volume */
- ad1816_write(d, 19, reg & ~0xff); /* mic is mono */
- break;
- case SOUND_MIXER_IGAIN:
- /* and now to something completely different ... */
- ad1816_write(d, 20, ((ad1816_read(d, 20) & ~0x0f0f)
- | (((AD1816_MUTE - left) / 2) << 8) /* four bits of adc gain */
- | ((AD1816_MUTE - right) / 2)));
- break;
- default:
- printf("ad1816_mixer_set(): unknown device.\n");
- break;
- }
-
- return 0; /* success */
-}
-
-static void
-ad1816_mixer_reset(snddev_info * d)
-{
- int i;
-
- d->mix_devs = AD1816_MIXER_DEVICES;
- d->mix_rec_devs = AD1816_REC_DEVICES;
-
- for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
- if (d->mix_devs & (1 << i))
- ad1816_mixer_set(d, i, default_mixer_levels[i]);
- ad1816_set_recsrc(d, SOUND_MASK_MIC);
-}
-
-/* Set the playback and capture rates. */
-
-static int
-ad1816_speed(snddev_info * d)
-{
- RANGE(d->play_speed,4000,55200);
- RANGE(d->rec_speed,4000,55200);
-
- ad1816_write(d, 2, d->play_speed);
- ad1816_write(d, 3, d->rec_speed);
-
- return d->play_speed;
-}
-
-/*
- * ad1816_format checks that the format is supported (or defaults to AFMT_U8)
- * and sets the chip to the desired format.
- */
-
-static int
-ad1816_format(snddev_info * d)
-{
- int oldplay =inb(ad1816_play(d)) & ~AD1816_FORMASK;
- int oldrec = inb(ad1816_capt(d)) & ~AD1816_FORMASK;
- int play = (d->play_fmt & d->audio_fmt) ? d->play_fmt : AFMT_U8;
- int rec = (d->rec_fmt & d->audio_fmt) ? d->rec_fmt : AFMT_U8;
-
- /*
- * check that arg is one of the supported formats in d->format; otherwise
- * fallback to AFMT_U8
- */
-
- switch (play) {
- case AFMT_A_LAW:
- outb(ad1816_play(d), oldplay | AD1816_ALAW);
- break;
- case AFMT_MU_LAW:
- outb(ad1816_play(d), oldplay | AD1816_MULAW);
- break;
- case AFMT_S16_LE:
- outb(ad1816_play(d), oldplay | AD1816_S16LE);
- break;
- case AFMT_S16_BE:
- outb(ad1816_play(d), oldplay | AD1816_S16BE);
- break;
- default:
- /* unlikely to happen */
- printf("ad1816: unknown play format. defaulting to U8.\n");
- case AFMT_U8:
- outb(ad1816_play(d), oldplay | AD1816_U8);
- break;
- }
-
- switch (rec) {
- case AFMT_A_LAW:
- outb(ad1816_capt(d), oldrec | AD1816_ALAW);
- break;
- case AFMT_MU_LAW:
- outb(ad1816_capt(d), oldrec | AD1816_MULAW);
- break;
- case AFMT_S16_LE:
- outb(ad1816_capt(d), oldrec | AD1816_S16LE);
- break;
- case AFMT_S16_BE:
- outb(ad1816_capt(d), oldrec | AD1816_S16BE);
- break;
- default:
- printf("ad1816: unknown capture format. defaulting to U8.\n");
- case AFMT_U8:
- outb(ad1816_capt(d), oldrec | AD1816_U8);
- break;
- }
-
- d->play_fmt = play;
- d->rec_fmt = rec;
-
- return (play);
-}
-
-/*
- * ad1816_reinit resets codec registers
- */
-static void
-ad1816_reinit(snddev_info * d)
-{
- ad1816_write(d, 8, 0x0000); /* reset base and current counter */
- ad1816_write(d, 9, 0x0000); /* for playback and capture */
- ad1816_write(d, 10, 0x0000);
- ad1816_write(d, 11, 0x0000);
-
- if (d->flags & SND_F_STEREO) {
- outb((ad1816_play(d)), AD1816_STEREO); /* set playback to stereo */
- outb((ad1816_capt(d)), AD1816_STEREO); /* set capture to stereo */
- } else {
- outb((ad1816_play(d)), 0x00); /* set playback to mono */
- outb((ad1816_capt(d)), 0x00); /* set capture to mono */
- }
-
- ad1816_format(d);
- ad1816_speed(d);
-
- snd_set_blocksize(d); /* update blocksize if user did not force it */
-}
-
#endif /* NPNP > 0 */
#endif /* NPCM > 0 */
diff --git a/sys/i386/isa/snd/dmabuf.c b/sys/i386/isa/snd/dmabuf.c
index 66f94ac55267..c69435c2cd5d 100644
--- a/sys/i386/isa/snd/dmabuf.c
+++ b/sys/i386/isa/snd/dmabuf.c
@@ -4,7 +4,7 @@
* This file implements the new DMA routines for the sound driver.
* AUTO DMA MODE (ISA DMA SIDE).
*
- * Copyright by Luigi Rizzo - 1997-99
+ * Copyright by Luigi Rizzo - 1997
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
*/
#include <i386/isa/snd/sound.h>
-#include <i386/isa/snd/ulaw.h>
+#include <i386/isa/sound/ulaw.h>
#define MIN_CHUNK_SIZE 256 /* for uiomove etc. */
#define DMA_ALIGN_THRESHOLD 4
@@ -108,10 +108,7 @@ dsp_wr_dmadone(snddev_info *d)
{
snd_dbuf *b = & (d->dbuf_out) ;
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
/*
* XXX here it would be more efficient to record if there
* actually is a sleeping process, but this should still work.
@@ -183,7 +180,7 @@ dsp_wrintr(snddev_info *d)
* This happens if the size has changed _and_ the new size
* is smaller, or it matches the blocksize.
*/
- if (l != b->dl && (b->dl == 0 || l<b->dl || l == d->play_blocksize) ) {
+ if (l != b->dl && (l < b->dl || l == d->play_blocksize) ) {
/* for any reason, size has changed. Stop and restart */
DEB(printf("wrintr: bsz change from %d to %d, rp %d rl %d\n",
b->dl, l, b->rp, b->rl));
@@ -194,10 +191,7 @@ dsp_wrintr(snddev_info *d)
* at high speed, it might well be that the count
* changes in the meantime. So we try to update b->rl
*/
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b) ;
+ dsp_wr_dmaupdate(b) ;
l = min(b->rl, d->play_blocksize );
l &= DMA_ALIGN_MASK ; /* realign things */
b->dl = l; /* record previous transfer size */
@@ -258,10 +252,7 @@ dsp_write_body(snddev_info *d, struct uio *buf)
while ( (n = buf->uio_resid) ) {
l = min (n, bsz); /* at most n bytes ... */
s = spltty(); /* no interrupts here ... */
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
l = min( l, b->fl ); /* no more than avail. space */
DEB(printf("dsp_write_body: prepare %d bytes out of %d\n", l,n));
/*
@@ -415,10 +406,7 @@ dsp_rd_dmadone(snddev_info *d)
{
snd_dbuf *b = & (d->dbuf_in) ;
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(b);
+ dsp_rd_dmaupdate(b);
wakeup(b) ; /* wakeup possibly sleeping processes */
if (b->sel.si_pid &&
( !(d->flags & SND_F_HAS_SIZE) || b->rl >= d->rec_blocksize ) )
@@ -542,10 +530,7 @@ dsp_read_body(snddev_info *d, struct uio *buf)
DEB(printf("dsp_read_body: start waiting for %d bytes\n", n));
l = min (n, bsz);
s = spltty(); /* no interrupts here ! */
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(b);
+ dsp_rd_dmaupdate(b);
l = min( l, b->rl ); /* no more than avail. data */
if (l == 0) {
int timeout;
@@ -658,8 +643,7 @@ reset_dbuf(snd_dbuf *b, int chan)
chan = B_WRITE | B_RAW ;
else
chan = B_READ | B_RAW ;
- if (b->chan != 4 && b->chan < 8) /* XXX hack for pci... */
- isa_dmastart( chan , b->buf, b->bufsize, b->chan);
+ isa_dmastart( chan , b->buf, b->bufsize, b->chan);
}
/*
@@ -679,14 +663,10 @@ snd_sync(snddev_info *d, int chan, int threshold)
for (;;) {
s=spltty();
- if (d->special_dma)
- d->callback(d, (chan==1? SND_CB_WR:SND_CB_RD) | SND_CB_DMAUPDATE);
- else {
- if ( chan==1 )
- dsp_wr_dmaupdate(b);
- else
- dsp_rd_dmaupdate(b);
- }
+ if ( chan==1 )
+ dsp_wr_dmaupdate(b);
+ else
+ dsp_rd_dmaupdate(b);
if ( (chan == 1 && b->fl <= threshold) ||
(chan == 2 && b->rl <= threshold) ) {
ret = tsleep((caddr_t)b, PRIBIO|PCATCH, "sndsyn", 1);
@@ -721,15 +701,13 @@ dsp_wrabort(snddev_info *d, int restart)
d->flags &= ~ SND_F_WRITING ;
if (d->callback)
d->callback(d, SND_CB_WR | SND_CB_ABORT);
- if (!d->special_dma)
- isa_dmastop(b->chan) ;
+ isa_dmastop(b->chan) ;
dsp_wr_dmadone(d);
DEB(printf("dsp_wrabort: stopped, %d bytes left\n", b->rl));
}
missing = b->rl;
- if (!d->special_dma)
- isa_dmadone(B_WRITE, b->buf, b->bufsize, b->chan); /*free chan */
+ isa_dmadone(B_WRITE, b->buf, b->bufsize, b->chan); /*free chan */
reset_dbuf(b, restart ? SND_CHAN_WR : SND_CHAN_NONE);
splx(s);
return missing;
@@ -748,13 +726,11 @@ dsp_rdabort(snddev_info *d, int restart)
d->flags &= ~ SND_F_READING ;
if (d->callback)
d->callback(d, SND_CB_RD | SND_CB_ABORT);
- if (!d->special_dma)
- isa_dmastop(b->chan) ;
+ isa_dmastop(b->chan) ;
dsp_rd_dmadone(d);
}
missing = b->rl ;
- if (!d->special_dma)
- isa_dmadone(B_READ, b->buf, b->bufsize, b->chan);
+ isa_dmadone(B_READ, b->buf, b->bufsize, b->chan);
reset_dbuf(b, restart ? SND_CHAN_RD : SND_CHAN_NONE);
splx(s);
return missing;
@@ -782,10 +758,7 @@ snd_flush(snddev_info *d)
* still pending output data.
*/
ret = tsleep( (caddr_t)b, PRIBIO|PCATCH, "dmafl1", hz);
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE);
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
DEB( printf("snd_sync: now rl : fl %d : %d\n", b->rl, b->fl ) );
if (ret == EINTR) {
printf("tsleep returns %d\n", ret);
diff --git a/sys/i386/isa/snd/mss.h b/sys/i386/isa/snd/mss.h
index 20ceaaf9da0c..54efc3cc2195 100644
--- a/sys/i386/isa/snd/mss.h
+++ b/sys/i386/isa/snd/mss.h
@@ -105,55 +105,6 @@ ahead.
#define BD_F_IRQ_OK 0x0002
#define BD_F_TMR_RUN 0x0004
-/* AD1816 register macros */
-
-#define ad1816_ale(d) ((d)->io_base+0) /* indirect reg access */
-#define ad1816_int(d) ((d)->io_base+1) /* interupt status */
-#define ad1816_low(d) ((d)->io_base+2) /* indirect low byte */
-#define ad1816_high(d) ((d)->io_base+3) /* indirect high byte */
-/* unused */
-#define ad1816_pioD(d) ((d)->io_base+4) /* PIO debug */
-#define ad1816_pios(d) ((d)->io_base+5) /* PIO status */
-#define ad1816_piod(d) ((d)->io_base+6) /* PIO data */
-/* end of unused */
-/* values for playback/capture config:
- bits: 0 enable/disable
- 1 pio/dma
- 2 stereo/mono
- 3 companded/linearPCM
- 4-5 format : 00 8bit linear (uncomp)
- 00 8bit mulaw (comp)
- 01 16bit le (uncomp)
- 01 8bit alaw (comp)
- 11 16bit be (uncomp)
-*/
-#define ad1816_play(d) ((d)->io_base+8) /* playback config */
-#define ad1816_capt(d) ((d)->io_base+9) /* capture config */
-
-#define AD1816_BUSY 0x80 /* chip is busy */
-#define AD1816_ALEMASK 0x3F /* mask for indirect adr. */
-/* unusud */
-#define AD1816_INTRSI 0x01 /* sb intr */
-#define AD1816_INTRGI 0x02 /* game intr */
-#define AD1816_INTRRI 0x04 /* ring intr */
-#define AD1816_INTRDI 0x08 /* dsp intr */
-#define AD1816_INTRVI 0x10 /* vol intr */
-#define AD1816_INTRTI 0x20 /* timer intr */
-/* used again */
-#define AD1816_INTRCI 0x40 /* capture intr */
-#define AD1816_INTRPI 0x80 /* playback intr */
-/* PIO stuff is not supplied here */
-/* playback / capture config */
-#define AD1816_ENABLE 0x01 /* enable pl/cp */
-#define AD1816_PIO 0x02 /* use pio */
-#define AD1816_STEREO 0x04
-#define AD1816_COMP 0x08 /* data is companded */
-#define AD1816_U8 0x00 /* 8 bit linear pcm */
-#define AD1816_MULAW 0x08 /* 8 bit mulaw */
-#define AD1816_ALAW 0x18 /* 8 bit alaw */
-#define AD1816_S16LE 0x10 /* 16 bit linear little endian */
-#define AD1816_S16BE 0x30 /* 16 bit linear big endian */
-#define AD1816_FORMASK 0x38 /* format mask */
/*
* sound/ad1848_mixer.h
@@ -274,12 +225,6 @@ MIX_NONE(SOUND_MIXER_LINE3),
SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | \
SOUND_MASK_IGAIN | SOUND_MASK_LINE1 )
-#define AD1816_REC_DEVICES \
- (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
-
-#define AD1816_MIXER_DEVICES \
- (SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH | \
- SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | SOUND_MASK_IGAIN)
static u_short default_mixer_levels[SOUND_MIXER_NRDEVICES] = {
0x5a5a, /* Master Volume */
diff --git a/sys/i386/isa/snd/sb_dsp.c b/sys/i386/isa/snd/sb_dsp.c
index 3c77f1f12bc5..96d0e626b420 100644
--- a/sys/i386/isa/snd/sb_dsp.c
+++ b/sys/i386/isa/snd/sb_dsp.c
@@ -324,10 +324,18 @@ again:
if ( reason & 1 ) { /* possibly a write interrupt */
if ( d->dbuf_out.dl )
dsp_wrintr(d);
+ else {
+ if (PLAIN_SB16(d->bd_flags))
+ printf("WARNING: wrintr but write DMA inactive!\n");
+ }
}
if ( reason & 2 ) {
if ( d->dbuf_in.dl )
dsp_rdintr(d);
+ else {
+ if (PLAIN_SB16(d->bd_flags))
+ printf("WARNING: rdintr but read DMA inactive!\n");
+ }
}
if ( c & 2 )
inb(DSP_DATA_AVL16); /* 16-bit int ack */
@@ -337,7 +345,7 @@ again:
/*
* the sb16 might have multiple sources etc.
*/
- if ((d->bd_flags & BD_F_SB16) && (c & 3))
+ if (d->bd_flags & BD_F_SB16 && (c & 3) )
goto again;
}
@@ -382,6 +390,7 @@ sb_callback(snddev_info *d, int reason)
* the proper initialization for each one.
*/
if (PLAIN_SB16(d->bd_flags)) {
+ u_char c, c1 ;
/* the original SB16 (non-PnP, or PnP, or Vibra16C)
* can do full duplex using one 16-bit channel
@@ -427,63 +436,29 @@ sb_callback(snddev_info *d, int reason)
d->dbuf_in.chan = d->dbuf_out.chan;
d->dbuf_out.chan = c ;
}
- }
- else if (d->bd_flags & BD_F_ESS) {
- u_char c;
-
- DEB(printf("SND_CB_INIT, play_fmt == 0x%x, rec_fmt == 0x%x\n",
- (int) d->play_fmt, (int) d->rec_fmt));
-
- /* autoinit DMA mode */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb8, 0x04);
- else
- ess_write(d->io_base, 0xb8, 0x0e);
-
- c = (ess_read(d->io_base, 0xa8) & ~0x03) | 0x01;
- if ((d->flags & SND_F_STEREO) == 0)
- c++;
- ess_write(d->io_base, 0xa8, c); /* select mono/stereo */
- ess_write(d->io_base, 0xb9, 2); /* demand 4 bytes/transfer */
-
- switch (d->play_fmt ? d->play_fmt : d->rec_fmt) {
- case AFMT_S16_LE:
- if (d->flags & SND_F_STEREO) {
- /* 16 bit stereo */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x00);
- ess_write(d->io_base, 0xb7, 0x71);
- ess_write(d->io_base, 0xb7, 0xbc);
- }
- else {
- /* 16 bit mono */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x00);
- ess_write(d->io_base, 0xb7, 0x71);
- ess_write(d->io_base, 0xb7, 0xf4);
- }
- break;
- case AFMT_U8:
- if (d->flags & SND_F_STEREO) {
- /* 8 bit stereo */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x80);
- ess_write(d->io_base, 0xb7, 0x51);
- ess_write(d->io_base, 0xb7, 0x98);
- }
- else {
- /* 8 bit mono */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x80);
- ess_write(d->io_base, 0xb7, 0x51);
- ess_write(d->io_base, 0xb7, 0xd0);
- }
- break;
- }
- ess_write(d->io_base, 0xb1,
- ess_read(d->io_base, 0xb1) | 0x50);
- ess_write(d->io_base, 0xb2,
- ess_read(d->io_base, 0xb1) | 0x50);
+ } else if (d->bd_flags & BD_F_ESS) {
+ u_char c ;
+ if (d->play_fmt == 0) {
+ /* initialize for record */
+ static u_char cmd[] = {
+ 0x51,0xd0,0x71,0xf4,0x51,0x98,0x71,0xbc
+ };
+ ess_write(d->io_base, 0xb8, 0x0e);
+ c = ( ess_read(d->io_base, 0xa8) & 0xfc ) | 1 ;
+ if (d->flags & SND_F_STEREO)
+ c++ ;
+ ess_write(d->io_base, 0xa8, c);
+ ess_write(d->io_base, 0xb9, 2); /* 4bytes/transfer */
+ /*
+ * set format in b6, b7
+ */
+ } else {
+ /* initialize for play */
+ static u_char cmd[] = {
+ 0x80,0x51,0xd0,0x00,0x71,0xf4,
+ 0x80,0x51,0x98,0x00,0x71,0xbc
+ };
+ }
}
reset_dbuf(& (d->dbuf_in), SND_CHAN_RD );
reset_dbuf(& (d->dbuf_out), SND_CHAN_WR );
@@ -499,6 +474,7 @@ sb_callback(snddev_info *d, int reason)
* the second one takes the next...
* The default is to be ready for play.
*/
+ int swap = 0 ;
DEB(printf("start %s -- now dma %d:%d\n",
rd ? "rd" : "wr",
d->dbuf_out.chan, d->dbuf_in.chan););
@@ -544,18 +520,10 @@ sb_callback(snddev_info *d, int reason)
sb_cmd(d->io_base, c );
sb_cmd3(d->io_base, c1 , l - 1) ;
} else if (d->bd_flags & BD_F_ESS) {
- u_long fmt = rd ? d->rec_fmt : d->play_fmt;
-
- DEB(printf("SND_CB_START: %s (%d)\n", rd ? "rd" : "wr", l));
- if (fmt == AFMT_S16_LE)
- l >>= 1;
- l--;
- if (!rd)
- sb_cmd(d->io_base, DSP_CMD_SPKON);
- ess_write(d->io_base, 0xa4, l);
- ess_write(d->io_base, 0xa5, l >> 8);
- ess_write(d->io_base, 0xb8,
- ess_read(d->io_base, 0xb8) | (rd ? 0x0f : 0x05));
+ /* XXX this code is still incomplete */
+ sb_cmd2(d->io_base, 0xb8, rd ? 4 : 0xe ) ; /* auto dma */
+ sb_cmd2(d->io_base, 0xa8, d->flags & SND_F_STEREO ? 1 : 2) ;
+ sb_cmd2(d->io_base, 0xb9, 2) ; /* demand dma */
} else { /* SBPro -- stereo not supported */
u_char c ;
if (!rd)
@@ -586,7 +554,6 @@ sb_callback(snddev_info *d, int reason)
case SND_CB_STOP :
{
int cmd = DSP_CMD_DMAPAUSE_8 ; /* default: halt 8 bit chan */
- DEB(printf("SND_CB_XXX: reason 0x%x\n", reason));
if ( b->chan > 4
|| (rd && d->rec_fmt == AFMT_S16_LE)
|| (!rd && d->play_fmt == AFMT_S16_LE)
@@ -763,20 +730,14 @@ sb_dsp_init(snddev_info *d, struct isa_device *dev)
/* the ESS488 can be treated as an SBPRO */
printf("ESS488 (rev %d)\n", ess_minor & 0x0f);
break ;
- }
- else if (ess_major == 0x68 && (ess_minor & 0xf0) == 0x80) {
- int rev = ess_minor & 0xf;
-
- if (rev >= 8)
- printf("ESS1868 (rev %d)\n", rev);
- else
- printf("ESS688 (rev %d)\n", rev);
- d->bd_flags |= BD_F_ESS;
- d->audio_fmt |= AFMT_S16_LE;
-
- /* enable extended ESS mode */
- sb_cmd(d->io_base, 0xc6);
- break;
+ } else if (ess_major == 0x68 && (ess_minor & 0xf0) == 0x80) {
+ int rev = ess_minor & 0xf ;
+ if ( rev >= 8 )
+ printf("ESS1868 (rev %d)\n", rev);
+ else
+ printf("ESS688 (rev %d)\n", rev);
+ /* d->audio_fmt |= AFMT_S16_LE; */ /* not yet... */
+ break ; /* XXX */
} else {
printf("Unknown card 0x%x 0x%x -- hope it is SBPRO\n",
ess_major, ess_minor);
@@ -786,8 +747,7 @@ sb_dsp_init(snddev_info *d, struct isa_device *dev)
}
- snprintf(d->name, sizeof(d->name),
- fmt, (d->bd_id >> 8) &0xff, d->bd_id & 0xff);
+ sprintf(d->name, fmt, (d->bd_id >> 8) &0xff, d->bd_id & 0xff);
sb_mix_init(d);
}
@@ -878,9 +838,9 @@ sb_setmixer(int io_base, u_int port, u_int value)
u_long flags;
flags = spltty();
- outb(io_base + SB_MIX_ADDR, (u_char) (port & 0xff)); /* Select register */
+ outb(io_base + 4, (u_char) (port & 0xff)); /* Select register */
DELAY(10);
- outb(io_base + SB_MIX_DATA, (u_char) (value & 0xff));
+ outb(io_base + 5, (u_char) (value & 0xff));
DELAY(10);
splx(flags);
}
@@ -1228,6 +1188,7 @@ ess1868_attach(u_long csn, u_long vend_id, char *name,
{
struct pnp_cinfo d ;
snddev_info tmp_d ; /* patched copy of the basic snddev_info */
+ int the_irq = 0 ;
tmp_d = sb_op_desc;
snddev_last_probed = &tmp_d;
@@ -1256,12 +1217,10 @@ ess1868_attach(u_long csn, u_long vend_id, char *name,
dev->id_drq = d.drq[0] ; /* primary dma */
dev->id_irq = (1 << d.irq[0] ) ;
- dev->id_intr = (inthand2_t *)pcmintr ;
+ dev->id_intr = pcmintr ;
dev->id_flags = 0 /* DV_F_DUAL_DMA | (d.drq[1] ) */;
-#if 0
snddev_last_probed->probe(dev); /* not really necessary but doesn't harm */
-#endif
pcmattach(dev);
}
@@ -1339,7 +1298,7 @@ sb16pnp_attach(u_long csn, u_long vend_id, char *name,
dev->id_drq = d.drq[0] ; /* primary dma */
dev->id_irq = (1 << d.irq[0] ) ;
- dev->id_intr = (inthand2_t *)pcmintr ;
+ dev->id_intr = pcmintr ;
dev->id_flags = DV_F_DUAL_DMA | (d.drq[1] ) ;
pcm_info[dev->id_unit] = tmp_d; /* pcm_info[] will be reinitialized after */
diff --git a/sys/i386/isa/snd/sbcard.h b/sys/i386/isa/snd/sbcard.h
index 481719961a78..92ec96610791 100644
--- a/sys/i386/isa/snd/sbcard.h
+++ b/sys/i386/isa/snd/sbcard.h
@@ -264,15 +264,15 @@ static u_char sb16_recmasks_L[SOUND_MIXER_NRDEVICES];
static u_char sb16_recmasks_R[SOUND_MIXER_NRDEVICES];
#else /* __SB_MIXER_C__ defined */
mixer_tab sbpro_mix = {
- PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 4, 4, 0x22, 0, 4),
+ PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
PMIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 4, 4, 0x26, 0, 4),
- PMIX_ENT(SOUND_MIXER_PCM, 0x04, 4, 4, 0x04, 0, 4),
+ PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
+ PMIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
PMIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 4, 4, 0x2e, 0, 4),
- PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_CD, 0x28, 4, 4, 0x28, 0, 4),
+ PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
+ PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
PMIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
@@ -280,15 +280,15 @@ mixer_tab sbpro_mix = {
#ifdef __SGNXPRO__
mixer_tab sgnxpro_mix = {
- PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 4, 4, 0x22, 0, 4),
- PMIX_ENT(SOUND_MIXER_BASS, 0x46, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_TREBLE, 0x44, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 4, 4, 0x26, 0, 4),
- PMIX_ENT(SOUND_MIXER_PCM, 0x04, 4, 4, 0x04, 0, 4),
- PMIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 4, 4, 0x2e, 0, 4),
- PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_CD, 0x28, 4, 4, 0x28, 0, 4),
+ PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
+ PMIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
+ PMIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
+ PMIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
+ PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
PMIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0),
diff --git a/sys/i386/isa/snd/sound.c b/sys/i386/isa/snd/sound.c
index 6a5a92d99a61..ef724cd5121b 100644
--- a/sys/i386/isa/snd/sound.c
+++ b/sys/i386/isa/snd/sound.c
@@ -229,7 +229,7 @@ synthprobe(struct isa_device * dev)
}
/*
- * this is the ISA part of the generic attach routine
+ * this is the generic attach routine
*/
int
@@ -238,8 +238,8 @@ pcmattach(struct isa_device * dev)
snddev_info *d = NULL ;
struct isa_device *dvp;
int stat = 0;
-
- dev->id_ointr = pcmintr;
+ dev_t isadev;
+ void *cookie;
if ( (dev->id_unit >= NPCM_MAX) || /* too many devs */
(snddev_last_probed == NULL) || /* last probe failed */
@@ -282,68 +282,19 @@ pcmattach(struct isa_device * dev)
isa_dma_acquire(d->dbuf_out.chan);
if (FULL_DUPLEX(d))
isa_dma_acquire(d->dbuf_in.chan);
-
-
- /*
- * should try and find a suitable value for id_id, otherwise
- * the interrupt is not registered and dispatched properly.
- * This is important for PnP devices, where "dev" is built on
- * the fly and many field are not initialized.
- */
- if (dev->id_driver == NULL) {
- dev->id_driver = &pcmdriver ;
- dvp=find_isadev(isa_devtab_tty, &pcmdriver, 0);
- if (dvp)
- dev->id_id = dvp->id_id;
- }
-
- /*
- * call the generic part of the attach
- */
- pcminit(d, dev->id_unit);
- /*
- * and finally, call the device attach routine
- * XXX I should probably use d->attach(dev)
- */
- stat = snddev_last_probed->attach(dev);
-#if 0
- /*
- * XXX hooks for synt support. Try probe and attach...
- */
- if (d->synth_base && opl3_probe(dev) ) {
- opl3_attach(dev);
- }
-#endif
- snddev_last_probed = NULL ;
-
- return stat ;
-}
-
-/*
- * This is the generic init routine
- */
-int
-pcminit(snddev_info *d, int unit)
-{
-#ifdef DEVFS
- void *cookie;
-#endif
- dev_t isadev;
-
- isadev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&isadev, &snd_cdevsw, NULL);
-
/*
* initialize standard parameters for the device. This can be
* overridden by device-specific configurations but better do
* here the generic things.
*/
- d->magic = MAGIC(unit); /* debugging... */
d->play_speed = d->rec_speed = 8000 ;
d->play_blocksize = d->rec_blocksize = 2048 ;
d->play_fmt = d->rec_fmt = AFMT_MU_LAW ;
+ isadev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&isadev, &snd_cdevsw, NULL);
+
#ifdef DEVFS
#ifndef GID_GAMES
#define GID_SND UID_ROOT
@@ -359,40 +310,70 @@ pcminit(snddev_info *d, int unit)
* Make links to first successfully probed unit.
* Attempts by later devices to make these links will fail.
*/
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", unit);
- if (cookie) devfs_makelink(cookie, "dsp");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "dsp");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", unit);
- if (cookie) devfs_makelink(cookie, "dspW");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "dspW");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", unit);
- if (cookie) devfs_makelink(cookie, "audio");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "audio");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_CTL,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", unit);
- if (cookie) devfs_makelink(cookie, "mixer");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "mixer");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", unit);
- if (cookie) devfs_makelink(cookie, "sndstat");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "sndstat");
#if 0 /* these two are still unsupported... */
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_MIDIN,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", unit);
- if (cookie) devfs_makelink(cookie, "midi");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "midi");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_SYNTH,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", unit);
- if (cookie) devfs_makelink(cookie, "sequencer");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SYNTH,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "sequencer");
#endif
#endif /* DEVFS */
+
+ /*
+ * should try and find a suitable value for id_id, otherwise
+ * the interrupt is not registered and dispatched properly.
+ * This is important for PnP devices, where "dev" is built on
+ * the fly and many field are not initialized.
+ */
+ if (dev->id_driver == NULL) {
+ dev->id_driver = &pcmdriver ;
+ dvp=find_isadev(isa_devtab_tty, &pcmdriver, 0);
+ if (dvp)
+ dev->id_id = dvp->id_id;
+ }
+
+ d->magic = MAGIC(dev->id_unit); /* debugging... */
+ /*
+ * and finally, call the device attach routine
+ * XXX I should probably use d->attach(dev)
+ */
+ stat = snddev_last_probed->attach(dev);
+#if 0
+ /*
+ * XXX hooks for synt support. Try probe and attach...
+ */
+ if (d->synth_base && opl3_probe(dev) ) {
+ opl3_attach(dev);
+ }
+#endif
+ snddev_last_probed = NULL ;
+
#if NAPM > 0
- init_sound_apm(unit);
+ init_sound_apm(dev->id_unit);
#endif
- return 0 ;
+ return stat ;
}
int midiattach(struct isa_device * dev) { return 0 ; }
@@ -605,14 +586,6 @@ sndread(dev_t i_dev, struct uio * buf, int flag)
return uiomove(p, l, buf) ;
}
- /*
- * XXX read from the ad1816 with a single DMA channel is unsupported.
- * This is really not the place for machine-dependent functions,
- * a proper device routine will be supplied in the future - luigi
- */
- if ((d->bd_id == MD_AD1816) && (!(FULL_DUPLEX(d))))
- return EIO;
-
if (d->read) /* device-specific read */
return d->read(i_dev, buf, flag);
@@ -810,12 +783,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
* we start with the new ioctl interface.
*/
case AIONWRITE : /* how many bytes can write ? */
- if (d->dbuf_out.dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(&(d->dbuf_out));
- }
+ if (d->dbuf_out.dl)
+ dsp_wr_dmaupdate(&(d->dbuf_out));
*(int *)arg = d->dbuf_out.fl;
break;
@@ -901,7 +870,7 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
break ;
case AIOSYNC:
- printf("AIOSYNC chan 0x%03lx pos %lu unimplemented\n",
+ printf("AIOSYNC chan 0x%03lx pos %d unimplemented\n",
((snd_sync_parm *)arg)->chan,
((snd_sync_parm *)arg)->pos);
break;
@@ -909,12 +878,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
* here follow the standard ioctls (filio.h etc.)
*/
case FIONREAD : /* get # bytes to read */
- if ( d->dbuf_in.dl ) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(&(d->dbuf_in));
- }
+ if ( d->dbuf_in.dl )
+ dsp_rd_dmaupdate(&(d->dbuf_in));
*(int *)arg = d->dbuf_in.rl;
break;
@@ -1071,12 +1036,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
audio_buf_info *a = (audio_buf_info *)arg;
snd_dbuf *b = &(d->dbuf_in);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_rd_dmaupdate( b );
a->bytes = d->dbuf_in.fl ;
a->fragments = 1 ;
a->fragstotal = b->bufsize / d->rec_blocksize ;
@@ -1089,12 +1050,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
audio_buf_info *a = (audio_buf_info *)arg;
snd_dbuf *b = &(d->dbuf_out);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_wr_dmaupdate( b );
a->bytes = d->dbuf_out.fl ;
a->fragments = 1 ;
a->fragstotal = b->bufsize / d->play_blocksize ;
@@ -1106,12 +1063,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
count_info *a = (count_info *)arg;
snd_dbuf *b = &(d->dbuf_in);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_rd_dmaupdate( b );
a->bytes = b->total;
a->blocks = (b->total - b->prev_total +
d->rec_blocksize -1 ) / d->rec_blocksize ;
@@ -1124,12 +1077,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
count_info *a = (count_info *)arg;
snd_dbuf *b = &(d->dbuf_out);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_wr_dmaupdate( b );
a->bytes = b->total;
a->blocks = (b->total - b->prev_total
/* +d->play_blocksize -1*/ ) / d->play_blocksize ;
@@ -1217,12 +1166,8 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
/* XXX fix the test here for half duplex devices */
if (1 /* write is compatible with current mode */) {
flags = spltty();
- if (d->dbuf_out.dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(&(d->dbuf_out));
- }
+ if (d->dbuf_out.dl)
+ dsp_wr_dmaupdate(&(d->dbuf_out));
c = d->dbuf_out.fl ;
if (c < lim) /* no space available */
selrecord(p, & (d->wsel));
@@ -1239,12 +1184,8 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
flags = spltty();
if ( d->dbuf_in.dl == 0 ) /* dma idle, restart it */
dsp_rdintr(d);
- else {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(&(d->dbuf_in));
- }
+ else
+ dsp_rd_dmaupdate(&(d->dbuf_in));
c = d->dbuf_in.rl ;
if (c < lim) /* no data available */
selrecord(p, & (d->rsel));
@@ -1283,7 +1224,7 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
#include <vm/vm_extern.h>
static int
-sndmmap(dev_t dev, vm_offset_t offset, int nprot)
+sndmmap(dev_t dev, int offset, int nprot)
{
snddev_info *d = get_snddev_info(dev, NULL);
@@ -1357,21 +1298,19 @@ init_status(snddev_info *d)
if (status_len != 0) /* only do init once */
return ;
- snprintf(status_buf, sizeof(status_buf),
+ sprintf(status_buf,
"FreeBSD Audio Driver (981002) " __DATE__ " " __TIME__ "\n"
"Installed devices:\n");
for (i = 0; i < NPCM_MAX; i++) {
if (pcm_info[i].open)
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"pcm%d: <%s> at 0x%x irq %d dma %d:%d\n",
i, pcm_info[i].name, pcm_info[i].io_base,
pcm_info[i].irq,
pcm_info[i].dbuf_out.chan, pcm_info[i].dbuf_in.chan);
if (midi_info[i].open)
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"midi%d: <%s> at 0x%x irq %d dma %d:%d\n",
i, midi_info[i].name, midi_info[i].io_base,
midi_info[i].irq,
@@ -1384,8 +1323,7 @@ init_status(snddev_info *d)
case 4 : s = "OPL4"; break;
}
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"sequencer%d: <%s> at 0x%x (not functional)\n",
i, s, pcm_info[i].synth_base);
}
@@ -1505,6 +1443,7 @@ change_bits(mixer_tab *t, u_char *regval, int dev, int chn, int newval)
* full-duplex)
*/
+#if 1
void
translate_bytes (u_char *table, u_char *buff, int n)
{
@@ -1516,5 +1455,22 @@ translate_bytes (u_char *table, u_char *buff, int n)
for (i = 0; i < n; ++i)
buff[i] = table[buff[i]];
}
+#else
+/* inline */
+void
+translate_bytes (const void *table, void *buff, int n)
+{
+ if (n > 0) {
+ __asm__ ( " cld\n"
+ "1: lodsb\n"
+ " xlatb\n"
+ " stosb\n"
+ " loop 1b\n":
+ : "b" (table), "c" (n), "D" (buff), "S" (buff)
+ : "bx", "cx", "di", "si", "ax");
+ }
+}
+
+#endif
#endif /* NPCM > 0 */
diff --git a/sys/i386/isa/snd/sound.h b/sys/i386/isa/snd/sound.h
index c404ce6503d4..eea64c639f4c 100644
--- a/sys/i386/isa/snd/sound.h
+++ b/sys/i386/isa/snd/sound.h
@@ -151,14 +151,6 @@ struct _snddev_info {
#define SND_CB_STOP 0x03 /* stop dma op */
#define SND_CB_ABORT 0x04 /* abort dma op */
#define SND_CB_INIT 0x05 /* init board parameters */
-
- /*
- * callback extensions
- */
-#define SND_CB_DMADONE 0x10
-#define SND_CB_DMAUPDATE 0x11
-#define SND_CB_DMASTOP 0x12
-
/* init can only be called with int enabled and
* no pending DMA activity.
*/
@@ -296,10 +288,6 @@ struct _snddev_info {
int synth_base ; /* base for the synth */
int synth_type ; /* type of synth */
void *device_data ; /* just in case it is needed...*/
- int special_dma ;
- /* when this is set, dsp_wr_dmaupdate etc.
- * are processed using callback extensions.
- */
} ;
/*
@@ -313,7 +301,6 @@ struct _snddev_info {
*/
#define MD_AD1848 0x91
#define MD_AD1845 0x92
-#define MD_AD1816 0x93
#define MD_CS4248 0xA1
#define MD_CS4231 0xA2
#define MD_CS4231A 0xA3
@@ -444,12 +431,9 @@ int pcmprobe(struct isa_device * dev);
int midiprobe(struct isa_device * dev);
int synthprobe(struct isa_device * dev);
int pcmattach(struct isa_device * dev);
-int pcminit(snddev_info *d, int unit);
int midiattach(struct isa_device * dev);
int synthattach(struct isa_device * dev);
-ointhand2_t pcmintr;
-
/*
* DMA buffer calls
*/
diff --git a/sys/i386/isa/snd/ulaw.h b/sys/i386/isa/snd/ulaw.h
deleted file mode 100644
index 4b9916f3063e..000000000000
--- a/sys/i386/isa/snd/ulaw.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * on entry: ulaw, on exit: unsigned 8 bit.
- */
-static unsigned char ulaw_dsp[] = {
- 3, 7, 11, 15, 19, 23, 27, 31,
- 35, 39, 43, 47, 51, 55, 59, 63,
- 66, 68, 70, 72, 74, 76, 78, 80,
- 82, 84, 86, 88, 90, 92, 94, 96,
- 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113,
- 113, 114, 114, 115, 115, 116, 116, 117,
- 117, 118, 118, 119, 119, 120, 120, 121,
- 121, 121, 122, 122, 122, 122, 123, 123,
- 123, 123, 124, 124, 124, 124, 125, 125,
- 125, 125, 125, 125, 126, 126, 126, 126,
- 126, 126, 126, 126, 127, 127, 127, 127,
- 127, 127, 127, 127, 127, 127, 127, 127,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 253, 249, 245, 241, 237, 233, 229, 225,
- 221, 217, 213, 209, 205, 201, 197, 193,
- 190, 188, 186, 184, 182, 180, 178, 176,
- 174, 172, 170, 168, 166, 164, 162, 160,
- 158, 157, 156, 155, 154, 153, 152, 151,
- 150, 149, 148, 147, 146, 145, 144, 143,
- 143, 142, 142, 141, 141, 140, 140, 139,
- 139, 138, 138, 137, 137, 136, 136, 135,
- 135, 135, 134, 134, 134, 134, 133, 133,
- 133, 133, 132, 132, 132, 132, 131, 131,
- 131, 131, 131, 131, 130, 130, 130, 130,
- 130, 130, 130, 130, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 129, 129,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
-};
-
-#ifndef DSP_ULAW_NOT_WANTED
-static unsigned char dsp_ulaw[] = {
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 2, 2, 2, 2, 3, 3, 3,
- 3, 4, 4, 4, 4, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 7, 7,
- 7, 8, 8, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 10, 11, 11, 11,
- 11, 12, 12, 12, 12, 13, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15,
- 15, 16, 16, 17, 17, 18, 18, 19,
- 19, 20, 20, 21, 21, 22, 22, 23,
- 23, 24, 24, 25, 25, 26, 26, 27,
- 27, 28, 28, 29, 29, 30, 30, 31,
- 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 49, 51, 53, 55, 57, 59, 61,
- 63, 66, 70, 74, 78, 84, 92, 104,
- 254, 231, 219, 211, 205, 201, 197, 193,
- 190, 188, 186, 184, 182, 180, 178, 176,
- 175, 174, 173, 172, 171, 170, 169, 168,
- 167, 166, 165, 164, 163, 162, 161, 160,
- 159, 159, 158, 158, 157, 157, 156, 156,
- 155, 155, 154, 154, 153, 153, 152, 152,
- 151, 151, 150, 150, 149, 149, 148, 148,
- 147, 147, 146, 146, 145, 145, 144, 144,
- 143, 143, 143, 143, 142, 142, 142, 142,
- 141, 141, 141, 141, 140, 140, 140, 140,
- 139, 139, 139, 139, 138, 138, 138, 138,
- 137, 137, 137, 137, 136, 136, 136, 136,
- 135, 135, 135, 135, 134, 134, 134, 134,
- 133, 133, 133, 133, 132, 132, 132, 132,
- 131, 131, 131, 131, 130, 130, 130, 130,
- 129, 129, 129, 129, 128, 128, 128, 128,
-};
-#endif /* !DSP_ULAW_NOT_WANTED */
diff --git a/sys/i386/isa/sound/README.FREEBSD b/sys/i386/isa/sound/README.FREEBSD
index 9979d12fa823..3603bfe040e9 100644
--- a/sys/i386/isa/sound/README.FREEBSD
+++ b/sys/i386/isa/sound/README.FREEBSD
@@ -90,7 +90,7 @@ Lugi also has Sujal's PnP driver .
This is my kernel configuration for my SB16 PnP:
controller snd0
-device sb0 at isa? port 0x220 irq 10 conflicts drq 3
+device sb0 at isa? port 0x220 irq 10 conflicts drq 3 vector sbintr
device sbxvi0 at isa? port? irq? drq 5 conflicts
device opl0 at isa? port 0x388 conflicts
device sbmidi0 at isa? port 0x300 irq? conflicts
@@ -123,13 +123,13 @@ To configure your guspnp PRO if you have a motherboard which supports
PnP:
controller snd0
- device gus0 at isa?
+ device gus0 at isa? vector gusintr
NONPNP CONFIGURATION
To configure your guspnp PRO if your motherboard does NOT support
PnP:
-device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3
+device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3 vector gusintr
the gus pnp is fully software configurable and the above configuration
diff --git a/sys/i386/isa/sound/ad1848.c b/sys/i386/isa/sound/ad1848.c
index 243ed78d1f51..fbd505134270 100644
--- a/sys/i386/isa/sound/ad1848.c
+++ b/sys/i386/isa/sound/ad1848.c
@@ -914,6 +914,7 @@ ad1848_start_input(int dev, u_long buf, int count,
static int
ad1848_prepare_for_IO(int dev, int bsize, int bcount)
{
+ int timeout;
u_char fs, old_fs;
u_long flags;
ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
@@ -1439,13 +1440,11 @@ ad1848_init(char *name, int io_base, int irq,
outb(io_Status(devc), 0); /* Clear pending interrupts */
if (name != NULL && name[0] != 0)
- snprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
- sizeof(ad1848_pcm_operations[nr_ad1848_devs].name),
- "%s (%s)", name, devc->chip_name);
+ sprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
+ "%s (%s)", name, devc->chip_name);
else
- snprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
- sizeof(ad1848_pcm_operations[nr_ad1848_devs].name),
- "Generic audio codec (%s)", devc->chip_name);
+ sprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
+ "Generic audio codec (%s)", devc->chip_name);
conf_printf2(ad1848_pcm_operations[nr_ad1848_devs].name,
devc->base, devc->irq, dma_playback, dma_capture);
diff --git a/sys/i386/isa/sound/audio.c b/sys/i386/isa/sound/audio.c
index d92dd49dc164..31f952ea10fa 100644
--- a/sys/i386/isa/sound/audio.c
+++ b/sys/i386/isa/sound/audio.c
@@ -57,6 +57,15 @@ static char *wr_dma_buf[MAX_AUDIO_DEV];
static int audio_format[MAX_AUDIO_DEV];
static int local_conversion[MAX_AUDIO_DEV];
+#if defined(NO_INLINE_ASM) || !defined(__i386__)
+static void
+translate_bytes(const u_char *table, u_char *buff, int n);
+
+#else
+extern __inline void
+translate_bytes(const void *table, void *buff, int n);
+#endif
+
static int
set_format(int dev, int fmt)
{
@@ -139,6 +148,7 @@ audio_release(int dev, struct fileinfo * file)
}
+#if defined(NO_INLINE_ASM) || !defined(__i386__)
static void
translate_bytes(const u_char *table, u_char *buff, int n)
{
@@ -151,6 +161,23 @@ translate_bytes(const u_char *table, u_char *buff, int n)
buff[i] = table[buff[i]];
}
+#else
+extern __inline void
+translate_bytes(const void *table, void *buff, int n)
+{
+ if (n > 0) {
+ __asm__("cld\n"
+ "1:\tlodsb\n\t"
+ "xlatb\n\t"
+ "stosb\n\t"
+ "loop 1b\n\t":
+ :"b"(table), "c"(n), "D"(buff), "S"(buff)
+ :"bx", "cx", "di", "si", "ax");
+ }
+}
+
+#endif
+
int
audio_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count)
{
diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c
index 76494ad8dc68..613e30b862e5 100644
--- a/sys/i386/isa/sound/dmabuf.c
+++ b/sys/i386/isa/sound/dmabuf.c
@@ -331,6 +331,7 @@ static int
dma_sync(int dev)
{
u_long flags;
+ int i = 0;
if (!audio_devs[dev]->go && (!audio_devs[dev]->enable_bits & PCM_ENABLE_OUTPUT))
return 0;
@@ -1154,6 +1155,8 @@ DMAbuf_outputintr(int dev, int event_type)
if (dmap->mapping_flags & DMA_MAP_MAPPED) {
/* mmapped access */
+ int p = dmap->fragment_size * dmap->qhead;
+
dmap->qhead = (dmap->qhead + 1) % dmap->nbufs;
dmap->qlen++; /* Yes increment it (don't decrement) */
dmap->flags &= ~DMA_ACTIVE;
diff --git a/sys/i386/isa/sound/gus_wave.c b/sys/i386/isa/sound/gus_wave.c
index 54d36cb531f0..9b3ab0b48b4f 100644
--- a/sys/i386/isa/sound/gus_wave.c
+++ b/sys/i386/isa/sound/gus_wave.c
@@ -4517,11 +4517,9 @@ gus_wave_init(struct address_info * hw_config)
}
if (gus_pnp_seen) {
- snprintf(gus_info.name, sizeof(gus_info.name),
- "Gravis %s (%dk)", model_num, (int) gus_mem_size / 1024);
+ sprintf(gus_info.name, "Gravis %s (%dk)", model_num, (int) gus_mem_size / 1024);
} else {
- snprintf(gus_info.name, sizeof(gus_info.name),
- "Gravis UltraSound %s (%dk)", model_num, (int) gus_mem_size / 1024);
+ sprintf(gus_info.name, "Gravis UltraSound %s (%dk)", model_num, (int) gus_mem_size / 1024);
}
conf_printf(gus_info.name, hw_config);
diff --git a/sys/i386/isa/sound/mmap_test.c b/sys/i386/isa/sound/mmap_test.c
index c6afae932d47..62de9dfed648 100644
--- a/sys/i386/isa/sound/mmap_test.c
+++ b/sys/i386/isa/sound/mmap_test.c
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: mmap_test.c,v 1.2 1998/01/16 07:20:34 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
diff --git a/sys/i386/isa/sound/mpu401.c b/sys/i386/isa/sound/mpu401.c
index 0bd1412b7b9e..fdfb94d0b36d 100644
--- a/sys/i386/isa/sound/mpu401.c
+++ b/sys/i386/isa/sound/mpu401.c
@@ -1002,8 +1002,7 @@ attach_mpu401(struct address_info * hw_config)
MPU_CAP_CLS | MPU_CAP_2PORT;
revision_char = (devc->revision == 0x7f) ? 'M' : ' ';
- snprintf(mpu_synth_info[num_midis].name,
- sizeof(mpu_synth_info[num_midis].name),
+ sprintf(mpu_synth_info[num_midis].name,
"MQX-%d%c MIDI Interface #%d",
ports,
revision_char,
@@ -1016,8 +1015,7 @@ attach_mpu401(struct address_info * hw_config)
devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK;
- snprintf(mpu_synth_info[num_midis].name,
- sizeof(mpu_synth_info[num_midis].name),
+ sprintf(mpu_synth_info[num_midis].name,
"MPU-401 %d.%d%c Midi interface #%d",
(int) (devc->version & 0xf0) >> 4,
devc->version & 0x0f,
diff --git a/sys/i386/isa/sound/pas2_card.c b/sys/i386/isa/sound/pas2_card.c
index dc78afa5cea7..06ab9f2e38c1 100644
--- a/sys/i386/isa/sound/pas2_card.c
+++ b/sys/i386/isa/sound/pas2_card.c
@@ -325,7 +325,7 @@ attach_pas_card(struct address_info * hw_config)
if ((pas_model = pas_read(CHIP_REV))) {
char temp[100];
- snprintf(temp, sizeof(temp),
+ sprintf(temp,
"%s rev %d", pas_model_names[(int) pas_model],
pas_read(BOARD_REV_ID));
conf_printf(temp, hw_config);
diff --git a/sys/i386/isa/sound/patmgr.c b/sys/i386/isa/sound/patmgr.c
index 752b2e95dedd..60f0ed639d90 100644
--- a/sys/i386/isa/sound/patmgr.c
+++ b/sys/i386/isa/sound/patmgr.c
@@ -181,7 +181,7 @@ pmgr_access(int dev, struct patmgr_info * rec)
if (mbox[dev])
printf(" PATMGR: Server %d mbox full. Why?\n", dev);
else {
- int chn;
+ int flag, chn;
rec->key = PM_K_COMMAND;
mbox[dev] = rec;
@@ -235,7 +235,7 @@ pmgr_inform(int dev, int event, u_long p1, u_long p2, u_long p3, u_long p4)
if (mbox[dev])
printf(" PATMGR: Server %d mbox full. Why?\n", dev);
else {
- int chn;
+ int flag, chn;
mbox[dev] = tmp_mbox;
mbox[dev]->key = PM_K_EVENT;
diff --git a/sys/i386/isa/sound/pcm86.c b/sys/i386/isa/sound/pcm86.c
index 9c16d9a44928..0df86b1d31a9 100644
--- a/sys/i386/isa/sound/pcm86.c
+++ b/sys/i386/isa/sound/pcm86.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcm86.c,v 1.5 1998/12/04 22:54:50 archie Exp $
+ * $Id: pcm86.c,v 1.3 1997/02/22 09:38:14 peter Exp $
*/
/*
@@ -1890,8 +1890,7 @@ pcm86_detect(struct address_info *hw_config)
outb(opna_iobase + 2, 0x30);
/* Ok. Detection finished. */
- snprintf(pcm86_operations.name, sizeof(pcm86_operations.name),
- "%s", board_name[pcm_s.board_type]);
+ sprintf(pcm86_operations.name, board_name[pcm_s.board_type]);
pcm_initialized = NO;
pcm_s.irq = irq;
diff --git a/sys/i386/isa/sound/pss.c b/sys/i386/isa/sound/pss.c
index a6a5b65b1449..17acfb2b4172 100644
--- a/sys/i386/isa/sound/pss.c
+++ b/sys/i386/isa/sound/pss.c
@@ -348,7 +348,7 @@ attach_pss(struct address_info * hw_config)
#endif
pss_initialized = 1;
- snprintf(tmp, sizeof(tmp), "ECHO-PSS Rev. %d", id);
+ sprintf(tmp, "ECHO-PSS Rev. %d", id);
conf_printf(tmp, hw_config);
return;
diff --git a/sys/i386/isa/sound/sb16_dsp.c b/sys/i386/isa/sound/sb16_dsp.c
index e923176ed875..ad9be54032ce 100644
--- a/sys/i386/isa/sound/sb16_dsp.c
+++ b/sys/i386/isa/sound/sb16_dsp.c
@@ -197,6 +197,8 @@ sb16_dsp_ioctl(int dev, u_int cmd, ioctl_arg arg, int local)
static int
sb16_dsp_open(int dev, int mode)
{
+ int retval;
+
DEB(printf("sb16_dsp_open()\n"));
if (!sb16_dsp_ok) {
@@ -448,8 +450,8 @@ sb16_dsp_init(struct address_info * hw_config)
if (sbc_major < 4)
return; /* Not a SB16 */
- snprintf(sb16_dsp_operations.name, sizeof(sb16_dsp_operations.name),
- "SoundBlaster 16 %d.%d", sbc_major, sbc_minor);
+ sprintf(sb16_dsp_operations.name, "SoundBlaster 16 %d.%d",
+ sbc_major, sbc_minor);
conf_printf(sb16_dsp_operations.name, hw_config);
diff --git a/sys/i386/isa/sound/sb_dsp.c b/sys/i386/isa/sound/sb_dsp.c
index 2facd331139f..1cf52c536995 100644
--- a/sys/i386/isa/sound/sb_dsp.c
+++ b/sys/i386/isa/sound/sb_dsp.c
@@ -539,6 +539,8 @@ sb_dsp_halt_xfer(int dev)
static int
sb_dsp_open(int dev, int mode)
{
+ int retval;
+
if (!sb_dsp_ok) {
printf("SB Error: SoundBlaster board not installed\n");
return -(ENXIO);
@@ -1079,8 +1081,7 @@ sb_dsp_init(struct address_info * hw_config)
fmt = "SoundBlaster %d.%d" ;
}
- snprintf(sb_dsp_operations.name, sizeof(sb_dsp_operations.name),
- fmt, sbc_major, sbc_minor);
+ sprintf(sb_dsp_operations.name, fmt, sbc_major, sbc_minor);
conf_printf(sb_dsp_operations.name, hw_config);
#if defined(CONFIG_SB16) && defined(CONFIG_SBPRO)
diff --git a/sys/i386/isa/sound/sequencer.c b/sys/i386/isa/sound/sequencer.c
index 499077483381..3639cf6f15c5 100644
--- a/sys/i386/isa/sound/sequencer.c
+++ b/sys/i386/isa/sound/sequencer.c
@@ -157,7 +157,7 @@ sequencer_read(int dev, struct fileinfo * file, snd_rw_buf * buf, int count)
flags = splhigh();
if (!iqlen) {
- int chn;
+ int flag, chn;
midi_sleeper = &chn;
diff --git a/sys/i386/isa/sound/sound.doc b/sys/i386/isa/sound/sound.doc
index 2340d6079c18..0b43822fa382 100644
--- a/sys/i386/isa/sound/sound.doc
+++ b/sys/i386/isa/sound/sound.doc
@@ -1,4 +1,4 @@
-$Id: sound.doc,v 1.9 1998/10/22 15:37:35 bde Exp $
+$Id$
Instructions on using audio on a FreeBSD 2.1 (or 2.0-current) system.
See also /sys/i386/conf/LINT.
@@ -14,10 +14,10 @@ Uncomment one or more of these device entries, depending on what type of
sound card you have:
# ProAudioSpectrum PCM and Midi - for PAS
-#device pas0 at isa? port 0x388 irq 10 drq 6
+#device pas0 at isa? port 0x388 irq 10 drq 6 vector pasintr
# SoundBlaster DSP driver - for SB, SB Pro, SB16, PAS(emulating SB)
-#device sb0 at isa? port 0x220 irq 7 drq 1
+#device sb0 at isa? port 0x220 irq 7 drq 1 vector sbintr
# SoundBlaster 16 DSP driver - for SB16 - requires sb0 device
#device sbxvi0 at isa? drq 5
@@ -28,13 +28,13 @@ sound card you have:
# Gravis UltraSound - for GUS, GUS16, GUSMAX
# For cards that use 2 DMA Channels:
# drq = Write DMA Channel, flags = Read DMA Channel
-#device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3
+#device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3 vector gusintr
# Gravis UltraSound 16 bit option - for GUS16 - requires gus0
-#device gusxvi0 at isa? port 0x530 irq 7 drq 3
+#device gusxvi0 at isa? port 0x530 irq 7 drq 3 vector adintr
# MS Sound System (AD1848 Based Boards)
-#device mss0 at isa? port 0x530 irq 10 drq 1
+#device mss0 at isa? port 0x530 irq 10 drq 1 vector adintr
# Yamaha OPL-2/OPL-3 FM - for SB, SB Pro, SB16, PAS
#device opl0 at isa? port 0x388
@@ -43,7 +43,7 @@ sound card you have:
#device mpu0 at isa? port 0x330 irq 6 drq 0
# 6850 UART Midi
-#device uart0 at isa? port 0x330 irq 5
+#device uart0 at isa? port 0x330 irq 5 vector "m6850intr"
You may add one or more of the following depending on what you do and don't
want compiled into your kernel. Note: Excluding things with EXCLUDE_...
diff --git a/sys/i386/isa/sound/sound_calls.h b/sys/i386/isa/sound/sound_calls.h
index cb00e30926a3..62d95487e689 100644
--- a/sys/i386/isa/sound/sound_calls.h
+++ b/sys/i386/isa/sound/sound_calls.h
@@ -99,7 +99,6 @@ int sb_dsp_detect (struct address_info *hw_config);
void sb_dsp_init (struct address_info *hw_config);
void sb_dsp_disable_midi(void);
int sb_dsp_command (u_char val);
-ointhand2_t sbintr;
int sb_reset_dsp (void);
/* From sb16_dsp.c */
@@ -141,7 +140,6 @@ int probe_adlib(struct address_info *hw_config);
/* From pas_card.c */
void attach_pas_card(struct address_info *hw_config);
int probe_pas(struct address_info *hw_config);
-ointhand2_t pasintr;
int pas_set_intr(int mask);
int pas_remove_intr(int mask);
u_char pas_read(int ioaddr);
@@ -162,7 +160,7 @@ void pas_midi_interrupt(void);
void attach_gus_card(struct address_info * hw_config);
int probe_gus(struct address_info *hw_config);
int gus_set_midi_irq(int num);
-ointhand2_t gusintr;
+/*void gusintr(int irq); */
void attach_gus_db16(struct address_info * hw_config);
int probe_gus_db16(struct address_info *hw_config);
@@ -188,7 +186,6 @@ void mpuintr(int irq);
/* From uart6850.c */
void attach_uart6850(struct address_info * hw_config);
-ointhand2_t m6850intr;
int probe_uart6850(struct address_info *hw_config);
/* From opl3.c */
@@ -212,7 +209,6 @@ void sound_timer_syncinterval(u_int new_usecs);
/* From ad1848.c */
void ad1848_init (char *name, int io_base, int irq, int dma_playback, int dma_capture, int share_dma, sound_os_info *osp);
-ointhand2_t adintr;
int ad1848_detect (int io_base, int *flags, sound_os_info *osp);
#define AD_F_CS4231 0x0001 /* Returned if a CS4232 (or compatible) detected */
@@ -237,7 +233,6 @@ int probe_sscape (struct address_info *hw_config);
void attach_sscape (struct address_info *hw_config);
int probe_ss_mss(struct address_info *hw_config);
void attach_ss_mss(struct address_info * hw_config);
-ointhand2_t sscapeintr;
int pss_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
int pss_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
diff --git a/sys/i386/isa/sound/sound_timer.c b/sys/i386/isa/sound/sound_timer.c
index cef7596f0962..8450b2d73503 100644
--- a/sys/i386/isa/sound/sound_timer.c
+++ b/sys/i386/isa/sound/sound_timer.c
@@ -335,7 +335,7 @@ sound_timer_init(struct sound_lowlev_timer * t, char *name)
else
n = num_sound_timers++;
- snprintf(sound_timer.info.name, sizeof(sound_timer.info.name), "%s", name);
+ strcpy(sound_timer.info.name, name);
sound_timer_devs[n] = &sound_timer;
}
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index 3b6db0be26e5..52428b404e33 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -34,8 +34,6 @@
#endif /* DEVFS */
#if NSND > 0 /* from "snd.h" */
-#include "uart.h"
-
#include <vm/vm.h>
#include <vm/pmap.h>
#include <sys/mman.h>
@@ -132,8 +130,6 @@ struct isa_driver sscape_mssdriver = {sndprobe, sndattach, "sscape_mss"};
short ipri_to_irq(u_short ipri);
-static ointhand2_t sndintr;
-
u_long
get_time(void)
{
@@ -147,6 +143,7 @@ get_time(void)
static int
sndmmap( dev_t dev, int offset, int nprot )
{
+ int unit;
struct dma_buffparms * dmap;
dev = minor(dev) >> 4;
@@ -399,41 +396,8 @@ sndattach(struct isa_device * dev)
static int midi_initialized = 0;
static int seq_initialized = 0;
struct address_info hw_config;
- char *dname;
void *tmp;
-
- /*
- * Associate interrupt handlers with devices. XXX this may be incomplete.
- */
- dname = dev->id_driver->name;
-#if defined(CONFIG_AD1848)
- if (strcmp(dname, "css") == 0 || strcmp(dname, "gusxvi") == 0 ||
- strcmp(dname, "mss") == 0)
- dev->id_ointr = adintr;
-#endif
-#ifdef CONFIG_GUS
- if (strcmp(dname, "gus") == 0)
- dev->id_ointr = gusintr;
-#endif
-#ifdef CONFIG_PAS
- if (strcmp(dname, "pas") == 0)
- dev->id_ointr = pasintr;
-#endif
-#if NSB > 0 && (defined(CONFIG_MIDI) || defined(CONFIG_AUDIO))
- if (strcmp(dname, "sb") == 0)
- dev->id_ointr = sbintr;
-#endif
- if (strcmp(dname, "sscape_mss") == 0)
- dev->id_ointr = sndintr;
-#if NSSCAPE > 0
- if (strcmp(dname, "sscape") == 0 || strcmp(dname, "trix") == 0)
- dev->id_ointr = sscapeintr;
-#endif
-#if NUART > 0
- if (strcmp(dname, "uart0") == 0)
- dev->id_ointr = m6850intr;
-#endif
-
+
unit = driver_to_voxunit(dev->id_driver);
hw_config.io_base = dev->id_iobase;
hw_config.irq = ipri_to_irq(dev->id_irq);
@@ -499,35 +463,35 @@ sndattach(struct isa_device * dev)
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"sequencer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sequencer");
+ if (tmp) devfs_link(tmp, "sequencer");
} else if (dev->id_driver == &mpudriver ||
dev->id_driver == &sbmididriver ||
dev->id_driver == &uartdriver){
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"midi%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "midi");
+ if (tmp) devfs_link(tmp, "midi");
} else {
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"dsp%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dsp");
+ if (tmp) devfs_link(tmp, "dsp");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"dspW%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dspW");
+ if (tmp) devfs_link(tmp, "dspW");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"audio%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "audio");
+ if (tmp) devfs_link(tmp, "audio");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"mixer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "mixer");
+ if (tmp) devfs_link(tmp, "mixer");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"sndstat%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sndstat");
+ if (tmp) devfs_link(tmp, "sndstat");
}
#endif /* DEVFS */
return TRUE;
@@ -612,7 +576,7 @@ snd_set_irq_handler(int int_lvl, void (*hndlr) (int), sound_os_info * osp)
return 1;
}
-static void
+void
sndintr(int unit)
{
if ( (unit >= MAX_UNIT) || (irq_proc[unit] == NULL) )
diff --git a/sys/i386/isa/sound/sscape.c b/sys/i386/isa/sound/sscape.c
index 28ef04467bcd..bfd5abe8afd1 100644
--- a/sys/i386/isa/sound/sscape.c
+++ b/sys/i386/isa/sound/sscape.c
@@ -292,6 +292,7 @@ void
sscapeintr(int irq)
{
u_char bits, tmp;
+ static int debug = 0;
DEB(printf("sscapeintr(0x%02x)\n", (bits = sscape_read(devc, GA_INTSTAT_REG))));
if ((sscape_sleep_flag.mode & WK_SLEEP)) {
@@ -303,8 +304,6 @@ sscapeintr(int irq)
}
#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI)
if (bits & 0x01) {
- static int debug = 0;
-
mpuintr(irq);
if (debug++ > 10) { /* Temporary debugging hack */
sscape_write(devc, GA_INTENA_REG, 0x00); /* Disable all interr. */
@@ -455,6 +454,7 @@ sscape_download_boot(struct sscape_info * devc, u_char *block, int size, int fla
done = 0;
timeout_val = 100;
while (!done && timeout_val-- > 0) {
+ int resid;
int chn;
sscape_sleeper = &chn;
DO_SLEEP(chn, sscape_sleep_flag, 1);
@@ -733,8 +733,6 @@ sscape_audio_reset(int dev)
sscape_audio_halt(dev);
}
-
-#if !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO)
static struct audio_operations sscape_audio_operations =
{
"Not functional",
@@ -753,13 +751,14 @@ static struct audio_operations sscape_audio_operations =
NULL,
NULL
};
-#endif /* !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO) */
static int sscape_detected = 0;
void
attach_sscape(struct address_info * hw_config)
{
+ int my_dev;
+
#ifndef SSCAPE_REGS
/*
* Config register values for Spea/V7 Media FX and Ensoniq S-2000.
@@ -878,8 +877,6 @@ attach_sscape(struct address_info * hw_config)
#ifdef CONFIG_AUDIO
if (num_audiodevs < MAX_AUDIO_DEV) {
- int my_dev;
-
audio_devs[my_dev = num_audiodevs++] = &sscape_audio_operations;
audio_devs[my_dev]->dmachan1 = hw_config->dma;
audio_devs[my_dev]->buffsize = DSP_BUFFSIZE;
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index e0f33a79f665..50aebba2f18c 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -107,8 +107,6 @@ static struct cdevsw spigot_cdevsw =
spigot_ioctl, nostop, nullreset, nodevtotty,/* Spigot */
seltrue, spigot_mmap, NULL, "spigot", NULL, -1 };
-static ointhand2_t spigintr;
-
static int
spigot_probe(struct isa_device *devp)
{
@@ -135,7 +133,6 @@ spigot_attach(struct isa_device *devp)
int unit;
struct spigot_softc *ss= &spigot_softc[unit = devp->id_unit];
- devp->id_ointr = spigintr;
ss->maddr = kvtop(devp->id_maddr);
ss->irq = devp->id_irq;
#ifdef DEVFS
@@ -249,7 +246,7 @@ struct spigot_info *info;
* Interrupt procedure.
* Just call a user level interrupt routine.
*/
-static void
+void
spigintr(int unit)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit];
@@ -259,7 +256,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit];
}
static int
-spigot_mmap(dev_t dev, vm_offset_t offset, int nprot)
+spigot_mmap(dev_t dev, int offset, int nprot)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0];
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index e6697a17aaa1..f85ae2eb2684 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: stallion.c,v 1.23 1998/10/22 05:58:40 bde Exp $
+ * $Id: stallion.c,v 1.21 1998/08/23 08:26:41 bde Exp $
*/
/*****************************************************************************/
@@ -467,7 +467,6 @@ static int stl_brdinit(stlbrd_t *brdp);
static int stl_initeio(stlbrd_t *brdp);
static int stl_initech(stlbrd_t *brdp);
static int stl_initports(stlbrd_t *brdp, stlpanel_t *panelp);
-static ointhand2_t stlintr;
static __inline void stl_txisr(stlpanel_t *panelp, int ioaddr);
static __inline void stl_rxisr(stlpanel_t *panelp, int ioaddr);
static __inline void stl_mdmisr(stlpanel_t *panelp, int ioaddr);
@@ -491,7 +490,7 @@ static int stl_clrportstats(stlport_t *portp, caddr_t data);
static stlport_t *stl_getport(int brdnr, int panelnr, int portnr);
#if NPCI > 0
-static const char *stlpciprobe(pcici_t tag, pcidi_t type);
+static char *stlpciprobe(pcici_t tag, pcidi_t type);
static void stlpciattach(pcici_t tag, int unit);
static void stlpciintr(void * arg);
#endif
@@ -635,8 +634,6 @@ static int stlattach(struct isa_device *idp)
idp->id_unit, idp->id_iobase);
#endif
- idp->id_ointr = stlintr;
-
brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT);
if (brdp == (stlbrd_t *) NULL) {
printf("STALLION: failed to allocate memory (size=%d)\n",
@@ -673,7 +670,7 @@ static int stlattach(struct isa_device *idp)
* carefull here, since it looks sort like a Nat Semi IDE chip...
*/
-static const char *stlpciprobe(pcici_t tag, pcidi_t type)
+char *stlpciprobe(pcici_t tag, pcidi_t type)
{
unsigned long class;
@@ -1761,7 +1758,7 @@ static __inline void stl_mdmisr(stlpanel_t *panelp, int ioaddr)
* io register.
*/
-static void stlintr(int unit)
+void stlintr(int unit)
{
stlbrd_t *brdp;
stlpanel_t *panelp;
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
new file mode 100644
index 000000000000..eba0d36dc0ab
--- /dev/null
+++ b/sys/i386/isa/syscons.c
@@ -0,0 +1,4688 @@
+/*-
+ * Copyright (c) 1992-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: syscons.c,v 1.283 1998/10/01 11:39:18 yokota Exp $
+ */
+
+#include "sc.h"
+#include "apm.h"
+#include "opt_ddb.h"
+#include "opt_devfs.h"
+#include "opt_vesa.h"
+#include "opt_vm86.h"
+#include "opt_syscons.h"
+
+#if NSC > 0
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/reboot.h>
+#include <sys/conf.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
+#include <sys/tty.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif
+
+#include <machine/bootinfo.h>
+#include <machine/clock.h>
+#include <machine/cons.h>
+#include <machine/console.h>
+#include <machine/mouse.h>
+#include <machine/md_var.h>
+#include <machine/psl.h>
+#include <machine/frame.h>
+#include <machine/pc/display.h>
+#include <machine/pc/vesa.h>
+#include <machine/apm_bios.h>
+#include <machine/random.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa.h>
+#include <i386/isa/isa_device.h>
+#include <i386/isa/timerreg.h>
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
+
+#if !defined(MAXCONS)
+#define MAXCONS 16
+#endif
+
+#if !defined(SC_MAX_HISTORY_SIZE)
+#define SC_MAX_HISTORY_SIZE (1000 * MAXCONS)
+#endif
+
+#if !defined(SC_HISTORY_SIZE)
+#define SC_HISTORY_SIZE (ROW * 4)
+#endif
+
+#if (SC_HISTORY_SIZE * MAXCONS) > SC_MAX_HISTORY_SIZE
+#undef SC_MAX_HISTORY_SIZE
+#define SC_MAX_HISTORY_SIZE (SC_HISTORY_SIZE * MAXCONS)
+#endif
+
+#if !defined(SC_MOUSE_CHAR)
+#define SC_MOUSE_CHAR (0xd0)
+#endif
+
+#define COLD 0
+#define WARM 1
+
+#define DEFAULT_BLANKTIME (5*60) /* 5 minutes */
+#define MAX_BLANKTIME (7*24*60*60) /* 7 days!? */
+
+/* for backward compatibility */
+#define OLD_CONS_MOUSECTL _IOWR('c', 10, old_mouse_info_t)
+
+typedef struct old_mouse_data {
+ int x;
+ int y;
+ int buttons;
+} old_mouse_data_t;
+
+typedef struct old_mouse_info {
+ int operation;
+ union {
+ struct old_mouse_data data;
+ struct mouse_mode mode;
+ } u;
+} old_mouse_info_t;
+
+/* XXX use sc_bcopy where video memory is concerned */
+extern void generic_bcopy(const void *, void *, size_t);
+extern void generic_bzero(void *, size_t);
+
+static default_attr user_default = {
+ (FG_LIGHTGREY | BG_BLACK) << 8,
+ (FG_BLACK | BG_LIGHTGREY) << 8
+};
+
+static default_attr kernel_default = {
+ (FG_WHITE | BG_BLACK) << 8,
+ (FG_BLACK | BG_LIGHTGREY) << 8
+};
+
+static scr_stat main_console;
+static scr_stat *console[MAXCONS];
+#ifdef DEVFS
+static void *sc_devfs_token[MAXCONS];
+static void *sc_mouse_devfs_token;
+static void *sc_console_devfs_token;
+#endif
+ scr_stat *cur_console;
+static scr_stat *new_scp, *old_scp;
+static term_stat kernel_console;
+static default_attr *current_default;
+static int sc_flags;
+static int sc_port = IO_KBD;
+static KBDC sc_kbdc = NULL;
+static char init_done = COLD;
+static u_short sc_buffer[ROW*COL];
+static char shutdown_in_progress = FALSE;
+static char font_loading_in_progress = FALSE;
+static char switch_in_progress = FALSE;
+static char write_in_progress = FALSE;
+static char blink_in_progress = FALSE;
+static int blinkrate = 0;
+ u_int crtc_addr = MONO_BASE;
+ char crtc_type = KD_MONO;
+static char crtc_vga = FALSE;
+static int adp_flags;
+static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0;
+static u_char accents = 0;
+static u_char nlkcnt = 0, clkcnt = 0, slkcnt = 0, alkcnt = 0;
+static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab);
+static int delayed_next_scr = FALSE;
+static long scrn_blank_time = 0; /* screen saver timeout value */
+ int scrn_blanked = 0; /* screen saver active flag */
+static long scrn_time_stamp;
+static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
+static int run_scrn_saver = FALSE; /* should run the saver? */
+static int scrn_idle = FALSE; /* about to run the saver */
+ u_char scr_map[256];
+ u_char scr_rmap[256];
+static int initial_video_mode; /* initial video mode # */
+static int bios_video_mode; /* video mode # set by BIOS */
+ int fonts_loaded = 0
+#ifdef STD8X16FONT
+ | FONT_16
+#endif
+ ;
+
+ u_char font_8[256*8];
+ u_char font_14[256*14];
+#ifdef STD8X16FONT
+extern
+#endif
+ u_char font_16[256*16];
+ u_char palette[256*3];
+static u_char *cut_buffer;
+static int cut_buffer_size;
+static int mouse_level; /* sysmouse protocol level */
+static mousestatus_t mouse_status = { 0, 0, 0, 0, 0, 0 };
+static u_short mouse_and_mask[16] = {
+ 0xc000, 0xe000, 0xf000, 0xf800,
+ 0xfc00, 0xfe00, 0xff00, 0xff80,
+ 0xfe00, 0x1e00, 0x1f00, 0x0f00,
+ 0x0f00, 0x0000, 0x0000, 0x0000
+ };
+static u_short mouse_or_mask[16] = {
+ 0x0000, 0x4000, 0x6000, 0x7000,
+ 0x7800, 0x7c00, 0x7e00, 0x6800,
+ 0x0c00, 0x0c00, 0x0600, 0x0600,
+ 0x0000, 0x0000, 0x0000, 0x0000
+ };
+
+ int sc_history_size = SC_HISTORY_SIZE;
+static int extra_history_size =
+ SC_MAX_HISTORY_SIZE - SC_HISTORY_SIZE * MAXCONS;
+
+static void none_saver(int blank) { }
+static void (*current_saver)(int blank) = none_saver;
+static void (*default_saver)(int blank) = none_saver;
+ d_ioctl_t *sc_user_ioctl;
+
+static int sticky_splash = FALSE;
+
+/* OS specific stuff */
+#ifdef not_yet_done
+#define VIRTUAL_TTY(x) (sccons[x] = ttymalloc(sccons[x]))
+struct CONSOLE_TTY (sccons[MAXCONS] = ttymalloc(sccons[MAXCONS]))
+struct MOUSE_TTY (sccons[MAXCONS+1] = ttymalloc(sccons[MAXCONS+1]))
+struct tty *sccons[MAXCONS+2];
+#else
+#define VIRTUAL_TTY(x) &sccons[x]
+#define CONSOLE_TTY &sccons[MAXCONS]
+#define MOUSE_TTY &sccons[MAXCONS+1]
+static struct tty sccons[MAXCONS+2];
+#endif
+#define SC_MOUSE 128
+#define SC_CONSOLE 255
+u_short *Crtat;
+static const int nsccons = MAXCONS+2;
+
+#define WRAPHIST(scp, pointer, offset)\
+ ((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \
+ + (offset)) % (scp)->history_size))
+#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
+
+/* prototypes */
+static int scattach(struct isa_device *dev);
+static int scparam(struct tty *tp, struct termios *t);
+static int scprobe(struct isa_device *dev);
+static int scvidprobe(int unit, int flags);
+static int sckbdprobe(int unit, int flags);
+static void scstart(struct tty *tp);
+static void scmousestart(struct tty *tp);
+static void scinit(void);
+static void scshutdown(int howto, void *arg);
+static u_int scgetc(u_int flags);
+#define SCGETC_CN 1
+#define SCGETC_NONBLOCK 2
+static void sccnupdate(scr_stat *scp);
+static scr_stat *alloc_scp(void);
+static void init_scp(scr_stat *scp);
+static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
+static int get_scr_num(void);
+static timeout_t scrn_timer;
+static void scrn_update(scr_stat *scp, int show_cursor);
+static void scrn_saver(void (*saver)(int), int blank);
+static void stop_scrn_saver(void (*saver)(int));
+static int wait_scrn_saver_stop(void);
+static int switch_scr(scr_stat *scp, u_int next_scr);
+static void exchange_scr(void);
+static void scan_esc(scr_stat *scp, u_char c);
+static void ansi_put(scr_stat *scp, u_char *buf, int len);
+static void draw_cursor_image(scr_stat *scp);
+static void remove_cursor_image(scr_stat *scp);
+static void move_crsr(scr_stat *scp, int x, int y);
+static u_char *get_fstr(u_int c, u_int *len);
+static void history_to_screen(scr_stat *scp);
+static int history_up_line(scr_stat *scp);
+static int history_down_line(scr_stat *scp);
+static int mask2attr(struct term_stat *term);
+static void set_keyboard(int command, int data);
+static void update_leds(int which);
+static void set_destructive_cursor(scr_stat *scp);
+static void set_mouse_pos(scr_stat *scp);
+static int skip_spc_right(scr_stat *scp, u_short *p);
+static int skip_spc_left(scr_stat *scp, u_short *p);
+static void mouse_cut(scr_stat *scp);
+static void mouse_cut_start(scr_stat *scp);
+static void mouse_cut_end(scr_stat *scp);
+static void mouse_cut_word(scr_stat *scp);
+static void mouse_cut_line(scr_stat *scp);
+static void mouse_cut_extend(scr_stat *scp);
+static void mouse_paste(scr_stat *scp);
+static void draw_mouse_image(scr_stat *scp);
+static void remove_mouse_image(scr_stat *scp);
+static void draw_cutmarking(scr_stat *scp);
+static void remove_cutmarking(scr_stat *scp);
+static void do_bell(scr_stat *scp, int pitch, int duration);
+static timeout_t blink_screen;
+#ifdef SC_SPLASH_SCREEN
+static void scsplash_init(scr_stat *scp);
+static void scsplash_term(scr_stat *scp);
+static void scsplash_saver(int show);
+#define scsplash_stick(stick) (sticky_splash = (stick))
+#else
+#define scsplash_stick(stick)
+#endif
+
+struct isa_driver scdriver = {
+ scprobe, scattach, "sc", 1
+};
+
+static d_open_t scopen;
+static d_close_t scclose;
+static d_read_t scread;
+static d_write_t scwrite;
+static d_ioctl_t scioctl;
+static d_mmap_t scmmap;
+
+#define CDEV_MAJOR 12
+static struct cdevsw sc_cdevsw = {
+ scopen, scclose, scread, scwrite,
+ scioctl, nullstop, noreset, scdevtotty,
+ ttpoll, scmmap, nostrategy, "sc",
+ NULL, -1, nodump, nopsize,
+ D_TTY,
+};
+
+static void
+draw_cursor_image(scr_stat *scp)
+{
+ u_short cursor_image;
+ u_short *ptr;
+ u_short prev_image;
+
+ if (ISPIXELSC(scp)) {
+ sc_bcopy(scp, scp->scr_buf, scp->cursor_pos - scp->scr_buf,
+ scp->cursor_pos - scp->scr_buf, 1);
+ return;
+ }
+
+ ptr = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->cursor_pos - scp->scr_buf);
+
+ /* do we have a destructive cursor ? */
+ if (sc_flags & CHAR_CURSOR) {
+ prev_image = scp->cursor_saveunder;
+ cursor_image = *ptr & 0x00ff;
+ if (cursor_image == DEAD_CHAR)
+ cursor_image = prev_image & 0x00ff;
+ cursor_image |= *(scp->cursor_pos) & 0xff00;
+ scp->cursor_saveunder = cursor_image;
+ /* update the cursor bitmap if the char under the cursor has changed */
+ if (prev_image != cursor_image)
+ set_destructive_cursor(scp);
+ /* modify cursor_image */
+ if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ /*
+ * When the mouse pointer is at the same position as the cursor,
+ * the cursor bitmap needs to be updated even if the char under
+ * the cursor hasn't changed, because the mouse pionter may
+ * have moved by a few dots within the cursor cel.
+ */
+ if ((prev_image == cursor_image)
+ && (cursor_image != *(scp->cursor_pos)))
+ set_destructive_cursor(scp);
+ cursor_image &= 0xff00;
+ cursor_image |= DEAD_CHAR;
+ }
+ } else {
+ cursor_image = (*(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
+ scp->cursor_saveunder = cursor_image;
+ if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ if ((cursor_image & 0x7000) == 0x7000) {
+ cursor_image &= 0x8fff;
+ if(!(cursor_image & 0x0700))
+ cursor_image |= 0x0700;
+ } else {
+ cursor_image |= 0x7000;
+ if ((cursor_image & 0x0700) == 0x0700)
+ cursor_image &= 0xf0ff;
+ }
+ }
+ }
+ *ptr = cursor_image;
+}
+
+static void
+remove_cursor_image(scr_stat *scp)
+{
+ if (ISPIXELSC(scp))
+ sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
+ scp->cursor_oldpos - scp->scr_buf, 0);
+ else
+ *((u_short *)(get_adapter(scp)->va_window)
+ + (scp->cursor_oldpos - scp->scr_buf))
+ = scp->cursor_saveunder;
+}
+
+static void
+move_crsr(scr_stat *scp, int x, int y)
+{
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ if (x >= scp->xsize)
+ x = scp->xsize-1;
+ if (y >= scp->ysize)
+ y = scp->ysize-1;
+ scp->xpos = x;
+ scp->ypos = y;
+ scp->cursor_pos = scp->scr_buf + scp->ypos * scp->xsize + scp->xpos;
+}
+
+static int
+scprobe(struct isa_device *dev)
+{
+ if (!scvidprobe(dev->id_unit, dev->id_flags)) {
+ if (bootverbose)
+ printf("sc%d: no video adapter is found.\n", dev->id_unit);
+ return (0);
+ }
+
+#if defined(VESA) && defined(VM86)
+ if (vesa_load())
+ return FALSE;
+#endif
+
+ (*biosvidsw.diag)(bootverbose);
+
+ sc_port = dev->id_iobase;
+ if (sckbdprobe(dev->id_unit, dev->id_flags))
+ return (IO_KBDSIZE);
+ else
+ return ((dev->id_flags & DETECT_KBD) ? 0 : IO_KBDSIZE);
+}
+
+/* probe video adapters, return TRUE if found */
+static int
+scvidprobe(int unit, int flags)
+{
+ video_adapter_t *adp;
+
+ /* do this test only once */
+ if (init_done != COLD)
+ return (crtc_type != -1);
+
+ if ((*biosvidsw.init)() <= 0)
+ return FALSE;
+ if ((adp = (*biosvidsw.adapter)(V_ADP_PRIMARY)) == NULL)
+ return FALSE;
+
+ crtc_type = adp->va_type;
+ crtc_vga = (crtc_type == KD_VGA);
+ crtc_addr = adp->va_crtc_addr;
+ Crtat = (u_short *)adp->va_window;
+ adp_flags = adp->va_flags;
+ initial_video_mode = adp->va_initial_mode;
+ bios_video_mode = adp->va_initial_bios_mode;
+
+ return TRUE;
+}
+
+/* probe the keyboard, return TRUE if found */
+static int
+sckbdprobe(int unit, int flags)
+{
+ int codeset;
+ int c = -1;
+ int m;
+ int res, id;
+
+ sc_kbdc = kbdc_open(sc_port);
+
+ if (!kbdc_lock(sc_kbdc, TRUE)) {
+ /* driver error? */
+ printf("sc%d: unable to lock the controller.\n", unit);
+ return ((flags & DETECT_KBD) ? FALSE : TRUE);
+ }
+
+ /* flush any noise in the buffer */
+ empty_both_buffers(sc_kbdc, 10);
+
+ /* save the current keyboard controller command byte */
+ m = kbdc_get_device_mask(sc_kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(sc_kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ printf("sc%d: unable to get the current command byte value.\n", unit);
+ goto fail;
+ }
+ if (bootverbose)
+ printf("sc%d: the current keyboard controller command byte %04x\n",
+ unit, c);
+#if 0
+ /* override the keyboard lock switch */
+ c |= KBD_OVERRIDE_KBD_LOCK;
+#endif
+
+ /*
+ * The keyboard may have been screwed up by the boot block.
+ * We may just be able to recover from error by testing the controller
+ * and the keyboard port. The controller command byte needs to be saved
+ * before this recovery operation, as some controllers seem to set
+ * the command byte to particular values.
+ */
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+
+ /* enable the keyboard port, but disable the keyboard intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * there is very little we can do...
+ */
+ printf("sc%d: unable to set the command byte.\n", unit);
+ goto fail;
+ }
+
+ /*
+ * Check if we have an XT keyboard before we attempt to reset it.
+ * The procedure assumes that the keyboard and the controller have
+ * been set up properly by BIOS and have not been messed up
+ * during the boot process.
+ */
+ codeset = -1;
+ if (flags & XT_KEYBD)
+ /* the user says there is a XT keyboard */
+ codeset = 1;
+#ifdef DETECT_XT_KEYBOARD
+ else if ((c & KBD_TRANSLATION) == 0) {
+ /* SET_SCANCODE_SET is not always supported; ignore error */
+ if (send_kbd_command_and_data(sc_kbdc, KBDC_SET_SCANCODE_SET, 0)
+ == KBD_ACK)
+ codeset = read_kbd_data(sc_kbdc);
+ }
+ if (bootverbose)
+ printf("sc%d: keyboard scancode set %d\n", unit, codeset);
+#endif /* DETECT_XT_KEYBOARD */
+
+ if (flags & KBD_NORESET) {
+ write_kbd_command(sc_kbdc, KBDC_ECHO);
+ if (read_kbd_data(sc_kbdc) != KBD_ECHO) {
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: failed to get response from the keyboard.\n",
+ unit);
+ goto fail;
+ }
+ } else {
+ /* reset keyboard hardware */
+ if (!reset_kbd(sc_kbdc)) {
+ /* KEYBOARD ERROR
+ * Keyboard reset may fail either because the keyboard doen't
+ * exist, or because the keyboard doesn't pass the self-test,
+ * or the keyboard controller on the motherboard and the keyboard
+ * somehow fail to shake hands. It is just possible, particularly
+ * in the last case, that the keyoard controller may be left
+ * in a hung state. test_controller() and test_kbd_port() appear
+ * to bring the keyboard controller back (I don't know why and
+ * how, though.)
+ */
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ /* We could disable the keyboard port and interrupt... but,
+ * the keyboard may still exist (see above).
+ */
+ if (bootverbose)
+ printf("sc%d: failed to reset the keyboard.\n", unit);
+ goto fail;
+ }
+ }
+
+ /*
+ * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
+ * such as those on the IBM ThinkPad laptop computers can be used
+ * with the standard console driver.
+ */
+ if (codeset == 1) {
+ if (send_kbd_command_and_data(
+ sc_kbdc, KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
+ /* XT kbd doesn't need scan code translation */
+ c &= ~KBD_TRANSLATION;
+ } else {
+ /* KEYBOARD ERROR
+ * The XT kbd isn't usable unless the proper scan code set
+ * is selected.
+ */
+ printf("sc%d: unable to set the XT keyboard mode.\n", unit);
+ goto fail;
+ }
+ }
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
+ | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled keyboard intr.
+ */
+ printf("sc%d: unable to enable the keyboard port and intr.\n", unit);
+ goto fail;
+ }
+
+ /* Get the ID of the keyboard, if any */
+ empty_kbd_buffer(sc_kbdc, 5);
+ res = send_kbd_command(sc_kbdc, KBDC_SEND_DEV_ID);
+ if (res == KBD_ACK) {
+ /* 10ms delay */
+ DELAY(10000);
+ id = (read_kbd_data(sc_kbdc) << 8) | read_kbd_data(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: keyboard device ID: %04x\n", unit, id);
+ }
+
+ kbdc_set_device_mask(sc_kbdc, m | KBD_KBD_CONTROL_BITS),
+ kbdc_lock(sc_kbdc, FALSE);
+ return TRUE;
+
+fail:
+ if (c != -1)
+ /* try to restore the command byte as before, if possible */
+ set_controller_command_byte(sc_kbdc, 0xff, c);
+ kbdc_set_device_mask(sc_kbdc,
+ (flags & DETECT_KBD) ? m : m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(sc_kbdc, FALSE);
+ return FALSE;
+}
+
+#if NAPM > 0
+static int
+scresume(void *dummy)
+{
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ return 0;
+}
+#endif
+
+static int
+scattach(struct isa_device *dev)
+{
+ scr_stat *scp;
+ video_info_t info;
+ dev_t cdev = makedev(CDEV_MAJOR, 0);
+#ifdef DEVFS
+ int vc;
+#endif
+
+ scinit();
+ sc_flags = dev->id_flags;
+ if (!ISFONTAVAIL(adp_flags))
+ sc_flags &= ~CHAR_CURSOR;
+
+ scp = console[0];
+
+ /* copy temporary buffer to final buffer */
+ scp->scr_buf = NULL;
+ sc_alloc_scr_buffer(scp, FALSE, FALSE);
+ bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
+
+ /* cut buffer is available only when the mouse pointer is used */
+ if (ISMOUSEAVAIL(adp_flags))
+ sc_alloc_cut_buffer(scp, FALSE);
+
+ /* initialize history buffer & pointers */
+ sc_alloc_history_buffer(scp, sc_history_size, 0, FALSE);
+
+#if defined(VESA) && defined(VM86)
+ if ((sc_flags & VESA800X600)
+ && ((*biosvidsw.get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
+#ifdef SC_SPLASH_SCREEN
+ scsplash_term(scp);
+#endif
+ sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
+ sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
+ initial_video_mode = M_VESA_800x600;
+#ifdef SC_SPLASH_SCREEN
+ scsplash_init(scp);
+#endif
+ }
+#endif /* VESA && VM86 */
+
+ /* initialize cursor stuff */
+ if (!ISGRAPHSC(scp))
+ draw_cursor_image(scp);
+
+ /* get screen update going */
+ scrn_timer((void *)TRUE);
+
+ update_leds(scp->status);
+
+ printf("sc%d: ", dev->id_unit);
+ switch(crtc_type) {
+ case KD_VGA:
+ printf("VGA %s", (adp_flags & V_ADP_COLOR) ? "color" : "mono");
+ break;
+ case KD_EGA:
+ printf("EGA %s", (adp_flags & V_ADP_COLOR) ? "color" : "mono");
+ break;
+ case KD_CGA:
+ printf("CGA");
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ default:
+ printf("MDA/Hercules");
+ break;
+ }
+ printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, sc_flags);
+
+#if NAPM > 0
+ scp->r_hook.ah_fun = scresume;
+ scp->r_hook.ah_arg = NULL;
+ scp->r_hook.ah_name = "system keyboard";
+ scp->r_hook.ah_order = APM_MID_ORDER;
+ apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
+#endif
+
+ at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
+
+ cdevsw_add(&cdev, &sc_cdevsw, NULL);
+
+#ifdef DEVFS
+ for (vc = 0; vc < MAXCONS; vc++)
+ sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
+ UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
+ sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
+ UID_ROOT, GID_WHEEL, 0600, "sysmouse");
+ sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
+ UID_ROOT, GID_WHEEL, 0600, "consolectl");
+#endif
+ return 0;
+}
+
+struct tty
+*scdevtotty(dev_t dev)
+{
+ int unit = minor(dev);
+
+ if (init_done == COLD)
+ return(NULL);
+ if (unit == SC_CONSOLE)
+ return CONSOLE_TTY;
+ if (unit == SC_MOUSE)
+ return MOUSE_TTY;
+ if (unit >= MAXCONS || unit < 0)
+ return(NULL);
+ return VIRTUAL_TTY(unit);
+}
+
+int
+scopen(dev_t dev, int flag, int mode, struct proc *p)
+{
+ struct tty *tp = scdevtotty(dev);
+
+ if (!tp)
+ return(ENXIO);
+
+ tp->t_oproc = (minor(dev) == SC_MOUSE) ? scmousestart : scstart;
+ tp->t_param = scparam;
+ tp->t_dev = dev;
+ if (!(tp->t_state & TS_ISOPEN)) {
+ ttychars(tp);
+ /* Use the current setting of the <-- key as default VERASE. */
+ /* If the Delete key is preferable, an stty is necessary */
+ tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
+ tp->t_iflag = TTYDEF_IFLAG;
+ tp->t_oflag = TTYDEF_OFLAG;
+ tp->t_cflag = TTYDEF_CFLAG;
+ tp->t_lflag = TTYDEF_LFLAG;
+ tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
+ scparam(tp, &tp->t_termios);
+ (*linesw[tp->t_line].l_modem)(tp, 1);
+ if (minor(dev) == SC_MOUSE)
+ mouse_level = 0; /* XXX */
+ }
+ else
+ if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
+ return(EBUSY);
+ if (minor(dev) < MAXCONS && !console[minor(dev)]) {
+ console[minor(dev)] = alloc_scp();
+ if (ISGRAPHSC(console[minor(dev)]))
+ sc_set_pixel_mode(console[minor(dev)], NULL, COL, ROW, 16);
+ }
+ if (minor(dev)<MAXCONS && !tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
+ tp->t_winsize.ws_col = console[minor(dev)]->xsize;
+ tp->t_winsize.ws_row = console[minor(dev)]->ysize;
+ }
+ return ((*linesw[tp->t_line].l_open)(dev, tp));
+}
+
+int
+scclose(dev_t dev, int flag, int mode, struct proc *p)
+{
+ struct tty *tp = scdevtotty(dev);
+ struct scr_stat *scp;
+
+ if (!tp)
+ return(ENXIO);
+ if (minor(dev) < MAXCONS) {
+ scp = sc_get_scr_stat(tp->t_dev);
+ if (scp->status & SWITCH_WAIT_ACQ)
+ wakeup((caddr_t)&scp->smode);
+#if not_yet_done
+ if (scp == &main_console) {
+ scp->pid = 0;
+ scp->proc = NULL;
+ scp->smode.mode = VT_AUTO;
+ }
+ else {
+ free(scp->scr_buf, M_DEVBUF);
+ if (scp->history != NULL) {
+ free(scp->history, M_DEVBUF);
+ if (scp->history_size / scp->xsize
+ > imax(sc_history_size, scp->ysize))
+ extra_history_size += scp->history_size / scp->xsize
+ - imax(sc_history_size, scp->ysize);
+ }
+ free(scp, M_DEVBUF);
+ console[minor(dev)] = NULL;
+ }
+#else
+ scp->pid = 0;
+ scp->proc = NULL;
+ scp->smode.mode = VT_AUTO;
+#endif
+ }
+ spltty();
+ (*linesw[tp->t_line].l_close)(tp, flag);
+ ttyclose(tp);
+ spl0();
+ return(0);
+}
+
+int
+scread(dev_t dev, struct uio *uio, int flag)
+{
+ struct tty *tp = scdevtotty(dev);
+
+ if (!tp)
+ return(ENXIO);
+ return((*linesw[tp->t_line].l_read)(tp, uio, flag));
+}
+
+int
+scwrite(dev_t dev, struct uio *uio, int flag)
+{
+ struct tty *tp = scdevtotty(dev);
+
+ if (!tp)
+ return(ENXIO);
+ return((*linesw[tp->t_line].l_write)(tp, uio, flag));
+}
+
+void
+scintr(int unit)
+{
+ static struct tty *cur_tty;
+ int c, len;
+ u_char *cp;
+
+ /*
+ * Loop while there is still input to get from the keyboard.
+ * I don't think this is nessesary, and it doesn't fix
+ * the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
+ */
+ while ((c = scgetc(SCGETC_NONBLOCK)) != NOKEY) {
+
+ cur_tty = VIRTUAL_TTY(get_scr_num());
+ if (!(cur_tty->t_state & TS_ISOPEN))
+ if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
+ continue;
+
+ switch (c & 0xff00) {
+ case 0x0000: /* normal key */
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
+ break;
+ case FKEY: /* function key, return string */
+ if (cp = get_fstr((u_int)c, (u_int *)&len)) {
+ while (len-- > 0)
+ (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty);
+ }
+ break;
+ case MKEY: /* meta is active, prepend ESC */
+ (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
+ break;
+ case BKEY: /* backtab fixed sequence (esc [ Z) */
+ (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)('[', cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty);
+ break;
+ }
+ }
+
+#if 0
+ if (cur_console->status & MOUSE_ENABLED) {
+ cur_console->status &= ~MOUSE_VISIBLE;
+ remove_mouse_image(cur_console);
+ }
+#else
+ if (cur_console->status & MOUSE_VISIBLE) {
+ remove_mouse_image(cur_console);
+ cur_console->status &= ~MOUSE_VISIBLE;
+ }
+#endif
+}
+
+static int
+scparam(struct tty *tp, struct termios *t)
+{
+ tp->t_ispeed = t->c_ispeed;
+ tp->t_ospeed = t->c_ospeed;
+ tp->t_cflag = t->c_cflag;
+ return 0;
+}
+
+int
+scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
+{
+ u_int delta_ehs;
+ int error;
+ int i;
+ struct tty *tp;
+ scr_stat *scp;
+ video_adapter_t *adp;
+ int s;
+
+ tp = scdevtotty(dev);
+ if (!tp)
+ return ENXIO;
+ scp = sc_get_scr_stat(tp->t_dev);
+
+ /* If there is a user_ioctl function call that first */
+ if (sc_user_ioctl) {
+ error = (*sc_user_ioctl)(dev, cmd, data, flag, p);
+ if (error != ENOIOCTL)
+ return error;
+ }
+
+ error = sc_vid_ioctl(tp, cmd, data, flag, p);
+ if (error != ENOIOCTL)
+ return error;
+
+ switch (cmd) { /* process console hardware related ioctl's */
+
+ case GIO_ATTR: /* get current attributes */
+ *(int*)data = (scp->term.cur_attr >> 8) & 0xFF;
+ return 0;
+
+ case GIO_COLOR: /* is this a color console ? */
+ *(int *)data = (adp_flags & V_ADP_COLOR) ? 1 : 0;
+ return 0;
+
+ case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
+ if (*(int *)data < 0 || *(int *)data > MAX_BLANKTIME)
+ return EINVAL;
+ s = spltty();
+ scrn_blank_time = *(int *)data;
+ run_scrn_saver = (scrn_blank_time != 0);
+ splx(s);
+ return 0;
+
+ case CONS_CURSORTYPE: /* set cursor type blink/noblink */
+ if ((*(int*)data) & 0x01)
+ sc_flags |= BLINK_CURSOR;
+ else
+ sc_flags &= ~BLINK_CURSOR;
+ if ((*(int*)data) & 0x02) {
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ sc_flags |= CHAR_CURSOR;
+ } else
+ sc_flags &= ~CHAR_CURSOR;
+ /*
+ * The cursor shape is global property; all virtual consoles
+ * are affected. Update the cursor in the current console...
+ */
+ if (!ISGRAPHSC(cur_console)) {
+ remove_cursor_image(cur_console);
+ if (sc_flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ draw_cursor_image(cur_console);
+ }
+ return 0;
+
+ case CONS_BELLTYPE: /* set bell type sound/visual */
+ if ((*(int *)data) & 0x01)
+ sc_flags |= VISUAL_BELL;
+ else
+ sc_flags &= ~VISUAL_BELL;
+ if ((*(int *)data) & 0x02)
+ sc_flags |= QUIET_BELL;
+ else
+ sc_flags &= ~QUIET_BELL;
+ return 0;
+
+ case CONS_HISTORY: /* set history size */
+ if (*(int *)data > 0) {
+ int lines; /* buffer size to allocate */
+ int lines0; /* current buffer size */
+
+ lines = imax(*(int *)data, scp->ysize);
+ lines0 = (scp->history != NULL) ?
+ scp->history_size / scp->xsize : scp->ysize;
+ if (lines0 > imax(sc_history_size, scp->ysize))
+ delta_ehs = lines0 - imax(sc_history_size, scp->ysize);
+ else
+ delta_ehs = 0;
+ /*
+ * syscons unconditionally allocates buffers upto SC_HISTORY_SIZE
+ * lines or scp->ysize lines, whichever is larger. A value
+ * greater than that is allowed, subject to extra_history_size.
+ */
+ if (lines > imax(sc_history_size, scp->ysize))
+ if (lines - imax(sc_history_size, scp->ysize) >
+ extra_history_size + delta_ehs)
+ return EINVAL;
+ if (cur_console->status & BUFFER_SAVED)
+ return EBUSY;
+ sc_alloc_history_buffer(scp, lines, delta_ehs, TRUE);
+ return 0;
+ }
+ else
+ return EINVAL;
+
+ case CONS_MOUSECTL: /* control mouse arrow */
+ case OLD_CONS_MOUSECTL:
+ {
+ /* MOUSE_BUTTON?DOWN -> MOUSE_MSC_BUTTON?UP */
+ static int butmap[8] = {
+ MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
+ MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
+ MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
+ MOUSE_MSC_BUTTON3UP,
+ MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP,
+ MOUSE_MSC_BUTTON2UP,
+ MOUSE_MSC_BUTTON1UP,
+ 0,
+ };
+ mouse_info_t *mouse = (mouse_info_t*)data;
+ mouse_info_t buf;
+
+ /* FIXME: */
+ if (!ISMOUSEAVAIL(get_adapter(scp)->va_flags))
+ return ENODEV;
+
+ if (cmd == OLD_CONS_MOUSECTL) {
+ static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
+ old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
+
+ mouse = &buf;
+ mouse->operation = old_mouse->operation;
+ switch (mouse->operation) {
+ case MOUSE_MODE:
+ mouse->u.mode = old_mouse->u.mode;
+ break;
+ case MOUSE_SHOW:
+ case MOUSE_HIDE:
+ break;
+ case MOUSE_MOVEABS:
+ case MOUSE_MOVEREL:
+ case MOUSE_ACTION:
+ mouse->u.data.x = old_mouse->u.data.x;
+ mouse->u.data.y = old_mouse->u.data.y;
+ mouse->u.data.z = 0;
+ mouse->u.data.buttons = swapb[old_mouse->u.data.buttons & 0x7];
+ break;
+ case MOUSE_GETINFO:
+ old_mouse->u.data.x = scp->mouse_xpos;
+ old_mouse->u.data.y = scp->mouse_ypos;
+ old_mouse->u.data.buttons = swapb[scp->mouse_buttons & 0x7];
+ break;
+ default:
+ return EINVAL;
+ }
+ }
+
+ switch (mouse->operation) {
+ case MOUSE_MODE:
+ if (ISSIGVALID(mouse->u.mode.signal)) {
+ scp->mouse_signal = mouse->u.mode.signal;
+ scp->mouse_proc = p;
+ scp->mouse_pid = p->p_pid;
+ }
+ else {
+ scp->mouse_signal = 0;
+ scp->mouse_proc = NULL;
+ scp->mouse_pid = 0;
+ }
+ return 0;
+
+ case MOUSE_SHOW:
+ if (ISTEXTSC(scp) && !(scp->status & MOUSE_ENABLED)) {
+ scp->status |= (MOUSE_ENABLED | MOUSE_VISIBLE);
+ scp->mouse_oldpos = scp->mouse_pos;
+ mark_all(scp);
+ return 0;
+ }
+ else
+ return EINVAL;
+ break;
+
+ case MOUSE_HIDE:
+ if (ISTEXTSC(scp) && (scp->status & MOUSE_ENABLED)) {
+ scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE);
+ mark_all(scp);
+ return 0;
+ }
+ else
+ return EINVAL;
+ break;
+
+ case MOUSE_MOVEABS:
+ scp->mouse_xpos = mouse->u.data.x;
+ scp->mouse_ypos = mouse->u.data.y;
+ set_mouse_pos(scp);
+ break;
+
+ case MOUSE_MOVEREL:
+ scp->mouse_xpos += mouse->u.data.x;
+ scp->mouse_ypos += mouse->u.data.y;
+ set_mouse_pos(scp);
+ break;
+
+ case MOUSE_GETINFO:
+ mouse->u.data.x = scp->mouse_xpos;
+ mouse->u.data.y = scp->mouse_ypos;
+ mouse->u.data.z = 0;
+ mouse->u.data.buttons = scp->mouse_buttons;
+ return 0;
+
+ case MOUSE_ACTION:
+ case MOUSE_MOTION_EVENT:
+ /* this should maybe only be settable from /dev/consolectl SOS */
+ /* send out mouse event on /dev/sysmouse */
+
+ mouse_status.dx += mouse->u.data.x;
+ mouse_status.dy += mouse->u.data.y;
+ mouse_status.dz += mouse->u.data.z;
+ if (mouse->operation == MOUSE_ACTION)
+ mouse_status.button = mouse->u.data.buttons;
+ mouse_status.flags |=
+ ((mouse->u.data.x || mouse->u.data.y || mouse->u.data.z) ?
+ MOUSE_POSCHANGED : 0)
+ | (mouse_status.obutton ^ mouse_status.button);
+ if (mouse_status.flags == 0)
+ return 0;
+
+ if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ cur_console->status |= MOUSE_VISIBLE;
+
+ if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
+ u_char buf[MOUSE_SYS_PACKETSIZE];
+ int j;
+
+ /* the first five bytes are compatible with MouseSystems' */
+ buf[0] = MOUSE_MSC_SYNC
+ | butmap[mouse_status.button & MOUSE_STDBUTTONS];
+ j = imax(imin(mouse->u.data.x, 255), -256);
+ buf[1] = j >> 1;
+ buf[3] = j - buf[1];
+ j = -imax(imin(mouse->u.data.y, 255), -256);
+ buf[2] = j >> 1;
+ buf[4] = j - buf[2];
+ for (j = 0; j < MOUSE_MSC_PACKETSIZE; j++)
+ (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
+ if (mouse_level >= 1) { /* extended part */
+ j = imax(imin(mouse->u.data.z, 127), -128);
+ buf[5] = (j >> 1) & 0x7f;
+ buf[6] = (j - (j >> 1)) & 0x7f;
+ /* buttons 4-10 */
+ buf[7] = (~mouse_status.button >> 3) & 0x7f;
+ for (j = MOUSE_MSC_PACKETSIZE;
+ j < MOUSE_SYS_PACKETSIZE; j++)
+ (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
+ }
+ }
+
+ if (cur_console->mouse_signal) {
+ cur_console->mouse_buttons = mouse->u.data.buttons;
+ /* has controlling process died? */
+ if (cur_console->mouse_proc &&
+ (cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
+ cur_console->mouse_signal = 0;
+ cur_console->mouse_proc = NULL;
+ cur_console->mouse_pid = 0;
+ }
+ else
+ psignal(cur_console->mouse_proc, cur_console->mouse_signal);
+ }
+ else if (mouse->operation == MOUSE_ACTION && cut_buffer != NULL) {
+ /* process button presses */
+ if ((cur_console->mouse_buttons ^ mouse->u.data.buttons) &&
+ ISTEXTSC(cur_console)) {
+ cur_console->mouse_buttons = mouse->u.data.buttons;
+ if (cur_console->mouse_buttons & MOUSE_BUTTON1DOWN)
+ mouse_cut_start(cur_console);
+ else
+ mouse_cut_end(cur_console);
+ if (cur_console->mouse_buttons & MOUSE_BUTTON2DOWN ||
+ cur_console->mouse_buttons & MOUSE_BUTTON3DOWN)
+ mouse_paste(cur_console);
+ }
+ }
+
+ if (mouse->u.data.x != 0 || mouse->u.data.y != 0) {
+ cur_console->mouse_xpos += mouse->u.data.x;
+ cur_console->mouse_ypos += mouse->u.data.y;
+ set_mouse_pos(cur_console);
+ }
+
+ break;
+
+ case MOUSE_BUTTON_EVENT:
+ if ((mouse->u.event.id & MOUSE_BUTTONS) == 0)
+ return EINVAL;
+ if (mouse->u.event.value < 0)
+ return EINVAL;
+
+ if (mouse->u.event.value > 0) {
+ cur_console->mouse_buttons |= mouse->u.event.id;
+ mouse_status.button |= mouse->u.event.id;
+ } else {
+ cur_console->mouse_buttons &= ~mouse->u.event.id;
+ mouse_status.button &= ~mouse->u.event.id;
+ }
+ mouse_status.flags |= mouse_status.obutton ^ mouse_status.button;
+ if (mouse_status.flags == 0)
+ return 0;
+
+ if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ cur_console->status |= MOUSE_VISIBLE;
+
+ if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
+ u_char buf[8];
+ int i;
+
+ buf[0] = MOUSE_MSC_SYNC
+ | butmap[mouse_status.button & MOUSE_STDBUTTONS];
+ buf[7] = (~mouse_status.button >> 3) & 0x7f;
+ buf[1] = buf[2] = buf[3] = buf[4] = buf[5] = buf[6] = 0;
+ for (i = 0;
+ i < ((mouse_level >= 1) ? MOUSE_SYS_PACKETSIZE
+ : MOUSE_MSC_PACKETSIZE); i++)
+ (*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[i],MOUSE_TTY);
+ }
+
+ if (cur_console->mouse_signal) {
+ if (cur_console->mouse_proc &&
+ (cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
+ cur_console->mouse_signal = 0;
+ cur_console->mouse_proc = NULL;
+ cur_console->mouse_pid = 0;
+ }
+ else
+ psignal(cur_console->mouse_proc, cur_console->mouse_signal);
+ break;
+ }
+
+ if (!ISTEXTSC(cur_console) || (cut_buffer == NULL))
+ break;
+
+ switch (mouse->u.event.id) {
+ case MOUSE_BUTTON1DOWN:
+ switch (mouse->u.event.value % 4) {
+ case 0: /* up */
+ mouse_cut_end(cur_console);
+ break;
+ case 1:
+ mouse_cut_start(cur_console);
+ break;
+ case 2:
+ mouse_cut_word(cur_console);
+ break;
+ case 3:
+ mouse_cut_line(cur_console);
+ break;
+ }
+ break;
+ case MOUSE_BUTTON2DOWN:
+ switch (mouse->u.event.value) {
+ case 0: /* up */
+ break;
+ default:
+ mouse_paste(cur_console);
+ break;
+ }
+ break;
+ case MOUSE_BUTTON3DOWN:
+ switch (mouse->u.event.value) {
+ case 0: /* up */
+ if (!(cur_console->mouse_buttons & MOUSE_BUTTON1DOWN))
+ mouse_cut_end(cur_console);
+ break;
+ default:
+ mouse_cut_extend(cur_console);
+ break;
+ }
+ break;
+ }
+ break;
+
+ default:
+ return EINVAL;
+ }
+ /* make screensaver happy */
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ return 0;
+ }
+
+ /* MOUSE_XXX: /dev/sysmouse ioctls */
+ case MOUSE_GETHWINFO: /* get device information */
+ {
+ mousehw_t *hw = (mousehw_t *)data;
+
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ hw->buttons = 10; /* XXX unknown */
+ hw->iftype = MOUSE_IF_SYSMOUSE;
+ hw->type = MOUSE_MOUSE;
+ hw->model = MOUSE_MODEL_GENERIC;
+ hw->hwid = 0;
+ return 0;
+ }
+
+ case MOUSE_GETMODE: /* get protocol/mode */
+ {
+ mousemode_t *mode = (mousemode_t *)data;
+
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ mode->level = mouse_level;
+ switch (mode->level) {
+ case 0:
+ /* at this level, sysmouse emulates MouseSystems protocol */
+ mode->protocol = MOUSE_PROTO_MSC;
+ mode->rate = -1; /* unknown */
+ mode->resolution = -1; /* unknown */
+ mode->accelfactor = 0; /* disabled */
+ mode->packetsize = MOUSE_MSC_PACKETSIZE;
+ mode->syncmask[0] = MOUSE_MSC_SYNCMASK;
+ mode->syncmask[1] = MOUSE_MSC_SYNC;
+ break;
+
+ case 1:
+ /* at this level, sysmouse uses its own protocol */
+ mode->protocol = MOUSE_PROTO_SYSMOUSE;
+ mode->rate = -1;
+ mode->resolution = -1;
+ mode->accelfactor = 0;
+ mode->packetsize = MOUSE_SYS_PACKETSIZE;
+ mode->syncmask[0] = MOUSE_SYS_SYNCMASK;
+ mode->syncmask[1] = MOUSE_SYS_SYNC;
+ break;
+ }
+ return 0;
+ }
+
+ case MOUSE_SETMODE: /* set protocol/mode */
+ {
+ mousemode_t *mode = (mousemode_t *)data;
+
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ if ((mode->level < 0) || (mode->level > 1))
+ return EINVAL;
+ mouse_level = mode->level;
+ return 0;
+ }
+
+ case MOUSE_GETLEVEL: /* get operation level */
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ *(int *)data = mouse_level;
+ return 0;
+
+ case MOUSE_SETLEVEL: /* set operation level */
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ if ((*(int *)data < 0) || (*(int *)data > 1))
+ return EINVAL;
+ mouse_level = *(int *)data;
+ return 0;
+
+ case MOUSE_GETSTATUS: /* get accumulated mouse events */
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ s = spltty();
+ *(mousestatus_t *)data = mouse_status;
+ mouse_status.flags = 0;
+ mouse_status.obutton = mouse_status.button;
+ mouse_status.dx = 0;
+ mouse_status.dy = 0;
+ mouse_status.dz = 0;
+ splx(s);
+ return 0;
+
+#if notyet
+ case MOUSE_GETVARS: /* get internal mouse variables */
+ case MOUSE_SETVARS: /* set internal mouse variables */
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ return ENODEV;
+#endif
+
+ case MOUSE_READSTATE: /* read status from the device */
+ case MOUSE_READDATA: /* read data from the device */
+ if (tp != MOUSE_TTY)
+ return ENOTTY;
+ return ENODEV;
+
+ case CONS_GETINFO: /* get current (virtual) console info */
+ {
+ vid_info_t *ptr = (vid_info_t*)data;
+ if (ptr->size == sizeof(struct vid_info)) {
+ ptr->m_num = get_scr_num();
+ ptr->mv_col = scp->xpos;
+ ptr->mv_row = scp->ypos;
+ ptr->mv_csz = scp->xsize;
+ ptr->mv_rsz = scp->ysize;
+ ptr->mv_norm.fore = (scp->term.std_color & 0x0f00)>>8;
+ ptr->mv_norm.back = (scp->term.std_color & 0xf000)>>12;
+ ptr->mv_rev.fore = (scp->term.rev_color & 0x0f00)>>8;
+ ptr->mv_rev.back = (scp->term.rev_color & 0xf000)>>12;
+ ptr->mv_grfc.fore = 0; /* not supported */
+ ptr->mv_grfc.back = 0; /* not supported */
+ ptr->mv_ovscan = scp->border;
+ ptr->mk_keylock = scp->status & LOCK_KEY_MASK;
+ return 0;
+ }
+ return EINVAL;
+ }
+
+ case CONS_GETVERS: /* get version number */
+ *(int*)data = 0x200; /* version 2.0 */
+ return 0;
+
+ case CONS_IDLE: /* see if the screen has been idle */
+ /*
+ * When the screen is in the GRAPHICS_MODE or UNKNOWN_MODE,
+ * the user process may have been writing something on the
+ * screen and syscons is not aware of it. Declare the screen
+ * is NOT idle if it is in one of these modes. But there is
+ * an exception to it; if a screen saver is running in the
+ * graphics mode in the current screen, we should say that the
+ * screen has been idle.
+ */
+ *(int *)data = scrn_idle
+ && (!ISGRAPHSC(cur_console)
+ || (cur_console->status & SAVER_RUNNING));
+ return 0;
+
+ case CONS_SAVERMODE: /* set saver mode */
+ switch(*(int *)data) {
+ case CONS_USR_SAVER:
+ /* if a LKM screen saver is running, stop it first. */
+ scsplash_stick(FALSE);
+ saver_mode = *(int *)data;
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ scp->status |= SAVER_RUNNING;
+ scsplash_stick(TRUE);
+ splx(s);
+ break;
+ case CONS_LKM_SAVER:
+ s = spltty();
+ if ((saver_mode == CONS_USR_SAVER) && (scp->status & SAVER_RUNNING))
+ scp->status &= ~SAVER_RUNNING;
+ saver_mode = *(int *)data;
+ splx(s);
+ break;
+ default:
+ return EINVAL;
+ }
+ return 0;
+
+ case CONS_SAVERSTART: /* immediately start/stop the screen saver */
+ /*
+ * Note that this ioctl does not guarantee the screen saver
+ * actually starts or stops. It merely attempts to do so...
+ */
+ s = spltty();
+ run_scrn_saver = (*(int *)data != 0);
+ if (run_scrn_saver)
+ scrn_time_stamp -= scrn_blank_time;
+ splx(s);
+ return 0;
+
+ case VT_SETMODE: /* set screen switcher mode */
+ {
+ struct vt_mode *mode;
+
+ mode = (struct vt_mode *)data;
+ if (ISSIGVALID(mode->relsig) && ISSIGVALID(mode->acqsig) &&
+ ISSIGVALID(mode->frsig)) {
+ bcopy(data, &scp->smode, sizeof(struct vt_mode));
+ if (scp->smode.mode == VT_PROCESS) {
+ scp->proc = p;
+ scp->pid = scp->proc->p_pid;
+ }
+ return 0;
+ } else
+ return EINVAL;
+ }
+
+ case VT_GETMODE: /* get screen switcher mode */
+ bcopy(&scp->smode, data, sizeof(struct vt_mode));
+ return 0;
+
+ case VT_RELDISP: /* screen switcher ioctl */
+ switch(*(int *)data) {
+ case VT_FALSE: /* user refuses to release screen, abort */
+ if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
+ old_scp->status &= ~SWITCH_WAIT_REL;
+ switch_in_progress = FALSE;
+ return 0;
+ }
+ return EINVAL;
+
+ case VT_TRUE: /* user has released screen, go on */
+ if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
+ scp->status &= ~SWITCH_WAIT_REL;
+ exchange_scr();
+ if (new_scp->smode.mode == VT_PROCESS) {
+ new_scp->status |= SWITCH_WAIT_ACQ;
+ psignal(new_scp->proc, new_scp->smode.acqsig);
+ }
+ else
+ switch_in_progress = FALSE;
+ return 0;
+ }
+ return EINVAL;
+
+ case VT_ACKACQ: /* acquire acknowledged, switch completed */
+ if (scp == new_scp && (scp->status & SWITCH_WAIT_ACQ)) {
+ scp->status &= ~SWITCH_WAIT_ACQ;
+ switch_in_progress = FALSE;
+ return 0;
+ }
+ return EINVAL;
+
+ default:
+ return EINVAL;
+ }
+ /* NOT REACHED */
+
+ case VT_OPENQRY: /* return free virtual console */
+ for (i = 0; i < MAXCONS; i++) {
+ tp = VIRTUAL_TTY(i);
+ if (!(tp->t_state & TS_ISOPEN)) {
+ *(int *)data = i + 1;
+ return 0;
+ }
+ }
+ return EINVAL;
+
+ case VT_ACTIVATE: /* switch to screen *data */
+ return switch_scr(scp, *(int *)data - 1);
+
+ case VT_WAITACTIVE: /* wait for switch to occur */
+ if (*(int *)data > MAXCONS || *(int *)data < 0)
+ return EINVAL;
+ if (minor(dev) == *(int *)data - 1)
+ return 0;
+ if (*(int *)data == 0) {
+ if (scp == cur_console)
+ return 0;
+ }
+ else
+ scp = console[*(int *)data - 1];
+ while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
+ "waitvt", 0)) == ERESTART) ;
+ return error;
+
+ case VT_GETACTIVE:
+ *(int *)data = get_scr_num()+1;
+ return 0;
+
+ case KDENABIO: /* allow io operations */
+ error = suser(p->p_ucred, &p->p_acflag);
+ if (error != 0)
+ return error;
+ if (securelevel > 0)
+ return EPERM;
+ p->p_md.md_regs->tf_eflags |= PSL_IOPL;
+ return 0;
+
+ case KDDISABIO: /* disallow io operations (default) */
+ p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
+ return 0;
+
+ case KDSKBSTATE: /* set keyboard state (locks) */
+ if (*(int *)data & ~LOCK_KEY_MASK)
+ return EINVAL;
+ scp->status &= ~LOCK_KEY_MASK;
+ scp->status |= *(int *)data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+
+ case KDGKBSTATE: /* get keyboard state (locks) */
+ *(int *)data = scp->status & LOCK_KEY_MASK;
+ return 0;
+
+ case KDSETRAD: /* set keyboard repeat & delay rates */
+ if (*(int *)data & ~0x7f)
+ return EINVAL;
+ if (sc_kbdc != NULL)
+ set_keyboard(KBDC_SET_TYPEMATIC, *(int *)data);
+ return 0;
+
+ case KDSKBMODE: /* set keyboard mode */
+ switch (*(int *)data) {
+ case K_RAW: /* switch to RAW scancode mode */
+ scp->status &= ~KBD_CODE_MODE;
+ scp->status |= KBD_RAW_MODE;
+ return 0;
+
+ case K_CODE: /* switch to CODE mode */
+ scp->status &= ~KBD_RAW_MODE;
+ scp->status |= KBD_CODE_MODE;
+ return 0;
+
+ case K_XLATE: /* switch to XLT ascii mode */
+ if (scp == cur_console && scp->status & KBD_RAW_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE);
+ return 0;
+ default:
+ return EINVAL;
+ }
+ /* NOT REACHED */
+
+ case KDGKBMODE: /* get keyboard mode */
+ *(int *)data = (scp->status & KBD_RAW_MODE) ? K_RAW :
+ ((scp->status & KBD_CODE_MODE) ? K_CODE : K_XLATE);
+ return 0;
+
+ case KDMKTONE: /* sound the bell */
+ if (*(int*)data)
+ do_bell(scp, (*(int*)data)&0xffff,
+ (((*(int*)data)>>16)&0xffff)*hz/1000);
+ else
+ do_bell(scp, scp->bell_pitch, scp->bell_duration);
+ return 0;
+
+ case KIOCSOUND: /* make tone (*data) hz */
+ if (scp == cur_console) {
+ if (*(int*)data) {
+ int pitch = timer_freq / *(int*)data;
+
+ /* set command for counter 2, 2 byte write */
+ if (acquire_timer2(TIMER_16BIT|TIMER_SQWAVE))
+ return EBUSY;
+
+ /* set pitch */
+ outb(TIMER_CNTR2, pitch);
+ outb(TIMER_CNTR2, (pitch>>8));
+
+ /* enable counter 2 output to speaker */
+ outb(IO_PPI, inb(IO_PPI) | 3);
+ }
+ else {
+ /* disable counter 2 output to speaker */
+ outb(IO_PPI, inb(IO_PPI) & 0xFC);
+ release_timer2();
+ }
+ }
+ return 0;
+
+ case KDGKBTYPE: /* get keyboard type */
+ *(int *)data = 0; /* type not known (yet) */
+ return 0;
+
+ case KDSETLED: /* set keyboard LED status */
+ if (*(int *)data & ~LED_MASK)
+ return EINVAL;
+ scp->status &= ~LED_MASK;
+ scp->status |= *(int *)data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+
+ case KDGETLED: /* get keyboard LED status */
+ *(int *)data = scp->status & LED_MASK;
+ return 0;
+
+ case GETFKEY: /* get functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(&fkey_tab[ptr->keynum].str, ptr->keydef,
+ fkey_tab[ptr->keynum].len);
+ ptr->flen = fkey_tab[ptr->keynum].len;
+ return 0;
+ }
+ else
+ return EINVAL;
+
+ case SETFKEY: /* set functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str,
+ min(ptr->flen, MAXFK));
+ fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK);
+ return 0;
+ }
+ else
+ return EINVAL;
+
+ case GIO_SCRNMAP: /* get output translation table */
+ bcopy(&scr_map, data, sizeof(scr_map));
+ return 0;
+
+ case PIO_SCRNMAP: /* set output translation table */
+ bcopy(data, &scr_map, sizeof(scr_map));
+ for (i=0; i<sizeof(scr_map); i++)
+ scr_rmap[scr_map[i]] = i;
+ return 0;
+
+ case GIO_KEYMAP: /* get keyboard translation table */
+ bcopy(&key_map, data, sizeof(key_map));
+ return 0;
+
+ case PIO_KEYMAP: /* set keyboard translation table */
+ accents = 0;
+ bzero(&accent_map, sizeof(accent_map));
+ bcopy(data, &key_map, sizeof(key_map));
+ return 0;
+
+ case GIO_DEADKEYMAP: /* get accent key translation table */
+ bcopy(&accent_map, data, sizeof(accent_map));
+ return 0;
+
+ case PIO_DEADKEYMAP: /* set accent key translation table */
+ accents = 0;
+ bcopy(data, &accent_map, sizeof(accent_map));
+ return 0;
+
+ case PIO_FONT8x8: /* set 8x8 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ bcopy(data, font_8, 8*256);
+ fonts_loaded |= FONT_8;
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ * Don't load if the current font size is not 8x8.
+ */
+ if (ISTEXTSC(cur_console) && (cur_console->font_size < 14))
+ copy_font(cur_console, LOAD, 8, font_8);
+ return 0;
+
+ case GIO_FONT8x8: /* get 8x8 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ if (fonts_loaded & FONT_8) {
+ bcopy(font_8, data, 8*256);
+ return 0;
+ }
+ else
+ return ENXIO;
+
+ case PIO_FONT8x14: /* set 8x14 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ bcopy(data, font_14, 14*256);
+ fonts_loaded |= FONT_14;
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ * Don't load if the current font size is not 8x14.
+ */
+ if (ISTEXTSC(cur_console)
+ && (cur_console->font_size >= 14) && (cur_console->font_size < 16))
+ copy_font(cur_console, LOAD, 14, font_14);
+ return 0;
+
+ case GIO_FONT8x14: /* get 8x14 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ if (fonts_loaded & FONT_14) {
+ bcopy(font_14, data, 14*256);
+ return 0;
+ }
+ else
+ return ENXIO;
+
+ case PIO_FONT8x16: /* set 8x16 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ bcopy(data, font_16, 16*256);
+ fonts_loaded |= FONT_16;
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ * Don't load if the current font size is not 8x16.
+ */
+ if (ISTEXTSC(cur_console) && (cur_console->font_size >= 16))
+ copy_font(cur_console, LOAD, 16, font_16);
+ return 0;
+
+ case GIO_FONT8x16: /* get 8x16 dot font */
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
+ return ENXIO;
+ if (fonts_loaded & FONT_16) {
+ bcopy(font_16, data, 16*256);
+ return 0;
+ }
+ else
+ return ENXIO;
+ default:
+ break;
+ }
+
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ if (error != ENOIOCTL)
+ return(error);
+ error = ttioctl(tp, cmd, data, flag);
+ if (error != ENOIOCTL)
+ return(error);
+ return(ENOTTY);
+}
+
+static void
+scstart(struct tty *tp)
+{
+ struct clist *rbp;
+ int s, len;
+ u_char buf[PCBURST];
+ scr_stat *scp = sc_get_scr_stat(tp->t_dev);
+
+ if (scp->status & SLKED || blink_in_progress)
+ return; /* XXX who repeats the call when the above flags are cleared? */
+ s = spltty();
+ if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
+ tp->t_state |= TS_BUSY;
+ rbp = &tp->t_outq;
+ while (rbp->c_cc) {
+ len = q_to_b(rbp, buf, PCBURST);
+ splx(s);
+ ansi_put(scp, buf, len);
+ s = spltty();
+ }
+ tp->t_state &= ~TS_BUSY;
+ ttwwakeup(tp);
+ }
+ splx(s);
+}
+
+static void
+scmousestart(struct tty *tp)
+{
+ struct clist *rbp;
+ int s;
+ u_char buf[PCBURST];
+
+ s = spltty();
+ if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
+ tp->t_state |= TS_BUSY;
+ rbp = &tp->t_outq;
+ while (rbp->c_cc) {
+ q_to_b(rbp, buf, PCBURST);
+ }
+ tp->t_state &= ~TS_BUSY;
+ ttwwakeup(tp);
+ }
+ splx(s);
+}
+
+void
+sccnprobe(struct consdev *cp)
+{
+ struct isa_device *dvp;
+
+ /*
+ * Take control if we are the highest priority enabled display device.
+ */
+ dvp = find_display();
+ if (dvp == NULL || dvp->id_driver != &scdriver) {
+ cp->cn_pri = CN_DEAD;
+ return;
+ }
+
+ if (!scvidprobe(dvp->id_unit, dvp->id_flags)) {
+ cp->cn_pri = CN_DEAD;
+ return;
+ }
+
+ /* initialize required fields */
+ cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
+ cp->cn_pri = CN_INTERNAL;
+
+ sc_kbdc = kbdc_open(sc_port);
+}
+
+void
+sccninit(struct consdev *cp)
+{
+ scinit();
+}
+
+void
+sccnputc(dev_t dev, int c)
+{
+ u_char buf[1];
+ int s;
+ scr_stat *scp = console[0];
+ term_stat save = scp->term;
+
+ scp->term = kernel_console;
+ current_default = &kernel_default;
+ if (scp == cur_console && !ISGRAPHSC(scp))
+ remove_cursor_image(scp);
+ buf[0] = c;
+ ansi_put(scp, buf, 1);
+ kernel_console = scp->term;
+ current_default = &user_default;
+ scp->term = save;
+
+ s = spltty(); /* block scintr and scrn_timer */
+ sccnupdate(scp);
+ splx(s);
+}
+
+int
+sccngetc(dev_t dev)
+{
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
+ int c;
+
+ /*
+ * Stop the screen saver and update the screen if necessary.
+ * What if we have been running in the screen saver code... XXX
+ */
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ sccnupdate(cur_console);
+
+ c = scgetc(SCGETC_CN);
+ splx(s);
+ return(c);
+}
+
+int
+sccncheckc(dev_t dev)
+{
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
+ int c;
+
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ sccnupdate(cur_console);
+
+ c = scgetc(SCGETC_CN | SCGETC_NONBLOCK);
+ splx(s);
+ return(c == NOKEY ? -1 : c); /* c == -1 can't happen */
+}
+
+static void
+sccnupdate(scr_stat *scp)
+{
+ /* this is a cut-down version of scrn_timer()... */
+
+ if (font_loading_in_progress)
+ return;
+
+ if (panicstr || shutdown_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ } else if (scp != cur_console) {
+ return;
+ }
+
+ if (!run_scrn_saver)
+ scrn_idle = FALSE;
+ if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
+ if (scp->status & SAVER_RUNNING)
+ stop_scrn_saver(current_saver);
+
+ if (scp != cur_console || blink_in_progress || switch_in_progress)
+ return;
+
+ if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ scrn_update(scp, TRUE);
+}
+
+scr_stat
+*sc_get_scr_stat(dev_t dev)
+{
+ int unit = minor(dev);
+
+ if (unit == SC_CONSOLE)
+ return console[0];
+ if (unit >= MAXCONS || unit < 0)
+ return(NULL);
+ return console[unit];
+}
+
+static int
+get_scr_num()
+{
+ int i = 0;
+
+ while ((i < MAXCONS) && (cur_console != console[i]))
+ i++;
+ return i < MAXCONS ? i : 0;
+}
+
+static void
+scrn_timer(void *arg)
+{
+ struct timeval tv;
+ scr_stat *scp;
+ int s;
+
+ /* don't do anything when we are touching font */
+ if (font_loading_in_progress) {
+ if (arg)
+ timeout(scrn_timer, (void *)TRUE, hz / 10);
+ return;
+ }
+ s = spltty();
+
+ /*
+ * With release 2.1 of the Xaccel server, the keyboard is left
+ * hanging pretty often. Apparently an interrupt from the
+ * keyboard is lost, and I don't know why (yet).
+ * This ugly hack calls scintr if input is ready for the keyboard
+ * and conveniently hides the problem. XXX
+ */
+ /* Try removing anything stuck in the keyboard controller; whether
+ * it's a keyboard scan code or mouse data. `scintr()' doesn't
+ * read the mouse data directly, but `kbdio' routines will, as a
+ * side effect.
+ */
+ if (kbdc_lock(sc_kbdc, TRUE)) {
+ /*
+ * We have seen the lock flag is not set. Let's reset the flag early;
+ * otherwise `update_led()' failes which may want the lock
+ * during `scintr()'.
+ */
+ kbdc_lock(sc_kbdc, FALSE);
+ if (kbdc_data_ready(sc_kbdc))
+ scintr(0);
+ }
+
+ scp = cur_console;
+
+ /* should we stop the screen saver? */
+ getmicrouptime(&tv);
+ if (panicstr || shutdown_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
+ if (run_scrn_saver) {
+ scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
+ } else {
+ scrn_time_stamp = tv.tv_sec;
+ scrn_idle = FALSE;
+ if (scrn_blank_time > 0)
+ run_scrn_saver = TRUE;
+ }
+ if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
+ if (scp->status & SAVER_RUNNING)
+ stop_scrn_saver(current_saver);
+
+ /* should we just return ? */
+ if (blink_in_progress || switch_in_progress) {
+ if (arg)
+ timeout(scrn_timer, (void *)TRUE, hz / 10);
+ splx(s);
+ return;
+ }
+
+ /* Update the screen */
+ if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ scrn_update(scp, TRUE);
+
+ /* should we activate the screen saver? */
+ if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
+ if (!ISGRAPHSC(scp) || (scp->status & SAVER_RUNNING))
+ scrn_saver(current_saver, TRUE);
+
+ if (arg)
+ timeout(scrn_timer, (void *)TRUE, hz / 25);
+ splx(s);
+}
+
+static void
+scrn_update(scr_stat *scp, int show_cursor)
+{
+ /* update screen image */
+ if (scp->start <= scp->end)
+ sc_bcopy(scp, scp->scr_buf, scp->start, scp->end, 0);
+
+ /* we are not to show the cursor and the mouse pointer... */
+ if (!show_cursor) {
+ scp->end = 0;
+ scp->start = scp->xsize*scp->ysize - 1;
+ return;
+ }
+
+ /* update "pseudo" mouse pointer image */
+ if (scp->status & MOUSE_VISIBLE) {
+ /* did mouse move since last time ? */
+ if (scp->status & MOUSE_MOVED) {
+ /* do we need to remove old mouse pointer image ? */
+ if (scp->mouse_cut_start != NULL ||
+ (scp->mouse_pos-scp->scr_buf) <= scp->start ||
+ (scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->end) {
+ remove_mouse_image(scp);
+ }
+ scp->status &= ~MOUSE_MOVED;
+ draw_mouse_image(scp);
+ }
+ else {
+ /* mouse didn't move, has it been overwritten ? */
+ if ((scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->start &&
+ (scp->mouse_pos - scp->scr_buf) <= scp->end) {
+ draw_mouse_image(scp);
+ }
+ }
+ }
+
+ /* update cursor image */
+ if (scp->status & CURSOR_ENABLED) {
+ /* did cursor move since last time ? */
+ if (scp->cursor_pos != scp->cursor_oldpos) {
+ /* do we need to remove old cursor image ? */
+ if ((scp->cursor_oldpos - scp->scr_buf) < scp->start ||
+ ((scp->cursor_oldpos - scp->scr_buf) > scp->end)) {
+ remove_cursor_image(scp);
+ }
+ scp->cursor_oldpos = scp->cursor_pos;
+ draw_cursor_image(scp);
+ }
+ else {
+ /* cursor didn't move, has it been overwritten ? */
+ if (scp->cursor_pos - scp->scr_buf >= scp->start &&
+ scp->cursor_pos - scp->scr_buf <= scp->end) {
+ draw_cursor_image(scp);
+ } else {
+ /* if its a blinking cursor, we may have to update it */
+ if (sc_flags & BLINK_CURSOR)
+ draw_cursor_image(scp);
+ }
+ }
+ blinkrate++;
+ }
+
+ if (scp->mouse_cut_start != NULL)
+ draw_cutmarking(scp);
+
+ scp->end = 0;
+ scp->start = scp->xsize*scp->ysize - 1;
+}
+
+int
+add_scrn_saver(void (*this_saver)(int))
+{
+#ifdef SC_SPLASH_SCREEN
+ if (current_saver == scsplash) {
+ scsplash_stick(FALSE);
+ stop_scrn_saver(scsplash);
+ }
+#endif
+
+ if (current_saver != default_saver)
+ return EBUSY;
+ run_scrn_saver = FALSE;
+ saver_mode = CONS_LKM_SAVER;
+ current_saver = this_saver;
+ return 0;
+}
+
+int
+remove_scrn_saver(void (*this_saver)(int))
+{
+ if (current_saver != this_saver)
+ return EINVAL;
+
+ /*
+ * In order to prevent `current_saver' from being called by
+ * the timeout routine `scrn_timer()' while we manipulate
+ * the saver list, we shall set `current_saver' to `none_saver'
+ * before stopping the current saver, rather than blocking by `splXX()'.
+ */
+ current_saver = none_saver;
+ if (scrn_blanked > 0)
+ stop_scrn_saver(this_saver);
+
+ if (scrn_blanked > 0)
+ return EBUSY; /* XXX */
+
+ current_saver = default_saver;
+ return 0;
+}
+
+static void
+scrn_saver(void (*saver)(int), int blank)
+{
+ static int busy = FALSE;
+
+ if (busy)
+ return;
+ busy = TRUE;
+ (*saver)(blank);
+ busy = FALSE;
+}
+
+static void
+stop_scrn_saver(void (*saver)(int))
+{
+ scrn_saver(saver, FALSE);
+ run_scrn_saver = FALSE;
+ /* the screen saver may have chosen not to stop after all... */
+ if (scrn_blanked > 0)
+ return;
+
+ mark_all(cur_console);
+ if (delayed_next_scr)
+ switch_scr(cur_console, delayed_next_scr - 1);
+ wakeup((caddr_t)&scrn_blanked);
+}
+
+static int
+wait_scrn_saver_stop(void)
+{
+ int error = 0;
+
+ while (scrn_blanked > 0) {
+ run_scrn_saver = FALSE;
+ error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
+ run_scrn_saver = FALSE;
+ if (error != ERESTART)
+ break;
+ }
+ return error;
+}
+
+void
+sc_clear_screen(scr_stat *scp)
+{
+ move_crsr(scp, 0, 0);
+ scp->cursor_oldpos = scp->cursor_pos;
+ fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
+ scp->xsize * scp->ysize);
+ mark_all(scp);
+ remove_cutmarking(scp);
+}
+
+static int
+switch_scr(scr_stat *scp, u_int next_scr)
+{
+ /* delay switch if actively updating screen */
+ if (scrn_blanked > 0 || write_in_progress || blink_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ delayed_next_scr = next_scr+1;
+ return 0;
+ }
+
+ if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid)))
+ switch_in_progress = FALSE;
+
+ if (next_scr >= MAXCONS || switch_in_progress ||
+ (cur_console->smode.mode == VT_AUTO && ISGRAPHSC(cur_console))) {
+ do_bell(scp, BELL_PITCH, BELL_DURATION);
+ return EINVAL;
+ }
+
+ /* is the wanted virtual console open ? */
+ if (next_scr) {
+ struct tty *tp = VIRTUAL_TTY(next_scr);
+ if (!(tp->t_state & TS_ISOPEN)) {
+ do_bell(scp, BELL_PITCH, BELL_DURATION);
+ return EINVAL;
+ }
+ }
+
+ switch_in_progress = TRUE;
+ old_scp = cur_console;
+ new_scp = console[next_scr];
+ wakeup((caddr_t)&new_scp->smode);
+ if (new_scp == old_scp) {
+ switch_in_progress = FALSE;
+ delayed_next_scr = FALSE;
+ return 0;
+ }
+
+ /* has controlling process died? */
+ if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid)))
+ old_scp->smode.mode = VT_AUTO;
+ if (new_scp->proc && (new_scp->proc != pfind(new_scp->pid)))
+ new_scp->smode.mode = VT_AUTO;
+
+ /* check the modes and switch appropriately */
+ if (old_scp->smode.mode == VT_PROCESS) {
+ old_scp->status |= SWITCH_WAIT_REL;
+ psignal(old_scp->proc, old_scp->smode.relsig);
+ }
+ else {
+ exchange_scr();
+ if (new_scp->smode.mode == VT_PROCESS) {
+ new_scp->status |= SWITCH_WAIT_ACQ;
+ psignal(new_scp->proc, new_scp->smode.acqsig);
+ }
+ else
+ switch_in_progress = FALSE;
+ }
+ return 0;
+}
+
+static void
+exchange_scr(void)
+{
+ move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
+ cur_console = new_scp;
+ if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
+ set_mode(new_scp);
+ move_crsr(new_scp, new_scp->xpos, new_scp->ypos);
+ if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
+ set_destructive_cursor(new_scp);
+ if (ISGRAPHSC(old_scp))
+ load_palette(new_scp, palette);
+ if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE ||
+ old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ set_border(new_scp, new_scp->border);
+ update_leds(new_scp->status);
+ delayed_next_scr = FALSE;
+ mark_all(new_scp);
+}
+
+static void
+scan_esc(scr_stat *scp, u_char c)
+{
+ static u_char ansi_col[16] =
+ {0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15};
+ int i, n;
+ u_short *src, *dst, count;
+
+ if (scp->term.esc == 1) { /* seen ESC */
+ switch (c) {
+
+ case '7': /* Save cursor position */
+ scp->saved_xpos = scp->xpos;
+ scp->saved_ypos = scp->ypos;
+ break;
+
+ case '8': /* Restore saved cursor position */
+ if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
+ move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
+ break;
+
+ case '[': /* Start ESC [ sequence */
+ scp->term.esc = 2;
+ scp->term.last_param = -1;
+ for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
+ scp->term.param[i] = 1;
+ scp->term.num_param = 0;
+ return;
+
+ case 'M': /* Move cursor up 1 line, scroll if at top */
+ if (scp->ypos > 0)
+ move_crsr(scp, scp->xpos, scp->ypos - 1);
+ else {
+ bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
+ (scp->ysize - 1) * scp->xsize * sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->scr_buf, scp->xsize);
+ mark_all(scp);
+ }
+ break;
+#if notyet
+ case 'Q':
+ scp->term.esc = 4;
+ return;
+#endif
+ case 'c': /* Clear screen & home */
+ sc_clear_screen(scp);
+ break;
+
+ case '(': /* iso-2022: designate 94 character set to G0 */
+ scp->term.esc = 5;
+ return;
+ }
+ }
+ else if (scp->term.esc == 2) { /* seen ESC [ */
+ if (c >= '0' && c <= '9') {
+ if (scp->term.num_param < MAX_ESC_PAR) {
+ if (scp->term.last_param != scp->term.num_param) {
+ scp->term.last_param = scp->term.num_param;
+ scp->term.param[scp->term.num_param] = 0;
+ }
+ else
+ scp->term.param[scp->term.num_param] *= 10;
+ scp->term.param[scp->term.num_param] += c - '0';
+ return;
+ }
+ }
+ scp->term.num_param = scp->term.last_param + 1;
+ switch (c) {
+
+ case ';':
+ if (scp->term.num_param < MAX_ESC_PAR)
+ return;
+ break;
+
+ case '=':
+ scp->term.esc = 3;
+ scp->term.last_param = -1;
+ for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
+ scp->term.param[i] = 1;
+ scp->term.num_param = 0;
+ return;
+
+ case 'A': /* up n rows */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos, scp->ypos - n);
+ break;
+
+ case 'B': /* down n rows */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos, scp->ypos + n);
+ break;
+
+ case 'C': /* right n columns */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos + n, scp->ypos);
+ break;
+
+ case 'D': /* left n columns */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos - n, scp->ypos);
+ break;
+
+ case 'E': /* cursor to start of line n lines down */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, 0, scp->ypos + n);
+ break;
+
+ case 'F': /* cursor to start of line n lines up */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, 0, scp->ypos - n);
+ break;
+
+ case 'f': /* Cursor move */
+ case 'H':
+ if (scp->term.num_param == 0)
+ move_crsr(scp, 0, 0);
+ else if (scp->term.num_param == 2)
+ move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1);
+ break;
+
+ case 'J': /* Clear all or part of display */
+ if (scp->term.num_param == 0)
+ n = 0;
+ else
+ n = scp->term.param[0];
+ switch (n) {
+ case 0: /* clear form cursor to end of display */
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->cursor_pos,
+ scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ remove_cutmarking(scp);
+ break;
+ case 1: /* clear from beginning of display to cursor */
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->scr_buf,
+ scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, 0);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ remove_cutmarking(scp);
+ break;
+ case 2: /* clear entire display */
+ fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
+ scp->xsize * scp->ysize);
+ mark_all(scp);
+ remove_cutmarking(scp);
+ break;
+ }
+ break;
+
+ case 'K': /* Clear all or part of line */
+ if (scp->term.num_param == 0)
+ n = 0;
+ else
+ n = scp->term.param[0];
+ switch (n) {
+ case 0: /* clear form cursor to end of line */
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->cursor_pos,
+ scp->xsize - scp->xpos);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf +
+ scp->xsize - 1 - scp->xpos);
+ break;
+ case 1: /* clear from beginning of line to cursor */
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->cursor_pos - scp->xpos,
+ scp->xpos + 1);
+ mark_for_update(scp, scp->ypos * scp->xsize);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ break;
+ case 2: /* clear entire line */
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->cursor_pos - scp->xpos,
+ scp->xsize);
+ mark_for_update(scp, scp->ypos * scp->xsize);
+ mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
+ break;
+ }
+ break;
+
+ case 'L': /* Insert n lines */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->ysize - scp->ypos)
+ n = scp->ysize - scp->ypos;
+ src = scp->scr_buf + scp->ypos * scp->xsize;
+ dst = src + n * scp->xsize;
+ count = scp->ysize - (scp->ypos + n);
+ bcopy(src, dst, count * scp->xsize * sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20], src,
+ n * scp->xsize);
+ mark_for_update(scp, scp->ypos * scp->xsize);
+ mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ break;
+
+ case 'M': /* Delete n lines */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->ysize - scp->ypos)
+ n = scp->ysize - scp->ypos;
+ dst = scp->scr_buf + scp->ypos * scp->xsize;
+ src = dst + n * scp->xsize;
+ count = scp->ysize - (scp->ypos + n);
+ bcopy(src, dst, count * scp->xsize * sizeof(u_short));
+ src = dst + count * scp->xsize;
+ fillw(scp->term.cur_color | scr_map[0x20], src,
+ n * scp->xsize);
+ mark_for_update(scp, scp->ypos * scp->xsize);
+ mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ break;
+
+ case 'P': /* Delete n chars */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->xsize - scp->xpos)
+ n = scp->xsize - scp->xpos;
+ dst = scp->cursor_pos;
+ src = dst + n;
+ count = scp->xsize - (scp->xpos + n);
+ bcopy(src, dst, count * sizeof(u_short));
+ src = dst + count;
+ fillw(scp->term.cur_color | scr_map[0x20], src, n);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ break;
+
+ case '@': /* Insert n chars */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->xsize - scp->xpos)
+ n = scp->xsize - scp->xpos;
+ src = scp->cursor_pos;
+ dst = src + n;
+ count = scp->xsize - (scp->xpos + n);
+ bcopy(src, dst, count * sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20], src, n);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ break;
+
+ case 'S': /* scroll up n lines */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->ysize)
+ n = scp->ysize;
+ bcopy(scp->scr_buf + (scp->xsize * n),
+ scp->scr_buf,
+ scp->xsize * (scp->ysize - n) * sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->scr_buf + scp->xsize * (scp->ysize - n),
+ scp->xsize * n);
+ mark_all(scp);
+ break;
+
+ case 'T': /* scroll down n lines */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->ysize)
+ n = scp->ysize;
+ bcopy(scp->scr_buf,
+ scp->scr_buf + (scp->xsize * n),
+ scp->xsize * (scp->ysize - n) *
+ sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->scr_buf, scp->xsize * n);
+ mark_all(scp);
+ break;
+
+ case 'X': /* erase n characters in line */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if (n > scp->xsize - scp->xpos)
+ n = scp->xsize - scp->xpos;
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->cursor_pos, n);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n - 1);
+ break;
+
+ case 'Z': /* move n tabs backwards */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ if ((i = scp->xpos & 0xf8) == scp->xpos)
+ i -= 8*n;
+ else
+ i -= 8*(n-1);
+ if (i < 0)
+ i = 0;
+ move_crsr(scp, i, scp->ypos);
+ break;
+
+ case '`': /* move cursor to column n */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, n - 1, scp->ypos);
+ break;
+
+ case 'a': /* move cursor n columns to the right */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos + n, scp->ypos);
+ break;
+
+ case 'd': /* move cursor to row n */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos, n - 1);
+ break;
+
+ case 'e': /* move cursor n rows down */
+ n = scp->term.param[0]; if (n < 1) n = 1;
+ move_crsr(scp, scp->xpos, scp->ypos + n);
+ break;
+
+ case 'm': /* change attribute */
+ if (scp->term.num_param == 0) {
+ scp->term.attr_mask = NORMAL_ATTR;
+ scp->term.cur_attr =
+ scp->term.cur_color = scp->term.std_color;
+ break;
+ }
+ for (i = 0; i < scp->term.num_param; i++) {
+ switch (n = scp->term.param[i]) {
+ case 0: /* back to normal */
+ scp->term.attr_mask = NORMAL_ATTR;
+ scp->term.cur_attr =
+ scp->term.cur_color = scp->term.std_color;
+ break;
+ case 1: /* bold */
+ scp->term.attr_mask |= BOLD_ATTR;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 4: /* underline */
+ scp->term.attr_mask |= UNDERLINE_ATTR;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 5: /* blink */
+ scp->term.attr_mask |= BLINK_ATTR;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 7: /* reverse video */
+ scp->term.attr_mask |= REVERSE_ATTR;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 30: case 31: /* set fg color */
+ case 32: case 33: case 34:
+ case 35: case 36: case 37:
+ scp->term.attr_mask |= FOREGROUND_CHANGED;
+ scp->term.cur_color =
+ (scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 40: case 41: /* set bg color */
+ case 42: case 43: case 44:
+ case 45: case 46: case 47:
+ scp->term.attr_mask |= BACKGROUND_CHANGED;
+ scp->term.cur_color =
+ (scp->term.cur_color&0x0F00) | (ansi_col[(n-40)&7]<<12);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ }
+ }
+ break;
+
+ case 's': /* Save cursor position */
+ scp->saved_xpos = scp->xpos;
+ scp->saved_ypos = scp->ypos;
+ break;
+
+ case 'u': /* Restore saved cursor position */
+ if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
+ move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
+ break;
+
+ case 'x':
+ if (scp->term.num_param == 0)
+ n = 0;
+ else
+ n = scp->term.param[0];
+ switch (n) {
+ case 0: /* reset attributes */
+ scp->term.attr_mask = NORMAL_ATTR;
+ scp->term.cur_attr =
+ scp->term.cur_color = scp->term.std_color =
+ current_default->std_color;
+ scp->term.rev_color = current_default->rev_color;
+ break;
+ case 1: /* set ansi background */
+ scp->term.attr_mask &= ~BACKGROUND_CHANGED;
+ scp->term.cur_color = scp->term.std_color =
+ (scp->term.std_color & 0x0F00) |
+ (ansi_col[(scp->term.param[1])&0x0F]<<12);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 2: /* set ansi foreground */
+ scp->term.attr_mask &= ~FOREGROUND_CHANGED;
+ scp->term.cur_color = scp->term.std_color =
+ (scp->term.std_color & 0xF000) |
+ (ansi_col[(scp->term.param[1])&0x0F]<<8);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 3: /* set ansi attribute directly */
+ scp->term.attr_mask &= ~(FOREGROUND_CHANGED|BACKGROUND_CHANGED);
+ scp->term.cur_color = scp->term.std_color =
+ (scp->term.param[1]&0xFF)<<8;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 5: /* set ansi reverse video background */
+ scp->term.rev_color =
+ (scp->term.rev_color & 0x0F00) |
+ (ansi_col[(scp->term.param[1])&0x0F]<<12);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 6: /* set ansi reverse video foreground */
+ scp->term.rev_color =
+ (scp->term.rev_color & 0xF000) |
+ (ansi_col[(scp->term.param[1])&0x0F]<<8);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ case 7: /* set ansi reverse video directly */
+ scp->term.rev_color =
+ (scp->term.param[1]&0xFF)<<8;
+ scp->term.cur_attr = mask2attr(&scp->term);
+ break;
+ }
+ break;
+
+ case 'z': /* switch to (virtual) console n */
+ if (scp->term.num_param == 1)
+ switch_scr(scp, scp->term.param[0]);
+ break;
+ }
+ }
+ else if (scp->term.esc == 3) { /* seen ESC [0-9]+ = */
+ if (c >= '0' && c <= '9') {
+ if (scp->term.num_param < MAX_ESC_PAR) {
+ if (scp->term.last_param != scp->term.num_param) {
+ scp->term.last_param = scp->term.num_param;
+ scp->term.param[scp->term.num_param] = 0;
+ }
+ else
+ scp->term.param[scp->term.num_param] *= 10;
+ scp->term.param[scp->term.num_param] += c - '0';
+ return;
+ }
+ }
+ scp->term.num_param = scp->term.last_param + 1;
+ switch (c) {
+
+ case ';':
+ if (scp->term.num_param < MAX_ESC_PAR)
+ return;
+ break;
+
+ case 'A': /* set display border color */
+ if (scp->term.num_param == 1) {
+ scp->border=scp->term.param[0] & 0xff;
+ if (scp == cur_console)
+ set_border(cur_console, scp->border);
+ }
+ break;
+
+ case 'B': /* set bell pitch and duration */
+ if (scp->term.num_param == 2) {
+ scp->bell_pitch = scp->term.param[0];
+ scp->bell_duration = scp->term.param[1];
+ }
+ break;
+
+ case 'C': /* set cursor type & shape */
+ if (scp->term.num_param == 1) {
+ if (scp->term.param[0] & 0x01)
+ sc_flags |= BLINK_CURSOR;
+ else
+ sc_flags &= ~BLINK_CURSOR;
+ if ((scp->term.param[0] & 0x02)
+ && ISFONTAVAIL(get_adapter(scp)->va_flags))
+ sc_flags |= CHAR_CURSOR;
+ else
+ sc_flags &= ~CHAR_CURSOR;
+ }
+ else if (scp->term.num_param == 2) {
+ scp->cursor_start = scp->term.param[0] & 0x1F;
+ scp->cursor_end = scp->term.param[1] & 0x1F;
+ }
+ /*
+ * The cursor shape is global property; all virtual consoles
+ * are affected. Update the cursor in the current console...
+ */
+ if (!ISGRAPHSC(cur_console)) {
+ remove_cursor_image(cur_console);
+ if (sc_flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ draw_cursor_image(cur_console);
+ }
+ break;
+
+ case 'F': /* set ansi foreground */
+ if (scp->term.num_param == 1) {
+ scp->term.attr_mask &= ~FOREGROUND_CHANGED;
+ scp->term.cur_color = scp->term.std_color =
+ (scp->term.std_color & 0xF000)
+ | ((scp->term.param[0] & 0x0F) << 8);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ }
+ break;
+
+ case 'G': /* set ansi background */
+ if (scp->term.num_param == 1) {
+ scp->term.attr_mask &= ~BACKGROUND_CHANGED;
+ scp->term.cur_color = scp->term.std_color =
+ (scp->term.std_color & 0x0F00)
+ | ((scp->term.param[0] & 0x0F) << 12);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ }
+ break;
+
+ case 'H': /* set ansi reverse video foreground */
+ if (scp->term.num_param == 1) {
+ scp->term.rev_color =
+ (scp->term.rev_color & 0xF000)
+ | ((scp->term.param[0] & 0x0F) << 8);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ }
+ break;
+
+ case 'I': /* set ansi reverse video background */
+ if (scp->term.num_param == 1) {
+ scp->term.rev_color =
+ (scp->term.rev_color & 0x0F00)
+ | ((scp->term.param[0] & 0x0F) << 12);
+ scp->term.cur_attr = mask2attr(&scp->term);
+ }
+ break;
+ }
+ }
+#if notyet
+ else if (scp->term.esc == 4) { /* seen ESC Q */
+ /* to be filled */
+ }
+#endif
+ else if (scp->term.esc == 5) { /* seen ESC ( */
+ switch (c) {
+ case 'B': /* iso-2022: desginate ASCII into G0 */
+ break;
+ /* other items to be filled */
+ default:
+ break;
+ }
+ }
+ scp->term.esc = 0;
+}
+
+static void
+ansi_put(scr_stat *scp, u_char *buf, int len)
+{
+ u_char *ptr = buf;
+
+ /* make screensaver happy */
+ if (!sticky_splash && scp == cur_console)
+ run_scrn_saver = FALSE;
+
+ write_in_progress++;
+outloop:
+ if (scp->term.esc) {
+ scan_esc(scp, *ptr++);
+ len--;
+ }
+ else if (PRINTABLE(*ptr)) { /* Print only printables */
+ int cnt = len <= (scp->xsize-scp->xpos) ? len : (scp->xsize-scp->xpos);
+ u_short cur_attr = scp->term.cur_attr;
+ u_short *cursor_pos = scp->cursor_pos;
+ do {
+ /*
+ * gcc-2.6.3 generates poor (un)sign extension code. Casting the
+ * pointers in the following to volatile should have no effect,
+ * but in fact speeds up this inner loop from 26 to 18 cycles
+ * (+ cache misses) on i486's.
+ */
+#define UCVP(ucp) ((u_char volatile *)(ucp))
+ *cursor_pos++ = UCVP(scr_map)[*UCVP(ptr)] | cur_attr;
+ ptr++;
+ cnt--;
+ } while (cnt && PRINTABLE(*ptr));
+ len -= (cursor_pos - scp->cursor_pos);
+ scp->xpos += (cursor_pos - scp->cursor_pos);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ mark_for_update(scp, cursor_pos - scp->scr_buf);
+ scp->cursor_pos = cursor_pos;
+ if (scp->xpos >= scp->xsize) {
+ scp->xpos = 0;
+ scp->ypos++;
+ }
+ }
+ else {
+ switch(*ptr) {
+ case 0x07:
+ do_bell(scp, scp->bell_pitch, scp->bell_duration);
+ break;
+
+ case 0x08: /* non-destructive backspace */
+ if (scp->cursor_pos > scp->scr_buf) {
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->cursor_pos--;
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ if (scp->xpos > 0)
+ scp->xpos--;
+ else {
+ scp->xpos += scp->xsize - 1;
+ scp->ypos--;
+ }
+ }
+ break;
+
+ case 0x09: /* non-destructive tab */
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->cursor_pos += (8 - scp->xpos % 8u);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) {
+ scp->xpos = 0;
+ scp->ypos++;
+ }
+ break;
+
+ case 0x0a: /* newline, same pos */
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->cursor_pos += scp->xsize;
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->ypos++;
+ break;
+
+ case 0x0c: /* form feed, clears screen */
+ sc_clear_screen(scp);
+ break;
+
+ case 0x0d: /* return, return to pos 0 */
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->cursor_pos -= scp->xpos;
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
+ scp->xpos = 0;
+ break;
+
+ case 0x1b: /* start escape sequence */
+ scp->term.esc = 1;
+ scp->term.num_param = 0;
+ break;
+ }
+ ptr++; len--;
+ }
+ /* do we have to scroll ?? */
+ if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
+ remove_cutmarking(scp);
+ if (scp->history != NULL) {
+ bcopy(scp->scr_buf, scp->history_head,
+ scp->xsize * sizeof(u_short));
+ scp->history_head += scp->xsize;
+ if (scp->history_head + scp->xsize >
+ scp->history + scp->history_size)
+ scp->history_head = scp->history;
+ }
+ bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
+ scp->xsize * (scp->ysize - 1) * sizeof(u_short));
+ fillw(scp->term.cur_color | scr_map[0x20],
+ scp->scr_buf + scp->xsize * (scp->ysize - 1),
+ scp->xsize);
+ scp->cursor_pos -= scp->xsize;
+ scp->ypos--;
+ mark_all(scp);
+ }
+ if (len)
+ goto outloop;
+ write_in_progress--;
+ if (delayed_next_scr)
+ switch_scr(scp, delayed_next_scr - 1);
+}
+
+static void
+scinit(void)
+{
+ int col;
+ int row;
+ u_int i;
+
+ if (init_done != COLD)
+ return;
+ init_done = WARM;
+
+ /* extract the hardware cursor location and move it out of the way */
+ (*biosvidsw.read_hw_cursor)(V_ADP_PRIMARY, &col, &row);
+ (*biosvidsw.set_hw_cursor)(V_ADP_PRIMARY, -1, -1);
+
+ /* set up the first console */
+ current_default = &user_default;
+ console[0] = &main_console;
+ init_scp(console[0]);
+ cur_console = console[0];
+
+ /* copy screen to temporary buffer */
+ if (ISTEXTSC(console[0]))
+ generic_bcopy((ushort *)(get_adapter(console[0])->va_window), sc_buffer,
+ console[0]->xsize * console[0]->ysize * sizeof(u_short));
+
+ console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
+ = sc_buffer;
+ if (col >= console[0]->xsize)
+ col = 0;
+ if (row >= console[0]->ysize)
+ row = console[0]->ysize - 1;
+ console[0]->xpos = col;
+ console[0]->ypos = row;
+ console[0]->cursor_pos = console[0]->cursor_oldpos =
+ sc_buffer + row*console[0]->xsize + col;
+ console[0]->cursor_saveunder = *console[0]->cursor_pos;
+ for (i=1; i<MAXCONS; i++)
+ console[i] = NULL;
+ kernel_console.esc = 0;
+ kernel_console.attr_mask = NORMAL_ATTR;
+ kernel_console.cur_attr =
+ kernel_console.cur_color = kernel_console.std_color =
+ kernel_default.std_color;
+ kernel_console.rev_color = kernel_default.rev_color;
+
+ /* initialize mapscrn arrays to a one to one map */
+ for (i=0; i<sizeof(scr_map); i++) {
+ scr_map[i] = scr_rmap[i] = i;
+ }
+
+ /* Save font and palette */
+ if (ISFONTAVAIL(get_adapter(cur_console)->va_flags)) {
+ if (fonts_loaded & FONT_16) {
+ copy_font(cur_console, LOAD, 16, font_16);
+ } else {
+ copy_font(cur_console, SAVE, 16, font_16);
+ fonts_loaded = FONT_16;
+ set_destructive_cursor(cur_console);
+ }
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ (*biosvidsw.show_font)(cur_console->adp, 0);
+ }
+ save_palette(cur_console, palette);
+
+#ifdef SC_SPLASH_SCREEN
+ /* put up the splash. */
+ scsplash_init(cur_console);
+#endif
+}
+
+static void
+scshutdown(int howto, void *arg)
+{
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ if (!cold && cur_console->smode.mode == VT_AUTO
+ && console[0]->smode.mode == VT_AUTO)
+ switch_scr(cur_console, 0);
+ shutdown_in_progress = TRUE;
+}
+
+int
+sc_clean_up(scr_stat *scp)
+{
+ int error;
+
+ if ((error = wait_scrn_saver_stop()))
+ return error;
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ return 0;
+}
+
+void
+sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear)
+{
+ if (scp->scr_buf)
+ free(scp->scr_buf, M_DEVBUF);
+ scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
+
+ if (clear) {
+ /* clear the screen and move the text cursor to the top-left position */
+ sc_clear_screen(scp);
+ } else {
+ /* retain the current cursor position, but adjust pointers */
+ move_crsr(scp, scp->xpos, scp->ypos);
+ scp->cursor_oldpos = scp->cursor_pos;
+ }
+
+ /* move the mouse cursor at the center of the screen */
+ sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
+}
+
+void
+sc_alloc_cut_buffer(scr_stat *scp, int wait)
+{
+ if ((cut_buffer == NULL)
+ || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
+ if (cut_buffer != NULL)
+ free(cut_buffer, M_DEVBUF);
+ cut_buffer_size = scp->xsize * scp->ysize + 1;
+ cut_buffer = (u_char *)malloc(cut_buffer_size,
+ M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
+ if (cut_buffer != NULL)
+ cut_buffer[0] = '\0';
+ }
+}
+
+void
+sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait)
+{
+ u_short *usp;
+
+ if (lines < scp->ysize)
+ lines = scp->ysize;
+
+ usp = scp->history;
+ scp->history = NULL;
+ if (usp != NULL) {
+ free(usp, M_DEVBUF);
+ if (extra > 0)
+ extra_history_size += extra;
+ }
+
+ scp->history_size = lines * scp->xsize;
+ if (lines > imax(sc_history_size, scp->ysize))
+ extra_history_size -= lines - imax(sc_history_size, scp->ysize);
+ usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
+ if (usp != NULL)
+ bzero(usp, scp->history_size * sizeof(u_short));
+ scp->history_head = scp->history_pos = usp;
+ scp->history = usp;
+}
+
+static scr_stat
+*alloc_scp()
+{
+ scr_stat *scp;
+
+ scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
+ init_scp(scp);
+ sc_alloc_scr_buffer(scp, TRUE, TRUE);
+ if (ISMOUSEAVAIL(get_adapter(scp)->va_flags))
+ sc_alloc_cut_buffer(scp, TRUE);
+ sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
+/* SOS
+ if (get_adapter(scp)->va_flags & V_ADP_MODECHANGE)
+ set_mode(scp);
+*/
+ sc_clear_screen(scp);
+ scp->cursor_saveunder = *scp->cursor_pos;
+ return scp;
+}
+
+static void
+init_scp(scr_stat *scp)
+{
+ video_info_t info;
+
+ scp->adp = V_ADP_PRIMARY;
+ (*biosvidsw.get_info)(scp->adp, initial_video_mode, &info);
+
+ scp->status = 0;
+ scp->mode = scp->initial_mode = initial_video_mode;
+ scp->scr_buf = NULL;
+ if (info.vi_flags & V_INFO_GRAPHICS) {
+ scp->status |= GRAPHICS_MODE;
+ scp->xpixel = info.vi_width;
+ scp->ypixel = info.vi_height;
+ scp->xsize = info.vi_width/8;
+ scp->ysize = info.vi_height/info.vi_cheight;
+ scp->font_size = FONT_NONE;
+ } else {
+ scp->xsize = info.vi_width;
+ scp->ysize = info.vi_height;
+ scp->xpixel = scp->xsize*8;
+ scp->ypixel = scp->ysize*info.vi_cheight;
+ scp->font_size = info.vi_cheight;
+ }
+ scp->xoff = scp->yoff = 0;
+ scp->xpos = scp->ypos = 0;
+ scp->saved_xpos = scp->saved_ypos = -1;
+ scp->start = scp->xsize * scp->ysize;
+ scp->end = 0;
+ scp->term.esc = 0;
+ scp->term.attr_mask = NORMAL_ATTR;
+ scp->term.cur_attr =
+ scp->term.cur_color = scp->term.std_color =
+ current_default->std_color;
+ scp->term.rev_color = current_default->rev_color;
+ scp->border = BG_BLACK;
+ scp->cursor_start = *(u_int8_t *)pa_to_va(0x461);
+ scp->cursor_end = *(u_int8_t *)pa_to_va(0x460);
+ scp->mouse_xpos = scp->xsize*8/2;
+ scp->mouse_ypos = scp->ysize*scp->font_size/2;
+ scp->mouse_cut_start = scp->mouse_cut_end = NULL;
+ scp->mouse_signal = 0;
+ scp->mouse_pid = 0;
+ scp->mouse_proc = NULL;
+ scp->bell_pitch = BELL_PITCH;
+ scp->bell_duration = BELL_DURATION;
+ scp->status |= (*(u_int8_t *)pa_to_va(0x417) & 0x20) ? NLKED : 0;
+ scp->status |= CURSOR_ENABLED;
+ scp->pid = 0;
+ scp->proc = NULL;
+ scp->smode.mode = VT_AUTO;
+ scp->history_head = scp->history_pos = scp->history = NULL;
+ scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
+}
+
+static u_char
+*get_fstr(u_int c, u_int *len)
+{
+ u_int i;
+
+ if (!(c & FKEY))
+ return(NULL);
+ i = (c & 0xFF) - F_FN;
+ if (i > n_fkey_tab)
+ return(NULL);
+ *len = fkey_tab[i].len;
+ return(fkey_tab[i].str);
+}
+
+static void
+history_to_screen(scr_stat *scp)
+{
+ int i;
+
+ for (i=0; i<scp->ysize; i++)
+ bcopy(scp->history + (((scp->history_pos - scp->history) +
+ scp->history_size-((i+1)*scp->xsize))%scp->history_size),
+ scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
+ scp->xsize * sizeof(u_short));
+ mark_all(scp);
+}
+
+static int
+history_up_line(scr_stat *scp)
+{
+ if (WRAPHIST(scp, scp->history_pos, -(scp->xsize*scp->ysize)) !=
+ scp->history_head) {
+ scp->history_pos = WRAPHIST(scp, scp->history_pos, -scp->xsize);
+ history_to_screen(scp);
+ return 0;
+ }
+ else
+ return -1;
+}
+
+static int
+history_down_line(scr_stat *scp)
+{
+ if (scp->history_pos != scp->history_head) {
+ scp->history_pos = WRAPHIST(scp, scp->history_pos, scp->xsize);
+ history_to_screen(scp);
+ return 0;
+ }
+ else
+ return -1;
+}
+
+/*
+ * scgetc(flags) - get character from keyboard.
+ * If flags & SCGETC_CN, then avoid harmful side effects.
+ * If flags & SCGETC_NONBLOCK, then wait until a key is pressed, else
+ * return NOKEY if there is nothing there.
+ */
+static u_int
+scgetc(u_int flags)
+{
+ struct key_t *key;
+ u_char scancode, keycode;
+ u_int state, action;
+ int c;
+ static u_char esc_flag = 0, compose = 0;
+ static u_int chr = 0;
+
+next_code:
+ /* first see if there is something in the keyboard port */
+ if (flags & SCGETC_NONBLOCK) {
+ c = read_kbd_data_no_wait(sc_kbdc);
+ if (c == -1)
+ return(NOKEY);
+ } else {
+ do {
+ c = read_kbd_data(sc_kbdc);
+ } while(c == -1);
+ }
+ scancode = (u_char)c;
+
+ /* make screensaver happy */
+ if (!(scancode & 0x80)) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
+
+ if (!(flags & SCGETC_CN)) {
+ /* do the /dev/random device a favour */
+ add_keyboard_randomness(scancode);
+
+ if (cur_console->status & KBD_RAW_MODE)
+ return scancode;
+ }
+
+ keycode = scancode & 0x7F;
+ switch (esc_flag) {
+ case 0x00: /* normal scancode */
+ switch(scancode) {
+ case 0xB8: /* left alt (compose key) */
+ if (compose) {
+ compose = 0;
+ if (chr > 255) {
+ do_bell(cur_console,
+ BELL_PITCH, BELL_DURATION);
+ chr = 0;
+ }
+ }
+ break;
+ case 0x38:
+ if (!compose) {
+ compose = 1;
+ chr = 0;
+ }
+ break;
+ case 0xE0:
+ case 0xE1:
+ esc_flag = scancode;
+ goto next_code;
+ }
+ break;
+ case 0xE0: /* 0xE0 prefix */
+ esc_flag = 0;
+ switch (keycode) {
+ case 0x1C: /* right enter key */
+ keycode = 0x59;
+ break;
+ case 0x1D: /* right ctrl key */
+ keycode = 0x5A;
+ break;
+ case 0x35: /* keypad divide key */
+ keycode = 0x5B;
+ break;
+ case 0x37: /* print scrn key */
+ keycode = 0x5C;
+ break;
+ case 0x38: /* right alt key (alt gr) */
+ keycode = 0x5D;
+ break;
+ case 0x47: /* grey home key */
+ keycode = 0x5E;
+ break;
+ case 0x48: /* grey up arrow key */
+ keycode = 0x5F;
+ break;
+ case 0x49: /* grey page up key */
+ keycode = 0x60;
+ break;
+ case 0x4B: /* grey left arrow key */
+ keycode = 0x61;
+ break;
+ case 0x4D: /* grey right arrow key */
+ keycode = 0x62;
+ break;
+ case 0x4F: /* grey end key */
+ keycode = 0x63;
+ break;
+ case 0x50: /* grey down arrow key */
+ keycode = 0x64;
+ break;
+ case 0x51: /* grey page down key */
+ keycode = 0x65;
+ break;
+ case 0x52: /* grey insert key */
+ keycode = 0x66;
+ break;
+ case 0x53: /* grey delete key */
+ keycode = 0x67;
+ break;
+
+ /* the following 3 are only used on the MS "Natural" keyboard */
+ case 0x5b: /* left Window key */
+ keycode = 0x69;
+ break;
+ case 0x5c: /* right Window key */
+ keycode = 0x6a;
+ break;
+ case 0x5d: /* menu key */
+ keycode = 0x6b;
+ break;
+ default: /* ignore everything else */
+ goto next_code;
+ }
+ break;
+ case 0xE1: /* 0xE1 prefix */
+ esc_flag = 0;
+ if (keycode == 0x1D)
+ esc_flag = 0x1D;
+ goto next_code;
+ /* NOT REACHED */
+ case 0x1D: /* pause / break */
+ esc_flag = 0;
+ if (keycode != 0x45)
+ goto next_code;
+ keycode = 0x68;
+ break;
+ }
+
+ if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
+ return (keycode | (scancode & 0x80));
+
+ /* if scroll-lock pressed allow history browsing */
+ if (cur_console->history && cur_console->status & SLKED) {
+ int i;
+
+ cur_console->status &= ~CURSOR_ENABLED;
+ if (!(cur_console->status & BUFFER_SAVED)) {
+ cur_console->status |= BUFFER_SAVED;
+ cur_console->history_save = cur_console->history_head;
+
+ /* copy screen into top of history buffer */
+ for (i=0; i<cur_console->ysize; i++) {
+ bcopy(cur_console->scr_buf + (cur_console->xsize * i),
+ cur_console->history_head,
+ cur_console->xsize * sizeof(u_short));
+ cur_console->history_head += cur_console->xsize;
+ if (cur_console->history_head + cur_console->xsize >
+ cur_console->history + cur_console->history_size)
+ cur_console->history_head=cur_console->history;
+ }
+ cur_console->history_pos = cur_console->history_head;
+ history_to_screen(cur_console);
+ }
+ switch (scancode) {
+ case 0x47: /* home key */
+ cur_console->history_pos = cur_console->history_head;
+ history_to_screen(cur_console);
+ goto next_code;
+
+ case 0x4F: /* end key */
+ cur_console->history_pos =
+ WRAPHIST(cur_console, cur_console->history_head,
+ cur_console->xsize*cur_console->ysize);
+ history_to_screen(cur_console);
+ goto next_code;
+
+ case 0x48: /* up arrow key */
+ if (history_up_line(cur_console))
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+
+ case 0x50: /* down arrow key */
+ if (history_down_line(cur_console))
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+
+ case 0x49: /* page up key */
+ for (i=0; i<cur_console->ysize; i++)
+ if (history_up_line(cur_console)) {
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ break;
+ }
+ goto next_code;
+
+ case 0x51: /* page down key */
+ for (i=0; i<cur_console->ysize; i++)
+ if (history_down_line(cur_console)) {
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ break;
+ }
+ goto next_code;
+ }
+ }
+
+ if (compose) {
+ switch (scancode) {
+ /* key pressed process it */
+ case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
+ chr = (scancode - 0x40) + chr*10;
+ goto next_code;
+ case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
+ chr = (scancode - 0x47) + chr*10;
+ goto next_code;
+ case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
+ chr = (scancode - 0x4E) + chr*10;
+ goto next_code;
+ case 0x52: /* keypad 0 */
+ chr *= 10;
+ goto next_code;
+
+ /* key release, no interest here */
+ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
+ case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
+ case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
+ case 0xD2: /* keypad 0 */
+ goto next_code;
+
+ case 0x38: /* left alt key */
+ break;
+ default:
+ if (chr) {
+ compose = chr = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ break;
+ }
+ }
+
+ state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0));
+ if ((!agrs && (cur_console->status & ALKED))
+ || (agrs && !(cur_console->status & ALKED)))
+ keycode += ALTGR_OFFSET;
+ key = &key_map.key[keycode];
+ if ( ((key->flgs & FLAG_LOCK_C) && (cur_console->status & CLKED))
+ || ((key->flgs & FLAG_LOCK_N) && (cur_console->status & NLKED)) )
+ state ^= 1;
+
+ /* Check for make/break */
+ action = key->map[state];
+ if (scancode & 0x80) { /* key released */
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
+ case LSH:
+ shfts &= ~1;
+ break;
+ case RSH:
+ shfts &= ~2;
+ break;
+ case LCTR:
+ ctls &= ~1;
+ break;
+ case RCTR:
+ ctls &= ~2;
+ break;
+ case LALT:
+ alts &= ~1;
+ break;
+ case RALT:
+ alts &= ~2;
+ break;
+ case NLK:
+ nlkcnt = 0;
+ break;
+ case CLK:
+ clkcnt = 0;
+ break;
+ case SLK:
+ slkcnt = 0;
+ break;
+ case ASH:
+ agrs = 0;
+ break;
+ case ALK:
+ alkcnt = 0;
+ break;
+ case META:
+ metas = 0;
+ break;
+ }
+ }
+ if (chr && !compose) {
+ action = chr;
+ chr = 0;
+ return(action);
+ }
+ } else {
+ /* key pressed */
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
+ /* LOCKING KEYS */
+ case NLK:
+ if (!nlkcnt) {
+ nlkcnt++;
+ if (cur_console->status & NLKED)
+ cur_console->status &= ~NLKED;
+ else
+ cur_console->status |= NLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case CLK:
+ if (!clkcnt) {
+ clkcnt++;
+ if (cur_console->status & CLKED)
+ cur_console->status &= ~CLKED;
+ else
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case SLK:
+ if (!slkcnt) {
+ slkcnt++;
+ if (cur_console->status & SLKED) {
+ cur_console->status &= ~SLKED;
+ if (cur_console->status & BUFFER_SAVED){
+ int i;
+ u_short *ptr = cur_console->history_save;
+
+ for (i=0; i<cur_console->ysize; i++) {
+ bcopy(ptr,
+ cur_console->scr_buf +
+ (cur_console->xsize*i),
+ cur_console->xsize * sizeof(u_short));
+ ptr += cur_console->xsize;
+ if (ptr + cur_console->xsize >
+ cur_console->history +
+ cur_console->history_size)
+ ptr = cur_console->history;
+ }
+ cur_console->status &= ~BUFFER_SAVED;
+ cur_console->history_head=cur_console->history_save;
+ cur_console->status |= CURSOR_ENABLED;
+ mark_all(cur_console);
+ }
+ scstart(VIRTUAL_TTY(get_scr_num()));
+ }
+ else
+ cur_console->status |= SLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case ALK:
+ if (!alkcnt) {
+ alkcnt++;
+ if (cur_console->status & ALKED)
+ cur_console->status &= ~ALKED;
+ else
+ cur_console->status |= ALKED;
+ update_leds(cur_console->status);
+ }
+ break;
+
+ /* NON-LOCKING KEYS */
+ case NOP:
+ break;
+ case SPSC:
+ /* force activatation/deactivation of the screen saver */
+ accents = 0;
+ if (scrn_blanked <= 0) {
+ run_scrn_saver = TRUE;
+ scrn_time_stamp -= scrn_blank_time;
+ }
+#ifdef SC_SPLASH_SCREEN
+ if (cold) {
+ /*
+ * While devices are being probed, the screen saver need
+ * to be invoked explictly. XXX
+ */
+ if (scrn_blanked > 0) {
+ scsplash_stick(FALSE);
+ stop_scrn_saver(current_saver);
+ } else {
+ if (!ISGRAPHSC(cur_console)) {
+ scsplash_stick(TRUE);
+ scrn_saver(current_saver, TRUE);
+ }
+ }
+ }
+#endif
+ break;
+ case RBT:
+#ifndef SC_DISABLE_REBOOT
+ accents = 0;
+ shutdown_nice();
+#endif
+ break;
+ case SUSP:
+#if NAPM > 0
+ accents = 0;
+ apm_suspend(PMST_SUSPEND);
+#endif
+ break;
+
+ case STBY:
+#if NAPM > 0
+ accents = 0;
+ apm_suspend(PMST_STANDBY);
+#endif
+ break;
+
+ case DBG:
+#ifdef DDB /* try to switch to console 0 */
+ accents = 0;
+ /*
+ * TRY to make sure the screen saver is stopped,
+ * and the screen is updated before switching to
+ * the vty0.
+ */
+ scrn_timer((void *)FALSE);
+ if (cur_console->smode.mode == VT_AUTO &&
+ console[0]->smode.mode == VT_AUTO)
+ switch_scr(cur_console, 0);
+ Debugger("manual escape to debugger");
+#else
+ printf("No debugger in kernel\n");
+#endif
+ break;
+ case LSH:
+ shfts |= 1;
+ break;
+ case RSH:
+ shfts |= 2;
+ break;
+ case LCTR:
+ ctls |= 1;
+ break;
+ case RCTR:
+ ctls |= 2;
+ break;
+ case LALT:
+ alts |= 1;
+ break;
+ case RALT:
+ alts |= 2;
+ break;
+ case ASH:
+ agrs = 1;
+ break;
+ case META:
+ metas = 1;
+ break;
+ case NEXT:
+ {
+ int next, this = get_scr_num();
+ accents = 0;
+ for (next = this+1; next != this; next = (next+1)%MAXCONS) {
+ struct tty *tp = VIRTUAL_TTY(next);
+ if (tp->t_state & TS_ISOPEN) {
+ switch_scr(cur_console, next);
+ break;
+ }
+ }
+ }
+ break;
+ case BTAB:
+ accents = 0;
+ return(BKEY);
+ default:
+ if (action >= F_ACC && action <= L_ACC) {
+ /* turn it into an index */
+ action -= F_ACC - 1;
+ if ((action > accent_map.n_accs)
+ || (accent_map.acc[action - 1].accchar == 0)) {
+ /*
+ * The index is out of range or pointing to an
+ * empty entry.
+ */
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ /*
+ * If the same accent key has been hit twice,
+ * produce the accent char itself.
+ */
+ if (action == accents) {
+ action = accent_map.acc[accents - 1].accchar;
+ accents = 0;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ /* remember the index and wait for the next key stroke */
+ accents = action;
+ break;
+ }
+ if (accents > 0) {
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ if (action >= F_SCR && action <= L_SCR) {
+ switch_scr(cur_console, action - F_SCR);
+ break;
+ }
+ if (action >= F_FN && action <= L_FN)
+ action |= FKEY;
+ return(action);
+ }
+ }
+ else {
+ if (accents) {
+ struct acc_t *acc;
+ int i;
+
+ acc = &accent_map.acc[accents - 1];
+ accents = 0;
+ /*
+ * If the accent key is followed by the space key,
+ * produce the accent char itself.
+ */
+ if (action == ' ') {
+ action = acc->accchar;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ for (i = 0; i < NUM_ACCENTCHARS; ++i) {
+ if (acc->map[i][0] == 0) /* end of the map entry */
+ break;
+ if (acc->map[i][0] == action) {
+ action = acc->map[i][1];
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ }
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ if (metas)
+ action |= MKEY;
+ return(action);
+ }
+ }
+ goto next_code;
+}
+
+int
+scmmap(dev_t dev, int offset, int nprot)
+{
+ if (offset > 0x20000 - PAGE_SIZE)
+ return -1;
+ return i386_btop((VIDEOMEM + offset));
+}
+
+/*
+ * Calculate hardware attributes word using logical attributes mask and
+ * hardware colors
+ */
+
+static int
+mask2attr(struct term_stat *term)
+{
+ int attr, mask = term->attr_mask;
+
+ if (mask & REVERSE_ATTR) {
+ attr = ((mask & FOREGROUND_CHANGED) ?
+ ((term->cur_color & 0xF000) >> 4) :
+ (term->rev_color & 0x0F00)) |
+ ((mask & BACKGROUND_CHANGED) ?
+ ((term->cur_color & 0x0F00) << 4) :
+ (term->rev_color & 0xF000));
+ } else
+ attr = term->cur_color;
+
+ /* XXX: underline mapping for Hercules adapter can be better */
+ if (mask & (BOLD_ATTR | UNDERLINE_ATTR))
+ attr ^= 0x0800;
+ if (mask & BLINK_ATTR)
+ attr ^= 0x8000;
+
+ return attr;
+}
+
+static void
+set_keyboard(int command, int data)
+{
+ int s;
+
+ if (sc_kbdc == NULL)
+ return;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(sc_kbdc, TRUE))
+ return;
+
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(sc_kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(sc_kbdc, FALSE);
+ splx(s);
+ return;
+ }
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
+
+ if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
+ send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
+
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
+ }
+#else
+ splx(s);
+#endif
+ kbdc_lock(sc_kbdc, FALSE);
+}
+
+static void
+update_leds(int which)
+{
+ static u_char xlate_leds[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
+
+ /* replace CAPS led with ALTGR led for ALTGR keyboards */
+ if (key_map.n_keys > ALTGR_OFFSET) {
+ if (which & ALKED)
+ which |= CLKED;
+ else
+ which &= ~CLKED;
+ }
+
+ set_keyboard(KBDC_SET_LEDS, xlate_leds[which & LED_MASK]);
+}
+
+int
+set_mode(scr_stat *scp)
+{
+ video_info_t info;
+ video_adapter_t *adp;
+
+ /* reject unsupported mode */
+ if ((*biosvidsw.get_info)(scp->adp, scp->mode, &info))
+ return 1;
+
+ /* if this vty is not currently showing, do nothing */
+ if (scp != cur_console)
+ return 0;
+
+ /* setup video hardware for the given mode */
+ adp = get_adapter(scp);
+ (*biosvidsw.set_mode)(scp->adp, scp->mode);
+ Crtat = (u_short *)adp->va_window;
+
+ if (!(scp->status & GRAPHICS_MODE)) {
+ /* load appropriate font */
+ if (!(scp->status & PIXEL_MODE)
+ && ISFONTAVAIL(get_adapter(scp)->va_flags)) {
+ if (scp->font_size < 14) {
+ if (fonts_loaded & FONT_8)
+ copy_font(scp, LOAD, 8, font_8);
+ } else if (scp->font_size >= 16) {
+ if (fonts_loaded & FONT_16)
+ copy_font(scp, LOAD, 16, font_16);
+ } else {
+ if (fonts_loaded & FONT_14)
+ copy_font(scp, LOAD, 14, font_14);
+ }
+ /*
+ * FONT KLUDGE:
+ * This is an interim kludge to display correct font.
+ * Always use the font page #0 on the video plane 2.
+ * Somehow we cannot show the font in other font pages on
+ * some video cards... XXX
+ */
+ (*biosvidsw.show_font)(scp->adp, 0);
+ }
+ mark_all(scp);
+ }
+
+ if (scp->status & PIXEL_MODE)
+ generic_bzero((u_char *)(adp->va_window), scp->xpixel*scp->ypixel/8);
+ set_border(scp, scp->border);
+
+ /* move hardware cursor out of the way */
+ (*biosvidsw.set_hw_cursor)(scp->adp, -1, -1);
+
+ return 0;
+}
+
+void
+set_border(scr_stat *scp, int color)
+{
+ u_char *p;
+ int xoff;
+ int yoff;
+ int xlen;
+ int ylen;
+ int i;
+
+ (*biosvidsw.set_border)(scp->adp, color);
+
+ if (scp->status & PIXEL_MODE) {
+ outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
+ outw(GDCIDX, 0x0003); /* data rotate/function select */
+ outw(GDCIDX, 0x0f01); /* set/reset enable */
+ outw(GDCIDX, 0xff08); /* bit mask */
+ outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
+ p = (u_char *)(get_adapter(scp)->va_window);
+ xoff = scp->xoff;
+ yoff = scp->yoff*scp->font_size;
+ xlen = scp->xpixel/8;
+ ylen = scp->ysize*scp->font_size;
+ if (yoff > 0) {
+ generic_bzero(p, xlen*yoff);
+ generic_bzero(p + xlen*(yoff + ylen),
+ xlen*scp->ypixel - xlen*(yoff + ylen));
+ }
+ if (xoff > 0) {
+ for (i = 0; i < ylen; ++i) {
+ generic_bzero(p + xlen*(yoff + i), xoff);
+ generic_bzero(p + xlen*(yoff + i) + xoff + scp->xsize,
+ xlen - xoff - scp->xsize);
+ }
+ }
+ outw(GDCIDX, 0x0000); /* set/reset */
+ outw(GDCIDX, 0x0001); /* set/reset enable */
+ }
+}
+
+void
+copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
+{
+ /*
+ * FONT KLUDGE:
+ * This is an interim kludge to display correct font.
+ * Always use the font page #0 on the video plane 2.
+ * Somehow we cannot show the font in other font pages on
+ * some video cards... XXX
+ */
+ font_loading_in_progress = TRUE;
+ if (operation == LOAD) {
+ (*biosvidsw.load_font)(scp->adp, 0, font_size, buf, 0, 256);
+ if (sc_flags & CHAR_CURSOR)
+ set_destructive_cursor(scp);
+ } else if (operation == SAVE) {
+ (*biosvidsw.save_font)(scp->adp, 0, font_size, buf, 0, 256);
+ }
+ font_loading_in_progress = FALSE;
+}
+
+static void
+set_destructive_cursor(scr_stat *scp)
+{
+ u_char cursor[32];
+ u_char *font_buffer;
+ int font_size;
+ int i;
+
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags)
+ || (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
+ return;
+
+ if (scp->font_size < 14) {
+ font_buffer = font_8;
+ font_size = 8;
+ } else if (scp->font_size >= 16) {
+ font_buffer = font_16;
+ font_size = 16;
+ } else {
+ font_buffer = font_14;
+ font_size = 14;
+ }
+
+ if (scp->status & MOUSE_VISIBLE) {
+ if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR)
+ bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
+ else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 1)
+ bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
+ else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 2)
+ bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
+ else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 3)
+ bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
+ else
+ bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
+ cursor, scp->font_size);
+ }
+ else
+ bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
+ cursor, scp->font_size);
+ for (i=0; i<32; i++)
+ if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
+ (scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
+ cursor[i] |= 0xff;
+#if 1
+ while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
+#endif
+ font_loading_in_progress = TRUE;
+ (*biosvidsw.load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
+ font_loading_in_progress = FALSE;
+}
+
+void
+sc_move_mouse(scr_stat *scp, int x, int y)
+{
+ scp->mouse_xpos = x;
+ scp->mouse_ypos = y;
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + (y / scp->font_size) * scp->xsize + x / 8;
+}
+
+static void
+set_mouse_pos(scr_stat *scp)
+{
+ static int last_xpos = -1, last_ypos = -1;
+
+ if (scp->mouse_xpos < 0)
+ scp->mouse_xpos = 0;
+ if (scp->mouse_ypos < 0)
+ scp->mouse_ypos = 0;
+ if (!ISTEXTSC(scp)) {
+ if (scp->mouse_xpos > scp->xpixel-1)
+ scp->mouse_xpos = scp->xpixel-1;
+ if (scp->mouse_ypos > scp->ypixel-1)
+ scp->mouse_ypos = scp->ypixel-1;
+ return;
+ }
+ if (scp->mouse_xpos > (scp->xsize*8)-1)
+ scp->mouse_xpos = (scp->xsize*8)-1;
+ if (scp->mouse_ypos > (scp->ysize*scp->font_size)-1)
+ scp->mouse_ypos = (scp->ysize*scp->font_size)-1;
+
+ if (scp->mouse_xpos != last_xpos || scp->mouse_ypos != last_ypos) {
+ scp->status |= MOUSE_MOVED;
+
+ scp->mouse_pos = scp->scr_buf +
+ ((scp->mouse_ypos/scp->font_size)*scp->xsize + scp->mouse_xpos/8);
+
+ if ((scp->status & MOUSE_VISIBLE) && (scp->status & MOUSE_CUTTING))
+ mouse_cut(scp);
+ }
+}
+
+#define isspace(c) (((c) & 0xff) == ' ')
+
+static int
+skip_spc_right(scr_stat *scp, u_short *p)
+{
+ int i;
+
+ for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
+ if (!isspace(*p))
+ break;
+ ++p;
+ }
+ return i;
+}
+
+static int
+skip_spc_left(scr_stat *scp, u_short *p)
+{
+ int i;
+
+ for (i = (p-- - scp->scr_buf) % scp->xsize - 1; i >= 0; --i) {
+ if (!isspace(*p))
+ break;
+ --p;
+ }
+ return i;
+}
+
+static void
+mouse_cut(scr_stat *scp)
+{
+ u_short *end;
+ u_short *p;
+ int i = 0;
+ int j = 0;
+
+ scp->mouse_cut_end = (scp->mouse_pos >= scp->mouse_cut_start) ?
+ scp->mouse_pos + 1 : scp->mouse_pos;
+ end = (scp->mouse_cut_start > scp->mouse_cut_end) ?
+ scp->mouse_cut_start : scp->mouse_cut_end;
+ for (p = (scp->mouse_cut_start > scp->mouse_cut_end) ?
+ scp->mouse_cut_end : scp->mouse_cut_start; p < end; ++p) {
+ cut_buffer[i] = *p & 0xff;
+ /* remember the position of the last non-space char */
+ if (!isspace(cut_buffer[i++]))
+ j = i;
+ /* trim trailing blank when crossing lines */
+ if (((p - scp->scr_buf) % scp->xsize) == (scp->xsize - 1)) {
+ cut_buffer[j++] = '\r';
+ i = j;
+ }
+ }
+ cut_buffer[i] = '\0';
+
+ /* scan towards the end of the last line */
+ --p;
+ for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
+ if (!isspace(*p))
+ break;
+ ++p;
+ }
+ /* if there is nothing but blank chars, trim them, but mark towards eol */
+ if (i >= scp->xsize) {
+ if (scp->mouse_cut_start > scp->mouse_cut_end)
+ scp->mouse_cut_start = p;
+ else
+ scp->mouse_cut_end = p;
+ cut_buffer[j++] = '\r';
+ cut_buffer[j] = '\0';
+ }
+
+ mark_for_update(scp, scp->mouse_cut_start - scp->scr_buf);
+ mark_for_update(scp, scp->mouse_cut_end - scp->scr_buf);
+}
+
+static void
+mouse_cut_start(scr_stat *scp)
+{
+ int i;
+
+ if (scp->status & MOUSE_VISIBLE) {
+ if (scp->mouse_pos == scp->mouse_cut_start &&
+ scp->mouse_cut_start == scp->mouse_cut_end - 1) {
+ cut_buffer[0] = '\0';
+ remove_cutmarking(scp);
+ } else if (skip_spc_right(scp, scp->mouse_pos) >= scp->xsize) {
+ /* if the pointer is on trailing blank chars, mark towards eol */
+ i = skip_spc_left(scp, scp->mouse_pos) + 1;
+ scp->mouse_cut_start = scp->scr_buf +
+ ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize + i;
+ scp->mouse_cut_end = scp->scr_buf +
+ ((scp->mouse_pos - scp->scr_buf) / scp->xsize + 1) * scp->xsize;
+ cut_buffer[0] = '\r';
+ cut_buffer[1] = '\0';
+ scp->status |= MOUSE_CUTTING;
+ } else {
+ scp->mouse_cut_start = scp->mouse_pos;
+ scp->mouse_cut_end = scp->mouse_cut_start + 1;
+ cut_buffer[0] = *scp->mouse_cut_start & 0xff;
+ cut_buffer[1] = '\0';
+ scp->status |= MOUSE_CUTTING;
+ }
+ mark_all(scp);
+ /* delete all other screens cut markings */
+ for (i=0; i<MAXCONS; i++) {
+ if (console[i] == NULL || console[i] == scp)
+ continue;
+ remove_cutmarking(console[i]);
+ }
+ }
+}
+
+static void
+mouse_cut_end(scr_stat *scp)
+{
+ if (scp->status & MOUSE_VISIBLE) {
+ scp->status &= ~MOUSE_CUTTING;
+ }
+}
+
+static void
+mouse_cut_word(scr_stat *scp)
+{
+ u_short *p;
+ u_short *sol;
+ u_short *eol;
+ int i;
+
+ /*
+ * Because we don't have locale information in the kernel,
+ * we only distinguish space char and non-space chars. Punctuation
+ * chars, symbols and other regular chars are all treated alike.
+ */
+ if (scp->status & MOUSE_VISIBLE) {
+ sol = scp->scr_buf
+ + ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
+ eol = sol + scp->xsize;
+ if (isspace(*scp->mouse_pos)) {
+ for (p = scp->mouse_pos; p >= sol; --p)
+ if (!isspace(*p))
+ break;
+ scp->mouse_cut_start = ++p;
+ for (p = scp->mouse_pos; p < eol; ++p)
+ if (!isspace(*p))
+ break;
+ scp->mouse_cut_end = p;
+ } else {
+ for (p = scp->mouse_pos; p >= sol; --p)
+ if (isspace(*p))
+ break;
+ scp->mouse_cut_start = ++p;
+ for (p = scp->mouse_pos; p < eol; ++p)
+ if (isspace(*p))
+ break;
+ scp->mouse_cut_end = p;
+ }
+ for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
+ cut_buffer[i++] = *p & 0xff;
+ cut_buffer[i] = '\0';
+ scp->status |= MOUSE_CUTTING;
+ }
+}
+
+static void
+mouse_cut_line(scr_stat *scp)
+{
+ u_short *p;
+ int i;
+
+ if (scp->status & MOUSE_VISIBLE) {
+ scp->mouse_cut_start = scp->scr_buf
+ + ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
+ scp->mouse_cut_end = scp->mouse_cut_start + scp->xsize;
+ for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
+ cut_buffer[i++] = *p & 0xff;
+ cut_buffer[i++] = '\r';
+ cut_buffer[i] = '\0';
+ scp->status |= MOUSE_CUTTING;
+ }
+}
+
+static void
+mouse_cut_extend(scr_stat *scp)
+{
+ if ((scp->status & MOUSE_VISIBLE) && !(scp->status & MOUSE_CUTTING)
+ && (scp->mouse_cut_start != NULL)) {
+ mouse_cut(scp);
+ scp->status |= MOUSE_CUTTING;
+ }
+}
+
+static void
+mouse_paste(scr_stat *scp)
+{
+ if (scp->status & MOUSE_VISIBLE) {
+ struct tty *tp;
+ u_char *ptr = cut_buffer;
+
+ tp = VIRTUAL_TTY(get_scr_num());
+ while (*ptr)
+ (*linesw[tp->t_line].l_rint)(scr_rmap[*ptr++], tp);
+ }
+}
+
+static void
+draw_mouse_image(scr_stat *scp)
+{
+ u_short buffer[32];
+ u_short xoffset, yoffset;
+ u_short *crt_pos = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->mouse_pos - scp->scr_buf);
+ u_char *font_buffer;
+ int font_size;
+ int i;
+
+ if (scp->font_size < 14) {
+ font_buffer = font_8;
+ font_size = 8;
+ } else if (scp->font_size >= 16) {
+ font_buffer = font_16;
+ font_size = 16;
+ } else {
+ font_buffer = font_14;
+ font_size = 14;
+ }
+
+ xoffset = scp->mouse_xpos % 8;
+ yoffset = scp->mouse_ypos % scp->font_size;
+
+ /* prepare mousepointer char's bitmaps */
+ bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
+ &scp->mouse_cursor[0], font_size);
+ bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
+ &scp->mouse_cursor[32], font_size);
+ bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
+ &scp->mouse_cursor[64], font_size);
+ bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
+ &scp->mouse_cursor[96], font_size);
+ for (i=0; i<font_size; i++) {
+ buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];
+ buffer[i+font_size]=scp->mouse_cursor[i+64]<<8|scp->mouse_cursor[i+96];
+ }
+
+ /* now and-or in the mousepointer image */
+ for (i=0; i<16; i++) {
+ buffer[i+yoffset] =
+ ( buffer[i+yoffset] & ~(mouse_and_mask[i] >> xoffset))
+ | (mouse_or_mask[i] >> xoffset);
+ }
+ for (i=0; i<font_size; i++) {
+ scp->mouse_cursor[i] = (buffer[i] & 0xff00) >> 8;
+ scp->mouse_cursor[i+32] = buffer[i] & 0xff;
+ scp->mouse_cursor[i+64] = (buffer[i+font_size] & 0xff00) >> 8;
+ scp->mouse_cursor[i+96] = buffer[i+font_size] & 0xff;
+ }
+
+ scp->mouse_oldpos = scp->mouse_pos;
+
+#if 1
+ /* wait for vertical retrace to avoid jitter on some videocards */
+ while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
+#endif
+ font_loading_in_progress = TRUE;
+ (*biosvidsw.load_font)(scp->adp, 0, 32, scp->mouse_cursor,
+ SC_MOUSE_CHAR, 4);
+ font_loading_in_progress = FALSE;
+
+ *(crt_pos) = (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR;
+ *(crt_pos+scp->xsize) =
+ (*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2);
+ if (scp->mouse_xpos < (scp->xsize-1)*8) {
+ *(crt_pos + 1) = (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1);
+ *(crt_pos+scp->xsize + 1) =
+ (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3);
+ }
+ mark_for_update(scp, scp->mouse_pos - scp->scr_buf);
+ mark_for_update(scp, scp->mouse_pos + scp->xsize + 1 - scp->scr_buf);
+}
+
+static void
+remove_mouse_image(scr_stat *scp)
+{
+ u_short *crt_pos;
+
+ if (!ISTEXTSC(scp))
+ return;
+
+ crt_pos = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->mouse_oldpos - scp->scr_buf);
+ *(crt_pos) = *(scp->mouse_oldpos);
+ *(crt_pos+1) = *(scp->mouse_oldpos+1);
+ *(crt_pos+scp->xsize) = *(scp->mouse_oldpos+scp->xsize);
+ *(crt_pos+scp->xsize+1) = *(scp->mouse_oldpos+scp->xsize+1);
+ mark_for_update(scp, scp->mouse_oldpos - scp->scr_buf);
+ mark_for_update(scp, scp->mouse_oldpos + scp->xsize + 1 - scp->scr_buf);
+}
+
+static void
+draw_cutmarking(scr_stat *scp)
+{
+ u_short *crt_pos;
+ u_short *ptr;
+ u_short och, nch;
+
+ crt_pos = (u_short *)(get_adapter(scp)->va_window);
+ for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
+ nch = och = *(crt_pos + (ptr - scp->scr_buf));
+ /* are we outside the selected area ? */
+ if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
+ scp->mouse_cut_end : scp->mouse_cut_start) ||
+ ptr >= (scp->mouse_cut_start > scp->mouse_cut_end ?
+ scp->mouse_cut_start : scp->mouse_cut_end)) {
+ if (ptr != scp->cursor_pos)
+ nch = (och & 0xff) | (*ptr & 0xff00);
+ }
+ else {
+ /* are we clear of the cursor image ? */
+ if (ptr != scp->cursor_pos)
+ nch = (och & 0x88ff) | (*ptr & 0x7000)>>4 | (*ptr & 0x0700)<<4;
+ else {
+ if (sc_flags & CHAR_CURSOR)
+ nch = (och & 0x88ff)|(*ptr & 0x7000)>>4|(*ptr & 0x0700)<<4;
+ else
+ if (!(sc_flags & BLINK_CURSOR))
+ nch = (och & 0xff) | (*ptr & 0xff00);
+ }
+ }
+ if (nch != och)
+ *(crt_pos + (ptr - scp->scr_buf)) = nch;
+ }
+}
+
+static void
+remove_cutmarking(scr_stat *scp)
+{
+ scp->mouse_cut_start = scp->mouse_cut_end = NULL;
+ scp->status &= ~MOUSE_CUTTING;
+ mark_all(scp);
+}
+
+static void
+do_bell(scr_stat *scp, int pitch, int duration)
+{
+ if (cold || shutdown_in_progress)
+ return;
+
+ if (scp != cur_console && (sc_flags & QUIET_BELL))
+ return;
+
+ if (sc_flags & VISUAL_BELL) {
+ if (blink_in_progress)
+ return;
+ blink_in_progress = 4;
+ if (scp != cur_console)
+ blink_in_progress += 2;
+ blink_screen(cur_console);
+ } else {
+ if (scp != cur_console)
+ pitch *= 2;
+ sysbeep(pitch, duration);
+ }
+}
+
+static void
+blink_screen(void *arg)
+{
+ scr_stat *scp = arg;
+
+ if (!ISTEXTSC(scp) || (blink_in_progress <= 1)) {
+ blink_in_progress = FALSE;
+ mark_all(scp);
+ if (delayed_next_scr)
+ switch_scr(scp, delayed_next_scr - 1);
+ }
+ else {
+ if (blink_in_progress & 1)
+ fillw(kernel_default.std_color | scr_map[0x20],
+ (u_short *)(get_adapter(scp)->va_window),
+ scp->xsize * scp->ysize);
+ else
+ fillw(kernel_default.rev_color | scr_map[0x20],
+ (u_short *)(get_adapter(scp)->va_window),
+ scp->xsize * scp->ysize);
+ blink_in_progress--;
+ timeout(blink_screen, scp, hz / 10);
+ }
+}
+
+void
+sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
+{
+ u_char *font;
+ u_char volatile *d;
+ u_char *e;
+ u_char *f;
+ int font_size;
+ int line_length;
+ int xsize;
+ u_short bg;
+ int i, j;
+ u_char c;
+
+ if (ISTEXTSC(scp)) {
+ generic_bcopy(p + from, (u_short *)(get_adapter(scp)->va_window) + from,
+ (to - from + 1)*sizeof(u_short));
+ } else /* if ISPIXELSC(scp) */ {
+ if (mark)
+ mark = 255;
+ font_size = scp->font_size;
+ if (font_size < 14)
+ font = font_8;
+ else if (font_size >= 16)
+ font = font_16;
+ else
+ font = font_14;
+ line_length = scp->xpixel/8;
+ xsize = scp->xsize;
+ d = (u_char *)(get_adapter(scp)->va_window)
+ + scp->xoff + scp->yoff*font_size*line_length
+ + (from%xsize) + font_size*line_length*(from/xsize);
+
+ outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
+ outw(GDCIDX, 0x0003); /* data rotate/function select */
+ outw(GDCIDX, 0x0f01); /* set/reset enable */
+ bg = -1;
+ for (i = from ; i <= to ; i++) {
+ /* set background color in EGA/VGA latch */
+ if (bg != (p[i] & 0xf000)) {
+ bg = (p[i] & 0xf000);
+ outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
+ outw(GDCIDX, 0xff08); /* bit mask */
+ *d = 0;
+ c = *d; /* set the background color in the latch */
+ }
+ /* foreground color */
+ outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
+ e = (u_char *)d;
+ f = &font[(p[i] & 0x00ff)*font_size];
+ for (j = 0 ; j < font_size; j++, f++) {
+ outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
+ *e = 0;
+ e += line_length;
+ }
+ d++;
+ if ((i % xsize) == xsize - 1)
+ d += scp->xoff*2 + (font_size - 1)*line_length;
+ }
+ outw(GDCIDX, 0x0000); /* set/reset */
+ outw(GDCIDX, 0x0001); /* set/reset enable */
+ outw(GDCIDX, 0xff08); /* bit mask */
+
+#if 0 /* VGA only */
+ outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
+ outw(GDCIDX, 0x0003); /* data rotate/function select */
+ outw(GDCIDX, 0x0f01); /* set/reset enable */
+ outw(GDCIDX, 0xff08); /* bit mask */
+ bg = -1;
+ for (i = from ; i <= to ; i++) {
+ /* set background color in EGA/VGA latch */
+ if (bg != (p[i] & 0xf000)) {
+ bg = (p[i] & 0xf000);
+ outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
+ outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
+ *d = 0;
+ c = *d; /* set the background color in the latch */
+ outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
+ }
+ /* foreground color */
+ outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
+ e = (u_char *)d;
+ f = &font[(p[i] & 0x00ff)*font_size];
+ for (j = 0 ; j < font_size; j++, f++) {
+ *e = *f^mark;
+ e += line_length;
+ }
+ d++;
+ if ((i % xsize) == xsize - 1)
+ d += scp->xoff*2 + (font_size - 1)*line_length;
+ }
+ outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
+ outw(GDCIDX, 0x0000); /* set/reset */
+ outw(GDCIDX, 0x0001); /* set/reset enable */
+#endif /* 0 */
+ }
+}
+
+#ifdef SC_SPLASH_SCREEN
+
+static void
+scsplash_init(scr_stat *scp)
+{
+ video_info_t info;
+
+ if (scsplash_load(scp) == 0 && add_scrn_saver(scsplash_saver) == 0) {
+ default_saver = scsplash_saver;
+ scrn_blank_time = DEFAULT_BLANKTIME;
+ run_scrn_saver = TRUE;
+ if (!(boothowto & (RB_VERBOSE | RB_CONFIG))) {
+ scsplash_stick(TRUE);
+ scsplash_saver(TRUE);
+ }
+ }
+}
+
+static void
+scsplash_term(scr_stat *scp)
+{
+ default_saver = none_saver;
+ scsplash_stick(FALSE);
+ remove_scrn_saver(scsplash_saver);
+ scsplash_unload(scp);
+}
+
+static void
+scsplash_saver(int show)
+{
+ if (show)
+ scsplash(TRUE);
+ else if (!sticky_splash)
+ scsplash(FALSE);
+}
+
+#endif /* SC_SPLASH_SCREEN */
+
+#endif /* NSC */
diff --git a/sys/i386/isa/syscons.h b/sys/i386/isa/syscons.h
new file mode 100644
index 000000000000..0298cbbf2f40
--- /dev/null
+++ b/sys/i386/isa/syscons.h
@@ -0,0 +1,245 @@
+/*-
+ * Copyright (c) 1995-1998 Søren Schmidt
+ * 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, immediately at the beginning of the file.
+ * 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.
+ *
+ * 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.
+ *
+ * $Id: syscons.h,v 1.43 1998/09/29 02:00:57 ache Exp $
+ */
+
+#ifndef _I386_ISA_SYSCONS_H_
+#define _I386_ISA_SYSCONS_H_
+
+/* vm things */
+#define ISMAPPED(pa, width) \
+ (((pa) <= (u_long)0x1000 - (width)) \
+ || ((pa) >= 0xa0000 && (pa) <= 0x100000 - (width)))
+#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
+
+/* printable chars */
+#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
+ || (ch) < 0x07)
+
+/* macros for "intelligent" screen update */
+#define mark_for_update(scp, x) {\
+ if ((x) < scp->start) scp->start = (x);\
+ else if ((x) > scp->end) scp->end = (x);\
+ }
+#define mark_all(scp) {\
+ scp->start = 0;\
+ scp->end = scp->xsize * scp->ysize - 1;\
+ }
+
+/* status flags */
+#define LOCK_KEY_MASK 0x0000F
+#define LED_MASK 0x00007
+#define UNKNOWN_MODE 0x00010
+#define KBD_RAW_MODE 0x00020
+#define KBD_CODE_MODE 0x00040
+#define SWITCH_WAIT_REL 0x00080
+#define SWITCH_WAIT_ACQ 0x00100
+#define BUFFER_SAVED 0x00200
+#define CURSOR_ENABLED 0x00400
+#define MOUSE_ENABLED 0x00800
+#define MOUSE_MOVED 0x01000
+#define MOUSE_CUTTING 0x02000
+#define MOUSE_VISIBLE 0x04000
+#define GRAPHICS_MODE 0x08000
+#define PIXEL_MODE 0x10000
+#define SAVER_RUNNING 0x20000
+
+/* configuration flags */
+#define VISUAL_BELL 0x00001
+#define BLINK_CURSOR 0x00002
+#define CHAR_CURSOR 0x00004
+#define DETECT_KBD 0x00008
+#define XT_KEYBD 0x00010
+#define KBD_NORESET 0x00020
+#define QUIET_BELL 0x00040
+#define VESA800X600 0x00080
+
+/* attribute flags */
+#define NORMAL_ATTR 0x00
+#define BLINK_ATTR 0x01
+#define BOLD_ATTR 0x02
+#define UNDERLINE_ATTR 0x04
+#define REVERSE_ATTR 0x08
+#define FOREGROUND_CHANGED 0x10
+#define BACKGROUND_CHANGED 0x20
+
+/* misc defines */
+#define FALSE 0
+#define TRUE 1
+#define MAX_ESC_PAR 5
+#define LOAD 1
+#define SAVE 0
+#define COL 80
+#define ROW 25
+#define BELL_DURATION 5
+#define BELL_PITCH 800
+#define CONSOLE_BUFSIZE 1024
+#define PCBURST 128
+#define FONT_NONE 1
+#define FONT_8 2
+#define FONT_14 4
+#define FONT_16 8
+
+/* special characters */
+#define cntlc 0x03
+#define cntld 0x04
+#define bs 0x08
+#define lf 0x0a
+#define cr 0x0d
+#define del 0x7f
+
+#define DEAD_CHAR 0x07 /* char used for cursor */
+
+typedef struct term_stat {
+ int esc; /* processing escape sequence */
+ int num_param; /* # of parameters to ESC */
+ int last_param; /* last parameter # */
+ int param[MAX_ESC_PAR]; /* contains ESC parameters */
+ int cur_attr; /* current hardware attr word */
+ int attr_mask; /* current logical attr mask */
+ int cur_color; /* current hardware color */
+ int std_color; /* normal hardware color */
+ int rev_color; /* reverse hardware color */
+} term_stat;
+
+typedef struct scr_stat {
+ int adp; /* video adapter index */
+ u_short *scr_buf; /* buffer when off screen */
+ int xpos; /* current X position */
+ int ypos; /* current Y position */
+ int saved_xpos; /* saved X position */
+ int saved_ypos; /* saved Y position */
+ int xsize; /* X text size */
+ int ysize; /* Y text size */
+ int xpixel; /* X graphics size */
+ int ypixel; /* Y graphics size */
+ int xoff; /* X offset in pixel mode */
+ int yoff; /* Y offset in pixel mode */
+ int font_size; /* fontsize in Y direction */
+ int start; /* modified area start */
+ int end; /* modified area end */
+ term_stat term; /* terminal emulation stuff */
+ int status; /* status (bitfield) */
+ u_short *cursor_pos; /* cursor buffer position */
+ u_short *cursor_oldpos; /* cursor old buffer position */
+ u_short cursor_saveunder; /* saved chars under cursor */
+ char cursor_start; /* cursor start line # */
+ char cursor_end; /* cursor end line # */
+ u_short *mouse_pos; /* mouse buffer position */
+ u_short *mouse_oldpos; /* mouse old buffer position */
+ short mouse_xpos; /* mouse x coordinate */
+ short mouse_ypos; /* mouse y coordinate */
+ short mouse_buttons; /* mouse buttons */
+ u_char mouse_cursor[128]; /* mouse cursor bitmap store */
+ u_short *mouse_cut_start; /* mouse cut start pos */
+ u_short *mouse_cut_end; /* mouse cut end pos */
+ struct proc *mouse_proc; /* proc* of controlling proc */
+ pid_t mouse_pid; /* pid of controlling proc */
+ int mouse_signal; /* signal # to report with */
+ u_short bell_duration;
+ u_short bell_pitch;
+ u_char border; /* border color */
+ int initial_mode; /* initial mode */
+ int mode; /* mode */
+ pid_t pid; /* pid of controlling proc */
+ struct proc *proc; /* proc* of controlling proc */
+ struct vt_mode smode; /* switch mode */
+ u_short *history; /* circular history buffer */
+ u_short *history_head; /* current head position */
+ u_short *history_pos; /* position shown on screen */
+ u_short *history_save; /* save area index */
+ int history_size; /* size of history buffer */
+ struct apmhook r_hook; /* reconfiguration support */
+#ifdef SC_SPLASH_SCREEN
+ int splash_save_mode; /* saved mode for splash screen */
+ int splash_save_status; /* saved status for splash screen */
+#endif
+} scr_stat;
+
+typedef struct default_attr {
+ int std_color; /* normal hardware color */
+ int rev_color; /* reverse hardware color */
+} default_attr;
+
+
+#define ISTEXTSC(scp) (!((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE)))
+#define ISGRAPHSC(scp) (((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE)))
+#define ISPIXELSC(scp) (((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\
+ == PIXEL_MODE)
+#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
+
+#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
+#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
+#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
+
+/* misc prototypes used by different syscons related LKM's */
+
+/* syscons.c */
+extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data, int flag,
+ struct proc *p);
+
+int set_mode(scr_stat *scp);
+scr_stat *sc_get_scr_stat(dev_t dev);
+
+void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
+void set_border(scr_stat *scp, int color);
+#define save_palette(scp, pal) (*biosvidsw.save_palette)((scp)->adp, pal)
+#define load_palette(scp, pal) (*biosvidsw.load_palette)((scp)->adp, pal)
+#define get_adapter(scp) (*biosvidsw.adapter)((scp)->adp)
+
+int add_scrn_saver(void (*this)(int));
+int remove_scrn_saver(void (*this)(int));
+
+void sc_clear_screen(scr_stat *scp);
+void sc_move_mouse(scr_stat *scp, int x, int y);
+int sc_clean_up(scr_stat *scp);
+void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear);
+void sc_alloc_cut_buffer(scr_stat *scp, int wait);
+void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait);
+struct tty *scdevtotty(dev_t dev);
+
+/* scvidctl.c */
+int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode,
+ int xsize, int ysize, int fontsize);
+int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode);
+int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
+ int xsize, int ysize, int fontsize);
+int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
+ struct proc *p);
+
+#ifdef SC_SPLASH_SCREEN
+/* splash.c */
+void scsplash(int);
+int scsplash_load(scr_stat *scp);
+int scsplash_unload(scr_stat *scp);
+#endif
+
+#endif /* !_I386_ISA_SYSCONS_H_ */
diff --git a/sys/i386/isa/syscons_isa.c b/sys/i386/isa/syscons_isa.c
deleted file mode 100644
index e96542fba603..000000000000
--- a/sys/i386/isa/syscons_isa.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id:$
- */
-
-#include "sc.h"
-#include "opt_syscons.h"
-
-#if NSC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-
-#include <machine/console.h>
-#include <machine/apm_bios.h>
-
-#include <dev/syscons/syscons.h>
-
-#include <i386/isa/isa_device.h>
-
-static int scprobe(struct isa_device *dev);
-static int scattach(struct isa_device *dev);
-
-struct isa_driver scdriver = {
- scprobe,
- scattach,
- "sc",
- 1
-};
-
-static int
-scprobe(struct isa_device *dev)
-{
- int error;
-
- error = sc_probe_unit(dev->id_unit, dev->id_flags);
- return ((error == 0) ? -1 : 0);
-}
-
-static int
-scattach(struct isa_device *dev)
-{
- int error;
-
- error = sc_attach_unit(dev->id_unit, dev->id_flags);
- return ((error == 0) ? 0 : 1);
-}
-
-#endif /* NSC > 0 */
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index ce98e65dfebe..5c2a661ee810 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -274,7 +274,6 @@ static void twdelayn(int n);
static void twsetuptimes(int *a);
static int wait_for_zero(struct tw_sc *sc);
static int twputpkt(struct tw_sc *sc, u_char *p);
-static ointhand2_t twintr;
static int twgetbytes(struct tw_sc *sc, u_char *p, int cnt);
static timeout_t twabortrcv;
static int twsend(struct tw_sc *sc, int h, int k, int cnt);
@@ -392,7 +391,6 @@ static int twattach(idp)
struct tw_sc *sc;
int unit;
- idp->id_ointr = twintr;
sc = &tw_sc[unit = idp->id_unit];
sc->sc_port = idp->id_iobase;
sc->sc_state = 0;
@@ -416,6 +414,7 @@ int twopen(dev, flag, mode, p)
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
+ int port;
s = spltty();
if(sc->sc_state == 0) {
@@ -436,6 +435,7 @@ int twclose(dev, flag, mode, p)
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
+ int port = sc->sc_port;
s = spltty();
sc->sc_state = 0;
@@ -918,7 +918,7 @@ tw_is_within(int value, int expected, int tolerance)
* reconstruct the transmission without having to poll.
*/
-static void twintr(unit)
+void twintr(unit)
int unit;
{
struct tw_sc *sc = &tw_sc[unit];
diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c
new file mode 100644
index 000000000000..8d01bef01fe2
--- /dev/null
+++ b/sys/i386/isa/ultra14f.c
@@ -0,0 +1,1362 @@
+/*
+ * Ported for use with the UltraStor 14f by Gary Close (gclose@wvnvms.wvnet.edu)
+ * Slight fixes to timeouts to run with the 34F
+ * Thanks to Julian Elischer for advice and help with this port.
+ *
+ * Written by Julian Elischer (julian@tfs.com)
+ * for TRW Financial Systems for use under the MACH(2.5) operating system.
+ *
+ * TRW Financial Systems, in accordance with their agreement with Carnegie
+ * Mellon University, makes this software available to CMU to distribute
+ * or use in any manner that they see fit as long as this message is kept with
+ * the software. For this reason TFS also grants any other persons or
+ * organisations permission to use or modify this software.
+ *
+ * TFS supplies this software to be publicly redistributed
+ * on the understanding that TFS is not responsible for the correct
+ * functioning of this software in any circumstances.
+ *
+ * commenced: Sun Sep 27 18:14:01 PDT 1992
+ * slight mod to make work with 34F as well: Wed Jun 2 18:05:48 WST 1993
+ *
+ * today: Fri Jun 2 17:21:03 EST 1994
+ * added 24F support ++sg
+ *
+ * $Id: ultra14f.c,v 1.60 1998/06/08 09:47:37 bde Exp $
+ */
+
+#ifdef KERNEL /* don't laugh.. this compiles to a program too.. look */
+#include "uha.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+#endif /*KERNEL */
+#include <scsi/scsiconf.h>
+#include <scsi/scsi_debug.h>
+
+/* */
+
+#ifndef KERNEL
+#define NUHA 1
+#endif /*KERNEL */
+
+typedef struct {
+ unsigned char addr[4];
+} physaddr;
+typedef struct {
+ unsigned char len[4];
+} physlen;
+
+#define KVTOPHYS(x) vtophys(x)
+
+#define UHA_MSCP_MAX 32 /* store up to 32MSCPs at any one time
+ * MAX = ?
+ */
+#define MSCP_HASH_SIZE 32 /* when we have a physical addr. for
+ * a mscp and need to find the mscp in
+ * space, look it up in the hash table
+ */
+#define MSCP_HASH_SHIFT 9 /* only hash on multiples of 512 */
+#define MSCP_HASH(x) ((((long int)(x))>>MSCP_HASH_SHIFT) % MSCP_HASH_SIZE)
+
+#define UHA_NSEG 33 /* number of dma segments supported */
+
+/************************** board definitions *******************************/
+struct uha_reg
+{
+ int id; /* product id reg */
+ int type; /* product type reg */
+ int ectl; /* EISA expansion control bits */
+ int config; /* configuration bits */
+ int lmask; /* local doorbell mask reg */
+ int lint; /* local doorbell int/stat reg */
+ int smask; /* system doorbell mask reg */
+ int sint; /* system doorbell int/stat reg */
+ int ogmcmd; /* outgoing mail command */
+ int ogmptr; /* outgoing mail ptr */
+ int icmcmd; /* incoming mail command */
+ int icmptr; /* incoming mail ptr */
+};
+
+struct uha_bits
+{
+ /* uha_lint (read) */
+ unsigned char ldip;
+
+ /* uha_lint (write) */
+ unsigned char adrst;
+ unsigned char sbrst;
+ unsigned char asrst;
+ unsigned char abort;
+ unsigned char ogmint;
+
+ /* uha_sint (read) */
+ unsigned char sintp;
+ unsigned char abort_succ;
+ unsigned char abort_fail;
+
+ /* uha_sint (write) */
+ unsigned char abort_ack;
+ unsigned char icm_ack;
+};
+
+
+/*
+ * UHA_LINT bits (read)
+ */
+
+#define UHA_LDIP 0x80 /* local doorbell int pending */
+#define U24_LDIP 0x02
+
+/*
+ * UHA_LINT bits (write)
+ */
+
+#define UHA_ADRST 0x40 /* adapter soft reset */
+#define UHA_SBRST 0x20 /* scsi bus reset */
+#define UHA_ASRST 0x60 /* adapter and scsi reset */
+#define UHA_ABORT 0x10 /* abort MSCP */
+#define UHA_OGMINT 0x01 /* tell adapter to get mail */
+#define U24_SBRST 0x40 /* scsi bus reset */
+#define U24_ADRST 0x80 /* adapter soft reset */
+#define U24_ASRST 0xc0 /* adapter and scsi reset */
+#define U24_ABORT 0x10 /* same? */
+#define U24_OGMINT 0x02 /* enable OGM interrupt */
+
+/*
+ * UHA_SMASK bits (read)
+ */
+
+#define UHA_SINTEN 0x80 /* system doorbell interupt Enabled */
+#define UHA_ABORT_COMPLETE_EN 0x10 /* abort MSCP command complete int Enabled */
+#define UHA_ICM_ENABLED 0x01 /* ICM interrupt enabled */
+
+/*
+ * UHA_SMASK bits (write)
+ */
+
+#define UHA_ENSINT 0x80 /* enable system doorbell interrupt */
+#define UHA_EN_ABORT_COMPLETE 0x10 /* enable abort MSCP complete int */
+#define UHA_ENICM 0x01 /* enable ICM interrupt */
+
+/*
+ * UHA_SINT bits (read)
+ */
+
+#define UHA_SINTP 0x80 /* system doorbell int pending */
+#define UHA_ABORT_SUCC 0x10 /* abort MSCP successful */
+#define UHA_ABORT_FAIL 0x18 /* abort MSCP failed */
+#define U24_SINTP 0x02 /* system doorbell int pending */
+#define U24_ABORT_SUCC 0x10 /* same? */
+#define U24_ABORT_FAIL 0x18 /* same? */
+
+/*
+ * UHA_SINT bits (write)
+ */
+
+#define UHA_ABORT_ACK 0x18 /* acknowledge status and clear */
+#define UHA_ICM_ACK 0x01 /* acknowledge ICM and clear */
+#define U24_ABORT_ACK 0x18 /* same */
+#define U24_ICM_ACK 0x02 /* 24F acknowledge ICM and clear */
+
+/*
+ * UHA_CONF1 bits (read only)
+ */
+
+#define UHA_DMA_CH5 0x00 /* DMA channel 5 */
+#define UHA_DMA_CH6 0x40 /* 6 */
+#define UHA_DMA_CH7 0x80 /* 7 */
+#define UHA_IRQ15 0x00 /* IRQ 15 */
+#define UHA_IRQ14 0x10 /* 14 */
+#define UHA_IRQ11 0x20 /* 11 */
+#define UHA_IRQ10 0x30 /* 10 */
+
+#define EISA_CONFIG 0x0c80 /* Configuration base port */
+#define EISA_DISABLE 0x01 /* EISA disable bit */
+
+/*
+ * ha_status error codes
+ */
+
+#define UHA_NO_ERR 0x00 /* No error supposedly */
+#define UHA_SBUS_ABORT_ERR 0x84 /* scsi bus abort error */
+#define UHA_SBUS_TIMEOUT 0x91 /* scsi bus selection timeout */
+#define UHA_SBUS_OVER_UNDER 0x92 /* scsi bus over/underrun */
+#define UHA_BAD_SCSI_CMD 0x96 /* illegal scsi command */
+#define UHA_AUTO_SENSE_ERR 0x9b /* auto request sense err */
+#define UHA_SBUS_RES_ERR 0xa3 /* scsi bus reset error */
+#define UHA_BAD_SG_LIST 0xff /* invalid scatter gath list */
+
+struct uha_dma_seg {
+ physaddr addr;
+ physlen len;
+};
+
+struct mscp {
+ unsigned int opcode:3;
+#define U14_HAC 0x01 /* host adapter command */
+#define U14_TSP 0x02 /* target scsi pass through command */
+#define U14_SDR 0x04 /* scsi device reset */
+ unsigned int xdir:2; /* xfer direction */
+#define U14_SDET 0x00 /* determined by scsi command */
+#define U14_SDIN 0x01 /* scsi data in */
+#define U14_SDOUT 0x02 /* scsi data out */
+#define U14_NODATA 0x03 /* no data xfer */
+ unsigned int dcn:1; /* disable disconnect for this command */
+ unsigned int ca:1; /* cache control */
+ unsigned int sgth:1; /* scatter gather flag */
+ unsigned int target:3;
+ unsigned int chan:2; /* scsi channel (always 0 for 14f) */
+ unsigned int lun:3;
+ physaddr data;
+ physlen datalen;
+ physaddr link;
+ unsigned char link_id;
+ unsigned char sg_num; /*number of scat gath segs */
+ /*in s-g list if sg flag is */
+ /*set. starts at 1, 8bytes per */
+ unsigned char senselen;
+ unsigned char cdblen;
+ unsigned char cdb[12];
+ unsigned char ha_status;
+ unsigned char targ_status;
+ physaddr sense; /* if 0 no auto sense */
+ /*-----------------end of hardware supported fields----------------*/
+ struct mscp *next; /* in free list */
+ struct scsi_xfer *xs; /* the scsi_xfer for this cmd */
+ int flags;
+#define MSCP_FREE 0
+#define MSCP_ACTIVE 1
+#define MSCP_ABORTED 2
+ struct uha_dma_seg uha_dma[UHA_NSEG];
+ struct scsi_sense_data mscp_sense;
+ struct mscp *nexthash;
+ long int hashkey;
+};
+
+static struct uha_data {
+ int flags;
+#define UHA_INIT 0x01
+#define UHA_24F 0x02
+ int baseport;
+ struct mscp *mscphash[MSCP_HASH_SIZE];
+ struct mscp *free_mscp;
+ int unit;
+ int our_id; /* our scsi id */
+ int vect;
+ int dma;
+ int nummscps;
+ struct scsi_link sc_link;
+ struct uha_reg *ur;
+ struct uha_bits *ub;
+} *uhadata[NUHA];
+
+static int uha_abort __P((struct uha_data *uha, struct mscp *mscp));
+static u_int32_t uha_adapter_info __P((int unit));
+static int uha_attach __P((struct isa_device *dev));
+static void uha_done __P((struct uha_data *uha, struct mscp *mscp));
+static void uha_free_mscp __P((struct uha_data *uha, struct mscp *mscp,
+ int flags));
+static struct mscp *
+ uha_get_mscp __P((struct uha_data *uha, int flags));
+static int uha_init __P((struct uha_data *uha));
+static int uha24_init __P((struct uha_data *uha));
+static void uhaminphys __P((struct buf *bp));
+static struct mscp *
+ uha_mscp_phys_kv __P((struct uha_data *uha, long mscp_phys));
+static int uha_poll __P((struct uha_data *uha, int wait));
+#ifdef UHADEBUG
+static void uha_print_active_mscp __P((struct uha_data *uha));
+static void uha_print_mscp __P((struct mscp *mscp));
+#endif
+static int uhaprobe __P((struct isa_device *dev));
+static int32_t uha_scsi_cmd __P((struct scsi_xfer *xs));
+static void uha_send_mbox __P((struct uha_data *uha, struct mscp *mscp));
+static timeout_t
+ uha_timeout;
+
+static unsigned long int scratch;
+#define EISA_MAX_SLOTS 16 /* XXX This should go into a comon header */
+static int uha_slot; /* slot last board was found in */
+static int uha_unit;
+#define UHA_SHOWMSCPS 0x01
+#define UHA_SHOWINTS 0x02
+#define UHA_SHOWCMDS 0x04
+#define UHA_SHOWMISC 0x08
+#define FAIL 1
+#define SUCCESS 0
+#define PAGESIZ 4096
+
+#ifdef KERNEL
+struct isa_driver uhadriver =
+{
+ uhaprobe,
+ uha_attach,
+ "uha"
+};
+
+static struct scsi_adapter uha_switch =
+{
+ uha_scsi_cmd,
+ uhaminphys,
+ 0,
+ 0,
+ uha_adapter_info,
+ "uha",
+ { 0, 0 }
+};
+
+/* the below structure is so we have a default dev struct for out link struct */
+static struct scsi_device uha_dev =
+{
+ NULL, /* Use default error handler */
+ NULL, /* have a queue, served by this */
+ NULL, /* have no async handler */
+ NULL, /* Use default 'done' routine */
+ "uha",
+ 0,
+ { 0, 0 }
+};
+
+#endif /*KERNEL */
+
+#ifndef KERNEL
+main()
+{
+ printf("uha_data is %d bytes\n", sizeof(struct uha_data));
+ printf("mscp is %d bytes\n", sizeof(struct mscp));
+}
+
+#else /*KERNEL*/
+/*
+ * Function to send a command out through a mailbox
+ */
+static void
+uha_send_mbox(struct uha_data *uha, struct mscp *mscp)
+{
+ int spincount = 100000; /* 1s should be enough */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int s = splbio();
+
+ while (--spincount) {
+ if ((inb(ur->lint) & ub->ldip) == 0)
+ break;
+ DELAY(100);
+ }
+ if (spincount == 0) {
+ printf("uha%d: uha_send_mbox, board is not responding\n",
+ uha->unit);
+ Debugger("ultra14f");
+ }
+ outl(ur->ogmptr, KVTOPHYS(mscp));
+ if (uha->flags & UHA_24F) outb(ur->ogmcmd, 1);
+ outb(ur->lint, ub->ogmint);
+ splx(s);
+}
+
+/*
+ * Function to send abort to 14f
+ */
+int
+uha_abort(struct uha_data *uha, struct mscp *mscp)
+{
+ int spincount = 100; /* 1 mSec */
+ int abortcount = 200000; /*2 secs */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int s = splbio();
+
+ while (--spincount) {
+ if ((inb(ur->lint) & ub->ldip) == 0)
+ break;
+ DELAY(10);
+ }
+ if (spincount == 0) {
+ printf("uha%d: uha_abort, board is not responding\n", uha->unit);
+ Debugger("ultra14f");
+ }
+ outl(ur->ogmptr,KVTOPHYS(mscp));
+ if (uha->flags & UHA_24F) outb(ur->ogmcmd, 1);
+ outb(ur->lint, ub->abort);
+
+ while (--abortcount) {
+ if (inb(ur->sint) & ub->abort_fail)
+ break;
+ DELAY(10);
+ }
+ if (abortcount == 0) {
+ printf("uha%d: uha_abort, board is not responding\n", uha->unit);
+ Debugger("ultra14f");
+ }
+ if ((inb(ur->sint) & 0x10) != 0) {
+ outb(ur->sint, ub->abort_ack);
+ splx(s);
+ return (1);
+ } else {
+ outb(ur->sint, ub->abort_ack);
+ splx(s);
+ return (0);
+ }
+}
+
+/*
+ * Function to poll for command completion when in poll mode.
+ *
+ * wait = timeout in msec
+ */
+static int
+uha_poll(struct uha_data *uha, int wait)
+{
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int stport = ur->sint;
+
+ while (--wait) {
+ if (inb(stport) & ub->sintp)
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (wait == 0) {
+ printf("uha%d: uha_poll, board is not responding\n", uha->unit);
+ return (EIO);
+ }
+ uhaintr(uha->unit);
+ return (0);
+}
+
+/*
+ * Check if the device can be found at the port given and if so, set it up
+ * ready for further work as an argument, takes the isa_device structure
+ * from autoconf.c
+ */
+int
+uhaprobe(dev)
+ struct isa_device *dev;
+{
+ int unit = uha_unit;
+ struct uha_data *uha;
+
+ dev->id_unit = unit; /* XXX */
+
+ /*
+ * find unit and check we have that many defined
+ */
+ if (unit >= NUHA) {
+ printf("uha: unit number (%d) too high\n", unit);
+ return (0);
+ }
+ dev->id_unit = unit;
+
+ /*
+ * Allocate a storage area for us
+ */
+ if (uhadata[unit]) {
+ printf("uha%d: memory already allocated\n", unit);
+ return 0;
+ }
+ uha = malloc(sizeof(struct uha_data), M_TEMP, M_NOWAIT);
+ if (!uha) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha, sizeof(struct uha_data));
+
+ uha->ur = malloc(sizeof(struct uha_reg), M_TEMP, M_NOWAIT);
+ if (!uha->ur) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha->ur, sizeof(struct uha_reg));
+
+ uha->ub = malloc(sizeof(struct uha_bits), M_TEMP, M_NOWAIT);
+ if (!uha->ub) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha->ub, sizeof(struct uha_bits));
+
+ uhadata[unit] = uha;
+ uha->unit = unit;
+ uha->baseport = dev->id_iobase;
+ /*
+ * Try initialise a unit at this location
+ * sets up dma and bus speed, loads uha->vect
+ */
+ if (uha_init(uha) != 0 && uha24_init(uha) != 0) {
+ uhadata[unit] = NULL;
+ free(uha->ur, M_TEMP);
+ free(uha->ub, M_TEMP);
+ free(uha, M_TEMP);
+ return (0);
+ }
+ /* if it's there put in its interrupt and DRQ vectors */
+ dev->id_irq = (1 << uha->vect);
+ dev->id_drq = uha->dma;
+ dev->id_iobase = uha->baseport;
+
+ uha_unit++;
+ return (16);
+}
+
+/*
+ * Attach all the sub-devices we can find
+ */
+int
+uha_attach(dev)
+ struct isa_device *dev;
+{
+ int unit = dev->id_unit;
+ struct uha_data *uha = uhadata[unit];
+ struct scsibus_data *scbus;
+
+ /*
+ * fill in the prototype scsi_link.
+ */
+ uha->sc_link.adapter_unit = unit;
+ uha->sc_link.adapter_targ = uha->our_id;
+ uha->sc_link.adapter_softc = uha;
+ uha->sc_link.adapter = &uha_switch;
+ uha->sc_link.device = &uha_dev;
+ uha->sc_link.flags = SDEV_BOUNCE;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &uha->sc_link;
+
+ /*
+ * ask the adapter what subunits are present
+ */
+ scsi_attachdevs(scbus);
+
+ return 1;
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities
+ */
+u_int32_t
+uha_adapter_info(unit)
+ int unit;
+{
+ return (2); /* 2 outstanding requests at a time per device */
+}
+
+/*
+ * Catch an interrupt from the adaptor
+ */
+void
+uhaintr(unit)
+ int unit;
+{
+ struct uha_data *uha = uhadata[unit];
+ struct mscp *mscp;
+ u_char uhastat;
+ unsigned long int mboxval;
+ struct uha_reg *ur;
+ struct uha_bits *ub;
+ int port;
+
+ ur = uha->ur;
+ ub = uha->ub;
+ port = uha->baseport;
+
+#ifdef UHADEBUG
+ printf("uhaintr ");
+#endif /*UHADEBUG */
+
+ while ((uhastat = inb(ur->sint)) & ub->sintp) {
+ /*
+ * First get all the information and then
+ * acknowledge the interrupt
+ */
+ mboxval = inl(ur->icmptr);
+ outb(ur->sint, ub->icm_ack);
+ if (uha->flags & UHA_24F) outb(ur->icmcmd, 0);
+
+#ifdef UHADEBUG
+ printf("status = 0x%x ", uhastat);
+#endif /*UHADEBUG*/
+ /*
+ * Process the completed operation
+ */
+
+ mscp = uha_mscp_phys_kv(uha, mboxval);
+ if (!mscp) {
+ printf("uha: BAD MSCP RETURNED\n");
+ return; /* whatever it was, it'll timeout */
+ }
+ untimeout(uha_timeout, (caddr_t)mscp, mscp->xs->timeout_ch);
+
+ uha_done(uha, mscp);
+ }
+}
+
+/*
+ * We have a mscp which has been processed by the adaptor, now we look to see
+ * how the operation went.
+ */
+void
+uha_done(uha, mscp)
+ struct uha_data *uha;
+ struct mscp *mscp;
+{
+ struct scsi_sense_data *s1, *s2;
+ struct scsi_xfer *xs = mscp->xs;
+
+ SC_DEBUG(xs->sc_link, SDEV_DB2, ("uha_done\n"));
+ /*
+ * Otherwise, put the results of the operation
+ * into the xfer and call whoever started it
+ */
+ if (((mscp->ha_status != UHA_NO_ERR) || (mscp->targ_status != SCSI_OK))
+ && ((xs->flags & SCSI_ERR_OK) == 0)) {
+
+ s1 = &(mscp->mscp_sense);
+ s2 = &(xs->sense);
+
+ if (mscp->ha_status != UHA_NO_ERR) {
+ switch (mscp->ha_status) {
+ case UHA_SBUS_ABORT_ERR:
+ case UHA_SBUS_TIMEOUT: /* No sel response */
+ SC_DEBUG(xs->sc_link, SDEV_DB3,
+ ("abort or timeout; ha_status 0x%x\n",
+ mscp->ha_status));
+ xs->error = XS_TIMEOUT;
+ break;
+ case UHA_SBUS_OVER_UNDER:
+ SC_DEBUG(xs->sc_link, SDEV_DB3,
+ ("scsi bus xfer over/underrun\n"));
+ xs->error = XS_DRIVER_STUFFUP;
+ break;
+ default: /* Other scsi protocol messes */
+ xs->error = XS_DRIVER_STUFFUP;
+ printf("uha%d: unexpected ha_status 0x%x (target status 0x%x)\n",
+ uha->unit, mscp->ha_status,
+ mscp->targ_status);
+ break;
+ }
+ } else {
+ /* Target status problem */
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("target err 0x%x\n",
+ mscp->targ_status));
+ switch (mscp->targ_status) {
+ case 0x02:
+ *s2 = *s1;
+ xs->error = XS_SENSE;
+ break;
+ case 0x08:
+ xs->error = XS_BUSY;
+ break;
+ default:
+ printf("uha%d: unexpected targ_status 0x%x\n",
+ uha->unit, mscp->targ_status);
+ xs->error = XS_DRIVER_STUFFUP;
+ break;
+ }
+ }
+ }
+ else {
+ /* All went correctly OR errors expected */
+ xs->resid = 0;
+ xs->error = 0;
+ }
+ xs->flags |= ITSDONE;
+ uha_free_mscp(uha, mscp, xs->flags);
+ scsi_done(xs);
+}
+
+/*
+ * A mscp (and hence a mbx-out) is put onto the free list.
+ */
+void
+uha_free_mscp(uha, mscp, flags)
+ struct uha_data *uha;
+ struct mscp *mscp;
+ int flags;
+{
+ unsigned int opri = 0;
+
+ if (!(flags & SCSI_NOMASK))
+ opri = splbio();
+
+ mscp->next = uha->free_mscp;
+ uha->free_mscp = mscp;
+ mscp->flags = MSCP_FREE;
+ /*
+ * If there were none, wake abybody waiting for
+ * one to come free, starting with queued entries
+ */
+ if (!mscp->next) {
+ wakeup((caddr_t)&uha->free_mscp);
+ }
+ if (!(flags & SCSI_NOMASK))
+ splx(opri);
+}
+
+/*
+ * Get a free mscp
+ *
+ * If there are none, see if we can allocate a new one. If so, put it in the
+ * hash table too otherwise either return an error or sleep.
+ */
+static struct mscp *
+uha_get_mscp(uha, flags)
+ struct uha_data *uha;
+ int flags;
+{
+ unsigned opri = 0;
+ struct mscp *mscpp;
+ int hashnum;
+
+ if (!(flags & SCSI_NOMASK))
+ opri = splbio();
+ /*
+ * If we can and have to, sleep waiting for one to come free
+ * but only if we can't allocate a new one
+ */
+ while (!(mscpp = uha->free_mscp)) {
+ if (uha->nummscps < UHA_MSCP_MAX) {
+ if (mscpp = (struct mscp *)malloc(sizeof(struct mscp),
+ M_TEMP,
+ M_NOWAIT)) {
+ bzero(mscpp, sizeof(struct mscp));
+ uha->nummscps++;
+ mscpp->flags = MSCP_ACTIVE;
+ /*
+ * put in the phystokv hash table
+ * Never gets taken out.
+ */
+ mscpp->hashkey = KVTOPHYS(mscpp);
+ hashnum = MSCP_HASH(mscpp->hashkey);
+ mscpp->nexthash = uha->mscphash[hashnum];
+ uha->mscphash[hashnum] = mscpp;
+ } else {
+ printf("uha%d: Can't malloc MSCP\n", uha->unit);
+ }
+ goto gottit;
+ } else {
+ if (!(flags & SCSI_NOSLEEP)) {
+ tsleep((caddr_t)&uha->free_mscp, PRIBIO,
+ "uhamscp", 0);
+ }
+ }
+ }
+ if (mscpp) {
+ /* Get MSCP from from free list */
+ uha->free_mscp = mscpp->next;
+ mscpp->flags = MSCP_ACTIVE;
+ }
+ gottit:
+ if (!(flags & SCSI_NOMASK))
+ splx(opri);
+
+ return (mscpp);
+}
+
+/*
+ * given a physical address, find the mscp that it corresponds to.
+ */
+static struct mscp *
+uha_mscp_phys_kv(uha, mscp_phys)
+ struct uha_data *uha;
+ long int mscp_phys;
+{
+ int hashnum = MSCP_HASH(mscp_phys);
+ struct mscp *mscpp = uha->mscphash[hashnum];
+
+ while (mscpp) {
+ if (mscpp->hashkey == mscp_phys)
+ break;
+ mscpp = mscpp->nexthash;
+ }
+ return mscpp;
+}
+
+/*
+ * Start the board, ready for normal operation
+ */
+int
+uha_init(uha)
+ struct uha_data *uha;
+{
+ volatile unsigned char model;
+ volatile unsigned char submodel;
+ unsigned char config_reg1;
+ unsigned char config_reg2;
+ unsigned char dma_ch;
+ unsigned char irq_ch;
+ unsigned char uha_id;
+ int port = uha->baseport;
+ int resetcount = 4000; /* 4 secs? */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+
+ /*
+ * Prepare to use a 14/34F.
+ */
+ ur->id = port + 0x04;
+ ur->type = port + 0x00; /* 24F only */
+ ur->ectl = port + 0x00; /* 24F only */
+ ur->config = port + 0x06; /* 0-1 for 14F */
+ ur->lmask = port + 0x00;
+ ur->lint = port + 0x01;
+ ur->smask = port + 0x02;
+ ur->sint = port + 0x03;
+ ur->ogmcmd = port + 0x00; /* 24F only */
+ ur->ogmptr = port + 0x08;
+ ur->icmcmd = port + 0x00; /* 24F only */
+ ur->icmptr = port + 0x0c;
+
+ ub->ldip = UHA_LDIP;
+ ub->adrst = UHA_ADRST;
+ ub->sbrst = UHA_SBRST;
+ ub->asrst = UHA_ASRST;
+ ub->abort = UHA_ABORT;
+ ub->ogmint = UHA_OGMINT;
+ ub->sintp = UHA_SINTP;
+ ub->abort_succ = UHA_ABORT_SUCC;
+ ub->abort_fail = UHA_ABORT_FAIL;
+ ub->abort_ack = UHA_ABORT_ACK;
+ ub->icm_ack = UHA_ICM_ACK;
+
+ model = inb(ur->id);
+ submodel = inb(ur->id + 1);
+ if ((model != 0x56) & (submodel != 0x40)) return(ENXIO);
+ printf("uha%d: reading board settings, ", uha->unit);
+
+ config_reg1 = inb(ur->config);
+ config_reg2 = inb(ur->config + 1);
+ dma_ch = (config_reg1 & 0xc0);
+ irq_ch = (config_reg1 & 0x30);
+ uha_id = (config_reg2 & 0x07);
+
+ switch (dma_ch) {
+ case UHA_DMA_CH5:
+ uha->dma = 5;
+ printf("dma=5 ");
+ break;
+ case UHA_DMA_CH6:
+ uha->dma = 6;
+ printf("dma=6 ");
+ break;
+ case UHA_DMA_CH7:
+ uha->dma = 7;
+ printf("dma=7 ");
+ break;
+ default:
+ printf("illegal dma jumper setting\n");
+ return (EIO);
+ }
+ switch (irq_ch) {
+ case UHA_IRQ10:
+ uha->vect = 10;
+ printf("int=10 ");
+ break;
+ case UHA_IRQ11:
+ uha->vect = 11;
+ printf("int=11 ");
+ break;
+ case UHA_IRQ14:
+ uha->vect = 14;
+ printf("int=14 ");
+ break;
+ case UHA_IRQ15:
+ uha->vect = 15;
+ printf("int=15 ");
+ break;
+ default:
+ printf("illegal int jumper setting\n");
+ return (EIO);
+ }
+
+ /* who are we on the scsi bus */
+ printf("id=%x\n", uha_id);
+ uha->our_id = uha_id;
+
+ /*
+ * Note that we are going and return (to probe)
+ */
+ outb(ur->lint, ub->asrst);
+ while (--resetcount) {
+ if (inb(ur->lint))
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (resetcount == 0) {
+ printf("uha%d: board timed out during reset\n", uha->unit);
+ return (ENXIO);
+ }
+ outb(ur->smask, 0x81); /* make sure interrupts are enabled */
+ uha->flags |= UHA_INIT;
+ return (0);
+}
+
+
+/*
+ * Initialize an Ultrastor 24F
+ */
+int
+uha24_init(uha)
+ struct uha_data *uha;
+{
+ unsigned char p0, p1, p2, p3, p5, p7;
+ unsigned char id[7], rev, haid;
+ int port = 0, irq;
+ int resetcount = 4000;
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+
+ /* Search for the 24F's product ID */
+ uha_slot++;
+ while (uha_slot < EISA_MAX_SLOTS) {
+ /*
+ * Prepare to use a 24F.
+ */
+ port = EISA_CONFIG | (uha_slot << 12);
+ ur->id = port + 0x00;
+ ur->type = port + 0x02;
+ ur->ectl = port + 0x04;
+ ur->config = port + 0x05; /* 0-2 for 24F */
+ ur->lmask = port + 0x0c;
+ ur->lint = port + 0x0d;
+ ur->smask = port + 0x0e;
+ ur->sint = port + 0x0f;
+ ur->ogmcmd = port + 0x16;
+ ur->ogmptr = port + 0x17;
+ ur->icmcmd = port + 0x1b;
+ ur->icmptr = port + 0x1c;
+
+ ub->ldip = U24_LDIP;
+ ub->adrst = U24_ADRST;
+ ub->sbrst = U24_SBRST;
+ ub->asrst = U24_ASRST;
+ ub->abort = U24_ABORT;
+ ub->ogmint = U24_OGMINT;
+ ub->sintp = U24_SINTP;
+ ub->abort_succ = U24_ABORT_SUCC;
+ ub->abort_fail = U24_ABORT_FAIL;
+ ub->abort_ack = U24_ABORT_ACK;
+ ub->icm_ack = U24_ICM_ACK;
+
+ /*
+ * Make sure an EISA card is installed in this slot,
+ * and if it is make sure that the card is enabled.
+ */
+ outb(ur->id, 0xff);
+ p0 = inb(ur->id);
+ if ((p0 == 0xff) ||
+ ((p0 & 0x80) != 0) ||
+ ((inb(ur->ectl) & EISA_DISABLE) == 0)) {
+ uha_slot++;
+ continue;
+ }
+
+ /* Found an enabled card. Grab the product ID. */
+ p1 = inb(ur->id+1);
+ p2 = inb(ur->type);
+ p3 = inb(ur->type+1);
+ id[0] = 0x40 + ((p0 >> 2) & 0x1f);
+ id[1] = 0x40 + (((p0 & 0x03) << 3) | ((p1 >> 5) & 0x07));
+ id[2] = 0x40 + (p1 & 0x1f);
+ id[3] = hex2ascii((p2 >> 4) & 0x0f);
+ id[4] = hex2ascii(p2 & 0x0f);
+ id[5] = hex2ascii((p3 >> 4) & 0x0f);
+ id[6] = '\0';
+ rev = p3 & 0xf;
+
+ /* We only want the 24F product ID. */
+ if (!strcmp(id, "USC024")) break;
+ uha_slot++;
+ }
+ if (uha_slot == EISA_MAX_SLOTS) return(ENODEV);
+
+ /* We have the card! Grab remaining config. */
+ p5 = inb(ur->config);
+ p7 = inb(ur->config+2);
+
+ switch (p5 & 0xf0) {
+ case 0x10: irq = 15; break;
+ case 0x20: irq = 14; break;
+ case 0x40: irq = 11; break;
+ case 0x80: irq = 10; break;
+ default:
+ printf("uha%d: bad 24F irq\n", uha->unit);
+ return(ENXIO);
+ }
+
+ haid = (p7 & 0x07);
+ printf("uha%d: UltraStor 24F int=%d id=%d\n", uha->unit, irq, haid);
+
+ /* Issue SCSI and adapter reset */
+ outb(ur->lint, ub->asrst);
+ while (--resetcount) {
+ if (inb(ur->lint))
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (resetcount == 0) {
+ printf("uha%d: board timed out during reset\n", uha->unit);
+ return (ENXIO);
+ }
+ outb(ur->smask, 0xc2); /* make sure interrupts are enabled */
+ uha->flags |= (UHA_INIT | UHA_24F);
+ uha->baseport = port;
+ uha->our_id = haid;
+ uha->vect = irq;
+ uha->dma = -1;
+ return(0);
+}
+
+#ifndef min
+#define min(x,y) (x < y ? x : y)
+#endif /* min */
+
+void
+uhaminphys(bp)
+ struct buf *bp;
+{
+ if (bp->b_bcount > ((UHA_NSEG - 1) * PAGESIZ)) {
+ bp->b_bcount = ((UHA_NSEG - 1) * PAGESIZ);
+ }
+}
+
+/*
+ * start a scsi operation given the command and the data address. Also
+ * needs the unit, target and lu.
+ */
+static int32_t
+uha_scsi_cmd(xs)
+ struct scsi_xfer *xs;
+{
+ struct mscp *mscp;
+ struct uha_dma_seg *sg;
+ int seg; /* scatter gather seg being worked on */
+ int thiskv;
+ unsigned long int thisphys, nextphys;
+ int bytes_this_seg, bytes_this_page, datalen, flags;
+ struct uha_data *uha;
+ int s;
+ unsigned long int templen;
+
+ uha = (struct uha_data *)xs->sc_link->adapter_softc;
+ SC_DEBUG(xs->sc_link, SDEV_DB2, ("uha_scsi_cmd\n"));
+ /*
+ * get a mscp (mbox-out) to use. If the transfer
+ * is from a buf (possibly from interrupt time)
+ * then we can't allow it to sleep
+ */
+ flags = xs->flags;
+ if (xs->bp)
+ flags |= (SCSI_NOSLEEP); /* just to be sure */
+ if (flags & ITSDONE) {
+ printf("uha%d: Already done?", uha->unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (!(flags & INUSE)) {
+ printf("uha%d: Not in use?", uha->unit);
+ xs->flags |= INUSE;
+ }
+ if (!(mscp = uha_get_mscp(uha, flags))) {
+ xs->error = XS_DRIVER_STUFFUP;
+ return (TRY_AGAIN_LATER);
+ }
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("start mscp(%p)\n", mscp));
+ mscp->xs = xs;
+
+ /*
+ * Put all the arguments for the xfer in the mscp
+ */
+ if (flags & SCSI_RESET) {
+ mscp->opcode = 0x04;
+ mscp->ca = 0x01;
+ } else {
+ mscp->opcode = 0x02;
+ mscp->ca = 0x01;
+ }
+ if (flags & SCSI_DATA_IN) {
+ mscp->xdir = 0x01;
+ }
+ if (flags & SCSI_DATA_OUT) {
+ mscp->xdir = 0x02;
+ }
+#ifdef GOTTABEJOKING
+ if (xs->sc_link->lun != 0) {
+ xs->error = XS_DRIVER_STUFFUP;
+ uha_free_mscp(uha, mscp, flags);
+ return (HAD_ERROR);
+ }
+#endif
+ mscp->dcn = 0x00;
+ mscp->chan = 0x00;
+ mscp->target = xs->sc_link->target;
+ mscp->lun = xs->sc_link->lun;
+ mscp->link.addr[0] = 0x00;
+ mscp->link.addr[1] = 0x00;
+ mscp->link.addr[2] = 0x00;
+ mscp->link.addr[3] = 0x00;
+ mscp->link_id = 0x00;
+ mscp->cdblen = xs->cmdlen;
+ scratch = KVTOPHYS(&(mscp->mscp_sense));
+ mscp->sense.addr[0] = (scratch & 0xff);
+ mscp->sense.addr[1] = ((scratch >> 8) & 0xff);
+ mscp->sense.addr[2] = ((scratch >> 16) & 0xff);
+ mscp->sense.addr[3] = ((scratch >> 24) & 0xff);
+ mscp->senselen = sizeof(mscp->mscp_sense);
+ mscp->ha_status = 0x00;
+ mscp->targ_status = 0x00;
+
+ if (xs->datalen) { /* should use S/G only if not zero length */
+ scratch = KVTOPHYS(mscp->uha_dma);
+ mscp->data.addr[0] = (scratch & 0xff);
+ mscp->data.addr[1] = ((scratch >> 8) & 0xff);
+ mscp->data.addr[2] = ((scratch >> 16) & 0xff);
+ mscp->data.addr[3] = ((scratch >> 24) & 0xff);
+ sg = mscp->uha_dma;
+ seg = 0;
+ mscp->sgth = 0x01;
+
+#ifdef TFS
+ if (flags & SCSI_DATA_UIO) {
+ iovp = ((struct uio *) xs->data)->uio_iov;
+ datalen = ((struct uio *) xs->data)->uio_iovcnt;
+ xs->datalen = 0;
+ while ((datalen) && (seg < UHA_NSEG)) {
+ scratch = (unsigned long) iovp->iov_base;
+ sg->addr.addr[0] = (scratch & 0xff);
+ sg->addr.addr[1] = ((scratch >> 8) & 0xff);
+ sg->addr.addr[2] = ((scratch >> 16) & 0xff);
+ sg->addr.addr[3] = ((scratch >> 24) & 0xff);
+ xs->datalen += *(unsigned long *) sg->len.len = iovp->iov_len;
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("(0x%x@0x%x)",
+ iovp->iov_len,
+ iovp->iov_base));
+ sg++;
+ iovp++;
+ seg++;
+ datalen--;
+ }
+ } else
+#endif /*TFS */
+ {
+ /*
+ * Set up the scatter gather block
+ */
+
+ SC_DEBUG(xs->sc_link, SDEV_DB4,
+ ("%ld @%p:- ", xs->datalen, xs->data));
+ datalen = xs->datalen;
+ thiskv = (int) xs->data;
+ thisphys = KVTOPHYS(thiskv);
+ templen = 0;
+
+ while ((datalen) && (seg < UHA_NSEG)) {
+ bytes_this_seg = 0;
+
+ /* put in the base address */
+ sg->addr.addr[0] = (thisphys & 0xff);
+ sg->addr.addr[1] = ((thisphys >> 8) & 0xff);
+ sg->addr.addr[2] = ((thisphys >> 16) & 0xff);
+ sg->addr.addr[3] = ((thisphys >> 24) & 0xff);
+
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("0x%lx",
+ thisphys));
+
+ /* do it at least once */
+ nextphys = thisphys;
+ while ((datalen) && (thisphys == nextphys))
+ /*
+ * This page is contiguous (physically) with
+ * the the last, just extend the length
+ */
+ {
+ /* how far to the end of the page */
+ nextphys = (thisphys & (~(PAGESIZ - 1)))
+ + PAGESIZ;
+ bytes_this_page = nextphys - thisphys;
+ /**** or the data ****/
+ bytes_this_page = min(bytes_this_page
+ ,datalen);
+ bytes_this_seg += bytes_this_page;
+ datalen -= bytes_this_page;
+
+ /* get more ready for the next page */
+ thiskv = (thiskv & (~(PAGESIZ - 1)))
+ + PAGESIZ;
+ if (datalen)
+ thisphys = KVTOPHYS(thiskv);
+ }
+ /*
+ * next page isn't contiguous, finish the seg
+ */
+ SC_DEBUGN(xs->sc_link, SDEV_DB4,
+ ("(0x%x)", bytes_this_seg));
+ sg->len.len[0] = (bytes_this_seg & 0xff);
+ sg->len.len[1] = ((bytes_this_seg >> 8) & 0xff);
+ sg->len.len[2] = ((bytes_this_seg >> 16) & 0xff);
+ sg->len.len[3] = ((bytes_this_seg >> 24) & 0xff);
+ templen += bytes_this_seg;
+ sg++;
+ seg++;
+ }
+ }
+
+ /* end of iov/kv decision */
+ mscp->datalen.len[0] = (templen & 0xff);
+ mscp->datalen.len[1] = ((templen >> 8) & 0xff);
+ mscp->datalen.len[2] = ((templen >> 16) & 0xff);
+ mscp->datalen.len[3] = ((templen >> 24) & 0xff);
+ mscp->sg_num = seg;
+
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("\n"));
+ if (datalen) { /* there's still data, must have run out of segs! */
+ printf("uha%d: uha_scsi_cmd, more than %d DMA segs\n",
+ uha->unit, UHA_NSEG);
+ xs->error = XS_DRIVER_STUFFUP;
+ uha_free_mscp(uha, mscp, flags);
+ return (HAD_ERROR);
+ }
+ } else { /* No data xfer, use non S/G values */
+ mscp->data.addr[0] = 0x00;
+ mscp->data.addr[1] = 0x00;
+ mscp->data.addr[2] = 0x00;
+ mscp->data.addr[3] = 0x00;
+ mscp->datalen.len[0] = 0x00;
+ mscp->datalen.len[1] = 0x00;
+ mscp->datalen.len[2] = 0x00;
+ mscp->datalen.len[3] = 0x00;
+ mscp->xdir = 0x03;
+ mscp->sgth = 0x00;
+ mscp->sg_num = 0x00;
+ }
+
+ /*
+ * Put the scsi command in the mscp and start it
+ */
+ bcopy(xs->cmd, mscp->cdb, xs->cmdlen);
+
+ /*
+ * Usually return SUCCESSFULLY QUEUED
+ */
+ if (!(flags & SCSI_NOMASK)) {
+ s = splbio();
+ uha_send_mbox(uha, mscp);
+ xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
+ (xs->timeout * hz) / 1000);
+ splx(s);
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /*
+ * If we can't use interrupts, poll on completion
+ */
+ uha_send_mbox(uha, mscp);
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_wait\n"));
+ do {
+ if (uha_poll(uha, xs->timeout)) {
+ if (!(xs->flags & SCSI_SILENT))
+ printf("uha%d: cmd fail\n", uha->unit);
+ if (!(uha_abort(uha, mscp))) {
+ printf("uha%d: abort failed in wait\n",
+ uha->unit);
+ uha_free_mscp(uha, mscp, flags);
+ }
+ xs->error = XS_DRIVER_STUFFUP;
+ return (HAD_ERROR);
+ }
+ }
+ while (!(xs->flags & ITSDONE)); /* something (?) else finished */
+ if (xs->error) {
+ return (HAD_ERROR);
+ }
+ return (COMPLETE);
+}
+
+static void
+uha_timeout(arg1)
+ void *arg1;
+{
+ struct mscp *mscp = (struct mscp *)arg1;
+ struct uha_data *uha;
+ int s = splbio();
+
+ uha = (struct uha_data *)mscp->xs->sc_link->adapter_softc;
+ printf("uha%d:%d:%d (%s%d) timed out ", uha->unit
+ ,mscp->xs->sc_link->target
+ ,mscp->xs->sc_link->lun
+ ,mscp->xs->sc_link->device->name
+ ,mscp->xs->sc_link->dev_unit);
+
+#ifdef UHADEBUG
+ uha_print_active_mscp(uha);
+#endif /*UHADEBUG */
+
+ if ((uha_abort(uha, mscp) != 1) || (mscp->flags = MSCP_ABORTED)) {
+ printf("AGAIN");
+ mscp->xs->retries = 0; /* I MEAN IT ! */
+ uha_done(uha, mscp);
+ } else { /* abort the operation that has timed out */
+ printf("\n");
+ mscp->xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
+ 2 * hz);
+ mscp->flags = MSCP_ABORTED;
+ }
+ splx(s);
+}
+
+#ifdef UHADEBUG
+void
+uha_print_mscp(mscp)
+ struct mscp *mscp;
+{
+ printf("mscp:%x op:%x cmdlen:%d senlen:%d\n"
+ ,mscp
+ ,mscp->opcode
+ ,mscp->cdblen
+ ,mscp->senselen);
+ printf(" sg:%d sgnum:%x datlen:%d hstat:%x tstat:%x flags:%x\n"
+ ,mscp->sgth
+ ,mscp->sg_num
+ ,mscp->datalen
+ ,mscp->ha_status
+ ,mscp->targ_status
+ ,mscp->flags);
+ show_scsi_cmd(mscp->xs);
+}
+
+void
+uha_print_active_mscp(struct uha_data *uha)
+{
+ struct mscp *mscp;
+ int i = 0;
+
+ while (i < MSCP_HASH_SIZE) {
+ mscp = uha->mscphash[i];
+ while (mscp) {
+ if (mscp->flags != MSCP_FREE) {
+ uha_print_mscp(mscp);
+ }
+ mscp = mscp->nexthash;
+ }
+ i++;
+ }
+}
+#endif /*UHADEBUG */
+#endif /*KERNEL */
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index a338fb59c2cf..cfd1075bf04e 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -23,25 +23,18 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vesa.c,v 1.14 1999/01/16 12:56:00 yokota Exp $
+ * $Id: vesa.c,v 1.7 1998/10/01 11:39:18 yokota Exp $
*/
-#include "vga.h"
-#include "opt_vga.h"
+#include "sc.h"
#include "opt_vesa.h"
#include "opt_vm86.h"
-#include "opt_fb.h"
-#ifdef VGA_NO_MODE_CHANGE
-#undef VESA
-#endif
-
-#if (NVGA > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE)
+#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/malloc.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -52,17 +45,14 @@
#include <machine/pc/bios.h>
#include <machine/pc/vesa.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
+#include <i386/isa/videoio.h>
-#ifndef __i386__
-#include <isa/isareg.h>
-#else
-#include <i386/isa/isa.h>
-#endif
+#ifdef VESA_MODULE
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
-#ifndef VESA_DEBUG
-#define VESA_DEBUG 0
+MOD_MISC(vesa);
#endif
/* VESA video adapter state buffer stub */
@@ -76,14 +66,11 @@ typedef struct adp_state adp_state_t;
/* VESA video adapter */
static video_adapter_t *vesa_adp = NULL;
static int vesa_state_buf_size = 0;
-#if 0
static void *vesa_state_buf = NULL;
-#endif
/* VESA functions */
-static int vesa_nop(void);
-static vi_probe_t vesa_probe;
static vi_init_t vesa_init;
+static vi_adapter_t vesa_adapter;
static vi_get_info_t vesa_get_info;
static vi_query_mode_t vesa_query_mode;
static vi_set_mode_t vesa_set_mode;
@@ -98,34 +85,17 @@ static vi_load_state_t vesa_load_state;
static vi_set_win_org_t vesa_set_origin;
static vi_read_hw_cursor_t vesa_read_hw_cursor;
static vi_set_hw_cursor_t vesa_set_hw_cursor;
-static vi_set_hw_cursor_shape_t vesa_set_hw_cursor_shape;
-static vi_mmap_t vesa_mmap;
static vi_diag_t vesa_diag;
-static video_switch_t vesavidsw = {
- vesa_probe,
- vesa_init,
- vesa_get_info,
- vesa_query_mode,
- vesa_set_mode,
- vesa_save_font,
- vesa_load_font,
- vesa_show_font,
- vesa_save_palette,
- vesa_load_palette,
- vesa_set_border,
- vesa_save_state,
- vesa_load_state,
- vesa_set_origin,
- vesa_read_hw_cursor,
- vesa_set_hw_cursor,
- vesa_set_hw_cursor_shape,
- (vi_blank_display_t *)vesa_nop,
- vesa_mmap,
+static struct vidsw vesavidsw = {
+ vesa_init, vesa_adapter, vesa_get_info, vesa_query_mode,
+ vesa_set_mode, vesa_save_font, vesa_load_font, vesa_show_font,
+ vesa_save_palette,vesa_load_palette,vesa_set_border,vesa_save_state,
+ vesa_load_state,vesa_set_origin,vesa_read_hw_cursor,vesa_set_hw_cursor,
vesa_diag,
};
-static video_switch_t *prevvidsw;
+static struct vidsw prevvidsw;
/* VESA BIOS video modes */
#define VESA_MAXMODES 64
@@ -148,14 +118,11 @@ static char *vesa_revstr = NULL;
/* local macros and functions */
#define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff))
-static int int10_set_mode(int mode);
static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode);
static int vesa_bios_set_mode(int mode);
static int vesa_bios_set_dac(int bits);
-static int vesa_bios_save_palette(int start, int colors, u_char *palette,
- int bits);
-static int vesa_bios_load_palette(int start, int colors, u_char *palette,
- int bits);
+static int vesa_bios_save_palette(int start, int colors, u_char *palette);
+static int vesa_bios_load_palette(int start, int colors, u_char *palette);
#define STATE_SIZE 0
#define STATE_SAVE 1
#define STATE_LOAD 2
@@ -186,18 +153,6 @@ dump_buffer(u_char *buf, size_t len)
}
}
-/* INT 10 BIOS calls */
-static int
-int10_set_mode(int mode)
-{
- struct vm86frame vmf;
-
- bzero(&vmf, sizeof(vmf));
- vmf.vmf_eax = 0x0000 | mode;
- vm86_intcall(0x10, &vmf);
- return 0;
-}
-
/* VESA BIOS calls */
static int
vesa_bios_get_mode(int mode, struct vesa_mode *vmode)
@@ -241,13 +196,11 @@ vesa_bios_set_dac(int bits)
vmf.vmf_eax = 0x4f08;
vmf.vmf_ebx = (bits << 8);
err = vm86_intcall(0x10, &vmf);
- if ((err != 0) || (vmf.vmf_eax != 0x4f))
- return 6; /* XXX */
- return ((vmf.vmf_ebx >> 8) & 0x00ff);
+ return ((err != 0) || (vmf.vmf_eax != 0x4f));
}
static int
-vesa_bios_save_palette(int start, int colors, u_char *palette, int bits)
+vesa_bios_save_palette(int start, int colors, u_char *palette)
{
struct vm86frame vmf;
u_char *p;
@@ -267,18 +220,17 @@ vesa_bios_save_palette(int start, int colors, u_char *palette, int bits)
return 1;
}
- bits = 8 - bits;
for (i = 0; i < colors; ++i) {
- palette[i*3] = p[i*4 + 2] << bits;
- palette[i*3 + 1] = p[i*4 + 1] << bits;
- palette[i*3 + 2] = p[i*4] << bits;
+ palette[i*3] = p[i*4 + 1];
+ palette[i*3 + 1] = p[i*4 + 2];
+ palette[i*3 + 2] = p[i*4 + 3];
}
free(p, M_DEVBUF);
return 0;
}
static int
-vesa_bios_load_palette(int start, int colors, u_char *palette, int bits)
+vesa_bios_load_palette(int start, int colors, u_char *palette)
{
struct vm86frame vmf;
u_char *p;
@@ -286,12 +238,11 @@ vesa_bios_load_palette(int start, int colors, u_char *palette, int bits)
int i;
p = malloc(colors*4, M_DEVBUF, M_WAITOK);
- bits = 8 - bits;
for (i = 0; i < colors; ++i) {
- p[i*4] = palette[i*3 + 2] >> bits;
- p[i*4 + 1] = palette[i*3 + 1] >> bits;
- p[i*4 + 2] = palette[i*3] >> bits;
- p[i*4 + 3] = 0;
+ p[i*4] = 0;
+ p[i*4 + 1] = palette[i*3];
+ p[i*4 + 2] = palette[i*3 + 1];
+ p[i*4 + 3] = palette[i*3 + 2];
}
bzero(&vmf, sizeof(vmf));
@@ -367,7 +318,7 @@ vesa_translate_flags(u_int16_t vflags)
} ftable[] = {
{ V_MODECOLOR, V_INFO_COLOR, 0 },
{ V_MODEGRAPHICS, V_INFO_GRAPHICS, 0 },
- { V_MODELFB, V_INFO_LINEAR, 0 },
+ { V_MODELFB, V_INFO_LENEAR, 0 },
};
int flags;
int i;
@@ -398,6 +349,7 @@ vesa_bios_init(void)
static u_char buf[512];
struct vm86frame vmf;
struct vesa_mode vmode;
+ u_int32_t p;
int modes;
int err;
int i;
@@ -418,10 +370,8 @@ vesa_bios_init(void)
if ((err != 0) || (vmf.vmf_eax != 0x4f) || bcmp("VESA", buf, 4))
return 1;
vesa_adp_info = (struct vesa_info *)buf;
- if (bootverbose) {
- printf("VESA: information block\n");
+ if (bootverbose)
dump_buffer(buf, 64);
- }
if (vesa_adp_info->v_flags & V_NONVGA)
return 1;
@@ -504,101 +454,42 @@ vesa_clear_modes(video_info_t *info, int color)
}
}
-/* entry points */
+/* exported functions */
static int
-vesa_configure(int flags)
+vesa_init(void)
{
- video_adapter_t *adp;
int adapters;
- int error;
int i;
- if (vesa_init_done)
- return 0;
- if (flags & VIO_PROBE_ONLY)
- return 0; /* XXX */
-
- /*
- * If the VESA module has already been loaded, abort loading
- * the module this time.
- */
- for (i = 0; (adp = vid_get_adapter(i)) != NULL; ++i) {
- if (adp->va_flags & V_ADP_VESA)
- return ENXIO;
- if (adp->va_type == KD_VGA)
- break;
- }
- /*
- * The VGA adapter is not found. This is because either
- * 1) the VGA driver has not been initialized, or 2) the VGA card
- * is not present. If 1) is the case, we shall defer
- * initialization for now and try again later.
- */
- if (adp == NULL) {
- vga_sub_configure = vesa_configure;
- return ENODEV;
- }
-
- /* count number of registered adapters */
- for (++i; vid_get_adapter(i) != NULL; ++i)
- ;
- adapters = i;
-
- /* call VESA BIOS */
- vesa_adp = adp;
- if (vesa_bios_init()) {
- vesa_adp = NULL;
- return ENXIO;
- }
- vesa_adp->va_flags |= V_ADP_VESA;
-
- /* remove conflicting modes if we have more than one adapter */
- if (adapters > 1) {
- vesa_clear_modes(vesa_vmode,
- (vesa_adp->va_flags & V_ADP_COLOR) ?
- V_INFO_COLOR : 0);
- }
-
- if ((error = vesa_load_ioctl()) == 0) {
- prevvidsw = vidsw[vesa_adp->va_index];
- vidsw[vesa_adp->va_index] = &vesavidsw;
- vesa_init_done = TRUE;
- } else {
- vesa_adp = NULL;
- return error;
+ adapters = (*prevvidsw.init)();
+ for (i = 0; i < adapters; ++i) {
+ if ((vesa_adp = (*prevvidsw.adapter)(i)) == NULL)
+ continue;
+ if (vesa_adp->va_type == KD_VGA) {
+ vesa_adp->va_flags |= V_ADP_VESA;
+ return adapters;
+ }
}
-
- return 0;
-}
-
-static int
-vesa_nop(void)
-{
- return 0;
-}
-
-static int
-vesa_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- return (*prevvidsw->probe)(unit, adpp, arg, flags);
+ vesa_adp = NULL;
+ return adapters;
}
-static int
-vesa_init(int unit, video_adapter_t *adp, int flags)
+static video_adapter_t
+*vesa_adapter(int ad)
{
- return (*prevvidsw->init)(unit, adp, flags);
+ return (*prevvidsw.adapter)(ad);
}
static int
-vesa_get_info(video_adapter_t *adp, int mode, video_info_t *info)
+vesa_get_info(int ad, int mode, video_info_t *info)
{
int i;
- if ((*prevvidsw->get_info)(adp, mode, info) == 0)
+ if ((*prevvidsw.get_info)(ad, mode, info) == 0)
return 0;
- if (adp != vesa_adp)
+ if (ad != vesa_adp->va_index)
return 1;
mode = vesa_map_gen_mode_num(vesa_adp->va_type,
@@ -615,13 +506,13 @@ vesa_get_info(video_adapter_t *adp, int mode, video_info_t *info)
}
static int
-vesa_query_mode(video_adapter_t *adp, video_info_t *info)
+vesa_query_mode(int ad, video_info_t *info)
{
int i;
- if ((i = (*prevvidsw->query_mode)(adp, info)) != -1)
+ if ((i = (*prevvidsw.query_mode)(ad, info)) != -1)
return i;
- if (adp != vesa_adp)
+ if (ad != vesa_adp->va_index)
return -1;
for (i = 0; vesa_vmode[i].vi_mode != EOT; ++i) {
@@ -653,19 +544,17 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
}
static int
-vesa_set_mode(video_adapter_t *adp, int mode)
+vesa_set_mode(int ad, int mode)
{
video_info_t info;
-#if 0
size_t len;
-#endif
- if (adp != vesa_adp)
- return (*prevvidsw->set_mode)(adp, mode);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.set_mode)(ad, mode);
mode = vesa_map_gen_mode_num(vesa_adp->va_type,
vesa_adp->va_flags & V_ADP_COLOR, mode);
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: set_mode(): %d(%x) -> %d(%x)\n",
vesa_adp->va_mode, vesa_adp->va_mode, mode, mode);
#endif
@@ -673,40 +562,37 @@ vesa_set_mode(video_adapter_t *adp, int mode)
* If the current mode is a VESA mode and the new mode is not,
* restore the state of the adapter first, so that non-standard,
* extended SVGA registers are set to the state compatible with
- * the standard VGA modes. Otherwise (*prevvidsw->set_mode)()
+ * the standard VGA modes. Otherwise (*prevvidsw.set_mode)()
* may not be able to set up the new mode correctly.
*/
if (VESA_MODE(vesa_adp->va_mode)) {
- if ((*prevvidsw->get_info)(adp, mode, &info) == 0) {
- int10_set_mode(vesa_adp->va_initial_bios_mode);
-#if 0
+ if ((*prevvidsw.get_info)(ad, mode, &info) == 0) {
/* assert(vesa_state_buf != NULL); */
if ((vesa_state_buf == NULL)
- || vesa_load_state(adp, vesa_state_buf))
+ || vesa_load_state(ad, vesa_state_buf))
return 1;
free(vesa_state_buf, M_DEVBUF);
vesa_state_buf = NULL;
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: restored\n");
#endif
-#endif /* 0 */
}
/*
- * once (*prevvidsw->get_info)() succeeded,
- * (*prevvidsw->set_mode)() below won't fail...
+ * once (*prevvidsw.get_info)() succeeded,
+ * (*prevvidsw.set_mode)() below won't fail...
*/
}
/* we may not need to handle this mode after all... */
- if ((*prevvidsw->set_mode)(adp, mode) == 0)
+ if ((*prevvidsw.set_mode)(ad, mode) == 0)
return 0;
/* is the new mode supported? */
- if (vesa_get_info(adp, mode, &info))
+ if (vesa_get_info(ad, mode, &info))
return 1;
/* assert(VESA_MODE(mode)); */
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: about to set a VESA mode...\n");
#endif
/*
@@ -714,38 +600,35 @@ vesa_set_mode(video_adapter_t *adp, int mode)
* so that the adapter state can be restored later when a non-VESA
* mode is to be set up. See above.
*/
-#if 0
if (!VESA_MODE(vesa_adp->va_mode) && (vesa_state_buf == NULL)) {
- len = vesa_save_state(adp, NULL, 0);
+ len = vesa_save_state(ad, NULL, 0);
vesa_state_buf = malloc(len, M_DEVBUF, M_WAITOK);
- if (vesa_save_state(adp, vesa_state_buf, len)) {
-#if VESA_DEBUG > 0
+ if (vesa_save_state(ad, vesa_state_buf, len)) {
+#ifdef SC_VIDEO_DEBUG
printf("VESA: state save failed! (len=%d)\n", len);
#endif
free(vesa_state_buf, M_DEVBUF);
vesa_state_buf = NULL;
return 1;
}
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: saved (len=%d)\n", len);
dump_buffer(vesa_state_buf, len);
#endif
}
-#endif /* 0 */
if (vesa_bios_set_mode(mode))
return 1;
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: mode set!\n");
#endif
vesa_adp->va_mode = mode;
- vesa_adp->va_mode_flags = info.vi_flags;
vesa_adp->va_flags &= ~V_ADP_COLOR;
vesa_adp->va_flags |=
(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
vesa_adp->va_crtc_addr =
- (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
+ (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_BASE : MONO_BASE;
vesa_adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
vesa_adp->va_window_size = info.vi_window_size;
vesa_adp->va_window_gran = info.vi_window_gran;
@@ -757,77 +640,58 @@ vesa_set_mode(video_adapter_t *adp, int mode)
vesa_adp->va_buffer_size = info.vi_buffer_size;
}
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
return 0;
}
static int
-vesa_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vesa_save_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
- return (*prevvidsw->save_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw.save_font)(ad, page, fontsize, data, ch, count);
}
static int
-vesa_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vesa_load_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
- return (*prevvidsw->load_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw.load_font)(ad, page, fontsize, data, ch, count);
}
static int
-vesa_show_font(video_adapter_t *adp, int page)
+vesa_show_font(int ad, int page)
{
- return (*prevvidsw->show_font)(adp, page);
+ return (*prevvidsw.show_font)(ad, page);
}
static int
-vesa_save_palette(video_adapter_t *adp, u_char *palette)
+vesa_save_palette(int ad, u_char *palette)
{
- int bits;
- int error;
-
- if ((adp == vesa_adp) && (vesa_adp_info->v_flags & V_DAC8)
- && ((bits = vesa_bios_set_dac(8)) > 6)) {
- error = vesa_bios_save_palette(0, 256, palette, bits);
- if (error == 0)
- return 0;
- vesa_bios_set_dac(6);
- }
+ if ((ad != vesa_adp->va_index) || !(vesa_adp_info->v_flags & V_DAC8)
+ || vesa_bios_set_dac(8))
+ return (*prevvidsw.save_palette)(ad, palette);
- return (*prevvidsw->save_palette)(adp, palette);
+ return vesa_bios_save_palette(0, 256, palette);
}
static int
-vesa_load_palette(video_adapter_t *adp, u_char *palette)
+vesa_load_palette(int ad, u_char *palette)
{
- int bits;
- int error;
-
- if ((adp == vesa_adp) && (vesa_adp_info->v_flags & V_DAC8)
- && ((bits = vesa_bios_set_dac(8)) > 6)) {
- error = vesa_bios_load_palette(0, 256, palette, bits);
- if (error == 0)
- return 0;
- vesa_bios_set_dac(6);
- }
+ if ((ad != vesa_adp->va_index) || !(vesa_adp_info->v_flags & V_DAC8)
+ || vesa_bios_set_dac(8))
+ return (*prevvidsw.load_palette)(ad, palette);
- return (*prevvidsw->load_palette)(adp, palette);
+ return vesa_bios_load_palette(0, 256, palette);
}
static int
-vesa_set_border(video_adapter_t *adp, int color)
+vesa_set_border(int ad, int color)
{
- return (*prevvidsw->set_border)(adp, color);
+ return (*prevvidsw.set_border)(ad, color);
}
static int
-vesa_save_state(video_adapter_t *adp, void *p, size_t size)
+vesa_save_state(int ad, void *p, size_t size)
{
- if (adp != vesa_adp)
- return (*prevvidsw->save_state)(adp, p, size);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.save_state)(ad, p, size);
if (vesa_state_buf_size == 0)
vesa_state_buf_size = vesa_bios_state_buf_size();
@@ -843,17 +707,18 @@ vesa_save_state(video_adapter_t *adp, void *p, size_t size)
}
static int
-vesa_load_state(video_adapter_t *adp, void *p)
+vesa_load_state(int ad, void *p)
{
- if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG))
- return (*prevvidsw->load_state)(adp, p);
+ if ((ad != vesa_adp->va_index)
+ || (((adp_state_t *)p)->sig != V_STATE_SIG))
+ return (*prevvidsw.load_state)(ad, p);
return vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs,
vesa_state_buf_size);
}
static int
-vesa_set_origin(video_adapter_t *adp, off_t offset)
+vesa_set_origin(int ad, off_t offset)
{
struct vm86frame vmf;
int err;
@@ -864,8 +729,8 @@ vesa_set_origin(video_adapter_t *adp, off_t offset)
* error checking is kept minimal and let the VESA BIOS to
* detect error.
*/
- if (adp != vesa_adp)
- return (*prevvidsw->set_win_org)(adp, offset);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.set_win_org)(ad, offset);
if (vesa_adp->va_window_gran == 0)
return 1;
@@ -878,45 +743,27 @@ vesa_set_origin(video_adapter_t *adp, off_t offset)
}
static int
-vesa_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
+vesa_read_hw_cursor(int ad, int *col, int *row)
{
- return (*prevvidsw->read_hw_cursor)(adp, col, row);
+ return (*prevvidsw.read_hw_cursor)(ad, col, row);
}
static int
-vesa_set_hw_cursor(video_adapter_t *adp, int col, int row)
+vesa_set_hw_cursor(int ad, int col, int row)
{
- return (*prevvidsw->set_hw_cursor)(adp, col, row);
+ return (*prevvidsw.set_hw_cursor)(ad, col, row);
}
static int
-vesa_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
+vesa_diag(int level)
{
- return (*prevvidsw->set_hw_cursor_shape)(adp, base, height, celsize,
- blink);
-}
-
-static int
-vesa_mmap(video_adapter_t *adp, vm_offset_t offset)
-{
- return (*prevvidsw->mmap)(adp, offset);
-}
-
-static int
-vesa_diag(video_adapter_t *adp, int level)
-{
-#if VESA_DEBUG > 1
struct vesa_mode vmode;
+ u_int32_t p;
int i;
-#endif
-
- if (adp != vesa_adp)
- return 1;
-#ifndef KLD_MODULE
+#ifndef VESA_MODULE
/* call the previous handler first */
- (*prevvidsw->diag)(adp, level);
+ (*prevvidsw.diag)(level);
#endif
/* general adapter information */
@@ -946,7 +793,6 @@ vesa_diag(video_adapter_t *adp, int level)
printf("VESA: %s\n", vesa_revstr);
}
-#if VESA_DEBUG > 1
/* mode information */
for (i = 0;
(i < (M_VESA_MODE_MAX - M_VESA_BASE + 1))
@@ -981,40 +827,79 @@ vesa_diag(video_adapter_t *adp, int level)
printf("size:%dk, gran:%dk\n",
vmode.v_wsize, vmode.v_wgran);
}
-#endif
return 0;
}
/* module loading */
+#ifdef VESA_MODULE
static int
+vesa_load(struct lkm_table *lkmtp, int cmd)
+#else
+int
vesa_load(void)
+#endif
{
+ int adapters;
int error;
int s;
+ int i;
if (vesa_init_done)
return 0;
- /* locate a VGA adapter */
- s = spltty();
+ /*
+ * If the VESA module is statically linked to the kernel, or
+ * it has already been loaded, abort loading this module this time.
+ */
vesa_adp = NULL;
- error = vesa_configure(0);
+ adapters = (*biosvidsw.init)();
+ for (i = 0; i < adapters; ++i) {
+ if ((vesa_adp = (*biosvidsw.adapter)(i)) == NULL)
+ continue;
+ if (vesa_adp->va_flags & V_ADP_VESA)
+ return ENXIO;
+ if (vesa_adp->va_type == KD_VGA)
+ break;
+ }
+ /* if a VGA adapter is not found, abort */
+ if (i >= adapters)
+ return ENXIO;
+
+ if (vesa_bios_init())
+ return ENXIO;
+ vesa_adp->va_flags |= V_ADP_VESA;
+
+ /* remove conflicting modes if we have more than one adapter */
+ if (adapters > 1) {
+ vesa_clear_modes(vesa_vmode,
+ (vesa_adp->va_flags & V_ADP_COLOR) ?
+ V_INFO_COLOR : 0);
+ }
+
+#ifdef VESA_MODULE
+ s = spltty();
+#endif
+ if ((error = vesa_load_ioctl()) == 0) {
+ bcopy(&biosvidsw, &prevvidsw, sizeof(prevvidsw));
+ bcopy(&vesavidsw, &biosvidsw, sizeof(vesavidsw));
+ vesa_init_done = TRUE;
+ }
+#ifdef VESA_MODULE
splx(s);
-#ifdef KLD_MODULE
if (error == 0)
- vesa_diag(vesa_adp, bootverbose);
+ vesa_diag(bootverbose);
#endif
return error;
}
-#ifdef KLD_MODULE
+#ifdef VESA_MODULE
static int
-vesa_unload(void)
+vesa_unload(struct lkm_table *lkmtp, int cmd)
{
int error;
int s;
@@ -1029,42 +914,22 @@ vesa_unload(void)
s = spltty();
if ((error = vesa_unload_ioctl()) == 0) {
- if (vesa_adp != NULL)
+ if (vesa_adp)
vesa_adp->va_flags &= ~V_ADP_VESA;
- vidsw[vesa_adp->va_index] = prevvidsw;
+ bcopy(&prevvidsw, &biosvidsw, sizeof(biosvidsw));
}
splx(s);
return error;
}
-static int
-vesa_mod_event(module_t mod, int type, void *data)
+int
+vesa_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
- switch (type) {
- case MOD_LOAD:
- return vesa_load();
- case MOD_UNLOAD:
- return vesa_unload();
- default:
- break;
- }
- return 0;
+ MOD_DISPATCH(vesa, lkmtp, cmd, ver,
+ vesa_load, vesa_unload, lkm_nullcmd);
}
-static moduledata_t vesa_mod = {
- "vesa",
- vesa_mod_event,
- NULL,
-};
-
-DECLARE_MODULE(vesa, vesa_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-
-#else /* KLD_MODULE */
-
-SYSINIT(vesa, SI_SUB_DRIVERS, SI_ORDER_MIDDLE,
- (void (*)(void *))vesa_load, NULL);
-
-#endif /* KLD_MODULE */
+#endif /* VESA_MODULE */
-#endif /* (NVGA > 0 && VESA && VM86) || KLD_MODULE */
+#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */
diff --git a/sys/i386/isa/vga_isa.c b/sys/i386/isa/vga_isa.c
deleted file mode 100644
index 0aaab5c0d8a4..000000000000
--- a/sys/i386/isa/vga_isa.c
+++ /dev/null
@@ -1,2238 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * Copyright (c) 1992-1998 Søren Schmidt
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
- *
- * $Id: $
- */
-
-#include "vga.h"
-#include "opt_vga.h"
-#include "opt_fb.h"
-#include "opt_syscons.h" /* should be removed in the future, XXX */
-
-#if NVGA > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/console.h>
-#include <machine/md_var.h>
-#include <machine/pc/bios.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
-
-#ifndef __i386__
-#include <isa/isareg.h>
-#include <isa/isavar.h>
-#else
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-#endif
-
-#define DRIVER_NAME "vga"
-
-/* cdev driver declaration */
-
-#define ISAVGA_UNIT(dev) minor(dev)
-#define ISAVGA_MKMINOR(unit) (unit)
-
-typedef struct isavga_softc {
- video_adapter_t *adp;
-} isavga_softc_t;
-
-#ifndef __i386__
-
-#define ISAVGA_SOFTC(unit) \
- ((isavga_softc_t *)devclass_get_softc(isavga_devclass, unit))
-
-devclass_t isavga_devclass;
-
-static int isavga_probe(device_t dev);
-static int isavga_attach(device_t dev);
-
-static device_method_t isavga_methods[] = {
- DEVMETHOD(device_probe, isavga_probe),
- DEVMETHOD(device_attach, isavga_attach),
- { 0, 0 }
-};
-
-static driver_t isavga_driver = {
- DRIVER_NAME,
- isavga_methods,
- DRIVER_TYPE_TTY,
- sizeof(isavga_softc_t),
-};
-
-#else /* __i386__ */
-
-#define ISAVGA_SOFTC(unit) (isavga_softc[unit])
-
-static isavga_softc_t *isavga_softc[NVGA];
-
-static int isavga_probe(struct isa_device *dev);
-static int isavga_attach(struct isa_device *dev);
-
-struct isa_driver vgadriver = {
- isavga_probe,
- isavga_attach,
- DRIVER_NAME,
- 0,
-};
-
-#endif /* __i386__ */
-
-static int isavga_probe_unit(int unit, isavga_softc_t *sc,
- int flags);
-static int isavga_attach_unit(int unit, isavga_softc_t *sc,
- int flags);
-
-#ifdef FB_INSTALL_CDEV
-
-static d_open_t isavgaopen;
-static d_close_t isavgaclose;
-static d_read_t isavgaread;
-static d_ioctl_t isavgaioctl;
-
-static struct cdevsw vga_cdevsw = {
- isavgaopen, isavgaclose, noread, nowrite, /* ?? */
- isavgaioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-#endif /* FB_INSTALL_CDEV */
-
-#ifndef __i386__
-
-static int
-isavga_probe(device_t dev)
-{
- isavga_softc_t *sc;
-
- sc = device_get_softc(dev);
- return isavga_probe_unit(device_get_unit(dev), sc, isa_get_flags(dev));
-}
-
-static int
-isavga_attach(device_t dev)
-{
- isavga_softc_t *sc;
-
- sc = device_get_softc(dev);
- return isavga_attach_unit(device_get_unit(dev), sc, isa_get_flags(dev));
-}
-
-#else /* __i386__ */
-
-static int
-isavga_probe(struct isa_device *dev)
-{
- isavga_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(isavga_softc)/sizeof(isavga_softc[0]))
- return 0;
- sc = isavga_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
-
- error = isavga_probe_unit(dev->id_unit, sc, dev->id_flags);
- if (error) {
- isavga_softc[dev->id_unit] = NULL;
- free(sc, M_DEVBUF);
- return 0;
- }
-
- dev->id_iobase = sc->adp->va_io_base;
- dev->id_maddr = (caddr_t)BIOS_PADDRTOVADDR(sc->adp->va_mem_base);
- dev->id_msize = sc->adp->va_mem_size;
-
- return sc->adp->va_io_size;
-}
-
-static int
-isavga_attach(struct isa_device *dev)
-{
- isavga_softc_t *sc;
-
- if (dev->id_unit >= sizeof(isavga_softc)/sizeof(isavga_softc[0]))
- return 0;
- sc = isavga_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((isavga_attach_unit(dev->id_unit, sc, dev->id_flags)) ? 0 : 1);
-}
-
-#endif /* __i386__ */
-
-static int
-isavga_probe_unit(int unit, isavga_softc_t *sc, int flags)
-{
- video_switch_t *sw;
-
- bzero(sc, sizeof(*sc));
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return 0;
- return (*sw->probe)(unit, &sc->adp, NULL, flags);
-}
-
-static int
-isavga_attach_unit(int unit, isavga_softc_t *sc, int flags)
-{
- video_switch_t *sw;
- int error;
-
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- error = (*sw->init)(unit, sc->adp, flags);
- if (error)
- return ENXIO;
-
-#ifdef FB_INSTALL_CDEV
- /* attach a virtual frame buffer device */
- error = fb_attach(makedev(0, ISAVGA_MKMINOR(unit)), scp->adp,
- &vga_cdevsw);
- if (error)
- return error;
-#endif /* FB_INSTALL_CDEV */
-
- if (bootverbose)
- (*sw->diag)(sc->adp, bootverbose);
-
- return 0;
-}
-
-/* LOW-LEVEL */
-
-#include <machine/clock.h>
-#include <machine/pc/vesa.h>
-
-#define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED)
-#define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED)
-#define config_done(adp) ((adp)->va_flags & V_ADP_REGISTERED)
-
-/* for compatibility with old kernel options */
-#ifdef SC_ALT_SEQACCESS
-#undef SC_ALT_SEQACCESS
-#undef VGA_ALT_SEQACCESS
-#define VGA_ALT_SEQACCESS 1
-#endif
-
-#ifdef SLOW_VGA
-#undef SLOW_VGA
-#undef VGA_SLOW_IOACCESS
-#define VGA_SLOW_IOACCESS 1
-#endif
-
-/* architecture dependent option */
-#ifdef __alpha__
-#define VGA_NO_BIOS 1
-#endif
-
-/* this should really be in `rtc.h' */
-#define RTC_EQUIPMENT 0x14
-
-/* various sizes */
-#define V_MODE_MAP_SIZE (M_VGA_CG320 + 1)
-#define V_MODE_PARAM_SIZE 64
-
-/* video adapter state buffer */
-struct adp_state {
- int sig;
-#define V_STATE_SIG 0x736f6962
- u_char regs[V_MODE_PARAM_SIZE];
-};
-typedef struct adp_state adp_state_t;
-
-/* video adapter information */
-#define DCC_MONO 0
-#define DCC_CGA40 1
-#define DCC_CGA80 2
-#define DCC_EGAMONO 3
-#define DCC_EGA40 4
-#define DCC_EGA80 5
-
-/*
- * NOTE: `va_window' should have a virtual address, but is initialized
- * with a physical address in the following table, as verify_adapter()
- * will perform address conversion at run-time.
- */
-static video_adapter_t adapter_init_value[] = {
- /* DCC_MONO */
- { 0, KD_MONO, "mda", 0, 0, 0, IO_MDA, IO_MDASIZE, MONO_CRTC,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE,
- 0, 0, 0, 7, 0, 0, NULL },
- /* DCC_CGA40 */
- { 0, KD_CGA, "cga", 0, 0, V_ADP_COLOR, IO_CGA, IO_CGASIZE, COLOR_CRTC,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_CGA80 */
- { 0, KD_CGA, "cga", 0, 0, V_ADP_COLOR, IO_CGA, IO_CGASIZE, COLOR_CRTC,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_EGAMONO */
- { 0, KD_EGA, "ega", 0, 0, 0, IO_MDA, 48, MONO_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE,
- 0, 0, 0, 7, 0, 0, NULL },
- /* DCC_EGA40 */
- { 0, KD_EGA, "ega", 0, 0, V_ADP_COLOR, IO_MDA, 48, COLOR_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_EGA80 */
- { 0, KD_EGA, "ega", 0, 0, V_ADP_COLOR, IO_MDA, 48, COLOR_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
-};
-
-static video_adapter_t biosadapter[2];
-static int biosadapters = 0;
-
-/* video driver declarations */
-static int vga_configure(int flags);
- int (*vga_sub_configure)(int flags);
-static int vga_nop(void);
-static vi_probe_t vga_probe;
-static vi_init_t vga_init;
-static vi_get_info_t vga_get_info;
-static vi_query_mode_t vga_query_mode;
-static vi_set_mode_t vga_set_mode;
-static vi_save_font_t vga_save_font;
-static vi_load_font_t vga_load_font;
-static vi_show_font_t vga_show_font;
-static vi_save_palette_t vga_save_palette;
-static vi_load_palette_t vga_load_palette;
-static vi_set_border_t vga_set_border;
-static vi_save_state_t vga_save_state;
-static vi_load_state_t vga_load_state;
-static vi_set_win_org_t vga_set_origin;
-static vi_read_hw_cursor_t vga_read_hw_cursor;
-static vi_set_hw_cursor_t vga_set_hw_cursor;
-static vi_set_hw_cursor_shape_t vga_set_hw_cursor_shape;
-static vi_mmap_t vga_mmap;
-static vi_diag_t vga_diag;
-
-static video_switch_t vgavidsw = {
- vga_probe,
- vga_init,
- vga_get_info,
- vga_query_mode,
- vga_set_mode,
- vga_save_font,
- vga_load_font,
- vga_show_font,
- vga_save_palette,
- vga_load_palette,
- vga_set_border,
- vga_save_state,
- vga_load_state,
- vga_set_origin,
- vga_read_hw_cursor,
- vga_set_hw_cursor,
- vga_set_hw_cursor_shape,
- (vi_blank_display_t *)vga_nop,
- vga_mmap,
- vga_diag,
-};
-
-VIDEO_DRIVER(mda, vgavidsw, NULL);
-VIDEO_DRIVER(cga, vgavidsw, NULL);
-VIDEO_DRIVER(ega, vgavidsw, NULL);
-VIDEO_DRIVER(vga, vgavidsw, vga_configure);
-
-/* VGA BIOS standard video modes */
-#define EOT (-1)
-#define NA (-2)
-
-static video_info_t bios_vmode[] = {
- /* CGA */
- { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- /* EGA */
- { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- /* VGA */
- { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- /* MDA */
- { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- /* EGA */
- { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- /* VGA */
- { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
-#ifndef VGA_NO_MODE_CHANGE
- /* CGA */
- { M_BG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_BG640, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8, 8, 1, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- /* EGA */
- { M_CG320_D, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640_E, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8, 8, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_EGAMONOAPA, V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, 64*1024, 0, 0 },
- { M_ENHMONOAPA2,V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640x350, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 2, 2,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_ENH_CG640, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- /* VGA */
- { M_BG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_VGA_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 8, 1,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_VGA_MODEX, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 240, 8, 8, 8, 1,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
-#endif /* VGA_NO_MODE_CHANGE */
-
- { EOT },
-};
-
-static int init_done = FALSE;
-static u_char *video_mode_ptr = NULL; /* EGA/VGA */
-static u_char *video_mode_ptr2 = NULL; /* CGA/MDA */
-static u_char *mode_map[V_MODE_MAP_SIZE];
-static adp_state_t adpstate;
-static adp_state_t adpstate2;
-static int rows_offset = 1;
-
-/* local macros and functions */
-#define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff))
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-static void map_mode_table(u_char *map[], u_char *table, int max);
-#endif
-static void clear_mode_map(video_adapter_t *adp, u_char *map[], int max,
- int color);
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-static int map_mode_num(int mode);
-#endif
-static int map_gen_mode_num(int type, int color, int mode);
-static int map_bios_mode_num(int type, int color, int bios_mode);
-static u_char *get_mode_param(int mode);
-#ifndef VGA_NO_BIOS
-static void fill_adapter_param(int code, video_adapter_t *adp);
-#endif
-static int verify_adapter(video_adapter_t *adp);
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-#define COMP_IDENTICAL 0
-#define COMP_SIMILAR 1
-#define COMP_DIFFERENT 2
-static int comp_adpregs(u_char *buf1, u_char *buf2);
-#endif
-static int probe_adapters(void);
-
-#define PARAM_BUFSIZE 6
-static void set_font_mode(video_adapter_t *adp, u_char *buf);
-static void set_normal_mode(video_adapter_t *adp, u_char *buf);
-
-static void dump_buffer(u_char *buf, size_t len);
-
-#define ISMAPPED(pa, width) \
- (((pa) <= (u_long)0x1000 - (width)) \
- || ((pa) >= ISA_HOLE_START && (pa) <= 0x100000 - (width)))
-
-#define prologue(adp, flag, err) \
- if (!init_done || !((adp)->va_flags & (flag))) \
- return (err)
-
-/* a backdoor for the console driver */
-static int
-vga_configure(int flags)
-{
- int i;
-
- probe_adapters();
- for (i = 0; i < biosadapters; ++i) {
- if (!probe_done(&biosadapter[i]))
- continue;
- biosadapter[i].va_flags |= V_ADP_INITIALIZED;
- if (!config_done(&biosadapter[i])) {
- if (vid_register(&biosadapter[i]) < 0)
- continue;
- biosadapter[i].va_flags |= V_ADP_REGISTERED;
- }
- }
- if (vga_sub_configure != NULL)
- (*vga_sub_configure)(flags);
-
- return biosadapters;
-}
-
-/* local subroutines */
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-/* construct the mode parameter map */
-static void
-map_mode_table(u_char *map[], u_char *table, int max)
-{
- int i;
-
- for(i = 0; i < max; ++i)
- map[i] = table + i*V_MODE_PARAM_SIZE;
- for(; i < V_MODE_MAP_SIZE; ++i)
- map[i] = NULL;
-}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
-
-static void
-clear_mode_map(video_adapter_t *adp, u_char *map[], int max, int color)
-{
- video_info_t info;
- int i;
-
- /*
- * NOTE: we don't touch `bios_vmode[]' because it is shared
- * by all adapters.
- */
- for(i = 0; i < max; ++i) {
- if (vga_get_info(adp, i, &info))
- continue;
- if ((info.vi_flags & V_INFO_COLOR) != color)
- map[i] = NULL;
- }
-}
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-/* map the non-standard video mode to a known mode number */
-static int
-map_mode_num(int mode)
-{
- static struct {
- int from;
- int to;
- } mode_map[] = {
- { M_ENH_B80x43, M_ENH_B80x25 },
- { M_ENH_C80x43, M_ENH_C80x25 },
- { M_VGA_M80x30, M_VGA_M80x25 },
- { M_VGA_C80x30, M_VGA_C80x25 },
- { M_VGA_M80x50, M_VGA_M80x25 },
- { M_VGA_C80x50, M_VGA_C80x25 },
- { M_VGA_M80x60, M_VGA_M80x25 },
- { M_VGA_C80x60, M_VGA_C80x25 },
- { M_VGA_MODEX, M_VGA_CG320 },
- };
- int i;
-
- for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
- if (mode_map[i].from == mode)
- return mode_map[i].to;
- }
- return mode;
-}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
-
-/* map a generic video mode to a known mode number */
-static int
-map_gen_mode_num(int type, int color, int mode)
-{
- static struct {
- int from;
- int to_color;
- int to_mono;
- } mode_map[] = {
- { M_TEXT_80x30, M_VGA_C80x30, M_VGA_M80x30, },
- { M_TEXT_80x43, M_ENH_C80x43, M_ENH_B80x43, },
- { M_TEXT_80x50, M_VGA_C80x50, M_VGA_M80x50, },
- { M_TEXT_80x60, M_VGA_C80x60, M_VGA_M80x60, },
- };
- int i;
-
- if (mode == M_TEXT_80x25) {
- switch (type) {
-
- case KD_VGA:
- if (color)
- return M_VGA_C80x25;
- else
- return M_VGA_M80x25;
- break;
-
- case KD_EGA:
- if (color)
- return M_ENH_C80x25;
- else
- return M_EGAMONO80x25;
- break;
-
- case KD_CGA:
- return M_C80x25;
-
- case KD_MONO:
- case KD_HERCULES:
- return M_EGAMONO80x25; /* XXX: this name is confusing */
-
- default:
- return -1;
- }
- }
-
- for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
- if (mode_map[i].from == mode)
- return ((color) ? mode_map[i].to_color : mode_map[i].to_mono);
- }
- return mode;
-}
-
-/* turn the BIOS video number into our video mode number */
-static int
-map_bios_mode_num(int type, int color, int bios_mode)
-{
- static int cga_modes[7] = {
- M_B40x25, M_C40x25, /* 0, 1 */
- M_B80x25, M_C80x25, /* 2, 3 */
- M_BG320, M_CG320,
- M_BG640,
- };
- static int ega_modes[17] = {
- M_ENH_B40x25, M_ENH_C40x25, /* 0, 1 */
- M_ENH_B80x25, M_ENH_C80x25, /* 2, 3 */
- M_BG320, M_CG320,
- M_BG640,
- M_EGAMONO80x25, /* 7 */
- 8, 9, 10, 11, 12,
- M_CG320_D,
- M_CG640_E,
- M_ENHMONOAPA2, /* XXX: video momery > 64K */
- M_ENH_CG640, /* XXX: video momery > 64K */
- };
- static int vga_modes[20] = {
- M_VGA_C40x25, M_VGA_C40x25, /* 0, 1 */
- M_VGA_C80x25, M_VGA_C80x25, /* 2, 3 */
- M_BG320, M_CG320,
- M_BG640,
- M_VGA_M80x25, /* 7 */
- 8, 9, 10, 11, 12,
- M_CG320_D,
- M_CG640_E,
- M_ENHMONOAPA2,
- M_ENH_CG640,
- M_BG640x480, M_CG640x480,
- M_VGA_CG320,
- };
-
- switch (type) {
-
- case KD_VGA:
- if (bios_mode < sizeof(vga_modes)/sizeof(vga_modes[0]))
- return vga_modes[bios_mode];
- else if (color)
- return M_VGA_C80x25;
- else
- return M_VGA_M80x25;
- break;
-
- case KD_EGA:
- if (bios_mode < sizeof(ega_modes)/sizeof(ega_modes[0]))
- return ega_modes[bios_mode];
- else if (color)
- return M_ENH_C80x25;
- else
- return M_EGAMONO80x25;
- break;
-
- case KD_CGA:
- if (bios_mode < sizeof(cga_modes)/sizeof(cga_modes[0]))
- return cga_modes[bios_mode];
- else
- return M_C80x25;
- break;
-
- case KD_MONO:
- case KD_HERCULES:
- return M_EGAMONO80x25; /* XXX: this name is confusing */
-
- default:
- break;
- }
- return -1;
-}
-
-/* look up a parameter table entry */
-static u_char
-*get_mode_param(int mode)
-{
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- if (mode >= V_MODE_MAP_SIZE)
- mode = map_mode_num(mode);
-#endif
- if ((mode >= 0) && (mode < V_MODE_MAP_SIZE))
- return mode_map[mode];
- else
- return NULL;
-}
-
-#ifndef VGA_NO_BIOS
-static void
-fill_adapter_param(int code, video_adapter_t *adp)
-{
- static struct {
- int primary;
- int secondary;
- } dcc[] = {
- { DCC_MONO, DCC_EGA40 /* CGA monitor */ },
- { DCC_MONO, DCC_EGA80 /* CGA monitor */ },
- { DCC_MONO, DCC_EGA80 /* CGA emulation */ },
- { DCC_MONO, DCC_EGA80 },
- { DCC_CGA40, DCC_EGAMONO },
- { DCC_CGA80, DCC_EGAMONO },
- { DCC_EGA40 /* CGA monitor */, DCC_MONO},
- { DCC_EGA80 /* CGA monitor */, DCC_MONO},
- { DCC_EGA80 /* CGA emulation */,DCC_MONO },
- { DCC_EGA80, DCC_MONO },
- { DCC_EGAMONO, DCC_CGA40 },
- { DCC_EGAMONO, DCC_CGA40 },
- };
-
- if ((code < 0) || (code >= sizeof(dcc)/sizeof(dcc[0]))) {
- adp[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
- adp[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
- } else {
- adp[V_ADP_PRIMARY] = adapter_init_value[dcc[code].primary];
- adp[V_ADP_SECONDARY] = adapter_init_value[dcc[code].secondary];
- }
-}
-#endif /* VGA_NO_BIOS */
-
-static int
-verify_adapter(video_adapter_t *adp)
-{
- volatile u_int16_t *buf;
- u_int16_t v;
- u_int32_t p;
-
- buf = (u_int16_t *)BIOS_PADDRTOVADDR(adp->va_window);
- v = readw(buf);
- writew(buf, 0xA55A);
- if (readw(buf) != 0xA55A)
- return 1;
- writew(buf, v);
-
- switch (adp->va_type) {
-
- case KD_EGA:
- outb(adp->va_crtc_addr, 7);
- if (inb(adp->va_crtc_addr) == 7) {
- adp->va_type = KD_VGA;
- adp->va_name = "vga";
- adp->va_flags |= V_ADP_STATESAVE | V_ADP_PALETTE;
- }
- adp->va_flags |= V_ADP_STATELOAD | V_ADP_BORDER;
- /* the color adapter may be in the 40x25 mode... XXX */
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- /* get the BIOS video mode pointer */
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8);
- p = BIOS_SADDRTOLADDR(p);
- if (ISMAPPED(p, sizeof(u_int32_t))) {
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(p);
- p = BIOS_SADDRTOLADDR(p);
- if (ISMAPPED(p, V_MODE_PARAM_SIZE))
- video_mode_ptr = (u_char *)BIOS_PADDRTOVADDR(p);
- }
-#endif
- break;
-
- case KD_CGA:
- adp->va_flags |= V_ADP_COLOR | V_ADP_BORDER;
- /* may be in the 40x25 mode... XXX */
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- /* get the BIOS video mode pointer */
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x1d*4);
- p = BIOS_SADDRTOLADDR(p);
- video_mode_ptr2 = (u_char *)BIOS_PADDRTOVADDR(p);
-#endif
- break;
-
- case KD_MONO:
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- /* get the BIOS video mode pointer */
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x1d*4);
- p = BIOS_SADDRTOLADDR(p);
- video_mode_ptr2 = (u_char *)BIOS_PADDRTOVADDR(p);
-#endif
- break;
- }
-
- return 0;
-}
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
-/* compare two parameter table entries */
-static int
-comp_adpregs(u_char *buf1, u_char *buf2)
-{
- static struct {
- u_char mask;
- } params[V_MODE_PARAM_SIZE] = {
- 0xff, 0x00, 0xff, /* COLS, ROWS, POINTS */
- 0x00, 0x00, /* page length */
- 0xfe, 0xff, 0xff, 0xff, /* sequencer registers */
- 0xf3, /* misc register */
- 0xff, 0xff, 0xff, 0x7f, 0xff, /* CRTC */
- 0xff, 0xff, 0xff, 0x7f, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xff, 0x7f, 0xff, 0xff,
- 0x7f, 0xff, 0xff, 0xef, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, /* attribute controller registers */
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xf0,
- 0xff, 0xff, 0xff, 0xff, 0xff, /* GDC register */
- 0xff, 0xff, 0xff, 0xff,
- };
- int identical = TRUE;
- int i;
-
- if ((buf1 == NULL) || (buf2 == NULL))
- return COMP_DIFFERENT;
-
- for (i = 0; i < sizeof(params)/sizeof(params[0]); ++i) {
- if (params[i].mask == 0) /* don't care */
- continue;
- if ((buf1[i] & params[i].mask) != (buf2[i] & params[i].mask))
- return COMP_DIFFERENT;
- if (buf1[i] != buf2[i])
- identical = FALSE;
- }
- return (identical) ? COMP_IDENTICAL : COMP_SIMILAR;
-}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
-
-/* probe video adapters and return the number of detected adapters */
-static int
-probe_adapters(void)
-{
- video_adapter_t *adp;
- video_info_t info;
- u_char *mp;
- int i;
-
- /* do this test only once */
- if (init_done)
- return biosadapters;
- init_done = TRUE;
-
- /*
- * Locate display adapters.
- * The AT architecture supports upto two adapters. `syscons' allows
- * the following combinations of adapters:
- * 1) MDA + CGA
- * 2) MDA + EGA/VGA color
- * 3) CGA + EGA/VGA mono
- * Note that `syscons' doesn't bother with MCGA as it is only
- * avaiable for low end PS/2 models which has 80286 or earlier CPUs,
- * thus, they are not running FreeBSD!
- * When there are two adapaters in the system, one becomes `primary'
- * and the other `secondary'. The EGA adapter has a set of DIP
- * switches on board for this information and the EGA BIOS copies
- * it in the BIOS data area BIOSDATA_VIDEOSWITCH (40:88).
- * The VGA BIOS has more sophisticated mechanism and has this
- * information in BIOSDATA_DCCINDEX (40:8a), but it also maintains
- * compatibility with the EGA BIOS by updating BIOSDATA_VIDEOSWITCH.
- */
-
- /*
- * Check rtc and BIOS data area.
- * XXX: we don't use BIOSDATA_EQUIPMENT, since it is not a dead
- * copy of RTC_EQUIPMENT. Bits 4 and 5 of ETC_EQUIPMENT are
- * zeros for EGA and VGA. However, the EGA/VGA BIOS sets
- * these bits in BIOSDATA_EQUIPMENT according to the monitor
- * type detected.
- */
-#ifndef VGA_NO_BIOS
- switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
- case 0:
- /* EGA/VGA */
- fill_adapter_param(readb(BIOS_PADDRTOVADDR(0x488)) & 0x0f,
- biosadapter);
- break;
- case 1:
- /* CGA 40x25 */
- /* FIXME: switch to the 80x25 mode? XXX */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
- break;
- case 2:
- /* CGA 80x25 */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
- break;
- case 3:
- /* MDA */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
- break;
- }
-#else
- /* assume EGA/VGA? XXX */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_EGA80];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
-#endif /* VGA_NO_BIOS */
-
- biosadapters = 0;
- if (verify_adapter(&biosadapter[V_ADP_SECONDARY]) == 0) {
- ++biosadapters;
- biosadapter[V_ADP_SECONDARY].va_flags |= V_ADP_PROBED;
- biosadapter[V_ADP_SECONDARY].va_mode =
- biosadapter[V_ADP_SECONDARY].va_initial_mode =
- map_bios_mode_num(biosadapter[V_ADP_SECONDARY].va_type,
- biosadapter[V_ADP_SECONDARY].va_flags
- & V_ADP_COLOR,
- biosadapter[V_ADP_SECONDARY].va_initial_bios_mode);
- } else {
- biosadapter[V_ADP_SECONDARY].va_type = -1;
- }
- if (verify_adapter(&biosadapter[V_ADP_PRIMARY]) == 0) {
- ++biosadapters;
- biosadapter[V_ADP_PRIMARY].va_flags |= V_ADP_PROBED;
-#ifndef VGA_NO_BIOS
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode =
- readb(BIOS_PADDRTOVADDR(0x449));
-#else
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode = 3; /* XXX */
-#endif
- biosadapter[V_ADP_PRIMARY].va_mode =
- biosadapter[V_ADP_PRIMARY].va_initial_mode =
- map_bios_mode_num(biosadapter[V_ADP_PRIMARY].va_type,
- biosadapter[V_ADP_PRIMARY].va_flags & V_ADP_COLOR,
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode);
- } else {
- biosadapter[V_ADP_PRIMARY] = biosadapter[V_ADP_SECONDARY];
- biosadapter[V_ADP_SECONDARY].va_type = -1;
- }
- if (biosadapters == 0)
- return biosadapters;
-#if 0
- biosadapter[V_ADP_PRIMARY].va_index = V_ADP_PRIMARY;
- biosadapter[V_ADP_SECONDARY].va_index = V_ADP_SECONDARY;
-#endif
- biosadapter[V_ADP_PRIMARY].va_unit = V_ADP_PRIMARY;
- biosadapter[V_ADP_SECONDARY].va_unit = V_ADP_SECONDARY;
-
-#if 0 /* we don't need these... */
- fb_init_struct(&biosadapter[V_ADP_PRIMARY], ...);
- fb_init_struct(&biosadapter[V_ADP_SECONDARY], ...);
-#endif
-
-#if 0
- /*
- * We cannot have two video adapter of the same type; there must be
- * only one of color or mono adapter, or one each of them.
- */
- if (biosadapters > 1) {
- if (!((biosadapter[0].va_flags ^ biosadapter[1].va_flags)
- & V_ADP_COLOR))
- /* we have two mono or color adapters!! */
- return (biosadapters = 0);
- }
-#endif
-
- /*
- * Ensure a zero start address. This is mainly to recover after
- * switching from pcvt using userconfig(). The registers are w/o
- * for old hardware so it's too hard to relocate the active screen
- * memory.
- * This must be done before vga_save_state() for VGA.
- */
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr, 12);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr, 13);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
-
- /* the video mode parameter table in EGA/VGA BIOS */
- /* NOTE: there can be only one EGA/VGA, wheather color or mono,
- * recognized by the video BIOS.
- */
- if ((biosadapter[V_ADP_PRIMARY].va_type == KD_EGA) ||
- (biosadapter[V_ADP_PRIMARY].va_type == KD_VGA)) {
- adp = &biosadapter[V_ADP_PRIMARY];
- } else if ((biosadapter[V_ADP_SECONDARY].va_type == KD_EGA) ||
- (biosadapter[V_ADP_SECONDARY].va_type == KD_VGA)) {
- adp = &biosadapter[V_ADP_SECONDARY];
- } else {
- adp = NULL;
- }
- bzero(mode_map, sizeof(mode_map));
- if (adp != NULL) {
- if (adp->va_type == KD_VGA) {
- vga_save_state(adp, &adpstate, sizeof(adpstate));
-#if defined(VGA_NO_BIOS) || defined(VGA_NO_MODE_CHANGE)
- mode_map[adp->va_initial_mode] = adpstate.regs;
- rows_offset = 1;
-#else /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
- if (video_mode_ptr == NULL) {
- mode_map[adp->va_initial_mode] = adpstate.regs;
- rows_offset = 1;
- } else {
- /* discard the table if we are not familiar with it... */
- map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
- mp = get_mode_param(adp->va_initial_mode);
- if (mp != NULL)
- bcopy(mp, adpstate2.regs, sizeof(adpstate2.regs));
- switch (comp_adpregs(adpstate.regs, mp)) {
- case COMP_IDENTICAL:
- /*
- * OK, this parameter table looks reasonably familiar
- * to us...
- */
- /*
- * This is a kludge for Toshiba DynaBook SS433
- * whose BIOS video mode table entry has the actual #
- * of rows at the offset 1; BIOSes from other
- * manufacturers store the # of rows - 1 there. XXX
- */
- rows_offset = adpstate.regs[1] + 1 - mp[1];
- break;
-
- case COMP_SIMILAR:
- /*
- * Not exactly the same, but similar enough to be
- * trusted. However, use the saved register values
- * for the initial mode and other modes which are
- * based on the initial mode.
- */
- mode_map[adp->va_initial_mode] = adpstate.regs;
- rows_offset = adpstate.regs[1] + 1 - mp[1];
- adpstate.regs[1] -= rows_offset - 1;
- break;
-
- case COMP_DIFFERENT:
- default:
- /*
- * Don't use the paramter table in BIOS. It doesn't
- * look familiar to us. Video mode switching is allowed
- * only if the new mode is the same as or based on
- * the initial mode.
- */
- video_mode_ptr = NULL;
- bzero(mode_map, sizeof(mode_map));
- mode_map[adp->va_initial_mode] = adpstate.regs;
- rows_offset = 1;
- break;
- }
- }
-#endif /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
-
-#ifndef VGA_NO_MODE_CHANGE
- adp->va_flags |= V_ADP_MODECHANGE;
-#endif
-#ifndef VGA_NO_FONT_LOADING
- adp->va_flags |= V_ADP_FONT;
-#endif
- } else if (adp->va_type == KD_EGA) {
-#if defined(VGA_NO_BIOS) || defined(VGA_NO_MODE_CHANGE)
- rows_offset = 1;
-#else /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
- if (video_mode_ptr == NULL) {
- rows_offset = 1;
- } else {
- map_mode_table(mode_map, video_mode_ptr, M_ENH_C80x25 + 1);
- /* XXX how can one validate the EGA table... */
- mp = get_mode_param(adp->va_initial_mode);
- if (mp != NULL) {
- adp->va_flags |= V_ADP_MODECHANGE;
-#ifndef VGA_NO_FONT_LOADING
- adp->va_flags |= V_ADP_FONT;
-#endif
- rows_offset = 1;
- } else {
- /*
- * This is serious. We will not be able to switch video
- * modes at all...
- */
- video_mode_ptr = NULL;
- bzero(mode_map, sizeof(mode_map));
- rows_offset = 1;
- }
- }
-#endif /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
- }
- }
-
- /* remove conflicting modes if we have more than one adapter */
- if (biosadapters > 1) {
- for (i = 0; i < biosadapters; ++i) {
- if (!(biosadapter[i].va_flags & V_ADP_MODECHANGE))
- continue;
- clear_mode_map(&biosadapter[i], mode_map, M_VGA_CG320 + 1,
- (biosadapter[i].va_flags & V_ADP_COLOR) ?
- V_INFO_COLOR : 0);
- if ((biosadapter[i].va_type == KD_VGA)
- || (biosadapter[i].va_type == KD_EGA)) {
- biosadapter[i].va_io_base =
- (biosadapter[i].va_flags & V_ADP_COLOR) ?
- IO_VGA : IO_MDA;
- biosadapter[i].va_io_size = 32;
- }
- }
- }
-
- /* buffer address */
- vga_get_info(&biosadapter[V_ADP_PRIMARY],
- biosadapter[V_ADP_PRIMARY].va_initial_mode, &info);
- biosadapter[V_ADP_PRIMARY].va_mode_flags = info.vi_flags;
- biosadapter[V_ADP_PRIMARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[V_ADP_PRIMARY].va_window_size = info.vi_window_size;
- biosadapter[V_ADP_PRIMARY].va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- biosadapter[V_ADP_PRIMARY].va_buffer = 0;
- biosadapter[V_ADP_PRIMARY].va_buffer_size = 0;
- } else {
- biosadapter[V_ADP_PRIMARY].va_buffer
- = BIOS_PADDRTOVADDR(info.vi_buffer);
- biosadapter[V_ADP_PRIMARY].va_buffer_size = info.vi_buffer_size;
- }
-
- if (biosadapters > 1) {
- vga_get_info(&biosadapter[V_ADP_SECONDARY],
- biosadapter[V_ADP_SECONDARY].va_initial_mode, &info);
- biosadapter[V_ADP_SECONDARY].va_mode_flags = info.vi_flags;
- biosadapter[V_ADP_SECONDARY].va_window =
- BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[V_ADP_SECONDARY].va_window_size = info.vi_window_size;
- biosadapter[V_ADP_SECONDARY].va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- biosadapter[V_ADP_SECONDARY].va_buffer = 0;
- biosadapter[V_ADP_SECONDARY].va_buffer_size = 0;
- } else {
- biosadapter[V_ADP_SECONDARY].va_buffer =
- BIOS_PADDRTOVADDR(info.vi_buffer);
- biosadapter[V_ADP_SECONDARY].va_buffer_size = info.vi_buffer_size;
- }
- }
-
- /*
- * XXX: we should verify the following values for the primary adapter...
- * crtc I/O port address: *(u_int16_t *)BIOS_PADDRTOVADDR(0x463);
- * color/mono display: (*(u_int8_t *)BIOS_PADDRTOVADDR(0x487) & 0x02)
- * ? 0 : V_ADP_COLOR;
- * columns: *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a);
- * rows: *(u_int8_t *)BIOS_PADDRTOVADDR(0x484);
- * font size: *(u_int8_t *)BIOS_PADDRTOVADDR(0x485);
- * buffer size: *(u_int16_t *)BIOS_PADDRTOVADDR(0x44c);
- */
-
- return biosadapters;
-}
-
-/* entry points */
-
-static int
-vga_nop(void)
-{
- return 0;
-}
-
-static int
-vga_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- probe_adapters();
- if (unit >= biosadapters)
- return ENXIO;
-
- *adpp = &biosadapter[unit];
-
- return 0;
-}
-
-static int
-vga_init(int unit, video_adapter_t *adp, int flags)
-{
- if ((unit >= biosadapters) || (adp == NULL) || !probe_done(adp))
- return ENXIO;
-
- if (!init_done(adp)) {
- /* nothing to do really... */
- adp->va_flags |= V_ADP_INITIALIZED;
- }
-
- if (!config_done(adp)) {
- if (vid_register(adp) < 0)
- return ENXIO;
- adp->va_flags |= V_ADP_REGISTERED;
- }
- if (vga_sub_configure != NULL)
- (*vga_sub_configure)(0);
-
- return 0;
-}
-
-/*
- * get_info():
- * Return the video_info structure of the requested video mode.
- *
- * all adapters
- */
-static int
-vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
-{
- int i;
-
- if (!init_done)
- return 1;
-
- mode = map_gen_mode_num(adp->va_type, adp->va_flags & V_ADP_COLOR, mode);
-#ifndef VGA_NO_MODE_CHANGE
- if (adp->va_flags & V_ADP_MODECHANGE) {
- /*
- * If the parameter table entry for this mode is not found,
- * the mode is not supported...
- */
- if (get_mode_param(mode) == NULL)
- return 1;
- } else
-#endif /* VGA_NO_MODE_CHANGE */
- {
- /*
- * Even if we don't support video mode switching on this adapter,
- * the information on the initial (thus current) video mode
- * should be made available.
- */
- if (mode != adp->va_initial_mode)
- return 1;
- }
-
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (mode == bios_vmode[i].vi_mode) {
- *info = bios_vmode[i];
- return 0;
- }
- }
- return 1;
-}
-
-/*
- * query_mode():
- * Find a video mode matching the requested parameters.
- * Fields filled with 0 are considered "don't care" fields and
- * match any modes.
- *
- * all adapters
- */
-static int
-vga_query_mode(video_adapter_t *adp, video_info_t *info)
-{
- video_info_t buf;
- int i;
-
- if (!init_done)
- return -1;
-
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
-
- if ((info->vi_width != 0)
- && (info->vi_width != bios_vmode[i].vi_width))
- continue;
- if ((info->vi_height != 0)
- && (info->vi_height != bios_vmode[i].vi_height))
- continue;
- if ((info->vi_cwidth != 0)
- && (info->vi_cwidth != bios_vmode[i].vi_cwidth))
- continue;
- if ((info->vi_cheight != 0)
- && (info->vi_cheight != bios_vmode[i].vi_cheight))
- continue;
- if ((info->vi_depth != 0)
- && (info->vi_depth != bios_vmode[i].vi_depth))
- continue;
- if ((info->vi_planes != 0)
- && (info->vi_planes != bios_vmode[i].vi_planes))
- continue;
- /* XXX: should check pixel format, memory model */
- if ((info->vi_flags != 0)
- && (info->vi_flags != bios_vmode[i].vi_flags))
- continue;
-
- /* verify if this mode is supported on this adapter */
- if (vga_get_info(adp, bios_vmode[i].vi_mode, &buf))
- continue;
- return bios_vmode[i].vi_mode;
- }
- return -1;
-}
-
-/*
- * set_mode():
- * Change the video mode.
- *
- * EGA/VGA
- */
-static int
-vga_set_mode(video_adapter_t *adp, int mode)
-{
-#ifndef VGA_NO_MODE_CHANGE
- video_info_t info;
- adp_state_t params;
-
- prologue(adp, V_ADP_MODECHANGE, 1);
-
- mode = map_gen_mode_num(adp->va_type,
- adp->va_flags & V_ADP_COLOR, mode);
- if (vga_get_info(adp, mode, &info))
- return 1;
- params.sig = V_STATE_SIG;
- bcopy(get_mode_param(mode), params.regs, sizeof(params.regs));
-
- switch (mode) {
- case M_VGA_C80x60: case M_VGA_M80x60:
- params.regs[2] = 0x08;
- params.regs[19] = 0x47;
- goto special_480l;
-
- case M_VGA_C80x30: case M_VGA_M80x30:
- params.regs[19] = 0x4f;
-special_480l:
- params.regs[9] |= 0xc0;
- params.regs[16] = 0x08;
- params.regs[17] = 0x3e;
- params.regs[26] = 0xea;
- params.regs[28] = 0xdf;
- params.regs[31] = 0xe7;
- params.regs[32] = 0x04;
- goto setup_mode;
-
- case M_ENH_C80x43: case M_ENH_B80x43:
- params.regs[28] = 87;
- goto special_80x50;
-
- case M_VGA_C80x50: case M_VGA_M80x50:
-special_80x50:
- params.regs[2] = 8;
- params.regs[19] = 7;
- goto setup_mode;
-
- case M_VGA_C40x25: case M_VGA_C80x25:
- case M_VGA_M80x25:
- case M_B40x25: case M_C40x25:
- case M_B80x25: case M_C80x25:
- case M_ENH_B40x25: case M_ENH_C40x25:
- case M_ENH_B80x25: case M_ENH_C80x25:
- case M_EGAMONO80x25:
-
-setup_mode:
- vga_load_state(adp, &params);
- break;
-
- case M_VGA_MODEX:
- /* "unchain" the VGA mode */
- params.regs[5-1+0x04] &= 0xf7;
- params.regs[5-1+0x04] |= 0x04;
- /* turn off doubleword mode */
- params.regs[10+0x14] &= 0xbf;
- /* turn off word adressing */
- params.regs[10+0x17] |= 0x40;
- /* set logical screen width */
- params.regs[10+0x13] = 80;
- /* set 240 lines */
- params.regs[10+0x11] = 0x2c;
- params.regs[10+0x06] = 0x0d;
- params.regs[10+0x07] = 0x3e;
- params.regs[10+0x10] = 0xea;
- params.regs[10+0x11] = 0xac;
- params.regs[10+0x12] = 0xdf;
- params.regs[10+0x15] = 0xe7;
- params.regs[10+0x16] = 0x06;
- /* set vertical sync polarity to reflect aspect ratio */
- params.regs[9] = 0xe3;
- goto setup_grmode;
-
- case M_BG320: case M_CG320: case M_BG640:
- case M_CG320_D: case M_CG640_E:
- case M_CG640x350: case M_ENH_CG640:
- case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
-
-setup_grmode:
- vga_load_state(adp, &params);
- break;
-
- default:
- return 1;
- }
-
- adp->va_mode = mode;
- adp->va_mode_flags = info.vi_flags;
- adp->va_flags &= ~V_ADP_COLOR;
- adp->va_flags |=
- (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
- adp->va_crtc_addr =
- (adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
- adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
- adp->va_window_size = info.vi_window_size;
- adp->va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- adp->va_buffer = 0;
- adp->va_buffer_size = 0;
- } else {
- adp->va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
- adp->va_buffer_size = info.vi_buffer_size;
- }
-
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
- return 0;
-#else /* VGA_NO_MODE_CHANGE */
- return 1;
-#endif /* VGA_NO_MODE_CHANGE */
-}
-
-#ifndef VGA_NO_FONT_LOADING
-
-static void
-set_font_mode(video_adapter_t *adp, u_char *buf)
-{
- u_char *mp;
- int s;
-
- s = splhigh();
-
- /* save register values */
- if (adp->va_type == KD_VGA) {
- outb(TSIDX, 0x02); buf[0] = inb(TSREG);
- outb(TSIDX, 0x04); buf[1] = inb(TSREG);
- outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
- outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
- outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
- inb(adp->va_crtc_addr + 6);
- outb(ATC, 0x10); buf[5] = inb(ATC + 1);
- } else /* if (adp->va_type == KD_EGA) */ {
- /*
- * EGA cannot be read; copy parameters from the mode parameter
- * table.
- */
- mp = get_mode_param(adp->va_mode);
- buf[0] = mp[5 + 0x02 - 1];
- buf[1] = mp[5 + 0x04 - 1];
- buf[2] = mp[55 + 0x04];
- buf[3] = mp[55 + 0x05];
- buf[4] = mp[55 + 0x06];
- buf[5] = mp[35 + 0x10];
- }
-
- /* setup vga for loading fonts */
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x20); /* enable palette */
-
-#if VGA_SLOW_IOACCESS
-#ifdef VGA_ALT_SEQACCESS
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
-#endif
- outb(TSIDX, 0x02); outb(TSREG, 0x04);
- outb(TSIDX, 0x04); outb(TSREG, 0x07);
-#ifdef VGA_ALT_SEQACCESS
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
-#endif
- outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
- outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
- outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
-#else /* VGA_SLOW_IOACCESS */
-#ifdef VGA_ALT_SEQACCESS
- outw(TSIDX, 0x0100);
-#endif
- outw(TSIDX, 0x0402);
- outw(TSIDX, 0x0704);
-#ifdef VGA_ALT_SEQACCESS
- outw(TSIDX, 0x0300);
-#endif
- outw(GDCIDX, 0x0204);
- outw(GDCIDX, 0x0005);
- outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
-#endif /* VGA_SLOW_IOACCESS */
-
- splx(s);
-}
-
-static void
-set_normal_mode(video_adapter_t *adp, u_char *buf)
-{
- int s;
-
- s = splhigh();
-
- /* setup vga for normal operation mode again */
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x10); outb(ATC, buf[5]);
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x20); /* enable palette */
-
-#if VGA_SLOW_IOACCESS
-#ifdef VGA_ALT_SEQACCESS
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
-#endif
- outb(TSIDX, 0x02); outb(TSREG, buf[0]);
- outb(TSIDX, 0x04); outb(TSREG, buf[1]);
-#ifdef VGA_ALT_SEQACCESS
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
-#endif
- outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
- outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
- if (adp->va_crtc_addr == MONO_CRTC) {
- outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x08);
- } else {
- outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
- }
-#else /* VGA_SLOW_IOACCESS */
-#ifdef VGA_ALT_SEQACCESS
- outw(TSIDX, 0x0100);
-#endif
- outw(TSIDX, 0x0002 | (buf[0] << 8));
- outw(TSIDX, 0x0004 | (buf[1] << 8));
-#ifdef VGA_ALT_SEQACCESS
- outw(TSIDX, 0x0300);
-#endif
- outw(GDCIDX, 0x0004 | (buf[2] << 8));
- outw(GDCIDX, 0x0005 | (buf[3] << 8));
- if (adp->va_crtc_addr == MONO_CRTC)
- outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x08)<<8));
- else
- outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
-#endif /* VGA_SLOW_IOACCESS */
-
- splx(s);
-}
-
-#endif /* VGA_NO_FONT_LOADING */
-
-/*
- * save_font():
- * Read the font data in the requested font page from the video adapter.
- *
- * EGA/VGA
- */
-static int
-vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
-{
-#ifndef VGA_NO_FONT_LOADING
- u_char buf[PARAM_BUFSIZE];
- u_int32_t segment;
- int c;
-#ifdef VGA_ALT_SEQACCESS
- int s;
- u_char val = 0;
-#endif
-
- prologue(adp, V_ADP_FONT, 1);
-
- if (fontsize < 14) {
- /* FONT_8 */
- fontsize = 8;
- } else if (fontsize >= 32) {
- fontsize = 32;
- } else if (fontsize >= 16) {
- /* FONT_16 */
- fontsize = 16;
- } else {
- /* FONT_14 */
- fontsize = 14;
- }
-
- if (page < 0 || page >= 8)
- return 1;
- segment = FONT_BUF + 0x4000*page;
- if (page > 3)
- segment -= 0xe000;
-
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) { /* what about EGA? XXX */
- s = splhigh();
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
- outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
- outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
- splx(s);
- }
-#endif
-
- set_font_mode(adp, buf);
- if (fontsize == 32) {
- bcopy_fromio((void *)(segment + ch*32), data, fontsize*count);
- } else {
- for (c = ch; count > 0; ++c, --count) {
- bcopy_fromio((void *)(segment + c*32), data, fontsize);
- data += fontsize;
- }
- }
- set_normal_mode(adp, buf);
-
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) {
- s = splhigh();
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
- outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
- splx(s);
- }
-#endif
-
- return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
-}
-
-/*
- * load_font():
- * Set the font data in the requested font page.
- * NOTE: it appears that some recent video adapters do not support
- * the font page other than 0... XXX
- *
- * EGA/VGA
- */
-static int
-vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
-{
-#ifndef VGA_NO_FONT_LOADING
- u_char buf[PARAM_BUFSIZE];
- u_int32_t segment;
- int c;
-#ifdef VGA_ALT_SEQACCESS
- int s;
- u_char val = 0;
-#endif
-
- prologue(adp, V_ADP_FONT, 1);
-
- if (fontsize < 14) {
- /* FONT_8 */
- fontsize = 8;
- } else if (fontsize >= 32) {
- fontsize = 32;
- } else if (fontsize >= 16) {
- /* FONT_16 */
- fontsize = 16;
- } else {
- /* FONT_14 */
- fontsize = 14;
- }
-
- if (page < 0 || page >= 8)
- return 1;
- segment = FONT_BUF + 0x4000*page;
- if (page > 3)
- segment -= 0xe000;
-
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) { /* what about EGA? XXX */
- s = splhigh();
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
- outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
- outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
- splx(s);
- }
-#endif
-
- set_font_mode(adp, buf);
- if (fontsize == 32) {
- bcopy_toio(data, (void *)(segment + ch*32), fontsize*count);
- } else {
- for (c = ch; count > 0; ++c, --count) {
- bcopy_toio(data, (void *)(segment + c*32), fontsize);
- data += fontsize;
- }
- }
- set_normal_mode(adp, buf);
-
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) {
- s = splhigh();
- outb(TSIDX, 0x00); outb(TSREG, 0x01);
- outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
- outb(TSIDX, 0x00); outb(TSREG, 0x03);
- splx(s);
- }
-#endif
-
- return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
-}
-
-/*
- * show_font():
- * Activate the requested font page.
- * NOTE: it appears that some recent video adapters do not support
- * the font page other than 0... XXX
- *
- * EGA/VGA
- */
-static int
-vga_show_font(video_adapter_t *adp, int page)
-{
-#ifndef VGA_NO_FONT_LOADING
- static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f, 0x30, 0x35, 0x3a, 0x3f };
- int s;
-
- prologue(adp, V_ADP_FONT, 1);
- if (page < 0 || page >= 8)
- return 1;
-
- s = splhigh();
- outb(TSIDX, 0x03); outb(TSREG, cg[page]);
- splx(s);
-
- return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
-}
-
-/*
- * save_palette():
- * Read DAC values. The values have expressed in 8 bits.
- *
- * VGA
- */
-static int
-vga_save_palette(video_adapter_t *adp, u_char *palette)
-{
- int i;
-
- prologue(adp, V_ADP_PALETTE, 1);
-
- /*
- * We store 8 bit values in the palette buffer, while the standard
- * VGA has 6 bit DAC .
- */
- outb(PALRADR, 0x00);
- for (i = 0; i < 256*3; ++i)
- palette[i] = inb(PALDATA) << 2;
- inb(adp->va_crtc_addr + 6); /* reset flip/flop */
- return 0;
-}
-
-/*
- * load_palette():
- * Set DAC values.
- *
- * VGA
- */
-static int
-vga_load_palette(video_adapter_t *adp, u_char *palette)
-{
- int i;
-
- prologue(adp, V_ADP_PALETTE, 1);
-
- outb(PIXMASK, 0xff); /* no pixelmask */
- outb(PALWADR, 0x00);
- for (i = 0; i < 256*3; ++i)
- outb(PALDATA, palette[i] >> 2);
- inb(adp->va_crtc_addr + 6); /* reset flip/flop */
- outb(ATC, 0x20); /* enable palette */
- return 0;
-}
-
-/*
- * set_border():
- * Change the border color.
- *
- * CGA/EGA/VGA
- */
-static int
-vga_set_border(video_adapter_t *adp, int color)
-{
- prologue(adp, V_ADP_BORDER, 1);
-
- switch (adp->va_type) {
- case KD_EGA:
- case KD_VGA:
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x31); outb(ATC, color & 0xff);
- break;
- case KD_CGA:
- outb(adp->va_crtc_addr + 5, color & 0x0f); /* color select register */
- break;
- case KD_MONO:
- case KD_HERCULES:
- default:
- break;
- }
- return 0;
-}
-
-/*
- * save_state():
- * Read video register values.
- * NOTE: this function only reads the standard EGA/VGA registers.
- * any extra/extended registers of SVGA adapters are not saved.
- *
- * VGA
- */
-static int
-vga_save_state(video_adapter_t *adp, void *p, size_t size)
-{
- video_info_t info;
- u_char *buf;
- int crtc_addr;
- int i, j;
- int s;
-
- if (size == 0) {
- /* return the required buffer size */
- prologue(adp, V_ADP_STATESAVE, 0);
- return sizeof(adp_state_t);
- } else {
- prologue(adp, V_ADP_STATESAVE, 1);
- if (size < sizeof(adp_state_t))
- return 1;
- }
-
- ((adp_state_t *)p)->sig = V_STATE_SIG;
- buf = ((adp_state_t *)p)->regs;
- bzero(buf, V_MODE_PARAM_SIZE);
- crtc_addr = adp->va_crtc_addr;
-
- s = splhigh();
-
- outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
- for (i = 0, j = 5; i < 4; i++) {
- outb(TSIDX, i + 1);
- buf[j++] = inb(TSREG);
- }
- buf[9] = inb(MISC + 10); /* dot-clock */
- outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
-
- for (i = 0, j = 10; i < 25; i++) { /* crtc */
- outb(crtc_addr, i);
- buf[j++] = inb(crtc_addr + 1);
- }
- for (i = 0, j = 35; i < 20; i++) { /* attribute ctrl */
- inb(crtc_addr + 6); /* reset flip-flop */
- outb(ATC, i);
- buf[j++] = inb(ATC + 1);
- }
- for (i = 0, j = 55; i < 9; i++) { /* graph data ctrl */
- outb(GDCIDX, i);
- buf[j++] = inb(GDCREG);
- }
- inb(crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x20); /* enable palette */
-
- splx(s);
-
-#if 1
- if (vga_get_info(adp, adp->va_mode, &info) == 0) {
- if (info.vi_flags & V_INFO_GRAPHICS) {
- buf[0] = info.vi_width/info.vi_cwidth; /* COLS */
- buf[1] = info.vi_height/info.vi_cheight - 1; /* ROWS */
- } else {
- buf[0] = info.vi_width; /* COLS */
- buf[1] = info.vi_height - 1; /* ROWS */
- }
- buf[2] = info.vi_cheight; /* POINTS */
- } else {
- /* XXX: shouldn't be happening... */
- printf("vga%d: %s: failed to obtain mode info. (vga_save_state())\n",
- adp->va_unit, adp->va_name);
- }
-#else
- buf[0] = readb(BIOS_PADDRTOVADDR(0x44a)); /* COLS */
- buf[1] = readb(BIOS_PADDRTOVADDR(0x484)); /* ROWS */
- buf[2] = readb(BIOS_PADDRTOVADDR(0x485)); /* POINTS */
- buf[3] = readb(BIOS_PADDRTOVADDR(0x44c));
- buf[4] = readb(BIOS_PADDRTOVADDR(0x44d));
-#endif
-
- return 0;
-}
-
-/*
- * load_state():
- * Set video registers at once.
- * NOTE: this function only updates the standard EGA/VGA registers.
- * any extra/extended registers of SVGA adapters are not changed.
- *
- * EGA/VGA
- */
-static int
-vga_load_state(video_adapter_t *adp, void *p)
-{
- u_char *buf;
- int crtc_addr;
- int s;
- int i;
-
- prologue(adp, V_ADP_STATELOAD, 1);
- if (((adp_state_t *)p)->sig != V_STATE_SIG)
- return 1;
-
- buf = ((adp_state_t *)p)->regs;
- crtc_addr = adp->va_crtc_addr;
-
- s = splhigh();
-
- outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
- for (i = 0; i < 4; ++i) { /* program sequencer */
- outb(TSIDX, i + 1);
- outb(TSREG, buf[i + 5]);
- }
- outb(MISC, buf[9]); /* set dot-clock */
- outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
- outb(crtc_addr, 0x11);
- outb(crtc_addr + 1, inb(crtc_addr + 1) & 0x7F);
- for (i = 0; i < 25; ++i) { /* program crtc */
- outb(crtc_addr, i);
- outb(crtc_addr + 1, buf[i + 10]);
- }
- inb(crtc_addr+6); /* reset flip-flop */
- for (i = 0; i < 20; ++i) { /* program attribute ctrl */
- outb(ATC, i);
- outb(ATC, buf[i + 35]);
- }
- for (i = 0; i < 9; ++i) { /* program graph data ctrl */
- outb(GDCIDX, i);
- outb(GDCREG, buf[i + 55]);
- }
- inb(crtc_addr + 6); /* reset flip-flop */
- outb(ATC, 0x20); /* enable palette */
-
-#ifndef VGA_NO_BIOS
- if (adp->va_unit == V_ADP_PRIMARY) {
- writeb(BIOS_PADDRTOVADDR(0x44a), buf[0]); /* COLS */
- writeb(BIOS_PADDRTOVADDR(0x484), buf[1] + rows_offset - 1); /* ROWS */
- writeb(BIOS_PADDRTOVADDR(0x485), buf[2]); /* POINTS */
-#if 0
- writeb(BIOS_PADDRTOVADDR(0x44c), buf[3]);
- writeb(BIOS_PADDRTOVADDR(0x44d), buf[4]);
-#endif
- }
-#endif /* VGA_NO_BIOS */
-
- splx(s);
- return 0;
-}
-
-/*
- * set_origin():
- * Change the origin (window mapping) of the banked frame buffer.
- */
-static int
-vga_set_origin(video_adapter_t *adp, off_t offset)
-{
- /*
- * The standard video modes do not require window mapping;
- * always return error.
- */
- return 1;
-}
-
-/*
- * read_hw_cursor():
- * Read the position of the hardware text cursor.
- *
- * all adapters
- */
-static int
-vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
-
- s = spltty();
- outb(adp->va_crtc_addr, 14);
- off = inb(adp->va_crtc_addr + 1);
- outb(adp->va_crtc_addr, 15);
- off = (off << 8) | inb(adp->va_crtc_addr + 1);
- splx(s);
-
- *row = off / info.vi_width;
- *col = off % info.vi_width;
-
- return 0;
-}
-
-/*
- * set_hw_cursor():
- * Move the hardware text cursor. If col and row are both -1,
- * the cursor won't be shown.
- *
- * all adapters
- */
-static int
-vga_set_hw_cursor(video_adapter_t *adp, int col, int row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- if ((col == -1) && (row == -1)) {
- off = -1;
- } else {
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
- off = row*info.vi_width + col;
- }
-
- s = spltty();
- outb(adp->va_crtc_addr, 14);
- outb(adp->va_crtc_addr + 1, off >> 8);
- outb(adp->va_crtc_addr, 15);
- outb(adp->va_crtc_addr + 1, off & 0x00ff);
- splx(s);
-
- return 0;
-}
-
-/*
- * set_hw_cursor_shape():
- * Change the shape of the hardware text cursor. If the height is
- * zero or negative, the cursor won't be shown.
- *
- * all adapters
- */
-static int
-vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
-{
- int s;
-
- if (!init_done)
- return 1;
-
- s = spltty();
- switch (adp->va_type) {
- case KD_VGA:
- case KD_CGA:
- case KD_MONO:
- case KD_HERCULES:
- default:
- if (height <= 0) {
- /* make the cursor invisible */
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, 32);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, 0);
- } else {
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize - base - height);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, celsize - base - 1);
- }
- break;
- case KD_EGA:
- if (height <= 0) {
- /* make the cursor invisible */
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, 0);
- } else {
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize - base - height);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, celsize - base);
- }
- break;
- }
- splx(s);
-
- return 0;
-}
-
-/*
- * mmap():
- * Mmap frame buffer.
- *
- * all adapters
- */
-static int
-vga_mmap(video_adapter_t *adp, vm_offset_t offset)
-{
- if (offset > 0x20000 - PAGE_SIZE)
- return -1;
-#ifdef __i386__
- return i386_btop((VIDEO_BUF_BASE + offset));
-#endif
-#ifdef __alpha__
- return alpha_btop((VIDEO_BUF_BASE + offset));
-#endif
-}
-
-static void
-dump_buffer(u_char *buf, size_t len)
-{
- int i;
-
- for(i = 0; i < len;) {
- printf("%02x ", buf[i]);
- if ((++i % 16) == 0)
- printf("\n");
- }
-}
-
-/*
- * diag():
- * Print some information about the video adapter and video modes,
- * with requested level of details.
- *
- * all adapters
- */
-static int
-vga_diag(video_adapter_t *adp, int level)
-{
-#if FB_DEBUG > 1
- video_info_t info;
-#endif
- u_char *mp;
-
- if (!init_done)
- return 1;
-
-#if FB_DEBUG > 1
-#ifndef VGA_NO_BIOS
- printf("vga: RTC equip. code:0x%02x, DCC code:0x%02x\n",
- rtcin(RTC_EQUIPMENT), readb(BIOS_PADDRTOVADDR(0x488)));
- printf("vga: CRTC:0x%x, video option:0x%02x, ",
- readw(BIOS_PADDRTOVADDR(0x463)),
- readb(BIOS_PADDRTOVADDR(0x487)));
- printf("rows:%d, cols:%d, font height:%d\n",
- readb(BIOS_PADDRTOVADDR(0x44a)),
- readb(BIOS_PADDRTOVADDR(0x484)) + 1,
- readb(BIOS_PADDRTOVADDR(0x485)));
-#endif /* VGA_NO_BIOS */
- printf("vga: param table EGA/VGA:%p", video_mode_ptr);
- printf(", CGA/MDA:%p\n", video_mode_ptr2);
- printf("vga: rows_offset:%d\n", rows_offset);
-#endif /* FB_DEBUG > 1 */
-
- fb_dump_adp_info(DRIVER_NAME, adp, level);
-
-#if FB_DEBUG > 1
- if (adp->va_flags & V_ADP_MODECHANGE) {
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
- continue;
- fb_dump_mode_info(DRIVER_NAME, adp, &bios_vmode[i], level);
- }
- } else {
- vga_get_info(adp, adp->va_initial_mode, &info); /* shouldn't fail */
- fb_dump_mode_info(DRIVER_NAME, adp, &info, level);
- }
-#endif /* FB_DEBUG > 1 */
-
- if ((adp->va_type != KD_EGA) && (adp->va_type != KD_VGA))
- return 0;
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- if (video_mode_ptr == NULL)
- printf("vga%d: %s: WARNING: video mode switching is not "
- "fully supported on this adapter\n",
- adp->va_unit, adp->va_name);
-#endif
- if (level <= 0)
- return 0;
-
- if (adp->va_type == KD_VGA) {
- printf("VGA parameters upon power-up\n");
- dump_buffer(adpstate.regs, sizeof(adpstate.regs));
- printf("VGA parameters in BIOS for mode %d\n", adp->va_initial_mode);
- dump_buffer(adpstate2.regs, sizeof(adpstate2.regs));
- }
-
- mp = get_mode_param(adp->va_initial_mode);
- if (mp == NULL) /* this shouldn't be happening */
- return 0;
- printf("EGA/VGA parameters to be used for mode %d\n", adp->va_initial_mode);
- dump_buffer(mp, V_MODE_PARAM_SIZE);
-
- return 0;
-}
-
-#endif /* NVGA > 0 */
diff --git a/sys/i386/isa/videoio.c b/sys/i386/isa/videoio.c
new file mode 100644
index 000000000000..571008051fb5
--- /dev/null
+++ b/sys/i386/isa/videoio.c
@@ -0,0 +1,1774 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * Copyright (c) 1992-1998 Søren Schmidt
+ * 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 as
+ * the first lines of this file unmodified.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
+ *
+ * $Id: videoio.c,v 1.5 1998/09/26 03:38:40 yokota Exp $
+ */
+
+#include "sc.h"
+#include "opt_syscons.h"
+
+#if NSC > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <machine/clock.h>
+#include <machine/console.h>
+#include <machine/md_var.h>
+#include <machine/pc/bios.h>
+
+#include <i386/isa/isa.h>
+#include <i386/isa/videoio.h>
+
+/* this should really be in `rtc.h' */
+#define RTC_EQUIPMENT 0x14
+
+/* video adapter state buffer */
+struct adp_state {
+ int sig;
+#define V_STATE_SIG 0x736f6962
+ u_char regs[V_MODE_PARAM_SIZE];
+};
+typedef struct adp_state adp_state_t;
+
+/* video adapter information */
+#define DCC_MONO 0
+#define DCC_CGA40 1
+#define DCC_CGA80 2
+#define DCC_EGAMONO 3
+#define DCC_EGA40 4
+#define DCC_EGA80 5
+
+/*
+ * NOTE: `va_window' should have a virtual address, but is initialized
+ * with a physical address in the following table, as verify_adapter()
+ * will perform address conversion at run-time.
+ */
+static video_adapter_t adapter_init_value[] = {
+ { 0, KD_MONO, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 },
+ { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_EGA, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 },
+ { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+};
+
+static video_adapter_t adapter[V_MAX_ADAPTERS];
+static int adapters = 0;
+
+/* VGA function entries */
+static vi_init_t vid_init;
+static vi_adapter_t vid_adapter;
+static vi_get_info_t vid_get_info;
+static vi_query_mode_t vid_query_mode;
+static vi_set_mode_t vid_set_mode;
+static vi_save_font_t vid_save_font;
+static vi_load_font_t vid_load_font;
+static vi_show_font_t vid_show_font;
+static vi_save_palette_t vid_save_palette;
+static vi_load_palette_t vid_load_palette;
+static vi_set_border_t vid_set_border;
+static vi_save_state_t vid_save_state;
+static vi_load_state_t vid_load_state;
+static vi_set_win_org_t vid_set_origin;
+static vi_read_hw_cursor_t vid_read_hw_cursor;
+static vi_set_hw_cursor_t vid_set_hw_cursor;
+static vi_diag_t vid_diag;
+
+struct vidsw biosvidsw = {
+ vid_init, vid_adapter, vid_get_info, vid_query_mode,
+ vid_set_mode, vid_save_font, vid_load_font, vid_show_font,
+ vid_save_palette,vid_load_palette,vid_set_border,vid_save_state,
+ vid_load_state, vid_set_origin, vid_read_hw_cursor, vid_set_hw_cursor,
+ vid_diag,
+};
+
+/* VGA BIOS standard video modes */
+#define EOT (-1)
+#define NA (-2)
+
+static video_info_t bios_vmode[] = {
+ /* CGA */
+ { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* EGA */
+ { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* VGA */
+ { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* MDA */
+ { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ /* EGA */
+ { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* VGA */
+ { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* CGA */
+ { M_BG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_CG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_BG640, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 200, 8, 8, 1, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ /* EGA */
+ { M_CG320_D, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640_E, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_EGAMONOAPA, V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_ENHMONOAPA2,V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640x350, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 2, 2, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_ENH_CG640, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ /* VGA */
+ { M_BG640x480, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640x480, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_VGA_CG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_VGA_MODEX, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 240, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 },
+
+ { EOT },
+};
+
+static int init_done = FALSE;
+static u_char *video_mode_ptr = NULL; /* EGA/VGA */
+static u_char *video_mode_ptr2 = NULL; /* CGA/MDA */
+static u_char *mode_map[V_MODE_MAP_SIZE];
+static adp_state_t adpstate;
+static adp_state_t adpstate2;
+static int rows_offset = 1;
+
+/* local macros and functions */
+#define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff))
+
+static void map_mode_table(u_char *map[], u_char *table, int max);
+static void clear_mode_map(int ad, u_char *map[], int max, int color);
+static int map_mode_num(int mode);
+static int map_gen_mode_num(int type, int color, int mode);
+static int map_bios_mode_num(int type, int color, int bios_mode);
+static u_char *get_mode_param(int mode);
+static void fill_adapter_param(int code, video_adapter_t *adp);
+static int verify_adapter(video_adapter_t *adp);
+#define COMP_IDENTICAL 0
+#define COMP_SIMILAR 1
+#define COMP_DIFFERENT 2
+static int comp_adpregs(u_char *buf1, u_char *buf2);
+
+#define PARAM_BUFSIZE 6
+static void set_font_mode(video_adapter_t *adp, u_char *buf);
+static void set_normal_mode(video_adapter_t *adp, u_char *buf);
+
+static char *adapter_name(int type);
+static void dump_adp_info(int ad, video_adapter_t *adp, int level);
+static void dump_mode_info(int ad, video_info_t *info, int level);
+static void dump_buffer(u_char *buf, size_t len);
+
+extern void generic_bcopy(const void *, void *, size_t);
+
+#define ISMAPPED(pa, width) \
+ (((pa) <= (u_long)0x1000 - (width)) \
+ || ((pa) >= ISA_HOLE_START && (pa) <= 0x100000 - (width)))
+
+#define prologue(ad, flag, err) \
+ if (!init_done \
+ || ((ad) < 0) || ((ad) >= adapters) \
+ || !(adapter[(ad)].va_flags & (flag))) \
+ return (err)
+
+/* construct the mode parameter map */
+static void
+map_mode_table(u_char *map[], u_char *table, int max)
+{
+ int i;
+
+ for(i = 0; i < max; ++i)
+ map[i] = table + i*V_MODE_PARAM_SIZE;
+ for(; i < V_MODE_MAP_SIZE; ++i)
+ map[i] = NULL;
+}
+
+static void
+clear_mode_map(int ad, u_char *map[], int max, int color)
+{
+ video_info_t info;
+ int i;
+
+ /*
+ * NOTE: we don't touch `bios_vmode[]' because it is shared
+ * by all adapters.
+ */
+ for(i = 0; i < max; ++i) {
+ if (vid_get_info(ad, i, &info))
+ continue;
+ if ((info.vi_flags & V_INFO_COLOR) != color)
+ map[i] = NULL;
+ }
+}
+
+/* map the non-standard video mode to a known mode number */
+static int
+map_mode_num(int mode)
+{
+ static struct {
+ int from;
+ int to;
+ } mode_map[] = {
+ { M_ENH_B80x43, M_ENH_B80x25 },
+ { M_ENH_C80x43, M_ENH_C80x25 },
+ { M_VGA_M80x30, M_VGA_M80x25 },
+ { M_VGA_C80x30, M_VGA_C80x25 },
+ { M_VGA_M80x50, M_VGA_M80x25 },
+ { M_VGA_C80x50, M_VGA_C80x25 },
+ { M_VGA_M80x60, M_VGA_M80x25 },
+ { M_VGA_C80x60, M_VGA_C80x25 },
+ { M_VGA_MODEX, M_VGA_CG320 },
+ };
+ int i;
+
+ for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
+ if (mode_map[i].from == mode)
+ return mode_map[i].to;
+ }
+ return mode;
+}
+
+/* map a generic video mode to a known mode number */
+static int
+map_gen_mode_num(int type, int color, int mode)
+{
+ static struct {
+ int from;
+ int to_color;
+ int to_mono;
+ } mode_map[] = {
+ { M_TEXT_80x30, M_VGA_C80x30, M_VGA_M80x30, },
+ { M_TEXT_80x43, M_ENH_C80x43, M_ENH_B80x43, },
+ { M_TEXT_80x50, M_VGA_C80x50, M_VGA_M80x50, },
+ { M_TEXT_80x60, M_VGA_C80x60, M_VGA_M80x60, },
+ };
+ int i;
+
+ if (mode == M_TEXT_80x25) {
+ switch (type) {
+
+ case KD_VGA:
+ if (color)
+ return M_VGA_C80x25;
+ else
+ return M_VGA_M80x25;
+ break;
+
+ case KD_EGA:
+ if (color)
+ return M_ENH_C80x25;
+ else
+ return M_EGAMONO80x25;
+ break;
+
+ case KD_CGA:
+ return M_C80x25;
+
+ case KD_MONO:
+ case KD_HERCULES:
+ return M_EGAMONO80x25; /* XXX: this name is confusing */
+
+ default:
+ return -1;
+ }
+ }
+
+ for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
+ if (mode_map[i].from == mode)
+ return ((color) ? mode_map[i].to_color : mode_map[i].to_mono);
+ }
+ return mode;
+}
+
+/* turn the BIOS video number into our video mode number */
+static int
+map_bios_mode_num(int type, int color, int bios_mode)
+{
+ static int cga_modes[7] = {
+ M_B40x25, M_C40x25, /* 0, 1 */
+ M_B80x25, M_C80x25, /* 2, 3 */
+ M_BG320, M_CG320,
+ M_BG640,
+ };
+ static int ega_modes[17] = {
+ M_ENH_B40x25, M_ENH_C40x25, /* 0, 1 */
+ M_ENH_B80x25, M_ENH_C80x25, /* 2, 3 */
+ M_BG320, M_CG320,
+ M_BG640,
+ M_EGAMONO80x25, /* 7 */
+ 8, 9, 10, 11, 12,
+ M_CG320_D,
+ M_CG640_E,
+ M_ENHMONOAPA2, /* XXX: video momery > 64K */
+ M_ENH_CG640, /* XXX: video momery > 64K */
+ };
+ static int vga_modes[20] = {
+ M_VGA_C40x25, M_VGA_C40x25, /* 0, 1 */
+ M_VGA_C80x25, M_VGA_C80x25, /* 2, 3 */
+ M_BG320, M_CG320,
+ M_BG640,
+ M_VGA_M80x25, /* 7 */
+ 8, 9, 10, 11, 12,
+ M_CG320_D,
+ M_CG640_E,
+ M_ENHMONOAPA2,
+ M_ENH_CG640,
+ M_BG640x480, M_CG640x480,
+ M_VGA_CG320,
+ };
+
+ switch (type) {
+
+ case KD_VGA:
+ if (bios_mode < sizeof(vga_modes)/sizeof(vga_modes[0]))
+ return vga_modes[bios_mode];
+ else if (color)
+ return M_VGA_C80x25;
+ else
+ return M_VGA_M80x25;
+ break;
+
+ case KD_EGA:
+ if (bios_mode < sizeof(ega_modes)/sizeof(ega_modes[0]))
+ return ega_modes[bios_mode];
+ else if (color)
+ return M_ENH_C80x25;
+ else
+ return M_EGAMONO80x25;
+ break;
+
+ case KD_CGA:
+ if (bios_mode < sizeof(cga_modes)/sizeof(cga_modes[0]))
+ return cga_modes[bios_mode];
+ else
+ return M_C80x25;
+ break;
+
+ case KD_MONO:
+ case KD_HERCULES:
+ return M_EGAMONO80x25; /* XXX: this name is confusing */
+
+ default:
+ break;
+ }
+ return -1;
+}
+
+/* look up a parameter table entry */
+static u_char
+*get_mode_param(int mode)
+{
+ if (mode >= V_MODE_MAP_SIZE)
+ mode = map_mode_num(mode);
+ if ((mode >= 0) && (mode < V_MODE_MAP_SIZE))
+ return mode_map[mode];
+ else
+ return NULL;
+}
+
+static void
+fill_adapter_param(int code, video_adapter_t *adp)
+{
+ static struct {
+ int primary;
+ int secondary;
+ } dcc[] = {
+ { DCC_MONO, DCC_EGA40 /* CGA monitor */ },
+ { DCC_MONO, DCC_EGA80 /* CGA monitor */ },
+ { DCC_MONO, DCC_EGA80 /* CGA emulation */ },
+ { DCC_MONO, DCC_EGA80 },
+ { DCC_CGA40, DCC_EGAMONO },
+ { DCC_CGA80, DCC_EGAMONO },
+ { DCC_EGA40 /* CGA monitor */, DCC_MONO},
+ { DCC_EGA80 /* CGA monitor */, DCC_MONO},
+ { DCC_EGA80 /* CGA emulation */,DCC_MONO },
+ { DCC_EGA80, DCC_MONO },
+ { DCC_EGAMONO, DCC_CGA40 },
+ { DCC_EGAMONO, DCC_CGA40 },
+ };
+
+ if ((code < 0) || (code >= sizeof(dcc)/sizeof(dcc[0]))) {
+ adp[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
+ adp[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
+ } else {
+ adp[V_ADP_PRIMARY] = adapter_init_value[dcc[code].primary];
+ adp[V_ADP_SECONDARY] = adapter_init_value[dcc[code].secondary];
+ }
+}
+
+static int
+verify_adapter(video_adapter_t *adp)
+{
+ u_short volatile *buf;
+ u_short v;
+ u_int32_t p;
+
+ buf = (u_short *)BIOS_PADDRTOVADDR(adp->va_window);
+ v = *buf;
+ *buf = (u_short) 0xA55A;
+ if (*buf != 0xA55A)
+ return 1;
+ *buf = v;
+
+ switch (adp->va_type) {
+
+ case KD_EGA:
+ outb(adp->va_crtc_addr, 7);
+ if (inb(adp->va_crtc_addr) == 7) {
+ adp->va_type = KD_VGA;
+ adp->va_flags |= V_ADP_STATESAVE | V_ADP_PALETTE;
+ }
+ adp->va_flags |= V_ADP_STATELOAD | V_ADP_FONT | V_ADP_BORDER;
+ /* the color adapter may be in the 40x25 mode... XXX */
+
+ /* get the BIOS video mode pointer */
+ p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8);
+ p = BIOS_SADDRTOLADDR(p);
+ if (ISMAPPED(p, sizeof(u_int32_t))) {
+ p = *(u_int32_t *)BIOS_PADDRTOVADDR(p);
+ p = BIOS_SADDRTOLADDR(p);
+ if (ISMAPPED(p, V_MODE_PARAM_SIZE))
+ video_mode_ptr = (u_char *)BIOS_PADDRTOVADDR(p);
+ }
+ break;
+
+ case KD_CGA:
+ adp->va_flags |= V_ADP_COLOR | V_ADP_BORDER;
+ /* may be in the 40x25 mode... XXX */
+ break;
+
+ case KD_MONO:
+ break;
+ }
+
+ return 0;
+}
+
+/* compare two parameter table entries */
+static int
+comp_adpregs(u_char *buf1, u_char *buf2)
+{
+ static struct {
+ u_char mask;
+ } params[V_MODE_PARAM_SIZE] = {
+ 0xff, 0x00, 0xff, /* COLS, ROWS, POINTS */
+ 0x00, 0x00, /* page length */
+ 0xfe, 0xff, 0xff, 0xff, /* sequencer registers */
+ 0xf3, /* misc register */
+ 0xff, 0xff, 0xff, 0x7f, 0xff, /* CRTC */
+ 0xff, 0xff, 0xff, 0x7f, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x7f, 0xff, 0xff,
+ 0x7f, 0xff, 0xff, 0xef, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* attribute controller registers */
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xf0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* GDC register */
+ 0xff, 0xff, 0xff, 0xff,
+ };
+ int identical = TRUE;
+ int i;
+
+ if ((buf1 == NULL) || (buf2 == NULL))
+ return COMP_DIFFERENT;
+
+ for (i = 0; i < sizeof(params)/sizeof(params[0]); ++i) {
+ if (params[i].mask == 0) /* don't care */
+ continue;
+ if ((buf1[i] & params[i].mask) != (buf2[i] & params[i].mask))
+ return COMP_DIFFERENT;
+ if (buf1[i] != buf2[i])
+ identical = FALSE;
+ }
+ return (identical) ? COMP_IDENTICAL : COMP_SIMILAR;
+}
+
+/* entry points */
+
+/*
+ * init()
+ * Return the # of video adapters found; usually 1 or 0.
+ *
+ * all adapters
+ */
+static int
+vid_init(void)
+{
+ video_adapter_t *adp;
+ video_info_t info;
+ u_char *mp;
+ int i;
+
+ /* do this test only once */
+ if (init_done)
+ return adapters;
+ init_done = TRUE;
+
+ /*
+ * Locate display adapters.
+ * The AT architecture supports upto two adapters. `syscons' allows
+ * the following combinations of adapters:
+ * 1) MDA + CGA
+ * 2) MDA + EGA/VGA color
+ * 3) CGA + EGA/VGA mono
+ * Note that `syscons' doesn't bother with MCGA as it is only
+ * avaiable for low end PS/2 models which has 80286 or earlier CPUs,
+ * thus, they are not running FreeBSD!
+ * When there are two adapaters in the system, one becomes `primary'
+ * and the other `secondary'. The EGA adapter has a set of DIP
+ * switches on board for this information and the EGA BIOS copies
+ * it in the BIOS data area BIOSDATA_VIDEOSWITCH (40:88).
+ * The VGA BIOS has more sophisticated mechanism and has this
+ * information in BIOSDATA_DCCINDEX (40:8a), but it also maintains
+ * compatibility with the EGA BIOS by updating BIOSDATA_VIDEOSWITCH.
+ */
+
+ /*
+ * Check rtc and BIOS date area.
+ * XXX: we don't use BIOSDATA_EQUIPMENT, since it is not a dead
+ * copy of RTC_EQUIPMENT. Bits 4 and 5 of the ETC_EQUIPMENT are
+ * zeros for EGA and VGA. However, the EGA/VGA BIOS sets
+ * these bits in BIOSDATA_EQUIPMENT according to the monitor
+ * type detected.
+ */
+ switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
+ case 0:
+ /* EGA/VGA */
+ fill_adapter_param(*(u_int8_t *)BIOS_PADDRTOVADDR(0x488) & 0x0f,
+ adapter);
+ break;
+ case 1:
+ /* CGA 40x25 */
+ /* FIXME: switch to the 80x25 mode? XXX */
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ break;
+ case 2:
+ /* CGA 80x25 */
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ break;
+ case 3:
+ /* MDA */
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
+ break;
+ }
+
+ adapters = 0;
+ if (verify_adapter(&adapter[V_ADP_SECONDARY]) == 0) {
+ ++adapters;
+ adapter[V_ADP_SECONDARY].va_mode =
+ adapter[V_ADP_SECONDARY].va_initial_mode =
+ map_bios_mode_num(adapter[V_ADP_SECONDARY].va_type,
+ adapter[V_ADP_SECONDARY].va_flags & V_ADP_COLOR,
+ adapter[V_ADP_SECONDARY].va_initial_bios_mode);
+ } else {
+ adapter[V_ADP_SECONDARY].va_type = -1;
+ }
+ if (verify_adapter(&adapter[V_ADP_PRIMARY]) == 0) {
+ ++adapters;
+ adapter[V_ADP_PRIMARY].va_initial_bios_mode =
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x449);
+ adapter[V_ADP_PRIMARY].va_mode =
+ adapter[V_ADP_PRIMARY].va_initial_mode =
+ map_bios_mode_num(adapter[V_ADP_PRIMARY].va_type,
+ adapter[V_ADP_PRIMARY].va_flags & V_ADP_COLOR,
+ adapter[V_ADP_PRIMARY].va_initial_bios_mode);
+ } else {
+ adapter[V_ADP_PRIMARY] = adapter[V_ADP_SECONDARY];
+ adapter[V_ADP_SECONDARY].va_type = -1;
+ }
+ if (adapters == 0)
+ return adapters;
+ adapter[V_ADP_PRIMARY].va_index = V_ADP_PRIMARY;
+ adapter[V_ADP_SECONDARY].va_index = V_ADP_SECONDARY;
+
+#if 0
+ /*
+ * We cannot have two video adapter of the same type; there must be
+ * only one of color or mono adapter, or one each of them.
+ */
+ if (adapters > 1) {
+ if (!((adapter[0].va_flags ^ adapter[1].va_flags) & V_ADP_COLOR))
+ /* we have two mono or color adapters!! */
+ return (adapters = 0);
+ }
+#endif
+
+ /*
+ * Ensure a zero start address. This is mainly to recover after
+ * switching from pcvt using userconfig(). The registers are w/o
+ * for old hardware so it's too hard to relocate the active screen
+ * memory.
+ * This must be done before vid_save_state() for VGA.
+ */
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr, 12);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr, 13);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
+
+ /* the video mode parameter table in EGA/VGA BIOS */
+ /* NOTE: there can be only one EGA/VGA, wheather color or mono,
+ * recognized by the video BIOS.
+ */
+ if ((adapter[V_ADP_PRIMARY].va_type == KD_EGA) ||
+ (adapter[V_ADP_PRIMARY].va_type == KD_VGA)) {
+ adp = &adapter[V_ADP_PRIMARY];
+ } else if ((adapter[V_ADP_SECONDARY].va_type == KD_EGA) ||
+ (adapter[V_ADP_SECONDARY].va_type == KD_VGA)) {
+ adp = &adapter[V_ADP_SECONDARY];
+ } else {
+ adp = NULL;
+ }
+ bzero(mode_map, sizeof(mode_map));
+ if (adp != NULL) {
+ if (adp->va_type == KD_VGA) {
+ vid_save_state(adp - adapter, &adpstate, sizeof(adpstate));
+ if (video_mode_ptr == NULL) {
+ mode_map[map_mode_num(adp->va_initial_mode)] = adpstate.regs;
+ rows_offset = 1;
+ } else {
+ /* discard the table if we are not familiar with it... */
+ map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
+ mp = get_mode_param(adp->va_initial_mode);
+ if (mp != NULL)
+ bcopy(mp, adpstate2.regs, sizeof(adpstate2.regs));
+ switch (comp_adpregs(adpstate.regs, mp)) {
+ case COMP_IDENTICAL:
+ /*
+ * OK, this parameter table looks reasonably familiar
+ * to us...
+ */
+ /*
+ * This is a kludge for Toshiba DynaBook SS433
+ * whose BIOS video mode table entry has the actual #
+ * of rows at the offset 1; BIOSes from other
+ * manufacturers store the # of rows - 1 there. XXX
+ */
+ rows_offset = adpstate.regs[1] + 1 - mp[1];
+ break;
+
+ case COMP_SIMILAR:
+ /*
+ * Not exactly the same, but similar enough to be
+ * trusted. However, use the saved register values
+ * for the initial mode and other modes which are
+ * based on the initial mode.
+ */
+ mode_map[map_mode_num(adp->va_initial_mode)] =
+ adpstate.regs;
+ rows_offset = adpstate.regs[1] + 1 - mp[1];
+ adpstate.regs[1] -= rows_offset - 1;
+ break;
+
+ case COMP_DIFFERENT:
+ default:
+ /*
+ * Don't use the paramter table in BIOS. It doesn't
+ * look familiar to us. Video mode switching is allowed
+ * only if the new mode is the same as or based on
+ * the initial mode.
+ */
+ video_mode_ptr = NULL;
+ bzero(mode_map, sizeof(mode_map));
+ mode_map[map_mode_num(adp->va_initial_mode)] =
+ adpstate.regs;
+ rows_offset = 1;
+ break;
+ }
+ }
+ adp->va_flags |= V_ADP_MODECHANGE;
+ } else if (adp->va_type == KD_EGA) {
+ if (video_mode_ptr == NULL) {
+ adp->va_flags &= ~V_ADP_FONT;
+ rows_offset = 1;
+ } else {
+ map_mode_table(mode_map, video_mode_ptr, M_ENH_C80x25 + 1);
+ /* XXX how can one validate the EGA table... */
+ mp = get_mode_param(adp->va_initial_mode);
+ if (mp != NULL) {
+ adp->va_flags |= V_ADP_MODECHANGE;
+ rows_offset = 1;
+ } else {
+ /*
+ * This is serious. We will not be able to switch video
+ * modes at all...
+ */
+ adp->va_flags &= ~V_ADP_FONT;
+ video_mode_ptr = NULL;
+ bzero(mode_map, sizeof(mode_map));
+ rows_offset = 1;
+ }
+ }
+ }
+ }
+
+ /* remove conflicting modes if we have more than one adapter */
+ if (adapters > 1) {
+ for (i = 0; i < adapters; ++i) {
+ if (!(adapter[i].va_flags & V_ADP_MODECHANGE))
+ continue;
+ clear_mode_map(i, mode_map, M_VGA_CG320 + 1,
+ (adapter[i].va_flags & V_ADP_COLOR) ?
+ V_INFO_COLOR : 0);
+ }
+ }
+
+ /* buffer address */
+ vid_get_info(V_ADP_PRIMARY,
+ adapter[V_ADP_PRIMARY].va_initial_mode, &info);
+ adapter[V_ADP_PRIMARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[V_ADP_PRIMARY].va_window_size = info.vi_window_size;
+ adapter[V_ADP_PRIMARY].va_window_gran = info.vi_window_gran;
+ adapter[V_ADP_PRIMARY].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[V_ADP_PRIMARY].va_buffer_size = info.vi_buffer_size;
+ if (adapters > 1) {
+ vid_get_info(V_ADP_SECONDARY,
+ adapter[V_ADP_SECONDARY].va_initial_mode, &info);
+ adapter[V_ADP_SECONDARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[V_ADP_SECONDARY].va_window_size = info.vi_window_size;
+ adapter[V_ADP_SECONDARY].va_window_gran = info.vi_window_gran;
+ adapter[V_ADP_SECONDARY].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[V_ADP_SECONDARY].va_buffer_size = info.vi_buffer_size;
+ }
+
+ /*
+ * XXX: we should verify the following values for the primary adapter...
+ * crtc I/O port address: *(u_int16_t *)BIOS_PADDRTOVADDR(0x463);
+ * color/mono display: (*(u_int8_t *)BIOS_PADDRTOVADDR(0x487) & 0x02)
+ * ? 0 : V_ADP_COLOR;
+ * columns: *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a);
+ * rows: *(u_int8_t *)BIOS_PADDRTOVADDR(0x484);
+ * font size: *(u_int8_t *)BIOS_PADDRTOVADDR(0x485);
+ * buffer size: *(u_int16_t *)BIOS_PADDRTOVADDR(0x44c);
+ */
+
+ return adapters;
+}
+
+/*
+ * adapter();
+ * Return a pointer to the video_adapter structure of the requested
+ * adapter.
+ *
+ * all adapters
+ */
+static video_adapter_t
+*vid_adapter(int ad)
+{
+ if (!init_done)
+ return NULL;
+ if ((ad < 0) || (ad >= adapters))
+ return NULL;
+ return &adapter[ad];
+}
+
+/*
+ * get_info():
+ * Return the video_info structure of the requested video mode.
+ *
+ * all adapters
+ */
+static int
+vid_get_info(int ad, int mode, video_info_t *info)
+{
+ int i;
+
+ if (!init_done)
+ return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
+
+ mode = map_gen_mode_num(adapter[ad].va_type,
+ adapter[ad].va_flags & V_ADP_COLOR, mode);
+ if (adapter[ad].va_flags & V_ADP_MODECHANGE) {
+ /*
+ * If the parameter table entry for this mode is not found,
+ * the mode is not supported...
+ */
+ if (get_mode_param(mode) == NULL)
+ return 1;
+ } else {
+ /*
+ * Even if we don't support video mode switching on this adapter,
+ * the information on the initial (thus current) video mode
+ * should be made available.
+ */
+ if (mode != adapter[ad].va_initial_mode)
+ return 1;
+ }
+
+ for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+ if (bios_vmode[i].vi_mode == NA)
+ continue;
+ if (mode == bios_vmode[i].vi_mode) {
+ *info = bios_vmode[i];
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/*
+ * query_mode():
+ * Find a video mode matching the requested parameters.
+ * Fields filled with 0 are considered "don't care" fields and
+ * match any modes.
+ *
+ * all adapters
+ */
+static int
+vid_query_mode(int ad, video_info_t *info)
+{
+ video_info_t buf;
+ int i;
+
+ if (!init_done)
+ return -1;
+ if ((ad < 0) || (ad >= adapters))
+ return -1;
+
+ for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+ if (bios_vmode[i].vi_mode == NA)
+ continue;
+
+ if ((info->vi_width != 0)
+ && (info->vi_width != bios_vmode[i].vi_width))
+ continue;
+ if ((info->vi_height != 0)
+ && (info->vi_height != bios_vmode[i].vi_height))
+ continue;
+ if ((info->vi_cwidth != 0)
+ && (info->vi_cwidth != bios_vmode[i].vi_cwidth))
+ continue;
+ if ((info->vi_cheight != 0)
+ && (info->vi_cheight != bios_vmode[i].vi_cheight))
+ continue;
+ if ((info->vi_depth != 0)
+ && (info->vi_depth != bios_vmode[i].vi_depth))
+ continue;
+ if ((info->vi_planes != 0)
+ && (info->vi_planes != bios_vmode[i].vi_planes))
+ continue;
+ /* XXX: should check pixel format, memory model */
+ if ((info->vi_flags != 0)
+ && (info->vi_flags != bios_vmode[i].vi_flags))
+ continue;
+
+ /* verify if this mode is supported on this adapter */
+ if (vid_get_info(ad, bios_vmode[i].vi_mode, &buf))
+ continue;
+ return bios_vmode[i].vi_mode;
+ }
+ return -1;
+}
+
+/*
+ * set_mode():
+ * Change the video mode.
+ *
+ * EGA/VGA
+ */
+static int
+vid_set_mode(int ad, int mode)
+{
+ video_info_t info;
+ adp_state_t params;
+
+ prologue(ad, V_ADP_MODECHANGE, 1);
+
+ mode = map_gen_mode_num(adapter[ad].va_type,
+ adapter[ad].va_flags & V_ADP_COLOR, mode);
+ if (vid_get_info(ad, mode, &info))
+ return 1;
+ params.sig = V_STATE_SIG;
+ bcopy(get_mode_param(mode), params.regs, sizeof(params.regs));
+
+ switch (mode) {
+ case M_VGA_C80x60: case M_VGA_M80x60:
+ params.regs[2] = 0x08;
+ params.regs[19] = 0x47;
+ goto special_480l;
+
+ case M_VGA_C80x30: case M_VGA_M80x30:
+ params.regs[19] = 0x4f;
+special_480l:
+ params.regs[9] |= 0xc0;
+ params.regs[16] = 0x08;
+ params.regs[17] = 0x3e;
+ params.regs[26] = 0xea;
+ params.regs[28] = 0xdf;
+ params.regs[31] = 0xe7;
+ params.regs[32] = 0x04;
+ goto setup_mode;
+
+ case M_ENH_C80x43: case M_ENH_B80x43:
+ params.regs[28] = 87;
+ goto special_80x50;
+
+ case M_VGA_C80x50: case M_VGA_M80x50:
+special_80x50:
+ params.regs[2] = 8;
+ params.regs[19] = 7;
+ goto setup_mode;
+
+ case M_VGA_C40x25: case M_VGA_C80x25:
+ case M_VGA_M80x25:
+ case M_B40x25: case M_C40x25:
+ case M_B80x25: case M_C80x25:
+ case M_ENH_B40x25: case M_ENH_C40x25:
+ case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
+
+setup_mode:
+ vid_load_state(ad, &params);
+ break;
+
+ case M_VGA_MODEX:
+ /* "unchain" the VGA mode */
+ params.regs[5-1+0x04] &= 0xf7;
+ params.regs[5-1+0x04] |= 0x04;
+ /* turn off doubleword mode */
+ params.regs[10+0x14] &= 0xbf;
+ /* turn off word adressing */
+ params.regs[10+0x17] |= 0x40;
+ /* set logical screen width */
+ params.regs[10+0x13] = 80;
+ /* set 240 lines */
+ params.regs[10+0x11] = 0x2c;
+ params.regs[10+0x06] = 0x0d;
+ params.regs[10+0x07] = 0x3e;
+ params.regs[10+0x10] = 0xea;
+ params.regs[10+0x11] = 0xac;
+ params.regs[10+0x12] = 0xdf;
+ params.regs[10+0x15] = 0xe7;
+ params.regs[10+0x16] = 0x06;
+ /* set vertical sync polarity to reflect aspect ratio */
+ params.regs[9] = 0xe3;
+ goto setup_grmode;
+
+ case M_BG320: case M_CG320: case M_BG640:
+ case M_CG320_D: case M_CG640_E:
+ case M_CG640x350: case M_ENH_CG640:
+ case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
+
+setup_grmode:
+ vid_load_state(ad, &params);
+ break;
+
+ default:
+ return 1;
+ }
+
+ adapter[ad].va_mode = mode;
+ adapter[ad].va_flags &= ~V_ADP_COLOR;
+ adapter[ad].va_flags |=
+ (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
+ adapter[ad].va_crtc_addr =
+ (adapter[ad].va_flags & V_ADP_COLOR) ? COLOR_BASE : MONO_BASE;
+ adapter[ad].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[ad].va_window_size = info.vi_window_size;
+ adapter[ad].va_window_gran = info.vi_window_gran;
+ if (info.vi_buffer_size == 0) {
+ adapter[ad].va_buffer = 0;
+ adapter[ad].va_buffer_size = 0;
+ } else {
+ adapter[ad].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[ad].va_buffer_size = info.vi_buffer_size;
+ }
+
+ return 0;
+}
+
+static void
+set_font_mode(video_adapter_t *adp, u_char *buf)
+{
+ u_char *mp;
+ int s;
+
+ s = splhigh();
+
+ /* save register values */
+ if (adp->va_type == KD_VGA) {
+ outb(TSIDX, 0x02); buf[0] = inb(TSREG);
+ outb(TSIDX, 0x04); buf[1] = inb(TSREG);
+ outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
+ outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
+ outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
+ inb(adp->va_crtc_addr + 6);
+ outb(ATC, 0x10); buf[5] = inb(ATC + 1);
+ } else /* if (adp->va_type == KD_EGA) */ {
+ /*
+ * EGA cannot be read; copy parameters from the mode parameter
+ * table.
+ */
+ mp = get_mode_param(adp->va_mode);
+ buf[0] = mp[5 + 0x02 - 1];
+ buf[1] = mp[5 + 0x04 - 1];
+ buf[2] = mp[55 + 0x04];
+ buf[3] = mp[55 + 0x05];
+ buf[4] = mp[55 + 0x06];
+ buf[5] = mp[35 + 0x10];
+ }
+
+ /* setup vga for loading fonts */
+ inb(adp->va_crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
+ inb(adp->va_crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifdef SC_ALT_SEQACCESS
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, 0x04);
+ outb(TSIDX, 0x04); outb(TSREG, 0x07);
+#ifdef SC_ALT_SEQACCESS
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
+ outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
+ outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
+#else
+#ifdef SC_ALT_SEQACCESS
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0402);
+ outw(TSIDX, 0x0704);
+#ifdef SC_ALT_SEQACCESS
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0204);
+ outw(GDCIDX, 0x0005);
+ outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
+#endif
+
+ splx(s);
+}
+
+static void
+set_normal_mode(video_adapter_t *adp, u_char *buf)
+{
+ int s;
+
+ s = splhigh();
+
+ /* setup vga for normal operation mode again */
+ inb(adp->va_crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5]);
+ inb(adp->va_crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifdef SC_ALT_SEQACCESS
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, buf[0]);
+ outb(TSIDX, 0x04); outb(TSREG, buf[1]);
+#ifdef SC_ALT_SEQACCESS
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
+ outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
+ if (adp->va_crtc_addr == MONO_BASE) {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x08);
+ } else {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
+ }
+#else
+#ifdef SC_ALT_SEQACCESS
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0002 | (buf[0] << 8));
+ outw(TSIDX, 0x0004 | (buf[1] << 8));
+#ifdef SC_ALT_SEQACCESS
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0004 | (buf[2] << 8));
+ outw(GDCIDX, 0x0005 | (buf[3] << 8));
+ if (adp->va_crtc_addr == MONO_BASE)
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x08)<<8));
+ else
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
+#endif
+
+ splx(s);
+}
+
+/*
+ * save_font():
+ * Read the font data in the requested font page from the video adapter.
+ *
+ * EGA/VGA
+ */
+static int
+vid_save_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
+{
+ u_char buf[PARAM_BUFSIZE];
+ u_char val = 0;
+ u_int32_t segment;
+ int c;
+ int s;
+
+ prologue(ad, V_ADP_FONT, 1);
+
+ if (fontsize < 14) {
+ /* FONT_8 */
+ fontsize = 8;
+ } else if (fontsize >= 32) {
+ fontsize = 32;
+ } else if (fontsize >= 16) {
+ /* FONT_16 */
+ fontsize = 16;
+ } else {
+ /* FONT_14 */
+ fontsize = 14;
+ }
+
+ if (page < 0 || page >= 8)
+ return 1;
+ segment = VIDEOMEM + 0x4000*page;
+ if (page > 3)
+ segment -= 0xe000;
+
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) { /* what about EGA? XXX */
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ }
+#endif
+
+ set_font_mode(&adapter[ad], buf);
+ if (fontsize == 32) {
+ generic_bcopy((void *)BIOS_PADDRTOVADDR(segment + ch*32), data,
+ fontsize*count);
+ } else {
+ for (c = ch; count > 0; ++c, --count) {
+ generic_bcopy((void *)BIOS_PADDRTOVADDR(segment + c*32), data,
+ fontsize);
+ data += fontsize;
+ }
+ }
+ set_normal_mode(&adapter[ad], buf);
+
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) {
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ }
+#endif
+
+ return 0;
+}
+
+/*
+ * load_font():
+ * Set the font data in the requested font page.
+ * NOTE: it appears that some recent video adapters do not support
+ * the font page other than 0... XXX
+ *
+ * EGA/VGA
+ */
+static int
+vid_load_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
+{
+ u_char buf[PARAM_BUFSIZE];
+ u_char val = 0;
+ u_int32_t segment;
+ int c;
+ int s;
+
+ prologue(ad, V_ADP_FONT, 1);
+
+ if (fontsize < 14) {
+ /* FONT_8 */
+ fontsize = 8;
+ } else if (fontsize >= 32) {
+ fontsize = 32;
+ } else if (fontsize >= 16) {
+ /* FONT_16 */
+ fontsize = 16;
+ } else {
+ /* FONT_14 */
+ fontsize = 14;
+ }
+
+ if (page < 0 || page >= 8)
+ return 1;
+ segment = VIDEOMEM + 0x4000*page;
+ if (page > 3)
+ segment -= 0xe000;
+
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) { /* what about EGA? XXX */
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ }
+#endif
+
+ set_font_mode(&adapter[ad], buf);
+ if (fontsize == 32) {
+ generic_bcopy(data, (void *)BIOS_PADDRTOVADDR(segment + ch*32),
+ fontsize*count);
+ } else {
+ for (c = ch; count > 0; ++c, --count) {
+ generic_bcopy(data, (void *)BIOS_PADDRTOVADDR(segment + c*32),
+ fontsize);
+ data += fontsize;
+ }
+ }
+ set_normal_mode(&adapter[ad], buf);
+
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) {
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ }
+#endif
+
+ return 0;
+}
+
+/*
+ * show_font():
+ * Activate the requested font page.
+ * NOTE: it appears that some recent video adapters do not support
+ * the font page other than 0... XXX
+ *
+ * EGA/VGA
+ */
+static int
+vid_show_font(int ad, int page)
+{
+ static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f, 0x30, 0x35, 0x3a, 0x3f };
+ int s;
+
+ prologue(ad, V_ADP_FONT, 1);
+ if (page < 0 || page >= 8)
+ return 1;
+
+ s = splhigh();
+ outb(TSIDX, 0x03); outb(TSREG, cg[page]);
+ splx(s);
+
+ return 0;
+}
+
+/*
+ * save_palette():
+ * Read DAC values. The values have expressed in 8 bits.
+ *
+ * VGA
+ */
+static int
+vid_save_palette(int ad, u_char *palette)
+{
+ int i;
+
+ prologue(ad, V_ADP_PALETTE, 1);
+
+ /*
+ * We store 8 bit values in the palette buffer, while the standard
+ * VGA has 6 bit DAC .
+ */
+ outb(PALRADR, 0x00);
+ for (i = 0; i < 256*3; ++i)
+ palette[i] = inb(PALDATA) << 2;
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip/flop */
+ return 0;
+}
+
+/*
+ * load_palette():
+ * Set DAC values.
+ *
+ * VGA
+ */
+static int
+vid_load_palette(int ad, u_char *palette)
+{
+ int i;
+
+ prologue(ad, V_ADP_PALETTE, 1);
+
+ outb(PIXMASK, 0xff); /* no pixelmask */
+ outb(PALWADR, 0x00);
+ for (i = 0; i < 256*3; ++i)
+ outb(PALDATA, palette[i] >> 2);
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip/flop */
+ outb(ATC, 0x20); /* enable palette */
+ return 0;
+}
+
+/*
+ * set_border():
+ * Change the border color.
+ *
+ * CGA/EGA/VGA
+ */
+static int
+vid_set_border(int ad, int color)
+{
+ prologue(ad, V_ADP_BORDER, 1);
+
+ switch (adapter[ad].va_type) {
+ case KD_EGA:
+ case KD_VGA:
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x31); outb(ATC, color & 0xff);
+ break;
+ case KD_CGA:
+ outb(adapter[ad].va_crtc_addr + 5, color & 0x0f); /* color select register */
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
+ * save_state():
+ * Read video register values.
+ * NOTE: this function only reads the standard EGA/VGA registers.
+ * any extra/extended registers of SVGA adapters are not saved.
+ *
+ * VGA
+ */
+static int
+vid_save_state(int ad, void *p, size_t size)
+{
+ video_info_t info;
+ u_char *buf;
+ int crtc_addr;
+ int i, j;
+ int s;
+
+ if (size == 0) {
+ /* return the required buffer size */
+ prologue(ad, V_ADP_STATESAVE, 0);
+ return sizeof(adp_state_t);
+ } else {
+ prologue(ad, V_ADP_STATESAVE, 1);
+ if (size < sizeof(adp_state_t))
+ return 1;
+ }
+
+ ((adp_state_t *)p)->sig = V_STATE_SIG;
+ buf = ((adp_state_t *)p)->regs;
+ bzero(buf, V_MODE_PARAM_SIZE);
+ crtc_addr = adapter[ad].va_crtc_addr;
+
+ s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i = 0, j = 5; i < 4; i++) {
+ outb(TSIDX, i + 1);
+ buf[j++] = inb(TSREG);
+ }
+ buf[9] = inb(MISC + 10); /* dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+
+ for (i = 0, j = 10; i < 25; i++) { /* crtc */
+ outb(crtc_addr, i);
+ buf[j++] = inb(crtc_addr + 1);
+ }
+ for (i = 0, j = 35; i < 20; i++) { /* attribute ctrl */
+ inb(crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, i);
+ buf[j++] = inb(ATC + 1);
+ }
+ for (i = 0, j = 55; i < 9; i++) { /* graph data ctrl */
+ outb(GDCIDX, i);
+ buf[j++] = inb(GDCREG);
+ }
+ inb(crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+ splx(s);
+
+#if 1
+ if (vid_get_info(ad, adapter[ad].va_mode, &info) == 0) {
+ if (info.vi_flags & V_INFO_GRAPHICS) {
+ buf[0] = info.vi_width/info.vi_cwidth; /* COLS */
+ buf[1] = info.vi_height/info.vi_cheight - 1; /* ROWS */
+ } else {
+ buf[0] = info.vi_width; /* COLS */
+ buf[1] = info.vi_height - 1; /* ROWS */
+ }
+ buf[2] = info.vi_cheight; /* POINTS */
+ } else {
+ /* XXX: shouldn't be happening... */
+ printf("video#%d: failed to obtain mode info. (vid_save_state())\n",
+ ad);
+ }
+#else
+ buf[0] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a); /* COLS */
+ buf[1] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x484); /* ROWS */
+ buf[2] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x485); /* POINTS */
+ buf[3] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44c);
+ buf[4] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44d);
+#endif
+
+ return 0;
+}
+
+/*
+ * load_state():
+ * Set video registers at once.
+ * NOTE: this function only updates the standard EGA/VGA registers.
+ * any extra/extended registers of SVGA adapters are not changed.
+ *
+ * EGA/VGA
+ */
+static int
+vid_load_state(int ad, void *p)
+{
+ u_char *buf;
+ int crtc_addr;
+ int s;
+ int i;
+
+ prologue(ad, V_ADP_STATELOAD, 1);
+ if (((adp_state_t *)p)->sig != V_STATE_SIG)
+ return 1;
+
+ buf = ((adp_state_t *)p)->regs;
+ crtc_addr = adapter[ad].va_crtc_addr;
+
+ s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i = 0; i < 4; ++i) { /* program sequencer */
+ outb(TSIDX, i + 1);
+ outb(TSREG, buf[i + 5]);
+ }
+ outb(MISC, buf[9]); /* set dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+ outb(crtc_addr, 0x11);
+ outb(crtc_addr + 1, inb(crtc_addr + 1) & 0x7F);
+ for (i = 0; i < 25; ++i) { /* program crtc */
+ outb(crtc_addr, i);
+ outb(crtc_addr + 1, buf[i + 10]);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ for (i = 0; i < 20; ++i) { /* program attribute ctrl */
+ outb(ATC, i);
+ outb(ATC, buf[i + 35]);
+ }
+ for (i = 0; i < 9; ++i) { /* program graph data ctrl */
+ outb(GDCIDX, i);
+ outb(GDCREG, buf[i + 55]);
+ }
+ inb(crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+ if (ad == V_ADP_PRIMARY) {
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a) = buf[0]; /* COLS */
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x484) = buf[1] + rows_offset - 1; /* ROWS */
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x485) = buf[2]; /* POINTS */
+#if 0
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44c) = buf[3];
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44d) = buf[4];
+#endif
+ }
+
+ splx(s);
+ return 0;
+}
+
+/*
+ * set_origin():
+ * Change the origin (window mapping) of the banked frame buffer.
+ */
+static int
+vid_set_origin(int ad, off_t offset)
+{
+ /*
+ * The standard video modes do not require window mapping;
+ * always return error.
+ */
+ return 1;
+}
+
+/*
+ * read_hw_cursor():
+ * Read the position of the hardware text cursor.
+ *
+ * all adapters
+ */
+static int
+vid_read_hw_cursor(int ad, int *col, int *row)
+{
+ video_info_t info;
+ u_int16_t off;
+
+ if (!init_done)
+ return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
+
+ (*biosvidsw.get_info)(ad, adapter[ad].va_mode, &info);
+ if (info.vi_flags & V_INFO_GRAPHICS)
+ return 1;
+
+ outb(adapter[ad].va_crtc_addr, 14);
+ off = inb(adapter[ad].va_crtc_addr + 1);
+ outb(adapter[ad].va_crtc_addr, 15);
+ off = (off << 8) | inb(adapter[ad].va_crtc_addr + 1);
+
+ *row = off / info.vi_width;
+ *col = off % info.vi_width;
+
+ return 0;
+}
+
+/*
+ * set_hw_cursor():
+ * Move the hardware text cursor. If the requested position is (-1, -1),
+ * the text cursor won't be shown.
+ *
+ * all adapters
+ */
+static int
+vid_set_hw_cursor(int ad, int col, int row)
+{
+ video_info_t info;
+ u_int16_t off;
+
+ if (!init_done)
+ return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
+
+ (*biosvidsw.get_info)(ad, adapter[ad].va_mode, &info);
+ if (info.vi_flags & V_INFO_GRAPHICS)
+ return 1;
+
+ if ((col == -1) || (row == -1))
+ off = 0xffff;
+ else
+ off = row*info.vi_width + col;
+ outb(adapter[ad].va_crtc_addr, 14);
+ outb(adapter[ad].va_crtc_addr + 1, off >> 8);
+ outb(adapter[ad].va_crtc_addr, 15);
+ outb(adapter[ad].va_crtc_addr + 1, off & 0x00ff);
+
+ return 0;
+}
+
+static char
+*adapter_name(int type)
+{
+ static struct {
+ int type;
+ char *name;
+ } names[] = {
+ { KD_MONO, "MDA" },
+ { KD_HERCULES, "Hercules" },
+ { KD_CGA, "CGA" },
+ { KD_EGA, "EGA" },
+ { KD_VGA, "VGA" },
+ { KD_PC98, "PC-98xx" },
+ { -1, "Unknown" },
+ };
+ int i;
+
+ for (i = 0; names[i].type != -1; ++i)
+ if (names[i].type == type)
+ break;
+ return names[i].name;
+}
+
+static void
+dump_adp_info(int ad, video_adapter_t *adp, int level)
+{
+ if (level <= 0)
+ return;
+
+ printf("video#%d: adapter type:%s (%d), flags:0x%x, CRTC:0x%x\n",
+ ad, adapter_name(adp->va_type), adp->va_type,
+ adp->va_flags, adp->va_crtc_addr);
+ printf("video#%d: init mode:%d, bios mode:%d, current mode:%d\n",
+ ad, adp->va_initial_mode, adp->va_initial_bios_mode, adp->va_mode);
+ printf("video#%d: window:0x%x size:%dk gran:%dk, buf:0x%x size:%dk\n",
+ ad,
+ adp->va_window, adp->va_window_size/1024, adp->va_window_gran/1024,
+ adp->va_buffer, adp->va_buffer_size/1024);
+}
+
+static void
+dump_mode_info(int ad, video_info_t *info, int level)
+{
+ if (level <= 0)
+ return;
+
+ printf("video#%d: mode:%d, flags:0x%x ",
+ ad, info->vi_mode, info->vi_flags);
+ if (info->vi_flags & V_INFO_GRAPHICS)
+ printf("G %dx%dx%d, %d plane(s), font:%dx%d, ",
+ info->vi_width, info->vi_height,
+ info->vi_depth, info->vi_planes,
+ info->vi_cwidth, info->vi_cheight);
+ else
+ printf("T %dx%d, font:%dx%d, ",
+ info->vi_width, info->vi_height,
+ info->vi_cwidth, info->vi_cheight);
+ printf("win:0x%x\n", info->vi_window);
+}
+
+static void
+dump_buffer(u_char *buf, size_t len)
+{
+ int i;
+
+ for(i = 0; i < len;) {
+ printf("%02x ", buf[i]);
+ if ((++i % 16) == 0)
+ printf("\n");
+ }
+}
+
+/*
+ * diag():
+ * Print some information about the video adapter and video modes,
+ * with requested level of details.
+ *
+ * all adapters
+ */
+static int
+vid_diag(int level)
+{
+ video_info_t info;
+ u_char *mp;
+ int ad;
+ int i;
+
+ if (!init_done)
+ return 1;
+
+ if (level > 0) {
+ printf("video: RTC equip. code:0x%02x, DCC code:0x%02x\n",
+ rtcin(RTC_EQUIPMENT), *(u_int8_t *)BIOS_PADDRTOVADDR(0x488));
+ printf("video: CRTC:0x%x, video option:0x%02x, ",
+ *(u_int16_t *)BIOS_PADDRTOVADDR(0x463),
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x487));
+ printf("rows:%d, cols:%d, font height:%d\n",
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a),
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x484) + 1,
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x485));
+ printf("video: param table EGA/VGA:%p, CGA/MDA:%p\n",
+ video_mode_ptr, video_mode_ptr2);
+ printf("video: rows_offset:%d\n", rows_offset);
+ }
+
+ for (ad = 0; ad < adapters; ++ad) {
+ dump_adp_info(ad, &adapter[ad], level);
+
+ if (!(adapter[ad].va_flags & V_ADP_MODECHANGE)) {
+ vid_get_info(ad, adapter[ad].va_initial_mode, &info);
+ dump_mode_info(ad, &info, level);
+ } else {
+ for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+ if (bios_vmode[i].vi_mode == NA)
+ continue;
+ if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
+ continue;
+ dump_mode_info(ad, &bios_vmode[i], level);
+ }
+ }
+ if ((adapter[ad].va_type != KD_EGA) && (adapter[ad].va_type != KD_VGA))
+ continue;
+
+ if (video_mode_ptr == NULL)
+ printf("video#%d: WARNING: video mode switching is not fully supported on this adapter\n", ad);
+
+ if (level <= 0)
+ continue;
+
+ if (adapter[ad].va_type == KD_VGA) {
+ printf("VGA parameters upon power-up\n");
+ dump_buffer(adpstate.regs, sizeof(adpstate.regs));
+ printf("VGA parameters in BIOS for mode %d\n",
+ adapter[ad].va_initial_mode);
+ dump_buffer(adpstate2.regs, sizeof(adpstate2.regs));
+ }
+
+ mp = get_mode_param(adapter[ad].va_initial_mode);
+ if (mp == NULL) /* this shouldn't be happening */
+ continue;
+ printf("EGA/VGA parameters to be used for mode %d\n",
+ adapter[ad].va_initial_mode);
+ dump_buffer(mp, V_MODE_PARAM_SIZE);
+ }
+
+ return 0;
+}
+
+#endif /* NSC > 0 */
diff --git a/sys/i386/isa/videoio.h b/sys/i386/isa/videoio.h
new file mode 100644
index 000000000000..a79ffbe97bab
--- /dev/null
+++ b/sys/i386/isa/videoio.h
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * 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 as
+ * the first lines of this file unmodified.
+ * 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.
+ *
+ * $Id: videoio.h,v 1.1 1998/09/15 18:16:38 sos Exp $
+ */
+
+#ifndef _I386_ISA_VIDEOIO_H_
+#define _I386_ISA_VIDEOIO_H_
+
+#ifdef KERNEL
+
+#define V_MAX_ADAPTERS 2
+
+#define V_MODE_MAP_SIZE (M_VGA_CG320 + 1)
+#define V_MODE_PARAM_SIZE 64
+
+/* physical addresses */
+#define MONO_BUF BIOS_PADDRTOVADDR(0xb0000)
+#define CGA_BUF BIOS_PADDRTOVADDR(0xb8000)
+#define GRAPHICS_BUF BIOS_PADDRTOVADDR(0xa0000)
+#define VIDEOMEM 0x000A0000
+
+/* I/O port addresses */
+#define MONO_BASE 0x3B4 /* crt controller base mono */
+#define COLOR_BASE 0x3D4 /* crt controller base color */
+#define MISC 0x3C2 /* misc output register */
+#define ATC IO_VGA+0x00 /* attribute controller */
+#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
+#define TSREG IO_VGA+0x05 /* timing sequencer data */
+#define PIXMASK IO_VGA+0x06 /* pixel write mask */
+#define PALRADR IO_VGA+0x07 /* palette read address */
+#define PALWADR IO_VGA+0x08 /* palette write address */
+#define PALDATA IO_VGA+0x09 /* palette data register */
+#define GDCIDX IO_VGA+0x0E /* graph data controller idx */
+#define GDCREG IO_VGA+0x0F /* graph data controller data */
+
+/* video function table */
+typedef int vi_init_t(void);
+typedef video_adapter_t *vi_adapter_t(int ad);
+typedef int vi_get_info_t(int ad, int mode, video_info_t *info);
+typedef int vi_query_mode_t(int ad, video_info_t *info);
+typedef int vi_set_mode_t(int ad, int mode);
+typedef int vi_save_font_t(int ad, int page, int size, u_char *data,
+ int c, int count);
+typedef int vi_load_font_t(int ad, int page, int size, u_char *data,
+ int c, int count);
+typedef int vi_show_font_t(int ad, int page);
+typedef int vi_save_palette_t(int ad, u_char *palette);
+typedef int vi_load_palette_t(int ad, u_char *palette);
+typedef int vi_set_border_t(int ad, int border);
+typedef int vi_save_state_t(int ad, void *p, size_t size);
+typedef int vi_load_state_t(int ad, void *p);
+typedef int vi_set_win_org_t(int ad, off_t offset);
+typedef int vi_read_hw_cursor_t(int ad, int *col, int *row);
+typedef int vi_set_hw_cursor_t(int ad, int col, int row);
+typedef int vi_diag_t(int level);
+
+struct vidsw {
+ vi_init_t *init; /* all */
+ vi_adapter_t *adapter; /* all */
+ vi_get_info_t *get_info; /* all */
+ vi_query_mode_t *query_mode; /* all */
+ vi_set_mode_t *set_mode; /* EGA/VGA */
+ vi_save_font_t *save_font; /* EGA/VGA */
+ vi_load_font_t *load_font; /* EGA/VGA */
+ vi_show_font_t *show_font; /* EGA/VGA */
+ vi_save_palette_t *save_palette; /* VGA */
+ vi_load_palette_t *load_palette; /* VGA */
+ vi_set_border_t *set_border; /* CGA/EGA/VGA */
+ vi_save_state_t *save_state; /* VGA */
+ vi_load_state_t *load_state; /* EGA/VGA */
+ vi_set_win_org_t *set_win_org; /* all */
+ vi_read_hw_cursor_t *read_hw_cursor; /* all */
+ vi_set_hw_cursor_t *set_hw_cursor; /* all */
+ vi_diag_t *diag; /* all */
+};
+
+extern struct vidsw biosvidsw;
+
+#endif /* KERNEL */
+
+#endif /* !_I386_ISA_VIDEOIO_H_ */
diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c
new file mode 100644
index 000000000000..1f22bfc7c821
--- /dev/null
+++ b/sys/i386/isa/wcd.c
@@ -0,0 +1,1399 @@
+/*
+ * IDE CD-ROM driver for FreeBSD.
+ * Supports ATAPI-compatible drives.
+ *
+ * Copyright (C) 1995 Cronyx Ltd.
+ * Author Serge Vakulenko, <vak@cronyx.ru>
+ *
+ * This software is distributed with NO WARRANTIES, not even the implied
+ * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Authors grant any other persons or organisations permission to use
+ * or modify this software as long as this message is kept with the software,
+ * all derivative works or modified versions.
+ *
+ * From: Version 1.9, Mon Oct 9 20:27:42 MSK 1995
+ * $Id: wcd.c,v 1.58 1998/09/08 20:57:47 sos Exp $
+ */
+
+#include "wdc.h"
+#include "wcd.h"
+#include "opt_atapi.h"
+#include "opt_devfs.h"
+
+#if NWCD > 0 && NWDC > 0 && defined (ATAPI)
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/devicestat.h>
+#include <sys/disklabel.h>
+#include <sys/cdio.h>
+#include <sys/conf.h>
+#include <sys/stat.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+
+#include <i386/isa/atapi.h>
+
+static d_open_t wcdopen;
+static d_read_t wcdread;
+static d_close_t wcdclose;
+static d_ioctl_t wcdioctl;
+static d_strategy_t wcdstrategy;
+
+#define CDEV_MAJOR 69
+#define BDEV_MAJOR 19
+static struct cdevsw wcd_cdevsw =
+ { wcdopen, wcdclose, wcdread, nowrite, /*69*/
+ wcdioctl, nostop, nullreset, nodevtotty,/* atapi */
+ seltrue, nommap, wcdstrategy, "wcd",
+ NULL, -1, nodump, nopsize,
+ D_DISK, 0, -1 };
+
+#ifndef ATAPI_STATIC
+static
+#endif
+int wcdattach(struct atapi*, int, struct atapi_params*, int);
+
+#define NUNIT 16 /* Max. number of devices */
+#define SECSIZE 2048 /* CD-ROM sector size in bytes */
+
+#define F_BOPEN 0x0001 /* The block device is opened */
+#define F_MEDIA_CHANGED 0x0002 /* The media have changed since open */
+#define F_DEBUG 0x0004 /* Print debug info */
+#define F_LOCKED 0x0008 /* This unit is locked (or should be) */
+
+/*
+ * Disc table of contents.
+ */
+#define MAXTRK 99
+struct toc {
+ struct ioc_toc_header hdr;
+ struct cd_toc_entry tab[MAXTRK+1]; /* One extra for the leadout */
+};
+
+/*
+ * Volume size info.
+ */
+struct volinfo {
+ u_long volsize; /* Volume size in blocks */
+ u_long blksize; /* Block size in bytes */
+};
+
+/*
+ * Current subchannel status.
+ */
+struct subchan {
+ u_char void0;
+ u_char audio_status;
+ u_short data_length;
+ u_char data_format;
+ u_char control;
+ u_char track;
+ u_char indx;
+ u_long abslba;
+ u_long rellba;
+};
+
+/*
+ * Audio Control Parameters Page
+ */
+struct audiopage {
+ /* Mode data header */
+ u_short data_length;
+ u_char medium_type;
+ u_char reserved1[5];
+
+ /* Audio control page */
+ u_char page_code;
+#define AUDIO_PAGE 0x0e
+#define AUDIO_PAGE_MASK 0x4e /* changeable values */
+ u_char param_len;
+ u_char flags;
+#define CD_PA_SOTC 0x02 /* mandatory */
+#define CD_PA_IMMED 0x04 /* always 1 */
+ u_char reserved3[3];
+ u_short lb_per_sec;
+ struct port_control {
+ u_char channels : 4;
+#define CHANNEL_0 1 /* mandatory */
+#define CHANNEL_1 2 /* mandatory */
+#define CHANNEL_2 4 /* optional */
+#define CHANNEL_3 8 /* optional */
+ u_char volume;
+ } port[4];
+};
+
+/*
+ * CD-ROM Capabilities and Mechanical Status Page
+ */
+struct cappage {
+ /* Mode data header */
+ u_short data_length;
+ u_char medium_type;
+#define MDT_UNKNOWN 0x00
+#define MDT_DATA_120 0x01
+#define MDT_AUDIO_120 0x02
+#define MDT_COMB_120 0x03
+#define MDT_PHOTO_120 0x04
+#define MDT_DATA_80 0x05
+#define MDT_AUDIO_80 0x06
+#define MDT_COMB_80 0x07
+#define MDT_PHOTO_80 0x08
+#define MDT_NO_DISC 0x70
+#define MDT_DOOR_OPEN 0x71
+#define MDT_FMT_ERROR 0x72
+ u_char reserved1[5];
+
+ /* Capabilities page */
+ u_char page_code;
+#define CAP_PAGE 0x2a
+ u_char param_len;
+ u_char reserved2[2];
+
+ u_int audio_play : 1; /* audio play supported */
+ u_int composite : 1; /* composite audio/video supported */
+ u_int dport1 : 1; /* digital audio on port 1 */
+ u_int dport2 : 1; /* digital audio on port 2 */
+ u_int mode2_form1 : 1; /* mode 2 form 1 (XA) read */
+ u_int mode2_form2 : 1; /* mode 2 form 2 format */
+ u_int multisession : 1; /* multi-session photo-CD */
+ u_int : 1;
+ u_int cd_da : 1; /* audio-CD read supported */
+ u_int cd_da_stream : 1; /* CD-DA streaming */
+ u_int rw : 1; /* combined R-W subchannels */
+ u_int rw_corr : 1; /* R-W subchannel data corrected */
+ u_int c2 : 1; /* C2 error pointers supported */
+ u_int isrc : 1; /* can return the ISRC info */
+ u_int upc : 1; /* can return the catalog number UPC */
+ u_int : 1;
+ u_int lock : 1; /* could be locked */
+ u_int locked : 1; /* current lock state */
+ u_int prevent : 1; /* prevent jumper installed */
+ u_int eject : 1; /* can eject */
+ u_int : 1;
+ u_int mech : 3; /* loading mechanism type */
+#define MECH_CADDY 0
+#define MECH_TRAY 1
+#define MECH_POPUP 2
+#define MECH_CHANGER 4
+#define MECH_CARTRIDGE 5
+ u_int sep_vol : 1; /* independent volume of channels */
+ u_int sep_mute : 1; /* independent mute of channels */
+ u_int : 6;
+
+ u_short max_speed; /* max raw data rate in bytes/1000 */
+ u_short max_vol_levels; /* number of discrete volume levels */
+ u_short buf_size; /* internal buffer size in bytes/1024 */
+ u_short cur_speed; /* current data rate in bytes/1000 */
+
+ /* Digital drive output format description (optional?) */
+ u_char reserved3;
+ u_int bckf : 1; /* data valid on failing edge of BCK */
+ u_int rch : 1; /* high LRCK indicates left channel */
+ u_int lsbf : 1; /* set if LSB first */
+ u_int dlen: 2;
+#define DLEN_32 0 /* 32 BCKs */
+#define DLEN_16 1 /* 16 BCKs */
+#define DLEN_24 2 /* 24 BCKs */
+#define DLEN_24_I2S 3 /* 24 BCKs (I2S) */
+ u_int : 3;
+ u_char reserved4[2];
+};
+
+/*
+ * CDROM changer mechanism status structure
+ */
+struct changer {
+ u_int current_slot : 5; /* active changer slot */
+ u_int mech_state : 2; /* current changer state */
+#define CH_READY 0
+#define CH_LOADING 1
+#define CH_UNLOADING 2
+#define CH_INITIALIZING 3
+ u_int fault : 1; /* fault in last operation */
+ u_int reserved0 : 5;
+ u_int cd_state : 3; /* current mechanism state */
+#define CD_IDLE 0
+#define CD_AUDIO_ACTIVE 1
+#define CD_AUDIO_SCAN 2
+#define CD_HOST_ACTIVE 3
+#define CD_NO_STATE 7
+ u_char current_lba[3]; /* current LBA */
+ u_char slots; /* number of available slots */
+ u_short table_length; /* slot table length */
+ struct {
+ u_int changed : 1; /* media has changed in this slot */
+ u_int unused : 6;
+ u_int present : 1; /* slot has a CD present */
+ u_char reserved0;
+ u_char reserved1;
+ u_char reserved2;
+ } slot[32];
+};
+
+struct wcd {
+ struct atapi *ata; /* Controller structure */
+ int unit; /* IDE bus drive unit */
+ int lun; /* Logical device unit */
+ int flags; /* Device state flags */
+ int refcnt; /* The number of raw opens */
+ struct buf_queue_head buf_queue;/* Queue of i/o requests */
+ struct atapi_params *param; /* Drive parameters table */
+ struct toc toc; /* Table of disc contents */
+ struct volinfo info; /* Volume size info */
+ struct audiopage au; /* Audio page info */
+ struct cappage cap; /* Capabilities page info */
+ struct audiopage aumask; /* Audio page mask */
+ struct subchan subchan; /* Subchannel info */
+ char description[80]; /* Device description */
+ struct changer *changer_info; /* changer info */
+ int slot; /* this lun's slot number */
+ struct devstat device_stats; /* devstat parameters */
+#ifdef DEVFS
+ void *ra_devfs_token;
+ void *rc_devfs_token;
+ void *a_devfs_token;
+ void *c_devfs_token;
+#endif
+};
+
+static struct wcd *wcdtab[NUNIT]; /* Drive info by unit number */
+static int wcdnlun = 0; /* Number of configured drives */
+
+static struct wcd *wcd_init_lun(struct atapi *ata, int unit,
+ struct atapi_params *ap, int lun);
+static void wcd_start (struct wcd *t);
+static void wcd_done (struct wcd *t, struct buf *bp, int resid,
+ struct atapires result);
+static void wcd_error (struct wcd *t, struct atapires result);
+static int wcd_read_toc (struct wcd *t);
+static int wcd_request_wait (struct wcd *t, u_char cmd, u_char a1, u_char a2,
+ u_char a3, u_char a4, u_char a5, u_char a6, u_char a7, u_char a8,
+ u_char a9, char *addr, int count);
+static void wcd_describe (struct wcd *t);
+static int wcd_setchan (struct wcd *t,
+ u_char c0, u_char c1, u_char c2, u_char c3);
+static int wcd_eject (struct wcd *t, int closeit);
+static void wcd_select_slot(struct wcd *cdp);
+
+/*
+ * Dump the array in hexadecimal format for debugging purposes.
+ */
+static void wcd_dump (int lun, char *label, void *data, int len)
+{
+ u_char *p = data;
+
+ printf ("wcd%d: %s %x", lun, label, *p++);
+ while (--len > 0)
+ printf ("-%x", *p++);
+ printf ("\n");
+}
+
+struct wcd *
+wcd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun)
+{
+ struct wcd *ptr;
+ ptr = malloc(sizeof(struct wcd), M_TEMP, M_NOWAIT);
+ if (!ptr)
+ return NULL;
+ bzero(ptr, sizeof(struct wcd));
+ bufq_init(&ptr->buf_queue);
+ ptr->ata = ata;
+ ptr->unit = unit;
+ ptr->lun = lun;
+ ptr->param = ap;
+ ptr->flags = F_MEDIA_CHANGED;
+ ptr->refcnt = 0;
+ ptr->slot = -1;
+ ptr->changer_info = NULL;
+#ifdef DEVFS
+ ptr->ra_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, 0),
+ DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
+ "rwcd%da", lun);
+ ptr->rc_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
+ "rwcd%dc", lun);
+ ptr->a_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, 0),
+ DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
+ "wcd%da", lun);
+ ptr->c_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
+ "wcd%dc", lun);
+#endif
+ /*
+ * Export the unit to the devstat interface.
+ */
+ devstat_add_entry(&ptr->device_stats, "wcd",
+ lun, SECSIZE,
+ DEVSTAT_NO_ORDERED_TAGS,
+ DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE);
+ return ptr;
+}
+
+#ifndef ATAPI_STATIC
+static
+#endif
+int
+wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
+{
+ struct wcd *cdp;
+ struct atapires result;
+ struct changer *chp;
+ int i;
+
+ if (wcdnlun >= NUNIT) {
+ printf ("wcd: too many units\n");
+ return (0);
+ }
+ if (!atapi_request_immediate) {
+ printf("wcd: configuration error, ATAPI core code not present!\n");
+ printf("wcd: check `options ATAPI_STATIC' in your kernel config file!\n");
+ return (0);
+ }
+ if ((cdp = wcd_init_lun(ata, unit, ap, wcdnlun)) == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ wcdtab[wcdnlun] = cdp;
+
+ if (debug) {
+ cdp->flags |= F_DEBUG;
+ /* Print params. */
+ wcd_dump (cdp->lun, "info", ap, sizeof *ap);
+ }
+
+ /* Get drive capabilities. */
+ result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
+ 0, CAP_PAGE, 0, 0, 0, 0, sizeof (cdp->cap) >> 8, sizeof (cdp->cap),
+ 0, 0, 0, 0, 0, 0, 0, (char*) &cdp->cap, sizeof (cdp->cap));
+
+ /* Do it twice to avoid the stale media changed state. */
+ if (result.code == RES_ERR &&
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION)
+ result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
+ 0, CAP_PAGE, 0, 0, 0, 0, sizeof (cdp->cap) >> 8,
+ sizeof (cdp->cap), 0, 0, 0, 0, 0, 0, 0,
+ (char*) &cdp->cap, sizeof (cdp->cap));
+
+ /* Some drives have shorter capabilities page. */
+ if (result.code == RES_UNDERRUN)
+ result.code = 0;
+
+ if (result.code == 0) {
+ wcd_describe (cdp);
+ if (cdp->flags & F_DEBUG)
+ wcd_dump (cdp->lun, "cap", &cdp->cap, sizeof(cdp->cap));
+ }
+
+ /* If this is a changer device, allocate the neeeded lun's */
+ if (cdp->cap.mech == MECH_CHANGER) {
+ chp = malloc(sizeof(struct changer), M_TEMP, M_NOWAIT);
+ if (chp == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ bzero(chp, sizeof(struct changer));
+ result = atapi_request_immediate(ata, unit, ATAPI_MECH_STATUS,
+ 0, 0, 0, 0, 0, 0, 0,
+ sizeof(struct changer)> 8, sizeof(struct changer),
+ 0, 0, 0, 0, 0, 0,
+ (char*) chp, sizeof(struct changer));
+ if (cdp->flags & F_DEBUG) {
+ printf("result.code=%d curr=%02x slots=%d len=%d\n",
+ result.code, chp->current_slot, chp->slots,
+ htons(chp->table_length));
+ }
+ if (result.code == RES_UNDERRUN)
+ result.code = 0;
+ if (result.code == 0) {
+ chp->table_length = htons(chp->table_length);
+ for (i=0; i<chp->slots && wcdnlun<NUNIT; i++) {
+ if (i>0) {
+ cdp = wcd_init_lun(ata,unit,ap,wcdnlun);
+ if (cdp == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ }
+ cdp->slot = i;
+ cdp->changer_info = chp;
+ printf("wcd%d: changer slot %d %s\n",
+ wcdnlun,
+ i, (chp->slot[i].present ?
+ "disk present" : "no disk"));
+ wcdtab[wcdnlun++] = cdp;
+ }
+ if (wcdnlun >= NUNIT) {
+ printf ("wcd: too many units\n");
+ return (0);
+ }
+ }
+ }
+ else
+ wcdnlun++;
+ return (1);
+}
+
+void wcd_describe (struct wcd *t)
+{
+ char *m;
+
+ t->cap.max_speed = ntohs (t->cap.max_speed);
+ t->cap.max_vol_levels = ntohs (t->cap.max_vol_levels);
+ t->cap.buf_size = ntohs (t->cap.buf_size);
+ t->cap.cur_speed = ntohs (t->cap.cur_speed);
+
+ printf ("wcd%d: ", t->lun);
+ if (t->cap.cur_speed != t->cap.max_speed)
+ printf ("%d/", t->cap.cur_speed * 1000 / 1024);
+ printf ("%dKb/sec", t->cap.max_speed * 1000 / 1024);
+ if (t->cap.buf_size)
+ printf (", %dKb cache", t->cap.buf_size);
+
+ if (t->cap.audio_play)
+ printf (", audio play");
+ if (t->cap.max_vol_levels)
+ printf (", %d volume levels", t->cap.max_vol_levels);
+
+ switch (t->cap.mech) {
+ default: m = 0; break;
+ case MECH_CADDY: m = "caddy"; break;
+ case MECH_TRAY: m = "tray"; break;
+ case MECH_POPUP: m = "popup"; break;
+ case MECH_CHANGER: m = "changer"; break;
+ case MECH_CARTRIDGE: m = "cartridge"; break;
+ }
+ if (m)
+ printf (", %s%s", t->cap.eject ? "ejectable " : "", m);
+ else if (t->cap.eject)
+ printf (", eject");
+ printf ("\n");
+
+ if (t->cap.mech != MECH_CHANGER) {
+ printf ("wcd%d: ", t->lun);
+ switch (t->cap.medium_type) {
+ case MDT_UNKNOWN:
+ printf ("medium type unknown"); break;
+ case MDT_DATA_120:
+ printf ("120mm data disc loaded"); break;
+ case MDT_AUDIO_120:
+ printf ("120mm audio disc loaded"); break;
+ case MDT_COMB_120:
+ printf ("120mm data/audio disc loaded"); break;
+ case MDT_PHOTO_120:
+ printf ("120mm photo disc loaded"); break;
+ case MDT_DATA_80:
+ printf ("80mm data disc loaded"); break;
+ case MDT_AUDIO_80:
+ printf ("80mm audio disc loaded"); break;
+ case MDT_COMB_80:
+ printf ("80mm data/audio disc loaded"); break;
+ case MDT_PHOTO_80:
+ printf ("80mm photo disc loaded"); break;
+ case MDT_NO_DISC:
+ printf ("no disc inside"); break;
+ case MDT_DOOR_OPEN:
+ printf ("door open"); break;
+ case MDT_FMT_ERROR:
+ printf ("medium format error"); break;
+ default:
+ printf ("medium type=0x%x", t->cap.medium_type); break;
+ }
+ }
+ if (t->cap.lock)
+ printf (t->cap.locked ? ", locked" : ", unlocked");
+ if (t->cap.prevent)
+ printf (", lock protected");
+ printf ("\n");
+}
+
+static int
+wcdopen (dev_t dev, int flags, int fmt, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t;
+
+ /* Check device number is legal and ATAPI driver is loaded. */
+ if (lun >= wcdnlun || ! atapi_request_immediate)
+ return (ENXIO);
+ t = wcdtab[lun];
+ /* On the first open, read the table of contents. */
+ if (! (t->flags & F_BOPEN) && ! t->refcnt) {
+ /* Read table of contents. */
+ if (wcd_read_toc (t) < 0)
+ return (EIO);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ }
+ if (fmt == S_IFCHR)
+ ++t->refcnt;
+ else
+ t->flags |= F_BOPEN;
+ return (0);
+}
+
+/*
+ * Close the device. Only called if we are the LAST
+ * occurence of an open device.
+ */
+static int
+wcdclose (dev_t dev, int flags, int fmt, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t = wcdtab[lun];
+
+ if (fmt == S_IFBLK) {
+ /* If we were the last open of the entire device, release it. */
+ if (! t->refcnt)
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~(F_BOPEN|F_LOCKED);
+ } else {
+ /* If we were the last open of the entire device, release it. */
+ if (! (t->flags & F_BOPEN) && t->refcnt == 1)
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~F_LOCKED;
+ --t->refcnt;
+ }
+ return (0);
+}
+
+static int
+wcdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(wcdstrategy, NULL, dev, 1, minphys, uio));
+}
+
+/*
+ * Actually translate the requested transfer into one the physical driver can
+ * understand. The transfer is described by a buf and will include only one
+ * physical transfer.
+ */
+void wcdstrategy (struct buf *bp)
+{
+ int lun = dkunit(bp->b_dev);
+ struct wcd *t = wcdtab[lun];
+ int x;
+
+ /* Can't ever write to a CD. */
+ if (! (bp->b_flags & B_READ)) {
+ bp->b_error = EROFS;
+ bp->b_flags |= B_ERROR;
+ biodone (bp);
+ return;
+ }
+
+ /* If it's a null transfer, return immediatly. */
+ if (bp->b_bcount == 0) {
+ bp->b_resid = 0;
+ biodone (bp);
+ return;
+ }
+
+ /* Process transfer request. */
+ bp->b_pblkno = bp->b_blkno;
+ bp->b_resid = bp->b_bcount;
+ x = splbio();
+
+ /* Place it in the queue of disk activities for this disk. */
+ bufqdisksort (&t->buf_queue, bp);
+
+ /* Tell the device to get going on the transfer if it's
+ * not doing anything, otherwise just wait for completion. */
+ wcd_start (t);
+ splx(x);
+}
+
+/*
+ * Look to see if there is a buf waiting for the device
+ * and that the device is not already busy. If both are true,
+ * It dequeues the buf and creates an ATAPI command to perform the
+ * transfer in the buf.
+ * The bufs are queued by the strategy routine (wcdstrategy).
+ * Must be called at the correct (splbio) level.
+ */
+static void wcd_start (struct wcd *t)
+{
+ struct buf *bp = bufq_first(&t->buf_queue);
+ u_long blkno, nblk;
+
+ /* See if there is a buf to do and we are not already doing one. */
+ if (! bp)
+ return;
+
+ /* Unqueue the request. */
+ bufq_remove(&t->buf_queue, bp);
+
+ /* Should reject all queued entries if media have changed. */
+ if (t->flags & F_MEDIA_CHANGED) {
+ bp->b_error = EIO;
+ bp->b_flags |= B_ERROR;
+ biodone (bp);
+ return;
+ }
+
+ /* Tell devstat we are starting on the transaction */
+ devstat_start_transaction(&t->device_stats);
+
+ wcd_select_slot(t);
+
+ /* We have a buf, now we should make a command
+ * First, translate the block to absolute and put it in terms of the
+ * logical blocksize of the device.
+ * What if something asks for 512 bytes not on a 2k boundary? */
+ blkno = bp->b_blkno / (SECSIZE / 512);
+ nblk = (bp->b_bcount + (SECSIZE - 1)) / SECSIZE;
+
+ atapi_request_callback (t->ata, t->unit, ATAPI_READ_BIG, 0,
+ blkno>>24, blkno>>16, blkno>>8, blkno, 0, nblk>>8, nblk, 0, 0,
+ 0, 0, 0, 0, 0, (u_char*) bp->b_data, bp->b_bcount,
+ wcd_done, t, bp);
+}
+
+static void wcd_done (struct wcd *t, struct buf *bp, int resid,
+ struct atapires result)
+{
+ if (result.code) {
+ wcd_error (t, result);
+ bp->b_error = EIO;
+ bp->b_flags |= B_ERROR;
+ } else
+ bp->b_resid = resid;
+
+ /* Tell devstat we have finished with the transaction */
+ devstat_end_transaction(&t->device_stats,
+ bp->b_bcount - bp->b_resid,
+ DEVSTAT_TAG_NONE,
+ (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
+ biodone (bp);
+ wcd_start (t);
+}
+
+static void wcd_error (struct wcd *t, struct atapires result)
+{
+ if (result.code != RES_ERR)
+ return;
+ switch (result.error & AER_SKEY) {
+ case AER_SK_NOT_READY:
+ if (result.error & ~AER_SKEY) {
+ /* Audio disc. */
+ printf ("wcd%d: cannot read audio disc\n", t->lun);
+ return;
+ }
+ /* Tray open. */
+ if (! (t->flags & F_MEDIA_CHANGED))
+ printf ("wcd%d: tray open\n", t->lun);
+ t->flags |= F_MEDIA_CHANGED;
+ return;
+
+ case AER_SK_UNIT_ATTENTION:
+ /* Media changed. */
+ if (! (t->flags & F_MEDIA_CHANGED))
+ printf ("wcd%d: media changed\n", t->lun);
+ t->flags |= F_MEDIA_CHANGED;
+ return;
+
+ case AER_SK_ILLEGAL_REQUEST:
+ /* Unknown command or invalid command arguments. */
+ if (t->flags & F_DEBUG)
+ printf ("wcd%d: invalid command\n", t->lun);
+ return;
+ }
+ printf ("wcd%d: i/o error, status=%b, error=%b\n", t->lun,
+ result.status, ARS_BITS, result.error, AER_BITS);
+}
+
+static int wcd_request_wait (struct wcd *t, u_char cmd, u_char a1, u_char a2,
+ u_char a3, u_char a4, u_char a5, u_char a6, u_char a7, u_char a8,
+ u_char a9, char *addr, int count)
+{
+ struct atapires result;
+
+ result = atapi_request_wait (t->ata, t->unit, cmd,
+ a1, a2, a3, a4, a5, a6, a7, a8, a9, 0, 0, 0, 0, 0, 0,
+ addr, count);
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+ return (0);
+}
+
+static __inline void lba2msf (int lba, u_char *m, u_char *s, u_char *f)
+{
+ lba += 150; /* offset of first logical frame */
+ lba &= 0xffffff; /* negative lbas use only 24 bits */
+ *m = lba / (60 * 75);
+ lba %= (60 * 75);
+ *s = lba / 75;
+ *f = lba % 75;
+}
+
+/*
+ * Perform special action on behalf of the user.
+ * Knows about the internals of this device
+ */
+int wcdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t = wcdtab[lun];
+ int error = 0;
+
+ if (t->flags & F_MEDIA_CHANGED)
+ switch (cmd) {
+ case CDIOCSETDEBUG:
+ case CDIOCCLRDEBUG:
+ case CDIOCRESET:
+ /* These ops are media change transparent. */
+ break;
+ default:
+ /* Read table of contents. */
+ wcd_read_toc (t);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ break;
+ }
+ switch (cmd) {
+ default:
+ return (ENOTTY);
+
+ case CDIOCSETDEBUG:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ t->flags |= F_DEBUG;
+ atapi_debug (t->ata, 1);
+ return 0;
+
+ case CDIOCCLRDEBUG:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ t->flags &= ~F_DEBUG;
+ atapi_debug (t->ata, 0);
+ return 0;
+
+ case CDIOCRESUME:
+ return wcd_request_wait (t, ATAPI_PAUSE,
+ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);
+
+ case CDIOCPAUSE:
+ return wcd_request_wait (t, ATAPI_PAUSE,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCSTART:
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCSTOP:
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCALLOW:
+ wcd_select_slot(t);
+ t->flags &= ~F_LOCKED;
+ return wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCPREVENT:
+ wcd_select_slot(t);
+ t->flags |= F_LOCKED;
+ return wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCRESET:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ return wcd_request_wait (t, ATAPI_TEST_UNIT_READY,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCEJECT:
+ /* Don't allow eject if the device is opened
+ * by somebody (not us) in block mode. */
+ if ((t->flags & F_BOPEN) && t->refcnt)
+ return (EBUSY);
+ return wcd_eject (t, 0);
+
+ case CDIOCCLOSE:
+ if ((t->flags & F_BOPEN) && t->refcnt)
+ return (0);
+ return wcd_eject (t, 1);
+
+ case CDIOREADTOCHEADER:
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+ bcopy (&t->toc.hdr, addr, sizeof t->toc.hdr);
+ break;
+
+ case CDIOREADTOCENTRYS: {
+ struct ioc_read_toc_entry *te =
+ (struct ioc_read_toc_entry*) addr;
+ struct toc *toc = &t->toc;
+ struct toc buf;
+ u_long len;
+ u_char starting_track = te->starting_track;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ if ( te->data_len < sizeof(toc->tab[0])
+ || (te->data_len % sizeof(toc->tab[0])) != 0
+ || te->address_format != CD_MSF_FORMAT
+ && te->address_format != CD_LBA_FORMAT
+ )
+ return EINVAL;
+
+ if (starting_track == 0)
+ starting_track = toc->hdr.starting_track;
+ else if (starting_track == 170) /* Handle leadout request */
+ starting_track = toc->hdr.ending_track + 1;
+ else if (starting_track < toc->hdr.starting_track ||
+ starting_track > toc->hdr.ending_track + 1)
+ return (EINVAL);
+
+ len = ((toc->hdr.ending_track + 1 - starting_track) + 1) *
+ sizeof(toc->tab[0]);
+ if (te->data_len < len)
+ len = te->data_len;
+ if (len > sizeof(toc->tab))
+ return EINVAL;
+
+ /* Convert to MSF format, if needed. */
+ if (te->address_format == CD_MSF_FORMAT) {
+ struct cd_toc_entry *e;
+
+ buf = t->toc;
+ toc = &buf;
+ e = toc->tab + (toc->hdr.ending_track + 1 -
+ toc->hdr.starting_track) + 1;
+ while (--e >= toc->tab)
+ lba2msf (ntohl(e->addr.lba), &e->addr.msf.minute,
+ &e->addr.msf.second, &e->addr.msf.frame);
+ }
+ return copyout (toc->tab + starting_track -
+ toc->hdr.starting_track, te->data, len);
+ }
+ case CDIOREADTOCENTRY: {
+ struct ioc_read_toc_single_entry *te =
+ (struct ioc_read_toc_single_entry*) addr;
+ struct toc *toc = &t->toc;
+ struct toc buf;
+ u_char track = te->track;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ if (te->address_format != CD_MSF_FORMAT
+ && te->address_format != CD_LBA_FORMAT)
+ return EINVAL;
+
+ if (track == 0)
+ track = toc->hdr.starting_track;
+ else if (track == 170) /* Handle leadout request */
+ track = toc->hdr.ending_track + 1;
+ else if (track < toc->hdr.starting_track ||
+ track > toc->hdr.ending_track + 1)
+ return (EINVAL);
+
+ /* Convert to MSF format, if needed. */
+ if (te->address_format == CD_MSF_FORMAT) {
+ struct cd_toc_entry *e;
+
+ buf = t->toc;
+ toc = &buf;
+ e = toc->tab + (track - toc->hdr.starting_track);
+ lba2msf (ntohl(e->addr.lba), &e->addr.msf.minute,
+ &e->addr.msf.second, &e->addr.msf.frame);
+ }
+ bcopy(toc->tab + track - toc->hdr.starting_track,
+ &te->entry, sizeof(struct cd_toc_entry));
+ }
+ case CDIOCREADSUBCHANNEL: {
+ struct ioc_read_subchannel *args =
+ (struct ioc_read_subchannel*) addr;
+ struct cd_sub_channel_info data;
+ u_long len = args->data_len;
+ int abslba, rellba;
+
+ if (len > sizeof(data) ||
+ len < sizeof(struct cd_sub_channel_header))
+ return (EINVAL);
+
+ if (wcd_request_wait (t, ATAPI_READ_SUBCHANNEL, 0, 0x40, 1, 0,
+ 0, 0, sizeof (t->subchan) >> 8, sizeof (t->subchan),
+ 0, (char*)&t->subchan, sizeof (t->subchan)) != 0)
+ return (EIO);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "subchan", &t->subchan, sizeof t->subchan);
+
+ abslba = t->subchan.abslba;
+ rellba = t->subchan.rellba;
+ if (args->address_format == CD_MSF_FORMAT) {
+ lba2msf (ntohl(abslba),
+ &data.what.position.absaddr.msf.minute,
+ &data.what.position.absaddr.msf.second,
+ &data.what.position.absaddr.msf.frame);
+ lba2msf (ntohl(rellba),
+ &data.what.position.reladdr.msf.minute,
+ &data.what.position.reladdr.msf.second,
+ &data.what.position.reladdr.msf.frame);
+ } else {
+ data.what.position.absaddr.lba = abslba;
+ data.what.position.reladdr.lba = rellba;
+ }
+ data.header.audio_status = t->subchan.audio_status;
+ data.what.position.control = t->subchan.control & 0xf;
+ data.what.position.addr_type = t->subchan.control >> 4;
+ data.what.position.track_number = t->subchan.track;
+ data.what.position.index_number = t->subchan.indx;
+
+ return copyout (&data, args->data, len);
+ }
+ case CDIOCPLAYMSF: {
+ struct ioc_play_msf *args = (struct ioc_play_msf*) addr;
+
+ return wcd_request_wait (t, ATAPI_PLAY_MSF, 0, 0,
+ args->start_m, args->start_s, args->start_f,
+ args->end_m, args->end_s, args->end_f, 0, 0, 0);
+ }
+ case CDIOCPLAYBLOCKS: {
+ struct ioc_play_blocks *args = (struct ioc_play_blocks*) addr;
+
+ return wcd_request_wait (t, ATAPI_PLAY_BIG, 0,
+ args->blk >> 24 & 0xff, args->blk >> 16 & 0xff,
+ args->blk >> 8 & 0xff, args->blk & 0xff,
+ args->len >> 24 & 0xff, args->len >> 16 & 0xff,
+ args->len >> 8 & 0xff, args->len & 0xff, 0, 0);
+ }
+ case CDIOCPLAYTRACKS: {
+ struct ioc_play_track *args = (struct ioc_play_track*) addr;
+ u_long start, len;
+ int t1, t2;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ /* Ignore index fields,
+ * play from start_track to end_track inclusive. */
+ if (args->end_track < t->toc.hdr.ending_track+1)
+ ++args->end_track;
+ if (args->end_track > t->toc.hdr.ending_track+1)
+ args->end_track = t->toc.hdr.ending_track+1;
+ t1 = args->start_track - t->toc.hdr.starting_track;
+ t2 = args->end_track - t->toc.hdr.starting_track;
+ if (t1 < 0 || t2 < 0)
+ return (EINVAL);
+ start = ntohl(t->toc.tab[t1].addr.lba);
+ len = ntohl(t->toc.tab[t2].addr.lba) - start;
+
+ return wcd_request_wait (t, ATAPI_PLAY_BIG, 0,
+ start >> 24 & 0xff, start >> 16 & 0xff,
+ start >> 8 & 0xff, start & 0xff,
+ len >> 24 & 0xff, len >> 16 & 0xff,
+ len >> 8 & 0xff, len & 0xff, 0, 0);
+ }
+ case CDIOCGETVOL: {
+ struct ioc_vol *arg = (struct ioc_vol*) addr;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+ arg->vol[0] = t->au.port[0].volume;
+ arg->vol[1] = t->au.port[1].volume;
+ arg->vol[2] = t->au.port[2].volume;
+ arg->vol[3] = t->au.port[3].volume;
+ break;
+ }
+ case CDIOCSETVOL: {
+ struct ioc_vol *arg = (struct ioc_vol*) addr;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0,
+ AUDIO_PAGE_MASK, 0, 0, 0, 0, sizeof (t->aumask) >> 8,
+ sizeof (t->aumask), 0, (char*) &t->aumask,
+ sizeof (t->aumask));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "mask", &t->aumask, sizeof t->aumask);
+
+ /* Sony-55E requires the data length field to be zeroed. */
+ t->au.data_length = 0;
+
+ t->au.port[0].channels = CHANNEL_0;
+ t->au.port[1].channels = CHANNEL_1;
+ t->au.port[0].volume = arg->vol[0] & t->aumask.port[0].volume;
+ t->au.port[1].volume = arg->vol[1] & t->aumask.port[1].volume;
+ t->au.port[2].volume = arg->vol[2] & t->aumask.port[2].volume;
+ t->au.port[3].volume = arg->vol[3] & t->aumask.port[3].volume;
+ return wcd_request_wait (t, ATAPI_MODE_SELECT, 0x10,
+ 0, 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au),
+ 0, (char*) &t->au, - sizeof (t->au));
+ }
+ case CDIOCSETPATCH: {
+ struct ioc_patch *arg = (struct ioc_patch*) addr;
+
+ return wcd_setchan (t, arg->patch[0], arg->patch[1],
+ arg->patch[2], arg->patch[3]);
+ }
+ case CDIOCSETMONO:
+ return wcd_setchan (t, CHANNEL_0 | CHANNEL_1,
+ CHANNEL_0 | CHANNEL_1, 0, 0);
+
+ case CDIOCSETSTERIO:
+ return wcd_setchan (t, CHANNEL_0, CHANNEL_1, 0, 0);
+
+ case CDIOCSETMUTE:
+ return wcd_setchan (t, 0, 0, 0, 0);
+
+ case CDIOCSETLEFT:
+ return wcd_setchan (t, CHANNEL_0, CHANNEL_0, 0, 0);
+
+ case CDIOCSETRIGHT:
+ return wcd_setchan (t, CHANNEL_1, CHANNEL_1, 0, 0);
+ }
+ return (error);
+}
+
+/*
+ * Read the entire TOC for the disc into our internal buffer.
+ */
+static int wcd_read_toc (struct wcd *t)
+{
+ int ntracks, len;
+ struct atapires result;
+
+ bzero (&t->toc, sizeof (t->toc));
+ bzero (&t->info, sizeof (t->info));
+
+ wcd_select_slot(t);
+
+ /* Check for the media.
+ * Do it twice to avoid the stale media changed state. */
+ result = atapi_request_wait (t->ata, t->unit, ATAPI_TEST_UNIT_READY,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ if (result.code == RES_ERR &&
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION) {
+ t->flags |= F_MEDIA_CHANGED;
+ result = atapi_request_wait (t->ata, t->unit,
+ ATAPI_TEST_UNIT_READY, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ }
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+ t->flags &= ~F_MEDIA_CHANGED;
+
+ /* First read just the header, so we know how long the TOC is. */
+ len = sizeof(struct ioc_toc_header) + sizeof(struct cd_toc_entry);
+ if (wcd_request_wait (t, ATAPI_READ_TOC, 0, 0, 0, 0, 0, 0,
+ len >> 8, len & 0xff, 0, (char*)&t->toc, len) != 0) {
+err: bzero (&t->toc, sizeof (t->toc));
+ return (0);
+ }
+
+ ntracks = t->toc.hdr.ending_track - t->toc.hdr.starting_track + 1;
+ if (ntracks <= 0 || ntracks > MAXTRK)
+ goto err;
+
+ /* Now read the whole schmeer. */
+ len = sizeof(struct ioc_toc_header) +
+ ntracks * sizeof(struct cd_toc_entry);
+ if (wcd_request_wait (t, ATAPI_READ_TOC, 0, 0, 0, 0, 0, 0,
+ len >> 8, len & 0xff, 0, (char*)&t->toc, len) & 0xff)
+ goto err;
+
+ NTOHS(t->toc.hdr.len);
+
+ /* Read disc capacity. */
+ if (wcd_request_wait (t, ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0,
+ 0, sizeof(t->info), 0, (char*)&t->info, sizeof(t->info)) != 0)
+ bzero (&t->info, sizeof (t->info));
+
+ /* make fake leadout entry */
+ t->toc.tab[ntracks].control = t->toc.tab[ntracks-1].control;
+ t->toc.tab[ntracks].addr_type = t->toc.tab[ntracks-1].addr_type;
+ t->toc.tab[ntracks].track = 170; /* magic */
+ t->toc.tab[ntracks].addr.lba = t->info.volsize;
+
+ NTOHL(t->info.volsize);
+ NTOHL(t->info.blksize);
+
+ /* Print the disc description string on every disc change.
+ * It would help to track the history of disc changes. */
+ if (t->info.volsize && t->toc.hdr.ending_track &&
+ (t->flags & F_MEDIA_CHANGED) && (t->flags & F_DEBUG)) {
+ printf ("wcd%d: ", t->lun);
+ if (t->toc.tab[0].control & 4)
+ printf ("%ldMB ", t->info.volsize / 512);
+ else
+ printf ("%ld:%ld audio ", t->info.volsize/75/60,
+ t->info.volsize/75%60);
+ printf ("(%ld sectors), %d tracks\n", t->info.volsize,
+ t->toc.hdr.ending_track - t->toc.hdr.starting_track + 1);
+ }
+ return (0);
+}
+
+/*
+ * Set up the audio channel masks.
+ */
+static int wcd_setchan (struct wcd *t,
+ u_char c0, u_char c1, u_char c2, u_char c3)
+{
+ int error;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+
+ /* Sony-55E requires the data length field to be zeroed. */
+ t->au.data_length = 0;
+
+ t->au.port[0].channels = c0;
+ t->au.port[1].channels = c1;
+ t->au.port[2].channels = c2;
+ t->au.port[3].channels = c3;
+ return wcd_request_wait (t, ATAPI_MODE_SELECT, 0x10,
+ 0, 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au),
+ 0, (char*) &t->au, - sizeof (t->au));
+}
+
+static int wcd_eject (struct wcd *t, int closeit)
+{
+ struct atapires result;
+
+ wcd_select_slot(t);
+
+ /* Try to stop the disc. */
+ result = atapi_request_wait (t->ata, t->unit, ATAPI_START_STOP,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ if (result.code == RES_ERR &&
+ ((result.error & AER_SKEY) == AER_SK_NOT_READY ||
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION)) {
+ int err;
+
+ if (!closeit)
+ return (0);
+ /*
+ * The disc was unloaded.
+ * Load it (close tray).
+ * Read the table of contents.
+ */
+ err = wcd_request_wait (t, ATAPI_START_STOP,
+ 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
+ if (err)
+ return (err);
+
+ /* Read table of contents. */
+ wcd_read_toc (t);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ return (0);
+ }
+
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+
+ if (closeit)
+ return (0);
+
+ /* Give it some time to stop spinning. */
+ tsleep ((caddr_t)&lbolt, PRIBIO, "wcdej1", 0);
+ tsleep ((caddr_t)&lbolt, PRIBIO, "wcdej2", 0);
+
+ /* Unlock. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~F_LOCKED;
+
+ /* Eject. */
+ t->flags |= F_MEDIA_CHANGED;
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0);
+}
+
+static void
+wcd_select_slot(struct wcd *cdp)
+{
+ if (cdp->slot < 0 || cdp->changer_info->current_slot == cdp->slot)
+ return;
+
+ /* Unlock (might not be needed but its cheaper than asking) */
+ wcd_request_wait (cdp, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ /* Unload the current media from player */
+ wcd_request_wait (cdp, ATAPI_LOAD_UNLOAD,
+ 0, 0, 0, 2, 0, 0, 0, cdp->changer_info->current_slot, 0, 0, 0);
+
+ /* load the wanted slot */
+ wcd_request_wait (cdp, ATAPI_LOAD_UNLOAD,
+ 0, 0, 0, 3, 0, 0, 0, cdp->slot, 0, 0, 0);
+
+ cdp->changer_info->current_slot = cdp->slot;
+
+ /* Lock the media if needed */
+ if (cdp->flags & F_LOCKED) {
+ wcd_request_wait (cdp, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ }
+}
+
+#ifdef WCD_MODULE
+/*
+ * Loadable ATAPI CD-ROM driver stubs.
+ */
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+/*
+ * Construct lkm_dev structures (see lkm.h).
+ * Our bdevsw/cdevsw slot numbers are 19/69.
+ */
+
+
+MOD_DEV(wcd, LM_DT_BLOCK, BDEV_MAJOR, &wcd_cdevsw);
+MOD_DEV(rwcd, LM_DT_CHAR, CDEV_MAJOR, &wcd_cdevsw);
+
+/*
+ * Function called when loading the driver.
+ */
+int wcd_load (struct lkm_table *lkmtp, int cmd)
+{
+ struct atapi *ata;
+ int n, u;
+
+ if (! atapi_start)
+ /* No ATAPI driver available. */
+ return EPROTONOSUPPORT;
+ n = 0;
+ for (ata=atapi_tab; ata<atapi_tab+2; ++ata)
+ if (ata->port)
+ for (u=0; u<2; ++u)
+ /* Probing controller ata->ctrlr, unit u. */
+ if (ata->params[u] && ! ata->attached[u] &&
+ wcdattach (ata, u, ata->params[u],
+ ata->debug) >= 0)
+ {
+ /* Drive found. */
+ ata->attached[u] = 1;
+ ++n;
+ }
+ if (! n)
+ /* No IDE CD-ROMs found. */
+ return ENXIO;
+ return 0;
+}
+
+/*
+ * Function called when unloading the driver.
+ */
+int wcd_unload (struct lkm_table *lkmtp, int cmd)
+{
+ struct wcd **t;
+
+ for (t=wcdtab; t<wcdtab+wcdnlun; ++t)
+ if (((*t)->flags & F_BOPEN) || (*t)->refcnt)
+ /* The device is opened, cannot unload the driver. */
+ return EBUSY;
+ for (t=wcdtab; t<wcdtab+wcdnlun; ++t) {
+ (*t)->ata->attached[(*t)->unit] = 0;
+ free (*t, M_TEMP);
+ }
+ wcdnlun = 0;
+ bzero (wcdtab, sizeof(wcdtab));
+ return 0;
+}
+
+/*
+ * Dispatcher function for the module (load/unload/stat).
+ */
+int wcd_mod (struct lkm_table *lkmtp, int cmd, int ver)
+{
+ int err = 0;
+
+ if (ver != LKM_VERSION)
+ return EINVAL;
+
+ if (cmd == LKM_E_LOAD)
+ err = wcd_load (lkmtp, cmd);
+ else if (cmd == LKM_E_UNLOAD)
+ err = wcd_unload (lkmtp, cmd);
+ if (err)
+ return err;
+
+ /* XXX Poking around in the LKM internals like this is bad.
+ */
+ /* Register the cdevsw entry. */
+ lkmtp->private.lkm_dev = & MOD_PRIVATE(rwcd);
+ err = lkmdispatch (lkmtp, cmd);
+ if (err)
+ return err;
+
+ /* Register the bdevsw entry. */
+ lkmtp->private.lkm_dev = & MOD_PRIVATE(wcd);
+ return lkmdispatch (lkmtp, cmd);
+}
+#endif /* WCD_MODULE */
+
+static wcd_devsw_installed = 0;
+
+static void wcd_drvinit(void *unused)
+{
+
+ if( ! wcd_devsw_installed ) {
+ cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &wcd_cdevsw);
+ wcd_devsw_installed = 1;
+ }
+}
+
+SYSINIT(wcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wcd_drvinit,NULL)
+
+
+#endif /* NWCD && NWDC && ATAPI */
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 488615575464..6a5f73023a17 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.185 1999/01/16 01:06:23 bde Exp $
+ * $Id: wd.c,v 1.176 1998/09/15 08:15:30 gibbs Exp $
*/
/* TODO:
@@ -67,8 +67,8 @@
#include "opt_atapi.h"
#include "opt_devfs.h"
#include "opt_hw_wdog.h"
-#include "opt_ide_delay.h"
#include "opt_wd.h"
+#include "pci.h"
#include <sys/param.h>
#include <sys/dkbad.h>
@@ -106,11 +106,7 @@
extern void wdstart(int ctrlr);
-#ifdef IDE_DELAY
-#define TIMEOUT IDE_DELAY
-#else
#define TIMEOUT 10000
-#endif
#define RETRIES 5 /* number of retries before giving up */
#define RECOVERYTIME 500000 /* usec for controller to recover after err */
#define MAXTRANSFER 255 /* max size of transfer in sectors */
@@ -311,16 +307,19 @@ wdprobe(struct isa_device *dvp)
du->dk_ctrlr = dvp->id_unit;
interface = du->dk_ctrlr / 2;
du->dk_interface = interface;
- du->dk_port = dvp->id_iobase;
- if (wddma[interface].wdd_candma != NULL) {
- du->dk_dmacookie =
- wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr,
- du->dk_unit);
- du->dk_altport =
- wddma[interface].wdd_altiobase(du->dk_dmacookie);
- }
- if (du->dk_altport == 0)
+#if !defined(DISABLE_PCI_IDE) && (NPCI > 0)
+ if (wddma[interface].wdd_candma) {
+ du->dk_dmacookie = wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr);
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = wddma[interface].wdd_altiobase(du->dk_dmacookie);
+ } else {
+ du->dk_port = dvp->id_iobase;
du->dk_altport = du->dk_port + wd_ctlr;
+ }
+#else
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = du->dk_port + wd_ctlr;
+#endif
/* check if we have registers that work */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -423,8 +422,6 @@ wdattach(struct isa_device *dvp)
struct disk *du;
struct wdparams *wp;
- dvp->id_intr = wdintr;
-
if (dvp->id_unit >= NWDC)
return (0);
@@ -665,17 +662,17 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
+ bufqdisksort(&drive_queue[lunit], bp);
+
+ if (wdutab[lunit].b_active == 0)
+ wdustart(du); /* start drive */
+
/* Pick up changes made by readdisklabel(). */
if (du->dk_flags & DKFL_LABELLING && du->dk_state > RECAL) {
wdsleep(du->dk_ctrlr, "wdlab");
du->dk_state = WANTOPEN;
}
- bufqdisksort(&drive_queue[lunit], bp);
-
- if (wdutab[lunit].b_active == 0)
- wdustart(du); /* start drive */
-
#ifdef CMD640
if (wdtab[du->dk_ctrlr_cmd640].b_active == 0)
#else
@@ -1033,12 +1030,11 @@ wdstart(int ctrlr)
*/
void
-wdintr(void *unitnum)
+wdintr(int unit)
{
register struct disk *du;
register struct buf *bp;
int dmastat = 0; /* Shut up GCC */
- int unit = (int)unitnum;
#ifdef CMD640
int ctrlr_atapi;
@@ -1087,7 +1083,8 @@ wdintr(void *unitnum)
if (du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) {
/* XXX SMP boxes sometimes generate an early intr. Why? */
if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & WDDS_INTERRUPT)
- != 0)
+ == 0)
+ return;
dmastat = wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
}
@@ -1879,8 +1876,7 @@ failed:
* check drive's DMA capability
*/
if (wddma[du->dk_interface].wdd_candma) {
- du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(
- du->dk_port, du->dk_ctrlr, du->dk_unit);
+ du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(du->dk_port, du->dk_ctrlr);
/* does user want this? */
if ((du->cfg_flags & WDOPT_DMA) &&
/* have we got a DMA controller? */
@@ -2253,11 +2249,11 @@ static void
wderror(struct buf *bp, struct disk *du, char *mesg)
{
if (bp == NULL)
- printf("wd%d: %s", du->dk_lunit, mesg);
+ printf("wd%d: %s:\n", du->dk_lunit, mesg);
else
diskerr(bp, "wd", mesg, LOG_PRINTF, du->dk_skip,
dsgetlabel(bp->b_dev, du->dk_slices));
- printf(" (status %b error %b)\n",
+ printf("wd%d: status %b error %b\n", du->dk_lunit,
du->dk_status, WDCS_BITS, du->dk_error, WDERR_BITS);
}
diff --git a/sys/i386/isa/wd7000.c b/sys/i386/isa/wd7000.c
new file mode 100644
index 000000000000..5722aeeed1cf
--- /dev/null
+++ b/sys/i386/isa/wd7000.c
@@ -0,0 +1,725 @@
+/*
+ * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
+ * All rights reserved.
+ *
+ * Written by Olof Johansson (offe@ludd.luth.se) 1995.
+ * Based on code written by Theo de Raadt (deraadt@fsa.ca).
+ *
+ * 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 at Ludd, University of Lule}.
+ * 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.
+ */
+
+ /* All bugs are subject to removal without further notice */
+
+/*
+ * offe 01/07/95
+ *
+ * This version of the driver _still_ doesn't implement scatter/gather for the
+ * WD7000-FASST2. This is due to the fact that my controller doesn't seem to
+ * support it. That, and the lack of documentation makes it impossible for
+ * me to implement it.
+ * What I've done instead is allocated a local buffer, contiguous buffer big
+ * enough to handle the requests. I haven't seen any read/write bigger than 64k,
+ * so I allocate a buffer of 64+16k. The data that needs to be DMA'd to/from
+ * the controller is copied to/from that buffer before/after the command is
+ * sent to the card.
+ */
+
+#include "wds.h"
+#if NWDS > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/buf.h>
+
+#include <scsi/scsiconf.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+
+static struct scsi_device wds_dev =
+{
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "wds",
+ 0,
+ { 0, 0 }
+};
+
+/*
+ XXX THIS SHOULD BE FIXED!
+ I haven't got the KERNBASE-version to work, but on my system the kernel
+ is at virtual address 0xFxxxxxxx, responding to physical address
+ 0x0xxxxxxx.
+#define PHYSTOKV(x) ((x) + KERNBASE)
+*/
+#define PHYSTOKV(x) ((x) | 0xf0000000)
+#define KVTOPHYS(x) vtophys(x)
+/* 0x10000 (64k) should be enough. But just to be sure... */
+#define BUFSIZ 0x12000
+
+
+/* WD7000 registers */
+#define WDS_STAT 0 /* read */
+#define WDS_IRQSTAT 1 /* read */
+
+#define WDS_CMD 0 /* write */
+#define WDS_IRQACK 1 /* write */
+#define WDS_HCR 2 /* write */
+
+/* WDS_STAT (read) defs */
+#define WDS_IRQ 0x80
+#define WDS_RDY 0x40
+#define WDS_REJ 0x20
+#define WDS_INIT 0x10
+
+/* WDS_IRQSTAT (read) defs */
+#define WDSI_MASK 0xc0
+#define WDSI_ERR 0x00
+#define WDSI_MFREE 0x80
+#define WDSI_MSVC 0xc0
+
+/* WDS_CMD (write) defs */
+#define WDSC_NOOP 0x00
+#define WDSC_INIT 0x01
+#define WDSC_DISUNSOL 0x02
+#define WDSC_ENAUNSOL 0x03
+#define WDSC_IRQMFREE 0x04
+#define WDSC_SCSIRESETSOFT 0x05
+#define WDSC_SCSIRESETHARD 0x06
+#define WDSC_MSTART(m) (0x80 + (m))
+#define WDSC_MMSTART(m) (0xc0 + (m))
+
+/* WDS_HCR (write) defs */
+#define WDSH_IRQEN 0x08
+#define WDSH_DRQEN 0x04
+#define WDSH_SCSIRESET 0x02
+#define WDSH_ASCRESET 0x01
+
+struct wds_cmd {
+ u_char cmd;
+ u_char targ;
+ u_char scb[12]; /*u_char scb[12];*/
+ u_char stat;
+ u_char venderr;
+ u_char len[3];
+ u_char data[3];
+ u_char next[3];
+ u_char write;
+ u_char xx[6];
+};
+
+struct wds_req {
+ struct wds_cmd cmd;
+ struct wds_cmd sense;
+ struct scsi_xfer *sxp;
+ int busy, polled;
+ int done, ret, ombn;
+};
+
+#define WDSX_SCSICMD 0x00
+#define WDSX_OPEN_RCVBUF 0x80
+#define WDSX_RCV_CMD 0x81
+#define WDSX_RCV_DATA 0x82
+#define WDSX_RCV_DATASTAT 0x83
+#define WDSX_SND_DATA 0x84
+#define WDSX_SND_DATASTAT 0x85
+#define WDSX_SND_CMDSTAT 0x86
+#define WDSX_READINIT 0x88
+#define WDSX_READSCSIID 0x89
+#define WDSX_SETUNSOLIRQMASK 0x8a
+#define WDSX_GETUNSOLIRQMASK 0x8b
+#define WDSX_GETFIRMREV 0x8c
+#define WDSX_EXECDIAG 0x8d
+#define WDSX_SETEXECPARM 0x8e
+#define WDSX_GETEXECPARM 0x8f
+
+struct wds_mb {
+ u_char stat;
+ u_char addr[3];
+};
+/* ICMB status value */
+#define ICMB_OK 0x01
+#define ICMB_OKERR 0x02
+#define ICMB_ETIME 0x04
+#define ICMB_ERESET 0x05
+#define ICMB_ETARCMD 0x06
+#define ICMB_ERESEL 0x80
+#define ICMB_ESEL 0x81
+#define ICMB_EABORT 0x82
+#define ICMB_ESRESET 0x83
+#define ICMB_EHRESET 0x84
+
+struct wds_setup {
+ u_char cmd;
+ u_char scsi_id;
+ u_char buson_t;
+ u_char busoff_t;
+ u_char xx;
+ u_char mbaddr[3];
+ u_char nomb;
+ u_char nimb;
+};
+
+#define WDS_NOMB 8
+#define WDS_NIMB 8
+#define MAXSIMUL 8
+
+static int wdsunit=0;
+
+static u_char wds_data[NWDS][BUFSIZ];
+static u_char wds_data_in_use[NWDS];
+
+static struct wds {
+ int addr;
+ struct wds_req wdsr[MAXSIMUL];
+ struct wds_mb ombs[WDS_NOMB], imbs[WDS_NIMB];
+ struct scsi_link sc_link;
+} wds[NWDS];
+
+static int wdsprobe(struct isa_device *);
+static void wds_minphys(struct buf *);
+static struct wds_req *wdsr_alloc(int);
+static int32_t wds_scsi_cmd(struct scsi_xfer *);
+static u_int32_t wds_adapter_info(int);
+static int wds_done(int, struct wds_cmd *, u_char);
+static int wdsattach(struct isa_device *);
+static int wds_init(struct isa_device *);
+static int wds_cmd(int, u_char *, int);
+static void wds_wait(int, int, int);
+
+struct isa_driver wdsdriver =
+{
+ wdsprobe,
+ wdsattach,
+ "wds"
+};
+
+static struct scsi_adapter wds_switch =
+{
+ wds_scsi_cmd,
+ wds_minphys,
+ 0,
+ 0,
+ wds_adapter_info,
+ "wds",
+ {0,0}
+};
+
+int
+wdsprobe(struct isa_device *dev)
+{
+ if(wdsunit > NWDS)
+ return 0;
+
+ dev->id_unit = wdsunit; /* XXX WRONG! */
+ wds[wdsunit].addr = dev->id_iobase;
+
+ if(wds_init(dev) != 0)
+ return 0;
+ wdsunit++;
+ return 8;
+}
+
+void
+wds_minphys(struct buf *bp)
+{
+ if(bp->b_bcount > BUFSIZ)
+ bp->b_bcount = BUFSIZ;
+}
+
+struct wds_req *
+wdsr_alloc(int unit)
+{
+ struct wds_req *r;
+ int x;
+ int i;
+
+ r = NULL;
+ x = splbio();
+ for(i=0; i<MAXSIMUL; i++)
+ if(!wds[unit].wdsr[i].busy)
+ {
+ r = &wds[unit].wdsr[i];
+ r->busy = 1;
+ break;
+ }
+ if(!r)
+ {
+ splx(x);
+ return NULL;
+ }
+
+ r->ombn = -1;
+ for(i=0; i<WDS_NOMB; i++)
+ if(!wds[unit].ombs[i].stat)
+ {
+ wds[unit].ombs[i].stat = 1;
+ r->ombn = i;
+ break;
+ }
+ if(r->ombn == -1 )
+ {
+ r->busy = 0;
+ splx(x);
+ return NULL;
+ }
+ splx(x);
+ return r;
+}
+
+int32_t
+wds_scsi_cmd(struct scsi_xfer *sxp)
+{
+ struct wds_req *r;
+ int unit = sxp->sc_link->adapter_unit;
+ int base;
+ u_char c;
+ int i;
+
+ base = wds[unit].addr;
+
+ if( sxp->flags & SCSI_RESET)
+ {
+ printf("reset!\n");
+ return COMPLETE;
+ }
+
+ r = wdsr_alloc(unit);
+ if(r==NULL)
+ {
+ printf("no request slot available!\n");
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+ r->done = 0;
+ r->sxp = sxp;
+
+ if(sxp->flags & SCSI_DATA_UIO)
+ {
+ printf("UIO!\n");
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+
+ scsi_uto3b(KVTOPHYS(&r->cmd),wds[unit].ombs[r->ombn].addr);
+
+ bzero(&r->cmd, sizeof r->cmd);
+ r->cmd.cmd = WDSX_SCSICMD;
+ r->cmd.targ = (sxp->sc_link->target << 5) | sxp->sc_link->lun;
+ bcopy(sxp->cmd, &r->cmd.scb, sxp->cmdlen<12 ? sxp->cmdlen : 12);
+ scsi_uto3b(sxp->datalen, r->cmd.len);
+
+ if(wds_data_in_use[unit])
+ {
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+ else
+ wds_data_in_use[unit] = 1;
+
+ if(sxp->datalen && !(sxp->flags&SCSI_DATA_IN))
+ bcopy(sxp->data, wds_data[unit], sxp->datalen);
+
+ scsi_uto3b(sxp->datalen ? KVTOPHYS(wds_data[unit]) : 0, r->cmd.data);
+
+ r->cmd.write = (sxp->flags&SCSI_DATA_IN)? 0x80 : 0x00;
+
+ scsi_uto3b(KVTOPHYS(&r->sense),r->cmd.next);
+
+ bzero(&r->sense, sizeof r->sense);
+ r->sense.cmd = r->cmd.cmd;
+ r->sense.targ = r->cmd.targ;
+ r->sense.scb[0] = REQUEST_SENSE;
+ scsi_uto3b(KVTOPHYS(&sxp->sense),r->sense.data);
+ scsi_uto3b(sizeof(sxp->sense), r->sense.len);
+ r->sense.write = 0x80;
+
+ if(sxp->flags & SCSI_NOMASK)
+ {
+ outb(base+WDS_HCR, WDSH_DRQEN);
+ r->polled = 1;
+ } else
+ {
+ outb(base+WDS_HCR, WDSH_IRQEN|WDSH_DRQEN);
+ r->polled = 0;
+ }
+
+ c = WDSC_MSTART(r->ombn);
+
+ if( wds_cmd(base, &c, sizeof c) != 0)
+ {
+ printf("wds%d: unable to start outgoing mbox\n", unit);
+ r->busy = 0;
+ wds[unit].ombs[r->ombn].stat = 0;
+
+ return TRY_AGAIN_LATER;
+ }
+
+ if(sxp->flags & SCSI_NOMASK)
+ {
+ repoll:
+
+ i = 0;
+ while(!(inb(base+WDS_STAT) & WDS_IRQ))
+ {
+
+ DELAY(20000);
+ if(++i == 20)
+ {
+ outb(base + WDS_IRQACK, 0);
+ /*r->busy = 0;*/
+ sxp->error = XS_TIMEOUT;
+ return HAD_ERROR;
+ }
+ }
+ wdsintr(unit);
+ if(r->done)
+ {
+ r->sxp->flags |= ITSDONE;
+ r->busy = 0;
+ return r->ret;
+ }
+ goto repoll;
+ }
+
+ return SUCCESSFULLY_QUEUED;
+}
+
+u_int32_t
+wds_adapter_info(int unit)
+{
+ return 1;
+}
+
+void
+wdsintr(int unit)
+{
+ struct wds_cmd *pc, *vc;
+ struct wds_mb *in;
+ u_char stat;
+ u_char c;
+
+ if(!inb(wds[unit].addr+WDS_STAT) & WDS_IRQ)
+ {
+ outb(wds[unit].addr + WDS_IRQACK, 0);
+ return;
+ }
+
+ c = inb(wds[unit].addr + WDS_IRQSTAT);
+ if( (c&WDSI_MASK) == WDSI_MSVC)
+ {
+ c = c & ~WDSI_MASK;
+ in = &wds[unit].imbs[c];
+
+ pc = (struct wds_cmd *)scsi_3btou(in->addr);
+ vc = (struct wds_cmd *)PHYSTOKV((intptr_t)(void *)pc);
+ stat = in->stat;
+
+ wds_done(unit, vc, stat);
+ in->stat = 0;
+
+ outb(wds[unit].addr + WDS_IRQACK, 0);
+ }
+}
+
+int
+wds_done(int unit, struct wds_cmd *c, u_char stat)
+{
+ struct wds_req *r;
+ int i;
+
+ r = (struct wds_req *)NULL;
+
+ for(i=0; i<MAXSIMUL; i++)
+ if( c == &wds[unit].wdsr[i].cmd && !wds[unit].wdsr[i].done)
+ {
+ r = &wds[unit].wdsr[i];
+ break;
+ }
+ if(r == (struct wds_req *)NULL)
+ {
+ /* failed to find request! */
+ return 1;
+ }
+
+ r->done = 1;
+ wds[unit].ombs[r->ombn].stat = 0;
+ r->ret = HAD_ERROR;
+ switch(stat)
+ {
+ case ICMB_OK:
+ r->ret = COMPLETE;
+ if(r->sxp)
+ r->sxp->resid = 0;
+ break;
+ case ICMB_OKERR:
+ if(!(r->sxp->flags & SCSI_ERR_OK) && c->stat)
+ {
+ r->sxp->sense.error_code = c->venderr;
+ r->sxp->error=XS_SENSE;
+ }
+ else
+ r->sxp->error=XS_NOERROR;
+ r->ret = COMPLETE;
+ break;
+ case ICMB_ETIME:
+ r->sxp->error = XS_TIMEOUT;
+ r->ret = HAD_ERROR;
+ break;
+ case ICMB_ERESET:
+ case ICMB_ETARCMD:
+ case ICMB_ERESEL:
+ case ICMB_ESEL:
+ case ICMB_EABORT:
+ case ICMB_ESRESET:
+ case ICMB_EHRESET:
+ r->sxp->error = XS_DRIVER_STUFFUP;
+ r->ret = HAD_ERROR;
+ break;
+ }
+
+ if(r->sxp)
+ if(r->sxp->datalen && (r->sxp->flags&SCSI_DATA_IN))
+ bcopy(wds_data[unit],r->sxp->data,r->sxp->datalen);
+
+ wds_data_in_use[unit] = 0;
+
+ if(!r->polled)
+ {
+ r->sxp->flags |= ITSDONE;
+ scsi_done(r->sxp);
+ }
+
+ r->busy = 0;
+
+ return 0;
+}
+
+static int
+wds_getvers(int unit)
+{
+ struct wds_req *r;
+ int base;
+ u_char c;
+ int i;
+
+ base = wds[unit].addr;
+
+ r = wdsr_alloc(unit);
+ if(!r)
+ {
+ printf("wds%d: no request slot available!\n", unit);
+ return -1;
+ }
+
+ r->done = 0;
+ r->sxp = NULL;
+
+ scsi_uto3b(KVTOPHYS(&r->cmd), wds[unit].ombs[r->ombn].addr);
+
+ bzero(&r->cmd, sizeof r->cmd);
+ r->cmd.cmd = WDSX_GETFIRMREV;
+
+ outb(base+WDS_HCR, WDSH_DRQEN);
+ r->polled = 1;
+
+ c = WDSC_MSTART(r->ombn);
+ if(wds_cmd(base, (u_char *)&c, sizeof c))
+ {
+ printf("wds%d: version request failed\n", unit);
+ r->busy = 0;
+ wds[unit].ombs[r->ombn].stat = 0;
+ return -1;
+ }
+
+ while(1)
+ {
+ i = 0;
+ while( (inb(base+WDS_STAT) & WDS_IRQ) == 0)
+ {
+ DELAY(9000);
+ if(++i == 20)
+ return -1;
+ }
+ wdsintr(unit);
+ if(r->done)
+ {
+ printf("wds%d: firmware version %d.%02d\n", unit,
+ r->cmd.targ, r->cmd.scb[0]);
+ r->busy = 0;
+ return 0;
+ }
+ }
+}
+
+int
+wdsattach(struct isa_device *dev)
+{
+ int masunit;
+ static u_long versprobe=0; /* max 32 controllers */
+ int unit = dev->id_unit;
+ struct scsibus_data *scbus;
+
+ masunit = dev->id_unit;
+
+ if( !(versprobe & (1<<masunit)))
+ {
+ versprobe |= (1<<masunit);
+ if(wds_getvers(masunit)==-1)
+ printf("wds%d: getvers failed\n", masunit);
+ }
+
+ printf("wds%d: using %d bytes for dma buffer\n",unit,BUFSIZ);
+
+ wds[unit].sc_link.adapter_unit = unit;
+ wds[unit].sc_link.adapter_targ = 7;
+ wds[unit].sc_link.adapter = &wds_switch;
+ wds[unit].sc_link.device = &wds_dev;
+ wds[unit].sc_link.flags = SDEV_BOUNCE;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &wds[unit].sc_link;
+
+ scsi_attachdevs(scbus);
+
+ return 1;
+}
+
+int
+wds_init(struct isa_device *dev)
+{
+ struct wds_setup init;
+ int base;
+ int unit, i;
+ struct wds_cmd wc;
+
+ unit = dev->id_unit;
+ base = wds[unit].addr;
+
+ /*
+ * Sending a command causes the CMDRDY bit to clear.
+ */
+
+ outb(base+WDS_CMD, WDSC_NOOP);
+ if( inb(base+WDS_STAT) & WDS_RDY)
+ return 1;
+
+ /*
+ * the controller exists. reset and init.
+ */
+ outb(base+WDS_HCR, WDSH_ASCRESET|WDSH_SCSIRESET);
+ DELAY(30);
+ outb(base+WDS_HCR, 0);
+
+ outb(base+WDS_HCR, WDSH_DRQEN);
+
+ isa_dmacascade(dev->id_drq);
+
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY)
+ {
+ for(i=0; i<10; i++)
+ {
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) == WDS_RDY)
+ break;
+ DELAY(40000);
+ }
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY) /* probe timeout */
+ return 1;
+ }
+
+ bzero(&init, sizeof init);
+ init.cmd = WDSC_INIT;
+ init.scsi_id = 7;
+ init.buson_t = 24;
+ init.busoff_t = 48;
+ scsi_uto3b(KVTOPHYS(wds[unit].ombs), init.mbaddr);
+ init.xx = 0;
+ init.nomb = WDS_NOMB;
+ init.nimb = WDS_NIMB;
+
+ wds_wait(base+WDS_STAT, WDS_RDY, WDS_RDY);
+ if( wds_cmd(base, (u_char *)&init, sizeof init) != 0)
+ {
+ printf("wds%d: wds_cmd failed\n", unit);
+ return 1;
+ }
+
+ wds_wait(base+WDS_STAT, WDS_INIT, WDS_INIT);
+
+ wds_wait(base+WDS_STAT, WDS_RDY, WDS_RDY);
+
+ bzero(&wc,sizeof wc);
+ wc.cmd = WDSC_DISUNSOL;
+ if( wds_cmd(base, (char *)&wc, sizeof wc) != 0)
+ {
+ printf("wds%d: wds_cmd failed\n", unit);
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+wds_cmd(int base, u_char *p, int l)
+{
+ int s=splbio();
+
+ while(l--)
+ {
+ do
+ {
+ outb(base+WDS_CMD,*p);
+ wds_wait(base+WDS_STAT,WDS_RDY,WDS_RDY);
+ } while (inb(base+WDS_STAT) & WDS_REJ);
+ p++;
+ }
+
+ wds_wait(base+WDS_STAT,WDS_RDY,WDS_RDY);
+
+ splx(s);
+
+ return 0;
+}
+
+void
+wds_wait(int reg, int mask, int val)
+{
+ while((inb(reg) & mask) != val);
+}
+
+#endif
diff --git a/sys/i386/isa/wdreg.h b/sys/i386/isa/wdreg.h
index 88a0fecb2b27..f8520bf56616 100644
--- a/sys/i386/isa/wdreg.h
+++ b/sys/i386/isa/wdreg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
- * $Id: wdreg.h,v 1.24 1999/01/12 01:04:38 eivind Exp $
+ * $Id: wdreg.h,v 1.21 1998/01/14 08:08:42 kato Exp $
*/
/*
@@ -262,7 +262,7 @@ int wdformat(struct buf *bp);
*/
struct wddma {
void *(*wdd_candma) /* returns a cookie if PCI */
- __P((int iobase_wd, int ctlr, int unit));
+ __P((int ctlr, int drive));
int (*wdd_dmaverify) /* verify that request is DMA-able */
__P((void *cookie, char *vaddr, u_long len, int direction));
int (*wdd_dmaprep) /* prepare DMA hardware */
@@ -312,6 +312,4 @@ struct wddma {
extern struct wddma wddma[];
-void wdintr __P((void *unit));
-
#endif /* KERNEL */
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index 60ceb0b81a13..67d570a37e5d 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wfd.c,v 1.16 1998/09/15 08:15:30 gibbs Exp $
+ * $Id: wfd.c,v 1.15 1998/08/23 20:16:34 phk Exp $
*/
/*
@@ -661,6 +661,9 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
struct wfd *t = wfdtab[lun];
int error = 0;
+ struct disklabel *dl;
+ char buffer[DEV_BSIZE];
+
error = dsioctl("wfd", dev, cmd, addr, flag, &t->dk_slices,
wfdstrategy1, (ds_setgeom_t *)NULL);
if (error != -1)
diff --git a/sys/i386/isa/wst.c b/sys/i386/isa/wst.c
index 3d2f4e8e5914..ff5f5435f31e 100644
--- a/sys/i386/isa/wst.c
+++ b/sys/i386/isa/wst.c
@@ -25,13 +25,12 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wst.c,v 1.14 1999/01/12 00:36:36 eivind Exp $
+ * $Id$
*/
#include "wdc.h"
#include "wst.h"
#include "opt_atapi.h"
-#include "opt_ddb.h"
#include "opt_devfs.h"
#if NWST > 0 && NWDC > 0 && defined(ATAPI)
@@ -200,6 +199,7 @@ static
int wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug);
static int wst_sense(struct wst *t);
static void wst_describe(struct wst *t);
+static int wst_open(dev_t dev, int chardev);
static void wst_poll_dsc(struct wst *t);
static void wst_start(struct wst *t);
static void wst_done(struct wst *t, struct buf *bp, int resid, struct atapires result);
@@ -212,10 +212,7 @@ static int wst_load_unload(struct wst *t, u_char finction);
static int wst_rewind(struct wst *t);
static void wst_reset(struct wst *t);
-#ifdef DDB
-void wst_dump(int lun, char *label, void *data, int len);
-
-void
+static void
wst_dump(int lun, char *label, void *data, int len)
{
u_char *p = data;
@@ -225,7 +222,6 @@ wst_dump(int lun, char *label, void *data, int len)
printf("-%x", *p++);
printf("\n");
}
-#endif
#ifndef ATAPI_STATIC
static
@@ -234,7 +230,9 @@ int
wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
{
struct wst *t;
- int lun;
+ struct atapires result;
+ int lun, i;
+ char buffer[255];
if (wstnlun >= NUNIT) {
printf("wst: too many units\n");
@@ -350,7 +348,9 @@ int
wstopen(dev_t dev, int flags, int fmt, struct proc *p)
{
int lun = UNIT(dev);
+ char buffer[255];
struct wst *t;
+ struct atapires result;
/* Check that the device number and that the ATAPI driver is loaded. */
if (lun >= wstnlun || !atapi_request_immediate) {
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index c8712ca4603d..481397e39abb 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -20,7 +20,7 @@
* the original CMU copyright notice.
*
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
- * $Id: wt.c,v 1.46 1998/10/22 05:58:41 bde Exp $
+ * $Id: wt.c,v 1.44 1998/06/07 17:11:07 dfr Exp $
*
*/
@@ -178,7 +178,6 @@ static void wtclock (wtinfo_t *t);
static int wtreset (wtinfo_t *t);
static int wtsense (wtinfo_t *t, int verb, int ignor);
static int wtstatus (wtinfo_t *t);
-static ointhand2_t wtintr;
static void wtrewind (wtinfo_t *t);
static int wtreadfm (wtinfo_t *t);
static int wtwritefm (wtinfo_t *t);
@@ -189,6 +188,8 @@ static d_read_t wtread;
static d_write_t wtwrite;
static d_close_t wtclose;
static d_ioctl_t wtioctl;
+static d_dump_t wtdump;
+static d_psize_t wtsize;
static d_strategy_t wtstrategy;
#define CDEV_MAJOR 10
@@ -255,7 +256,6 @@ wtattach (struct isa_device *id)
{
wtinfo_t *t = wttab + id->id_unit;
- id->id_ointr = wtintr;
if (t->type == ARCHIVE) {
printf ("wt%d: type <Archive>\n", t->unit);
outb (t->RDMAPORT, 0); /* reset dma */
@@ -275,10 +275,24 @@ wtattach (struct isa_device *id)
struct isa_driver wtdriver = { wtprobe, wtattach, "wt", };
+int
+wtdump (dev_t dev)
+{
+ /* Not implemented */
+ return (EINVAL);
+}
+
+int
+wtsize (dev_t dev)
+{
+ /* Not implemented */
+ return (-1);
+}
+
/*
* Open routine, called on every device open.
*/
-static int
+int
wtopen (dev_t dev, int flag, int fmt, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -359,7 +373,7 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p)
/*
* Close routine, called on last device close.
*/
-static int
+int
wtclose (dev_t dev, int flags, int fmt, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -408,7 +422,7 @@ done:
* ioctl (int fd, MTIOCGET, struct mtget *buf) -- get status
* ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op
*/
-static int
+int
wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -511,7 +525,7 @@ wtwrite(dev_t dev, struct uio *uio, int ioflag)
/*
* Strategy routine.
*/
-static void
+void
wtstrategy (struct buf *bp)
{
int u = minor (bp->b_dev) & T_UNIT;
@@ -589,7 +603,7 @@ xit: biodone (bp);
/*
* Interrupt routine.
*/
-static void
+void
wtintr (int u)
{
wtinfo_t *t = wttab + u;
diff --git a/sys/i386/linux/imgact_linux.c b/sys/i386/linux/imgact_linux.c
index 59ee24737b73..72f846cb447c 100644
--- a/sys/i386/linux/imgact_linux.c
+++ b/sys/i386/linux/imgact_linux.c
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_linux.c,v 1.30 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_linux.c,v 1.29 1998/08/16 01:21:50 bde Exp $
*/
#include <sys/param.h>
@@ -234,8 +234,8 @@ exec_linux_imgact(imgp)
/*
* Tell kern_execve.c about it, with a little help from the linker.
* Since `const' objects end up in the text segment, TEXT_SET is the
- * correct directive to use.
+ * correct directive to use. Do not staticize; used by Linux LKM.
*/
-static const struct execsw linux_execsw = { exec_linux_imgact, "linux a.out" };
+const struct execsw linux_execsw = { exec_linux_imgact, "linux a.out" };
EXEC_SET(linuxaout, linux_execsw);
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index eaffa614c6b8..db96f2e025d5 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux.h,v 1.25 1998/12/19 02:55:32 julian Exp $
+ * $Id: linux.h,v 1.22 1998/09/30 01:42:53 jfieber Exp $
*/
#ifndef _I386_LINUX_LINUX_H_
@@ -418,7 +418,6 @@ struct trapframe;
#define LINUX_MAP_PRIVATE 0x0002
#define LINUX_MAP_FIXED 0x0010
#define LINUX_MAP_ANON 0x0020
-#define LINUX_MAP_GROWSDOWN 0x0100
/* SystemV ipc defines */
#define LINUX_SEMOP 1
@@ -472,8 +471,6 @@ struct trapframe;
#define LINUX_SHUTDOWN 13
#define LINUX_SETSOCKOPT 14
#define LINUX_GETSOCKOPT 15
-#define LINUX_SENDMSG 16
-#define LINUX_RECVMSG 17
#define LINUX_AF_UNSPEC 0
#define LINUX_AF_UNIX 1
@@ -515,21 +512,6 @@ struct trapframe;
#define LINUX_IP_DROP_MEMBERSHIP 36
/* Sound system defines */
-#define LINUX_SNDCTL_SEQ_RESET 0x5100
-#define LINUX_SNDCTL_SEQ_SYNC 0x5101
-#define LINUX_SNDCTL_SYNTH_INFO 0x5102
-#define LINUX_SNDCTL_SEQ_CTRLRATE 0x5103
-#define LINUX_SNDCTL_SEQ_GETOUTCOUNT 0x5104
-#define LINUX_SNDCTL_SEQ_GETINCOUNT 0x5105
-#define LINUX_SNDCTL_SEQ_PERCMODE 0x5106
-#define LINUX_SNDCTL_FM_LOAD_INSTR 0x5107
-#define LINUX_SNDCTL_SEQ_TESTMIDI 0x5108
-#define LINUX_SNDCTL_SEQ_RESETSAMPLES 0x5109
-#define LINUX_SNDCTL_SEQ_NRSYNTHS 0x510A
-#define LINUX_SNDCTL_SEQ_NRMIDIS 0x510B
-#define LINUX_SNDCTL_MIDI_INFO 0x510C
-#define LINUX_SNDCTL_SEQ_TRESHOLD 0x510D
-#define LINUX_SNDCTL_SYNTH_MEMAVL 0x510E
#define LINUX_SNDCTL_DSP_RESET 0x5000
#define LINUX_SNDCTL_DSP_SYNC 0x5001
#define LINUX_SNDCTL_DSP_SPEED 0x5002
diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c
index 6a7ce1e82802..30a0dba49449 100644
--- a/sys/i386/linux/linux_dummy.c
+++ b/sys/i386/linux/linux_dummy.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_dummy.c,v 1.8 1997/11/06 19:28:52 phk Exp $
+ * $Id: linux_dummy.c,v 1.7 1997/10/29 08:17:09 kato Exp $
*/
#include <sys/param.h>
@@ -212,6 +212,13 @@ linux_sysinfo(struct proc *p, struct linux_sysinfo_args *args)
}
int
+linux_clone(struct proc *p, struct linux_clone_args *args)
+{
+ printf("Linux-emul(%d): clone() not supported\n", p->p_pid);
+ return ENOSYS;
+}
+
+int
linux_uname(struct proc *p, struct linux_uname_args *args)
{
printf("Linux-emul(%d): uname() not supported\n", p->p_pid);
diff --git a/sys/i386/linux/linux_file.c b/sys/i386/linux/linux_file.c
index 16f12ed4d7be..6a80d4c5ec66 100644
--- a/sys/i386/linux/linux_file.c
+++ b/sys/i386/linux/linux_file.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_file.c,v 1.22 1998/10/05 16:37:36 jfieber Exp $
+ * $Id: linux_file.c,v 1.21 1998/07/29 16:43:00 bde Exp $
*/
#include "opt_compat.h"
@@ -812,7 +812,7 @@ linux_readlink(struct proc *p, struct linux_readlink_args *args)
int
linux_truncate(struct proc *p, struct linux_truncate_args *args)
{
- struct truncate_args bsd;
+ struct otruncate_args bsd;
caddr_t sg;
sg = stackgap_init();
@@ -825,6 +825,6 @@ linux_truncate(struct proc *p, struct linux_truncate_args *args)
bsd.path = args->path;
bsd.length = args->length;
- return truncate(p, &bsd);
+ return otruncate(p, &bsd);
}
diff --git a/sys/i386/linux/linux_ioctl.c b/sys/i386/linux/linux_ioctl.c
index 3010f74116bd..26bb5ab710fc 100644
--- a/sys/i386/linux/linux_ioctl.c
+++ b/sys/i386/linux/linux_ioctl.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_ioctl.c,v 1.29 1998/09/30 01:42:53 jfieber Exp $
+ * $Id: linux_ioctl.c,v 1.28 1998/08/31 10:53:33 jkh Exp $
*/
#include <sys/param.h>
@@ -683,66 +683,6 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args)
return copyout(&linux_line, (caddr_t)args->arg,
sizeof(int));
- case LINUX_SNDCTL_SEQ_RESET:
- args->cmd = SNDCTL_SEQ_RESET;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_SYNC:
- args->cmd = SNDCTL_SEQ_SYNC;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SYNTH_INFO:
- args->cmd = SNDCTL_SYNTH_INFO;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_CTRLRATE:
- args->cmd = SNDCTL_SEQ_CTRLRATE;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_GETOUTCOUNT:
- args->cmd = SNDCTL_SEQ_GETOUTCOUNT;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_GETINCOUNT:
- args->cmd = SNDCTL_SEQ_GETINCOUNT;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_PERCMODE:
- args->cmd = SNDCTL_SEQ_PERCMODE;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_FM_LOAD_INSTR:
- args->cmd = SNDCTL_FM_LOAD_INSTR;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_TESTMIDI:
- args->cmd = SNDCTL_SEQ_TESTMIDI;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_RESETSAMPLES:
- args->cmd = SNDCTL_SEQ_RESETSAMPLES;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_NRSYNTHS:
- args->cmd = SNDCTL_SEQ_NRSYNTHS;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_NRMIDIS:
- args->cmd = SNDCTL_SEQ_NRMIDIS;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_MIDI_INFO:
- args->cmd = SNDCTL_MIDI_INFO;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_TRESHOLD:
- args->cmd = SNDCTL_SEQ_TRESHOLD;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SYNTH_MEMAVL:
- args->cmd = SNDCTL_SYNTH_MEMAVL;
- return ioctl(p, (struct ioctl_args *)args);
-
case LINUX_SNDCTL_DSP_GETOPTR :
args->cmd = SNDCTL_DSP_GETOPTR;
return ioctl(p, (struct ioctl_args *)args);
diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c
index 02f9785fa8a3..9fdd92327674 100644
--- a/sys/i386/linux/linux_misc.c
+++ b/sys/i386/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.50 1998/12/30 21:01:33 sos Exp $
+ * $Id: linux_misc.c,v 1.44 1998/09/24 13:25:43 jkh Exp $
*/
#include <sys/param.h>
@@ -41,9 +41,6 @@
#include <sys/resourcevar.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/unistd.h>
-#endif /* COMPAT_LINUX_THREADS */
#include <sys/vnode.h>
#include <sys/wait.h>
#include <sys/time.h>
@@ -563,79 +560,6 @@ linux_fork(struct proc *p, struct linux_fork_args *args)
return 0;
}
-#ifndef COMPAT_LINUX_THREADS
-int
-linux_clone(struct proc *p, struct linux_clone_args *args)
-{
- printf("linux_clone(%d): Not enabled\n", p->p_pid);
- return (EOPNOTSUPP);
-}
-
-#else
-#define CLONE_VM 0x100
-#define CLONE_FS 0x200
-#define CLONE_FILES 0x400
-#define CLONE_SIGHAND 0x800
-#define CLONE_PID 0x1000
-
-int
-linux_clone(struct proc *p, struct linux_clone_args *args)
-{
- int error, ff = RFPROC;
- struct proc *p2;
- int exit_signal;
- vm_offset_t start;
- struct rfork_args rf_args;
-
-#ifdef SMP
- printf("linux_clone(%d): does not work with SMP yet\n", p->p_pid);
- return (EOPNOTSUPP);
-#endif
-#ifdef DEBUG
- if (args->flags & CLONE_PID)
- printf("linux_clone(%d): CLONE_PID not yet supported\n", p->p_pid);
- printf ("linux_clone(%d): invoked with flags %x and stack %x\n", p->p_pid,
- (unsigned int)args->flags, (unsigned int)args->stack);
-#endif
-
- if (!args->stack)
- return (EINVAL);
- exit_signal = args->flags & 0x000000ff;
- if (exit_signal >= LINUX_NSIG)
- return EINVAL;
- exit_signal = linux_to_bsd_signal[exit_signal];
-
- /* RFTHREAD probably not necessary here, but it shouldn't hurt either */
- ff |= RFTHREAD;
-
- if (args->flags & CLONE_VM)
- ff |= RFMEM;
- if (args->flags & CLONE_SIGHAND)
- ff |= RFSIGSHARE;
- if (!(args->flags & CLONE_FILES))
- ff |= RFFDG;
-
- error = 0;
- start = 0;
-
- rf_args.flags = ff;
- if (error = rfork(p, &rf_args))
- return error;
-
- p2 = pfind(p->p_retval[0]);
- if (p2 == 0)
- return ESRCH;
-
- p2->p_sigparent = exit_signal;
- p2->p_md.md_regs->tf_esp = (unsigned int)args->stack;
-
-#ifdef DEBUG
- printf ("linux_clone(%d): successful rfork to %d\n", p->p_pid, p2->p_pid);
-#endif
- return 0;
-}
-
-#endif /* COMPAT_LINUX_THREADS */
/* XXX move */
struct linux_mmap_argv {
linux_caddr_t addr;
@@ -646,11 +570,6 @@ struct linux_mmap_argv {
int pos;
};
-#ifdef COMPAT_LINUX_THREADS
-#define STACK_SIZE (2 * 1024 * 1024)
-#define GUARD_SIZE (4 * PAGE_SIZE)
-
-#endif /* COMPAT_LINUX_THREADS */
int
linux_mmap(struct proc *p, struct linux_mmap_args *args)
{
@@ -683,69 +602,8 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args)
bsd_args.flags |= MAP_FIXED;
if (linux_args.flags & LINUX_MAP_ANON)
bsd_args.flags |= MAP_ANON;
-#ifndef COMPAT_LINUX_THREADS
bsd_args.addr = linux_args.addr;
bsd_args.len = linux_args.len;
-#else
-
-#ifndef VM_STACK
- /* Linux Threads will map into the proc stack space, unless
- * we prevent it. This causes problems if we're not using
- * our VM_STACK options.
- */
- if ((unsigned int)linux_args.addr + linux_args.len > (USRSTACK - MAXSSIZ))
- return (EINVAL);
-#endif
-
- if (linux_args.flags & LINUX_MAP_GROWSDOWN) {
-
-#ifdef VM_STACK
- bsd_args.flags |= MAP_STACK;
-#endif
-
- /* The linux MAP_GROWSDOWN option does not limit auto
- * growth of the region. Linux mmap with this option
- * takes as addr the inital BOS, and as len, the initial
- * region size. It can then grow down from addr without
- * limit. However, linux threads has an implicit internal
- * limit to stack size of STACK_SIZE. Its just not
- * enforced explicitly in linux. But, here we impose
- * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
- * region, since we can do this with our mmap.
- *
- * Our mmap with MAP_STACK takes addr as the maximum
- * downsize limit on BOS, and as len the max size of
- * the region. It them maps the top SGROWSIZ bytes,
- * and autgrows the region down, up to the limit
- * in addr.
- *
- * If we don't use the MAP_STACK option, the effect
- * of this code is to allocate a stack region of a
- * fixed size of (STACK_SIZE - GUARD_SIZE).
- */
-
- /* This gives us TOS */
- bsd_args.addr = linux_args.addr + linux_args.len;
-
- /* This gives us our maximum stack size */
- if (linux_args.len > STACK_SIZE - GUARD_SIZE)
- bsd_args.len = linux_args.len;
- else
- bsd_args.len = STACK_SIZE - GUARD_SIZE;
-
- /* This gives us a new BOS. If we're using VM_STACK, then
- * mmap will just map the top SGROWSIZ bytes, and let
- * the stack grow down to the limit at BOS. If we're
- * not using VM_STACK we map the full stack, since we
- * don't have a way to autogrow it.
- */
- bsd_args.addr -= bsd_args.len;
-
- } else {
- bsd_args.addr = linux_args.addr;
- bsd_args.len = linux_args.len;
- }
-#endif /* COMPAT_LINUX_THREADS */
bsd_args.prot = linux_args.prot | PROT_READ; /* always required */
bsd_args.fd = linux_args.fd;
bsd_args.pos = linux_args.pos;
@@ -801,23 +659,14 @@ int
linux_pipe(struct proc *p, struct linux_pipe_args *args)
{
int error;
- int reg_edx;
#ifdef DEBUG
printf("Linux-emul(%d): pipe(*)\n", p->p_pid);
#endif
- reg_edx = p->p_retval[1];
- if (error = pipe(p, 0)) {
- p->p_retval[1] = reg_edx;
+ if (error = pipe(p, 0))
return error;
- }
-
- if (error = copyout(p->p_retval, args->pipefds, 2*sizeof(int))) {
- p->p_retval[1] = reg_edx;
+ if (error = copyout(p->p_retval, args->pipefds, 2*sizeof(int)))
return error;
- }
-
- p->p_retval[1] = reg_edx;
p->p_retval[0] = 0;
return 0;
}
@@ -897,18 +746,12 @@ linux_newuname(struct proc *p, struct linux_newuname_args *args)
printf("Linux-emul(%d): newuname(*)\n", p->p_pid);
#endif
bzero(&linux_newuname, sizeof(struct linux_newuname_t));
- strncpy(linux_newuname.sysname, ostype,
- sizeof(linux_newuname.sysname) - 1);
- strncpy(linux_newuname.nodename, hostname,
- sizeof(linux_newuname.nodename) - 1);
- strncpy(linux_newuname.release, osrelease,
- sizeof(linux_newuname.release) - 1);
- strncpy(linux_newuname.version, version,
- sizeof(linux_newuname.version) - 1);
- strncpy(linux_newuname.machine, machine,
- sizeof(linux_newuname.machine) - 1);
- strncpy(linux_newuname.domainname, domainname,
- sizeof(linux_newuname.domainname) - 1);
+ strncpy(linux_newuname.sysname, ostype, 64);
+ strncpy(linux_newuname.nodename, hostname, 64);
+ strncpy(linux_newuname.release, osrelease, 64);
+ strncpy(linux_newuname.version, version, 64);
+ strncpy(linux_newuname.machine, machine, 64);
+ strncpy(linux_newuname.domainname, domainname, 64);
return (copyout((caddr_t)&linux_newuname, (caddr_t)args->buf,
sizeof(struct linux_newuname_t)));
}
@@ -972,25 +815,11 @@ linux_waitpid(struct proc *p, struct linux_waitpid_args *args)
#endif
tmp.pid = args->pid;
tmp.status = args->status;
-#ifndef COMPAT_LINUX_THREADS
tmp.options = args->options;
-#else
- /* This filters out the linux option _WCLONE. I don't
- * think we need it, but I could be wrong. If we need
- * it, we need to fix wait4, since it will give us an
- * error return of EINVAL if we pass in _WCLONE, and
- * of course, it won't do anything with it.
- */
- tmp.options = (args->options & (WNOHANG | WUNTRACED));
-#endif /* COMPAT_LINUX_THREADS */
tmp.rusage = NULL;
if (error = wait4(p, &tmp))
-#ifndef COMPAT_LINUX_THREADS
- return error;
-#else
return error;
-#endif /* COMPAT_LINUX_THREADS */
if (args->status) {
if (error = copyin(args->status, &tmpstat, sizeof(int)))
return error;
@@ -1023,17 +852,7 @@ linux_wait4(struct proc *p, struct linux_wait4_args *args)
#endif
tmp.pid = args->pid;
tmp.status = args->status;
-#ifndef COMPAT_LINUX_THREADS
tmp.options = args->options;
-#else
- /* This filters out the linux option _WCLONE. I don't
- * think we need it, but I could be wrong. If we need
- * it, we need to fix wait4, since it will give us an
- * error return of EINVAL if we pass in _WCLONE, and
- * of course, it won't do anything with it.
- */
- tmp.options = (args->options & (WNOHANG | WUNTRACED));
-#endif /* COMPAT_LINUX_THREADS */
tmp.rusage = args->rusage;
if (error = wait4(p, &tmp))
@@ -1170,75 +989,3 @@ linux_nice(struct proc *p, struct linux_nice_args *args)
return setpriority(p, &bsd_args);
}
-int
-linux_setgroups(p, uap)
- struct proc *p;
- struct linux_setgroups_args *uap;
-{
- struct pcred *pc = p->p_cred;
- linux_gid_t linux_gidset[NGROUPS];
- gid_t *bsd_gidset;
- int ngrp, error;
-
- if ((error = suser(pc->pc_ucred, &p->p_acflag)))
- return error;
-
- if (uap->gidsetsize > NGROUPS)
- return EINVAL;
-
- ngrp = uap->gidsetsize;
- pc->pc_ucred = crcopy(pc->pc_ucred);
- if (ngrp >= 1) {
- if ((error = copyin((caddr_t)uap->gidset,
- (caddr_t)linux_gidset,
- ngrp * sizeof(linux_gid_t))))
- return error;
-
- pc->pc_ucred->cr_ngroups = ngrp;
-
- bsd_gidset = pc->pc_ucred->cr_groups;
- ngrp--;
- while (ngrp >= 0) {
- bsd_gidset[ngrp] = linux_gidset[ngrp];
- ngrp--;
- }
- }
- else
- pc->pc_ucred->cr_ngroups = 1;
-
- setsugid(p);
- return 0;
-}
-
-int
-linux_getgroups(p, uap)
- struct proc *p;
- struct linux_getgroups_args *uap;
-{
- struct pcred *pc = p->p_cred;
- linux_gid_t linux_gidset[NGROUPS];
- gid_t *bsd_gidset;
- int ngrp, error;
-
- if ((ngrp = uap->gidsetsize) == 0) {
- p->p_retval[0] = pc->pc_ucred->cr_ngroups;
- return 0;
- }
-
- if (ngrp < pc->pc_ucred->cr_ngroups)
- return EINVAL;
-
- ngrp = 0;
- bsd_gidset = pc->pc_ucred->cr_groups;
- while (ngrp < pc->pc_ucred->cr_ngroups) {
- linux_gidset[ngrp] = bsd_gidset[ngrp];
- ngrp++;
- }
-
- if ((error = copyout((caddr_t)linux_gidset, (caddr_t)uap->gidset,
- ngrp * sizeof(linux_gid_t))))
- return error;
-
- p->p_retval[0] = ngrp;
- return (0);
-}
diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h
index cda56c279d8b..eedb56606a4c 100644
--- a/sys/i386/linux/linux_proto.h
+++ b/sys/i386/linux/linux_proto.h
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -195,14 +195,6 @@ struct linux_sigsuspend_args {
struct linux_sigpending_args {
linux_sigset_t * mask; char mask_[PAD_(linux_sigset_t *)];
};
-struct linux_getgroups_args {
- u_int gidsetsize; char gidsetsize_[PAD_(u_int)];
- linux_gid_t * gidset; char gidset_[PAD_(linux_gid_t *)];
-};
-struct linux_setgroups_args {
- u_int gidsetsize; char gidsetsize_[PAD_(u_int)];
- linux_gid_t * gidset; char gidset_[PAD_(linux_gid_t *)];
-};
struct linux_select_args {
struct linux_select_argv * ptr; char ptr_[PAD_(struct linux_select_argv *)];
};
@@ -309,8 +301,7 @@ struct linux_sigreturn_args {
struct linux_sigcontext * scp; char scp_[PAD_(struct linux_sigcontext *)];
};
struct linux_clone_args {
- int flags; char flags_[PAD_(int)];
- void * stack; char stack_[PAD_(void *)];
+ register_t dummy;
};
struct linux_newuname_args {
struct linux_newuname_t * buf; char buf_[PAD_(struct linux_newuname_t *)];
@@ -437,8 +428,6 @@ int linux_siggetmask __P((struct proc *, struct linux_siggetmask_args *));
int linux_sigsetmask __P((struct proc *, struct linux_sigsetmask_args *));
int linux_sigsuspend __P((struct proc *, struct linux_sigsuspend_args *));
int linux_sigpending __P((struct proc *, struct linux_sigpending_args *));
-int linux_getgroups __P((struct proc *, struct linux_getgroups_args *));
-int linux_setgroups __P((struct proc *, struct linux_setgroups_args *));
int linux_select __P((struct proc *, struct linux_select_args *));
int linux_symlink __P((struct proc *, struct linux_symlink_args *));
int linux_readlink __P((struct proc *, struct linux_readlink_args *));
diff --git a/sys/i386/linux/linux_signal.c b/sys/i386/linux/linux_signal.c
index 1f71bf53df09..481ed7f17753 100644
--- a/sys/i386/linux/linux_signal.c
+++ b/sys/i386/linux/linux_signal.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_signal.c,v 1.13 1998/10/11 04:54:16 jdp Exp $
+ * $Id: linux_signal.c,v 1.12 1998/08/15 22:29:43 bde Exp $
*/
#include <sys/param.h>
@@ -310,7 +310,7 @@ linux_kill(struct proc *p, struct linux_kill_args *args)
printf("Linux-emul(%d): kill(%d, %d)\n",
p->p_pid, args->pid, args->signum);
#endif
- if (args->signum < 0 || args->signum >= LINUX_NSIG)
+ if (args->signum <= 0 || args->signum >= LINUX_NSIG)
return EINVAL;
tmp.pid = args->pid;
tmp.signum = linux_to_bsd_signal[args->signum];
diff --git a/sys/i386/linux/linux_socket.c b/sys/i386/linux/linux_socket.c
index e757fc13c7f8..b50cf5860e31 100644
--- a/sys/i386/linux/linux_socket.c
+++ b/sys/i386/linux/linux_socket.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_socket.c,v 1.14 1998/12/30 21:20:00 sos Exp $
+ * $Id: linux_socket.c,v 1.12 1998/02/07 02:13:27 msmith Exp $
*/
/* XXX we use functions that might not exist. */
@@ -810,44 +810,6 @@ linux_socketcall(struct proc *p, struct linux_socketcall_args *args)
return linux_setsockopt(p, args->args);
case LINUX_GETSOCKOPT:
return linux_getsockopt(p, args->args);
- case LINUX_SENDMSG:
- do {
- int error;
- int level;
- caddr_t control;
- struct {
- int s;
- const struct msghdr *msg;
- int flags;
- } *uap = args->args;
-
- error = copyin(&uap->msg->msg_control,
- &control, sizeof(caddr_t));
- if (error)
- return error;
- if (control == NULL)
- goto done;
- error = copyin(&((struct cmsghdr *)control)->cmsg_level,
- &level, sizeof(int));
- if (error)
- return error;
- if (level == 1) {
- /*
- * Linux thinks that SOL_SOCKET is 1; we know that it's really
- * 0xffff, of course.
- */
- level = SOL_SOCKET;
- error = copyout(&level, &((struct cmsghdr *)control)->
- cmsg_level, sizeof(int));
- if (error)
- return error;
- }
- done:
- return sendmsg(p, args->args);
- } while (0);
- case LINUX_RECVMSG:
- return recvmsg(p, args->args);
-
default:
uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
return ENOSYS;
diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h
index e30d836f2406..c0b714753156 100644
--- a/sys/i386/linux/linux_syscall.h
+++ b/sys/i386/linux/linux_syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#define LINUX_SYS_linux_setup 0
@@ -85,8 +85,8 @@
#define LINUX_SYS_getrusage 77
#define LINUX_SYS_gettimeofday 78
#define LINUX_SYS_settimeofday 79
-#define LINUX_SYS_linux_getgroups 80
-#define LINUX_SYS_linux_setgroups 81
+#define LINUX_SYS_getgroups 80
+#define LINUX_SYS_setgroups 81
#define LINUX_SYS_linux_select 82
#define LINUX_SYS_linux_symlink 83
#define LINUX_SYS_ostat 84
@@ -162,6 +162,5 @@
#define LINUX_SYS_sched_rr_get_interval 161
#define LINUX_SYS_nanosleep 162
#define LINUX_SYS_linux_mremap 163
-#define LINUX_SYS_poll 168
#define LINUX_SYS_linux_chown 182
#define LINUX_SYS_MAXSYSCALL 183
diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c
index a5e8bdbf7bc7..da9ac246a517 100644
--- a/sys/i386/linux/linux_sysent.c
+++ b/sys/i386/linux/linux_sysent.c
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#include "opt_compat.h"
@@ -94,8 +94,8 @@ struct sysent linux_sysent[] = {
{ 2, (sy_call_t *)getrusage }, /* 77 = getrusage */
{ 2, (sy_call_t *)gettimeofday }, /* 78 = gettimeofday */
{ 2, (sy_call_t *)settimeofday }, /* 79 = settimeofday */
- { 2, (sy_call_t *)linux_getgroups }, /* 80 = linux_getgroups */
- { 2, (sy_call_t *)linux_setgroups }, /* 81 = linux_setgroups */
+ { 2, (sy_call_t *)getgroups }, /* 80 = getgroups */
+ { 2, (sy_call_t *)setgroups }, /* 81 = setgroups */
{ 1, (sy_call_t *)linux_select }, /* 82 = linux_select */
{ 2, (sy_call_t *)linux_symlink }, /* 83 = linux_symlink */
{ 2, (sy_call_t *)ostat }, /* 84 = ostat */
@@ -134,7 +134,7 @@ struct sysent linux_sysent[] = {
{ 5, (sy_call_t *)linux_ipc }, /* 117 = linux_ipc */
{ 1, (sy_call_t *)fsync }, /* 118 = fsync */
{ 1, (sy_call_t *)linux_sigreturn }, /* 119 = linux_sigreturn */
- { 2, (sy_call_t *)linux_clone }, /* 120 = linux_clone */
+ { 0, (sy_call_t *)linux_clone }, /* 120 = linux_clone */
{ 2, (sy_call_t *)setdomainname }, /* 121 = setdomainname */
{ 1, (sy_call_t *)linux_newuname }, /* 122 = linux_newuname */
{ 3, (sy_call_t *)linux_modify_ldt }, /* 123 = linux_modify_ldt */
@@ -182,7 +182,7 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)nosys }, /* 165 = getresuid */
{ 0, (sy_call_t *)nosys }, /* 166 = new_vm86 */
{ 0, (sy_call_t *)nosys }, /* 167 = query_module */
- { 3, (sy_call_t *)poll }, /* 168 = poll */
+ { 0, (sy_call_t *)nosys }, /* 168 = poll */
{ 0, (sy_call_t *)nosys }, /* 169 = nfsservctl */
{ 0, (sy_call_t *)nosys }, /* 170 = setresgid */
{ 0, (sy_call_t *)nosys }, /* 171 = getresgid */
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index fd80f1d438e8..cf8c021c53fe 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_sysvec.c,v 1.43 1999/01/06 23:05:38 julian Exp $
+ * $Id: linux_sysvec.c,v 1.36 1998/10/11 21:08:02 alex Exp $
*/
/* XXX we use functions that might not exist. */
@@ -70,7 +70,7 @@ static void linux_sendsig __P((sig_t catcher, int sig, int mask,
/*
* Linux syscalls return negative errno's, we do positive and map them
*/
-static int bsd_to_linux_errno[ELAST + 1] = {
+static int bsd_to_linux_errno[ELAST] = {
-0, -1, -2, -3, -4, -5, -6, -7, -8, -9,
-10, -35, -12, -13, -14, -15, -16, -17, -18, -19,
-20, -21, -22, -23, -24, -25, -26, -27, -28, -29,
@@ -79,7 +79,7 @@ static int bsd_to_linux_errno[ELAST + 1] = {
-100,-101,-102,-103,-104,-105,-106,-107,-108,-109,
-110,-111, -40, -36,-112,-113, -39, -11, -87,-122,
-116, -66, -6, -6, -6, -6, -6, -37, -38, -9,
- -6, -6, -43, -42, -75, -6, -84
+ -6, -43, -42
};
int bsd_to_linux_signal[NSIG] = {
@@ -217,11 +217,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof (struct linux_sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -285,7 +281,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
* Build context to run handler in.
*/
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_eflags &= ~PSL_VM;
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -399,7 +395,7 @@ struct sysentvec linux_sysvec = {
0xff,
NSIG,
bsd_to_linux_signal,
- ELAST + 1,
+ ELAST,
bsd_to_linux_errno,
translate_traps,
linux_fixup,
@@ -417,7 +413,7 @@ struct sysentvec elf_linux_sysvec = {
0xff,
NSIG,
bsd_to_linux_signal,
- ELAST + 1,
+ ELAST,
bsd_to_linux_errno,
translate_traps,
elf_linux_fixup,
@@ -429,6 +425,9 @@ struct sysentvec elf_linux_sysvec = {
elf_coredump
};
+/*
+ * Installed either via SYSINIT() or via LKM stubs.
+ */
static Elf32_Brandinfo linux_brand = {
"Linux",
"/compat/linux",
@@ -449,8 +448,14 @@ Elf32_Brandinfo *linux_brandlist[] = {
NULL
};
+/*
+ * XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
+ * "proof of concept" stage and will be fixed shortly
+ */
+static int linux_elf_modevent __P((module_t mod, modeventtype_t type, void *data));
+
static int
-linux_elf_modevent(module_t mod, int type, void *data)
+linux_elf_modevent(module_t mod, modeventtype_t type, void *data)
{
Elf32_Brandinfo **brandinfo;
int error;
diff --git a/sys/i386/linux/linux_util.h b/sys/i386/linux/linux_util.h
index 07a2d3ce686e..58a477d67e9b 100644
--- a/sys/i386/linux/linux_util.h
+++ b/sys/i386/linux/linux_util.h
@@ -28,7 +28,7 @@
*
* from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
* from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp
- * $Id: linux_util.h,v 1.6 1998/06/30 08:40:33 jmg Exp $
+ * $Id: linux_util.h,v 1.5 1997/02/22 09:38:30 peter Exp $
*/
/*
@@ -60,7 +60,7 @@ static __inline caddr_t
stackgap_init()
{
#define szsigcode (*(curproc->p_sysent->sv_szsigcode))
- return (caddr_t)(PS_STRINGS - szsigcode - SPARE_USRSPACE);
+ return (caddr_t)(((caddr_t)PS_STRINGS) - szsigcode - SPARE_USRSPACE);
}
diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master
index c4cc425be69a..912cb3244597 100644
--- a/sys/i386/linux/syscalls.master
+++ b/sys/i386/linux/syscalls.master
@@ -1,4 +1,4 @@
- $Id: syscalls.master,v 1.15 1998/12/22 08:59:19 sos Exp $
+ $Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; System call name/number master file (or rather, slave, from LINUX).
@@ -119,10 +119,8 @@
struct timezone *tzp); }
79 NOPROTO LINUX { int settimeofday(struct timeval *tp, \
struct timezone *tzp); }
-80 STD LINUX { int linux_getgroups(u_int gidsetsize, \
- linux_gid_t *gidset); }
-81 STD LINUX { int linux_setgroups(u_int gidsetsize, \
- linux_gid_t *gidset); }
+80 NOPROTO LINUX { int getgroups(u_int gidsetsize, gid_t *gidset); }
+81 NOPROTO LINUX { int setgroups(u_int gidsetsize, gid_t *gidset); }
82 STD LINUX { int linux_select(struct linux_select_argv *ptr); }
83 STD LINUX { int linux_symlink(char *path, char *to); }
84 NOPROTO LINUX { int ostat(char *path, struct ostat *up); }
@@ -173,7 +171,7 @@
caddr_t ptr); }
118 NOPROTO LINUX { int fsync(int fd); }
119 STD LINUX { int linux_sigreturn(struct linux_sigcontext *scp); }
-120 STD LINUX { int linux_clone(int flags, void *stack); }
+120 STD LINUX { int linux_clone(void); }
121 NOPROTO LINUX { int setdomainname(char *name, \
int len); }
122 STD LINUX { int linux_newuname(struct linux_newuname_t *buf); }
@@ -241,8 +239,7 @@
165 UNIMPL LINUX getresuid
166 UNIMPL LINUX new_vm86
167 UNIMPL LINUX query_module
-168 NOPROTO LINUX { int poll(struct pollfd*, unsigned int nfds, \
- long timeout); }
+168 UNIMPL LINUX poll
169 UNIMPL LINUX nfsservctl
170 UNIMPL LINUX setresgid
171 UNIMPL LINUX getresgid
diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c
deleted file mode 100644
index 04c63c1f6e6a..000000000000
--- a/sys/i4b/driver/i4b_ctl.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ctl.c - i4b system control port driver
- * ------------------------------------------
- *
- * $Id: i4b_ctl.c,v 1.1 1998/12/27 21:46:42 phk Exp $
- *
- * last edit-date: [Sat Dec 5 17:59:15 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bctl.h"
-
-#if NI4BCTL > 1
-#error "only 1 (one) i4bctl device allowed!"
-#endif
-
-#if NI4BCTL > 0
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/layer1/i4b_l1.h>
-
-static int openflag = 0;
-
-#if BSD > 199306 && defined(__FreeBSD__)
-static d_open_t i4bctlopen;
-static d_close_t i4bctlclose;
-static d_ioctl_t i4bctlioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-static d_poll_t i4bctlpoll;
-#endif
-
-#define CDEV_MAJOR 55
-static struct cdevsw i4bctl_cdevsw =
- { i4bctlopen, i4bctlclose, noread, nowrite,
- i4bctlioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4bctlpoll, nommap, NULL, "i4bctl", NULL, -1 };
-#else
- noselect, nommap, NULL, "i4bctl", NULL, -1 };
-#endif
-
-static void i4bctlattach(void *);
-PSEUDO_SET(i4bctlattach, i4b_i4bctldrv);
-
-#define PDEVSTATIC static
-#endif /* __FreeBSD__ */
-
-#ifdef DEVFS
-static void *devfs_token;
-#endif
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* */
-void i4bctlattach __P((void));
-int i4bctlopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4bctlclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4bctlioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-#endif /* !FreeBSD */
-
-#if BSD > 199306 && defined(__FreeBSD__)
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4bctlinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4bctl_cdevsw, NULL);
-}
-
-SYSINIT(i4bctldev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &i4bctlinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4bctlattach(void *dummy)
-#else
-i4bctlattach()
-#endif
-{
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4bctl: ISDN system control port attached\n");
-#endif
-#ifdef DEVFS
- devfs_token = devfs_add_devswf(&i4bctl_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4bctl");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlopen - device driver open routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bctlopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- if(minor(dev))
- return (ENXIO);
-
- if(openflag)
- return (EBUSY);
-
- openflag = 1;
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlclose - device driver close routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bctlclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- openflag = 0;
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4bctlioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- ctl_debug_t *cdbg;
- int error = 0;
-
-#ifndef DO_I4B_DEBUG
- return(ENODEV);
-#else
- if(minor(dev))
- return(ENODEV);
-
- switch(cmd)
- {
- case I4B_CTL_GET_DEBUG:
- cdbg = (ctl_debug_t *)data;
- cdbg->l1 = i4b_l1_debug;
- cdbg->l2 = i4b_l2_debug;
- cdbg->l3 = i4b_l3_debug;
- cdbg->l4 = i4b_l4_debug;
- break;
-
- case I4B_CTL_SET_DEBUG:
- cdbg = (ctl_debug_t *)data;
- i4b_l1_debug = cdbg->l1;
- i4b_l2_debug = cdbg->l2;
- i4b_l3_debug = cdbg->l3;
- i4b_l4_debug = cdbg->l4;
- break;
-
- case I4B_CTL_GET_HSCXSTAT:
- {
- hscxstat_t *hst;
- struct isic_softc *sc;
- hst = (hscxstat_t *)data;
-
- if( hst->unit < 0 ||
- hst->unit > ISIC_MAXUNIT ||
- hst->chan < 0 ||
- hst->chan > 1 )
- {
- error = EINVAL;
- break;
- }
-
-#ifndef __FreeBSD__
- sc = isic_find_sc(hst->unit);
-#else
- sc = &isic_sc[hst->unit];
-#endif
- hst->vfr = sc->sc_chan[hst->chan].stat_VFR;
- hst->rdo = sc->sc_chan[hst->chan].stat_RDO;
- hst->crc = sc->sc_chan[hst->chan].stat_CRC;
- hst->rab = sc->sc_chan[hst->chan].stat_RAB;
- hst->xdu = sc->sc_chan[hst->chan].stat_XDU;
- hst->rfo = sc->sc_chan[hst->chan].stat_RFO;
- break;
- }
-
- case I4B_CTL_CLR_HSCXSTAT:
- {
- hscxstat_t *hst;
- struct isic_softc *sc;
- hst = (hscxstat_t *)data;
-
- if( hst->unit < 0 ||
- hst->unit > ISIC_MAXUNIT ||
- hst->chan < 0 ||
- hst->chan > 1 )
- {
- error = EINVAL;
- break;
- }
-
-#ifndef __FreeBSD__
- sc = isic_find_sc(hst->unit);
-#else
- sc = &isic_sc[hst->unit];
-#endif
-
- sc->sc_chan[hst->chan].stat_VFR = 0;
- sc->sc_chan[hst->chan].stat_RDO = 0;
- sc->sc_chan[hst->chan].stat_CRC = 0;
- sc->sc_chan[hst->chan].stat_RAB = 0;
- sc->sc_chan[hst->chan].stat_XDU = 0;
- sc->sc_chan[hst->chan].stat_RFO = 0;
-
- break;
- }
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-#endif DO_I4B_DEBUG
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static int
-i4bctlpoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-#endif /* NI4BCTL > 0 */
diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c
deleted file mode 100644
index df3977cb72af..000000000000
--- a/sys/i4b/driver/i4b_ipr.c
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ipr.c - isdn4bsd IP over raw HDLC ISDN network driver
- * ---------------------------------------------------------
- *
- * $Id: i4b_ipr.c,v 1.42 1998/12/18 14:20:44 hm Exp $
- *
- * last edit-date: [Fri Dec 18 11:50:47 1998]
- *
- *---------------------------------------------------------------------------*
- *
- * statistics counter usage (interface lifetime):
- * ----------------------------------------------
- * sc->sc_if.if_ipackets # of received packets
- * sc->sc_if.if_ierrors # of error packets not going to upper layers
- * sc->sc_if.if_opackets # of transmitted packets
- * sc->sc_if.if_oerrors # of error packets not being transmitted
- * sc->sc_if.if_collisions # of invalid ip packets after VJ decompression
- * sc->sc_if.if_ibytes # of bytes coming in from the line (before VJ)
- * sc->sc_if.if_obytes # of bytes going out to the line (after VJ)
- * sc->sc_if.if_imcasts (currently unused)
- * sc->sc_if.if_omcasts # of frames sent out of the fastqueue
- * sc->sc_if.if_iqdrops # of frames dropped on input because queue full
- * sc->sc_if.if_noproto # of frames dropped on output because !AF_INET
- *
- * statistics counter usage (connection lifetime):
- * -----------------------------------------------
- * sc->sc_iinb # of ISDN incoming bytes from HSCX
- * sc->sc_ioutb # of ISDN outgoing bytes from HSCX
- * sc->sc_inb # of incoming bytes after decompression
- * sc->sc_outb # of outgoing bytes before compression
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bipr.h"
-
-#if NI4BIPR > 0
-
-#ifdef __FreeBSD__
-#include "opt_i4b.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#include <sys/sockio.h>
-#ifdef IPR_VJ
-#include <sys/malloc.h>
-#endif
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-
-#ifdef IPR_VJ
-#include <net/slcompress.h>
-#define IPR_COMPRESS IFF_LINK0 /* compress TCP traffic */
-#define IPR_AUTOCOMP IFF_LINK1 /* auto-enable TCP compression */
-
-/*---------------------------------------------------------------------------
- * NOTICE: using NO separate buffer relies on the assumption, that the HSCX
- * IRQ handler _always_ allocates a single, continuous mbuf cluster large
- * enough to hold the maximum MTU size if the ipr interface !
- *
- * CAUTION: i have re-defined IPR_VJ_USEBUFFER because it makes problems
- * with 2 i4b's back to back running cvs over ssh, cvs simply
- * aborts because it gets bad data. Everything else (telnet/ftp?etc)
- * functions fine.
- *---------------------------------------------------------------------------*/
-#define IPR_VJ_USEBUFFER /* define to use an allocated separate buffer*/
- /* undef to uncompress in the mbuf itself */
-#endif /* IPR_VJ */
-
-#include "bpfilter.h"
-#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_debug.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifndef __FreeBSD__
-#include <machine/cpu.h> /* For softnet */
-#endif
-
-#ifdef __FreeBSD__
-#define IPR_FMT "ipr%d: "
-#define IPR_ARG(sc) ((sc)->sc_if.if_unit)
-#define PDEVSTATIC static
-#else
-#define IPR_FMT "%s: "
-#define IPR_ARG(sc) ((sc)->sc_if.if_xname)
-#define PDEVSTATIC /* not static */
-#endif
-
-#define I4BIPRMTU 1500 /* regular MTU */
-#define I4BIPRMAXMTU 2000 /* max MTU */
-#define I4BIPRMINMTU 500 /* min MTU */
-
-#define I4BIPRMAXQLEN 50 /* max queue length */
-
-#define I4BIPRACCT 1 /* enable accounting messages */
-#define I4BIPRACCTINTVL 2 /* accounting msg interval in secs */
-#define I4BIPRADJFRXP 1 /* adjust 1st rxd packet */
-
-/* initialized by L4 */
-
-static drvr_link_t ipr_drvr_linktab[NI4BIPR];
-static isdn_link_t *isdn_linktab[NI4BIPR];
-
-struct ipr_softc {
- struct ifnet sc_if; /* network-visible interface */
- int sc_state; /* state of the interface */
-
-#ifndef __FreeBSD__
- int sc_unit; /* unit number for Net/OpenBSD */
-#endif
-
- call_desc_t *sc_cdp; /* ptr to call descriptor */
- int sc_updown; /* soft state of interface */
- struct ifqueue sc_fastq; /* interactive traffic */
- int sc_dialresp; /* dialresponse */
- int sc_lastdialresp;/* last dialresponse */
-
-#if I4BIPRACCT
- int sc_iinb; /* isdn driver # of inbytes */
- int sc_ioutb; /* isdn driver # of outbytes */
- int sc_inb; /* # of bytes rx'd */
- int sc_outb; /* # of bytes tx'd */
- int sc_linb; /* last # of bytes rx'd */
- int sc_loutb; /* last # of bytes tx'd */
- int sc_fn; /* flag, first null acct */
-#endif
-
-#ifdef I4BIPRADJFRXP
- int sc_first_pkt; /* flag, first rxd packet */
-#endif
-
-#ifdef IPR_VJ
- struct slcompress sc_compr; /* tcp compression data */
-#ifdef IPR_VJ_USEBUFFER
- u_char *sc_cbuf; /* tcp decompression buffer */
-#endif
-#endif
-
-} ipr_softc[NI4BIPR];
-
-enum ipr_states {
- ST_IDLE, /* initialized, ready, idle */
- ST_DIALING, /* dialling out to remote */
- ST_CONNECTED_W, /* connected to remote */
- ST_CONNECTED_A, /* connected to remote */
-};
-
-#ifdef __FreeBSD__
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-# define IOCTL_CMD_T u_long
-#else
-# define IOCTL_CMD_T int
-#endif
-PDEVSTATIC void i4biprattach(void *);
-PSEUDO_SET(i4biprattach, i4b_ipr);
-static int i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data);
-#else
-PDEVSTATIC void i4biprattach __P((void));
-static int i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
-#endif
-
-static void iprwatchdog(struct ifnet *ifp);
-static void ipr_init_linktab(int unit);
-static void ipr_tx_queue_empty(int unit);
-static int i4biproutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rtp);
-static void iprclearqueues(struct ipr_softc *sc);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine at kernel boot time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4biprattach(void *dummy)
-#else
-i4biprattach()
-#endif
-{
- struct ipr_softc *sc = ipr_softc;
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
-#ifdef IPR_VJ
- printf("i4bipr: %d IP over raw HDLC ISDN device(s) attached (VJ header compression)\n", NI4BIPR);
-#else
- printf("i4bipr: %d IP over raw HDLC ISDN device(s) attached\n", NI4BIPR);
-#endif
-#endif
-
- for(i=0; i < NI4BIPR; sc++, i++)
- {
- ipr_init_linktab(i);
-
- DBGL4(L4_DIALST, "i4biprattach", ("setting dial state to ST_IDLE\n"));
-
- sc->sc_state = ST_IDLE;
-
-#ifdef __FreeBSD__
- sc->sc_if.if_name = "ipr";
-#if __FreeBSD__ < 3
- sc->sc_if.if_next = NULL;
-#endif
- sc->sc_if.if_unit = i;
-#else
- sprintf(sc->sc_if.if_xname, "ipr%d", i);
- sc->sc_if.if_softc = sc;
- sc->sc_unit = i;
-#endif
-
-#ifdef IPR_VJ
- sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX | IPR_AUTOCOMP;
-#else
- sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX;
-#endif
-
- sc->sc_if.if_mtu = I4BIPRMTU;
- sc->sc_if.if_type = IFT_ISDNBASIC;
- sc->sc_if.if_ioctl = i4biprioctl;
- sc->sc_if.if_output = i4biproutput;
-
- sc->sc_if.if_snd.ifq_maxlen = I4BIPRMAXQLEN;
- sc->sc_fastq.ifq_maxlen = I4BIPRMAXQLEN;
-
- sc->sc_if.if_ipackets = 0;
- sc->sc_if.if_ierrors = 0;
- sc->sc_if.if_opackets = 0;
- sc->sc_if.if_oerrors = 0;
- sc->sc_if.if_collisions = 0;
- sc->sc_if.if_ibytes = 0;
- sc->sc_if.if_obytes = 0;
- sc->sc_if.if_imcasts = 0;
- sc->sc_if.if_omcasts = 0;
- sc->sc_if.if_iqdrops = 0;
- sc->sc_if.if_noproto = 0;
-
-#if I4BIPRACCT
- sc->sc_if.if_timer = 0;
- sc->sc_if.if_watchdog = iprwatchdog;
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_fn = 1;
-#endif
-
-#ifdef IPR_VJ
-#ifdef __FreeBSD__
- sl_compress_init(&sc->sc_compr, -1);
-#else
- sl_compress_init(&sc->sc_compr);
-#endif
-
-#ifdef IPR_VJ_USEBUFFER
- if(!((sc->sc_cbuf =
- (u_char *)malloc(I4BIPRMAXMTU+128, M_DEVBUF, M_WAITOK))))
- {
- panic("if_ipr.c, ipr_attach: VJ malloc failed");
- }
-#endif
-#endif
-
- sc->sc_updown = SOFT_ENA; /* soft enabled */
-
- sc->sc_dialresp = DSTAT_NONE; /* no response */
- sc->sc_lastdialresp = DSTAT_NONE;
-
- if_attach(&sc->sc_if);
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int));
-#else
- bpfattach(&sc->sc_if.if_bpf, &sc->sc_if, DLT_NULL, sizeof(u_int));
-#endif
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * output a packet to the ISDN B-channel
- *---------------------------------------------------------------------------*/
-static int
-i4biproutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
- struct rtentry *rtp)
-{
- struct ipr_softc *sc;
- int unit;
- int s;
- struct ifqueue *ifq;
- struct ip *ip;
-
- s = SPLI4B();
-
-#ifdef __FreeBSD__
- unit = ifp->if_unit;
- sc = &ipr_softc[unit];
-#else
- sc = ifp->if_softc;
- unit = sc->sc_unit;
-#endif
-
- /* check for IP */
-
- if(dst->sa_family != AF_INET)
- {
- printf(IPR_FMT "af%d not supported\n", IPR_ARG(sc), dst->sa_family);
- m_freem(m);
- splx(s);
- sc->sc_if.if_noproto++;
- sc->sc_if.if_oerrors++;
- return(EAFNOSUPPORT);
- }
-
- /* check interface state = UP */
-
- if(!(ifp->if_flags & IFF_UP))
- {
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: interface is DOWN!\n", unit));
- m_freem(m);
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENETDOWN);
- }
-
- /* dial if necessary */
-
- if(sc->sc_state == ST_IDLE || sc->sc_state == ST_DIALING)
- {
-
-#ifdef NOTDEF
- switch(sc->sc_dialresp)
- {
- case DSTAT_TFAIL: /* transient failure */
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: transient dial failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENETUNREACH);
- break;
-
- case DSTAT_PFAIL: /* permanent failure */
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: permanent dial failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(EHOSTUNREACH);
- break;
-
- case DSTAT_INONLY: /* no dialout allowed*/
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: dialout not allowed failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(EHOSTUNREACH);
- break;
- }
-#endif
-
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: send dial request message!\n", unit));
- DBGL4(L4_DIALST, "i4biproutput", ("ipr%d: setting dial state to ST_DIALING\n", unit));
- i4b_l4_dialout(BDRV_IPR, unit);
- sc->sc_state = ST_DIALING;
- }
-
- /* update access time */
-
- microtime(&sc->sc_if.if_lastchange);
-
- /*
- * check, if type of service indicates interactive, i.e. telnet,
- * traffic. in case it is interactive, put it into the fast queue,
- * else (i.e. ftp traffic) put it into the "normal" queue
- */
-
- ip = mtod(m, struct ip *); /* get ptr to ip header */
-
- if(ip->ip_tos & IPTOS_LOWDELAY)
- ifq = &sc->sc_fastq;
- else
- ifq = &sc->sc_if.if_snd;
-
- /* check for space in choosen send queue */
-
- if(IF_QFULL(ifq))
- {
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: send queue full!\n", unit));
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENOBUFS);
- }
-
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: add packet to send queue!\n", unit));
-
- IF_ENQUEUE(ifq, m);
-
- ipr_tx_queue_empty(unit);
-
- splx(s);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * process ioctl
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int
-i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data)
-#else
-static int
-i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
-#endif
-{
-#ifdef __FreeBSD__
- struct ipr_softc *sc = &ipr_softc[ifp->if_unit];
-#else
- struct ipr_softc *sc = ifp->if_softc;
-#endif
-
- struct ifreq *ifr = (struct ifreq *)data;
- struct ifaddr *ifa = (struct ifaddr *)data;
- int s;
- int error = 0;
-
- s = SPLI4B();
-
- switch (cmd)
- {
- case SIOCAIFADDR: /* add interface address */
- case SIOCSIFADDR: /* set interface address */
- case SIOCSIFDSTADDR: /* set interface destination address */
- if(ifa->ifa_addr->sa_family != AF_INET)
- error = EAFNOSUPPORT;
- else
- sc->sc_if.if_flags |= IFF_UP;
- microtime(&sc->sc_if.if_lastchange);
- break;
-
- case SIOCSIFFLAGS: /* set interface flags */
- if(!(ifr->ifr_flags & IFF_UP))
- {
- if(sc->sc_if.if_flags & IFF_RUNNING)
- {
- /* disconnect ISDN line */
-#ifdef __FreeBSD__
- i4b_l4_drvrdisc(BDRV_IPR, ifp->if_unit);
-#else
- i4b_l4_drvrdisc(BDRV_IPR, sc->sc_unit);
-#endif
- sc->sc_if.if_flags &= ~IFF_RUNNING;
- }
-
- sc->sc_state = ST_IDLE;
-
- /* empty queues */
-
- iprclearqueues(sc);
- }
-
- if(ifr->ifr_flags & IFF_DEBUG)
- {
- /* enable debug messages */
- }
-
- microtime(&sc->sc_if.if_lastchange);
- break;
-
-#if !defined(__OpenBSD__)
- case SIOCSIFMTU: /* set interface MTU */
- if(ifr->ifr_mtu > I4BIPRMAXMTU)
- error = EINVAL;
- else if(ifr->ifr_mtu < I4BIPRMINMTU)
- error = EINVAL;
- else
- {
- ifp->if_mtu = ifr->ifr_mtu;
- microtime(&sc->sc_if.if_lastchange);
- }
- break;
-#endif /* __OPENBSD__ */
-
-#if 0
- /* not needed for FreeBSD, done in sl_compress_init() (-hm) */
-
- /* need to add an ioctl: set VJ max slot ID
- * #define IPRIOCSMAXCID _IOW('I', XXX, int)
- */
-#ifdef IPR_VJ
- case IPRIOCSMAXCID:
- {
- struct proc *p = curproc; /* XXX */
- if((error = suser(p->p_ucred, &p->p_acflag)) != 0)
- return (error);
- sl_compress_setup(sc->sc_compr, *(int *)data);
- }
- break;
-#endif
-#endif
- default:
- error = EINVAL;
- break;
- }
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * clear the interface's send queues
- *---------------------------------------------------------------------------*/
-static void
-iprclearqueues(struct ipr_softc *sc)
-{
- int x;
- struct mbuf *m;
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&sc->sc_fastq, m);
- splx(x);
-
- if(m)
- m_freem(m);
- else
- break;
- }
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&sc->sc_if.if_snd, m);
- splx(x);
-
- if(m)
- m_freem(m);
- else
- break;
- }
-}
-
-#if I4BIPRACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-iprwatchdog(struct ifnet *ifp)
-{
-#ifdef __FreeBSD__
- int unit = ifp->if_unit;
- struct ipr_softc *sc = &ipr_softc[unit];
-#else
- struct ipr_softc *sc = ifp->if_softc;
- int unit = sc->sc_unit;
-#endif
- bchan_statistics_t bs;
-
- /* get # of bytes in and out from the HSCX driver */
-
- (*isdn_linktab[unit]->bch_stat)
- (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
-
- sc->sc_ioutb += bs.outbytes;
- sc->sc_iinb += bs.inbytes;
-
- if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
- {
- int ri = (sc->sc_iinb - sc->sc_linb)/I4BIPRACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BIPRACCTINTVL;
-
- if((sc->sc_iinb == sc->sc_linb) && (sc->sc_ioutb == sc->sc_loutb))
- sc->sc_fn = 0;
- else
- sc->sc_fn = 1;
-
- sc->sc_linb = sc->sc_iinb;
- sc->sc_loutb = sc->sc_ioutb;
-
- i4b_l4_accounting(BDRV_IPR, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
- }
- sc->sc_if.if_timer = I4BIPRACCTINTVL;
-}
-#endif /* I4BIPRACCT */
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * start transmitting after connect
- *---------------------------------------------------------------------------*/
-static void
-i4bipr_connect_startio(int unit)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- int s = SPLI4B();
-
- if(sc->sc_state == ST_CONNECTED_W)
- {
- sc->sc_state = ST_CONNECTED_A;
- ipr_tx_queue_empty(unit);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-ipr_connect(int unit, void *cdp)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- int s;
-
- sc->sc_cdp = (call_desc_t *)cdp;
-
- s = SPLI4B();
-
- DBGL4(L4_DIALST, "ipr_connect", ("ipr%d: setting dial state to ST_CONNECTED\n", unit));
-
- sc->sc_if.if_flags |= IFF_RUNNING;
- sc->sc_state = ST_CONNECTED_W;
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
-#if I4BIPRACCT
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_if.if_timer = I4BIPRACCTINTVL;
-#endif
-
-#ifdef I4BIPRADJFRXP
- sc->sc_first_pkt = 1;
-#endif
-
- /*
- * Sometimes ISDN B-channels are switched thru asymmetic. This
- * means that under such circumstances B-channel data (the first
- * three packets of a TCP connection in my case) may get lost,
- * causing a large delay until the connection is started.
- * When the sending of the very first packet of a TCP connection
- * is delayed for a to be empirically determined delay (close
- * to a second in my case) those packets go thru and the TCP
- * connection comes up "almost" immediately (-hm).
- */
-
- if(sc->sc_cdp->isdntxdelay > 0)
- {
- timeout((TIMEOUT_FUNC_T)i4bipr_connect_startio, (void *)unit, sc->sc_cdp->isdntxdelay /* hz*1 */);
- }
- else
- {
- sc->sc_state = ST_CONNECTED_A;
- ipr_tx_queue_empty(unit);
- }
-
- splx(s);
-
- /* we don't need any negotiation - pass event back right now */
- i4b_l4_negcomplete(sc->sc_cdp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-ipr_disconnect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
- struct ipr_softc *sc = &ipr_softc[unit];
-
- /* new stuff to check that the active channel is being closed */
-
- if (cd != sc->sc_cdp)
- {
- DBGL4(L4_IPRDBG, "ipr_disconnect", ("ipr%d: channel %d not active\n",
- cd->driver_unit, cd->channelid));
- return;
- }
-
-#if I4BIPRACCT
- sc->sc_if.if_timer = 0;
-#endif
-
- i4b_l4_accounting(BDRV_IPR, cd->driver_unit, ACCT_FINAL,
- sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-
- sc->sc_cdp = (call_desc_t *)0;
-
- DBGL4(L4_DIALST, "ipr_disconnect", ("setting dial state to ST_IDLE\n"));
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
- sc->sc_if.if_flags &= ~IFF_RUNNING;
- sc->sc_state = ST_IDLE;
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is used to give a feedback from userland daemon
- * in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-ipr_dialresponse(int unit, int status)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- sc->sc_dialresp = status;
-
- DBGL4(L4_IPRDBG, "ipr_dialresponse", ("ipr%d: last=%d, this=%d\n",
- unit, sc->sc_lastdialresp, sc->sc_dialresp));
-}
-
-/*---------------------------------------------------------------------------*
- * interface soft up/down
- *---------------------------------------------------------------------------*/
-static void
-ipr_updown(int unit, int updown)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- sc->sc_updown = updown;
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue. It is assumed that this routines runs at
- * pri level splimp() ! Keep it short !
- *---------------------------------------------------------------------------*/
-static void
-ipr_rx_data_rdy(int unit)
-{
- register struct ipr_softc *sc = &ipr_softc[unit];
- register struct mbuf *m;
-#ifdef IPR_VJ
-#ifdef IPR_VJ_USEBUFFER
- u_char *cp = sc->sc_cbuf;
-#endif
- int len, c;
-#endif
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.rcvif = &sc->sc_if;
-
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_if.if_lastchange);
-
-#ifdef I4BIPRADJFRXP
-
- /*
- * The very first packet after the B channel is switched thru
- * has very often several bytes of random data prepended. This
- * routine looks where the IP header starts and removes the
- * the bad data.
- */
-
- if(sc->sc_first_pkt)
- {
- unsigned char *mp = m->m_data;
- int i;
-
- sc->sc_first_pkt = 0;
-
- for(i = 0; i < m->m_len; i++, mp++)
- {
- if( ((*mp & 0xf0) == 0x40) &&
- ((*mp & 0x0f) >= 0x05) )
- {
- m->m_data = mp;
- m->m_pkthdr.len -= i;
- break;
- }
- }
- }
-#endif
-
- sc->sc_if.if_ipackets++;
- sc->sc_if.if_ibytes += m->m_pkthdr.len;
-
-#ifdef IPR_VJ
- if((c = (*(mtod(m, u_char *)) & 0xf0)) != (IPVERSION << 4))
- {
- /* copy data to buffer */
-
- len = m->m_len;
-
-#ifdef IPR_VJ_USEBUFFER
-/* XXX */ m_copydata(m, 0, len, cp);
-#endif
-
- if(c & 0x80)
- {
- c = TYPE_COMPRESSED_TCP;
- }
- else if(c == TYPE_UNCOMPRESSED_TCP)
- {
-#ifdef IPR_VJ_USEBUFFER
- *cp &= 0x4f; /* XXX */
-#else
- *(mtod(m, u_char *)) &= 0x4f;
-#endif
- }
-
- /*
- * We've got something that's not an IP packet.
- * If compression is enabled, try to decompress it.
- * Otherwise, if `auto-enable' compression is on and
- * it's a reasonable packet, decompress it and then
- * enable compression. Otherwise, drop it.
- */
- if(sc->sc_if.if_flags & IPR_COMPRESS)
- {
-#ifdef IPR_VJ_USEBUFFER
- len = sl_uncompress_tcp(&cp,len,(u_int)c,&sc->sc_compr);
-#else
- len = sl_uncompress_tcp((u_char **)&m->m_data, len,
- (u_int)c, &sc->sc_compr);
-#endif
-
- if(len <= 0)
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_rx_data_rdy: len <= 0 IPR_COMPRESS!\n");
-#endif
- goto error;
- }
- }
- else if((sc->sc_if.if_flags & IPR_AUTOCOMP) &&
- (c == TYPE_UNCOMPRESSED_TCP) && (len >= 40))
- {
-#ifdef IPR_VJ_USEBUFFER
- len = sl_uncompress_tcp(&cp,len,(u_int)c,&sc->sc_compr);
-#else
- len = sl_uncompress_tcp((u_char **)&m->m_data, len,
- (u_int)c, &sc->sc_compr);
-#endif
-
- if(len <= 0)
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_rx_data_rdy: len <= 0 IPR_AUTOCOMP!\n");
-#endif
- goto error;
- }
-
- sc->sc_if.if_flags |= IPR_COMPRESS;
- }
- else
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_input: invalid ip packet!\n");
-#endif
-
-error:
- sc->sc_if.if_ierrors++;
- sc->sc_if.if_collisions++;
- m_freem(m);
- return;
- }
-#ifdef IPR_VJ_USEBUFFER
-/* XXX */ m_copyback(m, 0, len, cp);
-#else
- m->m_len = m->m_pkthdr.len = len;
-#endif
- }
-#endif
-
-#if I4BIPRACCT
- /* NB. do the accounting after decompression! */
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
-#if NBPFILTER > 0
- if(sc->sc_if.if_bpf)
- {
- /* prepend the address family as a four byte field */
- struct mbuf mm;
- u_int af = AF_INET;
- mm.m_next = m;
- mm.m_len = 4;
- mm.m_data = (char *)&af;
-
-#ifdef __FreeBSD__
- bpf_mtap(&sc->sc_if, &mm);
-#else
- bpf_mtap(sc->sc_if.if_bpf, &mm);
-#endif
- }
-#endif /* NBPFILTER > 0 */
-
- if(IF_QFULL(&ipintrq))
- {
- DBGL4(L4_IPRDBG, "ipr_rx_data_rdy", ("ipr%d: ipintrq full!\n", unit));
-
- IF_DROP(&ipintrq);
- sc->sc_if.if_ierrors++;
- sc->sc_if.if_iqdrops++;
- m_freem(m);
- }
- else
- {
- IF_ENQUEUE(&ipintrq, m);
- schednetisr(NETISR_IP);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-ipr_tx_queue_empty(int unit)
-{
- register struct ipr_softc *sc = &ipr_softc[unit];
- register struct mbuf *m;
-#ifdef IPR_VJ
- struct ip *ip;
-#endif
- int x = 0;
-
- if(sc->sc_state != ST_CONNECTED_A)
- return;
-
- for(;;)
- {
- IF_DEQUEUE(&sc->sc_fastq, m);
- if(m)
- {
- sc->sc_if.if_omcasts++;
- }
- else
- {
- IF_DEQUEUE(&sc->sc_if.if_snd, m);
- if(m == NULL)
- break;
- }
-
- microtime(&sc->sc_if.if_lastchange);
-
-#if NBPFILTER > 0
- if(sc->sc_if.if_bpf)
- {
- /* prepend the address family as a four byte field */
-
- struct mbuf mm;
- u_int af = AF_INET;
- mm.m_next = m;
- mm.m_len = 4;
- mm.m_data = (char *)&af;
-
-#ifdef __FreeBSD__
- bpf_mtap(&sc->sc_if, &mm);
-#else
- bpf_mtap(sc->sc_if.if_bpf, &mm);
-#endif
- }
-#endif /* NBPFILTER */
-
-#if I4BIPRACCT
- sc->sc_outb += m->m_pkthdr.len; /* size before compression */
-#endif
-
-#ifdef IPR_VJ
- if((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP)
- {
- if(sc->sc_if.if_flags & IPR_COMPRESS)
- {
- *mtod(m, u_char *) |= sl_compress_tcp(m, ip,
- &sc->sc_compr, 1);
- }
- }
-#endif
- x = 1;
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- sc->sc_if.if_obytes += m->m_pkthdr.len;
-
- sc->sc_if.if_opackets++;
- }
-
- if(x)
- (*isdn_linktab[unit]->bch_tx_start)(isdn_linktab[unit]->unit, isdn_linktab[unit]->channel);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted. It should
- * be used to implement an activity timeout mechanism.
- *---------------------------------------------------------------------------*/
-static void
-ipr_activity(int unit, int rxtx)
-{
- ipr_softc[unit].sc_cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-ipr_ret_linktab(int unit)
-{
- return(&ipr_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-ipr_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-ipr_init_linktab(int unit)
-{
- ipr_drvr_linktab[unit].unit = unit;
- ipr_drvr_linktab[unit].bch_rx_data_ready = ipr_rx_data_rdy;
- ipr_drvr_linktab[unit].bch_tx_queue_empty = ipr_tx_queue_empty;
- ipr_drvr_linktab[unit].bch_activity = ipr_activity;
- ipr_drvr_linktab[unit].line_connected = ipr_connect;
- ipr_drvr_linktab[unit].line_disconnected = ipr_disconnect;
- ipr_drvr_linktab[unit].dial_response = ipr_dialresponse;
- ipr_drvr_linktab[unit].updown_ind = ipr_updown;
-}
-
-/*===========================================================================*/
-
-#endif /* NI4BIPR > 0 */
diff --git a/sys/i4b/driver/i4b_isppp.c b/sys/i4b/driver/i4b_isppp.c
deleted file mode 100644
index b1cb2cf9df5b..000000000000
--- a/sys/i4b/driver/i4b_isppp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isppp.c - isdn4bsd kernel SyncPPP driver
- * --------------------------------------------
- *
- * Uses Serge Vakulenko's sppp backend (originally contributed with
- * the "cx" driver for Cronyx's HDLC-in-hardware device). This driver
- * is only the glue between sppp and i4b.
- *
- * $Id: i4b_isppp.c,v 1.20 1998/12/18 14:20:44 hm Exp $
- *
- * last edit-date: [Fri Dec 18 11:47:58 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bisppp.h"
-#ifdef __FreeBSD__
-#include "sppp.h"
-#endif
-
-#if NI4BISPPP == 0
-# error "You need to define `pseudo-device sppp <N>' with options ISPPP"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioccom.h>
-#include <sys/sockio.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#ifdef __FreeBSD__
-#include <net/if_sppp.h>
-#else
-#include <i4b/sppp/if_sppp.h>
-#endif
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-
-#include "bpfilter.h"
-#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifdef __FreeBSD__
-#define ISPPP_FMT "isp%d: "
-#define ISPPP_ARG(sc) ((sc)->sc_if.if_unit)
-#define PDEVSTATIC static
-#define IFP2UNIT(ifp) (ifp)->if_unit
-
-# if __FreeBSD_version >= 300001
-# define CALLOUT_INIT(chan) callout_handle_init(chan)
-# define TIMEOUT(fun, arg, chan, tick) chan = timeout(fun, arg, tick)
-# define UNTIMEOUT(fun, arg, chan) untimeout(fun, arg, chan)
-# define IOCTL_CMD_T u_long
-# else
-# define CALLOUT_INIT(chan) do {} while(0)
-# define TIMEOUT(fun, arg, chan, tick) timeout(fun, arg, tick)
-# define UNTIMEOUT(fun, arg, chan) untimeout(fun, arg)
-# define IOCTL_CMD_T int
-# endif
-
-#elif defined __NetBSD__ || defined __OpenBSD__
-#define ISPPP_FMT "%s: "
-#define ISPPP_ARG(sc) ((sc)->sc_if.if_xname)
-#define PDEVSTATIC /* not static */
-#define IOCTL_CMD_T u_long
-#define IFP2UNIT(ifp) ((struct i4bisppp_softc *)ifp->if_softc)->sc_unit
-#else
-# error "What system are you using?"
-#endif
-
-#ifdef __FreeBSD__
-PDEVSTATIC void i4bispppattach(void *);
-PSEUDO_SET(i4bispppattach, i4b_isppp);
-#else
-PDEVSTATIC void i4bispppattach __P((void));
-#endif
-
-#define I4BISPPPACCT 1 /* enable accounting messages */
-#define I4BISPPPACCTINTVL 2 /* accounting msg interval in secs */
-#define I4BISPPPDISCDEBUG 1
-
-#define PPP_HDRLEN 4 /* 4 octetts PPP header length */
-
-struct i4bisppp_softc {
- /*
- * struct sppp starts with a struct ifnet, but we gotta allocate
- * more space for it. NB: do not relocate this union, it must
- * be first in isppp_softc. The tls and tlf hooks below want to
- * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
- */
- union {
- struct ifnet scu_if;
- struct sppp scu_sp;
- } sc_if_un;
-#define sc_if sc_if_un.scu_if
-
- int sc_state; /* state of the interface */
-
-#ifndef __FreeBSD__
- int sc_unit; /* unit number for Net/OpenBSD */
-#endif
-
- call_desc_t *sc_cdp; /* ptr to call descriptor */
-
-#ifdef I4BISPPPACCT
- int sc_iinb; /* isdn driver # of inbytes */
- int sc_ioutb; /* isdn driver # of outbytes */
- int sc_inb; /* # of bytes rx'd */
- int sc_outb; /* # of bytes tx'd */
- int sc_linb; /* last # of bytes rx'd */
- int sc_loutb; /* last # of bytes tx'd */
- int sc_fn; /* flag, first null acct */
-#endif
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle sc_ch;
-#endif
-
-} i4bisppp_softc[NI4BISPPP];
-
-static void i4bisppp_init_linktab(int unit);
-static int i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data);
-
-#if 0
-static void i4bisppp_send(struct ifnet *ifp);
-#endif
-
-static void i4bisppp_start(struct ifnet *ifp);
-
-#if 0 /* never used ??? */
-static void i4bisppp_timeout(void *cookie);
-#endif
-
-static void i4bisppp_tls(struct sppp *sp);
-static void i4bisppp_tlf(struct sppp *sp);
-static void i4bisppp_state_changed(struct sppp *sp, int new_state);
-static void i4bisppp_negotiation_complete(struct sppp *sp);
-static void i4bisppp_watchdog(struct ifnet *ifp);
-
-/* initialized by L4 */
-
-static drvr_link_t i4bisppp_drvr_linktab[NI4BISPPP];
-static isdn_link_t *isdn_linktab[NI4BISPPP];
-
-enum i4bisppp_states {
- ST_IDLE, /* initialized, ready, idle */
- ST_DIALING, /* dialling out to remote */
- ST_CONNECTED, /* connected to remote */
-};
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine at kernel boot time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4bispppattach(void *dummy)
-#else
-i4bispppattach(void)
-#endif
-{
- struct i4bisppp_softc *sc = i4bisppp_softc;
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4bisppp: %d ISDN SyncPPP device(s) attached\n",
- NI4BISPPP);
-#endif
-
- for(i = 0; i < NI4BISPPP; sc++, i++) {
- i4bisppp_init_linktab(i);
-
- sc->sc_if.if_softc = sc;
-
-#ifdef __FreeBSD__
- sc->sc_if.if_name = "isp";
-#if defined(__FreeBSD_version) && __FreeBSD_version < 300001
- sc->sc_if.if_next = NULL;
-#endif
- sc->sc_if.if_unit = i;
-#else
- sprintf(sc->sc_if.if_xname, "isp%d", i);
- sc->sc_unit = i;
-#endif
-
- sc->sc_if.if_mtu = PP_MTU;
- sc->sc_if.if_flags = IFF_SIMPLEX | IFF_POINTOPOINT;
- sc->sc_if.if_type = IFT_ISDNBASIC;
- sc->sc_state = ST_IDLE;
-
- sc->sc_if.if_ioctl = i4bisppp_ioctl;
-
- /* actually initialized by sppp_attach() */
- /* sc->sc_if.if_output = sppp_output; */
-
- sc->sc_if.if_start = i4bisppp_start;
-
- sc->sc_if.if_hdrlen = 0;
- sc->sc_if.if_addrlen = 0;
- sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
-
- sc->sc_if.if_ipackets = 0;
- sc->sc_if.if_ierrors = 0;
- sc->sc_if.if_opackets = 0;
- sc->sc_if.if_oerrors = 0;
- sc->sc_if.if_collisions = 0;
- sc->sc_if.if_ibytes = 0;
- sc->sc_if.if_obytes = 0;
- sc->sc_if.if_imcasts = 0;
- sc->sc_if.if_omcasts = 0;
- sc->sc_if.if_iqdrops = 0;
- sc->sc_if.if_noproto = 0;
-
-#if I4BISPPPACCT
- sc->sc_if.if_timer = 0;
- sc->sc_if.if_watchdog = i4bisppp_watchdog;
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_fn = 1;
-#endif
-
- sc->sc_if_un.scu_sp.pp_tls = i4bisppp_tls;
- sc->sc_if_un.scu_sp.pp_tlf = i4bisppp_tlf;
- sc->sc_if_un.scu_sp.pp_con = i4bisppp_negotiation_complete;
- sc->sc_if_un.scu_sp.pp_chg = i4bisppp_state_changed;
-
- sppp_attach(&sc->sc_if);
- if_attach(&sc->sc_if);
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- bpfattach(&sc->sc_if, DLT_PPP, PPP_HDRLEN);
- CALLOUT_INIT(&sc->sc_ch);
-#endif /* __FreeBSD__ */
-#ifdef __NetBSD__
- bpfattach(&sc->sc_if.if_bpf, &sc->sc_if, DLT_PPP, sizeof(u_int));
-#endif
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * process ioctl
- *---------------------------------------------------------------------------*/
-static int
-i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
-#if 0
- struct sppp *sp = (struct sppp *)sc;
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
-#endif
-
- int error;
-
- error = sppp_ioctl(&sc->sc_if, cmd, data);
- if (error)
- return error;
-
- switch(cmd) {
- case SIOCSIFFLAGS:
-#if 0 /* never used ??? */
- x = splimp();
- if ((ifp->if_flags & IFF_UP) == 0)
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
- splx(x);
-#endif
- break;
- }
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- * start output to ISDN B-channel
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_start(struct ifnet *ifp)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
- struct mbuf *m;
- int s;
- int unit = IFP2UNIT(ifp);
-
- if (sppp_isempty(ifp))
- return;
-
- if(sc->sc_state != ST_CONNECTED)
- return;
-
- s = splimp();
- /*ifp->if_flags |= IFF_OACTIVE; - need to clear this somewhere */
- splx(s);
-
- while ((m = sppp_dequeue(&sc->sc_if)) != NULL)
- {
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
-#endif /* __FreeBSD__ */
-
-#ifdef __NetBSD__
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
-#endif
-#endif /* NBPFILTER > 0 */
-
- microtime(&ifp->if_lastchange);
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- sc->sc_if.if_obytes += m->m_pkthdr.len;
- sc->sc_outb += m->m_pkthdr.len;
- sc->sc_if.if_opackets++;
- }
- isdn_linktab[unit]->bch_tx_start(isdn_linktab[unit]->unit,
- isdn_linktab[unit]->channel);
-}
-
-#ifdef I4BISPPPACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_watchdog(struct ifnet *ifp)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
- int unit = IFP2UNIT(ifp);
- bchan_statistics_t bs;
-
- (*isdn_linktab[unit]->bch_stat)
- (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
-
- sc->sc_ioutb += bs.outbytes;
- sc->sc_iinb += bs.inbytes;
-
- if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
- {
- int ri = (sc->sc_iinb - sc->sc_linb)/I4BISPPPACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BISPPPACCTINTVL;
-
- if((sc->sc_iinb == sc->sc_linb) && (sc->sc_ioutb == sc->sc_loutb))
- sc->sc_fn = 0;
- else
- sc->sc_fn = 1;
-
- sc->sc_linb = sc->sc_iinb;
- sc->sc_loutb = sc->sc_ioutb;
-
- i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
- }
- sc->sc_if.if_timer = I4BISPPPACCTINTVL;
-
-#if 0 /* old stuff, keep it around */
- printf(ISPPP_FMT "transmit timeout\n", ISPPP_ARG(sc));
- i4bisppp_start(ifp);
-#endif
-}
-#endif /* I4BISPPPACCT */
-
-/*
- *===========================================================================*
- * SyncPPP layer interface routines
- *===========================================================================*
- */
-
-#if 0 /* never used ??? */
-/*---------------------------------------------------------------------------*
- * just an alias for i4bisppp_tls, but of type timeout_t
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_timeout(void *cookie)
-{
- i4bisppp_tls((struct sppp *)cookie);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * PPP this-layer-started action
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_tls(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
- struct ifnet *ifp = (struct ifnet *)sp;
-
- if(sc->sc_state == ST_CONNECTED)
- return;
-
- i4b_l4_dialout(BDRV_ISPPP, IFP2UNIT(ifp));
-}
-
-/*---------------------------------------------------------------------------*
- * PPP this-layer-finished action
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_tlf(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-/* call_desc_t *cd = sc->sc_cdp; */
- struct ifnet *ifp = (struct ifnet *)sp;
-
- if(sc->sc_state != ST_CONNECTED)
- return;
-
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
-
- i4b_l4_drvrdisc(BDRV_ISPPP, IFP2UNIT(ifp));
-}
-/*---------------------------------------------------------------------------*
- * PPP interface phase change
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_state_changed(struct sppp *sp, int new_state)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-
- i4b_l4_ifstate_changed(sc->sc_cdp, new_state);
-}
-
-/*---------------------------------------------------------------------------*
- * PPP control protocol negotiation complete (run ip-up script now)
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_negotiation_complete(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-
- i4b_l4_negcomplete(sc->sc_cdp);
-}
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_connect(int unit, void *cdp)
-{
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct sppp *sp = &sc->sc_if_un.scu_sp;
- int s = splimp();
-
- sc->sc_cdp = (call_desc_t *)cdp;
- sc->sc_state = ST_CONNECTED;
-
-#if I4BISPPPACCT
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_if.if_timer = I4BISPPPACCTINTVL;
-#endif
-
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
-
- sp->pp_up(sp); /* tell PPP we are ready */
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_disconnect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct sppp *sp = &sc->sc_if_un.scu_sp;
-
- int s = splimp();
-
- /* new stuff to check that the active channel is being closed */
- if (cd != sc->sc_cdp)
- {
-#ifdef I4BISPPPDISCDEBUG
- printf("i4bisppp_disconnect: isppp%d channel%d not active\n",
- cd->driver_unit, cd->channelid);
-#endif
- splx(s);
- return;
- }
-
-#if I4BISPPPACCT
- sc->sc_if.if_timer = 0;
-#endif
-
- i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_FINAL,
- sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-
- if (sc->sc_state == ST_CONNECTED)
- {
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
- sc->sc_cdp = (call_desc_t *)0;
- /* do thhis here because pp_down calls i4bisppp_tlf */
- sc->sc_state = ST_IDLE;
- sp->pp_down(sp); /* tell PPP we have hung up */
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is used to give a feedback from userland demon
- * in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_dialresponse(int unit, int status)
-{
-/* struct i4bisppp_softc *sc = &i4bisppp_softc[unit]; */
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_updown(int unit, int updown)
-{
- /* could probably do something useful here */
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_rx_data_rdy(int unit)
-{
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct mbuf *m;
- int s;
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.rcvif = &sc->sc_if;
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_if.if_lastchange);
-
- sc->sc_if.if_ipackets++;
- sc->sc_if.if_ibytes += m->m_pkthdr.len;
-
-#if I4BISPPPACCT
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
-#ifdef I4BISPPPDEBUG
- printf("i4bisppp_rx_data_ready: received packet!\n");
-#endif
-
-#if NBPFILTER > 0
-
-#ifdef __FreeBSD__
- if(sc->sc_if.if_bpf)
- bpf_mtap(&sc->sc_if, m);
-#endif /* __FreeBSD__ */
-
-#ifdef __NetBSD__
- if(sc->sc_if.if_bpf)
- bpf_mtap(sc->sc_if.if_bpf, m);
-#endif
-
-#endif /* NBPFILTER > 0 */
-
- s = splimp();
-
- sppp_input(&sc->sc_if, m);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_tx_queue_empty(int unit)
-{
- i4bisppp_start(&i4bisppp_softc[unit].sc_if);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted. It should
- * be used to implement an activity timeout mechanism.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_activity(int unit, int rxtx)
-{
- i4bisppp_softc[unit].sc_cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-i4bisppp_ret_linktab(int unit)
-{
- return(&i4bisppp_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-i4bisppp_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_init_linktab(int unit)
-{
- i4bisppp_drvr_linktab[unit].unit = unit;
- i4bisppp_drvr_linktab[unit].bch_rx_data_ready = i4bisppp_rx_data_rdy;
- i4bisppp_drvr_linktab[unit].bch_tx_queue_empty = i4bisppp_tx_queue_empty;
- i4bisppp_drvr_linktab[unit].bch_activity = i4bisppp_activity;
- i4bisppp_drvr_linktab[unit].line_connected = i4bisppp_connect;
- i4bisppp_drvr_linktab[unit].line_disconnected = i4bisppp_disconnect;
- i4bisppp_drvr_linktab[unit].dial_response = i4bisppp_dialresponse;
- i4bisppp_drvr_linktab[unit].updown_ind = i4bisppp_updown;
-}
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_rbch.c b/sys/i4b/driver/i4b_rbch.c
deleted file mode 100644
index 9cf432c98f29..000000000000
--- a/sys/i4b/driver/i4b_rbch.c
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_rbch.c - device driver for raw B channel data
- * ---------------------------------------------------
- *
- * $Id: i4b_rbch.c,v 1.23 1998/12/14 09:39:10 hm Exp $
- *
- * last edit-date: [Sun Dec 13 10:19:08 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4brbch.h"
-
-#if NI4BRBCH > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/poll.h>
-#else
-#include <sys/fcntl.h>
-#include <sys/ioctl.h>
-#endif
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001)
-#include <sys/filio.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __NetBSD__
-extern cc_t ttydefchars;
-#define termioschars(t) memcpy((t)->c_cc, &ttydefchars, sizeof((t)->c_cc))
-#endif
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __NetBSD__
-#include <sys/filio.h>
-#define bootverbose 0
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_debug.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_debug.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-/* initialized by L4 */
-
-static drvr_link_t rbch_drvr_linktab[NI4BRBCH];
-static isdn_link_t *isdn_linktab[NI4BRBCH];
-
-static struct rbch_softc {
- int sc_devstate; /* state of driver */
-#define ST_IDLE 0x00
-#define ST_CONNECTED 0x01
-#define ST_ISOPEN 0x02
-#define ST_RDWAITDATA 0x04
-#define ST_WRWAITEMPTY 0x08
-#define ST_NOBLOCK 0x10
-
- int sc_bprot; /* B-ch protocol used */
-
- call_desc_t *cd; /* Call Descriptor */
- struct termios it_in;
-
- struct ifqueue sc_hdlcq; /* hdlc read queue */
-#define I4BRBCHMAXQLEN 10
-
- struct selinfo selp; /* select / poll */
-
-#ifdef DEVFS
- void *devfs_token; /* device filesystem */
-#endif
-} rbch_softc[NI4BRBCH];
-
-static void rbch_rx_data_rdy(int unit);
-static void rbch_tx_queue_empty(int unit);
-static void rbch_connect(int unit, void *cdp);
-static void rbch_disconnect(int unit, void *cdp);
-static void rbch_init_linktab(int unit);
-static void rbch_clrq(int unit);
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-#define IOCTL_CMD_T u_long
-void i4brbchattach __P((void));
-int i4brbchopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4brbchclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4brbchread __P((dev_t dev, struct uio *uio, int ioflag));
-int i4brbchwrite __P((dev_t dev, struct uio *uio, int ioflag));
-int i4brbchioctl __P((dev_t dev, IOCTL_CMD_T cmd, caddr_t arg, int flag, struct proc* pr));
-int i4brbchpoll __P((dev_t dev, int events, struct proc *p));
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-#if !defined(__FreeBSD_version) || __FreeBSD_version < 300003
-#define IOCTL_CMD_T int
-#else
-#define IOCTL_CMD_T u_long
-#endif
-
-PDEVSTATIC d_open_t i4brbchopen;
-PDEVSTATIC d_close_t i4brbchclose;
-PDEVSTATIC d_read_t i4brbchread;
-PDEVSTATIC d_read_t i4brbchwrite;
-PDEVSTATIC d_ioctl_t i4brbchioctl;
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-PDEVSTATIC d_poll_t i4brbchpoll;
-#else
-PDEVSTATIC d_select_t i4brbchselect;
-#endif
-
-#define CDEV_MAJOR 57
-static struct cdevsw i4brbch_cdevsw = {
- i4brbchopen, i4brbchclose, i4brbchread, i4brbchwrite,
- i4brbchioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4brbchpoll, nommap, NULL, "i4brbch", NULL, -1
-#else
- i4brbchselect, nommap, NULL, "i4brbch", NULL, -1
-#endif
-};
-
-static void i4brbchattach(void *);
-PSEUDO_SET(i4brbchattach, i4b_rbch);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4brbchinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4brbch_cdevsw, NULL);
-}
-
-SYSINIT(i4brbchdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4brbchinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4brbchattach(void *dummy)
-#else
-i4brbchattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4brbch: %d raw B channel access device(s) attached\n", NI4BRBCH);
-#endif
-
- for(i=0; i < NI4BRBCH; i++)
- {
-#ifdef DEVFS
- rbch_softc[i].devfs_token =
- devfs_add_devswf(&i4brbch_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4brbch%d", i);
-#endif
- rbch_softc[i].sc_devstate = ST_IDLE;
- rbch_softc[i].sc_hdlcq.ifq_maxlen = I4BRBCHMAXQLEN;
- rbch_softc[i].it_in.c_ispeed = rbch_softc[i].it_in.c_ospeed = 64000;
- termioschars(&rbch_softc[i].it_in);
- rbch_init_linktab(i);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * open rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
-
- if(unit > NI4BRBCH)
- return(ENXIO);
-
- if(rbch_softc[unit].sc_devstate & ST_ISOPEN)
- return(EBUSY);
-
- rbch_clrq(unit);
-
- rbch_softc[unit].sc_devstate |= ST_ISOPEN;
-
- DBGL4(L4_RBCHDBG, "i4brbchopen", ("unit %d, open\n", unit));
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
-
- if (rbch_softc[unit].cd) {
- i4b_l4_disconnect_ind(rbch_softc[unit].cd);
- rbch_softc[unit].cd = NULL;
- }
- rbch_softc[unit].sc_devstate &= ~ST_ISOPEN;
-
- rbch_clrq(unit);
-
- DBGL4(L4_RBCHDBG, "i4brbclose", ("unit %d, close\n", unit));
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- int unit = minor(dev);
- struct ifqueue *iqp;
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, enter read\n", unit));
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, read while not open\n", unit));
- return(EIO);
- }
-
- if((rbch_softc[unit].sc_devstate & ST_NOBLOCK)) {
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- return(EWOULDBLOCK);
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(IF_QEMPTY(iqp) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- return(EWOULDBLOCK);
- } else {
- while(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, wait read init\n", unit));
-
- if((error = tsleep((caddr_t) &rbch_softc[unit],
- TTIPRI | PCATCH,
- "rrrbch", 0 )) != 0)
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d tsleep\n", unit, error));
- return(error);
- }
- }
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- while(IF_QEMPTY(iqp) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- s = splimp();
- rbch_softc[unit].sc_devstate |= ST_RDWAITDATA;
- splx(s);
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, wait read data\n", unit));
-
- if((error = tsleep((caddr_t) &isdn_linktab[unit]->rx_queue,
- TTIPRI | PCATCH,
- "rrbch", 0 )) != 0)
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d tsleep read\n", unit, error));
- rbch_softc[unit].sc_devstate &= ~ST_RDWAITDATA;
- return(error);
- }
- }
- }
-
- s = splimp();
-
- IF_DEQUEUE(iqp, m);
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, read %d bytes\n", unit, m->m_len));
-
- if(m && m->m_len)
- {
- error = uiomove(m->m_data, m->m_len, uio);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d uiomove\n", unit, error));
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchwrite(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- int unit = minor(dev);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write\n", unit));
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write while not open\n", unit));
- return(EIO);
- }
-
- if((rbch_softc[unit].sc_devstate & ST_NOBLOCK)) {
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- return(EWOULDBLOCK);
- if(IF_QFULL(isdn_linktab[unit]->tx_queue) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- return(EWOULDBLOCK);
- } else {
- while(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write wait init\n", unit));
-
- error = tsleep((caddr_t) &rbch_softc[unit],
- TTIPRI | PCATCH,
- "wrrbch", 0 );
- if(error == ERESTART)
- return (ERESTART);
- else if(error == EINTR) {
- printf("\n ========= i4brbchwrite, EINTR during wait init ======== \n");
- return(EINTR);
- } else if(error) {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, error %d tsleep init\n", unit, error));
- return(error);
- }
-/*XXX*/ tsleep((caddr_t) &rbch_softc[unit], TTIPRI | PCATCH, "xrbch", (hz*1));
- }
-
- while(IF_QFULL(isdn_linktab[unit]->tx_queue) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- s = splimp();
- rbch_softc[unit].sc_devstate |= ST_WRWAITEMPTY;
- splx(s);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write queue full\n", unit));
-
- if ((error = tsleep((caddr_t) &isdn_linktab[unit]->tx_queue,
- TTIPRI | PCATCH,
- "wrbch", 0)) != 0) {
- rbch_softc[unit].sc_devstate &= ~ST_WRWAITEMPTY;
- if(error == ERESTART) {
- return(ERESTART);
- } else if(error == EINTR) {
- printf("\n ========= i4brbchwrite, EINTR during wait write ======== \n");
- return(error);
- } else if(error) {
- DBGL4(L4_RBCHDBG, "i4brbchwrite",
- ("unit %d, error %d tsleep write\n", unit, error));
- return(error);
- }
- }
- }
- }
-
- s = splimp();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, not open anymore\n", unit));
- splx(s);
- return(EIO);
- }
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write %d bytes\n", unit, m->m_len));
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- (*isdn_linktab[unit]->bch_tx_start)(isdn_linktab[unit]->unit, isdn_linktab[unit]->channel);
- }
-
- splx(s);
-
- return(error);
-}
-
-PDEVSTATIC int
-i4brbchioctl(dev_t dev, IOCTL_CMD_T cmd, caddr_t data, int flag, struct proc* p) {
- int error = 0;
- int unit = minor(dev);
-
- switch(cmd)
- {
-#if 0
- case I4B_RBCH_DIALOUT:
-if(bootverbose)printf("EE-rbch%d: attempting dialout (ioctl)\n", unit);
- i4b_l4_dialout(BDRV_RBCH, unit);
- break;
-#endif
-
- case FIOASYNC: /* Set async mode */
- if (*(int *)data) {
-if(bootverbose)printf("EE-rbch%d: setting async mode\n", unit);
- } else {
-if(bootverbose)printf("EE-rbch%d: clearing async mode\n", unit);
- }
- break;
- case FIONBIO:
- if (*(int *)data) {
-if(bootverbose)printf("EE-rbch%d: setting non-blocking mode\n", unit);
- rbch_softc[unit].sc_devstate |= ST_NOBLOCK;
- } else {
-if(bootverbose)printf("EE-rbch%d: clearing non-blocking mode\n", unit);
- rbch_softc[unit].sc_devstate &= ~ST_NOBLOCK;
- }
- break;
- case TIOCCDTR: /* Clear DTR */
- if(rbch_softc[unit].sc_devstate & ST_CONNECTED) {
-if(bootverbose)printf("EE-rbch%d: disconnecting for DTR down\n", unit);
- i4b_l4_disconnect_ind(rbch_softc[unit].cd);
- }
- break;
- case TIOCSDTR: /* Set DTR */
-if(bootverbose)printf("EE-rbch%d: attempting dialout (DTR)\n", unit);
- i4b_l4_dialout(BDRV_RBCH, unit);
- break;
- case TIOCSETA: /* Set termios struct */
- break;
- case TIOCGETA: /* Get termios struct */
- *(struct termios *)data = rbch_softc[unit].it_in;
- break;
- case TIOCMGET:
- *(int *)data = TIOCM_LE|TIOCM_DTR|TIOCM_RTS|TIOCM_CTS|TIOCM_DSR;
- if (rbch_softc[unit].sc_devstate & ST_CONNECTED)
- *(int *)data |= TIOCM_CD;
- break;
- default: /* Unknown stuff */
- printf("\n ========= i4brbch%d - ioctl, unknown cmd %lx ==================== \n",
- unit,
- (u_long)cmd);
- error = EINVAL;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * device driver poll
- *---------------------------------------------------------------------------*/
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-
-PDEVSTATIC int
-i4brbchpoll(dev_t dev, int events, struct proc *p)
-{
- int revents = 0; /* Events we found */
- int s;
- int unit = minor(dev);
-
- /* We can't check for anything but IN or OUT */
-
- if((events & (POLLIN|POLLOUT)) == 0)
- return(POLLNVAL);
-
- s = splhigh();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- splx(s);
- return(POLLNVAL);
- }
-
- /*
- * Writes are OK if we are connected and the
- * transmit queue can take them
- */
-
- if((events & POLLOUT) &&
- (rbch_softc[unit].sc_devstate & ST_CONNECTED) &&
- !IF_QFULL(isdn_linktab[unit]->tx_queue))
- {
- revents |= POLLOUT;
- }
-
- /* ... while reads are OK if we have any data */
-
- if((events & POLLIN) &&
- (rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- struct ifqueue *iqp;
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(!IF_QEMPTY(iqp))
- revents |= POLLIN;
- }
-
- if(revents == 0)
- selrecord(p, &rbch_softc[unit].selp);
-
- splx(s);
- return(revents);
-}
-
-#else
-
-/*---------------------------------------------------------------------------*
- * device driver select
- *---------------------------------------------------------------------------*/
-static int
-i4brbchselect(dev_t dev, int rw, struct proc *p)
-{
- int unit = minor(dev);
- int s;
-
- s = splhigh();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- splx(s);
- DBGL4(L4_RBCHDBG, "i4brbchselect", ("unit %d, not open anymore\n", unit));
- return(1);
- }
-
- if(rbch_softc[unit].sc_devstate & ST_CONNECTED)
- {
- struct ifqueue *iqp;
-
- switch(rw)
- {
- case FREAD:
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(!IF_QEMPTY(iqp))
- return(1);
- break;
-
- case FWRITE:
- if(!IF_QFULL(isdn_linktab[unit]->rx_queue))
- return(1);
- break;
-
- default:
- return 0;
- }
- }
- selrecord(p, &rbch_softc[unit].selp);
- return(0);
-}
-
-#endif /* defined(__FreeBSD_version) && __FreeBSD_version >= 300001 */
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-rbch_connect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
-
- rbch_softc[unit].sc_bprot = cd->bprot;
-
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "rbch_connect", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate |= ST_CONNECTED;
- rbch_softc[unit].cd = cdp;
- wakeup((caddr_t) &rbch_softc[unit]);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-rbch_disconnect(int unit, void *cdp)
-{
- /* call_desc_t *cd = (call_desc_t *)cdp; */
-
- DBGL4(L4_RBCHDBG, "rbch_disconnect", ("unit %d, deinit\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_CONNECTED;
- rbch_softc[unit].cd = NULL;
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-rbch_dialresponse(int unit, int status)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-rbch_updown(int unit, int updown)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and is to be put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-rbch_rx_data_rdy(int unit)
-{
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- {
- register struct mbuf *m;
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.len = m->m_len;
-
- if(IF_QFULL(&(rbch_softc[unit].sc_hdlcq)))
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d: hdlc rx queue full!\n", unit));
- m_freem(m);
- }
- else
- {
- IF_ENQUEUE(&(rbch_softc[unit].sc_hdlcq), m);
- }
- }
-
- if(rbch_softc[unit].sc_devstate & ST_RDWAITDATA)
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &isdn_linktab[unit]->rx_queue);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d, NO wakeup\n", unit));
- }
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-rbch_tx_queue_empty(int unit)
-{
- if(rbch_softc[unit].sc_devstate & ST_WRWAITEMPTY)
- {
- DBGL4(L4_RBCHDBG, "rbch_tx_queue_empty", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &isdn_linktab[unit]->tx_queue);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "rbch_tx_queue_empty", ("unit %d, NO wakeup\n", unit));
- }
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted
- *---------------------------------------------------------------------------*/
-static void
-rbch_activity(int unit, int rxtx)
-{
- if (rbch_softc[unit].cd)
- rbch_softc[unit].cd->last_active_time = SECOND;
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * clear an hdlc rx queue for a rbch unit
- *---------------------------------------------------------------------------*/
-static void
-rbch_clrq(int unit)
-{
- int x;
- struct mbuf *m;
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&rbch_softc[unit].sc_hdlcq, m);
- splx(x);
- if(m)
- m_freem(m);
- else
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-rbch_ret_linktab(int unit)
-{
- rbch_init_linktab(unit);
- return(&rbch_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-rbch_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-rbch_init_linktab(int unit)
-{
- rbch_drvr_linktab[unit].unit = unit;
- rbch_drvr_linktab[unit].bch_rx_data_ready = rbch_rx_data_rdy;
- rbch_drvr_linktab[unit].bch_tx_queue_empty = rbch_tx_queue_empty;
- rbch_drvr_linktab[unit].bch_activity = rbch_activity;
- rbch_drvr_linktab[unit].line_connected = rbch_connect;
- rbch_drvr_linktab[unit].line_disconnected = rbch_disconnect;
- rbch_drvr_linktab[unit].dial_response = rbch_dialresponse;
- rbch_drvr_linktab[unit].updown_ind = rbch_updown;
-}
-
-/*===========================================================================*/
-
-#endif /* NI4BRBCH > 0 */
diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c
deleted file mode 100644
index 81b38a614b06..000000000000
--- a/sys/i4b/driver/i4b_tel.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tel.c - device driver for ISDN telephony
- * --------------------------------------------
- *
- * $Id: i4b_tel.c,v 1.18 1998/12/14 10:31:53 hm Exp $
- *
- * last edit-date: [Mon Dec 14 11:32:06 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4btel.h"
-
-#if NI4BTEL > 0
-
-#undef I4BTELDEBUG
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_tel_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_tel_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-typedef struct {
- drvr_link_t drvr_linktab; /* driver linktab */
- isdn_link_t *isdn_linktab; /* isdn linktab */
- int devstate; /* state of this unit */
-#define ST_IDLE 0x00 /* idle */
-#define ST_CONNECTED 0x01 /* isdn connected state */
-#define ST_ISOPEN 0x02 /* userland opened */
-#define ST_RDWAITDATA 0x04 /* userland read waiting */
-#define ST_WRWAITEMPTY 0x08 /* userland write waiting */
- int audiofmt; /* audio format conversion */
- call_desc_t *cdp; /* call descriptor pointer */
-#ifdef DEVFS
- void *devfs_token; /* token for DEVFS */
-#endif
-} tel_sc_t;
-
-static tel_sc_t tel_sc[NI4BTEL];
-
-/* forward decl */
-
-static void tel_rx_data_rdy(int unit);
-static void tel_tx_queue_empty(int unit);
-static void tel_init_linktab(int unit);
-static void tel_connect(int unit, void *cdp);
-static void tel_disconnect(int unit, void *cdp);
-
-static unsigned char alaw_ulaw[];
-static unsigned char ulaw_alaw[];
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-PDEVSTATIC void i4btelattach __P((void));
-PDEVSTATIC int i4btelioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-int i4btelopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btelclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btelread __P((dev_t dev, struct uio *uio, int ioflag));
-int i4btelwrite __P((dev_t dev, struct uio * uio, int ioflag));
-#endif
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-PDEVSTATIC d_open_t i4btelopen;
-PDEVSTATIC d_close_t i4btelclose;
-PDEVSTATIC d_read_t i4btelread;
-PDEVSTATIC d_read_t i4btelwrite;
-PDEVSTATIC d_ioctl_t i4btelioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC d_poll_t i4btelpoll;
-#endif
-
-#define CDEV_MAJOR 56
-static struct cdevsw i4btel_cdevsw = {
- i4btelopen, i4btelclose, i4btelread, i4btelwrite,
- i4btelioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4btelpoll, nommap, NULL, "i4btel", NULL, -1
-#else
- noselect, nommap, NULL, "i4btel", NULL, -1
-#endif
-};
-
-PDEVSTATIC void i4btelinit(void *unused);
-
-PDEVSTATIC void i4btelattach(void *);
-PSEUDO_SET(i4btelattach, i4b_tel);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-i4btelinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4btel_cdevsw, NULL);
-}
-
-SYSINIT(i4bteldev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btelinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4btelattach(void *dummy)
-#else
-i4btelattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4btel: %d ISDN telephony interface device(s) attached\n", NI4BTEL);
-#endif
-
- for(i=0; i < NI4BTEL; i++)
- {
- tel_sc[i].devstate = ST_IDLE;
- tel_sc[i].audiofmt = CVT_NONE;
- tel_init_linktab(i);
-#ifdef DEVFS
- tel_sc[i].devfs_token
- = devfs_add_devswf(&i4btel_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4btel%d", i);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * open tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- tel_sc_t *sc;
-
- if(unit > NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(sc->devstate & ST_ISOPEN)
- return(EBUSY);
-
- sc->devstate |= ST_ISOPEN;
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- tel_sc_t *sc;
- int error = 0;
-
- if(unit > NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit];
-
- if(sc->isdn_linktab != NULL && sc->isdn_linktab->tx_queue != NULL)
- {
- while(!(IF_QEMPTY(sc->isdn_linktab->tx_queue)))
- {
- sc->devstate |= ST_WRWAITEMPTY;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
- TTIPRI | PCATCH, "wtcl", 0)) != 0)
- {
- break;
- }
- }
- sc->devstate &= ~ST_WRWAITEMPTY;
- }
- sc->devstate &= ~ST_ISOPEN;
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * i4btelioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300003
-i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4btelioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- int error = 0;
- struct mbuf *m;
- int s;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- switch(cmd)
- {
- case I4B_TEL_GETAUDIOFMT:
- *(int *)data = sc->audiofmt;
- break;
-
- case I4B_TEL_SETAUDIOFMT:
- sc->audiofmt = *(int *)data;
- break;
-
- case I4B_TEL_EMPTYINPUTQUEUE:
- s = splimp();
- while((sc->devstate & ST_CONNECTED) &&
- (sc->devstate & ST_ISOPEN) &&
- !IF_QEMPTY(sc->isdn_linktab->rx_queue))
- {
- IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
- if(m)
- i4b_Bfreembuf(m);
- }
- splx(s);
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * read from tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(!(sc->devstate & ST_ISOPEN))
- return(EIO);
-
-#ifdef NOTDEF
- while(!(sc->devstate & ST_CONNECTED))
- {
- if((error = tsleep((caddr_t) &sc->devstate,
- TTIPRI | PCATCH,
- "rrtel", 0 )) != 0)
- {
- return(error);
- }
- }
-#endif
-
- while(IF_QEMPTY(sc->isdn_linktab->rx_queue) &&
- (sc->devstate & ST_ISOPEN) &&
- (sc->devstate & ST_CONNECTED))
- {
- sc->devstate |= ST_RDWAITDATA;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->rx_queue,
- TTIPRI | PCATCH,
- "rtel", 0 )) != 0)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- return(EIO);
- }
-
- s = splimp();
-
- IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
-
- if(m && m->m_len)
- {
- if(sc->audiofmt == CVT_ALAW2ULAW)
- {
- int i;
- for(i = 0; i < m->m_len; i++)
- m->m_data[i] = alaw_ulaw[(int)m->m_data[i]];
- }
- error = uiomove(m->m_data, m->m_len, uio);
- }
- else
- {
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelwrite(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
-#ifdef NOTDEF
- while(!(sc->devstate & ST_CONNECTED))
- {
- if((error = tsleep((caddr_t) &sc->devstate,
- TTIPRI | PCATCH,
- "wrtel", 0 )) != 0)
- {
- return(error);
- }
-
- /*
- * XXX the originations B channel gets much earlier
- * switched thru than the destinations B channel, so
- * if the origination starts to send at once, some
- * 200 bytes (at my site) or so get lost, so i delay
- * a bit before sending. (-hm)
- */
-
- tsleep((caddr_t) &sc->devstate, TTIPRI | PCATCH, "xtel", (hz*1));
- }
-#endif
-
- while((IF_QFULL(sc->isdn_linktab->tx_queue)) &&
- (sc->devstate & ST_ISOPEN))
- {
- sc->devstate |= ST_WRWAITEMPTY;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
- TTIPRI | PCATCH, "wtel", 0)) != 0)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- return(EIO);
- }
-
- s = splimp();
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- if(sc->audiofmt == CVT_ALAW2ULAW)
- {
- int i;
- for(i = 0; i < m->m_len; i++)
- m->m_data[i] = ulaw_alaw[(int)m->m_data[i]];
- }
-
- IF_ENQUEUE(sc->isdn_linktab->tx_queue, m);
-
- (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
- }
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * poll
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC int
-i4btelpoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
-* this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-tel_connect(int unit, void *cdp)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->cdp = (call_desc_t *)cdp;
-
-#ifdef NOTDEF
- if(!(sc->devstate & ST_CONNECTED))
- {
- sc->devstate |= ST_CONNECTED;
- wakeup((caddr_t) &sc->devstate);
- }
-#else
- sc->devstate |= ST_CONNECTED;
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-tel_disconnect(int unit, void *cdp)
-{
-/* call_desc_t *cd = (call_desc_t *)cdp; */
-
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->devstate &= ~ST_CONNECTED;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
- }
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-tel_dialresponse(int unit, int status)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-tel_updown(int unit, int updown)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-tel_rx_data_rdy(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-tel_tx_queue_empty(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted.
- *---------------------------------------------------------------------------*/
-static void
-tel_activity(int unit, int rxtx)
-{
- tel_sc[unit].cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-tel_ret_linktab(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- tel_init_linktab(unit);
- return(&sc->drvr_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-tel_set_linktab(int unit, isdn_link_t *ilt)
-{
- tel_sc_t *sc = &tel_sc[unit];
- sc->isdn_linktab = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-tel_init_linktab(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->drvr_linktab.unit = unit;
- sc->drvr_linktab.bch_rx_data_ready = tel_rx_data_rdy;
- sc->drvr_linktab.bch_tx_queue_empty = tel_tx_queue_empty;
- sc->drvr_linktab.bch_activity = tel_activity;
- sc->drvr_linktab.line_connected = tel_connect;
- sc->drvr_linktab.line_disconnected = tel_disconnect;
- sc->drvr_linktab.dial_response = tel_dialresponse;
- sc->drvr_linktab.updown_ind = tel_updown;
-}
-
-/*===========================================================================*
- * AUDIO FORMAT CONVERSION
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * A-law to mu-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char alaw_ulaw[] = {
- 0x002a, 0x00a9, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0048, 0x00c8,
- 0x0039, 0x00b9, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d7,
- 0x0022, 0x00a1, 0x005b, 0x00dd, 0x001f, 0x009f, 0x0040, 0x00c0,
- 0x0031, 0x00b1, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00cf,
- 0x002e, 0x00ad, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004c, 0x00cc,
- 0x003d, 0x00bd, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00db,
- 0x0026, 0x00a5, 0x005d, 0x00df, 0x001f, 0x009f, 0x0044, 0x00c4,
- 0x0035, 0x00b5, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d3,
- 0x0028, 0x00a7, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0046, 0x00c6,
- 0x0037, 0x00b7, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0053, 0x00d5,
- 0x0020, 0x009f, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x002f, 0x00af, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004d, 0x00ce,
- 0x002c, 0x00ab, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004a, 0x00ca,
- 0x003b, 0x00bb, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0057, 0x00d9,
- 0x0024, 0x00a3, 0x005d, 0x00df, 0x001f, 0x009f, 0x0042, 0x00c2,
- 0x0033, 0x00b3, 0x006b, 0x00ef, 0x001f, 0x009f, 0x004f, 0x00d1,
- 0x002b, 0x00aa, 0x0063, 0x00e3, 0x001f, 0x009f, 0x0049, 0x00c9,
- 0x003a, 0x00ba, 0x0077, 0x00f7, 0x001f, 0x009f, 0x0057, 0x00d7,
- 0x0023, 0x00a2, 0x005d, 0x00dd, 0x001f, 0x009f, 0x0041, 0x00c1,
- 0x0032, 0x00b2, 0x006b, 0x00eb, 0x001f, 0x009f, 0x004f, 0x00cf,
- 0x002f, 0x00ae, 0x0067, 0x00e7, 0x001f, 0x009f, 0x004d, 0x00cd,
- 0x003e, 0x00be, 0x00ff, 0x00ff, 0x001f, 0x009f, 0x005b, 0x00db,
- 0x0027, 0x00a6, 0x005f, 0x00df, 0x001f, 0x009f, 0x0045, 0x00c5,
- 0x0036, 0x00b6, 0x006f, 0x00ef, 0x001f, 0x009f, 0x0053, 0x00d3,
- 0x0029, 0x00a8, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0047, 0x00c7,
- 0x0038, 0x00b8, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d5,
- 0x0021, 0x00a0, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x0030, 0x00b0, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00ce,
- 0x002d, 0x00ac, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004b, 0x00cb,
- 0x003c, 0x00bc, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00d9,
- 0x0025, 0x00a4, 0x005d, 0x00df, 0x001f, 0x009f, 0x0043, 0x00c3,
- 0x0034, 0x00b4, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d1
-};
-
-/*---------------------------------------------------------------------------*
- * mu-law to A-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char ulaw_alaw[] = {
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00ac,
- 0x0050, 0x00d0, 0x0010, 0x0090, 0x0070, 0x00f0, 0x0030, 0x00b0,
- 0x0040, 0x00c0, 0x0000, 0x0080, 0x0060, 0x00e0, 0x0020, 0x00a0,
- 0x00d8, 0x0018, 0x0098, 0x0078, 0x00f8, 0x0038, 0x00b8, 0x0048,
- 0x00c8, 0x0008, 0x0088, 0x0068, 0x00e8, 0x0028, 0x00a8, 0x00d6,
- 0x0096, 0x0076, 0x00f6, 0x0036, 0x00b6, 0x0046, 0x00c6, 0x0006,
- 0x0086, 0x0066, 0x00e6, 0x0026, 0x00a6, 0x00de, 0x009e, 0x00fe,
- 0x00fe, 0x00be, 0x00be, 0x00ce, 0x00ce, 0x008e, 0x008e, 0x00ee,
- 0x00ee, 0x00d2, 0x00d2, 0x00f2, 0x00f2, 0x00c2, 0x00c2, 0x00e2,
- 0x00e2, 0x00e2, 0x00da, 0x00da, 0x00da, 0x00da, 0x00fa, 0x00fa,
- 0x00fa, 0x00fa, 0x00ca, 0x00ca, 0x00ca, 0x00ca, 0x00ea, 0x00ea,
- 0x00ea, 0x00ea, 0x00ea, 0x00ea, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00d1, 0x0011, 0x0091, 0x0071, 0x00f1, 0x0031, 0x00b1, 0x0041,
- 0x00c1, 0x0001, 0x0081, 0x0061, 0x00e1, 0x0021, 0x00a1, 0x0059,
- 0x00d9, 0x0019, 0x0099, 0x0079, 0x00f9, 0x0039, 0x00b9, 0x0049,
- 0x00c9, 0x0009, 0x0089, 0x0069, 0x00e9, 0x0029, 0x00a9, 0x0057,
- 0x0017, 0x0097, 0x0077, 0x00f7, 0x0037, 0x00b7, 0x0047, 0x00c7,
- 0x0007, 0x0087, 0x0067, 0x00e7, 0x0027, 0x00a7, 0x00df, 0x009f,
- 0x009f, 0x00ff, 0x00ff, 0x00bf, 0x00bf, 0x00cf, 0x00cf, 0x008f,
- 0x008f, 0x00ef, 0x00ef, 0x00af, 0x00af, 0x00d3, 0x00d3, 0x00f3,
- 0x00f3, 0x00f3, 0x00c3, 0x00c3, 0x00c3, 0x00c3, 0x00e3, 0x00e3,
- 0x00e3, 0x00e3, 0x00db, 0x00db, 0x00db, 0x00db, 0x00fb, 0x00fb,
- 0x00fb, 0x00fb, 0x00fb, 0x00fb, 0x00cb, 0x00cb, 0x00cb, 0x00cb,
- 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x00eb, 0x00eb, 0x00eb, 0x00eb
-};
-
-/*===========================================================================*/
-
-#endif /* NI4BTEL > 0 */
diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c
deleted file mode 100644
index f64e35d622fd..000000000000
--- a/sys/i4b/driver/i4b_trace.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4btrc - device driver for trace data read device
- * ---------------------------------------------------
- *
- * $Id: i4b_trace.c,v 1.14 1998/12/05 18:02:51 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:01:53 1998]
- *
- * NOTE: the code assumes that SPLI4B >= splimp !
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4btrc.h"
-
-#if NI4BTRC > 0
-
-#ifdef __FreeBSD__
-#include "isic.h" /* 'isic' is no pseudo-device on non FreeBSD -
- * so we just can't count it at compile time,
- * we're doing an attach-time check instead. */
-
-#if NI4BTRC < NISIC
-#error "number of trace devices != number of passive ISDN controllers !"
-#error "change number of i4btrc to be equal to number of isic devices !"
-#endif
-#endif /* __FreeBSD__ */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_trace.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_trace.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#ifndef __FreeBSD__
-#define memcpy(d,s,l) bcopy(s,d,l)
-#endif
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-static struct ifqueue trace_queue[NI4BTRC];
-static int device_state[NI4BTRC];
-#define ST_IDLE 0x00
-#define ST_ISOPEN 0x01
-#define ST_WAITDATA 0x02
-#ifdef DEVFS
-static void *devfs_token[NI4BTRC];
-#endif
-
-static int analyzemode = 0;
-static int rxunit = -1;
-static int txunit = -1;
-static int outunit = -1;
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-void i4btrcattach __P((void));
-int i4btrcopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btrcclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btrcread __P((dev_t dev, struct uio * uio, int ioflag));
-int i4btrcioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-static d_open_t i4btrcopen;
-static d_close_t i4btrcclose;
-static d_read_t i4btrcread;
-static d_ioctl_t i4btrcioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-static d_poll_t i4btrcpoll;
-#endif
-
-#define CDEV_MAJOR 59
-static struct cdevsw i4btrc_cdevsw = {
- i4btrcopen, i4btrcclose, i4btrcread, nowrite,
- i4btrcioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4btrcpoll, nommap, NULL, "i4btrc", NULL, -1
-#else
- noselect, nommap, NULL, "i4btrc", NULL, -1
-#endif
-};
-
-/*---------------------------------------------------------------------------*
- * interface init routine
- *---------------------------------------------------------------------------*/
-static
-void i4btrcinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4btrc_cdevsw, NULL);
-}
-
-SYSINIT(i4btrcdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btrcinit, NULL);
-
-static void i4btrcattach(void *);
-PSEUDO_SET(i4btrcattach, i4b_trace);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-int get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf);
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4btrcattach(void *dummy)
-#else
-i4btrcattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4btrc: %d ISDN trace device(s) attached\n", NI4BTRC);
-#endif
-
- for(i=0; i < NI4BTRC; i++)
- {
-#ifdef DEVFS
- devfs_token[i]
- = devfs_add_devswf(&i4btrc_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4btrc%d", i);
-#endif
- trace_queue[i].ifq_maxlen = IFQ_MAXLEN;
- device_state[i] = ST_IDLE;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * get_trace_data_from_l1()
- * ------------------------
- * is called from layer 1, adds timestamp to trace data and puts
- * it into a queue, from which it can be read from the i4btrc
- * device. The unit number in the trace header selects the minor
- * device's queue the data is put into.
- *---------------------------------------------------------------------------*/
-int
-get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf)
-{
- struct mbuf *m;
- int x;
- int unit;
- int trunc = 0;
- int totlen = len + sizeof(i4b_trace_hdr_t);
-
- /*
- * for telephony (or better non-HDLC HSCX mode) we get
- * (MCLBYTE + sizeof(i4b_trace_hdr_t)) length packets
- * to put into the queue to userland. because of this
- * we detect this situation, strip the length to MCLBYTES
- * max size, and infor the userland program of this fact
- * by putting the no of truncated bytes into hdr->trunc.
- */
-
- if(totlen > MCLBYTES)
- {
- trunc = 1;
- hdr->trunc = totlen - MCLBYTES;
- totlen = MCLBYTES;
- }
- else
- {
- hdr->trunc = 0;
- }
-
- /* set length of trace record */
-
- hdr->length = totlen;
-
- /* check valid unit no */
-
- if((unit = hdr->unit) > NI4BTRC)
- {
- printf("i4b_trace: get_trace_data_from_l1 - unit > NI4BTRC!\n");
- return(0);
- }
-
- /* get mbuf */
-
- if(!(m = i4b_Bgetmbuf(totlen)))
- {
- printf("i4b_trace: get_trace_data_from_l1 - i4b_getmbuf() failed!\n");
- return(0);
- }
-
- /* check if we are in analyzemode */
-
- if(analyzemode && (unit == rxunit || unit == txunit))
- {
- if(unit == rxunit)
- hdr->dir = FROM_NT;
- else
- hdr->dir = FROM_TE;
- unit = outunit;
- }
-
- if(IF_QFULL(&trace_queue[unit]))
- {
- struct mbuf *m1;
-
- x = SPLI4B();
- IF_DEQUEUE(&trace_queue[unit], m1);
- splx(x);
-
- i4b_Bfreembuf(m1);
- }
-
- /* copy trace header */
- memcpy(m->m_data, hdr, sizeof(i4b_trace_hdr_t));
-
- /* copy trace data */
- if(trunc)
- memcpy(&m->m_data[sizeof(i4b_trace_hdr_t)], buf, totlen-sizeof(i4b_trace_hdr_t));
- else
- memcpy(&m->m_data[sizeof(i4b_trace_hdr_t)], buf, len);
-
- x = SPLI4B();
-
- IF_ENQUEUE(&trace_queue[unit], m);
-
- if(device_state[unit] & ST_WAITDATA)
- {
- device_state[unit] &= ~ST_WAITDATA;
- wakeup((caddr_t) &trace_queue[unit]);
- }
-
- splx(x);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * open trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x;
- int unit = minor(dev);
-
- if(unit > NI4BTRC)
- return(ENXIO);
-
- if(device_state[unit] & ST_ISOPEN)
- return(EBUSY);
-
- if(analyzemode && (unit == outunit || unit == rxunit || unit == txunit))
- return(EBUSY);
-
- x = SPLI4B();
-
- device_state[unit] = ST_ISOPEN;
-
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- int i, x, cno = -1;
-
- for(i = 0; i < nctrl; i++)
- {
- if(ctrl_desc[i].N_SET_TRACE)
- {
- cno = i;
- break;
- }
- }
-
- if(analyzemode && (unit == outunit))
- {
- analyzemode = 0;
- outunit = -1;
-
- if(cno >= 0)
- {
- ctrl_desc[cno].N_SET_TRACE(rxunit, TRACE_OFF);
- ctrl_desc[cno].N_SET_TRACE(txunit, TRACE_OFF);
- }
- rxunit = -1;
- txunit = -1;
- }
-
- if(cno >= 0)
- {
- ctrl_desc[cno].N_SET_TRACE(unit, TRACE_OFF);
- }
-
- x = SPLI4B();
- device_state[unit] = ST_IDLE;
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcread(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int x;
- int error = 0;
- int unit = minor(dev);
-
- if(!(device_state[unit] & ST_ISOPEN))
- return(EIO);
-
- x = SPLI4B();
-
- while(IF_QEMPTY(&trace_queue[unit]) && (device_state[unit] & ST_ISOPEN))
- {
- device_state[unit] |= ST_WAITDATA;
-
- if((error = tsleep((caddr_t) &trace_queue[unit],
- TTIPRI | PCATCH,
- "bitrc", 0 )) != 0)
- {
- device_state[unit] &= ~ST_WAITDATA;
- splx(x);
- return(error);
- }
- }
-
- IF_DEQUEUE(&trace_queue[unit], m);
-
- if(m && m->m_len)
- error = uiomove(m->m_data, m->m_len, uio);
- else
- error = EIO;
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(x);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * poll device
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC int
-i4btrcpoll(dev_t dev, int events, struct proc *p)
-{
- return(ENODEV);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4btrcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- int error = 0;
- int unit = minor(dev);
- i4b_trace_setupa_t *tsa;
- int i, cno = -1;
-
- /* find the first passive controller to get at the set/get function
- pointers. Would be better if we had the controller class virtual
- function table separate from the port registry... */
-
- for(i=0; i < nctrl; i++)
- {
- if(ctrl_desc[i].N_SET_TRACE)
- {
- cno = i; /* one suitable controller, might not */
- break; /* be related to the trace unit at all, but */
- } /* has the right function pointers */
- }
-
- switch(cmd)
- {
- case I4B_TRC_GET:
- if(cno < 0)
- return ENOTTY;
- *(int *)data = ctrl_desc[cno].N_GET_TRACE(unit);
- break;
-
- case I4B_TRC_SET:
- if(cno < 0)
- return ENOTTY;
- ctrl_desc[cno].N_SET_TRACE(unit, *(int *)data);
- break;
-
- case I4B_TRC_SETA:
- tsa = (i4b_trace_setupa_t *)data;
-
- if(tsa->rxunit >= 0 && tsa->rxunit < NI4BTRC)
- rxunit = tsa->rxunit;
- else
- error = EINVAL;
-
- if(tsa->txunit >= 0 && tsa->txunit < NI4BTRC)
- txunit = tsa->txunit;
- else
- error = EINVAL;
-
- if(error)
- {
- outunit = -1;
- rxunit = -1;
- txunit = -1;
- }
- else
- {
- if(cno < 0)
- return ENOTTY;
-
- outunit = unit;
- analyzemode = 1;
- ctrl_desc[cno].N_SET_TRACE(rxunit, tsa->rxflags & (TRACE_I | TRACE_D_RX | TRACE_B_RX));
- ctrl_desc[cno].N_SET_TRACE(txunit, tsa->txflags & (TRACE_I | TRACE_D_RX | TRACE_B_RX));
- }
- break;
-
- case I4B_TRC_RESETA:
- analyzemode = 0;
- outunit = -1;
- rxunit = -1;
- txunit = -1;
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-#endif /* NI4BTRC > 0 */
diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h
deleted file mode 100644
index 739d78d6b3ed..000000000000
--- a/sys/i4b/include/i4b_global.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_global.h - i4b global include file
- * --------------------------------------
- *
- * $Id: i4b_global.h,v 1.17 1998/12/05 18:02:53 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:03:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_GLOBAL_H_
-#define _I4B_GLOBAL_H_
-
-#define SPLI4B() splimp() /* spl for i4b */
-
-#define TIMER_IDLE 1 /* a timer is running */
-#define TIMER_ACTIVE 2 /* a timer is idle */
-
-#ifdef __FreeBSD__
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-
-#define TIMEOUT_FUNC_T timeout_t *
-#define SECOND time_second
-#define MICROTIME(x) getmicrotime(&(x))
-
-#else /* FreeBSD < 3 */
-
-#define TIMEOUT_FUNC_T timeout_func_t
-#define SECOND time.tv_sec
-#define MICROTIME(x) microtime(&(x))
-
-#endif /* >= 3 */
-#endif /* __FreeBSD__ */
-
-#if defined(__NetBSD__) || defined (__OpenBSD__)
-
-#define TIMEOUT_FUNC_T void *
-#define SECOND time.tv_sec
-#define MICROTIME(x) (x) = time
-
-#endif /* __NetBSD__ */
-
-/* definitions for the STATUS indications L1 -> L2 -> L3 */
-
-#define STI_ATTACH 0 /* attach at boot time */
-#define STI_L1STAT 1 /* layer 1 status */
-#define STI_L2STAT 2 /* layer 2 status */
-#define STI_TEIASG 3 /* TEI assignments */
-#define STI_PDEACT 4 /* Layer 1 T4 expired = persistent deactivation */
-#define STI_NOL1ACC 5 /* no outgoing L1 access possible */
-
-/* definitions for the COMMAND requests L3 -> L2 -> L1 */
-
-#define CMR_DOPEN 0 /* daemon opened /dev/i4b */
-#define CMR_DCLOSE 1 /* daemon closed /dev/i4b */
-
-/*---------------------------------------------------------------------------
- *
- * Number of max supported passive card units
- *
- * Teles/Creatix/Neuhaus cards have a hardware limitation
- * as one is able to set 3 (sometimes 4) different configurations by
- * jumpers so a maximum of 3 (4) cards per ISA bus is possible.
- * (Note: there are multiple ISA buses on some architectures)
- *
- *---------------------------------------------------------------------------*/
-#define ISIC_MAXUNIT 3 /* max no of supported units 0..3 */
-
-#endif /* _I4B_GLOBAL_H_ */
diff --git a/sys/i4b/include/i4b_isdnq931.h b/sys/i4b/include/i4b_isdnq931.h
deleted file mode 100644
index bdc77f08c660..000000000000
--- a/sys/i4b/include/i4b_isdnq931.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isdnq931.h - DSS1 layer 3 message types
- * -------------------------------------------
- *
- * $Id: i4b_isdnq931.h,v 1.4 1998/12/05 18:02:54 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:01 1998]
- *
- *---------------------------------------------------------------------------*/
-
-/* protocol discriminators */
-
-#define PD_Q931 0x08 /* Q.931/I.451 */
-
-/* Q.931 single octett information element identifiers */
-
-#define IEI_SENDCOMPL 0xa1 /* sending complete */
-
-/* Q.931 variable length information element identifiers */
-
-#define IEI_SEGMMSG 0x00 /* segmented message */
-#define IEI_BEARERCAP 0x04 /* bearer capabilities */
-#define IEI_CAUSE 0x08 /* cause */
-#define IEI_CALLID 0x10 /* call identity */
-#define IEI_CALLSTATE 0x14 /* call state */
-#define IEI_CHANNELID 0x18 /* channel identification */
-#define IEI_PROGRESSI 0x1e /* progress indicator */
-#define IEI_NETSPCFAC 0x20 /* network specific facilities */
-#define IEI_NOTIFIND 0x27 /* notification indicator */
-#define IEI_DISPLAY 0x28 /* display */
-#define IEI_DATETIME 0x29 /* date/time */
-#define IEI_KEYPAD 0x2c /* keypad facility */
-#define IEI_SIGNAL 0x34 /* signal */
-#define IEI_INFRATE 0x40 /* information rate */
-#define IEI_ETETDEL 0x42 /* end to end transit delay */
-#define IEI_TDELSELIND 0x43 /* transit delay selection and indication */
-#define IEI_PLBPARMS 0x44 /* packet layer binary parameters */
-#define IEI_PLWSIZE 0x45 /* packet layer window size */
-#define IEI_PSIZE 0x46 /* packet size */
-#define IEI_CUG 0x47 /* closed user group */
-#define IEI_REVCHRGI 0x4a /* reverse charge indication */
-#define IEI_CALLINGPN 0x6c /* calling party number */
-#define IEI_CALLINGPS 0x6d /* calling party subaddress */
-#define IEI_CALLEDPN 0x70 /* called party number */
-#define IEI_CALLEDPS 0x71 /* called party subaddress */
-#define IEI_REDIRNO 0x74 /* redirecting number */
-#define IEI_TRNSEL 0x78 /* transit network selection */
-#define IEI_RESTARTI 0x79 /* restart indicator */
-#define IEI_LLCOMPAT 0x7c /* low layer compatibility */
-#define IEI_HLCOMPAT 0x7d /* high layer compatibility */
-#define IEI_USERUSER 0x7e /* user-user */
-#define IEI_ESACPE 0x7f /* escape for extension */
-
-/* Q.932 variable length information element identifiers */
-
-#define IEI_EXTFAC 0x0d /* extended facility */
-#define IEI_FACILITY 0x1c /* facility */
-#define IEI_INFOREQ 0x32 /* information request */
-#define IEI_FEATACT 0x38 /* feature activation */
-#define IEI_FEATIND 0x39 /* feature indication */
-#define IEI_SERVPID 0x3a /* service profile identification */
-#define IEI_ENDPTID 0x3b /* endpoint identifier */
-
-/* Q.933 variable length information element identifiers */
-
-#define IEI_DATALCID 0x19 /* data link connection identifier */
-#define IEI_LLCOREP 0x48 /* link layer core parameters */
-#define IEI_LLPROTP 0x49 /* link layer protocol parameters */
-#define IEI_X213PRI 0x50 /* X.213 priority */
-#define IEI_REPORTT 0x51 /* report type */
-#define IEI_LNKITYVERF 0x53 /* link integrity verification */
-#define IEI_PVCSTAT 0x57 /* PVC status */
-
-/* Q.95x variable length information element identifiers */
-
-#define IEI_PRECLEV 0x41 /* precedence level */
-#define IEI_CONCTDNO 0x4c /* connected number */
-#define IEI_CONCTDSA 0x4d /* connected subaddress */
-#define IEI_REDICNNO 0x76 /* redirection number */
-
-/* single octett information elements */
-
-#define SOIE_SHIFT 0x90 /* shift codeset */
-#define SHIFT_LOCK 0x08 /* shift codeset, locking shift bit */
-#define SOIE_MDSC 0xa0 /* more data AND/OR sending complete */
-#define SOIE_SENDC 0xa1 /* sending complete */
-#define SOIE_CONGL 0xb0 /* congestion level */
-#define SOIE_REPTI 0xd0 /* repeat indicator */
-
-/* codesets */
-
-#define CODESET_0 0 /* codeset 0, normal DSS1 codeset */
-
-/* Q.931/Q.932 message types (see Q.931 03/93 p10 and p311) */
-
-/* call establishment messages */
-
-#define ALERT 0x01
-#define CALL_PROCEEDING 0x02
-#define PROGRESS 0x03
-#define SETUP 0x05
-#define CONNECT 0x07
-#define SETUP_ACKNOWLEDGE 0x0d
-#define CONNECT_ACKNOWLEDGE 0x0f
-
-/* call information phase messages */
-
-#define USER_INFORMATION 0x20
-#define SUSPEND_REJECT 0x21
-#define RESUME_REJECT 0x22
-#define HOLD 0x24
-#define SUSPEND 0x25
-#define RESUME 0x26
-#define HOLD_ACKNOWLEDGE 0x28
-#define SUSPEND_ACKNOWLEDGE 0x2d
-#define RESUME_ACKNOWLEDGE 0x2e
-#define HOLD_REJECT 0x30
-#define RETRIEVE 0x31
-#define RETRIEVE_ACKNOWLEDGE 0x32
-#define RETRIEVE_REJECT 0x37
-
-/* call clearing */
-
-#define DISCONNECT 0x45
-#define RESTART 0x46
-#define RELEASE 0x4d
-#define RESTART_ACKNOWLEDGE 0x4e
-#define RELEASE_COMPLETE 0x5a
-
-/* misc messages */
-
-#define SEGMENT 0x60
-#define FACILITY 0x62
-#define REGISTER 0x64
-#define NOTIFY 0x6e
-#define STATUS_ENQUIRY 0x75
-#define CONGESTION_CONTROL 0x79
-#define INFORMATION 0x7b
-#define STATUS 0x7d
-
-/* EOF */
diff --git a/sys/i4b/include/i4b_l1l2.h b/sys/i4b/include/i4b_l1l2.h
deleted file mode 100644
index 782ca68a97a3..000000000000
--- a/sys/i4b/include/i4b_l1l2.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1l2.h - i4b layer 1 / layer 2 interactions
- * ---------------------------------------------------
- *
- * $Id: i4b_l1l2.h,v 1.7 1998/12/05 18:02:56 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:25 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L1L2_H_
-#define _I4B_L1L2_H_
-
-#ifdef __FreeBSD__
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_trace.h>
-#endif
-
-extern struct i4b_l1l2_func i4b_l1l2_func;
-
-struct i4b_l1l2_func
-{
- /* Layer 1 --> Layer 2 */
- /* =================== */
-
- int (*PH_DATA_IND) (int, struct mbuf *);
- int (*PH_ACTIVATE_IND) (int);
- int (*PH_DEACTIVATE_IND) (int);
-
-#define PH_Data_Ind(unit, data) \
- ((*i4b_l1l2_func.PH_DATA_IND)(unit, data))
-#define PH_Act_Ind(unit) \
- ((*i4b_l1l2_func.PH_ACTIVATE_IND)(unit))
-#define PH_Deact_Ind(unit) \
- ((*i4b_l1l2_func.PH_DEACTIVATE_IND)(unit))
-
-
- /* Layer 2 --> Layer 1 */
- /* =================== */
-
- int (*PH_DATA_REQ) (int, struct mbuf *, int);
-
- /* 3rd ph_data_req parameter */
-#define MBUF_DONTFREE 0
-#define MBUF_FREE 1
-
- int (*PH_ACTIVATE_REQ) (int);
-
-#define PH_Data_Req(unit, data, freeflag) \
- ((*i4b_l1l2_func.PH_DATA_REQ)(unit, data, freeflag))
-#define PH_Act_Req(unit) \
- ((*i4b_l1l2_func.PH_ACTIVATE_REQ)(unit))
-
- /* Layer 1 --> upstream, ISDN trace data */
- /* ===================================== */
- int (*MPH_TRACE_IND) (i4b_trace_hdr_t *, int, unsigned char *);
-
-#define MPH_Trace_Ind(header, length, pointer) \
- ((*i4b_l1l2_func.MPH_TRACE_IND)(header, length, pointer))
-
- /* L1/L2 management command and status information */
- /* =============================================== */
- int (*MPH_STATUS_IND) (int, int, int);
- int (*MPH_COMMAND_REQ) (int, int, int);
-
-#define MPH_Status_Ind(unit, status, parm) \
- ((*i4b_l1l2_func.MPH_STATUS_IND)(unit, status, parm))
-#define MPH_Command_Req(unit, command, parm) \
- ((*i4b_l1l2_func.MPH_COMMAND_REQ)(unit, command, parm))
-};
-
-#endif /* _I4B_L1L2_H_ */
-
diff --git a/sys/i4b/include/i4b_l2l3.h b/sys/i4b/include/i4b_l2l3.h
deleted file mode 100644
index 81ab1829ebc9..000000000000
--- a/sys/i4b/include/i4b_l2l3.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2l3.h - i4b layer 2 / layer 3 interactions
- * -----------------------------------------------
- *
- * $Id: i4b_l2l3.h,v 1.5 1998/12/05 18:02:57 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:44 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2L3_H_
-#define _I4B_L2L3_H_
-
-extern struct i4b_l2l3_func i4b_l2l3_func;
-
-struct i4b_l2l3_func
-{
- /* Layer 2 --> Layer 3 */
- /* =================== */
-
- int (*DL_ESTABLISH_IND) (int);
- int (*DL_ESTABLISH_CNF) (int);
-
- int (*DL_RELEASE_IND) (int);
- int (*DL_RELEASE_CNF) (int);
-
- int (*DL_DATA_IND) (int, struct mbuf *);
-
- int (*DL_UNIT_DATA_IND) (int, struct mbuf *);
-
-#define DL_Est_Ind(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_IND)(unit))
-#define DL_Est_Cnf(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_CNF)(unit))
-#define DL_Rel_Ind(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_IND)(unit))
-#define DL_Rel_Cnf(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_CNF)(unit))
-#define DL_Data_Ind(unit, data) \
- ((*i4b_l2l3_func.DL_DATA_IND)(unit, data))
-#define DL_Unit_Data_Ind(unit, data) \
- ((*i4b_l2l3_func.DL_UNIT_DATA_IND)(unit, data))
-
-#define DL_Est_Ind_A \
- (i4b_l2l3_func.DL_ESTABLISH_IND)
-#define DL_Est_Cnf_A \
- (i4b_l2l3_func.DL_ESTABLISH_CNF)
-#define DL_Rel_Ind_A \
- (i4b_l2l3_func.DL_RELEASE_IND)
-#define DL_Rel_Cnf_A \
- (i4b_l2l3_func.DL_RELEASE_CNF)
-
- /* Layer 3 --> Layer 2 */
- /* =================== */
-
- int (*DL_ESTABLISH_REQ) (int);
-
- int (*DL_RELEASE_REQ) (int);
-
- int (*DL_DATA_REQ) (int, struct mbuf *);
-
- int (*DL_UNIT_DATA_REQ) (int, struct mbuf *);
-
-#define DL_Est_Req(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_REQ)(unit))
-#define DL_Rel_Req(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_REQ)(unit))
-#define DL_Data_Req(unit, data) \
- ((*i4b_l2l3_func.DL_DATA_REQ)(unit, data))
-#define DL_Unit_Data_Req(unit, data) \
- ((*i4b_l2l3_func.DL_UNIT_DATA_REQ)(unit, data))
-
- /* Layer 2 --> Layer 3 management */
- /* ============================== */
-
- int (*MDL_STATUS_IND) (int, int, int); /* L2 --> L3 status */
-
-#define MDL_Status_Ind(unit, status, parm) \
- ((*i4b_l2l3_func.MDL_STATUS_IND)(unit, status, parm))
-
- /* Layer 3 --> Layer 2 management */
- /* ============================== */
-
- int (*MDL_COMMAND_REQ) (int, int, int); /* L3 --> L2 command */
-
-#define MDL_Command_Req(unit, command, parm) \
- ((*i4b_l2l3_func.MDL_COMMAND_REQ)(unit, command, parm))
-};
-
-#endif /* _I4B_L2L3_H_ */
-
diff --git a/sys/i4b/include/i4b_l3l4.h b/sys/i4b/include/i4b_l3l4.h
deleted file mode 100644
index 642777c04d67..000000000000
--- a/sys/i4b/include/i4b_l3l4.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3l4.h - layer 3 / layer 4 interface
- * ------------------------------------------
- *
- * $Id: i4b_l3l4.h,v 1.21 1998/12/05 18:02:59 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:58 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3L4_H_
-#define _I4B_L3L4_H_
-
-#define T303VAL (hz*4) /* 4 seconds timeout */
-#define T305VAL (hz*30) /* 30 seconds timeout */
-#define T308VAL (hz*4) /* 4 seconds timeout */
-#define T309VAL (hz*90) /* 90 seconds timeout */
-#define T310VAL (hz*60) /* 30-120 seconds timeout */
-#define T313VAL (hz*4) /* 4 seconds timeout */
-#define T400DEF (hz*10) /* 10 seconds timeout */
-
-#define N_CALL_DESC (MAX_CONTROLLERS*2) /* no of call descriptors */
-
-extern int nctrl; /* number of controllers detected in system */
-
-typedef struct bchan_statistics {
- int outbytes;
- int inbytes;
-} bchan_statistics_t;
-
-/*---------------------------------------------------------------------------*
- * table of things the driver needs to know about the b channel
- * it is connected to for data transfer
- *---------------------------------------------------------------------------*/
-typedef struct i4l_isdn_bchan_linktab {
- int unit;
- int channel;
- void (*bch_config)(int unit, int channel, int bprot, int updown);
- void (*bch_tx_start)(int unit, int channel);
- void (*bch_stat)(int unit, int channel, bchan_statistics_t *bsp);
- struct ifqueue *tx_queue;
- struct ifqueue *rx_queue; /* data xfer for NON-HDLC traffic */
- struct mbuf **rx_mbuf; /* data xfer for HDLC based traffic */
-} isdn_link_t;
-
-/*---------------------------------------------------------------------------*
- * table of things the b channel handler needs to know about
- * the driver it is connected to for data transfer
- *---------------------------------------------------------------------------*/
-typedef struct i4l_driver_bchan_linktab {
- int unit;
- void (*bch_rx_data_ready)(int unit);
- void (*bch_tx_queue_empty)(int unit);
- void (*bch_activity)(int unit, int rxtx);
-#define ACT_RX 0
-#define ACT_TX 1
- void (*line_connected)(int unit, void *cde);
- void (*line_disconnected)(int unit, void *cde);
- void (*dial_response)(int unit, int stat);
- void (*updown_ind)(int unit, int updown);
-} drvr_link_t;
-
-/* global linktab functions for controller types (aka hardware drivers) */
-struct ctrl_type_desc {
- isdn_link_t* (*get_linktab)(int unit, int channel);
- void (*set_linktab)(int unit, int channel, drvr_link_t *dlt);
-};
-extern struct ctrl_type_desc ctrl_types[];
-
-/* global linktab functions for RBCH userland driver */
-
-drvr_link_t *rbch_ret_linktab(int unit);
-void rbch_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for IPR network driver */
-
-drvr_link_t *ipr_ret_linktab(int unit);
-void ipr_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for TEL userland driver */
-
-drvr_link_t *tel_ret_linktab(int unit);
-void tel_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for ISPPP userland driver */
-
-drvr_link_t *i4bisppp_ret_linktab(int unit);
-void i4bisppp_set_linktab(int unit, isdn_link_t *ilt);
-
-/*---------------------------------------------------------------------------*
- * this structure describes one call/connection on one B-channel
- * and all its parameters
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- u_int cdid; /* call descriptor id */
- int controller; /* isdn controller number */
- int cr; /* call reference value */
-
- int crflag; /* call reference flag */
-#define CRF_ORIG 0 /* originating side */
-#define CRF_DEST 1 /* destinating side */
-
- int channelid; /* channel id value */
- int channelexcl; /* channel exclusive */
-
- int bprot; /* B channel protocol BPROT_XXX */
-
- int driver; /* driver to use for B channel */
- int driver_unit; /* unit for above driver number */
-
- cause_t cause_in; /* cause value from NT */
- cause_t cause_out; /* cause value to NT */
-
- int call_state; /* from incoming SETUP */
-
- u_char dst_telno[TELNO_MAX]; /* destination number */
- u_char src_telno[TELNO_MAX]; /* source number */
- int scr_ind; /* screening ind for incoming call */
-
- int Q931state; /* Q.931 state for call */
- int event; /* event to be processed */
-
- int response; /* setup response type */
-
- int T303; /* SETUP sent response timeout */
- int T303_first_to; /* first timeout flag */
-
- int T305; /* DISC without PROG IND */
-
- int T308; /* RELEASE sent response timeout*/
- int T308_first_to; /* first timeout flag */
-
- int T309; /* data link disconnect timeout */
-
- int T310; /* CALL PROC received */
-
- int T313; /* CONNECT sent timeout */
-
- int T400; /* L4 timeout */
-
- isdn_link_t *ilt; /* isdn B channel linktab */
- drvr_link_t *dlt; /* driver linktab */
-
- int dir; /* outgoing or incoming call */
-#define DIR_OUTGOING 0
-#define DIR_INCOMING 1
-
- int timeout_active; /* idle timeout() active flag */
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || \
- (!defined(__FreeBSD_version) && defined(__FreeBSD__) && __FreeBSD__ >= 3)
- struct callout_handle idle_timeout_handle;
- struct callout_handle T303_callout;
- struct callout_handle T305_callout;
- struct callout_handle T308_callout;
- struct callout_handle T309_callout;
- struct callout_handle T310_callout;
- struct callout_handle T313_callout;
- struct callout_handle T400_callout;
- int callouts_inited; /* must init before use */
-#endif
-
- int idletime_state; /* wait for idle_time begin */
-#define IST_IDLE 0 /* shorthold mode disabled */
-#define IST_NONCHK 1 /* in non-checked window */
-#define IST_CHECK 2 /* in idle check window */
-#define IST_SAFE 3 /* in safety zone */
-
- time_t idletimechk_start; /* check idletime window start */
- time_t connect_time; /* time connect was made */
- time_t last_active_time; /* last time with activity */
-
- /* for incoming connections: */
- time_t max_idle_time; /* max time without activity */
-
- /* for outgoing connections: */
- time_t unitlen_time; /* length of a charging unit */
- time_t idle_time; /* idle time before end of unit */
- time_t earlyhup_time; /* safety time zone at end of unit */
-
- int aocd_flag; /* AOCD used for unitlength calc*/
- time_t last_aocd_time; /* last time AOCD received */
- int units; /* number of AOCD charging units*/
- int units_type; /* units type: AOCD, AOCE */
- int cunits; /* calculated units */
-
- int isdntxdelay; /* isdn tx delay after connect */
-
- u_char display[DISPLAY_MAX]; /* display information element */
- char datetime[DATETIME_MAX]; /* date/time information element*/
-} call_desc_t;
-
-extern call_desc_t call_desc[N_CALL_DESC];
-
-/* forward decl. */
-struct isdn_diagnostic_request;
-struct isdn_dr_prot;
-
-/*---------------------------------------------------------------------------*
- * this structure "describes" one controller
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- int unit; /* unit number of this contr. */
- int ctrl_type; /* controller type (CTRL_XXX) */
- int card_type; /* card manufacturer (CARD_XXX) */
-
- int dl_est; /* layer 2 established */
-#define DL_DOWN 0
-#define DL_UP 1
-
- int bch_state[2]; /* states of the b channels */
-#define BCH_ST_FREE 0 /* free to be used, idle */
-#define BCH_ST_RSVD 1 /* reserved, may become free or used */
-#define BCH_ST_USED 2 /* in use for data transfer */
-
- int tei; /* current tei or -1 if invalid */
-
- /* pointers to functions to be called from L4 */
-
- void (*N_CONNECT_REQUEST) (unsigned int);
- void (*N_CONNECT_RESPONSE) (unsigned int, int, int);
- void (*N_DISCONNECT_REQUEST) (unsigned int, int);
- void (*N_ALERT_REQUEST) (unsigned int);
- void (*N_SET_TRACE) (int unit, int val);
- int (*N_GET_TRACE) (int unit);
- int (*N_DOWNLOAD) (int unit, int numprotos, struct isdn_dr_prot *protocols);
- int (*N_DIAGNOSTICS) (int unit, struct isdn_diagnostic_request*);
- void (*N_MGMT_COMMAND) (int unit, int cmd, int parm);
-} ctrl_desc_t;
-
-extern ctrl_desc_t ctrl_desc[MAX_CONTROLLERS];
-
-#endif /* _I4B_Q931_H_ */
diff --git a/sys/i4b/include/i4b_mbuf.h b/sys/i4b/include/i4b_mbuf.h
deleted file mode 100644
index 49ee26d6162d..000000000000
--- a/sys/i4b/include/i4b_mbuf.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b - mbuf handling support routines
- * --------------------------------------
- *
- * $Id: i4b_mbuf.h,v 1.6 1998/12/05 18:03:00 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:05:12 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_MBUF_H_
-#define _I4B_MBUF_H_
-
-#define IF_QEMPTY(ifq) ((ifq)->ifq_len == 0)
-
-struct mbuf *i4b_Dgetmbuf( int );
-void i4b_Dfreembuf( struct mbuf *m );
-void i4b_Dcleanifq( struct ifqueue * );
-
-struct mbuf *i4b_Bgetmbuf( int );
-void i4b_Bfreembuf( struct mbuf *m );
-void i4b_Bcleanifq( struct ifqueue * );
-
-#endif /* _I4B_MBUF_H_ */
-
-/* EOF */
diff --git a/sys/i4b/layer1/i4b_avm_a1.c b/sys/i4b/layer1/i4b_avm_a1.c
deleted file mode 100644
index bb55979e3638..000000000000
--- a/sys/i4b/layer1/i4b_avm_a1.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 1996 Andrew Gordon. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_avm_a1.c - AVM A1/Fritz passive card driver for isdn4bsd
- * ------------------------------------------------------------
- *
- * $Id: i4b_avm_a1.c,v 1.20 1998/12/16 13:57:21 hm Exp $
- *
- * last edit-date: [Wed Dec 16 14:59:59 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(AVM_A1)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifndef __FreeBSD__
-static u_int8_t avma1_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void avma1_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void avma1_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void avma1_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM A1 and AVM Fritz! Card special registers
- *---------------------------------------------------------------------------*/
-
-#define AVM_CONF_REG 0x1800 /* base offset for config register */
-#define AVM_CONF_IRQ 0x1801 /* base offset for IRQ register */
- /* config register write */
-#define AVM_CONF_WR_RESET 0x01 /* 1 = RESET ISAC and HSCX */
-#define AVM_CONF_WR_CCL 0x02 /* 1 = clear counter low nibble */
-#define AVM_CONF_WR_CCH 0x04 /* 1 = clear counter high nibble */
-#define AVM_CONF_WR_IRQEN 0x08 /* 1 = enable IRQ */
-#define AVM_CONF_WR_TEST 0x10 /* test bit */
- /* config register read */
-#define AVM_CONF_RD_IIRQ 0x01 /* 0 = ISAC IRQ active */
-#define AVM_CONF_RD_HIRQ 0x02 /* 0 = HSCX IRQ active */
-#define AVM_CONF_RD_CIRQ 0x04 /* 0 = counter IRQ active */
-#define AVM_CONF_RD_ZER1 0x08 /* unused, always read 0 */
-#define AVM_CONF_RD_TEST 0x10 /* test bit read back */
-#define AVM_CONF_RD_ZER2 0x20 /* unused, always read 0 */
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base - 0x3e0, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+4].t;
- bus_space_handle_t h = sc->sc_maps[what+4].h;
- bus_space_read_multi_1(t, h, 0, buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base - 0x3e0, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+4].t;
- bus_space_handle_t h = sc->sc_maps[what+4].h;
- bus_space_write_multi_1(t, h, 0, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-#else
-static void
-avma1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-avma1_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-#else
-static u_int8_t
-avma1_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_avma1 - probe for AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_avma1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char savebyte;
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for AVM A1/Fritz!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for AVM A1/Fritz!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for AVM A1/Fritz!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x200:
- case 0x240:
- case 0x300:
- case 0x340:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for AVM A1/Fritz!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_read_reg;
- sc->writereg = avma1_write_reg;
-
- sc->readfifo = avma1_read_fifo;
- sc->writefifo = avma1_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase + 0x1400 - 0x20;
-
- HSCX_A_BASE = (caddr_t)dev->id_iobase + 0x400 - 0x20;
- HSCX_B_BASE = (caddr_t)dev->id_iobase + 0xc00 - 0x20;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for AVM A1/Fritz\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /* AVM A1 or Fritz! control register bits: */
- /* read write */
- /* 0x01 hscx irq* RESET */
- /* 0x02 isac irq* clear counter1 */
- /* 0x04 counter irq* clear counter2 */
- /* 0x08 always 0 irq enable */
- /* 0x10 read test bit set test bit */
- /* 0x20 always 0 unused */
-
- /*
- * XXX the following test may be destructive, to prevent the
- * worst case, we save the byte first, and in case the test
- * fails, we write back the saved byte .....
- */
-
- savebyte = inb(dev->id_iobase + AVM_CONF_REG);
-
- /* write low to test bit */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
-
- /* test bit and next higher and lower bit must be 0 */
-
- if((byte = inb(dev->id_iobase + AVM_CONF_REG) & 0x38) != 0x00)
- {
- printf("isic%d: Error, probe-1 failed, 0x%02x should be 0x00 for AVM A1/Fritz!\n",
- dev->id_unit, byte);
- outb(dev->id_iobase + AVM_CONF_REG, savebyte);
- return (0);
- }
-
- /* write high to test bit */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x10);
-
- /* test bit must be high, next higher and lower bit must be 0 */
-
- if((byte = inb(dev->id_iobase + AVM_CONF_REG) & 0x38) != 0x10)
- {
- printf("isic%d: Error, probe-2 failed, 0x%02x should be 0x10 for AVM A1/Fritz!\n",
- dev->id_unit, byte);
- outb(dev->id_iobase + AVM_CONF_REG, savebyte);
- return (0);
- }
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_avma1(struct isic_attach_args *ia)
-{
- u_int8_t savebyte, v1, v2;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- v1 = bus_space_read_1(ia->ia_maps[ISIC_WHAT_HSCXA+1].t, ia->ia_maps[ISIC_WHAT_HSCXA+1].h, H_VSTR) & 0x0f;
- v2 = bus_space_read_1(ia->ia_maps[ISIC_WHAT_HSCXB+1].t, ia->ia_maps[ISIC_WHAT_HSCXB+1].h, H_VSTR) & 0x0f;
- if (v1 != v2 || (v1 != 0x05 && v1 != 0x04))
- return 0;
-
- /* AVM A1 or Fritz! control register bits: */
- /* read write */
- /* 0x01 hscx irq* RESET */
- /* 0x02 isac irq* clear counter1 */
- /* 0x04 counter irq* clear counter2 */
- /* 0x08 always 0 irq enable */
- /* 0x10 read test bit set test bit */
- /* 0x20 always 0 unused */
-
- /*
- * XXX the following test may be destructive, to prevent the
- * worst case, we save the byte first, and in case the test
- * fails, we write back the saved byte .....
- */
-
- savebyte = bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0);
-
- /* write low to test bit */
-
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, 0);
-
- /* test bit and next higher and lower bit must be 0 */
-
- if((bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0) & 0x38) != 0x00)
- {
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, savebyte);
- return 0;
- }
-
- /* write high to test bit */
-
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, 0x10);
-
- /* test bit must be high, next higher and lower bit must be 0 */
-
- if((bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0) & 0x38) != 0x10)
- {
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, savebyte);
- return 0;
- }
-
- return (1);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_avma1 - attach AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_avma1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* reset the HSCX and ISAC chips */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + AVM_CONF_REG, AVM_CONF_WR_RESET);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- outb(dev->id_iobase + AVM_CONF_IRQ, (ffs(sc->sc_irq)) - 1);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- outb(dev->id_iobase + AVM_CONF_REG, AVM_CONF_WR_IRQEN |
- AVM_CONF_WR_CCH | AVM_CONF_WR_CCL);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#else
-
-int
-isic_attach_avma1(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_read_reg;
- sc->writereg = avma1_write_reg;
-
- sc->readfifo = avma1_read_fifo;
- sc->writefifo = avma1_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the HSCX and ISAC chips */
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, AVM_CONF_WR_RESET);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- bus_space_write_1(t, h, 1, sc->sc_irq);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- bus_space_write_1(t, h, 0, AVM_CONF_WR_IRQEN |
- AVM_CONF_WR_CCH | AVM_CONF_WR_CCL);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-#endif
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c b/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c
deleted file mode 100644
index 483eb660a828..000000000000
--- a/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright (c) 1998 Matthias Apitz. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * Fritz!Card pcmcia specific routines for isic driver
- * ---------------------------------------------------
- *
- * $Id: i4b_avm_fritz_pcmcia.c,v 1.7 1998/12/01 21:25:53 hm Exp $
- *
- * last edit-date: [Tue Dec 1 22:03:51 1998]
- *
- * -ap added support for AVM PCMCIA Fritz!Card
- * -mh split into separate file
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(AVM_PCMCIA)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t avma1_pcmcia_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void avma1_pcmcia_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void avma1_pcmcia_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void avma1_pcmcia_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM PCMCIA Fritz!Card special registers
- *---------------------------------------------------------------------------*/
-
-/*
- * register offsets from i/o base 0x140 or 0x300
- */
-#define ADDR_REG_OFFSET 0x02
-#define DATA_REG_OFFSET 0x03
-#define STAT0_OFFSET 0x04
-#define STAT1_OFFSET 0x05
-#define MODREG_OFFSET 0x06
-#define VERREG_OFFSET 0x07
-/*
- * AVM PCMCIA Status Latch 0 read only bits
- */
-#define ASL_IRQ_TIMER 0x10 /* Timer interrupt, active low */
-#define ASL_IRQ_ISAC 0x20 /* ISAC interrupt, active low */
-#define ASL_IRQ_HSCX 0x40 /* HSX interrupt, active low */
-#define ASL_IRQ_BCHAN ASL_IRQ_HSCX
-#define ASL_IRQ_Pending (ASL_IRQ_ISAC | ASL_IRQ_HSCX | ASL_IRQ_TIMER)
-/*
- * AVM Status Latch 0 write only bits
- */
-#define ASL_RESET_ALL 0x01 /* reset siemens IC's, active 1 */
-#define ASL_TIMERDISABLE 0x02 /* active high */
-#define ASL_TIMERRESET 0x04 /* active high */
-#define ASL_ENABLE_INT 0x08 /* active high */
-/*
- * AVM Status Latch 1 write only bits
- */
-#define ASL1_LED0 0x10 /* active high */
-#define ASL1_LED1 0x20 /* active high */
-
-#define ASL1_ENABLE_S0 0xc0 /* enable active S0 I/F */
-
-/*----- EEpromless controller -----*/
-/*
- * AVM Status Latch read/write bit
- */
-
-#define ASL_TESTBIT 0x80
-
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int PCMCIA_IO_BASE = 0; /* ap: XXX hack */
-static void
-avma1_pcmcia_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base - 0x20);
- insb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char *)buf, (u_int)len);
-}
-#else
-/* offsets of the different 'what' arguments */
-static u_int8_t what_map[] = {
- 0x20-0x20, /* ISIC_WHAT_ISAC */
- 0xA0-0x20, /* ISIC_WHAT_HSCXA */
- 0xE0-0x20 /* ISIC_WHAT_HSCXB */
-};
-static void
-avma1_pcmcia_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]);
- bus_space_read_multi_1(t, h, DATA_REG_OFFSET, buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_pcmcia_write_fifo(void *base, const void *buf, size_t len)
-{
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base - 0x20);
- outsb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_pcmcia_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]);
- bus_space_write_multi_1(t, h, DATA_REG_OFFSET, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_pcmcia_write_reg(u_char *base, u_int offset, u_int v)
-{
- /* offset includes 0x20 FIFO ! */
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base+offset-0x20);
- outb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char)v);
-}
-#else
-static void
-avma1_pcmcia_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]+offs);
- bus_space_write_1(t, h, DATA_REG_OFFSET, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-avma1_pcmcia_read_reg(u_char *base, u_int offset)
-{
- /* offset includes 0x20 FIFO ! */
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base+offset-0x20);
- return (inb(PCMCIA_IO_BASE + DATA_REG_OFFSET));
-}
-#else
-static u_int8_t
-avma1_pcmcia_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]+offs);
- return bus_space_read_1(t, h, DATA_REG_OFFSET);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_avma1_pcmcia - probe for AVM PCMCIA Fritz!Card
- * This is in the bus attachemnt part on NetBSD (pcmcia_isic.c), no
- * card specicfic probe is needed on direct config buses like pcmcia.
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_avma1_pcmcia(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
- int i;
- u_int cardinfo;
-
- /* check max unit range */
-
- if(dev->id_unit > 1)
- {
- printf("isic%d: Error, unit %d > MAXUNIT for AVM PCMCIA Fritz!Card\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /*
- * we trust the IRQ we got from PCCARD service
- */
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x140:
- case 0x300:
- break;
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for AVM PCMCIA Fritz!Card.\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* ResetController */
-
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 20);
- outb(dev->id_iobase + STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 20);
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
-
- /*
- * CheckController
- * The logic to check for the PCMCIA was adapted as
- * described by AVM.
- */
-
- outb(dev->id_iobase + ADDR_REG_OFFSET, 0x21); /* ISAC STAR */
- if ( (byte=inb(dev->id_iobase + DATA_REG_OFFSET) & 0xfd) != 0x48 )
- {
- printf("isic%d: Error, ISAC STAR for AVM PCMCIA is 0x%0x (should be 0x48)\n",
- dev->id_unit, byte);
- return(0);
- }
-
- outb(dev->id_iobase + ADDR_REG_OFFSET, 0xa1); /* HSCX STAR */
- if ( (byte=inb(dev->id_iobase + DATA_REG_OFFSET) & 0xfd) != 0x48 )
- {
- printf("isic%d: Error, HSCX STAR for AVM PCMCIA is 0x%0x (should be 0x48)\n",
- dev->id_unit, byte);
- return(0);
- }
-
- byte = ASL_TESTBIT;
- for (i=0; i<256; i++) {
- byte = byte ? 0 : ASL_TESTBIT;
- outb(dev->id_iobase + STAT0_OFFSET, byte);
- if ((inb(dev->id_iobase+STAT0_OFFSET)&ASL_TESTBIT)!=byte) {
- printf("isic%d: Error during toggle of AVM PCMCIA Status Latch0\n",
- dev->id_unit);
- return(0);
- }
- }
-
- sc->clearirq = NULL;
- sc->readreg = avma1_pcmcia_read_reg;
- sc->writereg = avma1_pcmcia_write_reg;
-
- sc->readfifo = avma1_pcmcia_read_fifo;
- sc->writefifo = avma1_pcmcia_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2; /* ap: XXX ??? */
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- /*
- * NOTE: for PCMCIA these are no real addrs; they are
- * offsets to be written into the base+ADDR_REG_OFFSET register
- * to pick up the values of the bytes fro base+DATA_REG_OFFSET
- *
- * see also the logic in the avma1_pcmcia_* routines;
- * therefore we also must have the base addr in some static
- * space or struct; XXX better solution?
- */
-
- PCMCIA_IO_BASE = dev->id_iobase;
- ISAC_BASE = (caddr_t)0x20;
-
- HSCX_A_BASE = (caddr_t)0xA0;
- HSCX_B_BASE = (caddr_t)0xE0;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for AVM PCMCIA Fritz!Card\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: 0x%0x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: 0x%0x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /*
- * seems we really have an AVM PCMCIA Fritz!Card controller
- */
- cardinfo = inb(dev->id_iobase + VERREG_OFFSET)<<8 | inb(dev->id_iobase + MODREG_OFFSET);
- printf("isic%d: successfully detect AVM PCMCIA cardinfo = 0x%0x\n",
- dev->id_unit, cardinfo);
- dev->id_flags = FLAG_AVM_A1_PCMCIA;
- return (1);
-}
-#endif /* __FreeBSD__ */
-
-
-
-/*---------------------------------------------------------------------------*
- * isic_attach_fritzpcmcia - attach Fritz!Card
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_fritzpcmica(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* ResetController again just to make sure... */
-
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- outb(dev->id_iobase + STAT0_OFFSET, ASL_TIMERDISABLE |
- ASL_TIMERRESET | ASL_ENABLE_INT);
- /* DELAY(SEC_DELAY / 10); */
-
- return(1);
-}
-
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_fritzpcmcia(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space - exactly as dictated by the card */
- if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start, cfe->iospace[0].length,
- 0, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_pcmcia_read_reg;
- sc->writereg = avma1_pcmcia_write_reg;
-
- sc->readfifo = avma1_pcmcia_read_fifo;
- sc->writefifo = avma1_pcmcia_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Reset controller again just to make sure... */
-
- bus_space_write_1(t, h, STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- bus_space_write_1(t, h, STAT0_OFFSET, ASL_TIMERDISABLE |
- ASL_TIMERRESET | ASL_ENABLE_INT);
-
- return 1;
-}
-#endif
-
-#endif /* NISIC > 0 && defined(AVM_PCMCIA) */
diff --git a/sys/i4b/layer1/i4b_bchan.c b/sys/i4b/layer1/i4b_bchan.c
deleted file mode 100644
index 17ee27364777..000000000000
--- a/sys/i4b/layer1/i4b_bchan.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_bchan.c - B channel handling L1 procedures
- * ----------------------------------------------
- *
- * $Id: i4b_bchan.c,v 1.28 1998/12/05 18:04:28 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:21:57 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __FreeBSD__
-static void isic_bchannel_start(int unit, int h_chan);
-static void isic_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp);
-#else
-static void isic_bchannel_start __P((int unit, int h_chan));
-static void isic_bchannel_stat __P((int unit, int h_chan, bchan_statistics_t *bsp));
-#endif
-
-static void isic_set_linktab(int unit, int channel, drvr_link_t *dlt);
-static isdn_link_t *isic_ret_linktab(int unit, int channel);
-
-/*---------------------------------------------------------------------------*
- * initialize one B channels rx/tx data structures and init/deinit HSCX
- *---------------------------------------------------------------------------*/
-void
-isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- isic_hscx_init(sc, h_chan, activate);
- }
-
- DBGL1(L1_BCHAN, "isic_bchannel_setup", ("unit=%d, channel=%d, %s\n",
- sc->sc_unit, h_chan, activate ? "activate" : "deactivate"));
-
- /* general part */
-
- chan->unit = sc->sc_unit; /* unit number */
- chan->channel = h_chan; /* B channel */
- chan->bprot = bprot; /* B channel protocol */
- chan->state = HSCX_IDLE; /* B channel state */
-
- /* receiver part */
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- chan->rxcount = 0; /* reset rx counter */
-
- i4b_Bfreembuf(chan->in_mbuf); /* clean rx mbuf */
-
- chan->in_mbuf = NULL; /* reset mbuf ptr */
- chan->in_cbptr = NULL; /* reset mbuf curr ptr */
- chan->in_len = 0; /* reset mbuf data len */
-
- /* transmitter part */
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- chan->txcount = 0; /* reset tx counter */
-
- i4b_Bfreembuf(chan->out_mbuf_head); /* clean tx mbuf */
-
- chan->out_mbuf_head = NULL; /* reset head mbuf ptr */
- chan->out_mbuf_cur = NULL; /* reset current mbuf ptr */
- chan->out_mbuf_cur_ptr = NULL; /* reset current mbuf data ptr */
- chan->out_mbuf_cur_len = 0; /* reset current mbuf data cnt */
-
- if(activate != 0)
- {
- /* activation */
- isic_hscx_init(sc, h_chan, activate);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * start transmission on a b channel
- *---------------------------------------------------------------------------*/
-static void
-isic_bchannel_start(int unit, int h_chan)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- register isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- register int next_len;
- register int len;
-
- int s;
- int activity = -1;
- int cmd = 0;
-
- s = SPLI4B(); /* enter critical section */
- if(chan->state & HSCX_TX_ACTIVE) /* already running ? */
- {
- splx(s);
- return; /* yes, leave */
- }
-
- /* get next mbuf from queue */
-
- IF_DEQUEUE(&chan->tx_queue, chan->out_mbuf_head);
-
- if(chan->out_mbuf_head == NULL) /* queue empty ? */
- {
- splx(s); /* leave critical section */
- return; /* yes, exit */
- }
-
- /* init current mbuf values */
-
- chan->out_mbuf_cur = chan->out_mbuf_head;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
-
- /* activity indicator for timeout handling */
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(isic_hscx_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
-
- chan->state |= HSCX_TX_ACTIVE; /* we start transmitting */
-
- if(sc->sc_trace & TRACE_B_TX) /* if trace, send mbuf to trace dev */
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- len = 0; /* # of chars put into HSCX tx fifo this time */
-
- /*
- * fill the HSCX tx fifo with data from the current mbuf. if
- * current mbuf holds less data than HSCX fifo length, try to
- * get the next mbuf from (a possible) mbuf chain. if there is
- * not enough data in a single mbuf or in a chain, then this
- * is the last mbuf and we tell the HSCX that it has to send
- * CRC and closing flag
- */
-
- while((len < sc->sc_bfifolen) && chan->out_mbuf_cur)
- {
- /*
- * put as much data into the HSCX fifo as is
- * available from the current mbuf
- */
-
- if((len + chan->out_mbuf_cur_len) >= sc->sc_bfifolen)
- next_len = sc->sc_bfifolen - len;
- else
- next_len = chan->out_mbuf_cur_len;
-
-#ifdef NOTDEF
- printf("b:mh=%x, mc=%x, mcp=%x, mcl=%d l=%d nl=%d # ",
- chan->out_mbuf_head,
- chan->out_mbuf_cur,
- chan->out_mbuf_cur_ptr,
- chan->out_mbuf_cur_len,
- len,
- next_len);
-#endif
-
- /* wait for tx fifo write enabled */
-
- isic_hscx_waitxfw(sc, h_chan);
-
- /* write what we have from current mbuf to HSCX fifo */
-
- HSCX_WRFIFO(h_chan, chan->out_mbuf_cur_ptr, next_len);
-
- len += next_len; /* update # of bytes written */
- chan->txcount += next_len; /* statistics */
- chan->out_mbuf_cur_ptr += next_len; /* data ptr */
- chan->out_mbuf_cur_len -= next_len; /* data len */
-
- /*
- * in case the current mbuf (of a possible chain) data
- * has been put into the fifo, check if there is a next
- * mbuf in the chain. If there is one, get ptr to it
- * and update the data ptr and the length
- */
-
- if((chan->out_mbuf_cur_len <= 0) &&
- ((chan->out_mbuf_cur = chan->out_mbuf_cur->m_next) != NULL))
- {
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
- }
- }
-
- /*
- * if there is either still data in the current mbuf and/or
- * there is a successor on the chain available issue just
- * a XTF (transmit) command to HSCX. if ther is no more
- * data available from the current mbuf (-chain), issue
- * an XTF and an XME (message end) command which will then
- * send the CRC and the closing HDLC flag sequence
- */
-
- if(chan->out_mbuf_cur && (chan->out_mbuf_cur_len > 0))
- {
- /*
- * more data available, send current fifo out.
- * next xfer to HSCX tx fifo is done in the
- * HSCX interrupt routine.
- */
-
- cmd |= HSCX_CMDR_XTF;
- }
- else
- {
- /* end of mbuf chain */
-
- if(chan->bprot == BPROT_NONE)
- cmd |= HSCX_CMDR_XTF;
- else
- cmd |= HSCX_CMDR_XTF | HSCX_CMDR_XME;
-
- i4b_Bfreembuf(chan->out_mbuf_head); /* free mbuf chain */
-
- chan->out_mbuf_head = NULL;
- chan->out_mbuf_cur = NULL;
- chan->out_mbuf_cur_ptr = NULL;
- chan->out_mbuf_cur_len = 0;
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->drvr_linktab->bch_activity)(chan->drvr_linktab->unit, activity);
-
- if(cmd)
- isic_hscx_cmd(sc, h_chan, cmd);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * fill statistics struct
- *---------------------------------------------------------------------------*/
-static void
-isic_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- int s;
-
- s = SPLI4B();
-
- bsp->outbytes = chan->txcount;
- bsp->inbytes = chan->rxcount;
-
- chan->txcount = 0;
- chan->rxcount = 0;
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return the address of isic drivers linktab
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-isic_ret_linktab(int unit, int channel)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-static void
-isic_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[channel];
-
- chan->drvr_linktab = dlt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-void
-isic_init_linktab(struct isic_softc *sc)
-{
- isic_Bchan_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- ctrl_types[CTRL_PASSIVE].set_linktab = isic_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = isic_ret_linktab;
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = isic_bchannel_setup;
- lt->bch_tx_start = isic_bchannel_start;
- lt->bch_stat = isic_bchannel_stat;
- lt->tx_queue = &chan->tx_queue;
-
- /* used by non-HDLC data transfers, i.e. telephony drivers */
- lt->rx_queue = &chan->rx_queue;
-
- /* used by HDLC data transfers, i.e. ipr and isp drivers */
- lt->rx_mbuf = &chan->in_mbuf;
-
- chan = &sc->sc_chan[HSCX_CH_B];
- lt = &chan->isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = isic_bchannel_setup;
- lt->bch_tx_start = isic_bchannel_start;
- lt->bch_stat = isic_bchannel_stat;
- lt->tx_queue = &chan->tx_queue;
-
- /* used by non-HDLC data transfers, i.e. telephony drivers */
- lt->rx_queue = &chan->rx_queue;
-
- /* used by HDLC data transfers, i.e. ipr and isp drivers */
- lt->rx_mbuf = &chan->in_mbuf;
-}
-
-/*---------------------------------------------------------------------------*
- * telephony silence detection
- *---------------------------------------------------------------------------*/
-
-#define TEL_IDLE_MIN (BCH_MAX_DATALEN/2)
-
-int
-isic_hscx_silence(unsigned char *data, int len)
-{
- register int i = 0;
- register int j = 0;
-
- /* count idle bytes */
-
- for(;i < len; i++)
- {
- if((*data >= 0xaa) && (*data <= 0xac))
- j++;
- data++;
- }
-
-#ifdef NOTDEF
- printf("isic_hscx_silence: got %d silence bytes in frame\n", j);
-#endif
-
- if(j < (TEL_IDLE_MIN))
- return(0);
- else
- return(1);
-
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_ctx_s0P.c b/sys/i4b/layer1/i4b_ctx_s0P.c
deleted file mode 100644
index f9e6b7f03eed..000000000000
--- a/sys/i4b/layer1/i4b_ctx_s0P.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Creatix PnP cards
- * ============================================================
- *
- * $Id: i4b_ctx_s0P.c,v 1.17 1998/12/16 09:32:50 hm Exp $
- *
- * last edit-date: [Mon Dec 14 17:26:30 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(CRTX_S0_P)
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t ctxs0P_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void ctxs0P_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void ctxs0P_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void ctxs0P_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_Cs0P(struct isic_softc *sc);
-#endif
-
-#ifdef __FreeBSD__
-#include <i386/isa/pnp.h>
-extern void isicintr ( int unit );
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-ctxs0P_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x3e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-ctxs0P_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x3e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-ctxs0P_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-ctxs0P_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-ctxs0P_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs);
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic_probe_Cs0P - probe for Creatix ISDN-S0 P&P and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_Cs0P(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- if(iobase2 == 0)
- {
- printf("isic%d: Error, iobase2 is 0 for Creatix ISDN-S0 P&P!\n",
- dev->id_unit);
- return(0);
- }
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x120:
- case 0x180:
-/*XXX*/ break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = ctxs0P_read_reg;
- sc->writereg = ctxs0P_write_reg;
-
- sc->readfifo = ctxs0P_read_fifo;
- sc->writefifo = ctxs0P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) dev->id_iobase - 0x20;
- HSCX_A_BASE = (caddr_t) iobase2 - 0x20;
- HSCX_B_BASE = (caddr_t) iobase2;
-
- /*
- * Read HSCX A/B VSTR. Expected value for the Creatix PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Creatix PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach Creatix ISDN-S0 P&P
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Cs0P(struct isa_device *dev, unsigned int iobase2)
-{
- outb((dev->id_iobase) + 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase) + 0x1c, 1);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_Cs0P(struct isic_softc *sc)
-{
- /* init card */
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 0x1c, 1);
- DELAY(SEC_DELAY / 10);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = ctxs0P_read_reg;
- sc->writereg = ctxs0P_write_reg;
-
- sc->readfifo = ctxs0P_read_fifo;
- sc->writefifo = ctxs0P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(CRTX_S0_P) */
-
diff --git a/sys/i4b/layer1/i4b_drn_ngo.c b/sys/i4b/layer1/i4b_drn_ngo.c
deleted file mode 100644
index a5f3d6941923..000000000000
--- a/sys/i4b/layer1/i4b_drn_ngo.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_drn_ngo.c - Dr. Neuhaus Niccy GO@ and SAGEM Cybermod
- * --------------------------------------------------------
- *
- * $Id: i4b_drn_ngo.c,v 1.19 1998/12/16 09:32:50 hm Exp $
- *
- * last edit-date: [Mon Dec 14 17:26:03 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(DRN_NGO)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-/*---------------------------------------------------------------------------*
- * Niccy GO@ definitions
- *
- * the card uses 2 i/o addressranges each using 2 bytes
- *
- * addressrange 0:
- * offset 0 - ISAC dataregister
- * offset 1 - HSCX dataregister
- * addressrange 1:
- * offset 0 - ISAC addressregister
- * offset 1 - HSCX addressregister
- *
- * to access an ISAC/HSCX register, you have to write the register
- * number into the ISAC or HSCX addressregister and then read/write
- * data for the ISAC/HSCX register into/from the corresponding
- * dataregister.
- *
- * Thanks to Klaus Muehle of Dr. Neuhaus Telekommunikation for giving
- * out this information!
- *
- *---------------------------------------------------------------------------*/
-#define NICCY_PORT_MIN 0x200
-#define NICCY_PORT_MAX 0x3e0
-
-#define HSCX_ABIT 0x1000 /* flag, HSCX A is meant */
-#define HSCX_BBIT 0x2000 /* flag, HSCX B is meant */
-
-#define HSCX_BOFF 0x40
-
-#define ADDR_OFF 2 /* address register range offset XXX */
-
-#define ISAC_DATA 0
-#define HSCX_DATA 1
-
-#define ISAC_ADDR 0
-#define HSCX_ADDR 1
-
-#ifdef __FreeBSD__
-
-#if 0
-#define HSCXADEBUG
-#define HSCXBDEBUG
-#define ISACDEBUG
-#else
-#undef HSCXADEBUG
-#undef HSCXBDEBUG
-#undef ISACDEBUG
-#endif
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_read_fifo(void *buf, const void *base, size_t len)
-{
- register int offset;
- register u_int data;
-
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = 0;
-#ifdef HSCXADEBUG
-printf("GO/A/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = HSCX_BOFF;
-#ifdef HSCXBDEBUG
-printf("GO/B/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else
- {
- (u_int)data = ((u_int)base + ISAC_DATA);
- (u_int)base += (ADDR_OFF + ISAC_ADDR);
- offset = 0;
-#ifdef ISACDEBUG
-printf("GO/I/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
-
- for(;len > 0; len--, offset++)
- {
- outb((int)base, (u_char)offset);
- *((u_char *)buf + offset) = inb((int)data);
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_fifo(void *base, const void *buf, size_t len)
-{
- register int offset;
- register u_int data;
-
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = 0;
-#ifdef HSCXADEBUG
-printf("GO/A/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = HSCX_BOFF;
-#ifdef HSCXBDEBUG
-printf("GO/B/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else
- {
- (u_int)data = ((u_int)base + ISAC_DATA);
- (u_int)base += (ADDR_OFF + ISAC_ADDR);
- offset = 0;
-#ifdef ISACDEBUG
-printf("GO/I/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
-
- for(;len > 0; len--, offset++)
- {
- outb((int)base, (u_char)offset);
- outb((int)data, *((u_char *)buf + offset));
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write register routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_reg(u_char *base, u_int offset, u_int v)
-{
- int x = SPLI4B();
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)offset);
- outb((int)base + HSCX_DATA, (u_char)v);
-#ifdef HSCXADEBUG
-printf("GO/A/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)offset, (u_char)v);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)(offset + HSCX_BOFF));
- outb((int)base + HSCX_DATA, (u_char)v);
-#ifdef HSCXBDEBUG
-printf("GO/B/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)(offset + HSCX_BOFF), (u_char)v);
-#endif
- }
- else
- {
- outb((int)base + ADDR_OFF + ISAC_ADDR, (u_char)offset);
- outb((int)base + ISAC_DATA, (u_char)v);
-#ifdef ISACDEBUG
-printf("GO/I/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + ISAC_ADDR, (int)base + ISAC_DATA,
- (u_char)offset, (u_char)v);
-#endif
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-drnngo_read_reg(u_char *base, u_int offset)
-{
- u_char val;
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)offset);
- val = inb((int)base + HSCX_DATA);
-#ifdef HSCXADEBUG
-printf("GO/A/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)offset, (u_char)val);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)(offset + HSCX_BOFF));
- val = inb((int)base + HSCX_DATA);
-#ifdef HSCXBDEBUG
-printf("GO/B/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)(offset + HSCX_BOFF), (u_char)val);
-#endif
- }
- else
- {
- outb((int)base + ADDR_OFF + ISAC_ADDR, (u_char)offset);
- val = inb((int)base + ISAC_DATA);
-#ifdef ISACDEBUG
-printf("GO/I/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + ISAC_ADDR, (int)base + ISAC_DATA,
- (u_char)offset, (u_char)val);
-#endif
- }
- splx(x);
- return(val);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_drnngo - probe for Dr. Neuhaus Niccy GO@
- *---------------------------------------------------------------------------*/
-int
-isic_probe_drnngo(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 3:
- case 4:
- case 5:
- case 9:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- if(dev->id_iobase < NICCY_PORT_MIN || dev->id_iobase > NICCY_PORT_MAX)
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- if(iobase2 == 0)
- {
- printf("isic%d: Error, iobase2 is 0 for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit);
- return(0);
- }
-
- if(iobase2 < NICCY_PORT_MIN || iobase2 > NICCY_PORT_MAX)
- {
- printf("isic%d: Error, invalid port1 0x%x specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, iobase2);
- return(0);
- }
-
-/*XXX*/ if((dev->id_iobase + 2) != iobase2)
- {
- printf("isic%d: Error, port1 must be (port0+2) for Dr.Neuhaus Niccy GO@!\n",
- dev->id_unit);
- return(0);
- }
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = drnngo_read_reg;
- sc->writereg = drnngo_write_reg;
-
- sc->readfifo = drnngo_read_fifo;
- sc->writefifo = drnngo_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DRNNGO;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase;
- HSCX_A_BASE = (caddr_t)(((u_int)dev->id_iobase) | HSCX_ABIT);
- HSCX_B_BASE = (caddr_t)(((u_int)dev->id_iobase) | HSCX_BBIT);
-
- /*
- * Read HSCX A/B VSTR. Expected value for Dr. Neuhaus Niccy GO@ based
- * boards is 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Dr. Neuhaus Niccy GO@\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_drnngo - attach Dr. Neuhaus Niccy GO@
- *---------------------------------------------------------------------------*/
-int
-isic_attach_drnngo(struct isa_device *dev, unsigned int iobase2)
-{
- return (1);
-}
-
-#else
-
-static u_int8_t drnngo_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void drnngo_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void drnngo_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void drnngo_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_drnngo __P((struct isic_softc *sc));
-
-/*
- * Mapping from "what" parameter to offsets into the io map
- */
-static struct {
- bus_size_t oa, /* address register offset */
- od, /* data register offset */
- or; /* additional chip register offset */
-} offset[] =
-{
- { ISAC_ADDR, ISAC_DATA, 0 }, /* ISAC access */
- { HSCX_ADDR, HSCX_DATA, 0 }, /* HSCX A access */
- { HSCX_ADDR, HSCX_DATA, HSCX_BOFF } /* HSCX B access */
-};
-
-static void
-drnngo_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offset[what].or);
- bus_space_read_multi_1(t, hd, offset[what].od, buf, size);
-}
-
-static void
-drnngo_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offset[what].or);
- bus_space_write_multi_1(t, hd, offset[what].od, (u_int8_t*)buf, size);
-}
-
-static void
-drnngo_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offs+offset[what].or);
- bus_space_write_1(t, hd, offset[what].od, data);
-}
-
-static u_int8_t
-drnngo_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offs+offset[what].or);
- return bus_space_read_1(t, hd, offset[what].od);
-}
-
-void
-isic_attach_drnngo(struct isic_softc *sc)
-{
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = drnngo_read_reg;
- sc->writereg = drnngo_write_reg;
-
- sc->readfifo = drnngo_read_fifo;
- sc->writefifo = drnngo_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DRNNGO;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(DRN_NGO) */
diff --git a/sys/i4b/layer1/i4b_dynalink.c b/sys/i4b/layer1/i4b_dynalink.c
deleted file mode 100644
index 846e79ae6da1..000000000000
--- a/sys/i4b/layer1/i4b_dynalink.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (c) 1998 Martijn Plak. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdn4bsd layer1 driver for Dynalink IS64PH isdn TA
- * ==================================================
- *
- * $Id: i4b_dynalink.c,v 1.8 1998/12/17 04:55:38 hm Exp $
- *
- * last edit-date: [Thu Dec 17 05:50:39 1998]
- *
- * written by Martijn Plak <tigrfhur@xs4all.nl>
- *
- * -mp 11 jun 1998 first try, code borrowed from Creatix driver
- * -mp 18 jun 1998 cleaned up code
- * -hm FreeBSD PnP
- * -mp 17 dec 1998 made it compile again
- *
- *---------------------------------------------------------------------------*/
-
-/* NOTES:
-
- This driver was written for the Dynalink IS64PH ISDN TA, based on two
- Siemens chips (HSCX 21525 and ISAC 2186). It is sold in the Netherlands.
-
- model numbers found on (my) card:
- IS64PH, TAS100H-N, P/N:89590555, TA200S100045521
-
- chips:
- Siemens PSB 21525N, HSCX TE V2.1
- Siemens PSB 2186N, ISAC-S TE V1.1
- 95MS14, PNP
-
- plug-and-play info:
- device id "ASU1688"
- vendor id 0x88167506
- serial 0x00000044
- i/o port 4 byte alignment, 4 bytes requested,
- 10 bit i/o decoding, 0x100-0x3f8 (?)
- irq 3,4,5,9,10,11,12,15, high true, edge sensitive
-
- At the moment I'm writing this Dynalink is replacing this card with
- one based on a single Siemens chip (IPAC). It will apparently be sold
- under the same model name.
-
- This driver might also work for Asuscom cards.
-*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(DYNALINK)
-
-/* HEADERS
-*/
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifdef __FreeBSD__
-static void dynalink_read_fifo(void *buf, const void *base, size_t len);
-static void dynalink_write_fifo(void *base, const void *buf, size_t len);
-static void dynalink_write_reg(u_char *base, u_int offset, u_int v);
-static u_char dynalink_read_reg(u_char *base, u_int offset);
-
-extern struct isa_driver isicdriver;
-
-#else
-static void dynalink_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size);
-static void dynalink_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size);
-static void dynalink_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data);
-static u_int8_t dynalink_read_reg(struct isic_softc *sc, int what, bus_size_t offs);
-void isic_attach_Dyn(struct isic_softc *sc);
-#endif
-
-/* io address mapping */
-#define ISAC 0
-#define HSCX 1
-#define ADDR 2
-
-/* ADDR bits */
-#define ADDRMASK 0x7F
-#define RESET 0x80
-
-/* HSCX register offsets */
-#define HSCXA 0x00
-#define HSCXB 0x40
-
-#ifdef __FreeBSD__
-/* base address juggling */
-#define HSCXB_HACK 0x400
-#define IOBASE(addr) (((int)addr)&0x3FC)
-#define IOADDR(addr) (((int)addr)&0x3FF)
-#define IS_HSCXB_HACK(addr) ((((int)addr)&HSCXB_HACK)?HSCXB:HSCXA)
-
-/* ISIC probe and attach
-*/
-
-int
-isic_probe_Dyn(struct isa_device *dev, unsigned int iobase2)
-{
-
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Dynalink IS64PH.\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 4:
- case 5:
- case 9:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Dynalink IS64PH.\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Dynalink IS64PH.\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return (0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
- if ( (dev->id_iobase < 0x100) ||
- (dev->id_iobase > 0x3f8) ||
- (dev->id_iobase & 3) )
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for Dynalink!\n", dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = dynalink_read_reg;
- sc->writereg = dynalink_write_reg;
- sc->readfifo = dynalink_read_fifo;
- sc->writefifo = dynalink_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- ISAC_BASE = (caddr_t) sc->sc_port;
- HSCX_A_BASE = (caddr_t) sc->sc_port + 1;
- HSCX_B_BASE = (caddr_t) sc->sc_port + 1 + HSCXB_HACK;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Dynalink\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-int
-isic_attach_Dyn(struct isa_device *dev, unsigned int iobase2)
-{
- outb((dev->id_iobase)+ADDR, RESET);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase)+ADDR, 0);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-void isic_attach_Dyn(struct isic_softc *sc)
-{
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = dynalink_read_reg;
- sc->writereg = dynalink_write_reg;
- sc->readfifo = dynalink_read_fifo;
- sc->writefifo = dynalink_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for Dynalink PnP\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return;
- }
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ADDR, RESET);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ADDR, 0);
- DELAY(SEC_DELAY / 10);
-}
-
-#endif /* ISIC>0 && NPNP>0 && defined(DYNALINK) */
-
-/* LOW-LEVEL DEVICE ACCESS
-
- NOTE: The isdn4bsd code expects the two HSCX channels at different
- base addresses. I'm faking this, and remap them to the same address
- in the low-level routines. Search for HSCXB_HACK and IS_HSCXB_HACK.
-
- REM: this is only true for the FreeBSD version of I4B!
-*/
-
-#ifdef __FreeBSD__
-static void
-dynalink_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(IOBASE(base)+ADDR, 0+IS_HSCXB_HACK(base));
- insb(IOADDR(base), (u_char *)buf, (u_int)len);
-}
-#else
-static void
-dynalink_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, 0);
- bus_space_read_multi_1(t, h, ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA);
- bus_space_read_multi_1(t, h, HSCX, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB);
- bus_space_read_multi_1(t, h, HSCX, buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-dynalink_write_fifo(void *base, const void *buf, size_t len)
-{
- outb(IOBASE(base)+ADDR, 0+IS_HSCXB_HACK(base));
- outsb(IOADDR(base), (u_char *)buf, (u_int)len);
-}
-#else
-static void dynalink_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, 0);
- bus_space_write_multi_1(t, h, ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA);
- bus_space_write_multi_1(t, h, HSCX, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB);
- bus_space_write_multi_1(t, h, HSCX, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-dynalink_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb(IOBASE(base)+ADDR, (offset+IS_HSCXB_HACK(base))&ADDRMASK);
- outb(IOADDR(base), (u_char)v);
-}
-#else
-static void dynalink_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, offs);
- bus_space_write_1(t, h, ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+offs);
- bus_space_write_1(t, h, HSCX, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+offs);
- bus_space_write_1(t, h, HSCX, data);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static u_char
-dynalink_read_reg(u_char *base, u_int offset)
-{
- outb(IOBASE(base)+ADDR, (offset+IS_HSCXB_HACK(base))&ADDRMASK);
- return (inb(IOADDR(base)));
-}
-#else
-static u_int8_t dynalink_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, offs);
- return bus_space_read_1(t, h, ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+offs);
- return bus_space_read_1(t, h, HSCX);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+offs);
- return bus_space_read_1(t, h, HSCX);
- }
- return 0;
-}
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(DYNALINK) */
diff --git a/sys/i4b/layer1/i4b_elsa_isdnmc.c b/sys/i4b/layer1/i4b_elsa_isdnmc.c
deleted file mode 100644
index c6987f55adb2..000000000000
--- a/sys/i4b/layer1/i4b_elsa_isdnmc.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * ELSA MicroLink ISDN/MC card specific routines
- * ---------------------------------------------
- *
- * $Id: i4b_elsa_isdnmc.c,v 1.2 1998/12/05 18:04:33 hm Exp $
- *
- * last edit-date: [Tue Dec 1 07:45:53 1998]
- *
- * -mh added support for elsa ISDN/mc
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(ELSA_ISDNMC)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t elsa_isdnmc_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void elsa_isdnmc_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void elsa_isdnmc_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void elsa_isdnmc_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*
- * The ELSA MicroLink ISDN/MC uses one contigous IO region,
- * mapped by the pcmcia code.
- * The chip access is via three ports:
- */
-#define ISAC_DATA 1 /* ISAC dataport at offset 1 */
-#define HSCX_DATA 2 /* HSCX dataport at offset 2 */
-#define ADDR_LATCH 4 /* address latch at offset 4 */
-
-/* This is very similar to the ELSA QuickStep 1000 (ISA) card */
-
-/*---------------------------------------------------------------------------*
- * read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_read_fifo(void *buf, const void *base, size_t len)
-{
-}
-#else
-static void
-elsa_isdnmc_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_read_multi_1(t, h, ISAC_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_read_multi_1(t, h, HSCX_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40);
- bus_space_read_multi_1(t, h, HSCX_DATA, buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_write_fifo(void *base, const void *buf, size_t len)
-{
-}
-#else
-static void
-elsa_isdnmc_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_write_multi_1(t, h, ISAC_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_write_multi_1(t, h, HSCX_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40);
- bus_space_write_multi_1(t, h, HSCX_DATA, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_write_reg(u_char *base, u_int offset, u_int v)
-{
-}
-#else
-static void
-elsa_isdnmc_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- bus_space_write_1(t, h, ISAC_DATA, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- bus_space_write_1(t, h, HSCX_DATA, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40+offs);
- bus_space_write_1(t, h, HSCX_DATA, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-elsa_isdnmc_read_reg(u_char *base, u_int offset)
-{
- return 0;
-}
-#else
-static u_int8_t
-elsa_isdnmc_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- return bus_space_read_1(t, h, ISAC_DATA);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- return bus_space_read_1(t, h, HSCX_DATA);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40+offs);
- return bus_space_read_1(t, h, HSCX_DATA);
- }
- return 0;
-}
-#endif
-
-#ifdef __FreeBSD__
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_elsaisdnmc(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space */
- if (pcmcia_io_alloc(pa->pf, 0, cfe->iospace[0].length,
- cfe->iospace[0].length, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* OK, this will work! */
- sc->sc_cardtyp = CARD_TYPEP_ELSAMLIMC;
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = elsa_isdnmc_read_reg;
- sc->writereg = elsa_isdnmc_write_reg;
-
- sc->readfifo = elsa_isdnmc_read_fifo;
- sc->writefifo = elsa_isdnmc_write_fifo;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- return 1;
-}
-#endif
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_elsa_mcall.c b/sys/i4b/layer1/i4b_elsa_mcall.c
deleted file mode 100644
index 36882e912809..000000000000
--- a/sys/i4b/layer1/i4b_elsa_mcall.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * ELSA MicroLink MC/all card specific routines
- * --------------------------------------------
- *
- * $Id: i4b_elsa_mcall.c,v 1.1 1998/12/02 06:44:27 hm Exp $
- *
- * last edit-date: [Tue Dec 1 07:45:53 1998]
- *
- * -mh started support for ELSA MC/all
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(ELSA_MCALL)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_ipac.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t elsa_mcall_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void elsa_mcall_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void elsa_mcall_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void elsa_mcall_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int PCMCIA_IO_BASE = 0; /* ap: XXX hack */
-static void
-elsa_mcall_read_fifo(void *buf, const void *base, size_t len)
-{
-}
-#else
-static void
-elsa_mcall_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_mcall_write_fifo(void *base, const void *buf, size_t len)
-{
-}
-#else
-static void
-elsa_mcall_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_mcall_write_reg(u_char *base, u_int offset, u_int v)
-{
-}
-#else
-static void
-elsa_mcall_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-elsa_mcall_read_reg(u_char *base, u_int offset)
-{
- return 0;
-}
-#else
-static u_int8_t
-elsa_mcall_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
- return 0;
-}
-#endif
-
-#ifdef __FreeBSD__
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_elsamcall(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space */
- if (pcmcia_io_alloc(pa->pf, 0, cfe->iospace[0].length,
- cfe->iospace[0].length, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ELSAMLMCALL;
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = elsa_mcall_read_reg;
- sc->writereg = elsa_mcall_write_reg;
-
- sc->readfifo = elsa_mcall_read_fifo;
- sc->writefifo = elsa_mcall_write_fifo;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- return 1;
-}
-#endif
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_elsa_qs1i.c b/sys/i4b/layer1/i4b_elsa_qs1i.c
deleted file mode 100644
index a6b5181c65d0..000000000000
--- a/sys/i4b/layer1/i4b_elsa_qs1i.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro ISA
- * =====================================================================
- *
- * $Id: i4b_elsa_qs1i.c,v 1.1 1998/12/27 21:46:45 phk Exp $
- *
- * last edit-date: [Mon Dec 14 17:27:08 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(ELSA_QS1ISA)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifdef __FreeBSD__
-/* static void i4b_eq1i_clrirq(void* base); */
-#else
-static void i4b_eq1i_clrirq(struct isic_softc *sc);
-void isic_attach_Eqs1pi __P((struct isic_softc *sc));
-#endif
-
-/* masks for register encoded in base addr */
-
-#define ELSA_BASE_MASK 0x0ffff
-#define ELSA_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define ELSA_IDISAC 0x00000
-#define ELSA_IDHSCXA 0x10000
-#define ELSA_IDHSCXB 0x20000
-
-/* offsets from base address */
-
-#define ELSA_OFF_ISAC 0x00
-#define ELSA_OFF_HSCX 0x02
-#define ELSA_OFF_OFF 0x03
-#define ELSA_OFF_CTRL 0x04
-#define ELSA_OFF_CFG 0x05
-#define ELSA_OFF_TIMR 0x06
-#define ELSA_OFF_IRQ 0x07
-
-/* control register (write access) */
-
-#define ELSA_CTRL_LED_YELLOW 0x02
-#define ELSA_CTRL_LED_GREEN 0x08
-#define ELSA_CTRL_RESET 0x20
-#define ELSA_CTRL_TIMEREN 0x80
-#define ELSA_CTRL_SECRET 0x50
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA clear IRQ routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-#ifdef notdef
-static void
-i4b_eq1i_clrirq(void* base)
-{
- outb((u_int)base + ELSA_OFF_IRQ, 0);
-}
-#endif
-#else
-static void
-i4b_eq1i_clrirq(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_read_fifo(void *buf, const void *base, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0x40);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pi_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_read_multi_1(t, h, ELSA_OFF_ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_read_multi_1(t, h, ELSA_OFF_HSCX, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40);
- bus_space_read_multi_1(t, h, ELSA_OFF_HSCX, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_write_fifo(void *base, const void *buf, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0x40);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pi_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_write_multi_1(t, h, ELSA_OFF_ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_write_multi_1(t, h, ELSA_OFF_HSCX, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40);
- bus_space_write_multi_1(t, h, ELSA_OFF_HSCX, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_write_reg(u_char *base, u_int offset, u_int v)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)(offset+0x40));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX, (u_char)v);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC, (u_char)v);
- }
-}
-
-#else
-
-static void
-eqs1pi_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- bus_space_write_1(t, h, ELSA_OFF_ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- bus_space_write_1(t, h, ELSA_OFF_HSCX, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40+offs);
- bus_space_write_1(t, h, ELSA_OFF_HSCX, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-eqs1pi_read_reg(u_char *base, u_int offset)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)(offset+0x40));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX));
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC));
- }
-}
-
-#else
-
-static u_int8_t
-eqs1pi_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- return bus_space_read_1(t, h, ELSA_OFF_ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- return bus_space_read_1(t, h, ELSA_OFF_HSCX);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40+offs);
- return bus_space_read_1(t, h, ELSA_OFF_HSCX);
- }
- return 0;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic_probe_Eqs1pi - probe for ELSA QuickStep 1000pro/ISA and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_Eqs1pi(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 4:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- if(!((dev->id_iobase >= 0x160) && (dev->id_iobase <= 0x360)))
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
-/* XXX no "sc_clearirq" in sight... /phk
- sc->sc_clearirq = i4b_eq1i_clrirq;
-*/
- sc->readreg = eqs1pi_read_reg;
- sc->writereg = eqs1pi_write_reg;
-
- sc->readfifo = eqs1pi_read_fifo;
- sc->writefifo = eqs1pi_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1ISA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDISAC);
- HSCX_A_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDHSCXA);
- HSCX_B_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDHSCXB);
-
- /*
- * Read HSCX A/B VSTR. Expected value for the ELSA QuickStep 1000pro
- * ISA card is 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for ELSA QuickStep 1000pro/ISA\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach ELSA QuickStep 1000pro/ISA
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Eqs1pi(struct isa_device *dev, unsigned int iobase2)
-{
- u_char byte = ELSA_CTRL_SECRET;
-
- byte &= ~ELSA_CTRL_RESET;
- outb(dev->id_iobase + ELSA_OFF_CTRL, byte);
- DELAY(20);
- byte |= ELSA_CTRL_RESET;
- outb(dev->id_iobase + ELSA_OFF_CTRL, byte);
-
- DELAY(20);
- outb(dev->id_iobase + ELSA_OFF_IRQ, 0xff);
-
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_Eqs1pi(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_char byte = ELSA_CTRL_SECRET;
-
- byte &= ~ELSA_CTRL_RESET;
- bus_space_write_1(t, h, ELSA_OFF_CTRL, byte);
- DELAY(20);
- byte |= ELSA_CTRL_RESET;
- bus_space_write_1(t, h, ELSA_OFF_CTRL, byte);
-
- DELAY(20);
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0xff);
-
- /* setup access routines */
-
- sc->clearirq = i4b_eq1i_clrirq;
- sc->readreg = eqs1pi_read_reg;
- sc->writereg = eqs1pi_write_reg;
-
- sc->readfifo = eqs1pi_read_fifo;
- sc->writefifo = eqs1pi_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1ISA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(ELSA_QS1ISA) */
diff --git a/sys/i4b/layer1/i4b_elsa_qs1p.c b/sys/i4b/layer1/i4b_elsa_qs1p.c
deleted file mode 100644
index b2b35d03fc34..000000000000
--- a/sys/i4b/layer1/i4b_elsa_qs1p.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro PCI
- * =====================================================================
- *
- * $Id: i4b_elsa_qs1p.c,v 1.4 1998/12/05 18:04:36 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:22:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pci.h"
-#else
-#define NISIC 1
-#endif
-
-#if (NISIC > 0) && /* (NPCI > 0) && */ defined(ELSA_QS1PCI)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcidevs.h>
-
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_ipac.h>
-
-#ifndef __FreeBSD__
-/* we don't have the function prototypes in the global i4b_l1.h any more */
-void isic_attach_Eqs1pp __P((struct isic_softc *sc, struct pci_attach_args *pa));
-#endif
-
-/* masks for register encoded in base addr */
-
-#define ELSA_BASE_MASK 0x0ffff
-#define ELSA_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define ELSA_IDISAC 0x00000
-#define ELSA_IDHSCXA 0x10000
-#define ELSA_IDHSCXB 0x20000
-#define ELSA_IDIPAC 0x40000
-
-/* offsets from base address */
-
-#define ELSA_OFF_ALE 0x00
-#define ELSA_OFF_RW 0x01
-
-#define ELSA_PORT0_MAPOFF PCI_MAPREG_START+4
-#define ELSA_PORT1_MAPOFF PCI_MAPREG_START+12
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_read_fifo(void *buf, const void *base, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pp_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_fifo(void *base, const void *buf, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pp_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_reg(u_char *base, u_int offset, u_int v)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXB_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXA_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_ISAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else /* IPAC */
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_IPAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
-}
-
-#else
-
-static void
-eqs1pp_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_IPAC_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-eqs1pp_read_reg(u_char *base, u_int offset)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXB_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXA_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_ISAC_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else /* IPAC */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_IPAC_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
-}
-
-#else
-
-static u_int8_t
-eqs1pp_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_IPAC:
- {
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_IPAC_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- }
- }
-
- return 0;
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Eqs1pp - attach for ELSA QuickStep 1000pro/PCI
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_Eqs1pp(int unit, unsigned int iobase1, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[unit];
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA QuickStep 1000pro/PCI!\n",
- unit, unit);
- return(0);
- }
- sc->sc_unit = unit;
-
- /* setup iobase */
-
- if((iobase2 <= 0) || (iobase2 > 0xffff))
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for ELSA QuickStep 1000pro/PCI!\n",
- unit, iobase2);
- return(0);
- }
- sc->sc_port = iobase2;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = eqs1pp_read_reg;
- sc->writereg = eqs1pp_write_reg;
-
- sc->readfifo = eqs1pp_read_fifo;
- sc->writefifo = eqs1pp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1PCI;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* setup chip type = IPAC ! */
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDISAC);
- HSCX_A_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDHSCXA);
- HSCX_B_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDHSCXB);
- IPAC_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDIPAC);
-
- /* enable hscx/isac irq's */
- IPAC_WRITE(IPAC_MASK, (IPAC_MASK_INT1 | IPAC_MASK_INT0));
-
- IPAC_WRITE(IPAC_ACFG, 0); /* outputs are open drain */
- IPAC_WRITE(IPAC_AOE, /* aux 5..2 are inputs, 7, 6 outputs */
- (IPAC_AOE_OE5 | IPAC_AOE_OE4 | IPAC_AOE_OE3 | IPAC_AOE_OE2));
- IPAC_WRITE(IPAC_ATX, 0xff); /* set all output lines high */
-
- outb(iobase1 + 0x4c, 0x41); /* enable card interrupt */
-
- return (1);
-}
-
-#else /* !FreeBSD */
-
-void
-isic_attach_Eqs1pp(sc, pa)
- struct isic_softc *sc;
- struct pci_attach_args *pa;
-{
- /* setup io mappings */
- sc->sc_num_mappings = 2;
- MALLOC_MAPS(sc);
- sc->sc_maps[0].size = 0;
- if (pci_mapreg_map(pa, ELSA_PORT0_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
- &sc->sc_maps[0].t, &sc->sc_maps[0].h, NULL, NULL)) {
- printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
- return;
- }
- sc->sc_maps[1].size = 0;
- if (pci_mapreg_map(pa, ELSA_PORT1_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
- &sc->sc_maps[1].t, &sc->sc_maps[1].h, NULL, NULL)) {
- printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
- return;
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = eqs1pp_read_reg;
- sc->writereg = eqs1pp_write_reg;
-
- sc->readfifo = eqs1pp_read_fifo;
- sc->writefifo = eqs1pp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1PCI;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* setup chip type = IPAC ! */
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- /* enable hscx/isac irq's */
- IPAC_WRITE(IPAC_MASK, (IPAC_MASK_INT1 | IPAC_MASK_INT0));
-
- IPAC_WRITE(IPAC_ACFG, 0); /* outputs are open drain */
- IPAC_WRITE(IPAC_AOE, /* aux 5..2 are inputs, 7, 6 outputs */
- (IPAC_AOE_OE5 | IPAC_AOE_OE4 | IPAC_AOE_OE3 | IPAC_AOE_OE2));
- IPAC_WRITE(IPAC_ATX, 0xff); /* set all output lines high */
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 0x4c, 0x41); /* enable card interrupt */
-}
-
-#endif
-
-#endif /* (NISIC > 0) && defined(ELSA_QS1PCI) */
diff --git a/sys/i4b/layer1/i4b_hscx.c b/sys/i4b/layer1/i4b_hscx.c
deleted file mode 100644
index ed80a51c5731..000000000000
--- a/sys/i4b/layer1/i4b_hscx.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b - Siemens HSCX chip (B-channel) handling
- * --------------------------------------------
- *
- * $Id: i4b_hscx.c,v 1.37 1998/12/05 18:04:38 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* doesn't matter in non-FreeBSD, config(8) d.t.r.t. */
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-/*---------------------------------------------------------------------------*
- * HSCX IRQ Handler
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_irq(register struct isic_softc *sc, u_char ista, int h_chan, u_char ex_irq)
-{
- register isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- u_char exir = 0;
- int activity = -1;
- u_char cmd = 0;
-
- DBGL1(L1_H_IRQ, "isic_hscx_irq", ("%#x\n", ista));
-
- if(ex_irq)
- {
- /* get channel extended irq reg */
-
- exir = HSCX_READ(h_chan, H_EXIR);
-
- if(exir & HSCX_EXIR_RFO)
- {
- chan->stat_RFO++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("ex_irq: receive data overflow\n"));
- }
-
- if((exir & HSCX_EXIR_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("ex_irq: xmit data underrun\n"));
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_XRES);
-
- if (chan->out_mbuf_head != NULL) /* don't continue to transmit this buffer */
- {
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_cur = chan->out_mbuf_head = NULL;
- }
- }
-
- }
-
- /* rx message end, end of frame */
-
- if(ista & HSCX_ISTA_RME)
- {
- register int fifo_data_len;
- u_char rsta;
- int error = 0;
-
- rsta = HSCX_READ(h_chan, H_RSTA);
-
- if((rsta & 0xf0) != 0xa0)
- {
- if((rsta & HSCX_RSTA_VFR) == 0)
- {
- chan->stat_VFR++;
- cmd |= (HSCX_CMDR_RHR);
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("received invalid Frame\n"));
- error++;
- }
-
- if(rsta & HSCX_RSTA_RDO)
- {
- chan->stat_RDO++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("receive data overflow\n"));
- error++;
- }
-
- if((rsta & HSCX_RSTA_CRC) == 0)
- {
- chan->stat_CRC++;
- cmd |= (HSCX_CMDR_RHR);
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("CRC check failed\n"));
- error++;
- }
-
- if(rsta & HSCX_RSTA_RAB)
- {
- chan->stat_RAB++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("Receive message aborted\n"));
- error++;
- }
- }
-
- fifo_data_len = ((HSCX_READ(h_chan, H_RBCL)) &
- ((sc->sc_bfifolen)-1));
-
- if(fifo_data_len == 0)
- fifo_data_len = sc->sc_bfifolen;
-
- /* all error conditions checked, now decide and take action */
-
- if(error == 0)
- {
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- fifo_data_len -= 1; /* last byte in fifo is RSTA ! */
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, fifo_data_len);
-
- cmd |= (HSCX_CMDR_RMC);
- isic_hscx_cmd(sc, h_chan, cmd);
- cmd = 0;
-
- chan->in_len += fifo_data_len;
- chan->rxcount += fifo_data_len;
-
- /* setup mbuf data length */
-
- chan->in_mbuf->m_len = chan->in_len;
- chan->in_mbuf->m_pkthdr.len = chan->in_len;
-
- if(sc->sc_trace & TRACE_B_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
-
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("RAWHDLC rx buffer overflow in RME, in_len=%d, fifolen=%d\n", chan->in_len, fifo_data_len));
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (HSCX_CMDR_RHR | HSCX_CMDR_RMC);
- }
- }
- else
- {
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- cmd |= (HSCX_CMDR_RMC);
- }
- }
-
- /* rx fifo full */
-
- if(ista & HSCX_ISTA_RPF)
- {
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RPF, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- chan->rxcount += sc->sc_bfifolen;
-
- if((chan->in_len + sc->sc_bfifolen) <= BCH_MAX_DATALEN)
- {
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, sc->sc_bfifolen);
-
- chan->in_cbptr += sc->sc_bfifolen;
- chan->in_len += sc->sc_bfifolen;
- }
- else
- {
- if(chan->bprot == BPROT_NONE)
- {
- /* setup mbuf data length */
-
- chan->in_mbuf->m_len = chan->in_len;
- chan->in_mbuf->m_pkthdr.len = chan->in_len;
-
- if(sc->sc_trace & TRACE_B_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- /* move rx'd data to rx queue */
-
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
-
- (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
-
- if(!(isic_hscx_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RPF, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, sc->sc_bfifolen);
-
- chan->in_cbptr += sc->sc_bfifolen;
- chan->in_len = sc->sc_bfifolen;
-
- chan->rxcount += sc->sc_bfifolen;
- }
- else
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("RAWHDLC rx buffer overflow in RPF, in_len=%d\n", chan->in_len));
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (HSCX_CMDR_RHR);
- }
- }
-
- /* command to release fifo space */
-
- cmd |= HSCX_CMDR_RMC;
- }
-
- /* transmit fifo empty, new data can be written to fifo */
-
- if(ista & HSCX_ISTA_XPR)
- {
- /*
- * for a description what is going on here, please have
- * a look at isic_bchannel_start() in i4b_bchan.c !
- */
-
- int activity = -1;
- int len;
- int nextlen;
-
- DBGL1(L1_H_IRQ, "isic_hscx_irq", ("unit %d, chan %d - XPR, Tx Fifo Empty!\n", sc->sc_unit, h_chan));
-
- if(chan->out_mbuf_cur == NULL) /* last frame is transmitted */
- {
- IF_DEQUEUE(&chan->tx_queue, chan->out_mbuf_head);
-
- if(chan->out_mbuf_head == NULL)
- {
- chan->state &= ~HSCX_TX_ACTIVE;
- (*chan->drvr_linktab->bch_tx_queue_empty)(chan->drvr_linktab->unit);
- }
- else
- {
- chan->state |= HSCX_TX_ACTIVE;
- chan->out_mbuf_cur = chan->out_mbuf_head;
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(isic_hscx_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
- }
- }
-
- len = 0;
-
- while(chan->out_mbuf_cur && len != sc->sc_bfifolen)
- {
- nextlen = min(chan->out_mbuf_cur_len, sc->sc_bfifolen - len);
-
-#ifdef NOTDEF
- printf("i:mh=%x, mc=%x, mcp=%x, mcl=%d l=%d nl=%d # ",
- chan->out_mbuf_head,
- chan->out_mbuf_cur,
- chan->out_mbuf_cur_ptr,
- chan->out_mbuf_cur_len,
- len,
- next_len);
-#endif
-
- isic_hscx_waitxfw(sc, h_chan); /* necessary !!! */
-
- HSCX_WRFIFO(h_chan, chan->out_mbuf_cur_ptr, nextlen);
- cmd |= HSCX_CMDR_XTF;
-
- len += nextlen;
- chan->txcount += nextlen;
-
- chan->out_mbuf_cur_ptr += nextlen;
- chan->out_mbuf_cur_len -= nextlen;
-
- if(chan->out_mbuf_cur_len == 0)
- {
- if((chan->out_mbuf_cur = chan->out_mbuf_cur->m_next) != NULL)
- {
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
- }
- else
- {
- if (chan->bprot != BPROT_NONE)
- cmd |= HSCX_CMDR_XME;
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_head = NULL;
- }
-
- }
- }
- }
-
- if(cmd) /* is there a command for the HSCX ? */
- {
- isic_hscx_cmd(sc, h_chan, cmd); /* yes, to HSCX */
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->drvr_linktab->bch_activity)(chan->drvr_linktab->unit, activity);
-}
-
-/*---------------------------------------------------------------------------*
- * HSCX initialization
- *
- * for telephony: extended transparent mode 1
- * for raw hdlc: transparent mode 0
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_init(struct isic_softc *sc, int h_chan, int activate)
-{
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
-
- HSCX_WRITE(h_chan, H_MASK, 0xff); /* mask irq's */
-
- if(sc->sc_ipac)
- {
- /* CCR1: Power Up, Clock Mode 5 */
- HSCX_WRITE(h_chan, H_CCR1, HSCX_CCR1_PU | /* power up */
- HSCX_CCR1_CM1); /* IPAC clock mode 5 */
- }
- else
- {
- /* CCR1: Power Up, Clock Mode 5 */
- HSCX_WRITE(h_chan, H_CCR1, HSCX_CCR1_PU | /* power up */
- HSCX_CCR1_CM2 | /* HSCX clock mode 5 */
- HSCX_CCR1_CM0);
- }
-
- /* XAD1: Transmit Address Byte 1 */
- HSCX_WRITE(h_chan, H_XAD1, 0xff);
-
- /* XAD2: Transmit Address Byte 2 */
- HSCX_WRITE(h_chan, H_XAD2, 0xff);
-
- /* RAH2: Receive Address Byte High Reg. 2 */
- HSCX_WRITE(h_chan, H_RAH2, 0xff);
-
- /* XBCH: reset Transmit Byte Count High */
- HSCX_WRITE(h_chan, H_XBCH, 0x00);
-
- /* RLCR: reset Receive Length Check Register */
- HSCX_WRITE(h_chan, H_RLCR, 0x00);
-
- /* CCR2: set tx/rx clock shift bit 0 */
- /* disable CTS irq, disable RIE irq*/
- HSCX_WRITE(h_chan, H_CCR2, HSCX_CCR2_XCS0|HSCX_CCR2_RCS0);
-
- /* XCCR: tx bit count per time slot */
- HSCX_WRITE(h_chan, H_XCCR, 0x07);
-
- /* RCCR: rx bit count per time slot */
- HSCX_WRITE(h_chan, H_RCCR, 0x07);
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- {
- switch(h_chan)
- {
- case HSCX_CH_A: /* Prepare HSCX channel A */
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x2f);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x2f);
- break;
-
- case HSCX_CH_B: /* Prepare HSCX channel B */
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x03);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x03);
- break;
- }
- }
- else /* IOM 1 setup */
- {
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x07);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x07);
- }
-
- if(activate)
- {
- if(chan->bprot == BPROT_RHDLC)
- {
- /* HDLC Frames, transparent mode 0 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_RAC|HSCX_MODE_RTS);
- }
- else
- {
- /* Raw Telephony, extended transparent mode 1 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_MDS0|HSCX_MODE_ADM|HSCX_MODE_RTS);
- }
-
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_RHR|HSCX_CMDR_XRES);
- }
- else
- {
- /* TSAX: tx time slot */
- HSCX_WRITE(h_chan, H_TSAX, 0xff);
-
- /* TSAR: rx time slot */
- HSCX_WRITE(h_chan, H_TSAR, 0xff);
-
- /* Raw Telephony, extended transparent mode 1 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_MDS0|HSCX_MODE_ADM|HSCX_MODE_RTS);
- }
-
- /* don't touch ICA, EXA and EXB bits, this could be HSCX_CH_B */
- /* always disable RSC and TIN */
-
- chan->hscx_mask |= HSCX_MASK_RSC | HSCX_MASK_TIN;
-
- if(activate)
- {
- /* enable */
- chan->hscx_mask &= ~(HSCX_MASK_RME | HSCX_MASK_RPF | HSCX_MASK_XPR);
- }
- else
- {
- /* disable */
- chan->hscx_mask |= HSCX_MASK_RME | HSCX_MASK_RPF | HSCX_MASK_XPR;
- }
-
- /* handle ICA, EXA, and EXB via interrupt mask of channel b */
-
- if (h_chan == HSCX_CH_A)
- {
- if (activate)
- HSCX_B_IMASK &= ~(HSCX_MASK_EXA | HSCX_MASK_ICA);
- else
- HSCX_B_IMASK |= HSCX_MASK_EXA | HSCX_MASK_ICA;
- HSCX_WRITE(HSCX_CH_A, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
- else
- {
- if (activate)
- HSCX_B_IMASK &= ~HSCX_MASK_EXB;
- else
- HSCX_B_IMASK |= HSCX_MASK_EXB;
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
-
- /* clear spurious interrupts left over */
-
- if(h_chan == HSCX_CH_A)
- {
- HSCX_READ(h_chan, H_EXIR);
- HSCX_READ(h_chan, H_ISTA);
- }
- else /* mask ICA, because it must not be cleared by reading ISTA */
- {
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK | HSCX_MASK_ICA);
- HSCX_READ(h_chan, H_EXIR);
- HSCX_READ(h_chan, H_ISTA);
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * write command to HSCX command register
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_cmd(struct isic_softc *sc, int h_chan, unsigned char cmd)
-{
- int timeout = 20;
-
- while(((HSCX_READ(h_chan, H_STAR)) & HSCX_STAR_CEC) && timeout)
- {
- DELAY(10);
- timeout--;
- }
-
- if(timeout == 0)
- {
- DBGL1(L1_H_ERR, "isic_hscx_cmd", ("HSCX wait for CEC timeout!\n"));
- }
-
- HSCX_WRITE(h_chan, H_CMDR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * wait for HSCX transmit FIFO write enable
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_waitxfw(struct isic_softc *sc, int h_chan)
-{
-#define WAITVAL 50
-#define WAITTO 200
-
- int timeout = WAITTO;
-
- while((!(((HSCX_READ(h_chan, H_STAR)) &
- (HSCX_STAR_CEC | HSCX_STAR_XFW)) == HSCX_STAR_XFW)) && timeout)
- {
- DELAY(WAITVAL);
- timeout--;
- }
-
- if(timeout == 0)
- {
- DBGL1(L1_H_ERR, "isic_hscx_waitxfw", ("HSCX wait for XFW timeout!\n"));
- }
- else if (timeout != WAITTO)
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_waitxfw", ("HSCX wait for XFW time: %d uS\n", (WAITTO-timeout)*50));
- }
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_hscx.h b/sys/i4b/layer1/i4b_hscx.h
deleted file mode 100644
index 1b1640de2282..000000000000
--- a/sys/i4b/layer1/i4b_hscx.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Gary Jennejohn. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * $Id: i4b_hscx.h,v 1.3 1998/02/13 17:00:31 hm Exp $
- *
- * last edit-date: [Thu Feb 5 13:38:50 1998]
- *
- * -hm added AVM config register defs
- * -hm split up for rewrite of Siemens chipset driver
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef I4B_HSCX_H_
-#define I4B_HSCX_H_
-
-enum HSCX_VERSIONS {
- HSCX_VA1, /* 82525 A1 */
- HSCX_UNKN1, /* unknown 1 */
- HSCX_VA2, /* 82525 A2 */
- HSCX_UNKN3, /* unknown 3 */
- HSCX_VA3, /* 82525 A3 */
- HSCX_V21, /* 82525 2.1 */
- HSCX_UNKN /* unknown version */
-};
-
-#define HSCX_CH_A 0 /* channel A */
-#define HSCX_CH_B 1 /* channel B */
-
-#define HSCX_FIFO_LEN 32 /* 32 bytes FIFO on chip */
-
-/*
- * definitions of registers and bits for the HSCX ISDN chip.
- */
-
-typedef struct hscx_reg {
-
- /* 32 byte deep FIFO always first */
-
- unsigned char hscx_fifo [HSCX_FIFO_LEN];
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char hscx_ista;
- unsigned char hscx_star;
- unsigned char hscx_mode;
- unsigned char hscx_timr;
- unsigned char hscx_exir;
- unsigned char hscx_rbcl;
- unsigned char dummy_26;
- unsigned char hscx_rsta;
- unsigned char hscx_ral1;
- unsigned char hscx_rhcr;
- unsigned char dummy_2a;
- unsigned char dummy_2b;
- unsigned char hscx_ccr2;
- unsigned char hscx_rbch;
- unsigned char hscx_vstr;
- unsigned char hscx_ccr;
- unsigned char dummy_30;
- unsigned char dummy_31;
- unsigned char dummy_32;
- unsigned char dummy_33;
- } hscx_r;
- struct {
- unsigned char hscx_mask;
- unsigned char hscx_cmdr;
- unsigned char hscx_mode;
- unsigned char hscx_timr;
- unsigned char hscx_xad1;
- unsigned char hscx_xad2;
- unsigned char hscx_rah1;
- unsigned char hscx_rah2;
- unsigned char hscx_ral1;
- unsigned char hscx_ral2;
- unsigned char hscx_xbcl;
- unsigned char hscx_bgr;
- unsigned char hscx_ccr2;
- unsigned char hscx_xbch;
- unsigned char hscx_rlcr;
- unsigned char hscx_ccr1;
- unsigned char hscx_tsax;
- unsigned char hscx_tsar;
- unsigned char hscx_xccr;
- unsigned char hscx_rccr;
- } hscx_w;
- } hscx_rw;
-} hscx_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* HSCX read registers */
-
-#define h_ista hscx_rw.hscx_r.hscx_ista
-#define H_ISTA REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ista)
-#define h_star hscx_rw.hscx_r.hscx_star
-#define H_STAR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_star)
-#define h_mode hscx_rw.hscx_r.hscx_mode
-#define H_MODE REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_mode)
-#define h_timr hscx_rw.hscx_r.hscx_timr
-#define H_TIMR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_timr)
-#define h_exir hscx_rw.hscx_r.hscx_exir
-#define H_EXIR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_exir)
-#define h_rbcl hscx_rw.hscx_r.hscx_rbcl
-#define H_RBCL REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rbcl)
-#define h_rsta hscx_rw.hscx_r.hscx_rsta
-#define H_RSTA REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rsta)
-#define h_ral1 hscx_rw.hscx_r.hscx_ral1
-#define H_RAL1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ral1)
-#define h_rhcr hscx_rw.hscx_r.hscx_rhcr
-#define H_RHCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rhcr)
-#define h_ccr2 hscx_rw.hscx_r.hscx_ccr2
-#define H_CCR2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ccr2)
-#define h_rbch hscx_rw.hscx_r.hscx_rbch
-#define H_RBCH REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rbch)
-#define h_vstr hscx_rw.hscx_r.hscx_vstr
-#define H_VSTR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_vstr)
-#define h_ccr hscx_rw.hscx_r.hscx_ccr
-#define H_CCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ccr)
-
-/* HSCX write registers - for hscx_mode, hscx_timr, hscx_ral1, hscx_ccr2 */
-/* see read registers */
-
-#define h_mask hscx_rw.hscx_w.hscx_mask
-#define H_MASK REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_mask)
-#define h_cmdr hscx_rw.hscx_w.hscx_cmdr
-#define H_CMDR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_cmdr)
-#define h_xad1 hscx_rw.hscx_w.hscx_xad1
-#define H_XAD1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xad1)
-#define h_xad2 hscx_rw.hscx_w.hscx_xad2
-#define H_XAD2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xad2)
-#define h_rah1 hscx_rw.hscx_w.hscx_rah1
-#define H_RAH1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rah1)
-#define h_rah2 hscx_rw.hscx_w.hscx_rah2
-#define H_RAH2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rah2)
-#define h_ral2 hscx_rw.hscx_w.hscx_ral2
-#define H_RAL2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_ral2)
-#define h_xbcl hscx_rw.hscx_w.hscx_xbcl
-#define H_XBCL REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xbcl)
-#define h_bgr hscx_rw.hscx_w.hscx_bgr
-#define H_BGR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_bgr)
-#define h_xbch hscx_rw.hscx_w.hscx_xbch
-#define H_XBCH REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xbch)
-#define h_rlcr hscx_rw.hscx_w.hscx_rlcr
-#define H_RLCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rlcr)
-#define h_ccr1 hscx_rw.hscx_w.hscx_ccr1
-#define H_CCR1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_ccr1)
-#define h_tsax hscx_rw.hscx_w.hscx_tsax
-#define H_TSAX REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_tsax)
-#define h_tsar hscx_rw.hscx_w.hscx_tsar
-#define H_TSAR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_tsar)
-#define h_xccr hscx_rw.hscx_w.hscx_xccr
-#define H_XCCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xccr)
-#define h_rccr hscx_rw.hscx_w.hscx_rccr
-#define H_RCCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rccr)
-
-#define HSCX_ISTA_RME 0x80
-#define HSCX_ISTA_RPF 0x40
-#define HSCX_ISTA_RSC 0x20
-#define HSCX_ISTA_XPR 0x10
-#define HSCX_ISTA_TIN 0x08
-#define HSCX_ISTA_ICA 0x04
-#define HSCX_ISTA_EXA 0x02
-#define HSCX_ISTA_EXB 0x01
-
-#define HSCX_MASK_RME 0x80
-#define HSCX_MASK_RPF 0x40
-#define HSCX_MASK_RSC 0x20
-#define HSCX_MASK_XPR 0x10
-#define HSCX_MASK_TIN 0x08
-#define HSCX_MASK_ICA 0x04
-#define HSCX_MASK_EXA 0x02
-#define HSCX_MASK_EXB 0x01
-
-#define HSCX_EXIR_XMR 0x80
-#define HSCX_EXIR_XDU 0x40
-#define HSCX_EXIR_PCE 0x20
-#define HSCX_EXIR_RFO 0x10
-#define HSCX_EXIR_CSC 0x08
-#define HSCX_EXIR_RFS 0x04
-
-/* the other bits are always 0 */
-
-#define HSCX_STAR_XDOV 0x80
-#define HSCX_STAR_XFW 0x40
-#define HSCX_STAR_XRNR 0x20
-#define HSCX_STAR_RRNR 0x10
-#define HSCX_STAR_RLI 0x08
-#define HSCX_STAR_CEC 0x04
-#define HSCX_STAR_CTS 0x02
-#define HSCX_STAR_WFA 0x01
-
-#define HSCX_CMDR_RMC 0x80
-#define HSCX_CMDR_RHR 0x40
-/* also known as XREP in transparent mode */
-#define HSCX_CMDR_RNR 0x20
-#define HSCX_CMDR_STI 0x10
-#define HSCX_CMDR_XTF 0x08
-#define HSCX_CMDR_XIF 0x04
-#define HSCX_CMDR_XME 0x02
-#define HSCX_CMDR_XRES 0x01
-
-#define HSCX_MODE_MDS1 0x80
-#define HSCX_MODE_MDS0 0x40
-#define HSCX_MODE_ADM 0x20
-#define HSCX_MODE_TMD 0x10
-#define HSCX_MODE_RAC 0x08
-#define HSCX_MODE_RTS 0x04
-#define HSCX_MODE_TRS 0x02
-#define HSCX_MODE_TLP 0x01
-
-#define HSCX_RSTA_VFR 0x80
-#define HSCX_RSTA_RDO 0x40
-#define HSCX_RSTA_CRC 0x20
-#define HSCX_RSTA_RAB 0x10
-#define HSCX_RSTA_HA1 0x08
-#define HSCX_RSTA_HA0 0x04
-#define HSCX_RSTA_CR 0x02
-#define HSCX_RSTA_LA 0x01
-
-#define HSCX_RSTA_MASK 0xf0 /* the interesting ones */
-
-/* only used in DMA mode */
-#define HSCX_XBCH_DMA 0x80
-#define HSCX_XBCH_NRM 0x40
-#define HSCX_XBCH_CAS 0x20
-#define HSCX_XBCH_XC 0x10
-/* the rest are bits 11 thru 8 of the byte count */
-
-#define HSCX_RBCH_DMA 0x80
-#define HSCX_RBCH_NRM 0x40
-#define HSCX_RBCH_CAS 0x20
-#define HSCX_RBCH_OV 0x10
-/* the rest are bits 11 thru 8 of the byte count */
-
-#define HSCX_VSTR_CD 0x80
-/* bits 6 thru 4 are 0 */
-/* bits 3 thru 0 are the version number */
-
-#define HSCX_RLCR_RC 0x80
-/* the rest of the bits are used to set the received length */
-
-#define HSCX_CCR1_PU 0x80
-/* bits 6 and 5 are SC1 SC0 */
-#define HSCX_CCR1_ODS 0x10
-#define HSCX_CCR1_ITF 0x08
-#define HSCX_CCR1_CM2 0x04
-#define HSCX_CCR1_CM1 0x02
-#define HSCX_CCR1_CM0 0x01
-
-/* for clock mode 5 */
-#define HSCX_CCR2_SOC2 0x80
-#define HSCX_CCR2_SOC1 0x40
-#define HSCX_CCR2_XCS0 0x20
-#define HSCX_CCR2_RCS0 0x10
-#define HSCX_CCR2_TIO 0x08
-#define HSCX_CCR2_CIE 0x04
-#define HSCX_CCR2_RIE 0x02
-#define HSCX_CCR2_DIV 0x01
-
-/* bits 7 thru 2 are TSNX */
-#define HSCX_TSAX_XCS2 0x02
-#define HSCX_TSAX_XCS1 0x01
-
-/* bits 7 thru 2 are TSNR */
-#define HSCX_TSAR_RCS2 0x02
-#define HSCX_TSAR_RCS1 0x01
-
-#endif /* I4B_HSCX_H_ */
diff --git a/sys/i4b/layer1/i4b_ipac.h b/sys/i4b/layer1/i4b_ipac.h
deleted file mode 100644
index 79d8bc9656bd..000000000000
--- a/sys/i4b/layer1/i4b_ipac.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ipac.h - definitions for the Siemens IPAC PSB2115 chip
- * ==========================================================
- *
- * $Id: i4b_ipac.h,v 1.4 1998/12/05 18:04:39 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:50 1998]
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef _I4B_IPAC_H_
-#define _I4B_IPAC_H_
-
-#define IPAC_BFIFO_LEN 64 /* 64 bytes B-channel FIFO on chip */
-
-#define IPAC_HSCXA_OFF 0x00
-#define IPAC_HSCXB_OFF 0x40
-#define IPAC_ISAC_OFF 0x80
-#define IPAC_IPAC_OFF 0xc0
-
-/*
- * definitions of registers and bits for the IPAC ISDN chip.
- */
-
-typedef struct ipac_reg {
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char ipac_conf;
- unsigned char ipac_ista;
- unsigned char ipac_id;
- unsigned char ipac_acfg;
- unsigned char ipac_aoe;
- unsigned char ipac_arx;
- unsigned char ipac_pita1;
- unsigned char ipac_pita2;
- unsigned char ipac_pota1;
- unsigned char ipac_pota2;
- unsigned char ipac_pcfg;
- unsigned char ipac_scfg;
- unsigned char ipac_timr2;
- } ipac_r;
- struct {
- unsigned char ipac_conf;
- unsigned char ipac_mask;
- unsigned char ipac_dummy;
- unsigned char ipac_acfg;
- unsigned char ipac_aoe;
- unsigned char ipac_atx;
- unsigned char ipac_pita1;
- unsigned char ipac_pita2;
- unsigned char ipac_pota1;
- unsigned char ipac_pota2;
- unsigned char ipac_pcfg;
- unsigned char ipac_scfg;
- unsigned char ipac_timr2;
- } ipac_w;
- } ipac_rw;
-} ipac_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* IPAC read registers */
-
-#define IPAC_CONF REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_conf)
-#define IPAC_ISTA REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_ista)
-#define IPAC_ID REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_id)
-#define IPAC_ACFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_acfg)
-#define IPAC_AOE REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_aoe)
-#define IPAC_ARX REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_arx)
-#define IPAC_PITA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita1)
-#define IPAC_PITA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita2)
-#define IPAC_POTA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota1)
-#define IPAC_POTA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota2)
-#define IPAC_PCFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pcfg)
-#define IPAC_SCFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_scfg)
-#define IPAC_TIMR2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_timr2)
-
-/* IPAC write registers */
-
-#define IPAC_MASK REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_mask)
-#define IPAC_ATX REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_atx)
-
-/* register bits */
-
-#define IPAC_CONF_AMP 0x80
-#define IPAC_CONF_CFS 0x40
-#define IPAC_CONF_TEM 0x20
-#define IPAC_CONF_PDS 0x10
-#define IPAC_CONF_IDH 0x08
-#define IPAC_CONF_SGO 0x04
-#define IPAC_CONF_ODS 0x02
-#define IPAC_CONF_IOF 0x01
-
-#define IPAC_ISTA_INT1 0x80
-#define IPAC_ISTA_INT0 0x40
-#define IPAC_ISTA_ICD 0x20
-#define IPAC_ISTA_EXD 0x10
-#define IPAC_ISTA_ICA 0x08
-#define IPAC_ISTA_EXA 0x04
-#define IPAC_ISTA_ICB 0x02
-#define IPAC_ISTA_EXB 0x01
-
-#define IPAC_MASK_INT1 0x80
-#define IPAC_MASK_INT0 0x40
-#define IPAC_MASK_ICD 0x20
-#define IPAC_MASK_EXD 0x10
-#define IPAC_MASK_ICA 0x08
-#define IPAC_MASK_EXA 0x04
-#define IPAC_MASK_ICB 0x02
-#define IPAC_MASK_EXB 0x01
-
-#define IPAC_ACFG_OD7 0x80
-#define IPAC_ACFG_OD6 0x40
-#define IPAC_ACFG_OD5 0x20
-#define IPAC_ACFG_OD4 0x10
-#define IPAC_ACFG_OD3 0x08
-#define IPAC_ACFG_OD2 0x04
-#define IPAC_ACFG_EL1 0x02
-#define IPAC_ACFG_EL2 0x01
-
-#define IPAC_AOE_OE7 0x80
-#define IPAC_AOE_OE6 0x40
-#define IPAC_AOE_OE5 0x20
-#define IPAC_AOE_OE4 0x10
-#define IPAC_AOE_OE3 0x08
-#define IPAC_AOE_OE2 0x04
-
-#define IPAC_ARX_AR7 0x80
-#define IPAC_ARX_AR6 0x40
-#define IPAC_ARX_AR5 0x20
-#define IPAC_ARX_AR4 0x10
-#define IPAC_ARX_AR3 0x08
-#define IPAC_ARX_AR2 0x04
-
-#define IPAC_ATX_AT7 0x80
-#define IPAC_ATX_AT6 0x40
-#define IPAC_ATX_AT5 0x20
-#define IPAC_ATX_AT4 0x10
-#define IPAC_ATX_AT3 0x08
-#define IPAC_ATX_AT2 0x04
-
-#define IPAC_PITA1_ENA 0x80
-#define IPAC_PITA1_DUDD 0x40
-
-#define IPAC_PITA2_ENA 0x80
-#define IPAC_PITA2_DUDD 0x40
-
-#define IPAC_POTA1_ENA 0x80
-#define IPAC_POTA1_DUDD 0x40
-
-#define IPAC_POTA2_ENA 0x80
-#define IPAC_POTA2_DUDD 0x40
-
-#define IPAC_PCFG_DPS 0x80
-#define IPAC_PCFG_ACL 0x40
-#define IPAC_PCFG_LED 0x20
-#define IPAC_PCFG_PLD 0x10
-#define IPAC_PCFG_FBS 0x08
-#define IPAC_PCFG_CSL2 0x04
-#define IPAC_PCFG_CSL1 0x02
-#define IPAC_PCFG_CSL0 0x01
-
-#define IPAC_SCFG_PRI 0x80
-#define IPAC_SCFG_TXD 0x40
-#define IPAC_SCFG_TLEN 0x20
-
-#define IPAC_TIMR2_TMD 0x80
-
-#endif /* _I4B_IPAC_H_ */
diff --git a/sys/i4b/layer1/i4b_isac.c b/sys/i4b/layer1/i4b_isac.c
deleted file mode 100644
index 4065c9a575b9..000000000000
--- a/sys/i4b/layer1/i4b_isac.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isac.c - i4b siemens isdn chipset driver ISAC handler
- * ---------------------------------------------------------
- *
- * $Id: i4b_isac.c,v 1.28 1998/12/05 18:04:41 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:59 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* non-FreeBSD handles this via config(8) */
-#endif
-#if NISIC > 0
-
-#ifdef __FreeBSD__
-#include "opt_i4b.h"
-#endif
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char isic_isac_exir_hdlr(register struct isic_softc *sc, u_char exir);
-static void isic_isac_ind_hdlr(register struct isic_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-isic_isac_irq(struct isic_softc *sc, int ista)
-{
- register u_char c = 0;
- DBGL1(L1_F_MSG, "isic_isac_irq", ("unit %d: ista = 0x%02x\n", sc->sc_unit, ista));
-
- if(ista & ISAC_ISTA_EXI) /* extended interrupt */
- {
- c |= isic_isac_exir_hdlr(sc, ISAC_READ(I_EXIR));
- }
-
- if(ista & ISAC_ISTA_RME) /* receive message end */
- {
- register int rest;
- u_char rsta;
-
- /* get rx status register */
-
- rsta = ISAC_READ(I_RSTA);
-
- if((rsta & ISAC_RSTA_MASK) != 0x20)
- {
- int error = 0;
-
- if(!(rsta & ISAC_RSTA_CRC)) /* CRC error */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: CRC error\n", sc->sc_unit));
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: Data Overrun error\n", sc->sc_unit));
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: Receive Aborted error\n", sc->sc_unit));
- }
-
- if(error == 0)
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: RME unknown error, RSTA = 0x%02x!\n", sc->sc_unit, rsta));
-
- i4b_Dfreembuf(sc->sc_ibuf);
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- ISAC_WRITE(I_CMDR, ISAC_CMDR_RMC|ISAC_CMDR_RRES);
- ISACCMDRWRDELAY();
-
- return;
- }
-
- rest = (ISAC_READ(I_RBCL) & (ISAC_FIFO_LEN-1));
-
- if(rest == 0)
- rest = ISAC_FIFO_LEN;
-
- if(sc->sc_ibuf == NULL)
- {
- if((sc->sc_ibuf = i4b_Dgetmbuf(rest)) != NULL)
- sc->sc_ib = sc->sc_ibuf->m_data;
- else
- panic("isic_isac_irq: RME, i4b_Dgetmbuf returns NULL!\n");
- sc->sc_ilen = 0;
- }
-
- if(sc->sc_ilen <= (MAX_DFRAME_LEN - rest))
- {
- ISAC_RDFIFO(sc->sc_ib, rest);
- sc->sc_ilen += rest;
-
- sc->sc_ibuf->m_pkthdr.len =
- sc->sc_ibuf->m_len = sc->sc_ilen;
-
- if(sc->sc_trace & TRACE_D_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled)
- PH_Data_Ind(sc->sc_unit, sc->sc_ibuf);
- else
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- else
- {
- DBGL1(L1_I_ERR, "isic_isac_irq", ("RME, input buffer overflow!\n"));
- i4b_Dfreembuf(sc->sc_ibuf);
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- }
-
- if(ista & ISAC_ISTA_RPF) /* receive fifo full */
- {
- if(sc->sc_ibuf == NULL)
- {
- if((sc->sc_ibuf = i4b_Dgetmbuf(MAX_DFRAME_LEN)) != NULL)
- sc->sc_ib= sc->sc_ibuf->m_data;
- else
- panic("isic_isac_irq: RPF, i4b_Dgetmbuf returns NULL!\n");
- sc->sc_ilen = 0;
- }
-
- if(sc->sc_ilen <= (MAX_DFRAME_LEN - ISAC_FIFO_LEN))
- {
- ISAC_RDFIFO(sc->sc_ib, ISAC_FIFO_LEN);
- sc->sc_ilen += ISAC_FIFO_LEN;
- sc->sc_ib += ISAC_FIFO_LEN;
- c |= ISAC_CMDR_RMC;
- }
- else
- {
- DBGL1(L1_I_ERR, "isic_isac_irq", ("RPF, input buffer overflow!\n"));
- i4b_Dfreembuf(sc->sc_ibuf);
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
- }
-
- if(ista & ISAC_ISTA_XPR) /* transmit fifo empty (XPR bit set) */
- {
- if((sc->sc_obuf2 != NULL) && (sc->sc_obuf == NULL))
- {
- sc->sc_freeflag = sc->sc_freeflag2;
- sc->sc_obuf = sc->sc_obuf2;
- sc->sc_op = sc->sc_obuf->m_data;
- sc->sc_ol = sc->sc_obuf->m_len;
- sc->sc_obuf2 = NULL;
-#ifdef NOTDEF
- printf("ob2=%x, op=%x, ol=%d, f=%d #",
- sc->sc_obuf,
- sc->sc_op,
- sc->sc_ol,
- sc->sc_state);
-#endif
- }
- else
- {
-#ifdef NOTDEF
- printf("ob=%x, op=%x, ol=%d, f=%d #",
- sc->sc_obuf,
- sc->sc_op,
- sc->sc_ol,
- sc->sc_state);
-#endif
- }
-
- if(sc->sc_obuf)
- {
- ISAC_WRFIFO(sc->sc_op, min(sc->sc_ol, ISAC_FIFO_LEN));
-
- if(sc->sc_ol > ISAC_FIFO_LEN) /* length > 32 ? */
- {
- sc->sc_op += ISAC_FIFO_LEN; /* bufferptr+32 */
- sc->sc_ol -= ISAC_FIFO_LEN; /* length - 32 */
- c |= ISAC_CMDR_XTF; /* set XTF bit */
- }
- else
- {
- if(sc->sc_freeflag)
- {
- i4b_Dfreembuf(sc->sc_obuf);
- sc->sc_freeflag = 0;
- }
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
-
- c |= ISAC_CMDR_XTF | ISAC_CMDR_XME;
- }
- }
- else
- {
- sc->sc_state &= ~ISAC_TX_ACTIVE;
- }
- }
-
- if(ista & ISAC_ISTA_CISQ) /* channel status change CISQ */
- {
- register u_char ci;
-
- /* get command/indication rx register*/
-
- ci = ISAC_READ(I_CIRR);
-
- /* if S/Q IRQ, read SQC reg to clr SQC IRQ */
-
- if(ci & ISAC_CIRR_SQC)
- (void) ISAC_READ(I_SQRR);
-
- /* C/I code change IRQ (flag already cleared by CIRR read) */
-
- if(ci & ISAC_CIRR_CIC0)
- isic_isac_ind_hdlr(sc, (ci >> 2) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDR, c);
- ISACCMDRWRDELAY();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-isic_isac_exir_hdlr(register struct isic_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Tx Message Repeat\n"));
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Tx Data Underrun\n"));
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Protocol Error\n"));
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Rx Frame Overflow\n"));
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Sync Xfer Overflow\n"));
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- DBGL1(L1_I_ERR, "L1 isic_isac_exir_hdlr", ("EXIRQ Monitor Status\n"));
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Subscriber Awake\n"));
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Watchdog Timer Overflow\n"));
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-isic_isac_ind_hdlr(register struct isic_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx AI8 in state %s\n", isic_printstate(sc)));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_ACTIVE);
- break;
-
- case ISAC_CIRR_IAI10:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx AI10 in state %s\n", isic_printstate(sc)));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_ACTIVE);
- break;
-
- case ISAC_CIRR_IRSY:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx RSY in state %s\n", isic_printstate(sc)));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx PU in state %s\n", isic_printstate(sc)));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DR in state %s\n", isic_printstate(sc)));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DID in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_IDLE);
- break;
-
- case ISAC_CIRR_IDIS:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DIS in state %s\n", isic_printstate(sc)));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx EI in state %s\n", isic_printstate(sc)));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx ARD in state %s\n", isic_printstate(sc)));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx TI in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx ATI in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx SD in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- default:
- DBGL1(L1_I_ERR, "isic_isac_ind_hdlr", ("UNKNOWN Indication 0x%x in state %s\n", ind, isic_printstate(sc)));
- event = EV_INFO0;
- break;
- }
- isic_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-isic_isac_l1_cmd(struct isic_softc *sc, int command)
-{
- u_char cmd;
-
-#ifdef I4B_SMP_WORKAROUND
-
- /* XXXXXXXXXXXXXXXXXXX */
-
- /*
- * patch from Wolfgang Helbig:
- *
- * Here is a patch that makes i4b work on an SMP:
- * The card (TELES 16.3) didn't interrupt on an SMP machine.
- * This is a gross workaround, but anyway it works *and* provides
- * some information as how to finally fix this problem.
- */
-
- HSCX_WRITE(0, H_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- /* XXXXXXXXXXXXXXXXXXX */
-
-#endif /* I4B_SMP_WORKAROUND */
-
- if(command < 0 || command > CMD_ILL)
- {
- DBGL1(L1_I_ERR, "isic_isac_l1_cmd", ("illegal cmd 0x%x in state %s\n", command, isic_printstate(sc)));
- return;
- }
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- cmd = ISAC_CIX0_LOW;
- else
- cmd = 0;
-
- switch(command)
- {
- case CMD_TIM:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx TIM in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx RS in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx AR8 in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx AR10 in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx DIU in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-isic_isac_init(struct isic_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- if(sc->sc_bustyp != BUS_TYPE_IOM2)
- {
- DBGL1(L1_I_SETUP, "isic_isac_setup", ("configuring for IOM-1 mode\n"));
-
- /* ADF2: Select mode IOM-1 */
- ISAC_WRITE(I_ADF2, 0x00);
-
- /* SPCR: serial port control register:
- * SPU - software power up = 0
- * SAC - SIP port high Z
- * SPM - timing mode 0
- * TLP - test loop = 0
- * C1C, C2C - B1 and B2 switched to/from SPa
- */
- ISAC_WRITE(I_SPCR, ISAC_SPCR_C1C1|ISAC_SPCR_C2C1);
-
- /* SQXR: S/Q channel xmit register:
- * SQIE - S/Q IRQ enable = 0
- * SQX1-4 - Fa bits = 1
- */
- ISAC_WRITE(I_SQXR, ISAC_SQXR_SQX1|ISAC_SQXR_SQX2|ISAC_SQXR_SQX3|ISAC_SQXR_SQX4);
-
- /* ADF1: additional feature reg 1:
- * WTC - watchdog = 0
- * TEM - test mode = 0
- * PFS - pre-filter = 0
- * CFS - IOM clock/frame always active
- * FSC1/2 - polarity of 8kHz strobe
- * ITF - interframe fill = idle
- */
- ISAC_WRITE(I_ADF1, ISAC_ADF1_FC2); /* ADF1 */
-
- /* STCR: sync transfer control reg:
- * TSF - terminal secific functions = 0
- * TBA - TIC bus address = 7
- * STx/SCx = 0
- */
- ISAC_WRITE(I_STCR, ISAC_STCR_TBA2|ISAC_STCR_TBA1|ISAC_STCR_TBA0);
-
- /* MODE: Mode Register:
- * MDSx - transparent mode 2
- * TMD - timer mode = external
- * RAC - Receiver enabled
- * DIMx - digital i/f mode
- */
- ISAC_WRITE(I_MODE, ISAC_MODE_MDS2|ISAC_MODE_MDS1|ISAC_MODE_RAC|ISAC_MODE_DIM0);
- }
- else
- {
- DBGL1(L1_I_SETUP, "isic_isac_setup", ("configuring for IOM-2 mode\n"));
-
- /* ADF2: Select mode IOM-2 */
- ISAC_WRITE(I_ADF2, ISAC_ADF2_IMS);
-
- /* SPCR: serial port control register:
- * SPU - software power up = 0
- * SPM - timing mode 0
- * TLP - test loop = 0
- * C1C, C2C - B1 + C1 and B2 + IC2 monitoring
- */
- ISAC_WRITE(I_SPCR, 0x00);
-
- /* SQXR: S/Q channel xmit register:
- * IDC - IOM direction = 0 (master)
- * CFS - Config Select = 0 (clock always active)
- * CI1E - C/I channel 1 IRQ enable = 0
- * SQIE - S/Q IRQ enable = 0
- * SQX1-4 - Fa bits = 1
- */
- ISAC_WRITE(I_SQXR, ISAC_SQXR_SQX1|ISAC_SQXR_SQX2|ISAC_SQXR_SQX3|ISAC_SQXR_SQX4);
-
- /* ADF1: additional feature reg 1:
- * WTC - watchdog = 0
- * TEM - test mode = 0
- * PFS - pre-filter = 0
- * IOF - IOM i/f off = 0
- * ITF - interframe fill = idle
- */
- ISAC_WRITE(I_ADF1, 0x00);
-
- /* STCR: sync transfer control reg:
- * TSF - terminal secific functions = 0
- * TBA - TIC bus address = 7
- * STx/SCx = 0
- */
- ISAC_WRITE(I_STCR, ISAC_STCR_TBA2|ISAC_STCR_TBA1|ISAC_STCR_TBA0);
-
- /* MODE: Mode Register:
- * MDSx - transparent mode 2
- * TMD - timer mode = external
- * RAC - Receiver enabled
- * DIMx - digital i/f mode
- */
- ISAC_WRITE(I_MODE, ISAC_MODE_MDS2|ISAC_MODE_MDS1|ISAC_MODE_RAC|ISAC_MODE_DIM0);
- }
-
-#ifdef NOTDEF
- /*
- * XXX a transmitter reset causes an ISAC tx IRQ which will not
- * be serviced at attach time under some circumstances leaving
- * the associated IRQ line on the ISA bus active. This prevents
- * any further interrupts to be serviced because no low -> high
- * transition can take place anymore. (-hm)
- */
-
- /* command register:
- * RRES - HDLC receiver reset
- * XRES - transmitter reset
- */
- ISAC_WRITE(I_CMDR, ISAC_CMDR_RRES|ISAC_CMDR_XRES);
- ISACCMDRWRDELAY();
-#endif
-
- /* enabled interrupts:
- * ===================
- * RME - receive message end
- * RPF - receive pool full
- * XPR - transmit pool ready
- * CISQ - CI or S/Q channel change
- * EXI - extended interrupt
- */
-
- ISAC_IMASK = ISAC_MASK_RSC | /* auto mode only */
- ISAC_MASK_TIN | /* timer irq */
- ISAC_MASK_SIN; /* sync xfer irq */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- return(0);
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_isac.h b/sys/i4b/layer1/i4b_isac.h
deleted file mode 100644
index 56a4241564fe..000000000000
--- a/sys/i4b/layer1/i4b_isac.h
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Gary Jennejohn. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * $Id: i4b_isac.h,v 1.5 1998/03/28 15:11:03 hm Exp $
- *
- * last edit-date: [Fri Mar 27 15:52:40 1998]
- *
- * -hm split up for rewrite of Siemens chipset driver
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef I4B_ISAC_H_
-#define I4B_ISAC_H_
-
-/*
- * The ISAC databook specifies a delay of 2.5 DCL clock cycles between
- * writes to the ISAC command register CMDR. This is the delay used to
- * satisfy this requirement.
- */
-
-#define I4B_ISAC_CMDRWRDELAY 30
-
-#if (I4B_ISAC_CMDRWRDELAY > 0)
-#define ISACCMDRWRDELAY() DELAY(I4B_ISAC_CMDRWRDELAY)
-#else
-#warning "I4B_ISAC_CMDRWRDELAY set to 0!"
-#define ISACCMDRWRDELAY()
-#endif
-
-enum ISAC_VERSIONS {
- ISAC_VA, /* 2085 A1 or A2, 2086/2186 V1.1 */
- ISAC_VB1, /* 2085 B1 */
- ISAC_VB2, /* 2085 B2 */
- ISAC_VB3, /* 2085 B3/V2.3 */
- ISAC_UNKN /* unknown version */
-};
-
-#define ISAC_FIFO_LEN 32 /* 32 bytes FIFO on chip */
-
-/*
- * definitions of registers and bits for the ISAC ISDN chip.
- */
-
-typedef struct isac_reg {
-
- /* 32 byte deep FIFO always first */
-
- unsigned char isac_fifo [ISAC_FIFO_LEN];
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char isac_ista;
- unsigned char isac_star;
- unsigned char isac_mode;
- unsigned char isac_timr;
- unsigned char isac_exir;
- unsigned char isac_rbcl;
- unsigned char isac_sapr;
- unsigned char isac_rsta;
- unsigned char dummy_28;
- unsigned char isac_rhcr;
- unsigned char isac_rbch;
- unsigned char isac_star2;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char dummy_2e;
- unsigned char dummt_2f;
- unsigned char isac_spcr;
- unsigned char isac_cirr;
- unsigned char isac_mor;
- unsigned char isac_sscr;
- unsigned char isac_sfcr;
- unsigned char isac_c1r;
- unsigned char isac_c2r;
- unsigned char isac_b1cr;
- unsigned char isac_b2cr;
- unsigned char isac_adf2;
- unsigned char isac_mosr;
- unsigned char isac_sqrr;
- } isac_r;
- struct {
- unsigned char isac_mask;
- unsigned char isac_cmdr;
- unsigned char isac_mode;
- unsigned char isac_timr;
- unsigned char isac_xad1;
- unsigned char isac_xad2;
- unsigned char isac_sap1;
- unsigned char isac_sap2;
- unsigned char isac_tei1;
- unsigned char isac_tei2;
- unsigned char dummy_2a;
- unsigned char isac_star2;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char dummy_2e;
- unsigned char dummt_2f;
- unsigned char isac_spcr;
- unsigned char isac_cixr;
- unsigned char isac_mox;
- unsigned char isac_sscx;
- unsigned char isac_sfcw;
- unsigned char isac_c1r;
- unsigned char isac_c2r;
- unsigned char isac_stcr;
- unsigned char isac_adf1;
- unsigned char isac_adf2;
- unsigned char isac_mocr;
- unsigned char isac_sqxr;
- } isac_w;
- } isac_rw;
-} isac_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* ISAC read registers */
-
-#define i_ista isac_rw.isac_r.isac_ista
-#define I_ISTA REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_ista)
-#define i_star isac_rw.isac_r.isac_star
-#define I_STAR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_star)
-#define i_mode isac_rw.isac_r.isac_mode
-#define I_MODE REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mode)
-#define i_timr isac_rw.isac_r.isac_timr
-#define I_TIMR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_timr)
-#define i_exir isac_rw.isac_r.isac_exir
-#define I_EXIR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_exir)
-#define i_rbcl isac_rw.isac_r.isac_rbcl
-#define I_RBCL REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rbcl)
-#define i_sapr isac_rw.isac_r.isac_sapr
-#define I_SAPR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sapr)
-#define i_rsta isac_rw.isac_r.isac_rsta
-#define I_RSTA REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rsta)
-#define i_rhcr isac_rw.isac_r.isac_rhcr
-#define I_RHCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rhcr)
-#define i_rbch isac_rw.isac_r.isac_rbch
-#define I_RBCH REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rbch)
-#define i_star2 isac_rw.isac_r.isac_star2
-#define I_STAR2 REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_star2)
-#define i_spcr isac_rw.isac_r.isac_spcr
-#define I_SPCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_spcr)
-#define i_cirr isac_rw.isac_r.isac_cirr
-#define I_CIRR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_cirr)
-#define i_mor isac_rw.isac_r.isac_mor
-#define I_MOR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mor)
-#define i_sscr isac_rw.isac_r.isac_sscr
-#define I_SSCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sscr)
-#define i_sfcr isac_rw.isac_r.isac_sfcr
-#define I_SFCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sfcr)
-#define i_c1r isac_rw.isac_r.isac_c1r
-#define I_C1R REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_c1r)
-#define i_c2r isac_rw.isac_r.isac_c2r
-#define I_C2R REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_c2r)
-#define i_b1cr isac_rw.isac_r.isac_b1cr
-#define I_B1CR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_b1cr)
-#define i_b2cr isac_rw.isac_r.isac_b2cr
-#define I_B2CR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_b2cr)
-#define i_adf2 isac_rw.isac_r.isac_adf2
-#define I_ADF2 REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_adf2)
-#define i_mosr isac_rw.isac_r.isac_mosr
-#define I_MOSR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mosr)
-#define i_sqrr isac_rw.isac_r.isac_sqrr
-#define I_SQRR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sqrr)
-
-/* ISAC write registers - isac_mode, isac_timr, isac_star2, isac_spcr, */
-/* isac_c1r, isac_c2r, isac_adf2 see read registers */
-
-#define i_mask isac_rw.isac_w.isac_mask
-#define I_MASK REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mask)
-#define i_cmdr isac_rw.isac_w.isac_cmdr
-#define I_CMDR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_cmdr)
-#define i_xad1 isac_rw.isac_w.isac_xad1
-#define I_XAD1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_xad1)
-#define i_xad2 isac_rw.isac_w.isac_xad2
-#define I_XAD2 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_xad2)
-#define i_sap1 isac_rw.isac_w.isac_sap1
-#define I_SAP1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sap1)
-#define i_sap2 isac_rw.isac_w.isac_sap2
-#define I_SAP2 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sap2)
-#define i_tei1 isac_rw.isac_w.isac_tei1
-#define i_tei2 isac_rw.isac_w.isac_tei2
-#define i_cixr isac_rw.isac_w.isac_cixr
-#define I_CIXR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_cixr)
-#define I_CIX0 I_CIXR
-#define i_mox isac_rw.isac_w.isac_mox
-#define I_MOX REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mox)
-#define i_sscx isac_rw.isac_w.isac_sscx
-#define I_SSCX REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sscx)
-#define i_sfcw isac_rw.isac_w.isac_sfcw
-#define I_SFCW REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sfcw)
-#define i_stcr isac_rw.isac_w.isac_stcr
-#define I_STCR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_stcr)
-#define i_adf1 isac_rw.isac_w.isac_adf1
-#define I_ADF1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_adf1)
-#define i_mocr isac_rw.isac_w.isac_mocr
-#define I_MOCR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mocr)
-#define i_sqxr isac_rw.isac_w.isac_sqxr
-#define I_SQXR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sqxr)
-
-#define ISAC_ISTA_RME 0x80
-#define ISAC_ISTA_RPF 0x40
-#define ISAC_ISTA_RSC 0x20
-#define ISAC_ISTA_XPR 0x10
-#define ISAC_ISTA_TIN 0x08
-#define ISAC_ISTA_CISQ 0x04
-#define ISAC_ISTA_SIN 0x02
-#define ISAC_ISTA_EXI 0x01
-
-#define ISAC_MASK_RME 0x80
-#define ISAC_MASL_RPF 0x40
-#define ISAC_MASK_RSC 0x20
-#define ISAC_MASK_XPR 0x10
-#define ISAC_MASK_TIN 0x08
-#define ISAC_MASK_CISQ 0x04
-#define ISAC_MASK_SIN 0x02
-#define ISAC_MASK_EXI 0x01
-#define ISAC_MASK_ALL 0xff
-
-#define ISAC_STAR_XDOV 0x80
-#define ISAC_STAR_XFW 0x40
-#define ISAC_STAR_XRNR 0x20
-#define ISAC_STAR_RRNR 0x10
-#define ISAC_STAR_MBR 0x08
-#define ISAC_STAR_MAC1 0x04
-#define ISAC_STAR_BVS 0x02
-#define ISAC_STAR_MAC0 0x01
-
-#define ISAC_CMDR_RMC 0x80
-#define ISAC_CMDR_RRES 0x40
-#define ISAC_CMDR_RNR 0x20
-#define ISAC_CMDR_STI 0x10
-#define ISAC_CMDR_XTF 0x08
-#define ISAC_CMDR_XIF 0x04
-#define ISAC_CMDR_XME 0x02
-#define ISAC_CMDR_XRES 0x01
-
-#define ISAC_MODE_MDS2 0x80
-#define ISAC_MODE_MDS1 0x40
-#define ISAC_MODE_MDS0 0x20
-#define ISAC_MODE_TMD 0x10
-#define ISAC_MODE_RAC 0x08
-#define ISAC_MODE_DIM2 0x04
-#define ISAC_MODE_DIM1 0x02
-#define ISAC_MODE_DIM0 0x01
-
-#define ISAC_EXIR_XMR 0x80
-#define ISAC_EXIR_XDU 0x40
-#define ISAC_EXIR_PCE 0x20
-#define ISAC_EXIR_RFO 0x10
-#define ISAC_EXIR_SOV 0x08
-#define ISAC_EXIR_MOS 0x04
-#define ISAC_EXIR_SAW 0x02
-#define ISAC_EXIR_WOV 0x01
-
-#define ISAC_RSTA_RDA 0x80
-#define ISAC_RSTA_RDO 0x40
-#define ISAC_RSTA_CRC 0x20
-#define ISAC_RSTA_RAB 0x10
-#define ISAC_RSTA_SA1 0x08
-#define ISAC_RSTA_SA0 0x04
-#define ISAC_RSTA_CR 0x02
-#define ISAC_RSTA_TA 0x01
-
-#define ISAC_RSTA_MASK 0x70 /* the interesting bits */
-
-#define ISAC_RBCH_XAC 0x80
-#define ISAC_RBCH_VN1 0x40
-#define ISAC_RBCH_VN0 0x20
-#define ISAC_RBCH_OV 0x10
-/* the other 4 bits are the high bits of the receive byte count */
-
-#define ISAC_SPCR_SPU 0x80
-#define ISAC_SPCR_SAC 0x40
-#define ISAC_SPCR_SPM 0x20
-#define ISAC_SPCR_TLP 0x10
-#define ISAC_SPCR_C1C1 0x08
-#define ISAC_SPCR_C1C0 0x04
-#define ISAC_SPCR_C2C1 0x02
-#define ISAC_SPCR_C2C0 0x01
-
-#define ISAC_CIRR_SQC 0x80
-#define ISAC_CIRR_BAS 0x40
-/* bits 5-2 CODR */
-#define ISAC_CIRR_CIC0 0x02
-/* bit 0 is always 0 */
-/* C/I codes from bits 5-2 (>> 2 & 0xf) */
-/* the indications */
-#define ISAC_CIRR_IPU 0x07
-#define ISAC_CIRR_IDR 0x00
-#define ISAC_CIRR_ISD 0x02
-#define ISAC_CIRR_IDIS 0x03
-#define ISAC_CIRR_IEI 0x06
-#define ISAC_CIRR_IRSY 0x04
-#define ISAC_CIRR_IARD 0x08
-#define ISAC_CIRR_ITI 0x0a
-#define ISAC_CIRR_IATI 0x0b
-#define ISAC_CIRR_IAI8 0x0c
-#define ISAC_CIRR_IAI10 0x0d
-#define ISAC_CIRR_IDID 0x0f
-
-#define ISAC_CI_MASK 0x0f
-
-#define ISAC_CIXR_RSS 0x80
-#define ISAC_CIXR_BAC 0x40
-/* bits 5-2 CODX */
-#define ISAC_CIXR_TCX 0x02
-#define ISAC_CIXR_ECX 0x01
-/* in IOM-2 mode the low bits are always 1 */
-#define ISAC_CIX0_LOW 0x03
-/* C/I codes from bits 5-2 (>> 2 & 0xf) */
-/* the commands */
-#define ISAC_CIXR_CTIM 0
-#define ISAC_CIXR_CRS 0x01
-#define ISAC_CIXR_CSCZ 0x04
-#define ISAC_CIXR_CSSZ 0x02
-#define ISAC_CIXR_CAR8 0x08
-#define ISAC_CIXR_CAR10 0x09
-#define ISAC_CIXR_CARL 0x0a
-#define ISAC_CIXR_CDIU 0x0f
-
-#define ISAC_STCR_TSF 0x80
-#define ISAC_STCR_TBA2 0x40
-#define ISAC_STCR_TBA1 0x20
-#define ISAC_STCR_TBA0 0x10
-#define ISAC_STCR_ST1 0x08
-#define ISAC_STCR_ST0 0x04
-#define ISAC_STCR_SC1 0x02
-#define ISAC_STCR_SC0 0x01
-
-#define ISAC_ADF1_WTC1 0x80
-#define ISAC_ADF1_WTC2 0x40
-#define ISAC_ADF1_TEM 0x20
-#define ISAC_ADF1_PFS 0x10
-#define ISAC_ADF1_CFS 0x08
-#define ISAC_ADF1_FC2 0x04
-#define ISAC_ADF1_FC1 0x02
-#define ISAC_ADF1_ITF 0x01
-
-#define ISAC_ADF2_IMS 0x80
-/* all other bits are 0 */
-
-/* bits 7-5 are always 0 */
-#define ISAC_SQRR_SYN 0x10
-#define ISAC_SQRR_SQR1 0x08
-#define ISAC_SQRR_SQR2 0x04
-#define ISAC_SQRR_SQR3 0x02
-#define ISAC_SQRR_SQR4 0x01
-
-#define ISAC_SQXR_IDC 0x80
-#define ISAC_SQXR_CFS 0x40
-#define ISAC_SQXR_CI1E 0x20
-#define ISAC_SQXR_SQIE 0x10
-#define ISAC_SQXR_SQX1 0x08
-#define ISAC_SQXR_SQX2 0x04
-#define ISAC_SQXR_SQX3 0x02
-#define ISAC_SQXR_SQX4 0x01
-
-#endif /* I4B_ISAC_H_ */
diff --git a/sys/i4b/layer1/i4b_isic.c b/sys/i4b/layer1/i4b_isic.c
deleted file mode 100644
index 922df793c07a..000000000000
--- a/sys/i4b/layer1/i4b_isic.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic.c - global isic stuff
- * ==============================
- *
- * $Id: i4b_isic.c,v 1.44 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 12:14:07 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/device.h>
-#if defined(__NetBSD__) && defined(amiga)
-#include <machine/bus.h>
-#else
-#include <dev/isa/isavar.h>
-#endif
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-void isic_settrace(int unit, int val);
-int isic_gettrace(int unit);
-
-#ifdef __FreeBSD__
-void isicintr_sc(struct isic_softc *sc);
-#if !(defined(__FreeBSD_version)) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-void isicintr(int unit);
-#endif
-#else
-/* XXX - hack, going away soon! */
-struct isic_softc *isic_sc[ISIC_MAXUNIT];
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic - device driver interrupt routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-void
-isicintr_sc(struct isic_softc *sc)
-{
- isicintr(sc->sc_unit);
-}
-
-void
-isicintr(int unit)
-{
- register struct isic_softc *sc = &isic_sc[unit];
-#else
-int
-isicintr(void *arg)
-{
- struct isic_softc *sc = arg;
-#endif
-
- if(sc->sc_ipac == 0) /* HSCX/ISAC interupt routine */
- {
- u_char was_hscx_irq = 0;
- u_char was_isac_irq = 0;
-
- register u_char hscx_irq_stat;
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get hscx irq status from hscx b ista */
- hscx_irq_stat =
- HSCX_READ(HSCX_CH_B, H_ISTA) & ~HSCX_B_IMASK;
-
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- /* do as long as there are pending irqs in the chips */
- if(!hscx_irq_stat && !isac_irq_stat)
- break;
-
- if(hscx_irq_stat & (HSCX_ISTA_RME | HSCX_ISTA_RPF |
- HSCX_ISTA_RSC | HSCX_ISTA_XPR |
- HSCX_ISTA_TIN | HSCX_ISTA_EXB))
- {
- isic_hscx_irq(sc, hscx_irq_stat,
- HSCX_CH_B,
- hscx_irq_stat & HSCX_ISTA_EXB);
- was_hscx_irq = 1;
- }
-
- if(hscx_irq_stat & (HSCX_ISTA_ICA | HSCX_ISTA_EXA))
- {
- isic_hscx_irq(sc,
- HSCX_READ(HSCX_CH_A, H_ISTA) & ~HSCX_A_IMASK,
- HSCX_CH_A,
- hscx_irq_stat & HSCX_ISTA_EXA);
- was_hscx_irq = 1;
- }
-
- if(isac_irq_stat)
- {
- isic_isac_irq(sc, isac_irq_stat); /* isac handler */
- was_isac_irq = 1;
- }
- }
-#ifndef amiga /* XXX should be: #if INTERUPTS_ARE_SHARED */
-#ifdef ELSA_QS1ISA
- if(sc->sc_cardtyp != CARD_TYPEP_ELSAQS1ISA)
- {
-#endif
- if((was_hscx_irq == 0) && (was_isac_irq == 0))
- DBGL1(L1_ERROR, "isicintr", ("WARNING: unit %d, No IRQ from HSCX/ISAC!\n", sc->sc_unit));
-#ifdef ELSA_QS1ISA
- }
-#endif
-#endif /* AMIGA */
-
- HSCX_WRITE(0, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
-
-#ifdef ELSA_QS1ISA
- DELAY(80);
-
- if(sc->sc_cardtyp == CARD_TYPEP_ELSAQS1ISA)
- if (sc->clearirq)
- {
- sc->clearirq(sc);
- }
-#else
- DELAY(100);
-#endif
-
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
-#ifndef __FreeBSD__
- return(was_hscx_irq || was_isac_irq);
-#endif
- }
- else /* IPAC interrupt routine */
- {
- register u_char ipac_irq_stat;
- register u_char was_ipac_irq = 0;
-
- for(;;)
- {
- /* get global irq status */
-
- ipac_irq_stat = (IPAC_READ(IPAC_ISTA)) & 0x3f;
-
- /* check hscx a */
-
- if(ipac_irq_stat & (IPAC_ISTA_ICA | IPAC_ISTA_EXA))
- {
- /* HSCX A interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_A, H_ISTA),
- HSCX_CH_A,
- ipac_irq_stat & IPAC_ISTA_EXA);
- was_ipac_irq = 1;
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICB | IPAC_ISTA_EXB))
- {
- /* HSCX B interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_B, H_ISTA),
- HSCX_CH_B,
- ipac_irq_stat & IPAC_ISTA_EXB);
- was_ipac_irq = 1;
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICD | IPAC_ISTA_EXD))
- {
- /* ISAC interrupt */
- isic_isac_irq(sc, ISAC_READ(I_ISTA));
- was_ipac_irq = 1;
- }
-
- /* do as long as there are pending irqs in the chip */
- if(!ipac_irq_stat)
- break;
- }
-
- if(was_ipac_irq == 0)
- DBGL1(L1_ERROR, "isicintr", ("WARNING: unit %d, No IRQ from IPAC!\n", sc->sc_unit));
-
- IPAC_WRITE(IPAC_MASK, 0xff);
- DELAY(50);
- IPAC_WRITE(IPAC_MASK, 0xc0);
-
-#ifndef __FreeBSD__
- return(was_ipac_irq);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_settrace
- *---------------------------------------------------------------------------*/
-void
-isic_settrace(int unit, int val)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- sc->sc_trace = val;
-}
-
-/*---------------------------------------------------------------------------*
- * isic_gettrace
- *---------------------------------------------------------------------------*/
-int
-isic_gettrace(int unit)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- return(sc->sc_trace);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_recovery - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-isic_recover(struct isic_softc *sc)
-{
- u_char byte;
-
- /* get hscx irq status from hscx b ista */
-
- byte = HSCX_READ(HSCX_CH_B, H_ISTA);
-
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: ISTA = 0x%x\n", byte));
-
- if(byte & HSCX_ISTA_ICA)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: ISTA = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_A, H_ISTA)));
-
- if(byte & HSCX_ISTA_EXB)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: EXIR = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_B, H_EXIR)));
-
- if(byte & HSCX_ISTA_EXA)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: EXIR = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_A, H_EXIR)));
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: ISTA = 0x%x\n", byte));
-
- if(byte & ISAC_ISTA_EXI)
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: EXIR = 0x%x\n", (u_char)ISAC_READ(I_EXIR)));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: CISQ = 0x%x\n", byte));
-
- if(byte & ISAC_CIRR_SQC)
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: SQRR = 0x%x\n", (u_char)ISAC_READ(I_SQRR)));
- }
-
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: IMASK = 0x%x\n", HSCX_B_IMASK));
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: IMASK = 0x%x\n", HSCX_A_IMASK));
-
- HSCX_WRITE(0, H_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
- DELAY(100);
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- DELAY(100);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: IMASK = 0x%x\n", ISAC_IMASK));
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_isic_isa.c b/sys/i4b/layer1/i4b_isic_isa.c
deleted file mode 100644
index c0e11b9a044f..000000000000
--- a/sys/i4b/layer1/i4b_isic_isa.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_isa.c - ISA bus interface
- * ==================================
- *
- * $Id: i4b_isic_isa.c,v 1.14 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 12:00:26 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/device.h>
-#if defined(__NetBSD__) && defined(amiga)
-#include <machine/bus.h>
-#else
-#include <dev/isa/isavar.h>
-#endif
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __FreeBSD__
-
-#if !(defined(__FreeBSD_version)) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-void isicintr ( int unit );
-#endif
-
-void isicintr_sc(struct isic_softc *sc);
-
-static int isicprobe(struct isa_device *dev);
-int isicattach(struct isa_device *dev);
-
-struct isa_driver isicdriver = {
- isicprobe,
- isicattach,
- "isic",
- 0
-};
-
-int next_isic_unit = 0;
-struct isic_softc isic_sc[ISIC_MAXUNIT];
-
-#else
-
-#ifdef NetBSD1_3
-#if NetBSD1_3 < 2
-struct cfdriver isic_cd = {
- NULL, "isic", DV_DULL
-};
-#endif
-#endif
-
-#if defined (__OpenBSD__)
-struct cfdriver isic_cd = {
- NULL, "isic", DV_DULL
-};
-#endif
-
-#endif
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-extern void isic_settrace(int unit, int val); /*XXX*/
-extern int isic_gettrace(int unit); /*XXX*/
-
-#ifdef __FreeBSD__
-/*---------------------------------------------------------------------------*
- * isic - non-pnp device driver probe routine
- *---------------------------------------------------------------------------*/
-static int
-isicprobe(struct isa_device *dev)
-{
- int ret = 0;
-
- if(dev->id_unit != next_isic_unit)
- {
- printf("isicprobe: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return(0);
- }
-
- switch(dev->id_flags)
- {
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_probe_s08(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_probe_s016(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_probe_s0163(dev);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_probe_avma1(dev);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_probe_usrtai(dev);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_probe_itkix1(dev);
- break;
-#endif
-
- default:
- break;
- }
- return(ret);
-}
-
-#else
-
-/*---------------------------------------------------------------------------*
- * isic - device driver probe routine, dummy for NetBSD/OpenBSD
- *---------------------------------------------------------------------------*/
-int
-isicprobe(struct isic_attach_args *args)
-{
- return 1;
-}
-
-#endif /* __FreeBSD__ */
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic - non-pnp device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-isicattach(struct isa_device *dev)
-{
- return(isic_realattach(dev, 0));
-}
-
-/*---------------------------------------------------------------------------*
- * isic - non-pnp and pnp device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-isic_realattach(struct isa_device *dev, unsigned int iobase2)
-
-#else /* ! __FreeBSD__ */
-
-int
-isicattach(int flags, struct isic_softc *sc)
-
-#endif /* __FreeBSD__ */
-{
- int ret = 0;
- char *drvid;
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#define PARM dev
-#define PARM2 dev, iobase2
-#define FLAGS dev->id_flags
-#else
-#define PARM sc
-#define PARM2 sc
-#define FLAGS flags
-#endif
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- /* done in bus specific attach code for other OS */
-
-#ifdef __FreeBSD__
- if(dev->id_unit != next_isic_unit)
- {
- printf("isicattach: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return(0);
- }
-
- sc->sc_unit = dev->id_unit;
-#else
- isic_sc[sc->sc_unit] = sc;
-#endif
-
- /* card dependent setup */
- switch(FLAGS)
- {
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_attach_Dyn(PARM2);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_attach_s08(PARM);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_attach_s016(PARM);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_attach_s0163(PARM);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_attach_avma1(PARM);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_attach_usrtai(PARM);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_attach_itkix1(PARM);
- break;
-#endif
-
-/* ======================================================================
- * Only P&P cards follow below!!!
- */
-#ifdef __FreeBSD__ /* we've already splitted all non-ISA stuff
- out of this ISA specific part for the other
- OS */
-
-#ifdef AVM_PCMCIA
- case FLAG_AVM_A1_PCMCIA:
- ret = isic_attach_fritzpcmcia(PARM);
- break;
-#endif
-
-#ifndef __FreeBSD__
-#ifdef TEL_S0_16_3_P
- case FLAG_TELES_S0_163_PnP:
- ret = isic_attach_s0163P(PARM2);
- break;
-#endif
-#endif
-
-#ifdef CRTX_S0_P
- case FLAG_CREATIX_S0_PnP:
- ret = isic_attach_Cs0P(PARM2);
- break;
-#endif
-
-#ifdef DRN_NGO
- case FLAG_DRN_NGO:
- ret = isic_attach_drnngo(PARM2);
- break;
-#endif
-
-#ifdef SEDLBAUER
- case FLAG_SWS:
- ret = isic_attach_sws(PARM);
- break;
-#endif
-
-#ifdef ELSA_QS1ISA
- case FLAG_ELSA_QS1P_ISA:
- ret = isic_attach_Eqs1pi(PARM2);
- break;
-#endif
-
-#endif /* __FreeBSD__ / P&P specific part */
-
-/* --- XXX - don't know how to handle this - should be removed!!!! ---- */
-#ifdef amiga
- case FLAG_BLMASTER:
- ret = 1; /* full detection was done in caller */
- break;
-#endif
-/* ------------------------------------------------------------------- */
-
- default:
- break;
- }
-
- if(ret == 0)
- return(0);
-
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce manufacturer and card type */
-
- switch(FLAGS)
- {
- case FLAG_TELES_S0_8:
- drvid = "Teles S0/8 or Niccy 1008";
- break;
-
- case FLAG_TELES_S0_16:
- drvid = "Teles S0/16, Creatix ISDN S0-16 or Niccy 1016";
- break;
-
- case FLAG_TELES_S0_163:
- drvid = "Teles S0/16.3";
- break;
-
- case FLAG_AVM_A1:
- drvid = "AVM A1 or AVM Fritz!Card";
- break;
-
- case FLAG_AVM_A1_PCMCIA:
- drvid = "AVM PCMCIA Fritz!Card";
- break;
-
- case FLAG_TELES_S0_163_PnP:
- drvid = "Teles S0/PnP";
- break;
-
- case FLAG_CREATIX_S0_PnP:
- drvid = "Creatix ISDN S0-16 P&P";
- break;
-
- case FLAG_USR_ISDN_TA_INT:
- drvid = "USRobotics Sportster ISDN TA intern";
- break;
-
- case FLAG_DRN_NGO:
- drvid = "Dr. Neuhaus NICCY Go@";
- break;
-
- case FLAG_DYNALINK:
- drvid = "Dynalink IS64PH";
- break;
-
- case FLAG_SWS:
- drvid = "Sedlbauer WinSpeed";
- break;
-
- case FLAG_BLMASTER:
- /* board announcement was done by caller */
- drvid = (char *)0;
- break;
-
- case FLAG_ELSA_QS1P_ISA:
- drvid = "ELSA QuickStep 1000pro (ISA)";
- break;
-
- case FLAG_ITK_IX1:
- drvid = "ITK ix1 micro";
- break;
-
- default:
- drvid = "ERROR, unknown flag used";
- break;
- }
-#ifndef __FreeBSD__
- printf("\n");
-#endif
- if (drvid)
- printf(ISIC_FMT "%s\n", ISIC_PARM, drvid);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
-#ifdef __FreeBSD__
- printf("(Addr=0x%lx)\n", (u_long)ISAC_BASE);
-#endif
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
-#ifdef __FreeBSD__
- printf("(AddrA=0x%lx, AddrB=0x%lx)\n", (u_long)HSCX_A_BASE, (u_long)HSCX_B_BASE);
-
- next_isic_unit++;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300003
-
- /* set the interrupt handler - no need to change isa_device.h */
- dev->id_intr = (inthand2_t *)isicintr;
-
-#endif
-
-#endif /* __FreeBSD__ */
-
- return(1);
-#undef PARM
-#undef FLAGS
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_isic_pci.c b/sys/i4b/layer1/i4b_isic_pci.c
deleted file mode 100644
index bd6d4fd92371..000000000000
--- a/sys/i4b/layer1/i4b_isic_pci.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pci.c - PCI bus interface
- * ==================================
- *
- * $Id: i4b_isic_pci.c,v 1.1 1998/12/27 21:46:46 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:24:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isic.h"
-
-#if defined(__FreeBSD__)
-#include "opt_i4b.h"
-#include "pci.h"
-#endif
-
-#if (NISIC > 0) && (NPCI > 0)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#define PCI_QS1000_ID 0x10001048
-
-#define MEM0_MAPOFF 0
-#define PORT0_MAPOFF 4
-#define PORT1_MAPOFF 12
-
-static const char* i4b_pci_probe(pcici_t tag, pcidi_t type);
-static void i4b_pci_attach(pcici_t config_id, int unit);
-static int isic_pciattach(int unit, u_long type, u_int iobase1, u_int iobase2);
-
-static u_long i4b_pci_count = 0;
-
-static struct pci_device i4b_pci_driver = {
- "isic",
- i4b_pci_probe,
- i4b_pci_attach,
- &i4b_pci_count,
- NULL
-};
-
-DATA_SET (pcidevice_set, i4b_pci_driver);
-
-static void isic_pci_intr_sc(struct isic_softc *sc);
-
-
-/*---------------------------------------------------------------------------*
- * PCI probe routine
- *---------------------------------------------------------------------------*/
-static const char *
-i4b_pci_probe(pcici_t tag, pcidi_t type)
-{
- switch(type)
- {
- case PCI_QS1000_ID:
- return("ELSA QuickStep 1000pro PCI ISDN adaptor");
- break;
-
- default:
- if(bootverbose)
- printf("i4b_pci_probe: unknown PCI type %ul!\n", (u_int)type);
- return(NULL);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * PCI attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4b_pci_attach(pcici_t config_id, int unit)
-{
- unsigned short iobase1;
- unsigned short iobase2;
- unsigned long type;
- struct isic_softc *sc = &isic_sc[unit];
-
- if(unit != next_isic_unit)
- {
- printf("i4b_pci_attach: Error: new unit (%d) != next_isic_unit (%d)!\n", unit, next_isic_unit);
- return;
- }
-
- if(!(pci_map_port(config_id, PCI_MAP_REG_START+PORT0_MAPOFF, &iobase1)))
- {
- printf("i4b_pci_attach: pci_map_port 1 failed!\n");
- return;
- }
-
- if(!(pci_map_port(config_id, PCI_MAP_REG_START+PORT1_MAPOFF, &iobase2)))
- {
- printf("i4b_pci_attach: pci_map_port 2 failed!\n");
- return;
- }
-
- if(bootverbose)
- printf("i4b_pci_attach: unit %d, port0 0x%x, port1 0x%x\n", unit, iobase1, iobase2);
-
- type = pci_conf_read(config_id, PCI_ID_REG);
-
- if((isic_pciattach(unit, type, iobase1, iobase2)) == 0)
- return;
-
- if(!(pci_map_int(config_id, (void *)isic_pci_intr_sc, (void *)sc, &net_imask)))
- return;
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pci device driver attach routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pciattach(int unit, u_long type, u_int iobase1, u_int iobase2)
-{
- int ret = 0;
- struct isic_softc *sc = &isic_sc[unit];
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- switch(type)
- {
-#ifdef ELSA_QS1PCI
- case PCI_QS1000_ID:
- ret = isic_attach_Eqs1pp(unit, iobase1, iobase2);
- break;
-#endif
- default:
- break;
- }
-
- if(ret == 0)
- return(ret);
-
- sc->sc_isac_version = 0;
- sc->sc_hscx_version = 0;
-
- sc->sc_unit = unit;
-
- if(sc->sc_ipac)
- {
- ret = IPAC_READ(IPAC_ID);
-
- switch(ret)
- {
- case 0x01:
- printf("isic%d: IPAC PSB2115 Version 1.1\n", unit);
- break;
-
- default:
- printf("isic%d: Error, IPAC version %d unknown!\n",
- unit, ret);
- return(0);
- break;
- }
- }
- else
- {
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- printf("isic%d: ISAC %s (IOM-%c)\n",
- unit,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- break;
-
- default:
- printf("isic%d: Error, ISAC version %d unknown!\n",
- unit, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- printf("isic%d: HSCX %s\n",
- unit,
- HSCXversion[sc->sc_hscx_version]);
- break;
-
- default:
- printf("isic%d: Error, HSCX version %d unknown!\n",
- unit, sc->sc_hscx_version);
- return(0);
- break;
- }
- }
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- next_isic_unit++;
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic - PCI device driver interrupt routine
- *---------------------------------------------------------------------------*/
-static void
-isic_pci_intr_sc(struct isic_softc *sc)
-{
- if(sc->sc_ipac == 0) /* HSCX/ISAC interupt routine */
- {
- register u_char hscx_irq_stat;
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get hscx irq status from hscx b ista */
- hscx_irq_stat =
- HSCX_READ(HSCX_CH_B, H_ISTA) & ~HSCX_B_IMASK;
-
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- /* do as long as there are pending irqs in the chips */
- if(!hscx_irq_stat && !isac_irq_stat)
- break;
-
- if(hscx_irq_stat & (HSCX_ISTA_RME | HSCX_ISTA_RPF |
- HSCX_ISTA_RSC | HSCX_ISTA_XPR |
- HSCX_ISTA_TIN | HSCX_ISTA_EXB))
- {
- isic_hscx_irq(sc, hscx_irq_stat,
- HSCX_CH_B,
- hscx_irq_stat & HSCX_ISTA_EXB);
- }
-
- if(hscx_irq_stat & (HSCX_ISTA_ICA | HSCX_ISTA_EXA))
- {
- isic_hscx_irq(sc,
- HSCX_READ(HSCX_CH_A, H_ISTA) & ~HSCX_A_IMASK,
- HSCX_CH_A,
- hscx_irq_stat & HSCX_ISTA_EXA);
- }
-
- if(isac_irq_stat)
- { /* isac handler */
- isic_isac_irq(sc, isac_irq_stat);
- }
- }
-
- HSCX_WRITE(0, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
-
- DELAY(100);
-
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- }
- else /* IPAC interrupt routine */
- {
- register u_char ipac_irq_stat;
-
- for(;;)
- {
- /* get global irq status */
-
- ipac_irq_stat = (IPAC_READ(IPAC_ISTA)) & 0x3f;
-
- /* do as long as there are pending irqs in the chip */
- if(!ipac_irq_stat)
- break;
-
- /* check hscx a */
-
- if(ipac_irq_stat & (IPAC_ISTA_ICA | IPAC_ISTA_EXA))
- {
- /* HSCX A interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_A, H_ISTA),
- HSCX_CH_A,
- ipac_irq_stat & IPAC_ISTA_EXA);
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICB | IPAC_ISTA_EXB))
- {
- /* HSCX B interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_B, H_ISTA),
- HSCX_CH_B,
- ipac_irq_stat & IPAC_ISTA_EXB);
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICD | IPAC_ISTA_EXD))
- {
- /* ISAC interrupt */
- isic_isac_irq(sc, ISAC_READ(I_ISTA));
- }
- }
-
- IPAC_WRITE(IPAC_MASK, 0xff);
- DELAY(50);
- IPAC_WRITE(IPAC_MASK, 0xc0);
- }
-}
-
-#endif /* (NISIC > 0) && (NPCI > 0) */
-
diff --git a/sys/i4b/layer1/i4b_isic_pcmcia.c b/sys/i4b/layer1/i4b_isic_pcmcia.c
deleted file mode 100644
index e20964cc92fc..000000000000
--- a/sys/i4b/layer1/i4b_isic_pcmcia.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1998 Matthias Apitz. All rights reserved.
- *
- * Copyright (c) 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pcmcia.c - i4b FreeBSD PCMCIA support
- * ----------------------------------------------
- *
- * $Id: i4b_isic_pcmcia.c,v 1.2 1999/01/12 11:04:59 eivind Exp $
- *
- * last edit-date: [Mon Dec 14 17:30:09 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "card.h"
-
-#if (NISIC > 0) && (NCARD > 0)
-
-#include "apm.h"
-#include <sys/param.h>
-#include <sys/select.h>
-#include <i386/isa/isa_device.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-
-#include <pccard/cardinfo.h>
-#include <pccard/slot.h>
-#include <pccard/driver.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-extern int isicattach(struct isa_device *dev);
-extern void isicintr(int unit);
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int isic_pccard_init __P((struct pccard_devinfo *));
-static void isic_unload __P((struct pccard_devinfo *));
-static int isic_card_intr __P((struct pccard_devinfo *));
-
-PCCARD_MODULE(isic, isic_pccard_init, isic_unload, isic_card_intr, 0,net_imask);
-
-/*
- * Initialize the device - called from Slot manager.
- */
-
-static int opened = 0; /* our cards status */
-
-static int isic_pccard_init(devi)
-struct pccard_devinfo *devi;
-{
- struct isa_device *is = &devi->isahd;
-
- if ((1 << is->id_unit) & opened)
- return(EBUSY);
-
- opened |= 1 << is->id_unit;
- printf("isic%d: PCMCIA init, irqmask = 0x%x (%d), iobase = 0x%x\n",
- is->id_unit, is->id_irq, devi->slt->irq, is->id_iobase);
-
-#if 0
- /* XXX: problems resolving isic_probe_avma1_pcmcia() /phk */
- /*
- * look if there is really an AVM PCMCIA Fritz!Card and
- * setup the card specific stuff
- */
- isic_probe_avma1_pcmcia(is);
-#endif
-
- /* ap:
- * XXX what's to do with the return value?
- */
-
- /*
- * try to attach the PCMCIA card as a normal A1 card
- */
- isicattach(is);
- return(0);
-}
-
-static void isic_unload(devi)
-struct pccard_devinfo *devi;
-{
- struct isa_device *is = &devi->isahd;
- printf("isic%d: unloaded\n", is->id_unit);
- opened &= ~(1 << is->id_unit);
-}
-
-/*
- * card_intr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int isic_card_intr(devi)
-struct pccard_devinfo *devi;
-{
- isicintr(devi->isahd.id_unit);
- return(1);
-}
-
-#endif /* (NISIC > 0) && (NCARD > 0) */
-#endif /* __FreeBSD__ */
diff --git a/sys/i4b/layer1/i4b_isic_pnp.c b/sys/i4b/layer1/i4b_isic_pnp.c
deleted file mode 100644
index ed1892d9088f..000000000000
--- a/sys/i4b/layer1/i4b_isic_pnp.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 1998 Eivind Eklund. All rights reserved.
- *
- * Copyright (c) 1998 German Tischler. All rights reserved.
- *
- * Copyright (c) 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pnp.c - i4b pnp support
- * --------------------------------
- *
- * $Id: i4b_isic_pnp.c,v 1.15 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 20:54:56 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "pnp.h"
-#include "isic.h"
-#include "opt_i4b.h"
-
-#if (NISIC > 0) && (NPNP > 0)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ < 3
-#include "ioconf.h"
-extern void isicintr(int unit); /* XXX this gives a compiler warning */
- /* on one 2.2.7 machine but no */
- /* warning on another one !? (-hm) */
-#endif
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-extern void isicintr(int unit);
-#endif
-
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-
-#include <i4b/include/i4b_global.h>
-#include <machine/i4b_ioctl.h>
-#include <i4b/layer1/i4b_l1.h>
-
-#define VID_TEL163PNP 0x10212750 /* Teles 16.3 PnP */
-#define VID_CREATIXPP 0x0000980e /* Creatix S0/16 P+P */
-#define VID_DYNALINK 0x88167506 /* Dynalink */
-#define VID_SEDLBAUER 0x0100274c /* Sedlbauer WinSpeed */
-#define VID_NICCYGO 0x5001814c /* Neuhaus Niccy GO@ */
-#define VID_ELSAQS1P 0x33019315 /* ELSA Quickstep1000pro*/
-
-static struct i4b_pnp_ids {
- u_long vend_id;
- char *id_str;
-} i4b_pnp_ids[] = {
- { VID_TEL163PNP, "Teles 16.3 PnP" },
- { VID_CREATIXPP, "Creatix S0/16 P+P" },
- { VID_DYNALINK, "Dynalink IS64PH" },
- { VID_SEDLBAUER, "Sedlbauer WinSpeed" },
- { VID_NICCYGO, "Dr.Neuhaus Niccy Go@" },
- { VID_ELSAQS1P, "ELSA QuickStep 1000pro"},
- { 0 }
-};
-
-extern struct isa_driver isicdriver;
-
-static int isic_pnpprobe(struct isa_device *dev, unsigned int iobase2);
-static char *i4b_pnp_probe(u_long csn, u_long vend_id);
-static void i4b_pnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev);
-
-static u_long ni4b_pnp = 0;
-
-static struct pnp_device i4b_pnp = {
- "i4b_pnp",
- i4b_pnp_probe,
- i4b_pnp_attach,
- &ni4b_pnp,
- &net_imask
-};
-
-DATA_SET(pnpdevice_set, i4b_pnp);
-
-/*---------------------------------------------------------------------------*
- * PnP probe routine
- *---------------------------------------------------------------------------*/
-static char *
-i4b_pnp_probe(u_long csn, u_long vend_id)
-{
- struct i4b_pnp_ids *ids;
- char *string = NULL;
-
- /* search table of knowd id's */
-
- for(ids = i4b_pnp_ids; ids->vend_id != 0; ids++)
- {
- if(vend_id == ids->vend_id)
- {
- string = ids->id_str;
- break;
- }
- }
-
- if(string)
- {
- struct pnp_cinfo spci;
-
- read_pnp_parms(&spci, 0);
-
- if((spci.enable == 0) || (spci.flags & 0x01))
- {
- printf("CSN %d (%s) is disabled.\n", (int)csn, string);
- return (NULL);
- }
- }
- return(string);
-}
-
-/*---------------------------------------------------------------------------*
- * PnP attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4b_pnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
-{
- struct pnp_cinfo spci;
- struct isa_device *isa_devp;
-
- if(dev->id_unit != next_isic_unit)
- {
- printf("i4b_pnp_attach: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return;
- }
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for %s\n",
- dev->id_unit, dev->id_unit, name);
- return;
- }
-
- if(read_pnp_parms(&spci, 0) == 0)
- {
- printf("isic%d: read_pnp_parms error for %s\n",
- dev->id_unit, name);
- return;
- }
-
- if(bootverbose)
- {
- printf("isic%d: vendorid = 0x%08x port0 = 0x%04x, port1 = 0x%04x, irq = %d\n",
- dev->id_unit, spci.vendor_id, spci.port[0], spci.port[1], spci.irq[0]);
- }
-
- dev->id_iobase = spci.port[0];
- dev->id_irq = (1 << spci.irq[0]);
- dev->id_intr = (inthand2_t *) isicintr;
- dev->id_drq = -1;
-
-/* XXX add dev->id_alive init here ! ?? */
-
- switch(spci.vendor_id)
- {
- case VID_TEL163PNP:
- dev->id_flags = FLAG_TELES_S0_163_PnP;
- break;
- case VID_CREATIXPP:
- dev->id_flags = FLAG_CREATIX_S0_PnP;
- break;
- case VID_DYNALINK:
- dev->id_flags = FLAG_DYNALINK;
- break;
- case VID_SEDLBAUER:
- dev->id_flags = FLAG_SWS;
- break;
- case VID_NICCYGO:
- dev->id_flags = FLAG_DRN_NGO;
- break;
- case VID_ELSAQS1P:
- dev->id_flags = FLAG_ELSA_QS1P_ISA;
- break;
- }
-
- write_pnp_parms(&spci, 0);
- enable_pnp_card();
-
- if(dev->id_driver == NULL)
- {
- dev->id_driver = &isicdriver;
-
- isa_devp = find_isadev(isa_devtab_net, &isicdriver, 0);
-
- if(isa_devp != NULL)
- {
- dev->id_id = isa_devp->id_id;
- }
- }
-
- if((dev->id_alive = isic_pnpprobe(dev, spci.port[1])) != 0)
- {
-/* XXX dev->id_alive is the size of the port area used ! */
- isic_realattach(dev, spci.port[1]);
- }
- else
- {
- printf("isic%d: probe failed!\n", dev->id_unit);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pnp device driver probe routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pnpprobe(struct isa_device *dev, unsigned int iobase2)
-{
- int ret = 0;
-
- switch(dev->id_flags)
- {
-#ifndef __FreeBSD__
-#ifdef TEL_S0_16_3_P
- case FLAG_TELES_S0_163_PnP:
- ret = isic_probe_s0163P(dev, iobase2);
- break;
-#endif
-#endif
-
-#ifdef CRTX_S0_P
- case FLAG_CREATIX_S0_PnP:
- ret = isic_probe_Cs0P(dev, iobase2);
- break;
-#endif
-
-#ifdef DRN_NGO
- case FLAG_DRN_NGO:
- ret = isic_probe_drnngo(dev, iobase2);
- break;
-#endif
-
-#ifdef SEDLBAUER
- case FLAG_SWS:
- ret = 8; /* pnp only, nothing to probe */
- break;
-#endif
-
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_probe_Dyn(dev, iobase2);
- break;
-#endif
-
-#ifdef ELSA_QS1ISA
- case FLAG_ELSA_QS1P_ISA:
- ret = isic_probe_Eqs1pi(dev, iobase2);
- break;
-#endif
- default:
- break;
- }
- return(ret);
-}
-
-#endif /* (NISIC > 0) && (NPNP > 0) */
-#endif /* __FreeBSD__ */
diff --git a/sys/i4b/layer1/i4b_itk_ix1.c b/sys/i4b/layer1/i4b_itk_ix1.c
deleted file mode 100644
index cd70dbf9ee07..000000000000
--- a/sys/i4b/layer1/i4b_itk_ix1.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann <martin@rumolt.teuto.de>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software withough 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_itk_ix1.c - ITK ix1 micro passive card driver for isdn4bsd
- * --------------------------------------------------------------
- *
- * $Id: i4b_itk_ix1.c,v 1.1 1998/12/27 21:46:46 phk Exp $
- *
- * last edit-date: [Wed Dec 16 14:46:36 1998]
- *
- *---------------------------------------------------------------------------
- *
- * The ITK ix1 micro ISDN card is an ISA card with one region
- * of four io ports mapped and a fixed irq all jumpered on the card.
- * Access to the board is straight forward and simmilar to
- * the ELSA and DYNALINK cards. If a PCI version of this card
- * exists all we need is probably a pci-bus attachment, all
- * this low level routines should work imediately.
- *
- * To reset the card:
- * - write 0x01 to ITK_CONFIG
- * - wait >= 10 ms
- * - write 0x00 to ITK_CONFIG
- *
- * To read or write data:
- * - write address to ITK_ALE port
- * - read data from or write data to ITK_ISAC_DATA port or ITK_HSCX_DATA port
- * The two HSCX channel registers are offset by HSCXA (0x00) and HSCXB (0x40).
- *
- * XXX - A reasonable probe routine has to be written.
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(ITKIX1)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-
-#define ITK_ISAC_DATA 0
-#define ITK_HSCX_DATA 1
-#define ITK_ALE 2
-#define ITK_CONFIG 3
-#define ITK_IO_SIZE 4
-
-#define HSCXA 0
-#define HSCXB 0x40
-
-#ifndef __FreeBSD__
-static void itkix1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size);
-static void itkix1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size);
-static void itkix1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data);
-static u_int8_t itkix1_read_reg(struct isic_softc *sc, int what, bus_size_t offs);
-#else
-static u_char itkix1_read_reg(u_char *base, u_int offset);
-static void itkix1_write_reg(u_char *base, u_int offset, u_int v);
-static void itkix1_read_fifo(void *base, const void *buf, size_t len);
-static void itkix1_write_fifo(void *base, const void *buf, size_t len);
-#endif
-
-/*
- * Probe for card
- */
-#ifdef __FreeBSD__
-int
-isic_probe_itkix1(struct isa_device *dev)
-{
- u_int8_t hd, cd;
- int ret;
-
- hd = inb(dev->id_iobase + ITK_HSCX_DATA);
- cd = inb(dev->id_iobase + ITK_CONFIG);
-
- ret = (hd == 0 && cd == 0xfc);
-
-#define ITK_PROBE_DEBUG
-#ifdef ITK_PROBE_DEBUG
- printf("\nITK ix1 micro probe: hscx = 0x%02x, config = 0x%02x, would have %s\n",
- hd, cd, ret ? "succeeded" : "failed");
- return 1;
-#else
- return ret;
-#endif
-}
-#else
-int
-isic_probe_itkix1(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t hd, cd;
- int ret;
-
- hd = bus_space_read_1(t, h, ITK_HSCX_DATA);
- cd = bus_space_read_1(t, h, ITK_CONFIG);
-
- ret = (hd == 0 && cd == 0xfc);
-
-#define ITK_PROBE_DEBUG
-#ifdef ITK_PROBE_DEBUG
- printf("\nITK ix1 micro probe: hscx = 0x%02x, config = 0x%02x, would have %s\n",
- hd, cd, ret ? "succeeded" : "failed");
- return 1;
-#else
- return ret;
-#endif
-}
-#endif
-
-/*
- * Attach card
- */
-#ifdef __FreeBSD__
-int
-isic_attach_itkix1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- sc->sc_irq = dev->id_irq;
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = itkix1_read_reg;
- sc->writereg = itkix1_write_reg;
- sc->readfifo = itkix1_read_fifo;
- sc->writefifo = itkix1_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ITKIX1;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- ISAC_BASE = (caddr_t) sc->sc_port;
- HSCX_A_BASE = (caddr_t) sc->sc_port + 1;
- HSCX_B_BASE = (caddr_t) sc->sc_port + 2;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for ITK ix1 micro\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- outb((dev->id_iobase)+ITK_CONFIG, 1);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase)+ITK_CONFIG, 0);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-int isic_attach_itkix1(struct isic_softc *sc)
-{
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = itkix1_read_reg;
- sc->writereg = itkix1_write_reg;
- sc->readfifo = itkix1_read_fifo;
- sc->writefifo = itkix1_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ITKIX1;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for ITK ix1 micro\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return 0;
- }
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ITK_CONFIG, 1);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ITK_CONFIG, 0);
- DELAY(SEC_DELAY / 10);
- return 1;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_read_fifo(void *buf, const void *base, size_t len)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, 0);
- insb(port+ITK_ISAC_DATA, (u_char *)buf, (u_int)len);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA);
- insb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB);
- insb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- }
-}
-#else
-static void
-itkix1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, 0);
- bus_space_read_multi_1(t, h, ITK_ISAC_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA);
- bus_space_read_multi_1(t, h, ITK_HSCX_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB);
- bus_space_read_multi_1(t, h, ITK_HSCX_DATA, buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_write_fifo(void *base, const void *buf, size_t len)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, 0);
- outsb(port+ITK_ISAC_DATA, (u_char *)buf, (u_int)len);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA);
- outsb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB);
- outsb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- }
-}
-#else
-static void itkix1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, 0);
- bus_space_write_multi_1(t, h, ITK_ISAC_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA);
- bus_space_write_multi_1(t, h, ITK_HSCX_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB);
- bus_space_write_multi_1(t, h, ITK_HSCX_DATA, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_write_reg(u_char *base, u_int offset, u_int v)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, offset);
- outb(port+ITK_ISAC_DATA, (u_char)v);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA+offset);
- outb(port+ITK_HSCX_DATA, (u_char)v);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB+offset);
- outb(port+ITK_HSCX_DATA, (u_char)v);
- break;
- }
-}
-#else
-static void itkix1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, offs);
- bus_space_write_1(t, h, ITK_ISAC_DATA, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA+offs);
- bus_space_write_1(t, h, ITK_HSCX_DATA, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB+offs);
- bus_space_write_1(t, h, ITK_HSCX_DATA, data);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static u_char
-itkix1_read_reg(u_char *base, u_int offset)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, offset);
- return (inb(port+ITK_ISAC_DATA));
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA+offset);
- return (inb(port+ITK_HSCX_DATA));
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB+offset);
- return (inb(port+ITK_HSCX_DATA));
- }
- panic("itkix1_read_reg: Fallthrough\n");
-}
-#else
-static u_int8_t itkix1_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, offs);
- return bus_space_read_1(t, h, ITK_ISAC_DATA);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA+offs);
- return bus_space_read_1(t, h, ITK_HSCX_DATA);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB+offs);
- return bus_space_read_1(t, h, ITK_HSCX_DATA);
- }
- return 0;
-}
-#endif
-
-#endif /* ITKIX1 */
diff --git a/sys/i4b/layer1/i4b_l1.c b/sys/i4b/layer1/i4b_l1.c
deleted file mode 100644
index 96497c5df6a4..000000000000
--- a/sys/i4b/layer1/i4b_l1.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1.c - isdn4bsd layer 1 handler
- * -----------------------------------
- *
- * $Id: i4b_l1.c,v 1.27 1998/12/05 18:04:51 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:24:52 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* don't bother */
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-unsigned int i4b_l1_debug = L1_DEBUG_DEFAULT;
-
-static int ph_data_req(int, struct mbuf *, int);
-static int ph_activate_req(int);
-
-/* from i4btrc driver i4b_trace.c */
-extern int get_trace_data_from_l1(int unit, int what, int len, char *buf);
-
-/* from layer 2 */
-extern int i4b_ph_data_ind(int unit, struct mbuf *m);
-extern int i4b_ph_activate_ind(int unit);
-extern int i4b_ph_deactivate_ind(int unit);
-extern int i4b_mph_attach_ind(int unit);
-extern int i4b_mph_status_ind(int, int, int);
-
-/* layer 1 lme */
-static int i4b_mph_command_req(int, int, int);
-
-/* jump table */
-struct i4b_l1l2_func i4b_l1l2_func = {
-
- /* Layer 1 --> Layer 2 */
-
- (int (*)(int, struct mbuf *)) i4b_ph_data_ind,
- (int (*)(int)) i4b_ph_activate_ind,
- (int (*)(int)) i4b_ph_deactivate_ind,
-
- /* Layer 2 --> Layer 1 */
-
- (int (*)(int, struct mbuf *, int)) ph_data_req,
- (int (*)(int)) ph_activate_req,
-
- /* Layer 1 --> upstream, ISDN trace data */
-
- (int (*)(i4b_trace_hdr_t *, int, u_char *)) get_trace_data_from_l1,
-
- /* Driver control and status information */
-
- (int (*)(int, int, int)) i4b_mph_status_ind,
- (int (*)(int, int, int)) i4b_mph_command_req,
-};
-
-/*---------------------------------------------------------------------------*
- *
- * L2 -> L1: PH-DATA-REQUEST
- * =========================
- *
- * parms:
- * unit physical interface unit number
- * m mbuf containing L2 frame to be sent out
- * freeflag MBUF_FREE: free mbuf here after having sent
- * it out
- * MBUF_DONTFREE: mbuf is freed by Layer 2
- * returns:
- * ==0 fail, nothing sent out
- * !=0 ok, frame sent out
- *
- *---------------------------------------------------------------------------*/
-static int
-ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
-#ifdef NOTDEF
- DBGL1(L1_PRIM, "PH-DATA-REQ", ("unit %d, freeflag=%d\n", unit, freeflag));
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- DBGL1(L1_I_ERR, "ph_data_req", ("still in state F3!\n"));
- ph_activate_req(unit);
- }
-
- if(sc->sc_state & ISAC_TX_ACTIVE)
- {
- if(sc->sc_obuf2 == NULL)
- {
- sc->sc_obuf2 = m; /* save mbuf ptr */
-
- if(freeflag)
- sc->sc_freeflag2 = 1; /* IRQ must mfree */
- else
- sc->sc_freeflag2 = 0; /* IRQ must not mfree */
-
- DBGL1(L1_I_MSG, "ph_data_req", ("using 2nd ISAC TX buffer, state = %s\n", isic_printstate(sc)));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- DBGL1(L1_I_ERR, "ph_data_req", ("No Space in TX FIFO, state = %s\n", isic_printstate(sc)));
-
- if(freeflag == MBUF_FREE)
- i4b_Dfreembuf(m);
-
- splx(s);
- return (0);
- }
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- DBGL1(L1_I_MSG, "ph_data_req", ("ISAC_TX_ACTIVE set\n"));
-
- sc->sc_freeflag = 0; /* IRQ must NOT mfree */
-
- ISAC_WRFIFO(m->m_data, min(m->m_len, ISAC_FIFO_LEN)); /* output to TX fifo */
-
- if(m->m_len > ISAC_FIFO_LEN) /* message > 32 bytes ? */
- {
- sc->sc_obuf = m; /* save mbuf ptr */
- sc->sc_op = m->m_data + ISAC_FIFO_LEN; /* ptr for irq hdl */
- sc->sc_ol = m->m_len - ISAC_FIFO_LEN; /* length for irq hdl */
-
- if(freeflag)
- sc->sc_freeflag = 1; /* IRQ must mfree */
-
- cmd = ISAC_CMDR_XTF;
- }
- else
- {
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
-
- if(freeflag)
- i4b_Dfreembuf(m);
-
- cmd = ISAC_CMDR_XTF | ISAC_CMDR_XME;
- }
-
- ISAC_WRITE(I_CMDR, cmd);
- ISACCMDRWRDELAY();
-
- splx(s);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *
- * L2 -> L1: PH-ACTIVATE-REQUEST
- * =============================
- *
- * parms:
- * unit physical interface unit number
- *
- * returns:
- * ==0
- * !=0
- *
- *---------------------------------------------------------------------------*/
-static int
-ph_activate_req(int unit)
-{
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- DBGL1(L1_PRIM, "PH-ACTIVATE-REQ", ("unit %d\n", unit));
- isic_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-static int
-i4b_mph_command_req(int unit, int command, int parm)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- DBGL1(L1_PRIM, "MPH-COMMAND-REQ", ("unit %d, command = CMR_DOPEN\n", unit));
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- DBGL1(L1_PRIM, "MPH-COMMAND-REQ", ("unit %d, command = CMR_DCLOSE\n", unit));
- sc->sc_enabled = 0;
- break;
-
- default:
- DBGL1(L1_ERROR, "i4b_mph_command_req", ("ERROR, unknown command = %d, unit = %d, parm = %d\n", command, unit, parm));
- break;
- }
-
- return(0);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_l1.h b/sys/i4b/layer1/i4b_l1.h
deleted file mode 100644
index 2b15ccc92983..000000000000
--- a/sys/i4b/layer1/i4b_l1.h
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------*
- *
- * i4b_l1.h - isdn4bsd layer 1 header file
- * ---------------------------------------
- *
- * $Id: i4b_l1.h,v 1.54 1998/12/17 04:55:39 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:41:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef I4B_L1_H_
-#define I4B_L1_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-/*---------------------------------------------------------------------------
- * kernel config file flags definition
- *---------------------------------------------------------------------------*/
- /* XXX: we do need these only for real ISA (not even ISAPNP cards), and only
- * because we are not confident enough in the general ISA probe routine (as
- * practiced by the NetBSD variant). *And* it is completely redundant to the
- * various options enabling only a few card's support routines to be compiled
- * in. Probably the current truth is: this is usefull for anybody with more
- * than one supported real ISA card. It is not usefull in generic configs,
- * nor in typical one-controller-only configurations.
- * Further - it is identical to the CARD_TYPEP_xxx definitions in
- * ../machine/i4b_ioctl.h.
- */
-#define FLAG_TELES_S0_8 1
-#define FLAG_TELES_S0_16 2
-#define FLAG_TELES_S0_163 3
-#define FLAG_AVM_A1 4
-#define FLAG_TELES_S0_163_PnP 5 /* XXX - not needed, remove! */
-#define FLAG_CREATIX_S0_PnP 6 /* XXX - not needed, remove! */
-#define FLAG_USR_ISDN_TA_INT 7
-#define FLAG_DRN_NGO 8 /* XXX - not needed, remove! */
-#define FLAG_SWS 9 /* XXX - not needed, remove! */
-#define FLAG_AVM_A1_PCMCIA 10 /* XXX - not needed, remove! */
-#define FLAG_DYNALINK 11 /* XXX - not needed, remove! */
-#define FLAG_BLMASTER 12
-#define FLAG_ELSA_QS1P_ISA 13 /* XXX - not needed, remove! */
-#define FLAG_ELSA_QS1P_PCI 14 /* XXX - not needed, remove! */
-#define FLAG_SIEMENS_ITALK 15
-#define FLAG_ELSA_MLIMC 16 /* XXX - not needed, remove! */
-#define FLAG_ELSA_MLMCALL 17 /* XXX - not needed, remove! */
-#define FLAG_ITK_IX1 18
-
-#define SEC_DELAY 1000000 /* one second DELAY for DELAY*/
-
-#define MAX_DFRAME_LEN 264 /* max length of a D frame */
-
-#define min(a,b) ((a)<(b)?(a):(b))
-
-#ifndef __FreeBSD__
-/* We try to map as few as possible as small as possible io and/or
- memory regions. Each card defines its own interpretation of this
- mapping array. At probe time we have a fixed size array, later
- (when the card type is known) we allocate a minimal array
- dynamically. */
-
-#define ISIC_MAX_IO_MAPS 49 /* no cardtype needs more yet */
-
-/* one entry in mapping array */
-struct isic_io_map {
- bus_space_tag_t t; /* which bus-space is this? */
- bus_space_handle_t h; /* handle of mapped bus space region */
- bus_size_t offset; /* offset into region */
- bus_size_t size; /* size of region, zero if not ours
- (i.e.: don't ever unmap it!) */
-};
-
-/* this is passed around at probe time (no struct isic_softc yet) */
-struct isic_attach_args {
- int ia_flags; /* flags from config file */
- int ia_num_mappings; /* number of io mappings provided */
- struct isic_io_map ia_maps[ISIC_MAX_IO_MAPS];
-};
-#endif
-
-#ifdef __FreeBSD__
-extern int next_isic_unit;
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_Bchan: the state of one B channel
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- int unit; /* cards unit number */
- int channel; /* which channel is this*/
-
-#ifdef __FreeBSD__
- caddr_t hscx; /* HSCX address */
-#endif
-
- u_char hscx_mask; /* HSCX interrupt mask */
-
- int bprot; /* B channel protocol */
-
- int state; /* this channels state */
-#define HSCX_IDLE 0x00 /* channel idle */
-#define HSCX_TX_ACTIVE 0x01 /* tx running */
-
- /* receive data from ISDN */
-
- struct ifqueue rx_queue; /* receiver queue */
-
- int rxcount; /* rx statistics counter*/
-
- struct mbuf *in_mbuf; /* rx input buffer */
- u_char *in_cbptr; /* curr buffer pointer */
- int in_len; /* rx input buffer len */
-
- /* transmit data to ISDN */
-
- struct ifqueue tx_queue; /* transmitter queue */
-
- int txcount; /* tx statistics counter*/
-
- struct mbuf *out_mbuf_head; /* first mbuf in possible chain */
- struct mbuf *out_mbuf_cur; /* current mbuf in possbl chain */
- unsigned char *out_mbuf_cur_ptr; /* data pointer into mbuf */
- int out_mbuf_cur_len; /* remaining bytes in mbuf */
-
- /* link between b channel and driver */
-
- isdn_link_t isdn_linktab; /* b channel addresses */
- drvr_link_t *drvr_linktab; /* ptr to driver linktab*/
-
- /* statistics */
-
- /* RSTA */
-
- int stat_VFR; /* HSCX RSTA Valid FRame */
- int stat_RDO; /* HSCX RSTA Rx Data Overflow */
- int stat_CRC; /* HSCX RSTA CRC */
- int stat_RAB; /* HSCX RSTA Rx message ABorted */
-
- /* EXIR */
-
- int stat_XDU; /* HSCX EXIR tx data underrun */
- int stat_RFO; /* HSCX EXIR rx frame overflow */
-
-} isic_Bchan_t;
-
-/*---------------------------------------------------------------------------*
- * isic_softc: the state of the layer 1 of the D channel
- *---------------------------------------------------------------------------*/
-struct isic_softc
-{
-#ifndef __FreeBSD__
- /* We are inherited from this class. All drivers must have this
- as their first entry in struct softc. */
- struct device sc_dev;
-#endif
-
- int sc_unit; /* unit number */
- int sc_irq; /* interrupt vector */
-
-#ifdef __FreeBSD__
- int sc_port; /* port base address */
-#else
- u_int sc_maddr; /* "memory address" for card config register */
- int sc_num_mappings; /* number of io mappings provided */
- struct isic_io_map *sc_maps;
-#define MALLOC_MAPS(sc) \
- (sc)->sc_maps = (struct isic_io_map*)malloc(sizeof((sc)->sc_maps[0])*(sc)->sc_num_mappings, M_DEVBUF, 0)
-#endif
-
- int sc_cardtyp; /* CARD_TYPEP_xxxx */
-
- int sc_bustyp; /* IOM1 or IOM2 */
-#define BUS_TYPE_IOM1 0x01
-#define BUS_TYPE_IOM2 0x02
-
- int sc_trace; /* output protocol data for tracing */
- unsigned int sc_trace_dcount;/* d channel trace frame counter */
- unsigned int sc_trace_bcount;/* b channel trace frame counter */
-
- int sc_state; /* ISAC state flag */
-#define ISAC_IDLE 0x00 /* state = idle */
-#define ISAC_TX_ACTIVE 0x01 /* state = transmitter active */
-
- int sc_init_tries; /* no of out tries to access S0 */
-
-#ifdef __FreeBSD__
- caddr_t sc_vmem_addr; /* card RAM virtual memory base */
- caddr_t sc_isac; /* ISAC port base addr */
-#define ISAC_BASE (sc->sc_isac)
-
- caddr_t sc_ipacbase; /* IPAC port base addr */
-#define IPAC_BASE (sc->sc_ipacbase)
-#endif
-
- u_char sc_isac_mask; /* ISAC IRQ mask */
-#define ISAC_IMASK (sc->sc_isac_mask)
-
- isic_Bchan_t sc_chan[2]; /* B-channel state */
-#define HSCX_A_BASE (sc->sc_chan[0].hscx)
-#define HSCX_A_IMASK (sc->sc_chan[0].hscx_mask)
-#define HSCX_B_BASE (sc->sc_chan[1].hscx)
-#define HSCX_B_IMASK (sc->sc_chan[1].hscx_mask)
-
- struct mbuf *sc_ibuf; /* input buffer mgmt */
- u_short sc_ilen;
- u_char *sc_ib;
- /* this is for the irq TX routine */
- struct mbuf *sc_obuf; /* pointer to an mbuf with TX frame */
- u_char *sc_op; /* ptr to next chunk of frame to tx */
- int sc_ol; /* length of remaining frame to tx */
- int sc_freeflag; /* m_freem mbuf if set */
-
- struct mbuf *sc_obuf2; /* pointer to an mbuf with TX frame */
- int sc_freeflag2; /* m_freem mbuf if set */
-
- int sc_isac_version; /* version number of ISAC */
- int sc_hscx_version; /* version number of HSCX */
-
- int sc_I430state; /* I.430 state F3 .... F8 */
-
- int sc_I430T3; /* I.430 Timer T3 running */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle sc_T3_callout;
-#endif
-
- int sc_I430T4; /* Timer T4 running */
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- struct callout_handle sc_T4_callout;
-#endif
-
- int sc_enabled; /* daemon is running */
-
- int sc_ipac; /* flag, running on ipac */
- int sc_bfifolen; /* length of b channel fifos */
-
-#ifdef __FreeBSD__
-
- u_char (*readreg)(u_char *, u_int);
- void (*writereg)(u_char *, u_int, u_int);
- void (*readfifo)(void *, const void *, size_t);
- void (*writefifo)(void *, const void *, size_t);
- void (*clearirq)(void *);
-
-#define ISAC_READ(r) (*sc->readreg)(ISAC_BASE, (r))
-#define ISAC_WRITE(r,v) (*sc->writereg)(ISAC_BASE, (r), (v));
-#define ISAC_RDFIFO(b,s) (*sc->readfifo)((b), ISAC_BASE, (s))
-#define ISAC_WRFIFO(b,s) (*sc->writefifo)(ISAC_BASE, (b), (s))
-
-#define HSCX_READ(n,r) (*sc->readreg)(sc->sc_chan[(n)].hscx, (r))
-#define HSCX_WRITE(n,r,v) (*sc->writereg)(sc->sc_chan[(n)].hscx, (r), (v))
-#define HSCX_RDFIFO(n,b,s) (*sc->readfifo)((b), sc->sc_chan[(n)].hscx, (s))
-#define HSCX_WRFIFO(n,b,s) (*sc->writefifo)(sc->sc_chan[(n)].hscx, (b), (s))
-
-#define IPAC_READ(r) (*sc->readreg)(IPAC_BASE, (r))
-#define IPAC_WRITE(r,v) (*sc->writereg)(IPAC_BASE, (r), (v));
-
-#else /* ! __FreeBSD__ */
-
-#define ISIC_WHAT_ISAC 0
-#define ISIC_WHAT_HSCXA 1
-#define ISIC_WHAT_HSCXB 2
-#define ISIC_WHAT_IPAC 3
-
- u_int8_t (*readreg) __P((struct isic_softc *sc, int what, bus_size_t offs));
- void (*writereg) __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
- void (*readfifo) __P((struct isic_softc *sc, int what, void *buf, size_t size));
- void (*writefifo) __P((struct isic_softc *sc, int what, const void *data, size_t size));
- void (*clearirq) __P((struct isic_softc *sc));
-
-#define ISAC_READ(r) (*sc->readreg)(sc, ISIC_WHAT_ISAC, (r))
-#define ISAC_WRITE(r,v) (*sc->writereg)(sc, ISIC_WHAT_ISAC, (r), (v))
-#define ISAC_RDFIFO(b,s) (*sc->readfifo)(sc, ISIC_WHAT_ISAC, (b), (s))
-#define ISAC_WRFIFO(b,s) (*sc->writefifo)(sc, ISIC_WHAT_ISAC, (b), (s))
-
-#define HSCX_READ(n,r) (*sc->readreg)(sc, ISIC_WHAT_HSCXA+(n), (r))
-#define HSCX_WRITE(n,r,v) (*sc->writereg)(sc, ISIC_WHAT_HSCXA+(n), (r), (v))
-#define HSCX_RDFIFO(n,b,s) (*sc->readfifo)(sc, ISIC_WHAT_HSCXA+(n), (b), (s))
-#define HSCX_WRFIFO(n,b,s) (*sc->writefifo)(sc, ISIC_WHAT_HSCXA+(n), (b), (s))
-
-#define IPAC_READ(r) (*sc->readreg)(sc, ISIC_WHAT_IPAC, (r))
-#define IPAC_WRITE(r, v) (*sc->writereg)(sc, ISIC_WHAT_IPAC, (r), (v))
-
-#endif /* __FreeBSD__ */
-};
-
-/*---------------------------------------------------------------------------*
- * possible I.430/ISAC states
- *---------------------------------------------------------------------------*/
-enum I430states {
- ST_F3, /* F3 Deactivated */
- ST_F4, /* F4 Awaiting Signal */
- ST_F5, /* F5 Identifying Input */
- ST_F6, /* F6 Synchronized */
- ST_F7, /* F7 Activated */
- ST_F8, /* F8 Lost Framing */
- ST_ILL, /* Illegal State */
- N_STATES
-};
-
-/*---------------------------------------------------------------------------*
- * possible I.430/ISAC events
- *---------------------------------------------------------------------------*/
-enum I430events {
- EV_PHAR, /* PH ACTIVATE REQUEST */
- EV_T3, /* Timer 3 expired */
- EV_INFO0, /* receiving INFO0 */
- EV_RSY, /* receiving any signal */
- EV_INFO2, /* receiving INFO2 */
- EV_INFO48, /* receiving INFO4 pri 8/9 */
- EV_INFO410, /* receiving INFO4 pri 10/11 */
- EV_DR, /* Deactivate Request */
- EV_PU, /* Power UP */
- EV_DIS, /* Disconnected (only 2085) */
- EV_EI, /* Error Indication */
- EV_ILL, /* Illegal Event */
- N_EVENTS
-};
-
-enum I430commands {
- CMD_TIM, /* Timing */
- CMD_RS, /* Reset */
- CMD_AR8, /* Activation request pri 8 */
- CMD_AR10, /* Activation request pri 10 */
- CMD_DIU, /* Deactivate Indication Upstream */
- CMD_ILL /* Illegal command */
-};
-
-#define N_COMMANDS CMD_ILL
-
-#ifdef __FreeBSD__
-
-extern struct isic_softc isic_sc[];
-
-extern void isic_recover(struct isic_softc *sc);
-extern int isic_realattach(struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_avma1 ( struct isa_device *dev );
-extern int isic_attach_fritzpcmcia ( struct isa_device *dev );
-extern int isic_attach_Cs0P ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_Dyn ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_s016 ( struct isa_device *dev );
-extern int isic_attach_s0163 ( struct isa_device *dev );
-extern int isic_attach_s0163P ( struct isa_device *dev );
-extern int isic_attach_s08 ( struct isa_device *dev );
-extern int isic_attach_usrtai ( struct isa_device *dev );
-extern int isic_attach_itkix1 ( struct isa_device *dev );
-extern int isic_attach_drnngo ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_sws ( struct isa_device *dev );
-extern int isic_attach_Eqs1pi(struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_Eqs1pp(int unit, unsigned int iobase1, unsigned int iobase2);
-extern void isic_bchannel_setup (int unit, int hscx_channel, int bprot, int activate );
-extern void isic_hscx_init ( struct isic_softc *sc, int hscx_channel, int activate );
-extern void isic_hscx_irq ( struct isic_softc *sc, u_char ista, int hscx_channel, u_char ex_irq );
-extern int isic_hscx_silence ( unsigned char *data, int len );
-extern void isic_hscx_cmd( struct isic_softc *sc, int h_chan, unsigned char cmd );
-extern void isic_hscx_waitxfw( struct isic_softc *sc, int h_chan );
-extern void isic_init_linktab ( struct isic_softc *sc );
-extern int isic_isac_init ( struct isic_softc *sc );
-extern void isic_isac_irq ( struct isic_softc *sc, int r );
-extern void isic_isac_l1_cmd ( struct isic_softc *sc, int command );
-extern void isic_next_state ( struct isic_softc *sc, int event );
-extern char *isic_printstate ( struct isic_softc *sc );
-extern int isic_probe_avma1 ( struct isa_device *dev );
-extern int isic_probe_avma1_pcmcia ( struct isa_device *dev );
-extern int isic_probe_Cs0P ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_Dyn ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_s016 ( struct isa_device *dev );
-extern int isic_probe_s0163 ( struct isa_device *dev );
-extern int isic_probe_s0163P ( struct isa_device *dev );
-extern int isic_probe_s08 ( struct isa_device *dev );
-extern int isic_probe_usrtai ( struct isa_device *dev );
-extern int isic_probe_itkix1 ( struct isa_device *dev );
-extern int isic_probe_drnngo ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_sws ( struct isa_device *dev );
-extern int isic_probe_Eqs1pi(struct isa_device *dev, unsigned int iobase2);
-
-#else /* not FreeBSD */
-
-extern void isic_recover __P((struct isic_softc *sc));
-extern int isicattach __P((int flags, struct isic_softc *sc));
-extern int isicintr __P((void *));
-extern int isicprobe __P((struct isic_attach_args *ia));
-extern int isic_attach_avma1 __P((struct isic_softc *sc));
-extern int isic_attach_s016 __P((struct isic_softc *sc));
-extern int isic_attach_s0163 __P((struct isic_softc *sc));
-extern int isic_attach_s08 __P((struct isic_softc *sc));
-extern int isic_attach_usrtai __P((struct isic_softc *sc));
-extern int isic_attach_itkix1 __P((struct isic_softc *sc));
-extern void isic_bchannel_setup __P((int unit, int hscx_channel, int bprot, int activate));
-extern void isic_hscx_init __P((struct isic_softc *sc, int hscx_channel, int activate));
-extern void isic_hscx_irq __P((struct isic_softc *sc, u_char ista, int hscx_channel, u_char ex_irq));
-extern int isic_hscx_silence __P(( unsigned char *data, int len ));
-extern void isic_hscx_cmd __P(( struct isic_softc *sc, int h_chan, unsigned char cmd ));
-extern void isic_hscx_waitxfw __P(( struct isic_softc *sc, int h_chan ));
-extern void isic_init_linktab __P((struct isic_softc *sc));
-extern int isic_isac_init __P((struct isic_softc *sc));
-extern void isic_isac_irq __P((struct isic_softc *sc, int r));
-extern void isic_isac_l1_cmd __P((struct isic_softc *sc, int command));
-extern void isic_next_state __P((struct isic_softc *sc, int event));
-extern char * isic_printstate __P((struct isic_softc *sc));
-extern int isic_probe_avma1 __P((struct isic_attach_args *ia));
-extern int isic_probe_s016 __P((struct isic_attach_args *ia));
-extern int isic_probe_s0163 __P((struct isic_attach_args *ia));
-extern int isic_probe_s08 __P((struct isic_attach_args *ia));
-extern int isic_probe_usrtai __P((struct isic_attach_args *ia));
-extern int isic_probe_itkix1 __P((struct isic_attach_args *ia));
-
-extern struct isic_softc *isic_sc[];
-
-#define isic_find_sc(unit) (isic_sc[(unit)])
-
-#endif /* __FreeBSD__ */
-
-#endif /* I4B_L1_H_ */
diff --git a/sys/i4b/layer1/i4b_l1fsm.c b/sys/i4b/layer1/i4b_l1fsm.c
deleted file mode 100644
index 397ce11f711c..000000000000
--- a/sys/i4b/layer1/i4b_l1fsm.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1fsm.c - isdn4bsd layer 1 I.430 state machine
- * --------------------------------------------------
- *
- * $Id: i4b_l1fsm.c,v 1.26 1998/12/05 18:04:55 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:25:12 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-
-static char *state_text[N_STATES] = {
- "F3 Deactivated",
- "F4 Awaiting Signal",
- "F5 Identifying Input",
- "F6 Synchronized",
- "F7 Activated",
- "F8 Lost Framing",
- "Illegal State"
-};
-
-static char *event_text[N_EVENTS] = {
- "EV_PHAR PH_ACT_REQ",
- "EV_T3 Timer 3 expired",
- "EV_INFO0 INFO0 received",
- "EV_RSY Level Detected",
- "EV_INFO2 INFO2 received",
- "EV_INFO48 INFO4 received",
- "EV_INFO410 INFO4 received",
- "EV_DR Deactivate Req",
- "EV_PU Power UP",
- "EV_DIS Disconnected",
- "EV_EI Error Ind",
- "Illegal Event"
-};
-
-/* Function prototypes */
-
-static void timer3_expired (struct isic_softc *sc);
-static void T3_start (struct isic_softc *sc);
-static void T3_stop (struct isic_softc *sc);
-static void F_T3ex (struct isic_softc *sc);
-static void timer4_expired (struct isic_softc *sc);
-static void T4_start (struct isic_softc *sc);
-static void T4_stop (struct isic_softc *sc);
-static void F_AI8 (struct isic_softc *sc);
-static void F_AI10 (struct isic_softc *sc);
-static void F_I01 (struct isic_softc *sc);
-static void F_I02 (struct isic_softc *sc);
-static void F_I03 (struct isic_softc *sc);
-static void F_I2 (struct isic_softc *sc);
-static void F_ill (struct isic_softc *sc);
-static void F_NULL (struct isic_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct isic_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- DBGL1(L1_T_ERR, "timer3_expired", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- isic_recover(sc);
-
- sc->sc_init_tries++; /* increment retry count */
-
-/*XXX*/ if(sc->sc_init_tries > 4)
- {
- int s = SPLI4B();
-
- sc->sc_init_tries = 0;
-
- if(sc->sc_obuf2 != NULL)
- {
- i4b_Dfreembuf(sc->sc_obuf2);
- sc->sc_obuf2 = NULL;
- }
- if(sc->sc_obuf != NULL)
- {
- i4b_Dfreembuf(sc->sc_obuf);
- sc->sc_obuf = NULL;
- sc->sc_freeflag = 0;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- }
-
- splx(s);
-
- MPH_Status_Ind(sc->sc_unit, STI_NOL1ACC, 0);
- }
-
- isic_next_state(sc, EV_T3);
- }
- else
- {
- DBGL1(L1_T_ERR, "timer3_expired", ("expired without starting it ....\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T3_start", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T3 = 1;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, 2*hz);
-#else
- timeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, 2*hz);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T3_stop", ("state = %s\n", isic_printstate(sc)));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, sc->sc_T3_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_T3ex", ("FSM function F_T3ex executing\n"));
- PH_Deact_Ind(sc->sc_unit);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct isic_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- DBGL1(L1_T_ERR, "timer4_expired", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T4 = 0;
- MPH_Status_Ind(sc->sc_unit, STI_PDEACT, 0);
- }
- else
- {
- DBGL1(L1_T_ERR, "timer4_expired", ("expired without starting it ....\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T4_start", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T4 = 1;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, hz);
-#else
- timeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, hz);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T4_stop", ("state = %s\n", isic_printstate(sc)));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, sc->sc_T4_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct isic_softc *sc)
-{
- T4_stop(sc);
-
- DBGL1(L1_F_MSG, "F_AI8", ("FSM function F_AI8 executing\n"));
-
- PH_Act_Ind(sc->sc_unit);
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct isic_softc *sc)
-{
- T4_stop(sc);
-
- DBGL1(L1_F_MSG, "F_AI10", ("FSM function F_AI10 executing\n"));
-
- PH_Act_Ind(sc->sc_unit);
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I01", ("FSM function F_I01 executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I02", ("FSM function F_I02 executing\n"));
-
- PH_Deact_Ind(sc->sc_unit);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I03", ("FSM function F_I03 executing\n"));
-
- PH_Deact_Ind(sc->sc_unit);
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_AR", ("FSM function F_AR executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-
- isic_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I2", ("FSM function F_I2 executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct isic_softc *sc)
-{
- DBGL1(L1_F_ERR, "F_ill", ("FSM function F_ill executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_NULL", ("FSM function F_NULL executing\n"));
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct isic_state_tab {
- void (*func) (struct isic_softc *sc); /* function to execute */
- int newstate; /* next state */
-} isic_state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: F3 F4 F5 F6 F7 F8 ILLEGAL STATE */
-/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/* EV_PHAR x*/ {{F_AR, ST_F4}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_ill, ST_ILL}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_T3 x*/ {{F_NULL, ST_F3}, {F_T3ex, ST_F3}, {F_T3ex, ST_F3}, {F_T3ex, ST_F3}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_INFO0 */ {{F_I01, ST_F3}, {F_I01, ST_F4}, {F_I01, ST_F5}, {F_I02, ST_F3}, {F_I03, ST_F3}, {F_I03, ST_F3}, {F_ill, ST_ILL}},
-/* EV_RSY x*/ {{F_NULL, ST_F3}, {F_NULL, ST_F5}, {F_NULL, ST_F5}, {F_NULL, ST_F8}, {F_NULL, ST_F8}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_INFO2 */ {{F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_ill, ST_ILL}},
-/* EV_INFO48*/ {{F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_NULL, ST_F7}, {F_AI8, ST_F7}, {F_ill, ST_ILL}},
-/* EV_INFO41*/ {{F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_NULL, ST_F7}, {F_AI10, ST_F7}, {F_ill, ST_ILL}},
-/* EV_DR */ {{F_NULL, ST_F3}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_PU */ {{F_NULL, ST_F3}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_DIS */ {{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_EI */ {{F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_ill, ST_ILL}},
-/* EV_ILL */ {{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void
-isic_next_state(struct isic_softc *sc, int event)
-{
- int currstate, newstate;
-
- if(event >= N_EVENTS)
- panic("i4b_l1fsm.c: event >= N_EVENTS\n");
-
- currstate = sc->sc_I430state;
-
- if(currstate >= N_STATES)
- panic("i4b_l1fsm.c: currstate >= N_STATES\n");
-
- newstate = isic_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- DBGL1(L1_F_MSG, "isic_next_state", ("FSM event [%s]: [%s => %s]\n", event_text[event],
- state_text[currstate],
- state_text[newstate]));
-
- (*isic_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- DBGL1(L1_F_ERR, "isic_next_state", ("FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!\n",
- state_text[currstate],
- state_text[newstate],
- event_text[event]));
- }
-
- sc->sc_I430state = newstate;
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-isic_printstate(struct isic_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_sws.c b/sys/i4b/layer1/i4b_sws.c
deleted file mode 100644
index c5182b49e3d7..000000000000
--- a/sys/i4b/layer1/i4b_sws.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (c) 1998 German Tischler. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * Card format:
- *
- * iobase + 0 : reset on (0x03)
- * iobase + 1 : reset off (0x0)
- * iobase + 2 : isac read/write
- * iobase + 3 : hscx read/write ( offset 0-0x3f hscx0 ,
- * offset 0x40-0x7f hscx1 )
- * iobase + 4 : offset for indirect adressing
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for SWS cards
- * ====================================================
- *
- * EXPERIMENTAL !!!!
- * =================
- *
- * $Id: i4b_sws.c,v 1.12 1998/12/18 09:32:45 hm Exp $
- *
- * last edit-date: [Sun Dec 13 10:49:25 1998]
- *
- * -hm adding driver to i4b
- * -hm adjustments for FreeBSD < 2.2.6, no PnP support yet
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-
-#include "isic.h"
-#include "opt_i4b.h"
-
-#else
-
-#define NISIC 1
-
-#endif
-
-#if defined (SEDLBAUER) && NISIC > 0
-
-#define SWS_RESON 0 /* reset on */
-#define SWS_RESOFF 1 /* reset off */
-#define SWS_ISAC 2 /* ISAC */
-#define SWS_HSCX0 3 /* HSCX0 */
-#define SWS_RW 4 /* indirect access register */
-#define SWS_HSCX1 5 /* this is for fakeing that we mean hscx1, though */
- /* access is done through hscx0 */
-
-#define SWS_REGS 8 /* we use an area of 8 bytes for io */
-
-#define SWS_BASE(X) ((unsigned int)X&~(SWS_REGS-1))
-#define SWS_PART(X) ((unsigned int)X& (SWS_REGS-1))
-#define SWS_ADDR(X) ((SWS_PART(X) == SWS_ISAC) ? (SWS_BASE(X)+SWS_ISAC) : (SWS_BASE(X)+SWS_HSCX0) )
-#define SWS_REG(X,Y) ((SWS_PART(X) != SWS_HSCX1) ? Y : (Y+0x40) )
-#define SWS_IDO(X) (SWS_BASE(X)+SWS_RW)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t sws_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void sws_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void sws_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void sws_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_sws __P((struct isic_softc *sc));
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(SWS_IDO(base),SWS_REG(base,0));
- insb(SWS_ADDR(base),buf,len);
-}
-
-#else
-
-static void
-sws_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_read_multi_1(t, h, SWS_ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_read_multi_1(t, h, SWS_HSCX0, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40);
- bus_space_read_multi_1(t, h, SWS_HSCX0, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_write_fifo(void *base, const void *buf, size_t len)
-{
- outb (SWS_IDO(base),SWS_REG(base,0));
- outsb(SWS_ADDR(base),buf,len);
-}
-
-#else
-
-static void
-sws_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_write_multi_1(t, h, SWS_ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_write_multi_1(t, h, SWS_HSCX0, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40);
- bus_space_write_multi_1(t, h, SWS_HSCX0, (u_int8_t*)buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC put register routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb(SWS_IDO(base),SWS_REG(base,offset));
- outb(SWS_ADDR(base),v);
-}
-
-#else
-
-static void
-sws_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, offs);
- bus_space_write_1(t, h, SWS_ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, offs);
- bus_space_write_1(t, h, SWS_HSCX0, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40+offs);
- bus_space_write_1(t, h, SWS_HSCX0, data);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-sws_read_reg(u_char *base, u_int offset)
-{
- outb(SWS_IDO(base),SWS_REG(base,offset));
- return inb(SWS_ADDR(base));
-}
-
-#else
-
-static u_int8_t
-sws_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, offs);
- return bus_space_read_1(t, h, SWS_ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, offs);
- return bus_space_read_1(t, h, SWS_HSCX0);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40+offs);
- return bus_space_read_1(t, h, SWS_HSCX0);
- }
- return 0;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/* attach callback routine */
-
-int
-isic_attach_sws(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* fill in isic_softc structure */
-
- sc->readreg = sws_read_reg;
- sc->writereg = sws_write_reg;
- sc->readfifo = sws_read_fifo;
- sc->writefifo = sws_write_fifo;
- sc->clearirq = NULL;
- sc->sc_unit = dev->id_unit;
- sc->sc_irq = dev->id_irq;
- sc->sc_port = dev->id_iobase;
- sc->sc_cardtyp = CARD_TYPEP_SWS;
- sc->sc_bustyp = BUS_TYPE_IOM2;
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
- dev->id_msize = 0;
-
- ISAC_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_ISAC);
- HSCX_A_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_HSCX0);
- HSCX_B_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_HSCX1);
-
- /*
- * Read HSCX A/B VSTR. Expected value for the SWS PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for SWS PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /* reset card */
-
- outb( ((u_int) sc->sc_port) + SWS_RESON , 0x3);
- DELAY(SEC_DELAY / 5);
- outb( ((u_int) sc->sc_port) + SWS_RESOFF, 0);
- DELAY(SEC_DELAY / 5);
-
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_sws(struct isic_softc *sc)
-{
- /* setup access routines */
-
- sc->readreg = sws_read_reg;
- sc->writereg = sws_write_reg;
-
- sc->readfifo = sws_read_fifo;
- sc->writefifo = sws_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_SWS;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /*
- * Read HSCX A/B VSTR. Expected value for the SWS PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for SWS PnP\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return;
- }
-
- /* reset card */
- {
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, SWS_RESON, 0x3);
- DELAY(SEC_DELAY / 5);
- bus_space_write_1(t, h, SWS_RESOFF, 0);
- DELAY(SEC_DELAY / 5);
- }
-}
-
-#endif /* !__FreeBSD__ */
-
-#endif /* defined(SEDLBAUER) && NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_tel_s016.c b/sys/i4b/layer1/i4b_tel_s016.c
deleted file mode 100644
index f77a3c184241..000000000000
--- a/sys/i4b/layer1/i4b_tel_s016.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/16 and clones
- * =================================================================
- *
- * $Id: i4b_tel_s016.c,v 1.12 1998/12/05 18:04:56 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:40:17 1998]
- *
- * -hm clean up
- * -hm checked with a Creatix ISDN-S0 (PCB version: mp 130.1)
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm converting asm -> C
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-
-#ifndef __FreeBSD__
-static u_int8_t tels016_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels016_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels016_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels016_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels016_write_reg(u_char *base, u_int i, u_int v)
-{
- if(i & 0x01)
- i |= 0x200;
- base[i] = v;
-}
-
-#else
-
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-static void
-tels016_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
-
- offs += offset[what];
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels016_read_reg(u_char *base, u_int i)
-{
- if(i & 0x1)
- i |= 0x200;
- return(base[i]);
-}
-
-#else
-
-static u_int8_t
-tels016_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
-
- offs += offset[what];
-
- if(offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 fifo read/write routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels016_memcpyb(void *to, const void *from, size_t len)
-{
- for(;len > 0; len--)
- *((unsigned char *)to)++ = *((unsigned char *)from)++;
-}
-
-#else
-
-static void
-tels016_write_fifo(struct isic_softc *sc, int what, const void *data, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-static void
-tels016_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s016 - probe for Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s016(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* check if valid memory addr */
-
- switch((unsigned int)kvtop(dev->id_maddr))
- {
- case 0xc0000:
- case 0xc2000:
- case 0xc4000:
- case 0xc6000:
- case 0xc8000:
- case 0xca000:
- case 0xcc000:
- case 0xce000:
- case 0xd0000:
- case 0xd2000:
- case 0xd4000:
- case 0xd6000:
- case 0xd8000:
- case 0xda000:
- case 0xdc000:
- case 0xde000:
- break;
-
- default:
- printf("isic%d: Error, invalid mem addr 0x%lx for Teles S0/16!\n",
- dev->id_unit, kvtop(dev->id_maddr));
- return(0);
- break;
- }
- sc->sc_vmem_addr = (caddr_t) dev->id_maddr;
- dev->id_msize = 0x1000;
-
- /* check card signature */
-
- if((byte = inb(sc->sc_port)) != 0x51)
- {
- printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 1)) != 0x93)
- {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- byte = inb(sc->sc_port + 2);
-
- if((byte != 0x1e) && (byte != 0x1f))
- {
- printf("isic%d: Error, signature 3 0x%x != 0x1e or 0x1f for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels016_read_reg;
- sc->writereg = tels016_write_reg;
-
- sc->readfifo = tels016_memcpyb;
- sc->writefifo = tels016_memcpyb;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC base addr */
-
- ISAC_BASE = (caddr_t) ((dev->id_maddr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t) ((dev->id_maddr) + 0x180);
- HSCX_B_BASE = (caddr_t) ((dev->id_maddr) + 0x1c0);
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s016(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t b0, b1, b2;
-
- b0 = bus_space_read_1(t, h, 0);
- b1 = bus_space_read_1(t, h, 1);
- b2 = bus_space_read_1(t, h, 2);
-
- if (b0 == 0x51 && b1 == 0x93 && (b2 == 0x1e || b2 == 0x1f))
- return 1;
-
- return 0;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s016 - attach Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-int
-#ifdef __FreeBSD__
-isic_attach_s016(struct isa_device *dev)
-#else
-isic_attach_s016(struct isic_softc *sc)
-#endif
-{
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#endif
-
- u_long irq;
-
-#ifndef __FreeBSD__
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels016_read_reg;
- sc->writereg = tels016_write_reg;
-
- sc->readfifo = tels016_read_fifo;
- sc->writefifo = tels016_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
-#endif
-
-#ifdef __FreeBSD__
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for Teles S0/16!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-#else
- irq = intr_no[sc->sc_irq];
-#endif
-
- /* configure IRQ */
-
-#ifdef __FreeBSD__
- irq |= ((u_long) sc->sc_vmem_addr) >> 9;
-
- DELAY(SEC_DELAY / 10);
- outb(sc->sc_port + 4, irq);
-
- DELAY(SEC_DELAY / 10);
- outb(sc->sc_port + 4, irq | 0x01);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card bit off */
-
- sc->sc_vmem_addr[0x80] = 0;
- DELAY(SEC_DELAY / 5);
-
- /* set card bit on */
-
- sc->sc_vmem_addr[0x80] = 1;
- DELAY(SEC_DELAY / 5);
-
-#else
-
- irq |= ((sc->sc_maddr >> 9) & 0x000000f0);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 4, irq);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 4, irq | 0x01);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card bit off */
-
- bus_space_write_1(sc->sc_maps[1].t, sc->sc_maps[1].h, 0x80, 0);
- DELAY(SEC_DELAY / 5);
-
- /* set card bit on */
-
- bus_space_write_1(sc->sc_maps[1].t, sc->sc_maps[1].h, 0x80, 1);
- DELAY(SEC_DELAY / 5);
-#endif
-
- return (1);
-}
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s0163.c b/sys/i4b/layer1/i4b_tel_s0163.c
deleted file mode 100644
index 5fdd32961b73..000000000000
--- a/sys/i4b/layer1/i4b_tel_s0163.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/16.3
- * ========================================================
- *
- * $Id: i4b_tel_s0163.c,v 1.15 1998/12/05 18:04:58 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:40:58 1998]
- *
- * -hm clean up
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm VSTR detection for older 16.3 cards
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16_3)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-
-#ifndef __FreeBSD__
-static u_int8_t tels0163_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels0163_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels0163_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels0163_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 read fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x1e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 write fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x1e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-tels0163_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs - 0x20, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels0163_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-tels0163_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs - 0x20);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s0163 - probe for Teles S0/16.3 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s0163(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16.3!",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Teles S0/16.3!",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16.3!",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- if((byte = inb(sc->sc_port)) != 0x51)
- {
- printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 1)) != 0x93)
- {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 2)) != 0x1c)
- {
- printf("isic%d: Error, signature 3 0x%x != 0x1c for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163_read_reg;
- sc->writereg = tels0163_write_reg;
-
- sc->readfifo = tels0163_read_fifo;
- sc->writefifo = tels0163_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16_3;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- ISAC_BASE = (caddr_t) 0x960;
- HSCX_A_BASE = (caddr_t) 0x160;
- HSCX_B_BASE = (caddr_t) 0x560;
- break;
-
- case 0xe80:
- ISAC_BASE = (caddr_t) 0xa60;
- HSCX_A_BASE = (caddr_t) 0x260;
- HSCX_B_BASE = (caddr_t) 0x660;
- break;
-
- case 0xf80:
- ISAC_BASE = (caddr_t) 0xb60;
- HSCX_A_BASE = (caddr_t) 0x360;
- HSCX_B_BASE = (caddr_t) 0x760;
- break;
- }
-
- /*
- * Read HSCX A/B VSTR. Expected value for the S0/16.3 card is
- * 0x05 or 0x04 (for older 16.3's) in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for Teles S0/16.3\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s0163(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t b0, b1, b2;
-
- b0 = bus_space_read_1(t, h, 0);
- b1 = bus_space_read_1(t, h, 1);
- b2 = bus_space_read_1(t, h, 2);
-
- if (b0 == 0x51 && b1 == 0x93 && b2 == 0x1c)
- return 1;
-
- return 0;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163 - attach Teles S0/16.3 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_s0163(struct isa_device *dev)
-{
- u_char irq;
-
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-
- /* configure IRQ */
-
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + 4, irq);
-
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + 4, irq | 0x01);
-
- return (1);
-}
-
-#else
-
-int
-isic_attach_s0163(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_int8_t irq = intr_no[sc->sc_irq];
-
- /* configure IRQ */
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, irq);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, irq | 0x01);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163_read_reg;
- sc->writereg = tels0163_write_reg;
-
- sc->readfifo = tels0163_read_fifo;
- sc->writefifo = tels0163_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16_3;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- return (1);
-}
-#endif
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s08.c b/sys/i4b/layer1/i4b_tel_s08.c
deleted file mode 100644
index 6115e12ab624..000000000000
--- a/sys/i4b/layer1/i4b_tel_s08.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/8 and clones
- * ================================================================
- *
- * $Id: i4b_tel_s08.c,v 1.13 1998/12/05 18:04:59 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:39:12 1998]
- *
- * -hm clean up
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm making it finally work (checked with board revision 1.2)
- * -hm converting asm -> C
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_8)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t tels08_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels08_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels08_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-static void tels08_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels08_write_reg(u_char *base, u_int i, u_int v)
-{
- if(i & 0x01)
- i |= 0x200;
- base[i] = v;
-}
-
-#else
-
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-static void
-tels08_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels08_read_reg(u_char *base, u_int i)
-{
- if(i & 0x1)
- i |= 0x200;
- return(base[i]);
-}
-
-#else
-
-static u_int8_t
-tels08_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 fifo read/write access
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels08_memcpyb(void *to, const void *from, size_t len)
-{
- for(;len > 0; len--)
- *((unsigned char *)to)++ = *((unsigned char *)from)++;
-}
-
-#else
-
-static void
-tels08_write_fifo(struct isic_softc *sc, int what, const void *data, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-static void
-tels08_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s08 - probe for Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-int
-isic_probe_s08(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/8!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 2:
- case 9: /* XXX */
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/8!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- if(dev->id_iobase > 0)
- {
- printf("isic%d: Error, iobase specified for Teles S0/8!\n",
- dev->id_unit);
- return(0);
- }
-
- /* check if inside memory range of 0xA0000 .. 0xDF000 */
-
- if( (kvtop(dev->id_maddr) < 0xa0000) ||
- (kvtop(dev->id_maddr) > 0xdf000) )
- {
- printf("isic%d: Error, mem addr 0x%lx outside 0xA0000-0xDF000 for Teles S0/8!\n",
- dev->id_unit, kvtop(dev->id_maddr));
- return(0);
- }
-
- sc->sc_vmem_addr = (caddr_t) dev->id_maddr;
- dev->id_msize = 0x1000;
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels08_read_reg;
- sc->writereg = tels08_write_reg;
-
- sc->readfifo = tels08_memcpyb;
- sc->writefifo = tels08_memcpyb;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_8;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC base addr */
-
- ISAC_BASE = (caddr_t)((dev->id_maddr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t)((dev->id_maddr) + 0x180);
- HSCX_B_BASE = (caddr_t)((dev->id_maddr) + 0x1c0);
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s08(struct isic_attach_args *ia)
-{
- /* no real sensible probe is easy - write to fifo memory
- and read back to verify there is memory doesn't work,
- because you talk to tx fifo and rcv fifo. So, just check
- HSCX version, which at least fails if no card present
- at the given location. */
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t v1, v2;
-
- /* HSCX A VSTR */
- v1 = bus_space_read_1(t, h, offset[1] + H_VSTR) & 0x0f;
- if (v1 != HSCX_VA1 && v1 != HSCX_VA2 && v1 != HSCX_VA3 && v1 != HSCX_V21)
- return 0;
-
- /* HSCX B VSTR */
- v2 = bus_space_read_1(t, h, offset[2] + H_VSTR) & 0x0f;
- if (v2 != HSCX_VA1 && v2 != HSCX_VA2 && v2 != HSCX_VA3 && v2 != HSCX_V21)
- return 0;
-
- /* both HSCX channels should have the same version... */
- if (v1 != v2)
- return 0;
-
- return 1;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s08 - attach Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-int
-#ifdef __FreeBSD__
-isic_attach_s08(struct isa_device *dev)
-#else
-isic_attach_s08(struct isic_softc *sc)
-#endif
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#else
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-#endif
-
- /* set card off */
-
-#ifdef __FreeBSD__
- sc->sc_vmem_addr[0x80] = 0;
-#else
- bus_space_write_1(t, h, 0x80, 0);
-#endif
-
- DELAY(SEC_DELAY / 5);
-
- /* set card on */
-
-#ifdef __FreeBSD__
- sc->sc_vmem_addr[0x80] = 1;
-#else
- bus_space_write_1(t, h, 0x80, 1);
-#endif
-
- DELAY(SEC_DELAY / 5);
-
-#ifndef __FreeBSD__
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels08_read_reg;
- sc->writereg = tels08_write_reg;
- sc->readfifo = tels08_read_fifo;
- sc->writefifo = tels08_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_8;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
-#endif
-
- return (1);
-}
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s0P.c b/sys/i4b/layer1/i4b_tel_s0P.c
deleted file mode 100644
index 9bccd77b6fc9..000000000000
--- a/sys/i4b/layer1/i4b_tel_s0P.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Copyright (c) 1997 Andrew Gordon. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0 PnP
- * =======================================================
- *
- * EXPERIMENTAL !!!
- * ================
- *
- * $Id: i4b_tel_s0P.c,v 1.12 1998/12/13 09:52:34 hm Exp $
- *
- * last edit-date: [Thu Dec 10 07:11:15 1998]
- *
- * -hm rudimentary PnP support, hint from Andrew Gordon
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16_3_P)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t tels0163P_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels0163P_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels0163P_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels0163P_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_s0163P __P((struct isic_softc *sc));
-#endif
-
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP read fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163P_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x3e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP write fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163P_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x3e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-tels0163P_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels0163P_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-tels0163P_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s0163P - probe for Teles S0/16.3 PnP and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s0163P(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16.3 PnP!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x580:
- case 0x500:
- case 0x680:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163P_read_reg;
- sc->writereg = tels0163P_write_reg;
-
- sc->readfifo = tels0163P_read_fifo;
- sc->writefifo = tels0163P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_163P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- switch(dev->id_iobase)
- {
- case 0x580:
- ISAC_BASE = (caddr_t) 0x580 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x180 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x180;
- break;
-
- case 0x500:
- ISAC_BASE = (caddr_t) 0x500 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x100 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x100;
- break;
-
- case 0x680:
- ISAC_BASE = (caddr_t) 0x680 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x280 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x280;
- break;
- }
-
- /*
- * Read HSCX A/B VSTR. Expected value for the S0/16.3 PnP card is
- * 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Teles S0/16.3 PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach Teles S0/16.3 PnP and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_s0163P(struct isa_device *dev)
-{
- outb((dev->id_iobase) + 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase) + 0x1c, 1);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-void
-isic_attach_s0163P(struct isic_softc *sc)
-{
- /* init card */
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 0x1c, 1);
- DELAY(SEC_DELAY / 10);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163P_read_reg;
- sc->writereg = tels0163P_write_reg;
-
- sc->readfifo = tels0163P_read_fifo;
- sc->writefifo = tels0163P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_163P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-#endif
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_usr_sti.c b/sys/i4b/layer1/i4b_usr_sti.c
deleted file mode 100644
index db89296160fa..000000000000
--- a/sys/i4b/layer1/i4b_usr_sti.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_usr_sti.c - USRobotics Sportster ISDN TA intern (Tina-pp)
- * -------------------------------------------------------------
- *
- * $Id: i4b_usr_sti.c,v 1.16 1998/12/05 18:05:02 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:25:34 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(USR_STI)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- * USR Sportster TA intern special registers
- *---------------------------------------------------------------------------*/
-#define USR_HSCXA_OFF 0x0000
-#define USR_HSCXB_OFF 0x4000
-#define USR_INTL_OFF 0x8000
-#define USR_ISAC_OFF 0xc000
-
-#define USR_RES_BIT 0x80 /* 0 = normal, 1 = reset ISAC/HSCX */
-#define USR_INTE_BIT 0x40 /* 0 = IRQ disabled, 1 = IRQ's enabled */
-#define USR_IL_MASK 0x07 /* IRQ level config */
-
-static u_char intr_no[] = { 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 3, 4, 5, 0, 6, 7 };
-
-#ifdef __FreeBSD__
-
-#define ADDR(reg) \
- (((reg/4) * 1024) + ((reg%4) * 2))
-
-/*---------------------------------------------------------------------------*
- * USRobotics read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_read_fifo(void *buf, const void *base, size_t len)
-{
- register int offset = 0;
-
- for(;len > 0; len--, offset++)
- *((u_char *)buf + offset) = inb((int)base + ADDR(offset));
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_fifo(void *base, const void *buf, size_t len)
-{
- register int offset = 0;
-
- for(;len > 0; len--, offset++)
- outb((int)base + ADDR(offset), *((u_char *)buf + offset));
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write register routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + ADDR(offset), (u_char)v);
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-usrtai_read_reg(u_char *base, u_int offset)
-{
- return(inb((int)base + ADDR(offset)));
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_usrtai - probe for USR
- *---------------------------------------------------------------------------*/
-int
-isic_probe_usrtai(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= MAXUNIT for USR Sportster TA!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 0)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- dev->id_unit, (ffs(dev->id_irq))-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for USR Sportster TA!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x200:
- case 0x208:
- case 0x210:
- case 0x218:
- case 0x220:
- case 0x228:
- case 0x230:
- case 0x238:
- case 0x240:
- case 0x248:
- case 0x250:
- case 0x258:
- case 0x260:
- case 0x268:
- case 0x270:
- case 0x278:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for USR Sportster TA!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = usrtai_read_reg;
- sc->writereg = usrtai_write_reg;
-
- sc->readfifo = usrtai_read_fifo;
- sc->writefifo = usrtai_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_USRTA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase + USR_ISAC_OFF;
- HSCX_A_BASE = (caddr_t)dev->id_iobase + USR_HSCXA_OFF;
- HSCX_B_BASE = (caddr_t)dev->id_iobase + USR_HSCXB_OFF;
-
- /*
- * Read HSCX A/B VSTR. Expected value for USR Sportster TA based
- * boards is 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for USR Sportster TA\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_usrtai - attach USR
- *---------------------------------------------------------------------------*/
-int
-isic_attach_usrtai(struct isa_device *dev)
-{
- u_char irq = 0;
-
- /* reset the HSCX and ISAC chips */
-
- outb(dev->id_iobase + USR_INTL_OFF, USR_RES_BIT);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + USR_INTL_OFF, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 0)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-
- /* configure and enable irq */
-
- outb(dev->id_iobase + USR_INTL_OFF, irq | USR_INTE_BIT);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#else /* end of FreeBSD, start NetBSD */
-
-/*
- * Use of sc->sc_maps:
- * 0 : config register
- * 1 - 16 : HSCX A registers
- * 17 - 32 : HSCX B registers
- * 33 - 48 : ISAC registers
- */
-
-#define USR_REG_OFFS(reg) ((reg % 4) * 2)
-#define USR_HSCXA_MAP(reg) ((reg / 4) + 1)
-#define USR_HSCXB_MAP(reg) ((reg / 4) + 17)
-#define USR_ISAC_MAP(reg) ((reg / 4) + 33)
-
-static int map_base[] = { 33, 1, 17, 0 }; /* ISAC, HSCX A, HSCX B */
-
-/*---------------------------------------------------------------------------*
- * USRobotics read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- int map, off, offset;
- u_char * p = buf;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- for (offset = 0; size > 0; size--, offset++) {
- map = map_base[what] + (offset / 4);
- t = sc->sc_maps[map].t;
- h = sc->sc_maps[map].h;
- off = USR_REG_OFFS(offset);
-
- *p++ = bus_space_read_1(t, h, off);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- int map, off, offset;
- const u_char * p = buf;
- bus_space_tag_t t;
- bus_space_handle_t h;
- u_char v;
-
- for (offset = 0; size > 0; size--, offset++) {
- map = map_base[what] + (offset / 4);
- t = sc->sc_maps[map].t;
- h = sc->sc_maps[map].h;
- off = USR_REG_OFFS(offset);
-
- v = *p++;
- bus_space_write_1(t, h, off, v);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write register routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- int map = map_base[what] + (offs / 4),
- off = USR_REG_OFFS(offs);
- bus_space_tag_t t = sc->sc_maps[map].t;
- bus_space_handle_t h = sc->sc_maps[map].h;
-
- bus_space_write_1(t, h, off, data);
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-usrtai_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- int map = map_base[what] + (offs / 4),
- off = USR_REG_OFFS(offs);
- bus_space_tag_t t = sc->sc_maps[map].t;
- bus_space_handle_t h = sc->sc_maps[map].h;
-
- return bus_space_read_1(t, h, off);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_usrtai - probe for USR
- *---------------------------------------------------------------------------*/
-int
-isic_probe_usrtai(struct isic_attach_args *ia)
-{
- /*
- * Read HSCX A/B VSTR. Expected value for IOM2 based
- * boards is 0x05 in the least significant bits.
- */
-
- if(((bus_space_read_1(ia->ia_maps[USR_HSCXA_MAP(H_VSTR)].t, ia->ia_maps[USR_HSCXA_MAP(H_VSTR)].h, USR_REG_OFFS(H_VSTR)) & 0x0f) != 0x05) ||
- ((bus_space_read_1(ia->ia_maps[USR_HSCXB_MAP(H_VSTR)].t, ia->ia_maps[USR_HSCXB_MAP(H_VSTR)].h, USR_REG_OFFS(H_VSTR)) & 0x0f) != 0x05))
- return 0;
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_usrtai - attach USR
- *---------------------------------------------------------------------------*/
-int
-isic_attach_usrtai(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_char irq = intr_no[sc->sc_irq];
-
- sc->clearirq = NULL;
- sc->readreg = usrtai_read_reg;
- sc->writereg = usrtai_write_reg;
-
- sc->readfifo = usrtai_read_fifo;
- sc->writefifo = usrtai_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_USRTA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the HSCX and ISAC chips */
-
- bus_space_write_1(t, h, 0, USR_RES_BIT);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- bus_space_write_1(t, h, 0, irq | USR_INTE_BIT);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#endif /* __FreeBSD__ */
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/isa_isic.c b/sys/i4b/layer1/isa_isic.c
deleted file mode 100644
index 94e4bf7e4151..000000000000
--- a/sys/i4b/layer1/isa_isic.c
+++ /dev/null
@@ -1,828 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isa_isic.c - ISA bus frontend for i4b_isic driver
- * --------------------------------------------------
- *
- * $Id: isa_isic.c,v 1.18 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:53:16 1998]
- *
- * -mh original implementation
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/isa/isavar.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-
-#if defined(__OpenBSD__)
-#define __BROKEN_INDIRECT_CONFIG
-#endif
-
-/* local functions */
-#ifdef __BROKEN_INDIRECT_CONFIG
-static int isa_isic_probe __P((struct device *, void *, void *));
-#else
-static int isa_isic_probe __P((struct device *, struct cfdata *, void *));
-#endif
-
-static void isa_isic_attach __P((struct device *, struct device *, void *));
-static int setup_io_map __P((int flags, bus_space_tag_t iot,
- bus_space_tag_t memt, bus_size_t iobase, bus_size_t maddr,
- int *num_mappings, struct isic_io_map *maps, int *iosize,
- int *msize));
-static void args_unmap __P((int *num_mappings, struct isic_io_map *maps));
-
-struct cfattach isa_isic_ca = {
- sizeof(struct isic_softc), isa_isic_probe, isa_isic_attach
-};
-
-
-/*
- * Probe card
- */
-static int
-#ifdef __BROKEN_INDIRECT_CONFIG
-isa_isic_probe(parent, match, aux)
-#else
-isa_isic_probe(parent, cf, aux)
-#endif
- struct device *parent;
-#ifdef __BROKEN_INDIRECT_CONFIG
- void *match;
-#else
- struct cfdata *cf;
-#endif
- void *aux;
-{
-#ifdef __BROKEN_INDIRECT_CONFIG
- struct cfdata *cf = ((struct device*)match)->dv_cfdata;
-#endif
- struct isa_attach_args *ia = aux;
- bus_space_tag_t memt = ia->ia_memt, iot = ia->ia_iot;
- int flags = cf->cf_flags;
- struct isic_attach_args args;
- int ret = 0;
-
- /* check irq */
- if (ia->ia_irq == IRQUNK) {
- printf("isic%d: config error: no IRQ specified\n", cf->cf_unit);
- return 0;
- }
-
- /* setup MI attach args */
- bzero(&args, sizeof(args));
- args.ia_flags = flags;
-
- /* if card type specified setup io map for that card */
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- case FLAG_TELES_S0_16:
- case FLAG_TELES_S0_163:
- case FLAG_AVM_A1:
- case FLAG_USR_ISDN_TA_INT:
- case FLAG_ITK_IX1:
- if (setup_io_map(flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &ia->ia_msize)) {
- ret = 0;
- goto done;
- }
- break;
-
- default:
- /* no io map now, will figure card type later */
- break;
- }
-
- /* probe card */
- switch(flags)
- {
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_probe_Dyn(&args);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_probe_s08(&args);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_probe_s016(&args);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_probe_s0163(&args);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_probe_avma1(&args);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_probe_usrtai(&args);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_probe_itkix1(&args);
- break;
-#endif
-
- default:
- /* No card type given, try to figure ... */
- if (ia->ia_iobase == IOBASEUNK) {
- ret = 0;
-#ifdef TEL_S0_8
- /* only Teles S0/8 will work without IO */
- args.ia_flags = FLAG_TELES_S0_8;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s08(&args);
- }
-#endif /* TEL_S0_8 */
- } else if (ia->ia_maddr == MADDRUNK) {
- ret = 0;
-#ifdef TEL_S0_16_3
- /* no shared memory, only a 16.3 based card,
- AVM A1, the usr sportster or an ITK would work */
- args.ia_flags = FLAG_TELES_S0_163;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s0163(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16_3 */
-#ifdef AVM_A1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_AVM_A1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_avma1(&args);
- if (ret)
- break;
- }
-#endif /* AVM_A1 */
-#ifdef USR_STI
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_USR_ISDN_TA_INT;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_usrtai(&args);
- if (ret)
- break;
- }
-#endif /* USR_STI */
-
-#ifdef ITKIX1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_ITK_IX1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_itkix1(&args);
- if (ret)
- break;
- }
-#endif /* ITKIX1 */
-
- } else {
-#ifdef TEL_S0_16_3
- /* could be anything */
- args.ia_flags = FLAG_TELES_S0_163;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s0163(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16_3 */
-#ifdef TEL_S0_16
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_TELES_S0_16;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s016(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16 */
-#ifdef AVM_A1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_AVM_A1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_avma1(&args);
- if (ret)
- break;
- }
-#endif /* AVM_A1 */
-#ifdef TEL_S0_8
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_TELES_S0_8;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s08(&args);
- }
-#endif /* TEL_S0_8 */
- }
- break;
- }
-
-done:
- /* unmap resources */
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-
- return ret;
-}
-
-/*
- * Attach the card
- */
-static void
-isa_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct isic_softc *sc = (void *)self;
- struct isa_attach_args *ia = aux;
- int flags = sc->sc_dev.dv_cfdata->cf_flags;
- int ret = 0;
- struct isic_attach_args args;
-
- /* Setup parameters */
- sc->sc_unit = sc->sc_dev.dv_unit;
- sc->sc_irq = ia->ia_irq;
- sc->sc_maddr = ia->ia_maddr;
- sc->sc_num_mappings = 0;
- sc->sc_maps = NULL;
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- case FLAG_TELES_S0_16:
- case FLAG_TELES_S0_163:
- case FLAG_AVM_A1:
- case FLAG_USR_ISDN_TA_INT:
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), NULL, NULL, NULL);
- MALLOC_MAPS(sc);
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), &(sc->sc_maps[0]), NULL, NULL);
- break;
-
- default:
- /* No card type given, try to figure ... */
-
- /* setup MI attach args */
- bzero(&args, sizeof(args));
- args.ia_flags = flags;
-
- /* Probe cards */
- if (ia->ia_iobase == IOBASEUNK) {
- ret = 0;
-#ifdef TEL_S0_8
- /* only Teles S0/8 will work without IO */
- args.ia_flags = FLAG_TELES_S0_8;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s08(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_8 */
- } else if (ia->ia_maddr == MADDRUNK) {
- /* no shared memory, only a 16.3 based card,
- AVM A1, the usr sportster or an ITK would work */
- ret = 0;
-#ifdef TEL_S0_16_3
- args.ia_flags = FLAG_TELES_S0_163;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s0163(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16_3 */
-#ifdef AVM_A1
- args.ia_flags = FLAG_AVM_A1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_avma1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* AVM_A1 */
-#ifdef USR_STI
- args.ia_flags = FLAG_USR_ISDN_TA_INT;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_usrtai(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* USR_STI */
-#ifdef ITKIX1
- args.ia_flags = FLAG_ITK_IX1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_itkix1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* ITKIX1 */
- } else {
- /* could be anything */
- ret = 0;
-#ifdef TEL_S0_16_3
- args.ia_flags = FLAG_TELES_S0_163;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s0163(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16_3 */
-#ifdef TEL_S0_16
- args.ia_flags = FLAG_TELES_S0_16;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s016(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16 */
-#ifdef AVM_A1
- args.ia_flags = FLAG_AVM_A1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_avma1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* AVM_A1 */
-#ifdef TEL_S0_8
- args.ia_flags = FLAG_TELES_S0_8;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s08(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_8 */
- }
- break;
-
- found:
- flags = args.ia_flags;
- sc->sc_num_mappings = args.ia_num_mappings;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- if (ret) {
- MALLOC_MAPS(sc);
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), &(sc->sc_maps[0]), NULL, NULL);
- } else {
- printf(": could not determine card type - not configured!\n");
- return;
- }
- break;
- }
-
-#if defined(__OpenBSD__)
- isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
- IPL_NET, isicintr, sc, sc->sc_dev.dv_xname);
-
- /* MI initialization of card */
- isicattach(flags, sc);
-
-#else
-
- /* MI initialization of card */
- isicattach(flags, sc);
-
- /*
- * Try to get a level-triggered interrupt first. If that doesn't
- * work (like on NetBSD/Atari, try to establish an edge triggered
- * interrupt.
- */
- if (isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_LEVEL,
- IPL_NET, isicintr, sc) == NULL) {
- if(isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
- IPL_NET, isicintr, sc) == NULL) {
- args_unmap(&(sc->sc_num_mappings), &(sc->sc_maps[0]));
- free((sc)->sc_maps, M_DEVBUF);
- }
- else {
- /*
- * XXX: This is a hack that probably needs to be
- * solved by setting an interrupt type in the sc
- * structure. I don't feel familiar enough with the
- * code to do this currently. Feel free to contact
- * me about it (leo@netbsd.org).
- */
- isicintr(sc);
- }
- }
-#endif
-}
-
-/*
- * Setup card specific io mapping. Return 0 on success,
- * any other value on config error.
- * Be prepared to get NULL as maps array.
- * Make sure to keep *num_mappings in sync with the real
- * mappings already setup when returning!
- */
-static int
-setup_io_map(flags, iot, memt, iobase, maddr, num_mappings, maps, iosize, msize)
- int flags, *num_mappings, *iosize, *msize;
- bus_size_t iobase, maddr;
- bus_space_tag_t iot, memt;
- struct isic_io_map *maps;
-{
- /* nothing mapped yet */
- *num_mappings = 0;
-
- /* which resources do we need? */
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- if (maddr == MADDRUNK) {
- printf("isic: config error: no shared memory specified for Teles S0/8!\n");
- return 1;
- }
- if (iosize) *iosize = 0; /* no i/o ports */
- if (msize) *msize = 0x1000; /* shared memory size */
-
- /* this card uses a single memory mapping */
- if (maps == NULL) {
- *num_mappings = 1;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = memt;
- maps[0].offset = 0;
- maps[0].size = 0x1000;
- if (bus_space_map(maps[0].t, maddr,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_TELES_S0_16:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for Teles S0/16!\n");
- return 1;
- }
- if (maddr == MADDRUNK) {
- printf("isic: config error: no shared memory specified for Teles S0/16!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* i/o ports */
- if (msize) *msize = 0x1000; /* shared memory size */
-
- /* one io and one memory mapping */
- if (maps == NULL) {
- *num_mappings = 2;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot;
- maps[0].offset = 0;
- maps[0].size = 8;
- if (bus_space_map(maps[0].t, iobase,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[1].t = memt;
- maps[1].offset = 0;
- maps[1].size = 0x1000;
- if (bus_space_map(maps[1].t, maddr,
- maps[1].size, 0, &maps[1].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_TELES_S0_163:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for Teles S0/16!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* only some i/o ports shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* Four io mappings: config, isac, 2 * hscx */
- if (maps == NULL) {
- *num_mappings = 4;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot;
- maps[0].offset = 0;
- maps[0].size = 8;
- if (bus_space_map(maps[0].t, iobase,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[1].t = iot;
- maps[1].offset = 0;
- maps[1].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x980) < 0 || (iobase - 0xd80 + 0x980) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[1].t, iobase - 0xd80 + 0x980,
- maps[1].size, 0, &maps[1].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[2].t = iot;
- maps[2].offset = 0;
- maps[2].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x180) < 0 || (iobase - 0xd80 + 0x180) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[2].t, iobase - 0xd80 + 0x180,
- maps[2].size, 0, &maps[2].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[3].t = iot;
- maps[3].offset = 0;
- maps[3].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x580) < 0 || (iobase - 0xd80 + 0x580) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[3].t, iobase - 0xd80 + 0x580,
- maps[3].size, 0, &maps[3].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_AVM_A1:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for AVM A1/Fritz! card!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* only some i/o ports shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* Seven io mappings: config, isac, 2 * hscx,
- isac-fifo, 2 * hscx-fifo */
- if (maps == NULL) {
- *num_mappings = 7;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot; /* config */
- maps[0].offset = 0;
- maps[0].size = 8;
- if ((iobase + 0x1800) < 0 || (iobase + 0x1800) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[0].t, iobase + 0x1800, maps[0].size, 0, &maps[0].h))
- return 1;
- (*num_mappings)++;
- maps[1].t = iot; /* isac */
- maps[1].offset = 0;
- maps[1].size = 0x80; /* XXX - ??? */
- if ((iobase + 0x1400 - 0x20) < 0 || (iobase + 0x1400 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[1].t, iobase + 0x1400 - 0x20, maps[1].size, 0, &maps[1].h))
- return 1;
- (*num_mappings)++;
- maps[2].t = iot; /* hscx 0 */
- maps[2].offset = 0;
- maps[2].size = 0x40; /* XXX - ??? */
- if ((iobase + 0x400 - 0x20) < 0 || (iobase + 0x400 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[2].t, iobase + 0x400 - 0x20, maps[2].size, 0, &maps[2].h))
- return 1;
- (*num_mappings)++;
- maps[3].t = iot; /* hscx 1 */
- maps[3].offset = 0;
- maps[3].size = 0x40; /* XXX - ??? */
- if ((iobase + 0xc00 - 0x20) < 0 || (iobase + 0xc00 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[3].t, iobase + 0xc00 - 0x20, maps[3].size, 0, &maps[3].h))
- return 1;
- (*num_mappings)++;
- maps[4].t = iot; /* isac-fifo */
- maps[4].offset = 0;
- maps[4].size = 1;
- if ((iobase + 0x1400 - 0x20 -0x3e0) < 0 || (iobase + 0x1400 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[4].t, iobase + 0x1400 - 0x20 -0x3e0, maps[4].size, 0, &maps[4].h))
- return 1;
- (*num_mappings)++;
- maps[5].t = iot; /* hscx 0 fifo */
- maps[5].offset = 0;
- maps[5].size = 1;
- if ((iobase + 0x400 - 0x20 -0x3e0) < 0 || (iobase + 0x400 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[5].t, iobase + 0x400 - 0x20 -0x3e0, maps[5].size, 0, &maps[5].h))
- return 1;
- (*num_mappings)++;
- maps[6].t = iot; /* hscx 1 fifo */
- maps[6].offset = 0;
- maps[6].size = 1;
- if ((iobase + 0xc00 - 0x20 -0x3e0) < 0 || (iobase + 0xc00 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[6].t, iobase + 0xc00 - 0x20 -0x3e0, maps[6].size, 0, &maps[6].h))
- return 1;
- (*num_mappings)++;
- break;
-
- case FLAG_USR_ISDN_TA_INT:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no I/O base specified for USR Sportster TA intern!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* scattered ports, only some shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* 49 io mappings: 1 config and 48x8 registers */
- if (maps == NULL) {
- *num_mappings = 49;
- return 0;
- }
- *num_mappings = 0;
- {
- int i, num;
- bus_size_t base;
-
- /* config at offset 0x8000 */
- base = iobase + 0x8000;
- maps[0].size = 1;
- maps[0].t = iot;
- maps[0].offset = 0;
- if (base < 0 || base > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base, 1, 0, &maps[0].h)) {
- return 1;
- }
- *num_mappings = num = 1;
-
- /* HSCX A at offset 0 */
- base = iobase;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- /* HSCX B at offset 0x4000 */
- base = iobase + 0x4000;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- /* ISAC at offset 0xc000 */
- base = iobase + 0xc000;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- }
- break;
-
- case FLAG_ITK_IX1:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no I/O base specified for ITK ix1 micro!\n");
- return 1;
- }
- if (iosize) *iosize = 4;
- if (msize) *msize = 0;
- if (maps == NULL) {
- *num_mappings = 1;
- return 0;
- }
- *num_mappings = 0;
- maps[0].size = 4;
- maps[0].t = iot;
- maps[0].offset = 0;
- if (bus_space_map(iot, iobase, 4, 0, &maps[0].h)) {
- return 1;
- }
- *num_mappings = 1;
- break;
-
- default:
- printf("isic: config error: flags do not specify any known card!\n");
- return 1;
- break;
- }
-
- return 0;
-}
-
-static void
-args_unmap(num_mappings, maps)
- int *num_mappings;
- struct isic_io_map *maps;
-{
- int i, n;
- for (i = 0, n = *num_mappings; i < n; i++)
- if (maps[i].size)
- bus_space_unmap(maps[i].t, maps[i].h, maps[i].size);
- *num_mappings = 0;
-}
diff --git a/sys/i4b/layer1/isapnp_isic.c b/sys/i4b/layer1/isapnp_isic.c
deleted file mode 100644
index 9dfdf68c62b3..000000000000
--- a/sys/i4b/layer1/isapnp_isic.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isapnp_isic.c - ISA-P&P bus frontend for i4b_isic driver
- * --------------------------------------------------------
- *
- * $Id: isapnp_isic.c,v 1.9 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:54:23 1998]
- *
- * -mh original implementation
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/isa/isavar.h>
-#include <dev/isapnp/isapnpreg.h>
-#include <dev/isapnp/isapnpvar.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __BROKEN_INDIRECT_CONFIG
-static int isapnp_isic_probe __P((struct device *, void *, void *));
-#else
-static int isapnp_isic_probe __P((struct device *, struct cfdata *, void *));
-#endif
-static void isapnp_isic_attach __P((struct device *, struct device *, void *));
-
-struct cfattach isapnp_isic_ca = {
- sizeof(struct isic_softc), isapnp_isic_probe, isapnp_isic_attach
-};
-
-typedef void (*allocmaps_func)(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-typedef void (*attach_func)(struct isic_softc *sc);
-
-/* map allocators */
-static void generic_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-static void ngo_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-static void tls_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-
-/* card attach functions */
-extern void isic_attach_Cs0P __P((struct isic_softc *sc));
-extern void isic_attach_Dyn __P((struct isic_softc *sc));
-extern void isic_attach_s0163P __P((struct isic_softc *sc));
-extern void isic_attach_drnngo __P((struct isic_softc *sc));
-extern void isic_attach_sws __P((struct isic_softc *sc));
-extern void isic_attach_Eqs1pi __P((struct isic_softc *sc));
-
-struct isapnp_isic_card_desc {
- char *devlogic; /* ISAPNP logical device ID */
- char *name; /* Name of the card */
- int card_type; /* isic card type identifier */
- allocmaps_func allocmaps; /* map allocator function */
- attach_func attach; /* card attach and init function */
-};
-static const struct isapnp_isic_card_desc
-isapnp_isic_descriptions[] =
-{
-#ifdef CRTX_S0_P
- { "CTX0000", "Creatix ISDN S0-16 P&P", CARD_TYPEP_CS0P,
- tls_pnp_mapalloc, isic_attach_Cs0P },
-#endif
-#ifdef TEL_S0_16_3_P
- { "TAG2110", "Teles S0/PnP", CARD_TYPEP_163P,
- tls_pnp_mapalloc, isic_attach_s0163P },
-#endif
-#ifdef DRN_NGO
- { "SDA0150", "Dr. Neuhaus NICCY GO@", CARD_TYPEP_DRNNGO,
- ngo_pnp_mapalloc, isic_attach_drnngo },
-#endif
-#ifdef ELSA_QS1ISA
- { "ELS0133", "Elsa QuickStep 1000 (ISA)", CARD_TYPEP_ELSAQS1ISA,
- generic_pnp_mapalloc, isic_attach_Eqs1pi },
-#endif
-#ifdef SEDLBAUER
- { "SAG0001", "Sedlbauer WinSpeed", CARD_TYPEP_SWS,
- generic_pnp_mapalloc, isic_attach_sws },
-#endif
-#ifdef DYNALINK
- { "ASU1688", "Dynalink IS64PH", CARD_TYPEP_DYNALINK,
- generic_pnp_mapalloc, isic_attach_Dyn },
-#endif
-};
-#define NUM_DESCRIPTIONS (sizeof(isapnp_isic_descriptions)/sizeof(isapnp_isic_descriptions[0]))
-
-/*
- * Probe card
- */
-static int
-#ifdef __BROKEN_INDIRECT_CONFIG
-isapnp_isic_probe(parent, match, aux)
-#else
-isapnp_isic_probe(parent, cf, aux)
-#endif
- struct device *parent;
-#ifdef __BROKEN_INDIRECT_CONFIG
- void *match;
-#else
- struct cfdata *cf;
-#endif
- void *aux;
-{
- struct isapnp_attach_args *ipa = aux;
- const struct isapnp_isic_card_desc *desc = isapnp_isic_descriptions;
- int i;
-
- for (i = 0; i < NUM_DESCRIPTIONS; i++, desc++)
- if (strcmp(ipa->ipa_devlogic, desc->devlogic) == 0)
- return 1;
-
- return 0;
-}
-
-
-/*---------------------------------------------------------------------------*
- * card independend attach for ISA P&P cards
- *---------------------------------------------------------------------------*/
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-static void
-isapnp_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- struct isic_softc *sc = (void *)self;
- struct isapnp_attach_args *ipa = aux;
- const struct isapnp_isic_card_desc *desc = isapnp_isic_descriptions;
- int i;
-
- for (i = 0; i < NUM_DESCRIPTIONS; i++, desc++)
- if (strcmp(ipa->ipa_devlogic, desc->devlogic) == 0)
- break;
- if (i >= NUM_DESCRIPTIONS)
- panic("could not identify isic PnP device");
-
- /* setup parameters */
- sc->sc_cardtyp = desc->card_type;
- sc->sc_unit = sc->sc_dev.dv_unit;
- sc->sc_irq = ipa->ipa_irq[0].num;
- desc->allocmaps(ipa, sc);
-
- /* announce card name */
- printf(": %s\n", desc->name);
-
- /* establish interrupt handler */
- isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, IST_EDGE,
- IPL_NET, isicintr, sc);
-
- /* init card */
- isic_sc[sc->sc_unit] = sc;
- desc->attach(sc);
-
- /* announce chip versions */
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return;
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return;
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-}
-
-static void
-generic_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 1; /* most cards have just one mapping */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
-}
-
-static void
-ngo_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 2; /* one data, one address mapping */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
- sc->sc_maps[1].t = ipa->ipa_iot;
- sc->sc_maps[1].h = ipa->ipa_io[1].h;
- sc->sc_maps[1].size = 0;
-}
-
-static void
-tls_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 4; /* config, isac, 2 * hscx */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
- sc->sc_maps[1].t = ipa->ipa_iot;
- sc->sc_maps[1].h = ipa->ipa_io[0].h;
- sc->sc_maps[1].size = 0;
- sc->sc_maps[1].offset = - 0x20;
- sc->sc_maps[2].t = ipa->ipa_iot;
- sc->sc_maps[2].offset = - 0x20;
- sc->sc_maps[2].h = ipa->ipa_io[1].h;
- sc->sc_maps[2].size = 0;
- sc->sc_maps[3].t = ipa->ipa_iot;
- sc->sc_maps[3].offset = 0;
- sc->sc_maps[3].h = ipa->ipa_io[1].h;
- sc->sc_maps[3].size = 0;
-}
diff --git a/sys/i4b/layer1/isic_supio.c b/sys/i4b/layer1/isic_supio.c
deleted file mode 100644
index 6c58ad218425..000000000000
--- a/sys/i4b/layer1/isic_supio.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1998 Ignatios Souvatzis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * isic_supio.c - Amiga supio pseudo bus frontend for i4b_isic driver
- * supports:
- * - ISDN Blaster 5001/1
- * - ISDN Master 2092/64
- * But we attach to the supio, so just see "isic".
- * -----------------------------------------------
- *
- * $Id: isic_supio.c,v 1.5 1998/12/19 12:07:55 hm Exp $
- *
- * last edit-date: [Mon Nov 16 12:29:19 1998]
- *
- * -is original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <amiga/dev/supio.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_isac.h>
-
-/*static*/ int isic_supio_match __P((struct device *, struct cfdata *, void *));
-/*static*/ void isic_supio_attach __P((struct device *, struct device *, void *));
-
-/*static*/ u_int8_t aster_read_reg __P((struct isic_softc *sc, int what,
- bus_size_t offs));
-/*static*/ void aster_write_reg __P((struct isic_softc *sc, int what,
- bus_size_t offs, u_int8_t data));
-/*static*/ void aster_read_fifo __P((struct isic_softc *sc, int what,
- void *buf, size_t size));
-/*static*/ void aster_write_fifo __P((struct isic_softc *sc, int what,
- const void *data, size_t size));
-
-static int supio_isicattach __P((struct isic_softc *sc));
-
-struct isic_supio_softc {
- struct isic_softc sc_isic;
- struct isr sc_isr;
- struct bus_space_tag sc_bst;
-};
-
-struct cfattach isic_supio_ca = {
- sizeof(struct isic_supio_softc), isic_supio_match, isic_supio_attach
-};
-
-/*
- * Probe card
- */
-/*static*/ int
-isic_supio_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct supio_attach_args *sap = aux;
-
- /* ARGSUSED */
- return (!strcmp("isic", sap->supio_name));
-}
-
-int isic_supio_ipl = 2;
-/*
- * Attach the card
- */
-/*static*/ void
-isic_supio_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct isic_supio_softc *ssc = (void *)self;
- struct isic_softc *sc = &ssc->sc_isic;
- struct supio_attach_args *sap = aux;
-
- bus_space_tag_t bst;
- bus_space_handle_t h;
-
- /* setup parameters */
- sc->sc_cardtyp = CARD_TYPEP_BLMASTER;
- sc->sc_num_mappings = 3;
- sc->sc_unit = sc->sc_dev.dv_unit; /* XXX ??? */
-
- /* create io mappings */
- MALLOC_MAPS(sc);
-
- bst = sap->supio_iot;
- bus_space_map(bst, sap->supio_iobase, 0x400, 0, &h);
-
- /* ISAC */
- sc->sc_maps[0].t = bst;
- sc->sc_maps[0].h = h;
- sc->sc_maps[0].offset = 0x300/2;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
-
- /* HSCX A */
- sc->sc_maps[1].t = bst;
- sc->sc_maps[1].h = h;
- sc->sc_maps[1].offset = 0x100/2;
- sc->sc_maps[1].size = 0; /* foreign mapping, leave it alone */
-
- /* HSCX B */
- sc->sc_maps[2].t = bst;
- sc->sc_maps[2].h = h;
- sc->sc_maps[2].offset = 0x180/2;
- sc->sc_maps[2].size = 0; /* foreign mapping, leave it alone */
-
- sc->clearirq = NULL;
- sc->readreg = aster_read_reg;
- sc->writereg = aster_write_reg;
- sc->readfifo = aster_read_fifo;
- sc->writefifo = aster_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_BLMASTER;
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* enable RTS on HSCX A */
- aster_write_reg(sc, ISIC_WHAT_HSCXA, H_MODE, HSCX_MODE_RTS);
-
- /* MI initialization of card */
-
- printf("\n");
- supio_isicattach(sc);
-
- ssc->sc_isr.isr_intr = isicintr;
- ssc->sc_isr.isr_arg = sc;
- ssc->sc_isr.isr_ipl = isic_supio_ipl; /* XXX */
- add_isr(&ssc->sc_isr);
-}
-
-#if 0
-int
-isic_supiointr(p)
- void *p;
-{
- /* XXX should test whether it is our interupt at all */
- add_sicallback((sifunc_t)isicintr, p, NULL);
- return 1;
-}
-#endif
-
-/*static*/ void
-aster_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_read_multi_1(t, h, o, buf, size);
-}
-
-/*static*/ void
-aster_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_write_multi_1(t, h, o, (u_int8_t*)buf, size);
-}
-
-/*static*/ u_int8_t
-aster_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- return bus_space_read_1(t, h, o + offs);
-}
-
-/*static*/ void
-aster_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_write_1(t, h, o + offs, data);
-}
-
-/*---------------------------------------------------------------------------*
- * card independend attach for pcmcia^Wsupio cards
- * XXX this should be centralized!
- *---------------------------------------------------------------------------*/
-
-/*
- * parameter and format for message producing e.g. "isic0: "
- * there is no FreeBSD/Amiga, so just:
- */
-
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-
-int
-supio_isicattach(struct isic_softc *sc)
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc;
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pci_isic.c b/sys/i4b/layer1/pci_isic.c
deleted file mode 100644
index 6f929e52cca6..000000000000
--- a/sys/i4b/layer1/pci_isic.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * pci_isic.c - pcmcia bus frontend for i4b_isic driver
- * -------------------------------------------------------
- *
- * $Id: pci_isic.c,v 1.1 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Nov 16 20:37:32 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcidevs.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-
-static int pci_isic_match __P((struct device *, struct cfdata *, void *));
-static void pci_isic_attach __P((struct device *, struct device *, void *));
-static const struct isic_pci_product * find_matching_card __P((struct pci_attach_args *pa));
-
-extern void isic_attach_Eqs1pp __P((struct isic_softc *sc, struct pci_attach_args *pa));
-static int isic_pciattach __P((struct isic_softc *sc));
-
-struct pci_isic_softc {
- struct isic_softc sc_isic; /* parent class */
-
- /* PCI-specific goo */
- void *sc_ih; /* interrupt handler */
-};
-
-struct cfattach pci_isic_ca = {
- sizeof(struct pci_isic_softc), pci_isic_match, pci_isic_attach
-};
-
-
-static const struct isic_pci_product {
- pci_vendor_id_t npp_vendor;
- pci_product_id_t npp_product;
- int cardtype;
- int flag;
- const char * name;
- void (*attach)(struct isic_softc *sc, struct pci_attach_args *pa);
-} isic_pci_products[] = {
- { PCI_VENDOR_ELSA, 0x1000,
- CARD_TYPEP_ELSAQS1PCI, FLAG_ELSA_QS1P_PCI,
- "ELSA QuickStep 1000pro/PCI",
- isic_attach_Eqs1pp },
-
- { 0, 0, 0, 0, NULL, NULL },
-};
-
-static const struct isic_pci_product * find_matching_card(pa)
- struct pci_attach_args *pa;
-{
- const struct isic_pci_product * pp = NULL;
-
- for (pp = isic_pci_products; pp->npp_vendor; pp++)
- if (PCI_VENDOR(pa->pa_id) == pp->npp_vendor &&
- PCI_PRODUCT(pa->pa_id) == pp->npp_product)
- return pp;
-
- return NULL;
-}
-
-/*
- * Match card
- */
-static int
-pci_isic_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct pci_attach_args *pa = aux;
-
- if (!find_matching_card(pa))
- return 0;
-
- return 1;
-}
-
-/*
- * Attach the card
- */
-static void
-pci_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct pci_isic_softc *psc = (void*) self;
- struct isic_softc *sc = &psc->sc_isic;
- struct pci_attach_args *pa = aux;
- pci_chipset_tag_t pc = pa->pa_pc;
- pci_intr_handle_t ih;
- const struct isic_pci_product * prod;
- const char *intrstr;
-
- /* Redo probe */
- prod = find_matching_card(pa);
- if (prod == NULL) return; /* oops - not found?!? */
-
- sc->sc_unit = sc->sc_dev.dv_unit;
- printf(": %s\n", prod->name);
-
- /* card initilization and sc setup */
- prod->attach(sc, pa);
-
- /* generic setup */
- isic_pciattach(sc);
-
- /* Map and establish the interrupt. */
- if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
- pa->pa_intrline, &ih)) {
- printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
- return;
- }
- intrstr = pci_intr_string(pc, ih);
- psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc);
- if (psc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt",
- sc->sc_dev.dv_xname);
- if (intrstr != NULL)
- printf(" at %s", intrstr);
- printf("\n");
- return;
- }
- printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pci device driver attach routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pciattach(sc)
- struct isic_softc *sc;
-{
- int ret = 0;
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc; /* XXX - hack! */
-
- sc->sc_isac_version = 0;
- sc->sc_hscx_version = 0;
-
- if(sc->sc_ipac)
- {
- ret = IPAC_READ(IPAC_ID);
-
- switch(ret)
- {
- case 0x01:
- printf("%s: IPAC PSB2115 Version 1.1\n", sc->sc_dev.dv_xname);
- break;
-
- default:
- printf("%s: Error, IPAC version %d unknown!\n",
- sc->sc_dev.dv_xname, ret);
- return(0);
- break;
- }
- }
- else
- {
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- printf("%s: ISAC %s (IOM-%c)\n",
- sc->sc_dev.dv_xname,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- break;
-
- default:
- printf("%s: Error, ISAC version %d unknown!\n",
- sc->sc_dev.dv_xname, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- printf("%s: HSCX %s\n",
- sc->sc_dev.dv_xname,
- HSCXversion[sc->sc_hscx_version]);
- break;
-
- default:
- printf("%s: Error, HSCX version %d unknown!\n",
- sc->sc_dev.dv_xname, sc->sc_hscx_version);
- return(0);
- break;
- }
- }
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pcmcia_isic.c b/sys/i4b/layer1/pcmcia_isic.c
deleted file mode 100644
index 9d428a1b3cef..000000000000
--- a/sys/i4b/layer1/pcmcia_isic.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcmcia_isic.c - pcmcia bus frontend for i4b_isic driver
- * -------------------------------------------------------
- *
- * $Id: pcmcia_isic.c,v 1.3 1998/12/05 18:05:04 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:38:43 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#include <dev/pcmcia/pcmciadevs.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-static int pcmcia_isic_match __P((struct device *, struct cfdata *, void *));
-static void pcmcia_isic_attach __P((struct device *, struct device *, void *));
-static const struct isic_pcmcia_card_entry * find_matching_card __P((struct pcmcia_attach_args *pa));
-static int pcmcia_isicattach __P((struct isic_softc *sc));
-
-struct cfattach pcmcia_isic_ca = {
- sizeof(struct pcmcia_isic_softc), pcmcia_isic_match, pcmcia_isic_attach
-};
-
-struct isic_pcmcia_card_entry {
- int32_t vendor; /* vendor ID */
- int32_t product; /* product ID */
- char *cis1_info[4]; /* CIS info to match */
- char *name; /* name of controller */
- int function; /* expected PCMCIA function type */
- int card_type; /* card type found */
- isic_pcmcia_attach_func attach; /* card initialization */
-};
-
-static const struct isic_pcmcia_card_entry card_list[] = {
-
-#ifdef AVM_PCMCIA
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "AVM", "ISDN A", NULL, NULL },
- "AVM Fritz!Card", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_PCFRITZ, isic_attach_fritzpcmcia },
-#endif
-
-#ifdef ELSA_ISDNMC
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "ELSA GmbH, Aachen", "MicroLink ISDN/MC ", NULL, NULL },
- "ELSA MicroLink ISDN/MC", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLIMC, isic_attach_elsaisdnmc },
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "ELSA AG, Aachen", "MicroLink ISDN/MC ", NULL, NULL },
- "ELSA MicroLink ISDN/MC", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLIMC, isic_attach_elsaisdnmc },
-#endif
-
-#ifdef ELSA_MCALL
- { 0x105, 0x410a,
- { "ELSA", "MicroLink MC all", NULL, NULL },
- "ELSA MicroLink MCall", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLMCALL, isic_attach_elsamcall },
-#endif
-
-};
-#define NUM_MATCH_ENTRIES (sizeof(card_list)/sizeof(card_list[0]))
-
-static const struct isic_pcmcia_card_entry *
-find_matching_card(pa)
- struct pcmcia_attach_args *pa;
-{
- int i, j;
-
- for (i = 0; i < NUM_MATCH_ENTRIES; i++) {
- if (card_list[i].vendor != PCMCIA_VENDOR_INVALID && pa->card->manufacturer != card_list[i].vendor)
- continue;
- if (card_list[i].product != PCMCIA_PRODUCT_INVALID && pa->card->product != card_list[i].product)
- continue;
- if (pa->pf->function != card_list[i].function)
- continue;
- for (j = 0; j < 4; j++) {
- if (card_list[i].cis1_info[j] == NULL)
- continue; /* wildcard */
- if (pa->card->cis1_info[j] == NULL)
- break; /* not available */
- if (strcmp(pa->card->cis1_info[j], card_list[i].cis1_info[j]) != 0)
- break; /* mismatch */
- }
- if (j >= 4)
- break;
- }
- if (i >= NUM_MATCH_ENTRIES)
- return NULL;
-
- return &card_list[i];
-}
-
-/*
- * Match card
- */
-static int
-pcmcia_isic_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct pcmcia_attach_args *pa = aux;
-
- if (!find_matching_card(pa))
- return 0;
-
- return 1;
-}
-
-/*
- * Attach the card
- */
-static void
-pcmcia_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct pcmcia_isic_softc *psc = (void*) self;
- struct isic_softc *sc = &psc->sc_isic;
- struct pcmcia_attach_args *pa = aux;
- struct pcmcia_config_entry *cfe;
- const struct isic_pcmcia_card_entry * cde;
-
- /* Which card is it? */
- cde = find_matching_card(pa);
- if (cde == NULL) return; /* oops - not found?!? */
-
- psc->sc_pf = pa->pf;
- cfe = pa->pf->cfe_head.sqh_first;
-
- /* Enable the card */
- pcmcia_function_init(pa->pf, cfe);
- pcmcia_function_enable(pa->pf);
-
- if (!cde->attach(psc, cfe, pa))
- return; /* Ooops ? */
-
- sc->sc_unit = sc->sc_dev.dv_unit;
-
- /* Announce card name */
- printf(": %s\n", cde->name);
-
- /* MI initilization */
- pcmcia_isicattach(sc);
-
- /* setup interrupt */
- psc->sc_ih = pcmcia_intr_establish(pa->pf, IPL_NET, isicintr, sc);
-}
-
-/*---------------------------------------------------------------------------*
- * card independend attach for pcmicia cards
- *---------------------------------------------------------------------------*/
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-int
-pcmcia_isicattach(struct isic_softc *sc)
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc;
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pcmcia_isic.h b/sys/i4b/layer1/pcmcia_isic.h
deleted file mode 100644
index 73f52d693020..000000000000
--- a/sys/i4b/layer1/pcmcia_isic.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcmcia_isic.h - common definitions for pcmcia isic cards
- * --------------------------------------------------------
- *
- * $Id: pcmcia_isic.h,v 1.1 1998/12/02 06:44:30 hm Exp $
- *
- * last edit-date: [Mon Nov 30 21:19:14 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-struct pcmcia_isic_softc {
- struct isic_softc sc_isic; /* parent class */
-
- /* PCMCIA-specific goo */
- struct pcmcia_io_handle sc_pcioh; /* PCMCIA i/o space info */
- int sc_io_window; /* our i/o window */
- struct pcmcia_function *sc_pf; /* our PCMCIA function */
- void *sc_ih; /* interrupt handler */
-};
-
-typedef int (*isic_pcmcia_attach_func)(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-
-extern int isic_attach_fritzpcmcia(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-extern int isic_attach_elsaisdnmc(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-extern int isic_attach_elsamcall(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-
-
diff --git a/sys/i4b/layer2/i4b_iframe.c b/sys/i4b/layer2/i4b_iframe.c
deleted file mode 100644
index c5e38d80f8ec..000000000000
--- a/sys/i4b/layer2/i4b_iframe.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_iframe.c - i frame handling routines
- * ------------------------------------------
- *
- * $Id: i4b_iframe.c,v 1.15 1998/12/05 18:05:06 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:26:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process i frame
- * implements the routine "I COMMAND" Q.921 03/93 pp 77
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_i_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
- int nr;
- int ns;
- int p;
- int x;
-
- if(!((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI)))))
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- if((l2sc->Q921_state != ST_MULTIFR) && (l2sc->Q921_state != ST_TIMREC))
- {
- i4b_Dfreembuf(m);
- DBGL2(L2_I_ERR, "i4b_rxd_i_frame", ("ERROR, state != (MF || TR)!\n"));
- return;
- }
-
- x = SPLI4B();
-
- nr = GETINR(*(ptr + OFF_INR));
- ns = GETINS(*(ptr + OFF_INS));
- p = GETIP(*(ptr + OFF_INR));
-
- i4b_rxd_ack(l2sc, nr); /* last packet ack */
-
- if(l2sc->own_busy) /* own receiver busy ? */
- {
- i4b_Dfreembuf(m); /* yes, discard information */
-
- if(p == 1) /* P bit == 1 ? */
- {
- i4b_tx_rnr_response(l2sc, p); /* yes, tx RNR */
- l2sc->ack_pend = 0; /* clear ACK pending */
- }
- }
- else /* own receiver ready */
- {
- if(ns == l2sc->vr) /* expected sequence number ? */
- {
- M128INC(l2sc->vr); /* yes, update */
-
- l2sc->rej_excpt = 0; /* clr reject exception */
-
- m_adj(m, I_HDR_LEN); /* strip i frame header */
-
- l2sc->iframe_sent = 0; /* reset i acked already */
-
- DL_Data_Ind(l2sc->unit, m); /* pass data up */
-
- if(!l2sc->iframe_sent)
- {
- i4b_tx_rr_response(l2sc, p); /* yes, tx RR */
- l2sc->ack_pend = 0; /* clr ACK pending */
- }
- }
- else /* ERROR, sequence number NOT expected */
- {
- i4b_Dfreembuf(m); /* discard information */
-
- if(l2sc->rej_excpt == 1) /* already exception ? */
- {
- if(p == 1) /* immediate response ? */
- {
- i4b_tx_rr_response(l2sc, p); /* yes, tx RR */
- l2sc->ack_pend = 0; /* clr ack pend */
- }
- }
- else /* not in exception cond */
- {
- l2sc->rej_excpt = 1; /* set exception */
- i4b_tx_rej_response(l2sc, p); /* tx REJ */
- l2sc->ack_pend = 0; /* clr ack pending */
- }
- }
- }
-
- /* sequence number ranges as expected ? */
-
- if(i4b_l2_nr_ok(nr, l2sc->va, l2sc->vs))
- {
- if(l2sc->Q921_state == ST_TIMREC)
- {
- l2sc->va = nr;
- splx(x);
- return;
- }
-
- if(l2sc->peer_busy) /* yes, other side busy ? */
- {
- l2sc->va = nr; /* yes, update ack count */
- }
- else /* other side ready */
- {
- if(nr == l2sc->vs) /* count expected ? */
- {
- l2sc->va = nr; /* update ack */
- i4b_T200_stop(l2sc);
- i4b_T203_restart(l2sc);
- }
- else
- {
- if(nr != l2sc->va)
- {
- l2sc->va = nr;
- i4b_T200_restart(l2sc);
- }
- }
- }
- }
- else
- {
- i4b_nr_error_recovery(l2sc); /* sequence error */
- l2sc->Q921_state = ST_AW_EST;
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * internal I FRAME QUEUED UP routine (Q.921 03/93 p 61)
- *---------------------------------------------------------------------------*/
-void
-i4b_i_frame_queued_up(l2_softc_t *l2sc)
-{
- int x;
- struct mbuf *m;
- u_char *ptr;
-
- x = SPLI4B();
-
- if(l2sc->peer_busy)
- {
- DBGL2(L2_I_MSG, "i4b_i_frame_queued_up", ("peer busy!\n"));
- i4b_print_l2var(l2sc);
- splx(x);
- return;
- }
-
- if(l2sc->vs == ((l2sc->va + MAX_K_VALUE) & 127))
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("V(S) == ((V(A) + k) & 127)!\n"));
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("state = %s\n", i4b_print_l2state(l2sc)));
- i4b_print_l2var(l2sc);
- splx(x);
- return;
- }
-
- IF_DEQUEUE(&l2sc->i_queue, m); /* fetch next frame to tx */
-
- if(!m)
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, mbuf NULL after IF_DEQUEUE\n"));
- splx(x);
- return;
- }
-
- ptr = m->m_data;
-
- PUTSAPI(SAPI_CCP, CR_CMD_TO_NT, *(ptr + OFF_SAPI));
- PUTTEI(l2sc->tei, *(ptr + OFF_TEI));
-
- *(ptr + OFF_INS) = (l2sc->vs << 1) & 0xfe; /* bit 0 = 0 */
- *(ptr + OFF_INR) = (l2sc->vr << 1) & 0xfe; /* P bit = 0 */
-
- PH_Data_Req(l2sc->unit, m, MBUF_DONTFREE); /* free'd when ack'd ! */
-
- l2sc->iframe_sent = 1; /* in case we ack an I frame with another I frame */
-
- if(l2sc->ua_num != UA_EMPTY) /* failsafe */
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, l2sc->ua_num: %d != UA_EMPTY\n", l2sc->ua_num));
- i4b_print_l2var(l2sc);
- i4b_Dfreembuf(l2sc->ua_frame);
- }
-
- l2sc->ua_frame = m; /* save unacked frame */
- l2sc->ua_num = l2sc->vs; /* save frame number */
-
- M128INC(l2sc->vs);
-
- l2sc->ack_pend = 0;
-
- splx(x);
-
- if(l2sc->T200 == TIMER_IDLE)
- {
- i4b_T203_stop(l2sc);
- i4b_T200_start(l2sc);
- }
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_l2.c b/sys/i4b/layer2/i4b_l2.c
deleted file mode 100644
index 5cdc1c7cc582..000000000000
--- a/sys/i4b/layer2/i4b_l2.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2.c - ISDN layer 2 (Q.921)
- * -------------------------------
- *
- * $Id: i4b_l2.c,v 1.23 1998/12/05 18:05:08 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:27:00 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-int i4b_dl_establish_ind(int);
-int i4b_dl_establish_cnf(int);
-int i4b_dl_release_ind(int);
-int i4b_dl_release_cnf(int);
-int i4b_dl_data_ind(int, struct mbuf *);
-int i4b_dl_unit_data_ind(int, struct mbuf *);
-
-static int i4b_mdl_command_req(int, int, int);
-
-/* from layer 2 */
-
-extern int i4b_mdl_attach_ind(int, int);
-extern int i4b_mdl_status_ind(int, int, int);
-
-/* this layers debug level */
-
-unsigned int i4b_l2_debug = L2_DEBUG_DEFAULT;
-
-struct i4b_l2l3_func i4b_l2l3_func = {
-
- /* Layer 2 --> Layer 3 */
-
- (int (*)(int)) i4b_dl_establish_ind,
- (int (*)(int)) i4b_dl_establish_cnf,
- (int (*)(int)) i4b_dl_release_ind,
- (int (*)(int)) i4b_dl_release_cnf,
- (int (*)(int, struct mbuf *)) i4b_dl_data_ind,
- (int (*)(int, struct mbuf *)) i4b_dl_unit_data_ind,
-
- /* Layer 3 --> Layer 2 */
-
- (int (*)(int)) i4b_dl_establish_req,
- (int (*)(int)) i4b_dl_release_req,
- (int (*)(int, struct mbuf *)) i4b_dl_data_req,
- (int (*)(int, struct mbuf *)) i4b_dl_unit_data_req,
-
- /* Layer 2 --> Layer 3 management */
-
- (int (*)(int, int, int)) i4b_mdl_status_ind,
-
- /* Layer 3 --> Layer 2 management */
-
- (int (*)(int, int, int)) i4b_mdl_command_req
-};
-
-/*---------------------------------------------------------------------------*
- * DL_ESTABLISH_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_establish_req(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-REQ", ("unit %d\n",unit));
- i4b_l1_activate(l2sc);
- i4b_next_l2state(l2sc, EV_DLESTRQ);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL_RELEASE_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_release_req(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL2(L2_PRIM, "DL-RELEASE-REQ", ("unit %d\n",unit));
- i4b_next_l2state(l2sc, EV_DLRELRQ);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL UNIT DATA REQUEST from Layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_unit_data_req(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-REQ", ("unit %d\n",unit));
-#endif
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL DATA REQUEST from Layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_data_req(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- int x;
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-REQ", ("unit %d\n",unit));
-#endif
- switch(l2sc->Q921_state)
- {
- case ST_AW_EST:
- case ST_MULTIFR:
- case ST_TIMREC:
-
- if(IF_QFULL(&l2sc->i_queue))
- {
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("i_queue full!!\n"));
- i4b_Dfreembuf(m);
- }
- else
- {
- x = splimp();
- IF_ENQUEUE(&l2sc->i_queue, m);
- splx(x);
- i4b_i_frame_queued_up(l2sc);
- }
- break;
-
- default:
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("unit %d ERROR in state [%s], freeing mbuf\n", unit, i4b_print_l2state(l2sc)));
- i4b_Dfreembuf(m);
- break;
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_activate_ind - link activation indication from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_activate_ind(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL1(L1_PRIM, "PH-ACTIVATE-IND", ("unit %d\n",unit));
- l2sc->ph_active = PH_ACTIVE;
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_deactivate_ind - link deactivation indication from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_deactivate_ind(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL1(L1_PRIM, "PH-DEACTIVATE-IND", ("unit %d\n",unit));
- l2sc->ph_active = PH_INACTIVE;
- return(0);
-}
-
-
-/*---------------------------------------------------------------------------*
- * i4b_l2_unit_init - place layer 2 unit into known state
- *---------------------------------------------------------------------------*/
-static void
-i4b_l2_unit_init(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- l2sc->Q921_state = ST_TEI_UNAS;
- l2sc->tei_valid = TEI_INVALID;
- l2sc->vr = 0;
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->ack_pend = 0;
- l2sc->rej_excpt = 0;
- l2sc->peer_busy = 0;
- l2sc->own_busy = 0;
- l2sc->l3initiated = 0;
-
- l2sc->rxd_CR = 0;
- l2sc->rxd_PF = 0;
- l2sc->rxd_NR = 0;
- l2sc->RC = 0;
- l2sc->iframe_sent = 0;
-
- l2sc->postfsmfunc = NULL;
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- l2sc->ua_frame = NULL;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T202_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_mph_status_ind - status indication upward
- *---------------------------------------------------------------------------*/
-int
-i4b_mph_status_ind(int unit, int status, int parm)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- int sendup = 1;
-
- int x = SPLI4B();
-
- DBGL1(L1_PRIM, "MPH-STATUS-IND", ("unit %d, status=%d, parm=%d\n", unit, status, parm));
-
- switch(status)
- {
- case STI_ATTACH:
- l2sc->unit = unit;
- l2sc->i_queue.ifq_maxlen = IQUEUE_MAXLEN;
- l2sc->ua_frame = NULL;
- i4b_l2_unit_init(unit);
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- /* initialize the callout handles for timeout routines */
- callout_handle_init(&l2sc->T200_callout);
- callout_handle_init(&l2sc->T202_callout);
- callout_handle_init(&l2sc->T203_callout);
-#endif
- break;
-
- case STI_L1STAT: /* state of layer 1 */
- break;
-
- case STI_PDEACT: /* Timer 4 expired */
- if((l2sc->Q921_state >= ST_AW_EST) &&
- (l2sc->Q921_state <= ST_TIMREC))
- {
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, persistent deactivation!\n", unit));
- i4b_l2_unit_init(unit);
- }
- else
- {
- sendup = 0;
- }
- break;
-
- case STI_NOL1ACC:
- i4b_l2_unit_init(unit);
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, cannot access S0 bus!\n", unit));
- break;
-
- default:
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("ERROR, unit %d, unknown status message!\n", unit));
- break;
- }
-
- if(sendup)
- MDL_Status_Ind(unit, status, parm); /* send up to layer 3 */
-
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * MDL_COMMAND_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_mdl_command_req(int unit, int command, int parm)
-{
- DBGL2(L2_PRIM, "MDL-COMMAND-REQ", ("unit %d, command=%d, parm=%d\n", unit, command, parm));
-
- switch(command)
- {
- case CMR_DOPEN:
- i4b_l2_unit_init(unit);
- break;
- }
-
- MPH_Command_Req(unit, command, parm);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_data_ind - process a rx'd frame got from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL1(L1_PRIM, "PH-DATA-IND", ("unit %d\n", unit));
-#endif
- u_char *ptr = m->m_data;
-
- if ( (*(ptr + OFF_CNTL) & 0x01) == 0 )
- {
- if(m->m_len < 4) /* 6 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, I-frame < 6 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_i_frame(unit, m);
- }
- else if ( (*(ptr + OFF_CNTL) & 0x03) == 0x01 )
- {
- if(m->m_len < 4) /* 6 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, S-frame < 6 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_s_frame(unit, m);
- }
- else if ( (*(ptr + OFF_CNTL) & 0x03) == 0x03 )
- {
- if(m->m_len < 3) /* 5 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, U-frame < 5 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_u_frame(unit, m);
- }
- else
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, bad frame rx'd - "));
- i4b_print_frame(m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- }
- return(0);
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer2/i4b_l2.h b/sys/i4b/layer2/i4b_l2.h
deleted file mode 100644
index ab1dfd7cd549..000000000000
--- a/sys/i4b/layer2/i4b_l2.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2.h - ISDN layer 2 (Q.921) definitions
- * ---------------------------------------------
- *
- * $Id: i4b_l2.h,v 1.14 1998/12/05 18:05:09 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:27:13 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2_H_
-#define _I4B_L2_H_
-
-typedef struct {
- int unit; /* unit number this entry is for */
-
- int Q921_state; /* state according to Q.921 */
-
- u_char last_ril; /* last reference number from TEI management */
- u_char last_rih;
-
- int tei_valid; /* tei is valid flag */
-#define TEI_INVALID 0
-#define TEI_VALID 1
- int tei; /* tei, if tei flag valid */
-
- int ph_active; /* Layer 1 active flag */
-#define PH_INACTIVE 0 /* layer 1 inactive */
-#define PH_ACTIVEPEND 1 /* already tried to activate */
-#define PH_ACTIVE 2 /* layer 1 active */
-
- int T200; /* Multiframe timeout timer */
- int T201; /* min time between TEI ID check */
- int T202; /* min time between TEI ID Req messages */
- int N202; /* TEI ID Req tx counter */
- void(*T202func)(void *);/* function to be called when T202 expires */
- int T203; /* max line idle time */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle T200_callout;
- struct callout_handle T202_callout;
- struct callout_handle T203_callout;
-#endif
-
- int vr; /* receive sequence frame counter */
- int vs; /* transmit sequence frame counter */
- int va; /* acknowledge sequence frame counter */
-
- int ack_pend; /* acknowledge pending */
- int rej_excpt; /* reject exception */
- int peer_busy; /* peer receiver busy */
- int own_busy; /* own receiver busy */
- int l3initiated; /* layer 3 initiated */
-
- struct ifqueue i_queue; /* queue of outgoing i frames */
-#define IQUEUE_MAXLEN 20
-
- /* this implementation only supports a k-value of 1 !!! */
- struct mbuf *ua_frame; /* last unacked frame */
- int ua_num; /* last unacked frame number */
-#define UA_EMPTY (-1) /* ua_frame is unused */
-
- int rxd_CR; /* received Command Response bit */
- int rxd_PF; /* received Poll/Final bit */
- int rxd_NR; /* received N(R) field */
- int RC; /* Retry Counter */
-
- int iframe_sent; /* check if i frame acked by another i frame */
-
- int (*postfsmfunc)(int);/* function to be called at fsm exit */
- int postfsmarg; /* argument for above function */
-} l2_softc_t;
-
-extern l2_softc_t l2_softc[];
-
-/* Q.912 system parameters (Q.921 03/93 pp 43) */
-
-#define MAX_K_VALUE 1 /* BRI - # of outstanding frames */
-
-#define N200 3 /* max no of retransmissions */
-#define N201DEF 260 /* max no of octetts in information field */
-#define N202DEF 3 /* max no of TEI ID Request message transmissions */
-
-#define T200DEF (hz*1) /* default T200 timer value = 1 second */
-#define T201DEF T200DEF /* default T201 timer value = T200DEF */
-#define T202DEF (hz*2) /* default T202 timer value = 2 seconds */
-#define T203DEF (hz*10) /* default T203 timer value = 10 seconds*/
-
-/* modulo 128 operations */
-
-#define M128INC(v) (v)++; \
- if((v)>127) \
- { \
- v = 0; \
- }
-
-#define M128DEC(v) (v)--; \
- if((v)<0) \
- { \
- v = 127;\
- }
-
-/* P-bit values */
-
-typedef enum {
- P0,
- P1
-} pbit_t;
-
-/* F-bit values */
-
-typedef enum {
- F0,
- F1
-} fbit_t;
-
-/* CR-bit values to NT */
-
-typedef enum {
- CR_CMD_TO_NT,
- CR_RSP_TO_NT
-} crbit_to_nt_t;
-
-/* CR-bit values from NT */
-
-typedef enum {
- CR_RSP_FROM_NT,
- CR_CMD_FROM_NT
-} crbit_from_nt_t;
-
-/* address field - octett 2 */
-
-#define OFF_SAPI 0 /* SAPI offset, HDLC flag is eaten by L1 */
-#define SAPI_CCP 0 /* SAPI = 0 - call control procedures */
-#define SAPI_X25 16 /* SAPI = 16 - X.25 packet procedures */
-#define SAPI_L2M 63 /* SAPI = 63 - Layer 2 management procedures */
-
-/* extract and insert macros for SAPI octett */
-
-#define GETSAPI(octett) (((octett) >> 2) & 0x3f)
-#define PUTSAPI(sapi,cr,octett) ((octett) = (((sapi << 2) & 0xfc) | ((cr & 0x01) << 1)))
-#define GETCR(octett) (((octett) >> 1) & 0x01)
-#define GETEA(octett) ((octett) & 0x01)
-
-/* address field - octett 3 */
-
-#define OFF_TEI 1 /* TEI offset */
-#define GETTEI(octett) (((octett) >> 1) & 0x7f)
-#define PUTTEI(tei, octett) ((octett) = ((((tei) << 1) & 0xfe)) | 0x01)
-#define GROUP_TEI 127 /* broadcast TEI for LME */
-
-/* control field - octett 4 */
-
-#define OFF_CNTL 2 /* 1st byte of control field */
-
-/* S frames */
-
-#define S_FRAME_LEN 4 /* lenght of a U-frame */
-#define OFF_SRCR 2 /* 1st byte of control field, */
- /* R-commands and R-responses */
-#define OFF_SNR 3 /* 2nd byte of control field, N(R) and PF */
-#define SPFBIT 0x01 /* poll/final bit mask */
-#define SPBITSET SPFBIT
-#define SFBITSET SPFBIT
-#define GETSNR(octett) (((octett) >> 1) & 0x7f)
-#define GETSPF(octett) ((octett) & SPFBIT)
-#define RR 0x01 /* RR and bit 0 set */
-#define RNR 0x05 /* RNR and bit 0 set */
-#define REJ 0x09 /* REJ and bit 0 set */
-
-/* U frames */
-
-#define UI_HDR_LEN 3 /* length of UI header in front of L3 frame */
-#define U_FRAME_LEN 3 /* lenght of a U-frame */
-#define UPFBIT 0x10 /* poll/final bit mask */
-#define UPBITSET UPFBIT
-#define UFBITSET UPFBIT
-#define GETUPF(octett) (((octett) >> 4) & 0x01)
-
-/* commands/responses with pf bit set to 0 */
-
-#define SABME 0x6f
-#define DM 0x0f
-#define UI 0x03
-#define DISC 0x43
-#define UA 0x63
-#define FRMR 0x87
-#define XID 0xaf
-
-/* control field - octett 3 */
-
-#define OFF_MEI 3 /* 2nd byte of control field */
-
-/* control field - octett 4,5 */
-
-#define OFF_RIL 4 /* Ri low byte */
-#define OFF_RIH 5 /* Ri high byte */
-
-/* control field - octett 6 */
-
-#define OFF_MT 6 /* Message Type */
-#define OFF_AI 7 /* Action Indicator */
-#define GET_TEIFROMAI(octett) (((octett) >> 1) & 0x7f)
-
-/* I frame */
-
-#define I_HDR_LEN 4 /* length of I header in front of L3 frame */
-#define OFF_INS 2 /* transmit sequence number */
-#define OFF_INR 3 /* receive sequence number */
-#define IPFBIT 0x01 /* poll/final bit mask */
-#define IPBITSET 0x01
-#define GETINR(octett) (((octett) >> 1) & 0x7f)
-#define GETINS(octett) (((octett) >> 1) & 0x7f)
-#define GETIP(octett) ((octett) & IPFBIT)
-
-/* structure of a TEI management frame */
-
-#define TEI_MGMT_FRM_LEN 8 /* frame length */
-#define TEIM_SAPIO 0x00 /* SAPI, CR, EA */
-#define TEIM_TEIO 0x01 /* TEI, EA */
-#define TEIM_UIO 0x02 /* frame type = UI = 0x03 */
-#define TEIM_MEIO 0x03 /* management entity id = 0x0f */
-#define MEI 0x0f
-#define TEIM_RILO 0x04 /* reference number, low */
-#define TEIM_RIHO 0x05 /* reference number, high */
-#define TEIM_MTO 0x06 /* message type */
-#define MT_ID_REQEST 0x01
-#define MT_ID_ASSIGN 0x02
-#define MT_ID_DENY 0x03
-#define MT_ID_CHK_REQ 0x04
-#define MT_ID_CHK_RSP 0x05
-#define MT_ID_REMOVE 0x06
-#define MT_ID_VERIFY 0x07
-#define TEIM_AIO 0x07 /* action indicator */
-
-/* i4b_mdl_error_ind codes */
-
-enum MDL_ERROR_CODES {
- MDL_ERR_A,
- MDL_ERR_B,
- MDL_ERR_C,
- MDL_ERR_D,
- MDL_ERR_E,
- MDL_ERR_F,
- MDL_ERR_G,
- MDL_ERR_H,
- MDL_ERR_I,
- MDL_ERR_J,
- MDL_ERR_K,
- MDL_ERR_L,
- MDL_ERR_M,
- MDL_ERR_N,
- MDL_ERR_O,
- MDL_ERR_MAX
-};
-
-/* forward decl */
-
-extern void i4b_acknowledge_pending ( l2_softc_t *l2sc );
-extern struct mbuf * i4b_build_s_frame ( l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type );
-extern struct mbuf * i4b_build_u_frame ( l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type );
-extern void i4b_clear_exception_conditions ( l2_softc_t *l2sc );
-extern int i4b_dl_data_req ( int unit, struct mbuf *m );
-extern int i4b_dl_establish_req ( int unit );
-extern int i4b_dl_release_req ( int unit );
-extern int i4b_dl_unit_data_req ( int unit, struct mbuf *m );
-extern void i4b_enquiry_response ( l2_softc_t *l2sc );
-extern void i4b_establish_data_link ( l2_softc_t *l2sc );
-extern void i4b_invoke_retransmission ( l2_softc_t *l2sc, int nr );
-extern void i4b_i_frame_queued_up ( l2_softc_t *l2sc );
-extern void i4b_l1_activate ( l2_softc_t *l2sc );
-extern int i4b_l2_nr_ok ( int nr, int va, int vs );
-extern void i4b_make_rand_ri ( l2_softc_t *l2sc );
-extern void i4b_mdl_assign_ind ( l2_softc_t *l2sc );
-extern void i4b_mdl_error_ind ( l2_softc_t *l2sc, char *where, int errorcode );
-extern int i4b_mph_attach_ind ( int unit, int type );
-extern int i4b_mph_status_ind ( int unit, int status, int parm );
-extern void i4b_next_l2state ( l2_softc_t *l2sc, int event );
-extern void i4b_nr_error_recovery ( l2_softc_t *l2sc );
-extern int i4b_ph_activate_ind ( int unit );
-extern int i4b_ph_deactivate_ind ( int unit );
-extern int i4b_ph_data_ind ( int unit, struct mbuf *m );
-extern void i4b_print_frame ( int len, u_char *buf );
-extern char *i4b_print_l2state ( l2_softc_t *l2sc );
-extern void i4b_print_l2var ( l2_softc_t *l2sc );
-extern void i4b_rxd_ack(l2_softc_t *l2sc, int nr);
-extern void i4b_rxd_i_frame ( int unit, struct mbuf *m );
-extern void i4b_rxd_s_frame ( int unit, struct mbuf *m );
-extern void i4b_rxd_u_frame ( int unit, struct mbuf *m );
-extern void i4b_T200_restart ( l2_softc_t *l2sc );
-extern void i4b_T200_start ( l2_softc_t *l2sc );
-extern void i4b_T200_stop ( l2_softc_t *l2sc );
-extern void i4b_T202_start ( l2_softc_t *l2sc );
-extern void i4b_T202_stop ( l2_softc_t *l2sc );
-extern void i4b_T203_restart ( l2_softc_t *l2sc );
-extern void i4b_T203_start ( l2_softc_t *l2sc );
-extern void i4b_T203_stop ( l2_softc_t *l2sc );
-extern void i4b_tei_assign ( l2_softc_t *l2sc );
-extern void i4b_tei_chkresp ( l2_softc_t *l2sc );
-extern void i4b_tei_rxframe ( int unit, struct mbuf *m );
-extern void i4b_tei_verify ( l2_softc_t *l2sc );
-extern void i4b_transmit_enquire ( l2_softc_t *l2sc );
-extern void i4b_tx_disc ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_dm ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_frmr ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rej_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rnr_command ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_rnr_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rr_command ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_rr_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_sabme ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_ua ( l2_softc_t *l2sc, fbit_t fbit );
-
-#endif /* _I4B_L2_H_ */
diff --git a/sys/i4b/layer2/i4b_l2fsm.c b/sys/i4b/layer2/i4b_l2fsm.c
deleted file mode 100644
index 113167c11429..000000000000
--- a/sys/i4b/layer2/i4b_l2fsm.c
+++ /dev/null
@@ -1,1593 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2fsm.c - layer 2 FSM
- * -------------------------
- *
- * $Id: i4b_l2fsm.c,v 1.13 1998/12/05 18:05:11 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:28:15 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-l2_softc_t l2_softc[ISIC_MAXUNIT];
-
-static char *l2state_text[N_STATES] = {
- "ST_TEI_UNAS",
- "ST_ASG_AW_TEI",
- "ST_EST_AW_TEI",
- "ST_TEI_ASGD",
-
- "ST_AW_EST",
- "ST_AW_REL",
- "ST_MULTIFR",
- "ST_TIMREC",
-
- "ST_SUBSET",
- "Illegal State"
-};
-
-static char *l2event_text[N_EVENTS] = {
- "EV_DLESTRQ",
- "EV_DLUDTRQ",
- "EV_MDASGRQ",
- "EV_MDERRRS",
- "EV_PSDEACT",
- "EV_MDREMRQ",
- "EV_RXSABME",
- "EV_RXDISC",
- "EV_RXUA",
- "EV_RXDM",
- "EV_T200EXP",
- "EV_DLDATRQ",
- "EV_DLRELRQ",
- "EV_T203EXP",
- "EV_OWNBUSY",
- "EV_OWNRDY",
- "EV_RXRR",
- "EV_RXREJ",
- "EV_RXRNR",
- "EV_RXFRMR",
- "Illegal Event"
-};
-
-static void F_TU01 __P((l2_softc_t *));
-static void F_TU03 __P((l2_softc_t *));
-
-static void F_TA03 __P((l2_softc_t *));
-static void F_TA04 __P((l2_softc_t *));
-static void F_TA05 __P((l2_softc_t *));
-
-static void F_TE03 __P((l2_softc_t *));
-static void F_TE04 __P((l2_softc_t *));
-static void F_TE05 __P((l2_softc_t *));
-
-static void F_T01 __P((l2_softc_t *));
-static void F_T05 __P((l2_softc_t *));
-static void F_T06 __P((l2_softc_t *));
-static void F_T07 __P((l2_softc_t *));
-static void F_T08 __P((l2_softc_t *));
-static void F_T09 __P((l2_softc_t *));
-static void F_T10 __P((l2_softc_t *));
-static void F_T13 __P((l2_softc_t *));
-
-static void F_AE01 __P((l2_softc_t *));
-static void F_AE05 __P((l2_softc_t *));
-static void F_AE06 __P((l2_softc_t *));
-static void F_AE07 __P((l2_softc_t *));
-static void F_AE08 __P((l2_softc_t *));
-static void F_AE09 __P((l2_softc_t *));
-static void F_AE10 __P((l2_softc_t *));
-static void F_AE11 __P((l2_softc_t *));
-static void F_AE12 __P((l2_softc_t *));
-
-static void F_AR05 __P((l2_softc_t *));
-static void F_AR06 __P((l2_softc_t *));
-static void F_AR07 __P((l2_softc_t *));
-static void F_AR08 __P((l2_softc_t *));
-static void F_AR09 __P((l2_softc_t *));
-static void F_AR10 __P((l2_softc_t *));
-static void F_AR11 __P((l2_softc_t *));
-
-static void F_MF01 __P((l2_softc_t *));
-static void F_MF05 __P((l2_softc_t *));
-static void F_MF06 __P((l2_softc_t *));
-static void F_MF07 __P((l2_softc_t *));
-static void F_MF08 __P((l2_softc_t *));
-static void F_MF09 __P((l2_softc_t *));
-static void F_MF10 __P((l2_softc_t *));
-static void F_MF11 __P((l2_softc_t *));
-static void F_MF12 __P((l2_softc_t *));
-static void F_MF13 __P((l2_softc_t *));
-static void F_MF14 __P((l2_softc_t *));
-static void F_MF15 __P((l2_softc_t *));
-static void F_MF16 __P((l2_softc_t *));
-static void F_MF17 __P((l2_softc_t *));
-static void F_MF18 __P((l2_softc_t *));
-static void F_MF19 __P((l2_softc_t *));
-static void F_MF20 __P((l2_softc_t *));
-
-static void F_TR01 __P((l2_softc_t *));
-static void F_TR05 __P((l2_softc_t *));
-static void F_TR06 __P((l2_softc_t *));
-static void F_TR07 __P((l2_softc_t *));
-static void F_TR08 __P((l2_softc_t *));
-static void F_TR09 __P((l2_softc_t *));
-static void F_TR10 __P((l2_softc_t *));
-static void F_TR11 __P((l2_softc_t *));
-static void F_TR12 __P((l2_softc_t *));
-static void F_TR13 __P((l2_softc_t *));
-static void F_TR15 __P((l2_softc_t *));
-static void F_TR16 __P((l2_softc_t *));
-static void F_TR17 __P((l2_softc_t *));
-static void F_TR18 __P((l2_softc_t *));
-static void F_TR19 __P((l2_softc_t *));
-static void F_TR20 __P((l2_softc_t *));
-static void F_ILL __P((l2_softc_t *));
-static void F_NCNA __P((l2_softc_t *));
-
-/*---------------------------------------------------------------------------*
- * FSM illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ILL(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_ERR, "F_ILL", ("FSM function F_ILL executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM No change, No action
- *---------------------------------------------------------------------------*/
-static void
-F_NCNA(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_NCNA", ("FSM function F_NCNA executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * layer 2 state transition table
- *---------------------------------------------------------------------------*/
-struct l2state_tab {
- void (*func) __P((l2_softc_t *)); /* function to execute */
- int newstate; /* next state */
-} l2state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_TEI_UNAS, ST_ASG_AW_TEI, ST_EST_AW_TEI, ST_TEI_ASGD, ST_AW_EST, ST_AW_REL, ST_MULTIFR, ST_TIMREC, ST_SUBSET, ILLEGAL STATE */
-/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_DLESTRQ*/{ {F_TU01, ST_EST_AW_TEI}, {F_NCNA, ST_EST_AW_TEI}, {F_ILL, ST_ILL}, {F_T01, ST_AW_EST}, {F_AE01, ST_AW_EST}, {F_ILL, ST_ILL}, {F_MF01, ST_AW_EST}, {F_TR01, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLUDTRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDASGRQ*/{ {F_TU03, ST_TEI_ASGD}, {F_TA03, ST_TEI_ASGD}, {F_TE03, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDERRRS*/{ {F_ILL, ST_ILL}, {F_TA04, ST_TEI_UNAS}, {F_TE04, ST_TEI_UNAS}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_PSDEACT*/{ {F_ILL, ST_ILL}, {F_TA05, ST_TEI_UNAS}, {F_TE05, ST_TEI_UNAS}, {F_T05, ST_TEI_ASGD}, {F_AE05, ST_TEI_ASGD}, {F_AR05, ST_TEI_ASGD}, {F_MF05, ST_TEI_ASGD}, {F_TR05, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDREMRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T06, ST_TEI_UNAS}, {F_AE06, ST_TEI_UNAS}, {F_AR06, ST_TEI_UNAS}, {F_MF06, ST_TEI_UNAS}, {F_TR06, ST_TEI_UNAS}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXSABME*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T07, ST_SUBSET}, {F_AE07, ST_AW_EST}, {F_AR07, ST_AW_REL}, {F_MF07, ST_MULTIFR}, {F_TR07, ST_MULTIFR}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXDISC */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T08, ST_TEI_ASGD}, {F_AE08, ST_AW_EST}, {F_AR08, ST_AW_REL}, {F_MF08, ST_TEI_ASGD}, {F_TR08, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXUA */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T09, ST_TEI_ASGD}, {F_AE09, ST_SUBSET}, {F_AR09, ST_SUBSET}, {F_MF09, ST_MULTIFR}, {F_TR09, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXDM */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T10, ST_SUBSET}, {F_AE10, ST_SUBSET}, {F_AR10, ST_SUBSET}, {F_MF10, ST_SUBSET}, {F_TR10, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_T200EXP*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_AE11, ST_SUBSET}, {F_AR11, ST_SUBSET}, {F_MF11, ST_TIMREC}, {F_TR11, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLDATRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_AE12, ST_AW_EST}, {F_ILL, ST_ILL}, {F_MF12, ST_MULTIFR}, {F_TR12, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLRELRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T13, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF13, ST_AW_REL}, {F_TR13, ST_AW_REL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_T203EXP*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF14, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_OWNBUSY*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF15, ST_MULTIFR}, {F_TR15, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_OWNRDY */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF16, ST_MULTIFR}, {F_TR16, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXRR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF17, ST_SUBSET}, {F_TR17, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXREJ */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF18, ST_SUBSET}, {F_TR18, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXRNR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF19, ST_SUBSET}, {F_TR19, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXFRMR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF20, ST_AW_EST}, {F_TR20, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_ILL */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} }
-};
-
-/*---------------------------------------------------------------------------*
- * event handler, executes function and sets new state
- *---------------------------------------------------------------------------*/
-void i4b_next_l2state(l2_softc_t *l2sc, int event)
-{
- int currstate, newstate;
-
- /* check event number */
- if(event > N_EVENTS)
- panic("i4b_l2fsm.c: event > N_EVENTS\n");
-
- /* get current state and check it */
- if((currstate = l2sc->Q921_state) > N_STATES) /* failsafe */
- panic("i4b_l2fsm.c: currstate > N_STATES\n");
-
- /* get new state and check it */
- if((newstate = l2state_tab[event][currstate].newstate) > N_STATES)
- panic("i4b_l2fsm.c: newstate > N_STATES\n");
-
-
- if(newstate != ST_SUBSET)
- { /* state function does NOT set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM event [%s]: [%s/%d => %s/%d]\n",
- l2event_text[event],
- l2state_text[currstate], currstate,
- l2state_text[newstate], newstate));
- }
-
- /* execute state transition function */
- (*l2state_tab[event][currstate].func)(l2sc);
-
- if(newstate == ST_SUBSET)
- { /* state function DOES set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM S-event [%s]: [%s => %s]\n", l2event_text[event],
- l2state_text[currstate],
- l2state_text[l2sc->Q921_state]));
- }
-
- /* check for illegal new state */
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- DBGL2(L2_F_ERR, "i4b_next_l2state", ("FSM illegal state, state = %s, event = %s!\n",
- l2state_text[currstate],
- l2event_text[event]));
- }
-
- /* check if state machine function has to set new state */
-
- if(newstate != ST_SUBSET)
- l2sc->Q921_state = newstate; /* no, we set new state */
-
- if(l2sc->postfsmfunc != NULL)
- {
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM executing postfsmfunc!\n"));
- (*l2sc->postfsmfunc)(l2sc->postfsmarg);
- l2sc->postfsmfunc = NULL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *i4b_print_l2state(l2_softc_t *l2sc)
-{
- return((char *) l2state_text[l2sc->Q921_state]);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_TU01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TU01", ("FSM function F_TU01 executing\n"));
- i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TU03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TU03", ("FSM function F_TU03 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TA03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA03", ("FSM function F_TA03 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl error response
- *---------------------------------------------------------------------------*/
-static void
-F_TA04(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA04", ("FSM function F_TA04 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TA05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA05", ("FSM function F_TA05 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TE03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE03", ("FSM function F_TE03 executing\n"));
- i4b_establish_data_link(l2sc);
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event mdl error response
- *---------------------------------------------------------------------------*/
-static void
-F_TE04(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE04", ("FSM function F_TE04 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TE05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE05", ("FSM function F_TE05 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_T01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T01", ("FSM function F_T01 executing\n"));
- i4b_establish_data_link(l2sc);
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_T05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T05", ("FSM function F_T05 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_T06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T06", ("FSM function F_T06 executing\n"));
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_T07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T07", ("FSM function F_T07 executing\n"));
-
-/* XXX */
-#ifdef NOTDEF
- if(NOT able to establish)
- {
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
- l2sc->Q921_state = ST_TEI_ASGD;
- return;
- }
-#endif
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
-
- i4b_T203_start(l2sc);
-
- l2sc->Q921_state = ST_MULTIFR;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_T08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T08", ("FSM function F_T08 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_T09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T09", ("FSM function F_T09 executing\n"));
- i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_C);
- i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_T10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T10", ("FSM function F_T10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
-#ifdef NOTDEF
- if(NOT able_to_etablish)
- {
- l2sc->Q921_state = ST_TEI_ASGD;
- return;
- }
-#endif
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_T13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T13", ("FSM function F_T13 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_AE01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE01", ("FSM function F_AE01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_AE05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE05", ("FSM function F_AE05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_AE06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE06", ("FSM function F_AE06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_AE07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE07", ("FSM function F_AE07 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_AE08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE08", ("FSM function F_AE08 executing\n"));
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_AE09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE09", ("FSM function F_AE09 executing\n"));
-
- if(l2sc->rxd_PF == 0)
- {
- i4b_mdl_error_ind(l2sc, "F_AE09", MDL_ERR_D);
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- if(l2sc->l3initiated)
- {
- l2sc->l3initiated = 0;
- l2sc->vr = 0;
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Cnf_A;
- }
- else
- {
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
- }
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
-
- l2sc->Q921_state = ST_MULTIFR;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_AE10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE10", ("FSM function F_AE10 executing\n"));
-
- if(l2sc->rxd_PF == 0)
- {
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_AE11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE11", ("FSM function F_AE11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_mdl_error_ind(l2sc, "F_AE11", MDL_ERR_G);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->RC++;
-
- i4b_tx_sabme(l2sc, P1);
-
- i4b_T200_start(l2sc);
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_AE12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE12", ("FSM function F_AE12 executing\n"));
-
- if(l2sc->l3initiated == 0)
- {
- i4b_i_frame_queued_up(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_AR05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR05", ("FSM function F_AR05 executing\n"));
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_AR06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR06", ("FSM function F_AR06 executing\n"));
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_AR07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR07", ("FSM function F_AR07 executing\n"));
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_AR08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR08", ("FSM function F_AR08 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_AR09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR09", ("FSM function F_AR09 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_AR09", MDL_ERR_D);
-
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_AR10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR10", ("FSM function F_AR10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_AR11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR11", ("FSM function F_AR11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_mdl_error_ind(l2sc, "F_AR11", MDL_ERR_H);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->RC++;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T200_start(l2sc);
-
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_MF01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF01", ("FSM function F_MF01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_MF05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF05", ("FSM function F_MF05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_MF06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF06", ("FSM function F_MF06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_MF07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF07", ("FSM function F_MF07 executing\n"));
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- i4b_mdl_error_ind(l2sc, "F_MF07", MDL_ERR_F);
-
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_MF08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF08", ("FSM function F_MF08 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_MF09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF09", ("FSM function F_MF09 executing\n"));
- if(l2sc->rxd_PF)
- i4b_mdl_error_ind(l2sc, "F_MF09", MDL_ERR_C);
- else
- i4b_mdl_error_ind(l2sc, "F_MF09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_MF10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF10", ("FSM function F_MF10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- i4b_mdl_error_ind(l2sc, "F_MF10", MDL_ERR_B);
-
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_MF10", MDL_ERR_E);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_MF11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF11", ("FSM function F_MF11 executing\n"));
-
- l2sc->RC = 0;
-
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC++;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_MF12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF12", ("FSM function F_MF12 executing\n"));
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_MF13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF13", ("FSM function F_MF13 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->RC = 0;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T203_stop(l2sc);
- i4b_T200_restart(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event T203 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_MF14(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF14", ("FSM function F_MF14 executing\n"));
-
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event set own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_MF15(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF15", ("FSM function F_MF15 executing\n"));
-
- if(l2sc->own_busy == 0)
- {
- l2sc->own_busy = 1;
-
- i4b_tx_rnr_response(l2sc, F0); /* wrong in Q.921 03/93 p 64 */
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event clear own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_MF16(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF16", ("FSM function F_MF16 executing\n"));
-
- if(l2sc->own_busy != 0)
- {
- l2sc->own_busy = 0;
-
- i4b_tx_rr_response(l2sc, F0); /* wrong in Q.921 03/93 p 64 */
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd RR
- *---------------------------------------------------------------------------*/
-static void
-F_MF17(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF17", ("FSM function F_MF17 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF17", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- if(l2sc->rxd_NR == l2sc->vs)
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_restart(l2sc);
- }
- else if(l2sc->rxd_NR != l2sc->va)
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_restart(l2sc);
- }
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd REJ
- *---------------------------------------------------------------------------*/
-static void
-F_MF18(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF18", ("FSM function F_MF18 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF18", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd RNR
- *---------------------------------------------------------------------------*/
-static void
-F_MF19(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF19", ("FSM function F_MF19 executing\n"));
-
- l2sc->peer_busy = 1;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF19", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T203_stop(l2sc);
- i4b_T200_restart(l2sc);
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd FRMR
- *---------------------------------------------------------------------------*/
-static void
-F_MF20(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF20", ("FSM function F_MF20 executing\n"));
-
- i4b_mdl_error_ind(l2sc, "F_MF20", MDL_ERR_K);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_TR01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR01", ("FSM function F_TR01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TR05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR05", ("FSM function F_TR05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_TR06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR06", ("FSM function F_TR06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_TR07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR07", ("FSM function F_TR07 executing\n"));
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- i4b_mdl_error_ind(l2sc, "F_TR07", MDL_ERR_F);
-
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_TR08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR08", ("FSM function F_TR08 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_TR09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR09", ("FSM function F_TR09 executing\n"));
- if(l2sc->rxd_PF)
- i4b_mdl_error_ind(l2sc, "F_TR09", MDL_ERR_C);
- else
- i4b_mdl_error_ind(l2sc, "F_TR09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_TR10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR10", ("FSM function F_TR10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- i4b_mdl_error_ind(l2sc, "F_TR10", MDL_ERR_B);
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_TR10", MDL_ERR_E);
- }
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_TR11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR11", ("FSM function F_TR11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_mdl_error_ind(l2sc, "F_TR11", MDL_ERR_I);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC++;
-
- l2sc->Q921_state = ST_TIMREC;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_TR12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR12", ("FSM function F_TR12 executing\n"));
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_TR13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR13", ("FSM function F_TR13 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->RC = 0;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T200_restart(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event set own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_TR15(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR15", ("FSM function F_TR15 executing\n"));
-
- if(l2sc->own_busy == 0)
- {
- l2sc->own_busy = 1;
-
- i4b_tx_rnr_response(l2sc, F0);
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event clear own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_TR16(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR16", ("FSM function F_TR16 executing\n"));
-
- if(l2sc->own_busy != 0)
- {
- l2sc->own_busy = 0;
-
- i4b_tx_rr_response(l2sc, F0); /* this is wrong */
- /* in Q.921 03/93 p 74 ! */
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd RR
- *---------------------------------------------------------------------------*/
-static void
-F_TR17(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR17", ("FSM function F_TR17 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event
- *---------------------------------------------------------------------------*/
-static void
-F_TR18(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR18", ("FSM function F_TR18 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd RNR
- *---------------------------------------------------------------------------*/
-static void
-F_TR19(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR19", ("FSM function F_TR19 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_restart(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd FRMR
- *---------------------------------------------------------------------------*/
-static void
-F_TR20(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR20", ("FSM function F_TR20 executing\n"));
-
- i4b_mdl_error_ind(l2sc, "F_TR20", MDL_ERR_K);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_l2fsm.h b/sys/i4b/layer2/i4b_l2fsm.h
deleted file mode 100644
index 8f510682bebf..000000000000
--- a/sys/i4b/layer2/i4b_l2fsm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2fsm.h - layer 2 FSM
- * -------------------------
- *
- * $Id: i4b_l2fsm.h,v 1.3 1998/12/05 18:05:13 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:28:39 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2FSM_H_
-#define _I4B_L2FSM_H_
-
-enum Q921_states {
- ST_TEI_UNAS, /* TEI unassigned */
- ST_ASG_AW_TEI, /* assign awaiting TEI */
- ST_EST_AW_TEI, /* establish awaiting TEI */
- ST_TEI_ASGD, /* TEI assigned */
-
- ST_AW_EST, /* awaiting establishment */
- ST_AW_REL, /* awaiting release */
- ST_MULTIFR, /* multiple frame established */
- ST_TIMREC, /* timer recovery */
-
- ST_SUBSET, /* SUBroutine SETs new state */
- ST_ILL, /* illegal state */
- N_STATES /* number of states */
-};
-
-enum Q921_events {
- EV_DLESTRQ, /* dl establish req */
- EV_DLUDTRQ, /* dl unit data req */
- EV_MDASGRQ, /* mdl assign req */
- EV_MDERRRS, /* mdl error response */
- EV_PSDEACT, /* persistent deactivation */
- EV_MDREMRQ, /* mdl remove req */
- EV_RXSABME, /* rx'd SABME */
- EV_RXDISC, /* rx'd DISC */
- EV_RXUA, /* rx'd UA */
- EV_RXDM, /* rx'd DM */
- EV_T200EXP, /* T200 expired */
- EV_DLDATRQ, /* dl data req */
- EV_DLRELRQ, /* dl release req */
- EV_T203EXP, /* T203 expired */
- EV_OWNBUSY, /* set own rx busy */
- EV_OWNRDY, /* clear own rx busy */
- EV_RXRR, /* rx'd RR */
- EV_RXREJ, /* rx'd REJ */
- EV_RXRNR, /* rx'd RNR */
- EV_RXFRMR, /* rx'd FRMR */
-
- EV_ILL, /* Illegal */
- N_EVENTS
-};
-
-#endif /* _I4B_L2FSM_H_ */
-
diff --git a/sys/i4b/layer2/i4b_l2timer.c b/sys/i4b/layer2/i4b_l2timer.c
deleted file mode 100644
index 3b45e807dcdb..000000000000
--- a/sys/i4b/layer2/i4b_l2timer.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2timer.c - layer 2 timer handling
- * --------------------------------------
- *
- * $Id: i4b_l2timer.c,v 1.12 1998/12/05 18:05:15 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:13 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_T200_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T200_timeout", ("unit %d, RC = %d\n", l2sc->unit, l2sc->RC));
- i4b_next_l2state(l2sc, EV_T200EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_start(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_MSG, "i4b_T200_start", ("unit %d\n", l2sc->unit));
- l2sc->T200 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_stop(l2_softc_t *l2sc)
-{
- if(l2sc->T200 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
- l2sc->T200 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T200_stop", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_restart(l2_softc_t *l2sc)
-{
- if(l2sc->T200 != TIMER_IDLE)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
- else
- l2sc->T200 = TIMER_ACTIVE;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
-
- DBGL2(L2_T_MSG, "i4b_T200_restart", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_T202_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T202_timeout", ("unit %d, N202 = %d\n", l2sc->unit, l2sc->N202));
-
- if(--(l2sc->N202))
- {
- (*l2sc->T202func)(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_start(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_MSG, "i4b_T202_start", ("unit %d\n", l2sc->unit));
- l2sc->N202 = N202DEF;
- l2sc->T202 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T202_callout = timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_stop(l2_softc_t *l2sc)
-{
- if(l2sc->T202 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, l2sc->T202_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc);
-#endif
- l2sc->T202 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T202_stop", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 timeout function
- *---------------------------------------------------------------------------*/
-#if I4B_T203_ACTIVE
-static void
-i4b_T203_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T203_timeout", ("unit %d\n", l2sc->unit));
- i4b_next_l2state(l2sc, EV_T203EXP);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_start(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- DBGL2(L2_T_MSG, "i4b_T203_start", ("unit %d\n", l2sc->unit));
- l2sc->T203 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_stop(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- if(l2sc->T203 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
- l2sc->T203 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T203_stop", ("unit %d\n", l2sc->unit));
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_restart(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- if(l2sc->T203 != TIMER_IDLE)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
- else
- l2sc->T203 = TIMER_ACTIVE;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
-
- DBGL2(L2_T_MSG, "i4b_T203_restart", ("unit %d\n", l2sc->unit));
-#endif
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer2/i4b_lme.c b/sys/i4b/layer2/i4b_lme.c
deleted file mode 100644
index b179e94bfe43..000000000000
--- a/sys/i4b/layer2/i4b_lme.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_lme.c - layer management entity
- * -------------------------------------
- *
- * $Id: i4b_lme.c,v 1.8 1998/12/05 18:05:19 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:25 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * mdl assign indication handler
- *---------------------------------------------------------------------------*/
-void
-i4b_mdl_assign_ind(l2_softc_t *l2sc)
-{
- DBGL2(L2_PRIM, "MDL-ASSIGN-IND", ("unit %d\n", l2sc->unit));
-
- i4b_l1_activate(l2sc);
-
- if(l2sc->tei_valid == TEI_VALID)
- {
- l2sc->T202func = (void(*)(void*))i4b_tei_verify;
- l2sc->N202 = N202DEF;
- i4b_tei_verify(l2sc);
- }
- else
- {
- l2sc->T202func = (void(*)(void*))i4b_tei_assign;
- l2sc->N202 = N202DEF;
- i4b_tei_assign(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_mdl_error_ind handler (Q.921 01/94 pp 156)
- *---------------------------------------------------------------------------*/
-void
-i4b_mdl_error_ind(l2_softc_t *l2sc, char *where, int errorcode)
-{
- static char *error_text[] = {
- "MDL_ERR_A: rx'd unsolicited response - supervisory (F=1)",
- "MDL_ERR_B: rx'd unsolicited response - DM (F=1)",
- "MDL_ERR_C: rx'd unsolicited response - UA (F=1)",
- "MDL_ERR_D: rx'd unsolicited response - UA (F=0)",
- "MDL_ERR_E: rx'd unsolicited response - DM (F=0)",
- "MDL_ERR_F: peer initiated re-establishment - SABME",
- "MDL_ERR_G: unsuccessful transmission N200times - SABME",
- "MDL_ERR_H: unsuccessful transmission N200times - DIS",
- "MDL_ERR_I: unsuccessful transmission N200times - Status ENQ",
- "MDL_ERR_J: other error - N(R) error",
- "MDL_ERR_K: other error - rx'd FRMR response",
- "MDL_ERR_L: other error - rx'd undefined frame",
- "MDL_ERR_M: other error - receipt of I field not permitted",
- "MDL_ERR_N: other error - rx'd frame with wrong size",
- "MDL_ERR_O: other error - N201 error",
- "MDL_ERR_MAX: i4b_mdl_error_ind called with wrong parameter!!!"
- };
-
- if(errorcode > MDL_ERR_MAX)
- errorcode = MDL_ERR_MAX;
-
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("unit = %d, location = %s\n", l2sc->unit, where));
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("error = %s\n", error_text[errorcode]));
-
- switch(errorcode)
- {
- case MDL_ERR_A:
- case MDL_ERR_B:
- break;
-
- case MDL_ERR_C:
- case MDL_ERR_D:
- i4b_tei_verify(l2sc);
- break;
-
- case MDL_ERR_E:
- case MDL_ERR_F:
- break;
-
- case MDL_ERR_G:
- case MDL_ERR_H:
- i4b_tei_verify(l2sc);
- break;
-
- case MDL_ERR_I:
- case MDL_ERR_J:
- case MDL_ERR_K:
- case MDL_ERR_L:
- case MDL_ERR_M:
- case MDL_ERR_N:
- case MDL_ERR_O:
- break;
-
- default:
- break;
- }
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_mbuf.c b/sys/i4b/layer2/i4b_mbuf.c
deleted file mode 100644
index 6d085c3e08c0..000000000000
--- a/sys/i4b/layer2/i4b_mbuf.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b - mbuf handling support routines
- * ------------------------------------
- *
- * $Id: i4b_mbuf.c,v 1.10 1998/12/05 18:05:20 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:44 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#define I4B_MBUF_DEBUG
-#undef I4B_MBUF_TYPE_DEBUG
-
-#ifdef I4B_MBUF_TYPE_DEBUG
-
-#ifdef __FreeBSD__
-
-#define MT_DCHAN 42
-#define MT_BCHAN 43
-
-#else /* NetBSD */
-
-#define MT_DCHAN MT_DATA
-#define MT_BCHAN MT_DATA
-
-#endif
-
-#define MT_I4B_D MT_DCHAN
-#define MT_I4B_B MT_BCHAN
-
-#else /* ! I4B_MBUF_TYPE_DEBUG */
-
-#define MT_I4B_D MT_DATA
-#define MT_I4B_B MT_DATA
-
-#endif /* I4B_MBUF_TYPE_DEBUG */
-
-/*---------------------------------------------------------------------------*
- * allocate D-channel mbuf space
- *---------------------------------------------------------------------------*/
-struct mbuf*
-i4b_Dgetmbuf(int len)
-{
- struct mbuf *m;
-
- if(len > MCLBYTES) /* if length > max extension size */
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getmbuf: error - len(%d) > MCLBYTES(%d)\n",
- len, MCLBYTES);
-#endif
-
- return(NULL);
- }
-
- MGETHDR(m, M_DONTWAIT, MT_I4B_D); /* get mbuf with pkthdr */
-
- /* did we actually get the mbuf ? */
-
- if(!m)
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MGETHDR failed!\n");
-#endif
-
- return(NULL);
- }
-
- if(len >= MHLEN)
- {
- MCLGET(m, M_DONTWAIT);
-
- if(!(m->m_flags & M_EXT))
- {
- m_freem(m);
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MCLGET failed, len(%d)\n", len);
-#endif
-
- return (NULL);
- }
- }
-
- m->m_len = len;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * free a D-channel mbuf
- *---------------------------------------------------------------------------*/
-void
-i4b_Dfreembuf(struct mbuf *m)
-{
- if(m)
- m_freem(m);
-}
-
-/*---------------------------------------------------------------------------*
- * clear a D-channel ifqueue from data
- *---------------------------------------------------------------------------*/
-void
-i4b_Dcleanifq(struct ifqueue *ifq)
-{
- struct mbuf *m;
- int x = splimp();
-
- while(!IF_QEMPTY(ifq))
- {
- IF_DEQUEUE(ifq, m);
- i4b_Dfreembuf(m);
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate B-channel mbuf space
- *---------------------------------------------------------------------------*/
-struct mbuf*
-i4b_Bgetmbuf(int len)
-{
- struct mbuf *m;
-
- if(len > MCLBYTES) /* if length > max extension size */
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getmbuf: error - len(%d) > MCLBYTES(%d)\n",
- len, MCLBYTES);
-#endif
-
- return(NULL);
- }
-
- MGETHDR(m, M_DONTWAIT, MT_I4B_B); /* get mbuf with pkthdr */
-
- /* did we actually get the mbuf ? */
-
- if(!m)
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MGETHDR failed!\n");
-#endif
-
- return(NULL);
- }
-
- if(len >= MHLEN)
- {
- MCLGET(m, M_DONTWAIT);
-
- if(!(m->m_flags & M_EXT))
- {
- m_freem(m);
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MCLGET failed, len(%d)\n", len);
-#endif
-
- return (NULL);
- }
- }
-
- m->m_len = len;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * free a B-channel mbuf
- *---------------------------------------------------------------------------*/
-void
-i4b_Bfreembuf(struct mbuf *m)
-{
- if(m)
- m_freem(m);
-}
-
-/*---------------------------------------------------------------------------*
- * clear a B-channel ifqueue from data
- *---------------------------------------------------------------------------*/
-void
-i4b_Bcleanifq(struct ifqueue *ifq)
-{
- struct mbuf *m;
- int x = splimp();
-
- while(!IF_QEMPTY(ifq))
- {
- IF_DEQUEUE(ifq, m);
- i4b_Bfreembuf(m);
- }
-
- splx(x);
-}
-
-/* EOF */
diff --git a/sys/i4b/layer2/i4b_sframe.c b/sys/i4b/layer2/i4b_sframe.c
deleted file mode 100644
index f8d14ba1a246..000000000000
--- a/sys/i4b/layer2/i4b_sframe.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_sframe.c - s frame handling routines
- * ----------------------------------------
- *
- * $Id: i4b_sframe.c,v 1.8 1998/12/05 18:05:21 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:02 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process s frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_s_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- if(!((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI)))))
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- l2sc->rxd_CR = GETCR(*(ptr + OFF_SAPI));
- l2sc->rxd_PF = GETSPF(*(ptr + OFF_SNR));
- l2sc->rxd_NR = GETSNR(*(ptr + OFF_SNR));
-
- i4b_rxd_ack(l2sc, l2sc->rxd_NR);
-
- switch(*(ptr + OFF_SRCR))
- {
- case RR:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RR, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXRR);
- break;
-
- case RNR:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RNR, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXRNR);
- break;
-
- case REJ:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd REJ, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXREJ);
- break;
-
- default:
- DBGL2(L2_S_ERR, "i4b_rxd_s_frame", ("ERROR, unknown code, frame = \n"));
- i4b_print_frame(m->m_len, m->m_data);
- break;
- }
- i4b_Dfreembuf(m);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RR command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rr_command(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rr_command", ("tx RR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rr_response", ("tx RR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_command(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rnr_command", ("tx RNR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rnr_response", ("tx RNR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit REJ response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rej_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rej_response", ("tx REJ, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, REJ);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * build S-frame for sending
- *---------------------------------------------------------------------------*/
-struct mbuf *
-i4b_build_s_frame(l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(S_FRAME_LEN)) == NULL)
- return(NULL);
-
- PUTSAPI(SAPI_CCP, crbit, m->m_data[OFF_SAPI]);
-
- PUTTEI(l2sc->tei, m->m_data[OFF_TEI]);
-
- m->m_data[OFF_SRCR] = type;
-
- m->m_data[OFF_SNR] = (l2sc->vr << 1) | (pbit & 0x01);
-
- return(m);
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_tei.c b/sys/i4b/layer2/i4b_tei.c
deleted file mode 100644
index 5c5b7b83fd87..000000000000
--- a/sys/i4b/layer2/i4b_tei.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tei.c - tei handling procedures
- * -----------------------------------
- *
- * $Id: i4b_tei.c,v 1.13 1998/12/05 18:05:23 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:20 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/syslog.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <machine/random.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * handle a received TEI management frame
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_rxframe(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- switch(*(ptr + OFF_MT))
- {
- case MT_ID_ASSIGN:
- if( (*(ptr + OFF_RIL) == l2sc->last_ril) &&
- (*(ptr + OFF_RIH) == l2sc->last_rih))
- {
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
- l2sc->tei_valid = TEI_VALID;
-
- if(l2sc->T202 == TIMER_ACTIVE)
- i4b_T202_stop(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, l2sc->tei);
-
- log(LOG_INFO, "i4b: unit %d, assigned TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
-
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Assign - TEI = %d\n", l2sc->tei));
-
- i4b_next_l2state(l2sc, EV_MDASGRQ);
- }
- break;
-
- case MT_ID_DENY:
- if( (*(ptr + OFF_RIL) == l2sc->last_ril) &&
- (*(ptr + OFF_RIH) == l2sc->last_rih))
- {
- l2sc->tei_valid = TEI_INVALID;
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
-
- if(l2sc->tei == GROUP_TEI)
- {
- log(LOG_WARNING, "i4b: unit %d, denied TEI, no TEI values available from exchange!\n", l2sc->unit);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied, No TEI values available from exchange!\n"));
- }
- else
- {
- log(LOG_WARNING, "i4b: unit %d, denied TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied - TEI = %d\n", l2sc->tei));
- }
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
- i4b_next_l2state(l2sc, EV_MDERRRS);
- }
- break;
-
- case MT_ID_CHK_REQ:
- if( (l2sc->tei_valid == TEI_VALID) &&
- ( (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI))) ||
- (GROUP_TEI == GET_TEIFROMAI(*(ptr+OFF_AI))) ))
- {
- static int lasttei = -1;
-
- if(l2sc->tei != lasttei)
- {
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Check Req - TEI = %d\n", l2sc->tei));
- lasttei = l2sc->tei;
- }
-
- if(l2sc->T202 == TIMER_ACTIVE)
- i4b_T202_stop(l2sc);
- i4b_tei_chkresp(l2sc);
- }
- break;
-
- case MT_ID_REMOVE:
- if( (l2sc->tei_valid == TEI_VALID) &&
- ( (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI))) ||
- (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI)))))
- {
- l2sc->tei_valid = TEI_INVALID;
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
-
- log(LOG_INFO, "i4b: unit %d, removed TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Remove - TEI = %d\n", l2sc->tei));
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
- i4b_next_l2state(l2sc, EV_MDREMRQ);
- }
- break;
-
- default:
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("UNKNOWN TEI MGMT Frame, type = 0x%x\n", *(ptr + OFF_MT)));
- i4b_print_frame(m->m_len, m->m_data);
- break;
- }
- i4b_Dfreembuf(m);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate and fill up a TEI management frame for sending
- *---------------------------------------------------------------------------*/
-static struct mbuf *
-build_tei_mgmt_frame(l2_softc_t *l2sc, unsigned char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(TEI_MGMT_FRM_LEN)) == NULL)
- return(NULL);
-
- m->m_data[TEIM_SAPIO] = 0xfc; /* SAPI = 63, CR = 0, EA = 0 */
- m->m_data[TEIM_TEIO] = 0xff; /* TEI = 127, EA = 1 */
- m->m_data[TEIM_UIO] = UI; /* UI */
- m->m_data[TEIM_MEIO] = MEI; /* MEI */
- m->m_data[TEIM_MTO] = type; /* message type */
-
- switch(type)
- {
- case MT_ID_REQEST:
- i4b_make_rand_ri(l2sc);
- m->m_data[TEIM_RILO] = l2sc->last_ril;
- m->m_data[TEIM_RIHO] = l2sc->last_rih;
- m->m_data[TEIM_AIO] = (GROUP_TEI << 1) | 0x01;
- break;
-
- case MT_ID_CHK_RSP:
- i4b_make_rand_ri(l2sc);
- m->m_data[TEIM_RILO] = l2sc->last_ril;
- m->m_data[TEIM_RIHO] = l2sc->last_rih;
- m->m_data[TEIM_AIO] = (l2sc->tei << 1) | 0x01;
- break;
-
- case MT_ID_VERIFY:
- m->m_data[TEIM_RILO] = 0;
- m->m_data[TEIM_RIHO] = 0;
- m->m_data[TEIM_AIO] = (l2sc->tei << 1) | 0x01;
- break;
-
- default:
- i4b_Dfreembuf(m);
- panic("build_tei_mgmt_frame: invalid type");
- break;
- }
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_assign - TEI assignment procedure (Q.921, 5.3.2, pp 24)
- * T202func and N202 _MUST_ be set prior to calling this function !
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_assign(l2_softc_t *l2sc)
-{
- struct mbuf *m;
-
- DBGL2(L2_TEI_MSG, "i4b_tei_assign", ("tx TEI ID_Request\n"));
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_REQEST);
-
- if(m == NULL)
- panic("i4b_tei_assign: no mbuf");
-
- i4b_T202_start(l2sc);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_assign - TEI verify procedure (Q.921, 5.3.5, pp 29)
- * T202func and N202 _MUST_ be set prior to calling this function !
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_verify(l2_softc_t *l2sc)
-{
- struct mbuf *m;
-
- DBGL2(L2_TEI_MSG, "i4b_tei_verify", ("tx TEI ID_Verify\n"));
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_VERIFY);
-
- if(m == NULL)
- panic("i4b_tei_verify: no mbuf");
-
- i4b_T202_start(l2sc);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_chkresp - TEI check response procedure (Q.921, 5.3.5, pp 29)
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_chkresp(l2_softc_t *l2sc)
-{
- struct mbuf *m;
- static int lasttei = 0;
-
- if(l2sc->tei != lasttei)
- {
- lasttei = l2sc->tei;
- DBGL2(L2_TEI_MSG, "i4b_tei_chkresp", ("tx TEI ID_Check_Response\n"));
- }
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_CHK_RSP);
-
- if(m == NULL)
- panic("i4b_tei_chkresp: no mbuf");
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * generate some 16 bit "random" number used for TEI mgmt Ri field
- *---------------------------------------------------------------------------*/
-void
-i4b_make_rand_ri(l2_softc_t *l2sc)
-{
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-
- u_short val;
- read_random((char *)&val, sizeof(val));
-
-#else
-
- register u_short val;
- register int i;
- static int called = 42;
-
- val = (l2sc->last_rih << 8) | l2sc->last_ril;
-
- val += ++called;
-
- for(i=0; i < 50 ; i++, val++)
- {
- val |= l2sc->unit+i;
- val <<= i;
- val ^= (time.tv_sec >> 16) ^ time.tv_usec;
- val <<= i;
- val ^= time.tv_sec ^ (time.tv_usec >> 16);
-
- if(val != 0 && val != 0xffff)
- break;
- }
-#endif
- l2sc->last_rih = (val >> 8) & 0x00ff;
- l2sc->last_ril = val & 0x00ff;
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_uframe.c b/sys/i4b/layer2/i4b_uframe.c
deleted file mode 100644
index 90e79124d29c..000000000000
--- a/sys/i4b/layer2/i4b_uframe.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_uframe.c - routines for handling U-frames
- * -----------------------------------------------
- *
- * $Id: i4b_uframe.c,v 1.6 1998/12/05 18:05:24 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:33 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process a received U-frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_u_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- int sapi = GETSAPI(*(ptr + OFF_SAPI));
- int tei = GETTEI(*(ptr + OFF_TEI));
- int pfbit = GETUPF(*(ptr + OFF_CNTL));
-
- switch(*(ptr + OFF_CNTL) & ~UPFBIT)
- {
- /* commands */
-
- case SABME:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("SABME, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXSABME);
- }
- i4b_Dfreembuf(m);
- break;
-
- case UI:
- if(sapi == SAPI_L2M &&
- tei == GROUP_TEI &&
- *(ptr + OFF_MEI) == MEI)
- {
- /* layer 2 management (SAPI = 63) */
-
- i4b_tei_rxframe(unit, m);
- }
- else if(sapi == SAPI_CCP && tei == GROUP_TEI)
- {
- /* call control (SAPI = 0) */
-
- /* strip ui header */
- m_adj(m, UI_HDR_LEN);
- /* to upper layer */
- DL_Unit_Data_Ind(unit, m);
- }
- else
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("unknown UI frame!\n"));
-
- i4b_Dfreembuf(m);
- }
- break;
-
- case DISC:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DISC, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXDISC);
- }
- i4b_Dfreembuf(m);
- break;
-
- case XID:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("XID, sapi = %d, tei = %d\n", sapi, tei));
- }
- i4b_Dfreembuf(m);
- break;
-
- /* responses */
-
- case DM:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DM, sapi = %d, tei = %d\n", sapi, tei));
-
- i4b_print_frame(m->m_len, m->m_data);
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXDM);
- }
- i4b_Dfreembuf(m);
- break;
-
- case UA:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("UA, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXUA);
- }
- i4b_Dfreembuf(m);
- break;
-
- case FRMR:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("FRMR, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXFRMR);
- }
- i4b_Dfreembuf(m);
- break;
-
- default:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
- i4b_print_frame(m->m_len, m->m_data);
- }
- else
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("not mine - UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
- i4b_print_frame(m->m_len, m->m_data);
- }
- i4b_Dfreembuf(m);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * build U-frame for sending
- *---------------------------------------------------------------------------*/
-struct mbuf *
-i4b_build_u_frame(l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(U_FRAME_LEN)) == NULL)
- return(NULL);
-
- PUTSAPI(SAPI_CCP, crbit, m->m_data[OFF_SAPI]);
-
- PUTTEI(l2sc->tei, m->m_data[OFF_TEI]);
-
- if(pbit)
- m->m_data[OFF_CNTL] = type | UPBITSET;
- else
- m->m_data[OFF_CNTL] = type & ~UPBITSET;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit SABME command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_sabme(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_sabme", ("tx SABME, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, SABME);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit DM response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_dm(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_dm", ("tx DM, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, DM);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit DISC command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_disc(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_disc", ("tx DISC, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, DISC);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit UA response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_ua(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_ua", ("tx UA, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, UA);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit FRMR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_frmr(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_frmr", ("tx FRMR, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, FRMR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_util.c b/sys/i4b/layer2/i4b_util.c
deleted file mode 100644
index 9f8fe196c56c..000000000000
--- a/sys/i4b/layer2/i4b_util.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_util.c - layer 2 utility routines
- * -------------------------------------
- *
- * $Id: i4b_util.c,v 1.15 1998/12/05 18:05:26 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:10 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * routine ESTABLISH DATA LINK (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_establish_data_link(l2_softc_t *l2sc)
-{
- i4b_l1_activate(l2sc);
-
- i4b_clear_exception_conditions(l2sc);
-
- l2sc->RC = 0;
-
- i4b_tx_sabme(l2sc, P1);
-
- i4b_T200_restart(l2sc);
-
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * routine CLEAR EXCEPTION CONDITIONS (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_clear_exception_conditions(l2_softc_t *l2sc)
-{
-
-/*XXX -------------------------------------------------------------- */
-/*XXX is this really appropriate here or should it moved elsewhere ? */
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- }
-/*XXX -------------------------------------------------------------- */
-
- l2sc->peer_busy = 0;
-
- l2sc->rej_excpt = 0;
-
- l2sc->own_busy = 0;
-
- l2sc->ack_pend = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine TRANSMIT ENQUIRE (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_transmit_enquire(l2_softc_t *l2sc)
-{
- if(l2sc->own_busy)
- i4b_tx_rnr_command(l2sc, P1);
- else
- i4b_tx_rr_command(l2sc, P1);
-
- l2sc->ack_pend = 0;
-
- i4b_T200_start(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * routine NR ERROR RECOVERY (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_nr_error_recovery(l2_softc_t *l2sc)
-{
- i4b_mdl_error_ind(l2sc, "i4b_nr_error_recovery", MDL_ERR_J);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine ENQUIRY RESPONSE (Q.921 03/93 page 84)
- *---------------------------------------------------------------------------*/
-void
-i4b_enquiry_response(l2_softc_t *l2sc)
-{
- if(l2sc->own_busy)
- i4b_tx_rnr_response(l2sc, F1);
- else
- i4b_tx_rr_response(l2sc, F1);
-
- l2sc->ack_pend = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine INVOKE RETRANSMISSION (Q.921 03/93 page 84)
- *---------------------------------------------------------------------------*/
-void
-i4b_invoke_retransmission(l2_softc_t *l2sc, int nr)
-{
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr = %d\n", nr ));
-
- while(l2sc->vs != nr)
- {
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr != vs, nr = %d, vs = %d\n", nr, l2sc->vs));
-
- M128DEC(l2sc->vs);
-
-/* XXXXXXXXXXXXXXXXX */
-
- if((l2sc->ua_num != UA_EMPTY) && (l2sc->vs == l2sc->ua_num))
- {
- IF_ENQUEUE(&l2sc->i_queue, l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- }
- else
- {
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("ERROR, l2sc->vs = %d, l2sc->ua_num = %d \n",l2sc->vs, l2sc->ua_num));
- }
-
-/* XXXXXXXXXXXXXXXXX */
-
- i4b_i_frame_queued_up(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * routine ACKNOWLEDGE PENDING (Q.921 03/93 p 70)
- *---------------------------------------------------------------------------*/
-void
-i4b_acknowledge_pending(l2_softc_t *l2sc)
-{
- if(l2sc->ack_pend)
- {
- l2sc->ack_pend = 0;
- i4b_tx_rr_response(l2sc, F0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_print_frame - just print the hex contents of a frame
- *---------------------------------------------------------------------------*/
-void
-i4b_print_frame(int len, u_char *buf)
-{
-#ifdef DO_I4B_DEBUG
- int i;
-
- if (!(i4b_l2_debug & L2_ERROR)) /* XXXXXXXXXXXXXXXXXXXXX */
- return;
-
- for(i = 0; i < len; i++)
- printf(" 0x%x", buf[i]);
- printf("\n");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_print_l2var - print some l2softc vars
- *---------------------------------------------------------------------------*/
-void
-i4b_print_l2var(l2_softc_t *l2sc)
-{
- DBGL2(L2_ERROR, "i4b_print_l2var", ("unit%d V(R)=%d, V(S)=%d, V(A)=%d,ACKP=%d,PBSY=%d,OBSY=%d\n",
- l2sc->unit,
- l2sc->vr,
- l2sc->vs,
- l2sc->va,
- l2sc->ack_pend,
- l2sc->peer_busy,
- l2sc->own_busy));
-}
-
-/*---------------------------------------------------------------------------*
- * got s or i frame, check if valid ack for last sent frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_ack(l2_softc_t *l2sc, int nr)
-{
-
-#ifdef NOTDEF
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d\n",
- nr,
- l2sc->ua_num,
- l2sc->vr,
- l2sc->vs,
- l2sc->va));
-#endif
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- int s;
-
- M128DEC(nr);
-
- if(l2sc->ua_num != nr)
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("((N(R)-1)=%d) != (UA=%d) !!!\n", nr, l2sc->ua_num));
-
- s = SPLI4B();
-
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
-
- splx(s);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * if not already active, activate layer 1
- *---------------------------------------------------------------------------*/
-void
-i4b_l1_activate(l2_softc_t *l2sc)
-{
- if(l2sc->ph_active == PH_INACTIVE)
- {
- l2sc->ph_active = PH_ACTIVEPEND;
- PH_Act_Req(l2sc->unit);
- }
-};
-
-/*---------------------------------------------------------------------------*
- * check for v(a) <= n(r) <= v(s)
- * nr = receive sequence frame counter, va = acknowledge sequence frame
- * counter and vs = transmit sequence frame counter
- *---------------------------------------------------------------------------*/
-int
-i4b_l2_nr_ok(int nr, int va, int vs)
-{
- if((va > nr) && ((nr != 0) || (va != 127)))
- {
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [1]\n", va, nr, vs));
- return 0; /* fail */
- }
-
- if((nr > vs) && ((vs != 0) || (nr != 127)))
- {
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [2]\n", va, nr, vs));
- return 0; /* fail */
- }
-
- return 1; /* good */
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer3/i4b_l2if.c b/sys/i4b/layer3/i4b_l2if.c
deleted file mode 100644
index 33b1340738ec..000000000000
--- a/sys/i4b/layer3/i4b_l2if.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2if.c - Layer 3 interface to Layer 2
- * -------------------------------------------
- *
- * $Id: i4b_l2if.c,v 1.14 1998/12/05 18:05:28 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:26 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-static unsigned char make_q931_cause(cause_t cause);
-
-/*---------------------------------------------------------------------------*
- * this converts our internal state (number) to the number specified
- * in Q.931 and is used for reporting our state in STATUS messages.
- *---------------------------------------------------------------------------*/
-int i4b_status_tab[] = {
- 0, /* ST_U0, */
- 1, /* ST_U1, */
- 3, /* ST_U3, */
- 4, /* ST_U4, */
- 6, /* ST_U6, */
- 7, /* ST_U7, */
- 8, /* ST_U8, */
- 9, /* ST_U9, */
- 10, /* ST_U10, */
- 11, /* ST_U11, */
- 12, /* ST_U12, */
- 19, /* ST_U19, */
- 6, /* ST_IWA, */
- 6, /* ST_IWR, */
- 1, /* ST_OW, */
- 6, /* ST_IWL, */
-};
-
-/*---------------------------------------------------------------------------*
- * return a valid q.931/q.850 cause from any of the internal causes
- *---------------------------------------------------------------------------*/
-static unsigned char
-make_q931_cause(cause_t cause)
-{
- register unsigned char ret;
-
- switch(GET_CAUSE_TYPE(cause))
- {
- case CAUSET_Q850:
- ret = GET_CAUSE_VAL(cause);
- break;
- case CAUSET_I4B:
- ret = cause_tab_q931[GET_CAUSE_VAL(cause)];
- break;
- default:
- panic("make_q931_cause: unknown cause type!");
- break;
- }
- ret |= EXT_LAST;
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * return status of data link
- *---------------------------------------------------------------------------*/
-int
-i4b_get_dl_stat(call_desc_t *cd)
-{
- return(ctrl_desc[cd->controller].dl_est);
-}
-
-/*---------------------------------------------------------------------------*
- * DL ESTABLISH INDICATION from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_establish_ind(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-IND", ("unit %d\n",unit));
-
- /* first set DL up in controller descriptor */
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d DL established!\n",unit));
- ctrl_desc[i].dl_est = DL_UP;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
- }
-
- found = 0;
-
- /* second, inform all (!) active call of the event */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
- next_l3state(&call_desc[i], EV_DLESTIN);
- found++;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, no cdid for unit %d found!\n", unit));
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL ESTABLISH CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_establish_cnf(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-CONF", ("unit %d\n",unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- ctrl_desc[call_desc[i].controller].dl_est = DL_UP;
-
- DBGL3(L3_MSG, "i4b_dl_establish_cnf", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
-
- next_l3state(&call_desc[i], EV_DLESTCF);
- found++;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_cnf", ("ERROR, no cdid for unit %d found!\n", unit));
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE INDICATION from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_ind(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-RELEASE-IND", ("unit %d\n",unit));
-
- /* first set controller to down */
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d DL released!\n",unit));
- ctrl_desc[i].dl_est = DL_DOWN;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_release_ind", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
- }
-
- found = 0;
-
- /* second, inform all (!) active calls of the event */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
- next_l3state(&call_desc[i], EV_DLRELIN);
- found++;
- }
- }
-
- if(found == 0)
- {
- /* this is not an error since it might be a normal call end */
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("no cdid for unit %d found\n", unit));
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_cnf(int unit)
-{
- int i;
-
- DBGL2(L2_PRIM, "DL-RELEASE-CONF", ("unit %d\n",unit));
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_cnf", ("unit=%d DL released!\n",unit));
- ctrl_desc[i].dl_est = DL_DOWN;
- return(0);
- }
- }
- DBGL3(L3_ERR, "i4b_dl_release_cnf", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_dl_data_ind - process a rx'd I-frame got from layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-IND", ("unit %d\n",unit));
-#endif
- i4b_decode_q931(unit, m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * dl_unit_data_ind - process a rx'd U-frame got from layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_unit_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-IND", ("unit %d\n",unit));
-#endif
- i4b_decode_q931(unit, m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * send CONNECT message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_connect(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx CONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_LEN)) == NULL)
- panic("i4b_l3_tx_connect: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = CONNECT; /* message type = connect */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send RELEASE COMPLETE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_release_complete(call_desc_t *cd, int send_cause_flag)
-{
- struct mbuf *m;
- u_char *ptr;
- int len = I_FRAME_HDRLEN + MSG_RELEASE_COMPLETE_LEN;
-
- DBGL3(L3_PRIM, "tx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if(send_cause_flag == 0)
- len -= 4;
-
- if((m = i4b_Dgetmbuf(len)) == NULL)
- panic("i4b_l3_tx_release_complete: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = RELEASE_COMPLETE; /* message type = release complete */
-
- if(send_cause_flag)
- {
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
- }
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send DISCONNECT message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_disconnect(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx DISCONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_DISCONNECT_LEN)) == NULL)
- panic("i4b_l3_tx_disconnect: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call ref length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = DISCONNECT; /* message type = disconnect */
-
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send SETUP message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_setup(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
- int slen = strlen(cd->src_telno);
- int dlen = strlen(cd->dst_telno);
-
- /*
- * there is one additional octet if cd->bprot == BPROT_NONE
- * NOTE: the selection of a bearer capability by a B L1
- * protocol is highly questionable and a better
- * mechanism should be used in future. (-hm)
- */
-
- DBGL3(L3_PRIM, "tx SETUP", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_SETUP_LEN + slen + dlen +
- (cd->bprot == BPROT_NONE ? 1 : 0))) == NULL)
- {
- panic("i4b_l3_tx_setup: can't allocate mbuf\n");
- }
-
- cd->crflag = CRF_ORIG; /* we are the originating side */
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call ref length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = SETUP; /* message type = setup */
-
- *ptr++ = IEI_SENDCOMPL; /* sending complete */
-
- *ptr++ = IEI_BEARERCAP; /* bearer capability */
-
- /* XXX
- * currently i have no idea if this should be switched by
- * the choosen B channel protocol or if there should be a
- * separate configuration item for the bearer capability.
- * For now, it is switched by the choosen b protocol (-hm)
- */
-
- switch(cd->bprot)
- {
- case BPROT_NONE: /* telephony */
- *ptr++ = IEI_BEARERCAP_LEN+1;
- *ptr++ = IT_CAP_SPEECH;
- *ptr++ = IT_RATE_64K;
- *ptr++ = IT_UL1_G711A;
- break;
-
- case BPROT_RHDLC: /* raw HDLC */
- *ptr++ = IEI_BEARERCAP_LEN;
- *ptr++ = IT_CAP_UNR_DIG_INFO;
- *ptr++ = IT_RATE_64K;
- break;
-
- default:
- *ptr++ = IEI_BEARERCAP_LEN;
- *ptr++ = IT_CAP_UNR_DIG_INFO;
- *ptr++ = IT_RATE_64K;
- break;
- }
-
- *ptr++ = IEI_CHANNELID; /* channel id */
- *ptr++ = IEI_CHANNELID_LEN; /* channel id length */
-
- switch(cd->channelid)
- {
- case CHAN_B1:
- *ptr++ = CHANNELID_B1;
- break;
- case CHAN_B2:
- *ptr++ = CHANNELID_B2;
- break;
- default:
- *ptr++ = CHANNELID_ANY;
- break;
- }
-
- *ptr++ = IEI_CALLINGPN; /* calling party no */
- *ptr++ = IEI_CALLINGPN_LEN+slen;/* calling party no length */
- *ptr++ = NUMBER_TYPEPLAN; /* type of number, number plan id */
- strncpy(ptr, cd->src_telno, slen);
- ptr += slen;
-
- *ptr++ = IEI_CALLEDPN; /* called party no */
- *ptr++ = IEI_CALLEDPN_LEN+dlen; /* called party no length */
- *ptr++ = NUMBER_TYPEPLAN; /* type of number, number plan id */
- strncpy(ptr, cd->dst_telno, dlen);
- ptr += dlen;
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send CONNECT ACKNOWLEDGE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_connect_ack(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_ACK_LEN)) == NULL)
- panic("i4b_l3_tx_connect_ack: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = CONNECT_ACKNOWLEDGE; /* message type = connect ack */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send STATUS message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_status(call_desc_t *cd, u_char q850cause)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx STATUS", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_STATUS_LEN)) == NULL)
- panic("i4b_l3_tx_status: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = STATUS; /* message type = connect ack */
-
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = q850cause;
-
- *ptr++ = IEI_CALLSTATE; /* call state ie */
- *ptr++ = CALLSTATE_LEN;
- *ptr++ = i4b_status_tab[cd->Q931state];
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send RELEASE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_release(call_desc_t *cd, int send_cause_flag)
-{
- struct mbuf *m;
- u_char *ptr;
- int len = I_FRAME_HDRLEN + MSG_RELEASE_LEN;
-
- DBGL3(L3_PRIM, "tx RELEASE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if(send_cause_flag == 0)
- len -= 4;
-
- if((m = i4b_Dgetmbuf(len)) == NULL)
- panic("i4b_l3_tx_release: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = RELEASE; /* message type = release complete */
-
- if(send_cause_flag)
- {
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
- }
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send ALERTING message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_alert(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_ALERT_LEN)) == NULL)
- panic("i4b_l3_tx_alert: can't allocate mbuf\n");
-
- DBGL3(L3_PRIM, "tx ALERT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = ALERT; /* message type = alert */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_l3.h b/sys/i4b/layer3/i4b_l3.h
deleted file mode 100644
index 9d05055fc537..000000000000
--- a/sys/i4b/layer3/i4b_l3.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3.h - layer 3 header file
- * ------------------------------
- *
- * $Id: i4b_l3.h,v 1.8 1998/12/05 18:05:30 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3_H_
-#define _I4B_L3_H_
-
-extern int utoc_tab[];
-extern unsigned char cause_tab_q931[];
-
-extern int i4b_aoc ( unsigned char *, call_desc_t *cd );
-extern void i4b_decode_q931 ( int unit, int msg_len, u_char *msg_ptr );
-extern int i4b_decode_q931_cs0_ie ( int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr );
-extern void i4b_decode_q931_message ( int unit, call_desc_t *cd, u_char message_type );
-extern void i4b_l3_stop_all_timers ( call_desc_t *cd );
-extern void i4b_l3_tx_alert ( call_desc_t *cd );
-extern void i4b_l3_tx_connect ( call_desc_t *cd );
-extern void i4b_l3_tx_connect_ack ( call_desc_t *cd );
-extern void i4b_l3_tx_disconnect ( call_desc_t *cd );
-extern void i4b_l3_tx_release ( call_desc_t *cd, int send_cause_flag );
-extern void i4b_l3_tx_release_complete ( call_desc_t *cd, int send_cause_flag );
-extern void i4b_l3_tx_setup ( call_desc_t *cd );
-extern void i4b_l3_tx_status ( call_desc_t *cd, u_char q850cause );
-extern int i4b_dl_data_ind ( int unit, struct mbuf *m );
-extern int i4b_dl_establish_cnf ( int unit );
-extern int i4b_dl_establish_ind ( int unit );
-extern int i4b_dl_release_cnf ( int unit );
-extern int i4b_dl_release_ind ( int unit );
-extern int i4b_dl_unit_data_ind ( int unit, struct mbuf *m );
-extern int i4b_get_dl_stat( call_desc_t *cd );
-extern int i4b_mdl_status_ind ( int unit, int status, int parm);
-extern void i4b_print_frame ( int len, u_char *buf );
-extern void next_l3state ( call_desc_t *cd, int event );
-extern char *print_l3state ( call_desc_t *cd );
-extern unsigned char setup_cr ( call_desc_t *cd, unsigned char cr );
-extern void T303_start ( call_desc_t *cd );
-extern void T303_stop ( call_desc_t *cd );
-extern void T305_start ( call_desc_t *cd );
-extern void T305_stop ( call_desc_t *cd );
-extern void T308_start ( call_desc_t *cd );
-extern void T308_stop ( call_desc_t *cd );
-extern void T309_start ( call_desc_t *cd );
-extern void T309_stop ( call_desc_t *cd );
-extern void T310_start ( call_desc_t *cd );
-extern void T310_stop ( call_desc_t *cd );
-extern void T313_start ( call_desc_t *cd );
-extern void T313_stop ( call_desc_t *cd );
-
-#endif /* _I4B_L3_H_ */
diff --git a/sys/i4b/layer3/i4b_l3fsm.c b/sys/i4b/layer3/i4b_l3fsm.c
deleted file mode 100644
index e45e1195e399..000000000000
--- a/sys/i4b/layer3/i4b_l3fsm.c
+++ /dev/null
@@ -1,1034 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3fsm.c - layer 3 FSM
- * -------------------------
- *
- * $Id: i4b_l3fsm.c,v 1.13 1998/12/05 18:05:31 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:32:17 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-
-static void F_00A(call_desc_t *cd), F_00H(call_desc_t *cd), F_00I(call_desc_t *cd);
-static void F_00J(call_desc_t *cd);
-
-static void F_01B(call_desc_t *cd), F_01K(call_desc_t *cd), F_01L(call_desc_t *cd);
-static void F_01M(call_desc_t *cd), F_01N(call_desc_t *cd), F_01U(call_desc_t *cd);
-static void F_01O(call_desc_t *cd);
-
-static void F_03C(call_desc_t *cd), F_03N(call_desc_t *cd), F_03O(call_desc_t *cd);
-static void F_03P(call_desc_t *cd), F_03Y(call_desc_t *cd);
-
-static void F_04O(call_desc_t *cd);
-
-static void F_06D(call_desc_t *cd), F_06E(call_desc_t *cd), F_06F(call_desc_t *cd);
-static void F_06G(call_desc_t *cd), F_06J(call_desc_t *cd), F_06Q(call_desc_t *cd);
-
-static void F_07E(call_desc_t *cd), F_07F(call_desc_t *cd), F_07G(call_desc_t *cd);
-
-static void F_08R(call_desc_t *cd), F_08Z(call_desc_t *cd);
-
-static void F_09D(call_desc_t *cd), F_09E(call_desc_t *cd), F_09F(call_desc_t *cd);
-static void F_09G(call_desc_t *cd);
-
-static void F_11J(call_desc_t *cd), F_11Q(call_desc_t *cd), F_11V(call_desc_t *cd);
-
-static void F_12C(call_desc_t *cd), F_12J(call_desc_t *cd);
-
-static void F_19I(call_desc_t *cd), F_19J(call_desc_t *cd), F_19K(call_desc_t *cd);
-static void F_19W(call_desc_t *cd);
-
-static void F_NCNA(call_desc_t *cd), F_STENQ(call_desc_t *cd), F_STAT(call_desc_t *cd);
-static void F_INFO(call_desc_t *cd), F_RELCP(call_desc_t *cd), F_REL(call_desc_t *cd);
-static void F_DISC(call_desc_t *cd), F_DCRQ(call_desc_t *cd), F_UEM(call_desc_t *cd);
-static void F_SIGN(call_desc_t *cd), F_DLEI(call_desc_t *cd), F_ILL(call_desc_t *cd);
-static void F_309TO(call_desc_t *cd), F_DECF(call_desc_t *cd), F_FCTY(call_desc_t *cd);
-static void F_DECF1(call_desc_t *cd), F_DECF2(call_desc_t *cd), F_DECF3(call_desc_t *cd);
-static void F_DLRI(call_desc_t *cd), F_DLRIA(call_desc_t *cd), F_DECF4(call_desc_t *cd);
-
-static char *l3state_text[N_STATES] = {
- "ST_U0 - Null",
- "ST_U1 - Out Init",
- "ST_U3 - Out Proc",
- "ST_U4 - Out Delv",
- "ST_U6 - In Pres",
- "ST_U7 - In Rxd",
- "ST_U8 - In ConReq",
- "ST_U9 - In Proc",
- "ST_U10 - Active",
- "ST_U11 - Disc Req",
- "ST_U12 - Disc Ind",
- "ST_U19 - Rel Req",
-
- "ST_IWA - In Wait EST-Accept",
- "ST_IWR - In Wait EST-Reject",
- "ST_OW - Out Wait EST",
- "ST_IWL - In Wait EST-Alert",
-
- "ST_SUSE - Subroutine sets state",
-
- "Illegal State"
-};
-
-static char *l3event_text[N_EVENTS] = {
- "EV_SETUPRQ - L4 SETUP REQ", /* setup request from L4 */
- "EV_DISCRQ - L4 DISC REQ", /* disconnect request from L4 */
- "EV_RELRQ - L4 REL REQ", /* release request from L4 */
- "EV_ALERTRQ - L4 ALERT REQ", /* alerting request from L4 */
- "EV_SETACRS - L4 accept RSP", /* setup response accept from l4 */
- "EV_SETRJRS - L4 reject RSP", /* setup response reject from l4 */
- "EV_SETDCRS - L4 ignore RSP", /* setup response dontcare from l4 */
-
- "EV_SETUP - rxd SETUP", /* incoming SETUP message from L2 */
- "EV_STATUS - rxd STATUS", /* incoming STATUS message from L2 */
- "EV_RELEASE - rxd REL", /* incoming RELEASE message from L2 */
- "EV_RELCOMP - rxd REL COMPL", /* incoming RELEASE COMPLETE from L2 */
- "EV_SETUPAK - rxd SETUP ACK", /* incoming SETUP ACK message from L2 */
- "EV_CALLPRC - rxd CALL PROC", /* incoming CALL PROCEEDING from L2 */
- "EV_ALERT - rxd ALERT", /* incoming ALERT message from L2 */
- "EV_CONNECT - rxd CONNECT", /* incoming CONNECT message from L2 */
- "EV_PROGIND - rxd PROG IND", /* incoming Progress IND from L2 */
- "EV_DISCONN - rxd DISC", /* incoming DISCONNECT message from L2 */
- "EV_CONACK - rxd CONN ACK", /* incoming CONNECT ACK message from L2 */
- "EV_STATENQ - rxd STAT ENQ", /* incoming STATUS ENQ message from L2 */
- "EV_INFO - rxd INFO", /* incoming INFO message from L2 */
- "EV_FACILITY - rxd FACILITY", /* incoming FACILITY message */
-
- "EV_T303EXP - T303 timeout", /* Timer T303 expired */
- "EV_T305EXP - T305 timeout", /* Timer T305 expired */
- "EV_T308EXP - T308 timeout", /* Timer T308 expired */
- "EV_T309EXP - T309 timeout", /* Timer T309 expired */
- "EV_T310EXP - T310 timeout", /* Timer T310 expired */
- "EV_T313EXP - T313 timeout", /* Timer T313 expired */
-
- "EV_DLESTIN - L2 DL_Est_Ind", /* dl establish indication from l2 */
- "EV_DLRELIN - L2 DL_Rel_Ind", /* dl release indication from l2 */
- "EV_DLESTCF - L2 DL_Est_Cnf", /* dl establish confirm from l2 */
- "EV_DLRELCF - L2 DL_Rel_Cnf", /* dl release confirm from l2 */
-
- "EV_ILL - Illegal event!!" /* Illegal */
-};
-
-/*---------------------------------------------------------------------------*
- * layer 3 state transition table
- *---------------------------------------------------------------------------*/
-struct l3state_tab {
- void (*func) (call_desc_t *); /* function to execute */
- int newstate; /* next state */
-} l3state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_SETUPRQ*/ {{F_00A, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DISCRQ */ {{F_ILL, ST_ILL}, {F_01B, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_NCNA, ST_U12}, {F_ILL, ST_ILL}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELRQ */ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_03C, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_12C, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ALERTRQ*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06D, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_09D, ST_U7}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETACRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06E, ST_SUSE}, {F_07E, ST_U8}, {F_ILL, ST_ILL}, {F_09E, ST_U8}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETRJRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06F, ST_SUSE}, {F_07F, ST_U0}, {F_ILL, ST_ILL}, {F_09F, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETDCRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06G, ST_U0}, {F_07G, ST_U0}, {F_ILL, ST_ILL}, {F_09G, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_SETUP */ {{F_00H, ST_U6}, {F_SIGN, ST_U1}, {F_SIGN, ST_U3}, {F_SIGN, ST_U4}, {F_SIGN, ST_U6}, {F_SIGN, ST_U7}, {F_SIGN, ST_U8}, {F_SIGN, ST_U9}, {F_SIGN, ST_U10}, {F_SIGN, ST_U11}, {F_SIGN, ST_U12}, {F_SIGN, ST_U19}, {F_SIGN, ST_IWA}, {F_SIGN, ST_IWR}, {F_SIGN, ST_OW}, {F_SIGN, ST_IWL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_STATUS */ {{F_00I, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_19I, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELEASE*/ {{F_00J, ST_U0}, {F_UEM, ST_SUSE}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_06J, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_11J, ST_U0}, {F_12J, ST_U0}, {F_19J, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELCOMP*/ {{F_NCNA, ST_U0}, {F_01K, ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_19K, ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETUPAK*/ {{F_UEM, ST_SUSE}, {F_01L, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CALLPRC*/ {{F_UEM, ST_SUSE}, {F_01M, ST_U3}, {F_NCNA, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ALERT */ {{F_UEM, ST_SUSE}, {F_01N, ST_U4}, {F_03N, ST_U4}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CONNECT*/ {{F_UEM, ST_SUSE}, {F_01O, ST_U10}, {F_03O, ST_U10}, {F_04O, ST_U10}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_PROGIND*/ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_03P, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DISCONN*/ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_06Q, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_11Q, ST_U19}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CONACK */ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_08R, ST_U10}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_STATENQ*/ {{F_STENQ,ST_U0}, {F_STENQ,ST_U1}, {F_STENQ,ST_U3}, {F_STENQ,ST_U4}, {F_STENQ,ST_U6}, {F_STENQ,ST_U7}, {F_STENQ,ST_U8}, {F_STENQ,ST_U9}, {F_STENQ,ST_U10}, {F_STENQ,ST_U11}, {F_STENQ,ST_U12}, {F_STENQ,ST_U19}, {F_STENQ,ST_IWA}, {F_STENQ,ST_IWR}, {F_STENQ,ST_OW}, {F_STENQ,ST_OW}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_INFO */ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_INFO, ST_U3}, {F_INFO, ST_U4}, {F_UEM, ST_SUSE}, {F_INFO, ST_U7}, {F_INFO, ST_U8}, {F_INFO, ST_U9}, {F_INFO, ST_U10}, {F_INFO, ST_U11}, {F_INFO, ST_U12}, {F_UEM, ST_SUSE}, {F_INFO, ST_IWA}, {F_INFO, ST_IWR}, {F_INFO, ST_OW}, {F_INFO, ST_OW}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_FACILITY*/ {{F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_T303EXP*/ {{F_ILL, ST_ILL}, {F_01U, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T305EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_11V, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T308EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_19W, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T309EXP*/ {{F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T310EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_03Y, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T313EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_08Z, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_DLESTIN*/ {{F_ILL, ST_ILL}, {F_DLEI, ST_U1}, {F_DLEI, ST_U3}, {F_DLEI, ST_U4}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLRELIN*/ {{F_NCNA, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRIA,ST_U10}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLESTCF*/ {{F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF2,ST_U8}, {F_DECF3,ST_U0}, {F_DECF1,ST_U1}, {F_DECF4,ST_U7}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLRELCF*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ILL */ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void next_l3state(call_desc_t *cd, int event)
-{
- int currstate, newstate;
-
- if(event > N_EVENTS)
- panic("i4b_l3fsm.c: event > N_EVENTS\n");
-
- currstate = cd->Q931state;
-
- if(currstate > N_STATES)
- panic("i4b_l3fsm.c: currstate > N_STATES\n");
-
- newstate = l3state_tab[event][currstate].newstate;
-
- if(newstate > N_STATES)
- panic("i4b_l3fsm.c: newstate > N_STATES\n");
-
- DBGL3(L3_F_MSG, "next_l3state", ("L3 FSM event [%s]: [%s => %s]\n",
- l3event_text[event],
- l3state_text[currstate],
- l3state_text[newstate]));
-
- /* execute function */
-
- (*l3state_tab[event][currstate].func)(cd);
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- DBGL3(L3_F_ERR, "next_l3state", ("FSM illegal state, state = %s, event = %s!\n",
- l3state_text[newstate],
- l3event_text[event]));
- }
-
- if(newstate != ST_SUSE)
- cd->Q931state = newstate;
-}
-
-/*---------------------------------------------------------------------------*
- * resturn pointer to current state description
- *---------------------------------------------------------------------------*/
-char *print_l3state(call_desc_t *cd)
-{
- return((char *) l3state_text[cd->Q931state]);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event L4 setup req
- *---------------------------------------------------------------------------*/
-static void F_00A(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00A", ("FSM function F_00A executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_OW;
- }
- else
- {
- i4b_l3_tx_setup(cd);
- cd->Q931state = ST_U1;
- }
-
- cd->T303_first_to = 1;
- T303_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event SETUP from L2
- *---------------------------------------------------------------------------*/
-static void F_00H(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00H", ("FSM function F_00H executing\n"));
- i4b_l4_connect_ind(cd); /* tell l4 we have an incoming setup */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_00I(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00I", ("FSM function F_00I executing\n"));
-
- if(cd->call_state != 0)
- {
- cd->cause_out = 101;
- i4b_l3_tx_release_complete(cd, 1); /* 1 = send cause */
- }
- cd->Q931state = ST_U0;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_00J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00J", ("FSM function F_00J executing\n"));
- i4b_l3_tx_release_complete(cd, 0); /* 0 = don't send cause */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event disconnect req from L4
- *---------------------------------------------------------------------------*/
-static void F_01B(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01B", ("FSM function F_01B executing\n"));
- /* cause from L4 */
- i4b_l3_tx_disconnect(cd);
- T303_stop(cd);
- T305_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_01K(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01K", ("FSM function F_01K executing\n"));
- T303_stop(cd);
- i4b_l4_disconnect_ind(cd); /* tell l4 we were rejected */
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event SETUP ACK from L2
- *---------------------------------------------------------------------------*/
-static void F_01L(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01L", ("FSM function F_01L executing\n"));
- T303_stop(cd);
-
- /*
- * since this implementation does NOT support overlap sending,
- * we react here as if we received a CALL PROCEEDING because
- * several PBX's react with a SETUP ACK even if the called
- * number is complete AND we sent a SENDING COMPLETE in the
- * preceeding SETUP message. (-hm)
- */
-
- T310_start(cd);
- i4b_l4_proceeding_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event CALL PROCEEDING from L2
- *---------------------------------------------------------------------------*/
-static void F_01M(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01M", ("FSM function F_01M executing\n"));
- T303_stop(cd);
- T310_start(cd);
- i4b_l4_proceeding_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event ALERT from L2 (XXX !)
- *---------------------------------------------------------------------------*/
-static void F_01N(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01N", ("FSM function F_01N executing\n"));
- T303_stop(cd);
- i4b_l4_alert_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event CONNECT from L2 (XXX !)
- *---------------------------------------------------------------------------*/
-static void F_01O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01O", ("FSM function F_01O executing\n"));
- T303_stop(cd);
- i4b_l3_tx_connect_ack(cd);
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event T303 timeout
- *---------------------------------------------------------------------------*/
-static void F_01U(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01U", ("FSM function F_01U executing\n"));
- if(cd->T303_first_to == 1)
- {
- cd->T303_first_to = 0;
- i4b_l3_tx_setup(cd);
- T303_start(cd);
- cd->Q931state = ST_U1;
- }
- else
- {
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event release req from L4
- *---------------------------------------------------------------------------*/
-static void F_03C(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03C", ("FSM function F_03C executing\n"));
- T310_stop(cd);
- cd->cause_out = 6;
- i4b_l3_tx_release(cd, 1); /* 0 = don't send cause */
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event ALERT from L2
- *---------------------------------------------------------------------------*/
-static void F_03N(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03N", ("FSM function F_03N executing\n"));
- T310_stop(cd);
- i4b_l4_alert_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event CONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_03O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03O", ("FSM function F_03O executing\n"));
- T310_stop(cd);
- i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event PROGESS IND from L2
- *---------------------------------------------------------------------------*/
-static void F_03P(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03P", ("FSM function F_03P executing\n"));
- T310_stop(cd);
-#ifdef NOTDEF
- i4b_l4_progress_ind(cd);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event T310 timeout
- *---------------------------------------------------------------------------*/
-static void F_03Y(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03Y", ("FSM function F_03Y executing\n"));
- cd->cause_out = 102; /* recovery on timer expiry */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U4 event CONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_04O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_04O", ("FSM function F_04O executing\n"));
- i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event alert req from L4
- *---------------------------------------------------------------------------*/
-static void F_06D(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06D", ("FSM function F_06D executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWL;
- }
- else
- {
- i4b_l3_tx_alert(cd);
- cd->Q931state = ST_U7;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup accept from L4
- *---------------------------------------------------------------------------*/
-static void F_06E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06E", ("FSM function F_06E executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWA;
- }
- else
- {
- i4b_l3_tx_connect(cd);
- cd->Q931state = ST_U8;
- }
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup reject from L4
- *---------------------------------------------------------------------------*/
-static void F_06F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06F", ("FSM function F_06F executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWR;
- }
- else
- {
- int s = SPLI4B();
- i4b_l3_tx_release_complete(cd, 1);
- cd->Q931state = ST_U0;
- freecd_by_cd(cd);
- splx(s);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_06G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06G", ("FSM function F_06G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_06J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06J", ("FSM function F_06J executing\n"));
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_06Q(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06Q", ("FSM function F_06Q executing\n"));
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_07E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07E", ("FSM function F_07E executing\n"));
- i4b_l3_tx_connect(cd);
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response reject from L4
- *---------------------------------------------------------------------------*/
-static void F_07F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07F", ("FSM function F_07F executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_07G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07G", ("FSM function F_07G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event CONNECT ACK from L2
- *---------------------------------------------------------------------------*/
-static void F_08R(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_08R", ("FSM function F_08R executing\n"));
- T313_stop(cd);
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event T313 timeout
- *---------------------------------------------------------------------------*/
-static void F_08Z(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_08Z", ("FSM function F_08Z executing\n"));
- cd->cause_out = 102; /* recovery on timer expiry */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event alert req from L4
- *---------------------------------------------------------------------------*/
-static void F_09D(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09D", ("FSM function F_09D executing\n"));
- i4b_l3_tx_alert(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_09E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09E", ("FSM function F_09E executing\n"));
- i4b_l3_tx_connect(cd);
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response reject from L4
- *---------------------------------------------------------------------------*/
-static void F_09F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09F", ("FSM function F_09F executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_09G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09G", ("FSM function F_09G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_11J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11J", ("FSM function F_11J executing\n"));
- T305_stop(cd);
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_11Q(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11Q", ("FSM function F_11Q executing\n"));
- T305_stop(cd);
- i4b_l3_tx_release(cd, 0);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event T305 timeout
- *---------------------------------------------------------------------------*/
-static void F_11V(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11V", ("FSM function F_11V executing\n"));
- cd->cause_out = 102;
- i4b_l3_tx_release(cd, 1);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U12 event release req from L4
- *---------------------------------------------------------------------------*/
-static void F_12C(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_12C", ("FSM function F_12C executing\n"));
- i4b_l3_tx_release(cd, 1);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U12 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_12J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_12J", ("FSM function F_12J executing\n"));
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_19I(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19I", ("FSM function F_19I executing\n"));
-
- if(cd->call_state == 0)
- {
- i4b_l4_status_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
- else
- {
- cd->Q931state = ST_U19;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_19J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19J", ("FSM function F_19J executing\n"));
- T308_stop(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_19K(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19K", ("FSM function F_19K executing\n"));
- T308_stop(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event T308 timeout
- *---------------------------------------------------------------------------*/
-static void F_19W(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19W", ("FSM function F_19W executing\n"));
- if(cd->T308_first_to == 0)
- {
- cd->T308_first_to = 1;
- i4b_l3_tx_release(cd, 0);
- T308_start(cd);
- cd->Q931state = ST_U19;
- }
- else
- {
- cd->T308_first_to = 0;
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM routine no change no action
- *---------------------------------------------------------------------------*/
-static void F_NCNA(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event STATUS ENQ from L2
- *---------------------------------------------------------------------------*/
-static void F_STENQ(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_STENQ", ("FSM function F_STENQ executing\n"));
- i4b_l3_tx_status(cd, CAUSE_Q850_STENQRSP); /* 30, resonse to stat enq */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 & 19 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_STAT(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_STAT", ("FSM function F_STAT executing\n"));
- if(cd->call_state == 0)
- {
- i4b_l4_status_ind(cd);
- cd->Q931state = ST_U0;
- freecd_by_cd(cd);
- }
- else
- {
- /* XXX !!!!!!!!!!!!!!!!!! */
-
- i4b_l4_status_ind(cd);
- cd->cause_out = 101; /* message not compatible with call state */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- cd->Q931state = ST_U11;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event INFORMATION from L2
- *---------------------------------------------------------------------------*/
-static void F_INFO(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_INFO", ("FSM function F_INFO executing\n"));
- i4b_l4_info_ind(cd);
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_RELCP(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_RELCP", ("FSM function F_RELCP executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_REL(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_REL", ("FSM function F_REL executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_DISC(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DISC", ("FSM function F_DISC executing\n"));
- i4b_l3_stop_all_timers(cd);
-
- /*
- * no disconnect ind to L4, no jump to state U12
- * instead we issue a RELEASE and jump to U19
- */
-
- i4b_l3_tx_release(cd, 0);
- cd->T308_first_to = 1;
- T308_start(cd);
- cd->Q931state = ST_U19;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event disconnect request from L4
- *---------------------------------------------------------------------------*/
-static void F_DCRQ(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DCRQ", ("FSM function F_DCRQ executing\n"));
- /* cause from L4 */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- cd->Q931state = ST_U11;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 event unexpected message from L2
- *---------------------------------------------------------------------------*/
-static void F_UEM(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_UEM", ("FSM function F_UEM executing, state = %s\n", print_l3state(cd)));
- i4b_l3_tx_status(cd, CAUSE_Q850_MSGNCWCS); /* 101, message not compatible with call state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 event SETUP from L2
- *---------------------------------------------------------------------------*/
-static void F_SIGN(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_SIGN", ("FSM function F_SIGN executing\n"));
-
-/* XXX */ /* freecd_by_cd(cd); ?????????? XXX */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM relevant states event DL ESTABLISH IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLEI(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLEI", ("FSM function F_DLEI executing\n"));
-
-/* XXX */
-
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event illegal event occured
- *---------------------------------------------------------------------------*/
-static void F_ILL(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_ILL", ("FSM function F_ILL executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event T309 timeout
- *---------------------------------------------------------------------------*/
-static void F_309TO(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_309TO", ("FSM function F_309TO executing\n"));
-
-/* XXX */
-
-#ifdef NOTDEF
- i4b_l4_dl_fail_ind(cd);
-#endif
-
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event FACILITY message received
- *---------------------------------------------------------------------------*/
-static void F_FCTY(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_FCTY", ("FSM function F_FCTY executing\n"));
- /* ST_SUSE, no change in state ! */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_OW event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF1(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF1", ("FSM function F_DECF1 executing\n"));
- i4b_l3_tx_setup(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWA event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF2(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF2", ("FSM function F_DECF2 executing\n"));
- i4b_l3_tx_connect(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWR event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF3(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF3", ("FSM function F_DECF3 executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWL event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF4(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF4", ("FSM function F_DECF4 executing\n"));
- i4b_l3_tx_alert(cd);
-}
-
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF", ("FSM function F_DECF executing\n"));
- T309_stop(cd);
- i4b_l3_tx_status(cd, CAUSE_Q850_NORMUNSP); /* 31, normal unspecified */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except U10 event DL RELEASE IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLRI(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLRI", ("FSM function F_DLRI executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U10 event DL RELEASE IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLRIA(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLRIA", ("FSM function F_DLRIA executing\n"));
-
- if(cd->T309 == TIMER_IDLE)
- T309_start(cd);
-
- DL_Est_Req(ctrl_desc[cd->controller].unit);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_l3fsm.h b/sys/i4b/layer3/i4b_l3fsm.h
deleted file mode 100644
index d69b810b45ad..000000000000
--- a/sys/i4b/layer3/i4b_l3fsm.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3fsm.c - layer 3 FSM
- * -------------------------
- *
- * $Id: i4b_l3fsm.h,v 1.5 1998/12/05 18:05:33 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:32:45 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3FSM_H_
-#define _I4B_L3FSM_H_
-
-enum Q931_states {
- ST_U0,
- ST_U1,
- ST_U3,
- ST_U4,
- ST_U6,
- ST_U7,
- ST_U8,
- ST_U9,
- ST_U10,
- ST_U11,
- ST_U12,
- ST_U19,
-
- ST_IWA, /* incoming call, wait establish, then accept */
- ST_IWR, /* incoming call, wait establish, then reject */
- ST_OW, /* outgoing call, wait establish */
- ST_IWL, /* incoming call, wait establish, then alert */
-
- ST_SUSE, /* SUBroutine SETs new state on exit */
- ST_ILL, /* Illegal */
-
- N_STATES /* number of states */
-};
-
-enum Q931_events {
-
- EV_SETUPRQ, /* setup request from L4 */
- EV_DISCRQ, /* disconnect request from L4 */
- EV_RELRQ, /* release request from L4 */
- EV_ALERTRQ, /* alerting request from L4 */
- EV_SETACRS, /* setup response accept from l4 */
- EV_SETRJRS, /* setup response reject from l4 */
- EV_SETDCRS, /* setup response dontcare from l4 */
-
- EV_SETUP, /* incoming SETUP message from L2 */
- EV_STATUS, /* incoming STATUS message from L2 */
- EV_RELEASE, /* incoming RELEASE message from L2 */
- EV_RELCOMP, /* incoming RELEASE COMPLETE from L2 */
- EV_SETUPAK, /* incoming SETUP ACK message from L2 */
- EV_CALLPRC, /* incoming CALL PROCEEDING from L2 */
- EV_ALERT, /* incoming ALERT message from L2 */
- EV_CONNECT, /* incoming CONNECT message from L2 */
- EV_PROGIND, /* incoming Progress IND from L2 */
- EV_DISCONN, /* incoming DISCONNECT message from L2 */
- EV_CONACK, /* incoming CONNECT ACK message from L2 */
- EV_STATENQ, /* incoming STATUS ENQ message from L2 */
- EV_INFO, /* incoming INFO message from L2 */
- EV_FACILITY, /* FACILITY message */
-
- EV_T303EXP, /* Timer T303 expired */
- EV_T305EXP, /* Timer T305 expired */
- EV_T308EXP, /* Timer T308 expired */
- EV_T309EXP, /* Timer T309 expired */
- EV_T310EXP, /* Timer T310 expired */
- EV_T313EXP, /* Timer T313 expired */
-
- EV_DLESTIN, /* dl establish indication from l2 */
- EV_DLRELIN, /* dl release indication from l2 */
- EV_DLESTCF, /* dl establish confirm from l2 */
- EV_DLRELCF, /* dl release indication from l2 */
-
- EV_ILL, /* Illegal */
- N_EVENTS
-};
-
-#endif /* _I4B_L3FSM_H_ */
diff --git a/sys/i4b/layer3/i4b_l3timer.c b/sys/i4b/layer3/i4b_l3timer.c
deleted file mode 100644
index 6c1a2d30122b..000000000000
--- a/sys/i4b/layer3/i4b_l3timer.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3timer.c - timer and timeout handling for layer 3
- * ------------------------------------------------------
- *
- * $Id: i4b_l3timer.c,v 1.9 1998/12/05 18:05:35 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:00 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/*---------------------------------------------------------------------------*
- * stop all layer 3 timers
- *---------------------------------------------------------------------------*/
-void i4b_l3_stop_all_timers(call_desc_t *cd)
-{
- T303_stop(cd);
- T305_stop(cd);
- T308_stop(cd);
- T309_stop(cd);
- T310_stop(cd);
- T313_stop(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T303_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T303_timeout", ("SETUP not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T303EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 start
- *---------------------------------------------------------------------------*/
-void
-T303_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T303_start", ("cr = %d\n", cd->cr));
- cd->T303 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T303_callout = timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 stop
- *---------------------------------------------------------------------------*/
-void
-T303_stop(call_desc_t *cd)
-{
- if(cd->T303 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, cd->T303_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd);
-#endif
- cd->T303 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T303_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T305_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T305_timeout", ("DISC not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T305EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 start
- *---------------------------------------------------------------------------*/
-void
-T305_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T305_start", ("cr = %d\n", cd->cr));
- cd->T305 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T305_callout = timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 stop
- *---------------------------------------------------------------------------*/
-void
-T305_stop(call_desc_t *cd)
-{
- if(cd->T305 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, cd->T305_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd);
-#endif
- cd->T305 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T305_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T308_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T308_timeout", ("REL not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T308EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 start
- *---------------------------------------------------------------------------*/
-void
-T308_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T308_start", ("cr = %d\n", cd->cr));
- cd->T308 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T308_callout = timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 stop
- *---------------------------------------------------------------------------*/
-void
-T308_stop(call_desc_t *cd)
-{
- if(cd->T308 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, cd->T308_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd);
-#endif
- cd->T308 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T308_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T309_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T309_timeout", ("datalink not reconnected, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T309EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 start
- *---------------------------------------------------------------------------*/
-void
-T309_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T309_start", ("cr = %d\n", cd->cr));
- cd->T309 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T309_callout = timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 stop
- *---------------------------------------------------------------------------*/
-void
-T309_stop(call_desc_t *cd)
-{
- if(cd->T309 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, cd->T309_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd);
-#endif
- cd->T309 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T309_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T310_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T310_timeout", ("CALL PROC timeout, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T310EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 start
- *---------------------------------------------------------------------------*/
-void
-T310_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T310_start", ("cr = %d\n", cd->cr));
- cd->T310 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T310_callout = timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 stop
- *---------------------------------------------------------------------------*/
-void
-T310_stop(call_desc_t *cd)
-{
- if(cd->T310 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, cd->T310_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd);
-#endif
- cd->T310 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T310_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T313_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T313_timeout", ("CONN ACK not received, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T313EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 start
- *---------------------------------------------------------------------------*/
-void
-T313_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T313_start", ("cr = %d\n", cd->cr));
- cd->T313 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T313_callout = timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 stop
- *---------------------------------------------------------------------------*/
-void
-T313_stop(call_desc_t *cd)
-{
- if(cd->T313 != TIMER_IDLE)
- {
- cd->T313 = TIMER_IDLE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, cd->T313_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd);
-#endif
- }
- DBGL3(L3_T_MSG, "T313_stop", ("cr = %d\n", cd->cr));
-}
-
-#endif /* NI4BQ931 > 0 */
-
diff --git a/sys/i4b/layer3/i4b_l4if.c b/sys/i4b/layer3/i4b_l4if.c
deleted file mode 100644
index 55d9bb9da445..000000000000
--- a/sys/i4b/layer3/i4b_l4if.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4if.c - Layer 3 interface to Layer 4
- * -------------------------------------------
- *
- * $Id: i4b_l4if.c,v 1.17 1998/12/05 18:05:36 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-extern void isic_settrace(int unit, int val); /*XXX*/
-extern int isic_gettrace(int unit); /*XXX*/
-
-static void n_connect_request(u_int cdid);
-static void n_connect_response(u_int cdid, int response, int cause);
-static void n_disconnect_request(u_int cdid, int cause);
-static void n_alert_request(u_int cdid);
-static void n_mgmt_command(int unit, int cmd, int parm);
-
-/*---------------------------------------------------------------------------*
- * i4b_mdl_status_ind - status indication from lower layers
- *---------------------------------------------------------------------------*/
-int
-i4b_mdl_status_ind(int unit, int status, int parm)
-{
- int sendup;
- int i;
-
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("unit = %d, status = %d, parm = %d\n", unit, status, parm));
-
- switch(status)
- {
- case STI_ATTACH:
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_ATTACH: attaching unit %d to controller %d\n", unit, nctrl));
-
- /* init function pointers */
-
- ctrl_desc[nctrl].N_CONNECT_REQUEST = n_connect_request;
- ctrl_desc[nctrl].N_CONNECT_RESPONSE = n_connect_response;
- ctrl_desc[nctrl].N_DISCONNECT_REQUEST = n_disconnect_request;
- ctrl_desc[nctrl].N_ALERT_REQUEST = n_alert_request;
- ctrl_desc[nctrl].N_SET_TRACE = isic_settrace;
- ctrl_desc[nctrl].N_GET_TRACE = isic_gettrace;
- ctrl_desc[nctrl].N_DOWNLOAD = NULL; /* only used by active cards */
- ctrl_desc[nctrl].N_DIAGNOSTICS = NULL; /* only used by active cards */
- ctrl_desc[nctrl].N_MGMT_COMMAND = n_mgmt_command;
-
- /* init type and unit */
-
- ctrl_desc[nctrl].unit = unit;
- ctrl_desc[nctrl].ctrl_type = CTRL_PASSIVE;
- ctrl_desc[nctrl].card_type = parm;
-
- /* state fields */
-
- ctrl_desc[nctrl].dl_est = DL_DOWN;
- ctrl_desc[nctrl].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[nctrl].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[nctrl].tei = -1;
-
- /* init unit to controller table */
-
- utoc_tab[unit] = nctrl;
-
- /* increment no. of controllers */
-
- nctrl++;
-
- break;
-
- case STI_L1STAT:
- i4b_l4_l12stat(unit, 1, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L1STAT: unit %d layer 1 = %s\n", unit, status ? "up" : "down"));
- break;
-
- case STI_L2STAT:
- i4b_l4_l12stat(unit, 2, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L2STAT: unit %d layer 2 = %s\n", unit, status ? "up" : "down"));
- break;
-
- case STI_TEIASG:
- ctrl_desc[unit].tei = parm;
- i4b_l4_teiasg(unit, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_TEIASG: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
- break;
-
- case STI_PDEACT: /* L1 T4 timeout */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_PDEACT: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
-
- sendup = 0;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- sendup++;
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
-
- if(sendup)
- i4b_l4_pdeact(unit, sendup);
- break;
-
- case STI_NOL1ACC: /* no outgoing access to S0 */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_NOL1ACC: unit %d no outgoing access to S0\n", unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- {
- SET_CAUSE_TYPE(call_desc[i].cause_in, CAUSET_I4B);
- SET_CAUSE_VAL(call_desc[i].cause_in, CAUSE_I4B_L1ERROR);
- i4b_l4_disconnect_ind(&(call_desc[i]));
- }
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- default:
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("ERROR, unit %d, unknown status value %d!\n", unit, status));
- break;
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * send command to the lower layers
- *---------------------------------------------------------------------------*/
-static void
-n_mgmt_command(int unit, int cmd, int parm)
-{
- int i;
-
- switch(cmd)
- {
- case CMR_DOPEN:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DOPEN for unit %d\n", unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- call_desc[i].cdid = CDID_UNUSED;
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- case CMR_DCLOSE:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DCLOSE for unit %d\n", unit));
- break;
-
- default:
- break;
-
- }
-
- MDL_Command_Req(unit, cmd, parm);
-
-}
-
-/*---------------------------------------------------------------------------*
- * handle connect request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_connect_request(u_int cdid)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- next_l3state(cd, EV_SETUPRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle setup response message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_connect_response(u_int cdid, int response, int cause)
-{
- call_desc_t *cd;
- int chstate;
-
- cd = cd_by_cdid(cdid);
-
- T400_stop(cd);
-
- cd->response = response;
- cd->cause_out = cause;
-
- switch(response)
- {
- case SETUP_RESP_ACCEPT:
- next_l3state(cd, EV_SETACRS);
- chstate = BCH_ST_USED;
- break;
-
- case SETUP_RESP_REJECT:
- next_l3state(cd, EV_SETRJRS);
- chstate = BCH_ST_FREE;
- break;
-
- case SETUP_RESP_DNTCRE:
- next_l3state(cd, EV_SETDCRS);
- chstate = BCH_ST_FREE;
- break;
-
- default: /* failsafe */
- next_l3state(cd, EV_SETDCRS);
- chstate = BCH_ST_FREE;
- DBGL3(L3_ERR, "n_connect_response", ("unknown response, doing SETUP_RESP_DNTCRE"));
- break;
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = chstate;
- }
- else
- {
- DBGL3(L3_ERR, "n_connect_response", ("ERROR, invalid channel %d\n", cd->channelid));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle disconnect request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_disconnect_request(u_int cdid, int cause)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- cd->cause_out = cause;
-
- next_l3state(cd, EV_DISCRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle alert request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_alert_request(u_int cdid)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- next_l3state(cd, EV_ALERTRQ);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q931.c b/sys/i4b/layer3/i4b_q931.c
deleted file mode 100644
index 6c111d101228..000000000000
--- a/sys/i4b/layer3/i4b_q931.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q931.c - Q931 received messages handling
- * --------------------------------------------
- *
- * $Id: i4b_q931.c,v 1.18 1998/12/05 18:05:38 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifndef __FreeBSD__
-#define memcpy(d,s,l) bcopy(s,d,l)
-#endif
-
-unsigned int i4b_l3_debug = L3_DEBUG_DEFAULT;
-
-call_desc_t call_desc[N_CALL_DESC]; /* call descriptor array */
-ctrl_desc_t ctrl_desc[MAX_CONTROLLERS]; /* controller description array */
-int utoc_tab[MAX_CONTROLLERS]; /* unit to controller conversion */
-
-/* protocol independent causes -> Q.931 causes */
-
-unsigned char cause_tab_q931[CAUSE_I4B_MAX] = {
- CAUSE_Q850_NCCLR, /* CAUSE_I4B_NORMAL -> normal call clearing */
- CAUSE_Q850_USRBSY, /* CAUSE_I4B_BUSY -> user busy */
- CAUSE_Q850_NOCAVAIL, /* CAUSE_I4B_NOCHAN -> no circuit/channel available*/
- CAUSE_Q850_INCDEST, /* CAUSE_I4B_INCOMP -> incompatible destination */
- CAUSE_Q850_CALLREJ, /* CAUSE_I4B_REJECT -> call rejected */
- CAUSE_Q850_DSTOOORDR, /* CAUSE_I4B_OOO -> destination out of order */
- CAUSE_Q850_TMPFAIL, /* CAUSE_I4B_TMPFAIL -> temporary failure */
-};
-
-/*---------------------------------------------------------------------------*
- * setup cr ref flag according to direction
- *---------------------------------------------------------------------------*/
-unsigned char
-setup_cr(call_desc_t *cd, unsigned char cr)
-{
- if(cd->crflag == CRF_ORIG)
- return(cr & 0x7f); /* clear cr ref flag */
- else if(cd->crflag == CRF_DEST)
- return(cr | 0x80); /* set cr ref flag */
- else
- panic("setup_cr: invalid crflag!\n");
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process a Q.931 message
- *---------------------------------------------------------------------------*/
-void
-i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
-{
- call_desc_t *cd;
- int codeset = CODESET_0;
- int old_codeset = CODESET_0;
- int shift_flag = UNSHIFTED;
- int crlen = 0;
- int crval = 0;
- int crflag = 0;
- int i;
- int offset;
- int s;
-
- /* check protocol discriminator */
-
- if(*msg_ptr != PD_Q931)
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("protocol discriminator 0x%x != Q.931\n", *msg_ptr));
- return;
- }
- msg_ptr++;
- msg_len--;
-
- s = SPLI4B(); /* this has to be protected ! */
-
- /* extract call reference */
-
- crlen = *msg_ptr & CRLENGTH_MASK;
- msg_ptr++;
- msg_len--;
-
- if(crlen != 0)
- {
- crval += *msg_ptr & 0x7f;
- crflag = (*msg_ptr >> 7) & 0x01;
- msg_ptr++;
- msg_len--;
-
- for(i=1; i < crlen; i++)
- {
- crval += *msg_ptr;
- msg_ptr++;
- msg_len--;
- }
- }
- else
- {
- crval = 0;
- crflag = 0;
- }
-
- DBGL3(L3_P_MSG, "i4b_decode_q931", ("Call Ref, len %d, val %d, flag %d\n", crlen, crval, crflag));
-
- /* find or allocate calldescriptor */
-
- if((cd = cd_by_unitcr(unit, crval,
- crflag == CRF_DEST ? CRF_ORIG : CRF_DEST)) == NULL)
- {
- if(*msg_ptr == SETUP)
- {
- /* get and init new calldescriptor */
-
- cd = reserve_cd(); /* cdid filled in */
- cd->controller = utoc_tab[unit];
- cd->cr = crval;
- cd->crflag = CRF_DEST; /* we are the dest side */
- cd->ilt = NULL; /* reset link tab ptrs */
- cd->dlt = NULL;
- }
- else
- {
-/*XXX*/ if(crval != 0) /* ignore global call references */
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("cannot find calldescriptor for cr = 0x%x, crflag = 0x%x, msg = 0x%x, frame = ", crval, crflag, *msg_ptr));
- i4b_print_frame(msg_len, msg_ptr);
- }
- splx(s);
- return;
- }
- }
-
- splx(s);
-
- /* decode and handle message type */
-
- i4b_decode_q931_message(unit, cd, *msg_ptr);
- msg_ptr++;
- msg_len--;
-
- /* process information elements */
-
- while(msg_len > 0)
- {
- /* check for shift codeset IE */
-
- if((*msg_ptr & 0x80) && ((*msg_ptr & 0xf0) == SOIE_SHIFT))
- {
- if(!(*msg_ptr & SHIFT_LOCK))
- shift_flag = SHIFTED;
-
- old_codeset = codeset;
- codeset = *msg_ptr & CODESET_MASK;
-
- if((shift_flag != SHIFTED) &&
- (codeset <= old_codeset))
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("Q.931 lockingshift proc violation, shift %d -> %d\n", old_codeset, codeset));
- codeset = old_codeset;
- }
- msg_len--;
- msg_ptr++;
- }
-
- /* process one IE for selected codeset */
-
- switch(codeset)
- {
- case CODESET_0:
- offset = i4b_decode_q931_cs0_ie(unit, cd, msg_len, msg_ptr);
- msg_len -= offset;
- msg_ptr += offset;
- break;
-
- default:
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("unknown codeset %d, ", codeset));
- i4b_print_frame(msg_len, msg_ptr);
- msg_len = 0;
- break;
- }
-
- /* check for non-locking shifts */
-
- if(shift_flag == SHIFTED)
- {
- shift_flag = UNSHIFTED;
- codeset = old_codeset;
- }
- }
- next_l3state(cd, cd->event);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process one Q.931 codeset 0 information element
- *---------------------------------------------------------------------------*/
-int
-i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
-{
- int i, j;
- char *p;
-
- switch(*msg_ptr)
- {
- /* single byte IE's */
-
- case IEI_SENDCOMPL:
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_SENDCOMPL\n"));
- return(1);
- break;
-
- /* multi byte IE's */
-
- case IEI_BEARERCAP: /* bearer capability */
- switch(msg_ptr[2])
- {
- case 0x80: /* speech */
- case 0x89: /* restricted digital info */
- case 0x90: /* 3.1KHz audio */
-/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - Telephony\n"));
- break;
-
- case 0x88: /* unrestricted digital info */
-/* XXX */ cd->bprot = BPROT_RHDLC;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - Raw HDLC\n"));
- break;
-
- default:
-/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - No Protocol\n"));
- break;
- }
- break;
-
- case IEI_CAUSE: /* cause */
- if(msg_ptr[2] & 0x80)
- {
- cd->cause_in = msg_ptr[3] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[3] & 0x7f));
- }
- else
- {
- cd->cause_in = msg_ptr[4] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[4] & 0x7f));
- }
- break;
-
- case IEI_CHANNELID: /* channel id */
- if((msg_ptr[2] & 0xf4) != 0x80)
- {
- cd->channelid = CHAN_NO;
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("IEI_CHANNELID, unsupported value 0x%x\n", msg_ptr[2]));
- }
- else
- {
- switch(msg_ptr[2] & 0x03)
- {
- case IE_CHAN_ID_NO:
- cd->channelid = CHAN_NO;
- break;
- case IE_CHAN_ID_B1:
- cd->channelid = CHAN_B1;
- break;
- case IE_CHAN_ID_B2:
- cd->channelid = CHAN_B2;
- break;
- case IE_CHAN_ID_ANY:
- cd->channelid = CHAN_ANY;
- break;
- }
- cd->channelexcl = (msg_ptr[2] & 0x08) >> 3;
-
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CHANNELID - channel %d, exclusive = %d\n", cd->channelid, cd->channelexcl));
-
- /* if this is a setup message, reserve channel */
-
- if(cd->event == EV_SETUP)
- {
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- if(ctrl_desc[cd->controller].bch_state[cd->channelid] == BCH_ST_FREE)
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_RSVD;
- else
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("IE ChannelID, Channel NOT free!!\n"));
- }
- else if(cd->channelid == CHAN_NO)
- {
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IE ChannelID, SETUP with channel = No channel (CW)\n"));
- }
- else /* cd->channelid == CHAN_ANY */
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("ERROR: IE ChannelID, SETUP with channel = Any channel!\n"));
- }
- }
- }
- break;
-
- case IEI_CALLINGPN: /* calling party no */
- if(msg_ptr[2] & 0x80) /* no presentation/screening indicator ? */
- {
- memcpy(cd->src_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
- cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 1)] = '\0';
- cd->scr_ind = SCR_NONE;
- }
- else
- {
- memcpy(cd->src_telno, &msg_ptr[4], min(TELNO_MAX, msg_ptr[1]-2));
- cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 2)] = '\0';
- cd->scr_ind = (msg_ptr[3] & 0x03) + SCR_USR_NOSC;
- }
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLINGPN = %s\n", cd->src_telno));
- break;
-
- case IEI_CALLEDPN: /* called party number */
- memcpy(cd->dst_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
- cd->dst_telno[min(TELNO_MAX, msg_ptr [1] - 1)] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLED = %s\n", cd->dst_telno));
- break;
-
- case IEI_CALLSTATE: /* call state */
- cd->call_state = msg_ptr[2] & 0x3f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLSTATE = %d\n", cd->call_state));
- break;
-
- case IEI_PROGRESSI: /* progress indicator */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_PROGRESSINDICATOR\n"));
- break;
-
- case IEI_DISPLAY: /* display */
- /* CHANGED BY <chris@medis.de> */
- memcpy(cd->display, &msg_ptr[2], min(DISPLAY_MAX, msg_ptr[1]));
- cd->display[min(DISPLAY_MAX, msg_ptr[1])] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_DISPLAY = %s\n", cd->display));
- break;
-
- case IEI_DATETIME: /* date/time */
- i = 2;
- j = msg_ptr[1];
- p = &(cd->datetime[0]);
- *p = '\0';
-
- for(j = msg_ptr[1]; j > 0; j--, i++)
- sprintf(p+strlen(p), "%02d", msg_ptr[i]);
-
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_DATETIME = %s\n", cd->datetime));
- break;
-
- case IEI_FACILITY: /* facility */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_FACILITY\n"));
- if(i4b_aoc(msg_ptr, cd) > -1)
- i4b_l4_charging_ind(cd);
- break;
-
- case IEI_CONCTDNO: /* connected number */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CONCTDNO\n"));
- break;
-
- case IEI_NETSPCFAC: /* network specific fac */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_NETSPCFAC\n"));
- break;
-
- case IEI_LLCOMPAT: /* low layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_LLCOMPAT\n"));
- break;
-
- case IEI_HLCOMPAT: /* high layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_HLCOMPAT\n"));
- break;
-
- default:
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("Unknown IE %d - ", *msg_ptr));
- i4b_print_frame(msg_ptr[1]+2, msg_ptr);
- break;
- }
- return(msg_ptr[1] + 2);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process one Q.931 codeset 0 information element
- *---------------------------------------------------------------------------*/
-void
-i4b_decode_q931_message(int unit, call_desc_t *cd, u_char message_type)
-{
- cd->event = EV_ILL;
-
- switch(message_type)
- {
- /* call establishment */
-
- case ALERT:
- cd->event = EV_ALERT;
- DBGL3(L3_PRIM, "rx ALERT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case CALL_PROCEEDING:
- cd->event = EV_CALLPRC;
- DBGL3(L3_PRIM, "rx CALL-PROC", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case PROGRESS:
- cd->event = EV_PROGIND;
- DBGL3(L3_PRIM, "rx PROGRESS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SETUP:
- DBGL3(L3_PRIM, "rx SETUP", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->bprot = BPROT_NONE;
- cd->cause_in = 0;
- cd->cause_out = 0;
- cd->dst_telno[0] = '\0';
- cd->src_telno[0] = '\0';
- cd->channelid = CHAN_NO;
- cd->channelexcl = 0;
- cd->display[0] = '\0';
- cd->datetime[0] = '\0';
- cd->event = EV_SETUP;
- break;
-
- case CONNECT:
- DBGL3(L3_PRIM, "rx CONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->datetime[0] = '\0';
- cd->event = EV_CONNECT;
- break;
-
- case SETUP_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SETUP-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_SETUPAK;
- break;
-
- case CONNECT_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_CONACK;
- break;
-
- /* call information */
-
- case USER_INFORMATION:
- DBGL3(L3_PRIM, "rx USER-INFO", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND_REJECT:
- DBGL3(L3_PRIM, "rx SUSPEND-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME_REJECT:
- DBGL3(L3_PRIM, "rx RESUME-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD:
- DBGL3(L3_PRIM, "rx HOLD", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND:
- DBGL3(L3_PRIM, "rx SUSPEND", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME:
- DBGL3(L3_PRIM, "rx RESUME", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx HOLD-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SUSPEND-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESUME-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD_REJECT:
- DBGL3(L3_PRIM, "rx HOLD-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE:
- DBGL3(L3_PRIM, "rx RETRIEVE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RETRIEVE-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE_REJECT:
- DBGL3(L3_PRIM, "rx RETRIEVE-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- /* call clearing */
-
- case DISCONNECT:
- DBGL3(L3_PRIM, "rx DISCONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_DISCONN;
- break;
-
- case RESTART:
- DBGL3(L3_PRIM, "rx RESTART", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RELEASE:
- DBGL3(L3_PRIM, "rx RELEASE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_RELEASE;
- break;
-
- case RESTART_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESTART-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RELEASE_COMPLETE:
- DBGL3(L3_PRIM, "rx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_RELCOMP;
- break;
-
- /* misc messages */
-
- case SEGMENT:
- DBGL3(L3_PRIM, "rx SEGMENT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case FACILITY:
- DBGL3(L3_PRIM, "rx FACILITY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_FACILITY;
- break;
-
- case REGISTER:
- DBGL3(L3_PRIM, "rx REGISTER", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case NOTIFY:
- DBGL3(L3_PRIM, "rx NOTIFY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case STATUS_ENQUIRY:
- DBGL3(L3_PRIM, "rx STATUS-ENQ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_STATENQ;
- break;
-
- case CONGESTION_CONTROL:
- DBGL3(L3_PRIM, "rx CONGESTION-CONTROL", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case INFORMATION:
- DBGL3(L3_PRIM, "rx INFORMATION", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_INFO;
- break;
-
- case STATUS:
- DBGL3(L3_PRIM, "rx STATUS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_STATUS;
- break;
-
- default:
- DBGL3(L3_P_ERR, "rx UNKNOWN msg", ("unit %d, cr = 0x%02x, msg = 0x%02x\n", unit, cd->cr, message_type));
- break;
- }
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q931.h b/sys/i4b/layer3/i4b_q931.h
deleted file mode 100644
index cb916b045fd0..000000000000
--- a/sys/i4b/layer3/i4b_q931.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q931.h - Q931 handling header file
- * --------------------------------------
- *
- * $Id: i4b_q931.h,v 1.5 1998/12/05 18:05:39 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:53 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_Q931_H_
-#define _I4B_Q931_H_
-
-/* extension bit */
-
-#define EXT_LAST 0x80 /* last octett */
-
-/* reserve space in mbuf */
-
-#define I_FRAME_HDRLEN 4 /* to be added by layer 2 */
-
-/* SHIFT */
-
-#define CODESET_MASK 0x07
-#define UNSHIFTED 0
-#define SHIFTED 1
-#define CRLENGTH_MASK 0x0f
-
-/* CONNECT */
-
-#define MSG_CONNECT_LEN 4 /* length of a connect message */
-
-/* DISCONNECT */
-
-#define MSG_DISCONNECT_LEN 8 /* length of a disconnect message */
-
-/* RELEASE COMPLETE */
-
-#define MSG_RELEASE_COMPLETE_LEN 8 /* length of release complete msg */
-
-/* for outgoing causes */
-
-#define CAUSE_LEN 2
-#define CAUSE_STD_LOC_OUT 0x80 /* std = CCITT, loc = user */
-
-/* SETUP */
-
-#define MSG_SETUP_LEN 18 /* without number strings ! */
-
-#define IEI_BEARERCAP_LEN 2 /* 2 octetts lenght */
-
-#define IT_CAP_SPEECH 0x80 /* BC: information xfer capability */
-#define IT_CAP_UNR_DIG_INFO 0x88 /* BC: information xfer capability */
-
-#define IT_RATE_64K 0x90 /* BC: information xfer rate */
-#define IT_UL1_G711A 0xa3 /* layer1 proto G.711 A-law */
-
-#define IEI_CHANNELID_LEN 0x01 /* length of channel id */
-#define CHANNELID_B1 0x81 /* channel = B1 (outgoing) */
-#define CHANNELID_B2 0x82 /* channel = B2 (outgoing) */
-#define CHANNELID_ANY 0x83 /* channel = any channel (outgoing) */
-
-#define IE_CHAN_ID_NO 0x00 /* no channel (incoming) */
-#define IE_CHAN_ID_B1 0x01 /* B1 channel (incoming) */
-#define IE_CHAN_ID_B2 0x02 /* B2 channel (incoming) */
-#define IE_CHAN_ID_ANY 0x03 /* ANY channel (incoming) */
-
-#define NUMBER_TYPEPLAN 0x81 /* type of number/numbering plan */
-
-#define IEI_CALLINGPN_LEN 1 /* without number string ! */
-
-#define IEI_CALLEDPN_LEN 1 /* without number string ! */
-
-/* CONNECT_ACK */
-
-#define MSG_CONNECT_ACK_LEN 4 /* length of a connect ack message */
-
-/* STATUS */
-
-#define MSG_STATUS_LEN 11
-#define CALLSTATE_LEN 1
-
-/* RELEASE */
-
-#define MSG_RELEASE_LEN 8 /* length of release msg */
-
-/* ALERT */
-
-#define MSG_ALERT_LEN 4 /* length of a alert message */
-
-#endif /* _I4B_Q931_H_ */
diff --git a/sys/i4b/layer3/i4b_q932fac.c b/sys/i4b/layer3/i4b_q932fac.c
deleted file mode 100644
index 487ce004c144..000000000000
--- a/sys/i4b/layer3/i4b_q932fac.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q932fac.c - Q932 facility handling
- * --------------------------------------
- *
- * $Id: i4b_q932fac.c,v 1.5 1998/12/05 18:05:41 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:34:11 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-#include <i4b/layer3/i4b_q932fac.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-static int do_component(int length);
-static void next_state(int class, int form, int code, int val);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-static int units;
-static int operation_value;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-i4b_aoc(unsigned char *buf, call_desc_t *cd)
-{
- int len;
-
- cd->units_type = CHARGE_INVALID;
- cd->units = -1;
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- break;
-
- case FAC_PROTO_CMIP:
- DBGL3(L3_A_MSG, "i4b_facility", ("CMIP Protocol (Q.941), UNSUPPORTED\n"));
- return(-1);
- break;
-
- case FAC_PROTO_ACSE:
- DBGL3(L3_A_MSG, "i4b_facility", ("ACSE Protocol (X.217/X.227), UNSUPPORTED!\n"));
- return(-1);
- break;
-
- default:
- DBGL3(L3_A_ERR, "i4b_facility", ("Unknown Protocol, UNSUPPORTED!\n"));
- return(-1);
- break;
- }
-
- DBGL3(L3_A_MSG, "i4b_facility", ("Remote Operations Protocol\n"));
-
- /* next byte */
-
- buf++;
- len--;
-
- /* initialize variables for do_component */
-
- byte_len = 0;
- byte_buf = buf;
- state = ST_EXP_COMP_TYP;
-
- /* decode facility */
-
- do_component(len);
-
- switch(operation_value)
- {
- case FAC_OPVAL_AOC_D_CUR:
- cd->units_type = CHARGE_AOCD;
- cd->units = 0;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_D_UNIT:
- cd->units_type = CHARGE_AOCD;
- cd->units = units;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_E_CUR:
- cd->units_type = CHARGE_AOCE;
- cd->units = 0;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_E_UNIT:
- cd->units_type = CHARGE_AOCE;
- cd->units = units;
- return(0);
- break;
-
- default:
- cd->units_type = CHARGE_INVALID;
- cd->units = -1;
- return(-1);
- break;
- }
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length)
-{
- int comp_tag_class; /* component tag class */
- int comp_tag_form; /* component form: constructor or primitive */
- int comp_tag_code; /* component code depending on class */
- int comp_length = 0; /* component length */
-
-again:
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- break;
- case FAC_TAGCLASS_APW:
- break;
- case FAC_TAGCLASS_COS:
- break;
- case FAC_TAGCLASS_PRU:
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- if(comp_tag_code == 0x1f)
- {
- comp_tag_code = 0;
-
- byte_buf++;
- byte_len++;
-
- while(*byte_buf & 0x80)
- {
- comp_tag_code += (*byte_buf & 0x7f);
- byte_buf++;
- byte_len++;
- }
- comp_tag_code += (*byte_buf & 0x7f);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- comp_length = 0;
-
- if(*byte_buf & 0x80)
- {
- int i = *byte_buf & 0x7f;
-
- byte_len += i;
-
- for(;i > 0;i++)
- {
- byte_buf++;
- comp_length += (*byte_buf * (i*256));
- }
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- }
-
- next_state(comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length);
- }
- else
- {
- int val = 0;
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- switch(comp_tag_code)
- {
- case FAC_CODEUNI_INT:
- case FAC_CODEUNI_ENUM:
- case FAC_CODEUNI_BOOL:
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- }
- }
- break;
- default:
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- byte_buf++;
- byte_len++;
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- }
- }
- }
- next_state(comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
-
- if(byte_len < length)
- goto again;
-
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(int val)
-{
- if(val == -1)
- {
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- * invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Invoke ID = %d\n", val));
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Operation Value = %d\n", val));
-
- operation_value = val;
-
- if((val == FAC_OPVAL_AOC_D_UNIT) || (val == FAC_OPVAL_AOC_E_UNIT))
- {
- units = 0;
- state = ST_EXP_INFO;
- }
- else
- {
- state = ST_EXP_NIX;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * specific charging units
- *---------------------------------------------------------------------------*/
-static void
-F_4(int val)
-{
- if(val == -1)
- state = ST_EXP_RUL;
-}
-
-/*---------------------------------------------------------------------------*
- * free of charge
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(int val)
-{
- if(val == -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Free of Charge\n"));
- /* units = 0; XXXX */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * charge not available
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(int val)
-{
- if(val == -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Charge not available\n"));
- /* units = -1; XXXXXX ??? */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * recorded units list
- *---------------------------------------------------------------------------*/
-static void
-F_5(int val)
-{
- if(val == -1)
- state = ST_EXP_RU;
-}
-
-/*---------------------------------------------------------------------------*
- * recorded units
- *---------------------------------------------------------------------------*/
-static void
-F_6(int val)
-{
- if(val == -1)
- state = ST_EXP_RNOU;
-}
-
-/*---------------------------------------------------------------------------*
- * number of units
- *---------------------------------------------------------------------------*/
-static void
-F_7(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Number of Units = %d\n", val));
- units = val;
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * subtotal/total
- *---------------------------------------------------------------------------*/
-static void
-F_8(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Subtotal/Total = %d\n", val));
- /* type_of_charge = val; */
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * billing_id
- *---------------------------------------------------------------------------*/
-static void
-F_9(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Billing ID = %d\n", val));
- /* billing_id = val; */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static struct statetab {
- int currstate; /* input: current state we are in */
- int form; /* input: current tag form */
- int class; /* input: current tag class */
- int code; /* input: current tag code */
- void (*func)(int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_1_1 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 2, F_1_2 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 3, F_1_3 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 4, F_1_4 },
- {ST_EXP_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_2 },
- {ST_EXP_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_3 },
- {ST_EXP_INFO, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_4 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_NULL, F_4_1 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_4_2 },
- {ST_EXP_RUL, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_5 },
- {ST_EXP_RU, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_6 },
- {ST_EXP_RNOU, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_7 },
- {ST_EXP_TOCI, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_8 },
- {ST_EXP_DBID, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_9 },
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(int class, int form, int code, int val)
-{
- int i;
-
- for(i=0; ; i++)
- {
- if((statetab[i].currstate > state) ||
- (statetab[i].currstate == -1))
- {
- break;
- }
-
- if((statetab[i].currstate == state) &&
- (statetab[i].form == form) &&
- (statetab[i].class == class) &&
- (statetab[i].code == code))
- {
- (*statetab[i].func)(val);
- break;
- }
- }
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q932fac.h b/sys/i4b/layer3/i4b_q932fac.h
deleted file mode 100644
index d7544a86e020..000000000000
--- a/sys/i4b/layer3/i4b_q932fac.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q932fac.h - Q932 facility handling header file
- * --------------------------------------------------
- *
- * $Id: i4b_q932fac.h,v 1.5 1998/12/18 17:17:57 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:17:23 1998]
- *
- *---------------------------------------------------------------------------
- *
- * - Q.932 (03/93) Generic Procedures for the Control of
- * ISDN Supplementaty Services
- * - Q.950 (03/93) Supplementary Services Protocols, Structure and
- * General Principles
- * - ETS 300 179 (10/92) Advice Of Charge: charging information during
- * the call (AOC-D) supplementary service Service description
- * - ETS 300 180 (10/92) Advice Of Charge: charging information at the
- * end of call (AOC-E) supplementary service Service description
- * - ETS 300 181 (04/93) Advice Of Charge (AOC) supplementary service
- * Functional capabilities and information flows
- * - ETS 300 182 (04/93) Advice Of Charge (AOC) supplementary service
- * Digital Subscriber Signalling System No. one (DSS1) protocol
- * - X.208 Specification of Abstract Syntax Notation One (ASN.1)
- * - X.209 Specification of Basic Encoding Rules for
- * Abstract Syntax Notation One (ASN.1)
- * - "ASN.1 Abstract Syntax Notation One", Walter Gora, DATACOM-Verlag
- * 1992, 3rd Edition (ISBN 3-89238-062-7) (german !)
- *
- *---------------------------------------------------------------------------*/
-
-/* protocols */
-#define FAC_PROTO_ROP 0x11
-#define FAC_PROTO_CMIP 0x12
-#define FAC_PROTO_ACSE 0x13
-
-/* tag classes */
-#define FAC_TAGCLASS_UNI 0x00
-#define FAC_TAGCLASS_APW 0x01
-#define FAC_TAGCLASS_COS 0x02
-#define FAC_TAGCLASS_PRU 0x03
-
-/* tag forms */
-#define FAC_TAGFORM_PRI 0x00
-#define FAC_TAGFORM_CON 0x01
-
-/* class UNIVERSAL values */
-#define FAC_CODEUNI_BOOL 1
-#define FAC_CODEUNI_INT 2
-#define FAC_CODEUNI_BITS 3
-#define FAC_CODEUNI_OCTS 4
-#define FAC_CODEUNI_NULL 5
-#define FAC_CODEUNI_OBJI 6
-#define FAC_CODEUNI_OBJD 7
-#define FAC_CODEUNI_EXT 8
-#define FAC_CODEUNI_REAL 9
-#define FAC_CODEUNI_ENUM 10
-#define FAC_CODEUNI_R11 11
-#define FAC_CODEUNI_R12 12
-#define FAC_CODEUNI_R13 13
-#define FAC_CODEUNI_R14 14
-#define FAC_CODEUNI_R15 15
-#define FAC_CODEUNI_SEQ 16
-#define FAC_CODEUNI_SET 17
-#define FAC_CODEUNI_NSTR 18
-#define FAC_CODEUNI_PSTR 19
-#define FAC_CODEUNI_TSTR 20
-#define FAC_CODEUNI_VSTR 21
-#define FAC_CODEUNI_ISTR 22
-#define FAC_CODEUNI_UTIME 23
-#define FAC_CODEUNI_GTIME 24
-#define FAC_CODEUNI_GSTR 25
-#define FAC_CODEUNI_VISTR 26
-#define FAC_CODEUNI_GNSTR 27
-
-/* operation values */
-#define FAC_OPVAL_UUS 1
-#define FAC_OPVAL_CUG 2
-#define FAC_OPVAL_MCID 3
-#define FAC_OPVAL_BTPY 4
-#define FAC_OPVAL_ETPY 5
-#define FAC_OPVAL_ECT 6
-
-#define FAC_OPVAL_DIV_ACT 7
-#define FAC_OPVAL_DIV_DEACT 8
-#define FAC_OPVAL_DIV_ACTSN 9
-#define FAC_OPVAL_DIV_DEACTSN 10
-#define FAC_OPVAL_DIV_INTER 11
-#define FAC_OPVAL_DIV_INFO 12
-#define FAC_OPVAL_DIV_CALLDEF 13
-#define FAC_OPVAL_DIV_CALLRER 14
-#define FAC_OPVAL_DIV_LINF2 15
-#define FAC_OPVAL_DIV_INVS 16
-#define FAC_OPVAL_DIV_INTER1 17
-#define FAC_OPVAL_DIV_LINF1 18
-#define FAC_OPVAL_DIV_LINF3 19
-
-#define FAC_OPVAL_ER_CRCO 20
-#define FAC_OPVAL_ER_MGMT 21
-#define FAC_OPVAL_ER_CANC 22
-
-#define FAC_OPVAL_MLPP_QUERY 24
-#define FAC_OPVAL_MLPP_CALLR 25
-#define FAC_OPVAL_MLPP_CALLP 26
-
-#define FAC_OPVAL_AOC_REQ 30
-#define FAC_OPVAL_AOC_S_CUR 31
-#define FAC_OPVAL_AOC_S_SPC 32
-#define FAC_OPVAL_AOC_D_CUR 33
-#define FAC_OPVAL_AOC_D_UNIT 34
-#define FAC_OPVAL_AOC_E_CUR 35
-#define FAC_OPVAL_AOC_E_UNIT 36
-#define FAC_OPVAL_AOC_IDOFCRG 37
-
-#define FAC_OPVAL_CONF_BEG 40
-#define FAC_OPVAL_CONF_ADD 41
-#define FAC_OPVAL_CONF_SPLIT 42
-#define FAC_OPVAL_CONF_DROP 43
-#define FAC_OPVAL_CONF_ISOLATE 44
-#define FAC_OPVAL_CONF_REATT 45
-#define FAC_OPVAL_CONF_PDISC 46
-#define FAC_OPVAL_CONF_FCONF 47
-#define FAC_OPVAL_CONF_END 48
-#define FAC_OPVAL_CONF_IDCFE 49
-
-#define FAC_OPVAL_REVC_REQ 60
-
-enum states {
- ST_EXP_COMP_TYP,
- ST_EXP_INV_ID,
- ST_EXP_OP_VAL,
- ST_EXP_INFO,
- ST_EXP_RUL,
- ST_EXP_RU,
- ST_EXP_RNOU,
- ST_EXP_TOCI,
- ST_EXP_DBID,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c
deleted file mode 100644
index e48d993496a0..000000000000
--- a/sys/i4b/layer4/i4b_i4bdrv.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_i4bdrv.c - i4b userland interface driver
- * --------------------------------------------
- *
- * $Id: i4b_i4bdrv.c,v 1.1 1998/12/27 21:46:52 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:02 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-#include "i4bipr.h"
-
-#if NI4B > 1
-#error "only 1 (one) i4b device possible!"
-#endif
-
-#if NI4B > 0
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#if defined(__FreeBSD__) && (!defined(__FreeBSD_version) || __FreeBSD_version < 300001)
-/* do nothing */
-#else
-#include <sys/poll.h>
-#endif
-
-struct selinfo select_rd_info;
-
-static struct ifqueue i4b_rdqueue;
-static int openflag = 0;
-static int selflag = 0;
-static int readflag = 0;
-#ifdef DEVFS
-static void *devfs_token;
-#endif
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-PDEVSTATIC void i4battach __P((void));
-PDEVSTATIC int i4bopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-PDEVSTATIC int i4bclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-PDEVSTATIC int i4bread __P((dev_t dev, struct uio *uio, int ioflag));
-PDEVSTATIC int i4bioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-PDEVSTATIC int i4bpoll __P((dev_t dev, int events, struct proc *p));
-
-#if defined (__OpenBSD__)
-PDEVSTATIC int i4bselect(dev_t dev, int rw, struct proc *p);
-#endif
-
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-
-PDEVSTATIC d_open_t i4bopen;
-PDEVSTATIC d_close_t i4bclose;
-PDEVSTATIC d_read_t i4bread;
-PDEVSTATIC d_ioctl_t i4bioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC d_poll_t i4bpoll;
-#else
-PDEVSTATIC d_select_t i4bselect;
-#endif
-
-#define CDEV_MAJOR 60
-static struct cdevsw i4b_cdevsw =
- { i4bopen, i4bclose, i4bread, nowrite,
- i4bioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4bpoll, nommap, NULL, "i4b", NULL, -1 };
-#else
- i4bselect, nommap, NULL, "i4b", NULL, -1 };
-#endif
-
-PDEVSTATIC void i4battach(void *);
-PSEUDO_SET(i4battach, i4b_i4bdrv);
-
-#endif /* __FreeBSD__ */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4battach(void *dummy)
-#else
-i4battach()
-#endif
-{
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4b: ISDN call control device attached\n");
-#endif
- i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
-#ifdef DEVFS
- devfs_token = devfs_add_devswf(&i4b_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4b");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4bopen - device driver open routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENXIO);
-
- if(openflag)
- return(EBUSY);
-
- x = splimp();
- openflag = 1;
- i4b_l4_daemon_attached();
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bclose - device driver close routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x = splimp();
- openflag = 0;
- i4b_l4_daemon_detached();
- i4b_Dcleanifq(&i4b_rdqueue);
- splx(x);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bread - device driver read routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int x;
- int error = 0;
-
- if(minor(dev))
- return(ENODEV);
-
- while(IF_QEMPTY(&i4b_rdqueue))
- {
- x = splimp();
- readflag = 1;
- splx(x);
- tsleep((caddr_t) &i4b_rdqueue, (PZERO + 1) | PCATCH, "bird", 0);
- }
-
- x = splimp();
-
- IF_DEQUEUE(&i4b_rdqueue, m);
-
- splx(x);
-
- if(m && m->m_len)
- error = uiomove(m->m_data, m->m_len, uio);
- else
- error = EIO;
-
- if(m)
- i4b_Dfreembuf(m);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- call_desc_t *cd;
- int error = 0;
-
- if(minor(dev))
- return(ENODEV);
-
- switch(cmd)
- {
- /* cdid request, reserve cd and return cdid */
-
- case I4B_CDID_REQ:
- {
- msg_cdid_req_t *mir;
- mir = (msg_cdid_req_t *)data;
- cd = reserve_cd();
- mir->cdid = cd->cdid;
- break;
- }
-
- /* connect request, dial out to remote */
-
- case I4B_CONNECT_REQ:
- {
- msg_connect_req_t *mcr;
- mcr = (msg_connect_req_t *)data; /* setup ptr */
-
- if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_CONNECT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- cd->controller = mcr->controller; /* fill cd */
- cd->bprot = mcr->bprot;
- cd->driver = mcr->driver;
- cd->driver_unit = mcr->driver_unit;
- cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
-
- cd->unitlen_time = mcr->unitlen_time;
- cd->idle_time = mcr->idle_time;
- cd->earlyhup_time = mcr->earlyhup_time;
-
- cd->last_aocd_time = 0;
- if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
- cd->aocd_flag = 1;
- else
- cd->aocd_flag = 0;
-
- cd->cunits = 0;
-
- cd->max_idle_time = 0; /* this is outgoing */
-
- cd->dir = DIR_OUTGOING;
-
- DBGL4(L4_TIMO, "i4bioctl", ("I4B_CONNECT_REQ times, unitlen=%ld idle=%ld earlyhup=%ld\n",
- (long)cd->unitlen_time, (long)cd->idle_time, (long)cd->earlyhup_time));
-
- strcpy(cd->dst_telno, mcr->dst_telno);
- strcpy(cd->src_telno, mcr->src_telno);
- cd->display[0] = '\0';
-
- SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
-
- switch(mcr->channel)
- {
- case CHAN_B1:
- case CHAN_B2:
- if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
-
- case CHAN_ANY:
- if((ctrl_desc[mcr->controller].bch_state[CHAN_B1] != BCH_ST_FREE) &&
- (ctrl_desc[mcr->controller].bch_state[CHAN_B2] != BCH_ST_FREE))
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
-
- default:
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
- }
-
- cd->channelid = mcr->channel;
-
- cd->isdntxdelay = mcr->txdelay;
-
- /* check whether we have a pointer. Seems like */
- /* this should be adequate. GJ 19.09.97 */
- if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
-/*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
-
- if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
- {
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- }
- else
- {
- (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
- }
- break;
- }
-
- /* connect response, accept/reject/ignore incoming call */
-
- case I4B_CONNECT_RESP:
- {
- msg_connect_resp_t *mcrsp;
-
- mcrsp = (msg_connect_resp_t *)data;
-
- if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_CONNECT_RESP ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- T400_stop(cd);
-
- cd->driver = mcrsp->driver;
- cd->driver_unit = mcrsp->driver_unit;
- cd->max_idle_time = mcrsp->max_idle_time;
-
- cd->unitlen_time = 0; /* this is incoming */
- cd->idle_time = 0;
- cd->earlyhup_time = 0;
-
- cd->isdntxdelay = mcrsp->txdelay;
-
- DBGL4(L4_TIMO, "i4bioctl", ("I4B_CONNECT_RESP max_idle_time set to %ld seconds\n", (long)cd->max_idle_time));
-
- (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
- break;
- }
-
- /* disconnect request, actively terminate connection */
-
- case I4B_DISCONNECT_REQ:
- {
- msg_discon_req_t *mdr;
-
- mdr = (msg_discon_req_t *)data;
-
- if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_DISCONNECT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- /* preset causes with our cause */
- cd->cause_in = cd->cause_out = mdr->cause;
-
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
- break;
- }
-
- /* controller info request */
-
- case I4B_CTRL_INFO_REQ:
- {
- msg_ctrl_info_req_t *mcir;
-
- mcir = (msg_ctrl_info_req_t *)data;
- mcir->ncontroller = nctrl;
-
- if(mcir->controller > nctrl)
- {
- mcir->ctrl_type = -1;
- mcir->card_type = -1;
- }
- else
- {
- mcir->ctrl_type =
- ctrl_desc[mcir->controller].ctrl_type;
- mcir->card_type =
- ctrl_desc[mcir->controller].card_type;
-
- if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
- mcir->tei = ctrl_desc[mcir->controller].tei;
- else
- mcir->tei = -1;
- }
- break;
- }
-
- /* dial response */
-
- case I4B_DIALOUT_RESP:
- {
- msg_dialout_resp_t *mdrsp;
-
- mdrsp = (msg_dialout_resp_t *)data;
-
-#if NI4BIPR > 0
- if(mdrsp->driver == BDRV_IPR)
- {
- drvr_link_t *dlt;
- dlt = ipr_ret_linktab(mdrsp->driver_unit);
- (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat);
- }
-#endif
- break;
- }
-
- /* update timeout value */
-
- case I4B_TIMEOUT_UPD:
- {
- msg_timeout_upd_t *mtu;
- int x;
-
- mtu = (msg_timeout_upd_t *)data;
-
- if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_TIMEOUT_UPD ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- x = SPLI4B();
- cd->unitlen_time = mtu->unitlen_time;
- cd->idle_time = mtu->idle_time;
- cd->earlyhup_time = mtu->earlyhup_time;
- splx(x);
- break;
- }
-
- /* soft enable/disable interface */
-
- case I4B_UPDOWN_IND:
- {
- msg_updown_ind_t *mui;
-
- mui = (msg_updown_ind_t *)data;
-
-#if NI4BIPR > 0
- if(mui->driver == BDRV_IPR)
- {
- drvr_link_t *dlt;
- dlt = ipr_ret_linktab(mui->driver_unit);
- (*dlt->updown_ind)(mui->driver_unit, mui->updown);
- }
-#endif
- break;
- }
-
- /* send ALERT request */
-
- case I4B_ALERT_REQ:
- {
- msg_alert_req_t *mar;
-
- mar = (msg_alert_req_t *)data;
-
- if((cd = cd_by_cdid(mar->cdid)) == NULL)
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_ALERT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- T400_stop(cd);
-
- (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
-
- break;
- }
-
- /* version/release number request */
-
- case I4B_VR_REQ:
- {
- msg_vr_req_t *mvr;
-
- mvr = (msg_vr_req_t *)data;
-
- mvr->version = VERSION;
- mvr->release = REL;
- mvr->step = STEP;
- break;
- }
-
- /* Download request */
-
- case I4B_CTRL_DOWNLOAD:
- {
- struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
- struct isdn_download_request *r =
- (struct isdn_download_request*)data;
- int i;
-
- if(!ctrl_desc[r->controller].N_DOWNLOAD)
- {
- error = ENODEV;
- goto download_done;
- }
-
- prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
- M_DEVBUF, M_WAITOK);
-
- prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
- M_DEVBUF, M_WAITOK);
-
- if(!prots || !prots2)
- {
- error = ENOMEM;
- goto download_done;
- }
-
- copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
-
- for(i = 0; i < r->numprotos; i++)
- {
- prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
- copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
- prots2[i].bytecount = prots[i].bytecount;
- }
-
- error = ctrl_desc[r->controller].N_DOWNLOAD(
- ctrl_desc[r->controller].unit,
- r->numprotos, prots2);
-
-download_done:
- if(prots2)
- {
- for(i = 0; i < r->numprotos; i++)
- {
- if(prots2[i].microcode)
- {
- free(prots2[i].microcode, M_DEVBUF);
- }
- }
- free(prots2, M_DEVBUF);
- }
-
- if(prots)
- {
- free(prots, M_DEVBUF);
- }
- break;
- }
-
- /* Diagnostic request */
-
- case I4B_ACTIVE_DIAGNOSTIC:
- {
- struct isdn_diagnostic_request req, *r =
- (struct isdn_diagnostic_request*)data;
-
- req.in_param = req.out_param = NULL;
-
- if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
- {
- error = ENODEV;
- goto diag_done;
- }
-
- memcpy(&req, r, sizeof(req));
-
- if(req.in_param_len)
- {
- req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
-
- if(!req.in_param)
- {
- error = ENOMEM;
- goto diag_done;
- }
- copyin(r->in_param, req.in_param, req.in_param_len);
- }
-
- if(req.out_param_len)
- {
- req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
-
- if(!req.out_param)
- {
- error = ENOMEM;
- goto diag_done;
- }
- }
-
- error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
-
- if(!error && req.out_param_len)
- copyout(req.out_param, r->out_param, req.out_param_len);
-
-diag_done:
- if(req.in_param)
- free(req.in_param, M_DEVBUF);
-
- if(req.out_param)
- free(req.out_param, M_DEVBUF);
-
- break;
- }
-
- /* default */
-
- default:
- error = ENOTTY;
- break;
- }
-
- return(error);
-}
-
-#if (defined(__FreeBSD__) && \
- (!defined(__FreeBSD_version) || (__FreeBSD_version < 300001))) \
- || defined (__OpenBSD__)
-
-/*---------------------------------------------------------------------------*
- * i4bselect - device driver select routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bselect(dev_t dev, int rw, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENODEV);
-
- switch(rw)
- {
- case FREAD:
- if(!IF_QEMPTY(&i4b_rdqueue))
- return(1);
- x = splimp();
- selrecord(p, &select_rd_info);
- selflag = 1;
- splx(x);
- return(0);
- break;
-
- case FWRITE:
- return(1);
- break;
- }
- return(0);
-}
-
-#else /* NetBSD and FreeBSD -current */
-
-/*---------------------------------------------------------------------------*
- * i4bpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bpoll(dev_t dev, int events, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENODEV);
-
- if((events & POLLIN) || (events & POLLRDNORM))
- {
- if(!IF_QEMPTY(&i4b_rdqueue))
- return(1);
-
- x = splimp();
- selrecord(p, &select_rd_info);
- selflag = 1;
- splx(x);
- return(0);
- }
- else if((events & POLLOUT) || (events & POLLWRNORM))
- {
- return(1);
- }
-
- return(0);
-}
-
-#endif /* defined(__FreeBSD__) && __FreeBSD__ < 3 */
-
-/*---------------------------------------------------------------------------*
- * i4bputqueue - put message into queue to userland
- *---------------------------------------------------------------------------*/
-void
-i4bputqueue(struct mbuf *m)
-{
- int x;
-
- if(!openflag)
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- x = splimp();
-
- if(IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- DBGL4(L4_ERR, "i4bputqueue", ("ERROR, queue full, removing entry!\n"));
- }
-
- IF_ENQUEUE(&i4b_rdqueue, m);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup((caddr_t) &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeup(&select_rd_info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4bputqueue_hipri - put message into front of queue to userland
- *---------------------------------------------------------------------------*/
-void
-i4bputqueue_hipri(struct mbuf *m)
-{
- int x;
-
- if(!openflag)
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- x = splimp();
-
- if(IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- DBGL4(L4_ERR, "i4bputqueue", ("ERROR, queue full, removing entry!\n"));
- }
-
- IF_PREPEND(&i4b_rdqueue, m);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup((caddr_t) &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeup(&select_rd_info);
- }
-}
-
-#if BSD > 199306 && defined(__FreeBSD__)
-static i4b_devsw_installed = 0;
-
-static void
-i4b_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! i4b_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&i4b_cdevsw,NULL);
- i4b_devsw_installed = 1;
- }
-}
-
-SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
-#endif /* __FreeBSD__ */
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/layer4/i4b_l4.c b/sys/i4b/layer4/i4b_l4.c
deleted file mode 100644
index cecd5f4e2d66..000000000000
--- a/sys/i4b/layer4/i4b_l4.c
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4.c - kernel interface to userland
- * -----------------------------------------
- *
- * $Id: i4b_l4.c,v 1.33 1998/12/05 18:05:49 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-#include "i4bipr.h"
-#include "i4bisppp.h"
-#include "i4brbch.h"
-#include "i4btel.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer4/i4b_l4.h>
-
-unsigned int i4b_l4_debug = L4_DEBUG_DEFAULT;
-
-struct ctrl_type_desc ctrl_types[CTRL_NUMTYPES] = { { NULL, NULL} };
-
-static int i4b_link_bchandrvr(call_desc_t *cd);
-static void i4b_unlink_bchandrvr(call_desc_t *cd);
-static void i4b_l4_setup_timeout(call_desc_t *cd);
-
-/*---------------------------------------------------------------------------*
- * send MSG_PDEACT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_pdeact(int controller, int numactive)
-{
- struct mbuf *m;
- int i;
- call_desc_t *cd;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if((call_desc[i].cdid != CDID_UNUSED) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == controller))
- {
- cd = &call_desc[i];
-
- if(cd->timeout_active)
- {
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, cd->idle_timeout_handle);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd);
-#endif
- }
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_FREE;
- }
-
- cd->cdid = CDID_UNUSED;
- }
- }
-
- if((m = i4b_Dgetmbuf(sizeof(msg_pdeact_ind_t))) != NULL)
- {
- msg_pdeact_ind_t *md = (msg_pdeact_ind_t *)m->m_data;
-
- md->header.type = MSG_PDEACT_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->numactive = numactive;
-
- i4bputqueue_hipri(m); /* URGENT !!! */
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_L12STAT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_l12stat(int controller, int layer, int state)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_l12stat_ind_t))) != NULL)
- {
- msg_l12stat_ind_t *md = (msg_l12stat_ind_t *)m->m_data;
-
- md->header.type = MSG_L12STAT_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->layer = layer;
- md->state = state;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_TEIASG_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_teiasg(int controller, int tei)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_teiasg_ind_t))) != NULL)
- {
- msg_teiasg_ind_t *md = (msg_teiasg_ind_t *)m->m_data;
-
- md->header.type = MSG_TEIASG_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->tei = ctrl_desc[controller].tei;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DIALOUT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_dialout(int driver, int driver_unit)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_dialout_ind_t))) != NULL)
- {
- msg_dialout_ind_t *md = (msg_dialout_ind_t *)m->m_data;
-
- md->header.type = MSG_DIALOUT_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_NEGOTIATION_COMPL message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_negcomplete(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_negcomplete_ind_t))) != NULL)
- {
- msg_negcomplete_ind_t *md = (msg_negcomplete_ind_t *)m->m_data;
-
- md->header.type = MSG_NEGCOMP_IND;
- md->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_IFSTATE_CHANGED_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_ifstate_changed(call_desc_t *cd, int new_state)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_ifstatechg_ind_t))) != NULL)
- {
- msg_ifstatechg_ind_t *md = (msg_ifstatechg_ind_t *)m->m_data;
-
- md->header.type = MSG_IFSTATE_CHANGED_IND;
- md->header.cdid = cd->cdid;
- md->state = new_state;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DRVRDISC_REQ message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_drvrdisc(int driver, int driver_unit)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_drvrdisc_req_t))) != NULL)
- {
- msg_drvrdisc_req_t *md = (msg_drvrdisc_req_t *)m->m_data;
-
- md->header.type = MSG_DRVRDISC_REQ;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_ACCT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_accounting(int driver, int driver_unit, int accttype, int ioutbytes,
- int iinbytes, int ro, int ri, int outbytes, int inbytes)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_accounting_ind_t))) != NULL)
- {
- msg_accounting_ind_t *md = (msg_accounting_ind_t *)m->m_data;
-
- md->header.type = MSG_ACCT_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- md->accttype = accttype;
- md->ioutbytes = ioutbytes;
- md->iinbytes = iinbytes;
- md->outbps = ro;
- md->inbps = ri;
- md->outbytes = outbytes;
- md->inbytes = inbytes;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CONNECT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_connect_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_connect_ind_t))) != NULL)
- {
- msg_connect_ind_t *mp = (msg_connect_ind_t *)m->m_data;
-
- mp->header.type = MSG_CONNECT_IND;
- mp->header.cdid = cd->cdid;
-
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- mp->bprot = cd->bprot;
-
- cd->dir = DIR_INCOMING;
-
- if(strlen(cd->dst_telno) > 0)
- strcpy(mp->dst_telno, cd->dst_telno);
- else
- strcpy(mp->dst_telno, TELNO_EMPTY);
-
- if(strlen(cd->src_telno) > 0)
- strcpy(mp->src_telno, cd->src_telno);
- else
- strcpy(mp->src_telno, TELNO_EMPTY);
-
- strcpy(mp->display, cd->display);
-
- mp->scr_ind = cd->scr_ind;
-
- T400_start(cd);
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CONNECT_ACTIVE_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_connect_active_ind(call_desc_t *cd)
-{
- int s;
- struct mbuf *m;
-
- s = SPLI4B();
-
- cd->last_active_time = cd->connect_time = SECOND;
-
- DBGL4(L4_TIMO, "i4b_l4_connect_active_ind", ("last_active/connect_time=%ld\n", (long)cd->connect_time));
-
- i4b_link_bchandrvr(cd);
-
- (*cd->dlt->line_connected)(cd->driver_unit, (void *)cd);
-
- i4b_l4_setup_timeout(cd);
-
- splx(s);
-
- if((m = i4b_Dgetmbuf(sizeof(msg_connect_active_ind_t))) != NULL)
- {
- msg_connect_active_ind_t *mp = (msg_connect_active_ind_t *)m->m_data;
-
- mp->header.type = MSG_CONNECT_ACTIVE_IND;
- mp->header.cdid = cd->cdid;
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- if(cd->datetime[0] != '\0')
- strcpy(mp->datetime, cd->datetime);
- else
- mp->datetime[0] = '\0';
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DISCONNECT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_disconnect_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if(cd->timeout_active)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, cd->idle_timeout_handle);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd);
-#endif
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_FREE;
- }
- else
- {
- /* no error, might be hunting call for callback */
- DBGL4(L4_MSG, "i4b_l4_disconnect_ind", ("channel free not B1/B2 but %d!\n", cd->channelid));
- }
-
- if((m = i4b_Dgetmbuf(sizeof(msg_disconnect_ind_t))) != NULL)
- {
- msg_disconnect_ind_t *mp = (msg_disconnect_ind_t *)m->m_data;
-
- mp->header.type = MSG_DISCONNECT_IND;
- mp->header.cdid = cd->cdid;
- mp->cause = cd->cause_in;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_IDLE_TIMEOUT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_idle_timeout_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_idle_timeout_ind_t))) != NULL)
- {
- msg_idle_timeout_ind_t *mp = (msg_idle_timeout_ind_t *)m->m_data;
-
- mp->header.type = MSG_IDLE_TIMEOUT_IND;
- mp->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CHARGING_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_charging_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_charging_ind_t))) != NULL)
- {
- msg_charging_ind_t *mp = (msg_charging_ind_t *)m->m_data;
-
- mp->header.type = MSG_CHARGING_IND;
- mp->header.cdid = cd->cdid;
- mp->units_type = cd->units_type;
-
-/*XXX*/ if(mp->units_type == CHARGE_CALC)
- mp->units = cd->cunits;
- else
- mp->units = cd->units;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_STATUS_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_status_ind(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_ALERT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_alert_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_alert_ind_t))) != NULL)
- {
- msg_alert_ind_t *mp = (msg_alert_ind_t *)m->m_data;
-
- mp->header.type = MSG_ALERT_IND;
- mp->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_INFO_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_info_ind(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_INFO_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_proceeding_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_proceeding_ind_t))) != NULL)
- {
- msg_proceeding_ind_t *mp = (msg_proceeding_ind_t *)m->m_data;
-
- mp->header.type = MSG_PROCEEDING_IND;
- mp->header.cdid = cd->cdid;
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * link a driver(unit) to a B-channel(controller,unit,channel)
- *---------------------------------------------------------------------------*/
-static int
-i4b_link_bchandrvr(call_desc_t *cd)
-{
- int t = ctrl_desc[cd->controller].ctrl_type;
-
- if(t < 0 || t >= CTRL_NUMTYPES || ctrl_types[t].get_linktab == NULL)
- {
- cd->ilt = NULL;
- }
- else
- {
- cd->ilt = ctrl_types[t].get_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid);
- }
-
- switch(cd->driver)
- {
-#if NI4BRBCH > 0
- case BDRV_RBCH:
- cd->dlt = rbch_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BTEL > 0
- case BDRV_TEL:
- cd->dlt = tel_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BIPR > 0
- case BDRV_IPR:
- cd->dlt = ipr_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BISPPP > 0
- case BDRV_ISPPP:
- cd->dlt = i4bisppp_ret_linktab(cd->driver_unit);
- break;
-#endif
-
- default:
- cd->dlt = NULL;
- break;
- }
-
- if(cd->dlt == NULL || cd->ilt == NULL)
- return(-1);
-
- if(t >= 0 && t < CTRL_NUMTYPES && ctrl_types[t].set_linktab != NULL)
- {
- ctrl_types[t].set_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid,
- cd->dlt);
- }
-
- switch(cd->driver)
- {
-#if NI4BRBCH > 0
- case BDRV_RBCH:
- rbch_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BTEL > 0
- case BDRV_TEL:
- tel_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BIPR > 0
- case BDRV_IPR:
- ipr_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BISPPP > 0
- case BDRV_ISPPP:
- i4bisppp_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
- default:
- return(0);
- break;
- }
-
- /* activate B channel */
-
- (*cd->ilt->bch_config)(ctrl_desc[cd->controller].unit,
- cd->channelid, cd->bprot, 1);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * unlink a driver(unit) from a B-channel(controller,unit,channel)
- *---------------------------------------------------------------------------*/
-static void
-i4b_unlink_bchandrvr(call_desc_t *cd)
-{
- int t = ctrl_desc[cd->controller].ctrl_type;
-
- if(t < 0 || t >= CTRL_NUMTYPES || ctrl_types[t].get_linktab == NULL)
- {
- cd->ilt = NULL;
- return;
- }
- else
- {
- cd->ilt = ctrl_types[t].get_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid);
- }
-
- /* deactivate B channel */
-
- (*cd->ilt->bch_config)(ctrl_desc[cd->controller].unit,
- cd->channelid, cd->bprot, 0);
-}
-
-/*---------------------------------------------------------------------------
-
- How shorthold mode works for OUTGOING connections
- =================================================
-
- |<---- unchecked-window ------->|<-checkwindow->|<-safetywindow>|
-
-idletime_state: IST_NONCHK IST_CHECK IST_SAFE
-
- | | | |
- time>>+-------------------------------+---------------+---------------+-...
- | | | |
- | |<--idle_time-->|<--earlyhup--->|
- |<-----------------------unitlen------------------------------->|
-
-
- unitlen - specifies the time a charging unit lasts
- idle_time - specifies the thime the line must be idle at the
- end of the unit to be elected for hangup
- earlyhup - is the beginning of a timing safety zone before the
- next charging unit starts
-
- The algorithm works as follows: lets assume the unitlen is 100
- secons, idle_time is 40 seconds and earlyhup is 10 seconds.
- The line then must be idle 50 seconds after the begin of the
- current unit and it must then be quiet for 40 seconds. if it
- has been quiet for this 40 seconds, the line is closed 10
- seconds before the next charging unit starts. In case there was
- any traffic within the idle_time, the line is not closed.
- It does not matter whether there was any traffic between second
- 0 and second 50 or not.
-
-
- How shorthold mode works for INCOMING connections
- =================================================
-
- it is just possible to specify a maximum idle time for incoming
- connections, after this time of no activity on the line the line
- is closed.
-
----------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------*
- * B channel idle check timeout setup
- *---------------------------------------------------------------------------*/
-static void
-i4b_l4_setup_timeout(call_desc_t *cd)
-{
- cd->timeout_active = 0;
- cd->idletime_state = IST_IDLE;
-
- if((cd->dir == DIR_INCOMING) && (cd->max_idle_time > 0))
- {
- /* incoming call: simple max idletime check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: incoming-call, setup max_idle_time to %ld\n", (long)SECOND, (long)cd->max_idle_time));
- }
- else if((cd->dir == DIR_OUTGOING) && (cd->idle_time > 0))
- {
- /* outgoing call */
-
- if((cd->idle_time > 0) && (cd->unitlen_time == 0))
- {
- /* outgoing call: simple max idletime check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: outgoing-call, setup idle_time to %ld\n", (long)SECOND, (long)cd->idle_time));
- }
- else if((cd->unitlen_time > 0) && (cd->unitlen_time > (cd->idle_time + cd->earlyhup_time)))
- {
- /* outgoing call: full shorthold mode check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->unitlen_time - (cd->idle_time + cd->earlyhup_time)));
- cd->timeout_active = 1;
- cd->idletime_state = IST_NONCHK;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: outgoing-call, start %ld sec nocheck window\n",
- (long)SECOND, (long)(cd->unitlen_time - (cd->idle_time + cd->earlyhup_time))));
-
- if(cd->aocd_flag == 0)
- {
- cd->units_type = CHARGE_CALC;
- cd->cunits++;
- i4b_l4_charging_ind(cd);
- }
- }
- else
- {
- /* parms somehow got wrong .. */
-
- DBGL4(L4_ERR, "i4b_l4_setup_timeout", ("%ld: ERROR: idletime[%ld]+earlyhup[%ld] > unitlength[%ld]!\n",
- (long)SECOND, (long)cd->idle_time, (long)cd->earlyhup_time, (long)cd->unitlen_time));
- }
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("no idle_timeout configured\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * B channel idle check timeout function
- *---------------------------------------------------------------------------*/
-void
-i4b_idle_check(call_desc_t *cd)
-{
- int s;
-
- if(cd->cdid == CDID_UNUSED)
- return;
-
- s = SPLI4B();
-
- /* failsafe */
-
- if(cd->timeout_active == 0)
- {
- DBGL4(L4_ERR, "i4b_idle_check", ("ERROR: timeout_active == 0 !!!\n"));
- }
- else
- {
- cd->timeout_active = 0;
- }
-
- /* incoming connections, simple idletime check */
-
- if(cd->dir == DIR_INCOMING)
- {
- if((cd->last_active_time + cd->max_idle_time) <= SECOND)
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: incoming-call, line idle timeout, disconnecting!\n", (long)SECOND));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: incoming-call, activity, last_active=%ld, max_idle=%ld\n", (long)SECOND, (long)cd->last_active_time, (long)cd->max_idle_time));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* outgoing connections */
-
- else if(cd->dir == DIR_OUTGOING)
- {
-
- /* simple idletime calculation */
-
- if((cd->idle_time > 0) && (cd->unitlen_time == 0))
- {
- if((cd->last_active_time + cd->idle_time) <= SECOND)
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call-st, idle timeout, disconnecting!\n", (long)SECOND));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call-st, activity, last_active=%ld, max_idle=%ld\n",
- (long)SECOND, (long)cd->last_active_time, (long)cd->idle_time));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* full shorthold mode calculation */
-
- else if((cd->unitlen_time > 0) && (cd->unitlen_time > (cd->idle_time + cd->earlyhup_time)))
- {
- switch(cd->idletime_state)
- {
- case IST_NONCHK: /* end of non-check time */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->idle_time));
- cd->idletimechk_start = SECOND;
- cd->idletime_state = IST_CHECK;
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, idletime check window reached!\n", (long)SECOND));
- break;
-
- case IST_CHECK: /* end of idletime chk */
- if((cd->last_active_time > cd->idletimechk_start) &&
- (cd->last_active_time <= SECOND))
- { /* activity detected */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->earlyhup_time));
- cd->timeout_active = 1;
- cd->idletime_state = IST_SAFE;
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, activity at %ld, wait earlyhup-end\n", (long)SECOND, (long)cd->last_active_time));
- }
- else
- { /* no activity, hangup */
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, idle timeout, last activity at %ld\n", (long)SECOND, (long)cd->last_active_time));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- cd->idletime_state = IST_IDLE;
- }
- break;
-
- case IST_SAFE: /* end of earlyhup time */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->unitlen_time - (cd->idle_time+cd->earlyhup_time)));
- cd->timeout_active = 1;
- cd->idletime_state = IST_NONCHK;
-
- if(cd->aocd_flag == 0)
- {
- cd->units_type = CHARGE_CALC;
- cd->cunits++;
- i4b_l4_charging_ind(cd);
- }
-
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, earlyhup end, wait for idletime start\n", (long)SECOND));
- break;
-
- default:
- DBGL4(L4_ERR, "i4b_idle_check", ("outgoing-call: invalid idletime_state value!\n"));
- cd->idletime_state = IST_IDLE;
- break;
- }
- }
- }
- splx(s);
-}
-
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/layer4/i4b_l4.h b/sys/i4b/layer4/i4b_l4.h
deleted file mode 100644
index e4ed863f383a..000000000000
--- a/sys/i4b/layer4/i4b_l4.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4.h - kernel interface to userland header file
- * ---------------------------------------------------
- *
- * $Id: i4b_l4.h,v 1.13 1998/12/05 18:05:50 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:34 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L4_H_
-#define _I4B_L4_H_
-
-extern void i4bputqueue ( struct mbuf *m );
-extern void i4bputqueue_hipri(struct mbuf *m);
-extern void i4b_l4_accounting(int, int, int, int, int, int, int, int, int);
-extern void i4b_l4_alert_ind ( call_desc_t *cd );
-extern void i4b_l4_charging_ind( call_desc_t *cd );
-extern void i4b_l4_connect_active_ind ( call_desc_t *cd );
-extern void i4b_l4_connect_ind ( call_desc_t *cd );
-extern void i4b_l4_daemon_attached(void);
-extern void i4b_l4_daemon_detached(void);
-extern void i4b_l4_dialout( int driver, int driver_unit );
-extern void i4b_l4_disconnect_ind ( call_desc_t *cd );
-extern void i4b_l4_drvrdisc (int driver, int driver_unit );
-extern void i4b_l4_negcomplete( call_desc_t *cd );
-extern void i4b_l4_ifstate_changed( call_desc_t *cd, int new_state );
-extern void i4b_l4_idle_timeout_ind( call_desc_t *cd );
-extern void i4b_l4_info_ind ( call_desc_t *cd );
-extern void i4b_l4_l12stat(int controller, int layer, int state);
-extern void i4b_l4_pdeact(int controller, int numactive);
-extern void i4b_l4_teiasg(int controller, int tei);
-extern void i4b_l4_status_ind ( call_desc_t *cd );
-extern void i4b_l4_proceeding_ind ( call_desc_t *cd );
-extern void i4b_idle_check(call_desc_t *cdp);
-extern call_desc_t * cd_by_cdid ( unsigned int cdid );
-extern call_desc_t * cd_by_unitcr ( int unit, int cr, int crf );
-extern void freecd_by_cd ( call_desc_t *cd );
-extern unsigned char get_rand_cr ( int unit );
-extern call_desc_t * reserve_cd ( void );
-extern void T400_start ( call_desc_t *cd );
-extern void T400_stop ( call_desc_t *cd );
-
-#endif /* _I4B_L4_H_ */
diff --git a/sys/i4b/layer4/i4b_l4mgmt.c b/sys/i4b/layer4/i4b_l4mgmt.c
deleted file mode 100644
index e8e1a967a696..000000000000
--- a/sys/i4b/layer4/i4b_l4mgmt.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4mgmt.c - layer 4 calldescriptor management utilites
- * -----------------------------------------------------------
- *
- * $Id: i4b_l4mgmt.c,v 1.23 1998/12/05 18:05:52 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:50 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <machine/random.h>
-#endif
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-call_desc_t call_desc[N_CALL_DESC]; /* call descriptor array */
-
-static unsigned int get_cdid(void);
-
-int nctrl; /* number of attached controllers */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-void init_callout(call_desc_t *);
-#endif
-
-/*---------------------------------------------------------------------------*
- * return a new unique call descriptor id
- * --------------------------------------
- * returns a new calldescriptor id which is used to uniquely identyfy
- * a single call in the communication between kernel and userland.
- * this cdid is then used to associate a calldescriptor with an id.
- *---------------------------------------------------------------------------*/
-static unsigned int
-get_cdid(void)
-{
- static unsigned int cdid_count = 0;
- int i;
- int x;
-
- x = SPLI4B();
-
- /* get next id */
-
- cdid_count++;
-
-again:
- if(cdid_count == CDID_UNUSED) /* zero is invalid */
- cdid_count++;
- else if(cdid_count > CDID_MAX) /* wraparound ? */
- cdid_count = 1;
-
- /* check if id already in use */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == cdid_count)
- {
- cdid_count++;
- goto again;
- }
- }
-
- splx(x);
-
- return(cdid_count);
-}
-
-/*---------------------------------------------------------------------------*
- * reserve a calldescriptor for later usage
- * ----------------------------------------
- * searches the calldescriptor array until an unused
- * descriptor is found, gets a new calldescriptor id
- * and reserves it by putting the id into the cdid field.
- * returns pointer to the calldescriptor.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-reserve_cd(void)
-{
- call_desc_t *cd;
- int x;
- int i;
-
- x = SPLI4B();
-
- cd = NULL;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == CDID_UNUSED)
- {
- bzero(&call_desc[i], sizeof(call_desc_t)); /* clear it */
- call_desc[i].cdid = get_cdid(); /* fill in new cdid */
- cd = &(call_desc[i]); /* get pointer to descriptor */
- DBGL4(L4_MSG, "reserve_cd", ("found free cd - index=%d cdid=%u\n",
- i, call_desc[i].cdid));
- break;
- }
- }
-
- splx(x);
-
- if(cd == NULL)
- panic("reserve_cd: no free call descriptor available!");
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(cd);
-#endif
-
- return(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * free a calldescriptor
- * ---------------------
- * free a unused calldescriptor by giving address of calldescriptor
- * and writing a 0 into the cdid field marking it as unused.
- *---------------------------------------------------------------------------*/
-void
-freecd_by_cd(call_desc_t *cd)
-{
- int i;
- int x = SPLI4B();
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != CDID_UNUSED) &&
- (&(call_desc[i]) == cd) )
- {
- DBGL4(L4_MSG, "freecd_by_cd", ("releasing cd - index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, cd->cr));
- call_desc[i].cdid = CDID_UNUSED;
- break;
- }
- }
-
- if(i == N_CALL_DESC)
- panic("freecd_by_cd: ERROR, cd not found, cr = %d\n", cd->cr);
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to calldescriptor by giving the calldescriptor id
- * ----------------------------------------------------------------
- * lookup a calldescriptor in the calldescriptor array by looking
- * at the cdid field. return pointer to calldescriptor if found,
- * else return NULL if not found.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-cd_by_cdid(unsigned int cdid)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == cdid)
- {
- DBGL4(L4_MSG, "cd_by_cdid", ("found cdid - index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, call_desc[i].cr));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(&call_desc[i]);
-#endif
- return(&(call_desc[i]));
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * search calldescriptor
- * ---------------------
- * This routine searches for the calldescriptor for a passive controller
- * given by unit number, callreference and callreference flag.
- * It returns a pointer to the calldescriptor if found, else a NULL.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-cd_by_unitcr(int unit, int cr, int crf)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if((call_desc[i].cdid != CDID_UNUSED) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit) &&
- (call_desc[i].cr == cr) &&
- (call_desc[i].crflag == crf) )
- {
- DBGL4(L4_MSG, "cd_by_unitcr", ("found cd, index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, call_desc[i].cr));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(&call_desc[i]);
-#endif
- return(&(call_desc[i]));
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * generate 7 bit "random" number used for outgoing Call Reference
- *---------------------------------------------------------------------------*/
-unsigned char
-get_rand_cr(int unit)
-{
- register int i, j;
- static u_char val, retval;
- static int called = 42;
-
- val += ++called;
-
- for(i=0; i < 50 ; i++, val++)
- {
- int found = 1;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- read_random((char *)&val, sizeof(val));
-#else
- val |= unit+i;
- val <<= i;
- val ^= (time.tv_sec >> 8) ^ time.tv_usec;
- val <<= i;
- val ^= time.tv_sec ^ (time.tv_usec >> 8);
-#endif
-
- retval = val & 0x7f;
-
- if(retval == 0 || retval == 0x7f)
- continue;
-
- for(j=0; j < N_CALL_DESC; j++)
- {
- if( (call_desc[j].cdid != CDID_UNUSED) &&
- (call_desc[j].cr == retval) )
- {
- found = 0;
- break;
- }
- }
-
- if(found)
- return(retval);
- }
- return(0); /* XXX */
-}
-
-/*---------------------------------------------------------------------------*
- * initialize the callout handles for FreeBSD-current 3.0
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-void
-init_callout(call_desc_t *cd)
-{
- if(cd->callouts_inited == 0)
- {
- callout_handle_init(&cd->idle_timeout_handle);
- callout_handle_init(&cd->T303_callout);
- callout_handle_init(&cd->T305_callout);
- callout_handle_init(&cd->T308_callout);
- callout_handle_init(&cd->T309_callout);
- callout_handle_init(&cd->T310_callout);
- callout_handle_init(&cd->T313_callout);
- callout_handle_init(&cd->T400_callout);
- cd->callouts_inited = 1;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * daemon is attached
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_daemon_attached(void)
-{
- int i;
-
- int x = SPLI4B();
-
- for(i=0; i < nctrl; i++)
- {
-/*XXX*/ if(ctrl_desc[i].ctrl_type == CTRL_PASSIVE)
- {
- DBGL4(L4_MSG, "i4b_l4_daemon_attached", ("CMR_DOPEN sent to unit %d\n", ctrl_desc[i].unit));
-
- (*ctrl_desc[i].N_MGMT_COMMAND)(ctrl_desc[i].unit, CMR_DOPEN, 0);
- }
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * daemon is detached
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_daemon_detached(void)
-{
- int i;
-
- int x = SPLI4B();
-
- for(i=0; i < nctrl; i++)
- {
-/*XXX*/ if(ctrl_desc[i].ctrl_type == CTRL_PASSIVE)
- {
- DBGL4(L4_MSG, "i4b_l4_daemon_detached", ("CMR_DCLOSE sent to unit %d\n", ctrl_desc[i].unit));
-
- (*ctrl_desc[i].N_MGMT_COMMAND)(ctrl_desc[i].unit, CMR_DCLOSE, 0);
- }
- }
- splx(x);
-}
-
-#ifdef I4B_CD_DEBUG_PRINT
-
-extern char *print_l3state(call_desc_t *cd);
-
-void i4b_print_cdp(call_desc_t *cdp);
-void i4b_print_cdx(int index);
-void i4b_print_cda(void);
-void i4b_print_cdaa(void);
-
-/*---------------------------------------------------------------------------*
- * print a call descriptor by cd-pointer
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdp(call_desc_t *cdp)
-{
- if((cdp > &(call_desc[N_CALL_DESC])) || (cdp < &(call_desc[0])))
- {
- printf("i4b_print_cd: cdp out of range!\n");
- return;
- }
-
- printf("i4b_print_cd: printing call descriptor %d at 0x%lx:\n", cdp - (&(call_desc[0])), (unsigned long)cdp);
-
- printf(" cdid = %d\n", cdp->cdid);
- printf(" controller = %d (u=%d, dl=%d, b1=%d, b2=%d)\n",
- cdp->controller,
- ctrl_desc[cdp->controller].unit,
- ctrl_desc[cdp->controller].dl_est,
- ctrl_desc[cdp->controller].bch_state[CHAN_B1],
- ctrl_desc[cdp->controller].bch_state[CHAN_B2]);
- printf(" cr = 0x%02x\n", cdp->cr);
- printf(" crflag = %d\n", cdp->crflag);
- printf(" channelid = %d\n", cdp->channelid);
- printf(" bprot = %d\n", cdp->bprot);
- printf(" driver = %d\n", cdp->driver);
- printf(" driver_unit = %d\n", cdp->driver_unit);
- printf(" call_state = %d\n", cdp->call_state);
- printf(" Q931state = %s\n", print_l3state(cdp));
- printf(" event = %d\n", cdp->event);
- printf(" response = %d\n", cdp->response);
- printf(" T303 = %d\n", cdp->T303);
- printf("T303_first_to = %d\n", cdp->T303_first_to);
- printf(" T305 = %d\n", cdp->T305);
- printf(" T308 = %d\n", cdp->T308);
- printf("T308_first_to = %d\n", cdp->T308_first_to);
- printf(" T309 = %d\n", cdp->T309);
- printf(" T310 = %d\n", cdp->T310);
- printf(" T313 = %d\n", cdp->T313);
- printf(" T400 = %d\n", cdp->T400);
- printf(" dir = %s\n", cdp->dir == DIR_OUTGOING ? "out" : "in");
-}
-
-/*---------------------------------------------------------------------------*
- * print a call descriptor by index
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdx(int index)
-{
- if(index >= N_CALL_DESC)
- {
- printf("i4b_print_cdx: index %d >= N_CALL_DESC %d\n", index, N_CALL_DESC);
- return;
- }
- i4b_print_cdp(&(call_desc[index]));
-}
-
-/*---------------------------------------------------------------------------*
- * print all call descriptors
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cda(void)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- i4b_print_cdp(&(call_desc[i]));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * print all active call descriptors
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdaa(void)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- {
- i4b_print_cdp(&(call_desc[i]));
- }
- }
-}
-
-#endif /* I4B_CD_DEBUG_PRINT */
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer4/i4b_l4timer.c b/sys/i4b/layer4/i4b_l4timer.c
deleted file mode 100644
index 7a38e13904dd..000000000000
--- a/sys/i4b/layer4/i4b_l4timer.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4timer.c - timer and timeout handling for layer 4
- * --------------------------------------------------------
- *
- * $Id: i4b_l4timer.c,v 1.10 1998/12/05 18:05:53 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:07 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/*---------------------------------------------------------------------------*
- * timer T400 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T400_timeout(call_desc_t *cd)
-{
- DBGL4(L4_ERR, "T400_timeout", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 start
- *---------------------------------------------------------------------------*/
-void
-T400_start(call_desc_t *cd)
-{
- DBGL4(L4_MSG, "T400_start", ("cr = %d\n", cd->cr));
-
- cd->T400 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T400_callout = timeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, T400DEF);
-#else
- timeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, T400DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 stop
- *---------------------------------------------------------------------------*/
-void
-T400_stop(call_desc_t *cd)
-{
- DBGL4(L4_MSG, "T400_stop", ("cr = %d\n", cd->cr));
-
- if(cd->T400 == TIMER_ACTIVE)
- {
- cd->T400 = TIMER_IDLE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, cd->T400_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd);
-#endif
- }
-}
-
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/tina-dd/README b/sys/i4b/tina-dd/README
deleted file mode 100644
index 6a2386f90bf4..000000000000
--- a/sys/i4b/tina-dd/README
+++ /dev/null
@@ -1,20 +0,0 @@
-
-THIS DRIVER IS NOT YET WORKING !
-================================
-
-This adds support for the active ISDN card tina-dd manufactured by
-Stollmann E+V GmbH in Hamburg, Germany. This card was also sold by
-MIRO as the Miro P1.
-
-Christian Luehrs and Manfred Jung of Stollmann were very helpful
-giving out docs and sources to support the development of a driver
-for this card.
-
-The card supports many protocols. In order to make the card operable
-you'll need the downloadable firmware which also can be found on the
-www/ftp server, www.stollmann.de / ftp.stollmann.de.
-
-While developing this driver, i used fcdddss1.loc as of April 1994.
-
-The code is based in part on sources and header files written by
-Stollmann for their driver development kit for the tina-dd.
diff --git a/sys/i4b/tina-dd/i4b_tina_dd.c b/sys/i4b/tina-dd/i4b_tina_dd.c
deleted file mode 100644
index e210d001888f..000000000000
--- a/sys/i4b/tina-dd/i4b_tina_dd.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 1994, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tina_dd.c - i4b Stollman Tina-dd control device driver
- * ----------------------------------------------------------
- *
- * $Id: i4b_tina_dd.c,v 1.1 1998/12/27 21:46:53 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:41:38 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "tina.h"
-
-#if NTINA > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/tina-dd/i4b_tina_ioctl.h>
-
-static int openflag = 0;
-
-int tinaprobe(struct isa_device *dev);
-int tinaattach(struct isa_device *dev);
-void tinaintr(int unit);
-
-struct isa_driver tinadriver = {
- tinaprobe,
- tinaattach,
- "tina",
- 0
-};
-
-static struct tina_softc {
- int sc_unit;
- int sc_iobase;
-} tina_sc[NTINA];
-
-static d_open_t tinaopen;
-static d_close_t tinaclose;
-static d_ioctl_t tinaioctl;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static d_poll_t tinapoll;
-#endif
-
-#define CDEV_MAJOR 54
-static struct cdevsw tina_cdevsw =
- { tinaopen, tinaclose, noread, nowrite,
- tinaioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- tinapoll, nommap, NULL, "tina", NULL, -1 };
-#else
- noselect, nommap, NULL, "tina", NULL, -1 };
-#endif
-
-static void setupaddr(unsigned short iobase, unsigned int addr);
-static void readblock(unsigned short iobase, unsigned int addr,
- unsigned char *dst, unsigned int len);
-static void writeblock(unsigned short iobase, unsigned char *src,
- unsigned long addr, int len);
-
-/*---------------------------------------------------------------------------*
- * tina - device driver probe routine
- *---------------------------------------------------------------------------*/
-int
-tinaprobe(struct isa_device *dev)
-{
- u_char byte;
-
-#define SETLOW 0x55
-#define SETMID 0xaa
-#define SETHIGH 0x06
-
- outb((dev->id_iobase + ADDR_CNTL), SETLOW);
-
- if((byte = inb(dev->id_iobase + ADDR_CNTL)) != SETLOW)
- {
- printf("tina%d: probe low failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETLOW);
- return(0);
- }
-
- outb((dev->id_iobase + ADDR_CNTM), SETMID);
- if((byte = inb(dev->id_iobase + ADDR_CNTM)) != SETMID)
- {
- printf("tina%d: probe mid failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETMID);
- return(0);
- }
-
- outb((dev->id_iobase + ADDR_CNTH), SETHIGH);
- if(((byte = inb(dev->id_iobase + ADDR_CNTH)) & 0x0f) != SETHIGH)
- {
- printf("tina%d: probe high failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETHIGH);
- return(0);
- }
-
- printf("tina%d: status register = 0x%x\n",
- dev->id_unit, inb(dev->id_iobase + CTRL_STAT));
-
- return(1); /* board found */
-}
-#undef SETLOW
-#undef SETMID
-#undef SETHIGH
-
-/*---------------------------------------------------------------------------*
- * tina - device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-tinaattach(struct isa_device *dev)
-{
- struct tina_softc *sc = &tina_sc[dev->id_unit];
-
- sc->sc_unit = dev->id_unit;
- sc->sc_iobase = dev->id_iobase;
-
- printf("tina%d: attaching Tina-dd\n", dev->id_unit);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * tina - device driver interrupt routine
- *---------------------------------------------------------------------------*/
-void
-tinaintr(int unit)
-{
-}
-
-#if BSD > 199306 && defined(__FreeBSD__)
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-tinainit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &tina_cdevsw, NULL);
-}
-
-SYSINIT(tinadev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &tinainit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * tinaopen - device driver open routine
- *---------------------------------------------------------------------------*/
-static int
-tinaopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- if(minor(dev))
- return (ENXIO);
-
- if(openflag)
- return (EBUSY);
-
- openflag = 1;
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * tinaclose - device driver close routine
- *---------------------------------------------------------------------------*/
-static int
-tinaclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- openflag = 0;
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * tinaioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-static int
-tinaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- struct tina_softc *sc = &tina_sc[minor(dev)];
- u_short iobase = sc->sc_iobase;
- int error = 0;
- int s;
-
- if(minor(dev))
- return(ENODEV);
-
- s = splimp();
-
- switch(cmd)
- {
- /* hardware layer - control & status register */
-
- case ISDN_GETCSR: /* return control register */
- *(unsigned char *)data = inb(iobase + CTRL_STAT);
- break;
-
- case ISDN_SETCSR: /* set status register */
- outb((iobase + CTRL_STAT), *(unsigned char *)data);
- break;
-
- /* hardware layer - dual ported memory */
-
- case ISDN_GETBLK: /* get block from dual port mem */
- readblock(iobase, (*(struct record *)data).addr,
- (*(struct record *)data).data,
- (*(struct record *)data).length);
- break;
-
- case ISDN_SETBLK: /* write block to dual port mem */
- writeblock(iobase, (*(struct record *)data).data,
- (*(struct record *)data).addr,
- (*(struct record *)data).length);
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * tinapoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static int
-tinapoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-/*===========================================================================*
- * tina dual ported memory access
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * setup address for accessing tina-dd ram
- *---------------------------------------------------------------------------*/
-static void
-setupaddr(unsigned short iobase, unsigned int addr)
-{
- outb((iobase + ADDR_CNTL), (unsigned char) addr & 0xff);
- outb((iobase + ADDR_CNTM), (unsigned char) ((addr >> 8) & 0xff));
- outb((iobase + ADDR_CNTH), (unsigned char) ((addr >> 16) & 0xff));
-}
-
-
-/*---------------------------------------------------------------------------*
- * read block from tina-dd dual ported ram
- *---------------------------------------------------------------------------*/
-static void
-readblock(unsigned short iobase, unsigned int addr,
- unsigned char *dst, unsigned int len)
-{
- setupaddr(iobase, addr); /* setup start address */
-
- while(len--) /* tina-dd mem -> pc mem */
- *dst++ = inb(iobase + DATA_LOW_INC);
-}
-
-/*---------------------------------------------------------------------------*
- * write block to tina-dd dual ported ram
- *---------------------------------------------------------------------------*/
-static void
-writeblock(unsigned short iobase, unsigned char *src,
- unsigned long addr, int len)
-{
- setupaddr(iobase, addr); /* setup start address */
-
- while(len--) /* pc mem -> tina-dd mem */
- outb((iobase + DATA_LOW_INC), *src++);
-}
-
-#endif /* NTINA > 0 */
diff --git a/sys/i4b/tina-dd/i4b_tina_ioctl.h b/sys/i4b/tina-dd/i4b_tina_ioctl.h
deleted file mode 100644
index d51f16d731a4..000000000000
--- a/sys/i4b/tina-dd/i4b_tina_ioctl.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1994, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Based on code written by Stollmann GmbH, Hamburg. Many thanks to
- * Christian Luehrs and Manfred Jung for docs, sources and answers!
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tina_ioctl.h - i4b Stollman Tina-dd ioctl header file
- * ---------------------------------------------------------
- *
- * $Id: i4b_tina_ioctl.h,v 1.2 1998/12/05 18:06:20 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:41:51 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TINA_IOCTL_H_
-#define _I4B_TINA_IOCTL_H_
-
-#define TINA_IOSIZE 8 /* 8 byte wide iospace occupied */
-
-/*---------------------------------------------------------------------------*
- * register offsets in i/o address space
- *---------------------------------------------------------------------------*/
-
-#define CTRL_STAT 0 /* control & status */
-
-#define ADDR_CNTL 1 /* address pointer low */
-#define ADDR_CNTM 2 /* address pointer mid */
-#define ADDR_CNTH 3 /* address pointer high */
-
-#define DATA_LOW 4 /* data register low */
-#define DATA_HIGH 5 /* data register high */
-
-#define DATA_LOW_INC 6 /* data register low, post inc */
-#define DATA_HIGH_INC 7 /* data register high, post inc */
-
-/*---------------------------------------------------------------------------*
- * status register (CTRL_STAT read access)
- *---------------------------------------------------------------------------*/
-
-#define CR_INTC 0x80 /* irq FROM tina-dd TO pc active */
-#define CR_INTP 0x40 /* irq FROM pc TO tina-dd active */
-#define CR_INTPA 0x20 /* irq FROM pc TO tina-dd active */
-#define CR_NMI 0x10 /* nmi FROM PC TO tina-dd active */
-#define CR_FLASHLD 0x08 /* read of the FLASHLD-bit (n/c) */
-#define CR_S2C 0x04 /* info bit */
-#define CR_S1C 0x02 /* info bit */
-#define CR_S0C 0x01 /* info bit */
-
-/*---------------------------------------------------------------------------*
- * control register (CTRL_STAT write access)
- *---------------------------------------------------------------------------*/
-
-#define CR_CLR_INTC 0x80 /* clear irq on tina-dd */
-#define CR_SET_INTP 0x40 /* trigger irq on tina-dd */
-#define CR_RESET 0x20 /* reset tina-dd */
-#define CR_SET_NMI 0x10 /* trigger nmi on tina-dd */
-#define CR_SET_FLASHLD 0x08 /* activates pin FLASHLD (n/c) */
-#define CR_S2P 0x04 /* info bit (not readable !) */
-#define CR_S1P 0x02 /* info bit (not readable !) */
-#define CR_S0P 0x01 /* info bit (not readable !) */
-
-/*---------------------------------------------------------------------------*
- * misc definitions in dual-ported mem on board of tina-dd
- *---------------------------------------------------------------------------*/
-
-#define FW_SYSCB 0x200 /* address of FW SYSCB / MJ 300392 */
-#define FW_SINFO_NAME 0x220 /* address of general info label */
-
-#define FW_HW_TYPE 0x224 /* address of hardware type byte: */
-#define FW_HW_UNDEF 0x00 /* undefined .. */
-#define FW_HW_TINA_DD 0x10 /* TINA-dd */
-#define FW_HW_TINA_DS 0x20 /* TINA-ds (B channel/ser ?) */
-#define FW_HW_TINA_D 0x30 /* TINA-d (one B channel ?) */
-#define FW_HW_TINA_DDM 0x40 /* TINA-dd with fax module */
-#define FW_HW_TINA_DDS 0x50 /* TINA-dd with fax/voice module */
-#define FW_HW_SICCE 0x80 /* X.25 board */
-#define FW_HW_ASIC 0x01 /* ASIC version bit */
-
-#define FW_STAT 0x228 /* address of firmware status byte */
-#define FW_READY 0x20 /* firmware ready bit */
-#define FW_BOOTPRM_RDY 0x02 /* boot PROM ready */
-#define FW_UNDEF_0 0x00 /* undefined */
-#define FW_UNDEF_1 0xFF /* undefined */
-
-#define FW_SINFO_ID "SYSI" /* general info label for FW > 2.13*/
-#define FW_SINFO_ID_LEN 4
-
-#define FW_ADDR_PROFPTR 0x260 /* addr of ptr to board profile */
-
-/*===========================================================================*
- * Layer 0 - Hardware layer
- *===========================================================================*/
-
-/* control and status register access */
-
-#define ISDN_GETCSR _IOR('I', 1, unsigned char) /* get csr */
-#define ISDN_SETCSR _IOW('I', 2, unsigned char) /* set csr */
-
-/* dual ported ram access */
-
-#define ISDN_GETBLK _IOWR('I', 3, struct record) /* get dpr record */
-#define ISDN_SETBLK _IOW('I', 4, struct record) /* set dpr record */
-
-/*---------------------------------------------------------------------------*
- * record structure for dual ported ram block rd/wr
- *---------------------------------------------------------------------------*/
-struct record {
- unsigned int length; /* length of data block */
- unsigned int addr; /* address of mem on tina-dd board */
- unsigned char *data; /* pointer to the datablock itself */
-};
-
-#endif /* _I4B_TINA_IOCTL_H_ */
diff --git a/sys/isa/isareg.h b/sys/isa/isareg.h
index 644755a6e6ea..8739e3cd191e 100644
--- a/sys/isa/isareg.h
+++ b/sys/isa/isareg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isareg.h,v 1.1 1998/08/06 08:49:09 dfr Exp $
+ * $Id: isa.h,v 1.21 1997/02/22 09:36:41 peter Exp $
*/
#ifdef PC98
@@ -147,7 +147,7 @@
#define IO_ISASIZES
#define IO_ASCSIZE 5 /* AmiScan GI1904-based hand scanner */
-#define IO_CGASIZE 12 /* CGA controllers */
+#define IO_CGASIZE 16 /* CGA controllers */
#define IO_COMSIZE 8 /* 8250, 16x50 com controllers */
#define IO_DMASIZE 16 /* 8237 DMA controllers */
#define IO_DPGSIZE 32 /* 74LS612 DMA page registers */
@@ -158,10 +158,9 @@
#define IO_ICUSIZE 16 /* 8259A interrupt controllers */
#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */
#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */
-#define IO_MDASIZE 12 /* Monochrome display controllers */
+#define IO_MDASIZE 16 /* Monochrome display controllers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_PMPSIZE 2 /* 82347 power management peripheral */
-#define IO_PSMSIZE 5 /* 8042 Keyboard controllers */
#define IO_RTCSIZE 16 /* CMOS real time clock, NMI control */
#define IO_TMRSIZE 16 /* 8253 programmable timers */
#define IO_VGASIZE 16 /* VGA controllers */
diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h
index bb8ee55c780f..756333a58378 100644
--- a/sys/isa/isavar.h
+++ b/sys/isa/isavar.h
@@ -23,34 +23,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isavar.h,v 1.1 1998/08/06 08:49:09 dfr Exp $
+ * $Id$
*/
-#define ISA_NPORT_IVARS 2
-#define ISA_NMEM_IVARS 2
-#define ISA_NIRQ_IVARS 2
-#define ISA_NDRQ_IVARS 2
-
enum isa_device_ivars {
- ISA_IVAR_PORT,
- ISA_IVAR_PORT_0 = ISA_IVAR_PORT,
- ISA_IVAR_PORT_1,
- ISA_IVAR_PORTSIZE,
- ISA_IVAR_PORTSIZE_0 = ISA_IVAR_PORTSIZE,
- ISA_IVAR_PORTSIZE_1,
- ISA_IVAR_MADDR,
- ISA_IVAR_MADDR_0 = ISA_IVAR_MADDR,
- ISA_IVAR_MADDR_1,
- ISA_IVAR_MSIZE,
- ISA_IVAR_MSIZE_0 = ISA_IVAR_MSIZE,
- ISA_IVAR_MSIZE_1,
- ISA_IVAR_FLAGS,
- ISA_IVAR_IRQ,
- ISA_IVAR_IRQ_0 = ISA_IVAR_IRQ,
- ISA_IVAR_IRQ_1,
- ISA_IVAR_DRQ,
- ISA_IVAR_DRQ_0 = ISA_IVAR_DRQ,
- ISA_IVAR_DRQ_1
+ ISA_IVAR_PORT,
+ ISA_IVAR_PORTSIZE,
+ ISA_IVAR_FLAGS,
+ ISA_IVAR_IRQ
};
extern int isa_irq_pending(void);
diff --git a/sys/isa/kbdio.c b/sys/isa/kbdio.c
index 5243d42a06d5..ca1565d5bd74 100644
--- a/sys/isa/kbdio.c
+++ b/sys/isa/kbdio.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kbdio.c,v 1.13 1998/08/06 09:15:53 dfr Exp $
+ * $Id$
* from: i386/isa kbdio.c,v 1.12
*/
@@ -40,7 +40,7 @@
#include <sys/systm.h>
#include <sys/syslog.h>
#include <machine/clock.h>
-#include <isa/kbdio.h>
+#include <i386/isa/kbdio.h>
/*
* driver specific options: the following options may be set by
diff --git a/sys/isa/kbdio.h b/sys/isa/kbdio.h
index 3aa0a0346e8e..5bdb5be7aee9 100644
--- a/sys/isa/kbdio.h
+++ b/sys/isa/kbdio.h
@@ -26,12 +26,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kbdio.h,v 1.9 1999/01/06 05:49:30 yokota Exp $
+ * $Id$
* from: i386/isa kbdio.h,v 1.7
*/
-#ifndef _ISA_KBDIO_H_
-#define _ISA_KBDIO_H_
+#ifndef _I386_ISA_KBDIO_H_
+#define _I386_ISA_KBDIO_H_
/* constants */
@@ -52,6 +52,9 @@
*/
#endif /* PC98 */
+/* FIXME: `IO_PSMSIZE' should really be in `isa.h'. */
+#define IO_PSMSIZE (KBD_COMMAND_PORT - KBD_DATA_PORT + 1) /* 5 */
+
/* controller commands (sent to KBD_COMMAND_PORT) */
#define KBDC_SET_COMMAND_BYTE 0x0060
#define KBDC_GET_COMMAND_BYTE 0x0020
@@ -204,4 +207,4 @@ int set_controller_command_byte __P((KBDC kbdc, int command, int flag));
#endif /* KERNEL */
-#endif /* !_ISA_KBDIO_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
deleted file mode 100644
index 5b999e1b36af..000000000000
--- a/sys/isa/psm.c
+++ /dev/null
@@ -1,2222 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993 Erik Forsberg.
- * Copyright (c) 1996, 1997 Kazutaka YOKOTA.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY ``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 I 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.
- *
- * $Id: psm.c,v 1.1 1998/11/08 18:43:03 dfr Exp $
- */
-
-/*
- * Ported to 386bsd Oct 17, 1992
- * Sandi Donno, Computer Science, University of Cape Town, South Africa
- * Please send bug reports to sandi@cs.uct.ac.za
- *
- * Thanks are also due to Rick Macklem, rick@snowhite.cis.uoguelph.ca -
- * although I was only partially successful in getting the alpha release
- * of his "driver for the Logitech and ATI Inport Bus mice for use with
- * 386bsd and the X386 port" to work with my Microsoft mouse, I nevertheless
- * found his code to be an invaluable reference when porting this driver
- * to 386bsd.
- *
- * Further modifications for latest 386BSD+patchkit and port to NetBSD,
- * Andrew Herbert <andrew@werple.apana.org.au> - 8 June 1993
- *
- * Cloned from the Microsoft Bus Mouse driver, also by Erik Forsberg, by
- * Andrew Herbert - 12 June 1993
- *
- * Modified for PS/2 mouse by Charles Hannum <mycroft@ai.mit.edu>
- * - 13 June 1993
- *
- * Modified for PS/2 AUX mouse by Shoji Yuen <yuen@nuie.nagoya-u.ac.jp>
- * - 24 October 1993
- *
- * Hardware access routines and probe logic rewritten by
- * Kazutaka Yokota <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * - 3, 14, 22 October 1996.
- * - 12 November 1996. IOCTLs and rearranging `psmread', `psmioctl'...
- * - 14, 30 November 1996. Uses `kbdio.c'.
- * - 13 December 1996. Uses queuing version of `kbdio.c'.
- * - January/February 1997. Tweaked probe logic for
- * HiNote UltraII/Latitude/Armada laptops.
- * - 30 July 1997. Added APM support.
- * - 5 March 1997. Defined driver configuration flags (PSM_CONFIG_XXX).
- * Improved sync check logic.
- * Vendor specific support routines.
- */
-
-#include "psm.h"
-#include "opt_devfs.h"
-#include "opt_psm.h"
-
-#if NPSM > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/poll.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-#include <sys/select.h>
-#include <sys/uio.h>
-
-#include <machine/clock.h>
-#include <machine/limits.h>
-#include <machine/mouse.h>
-#include <machine/resource.h>
-
-#include <isa/isareg.h>
-#include <isa/isavar.h>
-#include <isa/kbdio.h>
-
-/*
- * Driver specific options: the following options may be set by
- * `options' statements in the kernel configuration file.
- */
-
-/* debugging */
-#ifndef PSM_DEBUG
-#define PSM_DEBUG 0 /* logging: 0: none, 1: brief, 2: verbose */
-#endif
-
-/* features */
-
-/* #define PSM_HOOKAPM hook the APM resume event */
-/* #define PSM_RESETAFTERSUSPEND reset the device at the resume event */
-
-#if NAPM <= 0
-#undef PSM_HOOKAPM
-#endif /* NAPM */
-
-#ifndef PSM_HOOKAPM
-#undef PSM_RESETAFTERSUSPEND
-#endif /* PSM_HOOKAPM */
-
-/* end of driver specific options */
-
-/* input queue */
-#define PSM_BUFSIZE 960
-#define PSM_SMALLBUFSIZE 240
-
-/* operation levels */
-#define PSM_LEVEL_BASE 0
-#define PSM_LEVEL_STANDARD 1
-#define PSM_LEVEL_NATIVE 2
-#define PSM_LEVEL_MIN PSM_LEVEL_BASE
-#define PSM_LEVEL_MAX PSM_LEVEL_NATIVE
-
-/* some macros */
-#define PSM_UNIT(dev) (minor(dev) >> 1)
-#define PSM_NBLOCKIO(dev) (minor(dev) & 1)
-#define PSM_MKMINOR(unit,block) (((unit) << 1) | ((block) ? 0:1))
-
-#ifndef max
-#define max(x,y) ((x) > (y) ? (x) : (y))
-#endif
-#ifndef min
-#define min(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
-/* ring buffer */
-typedef struct ringbuf {
- int count; /* # of valid elements in the buffer */
- int head; /* head pointer */
- int tail; /* tail poiner */
- unsigned char buf[PSM_BUFSIZE];
-} ringbuf_t;
-
-/* driver control block */
-struct psm_softc { /* Driver status information */
- struct selinfo rsel; /* Process selecting for Input */
- unsigned char state; /* Mouse driver state */
- int config; /* driver configuration flags */
- int flags; /* other flags */
- KBDC kbdc; /* handle to access the keyboard controller */
- int addr; /* I/O port address */
- mousehw_t hw; /* hardware information */
- mousemode_t mode; /* operation mode */
- mousemode_t dflt_mode; /* default operation mode */
- mousestatus_t status; /* accumulated mouse movement */
- ringbuf_t queue; /* mouse status queue */
- unsigned char ipacket[16]; /* interim input buffer */
- int inputbytes; /* # of bytes in the input buffer */
- int button; /* the latest button state */
-#ifdef DEVFS
- void *devfs_token;
- void *b_devfs_token;
-#endif
-#ifdef PSM_HOOKAPM
- struct apmhook resumehook;
-#endif
-};
-devclass_t psm_devclass;
-#define PSM_SOFTC(unit) ((struct psm_softc*)devclass_get_softc(psm_devclass, unit))
-
-/* driver state flags (state) */
-#define PSM_VALID 0x80
-#define PSM_OPEN 1 /* Device is open */
-#define PSM_ASLP 2 /* Waiting for mouse data */
-
-/* driver configuration flags (config) */
-#define PSM_CONFIG_RESOLUTION 0x000f /* resolution */
-#define PSM_CONFIG_ACCEL 0x00f0 /* acceleration factor */
-#define PSM_CONFIG_NOCHECKSYNC 0x0100 /* disable sync. test */
-
-#define PSM_CONFIG_FLAGS (PSM_CONFIG_RESOLUTION \
- | PSM_CONFIG_ACCEL \
- | PSM_CONFIG_NOCHECKSYNC)
-
-/* other flags (flags) */
-/*
- * Pass mouse data packet to the user land program `as is', even if
- * the mouse has vendor-specific enhanced features and uses non-standard
- * packet format. Otherwise manipulate the mouse data packet so that
- * it can be recognized by the programs which can only understand
- * the standard packet format.
-*/
-#define PSM_FLAGS_NATIVEMODE 0x0200
-
-/* for backward compatibility */
-#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
-#define OLD_MOUSE_GETMODE _IOR('M', 2, old_mousemode_t)
-#define OLD_MOUSE_SETMODE _IOW('M', 3, old_mousemode_t)
-
-typedef struct old_mousehw {
- int buttons;
- int iftype;
- int type;
- int hwid;
-} old_mousehw_t;
-
-typedef struct old_mousemode {
- int protocol;
- int rate;
- int resolution;
- int accelfactor;
-} old_mousemode_t;
-
-/* packet formatting function */
-typedef int packetfunc_t __P((struct psm_softc *, unsigned char *,
- int *, int, mousestatus_t *));
-
-/* function prototypes */
-static int psmprobe __P((device_t));
-static int psmattach __P((device_t));
-#ifdef PSM_HOOKAPM
-static int psmresume __P((void *));
-#endif
-
-static d_open_t psmopen;
-static d_close_t psmclose;
-static d_read_t psmread;
-static d_ioctl_t psmioctl;
-static d_poll_t psmpoll;
-
-static int enable_aux_dev __P((KBDC));
-static int disable_aux_dev __P((KBDC));
-static int get_mouse_status __P((KBDC, int *, int, int));
-static int get_aux_id __P((KBDC));
-static int set_mouse_sampling_rate __P((KBDC, int));
-static int set_mouse_scaling __P((KBDC, int));
-static int set_mouse_resolution __P((KBDC, int));
-static int set_mouse_mode __P((KBDC));
-static int get_mouse_buttons __P((KBDC));
-static int is_a_mouse __P((int));
-static void recover_from_error __P((KBDC));
-static int restore_controller __P((KBDC, int));
-static int reinitialize __P((int, mousemode_t *));
-static int doopen __P((int, int));
-static char *model_name(int);
-static void psmintr(void*);
-
-/* vendor specific features */
-typedef int probefunc_t __P((struct psm_softc *));
-
-static int mouse_id_proc1 __P((KBDC, int, int, int *));
-static probefunc_t enable_groller;
-static probefunc_t enable_gmouse;
-static probefunc_t enable_aglide;
-static probefunc_t enable_kmouse;
-static probefunc_t enable_msintelli;
-static probefunc_t enable_mmanplus;
-static int tame_mouse __P((struct psm_softc *, mousestatus_t *, unsigned char *));
-
-static struct {
- int model;
- unsigned char syncmask;
- int packetsize;
- probefunc_t *probefunc;
-} vendortype[] = {
- { MOUSE_MODEL_NET, /* Genius NetMouse */
- 0xc8, MOUSE_INTELLI_PACKETSIZE, enable_gmouse, },
- { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */
- 0xc8, 6, enable_groller, },
- { MOUSE_MODEL_GLIDEPOINT, /* ALPS GlidePoint */
- 0xc0, MOUSE_PS2_PACKETSIZE, enable_aglide, },
- { MOUSE_MODEL_MOUSEMANPLUS, /* Logitech MouseMan+ */
- 0x08, MOUSE_PS2_PACKETSIZE, enable_mmanplus, },
- { MOUSE_MODEL_THINK, /* Kensignton ThinkingMouse */
- 0x80, MOUSE_PS2_PACKETSIZE, enable_kmouse, },
- { MOUSE_MODEL_INTELLI, /* Microsoft IntelliMouse */
- 0xc8, MOUSE_INTELLI_PACKETSIZE, enable_msintelli, },
- { MOUSE_MODEL_GENERIC,
- 0xc0, MOUSE_PS2_PACKETSIZE, NULL, },
-};
-
-/* device driver declarateion */
-static device_method_t psm_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, psmprobe),
- DEVMETHOD(device_attach, psmattach),
-
- { 0, 0 }
-};
-
-static driver_t psm_driver = {
- "psm",
- psm_methods,
- DRIVER_TYPE_TTY,
- sizeof(struct psm_softc),
-};
-
-#define CDEV_MAJOR 21
-
-static struct cdevsw psm_cdevsw = {
- psmopen, psmclose, psmread, nowrite, /* 21 */
- psmioctl, nostop, nullreset, nodevtotty,
- psmpoll, nommap, NULL, "psm", NULL, -1
-};
-
-/* debug message level */
-static int verbose = PSM_DEBUG;
-
-/* device I/O routines */
-static int
-enable_aux_dev(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_ENABLE_DEV);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: ENABLE_DEV return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-disable_aux_dev(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_DISABLE_DEV);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: DISABLE_DEV return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-get_mouse_status(KBDC kbdc, int *status, int flag, int len)
-{
- int cmd;
- int res;
- int i;
-
- switch (flag) {
- case 0:
- default:
- cmd = PSMC_SEND_DEV_STATUS;
- break;
- case 1:
- cmd = PSMC_SEND_DEV_DATA;
- break;
- }
- empty_aux_buffer(kbdc, 5);
- res = send_aux_command(kbdc, cmd);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SEND_AUX_DEV_%s return code:%04x\n",
- (flag == 1) ? "DATA" : "STATUS", res);
- if (res != PSM_ACK)
- return 0;
-
- for (i = 0; i < len; ++i) {
- status[i] = read_aux_data(kbdc);
- if (status[i] < 0)
- break;
- }
-
- if (verbose) {
- log(LOG_DEBUG, "psm: %s %02x %02x %02x\n",
- (flag == 1) ? "data" : "status", status[0], status[1], status[2]);
- }
-
- return i;
-}
-
-static int
-get_aux_id(KBDC kbdc)
-{
- int res;
- int id;
-
- empty_aux_buffer(kbdc, 5);
- res = send_aux_command(kbdc, PSMC_SEND_DEV_ID);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SEND_DEV_ID return code:%04x\n", res);
- if (res != PSM_ACK)
- return (-1);
-
- /* 10ms delay */
- DELAY(10000);
-
- id = read_aux_data(kbdc);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: device ID: %04x\n", id);
-
- return id;
-}
-
-static int
-set_mouse_sampling_rate(KBDC kbdc, int rate)
-{
- int res;
-
- res = send_aux_command_and_data(kbdc, PSMC_SET_SAMPLING_RATE, rate);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_SAMPLING_RATE (%d) %04x\n", rate, res);
-
- return ((res == PSM_ACK) ? rate : -1);
-}
-
-static int
-set_mouse_scaling(KBDC kbdc, int scale)
-{
- int res;
-
- switch (scale) {
- case 1:
- default:
- scale = PSMC_SET_SCALING11;
- break;
- case 2:
- scale = PSMC_SET_SCALING21;
- break;
- }
- res = send_aux_command(kbdc, scale);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_SCALING%s return code:%04x\n",
- (scale == PSMC_SET_SCALING21) ? "21" : "11", res);
-
- return (res == PSM_ACK);
-}
-
-/* `val' must be 0 through PSMD_MAX_RESOLUTION */
-static int
-set_mouse_resolution(KBDC kbdc, int val)
-{
- int res;
-
- res = send_aux_command_and_data(kbdc, PSMC_SET_RESOLUTION, val);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_RESOLUTION (%d) %04x\n", val, res);
-
- return ((res == PSM_ACK) ? val : -1);
-}
-
-/*
- * NOTE: once `set_mouse_mode()' is called, the mouse device must be
- * re-enabled by calling `enable_aux_dev()'
- */
-static int
-set_mouse_mode(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_SET_STREAM_MODE);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_STREAM_MODE return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-get_mouse_buttons(KBDC kbdc)
-{
- int c = 2; /* assume two buttons by default */
- int status[3];
-
- /*
- * NOTE: a special sequence to obtain Logitech Mouse specific
- * information: set resolution to 25 ppi, set scaling to 1:1, set
- * scaling to 1:1, set scaling to 1:1. Then the second byte of the
- * mouse status bytes is the number of available buttons.
- * Some manufactures also support this sequence.
- */
- if (set_mouse_resolution(kbdc, PSMD_RES_LOW) != PSMD_RES_LOW)
- return c;
- if (set_mouse_scaling(kbdc, 1) && set_mouse_scaling(kbdc, 1)
- && set_mouse_scaling(kbdc, 1)
- && (get_mouse_status(kbdc, status, 0, 3) >= 3)) {
- if (status[1] != 0)
- return status[1];
- }
- return c;
-}
-
-/* misc subroutines */
-/*
- * Someday, I will get the complete list of valid pointing devices and
- * their IDs... XXX
- */
-static int
-is_a_mouse(int id)
-{
-#if 0
- static int valid_ids[] = {
- PSM_MOUSE_ID, /* mouse */
- PSM_BALLPOINT_ID, /* ballpoint device */
- PSM_INTELLI_ID, /* Intellimouse */
- -1 /* end of table */
- };
- int i;
-
- for (i = 0; valid_ids[i] >= 0; ++i)
- if (valid_ids[i] == id)
- return TRUE;
- return FALSE;
-#else
- return TRUE;
-#endif
-}
-
-static char *
-model_name(int model)
-{
- static struct {
- int model_code;
- char *model_name;
- } models[] = {
- { MOUSE_MODEL_NETSCROLL, "NetScroll Mouse" },
- { MOUSE_MODEL_NET, "NetMouse" },
- { MOUSE_MODEL_GLIDEPOINT, "GlidePoint" },
- { MOUSE_MODEL_THINK, "ThinkingMouse" },
- { MOUSE_MODEL_INTELLI, "IntelliMouse" },
- { MOUSE_MODEL_MOUSEMANPLUS, "MouseMan+" },
- { MOUSE_MODEL_GENERIC, "Generic PS/2 mouse" },
- { MOUSE_MODEL_UNKNOWN, NULL },
- };
- int i;
-
- for (i = 0; models[i].model_code != MOUSE_MODEL_UNKNOWN; ++i) {
- if (models[i].model_code == model)
- return models[i].model_name;
- }
- return "Unknown";
-}
-
-static void
-recover_from_error(KBDC kbdc)
-{
- /* discard anything left in the output buffer */
- empty_both_buffers(kbdc, 10);
-
-#if 0
- /*
- * NOTE: KBDC_RESET_KBD may not restore the communication between the
- * keyboard and the controller.
- */
- reset_kbd(kbdc);
-#else
- /*
- * NOTE: somehow diagnostic and keyboard port test commands bring the
- * keyboard back.
- */
- if (!test_controller(kbdc))
- log(LOG_ERR, "psm: keyboard controller failed.\n");
- /* if there isn't a keyboard in the system, the following error is OK */
- if (test_kbd_port(kbdc) != 0) {
- if (verbose)
- log(LOG_ERR, "psm: keyboard port failed.\n");
- }
-#endif
-}
-
-static int
-restore_controller(KBDC kbdc, int command_byte)
-{
- empty_both_buffers(kbdc, 10);
-
- if (!set_controller_command_byte(kbdc, 0xff, command_byte)) {
- log(LOG_ERR, "psm: failed to restore the keyboard controller "
- "command byte.\n");
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-/*
- * Re-initialize the aux port and device. The aux port must be enabled
- * and its interrupt must be disabled before calling this routine.
- * The aux device will be disabled before returning.
- * The keyboard controller must be locked via `kbdc_lock()' before
- * calling this routine.
- */
-static int
-reinitialize(int unit, mousemode_t *mode)
-{
- struct psm_softc *sc = PSM_SOFTC(unit);
- KBDC kbdc = sc->kbdc;
- int stat[3];
- int i;
-
- switch((i = test_aux_port(kbdc))) {
- case 1: /* ignore this error */
- case PSM_ACK:
- if (verbose)
- log(LOG_DEBUG, "psm%d: strange result for test aux port (%d).\n",
- unit, i);
- /* fall though */
- case 0: /* no error */
- break;
- case -1: /* time out */
- default: /* error */
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: the aux port is not functioning (%d).\n",
- unit, i);
- return FALSE;
- }
-
- /*
- * NOTE: some controllers appears to hang the `keyboard' when
- * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(kbdc)) {
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
- return FALSE;
- }
-
- /*
- * both the aux port and the aux device is functioning, see
- * if the device can be enabled.
- */
- if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) {
- log(LOG_ERR, "psm%d: failed to enable the aux device.\n", unit);
- return FALSE;
- }
- empty_both_buffers(kbdc, 10); /* remove stray data if any */
-
- /* FIXME: hardware ID, mouse buttons? */
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- log(LOG_ERR, "psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
- }
-
- sc->hw.model = vendortype[i].model;
- sc->mode.packetsize = vendortype[i].packetsize;
-
- /* set mouse parameters */
- if (mode != (mousemode_t *)NULL) {
- if (mode->rate > 0)
- mode->rate = set_mouse_sampling_rate(kbdc, mode->rate);
- if (mode->resolution >= 0)
- mode->resolution = set_mouse_resolution(kbdc, mode->resolution);
- set_mouse_scaling(kbdc, 1);
- set_mouse_mode(kbdc);
- }
-
- /* request a data packet and extract sync. bits */
- if (get_mouse_status(kbdc, stat, 1, 3) < 3) {
- log(LOG_DEBUG, "psm%d: failed to get data (reinitialize).\n", unit);
- sc->mode.syncmask[0] = 0;
- } else {
- sc->mode.syncmask[1] = stat[0] & sc->mode.syncmask[0]; /* syncbits */
- /* the NetScroll Mouse will send three more bytes... Ignore them */
- empty_aux_buffer(kbdc, 5);
- }
-
- /* just check the status of the mouse */
- if (get_mouse_status(kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (reinitialize).\n", unit);
-
- return TRUE;
-}
-
-static int
-doopen(int unit, int command_byte)
-{
- struct psm_softc *sc = PSM_SOFTC(unit);
- int stat[3];
-
- /* enable the mouse device */
- if (!enable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR: failed to enable the mouse because:
- * 1) the mouse is faulty,
- * 2) the mouse has been removed(!?)
- * In the latter case, the keyboard may have hung, and need
- * recovery procedure...
- */
- recover_from_error(sc->kbdc);
-#if 0
- /* FIXME: we could reset the mouse here and try to enable
- * it again. But it will take long time and it's not a good
- * idea to disable the keyboard that long...
- */
- if (!reinitialize(unit, &sc->mode) || !enable_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
-#else
- {
-#endif
- restore_controller(sc->kbdc, command_byte);
- /* mark this device is no longer available */
- sc->state &= ~PSM_VALID;
- log(LOG_ERR, "psm%d: failed to enable the device (doopen).\n",
- unit);
- return (EIO);
- }
- }
-
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (doopen).\n", unit);
-
- /* enable the aux port and interrupt */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_ENABLE_AUX_PORT | KBD_ENABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- disable_aux_dev(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- log(LOG_ERR, "psm%d: failed to enable the aux interrupt (doopen).\n",
- unit);
- return (EIO);
- }
-
- return (0);
-}
-
-/* psm driver entry points */
-
-#define endprobe(v) { if (bootverbose) \
- --verbose; \
- kbdc_set_device_mask(sc->kbdc, mask); \
- kbdc_lock(sc->kbdc, FALSE); \
- free(sc, M_DEVBUF); \
- return (v); \
- }
-
-static int
-psmprobe(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct psm_softc *sc = device_get_softc(dev);
- int stat[3];
- int command_byte;
- int mask;
- int i;
-
-#if 0
- kbdc_debug(TRUE);
-#endif
- sc->addr = isa_get_port(dev);
- sc->kbdc = kbdc_open(sc->addr);
- sc->config = isa_get_flags(dev) & PSM_CONFIG_FLAGS;
- sc->flags = 0;
- if (bootverbose)
- ++verbose;
-
- if (!kbdc_lock(sc->kbdc, TRUE)) {
- printf("psm%d: unable to lock the controller.\n", unit);
- if (bootverbose)
- --verbose;
- return (ENXIO);
- }
-
- /*
- * NOTE: two bits in the command byte controls the operation of the
- * aux port (mouse port): the aux port disable bit (bit 5) and the aux
- * port interrupt (IRQ 12) enable bit (bit 2).
- */
-
- /* discard anything left after the keyboard initialization */
- empty_both_buffers(sc->kbdc, 10);
-
- /* save the current command byte; it will be used later */
- mask = kbdc_get_device_mask(sc->kbdc) & ~KBD_AUX_CONTROL_BITS;
- command_byte = get_controller_command_byte(sc->kbdc);
- if (verbose)
- printf("psm%d: current command byte:%04x\n", unit, command_byte);
- if (command_byte == -1) {
- /* CONTROLLER ERROR */
- printf("psm%d: unable to get the current command byte value.\n",
- unit);
- endprobe(ENXIO);
- }
-
- /*
- * disable the keyboard port while probing the aux port, which must be
- * enabled during this routine
- */
- if (!set_controller_command_byte(sc->kbdc,
- KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS,
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /*
- * this is CONTROLLER ERROR; I don't know how to recover
- * from this error...
- */
- restore_controller(sc->kbdc, command_byte);
- printf("psm%d: unable to set the command byte.\n", unit);
- endprobe(ENXIO);
- }
-
- /*
- * NOTE: `test_aux_port()' is designed to return with zero if the aux
- * port exists and is functioning. However, some controllers appears
- * to respond with zero even when the aux port doesn't exist. (It may
- * be that this is only the case when the controller DOES have the aux
- * port but the port is not wired on the motherboard.) The keyboard
- * controllers without the port, such as the original AT, are
- * supporsed to return with an error code or simply time out. In any
- * case, we have to continue probing the port even when the controller
- * passes this test.
- *
- * XXX: some controllers erroneously return the error code 1 when
- * it has the perfectly functional aux port. We have to ignore this
- * error code. Even if the controller HAS error with the aux port,
- * it will be detected later...
- * XXX: another incompatible controller returns PSM_ACK (0xfa)...
- */
- switch ((i = test_aux_port(sc->kbdc))) {
- case 1: /* ignore this error */
- case PSM_ACK:
- if (verbose)
- printf("psm%d: strange result for test aux port (%d).\n",
- unit, i);
- /* fall though */
- case 0: /* no error */
- break;
- case -1: /* time out */
- default: /* error */
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: the aux port is not functioning (%d).\n",
- unit, i);
- endprobe(ENXIO);
- }
-
- /*
- * NOTE: some controllers appears to hang the `keyboard' when the aux
- * port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to reset the aux device.\n", unit);
- endprobe(ENXIO);
- }
- /*
- * both the aux port and the aux device is functioning, see if the
- * device can be enabled. NOTE: when enabled, the device will start
- * sending data; we shall immediately disable the device once we know
- * the device can be enabled.
- */
- if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR */
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to enable the aux device.\n", unit);
- endprobe(ENXIO);
- }
-
- /* save the default values after reset */
- if (get_mouse_status(sc->kbdc, stat, 0, 3) >= 3) {
- sc->dflt_mode.rate = sc->mode.rate = stat[2];
- sc->dflt_mode.resolution = sc->mode.resolution = stat[1];
- } else {
- sc->dflt_mode.rate = sc->mode.rate = -1;
- sc->dflt_mode.resolution = sc->mode.resolution = -1;
- }
-
- /* hardware information */
- sc->hw.iftype = MOUSE_IF_PS2;
-
- /* verify the device is a mouse */
- sc->hw.hwid = get_aux_id(sc->kbdc);
- if (!is_a_mouse(sc->hw.hwid)) {
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: unknown device type (%d).\n", unit, sc->hw.hwid);
- endprobe(ENXIO);
- }
- switch (sc->hw.hwid) {
- case PSM_BALLPOINT_ID:
- sc->hw.type = MOUSE_TRACKBALL;
- break;
- case PSM_MOUSE_ID:
- case PSM_INTELLI_ID:
- sc->hw.type = MOUSE_MOUSE;
- break;
- default:
- sc->hw.type = MOUSE_UNKNOWN;
- break;
- }
-
- /* # of buttons */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- printf("psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
- }
-
- sc->hw.model = vendortype[i].model;
-
- sc->dflt_mode.level = PSM_LEVEL_BASE;
- sc->dflt_mode.packetsize = MOUSE_PS2_PACKETSIZE;
- sc->dflt_mode.accelfactor = (sc->config & PSM_CONFIG_ACCEL) >> 4;
- if (sc->config & PSM_CONFIG_NOCHECKSYNC)
- sc->dflt_mode.syncmask[0] = 0;
- else
- sc->dflt_mode.syncmask[0] = vendortype[i].syncmask;
- sc->dflt_mode.syncmask[1] = 0; /* syncbits */
- sc->mode = sc->dflt_mode;
- sc->mode.packetsize = vendortype[i].packetsize;
-
- /* set mouse parameters */
- i = send_aux_command(sc->kbdc, PSMC_SET_DEFAULTS);
- if (verbose >= 2)
- printf("psm%d: SET_DEFAULTS return code:%04x\n", unit, i);
- if (sc->config & PSM_CONFIG_RESOLUTION) {
- sc->mode.resolution
- = set_mouse_resolution(sc->kbdc,
- (sc->config & PSM_CONFIG_RESOLUTION) - 1);
- }
-
- /* request a data packet and extract sync. bits */
- if (get_mouse_status(sc->kbdc, stat, 1, 3) < 3) {
- printf("psm%d: failed to get data.\n", unit);
- sc->mode.syncmask[0] = 0;
- } else {
- sc->mode.syncmask[1] = stat[0] & sc->mode.syncmask[0]; /* syncbits */
- /* the NetScroll Mouse will send three more bytes... Ignore them */
- empty_aux_buffer(sc->kbdc, 5);
- }
-
- /* just check the status of the mouse */
- /*
- * NOTE: XXX there are some arcane controller/mouse combinations out
- * there, which hung the controller unless there is data transmission
- * after ACK from the mouse.
- */
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3) {
- printf("psm%d: failed to get status.\n", unit);
- } else {
- /*
- * When in its native mode, some mice operate with different
- * default parameters than in the PS/2 compatible mode.
- */
- sc->dflt_mode.rate = sc->mode.rate = stat[2];
- sc->dflt_mode.resolution = sc->mode.resolution = stat[1];
- }
-
- /* disable the aux port for now... */
- if (!set_controller_command_byte(sc->kbdc,
- KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS,
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /*
- * this is CONTROLLER ERROR; I don't know the proper way to
- * recover from this error...
- */
- restore_controller(sc->kbdc, command_byte);
- printf("psm%d: unable to set the command byte.\n", unit);
- endprobe(ENXIO);
- }
-
- /* done */
- kbdc_set_device_mask(sc->kbdc, mask | KBD_AUX_CONTROL_BITS);
- kbdc_lock(sc->kbdc, FALSE);
- return (0);
-}
-
-static int
-psmattach(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct psm_softc *sc = device_get_softc(dev);
- void *ih;
- struct resource *res;
- int zero = 0;
-
- if (sc == NULL) /* shouldn't happen */
- return (ENXIO);
-
- /* Setup initial state */
- sc->state = PSM_VALID;
-
- /* Done */
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, FALSE),
- DV_CHR, 0, 0, 0666, "psm%d", unit);
- sc->b_devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, TRUE),
- DV_CHR, 0, 0, 0666, "bpsm%d", unit);
-#endif /* DEVFS */
-
-#ifdef PSM_HOOKAPM
- sc->resumehook.ah_name = "PS/2 mouse";
- sc->resumehook.ah_fun = psmresume;
- sc->resumehook.ah_arg = (void *)unit;
- sc->resumehook.ah_order = APM_MID_ORDER;
- apm_hook_establish(APM_HOOK_RESUME , &sc->resumehook);
- if (verbose)
- printf("psm%d: APM hooks installed.\n", unit);
-#endif /* PSM_HOOKAPM */
-
- if (!verbose) {
- printf("psm%d: model %s, device ID %d\n",
- unit, model_name(sc->hw.model), sc->hw.hwid);
- } else {
- printf("psm%d: model %s, device ID %d, %d buttons\n",
- unit, model_name(sc->hw.model), sc->hw.hwid, sc->hw.buttons);
- printf("psm%d: config:%08x, flags:%08x, packet size:%d\n",
- unit, sc->config, sc->flags, sc->mode.packetsize);
- printf("psm%d: syncmask:%02x, syncbits:%02x\n",
- unit, sc->mode.syncmask[0], sc->mode.syncmask[1]);
- }
-
- if (bootverbose)
- --verbose;
-
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, psmintr, sc,
- &ih);
-
- return (0);
-}
-
-static int
-psmopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = PSM_UNIT(dev);
- struct psm_softc *sc;
- int command_byte;
- int err;
- int s;
-
- /* Validate unit number */
- if (unit >= NPSM)
- return (ENXIO);
-
- /* Get device data */
- sc = PSM_SOFTC(unit);
- if ((sc == NULL) || (sc->state & PSM_VALID) == 0)
- /* the device is no longer valid/functioning */
- return (ENXIO);
-
- /* Disallow multiple opens */
- if (sc->state & PSM_OPEN)
- return (EBUSY);
-
- device_busy(devclass_get_device(psm_devclass, unit));
-
- /* Initialize state */
- sc->rsel.si_flags = 0;
- sc->rsel.si_pid = 0;
- sc->mode.level = sc->dflt_mode.level;
- sc->mode.protocol = sc->dflt_mode.protocol;
-
- /* flush the event queue */
- sc->queue.count = 0;
- sc->queue.head = 0;
- sc->queue.tail = 0;
- sc->status.flags = 0;
- sc->status.button = 0;
- sc->status.obutton = 0;
- sc->status.dx = 0;
- sc->status.dy = 0;
- sc->status.dz = 0;
- sc->button = 0;
-
- /* empty input buffer */
- bzero(sc->ipacket, sizeof(sc->ipacket));
- sc->inputbytes = 0;
-
- /* don't let timeout routines in the keyboard driver to poll the kbdc */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
-
- /* save the current controller command byte */
- s = spltty();
- command_byte = get_controller_command_byte(sc->kbdc);
-
- /* enable the aux port and temporalily disable the keyboard */
- if ((command_byte == -1)
- || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR; do you know how to get out of this? */
- kbdc_lock(sc->kbdc, FALSE);
- splx(s);
- log(LOG_ERR, "psm%d: unable to set the command byte (psmopen).\n",
- unit);
- return (EIO);
- }
- /*
- * Now that the keyboard controller is told not to generate
- * the keyboard and mouse interrupts, call `splx()' to allow
- * the other tty interrupts. The clock interrupt may also occur,
- * but timeout routines will be blocked by the poll flag set
- * via `kbdc_lock()'
- */
- splx(s);
-
- /* enable the mouse device */
- err = doopen(unit, command_byte);
-
- /* done */
- if (err == 0)
- sc->state |= PSM_OPEN;
- kbdc_lock(sc->kbdc, FALSE);
- return (err);
-}
-
-static int
-psmclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = PSM_UNIT(dev);
- struct psm_softc *sc = PSM_SOFTC(unit);
- int stat[3];
- int command_byte;
- int s;
-
- /* don't let timeout routines in the keyboard driver to poll the kbdc */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
-
- /* save the current controller command byte */
- s = spltty();
- command_byte = get_controller_command_byte(sc->kbdc);
- if (command_byte == -1) {
- kbdc_lock(sc->kbdc, FALSE);
- splx(s);
- return (EIO);
- }
-
- /* disable the aux interrupt and temporalily disable the keyboard */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- log(LOG_ERR, "psm%d: failed to disable the aux int (psmclose).\n",
- PSM_UNIT(dev));
- /* CONTROLLER ERROR;
- * NOTE: we shall force our way through. Because the only
- * ill effect we shall see is that we may not be able
- * to read ACK from the mouse, and it doesn't matter much
- * so long as the mouse will accept the DISABLE command.
- */
- }
- splx(s);
-
- /* remove anything left in the output buffer */
- empty_aux_buffer(sc->kbdc, 10);
-
- /* disable the aux device, port and interrupt */
- if (sc->state & PSM_VALID) {
- if (!disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR;
- * NOTE: we don't return error and continue, pretending
- * we have successfully disabled the device. It's OK because
- * the interrupt routine will discard any data from the mouse
- * hereafter.
- */
- log(LOG_ERR, "psm%d: failed to disable the device (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR;
- * we shall ignore this error; see the above comment.
- */
- log(LOG_ERR, "psm%d: failed to disable the aux port (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- /* remove anything left in the output buffer */
- empty_aux_buffer(sc->kbdc, 10);
-
- /* close is almost always successful */
- sc->state &= ~PSM_OPEN;
- kbdc_lock(sc->kbdc, FALSE);
- device_unbusy(devclass_get_device(psm_devclass, unit));
- return (0);
-}
-
-static int
-tame_mouse(struct psm_softc *sc, mousestatus_t *status, unsigned char *buf)
-{
- static unsigned char butmapps2[8] = {
- 0,
- MOUSE_PS2_BUTTON1DOWN,
- MOUSE_PS2_BUTTON2DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON2DOWN,
- MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON2DOWN | MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON2DOWN | MOUSE_PS2_BUTTON3DOWN,
- };
- static unsigned char butmapmsc[8] = {
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON1UP,
- 0,
- };
- int mapped;
- int i;
-
- if (sc->mode.level == PSM_LEVEL_BASE) {
- mapped = status->button & ~MOUSE_BUTTON4DOWN;
- if (status->button & MOUSE_BUTTON4DOWN)
- mapped |= MOUSE_BUTTON1DOWN;
- status->button = mapped;
- buf[0] = MOUSE_PS2_SYNC | butmapps2[mapped & MOUSE_STDBUTTONS];
- i = max(min(status->dx, 255), -256);
- if (i < 0)
- buf[0] |= MOUSE_PS2_XNEG;
- buf[1] = i;
- i = max(min(status->dy, 255), -256);
- if (i < 0)
- buf[0] |= MOUSE_PS2_YNEG;
- buf[2] = i;
- return MOUSE_PS2_PACKETSIZE;
- } else if (sc->mode.level == PSM_LEVEL_STANDARD) {
- buf[0] = MOUSE_MSC_SYNC | butmapmsc[status->button & MOUSE_STDBUTTONS];
- i = max(min(status->dx, 255), -256);
- buf[1] = i >> 1;
- buf[3] = i - buf[1];
- i = max(min(status->dy, 255), -256);
- buf[2] = i >> 1;
- buf[4] = i - buf[2];
- i = max(min(status->dz, 127), -128);
- buf[5] = (i >> 1) & 0x7f;
- buf[6] = (i - (i >> 1)) & 0x7f;
- buf[7] = (~status->button >> 3) & 0x7f;
- return MOUSE_SYS_PACKETSIZE;
- }
- return sc->inputbytes;;
-}
-
-static int
-psmread(dev_t dev, struct uio *uio, int flag)
-{
- register struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- unsigned char buf[PSM_SMALLBUFSIZE];
- int error = 0;
- int s;
- int l;
-
- if ((sc->state & PSM_VALID) == 0)
- return EIO;
-
- /* block until mouse activity occured */
- s = spltty();
- while (sc->queue.count <= 0) {
- if (PSM_NBLOCKIO(dev)) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->state |= PSM_ASLP;
- error = tsleep((caddr_t) sc, PZERO | PCATCH, "psmrea", 0);
- sc->state &= ~PSM_ASLP;
- if (error) {
- splx(s);
- return error;
- } else if ((sc->state & PSM_VALID) == 0) {
- /* the device disappeared! */
- splx(s);
- return EIO;
- }
- }
- splx(s);
-
- /* copy data to the user land */
- while ((sc->queue.count > 0) && (uio->uio_resid > 0)) {
- s = spltty();
- l = min(sc->queue.count, uio->uio_resid);
- if (l > sizeof(buf))
- l = sizeof(buf);
- if (l > sizeof(sc->queue.buf) - sc->queue.head) {
- bcopy(&sc->queue.buf[sc->queue.head], &buf[0],
- sizeof(sc->queue.buf) - sc->queue.head);
- bcopy(&sc->queue.buf[0],
- &buf[sizeof(sc->queue.buf) - sc->queue.head],
- l - (sizeof(sc->queue.buf) - sc->queue.head));
- } else {
- bcopy(&sc->queue.buf[sc->queue.head], &buf[0], l);
- }
- sc->queue.count -= l;
- sc->queue.head = (sc->queue.head + l) % sizeof(sc->queue.buf);
- splx(s);
- error = uiomove(buf, l, uio);
- if (error)
- break;
- }
-
- return error;
-}
-
-static int
-block_mouse_data(struct psm_softc *sc, int *c)
-{
- int s;
-
- if (!kbdc_lock(sc->kbdc, TRUE))
- return EIO;
-
- s = spltty();
- *c = get_controller_command_byte(sc->kbdc);
- if ((*c == -1)
- || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* this is CONTROLLER ERROR */
- splx(s);
- kbdc_lock(sc->kbdc, FALSE);
- return EIO;
- }
-
- /*
- * The device may be in the middle of status data transmission.
- * The transmission will be interrupted, thus, incomplete status
- * data must be discarded. Although the aux interrupt is disabled
- * at the keyboard controller level, at most one aux interrupt
- * may have already been pending and a data byte is in the
- * output buffer; throw it away. Note that the second argument
- * to `empty_aux_buffer()' is zero, so that the call will just
- * flush the internal queue.
- * `psmintr()' will be invoked after `splx()' if an interrupt is
- * pending; it will see no data and returns immediately.
- */
- empty_aux_buffer(sc->kbdc, 0); /* flush the queue */
- read_aux_data_no_wait(sc->kbdc); /* throw away data if any */
- sc->inputbytes = 0;
- splx(s);
-
- return 0;
-}
-
-static int
-unblock_mouse_data(struct psm_softc *sc, int c)
-{
- int error = 0;
-
- /*
- * We may have seen a part of status data during `set_mouse_XXX()'.
- * they have been queued; flush it.
- */
- empty_aux_buffer(sc->kbdc, 0);
-
- /* restore ports and interrupt */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
- /* CONTROLLER ERROR; this is serious, we may have
- * been left with the inaccessible keyboard and
- * the disabled mouse interrupt.
- */
- error = EIO;
- }
-
- kbdc_lock(sc->kbdc, FALSE);
- return error;
-}
-
-static int
-psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
-{
- struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- mousemode_t mode;
- mousestatus_t status;
-#if (defined(MOUSE_GETVARS))
- mousevar_t *var;
-#endif
- mousedata_t *data;
- int stat[3];
- int command_byte;
- int error = 0;
- int s;
-
- /* Perform IOCTL command */
- switch (cmd) {
-
- case OLD_MOUSE_GETHWINFO:
- s = spltty();
- ((old_mousehw_t *)addr)->buttons = sc->hw.buttons;
- ((old_mousehw_t *)addr)->iftype = sc->hw.iftype;
- ((old_mousehw_t *)addr)->type = sc->hw.type;
- ((old_mousehw_t *)addr)->hwid = sc->hw.hwid;
- splx(s);
- break;
-
- case MOUSE_GETHWINFO:
- s = spltty();
- *(mousehw_t *)addr = sc->hw;
- if (sc->mode.level == PSM_LEVEL_BASE)
- ((mousehw_t *)addr)->model = MOUSE_MODEL_GENERIC;
- splx(s);
- break;
-
- case OLD_MOUSE_GETMODE:
- s = spltty();
- switch (sc->mode.level) {
- case PSM_LEVEL_BASE:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- case PSM_LEVEL_STANDARD:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_SYSMOUSE;
- break;
- case PSM_LEVEL_NATIVE:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- }
- ((old_mousemode_t *)addr)->rate = sc->mode.rate;
- ((old_mousemode_t *)addr)->resolution = sc->mode.resolution;
- ((old_mousemode_t *)addr)->accelfactor = sc->mode.accelfactor;
- splx(s);
- break;
-
- case MOUSE_GETMODE:
- s = spltty();
- *(mousemode_t *)addr = sc->mode;
- ((mousemode_t *)addr)->resolution =
- MOUSE_RES_LOW - sc->mode.resolution;
- switch (sc->mode.level) {
- case PSM_LEVEL_BASE:
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- ((mousemode_t *)addr)->packetsize = MOUSE_PS2_PACKETSIZE;
- break;
- case PSM_LEVEL_STANDARD:
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_SYSMOUSE;
- ((mousemode_t *)addr)->packetsize = MOUSE_SYS_PACKETSIZE;
- ((mousemode_t *)addr)->syncmask[0] = MOUSE_SYS_SYNCMASK;
- ((mousemode_t *)addr)->syncmask[1] = MOUSE_SYS_SYNC;
- break;
- case PSM_LEVEL_NATIVE:
- /* FIXME: this isn't quite correct... XXX */
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- }
- splx(s);
- break;
-
- case OLD_MOUSE_SETMODE:
- case MOUSE_SETMODE:
- if (cmd == OLD_MOUSE_SETMODE) {
- mode.rate = ((old_mousemode_t *)addr)->rate;
- /*
- * resolution old I/F new I/F
- * default 0 0
- * low 1 -2
- * medium low 2 -3
- * medium high 3 -4
- * high 4 -5
- */
- if (((old_mousemode_t *)addr)->resolution > 0)
- mode.resolution = -((old_mousemode_t *)addr)->resolution - 1;
- mode.accelfactor = ((old_mousemode_t *)addr)->accelfactor;
- mode.level = -1;
- } else {
- mode = *(mousemode_t *)addr;
- }
-
- /* adjust and validate parameters. */
- if (mode.rate > UCHAR_MAX)
- return EINVAL;
- if (mode.rate == 0)
- mode.rate = sc->dflt_mode.rate;
- else if (mode.rate == -1)
- /* don't change the current setting */
- ;
- else if (mode.rate < 0)
- return EINVAL;
- if (mode.resolution >= UCHAR_MAX)
- return EINVAL;
- if (mode.resolution >= 200)
- mode.resolution = MOUSE_RES_HIGH;
- else if (mode.resolution >= 100)
- mode.resolution = MOUSE_RES_MEDIUMHIGH;
- else if (mode.resolution >= 50)
- mode.resolution = MOUSE_RES_MEDIUMLOW;
- else if (mode.resolution > 0)
- mode.resolution = MOUSE_RES_LOW;
- if (mode.resolution == MOUSE_RES_DEFAULT)
- mode.resolution = sc->dflt_mode.resolution;
- else if (mode.resolution == -1)
- /* don't change the current setting */
- ;
- else if (mode.resolution < 0) /* MOUSE_RES_LOW/MEDIUM/HIGH */
- mode.resolution = MOUSE_RES_LOW - mode.resolution;
- if (mode.level == -1)
- /* don't change the current setting */
- mode.level = sc->mode.level;
- else if ((mode.level < PSM_LEVEL_MIN) || (mode.level > PSM_LEVEL_MAX))
- return EINVAL;
- if (mode.accelfactor == -1)
- /* don't change the current setting */
- mode.accelfactor = sc->mode.accelfactor;
- else if (mode.accelfactor < 0)
- return EINVAL;
-
- /* don't allow anybody to poll the keyboard controller */
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
-
- /* set mouse parameters */
- if (mode.rate > 0)
- mode.rate = set_mouse_sampling_rate(sc->kbdc, mode.rate);
- if (mode.resolution >= 0)
- mode.resolution = set_mouse_resolution(sc->kbdc, mode.resolution);
- set_mouse_scaling(sc->kbdc, 1);
- get_mouse_status(sc->kbdc, stat, 0, 3);
-
- s = spltty();
- sc->mode.rate = mode.rate;
- sc->mode.resolution = mode.resolution;
- sc->mode.accelfactor = mode.accelfactor;
- sc->mode.level = mode.level;
- splx(s);
-
- unblock_mouse_data(sc, command_byte);
- break;
-
- case MOUSE_GETLEVEL:
- *(int *)addr = sc->mode.level;
- break;
-
- case MOUSE_SETLEVEL:
- if ((*(int *)addr < PSM_LEVEL_MIN) || (*(int *)addr > PSM_LEVEL_MAX))
- return EINVAL;
- sc->mode.level = *(int *)addr;
- break;
-
- case MOUSE_GETSTATUS:
- s = spltty();
- status = sc->status;
- sc->status.flags = 0;
- sc->status.obutton = sc->status.button;
- sc->status.button = 0;
- sc->status.dx = 0;
- sc->status.dy = 0;
- sc->status.dz = 0;
- splx(s);
- *(mousestatus_t *)addr = status;
- break;
-
-#if (defined(MOUSE_GETVARS))
- case MOUSE_GETVARS:
- var = (mousevar_t *)addr;
- bzero(var, sizeof(*var));
- s = spltty();
- var->var[0] = MOUSE_VARS_PS2_SIG;
- var->var[1] = sc->config;
- var->var[2] = sc->flags;
- splx(s);
- break;
-
- case MOUSE_SETVARS:
- return ENODEV;
-#endif /* MOUSE_GETVARS */
-
- case MOUSE_READSTATE:
- case MOUSE_READDATA:
- data = (mousedata_t *)addr;
- if (data->len > sizeof(data->buf)/sizeof(data->buf[0]))
- return EINVAL;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- if ((data->len = get_mouse_status(sc->kbdc, data->buf,
- (cmd == MOUSE_READDATA) ? 1 : 0, data->len)) <= 0)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-
-#if (defined(MOUSE_SETRESOLUTION))
- case MOUSE_SETRESOLUTION:
- mode.resolution = *(int *)addr;
- if (mode.resolution >= UCHAR_MAX)
- return EINVAL;
- else if (mode.resolution >= 200)
- mode.resolution = MOUSE_RES_HIGH;
- else if (mode.resolution >= 100)
- mode.resolution = MOUSE_RES_MEDIUMHIGH;
- else if (mode.resolution >= 50)
- mode.resolution = MOUSE_RES_MEDIUMLOW;
- else if (mode.resolution > 0)
- mode.resolution = MOUSE_RES_LOW;
- if (mode.resolution == MOUSE_RES_DEFAULT)
- mode.resolution = sc->dflt_mode.resolution;
- else if (mode.resolution == -1)
- mode.resolution = sc->mode.resolution;
- else if (mode.resolution < 0) /* MOUSE_RES_LOW/MEDIUM/HIGH */
- mode.resolution = MOUSE_RES_LOW - mode.resolution;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->mode.resolution = set_mouse_resolution(sc->kbdc, mode.resolution);
- if (sc->mode.resolution != mode.resolution)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETRESOLUTION */
-
-#if (defined(MOUSE_SETRATE))
- case MOUSE_SETRATE:
- mode.rate = *(int *)addr;
- if (mode.rate > UCHAR_MAX)
- return EINVAL;
- if (mode.rate == 0)
- mode.rate = sc->dflt_mode.rate;
- else if (mode.rate < 0)
- mode.rate = sc->mode.rate;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->mode.rate = set_mouse_sampling_rate(sc->kbdc, mode.rate);
- if (sc->mode.rate != mode.rate)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETRATE */
-
-#if (defined(MOUSE_SETSCALING))
- case MOUSE_SETSCALING:
- if ((*(int *)addr <= 0) || (*(int *)addr > 2))
- return EINVAL;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- if (!set_mouse_scaling(sc->kbdc, *(int *)addr))
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETSCALING */
-
-#if (defined(MOUSE_GETHWID))
- case MOUSE_GETHWID:
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->hw.hwid = get_aux_id(sc->kbdc);
- *(int *)addr = sc->hw.hwid;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_GETHWID */
-
- default:
- return ENOTTY;
- }
-
- return error;
-}
-
-static void
-psmintr(void *arg)
-{
- /*
- * the table to turn PS/2 mouse button bits (MOUSE_PS2_BUTTON?DOWN)
- * into `mousestatus' button bits (MOUSE_BUTTON?DOWN).
- */
- static int butmap[8] = {
- 0,
- MOUSE_BUTTON1DOWN,
- MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON2DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN,
- MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN
- };
- register struct psm_softc *sc = arg;
- mousestatus_t ms;
- int x, y, z;
- int c;
- int l;
-
- /* read until there is nothing to read */
- while((c = read_aux_data_no_wait(sc->kbdc)) != -1) {
-
- /* discard the byte if the device is not open */
- if ((sc->state & PSM_OPEN) == 0)
- continue;
-
- /*
- * Check sync bits. We check for overflow bits and the bit 3
- * for most mice. True, the code doesn't work if overflow
- * condition occurs. But we expect it rarely happens...
- */
- if ((sc->inputbytes == 0)
- && ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1])) {
- log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x).\n",
- c & sc->mode.syncmask[0], sc->mode.syncmask[1]);
- continue;
- }
-
- sc->ipacket[sc->inputbytes++] = c;
- if (sc->inputbytes < sc->mode.packetsize)
- continue;
-
-#if 0
- log(LOG_DEBUG, "psmintr: %02x %02x %02x %02x %02x %02x\n",
- sc->ipacket[0], sc->ipacket[1], sc->ipacket[2],
- sc->ipacket[3], sc->ipacket[4], sc->ipacket[5]);
-#endif
-
- c = sc->ipacket[0];
-
- /*
- * A kludge for Kensington device!
- * The MSB of the horizontal count appears to be stored in
- * a strange place. This kludge doesn't affect other mice
- * because the bit is the overflow bit which is, in most cases,
- * expected to be zero when we reach here. XXX
- */
- sc->ipacket[1] |= (c & MOUSE_PS2_XOVERFLOW) ? 0x80 : 0;
-
- /* ignore the overflow bits... */
- x = (c & MOUSE_PS2_XNEG) ? sc->ipacket[1] - 256 : sc->ipacket[1];
- y = (c & MOUSE_PS2_YNEG) ? sc->ipacket[2] - 256 : sc->ipacket[2];
- z = 0;
- ms.obutton = sc->button; /* previous button state */
- ms.button = butmap[c & MOUSE_PS2_BUTTONS];
-
- switch (sc->hw.model) {
-
- case MOUSE_MODEL_INTELLI:
- case MOUSE_MODEL_NET:
- /* wheel data is in the fourth byte */
- z = (char)sc->ipacket[3];
- break;
-
- case MOUSE_MODEL_MOUSEMANPLUS:
- if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) {
- /* the extended data packet encodes button and wheel events */
- x = y = 0;
- z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG)
- ? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f);
- ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN)
- ? MOUSE_BUTTON4DOWN : 0;
- } else {
- /* preserve button states */
- ms.button |= ms.obutton & MOUSE_EXTBUTTONS;
- }
- break;
-
- case MOUSE_MODEL_GLIDEPOINT:
- /* `tapping' action */
- ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN;
- break;
-
- case MOUSE_MODEL_NETSCROLL:
- /* three addtional bytes encode button and wheel events */
- ms.button |= (sc->ipacket[3] & MOUSE_PS2_BUTTON3DOWN)
- ? MOUSE_BUTTON4DOWN : 0;
- z = (sc->ipacket[3] & MOUSE_PS2_XNEG)
- ? sc->ipacket[4] - 256 : sc->ipacket[4];
- break;
-
- case MOUSE_MODEL_THINK:
- /* the fourth button state in the first byte */
- ms.button |= (c & MOUSE_PS2_TAP) ? MOUSE_BUTTON4DOWN : 0;
- break;
-
- case MOUSE_MODEL_GENERIC:
- default:
- break;
- }
-
- /* scale values */
- if (sc->mode.accelfactor >= 1) {
- if (x != 0) {
- x = x * x / sc->mode.accelfactor;
- if (x == 0)
- x = 1;
- if (c & MOUSE_PS2_XNEG)
- x = -x;
- }
- if (y != 0) {
- y = y * y / sc->mode.accelfactor;
- if (y == 0)
- y = 1;
- if (c & MOUSE_PS2_YNEG)
- y = -y;
- }
- }
-
- ms.dx = x;
- ms.dy = y;
- ms.dz = z;
- ms.flags = ((x || y || z) ? MOUSE_POSCHANGED : 0)
- | (ms.obutton ^ ms.button);
-
- if (sc->mode.level < PSM_LEVEL_NATIVE)
- sc->inputbytes = tame_mouse(sc, &ms, sc->ipacket);
-
- sc->status.flags |= ms.flags;
- sc->status.dx += ms.dx;
- sc->status.dy += ms.dy;
- sc->status.dz += ms.dz;
- sc->status.button = ms.button;
- sc->button = ms.button;
-
- /* queue data */
- if (sc->queue.count + sc->inputbytes < sizeof(sc->queue.buf)) {
- l = min(sc->inputbytes, sizeof(sc->queue.buf) - sc->queue.tail);
- bcopy(&sc->ipacket[0], &sc->queue.buf[sc->queue.tail], l);
- if (sc->inputbytes > l)
- bcopy(&sc->ipacket[l], &sc->queue.buf[0], sc->inputbytes - l);
- sc->queue.tail =
- (sc->queue.tail + sc->inputbytes) % sizeof(sc->queue.buf);
- sc->queue.count += sc->inputbytes;
- }
- sc->inputbytes = 0;
-
- if (sc->state & PSM_ASLP) {
- sc->state &= ~PSM_ASLP;
- wakeup((caddr_t) sc);
- }
- selwakeup(&sc->rsel);
- }
-}
-
-static int
-psmpoll(dev_t dev, int events, struct proc *p)
-{
- struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- int s;
- int revents = 0;
-
- /* Return true if a mouse event available */
- s = spltty();
- if (events & (POLLIN | POLLRDNORM))
- if (sc->queue.count > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->rsel);
-
- splx(s);
-
- return (revents);
-}
-
-/* vendor/model specific routines */
-
-static int mouse_id_proc1(KBDC kbdc, int res, int scale, int *status)
-{
- if (set_mouse_resolution(kbdc, res) != res)
- return FALSE;
- if (set_mouse_scaling(kbdc, scale)
- && set_mouse_scaling(kbdc, scale)
- && set_mouse_scaling(kbdc, scale)
- && (get_mouse_status(kbdc, status, 0, 3) >= 3))
- return TRUE;
- return FALSE;
-}
-
-#if notyet
-/* Logitech MouseMan Cordless II */
-static int
-enable_lcordless(struct psm_softc *sc)
-{
- int status[3];
- int ch;
-
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 2, status))
- return FALSE;
- if (status[1] == PSMD_RES_HIGH)
- return FALSE;
- ch = (status[0] & 0x07) - 1; /* channel # */
- if ((ch <= 0) || (ch > 4))
- return FALSE;
- /*
- * status[1]: always one?
- * status[2]: battery status? (0-100)
- */
- return TRUE;
-}
-#endif /* notyet */
-
-/* Genius NetScroll Mouse */
-static int
-enable_groller(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to enable the fourth button and the
- * roller. Immediately after this sequence check status bytes.
- * if the mouse is NetScroll, the second and the third bytes are
- * '3' and 'D'.
- */
-
- /*
- * If the mouse is an ordinary PS/2 mouse, the status bytes should
- * look like the following.
- *
- * byte 1 bit 7 always 0
- * bit 6 stream mode (0)
- * bit 5 disabled (0)
- * bit 4 1:1 scaling (0)
- * bit 3 always 0
- * bit 0-2 button status
- * byte 2 resolution (PSMD_RES_HIGH)
- * byte 3 report rate (?)
- */
-
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 1, status))
- return FALSE;
- if ((status[1] != '3') || (status[2] != 'D'))
- return FALSE;
- /* FIXME!! */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
- sc->hw.buttons = 4;
- return TRUE;
-}
-
-/* Genius NetMouse/NetMouse Pro */
-static int
-enable_gmouse(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to enable the middle, "rubber" button.
- * Immediately after this sequence check status bytes.
- * if the mouse is NetMouse, NetMouse Pro, or ASCII MIE Mouse,
- * the second and the third bytes are '3' and 'U'.
- * NOTE: NetMouse reports that it has three buttons although it has
- * two buttons and a rubber button. NetMouse Pro and MIE Mouse
- * say they have three buttons too and they do have a button on the
- * side...
- */
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 1, status))
- return FALSE;
- if ((status[1] != '3') || (status[2] != 'U'))
- return FALSE;
- return TRUE;
-}
-
-/* ALPS GlidePoint */
-static int
-enable_aglide(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to obtain ALPS GlidePoint specific
- * information. Immediately after this sequence, status bytes will
- * contain something interesting.
- * NOTE: ALPS produces several models of GlidePoint. Some of those
- * do not respond to this sequence, thus, cannot be detected this way.
- */
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_LOW, 2, status))
- return FALSE;
- if ((status[0] & 0x10) || (status[1] == PSMD_RES_LOW))
- return FALSE;
- return TRUE;
-}
-
-/* Kensington ThinkingMouse/Trackball */
-static int
-enable_kmouse(struct psm_softc *sc)
-{
- static unsigned char rate[] = { 20, 60, 40, 20, 20, 60, 40, 20, 20 };
- KBDC kbdc = sc->kbdc;
- int status[3];
- int id1;
- int id2;
- int i;
-
- id1 = get_aux_id(kbdc);
- if (set_mouse_sampling_rate(kbdc, 10) != 10)
- return FALSE;
- /*
- * The device is now in the native mode? It returns a different
- * ID value...
- */
- id2 = get_aux_id(kbdc);
- if ((id1 == id2) || (id2 != 2))
- return FALSE;
-
- if (set_mouse_resolution(kbdc, PSMD_RES_LOW) != PSMD_RES_LOW)
- return FALSE;
-#if PSM_DEBUG >= 2
- /* at this point, resolution is LOW, sampling rate is 10/sec */
- if (get_mouse_status(kbdc, status, 0, 3) < 3)
- return FALSE;
-#endif
-
- /*
- * The special sequence to enable the third and fourth buttons.
- * Otherwise they behave like the first and second buttons.
- */
- for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) {
- if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i])
- return FALSE;
- }
-
- /*
- * At this point, the device is using default resolution and
- * sampling rate for the native mode.
- */
- if (get_mouse_status(kbdc, status, 0, 3) < 3)
- return FALSE;
- if ((status[1] == PSMD_RES_LOW) || (status[2] == rate[i - 1]))
- return FALSE;
-
- /* the device appears be enabled by this sequence, diable it for now */
- disable_aux_dev(kbdc);
- empty_aux_buffer(kbdc, 5);
-
- return TRUE;
-}
-
-/* Logitech MouseMan+/FirstMouse+ */
-static int
-enable_mmanplus(struct psm_softc *sc)
-{
- static char res[] = {
- -1, PSMD_RES_LOW, PSMD_RES_HIGH, PSMD_RES_MEDIUM_HIGH,
- PSMD_RES_MEDIUM_LOW, -1, PSMD_RES_HIGH, PSMD_RES_MEDIUM_LOW,
- PSMD_RES_MEDIUM_HIGH, PSMD_RES_HIGH,
- };
- KBDC kbdc = sc->kbdc;
- int data[3];
- int i;
-
- /* the special sequence to enable the fourth button and the roller. */
- for (i = 0; i < sizeof(res)/sizeof(res[0]); ++i) {
- if (res[i] < 0) {
- if (!set_mouse_scaling(kbdc, 1))
- return FALSE;
- } else {
- if (set_mouse_resolution(kbdc, res[i]) != res[i])
- return FALSE;
- }
- }
-
- if (get_mouse_status(kbdc, data, 1, 3) < 3)
- return FALSE;
-
- /*
- * MouseMan+ and FirstMouse+ return following data.
- *
- * byte 1 0xc8
- * byte 2 ?? (MouseMan+:0xc2, FirstMouse+:0xc6)
- * byte 3 model ID? MouseMan+:0x50, FirstMouse+:0x51
- */
- if ((data[0] & ~MOUSE_PS2_BUTTONS) != 0xc8)
- return FALSE;
-
- /*
- * MouseMan+ (or FirstMouse+) is now in its native mode, in which
- * the wheel and the fourth button events are encoded in the
- * special data packet. The mouse may be put in the IntelliMouse mode
- * if it is initialized by the IntelliMouse's method.
- */
- return TRUE;
-}
-
-/* MS IntelliMouse */
-static int
-enable_msintelli(struct psm_softc *sc)
-{
- /*
- * Logitech MouseMan+ and FirstMouse+ will also respond to this
- * probe routine and act like IntelliMouse.
- */
-
- static unsigned char rate[] = { 200, 100, 80, };
- KBDC kbdc = sc->kbdc;
- int id;
- int i;
-
- /* the special sequence to enable the third button and the roller. */
- for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) {
- if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i])
- return FALSE;
- }
- /* the device will give the genuine ID only after the above sequence */
- id = get_aux_id(kbdc);
- if (id != PSM_INTELLI_ID)
- return FALSE;
-
- sc->hw.hwid = id;
- sc->hw.buttons = 3;
-
- return TRUE;
-}
-
-#ifdef PSM_HOOKAPM
-static int
-psmresume(void *dummy)
-{
- struct psm_softc *sc = psm_softc[(int)dummy];
- int unit = (int)dummy;
- int err = 0;
- int s;
- int c;
-
- if (verbose >= 2)
- log(LOG_NOTICE, "psm%d: APM resume hook called.\n", unit);
-
- /* don't let anybody mess with the aux device */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
- s = spltty();
-
- /* save the current controller command byte */
- empty_both_buffers(sc->kbdc, 10);
- c = get_controller_command_byte(sc->kbdc);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm%d: current command byte: %04x (psmresume).\n",
- unit, c);
-
- /* enable the aux port but disable the aux interrupt and the keyboard */
- if ((c == -1) || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- splx(s);
- kbdc_lock(sc->kbdc, FALSE);
- log(LOG_ERR, "psm%d: unable to set the command byte (psmresume).\n",
- unit);
- return (EIO);
- }
-
- /* flush any data */
- if (sc->state & PSM_VALID) {
- disable_aux_dev(sc->kbdc); /* this may fail; but never mind... */
- empty_aux_buffer(sc->kbdc, 10);
- }
- sc->inputbytes = 0;
-
-#ifdef PSM_RESETAFTERSUSPEND
- /* try to detect the aux device; are you still there? */
- if (reinitialize(unit, &sc->mode)) {
- /* yes */
- sc->state |= PSM_VALID;
- } else {
- /* the device has gone! */
- restore_controller(sc->kbdc, c);
- sc->state &= ~PSM_VALID;
- log(LOG_ERR, "psm%d: the aux device has gone! (psmresume).\n",
- unit);
- err = ENXIO;
- }
-#endif /* PSM_RESETAFTERSUSPEND */
- splx(s);
-
- /* restore the driver state */
- if ((sc->state & PSM_OPEN) && (err == 0)) {
- /* enable the aux device and the port again */
- err = doopen(unit, c);
- if (err != 0)
- log(LOG_ERR, "psm%d: failed to enable the device (psmresume).\n",
- unit);
- } else {
- /* restore the keyboard port and disable the aux port */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (c & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- log(LOG_ERR, "psm%d: failed to disable the aux port (psmresume).\n",
- unit);
- err = EIO;
- }
- }
-
- /* done */
- kbdc_lock(sc->kbdc, FALSE);
- if ((sc->state & PSM_ASLP) && !(sc->state & PSM_VALID)) {
- /*
- * Release the blocked process; it must be notified that the device
- * cannot be accessed anymore.
- */
- sc->state &= ~PSM_ASLP;
- wakeup((caddr_t)sc);
- }
-
- if (verbose >= 2)
- log(LOG_DEBUG, "psm%d: APM resume hook exiting.\n", unit);
-
- return (err);
-}
-#endif /* PSM_HOOKAPM */
-
-CDEV_DRIVER_MODULE(psm, isa, psm_driver, psm_devclass,
- CDEV_MAJOR, psm_cdevsw, 0, 0);
-
-#endif /* NPSM > 0 */
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 6a2084e6dc81..d5b48cee1ecb 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sio.c,v 1.219 1998/12/13 23:12:54 steve Exp $
+ * $Id: sio.c,v 1.216 1998/09/26 13:59:26 peter Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.215
*/
@@ -68,7 +68,6 @@
#include <sys/syslog.h>
#include <sys/sysctl.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
@@ -79,7 +78,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#include <machine/resource.h>
#include <isa/sioreg.h>
@@ -92,7 +90,6 @@
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -495,7 +492,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -914,8 +921,6 @@ sioattach(dev)
int s;
int unit;
void *ih;
- struct resource *res;
- int zero = 0;
u_int flags = isa_get_flags(dev);
#if 0
@@ -1131,10 +1136,13 @@ determined_type: ;
#endif
com->flags = isa_get_flags(dev); /* Heritate id_flags for later */
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, siointr, com,
- &ih);
+ ih = BUS_CREATE_INTR(device_get_parent(dev), dev,
+ isa_get_irq(dev),
+ siointr, com);
+ if (!ih)
+ return ENXIO;
+
+ BUS_CONNECT_INTR(device_get_parent(dev), ih);
return (0);
}
@@ -3109,7 +3117,6 @@ static pnpid_t siopnp_ids[] = {
{ 0x7121b04e, "SupraExpress 56i Sp"},
{ 0x11007256, "USR0011"},
{ 0x30207256, "USR2030"},
- { 0x31307256, "USR3031"},
{ 0 }
};
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index e44fe37ee308..6d9f7c9c1b81 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.276 1998/11/08 12:39:04 dfr Exp $
+ * $Id: syscons.c,v 1.273 1998/08/06 09:15:53 dfr Exp $
* from: i386/isa syscons.c,v 1.278
*/
@@ -54,12 +54,10 @@
#include <sys/tty.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <sys/rman.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
-#include <machine/resource.h>
#include <machine/clock.h>
#include <machine/cons.h>
#include <machine/console.h>
@@ -454,12 +452,12 @@ scprobe(device_t dev)
if (!scvidprobe(device_get_unit(dev), isa_get_flags(dev))) {
if (bootverbose)
printf("sc%d: no video adapter is found.\n", device_get_unit(dev));
- return (ENXIO);
+ return (0);
}
(*biosvidsw.diag)(bootverbose);
#if defined(VESA) && defined(VM86)
if (vesa_load())
- return ENXIO;
+ return FALSE;
(*biosvidsw.diag)(bootverbose);
#endif
@@ -696,8 +694,6 @@ scattach(device_t dev)
int vc;
#endif
void *ih;
- struct resource *res;
- int zero = 0;
scinit();
flags = isa_get_flags(dev);
@@ -775,10 +771,13 @@ scattach(device_t dev)
UID_ROOT, GID_WHEEL, 0600, "consolectl");
#endif
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, scintr, 0,
- &ih);
+ ih = BUS_CREATE_INTR(device_get_parent(dev), dev,
+ isa_get_irq(dev),
+ scintr, 0);
+ if (!ih)
+ return ENXIO;
+
+ BUS_CONNECT_INTR(device_get_parent(dev), ih);
return 0;
}
@@ -3937,7 +3936,7 @@ next_code:
}
int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, int offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c
index edfd66cb61de..a7a971bffd1f 100644
--- a/sys/isofs/cd9660/cd9660_node.c
+++ b/sys/isofs/cd9660/cd9660_node.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_node.c,v 1.25 1998/02/09 06:09:18 eivind Exp $
+ * $Id: cd9660_node.c,v 1.24 1998/02/06 12:13:20 eivind Exp $
*/
#include <sys/param.h>
@@ -58,9 +58,7 @@
static struct iso_node **isohashtbl;
static u_long isohash;
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash)
-#ifndef NULL_SIMPLELOCKS
static struct simplelock cd9660_ihash_slock;
-#endif
static void cd9660_ihashrem __P((struct iso_node *));
static unsigned cd9660_chars2ui __P((unsigned char *begin, int len));
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 9e661a6cdf83..fb877ca1a412 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
- * $Id: cd9660_vfsops.c,v 1.46 1998/12/06 11:36:24 jkh Exp $
+ * $Id: cd9660_vfsops.c,v 1.43 1998/09/07 13:17:00 bde Exp $
*/
#include <sys/param.h>
@@ -122,13 +122,13 @@ iso_get_ssector(dev, p)
if (ioctlp == NULL)
return 0;
- if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) == -1)
return 0;
for (i = h.ending_track; i >= 0; i--) {
t.address_format = CD_LBA_FORMAT;
t.track = i;
- if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) == -1)
return 0;
if ((t.entry.control & 4) != 0)
/* found a data track */
@@ -141,6 +141,8 @@ iso_get_ssector(dev, p)
return ntohl(t.entry.addr.lba);
}
+#ifndef VFS_LKM /* mount root makes no sense to an LKM */
+
static int iso_mountroot __P((struct mount *mp, struct proc *p));
static int
@@ -166,6 +168,7 @@ iso_mountroot(mp, p)
(void)cd9660_statfs(mp, &mp->mnt_stat, p);
return (0);
}
+#endif /* ! VFS_LKM */
/*
* VFS Operations.
@@ -187,11 +190,13 @@ cd9660_mount(mp, path, data, ndp, p)
mode_t accessmode;
struct iso_mnt *imp = 0;
+#ifndef VFS_LKM /* mount root makes no sense to an LKM */
if ((mp->mnt_flag & MNT_ROOTFS) != 0) {
if (bdevsw[major(rootdev)]->d_flags & D_NOCLUSTERR)
mp->mnt_flag |= MNT_NOCLUSTERR;
return (iso_mountroot(mp, p));
}
+#endif /* ! VFS_LKM */
if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args))))
return (error);
@@ -224,8 +229,7 @@ cd9660_mount(mp, path, data, ndp, p)
vrele(devvp);
return ENOTBLK;
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return ENXIO;
}
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index fd4f648e002c..0c75b74b8509 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: bus_if.m,v 1.4 1998/11/08 18:51:38 nsouch Exp $
+# $Id: bus_if.m,v 1.2 1998/07/12 16:20:51 dfr Exp $
#
-INTERFACE bus;
+INTERFACE bus
#
# This is called from system code which prints out a description of a
@@ -57,7 +57,7 @@ METHOD int read_ivar {
device_t dev;
device_t child;
int index;
- uintptr_t *result;
+ u_long *result;
};
#
@@ -67,75 +67,27 @@ METHOD int write_ivar {
device_t dev;
device_t child;
int index;
- uintptr_t value;
+ u_long value;
};
#
-# Allocate a system resource attached to `dev' on behalf of `child'.
-# The types are defined in <machine/resource.h>; the meaning of the
-# resource-ID field varies from bus to bus (but *rid == 0 is always
-# valid if the resource type is). start and end reflect the allowable
-# range, and should be passed as `0UL' and `~0UL', respectively, if
-# the client has no range restriction. count is the number of consecutive
-# indices in the resource required. flags is a set of sharing flags
-# as defined in <sys/rman.h>.
-#
-# Returns a resource or a null pointer on failure. The caller is
-# responsible for calling rman_activate_resource() when it actually
-# uses the resource.
-#
-METHOD struct resource * alloc_resource {
- device_t dev;
- device_t child;
- int type;
- int *rid;
- u_long start;
- u_long end;
- u_long count;
- u_int flags;
-};
-
-METHOD int activate_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *r;
-};
-
-METHOD int deactivate_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *r;
+# Create an interrupt handler for the child device. The handler will
+# be called with the value 'arg' as its only argument. This method
+# does not activate the handler.
+#
+METHOD void* create_intr {
+ device_t dev;
+ device_t child;
+ int irq;
+ driver_intr_t *intr;
+ void *arg;
};
#
-# Free a resource allocated by the preceding method. The `rid' value
-# must be the same as the one returned by BUS_ALLOC_RESOURCE (which
-# is not necessarily the same as the one the client passed).
+# Activate an interrupt handler previously created with
+# BUS_CREATE_INTR.
#
-METHOD int release_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *res;
-};
-
-METHOD int setup_intr {
- device_t dev;
- device_t child;
- struct resource *irq;
- driver_intr_t *intr;
- void *arg;
- void **cookiep;
-};
-
-METHOD int teardown_intr {
- device_t dev;
- device_t child;
- struct resource *irq;
- void *cookie;
+METHOD int connect_intr {
+ device_t dev;
+ void *ih;
};
diff --git a/sys/kern/device_if.m b/sys/kern/device_if.m
index f429e67759a0..4ae1df86a0db 100644
--- a/sys/kern/device_if.m
+++ b/sys/kern/device_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: device_if.m,v 1.2 1998/11/08 18:35:53 nsouch Exp $
+# $Id$
#
-INTERFACE device;
+INTERFACE device
#
# Probe to see if the device is present. Return 0 if the device exists,
@@ -67,17 +67,3 @@ METHOD int detach {
METHOD int shutdown {
device_t dev;
};
-
-#
-# This is called by the power-management subsystem when a suspend has been
-# requested by the user or by some automatic mechanism. This gives
-# drivers a chance to veto the suspend or save their configuration before
-# power is removed.
-#
-METHOD int suspend {
- device_t dev;
-};
-
-METHOD int resume {
- device_t dev;
-};
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 9fbd203177dd..446946e8c58f 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.43 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_aout.c,v 1.42 1998/09/14 05:36:49 jdp Exp $
*/
#include <sys/param.h>
@@ -232,8 +232,8 @@ exec_aout_imgact(imgp)
}
/*
- * Dump core, into a file named as described in the comments for
- * expand_name(), unless the process was setuid/setgid.
+ * Dump core, into a file named "progname.core", unless the process was
+ * setuid/setgid.
*/
int
aout_coredump(p)
@@ -248,6 +248,7 @@ aout_coredump(p)
char *name; /* name of corefile */
STOPEVENT(p, S_CORE, 0);
+
if (sugid_coredump == 0 && p->p_flag & P_SUGID)
return (EFAULT);
if (ctob(UPAGES + vm->vm_dsize + vm->vm_ssize) >=
@@ -256,6 +257,7 @@ aout_coredump(p)
name = expand_name(p->p_comm, p->p_ucred->cr_uid, p->p_pid);
if (name == NULL)
return (EFAULT); /* XXX -- not the best error */
+
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, name, p);
error = vn_open(&nd, O_CREAT | FWRITE, S_IRUSR | S_IWUSR);
free(name, M_TEMP);
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index a0a228466784..c33c6bea43cb 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.43 1998/12/04 22:54:51 archie Exp $
+ * $Id: imgact_elf.c,v 1.39 1998/10/15 09:52:19 dfr Exp $
*/
#include "opt_rlimit.h"
@@ -63,25 +63,40 @@
#include <vm/vm_prot.h>
#include <vm/vm_extern.h>
-#include <machine/elf.h>
#include <machine/md_var.h>
-__ElfType(Brandinfo);
-__ElfType(Auxargs);
+#define MAX_PHDR 32 /* XXX enough ? */
+
+#if ELF_TARG_CLASS == ELFCLASS32
+
+#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Phdr Elf32_Phdr
+#define Elf_Auxargs Elf32_Auxargs
+#define Elf_Brandinfo Elf32_Brandinfo
+
+#else
+
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#define Elf_Auxargs Elf64_Auxargs
+#define Elf_Brandinfo Elf64_Brandinfo
+
+#endif
+
static int elf_check_header __P((const Elf_Ehdr *hdr, int type));
static int elf_freebsd_fixup __P((long **stack_base,
struct image_params *imgp));
static int elf_load_file __P((struct proc *p, char *file, u_long *addr,
u_long *entry));
-static int elf_load_section __P((struct proc *p,
- struct vmspace *vmspace, struct vnode *vp,
+static int elf_load_section __P((struct vmspace *vmspace, struct vnode *vp,
vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz,
vm_prot_t prot));
static int exec_elf_imgact __P((struct image_params *imgp));
static int elf_trace = 0;
SYSCTL_INT(_debug, OID_AUTO, elf_trace, CTLFLAG_RW, &elf_trace, 0, "");
+#define UPRINTF if (elf_trace) uprintf
static struct sysentvec elf_freebsd_sysvec = {
SYS_MAXSYSCALL,
@@ -148,124 +163,86 @@ elf_remove_brand_entry(Elf_Brandinfo *entry)
static int
elf_check_header(const Elf_Ehdr *hdr, int type)
{
- if (!IS_ELF(*hdr) ||
- hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS ||
- hdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
- hdr->e_ident[EI_VERSION] != EV_CURRENT)
+ if (!(hdr->e_ident[EI_MAG0] == ELFMAG0 &&
+ hdr->e_ident[EI_MAG1] == ELFMAG1 &&
+ hdr->e_ident[EI_MAG2] == ELFMAG2 &&
+ hdr->e_ident[EI_MAG3] == ELFMAG3))
return ENOEXEC;
- if (!ELF_MACHINE_OK(hdr->e_machine))
+#ifdef __i386__
+ if (hdr->e_machine != EM_386 && hdr->e_machine != EM_486)
+#endif
+#ifdef __alpha__
+ if (hdr->e_machine != EM_ALPHA)
+#endif
return ENOEXEC;
- if (hdr->e_type != type || hdr->e_version != ELF_TARG_VER)
+
+ if (hdr->e_type != type)
return ENOEXEC;
return 0;
}
static int
-elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)
+elf_load_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)
{
size_t map_len;
vm_offset_t map_addr;
- int error, rv;
+ int error;
+ unsigned char *data_buf = 0;
size_t copy_len;
- vm_object_t object;
- vm_offset_t file_addr;
- vm_offset_t data_buf = 0;
-
- object = vp->v_object;
- error = 0;
map_addr = trunc_page((vm_offset_t)vmaddr);
- file_addr = trunc_page(offset);
- /*
- * We have two choices. We can either clear the data in the last page
- * of an oversized mapping, or we can start the anon mapping a page
- * early and copy the initialized data into that first page. We
- * choose the second..
- */
if (memsz > filsz)
- map_len = trunc_page(offset+filsz) - file_addr;
+ map_len = trunc_page(offset+filsz) - trunc_page(offset);
else
- map_len = round_page(offset+filsz) - file_addr;
-
- if (map_len != 0) {
- vm_object_reference(object);
- vm_map_lock(&vmspace->vm_map);
- rv = vm_map_insert(&vmspace->vm_map,
- object,
- file_addr, /* file offset */
- map_addr, /* virtual start */
- map_addr + map_len,/* virtual end */
- prot,
- VM_PROT_ALL,
- MAP_COPY_NEEDED | MAP_COPY_ON_WRITE);
- vm_map_unlock(&vmspace->vm_map);
- if (rv != KERN_SUCCESS)
- return EINVAL;
-
- /* prefault the page tables */
- pmap_object_init_pt(&vmspace->vm_pmap,
- map_addr,
- object,
- (vm_pindex_t) OFF_TO_IDX(file_addr),
- map_len,
- 0);
-
- /* we can stop now if we've covered it all */
- if (memsz == filsz)
- return 0;
- }
+ map_len = round_page(offset+filsz) - trunc_page(offset);
+
+ if (error = vm_mmap (&vmspace->vm_map,
+ &map_addr,
+ map_len,
+ prot,
+ VM_PROT_ALL,
+ MAP_PRIVATE | MAP_FIXED,
+ (caddr_t)vp,
+ trunc_page(offset)))
+ return error;
+ if (memsz == filsz)
+ return 0;
/*
- * We have to get the remaining bit of the file into the first part
- * of the oversized map segment. This is normally because the .data
- * segment in the file is extended to provide bss. It's a neat idea
- * to try and save a page, but it's a pain in the behind to implement.
+ * We have to map the remaining bit of the file into the kernel's
+ * memory map, allocate some anonymous memory, and copy that last
+ * bit into it. The remaining space should be .bss...
*/
copy_len = (offset + filsz) - trunc_page(offset + filsz);
map_addr = trunc_page((vm_offset_t)vmaddr + filsz);
map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr;
- /* This had damn well better be true! */
if (map_len != 0) {
- vm_map_lock(&vmspace->vm_map);
- rv = vm_map_insert(&vmspace->vm_map, NULL, 0,
- map_addr, map_addr + map_len,
- VM_PROT_ALL, VM_PROT_ALL, 0);
- vm_map_unlock(&vmspace->vm_map);
- if (rv != KERN_SUCCESS)
- return EINVAL;
+ if (error = vm_map_find(&vmspace->vm_map, NULL, 0,
+ &map_addr, map_len, FALSE,
+ VM_PROT_ALL, VM_PROT_ALL,0))
+ return error;
}
- if (copy_len != 0) {
- vm_object_reference(object);
- rv = vm_map_find(exec_map,
- object,
- trunc_page(offset + filsz),
- &data_buf,
- PAGE_SIZE,
- TRUE,
- VM_PROT_READ,
- VM_PROT_ALL,
- MAP_COPY_ON_WRITE | MAP_COPY_NEEDED);
- if (rv != KERN_SUCCESS) {
- vm_object_deallocate(object);
- return EINVAL;
- }
- pmap_object_init_pt(exec_map->pmap, data_buf, object,
- (vm_pindex_t) OFF_TO_IDX(trunc_page(offset + filsz)),
- PAGE_SIZE, 1);
-
- /* send the page fragment to user space */
- error = copyout((caddr_t)data_buf, (caddr_t)map_addr, copy_len);
- vm_map_remove(exec_map, data_buf, data_buf + PAGE_SIZE);
- if (error)
- return (error);
- }
+ if (error = vm_mmap(exec_map,
+ (vm_offset_t *)&data_buf,
+ PAGE_SIZE,
+ VM_PROT_READ,
+ VM_PROT_READ,
+ 0,
+ (caddr_t)vp,
+ trunc_page(offset + filsz)))
+ return error;
+
+ error = copyout(data_buf, (caddr_t)map_addr, copy_len);
+
+ vm_map_remove(exec_map, (vm_offset_t)data_buf,
+ (vm_offset_t)data_buf + PAGE_SIZE);
/*
* set it to the specified protection
@@ -273,6 +250,7 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
vm_map_protect(&vmspace->vm_map, map_addr, map_addr + map_len, prot,
FALSE);
+ UPRINTF("bss size %d (%x)\n", map_len-copy_len, map_len-copy_len);
return error;
}
@@ -285,9 +263,10 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
struct vmspace *vmspace = p->p_vmspace;
struct vattr attr;
struct image_params image_params, *imgp;
- vm_prot_t prot;
+ vm_prot_t prot = 0;
unsigned long text_size = 0, data_size = 0;
unsigned long text_addr = 0, data_addr = 0;
+ int header_size = 0;
int error, i;
imgp = &image_params;
@@ -333,9 +312,19 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (error = elf_check_header(hdr, ET_DYN))
goto fail;
+ /*
+ * ouch, need to bounds check in case user gives us a corrupted
+ * file with an insane header size
+ */
+ if (hdr->e_phnum > MAX_PHDR) { /* XXX: ever more than this? */
+ error = ENOEXEC;
+ goto fail;
+ }
+
+ header_size = hdr->e_phentsize * hdr->e_phnum;
+
/* Only support headers that fit within first page for now */
- if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) {
+ if (header_size + hdr->e_phoff > PAGE_SIZE) {
error = ENOEXEC;
goto fail;
}
@@ -343,8 +332,14 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
phdr = (Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
for (i = 0; i < hdr->e_phnum; i++) {
- if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */
- prot = 0;
+ switch(phdr[i].p_type) {
+
+ case PT_NULL: /* NULL section */
+ UPRINTF ("ELF(file) PT_NULL section\n");
+ break;
+ case PT_LOAD: /* Loadable segment */
+ {
+ UPRINTF ("ELF(file) PT_LOAD section ");
if (phdr[i].p_flags & PF_X)
prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
@@ -352,7 +347,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(p, vmspace, nd.ni_vp,
+ if (error = elf_load_section(vmspace, nd.ni_vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr +
(*addr),
@@ -372,13 +367,37 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
phdr[i].p_vaddr -
trunc_page(phdr[i].p_vaddr));
*entry=(unsigned long)hdr->e_entry+(*addr);
+ UPRINTF(".text <%08lx,%08lx> entry=%08lx\n",
+ text_addr, text_size, *entry);
} else {
data_addr = trunc_page(phdr[i].p_vaddr+(*addr));
data_size = round_page(phdr[i].p_memsz +
phdr[i].p_vaddr -
trunc_page(phdr[i].p_vaddr));
+ UPRINTF(".data <%08lx,%08lx>\n",
+ data_addr, data_size);
}
}
+ break;
+
+ case PT_DYNAMIC:/* Dynamic link information */
+ UPRINTF ("ELF(file) PT_DYNAMIC section\n");
+ break;
+ case PT_INTERP: /* Path to interpreter */
+ UPRINTF ("ELF(file) PT_INTERP section\n");
+ break;
+ case PT_NOTE: /* Note section */
+ UPRINTF ("ELF(file) PT_NOTE section\n");
+ break;
+ case PT_SHLIB: /* Shared lib section */
+ UPRINTF ("ELF(file) PT_SHLIB section\n");
+ break;
+ case PT_PHDR: /* Program header table info */
+ UPRINTF ("ELF(file) PT_PHDR section\n");
+ break;
+ default:
+ UPRINTF ("ELF(file) %d section ??\n", phdr[i].p_type );
+ }
}
fail:
@@ -397,14 +416,14 @@ static int
exec_elf_imgact(struct image_params *imgp)
{
const Elf_Ehdr *hdr = (const Elf_Ehdr *) imgp->image_header;
- const Elf_Phdr *phdr;
+ const Elf_Phdr *phdr, *mapped_phdr = NULL;
Elf_Auxargs *elf_auxargs = NULL;
struct vmspace *vmspace;
- vm_prot_t prot;
+ vm_prot_t prot = 0;
u_long text_size = 0, data_size = 0;
u_long text_addr = 0, data_addr = 0;
u_long addr, entry = 0, proghdr = 0;
- int error, i;
+ int error, i, header_size = 0;
const char *interp = NULL;
Elf_Brandinfo *brand_info;
char *brand;
@@ -421,12 +440,24 @@ exec_elf_imgact(struct image_params *imgp)
* detected an ELF file.
*/
+ /*
+ * ouch, need to bounds check in case user gives us a corrupted
+ * file with an insane header size
+ */
+ if (hdr->e_phnum > MAX_PHDR) { /* XXX: ever more than this? */
+ return ENOEXEC;
+ }
+
+ header_size = hdr->e_phentsize * hdr->e_phnum;
+
if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) {
+ (hdr->e_phoff + header_size) > PAGE_SIZE) {
/* Only support headers in first page for now */
return ENOEXEC;
+ } else {
+ phdr = (const Elf_Phdr*)
+ ((const char *)imgp->image_header + hdr->e_phoff);
}
- phdr = (const Elf_Phdr*)(imgp->image_header + hdr->e_phoff);
/*
* From this point on, we may have resources that need to be freed.
@@ -441,8 +472,12 @@ exec_elf_imgact(struct image_params *imgp)
for (i = 0; i < hdr->e_phnum; i++) {
switch(phdr[i].p_type) {
+ case PT_NULL: /* NULL section */
+ UPRINTF ("ELF PT_NULL section\n");
+ break;
case PT_LOAD: /* Loadable segment */
- prot = 0;
+ {
+ UPRINTF ("ELF PT_LOAD section ");
if (phdr[i].p_flags & PF_X)
prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
@@ -450,8 +485,7 @@ exec_elf_imgact(struct image_params *imgp)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(imgp->proc,
- vmspace, imgp->vp,
+ if (error = elf_load_section(vmspace, imgp->vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr,
phdr[i].p_memsz,
@@ -470,26 +504,44 @@ exec_elf_imgact(struct image_params *imgp)
phdr[i].p_vaddr -
text_addr);
entry = (u_long)hdr->e_entry;
+ UPRINTF(".text <%08lx,%08lx> entry=%08lx\n",
+ text_addr, text_size, entry);
} else {
data_addr = trunc_page(phdr[i].p_vaddr);
data_size = round_page(phdr[i].p_memsz +
phdr[i].p_vaddr -
data_addr);
+ UPRINTF(".data <%08lx,%08lx>\n",
+ data_addr, data_size);
}
+ }
+ break;
+
+ case PT_DYNAMIC:/* Dynamic link information */
+ UPRINTF ("ELF PT_DYNAMIC section ??\n");
break;
case PT_INTERP: /* Path to interpreter */
+ UPRINTF ("ELF PT_INTERP section ");
if (phdr[i].p_filesz > MAXPATHLEN ||
phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) {
error = ENOEXEC;
goto fail;
}
interp = imgp->image_header + phdr[i].p_offset;
+ UPRINTF("<%s>\n", interp);
+ break;
+ case PT_NOTE: /* Note section */
+ UPRINTF ("ELF PT_NOTE section\n");
+ break;
+ case PT_SHLIB: /* Shared lib section */
+ UPRINTF ("ELF PT_SHLIB section\n");
break;
case PT_PHDR: /* Program header table info */
+ UPRINTF ("ELF PT_PHDR section <%x>\n", phdr[i].p_vaddr);
proghdr = phdr[i].p_vaddr;
break;
default:
- break;
+ UPRINTF ("ELF %d section ??\n", phdr[i].p_type);
}
}
@@ -548,8 +600,9 @@ exec_elf_imgact(struct image_params *imgp)
imgp->proc->p_sysent = brand_info->sysvec;
if (interp != NULL) {
- snprintf(path, sizeof(path), "%s%s",
- brand_info->emul_path, interp);
+ strcpy(path, brand_info->emul_path);
+ strcat(path, interp);
+ UPRINTF("interpreter=<%s> %s\n", interp, brand_info->emul_path);
if ((error = elf_load_file(imgp->proc, path, &addr,
&imgp->entry_addr)) != 0) {
uprintf("ELF interpreter %s not found\n", path);
@@ -557,6 +610,8 @@ exec_elf_imgact(struct image_params *imgp)
}
}
+ UPRINTF("Executing %s binary\n", brand_info->brand);
+
/*
* Construct auxargs table (used by the fixup routine)
*/
@@ -649,6 +704,7 @@ elf_coredump(p)
{
register struct vnode *vp;
register struct ucred *cred = p->p_cred->pc_ucred;
+ register struct vmspace *vm = p->p_vmspace;
struct nameidata nd;
struct vattr vattr;
int error, error1;
@@ -842,6 +898,7 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
size_t hdrsize;
void *hdr;
{
+ struct vmspace *vm = p->p_vmspace;
size_t off;
prstatus_t status;
prfpregset_t fpregset;
@@ -854,11 +911,7 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
status.pr_gregsetsz = sizeof(gregset_t);
status.pr_fpregsetsz = sizeof(fpregset_t);
status.pr_osreldate = osreldate;
-#ifndef COMPAT_LINUX_THREADS
status.pr_cursig = p->p_sigacts->ps_sig;
-#else
- status.pr_cursig = p->p_sig;
-#endif /* COMPAT_LINUX_THREADS */
status.pr_pid = p->p_pid;
fill_regs(p, &status.pr_reg);
diff --git a/sys/kern/inflate.c b/sys/kern/inflate.c
index 1db9b2c99642..4558eb3519bd 100644
--- a/sys/kern/inflate.c
+++ b/sys/kern/inflate.c
@@ -7,7 +7,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: inflate.c,v 1.11 1997/10/12 20:23:40 phk Exp $
+ * $Id: inflate.c,v 1.10 1997/10/11 18:31:20 phk Exp $
*
*
*/
@@ -16,13 +16,10 @@
#include <sys/inflate.h>
#ifdef KERNEL
#include <sys/systm.h>
-#include <sys/kernel.h>
#endif
#include <sys/malloc.h>
-#ifdef KERNEL
static MALLOC_DEFINE(M_GZIP, "Gzip trees", "Gzip trees");
-#endif
/* needed to make inflate() work */
#define uch u_char
@@ -50,10 +47,8 @@ extern void putstr (char *);
static const int qflag = 0;
#ifndef KERNEL /* want to use this file in kzip also */
-extern unsigned char *kzipmalloc (int);
-extern void kzipfree (void*);
-#define malloc(x, y, z) kzipmalloc((x))
-#define free(x, y) kzipfree((x))
+extern unsigned char *malloc (int, int, int);
+extern void free (void*, int);
#endif
/*
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 246684f88362..fffe109924d8 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.102 1998/12/30 10:38:58 dfr Exp $
+ * $Id: init_main.c,v 1.98 1998/10/09 23:42:47 peter Exp $
*/
#include "opt_devfs.h"
@@ -83,9 +83,6 @@ static struct session session0;
static struct pgrp pgrp0;
struct proc proc0;
static struct pcred cred0;
-#ifdef COMPAT_LINUX_THREADS
-static struct procsig procsig0;
-#endif /* COMPAT_LINUX_THREADS */
static struct filedesc0 filedesc0;
static struct plimit limit0;
static struct vmspace vmspace0;
@@ -418,12 +415,6 @@ proc0_init(dummy)
p->p_ucred = crget();
p->p_ucred->cr_ngroups = 1; /* group 0 */
-#ifdef COMPAT_LINUX_THREADS
- /* Create procsig. */
- p->p_procsig = &procsig0;
- p->p_procsig->ps_refcnt = 2;
-
-#endif /* COMPAT_LINUX_THREADS */
/* Create the file descriptor table. */
fdp = &filedesc0;
p->p_fd = &fdp->fd_fd;
@@ -626,7 +617,7 @@ start_init(p)
/*
* Need just enough stack to hold the faked-up "execve()" arguments.
*/
- addr = trunc_page(USRSTACK - PAGE_SIZE);
+ addr = trunc_page(VM_MAXUSER_ADDRESS - PAGE_SIZE);
if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
panic("init: couldn't allocate argument space");
p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index c31ed46bc01f..d806c5ba886f 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#include "opt_compat.h"
@@ -355,6 +355,4 @@ struct sysent sysent[] = {
{ 1, (sy_call_t *)sched_get_priority_min }, /* 333 = sched_get_priority_min */
{ 2, (sy_call_t *)sched_rr_get_interval }, /* 334 = sched_rr_get_interval */
{ 2, (sy_call_t *)utrace }, /* 335 = utrace */
- { 8, (sy_call_t *)sendfile }, /* 336 = sendfile */
- { 3, (sy_call_t *)kldsym }, /* 337 = kldsym */
};
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 2ea378fb9544..283e0c61f801 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,3 +1,5 @@
+static volatile int print_tci = 1;
+
/*-
* Copyright (c) 1997, 1998 Poul-Henning Kamp <phk@FreeBSD.org>
* Copyright (c) 1982, 1986, 1991, 1993
@@ -37,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.85 1998/11/23 09:58:53 phk Exp $
+ * $Id: kern_clock.c,v 1.79 1998/09/15 10:05:18 gibbs Exp $
*/
#include <sys/param.h>
@@ -46,7 +48,6 @@
#include <sys/callout.h>
#include <sys/kernel.h>
#include <sys/proc.h>
-#include <sys/malloc.h>
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/timex.h>
@@ -67,23 +68,10 @@
#include <machine/smp.h>
#endif
-/* This is where the NTIMECOUNTER option hangs out */
-#include "opt_ntp.h"
-
-/*
- * Number of timecounters used to implement stable storage
- */
-#ifndef NTIMECOUNTER
-#define NTIMECOUNTER 5
-#endif
-
-static MALLOC_DEFINE(M_TIMECOUNTER, "timecounter",
- "Timecounter stable storage");
-
static void initclocks __P((void *dummy));
SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL)
-static void tco_forward __P((int force));
+static void tco_forward __P((void));
static void tco_setscales __P((struct timecounter *tc));
static __inline unsigned tco_delta __P((struct timecounter *tc));
@@ -99,37 +87,9 @@ long tk_nin;
long tk_nout;
long tk_rawcc;
-time_t time_second;
+struct timecounter *timecounter;
-/*
- * Which update policy to use.
- * 0 - every tick, bad hardware may fail with "calcru negative..."
- * 1 - more resistent to the above hardware, but less efficient.
- */
-static int tco_method;
-
-/*
- * Implement a dummy timecounter which we can use until we get a real one
- * in the air. This allows the console and other early stuff to use
- * timeservices.
- */
-
-static unsigned
-dummy_get_timecount(struct timecounter *tc)
-{
- static unsigned now;
- return (++now);
-}
-
-static struct timecounter dummy_timecounter = {
- dummy_get_timecount,
- 0,
- ~0u,
- 1000000,
- "dummy"
-};
-
-struct timecounter *timecounter = &dummy_timecounter;
+time_t time_second;
/*
* Clock handling routines.
@@ -232,7 +192,7 @@ hardclock(frame)
if (stathz == 0)
statclock(frame);
- tco_forward(0);
+ tco_forward();
ticks++;
/*
@@ -365,15 +325,15 @@ statclock(frame)
{
#ifdef GPROF
register struct gmonparam *g;
- int i;
#endif
register struct proc *p;
+ register int i;
struct pstats *pstats;
long rss;
struct rusage *ru;
struct vmspace *vm;
- if (curproc != NULL && CLKF_USERMODE(frame)) {
+ if (CLKF_USERMODE(frame)) {
p = curproc;
if (p->p_flag & P_PROFIL)
addupc_intr(p, CLKF_PC(frame), 1);
@@ -522,12 +482,8 @@ getmicrotime(struct timeval *tvp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- *tvp = tc->tc_microtime;
- } else {
- microtime(tvp);
- }
+ tc = timecounter;
+ *tvp = tc->tc_microtime;
}
void
@@ -535,12 +491,8 @@ getnanotime(struct timespec *tsp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- *tsp = tc->tc_nanotime;
- } else {
- nanotime(tsp);
- }
+ tc = timecounter;
+ *tsp = tc->tc_nanotime;
}
void
@@ -611,13 +563,9 @@ getmicrouptime(struct timeval *tvp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- tvp->tv_sec = tc->tc_offset_sec;
- tvp->tv_usec = tc->tc_offset_micro;
- } else {
- microuptime(tvp);
- }
+ tc = timecounter;
+ tvp->tv_sec = tc->tc_offset_sec;
+ tvp->tv_usec = tc->tc_offset_micro;
}
void
@@ -625,13 +573,9 @@ getnanouptime(struct timespec *tsp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- tsp->tv_sec = tc->tc_offset_sec;
- tsp->tv_nsec = tc->tc_offset_nano >> 32;
- } else {
- nanouptime(tsp);
- }
+ tc = timecounter;
+ tsp->tv_sec = tc->tc_offset_sec;
+ tsp->tv_nsec = tc->tc_offset_nano >> 32;
}
void
@@ -650,14 +594,14 @@ microuptime(struct timeval *tv)
}
void
-nanouptime(struct timespec *ts)
+nanouptime(struct timespec *tv)
{
unsigned count;
u_int64_t delta;
struct timecounter *tc;
tc = (struct timecounter *)timecounter;
- ts->tv_sec = tc->tc_offset_sec;
+ tv->tv_sec = tc->tc_offset_sec;
count = tco_delta(tc);
delta = tc->tc_offset_nano;
delta += ((u_int64_t)count * tc->tc_scale_nano_f);
@@ -665,9 +609,9 @@ nanouptime(struct timespec *ts)
delta += ((u_int64_t)count * tc->tc_scale_nano_i);
if (delta >= 1000000000) {
delta -= 1000000000;
- ts->tv_sec++;
+ tv->tv_sec++;
}
- ts->tv_nsec = delta;
+ tv->tv_nsec = delta;
}
static void
@@ -689,29 +633,33 @@ tco_setscales(struct timecounter *tc)
void
init_timecounter(struct timecounter *tc)
{
- struct timespec ts1;
- struct timecounter *t1, *t2, *t3;
+ struct timespec ts0, ts1;
int i;
tc->tc_adjustment = 0;
tco_setscales(tc);
tc->tc_offset_count = tc->tc_get_timecount(tc);
- tc->tc_tweak = tc;
- MALLOC(t1, struct timecounter *, sizeof *t1, M_TIMECOUNTER, M_WAITOK);
- *t1 = *tc;
- t2 = t1;
- for (i = 1; i < NTIMECOUNTER; i++) {
- MALLOC(t3, struct timecounter *, sizeof *t3,
- M_TIMECOUNTER, M_WAITOK);
- *t3 = *tc;
- t3->tc_other = t2;
- t2 = t3;
- }
- t1->tc_other = t3;
- tc = t1;
-
- printf("Timecounter \"%s\" frequency %lu Hz\n",
- tc->tc_name, (u_long)tc->tc_frequency);
+ tc[0].tc_tweak = &tc[0];
+ tc[2] = tc[1] = tc[0];
+ tc[1].tc_other = &tc[2];
+ tc[2].tc_other = &tc[1];
+ if (!timecounter || !strcmp(timecounter->tc_name, "dummy"))
+ timecounter = &tc[2];
+ tc = &tc[1];
+
+ /*
+ * Figure out the cost of calling this timecounter.
+ */
+ nanotime(&ts0);
+ for (i = 0; i < 256; i ++)
+ tc->tc_get_timecount(tc);
+ nanotime(&ts1);
+ ts1.tv_sec -= ts0.tv_sec;
+ tc->tc_cost = ts1.tv_sec * 1000000000 + ts1.tv_nsec - ts0.tv_nsec;
+ tc->tc_cost >>= 8;
+ if (print_tci && strcmp(tc->tc_name, "dummy"))
+ printf("Timecounter \"%s\" frequency %lu Hz cost %u ns\n",
+ tc->tc_name, (u_long)tc->tc_frequency, tc->tc_cost);
/* XXX: For now always start using the counter. */
tc->tc_offset_count = tc->tc_get_timecount(tc);
@@ -735,7 +683,7 @@ set_timecounter(struct timespec *ts)
boottime.tv_sec--;
}
/* fiddle all the little crinkly bits around the fiords... */
- tco_forward(1);
+ tco_forward();
}
@@ -783,7 +731,7 @@ sync_other_counter(void)
}
static void
-tco_forward(int force)
+tco_forward(void)
{
struct timecounter *tc, *tco;
@@ -803,7 +751,6 @@ tco_forward(int force)
if (timedelta != 0) {
tc->tc_offset_nano += (u_int64_t)(tickdelta * 1000) << 32;
timedelta -= tickdelta;
- force++;
}
while (tc->tc_offset_nano >= 1000000000ULL << 32) {
@@ -813,12 +760,8 @@ tco_forward(int force)
tc->tc_adjustment = tc->tc_tweak->tc_adjustment;
ntp_update_second(tc); /* XXX only needed if xntpd runs */
tco_setscales(tc);
- force++;
}
- if (tco_method && !force)
- return;
-
tc->tc_offset_micro = (tc->tc_offset_nano / 1000) >> 32;
/* Figure out the wall-clock time */
@@ -856,15 +799,39 @@ sysctl_kern_timecounter_adjustment SYSCTL_HANDLER_ARGS
SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, "");
-SYSCTL_INT(_kern_timecounter, KERN_ARGMAX, method, CTLFLAG_RW, &tco_method, 0,
- "This variable determines the method used for updating timecounters. "
- "If the default algorithm (0) fails with \"calcru negative...\" messages "
- "try the alternate algorithm (1) which handles bad hardware better."
-
-);
-
SYSCTL_PROC(_kern_timecounter, OID_AUTO, frequency, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(u_int), sysctl_kern_timecounter_frequency, "I", "");
SYSCTL_PROC(_kern_timecounter, OID_AUTO, adjustment, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(int), sysctl_kern_timecounter_adjustment, "I", "");
+
+/*
+ * Implement a dummy timecounter which we can use until we get a real one
+ * in the air. This allows the console and other early stuff to use
+ * timeservices.
+ */
+
+static unsigned
+dummy_get_timecount(struct timecounter *tc)
+{
+ static unsigned now;
+ return (++now);
+}
+
+static struct timecounter dummy_timecounter[3] = {
+ {
+ dummy_get_timecount,
+ 0,
+ ~0u,
+ 1000000,
+ "dummy"
+ }
+};
+
+static void
+initdummytimecounter(void *dummy)
+{
+ init_timecounter(dummy_timecounter);
+}
+
+SYSINIT(dummytc, SI_SUB_CONSOLE, SI_ORDER_FIRST, initdummytimecounter, NULL)
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index df832f63fb7f..684b36514f8a 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.28 1998/10/25 17:44:50 phk Exp $
+ * $Id: kern_conf.c,v 1.26 1998/06/26 18:14:25 phk Exp $
*/
#include <sys/param.h>
@@ -57,6 +57,7 @@ int nchrdev = NUMCDEV;
dev_t
chrtoblk(dev_t dev)
{
+ struct bdevsw *bd;
struct cdevsw *cd;
if(cd = cdevsw[major(dev)]) {
@@ -166,7 +167,7 @@ cdevsw_add_generic(int bdev, int cdev, struct cdevsw *cdevsw)
}
int
-cdevsw_module_handler(module_t mod, int what, void *arg)
+cdevsw_module_handler(module_t mod, modeventtype_t what, void* arg)
{
struct cdevsw_module_data* data = (struct cdevsw_module_data*) arg;
int error;
@@ -190,7 +191,7 @@ cdevsw_module_handler(module_t mod, int what, void *arg)
}
int
-bdevsw_module_handler(module_t mod, int what, void* arg)
+bdevsw_module_handler(module_t mod, modeventtype_t what, void* arg)
{
struct bdevsw_module_data* data = (struct bdevsw_module_data*) arg;
int error;
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 1d18a86d98a2..e3d736b417b4 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $Id: kern_descrip.c,v 1.57 1998/11/11 10:55:56 truckman Exp $
+ * $Id: kern_descrip.c,v 1.54 1998/07/15 06:10:16 bde Exp $
*/
#include "opt_compat.h"
@@ -71,7 +71,6 @@
static MALLOC_DEFINE(M_FILEDESC, "file desc", "Open file descriptor table");
MALLOC_DEFINE(M_FILE, "file", "Open file structure");
-static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures");
static d_open_t fdopen;
@@ -258,13 +257,30 @@ fcntl(p, uap)
return (error);
case F_GETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ p->p_retval[0] = ((struct socket *)fp->f_data)->so_pgid;
+ return (0);
+ }
error = (*fp->f_ops->fo_ioctl)
- (fp, FIOGETOWN, (caddr_t)p->p_retval, p);
+ (fp, TIOCGPGRP, (caddr_t)p->p_retval, p);
+ p->p_retval[0] = - p->p_retval[0];
return (error);
case F_SETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ ((struct socket *)fp->f_data)->so_pgid = uap->arg;
+ return (0);
+ }
+ if (uap->arg <= 0) {
+ uap->arg = -uap->arg;
+ } else {
+ struct proc *p1 = pfind(uap->arg);
+ if (p1 == 0)
+ return (ESRCH);
+ uap->arg = p1->p_pgrp->pg_id;
+ }
return ((*fp->f_ops->fo_ioctl)
- (fp, FIOSETOWN, (caddr_t)&uap->arg, p));
+ (fp, TIOCSPGRP, (caddr_t)&uap->arg, p));
case F_SETLKW:
flg |= F_WAIT;
@@ -350,127 +366,6 @@ finishdup(fdp, old, new, retval)
}
/*
- * If sigio is on the list associated with a process or process group,
- * disable signalling from the device, remove sigio from the list and
- * free sigio.
- */
-void
-funsetown(sigio)
- struct sigio *sigio;
-{
- int s;
-
- if (sigio == NULL)
- return;
- s = splhigh();
- *(sigio->sio_myref) = NULL;
- splx(s);
- if (sigio->sio_pgid < 0) {
- SLIST_REMOVE(&sigio->sio_pgrp->pg_sigiolst, sigio,
- sigio, sio_pgsigio);
- } else /* if ((*sigiop)->sio_pgid > 0) */ {
- SLIST_REMOVE(&sigio->sio_proc->p_sigiolst, sigio,
- sigio, sio_pgsigio);
- }
- crfree(sigio->sio_ucred);
- FREE(sigio, M_SIGIO);
-}
-
-/* Free a list of sigio structures. */
-void
-funsetownlst(sigiolst)
- struct sigiolst *sigiolst;
-{
- struct sigio *sigio;
-
- while ((sigio = sigiolst->slh_first) != NULL)
- funsetown(sigio);
-}
-
-/*
- * This is common code for FIOSETOWN ioctl called by fcntl(fd, F_SETOWN, arg).
- *
- * After permission checking, add a sigio structure to the sigio list for
- * the process or process group.
- */
-int
-fsetown(pgid, sigiop)
- pid_t pgid;
- struct sigio **sigiop;
-{
- struct proc *proc;
- struct pgrp *pgrp;
- struct sigio *sigio;
- int s;
-
- if (pgid == 0) {
- funsetown(*sigiop);
- return (0);
- }
- if (pgid > 0) {
- proc = pfind(pgid);
- if (proc == NULL)
- return (ESRCH);
- /*
- * Policy - Don't allow a process to FSETOWN a process
- * in another session.
- *
- * Remove this test to allow maximum flexibility or
- * restrict FSETOWN to the current process or process
- * group for maximum safety.
- */
- else if (proc->p_session != curproc->p_session)
- return (EPERM);
- pgrp = NULL;
- } else /* if (pgid < 0) */ {
- pgrp = pgfind(-pgid);
- if (pgrp == NULL)
- return (ESRCH);
- /*
- * Policy - Don't allow a process to FSETOWN a process
- * in another session.
- *
- * Remove this test to allow maximum flexibility or
- * restrict FSETOWN to the current process or process
- * group for maximum safety.
- */
- else if (pgrp->pg_session != curproc->p_session)
- return (EPERM);
- proc = NULL;
- }
- funsetown(*sigiop);
- MALLOC(sigio, struct sigio *, sizeof(struct sigio), M_SIGIO,
- M_WAITOK);
- if (pgid > 0) {
- SLIST_INSERT_HEAD(&proc->p_sigiolst, sigio, sio_pgsigio);
- sigio->sio_proc = proc;
- } else {
- SLIST_INSERT_HEAD(&pgrp->pg_sigiolst, sigio, sio_pgsigio);
- sigio->sio_pgrp = pgrp;
- }
- sigio->sio_pgid = pgid;
- crhold(curproc->p_ucred);
- sigio->sio_ucred = curproc->p_ucred;
- /* It would be convenient if p_ruid was in ucred. */
- sigio->sio_ruid = curproc->p_cred->p_ruid;
- sigio->sio_myref = sigiop;
- s = splhigh();
- *sigiop = sigio;
- splx(s);
- return (0);
-}
-
-/*
- * This is common code for FIOGETOWN ioctl called by fcntl(fd, F_GETOWN, arg).
- */
-pid_t
-fgetown(sigio)
- struct sigio *sigio;
-{
- return (sigio != NULL ? sigio->sio_pgid : 0);
-}
-
-/*
* Close a file descriptor.
*/
#ifndef _SYS_SYSPROTO_H_
@@ -845,7 +740,7 @@ ffree(fp)
{
LIST_REMOVE(fp, f_list);
crfree(fp->f_cred);
-#if defined(DIAGNOSTIC) || defined(INVARIANTS)
+#ifdef DIAGNOSTIC
fp->f_count = 0;
#endif
nfiles--;
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index 2243e2749fb6..790fbf4f9d65 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_environment.c,v 1.3 1998/10/09 21:21:34 msmith Exp $
+ * $Id: kern_environment.c,v 1.2 1998/10/09 11:03:46 jkh Exp $
*/
/*
@@ -65,25 +65,6 @@ getenv(char *name)
return(NULL);
}
-/*
- * Return an integer value from an environment variable.
- */
-int
-getenv_int(char *name, int *data)
-{
- char *value, *vtp;
- quad_t iv;
-
- if ((value = getenv(name)) == NULL)
- return(0);
-
- iv = strtoq(value, &vtp, 0);
- if ((vtp == value) || (*vtp != 0))
- return(0);
-
- *data = (int)iv;
- return(1);
-}
static int
sysctl_kernenv SYSCTL_HANDLER_ARGS
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index dd6367203579..d30d9c29fc9b 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.92 1998/12/30 10:38:59 dfr Exp $
+ * $Id: kern_exec.c,v 1.86 1998/09/04 08:06:55 dfr Exp $
*/
#include <sys/param.h>
@@ -66,12 +66,11 @@
static long *exec_copyout_strings __P((struct image_params *));
-static long ps_strings = PS_STRINGS;
-SYSCTL_LONG(_kern, KERN_PS_STRINGS, ps_strings, CTLFLAG_RD, &ps_strings, "");
-
-static long usrstack = USRSTACK;
-SYSCTL_LONG(_kern, KERN_USRSTACK, usrstack, CTLFLAG_RD, &usrstack, "");
+static struct ps_strings *ps_strings = PS_STRINGS;
+SYSCTL_INTPTR(_kern, KERN_PS_STRINGS, ps_strings, 0, &ps_strings, 0, "");
+static caddr_t usrstack = (caddr_t)USRSTACK;
+SYSCTL_INTPTR(_kern, KERN_USRSTACK, usrstack, 0, &usrstack, 0, "");
/*
* Each of the items is a pointer to a `const struct execsw', hence the
* double pointer here.
@@ -149,7 +148,6 @@ interpret:
}
imgp->vp = ndp->ni_vp;
- imgp->fname = uap->fname;
/*
* Check file permissions (also 'opens' file)
@@ -324,8 +322,8 @@ exec_fail_dealloc:
kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
ARG_MAX + PAGE_SIZE);
- if (imgp->vp) {
- vrele(imgp->vp);
+ if (ndp->ni_vp) {
+ vrele(ndp->ni_vp);
zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
}
@@ -410,7 +408,7 @@ exec_unmap_first_page(imgp)
{
if (imgp->firstpage) {
pmap_kremove((vm_offset_t) imgp->image_header);
- vm_page_unwire(imgp->firstpage, 1);
+ vm_page_unwire(imgp->firstpage);
imgp->firstpage = NULL;
}
}
@@ -426,11 +424,7 @@ exec_new_vmspace(imgp)
{
int error;
struct vmspace *vmspace = imgp->proc->p_vmspace;
-#ifdef VM_STACK
- caddr_t stack_addr = (caddr_t) (USRSTACK - MAXSSIZ);
-#else
caddr_t stack_addr = (caddr_t) (USRSTACK - SGROWSIZ);
-#endif
vm_map_t map = &vmspace->vm_map;
imgp->vmspace_destroyed = 1;
@@ -443,8 +437,8 @@ exec_new_vmspace(imgp)
if (vmspace->vm_refcnt == 1) {
if (vmspace->vm_shm)
shmexit(imgp->proc);
- pmap_remove_pages(&vmspace->vm_pmap, 0, VM_MAXUSER_ADDRESS);
- vm_map_remove(map, 0, VM_MAXUSER_ADDRESS);
+ pmap_remove_pages(&vmspace->vm_pmap, 0, USRSTACK);
+ vm_map_remove(map, 0, USRSTACK);
} else {
vmspace_exec(imgp->proc);
vmspace = imgp->proc->p_vmspace;
@@ -452,19 +446,6 @@ exec_new_vmspace(imgp)
}
/* Allocate a new stack */
-#ifdef VM_STACK
- error = vm_map_stack (&vmspace->vm_map, (vm_offset_t)stack_addr,
- (vm_size_t)MAXSSIZ, VM_PROT_ALL, VM_PROT_ALL, 0);
- if (error)
- return (error);
-
- /* vm_ssize and vm_maxsaddr are somewhat antiquated concepts in the
- * VM_STACK case, but they are still used to monitor the size of the
- * process stack so we can check the stack rlimit.
- */
- vmspace->vm_ssize = SGROWSIZ >> PAGE_SHIFT;
- vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ;
-#else
error = vm_map_insert(&vmspace->vm_map, NULL, 0,
(vm_offset_t) stack_addr, (vm_offset_t) USRSTACK,
VM_PROT_ALL, VM_PROT_ALL, 0);
@@ -475,7 +456,6 @@ exec_new_vmspace(imgp)
/* Initialize maximum stack address */
vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ;
-#endif
return(0);
}
@@ -569,7 +549,7 @@ exec_copyout_strings(imgp)
* Calculate string base and vector table pointers.
* Also deal with signal trampoline code for this exec type.
*/
- arginfo = (struct ps_strings *)PS_STRINGS;
+ arginfo = PS_STRINGS;
szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 7be01af67fac..31c31bbd8926 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.70 1998/12/19 02:55:33 julian Exp $
+ * $Id: kern_exit.c,v 1.66 1998/04/06 08:26:03 phk Exp $
*/
#include "opt_compat.h"
@@ -45,7 +45,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/pioctl.h>
@@ -73,9 +72,6 @@
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_zone.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/user.h>
-#endif
static MALLOC_DEFINE(M_ZOMBIE, "zombie", "zombie proc status");
@@ -184,20 +180,12 @@ exit1(p, rv)
*/
p->p_flag &= ~(P_TRACED | P_PPWAIT);
p->p_flag |= P_WEXIT;
-#ifndef COMPAT_LINUX_THREADS
p->p_sigignore = ~0;
-#endif /* COMPAT_LINUX_THREADS */
p->p_siglist = 0;
if (timevalisset(&p->p_realtimer.it_value))
untimeout(realitexpire, (caddr_t)p, p->p_ithandle);
/*
- * Reset any sigio structures pointing to us as a result of
- * F_SETOWN with our pid.
- */
- funsetownlst(&p->p_sigiolst);
-
- /*
* Close open files and release open-file table.
* This may block!
*/
@@ -287,9 +275,6 @@ exit1(p, rv)
LIST_REMOVE(q, p_sibling);
LIST_INSERT_HEAD(&initproc->p_children, q, p_sibling);
q->p_pptr = initproc;
-#ifdef COMPAT_LINUX_THREADS
- q->p_sigparent = 0;
-#endif /* COMPAT_LINUX_THREADS */
/*
* Traced processes are killed
* since their existence means someone is screwing up.
@@ -314,11 +299,7 @@ exit1(p, rv)
* flag set, notify process 1 instead (and hope it will handle
* this situation).
*/
-#ifndef COMPAT_LINUX_THREADS
if (p->p_pptr->p_flag & P_NOCLDWAIT) {
-#else
- if (p->p_pptr->p_procsig->ps_flag & P_NOCLDWAIT) {
-#endif /* COMPAT_LINUX_THREADS */
struct proc *pp = p->p_pptr;
proc_reparent(p, initproc);
/*
@@ -330,15 +311,7 @@ exit1(p, rv)
wakeup((caddr_t)pp);
}
-#ifndef COMPAT_LINUX_THREADS
psignal(p->p_pptr, SIGCHLD);
-#else
- if (p->p_sigparent && p->p_pptr != initproc) {
- psignal(p->p_pptr, p->p_sigparent);
- } else {
- psignal(p->p_pptr, SIGCHLD);
- }
-#endif /* COMPAT_LINUX_THREADS */
wakeup((caddr_t)p->p_pptr);
#if defined(tahoe)
/* move this to cpu_exit */
@@ -508,14 +481,6 @@ loop:
LIST_REMOVE(p, p_list); /* off zombproc */
LIST_REMOVE(p, p_sibling);
-#ifdef COMPAT_LINUX_THREADS
- if (--p->p_procsig->ps_refcnt == 0) {
- if (p->p_sigacts != &p->p_addr->u_sigacts)
- FREE(p->p_sigacts, M_SUBPROC);
- FREE(p->p_procsig, M_SUBPROC);
- p->p_procsig = NULL;
- }
-#endif /* COMPAT_LINUX_THREADS */
/*
* Give machine-dependent layer a chance
* to free anything that cpu_exit couldn't
@@ -626,22 +591,3 @@ rm_at_exit(function)
}
return (count);
}
-
-#ifdef COMPAT_LINUX_THREADS
-void check_sigacts (void)
-{
- struct proc *p = curproc;
- struct sigacts *pss;
- int s;
-
- if (p->p_procsig->ps_refcnt == 1 &&
- p->p_sigacts != &p->p_addr->u_sigacts) {
- pss = p->p_sigacts;
- s = splhigh();
- p->p_addr->u_sigacts = *pss;
- p->p_sigacts = &p->p_addr->u_sigacts;
- splx(s);
- FREE(pss, M_SUBPROC);
- }
-}
-#endif
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 732712b32fd8..26cbe47576d6 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
- * $Id: kern_fork.c,v 1.53 1998/12/19 02:55:33 julian Exp $
+ * $Id: kern_fork.c,v 1.50 1997/12/12 04:00:58 dyson Exp $
*/
#include "opt_ktrace.h"
@@ -62,10 +62,6 @@
#include <vm/vm_extern.h>
#include <vm/vm_zone.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <machine/frame.h>
-#include <sys/user.h>
-#endif /* COMPAT_LINUX_THREADS */
#ifdef SMP
static int fast_vfork = 0; /* Doesn't work on SMP yet. */
#else
@@ -275,8 +271,7 @@ retry:
again:
for (; p2 != 0; p2 = p2->p_list.le_next) {
while (p2->p_pid == nextpid ||
- p2->p_pgrp->pg_id == nextpid ||
- p2->p_session->s_sid == nextpid) {
+ p2->p_pgrp->pg_id == nextpid) {
nextpid++;
if (nextpid >= pidchecked)
goto retry;
@@ -286,9 +281,6 @@ again:
if (p2->p_pgrp->pg_id > nextpid &&
pidchecked > p2->p_pgrp->pg_id)
pidchecked = p2->p_pgrp->pg_id;
- if (p2->p_session->s_sid > nextpid &&
- pidchecked > p2->p_session->s_sid)
- pidchecked = p2->p_session->s_sid;
}
if (!doingzomb) {
doingzomb = 1;
@@ -329,44 +321,6 @@ again:
p2->p_cred->p_refcnt = 1;
crhold(p1->p_ucred);
-#ifdef COMPAT_LINUX_THREADS
- if (flags & RFSIGSHARE) {
- p2->p_procsig = p1->p_procsig;
- p2->p_procsig->ps_refcnt++;
- if (p1->p_sigacts == &p1->p_addr->u_sigacts) {
- struct sigacts *newsigacts;
- int s;
-
- if (p2->p_procsig->ps_refcnt != 2)
- printf ("PID:%d Creating shared sigacts with procsig->ps_refcnt %d\n",
- p2->p_pid, p2->p_procsig->ps_refcnt);
- /* Create the shared sigacts structure */
- MALLOC (newsigacts, struct sigacts *, sizeof (struct sigacts),
- M_SUBPROC, M_WAITOK);
- s = splhigh();
- /* Set p_sigacts to the new shared structure. Note that this
- * is updating p1->p_sigacts at the same time, since p_sigacts
- * is just a pointer to the shared p_procsig->ps_sigacts.
- */
- p2->p_sigacts = newsigacts;
- /* Copy in the values from the u area */
- *p2->p_sigacts = p1->p_addr->u_sigacts;
- splx (s);
- }
- } else {
- MALLOC (p2->p_procsig, struct procsig *, sizeof(struct procsig),
- M_SUBPROC, M_WAITOK);
- bcopy(&p1->p_procsig->ps_begincopy, &p2->p_procsig->ps_begincopy,
- (unsigned)&p1->p_procsig->ps_endcopy -
- (unsigned)&p1->p_procsig->ps_begincopy);
- p2->p_procsig->ps_refcnt = 1;
- /* Note that we fill in the values of sigacts in vm_fork */
- p2->p_sigacts = NULL;
- }
- if (flags & RFLINUXTHPN) {
- p2->p_sigparent = SIGUSR1;
- }
-#endif /* COMPAT_LINUX_THREADS */
/* bump references to the text vnode (for procfs) */
p2->p_textvp = p1->p_textvp;
if (p2->p_textvp)
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 1d6756c0065c..207263736e86 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -23,14 +23,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kern_intr.c,v 1.20 1998/09/26 14:25:31 dfr Exp $
+ * $Id: kern_intr.c,v 1.19 1998/08/11 15:08:13 bde Exp $
*
*/
-#include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/types.h>
#include <sys/malloc.h>
+#include <sys/systm.h>
#include <sys/errno.h>
#ifdef RESOURCE_CHECK
#include <sys/drvresource.h>
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 7a6d237a8f48..57f470a6656f 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93
- * $Id: kern_ktrace.c,v 1.24 1998/11/10 09:16:29 peter Exp $
+ * $Id: kern_ktrace.c,v 1.22 1997/12/05 19:55:38 bde Exp $
*/
#include "opt_ktrace.h"
@@ -39,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/fcntl.h>
#include <sys/lock.h>
@@ -473,7 +472,7 @@ ktrwrite(vp, kth)
aiov[0].iov_len = sizeof(struct ktr_header);
auio.uio_resid = sizeof(struct ktr_header);
auio.uio_iovcnt = 1;
- auio.uio_procp = curproc;
+ auio.uio_procp = (struct proc *)0;
if (kth->ktr_len > 0) {
auio.uio_iovcnt++;
aiov[1].iov_base = kth->ktr_buf;
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 97def9fe8350..b43953b5936b 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_linker.c,v 1.20 1999/01/19 16:26:32 peter Exp $
+ * $Id: kern_linker.c,v 1.9 1998/10/10 02:29:07 peter Exp $
*/
#include "opt_ddb.h"
@@ -47,13 +47,8 @@
#include <sys/vnode.h>
#include <sys/sysctl.h>
-#ifdef KLD_DEBUG
-int kld_debug = 0;
-#endif
-
MALLOC_DEFINE(M_LINKER, "kld", "kernel linker");
linker_file_t linker_current_file;
-linker_file_t linker_kernel_file;
static struct lock lock; /* lock for the file list */
static linker_class_list_t classes;
@@ -123,11 +118,11 @@ linker_file_sysinit(linker_file_t lf)
* Since some things care about execution order, this is the
* operation which ensures continued function.
*/
- for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
- for (xipp = sipp + 1; *xipp; xipp++) {
- if ((*sipp)->subsystem <= (*xipp)->subsystem ||
- ((*sipp)->subsystem == (*xipp)->subsystem &&
- (*sipp)->order <= (*xipp)->order))
+ for( sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
+ for( xipp = sipp + 1; *xipp; xipp++) {
+ if( (*sipp)->subsystem < (*xipp)->subsystem ||
+ ( (*sipp)->subsystem == (*xipp)->subsystem &&
+ (*sipp)->order < (*xipp)->order))
continue; /* skip*/
save = *sipp;
*sipp = *xipp;
@@ -139,15 +134,18 @@ linker_file_sysinit(linker_file_t lf)
/*
* Traverse the (now) ordered list of system initialization tasks.
* Perform each task, and continue on to the next task.
+ *
+ * The last item on the list is expected to be the scheduler,
+ * which will not return.
*/
- for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
- if ((*sipp)->subsystem == SI_SUB_DUMMY)
+ for( sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
+ if( (*sipp)->subsystem == SI_SUB_DUMMY)
continue; /* skip dummy task(s)*/
- switch ((*sipp)->type) {
+ switch( (*sipp)->type) {
case SI_TYPE_DEFAULT:
/* no special processing*/
- (*((*sipp)->func))((*sipp)->udata);
+ (*((*sipp)->func))( (*sipp)->udata);
break;
case SI_TYPE_KTHREAD:
@@ -169,65 +167,7 @@ linker_file_sysinit(linker_file_t lf)
break;
default:
- panic ("linker_file_sysinit: unrecognized init type");
- }
- }
-}
-
-static void
-linker_file_sysuninit(linker_file_t lf)
-{
- struct linker_set* sysuninits;
- struct sysinit** sipp;
- struct sysinit** xipp;
- struct sysinit* save;
-
- KLD_DPF(FILE, ("linker_file_sysuninit: calling SYSUNINITs for %s\n",
- lf->filename));
-
- sysuninits = (struct linker_set*)
- linker_file_lookup_symbol(lf, "sysuninit_set", 0);
-
- KLD_DPF(FILE, ("linker_file_sysuninit: SYSUNINITs %p\n", sysuninits));
- if (!sysuninits)
- return;
-
- /*
- * Perform a reverse bubble sort of the system initialization objects
- * by their subsystem (primary key) and order (secondary key).
- *
- * Since some things care about execution order, this is the
- * operation which ensures continued function.
- */
- for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
- for (xipp = sipp + 1; *xipp; xipp++) {
- if ((*sipp)->subsystem >= (*xipp)->subsystem ||
- ((*sipp)->subsystem == (*xipp)->subsystem &&
- (*sipp)->order >= (*xipp)->order))
- continue; /* skip*/
- save = *sipp;
- *sipp = *xipp;
- *xipp = save;
- }
- }
-
-
- /*
- * Traverse the (now) ordered list of system initialization tasks.
- * Perform each task, and continue on to the next task.
- */
- for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
- if ((*sipp)->subsystem == SI_SUB_DUMMY)
- continue; /* skip dummy task(s)*/
-
- switch ((*sipp)->type) {
- case SI_TYPE_DEFAULT:
- /* no special processing*/
- (*((*sipp)->func))((*sipp)->udata);
- break;
-
- default:
- panic("linker_file_sysuninit: unrecognized uninit type");
+ panic( "linker_file_sysinit: unrecognized init type");
}
}
}
@@ -237,8 +177,7 @@ linker_load_file(const char* filename, linker_file_t* result)
{
linker_class_t lc;
linker_file_t lf;
- int foundfile, error = 0;
- char *koname = NULL;
+ int error = 0;
lf = linker_find_file_by_name(filename);
if (lf) {
@@ -248,47 +187,22 @@ linker_load_file(const char* filename, linker_file_t* result)
goto out;
}
- koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK);
- if (koname == NULL) {
- error = ENOMEM;
- goto out;
- }
- sprintf(koname, "%s.ko", filename);
lf = NULL;
- foundfile = 0;
for (lc = TAILQ_FIRST(&classes); lc; lc = TAILQ_NEXT(lc, link)) {
KLD_DPF(FILE, ("linker_load_file: trying to load %s as %s\n",
filename, lc->desc));
-
- error = lc->ops->load_file(koname, &lf); /* First with .ko */
- if (lf == NULL && error == ENOENT)
- error = lc->ops->load_file(filename, &lf); /* Then try without */
- /*
- * If we got something other than ENOENT, then it exists but we cannot
- * load it for some other reason.
- */
- if (error != ENOENT)
- foundfile = 1;
+ if (error = lc->ops->load_file(filename, &lf))
+ goto out;
if (lf) {
linker_file_sysinit(lf);
*result = lf;
- error = 0;
goto out;
}
}
- /*
- * Less than ideal, but tells the user whether it failed to load or
- * the module was not found.
- */
- if (foundfile)
- error = ENOEXEC; /* Format not recognised (or unloadable) */
- else
- error = ENOENT; /* Nothing found */
+ error = ENOEXEC; /* format not recognised */
out:
- if (koname)
- free(koname, M_LINKER);
return error;
}
@@ -296,25 +210,13 @@ linker_file_t
linker_find_file_by_name(const char* filename)
{
linker_file_t lf = 0;
- char *koname;
-
- koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK);
- if (koname == NULL)
- goto out;
- sprintf(koname, "%s.ko", filename);
lockmgr(&lock, LK_SHARED, 0, curproc);
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- if (!strcmp(lf->filename, koname))
- break;
+ for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link))
if (!strcmp(lf->filename, filename))
break;
- }
lockmgr(&lock, LK_RELEASE, 0, curproc);
-out:
- if (koname)
- free(koname, M_LINKER);
return lf;
}
@@ -410,8 +312,6 @@ linker_file_unload(linker_file_t file)
goto out;
}
- linker_file_sysuninit(file);
-
TAILQ_REMOVE(&files, file, link);
lockmgr(&lock, LK_RELEASE, 0, curproc);
@@ -459,7 +359,6 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
{
linker_sym_t sym;
linker_symval_t symval;
- linker_file_t lf;
caddr_t address;
size_t common_size = 0;
int i;
@@ -481,7 +380,7 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
}
}
- if (deps) {
+ if (deps)
for (i = 0; i < file->ndeps; i++) {
address = linker_file_lookup_symbol(file->deps[i], name, 0);
if (address) {
@@ -490,25 +389,6 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
}
}
- /* If we have not found it in the dependencies, search globally */
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- /* But skip the current file if it's on the list */
- if (lf == file)
- continue;
- /* And skip the files we searched above */
- for (i = 0; i < file->ndeps; i++)
- if (lf == file->deps[i])
- break;
- if (i < file->ndeps)
- continue;
- address = linker_file_lookup_symbol(lf, name, 0);
- if (address) {
- KLD_DPF(SYM, ("linker_file_lookup_symbol: global value=%x\n", address));
- return address;
- }
- }
- }
-
if (common_size > 0) {
/*
* This is a common symbol which was not found in the
@@ -627,7 +507,7 @@ linker_ddb_symbol_values(linker_sym_t sym, linker_symval_t *symval)
int
kldload(struct proc* p, struct kldload_args* uap)
{
- char* filename = NULL, *modulename;
+ char* filename = NULL;
linker_file_t lf;
int error = 0;
@@ -643,16 +523,7 @@ kldload(struct proc* p, struct kldload_args* uap)
if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
goto out;
- /* Can't load more than one module with the same name */
- modulename = rindex(filename, '/');
- if (modulename == NULL)
- modulename = filename;
- if (linker_find_file_by_name(modulename)) {
- error = EEXIST;
- goto out;
- }
-
- if (error = linker_load_file(filename, &lf))
+ if (error = linker_load_file(uap->file, &lf))
goto out;
lf->userrefs++;
@@ -684,10 +555,8 @@ kldunload(struct proc* p, struct kldunload_args* uap)
error = EBUSY;
goto out;
}
- error = linker_file_unload(lf);
- if (error)
- goto out;
lf->userrefs--;
+ error = linker_file_unload(lf);
} else
error = ENOENT;
@@ -698,7 +567,7 @@ out:
int
kldfind(struct proc* p, struct kldfind_args* uap)
{
- char* filename = NULL, *modulename;
+ char* filename = NULL;
linker_file_t lf;
int error = 0;
@@ -708,11 +577,7 @@ kldfind(struct proc* p, struct kldfind_args* uap)
if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
goto out;
- modulename = rindex(filename, '/');
- if (modulename == NULL)
- modulename = filename;
-
- lf = linker_find_file_by_name(modulename);
+ lf = linker_find_file_by_name(filename);
if (lf)
p->p_retval[0] = lf->id;
else
@@ -815,59 +680,6 @@ kldfirstmod(struct proc* p, struct kldfirstmod_args* uap)
return error;
}
-int
-kldsym(struct proc *p, struct kldsym_args *uap)
-{
- char *symstr = NULL;
- linker_sym_t sym;
- linker_symval_t symval;
- linker_file_t lf;
- struct kld_sym_lookup lookup;
- int error = 0;
-
- if (error = copyin(SCARG(uap, data), &lookup, sizeof(lookup)))
- goto out;
- if (lookup.version != sizeof(lookup) || SCARG(uap, cmd) != KLDSYM_LOOKUP) {
- error = EINVAL;
- goto out;
- }
-
- symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- if (error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL))
- goto out;
-
- if (SCARG(uap, fileid) != 0) {
- lf = linker_find_file_by_id(SCARG(uap, fileid));
- if (lf == NULL) {
- error = ENOENT;
- goto out;
- }
- if (lf->ops->lookup_symbol(lf, symstr, &sym) == 0 &&
- lf->ops->symbol_values(lf, sym, &symval) == 0) {
- lookup.symvalue = (u_long)symval.value;
- lookup.symsize = symval.size;
- error = copyout(&lookup, SCARG(uap, data), sizeof(lookup));
- } else
- error = ENOENT;
- } else {
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- if (lf->ops->lookup_symbol(lf, symstr, &sym) == 0 &&
- lf->ops->symbol_values(lf, sym, &symval) == 0) {
- lookup.symvalue = (u_long)symval.value;
- lookup.symsize = symval.size;
- error = copyout(&lookup, SCARG(uap, data), sizeof(lookup));
- break;
- }
- }
- if (!lf)
- error = ENOENT;
- }
-out:
- if (symstr)
- free(symstr, M_TEMP);
- return error;
-}
-
/*
* Preloaded module support
*/
@@ -890,14 +702,14 @@ linker_preload(void* arg)
modname = (char *)preload_search_info(modptr, MODINFO_NAME);
modtype = (char *)preload_search_info(modptr, MODINFO_TYPE);
if (modname == NULL) {
- printf("Preloaded module at %p does not have a name!\n", modptr);
+ printf("Preloaded module at 0x%p does not have a name!\n", modptr);
continue;
}
if (modtype == NULL) {
- printf("Preloaded module at %p does not have a type!\n", modptr);
+ printf("Preloaded module at 0x%p does not have a type!\n", modptr);
continue;
}
- printf("Preloaded %s \"%s\" at %p.\n", modtype, modname, modptr);
+ printf("Preloaded %s \"%s\" at 0x%p.\n", modtype, modname, modptr);
lf = linker_find_file_by_name(modname);
if (lf) {
lf->userrefs++;
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index e5ea6297398d..f7ca01d4b4a2 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -30,10 +30,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_lkm.c,v 1.59 1998/11/10 09:12:40 peter Exp $
+ * $Id: kern_lkm.c,v 1.56 1998/09/07 05:42:15 bde Exp $
*/
#include "opt_devfs.h"
+#include "opt_no_lkm.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -78,6 +79,16 @@ static int lkm_state = LKMS_IDLE;
static struct lkm_table lkmods[MAXLKMS]; /* table of loaded modules */
static struct lkm_table *curp; /* global for in-progress ops */
+/*
+ * XXX this bloat just exands the sysctl__vfs linker set a little so that
+ * we can attach sysctls for VFS LKMs without expanding the linker set.
+ * Currently (1998/09/06), only one VFS uses sysctls, so 2 extra linker
+ * set slots are more than sufficient.
+ */
+extern struct linker_set sysctl__vfs;
+SYSCTL_INT(_vfs, OID_AUTO, lkm0, CTLFLAG_RD, &lkm_v, 0, "");
+SYSCTL_INT(_vfs, OID_AUTO, lkm1, CTLFLAG_RD, &lkm_v, 0, "");
+
static int _lkm_dev __P((struct lkm_table *lkmtp, int cmd));
static int _lkm_exec __P((struct lkm_table *lkmtp, int cmd));
static int _lkm_vfs __P((struct lkm_table *lkmtp, int cmd));
@@ -239,7 +250,7 @@ lkmcioctl(dev, cmd, data, flag, p)
#ifdef DEBUG
printf("LKM: LMRESERV (actual = 0x%08lx)\n", curp->area);
- printf("LKM: LMRESERV (adjusted = 0x%08lx)\n",
+ printf("LKM: LMRESERV (adjusted = 0x%08x)\n",
trunc_page(curp->area));
#endif /* DEBUG */
lkm_state = LKMS_RESERVED;
@@ -480,6 +491,21 @@ lkmcioctl(dev, cmd, data, flag, p)
return (err);
}
+/*
+ * Acts like "nosys" but can be identified in sysent for dynamic call
+ * number assignment for a limited number of calls.
+ *
+ * Place holder for system call slots reserved for loadable modules.
+ */
+int
+lkmnosys(p, args)
+ struct proc *p;
+ struct nosys_args *args;
+{
+
+ return(nosys(p, args));
+}
+
int
lkmexists(lkmtp)
struct lkm_table *lkmtp;
@@ -522,16 +548,35 @@ _lkm_syscall(lkmtp, cmd)
/* don't load twice! */
if (lkmexists(lkmtp))
return(EEXIST);
+ if ((i = args->lkm_offset) == LKM_ANON) { /* auto */
+ /*
+ * Search the table looking for a slot...
+ */
+ for (i = 0; i < aout_sysvec.sv_size; i++)
+ if (aout_sysvec.sv_table[i].sy_call ==
+ (sy_call_t *)lkmnosys)
+ break; /* found it! */
+ /* out of allocable slots? */
+ if (i == aout_sysvec.sv_size) {
+ err = ENFILE;
+ break;
+ }
+ } else { /* assign */
+ if (i < 0 || i >= aout_sysvec.sv_size) {
+ err = EINVAL;
+ break;
+ }
+ }
- if (args->lkm_offset == LKM_ANON)
- i = NO_SYSCALL;
- else
- i = args->lkm_offset;
+ /* save old */
+ bcopy(&aout_sysvec.sv_table[i],
+ &(args->lkm_oldent),
+ sizeof(struct sysent));
- err = syscall_register(&i, args->lkm_sysent,
- &(args->lkm_oldent));
- if (err)
- return(err);
+ /* replace with new */
+ bcopy(args->lkm_sysent,
+ &aout_sysvec.sv_table[i],
+ sizeof(struct sysent));
/* done! */
args->lkm_offset = i; /* slot in sysent[] */
@@ -542,9 +587,11 @@ _lkm_syscall(lkmtp, cmd)
/* current slot... */
i = args->lkm_offset;
- err = syscall_deregister(&i, &(args->lkm_oldent));
- if (err)
- return(err);
+ /* replace current slot contents with old contents */
+ bcopy(&(args->lkm_oldent),
+ &aout_sysvec.sv_table[i],
+ sizeof(struct sysent));
+
break;
case LKM_E_STAT: /* no special handling... */
@@ -564,8 +611,11 @@ _lkm_vfs(lkmtp, cmd)
int cmd;
{
struct lkm_vfs *args = lkmtp->private.lkm_vfs;
+ struct linker_set *l;
+ struct sysctl_oid **oidpp;
struct vfsconf *vfc = args->lkm_vfsconf;
- int error, i;
+ struct vfsconf *vfsp, *prev_vfsp;
+ int error, i, maxtypenum;
switch(cmd) {
case LKM_E_LOAD:
@@ -573,13 +623,47 @@ _lkm_vfs(lkmtp, cmd)
if (lkmexists(lkmtp))
return(EEXIST);
- for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_add_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
- error = vfs_register(vfc);
- if (error)
- return(error);
+ for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next) {
+ if (!strcmp(vfc->vfc_name, vfsp->vfc_name)) {
+ return EEXIST;
+ }
+ }
- args->lkm_offset = vfc->vfc_typenum;
+ args->lkm_offset = vfc->vfc_typenum = maxvfsconf++;
+ if (vfc->vfc_vfsops->vfs_oid != NULL) {
+ l = &sysctl__vfs;
+ for (i = l->ls_length,
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ i--; oidpp++) {
+ if (!*oidpp || *oidpp == &sysctl___vfs_lkm0 ||
+ *oidpp == &sysctl___vfs_lkm1) {
+ *oidpp = vfc->vfc_vfsops->vfs_oid;
+ (*oidpp)->oid_number = vfc->vfc_typenum;
+ sysctl_order_all();
+ break;
+ }
+ }
+ }
+
+ vfsp->vfc_next = vfc;
+ vfc->vfc_next = NULL;
+
+ /* like in vfs_op_init */
+ for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
+ struct vnodeopv_desc *opv = (struct vnodeopv_desc *)
+ args->lkm_vnodeops->ls_items[i];
+ *(opv->opv_desc_vector_p) = NULL;
+ }
+ for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
+ struct vnodeopv_desc *opv = (struct vnodeopv_desc *)
+ args->lkm_vnodeops->ls_items[i];
+ vfs_opv_init(opv);
+ }
+
+ /*
+ * Call init function for this VFS...
+ */
+ (*(vfc->vfc_vfsops->vfs_init))(vfc);
/* done! */
break;
@@ -588,12 +672,49 @@ _lkm_vfs(lkmtp, cmd)
/* current slot... */
i = args->lkm_offset;
- error = vfs_unregister(vfc);
- if (error)
- return(error);
+ prev_vfsp = NULL;
+ for (vfsp = vfsconf; vfsp;
+ prev_vfsp = vfsp, vfsp = vfsp->vfc_next) {
+ if (!strcmp(vfc->vfc_name, vfsp->vfc_name))
+ break;
+ }
+ if (vfsp == NULL) {
+ return EINVAL;
+ }
+
+ if (vfsp->vfc_refcount) {
+ return EBUSY;
+ }
+
+ if (vfc->vfc_vfsops->vfs_uninit != NULL) {
+ error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp);
+ if (error)
+ return (error);
+ }
+
+ prev_vfsp->vfc_next = vfsp->vfc_next;
+
+ if (vfsp->vfc_vfsops->vfs_oid != NULL) {
+ l = &sysctl__vfs;
+ for (i = l->ls_length,
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ i--; oidpp++) {
+ if (*oidpp == vfsp->vfc_vfsops->vfs_oid) {
+ *oidpp = NULL;
+ sysctl_order_all();
+ break;
+ }
+ }
+ }
- for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_rm_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
+ /*
+ * Maintain maxvfsconf.
+ */
+ maxtypenum = 0;
+ for (vfsp = vfsconf; vfsp != NULL; vfsp = vfsp->vfc_next)
+ if (maxtypenum < vfsp->vfc_typenum)
+ maxtypenum = vfsp->vfc_typenum;
+ maxvfsconf = maxtypenum + 1;
break;
@@ -707,7 +828,10 @@ _lkm_exec(lkmtp, cmd)
int cmd;
{
struct lkm_exec *args = lkmtp->private.lkm_exec;
+ int i;
int err = 0;
+ const struct execsw **execsw =
+ (const struct execsw **)&execsw_set.ls_items[0];
switch(cmd) {
case LKM_E_LOAD:
@@ -722,7 +846,7 @@ _lkm_exec(lkmtp, cmd)
err = exec_register(args->lkm_exec);
/* done! */
- args->lkm_offset = 0;
+ args->lkm_offset = 0; /* slot in execsw[] */
break;
@@ -799,40 +923,27 @@ lkm_nullcmd(lkmtp, cmd)
return (0);
}
+static lkm_devsw_installed = 0;
#ifdef DEVFS
static void *lkmc_devfs_token;
#endif
-static int
-lkm_modevent(module_t mod, int type, void *data)
+static void lkm_drvinit(void *unused)
{
dev_t dev;
- static struct cdevsw *oldcdevsw;
- switch (type) {
- case MOD_LOAD:
+ if( ! lkm_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &lkmc_cdevsw, &oldcdevsw);
+ cdevsw_add(&dev,&lkmc_cdevsw, NULL);
+ lkm_devsw_installed = 1;
#ifdef DEVFS
lkmc_devfs_token = devfs_add_devswf(&lkmc_cdevsw, 0, DV_CHR,
UID_ROOT, GID_WHEEL, 0644,
"lkm");
#endif
- break;
- case MOD_UNLOAD:
-#ifdef DEVFS
- devfs_remove_dev(lkmc_devfs_token);
-#endif
- cdevsw_add(&dev, oldcdevsw, NULL);
- break;
- default:
- break;
- }
- return 0;
+ }
}
-static moduledata_t lkm_mod = {
- "lkm",
- lkm_modevent,
- NULL
-};
-DECLARE_MODULE(lkm, lkm_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR);
+
+#ifndef NO_LKM
+SYSINIT(lkmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,lkm_drvinit,NULL)
+#endif
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index e832acff84a2..65a84ea9737f 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* @(#)kern_lock.c 8.18 (Berkeley) 5/21/95
- * $Id: kern_lock.c,v 1.22 1999/01/10 01:58:24 eivind Exp $
+ * $Id: kern_lock.c,v 1.18 1998/03/07 19:25:34 dyson Exp $
*/
#include "opt_lint.h"
@@ -83,8 +83,14 @@ sharelock(struct lock *lkp, int incr) {
static LOCK_INLINE void
shareunlock(struct lock *lkp, int decr) {
-
- KASSERT(lkp->lk_sharecount >= decr, ("shareunlock: count < decr"));
+#if defined(DIAGNOSTIC)
+ if (lkp->lk_sharecount < decr)
+#if defined(DDB)
+ Debugger("shareunlock: count < decr");
+#else
+ panic("shareunlock: count < decr");
+#endif
+#endif
if (lkp->lk_sharecount == decr) {
lkp->lk_flags &= ~LK_SHARE_NONZERO;
@@ -171,20 +177,11 @@ acquire(struct lock *lkp, int extflags, int wanted) {
* accepted shared locks and shared-to-exclusive upgrades to go away.
*/
int
-#ifndef DEBUG_LOCKS
lockmgr(lkp, flags, interlkp, p)
-#else
-debuglockmgr(lkp, flags, interlkp, p, name, file, line)
-#endif
struct lock *lkp;
u_int flags;
struct simplelock *interlkp;
struct proc *p;
-#ifdef DEBUG_LOCKS
- const char *name; /* Name of lock function */
- const char *file; /* Name of file call is from */
- int line; /* Line number in file */
-#endif
{
int error;
pid_t pid;
@@ -292,11 +289,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
panic("lockmgr: non-zero exclusive count");
#endif
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
}
@@ -352,11 +344,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
panic("lockmgr: non-zero exclusive count");
#endif
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
@@ -402,11 +389,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
lkp->lk_flags |= LK_DRAINING | LK_HAVE_EXCL;
lkp->lk_lockholder = pid;
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
@@ -522,7 +504,7 @@ lockmgr_printinfo(lkp)
static int lockpausetime = 0;
SYSCTL_INT(_debug, OID_AUTO, lockpausetime, CTLFLAG_RW, &lockpausetime, 0, "");
-static int simplelockrecurse;
+int simplelockrecurse;
/*
* Simple lock functions so that the debugger can see from whence
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index cc1b8a562f20..bc73d382339b 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -34,14 +34,13 @@
* SUCH DAMAGE.
*
* @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94
- * $Id: kern_lockf.c,v 1.19 1998/07/29 17:38:14 bde Exp $
+ * $Id: kern_lockf.c,v 1.18 1998/01/31 07:23:11 eivind Exp $
*/
#include "opt_debug_lockf.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/proc.h>
#include <sys/unistd.h>
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index a9776a5f9a8c..618b726361c0 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.50 1999/01/08 17:31:09 eivind Exp $
+ * $Id: kern_malloc.c,v 1.46 1998/07/29 17:38:14 bde Exp $
*/
#include "opt_vm.h"
@@ -53,18 +53,19 @@
#include <vm/vm_map.h>
static void kmeminit __P((void *));
+static void malloc_init __P((struct malloc_type *));
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
static MALLOC_DEFINE(M_FREE, "free", "should be on free list");
-static struct malloc_type *kmemstatistics;
+static struct malloc_type *kmemstatistics = M_FREE;
static struct kmembuckets bucket[MINBUCKET + 16];
static struct kmemusage *kmemusage;
static char *kmembase;
static char *kmemlimit;
static int vm_kmem_size;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* This structure provides a set of masks to catch unaligned frees.
*/
@@ -94,11 +95,11 @@ struct freelist {
long spare1;
caddr_t next;
};
-#else /* !INVARIANTS */
+#else /* !DIAGNOSTIC */
struct freelist {
caddr_t next;
};
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
/*
* Allocate a block of memory
@@ -115,7 +116,7 @@ malloc(size, type, flags)
long indx, npg, allocsize;
int s;
caddr_t va, cp, savedlist;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
long *end, *lp;
int copysize;
char *savedtype;
@@ -138,7 +139,7 @@ malloc(size, type, flags)
tsleep((caddr_t)ksp, PSWP+2, type->ks_shortdesc, 0);
}
ksp->ks_size |= 1 << indx;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
copysize = 1 << indx < MAX_COPY ? 1 << indx : MAX_COPY;
#endif
if (kbp->kb_next == NULL) {
@@ -174,7 +175,7 @@ malloc(size, type, flags)
kbp->kb_next = cp = va + (npg * PAGE_SIZE) - allocsize;
for (;;) {
freep = (struct freelist *)cp;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Copy in known text to detect modification
* after freeing.
@@ -183,7 +184,7 @@ malloc(size, type, flags)
for (lp = (long *)cp; lp < end; lp++)
*lp = WEIRD_ADDR;
freep->type = M_FREE;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
if (cp <= va)
break;
cp -= allocsize;
@@ -195,7 +196,7 @@ malloc(size, type, flags)
}
va = kbp->kb_next;
kbp->kb_next = ((struct freelist *)va)->next;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
freep = (struct freelist *)va;
savedtype = (char *) type->ks_shortdesc;
#if BYTE_ORDER == BIG_ENDIAN
@@ -219,7 +220,7 @@ malloc(size, type, flags)
break;
}
freep->spare0 = 0;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
kup = btokup(va);
if (kup->ku_indx != indx)
panic("malloc: wrong bucket");
@@ -251,7 +252,7 @@ free(addr, type)
register struct freelist *freep;
long size;
int s;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
struct freelist *fp;
long *end, *lp, alloc, copysize;
#endif
@@ -260,13 +261,16 @@ free(addr, type)
if (!type->ks_next)
panic("freeing with unknown type (%s)", type->ks_shortdesc);
- KASSERT(kmembase <= (char *)addr && (char *)addr < kmemlimit,
- ("free: address %p out of range", (void *)addr));
+#ifdef DIAGNOSTIC
+ if ((char *)addr < kmembase || (char *)addr >= kmemlimit) {
+ panic("free: address %p out of range", (void *)addr);
+ }
+#endif
kup = btokup(addr);
size = 1 << kup->ku_indx;
kbp = &bucket[kup->ku_indx];
s = splmem();
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Check for returns of data that do not point to the
* beginning of the allocation.
@@ -278,7 +282,7 @@ free(addr, type)
if (((uintptr_t)(void *)addr & alloc) != 0)
panic("free: unaligned addr %p, size %ld, type %s, mask %ld",
(void *)addr, size, type->ks_shortdesc, alloc);
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
if (size > MAXALLOCSAVE) {
kmem_free(kmem_map, (vm_offset_t)addr, ctob(kup->ku_pagecnt));
size = kup->ku_pagecnt << PAGE_SHIFT;
@@ -294,7 +298,7 @@ free(addr, type)
return;
}
freep = (struct freelist *)addr;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Check for multiple frees. Use a quick check to see if
* it looks free before laboriously searching the freelist.
@@ -302,10 +306,13 @@ free(addr, type)
if (freep->spare0 == WEIRD_ADDR) {
fp = (struct freelist *)kbp->kb_next;
while (fp) {
- if (fp->spare0 != WEIRD_ADDR)
- panic("free: free item %p modified", fp);
- else if (addr == (caddr_t)fp)
- panic("free: multiple freed item %p", addr);
+ if (fp->spare0 != WEIRD_ADDR) {
+ printf("trashed free item %p\n", fp);
+ panic("free: free item modified");
+ } else if (addr == (caddr_t)fp) {
+ printf("multiple freed item %p\n", addr);
+ panic("free: multiple free");
+ }
fp = (struct freelist *)fp->next;
}
}
@@ -320,7 +327,7 @@ free(addr, type)
for (lp = (long *)addr; lp < end; lp++)
*lp = WEIRD_ADDR;
freep->type = type;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
kup->ku_freecnt++;
if (kup->ku_freecnt >= kbp->kb_elmpercl)
if (kup->ku_freecnt > kbp->kb_elmpercl)
@@ -425,18 +432,16 @@ kmeminit(dummy)
}
}
-void
-malloc_init(data)
- void *data;
+static void
+malloc_init(type)
+ struct malloc_type *type;
{
- struct malloc_type *type = (struct malloc_type *)data;
+ int npg;
+ int mem_size;
if (type->ks_magic != M_MAGIC)
panic("malloc type lacks magic");
- if (type->ks_next)
- return;
-
if (cnt.v_page_count == 0)
panic("malloc_init not allowed before vm init");
@@ -448,28 +453,3 @@ malloc_init(data)
type->ks_next = kmemstatistics;
kmemstatistics = type;
}
-
-void
-malloc_uninit(data)
- void *data;
-{
- struct malloc_type *type = (struct malloc_type *)data;
- struct malloc_type *t;
-
- if (type->ks_magic != M_MAGIC)
- panic("malloc type lacks magic");
-
- if (cnt.v_page_count == 0)
- panic("malloc_uninit not allowed before vm init");
-
- if (type == kmemstatistics)
- kmemstatistics = type->ks_next;
- else {
- for (t = kmemstatistics; t->ks_next != NULL; t = t->ks_next) {
- if (t->ks_next == type) {
- t->ks_next = type->ks_next;
- break;
- }
- }
- }
-}
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c
index afe9f2e2de78..5555df3c663c 100644
--- a/sys/kern/kern_module.c
+++ b/sys/kern/kern_module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_module.c,v 1.13 1999/01/09 14:59:50 dfr Exp $
+ * $Id: kern_module.c,v 1.10 1998/10/10 00:03:07 peter Exp $
*/
#include <sys/param.h>
@@ -48,7 +48,6 @@ struct module {
char *name; /* module name */
modeventhand_t handler; /* event handler */
void *arg; /* argument for handler */
- modspecific_t data; /* module specific data */
};
#define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
@@ -84,7 +83,7 @@ module_register_init(void *arg)
error = module_register(data->name, data->evhand, data->priv, data->_file);
if (error)
- printf("module_register_init: module_register(%s, %lx, %p) error %d\n",
+ printf("module_register_init: module_register(%s, %lx, %p) returned %d",
data->name, (u_long)(uintfptr_t)data->evhand, data->priv, error);
}
@@ -108,7 +107,6 @@ module_register(const char* name, modeventhand_t handler, void* arg, void *file)
strcpy(newmod->name, name);
newmod->handler = handler;
newmod->arg = arg;
- bzero(&newmod->data, sizeof(newmod->data));
TAILQ_INSERT_TAIL(&modules, newmod, link);
if (container == NULL)
@@ -198,12 +196,6 @@ module_getfnext(module_t mod)
return TAILQ_NEXT(mod, flink);
}
-void
-module_setspecific(module_t mod, modspecific_t *datap)
-{
- mod->data = *datap;
-}
-
/*
* Syscalls.
*/
@@ -251,13 +243,6 @@ modfnext(struct proc* p, struct modfnext_args* uap)
return 0;
}
-struct module_stat_v1 {
- int version; /* set to sizeof(struct module_stat) */
- char name[MAXMODNAME];
- int refs;
- int id;
-};
-
int
modstat(struct proc* p, struct modstat_args* uap)
{
@@ -278,8 +263,7 @@ modstat(struct proc* p, struct modstat_args* uap)
*/
if (error = copyin(&stat->version, &version, sizeof(version)))
goto out;
- if (version != sizeof(struct module_stat_v1)
- && version != sizeof(struct module_stat)) {
+ if (version != sizeof(struct module_stat)) {
error = EINVAL;
goto out;
}
@@ -295,14 +279,6 @@ modstat(struct proc* p, struct modstat_args* uap)
if (error = copyout(&mod->id, &stat->id, sizeof(int)))
goto out;
- /*
- * >v1 stat includes module data.
- */
- if (version == sizeof(struct module_stat)) {
- if (error = copyout(&mod->data, &stat->data, sizeof(mod->data)))
- goto out;
- }
-
p->p_retval[0] = 0;
out:
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 441d95fc5086..17bd5b2c4fa6 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: kern_physio.c,v 1.28 1998/08/19 10:50:32 sos Exp $
+ * $Id: kern_physio.c,v 1.27 1998/07/04 22:30:21 julian Exp $
*/
#include <sys/param.h>
@@ -169,6 +169,7 @@ minphys(bp)
{
u_int maxphys = DFLTPHYS;
struct cdevsw *bdsw;
+ int offset;
bdsw = cdevsw[major(bp->b_dev)];
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 0c6feac328a0..e229a5d4cd4e 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_proc.c 8.7 (Berkeley) 2/14/95
- * $Id: kern_proc.c,v 1.42 1999/01/10 01:58:24 eivind Exp $
+ * $Id: kern_proc.c,v 1.36 1998/02/20 13:52:14 bde Exp $
*/
#include <sys/param.h>
@@ -40,7 +40,6 @@
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/malloc.h>
-#include <sys/filedesc.h>
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <vm/vm.h>
@@ -195,19 +194,22 @@ enterpgrp(p, pgid, mksess)
{
register struct pgrp *pgrp = pgfind(pgid);
- KASSERT(pgrp == NULL || !mksess,
- ("enterpgrp: setsid into non-empty pgrp"));
- KASSERT(!SESS_LEADER(p),
- ("enterpgrp: session leader attempted setpgrp"));
-
+#ifdef DIAGNOSTIC
+ if (pgrp != NULL && mksess) /* firewalls */
+ panic("enterpgrp: setsid into non-empty pgrp");
+ if (SESS_LEADER(p))
+ panic("enterpgrp: session leader attempted setpgrp");
+#endif
if (pgrp == NULL) {
pid_t savepid = p->p_pid;
struct proc *np;
/*
* new process group
*/
- KASSERT(p->p_pid == pgid,
- ("enterpgrp: new pgrp and pid != pgid"));
+#ifdef DIAGNOSTIC
+ if (p->p_pid != pgid)
+ panic("enterpgrp: new pgrp and pid != pgid");
+#endif
MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
M_WAITOK);
if ((np = pfind(savepid)) == NULL || np != p)
@@ -221,7 +223,6 @@ enterpgrp(p, pgid, mksess)
MALLOC(sess, struct session *, sizeof(struct session),
M_SESSION, M_WAITOK);
sess->s_leader = p;
- sess->s_sid = p->p_pid;
sess->s_count = 1;
sess->s_ttyvp = NULL;
sess->s_ttyp = NULL;
@@ -229,8 +230,10 @@ enterpgrp(p, pgid, mksess)
sizeof(sess->s_login));
p->p_flag &= ~P_CONTROLT;
pgrp->pg_session = sess;
- KASSERT(p == curproc,
- ("enterpgrp: mksession and p != curproc"));
+#ifdef DIAGNOSTIC
+ if (p != curproc)
+ panic("enterpgrp: mksession and p != curproc");
+#endif
} else {
pgrp->pg_session = p->p_session;
pgrp->pg_session->s_count++;
@@ -239,7 +242,6 @@ enterpgrp(p, pgid, mksess)
LIST_INIT(&pgrp->pg_members);
LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash);
pgrp->pg_jobc = 0;
- SLIST_INIT(&pgrp->pg_sigiolst);
} else if (pgrp == p->p_pgrp)
return (0);
@@ -282,12 +284,6 @@ pgdelete(pgrp)
register struct pgrp *pgrp;
{
- /*
- * Reset any sigio structures pointing to us as a result of
- * F_SETOWN with our pgid.
- */
- funsetownlst(&pgrp->pg_sigiolst);
-
if (pgrp->pg_session->s_ttyp != NULL &&
pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
pgrp->pg_session->s_ttyp->t_pgrp = NULL;
@@ -415,11 +411,6 @@ fill_eproc(p, ep)
if (p->p_ucred)
ep->e_ucred = *p->p_ucred;
}
-#ifdef COMPAT_LINUX_THREADS
- if (p->p_procsig){
- ep->e_procsig = *p->p_procsig;
- }
-#endif
if (p->p_stat != SIDL && p->p_stat != SZOMB && p->p_vmspace != NULL) {
register struct vmspace *vm = p->p_vmspace;
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index e5e1a3eacb07..24abb73f0ba6 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_prot.c 8.6 (Berkeley) 1/21/94
- * $Id: kern_prot.c,v 1.42 1998/11/10 09:16:29 peter Exp $
+ * $Id: kern_prot.c,v 1.39 1997/12/20 03:05:46 sef Exp $
*/
/*
@@ -49,7 +49,6 @@
#include <sys/acct.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/unistd.h>
@@ -122,16 +121,13 @@ getpgid(p, uap)
struct proc *p;
struct getpgid_args *uap;
{
- struct proc *pt;
-
- pt = p;
if (uap->pid == 0)
goto found;
- if ((pt = pfind(uap->pid)) == 0)
+ if ((p == pfind(uap->pid)) == 0)
return ESRCH;
found:
- p->p_retval[0] = pt->p_pgrp->pg_id;
+ p->p_retval[0] = p->p_pgrp->pg_id;
return 0;
}
@@ -149,16 +145,13 @@ getsid(p, uap)
struct proc *p;
struct getsid_args *uap;
{
- struct proc *pt;
-
- pt = p;
if (uap->pid == 0)
goto found;
- if ((pt == pfind(uap->pid)) == 0)
+ if ((p == pfind(uap->pid)) == 0)
return ESRCH;
found:
- p->p_retval[0] = pt->p_session->s_sid;
+ p->p_retval[0] = p->p_pgrp->pg_session->s_leader->p_pid;
return 0;
}
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 4d6db416a02d..ff6997ce43d2 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_shutdown.c,v 1.43 1998/12/04 22:54:51 archie Exp $
+ * $Id: kern_shutdown.c,v 1.39 1998/09/15 08:49:52 gibbs Exp $
*/
#include "opt_ddb.h"
@@ -49,7 +49,6 @@
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/proc.h>
-#include <sys/vnode.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/mount.h>
@@ -80,9 +79,9 @@
#ifdef DDB
#ifdef DDB_UNATTENDED
-int debugger_on_panic = 0;
+static int debugger_on_panic = 0;
#else
-int debugger_on_panic = 1;
+static int debugger_on_panic = 1;
#endif
SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
&debugger_on_panic, 0, "");
@@ -112,7 +111,6 @@ typedef struct shutdown_list_element {
LIST_ENTRY(shutdown_list_element) links;
bootlist_fn function;
void *arg;
- int priority;
} *sle_p;
/*
@@ -225,21 +223,6 @@ boot(howto)
sync(&proc0, NULL);
DELAY(50000 * iter);
}
- /*
- * Count only busy local buffers to prevent forcing
- * a fsck if we're just a client of a wedged NFS server
- */
- nbusy = 0;
- for (bp = &buf[nbuf]; --bp >= buf; ) {
- if (((bp->b_flags & (B_BUSY | B_INVAL)) == B_BUSY)
- ||((bp->b_flags & (B_DELWRI | B_INVAL))== B_DELWRI))
- if(bp->b_dev == NODEV)
- CIRCLEQ_REMOVE(&mountlist, bp->b_vp->v_mount, mnt_list);
- else
- nbusy++;
-
-
- }
if (nbusy) {
/*
* Failed to sync all blocks. Indicate this and don't
@@ -292,6 +275,7 @@ boot(howto)
(*ep->function)(howto, ep->arg);
if (howto & RB_HALT) {
+ cpu_power_down();
printf("\n");
printf("The operating system has halted.\n");
printf("Please press any key to reboot.\n\n");
@@ -427,7 +411,7 @@ panic(const char *fmt, ...)
panicstr = fmt;
va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf), fmt, ap);
+ (void)vsprintf(buf, fmt, ap);
if (panicstr == fmt)
panicstr = buf;
va_end(ap);
@@ -447,7 +431,7 @@ panic(const char *fmt, ...)
}
/*
- * Three routines to handle adding/deleting items on the
+ * Two routines to handle adding/deleting items on the
* shutdown callout lists
*
* at_shutdown():
@@ -458,19 +442,7 @@ panic(const char *fmt, ...)
int
at_shutdown(bootlist_fn function, void *arg, int queue)
{
- return(at_shutdown_pri(function, arg, queue, SHUTDOWN_PRI_DEFAULT));
-}
-
-/*
- * at_shutdown_pri():
- * Take the arguments given and put them onto the shutdown callout list
- * with the given execution priority.
- * returns 0 on success.
- */
-int
-at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri)
-{
- sle_p ep, ip;
+ sle_p ep;
if (queue < SHUTDOWN_PRE_SYNC
|| queue > SHUTDOWN_FINAL) {
@@ -485,23 +457,7 @@ at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri)
return (ENOMEM);
ep->function = function;
ep->arg = arg;
- ep->priority = pri;
-
- /* Sort into list of items on this queue */
- ip = LIST_FIRST(&shutdown_lists[queue]);
- if (ip == NULL) {
- LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links);
- } else {
- for (; LIST_NEXT(ip, links) != NULL; ip = LIST_NEXT(ip, links)) {
- if (ep->priority < ip->priority) {
- LIST_INSERT_BEFORE(ip, ep, links);
- ep = NULL;
- break;
- }
- }
- if (ep != NULL)
- LIST_INSERT_AFTER(ip, ep, links);
- }
+ LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links);
return (0);
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index bf89d8a745de..f164ed6cf14e 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sig.c 8.7 (Berkeley) 4/18/94
- * $Id: kern_sig.c,v 1.52 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_sig.c,v 1.46 1998/09/14 05:36:49 jdp Exp $
*/
#include "opt_compat.h"
@@ -86,16 +86,6 @@ SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0,
(pc)->pc_ucred->cr_uid == (q)->p_ucred->cr_uid || \
((signum) == SIGCONT && (q)->p_session == (p)->p_session))
-/*
- * Policy -- Can real uid ruid with ucred uc send a signal to process q?
- */
-#define CANSIGIO(ruid, uc, q) \
- ((uc)->cr_uid == 0 || \
- (ruid) == (q)->p_cred->p_ruid || \
- (uc)->cr_uid == (q)->p_cred->p_ruid || \
- (ruid) == (q)->p_ucred->cr_uid || \
- (uc)->cr_uid == (q)->p_ucred->cr_uid)
-
int sugid_coredump;
SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "");
@@ -135,17 +125,9 @@ sigaction(p, uap)
sa->sa_flags |= SA_RESETHAND;
if ((ps->ps_signodefer & bit) != 0)
sa->sa_flags |= SA_NODEFER;
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP)
-#endif /* COMPAT_LINUX_THREADS */
sa->sa_flags |= SA_NOCLDSTOP;
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDWAIT)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDWAIT)
-#endif /* COMPAT_LINUX_THREADS */
sa->sa_flags |= SA_NOCLDWAIT;
if ((error = copyout((caddr_t)sa, (caddr_t)uap->osa,
sizeof (vec))))
@@ -203,15 +185,9 @@ setsigvec(p, signum, sa)
#endif
if (signum == SIGCHLD) {
if (sa->sa_flags & SA_NOCLDSTOP)
-#ifndef COMPAT_LINUX_THREADS
p->p_flag |= P_NOCLDSTOP;
else
p->p_flag &= ~P_NOCLDSTOP;
-#else
- p->p_procsig->ps_flag |= P_NOCLDSTOP;
- else
- p->p_procsig->ps_flag &= ~P_NOCLDSTOP;
-#endif /* COMPAT_LINUX_THREADS */
if (sa->sa_flags & SA_NOCLDWAIT) {
/*
* Paranoia: since SA_NOCLDWAIT is implemented by
@@ -220,21 +196,11 @@ setsigvec(p, signum, sa)
* forbidden to set SA_NOCLDWAIT.
*/
if (p->p_pid == 1)
-#ifndef COMPAT_LINUX_THREADS
p->p_flag &= ~P_NOCLDWAIT;
else
p->p_flag |= P_NOCLDWAIT;
-#else
- p->p_procsig->ps_flag &= ~P_NOCLDWAIT;
- else
- p->p_procsig->ps_flag |= P_NOCLDWAIT;
-#endif /* COMPAT_LINUX_THREADS */
} else
-#ifndef COMPAT_LINUX_THREADS
p->p_flag &= ~P_NOCLDWAIT;
-#else
- p->p_procsig->ps_flag &= ~P_NOCLDWAIT;
-#endif /* COMPAT_LINUX_THREADS */
}
/*
* Set bit in p_sigignore for signals that are set to SIG_IGN,
@@ -409,11 +375,7 @@ osigvec(p, uap)
if ((ps->ps_signodefer & bit) != 0)
sv->sv_flags |= SV_NODEFER;
#ifndef COMPAT_SUNOS
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP)
-#endif /* COMPAT_LINUX_THREADS */
sv->sv_flags |= SV_NOCLDSTOP;
#endif
if ((error = copyout((caddr_t)sv, (caddr_t)uap->osv,
@@ -498,12 +460,8 @@ sigsuspend(p, uap)
* save it here and mark the sigacts structure
* to indicate this.
*/
-#ifndef COMPAT_LINUX_THREADS
ps->ps_oldmask = p->p_sigmask;
ps->ps_flags |= SAS_OLDMASK;
-#else
- p->p_oldsigmask = p->p_sigmask;
-#endif /* COMPAT_LINUX_THREADS */
p->p_sigmask = uap->mask &~ sigcantmask;
while (tsleep((caddr_t) ps, PPAUSE|PCATCH, "pause", 0) == 0)
/* void */;
@@ -762,13 +720,8 @@ trapsignal(p, signum, code)
ps->ps_sigact[signum] = SIG_DFL;
}
} else {
-#ifndef COMPAT_LINUX_THREADS
ps->ps_code = code; /* XXX for core dump/debugger */
ps->ps_sig = signum; /* XXX to verify code */
-#else
- p->p_code = code; /* XXX for core dump/debugger */
- p->p_sig = signum; /* XXX to verify code */
-#endif /* COMPAT_LINUX_THREADS */
psignal(p, signum);
}
}
@@ -817,11 +770,7 @@ psignal(p, signum)
* and if it is set to SIG_IGN,
* action will be SIG_DFL here.)
*/
-#ifndef COMPAT_LINUX_THREADS
if (p->p_sigignore & mask)
-#else
- if ((p->p_sigignore & mask) || (p->p_flag & P_WEXIT))
-#endif /* COMPAT_LINUX_THREADS */
return;
if (p->p_sigmask & mask)
action = SIG_HOLD;
@@ -903,11 +852,7 @@ psignal(p, signum)
goto out;
p->p_siglist &= ~mask;
p->p_xstat = signum;
-#ifndef COMPAT_LINUX_THREADS
if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0)
-#else
- if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0)
-#endif /* COMPAT_LINUX_THREADS */
psignal(p->p_pptr, SIGCHLD);
stop(p);
goto out;
@@ -1114,11 +1059,7 @@ issignal(p)
break; /* == ignore */
p->p_xstat = signum;
stop(p);
-#ifndef COMPAT_LINUX_THREADS
if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0)
-#else
- if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0)
-#endif /* COMPAT_LINUX_THREADS */
psignal(p->p_pptr, SIGCHLD);
mi_switch();
break;
@@ -1183,21 +1124,18 @@ postsig(signum)
register sig_t action;
int code, mask, returnmask;
- KASSERT(signum != 0, ("postsig"));
-
+#ifdef DIAGNOSTIC
+ if (signum == 0)
+ panic("postsig");
+#endif
mask = sigmask(signum);
p->p_siglist &= ~mask;
action = ps->ps_sigact[signum];
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG))
ktrpsig(p->p_tracep,
-#ifndef COMPAT_LINUX_THREADS
signum, action, ps->ps_flags & SAS_OLDMASK ?
ps->ps_oldmask : p->p_sigmask, 0);
-#else
- signum, action, p->p_oldsigmask ?
- p->p_oldsigmask : p->p_sigmask, 0);
-#endif /* COMPAT_LINUX_THREADS */
#endif
STOPEVENT(p, S_SIG, signum);
@@ -1212,8 +1150,10 @@ postsig(signum)
/*
* If we get here, the signal must be caught.
*/
- KASSERT(action != SIG_IGN && (p->p_sigmask & mask) == 0,
- ("postsig action"));
+#ifdef DIAGNOSTIC
+ if (action == SIG_IGN || (p->p_sigmask & mask))
+ panic("postsig action");
+#endif
/*
* Set the new mask value and also defer further
* occurences of this signal.
@@ -1224,15 +1164,9 @@ postsig(signum)
* restored after the signal processing is completed.
*/
(void) splhigh();
-#ifndef COMPAT_LINUX_THREADS
if (ps->ps_flags & SAS_OLDMASK) {
returnmask = ps->ps_oldmask;
ps->ps_flags &= ~SAS_OLDMASK;
-#else
- if (p->p_oldsigmask) {
- returnmask = p->p_oldsigmask;
- p->p_oldsigmask = 0;
-#endif /* COMPAT_LINUX_THREADS */
} else
returnmask = p->p_sigmask;
p->p_sigmask |= ps->ps_catchmask[signum] |
@@ -1248,22 +1182,12 @@ postsig(signum)
}
(void) spl0();
p->p_stats->p_ru.ru_nsignals++;
-#ifndef COMPAT_LINUX_THREADS
if (ps->ps_sig != signum) {
-#else
- if (p->p_sig != signum) {
-#endif /* COMPAT_LINUX_THREADS */
code = 0;
} else {
-#ifndef COMPAT_LINUX_THREADS
code = ps->ps_code;
ps->ps_code = 0;
ps->ps_sig = 0;
-#else
- code = p->p_code;
- p->p_code = 0;
- p->p_sig = 0;
-#endif /* COMPAT_LINUX_THREADS */
}
(*p->p_sysent->sv_sendsig)(action, signum, returnmask, code);
}
@@ -1298,17 +1222,17 @@ sigexit(p, signum)
p->p_acflag |= AXSIG;
if (sigprop[signum] & SA_CORE) {
-#ifndef COMPAT_LINUX_THREADS
p->p_sigacts->ps_sig = signum;
-#else
- p->p_sig = signum;
-#endif /* COMPAT_LINUX_THREADS */
/*
* Log signals which would cause core dumps
* (Log as LOG_INFO to appease those who don't want
* these messages.)
* XXX : Todo, as well as euid, write out ruid too
*/
+
+ /* Use the correct function to dump core, as stored in
+ the sysentvec struct. This way we can do ELF and a.out
+ dumps without breaking a sweat. */
if (p->p_sysent->sv_coredump != NULL &&
(*p->p_sysent->sv_coredump)(p) == 0)
signum |= WCOREFLAG;
@@ -1349,8 +1273,6 @@ const char *name; int uid; int pid; {
char *format = corefilename;
temp = malloc(MAXPATHLEN + 3, M_TEMP, M_NOWAIT);
- if (temp == NULL)
- return NULL;
bzero(temp, MAXPATHLEN+3);
for (i = 0, n = 0; i < MAXPATHLEN && format[i]; i++) {
int l;
@@ -1426,30 +1348,3 @@ nosys(p, args)
psignal(p, SIGSYS);
return (EINVAL);
}
-
-/*
- * Send a signal to a SIGIO or SIGURG to a process or process group using
- * stored credentials rather than those of the current process.
- */
-void
-pgsigio(sigio, signum, checkctty)
- struct sigio *sigio;
- int signum, checkctty;
-{
- if (sigio == NULL)
- return;
-
- if (sigio->sio_pgid > 0) {
- if (CANSIGIO(sigio->sio_ruid, sigio->sio_ucred,
- sigio->sio_proc))
- psignal(sigio->sio_proc, signum);
- } else if (sigio->sio_pgid < 0) {
- struct proc *p;
-
- for (p = sigio->sio_pgrp->pg_members.lh_first; p != NULL;
- p = p->p_pglist.le_next)
- if (CANSIGIO(sigio->sio_ruid, sigio->sio_ucred, p) &&
- (checkctty == 0 || (p->p_flag & P_CONTROLT)))
- psignal(p, signum);
- }
-}
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index a96d554b6517..548cd20e1c8b 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_subr.c,v 1.23 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_subr.c,v 1.21 1998/07/15 02:32:10 bde Exp $
*/
#include <sys/param.h>
@@ -61,11 +61,12 @@ uiomove(cp, n, uio)
u_int cnt;
int error;
- KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
- ("uiomove: mode"));
- KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc,
- ("uiomove proc"));
-
+#ifdef DIAGNOSTIC
+ if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
+ panic("uiomove: mode");
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ panic("uiomove proc");
+#endif
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
@@ -119,11 +120,12 @@ uiomoveco(cp, n, uio, obj)
u_int cnt;
int error;
- KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
- ("uiomoveco: mode"));
- KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc,
- ("uiomoveco proc"));
-
+#ifdef DIAGNOSTIC
+ if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
+ panic("uiomove: mode");
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ panic("uiomove proc");
+#endif
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index f8baf85461ca..2d5105514a20 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
- * $Id: kern_synch.c,v 1.71 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_synch.c,v 1.61 1998/07/15 02:32:10 bde Exp $
*/
#include "opt_ktrace.h"
@@ -138,9 +138,7 @@ static void
roundrobin(arg)
void *arg;
{
-#ifndef SMP
struct proc *p = curproc; /* XXX */
-#endif
#ifdef SMP
need_resched();
@@ -225,8 +223,8 @@ roundrobin(arg)
static fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */
SYSCTL_INT(_kern, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0, "");
-/* kernel uses `FSCALE', userland (SHOULD) use kern.fscale */
-static int fscale __unused = FSCALE;
+/* kernel uses `FSCALE', user uses `fscale' */
+static int fscale = FSCALE;
SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, 0, FSCALE, "");
/*
@@ -253,10 +251,9 @@ schedcpu(arg)
{
register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]);
register struct proc *p;
- register int realstathz, s;
+ register int s;
register unsigned int newcpu;
- realstathz = stathz ? stathz : hz;
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
/*
* Increment time in/out of memory and sleep time
@@ -278,13 +275,13 @@ schedcpu(arg)
* p_pctcpu is only for ps.
*/
#if (FSHIFT >= CCPU_SHIFT)
- p->p_pctcpu += (realstathz == 100)?
+ p->p_pctcpu += (hz == 100)?
((fixpt_t) p->p_cpticks) << (FSHIFT - CCPU_SHIFT):
100 * (((fixpt_t) p->p_cpticks)
- << (FSHIFT - CCPU_SHIFT)) / realstathz;
+ << (FSHIFT - CCPU_SHIFT)) / hz;
#else
p->p_pctcpu += ((FSCALE - ccpu) *
- (p->p_cpticks * FSCALE / realstathz)) >> FSHIFT;
+ (p->p_cpticks * FSCALE / hz)) >> FSHIFT;
#endif
p->p_cpticks = 0;
newcpu = (u_int) decay_cpu(loadfac, p->p_estcpu) + p->p_nice;
@@ -401,15 +398,15 @@ tsleep(ident, priority, wmesg, timo)
splx(s);
return (0);
}
- KASSERT(p != NULL, ("tsleep1"));
- KASSERT(ident != NULL && p->p_stat == SRUN, ("tsleep"));
- /*
- * Process may be sitting on a slpque if asleep() was called, remove
- * it before re-adding.
- */
- if (p->p_wchan != NULL)
- unsleep(p);
-
+#ifdef DIAGNOSTIC
+ if(p == NULL)
+ panic("tsleep1");
+ if (ident == NULL || p->p_stat != SRUN)
+ panic("tsleep");
+ /* XXX This is not exhaustive, just the most common case */
+ if ((p->p_procq.tqe_prev != NULL) && (*p->p_procq.tqe_prev == p))
+ panic("sleeping process already on another queue");
+#endif
p->p_wchan = ident;
p->p_wmesg = wmesg;
p->p_slptime = 0;
@@ -475,170 +472,7 @@ resume:
}
/*
- * asleep() - async sleep call. Place process on wait queue and return
- * immediately without blocking. The process stays runnable until await()
- * is called. If ident is NULL, remove process from wait queue if it is still
- * on one.
- *
- * Only the most recent sleep condition is effective when making successive
- * calls to asleep() or when calling tsleep().
- *
- * The timeout, if any, is not initiated until await() is called. The sleep
- * priority, signal, and timeout is specified in the asleep() call but may be
- * overriden in the await() call.
- *
- * <<<<<<<< EXPERIMENTAL, UNTESTED >>>>>>>>>>
- */
-
-int
-asleep(void *ident, int priority, const char *wmesg, int timo)
-{
- struct proc *p = curproc;
- int s;
-
- /*
- * splhigh() while manipulating sleep structures and slpque.
- *
- * Remove preexisting wait condition (if any) and place process
- * on appropriate slpque, but do not put process to sleep.
- */
-
- s = splhigh();
-
- if (p->p_wchan != NULL)
- unsleep(p);
-
- if (ident) {
- p->p_wchan = ident;
- p->p_wmesg = wmesg;
- p->p_slptime = 0;
- p->p_asleep.as_priority = priority;
- p->p_asleep.as_timo = timo;
- TAILQ_INSERT_TAIL(&slpque[LOOKUP(ident)], p, p_procq);
- }
-
- splx(s);
-
- return(0);
-}
-
-/*
- * await() - wait for async condition to occur. The process blocks until
- * wakeup() is called on the most recent asleep() address. If wakeup is called
- * priority to await(), await() winds up being a NOP.
- *
- * If await() is called more then once (without an intervening asleep() call),
- * await() is still effectively a NOP but it calls mi_switch() to give other
- * processes some cpu before returning. The process is left runnable.
- *
- * <<<<<<<< EXPERIMENTAL, UNTESTED >>>>>>>>>>
- */
-
-int
-await(int priority, int timo)
-{
- struct proc *p = curproc;
- int s;
-
- s = splhigh();
-
- if (p->p_wchan != NULL) {
- struct callout_handle thandle;
- int sig;
- int catch;
-
- /*
- * The call to await() can override defaults specified in
- * the original asleep().
- */
- if (priority < 0)
- priority = p->p_asleep.as_priority;
- if (timo < 0)
- timo = p->p_asleep.as_timo;
-
- /*
- * Install timeout
- */
-
- if (timo)
- thandle = timeout(endtsleep, (void *)p, timo);
-
- sig = 0;
- catch = priority & PCATCH;
-
- if (catch) {
- p->p_flag |= P_SINTR;
- if ((sig = CURSIG(p))) {
- if (p->p_wchan)
- unsleep(p);
- p->p_stat = SRUN;
- goto resume;
- }
- if (p->p_wchan == NULL) {
- catch = 0;
- goto resume;
- }
- }
- p->p_stat = SSLEEP;
- p->p_stats->p_ru.ru_nvcsw++;
- mi_switch();
-resume:
- curpriority = p->p_usrpri;
-
- splx(s);
- p->p_flag &= ~P_SINTR;
- if (p->p_flag & P_TIMEOUT) {
- p->p_flag &= ~P_TIMEOUT;
- if (sig == 0) {
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- return (EWOULDBLOCK);
- }
- } else if (timo)
- untimeout(endtsleep, (void *)p, thandle);
- if (catch && (sig != 0 || (sig = CURSIG(p)))) {
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- if (p->p_sigacts->ps_sigintr & sigmask(sig))
- return (EINTR);
- return (ERESTART);
- }
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- } else {
- /*
- * If as_priority is 0, await() has been called without an
- * intervening asleep(). We are still effectively a NOP,
- * but we call mi_switch() for safety.
- */
-
- if (p->p_asleep.as_priority == 0) {
- p->p_stats->p_ru.ru_nvcsw++;
- mi_switch();
- }
- splx(s);
- }
-
- /*
- * clear p_asleep.as_priority as an indication that await() has been
- * called. If await() is called again without an intervening asleep(),
- * await() is still effectively a NOP but the above mi_switch() code
- * is triggered as a safety.
- */
- p->p_asleep.as_priority = 0;
-
- return (0);
-}
-
-/*
- * Implement timeout for tsleep or asleep()/await()
- *
+ * Implement timeout for tsleep.
* If process hasn't been awakened (wchan non-zero),
* set timeout flag and undo the sleep. If proc
* is stopped, just unsleep so it will remain stopped.
@@ -694,6 +528,10 @@ wakeup(ident)
qp = &slpque[LOOKUP(ident)];
restart:
for (p = qp->tqh_first; p != NULL; p = p->p_procq.tqe_next) {
+#ifdef DIAGNOSTIC
+ if (p->p_stat != SSLEEP && p->p_stat != SSTOP)
+ panic("wakeup");
+#endif
if (p->p_wchan == ident) {
TAILQ_REMOVE(qp, p, p_procq);
p->p_wchan = 0;
@@ -735,6 +573,10 @@ wakeup_one(ident)
qp = &slpque[LOOKUP(ident)];
for (p = qp->tqh_first; p != NULL; p = p->p_procq.tqe_next) {
+#ifdef DIAGNOSTIC
+ if (p->p_stat != SSLEEP && p->p_stat != SSTOP)
+ panic("wakeup_one");
+#endif
if (p->p_wchan == ident) {
TAILQ_REMOVE(qp, p, p_procq);
p->p_wchan = 0;
@@ -805,8 +647,7 @@ mi_switch()
* Check if the process exceeds its cpu resource allocation.
* If over max, kill it.
*/
- if (p->p_stat != SZOMB && p->p_limit->p_cpulimit != RLIM_INFINITY &&
- p->p_runtime > p->p_limit->p_cpulimit) {
+ if (p->p_stat != SZOMB && p->p_runtime > p->p_limit->p_cpulimit) {
rlim = &p->p_rlimit[RLIMIT_CPU];
if (p->p_runtime / (rlim_t)1000000 >= rlim->rlim_max) {
killproc(p, "exceeded maximum CPU limit");
diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c
deleted file mode 100644
index e1192a918c5b..000000000000
--- a/sys/kern/kern_syscalls.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * Copyright (c) 1999 Assar Westerlund
- * 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.
- *
- * $Id: kern_syscalls.c,v 1.2 1999/01/09 14:59:50 dfr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/syscall.h>
-#include <sys/module.h>
-#include <sys/linker.h>
-#include <sys/proc.h>
-
-/*
- * Acts like "nosys" but can be identified in sysent for dynamic call
- * number assignment for a limited number of calls.
- *
- * Place holder for system call slots reserved for loadable modules.
- */
-int
-lkmnosys(struct proc *p, struct nosys_args *args)
-{
- return(nosys(p, args));
-}
-
-int
-syscall_register(int *offset, struct sysent *new_sysent,
- struct sysent *old_sysent)
-{
- if (*offset == NO_SYSCALL) {
- int i;
-
- for (i = 1; i < SYS_MAXSYSCALL; ++i)
- if (sysent[i].sy_call == (sy_call_t *)lkmnosys)
- break;
- if (i == SYS_MAXSYSCALL)
- return ENFILE;
- *offset = i;
- } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL)
- return EINVAL;
- else if (sysent[*offset].sy_call != (sy_call_t *)lkmnosys)
- return EEXIST;
-
- *old_sysent = sysent[*offset];
- sysent[*offset] = *new_sysent;
- return 0;
-}
-
-int
-syscall_deregister(int *offset, struct sysent *old_sysent)
-{
- if (*offset)
- sysent[*offset] = *old_sysent;
- return 0;
-}
-
-int
-syscall_module_handler(struct module *mod, int what, void *arg)
-{
- struct syscall_module_data *data = (struct syscall_module_data*)arg;
- modspecific_t ms;
- int error;
-
- switch (what) {
- case MOD_LOAD :
- error = syscall_register(data->offset, data->new_sysent,
- &data->old_sysent);
- if (error)
- return error;
- ms.intval = *data->offset;
- module_setspecific(mod, &ms);
- break;
- case MOD_UNLOAD :
- error = syscall_deregister(data->offset, &data->old_sysent);
- if (error)
- return error;
- break;
- }
- if (data->chainevh)
- return data->chainevh(mod, what, data->chainarg);
- else
- return 0;
-}
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index fbf2f6a99389..c3e221fc0fd9 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
- * $Id: kern_sysctl.c,v 1.81 1998/12/27 18:03:29 dfr Exp $
+ * $Id: kern_sysctl.c,v 1.77 1998/09/05 17:13:27 bde Exp $
*/
#include "opt_compat.h"
@@ -225,7 +225,7 @@ sysctl_sysctl_name SYSCTL_HANDLER_ARGS
while (namelen) {
if (!lsp) {
- snprintf(buf,sizeof(buf),"%d",*name);
+ sprintf(buf,"%d",*name);
if (req->oldidx)
error = SYSCTL_OUT(req, ".", 1);
if (!error)
@@ -497,7 +497,7 @@ SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD, sysctl_sysctl_oidfmt, "");
*/
/*
- * Handle an int, signed or unsigned.
+ * Handle an integer, signed or unsigned.
* Two cases:
* a variable: point arg1 at it.
* a constant: pass it in arg2.
@@ -524,7 +524,7 @@ sysctl_handle_int SYSCTL_HANDLER_ARGS
}
/*
- * Handle a long, signed or unsigned.
+ * Handle an integer, signed or unsigned.
* Two cases:
* a variable: point arg1 at it.
* a constant: pass it in arg2.
@@ -535,7 +535,10 @@ sysctl_handle_long SYSCTL_HANDLER_ARGS
{
int error = 0;
- error = SYSCTL_OUT(req, arg1, sizeof(long));
+ if (arg1)
+ error = SYSCTL_OUT(req, arg1, sizeof(long));
+ else
+ error = SYSCTL_OUT(req, &arg2, sizeof(long));
if (error || !req->newptr)
return (error);
@@ -548,6 +551,33 @@ sysctl_handle_long SYSCTL_HANDLER_ARGS
}
/*
+ * Handle an integer, signed or unsigned.
+ * Two cases:
+ * a variable: point arg1 at it.
+ * a constant: pass it in arg2.
+ */
+
+int
+sysctl_handle_intptr SYSCTL_HANDLER_ARGS
+{
+ int error = 0;
+
+ if (arg1)
+ error = SYSCTL_OUT(req, arg1, sizeof(intptr_t));
+ else
+ error = SYSCTL_OUT(req, &arg2, sizeof(intptr_t));
+
+ if (error || !req->newptr)
+ return (error);
+
+ if (!arg1)
+ error = EPERM;
+ else
+ error = SYSCTL_IN(req, arg1, sizeof(intptr_t));
+ return (error);
+}
+
+/*
* Handle our generic '\0' terminated 'C' string.
* Two cases:
* a variable string: point arg1 at it, arg2 is max length.
@@ -774,8 +804,7 @@ sysctl_root SYSCTL_HANDLER_ARGS
return ENOENT;
found:
/* If writing isn't allowed */
- if (req->newptr && (!((*oidpp)->oid_kind & CTLFLAG_WR) ||
- (((*oidpp)->oid_kind & CTLFLAG_SECURE) && securelevel > 0)))
+ if (req->newptr && !((*oidpp)->oid_kind & CTLFLAG_WR))
return (EPERM);
/* Most likely only root can write */
diff --git a/sys/kern/kern_threads.c b/sys/kern/kern_threads.c
index 57e8d96eb4f8..1121f09837d1 100644
--- a/sys/kern/kern_threads.c
+++ b/sys/kern/kern_threads.c
@@ -46,7 +46,7 @@
* in Germany will I accept domestic beer. This code may or may not work
* and I certainly make no claims as to its fitness for *any* purpose.
*
- * $Id: kern_threads.c,v 1.9 1998/10/25 17:44:51 phk Exp $
+ * $Id: kern_threads.c,v 1.7 1998/03/30 09:50:18 phk Exp $
*/
#include <sys/param.h>
@@ -71,7 +71,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) {
int sleepstart;
struct timespec ts;
struct timeval atv;
- int error, timo;
+ int error, s, timo;
timo = 0;
if (uap->timeout != 0) {
@@ -86,7 +86,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) {
p->p_wakeup = 0;
return (EINVAL);
}
- TIMESPEC_TO_TIMEVAL(&atv, &ts);
+ TIMESPEC_TO_TIMEVAL(&atv, &ts)
if (itimerfix(&atv)) {
p->p_wakeup = 0;
return (EINVAL);
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 2bd17bb6bdcb..c269355a8a62 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
- * $Id: kern_time.c,v 1.58 1998/06/09 13:10:53 phk Exp $
+ * $Id: kern_time.c,v 1.57 1998/05/17 20:13:01 bde Exp $
*/
#include <sys/param.h>
@@ -79,6 +79,7 @@ settime(tv)
{
struct timeval delta, tv1;
struct timespec ts;
+ struct proc *p;
int s;
s = splclock();
diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c
index 29b588489b68..80e9e1f5ffd0 100644
--- a/sys/kern/link_aout.c
+++ b/sys/kern/link_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_aout.c,v 1.16 1998/11/03 14:25:21 peter Exp $
+ * $Id: link_aout.c,v 1.13 1998/10/09 23:49:28 peter Exp $
*/
#ifndef __alpha__
@@ -55,6 +55,13 @@ static int link_aout_search_symbol(linker_file_t lf, caddr_t value,
static void link_aout_unload_file(linker_file_t);
static void link_aout_unload_module(linker_file_t);
+/*
+ * The file representing the currently running kernel. This contains
+ * the global symbol table.
+ */
+
+static linker_file_t linker_kernel_file;
+
static struct linker_class_ops link_aout_class_ops = {
link_aout_load_module,
};
@@ -119,7 +126,7 @@ link_aout_init(void* arg)
#endif
}
-SYSINIT(link_aout, SI_SUB_KLD, SI_ORDER_THIRD, link_aout_init, 0);
+SYSINIT(link_aout, SI_SUB_KLD, SI_ORDER_SECOND, link_aout_init, 0);
static int
link_aout_load_module(const char* filename, linker_file_t* result)
@@ -301,10 +308,8 @@ load_dependancies(linker_file_t lf)
/*
* All files are dependant on /kernel.
*/
- if (linker_kernel_file) {
- linker_kernel_file->refs++;
- linker_file_add_dependancy(lf, linker_kernel_file);
- }
+ linker_kernel_file->refs++;
+ linker_file_add_dependancy(lf, linker_kernel_file);
off = LD_NEED(af->dynamic);
@@ -556,6 +561,7 @@ link_aout_search_symbol(linker_file_t lf, caddr_t value,
struct nzlist* sp;
struct nzlist* ep;
struct nzlist* best = 0;
+ int i;
for (sp = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic)),
ep = (struct nzlist *) ((caddr_t) sp + LD_STABSZ(af->dynamic));
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index c5e84daf0a3e..26b6213745d9 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_elf.c,v 1.10 1998/11/06 15:16:07 peter Exp $
+ * $Id: link_elf.c,v 1.6 1998/10/15 17:16:24 peter Exp $
*/
#include <sys/param.h>
@@ -58,6 +58,13 @@ static int link_elf_search_symbol(linker_file_t, caddr_t value,
static void link_elf_unload_file(linker_file_t);
static void link_elf_unload_module(linker_file_t);
+/*
+ * The file representing the currently running kernel. This contains
+ * the global symbol table.
+ */
+
+linker_file_t linker_kernel_file;
+
static struct linker_class_ops link_elf_class_ops = {
link_elf_load_module,
};
@@ -393,8 +400,10 @@ link_elf_load_file(const char* filename, linker_file_t* result)
{
struct nameidata nd;
struct proc* p = curproc; /* XXX */
- Elf_Ehdr *hdr;
- caddr_t firstpage;
+ union {
+ Elf_Ehdr hdr;
+ char buf[PAGE_SIZE];
+ } u;
int nbytes, i;
Elf_Phdr *phdr;
Elf_Phdr *phlimit;
@@ -407,6 +416,17 @@ link_elf_load_file(const char* filename, linker_file_t* result)
Elf_Off base_offset;
Elf_Addr base_vaddr;
Elf_Addr base_vlimit;
+ caddr_t base_addr;
+ Elf_Off data_offset;
+ Elf_Addr data_vaddr;
+ Elf_Addr data_vlimit;
+ caddr_t data_addr;
+ Elf_Addr clear_vaddr;
+ caddr_t clear_addr;
+ size_t nclear;
+ Elf_Addr bss_vaddr;
+ Elf_Addr bss_vlimit;
+ caddr_t bss_addr;
int error = 0;
int resid;
elf_file_t ef;
@@ -424,7 +444,6 @@ link_elf_load_file(const char* filename, linker_file_t* result)
pathname = linker_search_path(filename);
if (pathname == NULL)
return ENOENT;
-
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, pathname, p);
error = vn_open(&nd, FREAD, 0);
free(pathname, M_LINKER);
@@ -434,41 +453,35 @@ link_elf_load_file(const char* filename, linker_file_t* result)
/*
* Read the elf header from the file.
*/
- firstpage = malloc(PAGE_SIZE, M_LINKER, M_WAITOK);
- if (firstpage == NULL) {
- error = ENOMEM;
- goto out;
- }
- hdr = (Elf_Ehdr *)firstpage;
- error = vn_rdwr(UIO_READ, nd.ni_vp, firstpage, PAGE_SIZE, 0,
+ error = vn_rdwr(UIO_READ, nd.ni_vp, (void*) &u, sizeof u, 0,
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
- nbytes = PAGE_SIZE - resid;
+ nbytes = sizeof u - resid;
if (error)
goto out;
- if (!IS_ELF(*hdr)) {
+ if (!IS_ELF(u.hdr)) {
error = ENOEXEC;
goto out;
}
- if (hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS
- || hdr->e_ident[EI_DATA] != ELF_TARG_DATA) {
+ if (u.hdr.e_ident[EI_CLASS] != ELF_TARG_CLASS
+ || u.hdr.e_ident[EI_DATA] != ELF_TARG_DATA) {
link_elf_error("Unsupported file layout");
error = ENOEXEC;
goto out;
}
- if (hdr->e_ident[EI_VERSION] != EV_CURRENT
- || hdr->e_version != EV_CURRENT) {
+ if (u.hdr.e_ident[EI_VERSION] != EV_CURRENT
+ || u.hdr.e_version != EV_CURRENT) {
link_elf_error("Unsupported file version");
error = ENOEXEC;
goto out;
}
- if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) {
+ if (u.hdr.e_type != ET_EXEC && u.hdr.e_type != ET_DYN) {
link_elf_error("Unsupported file type");
error = ENOEXEC;
goto out;
}
- if (hdr->e_machine != ELF_TARG_MACH) {
+ if (u.hdr.e_machine != ELF_TARG_MACH) {
link_elf_error("Unsupported machine");
error = ENOEXEC;
goto out;
@@ -479,9 +492,9 @@ link_elf_load_file(const char* filename, linker_file_t* result)
* not strictly required by the ABI specification, but it seems to
* always true in practice. And, it simplifies things considerably.
*/
- if (!((hdr->e_phentsize == sizeof(Elf_Phdr)) &&
- (hdr->e_phoff + hdr->e_phnum*sizeof(Elf_Phdr) <= PAGE_SIZE) &&
- (hdr->e_phoff + hdr->e_phnum*sizeof(Elf_Phdr) <= nbytes)))
+ if (!((u.hdr.e_phentsize == sizeof(Elf_Phdr))
+ || (u.hdr.e_phoff + u.hdr.e_phnum*sizeof(Elf_Phdr) <= PAGE_SIZE)
+ || (u.hdr.e_phoff + u.hdr.e_phnum*sizeof(Elf_Phdr) <= nbytes)))
link_elf_error("Unreadable program headers");
/*
@@ -490,8 +503,8 @@ link_elf_load_file(const char* filename, linker_file_t* result)
* We rely on there being exactly two load segments, text and data,
* in that order.
*/
- phdr = (Elf_Phdr *) (firstpage + hdr->e_phoff);
- phlimit = phdr + hdr->e_phnum;
+ phdr = (Elf_Phdr *) (u.buf + u.hdr.e_phoff);
+ phlimit = phdr + u.hdr.e_phnum;
nsegs = 0;
phdyn = NULL;
phphdr = NULL;
@@ -623,8 +636,8 @@ link_elf_load_file(const char* filename, linker_file_t* result)
goto out;
/* Try and load the symbol table if it's present. (you can strip it!) */
- nbytes = hdr->e_shnum * hdr->e_shentsize;
- if (nbytes == 0 || hdr->e_shoff == 0)
+ nbytes = u.hdr.e_shnum * u.hdr.e_shentsize;
+ if (nbytes == 0 || u.hdr.e_shoff == 0)
goto nosyms;
shdr = malloc(nbytes, M_LINKER, M_WAITOK);
if (shdr == NULL) {
@@ -633,13 +646,13 @@ link_elf_load_file(const char* filename, linker_file_t* result)
}
bzero(shdr, nbytes);
error = vn_rdwr(UIO_READ, nd.ni_vp,
- (caddr_t)shdr, nbytes, hdr->e_shoff,
+ (caddr_t)shdr, nbytes, u.hdr.e_shoff,
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
if (error)
goto out;
symtabindex = -1;
symstrindex = -1;
- for (i = 0; i < hdr->e_shnum; i++) {
+ for (i = 0; i < u.hdr.e_shnum; i++) {
if (shdr[i].sh_type == SHT_SYMTAB) {
symtabindex = i;
symstrindex = shdr[i].sh_link;
@@ -682,8 +695,6 @@ out:
linker_file_unload(lf);
if (shdr)
free(shdr, M_LINKER);
- if (firstpage)
- free(firstpage, M_LINKER);
VOP_UNLOCK(nd.ni_vp, 0, p);
vn_close(nd.ni_vp, FREAD, p->p_ucred, p);
@@ -738,11 +749,10 @@ load_dependancies(linker_file_t lf)
/*
* All files are dependant on /kernel.
*/
- if (linker_kernel_file) {
- linker_kernel_file->refs++;
- linker_file_add_dependancy(lf, linker_kernel_file);
- }
+ linker_kernel_file->refs++;
+ linker_file_add_dependancy(lf, linker_kernel_file);
+
for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) {
if (dp->d_tag == DT_NEEDED) {
name = ef->strtab + dp->d_un.d_val;
@@ -788,10 +798,8 @@ relocate_file(linker_file_t lf)
rellim = (const Elf_Rel *) ((caddr_t) ef->rel + ef->relsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
- if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rel, ELF_RELOC_REL, symname))
return ENOENT;
- }
rel++;
}
}
@@ -802,10 +810,8 @@ relocate_file(linker_file_t lf)
relalim = (const Elf_Rela *) ((caddr_t) ef->rela + ef->relasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
- if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname))
return ENOENT;
- }
rela++;
}
}
@@ -816,10 +822,8 @@ relocate_file(linker_file_t lf)
rellim = (const Elf_Rel *) ((caddr_t) ef->pltrel + ef->pltrelsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
- if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rel, ELF_RELOC_REL, symname))
return ENOENT;
- }
rel++;
}
}
@@ -830,10 +834,8 @@ relocate_file(linker_file_t lf)
relalim = (const Elf_Rela *) ((caddr_t) ef->pltrela + ef->pltrelasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
- if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname))
return ENOENT;
- }
rela++;
}
}
diff --git a/sys/kern/makedevops.pl b/sys/kern/makedevops.pl
deleted file mode 100644
index 24e0b146a3f4..000000000000
--- a/sys/kern/makedevops.pl
+++ /dev/null
@@ -1,394 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (c) 1992, 1993
-# The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
-#
-# From @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93
-# From @(#)makedevops.sh 1.1 1998/06/14 13:53:12 dfr Exp $
-# From @(#)makedevops.sh ?.? 1998/10/05
-
-#
-# Script to produce device front-end sugar.
-#
-
-$debug = 0;
-$cfile = 0; # by default do not produce any file type
-$hfile = 0;
-
-$keepcurrentdir = 1;
-
-$line_width = 80;
-
-use File::Basename;
-
-# Process the command line
-#
-while ( $arg = shift @ARGV ) {
- if ( $arg eq '-c' ) {
- warn "Producing .c output files"
- if $debug;
- $cfile = 1;
- } elsif ( $arg eq '-h' ) {
- warn "Producing .h output files"
- if $debug;
- $hfile = 1;
- } elsif ( $arg eq '-ch' || $arg eq '-hc' ) {
- warn "Producing .c and .h output files"
- if $debug;
- $cfile = 1;
- $hfile = 1;
- } elsif ( $arg eq '-d' ) {
- $debug = 1;
- } elsif ( $arg eq '-p' ) {
- warn "Will produce files in original not in current directory"
- if $debug;
- $keepcurrentdir = 0;
- } elsif ( $arg eq '-l' ) {
- if ( $line_width = shift @ARGV and $line_width > 0 ) {
- warn "Line width set to $line_width"
- if $debug;
- } else {
- die "Please specify a valid line width after -l";
- }
- } elsif ( $arg =~ m/\.m$/ ) {
- warn "Filename: $arg"
- if $debug;
- push @filenames, $arg;
- } else {
- warn "$arg ignored"
- if $debug;
- }
-}
-
-
-# Validate the command line parameters
-#
-die "usage: $0 [-d] [-p] [-c|-h] srcfile
-where -c produce only .c files
- -h produce only .h files
- -p use the path component in the source file for destination dir
- -l set line width for output files [80]
- -d switch on debugging
-"
- unless ($cfile or $hfile)
- and $#filenames != -1;
-
-# FIXME should be able to do this more easily
-#
-$tmpdir = $ENV{'TMPDIR'}; # environment variables
-$tmpdir = $ENV{'TMP'}
- if !$tmpdir;
-$tmpdir = $ENV{'TEMP'}
- if !$tmpdir;
-$tmpdir = '/tmp' # look for a physical directory
- if !$tmpdir and -d '/tmp';
-$tmpdir = '/usr/tmp'
- if !$tmpdir and -d '/usr/tmp';
-$tmpdir = '/var/tmp'
- if !$tmpdir and -d '/var/tmp';
-$tmpdir = '.' # give up and use current dir
- if !$tmpdir;
-
-foreach $src ( @filenames ) {
- # Names of the created files
- $ctmpname = "$tmpdir/ctmp.$$";
- $htmpname = "$tmpdir/htmp.$$";
-
- ($name, $path, $suffix) = &fileparse($src, '.m');
- $path = '.'
- if $keepcurrentdir;
- $cfilename="$path/$name.c";
- $hfilename="$path/$name.h";
-
- warn "Processing from $src to $cfile / $hfile via $ctmp / $htmp"
- if $debug;
-
- die "Could not open $src, $!"
- if !open SRC, "$src";
- die "Could not open $ctmpname, $!"
- if $cfile and !open CFILE, ">$ctmpname";
- die "Could not open $htmpname, $!"
- if $hfile and !open HFILE, ">$htmpname";
-
- if ( $cfile ) {
- # Produce the header of the C file
- #
- print CFILE "/*\n";
- print CFILE " * This file is produced automatically.\n";
- print CFILE " * Do not modify anything in here by hand.\n";
- print CFILE " *\n";
- print CFILE " * Created from\n";
- print CFILE " * $src\n";
- print CFILE " * with\n";
- print CFILE " * $0\n";
- print CFILE " */\n";
- print CFILE "\n";
- print CFILE "#include <sys/param.h>\n";
- print CFILE "#include <sys/queue.h>\n";
- print CFILE "#include <sys/bus_private.h>\n";
- }
-
- if ( $hfile ) {
- # Produce the header of the H file
- #
- print HFILE "/*\n";
- print HFILE " * This file is produced automatically.\n";
- print HFILE " * Do not modify anything in here by hand.\n";
- print HFILE " *\n";
- print HFILE " * Created from\n";
- print HFILE " * $src\n";
- print HFILE " * with\n";
- print HFILE " * $0\n";
- print HFILE " */\n";
- print HFILE "\n";
- }
-
- %methods = (); # clear list of methods
- $lineno = 0;
- $error = 0; # to signal clean up and gerror setting
-
- LINE: while ( $line = <SRC> ) {
- $lineno++;
-
- # take special notice of include directives.
- #
- if ( $line =~ m/^#\s*include\s+(["<])([^">]+)([">]).*/i ) {
- warn "Included file: $1$2" . ($1 eq '<'? '>':'"')
- if $debug;
- print CFILE "#include $1$2" . ($1 eq '<'? '>':'"') . "\n"
- if $cfile;
- }
-
- $line =~ s/#.*//; # remove comments
- $line =~ s/^\s+//; # remove leading ...
- $line =~ s/\s+$//; # remove trailing whitespace
-
- if ( $line =~ m/^$/ ) { # skip empty lines
- # nop
-
- } elsif ( $line =~ m/^INTERFACE\s*([^\s;]*)(\s*;?)/i ) {
- $intname = $1;
- $semicolon = $2;
- unless ( $intname =~ m/^[a-z_][a-z0-9_]*$/ ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid interface name '$intname', use [a-z_][a-z0-9_]*";
- $error = 1;
- last LINE;
- }
-
- warn "$src:$lineno: semicolon missing at end of line, no problem"
- if $semicolon !~ s/;$//;
-
- warn "Interface $intname"
- if $debug;
-
- print HFILE '#ifndef _'.$intname."_if_h_\n"
- if $hfile;
- print HFILE '#define _'.$intname."_if_h_\n\n"
- if $hfile;
- print CFILE '#include "'.$intname.'_if.h"'."\n\n"
- if $cfile;
-
- } elsif ( $line =~ m/^METHOD/i ) {
- # Get the return type function name and delete that from
- # the line. What is left is the possibly first function argument
- # if it is on the same line.
- #
- # FIXME For compatibilities sake METHOD and METHODE is accepted.
- #
- if ( !$intname ) {
- warn "$src:$lineno: No interface name defined";
- $error = 1;
- last LINE;
- }
- $line =~ s/^METHODE?\s+([^{]+?)\s*{\s*//i;
- @ret = split m/\s+/, $1;
- $name = pop @ret; # last element is name of method
- $ret = join(" ", @ret); # return type
-
- warn "Method: name=$name return type=$ret"
- if $debug;
-
- if ( !$name or !$ret ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid method specification";
- $error = 1;
- last LINE;
- }
-
- unless ( $name =~ m/^[a-z_][a-z_0-9]*$/ ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid method name '$name', use [a-z_][a-z0-9_]*";
- $error = 1;
- last LINE;
- }
-
- if ( defined($methods{$name}) ) {
- warn "$src:$lineno: Duplicate method name";
- $error = 1;
- last LINE;
- }
-
- $methods{$name} = 'VIS';
-
- while ( $line !~ m/}/ and $line .= <SRC> ) { }
-
- if ( $line !~ s/};?(.*)// ) { # remove first '}' and trailing garbage
- # The '}' was not there (the rest is optional), so complain
- warn "$src:$lineno: Premature end of file";
- $error = 1;
- last LINE;
- }
- warn "$src:$lineno: Ignored '$1'" # warn about garbage at end of line
- if $debug and $1;
-
- # Create a list of variables without the types prepended
- #
- $line =~ s/^\s+//; # remove leading ...
- $line =~ s/\s+$//; # ... and trailing whitespace
- $line =~ s/\s+/ /; # remove double spaces
-
- @arguments = split m/\s*;\s*/, $line;
- @varnames = (); # list of varnames
- foreach $argument (@arguments) {
- next # skip argument if argument is empty
- if !$argument;
-
- @ar = split m/[*\s]+/, $argument;
- if ( $#ar == 0 ) { # only 1 word in argument?
- warn "$src:$lineno: no type for '$argument'";
- $error = 1;
- last LINE;
- }
-
- push @varnames, $ar[-1]; # last element is name of variable
- };
-
- warn 'Arguments: ' . join(', ', @arguments) . "\n"
- . 'Varnames: ' . join(', ', @varnames)
- if $debug;
-
- $mname = $intname.'_'.$name; # method name
- $umname = uc($mname); # uppercase method name
-
- $arguments = join(", ", @arguments);
- $varnames = join(", ", @varnames);
-
- if ( $hfile ) {
- # the method description
- print HFILE "extern struct device_op_desc $mname\_desc;\n";
- # the method typedef
- print HFILE &format_line("typedef $ret $mname\_t($arguments);",
- $line_width, ', ',
- ',',' ' x length("typedef $ret $mname\_t("))
- . "\n";
- # the method declaration
- print HFILE "$mname\_t $umname;\n\n";
- }
-
- if ( $cfile ) {
- # Print out the method desc
- print CFILE "struct device_op_desc $mname\_desc = {\n";
- print CFILE "\t0, \"$mname\"\n";
- print CFILE "};\n\n";
-
- # Print out the method itself
- if ( 0 ) { # haven't chosen the format yet
- print CFILE "$ret $umname($varnames)\n";
- print CFILE "\t".join(";\n\t", @arguments).";\n";
- } else {
- print CFILE &format_line("$ret $umname($arguments)",
- $line_width, ', ',
- ',', ' ' x length("$ret $umname(")) . "\n";
- }
- print CFILE "{\n";
- print CFILE &format_line("\t$mname\_t *m = ($mname\_t *) DEVOPMETH(dev, $mname);",
- $line_width-8, ' = ', ' =', "\t\t")
- . "\n";
- print CFILE "\t".($ret eq 'void'? '':'return ') . "m($varnames);\n";
- print CFILE "}\n\n";
- }
- } else {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid line encountered";
- $error = 1;
- last LINE;
- }
- } # end LINE
-
- # print the final '#endif' in the header file
- #
- print HFILE "#endif /* _".$intname."_if_h_ */\n"
- if $hfile;
-
- close SRC;
- close CFILE
- if $cfile;
- close HFILE
- if $hfile;
-
- if ( !$error ) {
- if ( $cfile ) {
- ($rc = system("mv $ctmpname $cfilename"))
- and warn "mv $ctmpname $cfilename failed, $rc";
- }
-
- if ( $hfile ) {
- ($rc = system("mv $htmpname $hfilename"))
- and warn "mv $htmpname $hfilename failed, $rc";
- }
- } else {
- warn 'File' . ($hfile and $cfile? 's':'') . ' skipped';
- ($rc = system("rm -f $htmpname $ctmpname"))
- and warn "rm -f $htmpname $ctmpname failed, $rc";
- $gerror = 1;
- }
-}
-
-exit $gerror;
-
-
-sub format_line {
- my ($line, $maxlength, $break, $new_end, $new_start) = @_;
- my $rline = "";
-
- while ( length($line) > $maxlength
- and ($i = rindex $line, $break, $maxlength-length($new_end)) != -1 ) {
- $rline .= substr($line, 0, $i) . $new_end . "\n";
- $line = $new_start . substr($line, $i+length($break));
- }
-
- return $rline . $line;
-}
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 92347324ec60..2ab21f521d1b 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -41,7 +41,7 @@
*
* @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93
*
- * $Id: subr_autoconf.c,v 1.7 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_autoconf.c,v 1.5 1997/09/21 22:00:18 gibbs Exp $
*/
#include <sys/param.h>
@@ -334,12 +334,14 @@ evcnt_attach(dev, name, ev)
{
static struct evcnt **nextp = &allevents;
- KASSERT(strlen(name) < sizeof(ev->ev_name), ("evcnt_attach"));
-
+#ifdef DIAGNOSTIC
+ if (strlen(name) >= sizeof(ev->ev_name))
+ panic("evcnt_attach");
+#endif
/* ev->ev_next = NULL; */
ev->ev_dev = dev;
/* ev->ev_count = 0; */
- snprintf(ev->ev_name, sizeof(ev->ev_name), "%s", name);
+ strcpy(ev->ev_name, name);
*nextp = ev;
nextp = &ev->ev_next;
}
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index dc4c88a22912..f38f0f885063 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: subr_bus.c,v 1.13 1999/01/10 22:04:05 n_hibma Exp $
+ * $Id: subr_bus.c,v 1.5 1998/09/05 13:24:39 bde Exp $
*/
#include <sys/param.h>
@@ -33,61 +33,11 @@
#include <sys/module.h>
#include <sys/bus_private.h>
#include <sys/systm.h>
-#include <machine/stdarg.h> /* for device_printf() */
-
-#include "opt_bus.h"
-
-#ifdef BUS_DEBUG
-#define PDEBUG(a) (printf(__FUNCTION__ ":%d: ", __LINE__), printf a, printf("\n"))
-#define DEVICENAME(d) ((d)? device_get_name(d): "no device")
-#define DRIVERNAME(d) ((d)? d->name : "no driver")
-#define DEVCLANAME(d) ((d)? d->name : "no devclass")
-
-/* Produce the indenting, indent*2 spaces plus a '.' ahead of that to
- * prevent syslog from deleting initial spaces
- */
-#define indentprintf(p) do { int iJ; printf("."); for (iJ=0; iJ<indent; iJ++) printf(" "); printf p ; } while(0)
-
-static void print_method_list(device_method_t *m, int indent);
-static void print_device_ops(device_ops_t ops, int indent);
-static void print_device_short(device_t dev, int indent);
-static void print_device(device_t dev, int indent);
-void print_device_tree_short(device_t dev, int indent);
-void print_device_tree(device_t dev, int indent);
-static void print_driver_short(driver_t *driver, int indent);
-static void print_driver(driver_t *driver, int indent);
-static void print_driver_list(driver_list_t drivers, int indent);
-static void print_devclass_short(devclass_t dc, int indent);
-static void print_devclass(devclass_t dc, int indent);
-void print_devclass_list_short(void);
-void print_devclass_list(void);
-
-#else
-/* Make the compiler ignore the function calls */
-#define PDEBUG(a) /* nop */
-#define DEVICENAME(d) /* nop */
-#define DRIVERNAME(d) /* nop */
-#define DEVCLANAME(d) /* nop */
-
-#define print_method_list(m,i) /* nop */
-#define print_device_ops(o,i) /* nop */
-#define print_device_short(d,i) /* nop */
-#define print_device(d,i) /* nop */
-#define print_device_tree_short(d,i) /* nop */
-#define print_device_tree(d,i) /* nop */
-#define print_driver_short(d,i) /* nop */
-#define print_driver(d,i) /* nop */
-#define print_driver_list(d,i) /* nop */
-#define print_devclass_short(d,i) /* nop */
-#define print_devclass(d,i) /* nop */
-#define print_devclass_list_short() /* nop */
-#define print_devclass_list() /* nop */
-#endif
-
/*
* Method table handling
*/
+
static int next_method_offset = 1;
static int methods_count = 0;
static int methods_size = 0;
@@ -108,8 +58,6 @@ register_method(struct device_op_desc *desc)
for (i = 0; i < methods_count; i++)
if (!strcmp(methods[i].name, desc->name)) {
desc->offset = methods[i].offset;
- PDEBUG(("methods[%d] has the same name, %s, with offset %d",
- i, desc->name, desc->offset));
return;
}
@@ -158,8 +106,6 @@ compile_methods(driver_t *driver)
for (i = 0, m = driver->methods; m->desc; i++, m++)
if (!m->desc->offset)
register_method(m->desc);
- else
- PDEBUG(("offset not equal to zero, method desc %d left as is", i));
/*
* Then allocate the compiled op table.
@@ -168,16 +114,11 @@ compile_methods(driver_t *driver)
M_DEVBUF, M_NOWAIT);
if (!ops)
panic("compile_methods: out of memory");
-
ops->maxoffset = next_method_offset;
for (i = 0; i < next_method_offset; i++)
ops->methods[i] = error_method;
for (i = 0, m = driver->methods; m->desc; i++, m++)
ops->methods[m->desc->offset] = m->func;
- PDEBUG(("%s has %d method%s, wasting %d bytes",
- DRIVERNAME(driver), i, (i==1?"":"s"),
- (next_method_offset-i)*sizeof(devop_t)));
-
driver->ops = ops;
}
@@ -185,22 +126,23 @@ compile_methods(driver_t *driver)
* Devclass implementation
*/
-static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses);
+static devclass_list_t devclasses;
+
+static void
+devclass_init(void)
+{
+ TAILQ_INIT(&devclasses);
+}
static devclass_t
devclass_find_internal(const char *classname, int create)
{
devclass_t dc;
- PDEBUG(("looking for %s", classname));
- if (!classname)
- return NULL;
-
for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
if (!strcmp(dc->name, classname))
return dc;
- PDEBUG(("%s not found%s", classname, (create? ", creating": "")));
if (create) {
dc = malloc(sizeof(struct devclass) + strlen(classname) + 1,
M_DEVBUF, M_NOWAIT);
@@ -227,7 +169,6 @@ devclass_find(const char *classname)
int
devclass_add_driver(devclass_t dc, driver_t *driver)
{
- PDEBUG(("%s", DRIVERNAME(driver)));
/*
* Compile the drivers methods.
*/
@@ -244,35 +185,31 @@ devclass_add_driver(devclass_t dc, driver_t *driver)
}
int
-devclass_delete_driver(devclass_t busclass, driver_t *driver)
+devclass_delete_driver(devclass_t dc, driver_t *driver)
{
- devclass_t dc = devclass_find(driver->name);
+ device_t bus;
device_t dev;
int i;
int error;
- PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass)));
-
- if (!dc)
- return 0;
-
/*
* Disassociate from any devices. We iterate through all the
- * devices in the devclass of the driver and detach any which are
- * using the driver.
+ * devices attached to any bus in this class.
*/
for (i = 0; i < dc->maxunit; i++) {
if (dc->devices[i]) {
- dev = dc->devices[i];
- if (dev->driver == driver) {
- if (error = device_detach(dev))
- return error;
- device_set_driver(dev, NULL);
- }
+ bus = dc->devices[i]->parent;
+ for (dev = TAILQ_FIRST(&bus->children); dev;
+ dev = TAILQ_NEXT(dev, link))
+ if (dev->driver == driver) {
+ if (error = device_detach(dev))
+ return error;
+ device_set_driver(dev, NULL);
+ }
}
}
- TAILQ_REMOVE(&busclass->drivers, driver, link);
+ TAILQ_REMOVE(&dc->drivers, driver, link);
return 0;
}
@@ -281,15 +218,11 @@ devclass_find_driver(devclass_t dc, const char *classname)
{
driver_t *driver;
- PDEBUG(("%s in devclass %s", classname, DEVCLANAME(dc)));
-
for (driver = TAILQ_FIRST(&dc->drivers); driver;
- driver = TAILQ_NEXT(driver, link)) {
+ driver = TAILQ_NEXT(driver, link))
if (!strcmp(driver->name, classname))
return driver;
- }
- PDEBUG(("not found"));
return NULL;
}
@@ -325,6 +258,7 @@ devclass_get_devices(devclass_t dc, device_t **devlistp, int *devcountp)
{
int i;
int count;
+ device_t dev;
device_t *list;
count = 0;
@@ -360,8 +294,6 @@ devclass_alloc_unit(devclass_t dc, int *unitp)
{
int unit = *unitp;
- PDEBUG(("unit %d in devclass %s", unit, DEVCLANAME(dc)));
-
/*
* If we have been given a wired unit number, check for existing
* device.
@@ -398,7 +330,6 @@ devclass_alloc_unit(devclass_t dc, int *unitp)
dc->devices = newlist;
dc->maxunit = newsize;
}
- PDEBUG(("now: unit %d in devclass %s", unit, DEVCLANAME(dc)));
*unitp = unit;
return 0;
@@ -409,8 +340,6 @@ devclass_add_device(devclass_t dc, device_t dev)
{
int error;
- PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
-
if (error = devclass_alloc_unit(dc, &dev->unit))
return error;
dc->devices[dev->unit] = dev;
@@ -421,11 +350,6 @@ devclass_add_device(devclass_t dc, device_t dev)
static int
devclass_delete_device(devclass_t dc, device_t dev)
{
- if (!dc || !dev)
- return 0;
-
- PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
-
if (dev->devclass != dc
|| dc->devices[dev->unit] != dev)
panic("devclass_delete_device: inconsistent device class");
@@ -442,13 +366,11 @@ static device_t
make_device(device_t parent, const char *name,
int unit, void *ivars)
{
+ driver_t *driver;
device_t dev;
devclass_t dc;
int error;
- PDEBUG(("%s at %s as unit %d with%s ivars",
- name, DEVICENAME(parent), unit, (ivars? "":"out")));
-
if (name) {
dc = devclass_find_internal(name, TRUE);
if (!dc) {
@@ -507,15 +429,9 @@ device_add_child(device_t dev, const char *name, int unit, void *ivars)
{
device_t child;
- PDEBUG(("%s at %s as unit %d with%s ivars",
- name, DEVICENAME(dev), unit, (ivars? "":"out")));
-
child = make_device(dev, name, unit, ivars);
- if (child)
- TAILQ_INSERT_TAIL(&dev->children, child, link);
- else
- PDEBUG(("%s failed", name));
+ TAILQ_INSERT_TAIL(&dev->children, child, link);
return child;
}
@@ -526,9 +442,6 @@ device_add_child_after(device_t dev, device_t place, const char *name,
{
device_t child;
- PDEBUG(("%s at %s after %s as unit %d with%s ivars",
- name, DEVICENAME(dev), DEVICENAME(place), unit, (ivars? "":"out")));
-
child = make_device(dev, name, unit, ivars);
if (place) {
@@ -544,23 +457,13 @@ int
device_delete_child(device_t dev, device_t child)
{
int error;
- device_t grandchild;
-
- PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev)));
-
- /* remove children first */
- while ( (grandchild = TAILQ_FIRST(&child->children)) ) {
- error = device_delete_child(child, grandchild);
- if (error)
- return error;
- }
if (error = device_detach(child))
return error;
if (child->devclass)
devclass_delete_device(child->devclass, child);
TAILQ_REMOVE(&dev->children, child, link);
- free(child, M_DEVBUF);
+ free(dev, M_DEVBUF);
return 0;
}
@@ -612,6 +515,7 @@ device_probe_child(device_t dev, device_t child)
{
devclass_t dc;
driver_t *driver;
+ void *softc;
dc = dev->devclass;
if (dc == NULL)
@@ -623,7 +527,6 @@ device_probe_child(device_t dev, device_t child)
for (driver = first_matching_driver(dc, child);
driver;
driver = next_matching_driver(dc, child, driver)) {
- PDEBUG(("Trying %s", DRIVERNAME(driver)));
device_set_driver(child, driver);
if (DEVICE_PROBE(child) == 0) {
if (!child->devclass)
@@ -642,35 +545,6 @@ device_get_parent(device_t dev)
return dev->parent;
}
-int
-device_get_children(device_t dev, device_t **devlistp, int *devcountp)
-{
- int count;
- device_t child;
- device_t *list;
-
- count = 0;
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- count++;
-
- list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT);
- if (!list)
- return ENOMEM;
-
- count = 0;
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link)) {
- list[count] = child;
- count++;
- }
-
- *devlistp = list;
- *devcountp = count;
-
- return 0;
-}
-
driver_t *
device_get_driver(device_t dev)
{
@@ -704,27 +578,6 @@ device_get_desc(device_t dev)
}
void
-device_print_prettyname(device_t dev)
-{
- const char *name = device_get_name(dev);
-
- if (name == 0)
- name = "(no driver assigned)";
- printf("%s%d: ", name, device_get_unit(dev));
-}
-
-void
-device_printf(device_t dev, const char * fmt, ...)
-{
- va_list ap;
-
- device_print_prettyname(dev);
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
-}
-
-void
device_set_desc(device_t dev, const char* desc)
{
dev->desc = desc;
@@ -831,11 +684,6 @@ device_set_driver(device_t dev, driver_t *driver)
if (driver) {
dev->ops = driver->ops;
dev->softc = malloc(driver->softc, M_DEVBUF, M_NOWAIT);
- if (!dev->softc) {
- dev->ops = &null_ops;
- dev->driver = NULL;
- return ENOMEM;
- }
bzero(dev->softc, driver->softc);
}
return 0;
@@ -845,15 +693,15 @@ int
device_probe_and_attach(device_t dev)
{
device_t bus = dev->parent;
- int error = 0;
+ int error;
if (dev->state >= DS_ALIVE)
return 0;
if (dev->flags & DF_ENABLED) {
- error = device_probe_child(bus, dev);
- if (!error) {
- device_print_child(bus, dev);
+ device_probe_child(bus, dev);
+ device_print_child(bus, dev);
+ if (dev->state == DS_ALIVE) {
error = DEVICE_ATTACH(dev);
if (!error)
dev->state = DS_ATTACHED;
@@ -864,12 +712,11 @@ device_probe_and_attach(device_t dev)
dev->state = DS_NOTPRESENT;
}
}
- } else {
- device_print_prettyname(dev);
- printf("not probed (disabled)\n");
- }
+ } else
+ printf("%s%d: disabled, not probed.\n",
+ dev->devclass->name, dev->unit);
- return error;
+ return 0;
}
int
@@ -877,7 +724,6 @@ device_detach(device_t dev)
{
int error;
- PDEBUG(("%s", DEVICENAME(dev)));
if (dev->state == DS_BUSY)
return EBUSY;
if (dev->state != DS_ATTACHED)
@@ -913,7 +759,7 @@ static int
resource_match_string(int i, char *resname, char *value)
{
int j;
- struct config_resource *res;
+ struct resource *res;
for (j = 0, res = devtab[i].resources;
j < devtab[i].resource_count; j++, res++)
@@ -925,11 +771,10 @@ resource_match_string(int i, char *resname, char *value)
}
static int
-resource_find(const char *name, int unit, char *resname,
- struct config_resource **result)
+resource_find(const char *name, int unit, char *resname, struct resource **result)
{
int i, j;
- struct config_resource *res;
+ struct resource *res;
/*
* First check specific instances, then generic.
@@ -965,7 +810,7 @@ int
resource_int_value(const char *name, int unit, char *resname, int *result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_INT)
@@ -978,7 +823,7 @@ int
resource_long_value(const char *name, int unit, char *resname, long *result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_LONG)
@@ -991,7 +836,7 @@ int
resource_string_value(const char *name, int unit, char *resname, char **result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_STRING)
@@ -1033,6 +878,7 @@ int
bus_generic_attach(device_t dev)
{
device_t child;
+ int error;
for (child = TAILQ_FIRST(&dev->children);
child; child = TAILQ_NEXT(child, link))
@@ -1052,8 +898,7 @@ bus_generic_detach(device_t dev)
for (child = TAILQ_FIRST(&dev->children);
child; child = TAILQ_NEXT(child, link))
- if (error = device_detach(child))
- return error;
+ device_detach(child);
return 0;
}
@@ -1070,197 +915,59 @@ bus_generic_shutdown(device_t dev)
return 0;
}
-int
-bus_generic_suspend(device_t dev)
-{
- int error;
- device_t child, child2;
-
- for (child = TAILQ_FIRST(&dev->children);
- child; child = TAILQ_NEXT(child, link)) {
- error = DEVICE_SUSPEND(child);
- if (error) {
- for (child2 = TAILQ_FIRST(&dev->children);
- child2 && child2 != child;
- child2 = TAILQ_NEXT(child2, link))
- DEVICE_RESUME(child2);
- return (error);
- }
- }
- return 0;
-}
-
-int
-bus_generic_resume(device_t dev)
-{
- device_t child;
-
- for (child = TAILQ_FIRST(&dev->children);
- child; child = TAILQ_NEXT(child, link)) {
- DEVICE_RESUME(child);
- /* if resume fails, there's nothing we can usefully do... */
- }
- return 0;
-}
-
void
bus_generic_print_child(device_t dev, device_t child)
{
- printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
}
int
-bus_generic_read_ivar(device_t dev, device_t child, int index,
- uintptr_t * result)
+bus_generic_read_ivar(device_t dev, device_t child, int index, u_long* result)
{
return ENOENT;
}
int
-bus_generic_write_ivar(device_t dev, device_t child, int index,
- uintptr_t value)
+bus_generic_write_ivar(device_t dev, device_t child, int index, u_long value)
{
return ENOENT;
}
-int
-bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_SETUP_INTR(dev->parent, child, irq, intr, arg,
- cookiep));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq,
- void *cookie)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
- else
- return (EINVAL);
-}
-
-struct resource *
-bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_ALLOC_RESOURCE(dev->parent, child, type, rid,
- start, end, count, flags));
- else
- return (NULL);
-}
-
-int
-bus_generic_release_resource(device_t dev, device_t child, int type, int rid,
- struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_RELEASE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_activate_resource(device_t dev, device_t child, int type, int rid,
- struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_ACTIVATE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_deactivate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_DEACTIVATE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-/*
- * Some convenience functions to make it easier for drivers to use the
- * resource-management functions. All these really do is hide the
- * indirection through the parent's method table, making for slightly
- * less-wordy code. In the future, it might make sense for this code
- * to maintain some sort of a list of resources allocated by each device.
- */
-struct resource *
-bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end,
- u_long count, u_int flags)
-{
- if (dev->parent == 0)
- return (0);
- return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end,
- count, flags));
-}
-
-int
-bus_activate_resource(device_t dev, int type, int rid, struct resource *r)
-{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_ACTIVATE_RESOURCE(dev->parent, dev, type, rid, r));
-}
-
-int
-bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r)
+void *
+bus_generic_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg)
{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_DEACTIVATE_RESOURCE(dev->parent, dev, type, rid, r));
+ /* Propagate up the bus hierarchy until someone handles it. */
+ if (dev->parent)
+ return BUS_CREATE_INTR(dev->parent, dev, irq, intr, arg);
+ else
+ return NULL;
}
int
-bus_release_resource(device_t dev, int type, int rid, struct resource *r)
-{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_RELEASE_RESOURCE(dev->parent, dev,
- type, rid, r));
-}
-
-static void
-root_print_child(device_t dev, device_t child)
+bus_generic_connect_intr(device_t dev, void *ih)
{
+ /* Propagate up the bus hierarchy until someone handles it. */
+ if (dev->parent)
+ return BUS_CONNECT_INTR(dev->parent, ih);
+ else
+ return EINVAL;
}
-static int
-root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg,
- void **cookiep)
+static int root_create_intr(device_t dev, device_t child,
+ driver_intr_t *intr, void *arg)
{
- /*
- * If an interrupt mapping gets to here something bad has happened.
- */
- panic("root_setup_intr");
+ /*
+ * If an interrupt mapping gets to here something bad has happened.
+ * Should probably panic.
+ */
+ return EINVAL;
}
static device_method_t root_methods[] = {
- /* Device interface */
- DEVMETHOD(device_suspend, bus_generic_suspend),
- DEVMETHOD(device_resume, bus_generic_resume),
-
/* Bus interface */
- DEVMETHOD(bus_print_child, root_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, root_setup_intr),
+ DEVMETHOD(bus_create_intr, root_create_intr),
{ 0, 0 }
};
@@ -1272,21 +979,21 @@ static driver_t root_driver = {
1, /* no softc */
};
-device_t root_bus;
-devclass_t root_devclass;
+device_t root_bus;
+devclass_t root_devclass;
static int
-root_bus_module_handler(module_t mod, int what, void* arg)
+root_bus_module_handler(module_t mod, modeventtype_t what, void* arg)
{
switch (what) {
case MOD_LOAD:
+ devclass_init();
compile_methods(&root_driver);
root_bus = make_device(NULL, "root", 0, NULL);
- root_bus->desc = "System root bus";
root_bus->ops = root_driver.ops;
root_bus->driver = &root_driver;
root_bus->state = DS_ATTACHED;
- root_devclass = devclass_find_internal("root", FALSE);
+ root_devclass = devclass_find("root");
return 0;
}
@@ -1301,11 +1008,10 @@ static moduledata_t root_bus_mod = {
DECLARE_MODULE(rootbus, root_bus_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
void
-root_bus_configure(void)
+root_bus_configure()
{
device_t dev;
-
- PDEBUG(("."));
+ int error;
for (dev = TAILQ_FIRST(&root_bus->children); dev;
dev = TAILQ_NEXT(dev, link)) {
@@ -1314,259 +1020,30 @@ root_bus_configure(void)
}
int
-driver_module_handler(module_t mod, int what, void *arg)
-{
- int error, i;
- struct driver_module_data *dmd;
- devclass_t bus_devclass;
-
- dmd = (struct driver_module_data *)arg;
- bus_devclass = devclass_find_internal(dmd->dmd_busname, TRUE);
- error = 0;
-
- switch (what) {
- case MOD_LOAD:
- for (i = 0; !error && i < dmd->dmd_ndrivers; i++) {
- PDEBUG(("Loading module: driver %s on bus %s",
- DRIVERNAME(dmd->dmd_drivers[i]),
- dmd->dmd_busname));
- error = devclass_add_driver(bus_devclass,
- dmd->dmd_drivers[i]);
- }
- if (error)
- break;
-
- /*
- * The drivers loaded in this way are assumed to all
- * implement the same devclass.
- */
- *dmd->dmd_devclass =
- devclass_find_internal(dmd->dmd_drivers[0]->name,
- TRUE);
- break;
-
- case MOD_UNLOAD:
- for (i = 0; !error && i < dmd->dmd_ndrivers; i++) {
- PDEBUG(("Unloading module: driver %s from bus %s",
- DRIVERNAME(dmd->dmd_drivers[i]),
- dmd->dmd_busname));
- error = devclass_delete_driver(bus_devclass,
- dmd->dmd_drivers[i]);
- }
- break;
- }
-
- if (!error && dmd->dmd_chainevh)
- error = dmd->dmd_chainevh(mod, what, dmd->dmd_chainarg);
- return (error);
-}
-
-#ifdef BUS_DEBUG
-
-/* the _short versions avoid iteration by not calling anything that prints
- * more than oneliners. I love oneliners.
- */
-
-static void
-print_method_list(device_method_t *m, int indent)
-{
- int i;
-
- if (!m)
- return;
-
- for (i = 0; m->desc; i++, m++)
- indentprintf(("method %d: %s, offset=%d\n",
- i, m->desc->name, m->desc->offset));
-}
-
-static void
-print_device_ops(device_ops_t ops, int indent)
+driver_module_handler(module_t mod, modeventtype_t what, void* arg)
{
- int i;
- int count = 0;
-
- if (!ops)
- return;
-
- /* we present a list of the methods that are pointing to the
- * error_method, but ignore the 0'th elements; it is always
- * error_method.
- */
- for (i = 1; i < ops->maxoffset; i++) {
- if (ops->methods[i] == error_method) {
- if (count == 0)
- indentprintf(("error_method:"));
- printf(" %d", i);
- count++;
- }
- }
- if (count)
- printf("\n");
-
- indentprintf(("(%d method%s, %d valid, %d error_method%s)\n",
- ops->maxoffset-1, (ops->maxoffset-1 == 1? "":"s"),
- ops->maxoffset-1-count,
- count, (count == 1? "":"'s")));
-}
-
-static void
-print_device_short(device_t dev, int indent)
-{
- if (!dev)
- return;
-
- indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%sivars,%ssoftc,busy=%d\n",
- dev->unit, dev->desc,
- (dev->parent? "":"no "),
- (TAILQ_EMPTY(&dev->children)? "no ":""),
- (dev->flags&DF_ENABLED? "enabled,":"disabled,"),
- (dev->flags&DF_FIXEDCLASS? "fixed,":""),
- (dev->flags&DF_WILDCARD? "wildcard,":""),
- (dev->ivars? "":"no "),
- (dev->softc? "":"no "),
- dev->busy));
-}
-
-static void
-print_device(device_t dev, int indent)
-{
- if (!dev)
- return;
-
- print_device_short(dev, indent);
-
- indentprintf(("Parent:\n"));
- print_device_short(dev->parent, indent+1);
- indentprintf(("Methods:\n"));
- print_device_ops(dev->ops, indent+1);
- indentprintf(("Driver:\n"));
- print_driver_short(dev->driver, indent+1);
- indentprintf(("Devclass:\n"));
- print_devclass_short(dev->devclass, indent+1);
-}
-
-void
-print_device_tree_short(device_t dev, int indent)
-/* print the device and all its children (indented) */
-{
- device_t child;
-
- if (!dev)
- return;
-
- print_device_short(dev, indent);
-
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- print_device_tree_short(child, indent+1);
-}
-
-void
-print_device_tree(device_t dev, int indent)
-/* print the device and all its children (indented) */
-{
- device_t child;
-
- if (!dev)
- return;
-
- print_device(dev, indent);
-
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- print_device_tree(child, indent+1);
-}
-
-static void
-print_driver_short(driver_t *driver, int indent)
-{
- if (!driver)
- return;
-
- indentprintf(("driver %s: type = %s%s%s%s, softc size = %d\n",
- driver->name,
- /* yes, I know this looks silly, but going to bed at
- * two o'clock and having to get up at 7:30 again is silly
- * as well. As is sticking your head in a bucket of water.
- */
- (driver->type == DRIVER_TYPE_TTY? "tty":""),
- (driver->type == DRIVER_TYPE_BIO? "bio":""),
- (driver->type == DRIVER_TYPE_NET? "net":""),
- (driver->type == DRIVER_TYPE_MISC? "misc":""),
- driver->softc));
-}
-
-static void
-print_driver(driver_t *driver, int indent)
-{
- if (!driver)
- return;
-
- print_driver_short(driver, indent);
- indentprintf(("Methods:\n"));
- print_method_list(driver->methods, indent+1);
- indentprintf(("Operations:\n"));
- print_device_ops(driver->ops, indent+1);
-}
-
-
-static void
-print_driver_list(driver_list_t drivers, int indent)
-{
- driver_t *driver;
-
- for (driver = TAILQ_FIRST(&drivers); driver;
- driver = TAILQ_NEXT(driver, link))
- print_driver(driver, indent);
-}
-
-static void
-print_devclass_short(devclass_t dc, int indent)
-{
- if ( !dc )
- return;
-
- indentprintf(("devclass %s: max units = %d, next unit = %d\n",
- dc->name, dc->maxunit, dc->nextunit));
-}
-
-static void
-print_devclass(devclass_t dc, int indent)
-{
- int i;
-
- if ( !dc )
- return;
-
- print_devclass_short(dc, indent);
- indentprintf(("Drivers:\n"));
- print_driver_list(dc->drivers, indent+1);
-
- indentprintf(("Devices:\n"));
- for (i = 0; i < dc->maxunit; i++)
- if (dc->devices[i])
- print_device(dc->devices[i], indent+1);
-}
-
-void
-print_devclass_list_short(void)
-{
- devclass_t dc;
+ struct driver_module_data* data = (struct driver_module_data*) arg;
+ devclass_t bus_devclass = devclass_find_internal(data->busname, TRUE);
+ int error;
- printf("Short listing of devclasses, drivers & devices:\n");
- for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
- print_devclass_short(dc, 0);
-}
+ switch (what) {
+ case MOD_LOAD:
+ if (error = devclass_add_driver(bus_devclass,
+ data->driver))
+ return error;
+ *data->devclass =
+ devclass_find_internal(data->driver->name, TRUE);
+ break;
-void
-print_devclass_list(void)
-{
- devclass_t dc;
+ case MOD_UNLOAD:
+ if (error = devclass_delete_driver(bus_devclass,
+ data->driver))
+ return error;
+ break;
+ }
- printf("Full listing of devclasses, drivers & devices:\n");
- for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
- print_devclass(dc, 0);
+ if (data->chainevh)
+ return data->chainevh(mod, what, data->chainarg);
+ else
+ return 0;
}
-
-#endif
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c
index 5fcf88efdca7..51c73df1da2f 100644
--- a/sys/kern/subr_devstat.c
+++ b/sys/kern/subr_devstat.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: subr_devstat.c,v 1.7 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_devstat.c,v 1.3 1998/10/06 04:16:07 ken Exp $
*/
#include <sys/param.h>
@@ -49,7 +49,7 @@ STAILQ_HEAD(devstatlist, devstat) device_statq;
* and add it to the queue of devices.
*/
void
-devstat_add_entry(struct devstat *ds, const char *dev_name,
+devstat_add_entry(struct devstat *ds, char *dev_name,
int unit_number, u_int32_t block_size,
devstat_support_flags flags,
devstat_type_flags device_type)
@@ -73,7 +73,6 @@ devstat_add_entry(struct devstat *ds, const char *dev_name,
ds->device_number = devstat_current_devnumber++;
ds->unit_number = unit_number;
strncpy(ds->device_name, dev_name, DEVSTAT_NAME_LEN);
- ds->device_name[DEVSTAT_NAME_LEN - 1] = 0;
ds->block_size = block_size;
ds->flags = flags;
ds->device_type = device_type;
@@ -178,10 +177,18 @@ devstat_end_transaction(struct devstat *ds, u_int32_t bytes,
/* Add our busy time to the total busy time. */
timevaladd(&ds->busy_time, &busy_time);
- } else if (ds->busy_count < 0)
+ }
+ /*
+ * XXX KDM this is temporarily disabled to avoid causing
+ * unsophisticated users to panic. There are unfixed bugs in the
+ * wd driver that will set off this error message.
+ */
+#if 0
+ else if (ds->busy_count < 0)
printf("devstat_end_transaction: HELP!! busy_count "
"for %s%d is < 0 (%d)!\n", ds->device_name,
ds->unit_number, ds->busy_count);
+#endif
}
/*
@@ -243,6 +250,6 @@ SYSCTL_PROC(_kern_devstat, OID_AUTO, all, CTLFLAG_RD|CTLTYPE_OPAQUE,
SYSCTL_INT(_kern_devstat, OID_AUTO, numdevs, CTLFLAG_RD, &devstat_num_devs,
0, "Number of devices in the devstat list");
SYSCTL_LONG(_kern_devstat, OID_AUTO, generation, CTLFLAG_RD,
- &devstat_generation, "Devstat list generation");
+ &devstat_generation, 0, "Devstat list generation");
SYSCTL_INT(_kern_devstat, OID_AUTO, version, CTLFLAG_RD, &devstat_version,
0, "Devstat list version number");
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index fa0e4a4126ac..d02b6b29cfbe 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -43,7 +43,7 @@
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: subr_diskslice.c,v 1.60 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_diskslice.c,v 1.57 1998/08/13 08:09:07 dfr Exp $
*/
#include "opt_devfs.h"
@@ -464,7 +464,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp, strat, setgeom)
(u_long)openmask);
/* XXX why doesn't setdisklabel() check this? */
if (error == 0 && lp->d_partitions[RAW_PART].p_offset != 0)
- error = EXDEV;
+ error = EINVAL;
if (error == 0) {
if (lp->d_secperunit > sp->ds_size)
error = ENOSPC;
@@ -680,14 +680,13 @@ dsname(dname, unit, slice, part, partname)
if (strlen(dname) > 16)
dname = "nametoolong";
- snprintf(name, sizeof(name), "%s%d", dname, unit);
+ sprintf(name, "%s%d", dname, unit);
partname[0] = '\0';
if (slice != WHOLE_DISK_SLICE || part != RAW_PART) {
partname[0] = 'a' + part;
partname[1] = '\0';
if (slice != COMPATIBILITY_SLICE)
- snprintf(name + strlen(name),
- sizeof(name) - strlen(name), "s%d", slice - 1);
+ sprintf(name + strlen(name), "s%d", slice - 1);
}
return (name);
}
@@ -1158,10 +1157,10 @@ set_ds_labeldevs_unaliased(dname, dev, ssp)
sname = dsname(dname, dkunit(dev), slice, part, partname);
if (part == RAW_PART && sp->ds_bdev != NULL) {
sp->ds_bdevs[part] =
- devfs_makelink(sp->ds_bdev,
+ devfs_link(sp->ds_bdev,
"%s%s", sname, partname);
sp->ds_cdevs[part] =
- devfs_makelink(sp->ds_cdev,
+ devfs_link(sp->ds_cdev,
"r%s%s", sname, partname);
} else {
mynor = minor(dkmodpart(dev, part));
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 1204376244c2..80193d400743 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_log.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_log.c,v 1.32 1998/11/11 10:55:56 truckman Exp $
+ * $Id: subr_log.c,v 1.29 1998/05/28 09:30:20 phk Exp $
*/
/*
@@ -51,7 +51,6 @@
#include <sys/signalvar.h>
#include <sys/kernel.h>
#include <sys/poll.h>
-#include <sys/filedesc.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
@@ -76,7 +75,7 @@ static struct cdevsw log_cdevsw =
static struct logsoftc {
int sc_state; /* see above for possibilities */
struct selinfo sc_selp; /* process waiting on select call */
- struct sigio *sc_sigio; /* information for async I/O */
+ int sc_pgid; /* process/group for async I/O */
} logsoftc;
int log_open; /* also used in log() */
@@ -91,7 +90,7 @@ logopen(dev, flags, mode, p)
if (log_open)
return (EBUSY);
log_open = 1;
- fsetown(p->p_pid, &logsoftc.sc_sigio); /* signal process only */
+ logsoftc.sc_pgid = p->p_pid; /* signal process only */
return (0);
}
@@ -105,7 +104,6 @@ logclose(dev, flag, mode, p)
log_open = 0;
logsoftc.sc_state = 0;
- funsetown(logsoftc.sc_sigio);
return (0);
}
@@ -180,11 +178,17 @@ logpoll(dev, events, p)
void
logwakeup()
{
+ struct proc *p;
+
if (!log_open)
return;
selwakeup(&logsoftc.sc_selp);
- if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL)
- pgsigio(logsoftc.sc_sigio, SIGIO, 0);
+ if (logsoftc.sc_state & LOG_ASYNC) {
+ if (logsoftc.sc_pgid < 0)
+ gsignal(-logsoftc.sc_pgid, SIGIO);
+ else if ((p = pfind(logsoftc.sc_pgid)))
+ psignal(p, SIGIO);
+ }
if (logsoftc.sc_state & LOG_RDWAIT) {
wakeup((caddr_t)msgbufp);
logsoftc.sc_state &= ~LOG_RDWAIT;
@@ -225,20 +229,12 @@ logioctl(dev, com, data, flag, p)
logsoftc.sc_state &= ~LOG_ASYNC;
break;
- case FIOSETOWN:
- return (fsetown(*(int *)data, &logsoftc.sc_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(logsoftc.sc_sigio);
- break;
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &logsoftc.sc_sigio));
+ logsoftc.sc_pgid = *(int *)data;
+ break;
- /* This is deprecated, FIOGETOWN should be used instead */
case TIOCGPGRP:
- *(int *)data = -fgetown(logsoftc.sc_sigio);
+ *(int *)data = logsoftc.sc_pgid;
break;
default:
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 424ac9faf084..f18a71ab070b 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- * $Id: subr_prf.c,v 1.50 1998/09/06 06:25:04 ache Exp $
+ * $Id: subr_prf.c,v 1.49 1998/08/10 14:27:34 bde Exp $
*/
#include <sys/param.h>
@@ -62,22 +62,12 @@
struct tty *constty; /* pointer to console "window" tty */
-struct putchar_arg {
- int flags;
- struct tty *tty;
-};
-
-struct snprintf_arg {
- char *str;
- size_t remain;
-};
-
static void (*v_putc)(int) = cnputc; /* routine to putc on virtual console */
static void logpri __P((int level));
static void msglogchar(int c, void *dummyarg);
+struct putchar_arg {int flags; struct tty *tty; };
static void putchar __P((int ch, void *arg));
static char *ksprintn __P((u_long num, int base, int *len));
-static void snprintf_func __P((int ch, void *arg));
static int consintr = 1; /* Ok to handle console interrupts? */
static int msgbufmapped; /* Set when safe to use msgbuf */
@@ -339,49 +329,6 @@ vsprintf(char *buf, const char *cfmt, va_list ap)
}
/*
- * Scaled down version of snprintf(3).
- */
-int
-snprintf(char *str, size_t size, const char *format, ...)
-{
- int retval;
- va_list ap;
-
- va_start(ap, format);
- retval = vsnprintf(str, size, format, ap);
- va_end(ap);
- return(retval);
-}
-
-/*
- * Scaled down version of vsnprintf(3).
- */
-int
-vsnprintf(char *str, size_t size, const char *format, va_list ap)
-{
- struct snprintf_arg info;
- int retval;
-
- info.str = str;
- info.remain = size;
- retval = kvprintf(format, snprintf_func, &info, 10, ap);
- if (info.remain >= 1)
- *info.str++ = '\0';
- return retval;
-}
-
-static void
-snprintf_func(int ch, void *arg)
-{
- struct snprintf_arg *const info = arg;
-
- if (info->remain >= 2) {
- *info->str++ = ch;
- info->remain--;
- }
-}
-
-/*
* Put a number (base <= 16) in a buffer in reverse order; return an
* optional length and a pointer to the NULL terminated (preceded?)
* buffer.
diff --git a/sys/kern/subr_rlist.c b/sys/kern/subr_rlist.c
index d637ab428f77..33ac63289046 100644
--- a/sys/kern/subr_rlist.c
+++ b/sys/kern/subr_rlist.c
@@ -54,7 +54,7 @@
* functioning of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: subr_rlist.c,v 1.28 1999/01/08 17:31:12 eivind Exp $
+ * $Id: subr_rlist.c,v 1.26 1998/04/15 17:46:25 bde Exp $
*/
#include <sys/param.h>
@@ -137,14 +137,16 @@ rlist_free(rlh, start, end)
while (cur_rlp != NULL) {
if (start < cur_rlp->rl_start)
break;
+#ifdef DIAGNOSTIC
if (prev_rlp) {
- KASSERT(prev_rlp->rl_end + 1 != cur_rlp->rl_start,
- ("rlist_free: missed coalesce opportunity"));
- KASSERT(prev_rlp->rl_end != cur_rlp->rl_start,
- ("rlist_free: entries overlap"));
- KASSERT(prev_rlp->rl_end <= cur_rlp->rl_start,
- ("entries out of order"));
+ if (prev_rlp->rl_end + 1 == cur_rlp->rl_start)
+ panic("rlist_free: missed coalesce opportunity");
+ if (prev_rlp->rl_end == cur_rlp->rl_start)
+ panic("rlist_free: entries overlap");
+ if (prev_rlp->rl_end > cur_rlp->rl_start)
+ panic("entries out of order");
}
+#endif
prev_rlp = cur_rlp;
cur_rlp = cur_rlp->rl_next;
}
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
deleted file mode 100644
index e0526bb5badc..000000000000
--- a/sys/kern/subr_rman.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id: subr_rman.c,v 1.3 1998/12/07 21:58:29 archie Exp $
- */
-
-/*
- * The kernel resource manager. This code is responsible for keeping track
- * of hardware resources which are apportioned out to various drivers.
- * It does not actually assign those resources, and it is not expected
- * that end-device drivers will call into this code directly. Rather,
- * the code which implements the buses that those devices are attached to,
- * and the code which manages CPU resources, will call this code, and the
- * end-device drivers will make upcalls to that code to actually perform
- * the allocation.
- *
- * There are two sorts of resources managed by this code. The first is
- * the more familiar array (RMAN_ARRAY) type; resources in this class
- * consist of a sequence of individually-allocatable objects which have
- * been numbered in some well-defined order. Most of the resources
- * are of this type, as it is the most familiar. The second type is
- * called a gauge (RMAN_GAUGE), and models fungible resources (i.e.,
- * resources in which each instance is indistinguishable from every
- * other instance). The principal anticipated application of gauges
- * is in the context of power consumption, where a bus may have a specific
- * power budget which all attached devices share. RMAN_GAUGE is not
- * implemented yet.
- *
- * For array resources, we make one simplifying assumption: two clients
- * sharing the same resource must use the same range of indices. That
- * is to say, sharing of overlapping-but-not-identical regions is not
- * permitted.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/malloc.h>
-#include <sys/rman.h>
-#include <sys/bus.h> /* XXX debugging */
-
-MALLOC_DEFINE(M_RMAN, "rman", "Resource manager");
-
-struct rman_head rman_head;
-#ifndef NULL_SIMPLELOCKS
-static struct simplelock rman_lock; /* mutex to protect rman_head */
-#endif
-static int int_rman_activate_resource(struct rman *rm, struct resource *r,
- struct resource **whohas);
-static int int_rman_release_resource(struct rman *rm, struct resource *r);
-
-#define CIRCLEQ_TERMCOND(var, head) (var == (void *)&(head))
-
-int
-rman_init(struct rman *rm)
-{
- static int once;
-
- if (once == 0) {
- once = 1;
- TAILQ_INIT(&rman_head);
- simple_lock_init(&rman_lock);
- }
-
- if (rm->rm_type == RMAN_UNINIT)
- panic("rman_init");
- if (rm->rm_type == RMAN_GAUGE)
- panic("implement RMAN_GAUGE");
-
- CIRCLEQ_INIT(&rm->rm_list);
- rm->rm_slock = malloc(sizeof *rm->rm_slock, M_RMAN, M_NOWAIT);
- if (rm->rm_slock == 0)
- return ENOMEM;
- simple_lock_init(rm->rm_slock);
-
- simple_lock(&rman_lock);
- TAILQ_INSERT_TAIL(&rman_head, rm, rm_link);
- simple_unlock(&rman_lock);
- return 0;
-}
-
-/*
- * NB: this interface is not robust against programming errors which
- * add multiple copies of the same region.
- */
-int
-rman_manage_region(struct rman *rm, u_long start, u_long end)
-{
- struct resource *r, *s;
-
- r = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (r == 0)
- return ENOMEM;
- r->r_sharehead = 0;
- r->r_start = start;
- r->r_end = end;
- r->r_flags = 0;
- r->r_dev = 0;
- r->r_rm = rm;
-
- simple_lock(rm->rm_slock);
- for (s = rm->rm_list.cqh_first;
- !CIRCLEQ_TERMCOND(s, rm->rm_list) && s->r_end < r->r_start;
- s = s->r_link.cqe_next)
- ;
-
- if (CIRCLEQ_TERMCOND(s, rm->rm_list)) {
- CIRCLEQ_INSERT_TAIL(&rm->rm_list, r, r_link);
- } else {
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, s, r, r_link);
- }
-
- simple_unlock(rm->rm_slock);
- return 0;
-}
-
-int
-rman_fini(struct rman *rm)
-{
- struct resource *r;
-
- simple_lock(rm->rm_slock);
- for (r = rm->rm_list.cqh_first; !CIRCLEQ_TERMCOND(r, rm->rm_list);
- r = r->r_link.cqe_next) {
- if (r->r_flags & RF_ALLOCATED)
- return EBUSY;
- }
-
- /*
- * There really should only be one of these if we are in this
- * state and the code is working properly, but it can't hurt.
- */
- for (r = rm->rm_list.cqh_first; !CIRCLEQ_TERMCOND(r, rm->rm_list);
- r = rm->rm_list.cqh_first) {
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- free(r, M_RMAN);
- }
- simple_unlock(rm->rm_slock);
- simple_lock(&rman_lock);
- TAILQ_REMOVE(&rman_head, rm, rm_link);
- simple_unlock(&rman_lock);
- free(rm->rm_slock, M_RMAN);
-
- return 0;
-}
-
-struct resource *
-rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count,
- u_int flags, struct device *dev)
-{
- u_int want_activate;
- struct resource *r, *s, *rv;
- u_long rstart, rend;
-
- rv = 0;
-
-#ifdef RMAN_DEBUG
- printf("rman_reserve_resource: <%s> request: [%#lx, %#lx], length "
- "%#lx, flags %u, device %s%d\n", rm->rm_descr, start, end,
- count, flags, device_get_name(dev), device_get_unit(dev));
-#endif /* RMAN_DEBUG */
- want_activate = (flags & RF_ACTIVE);
- flags &= ~RF_ACTIVE;
-
- simple_lock(rm->rm_slock);
-
- for (r = rm->rm_list.cqh_first;
- !CIRCLEQ_TERMCOND(r, rm->rm_list) && r->r_end < start;
- r = r->r_link.cqe_next)
- ;
-
- if (CIRCLEQ_TERMCOND(r, rm->rm_list)) {
-#ifdef RMAN_DEBUG
- printf("could not find a region\n");
-#endif RMAN_DEBUG
- goto out;
- }
-
- /*
- * First try to find an acceptable totally-unshared region.
- */
- for (s = r; !CIRCLEQ_TERMCOND(s, rm->rm_list);
- s = s->r_link.cqe_next) {
-#ifdef RMAN_DEBUG
- printf("considering [%#lx, %#lx]\n", s->r_start, s->r_end);
-#endif /* RMAN_DEBUG */
- if (s->r_start > end) {
-#ifdef RMAN_DEBUG
- printf("s->r_start (%#lx) > end (%#lx)\n", s->r_start, end);
-#endif /* RMAN_DEBUG */
- break;
- }
- if (s->r_flags & RF_ALLOCATED) {
-#ifdef RMAN_DEBUG
- printf("region is allocated\n");
-#endif /* RMAN_DEBUG */
- continue;
- }
- rstart = max(s->r_start, start);
- rend = min(s->r_end, max(start + count, end));
-#ifdef RMAN_DEBUG
- printf("truncated region: [%#lx, %#lx]; size %#lx (requested %#lx)\n",
- rstart, rend, (rend - rstart + 1), count);
-#endif /* RMAN_DEBUG */
-
- if ((rend - rstart + 1) >= count) {
-#ifdef RMAN_DEBUG
- printf("candidate region: [%#lx, %#lx], size %#lx\n",
- rend, rstart, (rend - rstart + 1));
-#endif /* RMAN_DEBUG */
- if ((s->r_end - s->r_start + 1) == count) {
-#ifdef RMAN_DEBUG
- printf("candidate region is entire chunk\n");
-#endif /* RMAN_DEBUG */
- rv = s;
- rv->r_flags |= RF_ALLOCATED;
- rv->r_dev = dev;
- goto out;
- }
-
- /*
- * If s->r_start < rstart and
- * s->r_end > rstart + count - 1, then
- * we need to split the region into three pieces
- * (the middle one will get returned to the user).
- * Otherwise, we are allocating at either the
- * beginning or the end of s, so we only need to
- * split it in two. The first case requires
- * two new allocations; the second requires but one.
- */
- rv = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (rv == 0)
- goto out;
- rv->r_start = rstart;
- rv->r_end = rstart + count - 1;
- rv->r_flags = flags | RF_ALLOCATED;
- rv->r_dev = dev;
- rv->r_sharehead = 0;
-
- if (s->r_start < rv->r_start && s->r_end > rv->r_end) {
-#ifdef RMAN_DEBUG
- printf("splitting region in three parts: "
- "[%#lx, %#lx]; [%#lx, %#lx]; [%#lx, %#lx]\n",
- s->r_start, rv->r_start - 1,
- rv->r_start, rv->r_end,
- rv->r_end + 1, s->r_end);
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating in the middle.
- */
- r = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (r == 0) {
- free(rv, M_RMAN);
- rv = 0;
- goto out;
- }
- r->r_start = rv->r_end + 1;
- r->r_end = s->r_end;
- r->r_flags = s->r_flags;
- r->r_dev = 0;
- r->r_sharehead = 0;
- s->r_end = rv->r_start - 1;
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, s, rv,
- r_link);
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, rv, r,
- r_link);
- } else if (s->r_start == rv->r_start) {
-#ifdef RMAN_DEBUG
- printf("allocating from the beginning\n");
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating at the beginning.
- */
- s->r_start = rv->r_end + 1;
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, s, rv,
- r_link);
- } else {
-#ifdef RMAN_DEBUG
- printf("allocating at the end\n");
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating at the end.
- */
- s->r_end = rv->r_start - 1;
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, s, rv,
- r_link);
- }
- goto out;
- }
- }
-
- /*
- * Now find an acceptable shared region, if the client's requirements
- * allow sharing. By our implementation restriction, a candidate
- * region must match exactly by both size and sharing type in order
- * to be considered compatible with the client's request. (The
- * former restriction could probably be lifted without too much
- * additional work, but this does not seem warranted.)
- */
-#ifdef RMAN_DEBUG
- printf("no unshared regions found\n");
-#endif /* RMAN_DEBUG */
- if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0)
- goto out;
-
- for (s = r; !CIRCLEQ_TERMCOND(s, rm->rm_list);
- s = s->r_link.cqe_next) {
- if (s->r_start > end)
- break;
- if ((s->r_flags & flags) != flags)
- continue;
- rstart = max(s->r_start, start);
- rend = min(s->r_end, max(start + count, end));
- if (s->r_start >= start && s->r_end <= end
- && (s->r_end - s->r_start + 1) == count) {
- rv = malloc(sizeof *rv, M_RMAN, M_NOWAIT);
- if (rv == 0)
- goto out;
- rv->r_start = s->r_start;
- rv->r_end = s->r_end;
- rv->r_flags = s->r_flags &
- (RF_ALLOCATED | RF_SHAREABLE | RF_TIMESHARE);
- rv->r_dev = dev;
- rv->r_rm = rm;
- if (s->r_sharehead == 0) {
- s->r_sharehead = malloc(sizeof *s->r_sharehead,
- M_RMAN, M_NOWAIT);
- if (s->r_sharehead == 0) {
- free(rv, M_RMAN);
- rv = 0;
- goto out;
- }
- LIST_INIT(s->r_sharehead);
- LIST_INSERT_HEAD(s->r_sharehead, s,
- r_sharelink);
- s->r_flags = RF_FIRSTSHARE;
- }
- rv->r_sharehead = s->r_sharehead;
- LIST_INSERT_HEAD(s->r_sharehead, rv, r_sharelink);
- goto out;
- }
- }
-
- /*
- * We couldn't find anything.
- */
-out:
- /*
- * If the user specified RF_ACTIVE in the initial flags,
- * which is reflected in `want_activate', we attempt to atomically
- * activate the resource. If this fails, we release the resource
- * and indicate overall failure. (This behavior probably doesn't
- * make sense for RF_TIMESHARE-type resources.)
- */
- if (rv && want_activate) {
- struct resource *whohas;
- if (int_rman_activate_resource(rm, rv, &whohas)) {
- int_rman_release_resource(rm, rv);
- rv = 0;
- }
- }
-
- simple_unlock(rm->rm_slock);
- return (rv);
-}
-
-static int
-int_rman_activate_resource(struct rman *rm, struct resource *r,
- struct resource **whohas)
-{
- struct resource *s;
- int ok;
-
- /*
- * If we are not timesharing, then there is nothing much to do.
- * If we already have the resource, then there is nothing at all to do.
- * If we are not on a sharing list with anybody else, then there is
- * little to do.
- */
- if ((r->r_flags & RF_TIMESHARE) == 0
- || (r->r_flags & RF_ACTIVE) != 0
- || r->r_sharehead == 0) {
- r->r_flags |= RF_ACTIVE;
- return 0;
- }
-
- ok = 1;
- for (s = r->r_sharehead->lh_first; s && ok;
- s = s->r_sharelink.le_next) {
- if ((s->r_flags & RF_ACTIVE) != 0) {
- ok = 0;
- *whohas = s;
- }
- }
- if (ok) {
- r->r_flags |= RF_ACTIVE;
- return 0;
- }
- return EBUSY;
-}
-
-int
-rman_activate_resource(struct resource *r)
-{
- int rv;
- struct resource *whohas;
- struct rman *rm;
-
- rm = r->r_rm;
- simple_lock(rm->rm_slock);
- rv = int_rman_activate_resource(rm, r, &whohas);
- simple_unlock(rm->rm_slock);
- return rv;
-}
-
-int
-rman_await_resource(struct resource *r, int pri, int timo)
-{
- int rv, s;
- struct resource *whohas;
- struct rman *rm;
-
- rm = r->r_rm;
- for (;;) {
- simple_lock(rm->rm_slock);
- rv = int_rman_activate_resource(rm, r, &whohas);
- if (rv != EBUSY)
- return (rv);
-
- if (r->r_sharehead == 0)
- panic("rman_await_resource");
- /*
- * splhigh hopefully will prevent a race between
- * simple_unlock and tsleep where a process
- * could conceivably get in and release the resource
- * before we have a chance to sleep on it.
- */
- s = splhigh();
- whohas->r_flags |= RF_WANTED;
- simple_unlock(rm->rm_slock);
- rv = tsleep(r->r_sharehead, pri, "rmwait", timo);
- if (rv) {
- splx(s);
- return rv;
- }
- simple_lock(rm->rm_slock);
- splx(s);
- }
-}
-
-int
-rman_deactivate_resource(struct resource *r)
-{
- struct rman *rm;
-
- rm = r->r_rm;
- simple_lock(rm->rm_slock);
- r->r_flags &= ~RF_ACTIVE;
- if (r->r_flags & RF_WANTED) {
- r->r_flags &= ~RF_WANTED;
- wakeup(r->r_sharehead);
- }
- simple_unlock(rm->rm_slock);
- return 0;
-}
-
-static int
-int_rman_release_resource(struct rman *rm, struct resource *r)
-{
- struct resource *s, *t;
-
- if (r->r_flags & RF_ACTIVE)
- return EBUSY;
-
- /*
- * Check for a sharing list first. If there is one, then we don't
- * have to think as hard.
- */
- if (r->r_sharehead) {
- /*
- * If a sharing list exists, then we know there are at
- * least two sharers.
- *
- * If we are in the main circleq, appoint someone else.
- */
- LIST_REMOVE(r, r_sharelink);
- s = r->r_sharehead->lh_first;
- if (r->r_flags & RF_FIRSTSHARE) {
- s->r_flags |= RF_FIRSTSHARE;
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, r, s, r_link);
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- }
-
- /*
- * Make sure that the sharing list goes away completely
- * if the resource is no longer being shared at all.
- */
- if (s->r_sharelink.le_next == 0) {
- free(s->r_sharehead, M_RMAN);
- s->r_sharehead = 0;
- s->r_flags &= ~RF_FIRSTSHARE;
- }
- goto out;
- }
-
- /*
- * Look at the adjacent resources in the list and see if our
- * segment can be merged with any of them.
- */
- s = r->r_link.cqe_prev;
- t = r->r_link.cqe_next;
-
- if (s != (void *)&rm->rm_list && (s->r_flags & RF_ALLOCATED) == 0
- && t != (void *)&rm->rm_list && (t->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge all three segments.
- */
- s->r_end = t->r_end;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- CIRCLEQ_REMOVE(&rm->rm_list, t, r_link);
- free(t, M_RMAN);
- } else if (s != (void *)&rm->rm_list
- && (s->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge previous segment with ours.
- */
- s->r_end = r->r_end;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- } else if (t != (void *)&rm->rm_list
- && (t->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge next segment with ours.
- */
- t->r_start = r->r_start;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- } else {
- /*
- * At this point, we know there is nothing we
- * can potentially merge with, because on each
- * side, there is either nothing there or what is
- * there is still allocated. In that case, we don't
- * want to remove r from the list; we simply want to
- * change it to an unallocated region and return
- * without freeing anything.
- */
- r->r_flags &= ~RF_ALLOCATED;
- return 0;
- }
-
-out:
- free(r, M_RMAN);
- return 0;
-}
-
-int
-rman_release_resource(struct resource *r)
-{
- int rv;
- struct rman *rm = r->r_rm;
-
- simple_lock(rm->rm_slock);
- rv = int_rman_release_resource(rm, r);
- simple_unlock(rm->rm_slock);
- return (rv);
-}
diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c
deleted file mode 100644
index 24f8846d5b99..000000000000
--- a/sys/kern/subr_scanf.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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 University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * $Id$
- * From: Id: vfscanf.c,v 1.13 1998/09/25 12:20:27 obrien Exp
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <machine/limits.h>
-
-/*
- * Note that stdarg.h and the ANSI style va_start macro is used for both
- * ANSI and traditional C compilers.
- */
-#include <machine/stdarg.h>
-
-#define BUF 32 /* Maximum length of numeric string. */
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x01 /* l: long or double */
-#define SHORT 0x04 /* h: short */
-#define SUPPRESS 0x08 /* suppress assignment */
-#define POINTER 0x10 /* weird %p pointer (`fake hex') */
-#define NOSKIP 0x20 /* do not skip blanks */
-#define QUAD 0x400
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x40 /* +/- is (still) legal */
-#define NDIGITS 0x80 /* no digits detected */
-
-#define DPTOK 0x100 /* (float) decimal point is still legal */
-#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
-
-#define PFXOK 0x100 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x200 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtoq or strtouq */
-typedef u_quad_t (*ccfntype)(const char *, char **, int);
-
-#define isspace(c) ((c) == ' ' || (c) == '\t' || \
- (c) == '\r' || (c) == '\n')
-#define isascii(c) (((c) & ~0x7f) == 0)
-#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
-#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#define isalpha(c) (isupper(c) || (islower(c)))
-#define isdigit(c) ((c) >= '0' && (c) <= '9')
-
-static u_char *__sccl(char *, u_char *);
-
-int
-sscanf(const char *ibuf, const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = vsscanf(ibuf, fmt, ap);
- va_end(ap);
- return(ret);
-}
-
-int
-vsscanf(const char *inp, char const *fmt0, va_list ap)
-{
- int inr;
- u_char *fmt = (u_char *)fmt0;
- int c; /* character from format, or conversion */
- size_t width; /* field width, or 0 */
- char *p; /* points into all kinds of strings */
- int n; /* handy integer */
- int flags; /* flags as defined above */
- char *p0; /* saves original value of p when necessary */
- int nassigned; /* number of fields assigned */
- int nconversions; /* number of conversions */
- int nread; /* number of characters consumed from fp */
- int base; /* base argument to strtoq/strtouq */
- ccfntype ccfn; /* conversion function (strtoq/strtouq) */
- char ccltab[256]; /* character class table for %[...] */
- char buf[BUF]; /* buffer for numeric conversions */
-
- /* `basefix' is used to avoid `if' tests in the integer scanner */
- static short basefix[17] =
- { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
- inr = strlen(inp);
-
- nassigned = 0;
- nconversions = 0;
- nread = 0;
- base = 0; /* XXX just to keep gcc happy */
- ccfn = NULL; /* XXX just to keep gcc happy */
- for (;;) {
- c = *fmt++;
- if (c == 0)
- return (nassigned);
- if (isspace(c)) {
- while (inr > 0 && isspace(*inp))
- nread++, inr--, inp++;
- continue;
- }
- if (c != '%')
- goto literal;
- width = 0;
- flags = 0;
- /*
- * switch on the format. continue if done;
- * break once format type is derived.
- */
-again: c = *fmt++;
- switch (c) {
- case '%':
-literal:
- if (inr <= 0)
- goto input_failure;
- if (*inp != c)
- goto match_failure;
- inr--, inp++;
- nread++;
- continue;
-
- case '*':
- flags |= SUPPRESS;
- goto again;
- case 'l':
- flags |= LONG;
- goto again;
- case 'q':
- flags |= QUAD;
- goto again;
- case 'h':
- flags |= SHORT;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- width = width * 10 + c - '0';
- goto again;
-
- /*
- * Conversions.
- *
- */
- case 'd':
- c = CT_INT;
- ccfn = (ccfntype)strtoq;
- base = 10;
- break;
-
- case 'i':
- c = CT_INT;
- ccfn = (ccfntype)strtoq;
- base = 0;
- break;
-
- case 'o':
- c = CT_INT;
- ccfn = strtouq;
- base = 8;
- break;
-
- case 'u':
- c = CT_INT;
- ccfn = strtouq;
- base = 10;
- break;
-
- case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
- c = CT_INT;
- ccfn = strtouq;
- base = 16;
- break;
-
- case 's':
- c = CT_STRING;
- break;
-
- case '[':
- fmt = __sccl(ccltab, fmt);
- flags |= NOSKIP;
- c = CT_CCL;
- break;
-
- case 'c':
- flags |= NOSKIP;
- c = CT_CHAR;
- break;
-
- case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
- c = CT_INT;
- ccfn = strtouq;
- base = 16;
- break;
-
- case 'n':
- nconversions++;
- if (flags & SUPPRESS) /* ??? */
- continue;
- if (flags & SHORT)
- *va_arg(ap, short *) = nread;
- else if (flags & LONG)
- *va_arg(ap, long *) = nread;
- else if (flags & QUAD)
- *va_arg(ap, quad_t *) = nread;
- else
- *va_arg(ap, int *) = nread;
- continue;
- }
-
- /*
- * We have a conversion that requires input.
- */
- if (inr <= 0)
- goto input_failure;
-
- /*
- * Consume leading white space, except for formats
- * that suppress this.
- */
- if ((flags & NOSKIP) == 0) {
- while (isspace(*inp)) {
- nread++;
- if (--inr > 0)
- inp++;
- else
- goto input_failure;
- }
- /*
- * Note that there is at least one character in
- * the buffer, so conversions that do not set NOSKIP
- * can no longer result in an input failure.
- */
- }
-
- /*
- * Do the conversion.
- */
- switch (c) {
-
- case CT_CHAR:
- /* scan arbitrary characters (sets NOSKIP) */
- if (width == 0)
- width = 1;
- if (flags & SUPPRESS) {
- size_t sum = 0;
- for (;;) {
- if ((n = inr) < width) {
- sum += n;
- width -= n;
- inp += n;
- if (sum == 0)
- goto input_failure;
- break;
- } else {
- sum += width;
- inr -= width;
- inp += width;
- break;
- }
- }
- nread += sum;
- } else {
- bcopy(inp, va_arg(ap, char *), width);
- inr -= width;
- inp += width;
- nread += width;
- nassigned++;
- }
- nconversions++;
- break;
-
- case CT_CCL:
- /* scan a (nonempty) character class (sets NOSKIP) */
- if (width == 0)
- width = (size_t)~0; /* `infinity' */
- /* take only those things in the class */
- if (flags & SUPPRESS) {
- n = 0;
- while (ccltab[*inp]) {
- n++, inr--, inp++;
- if (--width == 0)
- break;
- if (inr <= 0) {
- if (n == 0)
- goto input_failure;
- break;
- }
- }
- if (n == 0)
- goto match_failure;
- } else {
- p0 = p = va_arg(ap, char *);
- while (ccltab[*inp]) {
- inr--;
- *p++ = *inp++;
- if (--width == 0)
- break;
- if (inr <= 0) {
- if (p == p0)
- goto input_failure;
- break;
- }
- }
- n = p - p0;
- if (n == 0)
- goto match_failure;
- *p = 0;
- nassigned++;
- }
- nread += n;
- nconversions++;
- break;
-
- case CT_STRING:
- /* like CCL, but zero-length string OK, & no NOSKIP */
- if (width == 0)
- width = (size_t)~0;
- if (flags & SUPPRESS) {
- n = 0;
- while (!isspace(*inp)) {
- n++, inr--, inp++;
- if (--width == 0)
- break;
- if (inr <= 0)
- break;
- }
- nread += n;
- } else {
- p0 = p = va_arg(ap, char *);
- while (!isspace(*inp)) {
- inr--;
- *p++ = *inp++;
- if (--width == 0)
- break;
- if (inr <= 0)
- break;
- }
- *p = 0;
- nread += p - p0;
- nassigned++;
- }
- nconversions++;
- continue;
-
- case CT_INT:
- /* scan an integer as if by strtoq/strtouq */
-#ifdef hardway
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
-#else
- /* size_t is unsigned, hence this optimisation */
- if (--width > sizeof(buf) - 2)
- width = sizeof(buf) - 2;
- width++;
-#endif
- flags |= SIGNOK | NDIGITS | NZDIGITS;
- for (p = buf; width; width--) {
- c = *inp;
- /*
- * Switch on the character; `goto ok'
- * if we accept it as a part of number.
- */
- switch (c) {
-
- /*
- * The digit 0 is always legal, but is
- * special. For %i conversions, if no
- * digits (zero or nonzero) have been
- * scanned (only signs), we will have
- * base==0. In that case, we should set
- * it to 8 and enable 0x prefixing.
- * Also, if we have not scanned zero digits
- * before this, do not turn off prefixing
- * (someone else will turn it off if we
- * have scanned any nonzero digits).
- */
- case '0':
- if (base == 0) {
- base = 8;
- flags |= PFXOK;
- }
- if (flags & NZDIGITS)
- flags &= ~(SIGNOK|NZDIGITS|NDIGITS);
- else
- flags &= ~(SIGNOK|PFXOK|NDIGITS);
- goto ok;
-
- /* 1 through 7 always legal */
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- base = basefix[base];
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* digits 8 and 9 ok iff decimal or hex */
- case '8': case '9':
- base = basefix[base];
- if (base <= 8)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* letters ok iff hex */
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- /* no need to fix base here */
- if (base <= 10)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* sign ok only as first character */
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto ok;
- }
- break;
-
- /* x ok iff flag still set & 2nd char */
- case 'x': case 'X':
- if (flags & PFXOK && p == buf + 1) {
- base = 16; /* if %i */
- flags &= ~PFXOK;
- goto ok;
- }
- break;
- }
-
- /*
- * If we got here, c is not a legal character
- * for a number. Stop accumulating digits.
- */
- break;
- ok:
- /*
- * c is legal: store it and look at the next.
- */
- *p++ = c;
- if (--inr > 0)
- inp++;
- else
- break; /* end of input */
- }
- /*
- * If we had only a sign, it is no good; push
- * back the sign. If the number ends in `x',
- * it was [sign] '0' 'x', so push back the x
- * and treat it as [sign] '0'.
- */
- if (flags & NDIGITS) {
- if (p > buf) {
- inp--;
- inr++;
- }
- goto match_failure;
- }
- c = ((u_char *)p)[-1];
- if (c == 'x' || c == 'X') {
- --p;
- inp--;
- inr++;
- }
- if ((flags & SUPPRESS) == 0) {
- u_quad_t res;
-
- *p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
- if (flags & POINTER)
- *va_arg(ap, void **) =
- (void *)(u_long)res;
- else if (flags & SHORT)
- *va_arg(ap, short *) = res;
- else if (flags & LONG)
- *va_arg(ap, long *) = res;
- else if (flags & QUAD)
- *va_arg(ap, quad_t *) = res;
- else
- *va_arg(ap, int *) = res;
- nassigned++;
- }
- nread += p - buf;
- nconversions++;
- break;
-
- }
- }
-input_failure:
- return (nconversions != 0 ? nassigned : -1);
-match_failure:
- return (nassigned);
-}
-
-/*
- * Fill in the given table from the scanset at the given format
- * (just after `['). Return a pointer to the character past the
- * closing `]'. The table has a 1 wherever characters should be
- * considered part of the scanset.
- */
-static u_char *
-__sccl(char *tab, u_char *fmt)
-{
- int c, n, v;
-
- /* first `clear' the whole table */
- c = *fmt++; /* first char hat => negated scanset */
- if (c == '^') {
- v = 1; /* default => accept */
- c = *fmt++; /* get new first char */
- } else
- v = 0; /* default => reject */
-
- /* XXX: Will not work if sizeof(tab*) > sizeof(char) */
- for (n = 0; n < 256; n++)
- tab[n] = v; /* memset(tab, v, 256) */
-
- if (c == 0)
- return (fmt - 1);/* format ended before closing ] */
-
- /*
- * Now set the entries corresponding to the actual scanset
- * to the opposite of the above.
- *
- * The first character may be ']' (or '-') without being special;
- * the last character may be '-'.
- */
- v = 1 - v;
- for (;;) {
- tab[c] = v; /* take character c */
-doswitch:
- n = *fmt++; /* and examine the next */
- switch (n) {
-
- case 0: /* format ended too soon */
- return (fmt - 1);
-
- case '-':
- /*
- * A scanset of the form
- * [01+-]
- * is defined as `the digit 0, the digit 1,
- * the character +, the character -', but
- * the effect of a scanset such as
- * [a-zA-Z0-9]
- * is implementation defined. The V7 Unix
- * scanf treats `a-z' as `the letters a through
- * z', but treats `a-a' as `the letter a, the
- * character -, and the letter a'.
- *
- * For compatibility, the `-' is not considerd
- * to define a range if the character following
- * it is either a close bracket (required by ANSI)
- * or is not numerically greater than the character
- * we just stored in the table (c).
- */
- n = *fmt;
- if (n == ']' || n < c) {
- c = '-';
- break; /* resume the for(;;) */
- }
- fmt++;
- /* fill in the range */
- do {
- tab[++c] = v;
- } while (c < n);
- c = n;
- /*
- * Alas, the V7 Unix scanf also treats formats
- * such as [a-c-e] as `the letters a through e'.
- * This too is permitted by the standard....
- */
- goto doswitch;
- break;
-
- case ']': /* end of scanset */
- return (fmt);
-
- default: /* just another character */
- c = n;
- break;
- }
- }
- /* NOTREACHED */
-}
-
-/*
- * Convert a string to an unsigned quad integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-u_quad_t
-strtouq(const char *nptr, char **endptr, int base)
-{
- const char *s = nptr;
- u_quad_t acc;
- unsigned char c;
- u_quad_t qbase, cutoff;
- int neg, any, cutlim;
-
- /*
- * See strtoq for comments as to the logic used.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- qbase = (unsigned)base;
- cutoff = (u_quad_t)UQUAD_MAX / qbase;
- cutlim = (u_quad_t)UQUAD_MAX % qbase;
- for (acc = 0, any = 0;; c = *s++) {
- if (!isascii(c))
- break;
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= qbase;
- acc += c;
- }
- }
- if (any < 0) {
- acc = UQUAD_MAX;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
-
-/*
- * Convert a string to a quad integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-quad_t
-strtoq(const char *nptr, char **endptr, int base)
-{
- const char *s;
- u_quad_t acc;
- unsigned char c;
- u_quad_t qbase, cutoff;
- int neg, any, cutlim;
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
-
- /*
- * Compute the cutoff value between legal numbers and illegal
- * numbers. That is the largest legal value, divided by the
- * base. An input number that is greater than this value, if
- * followed by a legal input character, is too big. One that
- * is equal to this value may be valid or not; the limit
- * between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for quads is
- * [-9223372036854775808..9223372036854775807] and the input base
- * is 10, cutoff will be set to 922337203685477580 and cutlim to
- * either 7 (neg==0) or 8 (neg==1), meaning that if we have
- * accumulated a value > 922337203685477580, or equal but the
- * next digit is > 7 (or 8), the number is too big, and we will
- * return a range error.
- *
- * Set any if any `digits' consumed; make it negative to indicate
- * overflow.
- */
- qbase = (unsigned)base;
- cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
- cutlim = cutoff % qbase;
- cutoff /= qbase;
- for (acc = 0, any = 0;; c = *s++) {
- if (!isascii(c))
- break;
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= qbase;
- acc += c;
- }
- }
- if (any < 0) {
- acc = neg ? QUAD_MIN : QUAD_MAX;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c
index 7ff33668c2a9..e803032bdae7 100644
--- a/sys/kern/subr_xxx.c
+++ b/sys/kern/subr_xxx.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_xxx.c,v 1.11 1998/08/20 06:10:40 bde Exp $
+ * $Id: subr_xxx.c,v 1.10 1998/06/07 17:11:38 dfr Exp $
*/
/*
@@ -161,7 +161,7 @@ nodevtotty(dev)
int
nommap(dev, offset, nprot)
dev_t dev;
- vm_offset_t offset;
+ int offset;
int nprot;
{
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 8d90ee9bdc2e..bb8f7a3a70b0 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
- * $Id: sys_generic.c,v 1.42 1998/11/11 10:03:55 truckman Exp $
+ * $Id: sys_generic.c,v 1.40 1998/08/24 08:39:38 dfr Exp $
*/
#include "opt_ktrace.h"
@@ -469,6 +469,37 @@ ioctl(p, uap)
error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p);
break;
+ case FIOSETOWN:
+ tmp = *(int *)data;
+ if (fp->f_type == DTYPE_SOCKET) {
+ ((struct socket *)fp->f_data)->so_pgid = tmp;
+ error = 0;
+ break;
+ }
+ if (tmp <= 0) {
+ tmp = -tmp;
+ } else {
+ struct proc *p1 = pfind(tmp);
+ if (p1 == 0) {
+ error = ESRCH;
+ break;
+ }
+ tmp = p1->p_pgrp->pg_id;
+ }
+ error = (*fp->f_ops->fo_ioctl)
+ (fp, (int)TIOCSPGRP, (caddr_t)&tmp, p);
+ break;
+
+ case FIOGETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ error = 0;
+ *(int *)data = ((struct socket *)fp->f_data)->so_pgid;
+ break;
+ }
+ error = (*fp->f_ops->fo_ioctl)(fp, (int)TIOCGPGRP, data, p);
+ *(int *)data = -*(int *)data;
+ break;
+
default:
error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
/*
@@ -762,11 +793,9 @@ pollscan(p, fds, nfd)
int n = 0;
for (i = 0; i < nfd; i++, fds++) {
- if (fds->fd >= fdp->fd_nfiles) {
+ if ((u_int)fds->fd >= fdp->fd_nfiles) {
fds->revents = POLLNVAL;
n++;
- } else if (fds->fd < 0) {
- fds->revents = 0;
} else {
fp = fdp->fd_ofiles[fds->fd];
if (fp == 0) {
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 29e1e97a7aad..9b60e26c2543 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: sys_pipe.c,v 1.45 1998/11/11 10:03:55 truckman Exp $
+ * $Id: sys_pipe.c,v 1.42 1998/06/07 17:11:39 dfr Exp $
*/
/*
@@ -256,6 +256,7 @@ pipeinit(cpipe)
cpipe->pipe_atime = cpipe->pipe_ctime;
cpipe->pipe_mtime = cpipe->pipe_ctime;
bzero(&cpipe->pipe_sel, sizeof cpipe->pipe_sel);
+ cpipe->pipe_pgid = NO_PID;
#ifndef PIPE_NODIRECT
/*
@@ -308,12 +309,18 @@ static __inline void
pipeselwakeup(cpipe)
struct pipe *cpipe;
{
+ struct proc *p;
+
if (cpipe->pipe_state & PIPE_SEL) {
cpipe->pipe_state &= ~PIPE_SEL;
selwakeup(&cpipe->pipe_sel);
}
- if ((cpipe->pipe_state & PIPE_ASYNC) && cpipe->pipe_sigio)
- pgsigio(cpipe->pipe_sigio, SIGIO, 0);
+ if (cpipe->pipe_state & PIPE_ASYNC) {
+ if (cpipe->pipe_pgid < 0)
+ gsignal(-cpipe->pipe_pgid, SIGIO);
+ else if ((p = pfind(cpipe->pipe_pgid)) != NULL)
+ psignal(p, SIGIO);
+ }
}
/* ARGSUSED */
@@ -495,7 +502,7 @@ pipe_build_write_buffer(wpipe, uio)
if (!paddr) {
int j;
for(j=0;j<i;j++)
- vm_page_unwire(wpipe->pipe_map.ms[j], 1);
+ vm_page_unwire(wpipe->pipe_map.ms[j]);
return EFAULT;
}
@@ -559,7 +566,7 @@ struct pipe *wpipe;
}
}
for (i=0;i<wpipe->pipe_map.npages;i++)
- vm_page_unwire(wpipe->pipe_map.ms[i], 1);
+ vm_page_unwire(wpipe->pipe_map.ms[i]);
}
/*
@@ -946,20 +953,12 @@ pipe_ioctl(fp, cmd, data, p)
*(int *)data = mpipe->pipe_buffer.cnt;
return (0);
- case FIOSETOWN:
- return (fsetown(*(int *)data, &mpipe->pipe_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(mpipe->pipe_sigio);
- return (0);
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &mpipe->pipe_sigio));
+ mpipe->pipe_pgid = *(int *)data;
+ return (0);
- /* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)data = -fgetown(mpipe->pipe_sigio);
+ *(int *)data = mpipe->pipe_pgid;
return (0);
}
@@ -1039,7 +1038,6 @@ pipe_close(fp, p)
{
struct pipe *cpipe = (struct pipe *)fp->f_data;
- funsetown(cpipe->pipe_sigio);
pipeclose(cpipe);
fp->f_data = NULL;
return 0;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 475612703965..330a2d68c9ee 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sys_process.c,v 1.40 1998/07/29 18:41:30 dfr Exp $
+ * $Id: sys_process.c,v 1.39 1998/07/15 04:43:49 bde Exp $
*/
#include <sys/param.h>
@@ -407,10 +407,7 @@ ptrace(curp, uap)
return (error);
case PT_READ_U:
- if ((uintptr_t)uap->addr > UPAGES * PAGE_SIZE - sizeof(int)) {
- return EFAULT;
- }
- if ((uintptr_t)uap->addr & (sizeof(int) - 1)) {
+ if ((uintptr_t)uap->addr > UPAGES * PAGE_SIZE - sizeof(long)) {
return EFAULT;
}
if (ptrace_read_u_check(p,(vm_offset_t) uap->addr,
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 8cf30cdcaf55..5b65bea89362 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)sys_socket.c 8.1 (Berkeley) 6/10/93
- * $Id: sys_socket.c,v 1.18 1998/06/07 17:11:40 dfr Exp $
+ * $Id: sys_socket.c,v 1.17 1998/03/28 10:33:07 bde Exp $
*/
#include <sys/param.h>
@@ -44,7 +44,6 @@
#include <sys/sockio.h>
#include <sys/stat.h>
#include <sys/uio.h>
-#include <sys/filedesc.h>
#include <net/if.h>
#include <net/route.h>
@@ -115,18 +114,12 @@ soo_ioctl(fp, cmd, data, p)
*(int *)data = so->so_rcv.sb_cc;
return (0);
- case FIOSETOWN:
- return (fsetown(*(int *)data, &so->so_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(so->so_sigio);
- return (0);
-
case SIOCSPGRP:
- return (fsetown(-(*(int *)data), &so->so_sigio));
+ so->so_pgid = *(int *)data;
+ return (0);
case SIOCGPGRP:
- *(int *)data = -fgetown(so->so_sigio);
+ *(int *)data = so->so_pgid;
return (0);
case SIOCATMARK:
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 22e9e8ecf854..781cf4c6c739 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
char *syscallnames[] = {
@@ -342,6 +342,4 @@ char *syscallnames[] = {
"sched_get_priority_min", /* 333 = sched_get_priority_min */
"sched_rr_get_interval", /* 334 = sched_rr_get_interval */
"utrace", /* 335 = utrace */
- "sendfile", /* 336 = sendfile */
- "kldsym", /* 337 = kldsym */
};
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 677236325090..769988b97826 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
- $Id: syscalls.master,v 1.54 1998/11/05 14:28:24 dg Exp $
+ $Id: syscalls.master,v 1.52 1998/06/07 17:11:40 dfr Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
;
; System call name/number master file.
@@ -468,6 +468,3 @@
333 STD POSIX { int sched_get_priority_min (int policy); }
334 STD POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
335 STD BSD { int utrace(caddr_t addr, size_t len); }
-336 STD BSD { int sendfile(int fd, int s, off_t offset, size_t nbytes, \
- struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
-337 STD BSD { int kldsym(int fileid, int cmd, void *data); }
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index fb04c42b029a..d35bbca0b818 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $Id: sysv_sem.c,v 1.21 1998/03/30 09:50:41 phk Exp $ */
+/* $Id: sysv_sem.c,v 1.20 1997/11/06 19:29:24 phk Exp $ */
/*
* Implementation of SVID semaphores
@@ -276,7 +276,7 @@ semundo_adjust(p, supptr, semid, semnum, adjval)
/* Didn't find the right entry - create it */
if (adjval == 0)
return(0);
- if (suptr->un_cnt != seminfo.semume) {
+ if (suptr->un_cnt != SEMUME) {
sunptr = &suptr->un_ent[suptr->un_cnt];
suptr->un_cnt++;
sunptr->un_adjval = adjval;
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 1adf784ddfe1..7d34873e2e4d 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.110 1998/12/08 10:22:07 bde Exp $
+ * $Id: tty.c,v 1.105 1998/07/11 10:41:15 bde Exp $
*/
/*-
@@ -58,8 +58,8 @@
* than TTYDISC. Cancel their effects before switch disciplines
* and ignore them if they are set while we are in another
* discipline.
- * o Now that historical speed conversions are handled here, don't
- * do them in drivers.
+ * o Handle c_ispeed = 0 to c_ispeed = c_ospeed conversion here instead
+ * of in drivers and fix drivers that write to tp->t_termios.
* o Check for TS_CARR_ON being set while everything is closed and not
* waiting for carrier. TS_CARR_ON isn't cleared if nothing is open,
* so it would live until the next open even if carrier drops.
@@ -90,7 +90,6 @@
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/malloc.h>
-#include <sys/filedesc.h>
#if NSNP > 0
#include <sys/snoop.h>
#endif
@@ -231,7 +230,6 @@ ttyclose(tp)
{
int s;
- funsetown(tp->t_sigio);
s = spltty();
if (constty == tp)
constty = NULL;
@@ -706,27 +704,16 @@ ttioctl(tp, cmd, data, flag)
/* If the ioctl involves modification, hang if in the background. */
switch (cmd) {
- case TIOCCBRK:
- case TIOCCONS:
- case TIOCDRAIN:
- case TIOCEXCL:
case TIOCFLUSH:
-#ifdef TIOCHPCL
- case TIOCHPCL:
-#endif
- case TIOCNXCL:
- case TIOCSBRK:
- case TIOCSCTTY:
- case TIOCSDRAINWAIT:
case TIOCSETA:
+ case TIOCSETD:
case TIOCSETAF:
case TIOCSETAW:
- case TIOCSETD:
+#ifdef notdef
case TIOCSPGRP:
- case TIOCSTART:
+#endif
case TIOCSTAT:
case TIOCSTI:
- case TIOCSTOP:
case TIOCSWINSZ:
#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
case TIOCLBIC:
@@ -769,25 +756,6 @@ ttioctl(tp, cmd, data, flag)
*(int *)data = ttnread(tp);
splx(s);
break;
-
- case FIOSETOWN:
- /*
- * Policy -- Don't allow FIOSETOWN on someone else's
- * controlling tty
- */
- if (tp->t_session != NULL && !isctty(p, tp))
- return (ENOTTY);
-
- error = fsetown(*(int *)data, &tp->t_sigio);
- if (error)
- return (error);
- break;
- case FIOGETOWN:
- if (tp->t_session != NULL && !isctty(p, tp))
- return (ENOTTY);
- *(int *)data = fgetown(tp->t_sigio);
- break;
-
case TIOCEXCL: /* set exclusive use of tty */
s = spltty();
SET(tp->t_state, TS_XCLUDE);
@@ -858,11 +826,7 @@ ttioctl(tp, cmd, data, flag)
case TIOCSETAF: { /* drn out, fls in, set */
register struct termios *t = (struct termios *)data;
- if (t->c_ispeed == 0)
- t->c_ispeed = t->c_ospeed;
- if (t->c_ispeed == 0)
- t->c_ispeed = tp->t_ospeed;
- if (t->c_ispeed == 0)
+ if (t->c_ispeed < 0 || t->c_ospeed < 0)
return (EINVAL);
s = spltty();
if (cmd == TIOCSETAW || cmd == TIOCSETAF) {
@@ -904,8 +868,7 @@ ttioctl(tp, cmd, data, flag)
CLR(tp->t_state, TS_CONNECTED);
tp->t_cflag = t->c_cflag;
tp->t_ispeed = t->c_ispeed;
- if (t->c_ospeed != 0)
- tp->t_ospeed = t->c_ospeed;
+ tp->t_ospeed = t->c_ospeed;
ttsetwater(tp);
}
if (ISSET(t->c_lflag, ICANON) != ISSET(tp->t_lflag, ICANON) &&
@@ -1310,8 +1273,10 @@ ttrstrt(tp_arg)
struct tty *tp;
int s;
- KASSERT(tp_arg != NULL, ("ttrstrt"));
-
+#ifdef DIAGNOSTIC
+ if (tp_arg == NULL)
+ panic("ttrstrt");
+#endif
tp = tp_arg;
s = spltty();
@@ -1449,7 +1414,6 @@ ttread(tp, uio, flag)
int s, first, error = 0;
int has_stime = 0, last_cc = 0;
long slp = 0; /* XXX this should be renamed `timo'. */
- struct timeval stime;
loop:
s = spltty();
@@ -1506,7 +1470,7 @@ loop:
if (!ISSET(lflag, ICANON)) {
int m = cc[VMIN];
long t = cc[VTIME];
- struct timeval timecopy;
+ struct timeval stime, timecopy;
/*
* Check each of the four combinations.
@@ -2118,8 +2082,8 @@ ttwakeup(tp)
if (tp->t_rsel.si_pid != 0)
selwakeup(&tp->t_rsel);
- if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
- pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
+ if (ISSET(tp->t_state, TS_ASYNC))
+ pgsignal(tp->t_pgrp, SIGIO, 1);
wakeup(TSA_HUP_OR_INPUT(tp));
}
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index ba71a949fb3b..c4b13e575e25 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -135,8 +135,10 @@ snpread(dev, uio, flag)
caddr_t from;
char *nbuf;
- KASSERT(snp->snp_len + snp->snp_base <= snp->snp_blen,
- ("snoop buffer error"));
+#ifdef DIAGNOSTIC
+ if ((snp->snp_len + snp->snp_base) > snp->snp_blen)
+ panic("snoop buffer error");
+#endif
if (snp->snp_tty == NULL)
return (EIO);
@@ -206,12 +208,14 @@ snpin(snp, buf, n)
caddr_t from, to;
char *nbuf;
- KASSERT(n >= 0, ("negative snoop char count"));
if (n == 0)
return 0;
#ifdef DIAGNOSTIC
+ if (n < 0)
+ panic("bad snoop char count");
+
if (!(snp->snp_flags & SNOOP_OPEN)) {
printf("Snoop: data coming to closed device.\n");
return 0;
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index 929da87ba79d..22078b1c3f3d 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id: uipc_domain.c,v 1.19 1998/05/15 20:11:29 wollman Exp $
+ * $Id: uipc_domain.c,v 1.18 1997/09/16 11:43:36 bde Exp $
*/
#include <sys/param.h>
@@ -52,7 +52,7 @@
* want to call a registration function rather than being handled here
* in domaininit(). Probably this will look like:
*
- * SYSINIT(unique, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, domain_add, xxx)
+ * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
*
* Where 'xxx' is replaced by the address of a parameter struct to be
* passed to the doamin_add() function.
@@ -71,64 +71,21 @@ static void pfslowtimo __P((void *));
struct domain *domains;
-/*
- * Add a new protocol domain to the list of supported domains
- * Note: you cant unload it again because a socket may be using it.
- * XXX can't fail at this time.
- */
-static int
-net_init_domain(struct domain *dp)
-{
- register struct protosw *pr;
- int s;
-
- s = splnet();
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
- if (pr->pr_usrreqs == 0)
- panic("domaininit: %ssw[%d] has no usrreqs!",
- dp->dom_name,
- (int)(pr - dp->dom_protosw));
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- /*
- * update global informatio about maximums
- */
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- splx(s);
- return (0);
-}
-
-/*
- * Add a new protocol domain to the list of supported domains
- * Note: you cant unload it again because a socket may be using it.
- * XXX can't fail at this time.
- */
-int
-net_add_domain(struct domain *dp)
-{
- int s, error;
-
- s = splnet();
- dp->dom_next = domains;
- domains = dp;
- splx(s);
- error = net_init_domain(dp);
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- return (error);
+#define ADDDOMAIN(x) { \
+ __CONCAT(x,domain.dom_next) = domains; \
+ domains = &__CONCAT(x,domain); \
}
extern struct linker_set domain_set;
/* ARGSUSED*/
static void
-domaininit(void *dummy)
+domaininit(dummy)
+ void *dummy;
{
register struct domain *dp, **dpp;
+ register struct protosw *pr;
+
/*
* Before we do any setup, make sure to initialize the
* zone allocator we get struct sockets from. The obvious
@@ -144,33 +101,33 @@ domaininit(void *dummy)
socket_zone = zinit("socket", sizeof(struct socket), maxsockets,
ZONE_INTERRUPT, 0);
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
-
/*
* NB - local domain is always present.
*/
- net_add_domain(&localdomain);
+ ADDDOMAIN(local);
- /*
- * gather up as many protocols as we have statically linked.
- * XXX we need to do this because when we ask the routing
- * protocol to initialise it will want to examine all
- * installed protocols. This needs fixing before protocols
- * that use the standard routing can become modules.
- */
for (dpp = (struct domain **)domain_set.ls_items; *dpp; dpp++) {
(**dpp).dom_next = domains;
domains = *dpp;
}
- /*
- * Now ask them all to init (XXX including the routing domain,
- * see above)
- */
- for (dp = domains; dp; dp = dp->dom_next)
- net_init_domain(dp);
+ for (dp = domains; dp; dp = dp->dom_next) {
+ if (dp->dom_init)
+ (*dp->dom_init)();
+ for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
+ if (pr->pr_usrreqs == 0)
+ panic("domaininit: %ssw[%d] has no usrreqs!",
+ dp->dom_name,
+ (int)(pr - dp->dom_protosw));
+ if (pr->pr_init)
+ (*pr->pr_init)();
+ }
+ }
+ if (max_linkhdr < 16) /* XXX */
+ max_linkhdr = 16;
+ max_hdr = max_linkhdr + max_protohdr;
+ max_datalen = MHLEN - max_hdr;
timeout(pffasttimo, (void *)0, 1);
timeout(pfslowtimo, (void *)0, 1);
}
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 1efa8c531b3c..05d312f65302 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id: uipc_socket.c,v 1.50 1999/01/20 17:31:54 fenner Exp $
+ * $Id: uipc_socket.c,v 1.44 1998/08/31 15:34:55 wollman Exp $
*/
#include <sys/param.h>
@@ -218,7 +218,6 @@ soclose(so)
int s = splnet(); /* conservative */
int error = 0;
- funsetown(so->so_sigio);
if (so->so_options & SO_ACCEPTCONN) {
struct socket *sp, *sonext;
@@ -529,9 +528,7 @@ nopages:
((flags & MSG_EOF) &&
(so->so_proto->pr_flags & PR_IMPLOPCL) &&
(resid <= 0)) ?
- PRUS_EOF :
- /* If there is more to send set PRUS_MORETOCOME */
- (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0,
+ PRUS_EOF : 0,
top, addr, control, p);
splx(s);
if (dontroute)
@@ -639,7 +636,10 @@ restart:
(so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
- KASSERT(m != 0 || !so->so_rcv.sb_cc, ("receive 1"));
+#ifdef DIAGNOSTIC
+ if (m == 0 && so->so_rcv.sb_cc)
+ panic("receive 1");
+#endif
if (so->so_error) {
if (m)
goto dontblock;
@@ -682,7 +682,10 @@ dontblock:
uio->uio_procp->p_stats->p_ru.ru_msgrcv++;
nextrecord = m->m_nextpkt;
if (pr->pr_flags & PR_ADDR) {
- KASSERT(m->m_type == MT_SONAME, ("receive 1a"));
+#ifdef DIAGNOSTIC
+ if (m->m_type != MT_SONAME)
+ panic("receive 1a");
+#endif
orig_resid = 0;
if (psa)
*psa = dup_sockaddr(mtod(m, struct sockaddr *),
@@ -736,9 +739,10 @@ dontblock:
break;
} else if (type == MT_OOBDATA)
break;
- else
- KASSERT(m->m_type == MT_DATA || m->m_type == MT_HEADER,
- ("receive 3"));
+#ifdef DIAGNOSTIC
+ else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
+ panic("receive 3");
+#endif
so->so_state &= ~SS_RCVATMARK;
len = uio->uio_resid;
if (so->so_oobmark && len > so->so_oobmark - offset)
@@ -1176,8 +1180,12 @@ void
sohasoutofband(so)
register struct socket *so;
{
- if (so->so_sigio != NULL)
- pgsigio(so->so_sigio, SIGURG, 0);
+ struct proc *p;
+
+ if (so->so_pgid < 0)
+ gsignal(-so->so_pgid, SIGURG);
+ else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
+ psignal(p, SIGURG);
selwakeup(&so->so_rcv.sb_sel);
}
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index e718c62bd5cb..a7405d97a191 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id: uipc_socket2.c,v 1.42 1998/11/23 00:45:38 truckman Exp $
+ * $Id: uipc_socket2.c,v 1.38 1998/09/04 13:13:18 ache Exp $
*/
#include <sys/param.h>
@@ -213,6 +213,7 @@ sonewconn(head, connstatus)
so->so_state = head->so_state | SS_NOFDREF;
so->so_proto = head->so_proto;
so->so_timeo = head->so_timeo;
+ so->so_pgid = head->so_pgid;
so->so_uid = head->so_uid;
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
@@ -312,14 +313,20 @@ sowakeup(so, sb)
register struct socket *so;
register struct sockbuf *sb;
{
+ struct proc *p;
+
selwakeup(&sb->sb_sel);
sb->sb_flags &= ~SB_SEL;
if (sb->sb_flags & SB_WAIT) {
sb->sb_flags &= ~SB_WAIT;
wakeup((caddr_t)&sb->sb_cc);
}
- if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL)
- pgsigio(so->so_sigio, SIGIO, 0);
+ if (so->so_state & SS_ASYNC) {
+ if (so->so_pgid < 0)
+ gsignal(-so->so_pgid, SIGIO);
+ else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
+ psignal(p, SIGIO);
+ }
if (sb->sb_flags & SB_UPCALL)
(*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT);
}
@@ -470,20 +477,18 @@ sbcheck(sb)
register struct sockbuf *sb;
{
register struct mbuf *m;
- register struct mbuf *n = 0;
- register u_long len = 0, mbcnt = 0;
+ register int len = 0, mbcnt = 0;
- for (m = sb->sb_mb; m; m = n) {
- n = m->m_nextpkt;
- for (; m; m = m->m_next) {
+ for (m = sb->sb_mb; m; m = m->m_next) {
len += m->m_len;
mbcnt += MSIZE;
if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
mbcnt += m->m_ext.ext_size;
- }
+ if (m->m_nextpkt)
+ panic("sbcheck nextpkt");
}
if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %ld != %ld || mbcnt %ld != %ld\n", len, sb->sb_cc,
+ printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
mbcnt, sb->sb_mbcnt);
panic("sbcheck");
}
@@ -715,10 +720,10 @@ sbflush(sb)
if (sb->sb_flags & SB_LOCK)
panic("sbflush: locked");
- while (sb->sb_mbcnt && sb->sb_cc)
+ while (sb->sb_mbcnt)
sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt)
- panic("sbflush: cc %ld || mb %p || mbcnt %ld", sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt);
+ if (sb->sb_cc || sb->sb_mb)
+ panic("sbflush: cc %ld || mb %p", sb->sb_cc, (void *)sb->sb_mb);
}
/*
@@ -911,7 +916,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
xso->so_qlimit = so->so_qlimit;
xso->so_timeo = so->so_timeo;
xso->so_error = so->so_error;
- xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0;
+ xso->so_pgid = so->so_pgid;
xso->so_oobmark = so->so_oobmark;
sbtoxsockbuf(&so->so_snd, &xso->so_snd);
sbtoxsockbuf(&so->so_rcv, &xso->so_rcv);
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 6cc487ad8cdf..a841bfad18c7 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -2,9 +2,6 @@
* Copyright (c) 1982, 1986, 1989, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
- * sendfile(2) and related extensions:
- * Copyright (c) 1998, David Greenman. All rights reserved.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
- * $Id: uipc_syscalls.c,v 1.48 1998/12/03 12:35:47 dg Exp $
+ * $Id: uipc_syscalls.c,v 1.40 1998/06/10 10:30:23 dfr Exp $
*/
#include "opt_compat.h"
@@ -42,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/sysproto.h>
#include <sys/malloc.h>
#include <sys/filedesc.h>
@@ -55,27 +51,9 @@
#include <sys/socketvar.h>
#include <sys/signalvar.h>
#include <sys/uio.h>
-#include <sys/vnode.h>
-#include <sys/lock.h>
-#include <sys/mount.h>
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
-#include <vm/vm.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_object.h>
-#include <vm/vm_page.h>
-#include <vm/vm_pager.h>
-#include <vm/vm_pageout.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-#include <machine/limits.h>
-
-static void sf_buf_init(void *arg);
-SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL)
-static struct sf_buf *sf_buf_alloc(void);
-static void sf_buf_ref(caddr_t addr, u_int size);
-static void sf_buf_free(caddr_t addr, u_int size);
static int sendit __P((struct proc *p, int s, struct msghdr *mp, int flags));
static int recvit __P((struct proc *p, int s, struct msghdr *mp,
@@ -87,11 +65,6 @@ static int getsockname1 __P((struct proc *p, struct getsockname_args *uap,
static int getpeername1 __P((struct proc *p, struct getpeername_args *uap,
int compat));
-static SLIST_HEAD(, sf_buf) sf_freelist;
-static vm_offset_t sf_base;
-static struct sf_buf *sf_bufs;
-static int sf_buf_alloc_want;
-
/*
* System call interface to the socket abstraction.
*/
@@ -260,8 +233,6 @@ accept1(p, uap, compat)
so->so_state &= ~SS_COMP;
so->so_head = NULL;
- if (head->so_sigio != NULL)
- fsetown(fgetown(head->so_sigio), &so->so_sigio);
fp->f_type = DTYPE_SOCKET;
fp->f_flag = fflag;
@@ -1303,402 +1274,3 @@ getsock(fdp, fdes, fpp)
*fpp = fp;
return (0);
}
-
-/*
- * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
- * XXX - The sf_buf functions are currently private to sendfile(2), so have
- * been made static, but may be useful in the future for doing zero-copy in
- * other parts of the networking code.
- */
-static void
-sf_buf_init(void *arg)
-{
- int i;
-
- SLIST_INIT(&sf_freelist);
- sf_base = kmem_alloc_pageable(kernel_map, nsfbufs * PAGE_SIZE);
- sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, M_NOWAIT);
- bzero(sf_bufs, nsfbufs * sizeof(struct sf_buf));
- for (i = 0; i < nsfbufs; i++) {
- sf_bufs[i].kva = sf_base + i * PAGE_SIZE;
- SLIST_INSERT_HEAD(&sf_freelist, &sf_bufs[i], free_list);
- }
-}
-
-/*
- * Get an sf_buf from the freelist. Will block if none are available.
- */
-static struct sf_buf *
-sf_buf_alloc()
-{
- struct sf_buf *sf;
- int s;
-
- s = splimp();
- while ((sf = SLIST_FIRST(&sf_freelist)) == NULL) {
- sf_buf_alloc_want = 1;
- tsleep(&sf_freelist, PVM, "sfbufa", 0);
- }
- SLIST_REMOVE_HEAD(&sf_freelist, free_list);
- splx(s);
- sf->refcnt = 1;
- return (sf);
-}
-
-#define dtosf(x) (&sf_bufs[((uintptr_t)(x) - (uintptr_t)sf_base) >> PAGE_SHIFT])
-static void
-sf_buf_ref(caddr_t addr, u_int size)
-{
- struct sf_buf *sf;
-
- sf = dtosf(addr);
- if (sf->refcnt == 0)
- panic("sf_buf_ref: referencing a free sf_buf");
- sf->refcnt++;
-}
-
-/*
- * Lose a reference to an sf_buf. When none left, detach mapped page
- * and release resources back to the system.
- *
- * Must be called at splimp.
- */
-static void
-sf_buf_free(caddr_t addr, u_int size)
-{
- struct sf_buf *sf;
- struct vm_page *m;
- int s;
-
- sf = dtosf(addr);
- if (sf->refcnt == 0)
- panic("sf_buf_free: freeing free sf_buf");
- sf->refcnt--;
- if (sf->refcnt == 0) {
- pmap_qremove((vm_offset_t)addr, 1);
- m = sf->m;
- s = splvm();
- vm_page_unwire(m, 0);
- /*
- * Check for the object going away on us. This can
- * happen since we don't hold a reference to it.
- * If so, we're responsible for freeing the page.
- */
- if (m->wire_count == 0 && m->object == NULL)
- vm_page_free(m);
- splx(s);
- sf->m = NULL;
- SLIST_INSERT_HEAD(&sf_freelist, sf, free_list);
- if (sf_buf_alloc_want) {
- sf_buf_alloc_want = 0;
- wakeup(&sf_freelist);
- }
- }
-}
-
-/*
- * sendfile(2).
- * int sendfile(int fd, int s, off_t offset, size_t nbytes,
- * struct sf_hdtr *hdtr, off_t *sbytes, int flags)
- *
- * Send a file specified by 'fd' and starting at 'offset' to a socket
- * specified by 's'. Send only 'nbytes' of the file or until EOF if
- * nbytes == 0. Optionally add a header and/or trailer to the socket
- * output. If specified, write the total number of bytes sent into *sbytes.
- */
-int
-sendfile(struct proc *p, struct sendfile_args *uap)
-{
- struct file *fp;
- struct filedesc *fdp = p->p_fd;
- struct vnode *vp;
- struct vm_object *obj;
- struct socket *so;
- struct mbuf *m;
- struct sf_buf *sf;
- struct vm_page *pg;
- struct writev_args nuap;
- struct sf_hdtr hdtr;
- off_t off, xfsize, sbytes = 0;
- int error = 0, s;
-
- /*
- * Do argument checking. Must be a regular file in, stream
- * type and connected socket out, positive offset.
- */
- if (((u_int)uap->fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[uap->fd]) == NULL ||
- (fp->f_flag & FREAD) == 0) {
- error = EBADF;
- goto done;
- }
- if (fp->f_type != DTYPE_VNODE) {
- error = EINVAL;
- goto done;
- }
- vp = (struct vnode *)fp->f_data;
- obj = vp->v_object;
- if (vp->v_type != VREG || obj == NULL) {
- error = EINVAL;
- goto done;
- }
- error = getsock(p->p_fd, uap->s, &fp);
- if (error)
- goto done;
- so = (struct socket *)fp->f_data;
- if (so->so_type != SOCK_STREAM) {
- error = EINVAL;
- goto done;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto done;
- }
- if (uap->offset < 0) {
- error = EINVAL;
- goto done;
- }
-
- /*
- * If specified, get the pointer to the sf_hdtr struct for
- * any headers/trailers.
- */
- if (uap->hdtr != NULL) {
- error = copyin(uap->hdtr, &hdtr, sizeof(hdtr));
- if (error)
- goto done;
- /*
- * Send any headers. Wimp out and use writev(2).
- */
- if (hdtr.headers != NULL) {
- nuap.fd = uap->s;
- nuap.iovp = hdtr.headers;
- nuap.iovcnt = hdtr.hdr_cnt;
- error = writev(p, &nuap);
- if (error)
- goto done;
- sbytes += p->p_retval[0];
- }
- }
-
- /*
- * Protect against multiple writers to the socket.
- */
- (void) sblock(&so->so_snd, M_WAITOK);
-
- /*
- * Loop through the pages in the file, starting with the requested
- * offset. Get a file page (do I/O if necessary), map the file page
- * into an sf_buf, attach an mbuf header to the sf_buf, and queue
- * it on the socket.
- */
- for (off = uap->offset; ; off += xfsize, sbytes += xfsize) {
- vm_pindex_t pindex;
- vm_offset_t pgoff;
-
- pindex = OFF_TO_IDX(off);
-retry_lookup:
- /*
- * Calculate the amount to transfer. Not to exceed a page,
- * the EOF, or the passed in nbytes.
- */
- xfsize = obj->un_pager.vnp.vnp_size - off;
- if (xfsize > PAGE_SIZE)
- xfsize = PAGE_SIZE;
- pgoff = (vm_offset_t)(off & PAGE_MASK);
- if (PAGE_SIZE - pgoff < xfsize)
- xfsize = PAGE_SIZE - pgoff;
- if (uap->nbytes && xfsize > (uap->nbytes - sbytes))
- xfsize = uap->nbytes - sbytes;
- if (xfsize <= 0)
- break;
- /*
- * Optimize the non-blocking case by looking at the socket space
- * before going to the extra work of constituting the sf_buf.
- */
- if ((so->so_state & SS_NBIO) && sbspace(&so->so_snd) <= 0) {
- if (so->so_state & SS_CANTSENDMORE)
- error = EPIPE;
- else
- error = EAGAIN;
- sbunlock(&so->so_snd);
- goto done;
- }
- /*
- * Attempt to look up the page. If the page doesn't exist or the
- * part we're interested in isn't valid, then read it from disk.
- * If some other part of the kernel has this page (i.e. it's busy),
- * then disk I/O may be occuring on it, so wait and retry.
- */
- pg = vm_page_lookup(obj, pindex);
- if (pg == NULL || (!(pg->flags & PG_BUSY) && !pg->busy &&
- !vm_page_is_valid(pg, pgoff, xfsize))) {
- struct uio auio;
- struct iovec aiov;
- int bsize;
-
- if (pg == NULL) {
- pg = vm_page_alloc(obj, pindex, VM_ALLOC_NORMAL);
- if (pg == NULL) {
- VM_WAIT;
- goto retry_lookup;
- }
- vm_page_flag_clear(pg, PG_BUSY);
- }
- /*
- * Ensure that our page is still around when the I/O completes.
- */
- vm_page_io_start(pg);
- vm_page_wire(pg);
- /*
- * Get the page from backing store.
- */
- bsize = vp->v_mount->mnt_stat.f_iosize;
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- aiov.iov_base = 0;
- aiov.iov_len = MAXBSIZE;
- auio.uio_resid = MAXBSIZE;
- auio.uio_offset = trunc_page(off);
- auio.uio_segflg = UIO_NOCOPY;
- auio.uio_rw = UIO_READ;
- auio.uio_procp = p;
- vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, p);
- error = VOP_READ(vp, &auio, IO_VMIO | ((MAXBSIZE / bsize) << 16),
- p->p_ucred);
- VOP_UNLOCK(vp, 0, p);
- vm_page_flag_clear(pg, PG_ZERO);
- vm_page_io_finish(pg);
- if (error) {
- vm_page_unwire(pg, 0);
- /*
- * See if anyone else might know about this page.
- * If not and it is not valid, then free it.
- */
- if (pg->wire_count == 0 && pg->valid == 0 &&
- pg->busy == 0 && !(pg->flags & PG_BUSY) &&
- pg->hold_count == 0)
- vm_page_free(pg);
- sbunlock(&so->so_snd);
- goto done;
- }
- } else {
- if ((pg->flags & PG_BUSY) || pg->busy) {
- s = splvm();
- if ((pg->flags & PG_BUSY) || pg->busy) {
- /*
- * Page is busy. Wait and retry.
- */
- vm_page_flag_set(pg, PG_WANTED);
- tsleep(pg, PVM, "sfpbsy", 0);
- splx(s);
- goto retry_lookup;
- }
- splx(s);
- }
- /*
- * Protect from having the page ripped out from beneath us.
- */
- vm_page_wire(pg);
- }
- /*
- * Allocate a kernel virtual page and insert the physical page
- * into it.
- */
- sf = sf_buf_alloc();
- sf->m = pg;
- pmap_qenter(sf->kva, &pg, 1);
- /*
- * Get an mbuf header and set it up as having external storage.
- */
- MGETHDR(m, M_WAIT, MT_DATA);
- m->m_ext.ext_free = sf_buf_free;
- m->m_ext.ext_ref = sf_buf_ref;
- m->m_ext.ext_buf = (void *)sf->kva;
- m->m_ext.ext_size = PAGE_SIZE;
- m->m_data = (char *) sf->kva + pgoff;
- m->m_flags |= M_EXT;
- m->m_pkthdr.len = m->m_len = xfsize;
- /*
- * Add the buffer to the socket buffer chain.
- */
- s = splnet();
-retry_space:
- /*
- * Make sure that the socket is still able to take more data.
- * CANTSENDMORE being true usually means that the connection
- * was closed. so_error is true when an error was sensed after
- * a previous send.
- * The state is checked after the page mapping and buffer
- * allocation above since those operations may block and make
- * any socket checks stale. From this point forward, nothing
- * blocks before the pru_send (or more accurately, any blocking
- * results in a loop back to here to re-check).
- */
- if ((so->so_state & SS_CANTSENDMORE) || so->so_error) {
- if (so->so_state & SS_CANTSENDMORE) {
- error = EPIPE;
- } else {
- error = so->so_error;
- so->so_error = 0;
- }
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- goto done;
- }
- /*
- * Wait for socket space to become available. We do this just
- * after checking the connection state above in order to avoid
- * a race condition with sbwait().
- */
- if (sbspace(&so->so_snd) < so->so_snd.sb_lowat) {
- if (so->so_state & SS_NBIO) {
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- error = EAGAIN;
- goto done;
- }
- error = sbwait(&so->so_snd);
- /*
- * An error from sbwait usually indicates that we've
- * been interrupted by a signal. If we've sent anything
- * then return bytes sent, otherwise return the error.
- */
- if (error) {
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- goto done;
- }
- goto retry_space;
- }
- error = (*so->so_proto->pr_usrreqs->pru_send)(so, 0, m, 0, 0, p);
- splx(s);
- if (error) {
- sbunlock(&so->so_snd);
- goto done;
- }
- }
- sbunlock(&so->so_snd);
-
- /*
- * Send trailers. Wimp out and use writev(2).
- */
- if (uap->hdtr != NULL && hdtr.trailers != NULL) {
- nuap.fd = uap->s;
- nuap.iovp = hdtr.trailers;
- nuap.iovcnt = hdtr.trl_cnt;
- error = writev(p, &nuap);
- if (error)
- goto done;
- sbytes += p->p_retval[0];
- }
-
-done:
- if (uap->sbytes != NULL) {
- copyout(&sbytes, uap->sbytes, sizeof(off_t));
- }
- return (error);
-}
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 93f61649641e..0799791d33df 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
- * $Id: uipc_usrreq.c,v 1.36 1998/07/15 02:32:12 bde Exp $
+ * $Id: uipc_usrreq.c,v 1.35 1998/05/15 20:11:31 wollman Exp $
*/
#include <sys/param.h>
@@ -709,7 +709,7 @@ unp_abort(unp)
static int
unp_pcblist SYSCTL_HANDLER_ARGS
{
- int error, i, n;
+ int error, i, n, s;
struct unpcb *unp, **unp_list;
unp_gen_t gencnt;
struct xunpgen xug;
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index c7c8aa9a5af0..89e5a580d261 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: vfs_aio.c,v 1.35 1998/11/27 01:14:21 tegge Exp $
+ * $Id: vfs_aio.c,v 1.32 1998/07/15 06:51:14 bde Exp $
*/
/*
@@ -245,7 +245,7 @@ static vm_zone_t kaio_zone=0, aiop_zone=0,
/*
* Single AIOD vmspace shared amongst all of them
*/
-struct vmspace *aiovmspace = NULL;
+static struct vmspace *aiovmspace = NULL;
/*
* Startup initialization
@@ -953,6 +953,7 @@ aio_qphysio(p, aiocbe)
struct aiocblist *aiocbe;
{
int error;
+ caddr_t sa;
struct aiocb *cb;
struct file *fp;
struct buf *bp;
@@ -1387,10 +1388,11 @@ int
aio_return(struct proc *p, struct aio_return_args *uap)
{
int s;
- int jobref;
+ int jobref, status;
struct aiocblist *cb, *ncb;
struct aiocb *ujob;
struct kaioinfo *ki;
+ struct proc *userp;
ki = p->p_aioinfo;
if (ki == NULL) {
@@ -1478,7 +1480,7 @@ aio_suspend(struct proc *p, struct aio_suspend_args *uap)
if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000)
return (EINVAL);
- TIMESPEC_TO_TIMEVAL(&atv, &ts);
+ TIMESPEC_TO_TIMEVAL(&atv, &ts)
if (itimerfix(&atv))
return (EINVAL);
timo = tvtohz(&atv);
@@ -1581,6 +1583,7 @@ aio_error(struct proc *p, struct aio_error_args *uap)
struct aiocblist *cb;
struct kaioinfo *ki;
int jobref;
+ int error, status;
ki = p->p_aioinfo;
if (ki == NULL)
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 30018b544f53..0fc7770e03ca 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vfs_bio.c,v 1.192 1999/01/12 11:59:34 eivind Exp $
+ * $Id: vfs_bio.c,v 1.178 1998/09/26 00:12:35 dillon Exp $
*/
/*
@@ -23,8 +23,6 @@
* Author: John S. Dyson
* Significant help during the development and debugging phases
* had been provided by David Greenman, also of the FreeBSD core team.
- *
- * see man buf(9) for more info.
*/
#define VMIO
@@ -70,6 +68,7 @@ SYSINIT_KT(update, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp)
struct buf *buf; /* buffer header pool */
struct swqueue bswlist;
+static int count_lock_queue __P((void));
static void vm_hold_free_pages(struct buf * bp, vm_offset_t from,
vm_offset_t to);
static void vm_hold_load_pages(struct buf * bp, vm_offset_t from,
@@ -181,7 +180,7 @@ bufinit()
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_qindex = QUEUE_EMPTY;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
LIST_INIT(&bp->b_dep);
TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist);
LIST_INSERT_HEAD(&invalhash, bp, b_hash);
@@ -423,7 +422,7 @@ bwrite(struct buf * bp)
return (0);
}
-void
+__inline void
vfs_bio_need_satisfy(void) {
++numfreebuffers;
if (!needsbuffer)
@@ -445,6 +444,7 @@ vfs_bio_need_satisfy(void) {
void
bdwrite(struct buf * bp)
{
+ int s;
struct vnode *vp;
#if !defined(MAX_PERF)
@@ -499,9 +499,9 @@ bdwrite(struct buf * bp)
* requested by the soft dependency code.
*/
if ((vp = bp->b_vp) &&
- ((vp->v_type == VBLK && vp->v_specmountpoint &&
- (vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP)) ||
- (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP))))
+ (vp->v_type == VBLK && vp->v_specmountpoint &&
+ (vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP)) ||
+ (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP)))
return;
if (numdirtybuffers >= hidirtybuffers)
@@ -519,6 +519,7 @@ void
bdirty(bp)
struct buf *bp;
{
+ int s;
bp->b_flags &= ~(B_READ|B_RELBUF); /* XXX ??? check this */
if ((bp->b_flags & B_DELWRI) == 0) {
@@ -612,13 +613,11 @@ brelse(struct buf * bp)
* but the VM object is kept around. The B_NOCACHE flag is used to
* invalidate the pages in the VM object.
*
- * The b_{validoff,validend,dirtyoff,dirtyend} values are relative
- * to b_offset and currently have byte granularity, whereas the
- * valid flags in the vm_pages have only DEV_BSIZE resolution.
- * The byte resolution fields are used to avoid unnecessary re-reads
- * of the buffer but the code really needs to be genericized so
- * other filesystem modules can take advantage of these fields.
- *
+ * If the buffer is a partially filled NFS buffer, keep it
+ * since invalidating it now will lose informatio. The valid
+ * flags in the vm_pages have only DEV_BSIZE resolution but
+ * the b_validoff, b_validend fields have byte resolution.
+ * This can avoid unnecessary re-reads of the buffer.
* XXX this seems to cause performance problems.
*/
if ((bp->b_flags & B_VMIO)
@@ -644,22 +643,6 @@ brelse(struct buf * bp)
vp = bp->b_vp;
- /*
- * Get the base offset and length of the buffer. Note that
- * for block sizes that are less then PAGE_SIZE, the b_data
- * base of the buffer does not represent exactly b_offset and
- * neither b_offset nor b_size are necessarily page aligned.
- * Instead, the starting position of b_offset is:
- *
- * b_data + (b_offset & PAGE_MASK)
- *
- * block sizes less then DEV_BSIZE (usually 512) are not
- * supported due to the page granularity bits (m->valid,
- * m->dirty, etc...).
- *
- * See man buf(9) for more information
- */
-
resid = bp->b_bufsize;
foff = bp->b_offset;
@@ -692,12 +675,9 @@ brelse(struct buf * bp)
int poffset = foff & PAGE_MASK;
int presid = resid > (PAGE_SIZE - poffset) ?
(PAGE_SIZE - poffset) : resid;
-
- KASSERT(presid >= 0, ("brelse: extra page"));
vm_page_set_invalid(m, poffset, presid);
}
- resid -= PAGE_SIZE - (foff & PAGE_MASK);
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
+ resid -= PAGE_SIZE;
}
if (bp->b_flags & (B_INVAL | B_RELBUF))
@@ -811,18 +791,14 @@ static void
vfs_vmio_release(bp)
struct buf *bp;
{
- int i, s;
+ int i;
vm_page_t m;
- s = splvm();
for (i = 0; i < bp->b_npages; i++) {
m = bp->b_pages[i];
bp->b_pages[i] = NULL;
- /*
- * In order to keep page LRU ordering consistent, put
- * everything on the inactive queue.
- */
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+
/*
* We don't mess with busy pages, it is
* the responsibility of the process that
@@ -832,19 +808,49 @@ vfs_vmio_release(bp)
continue;
if (m->wire_count == 0) {
- vm_page_flag_clear(m, PG_ZERO);
+
+ /*
+ * If this is an async free -- we cannot place
+ * pages onto the cache queue. If it is an
+ * async free, then we don't modify any queues.
+ * This is probably in error (for perf reasons),
+ * and we will eventually need to build
+ * a more complete infrastructure to support I/O
+ * rundown.
+ */
+ if ((bp->b_flags & B_ASYNC) == 0) {
+
/*
- * Might as well free the page if we can and it has
- * no valid data.
+ * In the case of sync buffer frees, we can do pretty much
+ * anything to any of the memory queues. Specifically,
+ * the cache queue is okay to be modified.
*/
- if ((bp->b_flags & B_ASYNC) == 0 && !m->valid && m->hold_count == 0) {
- vm_page_busy(m);
- vm_page_protect(m, VM_PROT_NONE);
- vm_page_free(m);
+ if (m->valid) {
+ if(m->dirty == 0)
+ vm_page_test_dirty(m);
+ /*
+ * this keeps pressure off of the process memory
+ */
+ if (m->dirty == 0 && m->hold_count == 0)
+ vm_page_cache(m);
+ else
+ vm_page_deactivate(m);
+ vm_page_flag_clear(m, PG_ZERO);
+ } else if (m->hold_count == 0) {
+ vm_page_busy(m);
+ vm_page_protect(m, VM_PROT_NONE);
+ vm_page_free(m);
+ }
+ } else {
+ /*
+ * If async, then at least we clear the
+ * act_count.
+ */
+ m->act_count = 0;
+ vm_page_flag_clear(m, PG_ZERO);
}
}
}
- splx(s);
bufspace -= bp->b_bufsize;
vmiospace -= bp->b_bufsize;
pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages);
@@ -999,8 +1005,13 @@ trytofreespace:
while (needsbuffer & VFS_BIO_NEED_ANY);
return (0);
}
- KASSERT(!(bp->b_flags & B_BUSY),
- ("getnewbuf: busy buffer on free list\n"));
+
+#if defined(DIAGNOSTIC)
+ if (bp->b_flags & B_BUSY) {
+ panic("getnewbuf: busy buffer on free list\n");
+ }
+#endif
+
/*
* We are fairly aggressive about freeing VMIO buffers, but since
* the buffering is intact without buffer headers, there is not
@@ -1291,7 +1302,7 @@ int
inmem(struct vnode * vp, daddr_t blkno)
{
vm_object_t obj;
- vm_offset_t toff, tinc, size;
+ vm_offset_t toff, tinc;
vm_page_t m;
vm_ooffset_t off;
@@ -1303,18 +1314,16 @@ inmem(struct vnode * vp, daddr_t blkno)
return 0;
obj = vp->v_object;
- size = PAGE_SIZE;
- if (size > vp->v_mount->mnt_stat.f_iosize)
- size = vp->v_mount->mnt_stat.f_iosize;
- off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
+ tinc = PAGE_SIZE;
+ if (tinc > vp->v_mount->mnt_stat.f_iosize)
+ tinc = vp->v_mount->mnt_stat.f_iosize;
+ off = blkno * vp->v_mount->mnt_stat.f_iosize;
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
+
m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
if (!m)
return 0;
- tinc = size;
- if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
- tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
if (vm_page_is_valid(m,
(vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
return 0;
@@ -1335,11 +1344,7 @@ static void
vfs_setdirty(struct buf *bp) {
int i;
vm_object_t object;
- vm_offset_t boffset;
-#if 0
- vm_offset_t offset;
-#endif
-
+ vm_offset_t boffset, offset;
/*
* We qualify the scan for modified pages on whether the
* object has been flushed yet. The OBJ_WRITEABLE flag
@@ -1364,9 +1369,9 @@ vfs_setdirty(struct buf *bp) {
break;
}
}
- boffset = (i << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK);
+ boffset = (i << PAGE_SHIFT);
if (boffset < bp->b_dirtyoff) {
- bp->b_dirtyoff = max(boffset, 0);
+ bp->b_dirtyoff = boffset;
}
/*
@@ -1378,14 +1383,11 @@ vfs_setdirty(struct buf *bp) {
}
}
boffset = (i + 1);
-#if 0
offset = boffset + bp->b_pages[0]->pindex;
if (offset >= object->size)
boffset = object->size - bp->b_pages[0]->pindex;
-#endif
- boffset = (boffset << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK);
- if (bp->b_dirtyend < boffset)
- bp->b_dirtyend = min(boffset, bp->b_bufsize);
+ if (bp->b_dirtyend < (boffset << PAGE_SHIFT))
+ bp->b_dirtyend = (boffset << PAGE_SHIFT);
}
}
@@ -1398,6 +1400,20 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo)
struct buf *bp;
int i, s;
struct bufhashhdr *bh;
+ int maxsize;
+ int generation;
+ int checksize;
+
+ if (vp->v_mount) {
+ maxsize = vp->v_mount->mnt_stat.f_iosize;
+ /*
+ * This happens on mount points.
+ */
+ if (maxsize < size)
+ maxsize = size;
+ } else {
+ maxsize = size;
+ }
#if !defined(MAX_PERF)
if (size > MAXBSIZE)
@@ -1411,6 +1427,7 @@ loop:
}
if ((bp = gbincore(vp, blkno))) {
+loop1:
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -1455,8 +1472,12 @@ loop:
goto loop;
}
}
- KASSERT(bp->b_offset != NOOFFSET,
- ("getblk: no buffer offset"));
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("getblk: no buffer offset");
+#endif
+
/*
* Check that the constituted buffer really deserves for the
* B_CACHE bit to be set. B_VMIO type buffers might not
@@ -1464,10 +1485,11 @@ loop:
* should be fully valid.
*/
if (bp->b_flags & B_VMIO) {
- int checksize = bp->b_bufsize;
- int poffset = bp->b_offset & PAGE_MASK;
- int resid;
+ checksize = bp->b_bufsize;
for (i = 0; i < bp->b_npages; i++) {
+ int resid;
+ int poffset;
+ poffset = bp->b_offset & PAGE_MASK;
resid = (checksize > (PAGE_SIZE - poffset)) ?
(PAGE_SIZE - poffset) : checksize;
if (!vm_page_is_valid(bp->b_pages[i], poffset, resid)) {
@@ -1475,7 +1497,6 @@ loop:
break;
}
checksize -= resid;
- poffset = 0;
}
}
@@ -1484,22 +1505,7 @@ loop:
splx(s);
return (bp);
} else {
- int bsize, maxsize, vmio;
- off_t offset;
-
- if (vp->v_type == VBLK)
- bsize = DEV_BSIZE;
- else if (vp->v_mountedhere)
- bsize = vp->v_mountedhere->mnt_stat.f_iosize;
- else if (vp->v_mount)
- bsize = vp->v_mount->mnt_stat.f_iosize;
- else
- bsize = size;
-
- offset = (off_t)blkno * bsize;
- vmio = (vp->v_object != 0) && (vp->v_flag & VOBJBUF);
- maxsize = vmio ? size + (offset & PAGE_MASK) : size;
- maxsize = imax(maxsize, bsize);
+ vm_object_t obj;
if ((bp = getnewbuf(vp, blkno,
slpflag, slptimeo, size, maxsize)) == 0) {
@@ -1527,14 +1533,18 @@ loop:
* be found by incore.
*/
bp->b_blkno = bp->b_lblkno = blkno;
- bp->b_offset = offset;
+
+ if (vp->v_type != VBLK)
+ bp->b_offset = (off_t) blkno * maxsize;
+ else
+ bp->b_offset = (off_t) blkno * DEV_BSIZE;
bgetvp(vp, bp);
LIST_REMOVE(bp, b_hash);
bh = BUFHASH(vp, blkno);
LIST_INSERT_HEAD(bh, bp, b_hash);
- if (vmio) {
+ if ((obj = vp->v_object) && (vp->v_flag & VOBJBUF)) {
bp->b_flags |= (B_VMIO | B_CACHE);
#if defined(VFS_BIO_DEBUG)
if (vp->v_type != VREG && vp->v_type != VBLK)
@@ -1687,8 +1697,7 @@ allocbuf(struct buf * bp, int size)
int desiredpages;
newbsize = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
- desiredpages = (size == 0) ? 0 :
- num_pages((bp->b_offset & PAGE_MASK) + newbsize);
+ desiredpages = (round_page(newbsize) >> PAGE_SHIFT);
#if !defined(NO_B_MALLOC)
if (bp->b_flags & B_MALLOC)
@@ -1703,12 +1712,14 @@ allocbuf(struct buf * bp, int size)
* is the responsibility of vnode_pager_setsize
*/
m = bp->b_pages[i];
- KASSERT(m != bogus_page,
- ("allocbuf: bogus page found"));
+#if defined(DIAGNOSTIC)
+ if (m == bogus_page)
+ panic("allocbuf: bogus page found");
+#endif
vm_page_sleep(m, "biodep", &m->busy);
bp->b_pages[i] = NULL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
}
pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) +
(desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages));
@@ -1735,30 +1746,37 @@ allocbuf(struct buf * bp, int size)
if (bp->b_npages < desiredpages) {
obj = vp->v_object;
tinc = PAGE_SIZE;
+ if (tinc > bsize)
+ tinc = bsize;
off = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("allocbuf: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("allocbuf: no buffer offset");
+#endif
+
curbpnpages = bp->b_npages;
doretry:
bp->b_validoff = orig_validoff;
bp->b_validend = orig_validend;
bp->b_flags |= B_CACHE;
for (toff = 0; toff < newbsize; toff += tinc) {
+ int bytesinpage;
+
+ pageindex = toff >> PAGE_SHIFT;
objoff = OFF_TO_IDX(off + toff);
- pageindex = objoff - OFF_TO_IDX(off);
- tinc = PAGE_SIZE - ((off + toff) & PAGE_MASK);
if (pageindex < curbpnpages) {
m = bp->b_pages[pageindex];
#ifdef VFS_BIO_DIAG
if (m->pindex != objoff)
- panic("allocbuf: page changed offset?!!!?");
+ panic("allocbuf: page changed offset??!!!?");
#endif
+ bytesinpage = tinc;
if (tinc > (newbsize - toff))
- tinc = newbsize - toff;
+ bytesinpage = newbsize - toff;
if (bp->b_flags & B_CACHE)
- vfs_buf_set_valid(bp, off, toff, tinc, m);
+ vfs_buf_set_valid(bp, off, toff, bytesinpage, m);
continue;
}
m = vm_page_lookup(obj, objoff);
@@ -1766,7 +1784,7 @@ allocbuf(struct buf * bp, int size)
m = vm_page_alloc(obj, objoff, VM_ALLOC_NORMAL);
if (!m) {
VM_WAIT;
- vm_pageout_deficit += (desiredpages - curbpnpages);
+ vm_pageout_deficit += (desiredpages - bp->b_npages);
goto doretry;
}
@@ -1789,10 +1807,11 @@ allocbuf(struct buf * bp, int size)
(cnt.v_free_min + cnt.v_cache_min))) {
pagedaemon_wakeup();
}
+ bytesinpage = tinc;
if (tinc > (newbsize - toff))
- tinc = newbsize - toff;
+ bytesinpage = newbsize - toff;
if (bp->b_flags & B_CACHE)
- vfs_buf_set_valid(bp, off, toff, tinc, m);
+ vfs_buf_set_valid(bp, off, toff, bytesinpage, m);
vm_page_flag_clear(m, PG_ZERO);
vm_page_wire(m);
}
@@ -1925,8 +1944,10 @@ biodone(register struct buf * bp)
#endif
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("biodone: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("biodone: no buffer offset");
+#endif
#if !defined(MAX_PERF)
if (!obj) {
@@ -1958,9 +1979,7 @@ biodone(register struct buf * bp)
}
#if defined(VFS_BIO_DEBUG)
if (OFF_TO_IDX(foff) != m->pindex) {
- printf(
-"biodone: foff(%lu)/m->pindex(%d) mismatch\n",
- (unsigned long)foff, m->pindex);
+ printf("biodone: foff(%d)/m->pindex(%d) mismatch\n", foff, m->pindex);
}
#endif
resid = IDX_TO_OFF(m->pindex + 1) - foff;
@@ -2035,6 +2054,20 @@ biodone(register struct buf * bp)
splx(s);
}
+static int
+count_lock_queue()
+{
+ int count;
+ struct buf *bp;
+
+ count = 0;
+ for (bp = TAILQ_FIRST(&bufqueues[QUEUE_LOCKED]);
+ bp != NULL;
+ bp = TAILQ_NEXT(bp, b_freelist))
+ count++;
+ return (count);
+}
+
#if 0 /* not with kirks code */
static int vfs_update_interval = 30;
@@ -2073,7 +2106,7 @@ SYSCTL_PROC(_kern, KERN_UPDATEINTERVAL, update, CTLTYPE_INT|CTLFLAG_RW,
void
vfs_unbusy_pages(struct buf * bp)
{
- int i;
+ int i, s;
if (bp->b_flags & B_VMIO) {
struct vnode *vp = bp->b_vp;
@@ -2117,7 +2150,7 @@ vfs_buf_set_valid(struct buf *bp,
{
if (bp->b_vp->v_tag == VT_NFS && bp->b_vp->v_type != VBLK) {
vm_offset_t svalid, evalid;
- int validbits = m->valid >> (((foff+off)&PAGE_MASK)/DEV_BSIZE);
+ int validbits = m->valid;
/*
* This only bothers with the first valid range in the
@@ -2133,7 +2166,6 @@ vfs_buf_set_valid(struct buf *bp,
evalid += DEV_BSIZE;
validbits >>= 1;
}
- evalid = min(evalid, off + size);
/*
* Make sure this range is contiguous with the range
* built up from previous pages. If not, then we will
@@ -2162,17 +2194,15 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m)
vm_ooffset_t soff, eoff;
soff = off;
- eoff = (off + PAGE_SIZE) & ~PAGE_MASK;
- if (eoff > bp->b_offset + bp->b_bufsize)
- eoff = bp->b_offset + bp->b_bufsize;
+ eoff = off + min(PAGE_SIZE, bp->b_bufsize);
if (vp->v_tag == VT_NFS && vp->v_type != VBLK) {
vm_ooffset_t sv, ev;
vm_page_set_invalid(m,
(vm_offset_t) (soff & PAGE_MASK),
(vm_offset_t) (eoff - soff));
- sv = (bp->b_offset + bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
- ev = (bp->b_offset + bp->b_validend + (DEV_BSIZE - 1)) &
- ~(DEV_BSIZE - 1);
+ off = off - pageno * PAGE_SIZE;
+ sv = off + ((bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
+ ev = off + ((bp->b_validend + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
soff = qmax(sv, soff);
eoff = qmin(ev, eoff);
}
@@ -2193,7 +2223,7 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m)
void
vfs_busy_pages(struct buf * bp, int clear_modify)
{
- int i, bogus;
+ int i, s;
if (bp->b_flags & B_VMIO) {
struct vnode *vp = bp->b_vp;
@@ -2201,8 +2231,11 @@ vfs_busy_pages(struct buf * bp, int clear_modify)
vm_ooffset_t foff;
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("vfs_busy_pages: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("vfs_busy_pages: no buffer offset");
+#endif
+
vfs_setdirty(bp);
retry:
@@ -2212,8 +2245,7 @@ retry:
goto retry;
}
- bogus = 0;
- for (i = 0; i < bp->b_npages; i++) {
+ for (i = 0; i < bp->b_npages; i++, foff += PAGE_SIZE) {
vm_page_t m = bp->b_pages[i];
vm_page_flag_clear(m, PG_ZERO);
@@ -2225,15 +2257,13 @@ retry:
vm_page_protect(m, VM_PROT_NONE);
if (clear_modify)
vfs_page_set_valid(bp, foff, i, m);
- else if (m->valid == VM_PAGE_BITS_ALL &&
- (bp->b_flags & B_CACHE) == 0) {
- bp->b_pages[i] = bogus_page;
- bogus++;
+ else if (bp->b_bcount >= PAGE_SIZE) {
+ if (m->valid && (bp->b_flags & B_CACHE) == 0) {
+ bp->b_pages[i] = bogus_page;
+ pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages);
+ }
}
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
}
- if (bogus)
- pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages);
}
}
@@ -2248,55 +2278,55 @@ vfs_clean_pages(struct buf * bp)
int i;
if (bp->b_flags & B_VMIO) {
+ struct vnode *vp = bp->b_vp;
vm_ooffset_t foff;
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("vfs_clean_pages: no buffer offset"));
- for (i = 0; i < bp->b_npages; i++) {
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("vfs_clean_pages: no buffer offset");
+#endif
+
+ for (i = 0; i < bp->b_npages; i++, foff += PAGE_SIZE) {
vm_page_t m = bp->b_pages[i];
vfs_page_set_valid(bp, foff, i, m);
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
}
}
}
void
vfs_bio_clrbuf(struct buf *bp) {
- int i, mask = 0;
- caddr_t sa, ea;
+ int i;
if ((bp->b_flags & (B_VMIO | B_MALLOC)) == B_VMIO) {
- if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE) &&
- (bp->b_offset & PAGE_MASK) == 0) {
- mask = (1 << (bp->b_bufsize / DEV_BSIZE)) - 1;
- if (((bp->b_pages[0]->flags & PG_ZERO) == 0) &&
- ((bp->b_pages[0]->valid & mask) != mask)) {
+ if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE)) {
+ int mask;
+ mask = 0;
+ for(i=0;i<bp->b_bufsize;i+=DEV_BSIZE)
+ mask |= (1 << (i/DEV_BSIZE));
+ if(((bp->b_pages[0]->flags & PG_ZERO) == 0) &&
+ (bp->b_pages[0]->valid != mask)) {
bzero(bp->b_data, bp->b_bufsize);
}
- bp->b_pages[0]->valid |= mask;
+ bp->b_pages[0]->valid = mask;
bp->b_resid = 0;
return;
}
- ea = sa = bp->b_data;
- for(i=0;i<bp->b_npages;i++,sa=ea) {
- int j = ((u_long)sa & PAGE_MASK) / DEV_BSIZE;
- ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE);
- ea = (caddr_t)ulmin((u_long)ea,
- (u_long)bp->b_data + bp->b_bufsize);
- mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j;
- if ((bp->b_pages[i]->valid & mask) == mask)
+ for(i=0;i<bp->b_npages;i++) {
+ if( bp->b_pages[i]->valid == VM_PAGE_BITS_ALL)
continue;
- if ((bp->b_pages[i]->valid & mask) == 0) {
+ if( bp->b_pages[i]->valid == 0) {
if ((bp->b_pages[i]->flags & PG_ZERO) == 0) {
- bzero(sa, ea - sa);
+ bzero(bp->b_data + (i << PAGE_SHIFT), PAGE_SIZE);
}
} else {
- for (; sa < ea; sa += DEV_BSIZE, j++) {
+ int j;
+ for(j=0;j<PAGE_SIZE/DEV_BSIZE;j++) {
if (((bp->b_pages[i]->flags & PG_ZERO) == 0) &&
(bp->b_pages[i]->valid & (1<<j)) == 0)
- bzero(sa, DEV_BSIZE);
+ bzero(bp->b_data + (i << PAGE_SHIFT) + j * DEV_BSIZE, DEV_BSIZE);
}
}
- bp->b_pages[i]->valid |= mask;
+ bp->b_pages[i]->valid = VM_PAGE_BITS_ALL;
vm_page_flag_clear(bp->b_pages[i], PG_ZERO);
}
bp->b_resid = 0;
@@ -2366,7 +2396,7 @@ vm_hold_free_pages(struct buf * bp, vm_offset_t from, vm_offset_t to)
bp->b_pages[index] = NULL;
pmap_kremove(pg);
vm_page_busy(p);
- vm_page_unwire(p, 0);
+ vm_page_unwire(p);
vm_page_free(p);
}
}
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index ce842ad204cf..fb88938bbd63 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,18 +33,16 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.76 1999/01/08 17:31:15 eivind Exp $
+ * $Id: vfs_cluster.c,v 1.69 1998/08/24 08:39:39 dfr Exp $
*/
#include "opt_debug_cluster.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/vnode.h>
-#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/resourcevar.h>
#include <vm/vm.h>
@@ -54,14 +52,15 @@
#if defined(CLUSTERDEBUG)
#include <sys/sysctl.h>
+#include <sys/kernel.h>
static int rcluster= 0;
SYSCTL_INT(_debug, OID_AUTO, rcluster, CTLFLAG_RW, &rcluster, 0, "");
#endif
-static MALLOC_DEFINE(M_SEGMENT, "cluster_save buffer", "cluster_save buffer");
-
+#ifdef notyet_block_reallocation_enabled
static struct cluster_save *
cluster_collectbufs __P((struct vnode *vp, struct buf *last_bp));
+#endif
static struct buf *
cluster_rbuild __P((struct vnode *vp, u_quad_t filesize, daddr_t lbn,
daddr_t blkno, long size, int run, struct buf *fbp));
@@ -166,10 +165,12 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
}
reqbp = bp = NULL;
} else {
- off_t firstread = bp->b_offset;
-
- KASSERT(bp->b_offset != NOOFFSET,
- ("cluster_read: no buffer offset"));
+ off_t firstread;
+ firstread = bp->b_offset;
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_read: no buffer offset");
+#endif
if (firstread + totread > filesize)
totread = filesize - firstread;
if (totread > size) {
@@ -308,12 +309,13 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
{
struct buf *bp, *tbp;
daddr_t bn;
- int i, inc, j;
-
- KASSERT(size == vp->v_mount->mnt_stat.f_iosize,
- ("cluster_rbuild: size %ld != filesize %ld\n",
- size, vp->v_mount->mnt_stat.f_iosize));
+ int i, inc, j, s;
+#ifdef DIAGNOSTIC
+ if (size != vp->v_mount->mnt_stat.f_iosize)
+ panic("cluster_rbuild: size %ld != filesize %ld\n",
+ size, vp->v_mount->mnt_stat.f_iosize);
+#endif
/*
* avoid a division
*/
@@ -347,7 +349,10 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
bp->b_blkno = blkno;
bp->b_lblkno = lbn;
bp->b_offset = tbp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET, ("cluster_rbuild: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_rbuild: no buffer offset");
+#endif
pbgetvp(vp, bp);
TAILQ_INIT(&bp->b_cluster.cluster_head);
@@ -510,7 +515,11 @@ cluster_write(bp, filesize)
lblocksize = bp->b_bufsize;
}
lbn = bp->b_lblkno;
- KASSERT(bp->b_offset != NOOFFSET, ("cluster_write: no buffer offset"));
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_write: no buffer offset");
+#endif
/* Initialize vnode to beginning of file. */
if (lbn == 0)
@@ -530,7 +539,16 @@ cluster_write(bp, filesize)
* reallocating to make it sequential.
*/
cursize = vp->v_lastw - vp->v_cstart + 1;
+#ifndef notyet_block_reallocation_enabled
if (((u_quad_t) bp->b_offset + lblocksize) != filesize ||
+ lbn != vp->v_lastw + 1 ||
+ vp->v_clen <= cursize) {
+ if (!async)
+ cluster_wbuild(vp, lblocksize,
+ vp->v_cstart, cursize);
+ }
+#else
+ if ((lbn + 1) * lblocksize != filesize ||
lbn != vp->v_lastw + 1 || vp->v_clen <= cursize) {
if (!async)
cluster_wbuild(vp, lblocksize,
@@ -565,6 +583,7 @@ cluster_write(bp, filesize)
return;
}
}
+#endif /* notyet_block_reallocation_enabled */
}
/*
* Consider beginning a cluster. If at end of file, make
@@ -803,6 +822,7 @@ cluster_wbuild(vp, size, start_lbn, len)
return totalwritten;
}
+#ifdef notyet_block_reallocation_enabled
/*
* Collect together all the buffers in a cluster.
* Plus add one additional buffer.
@@ -813,7 +833,6 @@ cluster_collectbufs(vp, last_bp)
struct buf *last_bp;
{
struct cluster_save *buflist;
- struct buf *bp;
daddr_t lbn;
int i, len;
@@ -822,17 +841,11 @@ cluster_collectbufs(vp, last_bp)
M_SEGMENT, M_WAITOK);
buflist->bs_nchildren = 0;
buflist->bs_children = (struct buf **) (buflist + 1);
- for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) {
- (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp);
- buflist->bs_children[i] = bp;
- if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
- NULL, NULL);
- }
- buflist->bs_children[i] = bp = last_bp;
- if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
- NULL, NULL);
+ for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++)
+ (void) bread(vp, lbn, last_bp->b_bcount, NOCRED,
+ &buflist->bs_children[i]);
+ buflist->bs_children[i] = last_bp;
buflist->bs_nchildren = i + 1;
return (buflist);
}
+#endif /* notyet_block_reallocation_enabled */
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index b73b126a82cc..538cbc06d557 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -130,13 +130,6 @@ vop_defaultop(struct vop_generic_args *ap)
return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap));
}
-int
-vop_panic(struct vop_generic_args *ap)
-{
-
- panic("illegal vnode op called");
-}
-
static int
vop_nostrategy (struct vop_strategy_args *ap)
{
@@ -205,12 +198,7 @@ vop_stdlock(ap)
return 0;
}
-#ifndef DEBUG_LOCKS
return (lockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p));
-#else
- return (debuglockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p,
- "vop_stdlock", ap->a_vp->filename, ap->a_vp->line));
-#endif
}
int
@@ -360,12 +348,7 @@ vop_sharedlock(ap)
}
if (flags & LK_INTERLOCK)
vnflags |= LK_INTERLOCK;
-#ifndef DEBUG_LOCKS
- return (lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
-#else
- return (debuglockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p,
- "vop_sharedlock", vp->filename, vp->line));
-#endif
+ return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
}
/*
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
index 43589c740a7e..39900c612c64 100644
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
- * $Id: vfs_init.c,v 1.40 1998/11/15 15:18:30 bde Exp $
+ * $Id: vfs_init.c,v 1.34 1998/10/05 11:10:55 obrien Exp $
*/
@@ -49,10 +49,33 @@
#include <sys/malloc.h>
#include <vm/vm_zone.h>
+static void vfs_op_init __P((void));
+
+static void vfsinit __P((void *));
+SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL)
MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes");
/*
+ * Sigh, such primitive tools are these...
+ */
+#if 0
+#define DODEBUG(A) A
+#else
+#define DODEBUG(A)
+#endif
+
+static struct vfsconf void_vfsconf;
+
+#ifdef unused
+extern struct linker_set vfs_opv_descs_;
+#define vfs_opv_descs ((struct vnodeopv_desc **)vfs_opv_descs_.ls_items)
+#endif
+
+extern struct vnodeop_desc *vfs_op_descs[];
+ /* and the operations they perform */
+
+/*
* XXX this bloat just exands the sysctl__vfs linker set a little so that
* we can attach sysctls for VFS modules without expanding the linker set.
* Currently (1998/09/06), only one VFS uses sysctls, so 2 extra linker
@@ -83,221 +106,133 @@ struct vm_zone *namei_zone;
* listing those new operations Ficus adds to NFS, all without modifying the
* NFS code. (Of couse, the OTW NFS protocol still needs to be munged, but
* that is a(whole)nother story.) This is a feature.
+ *
+ * Without an explicit reserve area, however, you must replace vnode_if.c
+ * and vnode_if.h when you do this, or you will be derefrencing of the
+ * end of vfs_op_descs[]. This is a flaw in the use of a structure
+ * pointer array rather than an agregate to define vfs_op_descs. So
+ * it's not a very dynamic "feature".
*/
-
-/* Table of known vnodeop vectors (list of VFS vnode vectors) */
-static struct vnodeopv_desc **vnodeopv_descs;
-static int vnodeopv_num;
-
-/* Table of known descs (list of vnode op handlers "vop_access_desc") */
-static struct vnodeop_desc **vfs_op_descs;
-static int *vfs_op_desc_refs; /* reference counts */
-static int num_op_descs;
-static int vfs_opv_numops;
-
-static void
-vfs_opv_recalc(void)
+void
+vfs_opv_init(struct vnodeopv_desc *opv)
{
- int i, j;
+ int j, k;
vop_t ***opv_desc_vector_p;
vop_t **opv_desc_vector;
struct vnodeopv_entry_desc *opve_descp;
- struct vnodeopv_desc *opv;
-
- if (vfs_op_descs == NULL)
- panic("vfs_opv_recalc called with null vfs_op_descs");
/*
- * Run through and make sure all known descs have an offset
- *
- * vop_default_desc is hardwired at offset 1, and offset 0
- * is a panic sanity check.
+ * Allocate the dynamic vectors and fill them in.
*/
- vfs_opv_numops = 0;
- for (i = 0; i < num_op_descs; i++)
- if (vfs_opv_numops < (vfs_op_descs[i]->vdesc_offset + 1))
- vfs_opv_numops = vfs_op_descs[i]->vdesc_offset + 1;
- for (i = 0; i < num_op_descs; i++)
- if (vfs_op_descs[i]->vdesc_offset == 0)
- vfs_op_descs[i]->vdesc_offset = vfs_opv_numops++;
+ opv_desc_vector_p = opv->opv_desc_vector_p;
/*
- * Allocate and fill in the vectors
+ * Allocate and init the vector, if it needs it.
+ * Also handle backwards compatibility.
*/
- for (i = 0; i < vnodeopv_num; i++) {
- opv = vnodeopv_descs[i];
- opv_desc_vector_p = opv->opv_desc_vector_p;
- if (*opv_desc_vector_p)
- FREE(*opv_desc_vector_p, M_VNODE);
+ if (*opv_desc_vector_p == NULL) {
+ /* XXX - shouldn't be M_VNODE */
MALLOC(*opv_desc_vector_p, vop_t **,
- vfs_opv_numops * sizeof(vop_t *), M_VNODE, M_WAITOK);
- if (*opv_desc_vector_p == NULL)
- panic("no memory for vop_t ** vector");
- bzero(*opv_desc_vector_p, vfs_opv_numops * sizeof(vop_t *));
-
- /* Fill in, with slot 0 being panic */
- opv_desc_vector = *opv_desc_vector_p;
- opv_desc_vector[0] = (vop_t *)vop_panic;
- for (j = 0; opv->opv_desc_ops[j].opve_op; j++) {
- opve_descp = &(opv->opv_desc_ops[j]);
- opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
- opve_descp->opve_impl;
- }
-
- /* Replace unfilled routines with their default (slot 1). */
- opv_desc_vector = *(opv->opv_desc_vector_p);
- if (opv_desc_vector[1] == NULL)
- panic("vfs_opv_recalc: vector without a default.");
- for (j = 0; j < vfs_opv_numops; j++)
- if (opv_desc_vector[j] == NULL)
- opv_desc_vector[j] = opv_desc_vector[1];
+ vfs_opv_numops * sizeof(vop_t *), M_VNODE,
+ M_WAITOK);
+ bzero(*opv_desc_vector_p,
+ vfs_opv_numops * sizeof(vop_t *));
+ DODEBUG(printf("vector at %x allocated\n",
+ opv_desc_vector_p));
}
-}
+ opv_desc_vector = *opv_desc_vector_p;
+ for (j = 0; opv->opv_desc_ops[j].opve_op; j++) {
+ opve_descp = &(opv->opv_desc_ops[j]);
-void
-vfs_add_vnodeops(void *data)
-{
- struct vnodeopv_desc *opv;
- struct vnodeopv_desc **newopv;
- struct vnodeop_desc **newop;
- int *newref;
- vop_t **opv_desc_vector;
- struct vnodeop_desc *desc;
- int i, j;
-
- opv = (struct vnodeopv_desc *)data;
- MALLOC(newopv, struct vnodeopv_desc **,
- (vnodeopv_num + 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
- if (newopv == NULL)
- panic("vfs_add_vnodeops: no memory");
- if (vnodeopv_descs) {
- bcopy(vnodeopv_descs, newopv, vnodeopv_num * sizeof(*newopv));
- FREE(vnodeopv_descs, M_VNODE);
+ /*
+ * Sanity check: is this operation listed
+ * in the list of operations? We check this
+ * by seeing if its offest is zero. Since
+ * the default routine should always be listed
+ * first, it should be the only one with a zero
+ * offset. Any other operation with a zero
+ * offset is probably not listed in
+ * vfs_op_descs, and so is probably an error.
+ *
+ * A panic here means the layer programmer
+ * has committed the all-too common bug
+ * of adding a new operation to the layer's
+ * list of vnode operations but
+ * not adding the operation to the system-wide
+ * list of supported operations.
+ */
+ if (opve_descp->opve_op->vdesc_offset == 0 &&
+ opve_descp->opve_op->vdesc_offset !=
+ VOFFSET(vop_default)) {
+ printf("operation %s not listed in %s.\n",
+ opve_descp->opve_op->vdesc_name,
+ "vfs_op_descs");
+ panic ("vfs_opv_init: bad operation");
+ }
+ /*
+ * Fill in this entry.
+ */
+ opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
+ opve_descp->opve_impl;
}
- newopv[vnodeopv_num] = opv;
- vnodeopv_descs = newopv;
- vnodeopv_num++;
-
- /* See if we have turned up a new vnode op desc */
+ /*
+ * Finally, go back and replace unfilled routines
+ * with their default. (Sigh, an O(n^3) algorithm. I
+ * could make it better, but that'd be work, and n is small.)
+ */
opv_desc_vector = *(opv->opv_desc_vector_p);
- for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
- for (j = 0; j < num_op_descs; j++) {
- if (desc == vfs_op_descs[j]) {
- /* found it, increase reference count */
- vfs_op_desc_refs[j]++;
- break;
- }
- }
- if (j == num_op_descs) {
- /* not found, new entry */
- MALLOC(newop, struct vnodeop_desc **,
- (num_op_descs + 1) * sizeof(*newop),
- M_VNODE, M_WAITOK);
- if (newop == NULL)
- panic("vfs_add_vnodeops: no memory for desc");
- /* new reference count (for unload) */
- MALLOC(newref, int *,
- (num_op_descs + 1) * sizeof(*newref),
- M_VNODE, M_WAITOK);
- if (newref == NULL)
- panic("vfs_add_vnodeops: no memory for refs");
- if (vfs_op_descs) {
- bcopy(vfs_op_descs, newop,
- num_op_descs * sizeof(*newop));
- FREE(vfs_op_descs, M_VNODE);
- }
- if (vfs_op_desc_refs) {
- bcopy(vfs_op_desc_refs, newref,
- num_op_descs * sizeof(*newref));
- FREE(vfs_op_desc_refs, M_VNODE);
- }
- newop[num_op_descs] = desc;
- newref[num_op_descs] = 1;
- vfs_op_descs = newop;
- vfs_op_desc_refs = newref;
- num_op_descs++;
- }
+ /*
+ * Force every operations vector to have a default routine.
+ */
+ if (opv_desc_vector[VOFFSET(vop_default)]==NULL) {
+ panic("vfs_opv_init: operation vector without default routine.");
}
- vfs_opv_recalc();
+ for (k = 0; k<vfs_opv_numops; k++)
+ if (opv_desc_vector[k] == NULL)
+ opv_desc_vector[k] =
+ opv_desc_vector[VOFFSET(vop_default)];
}
-void
-vfs_rm_vnodeops(void *data)
+/*
+ * Initialize known vnode operations vectors.
+ */
+static void
+vfs_op_init()
{
- struct vnodeopv_desc *opv;
- struct vnodeopv_desc **newopv;
- struct vnodeop_desc **newop;
- int *newref;
- vop_t **opv_desc_vector;
- struct vnodeop_desc *desc;
- int i, j, k;
-
- opv = (struct vnodeopv_desc *)data;
- /* Lower ref counts on descs in the table and release if zero */
- opv_desc_vector = *(opv->opv_desc_vector_p);
- for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
- for (j = 0; j < num_op_descs; j++) {
- if (desc == vfs_op_descs[j]) {
- /* found it, decrease reference count */
- vfs_op_desc_refs[j]--;
- break;
- }
- }
- for (j = 0; j < num_op_descs; j++) {
- if (vfs_op_desc_refs[j] > 0)
- continue;
- if (vfs_op_desc_refs[j] < 0)
- panic("vfs_remove_vnodeops: negative refcnt");
- MALLOC(newop, struct vnodeop_desc **,
- (num_op_descs - 1) * sizeof(*newop),
- M_VNODE, M_WAITOK);
- if (newop == NULL)
- panic("vfs_remove_vnodeops: no memory for desc");
- /* new reference count (for unload) */
- MALLOC(newref, int *,
- (num_op_descs - 1) * sizeof(*newref),
- M_VNODE, M_WAITOK);
- if (newref == NULL)
- panic("vfs_remove_vnodeops: no memory for refs");
- for (k = j; k < (num_op_descs - 1); k++) {
- vfs_op_descs[k] = vfs_op_descs[k + 1];
- vfs_op_desc_refs[k] = vfs_op_desc_refs[k + 1];
- }
- bcopy(vfs_op_descs, newop,
- (num_op_descs - 1) * sizeof(*newop));
- bcopy(vfs_op_desc_refs, newref,
- (num_op_descs - 1) * sizeof(*newref));
- FREE(vfs_op_descs, M_VNODE);
- FREE(vfs_op_desc_refs, M_VNODE);
- vfs_op_descs = newop;
- vfs_op_desc_refs = newref;
- num_op_descs--;
- }
- }
-
- for (i = 0; i < vnodeopv_num; i++) {
- if (vnodeopv_descs[i] == opv) {
- for (j = i; j < (vnodeopv_num - 1); j++)
- vnodeopv_descs[j] = vnodeopv_descs[j + 1];
- break;
- }
- }
- if (i == vnodeopv_num)
- panic("vfs_remove_vnodeops: opv not found");
- MALLOC(newopv, struct vnodeopv_desc **,
- (vnodeopv_num - 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
- if (newopv == NULL)
- panic("vfs_remove_vnodeops: no memory");
- bcopy(vnodeopv_descs, newopv, (vnodeopv_num - 1) * sizeof(*newopv));
- FREE(vnodeopv_descs, M_VNODE);
- vnodeopv_descs = newopv;
- vnodeopv_num--;
+ int i;
- vfs_opv_recalc();
+ DODEBUG(printf("Vnode_interface_init.\n"));
+ DODEBUG(printf ("vfs_opv_numops=%d\n", vfs_opv_numops));
+#ifdef unused
+ /*
+ * Set all vnode vectors to a well known value.
+ */
+ for (i = 0; vfs_opv_descs[i]; i++)
+ *(vfs_opv_descs[i]->opv_desc_vector_p) = NULL;
+#endif
+ /*
+ * assign each op to its offset
+ *
+ * XXX This should not be needed, but is because the per
+ * XXX FS ops tables are not sorted according to the
+ * XXX vnodeop_desc's offset in vfs_op_descs. This
+ * XXX is the same reason we have to take the hit for
+ * XXX the static inline function calls instead of using
+ * XXX simple macro references.
+ */
+ for (i = 0; i < vfs_opv_numops; i++)
+ vfs_op_descs[i]->vdesc_offset = i;
+#ifdef unused
+ /* Finish the job */
+ for (i = 0; vfs_opv_descs[i]; i++)
+ vfs_opv_init(vfs_opv_descs[i]);
+#endif
}
/*
* Routines having to do with the management of the vnode table.
*/
+extern struct vnodeops dead_vnodeops;
+extern struct vnodeops spec_vnodeops;
struct vattr va_null;
/*
@@ -305,8 +240,11 @@ struct vattr va_null;
*/
/* ARGSUSED*/
static void
-vfsinit(void *dummy)
+vfsinit(dummy)
+ void *dummy;
{
+ struct vfsconf **vfc, *vfsp;
+ int maxtypenum;
namei_zone = zinit("NAMEI", MAXPATHLEN, 0, 0, 2);
@@ -319,23 +257,28 @@ vfsinit(void *dummy)
*/
nchinit();
/*
+ * Build vnode operation vectors.
+ */
+ vfs_op_init();
+ /*
* Initialize each file system type.
* Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF).
*/
vattr_null(&va_null);
maxvfsconf = VFS_GENERIC + 1;
}
-SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL)
int
-vfs_register(struct vfsconf *vfc)
+vfs_register(vfc)
+ struct vfsconf *vfc;
{
struct linker_set *l;
struct sysctl_oid **oidpp;
struct vfsconf *vfsp;
- int i, exists;
+ int error, i, maxtypenum, exists;
vfsp = NULL;
+ exists = 0;
l = &sysctl__vfs;
if (vfsconf)
for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next)
@@ -344,33 +287,23 @@ vfs_register(struct vfsconf *vfc)
vfc->vfc_typenum = maxvfsconf++;
if (vfc->vfc_vfsops->vfs_oid != NULL) {
- /*
- * Attach the oid to the "vfs" node of the sysctl tree if
- * it isn't already there (it will be there for statically
- * configured vfs's).
- */
- exists = 0;
- for (i = l->ls_length,
- oidpp = (struct sysctl_oid **)l->ls_items;
- i-- != 0; oidpp++)
- if (*oidpp == vfc->vfc_vfsops->vfs_oid) {
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ for (i = l->ls_length; i-- && !exists; oidpp++)
+ if (*oidpp == vfc->vfc_vfsops->vfs_oid)
exists = 1;
+ }
+ if (exists == 0 && vfc->vfc_vfsops->vfs_oid != NULL) {
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ for (i = l->ls_length; i--; oidpp++) {
+ if (*oidpp == NULL ||
+ *oidpp == &sysctl___vfs_mod0 ||
+ *oidpp == &sysctl___vfs_mod1) {
+ *oidpp = vfc->vfc_vfsops->vfs_oid;
+ (*oidpp)->oid_number = vfc->vfc_typenum;
+ sysctl_order_all();
break;
}
- if (exists == 0)
- for (i = l->ls_length,
- oidpp = (struct sysctl_oid **)l->ls_items;
- i-- != 0; oidpp++) {
- if (*oidpp == NULL ||
- *oidpp == &sysctl___vfs_mod0 ||
- *oidpp == &sysctl___vfs_mod1) {
- *oidpp = vfc->vfc_vfsops->vfs_oid;
- break;
- }
- }
-
- vfc->vfc_vfsops->vfs_oid->oid_number = vfc->vfc_typenum;
- sysctl_order_all();
+ }
}
if (vfsp)
vfsp->vfc_next = vfc;
@@ -387,8 +320,24 @@ vfs_register(struct vfsconf *vfc)
}
+/*
+ * To be called at SI_SUB_VFS, SECOND, for each VFS before any are registered.
+ */
+void
+vfs_mod_opv_init(handle)
+ void *handle;
+{
+ int i;
+ struct vnodeopv_desc *opv;
+
+ opv = (struct vnodeopv_desc *)handle;
+ *(opv->opv_desc_vector_p) = NULL;
+ vfs_opv_init(opv);
+}
+
int
-vfs_unregister(struct vfsconf *vfc)
+vfs_unregister(vfc)
+ struct vfsconf *vfc;
{
struct linker_set *l;
struct sysctl_oid **oidpp;
@@ -435,27 +384,3 @@ vfs_unregister(struct vfsconf *vfc)
maxvfsconf = maxtypenum + 1;
return 0;
}
-
-int
-vfs_modevent(module_t mod, int type, void *data)
-{
- struct vfsconf *vfc;
- int error = 0;
-
- vfc = (struct vfsconf *)data;
-
- switch (type) {
- case MOD_LOAD:
- if (vfc)
- error = vfs_register(vfc);
- break;
-
- case MOD_UNLOAD:
- if (vfc)
- error = vfs_unregister(vfc);
- break;
- default: /* including MOD_SHUTDOWN */
- break;
- }
- return (error);
-}
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 67efd523706d..b2d09547b936 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id: vfs_lookup.c,v 1.30 1999/01/08 17:31:16 eivind Exp $
+ * $Id: vfs_lookup.c,v 1.27 1998/04/08 18:31:57 wosch Exp $
*/
#include "opt_ktrace.h"
@@ -89,11 +89,14 @@ namei(ndp)
struct proc *p = cnp->cn_proc;
ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred;
- KASSERT(cnp->cn_cred && cnp->cn_proc, ("namei: bad cred/proc"));
- KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0,
- ("namei: nameiop contaminated with flags"));
- KASSERT((cnp->cn_flags & OPMASK) == 0,
- ("namei: flags contaminated with nameiops"));
+#ifdef DIAGNOSTIC
+ if (!cnp->cn_cred || !cnp->cn_proc)
+ panic ("namei: bad cred/proc");
+ if (cnp->cn_nameiop & (~OPMASK))
+ panic ("namei: nameiop contaminated with flags");
+ if (cnp->cn_flags & OPMASK)
+ panic ("namei: flags contaminated with nameiops");
+#endif
fdp = cnp->cn_proc->p_fd;
/*
@@ -165,11 +168,9 @@ namei(ndp)
if (ndp->ni_vp && ndp->ni_vp->v_type == VREG &&
(cnp->cn_nameiop != DELETE) &&
- ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) ==
- LOCKLEAF))
+ ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
vfs_object_create(ndp->ni_vp,
- ndp->ni_cnd.cn_proc,
- ndp->ni_cnd.cn_cred);
+ ndp->ni_cnd.cn_proc, ndp->ni_cnd.cn_cred, 1);
return (0);
}
@@ -415,7 +416,10 @@ unionlookup:
ndp->ni_vp = NULL;
ASSERT_VOP_LOCKED(dp, "lookup");
if (error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) {
- KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
+#ifdef DIAGNOSTIC
+ if (ndp->ni_vp != NULL)
+ panic("leaf should be empty");
+#endif
#ifdef NAMEI_DIAGNOSTIC
printf("not found\n");
#endif
@@ -643,7 +647,10 @@ relookup(dvp, vpp, cnp)
* We now have a segment name to search for, and a directory to search.
*/
if (error = VOP_LOOKUP(dp, vpp, cnp)) {
- KASSERT(*vpp == NULL, ("leaf should be empty"));
+#ifdef DIAGNOSTIC
+ if (*vpp != NULL)
+ panic("leaf should be empty");
+#endif
if (error != EJUSTRETURN)
goto bad;
/*
@@ -666,11 +673,13 @@ relookup(dvp, vpp, cnp)
}
dp = *vpp;
+#ifdef DIAGNOSTIC
/*
* Check for symbolic link
*/
- KASSERT(dp->v_type != VLNK || !(cnp->cn_flags & FOLLOW),
- ("relookup: symlink found.\n"));
+ if (dp->v_type == VLNK && (cnp->cn_flags & FOLLOW))
+ panic ("relookup: symlink found.\n");
+#endif
/*
* Disallow directory write attempts on read-only file systems.
@@ -689,7 +698,7 @@ relookup(dvp, vpp, cnp)
if (dp->v_type == VREG &&
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
- vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred);
+ vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred, 1);
if ((cnp->cn_flags & LOCKLEAF) == 0)
VOP_UNLOCK(dp, 0, p);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 179ef7899463..867cf8866f37 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.181 1999/01/08 17:31:17 eivind Exp $
+ * $Id: vfs_subr.c,v 1.165 1998/10/13 08:24:41 dg Exp $
*/
/*
@@ -46,8 +46,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/malloc.h>
@@ -77,6 +75,9 @@
static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");
static void insmntque __P((struct vnode *vp, struct mount *mp));
+#ifdef DDB
+static void printlockedvnodes __P((void));
+#endif
static void vclean __P((struct vnode *vp, int flags, struct proc *p));
static void vfree __P((struct vnode *));
static void vgonel __P((struct vnode *vp, struct proc *p));
@@ -92,6 +93,15 @@ int vttoif_tab[9] = {
S_IFSOCK, S_IFIFO, S_IFMT,
};
+/*
+ * Insq/Remq for the vnode usage lists.
+ */
+#define bufinsvn(bp, dp) LIST_INSERT_HEAD(dp, bp, b_vnbufs)
+#define bufremvn(bp) { \
+ LIST_REMOVE(bp, b_vnbufs); \
+ (bp)->b_vnbufs.le_next = NOLIST; \
+}
+
static TAILQ_HEAD(freelst, vnode) vnode_free_list; /* vnode free list */
struct tobefreelist vnode_tobefree_list; /* vnode free list */
@@ -107,13 +117,11 @@ SYSCTL_INT(_vfs, OID_AUTO, ioopt, CTLFLAG_RW, &vfs_ioopt, 0, "");
struct mntlist mountlist; /* mounted filesystem list */
struct simplelock mountlist_slock;
+static struct simplelock mntid_slock;
struct simplelock mntvnode_slock;
int nfs_mount_type = -1;
-#ifndef NULL_SIMPLELOCKS
-static struct simplelock mntid_slock;
static struct simplelock vnode_free_list_slock;
static struct simplelock spechash_slock;
-#endif
struct nfs_public nfs_pub; /* publicly exported FS */
static vm_zone_t vnode_zone;
@@ -121,7 +129,7 @@ static vm_zone_t vnode_zone;
* The workitem queue.
*/
#define SYNCER_MAXDELAY 32
-static int syncer_maxdelay = SYNCER_MAXDELAY; /* maximum delay time */
+int syncer_maxdelay = SYNCER_MAXDELAY; /* maximum delay time */
time_t syncdelay = 30;
int rushjob; /* number of slots to run ASAP */
@@ -422,7 +430,9 @@ getnewvnode(tag, mp, vops, vpp)
vp = NULL;
} else {
for (vp = TAILQ_FIRST(&vnode_free_list); vp; vp = nvp) {
+
nvp = TAILQ_NEXT(vp, v_freelist);
+
if (!simple_lock_try(&vp->v_interlock))
continue;
if (vp->v_usecount)
@@ -466,7 +476,7 @@ getnewvnode(tag, mp, vops, vpp)
simple_unlock(&vp->v_interlock);
}
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
{
int s;
@@ -499,8 +509,6 @@ getnewvnode(tag, mp, vops, vpp)
numvnodes++;
}
- TAILQ_INIT(&vp->v_cleanblkhd);
- TAILQ_INIT(&vp->v_dirtyblkhd);
vp->v_type = VNON;
vp->v_tag = tag;
vp->v_op = vops;
@@ -510,7 +518,7 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_data = 0;
splx(s);
- vfs_object_create(vp, p, p->p_ucred);
+ vfs_object_create(vp, p, p->p_ucred, TRUE);
return (0);
}
@@ -582,34 +590,37 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo)
s = splbio();
while (vp->v_numoutput) {
vp->v_flag |= VBWAIT;
- error = tsleep((caddr_t)&vp->v_numoutput,
- slpflag | (PRIBIO + 1), "vinvlbuf", slptimeo);
- if (error) {
- splx(s);
- return (error);
- }
+ tsleep((caddr_t)&vp->v_numoutput,
+ slpflag | (PRIBIO + 1),
+ "vinvlbuf", slptimeo);
}
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first != NULL) {
splx(s);
if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) != 0)
return (error);
s = splbio();
if (vp->v_numoutput > 0 ||
- !TAILQ_EMPTY(&vp->v_dirtyblkhd))
+ vp->v_dirtyblkhd.lh_first != NULL)
panic("vinvalbuf: dirty bufs");
}
splx(s);
}
s = splbio();
for (;;) {
- blist = TAILQ_FIRST(&vp->v_cleanblkhd);
- if (!blist)
- blist = TAILQ_FIRST(&vp->v_dirtyblkhd);
+ if ((blist = vp->v_cleanblkhd.lh_first) && (flags & V_SAVEMETA))
+ while (blist && blist->b_lblkno < 0)
+ blist = blist->b_vnbufs.le_next;
+ if (!blist && (blist = vp->v_dirtyblkhd.lh_first) &&
+ (flags & V_SAVEMETA))
+ while (blist && blist->b_lblkno < 0)
+ blist = blist->b_vnbufs.le_next;
if (!blist)
break;
for (bp = blist; bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ nbp = bp->b_vnbufs.le_next;
+ if ((flags & V_SAVEMETA) && bp->b_lblkno < 0)
+ continue;
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
error = tsleep((caddr_t) bp,
@@ -667,12 +678,17 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo)
simple_lock(&vp->v_interlock);
object = vp->v_object;
if (object != NULL) {
- vm_object_page_remove(object, 0, 0,
- (flags & V_SAVE) ? TRUE : FALSE);
+ if (flags & V_SAVEMETA)
+ vm_object_page_remove(object, 0, object->size,
+ (flags & V_SAVE) ? TRUE : FALSE);
+ else
+ vm_object_page_remove(object, 0, 0,
+ (flags & V_SAVE) ? TRUE : FALSE);
}
simple_unlock(&vp->v_interlock);
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) || !TAILQ_EMPTY(&vp->v_cleanblkhd))
+ if (!(flags & V_SAVEMETA) &&
+ (vp->v_dirtyblkhd.lh_first || vp->v_cleanblkhd.lh_first))
panic("vinvalbuf: flush failed");
return (0);
}
@@ -691,8 +707,9 @@ vtruncbuf(vp, cred, p, length, blksize)
int blksize;
{
register struct buf *bp;
- struct buf *nbp;
- int s, anyfreed;
+ struct buf *nbp, *blist;
+ int s, error, anyfreed;
+ vm_object_t object;
int trunclbn;
/*
@@ -705,8 +722,10 @@ restart:
anyfreed = 1;
for (;anyfreed;) {
anyfreed = 0;
- for (bp = TAILQ_FIRST(&vp->v_cleanblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for ( bp = LIST_FIRST(&vp->v_cleanblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if (bp->b_lblkno >= trunclbn) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -719,7 +738,8 @@ restart:
brelse(bp);
anyfreed = 1;
}
- if (nbp && (((nbp->b_xflags & B_VNCLEAN) == 0)||
+ if (nbp &&
+ ((LIST_NEXT(nbp, b_vnbufs) == NOLIST) ||
(nbp->b_vp != vp) ||
(nbp->b_flags & B_DELWRI))) {
goto restart;
@@ -727,8 +747,10 @@ restart:
}
}
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if (bp->b_lblkno >= trunclbn) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -741,7 +763,8 @@ restart:
brelse(bp);
anyfreed = 1;
}
- if (nbp && (((nbp->b_xflags & B_VNDIRTY) == 0)||
+ if (nbp &&
+ ((LIST_NEXT(nbp, b_vnbufs) == NOLIST) ||
(nbp->b_vp != vp) ||
(nbp->b_flags & B_DELWRI) == 0)) {
goto restart;
@@ -752,8 +775,10 @@ restart:
if (length > 0) {
restartsync:
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if ((bp->b_flags & B_DELWRI) && (bp->b_lblkno < 0)) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -796,8 +821,10 @@ bgetvp(vp, bp)
{
int s;
- KASSERT(bp->b_vp == NULL, ("bgetvp: not free"));
-
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp)
+ panic("bgetvp: not free");
+#endif
vhold(vp);
bp->b_vp = vp;
if (vp->v_type == VBLK || vp->v_type == VCHR)
@@ -808,9 +835,7 @@ bgetvp(vp, bp)
* Insert onto list for new vnode.
*/
s = splbio();
- bp->b_xflags |= B_VNCLEAN;
- bp->b_xflags &= ~B_VNDIRTY;
- TAILQ_INSERT_TAIL(&vp->v_cleanblkhd, bp, b_vnbufs);
+ bufinsvn(bp, &vp->v_cleanblkhd);
splx(s);
}
@@ -822,25 +847,21 @@ brelvp(bp)
register struct buf *bp;
{
struct vnode *vp;
- struct buflists *listheadp;
int s;
- KASSERT(bp->b_vp != NULL, ("brelvp: NULL"));
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp == (struct vnode *) 0)
+ panic("brelvp: NULL");
+#endif
/*
* Delete from old vnode list, if on one.
*/
vp = bp->b_vp;
s = splbio();
- if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
- if (bp->b_xflags & B_VNDIRTY)
- listheadp = &vp->v_dirtyblkhd;
- else
- listheadp = &vp->v_cleanblkhd;
- TAILQ_REMOVE(listheadp, bp, b_vnbufs);
- bp->b_xflags &= ~(B_VNDIRTY|B_VNCLEAN);
- }
- if ((vp->v_flag & VONWORKLST) && TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (bp->b_vnbufs.le_next != NOLIST)
+ bufremvn(bp);
+ if ((vp->v_flag & VONWORKLST) && (LIST_FIRST(&vp->v_dirtyblkhd) == NULL)) {
vp->v_flag &= ~VONWORKLST;
LIST_REMOVE(vp, v_synclist);
}
@@ -939,7 +960,7 @@ sched_sync(void)
(void) VOP_FSYNC(vp, p->p_ucred, MNT_LAZY, p);
VOP_UNLOCK(vp, 0, p);
if (LIST_FIRST(slp) == vp) {
- if (TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
+ if (LIST_FIRST(&vp->v_dirtyblkhd) == NULL &&
vp->v_type != VBLK)
panic("sched_sync: fsync failed");
/*
@@ -991,9 +1012,10 @@ pbgetvp(vp, bp)
register struct vnode *vp;
register struct buf *bp;
{
-
- KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
-
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp)
+ panic("pbgetvp: not free");
+#endif
bp->b_vp = vp;
if (vp->v_type == VBLK || vp->v_type == VCHR)
bp->b_dev = vp->v_rdev;
@@ -1009,7 +1031,10 @@ pbrelvp(bp)
register struct buf *bp;
{
- KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL"));
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp == (struct vnode *) 0)
+ panic("pbrelvp: NULL");
+#endif
bp->b_vp = (struct vnode *) 0;
}
@@ -1025,7 +1050,6 @@ reassignbuf(bp, newvp)
register struct vnode *newvp;
{
struct buflists *listheadp;
- struct vnode *oldvp;
int delay;
int s;
@@ -1038,15 +1062,9 @@ reassignbuf(bp, newvp)
/*
* Delete from old vnode list, if on one.
*/
- if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
- oldvp = bp->b_vp;
- if (bp->b_xflags & B_VNDIRTY)
- listheadp = &oldvp->v_dirtyblkhd;
- else
- listheadp = &oldvp->v_cleanblkhd;
- TAILQ_REMOVE(listheadp, bp, b_vnbufs);
- bp->b_xflags &= ~(B_VNDIRTY|B_VNCLEAN);
- vdrop(oldvp);
+ if (bp->b_vnbufs.le_next != NOLIST) {
+ bufremvn(bp);
+ vdrop(bp->b_vp);
}
/*
* If dirty, put on list of dirty buffers; otherwise insert onto list
@@ -1072,28 +1090,20 @@ reassignbuf(bp, newvp)
}
vn_syncer_add_to_worklist(newvp, delay);
}
- bp->b_xflags |= B_VNDIRTY;
- tbp = TAILQ_FIRST(listheadp);
- if (tbp == NULL ||
- (bp->b_lblkno >= 0 && tbp->b_lblkno > bp->b_lblkno)) {
- TAILQ_INSERT_HEAD(listheadp, bp, b_vnbufs);
+ tbp = listheadp->lh_first;
+ if (!tbp || (tbp->b_lblkno > bp->b_lblkno)) {
+ bufinsvn(bp, listheadp);
} else {
- if (bp->b_lblkno >= 0) {
- struct buf *ttbp;
- while ((ttbp = TAILQ_NEXT(tbp, b_vnbufs)) &&
- (ttbp->b_lblkno < bp->b_lblkno)) {
- tbp = ttbp;
- }
- TAILQ_INSERT_AFTER(listheadp, tbp, bp, b_vnbufs);
- } else {
- TAILQ_INSERT_TAIL(listheadp, bp, b_vnbufs);
+ while (tbp->b_vnbufs.le_next &&
+ (tbp->b_vnbufs.le_next->b_lblkno < bp->b_lblkno)) {
+ tbp = tbp->b_vnbufs.le_next;
}
+ LIST_INSERT_AFTER(tbp, bp, b_vnbufs);
}
} else {
- bp->b_xflags |= B_VNCLEAN;
- TAILQ_INSERT_TAIL(&newvp->v_cleanblkhd, bp, b_vnbufs);
+ bufinsvn(bp, &newvp->v_cleanblkhd);
if ((newvp->v_flag & VONWORKLST) &&
- TAILQ_EMPTY(&newvp->v_dirtyblkhd)) {
+ LIST_FIRST(&newvp->v_dirtyblkhd) == NULL) {
newvp->v_flag &= ~VONWORKLST;
LIST_REMOVE(newvp, v_synclist);
}
@@ -1116,20 +1126,16 @@ bdevvp(dev, vpp)
struct vnode *nvp;
int error;
- /* XXX 255 is for mfs. */
- if (dev == NODEV || (major(dev) != 255 && (major(dev) >= nblkdev ||
- bdevsw[major(dev)] == NULL))) {
- *vpp = NULLVP;
- return (ENXIO);
- }
- error = getnewvnode(VT_NON, (struct mount *)0, spec_vnodeop_p, &nvp);
+ if (dev == NODEV)
+ return (0);
+ error = getnewvnode(VT_NON, (struct mount *) 0, spec_vnodeop_p, &nvp);
if (error) {
- *vpp = NULLVP;
+ *vpp = 0;
return (error);
}
vp = nvp;
vp->v_type = VBLK;
- if ((nvp = checkalias(vp, dev, (struct mount *)0)) != NULL) {
+ if ((nvp = checkalias(vp, dev, (struct mount *) 0))) {
vput(vp);
vp = nvp;
}
@@ -1304,8 +1310,10 @@ vrele(vp)
{
struct proc *p = curproc; /* XXX */
- KASSERT(vp != NULL, ("vrele: null vp"));
-
+#ifdef DIAGNOSTIC
+ if (vp == NULL)
+ panic("vrele: null vp");
+#endif
simple_lock(&vp->v_interlock);
if (vp->v_usecount > 1) {
@@ -1345,7 +1353,10 @@ vput(vp)
{
struct proc *p = curproc; /* XXX */
- KASSERT(vp != NULL, ("vput: null vp"));
+#ifdef DIAGNOSTIC
+ if (vp == NULL)
+ panic("vput: null vp");
+#endif
simple_lock(&vp->v_interlock);
@@ -1572,7 +1583,7 @@ vclean(vp, flags, p)
*/
if (active) {
if (flags & DOCLOSE)
- VOP_CLOSE(vp, FNONBLOCK, NOCRED, p);
+ VOP_CLOSE(vp, IO_NDELAY, NOCRED, p);
VOP_INACTIVE(vp, p);
} else {
/*
@@ -1632,7 +1643,10 @@ vop_revoke(ap)
struct vnode *vp, *vq;
struct proc *p = curproc; /* XXX */
- KASSERT((ap->a_flags & REVOKEALL) != 0, ("vop_revoke"));
+#ifdef DIAGNOSTIC
+ if ((ap->a_flags & REVOKEALL) == 0)
+ panic("vop_revoke");
+#endif
vp = ap->a_vp;
simple_lock(&vp->v_interlock);
@@ -1891,7 +1905,7 @@ vprint(label, vp)
char *label;
register struct vnode *vp;
{
- char buf[96];
+ char buf[64];
if (label != NULL)
printf("%s: %p: ", label, (void *)vp);
@@ -1932,12 +1946,12 @@ vprint(label, vp)
}
#ifdef DDB
-#include <ddb/ddb.h>
/*
* List all of the locked vnodes in the system.
* Called when debugging the kernel.
*/
-DB_SHOW_COMMAND(lockedvnodes, lockedvnodes)
+static void
+printlockedvnodes()
{
struct proc *p = curproc; /* XXX */
struct mount *mp, *nmp;
@@ -2041,6 +2055,8 @@ sysctl_ovfs_conf SYSCTL_HANDLER_ARGS
#endif /* 1 || COMPAT_PRELITE2 */
+static volatile int kinfo_vdebug = 1;
+
#if 0
#define KINFO_VNODESLOP 10
/*
@@ -2082,6 +2098,8 @@ again:
*/
if (vp->v_mount != mp) {
simple_unlock(&mntvnode_slock);
+ if (kinfo_vdebug)
+ printf("kinfo: vp changed\n");
goto again;
}
nvp = vp->v_mntvnodes.le_next;
@@ -2463,7 +2481,7 @@ loop:
if (!vget(vp,
LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) {
if (vp->v_object) {
- vm_object_page_clean(vp->v_object, 0, 0, flags == MNT_WAIT ? OBJPC_SYNC : 0);
+ vm_object_page_clean(vp->v_object, 0, 0, TRUE);
anyio = 1;
}
vput(vp);
@@ -2482,20 +2500,27 @@ loop:
* afford the additional metadata buffering capability of the
* VMIO code by making the device node be VMIO mode also.
*
- * vp must be locked when vfs_object_create is called.
+ * If !waslocked, must be called with interlock.
*/
int
-vfs_object_create(vp, p, cred)
+vfs_object_create(vp, p, cred, waslocked)
struct vnode *vp;
struct proc *p;
struct ucred *cred;
+ int waslocked;
{
struct vattr vat;
vm_object_t object;
int error = 0;
- if ((vp->v_type != VREG) && (vp->v_type != VBLK))
+ if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
+ if (!waslocked)
+ simple_unlock(&vp->v_interlock);
return 0;
+ }
+
+ if (!waslocked)
+ vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY, p);
retry:
if ((object = vp->v_object) == NULL) {
@@ -2503,8 +2528,7 @@ retry:
if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
goto retn;
object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
- } else if (major(vp->v_rdev) < nblkdev &&
- bdevsw[major(vp->v_rdev)] != NULL) {
+ } else if (major(vp->v_rdev) < nblkdev) {
/*
* This simply allocates the biggest object possible
* for a VBLK vnode. This should be fixed, but doesn't
@@ -2523,10 +2547,16 @@ retry:
}
}
- if (vp->v_object)
+ if (vp->v_object) {
vp->v_flag |= VOBJBUF;
+ }
retn:
+ if (!waslocked) {
+ simple_lock(&vp->v_interlock);
+ VOP_UNLOCK(vp, LK_INTERLOCK, p);
+ }
+
return error;
}
@@ -2663,16 +2693,16 @@ vn_pollgone(vp)
* Routine to create and manage a filesystem syncer vnode.
*/
#define sync_close ((int (*) __P((struct vop_close_args *)))nullop)
-static int sync_fsync __P((struct vop_fsync_args *));
-static int sync_inactive __P((struct vop_inactive_args *));
-static int sync_reclaim __P((struct vop_reclaim_args *));
+int sync_fsync __P((struct vop_fsync_args *));
+int sync_inactive __P((struct vop_inactive_args *));
+int sync_reclaim __P((struct vop_reclaim_args *));
#define sync_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock)
#define sync_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock)
-static int sync_print __P((struct vop_print_args *));
+int sync_print __P((struct vop_print_args *));
#define sync_islocked ((int(*) __P((struct vop_islocked_args *)))vop_noislocked)
-static vop_t **sync_vnodeop_p;
-static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
+vop_t **sync_vnodeop_p;
+struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
{ &vop_default_desc, (vop_t *) vop_eopnotsupp },
{ &vop_close_desc, (vop_t *) sync_close }, /* close */
{ &vop_fsync_desc, (vop_t *) sync_fsync }, /* fsync */
@@ -2684,7 +2714,7 @@ static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
{ &vop_islocked_desc, (vop_t *) sync_islocked }, /* islocked */
{ NULL, NULL }
};
-static struct vnodeopv_desc sync_vnodeop_opv_desc =
+struct vnodeopv_desc sync_vnodeop_opv_desc =
{ &sync_vnodeop_p, sync_vnodeop_entries };
VNODEOP_SET(sync_vnodeop_opv_desc);
@@ -2730,7 +2760,7 @@ vfs_allocate_syncvnode(mp)
/*
* Do a lazy sync of the filesystem.
*/
-static int
+int
sync_fsync(ap)
struct vop_fsync_args /* {
struct vnode *a_vp;
@@ -2777,7 +2807,7 @@ sync_fsync(ap)
/*
* The syncer vnode is no referenced.
*/
-static int
+int
sync_inactive(ap)
struct vop_inactive_args /* {
struct vnode *a_vp;
@@ -2792,7 +2822,7 @@ sync_inactive(ap)
/*
* The syncer vnode is no longer needed and is being decommissioned.
*/
-static int
+int
sync_reclaim(ap)
struct vop_reclaim_args /* {
struct vnode *a_vp;
@@ -2812,7 +2842,7 @@ sync_reclaim(ap)
/*
* Print out a syncer vnode.
*/
-static int
+int
sync_print(ap)
struct vop_print_args /* {
struct vnode *a_vp;
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 18e39d63abd5..ec543ab35700 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,12 +36,21 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.111 1998/12/12 21:07:09 dillon Exp $
+ * $Id: vfs_syscalls.c,v 1.106 1998/09/10 02:27:52 tegge Exp $
*/
/* For 4.3 integer FS ID compatibility */
#include "opt_compat.h"
+/*
+ * XXX - The following is required because of some magic done
+ * in getdirentries() below which is only done if the translucent
+ * filesystem `UNION' is compiled into the kernel. This is broken,
+ * but I don't have time to study the code deeply enough to understand
+ * what's going on and determine an appropriate fix. -GAW
+ */
+#include "opt_union.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysent.h>
@@ -51,7 +60,6 @@
#include <sys/kernel.h>
#include <sys/fcntl.h>
#include <sys/file.h>
-#include <sys/linker.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
@@ -60,7 +68,9 @@
#include <sys/proc.h>
#include <sys/dirent.h>
+#ifdef UNION
#include <miscfs/union/union.h>
+#endif
#include <vm/vm.h>
#include <vm/vm_object.h>
@@ -76,8 +86,6 @@ static int setfflags __P((struct proc *, struct vnode *, int));
static int setutimes __P((struct proc *, struct vnode *, struct timeval *, int));
static int usermount = 0; /* if 1, non-root can mount fs. */
-int (*union_dircheckp) __P((struct proc *, struct vnode **, struct file *));
-
SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
/*
@@ -225,36 +233,8 @@ mount(p, uap)
if (!strcmp(vfsp->vfc_name, fstypename))
break;
if (vfsp == NULL) {
- linker_file_t lf;
-
- /* Refuse to load modules if securelevel raised */
- if (securelevel > 0) {
- vput(vp);
- return EPERM;
- }
- /* Only load modules for root (very important!) */
- if (error = suser(p->p_ucred, &p->p_acflag)) {
- vput(vp);
- return error;
- }
- error = linker_load_file(fstypename, &lf);
- if (error || lf == NULL) {
- vput(vp);
- if (lf == NULL)
- error = ENODEV;
- return error;
- }
- lf->userrefs++;
- /* lookup again, see if the VFS was loaded */
- for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
- if (!strcmp(vfsp->vfc_name, fstypename))
- break;
- if (vfsp == NULL) {
- lf->userrefs--;
- linker_file_unload(lf);
- vput(vp);
- return (ENODEV);
- }
+ vput(vp);
+ return (ENODEV);
}
simple_lock(&vp->v_interlock);
if ((vp->v_flag & VMOUNT) != 0 ||
@@ -494,8 +474,6 @@ dounmount(mp, flags, p)
mp->mnt_flag |= async_flag;
lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE,
&mountlist_slock, p);
- if (mp->mnt_kern_flag & MNTK_MWAIT)
- wakeup((caddr_t)mp);
return (error);
}
CIRCLEQ_REMOVE(&mountlist, mp, mnt_list);
@@ -976,7 +954,7 @@ open(p, uap)
fp->f_flag |= FHASLOCK;
}
if ((vp->v_type == VREG) && (vp->v_object == NULL))
- vfs_object_create(vp, p, p->p_ucred);
+ vfs_object_create(vp, p, p->p_ucred, TRUE);
VOP_UNLOCK(vp, 0, p);
p->p_retval[0] = indx;
return (0);
@@ -2432,7 +2410,7 @@ fsync(p, uap)
vp = (struct vnode *)fp->f_data;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
if (vp->v_object)
- vm_object_page_clean(vp->v_object, 0, 0, 0);
+ vm_object_page_clean(vp->v_object, 0, 0, FALSE);
if ((error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p)) == 0 &&
vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) &&
bioops.io_fsync)
@@ -2675,7 +2653,7 @@ ogetdirentries(p, uap)
syscallarg(long *) basep;
} */ *uap;
{
- struct vnode *vp;
+ register struct vnode *vp;
struct file *fp;
struct uio auio, kuio;
struct iovec aiov, kiov;
@@ -2756,12 +2734,57 @@ unionread:
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
- if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
- error = union_dircheckp(p, &vp, fp);
- if (error == -1)
+
+#ifdef UNION
+{
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_op == union_vnodeop_p)) {
+ struct vnode *lvp;
+
+ lvp = union_dircache(vp, p);
+ if (lvp != NULLVP) {
+ struct vattr va;
+
+ /*
+ * If the directory is opaque,
+ * then don't show lower entries
+ */
+ error = VOP_GETATTR(vp, &va, fp->f_cred, p);
+ if (va.va_flags & OPAQUE) {
+ vput(lvp);
+ lvp = NULL;
+ }
+ }
+
+ if (lvp != NULLVP) {
+ error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
+ if (error) {
+ vput(lvp);
+ return (error);
+ }
+ VOP_UNLOCK(lvp, 0, p);
+ fp->f_data = (caddr_t) lvp;
+ fp->f_offset = 0;
+ error = vn_close(vp, FREAD, fp->f_cred, p);
+ if (error)
+ return (error);
+ vp = lvp;
goto unionread;
- if (error)
- return (error);
+ }
+ }
+}
+#endif /* UNION */
+
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_flag & VROOT) &&
+ (vp->v_mount->mnt_flag & MNT_UNION)) {
+ struct vnode *tvp = vp;
+ vp = vp->v_mount->mnt_vnodecovered;
+ VREF(vp);
+ fp->f_data = (caddr_t) vp;
+ fp->f_offset = 0;
+ vrele(tvp);
+ goto unionread;
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long));
@@ -2791,7 +2814,7 @@ getdirentries(p, uap)
syscallarg(long *) basep;
} */ *uap;
{
- struct vnode *vp;
+ register struct vnode *vp;
struct file *fp;
struct uio auio;
struct iovec aiov;
@@ -2822,12 +2845,57 @@ unionread:
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
- if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
- error = union_dircheckp(p, &vp, fp);
- if (error == -1)
+
+#ifdef UNION
+{
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_op == union_vnodeop_p)) {
+ struct vnode *lvp;
+
+ lvp = union_dircache(vp, p);
+ if (lvp != NULLVP) {
+ struct vattr va;
+
+ /*
+ * If the directory is opaque,
+ * then don't show lower entries
+ */
+ error = VOP_GETATTR(vp, &va, fp->f_cred, p);
+ if (va.va_flags & OPAQUE) {
+ vput(lvp);
+ lvp = NULL;
+ }
+ }
+
+ if (lvp != NULLVP) {
+ error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
+ if (error) {
+ vput(lvp);
+ return (error);
+ }
+ VOP_UNLOCK(lvp, 0, p);
+ fp->f_data = (caddr_t) lvp;
+ fp->f_offset = 0;
+ error = vn_close(vp, FREAD, fp->f_cred, p);
+ if (error)
+ return (error);
+ vp = lvp;
goto unionread;
- if (error)
- return (error);
+ }
+ }
+}
+#endif /* UNION */
+
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_flag & VROOT) &&
+ (vp->v_mount->mnt_flag & MNT_UNION)) {
+ struct vnode *tvp = vp;
+ vp = vp->v_mount->mnt_vnodecovered;
+ VREF(vp);
+ fp->f_data = (caddr_t) vp;
+ fp->f_offset = 0;
+ vrele(tvp);
+ goto unionread;
}
if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 0b32a7d1950c..41e8cbb15dde 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
- * $Id: vfs_vnops.c,v 1.61 1999/01/05 18:49:56 eivind Exp $
+ * $Id: vfs_vnops.c,v 1.58 1998/06/07 17:11:48 dfr Exp $
*/
#include <sys/param.h>
@@ -78,7 +78,7 @@ vn_open(ndp, fmode, cmode)
register struct ucred *cred = p->p_ucred;
struct vattr vat;
struct vattr *vap = &vat;
- int mode, error;
+ int error;
if (fmode & O_CREAT) {
ndp->ni_cnd.cn_nameiop = CREATE;
@@ -136,7 +136,11 @@ vn_open(ndp, fmode, cmode)
goto bad;
}
if ((fmode & O_CREAT) == 0) {
- mode = 0;
+ if (fmode & FREAD) {
+ error = VOP_ACCESS(vp, VREAD, cred, p);
+ if (error)
+ goto bad;
+ }
if (fmode & (FWRITE | O_TRUNC)) {
if (vp->v_type == VDIR) {
error = EISDIR;
@@ -145,12 +149,7 @@ vn_open(ndp, fmode, cmode)
error = vn_writechk(vp);
if (error)
goto bad;
- mode |= VWRITE;
- }
- if (fmode & FREAD)
- mode |= VREAD;
- if (mode) {
- error = VOP_ACCESS(vp, mode, cred, p);
+ error = VOP_ACCESS(vp, VWRITE, cred, p);
if (error)
goto bad;
}
@@ -172,7 +171,7 @@ vn_open(ndp, fmode, cmode)
* Make sure that a VM object is created for VMIO support.
*/
if (vp->v_type == VREG) {
- if ((error = vfs_object_create(vp, p, cred)) != 0)
+ if ((error = vfs_object_create(vp, p, cred, 1)) != 0)
goto bad;
}
@@ -510,18 +509,10 @@ vn_poll(fp, events, cred, p)
* acquire requested lock.
*/
int
-#ifndef DEBUG_LOCKS
vn_lock(vp, flags, p)
-#else
-debug_vn_lock(vp, flags, p, filename, line)
-#endif
struct vnode *vp;
int flags;
struct proc *p;
-#ifdef DEBUG_LOCKS
- const char *filename;
- int line;
-#endif
{
int error;
@@ -534,12 +525,7 @@ debug_vn_lock(vp, flags, p, filename, line)
tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
-#ifdef DEBUG_LOCKS
- vp->filename = filename;
- vp->line = line;
-#endif
- error = VOP_LOCK(vp,
- flags | LK_NOPAUSE | LK_INTERLOCK, p);
+ error = VOP_LOCK(vp, flags | LK_NOPAUSE | LK_INTERLOCK, p);
if (error == 0)
return (error);
}
diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh
index 8193edb0c53c..d289c35da768 100644
--- a/sys/kern/vnode_if.sh
+++ b/sys/kern/vnode_if.sh
@@ -32,7 +32,7 @@
# SUCH DAMAGE.
#
# @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93
-# $Id: vnode_if.sh,v 1.15 1998/07/04 20:45:32 julian Exp $
+# $Id: vnode_if.sh,v 1.14 1997/12/19 23:25:16 bde Exp $
#
# Script to produce VFS front-end sugar.
@@ -188,7 +188,7 @@ cat << END_OF_LEADING_COMMENT > $CFILE
#include <sys/vnode.h>
struct vnodeop_desc vop_default_desc = {
- 1, /* special case, vop_default => 1 */
+ 0,
"default",
0,
NULL,
@@ -400,3 +400,39 @@ struct vnodeop_desc vop_bwrite_desc = {
NULL,
};
END_OF_SPECIAL_CASES
+
+# Add the vfs_op_descs array to the C file.
+$AWK '
+ BEGIN {
+ printf("\nstruct vnodeop_desc *vfs_op_descs[] = {\n");
+ printf("\t&vop_default_desc, /* MUST BE FIRST */\n");
+ printf("\t&vop_strategy_desc, /* XXX: SPECIAL CASE */\n");
+ printf("\t&vop_bwrite_desc, /* XXX: SPECIAL CASE */\n");
+ }
+ END {
+ printf("\tNULL\n};\n");
+ }
+ NF == 0 || $0 ~ "^#" {
+ next;
+ }
+ {
+ # Get the function name.
+ printf("\t&%s_desc,\n", $1);
+
+ # Skip the function arguments.
+ for (;;) {
+ if (getline <= 0)
+ exit
+ if ($0 ~ "^};")
+ break;
+ }
+ }' < $SRC >> $CFILE
+
+cat << END_OF_NUMOPS_CODE >> $CFILE
+
+/*
+ * the -1 is to account for the NULL
+ * XXX is the NULL still necessary? I don't think so...
+ */
+int vfs_opv_numops = (sizeof(vfs_op_descs)/sizeof(struct vnodeop_desc *)) - 1;
+END_OF_NUMOPS_CODE
diff --git a/sys/libkern/moddi3.c b/sys/libkern/moddi3.c
index d914dc17be64..0e87656a7678 100644
--- a/sys/libkern/moddi3.c
+++ b/sys/libkern/moddi3.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: moddi3.c,v 1.5 1997/02/22 09:39:56 peter Exp $
+ * $Id$
*/
#include <libkern/quad.h>
@@ -57,7 +57,7 @@ __moddi3(a, b)
else
ua = a, neg = 0;
if (b < 0)
- ub = -(u_quad_t)b;
+ ub = -(u_quad_t)b, neg ^= 1;
else
ub = b;
(void)__qdivrem(ua, ub, &ur);
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c
index 4e3853ce54c5..6e810f8071a6 100644
--- a/sys/miscfs/deadfs/dead_vnops.c
+++ b/sys/miscfs/deadfs/dead_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93
- * $Id: dead_vnops.c,v 1.24 1998/08/23 11:43:29 bde Exp $
+ * $Id: dead_vnops.c,v 1.23 1997/12/15 03:09:44 wollman Exp $
*/
#include <sys/param.h>
@@ -188,7 +188,7 @@ dead_ioctl(ap)
{
if (!chkvnlock(ap->a_vp))
- return (ENOTTY);
+ return (EBADF);
return (VCALL(ap->a_vp, VOFFSET(vop_ioctl), ap));
}
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c
index 7839645da0ac..c43a01109d29 100644
--- a/sys/miscfs/devfs/devfs_tree.c
+++ b/sys/miscfs/devfs/devfs_tree.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_tree.c,v 1.57 1998/11/26 18:50:23 eivind Exp $
+ * $Id: devfs_tree.c,v 1.55 1998/07/04 22:30:22 julian Exp $
*/
@@ -56,7 +56,7 @@ static MALLOC_DEFINE(M_DEVFSNODE, "DEVFS node", "DEVFS node");
static MALLOC_DEFINE(M_DEVFSNAME, "DEVFS name", "DEVFS name");
devnm_p dev_root; /* root of the backing tree */
-static struct mount *devfs_hidden_mount;
+struct mount *devfs_hidden_mount;
int devfs_up_and_going;
/*
@@ -1129,7 +1129,7 @@ devfs_add_devswf(void *devsw, int minor, int chrblk, uid_t uid,
* this function is exported.. see sys/devfsext.h *
\***********************************************************************/
void *
-devfs_makelink(void *original, char *fmt, ...)
+devfs_link(void *original, char *fmt, ...)
{
devnm_p new_dev;
devnm_p orig = (devnm_p) original;
diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c
index 95ae9579719b..f2751708b8a5 100644
--- a/sys/miscfs/devfs/devfs_vfsops.c
+++ b/sys/miscfs/devfs/devfs_vfsops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_vfsops.c,v 1.34 1998/10/31 15:31:23 peter Exp $
+ * $Id: devfs_vfsops.c,v 1.32 1998/09/07 13:17:00 bde Exp $
*
*/
@@ -258,6 +258,7 @@ static int
devfs_sync(struct mount *mp, int waitfor,struct ucred *cred,struct proc *p)
{
register struct vnode *vp, *nvp;
+ struct timeval tv;
int error, allerror = 0;
DBPRINT(("sync "));
@@ -281,7 +282,7 @@ loop:
nvp = vp->v_mntvnodes.le_next;
if (VOP_ISLOCKED(vp))
continue;
- if (TAILQ_EMPTY(&vp->v_dirtyblkhd))
+ if ( vp->v_dirtyblkhd.lh_first == NULL)
continue;
if (vp->v_type == VBLK) {
if (vget(vp, LK_EXCLUSIVE, p))
@@ -293,8 +294,6 @@ loop:
}
#ifdef NOTYET
else {
- struct timeval tv;
-
tv = time;
/* VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
VOP_UPDATE(vp, &tv, &tv, 0);
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index e9bdc2a36c72..213a8677c4de 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_vnops.c,v 1.64 1998/12/15 23:46:59 eivind Exp $
+ * $Id: devfs_vnops.c,v 1.60 1998/09/04 08:06:56 dfr Exp $
*/
@@ -639,6 +639,9 @@ devfs_xwrite(struct vop_write_args *ap)
struct ucred *a_cred;
} */
{
+ dn_p file_node;
+ int error;
+
switch (ap->a_vp->v_type) {
case VREG:
return(EINVAL);
@@ -1285,6 +1288,16 @@ devfs_print(struct vop_print_args *ap)
* pseudo ops *
\**************************************************************************/
+/*
+ * /devfs vnode unsupported operation
+ */
+static int
+devfs_enotsupp(void *junk)
+{
+
+ return (EOPNOTSUPP);
+}
+
/*proto*/
void
devfs_dropvnode(dn_p dnp)
@@ -1324,7 +1337,8 @@ static int
devfs_open( struct vop_open_args *ap)
{
struct proc *p = ap->a_p;
- struct vnode *vp = ap->a_vp;
+ struct vnode *bvp, *vp = ap->a_vp;
+ dev_t bdev, dev = (dev_t)vp->v_rdev;
int error;
dn_p dnp;
@@ -1373,7 +1387,7 @@ devfs_read( struct vop_read_args *ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
- int n, on;
+ int n, on, majordev;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@@ -1519,11 +1533,11 @@ devfs_write( struct vop_write_args *ap)
bp = getblk(vp, bn, bsize, 0, 0);
else
error = bread(vp, bn, bsize, NOCRED, &bp);
+ n = min(n, bsize - bp->b_resid);
if (error) {
brelse(bp);
return (error);
}
- n = min(n, bsize - bp->b_resid);
error = uiomove((char *)bp->b_data + on, n, uio);
if (n + on == bsize)
bawrite(bp);
@@ -1641,8 +1655,8 @@ devfs_fsync(struct vop_fsync_args *ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -1664,7 +1678,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("devfs_fsync: dirty", vp);
splx(s);
goto loop;
@@ -1763,8 +1777,11 @@ static int
devfs_close(struct vop_close_args *ap)
{
register struct vnode *vp = ap->a_vp;
- int error;
- dn_p dnp;
+ struct proc *p = ap->a_p;
+ dev_t dev = vp->v_rdev;
+ d_close_t *devclose;
+ int mode, error;
+ dn_p dnp;
if (error = devfs_vntodn(vp,&dnp))
return error;
diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h
index 43ae38b5d557..9144c3dd925e 100644
--- a/sys/miscfs/devfs/devfsdefs.h
+++ b/sys/miscfs/devfs/devfsdefs.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfsdefs.h,v 1.17 1998/09/30 20:33:46 sos Exp $
+ * $Id: devfsdefs.h,v 1.16 1998/07/05 23:10:22 julian Exp $
*/
#ifdef DEVFS_DEBUG
#define DBPRINT(A) printf(A)
@@ -202,6 +202,7 @@ struct dev_vn_data
devnm_p back;
};
+extern struct vnodeops spec_vnodeops,devfs_vnodeops;
/*
* Prototypes for DEVFS virtual filesystem operations
*/
diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c
index 881be49c8168..de6f03d062e4 100644
--- a/sys/miscfs/fdesc/fdesc_vfsops.c
+++ b/sys/miscfs/fdesc/fdesc_vfsops.c
@@ -35,7 +35,7 @@
*
* @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
*
- * $Id: fdesc_vfsops.c,v 1.16 1998/09/07 13:17:00 bde Exp $
+ * $Id: fdesc_vfsops.c,v 1.15 1998/05/06 05:29:33 msmith Exp $
*/
/*
@@ -55,8 +55,13 @@
static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
+static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp,
+ struct mbuf *nam, struct vnode **vpp,
+ int *exflagsp, struct ucred **credanonp));
static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
+static int fdesc_quotactl __P((struct mount *mp, int cmd, uid_t uid,
+ caddr_t arg, struct proc *p));
static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));
static int fdesc_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
@@ -64,6 +69,9 @@ static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int fdesc_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
+static int fdesc_vget __P((struct mount *mp, ino_t ino,
+ struct vnode **vpp));
+static int fdesc_vptofh __P((struct vnode *vp, struct fid *fhp));
/*
* Mount the per-process file descriptors (/dev/fd)
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c
index fb8f4a169f25..a8ec1765814c 100644
--- a/sys/miscfs/fdesc/fdesc_vnops.c
+++ b/sys/miscfs/fdesc/fdesc_vnops.c
@@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
- * $Id: fdesc_vnops.c,v 1.39 1998/12/07 21:58:31 archie Exp $
+ * $Id: fdesc_vnops.c,v 1.37 1998/06/10 21:21:28 dfr Exp $
*/
/*
@@ -84,6 +84,8 @@ static int fdesc_attr __P((int fd, struct vattr *vap, struct ucred *cred,
struct proc *p));
static int fdesc_badop __P((void));
static int fdesc_getattr __P((struct vop_getattr_args *ap));
+static struct fdcache *
+ fdesc_hash __P((int ix));
static int fdesc_inactive __P((struct vop_inactive_args *ap));
static int fdesc_ioctl __P((struct vop_ioctl_args *ap));
static int fdesc_lookup __P((struct vop_lookup_args *ap));
@@ -193,7 +195,7 @@ fdesc_lookup(ap)
char *pname = cnp->cn_nameptr;
struct proc *p = cnp->cn_proc;
int nfiles = p->p_fd->fd_nfiles;
- unsigned fd = -1;
+ unsigned fd;
int error;
struct vnode *fvp;
char *ln;
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c
index 49f7288f6909..c30ed0147f92 100644
--- a/sys/miscfs/kernfs/kernfs_vfsops.c
+++ b/sys/miscfs/kernfs/kernfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95
- * $Id: kernfs_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $
+ * $Id: kernfs_vfsops.c,v 1.22 1998/05/06 05:29:33 msmith Exp $
*/
/*
@@ -56,6 +56,7 @@ static MALLOC_DEFINE(M_KERNFSMNT, "KERNFS mount", "KERNFS mount structure");
dev_t rrootdev = NODEV;
+static int cdevvp __P((dev_t dev, struct vnode **vpp));
static void kernfs_get_rrootdev __P((void));
static int kernfs_init __P((struct vfsconf *vfsp));
static int kernfs_mount __P((struct mount *mp, char *path, caddr_t data,
diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c
index 81261a900920..4280ef1db733 100644
--- a/sys/miscfs/kernfs/kernfs_vnops.c
+++ b/sys/miscfs/kernfs/kernfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95
- * $Id: kernfs_vnops.c,v 1.36 1998/12/04 22:54:51 archie Exp $
+ * $Id: kernfs_vnops.c,v 1.34 1998/06/25 16:54:18 dt Exp $
*/
/*
@@ -106,9 +106,11 @@ static int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]);
static int kernfs_access __P((struct vop_access_args *ap));
static int kernfs_badop __P((void));
+static int kernfs_enotsupp __P((void));
static int kernfs_getattr __P((struct vop_getattr_args *ap));
static int kernfs_inactive __P((struct vop_inactive_args *ap));
static int kernfs_lookup __P((struct vop_lookup_args *ap));
+static int kernfs_pathconf __P((struct vop_pathconf_args *ap));
static int kernfs_print __P((struct vop_print_args *ap));
static int kernfs_read __P((struct vop_read_args *ap));
static int kernfs_readdir __P((struct vop_readdir_args *ap));
@@ -131,13 +133,13 @@ kernfs_xread(kt, buf, len, lenp)
case KTT_TIME: {
struct timeval tv;
microtime(&tv);
- snprintf(buf, len, "%ld %ld\n", tv.tv_sec, tv.tv_usec);
+ sprintf(buf, "%ld %ld\n", tv.tv_sec, tv.tv_usec);
break;
}
case KTT_INT: {
int *ip = kt->kt_data;
- snprintf(buf, len, "%d\n", *ip);
+ sprintf(buf, "%d\n", *ip);
break;
}
@@ -179,7 +181,7 @@ kernfs_xread(kt, buf, len, lenp)
}
case KTT_AVENRUN:
- snprintf(buf, len, "%lu %lu %lu %ld\n",
+ sprintf(buf, "%lu %lu %lu %ld\n",
(u_long)averunnable.ldavg[0], (u_long)averunnable.ldavg[1],
(u_long)averunnable.ldavg[2], averunnable.fscale);
break;
@@ -233,6 +235,7 @@ kernfs_lookup(ap)
struct proc *p = cnp->cn_proc;
struct kern_target *kt;
struct vnode *fvp;
+ int nameiop = cnp->cn_nameiop;
int error, i;
#ifdef KERNFS_DIAGNOSTIC
@@ -371,6 +374,7 @@ kernfs_getattr(ap)
{
struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap;
+ struct timeval tv;
int error = 0;
char strbuf[KSTRING];
@@ -455,6 +459,7 @@ kernfs_read(ap)
char strbuf[KSTRING];
int off = uio->uio_offset;
int error, len;
+ char *cp;
if (vp->v_type == VDIR)
return (EOPNOTSUPP);
diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c
index b2e1b63af955..1398e3432539 100644
--- a/sys/miscfs/nullfs/null_vnops.c
+++ b/sys/miscfs/nullfs/null_vnops.c
@@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
- * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $
+ * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
- * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $
+ * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $
*/
/*
@@ -523,6 +523,8 @@ null_unlock(ap)
struct proc *a_p;
} */ *ap;
{
+ struct vnode *vp = ap->a_vp;
+
vop_nounlock(ap);
ap->a_flags &= ~LK_INTERLOCK;
return (null_bypass((struct vop_generic_args *)ap));
diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c
index 819d636a20c2..11a1e84a1a48 100644
--- a/sys/miscfs/portal/portal_vnops.c
+++ b/sys/miscfs/portal/portal_vnops.c
@@ -35,7 +35,7 @@
*
* @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95
*
- * $Id: portal_vnops.c,v 1.34 1998/12/07 21:58:32 archie Exp $
+ * $Id: portal_vnops.c,v 1.32 1998/06/10 06:34:57 peter Exp $
*/
/*
@@ -68,6 +68,7 @@ static int portal_fileid = PORTAL_ROOTFILEID+1;
static int portal_badop __P((void));
static void portal_closefd __P((struct proc *p, int fd));
static int portal_connect __P((struct socket *so, struct socket *so2));
+static int portal_enotsupp __P((void));
static int portal_getattr __P((struct vop_getattr_args *ap));
static int portal_inactive __P((struct vop_inactive_args *ap));
static int portal_lookup __P((struct vop_lookup_args *ap));
@@ -444,6 +445,7 @@ portal_getattr(ap)
{
struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap;
+ struct timeval tv;
bzero(vap, sizeof(*vap));
vattr_null(vap);
@@ -575,6 +577,16 @@ portal_print(ap)
/*
+ * Portal vnode unsupported operation
+ */
+static int
+portal_enotsupp()
+{
+
+ return (EOPNOTSUPP);
+}
+
+/*
* Portal "should never get here" operation
*/
static int
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h
index 619e1b23ed8b..b727e16543aa 100644
--- a/sys/miscfs/procfs/procfs.h
+++ b/sys/miscfs/procfs/procfs.h
@@ -37,7 +37,7 @@
* @(#)procfs.h 8.9 (Berkeley) 5/14/95
*
* From:
- * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $
+ * $Id: procfs.h,v 1.19 1998/05/19 00:00:13 tegge Exp $
*/
/*
@@ -56,8 +56,7 @@ typedef enum {
Pnote, /* process notifier */
Pnotepg, /* process group notifier */
Pmap, /* memory map */
- Ptype, /* executable type */
- Pcmdline /* command line */
+ Ptype /* executable type */
} pfstype;
/*
@@ -155,7 +154,6 @@ int procfs_doctl __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct
int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
int procfs_dotype __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
-int procfs_docmdline __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
/* Return 1 if process has special kernel digging privileges */
int procfs_kmemaccess __P((struct proc *));
diff --git a/sys/miscfs/procfs/procfs_map.c b/sys/miscfs/procfs/procfs_map.c
index 4dae10a6fdc0..1a865e669042 100644
--- a/sys/miscfs/procfs/procfs_map.c
+++ b/sys/miscfs/procfs/procfs_map.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
- * $Id: procfs_map.c,v 1.17 1998/04/29 04:28:22 dyson Exp $
+ * $Id: procfs_map.c,v 1.16 1998/02/06 12:13:41 eivind Exp $
*/
#include <sys/param.h>
@@ -153,8 +153,7 @@ case OBJT_DEVICE:
* format:
* start, end, resident, private resident, cow, access, type.
*/
- snprintf(mebuffer, sizeof(mebuffer),
- "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n",
+ sprintf(mebuffer, "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n",
entry->start, entry->end,
resident, privateresident, id,
(entry->protection & VM_PROT_READ)?"r":"-",
diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c
index 22d8f7422876..c1012f1cb253 100644
--- a/sys/miscfs/procfs/procfs_mem.c
+++ b/sys/miscfs/procfs/procfs_mem.c
@@ -37,7 +37,7 @@
*
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
*
- * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $
+ * $Id: procfs_mem.c,v 1.33 1998/06/07 17:11:57 dfr Exp $
*/
/*
@@ -253,7 +253,7 @@ procfs_rwmem(curp, p, uio)
/*
* release the page and the object
*/
- vm_page_unwire(m, 1);
+ vm_page_unwire(m);
vm_object_deallocate(object);
object = NULL;
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index 3176a6440064..3f1cccf39f3e 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -37,7 +37,7 @@
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*
* From:
- * $Id: procfs_status.c,v 1.11 1998/07/11 07:45:45 bde Exp $
+ * $Id: procfs_status.c,v 1.10 1997/08/02 14:32:17 bde Exp $
*/
#include <sys/param.h>
@@ -147,40 +147,3 @@ procfs_dostatus(curp, p, pfs, uio)
return (error);
}
-
-int
-procfs_docmdline(curp, p, pfs, uio)
- struct proc *curp;
- struct proc *p;
- struct pfsnode *pfs;
- struct uio *uio;
-{
- char *ps;
- int xlen;
- int error;
- char psbuf[256];
-
- if (uio->uio_rw != UIO_READ)
- return (EOPNOTSUPP);
-
- /*
- * For now, this is a hack. To implement this fully would require
- * groping around in the process address space to follow argv etc.
- */
- ps = psbuf;
- bcopy(p->p_comm, ps, MAXCOMLEN);
- ps[MAXCOMLEN] = '\0';
- ps += strlen(ps);
-
- ps += sprintf(ps, "\n");
-
- xlen = ps - psbuf;
- xlen -= uio->uio_offset;
- ps = psbuf + uio->uio_offset;
- xlen = min(xlen, uio->uio_resid);
- if (xlen <= 0)
- error = 0;
- else
- error = uiomove(ps, xlen, uio);
- return (error);
-}
diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c
index 813232cb5fb3..2156b12b0453 100644
--- a/sys/miscfs/procfs/procfs_subr.c
+++ b/sys/miscfs/procfs/procfs_subr.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95
*
- * $Id: procfs_subr.c,v 1.21 1997/12/12 03:33:43 sef Exp $
+ * $Id: procfs_subr.c,v 1.20 1997/12/09 05:03:41 sef Exp $
*/
#include <sys/param.h>
@@ -181,7 +181,6 @@ loop:
case Ptype:
case Pmap:
case Pstatus:
- case Pcmdline:
pfs->pfs_mode = (VREAD) |
(VREAD >> 3) |
(VREAD >> 6);
@@ -283,10 +282,6 @@ procfs_rw(ap)
rtval = procfs_dotype(curp, p, pfs, uio);
break;
- case Pcmdline:
- rtval = procfs_docmdline(curp, p, pfs, uio);
- break;
-
default:
rtval = EOPNOTSUPP;
break;
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index daab08f2c240..8a6230eabf01 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
- * $Id: procfs_vnops.c,v 1.62 1998/12/04 22:54:51 archie Exp $
+ * $Id: procfs_vnops.c,v 1.60 1998/06/25 16:54:41 dt Exp $
*/
/*
@@ -101,7 +101,6 @@ static struct proc_target {
{ DT_REG, N("notepg"), Pnotepg, NULL },
{ DT_REG, N("map"), Pmap, procfs_validmap },
{ DT_REG, N("etype"), Ptype, procfs_validtype },
- { DT_REG, N("cmdline"), Pcmdline, NULL },
#undef N
};
static const int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]);
@@ -529,7 +528,7 @@ procfs_getattr(ap)
vap->va_uid = 0;
vap->va_gid = 0;
vap->va_size = vap->va_bytes =
- snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid);
+ sprintf(buf, "%ld", (long)curproc->p_pid);
break;
}
@@ -574,7 +573,6 @@ procfs_getattr(ap)
case Pstatus:
case Pnote:
case Pnotepg:
- case Pcmdline:
vap->va_nlink = 1;
vap->va_uid = procp->p_ucred->cr_uid;
vap->va_gid = procp->p_ucred->cr_gid;
@@ -946,7 +944,7 @@ procfs_readlink(ap)
if (VTOPFS(ap->a_vp)->pfs_fileno != PROCFS_FILENO(0, Pcurproc))
return (EINVAL);
- len = snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid);
+ len = sprintf(buf, "%ld", (long)curproc->p_pid);
return (uiomove((caddr_t)buf, len, ap->a_uio));
}
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index ff0f347546b7..f32a9f15033e 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/specfs/spec_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
- * $Id: spec_vnops.c,v 1.77 1998/12/07 21:58:33 archie Exp $
+ * $Id: spec_vnops.c,v 1.73 1998/09/05 14:13:12 phk Exp $
*/
#include <sys/param.h>
@@ -257,7 +257,7 @@ spec_read(ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
- int n, on;
+ int n, on, majordev;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@@ -285,7 +285,8 @@ spec_read(ap)
return (EINVAL);
bsize = BLKDEV_IOSIZE;
dev = vp->v_rdev;
- if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
+ if ((majordev = major(dev)) < nblkdev &&
+ (ioctl = bdevsw[majordev]->d_ioctl) != NULL &&
(*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
dpart.part->p_fstype == FS_BSDFFS &&
dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)
@@ -379,11 +380,11 @@ spec_write(ap)
bp = getblk(vp, bn, bsize, 0, 0);
else
error = bread(vp, bn, bsize, NOCRED, &bp);
+ n = min(n, bsize - bp->b_resid);
if (error) {
brelse(bp);
return (error);
}
- n = min(n, bsize - bp->b_resid);
error = uiomove((char *)bp->b_data + on, n, uio);
if (n + on == bsize)
bawrite(bp);
@@ -476,8 +477,8 @@ spec_fsync(ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -499,7 +500,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("spec_fsync: dirty", vp);
splx(s);
goto loop;
@@ -605,6 +606,7 @@ spec_close(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
+ struct proc *p = ap->a_p;
dev_t dev = vp->v_rdev;
d_close_t *devclose;
int mode, error;
diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c
index 4974f03c110c..fc4d5eb4575a 100644
--- a/sys/miscfs/umapfs/umap_subr.c
+++ b/sys/miscfs/umapfs/umap_subr.c
@@ -35,7 +35,7 @@
*
* @(#)umap_subr.c 8.9 (Berkeley) 5/14/95
*
- * $Id: umap_subr.c,v 1.15 1998/11/09 09:21:25 peter Exp $
+ * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $
*/
#include <sys/param.h>
@@ -259,7 +259,7 @@ umap_node_create(mp, targetvp, newvpp)
* Take another reference to the alias vnode
*/
#ifdef UMAPFS_DIAGNOSTIC
- vprint("umap_node_create: exists", aliasvp);
+ vprint("umap_node_create: exists", ap->umap_vnode);
#endif
/* VREF(aliasvp); */
} else {
@@ -352,18 +352,22 @@ umap_mapids(v_mount, credp)
struct mount *v_mount;
struct ucred *credp;
{
- int i;
+ int i, unentries, gnentries;
+ u_long *groupmap, *usermap;
uid_t uid;
gid_t gid;
if (credp == NOCRED)
return;
+ unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries;
+ usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]);
+ gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries;
+ groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]);
+
/* Find uid entry in map */
- uid = (uid_t) umap_findid(credp->cr_uid,
- MOUNTTOUMAPMOUNT(v_mount)->info_mapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_nentries);
+ uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries);
if (uid != -1)
credp->cr_uid = uid;
@@ -375,9 +379,7 @@ umap_mapids(v_mount, credp)
/* Find gid entry in map */
- gid = (gid_t) umap_findid(credp->cr_gid,
- MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_gnentries);
+ gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries);
if (gid != -1)
credp->cr_gid = gid;
@@ -391,8 +393,7 @@ umap_mapids(v_mount, credp)
i = 0;
while (credp->cr_groups[i] != 0) {
gid = (gid_t) umap_findid(credp->cr_groups[i],
- MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_gnentries);
+ groupmap, gnentries);
if (gid != -1)
credp->cr_groups[i++] = gid;
diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c
index 893e1e54ad90..a41a575bf410 100644
--- a/sys/miscfs/umapfs/umap_vnops.c
+++ b/sys/miscfs/umapfs/umap_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.6 (Berkeley) 5/22/95
- * $Id: umap_vnops.c,v 1.25 1998/07/30 17:40:45 bde Exp $
+ * $Id: umap_vnops.c,v 1.24 1998/07/04 20:45:34 julian Exp $
*/
/*
@@ -386,6 +386,8 @@ umap_unlock(ap)
struct proc *a_p;
} */ *ap;
{
+ struct vnode *vp = ap->a_vp;
+
vop_nounlock(ap);
ap->a_flags &= ~LK_INTERLOCK;
return (null_bypass((struct vop_generic_args *)ap));
diff --git a/sys/miscfs/union/union.h b/sys/miscfs/union/union.h
index 6a4aa226203e..4deb6d42fa2c 100644
--- a/sys/miscfs/union/union.h
+++ b/sys/miscfs/union/union.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union.h 8.9 (Berkeley) 12/10/94
- * $Id: union.h,v 1.12 1998/02/26 03:23:51 kato Exp $
+ * $Id: union.h,v 1.11 1998/02/10 03:32:03 kato Exp $
*/
struct union_args {
@@ -114,9 +114,6 @@ extern void union_removed_upper __P((struct union_node *un));
extern struct vnode *union_lowervp __P((struct vnode *));
extern void union_newsize __P((struct vnode *, off_t, off_t));
-extern int (*union_dircheckp) __P((struct proc *, struct vnode **,
- struct file *));
-
#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
#define UNIONTOV(un) ((un)->un_vnode)
diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c
index 7559b6e205fb..c54d86b6a419 100644
--- a/sys/miscfs/union/union_subr.c
+++ b/sys/miscfs/union/union_subr.c
@@ -35,19 +35,16 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.20 (Berkeley) 5/20/95
- * $Id: union_subr.c,v 1.35 1998/12/07 21:58:34 archie Exp $
+ * $Id: union_subr.c,v 1.30 1998/05/07 04:58:36 msmith Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/vnode.h>
#include <sys/namei.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
-#include <sys/file.h>
#include <sys/filedesc.h>
-#include <sys/module.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <vm/vm.h>
@@ -307,9 +304,10 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache)
struct union_node *un = 0;
struct vnode *xlowervp = NULLVP;
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
- int hash = 0;
+ int hash;
int vflag;
int try;
+ int klocked;
if (uppervp == NULLVP && lowervp == NULLVP)
panic("union: unidentifiable allocation");
@@ -773,7 +771,7 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
vrele(dvp);
else {
zfree(namei_zone, cn->cn_pnbuf);
- cn->cn_pnbuf = NULL;
+ cn->cn_pnbuf = '\0';
}
return (error);
@@ -1140,79 +1138,3 @@ out:
VOP_UNLOCK(vp, 0, p);
return (nvp);
}
-
-/*
- * Module glue to remove #ifdef UNION from vfs_syscalls.c
- */
-static int
-union_dircheck(struct proc *p, struct vnode **vp, struct file *fp)
-{
- int error = 0;
-
- if ((*vp)->v_op == union_vnodeop_p) {
- struct vnode *lvp;
-
- lvp = union_dircache(*vp, p);
- if (lvp != NULLVP) {
- struct vattr va;
-
- /*
- * If the directory is opaque,
- * then don't show lower entries
- */
- error = VOP_GETATTR(*vp, &va, fp->f_cred, p);
- if (va.va_flags & OPAQUE) {
- vput(lvp);
- lvp = NULL;
- }
- }
-
- if (lvp != NULLVP) {
- error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
- if (error) {
- vput(lvp);
- return (error);
- }
- VOP_UNLOCK(lvp, 0, p);
- fp->f_data = (caddr_t) lvp;
- fp->f_offset = 0;
- error = vn_close(*vp, FREAD, fp->f_cred, p);
- if (error)
- return (error);
- *vp = lvp;
- return -1; /* goto unionread */
- }
- }
- if (((*vp)->v_flag & VROOT) && ((*vp)->v_mount->mnt_flag & MNT_UNION)) {
- struct vnode *tvp = *vp;
- *vp = (*vp)->v_mount->mnt_vnodecovered;
- VREF(*vp);
- fp->f_data = (caddr_t) *vp;
- fp->f_offset = 0;
- vrele(tvp);
- return -1; /* goto unionread */
- }
- return error;
-}
-
-static int
-union_modevent(module_t mod, int type, void *data)
-{
- switch (type) {
- case MOD_LOAD:
- union_dircheckp = union_dircheck;
- break;
- case MOD_UNLOAD:
- union_dircheckp = NULL;
- break;
- default:
- break;
- }
- return 0;
-}
-static moduledata_t union_mod = {
- "union_dircheck",
- union_modevent,
- NULL
-};
-DECLARE_MODULE(union_dircheck, union_mod, SI_SUB_VFS, SI_ORDER_ANY);
diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c
index 87fda6d6cc81..2bcd1ee794f0 100644
--- a/sys/miscfs/union/union_vnops.c
+++ b/sys/miscfs/union/union_vnops.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
- * $Id: union_vnops.c,v 1.58 1998/07/04 20:45:35 julian Exp $
+ * $Id: union_vnops.c,v 1.57 1998/05/07 04:58:38 msmith Exp $
*/
#include <sys/param.h>
@@ -205,7 +205,7 @@ union_lookup(ap)
struct proc *p = cnp->cn_proc;
int lockparent = cnp->cn_flags & LOCKPARENT;
struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
- struct ucred *saved_cred = NULL;
+ struct ucred *saved_cred;
int iswhiteout;
struct vattr va;
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 90b5bb3cdd7e..bc956d9b32ba 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -1,15 +1,14 @@
-# $Id: Makefile,v 1.46 1999/01/17 19:06:06 peter Exp $
+# $Id: Makefile,v 1.33 1998/09/28 05:38:22 grog Exp $
# XXX present but broken: ip_mroute_mod
-# XXX not yet completed porting: acd
-# XXX builds but not updated: atapi
-
-SUBDIR= ccd cd9660 coda fdesc if_disc if_ppp if_sl if_tun ipfw kernfs \
- mfs msdos nfs nullfs portal procfs umapfs union vinum
-
-# XXX some of these can move to the general case when de-i386'ed
-.if ${MACHINE_ARCH} == "i386"
-SUBDIR+=atapi coff fpu gnufpu ibcs2 joy linux lkm pcic splash syscons vesa
+# XXX not yet completed porting: pcic coda syscons/*
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR= atapi ccd cd9660 coff fdesc fpu gnufpu ibcs2 if_disc if_ppp if_sl \
+ if_tun ipfw joy kernfs linux mfs msdos nfs nullfs \
+ portal procfs syscons umapfs vesa vinum wcd
.endif
+# XXX builds, but not useable with present design
+#union
+
.include <bsd.subdir.mk>
diff --git a/sys/modules/coda/Makefile b/sys/modules/coda/Makefile
index f30ec7b464a2..9135235c6a47 100644
--- a/sys/modules/coda/Makefile
+++ b/sys/modules/coda/Makefile
@@ -1,18 +1,10 @@
-# $Id: Makefile,v 1.3 1998/10/16 04:30:42 peter Exp $
+# $Id: Makefile,v 1.2 1998/09/29 20:19:45 rvb Exp $
.PATH: ${.CURDIR}/../../coda
KMOD= coda
SRCS= coda_fbsd.c coda_namecache.c coda_psdev.c coda_subr.c \
- coda_venus.c coda_vfsops.c coda_vnops.c opt_devfs.h vcoda.h
+ coda_venus.c coda_vfsops.c coda_vnops.c
NOMAN=
VFS_KLD=
-CLEANFILES+= vcoda.h opt_devfs.h
-
-opt_devfs.h:
- touch opt_devfs.h
-
-vcoda.h:
- echo "#define NVCODA 4" > vcoda.h
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/coff/Makefile b/sys/modules/coff/Makefile
index 759158538e9a..dbfd197030e0 100644
--- a/sys/modules/coff/Makefile
+++ b/sys/modules/coff/Makefile
@@ -1,11 +1,11 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:42 peter Exp $
+# $Id: Makefile,v 1.6 1998/03/12 20:04:38 eivind Exp $
.PATH: ${.CURDIR}/../../i386/ibcs2
KMOD= ibcs2_coff
SRCS= imgact_coff.c vnode_if.h
NOMAN=
-CLEANFILES+= vnode_if.h vnode_if.c
-CFLAGS+= -DCOMPAT_IBCS2
-KMODDEPS= ibcs2
+CLEANFILES+= vnode_if.h vnode_if.c
+CFLAGS+= -DCOMPAT_IBCS2
+DEPLKMS=${.OBJDIR}/../ibcs2/ibcs2_mod.o
.include <bsd.kmod.mk>
diff --git a/sys/modules/ibcs2/Makefile b/sys/modules/ibcs2/Makefile
index 9bb8a5b303bf..3f42872ab072 100644
--- a/sys/modules/ibcs2/Makefile
+++ b/sys/modules/ibcs2/Makefile
@@ -1,8 +1,8 @@
-# $Id: Makefile,v 1.22 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.17 1998/02/06 23:54:20 eivind Exp $
.PATH: ${.CURDIR}/../../i386/ibcs2
KMOD= ibcs2
-SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
+SRCS= ibcs2.c ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \
ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \
ibcs2_isc.c ibcs2_isc_sysent.c \
@@ -19,6 +19,6 @@ opt_spx_hack.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/ibcs2.sh ${DESTDIR}/usr/bin/ibcs2
+ ${.CURDIR}/ibcs2 ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/ibcs2/ibcs2 b/sys/modules/ibcs2/ibcs2
new file mode 100755
index 000000000000..a649885512ea
--- /dev/null
+++ b/sys/modules/ibcs2/ibcs2
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Copyright (C) 1994-1997
+# FreeBSD 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 FreeBSD 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 FreeBSD Inc. 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.
+#
+# $Id$
+
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH
+
+if [ $# -le 1 ]; then
+ LOADERS="coff" # elf
+fi
+
+set -e
+
+kernelfile=`sysctl -n kern.bootfile`
+kernelfile=`basename $kernelfile`
+newkernelfile="/tmp/_${kernelfile}+ibcs2$$"
+
+trap 'rm -f $newkernelfile; exit 1' 1 2 3 13 15
+
+rm -f $newkernelfile
+modload -e ibcs2_mod -o $newkernelfile -q /lkm/ibcs2_mod.o
+
+for loader in $LOADERS; do
+ modload -e ibcs2_${loader}_mod -o/tmp/ibcs2_${loader} -q -u \
+ -A${newkernelfile} /lkm/ibcs2_${loader}_mod.o
+done
+rm -f ${newkernelfile}
+set +e
diff --git a/sys/modules/ibcs2/ibcs2.c b/sys/modules/ibcs2/ibcs2.c
new file mode 100644
index 000000000000..2bd5fb62ec8f
--- /dev/null
+++ b/sys/modules/ibcs2/ibcs2.c
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 1994 Søren Schmidt
+ * 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
+ * in this position and unchanged.
+ * 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 withough 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.
+ *
+ * $Id: ibcs2.c,v 1.11 1997/05/01 06:09:01 jkh Exp $
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+static int
+ibcs2_modevent(module_t mod, modeventtype_t type, void *unused)
+{
+ switch (type) {
+ case MOD_LOAD:
+ printf("ibcs2 module loaded\n");
+ break;
+ case MOD_UNLOAD:
+ printf("ibcs2 module unloaded\n");
+ break;
+ default:
+ printf("ibcs2 module unknown event: 0x%x\n", type);
+ }
+ return 0;
+}
+
+moduledata_t ibcs2mod = {
+ "ibcs2",
+ ibcs2_modevent,
+ 0
+};
+
+DECLARE_MODULE(ibcs2, ibcs2mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
diff --git a/sys/modules/ibcs2/ibcs2.sh b/sys/modules/ibcs2/ibcs2.sh
deleted file mode 100644
index 0fd465fa023e..000000000000
--- a/sys/modules/ibcs2/ibcs2.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 1994-1997
-# FreeBSD 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 FreeBSD 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 FreeBSD Inc. 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.
-#
-# $Id: ibcs2,v 1.7 1997/02/22 12:47:59 peter Exp $
-
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH
-
-if [ $# -le 1 ]; then
- LOADERS="coff" # elf
-fi
-
-set -e
-
-kldload ibcs2
-
-for loader in $LOADERS; do
- kldload ibcs2_${loader}
-done
-set +e
diff --git a/sys/modules/if_ppp/Makefile b/sys/modules/if_ppp/Makefile
index 97c3b3c2df72..34b90d8ec4ea 100644
--- a/sys/modules/if_ppp/Makefile
+++ b/sys/modules/if_ppp/Makefile
@@ -1,11 +1,10 @@
-# $Id: Makefile,v 1.15 1998/10/16 04:30:44 peter Exp $
+# $Id: Makefile,v 1.14 1998/03/27 04:05:08 peter Exp $
.PATH: ${.CURDIR}/../../net
KMOD= if_ppp
SRCS= if_ppp.c ppp_tty.c slcompress.c \
- bpfilter.h ppp.h opt_inet.h opt_ipx.h opt_ppp.h vnode_if.h
+ bpfilter.h ppp.h opt_inet.h opt_ipx.h opt_ppp.h
NOMAN=
-CLEANFILES+= vnode_if.c vnode_if.h
NPPP?= 2
PPP_BSDCOMP?= 1 # 0/1
diff --git a/sys/modules/if_tun/Makefile b/sys/modules/if_tun/Makefile
index 7fadb7fa7126..2581e361e23d 100644
--- a/sys/modules/if_tun/Makefile
+++ b/sys/modules/if_tun/Makefile
@@ -1,10 +1,9 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:45 peter Exp $
+# $Id: Makefile,v 1.6 1998/02/01 18:12:14 bde Exp $
.PATH: ${.CURDIR}/../../net
KMOD= if_tun
-SRCS= if_tun.c bpfilter.h opt_devfs.h opt_inet.h tun.h vnode_if.h
+SRCS= if_tun.c bpfilter.h opt_devfs.h opt_inet.h tun.h
NOMAN=
-CLEANFILES+= vnode_if.h vnode_if.c
NBPFILTER?= 0
NTUN?= 2
diff --git a/sys/modules/joy/Makefile b/sys/modules/joy/Makefile
index 335833f31b1d..ebbf4c9f4778 100644
--- a/sys/modules/joy/Makefile
+++ b/sys/modules/joy/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.7 1998/02/01 18:12:15 bde Exp $
.PATH: ${.CURDIR}/../../i386/isa
KMOD = joy
@@ -17,6 +17,6 @@ opt_devfs.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/joy.sh ${DESTDIR}/usr/bin/joy
+ ${.CURDIR}/joy ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/joy/joy b/sys/modules/joy/joy
new file mode 100644
index 000000000000..3f5bbb96ab09
--- /dev/null
+++ b/sys/modules/joy/joy
@@ -0,0 +1,4 @@
+#!/bin/sh
+# $Id$
+
+modload -q -u -A `sysctl -n kern.bootfile` /lkm/joy_mod.o
diff --git a/sys/modules/joy/joy.sh b/sys/modules/joy/joy.sh
deleted file mode 100644
index 3f165a6aa2a1..000000000000
--- a/sys/modules/joy/joy.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $Id: joy,v 1.3 1997/02/22 12:48:17 peter Exp $
-
-kldload joy
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index ed7bed5750cc..090f2fc7e72c 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.23 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.18 1998/07/07 02:04:20 bde Exp $
.PATH: ${.CURDIR}/../../i386/linux
KMOD= linux
@@ -27,7 +27,7 @@ linux_genassym.o: linux_genassym.c linux.h @ machine
${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC}
linux_genassym: linux_genassym.o
- ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
opt_compat.h:
echo "#define COMPAT_43 1" > opt_compat.h
@@ -37,6 +37,6 @@ opt_linux.h opt_vmpage.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/linux.sh ${DESTDIR}/usr/bin/linux
+ ${.CURDIR}/linux ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/linux/linux b/sys/modules/linux/linux
new file mode 100644
index 000000000000..9945a9908c5c
--- /dev/null
+++ b/sys/modules/linux/linux
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# $Id: linux,v 1.4 1997/02/22 12:48:25 peter Exp $
+
+if modstat -n linux_mod > /dev/null ; then
+ echo Linux lkm already loaded
+ exit 1
+else
+ modload -e linux_mod -u -q -o /tmp/linux_mod /lkm/linux_mod.o
+fi
diff --git a/sys/modules/linux/linux.sh b/sys/modules/linux/linux.sh
deleted file mode 100644
index 8545fbbc47bc..000000000000
--- a/sys/modules/linux/linux.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# $Id: linux,v 1.5 1998/09/07 16:15:59 cracauer Exp $
-
-FOUND=`kldstat -v | egrep 'linux(aout|elf)'`
-
-if [ "x$FOUND" != x ] ; then
- echo Linux driver already loaded
- exit 1
-else
- kldload linux
-fi
diff --git a/sys/modules/lkm/Makefile b/sys/modules/lkm/Makefile
deleted file mode 100644
index ecf7d27dce59..000000000000
--- a/sys/modules/lkm/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $Id: Makefile,v 1.11 1998/11/12 00:37:39 jkh Exp $
-
-.PATH: ${.CURDIR}/../../kern
-KMOD = lkm
-SRCS = kern_lkm.c vnode_if.h opt_devfs.h
-
-CLEANFILES += opt_devfs.h vnode_if.c vnode_if.h
-
-opt_devfs.h:
- touch opt_devfs.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/mfs/Makefile b/sys/modules/mfs/Makefile
index 6fde55f65ac3..d1fb29b7a273 100644
--- a/sys/modules/mfs/Makefile
+++ b/sys/modules/mfs/Makefile
@@ -1,13 +1,13 @@
-# $Id: Makefile,v 1.4 1998/10/16 04:30:47 peter Exp $
+# $Id: Makefile,v 1.3 1997/02/22 12:48:36 peter Exp $
.PATH: ${.CURDIR}/../../ufs/mfs
KMOD= mfs
SRCS= mfs_vfsops.c mfs_vnops.c opt_mfs.h
NOMAN=
VFS_KLD=
-CLEANFILES+= opt_mfs.h
+CFLAGS+= -DFFS -DMFS
opt_mfs.h:
- touch ${.TARGET}
+ touch opt_mfs.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/pcic/Makefile b/sys/modules/pcic/Makefile
index 550d58922a49..0c8c2047bfcd 100644
--- a/sys/modules/pcic/Makefile
+++ b/sys/modules/pcic/Makefile
@@ -1,8 +1,9 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:48 peter Exp $
+# $Id: Makefile,v 1.6 1997/02/22 12:48:45 peter Exp $
.PATH: ${.CURDIR}/../../pccard
KMOD= pcic
SRCS= pcic.c
NOMAN=
+CFLAGS+= -DLKM
.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/Makefile b/sys/modules/splash/Makefile
deleted file mode 100644
index 39a292e7c6bf..000000000000
--- a/sys/modules/splash/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $Id: $
-
-SUBDIR= bmp
-
-.include <bsd.subdir.mk>
diff --git a/sys/modules/splash/Makefile.inc b/sys/modules/splash/Makefile.inc
deleted file mode 100644
index 64212f6bfa21..000000000000
--- a/sys/modules/splash/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id: $
-
-.include "../Makefile.inc"
diff --git a/sys/modules/splash/bmp/Makefile b/sys/modules/splash/bmp/Makefile
deleted file mode 100644
index 798e7e428389..000000000000
--- a/sys/modules/splash/bmp/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $Id: $
-
-KMOD= splash_bmp
-SRCS= splash_bmp.c
-
-NOMAN=
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/bmp/splash_bmp.c b/sys/modules/splash/bmp/splash_bmp.c
deleted file mode 100644
index 03192c697e39..000000000000
--- a/sys/modules/splash/bmp/splash_bmp.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*-
- * Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@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 AUTHORS 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 AUTHORS 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.
- *
- * $Id: splash_bmp.c,v 1.2 1999/01/11 17:32:22 yokota Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/linker.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
-#define FADE_TIMEOUT 300 /* sec */
-
-static int splash_mode = -1;
-static int splash_on = FALSE;
-
-static int bmp_start(video_adapter_t *adp);
-static int bmp_end(video_adapter_t *adp);
-static int bmp_splash(video_adapter_t *adp, int on);
-static int bmp_Init(const char *data, int swidth, int sheight, int sdepth);
-static int bmp_Draw(video_adapter_t *adp);
-
-static splash_decoder_t bmp_decoder = {
- "splash_bmp", bmp_start, bmp_end, bmp_splash, SPLASH_IMAGE,
-};
-
-SPLASH_DECODER(splash_bmp, bmp_decoder);
-
-static int
-bmp_start(video_adapter_t *adp)
-{
- static int modes[] = {
- M_VGA_CG320,
- -1,
- };
- video_info_t info;
- int i;
-
- if ((bmp_decoder.data == NULL) || (bmp_decoder.data_size <= 0))
- return ENODEV;
- for (i = 0; modes[i] >= 0; ++i) {
- if (((*vidsw[adp->va_index]->get_info)(adp, modes[i], &info) == 0)
- && (bmp_Init((u_char *)bmp_decoder.data,
- info.vi_width, info.vi_height, info.vi_depth) == 0))
- break;
- }
- splash_mode = modes[i];
- if (bootverbose)
- printf("bmp_start(): splash_mode:%d\n", splash_mode);
- return ((splash_mode < 0) ? ENODEV : 0);
-}
-
-static int
-bmp_end(video_adapter_t *adp)
-{
- /* nothing to do */
- return 0;
-}
-
-static int
-bmp_splash(video_adapter_t *adp, int on)
-{
- static u_char pal[256*3];
- static long time_stamp;
- struct timeval tv;
- int i;
-
- if (on) {
- if (!splash_on) {
- /* set up the video mode and draw something */
- if ((*vidsw[adp->va_index]->set_mode)(adp, splash_mode))
- return 1;
- if (bmp_Draw(adp))
- return 1;
- (*vidsw[adp->va_index]->save_palette)(adp, pal);
- time_stamp = 0;
- splash_on = TRUE;
- }
- /*
- * This is a kludge to fade the image away. This section of the
- * code takes effect only after the system is completely up.
- */
- if (!cold) {
- getmicrotime(&tv);
- if (time_stamp == 0)
- time_stamp = tv.tv_sec;
- if (tv.tv_sec > time_stamp + FADE_TIMEOUT) {
- for (i = 0; i < sizeof(pal); ++i) {
- if (pal[i] > 40)
- pal[i] -= 4;
- }
- (*vidsw[adp->va_index]->load_palette)(adp, pal);
- }
- }
- return 0;
- } else {
- /* the video mode will be restored by the caller */
- splash_on = FALSE;
- return 0;
- }
-}
-
-/*
-** Code to handle Microsoft DIB (".BMP") format images.
-**
-** Blame me (msmith@freebsd.org) if this is broken, not Soren.
-*/
-
-typedef struct tagBITMAPFILEHEADER { /* bmfh */
- u_short bfType __attribute__ ((packed));
- int bfSize __attribute__ ((packed));
- u_short bfReserved1 __attribute__ ((packed));
- u_short bfReserved2 __attribute__ ((packed));
- int bfOffBits __attribute__ ((packed));
-} BITMAPFILEHEADER;
-
-typedef struct tagBITMAPINFOHEADER { /* bmih */
- int biSize __attribute__ ((packed));
- int biWidth __attribute__ ((packed));
- int biHeight __attribute__ ((packed));
- short biPlanes __attribute__ ((packed));
- short biBitCount __attribute__ ((packed));
- int biCompression __attribute__ ((packed));
- int biSizeImage __attribute__ ((packed));
- int biXPelsPerMeter __attribute__ ((packed));
- int biYPelsPerMeter __attribute__ ((packed));
- int biClrUsed __attribute__ ((packed));
- int biClrImportant __attribute__ ((packed));
-} BITMAPINFOHEADER;
-
-typedef struct tagRGBQUAD { /* rgbq */
- u_char rgbBlue __attribute__ ((packed));
- u_char rgbGreen __attribute__ ((packed));
- u_char rgbRed __attribute__ ((packed));
- u_char rgbReserved __attribute__ ((packed));
-} RGBQUAD;
-
-typedef struct tagBITMAPINFO { /* bmi */
- BITMAPINFOHEADER bmiHeader __attribute__ ((packed));
- RGBQUAD bmiColors[256] __attribute__ ((packed));
-} BITMAPINFO;
-
-typedef struct tagBITMAPF
-{
- BITMAPFILEHEADER bmfh __attribute__ ((packed));
- BITMAPINFO bmfi __attribute__ ((packed));
-} BITMAPF;
-
-#define BI_RGB 0
-#define BI_RLE8 1
-#define BI_RLE4 2
-
-/*
-** all we actually care about the image
-*/
-typedef struct
-{
- int width,height; /* image dimensions */
- int swidth,sheight; /* screen dimensions for the current mode */
- u_char sdepth; /* screen depth (1, 4, 8 bpp) */
- int ncols; /* number of colours */
- u_char palette[256][3]; /* raw palette data */
- u_char format; /* one of the BI_* constants above */
- u_char *data; /* pointer to the raw data */
- u_char *index; /* running pointer to the data while drawing */
- u_char *vidmem; /* video memory allocated for drawing */
-} BMP_INFO;
-
-static BMP_INFO bmp_info;
-
-/*
-** bmp_SetPix
-**
-** Given (info), set the pixel at (x),(y) to (val)
-**
-*/
-static void
-bmp_SetPix(BMP_INFO *info, int x, int y, u_char val)
-{
- int sofs, bofs;
- u_char tpv, mask;
-
- /*
- * range check to avoid explosions
- */
- if ((x < 0) || (x >= info->swidth) || (y < 0) || (y >= info->sheight))
- return;
-
- /*
- * calculate offset into video memory;
- * because 0,0 is bottom-left for DIB, we have to convert.
- */
- sofs = ((info->height - (y+1) + (info->sheight - info->height) / 2)
- * info->swidth) + x + (info->swidth - info->width) / 2;
-
- switch(info->sdepth) {
- case 1:
- sofs = sofs >> 3; /* correct for depth */
- bofs = x & 0x7; /* offset within byte */
-
- val &= 1; /* mask pixel value */
- mask = ~(0x80 >> bofs); /* calculate bit mask */
- tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bit */
- *(info->vidmem+sofs) = tpv | (val << (8-bofs)); /* write new bit */
- break;
-
- /* XXX only correct for non-interleaved modes */
- case 4:
- sofs = sofs >> 1; /* correct for depth */
- bofs = x & 0x1; /* offset within byte */
-
- val &= 0xf; /* mask pixel value */
- mask = bofs ? 0x0f : 0xf0; /* calculate bit mask */
- tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bits */
- *(info->vidmem+sofs) = tpv | (val << (bofs ? 0 : 4)); /* write new bits */
- break;
-
- case 8:
- *(info->vidmem+sofs) = val;
- break;
- }
-}
-
-/*
-** bmp_DecodeRLE4
-**
-** Given (data) pointing to a line of RLE4-format data and (line) being the starting
-** line onscreen, decode the line.
-*/
-static void
-bmp_DecodeRLE4(BMP_INFO *info, int line)
-{
- int count; /* run count */
- u_char val;
- int x,y; /* screen position */
-
- x = 0; /* starting position */
- y = line;
-
- /* loop reading data */
- for (;;) {
- /*
- * encoded mode starts with a run length, and then a byte with
- * two colour indexes to alternate between for the run
- */
- if (*info->index) {
- for (count = 0; count < *info->index; count++, x++) {
- if (count & 1) { /* odd count, low nybble */
- bmp_SetPix(info, x, y, *(info->index+1) & 0x0f);
- } else { /* even count, high nybble */
- bmp_SetPix(info, x, y, (*(info->index+1) >>4) & 0x0f);
- }
- }
- info->index += 2;
- /*
- * A leading zero is an escape; it may signal the end of the
- * bitmap, a cursor move, or some absolute data.
- */
- } else { /* zero tag may be absolute mode or an escape */
- switch (*(info->index+1)) {
- case 0: /* end of line */
- info->index += 2;
- return;
- case 1: /* end of bitmap */
- info->index = NULL;
- return;
- case 2: /* move */
- x += *(info->index + 2); /* new coords */
- y += *(info->index + 3);
- info->index += 4;
- break;
- default: /* literal bitmap data */
- for (count = 0; count < *(info->index + 1); count++, x++) {
- val = *(info->index + 2 + (count / 2)); /* byte with nybbles */
- if (count & 1) {
- val &= 0xf; /* get low nybble */
- } else {
- val = (val >> 4); /* get high nybble */
- }
- bmp_SetPix(info, x, y, val);
- }
- /* warning, this depends on integer truncation, do not hand-optimise! */
- info->index += 2 + ((count + 3) / 4) * 2;
- break;
- }
- }
- }
-}
-
-/*
-** bmp_DecodeRLE8
-** Given (data) pointing to a line of RLE4-format data and (line) being the starting
-** line onscreen, decode the line.
-*/
-static void
-bmp_DecodeRLE8(BMP_INFO *info, int line)
-{
- int count; /* run count */
- int x,y; /* screen position */
-
- x = 0; /* starting position */
- y = line;
-
- /* loop reading data */
- for(;;) {
- /*
- * encoded mode starts with a run length, and then a byte with
- * two colour indexes to alternate between for the run
- */
- if (*info->index) {
- for (count = 0; count < *info->index; count++, x++)
- bmp_SetPix(info, x, y, *(info->index+1));
- info->index += 2;
- /*
- * A leading zero is an escape; it may signal the end of the
- * bitmap, a cursor move, or some absolute data.
- */
- } else { /* zero tag may be absolute mode or an escape */
- switch(*(info->index+1)) {
- case 0: /* end of line */
- info->index += 2;
- return;
- case 1: /* end of bitmap */
- info->index = NULL;
- return;
- case 2: /* move */
- x += *(info->index + 2); /* new coords */
- y += *(info->index + 3);
- info->index += 4;
- break;
- default: /* literal bitmap data */
- for (count = 0; count < *(info->index + 1); count++, x++)
- bmp_SetPix(info, x, y, *(info->index + 2 + count));
- /* must be an even count */
- info->index += 2 + count + (count & 1);
- break;
- }
- }
- }
-}
-
-/*
-** bmp_DecodeLine
-**
-** Given (info) pointing to an image being decoded, (line) being the line currently
-** being displayed, decode a line of data.
-*/
-static void
-bmp_DecodeLine(BMP_INFO *info, int line)
-{
- int x;
-
- switch(info->format) {
- case BI_RGB:
- for (x = 0; x < info->width; x++, info->index++)
- bmp_SetPix(info, x, line, *info->index);
- info->index += 3 - (--x % 4);
- break;
- case BI_RLE4:
- bmp_DecodeRLE4(info, line);
- break;
- case BI_RLE8:
- bmp_DecodeRLE8(info, line);
- break;
- }
-}
-
-/*
-** bmp_Init
-**
-** Given a pointer (data) to the image of a BMP file, fill in bmp_info with what
-** can be learnt from it. Return nonzero if the file isn't usable.
-**
-** Take screen dimensions (swidth), (sheight) and (sdepth) and make sure we
-** can work with these.
-*/
-static int
-bmp_Init(const char *data, int swidth, int sheight, int sdepth)
-{
- BITMAPF *bmf = (BITMAPF *)data;
- int pind;
-
- bmp_info.data = NULL; /* assume setup failed */
-#if 0
- bmp_info.vidmem = vidmem; /* remember where */
-#endif
-
- /* check file ID */
- if (bmf->bmfh.bfType != 0x4d42) {
- return(1); /* XXX check word ordering for big-endian ports? */
- }
-
- /* save what we know about the screen */
- bmp_info.swidth = swidth;
- bmp_info.sheight = sheight;
- bmp_info.sdepth = sdepth;
-
- /* where's the data? */
- bmp_info.data = (u_char *)data + bmf->bmfh.bfOffBits;
-
- /* image parameters */
- bmp_info.width = bmf->bmfi.bmiHeader.biWidth;
- bmp_info.height = bmf->bmfi.bmiHeader.biHeight;
- bmp_info.format = bmf->bmfi.bmiHeader.biCompression;
-
- switch(bmp_info.format) { /* check compression format */
- case BI_RGB:
- case BI_RLE4:
- case BI_RLE8:
- break;
- default:
- return(1); /* unsupported compression format */
- }
-
- /* palette details */
- bmp_info.ncols = (bmf->bmfi.bmiHeader.biClrUsed);
- bzero(bmp_info.palette,sizeof(bmp_info.palette));
- if (bmp_info.ncols == 0) { /* uses all of them */
- bmp_info.ncols = 1 << bmf->bmfi.bmiHeader.biBitCount;
- }
- if ((bmp_info.height > bmp_info.sheight) ||
- (bmp_info.width > bmp_info.swidth) ||
- (bmp_info.ncols > (1 << sdepth))) {
- return(1); /* beyond screen capacity */
- }
-
- /* read palette */
- for (pind = 0; pind < bmp_info.ncols; pind++) {
- bmp_info.palette[pind][0] = bmf->bmfi.bmiColors[pind].rgbRed;
- bmp_info.palette[pind][1] = bmf->bmfi.bmiColors[pind].rgbGreen;
- bmp_info.palette[pind][2] = bmf->bmfi.bmiColors[pind].rgbBlue;
- }
- return(0);
-}
-
-/*
-** bmp_Draw
-**
-** Render the image. Return nonzero if that's not possible.
-**
-*/
-static int
-bmp_Draw(video_adapter_t *adp)
-{
- int line;
-
- if (bmp_info.data == NULL) { /* init failed, do nothing */
- return(1);
- }
-
- /* clear the screen */
- bmp_info.vidmem = (u_char *)adp->va_window;
- /* XXX; the following line is correct only for 8bpp modes */
- bzero(bmp_info.vidmem, bmp_info.swidth * bmp_info.sheight);
-
- /* initialise the info structure for drawing */
- bmp_info.index = bmp_info.data;
-
- /* set the palette for our image */
- (*vidsw[adp->va_index]->load_palette)(adp, (u_char *)&bmp_info.palette);
-
- for (line = 0; (line < bmp_info.height) && bmp_info.index; line++) {
- bmp_DecodeLine(&bmp_info, line);
- }
- return(0);
-}
diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile
index d817ca271a49..195fd0381e66 100644
--- a/sys/modules/syscons/Makefile
+++ b/sys/modules/syscons/Makefile
@@ -1,5 +1,5 @@
-# $Id: Makefile,v 1.6 1998/12/28 14:23:43 des Exp $
+# $Id: Makefile,v 1.3 1997/02/22 12:48:58 peter Exp $
-SUBDIR= blank daemon fade green logo rain snake star warp
+SUBDIR= blank daemon fade green snake star
.include <bsd.subdir.mk>
diff --git a/sys/modules/syscons/blank/blank_saver.c b/sys/modules/syscons/blank/blank_saver.c
index 89dd199815f5..1bb73233e790 100644
--- a/sys/modules/syscons/blank/blank_saver.c
+++ b/sys/modules/syscons/blank/blank_saver.c
@@ -25,26 +25,29 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: blank_saver.c,v 1.14 1998/11/04 03:49:38 peter Exp $
+ * $Id: blank_saver.c,v 1.12 1998/09/15 18:16:38 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include <dev/fb/vgareg.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static int
-blank_saver(video_adapter_t *adp, int blank)
+MOD_MISC(blank_saver);
+
+static void
+blank_saver(int blank)
{
u_char val;
if (blank) {
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
@@ -53,18 +56,18 @@ blank_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x25);
+ outb(crtc_addr + 4, 0x25);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x21);
+ outb(crtc_addr + 4, 0x21);
break;
default:
break;
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
@@ -73,23 +76,24 @@ blank_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x2d);
+ outb(crtc_addr + 4, 0x2d);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x29);
+ outb(crtc_addr + 4, 0x29);
break;
default:
break;
}
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-blank_init(video_adapter_t *adp)
+blank_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -100,17 +104,18 @@ blank_init(video_adapter_t *adp)
default:
return ENODEV;
}
- return 0;
+ return add_scrn_saver(blank_saver);
}
static int
-blank_term(video_adapter_t *adp)
+blank_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(blank_saver);
}
-static scrn_saver_t blank_module = {
- "blank_saver", blank_init, blank_term, blank_saver, NULL,
-};
-
-SAVER_MODULE(blank_saver, blank_module);
+int
+blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
+ blank_saver_load, blank_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/daemon/daemon_saver.c b/sys/modules/syscons/daemon/daemon_saver.c
index 09f6caf36189..59e99f0fe328 100644
--- a/sys/modules/syscons/daemon/daemon_saver.c
+++ b/sys/modules/syscons/daemon/daemon_saver.c
@@ -25,12 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: daemon_saver.c,v 1.13 1999/01/11 03:18:45 yokota Exp $
+ * $Id: daemon_saver.c,v 1.10 1998/09/15 18:16:38 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
@@ -46,10 +48,11 @@
#define DAEMON_MAX_WIDTH 32
#define DAEMON_MAX_HEIGHT 19
+MOD_MISC(daemon_saver);
+
static char *message;
static int messagelen;
static u_short *window;
-static int blanked;
/* Who is the author of this ASCII pic? */
@@ -185,8 +188,8 @@ draw_string(int xpos, int ypos, int xoff, char *s, int len)
scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
}
-static int
-daemon_saver(video_adapter_t *adp, int blank)
+static void
+daemon_saver(int blank)
{
static int txpos = 10, typos = 10;
static int txdir = -1, tydir = -1;
@@ -199,19 +202,20 @@ daemon_saver(video_adapter_t *adp, int blank)
int min, max;
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (blanked == 0) {
- window = (u_short *)adp->va_window;
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked == 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
/* clear the screen and set the border color */
fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
window, scp->xsize * scp->ysize);
set_border(scp, 0);
xlen = ylen = tlen = 0;
}
- if (blanked++ < 2)
- return 0;
- blanked = 1;
+ if (scrn_blanked++ < 2)
+ return;
+ scrn_blanked = 1;
clear_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
clear_string(txpos, typos, toff, (char *)message, tlen);
@@ -322,31 +326,44 @@ daemon_saver(video_adapter_t *adp, int blank)
draw_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
draw_string(txpos, typos, toff, (char *)message, tlen);
} else {
- blanked = 0;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-daemon_init(video_adapter_t *adp)
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
{
+ int err;
+
messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 +
strlen(osrelease);
message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
sprintf(message, "%s - %s %s", hostname, ostype, osrelease);
- blanked = 0;
- return 0;
+
+ err = add_scrn_saver(daemon_saver);
+ if (err != 0)
+ free(message, M_DEVBUF);
+ return err;
}
static int
-daemon_term(video_adapter_t *adp)
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- free(message, M_DEVBUF);
- return 0;
-}
+ int err;
-static scrn_saver_t daemon_module = {
- "daemon_saver", daemon_init, daemon_term, daemon_saver, NULL,
-};
+ err = remove_scrn_saver(daemon_saver);
+ if (err == 0)
+ free(message, M_DEVBUF);
+ return err;
+}
-SAVER_MODULE(daemon_saver, daemon_module);
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/fade/fade_saver.c b/sys/modules/syscons/fade/fade_saver.c
index 70d36c9c1e0c..0d31bd6de526 100644
--- a/sys/modules/syscons/fade/fade_saver.c
+++ b/sys/modules/syscons/fade/fade_saver.c
@@ -25,34 +25,33 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: fade_saver.c,v 1.15 1998/11/04 03:49:38 peter Exp $
+ * $Id: fade_saver.c,v 1.13 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static u_char palette[256*3];
-static int blanked;
+MOD_MISC(fade_saver);
-static int
-fade_saver(video_adapter_t *adp, int blank)
+static void
+fade_saver(int blank)
{
static int count = 0;
u_char pal[256*3];
int i;
if (blank) {
- blanked = TRUE;
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
- if (count <= 0)
- save_palette(adp, palette);
if (count < 64) {
pal[0] = pal[1] = pal[2] = 0;
for (i = 3; i < 256*3; i++) {
@@ -61,7 +60,7 @@ fade_saver(video_adapter_t *adp, int blank)
else
pal[i] = 60;
}
- load_palette(adp, pal);
+ load_palette(cur_console, pal);
count++;
}
break;
@@ -69,44 +68,44 @@ fade_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x25);
+ outb(crtc_addr + 4, 0x25);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x21);
+ outb(crtc_addr + 4, 0x21);
break;
default:
break;
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
- load_palette(adp, palette);
+ load_palette(cur_console, palette);
count = 0;
break;
case KD_EGA:
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x2d);
+ outb(crtc_addr + 4, 0x2d);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x29);
+ outb(crtc_addr + 4, 0x29);
break;
default:
break;
}
- blanked = FALSE;
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-fade_init(video_adapter_t *adp)
+fade_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -121,18 +120,18 @@ fade_init(video_adapter_t *adp)
default:
return ENODEV;
}
- blanked = FALSE;
- return 0;
+ return add_scrn_saver(fade_saver);
}
static int
-fade_term(video_adapter_t *adp)
+fade_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(fade_saver);
}
-static scrn_saver_t fade_module = {
- "fade_saver", fade_init, fade_term, fade_saver, NULL,
-};
-
-SAVER_MODULE(fade_saver, fade_module);
+int
+fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
+ fade_saver_load, fade_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/green/green_saver.c b/sys/modules/syscons/green/green_saver.c
index 9decd7282f9f..0e61c2e2102b 100644
--- a/sys/modules/syscons/green/green_saver.c
+++ b/sys/modules/syscons/green/green_saver.c
@@ -25,29 +25,29 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: green_saver.c,v 1.14 1998/11/04 03:49:38 peter Exp $
+ * $Id: green_saver.c,v 1.12 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include <dev/fb/vgareg.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static int
-green_saver(video_adapter_t *adp, int blank)
+MOD_MISC(green_saver);
+
+static void
+green_saver(int blank)
{
- int crtc_addr;
u_char val;
-
- crtc_addr = adp->va_crtc_addr;
if (blank) {
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
@@ -69,7 +69,7 @@ green_saver(video_adapter_t *adp, int blank)
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
@@ -89,14 +89,15 @@ green_saver(video_adapter_t *adp, int blank)
default:
break;
}
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-green_init(video_adapter_t *adp)
+green_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -111,17 +112,18 @@ green_init(video_adapter_t *adp)
default:
return ENODEV;
}
- return 0;
+ return add_scrn_saver(green_saver);
}
static int
-green_term(video_adapter_t *adp)
+green_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(green_saver);
}
-static scrn_saver_t green_module = {
- "green_saver", green_init, green_term, green_saver, NULL,
-};
-
-SAVER_MODULE(green_saver, green_module);
+int
+green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
+ green_saver_load, green_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/logo/Makefile b/sys/modules/syscons/logo/Makefile
deleted file mode 100644
index 1bccccdbde1a..000000000000
--- a/sys/modules/syscons/logo/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/28 14:22:57 des Exp $
-
-KMOD= logo_saver
-SRCS= logo_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/logo/logo.c b/sys/modules/syscons/logo/logo.c
deleted file mode 100644
index be502fe502ff..000000000000
--- a/sys/modules/syscons/logo/logo.c
+++ /dev/null
@@ -1,352 +0,0 @@
-#define logo_w 88
-#define logo_h 88
-
-unsigned char logo_pal[768] = {
- 0x00, 0x00, 0x00,
- 0x33, 0x33, 0x33,
- 0x66, 0x66, 0x66,
- 0x99, 0x99, 0x99,
- 0xcc, 0xcc, 0xcc,
- 0xff, 0xff, 0xff,
- 0x90, 0x8f, 0x90,
- 0x56, 0x4b, 0x55,
- 0xa3, 0xa5, 0xab,
- 0xfd, 0xfd, 0xfd,
- 0x6d, 0x6e, 0x74,
- 0x41, 0x2b, 0x39,
- 0xcb, 0xc8, 0xcb,
- 0xcf, 0xbb, 0xba,
- 0x8e, 0x82, 0x87,
- 0x5c, 0x5d, 0x60,
- 0x52, 0x2a, 0x37,
- 0x7f, 0x76, 0x7d,
- 0x82, 0x82, 0x85,
- 0x7a, 0x3e, 0x45,
- 0x7f, 0x6e, 0x70,
- 0xef, 0xef, 0xed,
- 0x53, 0x41, 0x4b,
- 0x67, 0x2b, 0x35,
- 0x6a, 0x55, 0x62,
- 0xe7, 0xe2, 0xe3,
- 0x64, 0x35, 0x3f,
- 0xf7, 0xe0, 0xe7,
- 0xb1, 0xb2, 0xb2,
- 0x31, 0x2b, 0x35,
- 0x7a, 0x2d, 0x37,
- 0x69, 0x4c, 0x56,
- 0x95, 0x9d, 0xa4,
- 0x85, 0x61, 0x69,
- 0x40, 0x34, 0x41,
- 0x8f, 0x2e, 0x39,
- 0x7a, 0x50, 0x5a,
- 0xde, 0xe1, 0xe0,
- 0x32, 0x33, 0x3d,
- 0xa0, 0x9b, 0x9c,
- 0x68, 0x63, 0x67,
- 0x76, 0x60, 0x67,
- 0xba, 0xb6, 0xb8,
- 0x29, 0x24, 0x41,
- 0x38, 0x21, 0x29,
- 0x42, 0x21, 0x27,
- 0xa2, 0x2a, 0x32,
- 0x56, 0x55, 0x58,
- 0x55, 0x21, 0x2b,
- 0x7a, 0x20, 0x2a,
- 0x37, 0x16, 0x21,
- 0x4d, 0x18, 0x37,
- 0x8a, 0x3a, 0x3e,
- 0xc0, 0xc2, 0xc4,
- 0x64, 0x23, 0x2c,
- 0x37, 0x1a, 0x24,
- 0x42, 0x18, 0x20,
- 0x4c, 0x21, 0x2b,
- 0xa0, 0x23, 0x2e,
- 0x95, 0x6c, 0x76,
- 0x26, 0x16, 0x1c,
- 0xa5, 0x18, 0x23,
- 0x84, 0x20, 0x2b,
- 0x6d, 0x3f, 0x49,
- 0xae, 0xa7, 0xac,
- 0x2a, 0x1f, 0x24,
- 0x90, 0x21, 0x30,
- 0xa0, 0x39, 0x3e,
- 0x95, 0x0f, 0x1c,
- 0x84, 0x13, 0x1e,
- 0x4e, 0x17, 0x24,
- 0x8c, 0x56, 0x5f,
- 0xe0, 0xc4, 0xcb,
- 0xa5, 0x7f, 0x8e,
- 0xff, 0xff, 0xf1,
- 0x3d, 0x3d, 0x5d,
- 0x61, 0x19, 0x26,
- 0xd5, 0xd5, 0xd5,
- 0xff, 0xf1, 0xed,
- 0xb6, 0x9c, 0xa5,
- 0x87, 0x4c, 0x5a,
- 0xa0, 0x76, 0x76,
- 0xc8, 0xa0, 0xa0,
- 0xa2, 0xc1, 0xc8,
- 0x91, 0xae, 0xb6,
- 0x52, 0x8b, 0xae,
- 0xb3, 0xd2, 0xd4,
- 0x95, 0xb7, 0xc1,
- 0x54, 0x6e, 0x83,
- 0x67, 0x90, 0xa6,
- 0x44, 0x3e, 0x45,
- 0x23, 0x40, 0x6a,
- 0x41, 0x6e, 0x97,
- 0x7e, 0x8e, 0x91,
- 0x52, 0x33, 0x41,
- 0x39, 0x49, 0x68,
- 0x1d, 0x2a, 0x48,
- 0x17, 0x21, 0x45,
- 0x90, 0x17, 0x1f,
- 0x38, 0x54, 0x71,
- 0x1c, 0x33, 0x58,
- 0x1c, 0x1e, 0x23,
- 0x6c, 0x17, 0x21,
- 0xb0, 0xc5, 0xc1,
- 0x5d, 0x7f, 0x96,
- 0xe9, 0xbf, 0xc1,
- 0x96, 0x06, 0x0f,
- 0x78, 0x16, 0x1e,
- 0xab, 0x0e, 0x18,
- 0xa6, 0x06, 0x0e,
- 0x4c, 0x4c, 0x54,
- 0x61, 0x42, 0x4c,
- 0x48, 0x5f, 0x84,
- 0xa0, 0xb8, 0xbe,
- 0x5c, 0x66, 0x7f,
- 0x7b, 0x9e, 0xa9,
- 0x6f, 0x75, 0x7f,
- 0x45, 0x54, 0x74,
- 0x32, 0x3e, 0x63,
- 0xb1, 0xb4, 0xb3,
- 0x66, 0x9d, 0xb4,
- 0x7a, 0x9f, 0xbb,
- 0x82, 0xaa, 0xba,
- 0x13, 0x15, 0x17,
- 0x0b, 0x0b, 0x0a,
- 0x37, 0x66, 0x92,
- 0x4c, 0x7f, 0xa5,
- 0x24, 0x4c, 0x7b,
- 0x25, 0x5f, 0x91,
- 0x40, 0x7d, 0xa5,
- 0x1d, 0x56, 0x88,
- 0x2d, 0x6f, 0xa0,
- 0x70, 0x81, 0x8f,
- 0x58, 0x97, 0xbd,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
-};
-
-unsigned char logo_img[logo_w*logo_h] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x09, 0x0a, 0x0b, 0x07, 0x0c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0d, 0x0e, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x0f, 0x0b, 0x10, 0x11, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x12, 0x13, 0x14, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x16, 0x0b, 0x17, 0x18, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x13, 0x1a, 0x1b, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x1c, 0x1d, 0x10, 0x1e, 0x1f, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x20, 0x0b, 0x1e, 0x21, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x22, 0x0b, 0x17, 0x23, 0x24, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x26, 0x10, 0x23, 0x27, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x11, 0x28, 0x29, 0x11, 0x06, 0x0d, 0x09, 0x05, 0x2a, 0x2b, 0x2c, 0x2d, 0x1e, 0x2e, 0x21, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2f, 0x0b, 0x30, 0x31, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x06, 0x16, 0x22, 0x1d, 0x2c, 0x32, 0x33, 0x17, 0x17, 0x17, 0x22, 0x14, 0x16, 0x1d, 0x2c, 0x2d, 0x1e, 0x2e, 0x34, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x2c, 0x36, 0x36, 0x35, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x27, 0x0b, 0x2c, 0x2c, 0x37, 0x32, 0x38, 0x2c, 0x2d, 0x39, 0x36, 0x17, 0x30, 0x2c, 0x2c, 0x2d, 0x2c, 0x2c, 0x1a, 0x3a, 0x3a, 0x3b, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2d, 0x2b, 0x33, 0x31, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x09, 0x28, 0x2c, 0x37, 0x3c, 0x32, 0x38, 0x38, 0x37, 0x2c, 0x30, 0x36, 0x36, 0x17, 0x31, 0x36, 0x23, 0x23, 0x17, 0x2c, 0x17, 0x3a, 0x3d, 0x13, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x2c, 0x37, 0x33, 0x3e, 0x31, 0x3f, 0x40, 0x19, 0x05, 0x11, 0x2c, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x37, 0x41, 0x30, 0x3a, 0x3a, 0x2e, 0x42, 0x43, 0x17, 0x1a, 0x13, 0x23, 0x31, 0x1a, 0x2e, 0x3d, 0x1a, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0b, 0x37, 0x32, 0x37, 0x33, 0x44, 0x44, 0x45, 0x17, 0x1a, 0x10, 0x2d, 0x37, 0x38, 0x46, 0x33, 0x46, 0x32, 0x2c, 0x23, 0x23, 0x47, 0x21, 0x13, 0x43, 0x34, 0x48, 0x19, 0x49, 0x34, 0x17, 0x1e, 0x3a, 0x13, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4b, 0x32, 0x32, 0x32, 0x32, 0x4c, 0x45, 0x44, 0x44, 0x42, 0x36, 0x30, 0x33, 0x46, 0x38, 0x33, 0x46, 0x38, 0x31, 0x23, 0x27, 0x09, 0x4a, 0x4d, 0x47, 0x43, 0x0d, 0x4e, 0x4a, 0x4f, 0x34, 0x1a, 0x2e, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x33, 0x32, 0x32, 0x32, 0x33, 0x4c, 0x31, 0x45, 0x3e, 0x31, 0x36, 0x46, 0x46, 0x33, 0x33, 0x39, 0x30, 0x23, 0x50, 0x4a, 0x4a, 0x4a, 0x4a, 0x4d, 0x47, 0x51, 0x4e, 0x4a, 0x4a, 0x0e, 0x13, 0x1a, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x32, 0x32, 0x2b, 0x32, 0x33, 0x4c, 0x33, 0x4c, 0x4c, 0x36, 0x30, 0x30, 0x30, 0x30, 0x31, 0x23, 0x3a, 0x49, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4f, 0x50, 0x1b, 0x4e, 0x4a, 0x19, 0x50, 0x16, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x32, 0x32, 0x32, 0x32, 0x2b, 0x33, 0x33, 0x30, 0x2d, 0x39, 0x30, 0x30, 0x30, 0x4c, 0x36, 0x42, 0x3a, 0x52, 0x05, 0x4a, 0x4a, 0x4a, 0x4a, 0x09, 0x3b, 0x52, 0x4e, 0x4a, 0x4a, 0x4f, 0x1a, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x2b, 0x2b, 0x32, 0x32, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2d, 0x10, 0x30, 0x30, 0x3e, 0x23, 0x3a, 0x0d, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x40, 0x51, 0x4a, 0x4a, 0x25, 0x15, 0x1f, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x22, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x2d, 0x2c, 0x41, 0x32, 0x39, 0x46, 0x4c, 0x31, 0x2e, 0x2e, 0x0c, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x25, 0x53, 0x18, 0x4a, 0x54, 0x55, 0x56, 0x51, 0x11, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x22, 0x32, 0x32, 0x32, 0x38, 0x38, 0x32, 0x2c, 0x37, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3a, 0x2a, 0x4a, 0x4a, 0x05, 0x4a, 0x57, 0x58, 0x59, 0x5a, 0x35, 0x58, 0x5b, 0x5c, 0x5d, 0x5e, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x07, 0x37, 0x32, 0x38, 0x38, 0x32, 0x32, 0x41, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3d, 0x27, 0x05, 0x4a, 0x4a, 0x4a, 0x5c, 0x5f, 0x59, 0x1d, 0x29, 0x2f, 0x60, 0x61, 0x26, 0x0b, 0x1c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4e, 0x0a, 0x2d, 0x38, 0x38, 0x32, 0x37, 0x32, 0x2d, 0x39, 0x36, 0x31, 0x62, 0x3d, 0x0e, 0x4a, 0x4a, 0x4a, 0x09, 0x63, 0x64, 0x64, 0x61, 0x2d, 0x1d, 0x65, 0x61, 0x2b, 0x17, 0x16, 0x4a, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x2c, 0x38, 0x38, 0x37, 0x37, 0x38, 0x2d, 0x30, 0x31, 0x42, 0x3a, 0x18, 0x09, 0x05, 0x05, 0x4a, 0x63, 0x60, 0x60, 0x2b, 0x10, 0x2d, 0x41, 0x41, 0x30, 0x42, 0x3e, 0x29, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x37, 0x32, 0x38, 0x32, 0x41, 0x38, 0x38, 0x30, 0x66, 0x31, 0x3a, 0x1e, 0x67, 0x4a, 0x4a, 0x05, 0x68, 0x64, 0x61, 0x2b, 0x17, 0x36, 0x10, 0x33, 0x31, 0x42, 0x3d, 0x45, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x1c, 0x2c, 0x32, 0x32, 0x37, 0x41, 0x2c, 0x46, 0x30, 0x36, 0x36, 0x42, 0x42, 0x29, 0x1b, 0x4a, 0x4a, 0x4d, 0x26, 0x60, 0x0b, 0x17, 0x36, 0x44, 0x45, 0x66, 0x3e, 0x44, 0x44, 0x1a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x2c, 0x32, 0x32, 0x38, 0x37, 0x32, 0x37, 0x30, 0x36, 0x4c, 0x31, 0x1e, 0x10, 0x1f, 0x52, 0x69, 0x52, 0x07, 0x2c, 0x10, 0x36, 0x62, 0x6a, 0x44, 0x6b, 0x3e, 0x44, 0x6c, 0x30, 0x09, 0x05, 0x05, 0x25, 0x54, 0x19, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x2c, 0x37, 0x38, 0x37, 0x2c, 0x32, 0x32, 0x46, 0x30, 0x46, 0x4c, 0x31, 0x66, 0x4c, 0x36, 0x1a, 0x1a, 0x17, 0x37, 0x37, 0x10, 0x31, 0x62, 0x45, 0x4c, 0x3e, 0x44, 0x62, 0x30, 0x09, 0x05, 0x0a, 0x70, 0x71, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x32, 0x32, 0x38, 0x41, 0x41, 0x38, 0x2d, 0x46, 0x66, 0x44, 0x6c, 0x6c, 0x6c, 0x3d, 0x3a, 0x42, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x30, 0x36, 0x3e, 0x3e, 0x31, 0x07, 0x05, 0x12, 0x6e, 0x72, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2c, 0x38, 0x32, 0x41, 0x37, 0x2d, 0x46, 0x66, 0x6a, 0x6c, 0x6d, 0x6d, 0x6c, 0x3d, 0x3d, 0x31, 0x38, 0x38, 0x39, 0x33, 0x39, 0x36, 0x30, 0x30, 0x66, 0x30, 0x40, 0x4d, 0x5f, 0x4d, 0x4d, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x5a, 0x2d, 0x32, 0x32, 0x37, 0x37, 0x32, 0x38, 0x46, 0x46, 0x66, 0x45, 0x44, 0x62, 0x44, 0x44, 0x3e, 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, 0x37, 0x30, 0x10, 0x06, 0x05, 0x12, 0x0a, 0x05, 0x05, 0x05, 0x08, 0x68, 0x73, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x32, 0x32, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x39, 0x39, 0x39, 0x36, 0x36, 0x6b, 0x3e, 0x3e, 0x3e, 0x3e, 0x31, 0x4c, 0x39, 0x2d, 0x10, 0x16, 0x2a, 0x05, 0x05, 0x74, 0x74, 0x05, 0x05, 0x0c, 0x75, 0x5f, 0x1c, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x2c, 0x32, 0x32, 0x32, 0x41, 0x37, 0x41, 0x2c, 0x2c, 0x41, 0x2c, 0x33, 0x36, 0x31, 0x36, 0x31, 0x31, 0x17, 0x46, 0x2c, 0x16, 0x40, 0x05, 0x05, 0x05, 0x05, 0x20, 0x5f, 0x4d, 0x72, 0x76, 0x06, 0x25, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x0b, 0x2d, 0x37, 0x2d, 0x2c, 0x2c, 0x37, 0x37, 0x38, 0x2c, 0x37, 0x2c, 0x10, 0x10, 0x39, 0x30, 0x0b, 0x2c, 0x11, 0x09, 0x05, 0x09, 0x4a, 0x05, 0x05, 0x19, 0x1d, 0x26, 0x76, 0x08, 0x05, 0x05, 0x05, 0x15, 0x25, 0x4d, 0x53, 0x77, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x5a, 0x2c, 0x37, 0x2d, 0x2c, 0x37, 0x37, 0x39, 0x39, 0x33, 0x38, 0x2c, 0x2d, 0x2d, 0x2c, 0x5e, 0x2a, 0x05, 0x15, 0x3b, 0x17, 0x1f, 0x19, 0x05, 0x06, 0x26, 0x60, 0x5f, 0x0c, 0x05, 0x05, 0x05, 0x35, 0x68, 0x78, 0x56, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x37, 0x2c, 0x37, 0x32, 0x46, 0x33, 0x46, 0x39, 0x11, 0x15, 0x05, 0x05, 0x18, 0x31, 0x44, 0x6a, 0x30, 0x6e, 0x2b, 0x4b, 0x11, 0x5f, 0x63, 0x72, 0x54, 0x20, 0x74, 0x58, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2c, 0x38, 0x2d, 0x39, 0x39, 0x2d, 0x37, 0x3c, 0x32, 0x37, 0x0b, 0x18, 0x05, 0x05, 0x05, 0x4e, 0x26, 0x32, 0x45, 0x6a, 0x46, 0x2b, 0x72, 0x4e, 0x05, 0x35, 0x0a, 0x75, 0x5f, 0x70, 0x08, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x2d, 0x30, 0x6b, 0x6b, 0x66, 0x36, 0x30, 0x36, 0x4c, 0x36, 0x30, 0x18, 0x05, 0x05, 0x05, 0x09, 0x4b, 0x32, 0x46, 0x66, 0x38, 0x0b, 0x09, 0x05, 0x05, 0x05, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2c, 0x2c, 0x31, 0x62, 0x62, 0x6b, 0x31, 0x45, 0x44, 0x44, 0x45, 0x31, 0x10, 0x0c, 0x4d, 0x0c, 0x08, 0x0b, 0x3c, 0x32, 0x33, 0x66, 0x17, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x22, 0x2c, 0x2d, 0x31, 0x45, 0x6b, 0x36, 0x31, 0x6b, 0x62, 0x45, 0x6a, 0x66, 0x30, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x37, 0x46, 0x6b, 0x44, 0x62, 0x5e, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x1d, 0x2c, 0x39, 0x36, 0x4c, 0x30, 0x30, 0x30, 0x36, 0x4c, 0x66, 0x4c, 0x36, 0x30, 0x37, 0x41, 0x2c, 0x2d, 0x2c, 0x3c, 0x33, 0x6b, 0x44, 0x44, 0x39, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2d, 0x2d, 0x36, 0x39, 0x2d, 0x32, 0x38, 0x38, 0x46, 0x6a, 0x6d, 0x3d, 0x62, 0x46, 0x3c, 0x37, 0x2d, 0x32, 0x32, 0x32, 0x38, 0x4c, 0x30, 0x16, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x37, 0x38, 0x38, 0x39, 0x37, 0x2c, 0x37, 0x37, 0x30, 0x45, 0x6d, 0x6d, 0x62, 0x62, 0x38, 0x3c, 0x3c, 0x32, 0x37, 0x32, 0x32, 0x32, 0x2c, 0x14, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x6e, 0x37, 0x38, 0x38, 0x38, 0x37, 0x2c, 0x2d, 0x30, 0x31, 0x62, 0x6a, 0x6d, 0x6a, 0x6a, 0x46, 0x32, 0x32, 0x37, 0x37, 0x32, 0x30, 0x17, 0x29, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x0b, 0x38, 0x38, 0x38, 0x2c, 0x2c, 0x0b, 0x2d, 0x39, 0x4c, 0x45, 0x6a, 0x6a, 0x6a, 0x6a, 0x6a, 0x38, 0x37, 0x2c, 0x41, 0x18, 0x1c, 0x0c, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2d, 0x38, 0x38, 0x37, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x4c, 0x6b, 0x44, 0x44, 0x45, 0x6a, 0x45, 0x38, 0x37, 0x1c, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x1d, 0x38, 0x38, 0x38, 0x38, 0x2c, 0x3c, 0x37, 0x37, 0x32, 0x32, 0x46, 0x36, 0x1e, 0x6b, 0x4c, 0x46, 0x32, 0x22, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x37, 0x32, 0x37, 0x38, 0x38, 0x37, 0x32, 0x3c, 0x32, 0x32, 0x37, 0x38, 0x2d, 0x2d, 0x38, 0x2c, 0x2c, 0x4f, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x3c, 0x37, 0x41, 0x38, 0x2d, 0x37, 0x37, 0x3c, 0x32, 0x3c, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x41, 0x3c, 0x3c, 0x38, 0x32, 0x3c, 0x3c, 0x3c, 0x41, 0x32, 0x41, 0x37, 0x2c, 0x2c, 0x41, 0x38, 0x45, 0x18, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x37, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x4c, 0x45, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x2c, 0x37, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x41, 0x37, 0x37, 0x4c, 0x44, 0x6d, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x5a, 0x2c, 0x41, 0x3c, 0x3c, 0x3c, 0x32, 0x2c, 0x32, 0x2c, 0x2c, 0x38, 0x38, 0x36, 0x45, 0x62, 0x44, 0x45, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x37, 0x39, 0x4c, 0x4c, 0x45, 0x62, 0x44, 0x62, 0x30, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x5a, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x46, 0x4c, 0x6b, 0x6b, 0x45, 0x3e, 0x36, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x3c, 0x37, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x38, 0x37, 0x37, 0x37, 0x38, 0x39, 0x36, 0x4c, 0x30, 0x10, 0x16, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x25, 0x1d, 0x37, 0x37, 0x41, 0x32, 0x3c, 0x32, 0x41, 0x37, 0x32, 0x2c, 0x41, 0x37, 0x2c, 0x32, 0x37, 0x2c, 0x2c, 0x5a, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x05, 0x15, 0x5a, 0x37, 0x2c, 0x41, 0x2c, 0x2c, 0x41, 0x37, 0x41, 0x41, 0x3c, 0x2c, 0x41, 0x41, 0x3c, 0x37, 0x2c, 0x39, 0x0b, 0x0b, 0x25, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x2a, 0x22, 0x2d, 0x37, 0x2c, 0x3c, 0x1d, 0x2c, 0x38, 0x2c, 0x41, 0x2c, 0x2c, 0x2d, 0x39, 0x37, 0x3c, 0x37, 0x30, 0x1a, 0x5e, 0x6e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x2a, 0x6e, 0x0b, 0x2d, 0x38, 0x41, 0x41, 0x6e, 0x5a, 0x2c, 0x41, 0x32, 0x38, 0x32, 0x39, 0x3f, 0x6f, 0x16, 0x37, 0x1a, 0x1f, 0x1f, 0x16, 0x1d, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x40, 0x07, 0x2c, 0x37, 0x2c, 0x2d, 0x2c, 0x1d, 0x0e, 0x09, 0x0b, 0x4b, 0x07, 0x41, 0x38, 0x2d, 0x10, 0x2d, 0x10, 0x0b, 0x2b, 0x33, 0x3f, 0x21, 0x29, 0x07, 0x5e, 0x2f, 0x12, 0x08, 0x2a, 0x0c, 0x25, 0x09, 0x09, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x40, 0x28, 0x22, 0x2c, 0x38, 0x32, 0x32, 0x32, 0x1d, 0x0e, 0x19, 0x05, 0x35, 0x2c, 0x4b, 0x70, 0x0b, 0x32, 0x2c, 0x16, 0x16, 0x16, 0x0b, 0x22, 0x26, 0x0b, 0x10, 0x3f, 0x29, 0x1f, 0x47, 0x1f, 0x1f, 0x5e, 0x0b, 0x4b, 0x74, 0x84, 0x74, 0x84, 0x06, 0x35, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x4d, 0x27, 0x0a, 0x22, 0x1d, 0x2c, 0x2c, 0x37, 0x32, 0x41, 0x41, 0x16, 0x27, 0x15, 0x09, 0x4a, 0x09, 0x28, 0x2d, 0x0b, 0x76, 0x2c, 0x37, 0x2d, 0x37, 0x32, 0x37, 0x0b, 0x0b, 0x5e, 0x5a, 0x4b, 0x0b, 0x0b, 0x07, 0x6e, 0x16, 0x5e, 0x10, 0x76, 0x5c, 0x68, 0x79, 0x7a, 0x53, 0x71, 0x54, 0x5d, 0x08, 0x4d, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x28, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x41, 0x41, 0x41, 0x22, 0x11, 0x35, 0x4d, 0x4d, 0x35, 0x1c, 0x06, 0x0a, 0x22, 0x38, 0x38, 0x37, 0x38, 0x38, 0x38, 0x2d, 0x39, 0x39, 0x39, 0x10, 0x39, 0x10, 0x4b, 0x12, 0x08, 0x35, 0x67, 0x2a, 0x08, 0x74, 0x70, 0x81, 0x55, 0x78, 0x79, 0x57, 0x53, 0x71, 0x71, 0x73, 0x84, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x09, 0x27, 0x16, 0x0b, 0x2c, 0x2d, 0x2c, 0x41, 0x41, 0x1d, 0x22, 0x5a, 0x0f, 0x14, 0x0a, 0x28, 0x0a, 0x28, 0x28, 0x28, 0x6e, 0x5a, 0x65, 0x1d, 0x0b, 0x2d, 0x38, 0x46, 0x38, 0x38, 0x38, 0x39, 0x2d, 0x46, 0x39, 0x30, 0x39, 0x4b, 0x68, 0x79, 0x7a, 0x57, 0x67, 0x67, 0x56, 0x53, 0x71, 0x68, 0x7e, 0x85, 0x59, 0x73, 0x79, 0x54, 0x7a, 0x54, 0x06, 0x1c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x4d, 0x16, 0x0b, 0x10, 0x39, 0x2d, 0x0b, 0x28, 0x06, 0x2a, 0x25, 0x35, 0x06, 0x11, 0x0a, 0x28, 0x07, 0x5a, 0x22, 0x26, 0x5a, 0x41, 0x7b, 0x7c, 0x60, 0x76, 0x22, 0x1d, 0x32, 0x38, 0x46, 0x46, 0x46, 0x38, 0x38, 0x38, 0x38, 0x2b, 0x75, 0x7d, 0x7e, 0x55, 0x78, 0x7a, 0x57, 0x57, 0x57, 0x71, 0x20, 0x68, 0x55, 0x85, 0x7a, 0x57, 0x53, 0x71, 0x57, 0x5d, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x0c, 0x16, 0x0b, 0x30, 0x39, 0x18, 0x2a, 0x09, 0x05, 0x4e, 0x19, 0x25, 0x0c, 0x27, 0x11, 0x0a, 0x0a, 0x2f, 0x5a, 0x5a, 0x26, 0x5a, 0x7b, 0x7c, 0x7c, 0x61, 0x7f, 0x7f, 0x7f, 0x76, 0x22, 0x22, 0x0b, 0x2d, 0x0b, 0x2d, 0x2d, 0x33, 0x0b, 0x5f, 0x80, 0x7d, 0x5c, 0x81, 0x55, 0x59, 0x59, 0x73, 0x73, 0x54, 0x5c, 0x5c, 0x7e, 0x55, 0x59, 0x73, 0x7a, 0x71, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x25, 0x08, 0x07, 0x5e, 0x10, 0x22, 0x1c, 0x4a, 0x05, 0x09, 0x05, 0x15, 0x4d, 0x19, 0x19, 0x4d, 0x08, 0x12, 0x74, 0x0f, 0x6e, 0x5a, 0x26, 0x1d, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x61, 0x5b, 0x82, 0x82, 0x80, 0x80, 0x82, 0x7f, 0x7f, 0x7f, 0x7f, 0x5b, 0x7f, 0x82, 0x80, 0x7d, 0x5c, 0x7e, 0x79, 0x54, 0x54, 0x7a, 0x73, 0x0f, 0x2a, 0x25, 0x19, 0x09, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x4d, 0x2a, 0x06, 0x74, 0x28, 0x22, 0x22, 0x2d, 0x2c, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x3b, 0x07, 0x19, 0x09, 0x25, 0x0c, 0x27, 0x12, 0x0f, 0x2f, 0x26, 0x26, 0x1d, 0x65, 0x65, 0x7c, 0x7c, 0x7b, 0x7c, 0x7b, 0x7b, 0x60, 0x5b, 0x7f, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x80, 0x80, 0x83, 0x83, 0x81, 0x7e, 0x59, 0x73, 0x73, 0x84, 0x5d, 0x25, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x19, 0x08, 0x12, 0x0a, 0x0f, 0x6e, 0x5a, 0x26, 0x22, 0x2c, 0x2c, 0x0b, 0x27, 0x05, 0x05, 0x05, 0x15, 0x1e, 0x1e, 0x6f, 0x0c, 0x09, 0x15, 0x0c, 0x20, 0x12, 0x0f, 0x6e, 0x5a, 0x26, 0x26, 0x26, 0x65, 0x65, 0x65, 0x65, 0x7b, 0x7c, 0x7b, 0x65, 0x7b, 0x61, 0x61, 0x60, 0x64, 0x64, 0x64, 0x5b, 0x5b, 0x5f, 0x63, 0x70, 0x63, 0x58, 0x5d, 0x2a, 0x15, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x4a, 0x4d, 0x27, 0x11, 0x0a, 0x28, 0x6e, 0x5a, 0x26, 0x65, 0x41, 0x1d, 0x2c, 0x2c, 0x5e, 0x29, 0x0e, 0x14, 0x17, 0x31, 0x6b, 0x30, 0x14, 0x25, 0x09, 0x15, 0x4d, 0x08, 0x74, 0x0a, 0x0f, 0x2f, 0x5a, 0x26, 0x26, 0x1d, 0x1d, 0x1d, 0x2b, 0x65, 0x1d, 0x41, 0x65, 0x65, 0x7b, 0x65, 0x65, 0x1d, 0x6e, 0x74, 0x5d, 0x1c, 0x25, 0x15, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x19, 0x4d, 0x08, 0x06, 0x0a, 0x2f, 0x6e, 0x2f, 0x6e, 0x26, 0x41, 0x7b, 0x65, 0x41, 0x37, 0x33, 0x30, 0x36, 0x36, 0x4c, 0x6b, 0x66, 0x30, 0x14, 0x35, 0x4a, 0x09, 0x15, 0x15, 0x25, 0x25, 0x0c, 0x1c, 0x08, 0x06, 0x5d, 0x5d, 0x5d, 0x0e, 0x06, 0x12, 0x06, 0x08, 0x1c, 0x2a, 0x0c, 0x19, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x09, 0x19, 0x35, 0x08, 0x12, 0x28, 0x2f, 0x2f, 0x6e, 0x5a, 0x41, 0x7c, 0x3c, 0x3c, 0x2c, 0x41, 0x2d, 0x2d, 0x39, 0x30, 0x4c, 0x4c, 0x66, 0x66, 0x31, 0x24, 0x20, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x4a, 0x09, 0x4a, 0x09, 0x09, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x15, 0x0c, 0x1c, 0x12, 0x28, 0x2f, 0x5a, 0x1d, 0x7c, 0x7b, 0x41, 0x7b, 0x3c, 0x7b, 0x3c, 0x41, 0x41, 0x5a, 0x16, 0x28, 0x14, 0x14, 0x14, 0x3b, 0x12, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x4a, 0x09, 0x15, 0x1c, 0x12, 0x12, 0x0a, 0x0f, 0x2f, 0x07, 0x2f, 0x0a, 0x12, 0x27, 0x0c, 0x4d, 0x15, 0x09, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x15, 0x15, 0x15, 0x19, 0x4e, 0x4e, 0x05, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
diff --git a/sys/modules/syscons/logo/logo_saver.c b/sys/modules/syscons/logo/logo_saver.c
deleted file mode 100644
index 1db8dcc496b6..000000000000
--- a/sys/modules/syscons/logo/logo_saver.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * 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
- * in this position and unchanged.
- * 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
- *
- * 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.
- *
- * $Id: logo_saver.c,v 1.3 1999/01/11 03:18:49 yokota Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <saver.h>
-
-static u_char *vid;
-static int banksize, scrmode, scrw, scrh;
-static int blanked;
-
-#include "logo.c"
-
-static void
-logo_blit(video_adapter_t *adp, int x, int y)
-{
- int d, l, o, p;
-
- for (o = 0, p = y * scrw + x; p > banksize; p -= banksize)
- o += banksize;
- set_origin(adp, o);
-
- for (d = 0; d < sizeof logo_img; d += logo_w) {
- if (p + logo_w < banksize) {
- bcopy(logo_img + d, vid + p, logo_w);
- p += scrw;
- } else if (p < banksize) {
- l = banksize - p;
- bcopy(logo_img + d, vid + p, l);
- set_origin(adp, (o += banksize));
- bcopy(logo_img + d + l, vid, logo_w - l);
- p += scrw - banksize;
- } else {
- p -= banksize;
- set_origin(adp, (o += banksize));
- bcopy(logo_img + d, vid + p, logo_w);
- p += scrw;
- }
- }
-}
-
-static void
-logo_update(video_adapter_t *adp)
-{
- static int xpos = 0, ypos = 0;
- static int xinc = 1, yinc = 1;
-
- /* Turn when you hit the edge */
- if ((xpos + logo_w + xinc > scrw) || (xpos + xinc < 0))
- xinc = -xinc;
- if ((ypos + logo_h + yinc > scrh) || (ypos + yinc < 0))
- yinc = -yinc;
- xpos += xinc;
- ypos += yinc;
-
- /* XXX Relies on margin around logo to erase trail */
- logo_blit(adp, xpos, ypos);
-}
-
-static int
-logo_saver(video_adapter_t *adp, int blank)
-{
- int i, pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, scrmode, logo_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- for (i = 0; i < scrw*scrh; i += banksize) {
- set_origin(adp, i);
- bzero(vid, banksize);
- }
- }
- logo_update(adp);
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-logo_init(video_adapter_t *adp)
-{
- video_info_t info;
-
- if (!get_mode_info(adp, M_VESA_CG800x600, &info)) {
- scrmode = M_VESA_CG800x600;
- } else if (!get_mode_info(adp, M_VGA_CG320, &info)) {
- scrmode = M_VGA_CG320;
- } else {
- log(LOG_NOTICE, "logo_saver: no suitable graphics mode\n");
- return ENODEV;
- }
-
- banksize = info.vi_window_size;
- scrw = info.vi_width;
- scrh = info.vi_height;
- blanked = 0;
-
- return 0;
-}
-
-static int
-logo_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t logo_module = {
- "logo_saver", logo_init, logo_term, logo_saver, NULL,
-};
-
-SAVER_MODULE(logo_saver, logo_module);
diff --git a/sys/modules/syscons/rain/Makefile b/sys/modules/syscons/rain/Makefile
deleted file mode 100644
index 8b964f34a0fa..000000000000
--- a/sys/modules/syscons/rain/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/27 22:03:09 des Exp $
-
-KMOD= rain_saver
-SRCS= rain_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/..
-CWARNFLAGS= -Wall -pedantic
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/rain/rain_saver.c b/sys/modules/syscons/rain/rain_saver.c
deleted file mode 100644
index 0b4b2ee3e9e2..000000000000
--- a/sys/modules/syscons/rain/rain_saver.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * 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
- * in this position and unchanged.
- * 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
- *
- * 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.
- *
- * $Id: rain_saver.c,v 1.1 1998/12/31 13:41:40 des Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <machine/random.h>
-
-#include <saver.h>
-
-static u_char *vid;
-
-#define SCRW 320
-#define SCRH 200
-#define MAX 63
-
-static u_char rain_pal[768];
-static int blanked;
-
-static void
-rain_update(video_adapter_t *adp)
-{
- int i, t;
-
- t = rain_pal[(MAX*3+2)];
- for (i = (MAX*3+2); i > 5; i -= 3)
- rain_pal[i] = rain_pal[i-3];
- rain_pal[5] = t;
- load_palette(adp, rain_pal);
-}
-
-static int
-rain_saver(video_adapter_t *adp, int blank)
-{
- int i, j, k, pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, M_VGA_CG320, rain_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- bzero(vid, SCRW*SCRH);
- for (i = 0; i < SCRW; i += 2)
- vid[i] = 1 + (random() % MAX);
- for (j = 1, k = SCRW; j < SCRH; j++)
- for (i = 0; i < SCRW; i += 2, k += 2)
- vid[k] = (vid[k-SCRW] < MAX) ? 1 + vid[k-SCRW] : 1;
- }
-
- /* update display */
- rain_update(adp);
-
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-rain_init(video_adapter_t *adp)
-{
- video_info_t info;
- int i;
-
- /* check that the console is capable of running in 320x200x256 */
- if (get_mode_info(adp, M_VGA_CG320, &info)) {
- log(LOG_NOTICE, "rain_saver: the console does not support M_VGA_CG320\n");
- return ENODEV;
- }
-
- /* intialize the palette */
- for (i = 3; i < (MAX+1)*3; i += 3)
- rain_pal[i+2] = rain_pal[i-1] + 4;
-
- blanked = 0;
-
- return 0;
-}
-
-static int
-rain_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t rain_module = {
- "rain_saver", rain_init, rain_term, rain_saver, NULL,
-};
-
-SAVER_MODULE(rain_saver, rain_module);
diff --git a/sys/modules/syscons/saver.h b/sys/modules/syscons/saver.h
index 661b15acaba9..9eb19956327f 100644
--- a/sys/modules/syscons/saver.h
+++ b/sys/modules/syscons/saver.h
@@ -25,26 +25,20 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: saver.h,v 1.15 1999/01/11 03:18:42 yokota Exp $
+ * $Id: saver.h,v 1.11 1998/09/15 18:16:38 sos Exp $
*/
#include <machine/apm_bios.h>
#include <machine/console.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
-#include <dev/syscons/syscons.h>
-
-#define set_video_mode(adp, mode, pal, border) \
- { \
- (*vidsw[(adp)->va_index]->set_mode)((adp), (mode)); \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal)); \
- (*vidsw[(adp)->va_index]->set_border)((adp), (border)); \
- }
-#define get_mode_info(adp, mode, buf) \
- (*vidsw[(adp)->va_index]->get_info)((adp), (mode), (buf))
-#define set_origin(adp, o) \
- (*vidsw[(adp)->va_index]->set_win_org)(adp, o)
-
extern scr_stat *cur_console;
+extern u_short *Crtat;
+extern u_int crtc_addr;
+extern char crtc_type;
extern char scr_map[];
+extern int scrn_blanked;
+extern int fonts_loaded;
+extern char font_8[], font_14[], font_16[];
+extern char palette[];
diff --git a/sys/modules/syscons/snake/snake_saver.c b/sys/modules/syscons/snake/snake_saver.c
index 642e6b15b309..efb76d505df7 100644
--- a/sys/modules/syscons/snake/snake_saver.c
+++ b/sys/modules/syscons/snake/snake_saver.c
@@ -25,12 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: snake_saver.c,v 1.21 1999/01/11 03:18:52 yokota Exp $
+ * $Id: snake_saver.c,v 1.18 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
@@ -40,14 +42,15 @@
#include <saver.h>
+MOD_MISC(snake_saver);
+
static char *message;
static u_char **messagep;
static int messagelen;
static u_short *window;
-static int blanked;
-static int
-snake_saver(video_adapter_t *adp, int blank)
+static void
+snake_saver(int blank)
{
static int dirx, diry;
int f;
@@ -58,11 +61,12 @@ snake_saver(video_adapter_t *adp, int blank)
#define savs messagep
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (blanked <= 0) {
- window = (u_short *)adp->va_window;
- fillw(((FG_LIGHTGREY|BG_BLACK)<<8) | scr_map[0x20],
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8 | scr_map[0x20],
window, scp->xsize * scp->ysize);
set_border(scp, 0);
dirx = (scp->xpos ? 1 : -1);
@@ -72,11 +76,16 @@ snake_saver(video_adapter_t *adp, int blank)
savs[f] = (u_char *)window + 2 *
(scp->xpos+scp->ypos*scp->xsize);
*(savs[0]) = scr_map[*save];
- blanked = 1;
+ f = scp->ysize * scp->xsize + 5;
+ outb(crtc_addr, 14);
+ outb(crtc_addr+1, f >> 8);
+ outb(crtc_addr, 15);
+ outb(crtc_addr+1, f & 0xff);
+ scrn_blanked = 1;
}
- if (blanked++ < 4)
- return 0;
- blanked = 1;
+ if (scrn_blanked++ < 4)
+ return;
+ scrn_blanked = 1;
*(savs[messagelen-1]) = scr_map[0x20];
for (f=messagelen-1; f > 0; f--)
savs[f] = savs[f-1];
@@ -94,31 +103,48 @@ snake_saver(video_adapter_t *adp, int blank)
*(savs[f]) = scr_map[save[f]];
}
else {
- blanked = 0;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-snake_init(video_adapter_t *adp)
+snake_saver_load(struct lkm_table *lkmtp, int cmd)
{
+ int err;
+
messagelen = strlen(ostype) + 1 + strlen(osrelease);
message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
sprintf(message, "%s %s", ostype, osrelease);
messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK);
- return 0;
+
+ err = add_scrn_saver(snake_saver);
+ if (err != 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
}
static int
-snake_term(video_adapter_t *adp)
+snake_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- free(message, M_DEVBUF);
- free(messagep, M_DEVBUF);
- return 0;
-}
+ int err;
-static scrn_saver_t snake_module = {
- "snake_saver", snake_init, snake_term, snake_saver, NULL,
-};
+ err = remove_scrn_saver(snake_saver);
+ if (err == 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
+}
-SAVER_MODULE(snake_saver, snake_module);
+int
+snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
+ snake_saver_load, snake_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/star/star_saver.c b/sys/modules/syscons/star/star_saver.c
index 463a0ae0f3f8..2e56a3c96fbd 100644
--- a/sys/modules/syscons/star/star_saver.c
+++ b/sys/modules/syscons/star/star_saver.c
@@ -25,30 +25,32 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: star_saver.c,v 1.18 1999/01/11 03:18:53 yokota Exp $
+ * $Id: star_saver.c,v 1.15 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <machine/md_var.h>
#include <machine/pc/display.h>
#include <saver.h>
+MOD_MISC(star_saver);
+
#define NUM_STARS 50
static u_short *window;
-static int blanked;
/*
* Alternate saver that got its inspiration from a well known utility
* package for an inferior^H^H^H^H^H^Hfamous OS.
*/
-static int
-star_saver(video_adapter_t *adp, int blank)
+static void
+star_saver(int blank)
{
scr_stat *scp = cur_console;
int cell, i;
@@ -58,15 +60,15 @@ star_saver(video_adapter_t *adp, int blank)
static u_short stars[NUM_STARS][2];
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (!blanked) {
- window = (u_short *)adp->va_window;
- /* clear the screen and set the border color */
- fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
- window, scp->xsize * scp->ysize);
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ scrn_blanked = 1;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], window,
+ scp->xsize * scp->ysize);
set_border(scp, 0);
- blanked = TRUE;
for(i=0; i<NUM_STARS; i++) {
stars[i][0] =
random() % (scp->xsize*scp->ysize);
@@ -83,26 +85,29 @@ star_saver(video_adapter_t *adp, int blank)
}
}
else {
- blanked = FALSE;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-star_init(video_adapter_t *adp)
+star_saver_load(struct lkm_table *lkmtp, int cmd)
{
- blanked = FALSE;
- return 0;
+ return add_scrn_saver(star_saver);
}
static int
-star_term(video_adapter_t *adp)
+star_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(star_saver);
}
-static scrn_saver_t star_module = {
- "star_saver", star_init, star_term, star_saver, NULL,
-};
-
-SAVER_MODULE(star_saver, star_module);
+int
+star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(star_saver, lkmtp, cmd, ver,
+ star_saver_load, star_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/warp/Makefile b/sys/modules/syscons/warp/Makefile
deleted file mode 100644
index 3902ca0eac53..000000000000
--- a/sys/modules/syscons/warp/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/27 22:03:09 des Exp $
-
-KMOD= warp_saver
-SRCS= warp_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/..
-CWARNFLAGS= -Wall -pedantic
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/warp/warp_saver.c b/sys/modules/syscons/warp/warp_saver.c
deleted file mode 100644
index ef0afa2bebfa..000000000000
--- a/sys/modules/syscons/warp/warp_saver.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * 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
- * in this position and unchanged.
- * 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
- *
- * 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.
- *
- * $Id: warp_saver.c,v 1.3 1998/12/31 13:38:59 des Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <machine/md_var.h>
-#include <machine/random.h>
-
-#include <saver.h>
-
-static u_char *vid;
-static int blanked;
-
-#define SCRW 320
-#define SCRH 200
-#define SPP 15
-#define STARS (SPP*(1+2+4+8))
-
-static int star[STARS];
-static u_char warp_pal[768] = {
- 0x00, 0x00, 0x00,
- 0x66, 0x66, 0x66,
- 0x99, 0x99, 0x99,
- 0xcc, 0xcc, 0xcc,
- 0xff, 0xff, 0xff
- /* the rest is zero-filled by the compiler */
-};
-
-static void
-warp_update(void)
-{
- int i, j, k, n;
-
- for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2)
- for (j = 0; j < n; j++, k++) {
- vid[star[k]] = 0;
- star[k] += i;
- if (star[k] > SCRW*SCRH)
- star[k] -= SCRW*SCRH;
- vid[star[k]] = i;
- }
-}
-
-static int
-warp_saver(video_adapter_t *adp, int blank)
-{
- int pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, M_VGA_CG320, warp_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- bzero(vid, SCRW*SCRH);
- }
-
- /* update display */
- warp_update();
-
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-warp_init(video_adapter_t *adp)
-{
- video_info_t info;
- int i;
-
- /* check that the console is capable of running in 320x200x256 */
- if (get_mode_info(adp, M_VGA_CG320, &info)) {
- log(LOG_NOTICE, "warp_saver: the console does not support M_VGA_CG320\n");
- return ENODEV;
- }
-
- /* randomize the star field */
- for (i = 0; i < STARS; i++) {
- star[i] = random() % (SCRW*SCRH);
- }
-
- blanked = 0;
-
- return 0;
-}
-
-static int
-warp_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t warp_module = {
- "warp_saver", warp_init, warp_term, warp_saver, NULL,
-};
-
-SAVER_MODULE(warp_saver, warp_module);
diff --git a/sys/modules/vesa/Makefile b/sys/modules/vesa/Makefile
index 6de1c879120c..62dd4bc141e6 100644
--- a/sys/modules/vesa/Makefile
+++ b/sys/modules/vesa/Makefile
@@ -1,32 +1,19 @@
-# $Id: Makefile,v 1.4 1998/12/30 11:21:07 yokota Exp $
+# $Id: Makefile,v 1.2 1998/09/15 20:14:11 sos Exp $
-.PATH: ${.CURDIR}/../../dev/syscons ${.CURDIR}/../../i386/isa
+.PATH: ${.CURDIR}/../../i386/isa
KMOD = vesa
-SRCS = vesa.c scvesactl.c sc.h vga.h opt_syscons.h opt_vga.h \
- opt_vesa.h opt_vm86.h opt_fb.h
+SRCS = vesa.c scvesactl.c sc.h opt_vesa.h opt_vm86.h
NOMAN =
-CLEANFILES += sc.h vga.h opt_syscons.h opt_vga.h opt_vesa.h opt_vm86.h \
- opt_fb.h
+CFLAGS += -DVESA_MODULE
+CLEANFILES += sc.h opt_vesa.h opt_vm86.h
sc.h:
echo "#define NSC 1" > sc.h
-vga.h:
- echo "#define NVGA 1" > vga.h
-
-opt_syscons.h:
- touch opt_syscons.h
-
-opt_vga.h:
- touch opt_vga.h
-
opt_vesa.h:
echo "#define VESA 1" > opt_vesa.h
opt_vm86.h:
echo "#define VM86 1" > opt_vm86.h
-opt_fb.h:
- touch opt_fb.h
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/vinum/COPYRIGHT b/sys/modules/vinum/COPYRIGHT
new file mode 100644
index 000000000000..4ee95f20ce5c
--- /dev/null
+++ b/sys/modules/vinum/COPYRIGHT
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
+ */
diff --git a/sys/modules/vinum/Makefile b/sys/modules/vinum/Makefile
index 0a89def26a8e..6489222ef0c3 100644
--- a/sys/modules/vinum/Makefile
+++ b/sys/modules/vinum/Makefile
@@ -1,23 +1,20 @@
-# $Id: Makefile.Vinum,v 1.1 1999/01/18 04:49:18 grog Exp grog $
+# $Id: Makefile,v 1.2 1998/09/28 04:21:20 grog Exp $
-SOURCE= ${.CURDIR}/../../dev/vinum
-
-.PATH: ${SOURCE}
+.PATH: ${.CURDIR}/../../dev/ccd
KMOD= vinum
-SRCS= vnode_if.h opt_vinum.h vinumstate.h vinumvar.h \
- vinumhdr.h request.h vinumext.h vinumio.h vinumkw.h \
- vinum.c vinumparser.c vinumconfig.c vinumio.c vinumutil.c \
- vinumstate.c vinummemory.c vinumrequest.c vinumlock.c \
- vinumrevive.c vinumioctl.c vinuminterrupt.c vinumdaemon.c
-
+SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
+ state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
+ vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
NOMAN=
+CFLAGS = -I${.CURDIR} -O -g -I/usr/include/machine -DDEBUG -Wall -Wno-unused -Wno-parentheses
-CLEANFILES+= vnode_if.h vnode_if.c opt_vinum.h
+CLEANFILES+= vinum.h vnode_if.h vnode_if.c
all:
-opt_vinum.h:
- @touch opt_vinum.h
+# We don't need this, but the Makefile wants it
+vinum.h:
+ touch $@
state.h: maketabs vinumstate.h
./maketabs >state.h
@@ -26,5 +23,3 @@ maketabs: maketabs.c
${CC} -g -o maketabs maketabs.c
.include <bsd.kmod.mk>
-
-CFLAGS += -I${SOURCE} -g -DVINUMDEBUG -Wall -Wno-unused -Wno-parentheses
diff --git a/sys/modules/vinum/config.c b/sys/modules/vinum/config.c
new file mode 100644
index 000000000000..fd31c5e07c46
--- /dev/null
+++ b/sys/modules/vinum/config.c
@@ -0,0 +1,1712 @@
+/* To do:
+
+ * Don't store drive configuration on the config DB: read each drive's header
+ * to decide where it is.
+ *
+ * Accept any old crap in the config_<foo> functions, and complain when
+ * we try to bring it up.
+ *
+ * When trying to bring volumes up, check that the complete address range
+ * is covered.
+ */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: config.c,v 1.17 1998/08/14 04:49:26 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+
+extern jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+void longjmp(jmp_buf, int);
+#endif
+
+#define MAXTOKEN 64 /* maximum number of tokens in a line */
+
+/* We can afford the luxury of global variables here,
+ * since start_config ensures that these functions
+ * are single-threaded. */
+
+/* These are indices in vinum_conf of the last-mentioned of each kind of object */
+static int current_drive = -1; /* note the last drive we mention, for
+ * some defaults */
+static int current_plex = -1; /* and the same for the last plex */
+static int current_volume = -1; /* and the last volme */
+static struct _ioctl_reply *ioctl_reply; /* struct to return via ioctl */
+
+
+/* These values are used by most of these routines, so set them as globals */
+static char *token[MAXTOKEN]; /* pointers to individual tokens */
+static int tokens; /* number of tokens */
+
+#define TOCONS 0x01
+#define TOTTY 0x02
+#define TOLOG 0x04
+
+struct putchar_arg {
+ int flags;
+ struct tty *tty;
+};
+
+#define MSG_MAX 1024 /* maximum length of a formatted message */
+/* Format an error message and return to the user in the reply.
+ * CARE: This routine is designed to be called only from the
+ * configuration routines, so it assumes it's the owner of
+ * the configuration lock, and unlocks it on exit */
+void
+throw_rude_remark(int error, char *msg,...)
+{
+ BROKEN_GDB;
+ int retval;
+ va_list ap;
+ char *text;
+ static int finishing; /* don't recurse */
+ int was_finishing;
+
+ va_start(ap, msg);
+ if ((ioctl_reply != NULL) /* we're called from the user */
+ &&(!(vinum_conf.flags & VF_KERNELOP))) { /* and we're not doing kernel things: return msg */
+ /* XXX We can't just format to ioctl_reply, since it
+ * may contain our input parameters */
+ text = Malloc(MSG_MAX);
+ if (text == NULL) {
+ printf("vinum: can't allocate error message buffer");
+ printf("vinum: ");
+ vprintf(msg, ap); /* print to the console */
+ printf("\n");
+ } else {
+ retval = kvprintf(msg, NULL, (void *) text, 10, ap);
+ text[retval] = '\0'; /* delimit */
+ strcpy(ioctl_reply->msg, text);
+ ioctl_reply->error = error; /* first byte is the error number */
+ Free(text);
+ }
+ } else {
+ printf("vinum: ");
+ vprintf(msg, ap); /* print to the console */
+ printf("\n");
+ }
+ va_end(ap);
+
+ if (vinum_conf.flags & VF_READING_CONFIG) /* go through to the bitter end, */
+ return;
+ /* We have a problem here: we want to unlock the
+ * configuration, which implies tidying up, but
+ * if we find an error while tidying up, we could
+ * recurse for ever. Use this kludge to only try
+ * once */
+ was_finishing = finishing;
+ finishing = 1;
+ finish_config(was_finishing); /* unlock anything we may be holding */
+ finishing = was_finishing;
+ longjmp(command_fail, error);
+}
+
+/* Function declarations */
+int atoi(char *); /* no atoi in the kernel */
+
+/* Minimal version of atoi */
+int
+atoi(char *s)
+{ /* no atoi in the kernel */
+ BROKEN_GDB;
+ int r = 0;
+ int sign = 1;
+
+ while (((*s >= '0') && (*s <= '9')) || (*s == '-')) {
+ if (*s == '-')
+ sign = -sign;
+ else
+ r = r * 10 + (*s - '0');
+ }
+ return r;
+}
+
+/* Find index of volume in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+volume_index(struct volume *vol)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.volumes_used; i++)
+ if (&VOL[i] == vol)
+ return i;
+ return -1;
+}
+
+/* Find index of plex in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+plex_index(struct plex *plex)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.plexes_used; i++)
+ if (&PLEX[i] == plex)
+ return i;
+ return -1;
+}
+
+/* Find index of subdisk in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+sd_index(struct sd *sd)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.subdisks_used; i++)
+ if (&SD[i] == sd)
+ return i;
+ return -1;
+}
+
+/* Find index of drive in vinum_conf. Return the index
+ * if found, or -1 if not */
+int
+drive_index(struct drive *drive)
+{
+ BROKEN_GDB;
+ int i;
+
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ if (&DRIVE[i] == drive)
+ return i;
+ return -1;
+}
+
+/* Check a volume to see if the plex is already assigned to it.
+ * Return index in volume->plex, or -1 if not assigned */
+int
+my_plex(int volno, int plexno)
+{
+ BROKEN_GDB;
+ int i;
+ struct volume *vol;
+
+ vol = &VOL[volno]; /* point to volno */
+ for (i = 0; i < vol->plexes; i++)
+ if (vol->plex[i] == plexno)
+ return i;
+ return -1; /* not found */
+}
+
+/* Check a plex to see if the subdisk is already assigned to it.
+ * Return index in plex->sd, or -1 if not assigned */
+int
+my_sd(int plexno, int sdno)
+{
+ BROKEN_GDB;
+ int i;
+ struct plex *plex;
+
+ plex = &PLEX[plexno];
+ for (i = 0; i < plex->subdisks; i++)
+ if (plex->sdnos[i] == sdno)
+ return i;
+ return -1; /* not found */
+}
+
+/* Check that this operation is being done in the kernel.
+ * longjmp out if not. op the name of the operation. */
+void
+checkkernel(char *op)
+{
+ BROKEN_GDB;
+ if (vinum_conf.flags & VF_KERNELOP == 0)
+ throw_rude_remark(EPERM, "Can't perform '%s' from user space", op);
+}
+
+/* Add plex to the volume if possible */
+int
+give_plex_to_volume(int volno, int plexno)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+
+ /* XXX It's not an error for the plex to already
+ * belong to the volume, but we need to check a
+ * number of things to make sure it's done right.
+ * Some day. */
+ if (my_plex(volno, plexno) >= 0)
+ return plexno; /* that's it */
+
+ vol = &VOL[volno]; /* point to volume */
+ if (vol->plexes == MAXPLEX) /* all plexes allocated */
+ throw_rude_remark(ENOSPC,
+ "Too many plexes for volume %s",
+ vol->name);
+ vol->plex[vol->plexes] = plexno; /* this one */
+ vol->plexes++; /* add another plex */
+ PLEX[plexno].volno = volno; /* note the number of our volume */
+
+ return vol->plexes - 1; /* and return its index */
+}
+
+/* Add subdisk to a plex if possible */
+int
+give_sd_to_plex(int plexno, int sdno)
+{
+ BROKEN_GDB;
+ int i;
+ struct plex *plex;
+ struct sd *sd;
+
+ /* XXX It's not an error for the sd to already
+ * belong to the plex, but we need to check a
+ * number of things to make sure it's done right.
+ * Some day. */
+ i = my_sd(plexno, sdno);
+ if (i >= 0) /* does it already belong to us? */
+ return i; /* that's it */
+
+ plex = &PLEX[plexno]; /* point to the plex */
+ sd = &SD[sdno]; /* and the subdisk */
+
+ /* Do we have an offset? Otherwise put it after the last one */
+ if (sd->plexoffset < 0) { /* no offset specified */
+ if (plex->subdisks > 0) {
+ struct sd *lastsd = &SD[plex->sdnos[plex->subdisks - 1]]; /* last subdisk */
+ sd->plexoffset = lastsd->sectors + lastsd->plexoffset; /* take it */
+ } else /* first subdisk */
+ sd->plexoffset = 0; /* start at the beginning */
+ }
+ plex->subdisks++; /* another entry */
+ if (plex->subdisks >= plex->subdisks_allocated) /* need more space */
+ EXPAND(plex->sdnos, int, plex->subdisks_allocated, INITIAL_SUBDISKS_IN_PLEX);
+
+ /* XXX I'm not sure this makes any sense
+ * for anything except concatenated plexes,
+ * and it comes up with the wrong answer for
+ * RAID-5 plexes, but it's currently needed
+ * for the calculations. We'll adjust for
+ * RAID-5 in config_plex */
+ if ((sd->sectors + sd->plexoffset) > plex->length) { /* gone beyond the end of the plex */
+ plex->length = sd->sectors + sd->plexoffset; /* adjust the length */
+
+ if ((plex->volno >= 0) /* we have a volume */
+ &&(plex->length > VOL[plex->volno].size)) /* and we're now the longest plex */
+ VOL[plex->volno].size = plex->length; /* increase the size of the volume */
+ }
+ /* We need to check that the subdisks don't overlap,
+ * but we can't do that until a point where we *must*
+ * know the size of all the subdisks. That's not
+ * here. But we need to sort them by offset */
+ for (i = 0; i < plex->subdisks - 1; i++) {
+ if (sd->plexoffset < SD[plex->sdnos[i]].plexoffset) { /* it fits before this one */
+ /* First move any remaining subdisks by one */
+ int j;
+
+ for (j = plex->subdisks - 1; j > i; j--) /* move up one at a time */
+ plex->sdnos[j] = plex->sdnos[j - 1];
+ plex->sdnos[i] = sdno;
+ return i;
+ }
+ }
+
+ /* The plex doesn't have any subdisk with a larger
+ * offset. Insert it */
+ plex->sdnos[i] = sdno;
+ return i;
+}
+
+/* Add a subdisk to drive if possible. The pointer to the drive
+ * must already be stored in the sd structure, but the drive
+ * doesn't know about the subdisk yet. */
+static void
+give_sd_to_drive(int sdno)
+{
+ BROKEN_GDB;
+ struct sd *sd; /* pointer to subdisk */
+ struct drive *drive; /* and drive */
+ int fe; /* index in free list */
+
+ sd = &SD[sdno]; /* point to sd */
+ drive = &DRIVE[sd->driveno]; /* and drive */
+
+ if (drive->state != drive_up) /* not up */
+ throw_rude_remark(EIO, "Drive %s is not accessible", drive->label.name);
+ else if (sd->sectors > drive->sectors_available) { /* too big, */
+ sd->driveoffset = -1; /* don't be confusing */
+ throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
+ }
+ drive->subdisks_used++; /* one more subdisk */
+
+ /* no offset specified, find one */
+ if (sd->driveoffset < 0) {
+ for (fe = 0; fe < drive->freelist_entries; fe++) {
+ if (drive->freelist[fe].sectors >= sd->sectors) { /* it'll fit here */
+ sd->driveoffset = drive->freelist[fe].offset;
+ if (sd->sectors == drive->freelist[fe].sectors) { /* used up the entire entry */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one, */
+ bcopy(&drive->freelist[fe + 1],
+ &drive->freelist[fe],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry */
+ } else {
+ drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
+ drive->freelist[fe].offset += sd->sectors; /* this much further on */
+ }
+ drive->sectors_available -= sd->sectors; /* and note how much less space we have */
+ break;
+ }
+ }
+ if (fe == drive->freelist_entries)
+ /* Didn't find anything. Although the drive has
+ * enough space, it's too fragmented */
+ {
+ sd->driveoffset = -1; /* don't be confusing */
+ throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
+ }
+ } else { /* specific offset */
+ /* For a specific offset to work, the space must be
+ * entirely in a single freelist entry. Look for it. */
+ u_int64_t sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
+ for (fe = 0; fe < drive->freelist_entries; fe++) {
+ u_int64_t dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of entry */
+ if (dend >= sdend) { /* fits before here */
+ if (drive->freelist[fe].offset > sd->driveoffset) /* starts after the beginning of sd area */
+ throw_rude_remark(ENOSPC,
+ "No space for subdisk %s on drive %s at offset %qd\n",
+ sd->name,
+ drive->label.name);
+
+ /* We've found the space, and we can allocate it.
+ * We don't need to say that to the subdisk, which
+ * already knows about it. We need to tell it to
+ * the free list, though. We have four possibilities:
+ *
+ * 1. The subdisk exactly eats up the entry. That's the
+ * same as above.
+ * 2. The subdisk starts at the beginning and leaves space
+ * at the end.
+ * 3. The subdisk starts after the beginning and leaves
+ * space at the end as well: we end up with another
+ * fragment.
+ * 4. The subdisk leaves space at the beginning and finishes
+ * at the end.
+ */
+ drive->sectors_available -= sd->sectors; /* note how much less space we have */
+ if (sd->driveoffset == drive->freelist[fe].offset) { /* 1 or 2 */
+ if (sd->sectors == drive->freelist[fe].sectors) { /* 1: used up the entire entry */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one, */
+ bcopy(&drive->freelist[fe + 1],
+ &drive->freelist[fe],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry */
+ } else { /* 2: space at the end */
+ drive->freelist[fe].sectors -= sd->sectors; /* this much less space */
+ drive->freelist[fe].offset += sd->sectors; /* this much further on */
+ }
+ } else { /* 3 or 4 */
+ drive->freelist[fe].sectors = sd->driveoffset - drive->freelist[fe].offset;
+ if (dend > sdend) { /* 3: space at the end as well */
+ if (fe < (drive->freelist_entries - 1)) /* not the last one */
+ bcopy(&drive->freelist[fe], /* move the rest down */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries++; /* one less entry */
+ drive->freelist[fe + 1].offset = sdend; /* second entry starts after sd */
+ drive->freelist[fe + 1].sectors = dend - sdend; /* and is this long */
+ }
+ }
+ break;
+ }
+ }
+ }
+ drive->opencount++; /* one more subdisk attached */
+}
+
+/* Get an empty drive entry from the drive table */
+int
+get_empty_drive(void)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ /* first see if we have one which has been deallocated */
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ if (DRIVE[driveno].state == drive_unallocated) /* bingo */
+ break;
+ }
+
+ if (driveno >= vinum_conf.drives_used)
+ /* Couldn't find a deallocated drive. Allocate a new one */
+ {
+ vinum_conf.drives_used++;
+ if (vinum_conf.drives_used > vinum_conf.drives_allocated) /* we've used all our allocation */
+ EXPAND(DRIVE, struct drive, vinum_conf.drives_allocated, INITIAL_DRIVES);
+ }
+ /* got a drive entry. Make it pretty */
+ drive = &DRIVE[driveno];
+ bzero(drive, sizeof(struct drive));
+ drive->driveno = driveno; /* put number in structure */
+ return driveno; /* return the index */
+}
+
+/* Find the named drive in vinum_conf.drive, return a pointer
+ * return the index in vinum_conf.drive.
+ * Don't mark the drive as allocated (XXX MP)
+ * If create != 0, create an entry if it doesn't exist
+ */
+/* XXX check if we have it open from attach */
+int
+find_drive(const char *name, int create)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ if (name != NULL) {
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &DRIVE[driveno]; /* point to drive */
+ if ((drive->label.name[0] != '\0') /* it has a name */
+ &&(strcmp(drive->label.name, name) == 0)) /* and it's this one: found */
+ return driveno;
+ }
+ }
+ /* the drive isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ driveno = get_empty_drive();
+ drive = &DRIVE[driveno];
+ if (name != NULL)
+ bcopy(name, /* put in its name */
+ drive->label.name,
+ min(sizeof(drive->label.name),
+ strlen(name)));
+ drive->state = drive_uninit; /* in use, nothing worthwhile there */
+ return driveno; /* return the index */
+}
+
+/* Find a drive given its device name.
+ * devname must be valid.
+ * Otherwise the same as find_drive above */
+int
+find_drive_by_dev(const char *devname, int create)
+{
+ BROKEN_GDB;
+ int driveno;
+ struct drive *drive;
+
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &DRIVE[driveno]; /* point to drive */
+ if ((drive->label.name[0] != '\0') /* it has a name */
+ &&(strcmp(drive->label.name, devname) == 0)) /* and it's this one: found */
+ return driveno;
+ }
+
+ /* the drive isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ driveno = get_empty_drive();
+ drive = &DRIVE[driveno];
+ bcopy(devname, /* put in its name */
+ drive->devicename,
+ min(sizeof(drive->devicename),
+ strlen(devname)));
+ drive->state = drive_uninit; /* in use, nothing worthwhile there */
+ return driveno; /* return the index */
+}
+
+/* Find an empty subdisk in the subdisk table */
+int
+get_empty_sd(void)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+
+ /* first see if we have one which has been deallocated */
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
+ if (SD[sdno].state == sd_unallocated) /* bingo */
+ break;
+ }
+
+ if (sdno >= vinum_conf.subdisks_used) { /* No unused sd found. Allocate a new one */
+ vinum_conf.subdisks_used++;
+ if (vinum_conf.subdisks_used > vinum_conf.subdisks_allocated)
+ EXPAND(SD, struct sd, vinum_conf.subdisks_allocated, INITIAL_SUBDISKS);
+ }
+ /* initialize some things */
+ sd = &SD[sdno]; /* point to it */
+ bzero(sd, sizeof(struct sd)); /* initialize */
+ sd->plexno = -1; /* no plex */
+ sd->driveno = -1; /* and no drive */
+ sd->plexoffset = -1; /* and no offsets */
+ sd->driveoffset = -1;
+ return sdno; /* return the index */
+}
+
+/* return a drive to the free pool */
+void
+free_drive(struct drive *drive)
+{
+ BROKEN_GDB;
+ if (drive->vp != NULL) /* device open */
+ vn_close(drive->vp, FREAD | FWRITE, FSCRED, drive->p);
+ bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
+}
+
+/* Find the named subdisk in vinum_conf.sd.
+
+ * If create != 0, create an entry if it doesn't exist
+ *
+ * Return index in vinum_conf.sd
+ */
+int
+find_subdisk(const char *name, int create)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_allocated; sdno++) {
+ if (strcmp(SD[sdno].name, name) == 0) /* found it */
+ return sdno;
+ }
+
+ /* the subdisk isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ sdno = get_empty_sd();
+ sd = &SD[sdno];
+ bcopy(name, sd->name, min(sizeof(sd->name), strlen(name))); /* put in its name */
+ return sdno; /* return the pointer */
+}
+
+/* Free an allocated sd entry
+ * This performs memory management only. remove()
+ * is responsible for checking relationships.
+ */
+void
+free_sd(int sdno)
+{
+ BROKEN_GDB;
+ struct sd *sd;
+ struct drive *drive;
+ int fe; /* free list entry */
+ u_int64_t sdend; /* end of our subdisk */
+ u_int64_t dend; /* end of our freelist entry */
+
+ sd = &SD[sdno];
+ if ((sd->driveno >= 0) /* we have a drive, */
+ &&(sd->sectors > 0)) { /* and some space on it */
+ drive = &DRIVE[sd->driveno];
+ sdend = sd->driveoffset + sd->sectors; /* end of our subdisk */
+
+ /* Look for where to return the sd address space */
+ for (fe = 0;
+ (fe < drive->freelist_entries) && (drive->freelist[fe].offset < sd->driveoffset);
+ fe++);
+ /* Now we are pointing to the last entry, the first
+ * with a higher offset than the subdisk, or both. */
+ if ((fe > 1) /* not the first entry */
+ &&((fe == drive->freelist_entries) /* gone past the end */
+ ||(drive->freelist[fe].offset > sd->driveoffset))) /* or past the block were looking for */
+ fe--; /* point to the block before */
+ dend = drive->freelist[fe].offset + drive->freelist[fe].sectors; /* end of the entry */
+
+ /* At this point, we are pointing to the correct
+ * place in the free list. A number of possibilities
+ * exist:
+ *
+ * 1. The block to be freed immediately follows
+ * the block to which we are pointing. Just
+ * enlarge it.
+ * 2. The block to be freed starts at the end of
+ * the current block and ends at the beginning
+ * of the following block. Merge the three
+ * areas into a single block.
+ * 3. The block to be freed starts after the end
+ * of the block and ends before the start of
+ * the following block. Create a new free block.
+ * 4. The block to be freed starts after the end
+ * of the block, but ends at the start of the
+ * following block. Enlarge the following block
+ * downwards.
+ *
+ */
+ if (sd->driveoffset == dend) { /* it starts after the end of this block */
+ if ((fe < drive->freelist_entries - 1) /* we're not the last block in the free list */
+ &&(sdend == drive->freelist[fe + 1].offset)) { /* and the subdisk ends at the start of the
+ * next block */
+ drive->freelist[fe].sectors = drive->freelist[fe + 1].sectors; /* 2: merge all three blocks */
+ if (fe < drive->freelist_entries - 2) /* still more blocks after next */
+ bcopy(&drive->freelist[fe + 2], /* move down one */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - 2 - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries--; /* one less entry in the free list */
+ } else /* 1: just enlarge this block */
+ drive->freelist[fe].sectors += sd->sectors;
+ } else {
+ if (sd->driveoffset > dend) /* it starts after this block */
+ fe++; /* so look at the next block */
+ if ((fe < drive->freelist_entries) /* we're not the last block in the free list */
+ &&(sdend == drive->freelist[fe].offset)) { /* and the subdisk ends at the start of
+ * this block: case 4 */
+ drive->freelist[fe].offset = sd->driveoffset; /* it starts where the sd was */
+ drive->freelist[fe].sectors += sd->sectors; /* and it's this much bigger */
+ } else { /* case 3: non-contiguous */
+ if (fe < drive->freelist_entries) /* not after the last block, */
+ bcopy(&drive->freelist[fe], /* move the rest up one entry */
+ &drive->freelist[fe + 1],
+ (drive->freelist_entries - fe) * sizeof(struct drive_freelist));
+ drive->freelist_entries++; /* one less entry */
+ drive->freelist[fe].offset = sd->driveoffset; /* this entry represents the sd */
+ drive->freelist[fe].sectors = sd->sectors;
+ }
+ }
+ drive->opencount--; /* one less subdisk attached */
+ }
+ bzero(sd, sizeof(struct sd)); /* and clear it out */
+ sd->state = sd_unallocated;
+}
+
+/* Find an empty plex in the plex table */
+int
+get_empty_plex(void)
+{
+ BROKEN_GDB;
+ int plexno;
+ struct plex *plex; /* if we allocate one */
+
+ /* first see if we have one which has been deallocated */
+ for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++) {
+ if (PLEX[plexno].state == plex_unallocated) /* bingo */
+ break; /* and get out of here */
+ }
+
+ if (plexno >= vinum_conf.plexes_used) {
+ /* Couldn't find a deallocated plex. Allocate a new one */
+ vinum_conf.plexes_used++;
+ if (vinum_conf.plexes_used > vinum_conf.plexes_allocated)
+ EXPAND(PLEX, struct plex, vinum_conf.plexes_allocated, INITIAL_PLEXES);
+ }
+ /* Found a plex. Give it an sd structure */
+ plex = &PLEX[plexno]; /* this one is ours */
+ bzero(plex, sizeof(struct plex)); /* polish it up */
+ plex->sdnos = (int *) Malloc(sizeof(int) * INITIAL_SUBDISKS_IN_PLEX); /* allocate sd table */
+ CHECKALLOC(plex->sdnos, "vinum: Can't allocate plex subdisk table");
+ bzero(plex->sdnos, (sizeof(int) * INITIAL_SUBDISKS_IN_PLEX)); /* do we need this? */
+ plex->subdisks = 0; /* no subdisks in use */
+ plex->subdisks_allocated = INITIAL_SUBDISKS_IN_PLEX; /* and we have space for this many */
+ plex->organization = plex_disorg; /* and it's not organized */
+ plex->volno = -1; /* no volume yet */
+ return plexno; /* return the index */
+}
+
+/* Find the named plex in vinum_conf.plex
+
+ * If create != 0, create an entry if it doesn't exist
+ * return index in vinum_conf.plex
+ */
+int
+find_plex(const char *name, int create)
+{
+ BROKEN_GDB;
+ int plexno;
+ struct plex *plex;
+
+ for (plexno = 0; plexno < vinum_conf.plexes_allocated; plexno++) {
+ if (strcmp(PLEX[plexno].name, name) == 0) /* found it */
+ return plexno;
+ }
+
+ /* the plex isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ plexno = get_empty_plex();
+ plex = &PLEX[plexno]; /* point to it */
+ bcopy(name, plex->name, min(sizeof(plex->name), strlen(name))); /* put in its name */
+ return plexno; /* return the pointer */
+}
+
+/* Free an allocated plex entry
+ * and its associated memory areas */
+void
+free_plex(int plexno)
+{
+ BROKEN_GDB;
+ struct plex *plex;
+
+ plex = &PLEX[plexno];
+ if (plex->sdnos)
+ Free(plex->sdnos);
+ if (plex->lock)
+ Free(plex->lock);
+ if (plex->defective_region)
+ Free(plex->defective_region);
+ if (plex->unmapped_region)
+ Free(plex->unmapped_region);
+ bzero(plex, sizeof(struct plex)); /* and clear it out */
+ plex->state = plex_unallocated;
+}
+
+/* Find an empty volume in the volume table */
+int
+get_empty_volume(void)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol;
+
+ /* first see if we have one which has been deallocated */
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
+ if (VOL[volno].state == volume_unallocated) /* bingo */
+ break;
+ }
+
+ if (volno >= vinum_conf.volumes_used)
+ /* Couldn't find a deallocated volume. Allocate a new one */
+ {
+ vinum_conf.volumes_used++;
+ if (vinum_conf.volumes_used > vinum_conf.volumes_allocated)
+ EXPAND(VOL, struct volume, vinum_conf.volumes_allocated, INITIAL_VOLUMES);
+ }
+ /* Now initialize fields */
+ vol = &VOL[volno];
+ bzero(vol, sizeof(struct volume));
+ vol->preferred_plex = -1; /* default to round robin */
+ vol->preferred_plex = ROUND_ROBIN_READPOL; /* round robin */
+
+ return volno; /* return the index */
+}
+
+/* Find the named volume in vinum_conf.volume.
+
+ * If create != 0, create an entry if it doesn't exist
+ * return the index in vinum_conf
+ */
+int
+find_volume(const char *name, int create)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol;
+
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
+ if (strcmp(VOL[volno].name, name) == 0) /* found it */
+ return volno;
+ }
+
+ /* the volume isn't in the list. Add it if he wants */
+ if (create == 0) /* don't want to create */
+ return -1; /* give up */
+
+ /* Allocate one and insert the name */
+ volno = get_empty_volume();
+ vol = &VOL[volno];
+ bcopy(name, vol->name, min(sizeof(vol->name), strlen(name))); /* put in its name */
+ vol->blocksize = DEV_BSIZE; /* block size of this volume */
+ return volno; /* return the pointer */
+}
+
+/* Free an allocated volume entry
+ * and its associated memory areas */
+void
+free_volume(int volno)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+
+ vol = &VOL[volno];
+ bzero(vol, sizeof(struct volume)); /* and clear it out */
+ vol->state = volume_unallocated;
+}
+
+/* Handle a drive definition. We store the information in the global variable
+ * drive, so we don't need to allocate.
+ *
+ * If we find an error, print a message and return
+ */
+void
+config_drive(void)
+{
+ BROKEN_GDB;
+ enum drive_label_info partition_status; /* info about the partition */
+ int parameter;
+ int driveno; /* index of drive in vinum_conf */
+ struct drive *drive; /* and pointer to it */
+
+ if (tokens < 2) /* not enough tokens */
+ throw_rude_remark(EINVAL, "Drive has no name");
+ driveno = find_drive(token[1], 1); /* allocate a drive to initialize */
+ drive = &DRIVE[driveno]; /* and get a pointer */
+
+ if (drive->state != drive_uninit) { /* we already know this drive */
+ /* XXX Check which definition is more up-to-date. Give
+ * preference for the definition on its own drive */
+ return; /* XXX */
+ }
+ for (parameter = 2; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_device:
+ parameter++;
+ if (drive->devicename[0] != '\0') { /* we know this drive... */
+ if (strcmp(drive->devicename, token[parameter])) /* different name */
+ close_drive(drive); /* close it if it's open */
+ else /* no change */
+ break;
+ }
+ bcopy(token[parameter], /* insert device information */
+ drive->devicename,
+ min(sizeof(drive->devicename),
+ strlen(token[parameter])));
+ /* open the device and get the configuration */
+ partition_status = read_drive_label(drive);
+ if (partition_status == DL_CANT_OPEN) { /* not our kind */
+ close_drive(drive);
+ if (drive->lasterror == EFTYPE) /* wrong kind of partition */
+ throw_rude_remark(drive->lasterror,
+ "Drive %s has invalid partition type",
+ drive->label.name);
+ else /* I/O error of some kind */
+ throw_rude_remark(drive->lasterror,
+ "Can't initialize drive %s",
+ drive->label.name);
+ } else if (partition_status == DL_WRONG_DRIVE) { /* valid drive, not ours */
+ close_drive(drive);
+ throw_rude_remark(drive->lasterror,
+ "Incorrect drive name %s specified for drive %s",
+ token[1],
+ drive->label.name);
+ }
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ drive->state = DriveState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ close_drive(drive);
+ throw_rude_remark(EINVAL,
+ "Drive %s, invalid keyword: %s",
+ token[1],
+ token[parameter]);
+ }
+ }
+
+ if (drive->devicename[0] == '\0')
+ throw_rude_remark(EINVAL, "No device name for %s", drive->label.name);
+
+}
+
+/* Handle a subdisk definition. We store the information in the global variable
+ * sd, so we don't need to allocate.
+ *
+ * If we find an error, print a message and return
+ */
+void
+config_subdisk(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int sdno; /* index of sd in vinum_conf */
+ struct sd *sd; /* and pointer to it */
+ u_int64_t size;
+ int sectors; /* sector offset value */
+ int detached = 0; /* set to 1 if this is a detached subdisk */
+ int sdindex = -1; /* index in plexes subdisk table */
+
+ sdno = get_empty_sd(); /* allocate an SD to initialize */
+ sd = &SD[sdno]; /* and get a pointer */
+ for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_detached:
+ detached = 1;
+ break;
+
+ case kw_plexoffset:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, bad plex offset alignment: %qd", sd->name, size);
+ else
+ sd->plexoffset = size / DEV_BSIZE;
+ break;
+
+ case kw_driveoffset:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, bad drive offset alignment: %qd", sd->name, size);
+ else
+ sd->driveoffset = size / DEV_BSIZE;
+ break;
+
+ case kw_name:
+ ++parameter;
+ bcopy(token[parameter],
+ sd->name,
+ min(sizeof(sd->name), strlen(token[parameter])));
+ break;
+
+ case kw_len:
+ size = sizespec(token[++parameter]);
+ if ((size % DEV_BSIZE) != 0)
+ throw_rude_remark(EINVAL, "sd %s, length %d not multiple of sector size", sd->name, size);
+ else
+ sd->sectors = size / DEV_BSIZE;
+ break;
+
+ case kw_drive:
+ sd->driveno = find_drive(token[++parameter], 1); /* insert drive information */
+ break;
+
+ case kw_plex:
+ sd->plexno = find_plex(token[++parameter], 1); /* insert plex information */
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ sd->state = SdState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "sd %s, invalid keyword: %s", sd->name, token[parameter]);
+ }
+ }
+
+ /* Check we have a drive name */
+ if (sd->driveno < 0) { /* didn't specify a drive */
+ sd->driveno = current_drive; /* set to the current drive */
+ if (sd->driveno < 0) /* no current drive? */
+ throw_rude_remark(EINVAL, "Subdisk %s is not associated with a drive", sd->name);
+ }
+ /* Check for a plex name */
+ if ((sd->plexno < 0) /* didn't specify a plex */
+ &&(!detached)) /* and didn't say not to, */
+ sd->plexno = current_plex; /* set to the current plex */
+
+ if (sd->plexno >= 0)
+ sdindex = give_sd_to_plex(sd->plexno, sdno); /* now tell the plex that it has this sd */
+
+ sd->sdno = sdno; /* point to our entry in the table */
+
+ /* Does the subdisk have a name? If not, give it one */
+ if (sd->name[0] == '\0') { /* no name */
+ char sdsuffix[8]; /* form sd name suffix here */
+
+ /* Do we have a plex name? */
+ if (sdindex >= 0) /* we have a plex */
+ strcpy(sd->name, PLEX[sd->plexno].name); /* take it from there */
+ else /* no way */
+ throw_rude_remark(EINVAL, "Unnamed sd is not associated with a plex");
+ sprintf(sdsuffix, ".s%d", sdindex); /* form the suffix */
+ strcat(sd->name, sdsuffix); /* and add it to the name */
+ }
+ /* do we have complete info for this subdisk? */
+ if (sd->sectors == 0)
+ throw_rude_remark(EINVAL, "sd %s has no length spec", sd->name);
+
+ if (sd->state == sd_unallocated) /* no state decided, */
+ sd->state = sd_init; /* at least we're in the game */
+
+ /* register the subdisk with the drive. This action
+ * will have the side effect of setting the offset if
+ * we haven't specified one, and causing an error
+ * message if it overlaps with another subdisk. */
+ give_sd_to_drive(sdno);
+}
+
+/* Handle a plex definition.
+ * If we find an error, print a message, deallocate the nascent plex, and return
+ */
+void
+config_plex(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int plexno; /* index of plex in vinum_conf */
+ struct plex *plex; /* and pointer to it */
+ int pindex = MAXPLEX; /* index in volume's plex list */
+ int detached = 0; /* don't give it to a volume */
+
+ current_plex = -1; /* forget the previous plex */
+ plexno = get_empty_plex(); /* allocate a plex */
+ plex = &PLEX[plexno]; /* and point to it */
+ plex->plexno = plexno; /* and back to the config */
+ for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_detached:
+ detached = 1;
+ break;
+
+ case kw_name:
+ {
+ int namedplexno;
+
+ namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */
+ if (namedplexno >= 0)
+ throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]);
+ }
+ bcopy(token[parameter], /* put in the name */
+ plex->name,
+ min(MAXPLEXNAME, strlen(token[parameter])));
+ break;
+
+ case kw_org: /* plex organization */
+ switch (get_keyword(token[++parameter], &keyword_set)) {
+ case kw_concat:
+ plex->organization = plex_concat;
+ break;
+
+ case kw_striped:
+ {
+ int stripesize = sizespec(token[++parameter]);
+
+ plex->organization = plex_striped;
+ if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */
+ throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size",
+ plex->name,
+ stripesize);
+ else
+ plex->stripesize = stripesize / DEV_BSIZE;
+ break;
+ }
+
+
+ default:
+ throw_rude_remark(EINVAL, "Invalid plex organization");
+ }
+ if (((plex->organization == plex_striped)
+ )
+ && (plex->stripesize == 0)) /* didn't specify a valid stripe size */
+ throw_rude_remark(EINVAL, "Need a stripe size parameter");
+ break;
+
+ case kw_volume:
+ plex->volno = find_volume(token[++parameter], 1); /* insert a pointer to the volume */
+ break;
+
+ case kw_sd: /* add a subdisk */
+ {
+ int sdno;
+
+ sdno = find_subdisk(token[++parameter], 1); /* find a subdisk */
+ SD[sdno].plexoffset = sizespec(token[++parameter]); /* get the offset */
+ give_sd_to_plex(plexno, sdno); /* and insert it there */
+ break;
+ }
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* only for kernel use */
+ plex->state = PlexState(token[parameter]); /* set the state */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "plex %s, invalid keyword: %s",
+ plex->name,
+ token[parameter]);
+ }
+ }
+
+ if ((plex->volno < 0) /* we don't have a volume */
+ &&(!detached)) /* and we wouldn't object */
+ plex->volno = current_volume;
+
+ if (plex->volno >= 0)
+ pindex = give_plex_to_volume(plex->volno, plexno); /* Now tell the volume that it has this plex */
+
+ /* Does the plex have a name? If not, give it one */
+ if (plex->name[0] == '\0') { /* no name */
+ char plexsuffix[8]; /* form plex name suffix here */
+ /* Do we have a volume name? */
+ if (plex->volno >= 0) /* we have a volume */
+ strcpy(plex->name, /* take it from there */
+ VOL[plex->volno].name);
+ else /* no way */
+ throw_rude_remark(EINVAL, "Unnamed plex is not associated with a volume");
+ sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */
+ strcat(plex->name, plexsuffix); /* and add it to the name */
+ }
+ /* Note the last plex we configured */
+ current_plex = plexno;
+ if (plex->state == plex_unallocated) /* we haven't changed the state, */
+ plex->state = plex_init; /* we're initialized now */
+}
+
+/* Handle a volume definition.
+ * If we find an error, print a message, deallocate the nascent volume, and return
+ */
+void
+config_volume(void)
+{
+ BROKEN_GDB;
+ int parameter;
+ int volno;
+ struct volume *vol; /* collect volume info here */
+ int i;
+
+ if (tokens < 2) /* not enough tokens */
+ throw_rude_remark(EINVAL, "Volume has no name");
+ current_volume = -1; /* forget the previous volume */
+ volno = find_volume(token[1], 1); /* allocate a volume to initialize */
+ vol = &VOL[volno]; /* and get a pointer */
+
+ for (parameter = 2; parameter < tokens; parameter++) { /* look at all tokens */
+ switch (get_keyword(token[parameter], &keyword_set)) {
+ case kw_plex:
+ {
+ int plexno; /* index of this plex */
+
+ plexno = find_plex(token[++parameter], 1); /* find a plex */
+ if (plexno < 0) /* couldn't */
+ break; /* we've already had an error message */
+ plexno = my_plex(volno, plexno); /* does it already belong to us? */
+ if (plexno > 0) /* yes, shouldn't get it again */
+ throw_rude_remark(EINVAL,
+ "Plex %s already belongs to volume %s",
+ token[parameter],
+ vol->name);
+ else if (++vol->plexes > 8) /* another entry */
+ throw_rude_remark(EINVAL,
+ "Too many plexes for volume %s",
+ vol->name);
+ vol->plex[vol->plexes - 1] = plexno;
+ }
+ break;
+
+ case kw_readpol:
+ switch (get_keyword(token[++parameter], &keyword_set)) { /* decide what to do */
+ case kw_round:
+ vol->preferred_plex = ROUND_ROBIN_READPOL; /* default */
+ break;
+
+ case kw_prefer:
+ {
+ int myplexno; /* index of this plex */
+
+ myplexno = find_plex(token[++parameter], 1); /* find a plex */
+ if (myplexno < 0) /* couldn't */
+ break; /* we've already had an error message */
+ myplexno = my_plex(volno, myplexno); /* does it already belong to us? */
+ if (myplexno > 0) /* yes */
+ vol->preferred_plex = myplexno; /* just note the index */
+ else if (++vol->plexes > 8) /* another entry */
+ throw_rude_remark(EINVAL, "Too many plexes");
+ else { /* space for the new plex */
+ vol->plex[vol->plexes - 1] = myplexno; /* add it to our list */
+ vol->preferred_plex = vol->plexes - 1; /* and note the index */
+ }
+ }
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "Invalid read policy");
+ }
+
+ case kw_setupstate:
+ vol->flags |= VF_CONFIG_SETUPSTATE; /* set the volume up later on */
+ break;
+
+ case kw_state:
+ checkkernel(token[++parameter]); /* must be a kernel user */
+ vol->state = VolState(token[parameter]); /* set the state */
+ break;
+
+ /* XXX experimental ideas. These are not
+ * documented, and will not be until I
+ * decide they're worth keeping */
+ case kw_writethrough: /* set writethrough mode */
+ vol->flags |= VF_WRITETHROUGH;
+ break;
+
+ case kw_writeback: /* set writeback mode */
+ vol->flags &= ~VF_WRITETHROUGH;
+ break;
+
+ case kw_raw:
+ vol->flags |= VF_RAW; /* raw volume (no label) */
+ break;
+
+ default:
+ throw_rude_remark(EINVAL, "volume %s, invalid keyword: %s",
+ vol->name,
+ token[parameter]);
+ }
+ }
+
+ current_volume = volno; /* note last referred volume */
+ vol->devno = VINUMBDEV(volno, 0, 0, VINUM_VOLUME_TYPE); /* also note device number */
+
+ /* Before we can actually use the volume, we need
+ * a volume label. We could start to fake one here,
+ * but it will be a lot easier when we have some
+ * to copy from the drives, so defer it until we
+ * set up the configuration. XXX */
+ if (vol->state == volume_unallocated)
+ vol->state = volume_down; /* now ready to bring up at the end */
+
+ /* Find out how big our volume is */
+ for (i = 0; i < vol->plexes; i++)
+ vol->size = max(vol->size, PLEX[vol->plex[i]].length);
+}
+
+/* Parse a config entry. CARE! This destroys the original contents of the
+ * config entry, which we don't really need after this. More specifically, it
+ * places \0 characters at the end of each token.
+ *
+ * Return 0 if all is well, otherwise EINVAL */
+int
+parse_config(char *cptr, struct keywordset *keyset)
+{
+ BROKEN_GDB;
+ int status;
+
+ status = 0; /* until proven otherwise */
+ tokens = tokenize(cptr, token); /* chop up into tokens */
+
+ if (tokens <= 0) /* screwed up or empty line */
+ return tokens; /* give up */
+
+ if (token[0][0] == '#') /* comment line */
+ return 0;
+
+ switch (get_keyword(token[0], keyset)) { /* decide what to do */
+ case kw_read: /* read config from a specified drive */
+ vinum_conf.flags |= VF_KERNELOP | VF_READING_CONFIG; /* kernel operation: reading config */
+ status = check_drive(token[1]); /* check the drive info */
+ vinum_conf.flags &= ~(VF_KERNELOP | VF_READING_CONFIG);
+ if (status != 0) {
+ char *msg = "Can't read configuration from %s";
+ if (status == ENODEV)
+ msg = "No vinum configuration on %s";
+ throw_rude_remark(status, msg, token[1]);
+ }
+ updateconfig(VF_KERNELOP); /* update from kernel space */
+ break;
+
+ case kw_drive:
+ config_drive();
+ break;
+
+ case kw_subdisk:
+ config_subdisk();
+ break;
+
+ case kw_plex:
+ config_plex();
+ break;
+
+ case kw_volume:
+ config_volume();
+ break;
+
+ /* Anything else is invalid in this context */
+ default:
+ throw_rude_remark(EINVAL, /* should we die? */
+ "Invalid configuration information: %s",
+ token[0]);
+ }
+ return status;
+}
+
+/* parse a line handed in from userland via ioctl.
+ * This differs only by the error reporting mechanism:
+ * we return the error indication in the reply to the
+ * ioctl, so we need to set a global static pointer in
+ * this file. This technique works because we have
+ * ensured that configuration is performed in a single-
+ * threaded manner */
+int
+parse_user_config(char *cptr, struct keywordset *keyset)
+{
+ BROKEN_GDB;
+ int status;
+
+ ioctl_reply = (struct _ioctl_reply *) cptr;
+ status = parse_config(cptr, keyset);
+ ioctl_reply = NULL; /* don't do this again */
+ return status;
+}
+
+/* Remove an object */
+void
+remove(struct vinum_ioctl_msg *msg)
+{
+ struct vinum_ioctl_msg message = *msg; /* make a copy to hand on */
+
+ ioctl_reply = (struct _ioctl_reply *) msg; /* reinstate the address to reply to */
+ ioctl_reply->error = 0; /* no error, */
+ ioctl_reply->msg[0] = '\0'; /* no message */
+
+ switch (message.type) {
+ case drive_object:
+ remove_drive_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case sd_object:
+ remove_sd_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case plex_object:
+ remove_plex_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ case volume_object:
+ remove_volume_entry(message.index, message.force, message.recurse);
+ updateconfig(0);
+ return;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ }
+}
+
+/* Remove a drive. */
+void
+remove_drive_entry(int driveno, int force, int recurse)
+{
+ struct drive *drive = &DRIVE[driveno];
+
+ if ((driveno > vinum_conf.drives_used) /* not a valid drive */
+ ||(drive->state == drive_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such drive");
+ } else if (drive->opencount > 0) { /* we have subdisks */
+ if (force) { /* do it at any cost */
+ int sdno;
+ struct vinum_ioctl_msg sdmsg;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
+ if ((SD[sdno].state != sd_unallocated) /* subdisk is allocated */
+ &&(SD[sdno].driveno == driveno)) { /* and it belongs to this drive */
+ sdmsg.type = sd_object;
+ sdmsg.recurse = 1;
+ sdmsg.force = force;
+ remove(&sdmsg); /* remove the subdisk by force */
+ }
+ }
+ remove_drive(driveno); /* now remove it */
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ remove_drive(driveno); /* just remove it */
+}
+
+/* remove a subdisk */
+void
+remove_sd_entry(int sdno, int force, int recurse)
+{
+ struct sd *sd = &SD[sdno];
+
+ if ((sdno > vinum_conf.subdisks_used) /* not a valid sd */
+ ||(sd->state == sd_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such subdisk");
+ } else if (sd->plexno >= 0) { /* we have a plex */
+ if (force) { /* do it at any cost */
+ struct plex *plex = &PLEX[sd->plexno]; /* point to our plex */
+ int mysdno;
+
+ for (mysdno = 0; /* look for ourselves */
+ mysdno < plex->subdisks && &SD[plex->sdnos[mysdno]] != sd;
+ mysdno++);
+ if (mysdno == plex->subdisks) /* didn't find it */
+ throw_rude_remark(ENOENT, "plex %s does not contain subdisk %s", plex->name, sd->name);
+ if (mysdno < (plex->subdisks - 1)) /* not the last subdisk */
+ bcopy(&plex->sdnos[mysdno + 1],
+ &plex->sdnos[mysdno],
+ (plex->subdisks - 1 - mysdno) * sizeof(int));
+ plex->subdisks--;
+ /* removing a subdisk from a striped or
+ * RAID-5 plex really tears the hell out
+ * of the structure, and it needs to be
+ * reinitialized */
+ if (plex->organization != plex_concat) /* not concatenated, */
+ set_plex_state(plex->plexno, plex_faulty, setstate_force); /* need to reinitialize */
+ rebuild_plex_unmappedlist(plex); /* and see what remains */
+ free_sd(sdno);
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ free_sd(sdno);
+}
+
+/* remove a plex */
+void
+remove_plex_entry(int plexno, int force, int recurse)
+{
+ struct plex *plex = &PLEX[plexno];
+ int sdno;
+
+ if ((plexno > vinum_conf.plexes_used) /* not a valid plex */
+ ||(plex->state == plex_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such plex");
+ } else if (plex->pid) { /* we're open */
+ ioctl_reply->error = EBUSY; /* no getting around that */
+ return;
+ }
+ if (plex->subdisks) {
+ if (force) { /* do it anyway */
+ if (recurse) { /* remove all below */
+ for (sdno = 0; sdno < plex->subdisks; sdno++)
+ free_sd(plex->sdnos[sdno]); /* free all subdisks */
+ } else { /* just tear them out */
+ for (sdno = 0; sdno < plex->subdisks; sdno++)
+ SD[plex->sdnos[sdno]].plexno = -1; /* no plex any more */
+ }
+ } else { /* can't do it without force */
+ ioctl_reply->error = EBUSY; /* can't do that */
+ return;
+ }
+ }
+ if (plex->volno >= 0) { /* we are part of a volume */
+ /* XXX This should be more intelligent. We should
+ * be able to remove a plex as long as the volume
+ * does not lose any data, which is normally the
+ * case when it has more than one plex. To do it
+ * right we must compare the completeness of the
+ * mapping of all the plexes in the volume */
+ if (force) { /* do it at any cost */
+ struct volume *vol = &VOL[plex->volno];
+ int myplexno;
+
+ for (myplexno = 0; myplexno < vol->plexes; myplexno++)
+ if (vol->plex[myplexno] == plexno) /* found it */
+ break;
+ if (myplexno == vol->plexes) /* didn't find it. Huh? */
+ throw_rude_remark(ENOENT, "volume %s does not contain plex %s", vol->name, plex->name);
+ if (myplexno < (vol->plexes - 1)) /* not the last plex in the list */
+ bcopy(&vol->plex[myplexno + 1], &vol->plex[myplexno], vol->plexes - 1 - myplexno);
+ vol->plexes--;
+ } else {
+ ioctl_reply->error = EBUSY; /* can't do that */
+ return;
+ }
+ }
+ free_plex(plexno);
+}
+
+/* remove a volume */
+void
+remove_volume_entry(int volno, int force, int recurse)
+{
+ struct volume *vol = &VOL[volno];
+ int plexno;
+
+ if ((volno > vinum_conf.volumes_used) /* not a valid volume */
+ ||(vol->state == volume_unallocated)) { /* or nothing there */
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "No such volume");
+ } else if (vol->opencount) /* we're open */
+ ioctl_reply->error = EBUSY; /* no getting around that */
+ else if (vol->plexes) {
+ if (recurse && force) { /* remove all below */
+ struct vinum_ioctl_msg plexmsg;
+
+ plexmsg.type = plex_object;
+ plexmsg.recurse = 1;
+ plexmsg.force = force;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ plexmsg.index = vol->plex[plexno]; /* plex number */
+ remove(&plexmsg);
+ }
+ free_volume(volno);
+ } else
+ ioctl_reply->error = EBUSY; /* can't do that */
+ } else
+ free_volume(volno);
+}
+
+void
+update_sd_config(int sdno, int kernelstate)
+{
+ if (!kernelstate)
+ set_sd_state(sdno, sd_up, setstate_configuring | setstate_norecurse);
+}
+
+void
+update_plex_config(int plexno, int kernelstate)
+{
+ int error = 0;
+ int size;
+ int sdno;
+ struct plex *plex = &PLEX[plexno];
+ enum plexstate state = plex_up; /* state we want the plex in */
+
+ /* XXX Insert checks here for sparse plexes and volumes */
+
+ /* Check that our subdisks make sense. For
+ * striped and RAID5 plexes, we need at least
+ * two subdisks, and they must all be the same
+ * size */
+ if (((plex->organization == plex_striped)
+ )
+ && (plex->subdisks < 2)) {
+ error = 1;
+ printf("vinum: plex %s does not have at least 2 subdisks\n", plex->name);
+ if (!kernelstate)
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
+ }
+ size = 0;
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ if (((plex->organization == plex_striped)
+ )
+ && (sdno > 0)
+ && (SD[plex->sdnos[sdno]].sectors != SD[plex->sdnos[sdno - 1]].sectors)) {
+ error = 1;
+ printf("vinum: plex %s must have equal sized subdisks\n", plex->name);
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
+ }
+ size += SD[plex->sdnos[sdno]].sectors;
+ }
+
+ if (plex->subdisks) { /* plex has subdisks, calculate size */
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list first */
+
+ plex->length = size;
+ } else { /* no subdisks, */
+ plex->length = 0; /* no size */
+ state = plex_down; /* take it down */
+ }
+ if (!(kernelstate || error))
+ set_plex_state(plexno, state, setstate_none | setstate_configuring | setstate_norecurse);
+}
+
+void
+update_volume_config(int volno, int kernelstate)
+{
+ struct volume *vol = &VOL[volno];
+ struct plex *plex;
+ int plexno;
+
+ if (vol->state != volume_unallocated)
+ /* Recalculate the size of the volume */
+ {
+ vol->size = 0;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ plex = &PLEX[vol->plex[plexno]];
+ vol->size = max(plex->length, vol->size); /* maximum size */
+ plex->volplexno = plexno; /* note it in the plex */
+ }
+ }
+ if (!kernelstate) /* try to bring it up */
+ set_volume_state(volno, volume_up, setstate_configuring | setstate_norecurse);
+}
+
+/* Update the global configuration.
+ * kernelstate is != 0 if we're reading in a config
+ * from disk. In this case, we don't try to
+ * bring the devices up, though we will bring
+ * them down if there's some error which got
+ * missed when writing to disk.
+ */
+void
+updateconfig(int kernelstate)
+{
+ BROKEN_GDB;
+ int sdno;
+ int plexno;
+ int volno;
+ struct volume *vol;
+ struct plex *plex;
+
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++)
+ update_sd_config(sdno, kernelstate);
+
+ for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++)
+ update_plex_config(plexno, kernelstate);
+
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++)
+ update_volume_config(volno, kernelstate);
+ save_config();
+}
+
+/* Start manual changes to the configuration and lock out
+ * others who may wish to do so.
+ * XXX why do we need this and lock_config too? */
+int
+start_config(void)
+{
+ int error;
+
+ while ((vinum_conf.flags & VF_CONFIGURING) != 0) {
+ vinum_conf.flags |= VF_WILL_CONFIGURE;
+ if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
+ return error;
+ }
+ /* We need two flags here: VF_CONFIGURING
+ * tells other processes to hold off (this
+ * function), and VF_CONFIG_INCOMPLETE
+ * tells the state change routines not to
+ * propagate incrememntal state changes */
+ vinum_conf.flags |= VF_CONFIGURING | VF_CONFIG_INCOMPLETE;
+ current_drive = -1; /* reset the defaults */
+ current_plex = -1; /* and the same for the last plex */
+ current_volume = -1; /* and the last volme */
+ return 0;
+}
+
+/* Update the config if update is 1, and unlock
+ * it. We won't update the configuration if we
+ * are called in a recursive loop via throw_rude_remark.
+ */
+void
+finish_config(int update)
+{
+ vinum_conf.flags &= ~VF_CONFIG_INCOMPLETE; /* we've finished our config */
+ if (update)
+ updateconfig(0); /* so update things */
+ else
+ updateconfig(1); /* do some updates only */
+ vinum_conf.flags &= ~VF_CONFIGURING; /* and now other people can take a turn */
+ if ((vinum_conf.flags & VF_WILL_CONFIGURE) != 0) {
+ vinum_conf.flags &= ~VF_WILL_CONFIGURE;
+ wakeup(&vinum_conf);
+ }
+}
diff --git a/sys/modules/vinum/interrupt.c b/sys/modules/vinum/interrupt.c
new file mode 100644
index 000000000000..e7eb034faf4b
--- /dev/null
+++ b/sys/modules/vinum/interrupt.c
@@ -0,0 +1,190 @@
+/* interrupt.c: bottom half of the driver */
+
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: interrupt.c,v 1.1 1998/08/13 06:12:27 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+#include <miscfs/specfs/specdev.h>
+#include <sys/resourcevar.h>
+
+void complete_raid5_write(struct rqelement *);
+void freerq(struct request *rq);
+void free_rqg(struct rqgroup *rqg);
+void complete_rqe(struct buf *bp);
+void sdio_done(struct buf *bp);
+
+/* Take a completed buffer, transfer the data back if
+ * it's a read, and complete the high-level request
+ * if this is the last subrequest.
+ *
+ * The bp parameter is in fact a struct rqelement, which
+ * includes a couple of extras at the end.
+ */
+void
+complete_rqe(struct buf *bp)
+{
+ BROKEN_GDB;
+ struct rqelement *rqe;
+ struct request *rq;
+ struct rqgroup *rqg;
+ struct buf *ubp; /* user buffer */
+
+ rqe = (struct rqelement *) bp; /* point to the element element that completed */
+ rqg = rqe->rqg; /* and the request group */
+ rq = rqg->rq; /* and the complete request */
+
+ if ((bp->b_flags & B_ERROR) != 0) { /* transfer in error */
+ if (bp->b_error != 0) /* did it return a number? */
+ rq->error = bp->b_error; /* yes, put it in. */
+ else if (rq->error == 0) /* no: do we have one already? */
+ rq->error = EIO; /* no: catchall "I/O error" */
+ if (rq->error == EIO) /* I/O error, */
+ set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* take the subdisk down */
+ }
+ /* Now update the statistics */
+ if (bp->b_flags & B_READ) { /* read operation */
+ DRIVE[rqe->driveno].reads++;
+ DRIVE[rqe->driveno].bytes_read += bp->b_bcount;
+ SD[rqe->sdno].reads++;
+ SD[rqe->sdno].bytes_read += bp->b_bcount;
+ PLEX[rqe->rqg->plexno].reads++;
+ PLEX[rqe->rqg->plexno].bytes_read += bp->b_bcount;
+ } else { /* write operation */
+ DRIVE[rqe->driveno].writes++;
+ DRIVE[rqe->driveno].bytes_written += bp->b_bcount;
+ SD[rqe->sdno].writes++;
+ SD[rqe->sdno].bytes_written += bp->b_bcount;
+ PLEX[rqe->rqg->plexno].writes++;
+ PLEX[rqe->rqg->plexno].bytes_written += bp->b_bcount;
+ }
+ ubp = rq->bp; /* user buffer */
+ rqg->active--; /* one less request active */
+ if (rqg->active == 0) /* request group finished, */
+ rq->active--; /* one less */
+ if (rq->active == 0) { /* request finished, */
+#if DEBUG
+ if (debug & 4) {
+ if (ubp->b_resid != 0) /* still something to transfer? */
+ Debugger("resid");
+
+ {
+ int i;
+ for (i = 0; i < ubp->b_bcount; i += 512) /* XXX debug */
+ if (((char *) ubp->b_data)[i] != '<') { /* and not what we expected */
+ printf("At 0x%x (offset 0x%x): '%c' (0x%x)\n",
+ (int) (&((char *) ubp->b_data)[i]),
+ i,
+ ((char *) ubp->b_data)[i],
+ ((char *) ubp->b_data)[i]);
+ Debugger("complete_request checksum");
+ }
+ }
+ }
+#endif
+
+ if (rq->error) { /* did we have an error? */
+ ubp->b_flags |= B_ERROR; /* yes, propagate to user */
+ ubp->b_error = rq->error;
+ } else
+ ubp->b_resid = 0; /* completed our transfer */
+ if (rq->isplex == 0) /* volume request, */
+ VOL[rq->volplex.volno].active--; /* another request finished */
+ biodone(ubp); /* top level buffer completed */
+ freerq(rq); /* return the request storage */
+ }
+}
+
+
+/* Free a request block and anything hanging off it */
+void
+freerq(struct request *rq)
+{
+ BROKEN_GDB;
+ struct rqgroup *rqg;
+ struct rqgroup *nrqg; /* next in chain */
+ int rqno;
+
+ for (rqg = rq->rqg; rqg != NULL; rqg = nrqg) { /* through the whole request chain */
+ for (rqno = 0; rqno < rqg->count; rqno++)
+ if ((rqg->rqe[rqno].flags & XFR_MALLOCED) /* data buffer was malloced, */
+ &&rqg->rqe[rqno].b.b_data) /* and the allocation succeeded */
+ Free(rqg->rqe[rqno].b.b_data); /* free it */
+ nrqg = rqg->next; /* note the next one */
+ Free(rqg); /* and free this one */
+ }
+ Free(rq); /* free the request itself */
+}
+
+void
+free_rqg(struct rqgroup *rqg)
+{
+ if ((rqg->flags & XFR_GROUPOP) /* RAID 5 request */
+ &&(rqg->rqe) /* got a buffer structure */
+ &&(rqg->rqe->b.b_data)) /* and it has a buffer allocated */
+ Free(rqg->rqe->b.b_data); /* free it */
+}
+
+/* I/O on subdisk completed */
+void
+sdio_done(struct buf *bp)
+{
+ struct sdbuf *sbp;
+
+ sbp = (struct sdbuf *) bp;
+ if (sbp->b.b_flags & B_ERROR) { /* had an error */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = sbp->b.b_error;
+ }
+ bp->b_resid = sbp->b.b_resid;
+ biodone(sbp->bp); /* complete the caller's I/O */
+ /* Now update the statistics */
+ if (bp->b_flags & B_READ) { /* read operation */
+ DRIVE[sbp->driveno].reads++;
+ DRIVE[sbp->driveno].bytes_read += bp->b_bcount;
+ SD[sbp->sdno].reads++;
+ SD[sbp->sdno].bytes_read += bp->b_bcount;
+ } else { /* write operation */
+ DRIVE[sbp->driveno].writes++;
+ DRIVE[sbp->driveno].bytes_written += bp->b_bcount;
+ SD[sbp->sdno].writes++;
+ SD[sbp->sdno].bytes_written += bp->b_bcount;
+ }
+ Free(sbp);
+}
diff --git a/sys/modules/vinum/io.c b/sys/modules/vinum/io.c
new file mode 100644
index 000000000000..a16a33a9e8bc
--- /dev/null
+++ b/sys/modules/vinum/io.c
@@ -0,0 +1,886 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: io.c,v 1.16 1998/08/10 23:47:21 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#if __FreeBSD__ < 3 /* this is in sys/disklabel.h in 3.0 and on */
+#define DTYPE_VINUM 12 /* vinum volume */
+#endif
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include <miscfs/specfs/specdev.h>
+
+extern jmp_buf command_fail; /* return on a failed command */
+struct _ioctl_reply *ioctl_reply; /* data pointer, for returning error messages */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
+
+/* Open the device associated with the drive, and set drive's vp */
+int
+open_drive(struct drive *drive, struct proc *p)
+{
+ BROKEN_GDB;
+ struct nameidata nd;
+ struct vattr va;
+ int error;
+
+ if (drive->devicename[0] == '\0') /* no device name */
+ sprintf(drive->devicename, "/dev/%s", drive->label.name); /* get it from the drive name */
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, drive->devicename, p);
+ error = vn_open(&nd, FREAD | FWRITE, 0); /* open the device */
+ if (error != 0) { /* can't open? */
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = error;
+ printf("vinum open_drive %s: failed with error %d\n", drive->devicename, error); /* XXX */
+ return error;
+ }
+ drive->vp = nd.ni_vp;
+ drive->p = p;
+
+ if (drive->vp->v_usecount > 1) { /* already in use? */
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = EBUSY;
+ printf("vinum open_drive %s: Drive in use\n", drive->devicename); /* XXX */
+ return EBUSY;
+ }
+ error = VOP_GETATTR(drive->vp, &va, NOCRED, p);
+ if (error) {
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = error;
+ printf("vinum open_drive %s: GETAATTR returns error %d\n", drive->devicename, error); /* XXX */
+ return error;
+ }
+ drive->dev = va.va_rdev; /* device */
+
+ if (va.va_type != VBLK) { /* only consider block devices */
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1); /* this also closes the drive */
+ drive->lasterror = ENOTBLK;
+ printf("vinum open_drive %s: Not a block device\n", drive->devicename); /* XXX */
+ return ENOTBLK;
+ }
+ drive->vp->v_numoutput = 0;
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ return 0;
+}
+
+/* Set some variables in the drive struct
+ * in more convenient form. Return error indication */
+int
+set_drive_parms(struct drive *drive)
+{
+ drive->blocksize = BLKDEV_IOSIZE; /* XXX do we need this? */
+ drive->secsperblock = drive->blocksize /* number of sectors per block */
+ / drive->partinfo.disklab->d_secsize;
+
+ /* Now update the label part */
+ bcopy(hostname, drive->label.sysname, VINUMHOSTNAMELEN); /* put in host name */
+#if __FreeBSD__ >= 3
+ getmicrotime(&drive->label.date_of_birth); /* and current time */
+#else
+ drive->label.date_of_birth = time; /* and current time */
+#endif
+ drive->label.drive_size = ((u_int64_t) drive->partinfo.part->p_size) /* size of the drive in bytes */
+ *((u_int64_t) drive->partinfo.disklab->d_secsize);
+
+ /* number of sectors available for subdisks */
+ drive->sectors_available = drive->label.drive_size / DEV_BSIZE - DATASTART;
+
+ /* XXX Bug in 3.0 as of January 1998: you can open
+ * non-existent slices. They have a length of 0 */
+ if (drive->label.drive_size < MINVINUMSLICE) { /* too small to worry about */
+ set_drive_state(drive->driveno, drive_down, 1);
+ printf("vinum open_drive %s: Drive too small\n", drive->devicename); /* XXX */
+ drive->lasterror = ENOSPC;
+ return ENOSPC;
+ }
+ drive->freelist_size = INITIAL_DRIVE_FREELIST; /* initial number of entries */
+ drive->freelist = (struct drive_freelist *)
+ Malloc(INITIAL_DRIVE_FREELIST * sizeof(struct drive_freelist));
+ if (drive->freelist == NULL) /* can't malloc, dammit */
+ return ENOSPC;
+ drive->freelist_entries = 1; /* just (almost) the complete drive */
+ drive->freelist[0].offset = DATASTART; /* starts here */
+ drive->freelist[0].sectors = (drive->label.drive_size >> DEV_BSHIFT) - DATASTART; /* and it's this long */
+ set_drive_state(drive->driveno, drive_up, 1); /* our drive is accessible */
+ return 0;
+}
+
+/* Initialize a drive: open the device and add device
+ * information */
+int
+init_drive(struct drive *drive)
+{
+ BROKEN_GDB;
+ int error;
+
+ if (drive->devicename[0] == '\0') { /* no device name yet, default to drive name */
+ drive->lasterror = EINVAL;
+ printf("vinum: Can't open drive without drive name\n"); /* XXX */
+ return EINVAL;
+ }
+ error = open_drive(drive, myproc); /* open the drive */
+ if (error)
+ return error;
+
+ error = VOP_IOCTL(drive->vp, /* get the partition information */
+ DIOCGPART,
+ (caddr_t) & drive->partinfo,
+ FREAD,
+ NOCRED,
+ myproc);
+ if (error) {
+ printf("vinum open_drive %s: Can't get partition information, error %d\n",
+ drive->devicename,
+ error); /* XXX */
+ close_drive(drive);
+ drive->lasterror = error;
+ set_drive_state(drive->driveno, drive_down, 1);
+ return error;
+ }
+ if (drive->partinfo.part->p_fstype != 0) { /* not plain */
+ drive->lasterror = EFTYPE;
+ printf("vinum open_drive %s: Wrong partition type for vinum\n", drive->devicename); /* XXX */
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ return EFTYPE;
+ }
+ return set_drive_parms(drive); /* set various odds and ends */
+}
+
+/* Close a drive if it's open. No errors */
+void
+close_drive(struct drive *drive)
+{
+ if (drive->vp) {
+ vn_close(drive->vp, FREAD | FWRITE, NOCRED, drive->p);
+ drive->vp = NULL;
+ }
+}
+
+/* Remove drive from the configuration.
+ * Caller must ensure that it isn't active
+ */
+void
+remove_drive(int driveno)
+{
+ BROKEN_GDB;
+ struct drive *drive = &vinum_conf.drive[driveno];
+ long long int nomagic = VINUM_NOMAGIC; /* no magic number */
+
+ write_drive(drive, /* obliterate the magic, but leave a hint */
+ (char *) &nomagic,
+ 8,
+ VINUM_LABEL_OFFSET);
+ close_drive(drive); /* and close it */
+ drive->state = drive_unallocated; /* and forget everything we knew about it */
+ save_config(); /* and save the updated configuration */
+}
+
+/* Transfer drive data. Usually called from one of these defines;
+
+ * #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
+ * #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE)
+ *
+ * Return error number
+ */
+int
+driveio(struct drive *drive, void *buf, size_t length, off_t offset, int flag)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ int spl;
+
+ error = 0;
+
+ /* Get a buffer */
+ bp = (struct buf *) Malloc(sizeof(struct buf)); /* get a buffer */
+ CHECKALLOC(bp, "Can't allocate memory");
+
+ bzero(&buf, sizeof(buf));
+ bp->b_flags = B_BUSY | flag; /* tell us when it's done */
+ bp->b_iodone = drive_io_done; /* here */
+ bp->b_proc = myproc; /* process */
+ bp->b_dev = drive->vp->v_un.vu_specinfo->si_rdev; /* device */
+ if (offset & (drive->partinfo.disklab->d_secsize - 1)) /* not on a block boundary */
+ bp->b_blkno = offset / drive->partinfo.disklab->d_secsize; /* block number */
+ bp->b_data = buf;
+ bp->b_vp = drive->vp; /* vnode */
+ bp->b_bcount = length;
+ bp->b_bufsize = length;
+
+ (*bdevsw[major(bp->b_dev)]->d_strategy) (bp); /* initiate the transfer */
+
+ spl = splbio();
+ while ((bp->b_flags & B_DONE) == 0) {
+ bp->b_flags |= B_CALL; /* wake me again */
+ tsleep((caddr_t) bp, PRIBIO, "driveio", 0); /* and wait for it to complete */
+ }
+ splx(spl);
+ if (bp->b_flags & B_ERROR) /* didn't work */
+ error = bp->b_error; /* get the error return */
+ Free(bp); /* then return the buffer */
+ return error;
+}
+
+/* Read data from a drive
+
+ * Return error number
+ */
+int
+read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ daddr_t nextbn;
+ long bscale;
+
+ struct uio uio;
+ struct iovec iov;
+ daddr_t blocknum; /* block number */
+ int blockoff; /* offset in block */
+ int count; /* amount to transfer */
+
+ iov.iov_base = buf;
+ iov.iov_len = length;
+
+ uio.uio_iov = &iov;
+ uio.uio_iovcnt = length;
+ uio.uio_offset = offset;
+ uio.uio_resid = length;
+ uio.uio_segflg = UIO_SYSSPACE;
+ uio.uio_rw = UIO_READ;
+ uio.uio_procp = myproc;
+
+ bscale = btodb(drive->blocksize); /* mask off offset from block number */
+ do {
+ blocknum = btodb(uio.uio_offset) & ~(bscale - 1); /* get the block number */
+ blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
+ count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
+ uio.uio_resid);
+
+ /* XXX Check this. I think the test is wrong */
+ if (drive->vp->v_lastr + bscale == blocknum) { /* did our last read finish in this block? */
+ nextbn = blocknum + bscale; /* note the end of the transfer */
+ error = breadn(drive->vp, /* and read with read-ahead */
+ blocknum,
+ (int) drive->blocksize,
+ &nextbn,
+ (int *) &drive->blocksize,
+ 1,
+ NOCRED,
+ &bp);
+ } else /* random read: just read this block */
+ error = bread(drive->vp, blocknum, (int) drive->blocksize, NOCRED, &bp);
+ drive->vp->v_lastr = blocknum; /* note the last block we read */
+ count = min(count, drive->blocksize - bp->b_resid);
+ if (error) {
+ brelse(bp);
+ return error;
+ }
+ error = uiomove((char *) bp->b_data + blockoff, count, &uio); /* move the data */
+ brelse(bp);
+ }
+ while (error == 0 && uio.uio_resid > 0 && count != 0);
+ return error;
+}
+
+/* Write data to a drive
+
+ * Return error number
+ */
+int
+write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
+{
+ BROKEN_GDB;
+ int error;
+ struct buf *bp;
+ struct uio uio;
+ struct iovec iov;
+ daddr_t blocknum; /* block number */
+ int blockoff; /* offset in block */
+ int count; /* amount to transfer */
+ int blockshift;
+
+ if (drive->state == drive_down) /* currently down */
+ return 0; /* ignore */
+ if (drive->vp == NULL) {
+ drive->lasterror = ENODEV;
+ return ENODEV; /* not configured yet */
+ }
+ iov.iov_base = buf;
+ iov.iov_len = length;
+
+ uio.uio_iov = &iov;
+ uio.uio_iovcnt = length;
+ uio.uio_offset = offset;
+ uio.uio_resid = length;
+ uio.uio_segflg = UIO_SYSSPACE;
+ uio.uio_rw = UIO_WRITE;
+ uio.uio_procp = myproc;
+
+ error = 0;
+ blockshift = btodb(drive->blocksize) - 1; /* amount to shift block number
+ * to get sector number */
+ do {
+ blocknum = btodb(uio.uio_offset) & ~blockshift; /* get the block number */
+ blockoff = uio.uio_offset % drive->blocksize; /* offset in block */
+ count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
+ uio.uio_resid);
+ if (count == drive->blocksize) /* the whole block */
+ bp = getblk(drive->vp, blocknum, drive->blocksize, 0, 0); /* just get it */
+ else /* partial block: */
+ error = bread(drive->vp, /* read it first */
+ blocknum,
+ drive->blocksize,
+ NOCRED,
+ &bp);
+ count = min(count, drive->blocksize - bp->b_resid); /* how much will we transfer now? */
+ if (error == 0)
+ error = uiomove((char *) bp->b_data + blockoff, /* move the data to the block */
+ count,
+ &uio);
+ if (error) {
+ brelse(bp);
+ drive->lasterror = error;
+ switch (error) {
+ case EIO:
+ set_drive_state(drive->driveno, drive_down, 1);
+ break;
+
+ /* XXX Add other possibilities here */
+ default:
+ }
+ return error;
+ }
+ if (count + blockoff == drive->blocksize)
+ /* The transfer goes to the end of the block. There's
+ * no need to wait for any more data to arrive. */
+ bawrite(bp); /* start the write now */
+ else
+ bdwrite(bp); /* do a delayed write */
+ }
+ while (error == 0 && uio.uio_resid > 0 && count != 0);
+ if (error)
+ drive->lasterror = error;
+ return error; /* OK */
+}
+
+/* Wake up on completion */
+void
+drive_io_done(struct buf *bp)
+{
+ BROKEN_GDB;
+ wakeup((caddr_t) bp); /* Wachet auf! */
+ bp->b_flags &= ~B_CALL; /* don't do this again */
+}
+
+/* Check a drive for a vinum header. If found,
+ * update the drive information. We come here
+ * with a partially populated drive structure
+ * which includes the device name.
+ *
+ * Return information on what we found
+ */
+enum drive_label_info
+read_drive_label(struct drive *drive)
+{
+ BROKEN_GDB;
+ int error;
+ int result; /* result of our search */
+ struct vinum_hdr *vhdr; /* and as header */
+
+ error = init_drive(drive); /* find the drive */
+ if (error) /* find the drive */
+ return DL_CANT_OPEN; /* not ours */
+
+ vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* allocate buffers */
+ CHECKALLOC(vhdr, "Can't allocate memory");
+
+ error = read_drive(drive, (void *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
+ if (vhdr->magic == VINUM_MAGIC) { /* ours! */
+ if (drive->label.name[0] /* we have a name for this drive */
+ &&(strcmp(drive->label.name, vhdr->label.name))) { /* but it doesn't match the real name */
+ drive->lasterror = EINVAL;
+ result = DL_WRONG_DRIVE; /* it's the wrong drive */
+ } else {
+ set_drive_parms(drive); /* and set other parameters */
+ result = DL_OURS;
+ }
+ /* We copy the drive anyway so that we have
+ * the correct name in the drive info. This
+ * may not be the name specified */
+ drive->label = vhdr->label; /* put in the label information */
+ } else if (vhdr->magic == VINUM_NOMAGIC) /* was ours, but we gave it away */
+ result = DL_DELETED_LABEL;
+ else
+ result = DL_NOT_OURS; /* we could have it, but we don't yet */
+ Free(vhdr); /* that's all. */
+ return result;
+}
+
+/* Check a drive for a vinum header. If found,
+ * read configuration information from the drive and
+ * incorporate the data into the configuration.
+ *
+ * Return error number
+ */
+int
+check_drive(char *drivename)
+{
+ BROKEN_GDB;
+ int error;
+ struct nameidata nd; /* mount point credentials */
+ char *config_text; /* read the config info from disk into here */
+ volatile char *cptr; /* pointer into config information */
+ char *eptr; /* end pointer into config information */
+ int driveno;
+ struct drive *drive;
+ char *config_line; /* copy the config line to */
+
+ driveno = find_drive_by_dev(drivename, 1); /* doesn't exist, create it */
+ drive = &vinum_conf.drive[driveno]; /* and get a pointer */
+ strcpy(drive->devicename, drivename); /* put in device name */
+
+ if (read_drive_label(drive) == DL_OURS) { /* ours! */
+ config_text = (char *) Malloc(MAXCONFIG * 2); /* allocate buffers */
+ CHECKALLOC(config_text, "Can't allocate memory");
+ config_line = (char *) Malloc(MAXCONFIGLINE * 2); /* allocate buffers */
+ CHECKALLOC(config_line, "Can't allocate memory");
+
+ /* Read in both copies of the configuration information */
+ error = read_drive(drive, config_text, MAXCONFIG * 2, VINUM_CONFIG_OFFSET);
+
+ if (error != 0) {
+ printf("vinum: Can't read device %s, error %d\n", drive->devicename, error);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return error;
+ }
+ /* XXX At this point, check that the two copies are the same, and do something useful if not.
+ * In particular, consider which is newer, and what this means for the integrity of the
+ * data on the drive */
+
+ /* Parse the configuration, and add it to the global configuration */
+ for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */
+ volatile int parse_status; /* return value from parse_config */
+
+ for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */
+ *eptr++ = *cptr++;
+ *eptr = '\0'; /* and delimit */
+ if (setjmp(command_fail) == 0) { /* come back here on error and continue */
+ parse_status = parse_config(config_line, &keyword_set); /* parse the config line */
+ if (parse_status < 0) { /* error in config */
+ /* This config should have been parsed in user
+ * space. If we run into problems here, something
+ * serious is afoot. Complain and let the user
+ * snarf the config to see what's wrong */
+ printf("vinum: Config error on drive %s, aborting integration\n", nd.ni_dirp);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return EINVAL;
+ }
+ }
+ while (*cptr == '\n')
+ cptr++; /* skip to next line */
+ }
+ Free(config_text);
+ if ((vinum_conf.flags & VF_READING_CONFIG) == 0) /* not reading config */
+ updateconfig(0); /* update object states */
+ printf("vinum: read configuration from %s\n", drivename);
+ return 0; /* it all worked */
+ } else { /* no vinum label found */
+ if (drive->lasterror) {
+ set_drive_state(drive->driveno, drive_down, 1);
+ return drive->lasterror;
+ } else
+ return ENODEV; /* not our device */
+ }
+}
+
+/* Kludge: kernel printf doesn't handle longs correctly XXX */
+static char *lltoa(long long l, char *s);
+static char *sappend(char *txt, char *s);
+
+static char *
+lltoa(long long l, char *s)
+{
+ if (l < 0) {
+ *s++ = '-';
+ l = -l;
+ }
+ if (l > 9) {
+ s = lltoa(l / 10, s);
+ l %= 10;
+ }
+ *s++ = l + '0';
+ return s;
+}
+
+static char *
+sappend(char *txt, char *s)
+{
+ while (*s++ = *txt++);
+ return s - 1;
+}
+
+/* Format the configuration in text form into the buffer
+ * at config. Don't go beyond len bytes
+ * XXX this stinks. Fix soon. */
+void
+format_config(char *config, int len)
+{
+ BROKEN_GDB;
+ int i;
+ int j;
+ char *s = config;
+
+ bzero(config, len);
+
+ /* First write the drive configuration */
+ for (i = 0; i < vinum_conf.drives_used; i++) {
+ struct drive *drive;
+
+ drive = &vinum_conf.drive[i];
+ if (drive->state != drive_unallocated) {
+ sprintf(s,
+ "drive %s state %s device %s\n",
+ drive->label.name,
+ drive_state(drive->state),
+ drive->devicename);
+ while (*s)
+ s++; /* find the end */
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* Then the volume configuration */
+ for (i = 0; i < vinum_conf.volumes_used; i++) {
+ struct volume *vol;
+
+ vol = &vinum_conf.volume[i];
+ if (vol->state != volume_unallocated) {
+ if (vol->preferred_plex >= 0) /* preferences, */
+ sprintf(s,
+ "volume %s state %s readpol prefer %s",
+ vol->name,
+ volume_state(vol->state),
+ vinum_conf.plex[vol->preferred_plex].name);
+ else /* default round-robin */
+ sprintf(s,
+ "volume %s state %s",
+ vol->name,
+ volume_state(vol->state));
+ while (*s)
+ s++; /* find the end */
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* Then the plex configuration */
+ for (i = 0; i < vinum_conf.plexes_used; i++) {
+ struct plex *plex;
+
+ plex = &vinum_conf.plex[i];
+ if (plex->state != plex_unallocated) {
+ sprintf(s, "plex name %s state %s org %s ",
+ plex->name,
+ plex_state(plex->state),
+ plex_org(plex->organization));
+ while (*s)
+ s++; /* find the end */
+ if ((plex->organization == plex_striped)
+ ) {
+ sprintf(s, "%db ", (int) plex->stripesize);
+ while (*s)
+ s++; /* find the end */
+ }
+ if (plex->volno >= 0) /* we have a volume */
+ sprintf(s, "vol %s ", vinum_conf.volume[plex->volno].name);
+ while (*s)
+ s++; /* find the end */
+ for (j = 0; j < plex->subdisks; j++) {
+ sprintf(s, " sd %s", vinum_conf.sd[plex->sdnos[j]].name);
+ }
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+
+ /* And finally the subdisk configuration */
+ for (i = 0; i < vinum_conf.subdisks_used; i++) {
+ struct sd *sd = &vinum_conf.sd[i]; /* XXX */
+ if (vinum_conf.sd[i].state != sd_unallocated) {
+ sprintf(s,
+ "sd name %s drive %s plex %s state %s len ",
+ sd->name,
+ vinum_conf.drive[sd->driveno].label.name,
+ vinum_conf.plex[sd->plexno].name,
+ sd_state(sd->state));
+ while (*s)
+ s++; /* find the end */
+ s = lltoa(sd->sectors, s);
+ s = sappend("b driveoffset ", s);
+ s = lltoa(sd->driveoffset, s);
+ s = sappend("b plexoffset ", s);
+ s = lltoa(sd->plexoffset, s);
+ s = sappend("b\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
+ }
+ }
+}
+
+/* Write the configuration to all vinum slices */
+int
+save_config(void)
+{
+ BROKEN_GDB;
+ int error;
+ int written_config; /* set when we firstnwrite the config to disk */
+ int driveno;
+ struct drive *drive; /* point to current drive info */
+ struct vinum_hdr *vhdr; /* and as header */
+ char *config; /* point to config data */
+ int wlabel_on; /* to set writing label on/off */
+
+ /* don't save the configuration while we're still working on it */
+ if (vinum_conf.flags & VF_CONFIGURING)
+ return 0;
+ written_config = 0; /* no config written yet */
+ /* Build a volume header */
+ vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* get space for the config data */
+ CHECKALLOC(vhdr, "Can't allocate config data");
+ vhdr->magic = VINUM_MAGIC; /* magic number */
+ vhdr->config_length = MAXCONFIG; /* length of following config info */
+
+ config = Malloc(MAXCONFIG); /* get space for the config data */
+ CHECKALLOC(config, "Can't allocate config data");
+
+ format_config(config, MAXCONFIG);
+ error = 0; /* no errors yet */
+ for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
+ drive = &vinum_conf.drive[driveno]; /* point to drive */
+
+ if (drive->state != drive_down) {
+#if (__FreeBSD__ >= 3)
+ getmicrotime(&drive->label.last_update); /* time of last update is now */
+#else
+ drive->label.last_update = time; /* time of last update is now */
+#endif
+ bcopy((char *) &drive->label, /* and the label info from the drive structure */
+ (char *) &vhdr->label,
+ sizeof(vhdr->label));
+ if ((drive->state != drive_unallocated)
+ && (drive->state != drive_uninit)) {
+ wlabel_on = 1; /* enable writing the label */
+ error = VOP_IOCTL(drive->vp, /* make the label writeable */
+ DIOCWLABEL,
+ (caddr_t) & wlabel_on,
+ FWRITE,
+ NOCRED,
+ myproc);
+ if (error == 0)
+ error = write_drive(drive, vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
+ if (error == 0)
+ error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET);
+ wlabel_on = 0; /* enable writing the label */
+ VOP_IOCTL(drive->vp, /* make the label non-writeable again */
+ DIOCWLABEL,
+ (caddr_t) & wlabel_on,
+ FWRITE,
+ NOCRED,
+ myproc);
+ if (error) {
+ printf("vinum: Can't write config to %s, error %d\n", drive->devicename, error);
+ set_drive_state(drive->driveno, drive_down, 1);
+ } else
+ written_config = 1; /* we've written it on at least one drive */
+ }
+ }
+ }
+ Free(vhdr);
+ Free(config);
+ return written_config == 0; /* return 1 if we failed to write config */
+}
+
+/* Disk labels are a mess. The correct way to access them
+ * is with the DIOC[GSW]DINFO ioctls, but some programs, such
+ * as newfs, access the disk directly, so we have to write
+ * things there. We do this only on request. If a user
+ * request tries to read it directly, we fake up one on the fly.
+ */
+
+/* get_volume_label returns a label structure to lp, which
+ * is allocated by the caller */
+void
+get_volume_label(struct volume *vol, struct disklabel *lp)
+{
+ bzero(lp, sizeof(struct disklabel));
+
+ strncpy(lp->d_typename, "vinum", sizeof(lp->d_typename));
+ lp->d_type = DTYPE_VINUM;
+ strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
+ lp->d_rpm = 14400 * vol->plexes; /* to keep them guessing */
+ lp->d_interleave = 1;
+ lp->d_flags = 0;
+
+ /* Fitting unto the vine, a vinum has a single
+ * track with all its sectors */
+ lp->d_secsize = DEV_BSIZE; /* bytes per sector */
+ lp->d_nsectors = vol->size; /* data sectors per track */
+ lp->d_ntracks = 1; /* tracks per cylinder */
+ lp->d_ncylinders = 1; /* data cylinders per unit */
+ lp->d_secpercyl = vol->size; /* data sectors per cylinder */
+ lp->d_secperunit = vol->size; /* data sectors per unit */
+
+ lp->d_bbsize = BBSIZE;
+ lp->d_sbsize = SBSIZE;
+
+ lp->d_magic = DISKMAGIC;
+ lp->d_magic2 = DISKMAGIC;
+
+ /* Set up partitions a, b and c to be identical
+ * and the size of the volume. a is UFS, b is
+ * swap, c is nothing */
+ lp->d_partitions[0].p_size = vol->size;
+ lp->d_partitions[0].p_fsize = 1024;
+ lp->d_partitions[0].p_fstype = FS_BSDFFS; /* FreeBSD File System :-) */
+ lp->d_partitions[0].p_fsize = 1024; /* FS fragment size */
+ lp->d_partitions[0].p_frag = 8; /* and fragments per block */
+ lp->d_partitions[SWAP_PART].p_size = vol->size;
+ lp->d_partitions[SWAP_PART].p_fstype = FS_SWAP; /* swap partition */
+ lp->d_partitions[LABEL_PART].p_size = vol->size;
+ lp->d_npartitions = LABEL_PART + 1;
+ strncpy(lp->d_packname, vol->name, min(sizeof(lp->d_packname), sizeof(vol->name)));
+ lp->d_checksum = dkcksum(lp);
+}
+
+int
+write_volume_label(int volno)
+{
+ struct disklabel *lp;
+ struct buf *bp;
+ struct disklabel *dlp;
+ struct volume *vol;
+ int error;
+
+ lp = (struct disklabel *) Malloc((sizeof(struct disklabel) + (DEV_BSIZE - 1)) & (DEV_BSIZE - 1));
+ if (lp == 0)
+ return ENOMEM;
+
+ if ((unsigned) (volno) >= (unsigned) vinum_conf.volumes_used) /* invalid volume */
+ return ENOENT;
+
+ vol = &VOL[volno]; /* volume in question */
+ if (vol->state == volume_unallocated) /* nothing there */
+ return ENOENT;
+
+ get_volume_label(vol, lp); /* get the label */
+
+ /* Now write to disk. This code is derived from the
+ * system writedisklabel (), which does silly things
+ * like reading the label and refusing to write
+ * unless it's already there. */
+ bp = geteblk((int) lp->d_secsize); /* get a buffer */
+ bp->b_dev = minor(vol->devno) | (CDEV_MAJOR << MAJORDEV_SHIFT); /* our own raw volume */
+ bp->b_blkno = LABELSECTOR * ((int) lp->d_secsize / DEV_BSIZE);
+ bp->b_bcount = lp->d_secsize;
+ bzero(bp->b_data, lp->d_secsize);
+ dlp = (struct disklabel *) bp->b_data;
+ *dlp = *lp;
+ bp->b_flags &= ~B_INVAL;
+ bp->b_flags |= B_BUSY | B_WRITE;
+ vinumstrategy(bp); /* write it out */
+ error = biowait(bp);
+ bp->b_flags |= B_INVAL | B_AGE;
+ brelse(bp);
+ return error;
+}
+
+/* Initialize a subdisk */
+int
+initsd(int sdno)
+{
+ return 0;
+}
diff --git a/sys/modules/vinum/lock.c b/sys/modules/vinum/lock.c
new file mode 100644
index 000000000000..ed69649fccdc
--- /dev/null
+++ b/sys/modules/vinum/lock.c
@@ -0,0 +1,137 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: lock.c,v 1.6 1998/07/28 06:32:57 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+
+/* Lock routines. Currently, we lock either an individual volume
+ * or the global configuration. I don't think tsleep and
+ * wakeup are SMP safe. FIXME XXX */
+
+/* Lock a volume, wait if it's in use */
+int
+lockvol(struct volume *vol)
+{
+ int error;
+
+ while ((vol->flags & VF_LOCKED) != 0) {
+ vol->flags |= VF_LOCKING;
+ /* It would seem to make more sense to sleep on
+ * the address 'vol'. Unfortuntaly we can't
+ * guarantee that this address won't change due to
+ * table expansion. The address we choose won't change. */
+ if ((error = tsleep(&vinum_conf.volume + vol->devno,
+ PRIBIO | PCATCH,
+ "volock",
+ 0)) != 0)
+ return error;
+ }
+ vol->flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock a volume and let the next one at it */
+void
+unlockvol(struct volume *vol)
+{
+ vol->flags &= ~VF_LOCKED;
+ if ((vol->flags & VF_LOCKING) != 0) {
+ vol->flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf.volume + vol->devno);
+ }
+}
+
+/* Lock a plex, wait if it's in use */
+int
+lockplex(struct plex *plex)
+{
+ int error;
+
+ while ((plex->flags & VF_LOCKED) != 0) {
+ plex->flags |= VF_LOCKING;
+ /* It would seem to make more sense to sleep on
+ * the address 'plex'. Unfortuntaly we can't
+ * guarantee that this address won't change due to
+ * table expansion. The address we choose won't change. */
+ if ((error = tsleep(&vinum_conf.plex + plex->sdnos[0],
+ PRIBIO | PCATCH,
+ "plexlk",
+ 0)) != 0)
+ return error;
+ }
+ plex->flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock a plex and let the next one at it */
+void
+unlockplex(struct plex *plex)
+{
+ plex->flags &= ~VF_LOCKED;
+ if ((plex->flags & VF_LOCKING) != 0) {
+ plex->flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf.plex + plex->plexno);
+ }
+}
+
+
+/* Get a lock for the global config, wait if it's not available */
+int
+lock_config(void)
+{
+ int error;
+
+ while ((vinum_conf.flags & VF_LOCKED) != 0) {
+ vinum_conf.flags |= VF_LOCKING;
+ if ((error = tsleep(&vinum_conf, PRIBIO | PCATCH, "vincfg", 0)) != 0)
+ return error;
+ }
+ vinum_conf.flags |= VF_LOCKED;
+ return 0;
+}
+
+/* Unlock and wake up any waiters */
+void
+unlock_config(void)
+{
+ vinum_conf.flags &= ~VF_LOCKED;
+ if ((vinum_conf.flags & VF_LOCKING) != 0) {
+ vinum_conf.flags &= ~VF_LOCKING;
+ wakeup(&vinum_conf);
+ }
+}
diff --git a/sys/modules/vinum/makestatetext b/sys/modules/vinum/makestatetext
new file mode 100755
index 000000000000..ca5eb2dc3c3d
--- /dev/null
+++ b/sys/modules/vinum/makestatetext
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Make statetexts.h from vinumstate.h
+# $Id: makestatetext,v 1.4 1998/03/13 05:36:16 grog Exp grog $
+infile=vinumstate.h
+ofile=statetexts.h
+cat <COPYRIGHT > $ofile
+
+echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
+echo >>$ofile
+echo >>$ofile "/* Drive state texts */"
+echo >>$ofile "char *drivestatetext [] =
+ { "
+egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Subdisk state texts */
+char *sdstatetext [] =
+ {
+FOO
+egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Plex state texts */
+char *plexstatetext [] =
+ {
+FOO
+egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Volume state texts */
+char *volstatetext [] =
+ {
+FOO
+egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+FOO
diff --git a/sys/modules/vinum/memory.c b/sys/modules/vinum/memory.c
new file mode 100644
index 000000000000..5dee671167b0
--- /dev/null
+++ b/sys/modules/vinum/memory.c
@@ -0,0 +1,186 @@
+
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: memory.c,v 1.16 1998/08/08 04:43:22 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#define USES_VM
+#include "vinumhdr.h"
+
+extern jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+void freedatabuf(struct mc *me);
+caddr_t allocdatabuf(struct mc *me);
+
+void
+expand_table(void **table, int oldsize, int newsize)
+{
+ if (newsize > oldsize) {
+ int *temp;
+
+ temp = (int *) Malloc(newsize); /* allocate a new table */
+ CHECKALLOC(temp, "vinum: Can't expand table\n");
+ if (*table != NULL) { /* already something there, */
+ bcopy((char *) *table, (char *) temp, oldsize); /* copy it to the old table */
+ Free(*table);
+ }
+ *table = temp;
+ }
+}
+
+#ifndef DEBUG
+/* increase the size of a request block */
+void
+expandrq(struct plexrq *prq)
+{
+ expand_table((void **) &prq->rqe,
+ prq->requests * sizeof(struct rqelement),
+ (prq->requests + RQELTS) * sizeof(struct rqelement));
+ bzero(&prq->rqe[prq->requests], RQELTS * sizeof(struct rqelement)); /* clear the new part */
+ prq->rqcount += RQELTS;
+}
+
+#endif
+
+#if DEBUG /* XXX debug */
+#define MALLOCENTRIES 16384
+int malloccount = 0;
+int highwater = 0; /* highest index ever allocated */
+static struct mc malloced[MALLOCENTRIES];
+
+static total_malloced;
+
+caddr_t
+MMalloc(int size, char *file, int line)
+{
+ caddr_t result;
+ int i;
+ static int seq = 0;
+ int s;
+ struct mc me; /* information to pass to allocdatabuf */
+
+ if (malloccount >= MALLOCENTRIES) { /* too many */
+ printf("vinum: can't allocate table space to trace memory allocation");
+ return 0; /* can't continue */
+ }
+ result = malloc(size, M_DEVBUF, M_WAITOK); /* use malloc for smaller and irregular stuff */
+ if (result == NULL)
+ printf("vinum: can't allocate %d bytes from %s:%d\n", size, file, line);
+ else {
+ me.flags = 0; /* allocation via malloc */
+ s = splhigh();
+ for (i = 0; i < malloccount; i++) {
+ if (((result + size) > malloced[i].address)
+ && (result < malloced[i].address + malloced[i].size)) /* overlap */
+ Debugger("Malloc overlap");
+ }
+ if (result) {
+ i = malloccount++;
+ total_malloced += size;
+ malloced[i].address = result;
+ malloced[i].size = size;
+ malloced[i].line = line;
+ malloced[i].seq = seq++;
+ malloced[i].flags = me.flags;
+ malloced[i].databuf = me.databuf; /* only used with kva alloc */
+ bcopy(file, malloced[i].file, min(strlen(file) + 1, 16));
+ }
+ if (malloccount > highwater)
+ highwater = malloccount;
+ splx(s);
+ }
+ return result;
+}
+
+void
+FFree(void *mem, char *file, int line)
+{
+ int i;
+ int s;
+
+ s = splhigh();
+ for (i = 0; i < malloccount; i++) {
+ if ((caddr_t) mem == malloced[i].address) { /* found it */
+ bzero(mem, malloced[i].size); /* XXX */
+ free(mem, M_DEVBUF);
+ malloccount--;
+ total_malloced -= malloced[i].size;
+ if (i < malloccount) /* more coming after */
+ bcopy(&malloced[i + 1], &malloced[i], (malloccount - i) * sizeof(struct mc));
+ splx(s);
+ return;
+ }
+ }
+ splx(s);
+ printf("Freeing unallocated data at 0x%08x from %s, line %d\n", (int) mem, file, line);
+ Debugger("Free");
+}
+
+void
+vinum_meminfo(caddr_t data)
+{
+ struct meminfo *m = (struct meminfo *) data;
+
+ m->mallocs = malloccount;
+ m->total_malloced = total_malloced;
+ m->malloced = malloced;
+ m->highwater = highwater;
+}
+
+int
+vinum_mallocinfo(caddr_t data)
+{
+ struct mc *m = (struct mc *) data;
+ unsigned int ent = *(int *) data; /* 1st word is index */
+
+ if (ent >= malloccount)
+ return ENOENT;
+ m->address = malloced[ent].address;
+ m->size = malloced[ent].size;
+ m->line = malloced[ent].line;
+ m->seq = malloced[ent].seq;
+ bcopy(malloced[ent].file, m->file, 16);
+ return 0;
+}
+
+#endif
diff --git a/sys/modules/vinum/parser.c b/sys/modules/vinum/parser.c
new file mode 100644
index 000000000000..9e7f791a7d14
--- /dev/null
+++ b/sys/modules/vinum/parser.c
@@ -0,0 +1,206 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: parser.c,v 1.11 1998/08/10 08:50:42 grog Exp grog $
+ */
+
+/* This file contains the parser for the configuration routines. It's used
+ * both in the kernel and in the user interface program, thus the separate file. */
+
+/* Go through a text and split up into text tokens. These are either non-blank
+ * sequences, or any sequence (except \0) enclosed in ' or ". Embedded ' or
+ * " characters may be escaped by \, which otherwise has no special meaning.
+ *
+ * Delimit by following with a \0, and return pointers to the starts at token [].
+ * Return the number of tokens found as the return value.
+ *
+ * This method has the restriction that a closing " or ' must be followed by
+ * grey space.
+ *
+ * Error conditions are end of line before end of quote, or no space after
+ * a closing quote. In this case, tokenize() returns -1. */
+
+#include <sys/param.h>
+#ifdef KERNEL
+#undef KERNEL /* XXX */
+#define REALLYKERNEL
+#else
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#endif
+/* All this mess for a single struct definition */
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/disklabel.h>
+#include <sys/mount.h>
+#include <sys/device.h>
+#include <sys/disk.h>
+#include "sys/buf.h"
+
+#include <vinumvar.h>
+#include "vinumkw.h"
+#include "vinumio.h"
+#include "vinumext.h"
+
+#ifdef REALLYKERNEL
+#define isspace(c) ((c == ' ') || (c == '\t')) /* check for white space */
+#else /* get it from the headers */
+#include <ctype.h>
+#endif
+
+/* enum keyword is defined in vinumvar.h */
+
+#define keypair(x) { #x, kw_##x } /* create pair "foo", kw_foo */
+#define flagkeypair(x) { "-"#x, kw_##x } /* create pair "-foo", kw_foo */
+#define KEYWORDSET(x) {sizeof (x) / sizeof (struct _keywords), x}
+
+/* Normal keywords. These are all the words that vinum knows. */
+struct _keywords keywords[] =
+{keypair(drive),
+ keypair(sd),
+ keypair(subdisk),
+ keypair(plex),
+ keypair(volume),
+ keypair(vol),
+ keypair(setupstate),
+ keypair(readpol),
+ keypair(org),
+ keypair(name),
+ keypair(writethrough),
+ keypair(writeback),
+ keypair(raw),
+ keypair(device),
+ keypair(concat),
+ keypair(raid5),
+ keypair(striped),
+ keypair(plexoffset),
+ keypair(driveoffset),
+ keypair(length),
+ keypair(len),
+ keypair(state),
+ keypair(round),
+ keypair(prefer),
+ keypair(rename),
+ keypair(detached),
+#ifndef KERNEL /* for vinum(8) only */
+#ifdef DEBUG
+ keypair(debug),
+#endif
+ keypair(attach),
+ keypair(detach),
+ keypair(printconfig),
+ keypair(replace),
+ keypair(create),
+ keypair(read),
+ keypair(modify),
+ keypair(list),
+ keypair(l),
+ keypair(ld),
+ keypair(ls),
+ keypair(lp),
+ keypair(lv),
+ keypair(info),
+ keypair(set),
+ keypair(rm),
+ keypair(init),
+ keypair(label),
+ keypair(resetconfig),
+ keypair(start),
+ keypair(stop),
+ keypair(resetstats)
+#endif
+};
+struct keywordset keyword_set = KEYWORDSET(keywords);
+
+#ifndef KERNEL
+struct _keywords flag_keywords[] =
+{flagkeypair(f),
+ flagkeypair(d),
+ flagkeypair(v),
+ flagkeypair(s),
+ flagkeypair(r)
+};
+struct keywordset flag_set = KEYWORDSET(flag_keywords);
+
+#endif
+
+int
+tokenize(char *cptr, char *token[])
+{
+ char delim; /* delimiter for searching for the partner */
+ int tokennr; /* index of this token */
+ tokennr = 0; /* none found yet */
+
+ for (;;) {
+ while (isspace(*cptr))
+ cptr++; /* skip initial white space */
+ if ((*cptr == '\0') || (*cptr == '\n') || (*cptr == '#')) /* end of line */
+ return tokennr; /* return number of tokens found */
+ delim = *cptr;
+ token[tokennr] = cptr; /* point to it */
+ tokennr++; /* one more */
+ /* XXX this is broken. It leaves superfluous \\ characters in the text */
+ if ((delim == '\'') || (delim == '"')) { /* delimitered */
+ for (;;) {
+ cptr++;
+ if ((*cptr == delim) && (cptr[-1] != '\\')) { /* found the partner */
+ cptr++; /* move on past */
+ if (!isspace(*cptr)) /* error, no space after closing quote */
+ return -1;
+ *cptr++ = '\0'; /* delimit */
+ } else if ((*cptr == '\0') || (*cptr == '\n')) /* end of line */
+ return -1;
+ }
+ } else { /* not quoted */
+ while ((*cptr != '\0') && (!isspace(*cptr)) && (*cptr != '\n'))
+ cptr++;
+ if (*cptr != '\0') /* not end of the line, */
+ *cptr++ = '\0'; /* delimit and move to the next */
+ }
+ }
+}
+
+/* Find a keyword and return an index */
+enum keyword
+get_keyword(char *name, struct keywordset *keywordset)
+{
+ int i;
+ struct _keywords *keywords = keywordset->k; /* point to the keywords */
+ for (i = 0; i < keywordset->size; i++)
+ if (!strcmp(name, keywords[i].name))
+ return (enum keyword) keywords[i].keyword;
+ return kw_invalid_keyword;
+}
diff --git a/sys/modules/vinum/request.c b/sys/modules/vinum/request.c
new file mode 100644
index 000000000000..589eb3fac0ba
--- /dev/null
+++ b/sys/modules/vinum/request.c
@@ -0,0 +1,882 @@
+/* XXX to do:
+
+ * Decide where we need splbio ()
+ */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: request.c,v 1.17 1998/08/13 06:04:47 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+#include <miscfs/specfs/specdev.h>
+#include <sys/resourcevar.h>
+
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
+
+enum requeststatus bre(struct request *rq,
+ int plexno,
+ daddr_t * diskstart,
+ daddr_t diskend);
+enum requeststatus bre5(struct request *rq,
+ int plexno,
+ daddr_t * diskstart,
+ daddr_t diskend);
+enum requeststatus build_read_request(struct request *rq, int volplexno);
+enum requeststatus build_write_request(struct request *rq);
+enum requeststatus build_rq_buffer(struct rqelement *rqe, struct plex *plex);
+void freerq(struct request *rq);
+void free_rqg(struct rqgroup *rqg);
+int find_alternate_sd(struct request *rq);
+int check_range_covered(struct request *);
+void complete_rqe(struct buf *bp);
+void complete_raid5_write(struct rqelement *);
+int abortrequest(struct request *rq, int error);
+void sdio(struct buf *bp);
+void sdio_done(struct buf *bp);
+int vinum_bounds_check(struct buf *bp, struct volume *vol);
+caddr_t allocdatabuf(struct rqelement *rqe);
+void freedatabuf(struct rqelement *rqe);
+
+void
+vinumstrategy(struct buf *bp)
+{
+ BROKEN_GDB;
+ int volno;
+ struct volume *vol = NULL;
+ int s;
+ struct devcode *device = (struct devcode *) &bp->b_dev; /* decode device number */
+ enum requeststatus status;
+
+ switch (device->type) {
+ case VINUM_SD_TYPE:
+ sdio(bp);
+ return;
+
+ /* In fact, vinum doesn't handle drives: they're
+ * handled directly by the disk drivers */
+ case VINUM_DRIVE_TYPE:
+ default:
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+
+ case VINUM_VOLUME_TYPE: /* volume I/O */
+ volno = VOLNO(bp->b_dev);
+ vol = &VOL[volno];
+ if (vol->state != volume_up) { /* can't access this volume */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+ }
+ if (vinum_bounds_check(bp, vol) <= 0) { /* don't like them bounds */
+ biodone(bp); /* have nothing to do with this */
+ return;
+ }
+ /* FALLTHROUGH */
+ /* Plex I/O is pretty much the same as volume I/O
+ * for a single plex. Indicate this by passing a NULL
+ * pointer (set above) for the volume */
+ case VINUM_PLEX_TYPE:
+ bp->b_resid = bp->b_bcount; /* transfer everything */
+ vinumstart(bp, 0);
+ return;
+ }
+}
+
+/* Start a transfer. Return -1 on error,
+ * 0 if OK, 1 if we need to retry.
+ * Parameter reviveok is set when doing
+ * transfers for revives: it allows transfers to
+ * be started immediately when a revive is in
+ * progress. During revive, normal transfers
+ * are queued if they share address space with
+ * a currently active revive operation. */
+int
+vinumstart(struct buf *bp, int reviveok)
+{
+ BROKEN_GDB;
+ int plexno;
+ int maxplex; /* maximum number of plexes to handle */
+ struct volume *vol;
+ struct rqgroup *rqg; /* current plex's requests */
+ struct rqelement *rqe; /* individual element */
+ struct request *rq; /* build up our request here */
+ int rqno; /* index in request list */
+ enum requeststatus status;
+
+ /* XXX In these routines, we're assuming that
+ * we will always be called with bp->b_bcount
+ * which is a multiple of the sector size. This
+ * is a reasonable assumption, since we are only
+ * called from system routines. Should we check
+ * anyway? */
+
+ if ((bp->b_bcount % DEV_BSIZE) != 0) { /* bad length */
+ bp->b_error = EINVAL; /* invalid size */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return -1;
+ }
+ rq = (struct request *) Malloc(sizeof(struct request)); /* allocate a request struct */
+ if (rq == NULL) { /* can't do it */
+ bp->b_error = ENOMEM; /* can't get memory */
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return -1;
+ }
+ bzero(rq, sizeof(struct request));
+
+ /* Note the volume ID. This can be NULL, which
+ * the request building functions use as an
+ * indication for single plex I/O */
+ rq->bp = bp; /* and the user buffer struct */
+
+ if (DEVTYPE(bp->b_dev) == VINUM_VOLUME_TYPE) { /* it's a volume, */
+ rq->volplex.volno = VOLNO(bp->b_dev); /* get the volume number */
+ vol = &VOL[rq->volplex.volno]; /* and point to it */
+ vol->active++; /* one more active request */
+ maxplex = vol->plexes; /* consider all its plexes */
+ } else {
+ vol = NULL; /* no volume */
+ rq->volplex.plexno = PLEXNO(bp->b_dev); /* point to the plex */
+ rq->isplex = 1; /* note that it's a plex */
+ maxplex = 1; /* just the one plex */
+ }
+
+ if (bp->b_flags & B_READ) {
+ /* This is a read request. Decide
+ * which plex to read from.
+ *
+ * There's a potential race condition here,
+ * since we're not locked, and we could end
+ * up multiply incrementing the round-robin
+ * counter. This doesn't have any serious
+ * effects, however. */
+ if (vol != NULL) {
+ vol->reads++;
+ vol->bytes_read += bp->b_bcount;
+ plexno = vol->preferred_plex; /* get the plex to use */
+ if (plexno < 0) { /* round robin */
+ plexno = vol->last_plex_read;
+ vol->last_plex_read++;
+ if (vol->last_plex_read == vol->plexes) /* got the the end? */
+ vol->last_plex_read = 0; /* wrap around */
+ }
+ status = build_read_request(rq, plexno); /* build a request */
+ } else {
+ daddr_t diskaddr = bp->b_blkno; /* start offset of transfer */
+ status = bre(rq, /* build a request list */
+ rq->volplex.plexno,
+ &diskaddr,
+ diskaddr + (bp->b_bcount / DEV_BSIZE));
+ }
+
+ if ((status > REQUEST_RECOVERED) /* can't satisfy it */
+ ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
+ if (status == REQUEST_DOWN) { /* not enough subdisks */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ }
+ biodone(bp);
+ freerq(rq);
+ return -1;
+ }
+ return launch_requests(rq, reviveok); /* now start the requests if we can */
+ } else
+ /* This is a write operation. We write to all
+ * plexes. If this is a RAID 5 plex, we must also
+ * update the parity stripe. */
+ {
+ if (vol != NULL) {
+ vol->writes++;
+ vol->bytes_written += bp->b_bcount;
+ status = build_write_request(rq); /* Not all the subdisks are up */
+ } else { /* plex I/O */
+ daddr_t diskstart;
+
+ diskstart = bp->b_blkno; /* start offset of transfer */
+ status = bre(rq,
+ PLEXNO(bp->b_dev),
+ &diskstart,
+ bp->b_blkno + (bp->b_bcount / DEV_BSIZE)); /* build requests for the plex */
+ }
+ if ((status > REQUEST_RECOVERED) /* can't satisfy it */
+ ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */
+ if (status == REQUEST_DOWN) { /* not enough subdisks */
+ bp->b_error = EIO; /* I/O error */
+ bp->b_flags |= B_ERROR;
+ }
+ if ((bp->b_flags & B_DONE) == 0)
+ biodone(bp);
+ freerq(rq);
+ return -1;
+ }
+ return launch_requests(rq, reviveok); /* start the requests */
+ }
+}
+
+/* Call the low-level strategy routines to
+ * perform the requests in a struct request */
+int
+launch_requests(struct request *rq, int reviveok)
+{
+ struct rqgroup *rqg;
+ int rqno; /* loop index */
+ struct rqelement *rqe; /* current element */
+ int s;
+
+ /* First find out whether we're reviving, and the
+ * request contains a conflict. If so, we hang
+ * the request off plex->waitlist of the first
+ * plex we find which is reviving */
+ if ((rq->flags & XFR_REVIVECONFLICT) /* possible revive conflict */
+ &&(!reviveok)) { /* and we don't want to do it now, */
+ struct volume *vol = &VOL[VOLNO(rq->bp->b_dev)];
+ struct plex *plex;
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) { /* find the reviving plex */
+ plex = &PLEX[vol->plex[plexno]];
+ if (plex->state == plex_reviving) /* found it */
+ break;
+ }
+ if (plexno < vol->plexes) { /* found it? */
+ struct request *waitlist = plex->waitlist; /* point to the waiting list */
+
+ while (waitlist->next != NULL) /* find the end */
+ waitlist = waitlist->next;
+ waitlist->next = rq; /* hook our request there */
+ return 0; /* and get out of here */
+ } else /* bad vinum, bad */
+ printf("vinum: can't find reviving plex for volume %s\n", vol->name);
+ }
+ rq->active = 0; /* nothing yet */
+ /* XXX This is probably due to a bug */
+ if (rq->rqg == NULL) { /* no request */
+ abortrequest(rq, EINVAL);
+ return -1;
+ }
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf("Request: %x\nWrite dev 0x%x, offset 0x%x, length %ld\n",
+ (u_int) rq,
+ rq->bp->b_dev,
+ rq->bp->b_blkno,
+ rq->bp->b_bcount); /* XXX */
+ vinum_conf.lastrq = (int) rq;
+ vinum_conf.lastbuf = rq->bp;
+#endif
+ for (rqg = rq->rqg; rqg != NULL; rqg = rqg->next) { /* through the whole request chain */
+ rqg->active = rqg->count; /* they're all active */
+ rq->active++; /* one more active request group */
+ for (rqno = 0; rqno < rqg->count; rqno++) {
+ rqe = &rqg->rqe[rqno];
+ if (rqe->flags & XFR_BAD_SUBDISK) /* this subdisk is bad, */
+ rqg->active--; /* one less active request */
+ else {
+ struct drive *drive = &DRIVE[rqe->driveno]; /* drive to access */
+ if ((rqe->b.b_flags & B_READ) == 0)
+ rqe->b.b_vp->v_numoutput++; /* one more output going */
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
+ rqe->b.b_flags & B_READ ? "Read" : "Write",
+ rqe->b.b_dev,
+ rqe->sdno,
+ (u_int) (rqe->b.b_blkno - SD[rqe->sdno].driveoffset),
+ rqe->b.b_blkno,
+ rqe->b.b_bcount); /* XXX */
+ if (debug & DEBUG_NUMOUTPUT)
+ printf(" vinumstart sd %d numoutput %ld\n",
+ rqe->sdno,
+ rqe->b.b_vp->v_numoutput);
+#endif
+ /* fire off the request */
+ s = splbio();
+ (*bdevsw[major(rqe->b.b_dev)]->d_strategy) (&rqe->b);
+ splx(s);
+ }
+ /* XXX Do we need caching? Think about this more */
+ }
+ }
+ return 0;
+}
+
+/* define the low-level requests needed to perform a
+ * high-level I/O operation for a specific plex 'plexno'.
+ *
+ * Return 0 if all subdisks involved in the request are up, 1 if some
+ * subdisks are not up, and -1 if the request is at least partially
+ * outside the bounds of the subdisks.
+ *
+ * Modify the pointer *diskstart to point to the end address. On
+ * read, return on the first bad subdisk, so that the caller
+ * (build_read_request) can try alternatives.
+ *
+ * On entry to this routine, the rqg structures are not assigned. The
+ * assignment is performed by expandrq(). Strictly speaking, the
+ * elements rqe->sdno of all entries should be set to -1, since 0
+ * (from bzero) is a valid subdisk number. We avoid this problem by
+ * initializing the ones we use, and not looking at the others (index
+ * >= rqg->requests).
+ */
+enum requeststatus
+bre(struct request *rq,
+ int plexno,
+ daddr_t * diskaddr,
+ daddr_t diskend)
+{
+ BROKEN_GDB;
+ int sdno;
+ struct sd *sd;
+ struct rqgroup *rqg;
+ struct buf *bp; /* user's bp */
+ struct plex *plex;
+ enum requeststatus status; /* return value */
+ daddr_t plexoffset; /* offset of transfer in plex */
+ daddr_t stripebase; /* base address of stripe (1st subdisk) */
+ daddr_t stripeoffset; /* offset in stripe */
+ daddr_t blockoffset; /* offset in stripe on subdisk */
+ struct rqelement *rqe; /* point to this request information */
+ daddr_t diskstart = *diskaddr; /* remember where this transfer starts */
+
+ bp = rq->bp; /* buffer pointer */
+ status = REQUEST_OK; /* return value: OK until proven otherwise */
+ plex = &PLEX[plexno]; /* point to the plex */
+
+ switch (plex->organization) {
+ case plex_concat:
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ if ((*diskaddr < (sd->plexoffset + sd->sectors)) /* The request starts before the end of this */
+ &&(diskend > sd->plexoffset)) { /* subdisk and ends after the start of this sd */
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
+ enum requeststatus s;
+
+ s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
+ if (s) /* give up? */
+ return s; /* yup */
+ }
+ rqg = allocrqg(rq, 1); /* space for the request */
+ if (rqg == NULL) { /* malloc failed */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM;
+ }
+ rqg->plexno = plexno;
+
+ rqe = &rqg->rqe[0]; /* point to the element */
+ rqe->rqg = rqg; /* group */
+ rqe->sdno = sd->sdno; /* put in the subdisk number */
+ plexoffset = max(sd->plexoffset, *diskaddr); /* start offset in plex */
+ rqe->sdoffset = plexoffset - sd->plexoffset; /* start offset in subdisk */
+ rqe->useroffset = plexoffset - diskstart; /* start offset in user buffer */
+ rqe->dataoffset = 0;
+ rqe->datalen = min(diskend - *diskaddr, /* number of sectors to transfer in this sd */
+ sd->sectors - rqe->sdoffset);
+ rqe->groupoffset = 0; /* no groups for concatenated plexes */
+ rqe->grouplen = 0;
+ rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
+ rqe->flags = 0;
+ rqe->driveno = sd->driveno;
+ *diskaddr += rqe->datalen; /* bump the address */
+ if (build_rq_buffer(rqe, plex)) { /* build the buffer */
+ deallocrqg(rqg);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM; /* can't do it */
+ }
+ }
+ if (*diskaddr > diskend) /* we're finished, */
+ break; /* get out of here */
+ }
+ break;
+
+ case plex_striped:
+ {
+ while (*diskaddr < diskend) { /* until we get it all sorted out */
+ /* The offset of the start address from
+ * the start of the stripe */
+ stripeoffset = *diskaddr % (plex->stripesize * plex->subdisks);
+
+ /* The plex-relative address of the
+ * start of the stripe */
+ stripebase = *diskaddr - stripeoffset;
+
+ /* The number of the subdisk in which
+ * the start is located */
+ sdno = stripeoffset / plex->stripesize;
+
+ /* The offset from the beginning of the stripe
+ * on this subdisk */
+ blockoffset = stripeoffset % plex->stripesize;
+
+ sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
+ enum requeststatus s;
+
+ s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
+ if (s) /* give up? */
+ return s; /* yup */
+ }
+ rqg = allocrqg(rq, 1); /* space for the request */
+ if (rqg == NULL) { /* malloc failed */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM;
+ }
+ rqg->plexno = plexno;
+
+ rqe = &rqg->rqe[0]; /* point to the element */
+ rqe->rqg = rqg;
+ rqe->sdoffset = stripebase / plex->subdisks + blockoffset; /* start offset in this subdisk */
+ rqe->useroffset = *diskaddr - diskstart; /* The offset of the start in the user buffer */
+ rqe->dataoffset = 0;
+ rqe->datalen = min(diskend - *diskaddr, /* the amount remaining to transfer */
+ plex->stripesize - blockoffset); /* and the amount left in this stripe */
+ rqe->groupoffset = 0; /* no groups for striped plexes */
+ rqe->grouplen = 0;
+ rqe->buflen = rqe->datalen; /* buffer length is data buffer length */
+ rqe->flags = 0;
+ rqe->sdno = sd->sdno; /* put in the subdisk number */
+ rqe->driveno = sd->driveno;
+
+ if (rqe->sdoffset >= sd->sectors) { /* starts beyond the end of the subdisk? */
+ deallocrqg(rqg);
+ return REQUEST_EOF;
+ } else if (rqe->sdoffset + rqe->datalen > sd->sectors) /* ends beyond the end of the subdisk? */
+ rqe->datalen = sd->sectors - rqe->sdoffset; /* yes, truncate */
+
+ if (build_rq_buffer(rqe, plex)) { /* build the buffer */
+ deallocrqg(rqg);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return REQUEST_ENOMEM; /* can't do it */
+ }
+ *diskaddr += rqe->datalen; /* look at the remainder */
+ if (*diskaddr < diskend) { /* didn't finish the request on this stripe */
+ plex->multiblock++; /* count another one */
+ if (sdno == plex->subdisks - 1) /* last subdisk, */
+ plex->multistripe++; /* another stripe as well */
+ }
+ }
+ }
+ break;
+
+
+ default:
+ printf("vinum: invalid plex type in bre");
+ }
+
+ return status;
+}
+
+/* Build up a request structure for reading volumes.
+ * This function is not needed for plex reads, since there's
+ * no recovery if a plex read can't be satisified. */
+enum requeststatus
+build_read_request(struct request *rq, /* request */
+ int plexindex)
+{ /* index in the volume's plex table */
+ BROKEN_GDB;
+ struct buf *bp;
+ daddr_t startaddr; /* offset of previous part of transfer */
+ daddr_t diskaddr; /* offset of current part of transfer */
+ daddr_t diskend; /* and end offset of transfer */
+ int plexno; /* plex index in vinum_conf */
+ struct rqgroup *rqg; /* point to the request we're working on */
+ struct volume *vol; /* volume in question */
+ off_t oldstart; /* note where we started */
+ int recovered = 0; /* set if we recover a read */
+ enum requeststatus status = REQUEST_OK;
+
+ bp = rq->bp; /* buffer pointer */
+ diskaddr = bp->b_blkno; /* start offset of transfer */
+ diskend = diskaddr + (bp->b_bcount / DEV_BSIZE); /* and end offset of transfer */
+ rqg = &rq->rqg[plexindex]; /* plex request */
+ vol = &VOL[rq->volplex.volno]; /* point to volume */
+
+ while (diskaddr < diskend) { /* build up request components */
+ startaddr = diskaddr;
+ status = bre(rq, vol->plex[plexindex], &diskaddr, diskend); /* build up a request */
+ switch (status) {
+ case REQUEST_OK:
+ continue;
+
+ case REQUEST_RECOVERED:
+ recovered = 1;
+ break;
+
+ case REQUEST_EOF:
+ case REQUEST_ENOMEM:
+ return status;
+
+ /* if we get here, we have either had a failure or
+ * a RAID 5 recovery. We don't want to use the
+ * recovery, because it's expensive, so first we
+ * check if we have alternatives */
+ case REQUEST_DOWN: /* can't access the plex */
+ if (vol != NULL) { /* and this is volume I/O */
+ /* Try to satisfy the request
+ * from another plex */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ diskaddr = startaddr; /* start at the beginning again */
+ oldstart = startaddr; /* and note where that was */
+ if (plexno != plexindex) { /* don't try this plex again */
+ bre(rq, vol->plex[plexno], &diskaddr, diskend); /* try a request */
+ if (diskaddr > oldstart) { /* we satisfied another part */
+ recovered = 1; /* we recovered from the problem */
+ status = REQUEST_OK; /* don't complain about it */
+ break;
+ }
+ }
+ if (plexno == (vol->plexes - 1)) /* couldn't satisfy the request */
+ return REQUEST_DOWN; /* failed */
+ }
+ } else
+ return REQUEST_DOWN; /* bad luck */
+ }
+ if (recovered)
+ vol->recovered_reads += recovered; /* adjust our recovery count */
+ }
+ return status;
+}
+
+/* Build up a request structure for writes.
+ * Return 0 if all subdisks involved in the request are up, 1 if some
+ * subdisks are not up, and -1 if the request is at least partially
+ * outside the bounds of the subdisks. */
+enum requeststatus
+build_write_request(struct request *rq)
+{ /* request */
+ BROKEN_GDB;
+ struct buf *bp;
+ daddr_t diskstart; /* offset of current part of transfer */
+ daddr_t diskend; /* and end offset of transfer */
+ int plexno; /* plex index in vinum_conf */
+ struct volume *vol; /* volume in question */
+ enum requeststatus status;
+
+ bp = rq->bp; /* buffer pointer */
+ vol = &VOL[rq->volplex.volno]; /* point to volume */
+ diskend = bp->b_blkno + (bp->b_bcount / DEV_BSIZE); /* end offset of transfer */
+ status = REQUEST_OK;
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ diskstart = bp->b_blkno; /* start offset of transfer */
+ status = min(status, bre(rq, /* build requests for the plex */
+ vol->plex[plexno],
+ &diskstart,
+ diskend));
+ }
+ return status;
+}
+
+/* Fill in the struct buf part of a request element. */
+enum requeststatus
+build_rq_buffer(struct rqelement *rqe, struct plex *plex)
+{
+ BROKEN_GDB;
+ struct sd *sd; /* point to subdisk */
+ struct volume *vol;
+ struct buf *bp;
+ struct buf *ubp; /* user (high level) buffer header */
+
+ vol = &VOL[rqe->rqg->rq->volplex.volno];
+ sd = &SD[rqe->sdno]; /* point to subdisk */
+ bp = &rqe->b;
+ ubp = rqe->rqg->rq->bp; /* pointer to user buffer header */
+
+ /* Initialize the buf struct */
+ bzero(&rqe->b, sizeof(struct buf));
+ bp->b_proc = ubp->b_proc; /* process pointer */
+ bp->b_flags = ubp->b_flags & (B_NOCACHE | B_READ | B_ASYNC); /* copy these flags from user bp */
+ bp->b_flags |= B_CALL | B_BUSY; /* inform us when it's done */
+ if (plex->state == plex_reviving)
+ bp->b_flags |= B_ORDERED; /* keep request order if we're reviving */
+ bp->b_iodone = complete_rqe; /* by calling us here */
+ bp->b_dev = DRIVE[rqe->driveno].dev; /* drive device */
+ bp->b_blkno = rqe->sdoffset + sd->driveoffset; /* start address */
+ bp->b_bcount = rqe->buflen << DEV_BSHIFT; /* number of bytes to transfer */
+ bp->b_resid = bp->b_bcount; /* and it's still all waiting */
+ bp->b_bufsize = bp->b_bcount; /* and buffer size */
+ bp->b_vp = DRIVE[rqe->driveno].vp; /* drive vnode */
+ bp->b_rcred = FSCRED; /* we have the file system credentials */
+ bp->b_wcred = FSCRED; /* we have the file system credentials */
+
+ if (rqe->flags & XFR_MALLOCED) { /* this operation requires a malloced buffer */
+ bp->b_data = Malloc(bp->b_bcount); /* get a buffer to put it in */
+ if (bp->b_data == NULL) { /* failed */
+ Debugger("XXX");
+ abortrequest(rqe->rqg->rq, ENOMEM);
+ return REQUEST_ENOMEM; /* no memory */
+ }
+ } else
+ /* Point directly to user buffer data. This means
+ * that we don't need to do anything when we have
+ * finished the transfer */
+ bp->b_data = ubp->b_data + rqe->useroffset * DEV_BSIZE;
+ return 0;
+}
+/* Abort a request: free resources and complete the
+ * user request with the specified error */
+int
+abortrequest(struct request *rq, int error)
+{
+ struct buf *bp = rq->bp; /* user buffer */
+
+ bp->b_flags |= B_ERROR;
+ bp->b_error = error;
+ freerq(rq); /* free everything we're doing */
+ biodone(bp);
+ return error; /* and give up */
+}
+
+/* Check that our transfer will cover the
+ * complete address space of the user request.
+ *
+ * Return 1 if it can, otherwise 0 */
+int
+check_range_covered(struct request *rq)
+{
+ /* XXX */
+ return 1;
+}
+
+/* Perform I/O on a subdisk */
+void
+sdio(struct buf *bp)
+{
+ int s; /* spl */
+ struct sd *sd;
+ struct sdbuf *sbp;
+ daddr_t endoffset;
+ struct drive *drive;
+
+ sd = &SD[SDNO(bp->b_dev)]; /* point to the subdisk */
+ drive = &DRIVE[sd->driveno];
+
+ if (drive->state != drive_up) { /* XXX until we get the states fixed */
+ set_sd_state(SDNO(bp->b_dev), sd_obsolete, setstate_force);
+ bp->b_flags |= B_ERROR;
+ bp->b_error = EIO;
+ biodone(bp);
+ return;
+ }
+ /* XXX decide which states we will really accept here. up
+ * implies it could be involved with a plex, in which
+ * case we don't want to dick with it */
+ if ((sd->state != sd_up)
+ && (sd->state != sd_initializing)
+ && (sd->state != sd_reborn)) { /* we can't access it */
+ bp->b_flags |= B_ERROR;
+ bp->b_flags = EIO;
+ if (bp->b_flags & B_BUSY) /* XXX why isn't this always the case? */
+ biodone(bp);
+ return;
+ }
+ /* Get a buffer */
+ sbp = (struct sdbuf *) Malloc(sizeof(struct sdbuf));
+ if (sbp == NULL) {
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOMEM;
+ biodone(bp);
+ return;
+ }
+ bcopy(bp, &sbp->b, sizeof(struct buf)); /* start with the user's buffer */
+ sbp->b.b_flags |= B_CALL; /* tell us when it's done */
+ sbp->b.b_iodone = sdio_done; /* here */
+ sbp->b.b_dev = DRIVE[sd->driveno].dev; /* device */
+ sbp->b.b_vp = DRIVE[sd->driveno].vp; /* vnode */
+ sbp->b.b_blkno += sd->driveoffset;
+ sbp->bp = bp; /* note the address of the original header */
+ sbp->sdno = sd->sdno; /* note for statistics */
+ sbp->driveno = sd->driveno;
+ endoffset = bp->b_blkno + sbp->b.b_bcount / DEV_BSIZE; /* final sector offset */
+ if (endoffset > sd->sectors) { /* beyond the end */
+ sbp->b.b_bcount -= (endoffset - sd->sectors) * DEV_BSIZE; /* trim */
+ if (sbp->b.b_bcount <= 0) { /* nothing to transfer */
+ bp->b_resid = bp->b_bcount; /* nothing transferred */
+ /* XXX Grrr. This doesn't seem to work. Return
+ * an error after all */
+ bp->b_flags |= B_ERROR;
+ bp->b_error = ENOSPC;
+ biodone(bp);
+ Free(sbp);
+ return;
+ }
+ }
+ if ((sbp->b.b_flags & B_READ) == 0) /* write */
+ sbp->b.b_vp->v_numoutput++; /* one more output going */
+#if DEBUG
+ if (debug & DEBUG_ADDRESSES)
+ printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
+ sbp->b.b_flags & B_READ ? "Read" : "Write",
+ sbp->b.b_dev,
+ sbp->sdno,
+ (u_int) (sbp->b.b_blkno - SD[sbp->sdno].driveoffset),
+ (int) sbp->b.b_blkno,
+ sbp->b.b_bcount); /* XXX */
+ if (debug & DEBUG_NUMOUTPUT)
+ printf(" vinumstart sd %d numoutput %ld\n",
+ sbp->sdno,
+ sbp->b.b_vp->v_numoutput);
+#endif
+ s = splbio();
+ (*bdevsw[major(sbp->b.b_dev)]->d_strategy) (&sbp->b);
+ splx(s);
+}
+
+/* Simplified version of bounds_check_with_label
+ * Determine the size of the transfer, and make sure it is
+ * within the boundaries of the partition. Adjust transfer
+ * if needed, and signal errors or early completion.
+ *
+ * Volumes are simpler than disk slices: they only contain
+ * one component (though we call them a, b and c to make
+ * system utilities happy), and they always take up the
+ * complete space of the "partition".
+ *
+ * I'm still not happy with this: why should the label be
+ * protected? If it weren't so damned difficult to write
+ * one in the first pleace (because it's protected), it wouldn't
+ * be a problem.
+ */
+int
+vinum_bounds_check(struct buf *bp, struct volume *vol)
+{
+ int maxsize = vol->size; /* size of the partition (sectors) */
+ int size = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; /* size of this request (sectors) */
+
+ /* Would this transfer overwrite the disk label? */
+ if (bp->b_blkno <= LABELSECTOR /* starts before or at the label */
+#if LABELSECTOR != 0
+ && bp->b_blkno + size > LABELSECTOR /* and finishes after */
+#endif
+ && (!(vol->flags & VF_RAW)) /* and it's not raw */
+ &&major(bp->b_dev) == BDEV_MAJOR /* and it's the block device */
+ && (bp->b_flags & B_READ) == 0 /* and it's a write */
+ && (!vol->flags & (VF_WLABEL | VF_LABELLING))) { /* and we're not allowed to write the label */
+ bp->b_error = EROFS; /* read-only */
+ bp->b_flags |= B_ERROR;
+ return -1;
+ }
+ if (size == 0) /* no transfer specified, */
+ return 0; /* treat as EOF */
+ /* beyond partition? */
+ if (bp->b_blkno < 0 /* negative start */
+ || bp->b_blkno + size > maxsize) { /* or goes beyond the end of the partition */
+ /* if exactly at end of disk, return an EOF */
+ if (bp->b_blkno == maxsize) {
+ bp->b_resid = bp->b_bcount;
+ return 0;
+ }
+ /* or truncate if part of it fits */
+ size = maxsize - bp->b_blkno;
+ if (size <= 0) { /* nothing to transfer */
+ bp->b_error = EINVAL;
+ bp->b_flags |= B_ERROR;
+ return -1;
+ }
+ bp->b_bcount = size << DEV_BSHIFT;
+ }
+ bp->b_pblkno = bp->b_blkno;
+ return 1;
+}
+
+/* Allocate a request group and hook
+ * it in in the list for rq */
+struct rqgroup *
+allocrqg(struct request *rq, int elements)
+{
+ struct rqgroup *rqg; /* the one we're going to allocate */
+ int size = sizeof(struct rqgroup) + elements * sizeof(struct rqelement);
+
+ rqg = (struct rqgroup *) Malloc(size);
+ if (rqg != NULL) { /* malloc OK, */
+ if (rq->rqg) /* we already have requests */
+ rq->lrqg->next = rqg; /* hang it off the end */
+ else /* first request */
+ rq->rqg = rqg; /* at the start */
+ rq->lrqg = rqg; /* this one is the last in the list */
+
+ bzero(rqg, size); /* no old junk */
+ rqg->rq = rq; /* point back to the parent request */
+ rqg->count = elements; /* number of requests in the group */
+ } else
+ Debugger("XXX");
+ return rqg;
+}
+
+/* Deallocate a request group out of a chain. We do
+ * this by linear search: the chain is short, this
+ * almost never happens, and currently it can only
+ * happen to the first member of the chain. */
+void
+deallocrqg(struct rqgroup *rqg)
+{
+ struct rqgroup *rqgc = rqg->rq->rqg; /* point to the request chain */
+
+ if (rqg->rq->rqg == rqg) /* we're first in line */
+ rqg->rq->rqg = rqg->next; /* unhook ourselves */
+ else {
+ while (rqgc->next != rqg) /* find the group */
+ rqgc = rqgc->next;
+ rqgc->next = rqg->next;
+ }
+ Free(rqgc);
+}
+
+/* Character device interface */
+int
+vinumread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(vinumstrategy, NULL, dev, 1, minphys, uio));
+}
+
+int
+vinumwrite(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(vinumstrategy, NULL, dev, 0, minphys, uio));
+}
diff --git a/sys/modules/vinum/request.h b/sys/modules/vinum/request.h
new file mode 100644
index 000000000000..b4beccca9b42
--- /dev/null
+++ b/sys/modules/vinum/request.h
@@ -0,0 +1,159 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: request.h,v 1.10 1998/08/03 07:15:26 grog Exp grog $
+ */
+
+/* Information needed to set up a transfer */
+
+/* struct buf is surprisingly big (about 300
+ * bytes), and it's part of the request, so this
+ * value is really important. Most requests
+ * don't need more than 2 subrequests per
+ * plex. The table is automatically extended if
+ * this value is too small. */
+#define RQELTS 2 /* default of 2 requests per transfer */
+
+enum xferinfo {
+ XFR_NORMAL_READ = 1,
+ XFR_NORMAL_WRITE = 2, /* write request in normal mode */
+ XFR_RECOVERY_READ = 4,
+ XFR_DEGRADED_WRITE = 8,
+ XFR_PARITYLESS_WRITE = 0x10,
+ XFR_NO_PARITY_STRIPE = 0x20, /* parity stripe is not available */
+ XFR_DATA_BLOCK = 0x40, /* data block in request */
+ XFR_PARITY_BLOCK = 0x80, /* parity block in request */
+ XFR_BAD_SUBDISK = 0x100, /* this subdisk is dead */
+ XFR_MALLOCED = 0x200, /* this buffer is malloced */
+#if DEBUG
+ XFR_PHASE2 = 0x800, /* documentation only: 2nd phase write */
+#endif
+ XFR_REVIVECONFLICT = 0x1000, /* possible conflict with a revive operation */
+ /* operations that need a parity block */
+ XFR_PARITYOP = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE),
+ /* operations that use the group parameters */
+ XFR_GROUPOP = (XFR_DEGRADED_WRITE | XFR_RECOVERY_READ),
+ /* operations that that use the data parameters */
+ XFR_DATAOP = (XFR_NORMAL_READ | XFR_NORMAL_WRITE | XFR_PARITYLESS_WRITE),
+ /* operations requiring read before write */
+ XFR_RBW = (XFR_NORMAL_WRITE | XFR_DEGRADED_WRITE),
+ /* operations that need a malloced buffer */
+ XFR_NEEDS_MALLOC = (XFR_NORMAL_WRITE | XFR_RECOVERY_READ | XFR_DEGRADED_WRITE)
+};
+
+/* Describe one low-level request, part
+ * of a high-level request. This is an
+ * extended struct buf buffer, and the first
+ * element *must* be a struct buf. We pass this structure
+ * to the I/O routines instead of a struct buf in oder
+ * to be able to locate the high-level request when it
+ * completes.
+ *
+ * All offsets and lengths are in "blocks", i.e. sectors */
+struct rqelement {
+ struct buf b; /* buf structure */
+ struct rqgroup *rqg; /* pointer to our group */
+ /* Information about the transfer */
+ daddr_t sdoffset; /* offset in subdisk */
+ int useroffset; /* offset in user buffer of normal data */
+ /* dataoffset and datalen refer to "individual"
+ * data transfers (normal read, parityless write)
+ * and also degraded write.
+ *
+ * groupoffset and grouplen refer to the other
+ * "group" operations (normal write, recovery read)
+ * Both the offsets are relative to the start of the
+ * local buffer */
+ int dataoffset; /* offset in buffer of the normal data */
+ int groupoffset; /* offset in buffer of group data */
+ short datalen; /* length of normal data (sectors) */
+ short grouplen; /* length of group data (sectors) */
+ short buflen; /* total buffer length to allocate */
+ short flags; /* really enum xferinfo (see above) */
+ /* Ways to find other components */
+ short sdno; /* subdisk number */
+ short driveno; /* drive number */
+};
+
+/* A group of requests built to satisfy a certain
+ * component of a user request */
+struct rqgroup {
+ struct rqgroup *next; /* pointer to next group */
+ struct request *rq; /* pointer to the request */
+ short count; /* number of requests in this group */
+ short active; /* and number active */
+ short plexno; /* index of plex */
+ int badsdno; /* index of bad subdisk or -1 */
+ enum xferinfo flags; /* description of transfer */
+ struct rqelement rqe[0]; /* and the elements of this request */
+};
+
+/* Describe one high-level request and the
+ * work we have to do to satisfy it */
+struct request {
+ struct buf *bp; /* pointer to the high-level request */
+ int flags;
+ union {
+ int volno; /* volume index */
+ int plexno; /* or plex index */
+ } volplex;
+ int error; /* current error indication */
+ short isplex; /* set if this is a plex request */
+ short active; /* number of subrequests still active */
+ struct rqgroup *rqg; /* pointer to the first group of requests */
+ struct rqgroup *lrqg; /* and to the first group of requests */
+ struct request *next; /* link of waiting requests */
+};
+
+/* Extended buffer header for subdisk I/O. Includes
+ * a pointer to the user I/O request. */
+struct sdbuf {
+ struct buf b; /* our buffer */
+ struct buf *bp; /* and pointer to parent */
+ short driveno; /* drive index */
+ short sdno; /* and subdisk index */
+};
+
+/* Values returned by rqe and friends.
+ * Be careful with these: they are in order of increasing
+ * seriousness. Some routines check for > REQUEST_RECOVERED
+ * to indicate a completely failed request. */
+enum requeststatus {
+ REQUEST_OK, /* request built OK */
+ REQUEST_RECOVERED, /* request OK, but involves RAID5 recovery */
+ REQUEST_EOF, /* request failed: outside plex */
+ REQUEST_DOWN, /* request failed: subdisk down */
+ REQUEST_ENOMEM /* ran out of memory */
+};
diff --git a/sys/modules/vinum/revive.c b/sys/modules/vinum/revive.c
new file mode 100644
index 000000000000..216dc4887d41
--- /dev/null
+++ b/sys/modules/vinum/revive.c
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: revive.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* revive a block of a plex. Return an error
+ * indication. EAGAIN means successful copy, but
+ * that more blocks remain to be copied.
+ * XXX We should specify a block size here. At the moment,
+ * just take a default value. FIXME */
+int
+revive_block(int plexno)
+{
+ struct plex *plex = &PLEX[plexno];
+ struct buf *bp;
+ int error = EAGAIN;
+ int size;
+ int s; /* priority level */
+
+ if (plex->revive_blocksize == 0) {
+ if (plex->stripesize != 0) /* we're striped, don't revive more than */
+ plex->revive_blocksize = min(DEFAULT_REVIVE_BLOCKSIZE, plex->stripesize); /* one block at a time */
+ else
+ plex->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
+ }
+ size = min(plex->revive_blocksize, (plex->length - plex->revived) << DEV_BSHIFT);
+
+ s = splbio();
+ /* Get a buffer */
+ bp = geteblk(size);
+ if (bp == NULL) {
+ splx(s);
+ return ENOMEM;
+ }
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+
+ /* Amount to transfer: block size, unless it
+ * would overlap the end */
+ bp->b_bufsize = size;
+ bp->b_bcount = bp->b_bufsize;
+ bp->b_resid = 0x0;
+ bp->b_blkno = plex->revived; /* we've got this far */
+
+ /* XXX what about reviving anonymous plexes? */
+
+ /* First, read the data from the volume. We don't
+ * care which plex, that's bre's job */
+ bp->b_dev = VINUMBDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
+ bp->b_flags = B_BUSY | B_READ;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else
+ /* Now write to the plex */
+ {
+ s = splbio();
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+ bp->b_dev = VINUMBDEV(plex->volno, plex->volplexno, 0, VINUM_PLEX_TYPE); /* create the device number */
+
+ bp->b_flags = B_BUSY; /* make this a write */
+ bp->b_resid = 0x0;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else {
+ plex->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */
+ if (plex->revived >= plex->length) { /* finished */
+ plex->revived = 0;
+ plex->state = plex_up; /* do we need to do more? */
+ if (plex->volno >= 0) /* we have a volume, */
+ set_volume_state(plex->volno, volume_up, 0);
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ save_config(); /* and save the updated configuration */
+ error = 0; /* we're done */
+ }
+ }
+ while (plex->waitlist) { /* we have waiting requests */
+ launch_requests(plex->waitlist, 1); /* do them now */
+ plex->waitlist = plex->waitlist->next; /* and move on to the next */
+ }
+ }
+ if (bp->b_qindex == 0) /* not on a queue, */
+ brelse(bp); /* is this kosher? */
+ return error;
+}
diff --git a/sys/modules/vinum/state.c b/sys/modules/vinum/state.c
new file mode 100644
index 000000000000..2ce2ed0c29e5
--- /dev/null
+++ b/sys/modules/vinum/state.c
@@ -0,0 +1,755 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: state.c,v 2.6 1998/08/19 08:04:47 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* Update drive state */
+/* Return 1 if the state changes, otherwise 0 */
+int
+set_drive_state(int driveno, enum drivestate state, int flags)
+{
+ struct drive *drive = &DRIVE[driveno];
+ int oldstate = drive->state;
+ int sdno;
+
+ if (drive->state == drive_unallocated) /* no drive to do anything with, */
+ return 0;
+
+ if (state != oldstate) { /* don't change it if it's not different */
+ if (state == drive_down) { /* the drive's going down */
+ if (flags || (drive->opencount == 0)) { /* we can do it */
+ close_drive(drive);
+ drive->state = state;
+ printf("vinum: drive %s is %s\n", drive->label.name, drive_state(drive->state));
+ } else
+ return 0; /* don't do it */
+ }
+ drive->state = state; /* set the state */
+ if (((drive->state == drive_up)
+ || ((drive->state == drive_coming_up)))
+ && (drive->vp == NULL)) /* should be open, but we're not */
+ init_drive(drive); /* which changes the state again */
+ if ((state != oldstate) /* state has changed */
+ &&((flags & setstate_norecurse) == 0)) { /* and we want to recurse, */
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) { /* find this drive's subdisks */
+ if (SD[sdno].driveno == driveno) /* belongs to this drive */
+ set_sd_state(sdno, sd_down, setstate_force | setstate_recursing); /* take it down */
+ }
+ save_config(); /* and save the updated configuration */
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* Try to set the subdisk state. Return 1 if state changed to
+ * what we wanted, -1 if it changed to something else, and 0
+ * if no change.
+ *
+ * This routine is called both from the user (up, down states
+ * only) and internally.
+ */
+int
+set_sd_state(int sdno, enum sdstate state, enum setstateflags flags)
+{
+ struct sd *sd = &SD[sdno];
+ int oldstate = sd->state;
+ int status = 1; /* status to return */
+
+ if (state == oldstate)
+ return 0; /* no change */
+
+ if (sd->state == sd_unallocated) /* no subdisk to do anything with, */
+ return 0;
+
+ if (sd->driveoffset < 0) { /* not allocated space */
+ sd->state = sd_down;
+ if (state != sd_down)
+ return -1;
+ } else { /* space allocated */
+ switch (state) {
+ case sd_down:
+ if ((!flags & setstate_force) /* but gently */
+ &&(sd->plexno >= 0)) /* and we're attached to a plex, */
+ return 0; /* don't do it */
+ break;
+
+ case sd_up:
+ if (DRIVE[sd->driveno].state != drive_up) /* can't bring the sd up if the drive isn't, */
+ return 0; /* not even by force */
+ switch (sd->state) {
+ case sd_obsolete:
+ case sd_down: /* been down, no data lost */
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ /* XXX Get this right: make sure that other plexes in
+ * the volume cover this address space, otherwise
+ * we make this one sd_up */
+ sd->state = sd_reborn; /* here it is again */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_init: /* brand new */
+ if (flags & setstate_configuring) /* we're doing this while configuring */
+ break;
+ sd->state = sd_empty; /* nothing in it */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_initializing:
+ break; /* go on and do it */
+
+ case sd_empty:
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ return 0; /* can't do it */
+
+ default: /* can't do it */
+ /* There's no way to bring subdisks up directly from
+ * other states. First they need to be initialized
+ * or revived */
+ return 0;
+ }
+ break;
+
+ default: /* other ones, only internal with force */
+ if (flags & setstate_force == 0) /* no force? What's this? */
+ return 0; /* don't do it */
+ }
+ }
+ sd->state = state;
+ printf("vinum: subdisk %s is %s\n", sd->name, sd_state(sd->state));
+ if ((flags & setstate_norecurse) == 0)
+ set_plex_state(sd->plexno, plex_up, setstate_recursing); /* update plex state */
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return status;
+}
+
+/* Called from request routines when they find
+ * a subdisk which is not kosher. Decide whether
+ * it warrants changing the state. Return
+ * REQUEST_DOWN if we can't use the subdisk,
+ * REQUEST_OK if we can. */
+enum requeststatus
+checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend)
+{
+ struct plex *plex = &PLEX[sd->plexno];
+ int writeop = (rq->bp->b_flags & B_READ) == 0; /* note if we're writing */
+
+ /* first, see if the plex wants to be accessed */
+ switch (plex->state) {
+ case plex_reviving:
+ /* When writing, we'll write anything that starts
+ * up to the current revive pointer, but we'll
+ * only accept a read which finishes before the
+ * current revive pointer.
+ */
+ if ((writeop && (diskaddr > plex->revived)) /* write starts after current revive pointer */
+ ||((!writeop) && (diskend >= plex->revived))) { /* or read ends after current revive pointer */
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* that part of the plex is still down */
+ } else if (diskend >= plex->revived) /* write finishes beyond revive pointer */
+ rq->flags |= XFR_REVIVECONFLICT; /* note a potential conflict */
+ /* FALLTHROUGH */
+
+ case plex_up:
+ case plex_degraded:
+ case plex_flaky:
+ /* We can access the plex: let's see
+ * how the subdisk feels */
+ switch (sd->state) {
+ case sd_up:
+ return REQUEST_OK;
+
+ case sd_reborn:
+ if (writeop)
+ return REQUEST_OK; /* always write to a reborn disk */
+ /* Handle the mapping. We don't want to reject
+ * a read request to a reborn subdisk if that's
+ * all we have. XXX */
+ return REQUEST_DOWN;
+
+ case sd_down:
+ case sd_crashed:
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* and it's down one way or another */
+
+ default:
+ return REQUEST_DOWN;
+ }
+
+ default:
+ return REQUEST_DOWN;
+ }
+}
+
+void
+add_defective_region(struct plex *plex, off_t offset, size_t length)
+{
+/* XXX get this ordered, and coalesce regions if necessary */
+ if (++plex->defective_regions > plex->defective_region_count)
+ EXPAND(plex->defective_region,
+ struct plexregion,
+ plex->defective_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->defective_region[plex->defective_regions - 1].offset = offset;
+ plex->defective_region[plex->defective_regions - 1].length = length;
+}
+
+void
+add_unmapped_region(struct plex *plex, off_t offset, size_t length)
+{
+ if (++plex->unmapped_regions > plex->unmapped_region_count)
+ EXPAND(plex->unmapped_region,
+ struct plexregion,
+ plex->unmapped_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->unmapped_region[plex->unmapped_regions - 1].offset = offset;
+ plex->unmapped_region[plex->unmapped_regions - 1].length = length;
+}
+
+/* Rebuild a plex free list and set state if
+ * we have a configuration error */
+void
+rebuild_plex_unmappedlist(struct plex *plex)
+{
+ int sdno;
+ struct sd *sd;
+ int lastsdend = 0; /* end offset of last subdisk */
+
+ if (plex->unmapped_region != NULL) { /* we're going to rebuild it */
+ Free(plex->unmapped_region);
+ plex->unmapped_region = NULL;
+ plex->unmapped_regions = 0;
+ plex->unmapped_region_count = 0;
+ }
+ if (plex->defective_region != NULL) {
+ Free(plex->defective_region);
+ plex->defective_region = NULL;
+ plex->defective_regions = 0;
+ plex->defective_region_count = 0;
+ }
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ if (sd->plexoffset < lastsdend) { /* overlap */
+ printf("vinum: Plex %s, subdisk %s overlaps previous\n", plex->name, sd->name);
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* don't allow that */
+ } else if (sd->plexoffset > lastsdend) /* gap */
+ add_unmapped_region(plex, lastsdend, sd->plexoffset - lastsdend);
+ else if (sd->state < sd_reborn) /* this part defective */
+ add_defective_region(plex, sd->plexoffset, sd->sectors);
+ lastsdend = sd->plexoffset + sd->sectors;
+ }
+}
+
+/* return a state map for the subdisks of a plex */
+enum sdstates
+sdstatemap(struct plex *plex, int *sddowncount)
+{
+ int sdno;
+ enum sdstates statemap = 0; /* note the states we find */
+
+ *sddowncount = 0; /* no subdisks down yet */
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
+
+ switch (sd->state) {
+ case sd_empty:
+ statemap |= sd_emptystate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_init:
+ statemap |= sd_initstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_down:
+ statemap |= sd_downstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_crashed:
+ statemap |= sd_crashedstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_obsolete:
+ statemap |= sd_obsolete;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_stale:
+ statemap |= sd_stalestate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_reborn:
+ statemap |= sd_rebornstate;
+ break;
+
+ case sd_up:
+ statemap |= sd_upstate;
+ break;
+
+ default:
+ statemap |= sd_otherstate;
+ break;
+ }
+ }
+ return statemap;
+}
+
+/* determine the state of the volume relative to this plex */
+enum volplexstate
+vpstate(struct plex *plex)
+{
+ struct volume *vol;
+ enum volplexstate state = volplex_onlyusdown; /* state to return */
+ int plexno;
+
+ if (plex->volno < 0) /* not associated with a volume */
+ return volplex_onlyusdown; /* assume the worst */
+
+ vol = &VOL[plex->volno]; /* point to our volume */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ if (&PLEX[vol->plex[plexno]] == plex) { /* us */
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* are we up? */
+ state |= volplex_onlyus; /* yes */
+ } else {
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* not us */
+ state |= volplex_otherup; /* and when they were up, they were up */
+ else
+ state |= volplex_alldown; /* and when they were down, they were down */
+ }
+ }
+ return state; /* and when they were only halfway up */
+} /* they were neither up nor down */
+
+/* Check if all bits b are set in a */
+int allset(int a, int b);
+
+int
+allset(int a, int b)
+{
+ return (a & b) == b;
+}
+
+/* Update the state of a plex dependent on its subdisks.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_plex_state(int plexno, enum plexstate state, enum setstateflags flags)
+{
+ int sddowncount = 0; /* number of down subdisks */
+ struct plex *plex = &PLEX[plexno]; /* point to our plex */
+ enum plexstate oldstate = plex->state;
+ enum volplexstate vps = vpstate(plex); /* how do we compare with the other plexes? */
+ enum sdstates statemap = sdstatemap(plex, &sddowncount); /* get a map of the subdisk states */
+
+ if ((flags & setstate_force) && (oldstate == state)) /* we're there already, */
+ return 0; /* no change */
+
+ if (plex->state == plex_unallocated) /* no plex to do anything with, */
+ return 0;
+
+ switch (state) {
+ case plex_up:
+ if ((plex->state == plex_initializing) /* we're initializing */
+ &&(statemap != sd_upstate)) /* but SDs aren't up yet */
+ return 0; /* do nothing */
+
+ /* We don't really care what our state was before
+ * if we want to come up. We rely entirely on the
+ * state of our subdisks and our volume */
+ switch (vps) {
+ case volplex_onlyusdown:
+ case volplex_alldown: /* another plex is down, and so are we */
+ if (statemap == sd_upstate) { /* all subdisks ready for action */
+ if ((plex->state == plex_init) /* we're brand spanking new */
+ &&(VOL[plex->volno].flags & VF_CONFIG_SETUPSTATE)) { /* and we consider that up */
+ /* Conceptually, an empty plex does not contain valid data,
+ * but normally we'll see this state when we have just
+ * created a plex, and it's either consistent from earlier,
+ * or we don't care about the previous contents (we're going
+ * to create a file system or use it for swap).
+ *
+ * We need to do this in one swell foop: on the next call
+ * we will no longer be just empty.
+ *
+ * We'll still come back to this function for the remaining
+ * plexes in the volume. They'll be up already, so that
+ * doesn't change anything, but it's not worth the additional
+ * code to stop doing it. */
+ struct volume *vol = &VOL[plex->volno];
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++)
+ PLEX[vol->plex[plexno]].state = plex_up;
+ }
+ plex->state = plex_up; /* bring up up, anyway */
+ } else
+ plex->state = plex_down;
+ break;
+
+ case volplex_onlyusup: /* only we are up: others are down */
+ case volplex_onlyus: /* we're up and alone */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate)) /* or all empty */
+ plex->state = plex_up; /* go for it */
+ else if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ plex->state = plex_flaky;
+ else if (statemap & (sd_upstate | sd_reborn)) /* some up or reborn, */
+ plex->state = plex_degraded; /* so far no corruption */
+ else
+ plex->state = plex_faulty;
+ break;
+
+ case volplex_otherup: /* another plex is up */
+ case volplex_otherupdown: /* other plexes are up and down */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate) /* or all empty */
+ ) {
+ /* Is the data in all subdisks valid? */
+ if (statemap == statemap & (sd_downstate | sd_rebornstate | sd_upstate))
+ break; /* yes, we can bring the plex up */
+ plex->state = plex_reviving; /* we need reviving */
+ return EAGAIN;
+ } else
+ plex->state = plex_faulty; /* still in error */
+ break;
+
+ case volplex_allup: /* all plexes are up */
+ case volplex_someup:
+ if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ break; /* no change */
+ else
+ plex->state = plex_degraded; /* we're not all there */
+ }
+
+ if (plex->state != oldstate)
+ break;
+ return 0; /* no change */
+
+ case plex_down: /* want to take it down */
+ if (((vps == volplex_onlyus) /* we're the only one up */
+ ||(vps == volplex_onlyusup)) /* we're the only one up */
+ &&(!(flags & setstate_force))) /* and we don't want to use force */
+ return 0; /* can't do it */
+ plex->state = state; /* do it */
+ break;
+
+ /* This is only requested by the driver.
+ * Trust ourselves */
+ case plex_faulty:
+ plex->state = state; /* do it */
+ break;
+
+ case plex_initializing:
+ /* XXX consider what safeguards we need here */
+ if ((flags & setstate_force) == 0)
+ return 0;
+ plex->state = state; /* do it */
+ break;
+
+ /* What's this? */
+ default:
+ return 0;
+ }
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ /* Now see what we have left, and whether
+ * we're taking the volume down */
+ if (plex->volno >= 0) { /* we have a volume */
+ struct volume *vol = &VOL[plex->volno];
+
+ vps = vpstate(plex); /* get our combined state again */
+ if ((flags & setstate_norecurse) == 0) { /* we can recurse */
+ if ((vol->state == volume_up)
+ && (vps == volplex_alldown)) /* and we're all down */
+ set_volume_state(plex->volno, volume_down, setstate_recursing); /* take our volume down */
+ else if ((vol->state == volume_down)
+ && (vps & (volplex_otherup | volplex_onlyusup))) /* and at least one is up */
+ set_volume_state(plex->volno, volume_up, setstate_recursing); /* bring our volume up */
+ }
+ }
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+}
+
+/* Update the state of a plex dependent on its plexes.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_volume_state(int volno, enum volumestate state, enum setstateflags flags)
+{
+ int plexno;
+ enum plexstates {
+ plex_downstate = 1, /* found a plex which is down */
+ plex_degradedstate = 2, /* found a plex which is halfway up */
+ plex_upstate = 4 /* found a plex which is completely up */
+ };
+
+ int plexstatemap = 0; /* note the states we find */
+ struct volume *vol = &VOL[volno]; /* point to our volume */
+
+ if (vol->state == state) /* we're there already */
+ return 0; /* no change */
+ if (vol->state == volume_unallocated) /* no volume to do anything with, */
+ return 0;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ struct plex *plex = &PLEX[vol->plex[plexno]]; /* point to the plex */
+ switch (plex->state) {
+ case plex_degraded:
+ case plex_flaky:
+ case plex_reviving:
+ plexstatemap |= plex_degradedstate;
+ break;
+
+ case plex_up:
+ plexstatemap |= plex_upstate;
+ break;
+
+ default:
+ plexstatemap |= plex_downstate;
+ break;
+ }
+ }
+
+ if (state == volume_up) { /* want to come up */
+ if (plexstatemap & plex_upstate) { /* we have a plex which is completely up */
+ vol->state = volume_up; /* did it */
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ /* Here we should check whether we have enough
+ * coverage for the complete volume. Writeme XXX */
+ } else if (state == volume_down) { /* want to go down */
+ if ((vol->opencount == 0) /* not open */
+ ||(flags & setstate_force != 0)) { /* or we're forcing */
+ vol->state = volume_down;
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ }
+ return 0; /* no change */
+}
+
+/* Start an object, in other words do what we can to get it up.
+ * This is called from vinumioctl (VINUMSTART).
+ * Return error indications via ioctl_reply
+ */
+void
+start_object(struct vinum_ioctl_msg *data)
+{
+ int status;
+ int realstatus; /* what we really have */
+ int objindex = data->index; /* data gets overwritten */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_up, setstate_none);
+ realstatus = DRIVE[objindex].state == drive_up; /* set status on whether we really did it */
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_up, setstate_none); /* set state */
+ realstatus = SD[objindex].state == sd_up; /* set status on whether we really did it */
+ break;
+
+ case plex_object:
+ if (PLEX[objindex].state == plex_reviving) { /* reviving, */
+ ioctl_reply->error = revive_block(objindex); /* revive another block */
+ ioctl_reply->msg[0] = '\0'; /* no comment */
+ return;
+ }
+ status = set_plex_state(objindex, plex_up, setstate_none);
+ realstatus = PLEX[objindex].state == plex_up; /* set status on whether we really did it */
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_up, setstate_none);
+ realstatus = VOL[objindex].state == volume_up; /* set status on whether we really did it */
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ /* There's no point in saying anything here:
+ * the userland program does it better */
+ ioctl_reply->msg[0] = '\0';
+ if (realstatus == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* Stop an object, in other words do what we can to get it down
+ * This is called from vinumioctl (VINUMSTOP).
+ * Return error indications via ioctl_reply.
+ */
+void
+stop_object(struct vinum_ioctl_msg *data)
+{
+ int status = 1;
+ int objindex = data->index; /* save the number from change */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_down, data->force);
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_down, data->force);
+ break;
+
+ case plex_object:
+ status = set_plex_state(objindex, plex_down, data->force);
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_down, data->force);
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ ioctl_reply->msg[0] = '\0';
+ if (status == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* VINUM_SETSTATE ioctl: set an object state
+ * msg is the message passed by the user */
+void
+setstate(struct vinum_ioctl_msg *msg)
+{
+ int sdno;
+ struct sd *sd;
+ struct plex *plex;
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) msg; /* format for returning replies */
+
+ switch (msg->state) {
+ case object_down:
+ stop_object(msg);
+ break;
+
+ case object_initializing:
+ switch (msg->type) {
+ case sd_object:
+ sd = &SD[msg->index];
+ if ((msg->index >= vinum_conf.subdisks_used)
+ || (sd->state == sd_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_sd_state(msg->index, sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else
+ ioctl_reply->error = 0;
+ break;
+
+ case plex_object:
+ plex = &PLEX[msg->index];
+ if ((msg->index >= vinum_conf.plexes_used)
+ || (plex->state == plex_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_plex_state(msg->index, plex_initializing, msg->force);
+ if (plex->state != plex_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else {
+ ioctl_reply->error = 0;
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ set_sd_state(plex->sdnos[sdno], sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ break;
+ }
+ }
+ }
+ break;
+
+ default:
+ strcpy(ioctl_reply->msg, "Invalid object");
+ ioctl_reply->error = EINVAL;
+ }
+ break;
+
+ case object_up:
+ start_object(msg);
+ }
+}
diff --git a/sys/modules/vinum/statetexts.h b/sys/modules/vinum/statetexts.h
new file mode 100644
index 000000000000..b7ce4eb54bef
--- /dev/null
+++ b/sys/modules/vinum/statetexts.h
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
+ */
+/* Created by ./makestatetext on Tue 4 Aug 15:53:16 CST 1998. Do not edit */
+
+/* Drive state texts */
+char *drivestatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "down",
+ "coming_up",
+ "up",
+};
+
+/* Subdisk state texts */
+char *sdstatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "init",
+ "initializing",
+ "empty",
+ "obsolete",
+ "stale",
+ "crashed",
+ "down",
+ "reborn",
+ "up",
+};
+
+/* Plex state texts */
+char *plexstatetext[] =
+{
+ "unallocated",
+ "init",
+ "faulty",
+ "down",
+ "reviving",
+ "initializing",
+ "corrupt",
+ "degraded",
+ "flaky",
+ "up",
+};
+
+/* Volume state texts */
+char *volstatetext[] =
+{
+ "unallocated",
+ "uninit",
+ "down",
+ "up",
+};
diff --git a/sys/modules/vinum/util.c b/sys/modules/vinum/util.c
new file mode 100644
index 000000000000..512140438fc9
--- /dev/null
+++ b/sys/modules/vinum/util.c
@@ -0,0 +1,211 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: util.c,v 1.7 1998/08/07 09:23:10 grog Exp grog $
+ */
+
+/* This file contains utility routines used both in kernel and user context */
+
+#include "vinumhdr.h"
+#include "statetexts.h"
+#ifndef REALLYKERNEL
+#include <stdio.h>
+extern jmp_buf command_fail; /* return on a failed command */
+#endif
+
+static char numeric_state[32]; /* temporary buffer for ASCII conversions */
+#define STATECOUNT(x) (sizeof (x##statetext) / sizeof (char *))
+/* Return drive state as a string */
+char *
+drive_state(enum drivestate state)
+{
+ if (((unsigned) state) >= STATECOUNT(drive)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return drivestatetext[state];
+}
+
+/* Return volume state as a string */
+char *
+volume_state(enum volumestate state)
+{
+ if (((unsigned) state) >= STATECOUNT(vol)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return volstatetext[state];
+}
+
+/* Return plex state as a string */
+char *
+plex_state(enum plexstate state)
+{
+ if (((unsigned) state) >= STATECOUNT(plex)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return plexstatetext[state];
+}
+
+/* Return plex organization as a string */
+char *
+plex_org(enum plexorg org)
+{
+ switch (org) {
+ case plex_disorg: /* disorganized */
+ return "disorg";
+ break;
+
+ case plex_concat: /* concatenated plex */
+ return "concat";
+ break;
+
+ case plex_striped: /* striped plex */
+ return "striped";
+ break;
+
+
+ default:
+ sprintf(numeric_state, "Invalid org %d", (int) org);
+ return numeric_state;
+ }
+}
+
+/* Return sd state as a string */
+char *
+sd_state(enum sdstate state)
+{
+ if (((unsigned) state) >= STATECOUNT(sd)) {
+ sprintf(numeric_state, "Invalid state %d", (int) state);
+ return numeric_state;
+ } else
+ return sdstatetext[state];
+}
+
+/* Now convert in the other direction */
+/* These are currently used only internally,
+ * so we don't do too much error checking */
+enum drivestate
+DriveState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(drive); i++)
+ if (strcmp(text, drivestatetext[i]) == 0) /* found it */
+ return (enum drivestate) i;
+ return -1;
+}
+
+enum sdstate
+SdState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(sd); i++)
+ if (strcmp(text, sdstatetext[i]) == 0) /* found it */
+ return (enum sdstate) i;
+ return -1;
+}
+
+enum plexstate
+PlexState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(plex); i++)
+ if (strcmp(text, plexstatetext[i]) == 0) /* found it */
+ return (enum plexstate) i;
+ return -1;
+}
+
+enum volumestate
+VolState(char *text)
+{
+ int i;
+ for (i = 0; i < STATECOUNT(vol); i++)
+ if (strcmp(text, volstatetext[i]) == 0) /* found it */
+ return (enum volstate) i;
+ return -1;
+}
+
+/* Take a number with an optional scale factor and convert
+ * it to a number of bytes.
+ *
+ * The scale factors are:
+ *
+ * b blocks (of 512 bytes)
+ * k kilobytes (1024 bytes)
+ * m megabytes (of 1024 * 1024 bytes)
+ * g gigabytes (of 1024 * 1024 * 1024 bytes)
+ */
+u_int64_t
+sizespec(char *spec)
+{
+ u_int64_t size;
+ char *s;
+
+ size = 0;
+ s = spec;
+ if ((*s >= '0') && (*s <= '9')) { /* it's numeric */
+ while ((*s >= '0') && (*s <= '9')) /* it's numeric */
+ size = size * 10 + *s++ - '0'; /* convert it */
+ switch (*s) {
+ case '\0':
+ return size;
+
+ case 'B':
+ case 'b':
+ return size * 512;
+
+ case 'K':
+ case 'k':
+ return size * 1024;
+
+ case 'M':
+ case 'm':
+ return size * 1024 * 1024;
+
+ case 'G':
+ case 'g':
+ return size * 1024 * 1024 * 1024;
+ }
+ }
+#ifdef REALLYKERNEL
+ throw_rude_remark(EINVAL, "Invalid length specification: %s", spec);
+#else
+ fprintf(stderr, "Invalid length specification: %s", spec);
+ longjmp(command_fail, -1);
+#endif
+ /* NOTREACHED */
+ return -1;
+}
diff --git a/sys/modules/vinum/vinum.c b/sys/modules/vinum/vinum.c
new file mode 100644
index 000000000000..62c6b3fa7678
--- /dev/null
+++ b/sys/modules/vinum/vinum.c
@@ -0,0 +1,543 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinum.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
+#include <sys/reboot.h>
+int debug = 0;
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
+
+#if __FreeBSD__ < 3
+STATIC struct cdevsw vinum_cdevsw;
+STATIC struct bdevsw vinum_bdevsw =
+{
+ vinumopen, vinumclose, vinumstrategy, vinumioctl,
+ vinumdump, vinumsize, 0,
+ "vinum", &vinum_cdevsw, -1
+};
+#else /* goodbye, bdevsw */
+STATIC struct cdevsw vinum_cdevsw =
+{
+ vinumopen, vinumclose, vinumread, vinumwrite,
+ vinumioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, vinumstrategy, "vinum",
+ NULL, -1, vinumdump, vinumsize,
+ D_DISK, 0, -1
+};
+#endif
+
+/* Called by main() during pseudo-device attachment. */
+STATIC void vinumattach(void *);
+
+STATIC void vinumgetdisklabel(dev_t);
+void vinum_scandisk(void);
+int vinum_inactive(void);
+void free_vinum(int);
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+extern jmp_buf command_fail; /* return here if config fails */
+
+struct _vinum_conf vinum_conf; /* configuration information */
+
+STATIC int vinum_devsw_installed = 0;
+
+/*
+ * Called by main() during pseudo-device attachment. All we need
+ * to do is allocate enough space for devices to be configured later, and
+ * add devsw entries.
+ */
+void
+vinumattach(void *dummy)
+{
+ BROKEN_GDB;
+ char *buf; /* pointer to temporary buffer */
+ struct _ioctl_reply *ioctl_reply; /* struct to return */
+ struct uio uio;
+ struct iovec iovec;
+
+ /* modload should prevent multiple loads, so this is worth a panic */
+ if ((vinum_conf.flags & VF_LOADED) != NULL)
+ panic("vinum: already loaded");
+
+ printf("vinum: loaded\n");
+ vinum_conf.flags |= VF_LOADED; /* we're loaded now */
+
+ /* We don't have a p pointer here, so take it from curproc */
+ myproc = curproc;
+#if __FreeBSD__ < 3
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_bdevsw);
+#else
+ cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_cdevsw);
+#endif
+#ifdef DEVFS
+#error DEVFS not finished yet
+#endif
+
+ uio.uio_iov = &iovec;
+ uio.uio_iovcnt = 1; /* just one buffer */
+ uio.uio_offset = 0; /* start at the beginning */
+ uio.uio_resid = 512; /* one sector */
+ uio.uio_segflg = UIO_SYSSPACE; /* we're in system space */
+ uio.uio_rw = UIO_READ; /* do we need this? */
+ uio.uio_procp = curproc; /* do it for our own process */
+
+ iovec.iov_len = 512;
+ buf = (char *) Malloc(iovec.iov_len); /* get a buffer */
+ CHECKALLOC(buf, "vinum: no memory\n"); /* can't get 512 bytes? */
+ iovec.iov_base = buf; /* read into buf */
+
+ /* allocate space: drives... */
+ DRIVE = (struct drive *) Malloc(sizeof(struct drive) * INITIAL_DRIVES);
+ CHECKALLOC(DRIVE, "vinum: no memory\n");
+ vinum_conf.drives_allocated = INITIAL_DRIVES; /* number of drive slots allocated */
+ vinum_conf.drives_used = 0; /* and number in use */
+
+ /* volumes, ... */
+ VOL = (struct volume *) Malloc(sizeof(struct volume) * INITIAL_VOLUMES);
+ CHECKALLOC(VOL, "vinum: no memory\n");
+ vinum_conf.volumes_allocated = INITIAL_VOLUMES; /* number of volume slots allocated */
+ vinum_conf.volumes_used = 0; /* and number in use */
+
+ /* plexes, ... */
+ PLEX = (struct plex *) Malloc(sizeof(struct plex) * INITIAL_PLEXES);
+ CHECKALLOC(PLEX, "vinum: no memory\n");
+ vinum_conf.plexes_allocated = INITIAL_PLEXES; /* number of plex slots allocated */
+ vinum_conf.plexes_used = 0; /* and number in use */
+
+ /* and subdisks */
+ SD = (struct sd *) Malloc(sizeof(struct sd) * INITIAL_SUBDISKS);
+ CHECKALLOC(SD, "vinum: no memory\n");
+ vinum_conf.subdisks_allocated = INITIAL_SUBDISKS; /* number of sd slots allocated */
+ vinum_conf.subdisks_used = 0; /* and number in use */
+
+ ioctl_reply = NULL; /* no reply on longjmp */
+}
+
+
+/* Check if we have anything open. If so, return 0 (not inactive),
+ * otherwise 1 (inactive) */
+int
+vinum_inactive(void)
+{
+ BROKEN_GDB;
+ int i;
+ int can_do = 1; /* assume we can do it */
+
+ lock_config();
+ for (i = 0; i < vinum_conf.volumes_used; i++) {
+ if (VOL[i].pid != NULL) { /* volume is open */
+ can_do = 0;
+ break;
+ }
+ }
+ unlock_config();
+ return can_do;
+}
+
+/* Free all structures.
+ * If cleardrive is 0, save the configuration; otherwise
+ * remove the configuration from the drive.
+ *
+ * Before coming here, ensure that no volumes are open.
+ */
+void
+free_vinum(int cleardrive)
+{
+ BROKEN_GDB;
+ int i;
+
+ if (cleardrive) {
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ remove_drive(i); /* remove the drive */
+ } else { /* keep the config */
+ save_config();
+ if (DRIVE != NULL) {
+ for (i = 0; i < vinum_conf.drives_used; i++)
+ free_drive(&DRIVE[i]); /* close files and things */
+ Free(DRIVE);
+ }
+ }
+ if (SD != NULL)
+ Free(SD);
+ if (PLEX != NULL) {
+ for (i = 0; i < vinum_conf.plexes_used; i++) {
+ struct plex *plex = &vinum_conf.plex[i];
+
+ if (plex->state != plex_unallocated) { /* we have real data there */
+ if (plex->sdnos)
+ Free(plex->sdnos);
+ if (plex->unmapped_regions)
+ Free(plex->unmapped_region);
+ if (plex->defective_regions)
+ Free(plex->defective_region);
+ }
+ }
+ Free(PLEX);
+ }
+ if (VOL != NULL)
+ Free(VOL);
+ bzero(&vinum_conf, sizeof(vinum_conf));
+}
+
+#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
+MOD_MISC(vinum);
+
+/*
+ * Function called when loading the driver.
+ */
+STATIC int
+vinum_load(struct lkm_table *lkmtp, int cmd)
+{
+ BROKEN_GDB;
+/* Debugger ("vinum_load"); */
+ vinumattach(NULL);
+ return 0; /* OK */
+}
+
+/*
+ * Function called when unloading the driver.
+ */
+STATIC int
+vinum_unload(struct lkm_table *lkmtp, int cmd)
+{
+ BROKEN_GDB;
+ if (vinum_inactive()) { /* is anything open? */
+ struct sync_args dummyarg =
+ {0};
+#if __FreeBSD__ < 3
+ int retval;
+#endif
+
+ printf("vinum: unloaded\n");
+#if __FreeBSD__ < 3
+ sync(curproc, &dummyarg, &retval); /* write out buffers */
+#else
+ sync(curproc, &dummyarg); /* write out buffers */
+#endif
+ free_vinum(0); /* no: clean up */
+#if __FreeBSD__ < 3
+ bdevsw[BDEV_MAJOR] = NULL; /* clear bdevsw */
+#endif
+ cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
+ return 0;
+ } else
+ return EBUSY;
+}
+
+/*
+ * Dispatcher function for the module (load/unload/stat).
+ */
+int
+vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ BROKEN_GDB;
+ MOD_DISPATCH(vinum, /* module name */
+ lkmtp, /* LKM table */
+ cmd, /* command */
+ ver,
+ vinum_load, /* load with this function */
+ vinum_unload, /* and unload with this */
+ lkm_nullcmd);
+}
+
+#else /* not LKM */
+
+STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
+STATIC int
+vinum_modevent(module_t mod, modeventtype_t type, void *unused)
+{
+ struct sync_args dummyarg = {0};
+
+ BROKEN_GDB;
+ switch (type) {
+ case MOD_LOAD:
+ /* Debugger ("vinum_load"); */
+ vinumattach(NULL);
+ return 0; /* OK */
+ case MOD_UNLOAD:
+ if (!vinum_inactive()) /* is anything open? */
+ return EBUSY;
+ sync(curproc, &dummyarg); /* write out buffers */
+ free_vinum(0); /* no: clean up */
+ cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
+ return 0;
+ default:
+ break;
+ }
+ return 0;
+}
+
+moduledata_t vinum_mod = {
+ "vinum",
+ vinum_modevent,
+ 0
+};
+DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
+
+#endif /* LKM */
+
+/* ARGSUSED */
+/* Open a vinum object
+ * At the moment, we only open volumes and the
+ * super device. It's a nice concept to be
+ * able to open drives, subdisks and plexes, but
+ * I can't think what good it could be */
+int
+vinumopen(dev_t dev,
+ int flags,
+ int fmt,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ int s; /* spl */
+ int error;
+ unsigned int index;
+ struct volume *vol;
+ struct plex *plex;
+ struct sd *sd;
+ struct devcode *device;
+
+ device = (struct devcode *) &dev;
+
+ error = 0;
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_VOLUME_TYPE:
+ index = VOLNO(dev);
+ if (index >= vinum_conf.volumes_used)
+ return ENXIO; /* no such device */
+ vol = &VOL[index];
+
+ switch (vol->state) {
+ case volume_unallocated:
+ case volume_uninit:
+ return ENXIO;
+
+ case volume_up:
+ s = splhigh(); /* quick lock */
+ if (error)
+ return error;
+ if (vol->opencount == 0)
+ vol->openflags = flags; /* set our flags */
+ vol->opencount++;
+ vol->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+
+ case volume_down:
+ return EIO;
+
+ default:
+ return EINVAL;
+ }
+
+ case VINUM_PLEX_TYPE:
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
+ return ENXIO;
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
+ if (index >= vinum_conf.plexes_used)
+ return ENXIO; /* no such device */
+ plex = &PLEX[index];
+
+ switch (plex->state) {
+ case plex_unallocated:
+ return EINVAL;
+
+ default:
+ s = splhigh();
+ if (plex->pid /* it's open already */
+ && (plex->pid != p->p_pid)) { /* and not by us, */
+ splx(s);
+ return EBUSY; /* one at a time, please */
+ }
+ plex->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+ }
+
+ case VINUM_SD_TYPE:
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ return ENXIO; /* no such device */
+ index = SDNO(dev); /* get the subdisk number */
+ if (index >= vinum_conf.subdisks_used)
+ return ENXIO; /* no such device */
+ sd = &SD[index];
+
+ /* Opening a subdisk is always a special operation, so we
+ * ignore the state as long as it represents a real subdisk */
+ switch (sd->state) {
+ case sd_unallocated:
+ case sd_uninit:
+ return EINVAL;
+
+ default:
+ s = splhigh();
+ if (sd->pid /* it's open already */
+ && (sd->pid != p->p_pid)) { /* and not by us, */
+ splx(s);
+ return EBUSY; /* one at a time, please */
+ }
+ sd->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
+ return 0;
+ }
+
+ case VINUM_DRIVE_TYPE:
+ default:
+ return ENODEV; /* don't know what to do with these */
+
+ case VINUM_SUPERDEV_TYPE:
+ if (p->p_ucred->cr_uid == 0) { /* root calling, */
+ vinum_conf.opencount++; /* one more opener */
+ return 0; /* no worries opening super dev */
+ } else
+ return EPERM; /* you can't do that! */
+ }
+}
+
+/* ARGSUSED */
+int
+vinumclose(dev_t dev,
+ int flags,
+ int fmt,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ unsigned int index;
+ struct volume *vol;
+ struct plex *plex;
+ struct sd *sd;
+ struct devcode *device = (struct devcode *) &dev;
+
+ index = VOLNO(dev);
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_VOLUME_TYPE:
+ if (index >= vinum_conf.volumes_used)
+ return ENXIO; /* no such device */
+ vol = &VOL[index];
+
+ switch (vol->state) {
+ case volume_unallocated:
+ case volume_uninit:
+ return ENXIO;
+
+ case volume_up:
+ vol->opencount = 0; /* reset our flags */
+ vol->pid = NULL; /* and forget who owned us */
+ return 0;
+
+ case volume_down:
+ return EIO;
+
+ default:
+ return EINVAL;
+ }
+
+ case VINUM_PLEX_TYPE:
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
+ return ENXIO;
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
+ if (index >= vinum_conf.plexes_used)
+ return ENXIO; /* no such device */
+ plex = &PLEX[index];
+ plex->pid = 0;
+ return 0;
+
+ case VINUM_SD_TYPE:
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ return ENXIO; /* no such device */
+ index = SDNO(dev); /* get the subdisk number */
+ if (index >= vinum_conf.subdisks_used)
+ return ENXIO; /* no such device */
+ sd = &SD[index];
+ sd->pid = 0;
+ return 0;
+
+ case VINUM_SUPERDEV_TYPE:
+ if (p->p_ucred->cr_uid == 0) /* root calling, */
+ vinum_conf.opencount--; /* one less opener */
+ return 0; /* no worries closing super dev */
+
+ case VINUM_DRIVE_TYPE:
+ default:
+ return ENODEV; /* don't know what to do with these */
+ }
+}
+
+/* size routine */
+int
+vinumsize(dev_t dev)
+{
+ BROKEN_GDB;
+ struct volume *vol;
+ int size;
+
+/* XXX This is bogus. We don't need to open
+ * a device to find its size */
+ vol = &VOL[VOLNO(dev)];
+
+ if (vol->state == volume_up)
+ size = vol->size;
+ else
+ return 0; /* err on the size of conservatism */
+
+
+ return size;
+}
+
+int
+vinumdump(dev_t dev)
+{
+ /* Not implemented. */
+ return ENXIO;
+}
diff --git a/sys/modules/vinum/vinumext.h b/sys/modules/vinum/vinumext.h
new file mode 100644
index 000000000000..4b7d5a01d642
--- /dev/null
+++ b/sys/modules/vinum/vinumext.h
@@ -0,0 +1,214 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumext.h,v 1.14 1998/08/11 00:03:57 grog Exp grog $
+ */
+
+/* vinumext.h: external definitions */
+
+extern struct _vinum_conf vinum_conf; /* configuration information */
+
+#ifdef DEBUG
+extern debug; /* debug flags */
+#endif
+
+#define CHECKALLOC(ptr, msg) \
+ if (ptr == NULL) \
+ { \
+ printf (msg); \
+ longjmp (command_fail, -1); \
+ }
+#ifndef KERNEL
+struct vnode;
+struct proc;
+#endif
+
+#ifdef KERNEL
+int give_sd_to_plex(int plexno, int sdno);
+int give_plex_to_volume(int volno, int plexno);
+int check_drive(char *);
+enum drive_label_info read_drive_label(struct drive *drive);
+int parse_config(char *, struct keywordset *);
+int parse_user_config(char *cptr, struct keywordset *keyset);
+u_int64_t sizespec(char *spec);
+int volume_index(struct volume *volume);
+int plex_index(struct plex *plex);
+int sd_index(struct sd *sd);
+int drive_index(struct drive *drive);
+int my_plex(int volno, int plexno);
+int my_sd(int plexno, int sdno);
+int get_empty_drive(void);
+int find_drive(const char *name, int create);
+int find_drive_by_dev(const char *devname, int create);
+int get_empty_sd(void);
+int find_subdisk(const char *name, int create);
+void free_sd(int sdno);
+void free_volume(int volno);
+int get_empty_plex(void);
+int find_plex(const char *name, int create);
+void free_plex(int plexno);
+int get_empty_volume(void);
+int find_volume(const char *name, int create);
+void config_subdisk(void);
+void config_plex(void);
+void config_volume(void);
+void config_drive(void);
+void updateconfig(int);
+void update_sd_config(int sdno, int kernelstate);
+void update_plex_config(int plexno, int kernelstate);
+void update_volume_config(int volno, int kernelstate);
+void update_config(void);
+void drive_io_done(struct buf *);
+int save_config(void);
+void write_config(char *, int);
+int start_config(void);
+void finish_config(int);
+void remove(struct vinum_ioctl_msg *msg);
+void remove_drive_entry(int driveno, int force, int recurse);
+void remove_sd_entry(int sdno, int force, int recurse);
+void remove_plex_entry(int plexno, int force, int recurse);
+void remove_volume_entry(int volno, int force, int recurse);
+
+void checkernel(char *);
+int open_drive(struct drive *, struct proc *);
+void close_drive(struct drive *drive);
+int driveio(struct drive *, void *, size_t, off_t, int);
+/* #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
+ #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE) */
+int set_drive_parms(struct drive *drive);
+int init_drive(struct drive *);
+/* void throw_rude_remark (int, struct _ioctl_reply *, char *, ...); XXX */
+void throw_rude_remark(int, char *,...);
+
+int read_drive(struct drive *drive, void *buf, size_t length, off_t offset);
+int write_drive(struct drive *drive, void *buf, size_t length, off_t offset);
+void format_config(char *config, int len);
+void checkkernel(char *op);
+void free_drive(struct drive *drive);
+void down_drive(struct drive *drive);
+void remove_drive(int driveno);
+
+/* I/O */
+d_open_t vinumopen;
+d_close_t vinumclose;
+d_strategy_t vinumstrategy;
+d_ioctl_t vinumioctl;
+d_dump_t vinumdump;
+d_psize_t vinumsize;
+d_read_t vinumread;
+d_write_t vinumwrite;
+
+int vinumstart(struct buf *bp, int reviveok);
+int launch_requests(struct request *rq, int reviveok);
+
+/* XXX Do we need this? */
+int vinumpart(dev_t);
+
+/* Memory allocation */
+void vinum_meminfo(caddr_t data);
+int vinum_mallocinfo(caddr_t data);
+
+void expand_table(void **, int, int);
+
+void add_defective_region(struct plex *plex, off_t offset, size_t length);
+void add_unmapped_region(struct plex *plex, off_t offset, size_t length);
+void rebuild_plex_unmappedlist(struct plex *plex);
+struct request;
+struct rqgroup *allocrqg(struct request *rq, int elements);
+void deallocrqg(struct rqgroup *rqg);
+
+/* State transitions */
+int set_drive_state(int driveno, enum drivestate state, int force);
+int set_sd_state(int sdno, enum sdstate state, enum setstateflags flags);
+enum requeststatus checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend);
+int set_plex_state(int plexno, enum plexstate state, enum setstateflags flags);
+int set_volume_state(int volumeno, enum volumestate state, enum setstateflags flags);
+void get_volume_label(struct volume *vol, struct disklabel *lp);
+int write_volume_label(int);
+void start_object(struct vinum_ioctl_msg *);
+void stop_object(struct vinum_ioctl_msg *);
+void setstate(struct vinum_ioctl_msg *msg);
+void vinum_label(int);
+int vinum_writedisklabel(struct volume *, struct disklabel *);
+int initsd(int);
+
+int restart_plex(int plexno);
+int revive_block(int plexno);
+
+/* Auxiliary functions */
+enum sdstates sdstatemap(struct plex *plex, int *sddowncount);
+enum volplexstate vpstate(struct plex *plex);
+#endif
+
+enum keyword get_keyword(char *, struct keywordset *);
+void listconfig(void);
+char *drive_state(enum drivestate);
+char *volume_state(enum volumestate);
+char *plex_state(enum plexstate);
+char *plex_org(enum plexorg);
+char *sd_state(enum sdstate);
+enum drivestate DriveState(char *text);
+enum sdstate SdState(char *text);
+enum plexstate PlexState(char *text);
+enum volumestate VolState(char *text);
+struct drive *validdrive(int driveno, struct _ioctl_reply *);
+struct sd *validsd(int sdno, struct _ioctl_reply *);
+struct plex *validplex(int plexno, struct _ioctl_reply *);
+struct volume *validvol(int volno, struct _ioctl_reply *);
+int tokenize(char *, char *[]);
+void resetstats(struct vinum_ioctl_msg *msg);
+
+/* Locking */
+int lockvol(struct volume *vol);
+void unlockvol(struct volume *vol);
+int lockplex(struct plex *plex);
+void unlockplex(struct plex *plex);
+int lockrange(struct plex *plex, off_t first, off_t last);
+void unlockrange(struct plex *plex, off_t first, off_t last);
+int lock_config(void);
+void unlock_config(void);
+
+#ifdef DEBUG
+#define expandrq(prq) \
+{ \
+ expand_table ((void **) &prq->rqe, \
+ prq->requests * sizeof (struct rqelement), \
+ (prq->requests + RQELTS) * sizeof (struct rqelement) ); \
+ bzero (&prq->rqe [prq->requests], RQELTS * sizeof (struct rqelement)); \
+ prq->rqcount += RQELTS; \
+ }
+#else
+void expandrq(struct plexrq *);
+#endif
diff --git a/sys/modules/vinum/vinumhdr.h b/sys/modules/vinum/vinumhdr.h
new file mode 100644
index 000000000000..22a856182396
--- /dev/null
+++ b/sys/modules/vinum/vinumhdr.h
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ */
+
+/* Header files used by all modules */
+/* $Id: vinumhdr.h,v 1.7 1998/08/07 04:41:18 grog Exp grog $ */
+
+#ifdef KERNEL
+#define REALLYKERNEL
+#endif
+#include <sys/param.h>
+#ifdef REALLYKERNEL
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#endif
+#ifdef DEVFS
+#error "DEVFS code not complete yet"
+#include <sys/devfsext.h>
+#endif /*DEVFS */
+#include <sys/proc.h>
+#include <sys/errno.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/malloc.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/conf.h>
+#include <sys/stat.h>
+#include <sys/disklabel.h>
+#include <ufs/ffs/fs.h>
+#include <sys/mount.h>
+#include <sys/device.h>
+#undef KERNEL /* XXX */
+#include <sys/disk.h>
+#ifdef REALLYKERNEL
+#define KERNEL
+#endif
+#include <sys/syslog.h>
+#include <sys/fcntl.h>
+#include <sys/vnode.h>
+#include <sys/dkbad.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <vm/vm.h>
+#ifdef USES_VM
+/* XXX Do we need this? */
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_object.h>
+#include <vm/vm_prot.h>
+/* #include <vm/vm_page.h> */
+#include <sys/vmmeter.h>
+/* #include <machine/pmap.h> */
+#include <machine/cputypes.h>
+#endif /* USES_VM */
+#include <vinumvar.h>
+#include <vinumio.h>
+#include "vinumkw.h"
+#include "vinumext.h"
+
+#undef Free /* defined in some funny net stuff */
+#ifdef REALLYKERNEL
+#define Malloc(x) MMalloc ((x), __FILE__, __LINE__) /* show where we came from */
+#define Free(x) FFree ((x), __FILE__, __LINE__) /* show where we came from */
+caddr_t MMalloc (int size, char *, int);
+void FFree (void *mem, char *, int);
+#else
+#define Malloc(x) malloc ((x)) /* just the size */
+#define Free(x) free ((x)) /* just the address */
+#endif
+
diff --git a/sys/modules/vinum/vinumio.h b/sys/modules/vinum/vinumio.h
new file mode 100644
index 000000000000..be79528a6db8
--- /dev/null
+++ b/sys/modules/vinum/vinumio.h
@@ -0,0 +1,132 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumio.h,v 1.10 1998/08/10 05:46:19 grog Exp grog $
+ */
+
+#define MAX_IOCTL_REPLY 256
+#define L 'F' /* ID letter of our ioctls */
+/* VINUM_CREATE returns a buffer of this kind */
+struct _ioctl_reply {
+ int error;
+ char msg[MAX_IOCTL_REPLY];
+};
+
+/* ioctl requests */
+#define BUFSIZE 1024 /* size of buffer, including continuations */
+#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
+#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
+#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
+#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
+#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
+#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
+#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
+#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
+#define VINUM_SAVECONFIG _IOC(0, L, 72, 0) /* release locks, update, write config to disk */
+#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
+#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
+#ifdef DEBUG
+
+struct debuginfo {
+ int changeit;
+ int param;
+};
+
+#define VINUM_DEBUG _IOWR(L, 75, struct debuginfo) /* call the debugger from ioctl () */
+#endif
+
+enum objecttype {
+ drive_object,
+ sd_object,
+ plex_object,
+ volume_object,
+ invalid_object
+};
+
+/* Start an object. Pass two integers:
+ * msg [0] index in vinum_conf.<object>
+ * msg [1] type of object (see below)
+ *
+ * Return ioctl_reply
+ */
+#define VINUM_SETSTATE _IOC(IOC_IN | IOC_OUT, L, 76, MAX_IOCTL_REPLY) /* start an object */
+
+/* The state to set with VINUM_SETSTATE. Since
+ * each object has a different set of states, we
+ * need to translate later */
+enum objectstate {
+ object_down,
+ object_initializing,
+ object_up
+};
+
+/* This structure is used for modifying objects
+ * (VINUM_SETSTATE, VINUM_REMOVE, VINUM_RESETSTATS, VINUM_ATTACH,
+ * VINUM_DETACH, VINUM_REPLACE
+ */
+struct vinum_ioctl_msg {
+ int index;
+ enum objecttype type;
+ enum objectstate state; /* state to set (VINUM_SETSTATE) */
+ int force; /* do it even if it doesn't make sense */
+ int recurse; /* recurse (VINUM_REMOVE) */
+ int otherobject; /* superordinate object (attach),
+ * replacement object (replace) */
+ int rename; /* rename object (attach) */
+ int64_t offset; /* offset of subdisk (for attach) */
+};
+
+#define VINUM_RELEASECONFIG _IOC(0, L, 77, 0) /* release locks and write config to disk */
+#define VINUM_STARTCONFIG _IOC(0, L, 78, 0) /* start a configuration operation */
+#define VINUM_MEMINFO _IOR(L, 79, struct meminfo) /* get memory usage summary */
+#define VINUM_MALLOCINFO _IOWR(L, 80, struct mc) /* get specific malloc information [i] */
+#define VINUM_LABEL _IOC(IOC_IN | IOC_OUT, L, 81, MAX_IOCTL_REPLY) /* label a volume */
+#define VINUM_INITSD _IOW(L, 82, int) /* initialize a subdisk */
+#define VINUM_REMOVE _IOC(IOC_IN | IOC_OUT, L, 83, MAX_IOCTL_REPLY) /* remove an object */
+#define VINUM_GETUNMAPPED _IOWR(L, 84, struct plexregion) /* get unmapped element (plex, re) */
+#define VINUM_GETDEFECTIVE _IOWR(L, 85, struct plexregion) /* get defective element (plex, re) */
+#define VINUM_RESETSTATS _IOC(IOC_IN | IOC_OUT, L, 86, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_ATTACH _IOC(IOC_IN | IOC_OUT, L, 87, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_DETACH _IOC(IOC_IN | IOC_OUT, L, 88, MAX_IOCTL_REPLY) /* reset object stats */
+
+struct vinum_rename_msg {
+ int index;
+ int recurse; /* rename subordinate objects too */
+ enum objecttype type;
+ char newname[MAXNAME]; /* new name to give to object */
+};
+
+#define VINUM_RENAME _IOC(IOC_IN | IOC_OUT, L, 89, MAX_IOCTL_REPLY) /* reset object stats */
+#define VINUM_REPLACE _IOC(IOC_IN | IOC_OUT, L, 90, MAX_IOCTL_REPLY) /* reset object stats */
diff --git a/sys/modules/vinum/vinumioctl.c b/sys/modules/vinum/vinumioctl.c
new file mode 100644
index 000000000000..6dbe3c6bf4d6
--- /dev/null
+++ b/sys/modules/vinum/vinumioctl.c
@@ -0,0 +1,787 @@
+/* XXX replace all the checks on object validity with
+ * calls to valid<object> */
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumioctl.c,v 1.1 1998/08/14 08:46:10 grog Exp grog $
+ */
+
+#define STATIC /* nothing while we're testing XXX */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
+#include <sys/reboot.h>
+#endif
+
+jmp_buf command_fail; /* return on a failed command */
+
+#if __FreeBSD__ >= 3
+/* Why aren't these declared anywhere? XXX */
+int setjmp(jmp_buf);
+void longjmp(jmp_buf, int);
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
+
+int vinum_inactive(void);
+void free_vinum(int);
+void attachobject(struct vinum_ioctl_msg *);
+void detachobject(struct vinum_ioctl_msg *);
+void renameobject(struct vinum_rename_msg *);
+void replaceobject(struct vinum_ioctl_msg *);
+
+/* ioctl routine */
+int
+vinumioctl(dev_t dev,
+#if __FreeBSD__ >= 3
+ u_long cmd,
+#else
+ int cmd,
+#endif
+ caddr_t data,
+ int flag,
+ struct proc *p)
+{
+ BROKEN_GDB;
+ unsigned int objno;
+ int error = 0;
+ struct volume *vol;
+ unsigned int index; /* for transferring config info */
+ unsigned int sdno; /* for transferring config info */
+ int fe; /* free list element number */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* struct to return */
+
+ struct devcode *device = (struct devcode *) &dev;
+
+ /* First, decide what we're looking at */
+ switch (device->type) {
+ case VINUM_SUPERDEV_TYPE:
+ myproc = p; /* save pointer to process */
+ ioctl_reply = (struct _ioctl_reply *) data; /* save the address to reply to */
+ error = setjmp(command_fail); /* come back here on error */
+ if (error) /* bombed out */
+ return 0; /* the reply will contain meaningful info */
+ switch (cmd) {
+ /* XXX #ifdef DEBUG */
+ case VINUM_DEBUG:
+ boothowto |= RB_GDB; /* serial debug line */
+ if (((struct debuginfo *) data)->changeit) /* change debug settings */
+ debug = (((struct debuginfo *) data)->param);
+ else
+ Debugger("vinum debug");
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+ /* XXX #endif */
+
+ case VINUM_CREATE: /* create a vinum object */
+ error = lock_config(); /* get the config for us alone */
+ if (error) /* can't do it, */
+ return error; /* give up */
+ error = setjmp(command_fail); /* come back here on error */
+ if (error == 0) { /* first time, */
+ parse_user_config((char *) data, &keyword_set); /* update the config */
+ ioctl_reply->error = 0; /* no error if we make it here */
+ } else if (ioctl_reply->error == 0) { /* longjmp, but no error status */
+ ioctl_reply->error = EINVAL; /* note that something's up */
+ ioctl_reply->msg[0] = '\0'; /* no message? */
+ }
+ unlock_config();
+ return 0; /* must be 0 to return the real error info */
+
+ case VINUM_GETCONFIG: /* get the configuration information */
+ bcopy(&vinum_conf, data, sizeof(vinum_conf));
+ return 0;
+
+ /* start configuring the subsystem */
+ case VINUM_STARTCONFIG:
+ return start_config(); /* just lock it */
+
+ /* Move the individual parts of the config to user space.
+
+ * Specify the index of the object in the first word of data,
+ * and return the object there
+ */
+ case VINUM_DRIVECONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.drives_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&DRIVE[index], data, sizeof(struct drive)); /* copy the config item out */
+ return 0;
+
+ case VINUM_SDCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.subdisks_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&SD[index], data, sizeof(struct sd)); /* copy the config item out */
+ return 0;
+
+ case VINUM_PLEXCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.plexes_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&PLEX[index], data, sizeof(struct plex)); /* copy the config item out */
+ return 0;
+
+ case VINUM_VOLCONFIG:
+ index = *(int *) data; /* get the index */
+ if (index >= (unsigned) vinum_conf.volumes_used) /* can't do it */
+ return EFAULT; /* bang */
+ bcopy(&VOL[index], data, sizeof(struct volume)); /* copy the config item out */
+ return 0;
+
+ case VINUM_PLEXSDCONFIG:
+ index = *(int *) data; /* get the plex index */
+ sdno = ((int *) data)[1]; /* and the sd index */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(sdno >= PLEX[index].subdisks)) /* or it doesn't have this many subdisks */
+ return EFAULT; /* bang */
+ bcopy(&SD[PLEX[index].sdnos[sdno]], /* copy the config item out */
+ data,
+ sizeof(struct sd));
+ return 0;
+
+ case VINUM_SAVECONFIG:
+ if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
+ finish_config(1); /* finish the configuration and update it */
+ error = save_config(); /* save configuration to disk */
+ } else
+ error = EINVAL; /* queue up for this one, please */
+ return error;
+
+ case VINUM_RELEASECONFIG: /* release the config */
+ if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
+ finish_config(0); /* finish the configuration, don't change it */
+ error = save_config(); /* save configuration to disk */
+ } else
+ error = EINVAL; /* release what config? */
+ return error;
+
+ case VINUM_INIT:
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+
+ case VINUM_RESETCONFIG:
+ if (vinum_inactive() && (vinum_conf.opencount < 2)) { /* if we're not active */
+ /* Note the open count. We may be called from v, so we'll be open.
+ * Keep the count so we don't underflow */
+ int oc = vinum_conf.opencount;
+ free_vinum(1); /* clean up everything */
+ printf("vinum: CONFIGURATION OBLITERATED\n");
+ vinum_conf.opencount = oc;
+ ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
+ ioctl_reply->error = 0;
+ return 0;
+ }
+ return EBUSY;
+
+ case VINUM_SETSTATE:
+ setstate((struct vinum_ioctl_msg *) data); /* set an object state */
+ return 0;
+
+ case VINUM_MEMINFO:
+ vinum_meminfo(data);
+ return 0;
+
+ case VINUM_MALLOCINFO:
+ return vinum_mallocinfo(data);
+
+ case VINUM_LABEL: /* label a volume */
+ ioctl_reply->error = write_volume_label(*(int *) data); /* index of the volume to label */
+ ioctl_reply->msg[0] = '\0'; /* no message */
+ return 0;
+
+ case VINUM_REMOVE:
+ remove((struct vinum_ioctl_msg *) data); /* remove an object */
+ return 0;
+
+ case VINUM_GETFREELIST: /* get a drive free list element */
+ index = *(int *) data; /* get the drive index */
+ fe = ((int *) data)[1]; /* and the free list element */
+ if ((index >= (unsigned) vinum_conf.drives_used) /* plex doesn't exist */
+ ||(DRIVE[index].state == drive_unallocated))
+ return ENODEV;
+ if (fe >= DRIVE[index].freelist_entries) /* no such entry */
+ return ENOENT;
+ bcopy(&DRIVE[index].freelist[fe],
+ data,
+ sizeof(struct drive_freelist));
+ return 0;
+
+ case VINUM_GETDEFECTIVE: /* get a plex defective area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].defective_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].defective_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
+ case VINUM_GETUNMAPPED: /* get a plex unmapped area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].unmapped_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].unmapped_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
+ case VINUM_RESETSTATS:
+ resetstats((struct vinum_ioctl_msg *) data); /* reset object stats */
+ return 0;
+
+ /* attach an object to a superordinate object */
+ case VINUM_ATTACH:
+ attachobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ /* detach an object from a superordinate object */
+ case VINUM_DETACH:
+ detachobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ /* rename an object */
+ case VINUM_RENAME:
+ renameobject((struct vinum_rename_msg *) data);
+ return 0;
+
+ /* replace an object */
+ case VINUM_REPLACE:
+ replaceobject((struct vinum_ioctl_msg *) data);
+ return 0;
+
+ default:
+ /* FALLTHROUGH */
+ }
+
+ default:
+#if __FreeBSD__>=3
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %lx\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
+ cmd); /* XXX */
+
+#else
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %x\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
+ cmd); /* XXX */
+
+#endif
+ return EINVAL;
+
+ case VINUM_DRIVE_TYPE:
+ case VINUM_PLEX_TYPE:
+ return EAGAIN; /* try again next week */
+
+ case VINUM_SD_TYPE:
+ objno = SDNO(dev);
+
+ switch (cmd) {
+ case VINUM_INITSD: /* initialize subdisk */
+ return initsd(objno);
+
+ default:
+ return EINVAL;
+ }
+ break;
+
+ case VINUM_VOLUME_TYPE:
+ objno = VOLNO(dev);
+
+ if ((unsigned) objno >= (unsigned) vinum_conf.volumes_used) /* not a valid volume */
+ return ENXIO;
+ vol = &VOL[objno];
+ if (vol->state != volume_up) /* not up, */
+ return EIO; /* I/O error */
+
+ switch (cmd) {
+ case DIOCGDINFO: /* get disk label */
+ get_volume_label(vol, (struct disklabel *) data);
+ break;
+
+ /* Care! DIOCGPART returns *pointers* to
+ * the caller, so we need to store this crap as well.
+ * And yes, we need it. */
+ case DIOCGPART: /* get partition information */
+ get_volume_label(vol, &vol->label);
+ ((struct partinfo *) data)->disklab = &vol->label;
+ ((struct partinfo *) data)->part = &vol->label.d_partitions[0];
+ break;
+
+ /* We don't have this stuff on hardware,
+ * so just pretend to do it so that
+ * utilities don't get upset. */
+ case DIOCWDINFO: /* write partition info */
+ case DIOCSDINFO: /* set partition info */
+ return 0; /* not a titty */
+
+ case DIOCWLABEL: /* set or reset label writeable */
+ if ((flag & FWRITE) == 0) /* not writeable? */
+ return EACCES; /* no, die */
+ if (*(int *) data != 0) /* set it? */
+ vol->flags |= VF_WLABEL; /* yes */
+ else
+ vol->flags &= ~VF_WLABEL; /* no, reset */
+ break;
+
+ default:
+ return ENOTTY; /* not my kind of ioctl */
+ }
+ break;
+ }
+ return 0; /* XXX */
+}
+
+/* The following four functions check the supplied
+ * object index and return a pointer to the object
+ * if it exists. Otherwise they longjump out via
+ * throw_rude_remark */
+struct drive *
+validdrive(int driveno, struct _ioctl_reply *reply)
+{
+ if ((driveno < vinum_conf.drives_used)
+ && (DRIVE[driveno].state != drive_unallocated))
+ return &DRIVE[driveno];
+ strcpy(reply->msg, "No such drive");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct sd *
+validsd(int sdno, struct _ioctl_reply *reply)
+{
+ if ((sdno < vinum_conf.subdisks_used)
+ && (SD[sdno].state != sd_unallocated))
+ return &SD[sdno];
+ strcpy(reply->msg, "No such subdisk");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct plex *
+validplex(int plexno, struct _ioctl_reply *reply)
+{
+ if ((plexno < vinum_conf.plexes_used)
+ && (PLEX[plexno].state != plex_unallocated))
+ return &PLEX[plexno];
+ strcpy(reply->msg, "No such plex");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+struct volume *
+validvol(int volno, struct _ioctl_reply *reply)
+{
+ if ((volno < vinum_conf.volumes_used)
+ && (VOL[volno].state != volume_unallocated))
+ return &VOL[volno];
+ strcpy(reply->msg, "No such volume");
+ reply->error = ENOENT;
+ return NULL;
+}
+
+/* reset an object's stats */
+void
+resetstats(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+
+ switch (msg->type) {
+ case drive_object:
+ if (msg->index < vinum_conf.drives_used) {
+ struct drive *drive = &DRIVE[msg->index];
+ if (drive->state != drive_unallocated) {
+ drive->reads = 0; /* number of reads on this drive */
+ drive->writes = 0; /* number of writes on this drive */
+ drive->bytes_read = 0; /* number of bytes read */
+ drive->bytes_written = 0; /* number of bytes written */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ case sd_object:
+ if (msg->index < vinum_conf.subdisks_used) {
+ struct sd *sd = &SD[msg->index];
+ if (sd->state != sd_unallocated) {
+ sd->reads = 0; /* number of reads on this subdisk */
+ sd->writes = 0; /* number of writes on this subdisk */
+ sd->bytes_read = 0; /* number of bytes read */
+ sd->bytes_written = 0; /* number of bytes written */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ break;
+
+ case plex_object:
+ if (msg->index < vinum_conf.plexes_used) {
+ struct plex *plex = &PLEX[msg->index];
+ if (plex->state != plex_unallocated) {
+ plex->reads = 0;
+ plex->writes = 0; /* number of writes on this plex */
+ plex->bytes_read = 0; /* number of bytes read */
+ plex->bytes_written = 0; /* number of bytes written */
+ plex->multiblock = 0; /* requests that needed more than one block */
+ plex->multistripe = 0; /* requests that needed more than one stripe */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ break;
+
+ case volume_object:
+ if (msg->index < vinum_conf.volumes_used) {
+ struct volume *vol = &VOL[msg->index];
+ if (vol->state != volume_unallocated) {
+ vol->bytes_read = 0; /* number of bytes read */
+ vol->bytes_written = 0; /* number of bytes written */
+ vol->reads = 0; /* number of reads on this volume */
+ vol->writes = 0; /* number of writes on this volume */
+ vol->recovered_reads = 0; /* reads recovered from another plex */
+ reply->error = 0;
+ return;
+ }
+ reply->error = EINVAL;
+ return;
+ }
+ case invalid_object: /* can't get this */
+ reply->error = EINVAL;
+ return;
+ }
+}
+
+/* attach an object to a superior object */
+void
+attachobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ case volume_object: /* nor a volume */
+ case invalid_object: /* "this can't happen" */
+ reply->error = EINVAL;
+ reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
+ return;
+
+ case sd_object:
+ sd = validsd(msg->index, reply);
+ if (sd == NULL) /* not a valid subdisk */
+ return;
+ plex = validplex(msg->otherobject, reply);
+ if (plex) {
+ if (sd->plexno >= 0) { /* already belong to a plex */
+ reply->error = EBUSY; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd->plexoffset = msg->offset; /* this is where we want it */
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* make sure it's stale */
+ give_sd_to_plex(plex->plexno, sd->sdno); /* and give it to the plex */
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ break;
+
+ case plex_object:
+ plex = validplex(msg->index, reply); /* get plex */
+ if (plex == NULL)
+ return;
+ if (plex->organization != plex_concat) { /* can't attach to striped and raid-5 */
+ reply->error = EINVAL; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ vol = validvol(msg->otherobject, reply); /* and volume information */
+ if (vol) {
+ if ((vol->plexes == MAXPLEX) /* we have too many already */
+ ||(plex->volno >= 0)) { /* or the plex has an owner */
+ reply->error = EINVAL; /* no message, the user should check */
+ reply->msg[0] = '\0';
+ return;
+ }
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* make sure it's down */
+ give_plex_to_volume(msg->otherobject, msg->index); /* and give it to the volume */
+ update_plex_config(plex->plexno, 0);
+ save_config();
+ if (plex->state == plex_reviving)
+ reply->error = EAGAIN; /* need to revive it */
+ else
+ reply->error = 0;
+ }
+ }
+}
+
+/* detach an object from a superior object */
+void
+detachobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+ int sdno;
+ int plexno;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ case volume_object: /* nor a volume */
+ case invalid_object: /* "this can't happen" */
+ reply->error = EINVAL;
+ reply->msg[0] = '\0'; /* vinum(8) doesn't do this */
+ return;
+
+ case sd_object:
+ sd = validsd(msg->index, reply);
+ if (sd == NULL)
+ return;
+ if (sd->plexno < 0) { /* doesn't belong to a plex */
+ reply->error = ENOENT;
+ strcpy(reply->msg, "Subdisk is not attached");
+ return;
+ } else { /* valid plex number */
+ plex = &PLEX[sd->plexno];
+ if ((!msg->force) /* don't force things */
+ &&((plex->state == plex_up) /* and the plex is up */
+ ||((plex->state == plex_flaky) && sd->state == sd_up))) { /* or flaky with this sd up */
+ reply->error = EBUSY; /* we need this sd */
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd->plexno = -1; /* anonymous sd */
+ if (plex->subdisks == 1) { /* this was the only subdisk */
+ Free(plex->sdnos); /* free the subdisk array */
+ plex->sdnos = NULL; /* and note the fact */
+ plex->subdisks_allocated = 0; /* no subdisk space */
+ } else {
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ if (plex->sdnos[sdno] == msg->index) /* found our subdisk */
+ break;
+ }
+ if (sdno < (plex->subdisks - 1)) /* not the last one, compact */
+ bcopy(&plex->sdnos[sdno + 1],
+ &plex->sdnos[sdno],
+ (plex->subdisks - 1 - sdno) * sizeof(int));
+ }
+ plex->subdisks--;
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list */
+ if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* this subdisk is named after the plex */
+ bcopy(sd->name,
+ &sd->name[3],
+ min(strlen(sd->name), MAXSDNAME - 3));
+ bcopy("ex-", sd->name, 3);
+ sd->name[MAXSDNAME - 1] = '\0';
+ }
+ update_plex_config(plex->plexno, 0);
+ if ((plex->organization == plex_striped) /* we've just mutilated our plex, */
+ ||(plex->organization == plex_striped)) /* the data no longer matches */
+ set_plex_state(plex->plexno,
+ plex_down,
+ setstate_force | setstate_configuring);
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case plex_object:
+ plex = validplex(msg->index, reply); /* get plex */
+ if (plex == NULL)
+ return;
+ if (plex->volno >= 0) {
+ int volno = plex->volno;
+
+ vol = &VOL[volno];
+ if ((!msg->force) /* don't force things */
+ &&((vol->state == volume_up) /* and the volume is up */
+ &&(vol->plexes == 1))) { /* and this is the last plex */
+ /* XXX As elsewhere, check whether we will lose
+ * mapping by removing this plex */
+ reply->error = EBUSY; /* we need this plex */
+ reply->msg[0] = '\0';
+ return;
+ }
+ plex->volno = -1; /* anonymous plex */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ if (vol->plex[plexno] == msg->index) /* found our plex */
+ break;
+ }
+ if (plexno < (vol->plexes - 1)) /* not the last one, compact */
+ bcopy(&vol[plexno + 1], &vol[plexno], (vol->plexes - 1 - plexno) * sizeof(int));
+ vol->plexes--;
+ if (!bcmp(vol->name, plex->name, strlen(vol->name))) { /* this plex is named after the volume */
+ /* First, check if the subdisks are the same */
+ if (msg->recurse) {
+ int sdno;
+
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ struct sd *sd = &SD[plex->sdnos[sdno]];
+
+ if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* subdisk is named after the plex */
+ bcopy(sd->name, &sd->name[3], min(strlen(sd->name), MAXSDNAME - 3));
+ bcopy("ex-", sd->name, 3);
+ sd->name[MAXSDNAME - 1] = '\0';
+ }
+ }
+ }
+ bcopy(plex->name, &plex->name[3], min(strlen(plex->name), MAXPLEXNAME - 3));
+ bcopy("ex-", plex->name, 3);
+ plex->name[MAXPLEXNAME - 1] = '\0';
+ }
+ update_plex_config(plex->plexno, 0);
+ update_volume_config(volno, 0);
+ save_config();
+ reply->error = 0;
+ } else {
+ reply->error = ENOENT;
+ strcpy(reply->msg, "Plex is not attached");
+ }
+ }
+}
+
+void
+renameobject(struct vinum_rename_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+ struct drive *drive;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *vol;
+
+ switch (msg->type) {
+ case drive_object: /* you can't attach a drive to anything */
+ if (find_drive(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ drive = validdrive(msg->index, reply);
+ if (drive) {
+ bcopy(msg->newname, drive->label.name, MAXDRIVENAME);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case sd_object: /* you can't attach a subdisk to anything */
+ if (find_subdisk(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ sd = validsd(msg->index, reply);
+ if (sd) {
+ bcopy(msg->newname, sd->name, MAXSDNAME);
+ update_sd_config(sd->sdno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case plex_object: /* you can't attach a plex to anything */
+ if (find_plex(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ plex = validplex(msg->index, reply);
+ if (plex) {
+ bcopy(msg->newname, plex->name, MAXPLEXNAME);
+ update_plex_config(plex->plexno, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case volume_object: /* you can't attach a volume to anything */
+ if (find_volume(msg->newname, 0) >= 0) { /* we have that name already, */
+ reply->error = EEXIST;
+ reply->msg[0] = '\0';
+ return;
+ }
+ vol = validvol(msg->index, reply);
+ if (vol) {
+ bcopy(msg->newname, vol->name, MAXVOLNAME);
+ update_volume_config(msg->index, 0);
+ save_config();
+ reply->error = 0;
+ }
+ return;
+
+ case invalid_object:
+ reply->error = EINVAL;
+ reply->msg[0] = '\0';
+ }
+}
+
+/* Replace one object with another */
+void
+replaceobject(struct vinum_ioctl_msg *msg)
+{
+ struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
+
+ reply->error = ENODEV; /* until I know how to do this */
+ strcpy(reply->msg, "replace not implemented yet");
+/* save_config (); */
+}
diff --git a/sys/modules/vinum/vinumkw.h b/sys/modules/vinum/vinumkw.h
new file mode 100644
index 000000000000..1a81f37656f4
--- /dev/null
+++ b/sys/modules/vinum/vinumkw.h
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumkw.h,v 1.7 1998/08/07 02:35:51 grog Exp grog $
+ */
+
+/* Command keywords that vinum knows. These include both user-level
+ * and kernel-level stuff */
+
+/* Our complete vocabulary. The names of the commands are
+ * the same as the identifier without the kw_ at the beginning
+ * (i.e. kw_create defines the "create" keyword). Preprocessor
+ * magic in parser.c does the rest. */
+enum keyword {
+ kw_create,
+ kw_modify,
+ kw_list,
+ kw_l = kw_list,
+ kw_ld, /* list drive */
+ kw_ls, /* list subdisk */
+ kw_lp, /* list plex */
+ kw_lv, /* list volume */
+ kw_set,
+ kw_rm,
+ kw_start,
+ kw_stop,
+ kw_drive,
+ kw_sd,
+ kw_subdisk = kw_sd,
+ kw_plex,
+ kw_volume,
+ kw_vol = kw_volume,
+ kw_read,
+ kw_readpol,
+ kw_org,
+ kw_name,
+ kw_concat,
+ kw_striped,
+ kw_raid5,
+ kw_driveoffset,
+ kw_plexoffset,
+ kw_len,
+ kw_length = kw_len,
+ kw_state,
+ kw_setupstate,
+ kw_d, /* flag names */
+ kw_f,
+ kw_r,
+ kw_s,
+ kw_v,
+ kw_round, /* round robin */
+ kw_prefer, /* prefer plex */
+ kw_device,
+ kw_init,
+ kw_label,
+ kw_resetconfig,
+ kw_writethrough,
+ kw_writeback,
+ kw_raw,
+ kw_resetstats,
+ kw_attach,
+ kw_detach,
+ kw_rename,
+ kw_printconfig,
+ kw_replace,
+ kw_detached,
+#ifdef DEBUG
+ kw_debug, /* go into debugger */
+ kw_info,
+#endif
+ kw_invalid_keyword = -1
+};
+
+struct _keywords {
+ char *name;
+ enum keyword keyword;
+};
+
+struct keywordset {
+ int size;
+ struct _keywords *k;
+};
+
+extern struct _keywords keywords[];
+extern struct _keywords flag_keywords[];
+
+extern struct keywordset keyword_set;
+extern struct keywordset flag_set;
diff --git a/sys/modules/vinum/vinumstate.h b/sys/modules/vinum/vinumstate.h
new file mode 100644
index 000000000000..0b07590b2cf6
--- /dev/null
+++ b/sys/modules/vinum/vinumstate.h
@@ -0,0 +1,213 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumstate.h,v 1.11 1998/08/04 06:22:49 grog Exp grog $
+ */
+
+/* This file gets read by makestatetext to create text files
+ * with the names of the states, so don't change the file
+ * format */
+
+enum volumestate {
+ volume_unallocated,
+ /* present but unused. Must be 0 */
+
+ volume_uninit,
+ /* mentioned elsewhere but not defined */
+
+ volume_down,
+
+ /* The volume is up and functional, but not all plexes may be available */
+ volume_up,
+ volume_laststate = volume_up /* last value, for table dimensions */
+};
+
+enum plexstate {
+ /* An empty entry, not a plex at all. */
+ plex_unallocated,
+
+ /* The plex has been allocated, but there configuration
+ * is not complete */
+ plex_init,
+
+ /* A plex which has gone completely down because of
+ * I/O errors. */
+ plex_faulty,
+
+ /* A plex which has been taken down by the
+ * administrator. */
+ plex_down,
+
+ /* A plex which is currently being brought up after
+ * being not up. This involves copying data from
+ * another plex */
+ plex_reviving,
+
+ /* A plex which is being initialized */
+ plex_initializing,
+
+ /* *** The remaining states represent plexes which are
+ * at least partially up. Keep these separate so that
+ * they can be checked more easily. */
+
+ /* A plex entry which is at least partially up. Not
+ * all subdisks are available, and an inconsistency
+ * has occurred. If no other plex is uncorrupted,
+ * the volume is no longer consistent. */
+ plex_corrupt,
+
+ plex_firstup = plex_corrupt, /* first "up" state */
+
+ /* A plex entry which is at least partially up. Not
+ * all subdisks are available, but so far no
+ * inconsistency has occurred (this will change with
+ * the first write to the address space occupied by
+ * a defective subdisk). A RAID 5 plex with one subdisk
+ * down will remain degraded even after a write */
+ plex_degraded,
+
+ /* A plex which is really up, but which has a reborn
+ * subdisk which we don't completely trust, and
+ * which we don't want to read if we can avoid it */
+ plex_flaky,
+
+ /* A plex entry which is completely up. All subdisks
+ * are up. */
+ plex_up,
+
+ plex_laststate = plex_up /* last value, for table dimensions */
+};
+
+/* subdisk states */
+enum sdstate {
+ /* An empty entry, not a subdisk at all. */
+ sd_unallocated,
+
+ /* A subdisk entry which has not been created
+ * completely. Some fields may be empty.
+ */
+ sd_uninit,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, but the disk hasn't
+ * been updated.
+ */
+ sd_init,
+
+ /* A subdisk entry which has been created completely and
+ * which is currently being initialized */
+ sd_initializing,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, and the disk has been
+ * updated, but there is no data on the disk.
+ */
+ sd_empty,
+
+ /* *** The following states represent invalid data */
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down, and as a result updates have been
+ * missed.
+ */
+ sd_obsolete,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down, updates have been lost, and then
+ * the drive came up again.
+ */
+ sd_stale,
+
+ /* *** The following states represent valid, inaccessible data */
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down. No attempt has been made to write
+ * to the subdisk since the crash.
+ */
+ sd_crashed,
+
+ /* A subdisk entry which was up, which contained
+ * valid data, and which was taken down by the
+ * administrator. The data is valid. */
+ sd_down,
+
+ /* *** The following states represent accessible subdisks
+ * with valid data */
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down and up again. No updates were lost,
+ * but it is possible that the subdisk has been
+ * damaged. We won't read from this subdisk if we
+ * have a choice. If this is the only subdisk which
+ * covers this address space in the plex, we set its
+ * state to sd_up under these circumstances, so this
+ * status implies that there is another subdisk to
+ * fulfil the request.
+ */
+ sd_reborn,
+
+ /* A subdisk entry which has been created completely.
+ * All fields are correct, the disk has been updated,
+ * and the data is valid.
+ */
+ sd_up,
+
+ sd_laststate = sd_up /* last value, for table dimensions */
+};
+
+enum drivestate {
+ drive_unallocated,
+ /* present but unused. Must be 0 */
+
+ drive_uninit,
+ /* just mentioned in some other config entry */
+
+ drive_down,
+ /* not accessible */
+
+ drive_coming_up,
+ /* in the process of being brought up */
+
+ drive_up,
+ /* up and running */
+
+ drive_laststate = drive_up /* last value, for table dimensions */
+};
diff --git a/sys/modules/vinum/vinumvar.h b/sys/modules/vinum/vinumvar.h
new file mode 100644
index 000000000000..ca54f76aad02
--- /dev/null
+++ b/sys/modules/vinum/vinumvar.h
@@ -0,0 +1,510 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * 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 Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company 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 ``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 company 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.
+ *
+ * $Id: vinumvar.h,v 1.15 1998/08/14 06:36:41 grog Exp grog $
+ */
+
+/* XXX gdb can't find our global pointers, so use this kludge to
+ * point to them locally. Remove after testing */
+#define BROKEN_GDB struct _vinum_conf *VC = &vinum_conf
+
+#include <sys/time.h>
+#include "vinumstate.h"
+/* Some configuration maxima. They're an enum because
+ * we can't define global constants. Sorry about that.
+ *
+ * These aren't as bad as they look: most of them
+ * are soft limits. Only the MAXCONFIG parameter is set in stone
+ */
+
+enum constants {
+ VINUM_HEADER = 512, /* size of header on disk */
+ MAXCONFIGLINE = 1024, /* maximum size of a single config line */
+ /* XXX Do we still need this? */
+ MINVINUMSLICE = 1048576, /* minimum size of a slice */
+
+ CDEV_MAJOR = 91, /* major number for character device */
+ BDEV_MAJOR = 25, /* and block device */
+
+ ROUND_ROBIN_READPOL = -1, /* round robin read policy */
+
+ /* type field in minor number */
+ VINUM_VOLUME_TYPE = 0,
+ VINUM_PLEX_TYPE = 1,
+ VINUM_SD_TYPE = 2,
+ VINUM_DRIVE_TYPE = 3,
+ VINUM_SUPERDEV_TYPE = 4, /* super device. */
+
+ /* Shifts for the individual fields in the device */
+ VINUM_TYPE_SHIFT = 28,
+ VINUM_VOL_SHIFT = 0,
+ VINUM_PLEX_SHIFT = 16,
+ VINUM_SD_SHIFT = 20,
+ VINUM_VOL_WIDTH = 8,
+ VINUM_PLEX_WIDTH = 3,
+ VINUM_SD_WIDTH = 8,
+ MAJORDEV_SHIFT = 8,
+
+
+/* Create a block device number */
+#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
+ | (v << VINUM_VOL_SHIFT) \
+ | (p << VINUM_PLEX_SHIFT) \
+ | (s << VINUM_SD_SHIFT) \
+ | (t << VINUM_TYPE_SHIFT) )
+
+/* And a character device number */
+#define VINUMCDEV(v,p,s,t) ((CDEV_MAJOR << MAJORDEV_SHIFT) \
+ | (v << VINUM_VOL_SHIFT) \
+ | (p << VINUM_PLEX_SHIFT) \
+ | (s << VINUM_SD_SHIFT) \
+ | (t << VINUM_TYPE_SHIFT) )
+
+/* extract device type */
+#define DEVTYPE(x) ((x >> VINUM_TYPE_SHIFT) & 7)
+
+/* extract volume number */
+#define VOLNO(x) (x & ((1 << VINUM_VOL_WIDTH) - 1))
+
+/* extract plex number */
+#define PLEXNO(x) (VOL [VOLNO (x)].plex [(x >> VINUM_PLEX_SHIFT) & ((1 << VINUM_PLEX_WIDTH) - 1)])
+
+/* extract subdisk number */
+#define SDNO(x) (PLEX [PLEXNO (x)].sdnos [(x >> VINUM_SD_SHIFT) & ((1 << VINUM_SD_WIDTH) - 1)])
+
+/* extract drive number */
+#define DRIVENO(x) (SD [SDNO (x)].driveno)
+
+ VINUM_SUPERDEV = VINUMBDEV(0, 0, 0, VINUM_SUPERDEV_TYPE), /* superdevice number */
+
+/* the number of object entries to cater for initially, and also the
+ * value by which they are incremented. It doesn't take long
+ * to extend them, so theoretically we could start with 1 of each, but
+ * it's untidy to allocate such small areas. These values are
+ * probably too small.
+ */
+
+ INITIAL_DRIVES = 4,
+ INITIAL_VOLUMES = 4,
+ INITIAL_PLEXES = 8,
+ INITIAL_SUBDISKS = 16,
+ INITIAL_SUBDISKS_IN_PLEX = 4, /* number of subdisks to allocate to a plex */
+ INITIAL_SUBDISKS_IN_DRIVE = 4, /* number of subdisks to allocate to a drive */
+ INITIAL_DRIVE_FREELIST = 16, /* number of entries in drive freelist */
+ PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
+ INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
+ DEFAULT_REVIVE_BLOCKSIZE = 32768, /* size of block to transfer in one op */
+};
+
+/* device numbers */
+
+/*
+ * 31 30 28 27 20 19 18 16 15 8 7 0
+ * |-----------------------------------------------------------------------------------------------|
+ * |X | Type | Subdisk number | X| Plex | Major number | volume number |
+ * |-----------------------------------------------------------------------------------------------|
+ *
+ * 0x2 03 1 19 06
+ */
+struct devcode {
+/* CARE. These fields assume a big-endian word. On a
+ * little-endian system, they're the wrong way around */
+ unsigned volume:8; /* up to 256 volumes */
+ unsigned major:8; /* this is where the major number fits */
+ unsigned plex:3; /* up to 8 plexes per volume */
+ unsigned unused:1; /* up for grabs */
+ unsigned sd:8; /* up to 256 subdisks per plex */
+ unsigned type:3; /* type of object */
+ /* type field
+ VINUM_VOLUME = 0,
+ VINUM_PLEX = 1,
+ VINUM_SUBDISK = 2,
+ VINUM_DRIVE = 3,
+ VINUM_SUPERDEV = 4, */
+ unsigned signbit:1; /* to make 32 bits */
+};
+
+#define VINUM_DIR "/dev/vinum"
+#define VINUM_RDIR "/dev/rvinum"
+#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
+#define MAXDRIVENAME 32 /* maximum length of a device name */
+#define MAXSDNAME 64 /* maximum length of a subdisk name */
+#define MAXPLEXNAME 64 /* maximum length of a plex name */
+#define MAXVOLNAME 64 /* maximum length of a volume name */
+#define MAXNAME 64 /* maximum length of any name */
+#define MAXVOLPLEX 8 /* maximum number of plexes in a volume */
+
+/* Flags for all objects. Most of them only apply to
+ * specific objects, but we have space for all in any
+ * 32 bit flags word. */
+enum objflags {
+ VF_LOCKED = 1, /* somebody has locked access to this object */
+ VF_LOCKING = 2, /* we want access to this object */
+ VF_WRITETHROUGH = 8, /* volume: write through */
+ VF_INITED = 0x10, /* unit has been initialized */
+ VF_WLABEL = 0x20, /* label area is writable */
+ VF_LABELLING = 0x40, /* unit is currently being labelled */
+ VF_WANTED = 0x80, /* someone is waiting to obtain a lock */
+ VF_RAW = 0x100, /* raw volume (no file system) */
+ VF_LOADED = 0x200, /* module is loaded */
+ VF_CONFIGURING = 0x400, /* somebody is changing the config */
+ VF_WILL_CONFIGURE = 0x800, /* somebody wants to change the config */
+ VF_CONFIG_INCOMPLETE = 0x1000, /* haven't finished changing the config */
+ VF_CONFIG_SETUPSTATE = 0x2000, /* set a volume up if all plexes are empty */
+ VF_READING_CONFIG = 0x4000, /* we're reading config database from disk */
+ VF_KERNELOP = 0x8000, /* we're performing ops from kernel space */
+};
+
+/* Global configuration information for the vinum subsystem */
+struct _vinum_conf {
+ /* Pointers to vinum structures */
+ struct drive *drive;
+ struct sd *sd;
+ struct plex *plex;
+ struct volume *volume;
+
+ /* the number allocated */
+ int drives_allocated;
+ int subdisks_allocated;
+ int plexes_allocated;
+ int volumes_allocated;
+
+ /* and the number currently in use */
+ int drives_used;
+ int subdisks_used;
+ int plexes_used;
+ int volumes_used;
+
+ int flags;
+ int opencount; /* number of times we've been opened */
+#if DEBUG
+ int lastrq;
+ struct buf *lastbuf;
+#endif
+};
+
+/* Use these defines to simplify code */
+#define DRIVE vinum_conf.drive
+#define SD vinum_conf.sd
+#define PLEX vinum_conf.plex
+#define VOL vinum_conf.volume
+#define VFLAGS vinum_conf.flags
+
+/* Slice header
+
+ * Vinum drives start with this structure:
+ *
+ * Sector
+ * |--------------------------------------|
+ * | PDP-11 memorial boot block | 0
+ * |--------------------------------------|
+ * | Disk label, maybe | 1
+ * |--------------------------------------|
+ * | Slice definition (vinum_hdr) | 2
+ * |--------------------------------------|
+ * | |
+ * | Configuration info, first copy | 3
+ * | |
+ * |--------------------------------------|
+ * | |
+ * | Configuration info, second copy | 3 + size of config
+ * | |
+ * |--------------------------------------|
+ */
+
+/* Sizes and offsets of our information */
+enum {
+ VINUM_LABEL_OFFSET = 4096, /* offset of vinum label */
+ VINUMHEADERLEN = 512, /* size of vinum label */
+ VINUM_CONFIG_OFFSET = 4608, /* offset of first config copy */
+ MAXCONFIG = 65536, /* and size of config copy */
+ DATASTART = (MAXCONFIG * 2 + VINUM_CONFIG_OFFSET) / DEV_BSIZE /* this is where the data starts */
+};
+
+/* hostname is 256 bytes long, but we don't need to shlep
+ * multiple copies in vinum. We use the host name just
+ * to identify this system, and 32 bytes should be ample
+ * for that purpose */
+#define VINUMHOSTNAMELEN 32
+
+struct vinum_label {
+ char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
+ char name[MAXDRIVENAME]; /* our name of the drive */
+ struct timeval date_of_birth; /* the time it was created */
+ struct timeval last_update; /* and the time of last update */
+ off_t drive_size; /* total size in bytes of the drive.
+ * This value includes the headers */
+};
+
+struct vinum_hdr {
+ long long magic; /* we're long on magic numbers */
+ /* XXX Get these right for big-endian */
+#define VINUM_MAGIC 22322600044678729LL /* should be this */
+#define VINUM_NOMAGIC 22322600044678990LL /* becomes this after obliteration */
+ int config_length; /* size in bytes of each copy of the
+ * configuration info.
+ * This must be a multiple of the sector size. */
+
+ struct vinum_label label; /* unique label */
+};
+
+/* Information returned from read_drive_label */
+enum drive_label_info {
+ DL_CANT_OPEN, /* invalid partition */
+ DL_NOT_OURS, /* valid partition, but no vinum label */
+ DL_DELETED_LABEL, /* valid partition, deleted label found */
+ DL_WRONG_DRIVE, /* drive name doesn't match */
+ DL_OURS /* valid partition and label found */
+};
+
+/*** Drive definitions ***/
+/* A drive corresponds to a disk slice. We use a different term to show
+ * the difference in usage: it doesn't have to be a slice, and could
+ * theroretically be a complete, unpartitioned disk */
+
+struct drive {
+ enum drivestate state; /* current state */
+ int subdisks_allocated; /* number of entries in sd */
+ int subdisks_used; /* and the number used */
+ int blocksize; /* size of fs blocks */
+ u_int64_t sectors_available; /* number of sectors still available */
+ int secsperblock;
+ int lasterror; /* last error on drive */
+ int driveno; /* index of drive in vinum_conf */
+ int opencount; /* number of up subdisks */
+ u_int64_t reads; /* number of reads on this drive */
+ u_int64_t writes; /* number of writes on this drive */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ dev_t dev; /* and device number */
+ char devicename[MAXDRIVENAME]; /* name of the slice it's on */
+ struct vnode *vp; /* vnode pointer */
+ struct proc *p;
+ struct vinum_label label; /* and the label information */
+ struct partinfo partinfo; /* partition information */
+ int freelist_size; /* number of entries alloced in free list */
+ int freelist_entries; /* number of entries used in free list */
+ struct drive_freelist { /* sorted list of free space on drive */
+ u_int64_t offset;
+ long sectors;
+ } *freelist;
+};
+
+/*** Subdisk definitions ***/
+
+struct sd {
+ enum sdstate state; /* state */
+ /* offsets in blocks */
+ int64_t driveoffset; /* offset on drive */
+ int64_t plexoffset; /* offset in plex */
+ u_int64_t sectors; /* and length in sectors */
+ int plexno; /* index of plex, if it belongs */
+ int driveno; /* index of the drive on which it is located */
+ int sdno; /* our index in vinum_conf */
+ int pid; /* pid of process which opened us */
+ u_int64_t reads; /* number of reads on this subdisk */
+ u_int64_t writes; /* number of writes on this subdisk */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ char name[MAXSDNAME]; /* name of subdisk */
+};
+
+/*** Plex definitions ***/
+
+/* kinds of plex organization */
+enum plexorg {
+ plex_disorg, /* disorganized */
+ plex_concat, /* concatenated plex */
+ plex_striped, /* striped plex */
+ plex_raid5 /* RAID5 plex */
+};
+
+/* Region in plex (either defective or unmapped) */
+struct plexregion {
+ u_int64_t offset; /* start of region */
+ u_int64_t length; /* length */
+};
+
+struct plex {
+ enum plexorg organization; /* Plex organization */
+ enum plexstate state; /* and current state */
+ u_int64_t length; /* total length of plex (max offset) */
+ int flags;
+ int stripesize; /* size of stripe or raid band, in sectors */
+ int subdisks; /* number of associated subdisks */
+ int subdisks_allocated; /* number of subdisks allocated space for */
+ int *sdnos; /* list of component subdisks */
+ int plexno; /* index of plex in vinum_conf */
+ int volno; /* index of volume */
+ int volplexno; /* number of plex in volume */
+ int pid; /* pid of process which opened us */
+ /* Lock information */
+ int locks; /* number of locks used */
+ int alloclocks; /* number of locks allocated */
+ struct rangelock *lock; /* ranges of locked addresses */
+ /* Statistics */
+ u_int64_t reads; /* number of reads on this plex */
+ u_int64_t writes; /* number of writes on this plex */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ u_int64_t multiblock; /* requests that needed more than one block */
+ u_int64_t multistripe; /* requests that needed more than one stripe */
+ /* revive parameters */
+ u_int64_t revived; /* block number of current revive request */
+ int revive_blocksize; /* revive block size (bytes) */
+ int revive_interval; /* and time to wait between transfers */
+ struct request *waitlist; /* list of requests waiting on revive op */
+ /* geometry control */
+ int defective_regions; /* number of regions which are defective */
+ int defective_region_count; /* number of entries in defective_region */
+ struct plexregion *defective_region; /* list of offset/length pairs: defective sds */
+ int unmapped_regions; /* number of regions which are missing */
+ int unmapped_region_count; /* number of entries in unmapped_region */
+ struct plexregion *unmapped_region; /* list of offset/length pairs: missing sds */
+ char name[MAXPLEXNAME]; /* name of plex */
+};
+
+/*** Volume definitions ***/
+
+#define MAXPLEX 8 /* maximum number of plexes */
+
+
+struct volume {
+ enum volumestate state; /* current state */
+ int plexes; /* number of plexes */
+ int preferred_plex; /* plex to read from, -1 for round-robin */
+ int last_plex_read; /* index of plex used for last read,
+ * for round-robin */
+ dev_t devno; /* device number */
+ int flags; /* status and configuration flags */
+ int opencount; /* number of opens (all the same process) */
+ int openflags; /* flags supplied to last open(2) */
+ u_int64_t size; /* size of volume */
+ int disk; /* disk index */
+ int blocksize; /* logical block size */
+ int active; /* number of outstanding requests active */
+ int subops; /* and the number of suboperations */
+ pid_t pid; /* pid of locker */
+ /* Statistics */
+ u_int64_t bytes_read; /* number of bytes read */
+ u_int64_t bytes_written; /* number of bytes written */
+ u_int64_t reads; /* number of reads on this volume */
+ u_int64_t writes; /* number of writes on this volume */
+ u_int64_t recovered_reads; /* reads recovered from another plex */
+ /* Unlike subdisks in the plex, space for the plex pointers is static */
+ int plex[MAXPLEX]; /* index of plexes */
+ char name[MAXVOLNAME]; /* name of volume */
+ struct disklabel label; /* for DIOCGPART */
+};
+
+/* Table expansion. Expand table, which contains oldcount
+ * entries of type element, by increment entries, and change
+ * oldcount accordingly */
+#define EXPAND(table, element, oldcount, increment) \
+{ \
+ expand_table ((void **) &table, \
+ oldcount * sizeof (element), \
+ (oldcount + increment) * sizeof (element) ); \
+ oldcount += increment; \
+ }
+
+/* Information on vinum's memory usage */
+struct meminfo {
+ int mallocs; /* number of malloced blocks */
+ int total_malloced; /* total amount malloced */
+ int highwater; /* maximum number of mallocs */
+ struct mc *malloced; /* pointer to kernel table */
+};
+
+struct mc {
+ int seq;
+ int size;
+ short line;
+ short flags;
+#define ALLOC_KVA 1 /* allocated via kva calls */
+ int *databuf; /* really vm_object_t */
+ caddr_t address;
+ char file[16];
+};
+
+/* These enums are used by the state transition
+ * routines. They're in bit map format:
+ *
+ * Bit 0: Other plexes in the volume are down
+ * Bit 1: Other plexes in the volume are up
+ * Bit 2: The current plex is up
+ * Maybe they should be local to
+ * state.c */
+enum volplexstate {
+ volplex_onlyusdown = 0, /* we're the only plex, and we're down */
+ volplex_alldown, /* 1: another plex is down, and so are we */
+ volplex_otherup, /* 2: another plex is up */
+ volplex_otherupdown, /* other plexes are up and down */
+ volplex_onlyus, /* 4: we're up and alone */
+ volplex_onlyusup, /* only we are up, others are down */
+ volplex_allup, /* all plexes are up */
+ volplex_someup /* some plexes are up, including us */
+};
+
+/* state map for plex */
+enum sdstates {
+ sd_emptystate = 1,
+ sd_downstate = 2, /* found an SD which is down */
+ sd_crashedstate = 4, /* found an SD which is crashed */
+ sd_obsoletestate = 8, /* found an SD which is obsolete */
+ sd_stalestate = 16, /* found an SD which is stale */
+ sd_rebornstate = 32, /* found an SD which is reborn */
+ sd_upstate = 64, /* found an SD which is up */
+ sd_initstate = 128, /* found an SD which is init */
+ sd_otherstate = 256 /* found an SD in some other state */
+};
+
+/* This is really just a parameter to pass to
+ * set_<foo>_state, but since it needs to be known
+ * in the external definitions, we need to define
+ * it here */
+enum setstateflags {
+ setstate_none = 0, /* no flags */
+ setstate_force = 1, /* force the state change */
+ setstate_configuring = 2, /* we're currently configuring, don't save */
+ setstate_recursing = 4, /* we're called from another setstate function */
+ setstate_norecurse = 8 /* don't call other setstate functions */
+};
+
+#ifdef DEBUG
+/* Debugging stuff */
+#define DEBUG_ADDRESSES 1
+#define DEBUG_NUMOUTPUT 2
+#endif
diff --git a/sys/modules/wcd/Makefile b/sys/modules/wcd/Makefile
new file mode 100644
index 000000000000..9f1dfb102cf7
--- /dev/null
+++ b/sys/modules/wcd/Makefile
@@ -0,0 +1,29 @@
+# $Id: Makefile,v 1.11 1998/02/25 01:40:55 bde Exp $
+
+.PATH: ${.CURDIR}/../../i386/isa
+KMOD = wcd
+SRCS = wcd.c wdc.h wcd.h opt_atapi.h opt_devfs.h
+NOMAN =
+CFLAGS += -DWCD_MODULE
+CLEANFILES += wdc.h wcd.h opt_atapi.h opt_devfs.h
+
+load: ${PROG}
+ ${MODLOAD} -u -e wcd $(PROG)
+
+unload: ${PROG}
+ ${MODUNLOAD} -n wcd
+
+wdc.h:
+ echo "#define NWDC 2" > wdc.h
+ echo "#define NWD 4" >> wdc.h
+
+wcd.h:
+ echo "#define NWCD 1" > wcd.h
+
+opt_atapi.h:
+ echo "#define ATAPI 1"> opt_atapi.h
+
+opt_devfs.h:
+ touch opt_devfs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h
index ba2ef8c65dab..16220e54f4ef 100644
--- a/sys/msdosfs/denode.h
+++ b/sys/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $Id: denode.h,v 1.17 1998/11/21 00:20:24 dt Exp $ */
+/* $Id: denode.h,v 1.15 1998/02/18 09:28:26 jkh Exp $ */
/* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */
/*-
@@ -150,7 +150,6 @@ struct denode {
struct msdosfsmount *de_pmp; /* addr of our mount struct */
u_char de_Name[12]; /* name, from DOS directory entry */
u_char de_Attributes; /* attributes, from directory entry */
- u_char de_LowerCase; /* NT VFAT lower case flags */
u_char de_CHun; /* Hundredth of second of CTime*/
u_short de_CTime; /* creation time */
u_short de_CDate; /* creation date */
@@ -183,7 +182,6 @@ struct denode {
#define DE_INTERNALIZE(dep, dp) \
(bcopy((dp)->deName, (dep)->de_Name, 11), \
(dep)->de_Attributes = (dp)->deAttributes, \
- (dep)->de_LowerCase = (dp)->deLowerCase, \
(dep)->de_CHun = (dp)->deCHundredth, \
(dep)->de_CTime = getushort((dp)->deCTime), \
(dep)->de_CDate = getushort((dp)->deCDate), \
@@ -194,10 +192,12 @@ struct denode {
(dep)->de_FileSize = getulong((dp)->deFileSize), \
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
+#define DE_EXTERNALIZE32(dp, dep) \
+ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
#define DE_EXTERNALIZE(dp, dep) \
(bcopy((dep)->de_Name, (dp)->deName, 11), \
+ bzero((dp)->deReserved, 10), \
(dp)->deAttributes = (dep)->de_Attributes, \
- (dp)->deLowerCase = (dep)->de_LowerCase, \
(dp)->deCHundredth = (dep)->de_CHun, \
putushort((dp)->deCTime, (dep)->de_CTime), \
putushort((dp)->deCDate, (dep)->de_CDate), \
@@ -207,7 +207,7 @@ struct denode {
putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
putulong((dp)->deFileSize, \
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
- putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
+ (FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
#define de_forw de_chain[0]
#define de_back de_chain[1]
@@ -217,33 +217,21 @@ struct denode {
#define VTODE(vp) ((struct denode *)(vp)->v_data)
#define DETOV(de) ((de)->de_vnode)
-#define DETIMES(dep, acc, mod, cre) do { \
- if ((dep)->de_flag & DE_UPDATE) { \
- (dep)->de_flag |= DE_MODIFIED; \
- unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, \
- NULL); \
- (dep)->de_Attributes |= ATTR_ARCHIVE; \
- } \
- if ((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95) { \
- (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
- break; \
- } \
- if ((dep)->de_flag & DE_ACCESS) { \
- u_int16_t adate; \
- \
- unix2dostime((acc), &adate, NULL, NULL); \
- if (adate != (dep)->de_ADate) { \
- (dep)->de_flag |= DE_MODIFIED; \
- (dep)->de_ADate = adate; \
- } \
- } \
- if ((dep)->de_flag & DE_CREATE) { \
- unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, \
- &(dep)->de_CHun); \
- (dep)->de_flag |= DE_MODIFIED; \
- } \
- (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
-} while (0);
+#define DETIMES(dep, acc, mod, cre) \
+ if ((dep)->de_flag & (DE_UPDATE | DE_CREATE | DE_ACCESS)) { \
+ (dep)->de_flag |= DE_MODIFIED; \
+ if ((dep)->de_flag & DE_UPDATE) { \
+ unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, NULL); \
+ (dep)->de_Attributes |= ATTR_ARCHIVE; \
+ } \
+ if (!((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95)) { \
+ if ((dep)->de_flag & DE_ACCESS) \
+ unix2dostime((acc), &(dep)->de_ADate, NULL, NULL); \
+ if ((dep)->de_flag & DE_CREATE) \
+ unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, &(dep)->de_CHun); \
+ } \
+ (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
+ }
/*
* This overlays the fid structure (see mount.h)
diff --git a/sys/msdosfs/direntry.h b/sys/msdosfs/direntry.h
index 796fe78131c8..c0db68c46933 100644
--- a/sys/msdosfs/direntry.h
+++ b/sys/msdosfs/direntry.h
@@ -1,4 +1,4 @@
-/* $Id: direntry.h,v 1.12 1998/02/26 06:45:42 msmith Exp $ */
+/* $Id: direntry.h,v 1.11 1998/02/24 14:13:08 ache Exp $ */
/* $NetBSD: direntry.h,v 1.14 1997/11/17 15:36:32 ws Exp $ */
/*-
@@ -65,9 +65,7 @@ struct direntry {
#define ATTR_VOLUME 0x08 /* entry is a volume label */
#define ATTR_DIRECTORY 0x10 /* entry is a directory name */
#define ATTR_ARCHIVE 0x20 /* file is new or modified */
- u_int8_t deLowerCase; /* NT VFAT lower case flags */
-#define LCASE_BASE 0x08 /* filename base in lower case */
-#define LCASE_EXT 0x10 /* filename extension in lower case */
+ u_int8_t deReserved[1]; /* reserved */
u_int8_t deCHundredth; /* hundredth of seconds in CTime */
u_int8_t deCTime[2]; /* create time */
u_int8_t deCDate[2]; /* create date */
diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c
index 2c792ebf89bb..6c39544cc5ae 100644
--- a/sys/msdosfs/msdosfs_conv.c
+++ b/sys/msdosfs/msdosfs_conv.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_conv.c,v 1.27 1998/05/17 21:18:08 dt Exp $ */
+/* $Id: msdosfs_conv.c,v 1.26 1998/04/15 17:46:37 bde Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
/*-
@@ -418,7 +418,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
else
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
- *un++ = (lower & LCASE_BASE) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
dn++;
@@ -429,7 +429,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
- *un++ = (lower & LCASE_BASE) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
@@ -446,7 +446,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
- *un++ = (lower & LCASE_EXT) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c
index 74be5c4695a5..63b878ab5a81 100644
--- a/sys/msdosfs/msdosfs_denode.c
+++ b/sys/msdosfs/msdosfs_denode.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_denode.c,v 1.43 1998/12/07 21:58:34 archie Exp $ */
+/* $Id: msdosfs_denode.c,v 1.38 1998/05/17 18:09:28 bde Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */
/*-
@@ -50,7 +50,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -72,9 +71,7 @@ static struct denode **dehashtbl;
static u_long dehash; /* size of hash table - 1 */
#define DEHASH(dev, dcl, doff) (dehashtbl[((dev) + (dcl) + (doff) / \
sizeof(struct direntry)) & dehash])
-#ifndef NULL_SIMPLELOCKS
static struct simplelock dehash_slock;
-#endif
union _qcvt {
quad_t qcvt;
@@ -293,7 +290,6 @@ deget(pmp, dirclust, diroffset, depp)
nvp->v_flag |= VROOT; /* should be further down XXX */
ldep->de_Attributes = ATTR_DIRECTORY;
- ldep->de_LowerCase = 0;
if (FAT32(pmp))
ldep->de_StartCluster = pmp->pm_rootdirblk;
/* de_FileSize will be filled in further down */
@@ -412,6 +408,7 @@ detrunc(dep, length, flags, cred, p)
{
int error;
int allerror;
+ int vflags;
u_long eofentry;
u_long chaintofree;
daddr_t bn;
@@ -419,6 +416,7 @@ detrunc(dep, length, flags, cred, p)
int isadir = dep->de_Attributes & ATTR_DIRECTORY;
struct buf *bp;
struct msdosfsmount *pmp = dep->de_pmp;
+ struct timespec ts;
#ifdef MSDOSFS_DEBUG
printf("detrunc(): file %s, length %lu, flags %x\n", dep->de_Name, length, flags);
@@ -509,14 +507,10 @@ detrunc(dep, length, flags, cred, p)
dep->de_FileSize = length;
if (!isadir)
dep->de_flag |= DE_UPDATE|DE_MODIFIED;
- allerror = vtruncbuf(DETOV(dep), cred, p, length, pmp->pm_bpcluster);
-#ifdef MSDOSFS_DEBUG
- if (allerror)
- printf("detrunc(): vtruncbuf error %d\n", allerror);
-#endif
- error = deupdat(dep, 1);
- if (error && (allerror == 0))
- allerror = error;
+ vflags = (length > 0 ? V_SAVE : 0) | V_SAVEMETA;
+ vinvalbuf(DETOV(dep), vflags, cred, p, 0, 0);
+ vnode_pager_setsize(DETOV(dep), length);
+ allerror = deupdat(dep, 1);
#ifdef MSDOSFS_DEBUG
printf("detrunc(): allerror %d, eofentry %lu\n",
allerror, eofentry);
@@ -561,6 +555,7 @@ deextend(dep, length, cred)
struct msdosfsmount *pmp = dep->de_pmp;
u_long count;
int error;
+ struct timespec ts;
/*
* The root of a DOS filesystem cannot be extended.
@@ -666,6 +661,7 @@ msdosfs_inactive(ap)
struct denode *dep = VTODE(vp);
struct proc *p = ap->a_p;
int error = 0;
+ struct timespec ts;
#ifdef MSDOSFS_DEBUG
printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]);
diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c
index 87de1f23eba3..4827201100b7 100644
--- a/sys/msdosfs/msdosfs_lookup.c
+++ b/sys/msdosfs/msdosfs_lookup.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_lookup.c,v 1.27 1998/12/07 21:58:35 archie Exp $ */
+/* $Id: msdosfs_lookup.c,v 1.25 1998/05/18 10:24:26 dt Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */
/*-
@@ -61,6 +61,9 @@
#include <msdosfs/msdosfsmount.h>
#include <msdosfs/fat.h>
+static int markdeleted __P((struct msdosfsmount *pmp, u_long dirclust,
+ u_long diroffset));
+
/*
* When we search a directory the blocks containing directory entries are
* read and examined. The directory entries contain information that would
@@ -106,6 +109,7 @@ msdosfs_lookup(ap)
struct msdosfsmount *pmp;
struct buf *bp = 0;
struct direntry *dep = NULL;
+ struct ucred *cred = cnp->cn_cred;
u_char dosfilename[12];
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
@@ -1040,22 +1044,21 @@ findwin95(dep)
{
struct msdosfsmount *pmp = dep->de_pmp;
struct direntry *dentp;
- int blsize, win95;
+ int blsize;
u_long cn;
daddr_t bn;
struct buf *bp;
- win95 = 1;
/*
* Read through the directory looking for Win'95 entries
* Note: Error currently handled just as EOF XXX
*/
for (cn = 0;; cn++) {
if (pcbmap(dep, cn, &bn, 0, &blsize))
- return (win95);
+ return 0;
if (bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) {
brelse(bp);
- return (win95);
+ return 0;
}
for (dentp = (struct direntry *)bp->b_data;
(char *)dentp < bp->b_data + blsize;
@@ -1065,7 +1068,7 @@ findwin95(dep)
* Last used entry and not found
*/
brelse(bp);
- return (win95);
+ return 0;
}
if (dentp->deName[0] == SLOT_DELETED) {
/*
@@ -1078,7 +1081,6 @@ findwin95(dep)
brelse(bp);
return 1;
}
- win95 = 0;
}
brelse(bp);
}
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index b3a63b55d613..42798d765e7b 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vfsops.c,v 1.38 1998/10/31 15:31:24 peter Exp $ */
+/* $Id: msdosfs_vfsops.c,v 1.35 1998/05/06 05:29:38 msmith Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
/*-
@@ -50,7 +50,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/kernel.h>
@@ -298,8 +297,7 @@ msdosfs_mount(mp, path, data, ndp, p)
vrele(devvp);
return (ENOTBLK);
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return (ENXIO);
}
@@ -365,7 +363,6 @@ mountmsdosfs(devvp, mp, p, argp)
dev_t dev = devvp->v_rdev;
#ifndef __FreeBSD__
struct partinfo dpart;
- int bsize = 0, dtype = 0, tmp;
#endif
union bootsector *bsp;
struct byte_bpb33 *b33;
@@ -373,6 +370,7 @@ mountmsdosfs(devvp, mp, p, argp)
struct byte_bpb710 *b710;
u_int8_t SecPerClust;
int ronly, error;
+ int bsize = 0, dtype = 0, tmp;
/*
* Disallow multiple mounts of the same device.
@@ -797,8 +795,8 @@ msdosfs_unmount(mp, mntflags, p)
vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev,
vp->v_mount);
printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n",
- TAILQ_FIRST(&vp->v_cleanblkhd),
- TAILQ_FIRST(&vp->v_dirtyblkhd),
+ vp->v_cleanblkhd.lh_first,
+ vp->v_dirtyblkhd.lh_first,
vp->v_numoutput, vp->v_type);
printf("union %p, tag %d, data[0] %08x, data[1] %08x\n",
vp->v_socket, vp->v_tag,
@@ -913,7 +911,8 @@ loop:
if (vp->v_type == VNON ||
(dep->de_flag &
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) {
+ (vp->v_dirtyblkhd.lh_first == NULL ||
+ waitfor == MNT_LAZY)) {
simple_unlock(&vp->v_interlock);
continue;
}
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index aad4e6ba9f1e..c8923601b85a 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vnops.c,v 1.79 1998/11/29 22:38:57 dt Exp $ */
+/* $Id: msdosfs_vnops.c,v 1.75 1998/07/11 07:45:50 bde Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@@ -174,7 +174,6 @@ msdosfs_create(ap)
ndirent.de_Attributes = (ap->a_vap->va_mode & VWRITE) ?
ATTR_ARCHIVE : ATTR_ARCHIVE | ATTR_READONLY;
- ndirent.de_LowerCase = 0;
ndirent.de_StartCluster = 0;
ndirent.de_FileSize = 0;
ndirent.de_dev = pdep->de_dev;
@@ -329,6 +328,7 @@ msdosfs_getattr(ap)
struct proc *a_p;
} */ *ap;
{
+ u_int cn;
struct denode *dep = VTODE(ap->a_vp);
struct msdosfsmount *pmp = dep->de_pmp;
struct vattr *vap = ap->a_vap;
@@ -609,10 +609,10 @@ msdosfs_read(ap)
return (error);
}
error = uiomove(bp->b_data + on, (int) n, uio);
+ if (!isadir)
+ dep->de_flag |= DE_ACCESS;
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
- if (!isadir && !(vp->v_mount->mnt_flag & MNT_NOATIME))
- dep->de_flag |= DE_ACCESS;
return (error);
}
@@ -835,8 +835,8 @@ msdosfs_fsync(ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -852,7 +852,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("msdosfs_fsync: dirty", vp);
goto loop;
}
@@ -1402,7 +1402,6 @@ msdosfs_mkdir(ap)
goto bad;
ndirent.de_Attributes = ATTR_DIRECTORY;
- ndirent.de_LowerCase = 0;
ndirent.de_StartCluster = newcluster;
ndirent.de_FileSize = 0;
ndirent.de_dev = pdep->de_dev;
@@ -1715,9 +1714,7 @@ msdosfs_readdir(ap)
if (chksum != winChksum(dentp->deName))
dirbuf.d_namlen = dos2unixfn(dentp->deName,
(u_char *)dirbuf.d_name,
- dentp->deLowerCase |
- ((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ?
- (LCASE_BASE | LCASE_EXT) : 0),
+ pmp->pm_flags & MSDOSFSMNT_SHORTNAME,
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_d2u,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,
@@ -1797,6 +1794,7 @@ msdosfs_bmap(ap)
} */ *ap;
{
struct denode *dep = VTODE(ap->a_vp);
+ struct msdosfsmount *pmp = dep->de_pmp;
if (ap->a_vpp != NULL)
*ap->a_vpp = dep->de_devvp;
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 001d797fed4a..f9a217b5e334 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -37,7 +37,7 @@
*
* @(#)bpf.c 8.2 (Berkeley) 3/28/94
*
- * $Id: bpf.c,v 1.45 1998/11/11 10:04:09 truckman Exp $
+ * $Id: bpf.c,v 1.43 1998/10/04 23:04:48 alex Exp $
*/
#include "bpfilter.h"
@@ -61,7 +61,6 @@
#include <sys/filio.h>
#include <sys/sockio.h>
#include <sys/ttycom.h>
-#include <sys/filedesc.h>
#if defined(sparc) && BSD < 199103
#include <sys/stream.h>
@@ -380,7 +379,6 @@ bpfclose(dev, flags, fmt, p)
register struct bpf_d *d = &bpf_dtab[minor(dev)];
register int s;
- funsetown(d->bd_sigio);
s = splimp();
if (d->bd_bif)
bpf_detachd(d);
@@ -536,9 +534,14 @@ static inline void
bpf_wakeup(d)
register struct bpf_d *d;
{
+ struct proc *p;
+
wakeup((caddr_t)d);
- if (d->bd_async && d->bd_sig && d->bd_sigio)
- pgsigio(d->bd_sigio, d->bd_sig, 0);
+ if (d->bd_async && d->bd_sig)
+ if (d->bd_pgid > 0)
+ gsignal (d->bd_pgid, d->bd_sig);
+ else if (p = pfind (-d->bd_pgid))
+ psignal (p, d->bd_sig);
#if BSD >= 199103
selwakeup(&d->bd_sel);
@@ -831,22 +834,18 @@ bpfioctl(dev, cmd, addr, flags, p)
d->bd_async = *(int *)addr;
break;
- case FIOSETOWN:
- error = fsetown(*(int *)addr, &d->bd_sigio);
- break;
-
- case FIOGETOWN:
- *(int *)addr = fgetown(d->bd_sigio);
- break;
+/* N.B. ioctl (FIOSETOWN) and fcntl (F_SETOWN) both end up doing the
+ equivalent of a TIOCSPGRP and hence end up here. *However* TIOCSPGRP's arg
+ is a process group if it's positive and a process id if it's negative. This
+ is exactly the opposite of what the other two functions want! Therefore
+ there is code in ioctl and fcntl to negate the arg before calling here. */
- /* This is deprecated, FIOSETOWN should be used instead. */
- case TIOCSPGRP:
- error = fsetown(-(*(int *)addr), &d->bd_sigio);
+ case TIOCSPGRP: /* Process or group to send signals to */
+ d->bd_pgid = *(int *)addr;
break;
- /* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)addr = -fgetown(d->bd_sigio);
+ *(int *)addr = d->bd_pgid;
break;
case BIOCSRSIG: /* Set receive signal */
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index a45244839034..63f78f8e889d 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -37,7 +37,7 @@
*
* @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93
*
- * $Id: bpf_filter.c,v 1.11 1998/12/07 03:26:34 eivind Exp $
+ * $Id: bpf_filter.c,v 1.8 1997/02/22 09:40:57 peter Exp $
*/
#include <sys/param.h>
@@ -46,30 +46,27 @@
#include <netinet/in.h>
#endif
-#if defined(sparc) || defined(mips) || defined(ibm032) || defined(__alpha__)
+#if defined(sparc) || defined(mips) || defined(ibm032)
#define BPF_ALIGN
#endif
#ifndef BPF_ALIGN
-#define EXTRACT_SHORT(p) ((u_int16_t)ntohs(*(u_int16_t *)p))
-#define EXTRACT_LONG(p) (ntohl(*(u_int32_t *)p))
+#define EXTRACT_SHORT(p) ((u_short)ntohs(*(u_short *)p))
+#define EXTRACT_LONG(p) (ntohl(*(u_long *)p))
#else
#define EXTRACT_SHORT(p)\
- ((u_int16_t)\
- ((u_int16_t)*((u_char *)p+0)<<8|\
- (u_int16_t)*((u_char *)p+1)<<0))
+ ((u_short)\
+ ((u_short)*((u_char *)p+0)<<8|\
+ (u_short)*((u_char *)p+1)<<0))
#define EXTRACT_LONG(p)\
- ((u_int32_t)*((u_char *)p+0)<<24|\
- (u_int32_t)*((u_char *)p+1)<<16|\
- (u_int32_t)*((u_char *)p+2)<<8|\
- (u_int32_t)*((u_char *)p+3)<<0)
+ ((u_long)*((u_char *)p+0)<<24|\
+ (u_long)*((u_char *)p+1)<<16|\
+ (u_long)*((u_char *)p+2)<<8|\
+ (u_long)*((u_char *)p+3)<<0)
#endif
#ifdef KERNEL
#include <sys/mbuf.h>
-#endif
-#include <net/bpf.h>
-#ifdef KERNEL
#define MINDEX(m, k) \
{ \
register int len = m->m_len; \
@@ -83,16 +80,15 @@
} \
}
-static u_int16_t m_xhalf __P((struct mbuf *m, bpf_u_int32 k, int *err));
-static u_int32_t m_xword __P((struct mbuf *m, bpf_u_int32 k, int *err));
+static int m_xhalf __P((struct mbuf *m, int k, int *err));
+static int m_xword __P((struct mbuf *m, int k, int *err));
-static u_int32_t
+static int
m_xword(m, k, err)
register struct mbuf *m;
- register bpf_u_int32 k;
- register int *err;
+ register int k, *err;
{
- register size_t len;
+ register int len;
register u_char *cp, *np;
register struct mbuf *m0;
@@ -117,38 +113,27 @@ m_xword(m, k, err)
switch (len - k) {
case 1:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)np[0] << 16) |
- ((u_int32_t)np[1] << 8) |
- (u_int32_t)np[2];
+ return (cp[0] << 24) | (np[0] << 16) | (np[1] << 8) | np[2];
case 2:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)cp[1] << 16) |
- ((u_int32_t)np[0] << 8) |
- (u_int32_t)np[1];
+ return (cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) |
+ np[1];
default:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)cp[1] << 16) |
- ((u_int32_t)cp[2] << 8) |
- (u_int32_t)np[0];
+ return (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) |
+ np[0];
}
bad:
*err = 1;
return 0;
}
-static u_int16_t
+static int
m_xhalf(m, k, err)
register struct mbuf *m;
- register bpf_u_int32 k;
- register int *err;
+ register int k, *err;
{
- register size_t len;
+ register int len;
register u_char *cp;
register struct mbuf *m0;
@@ -176,6 +161,7 @@ m_xhalf(m, k, err)
}
#endif
+#include <net/bpf.h>
/*
* Execute the filter program starting at pc on the packet p
* wirelen is the length of the original packet
@@ -188,9 +174,9 @@ bpf_filter(pc, p, wirelen, buflen)
u_int wirelen;
register u_int buflen;
{
- register u_int32_t A = 0, X = 0;
- register bpf_u_int32 k;
- int32_t mem[BPF_MEMWORDS];
+ register u_long A = 0, X = 0;
+ register int k;
+ long mem[BPF_MEMWORDS];
if (pc == 0)
/*
@@ -217,7 +203,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_W|BPF_ABS:
k = pc->k;
- if (k > buflen || sizeof(int32_t) > buflen - k) {
+ if (k + sizeof(long) > buflen) {
#ifdef KERNEL
int merr;
@@ -232,16 +218,16 @@ bpf_filter(pc, p, wirelen, buflen)
#endif
}
#ifdef BPF_ALIGN
- if (((intptr_t)(p + k) & 3) != 0)
+ if (((int)(p + k) & 3) != 0)
A = EXTRACT_LONG(&p[k]);
else
#endif
- A = ntohl(*(int32_t *)(p + k));
+ A = ntohl(*(long *)(p + k));
continue;
case BPF_LD|BPF_H|BPF_ABS:
k = pc->k;
- if (k > buflen || sizeof(int16_t) > buflen - k) {
+ if (k + sizeof(short) > buflen) {
#ifdef KERNEL
int merr;
@@ -285,7 +271,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_W|BPF_IND:
k = X + pc->k;
- if (pc->k > buflen || X > buflen - pc->k || sizeof(int32_t) > buflen - k) {
+ if (k + sizeof(long) > buflen) {
#ifdef KERNEL
int merr;
@@ -300,16 +286,16 @@ bpf_filter(pc, p, wirelen, buflen)
#endif
}
#ifdef BPF_ALIGN
- if (((intptr_t)(p + k) & 3) != 0)
+ if (((int)(p + k) & 3) != 0)
A = EXTRACT_LONG(&p[k]);
else
#endif
- A = ntohl(*(int32_t *)(p + k));
+ A = ntohl(*(long *)(p + k));
continue;
case BPF_LD|BPF_H|BPF_IND:
k = X + pc->k;
- if (X > buflen || pc->k > buflen - X || sizeof(int16_t) > buflen - k) {
+ if (k + sizeof(short) > buflen) {
#ifdef KERNEL
int merr;
@@ -328,7 +314,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_B|BPF_IND:
k = X + pc->k;
- if (pc->k >= buflen || X >= buflen - k) {
+ if (k >= buflen) {
#ifdef KERNEL
register struct mbuf *m;
@@ -534,10 +520,10 @@ bpf_validate(f, len)
register int from = i + 1;
if (BPF_OP(p->code) == BPF_JA) {
- if (from >= len || p->k >= len - from)
+ if (from + p->k >= len)
return 0;
}
- else if (from >= len || p->jt >= len - from || p->jf >= len - from)
+ else if (from + p->jt >= len || from + p->jf >= len)
return 0;
}
/*
@@ -546,7 +532,7 @@ bpf_validate(f, len)
if ((BPF_CLASS(p->code) == BPF_ST ||
(BPF_CLASS(p->code) == BPF_LD &&
(p->code & 0xe0) == BPF_MEM)) &&
- p->k >= BPF_MEMWORDS)
+ (p->k >= BPF_MEMWORDS || p->k < 0))
return 0;
/*
* Check for constant division by 0.
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index 39ac4897915f..aa7f4622816c 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -37,7 +37,7 @@
*
* @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93
*
- * $Id: bpfdesc.h,v 1.11 1998/11/11 10:04:09 truckman Exp $
+ * $Id$
*/
#ifndef _NET_BPFDESC_H_
@@ -78,7 +78,7 @@ struct bpf_d {
u_char bd_immediate; /* true to return on packet arrival */
int bd_async; /* non-zero if packet reception should generate signal */
int bd_sig; /* signal to send upon packet reception */
- struct sigio * bd_sigio; /* information for async I/O */
+ pid_t bd_pgid; /* process or group id for signal */
#if BSD < 199103
u_char bd_selcoll; /* true if selects collide */
int bd_timedout;
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index 745eaa2fca0d..7c2e0f23508f 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -77,7 +77,6 @@
#include <sys/param.h>
#include <sys/mbuf.h>
-#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/socket.h> /* for net/if.h */
#include <sys/kernel.h>
@@ -90,11 +89,9 @@
#include <netinet/if_ether.h> /* for struct arpcom */
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#if defined(IPFIREWALL) && defined(DUMMYNET)
#include <net/route.h>
-#include <netinet/ip_fw.h>
#include <netinet/ip_dummynet.h>
#endif
@@ -239,10 +236,11 @@ bdg_timeout(void *dummy)
if (--slowtimer <= 0 ) {
slowtimer = 5 ;
- for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_link.tqe_next) {
+ for (ifp = ifnet; ifp; ifp = ifp->if_next) {
if (ifp->if_type != IFT_ETHER)
continue ;
if ( 0 == ( ifp->if_flags & IFF_UP) ) {
+ int ret ;
s = splimp();
if_up(ifp);
splx(s);
@@ -281,7 +279,7 @@ static void
bdginit(dummy)
void *dummy;
{
- int i ;
+ int s, i ;
struct ifnet *ifp;
struct arpcom *ac ;
u_char *eth_addr ;
@@ -301,9 +299,8 @@ bdginit(dummy)
bdg_ports = 0 ;
eth_addr = bdg_addresses ;
- printf("BRIDGE 981214, have %d interfaces\n", if_index);
- for (i = 0 , ifp = ifnet.tqh_first ; i < if_index ;
- i++, ifp = ifp->if_link.tqe_next)
+ printf("BRIDGE 980911, have %d interfaces\n", if_index);
+ for (i = 0 , ifp = ifnet ; i < if_index ; i++, ifp = ifp->if_next)
if (ifp->if_type == IFT_ETHER) { /* ethernet ? */
ac = (struct arpcom *)ifp;
sprintf(bdg_stats.s[ifp->if_index].name,
@@ -325,7 +322,7 @@ bdginit(dummy)
bdg_ports ++ ;
}
bdg_timeout(0);
- do_bridge=0;
+ do_bridge=1;
}
/*
@@ -467,7 +464,7 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst)
return 0;
}
if (dst == BDG_BCAST || dst == BDG_MCAST || dst == BDG_UNKNOWN) {
- ifp = ifnet.tqh_first ;
+ ifp = ifnet ;
once = 0 ;
if (dst != BDG_UNKNOWN)
canfree = 0 ;
@@ -518,7 +515,7 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst)
}
dummy = 0 ;
- off= (*ip_fw_chk_ptr)(NULL, 0, src, &dummy, &m, &rule, NULL /*next hop */ ) ;
+ off=(*ip_fw_chk_ptr)(NULL, 0, src, &dummy, &m, &rule) ;
if (m == NULL) { /* pkt discarded by firewall */
printf("-- bdg: firewall discarded pkt\n");
if (canfree)
@@ -559,12 +556,12 @@ forward:
else
m = NULL ;
- for ( ; ifp ; ifp = ifp->if_link.tqe_next ) {
+ for ( ; ifp ; ifp = ifp->if_next ) {
if (ifp != src && ifp->if_type == IFT_ETHER &&
(ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING) &&
SAMEGROUP(ifp, src) && !MUTED(ifp) ) {
if (m == NULL) { /* do i need to make a copy ? */
- if (canfree && ifp->if_link.tqe_next == NULL) /* last one! */
+ if (canfree && ifp->if_next == NULL) /* last one! */
m = *m0 ;
else /* on a P5-90, m_packetcopy takes 540 ticks */
m = m_copypacket(*m0, M_DONTWAIT);
diff --git a/sys/net/bridge.h b/sys/net/bridge.h
index e151e4e6ac7d..8dcee07a3c51 100644
--- a/sys/net/bridge.h
+++ b/sys/net/bridge.h
@@ -108,7 +108,7 @@ struct bdg_stats {
* BDG_DROP must be dropped
* other ifp of the dest. interface (incl.self)
*/
-static __inline
+static inline
struct ifnet *
bridge_dst_lookup(struct mbuf *m)
{
diff --git a/sys/net/if.c b/sys/net/if.c
index b0c7be766cee..295ae4d23058 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.63 1998/12/04 22:54:52 archie Exp $
+ * $Id: if.c,v 1.61 1998/07/20 13:21:56 dfr Exp $
*/
#include "opt_compat.h"
@@ -143,8 +143,7 @@ if_attach(ifp)
/*
* create a Link Level name for this device
*/
- namelen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
socksize = masklen + ifp->if_addrlen;
@@ -401,17 +400,16 @@ link_rtrequest(cmd, rt, sa)
* NOTE: must be called at splnet or eqivalent.
*/
void
-if_unroute(ifp, flag, fam)
+if_down(ifp)
register struct ifnet *ifp;
- int flag, fam;
{
register struct ifaddr *ifa;
- ifp->if_flags &= ~flag;
+ ifp->if_flags &= ~IFF_UP;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
- if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
+ for (ifa = ifp->if_addrhead.tqh_first; ifa;
+ ifa = ifa->ifa_link.tqe_next)
+ pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
if_qflush(&ifp->if_snd);
rt_ifmsg(ifp);
}
@@ -422,47 +420,20 @@ if_unroute(ifp, flag, fam)
* NOTE: must be called at splnet or eqivalent.
*/
void
-if_route(ifp, flag, fam)
+if_up(ifp)
register struct ifnet *ifp;
- int flag, fam;
{
register struct ifaddr *ifa;
- ifp->if_flags |= flag;
+ ifp->if_flags |= IFF_UP;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
- if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
+ for (ifa = ifp->if_addrhead.tqh_first; ifa;
+ ifa = ifa->ifa_link.tqe_next)
+ pfctlinput(PRC_IFUP, ifa->ifa_addr);
rt_ifmsg(ifp);
}
/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
-
- if_unroute(ifp, IFF_UP, AF_UNSPEC);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- if_route(ifp, IFF_UP, AF_UNSPEC);
-}
-
-/*
* Flush an interface queue.
*/
static void
@@ -821,8 +792,7 @@ ifconf(cmd, data)
char workbuf[64];
int ifnlen;
- ifnlen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
if(ifnlen + 1 > sizeof ifr.ifr_name) {
error = ENAMETOOLONG;
} else {
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index 9f56a9b610ff..a41bfaf8548d 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -521,16 +521,14 @@ pvc_ioctl(shadow, cmd, data)
*/
switch (cmd) {
case SIOCGPVCSIF:
- snprintf(ifr->ifr_name, sizeof(ifr->ifr_name),
- "%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(ifr->ifr_name, "%s%d", ifp->if_name, ifp->if_unit);
return (0);
case SIOCGPVCTX:
do {
struct pvctxreq *pvcreq = (struct pvctxreq *)data;
- snprintf(pvcreq->pvc_ifname,
- sizeof(pvcreq->pvc_ifname), "%s%d",
+ sprintf(pvcreq->pvc_ifname, "%s%d",
ifp->if_name, ifp->if_unit);
pvcreq->pvc_aph = pvcsif->sif_aph;
} while (0);
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index 8e7b99e862a4..796061e978a0 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id: if_disc.c,v 1.20 1998/06/07 17:12:03 dfr Exp $
+ * $Id: if_disc.c,v 1.19 1998/01/08 23:41:21 eivind Exp $
*/
/*
@@ -63,24 +63,24 @@
static void discattach __P((void *dummy));
PSEUDO_SET(discattach, if_disc);
-static struct ifnet discif;
-static int discoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+static struct ifnet dsif;
+static int dsoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
-static void discrtrequest(int cmd, struct rtentry *rt, struct sockaddr *sa);
-static int discioctl(struct ifnet *, u_long, caddr_t);
+static void dsrtrequest(int cmd, struct rtentry *rt, struct sockaddr *sa);
+static int dsioctl(struct ifnet *, u_long, caddr_t);
/* ARGSUSED */
static void
discattach(dummy)
void *dummy;
{
- register struct ifnet *ifp = &discif;
+ register struct ifnet *ifp = &dsif;
ifp->if_name = "ds";
ifp->if_mtu = DSMTU;
ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = discioctl;
- ifp->if_output = discoutput;
+ ifp->if_ioctl = dsioctl;
+ ifp->if_output = dsoutput;
ifp->if_type = IFT_LOOP;
ifp->if_hdrlen = 0;
ifp->if_addrlen = 0;
@@ -91,14 +91,14 @@ discattach(dummy)
}
static int
-discoutput(ifp, m, dst, rt)
+dsoutput(ifp, m, dst, rt)
struct ifnet *ifp;
register struct mbuf *m;
struct sockaddr *dst;
register struct rtentry *rt;
{
if ((m->m_flags & M_PKTHDR) == 0)
- panic("discoutput no HDR");
+ panic("dsoutput no HDR");
#if NBPFILTER > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
@@ -108,7 +108,7 @@ discoutput(ifp, m, dst, rt)
m->m_data += sizeof(int);
}
- if (discif.if_bpf) {
+ if (dsif.if_bpf) {
/*
* We need to prepend the address family as
* a four byte field. Cons up a dummy header
@@ -123,7 +123,7 @@ discoutput(ifp, m, dst, rt)
m0.m_len = 4;
m0.m_data = (char *)&af;
- bpf_mtap(&discif, &m0);
+ bpf_mtap(&dsif, &m0);
}
#endif
m->m_pkthdr.rcvif = ifp;
@@ -137,7 +137,7 @@ discoutput(ifp, m, dst, rt)
/* ARGSUSED */
static void
-discrtrequest(cmd, rt, sa)
+dsrtrequest(cmd, rt, sa)
int cmd;
struct rtentry *rt;
struct sockaddr *sa;
@@ -151,7 +151,7 @@ discrtrequest(cmd, rt, sa)
*/
/* ARGSUSED */
static int
-discioctl(ifp, cmd, data)
+dsioctl(ifp, cmd, data)
register struct ifnet *ifp;
u_long cmd;
caddr_t data;
@@ -166,7 +166,7 @@ discioctl(ifp, cmd, data)
ifp->if_flags |= IFF_UP;
ifa = (struct ifaddr *)data;
if (ifa != 0)
- ifa->ifa_rtrequest = discrtrequest;
+ ifa->ifa_rtrequest = dsrtrequest;
/*
* Everything else is done at a higher level.
*/
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 1485c2766546..ca66eb0dc906 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -31,13 +31,12 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ethersubr.c,v 1.53 1998/12/14 17:58:05 luigi Exp $
+ * $Id: if_ethersubr.c,v 1.51 1998/06/14 20:58:14 julian Exp $
*/
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_ipx.h"
-#include "opt_bdg.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,10 +101,6 @@ extern u_char at_org_code[3];
extern u_char aarp_org_code[3];
#endif /* NETATALK */
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include "vlan.h"
#if NVLAN > 0
#include <net/if_vlan_var.h>
@@ -374,22 +369,10 @@ ether_output(ifp, m0, dst, rt0)
} else if (bcmp(eh->ether_dhost,
eh->ether_shost, ETHER_ADDR_LEN) == 0) {
(void) if_simloop(ifp, m, dst, hlen);
- return (0); /* XXX */
+ return(0); /* XXX */
}
}
-#ifdef BRIDGE
- if (do_bridge) {
- struct mbuf *m0 = m ;
-
- if (m->m_pkthdr.rcvif)
- m->m_pkthdr.rcvif = NULL ;
- ifp = bridge_dst_lookup(m);
- bdg_forward(&m0, ifp);
- if (m0)
- m_freem(m0);
- return (0);
- }
-#endif
+
s = splimp();
/*
* Queue message on interface, and start output if interface
diff --git a/sys/net/if_mib.c b/sys/net/if_mib.c
index 2e8f331cfdfc..268669d36922 100644
--- a/sys/net/if_mib.c
+++ b/sys/net/if_mib.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_mib.c,v 1.5 1997/08/02 14:32:38 bde Exp $
+ * $Id: if_mib.c,v 1.4 1997/02/22 09:41:02 peter Exp $
*/
#include <sys/param.h>
@@ -89,8 +89,7 @@ sysctl_ifdata SYSCTL_HANDLER_ARGS /* XXX bad syntax! */
return ENOENT;
case IFDATA_GENERAL:
- ifnlen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
if(ifnlen + 1 > sizeof ifmd.ifmd_name) {
return ENAMETOOLONG;
} else {
diff --git a/sys/net/if_sppp.h b/sys/net/if_sppp.h
index 67a63ae0472f..41e5d8e427cb 100644
--- a/sys/net/if_sppp.h
+++ b/sys/net/if_sppp.h
@@ -16,11 +16,11 @@
*
* From: Version 2.0, Fri Oct 6 20:39:21 MSK 1995
*
- * $Id: if_sppp.h,v 1.12 1998/12/20 19:06:22 phk Exp $
+ * $Id: if_sppp.h,v 1.8 1997/10/11 11:25:20 joerg Exp $
*/
-#ifndef _NET_IF_SPPP_H_
-#define _NET_IF_SPPP_H_ 1
+#ifndef _NET_IF_HDLC_H_
+#define _NET_IF_HDLC_H_ 1
#define IDX_LCP 0 /* idx into state table */
@@ -45,7 +45,6 @@ struct sipcp {
u_int flags;
#define IPCP_HISADDR_SEEN 1 /* have seen his address already */
#define IPCP_MYADDR_DYN 2 /* my address is dynamically assigned */
-#define IPCP_MYADDR_SEEN 4 /* have seen his address already */
};
#define AUTHNAMELEN 32
@@ -117,18 +116,6 @@ struct sppp {
*/
void (*pp_tls)(struct sppp *sp);
void (*pp_tlf)(struct sppp *sp);
- /*
- * These (optional) functions may be filled by the hardware
- * driver if any notification of established connections
- * (currently: IPCP up) is desired (pp_con) or any internal
- * state change of the interface state machine should be
- * signaled for monitoring purposes (pp_chg).
- */
- void (*pp_con)(struct sppp *sp);
- void (*pp_chg)(struct sppp *sp, int new_state);
- /* These two fields are for use by the lower layer */
- void *pp_lowerp;
- int pp_loweri;
};
#define PP_KEEPALIVE 0x01 /* use keepalive protocol */
@@ -172,4 +159,4 @@ int sppp_isempty (struct ifnet *ifp);
void sppp_flush (struct ifnet *ifp);
#endif
-#endif /* _NET_IF_SPPP_H_ */
+#endif /* _NET_IF_HDLC_H_ */
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 4f3e17afdecb..e5b040debdfa 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -17,12 +17,12 @@
*
* From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997
*
- * $Id: if_spppsubr.c,v 1.51 1998/12/26 13:14:45 phk Exp $
+ * $Id: if_spppsubr.c,v 1.44 1998/10/06 20:47:53 joerg Exp $
*/
#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#include "opt_inet.h"
#include "opt_ipx.h"
#endif
@@ -39,9 +39,6 @@
#include <sys/sockio.h>
#include <sys/socket.h>
#include <sys/syslog.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <machine/random.h>
-#endif
#include <sys/malloc.h>
#include <sys/mbuf.h>
@@ -54,15 +51,13 @@
#include <net/if.h>
#include <net/netisr.h>
#include <net/if_types.h>
-#include <net/route.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#include <machine/random.h>
#endif
#if defined (__NetBSD__) || defined (__OpenBSD__)
#include <machine/cpu.h> /* XXX for softnet */
#endif
-
#include <machine/stdarg.h>
#ifdef INET
@@ -99,16 +94,13 @@
#include <net/if_sppp.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-# define UNTIMEOUT(fun, arg, handle) untimeout(fun, arg, handle)
-# define TIMEOUT(fun, arg1, arg2, handle) handle = timeout(fun, arg1, arg2)
-# define IOCTL_CMD_T u_long
+#if defined (__FreeBSD__)
+# define UNTIMEOUT(fun, arg, handle) \
+ untimeout(fun, arg, handle)
#else
-# define UNTIMEOUT(fun, arg, handle) untimeout(fun, arg)
-# define TIMEOUT(fun, arg1, arg2, handle) timeout(fun, arg1, arg2)
-# define IOCTL_CMD_T int
+# define UNTIMEOUT(fun, arg, handle) \
+ untimeout(fun, arg)
#endif
-
#define MAXALIVECNT 3 /* max. alive packets */
/*
@@ -258,11 +250,11 @@ struct cp {
};
static struct sppp *spppq;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
static struct callout_handle keepalive_ch;
#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#define SPP_FMT "%s%d: "
#define SPP_ARGS(ifp) (ifp)->if_name, (ifp)->if_unit
#else
@@ -299,11 +291,13 @@ static void sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m);
static void sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
u_char ident, u_short len, void *data);
-/* static void sppp_cp_timeout(void *arg); */
+#ifdef notyet
+static void sppp_cp_timeout(void *arg);
+#endif
static void sppp_cp_change_state(const struct cp *cp, struct sppp *sp,
int newstate);
static void sppp_auth_send(const struct cp *cp,
- struct sppp *sp, unsigned int type, unsigned int id,
+ struct sppp *sp, u_char type, u_char id,
...);
static void sppp_up_event(const struct cp *cp, struct sppp *sp);
@@ -625,7 +619,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
struct ppp_header *h;
struct ifqueue *ifq;
int s, rv = 0;
- int debug = ifp->if_flags & IFF_DEBUG;
s = splimp();
@@ -649,47 +642,21 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
ifq = &ifp->if_snd;
#ifdef INET
+ /*
+ * Put low delay, telnet, rlogin and ftp control packets
+ * in front of the queue.
+ */
if (dst->sa_family == AF_INET) {
/* XXX Check mbuf length here? */
struct ip *ip = mtod (m, struct ip*);
struct tcphdr *tcp = (struct tcphdr*) ((long*)ip + ip->ip_hl);
- /*
- * When using dynamic local IP address assignment by using
- * 0.0.0.0 as a local address, the first TCP session will
- * not connect because the local TCP checksum is computed
- * using 0.0.0.0 which will later become our real IP address
- * so the TCP checksum computed at the remote end will
- * become invalid. So we
- * - don't let packets with src ip addr 0 thru
- * - we flag TCP packets with src ip 0 as an error
- */
-
- if(ip->ip_src.s_addr == INADDR_ANY) /* -hm */
- {
- m_freem(m);
- splx(s);
- if(ip->ip_p == IPPROTO_TCP)
- return(EADDRNOTAVAIL);
- else
- return(0);
- }
-
- /*
- * Put low delay, telnet, rlogin and ftp control packets
- * in front of the queue.
- */
- if (IF_QFULL (&sp->pp_fastq))
- ;
- else if (ip->ip_tos & IPTOS_LOWDELAY)
- ifq = &sp->pp_fastq;
- else if (m->m_len < sizeof *ip + sizeof *tcp)
- ;
- else if (ip->ip_p != IPPROTO_TCP)
- ;
- else if (INTERACTIVE (ntohs (tcp->th_sport)))
- ifq = &sp->pp_fastq;
- else if (INTERACTIVE (ntohs (tcp->th_dport)))
+ if (! IF_QFULL (&sp->pp_fastq) &&
+ ((ip->ip_tos & IPTOS_LOWDELAY) ||
+ ((ip->ip_p == IPPROTO_TCP &&
+ m->m_len >= sizeof (struct ip) + sizeof (struct tcphdr) &&
+ (INTERACTIVE (ntohs (tcp->th_sport)))) ||
+ INTERACTIVE (ntohs (tcp->th_dport)))))
ifq = &sp->pp_fastq;
}
#endif
@@ -699,7 +666,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
*/
M_PREPEND (m, PPP_HEADER_LEN, M_DONTWAIT);
if (! m) {
- if (debug)
+ if (ifp->if_flags & IFF_DEBUG)
log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n",
SPP_ARGS(ifp));
++ifp->if_oerrors;
@@ -799,19 +766,17 @@ sppp_attach(struct ifnet *ifp)
/* Initialize keepalive handler. */
if (! spppq)
- TIMEOUT(sppp_keepalive, 0, hz * 10, keepalive_ch);
+#if defined (__FreeBSD__)
+ keepalive_ch =
+#endif
+ timeout(sppp_keepalive, 0, hz * 10);
/* Insert new entry into the keepalive list. */
sp->pp_next = spppq;
spppq = sp;
- sp->pp_if.if_mtu = PP_MTU;
- sp->pp_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
sp->pp_if.if_type = IFT_PPP;
sp->pp_if.if_output = sppp_output;
-#if 0
- sp->pp_flags = PP_KEEPALIVE;
-#endif
sp->pp_fastq.ifq_maxlen = 32;
sp->pp_cpq.ifq_maxlen = 20;
sp->pp_loopcnt = 0;
@@ -933,7 +898,7 @@ sppp_pick(struct ifnet *ifp)
* Process an ioctl request. Called on low priority level.
*/
int
-sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data)
+sppp_ioctl(struct ifnet *ifp, u_long cmd, void *data)
{
struct ifreq *ifr = (struct ifreq*) data;
struct sppp *sp = (struct sppp*) ifp;
@@ -1076,7 +1041,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
++sp->pp_loopcnt;
/* Generate new local sequence number */
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->pp_seq = random();
#else
sp->pp_seq ^= time.tv_sec ^ time.tv_usec;
@@ -1108,13 +1073,13 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
struct ppp_header *h;
struct cisco_packet *ch;
struct mbuf *m;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
struct timeval tv;
#else
u_long t = (time.tv_sec - boottime.tv_sec) * 1000;
#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
getmicrouptime(&tv);
#endif
@@ -1135,7 +1100,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
ch->par2 = htonl (par2);
ch->rel = -1;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
ch->time0 = htons ((u_short) (tv.tv_sec >> 16));
ch->time1 = htons ((u_short) tv.tv_sec);
#else
@@ -1435,12 +1400,12 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
case STATE_ACK_SENT:
break;
case STATE_CLOSING:
- sppp_cp_change_state(cp, sp, STATE_CLOSED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_CLOSED);
break;
case STATE_STOPPING:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
case STATE_ACK_RCVD:
sppp_cp_change_state(cp, sp, STATE_REQ_SENT);
@@ -1605,9 +1570,8 @@ sppp_down_event(const struct cp *cp, struct sppp *sp)
sppp_cp_change_state(cp, sp, STATE_INITIAL);
break;
case STATE_STOPPED:
- sppp_cp_change_state(cp, sp, STATE_STARTING);
(cp->tls)(sp);
- break;
+ /* fall through */
case STATE_STOPPING:
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
@@ -1638,8 +1602,8 @@ sppp_open_event(const struct cp *cp, struct sppp *sp)
switch (sp->state[cp->protoidx]) {
case STATE_INITIAL:
- sppp_cp_change_state(cp, sp, STATE_STARTING);
(cp->tls)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STARTING);
break;
case STATE_STARTING:
break;
@@ -1678,8 +1642,8 @@ sppp_close_event(const struct cp *cp, struct sppp *sp)
case STATE_CLOSING:
break;
case STATE_STARTING:
- sppp_cp_change_state(cp, sp, STATE_INITIAL);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_INITIAL);
break;
case STATE_STOPPED:
sppp_cp_change_state(cp, sp, STATE_CLOSED);
@@ -1717,18 +1681,18 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
/* TO- event */
switch (sp->state[cp->protoidx]) {
case STATE_CLOSING:
- sppp_cp_change_state(cp, sp, STATE_CLOSED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_CLOSED);
break;
case STATE_STOPPING:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
case STATE_ACK_SENT:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
}
else
@@ -1738,8 +1702,10 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
case STATE_STOPPING:
sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq,
0, 0);
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
@@ -1749,8 +1715,10 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
break;
case STATE_ACK_SENT:
(cp->scr)(sp);
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
}
@@ -1779,8 +1747,10 @@ sppp_cp_change_state(const struct cp *cp, struct sppp *sp, int newstate)
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
case STATE_ACK_SENT:
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
}
}
@@ -1812,7 +1782,7 @@ sppp_lcp_init(struct sppp *sp)
sp->lcp.max_terminate = 2;
sp->lcp.max_configure = 10;
sp->lcp.max_failure = 10;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_LCP]);
#endif
}
@@ -1860,7 +1830,7 @@ sppp_lcp_down(struct sppp *sp)
*/
if ((ifp->if_flags & (IFF_AUTO | IFF_PASSIVE)) == 0) {
log(LOG_INFO,
- SPP_FMT "Down event, taking interface down.\n",
+ SPP_FMT "Down event (carrier loss), taking interface down.\n",
SPP_ARGS(ifp));
if_down(ifp);
} else {
@@ -2222,7 +2192,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
if (magic == ~sp->lcp.magic) {
if (debug)
addlog("magic glitch ");
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->lcp.magic = random();
#else
sp->lcp.magic = time.tv_sec + time.tv_usec;
@@ -2270,7 +2240,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
static void
sppp_lcp_tlu(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
@@ -2292,9 +2262,8 @@ sppp_lcp_tlu(struct sppp *sp)
else
sp->pp_phase = PHASE_NETWORK;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/*
* Open all authentication protocols. This is even required
@@ -2319,10 +2288,6 @@ sppp_lcp_tlu(struct sppp *sp)
if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0)
(cps[i])->Up(sp);
- /* notify low-level driver of state change */
- if (sp->pp_chg)
- sp->pp_chg(sp, (int)sp->pp_phase);
-
if (sp->pp_phase == PHASE_NETWORK)
/* if no NCP is starting, close down */
sppp_lcp_check_and_close(sp);
@@ -2331,15 +2296,14 @@ sppp_lcp_tlu(struct sppp *sp)
static void
sppp_lcp_tld(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
sp->pp_phase = PHASE_TERMINATE;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/*
* Take upper layers down. We send the Down event first and
@@ -2357,36 +2321,30 @@ sppp_lcp_tld(struct sppp *sp)
static void
sppp_lcp_tls(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
sp->pp_phase = PHASE_ESTABLISH;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify lower layer if desired. */
if (sp->pp_tls)
(sp->pp_tls)(sp);
- else
- (sp->pp_up)(sp);
}
static void
sppp_lcp_tlf(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
sp->pp_phase = PHASE_DEAD;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify lower layer if desired. */
if (sp->pp_tlf)
(sp->pp_tlf)(sp);
- else
- (sp->pp_down)(sp);
}
static void
@@ -2398,7 +2356,7 @@ sppp_lcp_scr(struct sppp *sp)
if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) {
if (! sp->lcp.magic)
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->lcp.magic = random();
#else
sp->lcp.magic = time.tv_sec + time.tv_usec;
@@ -2478,7 +2436,7 @@ sppp_ipcp_init(struct sppp *sp)
sp->ipcp.flags = 0;
sp->state[IDX_IPCP] = STATE_INITIAL;
sp->fail_counter[IDX_IPCP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_IPCP]);
#endif
}
@@ -2501,8 +2459,6 @@ sppp_ipcp_open(struct sppp *sp)
STDDCL;
u_long myaddr, hisaddr;
- sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN);
-
sppp_get_ip_addrs(sp, &myaddr, &hisaddr, 0);
/*
* If we don't have his address, this probably means our
@@ -2525,8 +2481,7 @@ sppp_ipcp_open(struct sppp *sp)
*/
sp->ipcp.flags |= IPCP_MYADDR_DYN;
sp->ipcp.opts |= (1 << IPCP_OPT_ADDRESS);
- } else
- sp->ipcp.flags |= IPCP_MYADDR_SEEN;
+ }
sppp_open_event(&ipcp, sp);
}
@@ -2560,7 +2515,6 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
struct ifnet *ifp = &sp->pp_if;
int rlen, origlen, debug = ifp->if_flags & IFF_DEBUG;
u_long hisaddr, desiredaddr;
- int gotmyaddr = 0;
len -= 4;
origlen = len;
@@ -2634,11 +2588,10 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
continue;
#endif
case IPCP_OPT_ADDRESS:
- /* This is the address he wants in his end */
desiredaddr = p[2] << 24 | p[3] << 16 |
p[4] << 8 | p[5];
if (desiredaddr == hisaddr ||
- (hisaddr == 1 && desiredaddr != 0)) {
+ hisaddr == 1 && desiredaddr != 0) {
/*
* Peer's address is same as our value,
* or we have set it to 0.0.0.1 to
@@ -2648,7 +2601,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
*/
if (debug)
addlog("%s [ack] ",
- sppp_dotted_quad(hisaddr));
+ sppp_dotted_quad(desiredaddr));
/* record that we've seen it already */
sp->ipcp.flags |= IPCP_HISADDR_SEEN;
continue;
@@ -2659,14 +2612,13 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
* address, or he send us another address not
* matching our value. Either case, we gonna
* conf-nak it with our value.
- * XXX: we should "rej" if hisaddr == 0
*/
if (debug) {
if (desiredaddr == 0)
addlog("[addr requested] ");
else
addlog("%s [not agreed] ",
- sppp_dotted_quad(desiredaddr));
+ sppp_dotted_quad(desiredaddr));
p[2] = hisaddr >> 24;
p[3] = hisaddr >> 16;
@@ -2691,7 +2643,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
* doesn't want to send us his address. Q: What should we do
* about it? XXX A: implement the max-failure counter.
*/
- if (rlen == 0 && !(sp->ipcp.flags & IPCP_HISADDR_SEEN) && !gotmyaddr) {
+ if (rlen == 0 && !(sp->ipcp.flags & IPCP_HISADDR_SEEN)) {
buf[0] = IPCP_OPT_ADDRESS;
buf[1] = 6;
buf[2] = hisaddr >> 24;
@@ -2747,7 +2699,6 @@ sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
/*
* Peer doesn't grok address option. This is
* bad. XXX Should we better give up here?
- * XXX We could try old "addresses" option...
*/
sp->ipcp.opts &= ~(1 << IPCP_OPT_ADDRESS);
break;
@@ -2808,14 +2759,11 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
* we accept his offer. Otherwise, we
* ignore it and thus continue to negotiate
* our already existing value.
- * XXX: Bogus, if he said no once, he'll
- * just say no again, might as well die.
*/
if (sp->ipcp.flags & IPCP_MYADDR_DYN) {
sppp_set_ip_addr(sp, wantaddr);
if (debug)
addlog("[agree] ");
- sp->ipcp.flags |= IPCP_MYADDR_SEEN;
}
}
break;
@@ -2837,9 +2785,6 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
static void
sppp_ipcp_tlu(struct sppp *sp)
{
- /* we are up - notify isdn daemon */
- if (sp->pp_con)
- sp->pp_con(sp);
}
static void
@@ -3213,7 +3158,7 @@ sppp_chap_init(struct sppp *sp)
/* Chap doesn't have STATE_INITIAL at all. */
sp->state[IDX_CHAP] = STATE_CLOSED;
sp->fail_counter[IDX_CHAP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_CHAP]);
#endif
}
@@ -3298,7 +3243,11 @@ sppp_chap_tlu(struct sppp *sp)
* a number between 300 and 810 seconds.
*/
i = 300 + ((unsigned)(random() & 0xff00) >> 7);
- TIMEOUT(chap.TO, (void *)sp, i * hz, sp->ch[IDX_CHAP]);
+
+#if defined (__FreeBSD__)
+ sp->ch[IDX_CHAP] =
+#endif
+ timeout(chap.TO, (void *)sp, i * hz);
}
if (debug) {
@@ -3353,17 +3302,17 @@ sppp_chap_scr(struct sppp *sp)
{
u_long *ch, seed;
u_char clen;
+#if defined (__NetBSD__) || defined (__OpenBSD__)
+ struct timeval tv;
+#endif
/* Compute random challenge. */
ch = (u_long *)sp->myauth.challenge;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
read_random(&seed, sizeof seed);
#else
- {
- struct timeval tv;
microtime(&tv);
seed = tv.tv_sec ^ tv.tv_usec;
- }
#endif
ch[0] = seed ^ random();
ch[1] = seed ^ random();
@@ -3545,7 +3494,7 @@ sppp_pap_init(struct sppp *sp)
/* PAP doesn't have STATE_INITIAL at all. */
sp->state[IDX_PAP] = STATE_CLOSED;
sp->fail_counter[IDX_PAP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_PAP]);
callout_handle_init(&sp->pap_my_to_ch);
#endif
@@ -3563,8 +3512,10 @@ sppp_pap_open(struct sppp *sp)
if (sp->myauth.proto == PPP_PAP) {
/* we are peer, send a request, and start a timer */
pap.scr(sp);
- TIMEOUT(sppp_pap_my_TO, (void *)sp, sp->lcp.timeout,
- sp->pap_my_to_ch);
+#if defined (__FreeBSD__)
+ sp->pap_my_to_ch =
+#endif
+ timeout(sppp_pap_my_TO, (void *)sp, sp->lcp.timeout);
}
}
@@ -3700,14 +3651,10 @@ sppp_pap_scr(struct sppp *sp)
* Varadic function, each of the elements for the ellipsis is of type
* ``size_t mlen, const u_char *msg''. Processing will stop iff
* mlen == 0.
- * NOTE: never declare variadic functions with types subject to type
- * promotion (i.e. u_char). This is asking for big trouble depending
- * on the architecture you are on...
*/
static void
-sppp_auth_send(const struct cp *cp, struct sppp *sp,
- unsigned int type, unsigned int id,
+sppp_auth_send(const struct cp *cp, struct sppp *sp, u_char type, u_char id,
...)
{
STDDCL;
@@ -3716,7 +3663,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
struct mbuf *m;
u_char *p;
int len;
- unsigned int mlen;
+ size_t mlen;
const char *msg;
va_list ap;
@@ -3738,7 +3685,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
va_start(ap, id);
len = 0;
- while ((mlen = (unsigned int)va_arg(ap, size_t)) != 0) {
+ while ((mlen = va_arg(ap, size_t)) != 0) {
msg = va_arg(ap, const char *);
len += mlen;
if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN) {
@@ -3843,7 +3790,10 @@ sppp_keepalive(void *dummy)
}
}
splx(s);
- TIMEOUT(sppp_keepalive, 0, hz * 10, keepalive_ch);
+#if defined (__FreeBSD__)
+ keepalive_ch =
+#endif
+ timeout(sppp_keepalive, 0, hz * 10);
}
/*
@@ -3863,17 +3813,14 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
-#elif defined(__NetBSD__) || defined (__OpenBSD__)
- for (ifa = ifp->if_addrlist.tqh_first;
+#if defined (__FreeBSD__)
+ for (ifa = ifp->if_addrhead.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_list.tqe_next)
+ ifa = ifa->ifa_link.tqe_next)
#else
- for (ifa = ifp->if_addrlist;
+ for (ifa = ifp->if_addrlist.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_next)
+ ifa = ifa->ifa_list.tqe_next)
#endif
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
@@ -3903,7 +3850,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
static void
sppp_set_ip_addr(struct sppp *sp, u_long src)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
struct ifaddr *ifa;
struct sockaddr_in *si;
@@ -3911,17 +3858,15 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
-#elif defined(__NetBSD__) || defined (__OpenBSD__)
- for (ifa = ifp->if_addrlist.tqh_first;
+
+#if defined (__FreeBSD__)
+ for (ifa = ifp->if_addrhead.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_list.tqe_next)
+ ifa = ifa->ifa_link.tqe_next)
#else
- for (ifa = ifp->if_addrlist;
+ for (ifa = ifp->if_addrlist.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_next)
+ ifa = ifa->ifa_list.tqe_next)
#endif
{
if (ifa->ifa_addr->sa_family == AF_INET)
@@ -3933,40 +3878,8 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
}
if (ifa && si)
- {
- int error;
-#if __NetBSD_Version__ >= 103080000
- struct sockaddr_in new_sin = *si;
-
- new_sin.sin_addr.s_addr = htonl(src);
- error = in_ifinit(ifp, ifatoia(ifa), &new_sin, 1);
- if(debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: in_ifinit "
- " failed, error=%d\n", SPP_ARGS(ifp), error);
- }
-#else
- /* delete old route */
- error = rtinit(ifa, (int)RTM_DELETE, RTF_HOST);
- if(debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: rtinit DEL failed, error=%d\n",
- SPP_ARGS(ifp), error);
- }
-
- /* set new address */
si->sin_addr.s_addr = htonl(src);
-
- /* add new route */
- error = rtinit(ifa, (int)RTM_ADD, RTF_HOST);
- if (debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: rtinit ADD failed, error=%d",
- SPP_ARGS(ifp), error);
- }
-#endif
- }
-}
+}
static int
sppp_params(struct sppp *sp, u_long cmd, void *data)
@@ -4075,15 +3988,14 @@ sppp_params(struct sppp *sp, u_long cmd, void *data)
static void
sppp_phase_network(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
sp->pp_phase = PHASE_NETWORK;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify NCPs now. */
for (i = 0; i < IDX_COUNT; i++)
@@ -4117,7 +4029,7 @@ sppp_cp_type_name(u_char type)
case ECHO_REPLY: return "echo-reply";
case DISC_REQ: return "discard-req";
}
- snprintf (buf, sizeof(buf), "0x%x", type);
+ sprintf (buf, "0x%x", type);
return buf;
}
@@ -4140,7 +4052,7 @@ sppp_auth_type_name(u_short proto, u_char type)
case PAP_NAK: return "nak";
}
}
- snprintf (buf, sizeof(buf), "0x%x", type);
+ sprintf (buf, "0x%x", type);
return buf;
}
@@ -4157,7 +4069,7 @@ sppp_lcp_opt_name(u_char opt)
case LCP_OPT_PROTO_COMP: return "proto-comp";
case LCP_OPT_ADDR_COMP: return "addr-comp";
}
- snprintf (buf, sizeof(buf), "0x%x", opt);
+ sprintf (buf, "0x%x", opt);
return buf;
}
@@ -4170,7 +4082,7 @@ sppp_ipcp_opt_name(u_char opt)
case IPCP_OPT_COMPRESSION: return "compression";
case IPCP_OPT_ADDRESS: return "address";
}
- snprintf (buf, sizeof(buf), "0x%x", opt);
+ sprintf (buf, "0x%x", opt);
return buf;
}
@@ -4215,7 +4127,7 @@ sppp_proto_name(u_short proto)
case PPP_PAP: return "pap";
case PPP_CHAP: return "chap";
}
- snprintf(buf, sizeof(buf), "0x%x", (unsigned)proto);
+ sprintf(buf, "0x%x", (unsigned)proto);
return buf;
}
@@ -4272,3 +4184,10 @@ sppp_null(struct sppp *unused)
{
/* do just nothing */
}
+/*
+ * This file is large. Tell emacs to highlight it nevertheless.
+ *
+ * Local Variables:
+ * hilit-auto-highlight-maxout: 120000
+ * End:
+ */
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index ed98e6c0a539..e00ce0c5bd3d 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -30,7 +30,6 @@
#include <sys/ttycom.h>
#include <sys/poll.h>
#include <sys/signalvar.h>
-#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#ifdef DEVFS
@@ -38,7 +37,13 @@
#endif /*DEVFS*/
#include <sys/conf.h>
#include <sys/uio.h>
+/*
+ * XXX stop <sys/vnode.h> from including <vnode_if.h>. <vnode_if.h> doesn't
+ * exist if we are an LKM.
+ */
+#undef KERNEL
#include <sys/vnode.h>
+#define KERNEL
#include <net/if.h>
#include <net/netisr.h>
@@ -210,7 +215,7 @@ tunclose(dev, foo, bar, p)
}
splx(s);
}
- funsetown(tp->tun_sigio);
+ tp->tun_pgrp = 0;
selwakeup(&tp->tun_rsel);
TUNDEBUG ("%s%d: closed\n", ifp->if_name, ifp->if_unit);
@@ -301,6 +306,7 @@ tunoutput(ifp, m0, dst, rt)
struct rtentry *rt;
{
struct tun_softc *tp = &tunctl[ifp->if_unit];
+ struct proc *p;
int s;
TUNDEBUG ("%s%d: tunoutput\n", ifp->if_name, ifp->if_unit);
@@ -366,8 +372,12 @@ tunoutput(ifp, m0, dst, rt)
tp->tun_flags &= ~TUN_RWAIT;
wakeup((caddr_t)tp);
}
- if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio)
- pgsigio(tp->tun_sigio, SIGIO, 0);
+ if (tp->tun_flags & TUN_ASYNC && tp->tun_pgrp) {
+ if (tp->tun_pgrp > 0)
+ gsignal(tp->tun_pgrp, SIGIO);
+ else if ((p = pfind(-tp->tun_pgrp)) != 0)
+ psignal(p, SIGIO);
+ }
selwakeup(&tp->tun_rsel);
return 0;
}
@@ -424,22 +434,12 @@ tunioctl(dev, cmd, data, flag, p)
*(int *)data = 0;
splx(s);
break;
- case FIOSETOWN:
- return (fsetown(*(int *)data, &tp->tun_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(tp->tun_sigio);
- return (0);
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &tp->tun_sigio));
-
- /* This is deprecated, FIOGETOWN should be used instead. */
+ tp->tun_pgrp = *(int *)data;
+ break;
case TIOCGPGRP:
- *(int *)data = -fgetown(tp->tun_sigio);
- return (0);
-
+ *(int *)data = tp->tun_pgrp;
+ break;
default:
return (ENOTTY);
}
diff --git a/sys/net/if_tunvar.h b/sys/net/if_tunvar.h
index 9e537d3abef8..c44911bcc15c 100644
--- a/sys/net/if_tunvar.h
+++ b/sys/net/if_tunvar.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_tunvar.h,v 1.2 1998/11/11 10:04:10 truckman Exp $
+ * $Id:$
*/
#ifndef _NET_IF_TUNVAR_H_
@@ -42,7 +42,7 @@ struct tun_softc {
#define TUN_READY (TUN_OPEN | TUN_INITED)
struct ifnet tun_if; /* the interface */
- struct sigio *tun_sigio; /* information for async I/O */
+ int tun_pgrp; /* the process group - if any */
struct selinfo tun_rsel; /* read select */
struct selinfo tun_wsel; /* write select (not used) */
};
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 31ce8f63c15d..0feaf2322d29 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id: if_var.h,v 1.9 1998/06/12 03:48:09 julian Exp $
+ * $Id: if_var.h,v 1.8 1998/06/07 17:12:06 dfr Exp $
*/
#ifndef _NET_IF_VAR_H_
@@ -300,9 +300,10 @@ int if_allmulti __P((struct ifnet *, int));
void if_attach __P((struct ifnet *));
int if_delmulti __P((struct ifnet *, struct sockaddr *));
void if_down __P((struct ifnet *));
-void if_route __P((struct ifnet *, int flag, int fam));
-void if_unroute __P((struct ifnet *, int flag, int fam));
void if_up __P((struct ifnet *));
+#ifdef vax
+void ifubareset __P((int));
+#endif
/*void ifinit __P((void));*/ /* declared in systm.h for main() */
int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *));
int ifpromisc __P((struct ifnet *, int));
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 2488b31a1a36..d6149e9175e1 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_vlan.c,v 1.3 1998/08/23 03:07:10 wollman Exp $
+ * $Id: if_vlan.c,v 1.2 1998/05/15 20:02:47 wollman Exp $
*/
/*
@@ -334,8 +334,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCGETVLAN:
bzero(&vlr, sizeof vlr);
if (ifv->ifv_p) {
- snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent),
- "%s%d", ifv->ifv_p->if_name, ifv->ifv_p->if_unit);
+ sprintf(vlr.vlr_parent, "%s%d", ifv->ifv_p->if_name,
+ ifv->ifv_p->if_unit);
vlr.vlr_tag = ifv->ifv_tag;
}
error = copyout(&vlr, ifr->ifr_data, sizeof vlr);
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 74e7172f960c..dc48c8f2b410 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -70,7 +70,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
-/* $Id: ppp_tty.c,v 1.37 1998/06/20 16:39:35 peter Exp $ */
+/* $Id: ppp_tty.c,v 1.36 1998/06/07 17:12:07 dfr Exp $ */
#include "ppp.h"
#if NPPP > 0
@@ -89,7 +89,14 @@
#include <sys/tty.h>
#include <sys/conf.h>
#include <sys/uio.h>
-#include <sys/vnode.h>
+
+/*
+ * XXX stop <sys/vnode.h> from including <vnode_if.h>. <vnode_if.h> doesn't
+ * exist if we are an LKM.
+ */
+#undef KERNEL
+# include <sys/vnode.h>
+#define KERNEL
#ifdef __i386__
#include <i386/isa/intr_machdep.h>
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index 27295dc46781..702f08857ab8 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -31,6 +31,7 @@ static void at_aarpinput( struct arpcom *ac, struct mbuf *m);
#define AARPTAB_NB 19
#define AARPTAB_SIZE (AARPTAB_BSIZ * AARPTAB_NB)
static struct aarptab aarptab[AARPTAB_SIZE];
+static int aarptab_size = AARPTAB_SIZE;
#define AARPTAB_HASH(a) \
((((a).s_net << 8 ) + (a).s_node ) % AARPTAB_NB )
diff --git a/sys/netatalk/at_rmx.c b/sys/netatalk/at_rmx.c
index ca8db3aff5db..556c1c221b26 100644
--- a/sys/netatalk/at_rmx.c
+++ b/sys/netatalk/at_rmx.c
@@ -37,11 +37,9 @@
#include <net/route.h>
-int at_inithead(void **head, int off);
-
static char hexbuf[256];
-static char *
+char *
prsockaddr(void *v)
{
char *bp = &hexbuf[0];
@@ -149,3 +147,4 @@ at_inithead(void **head, int off)
rnh->rnh_lookup = at_lookup;
return 1;
}
+
diff --git a/sys/netatalk/ddp_input.c b/sys/netatalk/ddp_input.c
index 6f7e9f3d0684..e5d37793d615 100644
--- a/sys/netatalk/ddp_input.c
+++ b/sys/netatalk/ddp_input.c
@@ -37,6 +37,7 @@ atintr( void )
struct elaphdr *elhp, elh;
struct ifnet *ifp;
struct mbuf *m;
+ struct at_ifaddr *aa;
int s;
/*
diff --git a/sys/netatalk/ddp_usrreq.c b/sys/netatalk/ddp_usrreq.c
index ce681ffc509a..45c9b2eb4836 100644
--- a/sys/netatalk/ddp_usrreq.c
+++ b/sys/netatalk/ddp_usrreq.c
@@ -60,6 +60,7 @@ static int
ddp_detach(struct socket *so)
{
struct ddpcb *ddp;
+ int error = 0;
int s;
ddp = sotoddpcb( so );
@@ -118,6 +119,7 @@ ddp_disconnect(struct socket *so)
{
struct ddpcb *ddp;
+ int error = 0;
int s;
ddp = sotoddpcb( so );
@@ -140,7 +142,9 @@ static int
ddp_shutdown(struct socket *so)
{
struct ddpcb *ddp;
-
+ int error = 0;
+ int s;
+
ddp = sotoddpcb( so );
if ( ddp == NULL ) {
return( EINVAL);
@@ -532,7 +536,9 @@ static int
at_setsockaddr(struct socket *so, struct sockaddr **nam)
{
struct ddpcb *ddp;
-
+ int error = 0;
+ int s;
+
ddp = sotoddpcb( so );
if ( ddp == NULL ) {
return( EINVAL);
diff --git a/sys/netatm/atm_aal5.c b/sys/netatm/atm_aal5.c
index 7d6a22bd792b..4d365dd63b40 100644
--- a/sys/netatm/atm_aal5.c
+++ b/sys/netatm/atm_aal5.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_aal5.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,13 +35,13 @@
*
*/
-#include <netatm/kern_include.h>
-#include <sys/stat.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_aal5.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+#include <sys/stat.h>
+
/*
* Global variables
@@ -193,14 +193,15 @@ static Atm_attributes atm_aal5_defattr = {
if (atm_stackq_head != NULL) \
panic("atm_aal5: stack queue not empty"); \
;
-#else /* !DIAGNOSTIC */
+#else
#define ATM_INTRO(f) \
int s, err = 0; \
s = splnet(); \
;
-#endif /* DIAGNOSTIC */
+#endif
#define ATM_OUTRO() \
+out: \
/* \
* Drain any deferred calls \
*/ \
@@ -243,7 +244,7 @@ atm_aal5_attach(so, proto, p)
*/
err = atm_sock_attach(so, atm_aal5_sendspace, atm_aal5_recvspace);
if (err)
- ATM_RETERR(err);
+ goto out;
/*
* Finish up any protocol specific stuff
@@ -257,7 +258,6 @@ atm_aal5_attach(so, proto, p)
atp->atp_attr = atm_aal5_defattr;
strncpy(atp->atp_name, "(AAL5)", T_ATM_APP_NAME_LEN);
-out:
ATM_OUTRO();
}
@@ -521,7 +521,6 @@ atm_aal5_send(so, flags, m, addr, control, p)
KB_FREEALL(m);
}
-out:
ATM_OUTRO();
}
@@ -693,7 +692,7 @@ atm_aal5_incoming(tok, cop, ap, tokp)
Atm_attributes *ap;
void **tokp;
{
- Atm_pcb *atp0 = tok, *atp;
+ Atm_pcb *atp = tok;
struct socket *so;
int err = 0;
@@ -703,11 +702,11 @@ atm_aal5_incoming(tok, cop, ap, tokp)
* Note that our attach function will be called via sonewconn
* and it will allocate and setup most of the pcb.
*/
- atm_sock_stat.as_inconn[atp0->atp_type]++;
+ atm_sock_stat.as_inconn[atp->atp_type]++;
#if (defined(BSD) && (BSD >= 199103))
- so = sonewconn(atp0->atp_socket, 0);
+ so = sonewconn(atp->atp_socket, 0);
#else
- so = sonewconn(atp0->atp_socket);
+ so = sonewconn(atp->atp_socket);
#endif
if (so) {
@@ -716,12 +715,10 @@ atm_aal5_incoming(tok, cop, ap, tokp)
*/
atp = sotoatmpcb(so);
atp->atp_conn = cop;
- atp->atp_attr = *atp0->atp_conn->co_lattr;
- strncpy(atp->atp_name, atp0->atp_name, T_ATM_APP_NAME_LEN);
*tokp = atp;
} else {
err = ECONNABORTED;
- atm_sock_stat.as_connfail[atp0->atp_type]++;
+ atm_sock_stat.as_connfail[atp->atp_type]++;
}
return (err);
@@ -826,7 +823,6 @@ atm_aal5_ctloutput(so, sopt)
break;
case T_ATM_CAUSE:
- case T_ATM_APP_NAME:
break;
default:
@@ -856,7 +852,6 @@ atm_aal5_ctloutput(so, sopt)
break;
}
-out:
ATM_OUTRO();
}
diff --git a/sys/netatm/atm_cm.c b/sys/netatm/atm_cm.c
index 6ae42e8396bd..4304b56dc750 100644
--- a/sys/netatm/atm_cm.c
+++ b/sys/netatm/atm_cm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_cm.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: atm_cm.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_cm.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_cm.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Global variables
diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c
index d68134fc03fe..3a65880e1574 100644
--- a/sys/netatm/atm_device.c
+++ b/sys/netatm/atm_device.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_device.c,v 1.3 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_device.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_device.c,v 1.3 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_device.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Private structures for managing allocated kernel memory resources
@@ -874,7 +874,7 @@ atm_dev_pdu_print(cup, cvp, m, msg)
{
char buf[128];
- snprintf(buf, sizeof(buf), "%s vcc=(%d,%d)", msg,
+ sprintf(buf, "%s vcc=(%d,%d)", msg,
cvp->cv_connvc->cvc_vcc->vc_vpi,
cvp->cv_connvc->cvc_vcc->vc_vci);
diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c
index a3609551b484..a07ccc2251d6 100644
--- a/sys/netatm/atm_if.c
+++ b/sys/netatm/atm_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_if.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_if.c,v 1.13 1998/07/23 21:43:55 root Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_if.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_if.c,v 1.13 1998/07/23 21:43:55 root Exp $";
#endif
+#include <netatm/kern_include.h>
+
#if (defined(BSD) && (BSD < 199506))
extern int ifqmaxlen;
@@ -326,8 +326,8 @@ atm_physif_ioctl(code, data, arg)
KM_ZERO((caddr_t)&apr, sizeof(apr));
smp = pip->pif_sigmgr;
sip = pip->pif_siginst;
- (void) snprintf(apr.anp_intf, sizeof(apr.anp_intf),
- "%s%d", pip->pif_name, pip->pif_unit );
+ (void) sprintf(apr.anp_intf, "%s%d", pip->pif_name,
+ pip->pif_unit );
if ( pip->pif_nif )
{
strcpy(apr.anp_nif_pref, pip->pif_nif->nif_if.if_name);
@@ -380,14 +380,14 @@ atm_physif_ioctl(code, data, arg)
* Fill in info to be returned
*/
KM_ZERO((caddr_t)&anr, sizeof(anr));
- (void) snprintf(anr.anp_intf, sizeof(anr.anp_intf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(anr.anp_intf, "%s%d", ifp->if_name,
+ ifp->if_unit);
IFP_TO_IA(ifp, ia);
if (ia) {
anr.anp_proto_addr = *ia->ia_ifa.ifa_addr;
}
- (void) snprintf(anr.anp_phy_intf, sizeof(anr.anp_phy_intf),
- "%s%d", pip->pif_name, pip->pif_unit);
+ (void) sprintf(anr.anp_phy_intf, "%s%d", pip->pif_name,
+ pip->pif_unit);
/*
* Copy data to user buffer
@@ -410,8 +410,7 @@ atm_physif_ioctl(code, data, arg)
pip = (struct atm_pif *)arg;
if ( pip == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response into users buffer
@@ -573,8 +572,8 @@ atm_physif_ioctl(code, data, arg)
* Fill in info to be returned
*/
KM_ZERO((caddr_t)&acr, sizeof(acr));
- (void) snprintf(acr.acp_intf, sizeof(acr.acp_intf),
- "%s%d", pip->pif_name, pip->pif_unit);
+ (void) sprintf(acr.acp_intf, "%s%d", pip->pif_name,
+ pip->pif_unit);
KM_COPY((caddr_t)acp, (caddr_t)&acr.acp_cfg,
sizeof(Atm_config));
diff --git a/sys/netatm/atm_proto.c b/sys/netatm/atm_proto.c
index 5327e4ed923a..ddd1a88bb201 100644
--- a/sys/netatm/atm_proto.c
+++ b/sys/netatm/atm_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_proto.c,v 1.1 1998/09/15 08:22:58 phk Exp $
+ * @(#) $Id: atm_proto.c,v 1.6 1998/02/19 19:52:06 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_proto.c,v 1.1 1998/09/15 08:22:58 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_proto.c,v 1.6 1998/02/19 19:52:06 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
struct protosw atmsw[] = {
{ SOCK_DGRAM, /* ioctl()-only */
diff --git a/sys/netatm/atm_signal.c b/sys/netatm/atm_signal.c
index da46c98771a5..8acbf7a11757 100644
--- a/sys/netatm/atm_signal.c
+++ b/sys/netatm/atm_signal.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_signal.c,v 1.1 1998/09/15 08:22:58 phk Exp $
+ * @(#) $Id: atm_signal.c,v 1.8 1998/03/24 20:45:37 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_signal.c,v 1.1 1998/09/15 08:22:58 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_signal.c,v 1.8 1998/03/24 20:45:37 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local variables
diff --git a/sys/netatm/atm_socket.c b/sys/netatm/atm_socket.c
index 004fba4949d0..2370a15fd070 100644
--- a/sys/netatm/atm_socket.c
+++ b/sys/netatm/atm_socket.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_socket.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_socket.c,v 1.3 1998/07/30 22:30:53 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_socket.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_socket.c,v 1.3 1998/07/30 22:30:53 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local functions
@@ -1207,8 +1207,8 @@ atm_sock_getopt(so, sopt, atp)
struct ifnet *ifp;
ifp = &ap->nif->nif_if;
- (void) snprintf(netif.net_intf, sizeof(netif.net_intf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(netif.net_intf, "%s%d",
+ ifp->if_name, ifp->if_unit);
return (sooptcopyout(sopt, &netif,
sizeof netif));
} else {
diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c
index 328b6be5a57f..3fcf36e16a79 100644
--- a/sys/netatm/atm_subr.c
+++ b/sys/netatm/atm_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_subr.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:59 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_subr.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:59 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Global variables
diff --git a/sys/netatm/atm_usrreq.c b/sys/netatm/atm_usrreq.c
index 278d9f8f8574..4231d1c010d1 100644
--- a/sys/netatm/atm_usrreq.c
+++ b/sys/netatm/atm_usrreq.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_usrreq.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_usrreq.c,v 1.7 1998/06/29 21:51:29 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_usrreq.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_usrreq.c,v 1.7 1998/06/29 21:51:29 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local functions
@@ -98,6 +98,7 @@ struct pr_usrreqs atm_dgram_usrreqs = {
#endif
#define ATM_OUTRO() \
+done: \
/* \
* Drain any deferred calls \
*/ \
@@ -108,7 +109,7 @@ struct pr_usrreqs atm_dgram_usrreqs = {
#define ATM_RETERR(errno) { \
err = errno; \
- goto out; \
+ goto done; \
}
@@ -437,7 +438,6 @@ atm_dgram_control(so, cmd, data, ifp, p)
err = EOPNOTSUPP;
}
-out:
ATM_OUTRO();
}
@@ -547,17 +547,11 @@ atm_dgram_info(data)
for (pip = atm_interface_head; pip;
pip = pip->pif_next) {
if (smp = pip->pif_sigmgr) {
- for (nip = pip->pif_nif; nip;
- nip = nip->nif_pnext) {
- err = (*smp->sm_ioctl)
- (AIOCS_INF_ASV, data,
- (caddr_t)nip);
- if (err)
- break;
- }
- if (err)
- break;
+ err = (*smp->sm_ioctl)(AIOCS_INF_ASV,
+ data, NULL);
}
+ if (err)
+ break;
}
}
break;
diff --git a/sys/netatm/ipatm/ipatm_event.c b/sys/netatm/ipatm/ipatm_event.c
index 66f736e6bbd0..842ee64feaaa 100644
--- a/sys/netatm/ipatm/ipatm_event.c
+++ b/sys/netatm/ipatm/ipatm_event.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_event.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: ipatm_event.c,v 1.1 1998/09/15 08:23:00 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_event.c,v 1.1 1998/09/15 08:23:00 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_event.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Process an IP VCC timeout
diff --git a/sys/netatm/ipatm/ipatm_if.c b/sys/netatm/ipatm/ipatm_if.c
index 7cac3da4e319..ede2450ff8be 100644
--- a/sys/netatm/ipatm/ipatm_if.c
+++ b/sys/netatm/ipatm/ipatm_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_if.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_if.c,v 1.6 1998/03/24 20:51:47 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_if.c,v 1.6 1998/03/24 20:51:47 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_if.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/ipatm/ipatm_input.c b/sys/netatm/ipatm/ipatm_input.c
index 5d292fe2c906..ca3e3e75a34a 100644
--- a/sys/netatm/ipatm/ipatm_input.c
+++ b/sys/netatm/ipatm/ipatm_input.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_input.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_input.c,v 1.9 1998/04/07 23:03:52 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_input.c,v 1.9 1998/04/07 23:03:52 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_input.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Process VCC Input Data
@@ -111,10 +111,7 @@ ipatm_ipinput(inp, m)
struct ip_nif *inp;
KBuffer *m;
{
- int s;
-#if BSD < 199103
- int space;
-#endif
+ int s, space;
#ifdef DIAGNOSTIC
if (ipatm_print) {
diff --git a/sys/netatm/ipatm/ipatm_load.c b/sys/netatm/ipatm/ipatm_load.c
index 38254150b1e2..8caa6354a4cb 100644
--- a/sys/netatm/ipatm/ipatm_load.c
+++ b/sys/netatm/ipatm/ipatm_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_load.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_load.c,v 1.12 1998/07/30 22:23:00 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_load.c,v 1.12 1998/07/30 22:23:00 mks Exp $";
+#endif
+
#ifndef ATM_IP_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_load.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Global variables
diff --git a/sys/netatm/ipatm/ipatm_output.c b/sys/netatm/ipatm/ipatm_output.c
index 54def8a1e506..7f02f28c8505 100644
--- a/sys/netatm/ipatm/ipatm_output.c
+++ b/sys/netatm/ipatm/ipatm_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_output.c,v 1.1 1998/09/15 08:23:01 phk Exp $
+ * @(#) $Id: ipatm_output.c,v 1.6 1998/02/19 20:14:17 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_output.c,v 1.6 1998/02/19 20:14:17 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_output.c,v 1.1 1998/09/15 08:23:01 phk Exp $");
-#endif
-
/*
* Output an IP Packet
diff --git a/sys/netatm/ipatm/ipatm_usrreq.c b/sys/netatm/ipatm/ipatm_usrreq.c
index 6fc94d6feb76..1f1751c703d5 100644
--- a/sys/netatm/ipatm/ipatm_usrreq.c
+++ b/sys/netatm/ipatm/ipatm_usrreq.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_usrreq.c,v 1.2 1998/10/31 20:06:55 phk Exp $
+ * @(#) $Id: ipatm_usrreq.c,v 1.6 1998/05/18 19:14:04 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_usrreq.c,v 1.6 1998/05/18 19:14:04 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_usrreq.c,v 1.2 1998/10/31 20:06:55 phk Exp $");
-#endif
-
/*
* Process IP PF_ATM ioctls
@@ -333,8 +333,7 @@ ipatm_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aivr.aip_dst_addr)->sin_addr.s_addr =
ivp->iv_dst.s_addr;
- (void) snprintf(aivr.aip_intf,
- sizeof(aivr.aip_intf), "%s%d",
+ (void) sprintf(aivr.aip_intf, "%s%d",
inp->inf_nif->nif_if.if_name,
inp->inf_nif->nif_if.if_unit);
if ((ivp->iv_conn) &&
diff --git a/sys/netatm/ipatm/ipatm_vcm.c b/sys/netatm/ipatm/ipatm_vcm.c
index 8bfab7e5e064..cb8f46bdb61a 100644
--- a/sys/netatm/ipatm/ipatm_vcm.c
+++ b/sys/netatm/ipatm/ipatm_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_vcm.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: ipatm_vcm.c,v 1.1 1998/09/15 08:23:01 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_vcm.c,v 1.1 1998/09/15 08:23:01 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_vcm.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
Atm_attributes ipatm_aal5llc = {
NULL, /* nif */
diff --git a/sys/netatm/sigpvc/sigpvc_if.c b/sys/netatm/sigpvc/sigpvc_if.c
index b3af607af6a1..4208f29f4cb3 100644
--- a/sys/netatm/sigpvc/sigpvc_if.c
+++ b/sys/netatm/sigpvc/sigpvc_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sigpvc_if.c,v 1.3 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: sigpvc_if.c,v 1.13 1998/07/30 22:32:42 mks Exp $
*
*/
@@ -36,6 +36,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sigpvc_if.c,v 1.13 1998/07/30 22:32:42 mks Exp $";
+#endif
+
#ifndef ATM_SIGPVC_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include <netatm/sigpvc/sigpvc.h>
#include <netatm/sigpvc/sigpvc_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sigpvc_if.c,v 1.3 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -604,8 +604,7 @@ sigpvc_ioctl(code, data, arg1)
/*
* Fill in info to be returned
*/
- (void) snprintf(avr.avp_intf, sizeof(avr.avp_intf),
- "%s%d",
+ (void) sprintf(avr.avp_intf, "%s%d",
pvp->pv_pif->pif_name, pvp->pv_pif->pif_unit);
avr.avp_vpi = vcp->vc_vpi;
avr.avp_vci = vcp->vc_vci;
@@ -653,9 +652,8 @@ sigpvc_ioctl(code, data, arg1)
break;
case AIOCS_INF_ARP:
- case AIOCS_INF_ASV:
/*
- * Get ARP table/server information
+ * Get ARP table information
*/
/* We don't maintain any ARP information */
break;
diff --git a/sys/netatm/sigpvc/sigpvc_subr.c b/sys/netatm/sigpvc/sigpvc_subr.c
index 63e3b64fd577..00f92ec125e5 100644
--- a/sys/netatm/sigpvc/sigpvc_subr.c
+++ b/sys/netatm/sigpvc/sigpvc_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sigpvc_subr.c,v 1.1 1998/09/15 08:23:02 phk Exp $
+ * @(#) $Id: sigpvc_subr.c,v 1.7 1998/06/29 21:52:25 mks Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sigpvc_subr.c,v 1.7 1998/06/29 21:52:25 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/sigpvc/sigpvc.h>
#include <netatm/sigpvc/sigpvc_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sigpvc_subr.c,v 1.1 1998/09/15 08:23:02 phk Exp $");
-#endif
-
extern struct sp_info sigpvc_vcpool;
/*
diff --git a/sys/netatm/spans/spans_arp.c b/sys/netatm/spans/spans_arp.c
index d2d65e6c3879..5a2443af9de3 100644
--- a/sys/netatm/spans/spans_arp.c
+++ b/sys/netatm/spans/spans_arp.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_arp.c,v 1.3 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: spans_arp.c,v 1.9 1998/06/29 22:03:12 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_arp.c,v 1.9 1998/06/29 22:03:12 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -43,10 +47,6 @@
#include <netatm/spans/spans_var.h>
#include <netatm/spans/spans_cls.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_arp.c,v 1.3 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -1089,8 +1089,7 @@ spansarp_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr =
sap->sa_dstip.s_addr;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
clp->cls_ipnif->inf_nif->nif_if.if_name,
clp->cls_ipnif->inf_nif->nif_if.if_unit
);
@@ -1125,13 +1124,6 @@ spansarp_ioctl(code, data, arg1)
aip->air_buf_len = buf_len;
break;
- case AIOCS_INF_ASV:
- /*
- * Get ARP server information
- */
- /* SPANS doesn't have an ARP server */
- break;
-
default:
err = EOPNOTSUPP;
}
diff --git a/sys/netatm/spans/spans_cls.c b/sys/netatm/spans/spans_cls.c
index 17dc135fc547..f496311f0d39 100644
--- a/sys/netatm/spans/spans_cls.c
+++ b/sys/netatm/spans/spans_cls.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_cls.c,v 1.2 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_cls.c,v 1.11 1998/06/29 22:04:29 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_cls.c,v 1.11 1998/06/29 22:04:29 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -43,10 +47,6 @@
#include <netatm/spans/spans_var.h>
#include <netatm/spans/spans_cls.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_cls.c,v 1.2 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* Global variables
@@ -842,7 +842,7 @@ spanscls_pdu_print(clp, m, msg)
{
char buf[128];
- snprintf(buf, sizeof(buf), "spanscls %s:\n", msg);
+ sprintf(buf, "spanscls %s:\n", msg);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/spans/spans_if.c b/sys/netatm/spans/spans_if.c
index 4557f26a662d..6546ae25a601 100644
--- a/sys/netatm/spans/spans_if.c
+++ b/sys/netatm/spans/spans_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_if.c,v 1.3 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_if.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -36,6 +36,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_if.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#ifndef ATM_SPANS_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_if.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* Global variables
*/
@@ -972,8 +972,7 @@ spans_ioctl(code, data, arg1)
/*
* Fill out the response struct for the VCC
*/
- (void) snprintf(rsp.avp_intf,
- sizeof(rsp.avp_intf), "%s%d",
+ (void) sprintf(rsp.avp_intf, "%s%d",
spp->sp_pif->pif_name,
spp->sp_pif->pif_unit);
rsp.avp_vpi = svp->sv_vpi;
diff --git a/sys/netatm/spans/spans_kxdr.c b/sys/netatm/spans/spans_kxdr.c
index 3843341c2241..b6534de0e3f7 100644
--- a/sys/netatm/spans/spans_kxdr.c
+++ b/sys/netatm/spans/spans_kxdr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_kxdr.c,v 1.1 1998/09/15 08:23:03 phk Exp $
+ * @(#) $Id: spans_kxdr.c,v 1.2 1997/05/06 22:17:00 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: spans_kxdr.c,v 1.1 1998/09/15 08:23:03 phk Exp $");
+static char *RCSid = "@(#) $Id: spans_kxdr.c,v 1.2 1997/05/06 22:17:00 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* This file contains code that has been copied and/or modified from
* the following FreeBSD files:
diff --git a/sys/netatm/spans/spans_msg.c b/sys/netatm/spans/spans_msg.c
index f04cc7fb3bed..1ce9a50eecfd 100644
--- a/sys/netatm/spans/spans_msg.c
+++ b/sys/netatm/spans/spans_msg.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_msg.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_msg.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_msg.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <rpc/rpc.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_msg.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* External functions
*/
diff --git a/sys/netatm/spans/spans_print.c b/sys/netatm/spans/spans_print.c
index 99e8c94b1828..117324c29ef1 100644
--- a/sys/netatm/spans/spans_print.c
+++ b/sys/netatm/spans/spans_print.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_print.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_print.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* If LONGPRINT is defined, every field of the SPANS message will be
* printed. If not, a shorter summary (useful for debugging without
@@ -54,17 +54,13 @@ __RCSID("@(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
/*
* Local functions
*/
-static void spans_msgtype_str __P((spans_msgtype *, char *, int));
-static void spans_print_msgbody __P((spans_msgbody *));
-static void spans_result_str __P((spans_result *, char *, int));
-
-#ifdef LONGPRINT
-
static void inc_indent __P((void));
static void dec_indent __P((void));
-static void spans_aal_str __P((spans_aal *, char *, int));
-static void spans_query_type_str __P((spans_query_type *, char *, int));
-static void spans_state_str __P((spans_query_type *, char *, int));
+static void spans_aal_str __P((spans_aal *, char *));
+static void spans_result_str __P((spans_result *, char *));
+static void spans_msgtype_str __P((spans_msgtype *, char *));
+static void spans_query_type_str __P((spans_query_type *, char *));
+static void spans_state_str __P((spans_query_type *, char *));
static void spans_print_version __P((spans_version *));
static void spans_print_vpvc __P((spans_vpvc *));
static void spans_print_vpvc_pref __P((spans_vpvc_pref *));
@@ -105,6 +101,7 @@ static void spans_print_parm_leave_cnf __P((spans_parm_leave_cnf *));
static void spans_print_parm_vcir_ind __P((spans_parm_vcir_ind *));
static void spans_print_parm_query_req __P((spans_parm_query_req *));
static void spans_print_parm_query_rsp __P((spans_parm_query_rsp *));
+static void spans_print_msgbody __P((spans_msgbody *));
/*
@@ -119,7 +116,7 @@ static void
inc_indent()
{
if (spans_indent != &indent_str[0]) {
- spans_indent--;
+ *spans_indent--;
}
}
@@ -127,15 +124,14 @@ static void
dec_indent()
{
if (spans_indent != INIT_INDENT) {
- spans_indent++;
+ *spans_indent++;
}
}
static void
-spans_aal_str(objp, dest, len)
+spans_aal_str(objp, dest)
spans_aal *objp;
char *dest;
- int len;
{
static char *aal_names[] = {
"SPANS_AAL0",
@@ -147,20 +143,17 @@ spans_aal_str(objp, dest, len)
};
if (*objp < SPANS_AAL0 || *objp > SPANS_AAL5) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", aal_names[(int)*objp],
+ sprintf(dest, "%s (%d)", aal_names[(int)*objp],
(int)*objp);
}
}
-#endif
-
static void
-spans_result_str(objp, dest, len)
+spans_result_str(objp, dest)
spans_result *objp;
char *dest;
- int len;
{
static char *result_names[] = {
"SPANS_OK",
@@ -171,18 +164,17 @@ spans_result_str(objp, dest, len)
};
if (*objp < SPANS_OK || *objp > SPANS_BADDEST) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)",
+ sprintf(dest, "%s (%d)",
result_names[(int)*objp], (int)*objp);
}
}
static void
-spans_msgtype_str(objp, dest, len)
+spans_msgtype_str(objp, dest)
spans_msgtype *objp;
char *dest;
- int len;
{
int i;
@@ -228,7 +220,7 @@ spans_msgtype_str(objp, dest, len)
*/
for (i=0; msgtype_names[i].name; i++) {
if (*objp == msgtype_names[i].type) {
- snprintf(dest, len, "%s (%d)",
+ sprintf(dest, "%s (%d)",
msgtype_names[i].name,
(int)*objp);
return;
@@ -238,16 +230,13 @@ spans_msgtype_str(objp, dest, len)
/*
* Type was not found--return an error indicator
*/
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
}
-#ifdef LONGPRINT
-
static void
-spans_query_type_str(objp, dest, len)
+spans_query_type_str(objp, dest)
spans_query_type *objp;
char *dest;
- int len;
{
static char *query_names[] = {
"SPANS_QUERY_NORMAL",
@@ -257,18 +246,17 @@ spans_query_type_str(objp, dest, len)
if (*objp < SPANS_QUERY_NORMAL ||
*objp > SPANS_QUERY_END_TO_END) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", query_names[(int)*objp],
+ sprintf(dest, "%s (%d)", query_names[(int)*objp],
(int)*objp);
}
}
static void
-spans_state_str(objp, dest, len)
+spans_state_str(objp, dest)
spans_query_type *objp;
char *dest;
- int len;
{
static char *state_names[] = {
"SPANS_CONN_OPEN",
@@ -278,13 +266,14 @@ spans_state_str(objp, dest, len)
};
if (*objp < SPANS_CONN_OPEN || *objp > SPANS_CONN_CLOSED) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", state_names[(int)*objp],
+ sprintf(dest, "%s (%d)", state_names[(int)*objp],
(int)*objp);
}
}
+#ifdef LONGPRINT
static void
spans_print_version(objp)
@@ -362,7 +351,7 @@ spans_print_aal(objp)
{
char aal_str[80];
- spans_aal_str(objp, aal_str, sizeof(aal_str));
+ spans_aal_str(objp, aal_str);
printf("%sspans_aal %s\n", spans_indent, aal_str);
}
@@ -372,7 +361,7 @@ spans_print_result(objp)
{
char result_str[80];
- spans_result_str(objp, result_str, sizeof(result_str));
+ spans_result_str(objp, result_str);
printf("%sspans_result %s\n", spans_indent, result_str);
}
@@ -382,7 +371,7 @@ spans_print_msgtype(objp)
{
char msgtype_str[80];
- spans_msgtype_str(objp, msgtype_str, sizeof(msgtype_str));
+ spans_msgtype_str(objp, msgtype_str);
printf("%sspans_msgtype %s\n", spans_indent, msgtype_str);
}
@@ -722,8 +711,7 @@ spans_print_parm_query_req(objp)
printf("%sspans_parm_query_req\n", spans_indent);
inc_indent();
spans_print_atm_conn(&objp->qyreq_conn);
- spans_query_type_str(&objp->qyreq_type,
- query_type_str, sizeof(query_type_str));
+ spans_query_type_str(&objp->qyreq_type, query_type_str);
printf("%sqyreq_type %s\n", spans_indent, query_type_str);
dec_indent();
}
@@ -737,11 +725,9 @@ spans_print_parm_query_rsp(objp)
printf("%sspans_parm_query_rsp\n", spans_indent);
inc_indent();
spans_print_atm_conn(&objp->qyrsp_conn);
- spans_query_type_str(&objp->qyrsp_type,
- query_type_str, sizeof(query_type_str));
+ spans_query_type_str(&objp->qyrsp_type, query_type_str);
printf("%sqyrsp_type %s\n", spans_indent, query_type_str);
- spans_state_str(&objp->qyrsp_state,
- state_type_str, sizeof(state_type_str));
+ spans_state_str(&objp->qyrsp_state, state_type_str);
printf("%sqyrsp_state %s\n", spans_indent, state_type_str);
printf("%sqyrsp_data 0x%x\n", spans_indent,
objp->qyrsp_data);
@@ -885,7 +871,7 @@ spans_print_msgbody(objp)
spans_parm_rclose_rsp *rcrsp_p;
spans_parm_rclose_cnf *rccnf_p;
- spans_msgtype_str(&objp->mb_type, msgtype_str, sizeof(msgtype_str));
+ spans_msgtype_str(&objp->mb_type, msgtype_str);
printf("%s: ", msgtype_str);
switch (objp->mb_type) {
case SPANS_STAT_REQ:
@@ -897,7 +883,7 @@ spans_print_msgbody(objp)
strncpy(daddr, spans_addr_print(&stind_p->stind_es_addr),
sizeof(daddr));
strncpy(saddr, spans_addr_print(&stind_p->stind_sw_addr),
- sizeof(saddr));
+ sizeof(daddr));
printf("sw_epoch=0x%lx, es_addr=%s, sw_addr=0x%s",
stind_p->stind_sw_epoch,
daddr, saddr);
@@ -947,8 +933,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&oprsp_p->oprsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&oprsp_p->oprsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&oprsp_p->oprsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d",
result_str, daddr, saddr,
oprsp_p->oprsp_conn.con_dsap,
@@ -962,8 +947,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&opcnf_p->opcnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&opcnf_p->opcnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&opcnf_p->opcnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d",
result_str, daddr, saddr,
opcnf_p->opcnf_conn.con_dsap,
@@ -999,8 +983,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&clrsp_p->clrsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&clrsp_p->clrsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&clrsp_p->clrsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
clrsp_p->clrsp_conn.con_dsap,
@@ -1012,8 +995,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&clcnf_p->clcnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&clcnf_p->clcnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&clcnf_p->clcnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
clcnf_p->clcnf_conn.con_dsap,
@@ -1047,8 +1029,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&rcrsp_p->rcrsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&rcrsp_p->rcrsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&rcrsp_p->rcrsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
rcrsp_p->rcrsp_conn.con_dsap,
@@ -1060,8 +1041,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&rccnf_p->rccnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&rccnf_p->rccnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&rccnf_p->rccnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
rccnf_p->rccnf_conn.con_dsap,
@@ -1075,9 +1055,7 @@ void
spans_print_msg(objp)
spans_msg *objp;
{
-#ifdef LONGPRINT
spans_indent = INIT_INDENT;
-#endif
spans_print_msgbody(&objp->sm_body);
}
diff --git a/sys/netatm/spans/spans_proto.c b/sys/netatm/spans/spans_proto.c
index 2cd2f7226242..b0e0f1e44c1e 100644
--- a/sys/netatm/spans/spans_proto.c
+++ b/sys/netatm/spans/spans_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_proto.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_proto.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_proto.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_proto.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Internal functions
*/
diff --git a/sys/netatm/spans/spans_subr.c b/sys/netatm/spans/spans_subr.c
index b2a418c454b5..a6e720f811c4 100644
--- a/sys/netatm/spans/spans_subr.c
+++ b/sys/netatm/spans/spans_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_subr.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_subr.c,v 1.1 1998/09/15 08:23:04 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_subr.c,v 1.1 1998/09/15 08:23:04 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_subr.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Open a SPANS VCC
diff --git a/sys/netatm/spans/spans_util.c b/sys/netatm/spans/spans_util.c
index 904f176d2d56..f3f0235264f6 100644
--- a/sys/netatm/spans/spans_util.c
+++ b/sys/netatm/spans/spans_util.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_util.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: spans_util.c,v 1.1 1998/09/15 08:23:04 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_util.c,v 1.1 1998/09/15 08:23:04 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_util.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
#ifdef NOTDEF
/* XXX -- Remove all SAP checks? */
diff --git a/sys/netatm/uni/Makefile b/sys/netatm/uni/Makefile
new file mode 100644
index 000000000000..5b769b4f0a0b
--- /dev/null
+++ b/sys/netatm/uni/Makefile
@@ -0,0 +1,93 @@
+#
+#
+# ===================================
+# HARP | Host ATM Research Platform
+# ===================================
+#
+#
+# This Host ATM Research Platform ("HARP") file (the "Software") is
+# made available by Network Computing Services, Inc. ("NetworkCS")
+# "AS IS". NetworkCS does not provide maintenance, improvements or
+# support of any kind.
+#
+# NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
+# INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
+# SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
+# In no event shall NetworkCS be responsible for any damages, including
+# but not limited to consequential damages, arising from or relating to
+# any use of the Software or related support.
+#
+# Copyright 1994-1998 Network Computing Services, Inc.
+#
+# Copies of this Software may be made, however, the above copyright
+# notice must be reproduced on all copies.
+#
+# @(#) $Id: Makefile,v 1.6 1998/08/26 23:29:17 mks Exp $
+#
+#
+
+#
+# ATM Forum UNI Support
+# ---------------------
+#
+# Source directory Makefile
+#
+#
+
+DEFS=
+
+UNI_HDRS= uni.h
+UNI_SRCS= uni_load.c
+UNI_OBJS= uni_load.o
+
+SIG_HDRS= unisig.h unisig_decode.h unisig_mbuf.h \
+ unisig_msg.h unisig_print.h unisig_var.h
+SIG_SRCS= unisig_decode.c unisig_encode.c unisig_if.c \
+ unisig_mbuf.c unisig_msg.c \
+ unisig_print.c unisig_proto.c \
+ unisig_sigmgr_state.c unisig_subr.c \
+ unisig_util.c unisig_vc_state.c
+SIG_OBJS= unisig_decode.o unisig_encode.o unisig_if.o \
+ unisig_mbuf.o unisig_msg.o \
+ unisig_print.o unisig_proto.o \
+ unisig_sigmgr_state.o unisig_subr.o \
+ unisig_util.o unisig_vc_state.o
+
+SAAL_HDRS= sscop.h sscop_misc.h sscop_pdu.h sscop_var.h \
+ sscf_uni.h sscf_uni_var.h
+SAAL_SRCS= sscop.c sscop_lower.c sscop_pdu.c sscop_sigaa.c \
+ sscop_sigcpcs.c sscop_subr.c sscop_timer.c sscop_upper.c \
+ qsaal1_sigaa.c qsaal1_sigcpcs.c qsaal1_subr.c \
+ q2110_sigaa.c q2110_sigcpcs.c q2110_subr.c \
+ sscf_uni.c sscf_uni_lower.c sscf_uni_upper.c
+SAAL_OBJS= sscop.o sscop_lower.o sscop_pdu.o sscop_sigaa.o \
+ sscop_sigcpcs.o sscop_subr.o sscop_timer.o sscop_upper.o \
+ qsaal1_sigaa.o qsaal1_sigcpcs.o qsaal1_subr.o \
+ q2110_sigaa.o q2110_sigcpcs.o q2110_subr.o \
+ sscf_uni.o sscf_uni_lower.o sscf_uni_upper.o
+
+IP_HDRS= uniip_var.h
+IP_SRCS= uniip.c uniarp.c uniarp_cache.c uniarp_input.c \
+ uniarp_output.c uniarp_timer.c uniarp_vcm.c
+IP_OBJS= uniip.o uniarp.o uniarp_cache.o uniarp_input.o \
+ uniarp_output.o uniarp_timer.o uniarp_vcm.o
+
+HDRS= $(UNI_HDRS) $(SIG_HDRS) $(SAAL_HDRS) $(IP_HDRS)
+SRCS= $(UNI_SRCS) $(SIG_SRCS) $(SAAL_SRCS) $(IP_SRCS)
+OBJS= $(UNI_OBJS) $(SIG_OBJS) $(SAAL_OBJS) $(IP_OBJS)
+MOD= uni_mod.o
+
+OBJDIR= ../../`../../config/mkobjname -d`/uni
+
+all $(OBJS) $(MOD) config install clean depend lint load unload:
+ @if [ -d $(OBJDIR) ]; then \
+ echo "cd $(OBJDIR); $(MAKE) $@"; \
+ cd $(OBJDIR); \
+ $(MAKE) $(MFLAGS) DEFS='$(DEFS)' HDRS='$(HDRS)' SRCS='$(SRCS)' OBJS='$(OBJS)' $@; \
+ exit $$?; \
+ else \
+ echo "Object directory \"$(OBJDIR)\" does not exist."; \
+ exit 1; \
+ fi
+
diff --git a/sys/netatm/uni/q2110_sigaa.c b/sys/netatm/uni/q2110_sigaa.c
index 381356f6c7e8..357df710c294 100644
--- a/sys/netatm/uni/q2110_sigaa.c
+++ b/sys/netatm/uni/q2110_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_sigaa.c,v 1.6 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_sigaa.c,v 1.6 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/q2110_sigcpcs.c b/sys/netatm/uni/q2110_sigcpcs.c
index 7752fd04278e..0fa5555a7ce9 100644
--- a/sys/netatm/uni/q2110_sigcpcs.c
+++ b/sys/netatm/uni/q2110_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_sigcpcs.c,v 1.7 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_sigcpcs.c,v 1.7 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/q2110_subr.c b/sys/netatm/uni/q2110_subr.c
index 32f3833aa134..4c6036b8de2b 100644
--- a/sys/netatm/uni/q2110_subr.c
+++ b/sys/netatm/uni/q2110_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_subr.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_subr.c,v 1.1 1998/04/07 23:15:20 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_subr.c,v 1.1 1998/04/07 23:15:20 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_subr.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Conditionally Clear Transmission Queues
diff --git a/sys/netatm/uni/qsaal1_sigaa.c b/sys/netatm/uni/qsaal1_sigaa.c
index 1788794c5b00..f3b00973f1e0 100644
--- a/sys/netatm/uni/qsaal1_sigaa.c
+++ b/sys/netatm/uni/qsaal1_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: qsaal1_sigaa.c,v 1.7 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_sigaa.c,v 1.7 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/qsaal1_sigcpcs.c b/sys/netatm/uni/qsaal1_sigcpcs.c
index 203e483e6a03..1d6216555bb0 100644
--- a/sys/netatm/uni/qsaal1_sigcpcs.c
+++ b/sys/netatm/uni/qsaal1_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: qsaal1_sigcpcs.c,v 1.7 1998/04/07 23:21:03 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_sigcpcs.c,v 1.7 1998/04/07 23:21:03 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/qsaal1_subr.c b/sys/netatm/uni/qsaal1_subr.c
index 9ad2468dc52a..ed4b43cb3758 100644
--- a/sys/netatm/uni/qsaal1_subr.c
+++ b/sys/netatm/uni/qsaal1_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_subr.c,v 1.1 1998/09/15 08:23:06 phk Exp $
+ * @(#) $Id: qsaal1_subr.c,v 1.6 1998/04/07 23:21:17 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_subr.c,v 1.6 1998/04/07 23:21:17 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_subr.c,v 1.1 1998/09/15 08:23:06 phk Exp $");
-#endif
-
/*
* Re-establish a new SSCOP Connection
diff --git a/sys/netatm/uni/sscf_uni.c b/sys/netatm/uni/sscf_uni.c
index b73452442346..05825808c52c 100644
--- a/sys/netatm/uni/sscf_uni.c
+++ b/sys/netatm/uni/sscf_uni.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni.c,v 1.3 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: sscf_uni.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni.c,v 1.3 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Global variables
@@ -310,7 +310,7 @@ sscf_uni_pdu_print(uvp, m, msg)
struct vccb *vcp;
vcp = uvp->uv_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf), "sscf_uni %s: vcc=(%d,%d)\n",
+ sprintf(buf, "sscf_uni %s: vcc=(%d,%d)\n",
msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/sscf_uni_lower.c b/sys/netatm/uni/sscf_uni_lower.c
index 56db85fd7de9..9639d96fa32f 100644
--- a/sys/netatm/uni/sscf_uni_lower.c
+++ b/sys/netatm/uni/sscf_uni_lower.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscf_uni_lower.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni_lower.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/sscf_uni_upper.c b/sys/netatm/uni/sscf_uni_upper.c
index 24a41f555be3..a979260ac0b3 100644
--- a/sys/netatm/uni/sscf_uni_upper.c
+++ b/sys/netatm/uni/sscf_uni_upper.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscf_uni_upper.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni_upper.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* SSCF_UNI Upper Stack Command Handler
diff --git a/sys/netatm/uni/sscop.c b/sys/netatm/uni/sscop.c
index bfd37bdac07b..d4a2dfb07085 100644
--- a/sys/netatm/uni/sscop.c
+++ b/sys/netatm/uni/sscop.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Global variables
@@ -205,6 +205,7 @@ sscop_stop()
*/
atm_release_pool(&sscop_pool);
+done:
return (err);
}
diff --git a/sys/netatm/uni/sscop_lower.c b/sys/netatm/uni/sscop_lower.c
index 3810f91123fd..536ed0386dd3 100644
--- a/sys/netatm/uni/sscop_lower.c
+++ b/sys/netatm/uni/sscop_lower.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_lower.c,v 1.1 1998/09/15 08:23:07 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_lower.c,v 1.1 1998/09/15 08:23:07 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/sscop_pdu.c b/sys/netatm/uni/sscop_pdu.c
index 03562841d8ca..b9aec0340009 100644
--- a/sys/netatm/uni/sscop_pdu.c
+++ b/sys/netatm/uni/sscop_pdu.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_pdu.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: sscop_pdu.c,v 1.6 1998/04/07 23:21:36 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_pdu.c,v 1.6 1998/04/07 23:21:36 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_pdu.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Local functions
*/
@@ -1231,8 +1231,7 @@ sscop_pdu_print(sop, m, msg)
struct vccb *vcp;
vcp = sop->so_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf),
- "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
+ sprintf(buf, "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/sscop_sigaa.c b/sys/netatm/uni/sscop_sigaa.c
index 675398216139..8f347ce5ebe1 100644
--- a/sys/netatm/uni/sscop_sigaa.c
+++ b/sys/netatm/uni/sscop_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_sigaa.c,v 1.1 1998/09/15 08:23:07 phk Exp $
+ * @(#) $Id: sscop_sigaa.c,v 1.1 1998/04/07 23:15:11 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_sigaa.c,v 1.1 1998/04/07 23:15:11 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_sigaa.c,v 1.1 1998/09/15 08:23:07 phk Exp $");
-#endif
-
/*
* SSCOP_ESTABLISH_REQ / SOS_IDLE Command Processor
diff --git a/sys/netatm/uni/sscop_sigcpcs.c b/sys/netatm/uni/sscop_sigcpcs.c
index 6b1c477bbb01..a9bf504d99c4 100644
--- a/sys/netatm/uni/sscop_sigcpcs.c
+++ b/sys/netatm/uni/sscop_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_sigcpcs.c,v 1.1 1998/09/15 08:23:08 phk Exp $
+ * @(#) $Id: sscop_sigcpcs.c,v 1.2 1998/07/24 20:18:09 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_sigcpcs.c,v 1.2 1998/07/24 20:18:09 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_sigcpcs.c,v 1.1 1998/09/15 08:23:08 phk Exp $");
-#endif
-
/*
* No-op Processor
diff --git a/sys/netatm/uni/sscop_subr.c b/sys/netatm/uni/sscop_subr.c
index 16ad1395a243..88656adb098e 100644
--- a/sys/netatm/uni/sscop_subr.c
+++ b/sys/netatm/uni/sscop_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_subr.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_subr.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_subr.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_subr.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/sscop_timer.c b/sys/netatm/uni/sscop_timer.c
index 087ae79e96cd..c66525b9f08e 100644
--- a/sys/netatm/uni/sscop_timer.c
+++ b/sys/netatm/uni/sscop_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_timer.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_timer.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_timer.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_timer.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/sscop_upper.c b/sys/netatm/uni/sscop_upper.c
index f2ad1bd95c5e..162b48cbd1ac 100644
--- a/sys/netatm/uni/sscop_upper.c
+++ b/sys/netatm/uni/sscop_upper.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_upper.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_upper.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/uni_load.c b/sys/netatm/uni/uni_load.c
index 7be1eba01a0c..23e7ff586bdb 100644
--- a/sys/netatm/uni/uni_load.c
+++ b/sys/netatm/uni/uni_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uni_load.c,v 1.1 1998/09/15 08:23:09 phk Exp $
+ * @(#) $Id: uni_load.c,v 1.6 1997/05/06 22:20:43 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uni_load.c,v 1.6 1997/05/06 22:20:43 mks Exp $";
+#endif
+
#ifndef ATM_UNI_MODULE
#include "opt_atm.h"
#endif
@@ -43,10 +47,6 @@
#include <netatm/uni/uni.h>
-#ifndef lint
-__RCSID("@(#) $Id: uni_load.c,v 1.1 1998/09/15 08:23:09 phk Exp $");
-#endif
-
/*
* External functions
*/
diff --git a/sys/netatm/uni/uniarp.c b/sys/netatm/uni/uniarp.c
index 2d6006f802b3..e0448a8a8c11 100644
--- a/sys/netatm/uni/uniarp.c
+++ b/sys/netatm/uni/uniarp.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp.c,v 1.4 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: uniarp.c,v 1.1 1998/09/15 08:23:09 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp.c,v 1.1 1998/09/15 08:23:09 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp.c,v 1.4 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -225,6 +225,7 @@ void
uniarp_ipdact(uip)
struct uniip *uip;
{
+ struct ip_nif *inp = uip->uip_ipnif;
struct uniarp *uap, *unext;
int i;
@@ -1022,8 +1023,7 @@ uniarp_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr =
uap->ua_dstip.s_addr;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
nip->nif_if.if_name,
nip->nif_if.if_unit);
aar.aap_flags = uap->ua_flags;
@@ -1077,8 +1077,7 @@ uniarp_ioctl(code, data, arg1)
*/
SATOSIN(&aar.aap_arp_addr)->sin_family = AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr = 0;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
nip->nif_if.if_name, nip->nif_if.if_unit);
aar.aap_flags = 0;
aar.aap_origin = uap->ua_origin;
@@ -1137,14 +1136,14 @@ updbuf:
* Get ARP server information
*/
aip = (struct atminfreq *)data;
- nip = (struct atm_nif *)arg1;
buf_addr = aip->air_buf_addr;
buf_len = aip->air_buf_len;
for (uip = uniip_head; uip; uip = uip->uip_next) {
- if (uip->uip_ipnif->inf_nif != nip)
+ if ((arg1 != NULL) &&
+ (uip->uip_ipnif->inf_nif != (struct atm_nif *)arg1))
continue;
/*
@@ -1158,8 +1157,8 @@ updbuf:
/*
* Fill in info to be returned
*/
- (void) snprintf(asr.asp_intf,
- sizeof(asr.asp_intf), "%s%d",
+ nip = uip->uip_ipnif->inf_nif;
+ (void) sprintf(asr.asp_intf, "%s%d",
nip->nif_if.if_name, nip->nif_if.if_unit);
asr.asp_state = uip->uip_arpstate;
if (uip->uip_arpstate == UIAS_SERVER_ACTIVE) {
diff --git a/sys/netatm/uni/uniarp_cache.c b/sys/netatm/uni/uniarp_cache.c
index 88a26a59c76b..6c9537e722c6 100644
--- a/sys/netatm/uni/uniarp_cache.c
+++ b/sys/netatm/uni/uniarp_cache.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_cache.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: uniarp_cache.c,v 1.8 1998/08/26 23:29:20 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_cache.c,v 1.8 1998/08/26 23:29:20 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_cache.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Add data to the arp table cache
@@ -79,7 +79,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
#ifdef DIAGNOSTIC
strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
ATM_DEBUG4("cache_svc: ip=%s, atm=(%s,%s), origin=%d\n",
inet_ntoa(*ip), unisig_addr_print(atm), abuf, origin);
#endif
@@ -157,7 +156,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
if (ipuap->ua_ivp != NULL) {
strncpy(abuf, unisig_addr_print(atmsub),
sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
log(LOG_WARNING,
"uniarp: duplicate IP address %s from %s,%s\n",
inet_ntoa(*ip), unisig_addr_print(atm),
@@ -187,7 +185,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
}
strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
log(LOG_WARNING,
"uniarp: ATM address for %s changed to %s,%s\n",
inet_ntoa(*ip), unisig_addr_print(atm), abuf);
@@ -331,7 +328,6 @@ uniarp_cache_pvc(ivp, ip, atm, atmsub)
vci = ivp->iv_conn->co_connvc->cvc_vcc->vc_vci;
}
strncpy(buf, unisig_addr_print(atmsub), sizeof(buf));
- buf[sizeof(buf) - 1] = 0;
ATM_DEBUG5("cache_pvc: vcc=(%d,%d), ip=%s, atm=(%s,%s)\n",
vpi, vci, inet_ntoa(*ip), unisig_addr_print(atm), buf);
#endif
diff --git a/sys/netatm/uni/uniarp_input.c b/sys/netatm/uni/uniarp_input.c
index b621ac35c541..cceeaa92c87f 100644
--- a/sys/netatm/uni/uniarp_input.c
+++ b/sys/netatm/uni/uniarp_input.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_input.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: uniarp_input.c,v 1.10 1998/07/13 00:04:32 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_input.c,v 1.10 1998/07/13 00:04:32 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_input.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Local functions
@@ -735,6 +735,7 @@ proc_inarp_rsp(ivp, m)
struct atm_nif *nip;
struct siginst *sgp;
struct uniip *uip;
+ struct uniarp *uap;
struct in_addr myip;
int s = splnet();
@@ -846,8 +847,7 @@ uniarp_pdu_print(ivp, m, msg)
struct vccb *vcp;
vcp = ivp->iv_conn->co_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf),
- "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
+ sprintf(buf, "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/uniarp_output.c b/sys/netatm/uni/uniarp_output.c
index 4f7a16388d09..81fab93219c7 100644
--- a/sys/netatm/uni/uniarp_output.c
+++ b/sys/netatm/uni/uniarp_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_output.c,v 1.1 1998/09/15 08:23:09 phk Exp $
+ * @(#) $Id: uniarp_output.c,v 1.7 1998/06/29 22:15:41 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_output.c,v 1.7 1998/06/29 22:15:41 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_output.c,v 1.1 1998/09/15 08:23:09 phk Exp $");
-#endif
-
/*
* Issue an ATMARP Request PDU
diff --git a/sys/netatm/uni/uniarp_timer.c b/sys/netatm/uni/uniarp_timer.c
index b65ca568cdd8..1f002023e544 100644
--- a/sys/netatm/uni/uniarp_timer.c
+++ b/sys/netatm/uni/uniarp_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_timer.c,v 1.1 1998/09/15 08:23:10 phk Exp $
+ * @(#) $Id: uniarp_timer.c,v 1.8 1998/06/29 22:44:31 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_timer.c,v 1.8 1998/06/29 22:44:31 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_timer.c,v 1.1 1998/09/15 08:23:10 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/uniarp_vcm.c b/sys/netatm/uni/uniarp_vcm.c
index e2e9c2d28973..338d2b50264b 100644
--- a/sys/netatm/uni/uniarp_vcm.c
+++ b/sys/netatm/uni/uniarp_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_vcm.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: uniarp_vcm.c,v 1.1 1998/09/15 08:23:10 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_vcm.c,v 1.1 1998/09/15 08:23:10 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_vcm.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/uniip.c b/sys/netatm/uni/uniip.c
index dd7bc3e3f807..003958514671 100644
--- a/sys/netatm/uni/uniip.c
+++ b/sys/netatm/uni/uniip.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniip.c,v 1.1 1998/09/15 08:23:10 phk Exp $
+ * @(#) $Id: uniip.c,v 1.6 1998/05/18 19:18:42 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniip.c,v 1.6 1998/05/18 19:18:42 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniip.c,v 1.1 1998/09/15 08:23:10 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/unisig_decode.c b/sys/netatm/uni/unisig_decode.c
index 08fe4b728a7c..d7d3cd4be92c 100644
--- a/sys/netatm/uni/unisig_decode.c
+++ b/sys/netatm/uni/unisig_decode.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_decode.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_decode.c,v 1.1 1998/09/15 08:23:10 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_decode.c,v 1.1 1998/09/15 08:23:10 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_decode.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
#define ALLOC_IE(ie) \
(ie) = (struct ie_generic *) atm_allocate(&unisig_iepool); \
if (!ie) \
diff --git a/sys/netatm/uni/unisig_encode.c b/sys/netatm/uni/unisig_encode.c
index 34a039aec159..a142a33e43ab 100644
--- a/sys/netatm/uni/unisig_encode.c
+++ b/sys/netatm/uni/unisig_encode.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_encode.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_encode.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_encode.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_encode.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/unisig_if.c b/sys/netatm/uni/unisig_if.c
index 0401154fa803..e52f650a3536 100644
--- a/sys/netatm/uni/unisig_if.c
+++ b/sys/netatm/uni/unisig_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_if.c,v 1.4 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: unisig_if.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_if.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -46,10 +50,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_if.c,v 1.4 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -863,7 +863,7 @@ unisig_ioctl(code, data, arg1)
/*
* Schedule VCC termination
*/
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_UNSPECIFIED_NORMAL);
err = unisig_abort((struct vccb *)uvp);
break;
@@ -894,8 +894,7 @@ unisig_ioctl(code, data, arg1)
/*
* Fill out the response struct for the VCC
*/
- (void) snprintf(rsp.avp_intf,
- sizeof(rsp.avp_intf), "%s%d",
+ (void) sprintf(rsp.avp_intf, "%s%d",
usp->us_pif->pif_name,
usp->us_pif->pif_unit);
rsp.avp_vpi = uvp->uv_vpi;
diff --git a/sys/netatm/uni/unisig_mbuf.c b/sys/netatm/uni/unisig_mbuf.c
index b96a636a4be8..c64ee9a85fac 100644
--- a/sys/netatm/uni/unisig_mbuf.c
+++ b/sys/netatm/uni/unisig_mbuf.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_mbuf.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_mbuf.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_mbuf.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_mbuf.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Initialize a unisig formatting structure
diff --git a/sys/netatm/uni/unisig_msg.c b/sys/netatm/uni/unisig_msg.c
index f52f46e8f446..4e61cf48571d 100644
--- a/sys/netatm/uni/unisig_msg.c
+++ b/sys/netatm/uni/unisig_msg.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_msg.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_msg.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_msg.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_print.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_msg.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -68,7 +68,8 @@ static int unisig_print_msg = 0;
*
* Arguments:
* iep pointer to a cause IE
- * aap pointer to attribute block
+ * msg pointer to message
+ * cause cause code for the error
*
* Returns:
* 0 message sent OK
diff --git a/sys/netatm/uni/unisig_print.c b/sys/netatm/uni/unisig_print.c
index 93133cad3d6e..f335ce45a7b3 100644
--- a/sys/netatm/uni/unisig_print.c
+++ b/sys/netatm/uni/unisig_print.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_print.c,v 1.1 1998/09/15 08:23:12 phk Exp $
+ * @(#) $Id: unisig_print.c,v 1.9 1998/08/26 23:29:23 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_print.c,v 1.9 1998/08/26 23:29:23 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_msg.h>
#include <netatm/uni/unisig_print.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_print.c,v 1.1 1998/09/15 08:23:12 phk Exp $");
-#endif
-
/*
* Local declarations
diff --git a/sys/netatm/uni/unisig_proto.c b/sys/netatm/uni/unisig_proto.c
index 8a3daac6753a..bbad9e64ff85 100644
--- a/sys/netatm/uni/unisig_proto.c
+++ b/sys/netatm/uni/unisig_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_proto.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_proto.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_proto.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_msg.h>
#include <netatm/uni/unisig_mbuf.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_proto.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Process a UNISIG timeout
diff --git a/sys/netatm/uni/unisig_sigmgr_state.c b/sys/netatm/uni/unisig_sigmgr_state.c
index e2213bf2ec6a..0439d1c75888 100644
--- a/sys/netatm/uni/unisig_sigmgr_state.c
+++ b/sys/netatm/uni/unisig_sigmgr_state.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_sigmgr_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_sigmgr_state.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_sigmgr_state.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -46,10 +50,6 @@
#include <netatm/uni/sscf_uni.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_sigmgr_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -817,6 +817,11 @@ unisig_sigmgr_act14(usp, m)
}
/*
+ * Set the signalling manager state
+ */
+ usp->us_state = UNISIG_DETACH;
+
+ /*
* Close the signalling channel
*/
if (usp->us_conn) {
@@ -844,14 +849,12 @@ unisig_sigmgr_act14(usp, m)
UNLINK((struct siginst *)usp, struct siginst,
smp->sm_prinst, si_next);
KM_FREE(usp, sizeof(struct unisig), M_DEVBUF);
- } else {
- /*
- * Otherwise, set new signalling manager state and
- * wait for protocol instance to be freed during
- * unisig_free processing for the last queued VCC
- */
- usp->us_state = UNISIG_DETACH;
}
+ /*
+ * Otherwise, wait for protocol instance to be freed
+ * during unisig_free processing for the last queued VCC
+ */
+
return (0);
}
diff --git a/sys/netatm/uni/unisig_subr.c b/sys/netatm/uni/unisig_subr.c
index 888cedcf99ab..52326bc2bc46 100644
--- a/sys/netatm/uni/unisig_subr.c
+++ b/sys/netatm/uni/unisig_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $
+ * @(#) $Id: unisig_subr.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_subr.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $");
-#endif
-
/*
* External variables
@@ -73,7 +73,7 @@ extern struct ie_epst ie_epst_absent;
/*
- * Set a User Location cause code in an ATM attribute block
+ * Set a cause code in an ATM attribute block
*
* Arguments:
* aap pointer to attribute block
@@ -84,13 +84,10 @@ extern struct ie_epst ie_epst_absent;
*
*/
void
-unisig_cause_attr_from_user(aap, cause)
+unisig_set_cause_attr(aap, cause)
Atm_attributes *aap;
int cause;
{
- if (cause == T_ATM_ABSENT)
- return;
-
/*
* Set the fields in the attribute block
*/
@@ -104,35 +101,6 @@ unisig_cause_attr_from_user(aap, cause)
/*
- * Set a cause code in an ATM attribute block from a Cause IE
- *
- * Arguments:
- * aap pointer to attribute block
- * iep pointer to Cause IE
- *
- * Returns:
- * none
- *
- */
-void
-unisig_cause_attr_from_ie(aap, iep)
- Atm_attributes *aap;
- struct ie_generic *iep;
-{
- /*
- * Set the fields in the attribute block
- */
- aap->cause.tag = T_ATM_PRESENT;
- aap->cause.v.coding_standard = iep->ie_coding;
- aap->cause.v.location = iep->ie_caus_loc;
- aap->cause.v.cause_value = iep->ie_caus_cause;
- KM_ZERO(aap->cause.v.diagnostics, sizeof(aap->cause.v.diagnostics));
- KM_COPY(iep->ie_caus_diagnostic, aap->cause.v.diagnostics,
- MIN(sizeof(aap->cause.v.diagnostics), iep->ie_caus_diag_len));
-}
-
-
-/*
* Open a UNI VCC
*
* Called when a user wants to open a VC. This function will construct
@@ -434,7 +402,7 @@ unisig_clear_vcc(usp, uvp, cause)
outstate == UNI_SSCF_RECOV ||
outstate == UNI_PVC_ACT_DOWN ||
outstate == UNI_PVC_ACTIVE) {
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, cause);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr, cause);
atm_cm_cleared(uvp->uv_connvc);
}
@@ -1080,8 +1048,6 @@ unisig_set_attrs(usp, msg, ap)
ap->blli.v.layer_2_protocol.ID.simple_ID;
break;
case T_ATM_USER_ID:
- msg->msg_ie_blli->ie_blli_l2_id =
- UNI_IE_BLLI_L2P_USER;
msg->msg_ie_blli->ie_blli_l2_user_proto =
ap->blli.v.layer_2_protocol.ID.user_defined_ID;
break;
diff --git a/sys/netatm/uni/unisig_util.c b/sys/netatm/uni/unisig_util.c
index a3a2ab2ba3cb..d7a64f6b17e5 100644
--- a/sys/netatm/uni/unisig_util.c
+++ b/sys/netatm/uni/unisig_util.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_util.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_util.c,v 1.1 1998/09/15 08:23:13 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_util.c,v 1.1 1998/09/15 08:23:13 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_util.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Free a UNISIG signalling message
@@ -303,8 +303,7 @@ unisig_addr_print(p)
* two-digit hex representation of the
* NSAP byte in the output buffer
*/
- snprintf(t_buff, sizeof(t_buff),
- "%x", *cp + 512);
+ sprintf(t_buff, "%x", *cp + 512);
strcpy(op, &t_buff[strlen(t_buff)-2]);
op++; op++;
cp++;
@@ -326,8 +325,7 @@ unisig_addr_print(p)
* Print the IA5 characters of the E.164 address
*/
for(i=0; i<p->address_length; i++) {
- snprintf(strbuff + strlen(strbuff),
- sizeof(strbuff) - strlen(strbuff), "%c",
+ sprintf(&strbuff[strlen(strbuff)], "%c",
((Atm_addr_e164 *)p->address)->aae_addr[i]);
}
break;
@@ -348,7 +346,7 @@ unisig_addr_print(p)
/*
* Print the address as two words xxxxx.yyyyyyyy
*/
- snprintf(strbuff, sizeof(strbuff), "%x.%x", u1.w, u2.w);
+ sprintf(strbuff, "%x.%x", u1.w, u2.w);
break;
case T_ATM_ABSENT:
diff --git a/sys/netatm/uni/unisig_var.h b/sys/netatm/uni/unisig_var.h
index b8d422930250..1e3d01a7748b 100644
--- a/sys/netatm/uni/unisig_var.h
+++ b/sys/netatm/uni/unisig_var.h
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_var.h,v 1.1 1998/09/15 08:23:13 phk Exp $
+ * @(#) $Id: unisig_var.h,v 1.12 1998/07/24 20:24:34 mks Exp $
*
*/
@@ -276,9 +276,7 @@ int unisig_sigmgr_state __P((struct unisig *, int,
KBuffer *));
/* unisig_subr.c */
-void unisig_cause_attr_from_user __P((Atm_attributes *, int));
-void unisig_cause_attr_from_ie __P((Atm_attributes *,
- struct ie_generic *));
+void unisig_set_cause_attr __P((Atm_attributes *, int));
int unisig_open_vcc __P((struct unisig *, Atm_connvc *));
int unisig_close_vcc __P((struct unisig *,
struct unisig_vccb *));
diff --git a/sys/netatm/uni/unisig_vc_state.c b/sys/netatm/uni/unisig_vc_state.c
index 84f995e9cf31..e52515d3d798 100644
--- a/sys/netatm/uni/unisig_vc_state.c
+++ b/sys/netatm/uni/unisig_vc_state.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_vc_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_vc_state.c,v 1.1 1998/09/15 08:23:13 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_vc_state.c,v 1.1 1998/09/15 08:23:13 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_vc_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -380,22 +380,13 @@ unisig_vc_act03(usp, uvp, msg)
struct unisig_vccb *uvp;
struct unisig_msg *msg;
{
- int rc, cause;
-
- /*
- * Set cause code
- */
- if ((msg != NULL) && (msg->msg_ie_caus != NULL)) {
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- cause = T_ATM_ABSENT;
- } else
- cause = T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER;
+ int rc;
/*
* Clear the VCCB
*/
- rc = unisig_clear_vcc(usp, uvp, cause);
+ rc = unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER);
return(rc);
}
@@ -822,11 +813,7 @@ unisig_vc_act07(usp, uvp, msg)
/*
* Notify the user
*/
- if ((msg != NULL) && (msg->msg_ie_caus != NULL))
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- else
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
@@ -900,6 +887,18 @@ unisig_vc_act08(usp, uvp, msg)
}
/*
+ * See if we can handle the specified encapsulation
+ */
+ if (msg->msg_ie_blli->ie_blli_l2_id != UNI_IE_BLLI_L2P_LLC &&
+ (msg->msg_ie_blli->ie_blli_l2_id != 0 ||
+ msg->msg_ie_blli->ie_blli_l3_id !=
+ UNI_IE_BLLI_L3P_ISO9577)) {
+ cause = UNI_IE_CAUS_UNAVAIL;
+ ATM_DEBUG0("unisig_vc_act08: bad encapsulation\n");
+ goto response08;
+ }
+
+ /*
* See if we recognize the specified AAL
*/
if (msg->msg_ie_aalp->ie_aalp_aal_type != UNI_IE_AALP_AT_AAL3 &&
@@ -1152,20 +1151,13 @@ unisig_vc_act11(usp, uvp, msg)
struct unisig_vccb *uvp;
struct unisig_msg *msg;
{
- int rc, cause;
-
- /*
- * Send generic cause code if one is not already set
- */
- if (uvp->uv_connvc->cvc_attr.cause.tag == T_ATM_PRESENT)
- cause = T_ATM_ABSENT;
- else
- cause = T_ATM_CAUSE_CALL_REJECTED;
+ int rc;
/*
* Send a RELEASE COMPLETE message
*/
- rc = unisig_send_release_complete(usp, uvp, msg, cause);
+ rc = unisig_send_release_complete(usp, uvp, msg,
+ UNI_IE_CAUS_REJECT);
/*
* Clear the call VCCB
@@ -1214,7 +1206,7 @@ unisig_vc_act12(usp, uvp, msg)
/*
* Send the RELEASE message
*/
- rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL,
+ rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)0,
T_ATM_ABSENT);
return(rc);
@@ -1263,9 +1255,8 @@ unisig_vc_act13(usp, uvp, msg)
/*
* Notify the user that the call is now closed
*/
- if (msg->msg_ie_caus != NULL)
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
return(0);
@@ -1404,12 +1395,8 @@ unisig_vc_act15(usp, uvp, msg)
/*
* Notify the user that the call is cleared
*/
- if (msg->msg_ie_caus != NULL)
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- else
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
- T_ATM_CAUSE_UNSPECIFIED_NORMAL);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
return(rc);
@@ -1448,7 +1435,8 @@ unisig_vc_act16(usp, uvp, msg)
/*
* Clear the VCCB
*/
- rc = unisig_clear_vcc(usp, uvp, T_ATM_ABSENT);
+ rc = unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
return(rc);
}
@@ -1684,7 +1672,7 @@ unisig_vc_act21(usp, uvp, msg)
return(0);
}
rc = unisig_clear_vcc(usp, uvp,
- T_ATM_CAUSE_MESSAGE_INCOMPATIBLE_WITH_CALL_STATE);
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
}
/*
@@ -1700,7 +1688,8 @@ unisig_vc_act21(usp, uvp, msg)
cause,
msg->msg_ie_caus->ie_caus_diagnostic[0]);
if (uvp) {
- (void)unisig_clear_vcc(usp, uvp, cause);
+ (void)unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_INVALID_INFO_ELEMENT_CONTENTS);
}
}
@@ -1969,10 +1958,8 @@ unisig_vc_act26(usp, uvp, msg)
/*
* Notify the user
*/
- if (uvp->uv_connvc->cvc_attr.cause.tag != T_ATM_PRESENT)
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_NORMAL_CALL_CLEARING);
-
atm_cm_cleared(uvp->uv_connvc);
return(0);
diff --git a/sys/netinet/fil.c b/sys/netinet/fil.c
index f91ee3dec08b..d634bbb74655 100644
--- a/sys/netinet/fil.c
+++ b/sys/netinet/fil.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-1996 Darren Reed";
-static const char rcsid[] = "@(#)$Id: fil.c,v 1.3 1998/06/20 18:37:49 peter Exp $";
+static const char rcsid[] = "@(#)$Id: fil.c,v 1.2 1998/03/21 11:33:54 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -153,7 +153,7 @@ static int frflushlist __P((int, int, int *, frentry_t *, frentry_t **));
/*
* bit values for identifying presence of individual IP options
*/
-static struct optlist ipopts[20] = {
+struct optlist ipopts[20] = {
{ IPOPT_NOP, 0x000001 },
{ IPOPT_RR, 0x000002 },
{ IPOPT_ZSU, 0x000004 },
@@ -179,7 +179,7 @@ static struct optlist ipopts[20] = {
/*
* bit values for identifying presence of individual IP security options
*/
-static struct optlist secopt[8] = {
+struct optlist secopt[8] = {
{ IPSO_CLASS_RES4, 0x01 },
{ IPSO_CLASS_TOPS, 0x02 },
{ IPSO_CLASS_SECR, 0x04 },
@@ -1098,7 +1098,7 @@ nodata:
* SUCH DAMAGE.
*
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id: fil.c,v 1.3 1998/06/20 18:37:49 peter Exp $
+ * $Id: fil.c,v 1.2 1998/03/21 11:33:54 peter Exp $
*/
/*
* Copy data from an mbuf chain starting "off" bytes from the beginning,
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index 7ccbe4b31ef2..13b778e159ee 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -31,16 +31,12 @@
* SUCH DAMAGE.
*
* @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id: icmp_var.h,v 1.11 1998/12/04 03:49:18 dillon Exp $
+ * $Id: icmp_var.h,v 1.8 1997/08/25 16:29:25 wollman Exp $
*/
#ifndef _NETINET_ICMP_VAR_H_
#define _NETINET_ICMP_VAR_H_
-#ifdef KERNEL
-#include "opt_icmp_bandlim.h" /* for ICMP_BANDLIM */
-#endif
-
/*
* Variables related to this implementation
* of the internet control message protocol.
@@ -67,20 +63,12 @@ struct icmpstat {
*/
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_ICMPLIM 3
-#define ICMPCTL_MAXID 4
+#define ICMPCTL_MAXID 3
#define ICMPCTL_NAMES { \
{ 0, 0 }, \
{ "maskrepl", CTLTYPE_INT }, \
{ "stats", CTLTYPE_STRUCT }, \
- { "icmplim", CTLTYPE_INT }, \
}
-#ifdef KERNEL
-#ifdef ICMP_BANDLIM
-extern int badport_bandlim __P((int));
-#endif
-#endif
-
#endif
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 4f57f64b2bad..ac8d86db643a 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ether.c,v 1.51 1999/01/18 01:54:36 fenner Exp $
+ * $Id: if_ether.c,v 1.47 1998/06/12 03:48:14 julian Exp $
*/
/*
@@ -41,7 +41,6 @@
*/
#include "opt_inet.h"
-#include "opt_bdg.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -327,7 +326,7 @@ arpresolve(ac, rt, m, dst, desten, rt0)
register u_char *desten;
struct rtentry *rt0;
{
- register struct llinfo_arp *la = 0;
+ register struct llinfo_arp *la;
struct sockaddr_dl *sdl;
if (m->m_flags & M_BCAST) { /* broadcast */
@@ -340,7 +339,7 @@ arpresolve(ac, rt, m, dst, desten, rt0)
}
if (rt)
la = (struct llinfo_arp *)rt->rt_llinfo;
- if (la == 0) {
+ else {
la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
if (la)
rt = la->la_rt;
@@ -462,16 +461,7 @@ in_arpinput(m)
(void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
(void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next)
-#ifdef BRIDGE
- /*
- * For a bridge, we want to check the address irrespective
- * of the receive interface. (This will change slightly
- * when we have clusters of interfaces).
- */
- {
-#else
if (ia->ia_ifp == &ac->ac_if) {
-#endif
maybe_ia = ia;
if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
(isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
@@ -504,7 +494,6 @@ in_arpinput(m)
}
la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
-#ifndef BRIDGE /* the following is not an error when doing bridging */
if (rt->rt_ifp != &ac->ac_if) {
log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
inet_ntoa(isaddr),
@@ -513,7 +502,6 @@ in_arpinput(m)
ac->ac_if.if_name, ac->ac_if.if_unit);
goto reply;
}
-#endif
if (sdl->sdl_alen &&
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
if (rt->rt_expire)
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index c1c90c041642..8a4bd8577c6f 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id: igmp.c,v 1.26 1998/12/12 21:45:49 dillon Exp $
+ * $Id: igmp.c,v 1.24 1997/10/11 18:31:31 phk Exp $
*/
/*
@@ -69,7 +69,7 @@
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
-static MALLOC_DEFINE(M_IGMP, "igmp", "igmp state");
+static MALLOC_DEFINE(M_MRTABLE, "mrt", "multicast routing tables");
static struct router_info *
find_rti __P((struct ifnet *ifp));
@@ -133,7 +133,7 @@ find_rti(ifp)
}
rti = rti->rti_next;
}
- MALLOC(rti, struct router_info *, sizeof *rti, M_IGMP, M_NOWAIT);
+ MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
rti->rti_ifp = ifp;
rti->rti_type = IGMP_V2_ROUTER;
rti->rti_time = 0;
@@ -198,8 +198,6 @@ igmp_input(m, iphlen)
ip = mtod(m, struct ip *);
timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- if (timer == 0)
- timer = 1;
rti = find_rti(ifp);
/*
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 9fe7095db720..45121066d1fa 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.c 8.4 (Berkeley) 1/9/95
- * $Id: in.c,v 1.38 1998/06/07 17:12:13 dfr Exp $
+ * $Id: in.c,v 1.37 1997/10/12 20:25:23 phk Exp $
*/
#include <sys/param.h>
@@ -179,8 +179,6 @@ in_control(so, cmd, data, ifp, p)
case SIOCAIFADDR:
case SIOCDIFADDR:
- if (ifp == 0)
- return (EADDRNOTAVAIL);
if (ifra->ifra_addr.sin_family == AF_INET) {
for (oia = ia; ia; ia = ia->ia_link.tqe_next) {
if (ia->ia_ifp == ifp &&
@@ -205,7 +203,7 @@ in_control(so, cmd, data, ifp, p)
return error;
if (ifp == 0)
- return (EADDRNOTAVAIL);
+ panic("in_control");
if (ia == (struct in_ifaddr *)0) {
ia = (struct in_ifaddr *)
malloc(sizeof *ia, M_IFADDR, M_WAITOK);
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 1188bdea11d6..67e58515775b 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $Id: in.h,v 1.37 1998/08/23 03:07:14 wollman Exp $
+ * $Id: in.h,v 1.36 1998/07/06 03:20:12 julian Exp $
*/
#ifndef _NETINET_IN_H_
@@ -323,11 +323,6 @@ struct ip_opts {
#define IP_FW_GET 54 /* get entire firewall rule chain */
#define IP_NAT 55 /* set/get NAT opts */
-#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */
-#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */
-#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */
-#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */
-
/*
* Defaults and limits for options
*/
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index d604ad06a88b..c8ac1c0ee298 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id: in_pcb.c,v 1.45 1998/09/17 18:42:16 fenner Exp $
+ * $Id: in_pcb.c,v 1.44 1998/05/15 20:11:32 wollman Exp $
*/
#include <sys/param.h>
@@ -688,7 +688,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
u_int lport_arg;
int wild_okay;
{
- register struct inpcb *inp;
+ register struct inpcb *inp, *match = NULL;
int matchwild = 3, wildcard;
u_short lport = lport_arg;
diff --git a/sys/netinet/ip_auth.c b/sys/netinet/ip_auth.c
index dab93b0ef0c2..9996c8d1a527 100644
--- a/sys/netinet/ip_auth.c
+++ b/sys/netinet/ip_auth.c
@@ -6,7 +6,7 @@
* to the original author and the contributors.
*/
#if !defined(lint)
-static const char rcsid[] = "@(#)$Id: ip_auth.c,v 1.5 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_auth.c,v 1.4 1998/06/20 18:37:50 peter Exp $";
#endif
#if defined(KERNEL) && !defined(_KERNEL)
@@ -117,10 +117,10 @@ int fr_authsize = FR_NUMAUTH;
int fr_authused = 0;
int fr_defaultauthage = 600;
fr_authstat_t fr_authstats;
-static frauth_t fr_auth[FR_NUMAUTH];
+frauth_t fr_auth[FR_NUMAUTH];
mb_t *fr_authpkts[FR_NUMAUTH];
-static int fr_authstart = 0, fr_authend = 0, fr_authnext = 0;
-static frauthent_t *fae_list = NULL;
+int fr_authstart = 0, fr_authend = 0, fr_authnext = 0;
+frauthent_t *fae_list = NULL;
frentry_t *ipauth = NULL;
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index b39948e9c66c..87ae6715b5db 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ip_divert.c,v 1.34 1998/07/06 09:06:58 julian Exp $
+ * $Id: ip_divert.c,v 1.33 1998/07/02 06:31:25 julian Exp $
*/
#include "opt_inet.h"
@@ -197,8 +197,8 @@ div_input(struct mbuf *m, int hlen)
/*
* Record the incoming interface name whenever we have one.
*/
- bzero(&divsrc.sin_zero, sizeof(divsrc.sin_zero));
if (m->m_pkthdr.rcvif) {
+ char name[32];
/*
* Hide the actual interface name in there in the
* sin_zero array. XXX This needs to be moved to a
@@ -217,9 +217,9 @@ div_input(struct mbuf *m, int hlen)
* this iface name will come along for the ride.
* (see div_output for the other half of this.)
*/
- snprintf(divsrc.sin_zero, sizeof(divsrc.sin_zero),
- "%s%d", m->m_pkthdr.rcvif->if_name,
- m->m_pkthdr.rcvif->if_unit);
+ sprintf(name, "%s%d",
+ m->m_pkthdr.rcvif->if_name, m->m_pkthdr.rcvif->if_unit);
+ strncpy(divsrc.sin_zero, name, 7);
}
/* Put packet on socket queue, if any */
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index e495b60450b0..31b424995472 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -10,7 +10,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_dummynet.c,v 1.6 1999/01/12 16:40:57 eivind Exp $
+ * $Id: ip_dummynet.c 1.2 1998/08/21 15:01:13 luigi Exp $
*/
/*
@@ -40,7 +40,6 @@
#include <sys/queue.h> /* XXX */
#include <sys/kernel.h>
#include <sys/socket.h>
-#include <sys/socketvar.h>
#include <sys/time.h>
#include <sys/sysctl.h>
#include <net/if.h>
@@ -51,7 +50,6 @@
#include <netinet/ip.h>
#include <netinet/ip_fw.h>
#include <netinet/ip_dummynet.h>
-#include <netinet/ip_var.h>
#ifdef BRIDGE
#include <netinet/if_ether.h> /* for struct arpcom */
@@ -70,13 +68,11 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, calls, CTLFLAG_RD, &dn_calls, 0, "")
SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, idle, CTLFLAG_RD, &dn_idle, 0, "");
#endif
-static int ip_dn_ctl(struct sockopt *sopt);
+static int ip_dn_ctl(int optname, struct mbuf **mm);
-static void rt_unref(struct rtentry *);
-static void dummynet(void *);
+static void dummynet(void);
static void dn_restart(void);
static void dn_move(struct dn_pipe *pipe, int immediate);
-static void dummynet_flush(void);
/*
* the following is needed when deleting a pipe, because rules can
@@ -100,29 +96,19 @@ dn_restart()
/* if there any pipe that needs work, restart */
if (pipe->r.head || pipe->p.head || pipe->numbytes < 0 ) {
dn_idle = 0;
- timeout(dummynet, NULL, 1);
+ timeout(dummynet, (caddr_t)NULL, 1);
return ;
}
}
}
-static void
-rt_unref(struct rtentry *rt)
-{
- if (rt == NULL)
- return ;
- if (rt->rt_refcnt <= 0)
- printf("-- warning, refcnt now %d, decreasing\n", rt->rt_refcnt);
- RTFREE(rt);
-}
-
/*
* move packets from R-queue to P-queue
*/
static void
dn_move(struct dn_pipe *pipe, int immediate)
{
- struct dn_pkt *pkt;
+ struct dn_pkt *tmp, *pkt;
/*
* consistency check, should catch new pipes which are
@@ -130,7 +116,7 @@ dn_move(struct dn_pipe *pipe, int immediate)
*/
if ( pipe->p.head == NULL &&
pipe->ticks_from_last_insert != pipe->delay) {
- printf("Warning, empty pipe and delay %d (should be %d)\n",
+ printf("Warning, empty pipe and delay %d (should be %a)d\n",
pipe->ticks_from_last_insert, pipe->delay);
pipe->ticks_from_last_insert = pipe->delay;
}
@@ -180,8 +166,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
/*** XXX just a sanity check */
if ( ( pkt == NULL && pipe->r_len != 0) ||
( pkt != NULL && pipe->r_len == 0) )
- printf("-- Warning, pipe head %p len %d\n",
- (void *)pkt, pipe->r_len);
+ printf("-- Warning, pipe head %x len %d\n",
+ pkt, pipe->r_len);
}
/*
@@ -216,7 +202,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
(void)ip_output((struct mbuf *)pkt, (struct mbuf *)pkt->ifp,
&(pkt->ro), pkt->dn_hlen, NULL);
- rt_unref (tmp_rt) ;
+ if (tmp_rt)
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
}
break ;
case DN_TO_IP_IN :
@@ -239,9 +226,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
* this is the periodic task that moves packets between the R-
* and the P- queue
*/
-/*ARGSUSED*/
void
-dummynet(void * __unused unused)
+dummynet()
{
struct dn_pipe *p ;
int s ;
@@ -321,7 +307,6 @@ dummynet_io(int pipe_nr, int dir,
m_freem(m);
return 0 ; /* XXX error */
}
- bzero(pkt, sizeof(*pkt) );
/* build and enqueue packet */
pkt->hdr.mh_type = MT_DUMMYNET ;
(struct ip_fw_chain *)pkt->hdr.mh_data = rule ;
@@ -368,14 +353,16 @@ purge_pipe(struct dn_pipe *pipe)
struct rtentry *tmp_rt ;
for (pkt = pipe->r.head ; pkt ; ) {
- rt_unref (tmp_rt = pkt->ro.ro_rt ) ;
+ if (tmp_rt = pkt->ro.ro_rt )
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
m_freem(pkt->dn_m);
n = pkt ;
pkt = (struct dn_pkt *)pkt->dn_next ;
free(n, M_IPFW) ;
}
for (pkt = pipe->p.head ; pkt ; ) {
- rt_unref (tmp_rt = pkt->ro.ro_rt ) ;
+ if (tmp_rt = pkt->ro.ro_rt )
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
m_freem(pkt->dn_m);
n = pkt ;
pkt = (struct dn_pkt *)pkt->dn_next ;
@@ -413,25 +400,18 @@ extern struct ip_fw_chain *ip_fw_default_rule ;
void
dn_rule_delete(void *r)
{
- struct dn_pipe *p ;
- int matches = 0 ;
- for ( p = all_pipes ; p ; p = p->next ) {
+ struct dn_pipe *q, *p = all_pipes ;
+
+ for ( p= all_pipes ; p ; p = p->next ) {
struct dn_pkt *x ;
for (x = p->r.head ; x ; x = (struct dn_pkt *)x->dn_next )
- if (x->hdr.mh_data == r) {
- matches++ ;
+ if (x->hdr.mh_data == r)
x->hdr.mh_data = (void *)ip_fw_default_rule ;
- }
for (x = p->p.head ; x ; x = (struct dn_pkt *)x->dn_next )
- if (x->hdr.mh_data == r) {
- matches++ ;
+ if (x->hdr.mh_data == r)
x->hdr.mh_data = (void *)ip_fw_default_rule ;
- }
}
- printf("dn_rule_delete, r %p, default %p%s, %d matches\n",
- (void *)r, (void *)ip_fw_default_rule,
- r == ip_fw_default_rule ? " AARGH!":"", matches);
}
/*
@@ -439,53 +419,51 @@ dn_rule_delete(void *r)
* (get, flush, config, del)
*/
static int
-ip_dn_ctl(struct sockopt *sopt)
+ip_dn_ctl(int optname, struct mbuf **mm)
{
- int error = 0 ;
- size_t size ;
- char *buf, *bp ;
- struct dn_pipe *p, tmp_pipe ;
-
- struct dn_pipe *x, *a, *b ;
-
- /* Disallow sets in really-really secure mode. */
- if (sopt->sopt_dir == SOPT_SET && securelevel >= 3)
- return (EPERM);
-
- switch (sopt->sopt_name) {
- default :
- panic("ip_dn_ctl -- unknown option");
-
- case IP_DUMMYNET_GET :
- for (p = all_pipes, size = 0 ; p ; p = p->next )
- size += sizeof( *p ) ;
- buf = malloc(size, M_TEMP, M_WAITOK);
- if (buf == 0) {
- error = ENOBUFS ;
- break ;
- }
- for (p = all_pipes, bp = buf ; p ; p = p->next ) {
- struct dn_pipe *q = (struct dn_pipe *)bp ;
-
- bcopy(p, bp, sizeof( *p ) );
+ struct mbuf *m ;
+ if (optname == IP_DUMMYNET_GET) {
+ struct dn_pipe *p = all_pipes ;
+ *mm = m = m_get(M_WAIT, MT_SOOPTS);
+ m->m_len = 0 ;
+ m->m_next = NULL ;
+ for (; p ; p = p->next ) {
+ struct dn_pipe *q = mtod(m,struct dn_pipe *) ;
+ memcpy( m->m_data, p, sizeof(*p) );
/*
* return bw and delay in bits/s and ms, respectively
*/
q->bandwidth *= (8*hz) ;
q->delay = (q->delay * 1000) / hz ;
- bp += sizeof( *p ) ;
+
+ m->m_len = sizeof(*p) ;
+ m->m_next = m_get(M_WAIT, MT_SOOPTS);
+ m = m->m_next ;
+ m->m_len = 0 ;
+ }
+ return 0 ;
}
- error = sooptcopyout(sopt, buf, size);
- FREE(buf, M_TEMP);
- break ;
- case IP_DUMMYNET_FLUSH :
+ if (securelevel > 2) { /* like in the firewall code... */
+ if (m) (void)m_free(m);
+ return (EPERM) ;
+ }
+ m = *mm ;
+ if (optname == IP_DUMMYNET_FLUSH) {
dummynet_flush() ;
- break ;
- case IP_DUMMYNET_CONFIGURE :
- p = &tmp_pipe ;
- error = sooptcopyin(sopt, p, sizeof *p, sizeof *p);
- if (error)
- break ;
+ if (m) (void)m_free(m);
+ return 0 ;
+ }
+ if (!m) /* need an argument for the following */
+ return (EINVAL);
+ if (optname == IP_DUMMYNET_CONFIGURE) {
+ struct dn_pipe *p = mtod(m,struct dn_pipe *) ;
+ struct dn_pipe *x, *a, *b ;
+ if (m->m_len != sizeof (*p) ) {
+ printf("dn_pipe Invalid length, %d instead of %d\n",
+ m->m_len, sizeof(*p) );
+ (void)m_free(m);
+ return (EINVAL);
+ }
/*
* The config program passes parameters as follows:
* bandwidth = bits/second (0 = no limits);
@@ -531,8 +509,7 @@ ip_dn_ctl(struct sockopt *sopt)
x = malloc(sizeof(struct dn_pipe), M_IPFW, M_DONTWAIT) ;
if (x == NULL) {
printf("ip_dummynet.c: sorry no memory\n");
- error = ENOSPC ;
- break ;
+ return (ENOSPC) ;
}
bzero(x, sizeof(*x) );
x->bandwidth = p->bandwidth ;
@@ -551,13 +528,12 @@ ip_dn_ctl(struct sockopt *sopt)
a->next = x ;
splx(s);
}
- break ;
-
- case IP_DUMMYNET_DEL :
- p = &tmp_pipe ;
- error = sooptcopyin(sopt, p, sizeof *p, sizeof *p);
- if (error)
- break ;
+ (void)m_free(m);
+ return 0 ;
+ }
+ if (optname == IP_DUMMYNET_DEL) {
+ struct dn_pipe *p = mtod(m,struct dn_pipe *) ;
+ struct dn_pipe *x, *a, *b ;
for (a = NULL , b = all_pipes ; b && b->pipe_nr < p->pipe_nr ;
a = b , b = b->next) ;
@@ -581,9 +557,8 @@ ip_dn_ctl(struct sockopt *sopt)
purge_pipe(b); /* remove pkts from here */
free(b, M_IPFW);
}
- break ;
}
- return error ;
+ return 0 ;
}
void
diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h
index f01406fdc6cf..33833fcaffb0 100644
--- a/sys/netinet/ip_dummynet.h
+++ b/sys/netinet/ip_dummynet.h
@@ -16,8 +16,6 @@
#ifndef _IP_DUMMYNET_H
#define _IP_DUMMYNET_H
-typedef int ip_dn_ctl_t __P((struct sockopt *)) ;
-extern ip_dn_ctl_t *ip_dn_ctl_ptr;
/*
* Definition of dummynet data structures.
* Dummynet handles a list of pipes, each one identified by a unique
@@ -87,20 +85,12 @@ struct dn_pipe { /* a pipe */
};
/*
- * The following is used to define a new mbuf type that is
- * prepended to the packet when it comes out of a pipe. The definition
- * ought to go in /sys/sys/mbuf.h but here it is less intrusive.
- */
-
-#define MT_DUMMYNET MT_CONTROL
-/*
* what to do of a packet when it comes out of a pipe
*/
#define DN_TO_IP_OUT 1
#define DN_TO_IP_IN 2
#define DN_TO_BDG_FWD 3
#ifdef KERNEL
-MALLOC_DECLARE(M_IPFW);
void ip_dn_init(void); /* called in ip_input.c */
void dn_rule_delete(void *r); /* used in ip_fw.c */
int dummynet_io(int pipe, int dir,
diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c
index 6cbdac90533c..1075316718d1 100644
--- a/sys/netinet/ip_fil.c
+++ b/sys/netinet/ip_fil.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.6 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.5 1998/06/20 18:37:50 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -1110,12 +1110,12 @@ ip_t *ip;
# if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \
(defined(OpenBSD) && (OpenBSD >= 199603))
- snprintf(fname, sizeof(fname), "/tmp/%s", ifp->if_xname);
+ sprintf(fname, "/tmp/%s", ifp->if_xname);
if ((fp = fopen(fname, "a"))) {
fclose(fp);
}
# else
- snprintf(fname, sizeof(fname), "/tmp/%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
if ((fp = fopen(fname, "a"))) {
fwrite((char *)ip, ntohs(ip->ip_len), 1, fp);
fclose(fp);
@@ -1139,8 +1139,7 @@ char *name;
char ifname[32], *s;
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
- (void) snprintf(ifname, sizeof(ifname),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(ifname, "%s%d", ifp->if_name, ifp->if_unit);
if (!strcmp(name, ifname))
return ifp;
}
@@ -1191,7 +1190,7 @@ void init_ifp()
(defined(OpenBSD) && (OpenBSD >= 199603))
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
ifp->if_output = write_output;
- snprintf(fname, sizeof(fname), "/tmp/%s", ifp->if_xname);
+ sprintf(fname, "/tmp/%s", ifp->if_xname);
if ((fp = fopen(fname, "w")))
fclose(fp);
}
@@ -1199,8 +1198,7 @@ void init_ifp()
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
ifp->if_output = write_output;
- snprintf(fname, sizeof(fname),
- "/tmp/%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
if ((fp = fopen(fname, "w")))
fclose(fp);
}
diff --git a/sys/netinet/ip_flow.c b/sys/netinet/ip_flow.c
index d4a2439ed547..b9a000ce532b 100644
--- a/sys/netinet/ip_flow.c
+++ b/sys/netinet/ip_flow.c
@@ -33,7 +33,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ip_flow.c,v 1.5 1998/06/21 14:53:29 bde Exp $
+ * $Id: ip_flow.c,v 1.4 1998/05/19 17:47:11 jdp Exp $
*/
#include <sys/param.h>
@@ -109,6 +109,7 @@ ipflow_fastforward(
struct ip *ip;
struct ipflow *ipf;
struct rtentry *rt;
+ u_int32_t sum;
int error;
/*
diff --git a/sys/netinet/ip_frag.c b/sys/netinet/ip_frag.c
index 7ad47f784b08..a379c67b6601 100644
--- a/sys/netinet/ip_frag.c
+++ b/sys/netinet/ip_frag.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_frag.c 1.11 3/24/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.2 1998/03/21 11:34:06 peter Exp $";
+static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.1.1.5 1997/11/16 05:55:34 peter Exp $";
#endif
#if !defined(_KERNEL) && defined(KERNEL)
@@ -76,11 +76,11 @@ static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.2 1998/03/21 11:34:06 peter
#include "netinet/ip_state.h"
#include "netinet/ip_auth.h"
-static ipfr_t *ipfr_heads[IPFT_SIZE];
-static ipfr_t *ipfr_nattab[IPFT_SIZE];
-static ipfrstat_t ipfr_stats;
-static int ipfr_inuse = 0;
- int fr_ipfrttl = 120; /* 60 seconds */
+ipfr_t *ipfr_heads[IPFT_SIZE];
+ipfr_t *ipfr_nattab[IPFT_SIZE];
+ipfrstat_t ipfr_stats;
+int ipfr_inuse = 0,
+ fr_ipfrttl = 120; /* 60 seconds */
#ifdef _KERNEL
extern int ipfr_timer_id;
#endif
diff --git a/sys/netinet/ip_ftp_pxy.c b/sys/netinet/ip_ftp_pxy.c
index dd70c8124015..1a66a9ba0c42 100644
--- a/sys/netinet/ip_ftp_pxy.c
+++ b/sys/netinet/ip_ftp_pxy.c
@@ -165,7 +165,7 @@ nat_t *nat;
a4 = a1 & 0xff;
a1 >>= 24;
olen = s - portbuf + 1;
- (void) snprintf(newbuf, sizeof(newbuf), "PORT %d,%d,%d,%d,%d,%d\r\n",
+ (void) sprintf(newbuf, "PORT %d,%d,%d,%d,%d,%d\r\n",
a1, a2, a3, a4, a5, a6);
nlen = strlen(newbuf);
inc = nlen - olen;
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 4bad5b66e3cc..bf4beb4702b1 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -12,7 +12,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_fw.c,v 1.102 1998/12/22 20:38:06 luigi Exp $
+ * $Id: ip_fw.c,v 1.96 1998/08/23 03:07:14 wollman Exp $
*/
/*
@@ -21,7 +21,6 @@
#if !defined(KLD_MODULE) && !defined(IPFIREWALL_MODULE)
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_inet.h"
#ifndef INET
@@ -44,25 +43,18 @@
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_fw.h>
-#ifdef DUMMYNET
-#include <net/route.h>
-#include <netinet/ip_dummynet.h>
-#endif
#include <netinet/tcp.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
#include <netinet/udp.h>
-#include <netinet/if_ether.h> /* XXX ethertype_ip */
-
static int fw_debug = 1;
#ifdef IPFIREWALL_VERBOSE
static int fw_verbose = 1;
#else
static int fw_verbose = 0;
#endif
-static int fw_one_pass = 0; /* XXX */
#ifdef IPFIREWALL_VERBOSE_LIMIT
static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
#else
@@ -71,14 +63,13 @@ static int fw_verbose_limit = 0;
#define IPFW_DEFAULT_RULE ((u_int)(u_short)~0)
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
+static LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
+static MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
#ifdef SYSCTL_NODE
SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO,one_pass,CTLFLAG_RW, &fw_one_pass, 0, "");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
#endif
@@ -109,11 +100,8 @@ static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
struct ifnet *rif, struct ifnet *oif));
-static void flush_rule_ptrs(void);
-
static int ip_fw_chk __P((struct ip **pip, int hlen,
struct ifnet *oif, u_int16_t *cookie, struct mbuf **m,
- struct ip_fw_chain **flow_id,
struct sockaddr_in **next_hop));
static int ip_fw_ctl __P((struct sockopt *sopt));
@@ -291,7 +279,6 @@ static void
ipfw_report(struct ip_fw *f, struct ip *ip,
struct ifnet *rif, struct ifnet *oif)
{
- if (ip) {
static u_int64_t counter;
struct tcphdr *const tcp = (struct tcphdr *) ((u_int32_t *) ip+ ip->ip_hl);
struct udphdr *const udp = (struct udphdr *) ((u_int32_t *) ip+ ip->ip_hl);
@@ -332,11 +319,6 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
case IP_FW_F_SKIPTO:
printf("SkipTo %d", f->fw_skipto_rule);
break;
-#ifdef DUMMYNET
- case IP_FW_F_PIPE:
- printf("Pipe %d", f->fw_skipto_rule);
- break;
-#endif
#ifdef IPFIREWALL_FORWARD
case IP_FW_F_FWD:
printf("Forward to ");
@@ -400,46 +382,16 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
if (fw_verbose_limit != 0 && count == fw_verbose_limit)
printf("ipfw: limit reached on rule #%d\n",
f ? f->fw_number : -1);
- }
-}
-
-/*
- * given an ip_fw_chain *, lookup_next_rule will return a pointer
- * of the same type to the next one. This can be either the jump
- * target (for skipto instructions) or the next one in the chain (in
- * all other cases including a missing jump target).
- * Backward jumps are not allowed, so start looking from the next
- * rule...
- */
-static struct ip_fw_chain * lookup_next_rule(struct ip_fw_chain *me);
-
-static struct ip_fw_chain *
-lookup_next_rule(struct ip_fw_chain *me)
-{
- struct ip_fw_chain *chain ;
- int rule = me->rule->fw_skipto_rule ; /* guess... */
-
- if ( (me->rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_SKIPTO )
- for (chain = me->chain.le_next; chain ; chain = chain->chain.le_next )
- if (chain->rule->fw_number >= rule)
- return chain ;
- return me->chain.le_next ; /* failure or not a skipto */
}
/*
* Parameters:
*
- * pip Pointer to packet header (struct ip **)
- * bridge_ipfw extension: pip = NULL means a complete ethernet packet
- * including ethernet header in the mbuf. Other fields
- * are ignored/invalid.
- *
+ * ip Pointer to packet header (struct ip *)
* hlen Packet header length
* oif Outgoing interface, or NULL if packet is incoming
* *cookie Skip up to the first rule past this rule number;
* *m The packet; we set to NULL when/if we nuke it.
- * *flow_id pointer to the last matching rule (in/out)
- * *next_hop socket we are forwarding to (in/out).
*
* Return value:
*
@@ -452,58 +404,17 @@ lookup_next_rule(struct ip_fw_chain *me)
static int
ip_fw_chk(struct ip **pip, int hlen,
struct ifnet *oif, u_int16_t *cookie, struct mbuf **m,
- struct ip_fw_chain **flow_id,
struct sockaddr_in **next_hop)
{
struct ip_fw_chain *chain;
struct ip_fw *rule = NULL;
- struct ip *ip = NULL ;
+ struct ip *ip = *pip;
struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = 0 ;
+ u_short offset = (ip->ip_off & IP_OFFMASK);
u_short src_port, dst_port;
u_int16_t skipto = *cookie;
- if (pip) { /* normal ip packet */
- ip = *pip;
- offset = (ip->ip_off & IP_OFFMASK);
- } else { /* bridged or non-ip packet */
- struct ether_header *eh = mtod(*m, struct ether_header *);
- switch (ntohs(eh->ether_type)) {
- case ETHERTYPE_IP :
- if ((*m)->m_len<sizeof(struct ether_header) + sizeof(struct ip))
- goto non_ip ;
- ip = (struct ip *)(eh + 1 );
- if (ip->ip_v != IPVERSION)
- goto non_ip ;
- hlen = ip->ip_hl << 2;
- if (hlen < sizeof(struct ip)) /* minimum header length */
- goto non_ip ;
- if ((*m)->m_len < 14 + hlen + 14) {
- printf("-- m_len %d, need more...\n", (*m)->m_len);
- goto non_ip ;
- }
- offset = (ntohs(ip->ip_off) & IP_OFFMASK);
- break ;
- default :
-non_ip: ip = NULL ;
- break ;
- }
- }
-
- if (*flow_id) {
- if (fw_one_pass)
- return 0 ; /* accept if passed first test */
- /*
- * pkt has already been tagged. Look for the next rule
- * to restart processing
- */
- chain = LIST_NEXT( *flow_id, chain);
-
- if ( (chain = (*flow_id)->rule->next_rule_ptr) == NULL )
- chain = (*flow_id)->rule->next_rule_ptr =
- lookup_next_rule(*flow_id) ;
- if (! chain) goto dropit;
- } else {
+ *cookie = 0;
/*
* Go down the chain, looking for enlightment
* If we've been asked to start at a given rule immediatly, do so.
@@ -517,12 +428,8 @@ non_ip: ip = NULL ;
}
if (! chain) goto dropit;
}
- }
- *cookie = 0;
for (; chain; chain = LIST_NEXT(chain, chain)) {
- register struct ip_fw * f ;
-again:
- f = chain->rule;
+ register struct ip_fw *const f = chain->rule;
if (oif) {
/* Check direction outbound */
@@ -533,43 +440,9 @@ again:
if (!(f->fw_flg & IP_FW_F_IN))
continue;
}
- if (ip == NULL ) {
- /*
- * do relevant checks for non-ip packets:
- * after this, only goto got_match or continue
- */
- struct ether_header *eh = mtod(*m, struct ether_header *);
-
- /*
- * make default rule always match or we have a panic
- */
- if (f->fw_number == IPFW_DEFAULT_RULE)
- goto got_match ;
- /*
- * temporary hack:
- * udp from 0.0.0.0 means this rule applies.
- * 1 src port is match ether type
- * 2 src ports (interval) is match ether type
- * 3 src ports is match ether address
- */
- if ( f->fw_src.s_addr != 0 || f->fw_prot != IPPROTO_UDP)
- continue;
- switch (IP_FW_GETNSRCP(f)) {
- case 1: /* match one type */
- if ( /* ( (f->fw_flg & IP_FW_F_INVSRC) != 0) ^ */
- ( f->fw_uar.fw_pts[0] == ntohs(eh->ether_type) ) ) {
- printf("match!\n");
- goto got_match ;
- }
- break ;
- default:
- break ;
- }
- continue ;
- }
/* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && offset == 0 )
+ if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
continue;
/* If src-addr doesn't match, not this rule. */
@@ -615,19 +488,14 @@ again:
if (ip->ip_p != f->fw_prot)
continue;
-#define PULLUP_TO(len) \
- do { \
- if ((*m)->m_len < (len) ) { \
- if ( (*m = m_pullup(*m, (len))) == 0) \
- goto bogusfrag; \
- ip = mtod(*m, struct ip *); \
- if (pip) { \
- *pip = ip ; \
- offset = (ip->ip_off & IP_OFFMASK); \
- } else \
- offset = (ntohs(ip->ip_off) & IP_OFFMASK); \
- } \
- } while (0)
+#define PULLUP_TO(len) do { \
+ if ((*m)->m_len < (len) \
+ && (*m = m_pullup(*m, (len))) == 0) { \
+ goto bogusfrag; \
+ } \
+ *pip = ip = mtod(*m, struct ip *); \
+ offset = (ip->ip_off & IP_OFFMASK); \
+ } while (0)
/* Protocol specific checks */
switch (ip->ip_p) {
@@ -710,12 +578,9 @@ bogusfrag:
}
got_match:
- *flow_id = chain ; /* XXX set flow id */
/* Update statistics */
f->fw_pcnt += 1;
- if (ip) {
- f->fw_bcnt += pip ? ip->ip_len : ntohs(ip->ip_len);
- }
+ f->fw_bcnt += ip->ip_len;
f->timestamp = time_second;
/* Log to console if desired */
@@ -728,11 +593,9 @@ got_match:
return(0);
case IP_FW_F_COUNT:
continue;
-#ifdef IPDIVERT
case IP_FW_F_DIVERT:
*cookie = f->fw_number;
return(f->fw_divert_port);
-#endif
case IP_FW_F_TEE:
/*
* XXX someday tee packet here, but beware that you
@@ -743,17 +606,17 @@ got_match:
* to write custom routine.
*/
continue;
- case IP_FW_F_SKIPTO: /* XXX check */
- if ( f->next_rule_ptr )
- chain = f->next_rule_ptr ;
- else
- chain = lookup_next_rule(chain) ;
- if (! chain) goto dropit;
- goto again ;
-#ifdef DUMMYNET
- case IP_FW_F_PIPE:
- return(f->fw_pipe_nr | 0x10000 );
+ case IP_FW_F_SKIPTO:
+#ifdef DIAGNOSTIC
+ while (LIST_NEXT(chain, chain)
+ && LIST_NEXT(chain, chain)->rule->fw_number
+ < f->fw_skipto_rule)
+#else
+ while (LIST_NEXT(chain, chain)->rule->fw_number
+ < f->fw_skipto_rule)
#endif
+ chain = LIST_NEXT(chain, chain);
+ continue;
#ifdef IPFIREWALL_FORWARD
case IP_FW_F_FWD:
/* Change the next-hop address for this packet.
@@ -793,7 +656,6 @@ got_match:
* - The packet is not a multicast or broadcast packet
*/
if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip
&& (ip->ip_p != IPPROTO_ICMP || is_icmp_query(ip))
&& !((*m)->m_flags & (M_BCAST|M_MCAST))
&& !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
@@ -836,7 +698,7 @@ dropit:
/*
* Finally, drop the packet.
*/
- /* *cookie = 0; */ /* XXX is this necessary ? */
+ *cookie = 0;
if (*m) {
m_freem(*m);
*m = NULL;
@@ -844,22 +706,6 @@ dropit:
return(0);
}
-/*
- * when a rule is added/deleted, zero the direct pointers within
- * all firewall rules. These will be reconstructed on the fly
- * as packets are matched.
- * Must be called at splnet().
- */
-static void
-flush_rule_ptrs()
-{
- struct ip_fw_chain *fcp ;
-
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next) {
- fcp->rule->next_rule_ptr = NULL ;
- }
-}
-
static int
add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
{
@@ -881,8 +727,6 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
ftmp->fw_pcnt = 0L;
ftmp->fw_bcnt = 0L;
- ftmp->next_rule_ptr = NULL ;
- ftmp->pipe_ptr = NULL ;
fwc->rule = ftmp;
s = splnet();
@@ -919,7 +763,6 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
fcpl = fcp;
}
}
- flush_rule_ptrs();
splx(s);
return (0);
@@ -943,10 +786,6 @@ del_entry(struct ip_fw_head *chainptr, u_short number)
next = LIST_NEXT(fcp, chain);
LIST_REMOVE(fcp, chain);
-#ifdef DUMMYNET
- dn_rule_delete(fcp) ;
-#endif
- flush_rule_ptrs();
free(fcp->rule, M_IPFW);
free(fcp, M_IPFW);
fcp = next;
@@ -1102,7 +941,6 @@ check_ipfw_struct(struct ip_fw *frwl)
}
break;
case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_PIPE: /* piping through 0 is invalid */
case IP_FW_F_TEE:
if (frwl->fw_divert_port == 0) {
dprintf(("%s can't divert to port 0\n", err_prefix));
@@ -1211,15 +1049,12 @@ ip_fw_ctl(struct sockopt *sopt)
break;
default:
- printf("ip_fw_ctl invalid option %d\n", sopt->sopt_name);
- error = EINVAL ;
+ panic("ip_fw_ctl");
}
return (error);
}
-struct ip_fw_chain *ip_fw_default_rule ;
-
void
ip_fw_init(void)
{
@@ -1242,7 +1077,6 @@ ip_fw_init(void)
add_entry(&ip_fw_chain, &default_rule))
panic("ip_fw_init");
- ip_fw_default_rule = ip_fw_chain.lh_first ;
printf("IP packet filtering initialized, "
#ifdef IPDIVERT
"divert enabled, ");
@@ -1320,7 +1154,7 @@ ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
}
#else
static int
-ipfw_modevent(module_t mod, int type, void *unused)
+ipfw_modevent(module_t mod, modeventtype_t type, void *unused)
{
int s;
@@ -1356,7 +1190,7 @@ ipfw_modevent(module_t mod, int type, void *unused)
return 0;
}
-static moduledata_t ipfwmod = {
+moduledata_t ipfwmod = {
"ipfw",
ipfw_modevent,
0
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index a4cee76ed8e0..31e8366e82f8 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -11,7 +11,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_fw.h,v 1.35 1998/09/02 19:14:01 phk Exp $
+ * $Id: ip_fw.h,v 1.34 1998/08/23 03:07:14 wollman Exp $
*/
#ifndef _IP_FW_H
@@ -35,7 +35,7 @@
union ip_fw_if {
struct in_addr fu_via_ip; /* Specified by IP address */
struct { /* Specified by interface name */
-#define FW_IFNLEN 10 /* need room ! was IFNAMSIZ */
+#define FW_IFNLEN IFNAMSIZ
char name[FW_IFNLEN];
short unit; /* -1 means match any unit */
} fu_via_if;
@@ -69,7 +69,6 @@ struct ip_fw {
union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
union {
u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_pipe_nr; /* pipe number (option DUMMYNET) */
u_short fu_skipto_rule; /* SKIPTO command rule number */
u_short fu_reject_code; /* REJECT response code */
struct sockaddr_in fu_fwd_ip;
@@ -79,8 +78,6 @@ struct ip_fw {
/* in ports array (dst ports follow */
/* src ports; max of 10 ports in all; */
/* count of 0 means match all ports) */
- void *pipe_ptr; /* Pipe ptr in case of dummynet pipe */
- void *next_rule_ptr ; /* next rule in case of match */
};
#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
@@ -97,7 +94,6 @@ struct ip_fw {
#define fw_divert_port fw_un.fu_divert_port
#define fw_skipto_rule fw_un.fu_skipto_rule
#define fw_reject_code fw_un.fu_reject_code
-#define fw_pipe_nr fw_un.fu_pipe_nr
#define fw_fwd_ip fw_un.fu_fwd_ip
struct ip_fw_chain {
@@ -117,7 +113,6 @@ struct ip_fw_chain {
#define IP_FW_F_TEE 0x00000005 /* This is a tee rule */
#define IP_FW_F_SKIPTO 0x00000006 /* This is a skipto rule */
#define IP_FW_F_FWD 0x00000007 /* This is a "change forwarding address" rule */
-#define IP_FW_F_PIPE 0x00000008 /* This is a dummynet rule */
#define IP_FW_F_IN 0x00000100 /* Check inbound packets */
#define IP_FW_F_OUT 0x00000200 /* Check outbound packets */
@@ -193,7 +188,7 @@ void ip_fw_init __P((void));
struct ip;
struct sockopt;
typedef int ip_fw_chk_t __P((struct ip **, int, struct ifnet *, u_int16_t *,
- struct mbuf **, struct ip_fw_chain **, struct sockaddr_in **));
+ struct mbuf **, struct sockaddr_in **));
typedef int ip_fw_ctl_t __P((struct sockopt *));
extern ip_fw_chk_t *ip_fw_chk_ptr;
extern ip_fw_ctl_t *ip_fw_ctl_ptr;
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index d4eb5ca816dd..186b8e676774 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_icmp.c,v 1.32 1998/12/03 20:23:20 dillon Exp $
+ * $Id: ip_icmp.c,v 1.30 1998/05/26 11:34:30 dg Exp $
*/
#include <sys/param.h>
@@ -69,33 +69,10 @@ static int icmpmaskrepl = 0;
SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
&icmpmaskrepl, 0, "");
-#ifdef ICMP_BANDLIM
-
-/*
- * ICMP error-response bandwidth limiting sysctl. If not enabled, sysctl
- * variable content is -1 and read-only.
- */
-
-static int icmplim = 100;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
- &icmplim, 0, "");
-#else
-
-static int icmplim = -1;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RD,
- &icmplim, 0, "");
-
-#endif
-
-/*
- * ICMP broadcast echo sysctl
- */
-
static int icmpbmcastecho = 0;
SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
0, "");
-
#ifdef ICMPPRINTFS
int icmpprintfs = 0;
#endif
@@ -727,69 +704,3 @@ ip_next_mtu(mtu, dir)
}
}
#endif
-
-#ifdef ICMP_BANDLIM
-
-/*
- * badport_bandlim() - check for ICMP bandwidth limit
- *
- * Return 0 if it is ok to send an ICMP error response, -1 if we have
- * hit our bandwidth limit and it is not ok.
- *
- * If icmplim is <= 0, the feature is disabled and 0 is returned.
- *
- * For now we separate the TCP and UDP subsystems w/ different 'which'
- * values. We may eventually remove this separation (and simplify the
- * code further).
- *
- * Note that the printing of the error message is delayed so we can
- * properly print the icmp error rate that the system was trying to do
- * (i.e. 22000/100 pps, etc...). This can cause long delays in printing
- * the 'final' error, but it doesn't make sense to solve the printing
- * delay with more complex code.
- */
-
-int
-badport_bandlim(int which)
-{
- static int lticks[2];
- static int lpackets[2];
- int dticks;
-
- /*
- * Return ok status if feature disabled or argument out of
- * ranage.
- */
-
- if (icmplim <= 0 || which >= 2 || which < 0)
- return(0);
- dticks = ticks - lticks[which];
-
- /*
- * reset stats when cumulative dt exceeds one second.
- */
-
- if ((unsigned int)dticks > hz) {
- if (lpackets[which] > icmplim) {
- printf("icmp-response bandwidth limit %d/%d pps\n",
- lpackets[which],
- icmplim
- );
- }
- lticks[which] = ticks;
- lpackets[which] = 0;
- }
-
- /*
- * bump packet count
- */
-
- if (++lpackets[which] > icmplim) {
- return(-1);
- }
- return(0);
-}
-
-#endif
-
-
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index d6cc0d532469..18f9fe209edb 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_input.c,v 1.110 1998/12/21 22:40:54 luigi Exp $
+ * $Id: ip_input.c,v 1.101 1998/09/10 08:56:40 dfr Exp $
* $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
*/
@@ -39,7 +39,6 @@
#include "opt_bootp.h"
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_ipfilter.h"
@@ -48,7 +47,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
-#include <sys/malloc.h>
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/socket.h>
@@ -78,10 +76,6 @@
#include <netinet/ip_fw.h>
#endif
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
-
int rsvp_on = 0;
static int ip_rsvp_on;
struct socket *ip_rsvpd;
@@ -155,10 +149,6 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
ip_fw_chk_t *ip_fw_chk_ptr;
ip_fw_ctl_t *ip_fw_ctl_ptr;
-#ifdef DUMMYNET
-ip_dn_ctl_t *ip_dn_ctl_ptr;
-#endif
-
/* IP Network Address Translation (NAT) hooks */
ip_nat_t *ip_nat_ptr;
ip_nat_ctl_t *ip_nat_ctl_ptr;
@@ -234,9 +224,6 @@ ip_init()
ip_id = time_second & 0xffff;
ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef DUMMYNET
- ip_dn_init();
-#endif
#ifdef IPNAT
ip_nat_init();
#endif
@@ -258,33 +245,10 @@ ip_input(struct mbuf *m)
{
struct ip *ip;
struct ipq *fp;
+ struct ipqent *ipqe;
struct in_ifaddr *ia;
int i, hlen, mff;
u_short sum;
-#ifndef IPDIVERT /* dummy variable for the firewall code to play with */
- u_short ip_divert_cookie = 0 ;
-#endif
-#ifdef COMPAT_IPFW
- struct ip_fw_chain *rule = NULL ;
-#endif
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
- /*
- * dummynet packet are prepended a vestigial mbuf with
- * m_type = MT_DUMMYNET and m_data pointing to the matching
- * rule.
- */
- if (m->m_type == MT_DUMMYNET) {
- struct mbuf *m0 = m ;
- rule = (struct ip_fw_chain *)(m->m_data) ;
- m = m->m_next ;
- free(m0, M_IPFW);
- ip = mtod(m, struct ip *);
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- goto iphack ;
- } else
- rule = NULL ;
-#endif
#ifdef DIAGNOSTIC
if (m == NULL || (m->m_flags & M_PKTHDR) == 0)
@@ -373,14 +337,9 @@ tooshort:
* deals with it.
* - Firewall: deny/allow/divert
* - Xlate: translate packet's addr/port (NAT).
- * - Pipe: pass pkt through dummynet.
* - Wrap: fake packet's addr/port <unimpl.>
* - Encapsulate: put it in another IP and send out. <unimp.>
*/
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
-iphack:
-#endif
#if defined(IPFILTER) || defined(IPFILTER_LKM)
/*
* Check if we want to allow this packet to be processed.
@@ -396,6 +355,8 @@ iphack:
#endif
#ifdef COMPAT_IPFW
if (ip_fw_chk_ptr) {
+ u_int16_t port;
+
#ifdef IPFIREWALL_FORWARD
/*
* If we've been forwarded from the output side, then
@@ -404,41 +365,29 @@ iphack:
if (ip_fw_fwd_addr)
goto ours;
#endif /* IPFIREWALL_FORWARD */
- i = (*ip_fw_chk_ptr)(&ip, hlen, NULL, &ip_divert_cookie,
- &m, &rule, &ip_fw_fwd_addr);
- /*
- * see the comment in ip_output for the return values
- * produced by the firewall.
- */
- if (!m) /* packet discarded by firewall */
- return ;
- if (i == 0 && ip_fw_fwd_addr == NULL) /* common case */
- goto pass ;
-#ifdef DUMMYNET
- if (i & 0x10000) {
- /* send packet to the appropriate pipe */
- dummynet_io(i&0xffff,DN_TO_IP_IN,m,NULL,NULL,0, rule);
- return ;
- }
-#endif
#ifdef IPDIVERT
- if (i > 0 && i < 0x10000) {
+ port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, &ip_divert_cookie,
+ &m, &ip_fw_fwd_addr);
+ if (port) {
/* Divert packet */
- frag_divert_port = i & 0xffff ;
+ frag_divert_port = port;
goto ours;
}
-#endif
-#ifdef IPFIREWALL_FORWARD
- if (i == 0 && ip_fw_fwd_addr != NULL)
- goto pass ;
-#endif
+#else /* !DIVERT */
/*
- * if we get here, the packet must be dropped
+ * If ipfw says divert, we have to just drop packet
+ * Use port as a dummy argument.
*/
+ port = 0;
+ if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, &port,
+ &m, &ip_fw_fwd_addr)) {
m_freem(m);
+ m = NULL;
+ }
+#endif /* !DIVERT */
+ if (!m)
return;
}
-pass:
if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
return;
@@ -564,7 +513,7 @@ ours:
*/
if (ip->ip_off & (IP_MF | IP_OFFMASK | IP_RF)) {
if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, hlen)) == 0) {
+ if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
ipstat.ips_toosmall++;
#ifdef IPDIVERT
frag_divert_port = 0;
@@ -762,13 +711,13 @@ ip_reass(m, fp, where)
fp->ipq_id = ip->ip_id;
fp->ipq_src = ip->ip_src;
fp->ipq_dst = ip->ip_dst;
- fp->ipq_frags = m;
- m->m_nextpkt = NULL;
+ fp->ipq_frags = 0;
#ifdef IPDIVERT
fp->ipq_divert = 0;
fp->ipq_div_cookie = 0;
#endif
- goto inserted;
+ q = 0;
+ goto insert;
}
#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header))
@@ -783,8 +732,7 @@ ip_reass(m, fp, where)
/*
* If there is a preceding segment, it may provide some of
* our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us, otherwise
- * stick new segment in the proper place.
+ * segment. If it provides all of our data, drop us.
*/
if (p) {
i = GETIP(p)->ip_off + GETIP(p)->ip_len - ip->ip_off;
@@ -795,11 +743,6 @@ ip_reass(m, fp, where)
ip->ip_off += i;
ip->ip_len -= i;
}
- m->m_nextpkt = p->m_nextpkt;
- p->m_nextpkt = m;
- } else {
- m->m_nextpkt = fp->ipq_frags;
- fp->ipq_frags = m;
}
/*
@@ -807,7 +750,7 @@ ip_reass(m, fp, where)
* if they are completely covered, dequeue them.
*/
for (; q != NULL && ip->ip_off + ip->ip_len > GETIP(q)->ip_off;
- q = nq) {
+ p = q, q = nq) {
i = (ip->ip_off + ip->ip_len) -
GETIP(q)->ip_off;
if (i < GETIP(q)->ip_len) {
@@ -817,11 +760,14 @@ ip_reass(m, fp, where)
break;
}
nq = q->m_nextpkt;
- m->m_nextpkt = nq;
+ if (p)
+ p->m_nextpkt = nq;
+ else
+ fp->ipq_frags = nq;
m_freem(q);
}
-inserted:
+insert:
#ifdef IPDIVERT
/*
@@ -836,8 +782,16 @@ inserted:
#endif
/*
- * Check for complete reassembly.
+ * Stick new segment in its place;
+ * check for complete reassembly.
*/
+ if (p == NULL) {
+ m->m_nextpkt = fp->ipq_frags;
+ fp->ipq_frags = m;
+ } else {
+ m->m_nextpkt = p->m_nextpkt;
+ p->m_nextpkt = m;
+ }
next = 0;
for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) {
if (GETIP(q)->ip_off != next)
@@ -1293,7 +1247,7 @@ ip_srcroute()
*(mtod(m, struct in_addr *)) = *p--;
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" hops %lx", (u_long)ntohl(mtod(m, struct in_addr *)->s_addr));
+ printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
#endif
/*
@@ -1313,7 +1267,7 @@ ip_srcroute()
while (p >= ip_srcrt.route) {
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" %lx", (u_long)ntohl(q->s_addr));
+ printf(" %lx", ntohl(q->s_addr));
#endif
*q++ = *p--;
}
@@ -1323,7 +1277,7 @@ ip_srcroute()
*q = ip_srcrt.dst;
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" %lx\n", (u_long)ntohl(q->s_addr));
+ printf(" %lx\n", ntohl(q->s_addr));
#endif
return (m);
}
diff --git a/sys/netinet/ip_log.c b/sys/netinet/ip_log.c
index 8a826ed2985c..2d789154a46a 100644
--- a/sys/netinet/ip_log.c
+++ b/sys/netinet/ip_log.c
@@ -5,7 +5,7 @@
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
- * $Id: ip_log.c,v 1.5 1998/11/26 18:54:52 eivind Exp $
+ * $Id: ip_log.c,v 1.3 1998/03/21 14:42:45 peter Exp $
*/
#include "opt_ipfilter.h"
@@ -122,8 +122,8 @@ extern kcondvar_t iplwait;
iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1];
int iplused[IPL_LOGMAX+1];
-static u_long iplcrc[IPL_LOGMAX+1];
-static u_long iplcrcinit;
+u_long iplcrc[IPL_LOGMAX+1];
+u_long iplcrcinit;
#ifdef linux
static struct wait_queue *iplwait[IPL_LOGMAX+1];
#endif
@@ -135,6 +135,7 @@ static struct wait_queue *iplwait[IPL_LOGMAX+1];
*/
void ipflog_init()
{
+ struct timeval tv;
int i;
for (i = IPL_LOGMAX; i >= 0; i--) {
@@ -145,16 +146,12 @@ void ipflog_init()
# if defined(__FreeBSD__) && __FreeBSD_version >= 300000
read_random(&iplcrcinit, sizeof iplcrcinit);
# else
- {
- struct timeval tv;
-
#if BSD >= 199306 || defined(__FreeBSD__) || defined(__sgi)
- microtime(&tv);
+ microtime(&tv);
# else
- uniqtime(&tv);
+ uniqtime(&tv);
# endif
- iplcrcinit = tv.tv_sec ^ (tv.tv_usec << 8) ^ tv.tv_usec;
- }
+ iplcrcinit = tv.tv_sec ^ (tv.tv_usec << 8) ^ tv.tv_usec;
# endif
}
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 65bfecfaf0a9..3c11f8247274 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -9,14 +9,13 @@
* Modified by Bill Fenner, PARC, April 1995
*
* MROUTING Revision: 3.5
- * $Id: ip_mroute.c,v 1.52 1999/01/12 12:16:50 eivind Exp $
+ * $Id: ip_mroute.c,v 1.48 1998/08/17 01:05:24 bde Exp $
*/
#include "opt_mrouting.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -64,6 +63,8 @@ extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
*/
struct socket *ip_mrouter = NULL;
+static u_int ip_mrtproto = 0;
+static struct mrtstat mrtstat;
u_int rsvpdebug = 0;
int
@@ -186,7 +187,7 @@ ip_rsvp_force_done(so)
#define same(a1, a2) \
(bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast routing tables");
+#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
/*
* Globals. All but ip_mrouter and ip_mrtproto could be static,
@@ -195,6 +196,8 @@ static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast routing tables");
#ifndef MROUTE_LKM
struct socket *ip_mrouter = NULL;
static struct mrtstat mrtstat;
+
+static int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
#else /* MROUTE_LKM */
extern void X_ipip_input __P((struct mbuf *m, int iphlen));
extern struct mrtstat mrtstat;
@@ -204,7 +207,7 @@ static int ip_mrtproto;
#define NO_RTE_FOUND 0x1
#define RTE_FOUND 0x2
-static struct mfc *mfctable[MFCTBLSIZ];
+static struct mbuf *mfctable[MFCTBLSIZ];
static u_char nexpire[MFCTBLSIZ];
static struct vif viftable[MAXVIFS];
static u_int mrtdebug = 0; /* debug level */
@@ -322,17 +325,19 @@ static int pim_assert;
*/
#define MFCFIND(o, g, rt) { \
- register struct mfc *_rt = mfctable[MFCHASH(o,g)]; \
+ register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
+ register struct mfc *_rt = NULL; \
rt = NULL; \
++mrtstat.mrts_mfc_lookups; \
- while (_rt) { \
+ while (_mb_rt) { \
+ _rt = mtod(_mb_rt, struct mfc *); \
if ((_rt->mfc_origin.s_addr == o) && \
(_rt->mfc_mcastgrp.s_addr == g) && \
- (_rt->mfc_stall == NULL)) { \
+ (_mb_rt->m_act == NULL)) { \
rt = _rt; \
break; \
} \
- _rt = _rt->mfc_next; \
+ _mb_rt = _mb_rt->m_next; \
} \
if (rt == NULL) { \
++mrtstat.mrts_mfc_misses; \
@@ -424,7 +429,6 @@ X_ip_mrouter_set(so, sopt)
error = add_mfc(&mfc);
else
error = del_mfc(&mfc);
- break;
case MRT_ASSERT:
error = sooptcopyin(sopt, &optval, sizeof optval,
@@ -432,7 +436,6 @@ X_ip_mrouter_set(so, sopt)
if (error)
break;
set_assert(optval);
- break;
default:
error = EOPNOTSUPP;
@@ -553,6 +556,8 @@ ip_mrouter_init(so, version)
struct socket *so;
int version;
{
+ int *v;
+
if (mrtdebug)
log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
so->so_type, so->so_proto->pr_protocol);
@@ -590,7 +595,8 @@ X_ip_mrouter_done()
int i;
struct ifnet *ifp;
struct ifreq ifr;
- struct mfc *rt;
+ struct mbuf *mb_rt;
+ struct mbuf *m;
struct rtdetq *rte;
int s;
@@ -621,18 +627,18 @@ X_ip_mrouter_done()
* Free all multicast forwarding cache entries.
*/
for (i = 0; i < MFCTBLSIZ; i++) {
- for (rt = mfctable[i]; rt != NULL; ) {
- struct mfc *nr = rt->mfc_next;
-
- for (rte = rt->mfc_stall; rte != NULL; ) {
- struct rtdetq *n = rte->next;
-
- m_freem(rte->m);
- free(rte, M_MRTABLE);
- rte = n;
+ mb_rt = mfctable[i];
+ while (mb_rt) {
+ if (mb_rt->m_act != NULL) {
+ while (mb_rt->m_act) {
+ m = mb_rt->m_act;
+ mb_rt->m_act = m->m_act;
+ rte = mtod(m, struct rtdetq *);
+ m_freem(rte->m);
+ m_free(m);
+ }
}
- free(rt, M_MRTABLE);
- rt = nr;
+ mb_rt = m_free(mb_rt);
}
}
@@ -685,6 +691,7 @@ add_vif(vifcp)
static struct sockaddr_in sin = {sizeof sin, AF_INET};
struct ifaddr *ifa;
struct ifnet *ifp;
+ struct ifreq ifr;
int error, s;
struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
@@ -838,7 +845,9 @@ add_mfc(mfccp)
struct mfcctl *mfccp;
{
struct mfc *rt;
+ register struct mbuf *mb_rt;
u_long hash;
+ struct mbuf *mb_ntry;
struct rtdetq *rte;
register u_short nstl;
int s;
@@ -867,24 +876,25 @@ add_mfc(mfccp)
*/
s = splnet();
hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (rt = mfctable[hash], nstl = 0; rt; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
(rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (rt->mfc_stall != NULL)) {
+ (mb_rt->m_act != NULL)) {
if (nstl++)
log(LOG_ERR, "add_mfc %s o %lx g %lx p %x dbx %p\n",
"multiple kernel entries",
(u_long)ntohl(mfccp->mfcc_origin.s_addr),
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, (void *)rt->mfc_stall);
+ mfccp->mfcc_parent, (void *)mb_rt->m_act);
if (mrtdebug & DEBUG_MFC)
log(LOG_DEBUG,"add_mfc o %lx g %lx p %x dbg %p\n",
(u_long)ntohl(mfccp->mfcc_origin.s_addr),
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, (void *)rt->mfc_stall);
+ mfccp->mfcc_parent, (void *)mb_rt->m_act);
rt->mfc_origin = mfccp->mfcc_origin;
rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
@@ -901,18 +911,19 @@ add_mfc(mfccp)
nexpire[hash]--;
/* free packets Qed at the end of this entry */
- for (rte = rt->mfc_stall; rte != NULL; ) {
- struct rtdetq *n = rte->next;
-
+ while (mb_rt->m_act) {
+ mb_ntry = mb_rt->m_act;
+ rte = mtod(mb_ntry, struct rtdetq *);
+/* #ifdef RSVP_ISI */
ip_mdq(rte->m, rte->ifp, rt, -1);
+/* #endif */
+ mb_rt->m_act = mb_ntry->m_act;
m_freem(rte->m);
#ifdef UPCALL_TIMING
collate(&(rte->t));
#endif /* UPCALL_TIMING */
- free(rte, M_MRTABLE);
- rte = n;
+ m_free(mb_ntry);
}
- rt->mfc_stall = NULL;
}
}
@@ -926,8 +937,9 @@ add_mfc(mfccp)
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
mfccp->mfcc_parent);
- for (rt = mfctable[hash]; rt != NULL; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
(rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
@@ -946,14 +958,16 @@ add_mfc(mfccp)
rt->mfc_expire = 0;
}
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
/* no upcall, so make a new entry */
- rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
- if (rt == NULL) {
+ MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
+ if (mb_rt == NULL) {
splx(s);
return ENOBUFS;
}
+ rt = mtod(mb_rt, struct mfc *);
+
/* insert new entry at head of hash chain */
rt->mfc_origin = mfccp->mfcc_origin;
rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
@@ -966,11 +980,11 @@ add_mfc(mfccp)
rt->mfc_wrong_if = 0;
rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
rt->mfc_expire = 0;
- rt->mfc_stall = NULL;
/* link into table */
- rt->mfc_next = mfctable[hash];
- mfctable[hash] = rt;
+ mb_rt->m_next = mfctable[hash];
+ mfctable[hash] = mb_rt;
+ mb_rt->m_act = NULL;
}
}
splx(s);
@@ -1013,7 +1027,8 @@ del_mfc(mfccp)
struct in_addr origin;
struct in_addr mcastgrp;
struct mfc *rt;
- struct mfc **nptr;
+ struct mbuf *mb_rt;
+ struct mbuf **nptr;
u_long hash;
int s;
@@ -1028,21 +1043,21 @@ del_mfc(mfccp)
s = splnet();
nptr = &mfctable[hash];
- while ((rt = *nptr) != NULL) {
+ while ((mb_rt = *nptr) != NULL) {
+ rt = mtod(mb_rt, struct mfc *);
if (origin.s_addr == rt->mfc_origin.s_addr &&
mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- rt->mfc_stall == NULL)
+ mb_rt->m_act == NULL)
break;
- nptr = &rt->mfc_next;
+ nptr = &mb_rt->m_next;
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
splx(s);
return EADDRNOTAVAIL;
}
- *nptr = rt->mfc_next;
- free(rt, M_MRTABLE);
+ MFREE(mb_rt, *nptr);
splx(s);
@@ -1168,9 +1183,13 @@ X_ip_mforward(ip, ifp, m, imo)
* send message to routing daemon
*/
+ register struct mbuf *mb_rt;
+ register struct mbuf *mb_ntry;
register struct mbuf *mb0;
register struct rtdetq *rte;
+ register struct mbuf *rte_m;
register u_long hash;
+ register int npkts;
int hlen = ip->ip_hl << 2;
#ifdef UPCALL_TIMING
struct timeval tp;
@@ -1189,8 +1208,8 @@ X_ip_mforward(ip, ifp, m, imo)
* just going to fail anyway. Make sure to pullup the header so
* that other people can't step on it.
*/
- rte = (struct rtdetq *)malloc((sizeof *rte), M_MRTABLE, M_NOWAIT);
- if (rte == NULL) {
+ MGET(mb_ntry, M_DONTWAIT, MT_DATA);
+ if (mb_ntry == NULL) {
splx(s);
return ENOBUFS;
}
@@ -1198,28 +1217,29 @@ X_ip_mforward(ip, ifp, m, imo)
if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
mb0 = m_pullup(mb0, hlen);
if (mb0 == NULL) {
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
splx(s);
return ENOBUFS;
}
/* is there an upcall waiting for this packet? */
hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (rt = mfctable[hash]; rt; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
(ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (rt->mfc_stall != NULL))
+ (mb_rt->m_act != NULL))
break;
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
int i;
struct igmpmsg *im;
/* no upcall, so make a new entry */
- rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
- if (rt == NULL) {
- free(rte, M_MRTABLE);
+ MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
+ if (mb_rt == NULL) {
+ m_free(mb_ntry);
m_freem(mb0);
splx(s);
return ENOBUFS;
@@ -1227,9 +1247,9 @@ X_ip_mforward(ip, ifp, m, imo)
/* Make a copy of the header to send to the user level process */
mm = m_copy(mb0, 0, hlen);
if (mm == NULL) {
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
- free(rt, M_MRTABLE);
+ m_free(mb_rt);
splx(s);
return ENOBUFS;
}
@@ -1249,13 +1269,15 @@ X_ip_mforward(ip, ifp, m, imo)
if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
++mrtstat.mrts_upq_sockfull;
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
- free(rt, M_MRTABLE);
+ m_free(mb_rt);
splx(s);
return ENOBUFS;
}
+ rt = mtod(mb_rt, struct mfc *);
+
/* insert new entry at head of hash chain */
rt->mfc_origin.s_addr = ip->ip_src.s_addr;
rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
@@ -1266,36 +1288,36 @@ X_ip_mforward(ip, ifp, m, imo)
rt->mfc_parent = -1;
/* link into table */
- rt->mfc_next = mfctable[hash];
- mfctable[hash] = rt;
- rt->mfc_stall = rte;
+ mb_rt->m_next = mfctable[hash];
+ mfctable[hash] = mb_rt;
+ mb_rt->m_act = NULL;
+ rte_m = mb_rt;
} else {
/* determine if q has overflowed */
- int npkts = 0;
- struct rtdetq **p;
-
- for (p = &rt->mfc_stall; *p != NULL; p = &(*p)->next)
+ for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
npkts++;
if (npkts > MAX_UPQ) {
mrtstat.mrts_upq_ovflw++;
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
splx(s);
return 0;
}
-
- /* Add this entry to the end of the queue */
- *p = rte;
}
+ mb_ntry->m_act = NULL;
+ rte = mtod(mb_ntry, struct rtdetq *);
+
rte->m = mb0;
rte->ifp = ifp;
#ifdef UPCALL_TIMING
rte->t = tp;
#endif
- rte->next = NULL;
+
+ /* Add this entry to the end of the queue */
+ rte_m->m_act = mb_ntry;
splx(s);
@@ -1314,8 +1336,9 @@ int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
static void
expire_upcalls(void *unused)
{
+ struct mbuf *mb_rt, *m, **nptr;
struct rtdetq *rte;
- struct mfc *mfc, **nptr;
+ struct mfc *mfc;
int i;
int s;
@@ -1324,13 +1347,15 @@ expire_upcalls(void *unused)
if (nexpire[i] == 0)
continue;
nptr = &mfctable[i];
- for (mfc = *nptr; mfc != NULL; mfc = *nptr) {
+ for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
+ mfc = mtod(mb_rt, struct mfc *);
+
/*
* Skip real cache entries
* Make sure it wasn't marked to not expire (shouldn't happen)
* If it expires now
*/
- if (mfc->mfc_stall != NULL &&
+ if (mb_rt->m_act != NULL &&
mfc->mfc_expire != 0 &&
--mfc->mfc_expire == 0) {
if (mrtdebug & DEBUG_EXPIRE)
@@ -1341,20 +1366,20 @@ expire_upcalls(void *unused)
* drop all the packets
* free the mbuf with the pkt, if, timing info
*/
- for (rte = mfc->mfc_stall; rte; ) {
- struct rtdetq *n = rte->next;
-
+ while (mb_rt->m_act) {
+ m = mb_rt->m_act;
+ mb_rt->m_act = m->m_act;
+
+ rte = mtod(m, struct rtdetq *);
m_freem(rte->m);
- free(rte, M_MRTABLE);
- rte = n;
+ m_free(m);
}
++mrtstat.mrts_cache_cleanups;
nexpire[i]--;
- *nptr = mfc->mfc_next;
- free(mfc, M_MRTABLE);
+ MFREE(mb_rt, *nptr);
} else {
- nptr = &mfc->mfc_next;
+ nptr = &mb_rt->m_next;
}
}
}
@@ -1535,7 +1560,7 @@ phyint_send(ip, vifp, m)
if (mb_copy == NULL)
return;
- if (vifp->v_rate_limit == 0)
+ if (vifp->v_rate_limit <= 0)
tbf_send_packet(vifp, mb_copy);
else
tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
@@ -1596,7 +1621,7 @@ encap_send(ip, vifp, m)
ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
mb_copy->m_data -= sizeof(multicast_encap_iphdr);
- if (vifp->v_rate_limit == 0)
+ if (vifp->v_rate_limit <= 0)
tbf_send_packet(vifp, mb_copy);
else
tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h
index 0526bbb18f75..94ddeac0608a 100644
--- a/sys/netinet/ip_mroute.h
+++ b/sys/netinet/ip_mroute.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id: ip_mroute.h,v 1.14 1998/08/23 03:07:14 wollman Exp $
+ * $Id: ip_mroute.h,v 1.13 1997/02/22 09:41:35 peter Exp $
*/
#ifndef _NETINET_IP_MROUTE_H_
@@ -188,8 +188,6 @@ struct mfc {
u_long mfc_wrong_if; /* wrong if for src-grp */
int mfc_expire; /* time to clean entry up */
struct timeval mfc_last_assert; /* last time I sent an assert*/
- struct rtdetq *mfc_stall; /* q of packets awaiting mfc */
- struct mfc *mfc_next; /* next mfc entry */
};
/*
@@ -218,7 +216,6 @@ struct rtdetq {
#ifdef UPCALL_TIMING
struct timeval t; /* Timestamp */
#endif /* UPCALL_TIMING */
- struct rtdetq *next; /* Next in list of packets */
};
#define MFCTBLSIZ 256
diff --git a/sys/netinet/ip_nat.c b/sys/netinet/ip_nat.c
index 243c8bb19144..673e1f3a80b8 100644
--- a/sys/netinet/ip_nat.c
+++ b/sys/netinet/ip_nat.c
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.4 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.3 1998/06/20 18:37:50 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -103,11 +103,11 @@ extern struct ifnet vpnif;
#undef SOCKADDR_IN
#define SOCKADDR_IN struct sockaddr_in
- nat_t *nat_table[2][NAT_SIZE], *nat_instances = NULL;
-static ipnat_t *nat_list = NULL;
+nat_t *nat_table[2][NAT_SIZE], *nat_instances = NULL;
+ipnat_t *nat_list = NULL;
u_long fr_defnatage = 1200, /* 10 minutes (600 seconds) */
fr_defnaticmpage = 6; /* 3 seconds */
-static natstat_t nat_stats;
+natstat_t nat_stats;
#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
extern kmutex_t ipf_nat;
#endif
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index a180e401b8de..be7722885a65 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -31,19 +31,17 @@
* SUCH DAMAGE.
*
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id: ip_output.c,v 1.84 1998/12/14 18:09:13 luigi Exp $
+ * $Id: ip_output.c,v 1.81 1998/08/23 03:07:14 wollman Exp $
*/
#define _IP_VHL
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_ipfilter.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
@@ -78,10 +76,6 @@ static MALLOC_DEFINE(M_IPMOPTS, "ip_moptions", "internet multicast options");
#include <netinet/ip_fw.h>
#endif
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
-
#ifdef IPFIREWALL_FORWARD_DEBUG
#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
(ntohl(a.s_addr)>>16)&0xFF,\
@@ -136,41 +130,6 @@ ip_output(m0, opt, ro, flags, imo)
int fwd_rewrite_src = 0;
#endif
-#ifndef IPDIVERT /* dummy variable for the firewall code to play with */
- u_short ip_divert_cookie = 0 ;
-#endif
-#ifdef COMPAT_IPFW
- struct ip_fw_chain *rule = NULL ;
-#endif
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
- /*
- * dummynet packet are prepended a vestigial mbuf with
- * m_type = MT_DUMMYNET and m_data pointing to the matching
- * rule.
- */
- if (m->m_type == MT_DUMMYNET) {
- struct mbuf *tmp_m = m ;
- /*
- * the packet was already tagged, so part of the
- * processing was already done, and we need to go down.
- * opt, flags and imo have already been used, and now
- * they are used to hold ifp and hlen and NULL, respectively.
- */
- rule = (struct ip_fw_chain *)(m->m_data) ;
- m = m->m_next ;
- free(tmp_m, M_IPFW);
- ip = mtod(m, struct ip *);
- dst = (struct sockaddr_in *)&ro->ro_dst;
- ifp = (struct ifnet *)opt;
- hlen = IP_VHL_HL(ip->ip_vhl) << 2 ;
- opt = NULL ;
- flags = 0 ; /* XXX is this correct ? */
- goto sendit;
- } else
- rule = NULL ;
-#endif
-
#ifdef DIAGNOSTIC
if ((m->m_flags & M_PKTHDR) == 0)
panic("ip_output no HDR");
@@ -434,52 +393,28 @@ sendit:
* Check with the firewall...
*/
if (ip_fw_chk_ptr) {
+#ifdef IPFIREWALL_FORWARD
struct sockaddr_in *old = dst;
-
- off = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, &ip_divert_cookie, &m, &rule, &dst);
- /*
- * On return we must do the following:
- * m == NULL -> drop the pkt
- * 1<=off<= 0xffff -> DIVERT
- * (off & 0x10000) -> send to a DUMMYNET pipe
- * dst != old -> IPFIREWALL_FORWARD
- * off==0, dst==old -> accept
- * If some of the above modules is not compiled in, then
- * we should't have to check the corresponding condition
- * (because the ipfw control socket should not accept
- * unsupported rules), but better play safe and drop
- * packets in case of doubt.
- */
- if (!m) { /* firewall said to reject */
- error = EACCES;
+#endif
+#ifdef IPDIVERT
+ ip_divert_port = (*ip_fw_chk_ptr)(&ip,
+ hlen, ifp, &ip_divert_cookie, &m, &dst);
+ if (ip_divert_port) { /* Divert packet */
+ (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
goto done;
}
- if (off == 0 && dst == old) /* common case */
- goto pass ;
-#ifdef DUMMYNET
- if (off & 0x10000) {
- /*
- * pass the pkt to dummynet. Need to include
- * pipe number, m, ifp, ro, hlen because these are
- * not recomputed in the next pass.
- * All other parameters have been already used and
- * so they are not needed anymore.
- * XXX note: if the ifp or ro entry are deleted
- * while a pkt is in dummynet, we are in trouble!
- */
- dummynet_io(off & 0xffff, DN_TO_IP_OUT, m,ifp,ro,hlen,rule);
+#else /* !IPDIVERT */
+ u_int16_t dummy = 0;
+ /* If ipfw says divert, we have to just drop packet */
+ if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, &dummy, &m, &dst)) {
+ m_freem(m);
goto done;
}
-#endif
-#ifdef IPDIVERT
- if (off > 0 && off < 0x10000) { /* Divert packet */
- ip_divert_port = off & 0xffff ;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
+#endif /* !IPDIVERT */
+ if (!m) {
+ error = EACCES;
goto done;
}
-#endif
-
#ifdef IPFIREWALL_FORWARD
/* Here we check dst to make sure it's directly reachable on the
* interface we previously thought it was.
@@ -490,7 +425,7 @@ sendit:
* such control is nigh impossible. So we do it here.
* And I'm babbling.
*/
- if (off == 0 && old != dst) {
+ if (old != dst) {
struct in_ifaddr *ia;
/* It's changed... */
@@ -579,20 +514,12 @@ sendit:
*/
if (fwd_rewrite_src)
ip->ip_src = IA_SIN(ia)->sin_addr;
- goto pass ;
}
#endif /* IPFIREWALL_FORWARD */
- /*
- * if we get here, none of the above matches, and
- * we have to drop the pkt
- */
- m_freem(m);
- error = EACCES; /* not sure this is the right error msg */
- goto done;
}
#endif /* COMPAT_IPFW */
-pass:
+
/*
* If small enough for interface, can just send directly.
*/
diff --git a/sys/netinet/ip_state.c b/sys/netinet/ip_state.c
index 5545b3daea0f..98cc86295ade 100644
--- a/sys/netinet/ip_state.c
+++ b/sys/netinet/ip_state.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_state.c 1.8 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.3 1998/06/20 18:37:51 peter Exp $";
+static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.2 1998/03/21 11:34:27 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -85,9 +85,9 @@ static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.3 1998/06/20 18:37:51 peter
#define TCP_CLOSE (TH_FIN|TH_RST)
-static ipstate_t *ips_table[IPSTATE_SIZE];
-static int ips_num = 0;
-static ips_stat_t ips_stats;
+ipstate_t *ips_table[IPSTATE_SIZE];
+int ips_num = 0;
+ips_stat_t ips_stats;
#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
extern kmutex_t ipf_state;
#endif
diff --git a/sys/netinet/mlf_ipl.c b/sys/netinet/mlf_ipl.c
index 1ef9077e53d5..d3abe3e8faf0 100644
--- a/sys/netinet/mlf_ipl.c
+++ b/sys/netinet/mlf_ipl.c
@@ -81,8 +81,29 @@
extern int lkmenodev __P((void));
+static char *ipf_devfiles[] = { IPL_NAME, IPL_NAT, IPL_STATE, IPL_AUTH,
+ NULL };
+static int if_ipl_unload __P((struct lkm_table *, int));
+static int if_ipl_load __P((struct lkm_table *, int));
+static int if_ipl_remove __P((void));
int xxxinit __P((struct lkm_table *, int, int));
+
+struct cdevsw ipldevsw =
+{
+ iplopen, /* open */
+ iplclose, /* close */
+ iplread, /* read */
+ (void *)nullop, /* write */
+ iplioctl, /* ioctl */
+ (void *)nullop, /* stop */
+ (void *)nullop, /* reset */
+ (void *)NULL, /* tty */
+ (void *)nullop, /* select */
+ (void *)nullop, /* mmap */
+ NULL /* strategy */
+};
+
#ifdef SYSCTL_INT
SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF");
SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &fr_flags, 0, "");
@@ -119,33 +140,19 @@ SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_defaultauthage, CTLFLAG_RW,
#endif
#ifdef DEVFS
-static void *ipf_devfs[IPL_LOGMAX + 1];
+void *ipf_devfs[IPL_LOGMAX + 1];
#endif
#if !defined(__FreeBSD_version) || (__FreeBSD_version < 220000)
int ipl_major = 0;
-static struct cdevsw ipldevsw =
-{
- iplopen, /* open */
- iplclose, /* close */
- iplread, /* read */
- (void *)nullop, /* write */
- iplioctl, /* ioctl */
- (void *)nullop, /* stop */
- (void *)nullop, /* reset */
- (void *)NULL, /* tty */
- (void *)nullop, /* select */
- (void *)nullop, /* mmap */
- NULL /* strategy */
-};
-
MOD_DEV(IPL_VERSION, LM_DT_CHAR, -1, &ipldevsw);
extern struct cdevsw cdevsw[];
extern int vd_unuseddev __P((void));
extern int nchrdev;
#else
+int ipl_major = CDEV_MAJOR;
static struct cdevsw ipl_cdevsw = {
iplopen, iplclose, iplread, nowrite, /* 79 */
@@ -159,13 +166,8 @@ static struct cdevsw ipl_cdevsw = {
static void ipl_drvinit __P((void *));
#ifdef ACTUALLY_LKM_NOT_KERNEL
-static int if_ipl_unload __P((struct lkm_table *, int));
-static int if_ipl_load __P((struct lkm_table *, int));
-static int if_ipl_remove __P((void));
-static int ipl_major = CDEV_MAJOR;
-
static int iplaction __P((struct lkm_table *, int));
-static char *ipf_devfiles[] = { IPL_NAME, IPL_NAT, IPL_STATE, IPL_AUTH, NULL };
+
static int iplaction(lkmtp, cmd)
struct lkm_table *lkmtp;
int cmd;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 1dd361822dd2..ee05690cb94f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id: raw_ip.c,v 1.55 1998/08/23 03:07:14 wollman Exp $
+ * $Id: raw_ip.c,v 1.54 1998/05/15 20:11:34 wollman Exp $
*/
#include <sys/param.h>
@@ -61,10 +61,6 @@
#include <netinet/ip_fw.h>
-#include "opt_ipdn.h"
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
#undef COMPAT_IPFW
#define COMPAT_IPFW 1
@@ -263,14 +259,6 @@ rip_ctloutput(so, sopt)
else
error = ip_nat_ctl_ptr(sopt);
break;
-#ifdef DUMMYNET
- case IP_DUMMYNET_GET:
- if (ip_dn_ctl_ptr == NULL)
- error = ENOPROTOOPT ;
- else
- error = ip_dn_ctl_ptr(sopt);
- break ;
-#endif /* DUMMYNET */
#endif /* COMPAT_IPFW */
case MRT_INIT:
@@ -320,16 +308,6 @@ rip_ctloutput(so, sopt)
else
error = ip_nat_ctl_ptr(sopt);
break;
-#ifdef DUMMYNET
- case IP_DUMMYNET_CONFIGURE:
- case IP_DUMMYNET_DEL:
- case IP_DUMMYNET_FLUSH:
- if (ip_dn_ctl_ptr == NULL)
- error = ENOPROTOOPT ;
- else
- error = ip_dn_ctl_ptr(sopt);
- break ;
-#endif
#endif /* COMPAT_IPFW */
case IP_RSVP_ON:
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 97d1983b0078..bb88d163986b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -31,10 +31,10 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id: tcp_input.c,v 1.81 1998/09/11 16:04:03 wollman Exp $
+ * $Id: tcp_input.c,v 1.80 1998/08/24 07:47:39 dfr Exp $
*/
-#include "opt_ipfw.h" /* for ipfw_fwd */
+#include "opt_ipfw.h" /* for ipfw_fwd */
#include "opt_tcpdebug.h"
#include <sys/param.h>
@@ -57,10 +57,8 @@
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/ip_icmp.h> /* for ICMP_BANDLIM */
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h> /* for ICMP_BANDLIM */
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
@@ -399,10 +397,6 @@ findpcb:
buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src),
ntohs(ti->ti_sport));
}
-#ifdef ICMP_BANDLIM
- if (badport_bandlim(1) < 0)
- goto drop;
-#endif
goto dropwithreset;
}
tp = intotcpcb(inp);
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 36f431ac6182..a0ae43af0b4b 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id: tcp_output.c,v 1.31 1998/07/13 11:53:59 bde Exp $
+ * $Id: tcp_output.c,v 1.30 1998/05/24 18:41:04 fenner Exp $
*/
#include "opt_tcpdebug.h"
@@ -223,8 +223,7 @@ again:
if (len) {
if (len == tp->t_maxseg)
goto send;
- if (!(tp->t_flags & TF_MORETOCOME) &&
- (idle || tp->t_flags & TF_NODELAY) &&
+ if ((idle || tp->t_flags & TF_NODELAY) &&
(tp->t_flags & TF_NOPUSH) == 0 &&
len + off >= so->so_snd.sb_cc)
goto send;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 12ca0258f12f..c1c29e4524f8 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.48 1998/11/15 21:35:09 guido Exp $
+ * $Id: tcp_subr.c,v 1.46 1998/08/24 07:47:39 dfr Exp $
*/
#include "opt_compat.h"
@@ -209,8 +209,7 @@ tcp_respond(tp, ti, m, ack, seq, flags)
struct route sro;
if (tp) {
- if (!(flags & TH_RST))
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
+ win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
ro = &tp->t_inpcb->inp_route;
} else {
ro = &sro;
@@ -348,6 +347,7 @@ tcp_close(tp)
register struct mbuf *nq;
struct inpcb *inp = tp->t_inpcb;
struct socket *so = inp->inp_socket;
+ register struct mbuf *m;
register struct rtentry *rt;
int dosavessthresh;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 66519cef45f8..ba0c01233636 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id: tcp_usrreq.c,v 1.39 1998/12/07 21:58:42 archie Exp $
+ * $Id: tcp_usrreq.c,v 1.37 1998/01/27 09:15:11 davidg Exp $
*/
#include "opt_tcpdebug.h"
@@ -368,13 +368,8 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
socantsendmore(so);
tp = tcp_usrclosed(tp);
}
- if (tp != NULL) {
- if (flags & PRUS_MORETOCOME)
- tp->t_flags |= TF_MORETOCOME;
+ if (tp != NULL)
error = tcp_output(tp);
- if (flags & PRUS_MORETOCOME)
- tp->t_flags &= ~TF_MORETOCOME;
- }
} else {
if (sbspace(&so->so_snd) < -512) {
m_freem(m);
@@ -580,6 +575,7 @@ tcp_ctloutput(so, sopt)
int error, opt, optval, s;
struct inpcb *inp;
struct tcpcb *tp;
+ struct mbuf *m;
error = 0;
s = splnet(); /* XXX */
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index db4f401a060d..4e8d88c086fd 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id: tcp_var.h,v 1.48 1998/08/24 07:47:39 dfr Exp $
+ * $Id: tcp_var.h,v 1.47 1998/08/23 03:07:15 wollman Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@@ -54,23 +54,22 @@ struct tcpcb {
struct inpcb *t_inpcb; /* back pointer to internet pcb */
int t_state; /* state of this connection */
u_int t_flags;
-#define TF_ACKNOW 0x00001 /* ack peer immediately */
-#define TF_DELACK 0x00002 /* ack, but try to delay it */
-#define TF_NODELAY 0x00004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x00008 /* don't use tcp options */
-#define TF_SENTFIN 0x00010 /* have sent FIN */
-#define TF_REQ_SCALE 0x00020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x00040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x00080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x00100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x00400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x01000 /* don't push */
-#define TF_REQ_CC 0x02000 /* have/will request CC */
-#define TF_RCVD_CC 0x04000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */
-#define TF_MORETOCOME 0x10000 /* More data to be appended to sock */
+#define TF_ACKNOW 0x0001 /* ack peer immediately */
+#define TF_DELACK 0x0002 /* ack, but try to delay it */
+#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
+#define TF_NOOPT 0x0008 /* don't use tcp options */
+#define TF_SENTFIN 0x0010 /* have sent FIN */
+#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
+#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
+#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
+#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
+#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
+#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
+#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
+#define TF_NOPUSH 0x1000 /* don't push */
+#define TF_REQ_CC 0x2000 /* have/will request CC */
+#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
+#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
int t_force; /* 1 if forcing out a byte */
tcp_seq snd_una; /* send unacknowledged */
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 3462c70908d3..d5eae08ae4fd 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id: udp_usrreq.c,v 1.48 1998/08/24 07:47:39 dfr Exp $
+ * $Id: udp_usrreq.c,v 1.47 1998/05/15 20:11:35 wollman Exp $
*/
#include <sys/param.h>
@@ -57,7 +57,6 @@
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
@@ -297,10 +296,6 @@ udp_input(m, iphlen)
goto bad;
}
*ip = save_ip;
-#ifdef ICMP_BANDLIM
- if (badport_bandlim(0) < 0)
- goto bad;
-#endif
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
return;
}
@@ -696,4 +691,3 @@ struct pr_usrreqs udp_usrreqs = {
pru_rcvoob_notsupp, udp_send, pru_sense_null, udp_shutdown,
in_setsockaddr, sosend, soreceive, sopoll
};
-
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 6fed4bf57957..8aee42687512 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id: udp_var.h,v 1.15 1998/05/15 20:11:36 wollman Exp $
+ * $Id: udp_var.h,v 1.14 1997/09/07 05:26:51 bde Exp $
*/
#ifndef _NETINET_UDP_VAR_H_
@@ -44,6 +44,8 @@ struct udpiphdr {
struct ipovly ui_i; /* overlaid ip structure */
struct udphdr ui_u; /* udp header */
};
+#define ui_next ui_i.ih_next
+#define ui_prev ui_i.ih_prev
#define ui_x1 ui_i.ih_x1
#define ui_pr ui_i.ih_pr
#define ui_len ui_i.ih_len
diff --git a/sys/netipx/ipx.c b/sys/netipx/ipx.c
index 59ccffee4e3b..ab2f42aa48b3 100644
--- a/sys/netipx/ipx.c
+++ b/sys/netipx/ipx.c
@@ -33,7 +33,7 @@
*
* @(#)ipx.c
*
- * $Id: ipx.c,v 1.13 1998/12/04 22:54:54 archie Exp $
+ * $Id: ipx.c,v 1.11 1997/06/26 19:35:42 jhay Exp $
*/
#include <sys/param.h>
@@ -359,7 +359,7 @@ register struct ipx_addr *addr;
net = "*";
else {
q = work.x_net.c_net;
- snprintf(cnet, sizeof(cnet), "%x%x%x%x",
+ sprintf(cnet, "%x%x%x%x",
q[0], q[1], q[2], q[3]);
for (p = cnet; *p == '0' && p < cnet + 8; p++)
continue;
@@ -372,7 +372,7 @@ register struct ipx_addr *addr;
host = "*";
else {
q = work.x_host.c_host;
- snprintf(chost, sizeof(chost), "%x%x%x%x%x%x",
+ sprintf(chost, "%x%x%x%x%x%x",
q[0], q[1], q[2], q[3], q[4], q[5]);
for (p = chost; *p == '0' && p < chost + 12; p++)
continue;
@@ -382,9 +382,9 @@ register struct ipx_addr *addr;
if (port) {
if (strcmp(host, "*") == 0) {
host = "";
- snprintf(cport, sizeof(cport), "%x", port);
+ sprintf(cport, "%x", port);
} else
- snprintf(cport, sizeof(cport), ".%x", port);
+ sprintf(cport, ".%x", port);
} else
*cport = 0;
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c
index 63e140646667..58fb5e24e264 100644
--- a/sys/netipx/ipx_usrreq.c
+++ b/sys/netipx/ipx_usrreq.c
@@ -33,7 +33,7 @@
*
* @(#)ipx_usrreq.c
*
- * $Id: ipx_usrreq.c,v 1.20 1998/08/23 03:07:15 wollman Exp $
+ * $Id: ipx_usrreq.c,v 1.19 1998/02/09 06:10:25 eivind Exp $
*/
#include "opt_ipx.h"
@@ -314,6 +314,7 @@ ipx_ctloutput(so, sopt)
struct socket *so;
struct sockopt *sopt;
{
+ register struct mbuf *m;
struct ipxpcb *ipxp = sotoipxpcb(so);
int mask, error, optval;
short soptval;
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index 13f336082c3b..e37a2f89f1e3 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -33,7 +33,7 @@
*
* @(#)spx_usrreq.h
*
- * $Id: spx_usrreq.c,v 1.21 1998/12/07 21:58:42 archie Exp $
+ * $Id: spx_usrreq.c,v 1.19 1998/05/01 18:30:02 bde Exp $
*/
#include <sys/param.h>
@@ -75,10 +75,12 @@ static struct spx_istat spx_istat;
static int spx_backoff[SPX_MAXRXTSHIFT+1] =
{ 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
+static void spx_abort(struct ipxpcb *ipxp);
static struct spxpcb *spx_close(struct spxpcb *cb);
static struct spxpcb *spx_disconnect(struct spxpcb *cb);
static struct spxpcb *spx_drop(struct spxpcb *cb, int errno);
static int spx_output(struct spxpcb *cb, struct mbuf *m0);
+static void spx_quench(struct ipxpcb *ipxp);
static int spx_reass(struct spxpcb *cb, struct spx *si);
static void spx_setpersist(struct spxpcb *cb);
static void spx_template(struct spxpcb *cb);
@@ -654,6 +656,19 @@ spx_ctlinput(cmd, arg_as_sa, dummy)
break;
}
}
+/*
+ * When a source quench is received, close congestion window
+ * to one packet. We will gradually open it again as we proceed.
+ */
+static void
+spx_quench(ipxp)
+ struct ipxpcb *ipxp;
+{
+ struct spxpcb *cb = ipxtospxpcb(ipxp);
+
+ if (cb != NULL)
+ cb->s_cwnd = CUNIT;
+}
#ifdef notdef
int
@@ -1143,6 +1158,7 @@ spx_ctloutput(so, sopt)
struct socket *so;
struct sockopt *sopt;
{
+ register struct mbuf *m;
struct ipxpcb *ipxp = sotoipxpcb(so);
register struct spxpcb *cb;
int mask, error;
@@ -1736,6 +1752,14 @@ spx_drop(cb, errno)
return (spx_close(cb));
}
+static void
+spx_abort(ipxp)
+ struct ipxpcb *ipxp;
+{
+
+ spx_close((struct spxpcb *)ipxp->ipxp_pcb);
+}
+
/*
* Fast timeout routine for processing delayed acks
*/
diff --git a/sys/netkey/key.c b/sys/netkey/key.c
index 0116b2a23ec3..debf1cb1c313 100644
--- a/sys/netkey/key.c
+++ b/sys/netkey/key.c
@@ -164,6 +164,7 @@ extern struct sockaddr key_addr;
{ x += ROUNDUP(n); }
static int addrpart_equal __P((struct sockaddr *, struct sockaddr *));
+static int key_freetables __P((void));
static int key_gethashval __P((char *, int, int));
static int key_createkey __P((char *, u_int, struct sockaddr *,
struct sockaddr *, u_int32_t, u_int));
@@ -446,7 +447,6 @@ key_inittables()
return 0;
}
-#ifdef notyet
static int
key_freetables()
{
@@ -456,7 +456,6 @@ key_freetables()
key_acquirelist = NULL;
return 0;
}
-#endif
/*----------------------------------------------------------------------
* key_gethashval():
@@ -2255,27 +2254,24 @@ static int
my_addr(sa)
struct sockaddr *sa;
{
+ struct in6_ifaddr *i6a = 0;
+ struct in_ifaddr *ia = 0;
+
switch(sa->sa_family) {
#ifdef INET6
- case AF_INET6: {
- struct in6_ifaddr *i6a = 0;
-
- for (i6a = in6_ifaddr; i6a; i6a = i6a->ia_next) { /*XXX*/
- if (IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)sa)->sin6_addr,
- &i6a->ia_addr.sin6_addr))
- return(1);
- }
+ case AF_INET6:
+ for (i6a = in6_ifaddr; i6a; i6a = i6a->ia_next) { /*XXX*/
+ if (IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)sa)->sin6_addr,
+ &i6a->ia_addr.sin6_addr))
+ return(1);
}
break;
#endif /* INET6 */
- case AF_INET: {
- struct in_ifaddr *ia = 0;
-
- for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next) {
- if (((struct sockaddr_in *)sa)->sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- return(1);
- }
+ case AF_INET:
+ for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next) {
+ if (((struct sockaddr_in *)sa)->sin_addr.s_addr ==
+ ia->ia_addr.sin_addr.s_addr)
+ return(1);
}
break;
}
@@ -2292,6 +2288,7 @@ key_output(m, so)
struct socket *so;
{
struct key_msghdr *km = 0;
+ caddr_t cp, cplimit;
int len;
int error = 0;
int dstfamily = 0;
diff --git a/sys/netkey/key_debug.c b/sys/netkey/key_debug.c
index a596c0c72a50..31f14cacea1e 100644
--- a/sys/netkey/key_debug.c
+++ b/sys/netkey/key_debug.c
@@ -436,6 +436,7 @@ void dump_mchain(m)
void dump_tcpdump(m)
struct mbuf *m;
{
+ struct mbuf *walker;
int i, j, count;
for (i = count = 0; m && (i < 10); m = m->m_next, i++) {
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c
index e7fca3d84b48..8bc971d636aa 100644
--- a/sys/netnatm/natm.c
+++ b/sys/netnatm/natm.c
@@ -144,6 +144,7 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
struct natmpcb *npcb;
struct sockaddr_natm *snatm;
struct atm_pseudoioctl api;
+ struct atm_pseudohdr *aph;
struct ifnet *ifp;
int error = 0;
int s2, s = SPLSOFTNET();
@@ -225,10 +226,13 @@ static int
natm_usr_disconnect(struct socket *so)
{
struct natmpcb *npcb;
+ struct sockaddr_natm *snatm;
struct atm_pseudoioctl api;
+ struct atm_pseudohdr *aph;
struct ifnet *ifp;
int error = 0;
int s2, s = SPLSOFTNET();
+ int proto = so->so_proto->pr_protocol;
npcb = (struct natmpcb *) so->so_pcb;
if (npcb == NULL) {
@@ -333,8 +337,8 @@ natm_usr_peeraddr(struct socket *so, struct sockaddr **nam)
bzero(snatm, sizeof(*snatm));
snatm->snatm_len = sizeof(*snatm);
snatm->snatm_family = AF_NATM;
- snprintf(snatm->snatm_if, sizeof(snatm->snatm_if),
- "%s%d", npcb->npcb_ifp->if_name, npcb->npcb_ifp->if_unit);
+ sprintf(snatm->snatm_if, "%s%d", npcb->npcb_ifp->if_name,
+ npcb->npcb_ifp->if_unit);
snatm->snatm_vci = npcb->npcb_vci;
snatm->snatm_vpi = npcb->npcb_vpi;
*nam = dup_sockaddr((struct sockaddr *)snatm, 0);
@@ -623,8 +627,8 @@ struct proc *p;
#if defined(__NetBSD__) || defined(__OpenBSD__)
bcopy(npcb->npcb_ifp->if_xname, snatm->snatm_if, sizeof(snatm->snatm_if));
#elif defined(__FreeBSD__)
- snprintf(snatm->snatm_if, sizeof(snatm->snatm_if),
- "%s%d", npcb->npcb_ifp->if_name, npcb->npcb_ifp->if_unit);
+ sprintf(snatm->snatm_if, "%s%d", npcb->npcb_ifp->if_name,
+ npcb->npcb_ifp->if_unit);
#endif
snatm->snatm_vci = npcb->npcb_vci;
snatm->snatm_vpi = npcb->npcb_vpi;
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c
index 1efca259d536..c66e38466540 100644
--- a/sys/nfs/bootp_subr.c
+++ b/sys/nfs/bootp_subr.c
@@ -1,4 +1,4 @@
-/* $Id: bootp_subr.c,v 1.17 1998/12/04 22:54:54 archie Exp $ */
+/* $Id: bootp_subr.c,v 1.14 1998/08/18 00:32:47 bde Exp $ */
/*
* Copyright (c) 1995 Gordon Ross, Adam Glass
@@ -262,11 +262,13 @@ bootpc_call(call,reply,procp)
{
struct socket *so;
struct sockaddr_in *sin, sa;
+ struct mbuf *m;
struct uio auio;
struct sockopt sopt;
struct iovec aio;
struct timeval tv;
int error, on, len, rcvflg, secs, timo;
+ u_int tport;
/*
* Create socket and set its recieve timeout.
@@ -343,7 +345,7 @@ bootpc_call(call,reply,procp)
error = sosend(so, (struct sockaddr *)sin, &auio, NULL,
NULL, 0, procp);
if (error) {
- printf("bootpc_call: sosend: %d state %08x\n", error, (int)so->so_state);
+ printf("bootpc_call: sosend: %d\n", error);
goto out;
}
@@ -728,7 +730,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int j;
+ int i,j;
char *p;
unsigned int ip;
@@ -742,6 +744,7 @@ bootpc_init(void)
char lookup_path[24];
#define EALEN 6
+ unsigned char ea[EALEN];
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
@@ -771,8 +774,7 @@ bootpc_init(void)
bzero(&ireq, sizeof(ireq));
for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
{
- snprintf(ireq.ifr_name, sizeof(ireq.ifr_name),
- "%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(ireq.ifr_name, "%s%d", ifp->if_name, ifp->if_unit);
#ifdef BOOTP_WIRED_TO
if (strcmp(ireq.ifr_name, __XSTRING(BOOTP_WIRED_TO)) == 0)
break;
@@ -883,7 +885,7 @@ bootpc_init(void)
myaddr.sin_addr = reply.yiaddr;
ip = ntohl(myaddr.sin_addr.s_addr);
- snprintf(lookup_path, sizeof(lookup_path), "swap.%d.%d.%d.%d",
+ sprintf(lookup_path,"swap.%d.%d.%d.%d",
ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
printip("My ip address",myaddr.sin_addr);
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index c9737006f1d4..b8b97a4aa860 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
- * $Id: nfs_bio.c,v 1.64 1998/12/07 21:58:43 archie Exp $
+ * $Id: nfs_bio.c,v 1.61 1998/09/29 21:46:54 mckusick Exp $
*/
@@ -86,6 +86,7 @@ nfs_getpages(ap)
int i, error, nextoff, size, toff, npages, count;
struct uio uio;
struct iovec iov;
+ vm_page_t m;
vm_offset_t kva;
struct buf *bp;
struct vnode *vp;
@@ -197,6 +198,7 @@ nfs_putpages(ap)
{
struct uio uio;
struct iovec iov;
+ vm_page_t m;
vm_offset_t kva;
struct buf *bp;
int iomode, must_commit, i, error, npages, count;
@@ -277,8 +279,7 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
int getpages;
{
register struct nfsnode *np = VTONFS(vp);
- register int biosize, i;
- off_t diff;
+ register int biosize, diff, i;
struct buf *bp = 0, *rabp;
struct vattr vattr;
struct proc *p;
@@ -433,7 +434,7 @@ again:
bufsize = biosize;
if ((off_t)(lbn + 1) * biosize > np->n_size &&
(off_t)(lbn + 1) * biosize - np->n_size < biosize) {
- bufsize = np->n_size - (off_t)lbn * biosize;
+ bufsize = np->n_size - lbn * biosize;
bufsize = (bufsize + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
}
bp = nfs_getcacheblk(vp, lbn, bufsize, p);
@@ -755,11 +756,11 @@ again:
if (uio->uio_offset + n > np->n_size) {
np->n_size = uio->uio_offset + n;
np->n_flag |= NMODIFIED;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
}
bufsize = biosize;
- if ((off_t)(lbn + 1) * biosize > np->n_size) {
- bufsize = np->n_size - (off_t)lbn * biosize;
+ if ((lbn + 1) * biosize > np->n_size) {
+ bufsize = np->n_size - lbn * biosize;
bufsize = (bufsize + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
}
bp = nfs_getcacheblk(vp, lbn, bufsize, p);
@@ -771,8 +772,9 @@ again:
}
np->n_flag |= NMODIFIED;
- if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size)
- bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE;
+ if ((bp->b_blkno * DEV_BSIZE) + bp->b_dirtyend > np->n_size) {
+ bp->b_dirtyend = np->n_size - (bp->b_blkno * DEV_BSIZE);
+ }
/*
* If the new write will leave a contiguous dirty
@@ -903,10 +905,10 @@ nfs_getcacheblk(vp, bn, size, p)
} else
bp = getblk(vp, bn, size, 0, 0);
- if (vp->v_type == VREG) {
+ if( vp->v_type == VREG) {
int biosize;
biosize = mp->mnt_stat.f_iosize;
- bp->b_blkno = bn * (biosize / DEV_BSIZE);
+ bp->b_blkno = (bn * biosize) / DEV_BSIZE;
}
return (bp);
@@ -1216,13 +1218,13 @@ nfs_doio(bp, cr, p)
bp->b_error = error;
}
} else {
- if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size)
- bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE;
+ if (((bp->b_blkno * DEV_BSIZE) + bp->b_dirtyend) > np->n_size)
+ bp->b_dirtyend = np->n_size - (bp->b_blkno * DEV_BSIZE);
if (bp->b_dirtyend > bp->b_dirtyoff) {
io.iov_len = uiop->uio_resid = bp->b_dirtyend
- bp->b_dirtyoff;
- uiop->uio_offset = (off_t)bp->b_blkno * DEV_BSIZE
+ uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE
+ bp->b_dirtyoff;
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c
index ae6a14a2fc07..a9464dc7b265 100644
--- a/sys/nfs/nfs_nqlease.c
+++ b/sys/nfs/nfs_nqlease.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95
- * $Id: nfs_nqlease.c,v 1.38 1998/09/05 15:17:33 bde Exp $
+ * $Id: nfs_nqlease.c,v 1.37 1998/05/31 20:08:52 peter Exp $
*/
@@ -1117,8 +1117,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p)
}
} else if ((np->n_expiry - NQ_RENEWAL) < time_second) {
if ((np->n_flag & (NQNFSWRITE | NQNFSNONCACHE))
- == NQNFSWRITE &&
- !TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
+ == NQNFSWRITE && vp->v_dirtyblkhd.lh_first &&
vget(vp, LK_EXCLUSIVE, p) == 0) {
nmp->nm_inprog = vp;
if (vpid == vp->v_id &&
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 346c4fc58c7c..d70121354537 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95
- * $Id: nfs_serv.c,v 1.71 1998/12/08 23:11:24 eivind Exp $
+ * $Id: nfs_serv.c,v 1.68 1998/05/31 20:08:52 peter Exp $
*/
/*
@@ -1776,7 +1776,8 @@ out:
vrele(nd.ni_dvp);
else
vput(nd.ni_dvp);
- vput(vp);
+ if (vp != NULLVP);
+ vput(vp);
}
if (dirp && v3) {
diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp);
@@ -3121,7 +3122,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
for_ret = VOP_GETATTR(vp, &bfor, cred, procp);
if (vp->v_object &&
(vp->v_object->flags & OBJ_MIGHTBEDIRTY)) {
- vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC);
+ vm_object_page_clean(vp->v_object, 0, 0, TRUE);
}
error = VOP_FSYNC(vp, cred, MNT_WAIT, procp);
aft_ret = VOP_GETATTR(vp, &aft, cred, procp);
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 8c1b812af165..11ac51899598 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_socket.c,v 1.48 1998/12/07 21:58:44 archie Exp $
+ * $Id: nfs_socket.c,v 1.45 1998/09/07 05:42:15 bde Exp $
*/
/*
@@ -191,6 +191,7 @@ nfs_connect(nmp, rep)
int s, error, rcvreserve, sndreserve;
struct sockaddr *saddr;
struct sockaddr_in *sin;
+ struct mbuf *m;
u_int16_t tport;
struct proc *p = &proc0; /* only used for socreate and sobind */
@@ -403,11 +404,11 @@ nfs_safedisconnect(nmp)
* For the client side:
* - return EINTR if the RPC is terminated, 0 otherwise
* - set R_MUSTRESEND if the send fails for any reason
- * - do any cleanup required by recoverable socket errors (?)
+ * - do any cleanup required by recoverable socket errors (???)
* For the server side:
* - return EINTR or ERESTART if interrupted by a signal
* - return EPIPE if a connection is lost for connection based sockets (TCP...)
- * - do any cleanup required by recoverable socket errors (?)
+ * - do any cleanup required by recoverable socket errors (???)
*/
int
nfs_send(so, nam, top, rep)
@@ -469,7 +470,7 @@ nfs_send(so, nam, top, rep)
log(LOG_INFO, "nfsd send error %d\n", error);
/*
- * Handle any recoverable (soft) socket errors here. (?)
+ * Handle any recoverable (soft) socket errors here. (???)
*/
if (error != EINTR && error != ERESTART &&
error != EWOULDBLOCK && error != EPIPE)
@@ -2231,9 +2232,7 @@ nfsrv_dorec(slp, nfsd, ndp)
nd->nd_dpos = mtod(m, caddr_t);
error = nfs_getreq(nd, nfsd, TRUE);
if (error) {
- if (nam) {
- FREE(nam, M_SONAME);
- }
+ FREE(nam, M_SONAME);
free((caddr_t)nd, M_NFSRVDESC);
return (error);
}
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index b3eec2408a2e..346e9e619199 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
- * $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
+ * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
*/
/*
@@ -208,8 +208,7 @@ static u_char nfsrv_v2errmap[ELAST] = {
NFSERR_NOTEMPTY, NFSERR_IO, NFSERR_IO, NFSERR_DQUOT, NFSERR_STALE,
NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
- NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
- NFSERR_IO /* << Last is 86 */
+ NFSERR_IO, NFSERR_IO, NFSERR_IO /* << Last is 83 */
};
/*
@@ -651,6 +650,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
register int i;
struct mbuf *mreq, *mb2;
int siz, grpsiz, authsiz;
+ static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@@ -1377,7 +1377,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
} else
np->n_size = vap->va_size;
}
@@ -1463,7 +1463,7 @@ nfs_getattrcache(vp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
} else
np->n_size = vap->va_size;
}
@@ -2129,8 +2129,8 @@ loop:
if (vp->v_mount != mp) /* Paranoia */
goto loop;
nvp = vp->v_mntvnodes.le_next;
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
== (B_DELWRI | B_NEEDCOMMIT))
bp->b_flags &= ~B_NEEDCOMMIT;
@@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
if (vp == NULL || vp->v_type != VREG)
return (1);
return (vfs_object_create(vp, curproc,
- curproc ? curproc->p_ucred : NULL));
+ curproc ? curproc->p_ucred : NULL, 1));
}
/*
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 8b85b9b22bd9..abf3383e709d 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_syscalls.c,v 1.43 1998/09/01 02:31:52 luoqi Exp $
+ * $Id: nfs_syscalls.c,v 1.42 1998/08/23 03:07:16 wollman Exp $
*/
#include <sys/param.h>
@@ -357,6 +357,7 @@ nfssvc_addsock(fp, mynam, p)
struct sockaddr *mynam;
struct proc *p;
{
+ register struct mbuf *m;
register int siz;
register struct nfssvc_sock *slp;
register struct socket *so;
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index cc4775b61866..23e30c00a956 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.78 1998/10/31 15:31:26 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.76 1998/09/07 13:17:05 bde Exp $
*/
#include <sys/param.h>
@@ -486,7 +486,7 @@ nfs_mountroot(mp)
nd->root_args.fh = nd->root_fh;
nd->root_args.fhsize = nd->root_fhsize;
l = ntohl(nd->root_saddr.sin_addr.s_addr);
- snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s",
+ sprintf(buf,"%ld.%ld.%ld.%ld:%s",
(l >> 24) & 0xff, (l >> 16) & 0xff,
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->root_hostnam);
printf("NFS ROOT: %s\n",buf);
@@ -512,7 +512,7 @@ nfs_mountroot(mp)
nd->swap_args.fh = nd->swap_fh;
nd->swap_args.fhsize = nd->swap_fhsize;
l = ntohl(nd->swap_saddr.sin_addr.s_addr);
- snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s",
+ sprintf(buf,"%ld.%ld.%ld.%ld:%s",
(l >> 24) & 0xff, (l >> 16) & 0xff,
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->swap_hostnam);
printf("NFS SWAP: %s\n",buf);
@@ -1066,7 +1066,7 @@ loop:
*/
if (vp->v_mount != mp)
goto loop;
- if (VOP_ISLOCKED(vp) || TAILQ_EMPTY(&vp->v_dirtyblkhd) ||
+ if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL ||
waitfor == MNT_LAZY)
continue;
if (vget(vp, LK_EXCLUSIVE, p))
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index c97267a42aee..e4917c1d5616 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.115 1998/12/25 10:34:27 dfr Exp $
+ * $Id: nfs_vnops.c,v 1.108 1998/09/29 23:29:48 mckusick Exp $
*/
@@ -60,7 +60,6 @@
#include <sys/fcntl.h>
#include <sys/lockf.h>
#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -248,18 +247,6 @@ struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON];
int nfs_numasync = 0;
#define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1))
-static int nfsaccess_cache_timeout = 2;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
- &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
-
-static int nfsaccess_cache_hits;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD,
- &nfsaccess_cache_hits, 0, "NFS ACCESS cache hit count");
-
-static int nfsaccess_cache_fills;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_fills, CTLFLAG_RD,
- &nfsaccess_cache_fills, 0, "NFS ACCESS cache fill count");
-
/*
* nfs access vnode op.
* For nfs version 2, just return ok. File accesses may fail later.
@@ -282,9 +269,8 @@ nfs_access(ap)
caddr_t bpos, dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
- u_int32_t mode, rmode, wmode;
+ u_int32_t mode, rmode;
int v3 = NFS_ISV3(vp);
- struct nfsnode *np = VTONFS(vp);
/*
* Disallow write attempts on filesystems mounted read-only;
@@ -302,14 +288,18 @@ nfs_access(ap)
}
}
/*
- * For nfs v3, check to see if we have done this recently, and if
- * so return our cached result instead of making an ACCESS call.
- * If not, do an access rpc, otherwise you are stuck emulating
+ * For nfs v3, do an access rpc, otherwise you are stuck emulating
* ufs_access() locally using the vattr. This may not be correct,
* since the server may apply other access criteria such as
- * client uid-->server uid mapping that we do not know about.
+ * client uid-->server uid mapping that we do not know about, but
+ * this is better than just returning anything that is lying about
+ * in the cache.
*/
if (v3) {
+ nfsstats.rpccnt[NFSPROC_ACCESS]++;
+ nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
+ nfsm_fhtom(vp, v3);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
mode = NFSV3ACCESS_READ;
else
@@ -326,54 +316,21 @@ nfs_access(ap)
if (ap->a_mode & VEXEC)
mode |= NFSV3ACCESS_LOOKUP;
}
- /* XXX safety belt, only make blanket request if caching */
- if (nfsaccess_cache_timeout > 0) {
- wmode = NFSV3ACCESS_READ | NFSV3ACCESS_MODIFY |
- NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE |
- NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP;
- } else {
- wmode = mode;
- }
-
- /*
- * Does our cached result allow us to give a definite yes to
- * this request?
- */
- if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) &&
- (ap->a_cred->cr_uid == np->n_modeuid) &&
- ((np->n_mode & mode) == mode)) {
- nfsaccess_cache_hits++;
- } else {
+ *tl = txdr_unsigned(mode);
+ nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
+ nfsm_postop_attr(vp, attrflag);
+ if (!error) {
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
+ rmode = fxdr_unsigned(u_int32_t, *tl);
/*
- * Either a no, or a don't know. Go to the wire.
+ * The NFS V3 spec does not clarify whether or not
+ * the returned access bits can be a superset of
+ * the ones requested, so...
*/
- nfsstats.rpccnt[NFSPROC_ACCESS]++;
- nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
- nfsm_fhtom(vp, v3);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
- *tl = txdr_unsigned(wmode);
- nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
- nfsm_postop_attr(vp, attrflag);
- if (!error) {
- nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
- rmode = fxdr_unsigned(u_int32_t, *tl);
- /*
- * The NFS V3 spec does not clarify whether or not
- * the returned access bits can be a superset of
- * the ones requested, so...
- */
- if ((rmode & mode) != mode) {
- error = EACCES;
- } else if (nfsaccess_cache_timeout > 0) {
- /* cache the result */
- nfsaccess_cache_fills++;
- np->n_mode = rmode;
- np->n_modeuid = ap->a_cred->cr_uid;
- np->n_modestamp = time_second;
- }
- }
- nfsm_reqdone;
+ if ((rmode & mode) != mode)
+ error = EACCES;
}
+ nfsm_reqdone;
return (error);
} else {
if (error = nfsspec_access(ap))
@@ -665,7 +622,7 @@ nfs_setattr(ap)
*/
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
- vnode_pager_setsize(vp, vap->va_size);
+ vnode_pager_setsize(vp, (u_long)vap->va_size);
if (np->n_flag & NMODIFIED) {
if (vap->va_size == 0)
error = nfs_vinvalbuf(vp, 0,
@@ -674,7 +631,7 @@ nfs_setattr(ap)
error = nfs_vinvalbuf(vp, V_SAVE,
ap->a_cred, ap->a_p, 1);
if (error) {
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
return (error);
}
}
@@ -690,7 +647,7 @@ nfs_setattr(ap)
error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_p);
if (error && vap->va_size != VNOVAL) {
np->n_size = np->n_vattr.va_size = tsize;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
}
return (error);
}
@@ -718,7 +675,64 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
- nfsm_v3attrbuild(vap, TRUE);
+ if (vap->va_mode != (mode_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_mode);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_uid != (uid_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_uid);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_gid != (gid_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_gid);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_size != VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ txdr_hyper(&vap->va_size, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_atime.tv_sec != VNOVAL) {
+ if (vap->va_atime.tv_sec != time_second) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
+ txdr_nfsv3time(&vap->va_atime, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
+ }
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
+ }
+ if (vap->va_mtime.tv_sec != VNOVAL) {
+ if (vap->va_mtime.tv_sec != time_second) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
+ txdr_nfsv3time(&vap->va_mtime, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
+ }
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
+ }
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
@@ -1204,6 +1218,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
register struct vattr *vap;
{
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1235,9 +1250,10 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
- nfsm_v3attrbuild(vap, FALSE);
+ sp3 = (struct nfsv3_sattr *)tl;
+ nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
@@ -1324,6 +1340,7 @@ nfs_create(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1356,18 +1373,20 @@ again:
if (v3) {
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
- *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
- nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
+ *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
+ nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
#ifdef INET
- if (!TAILQ_EMPTY(&in_ifaddrhead))
- *tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
- else
+ if (!TAILQ_EMPTY(&in_ifaddrhead))
+ *tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
+ else
#endif
- *tl++ = create_verf;
- *tl = ++create_verf;
+ *tl++ = create_verf;
+ *tl = ++create_verf;
} else {
- *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
- nfsm_v3attrbuild(vap, FALSE);
+ *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
+ nfsm_build(tl, u_int32_t *, NFSX_V3SRVSATTR);
+ sp3 = (struct nfsv3_sattr *)tl;
+ nfsm_v3sattr(sp3, vap);
}
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -1586,7 +1605,6 @@ nfs_rename(ap)
cache_purge(tdvp);
cache_purge(fdvp);
}
-
out:
if (tdvp == tvp)
vrele(tdvp);
@@ -1741,6 +1759,7 @@ nfs_symlink(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1757,7 +1776,8 @@ nfs_symlink(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_v3attrbuild(vap, FALSE);
+ nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
+ nfsm_v3sattr(sp3, vap);
}
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
@@ -1806,6 +1826,7 @@ nfs_mkdir(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1830,7 +1851,8 @@ nfs_mkdir(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
if (v3) {
- nfsm_v3attrbuild(vap, FALSE);
+ nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
+ nfsm_v3sattr(sp3, vap);
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
@@ -2733,8 +2755,8 @@ again:
* Count up how many buffers waiting for a commit.
*/
bveccount = 0;
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
== (B_DELWRI | B_NEEDCOMMIT))
bveccount++;
@@ -2760,8 +2782,8 @@ again:
bvec = bvec_on_stack;
bvecsize = NFS_COMMITBVECSIZ;
}
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if (bvecpos >= bvecsize)
break;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
@@ -2858,8 +2880,8 @@ again:
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if (bp->b_flags & B_BUSY) {
if (waitfor != MNT_WAIT || passone)
continue;
@@ -2913,7 +2935,7 @@ loop:
}
}
}
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) && commit) {
+ if (vp->v_dirtyblkhd.lh_first && commit) {
goto loop;
}
}
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 3692b7b1375b..75158edd074c 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.21 1998/05/31 20:08:57 peter Exp $
+ * $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@@ -235,68 +235,17 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-/* If full is true, set all fields, otherwise just set mode and time fields */
-#define nfsm_v3attrbuild(a, full) \
- { if ((a)->va_mode != (mode_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_mode); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_uid != (uid_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_uid); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_gid != (gid_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_gid); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_size != VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- txdr_hyper(&(a)->va_size, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((a)->va_atime.tv_sec != VNOVAL) { \
- if ((a)->va_atime.tv_sec != time_second) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
- txdr_nfsv3time(&(a)->va_atime, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
- } \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
- } \
- if ((a)->va_mtime.tv_sec != VNOVAL) { \
- if ((a)->va_mtime.tv_sec != time_second) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
- txdr_nfsv3time(&(a)->va_mtime, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
- } \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
- } \
+#define nfsm_v3sattr(s, a) \
+ { (s)->sa_modetrue = nfs_true; \
+ (s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
+ (s)->sa_sizefalse = nfs_false; \
+ (s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+ txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
+ (s)->sa_mtimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+ txdr_nfsv3time(&(a)->va_mtime, &(s)->sa_mtime); \
}
-
#define nfsm_strsiz(s,m) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h
index 49adeb21e5c7..51f5d7864889 100644
--- a/sys/nfs/nfsnode.h
+++ b/sys/nfs/nfsnode.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsnode.h 8.9 (Berkeley) 5/14/95
- * $Id: nfsnode.h,v 1.27 1998/11/13 02:39:09 msmith Exp $
+ * $Id: nfsnode.h,v 1.25 1998/03/06 09:46:52 msmith Exp $
*/
@@ -93,9 +93,6 @@ struct nfsnode {
u_quad_t n_lrev; /* Modify rev for lease */
struct vattr n_vattr; /* Vnode attribute cache */
time_t n_attrstamp; /* Attr. cache timestamp */
- u_int32_t n_mode; /* ACCESS mode cache */
- uid_t n_modeuid; /* credentials having mode */
- time_t n_modestamp; /* mode cache timestamp */
time_t n_mtime; /* Prev modify time. */
time_t n_ctime; /* Prev create time. */
time_t n_expiry; /* Lease expiry time */
diff --git a/sys/pc98/boot/Makefile.inc b/sys/pc98/boot/Makefile.inc
index 88916943ec96..c02d4d7980f0 100644
--- a/sys/pc98/boot/Makefile.inc
+++ b/sys/pc98/boot/Makefile.inc
@@ -1,7 +1,5 @@
-# $Id: Makefile.inc,v 1.3 1998/03/14 02:33:54 kato Exp $
+# $Id: Makefile.inc,v 1.2 1998/03/14 02:29:24 kato Exp $
-BINDIR?= /usr/mdec
-CFLAGS+= -aout
.if exists(${.CURDIR}/../../../../include)
CFLAGS+= -nostdinc -I${.CURDIR}/../../../../include
.endif
diff --git a/sys/pc98/boot/biosboot/Makefile b/sys/pc98/boot/biosboot/Makefile
index 3a2640c950d3..cef96e0f6c15 100644
--- a/sys/pc98/boot/biosboot/Makefile
+++ b/sys/pc98/boot/biosboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.21 1999/01/03 05:03:46 kato Exp $
+# $Id: Makefile,v 1.18 1998/05/28 13:46:04 kato Exp $
#
PROG= boot
@@ -6,6 +6,7 @@ PROG= boot
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
SRCS+= probe_keyboard.c io.c disk.c sys.c
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -15,8 +16,7 @@ CFLAGS+= ${CWARNFLAGS}
# By default, if a serial port is going to be used as console, use COM1
# (aka /dev/ttyd0).
-#BOOT_COMCONSOLE_PORT?=0x30
-BOOT_COMCONSOLE_PORT?=0x238
+BOOT_COMCONSOLE_PORT?=0x30
BOOT_COMCONSOLE_CLK?=16
BOOT_COMCONSOLE_MODE=0x0c
CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
@@ -24,8 +24,8 @@ CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
-DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
# feature not implemented
-BOOT_COMCONSOLE_SPEED?=9600
-CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
+# BOOT_COMCONSOLE_SPEED?=9600
+# CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
# Enable code to take the default boot string from a fixed location on the
# disk. See nextboot(8) and README.386BSD for more info.
@@ -64,8 +64,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
@@ -86,11 +86,19 @@ boot2: boot.nohdr
all: boot1 boot2
install:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- boot1 boot2 ${DESTDIR}${BINDIR}/
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot1 ${DESTDIR}${BINDIR}/boot1
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot2 ${DESTDIR}${BINDIR}/boot2
+ for i in da fd wd od vn wfd ; do \
+ ( cd ${DESTDIR}${BINDIR} ; \
+ rm -f boot$${i} $${i}boot ; \
+ ln -s boot1 $${i}boot ; \
+ ln -s boot2 boot$${i} ; ) \
+ done
install-boothelp:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
${.CURDIR}/boot.help ${DESTDIR}/
.include <bsd.kern.mk>
diff --git a/sys/pc98/boot/biosboot/README.serial b/sys/pc98/boot/biosboot/README.serial
index bf47e6c4a470..5adbfa941233 100644
--- a/sys/pc98/boot/biosboot/README.serial
+++ b/sys/pc98/boot/biosboot/README.serial
@@ -105,7 +105,7 @@ To boot FreeBSD in serial console mode, you must do the following:
higher priority console). This replaces the COMCONSOLE option.
Example:
- device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
If the flags were not set, you need to run UserConfig (on a different
console) or recompile the kernel.
@@ -185,7 +185,7 @@ CAVEATS:
`flags' for the serial port you want to use. For example, if you
want to make COM2 the console:
- device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3
+ device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3 vector siointr
The console flags for the other serial ports should not be set.
o Recompile both the boot blocks and the kernel.
@@ -193,4 +193,4 @@ CAVEATS:
from the new kernel.
-$Id: README.serial,v 1.5 1998/04/07 15:33:47 kato Exp $
+$Id: README.serial,v 1.4 1997/06/09 13:44:03 kato Exp $
diff --git a/sys/pc98/boot/biosboot/serial.S b/sys/pc98/boot/biosboot/serial.S
index 2cc22465fe79..ebf1c5e9c0c9 100644
--- a/sys/pc98/boot/biosboot/serial.S
+++ b/sys/pc98/boot/biosboot/serial.S
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:34:26 rpd
- * $Id: serial.S,v 1.7 1998/01/02 09:29:15 kato Exp $
+ * $Id: serial.S,v 1.6 1997/07/14 12:34:01 kato Exp $
*/
/*
@@ -65,16 +65,17 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
-#if COMCONSOLE == 0x238
-#include "../../../i386/boot/biosboot/serial.S"
-#else
/*
* modified for PC-98 by KATO T. of Nagoya University
*/
.file "serial.S"
+#ifdef PC98
+#include <pc98/pc98/sioreg.h>
+#else
#include <i386/isa/sioreg.h>
+#endif
#include "asm.h"
.text
@@ -198,4 +199,3 @@ ENTRY(init_serial)
outb %al, %dx
ret
-#endif
diff --git a/sys/pc98/boot/kzipboot/Makefile b/sys/pc98/boot/kzipboot/Makefile
index beb70a5e56cc..f97824c40ed5 100644
--- a/sys/pc98/boot/kzipboot/Makefile
+++ b/sys/pc98/boot/kzipboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 1998/05/28 13:48:40 kato Exp $
+# $Id: Makefile,v 1.5 1998/03/07 15:48:11 kato Exp $
PROG= kztail.o kzhead.o
BINMODE = 444 # target is a relocatable object
@@ -22,9 +22,9 @@ CFLAGS+= -DKZIP -DCOMCONSOLE=0x30
CFLAGS+= -DPC98
kztail.o: ${OBJS_KZTAIL}
- $(LD) -aout -r -x -o kztail.o $(OBJS_KZTAIL)
+ $(LD) -r -x -o kztail.o $(OBJS_KZTAIL)
kzhead.o: ${OBJS_KZHEAD}
- $(LD) -aout -r -x -o kzhead.o $(OBJS_KZHEAD)
+ $(LD) -r -x -o kzhead.o $(OBJS_KZHEAD)
.include <bsd.prog.mk>
diff --git a/sys/pc98/boot/kzipboot/malloc.c b/sys/pc98/boot/kzipboot/malloc.c
index 052e5e357dbb..cf51be721a51 100644
--- a/sys/pc98/boot/kzipboot/malloc.c
+++ b/sys/pc98/boot/kzipboot/malloc.c
@@ -36,8 +36,9 @@
extern unsigned char *storage;
void *
-kzipmalloc(nbytes)
+malloc(nbytes, junk1, junk2) /* junk? not used */
size_t nbytes;
+ int junk1, junk2;
{
unsigned char *p = storage;
storage += nbytes;
@@ -50,7 +51,8 @@ kzipmalloc(nbytes)
}
void
-kzipfree(cp)
+free(cp, junk) /* junk not used */
void *cp;
+ int junk;
{
}
diff --git a/sys/pc98/boot/netboot/Makefile b/sys/pc98/boot/netboot/Makefile
index dad72fc3b15d..37bfd672afab 100644
--- a/sys/pc98/boot/netboot/Makefile
+++ b/sys/pc98/boot/netboot/Makefile
@@ -36,6 +36,7 @@ PROG= nb8390.com nb8390.rom
# Order is very important on the SRCS line for this prog
SRCS= start2.S main.c misc.c bootmenu.c rpc.c
+BINDIR= /usr/mdec
BINMODE= 555
CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} -DASK_BOOT
CFLAGS+= -DPC98
@@ -47,12 +48,10 @@ CFLAGS+= -DPC98
NS8390= -DINCLUDE_EGY -DNE_BASE=0xd0
CLEANFILES+= netboot.com
CLEANFILES+= makerom start2.ro 3c509.o ns8390.o
-ROMLDFLAGS= ${LDFLAGS} -aout -N -T ${RELOCADDR} -e _start -nostdlib
+ROMLDFLAGS= ${LDFLAGS} -N -T ${RELOCADDR} -e _start -nostdlib
NOSHARED= YES
NOMAN=
-SIZE= size -aout
STRIP=
-STRIPCMD= strip -aout
ROMSIZE=16384
RELOCADDR=0x90000
@@ -73,27 +72,27 @@ makerom: makerom.c
nb8390.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} ns8390.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb3c509.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} 3c509.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb8390.com: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} ns8390.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
nb3c509.com: start2.o ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} 3c509.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
diff --git a/sys/pc98/boot/rawboot/Makefile b/sys/pc98/boot/rawboot/Makefile
index 7aafe0de65fd..b549f42f07d8 100644
--- a/sys/pc98/boot/rawboot/Makefile
+++ b/sys/pc98/boot/rawboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/03/30 12:24:12 kato Exp $
+# $Id: Makefile,v 1.10 1998/03/14 02:30:01 kato Exp $
#
PROG= boot
@@ -9,6 +9,7 @@ SRCS+= probe_keyboard.c io.c disk.c sys.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-DPC98 \
@@ -68,8 +69,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/pc98/conf/GENERIC98 b/sys/pc98/conf/GENERIC98
index 87d05b6cdad8..90ae50c81a55 100644
--- a/sys/pc98/conf/GENERIC98
+++ b/sys/pc98/conf/GENERIC98
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC98,v 1.62 1999/01/16 13:20:42 kato Exp $
+# $Id: GENERIC98,v 1.49 1998/10/11 15:00:24 kato Exp $
# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
@@ -41,7 +41,7 @@ options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
#options EPSON_MEMWIN #EPSON memory window support
options UCONSOLE #Allow users to grab the console
-#options "LINE30"
+options "LINE30"
options FAILSAFE #Be conservative
options USERCONFIG #boot -c editor
options VISUAL_USERCONFIG #visual boot -c editor
@@ -58,26 +58,18 @@ options COM_MULTIPORT
config kernel root on wd0
-# To make an SMP kernel, the next two are needed
-#options SMP # Symmetric MultiProcessor Kernel
-#options APIC_IO # Symmetric (APIC) I/O
-# Optionally these may need tweaked, (defaults shown):
-#options NCPU=2 # number of CPUs
-#options NBUS=4 # number of busses
-#options NAPIC=1 # number of IO APICs
-#options NINTR=24 # number of INTs
-
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
disk fd2 at fdc0 drive 2
disk fd3 at fdc0 drive 3
+tape ft0 at fdc0 drive 4
# options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 9
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
disk wd0 at wdc0 drive 0
#disk wd1 at wdc0 drive 1
#disk wd2 at wdc0 drive 2
@@ -85,11 +77,12 @@ disk wd0 at wdc0 drive 0
options ATAPI # Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-device acd0 #IDE CD-ROM
+device wcd0 #IDE CD-ROM
-# A single entry for any of these controllers (ncr, ahb, ahc) is
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
# for any number of installed devices.
controller ncr0
+#controller amd0
controller ahc0
controller isp0
@@ -100,19 +93,19 @@ controller isp0
options BS_TARG_SAFEMODE
# PC-9801-92
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0
+controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
# SC-98
-# controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x10000
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
# HA-55BS2 and later
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x20000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
# ELECOM type
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x30000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
# SMIT
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
# Logitec LHA-20x
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x50000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
-#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000
+#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
controller scbus0
@@ -126,17 +119,11 @@ device cd0 #Only need one of these, the code dynamically grows
controller matcd0 at isa? port? bio
-# keyboard driver
-device pckbd0 at isa? port IO_KBD tty irq 1
-#options KBD_INSTALL_CDEV
-
-device gdc0 at isa?
-
-#pseudo-device splash
-
-device sc0 at isa? tty
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
-device npx0 at isa? port IO_NPX irq 8
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
#
# Laptop support (see LINT for more options)
@@ -148,36 +135,12 @@ device apm0 at isa? disable flags 0x31 # Advanced Power Management
#device pcic0 at card?
#device pcic1 at card?
-#
-# Serial Interface
-#
-# COM1
-device sio0 at isa? port "IO_COM1" tty irq 4
-# COM2 (2nd CCU)
-device sio1 at isa? port 0x238 tty irq 5 flags 0x12000000
-# PC-9861K, PC-9801-101, MDC-926Rs
-#device sio1 at isa? port "IO_COM2" tty irq 5 flags 0x01000000
-#device sio2 at isa? port "IO_COM3" tty irq 6 flags 0x02000000
-# PC-9801-120 (PnP off)
-#device sio1 at isa? port 0x8b0 tty irq 5 flags 0x11000000
-# MC-16550II, MC-RS98
-#device sio1 at isa? port 0xd2 tty irq 5 flags 0x14000101
-#device sio2 at isa? port 0x8d2 tty flags 0x14000101
-# RSB-2000, RSB-3000, B98-02
-#device sio1 at isa? port 0xb0 tty flags 0x15000101
-#device sio2 at isa? port 0xb1 tty flags 0x15000101
-# RSB-384
-#device sio1 at isa? port 0xb0 tty flags 0x16000000
-#device sio2 at isa? port 0xb1 tty flags 0x16000000
-# RSA-98III
-#device sio1 at isa? port 0x50e0 tty irq 5 flags 0x18000101
-#device sio2 at isa? port 0x51e0 tty flags 0x18000101
-# ESP98
-#options COM_ESP
-#device sio1 at isa? port 0x18b0 tty irq 5 flags 0x19000000
-
-device lpt0 at isa? port IO_LPT tty
-device mse0 at isa? port IO_MSE tty irq 13
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
@@ -185,14 +148,9 @@ device mse0 at isa? port IO_MSE tty irq 13
# revision 1.20 of this file.
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
#
# DP8390 NIC
@@ -210,30 +168,30 @@ device wb0
# fe0: RE1000/1000Plus
# fe1: C-NET(98)P2/C-NET(9N)E
#
-device ed0 at isa? port 0x00d0 net irq 6
-device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000
-device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000
-device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000
-device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000
-device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000
-device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000
-device ed6 at isa? port 0x0770 net irq 6 flags 0x800000
-device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000
-device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000
-
-device ep0 at isa? port 0x40d0 net irq 3
-device fe0 at isa? port 0x00d0 net irq 3
-device fe1 at isa? port 0x73d0 net irq 5
-device lnc0 at isa? port 0x03d0 net irq 6
-device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device fe1 at isa? port 0x73d0 net irq 5 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
#controller snd0
-#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
#device sbxvi0 at isa? drq 3
#device sbmidi0 at isa? port 0x80d2
#device opl0 at isa? port 0x28d2
-#device pcm0 at isa? port 0xa460 irq 12
-#device mss0 at isa? port 0xf40 irq 12 drq 1
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
pseudo-device loop
pseudo-device ether
@@ -248,8 +206,3 @@ pseudo-device gzip # Exec gzipped a.out's
# the costs of each syscall.
options KTRACE #kernel tracing
-# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be
-# aware of the legal and administrative consequences of enabling this
-# option. The number of devices determines the maximum number of
-# simultaneous BPF clients programs runnable.
-#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/pc98/conf/GENERICupgrade b/sys/pc98/conf/GENERICupgrade
new file mode 100644
index 000000000000..f07a434b2e7b
--- /dev/null
+++ b/sys/pc98/conf/GENERICupgrade
@@ -0,0 +1,204 @@
+#
+# GENERICupgrade (a copy of GENERIC98)
+#
+# This config file is used by the aout->elf transition build on systems
+# not running a 3.0-CURRENT kernel. Unless a kernel is built and installed
+# as part of the upgrade, the system will be hosed by the installation
+# of the 3.0 binaries and subsequent reboot. If the transition build is
+# being perfomed on a machine for which this config file is inappropriate,
+# it should be replaced with a suitable one prior to performing the upgrade.
+#
+# $Id: GENERICupgrade,v 1.3 1998/09/22 16:10:40 kato Exp $
+#
+
+# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
+
+machine "pc98"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident "GENERIC98"
+maxusers 32
+
+options "PC98" #PC98
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device
+options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
+#options EPSON_MEMWIN #EPSON memory window support
+options UCONSOLE #Allow users to grab the console
+options "LINE30"
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+options SYSVSHM
+options SYSVSEM
+options SYSVMSG
+
+options COM_MULTIPORT
+
+#
+# IBM-PC HDD support
+#options COMPAT_ATDISK
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+disk fd2 at fdc0 drive 2
+disk fd3 at fdc0 drive 3
+tape ft0 at fdc0 drive 4
+
+# options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
+disk wd0 at wdc0 drive 0
+#disk wd1 at wdc0 drive 1
+#disk wd2 at wdc0 drive 2
+#disk wd3 at wdc0 drive 3
+
+options ATAPI # Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahc0
+controller isp0
+
+#
+# WD33C93 SCSI card (55/92 like board)
+#
+
+options BS_TARG_SAFEMODE
+
+# PC-9801-92
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
+# SC-98
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
+# HA-55BS2 and later
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
+# ELECOM type
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
+# SMIT
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
+# Logitec LHA-20x
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
+
+#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+controller matcd0 at isa? port? bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
+
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+# ed8: C-NET(98)
+# ed9: C-NET(98)E/L
+# fe0: RE1000/1000Plus
+# fe1: C-NET(98)P2/C-NET(9N)E
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device fe1 at isa? port 0x73d0 net irq 5 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
+
+#controller snd0
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
diff --git a/sys/pc98/conf/Makefile.pc98 b/sys/pc98/conf/Makefile.pc98
index 2af781934392..f6ba1b258a01 100644
--- a/sys/pc98/conf/Makefile.pc98
+++ b/sys/pc98/conf/Makefile.pc98
@@ -3,7 +3,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.pc98,v 1.51 1999/01/18 11:00:29 kato Exp $
+# $Id: Makefile.pc98,v 1.41 1998/10/05 08:57:17 kato Exp $
#
# Makefile for FreeBSD
#
@@ -19,9 +19,9 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
-KERNFORMAT?= elf
+KERNFORMAT?= aout
#STD8X16FONT?= iso
@@ -77,8 +77,8 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_S= ${CC} -c -x ${ASM_CFLAGS} $<
PROFILE_C= ${CC} -c ${CFLAGS} $<
-GEN_CFILES= ${I386}/i386/genassym.c
-# setdef0.c and setdef1.c are intentionally
+GEN_CFILES= ${I386}/i386/genassym.c ${I386}/i386/gensetdefs.c
+# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally
# omitted from SYSTEM_CFILES. They include setdefs.h, a header which
# is generated from all of ${OBJS}. We don't want to have to compile
# everything just to do a make depend.
@@ -89,7 +89,14 @@ SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS}
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET}
-.if ${KERNFORMAT} == aout || ${KERNFORMAT} == aoutkld
+.if ${KERNFORMAT} == aout
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
+SYSTEM_LD= @${LD} -aout -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL= @echo rearranging symbols; \
+ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \
+ size -aout ${.TARGET} ; chmod 755 ${.TARGET}
+.endif
+.if ${KERNFORMAT} == aoutkld
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
SYSTEM_LD= @${LD} -aout -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @echo rearranging symbols; \
@@ -97,8 +104,9 @@ SYSTEM_LD_TAIL= @echo rearranging symbols; \
size -aout ${.TARGET} ; chmod 755 ${.TARGET}
.endif
.if ${KERNFORMAT} == elf
+# kld compatable export of symbols.
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} -elf -Bdynamic -T $S/i386/conf/kernel.script \
-export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
@@ -120,14 +128,9 @@ SYSTEM_DEP+= $S/i386/conf/kernel.script
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
- rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \
- kernel linterrs makelinks param.c setdef[01].c setdefs.h \
- symbols.exclude symbols.sort tags \
+ rm -f *.o *.so *.ko *.s eddep errs genassym gensetdefs kernel linterrs \
+ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
vers.c vnode_if.c vnode_if.h ${CLEAN}
#lint: /tmp param.c
@@ -151,21 +154,26 @@ locore.o: ${I386}/i386/locore.s assym.s
# This is a hack. BFD "optimizes" away dynamic mode if there are no
# dynamic references. We could probably do a '-Bforcedynamic' mode like
# in the a.out ld. For now, this works.
-hack.So: Makefile
+hack.so: Makefile
touch hack.c
- ${CC} -elf -shared -nostdlib hack.c -o hack.So
+ ${CC} -elf -shared -nostdlib hack.c -o hack.so
rm -f hack.c
.endif
-setdef0.o: setdef0.c setdefs.h
+setdef0.o: ${I386}/i386/setdef0.c setdefs.h
${NORMAL_C}
-setdef1.o: setdef1.c setdefs.h
+setdef1.o: ${I386}/i386/setdef1.c setdefs.h
${NORMAL_C}
-setdef0.c setdef1.c setdefs.h: ${OBJS}
- @echo generating linker set emulation glue for ELF
- @gensetdefs ${OBJS}
+setdefs.h: gensetdefs ${OBJS}
+ ./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} ${GEN_CFLAGS} gensetdefs.o -o ${.TARGET}
+
+gensetdefs.o: ${I386}/i386/gensetdefs.c
+ ${CC} -c ${GEN_CFLAGS} ${I386}/i386/gensetdefs.c
# this rule stops ./assym.s in .depend from causing problems
./assym.s: assym.s
@@ -180,7 +188,7 @@ genassym.o: ${I386}/i386/genassym.c
genassym: genassym.o
${CC} ${GEN_CFLAGS} genassym.o -o ${.TARGET}
-${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
+${SYSTEM_OBJS} genassym.o gensetdefs.o vers.o: opt_global.h
# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical.
depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND}
@@ -211,16 +219,6 @@ install:
echo "You must first build your kernel before trying to install." ; \
exit 1 ; \
fi
-.if ${KERNFORMAT} == "elf" && !defined(FORCE)
- @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \
- echo "WARNING: You are about to install an ELF kernel for the first time!" ; \
- echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \
- echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \
- echo "http://www.freebsd.org/~peter/elfday.html for information." ; \
- echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \
- exit 1 ; \
- fi
-.endif
.if exists(${DESTDIR}/kernel)
chflags noschg ${DESTDIR}/kernel
mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old
diff --git a/sys/pc98/conf/SMP-GENERIC98 b/sys/pc98/conf/SMP-GENERIC98
new file mode 100644
index 000000000000..6b08d04497a9
--- /dev/null
+++ b/sys/pc98/conf/SMP-GENERIC98
@@ -0,0 +1,230 @@
+#
+# GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: SMP-GENERIC98,v 1.4 1998/09/19 13:36:13 kato Exp $
+
+# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
+
+machine "pc98"
+# SMP does NOT support 386/486 CPUs.
+#cpu "I386_CPU"
+#cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident "SMP-GENERIC98"
+maxusers 32
+
+# Create a SMP capable kernel (mandatory options):
+options SMP # Symmetric MultiProcessor Kernel
+options APIC_IO # Symmetric (APIC) I/O
+
+# Optional, these are the defaults:
+#options NCPU=2 # number of CPUs
+#options NBUS=4 # number of busses
+#options NAPIC=1 # number of IO APICs
+#options NINTR=24 # number of INTs
+
+options "PC98" #PC98
+# SMP shouldn't need x87 emulation, disable by default.
+#options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options "LINE30"
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+options SYSVSHM
+options SYSVSEM
+options SYSVMSG
+
+options COM_MULTIPORT
+
+#
+# IBM-PC HDD support
+#options COMPAT_ATDISK
+#
+# FreeBSD(98)-current is a *TEST VERSION*.
+# It is highly recomended to compile with following options, and to
+# record the panic messages and the result of trace command brefore
+# reporting a problem.
+options DDB
+options DIAGNOSTIC
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+disk fd2 at fdc0 drive 2
+disk fd3 at fdc0 drive 3
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 4
+
+# options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
+disk wd0 at wdc0 drive 0
+#disk wd1 at wdc0 drive 1
+#disk wd2 at wdc0 drive 2
+#disk wd3 at wdc0 drive 3
+
+options ATAPI # Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahc0
+controller isp0
+
+
+#
+# SMP does not support bs driver: see /sys/i386/isa/bs/bsif.h
+#
+# WD33C93 SCSI card (55/92 like board)
+#
+
+options BS_TARG_SAFEMODE
+
+# PC-9801-92
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
+# SC-98
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
+# HA-55BS2 and later
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
+# ELECOM type
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
+# SMIT
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
+# Logitec LHA-20x
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
+
+controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+controller matcd0 at isa? port? bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
+
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+# ed8: C-NET(98)
+# ed9: C-NET(98)E/L
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0x03d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
+
+#controller snd0
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+#pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/pc98/conf/devices.pc98 b/sys/pc98/conf/devices.pc98
index cc10d30cd991..8b2641f04642 100644
--- a/sys/pc98/conf/devices.pc98
+++ b/sys/pc98/conf/devices.pc98
@@ -1,6 +1,6 @@
# This file tells what major numbers the various possible swap devices have.
#
-# $Id: devices.pc98,v 1.6 1998/09/15 14:10:55 kato Exp $
+# $Id: devices.pc98,v 1.5 1998/02/18 12:33:34 kato Exp $
#
wd 0
wfd 1
@@ -13,5 +13,5 @@ mcd 7
vn 15
scd 16
pcd 17
-acd 19
+wcd 19
wst 24
diff --git a/sys/pc98/conf/files.pc98 b/sys/pc98/conf/files.pc98
index 1a5d72d84f6a..7b2d2a07e48d 100644
--- a/sys/pc98/conf/files.pc98
+++ b/sys/pc98/conf/files.pc98
@@ -3,7 +3,7 @@
#
# modified for PC-9801
#
-# $Id: files.pc98,v 1.80 1999/01/18 08:38:07 kato Exp $
+# $Id: files.pc98,v 1.71 1998/09/20 10:50:18 kato Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -26,11 +26,6 @@ font8x16.o optional std8x16font \
no-implicit-rule before-depend \
clean "${STD8X16FONT}-8x16 font8x16.c"
#
-dev/fb/fb.c optional fb device-driver
-dev/fb/fb.c optional gdc device-driver
-dev/fb/splash.c optional splash
-dev/kbd/kbd.c optional kbd device-driver
-dev/kbd/kbd.c optional pckbd device-driver
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
i386/eisa/dpt_eisa.c optional eisa dpt device-driver
@@ -76,7 +71,7 @@ i386/i386/simplelock.s optional smp
i386/i386/support.s standard
i386/i386/swtch.s standard
i386/i386/sys_machdep.c standard
-i386/i386/trap.c standard
+pc98/i386/trap.c standard
pc98/i386/userconfig.c optional userconfig
i386/i386/vm_machdep.c standard
i386/i386/vm86.c optional vm86
@@ -109,6 +104,8 @@ i386/isa/adv_isa.c optional adv device-driver
i386/isa/aha_isa.c optional aha device-driver
#i386/isa/aic6360.c optional aic device-driver
i386/isa/aic_isa.c optional aic device-driver
+i386/isa/alog.c optional alog device-driver
+i386/isa/b004.c optional bqu device-driver
i386/isa/bt_isa.c optional bt device-driver
pc98/pc98/clock.c standard
i386/isa/cronyx.c optional cx device-driver
@@ -120,6 +117,7 @@ pc98/pc98/atcompat_diskslice.c optional compat_atdisk
i386/isa/elink.c optional ep device-driver
i386/isa/elink.c optional ie device-driver
pc98/pc98/fd.c optional fd device-driver
+i386/isa/ft.c optional ft device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/asc.c optional asc device-driver
i386/isa/gsc.c optional gsc device-driver
@@ -127,14 +125,14 @@ i386/isa/if_ar.c optional ar device-driver
i386/isa/if_cs.c optional cs device-driver
i386/isa/if_cx.c optional cx device-driver
pc98/pc98/if_ed.c optional ed device-driver
+i386/isa/if_eg.c optional eg device-driver
i386/isa/if_el.c optional el device-driver
i386/isa/if_ep.c optional ep device-driver
i386/isa/if_ex.c optional ex device-driver
-i386/isa/if_fe.c optional fe device-driver
+pc98/pc98/if_fe.c optional fe device-driver
i386/isa/if_ie.c optional ie device-driver
i386/isa/if_le.c optional le device-driver
i386/isa/if_lnc.c optional lnc device-driver
-i386/isa/if_rdp.c optional rdp device-driver
i386/isa/if_sr.c optional sr device-driver
i386/isa/if_wl.c optional wl device-driver
i386/isa/if_ze.c optional ze device-driver
@@ -145,25 +143,27 @@ i386/isa/intr_machdep.c standard
pc98/pc98/pc98.c optional isa device-driver
i386/isa/istallion.c optional stli device-driver
i386/isa/joy.c optional joy device-driver
-pc98/pc98/pc98kbd.c optional pckbd device-driver
+i386/isa/kbdio.c optional psm device-driver
+i386/isa/kbdio.c optional sc device-driver
+i386/isa/kbdio.c optional vt device-driver
i386/isa/loran.c optional loran device-driver
pc98/pc98/lpt.c optional lpt device-driver
i386/isa/labpc.c optional labpc device-driver
i386/isa/mcd.c optional mcd device-driver
pc98/pc98/mse.c optional mse device-driver
+#i386/isa/ncr5380.c optional nca device-driver
pc98/pc98/npx.c mandatory npx device-driver
-pc98/pc98/pc98gdc.c optional gdc device-driver
pc98/pc98/pcaudio.c optional pca device-driver
i386/isa/matcd/matcd.c optional matcd device-driver
i386/isa/pcibus.c optional pci device-driver
i386/isa/pcicx.c optional ze device-driver
i386/isa/pcicx.c optional zp device-driver
-#i386/isa/pcvt/pcvt_drv.c optional vt device-driver
-#i386/isa/pcvt/pcvt_ext.c optional vt device-driver
-#i386/isa/pcvt/pcvt_kbd.c optional vt device-driver
-#i386/isa/pcvt/pcvt_out.c optional vt device-driver
-#i386/isa/pcvt/pcvt_sup.c optional vt device-driver
-#i386/isa/pcvt/pcvt_vtf.c optional vt device-driver
+i386/isa/pcvt/pcvt_drv.c optional vt device-driver
+i386/isa/pcvt/pcvt_ext.c optional vt device-driver
+i386/isa/pcvt/pcvt_kbd.c optional vt device-driver
+i386/isa/pcvt/pcvt_out.c optional vt device-driver
+i386/isa/pcvt/pcvt_sup.c optional vt device-driver
+i386/isa/pcvt/pcvt_vtf.c optional vt device-driver
i386/isa/pnp.c optional pnp device-driver
i386/isa/prof_machdep.c optional profiling-routine
i386/isa/ppc.c optional ppc device-driver
@@ -173,15 +173,17 @@ i386/isa/random_machdep.c standard
i386/isa/rc.c optional rc device-driver
i386/isa/rp.c optional rp device-driver
i386/isa/scd.c optional scd device-driver
+#i386/isa/seagate.c optional sea device-driver
i386/isa/si.c optional si device-driver
i386/isa/si2_z280.c optional si device-driver
i386/isa/si3_t225.c optional si device-driver
pc98/pc98/sio.c optional sio device-driver
-i386/isa/snd/sound.c optional pcm device-driver
-i386/isa/snd/dmabuf.c optional pcm device-driver
-i386/isa/snd/ad1848.c optional pcm device-driver
-i386/isa/snd/sb_dsp.c optional pcm device-driver
-i386/isa/snd/clones.c optional pcm device-driver
+#i386/isa/snd/sound.c optional pcm device-driver
+#i386/isa/snd/dmabuf.c optional pcm device-driver
+#i386/isa/snd/ad1848.c optional pcm device-driver
+#i386/isa/snd/sb_dsp.c optional pcm device-driver
+#i386/isa/snd/clones.c optional pcm device-driver
+i386/isa/sound/pcm86.c optional pcm device-driver
i386/isa/sound/dev_table.c optional snd device-driver
i386/isa/sound/soundcard.c optional snd device-driver
i386/isa/sound/sound_switch.c optional snd device-driver
@@ -247,17 +249,20 @@ i386/isa/spigot.c optional spigot device-driver
pc98/pc98/spkr.c optional speaker device-driver
i386/isa/stallion.c optional stl device-driver
pc98/pc98/syscons.c optional sc device-driver
-pc98/pc98/scvidctl.c optional sc device-driver
+#i386/isa/scvidctl.c optional sc device-driver
#i386/isa/scvesactl.c optional sc device-driver
#i386/isa/videoio.c optional sc device-driver
#i386/isa/vesa.c optional sc device-driver
i386/isa/tw.c optional tw device-driver
+#i386/isa/ultra14f.c optional uha device-driver
pc98/pc98/wd.c optional wdc device-driver
pc98/pc98/wd.c optional wd device-driver
i386/isa/atapi.c optional atapi device-driver
i386/isa/atapi-cd.c optional acd device-driver
+i386/isa/wcd.c optional wcd device-driver
i386/isa/wfd.c optional wfd device-driver
i386/isa/wst.c optional wst device-driver
+i386/isa/wd7000.c optional wds device-driver
i386/isa/wt.c optional wt device-driver
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
@@ -273,30 +278,6 @@ i386/linux/linux_stats.c optional compat_linux
i386/linux/linux_sysent.c optional compat_linux
i386/linux/linux_sysvec.c optional compat_linux
i386/linux/linux_util.c optional compat_linux
-i4b/layer1/i4b_isic.c optional isic device-driver
-i4b/layer1/i4b_isic_isa.c optional isic device-driver
-i4b/layer1/i4b_isic_pnp.c optional isic device-driver
-i4b/layer1/i4b_isic_pci.c optional isic device-driver
-i4b/layer1/i4b_isic_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_isac.c optional isic device-driver
-i4b/layer1/i4b_hscx.c optional isic device-driver
-i4b/layer1/i4b_l1.c optional isic device-driver
-i4b/layer1/i4b_l1fsm.c optional isic device-driver
-i4b/layer1/i4b_bchan.c optional isic device-driver
-i4b/layer1/i4b_tel_s08.c optional isic device-driver
-i4b/layer1/i4b_tel_s016.c optional isic device-driver
-i4b/layer1/i4b_tel_s0163.c optional isic device-driver
-i4b/layer1/i4b_tel_s0P.c optional isic device-driver
-i4b/layer1/i4b_ctx_s0P.c optional isic device-driver
-i4b/layer1/i4b_avm_a1.c optional isic device-driver
-i4b/layer1/i4b_avm_fritz_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_usr_sti.c optional isic device-driver
-i4b/layer1/i4b_itk_ix1.c optional isic device-driver
-i4b/layer1/i4b_drn_ngo.c optional isic device-driver
-i4b/layer1/i4b_sws.c optional isic device-driver
-i4b/layer1/i4b_dynalink.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1i.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1p.c optional isic device-driver
libkern/bcd.c standard
libkern/divdi3.c standard
libkern/inet_ntoa.c standard
@@ -351,5 +332,4 @@ gnu/i386/fpemul/wm_sqrt.s optional gpl_math_emulate
gnu/i386/isa/dgb.c optional dgb device-driver
gnu/i386/isa/dgm.c optional dgm device-driver
gnu/i386/isa/sound/awe_wave.c optional awe device-driver
-pci/es1370.c optional pcm device-driver
#pci/ide_pci.c optional wd device-driver
diff --git a/sys/pc98/conf/majors.pc98 b/sys/pc98/conf/majors.pc98
index 90ffbefccbce..2dce44c1a47f 100644
--- a/sys/pc98/conf/majors.pc98
+++ b/sys/pc98/conf/majors.pc98
@@ -1,4 +1,4 @@
-$Id: majors.pc98,v 1.48 1999/01/16 11:36:28 kato Exp $
+$Id: majors.pc98,v 1.40 1998/09/15 14:10:56 kato Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -32,7 +32,7 @@ blkdev name comments
16 scd Sony CDROM interface
17 matcd Matsushita/Panasonic/Creative(SB) CDROM interface
18 ata "device independent" ATA/IDE driver
-19 acdb ATAPI CDROM client of "ata"
+19 wcdb ATAPI CDROM client of "ata"
21 ccd concatenated disk
22 gd Geometry disk.
24 wstb ATAPI tape client of "ata"
@@ -40,9 +40,6 @@ blkdev name comments
26 sw VM internal swap device
27 myx Mylex RAID (ulf@alameda.net)
28 fla M-Systems DiskOnChip(r)
-29 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-100 ?? entries from 100-127 are reserved for local use
-127 ?? entries from 100-127 are reserved for local use
chrdev name comments
0 cn console
@@ -114,7 +111,7 @@ chrdev name comments
66 labpc National Instruments LabPC
67 meteor Matrox Meteor video capture
68 si Specialix SI/XIO (peter@freebsd.org)
-69 acd ATAPI CDROM client of "ata"
+69 wcd ATAPI CDROM client of "ata"
71 asc AmiScan driver
72 stl Stallion (cd1400 based) (gerg@stallion.oz.au)
73 ?? was qcam
@@ -128,9 +125,9 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
-86 alog Industrial Computer Source AIO8-P driver (deprecated)
+86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
88 dpt DPT RAID Controller <shimon@i-connect.net>
89 pps Pulse-Per-Second timing interface
@@ -152,12 +149,3 @@ chrdev name comments
105 iic I2C bus generic i/o
106 smb System Management Bus generic i/o
107 3dfx 3Dfx driver (shocking@prth.pgs.com)
-108 usb Universal Serial Bus (nick.hibma@jrc.it)
-109 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-111 ums USB Mouse (nick.hibma@jrc.it)
-112 kbd keyboard
-113 ulpt USB Printer (nick.hibma@jrc.it)
-114 ugen USB Generic device (nick.hibma@jrc.it)
-200 ?? entries from 200-255 are reserved for local use
-255 ?? entries from 200-255 are reserved for local use
diff --git a/sys/pc98/conf/options.pc98 b/sys/pc98/conf/options.pc98
index 22c264c07e3a..d18cabcdd4f9 100644
--- a/sys/pc98/conf/options.pc98
+++ b/sys/pc98/conf/options.pc98
@@ -1,7 +1,5 @@
-# $Id: options.pc98,v 1.77 1999/01/04 08:09:15 kato Exp $
-
+# $Id: options.pc98,v 1.68 1998/09/28 08:23:26 kato Exp $
DISABLE_PSE
-IDE_DELAY
USER_LDT
MATH_EMULATE opt_math_emulate.h
GPL_MATH_EMULATE opt_math_emulate.h
@@ -26,13 +24,19 @@ BREAK_TO_DEBUGGER opt_comconsole.h
CONSPEED opt_comconsole.h
COM_ESP opt_sio.h
COM_MULTIPORT opt_sio.h
+DSI_SOFT_MODEM opt_sio.h
EXTRA_SIO opt_sio.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
-# i386 SMP options
+# These two SMP options have dramatic implications all over the kernel
+SMP opt_global.h
APIC_IO opt_global.h
+
+# Standard SMP options
+NCPU opt_smp.h
+NBUS opt_smp.h
NAPIC opt_smp.h
NINTR opt_smp.h
@@ -56,7 +60,6 @@ CPU_UPGRADE_HW_CACHE opt_cpu.h
CPU_WT_ALLOC opt_cpu.h
CYRIX_CACHE_WORKS opt_cpu.h
CYRIX_CACHE_REALLY_WORKS opt_cpu.h
-NO_MEMORY_HOLE opt_cpu.h
# The CPU type affects the endian conversion functions all over the kernel.
I386_CPU opt_global.h
@@ -64,29 +67,27 @@ I486_CPU opt_global.h
I586_CPU opt_global.h
I686_CPU opt_global.h
+SC_SPLASH_SCREEN opt_syscons.h
MAXCONS opt_syscons.h
+SLOW_VGA opt_syscons.h
STD8X16FONT opt_syscons.h
SC_HISTORY_SIZE opt_syscons.h
SC_DISABLE_REBOOT opt_syscons.h
SC_MOUSE_CHAR opt_syscons.h
-
-FB_INSTALL_CDEV opt_fb.h
+SC_ALT_SEQACCESS opt_syscons.h
VESA opt_vesa.h
-GDC opt_gdc.h
-
PSM_HOOKAPM opt_psm.h
PSM_RESETAFTERSUSPEND opt_psm.h
PSM_DEBUG opt_psm.h
PCIC_RESUME_RESET opt_pcic.h
-KBD_INSTALL_CDEV opt_kbd.h
-KBD_MAXRETRY opt_kbd.h
-KBD_MAXWAIT opt_kbd.h
-KBD_RESETDELAY opt_kbd.h
-KBDIO_DEBUG opt_kbd.h
+KBD_RESETDELAY opt_kbdio.h
+KBD_MAXRETRY opt_kbdio.h
+KBD_MAXWAIT opt_kbdio.h
+KBDIO_DEBUG opt_kbdio.h
ATAPI opt_atapi.h
ATAPI_STATIC opt_atapi.h
@@ -95,13 +96,12 @@ CMD640 opt_wd.h
USERCONFIG opt_userconfig.h
VISUAL_USERCONFIG opt_userconfig.h
-INTRO_USERCONFIG opt_userconfig.h
+USERCONFIG_BOOT opt_userconfig.h
EISA_SLOTS opt_eisa.h
FDC_DEBUG opt_fdc.h
FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h
-FDC_YE opt_fdc.h
# pcvt(4) has a bunch of options
FAT_CURSOR opt_pcvt.h
@@ -125,42 +125,6 @@ GUS_IRQ opt_sound.h
# Video spigot
SPIGOT_UNSECURE opt_spigot.h
-# -------------------------------
-# isdn4bsd: passive ISA cards
-# -------------------------------
-TEL_S0_8 opt_i4b.h
-TEL_S0_16 opt_i4b.h
-TEL_S0_16_3 opt_i4b.h
-AVM_A1 opt_i4b.h
-USR_STI opt_i4b.h
-ITKIX1 opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive ISA PnP cards
-# -------------------------------
-CRTX_S0_P opt_i4b.h
-DRN_NGO opt_i4b.h
-TEL_S0_16_3_P opt_i4b.h
-SEDLBAUER opt_i4b.h
-DYNALINK opt_i4b.h
-ELSA_QS1ISA opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCMCIA cards
-# -------------------------------
-AVM_A1_PCMCIA opt_i4b.h
-# -------------------------------
-# isdn4bsd: misc options
-# -------------------------------
-# temporary workaround for SMP machines
-I4B_SMP_WORKAROUND opt_i4b.h
-# enable VJ compression code for ipr i/f
-IPR_VJ opt_i4b.h
-# -------------------------------
-# EOF
-# -------------------------------
# bs driver options
SCSI_BOUNCE_SIZE opt_bs.h
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 91095587ab6e..7449379560cf 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.104 1999/01/08 16:04:20 kato Exp $
+ * $Id: machdep.c,v 1.98 1998/10/09 12:36:25 kato Exp $
*/
#include "apm.h"
@@ -109,6 +109,9 @@
#include <net/netisr.h>
#endif
+#if NAPM > 0
+#include <machine/apm_bios.h>
+#endif
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/clock.h>
@@ -423,12 +426,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -452,8 +449,14 @@ again:
}
#if defined(USERCONFIG)
- userconfig();
- cninit(); /* the preferred console may have changed */
+#if defined(USERCONFIG_BOOT)
+ if (1) {
+#else
+ if (boothowto & RB_CONFIG) {
+#endif
+ userconfig();
+ cninit(); /* the preferred console may have changed */
+ }
#endif
printf("avail memory = %d (%dK bytes)\n", ptoa(cnt.v_free_count),
@@ -545,11 +548,7 @@ sendsig(catcher, sig, mask, code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof(struct sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -644,7 +643,7 @@ sendsig(catcher, sig, mask, code)
}
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
@@ -808,6 +807,17 @@ cpu_halt(void)
}
/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+#if NAPM > 0
+ apm_power_off();
+#endif
+}
+
+/*
* Clear registers on exec
*/
void
@@ -1255,7 +1265,11 @@ init386(first)
setidt(11, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(12, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(13, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#ifdef CPU_BUGGY_CYRIX
setidt(14, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#else
+ setidt(14, &IDTVEC(page), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#endif
setidt(15, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(16, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(17, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -1680,7 +1694,7 @@ f00f_hack(void *unused) {
if (!has_f00f_bug)
return;
- printf("Intel Pentium detected, installing workaround for F00F bug\n");
+ printf("Intel Pentium F00F detected, installing workaround\n");
r_idt.rd_limit = sizeof(idt) - 1;
diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c
new file mode 100644
index 000000000000..9ea5d8051d1f
--- /dev/null
+++ b/sys/pc98/i386/trap.c
@@ -0,0 +1,1159 @@
+/*-
+ * Copyright (C) 1994, David Greenman
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the University of Utah, and William Jolitz.
+ *
+ * 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 University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
+ * $Id: trap.c,v 1.50 1998/04/29 09:45:38 kato Exp $
+ */
+
+/*
+ * 386 Trap and System call handling
+ */
+
+#include "opt_cpu.h"
+#include "opt_ddb.h"
+#include "opt_ktrace.h"
+#include "opt_trap.h"
+#include "opt_vm86.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/pioctl.h>
+#include <sys/kernel.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/syscall.h>
+#include <sys/sysent.h>
+#include <sys/uio.h>
+#include <sys/vmmeter.h>
+#ifdef KTRACE
+#include <sys/ktrace.h>
+#endif
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_prot.h>
+#include <sys/lock.h>
+#include <vm/pmap.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_map.h>
+#include <vm/vm_page.h>
+#include <vm/vm_extern.h>
+
+#include <machine/cpu.h>
+#include <machine/ipl.h>
+#include <machine/md_var.h>
+#include <machine/pcb.h>
+#ifdef SMP
+#include <machine/smp.h>
+#endif
+#include <machine/tss.h>
+
+#include <i386/isa/intr_machdep.h>
+
+#ifdef POWERFAIL_NMI
+#include <sys/syslog.h>
+#include <machine/clock.h>
+#endif
+
+#ifdef VM86
+#include <machine/vm86.h>
+#endif
+
+#include "isa.h"
+#include "npx.h"
+
+extern struct i386tss common_tss;
+
+int (*pmath_emulate) __P((struct trapframe *));
+
+extern void trap __P((struct trapframe frame));
+extern int trapwrite __P((unsigned addr));
+extern void syscall __P((struct trapframe frame));
+
+#ifdef CPU_BUGGY_CYRIX
+static int trap_pfault __P((struct trapframe *, int, vm_offset_t));
+#else
+static int trap_pfault __P((struct trapframe *, int));
+#endif
+static void trap_fatal __P((struct trapframe *));
+void dblfault_handler __P((void));
+
+extern inthand_t IDTVEC(syscall);
+
+#define MAX_TRAP_MSG 28
+static char *trap_msg[] = {
+ "", /* 0 unused */
+ "privileged instruction fault", /* 1 T_PRIVINFLT */
+ "", /* 2 unused */
+ "breakpoint instruction fault", /* 3 T_BPTFLT */
+ "", /* 4 unused */
+ "", /* 5 unused */
+ "arithmetic trap", /* 6 T_ARITHTRAP */
+ "system forced exception", /* 7 T_ASTFLT */
+ "", /* 8 unused */
+ "general protection fault", /* 9 T_PROTFLT */
+ "trace trap", /* 10 T_TRCTRAP */
+ "", /* 11 unused */
+ "page fault", /* 12 T_PAGEFLT */
+ "", /* 13 unused */
+ "alignment fault", /* 14 T_ALIGNFLT */
+ "", /* 15 unused */
+ "", /* 16 unused */
+ "", /* 17 unused */
+ "integer divide fault", /* 18 T_DIVIDE */
+ "non-maskable interrupt trap", /* 19 T_NMI */
+ "overflow trap", /* 20 T_OFLOW */
+ "FPU bounds check fault", /* 21 T_BOUND */
+ "FPU device not available", /* 22 T_DNA */
+ "double fault", /* 23 T_DOUBLEFLT */
+ "FPU operand fetch fault", /* 24 T_FPOPFLT */
+ "invalid TSS fault", /* 25 T_TSSFLT */
+ "segment not present fault", /* 26 T_SEGNPFLT */
+ "stack fault", /* 27 T_STKFLT */
+ "machine check trap", /* 28 T_MCHK */
+};
+
+static __inline void userret __P((struct proc *p, struct trapframe *frame,
+ u_quad_t oticks));
+
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+extern struct gate_descriptor *t_idt;
+extern int has_f00f_bug;
+#endif
+
+static __inline void
+userret(p, frame, oticks)
+ struct proc *p;
+ struct trapframe *frame;
+ u_quad_t oticks;
+{
+ int sig, s;
+
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+
+#if 0
+ if (!want_resched &&
+ (p->p_priority <= p->p_usrpri) &&
+ (p->p_rtprio.type == RTP_PRIO_NORMAL)) {
+ int newpriority;
+ p->p_estcpu += 1;
+ newpriority = PUSER + p->p_estcpu / 4 + 2 * p->p_nice;
+ newpriority = min(newpriority, MAXPRI);
+ p->p_usrpri = newpriority;
+ }
+#endif
+
+ p->p_priority = p->p_usrpri;
+ if (want_resched) {
+ /*
+ * Since we are curproc, clock will normally just change
+ * our priority without moving us from one queue to another
+ * (since the running process is not on a queue.)
+ * If that happened after we setrunqueue ourselves but before we
+ * mi_switch()'ed, we might not be on the queue indicated by
+ * our priority.
+ */
+ s = splhigh();
+ setrunqueue(p);
+ p->p_stats->p_ru.ru_nivcsw++;
+ mi_switch();
+ splx(s);
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ }
+ /*
+ * Charge system time if profiling.
+ */
+ if (p->p_flag & P_PROFIL)
+ addupc_task(p, frame->tf_eip,
+ (u_int)(p->p_sticks - oticks) * psratio);
+
+ curpriority = p->p_priority;
+}
+
+/*
+ * Exception, fault, and trap interface to the FreeBSD kernel.
+ * This common code is called from assembly language IDT gate entry
+ * routines that prepare a suitable stack frame, and restore this
+ * frame after the exception has been processed.
+ */
+
+void
+trap(frame)
+ struct trapframe frame;
+{
+ struct proc *p = curproc;
+ u_quad_t sticks = 0;
+ int i = 0, ucode = 0, type, code;
+#ifdef DEBUG
+ u_long eva;
+#endif
+#ifdef CPU_BUGGY_CYRIX
+ vm_offset_t va;
+#endif
+
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+restart:
+#endif
+ type = frame.tf_trapno;
+ code = frame.tf_err;
+
+#ifdef CPU_BUGGY_CYRIX
+ /* XXX:
+ * CYRIX 486 CPU FIX.
+ * If you use cyrix cpu, you often encouter strange signal 11's?
+ * I think this is due to cyrix cpu bugs.
+ * In any way, the following trick is effective for the problem.
+ * As soon as possible, we must get the fault page address.
+ */
+ va = (vm_offset_t)(rcr2());
+ if( type == T_PAGEFLT && ( frame.tf_eflags & PSL_I ) )
+ asm("sti");
+#endif /* CPU_BUGGY_CYRIX */
+
+#ifdef VM86
+ if (in_vm86call) {
+ if (frame.tf_eflags & PSL_VM &&
+ (type == T_PROTFLT || type == T_STKFLT)) {
+ i = vm86_emulate((struct vm86frame *)&frame);
+ if (i != 0)
+ /*
+ * returns to original process
+ */
+ vm86_trap((struct vm86frame *)&frame);
+ return;
+ }
+ switch (type) {
+ /*
+ * these traps want either a process context, or
+ * assume a normal userspace trap.
+ */
+ case T_PROTFLT:
+ case T_SEGNPFLT:
+ trap_fatal(&frame);
+ return;
+ case T_TRCTRAP:
+ type = T_BPTFLT; /* kernel breakpoint */
+ /* FALL THROUGH */
+ }
+ goto kernel_trap; /* normal kernel trap handling */
+ }
+#endif
+
+ if ((ISPL(frame.tf_cs) == SEL_UPL) || (frame.tf_eflags & PSL_VM)) {
+ /* user trap */
+
+ sticks = p->p_sticks;
+ p->p_md.md_regs = &frame;
+
+ switch (type) {
+ case T_PRIVINFLT: /* privileged instruction fault */
+ ucode = type;
+ i = SIGILL;
+ break;
+
+ case T_BPTFLT: /* bpt instruction fault */
+ case T_TRCTRAP: /* trace trap */
+ frame.tf_eflags &= ~PSL_T;
+ i = SIGTRAP;
+ break;
+
+ case T_ARITHTRAP: /* arithmetic trap */
+ ucode = code;
+ i = SIGFPE;
+ break;
+
+ case T_ASTFLT: /* Allow process switch */
+ astoff();
+ cnt.v_soft++;
+ if (p->p_flag & P_OWEUPC) {
+ p->p_flag &= ~P_OWEUPC;
+ addupc_task(p, p->p_stats->p_prof.pr_addr,
+ p->p_stats->p_prof.pr_ticks);
+ }
+ goto out;
+
+ /*
+ * The following two traps can happen in
+ * vm86 mode, and, if so, we want to handle
+ * them specially.
+ */
+ case T_PROTFLT: /* general protection fault */
+ case T_STKFLT: /* stack fault */
+#ifdef VM86
+ if (frame.tf_eflags & PSL_VM) {
+ i = vm86_emulate((struct vm86frame *)&frame);
+ if (i == 0)
+ goto out;
+ break;
+ }
+#endif /* VM86 */
+ /* FALL THROUGH */
+
+ case T_SEGNPFLT: /* segment not present fault */
+ case T_TSSFLT: /* invalid TSS fault */
+ case T_DOUBLEFLT: /* double fault */
+ default:
+ ucode = code + BUS_SEGM_FAULT ;
+ i = SIGBUS;
+ break;
+
+ case T_PAGEFLT: /* page fault */
+#ifdef CPU_BUGGY_CYRIX
+ i = trap_pfault(&frame, TRUE, va);
+#else
+ i = trap_pfault(&frame, TRUE);
+#endif
+ if (i == -1)
+ return;
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+ if (i == -2)
+ goto restart;
+#endif
+ if (i == 0)
+ goto out;
+
+ ucode = T_PAGEFLT;
+ break;
+
+ case T_DIVIDE: /* integer divide fault */
+ ucode = FPE_INTDIV_TRAP;
+ i = SIGFPE;
+ break;
+
+#if NISA > 0
+ case T_NMI:
+#ifdef POWERFAIL_NMI
+ goto handle_powerfail;
+#else /* !POWERFAIL_NMI */
+#ifdef DDB
+ /* NMI can be hooked up to a pushbutton for debugging */
+ printf ("NMI ... going to debugger\n");
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif /* DDB */
+ /* machine/parity/power fail/"kitchen sink" faults */
+ if (isa_nmi(code) == 0) return;
+ panic("NMI indicates hardware failure");
+#endif /* POWERFAIL_NMI */
+#endif /* NISA > 0 */
+
+ case T_OFLOW: /* integer overflow fault */
+ ucode = FPE_INTOVF_TRAP;
+ i = SIGFPE;
+ break;
+
+ case T_BOUND: /* bounds check fault */
+ ucode = FPE_SUBRNG_TRAP;
+ i = SIGFPE;
+ break;
+
+ case T_DNA:
+#if NNPX > 0
+ /* if a transparent fault (due to context switch "late") */
+ if (npxdna())
+ return;
+#endif
+ if (!pmath_emulate) {
+ i = SIGFPE;
+ ucode = FPE_FPU_NP_TRAP;
+ break;
+ }
+ i = (*pmath_emulate)(&frame);
+ if (i == 0) {
+ if (!(frame.tf_eflags & PSL_T))
+ return;
+ frame.tf_eflags &= ~PSL_T;
+ i = SIGTRAP;
+ }
+ /* else ucode = emulator_only_knows() XXX */
+ break;
+
+ case T_FPOPFLT: /* FPU operand fetch fault */
+ ucode = T_FPOPFLT;
+ i = SIGILL;
+ break;
+ }
+ } else {
+#ifdef VM86
+kernel_trap:
+#endif
+ /* kernel trap */
+
+ switch (type) {
+ case T_PAGEFLT: /* page fault */
+#ifdef CPU_BUGGY_CYRIX
+ (void) trap_pfault(&frame, FALSE, va);
+#else
+ (void) trap_pfault(&frame, FALSE);
+#endif
+ return;
+
+ case T_DNA:
+#if NNPX > 0
+ /*
+ * The kernel is apparently using npx for copying.
+ * XXX this should be fatal unless the kernel has
+ * registered such use.
+ */
+ if (npxdna())
+ return;
+#endif
+ break;
+
+ case T_PROTFLT: /* general protection fault */
+ case T_SEGNPFLT: /* segment not present fault */
+ /*
+ * Invalid segment selectors and out of bounds
+ * %eip's and %esp's can be set up in user mode.
+ * This causes a fault in kernel mode when the
+ * kernel tries to return to user mode. We want
+ * to get this fault so that we can fix the
+ * problem here and not have to check all the
+ * selectors and pointers when the user changes
+ * them.
+ */
+#define MAYBE_DORETI_FAULT(where, whereto) \
+ do { \
+ if (frame.tf_eip == (int)where) { \
+ frame.tf_eip = (int)whereto; \
+ return; \
+ } \
+ } while (0)
+
+ if (intr_nesting_level == 0) {
+ /*
+ * Invalid %fs's and %gs's can be created using
+ * procfs or PT_SETREGS or by invalidating the
+ * underlying LDT entry. This causes a fault
+ * in kernel mode when the kernel attempts to
+ * switch contexts. Lose the bad context
+ * (XXX) so that we can continue, and generate
+ * a signal.
+ */
+ if (frame.tf_eip == (int)cpu_switch_load_fs) {
+ curpcb->pcb_fs = 0;
+ psignal(p, SIGBUS);
+ return;
+ }
+ if (frame.tf_eip == (int)cpu_switch_load_gs) {
+ curpcb->pcb_gs = 0;
+ psignal(p, SIGBUS);
+ return;
+ }
+ MAYBE_DORETI_FAULT(doreti_iret,
+ doreti_iret_fault);
+ MAYBE_DORETI_FAULT(doreti_popl_ds,
+ doreti_popl_ds_fault);
+ MAYBE_DORETI_FAULT(doreti_popl_es,
+ doreti_popl_es_fault);
+ if (curpcb && curpcb->pcb_onfault) {
+ frame.tf_eip = (int)curpcb->pcb_onfault;
+ return;
+ }
+ }
+ break;
+
+ case T_TSSFLT:
+ /*
+ * PSL_NT can be set in user mode and isn't cleared
+ * automatically when the kernel is entered. This
+ * causes a TSS fault when the kernel attempts to
+ * `iret' because the TSS link is uninitialized. We
+ * want to get this fault so that we can fix the
+ * problem here and not every time the kernel is
+ * entered.
+ */
+ if (frame.tf_eflags & PSL_NT) {
+ frame.tf_eflags &= ~PSL_NT;
+ return;
+ }
+ break;
+
+ case T_TRCTRAP: /* trace trap */
+ if (frame.tf_eip == (int)IDTVEC(syscall)) {
+ /*
+ * We've just entered system mode via the
+ * syscall lcall. Continue single stepping
+ * silently until the syscall handler has
+ * saved the flags.
+ */
+ return;
+ }
+ if (frame.tf_eip == (int)IDTVEC(syscall) + 1) {
+ /*
+ * The syscall handler has now saved the
+ * flags. Stop single stepping it.
+ */
+ frame.tf_eflags &= ~PSL_T;
+ return;
+ }
+ /*
+ * Fall through.
+ */
+ case T_BPTFLT:
+ /*
+ * If DDB is enabled, let it handle the debugger trap.
+ * Otherwise, debugger traps "can't happen".
+ */
+#ifdef DDB
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif
+ break;
+
+#if NISA > 0
+ case T_NMI:
+#ifdef POWERFAIL_NMI
+#ifndef TIMER_FREQ
+# define TIMER_FREQ 1193182
+#endif
+ handle_powerfail:
+ {
+ static unsigned lastalert = 0;
+
+ if(time_second - lastalert > 10)
+ {
+ log(LOG_WARNING, "NMI: power fail\n");
+ sysbeep(TIMER_FREQ/880, hz);
+ lastalert = time_second;
+ }
+ return;
+ }
+#else /* !POWERFAIL_NMI */
+#ifdef DDB
+ /* NMI can be hooked up to a pushbutton for debugging */
+ printf ("NMI ... going to debugger\n");
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif /* DDB */
+ /* machine/parity/power fail/"kitchen sink" faults */
+ if (isa_nmi(code) == 0) return;
+ /* FALL THROUGH */
+#endif /* POWERFAIL_NMI */
+#endif /* NISA > 0 */
+ }
+
+ trap_fatal(&frame);
+ return;
+ }
+
+ /* Translate fault for emulators (e.g. Linux) */
+ if (*p->p_sysent->sv_transtrap)
+ i = (*p->p_sysent->sv_transtrap)(i, type);
+
+ trapsignal(p, i, ucode);
+
+#ifdef DEBUG
+ eva = rcr2();
+ if (type <= MAX_TRAP_MSG) {
+ uprintf("fatal process exception: %s",
+ trap_msg[type]);
+ if ((type == T_PAGEFLT) || (type == T_PROTFLT))
+ uprintf(", fault VA = 0x%lx", eva);
+ uprintf("\n");
+ }
+#endif
+
+out:
+ userret(p, &frame, sticks);
+}
+
+#ifdef notyet
+/*
+ * This version doesn't allow a page fault to user space while
+ * in the kernel. The rest of the kernel needs to be made "safe"
+ * before this can be used. I think the only things remaining
+ * to be made safe are the iBCS2 code and the process tracing/
+ * debugging code.
+ */
+static int
+#ifdef CPU_BUGGY_CYRIX
+trap_pfault(frame, usermode,faultva)
+ struct trapframe *frame;
+ int usermode;
+ vm_offset_t faultva;
+#else
+trap_pfault(frame, usermode)
+ struct trapframe *frame;
+ int usermode;
+#endif
+{
+ vm_offset_t va;
+ struct vmspace *vm = NULL;
+ vm_map_t map = 0;
+ int rv = 0;
+ vm_prot_t ftype;
+ int eva;
+ struct proc *p = curproc;
+
+ if (frame->tf_err & PGEX_W)
+ ftype = VM_PROT_READ | VM_PROT_WRITE;
+ else
+ ftype = VM_PROT_READ;
+
+#ifdef CPU_BUGGY_CYRIX
+ eva = faultva;
+#else
+ eva = rcr2();
+#endif
+ va = trunc_page((vm_offset_t)eva);
+
+ if (va < VM_MIN_KERNEL_ADDRESS) {
+ vm_offset_t v;
+ vm_page_t mpte;
+
+ if (p == NULL ||
+ (!usermode && va < VM_MAXUSER_ADDRESS &&
+ (intr_nesting_level != 0 || curpcb == NULL ||
+ curpcb->pcb_onfault == NULL))) {
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /*
+ * This is a fault on non-kernel virtual memory.
+ * vm is initialized above to NULL. If curproc is NULL
+ * or curproc->p_vmspace is NULL the fault is fatal.
+ */
+ vm = p->p_vmspace;
+ if (vm == NULL)
+ goto nogo;
+
+ map = &vm->vm_map;
+
+ /*
+ * Keep swapout from messing with us during this
+ * critical time.
+ */
+ ++p->p_lock;
+
+ /*
+ * Grow the stack if necessary
+ */
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ rv = KERN_FAILURE;
+ --p->p_lock;
+ goto nogo;
+ }
+ }
+
+ /* Fault in the user page: */
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
+
+ --p->p_lock;
+ } else {
+ /*
+ * Don't allow user-mode faults in kernel address space.
+ */
+ if (usermode)
+ goto nogo;
+
+ /*
+ * Since we know that kernel virtual address addresses
+ * always have pte pages mapped, we just have to fault
+ * the page.
+ */
+ rv = vm_fault(kernel_map, va, ftype, FALSE);
+ }
+
+ if (rv == KERN_SUCCESS)
+ return (0);
+nogo:
+ if (!usermode) {
+ if (intr_nesting_level == 0 && curpcb && curpcb->pcb_onfault) {
+ frame->tf_eip = (int)curpcb->pcb_onfault;
+ return (0);
+ }
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /* kludge to pass faulting virtual address to sendsig */
+ frame->tf_err = eva;
+
+ return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
+}
+#endif
+
+int
+#ifdef CPU_BUGGY_CYRIX
+trap_pfault(frame, usermode,faultva)
+ struct trapframe *frame;
+ int usermode;
+ vm_offset_t faultva;
+#else
+trap_pfault(frame, usermode)
+ struct trapframe *frame;
+ int usermode;
+#endif
+{
+ vm_offset_t va;
+ struct vmspace *vm = NULL;
+ vm_map_t map = 0;
+ int rv = 0;
+ vm_prot_t ftype;
+ int eva;
+ struct proc *p = curproc;
+
+#ifdef CPU_BUGGY_CYRIX
+ eva = faultva;
+#else
+ eva = rcr2();
+#endif
+ va = trunc_page((vm_offset_t)eva);
+
+ if (va >= KERNBASE) {
+ /*
+ * Don't allow user-mode faults in kernel address space.
+ * An exception: if the faulting address is the invalid
+ * instruction entry in the IDT, then the Intel Pentium
+ * F00F bug workaround was triggered, and we need to
+ * treat it is as an illegal instruction, and not a page
+ * fault.
+ */
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+ if ((eva == (unsigned int)&t_idt[6]) && has_f00f_bug) {
+ frame->tf_trapno = T_PRIVINFLT;
+ return -2;
+ }
+#endif
+ if (usermode)
+ goto nogo;
+
+ map = kernel_map;
+ } else {
+ /*
+ * This is a fault on non-kernel virtual memory.
+ * vm is initialized above to NULL. If curproc is NULL
+ * or curproc->p_vmspace is NULL the fault is fatal.
+ */
+ if (p != NULL)
+ vm = p->p_vmspace;
+
+ if (vm == NULL)
+ goto nogo;
+
+ map = &vm->vm_map;
+ }
+
+ if (frame->tf_err & PGEX_W)
+ ftype = VM_PROT_READ | VM_PROT_WRITE;
+ else
+ ftype = VM_PROT_READ;
+
+ if (map != kernel_map) {
+ /*
+ * Keep swapout from messing with us during this
+ * critical time.
+ */
+ ++p->p_lock;
+
+ /*
+ * Grow the stack if necessary
+ */
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ rv = KERN_FAILURE;
+ --p->p_lock;
+ goto nogo;
+ }
+ }
+
+ /* Fault in the user page: */
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
+
+ --p->p_lock;
+ } else {
+ /*
+ * Don't have to worry about process locking or stacks in the kernel.
+ */
+ rv = vm_fault(map, va, ftype, FALSE);
+ }
+
+ if (rv == KERN_SUCCESS)
+ return (0);
+nogo:
+ if (!usermode) {
+ if (intr_nesting_level == 0 && curpcb && curpcb->pcb_onfault) {
+ frame->tf_eip = (int)curpcb->pcb_onfault;
+ return (0);
+ }
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /* kludge to pass faulting virtual address to sendsig */
+ frame->tf_err = eva;
+
+ return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
+}
+
+static void
+trap_fatal(frame)
+ struct trapframe *frame;
+{
+ int code, type, eva, ss, esp;
+ struct soft_segment_descriptor softseg;
+
+ code = frame->tf_err;
+ type = frame->tf_trapno;
+ eva = rcr2();
+ sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg);
+
+ if (type <= MAX_TRAP_MSG)
+ printf("\n\nFatal trap %d: %s while in %s mode\n",
+ type, trap_msg[type],
+ frame->tf_eflags & PSL_VM ? "vm86" :
+ ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
+#ifdef SMP
+ /* three seperate prints in case of a trap on an unmapped page */
+ printf("mp_lock = %08x; ", mp_lock);
+ printf("cpuid = %d; ", cpuid);
+ printf("lapic.id = %08x\n", lapic.id);
+#endif
+ if (type == T_PAGEFLT) {
+ printf("fault virtual address = 0x%x\n", eva);
+ printf("fault code = %s %s, %s\n",
+ code & PGEX_U ? "user" : "supervisor",
+ code & PGEX_W ? "write" : "read",
+ code & PGEX_P ? "protection violation" : "page not present");
+ }
+ printf("instruction pointer = 0x%x:0x%x\n",
+ frame->tf_cs & 0xffff, frame->tf_eip);
+ if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) {
+ ss = frame->tf_ss & 0xffff;
+ esp = frame->tf_esp;
+ } else {
+ ss = GSEL(GDATA_SEL, SEL_KPL);
+ esp = (int)&frame->tf_esp;
+ }
+ printf("stack pointer = 0x%x:0x%x\n", ss, esp);
+ printf("frame pointer = 0x%x:0x%x\n", ss, frame->tf_ebp);
+ printf("code segment = base 0x%x, limit 0x%x, type 0x%x\n",
+ softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type);
+ printf(" = DPL %d, pres %d, def32 %d, gran %d\n",
+ softseg.ssd_dpl, softseg.ssd_p, softseg.ssd_def32,
+ softseg.ssd_gran);
+ printf("processor eflags = ");
+ if (frame->tf_eflags & PSL_T)
+ printf("trace trap, ");
+ if (frame->tf_eflags & PSL_I)
+ printf("interrupt enabled, ");
+ if (frame->tf_eflags & PSL_NT)
+ printf("nested task, ");
+ if (frame->tf_eflags & PSL_RF)
+ printf("resume, ");
+ if (frame->tf_eflags & PSL_VM)
+ printf("vm86, ");
+ printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12);
+ printf("current process = ");
+ if (curproc) {
+ printf("%lu (%s)\n",
+ (u_long)curproc->p_pid, curproc->p_comm ?
+ curproc->p_comm : "");
+ } else {
+ printf("Idle\n");
+ }
+ printf("interrupt mask = ");
+ if ((cpl & net_imask) == net_imask)
+ printf("net ");
+ if ((cpl & tty_imask) == tty_imask)
+ printf("tty ");
+ if ((cpl & bio_imask) == bio_imask)
+ printf("bio ");
+ if ((cpl & cam_imask) == cam_imask)
+ printf("cam ");
+ if (cpl == 0)
+ printf("none");
+#ifdef SMP
+/**
+ * XXX FIXME:
+ * we probably SHOULD have stopped the other CPUs before now!
+ * another CPU COULD have been touching cpl at this moment...
+ */
+ printf(" <- SMP: XXX");
+#endif
+ printf("\n");
+
+#ifdef KDB
+ if (kdb_trap(&psl))
+ return;
+#endif
+#ifdef DDB
+ if (kdb_trap (type, 0, frame))
+ return;
+#endif
+ printf("trap number = %d\n", type);
+ if (type <= MAX_TRAP_MSG)
+ panic(trap_msg[type]);
+ else
+ panic("unknown/reserved trap");
+}
+
+/*
+ * Double fault handler. Called when a fault occurs while writing
+ * a frame for a trap/exception onto the stack. This usually occurs
+ * when the stack overflows (such is the case with infinite recursion,
+ * for example).
+ *
+ * XXX Note that the current PTD gets replaced by IdlePTD when the
+ * task switch occurs. This means that the stack that was active at
+ * the time of the double fault is not available at <kstack> unless
+ * the machine was idle when the double fault occurred. The downside
+ * of this is that "trace <ebp>" in ddb won't work.
+ */
+void
+dblfault_handler()
+{
+ printf("\nFatal double fault:\n");
+ printf("eip = 0x%x\n", common_tss.tss_eip);
+ printf("esp = 0x%x\n", common_tss.tss_esp);
+ printf("ebp = 0x%x\n", common_tss.tss_ebp);
+#ifdef SMP
+ /* three seperate prints in case of a trap on an unmapped page */
+ printf("mp_lock = %08x; ", mp_lock);
+ printf("cpuid = %d; ", cpuid);
+ printf("lapic.id = %08x\n", lapic.id);
+#endif
+ panic("double fault");
+}
+
+/*
+ * Compensate for 386 brain damage (missing URKR).
+ * This is a little simpler than the pagefault handler in trap() because
+ * it the page tables have already been faulted in and high addresses
+ * are thrown out early for other reasons.
+ */
+int trapwrite(addr)
+ unsigned addr;
+{
+ struct proc *p;
+ vm_offset_t va;
+ struct vmspace *vm;
+ int rv;
+
+ va = trunc_page((vm_offset_t)addr);
+ /*
+ * XXX - MAX is END. Changed > to >= for temp. fix.
+ */
+ if (va >= VM_MAXUSER_ADDRESS)
+ return (1);
+
+ p = curproc;
+ vm = p->p_vmspace;
+
+ ++p->p_lock;
+
+ if ((caddr_t)va >= vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ --p->p_lock;
+ return (1);
+ }
+ }
+
+ /*
+ * fault the data page
+ */
+ rv = vm_fault(&vm->vm_map, va, VM_PROT_READ|VM_PROT_WRITE, VM_FAULT_DIRTY);
+
+ --p->p_lock;
+
+ if (rv != KERN_SUCCESS)
+ return 1;
+
+ return (0);
+}
+
+/*
+ * System call request from POSIX system call gate interface to kernel.
+ * Like trap(), argument is call by reference.
+ */
+void
+syscall(frame)
+ struct trapframe frame;
+{
+ caddr_t params;
+ int i;
+ struct sysent *callp;
+ struct proc *p = curproc;
+ u_quad_t sticks;
+ int error;
+ int args[8];
+ u_int code;
+
+#ifdef DIAGNOSTIC
+ if (ISPL(frame.tf_cs) != SEL_UPL)
+ panic("syscall");
+#endif
+ sticks = p->p_sticks;
+ p->p_md.md_regs = &frame;
+ params = (caddr_t)frame.tf_esp + sizeof(int);
+ code = frame.tf_eax;
+ if (p->p_sysent->sv_prepsyscall) {
+ (*p->p_sysent->sv_prepsyscall)(&frame, args, &code, &params);
+ } else {
+ /*
+ * Need to check if this is a 32 bit or 64 bit syscall.
+ */
+ if (code == SYS_syscall) {
+ /*
+ * Code is first argument, followed by actual args.
+ */
+ code = fuword(params);
+ params += sizeof(int);
+ } else if (code == SYS___syscall) {
+ /*
+ * Like syscall, but code is a quad, so as to maintain
+ * quad alignment for the rest of the arguments.
+ */
+ code = fuword(params);
+ params += sizeof(quad_t);
+ }
+ }
+
+ if (p->p_sysent->sv_mask)
+ code &= p->p_sysent->sv_mask;
+
+ if (code >= p->p_sysent->sv_size)
+ callp = &p->p_sysent->sv_table[0];
+ else
+ callp = &p->p_sysent->sv_table[code];
+
+ if (params && (i = callp->sy_narg * sizeof(int)) &&
+ (error = copyin(params, (caddr_t)args, (u_int)i))) {
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+#endif
+ goto bad;
+ }
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+#endif
+ p->p_retval[0] = 0;
+ p->p_retval[1] = frame.tf_edx;
+
+ STOPEVENT(p, S_SCE, callp->sy_narg);
+
+ error = (*callp->sy_call)(p, args);
+
+ switch (error) {
+
+ case 0:
+ /*
+ * Reinitialize proc pointer `p' as it may be different
+ * if this is a child returning from fork syscall.
+ */
+ p = curproc;
+ frame.tf_eax = p->p_retval[0];
+ frame.tf_edx = p->p_retval[1];
+ frame.tf_eflags &= ~PSL_C;
+ break;
+
+ case ERESTART:
+ /*
+ * Reconstruct pc, assuming lcall $X,y is 7 bytes,
+ * int 0x80 is 2 bytes. We saved this in tf_err.
+ */
+ frame.tf_eip -= frame.tf_err;
+ break;
+
+ case EJUSTRETURN:
+ break;
+
+ default:
+bad:
+ if (p->p_sysent->sv_errsize)
+ if (error >= p->p_sysent->sv_errsize)
+ error = -1; /* XXX */
+ else
+ error = p->p_sysent->sv_errtbl[error];
+ frame.tf_eax = error;
+ frame.tf_eflags |= PSL_C;
+ break;
+ }
+
+ if ((frame.tf_eflags & PSL_T) && !(frame.tf_eflags & PSL_VM)) {
+ /* Traced syscall. */
+ frame.tf_eflags &= ~PSL_T;
+ trapsignal(p, SIGTRAP, 0);
+ }
+
+ userret(p, &frame, sticks);
+
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSRET))
+ ktrsysret(p->p_tracep, code, error, p->p_retval[0]);
+#endif
+
+ /*
+ * This works because errno is findable through the
+ * register set. If we ever support an emulation where this
+ * is not the case, this code will need to be revisited.
+ */
+ STOPEVENT(p, S_SCX, code);
+
+}
+
+/*
+ * Simplified back end of syscall(), used when returning from fork()
+ * directly into user mode.
+ */
+void
+fork_return(p, frame)
+ struct proc *p;
+ struct trapframe frame;
+{
+ frame.tf_eax = 0; /* Child returns zero */
+ frame.tf_eflags &= ~PSL_C; /* success */
+ frame.tf_edx = 1;
+
+ userret(p, &frame, 0);
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSRET))
+ ktrsysret(p->p_tracep, SYS_fork, 0, 0);
+#endif
+}
diff --git a/sys/pc98/i386/userconfig.c b/sys/pc98/i386/userconfig.c
index 30fccbc4da75..d291653b8419 100644
--- a/sys/pc98/i386/userconfig.c
+++ b/sys/pc98/i386/userconfig.c
@@ -46,7 +46,7 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
- ** $Id: userconfig.c,v 1.64 1999/01/16 11:39:08 kato Exp $
+ ** $Id: userconfig.c,v 1.56 1998/10/08 12:09:38 kato Exp $
**/
/**
@@ -117,8 +117,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
-#include <sys/linker.h>
-#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@@ -137,156 +135,36 @@ static MALLOC_DEFINE(M_DEVL, "isa_devlist", "isa_device lists in userconfig()");
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
+#ifdef USERCONFIG_BOOT
+char userconfig_from_boot[512] = "";
static int userconfig_boot_parsing; /* set if we are reading from the boot instructions */
-#define putchar(x) cnputc(x)
-
-static int
-sysctl_machdep_uc_devlist SYSCTL_HANDLER_ARGS
-{
- struct isa_device *id;
- int error=0;
- char name[8];
-
- if(!req->oldptr) {
- /* Only sizing */
- id=isa_devlist;
- while(id) {
- error+=sizeof(struct isa_device)+8;
- id=id->id_next;
- }
- return(SYSCTL_OUT(req,0,error));
- } else {
- /* Output the data. The buffer is filled with consecutive
- * struct isa_device and char buf[8], containing the name
- * (not guaranteed to end with '\0').
- */
- id=isa_devlist;
- while(id) {
- error=sysctl_handle_opaque(oidp,id,
- sizeof(struct isa_device),req);
- if(error) return(error);
- strncpy(name,id->id_driver->name,8);
- error=sysctl_handle_opaque(oidp,name,
- 8,req);
- if(error) return(error);
- id=id->id_next;
- }
- return(0);
- }
-}
-
-SYSCTL_PROC( _machdep, OID_AUTO, uc_devlist, CTLFLAG_RD,
- 0, 0, sysctl_machdep_uc_devlist, "A",
- "List of ISA devices changed in UserConfig");
-
-/*
-** Obtain command input.
-**
-** Initially, input is read from a possibly-loaded script.
-** At the end of the script, or if no script is supplied,
-** behaviour is determined by the RB_CONFIG (-c) flag. If
-** the flag is set, user input is read from the console; if
-** unset, the 'quit' command is invoked and userconfig
-** will exit.
-**
-** Note that quit commands encountered in the script will be
-** ignored if the RB_CONFIG flag is supplied.
-*/
static int
getchar(void)
{
- static const char *asp;
- static int assize; /* use of int for -ve magic value */
- static int autocheck = 0;
- caddr_t autoentry, autoattr;
- int c = 0;
- static int intro = 0;
-
- /* Look for loaded userconfig script */
- if (autocheck == 0)
- {
- autocheck = 1;
- autoentry = preload_search_by_type("userconfig_script");
- if (autoentry != NULL)
- {
- /* We have one, get size and data */
- assize = 0;
- if ((autoattr = preload_search_info(autoentry, MODINFO_SIZE)) != NULL)
- assize = (size_t)*(u_int32_t *)autoattr;
- asp = NULL;
- if ((autoattr = preload_search_info(autoentry, MODINFO_ADDR)) != NULL)
- asp = *(const char **)autoattr;
- /* sanity check */
- if ((assize == 0) || (asp == NULL)) {
- assize = 0;
- asp = NULL;
- }
- }
- }
-
- if (assize > 0)
- {
- /* Consume character from loaded userconfig script, display */
- userconfig_boot_parsing = 1;
- c = *asp;
- asp++;
- assize--;
+ static char *next = userconfig_from_boot;
- } else if (assize == 0) {
-
-#ifdef INTRO_USERCONFIG
- if (intro == 0)
- {
- /*
- * We don't want intro if we just executed a
- * script (userconfig_boot_parsing==1), otherwise
- * we would always block here waiting for user input.
- */
- intro = 1;
- if (userconfig_boot_parsing == 0)
- {
- /* userconfig_boot_parsing will be set to 1 on next pass,
- * which will allow using 'intro' in the middle of other
- * userconfig_script commands.
- */
- c = 'i';
- asp = "ntro\n";
- assize = strlen(asp);
- } else {
- userconfig_boot_parsing = 0;
- assize=-1;
- }
-#else
- userconfig_boot_parsing = 0;
- if (!(boothowto & RB_CONFIG))
- {
- /* don't want to drop to interpreter */
- c = 'q';
- asp = "uit\n";
- assize = strlen(asp);
-#endif
- userconfig_boot_parsing = 0;
+ if (next == userconfig_from_boot) {
+ if (strncmp(next, "USERCONFIG\n", 11)) {
+ next++;
+ strcpy(next, "intro\n");
} else {
- /* Only display signon banner if we are about to go interactive */
- if (!intro)
- printf("\nFreeBSD Kernel Configuration Utility - Version 1.2\n"
- " Type \"help\" for help"
-#ifdef VISUAL_USERCONFIG
- " or \"visual\" to go to the visual\n"
- " configuration interface (requires MGA/VGA display or\n"
- " serial terminal capable of displaying ANSI graphics)"
-#endif
- ".\n");
- assize = -1;
+ next += 11;
}
+ }
+ if (*next) {
+ userconfig_boot_parsing = 1;
+ return (*next++);
+ } else {
+ userconfig_boot_parsing = 0;
+ return cngetc();
}
- if (assize < 0) {
- /* No script, read from the keyboard */
- c = cngetc();
- }
- return(c);
}
+#else /* !USERCONFIG_BOOT */
+#define getchar() cngetc()
+#endif /* USERCONFIG_BOOT */
+
+#define putchar(x) cnputc(x)
#ifndef FALSE
#define FALSE (0)
@@ -403,16 +281,10 @@ static DEV_INFO device_info[] = {
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
-{"ax", "ASIC AX88140A ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"fpa", "DEC DEFPA PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
-{"rl", "RealTek 8129/8139 ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"mx", "Macronix PMAC ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"pn", "Lite-On 82c168/82c169 PNIC adapter", FLG_FIXED, CLS_NETWORK},
-{"tl", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"vr", "VIA Rhine/Rhine II ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"wb", "Winbond W89C840F ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"xl", "3COM 3C90x PCI ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"tlc", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"xl", "3COM 3C90x PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
{"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS},
{"cx", "Cronyx/Sigma multiport sync/async adapter",0, CLS_COMMS},
@@ -2081,17 +1953,15 @@ static void
helpscreen(void)
{
int topline = 0; /* where we are in the text */
- int c, delta = 1;
+ int line, c, delta = 1;
char prompt[80];
for (;;) /* loop until user quits */
{
- int line = 0;
-
/* display help text */
if (delta)
{
- clear(); /* remove everything else */
+ clear(); /* remove everything else */
for (line = topline;
(line < (topline + 24)) && (helptext[line]);
line++)
@@ -2531,7 +2401,7 @@ visuserconfig(void)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: userconfig.c,v 1.64 1999/01/16 11:39:08 kato Exp $
+ * $Id: userconfig.c,v 1.56 1998/10/08 12:09:38 kato Exp $
*/
#include "scbus.h"
@@ -2584,7 +2454,7 @@ static int set_device_enable(CmdParm *);
static int set_device_disable(CmdParm *);
static int quitfunc(CmdParm *);
static int helpfunc(CmdParm *);
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
static int introfunc(CmdParm *);
#endif
@@ -2622,12 +2492,10 @@ static CmdParm dev_parms[] = {
{ -1, {} },
};
-#if NPNP > 0
static CmdParm string_arg[] = {
{ PARM_STRING, {} },
{ -1, {} },
};
-#endif
#if NEISA > 0
static CmdParm int_arg[] = {
@@ -2647,7 +2515,7 @@ static Cmd CmdList[] = {
{ "ex", quitfunc, NULL }, /* exit (quit) */
{ "f", set_device_flags, int_parms }, /* flags dev mask */
{ "h", helpfunc, NULL }, /* help */
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
{ "intro", introfunc, NULL }, /* intro screen */
#endif
{ "iom", set_device_mem, addr_parms }, /* iomem dev addr */
@@ -2676,6 +2544,16 @@ userconfig(void)
int rval;
Cmd *cmd;
+ printf("\nFreeBSD Kernel Configuration Utility - Version 1.1\n"
+ " Type \"help\" for help"
+#ifdef VISUAL_USERCONFIG
+ " or \"visual\" to go to the visual\n"
+ " configuration interface (requires MGA/VGA display or\n"
+ " serial terminal capable of displaying ANSI graphics)"
+#endif
+ ".\n");
+
+
while (1) {
printf("config> ");
cngets(input, 80);
@@ -2989,6 +2867,7 @@ set_num_eisa_slots(CmdParm *parms)
static int
quitfunc(CmdParm *parms)
{
+#ifdef USERCONFIG_BOOT
/*
* If kernel config supplied, and we are parsing it, and -c also supplied,
* ignore a quit command, This provides a safety mechanism to allow
@@ -2996,6 +2875,7 @@ quitfunc(CmdParm *parms)
*/
if ((boothowto & RB_CONFIG) && userconfig_boot_parsing)
return 0;
+#endif
return 1;
}
@@ -3038,7 +2918,7 @@ helpfunc(CmdParm *parms)
return 0;
}
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
#if defined (VISUAL_USERCONFIG)
static void
@@ -3172,10 +3052,7 @@ introfunc(CmdParm *parms)
return visuserconfig();
else {
putxy(0, 1, "Type \"help\" for help or \"quit\" to exit.");
- /* enable quitfunc */
- userconfig_boot_parsing=0;
move (0, 3);
- boothowto |= RB_CONFIG; /* force -c */
return 0;
}
break;
@@ -3204,14 +3081,12 @@ lspnp ()
"mem 0x%x 0x%x 0x%x 0x%x";
char buf[256];
if (lineno >= 23) {
- if (!userconfig_boot_parsing) {
- printf("<More> ");
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ printf("<More> ");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0 || first)
@@ -3257,13 +3132,11 @@ lsdevtab(struct isa_device *dt)
if (lineno >= 23) {
printf("<More> ");
- if (!userconfig_boot_parsing) {
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0) {
diff --git a/sys/pc98/pc98/atcompat_diskslice.c b/sys/pc98/pc98/atcompat_diskslice.c
index ad51bc05e3f6..c25afaf36e56 100644
--- a/sys/pc98/pc98/atcompat_diskslice.c
+++ b/sys/pc98/pc98/atcompat_diskslice.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: atcompat_diskslice.c,v 1.12 1998/08/10 16:55:54 kato Exp $
+ * $Id: atcompat_diskslice.c,v 1.11 1998/07/27 09:49:22 kato Exp $
*/
/*
@@ -423,7 +423,7 @@ atcompat_extended(dname, dev, strat, lp, ssp, ext_offset, ext_size,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c
index 1225f3157d4c..20744f80f8c0 100644
--- a/sys/pc98/pc98/clock.c
+++ b/sys/pc98/pc98/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.64 1998/10/23 13:13:43 kato Exp $
+ * $Id: clock.c,v 1.62 1998/10/13 02:33:21 kato Exp $
*/
/*
@@ -136,7 +136,7 @@ static void setup_8254_mixed_mode __P((void));
*/
#define TIMER0_MAX_FREQ 20000
-int adjkerntz; /* local offset from GMT in seconds */
+int adjkerntz; /* local offset from GMT in seconds */
int disable_rtc_set; /* disable resettodr() if != 0 */
u_int idelayed;
int statclock_disable;
@@ -151,7 +151,7 @@ u_int stat_imask = SWI_CLOCK_MASK;
u_int timer_freq = TIMER_FREQ;
int timer0_max_count;
u_int tsc_freq;
-int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
static u_int clk_imask = HWI_MASK | SWI_MASK;
@@ -198,7 +198,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
static unsigned tsc_get_timecount __P((struct timecounter *tc));
static void set_timer_freq(u_int freq, int intr_freq);
-static struct timecounter tsc_timecounter = {
+static struct timecounter tsc_timecounter[3] = {
tsc_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -207,9 +207,9 @@ static struct timecounter tsc_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
- &tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
+ tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
-static struct timecounter i8254_timecounter = {
+static struct timecounter i8254_timecounter[3] = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -218,7 +218,7 @@ static struct timecounter i8254_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
- &i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
+ i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
static void
clkintr(struct clockframe frame)
@@ -952,8 +952,8 @@ startrtclock()
}
set_timer_freq(timer_freq, hz);
- i8254_timecounter.tc_frequency = timer_freq;
- init_timecounter(&i8254_timecounter);
+ i8254_timecounter[0].tc_frequency = timer_freq;
+ init_timecounter(i8254_timecounter);
#ifndef CLK_USE_TSC_CALIBRATION
if (tsc_freq != 0) {
@@ -1002,8 +1002,8 @@ startrtclock()
#endif /* NAPM > 0 */
if (tsc_present && tsc_freq != 0) {
- tsc_timecounter.tc_frequency = tsc_freq;
- init_timecounter(&tsc_timecounter);
+ tsc_timecounter[0].tc_frequency = tsc_freq;
+ init_timecounter(tsc_timecounter);
}
#endif /* !defined(SMP) */
@@ -1070,8 +1070,8 @@ rtc_inb(void)
#endif /* PC-98 */
/*
- * Initialize the time of day register, based on the time base which is, e.g.
- * from a filesystem.
+ * Initialize the time of day register, based on the time base which is, e.g.
+ * from a filesystem.
*/
void
inittodr(time_t base)
@@ -1123,17 +1123,17 @@ inittodr(time_t base)
/* sec now contains the number of seconds, since Jan 1 1970,
in the local time zone */
#else /* IBM-PC */
- /* Look if we have a RTC present and the time is valid */
+ /* Look if we have a RTC present and the time is valid */
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
goto wrong_time;
- /* wait for time update to complete */
- /* If RTCSA_TUP is zero, we have at least 244us before next update */
+ /* wait for time update to complete */
+ /* If RTCSA_TUP is zero, we have at least 244us before next update */
while (rtcin(RTC_STATUSA) & RTCSA_TUP);
days = 0;
#ifdef USE_RTC_CENTURY
- year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
+ year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
#else
year = readrtc(RTC_YEAR) + 1900;
if (year < 1970)
@@ -1141,21 +1141,21 @@ inittodr(time_t base)
#endif
if (year < 1970)
goto wrong_time;
- month = readrtc(RTC_MONTH);
- for (m = 1; m < month; m++)
- days += daysinmonth[m-1];
- if ((month > 2) && LEAPYEAR(year))
+ month = readrtc(RTC_MONTH);
+ for (m = 1; m < month; m++)
+ days += daysinmonth[m-1];
+ if ((month > 2) && LEAPYEAR(year))
days ++;
- days += readrtc(RTC_DAY) - 1;
+ days += readrtc(RTC_DAY) - 1;
yd = days;
for (y = 1970; y < year; y++)
- days += DAYSPERYEAR + LEAPYEAR(y);
+ days += DAYSPERYEAR + LEAPYEAR(y);
sec = ((( days * 24 +
readrtc(RTC_HRS)) * 60 +
readrtc(RTC_MIN)) * 60 +
readrtc(RTC_SEC));
- /* sec now contains the number of seconds, since Jan 1 1970,
- in the local time zone */
+ /* sec now contains the number of seconds, since Jan 1 1970,
+ in the local time zone */
#endif
sec += tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -1172,12 +1172,12 @@ inittodr(time_t base)
return;
wrong_time:
- printf("Invalid time in real time clock.\n");
- printf("Check and reset the date immediately!\n");
+ printf("Invalid time in real time clock.\n");
+ printf("Check and reset the date immediately!\n");
}
/*
- * Write system time back to RTC
+ * Write system time back to RTC
*/
void
resettodr()
@@ -1236,7 +1236,7 @@ resettodr()
/* Disable RTC updates and interrupts. */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in RTC */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -1244,7 +1244,7 @@ resettodr()
writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */
writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
- /* We have now the days since 01-01-1970 in tm */
+ /* We have now the days since 01-01-1970 in tm */
writertc(RTC_WDAY, (tm+4)%7); /* Write back Weekday */
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
tm >= m;
@@ -1467,7 +1467,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
if (timer0_state != RELEASED)
return (EBUSY); /* too much trouble to handle */
set_timer_freq(freq, hz);
- i8254_timecounter.tc_frequency = freq;
+ i8254_timecounter[0].tc_frequency = freq;
}
return (error);
}
@@ -1487,7 +1487,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
if (error == 0 && req->newptr != NULL) {
tsc_freq = freq;
- tsc_timecounter.tc_frequency = tsc_freq;
+ tsc_timecounter[0].tc_frequency = tsc_freq;
}
return (error);
}
diff --git a/sys/pc98/pc98/diskslice_machdep.c b/sys/pc98/pc98/diskslice_machdep.c
index 5370462dcd06..e2688ffde2f6 100644
--- a/sys/pc98/pc98/diskslice_machdep.c
+++ b/sys/pc98/pc98/diskslice_machdep.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: diskslice_machdep.c,v 1.16 1998/08/10 16:55:54 kato Exp $
+ * $Id: diskslice_machdep.c,v 1.15 1998/07/27 09:49:23 kato Exp $
*/
/*
@@ -470,7 +470,7 @@ reread_mbr:
sp->ds_size = pc98_size;
sp->ds_type = dp->dp_mid;
sp->ds_subtype = dp->dp_sid;
- strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name));
+ strncpy(sp->ds_name, dp->dp_name, 16);
#else
sp->ds_offset = mbr_offset + dp->dp_start;
sp->ds_size = dp->dp_size;
@@ -580,7 +580,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
@@ -611,7 +611,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sp->ds_size = pc98_size;
sp->ds_type = dp->dp_mid;
sp->ds_subtype = dp->dp_sid;
- strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name));
+ strncpy(sp->ds_name, dp->dp_name, 16);
#else
sp->ds_offset = ext_offset + dp->dp_start;
sp->ds_size = dp->dp_size;
diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c
index 90f230f5e871..889c066e6e25 100644
--- a/sys/pc98/pc98/fd.c
+++ b/sys/pc98/pc98/fd.c
@@ -5,10 +5,6 @@
* This code is derived from software contributed to Berkeley by
* Don Ahn.
*
- * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)
- * aided by the Linux floppy driver modifications from David Bateman
- * (dbateman@eng.uts.edu.au).
- *
* Copyright (c) 1993, 1994 by
* jc@irbs.UUCP (John Capo)
* vak@zebub.msk.su (Serge Vakulenko)
@@ -47,10 +43,14 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.49 1999/01/16 11:40:02 kato Exp $
+ * $Id: fd.c,v 1.40 1998/09/15 14:07:08 kato Exp $
*
*/
+#include "ft.h"
+#if NFT < 1
+#undef NFDC
+#endif
#include "fd.h"
#include "opt_devfs.h"
#include "opt_fdc.h"
@@ -84,6 +84,10 @@
#endif
#include <i386/isa/fdc.h>
#include <machine/stdarg.h>
+#if NFT > 0
+#include <sys/ftape.h>
+#include <i386/isa/ftreg.h>
+#endif
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -93,10 +97,6 @@
/* configuration flags */
#define FDC_PRETEND_D0 (1 << 0) /* pretend drive 0 to be there */
-#ifdef FDC_YE
-#define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's
- a PCMCIA device */
-#endif
/* internally used only, not really from CMOS: */
#define RTCFDT_144M_PRETENDED 0x1000
@@ -285,9 +285,15 @@ nrd_info(addr)
* fdsu is the floppy drive unit number on that controller. (sub-unit) *
\***********************************************************************/
-#ifdef FDC_YE
-#include "card.h"
-static int yeattach(struct isa_device *);
+#if NFT > 0
+int ftopen(dev_t, int);
+int ftintr(ftu_t ftu);
+int ftclose(dev_t, int);
+void ftstrategy(struct buf *);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftdump(dev_t);
+int ftsize(dev_t);
+int ftattach(struct isa_device *, struct isa_device *, int);
#endif
/* autoconfig functions */
@@ -310,7 +316,6 @@ static int fd_in(fdcu_t, int *);
static void fdstart(fdcu_t);
static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
-static ointhand2_t fdintr;
static int fdstate(fdcu_t, fdc_p);
static int retrier(fdcu_t);
static int fdformat(dev_t, struct fd_formb *, struct proc *);
@@ -333,9 +338,6 @@ static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
#define MOTORWAIT 10
#define IOTIMEDOUT 11
#define RESETCOMPLETE 12
-#ifdef FDC_YE
-#define PIOREAD 13
-#endif
#ifdef FDC_DEBUG
static char const * const fdstates[] =
@@ -353,9 +355,6 @@ static char const * const fdstates[] =
"MOTORWAIT",
"IOTIMEDOUT",
"RESETCOMPLETE",
-#ifdef FDC_YE
-"PIOREAD",
-#endif
};
/* CAUTION: fd_debug causes huge amounts of logging output */
@@ -367,91 +366,6 @@ static int volatile fd_debug = 0;
#define TRACE1(arg1, arg2)
#endif /* FDC_DEBUG */
-#ifdef FDC_YE
-#if NCARD > 0
-#include <sys/select.h>
-#include <sys/module.h>
-#include <pccard/cardinfo.h>
-#include <pccard/driver.h>
-#include <pccard/slot.h>
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int yeinit(struct pccard_devinfo *); /* init device */
-static void yeunload(struct pccard_devinfo *); /* Disable driver */
-static int yeintr(struct pccard_devinfo *); /* Interrupt handler */
-
-PCCARD_MODULE(fdc, yeinit, yeunload, yeintr, 0, bio_imask);
-
-/*
- * this is the secret PIO data port (offset from base)
- */
-#define FDC_YE_DATAPORT 6
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int yeinit(struct pccard_devinfo *devi)
-{
- fdc_p fdc = &fdc_data[devi->isahd.id_unit];
-
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFDC)
- return(ENODEV);
- fdc->baseport = devi->isahd.id_iobase;
- /*
- * reset controller
- */
- outb(fdc->baseport+FDOUT, 0);
- DELAY(100);
- outb(fdc->baseport+FDOUT, FDO_FRST);
-
- /*
- * wire into system
- */
- if (yeattach(&devi->isahd) == 0)
- return(ENXIO);
-
- return(0);
-}
-
-/*
- * yeunload - unload the driver and clear the table.
- * XXX TODO:
- * This is usually called when the card is ejected, but
- * can be caused by a modunload of a controller driver.
- * The idea is to reset the driver's view of the device
- * and ensure that any driver entry points such as
- * read and write do not hang.
- */
-static void yeunload(struct pccard_devinfo *devi)
-{
- if (fd_data[devi->isahd.id_unit].type == NO_TYPE)
- return;
-
- /*
- * this prevents Fdopen() and fdstrategy() from attempting
- * to access unloaded controller
- */
- fd_data[devi->isahd.id_unit].type = NO_TYPE;
-
- printf("fdc%d: unload\n", devi->isahd.id_unit);
-}
-
-/*
- * yeintr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int yeintr(struct pccard_devinfo *devi)
-{
- fdintr((fdcu_t)devi->isahd.id_unit);
- return(1);
-}
-#endif /* NCARD > 0 */
-#endif /* FDC_YE */
-
-
/* autoconfig structure */
struct isa_driver fdcdriver = {
@@ -490,7 +404,7 @@ fdc_err(fdcu_t fdcu, const char *s)
printf("fdc%d: %s", fdcu, s);
else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
printf("fdc%d: too many errors, not logging any more\n",
- fdcu);
+ fdcu);
}
return FD_FAILED;
@@ -520,7 +434,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (out_fdc(fdcu, va_arg(ap, int)) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %x failed at out byte %d of %d\n",
cmd, n + 1, n_out);
return fdc_err(fdcu, msg);
@@ -533,7 +447,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (fd_in(fdcu, ptr) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %02x failed at in byte %d of %d\n",
cmd, n + 1, n_in);
return fdc_err(fdcu, msg);
@@ -783,14 +697,6 @@ fdprobe(struct isa_device *dev)
{
return(0);
}
-#ifdef FDC_YE
- /*
- * don't succeed on probe; wait
- * for PCCARD subsystem to do it
- */
- if (dev->id_flags & FDC_IS_PCMCIA)
- return(0);
-#endif
return (IO_FDCSIZE);
}
@@ -806,6 +712,9 @@ fdattach(struct isa_device *dev)
fdc_p fdc = fdc_data + fdcu;
fd_p fd;
int fdsu, st0, st3, i;
+#if NFT > 0
+ int unithasfd;
+#endif
struct isa_device *fdup;
int ic_type = 0;
#ifdef DEVFS
@@ -814,7 +723,6 @@ fdattach(struct isa_device *dev)
int typesize;
#endif
- dev->id_ointr = fdintr;
fdc->fdcu = fdcu;
fdc->flags |= FDC_ATTACHED;
#ifdef PC98
@@ -845,7 +753,7 @@ fdattach(struct isa_device *dev)
continue;
fdu = fdup->id_unit;
fd = &fd_data[fdu];
- if (fdu >= (NFD))
+ if (fdu >= (NFD+NFT))
continue;
fdsu = fdup->id_physid;
/* look up what bios thinks we have */
@@ -901,11 +809,29 @@ fdattach(struct isa_device *dev)
#else
if ((fdt == RTCFDT_NONE)
#endif
+#if NFT > 0
+ || (fdsu >= DRVS_PER_CTLR)) {
+#else
) {
#ifdef PC98
fd->fdc = fdc;
#endif
fd->type = NO_TYPE;
+#endif
+#if NFT > 0
+ /* If BIOS says no floppy, or > 2nd device */
+ /* Probe for and attach a floppy tape. */
+ /* Tell FT if there was already a disk */
+ /* with this unit number found. */
+
+ unithasfd = 0;
+ if (fdu < NFD && fd->type != NO_TYPE)
+ unithasfd = 1;
+ if (ftattach(dev, fdup, unithasfd))
+ continue;
+ if (fdsu < DRVS_PER_CTLR)
+ fd->type = NO_TYPE;
+#endif
continue;
}
@@ -952,7 +878,7 @@ fdattach(struct isa_device *dev)
enable_fifo(fdc) == 0) {
printf("fdc%d: FIFO enabled", fdcu);
printf(", %d bytes threshold\n",
- fifo_threshold);
+ fifo_threshold);
}
}
if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
@@ -1141,10 +1067,10 @@ fdattach(struct isa_device *dev)
}
for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
+ fd->bdevs[1 + NUMDENS + i] = devfs_link(fd->bdevs[0],
"fd%d%c", fdu, 'a' + i);
fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
+ devfs_link(fd->cdevs[0],
"rfd%d%c", fdu, 'a' + i);
}
#endif /* DEVFS */
@@ -1163,138 +1089,6 @@ fdattach(struct isa_device *dev)
-#ifdef FDC_YE
-/*
- * this is a subset of fdattach() optimized for the Y-E Data
- * PCMCIA floppy drive.
- */
-static int yeattach(struct isa_device *dev)
-{
- fdcu_t fdcu = dev->id_unit;
- fdc_p fdc = fdc_data + fdcu;
- fdsu_t fdsu = 0; /* assume 1 drive per YE controller */
- fdu_t fdu;
- fd_p fd;
- int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
- fdc->fdcu = fdcu;
- /*
- * the FDC_PCMCIA flag is used to to indicate special PIO is used
- * instead of DMA
- */
- fdc->flags = FDC_ATTACHED|FDC_PCMCIA;
- fdc->state = DEVIDLE;
- /* reset controller, turn motor off, clear fdout mirror reg */
- outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
- bufq_init(&fdc->head);
- /*
- * assume 2 drives/ "normal" controller
- */
- fdu = fdcu * 2;
- if (fdu >= NFD) {
- printf("fdu %d >= NFD\n",fdu);
- return(0);
- };
- fd = &fd_data[fdu];
-
- set_motor(fdcu, fdsu, TURNON);
- DELAY(1000000); /* 1 sec */
- fdc->fdct = FDC_NE765;
-
- if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
- (st3 & NE7_ST3_T0)) {
- /* if at track 0, first seek inwards */
- /* seek some steps: */
- (void)fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0);
- DELAY(300000); /* ...wait a moment... */
- (void)fd_sense_int(fdc, 0, 0); /* make ctrlr happy */
- }
-
- /* If we're at track 0 first seek inwards. */
- if ((fd_sense_drive_status(fdc, &st3) == 0) && (st3 & NE7_ST3_T0)) {
- /* Seek some steps... */
- if (fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0) == 0) {
- /* ...wait a moment... */
- DELAY(300000);
- /* make ctrlr happy: */
- (void)fd_sense_int(fdc, 0, 0);
- }
- }
-
- for(i = 0; i < 2; i++) {
- /*
- * we must recalibrate twice, just in case the
- * heads have been beyond cylinder 76, since most
- * FDCs still barf when attempting to recalibrate
- * more than 77 steps
- */
- /* go back to 0: */
- if (fd_cmd(fdcu, 2, NE7CMD_RECAL, fdsu, 0) == 0) {
- /* a second being enough for full stroke seek*/
- DELAY(i == 0? 1000000: 300000);
-
- /* anything responding? */
- if (fd_sense_int(fdc, &st0, 0) == 0 &&
- (st0 & NE7_ST0_EC) == 0)
- break; /* already probed succesfully */
- }
- }
-
- set_motor(fdcu, fdsu, TURNOFF);
-
- if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */
- return(0);
-
- fd->track = FD_NO_TRACK;
- fd->fdc = fdc;
- fd->fdsu = fdsu;
- fd->options = 0;
- printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
- fd->type = FD_1440;
-
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
- return (1);
-}
-#endif
-
/****************************************************************************/
/* motor control stuff */
/* remember to not deselect the drive we're working on */
@@ -1532,6 +1326,11 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p)
int type = FDTYPE(minor(dev));
fdc_p fdc;
+#if NFT > 0
+ /* check for a tape open */
+ if (type & F_TAPE_TYPE)
+ return(ftopen(dev, flags));
+#endif
/* check bounds */
if (fdu >= NFD)
return(ENXIO);
@@ -1611,6 +1410,12 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p)
{
fdu_t fdu = FDUNIT(minor(dev));
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ if (type & F_TAPE_TYPE)
+ return ftclose(dev, flags);
+#endif
fd_data[fdu].flags &= ~FD_OPEN;
fd_data[fdu].options &= ~FDOPT_NORETRY;
@@ -1648,18 +1453,21 @@ fdstrategy(struct buf *bp)
fd = &fd_data[fdu];
fdc = fd->fdc;
fdcu = fdc->fdcu;
-#ifdef FDC_YE
- if (fd->type == NO_TYPE) {
- bp->b_error = ENXIO;
+
+#if NFT > 0
+ if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) {
+ /* ft tapes do not (yet) support strategy i/o */
+ bp->b_error = ENODEV;
bp->b_flags |= B_ERROR;
- /*
- * I _refuse_ to use a goto
- */
- biodone(bp);
- return;
- };
+ goto bad;
+ }
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY) {
+ bp->b_error = EBUSY;
+ bp->b_flags |= B_ERROR;
+ goto bad;
+ }
#endif
-
fdblk = 128 << (fd->ft->secsize);
if (!(bp->b_flags & B_FORMAT)) {
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
@@ -1797,46 +1605,21 @@ fd_pseudointr(void *arg1)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
-static void
+void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
+#if NFT > 0
+ fdu_t fdu = fdc->fdu;
+
+ if (fdc->flags & FDC_TAPE_BUSY)
+ (ftintr(fdu));
+ else
+#endif
while(fdstate(fdcu, fdc))
;
}
-#ifdef FDC_YE
-/*
- * magic pseudo-DMA initialization for YE FDC. Sets count and
- * direction
- */
-#define SET_BCDR(wr,cnt,port) outb(port,(((cnt)-1) & 0xff)); \
- outb(port+1,((wr ? 0x80 : 0) | ((((cnt)-1) >> 8) & 0x7f)))
-
-/*
- * fdcpio(): perform programmed IO read/write for YE PCMCIA floppy
- */
-static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
-{
- u_char *cptr = (u_char *)addr;
- fdc_p fdc = &fdc_data[fdcu];
- int io = fdc->baseport;
-
- if (flags & B_READ) {
- if (fdc->state != PIOREAD) {
- fdc->state = PIOREAD;
- return(0);
- };
- SET_BCDR(0,count,io);
- insb(io+FDC_YE_DATAPORT,cptr,count);
- } else {
- outsb(io+FDC_YE_DATAPORT,cptr,count);
- SET_BCDR(0,count,io);
- };
- return(1);
-}
-#endif /* FDC_YE */
-
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
@@ -1844,6 +1627,7 @@ static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
static int
fdstate(fdcu_t fdcu, fdc_p fdc)
{
+ struct subdev *sd;
int read, format, head, i, sec = 0, sectrac, st0, cyl, st3;
unsigned blknum = 0, b_cylinder = 0;
fdu_t fdu = fdc->fdu;
@@ -1852,15 +1636,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
struct fd_formb *finfo = NULL;
size_t fdblk;
- bp = fdc->bp;
- if (bp == NULL) {
- bp = bufq_first(&fdc->head);
- if (bp != NULL) {
- bufq_remove(&fdc->head, bp);
- fdc->bp = bp;
- }
- }
- if (bp == NULL) {
+ bp = bufq_first(&fdc->head);
+ if(!bp) {
/***********************************************\
* nothing left for this controller to do *
* Force into the IDLE state, *
@@ -2083,11 +1860,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
sectrac = fd->ft->sectrac;
sec = blknum % (sectrac * fd->ft->heads);
head = sec / sectrac;
@@ -2128,12 +1902,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
if(format)
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- bp->b_bcount);
-#endif
/* formatting */
if(fd_cmd(fdcu, 6,
NE7CMD_FORMAT,
@@ -2154,24 +1922,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
else
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA) {
- /*
- * this seems to be necessary even when
- * reading data
- */
- SET_BCDR(1,fdblk,fdc->baseport);
-
- /*
- * perform the write pseudo-DMA before
- * the WRITE command is sent
- */
- if (!read)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- fdblk);
- }
-#endif
if (fd_cmd(fdcu, 9,
(read ? NE7CMD_READ : NE7CMD_WRITE),
head << 2 | fdu, /* head & unit */
@@ -2192,24 +1942,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
return(retrier(fdcu));
}
}
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- /*
- * if this is a read, then simply await interrupt
- * before performing PIO
- */
- if (read && !fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,fdblk)) {
- fd->tohandle = timeout(fd_iotimeout,
- (caddr_t)fdcu, hz);
- return(0); /* will return later */
- };
-
- /*
- * write (or format) operation will fall through and
- * await completion interrupt
- */
-#endif
fdc->state = IOCOMPLETE;
fd->tohandle = timeout(fd_iotimeout, (caddr_t)fdcu, hz);
return(0); /* will return later */
@@ -2243,16 +1975,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
fdc->state = IOCOMPLETE;
}
#endif
-#ifdef FDC_YE
- case PIOREAD:
- /*
- * actually perform the PIO read. The IOCOMPLETE case
- * removes the timeout for us.
- */
- (void)fdcpio(fdcu,bp->b_flags,bp->b_data+fd->skip,fdblk);
- fdc->state = IOCOMPLETE;
- /* FALLTHROUGH */
-#endif
case IOCOMPLETE: /* IO DONE, post-analyze */
#ifdef EPSON_NRDISK
if (fdu != nrdu)
@@ -2279,11 +2001,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
#ifdef EPSON_NRDISK
}
else nrd_LED_off();
@@ -2322,7 +2041,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
{
/* ALL DONE */
fd->skip = 0;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fd->device_stats,
bp->b_bcount - bp->b_resid,
@@ -2451,10 +2170,12 @@ static int
retrier(fdcu)
fdcu_t fdcu;
{
+ struct subdev *sd;
fdc_p fdc = fdc_data + fdcu;
register struct buf *bp;
+ int fdu;
- bp = fdc->bp;
+ bp = bufq_first(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -2498,7 +2219,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid += bp->b_bcount - fdc->fd->skip;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fdc->fd->device_stats,
@@ -2607,6 +2328,14 @@ fdioctl(dev, cmd, addr, flag, p)
char buffer[DEV_BSIZE];
int error = 0;
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ /* check for a tape ioctl */
+ if (type & F_TAPE_TYPE)
+ return ftioctl(dev, cmd, addr, flag, p);
+#endif
+
fdblk = 128 << fd->ft->secsize;
#ifdef PC98
diff --git a/sys/pc98/pc98/if_ed.c b/sys/pc98/pc98/if_ed.c
index b34898e3e80e..9b7f815e1d28 100644
--- a/sys/pc98/pc98/if_ed.c
+++ b/sys/pc98/pc98/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.57 1998/12/31 03:23:39 kato Exp $
+ * $Id: if_ed.c,v 1.53 1998/10/08 17:04:58 kato Exp $
*/
/*
@@ -49,7 +49,6 @@
* MELCO LPC-TJ, LPC-TS, LGY-98, LGH-98, IND-SP, IND-SS, EGY-98
* PLANET SMART COM CREDITCARD/2000 PCMCIA, EN-2298
* Contec C-NET(98), C-NET(98)E, C-NET(98)L, C-NET(98)E-A, C-NET(98)L-A
- * SMC EtherEZ98
*
* Modified for FreeBSD(98) 2.2 by KATO T. of Nagoya University.
*
@@ -180,7 +179,6 @@ static int ed_attach __P((struct ed_softc *, int, int));
static int ed_attach_isa __P((struct isa_device *));
static void ed_init __P((void *));
-static ointhand2_t edintr;
static int ed_ioctl __P((struct ifnet *, u_long, caddr_t));
static int ed_probe __P((struct isa_device *));
static void ed_start __P((struct ifnet *));
@@ -241,7 +239,6 @@ static u_long ds_crc __P((u_char *ep));
#endif
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -252,7 +249,17 @@ static int edinit __P((struct pccard_devinfo *));
static void edunload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ed, edinit, edunload, card_intr, 0, net_imask);
+static struct pccard_device ed_info = {
+ "ed",
+ edinit,
+ edunload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, ed_info);
/*
* Initialize the device - called from Slot manager.
@@ -349,16 +356,6 @@ static unsigned short ed_intr_mask[] = {
* Interrupt conversion table for 83C790
*/
static unsigned short ed_790_intr_mask[] = {
-#ifdef PC98
- 0,
- IRQ3,
- IRQ5,
- IRQ6,
- 0,
- IRQ9,
- IRQ12,
- IRQ13
-#else
0,
IRQ9,
IRQ3,
@@ -367,7 +364,6 @@ static unsigned short ed_790_intr_mask[] = {
IRQ10,
IRQ11,
IRQ15
-#endif
};
/*
@@ -2485,7 +2481,6 @@ ed_attach_isa(isa_dev)
struct ed_softc *sc = &ed_softc[unit];
int flags = isa_dev->id_flags;
- isa_dev->id_ointr = edintr;
return ed_attach(sc, unit, flags);
}
@@ -3322,7 +3317,7 @@ edintr_sc(sc)
}
}
-static void
+void
edintr(unit)
int unit;
{
@@ -4283,7 +4278,7 @@ edpnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = edintr;
+ dev->id_intr = edintr;
dev->id_drq = -1;
if (dev->id_driver == NULL) {
diff --git a/sys/pc98/pc98/if_ed98.h b/sys/pc98/pc98/if_ed98.h
index 19d07d08dd07..632006437273 100644
--- a/sys/pc98/pc98/if_ed98.h
+++ b/sys/pc98/pc98/if_ed98.h
@@ -26,7 +26,7 @@
*/
/*
- * PC-9801 specific definitions for DP8390/SMC8216 NICs.
+ * PC-9801 specific definitions for National Semiconductor DP8390 NIC.
*/
#ifndef __PC98_PC98_IF_ED98_H__
#define __PC98_PC98_IF_ED98_H__
@@ -47,22 +47,30 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
/*
* Register offsets/total
*/
+#ifdef ED_NOVELL_NIC_OFFSET
#undef ED_NOVELL_NIC_OFFSET
+#endif
#define ED_NOVELL_NIC_OFFSET sc->edreg.nic_offset
+#ifdef ED_NOVELL_ASIC_OFFSET
#undef ED_NOVELL_ASIC_OFFSET
+#endif
#define ED_NOVELL_ASIC_OFFSET sc->edreg.asic_offset
/*
* Remote DMA data register; for reading or writing to the NIC mem
* via programmed I/O (offset from ASIC base).
*/
+#ifdef ED_NOVELL_DATA
#undef ED_NOVELL_DATA
+#endif
#define ED_NOVELL_DATA sc->edreg.data
/*
* Reset register; reading from this register causes a board reset.
*/
+#ifdef ED_NOVELL_RESET
#undef ED_NOVELL_RESET
+#endif
#define ED_NOVELL_RESET sc->edreg.reset
/*
@@ -82,20 +90,20 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
* 0xa0 Contec C-NET(98).
* 0xb0 Contec C-NET(98)E/L.
*/
-#define ED_TYPE98_BASE 0x80
-
-#define ED_TYPE98_GENERIC 0x80
-#define ED_TYPE98_LPC 0x81
-#define ED_TYPE98_BDN 0x82
-#define ED_TYPE98_EGY 0x83
-#define ED_TYPE98_LGY 0x84
-#define ED_TYPE98_ICM 0x85
-#define ED_TYPE98_SIC 0x86
-#define ED_TYPE98_108 0x88
-#define ED_TYPE98_LA98 0x89
-#define ED_TYPE98_CNET98 0x8a
-#define ED_TYPE98_CNET98EL 0x8b
-#define ED_TYPE98_UE2212 0x8c
+#define ED_TYPE98_BASE 0x10
+
+#define ED_TYPE98_GENERIC 0x10
+#define ED_TYPE98_LPC 0x11
+#define ED_TYPE98_BDN 0x12
+#define ED_TYPE98_EGY 0x13
+#define ED_TYPE98_LGY 0x14
+#define ED_TYPE98_ICM 0x15
+#define ED_TYPE98_SIC 0x16
+#define ED_TYPE98_108 0x18
+#define ED_TYPE98_LA98 0x19
+#define ED_TYPE98_CNET98 0x1a
+#define ED_TYPE98_CNET98EL 0x1b
+#define ED_TYPE98_UE2212 0x1c
#define ED_TYPE98(x) (((x & 0xffff0000) >> 20) | ED_TYPE98_BASE)
#define ED_TYPE98SUB(x) ((x & 0xf0000) >> 16)
@@ -247,10 +255,14 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
#define ED_P2_IMR sc->edreg.port[0x0f]
/* PCCARD */
+#ifdef ED_PC_MISC
#undef ED_PC_MISC
+#endif
#define ED_PC_MISC sc->edreg.pc_misc
+#ifdef ED_PC_RESET
#undef ED_PC_RESET
-#define ED_PC_RESET sc->edreg.pc_reset
+#endif
+#define ED_PC_RESET sc->edreg.pc_reset
/* LPC-T support */
#define LPCT_1d0_ON() \
@@ -385,9 +397,6 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
int nports;
sc->type = type;
- ED_PC_MISC = 0x18; /* dummy for NON-PCCard */
- ED_PC_RESET = 0x1f; /* same above */
-
switch (type) {
case ED_TYPE98_GENERIC:
sc->edreg.port = edp_generic;
@@ -395,6 +404,8 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
ED_NOVELL_ASIC_OFFSET = 0x0010;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x000f;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 32;
break;
@@ -404,24 +415,30 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
ED_NOVELL_ASIC_OFFSET = 0x0200;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x0100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_EGY:
sc->edreg.port = edp_egy98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0200;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x0100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_ICM:
sc->edreg.port = edp_generic;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0100;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x000f;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
@@ -429,8 +446,10 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
sc->edreg.port = edp_la98;
ED_NOVELL_NIC_OFFSET = 0x0000;
ED_NOVELL_ASIC_OFFSET = 0x0100;
- ED_NOVELL_DATA = 0x0000;
+ ED_NOVELL_DATA = 0;
ED_NOVELL_RESET = 0xc100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 1;
break;
@@ -438,8 +457,10 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
sc->edreg.port = edp_sic98;
ED_NOVELL_NIC_OFFSET = 0x0000;
ED_NOVELL_ASIC_OFFSET = 0x2000;
- ED_NOVELL_DATA = 0; /* dummy */
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_DATA = 0x00; /* dummy */
+ ED_NOVELL_RESET = 0x00;
+ ED_PC_MISC = 0x18; /* dummy */
+ ED_PC_RESET = 0x1f; /* dummy */
nports = 1;
break;
@@ -457,58 +478,47 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
case ED_TYPE98_108:
sc->edreg.port = edp_nec108;
adj = (iobase & 0xf000) / 2;
- ED_NOVELL_NIC_OFFSET = 0x0000;
- ED_NOVELL_ASIC_OFFSET = (0x0888 | adj) - iobase;
- ED_NOVELL_DATA = 0x0000;
- ED_NOVELL_RESET = 0x0002;
+ ED_NOVELL_NIC_OFFSET = 0;
+ ED_NOVELL_ASIC_OFFSET = (0x888 | adj) - iobase;
+ ED_NOVELL_DATA = 0;
+ ED_NOVELL_RESET = 2;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_LA98:
sc->edreg.port = edp_la98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
- ED_NOVELL_ASIC_OFFSET = 0x0100;
+ ED_NOVELL_NIC_OFFSET = 0;
+ ED_NOVELL_ASIC_OFFSET = 0x100;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0xf000;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 1;
break;
case ED_TYPE98_CNET98EL:
sc->edreg.port = edp_generic;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0400;
ED_NOVELL_DATA = 0x000e;
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_RESET = 0x0000; /* dummy */
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_CNET98:
sc->edreg.port = edp_cnet98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0400;
- ED_NOVELL_DATA = 0; /* dummy */
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_DATA = 0x0000;
+ ED_NOVELL_RESET = 0x0000; /* dummy */
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
}
return nports;
}
-/*
- * SMC EtherEZ98(SMC8498BTA)
- *
- * A sample of kernel conf is as follows.
- * #device ed0 at isa? port 0x10d0 net irq 6 iomem 0xc8000 vector edintr
- */
-#undef ED_WD_NIC_OFFSET
-#define ED_WD_NIC_OFFSET 0x100 /* I/O base offset to NIC */
-#undef ED_WD_ASIC_OFFSET
-#define ED_WD_ASIC_OFFSET 0 /* I/O base offset to ASIC */
-/*
- * XXX - The I/O address range is fragmented in the EtherEZ98;
- * it occupies 16*2 I/O addresses, by the way.
- */
-#undef ED_WD_IO_PORTS
-#define ED_WD_IO_PORTS 16 /* # of i/o addresses used */
-
#endif /* __PC98_PC98_IF_ED98_H__ */
diff --git a/sys/pc98/pc98/if_fe.c b/sys/pc98/pc98/if_fe.c
new file mode 100644
index 000000000000..64b3091572cb
--- /dev/null
+++ b/sys/pc98/pc98/if_fe.c
@@ -0,0 +1,3824 @@
+/*
+ * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
+ *
+ * This software may be used, modified, copied, distributed, and sold, in
+ * both source and binary form provided that the above copyright, these
+ * terms and the following disclaimer are retained. The name of the author
+ * and/or the contributor 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 AND THE CONTRIBUTOR ``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 THE CONTRIBUTOR 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.
+ */
+
+/*
+ * $Id: if_fe.c,v 1.33 1998/10/08 17:06:32 kato Exp $
+ *
+ * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
+ * To be used with FreeBSD 2.x
+ * Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
+ *
+ * This version is intended to be a generic template for various
+ * MB86960A/MB86965A based Ethernet cards. It currently supports
+ * Fujitsu FMV-180 series for ISA and Allied-Telesis AT1700/RE2000
+ * series for ISA, as well as Fujitsu MBH10302 PC card.
+ * There are some currently-
+ * unused hooks embedded, which are primarily intended to support
+ * other types of Ethernet cards, but the author is not sure whether
+ * they are useful.
+ *
+ * This version also includes some alignments for
+ * RE1000/RE1000+/ME1500 support. It is incomplete, however, since the
+ * cards are not for AT-compatibles. (They are for PC98 bus -- a
+ * proprietary bus architecture available only in Japan.) Further
+ * work for PC98 version will be available as a part of FreeBSD(98)
+ * project.
+ *
+ * This software is a derivative work of if_ed.c version 1.56 by David
+ * Greenman available as a part of FreeBSD 2.0 RELEASE source distribution.
+ *
+ * The following lines are retained from the original if_ed.c:
+ *
+ * Copyright (C) 1993, David Greenman. This software may be used, modified,
+ * copied, distributed, and sold, in both source and binary form provided
+ * that the above copyright and these terms are retained. Under no
+ * circumstances is the author responsible for the proper functioning
+ * of this software, nor does the author assume any responsibility
+ * for damages incurred with its use.
+ */
+
+/*
+ * Modified for Allied-Telesis RE1000 series.
+ */
+
+
+/*
+ * TODO:
+ * o To support MBH10304 PC card. It is another MB8696x based
+ * PCMCIA Ethernet card by Fujitsu, which is not compatible with
+ * MBH10302.
+ * o To merge FreeBSD(98) efforts into a single source file.
+ * o To support ISA PnP auto configuration for FMV-183/184.
+ * o To reconsider mbuf usage.
+ * o To reconsider transmission buffer usage, including
+ * transmission buffer size (currently 4KB x 2) and pros-and-
+ * cons of multiple frame transmission.
+ * o To test IPX codes.
+ */
+
+#include "fe.h"
+#include "bpfilter.h"
+#include "opt_inet.h"
+#include "opt_ipx.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+/* IPX code is not tested. FIXME. */
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
+/* To be used with IPv6 package of INRIA. */
+#ifdef INET6
+/* IPv6 added by shin 96.2.6 */
+#include <netinet/if_ether6.h>
+#endif
+
+/* XNS code is not tested. FIXME. */
+#ifdef NS
+#include <netns/ns.h>
+#include <netns/ns_if.h>
+#endif
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/icu.h>
+
+/* PCCARD suport */
+#include "card.h"
+#if NCARD > 0
+#include <sys/kernel.h>
+#include <sys/select.h>
+#include <pccard/cardinfo.h>
+#include <pccard/slot.h>
+#endif
+
+#include <i386/isa/ic/mb86960.h>
+#include <i386/isa/if_fereg.h>
+
+/*
+ * This version of fe is an ISA device driver.
+ * Override the following macro to adapt it to another bus.
+ * (E.g., PC98.)
+ */
+#define DEVICE struct isa_device
+
+/*
+ * Default settings for fe driver specific options.
+ * They can be set in config file by "options" statements.
+ */
+
+/*
+ * Debug control.
+ * 0: No debug at all. All debug specific codes are stripped off.
+ * 1: Silent. No debug messages are logged except emergent ones.
+ * 2: Brief. Lair events and/or important information are logged.
+ * 3: Detailed. Logs all information which *may* be useful for debugging.
+ * 4: Trace. All actions in the driver is logged. Super verbose.
+ */
+#ifndef FE_DEBUG
+#define FE_DEBUG 1
+#endif
+
+/*
+ * Transmit just one packet per a "send" command to 86960.
+ * This option is intended for performance test. An EXPERIMENTAL option.
+ */
+#ifndef FE_SINGLE_TRANSMISSION
+#define FE_SINGLE_TRANSMISSION 0
+#endif
+
+/*
+ * Device configuration flags.
+ */
+
+/* DLCR6 settings. */
+#define FE_FLAGS_DLCR6_VALUE 0x007F
+
+/* Force DLCR6 override. */
+#define FE_FLAGS_OVERRIDE_DLCR6 0x0080
+
+/* Shouldn't these be defined somewhere else such as isa_device.h? */
+#define NO_IOADDR (-1)
+#define NO_IRQ 0
+
+/*
+ * Data type for a multicast address filter on 8696x.
+ */
+struct fe_filter { u_char data [ FE_FILTER_LEN ]; };
+
+/*
+ * Special filter values.
+ */
+static struct fe_filter const fe_filter_nothing = { FE_FILTER_NOTHING };
+static struct fe_filter const fe_filter_all = { FE_FILTER_ALL };
+
+/* How many registers does an fe-supported adapter have at maximum? */
+#define MAXREGISTERS 32
+
+/*
+ * fe_softc: per line info and status
+ */
+static struct fe_softc {
+
+ /* Used by "common" codes. */
+ struct arpcom arpcom; /* Ethernet common */
+
+ /* Used by config codes. */
+
+ /* Set by probe() and not modified in later phases. */
+ char * typestr; /* printable name of the interface. */
+ u_short iobase; /* base I/O address of the adapter. */
+ u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of register. */
+ u_short txb_size; /* size of TX buffer, in bytes */
+ u_char proto_dlcr4; /* DLCR4 prototype. */
+ u_char proto_dlcr5; /* DLCR5 prototype. */
+ u_char proto_dlcr6; /* DLCR6 prototype. */
+ u_char proto_dlcr7; /* DLCR7 prototype. */
+ u_char proto_bmpr13; /* BMPR13 prototype. */
+ u_char proto_bmpr14; /* BMPR14 prototype. */
+
+ /* Vendor specific hooks. */
+ void ( * init )( struct fe_softc * ); /* Just before fe_init(). */
+ void ( * stop )( struct fe_softc * ); /* Just after fe_stop(). */
+
+ /* Transmission buffer management. */
+ u_short txb_free; /* free bytes in TX buffer */
+ u_char txb_count; /* number of packets in TX buffer */
+ u_char txb_sched; /* number of scheduled packets */
+
+ /* Excessive collision counter (see fe_tint() for details. */
+ u_char tx_excolls; /* # of excessive collisions. */
+
+ /* Multicast address filter management. */
+ u_char filter_change; /* MARs must be changed ASAP. */
+ struct fe_filter filter;/* new filter value. */
+
+} fe_softc[NFE];
+
+#define sc_if arpcom.ac_if
+#define sc_unit arpcom.ac_if.if_unit
+#define sc_enaddr arpcom.ac_enaddr
+
+/* Standard driver entry points. These can be static. */
+static int fe_probe ( struct isa_device * );
+static int fe_attach ( struct isa_device * );
+static void fe_init ( int );
+static int fe_ioctl ( struct ifnet *, u_long, caddr_t );
+static void fe_start ( struct ifnet * );
+static void fe_reset ( int );
+static void fe_watchdog ( struct ifnet * );
+
+/* Local functions. Order of declaration is confused. FIXME. */
+#ifdef PC98
+static int fe_probe_re1000 ( DEVICE *, struct fe_softc * );
+static int fe_probe_re1000p( DEVICE *, struct fe_softc * );
+static int fe_probe_cnet9ne ( DEVICE *, struct fe_softc * );
+static int fe_probe_cnet98p2( DEVICE *, struct fe_softc * );
+#else
+static int fe_probe_fmv ( DEVICE *, struct fe_softc * );
+static int fe_probe_ati ( DEVICE *, struct fe_softc * );
+static void fe_init_ati ( struct fe_softc * );
+#endif /* PC98 */
+static int fe_probe_gwy ( DEVICE *, struct fe_softc * );
+#if NCARD > 0
+static int fe_probe_mbh ( DEVICE *, struct fe_softc * );
+static void fe_init_mbh ( struct fe_softc * );
+static int fe_probe_tdk ( DEVICE *, struct fe_softc * );
+#endif
+static int fe_get_packet ( struct fe_softc *, u_short );
+static void fe_stop ( int );
+static void fe_tint ( struct fe_softc *, u_char );
+static void fe_rint ( struct fe_softc *, u_char );
+static void fe_xmit ( struct fe_softc * );
+static void fe_emptybuffer ( struct fe_softc * );
+static void fe_write_mbufs ( struct fe_softc *, struct mbuf * );
+static struct fe_filter
+ fe_mcaf ( struct fe_softc * );
+static int fe_hash ( u_char * );
+static void fe_setmode ( struct fe_softc * );
+static void fe_loadmar ( struct fe_softc * );
+#if FE_DEBUG >= 1
+static void fe_dump ( int, struct fe_softc *, char * );
+#endif
+
+/* Driver struct used in the config code. This must be public (external.) */
+struct isa_driver fedriver =
+{
+ fe_probe,
+ fe_attach,
+ "fe",
+ 1 /* It's safe to mark as "sensitive" */
+};
+
+/*
+ * Fe driver specific constants which relate to 86960/86965.
+ */
+
+/* Interrupt masks */
+#define FE_TMASK ( FE_D2_COLL16 | FE_D2_TXDONE )
+#define FE_RMASK ( FE_D3_OVRFLO | FE_D3_CRCERR \
+ | FE_D3_ALGERR | FE_D3_SRTPKT | FE_D3_PKTRDY )
+
+/* Maximum number of iterations for a receive interrupt. */
+#define FE_MAX_RECV_COUNT ( ( 65536 - 2048 * 2 ) / 64 )
+ /*
+ * Maximum size of SRAM is 65536,
+ * minimum size of transmission buffer in fe is 2x2KB,
+ * and minimum amount of received packet including headers
+ * added by the chip is 64 bytes.
+ * Hence FE_MAX_RECV_COUNT is the upper limit for number
+ * of packets in the receive buffer.
+ */
+
+/*
+ * Routines to access contiguous I/O ports.
+ */
+
+static void
+inblk ( struct fe_softc * sc, int offs, u_char * mem, int len )
+{
+ while ( --len >= 0 ) {
+ *mem++ = inb( sc->ioaddr[ offs++ ] );
+ }
+}
+
+static void
+outblk ( struct fe_softc * sc, int offs, u_char const * mem, int len )
+{
+ while ( --len >= 0 ) {
+ outb( sc->ioaddr[ offs++ ], *mem++ );
+ }
+}
+
+/* PCCARD Support */
+#if NCARD > 0
+/*
+ * PC-Card (PCMCIA) specific code.
+ */
+static int feinit ( struct pccard_devinfo * );
+static void feunload ( struct pccard_devinfo * );
+static int fe_card_intr ( struct pccard_devinfo * );
+
+static struct pccard_device fe_info = {
+ "fe",
+ feinit,
+ feunload,
+ fe_card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* XXX - Should this also include tty_imask? */
+};
+
+DATA_SET(pccarddrv_set, fe_info);
+
+/*
+ * Initialize the device - called from Slot manager.
+ */
+static int
+feinit(struct pccard_devinfo *devi)
+{
+ struct fe_softc *sc;
+
+ /* validate unit number. */
+ if (devi->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
+#if FE_DEBUG >= 2
+ printf("Start Probe\n");
+#endif
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[devi->isahd.id_unit];
+ sc->sc_unit = devi->isahd.id_unit;
+ sc->iobase = devi->isahd.id_iobase;
+
+ /* Use Ethernet address got from CIS, if one is available. */
+ if ((devi->misc[0] & 0x03) == 0x00
+ && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
+ /* Yes, it looks like a valid Ether address. */
+ bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
+ } else {
+ /* Indicate we have no Ether address in CIS. */
+ bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
+ }
+
+ /* Probe supported PC card models. */
+ if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
+ fe_probe_mbh(&devi->isahd, sc) == 0)
+ return (ENXIO);
+#if FE_DEBUG >= 2
+ printf("Start attach\n");
+#endif
+ if (fe_attach(&devi->isahd) == 0)
+ return (ENXIO);
+
+ return (0);
+}
+
+/*
+ * feunload - unload the driver and clear the table.
+ * XXX TODO:
+ * This is usually called when the card is ejected, but
+ * can be caused by a modunload of a controller driver.
+ * The idea is to reset the driver's view of the device
+ * and ensure that any driver entry points such as
+ * read and write do not hang.
+ */
+static void
+feunload(struct pccard_devinfo *devi)
+{
+ struct fe_softc *sc = &fe_softc[devi->isahd.id_unit];
+ printf("fe%d: unload\n", devi->isahd.id_unit);
+ fe_stop(devi->isahd.id_unit);
+}
+
+/*
+ * fe_card_intr - Shared interrupt called from
+ * front end of PC-Card handler.
+ */
+static int
+fe_card_intr(struct pccard_devinfo *devi)
+{
+ feintr(devi->isahd.id_unit);
+ return (1);
+}
+#endif /* NCARD > 0 */
+
+
+/*
+ * Hardware probe routines.
+ */
+
+/* How and where to probe; to support automatic I/O address detection. */
+struct fe_probe_list
+{
+ int ( * probe ) ( DEVICE *, struct fe_softc * );
+ u_short const * addresses;
+};
+
+/* Lists of possible addresses. */
+#ifdef PC98
+static u_short const fe_re1000_addr [] =
+ { 0x0D0, 0x0D2, 0x0D4, 0x0D6, 0x0D8, 0x0DA, 0x0DC, 0x0DE,
+ 0x1D0, 0x1D2, 0x1D4, 0x1D6, 0x1D8, 0x1DA, 0x1DC, 0x1DE, 0 };
+static u_short const fe_re1000p_addr [] =
+ { 0x0D0, 0x0D2, 0x0D4, 0x0D8, 0x1D4, 0x1D6, 0x1D8, 0x1DA, 0 };
+static u_short const fe_cnet9ne_addr [] =
+ { 0x73D0, 0 };
+static u_short const fe_cnet98p2_addr [] =
+ { 0x03D0, 0x13D0, 0x23D0, 0x33D0, 0x43D0, 0x53D0, 0x63D0,
+ 0x73D0, 0x83D0, 0x93D0, 0xA3D0, 0xB3D0, 0xC3D0, 0xD3D0, 0 };
+#else
+static u_short const fe_fmv_addr [] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340, 0 };
+static u_short const fe_ati_addr [] =
+ { 0x240, 0x260, 0x280, 0x2A0, 0x300, 0x320, 0x340, 0x380, 0 };
+#endif
+
+static struct fe_probe_list const fe_probe_list [] =
+{
+#ifdef PC98
+ { fe_probe_re1000, fe_re1000_addr },
+ { fe_probe_re1000p, fe_re1000p_addr },
+ /* XXX: We must probe C-NET(98)P2 after C-NET(9N)E. */
+ { fe_probe_cnet9ne, fe_cnet9ne_addr },
+ { fe_probe_cnet98p2, fe_cnet98p2_addr },
+#else
+ { fe_probe_fmv, fe_fmv_addr },
+ { fe_probe_ati, fe_ati_addr },
+#endif
+ { fe_probe_gwy, NULL }, /* GWYs cannot be auto detected. */
+ { NULL, NULL }
+};
+
+
+/*
+ * Determine if the device is present
+ *
+ * on entry:
+ * a pointer to an isa_device struct
+ * on exit:
+ * zero if device not found
+ * or number of i/o addresses used (if found)
+ */
+
+static int
+fe_probe ( DEVICE * dev )
+{
+ struct fe_softc * sc;
+ int u;
+ int nports;
+ struct fe_probe_list const * list;
+ u_short const * addr;
+ u_short single [ 2 ];
+
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[ dev->id_unit ];
+ sc->sc_unit = dev->id_unit;
+
+ /* TODO: Should be in each probe routines */
+ sc->proto_bmpr14 = 0;
+
+ /* Probe each possibility, one at a time. */
+ for ( list = fe_probe_list; list->probe != NULL; list++ ) {
+
+ if ( dev->id_iobase != NO_IOADDR ) {
+ /* Probe one specific address. */
+ single[ 0 ] = dev->id_iobase;
+ single[ 1 ] = 0;
+ addr = single;
+ } else if ( list->addresses != NULL ) {
+ /* Auto detect. */
+ addr = list->addresses;
+ } else {
+ /* We need a list of addresses to do auto detect. */
+ continue;
+ }
+
+ /* Probe all possible addresses for the board. */
+ while ( *addr != 0 ) {
+
+ /* See if the address is already in use. */
+ for ( u = 0; u < NFE; u++ ) {
+ if ( fe_softc[u].iobase == *addr ) break;
+ }
+
+#if FE_DEBUG >= 3
+ if ( u == NFE ) {
+ log( LOG_INFO, "fe%d: probing %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else if ( u == sc->sc_unit ) {
+ log( LOG_INFO, "fe%d: re-probing %d at 0x%x?\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else {
+ log( LOG_INFO, "fe%d: skipping %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ }
+#endif
+
+ /* Probe the address if it is free. */
+ if ( u == NFE || u == sc->sc_unit ) {
+
+ /* Probe an address. */
+ sc->iobase = *addr;
+ nports = list->probe( dev, sc );
+ if ( nports > 0 ) {
+ /* Found. */
+ dev->id_iobase = *addr;
+ return ( nports );
+ }
+ sc->iobase = 0;
+ }
+
+ /* Try next. */
+ addr++;
+ }
+ }
+
+ /* Probe failed. */
+ return ( 0 );
+}
+
+/*
+ * Check for specific bits in specific registers have specific values.
+ */
+struct fe_simple_probe_struct
+{
+ u_char port; /* Offset from the base I/O address. */
+ u_char mask; /* Bits to be checked. */
+ u_char bits; /* Values to be compared against. */
+};
+
+static int
+fe_simple_probe ( struct fe_softc const * sc,
+ struct fe_simple_probe_struct const * sp )
+{
+ struct fe_simple_probe_struct const * p;
+
+ for ( p = sp; p->mask != 0; p++ ) {
+#if FE_DEBUG >=2
+ printf("Probe Port:%x,Value:%x,Mask:%x.Bits:%x\n",
+ p->port,inb(sc->ioaddr[ p->port]),p->mask,p->bits);
+#endif
+ if ( ( inb( sc->ioaddr[ p->port ] ) & p->mask ) != p->bits )
+ {
+ return ( 0 );
+ }
+ }
+ return ( 1 );
+}
+
+/*
+ * Routines to read all bytes from the config EEPROM through MB86965A.
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? (Or, why all similar codes I tried previously doesn't
+ * work.) FIXME.
+ */
+
+static void
+fe_strobe_eeprom ( u_short bmpr16 )
+{
+ /*
+ * We must guarantee 800ns (or more) interval to access slow
+ * EEPROMs. The following redundant code provides enough
+ * delay with ISA timing. (Even if the bus clock is "tuned.")
+ * Some modification will be needed on faster busses.
+ */
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
+ outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
+}
+
+static void
+fe_read_eeprom ( struct fe_softc * sc, u_char * data )
+{
+ u_short bmpr16 = sc->ioaddr[ FE_BMPR16 ];
+ u_short bmpr17 = sc->ioaddr[ FE_BMPR17 ];
+ u_char n, val, bit;
+
+ /* Read bytes from EEPROM; two bytes per an iteration. */
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
+
+ /* Reset the EEPROM interface. */
+ outb( bmpr16, 0x00 );
+ outb( bmpr17, 0x00 );
+
+ /* Start EEPROM access. */
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr17, FE_B17_DATA );
+ fe_strobe_eeprom( bmpr16 );
+
+ /* Pass the iteration count to the chip. */
+ val = 0x80 | n;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr17, ( val & bit ) ? FE_B17_DATA : 0 );
+ fe_strobe_eeprom( bmpr16 );
+ }
+ outb( bmpr17, 0x00 );
+
+ /* Read a byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ fe_strobe_eeprom( bmpr16 );
+ if ( inb( bmpr17 ) & FE_B17_DATA ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ /* Read one more byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ fe_strobe_eeprom( bmpr16 );
+ if ( inb( bmpr17 ) & FE_B17_DATA ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+ }
+
+ /* Reset the EEPROM interface, again. */
+ outb( bmpr16, 0x00 );
+ outb( bmpr17, 0x00 );
+
+#if FE_DEBUG >= 3
+ /* Report what we got. */
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
+#endif
+}
+
+/*
+ * Hardware (vendor) specific probe routines.
+ */
+
+#ifdef PC98
+/*
+ * Probe and initialization for Allied-Telesis RE1000 series.
+ */
+static int
+fe_probe_re1000 ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i, n;
+ int dlcr6, dlcr7;
+ u_char c = 0;
+
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ5, IRQ6, IRQ12 };
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for RE1000\n", sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + (i/2)*0x200 + (i%2);
+ }
+
+ /*
+ * RE1000 does not use 86965 EEPROM interface.
+ */
+ c ^= sc->sc_enaddr[0] = inb(sc->ioaddr[FE_RE1000_MAC0]);
+ c ^= sc->sc_enaddr[1] = inb(sc->ioaddr[FE_RE1000_MAC1]);
+ c ^= sc->sc_enaddr[2] = inb(sc->ioaddr[FE_RE1000_MAC2]);
+ c ^= sc->sc_enaddr[3] = inb(sc->ioaddr[FE_RE1000_MAC3]);
+ c ^= sc->sc_enaddr[4] = inb(sc->ioaddr[FE_RE1000_MAC4]);
+ c ^= sc->sc_enaddr[5] = inb(sc->ioaddr[FE_RE1000_MAC5]);
+ c ^= inb(sc->ioaddr[FE_RE1000_MACCHK]);
+ if (c != 0) return 0;
+
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
+
+ /*
+ * check interrupt configure
+ */
+ for (n=0; n<4; n++) {
+ if (isa_dev->id_irq == irqmap[n]) break;
+ }
+ if (n == 4) return 0;
+
+ /*
+ * set irq
+ */
+ c = inb(sc->ioaddr[FE_RE1000_IRQCONF]);
+ c &= (~ FE_RE1000_IRQCONF_IRQ);
+ c |= (1 << (n + FE_RE1000_IRQCONF_IRQSHIFT));
+ outb(sc->ioaddr[FE_RE1000_IRQCONF], c);
+
+ sc->typestr = "RE1000";
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "RE1000 found" );
+#endif
+
+ /* Initialize 86965. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY(200);
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_re1000()" );
+#endif
+
+ /*
+ * That's all. RE1000 occupies 2*16 I/O addresses, by the way.
+ */
+ return 2; /* ??? */
+}
+
+/*
+ * Probe and initialization for Allied-Telesis RE1000Plus/ME1500 series.
+ */
+static int
+fe_probe_re1000p ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i, n, signature;
+ int dlcr6, dlcr7;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ5, IRQ6, IRQ12 };
+ static struct fe_simple_probe_struct const probe_signature1 [] = {
+ { FE_DLCR0, 0xBF, 0x00 },
+ { FE_DLCR2, 0xFF, 0x00 },
+ { FE_DLCR4, 0x0F, 0x06 },
+ { FE_DLCR6, 0x0F, 0x06 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const probe_signature2 [] = {
+ { FE_DLCR1, 0xFF, 0x00 },
+ { FE_DLCR3, 0xFF, 0x00 },
+ { FE_DLCR5, 0xFF, 0x41 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x71, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR5, 0x80, 0x00 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const vendor_code [] = {
+ { FE_DLCR8, 0xFF, 0x00 },
+ { FE_DLCR9, 0xFF, 0x00 },
+ { FE_DLCR10, 0xFF, 0xF4 },
+ { 0 }
+ };
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for RE1000Plus/ME1500\n", sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + (i/2)*0x200 + (i%2);
+ }
+ for ( i = 16; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i*0x200 - 0x1000;
+ }
+
+ /* First, check the "signature" */
+ signature = 0;
+ if (fe_simple_probe(sc, probe_signature1)) {
+ outb(sc->ioaddr[FE_DLCR6], (inb(sc->ioaddr[FE_DLCR6]) & 0xCF) | 0x16);
+ if (fe_simple_probe(sc, probe_signature2))
+ signature = 1;
+ }
+
+ /*
+ * If the "signature" not detected, 86965 *might* be previously
+ * initialized. So, check the Ethernet address here.
+ *
+ * Allied-Telesis uses 00 00 F4 ?? ?? ??.
+ */
+ if (signature == 0) {
+ /* Simple check */
+ if (!fe_simple_probe(sc, probe_table)) return 0;
+
+ /* Disable DLC */
+ dlcr6 = inb(sc->ioaddr[FE_DLCR6]);
+ outb(sc->ioaddr[FE_DLCR6], dlcr6 | FE_D6_DLC_DISABLE);
+ /* Select register bank for DLCR */
+ dlcr7 = inb(sc->ioaddr[FE_DLCR7]);
+ outb(sc->ioaddr[FE_DLCR7], dlcr7 & 0xF3 | FE_D7_RBS_DLCR);
+
+ /* Check the Ethernet address */
+ if (!fe_simple_probe(sc, vendor_code)) return 0;
+
+ /* Restore configuration registers */
+ DELAY(200);
+ outb(sc->ioaddr[FE_DLCR6], dlcr6);
+ outb(sc->ioaddr[FE_DLCR7], dlcr7);
+ }
+
+ /*
+ * We are now almost sure we have an 86965 at the given
+ * address. So, read EEPROM through 86965. We have to write
+ * into LSI registers to read from EEPROM. I want to avoid it
+ * at this stage, but I cannot test the presense of the chip
+ * any further without reading EEPROM. FIXME.
+ */
+ fe_read_eeprom( sc, eeprom );
+
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[FE_BMPR19] ) ) {
+ return 0;
+ }
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ sc->typestr = "RE1000Plus/ME1500";
+
+ /*
+ * Read IRQ configuration.
+ */
+ n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ ) >> FE_B19_IRQ_SHIFT;
+ isa_dev->id_irq = irqmap[n];
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "RE1000Plus/ME1500 found" );
+#endif
+
+ /* Initialize 86965. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY(200);
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_re1000p()" );
+#endif
+
+ /*
+ * That's all. RE1000Plus/ME1500 occupies 2*16 I/O addresses, by the way.
+ */
+ return 2; /* ??? */
+}
+
+/*
+ * Probe and initialization for Contec C-NET(9N)E series.
+ */
+
+/* TODO: Should be in "if_fereg.h" */
+#define FE_CNET9NE_INTR 0x10 /* Interrupt Mask? */
+#define FE_CNET9NE_MAC0 0x11 /* Station(MAC) address */
+#define FE_CNET9NE_MAC1 0x13
+#define FE_CNET9NE_MAC2 0x15
+#define FE_CNET9NE_MAC3 0x17
+#define FE_CNET9NE_MAC4 0x19
+#define FE_CNET9NE_MAC5 0x1B
+
+/* TODO: Should be in "ic/mb86960.h" */
+#define FE_D7_ENDEC 0xC0 /* Encoder/Decoder mode(86960 only) */
+#define FE_D7_ENDEC_NORMAL_NICE 0x00 /* Normal NICE */
+#define FE_D7_ENDEC_NICE_MONITOR 0x40 /* NICE + Monitor */
+#define FE_D7_ENDEC_BYPASS 0x80 /* Encoder/Decoder Bypass */
+#define FE_D7_ENDEC_TEST 0xC0 /* Encoder/Decoder Test */
+
+static int
+fe_probe_cnet9ne ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i;
+ u_char c;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for C-NET(9N)E\n", sc->sc_unit, sc->iobase );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ for ( ; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[i] = sc->iobase + 0x400 - 16 + i;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Get our station address from EEPROM. */
+ sc->sc_enaddr[0] = inb( sc->ioaddr[FE_CNET9NE_MAC0] );
+ sc->sc_enaddr[1] = inb( sc->ioaddr[FE_CNET9NE_MAC1] );
+ sc->sc_enaddr[2] = inb( sc->ioaddr[FE_CNET9NE_MAC2] );
+ sc->sc_enaddr[3] = inb( sc->ioaddr[FE_CNET9NE_MAC3] );
+ sc->sc_enaddr[4] = inb( sc->ioaddr[FE_CNET9NE_MAC4] );
+ sc->sc_enaddr[5] = inb( sc->ioaddr[FE_CNET9NE_MAC5] );
+
+#if 1
+ /*
+ * Check the Ethernet address here.
+ *
+ * Contec uses 00 80 4C ?? ?? ??.
+ */
+ if ( sc->sc_enaddr[0] != (u_char)0x00
+ || sc->sc_enaddr[1] != (u_char)0x80
+ || sc->sc_enaddr[2] != (u_char)0x4C ) {
+#else
+ /*
+ * Make sure we got a valid Ethernet address.
+ */
+ if ( ( sc->sc_enaddr[0] & 0x03 ) != 0x00 /* Multicast or Local address. */
+ || ( sc->sc_enaddr[0] | sc->sc_enaddr[1] | sc->sc_enaddr[2] ) == 0x00 ) {
+#endif
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid MAC adrs(%x:%x:%x:%x:%x:%x)\n"
+ , sc->sc_unit
+ , (u_char)sc->sc_enaddr[0], (u_char)sc->sc_enaddr[1]
+ , (u_char)sc->sc_enaddr[2], (u_char)sc->sc_enaddr[3]
+ , (u_char)sc->sc_enaddr[4], (u_char)sc->sc_enaddr[5] );
+#endif
+ return 0;
+ }
+
+ /* See if C-NET(9N)E is on its address. */
+ if ( inb( sc->ioaddr[FE_DLCR6] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR6] );
+#endif
+ return 0;
+ }
+
+ sc->typestr = "C-NET9NE";
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 64KB, word-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * Encoder/Decoder mode: Normal NICE.
+ *
+ * 86960 manual says that SRAM access-time can't be configured.
+ * (must be 1)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = FE_D5_RMTRST; /* reserved bit(must be 1) */
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_64KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_SRAM;
+#ifndef CNET9NC
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_ENDEC_NORMAL_NICE;
+#else
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_ENDEC_BYPASS;
+#endif
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+ sc->proto_bmpr14 = 0;
+
+ sc->stop = sc->init = NULL;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "C-NET(9N)E found" );
+#endif
+
+ /* Initialize 86960. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+#if 1 /* XXX: Is this really necessary? FIXME. */
+ c = inb( sc->ioaddr[FE_DLCR1] );
+ if ( c == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR1] );
+#endif
+ return 0;
+ }
+ if ( ( c & FE_D1_PKTRDY ) == 0 ) {
+ outb( sc->ioaddr[FE_DLCR1], FE_D1_PKTRDY );
+ }
+#endif
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#ifndef CNET9NC
+ /* Enable interrupt? FIXME. */
+ outb( sc->ioaddr[FE_CNET9NE_INTR], 0x10 );
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_cnet9ne()" );
+#endif
+
+ /*
+ * XXX: The I/O address range is fragmented in the CNET(9N)E.
+ * "16" is the number of regs at iobase.
+ */
+ return 16;
+}
+
+/*
+ * Probe and initialization for Contec C-NET(98)P2 series.
+ */
+
+/*
+ * Routines to read all bytes from the config EEPROM through TDK 78Q8377A.
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? FIXME.
+ */
+
+static void
+fe_strobe_eeprom_tdk ( u_short bmpr12 )
+{
+ outb( bmpr12, 0x10 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ outb( bmpr12, 0x12 | 0x01 );
+ outb( bmpr12, 0x16 | 0x01 );
+ outb( bmpr12, 0x12 | 0x01 );
+ outb( bmpr12, 0x16 | 0x01 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+}
+
+static void
+fe_read_eeprom_tdk ( struct fe_softc * sc, u_char * data )
+{
+ u_short bmpr12 = sc->ioaddr[FE_DLCR12];
+ u_char n, val, bit;
+
+ outb( sc->ioaddr[FE_DLCR6], FE_D6_BBW_WORD | FE_D6_SBW_WORD
+ | FE_D6_DLC_DISABLE );
+ outb( sc->ioaddr[FE_DLCR7], FE_D7_BYTSWP_LH | FE_D7_RBS_BMPR
+ | FE_D7_RDYPNS | FE_D7_POWER_UP );
+
+ /* Read bytes from EEPROM; two bytes per an iteration. */
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
+
+ /* Start EEPROM access. */
+ fe_strobe_eeprom_tdk( bmpr12 );
+
+ /* Pass the iteration count to the chip. */
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ val = ( n & bit ) ? 0x01 : 0x00;
+ outb( bmpr12, 0x12 | val );
+ outb( bmpr12, 0x16 | val );
+ }
+
+ /* Read a byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ if ( inb( bmpr12 ) & 0x01 ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ /* Read one more byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ if ( inb( bmpr12 ) & 0x01 ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ outb( bmpr12, 0x10 );
+ }
+
+ /* Reset the EEPROM interface. */
+ outb( bmpr12, 0x00 );
+
+#if FE_DEBUG >= 3
+ /* Report what we got. */
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
+#endif
+}
+
+/* TODO: Should be in "if_fereg.h" */
+#define FE_CNET98P2_EEP_IRQ (0x04 * 2 + 1) /* Irq */
+#define FE_CNET98P2_EEP_ADDR (0x08 * 2) /* Station(MAC) address */
+#define FE_CNET98P2_EEP_DUPLEX (0x0c * 2 + 1) /* Duplex mode */
+
+static int
+fe_probe_cnet98p2 ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i;
+ u_char duplex;
+ u_char eeprom[FE_EEPROM_SIZE];
+ static u_short const irqmap [] =
+ /* INT0 INT1 INT2 */
+ { NO_IRQ, NO_IRQ, NO_IRQ, IRQ3, NO_IRQ, IRQ5, IRQ6, NO_IRQ,
+ NO_IRQ, IRQ9, IRQ10, NO_IRQ, IRQ12, IRQ13, NO_IRQ, NO_IRQ };
+ /* INT3 INT4 INT5 INT6 */
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for C-NET(98)P2\n", sc->sc_unit, sc->iobase );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Full unused slots with a safe address. */
+ for ( ; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[i] = sc->iobase;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* See if C-NET(98)P2 is on its address. */
+ if ( inb( sc->ioaddr[FE_DLCR0] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR0] );
+#endif
+ return 0;
+ }
+ if ( inb( sc->ioaddr[FE_DLCR6] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR6] );
+#endif
+ return 0;
+ }
+
+ /*
+ * We are now almost sure we have a 78Q8377 at the given
+ * address. So, read EEPROM through 78Q8377. We have to write
+ * into LSI registers to read from EEPROM. FIXME.
+ */
+ fe_read_eeprom_tdk( sc, eeprom );
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_CNET98P2_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+#if 1
+ /*
+ * Check the Ethernet address here.
+ *
+ * Contec uses 00 80 4C ?? ?? ??.
+ */
+ if ( sc->sc_enaddr[0] != (u_char)0x00
+ || sc->sc_enaddr[1] != (u_char)0x80
+ || sc->sc_enaddr[2] != (u_char)0x4C ) {
+#else
+ /*
+ * Make sure we got a valid Ethernet address.
+ */
+ if ( ( sc->sc_enaddr[0] & 0x03 ) != 0x00 /* Multicast or Local address. */
+ || ( sc->sc_enaddr[0] | sc->sc_enaddr[1] | sc->sc_enaddr[2] ) == 0x00 ) {
+#endif
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid MAC adrs(%x:%x:%x:%x:%x:%x)\n"
+ , sc->sc_unit
+ , (u_char)sc->sc_enaddr[0], (u_char)sc->sc_enaddr[1]
+ , (u_char)sc->sc_enaddr[2], (u_char)sc->sc_enaddr[3]
+ , (u_char)sc->sc_enaddr[4], (u_char)sc->sc_enaddr[5] );
+#endif
+ return 0;
+ }
+
+ /*
+ * Get IRQ configuration from EEPROM.
+ */
+ isa_dev->id_irq = irqmap[ eeprom[FE_CNET98P2_EEP_IRQ] ];
+ if ( isa_dev->id_irq == NO_IRQ ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid irq configuration(%d)\n"
+ , sc->sc_unit, eeprom[FE_CNET98P2_EEP_IRQ] );
+#endif
+ return 0;
+ }
+
+ /*
+ * Get Duplex-mode configuration from EEPROM.
+ */
+ duplex = eeprom[FE_CNET98P2_EEP_DUPLEX] & FE_D4_DSC;
+ sc->typestr = ( duplex ? "CNET98P2(Full duplex)"
+ : "CNET98P2(Half duplex)" );
+
+ /*
+ * Program the 78Q8377 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we add IDENT_NICE or IDENT_EC to DLCR7? FIXME.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL | duplex;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+ sc->proto_bmpr14 = FE_B14_FILTER;
+
+ sc->stop = sc->init = NULL;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "C-NET(98)P2 found" );
+#endif
+
+ /* Initialize 78Q8377. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_cnet98p2()" );
+#endif
+
+ /*
+ * That's all. C-NET(98)P2 occupies 16 I/O addresses, as always.
+ */
+ return 16;
+}
+#else
+/*
+ * Probe and initialization for Fujitsu FMV-180 series boards
+ */
+static int
+fe_probe_fmv ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i, n;
+
+ static u_short const baseaddr [ 8 ] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340 };
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ7, IRQ10, IRQ15 };
+
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+
+ { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
+ { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/184 has 0x48 bits. */
+ { FE_FMV3, 0x7F, 0x00 },
+#if 1
+ /*
+ * Test *vendor* part of the station address for Fujitsu.
+ * The test will gain reliability of probe process, but
+ * it rejects FMV-180 clone boards manufactured by other vendors.
+ * We have to turn the test off when such cards are made available.
+ */
+ { FE_FMV4, 0xFF, 0x00 },
+ { FE_FMV5, 0xFF, 0x00 },
+ { FE_FMV6, 0xFF, 0x0E },
+#else
+ /*
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "no multicast" and "no local" even for
+ * unknown vendors.
+ */
+ { FE_FMV4, 0x03, 0x00 },
+#endif
+ { 0 }
+ };
+
+ /* "Hardware revision ID" */
+ int revision;
+
+ /*
+ * See if the specified address is possible for FMV-180 series.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) return 0;
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /* Simple probe. */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Check if our I/O address matches config info. on EEPROM. */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IOS )
+ >> FE_FMV2_IOS_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) {
+#if 0
+ /* May not work on some revisions of the cards... FIXME. */
+ return 0;
+#else
+ /* Just log the fact and see what happens... FIXME. */
+ log( LOG_WARNING, "fe%d: strange I/O config?\n", sc->sc_unit );
+#endif
+ }
+
+ /* Find the "hardware revision." */
+ revision = inb( sc->ioaddr[ FE_FMV1 ] ) & FE_FMV1_REV;
+
+ /* Determine the card type. */
+ sc->typestr = NULL;
+ switch ( inb( sc->ioaddr[ FE_FMV0 ] ) & FE_FMV0_MEDIA ) {
+ case 0:
+ /* No interface? This doesn't seem to be an FMV-180... */
+ return 0;
+ case FE_FMV0_MEDIUM_T:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-183";
+ break;
+ case 12:
+ sc->typestr = "FMV-183 (on-board)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_T | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-181";
+ break;
+ case 1:
+ sc->typestr = "FMV-181A";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_2:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 2)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 1)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_2 | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-182";
+ break;
+ case 1:
+ sc->typestr = "FMV-182A";
+ break;
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 3)";
+ break;
+ }
+ break;
+ }
+ if ( sc->typestr == NULL ) {
+ /* Unknown card type... Hope the driver works. */
+ sc->typestr = "unknown FMV-180 version";
+ log( LOG_WARNING, "fe%d: %s: %x-%x-%x-%x\n",
+ sc->sc_unit, sc->typestr,
+ inb( sc->ioaddr[ FE_FMV0 ] ),
+ inb( sc->ioaddr[ FE_FMV1 ] ),
+ inb( sc->ioaddr[ FE_FMV2 ] ),
+ inb( sc->ioaddr[ FE_FMV3 ] ) );
+ }
+
+ /*
+ * An FMV-180 has been proved.
+ * Determine which IRQ to be used.
+ *
+ * In this version, we give a priority to the kernel config file.
+ * If the EEPROM and config don't match, say it to the user for
+ * an attention.
+ */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
+ >> FE_FMV2_IRS_SHIFT;
+ if ( dev->id_irq == NO_IRQ ) {
+ /* Just use the probed value. */
+ dev->id_irq = irqmap[ n ];
+ } else if ( dev->id_irq != irqmap[ n ] ) {
+ /* Don't match. */
+ log( LOG_WARNING,
+ "fe%d: check IRQ in config; it may be incorrect\n",
+ sc->sc_unit );
+ }
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+
+ /*
+ * Register values which (may) depend on board design.
+ *
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /*
+ * Minimum initialization of the hardware.
+ * We write into registers; hope I/O ports have no
+ * overlap with other boards.
+ */
+
+ /* Initialize ASIC. */
+ outb( sc->ioaddr[ FE_FMV3 ], 0 );
+ outb( sc->ioaddr[ FE_FMV10 ], 0 );
+
+ /* Initialize 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* "Refresh" hardware configuration. FIXME. */
+ outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
+
+ /* Turn the "master interrupt control" flag of ASIC on. */
+ outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
+
+ /*
+ * That's all. FMV-180 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+}
+
+/*
+ * Probe and initialization for Allied-Telesis AT1700/RE2000 series.
+ */
+static int
+fe_probe_ati ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i, n;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+ u_char save16, save17;
+
+ static u_short const baseaddr [ 8 ] =
+ { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
+ static u_short const irqmaps [ 4 ][ 4 ] =
+ {
+ { IRQ3, IRQ4, IRQ5, IRQ9 },
+ { IRQ10, IRQ11, IRQ12, IRQ15 },
+ { IRQ3, IRQ11, IRQ5, IRQ15 },
+ { IRQ10, IRQ11, IRQ14, IRQ15 },
+ };
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR5, 0x80, 0x00 },
+#if 0
+ { FE_BMPR16, 0x1B, 0x00 },
+ { FE_BMPR17, 0x7F, 0x00 },
+#endif
+ { 0 }
+ };
+
+ /* Assume we have 86965 and no need to restore these. */
+ save16 = 0;
+ save17 = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for ATI\n",
+ sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /*
+ * See if the specified address is possible for MB86965A JLI mode.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) goto NOTFOUND;
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /*
+ * We should test if MB86965A is on the base address now.
+ * Unfortunately, it is very hard to probe it reliably, since
+ * we have no way to reset the chip under software control.
+ * On cold boot, we could check the "signature" bit patterns
+ * described in the Fujitsu document. On warm boot, however,
+ * we can predict almost nothing about register values.
+ */
+ if ( !fe_simple_probe( sc, probe_table ) ) goto NOTFOUND;
+
+ /* Check if our I/O address matches config info on 86965. */
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_ADDR )
+ >> FE_B19_ADDR_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) goto NOTFOUND;
+
+ /*
+ * We are now almost sure we have an AT1700 at the given
+ * address. So, read EEPROM through 86965. We have to write
+ * into LSI registers to read from EEPROM. I want to avoid it
+ * at this stage, but I cannot test the presence of the chip
+ * any further without reading EEPROM. FIXME.
+ */
+ save16 = inb( sc->ioaddr[ FE_BMPR16 ] );
+ save17 = inb( sc->ioaddr[ FE_BMPR17 ] );
+ fe_read_eeprom( sc, eeprom );
+
+ /* Make sure the EEPROM is turned off. */
+ outb( sc->ioaddr[ FE_BMPR16 ], 0 );
+ outb( sc->ioaddr[ FE_BMPR17 ], 0 );
+
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[ FE_BMPR19 ] ) ) {
+ goto NOTFOUND;
+ }
+
+ /*
+ * The following model identification codes are stolen from
+ * from the NetBSD port of the fe driver. My reviewers
+ * suggested minor revision.
+ */
+
+ /* Determine the card type. */
+ switch (eeprom[FE_ATI_EEP_MODEL]) {
+ case FE_ATI_MODEL_AT1700T:
+ sc->typestr = "AT-1700T/RE2001";
+ break;
+ case FE_ATI_MODEL_AT1700BT:
+ sc->typestr = "AT-1700BT/RE2003";
+ break;
+ case FE_ATI_MODEL_AT1700FT:
+ sc->typestr = "AT-1700FT/RE2009";
+ break;
+ case FE_ATI_MODEL_AT1700AT:
+ sc->typestr = "AT-1700AT/RE2005";
+ break;
+ default:
+ sc->typestr = "unknown AT-1700/RE2000 ?";
+ break;
+ }
+
+ /*
+ * Try to determine IRQ settings.
+ * Different models use different ranges of IRQs.
+ */
+ if ( dev->id_irq == NO_IRQ ) {
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_IRQ )
+ >> FE_B19_IRQ_SHIFT;
+ switch ( eeprom[ FE_ATI_EEP_REVISION ] & 0xf0 ) {
+ case 0x30:
+ dev->id_irq = irqmaps[ 3 ][ n ];
+ break;
+ case 0x10:
+ case 0x50:
+ dev->id_irq = irqmaps[ 2 ][ n ];
+ break;
+ case 0x40:
+ case 0x60:
+ if ( eeprom[ FE_ATI_EEP_MAGIC ] & 0x04 ) {
+ dev->id_irq = irqmaps[ 1 ][ n ];
+ } else {
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ }
+ break;
+ default:
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ break;
+ }
+ }
+
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+#if 1
+ /*
+ * This test doesn't work well for AT1700 look-alike by
+ * other vendors.
+ */
+ /* Make sure the vendor part is for Allied-Telesis. */
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
+
+#else
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+#endif
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+#if 0 /* XXXX Should we use this? FIXME. */
+ sc->proto_bmpr13 = eeprom[ FE_ATI_EEP_MEDIA ];
+#else
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "ATI found" );
+#endif
+
+ /* Setup hooks. This may solves a nasty bug. FIXME. */
+ sc->init = fe_init_ati;
+
+ /* Initialize 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_ati()" );
+#endif
+
+ /*
+ * That's all. AT1700 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+
+ NOTFOUND:
+ /*
+ * We have no AT1700 at a given address.
+ * Restore BMPR16 and BMPR17 if we have destroyed them,
+ * hoping that the hardware on the address didn't get
+ * bad side effect.
+ */
+ if ( save16 != 0 | save17 != 0 ) {
+ outb( sc->ioaddr[ FE_BMPR16 ], save16 );
+ outb( sc->ioaddr[ FE_BMPR17 ], save17 );
+ }
+ return ( 0 );
+}
+
+/* ATI specific initialization routine. */
+static void
+fe_init_ati ( struct fe_softc * sc )
+{
+/*
+ * I've told that the following operation "Resets" the chip.
+ * Hope this solve a bug which hangs up the driver under
+ * heavy load... FIXME.
+ */
+
+ /* Minimal initialization of 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* "Reset" by wrting into an undocument register location. */
+ outb( sc->ioaddr[ 0x1F ], 0 );
+
+ /* How long do we have to wait after the reset? FIXME. */
+ DELAY( 300 );
+}
+#endif /* PC98 */
+
+/*
+ * Probe and initialization for Gateway Communications' old cards.
+ */
+static int
+fe_probe_gwy ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR7, 0xC0, 0x00 },
+ /*
+ * Test *vendor* part of the address for Gateway.
+ * This test is essential to identify Gateway's cards.
+ * We shuld define some symbolic names for the
+ * following offsets. FIXME.
+ */
+ { 0x18, 0xFF, 0x00 },
+ { 0x19, 0xFF, 0x00 },
+ { 0x1A, 0xFF, 0x61 },
+ { 0 }
+ };
+
+ /*
+ * We need explicit IRQ and supported address.
+ * I'm not sure which address and IRQ is possible for Gateway
+ * Ethernet family. The following accepts everything. FIXME.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /* See if the card is on its address. */
+ if ( !fe_simple_probe( sc, probe_table ) ) {
+ return 0;
+ }
+
+ /* Determine the card type. */
+ sc->typestr = "Gateway Ethernet w/ Fujitsu chipset";
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 16KB, 100ns, byte-wide access.
+ * Transmission buffer: 2KB x 2.
+ * System bus interface: 16 bits.
+ * Make sure to clear out ID bits in DLCR7
+ * (They actually are Encoder/Decoder control in NICE.)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_16KB | FE_D6_TXBSIZ_2x2KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = 0;
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* That's all. The card occupies 32 I/O addresses, as always. */
+ return 32;
+}
+
+#if NCARD > 0
+/*
+ * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
+ * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
+ */
+static int
+fe_probe_mbh ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i,type;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR0, 0x09, 0x00 },
+ { FE_DLCR2, 0x79, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR6, 0xFF, 0xB6 },
+ /*
+ * The following location has the first byte of the card's
+ * Ethernet (MAC) address.
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "global" and "unicast" for any vendors'.
+ */
+ { FE_MBH10, 0x03, 0x00 },
+
+ /* Just a gap? Seems reliable, anyway. */
+ { 0x12, 0xFF, 0x00 },
+ { 0x13, 0xFF, 0x00 },
+ { 0x14, 0xFF, 0x00 },
+ { 0x15, 0xFF, 0x00 },
+ { 0x16, 0xFF, 0x00 },
+ { 0x17, 0xFF, 0x00 },
+#if 0
+ { 0x18, 0xFF, 0xFF },
+ { 0x19, 0xFF, 0xFF },
+#endif
+
+ { 0 }
+ };
+
+ /*
+ * We need explicit IRQ and supported address.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /*
+ * See if MBH10302 is on its address.
+ * I'm not sure the following probe code works. FIXME.
+ */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Determine the card type. */
+ sc->typestr = "MBH10302 (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, FE_MBH10, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Make sure we got a valid station address. */
+ if ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) return 0;
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Setup hooks. We need a special initialization procedure. */
+ sc->init = fe_init_mbh;
+
+ /*
+ * Minimum initialization.
+ */
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if 1 /* FIXME. */
+ /* Initialize system bus interface and encoder/decoder operation. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_DISABLE );
+#endif
+
+ /*
+ * That's all. MBH10302 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+}
+
+/* MBH specific initialization routine. */
+static void
+fe_init_mbh ( struct fe_softc * sc )
+{
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* Enable master interrupt flag. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+}
+
+/*
+ * Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
+ * by MASUI Kenji <masui@cs.titech.ac.jp>
+ *
+ * (Contec uses TDK Ethenet chip -- hosokawa)
+ *
+ * This version of fe_probe_tdk has been rewrote to handle
+ * *generic* PC card implementation of Fujitsu MB8696x and compatibles.
+ * The name _tdk is just for a historical reason. <seki> :-)
+ */
+static int
+fe_probe_tdk ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Does not work well. */
+ { 0 }
+ };
+
+ /* We need an IRQ. */
+ if ( dev->id_irq == NO_IRQ ) {
+ return ( 0 );
+ }
+
+ /* Generic driver needs Ethernet address taken from CIS. */
+ if (sc->arpcom.ac_enaddr[0] == 0
+ && sc->arpcom.ac_enaddr[1] == 0
+ && sc->arpcom.ac_enaddr[2] == 0) {
+ return 0;
+ }
+
+ /* Setup an I/O address mapping table; we need only 16 ports. */
+ for (i = 0; i < 16; i++) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Fill unused slots with a safe address. */
+ for (i = 16; i < MAXREGISTERS; i++) {
+ sc->ioaddr[i] = sc->iobase;
+ }
+
+ /*
+ * See if C-NET(PC)C is on its address.
+ */
+
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Determine the card type. */
+ sc->typestr = "Generic MB8696x Ethernet (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* The station address *must*be* already in sc_enaddr;
+ Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we remove IDENT_NICE from DLCR7? Or,
+ * even add IDENT_EC instead? FIXME.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Minimul initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /*
+ * That's all. C-NET(PC)C occupies 16 I/O addresses.
+ *
+ * Some PC cards (e.g., TDK and Contec) have 16 I/O addresses,
+ * while some others (e.g., Fujitsu) have 32. Fortunately,
+ * this generic driver never accesses latter 16 ports in 32
+ * ports cards. So, we can assume the *generic* PC cards
+ * always have 16 ports.
+ *
+ * Moreover, PC card probe is isolated from ISA probe, and PC
+ * card probe routine doesn't use "# of ports" returned by this
+ * function. 16 v.s. 32 is not important now.
+ */
+ return 16;
+}
+#endif /* NCARD > 0 */
+
+/*
+ * Install interface into kernel networking data structures
+ */
+static int
+fe_attach ( DEVICE * dev )
+{
+#if NCARD > 0
+ static int already_ifattach[NFE];
+#endif
+ struct fe_softc *sc = &fe_softc[dev->id_unit];
+
+ /*
+ * Initialize ifnet structure
+ */
+ sc->sc_if.if_softc = sc;
+ sc->sc_if.if_unit = sc->sc_unit;
+ sc->sc_if.if_name = "fe";
+ sc->sc_if.if_output = ether_output;
+ sc->sc_if.if_start = fe_start;
+ sc->sc_if.if_ioctl = fe_ioctl;
+ sc->sc_if.if_watchdog = fe_watchdog;
+
+ /*
+ * Set default interface flags.
+ */
+ sc->sc_if.if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+
+ /*
+ * Set maximum size of output queue, if it has not been set.
+ * It is done here as this driver may be started after the
+ * system initialization (i.e., the interface is PCMCIA.)
+ *
+ * I'm not sure this is really necessary, but, even if it is,
+ * it should be done somewhere else, e.g., in if_attach(),
+ * since it must be a common workaround for all network drivers.
+ * FIXME.
+ */
+ if ( sc->sc_if.if_snd.ifq_maxlen == 0 ) {
+ sc->sc_if.if_snd.ifq_maxlen = ifqmaxlen;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "attach()" );
+#endif
+
+#if FE_SINGLE_TRANSMISSION
+ /* Override txb config to allocate minimum. */
+ sc->proto_dlcr6 &= ~FE_D6_TXBSIZ
+ sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
+#endif
+
+ /* Modify hardware config if it is requested. */
+ if ( dev->id_flags & FE_FLAGS_OVERRIDE_DLCR6 ) {
+ sc->proto_dlcr6 = dev->id_flags & FE_FLAGS_DLCR6_VALUE;
+ }
+
+ /* Find TX buffer size, based on the hardware dependent proto. */
+ switch ( sc->proto_dlcr6 & FE_D6_TXBSIZ ) {
+ case FE_D6_TXBSIZ_2x2KB: sc->txb_size = 2048; break;
+ case FE_D6_TXBSIZ_2x4KB: sc->txb_size = 4096; break;
+ case FE_D6_TXBSIZ_2x8KB: sc->txb_size = 8192; break;
+ default:
+ /* Oops, we can't work with single buffer configuration. */
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: strange TXBSIZ config; fixing\n",
+ sc->sc_unit );
+#endif
+ sc->proto_dlcr6 &= ~FE_D6_TXBSIZ;
+ sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
+ sc->txb_size = 2048;
+ break;
+ }
+
+ /* Attach and stop the interface. */
+#if NCARD > 0
+ if (already_ifattach[dev->id_unit] != 1) {
+ if_attach(&sc->sc_if);
+ already_ifattach[dev->id_unit] = 1;
+ }
+#else
+ if_attach(&sc->sc_if);
+#endif
+ fe_stop(sc->sc_unit); /* This changes the state to IDLE. */
+ ether_ifattach(&sc->sc_if);
+
+ /* Print additional info when attached. */
+ printf( "fe%d: address %6D, type %s\n", sc->sc_unit,
+ sc->sc_enaddr, ":" , sc->typestr );
+#if FE_DEBUG >= 3
+ {
+ int buf, txb, bbw, sbw, ram;
+
+ buf = txb = bbw = sbw = ram = -1;
+ switch ( sc->proto_dlcr6 & FE_D6_BUFSIZ ) {
+ case FE_D6_BUFSIZ_8KB: buf = 8; break;
+ case FE_D6_BUFSIZ_16KB: buf = 16; break;
+ case FE_D6_BUFSIZ_32KB: buf = 32; break;
+ case FE_D6_BUFSIZ_64KB: buf = 64; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_TXBSIZ ) {
+ case FE_D6_TXBSIZ_2x2KB: txb = 2; break;
+ case FE_D6_TXBSIZ_2x4KB: txb = 4; break;
+ case FE_D6_TXBSIZ_2x8KB: txb = 8; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_BBW ) {
+ case FE_D6_BBW_BYTE: bbw = 8; break;
+ case FE_D6_BBW_WORD: bbw = 16; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_SBW ) {
+ case FE_D6_SBW_BYTE: sbw = 8; break;
+ case FE_D6_SBW_WORD: sbw = 16; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_SRAM ) {
+ case FE_D6_SRAM_100ns: ram = 100; break;
+ case FE_D6_SRAM_150ns: ram = 150; break;
+ }
+ printf( "fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
+ sc->sc_unit, buf, bbw, ram, txb, sbw );
+ }
+#endif
+
+#if NBPFILTER > 0
+ /* If BPF is in the kernel, call the attach for it. */
+ bpfattach( &sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
+#endif
+ return 1;
+}
+
+/*
+ * Reset interface.
+ */
+static void
+fe_reset ( int unit )
+{
+ /*
+ * Stop interface and re-initialize.
+ */
+ fe_stop(unit);
+ fe_init(unit);
+}
+
+/*
+ * Stop everything on the interface.
+ *
+ * All buffered packets, both transmitting and receiving,
+ * if any, will be lost by stopping the interface.
+ */
+static void
+fe_stop ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ int s;
+
+ s = splimp();
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "stop()" );
+#endif
+
+ /* Disable interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
+
+ /* Stop interface hardware. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Clear all interrupt status. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF );
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF );
+
+ /* Put the chip in stand-by mode. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR7 ], sc->proto_dlcr7 | FE_D7_POWER_DOWN );
+ DELAY( 200 );
+
+ /* Reset transmitter variables and interface flags. */
+ sc->sc_if.if_flags &= ~( IFF_OACTIVE | IFF_RUNNING );
+ sc->sc_if.if_timer = 0;
+ sc->txb_free = sc->txb_size;
+ sc->txb_count = 0;
+ sc->txb_sched = 0;
+
+ /* MAR loading can be delayed. */
+ sc->filter_change = 0;
+
+ /* Update config status also. */
+
+ /* Call a hook. */
+ if ( sc->stop ) sc->stop( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of stop()" );
+#endif
+
+ (void) splx(s);
+}
+
+/*
+ * Device timeout/watchdog routine. Entered if the device neglects to
+ * generate an interrupt after a transmit has been started on it.
+ */
+static void
+fe_watchdog ( struct ifnet *ifp )
+{
+ struct fe_softc *sc = (struct fe_softc *)ifp;
+
+#if FE_DEBUG >= 1
+ /* A "debug" message. */
+ log( LOG_ERR, "fe%d: transmission timeout (%d+%d)%s\n",
+ ifp->if_unit, sc->txb_sched, sc->txb_count,
+ ( ifp->if_flags & IFF_UP ) ? "" : " when down" );
+ if ( sc->sc_if.if_opackets == 0 && sc->sc_if.if_ipackets == 0 ) {
+ log( LOG_WARNING, "fe%d: wrong IRQ setting in config?\n",
+ ifp->if_unit );
+ }
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Record how many packets are lost by this accident. */
+ ifp->if_oerrors += sc->txb_sched + sc->txb_count;
+
+ /* Put the interface into known initial state. */
+ if ( ifp->if_flags & IFF_UP ) {
+ fe_reset( ifp->if_unit );
+ } else {
+ fe_stop( ifp->if_unit );
+ }
+}
+
+/*
+ * Initialize device.
+ */
+static void
+fe_init ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ int s;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init()" );
+#endif
+
+ /* We need an address. */
+ if (TAILQ_EMPTY(&sc->sc_if.if_addrhead)) { /* XXX unlikely */
+#if FE_DEBUG >= 1
+ log( LOG_ERR, "fe%d: init() without any address\n",
+ sc->sc_unit );
+#endif
+ return;
+ }
+
+#if FE_DEBUG >= 1
+ /*
+ * Make sure we have a valid station address.
+ * The following test is applicable for any Ethernet interfaces.
+ * It can be done in somewhere common to all of them. FIXME.
+ */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x01 ) != 0
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) {
+ log( LOG_ERR, "fe%d: invalid station address (%6D)\n",
+ sc->sc_unit, sc->sc_enaddr, ":" );
+ return;
+ }
+#endif
+
+ /* Start initializing 86960. */
+ s = splimp();
+
+ /* Call a hook. */
+ if ( sc->init ) sc->init( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after init hook" );
+#endif
+
+ /*
+ * Make sure to disable the chip, also.
+ * This may also help re-programming the chip after
+ * hot insertion of PCMCIAs.
+ */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Power up the chip and select register bank for DLCRs. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_DLCR | FE_D7_POWER_UP );
+ DELAY( 200 );
+
+ /* Feed the station address. */
+ outblk( sc, FE_DLCR8, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Clear multicast address filter to receive nothing. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_MAR | FE_D7_POWER_UP );
+ outblk( sc, FE_MAR8, fe_filter_nothing.data, FE_FILTER_LEN );
+
+ /* Select the BMPR bank for runtime register access. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP );
+
+ /* Initialize registers. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR4 ], sc->proto_dlcr4 );
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 );
+ outb( sc->ioaddr[ FE_BMPR10 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR11 ], FE_B11_CTRL_SKIP | FE_B11_MODE1 );
+ outb( sc->ioaddr[ FE_BMPR12 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR13 ], sc->proto_bmpr13 );
+ outb( sc->ioaddr[ FE_BMPR14 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR15 ], 0x00 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just before enabling DLC" );
+#endif
+
+ /* Enable interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], FE_TMASK );
+ outb( sc->ioaddr[ FE_DLCR3 ], FE_RMASK );
+
+ /* Enable transmitter and receiver. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
+ DELAY( 200 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just after enabling DLC" );
+#endif
+
+ /*
+ * Make sure to empty the receive buffer.
+ *
+ * This may be redundant, but *if* the receive buffer were full
+ * at this point, then the driver would hang. I have experienced
+ * some strange hang-up just after UP. I hope the following
+ * code solve the problem.
+ *
+ * I have changed the order of hardware initialization.
+ * I think the receive buffer cannot have any packets at this
+ * point in this version. The following code *must* be
+ * redundant now. FIXME.
+ *
+ * I've heard a rumore that on some PC card implementation of
+ * 8696x, the receive buffer can have some data at this point.
+ * The following message helps discovering the fact. FIXME.
+ */
+ if ( !( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) ) {
+ log( LOG_WARNING,
+ "fe%d: receive buffer has some data after reset\n",
+ sc->sc_unit );
+
+ fe_emptybuffer( sc );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after ERB loop" );
+#endif
+
+ /* Do we need this here? Actually, no. I must be paranoia. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after FIXME" );
+#endif
+ /* Set 'running' flag, because we are now running. */
+ sc->sc_if.if_flags |= IFF_RUNNING;
+
+ /*
+ * At this point, the interface is running properly,
+ * except that it receives *no* packets. we then call
+ * fe_setmode() to tell the chip what packets to be
+ * received, based on the if_flags and multicast group
+ * list. It completes the initialization process.
+ */
+ fe_setmode( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after setmode" );
+#endif
+
+ /* ...and attempt to start output queued packets. */
+ fe_start( &sc->sc_if );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init() done" );
+#endif
+
+ (void) splx(s);
+}
+
+/*
+ * This routine actually starts the transmission on the interface
+ */
+static void
+fe_xmit ( struct fe_softc * sc )
+{
+ /*
+ * Set a timer just in case we never hear from the board again.
+ * We use longer timeout for multiple packet transmission.
+ * I'm not sure this timer value is appropriate. FIXME.
+ */
+ sc->sc_if.if_timer = 1 + sc->txb_count;
+
+ /* Update txb variables. */
+ sc->txb_sched = sc->txb_count;
+ sc->txb_count = 0;
+ sc->txb_free = sc->txb_size;
+ sc->tx_excolls = 0;
+
+ /* Start transmitter, passing packets in TX buffer. */
+ outb( sc->ioaddr[ FE_BMPR10 ], sc->txb_sched | FE_B10_START );
+}
+
+/*
+ * Start output on interface.
+ * We make two assumptions here:
+ * 1) that the current priority is set to splimp _before_ this code
+ * is called *and* is returned to the appropriate priority after
+ * return
+ * 2) that the IFF_OACTIVE flag is checked before this code is called
+ * (i.e. that the output part of the interface is idle)
+ */
+void
+fe_start ( struct ifnet *ifp )
+{
+ struct fe_softc *sc = ifp->if_softc;
+ struct mbuf *m;
+
+#if FE_DEBUG >= 1
+ /* Just a sanity check. */
+ if ( ( sc->txb_count == 0 ) != ( sc->txb_free == sc->txb_size ) ) {
+ /*
+ * Txb_count and txb_free co-works to manage the
+ * transmission buffer. Txb_count keeps track of the
+ * used potion of the buffer, while txb_free does unused
+ * potion. So, as long as the driver runs properly,
+ * txb_count is zero if and only if txb_free is same
+ * as txb_size (which represents whole buffer.)
+ */
+ log( LOG_ERR, "fe%d: inconsistent txb variables (%d, %d)\n",
+ sc->sc_unit, sc->txb_count, sc->txb_free );
+ /*
+ * So, what should I do, then?
+ *
+ * We now know txb_count and txb_free contradicts. We
+ * cannot, however, tell which is wrong. More
+ * over, we cannot peek 86960 transmission buffer or
+ * reset the transmission buffer. (In fact, we can
+ * reset the entire interface. I don't want to do it.)
+ *
+ * If txb_count is incorrect, leaving it as-is will cause
+ * sending of garbage after next interrupt. We have to
+ * avoid it. Hence, we reset the txb_count here. If
+ * txb_free was incorrect, resetting txb_count just loose
+ * some packets. We can live with it.
+ */
+ sc->txb_count = 0;
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * First, see if there are buffered packets and an idle
+ * transmitter - should never happen at this point.
+ */
+ if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
+ log( LOG_ERR,
+ "fe%d: transmitter idle with %d buffered packets\n",
+ sc->sc_unit, sc->txb_count );
+ fe_xmit( sc );
+ }
+#endif
+
+ /*
+ * Stop accepting more transmission packets temporarily, when
+ * a filter change request is delayed. Updating the MARs on
+ * 86960 flushes the transmission buffer, so it is delayed
+ * until all buffered transmission packets have been sent
+ * out.
+ */
+ if ( sc->filter_change ) {
+ /*
+ * Filter change request is delayed only when the DLC is
+ * working. DLC soon raise an interrupt after finishing
+ * the work.
+ */
+ goto indicate_active;
+ }
+
+ for (;;) {
+
+ /*
+ * See if there is room to put another packet in the buffer.
+ * We *could* do better job by peeking the send queue to
+ * know the length of the next packet. Current version just
+ * tests against the worst case (i.e., longest packet). FIXME.
+ *
+ * When adding the packet-peek feature, don't forget adding a
+ * test on txb_count against QUEUEING_MAX.
+ * There is a little chance the packet count exceeds
+ * the limit. Assume transmission buffer is 8KB (2x8KB
+ * configuration) and an application sends a bunch of small
+ * (i.e., minimum packet sized) packets rapidly. An 8KB
+ * buffer can hold 130 blocks of 62 bytes long...
+ */
+ if ( sc->txb_free
+ < ETHER_MAX_LEN - ETHER_CRC_LEN + FE_DATA_LEN_LEN ) {
+ /* No room. */
+ goto indicate_active;
+ }
+
+#if FE_SINGLE_TRANSMISSION
+ if ( sc->txb_count > 0 ) {
+ /* Just one packet per a transmission buffer. */
+ goto indicate_active;
+ }
+#endif
+
+ /*
+ * Get the next mbuf chain for a packet to send.
+ */
+ IF_DEQUEUE( &sc->sc_if.if_snd, m );
+ if ( m == NULL ) {
+ /* No more packets to send. */
+ goto indicate_inactive;
+ }
+
+ /*
+ * Copy the mbuf chain into the transmission buffer.
+ * txb_* variables are updated as necessary.
+ */
+ fe_write_mbufs( sc, m );
+
+ /* Start transmitter if it's idle. */
+ if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
+ fe_xmit( sc );
+ }
+
+ /*
+ * Tap off here if there is a bpf listener,
+ * and the device is *not* in promiscuous mode.
+ * (86960 receives self-generated packets if
+ * and only if it is in "receive everything"
+ * mode.)
+ */
+#if NBPFILTER > 0
+ if ( sc->sc_if.if_bpf
+ && !( sc->sc_if.if_flags & IFF_PROMISC ) ) {
+ bpf_mtap( &sc->sc_if, m );
+ }
+#endif
+
+ m_freem( m );
+ }
+
+ indicate_inactive:
+ /*
+ * We are using the !OACTIVE flag to indicate to
+ * the outside world that we can accept an
+ * additional packet rather than that the
+ * transmitter is _actually_ active. Indeed, the
+ * transmitter may be active, but if we haven't
+ * filled all the buffers with data then we still
+ * want to accept more.
+ */
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ return;
+
+ indicate_active:
+ /*
+ * The transmitter is active, and there are no room for
+ * more outgoing packets in the transmission buffer.
+ */
+ sc->sc_if.if_flags |= IFF_OACTIVE;
+ return;
+}
+
+/*
+ * Drop (skip) a packet from receive buffer in 86960 memory.
+ */
+static void
+fe_droppacket ( struct fe_softc * sc, int len )
+{
+ int i;
+
+ /*
+ * 86960 manual says that we have to read 8 bytes from the buffer
+ * before skip the packets and that there must be more than 8 bytes
+ * remaining in the buffer when issue a skip command.
+ * Remember, we have already read 4 bytes before come here.
+ */
+ if ( len > 12 ) {
+ /* Read 4 more bytes, and skip the rest of the packet. */
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ outb( sc->ioaddr[ FE_BMPR14 ], sc->proto_bmpr14 | FE_B14_SKIP );
+ } else {
+ /* We should not come here unless receiving RUNTs. */
+ for ( i = 0; i < len; i += 2 ) {
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ }
+ }
+}
+
+/*
+ * Empty receiving buffer.
+ */
+static void
+fe_emptybuffer ( struct fe_softc * sc )
+{
+ int i;
+ u_char saved_dlcr5;
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: emptying receive buffer\n", sc->sc_unit );
+#endif
+ /*
+ * Stop receiving packets, temporarily.
+ */
+ saved_dlcr5 = inb( sc->ioaddr[ FE_DLCR5 ] );
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 );
+ DELAY(1300);
+
+ /*
+ * When we come here, the receive buffer management should
+ * have been broken. So, we cannot use skip operation.
+ * Just discard everything in the buffer.
+ */
+ for (i = 0; i < 32768; i++) {
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ }
+
+ /*
+ * Double check.
+ */
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) {
+ log( LOG_ERR, "fe%d: could not empty receive buffer\n",
+ sc->sc_unit );
+ /* Hmm. What should I do if this happens? FIXME. */
+ }
+
+ /*
+ * Restart receiving packets.
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ], saved_dlcr5 );
+}
+
+/*
+ * Transmission interrupt handler
+ * The control flow of this function looks silly. FIXME.
+ */
+static void
+fe_tint ( struct fe_softc * sc, u_char tstat )
+{
+ int left;
+ int col;
+
+ /*
+ * Handle "excessive collision" interrupt.
+ */
+ if ( tstat & FE_D0_COLL16 ) {
+
+ /*
+ * Find how many packets (including this collided one)
+ * are left unsent in transmission buffer.
+ */
+ left = inb( sc->ioaddr[ FE_BMPR10 ] );
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: excessive collision (%d/%d)\n",
+ sc->sc_unit, left, sc->txb_sched );
+#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /*
+ * Clear the collision flag (in 86960) here
+ * to avoid confusing statistics.
+ */
+ outb( sc->ioaddr[ FE_DLCR0 ], FE_D0_COLLID );
+
+ /*
+ * Restart transmitter, skipping the
+ * collided packet.
+ *
+ * We *must* skip the packet to keep network running
+ * properly. Excessive collision error is an
+ * indication of the network overload. If we
+ * tried sending the same packet after excessive
+ * collision, the network would be filled with
+ * out-of-time packets. Packets belonging
+ * to reliable transport (such as TCP) are resent
+ * by some upper layer.
+ */
+ outb( sc->ioaddr[ FE_BMPR11 ],
+ FE_B11_CTRL_SKIP | FE_B11_MODE1 );
+
+ /* Update statistics. */
+ sc->tx_excolls++;
+ }
+
+ /*
+ * Handle "transmission complete" interrupt.
+ */
+ if ( tstat & FE_D0_TXDONE ) {
+
+ /*
+ * Add in total number of collisions on last
+ * transmission. We also clear "collision occurred" flag
+ * here.
+ *
+ * 86960 has a design flaw on collision count on multiple
+ * packet transmission. When we send two or more packets
+ * with one start command (that's what we do when the
+ * transmission queue is crowded), 86960 informs us number
+ * of collisions occurred on the last packet on the
+ * transmission only. Number of collisions on previous
+ * packets are lost. I have told that the fact is clearly
+ * stated in the Fujitsu document.
+ *
+ * I considered not to mind it seriously. Collision
+ * count is not so important, anyway. Any comments? FIXME.
+ */
+
+ if ( inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_D0_COLLID ) {
+
+ /* Clear collision flag. */
+ outb( sc->ioaddr[ FE_DLCR0 ], FE_D0_COLLID );
+
+ /* Extract collision count from 86960. */
+ col = inb( sc->ioaddr[ FE_DLCR4 ] );
+ col = ( col & FE_D4_COL ) >> FE_D4_COL_SHIFT;
+ if ( col == 0 ) {
+ /*
+ * Status register indicates collisions,
+ * while the collision count is zero.
+ * This can happen after multiple packet
+ * transmission, indicating that one or more
+ * previous packet(s) had been collided.
+ *
+ * Since the accurate number of collisions
+ * has been lost, we just guess it as 1;
+ * Am I too optimistic? FIXME.
+ */
+ col = 1;
+ }
+ sc->sc_if.if_collisions += col;
+#if FE_DEBUG >= 3
+ log( LOG_WARNING, "fe%d: %d collision(s) (%d)\n",
+ sc->sc_unit, col, sc->txb_sched );
+#endif
+ }
+
+ /*
+ * Update transmission statistics.
+ * Be sure to reflect number of excessive collisions.
+ */
+ sc->sc_if.if_opackets += sc->txb_sched - sc->tx_excolls;
+ sc->sc_if.if_oerrors += sc->tx_excolls;
+ sc->sc_if.if_collisions += sc->tx_excolls * 16;
+ sc->txb_sched = 0;
+
+ /*
+ * The transmitter is no more active.
+ * Reset output active flag and watchdog timer.
+ */
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ sc->sc_if.if_timer = 0;
+
+ /*
+ * If more data is ready to transmit in the buffer, start
+ * transmitting them. Otherwise keep transmitter idle,
+ * even if more data is queued. This gives receive
+ * process a slight priority.
+ */
+ if ( sc->txb_count > 0 ) fe_xmit( sc );
+ }
+}
+
+/*
+ * Ethernet interface receiver interrupt.
+ */
+static void
+fe_rint ( struct fe_softc * sc, u_char rstat )
+{
+ u_short len;
+ u_char status;
+ int i;
+
+ /*
+ * Update statistics if this interrupt is caused by an error.
+ */
+ if ( rstat & ( FE_D1_OVRFLO | FE_D1_CRCERR
+ | FE_D1_ALGERR | FE_D1_SRTPKT ) ) {
+#if FE_DEBUG >= 2
+ log( LOG_WARNING,
+ "fe%d: receive error: %s%s%s%s(%02x)\n",
+ sc->sc_unit,
+ rstat & FE_D1_OVRFLO ? "OVR " : "",
+ rstat & FE_D1_CRCERR ? "CRC " : "",
+ rstat & FE_D1_ALGERR ? "ALG " : "",
+ rstat & FE_D1_SRTPKT ? "LEN " : "",
+ rstat );
+#endif
+ sc->sc_if.if_ierrors++;
+ }
+
+ /*
+ * MB86960 has a flag indicating "receive queue empty."
+ * We just loop, checking the flag, to pull out all received
+ * packets.
+ *
+ * We limit the number of iterations to avoid infinite-loop.
+ * The upper bound is set to unrealistic high value.
+ */
+ for (i = 0; i < FE_MAX_RECV_COUNT * 2; i++) {
+
+ /* Stop the iteration if 86960 indicates no packets. */
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+
+ /*
+ * Extract A receive status byte.
+ * As our 86960 is in 16 bit bus access mode, we have to
+ * use inw() to get the status byte. The significant
+ * value is returned in lower 8 bits.
+ */
+ status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: receive status = %04x\n",
+ sc->sc_unit, status );
+#endif
+
+ /*
+ * Extract the packet length.
+ * It is a sum of a header (14 bytes) and a payload.
+ * CRC has been stripped off by the 86960.
+ */
+ len = inw( sc->ioaddr[ FE_BMPR8 ] );
+
+#if FE_DEBUG >= 1
+ /*
+ * If there was an error with the received packet, it
+ * must be an indication of out-of-sync on receive
+ * buffer, because we have programmed the 8696x to
+ * to discard errored packets, even when the interface
+ * is in promiscuous mode. We have to re-synchronize.
+ */
+ if (!(status & FE_RPH_GOOD)) {
+ log(LOG_ERR,
+ "fe%d: corrupted receive status byte (%02x)\n",
+ sc->arpcom.ac_if.if_unit, status);
+ sc->arpcom.ac_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * MB86960 checks the packet length and drop big packet
+ * before passing it to us. There are no chance we can
+ * get big packets through it, even if they are actually
+ * sent over a line. Hence, if the length exceeds
+ * the specified limit, it means some serious failure,
+ * such as out-of-sync on receive buffer management.
+ *
+ * Same for short packets, since we have programmed
+ * 86960 to drop short packets.
+ */
+ if ( len > ETHER_MAX_LEN - ETHER_CRC_LEN
+ || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ log( LOG_WARNING,
+ "fe%d: received a %s packet? (%u bytes)\n",
+ sc->sc_unit,
+ len < ETHER_MIN_LEN - ETHER_CRC_LEN
+ ? "partial" : "big",
+ len );
+ sc->sc_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
+ }
+#endif
+
+ /*
+ * Go get a packet.
+ */
+ if ( fe_get_packet( sc, len ) < 0 ) {
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "%s%d: out of mbuf;"
+ " dropping a packet (%u bytes)\n",
+ sc->sc_unit, len );
+#endif
+
+ /* Skip a packet, updating statistics. */
+ sc->sc_if.if_ierrors++;
+ fe_droppacket( sc, len );
+
+ /*
+ * Try extracting other packets, although they will
+ * cause out-of-mbuf error again. This is required
+ * to keep receiver interrupt comming.
+ * (Earlier versions had a bug on this point.)
+ */
+ continue;
+ }
+
+ /* Successfully received a packet. Update stat. */
+ sc->sc_if.if_ipackets++;
+ }
+}
+
+/*
+ * Ethernet interface interrupt processor
+ */
+void
+feintr ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ u_char tstat, rstat;
+
+ /*
+ * Loop until there are no more new interrupt conditions.
+ */
+ for (;;) {
+
+#if FE_DEBUG >= 4
+ fe_dump( LOG_INFO, sc, "intr()" );
+#endif
+
+ /*
+ * Get interrupt conditions, masking unneeded flags.
+ */
+ tstat = inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_TMASK;
+ rstat = inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_RMASK;
+
+#if FE_DEBUG >= 1
+ /* Test for a "dead-lock" condition. */
+ if ((rstat & FE_D1_PKTRDY) == 0
+ && (inb(sc->ioaddr[FE_DLCR5]) & FE_D5_BUFEMP) == 0
+ && (inb(sc->ioaddr[FE_DLCR1]) & FE_D1_PKTRDY) == 0) {
+ /*
+ * PKTRDY is off, while receive buffer is not empty.
+ * We did a double check to avoid a race condition...
+ * So, we should have missed an interrupt.
+ */
+ log(LOG_WARNING,
+ "fe%d: missed a receiver interrupt?\n",
+ sc->arpcom.ac_if.if_unit);
+ /* Simulate the missed interrupt condition. */
+ rstat |= FE_D1_PKTRDY;
+ }
+#endif
+
+ /* Stop processing if there are no interrupts to handle. */
+ if ( tstat == 0 && rstat == 0 ) break;
+
+ /*
+ * Reset the conditions we are acknowledging.
+ */
+ outb( sc->ioaddr[ FE_DLCR0 ], tstat );
+ outb( sc->ioaddr[ FE_DLCR1 ], rstat );
+
+ /*
+ * Handle transmitter interrupts. Handle these first because
+ * the receiver will reset the board under some conditions.
+ */
+ if ( tstat ) {
+ fe_tint( sc, tstat );
+ }
+
+ /*
+ * Handle receiver interrupts
+ */
+ if ( rstat ) {
+ fe_rint( sc, rstat );
+ }
+
+ /*
+ * Update the multicast address filter if it is
+ * needed and possible. We do it now, because
+ * we can make sure the transmission buffer is empty,
+ * and there is a good chance that the receive queue
+ * is empty. It will minimize the possibility of
+ * packet loss.
+ */
+ if ( sc->filter_change
+ && sc->txb_count == 0 && sc->txb_sched == 0 ) {
+ fe_loadmar(sc);
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ }
+
+ /*
+ * If it looks like the transmitter can take more data,
+ * attempt to start output on the interface. This is done
+ * after handling the receiver interrupt to give the
+ * receive operation priority.
+ *
+ * BTW, I'm not sure in what case the OACTIVE is on at
+ * this point. Is the following test redundant?
+ *
+ * No. This routine polls for both transmitter and
+ * receiver interrupts. 86960 can raise a receiver
+ * interrupt when the transmission buffer is full.
+ */
+ if ( ( sc->sc_if.if_flags & IFF_OACTIVE ) == 0 ) {
+ fe_start( &sc->sc_if );
+ }
+
+ }
+}
+
+/*
+ * Process an ioctl request. This code needs some work - it looks
+ * pretty ugly.
+ */
+static int
+fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
+{
+ struct fe_softc *sc = ifp->if_softc;
+ int s, error = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: ioctl(%x)\n", sc->sc_unit, command );
+#endif
+
+ s = splimp();
+
+ switch (command) {
+
+ case SIOCSIFADDR:
+ {
+ struct ifaddr * ifa = ( struct ifaddr * )data;
+
+ sc->sc_if.if_flags |= IFF_UP;
+
+ switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+ case AF_INET:
+ fe_init( sc->sc_unit ); /* before arp_ifinit */
+ arp_ifinit( &sc->arpcom, ifa );
+ break;
+#endif
+#ifdef IPX
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_IPX:
+ {
+ register struct ipx_addr *ina
+ = &(IA_SIPX(ifa)->sipx_addr);
+
+ if (ipx_nullhost(*ina))
+ ina->x_host =
+ *(union ipx_host *) (sc->sc_enaddr); else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+#ifdef INET6
+ case AF_INET6:
+ /* IPV6 added by shin 96.2.6 */
+ fe_init(sc->sc_unit);
+ ndp6_ifinit(&sc->arpcom, ifa);
+ break;
+#endif
+#ifdef NS
+
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_NS:
+ {
+ register struct ns_addr *ina
+ = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host =
+ *(union ns_host *) (sc->sc_enaddr);
+ else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+ default:
+ fe_init( sc->sc_unit );
+ break;
+ }
+ break;
+ }
+
+#ifdef SIOCGIFADDR
+ case SIOCGIFADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+ struct sockaddr * sa = ( struct sockaddr * )&ifr->ifr_data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)sa->sa_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef SIOCGIFPHYSADDR
+ case SIOCGIFPHYSADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)&ifr->ifr_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef notdef
+#ifdef SIOCSIFPHYSADDR
+ case SIOCSIFPHYSADDR:
+ {
+ /*
+ * Set the physical (Ethernet) address of the interface.
+ * When and by whom is this command used? FIXME.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)&ifr->ifr_data,
+ (caddr_t)sc->sc_enaddr, ETHER_ADDR_LEN);
+ fe_setlinkaddr( sc );
+ break;
+ }
+#endif
+#endif /* notdef */
+
+#ifdef SIOCSIFFLAGS
+ case SIOCSIFFLAGS:
+ {
+ /*
+ * Switch interface state between "running" and
+ * "stopped", reflecting the UP flag.
+ */
+ if ( sc->sc_if.if_flags & IFF_UP ) {
+ if ( ( sc->sc_if.if_flags & IFF_RUNNING ) == 0 ) {
+ fe_init( sc->sc_unit );
+ }
+ } else {
+ if ( ( sc->sc_if.if_flags & IFF_RUNNING ) != 0 ) {
+ fe_stop( sc->sc_unit );
+ }
+ }
+
+ /*
+ * Promiscuous and/or multicast flags may have changed,
+ * so reprogram the multicast filter and/or receive mode.
+ */
+ fe_setmode( sc );
+
+#if FE_DEBUG >= 1
+ /* "ifconfig fe0 debug" to print register dump. */
+ if ( sc->sc_if.if_flags & IFF_DEBUG ) {
+ fe_dump( LOG_DEBUG, sc, "SIOCSIFFLAGS(DEBUG)" );
+ }
+#endif
+ break;
+ }
+#endif
+
+#ifdef SIOCADDMULTI
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ /*
+ * Multicast list has changed; set the hardware filter
+ * accordingly.
+ */
+ fe_setmode( sc );
+ error = 0;
+ break;
+#endif
+
+#ifdef SIOCSIFMTU
+ case SIOCSIFMTU:
+ {
+ /*
+ * Set the interface MTU.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ if ( ifr->ifr_mtu > ETHERMTU ) {
+ error = EINVAL;
+ } else {
+ sc->sc_if.if_mtu = ifr->ifr_mtu;
+ }
+ break;
+ }
+#endif
+
+ default:
+ error = EINVAL;
+ }
+
+ (void) splx(s);
+ return (error);
+}
+
+/*
+ * Retrieve packet from receive buffer and send to the next level up via
+ * ether_input(). If there is a BPF listener, give a copy to BPF, too.
+ * Returns 0 if success, -1 if error (i.e., mbuf allocation failure).
+ */
+static int
+fe_get_packet ( struct fe_softc * sc, u_short len )
+{
+ struct ether_header *eh;
+ struct mbuf *m;
+
+ /*
+ * NFS wants the data be aligned to the word (4 byte)
+ * boundary. Ethernet header has 14 bytes. There is a
+ * 2-byte gap.
+ */
+#define NFS_MAGIC_OFFSET 2
+
+ /*
+ * This function assumes that an Ethernet packet fits in an
+ * mbuf (with a cluster attached when necessary.) On FreeBSD
+ * 2.0 for x86, which is the primary target of this driver, an
+ * mbuf cluster has 4096 bytes, and we are happy. On ancient
+ * BSDs, such as vanilla 4.3 for 386, a cluster size was 1024,
+ * however. If the following #error message were printed upon
+ * compile, you need to rewrite this function.
+ */
+#if ( MCLBYTES < ETHER_MAX_LEN - ETHER_CRC_LEN + NFS_MAGIC_OFFSET )
+#error "Too small MCLBYTES to use fe driver."
+#endif
+
+ /*
+ * Our strategy has one more problem. There is a policy on
+ * mbuf cluster allocation. It says that we must have at
+ * least MINCLSIZE (208 bytes on FreeBSD 2.0 for x86) to
+ * allocate a cluster. For a packet of a size between
+ * (MHLEN - 2) to (MINCLSIZE - 2), our code violates the rule...
+ * On the other hand, the current code is short, simple,
+ * and fast, however. It does no harmful thing, just waists
+ * some memory. Any comments? FIXME.
+ */
+
+ /* Allocate an mbuf with packet header info. */
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if ( m == NULL ) return -1;
+
+ /* Attach a cluster if this packet doesn't fit in a normal mbuf. */
+ if ( len > MHLEN - NFS_MAGIC_OFFSET ) {
+ MCLGET( m, M_DONTWAIT );
+ if ( !( m->m_flags & M_EXT ) ) {
+ m_freem( m );
+ return -1;
+ }
+ }
+
+ /* Initialize packet header info. */
+ m->m_pkthdr.rcvif = &sc->sc_if;
+ m->m_pkthdr.len = len;
+
+ /* Set the length of this packet. */
+ m->m_len = len;
+
+ /* The following silliness is to make NFS happy */
+ m->m_data += NFS_MAGIC_OFFSET;
+
+ /* Get a packet. */
+ insw( sc->ioaddr[ FE_BMPR8 ], m->m_data, ( len + 1 ) >> 1 );
+
+ /* Get (actually just point to) the header part. */
+ eh = mtod( m, struct ether_header *);
+
+#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a BPF listener on this interface.
+ * If it is, hand off the raw packet to bpf.
+ */
+ if ( sc->sc_if.if_bpf ) {
+ bpf_mtap( &sc->sc_if, m );
+ }
+#endif
+
+ /*
+ * Make sure this packet is (or may be) directed to us.
+ * That is, the packet is either unicasted to our address,
+ * or broad/multi-casted. If any other packets are
+ * received, it is an indication of an error -- probably
+ * 86960 is in a wrong operation mode.
+ * Promiscuous mode is an exception. Under the mode, all
+ * packets on the media must be received. (We must have
+ * programmed the 86960 so.)
+ */
+
+ if ( ( sc->sc_if.if_flags & IFF_PROMISC )
+ && !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * The packet was not for us. This is normal since
+ * we are now in promiscuous mode. Just drop the packet.
+ */
+ m_freem( m );
+ return 0;
+ }
+
+#if FE_DEBUG >= 3
+ if ( !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * This packet was not for us. We can't be in promiscuous
+ * mode since the case was handled by above test.
+ * We found an error (of this driver.)
+ */
+ log( LOG_WARNING,
+ "fe%d: got an unwanted packet, dst = %6D\n",
+ sc->sc_unit, eh->ether_dhost , ":" );
+ m_freem( m );
+ return 0;
+ }
+#endif
+
+ /* Strip off the Ethernet header. */
+ m->m_pkthdr.len -= sizeof ( struct ether_header );
+ m->m_len -= sizeof ( struct ether_header );
+ m->m_data += sizeof ( struct ether_header );
+
+ /* Feed the packet to upper layer. */
+ ether_input( &sc->sc_if, eh, m );
+ return 0;
+}
+
+/*
+ * Write an mbuf chain to the transmission buffer memory using 16 bit PIO.
+ * Returns number of bytes actually written, including length word.
+ *
+ * If an mbuf chain is too long for an Ethernet frame, it is not sent.
+ * Packets shorter than Ethernet minimum are legal, and we pad them
+ * before sending out. An exception is "partial" packets which are
+ * shorter than mandatory Ethernet header.
+ */
+static void
+fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
+{
+ u_short addr_bmpr8 = sc->ioaddr[ FE_BMPR8 ];
+ u_short length, len;
+ struct mbuf *mp;
+ u_char *data;
+ u_short savebyte; /* WARNING: Architecture dependent! */
+#define NO_PENDING_BYTE 0xFFFF
+
+ static u_char padding [ ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_HDR_LEN ];
+
+#if FE_DEBUG >= 1
+ /* First, count up the total number of bytes to copy */
+ length = 0;
+ for ( mp = m; mp != NULL; mp = mp->m_next ) {
+ length += mp->m_len;
+ }
+#else
+ /* Just use the length value in the packet header. */
+ length = m->m_pkthdr.len;
+#endif
+
+#if FE_DEBUG >= 2
+ /* Check if this matches the one in the packet header. */
+ if ( length != m->m_pkthdr.len ) {
+ log( LOG_WARNING, "fe%d: packet length mismatch? (%d/%d)\n",
+ sc->sc_unit, length, m->m_pkthdr.len );
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * Should never send big packets. If such a packet is passed,
+ * it should be a bug of upper layer. We just ignore it.
+ * ... Partial (too short) packets, neither.
+ */
+ if ( length < ETHER_HDR_LEN
+ || length > ETHER_MAX_LEN - ETHER_CRC_LEN ) {
+ log( LOG_ERR,
+ "fe%d: got an out-of-spec packet (%u bytes) to send\n",
+ sc->sc_unit, length );
+ sc->sc_if.if_oerrors++;
+ return;
+ }
+#endif
+
+ /*
+ * Put the length word for this frame.
+ * Does 86960 accept odd length? -- Yes.
+ * Do we need to pad the length to minimum size by ourselves?
+ * -- Generally yes. But for (or will be) the last
+ * packet in the transmission buffer, we can skip the
+ * padding process. It may gain performance slightly. FIXME.
+ */
+ outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
+
+ /*
+ * Update buffer status now.
+ * Truncate the length up to an even number, since we use outw().
+ */
+ length = ( length + 1 ) & ~1;
+ sc->txb_free -= FE_DATA_LEN_LEN + max( length, ETHER_MIN_LEN - ETHER_CRC_LEN);
+ sc->txb_count++;
+
+ /*
+ * Transfer the data from mbuf chain to the transmission buffer.
+ * MB86960 seems to require that data be transferred as words, and
+ * only words. So that we require some extra code to patch
+ * over odd-length mbufs.
+ */
+ savebyte = NO_PENDING_BYTE;
+ for ( mp = m; mp != 0; mp = mp->m_next ) {
+
+ /* Ignore empty mbuf. */
+ len = mp->m_len;
+ if ( len == 0 ) continue;
+
+ /* Find the actual data to send. */
+ data = mtod(mp, caddr_t);
+
+ /* Finish the last byte. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte | ( *data << 8 ) );
+ data++;
+ len--;
+ savebyte = NO_PENDING_BYTE;
+ }
+
+ /* output contiguous words */
+ if (len > 1) {
+ outsw( addr_bmpr8, data, len >> 1);
+ data += len & ~1;
+ len &= 1;
+ }
+
+ /* Save a remaining byte, if there is one. */
+ if ( len > 0 ) {
+ savebyte = *data;
+ }
+ }
+
+ /* Spit the last byte, if the length is odd. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte );
+ }
+
+ /* Pad to the Ethernet minimum length, if the packet is too short. */
+ if ( length < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
+ }
+}
+
+/*
+ * Compute hash value for an Ethernet address
+ */
+static int
+fe_hash ( u_char * ep )
+{
+#define FE_HASH_MAGIC_NUMBER 0xEDB88320L
+
+ u_long hash = 0xFFFFFFFFL;
+ int i, j;
+ u_char b;
+ u_long m;
+
+ for ( i = ETHER_ADDR_LEN; --i >= 0; ) {
+ b = *ep++;
+ for ( j = 8; --j >= 0; ) {
+ m = hash;
+ hash >>= 1;
+ if ( ( m ^ b ) & 1 ) hash ^= FE_HASH_MAGIC_NUMBER;
+ b >>= 1;
+ }
+ }
+ return ( ( int )( hash >> 26 ) );
+}
+
+/*
+ * Compute the multicast address filter from the
+ * list of multicast addresses we need to listen to.
+ */
+static struct fe_filter
+fe_mcaf ( struct fe_softc *sc )
+{
+ int index;
+ struct fe_filter filter;
+ struct ifmultiaddr *ifma;
+
+ filter = fe_filter_nothing;
+ for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma;
+ ifma = ifma->ifma_link.le_next) {
+ if (ifma->ifma_addr->sa_family != AF_LINK)
+ continue;
+ index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: hash(%6D) == %d\n",
+ sc->sc_unit, enm->enm_addrlo , ":", index );
+#endif
+
+ filter.data[index >> 3] |= 1 << (index & 7);
+ }
+ return ( filter );
+}
+
+/*
+ * Calculate a new "multicast packet filter" and put the 86960
+ * receiver in appropriate mode.
+ */
+static void
+fe_setmode ( struct fe_softc *sc )
+{
+ int flags = sc->sc_if.if_flags;
+
+ /*
+ * If the interface is not running, we postpone the update
+ * process for receive modes and multicast address filter
+ * until the interface is restarted. It reduces some
+ * complicated job on maintaining chip states. (Earlier versions
+ * of this driver had a bug on that point...)
+ *
+ * To complete the trick, fe_init() calls fe_setmode() after
+ * restarting the interface.
+ */
+ if ( !( flags & IFF_RUNNING ) ) return;
+
+ /*
+ * Promiscuous mode is handled separately.
+ */
+ if ( flags & IFF_PROMISC ) {
+ /*
+ * Program 86960 to receive all packets on the segment
+ * including those directed to other stations.
+ * Multicast filter stored in MARs are ignored
+ * under this setting, so we don't need to update it.
+ *
+ * Promiscuous mode in FreeBSD 2 is used solely by
+ * BPF, and BPF only listens to valid (no error) packets.
+ * So, we ignore erroneous ones even in this mode.
+ * (Older versions of fe driver mistook the point.)
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ],
+ sc->proto_dlcr5 | FE_D5_AFM0 | FE_D5_AFM1 );
+ sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: promiscuous mode\n", sc->sc_unit );
+#endif
+ return;
+ }
+
+ /*
+ * Turn the chip to the normal (non-promiscuous) mode.
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 | FE_D5_AFM1 );
+
+ /*
+ * Find the new multicast filter value.
+ * I'm not sure we have to handle modes other than MULTICAST.
+ * Who sets ALLMULTI? Who turns MULTICAST off? FIXME.
+ */
+ if ( flags & IFF_ALLMULTI ) {
+ sc->filter = fe_filter_all;
+ } else if ( flags & IFF_MULTICAST ) {
+ sc->filter = fe_mcaf( sc );
+ } else {
+ sc->filter = fe_filter_nothing;
+ }
+ sc->filter_change = 1;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter: [%8D]\n",
+ sc->sc_unit, sc->filter.data, " " );
+#endif
+
+ /*
+ * We have to update the multicast filter in the 86960, A.S.A.P.
+ *
+ * Note that the DLC (Data Link Control unit, i.e. transmitter
+ * and receiver) must be stopped when feeding the filter, and
+ * DLC trashes all packets in both transmission and receive
+ * buffers when stopped.
+ *
+ * ... Are the above sentences correct? I have to check the
+ * manual of the MB86960A. FIXME.
+ *
+ * To reduce the packet loss, we delay the filter update
+ * process until buffers are empty.
+ */
+ if ( sc->txb_sched == 0 && sc->txb_count == 0
+ && !( inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_D1_PKTRDY ) ) {
+ /*
+ * Buffers are (apparently) empty. Load
+ * the new filter value into MARs now.
+ */
+ fe_loadmar(sc);
+ } else {
+ /*
+ * Buffers are not empty. Mark that we have to update
+ * the MARs. The new filter will be loaded by feintr()
+ * later.
+ */
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: filter change delayed\n", sc->sc_unit );
+#endif
+ }
+}
+
+/*
+ * Load a new multicast address filter into MARs.
+ *
+ * The caller must have splimp'ed before fe_loadmar.
+ * This function starts the DLC upon return. So it can be called only
+ * when the chip is working, i.e., from the driver's point of view, when
+ * a device is RUNNING. (I mistook the point in previous versions.)
+ */
+static void
+fe_loadmar ( struct fe_softc * sc )
+{
+ /* Stop the DLC (transmitter and receiver). */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Select register bank 1 for MARs. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_MAR | FE_D7_POWER_UP );
+
+ /* Copy filter value into the registers. */
+ outblk( sc, FE_MAR8, sc->filter.data, FE_FILTER_LEN );
+
+ /* Restore the bank selection for BMPRs (i.e., runtime registers). */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP );
+
+ /* Restart the DLC. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
+ DELAY( 200 );
+
+ /* We have just updated the filter. */
+ sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter changed\n", sc->sc_unit );
+#endif
+}
+
+#if FE_DEBUG >= 1
+static void
+fe_dump ( int level, struct fe_softc * sc, char * message )
+{
+ log( level, "fe%d: %s,"
+ " DLCR = %02x %02x %02x %02x %02x %02x %02x %02x,"
+ " BMPR = xx xx %02x %02x %02x %02x %02x %02x,"
+ " asic = %02x %02x %02x %02x %02x %02x %02x %02x"
+ " + %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ sc->sc_unit, message ? message : "registers",
+ inb( sc->ioaddr[ FE_DLCR0 ] ), inb( sc->ioaddr[ FE_DLCR1 ] ),
+ inb( sc->ioaddr[ FE_DLCR2 ] ), inb( sc->ioaddr[ FE_DLCR3 ] ),
+ inb( sc->ioaddr[ FE_DLCR4 ] ), inb( sc->ioaddr[ FE_DLCR5 ] ),
+ inb( sc->ioaddr[ FE_DLCR6 ] ), inb( sc->ioaddr[ FE_DLCR7 ] ),
+ inb( sc->ioaddr[ FE_BMPR10 ] ), inb( sc->ioaddr[ FE_BMPR11 ] ),
+ inb( sc->ioaddr[ FE_BMPR12 ] ), inb( sc->ioaddr[ FE_BMPR13 ] ),
+ inb( sc->ioaddr[ FE_BMPR14 ] ), inb( sc->ioaddr[ FE_BMPR15 ] ),
+ inb( sc->ioaddr[ 0x10 ] ), inb( sc->ioaddr[ 0x11 ] ),
+ inb( sc->ioaddr[ 0x12 ] ), inb( sc->ioaddr[ 0x13 ] ),
+ inb( sc->ioaddr[ 0x14 ] ), inb( sc->ioaddr[ 0x15 ] ),
+ inb( sc->ioaddr[ 0x16 ] ), inb( sc->ioaddr[ 0x17 ] ),
+ inb( sc->ioaddr[ 0x18 ] ), inb( sc->ioaddr[ 0x19 ] ),
+ inb( sc->ioaddr[ 0x1A ] ), inb( sc->ioaddr[ 0x1B ] ),
+ inb( sc->ioaddr[ 0x1C ] ), inb( sc->ioaddr[ 0x1D ] ),
+ inb( sc->ioaddr[ 0x1E ] ), inb( sc->ioaddr[ 0x1F ] ) );
+}
+#endif
diff --git a/sys/pc98/pc98/lpt.c b/sys/pc98/pc98/lpt.c
index 856974f65f84..1fac3d86e58c 100644
--- a/sys/pc98/pc98/lpt.c
+++ b/sys/pc98/pc98/lpt.c
@@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
- * $Id: lpt.c,v 1.23 1998/10/22 05:58:45 bde Exp $
+ * $Id: lpt.c,v 1.21 1998/06/17 16:33:14 kato Exp $
*/
/*
@@ -195,12 +195,9 @@
#ifndef DEBUG
-#define lprintf(args)
+#define lprintf (void)
#else
-#define lprintf(args) do { \
- if (lptflag) \
- printf args; \
- } while (0)
+#define lprintf if (lptflag) printf
static int volatile lptflag = 1;
#endif
@@ -272,7 +269,6 @@ static struct lpt_softc {
static timeout_t lptout;
static int lptprobe (struct isa_device *dvp);
static int lptattach (struct isa_device *isdp);
-static ointhand2_t lptintr;
#ifdef INET
@@ -328,8 +324,8 @@ lpt_port_test (int port, u_char data, u_char mask)
temp = inb(port) & mask;
}
while (temp != data && --timeout);
- lprintf(("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
- port, data, temp, timeout));
+ lprintf("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
+ port, data, temp, timeout);
return (temp == data);
}
@@ -441,7 +437,6 @@ lptattach(struct isa_device *isdp)
struct lpt_softc *sc;
int unit;
- isdp->id_ointr = lptintr;
unit = isdp->id_unit;
sc = lpt_sc + unit;
sc->sc_port = isdp->id_iobase;
@@ -457,7 +452,7 @@ lptattach(struct isa_device *isdp)
#endif
/* check if we can use interrupt */
- lprintf(("oldirq %x\n", sc->sc_irq));
+ lprintf("oldirq %x\n", sc->sc_irq);
if (isdp->id_irq) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf("lpt%d: Interrupt-driven port\n", unit);
@@ -466,9 +461,9 @@ lptattach(struct isa_device *isdp)
#endif
} else {
sc->sc_irq = 0;
- lprintf(("lpt%d: Polled port\n", unit));
+ lprintf("lpt%d: Polled port\n", unit);
}
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
#ifdef DEVFS
/* XXX what to do about the flags in the minor number? */
@@ -506,7 +501,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
#endif
if (sc->sc_state) {
- lprintf(("lp: still open %x\n", sc->sc_state));
+ lprintf("lp: still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= INIT;
@@ -520,7 +515,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
}
s = spltty();
- lprintf(("lp flags 0x%x\n", sc->sc_flags));
+ lprintf("lp flags 0x%x\n", sc->sc_flags);
port = sc->sc_port;
/* set IRQ status according to ENABLE_IRQ flag */
@@ -548,7 +543,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- lprintf(("status %x\n", inb(port+lpt_status)));
+ lprintf ("status %x\n", inb(port+lpt_status) );
return (EBUSY);
}
@@ -581,14 +576,14 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
splx(s);
/* only use timeout if using interrupt */
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- lprintf(("opened.\n"));
+ lprintf("opened.\n");
return(0);
}
@@ -598,7 +593,7 @@ lptout (void *arg)
struct lpt_softc *sc = arg;
int pl;
- lprintf(("T %x ", inb(sc->sc_port+lpt_status)));
+ lprintf ("T %x ", inb(sc->sc_port+lpt_status));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -657,7 +652,7 @@ lptclose(dev_t dev, int flags, int fmt, struct proc *p)
end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- lprintf(("closed.\n"));
+ lprintf("closed.\n");
return(0);
}
@@ -676,7 +671,7 @@ pushbytes(struct lpt_softc * sc)
char ch;
int port = sc->sc_port;
- lprintf(("p"));
+ lprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -754,16 +749,16 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- lprintf(("i"));
+ lprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- lprintf(("\nC %d. ", sc->sc_xfercnt));
+ lprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
lptintr(sc - lpt_sc);
(void) splx(pl);
}
- lprintf(("W "));
+ lprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep ((caddr_t)sc,
LPPRI|PCATCH, "lpwrite", 0))) {
@@ -773,7 +768,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
}
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- lprintf(("p"));
+ lprintf("p");
if((err = pushbytes(sc)))
return(err);
}
@@ -788,7 +783,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
* do checking for interrupted write call.
*/
-static void
+void
lptintr(int unit)
{
struct lpt_softc *sc = lpt_sc + unit;
@@ -819,7 +814,7 @@ lptintr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*lprintf(("%x ", *sc->sc_cp)); */
+ /*lprintf("%x ", *sc->sc_cp); */
outb(port+lpt_data, *sc->sc_cp++) ;
outb(port+lpt_control, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -836,7 +831,7 @@ lptintr(int unit)
sc->sc_state &= ~OBUSY;
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- lprintf(("w "));
+ lprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -845,7 +840,7 @@ lptintr(int unit)
/* lptout() will jump in and try to restart. */
}
#endif
- lprintf(("sts %x ", sts));
+ lprintf("sts %x ", sts);
}
static int
@@ -1032,7 +1027,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- lprintf(("LP:ioctl(0x%lx)\n", cmd));
+ lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
}
return 0;
@@ -1129,7 +1124,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1178,7 +1173,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1200,7 +1195,7 @@ lpintr (int unit)
err:
outb(lpt_data_port, 0);
- lprintf(("R"));
+ lprintf("R");
sc->sc_if.if_ierrors++;
sc->sc_iferrs++;
@@ -1266,7 +1261,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (ifp->if_flags & IFF_LINK0) {
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1326,7 +1321,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
nend:
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1335,7 +1330,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
(void) splx(s);
@@ -1343,7 +1338,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
}
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1368,7 +1363,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1396,7 +1391,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c
index e5bcc4439bf8..65a8aa5bc858 100644
--- a/sys/pc98/pc98/mse.c
+++ b/sys/pc98/pc98/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.17 1998/06/08 08:55:44 kato Exp $
+ * $Id: mse.c,v 1.16 1998/01/24 02:54:38 eivind Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -88,7 +88,6 @@ static struct cdevsw mse_cdevsw =
mseioctl, nostop, nullreset, nodevtotty,/* mse */
msepoll, nommap, NULL, "mse", NULL, -1 };
-static ointhand2_t mseintr;
/*
* Software control structure for mouse. The sc_enablemouse(),
@@ -322,7 +321,6 @@ mseattach(idp)
}
#endif
- idp->id_ointr = mseintr;
sc->sc_port = idp->id_iobase;
sc->mode.accelfactor = (idp->id_flags & MSE_CONFIG_ACCEL) >> 4;
#ifdef DEVFS
@@ -612,7 +610,7 @@ msepoll(dev, events, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
-static void
+void
mseintr(unit)
int unit;
{
diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c
index 03077ddfb565..504fd3cf506e 100644
--- a/sys/pc98/pc98/npx.c
+++ b/sys/pc98/pc98/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.41 1998/12/17 08:41:34 kato Exp $
+ * $Id: npx.c,v 1.37 1998/05/04 07:33:32 kato Exp $
*/
#include "npx.h"
@@ -59,7 +59,9 @@
#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/ipl.h>
+#ifndef SMP
#include <machine/md_var.h>
+#endif
#include <machine/pcb.h>
#include <machine/psl.h>
#ifndef SMP
@@ -89,7 +91,15 @@
#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
/* XXX - should be in header file. */
-ointhand2_t npxintr;
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+extern int (*copyin_vector) __P((const void *udaddr, void *kaddr, size_t len));
+extern int (*copyout_vector) __P((const void *kaddr, void *udaddr, size_t len));
+
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
+int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
+int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
#ifdef __GNUC__
@@ -140,17 +150,15 @@ SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
CTLFLAG_RD, &hw_float, 0,
"Floatingpoint instructions executed in hardware");
-#ifndef SMP
-static u_int npx0_imask = SWI_CLOCK_MASK;
-static struct gate_descriptor npx_idt_probeintr;
-static int npx_intrno;
-static volatile u_int npx_intrs_while_probing;
-static volatile u_int npx_traps_while_probing;
-#endif
+static u_int npx0_imask = SWI_CLOCK_MASK;
static bool_t npx_ex16;
static bool_t npx_exists;
+static struct gate_descriptor npx_idt_probeintr;
+static int npx_intrno;
+static volatile u_int npx_intrs_while_probing;
static bool_t npx_irq13;
+static volatile u_int npx_traps_while_probing;
#ifndef SMP
/*
@@ -270,10 +278,8 @@ static int
npxprobe1(dvp)
struct isa_device *dvp;
{
-#ifndef SMP
u_short control;
u_short status;
-#endif
/*
* Partially reset the coprocessor, if any. Some BIOS's don't reset
@@ -421,8 +427,6 @@ int
npxattach(dvp)
struct isa_device *dvp;
{
- dvp->id_ointr = npxintr;
-
/* The caller has printed "irq 13" for the npx_irq13 case. */
if (!npx_irq13) {
printf("npx%d: ", dvp->id_unit);
diff --git a/sys/pc98/pc98/pc98.c b/sys/pc98/pc98/pc98.c
index a3c9bc36c214..185c34906674 100644
--- a/sys/pc98/pc98/pc98.c
+++ b/sys/pc98/pc98/pc98.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: pc98.c,v 1.54 1998/10/22 05:58:45 bde Exp $
+ * $Id: pc98.c,v 1.52 1998/10/12 15:06:02 kato Exp $
*/
/*
@@ -535,7 +535,7 @@ config_isadev_c(isdp, mp, reconfig)
printf("%s%d", dp->name, isdp->id_unit);
if (id_alive != -1) {
if (isdp->id_iobase == -1)
- printf(" at");
+ printf(" at ?");
else {
printf(" at 0x%x", isdp->id_iobase);
if (isdp->id_iobase + id_alive - 1 !=
@@ -583,10 +583,7 @@ config_isadev_c(isdp, mp, reconfig)
isdp->id_alive = id_alive;
}
(*dp->attach)(isdp);
- if (isdp->id_irq != 0 && isdp->id_intr == NULL)
- printf("%s%d: irq with no handler\n",
- dp->name, isdp->id_unit);
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
#ifdef APIC_IO
/*
* Some motherboards use upper IRQs for traditional
@@ -623,7 +620,7 @@ config_isadev_c(isdp, mp, reconfig)
} else {
#if 0
/* This code has not been tested.... */
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
icu_unset(ffs(isdp->id_irq) - 1,
isdp->id_intr);
if (mp)
diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c
deleted file mode 100644
index 076f9e774882..000000000000
--- a/sys/pc98/pc98/pc98gdc.c
+++ /dev/null
@@ -1,887 +0,0 @@
-/*
- * Copyright (c) 1999 FreeBSD(98) port team.
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * 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.
- *
- * $Id$
- */
-
-#include "gdc.h"
-#include "opt_gdc.h"
-#include "opt_fb.h"
-#include "opt_syscons.h"
-
-#if NGDC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/console.h>
-#include <machine/md_var.h>
-#include <machine/pc/bios.h>
-
-#include <dev/fb/fbreg.h>
-
-#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_machdep.h>
-
-#include <i386/isa/isa_device.h>
-
-#define TEXT_GDC IO_GDC1 /* 0x60 */
-#define ROW 25
-#define COL 80
-
-#define DRIVER_NAME "gdc"
-
-/* cdev driver declaration */
-
-#define GDC_UNIT(dev) minor(dev)
-#define GDC_MKMINOR(unit) (unit)
-
-static int gdcprobe(struct isa_device *dev);
-static int gdc_attach(struct isa_device *dev);
-static void gdc_drvinit(void *unused);
-
-struct isa_driver gdcdriver = {
- gdcprobe,
- gdc_attach,
- DRIVER_NAME,
- 0,
-};
-
-typedef struct gdc_softc {
- video_adapter_t *adp;
-} gdc_softc_t;
-
-static int gdc_probe_unit(int unit, gdc_softc_t *sc, int flags);
-static int gdc_attach_unit(int unit, gdc_softc_t *sc, int flags);
-
-#define GDC_SOFTC(unit) (gdc_softc[unit])
-
-static gdc_softc_t *gdc_softc[NGDC];
-
-#if FB_INSTALL_CDEV
-
-static d_open_t gdcopen;
-static d_close_t gdcclose;
-static d_read_t gdcread;
-static d_ioctl_t gdcioctl;
-
-static struct cdevsw vga_cdevsw = {
- gdcopen, gdcclose, noread, nowrite, /* ?? */
- gdcioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-#endif /* FB_INSTALL_CDEV */
-
-static int
-gdcprobe(struct isa_device *dev)
-{
- gdc_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(gdc_softc)/sizeof(gdc_softc[0]))
- return 0;
- sc = gdc_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
-
- error = gdc_probe_unit(dev->id_unit, sc, dev->id_flags);
- if (error) {
- gdc_softc[dev->id_unit] = NULL;
- free(sc, M_DEVBUF);
- return 0;
- }
-
- dev->id_iobase = sc->adp->va_io_base;
- dev->id_maddr = (caddr_t)BIOS_PADDRTOVADDR(sc->adp->va_mem_base);
- dev->id_msize = sc->adp->va_mem_size;
-
- return sc->adp->va_io_size;
-}
-
-static int
-gdc_attach(struct isa_device *dev)
-{
- gdc_softc_t *sc;
-
- if (dev->id_unit >= sizeof(gdc_softc)/sizeof(gdc_softc[0]))
- return 0;
- sc = gdc_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((gdc_attach_unit(dev->id_unit, sc, dev->id_flags)) ? 0 : 1);
-}
-
-static int
-gdc_probe_unit(int unit, gdc_softc_t *sc, int flags)
-{
- video_switch_t *sw;
-
- bzero(sc, sizeof(*sc));
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return 0;
- return (*sw->probe)(unit, &sc->adp, NULL, flags);
-}
-
-static int
-gdc_attach_unit(int unit, gdc_softc_t *sc, int flags)
-{
- video_switch_t *sw;
- int error;
-
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- error = (*sw->init)(unit, sc->adp, flags);
- if (error)
- return ENXIO;
-
-#ifdef FB_INSTALL_CDEV
- /* attach a virtual frame buffer device */
- error = fb_attach(makedev(0, GDC_MKMINOR(unit)), scp->adp,
- &vga_cdevsw);
- if (error)
- return error;
-#endif /* FB_INSTALL_CDEV */
-
- if (bootverbose)
- (*sw->diag)(sc->adp, bootverbose);
-
- return 0;
-}
-
-/* LOW-LEVEL */
-
-#include <machine/clock.h>
-
-#include <pc98/pc98/30line.h>
-
-#define TEXT_BUF_BASE 0x000a0000
-#define TEXT_BUF_SIZE 0x00008000
-#define GRAPHICS_BUF_BASE 0x000a8000
-#define GRAPHICS_BUF_SIZE 0x00040000
-#define VIDEO_BUF_BASE 0x000a0000
-#define VIDEO_BUF_SIZE 0x00048000
-
-#define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED)
-#define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED)
-#define config_done(adp) ((adp)->va_flags & V_ADP_REGISTERED)
-
-/*
- * NOTE: `va_window' should have a virtual address, but is initialized
- * with a physical address in the following table, they will be
- * converted at run-time.
- */
-static video_adapter_t adapter_init_value[] = {
- { 0,
- KD_PC98, "gdc", /* va_type, va_name */
- 0, 0, /* va_unit, va_minor */
- V_ADP_COLOR | V_ADP_MODECHANGE | V_ADP_BORDER,
- IO_GDC1, 16, TEXT_GDC, /* va_io*, XXX */
- VIDEO_BUF_BASE, VIDEO_BUF_SIZE, /* va_mem* */
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, /* va_window* */
- 0, 0, /* va_buffer, va_buffer_size */
- 0, M_PC98_80x25, 0, 0, /* va_*mode* */
- NULL },
-};
-
-static video_adapter_t biosadapter[1];
-
-/* video driver declarations */
-static int gdc_configure(int flags);
-static int gdc_nop(void);
-static vi_probe_t gdc_probe;
-static vi_init_t gdc_init;
-static vi_get_info_t gdc_get_info;
-static vi_query_mode_t gdc_query_mode;
-static vi_set_mode_t gdc_set_mode;
-static vi_set_border_t gdc_set_border;
-static vi_save_state_t gdc_save_state;
-static vi_load_state_t gdc_load_state;
-static vi_read_hw_cursor_t gdc_read_hw_cursor;
-static vi_set_hw_cursor_t gdc_set_hw_cursor;
-static vi_set_hw_cursor_shape_t gdc_set_hw_cursor_shape;
-static vi_mmap_t gdc_mmap;
-static vi_diag_t gdc_diag;
-
-static int gdc_err(video_adapter_t *adp, ...);
-
-static video_switch_t gdcvidsw = {
- gdc_probe,
- gdc_init,
- gdc_get_info,
- gdc_query_mode,
- gdc_set_mode,
- (vi_save_font_t *)gdc_err,
- (vi_load_font_t *)gdc_err,
- (vi_show_font_t *)gdc_err,
- (vi_save_palette_t *)gdc_err,
- (vi_load_palette_t *)gdc_err,
- gdc_set_border,
- gdc_save_state,
- gdc_load_state,
- (vi_set_win_org_t *)gdc_err,
- gdc_read_hw_cursor,
- gdc_set_hw_cursor,
- gdc_set_hw_cursor_shape,
- (vi_blank_display_t *)gdc_nop,
- gdc_mmap,
- gdc_diag,
-};
-
-VIDEO_DRIVER(gdc, gdcvidsw, gdc_configure);
-
-/* GDC BIOS standard video modes */
-#define EOT (-1)
-#define NA (-2)
-
-static video_info_t bios_vmode[] = {
- { M_PC98_80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, 0, 0 },
-#ifdef LINE30
- { M_PC98_80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, 0, 0 },
-#endif
- { EOT },
-};
-
-static int init_done = FALSE;
-
-/* local functions */
-static int map_gen_mode_num(int type, int color, int mode);
-static int probe_adapters(void);
-static void dump_buffer(u_char *buf, size_t len);
-
-#define prologue(adp, flag, err) \
- if (!init_done || !((adp)->va_flags & (flag))) \
- return (err)
-
-/* a backdoor for the console driver */
-static int
-gdc_configure(int flags)
-{
- probe_adapters();
- biosadapter[0].va_flags |= V_ADP_INITIALIZED;
- if (!config_done(&biosadapter[0])) {
- if (vid_register(&biosadapter[0]) < 0)
- return 1;
- biosadapter[0].va_flags |= V_ADP_REGISTERED;
- }
-
- return 1;
-}
-
-/* local subroutines */
-
-/* map a generic video mode to a known mode number */
-static int
-map_gen_mode_num(int type, int color, int mode)
-{
- static struct {
- int from;
- int to;
- } mode_map[] = {
- { M_TEXT_80x25, M_PC98_80x25, },
-#ifdef LINE30
- { M_TEXT_80x30, M_PC98_80x30, },
-#endif
- };
- int i;
-
- for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
- if (mode_map[i].from == mode)
- return mode_map[i].to;
- }
- return mode;
-}
-
-/* probe video adapters and return the number of detected adapters */
-static int
-probe_adapters(void)
-{
- video_info_t info;
-
- /* do this test only once */
- if (init_done)
- return 1;
- init_done = TRUE;
-
- biosadapter[0] = adapter_init_value[0];
- biosadapter[0].va_flags |= V_ADP_PROBED;
- biosadapter[0].va_mode =
- biosadapter[0].va_initial_mode = biosadapter[0].va_initial_bios_mode;
-
- master_gdc_wait_vsync();
- master_gdc_cmd(_GDC_START); /* text ON */
- gdc_wait_vsync();
- gdc_cmd(_GDC_STOP); /* graphics OFF */
-
- gdc_get_info(&biosadapter[0], biosadapter[0].va_initial_mode, &info);
- biosadapter[0].va_mode_flags = info.vi_flags;
- biosadapter[0].va_window = BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[0].va_window_size = info.vi_window_size;
- biosadapter[0].va_window_gran = info.vi_window_gran;
- biosadapter[0].va_buffer = 0;
- biosadapter[0].va_buffer_size = 0;
-
- return 1;
-}
-
-static void master_gdc_cmd(unsigned int cmd)
-{
- while ( (inb(IO_GDC1) & 2) != 0);
- outb(IO_GDC1+2, cmd);
-}
-
-static void master_gdc_prm(unsigned int pmtr)
-{
- while ( (inb(IO_GDC1) & 2) != 0);
- outb(IO_GDC1, pmtr);
-}
-
-static void master_gdc_word_prm(unsigned int wpmtr)
-{
- master_gdc_prm(wpmtr & 0x00ff);
- master_gdc_prm((wpmtr >> 8) & 0x00ff);
-}
-
-static void master_gdc_fifo_empty(void)
-{
- while ( (inb(IO_GDC1) & 4) == 0);
-}
-
-static void master_gdc_wait_vsync(void)
-{
- while ( (inb(IO_GDC1) & 0x20) != 0);
- while ( (inb(IO_GDC1) & 0x20) == 0);
-}
-
-static void gdc_cmd(unsigned int cmd)
-{
- while ( (inb(IO_GDC2) & 2) != 0);
- outb( IO_GDC2+2, cmd);
-}
-
-static void gdc_prm(unsigned int pmtr)
-{
- while ( (inb(IO_GDC2) & 2) != 0);
- outb( IO_GDC2, pmtr);
-}
-
-static void gdc_word_prm(unsigned int wpmtr)
-{
- gdc_prm(wpmtr & 0x00ff);
- gdc_prm((wpmtr >> 8) & 0x00ff);
-}
-
-static void gdc_fifo_empty(void)
-{
- while ( (inb(IO_GDC2) & 0x04) == 0);
-}
-
-static void gdc_wait_vsync(void)
-{
- while ( (inb(IO_GDC2) & 0x20) != 0);
- while ( (inb(IO_GDC2) & 0x20) == 0);
-}
-
-static int check_gdc_clock(void)
-{
- if ((inb(IO_SYSPORT) & 0x80) == 0){
- return _5MHZ;
- } else {
- return _2_5MHZ;
- }
-}
-
-static void initialize_gdc(unsigned int mode)
-{
- /* start 30line initialize */
- int m_mode,s_mode,gdc_clock;
- gdc_clock = check_gdc_clock();
-
- if (mode == T25_G400){
- m_mode = _25L;
- }else{
- m_mode = _30L;
- }
-
- s_mode = 2*mode+gdc_clock;
-
- gdc_INFO = m_mode;
-
- master_gdc_cmd(_GDC_RESET);
- master_gdc_cmd(_GDC_MASTER);
- gdc_cmd(_GDC_RESET);
- gdc_cmd(_GDC_SLAVE);
-
- /* GDC Master */
- master_gdc_cmd(_GDC_SYNC);
- master_gdc_prm(0x00); /* flush less */ /* text & graph */
- master_gdc_prm(master_param[m_mode][GDC_CR]);
- master_gdc_word_prm(((master_param[m_mode][GDC_HFP] << 10)
- + (master_param[m_mode][GDC_VS] << 5)
- + master_param[m_mode][GDC_HS]));
- master_gdc_prm(master_param[m_mode][GDC_HBP]);
- master_gdc_prm(master_param[m_mode][GDC_VFP]);
- master_gdc_word_prm(((master_param[m_mode][GDC_VBP] << 10)
- + (master_param[m_mode][GDC_LF])));
- master_gdc_fifo_empty();
- master_gdc_cmd(_GDC_PITCH);
- master_gdc_prm(MasterPCH);
- master_gdc_fifo_empty();
-
- /* GDC slave */
- gdc_cmd(_GDC_SYNC);
- gdc_prm(0x06);
- gdc_prm(slave_param[s_mode][GDC_CR]);
- gdc_word_prm((slave_param[s_mode][GDC_HFP] << 10)
- + (slave_param[s_mode][GDC_VS] << 5)
- + (slave_param[s_mode][GDC_HS]));
- gdc_prm(slave_param[s_mode][GDC_HBP]);
- gdc_prm(slave_param[s_mode][GDC_VFP]);
- gdc_word_prm((slave_param[s_mode][GDC_VBP] << 10)
- + (slave_param[s_mode][GDC_LF]));
- gdc_fifo_empty();
- gdc_cmd(_GDC_PITCH);
- gdc_prm(SlavePCH[gdc_clock]);
- gdc_fifo_empty();
-
- /* set Master GDC scroll param */
- master_gdc_wait_vsync();
- master_gdc_wait_vsync();
- master_gdc_wait_vsync();
- master_gdc_cmd(_GDC_SCROLL);
- master_gdc_word_prm(0);
- master_gdc_word_prm((master_param[m_mode][GDC_LF] << 4) | 0x0000);
- master_gdc_fifo_empty();
-
- /* set Slave GDC scroll param */
- gdc_wait_vsync();
- gdc_cmd(_GDC_SCROLL);
- gdc_word_prm(0);
- if (gdc_clock == _5MHZ){
- gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
- }else{
- gdc_word_prm(SlaveScrlLF[mode] << 4);
- }
- gdc_fifo_empty();
-
- gdc_word_prm(0);
- if (gdc_clock == _5MHZ){
- gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
- }else{
- gdc_word_prm(SlaveScrlLF[mode] << 4);
- }
- gdc_fifo_empty();
-
- /* sync start */
- gdc_cmd(_GDC_STOP);
-
- gdc_wait_vsync();
- gdc_wait_vsync();
- gdc_wait_vsync();
-
- master_gdc_cmd(_GDC_START);
-}
-
-/* entry points */
-
-static int
-gdc_nop(void)
-{
- return 0;
-}
-
-static int
-gdc_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- probe_adapters();
- if (unit >= 1)
- return ENXIO;
-
- *adpp = &biosadapter[unit];
-
- return 0;
-}
-
-static int
-gdc_init(int unit, video_adapter_t *adp, int flags)
-{
- if ((unit >= 1) || (adp == NULL) || !probe_done(adp))
- return ENXIO;
-
- if (!init_done(adp)) {
- /* nothing to do really... */
- adp->va_flags |= V_ADP_INITIALIZED;
- }
-
- if (!config_done(adp)) {
- if (vid_register(adp) < 0)
- return ENXIO;
- adp->va_flags |= V_ADP_REGISTERED;
- }
-
- return 0;
-}
-
-/*
- * get_info():
- * Return the video_info structure of the requested video mode.
- */
-static int
-gdc_get_info(video_adapter_t *adp, int mode, video_info_t *info)
-{
- int i;
-
- if (!init_done)
- return 1;
-
- mode = map_gen_mode_num(adp->va_type, adp->va_flags & V_ADP_COLOR, mode);
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (mode == bios_vmode[i].vi_mode) {
- *info = bios_vmode[i];
- return 0;
- }
- }
- return 1;
-}
-
-/*
- * query_mode():
- * Find a video mode matching the requested parameters.
- * Fields filled with 0 are considered "don't care" fields and
- * match any modes.
- */
-static int
-gdc_query_mode(video_adapter_t *adp, video_info_t *info)
-{
- video_info_t buf;
- int i;
-
- if (!init_done)
- return -1;
-
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
-
- if ((info->vi_width != 0)
- && (info->vi_width != bios_vmode[i].vi_width))
- continue;
- if ((info->vi_height != 0)
- && (info->vi_height != bios_vmode[i].vi_height))
- continue;
- if ((info->vi_cwidth != 0)
- && (info->vi_cwidth != bios_vmode[i].vi_cwidth))
- continue;
- if ((info->vi_cheight != 0)
- && (info->vi_cheight != bios_vmode[i].vi_cheight))
- continue;
- if ((info->vi_depth != 0)
- && (info->vi_depth != bios_vmode[i].vi_depth))
- continue;
- if ((info->vi_planes != 0)
- && (info->vi_planes != bios_vmode[i].vi_planes))
- continue;
- /* XXX: should check pixel format, memory model */
- if ((info->vi_flags != 0)
- && (info->vi_flags != bios_vmode[i].vi_flags))
- continue;
-
- /* verify if this mode is supported on this adapter */
- if (gdc_get_info(adp, bios_vmode[i].vi_mode, &buf))
- continue;
- return bios_vmode[i].vi_mode;
- }
- return -1;
-}
-
-/*
- * set_mode():
- * Change the video mode.
- */
-static int
-gdc_set_mode(video_adapter_t *adp, int mode)
-{
- video_info_t info;
-
- prologue(adp, V_ADP_MODECHANGE, 1);
-
- mode = map_gen_mode_num(adp->va_type,
- adp->va_flags & V_ADP_COLOR, mode);
- if (gdc_get_info(adp, mode, &info))
- return 1;
-
-#ifdef LINE30
- switch (scp->mode) {
- case M_PC98_80x25: /* VGA TEXT MODES */
- initialize_gdc(T25_G400);
- break;
- case M_PC98_80x30:
- initialize_gdc(T30_G400);
- break;
- default:
- break;
- }
-#endif
-
- adp->va_mode = mode;
- adp->va_mode_flags = info.vi_flags;
- adp->va_flags &= ~V_ADP_COLOR;
- adp->va_flags |=
- (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
-#if 0
- adp->va_crtc_addr =
- (adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
-#endif
- adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
- adp->va_window_size = info.vi_window_size;
- adp->va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- adp->va_buffer = 0;
- adp->va_buffer_size = 0;
- } else {
- adp->va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
- adp->va_buffer_size = info.vi_buffer_size;
- }
-
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
- return 0;
-}
-
-/*
- * set_border():
- * Change the border color.
- */
-static int
-gdc_set_border(video_adapter_t *adp, int color)
-{
- outb(0x6c, color << 4);
- return 0;
-}
-
-/*
- * save_state():
- * Read video card register values.
- */
-static int
-gdc_save_state(video_adapter_t *adp, void *p, size_t size)
-{
- return 1;
-}
-
-/*
- * load_state():
- * Set video card registers at once.
- */
-static int
-gdc_load_state(video_adapter_t *adp, void *p)
-{
- return 1;
-}
-
-/*
- * read_hw_cursor():
- * Read the position of the hardware text cursor.
- */
-static int
-gdc_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
-
- s = spltty();
- master_gdc_cmd(0xe0); /* _GDC_CSRR */
- while((inb(TEXT_GDC + 0) & 0x1) == 0) {} /* GDC wait */
- off = inb(TEXT_GDC + 2); /* EADl */
- off |= (inb(TEXT_GDC + 2) << 8); /* EADh */
- inb(TEXT_GDC + 2); /* dummy */
- inb(TEXT_GDC + 2); /* dummy */
- inb(TEXT_GDC + 2); /* dummy */
- splx(s);
-
- if (off >= ROW*COL)
- off = 0;
- *row = off / info.vi_width;
- *col = off % info.vi_width;
-
- return 0;
-}
-
-/*
- * set_hw_cursor():
- * Move the hardware text cursor. If col and row are both -1,
- * the cursor won't be shown.
- */
-static int
-gdc_set_hw_cursor(video_adapter_t *adp, int col, int row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- if ((col == -1) && (row == -1)) {
- off = -1;
- } else {
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
- off = row*info.vi_width + col;
- }
-
- s = spltty();
- master_gdc_cmd(0x49); /* _GDC_CSRW */
- master_gdc_word_prm(off);
- splx(s);
-
- return 0;
-}
-
-/*
- * set_hw_cursor_shape():
- * Change the shape of the hardware text cursor. If the height is zero
- * or negative, the cursor won't be shown.
- */
-static int
-gdc_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
-{
- int start;
- int end;
- int s;
-
- start = celsize - (base + height);
- end = celsize - base - 1;
- /*
- * muPD7220 GDC has anomaly that if end == celsize - 1 then start
- * must be 0, otherwise the cursor won't be correctly shown
- * in the first row in the screen. We shall set end to celsize - 2;
- * if end == celsize -1 && start > 0. XXX
- */
- if ((end == celsize - 1) && (start > 0))
- --end;
-
- s = spltty();
- master_gdc_cmd(0x4b); /* _GDC_CSRFORM */
- master_gdc_prm(((height > 0) ? 0x80 : 0) /* cursor on/off */
- | (celsize - 1) & 0x1f); /* cel size */
- master_gdc_word_prm(((end & 0x1f) << 11) /* end line */
- | (12 << 6) /* blink rate */
- | (blink ? 0x20 : 0) /* blink on/off */
- | (start & 0x1f)); /* start line */
- splx(s);
-
- return 1;
-}
-
-static void
-dump_buffer(u_char *buf, size_t len)
-{
- int i;
-
- for(i = 0; i < len;) {
- printf("%02x ", buf[i]);
- if ((++i % 16) == 0)
- printf("\n");
- }
-}
-
-/*
- * mmap():
- * Mmap frame buffer.
- */
-static int
-gdc_mmap(video_adapter_t *adp, vm_offset_t offset)
-{
- if (offset > 0x48000 - PAGE_SIZE)
- return -1;
- return i386_btop((VIDEO_BUF_BASE + offset));
-}
-
-/*
- * diag():
- * Print some information about the video adapter and video modes,
- * with requested level of details.
- */
-static int
-gdc_diag(video_adapter_t *adp, int level)
-{
- video_info_t info;
- int i;
-
- if (!init_done)
- return 1;
-
- fb_dump_adp_info(DRIVER_NAME, adp, level);
-
-#if FB_DEBUG > 1
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
- continue;
- fb_dump_mode_info(DRIVER_NAME, adp, &bios_vmode[i], level);
- }
-#endif
-
- return 0;
-}
-
-static int
-gdc_err(video_adapter_t *adp, ...)
-{
- return 0;
-}
-
-#endif /* NGDC > 0 */
diff --git a/sys/pc98/pc98/pc98kbd.c b/sys/pc98/pc98/pc98kbd.c
deleted file mode 100644
index 668ae9d8ae43..000000000000
--- a/sys/pc98/pc98/pc98kbd.c
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- * Copyright (c) 1999 FreeBSD(98) port team.
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * 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.
- *
- * $Id: pc98kbd.c,v 1.3 1999/01/19 12:41:26 kato Exp $
- */
-
-#include "pckbd.h"
-#include "opt_kbd.h"
-#include "opt_devfs.h"
-
-#if NPCKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/fcntl.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
-#include <machine/resource.h>
-
-#include <dev/kbd/kbdreg.h>
-
-#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_machdep.h>
-
-#ifdef __i386__
-#include <i386/isa/isa_device.h>
-#endif
-
-#define DRIVER_NAME "pckbd"
-
-/* device configuration flags */
-#define KB_CONF_FAIL_IF_NO_KBD (1 << 0) /* don't install if no kbd is found */
-
-/* some macros */
-#define PC98KBD_UNIT(dev) minor(dev)
-#define PC98KBD_MKMINOR(unit) (unit)
-
-/* cdev driver declaration */
-
-typedef struct pckbd_softc {
- short flags;
-#define PC98KBD_ATTACHED (1 << 0)
- keyboard_t *kbd;
-#ifdef KBD_INSTALL_CDEV
- genkbd_softc_t gensc;
-#endif
-} pckbd_softc_t;
-
-#define PC98KBD_SOFTC(unit) pckbd_softc[(unit)]
-
-static pckbd_softc_t *pckbd_softc[NPCKBD];
-
-static int pckbdprobe(struct isa_device *dev);
-static int pckbdattach(struct isa_device *dev);
-
-static ointhand2_t pckbd_isa_intr;
-
-/* driver declaration for isa_devtab_tty[] */
-struct isa_driver pckbddriver = {
- pckbdprobe,
- pckbdattach,
- DRIVER_NAME,
- 0,
-};
-
-static int pckbd_probe_unit(int unit, pckbd_softc_t *sc,
- int port, int irq, int flags);
-static int pckbd_attach_unit(int unit, pckbd_softc_t *sc);
-static timeout_t pckbd_timeout;
-
-#ifdef KBD_INSTALL_CDEV
-
-static d_open_t pckbdopen;
-static d_close_t pckbdclose;
-static d_read_t pckbdread;
-static d_ioctl_t pckbdioctl;
-static d_poll_t pckbdpoll;
-
-static struct cdevsw pckbd_cdevsw = {
- pckbdopen, pckbdclose, pckbdread, nowrite,
- pckbdioctl, nostop, nullreset, nodevtotty,
- pckbdpoll, nommap, NULL, DRIVER_NAME,
- NULL, -1,
-};
-
-#endif /* KBD_INSTALL_CDEV */
-
-static int
-pckbdprobe(struct isa_device *dev)
-{
- pckbd_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(pckbd_softc)/sizeof(pckbd_softc[0]))
- return 0;
- sc = pckbd_softc[dev->id_unit];
- if (sc == NULL) {
- sc = pckbd_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
- bzero(sc, sizeof(*sc));
- }
-
- /* try to find a keyboard */
- error = pckbd_probe_unit(dev->id_unit, sc, dev->id_iobase,
- dev->id_irq, dev->id_flags);
- if (error)
- return 0;
-
- /* declare our interrupt handler */
- dev->id_ointr = pckbd_isa_intr;
-
- return IO_KBDSIZE;
-}
-
-static int
-pckbdattach(struct isa_device *dev)
-{
- pckbd_softc_t *sc;
-
- if (dev->id_unit >= sizeof(pckbd_softc)/sizeof(pckbd_softc[0]))
- return 0;
- sc = pckbd_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((pckbd_attach_unit(dev->id_unit, sc)) ? 0 : 1);
-}
-
-static void
-pckbd_isa_intr(int unit)
-{
- keyboard_t *kbd;
-
- kbd = pckbd_softc[unit]->kbd;
- (*kbdsw[kbd->kb_index]->intr)(kbd);
-}
-
-static int
-pckbd_probe_unit(int unit, pckbd_softc_t *sc, int port, int irq, int flags)
-{
- keyboard_switch_t *sw;
- int args[2];
-
- if (sc->flags & PC98KBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- args[0] = port;
- args[1] = irq;
- return (*sw->probe)(unit, &sc->kbd, args, flags);
-}
-
-static int
-pckbd_attach_unit(int unit, pckbd_softc_t *sc)
-{
- keyboard_switch_t *sw;
- int error;
-
- if (sc->flags & PC98KBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- /* reset, initialize and enable the device */
- error = (*sw->init)(sc->kbd);
- if (error)
- return ENXIO;
- (*sw->enable)(sc->kbd);
-
-#ifdef KBD_INSTALL_CDEV
- /* attach a virtual keyboard cdev */
- error = kbd_attach(makedev(0, PC98KBD_MKMINOR(unit)), sc->kbd,
- &pckbd_cdevsw);
- if (error)
- return error;
-#endif /* KBD_INSTALL_CDEV */
-
- /*
- * This is a kludge to compensate for lost keyboard interrupts.
- * A similar code used to be in syscons. See below. XXX
- */
- pckbd_timeout(sc->kbd);
-
- if (bootverbose)
- (*sw->diag)(sc->kbd, bootverbose);
-
- sc->flags |= PC98KBD_ATTACHED;
- return 0;
-}
-
-static void
-pckbd_timeout(void *arg)
-{
- keyboard_t *kbd;
- int s;
-
- /* The following comments are extracted from syscons.c (1.287) */
- /*
- * With release 2.1 of the Xaccel server, the keyboard is left
- * hanging pretty often. Apparently an interrupt from the
- * keyboard is lost, and I don't know why (yet).
- * This ugly hack calls scintr if input is ready for the keyboard
- * and conveniently hides the problem. XXX
- */
- /*
- * Try removing anything stuck in the keyboard controller; whether
- * it's a keyboard scan code or mouse data. `scintr()' doesn't
- * read the mouse data directly, but `kbdio' routines will, as a
- * side effect.
- */
- s = spltty();
- kbd = (keyboard_t *)arg;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
- /*
- * We have seen the lock flag is not set. Let's reset
- * the flag early, otherwise the LED update routine fails
- * which may want the lock during the interrupt routine.
- */
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check_char)(kbd))
- (*kbdsw[kbd->kb_index]->intr)(kbd);
- }
- splx(s);
- timeout(pckbd_timeout, arg, hz/10);
-}
-
-/* cdev driver functions */
-
-#ifdef KBD_INSTALL_CDEV
-
-static int
-pckbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- pckbd_softc_t *sc;
- int unit;
-
- unit = PC98KBD_UNIT(dev);
- if ((unit >= NPCKBD) || ((sc = PC98KBD_SOFTC(unit)) == NULL))
- return ENXIO;
- if (mode & (FWRITE | O_CREAT | O_APPEND | O_TRUNC))
- return ENODEV;
-
- /* FIXME: set the initial input mode (K_XLATE?) and lock state? */
- return genkbdopen(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-pckbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdclose(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-pckbdread(dev_t dev, struct uio *uio, int flag)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdread(&sc->gensc, sc->kbd, uio, flag);
-}
-
-static int
-pckbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdioctl(&sc->gensc, sc->kbd, cmd, arg, flag, p);
-}
-
-static int
-pckbdpoll(dev_t dev, int event, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdpoll(&sc->gensc, sc->kbd, event, p);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* LOW-LEVEL */
-
-#include <machine/limits.h>
-#include <machine/console.h>
-#include <machine/clock.h>
-
-#define PC98KBD_DEFAULT 0
-
-typedef caddr_t KBDC;
-
-typedef struct pckbd_state {
- KBDC kbdc; /* keyboard controller */
- int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
- int ks_flags; /* flags */
-#define COMPOSE (1 << 0)
- int ks_state; /* shift/lock key state */
- int ks_accents; /* accent key index (> 0) */
- u_int ks_composed_char; /* composed char code (> 0) */
-} pckbd_state_t;
-
-/* keyboard driver declaration */
-static int pckbd_configure(int flags);
-static kbd_probe_t pckbd_probe;
-static kbd_init_t pckbd_init;
-static kbd_term_t pckbd_term;
-static kbd_intr_t pckbd_intr;
-static kbd_test_if_t pckbd_test_if;
-static kbd_enable_t pckbd_enable;
-static kbd_disable_t pckbd_disable;
-static kbd_read_t pckbd_read;
-static kbd_check_t pckbd_check;
-static kbd_read_char_t pckbd_read_char;
-static kbd_check_char_t pckbd_check_char;
-static kbd_ioctl_t pckbd_ioctl;
-static kbd_lock_t pckbd_lock;
-static kbd_clear_state_t pckbd_clear_state;
-static kbd_get_state_t pckbd_get_state;
-static kbd_set_state_t pckbd_set_state;
-
-keyboard_switch_t pckbdsw = {
- pckbd_probe,
- pckbd_init,
- pckbd_term,
- pckbd_intr,
- pckbd_test_if,
- pckbd_enable,
- pckbd_disable,
- pckbd_read,
- pckbd_check,
- pckbd_read_char,
- pckbd_check_char,
- pckbd_ioctl,
- pckbd_lock,
- pckbd_clear_state,
- pckbd_get_state,
- pckbd_set_state,
- genkbd_get_fkeystr,
- genkbd_diag,
-};
-
-KEYBOARD_DRIVER(pckbd, pckbdsw, pckbd_configure);
-
-struct kbdc_softc {
- int port; /* base port address */
- int lock; /* FIXME: XXX not quite a semaphore... */
-};
-
-/* local functions */
-static int probe_keyboard(KBDC kbdc, int flags);
-static int init_keyboard(KBDC kbdc, int *type, int flags);
-static KBDC kbdc_open(int port);
-static int kbdc_lock(KBDC kbdc, int lock);
-static int kbdc_data_ready(KBDC kbdc);
-static int read_kbd_data(KBDC kbdc);
-static int read_kbd_data_no_wait(KBDC kbdc);
-static int wait_for_kbd_data(struct kbdc_softc *kbdc);
-
-/* local variables */
-
-/* the initial key map, accent map and fkey strings */
-#include <dev/kbd/kbdtables.h>
-
-/* structures for the default keyboard */
-static keyboard_t default_kbd;
-static pckbd_state_t default_kbd_state;
-static keymap_t default_keymap;
-static accentmap_t default_accentmap;
-static fkeytab_t default_fkeytab[NUM_FKEYS];
-
-/*
- * The back door to the keyboard driver!
- * This function is called by the console driver, via the kbdio module,
- * to tickle keyboard drivers when the low-level console is being initialized.
- * Almost nothing in the kernel has been initialied yet. Try to probe
- * keyboards if possible.
- * NOTE: because of the way the low-level conole is initialized, this routine
- * may be called more than once!!
- */
-static int
-pckbd_configure(int flags)
-{
- keyboard_t *kbd;
- KBDC kbdc;
- int arg[2];
- struct isa_device *dev;
-
- /* XXX: a kludge to obtain the device configuration flags */
- dev = find_isadev(isa_devtab_tty, &pckbddriver, 0);
- if (dev != NULL)
- flags |= dev->id_flags;
-
- /* probe the default keyboard */
- arg[0] = -1;
- arg[1] = -1;
- if (pckbd_probe(PC98KBD_DEFAULT, &kbd, arg, flags))
- return 0;
-
- /* initialize it */
- kbdc = ((pckbd_state_t *)kbd->kb_data)->kbdc;
- if (!(flags & KB_CONF_PROBE_ONLY) && !KBD_IS_PROBED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, flags)
- && (flags & KB_CONF_FAIL_IF_NO_KBD))
- return 0;
- KBD_INIT_DONE(kbd);
- }
-
- /* and register */
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return 0;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 1; /* return the number of found keyboards */
-}
-
-/* low-level functions */
-
-/* initialize the keyboard_t structure and try to detect a keyboard */
-static int
-pckbd_probe(int unit, keyboard_t **kbdp, void *arg, int flags)
-{
- keyboard_t *kbd;
- pckbd_state_t *state;
- keymap_t *keymap;
- accentmap_t *accmap;
- fkeytab_t *fkeymap;
- int fkeymap_size;
- KBDC kbdc;
- int *data = (int *)arg;
-
- if (unit != PC98KBD_DEFAULT)
- return ENXIO;
-
- *kbdp = kbd = &default_kbd;
- if (KBD_IS_PROBED(kbd))
- return 0;
- state = &default_kbd_state;
- keymap = &default_keymap;
- accmap = &default_accentmap;
- fkeymap = default_fkeytab;
- fkeymap_size = sizeof(default_fkeytab)/sizeof(default_fkeytab[0]);
-
- state->kbdc = kbdc = kbdc_open(data[0]);
- if (kbdc == NULL)
- return ENXIO;
- kbd_init_struct(kbd, DRIVER_NAME, KB_OTHER, unit, flags, data[0],
- IO_KBDSIZE);
- bcopy(&key_map, keymap, sizeof(key_map));
- bcopy(&accent_map, accmap, sizeof(accent_map));
- bcopy(fkey_tab, fkeymap,
- imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab)));
- kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
- kbd->kb_data = (void *)state;
-
- if (probe_keyboard(kbdc, flags)) {
- if (flags & KB_CONF_FAIL_IF_NO_KBD)
- return ENXIO;
- } else {
- KBD_FOUND_DEVICE(kbd);
- }
- pckbd_clear_state(kbd);
- state->ks_mode = K_XLATE;
-
- KBD_PROBE_DONE(kbd);
- return 0;
-}
-
-/* reset and initialize the device */
-static int
-pckbd_init(keyboard_t *kbd)
-{
- KBDC kbdc;
-
- if ((kbd == NULL) || !KBD_IS_PROBED(kbd))
- return ENXIO; /* shouldn't happen */
- kbdc = ((pckbd_state_t *)kbd->kb_data)->kbdc;
- if (kbdc == NULL)
- return ENXIO; /* shouldn't happen */
-
- if (!KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, kbd->kb_config)
- && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD))
- return ENXIO;
- pckbd_ioctl(kbd, KDSETLED,
- (caddr_t)&((pckbd_state_t *)(kbd->kb_data))->ks_state);
- KBD_INIT_DONE(kbd);
- }
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return ENXIO;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 0;
-}
-
-/* finish using this keyboard */
-static int
-pckbd_term(keyboard_t *kbd)
-{
- kbd_unregister(kbd);
- return 0;
-}
-
-/* keyboard interrupt routine */
-static int
-pckbd_intr(keyboard_t *kbd)
-{
- int c;
-
- if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
- /* let the callback function to process the input */
- (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
- kbd->kb_callback.kc_arg);
- } else {
- /* read and discard the input; no one is waiting for input */
- do {
- c = pckbd_read_char(kbd, FALSE);
- } while (c != NOKEY);
- }
- return 0;
-}
-
-/* test the interface to the device */
-static int
-pckbd_test_if(keyboard_t *kbd)
-{
- return 0;
-}
-
-/*
- * Enable the access to the device; until this function is called,
- * the client cannot read from the keyboard.
- */
-static int
-pckbd_enable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_ACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* disallow the access to the device */
-static int
-pckbd_disable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_DEACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* read one byte from the keyboard if it's allowed */
-static int
-pckbd_read(keyboard_t *kbd, int wait)
-{
- int c;
-
- if (wait)
- c = read_kbd_data(((pckbd_state_t *)kbd->kb_data)->kbdc);
- else
- c = read_kbd_data_no_wait(((pckbd_state_t *)kbd->kb_data)->kbdc);
- return (KBD_IS_ACTIVE(kbd) ? c : -1);
-}
-
-/* check if data is waiting */
-static int
-pckbd_check(keyboard_t *kbd)
-{
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- return kbdc_data_ready(((pckbd_state_t *)kbd->kb_data)->kbdc);
-}
-
-/* read char from the keyboard */
-static u_int
-pckbd_read_char(keyboard_t *kbd, int wait)
-{
- pckbd_state_t *state;
- u_int action;
- int scancode;
- int keycode;
-
- state = (pckbd_state_t *)kbd->kb_data;
-next_code:
- /* do we have a composed char to return? */
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) {
- action = state->ks_composed_char;
- state->ks_composed_char = 0;
- if (action > UCHAR_MAX)
- return ERRKEY;
- return action;
- }
-
- /* see if there is something in the keyboard port */
- if (wait) {
- do {
- scancode = read_kbd_data(state->kbdc);
- } while (scancode == -1);
- } else {
- scancode = read_kbd_data_no_wait(state->kbdc);
- if (scancode == -1)
- return NOKEY;
- }
-
- /* return the byte as is for the K_RAW mode */
- if (state->ks_mode == K_RAW)
- return scancode;
-
- /* translate the scan code into a keycode */
- keycode = scancode & 0x7F;
- switch(scancode) {
- case 0xF3: /* GRPH (compose key) released */
- if (state->ks_flags & COMPOSE) {
- state->ks_flags &= ~COMPOSE;
- if (state->ks_composed_char > UCHAR_MAX)
- state->ks_composed_char = 0;
- }
- break;
- case 0x73: /* GRPH (compose key) pressed */
- if (!(state->ks_flags & COMPOSE)) {
- state->ks_flags |= COMPOSE;
- state->ks_composed_char = 0;
- }
- break;
- }
-
- /* return the key code in the K_CODE mode */
- if (state->ks_mode == K_CODE)
- return (keycode | (scancode & 0x80));
-
- /* compose a character code */
- if (state->ks_flags & COMPOSE) {
- switch (scancode) {
- /* key pressed, process it */
- case 0x42: case 0x43: case 0x44: /* keypad 7,8,9 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x3B;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x46: case 0x47: case 0x48: /* keypad 4,5,6 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x42;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4A: case 0x4B: case 0x4C: /* keypad 1,2,3 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x49;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4E: /* keypad 0 */
- state->ks_composed_char *= 10;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
-
- /* key released, no interest here */
- case 0xC2: case 0xC3: case 0xC4: /* keypad 7,8,9 */
- case 0xC6: case 0xC7: case 0xC8: /* keypad 4,5,6 */
- case 0xCA: case 0xCB: case 0xCC: /* keypad 1,2,3 */
- case 0xCE: /* keypad 0 */
- goto next_code;
-
- case 0x73: /* GRPH key */
- break;
-
- default:
- if (state->ks_composed_char > 0) {
- state->ks_flags &= ~COMPOSE;
- state->ks_composed_char = 0;
- return ERRKEY;
- }
- break;
- }
- }
-
- /* keycode to key action */
- action = genkbd_keyaction(kbd, keycode, scancode & 0x80,
- &state->ks_state, &state->ks_accents);
- if (action == NOKEY)
- goto next_code;
- else
- return action;
-}
-
-/* check if char is waiting */
-static int
-pckbd_check_char(keyboard_t *kbd)
-{
- pckbd_state_t *state;
-
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- state = (pckbd_state_t *)kbd->kb_data;
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
- return TRUE;
- return kbdc_data_ready(state->kbdc);
-}
-
-/* some useful control functions */
-static int
-pckbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- pckbd_state_t *state = kbd->kb_data;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBMODE: /* get keyboard mode */
- *(int *)arg = state->ks_mode;
- break;
- case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)arg) {
- case K_XLATE:
- if (state->ks_mode != K_XLATE) {
- /* make lock key state and LED state match */
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= KBD_LED_VAL(kbd);
- }
- /* FALL THROUGH */
- case K_RAW:
- case K_CODE:
- if (state->ks_mode != *(int *)arg) {
- pckbd_clear_state(kbd);
- state->ks_mode = *(int *)arg;
- }
- break;
- default:
- splx(s);
- return EINVAL;
- }
- break;
-
- case KDGETLED: /* get keyboard LED */
- *(int *)arg = KBD_LED_VAL(kbd);
- break;
- case KDSETLED: /* set keyboard LED */
- /* NOTE: lock key state in ks_state won't be changed */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- i = *(int *)arg;
- /* replace CAPS LED with ALTGR LED for ALTGR keyboards */
- if (kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
- if (i & ALKED)
- i |= CLKED;
- else
- i &= ~CLKED;
- }
- KBD_LED_VAL(kbd) = *(int *)arg;
- break;
-
- case KDGKBSTATE: /* get lock key state */
- *(int *)arg = state->ks_state & LOCK_MASK;
- break;
- case KDSKBSTATE: /* set lock key state */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= *(int *)arg;
- splx(s);
- /* set LEDs and quit */
- return pckbd_ioctl(kbd, KDSETLED, arg);
-
- case KDSETRAD: /* set keyboard repeat rate */
- break;
-
- case PIO_KEYMAP: /* set keyboard translation table */
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- state->ks_accents = 0;
- /* FALL THROUGH */
- default:
- splx(s);
- return genkbd_commonioctl(kbd, cmd, arg);
- }
-
- splx(s);
- return 0;
-}
-
-/* lock the access to the keyboard */
-static int
-pckbd_lock(keyboard_t *kbd, int lock)
-{
- return kbdc_lock(((pckbd_state_t *)kbd->kb_data)->kbdc, lock);
-}
-
-/* clear the internal state of the keyboard */
-static void
-pckbd_clear_state(keyboard_t *kbd)
-{
- pckbd_state_t *state;
-
- state = (pckbd_state_t *)kbd->kb_data;
- state->ks_flags = 0;
- state->ks_state &= LOCK_MASK; /* preserve locking key state */
- state->ks_accents = 0;
- state->ks_composed_char = 0;
-}
-
-/* save the internal state */
-static int
-pckbd_get_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len == 0)
- return sizeof(pckbd_state_t);
- if (len < sizeof(pckbd_state_t))
- return -1;
- bcopy(kbd->kb_data, buf, sizeof(pckbd_state_t));
- return 0;
-}
-
-/* set the internal state */
-static int
-pckbd_set_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len < sizeof(pckbd_state_t))
- return ENOMEM;
- if (((pckbd_state_t *)kbd->kb_data)->kbdc
- != ((pckbd_state_t *)buf)->kbdc)
- return ENOMEM;
- bcopy(buf, kbd->kb_data, sizeof(pckbd_state_t));
- return 0;
-}
-
-/* local functions */
-
-static int
-probe_keyboard(KBDC kbdc, int flags)
-{
- return 0;
-}
-
-static int
-init_keyboard(KBDC kbdc, int *type, int flags)
-{
- *type = KB_OTHER;
- return 0;
-}
-
-/* keyboard I/O routines */
-
-/* retry count */
-#ifndef KBD_MAXRETRY
-#define KBD_MAXRETRY 3
-#endif
-
-/* timing parameters */
-#ifndef KBD_RESETDELAY
-#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
-#endif
-#ifndef KBD_MAXWAIT
-#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
-#endif
-
-/* I/O recovery time */
-#define KBDC_DELAYTIME 37
-#define KBDD_DELAYTIME 37
-
-/* I/O ports */
-#define KBD_STATUS_PORT 2 /* status port, read */
-#define KBD_DATA_PORT 0 /* data port, read */
-
-/* status bits (KBD_STATUS_PORT) */
-#define KBDS_BUFFER_FULL 0x0002
-
-/* macros */
-
-#define kbdcp(p) ((struct kbdc_softc *)(p))
-
-/* local variables */
-
-static struct kbdc_softc kbdc_softc[NPCKBD] = { { 0 }, };
-
-/* associate a port number with a KBDC */
-
-static KBDC
-kbdc_open(int port)
-{
- if (port <= 0)
- port = IO_KBD;
-
- if (NPCKBD) {
- /* PC-98 has only one keyboard I/F */
- kbdc_softc[0].port = port;
- kbdc_softc[0].lock = FALSE;
- return (KBDC)&kbdc_softc[0];
- }
- return NULL; /* You didn't include sc driver in your config file */
-}
-
-/* set/reset polling lock */
-static int
-kbdc_lock(KBDC p, int lock)
-{
- int prevlock;
-
- prevlock = kbdcp(p)->lock;
- kbdcp(p)->lock = lock;
-
- return (prevlock != lock);
-}
-
-/* check if any data is waiting to be processed */
-static int
-kbdc_data_ready(KBDC p)
-{
- return (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL);
-}
-
-/* wait for data from the keyboard */
-static int
-wait_for_kbd_data(struct kbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
-
- while (!(inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)) {
- DELAY(KBDD_DELAYTIME);
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return 0;
- }
- DELAY(KBDD_DELAYTIME);
- return 1;
-}
-
-/* read one byte from the keyboard */
-static int
-read_kbd_data(KBDC p)
-{
- if (!wait_for_kbd_data(kbdcp(p)))
- return -1; /* timeout */
- DELAY(KBDC_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
-}
-
-/* read one byte from the keyboard, but return immediately if
- * no data is waiting
- */
-static int
-read_kbd_data_no_wait(KBDC p)
-{
- if (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
- }
- return -1; /* no data */
-}
-
-#endif /* NPCKBD > 0 */
diff --git a/sys/pc98/pc98/pcaudio.c b/sys/pc98/pc98/pcaudio.c
index 05ba0161b6aa..abffc8c418ef 100644
--- a/sys/pc98/pc98/pcaudio.c
+++ b/sys/pc98/pc98/pcaudio.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcaudio.c,v 1.19 1998/12/14 08:58:56 kato Exp $
+ * $Id: pcaudio.c,v 1.43 1998/09/15 18:16:37 sos Exp $
*/
#include "pca.h"
@@ -52,6 +52,11 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#define DSP_ULAW_NOT_WANTED
+#include <i386/isa/sound/ulaw.h>
+#define LINEAR_ALAW_NOT_WANTED
+#include <i386/isa/sound/alaw.h>
+
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -84,44 +89,6 @@ static char buffer2[BUF_SIZE];
static char buffer3[BUF_SIZE];
static char volume_table[256];
-#define DSP_ULAW_NOT_WANTED
-#include <i386/isa/snd/ulaw.h>
-
-static unsigned char alaw_linear[] = {
- 45, 214, 122, 133, 0, 255, 107, 149,
- 86, 171, 126, 129, 0, 255, 117, 138,
- 13, 246, 120, 135, 0, 255, 99, 157,
- 70, 187, 124, 131, 0, 255, 113, 142,
- 61, 198, 123, 132, 0, 255, 111, 145,
- 94, 163, 127, 128, 0, 255, 119, 136,
- 29, 230, 121, 134, 0, 255, 103, 153,
- 78, 179, 125, 130, 0, 255, 115, 140,
- 37, 222, 122, 133, 0, 255, 105, 151,
- 82, 175, 126, 129, 0, 255, 116, 139,
- 5, 254, 120, 135, 0, 255, 97, 159,
- 66, 191, 124, 131, 0, 255, 112, 143,
- 53, 206, 123, 132, 0, 255, 109, 147,
- 90, 167, 127, 128, 0, 255, 118, 137,
- 21, 238, 121, 134, 0, 255, 101, 155,
- 74, 183, 125, 130, 0, 255, 114, 141,
- 49, 210, 123, 133, 0, 255, 108, 148,
- 88, 169, 127, 129, 0, 255, 118, 138,
- 17, 242, 121, 135, 0, 255, 100, 156,
- 72, 185, 125, 131, 0, 255, 114, 142,
- 64, 194, 124, 132, 0, 255, 112, 144,
- 96, 161, 128, 128, 1, 255, 120, 136,
- 33, 226, 122, 134, 0, 255, 104, 152,
- 80, 177, 126, 130, 0, 255, 116, 140,
- 41, 218, 122, 133, 0, 255, 106, 150,
- 84, 173, 126, 129, 0, 255, 117, 139,
- 9, 250, 120, 135, 0, 255, 98, 158,
- 68, 189, 124, 131, 0, 255, 113, 143,
- 57, 202, 123, 132, 0, 255, 110, 146,
- 92, 165, 127, 128, 0, 255, 119, 137,
- 25, 234, 121, 134, 0, 255, 102, 154,
- 76, 181, 125, 130, 0, 255, 115, 141,
-};
-
#ifdef DEVFS
static void *pca_devfs_token;
static void *pcac_devfs_token;
@@ -198,7 +165,7 @@ pca_init(void)
pca_status.buf[1] = (unsigned char *)&buffer2[0];
pca_status.buf[2] = (unsigned char *)&buffer3[0];
pca_status.buffer = pca_status.buf[0];
- pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0;
+ pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[3] = 0;
pca_status.current = 0;
pca_status.sample_rate = SAMPLE_RATE;
pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE;
@@ -602,4 +569,5 @@ static void pca_drvinit(void *unused)
SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
+
#endif
diff --git a/sys/pc98/pc98/scvidctl.c b/sys/pc98/pc98/scvidctl.c
deleted file mode 100644
index 77eba9811ce8..000000000000
--- a/sys/pc98/pc98/scvidctl.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/*-
- * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * 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 as
- * the first lines of this file unmodified.
- * 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.
- *
- * $Id: scvidctl.c,v 1.1 1998/12/16 14:57:37 kato Exp $
- */
-
-#include "sc.h"
-#include "opt_syscons.h"
-
-#if NSC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-
-#include <machine/apm_bios.h>
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-
-#include <pc98/pc98/syscons.h>
-
-/* for compatibility with previous versions */
-typedef struct old_video_adapter {
- int va_index;
- int va_type;
- int va_flags;
-#define V_ADP_COLOR (1<<0)
-#define V_ADP_MODECHANGE (1<<1)
-#define V_ADP_STATESAVE (1<<2)
-#define V_ADP_STATELOAD (1<<3)
-#define V_ADP_FONT (1<<4)
-#define V_ADP_PALETTE (1<<5)
-#define V_ADP_BORDER (1<<6)
-#define V_ADP_VESA (1<<7)
- int va_crtc_addr;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
-} old_video_adapter_t;
-
-#define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
-
-/* variables */
-extern scr_stat *cur_console;
-extern int fonts_loaded;
-extern int sc_history_size;
-extern u_char palette[];
-
-int
-sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* adjust argument values */
- if (fontsize <= 0)
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if ((xsize <= 0) || (xsize > info.vi_width))
- xsize = info.vi_width;
- if ((ysize <= 0) || (ysize > info.vi_height))
- ysize = info.vi_height;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- /*
- * This is a kludge to fend off scrn_update() while we
- * muck around with scp. XXX
- */
- scp->status |= UNKNOWN_MODE;
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->mode = mode;
- scp->font_size = fontsize;
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*fontsize;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
-{
- video_info_t info;
- int error;
- int s;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE);
- scp->status &= ~PIXEL_MODE;
- scp->mode = mode;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- /* clear_graphics();*/
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_xpixel != scp->xpixel
- || tp->t_winsize.ws_ypixel != scp->ypixel) {
- tp->t_winsize.ws_xpixel = scp->xpixel;
- tp->t_winsize.ws_ypixel = scp->ypixel;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return ENODEV; /* this shouldn't happen */
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- }
-#endif
-
- /* adjust argument values */
- if ((fontsize <= 0) || (fontsize == FONT_NONE))
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if (xsize <= 0)
- xsize = info.vi_width/8;
- if (ysize <= 0)
- ysize = info.vi_height/fontsize;
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- printf("set_pixel_mode(): window:%x, %dx%d, xoff:%d, yoff:%d\n",
- scp->adp->va_window, info.vi_width, info.vi_height,
- (info.vi_width/8 - xsize)/2,
- (info.vi_height/fontsize - ysize)/2);
- }
-#endif
-
- if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
- return EINVAL;
-
- /* only 16 color, 4 plane modes are supported XXX */
- if ((info.vi_depth != 4) || (info.vi_planes != 4))
- return ENODEV;
-
- /*
- * set_pixel_mode() currently does not support video modes whose
- * memory size is larger than 64K. Because such modes require
- * bank switching to access the entire screen. XXX
- */
- if (info.vi_width*info.vi_height/8 > info.vi_window_size)
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | MOUSE_ENABLED);
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->font_size = fontsize;
- scp->xoff = (scp->xpixel/8 - xsize)/2;
- scp->yoff = (scp->ypixel/fontsize - ysize)/2;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_border(scp, scp->border);
-
- scp->status &= ~UNKNOWN_MODE;
-
-#ifdef SC_VIDEO_DEBUG
- printf("set_pixel_mode(): status:%x\n", scp->status);
-#endif
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- scr_stat *scp;
- int error;
- int s;
-
- scp = sc_get_scr_stat(tp->t_dev);
-
- switch (cmd) {
-
- case CONS_CURRENT: /* get current adapter type */
- if (scp->adp == NULL)
- return ENODEV;
- *(int *)data = scp->adp->va_type;
- return 0;
-
- case CONS_CURRENTADP: /* get current adapter index */
- *(int *)data = scp->ad;
- return 0;
-
- case OLD_CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((old_video_adapter_t *)data)->va_index = scp->adp->va_index;
- ((old_video_adapter_t *)data)->va_type = scp->adp->va_type;
- ((old_video_adapter_t *)data)->va_flags = scp->adp->va_flags;
- ((old_video_adapter_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((old_video_adapter_t *)data)->va_window = scp->adp->va_window;
- ((old_video_adapter_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((old_video_adapter_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((old_video_adapter_t *)data)->va_buffer = scp->adp->va_buffer;
- ((old_video_adapter_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((old_video_adapter_t *)data)->va_mode = scp->adp->va_mode;
- ((old_video_adapter_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((old_video_adapter_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((video_adapter_info_t *)data)->va_index = scp->adp->va_index;
- ((video_adapter_info_t *)data)->va_type = scp->adp->va_type;
- bcopy(scp->adp->va_name, ((video_adapter_info_t *)data)->va_name,
- imin(strlen(scp->adp->va_name) + 1,
- sizeof(((video_adapter_info_t *)data)->va_name)));
- ((video_adapter_info_t *)data)->va_unit = scp->adp->va_unit;
- ((video_adapter_info_t *)data)->va_flags = scp->adp->va_flags;
- ((video_adapter_info_t *)data)->va_io_base = scp->adp->va_io_base;
- ((video_adapter_info_t *)data)->va_io_size = scp->adp->va_io_size;
- ((video_adapter_info_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((video_adapter_info_t *)data)->va_mem_base = scp->adp->va_mem_base;
- ((video_adapter_info_t *)data)->va_mem_size = scp->adp->va_mem_size;
- ((video_adapter_info_t *)data)->va_window = scp->adp->va_window;
- ((video_adapter_info_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((video_adapter_info_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((video_adapter_info_t *)data)->va_buffer = scp->adp->va_buffer;
- ((video_adapter_info_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((video_adapter_info_t *)data)->va_mode = scp->adp->va_mode;
- ((video_adapter_info_t *)data)->va_mode_flags = scp->adp->va_mode_flags;
- ((video_adapter_info_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((video_adapter_info_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_GET: /* get current video mode */
- *(int *)data = scp->mode;
- return 0;
-
- case CONS_MODEINFO: /* get mode information */
- return ((*vidsw[scp->ad]->get_info)(scp->adp,
- ((video_info_t *)data)->vi_mode, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_FINDMODE: /* find a matching video mode */
- return ((*vidsw[scp->ad]->query_mode)(scp->adp, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_SETWINORG:
- return ((*vidsw[scp->ad]->set_win_org)(scp->adp, *(u_int *)data)
- ? ENODEV : 0);
-
- /* generic text modes */
- case SW_TEXT_80x25: case SW_TEXT_80x30:
- case SW_TEXT_80x43: case SW_TEXT_80x50:
- case SW_TEXT_80x60:
- /* FALL THROUGH */
-
- /* VGA TEXT MODES */
- case SW_VGA_C40x25:
- case SW_VGA_C80x25: case SW_VGA_M80x25:
- case SW_VGA_C80x30: case SW_VGA_M80x30:
- case SW_VGA_C80x50: case SW_VGA_M80x50:
- case SW_VGA_C80x60: case SW_VGA_M80x60:
- case SW_B40x25: case SW_C40x25:
- case SW_B80x25: case SW_C80x25:
- case SW_ENH_B40x25: case SW_ENH_C40x25:
- case SW_ENH_B80x25: case SW_ENH_C80x25:
- case SW_ENH_B80x43: case SW_ENH_C80x43:
- case SW_EGAMONO80x25:
-
-#ifdef PC98
- /* PC98 TEXT MODES */
- case SW_PC98_80x25:
- case SW_PC98_80x30:
-#endif
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
-
- /* GRAPHICS MODES */
- case SW_BG320: case SW_BG640:
- case SW_CG320: case SW_CG320_D: case SW_CG640_E:
- case SW_CG640x350: case SW_ENH_CG640:
- case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
- case SW_VGA_MODEX:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_graphics_mode(scp, tp, cmd & 0xff);
-
- case KDSETMODE: /* set current mode of this (virtual) console */
- switch (*(int *)data) {
- case KD_TEXT: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- /* restore fonts & palette ! */
-#if 0
- if (ISFONTAVAIL(scp->adp->va_flags)
- && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- /*
- * FONT KLUDGE
- * Don't load fonts for now... XXX
- */
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- }
-#endif
- load_palette(scp->adp, palette);
-
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-
- /* FALL THROUGH */
-
- case KD_TEXT1: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text/pixel mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-#ifndef PC98
- scp->status |= UNKNOWN_MODE;
- splx(s);
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
-#else /* PC98 */
- scp->status &= ~UNKNOWN_MODE;
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- splx(s);
-#endif /* PC98 */
- return 0;
-
- case KD_PIXEL: /* pixel (raster) display */
- if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return EINVAL;
- if (scp->status & GRAPHICS_MODE)
- return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
- scp->font_size);
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- splx(s);
- if (scp == cur_console) {
- set_mode(scp);
- load_palette(scp->adp, palette);
- }
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
- return 0;
-
- case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= UNKNOWN_MODE;
- splx(s);
-#ifdef PC98
- if (scp == cur_console)
- set_mode(scp);
-#endif
- return 0;
-
- default:
- return EINVAL;
- }
- /* NOT REACHED */
-
- case KDRASTER: /* set pixel (raster) display mode */
- if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
- return ENODEV;
- return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
- ((int *)data)[2]);
-
- case KDGETMODE: /* get current mode of this (virtual) console */
- /*
- * From the user program's point of view, KD_PIXEL is the same
- * as KD_TEXT...
- */
- *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
- return 0;
-
- case KDSBORDER: /* set border color of this (virtual) console */
- scp->border = *data;
- if (scp == cur_console)
- set_border(scp, scp->border);
- return 0;
- }
-
- return ENOIOCTL;
-}
-
-#endif /* NSC > 0 */
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 97ac3ad3b384..abce135c8193 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.75 1999/01/16 11:42:16 kato Exp $
+ * $Id: sio.c,v 1.66 1998/08/28 12:44:49 kato Exp $
*/
#include "opt_comconsole.h"
@@ -74,9 +74,9 @@
*
* 1) config
* options COM_MULTIPORT #if using MC16550II
- * device sio0 at nec? port 0x30 tty irq 4 #internal
- * device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 #mc1
- * device sio2 at nec? port 0x8d2 tty flags 0x101 #mc2
+ * device sio0 at nec? port 0x30 tty irq 4 vector siointr #internal
+ * device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 vector siointr #mc1
+ * device sio2 at nec? port 0x8d2 tty flags 0x101 vector siointr #mc2
* # ~~~~~iobase ~~multi port flag
* # ~ master device is sio1
* 2) device
@@ -103,36 +103,21 @@
* # options COM_MULTIPORT # support for MICROCORE MC16550II
* ... comment-out this line, which will conflict with B98_01.
* options "B98_01" # support for AIWA B98-01
- * device sio1 at nec? port 0x00d1 tty irq ?
- * device sio2 at nec? port 0x00d5 tty irq ?
+ * device sio1 at nec? port 0x00d1 tty irq ? vector siointr
+ * device sio2 at nec? port 0x00d5 tty irq ? vector siointr
* ... you can leave these lines `irq ?', irq will be autodetected.
*/
-/*
- * Modified by Y.Takahashi of Kogakuin University.
- */
-
#ifdef PC98
-#define COM_IF_INTERNAL 0x00
-#define COM_IF_PC9861K_1 0x01
-#define COM_IF_PC9861K_2 0x02
-#define COM_IF_IND_SS_1 0x03
-#define COM_IF_IND_SS_2 0x04
-#define COM_IF_PIO9032B_1 0x05
-#define COM_IF_PIO9032B_2 0x06
-#define COM_IF_B98_01_1 0x07
-#define COM_IF_B98_01_2 0x08
-#define COM_IF_END1 COM_IF_B98_01_2
-#define COM_IF_RSA98 0x10 /* same as COM_IF_NS16550 */
-#define COM_IF_NS16550 0x11
-#define COM_IF_SECOND_CCU 0x12 /* same as COM_IF_NS16550 */
-#define COM_IF_MC16550II 0x13
-#define COM_IF_MCRS98 0x14 /* same as COM_IF_MC16550II */
-#define COM_IF_RSB3000 0x15
-#define COM_IF_RSB384 0x16
-#define COM_IF_MODEM_CARD 0x17 /* same as COM_IF_NS16550 */
-#define COM_IF_RSA98III 0x18
-#define COM_IF_ESP98 0x19
-#define COM_IF_END2 COM_IF_ESP98
+#define MC16550 0
+#define COM_IF_INTERNAL 1
+#if 0
+#define COM_IF_PC9861K 2
+#define COM_IF_PIO9032B 3
+#endif
+#ifdef B98_01
+#undef COM_MULTIPORT /* COM_MULTIPORT will conflict with B98_01 */
+#define COM_IF_B98_01 4
+#endif /* B98_01 */
#endif /* PC98 */
#include <sys/param.h>
@@ -154,33 +139,28 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#ifdef PC98
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/pc98_machdep.h>
#include <i386/isa/icu.h>
+#include <i386/isa/isa_device.h>
+#include <pc98/pc98/sioreg.h>
#include <i386/isa/ic/i8251.h>
#else
#include <i386/isa/isa.h>
-#endif
#include <i386/isa/isa_device.h>
#include <i386/isa/sioreg.h>
+#endif
#include <i386/isa/intr_machdep.h>
#ifdef COM_ESP
#include <i386/isa/ic/esp.h>
#endif
#include <i386/isa/ic/ns16550.h>
-#ifdef PC98
-#include <i386/isa/ic/rsa.h>
-#endif
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -236,11 +216,9 @@
#define COM_IIR_TXRDYBUG(dev) ((dev)->id_flags & COM_C_IIR_TXRDYBUG)
#define COM_FIFOSIZE(dev) (((dev)->id_flags & 0xff000000) >> 24)
-#ifdef PC98
-#define com_emr com_msr /* Extension mode register for RSB-2000/3000 */
-#else
+#ifndef PC98
#define com_scr 7 /* scratch register for 16450-16550 (R/W) */
-#endif
+#endif /* !PC98 */
/*
* Input buffer watermarks.
@@ -369,9 +347,6 @@ struct com_s {
#endif
Port_t int_id_port;
Port_t iobase;
-#ifdef PC98
- Port_t rsabase; /* iobase address of a I/O-DATA RSA board */
-#endif
Port_t modem_ctl_port;
Port_t line_status_port;
Port_t modem_status_port;
@@ -401,18 +376,6 @@ struct com_s {
* Ping-pong input buffers. The extra factor of 2 in the sizes is
* to allow for an error byte for each input byte.
*/
-#ifdef PC98
- u_long CE_INPUT_OFFSET;
- u_char *ibuf1;
- u_char *ibuf2;
-
- /*
- * Data area for output buffers. Someday we should build the output
- * buffer queue without copying data.
- */
- u_char *obuf1;
- u_char *obuf2;
-#else
#define CE_INPUT_OFFSET RS_IBUFSIZE
u_char ibuf1[2 * RS_IBUFSIZE];
u_char ibuf2[2 * RS_IBUFSIZE];
@@ -423,7 +386,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#endif
#ifdef DEVFS
void *devfs_token_ttyd;
void *devfs_token_ttyl;
@@ -442,7 +404,6 @@ static int sioattach __P((struct isa_device *dev));
static timeout_t siobusycheck;
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
-static ointhand2_t siointr;
static void siointr1 __P((struct com_s *com));
static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
@@ -454,6 +415,9 @@ static timeout_t comwakeup;
static void disc_optim __P((struct tty *tp, struct termios *t,
struct com_s *com));
+#ifdef DSI_SOFT_MODEM
+static int LoadSoftModem __P((int unit,int base_io, u_long size, u_char *ptr));
+#endif /* DSI_SOFT_MODEM */
static char driver_name[] = "sio";
@@ -503,9 +467,28 @@ struct siodev {
short if_type;
short irq;
Port_t cmd, sts, ctrl, mod;
-};
+ };
static int sysclock;
-
+static short port_table[5][3] = {
+ {0x30, 0xb1, 0xb9},
+ {0x32, 0xb3, 0xbb},
+ {0x32, 0xb3, 0xbb},
+ {0x33, 0xb0, 0xb2},
+ {0x35, 0xb0, 0xb2}
+ };
+#define PC98SIO_data_port(ch) port_table[0][ch]
+#define PC98SIO_cmd_port(ch) port_table[1][ch]
+#define PC98SIO_sts_port(ch) port_table[2][ch]
+#define PC98SIO_in_modem_port(ch) port_table[3][ch]
+#define PC98SIO_intr_ctrl_port(ch) port_table[4][ch]
+#ifdef COM_IF_PIO9032B
+#define IO_COM_PIO9032B_2 0x0b8
+#define IO_COM_PIO9032B_3 0x0ba
+#endif /* COM_IF_PIO9032B */
+#ifdef COM_IF_B98_01
+#define IO_COM_B98_01_2 0x0d1
+#define IO_COM_B98_01_3 0x0d5
+#endif /* COM_IF_B98_01 */
#define COM_INT_DISABLE {int previpri; previpri=spltty();
#define COM_INT_ENABLE splx(previpri);}
#define IEN_TxFLAG IEN_Tx
@@ -514,8 +497,8 @@ static int sysclock;
#define PC98_CHECK_MODEM_INTERVAL (hz/10)
#define DCD_OFF_TOLERANCE 2
#define DCD_ON_RECOGNITION 2
-#define IS_8251(if_type) (!(if_type & 0x10))
-#define COM1_EXT_CLOCK 0x40000
+#define IS_8251(type) (type != MC16550)
+#define IS_PC98IN(adr) (adr == 0x30)
static void commint __P((dev_t dev));
static void com_tiocm_set __P((struct com_s *com, int msr));
@@ -539,9 +522,9 @@ static void pc98_i8251_set_cmd __P((struct com_s *com, int x));
static void pc98_i8251_or_cmd __P((struct com_s *com, int x));
static void pc98_i8251_clear_cmd __P((struct com_s *com, int x));
static void pc98_i8251_clear_or_cmd __P((struct com_s *com, int clr, int x));
-static int pc98_check_if_type __P((struct isa_device *dev, struct siodev *iod));
+static int pc98_check_if_type __P((int iobase, struct siodev *iod));
static void pc98_check_sysclock __P((void));
-static int pc98_set_ioport __P((struct com_s *com, int id_flags));
+static int pc98_set_ioport __P((struct com_s *com, int io_base));
#define com_int_Tx_disable(com) \
pc98_disable_i8251_interrupt(com,IEN_Tx|IEN_TxEMP)
@@ -560,7 +543,7 @@ static int pc98_set_ioport __P((struct com_s *com, int id_flags));
#define com_send_break_off(com) \
pc98_i8251_clear_cmd(com,CMD8251_SBRK)
-static struct speedtab pc98speedtab[] = { /* internal RS232C interface */
+struct speedtab pc98speedtab[] = { /* internal RS232C interface */
0, 0,
50, 50,
75, 75,
@@ -574,23 +557,16 @@ static struct speedtab pc98speedtab[] = { /* internal RS232C interface */
9600, 9600,
19200, 19200,
38400, 38400,
- 51200, 51200,
76800, 76800,
20800, 20800,
- 31200, 31200,
41600, 41600,
+ 15600, 15600,
+ 31200, 31200,
62400, 62400,
-1, -1
};
-static struct speedtab pc98fast_speedtab[] = {
- 9600, 0x80 | COMBRD(9600),
- 19200, 0x80 | COMBRD(19200),
- 38400, 0x80 | COMBRD(38400),
- 57600, 0x80 | COMBRD(57600),
- 115200, 0x80 | COMBRD(115200),
- -1, -1
-};
-static struct speedtab comspeedtab_pio9032b[] = {
+#ifdef COM_IF_PIO9032B
+struct speedtab comspeedtab_pio9032b[] = {
300, 6,
600, 5,
1200, 4,
@@ -601,82 +577,26 @@ static struct speedtab comspeedtab_pio9032b[] = {
38400, 7,
-1, -1
};
-static struct speedtab comspeedtab_b98_01[] = {
- 75, 11,
- 150, 10,
- 300, 9,
- 600, 8,
- 1200, 7,
- 2400, 6,
- 4800, 5,
- 9600, 4,
- 19200, 3,
- 38400, 2,
- 76800, 1,
- 153600, 0,
- -1, -1
-};
-static struct speedtab comspeedtab_mc16550[] = {
- 300, 1536,
- 600, 768,
- 1200, 384,
- 2400, 192,
- 4800, 96,
- 9600, 48,
- 19200, 24,
- 38400, 12,
- 57600, 8,
- 115200, 4,
- 153600, 3,
- 230400, 2,
- 460800, 1,
+#endif
+
+#ifdef COM_IF_B98_01
+struct speedtab comspeedtab_b98_01[] = {
+ 0, 0,
+ 75, 15,
+ 150, 14,
+ 300, 13,
+ 600, 12,
+ 1200, 11,
+ 2400, 10,
+ 4800, 9,
+ 9600, 8,
+ 19200, 7,
+ 38400, 6,
+ 76800, 5,
+ 153600, 4,
-1, -1
};
-static struct speedtab comspeedtab_rsb384[] = {
- 300, 3840,
- 600, 1920,
- 1200, 960,
- 2400, 480,
- 4800, 240,
- 9600, 120,
- 19200, 60,
- 38400, 30,
- 57600, 20,
- 115200, 10,
- 128000, 9,
- 144000, 8,
- 192000, 6,
- 230400, 5,
- 288000, 4,
- 384000, 3,
- 576000, 2,
- 1152000, 1,
- -1, -1
-};
-static struct speedtab comspeedtab_rsa[] = {
- { 0, 0 },
- { 50, COMBRD_RSA(50) },
- { 75, COMBRD_RSA(75) },
- { 110, COMBRD_RSA(110) },
- { 134, COMBRD_RSA(134) },
- { 150, COMBRD_RSA(150) },
- { 200, COMBRD_RSA(200) },
- { 300, COMBRD_RSA(300) },
- { 600, COMBRD_RSA(600) },
- { 1200, COMBRD_RSA(1200) },
- { 1800, COMBRD_RSA(1800) },
- { 2400, COMBRD_RSA(2400) },
- { 4800, COMBRD_RSA(4800) },
- { 9600, COMBRD_RSA(9600) },
- { 19200, COMBRD_RSA(19200) },
- { 38400, COMBRD_RSA(38400) },
- { 57600, COMBRD_RSA(57600) },
- { 115200, COMBRD_RSA(115200) },
- { 230400, COMBRD_RSA(230400) },
- { 460800, COMBRD_RSA(460800) },
- { 921600, COMBRD_RSA(921600) },
- { -1, -1 }
-};
+#endif
#endif /* PC98 */
static struct speedtab comspeedtab[] = {
@@ -701,100 +621,10 @@ static struct speedtab comspeedtab[] = {
{ -1, -1 }
};
-#ifdef PC98
-struct {
- char *name;
- short port_table[7];
- short irr_mask;
- struct speedtab *speedtab;
- short check_irq;
-} if_8251_type[] = {
- /* COM_IF_INTERNAL */
- { " (internal)", {0x30, 0x32, 0x32, 0x33, 0x35, -1, -1},
- -1, pc98speedtab, 1 },
- /* COM_IF_PC9861K_1 */
- { " (PC9861K)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, -1, -1},
- 3, NULL, 1 },
- /* COM_IF_PC9861K_2 */
- { " (PC9861K)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, -1, -1},
- 3, NULL, 1 },
- /* COM_IF_IND_SS_1 */
- { " (IND-SS)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xb3, -1},
- 3, comspeedtab_mc16550, 1 },
- /* COM_IF_IND_SS_2 */
- { " (IND-SS)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xbb, -1},
- 3, comspeedtab_mc16550, 1 },
- /* COM_IF_PIO9032B_1 */
- { " (PIO9032B)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xb8, -1},
- 7, comspeedtab_pio9032b, 1 },
- /* COM_IF_PIO9032B_2 */
- { " (PIO9032B)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xba, -1},
- 7, comspeedtab_pio9032b, 1 },
- /* COM_IF_B98_01_1 */
- { " (B98-01)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xd1, 0xd3},
- 7, comspeedtab_b98_01, 0 },
- /* COM_IF_B98_01_2 */
- { " (B98-01)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xd5, 0xd7},
- 7, comspeedtab_b98_01, 0 },
-};
-#define PC98SIO_data_port(type) (if_8251_type[type].port_table[0])
-#define PC98SIO_cmd_port(type) (if_8251_type[type].port_table[1])
-#define PC98SIO_sts_port(type) (if_8251_type[type].port_table[2])
-#define PC98SIO_in_modem_port(type) (if_8251_type[type].port_table[3])
-#define PC98SIO_intr_ctrl_port(type) (if_8251_type[type].port_table[4])
-#define PC98SIO_baud_rate_port(type) (if_8251_type[type].port_table[5])
-#define PC98SIO_func_port(type) (if_8251_type[type].port_table[6])
-
-struct {
- char *name;
- short irr_read;
- short irr_write;
- short port_shift;
- short io_size;
- struct speedtab *speedtab;
-} if_16550a_type[] = {
- /* COM_IF_RSA98 */
- { " (RSA-98)", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_NS16550 */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_SECOND_CCU */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_MC16550II */
- { " (MC16550II)", -1, 0x1000, 8, 1, comspeedtab_mc16550 },
- /* COM_IF_MCRS98 */
- { " (MC-RS98)", -1, 0x1000, 8, 1, comspeedtab_mc16550 },
- /* COM_IF_RSB3000 */
- { " (RSB-3000)", 0xbf, -1, 1, 1, comspeedtab_rsb384 },
- /* COM_IF_RSB384 */
- { " (RSB-384)", 0xbf, -1, 1, 1, comspeedtab_rsb384 },
- /* COM_IF_MODEM_CARD */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_RSA98III */
- { " (RSA-98III)", -1, -1, 0, 16, comspeedtab_rsa },
- /* COM_IF_ESP98 */
- { " (ESP98)", -1, -1, 1, 1, comspeedtab_mc16550 },
-};
-#endif /* PC98 */
-
#ifdef COM_ESP
-#ifdef PC98
-
-/* XXX configure this properly. */
-static Port_t likely_com_ports[] = { 0, 0xb0, 0xb1, 0 };
-static Port_t likely_esp_ports[] = { 0xc0d0, 0 };
-
-#define ESP98_CMD1 (ESP_CMD1 * 0x100)
-#define ESP98_CMD2 (ESP_CMD2 * 0x100)
-#define ESP98_STATUS1 (ESP_STATUS1 * 0x100)
-#define ESP98_STATUS2 (ESP_STATUS2 * 0x100)
-
-#else /* PC98 */
-
/* XXX configure this properly. */
static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, };
static Port_t likely_esp_ports[] = { 0x140, 0x180, 0x280, 0 };
-
-#endif /* PC98 */
#endif
/*
@@ -865,7 +695,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -932,9 +772,6 @@ siounload(struct pccard_devinfo *devi)
ttwwakeup(com->tp);
} else {
com_addr(com->unit) = NULL;
-#ifdef PC98
- bzero(com->ibuf1, com->CE_INPUT_OFFSET * 6);
-#endif
bzero(com, sizeof *com);
free(com,M_TTYS);
printf("sio%d: unload,gone\n", devi->isahd.id_unit);
@@ -977,9 +814,7 @@ sioprobe(dev)
int irqout=0;
int ret = 0;
int tmp;
- int port_shift = 0;
- struct siodev iod;
- Port_t rsabase = NULL;
+ struct siodev iod;
#endif
if (!already_init) {
@@ -990,26 +825,13 @@ sioprobe(dev)
* XXX the gate enable is elsewhere for some multiports.
*/
for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++)
+ if (xdev->id_driver == &siodriver && xdev->id_enabled)
#ifdef PC98
- if (xdev->id_driver == &siodriver && xdev->id_enabled) {
- tmp = (xdev->id_flags >> 24) & 0xff;
- if (IS_8251(tmp))
- outb((xdev->id_iobase & 0xff00) | PC98SIO_cmd_port(tmp & 0x0f), 0xf2);
- else
- if (tmp == COM_IF_RSA98III) {
- rsabase = xdev->id_iobase & 0xfff0;
-#if 0
- if (rsabase != xdev->id_iobase)
- return(0);
+ if (IS_PC98IN(xdev->id_iobase))
+ outb(xdev->id_iobase + 2, 0xf2);
+ else
#endif
- outb(xdev->id_iobase + 8 + (com_mcr << if_16550a_type[tmp & 0x0f].port_shift), 0);
- } else
- outb(xdev->id_iobase + (com_mcr << if_16550a_type[tmp & 0x0f].port_shift), 0);
- }
-#else
- if (xdev->id_driver == &siodriver && xdev->id_enabled)
outb(xdev->id_iobase + com_mcr, 0);
-#endif
already_init = TRUE;
}
@@ -1020,15 +842,14 @@ sioprobe(dev)
#ifdef PC98
DELAY(10);
-
/*
* If the port is i8251 UART (internal, B98_01)
*/
- if (pc98_check_if_type(dev, &iod) == -1)
- return 0;
- if (iod.irq > 0)
- dev->id_irq = 1 << iod.irq;
- if (IS_8251(iod.if_type)) {
+ if(pc98_check_if_type(dev->id_iobase, &iod) == -1)
+ return 0;
+ if(IS_8251(iod.if_type)){
+ if ( iod.irq > 0 )
+ dev->id_irq = (1 << iod.irq);
outb(iod.cmd, 0);
DELAY(10);
outb(iod.cmd, 0);
@@ -1044,20 +865,23 @@ sioprobe(dev)
if (( inb(iod.sts) & STS8251_TxEMP ) == 0 ) {
ret = 0;
}
- if (if_8251_type[iod.if_type & 0x0f].check_irq) {
- COM_INT_DISABLE
- tmp = ( inb( iod.ctrl ) & ~(IEN_Rx|IEN_TxEMP|IEN_Tx));
- outb( iod.ctrl, tmp|IEN_TxEMP );
- DELAY(10);
- ret = isa_irq_pending() ? 4 : 0;
- outb( iod.ctrl, tmp );
- COM_INT_ENABLE
- } else {
- /*
- * B98_01 doesn't activate TxEMP interrupt line
- * when being reset, so we can't check irq pending.
- */
- ret = 4;
+ switch (iod.if_type) {
+ case COM_IF_INTERNAL:
+ COM_INT_DISABLE
+ tmp = ( inb( iod.ctrl ) & ~(IEN_Rx|IEN_TxEMP|IEN_Tx));
+ outb( iod.ctrl, tmp|IEN_TxEMP );
+ DELAY(10);
+ ret = isa_irq_pending() ? 4 : 0;
+ outb( iod.ctrl, tmp );
+ COM_INT_ENABLE
+ break;
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ /* B98_01 doesn't activate TxEMP interrupt line
+ when being reset, so we can't check irq pending.*/
+ ret = 4;
+ break;
+#endif
}
if (epson_machine_id==0x20) { /* XXX */
ret = 4;
@@ -1075,22 +899,6 @@ sioprobe(dev)
*/
idev = dev;
mcr_image = MCR_IENABLE;
-#ifdef PC98
- if (iod.if_type == COM_IF_RSA98III) {
- mcr_image = 0;
- rsabase = idev->id_iobase & 0xfff0;
- if (rsabase != idev->id_iobase)
- return(0);
- outb(rsabase + rsa_msr, 0x04);
- outb(rsabase + rsa_frr, 0x00);
- if ((inb(rsabase + rsa_srr) & 0x36) != 0x36)
- return (0);
- outb(rsabase + rsa_ier, 0x00);
- outb(rsabase + rsa_frr, 0x00);
- outb(rsabase + rsa_tivsr, 0x00);
- outb(rsabase + rsa_tcr, 0x00);
- }
-#endif /* PC98 */
#ifdef COM_MULTIPORT
if (COM_ISMULTIPORT(dev)) {
idev = find_isadev(isa_devtab_tty, &siodriver,
@@ -1114,28 +922,18 @@ sioprobe(dev)
mcr_image = 0;
#ifdef PC98
- tmp = if_16550a_type[iod.if_type & 0x0f].irr_write;
- if (tmp != -1) {
- /* MC16550II */
- switch (idev->id_irq) {
- case IRQ3: irqout = 4; break;
- case IRQ5: irqout = 5; break;
- case IRQ6: irqout = 6; break;
- case IRQ12: irqout = 7; break;
- default:
- printf("sio%d: irq configuration error\n", dev->id_unit);
- return (0);
- }
- outb((dev->id_iobase & 0x00ff) | tmp, irqout);
+ switch(idev->id_irq){
+ case IRQ3: irqout = 4; break;
+ case IRQ5: irqout = 5; break;
+ case IRQ6: irqout = 6; break;
+ case IRQ12: irqout = 7; break;
+ default:
+ printf("sio%d: irq configuration error\n",dev->id_unit);
+ return (0);
}
- port_shift = if_16550a_type[iod.if_type & 0x0f].port_shift;
+ outb(dev->id_iobase+0x1000, irqout);
#endif
bzero(failures, sizeof failures);
-#ifdef PC98
- if (iod.if_type == COM_IF_RSA98III)
- iobase = dev->id_iobase + 8;
- else
-#endif
iobase = dev->id_iobase;
/*
@@ -1160,19 +958,10 @@ sioprobe(dev)
if (iobase == siocniobase)
DELAY((16 + 1) * 1000000 / (comdefaultrate / 10));
else {
-#ifdef PC98
- tmp = ttspeedtab(SIO_TEST_SPEED,
- if_16550a_type[iod.if_type & 0x0f].speedtab);
- outb(iobase + (com_cfcr << port_shift), CFCR_DLAB|CFCR_8BITS);
- outb(iobase + (com_dlbl << port_shift), tmp & 0xff);
- outb(iobase + (com_dlbh << port_shift), (tmp >> 8) & 0xff);
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
-#else
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
outb(iobase + com_dlbl, COMBRD(SIO_TEST_SPEED) & 0xff);
outb(iobase + com_dlbh, (u_int) COMBRD(SIO_TEST_SPEED) >> 8);
outb(iobase + com_cfcr, CFCR_8BITS);
-#endif
DELAY((16 + 1) * 1000000 / (SIO_TEST_SPEED / 10));
}
@@ -1182,13 +971,8 @@ sioprobe(dev)
* guarantee an edge trigger if an interrupt can be generated.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image);
- outb(iobase + (com_ier << port_shift), 0);
-#else
outb(iobase + com_mcr, mcr_image);
outb(iobase + com_ier, 0);
-#endif
DELAY(1000); /* XXX */
irqmap[0] = isa_irq_pending();
@@ -1197,11 +981,7 @@ sioprobe(dev)
* without annoying any external device.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image | MCR_LOOPBACK);
-#else
outb(iobase + com_mcr, mcr_image | MCR_LOOPBACK);
-#endif
/*
* Attempt to generate an output interrupt. On 8250's, setting
@@ -1211,14 +991,7 @@ sioprobe(dev)
* current setting. On 16550A's, setting IER_ETXRDY only
* generates an interrupt when IER_ETXRDY is not already set.
*/
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), IER_ETXRDY);
- if (iod.if_type == COM_IF_RSA98III) {
- outb(rsabase + rsa_ier, 0x04);
- }
-#else
outb(iobase + com_ier, IER_ETXRDY);
-#endif /* PC98 */
/*
* On some 16x50 incompatibles, setting IER_ETXRDY doesn't generate
@@ -1226,11 +999,7 @@ sioprobe(dev)
* output. Loopback may be broken on the same incompatibles but
* it's unlikely to do more than allow the null byte out.
*/
-#ifdef PC98
- outb(iobase + (com_data << port_shift), 0);
-#else
outb(iobase + com_data, 0);
-#endif
DELAY((1 + 2) * 1000000 / (SIO_TEST_SPEED / 10));
/*
@@ -1241,11 +1010,7 @@ sioprobe(dev)
* are disabled.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image);
-#else
outb(iobase + com_mcr, mcr_image);
-#endif /* PC98 */
/*
* It's a definitly Serial PCMCIA(16550A), but still be required
@@ -1255,28 +1020,14 @@ sioprobe(dev)
/* Reading IIR register twice */
for ( fn = 0; fn < 2; fn ++ ) {
DELAY(10000);
-#ifdef PC98
- failures[6] = inb(iobase + (com_iir << port_shift));
-#else
failures[6] = inb(iobase + com_iir);
-#endif
}
/* Check IIR_TXRDY clear ? */
-#ifdef PC98
- result = if_16550a_type[iod.if_type & 0x0f].io_size;
-#else
result = IO_COMSIZE;
-#endif
if ( failures[6] & IIR_TXRDY ) {
/* Nop, Double check with clearing IER */
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), 0);
- if (inb(iobase +
- (com_iir << port_shift)) & IIR_NOPEND) {
-#else
outb(iobase + com_ier, 0);
if ( inb(iobase + com_iir) & IIR_NOPEND ) {
-#endif
/* Ok. we're familia this gang */
dev->id_flags |= COM_C_IIR_TXRDYBUG; /* Set IIR_TXRDYBUG */
} else {
@@ -1287,11 +1038,7 @@ sioprobe(dev)
/* OK. this is well-known guys */
dev->id_flags &= ~COM_C_IIR_TXRDYBUG; /*Clear IIR_TXRDYBUG*/
}
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
-#else
outb(iobase + com_cfcr, CFCR_8BITS);
-#endif
enable_intr();
return (iobase == siocniobase ? IO_COMSIZE : result);
}
@@ -1305,37 +1052,15 @@ sioprobe(dev)
* o the interrupt goes away when the IIR in the UART is read.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- failures[0] = inb(iobase + (com_cfcr << port_shift)) - CFCR_8BITS;
- failures[1] = inb(iobase + (com_ier << port_shift)) - IER_ETXRDY;
- failures[2] = inb(iobase + (com_mcr << port_shift)) - mcr_image;
-#else
failures[0] = inb(iobase + com_cfcr) - CFCR_8BITS;
failures[1] = inb(iobase + com_ier) - IER_ETXRDY;
failures[2] = inb(iobase + com_mcr) - mcr_image;
-#endif
DELAY(10000); /* Some internal modems need this time */
irqmap[1] = isa_irq_pending();
-#ifdef PC98
- failures[4] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_TXRDY;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- }
-#else
failures[4] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_TXRDY;
-#endif
DELAY(1000); /* XXX */
irqmap[2] = isa_irq_pending();
-#ifdef PC98
- failures[6] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_NOPEND;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- }
-#else
failures[6] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
-#endif
/*
* Turn off all device interrupts and check that they go off properly.
@@ -1346,30 +1071,12 @@ sioprobe(dev)
* (On the system that this was first tested on, the input floats high
* and gives a (masked) interrupt as soon as the gate is closed.)
*/
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), 0);
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
- failures[7] = inb(iobase + (com_ier << port_shift));
- if (iod.if_type == COM_IF_RSA98III) {
- outb(rsabase + rsa_ier, 0x00);
- }
-#else
outb(iobase + com_ier, 0);
outb(iobase + com_cfcr, CFCR_8BITS); /* dummy to avoid bus echo */
failures[7] = inb(iobase + com_ier);
-#endif
DELAY(1000); /* XXX */
irqmap[3] = isa_irq_pending();
-#ifdef PC98
- failures[9] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_NOPEND;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- outb(rsabase + rsa_frr, 0x00);
- }
-#else
failures[9] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
-#endif
enable_intr();
@@ -1382,18 +1089,10 @@ sioprobe(dev)
printf("sio%d: irq maps: %#x %#x %#x %#x\n",
dev->id_unit, irqmap[0], irqmap[1], irqmap[2], irqmap[3]);
-#ifdef PC98
- result = if_16550a_type[iod.if_type & 0x0f].io_size;
-#else
result = IO_COMSIZE;
-#endif
for (fn = 0; fn < sizeof failures; ++fn)
if (failures[fn]) {
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), 0);
-#else
outb(iobase + com_mcr, 0);
-#endif
result = 0;
if (bootverbose) {
printf("sio%d: probe failed test(s):",
@@ -1433,22 +1132,13 @@ espattach(isdp, com, esp_port)
*/
/* Get the dip-switch configuration */
-#ifdef PC98
- outb(esp_port + ESP98_CMD1, ESP_GETDIPS);
- dips = inb(esp_port + ESP98_STATUS1);
-#else
outb(esp_port + ESP_CMD1, ESP_GETDIPS);
dips = inb(esp_port + ESP_STATUS1);
-#endif
/*
* Bits 0,1 of dips say which COM port we are.
*/
-#ifdef PC98
- if ((com->iobase & 0xff) == likely_com_ports[dips & 0x03])
-#else
if (com->iobase == likely_com_ports[dips & 0x03])
-#endif
printf(" : ESP");
else {
printf(" esp_port has com %d\n", dips & 0x03);
@@ -1458,15 +1148,9 @@ espattach(isdp, com, esp_port)
/*
* Check for ESP version 2.0 or later: bits 4,5,6 = 010.
*/
-#ifdef PC98
- outb(esp_port + ESP98_CMD1, ESP_GETTEST);
- val = inb(esp_port + ESP98_STATUS1); /* clear reg 1 */
- val = inb(esp_port + ESP98_STATUS2);
-#else
outb(esp_port + ESP_CMD1, ESP_GETTEST);
val = inb(esp_port + ESP_STATUS1); /* clear reg 1 */
val = inb(esp_port + ESP_STATUS2);
-#endif
if ((val & 0x70) < 0x20) {
printf("-old (%o)", val & 0x70);
return (0);
@@ -1501,28 +1185,11 @@ sioattach(isdp)
Port_t iobase;
int s;
int unit;
-#ifdef PC98
- int port_shift = 0;
- u_long ibufsize;
-#endif
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
-#ifdef PC98
- if (((isdp->id_flags >> 24) & 0xff) == COM_IF_RSA98III)
- iobase = isdp->id_iobase + 8;
- else
-#endif
iobase = isdp->id_iobase;
unit = isdp->id_unit;
-#ifndef PC98
com = malloc(sizeof *com, M_TTYS, M_NOWAIT);
-#else
- ibufsize = RS_IBUFSIZE;
- if (((isdp->id_flags >> 24) & 0xff) == COM_IF_RSA98III)
- ibufsize = 2048;
- com = malloc((sizeof *com) + ibufsize * 6, M_TTYS, M_NOWAIT);
-#endif
if (com == NULL)
return (0);
@@ -1539,14 +1206,6 @@ sioattach(isdp)
* device from sending before we are ready.
*/
bzero(com, sizeof *com);
-#ifdef PC98
- com->CE_INPUT_OFFSET = ibufsize;
- com->ibuf1 = (u_char *)com + (sizeof *com);
- com->ibuf2 = com->ibuf1 + (ibufsize * 2);
- com->obuf1 = com->ibuf2 + (ibufsize * 2);
- com->obuf2 = com->obuf1 + ibufsize;
- bzero(com->ibuf1, ibufsize * 6);
-#endif
com->unit = unit;
com->cfcr_image = CFCR_8BITS;
com->dtr_wait = 3 * hz;
@@ -1554,29 +1213,24 @@ sioattach(isdp)
com->no_irq = isdp->id_irq == 0;
com->tx_fifo_size = 1;
com->iptr = com->ibuf = com->ibuf1;
-#ifndef PC98
com->ibufend = com->ibuf1 + RS_IBUFSIZE;
com->ihighwater = com->ibuf1 + RS_IHIGHWATER;
-#else
- com->ibufend = com->ibuf1 + com->CE_INPUT_OFFSET;
- com->ihighwater = com->ibuf1 + (3 * com->CE_INPUT_OFFSET / 4);
-#endif
com->obufs[0].l_head = com->obuf1;
com->obufs[1].l_head = com->obuf2;
com->iobase = iobase;
#ifdef PC98
- if (pc98_set_ioport(com, isdp->id_flags) == -1) {
- com->pc98_if_type = (isdp->id_flags >> 24) & 0xff;
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
- com->data_port = iobase + (com_data << port_shift);
- com->int_id_port = iobase + (com_iir << port_shift);
- com->modem_ctl_port = iobase + (com_mcr << port_shift);
- com->mcr_image = inb(com->modem_ctl_port);
- com->line_status_port = iobase + (com_lsr << port_shift);
- com->modem_status_port = iobase + (com_msr << port_shift);
- com->intr_ctl_port = iobase + (com_ier << port_shift);
- }
+ if(pc98_set_ioport(com, iobase) == -1)
+ if((iobase & 0x0f0) == 0xd0) {
+ com->pc98_if_type = MC16550;
+ com->data_port = iobase + com_data;
+ com->int_id_port = iobase + com_iir;
+ com->modem_ctl_port = iobase + com_mcr;
+ com->mcr_image = inb(com->modem_ctl_port);
+ com->line_status_port = iobase + com_lsr;
+ com->modem_status_port = iobase + com_msr;
+ com->intr_ctl_port = iobase + com_ier;
+ }
#else /* not PC98 */
com->data_port = iobase + com_data;
com->int_id_port = iobase + com_iir;
@@ -1599,7 +1253,7 @@ sioattach(isdp)
com->it_in.c_lflag = 0;
if (unit == comconsole) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
DELAY(100000);
#endif
com->it_in.c_iflag = TTYDEF_IFLAG;
@@ -1618,6 +1272,12 @@ sioattach(isdp)
/* attempt to determine UART type */
printf("sio%d: type", unit);
+#ifdef DSI_SOFT_MODEM
+ if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) {
+ printf(" Digicom Systems, Inc. SoftModem");
+ goto determined_type;
+ }
+#endif /* DSI_SOFT_MODEM */
#ifndef PC98
#ifdef COM_MULTIPORT
@@ -1643,17 +1303,35 @@ sioattach(isdp)
}
#endif /* !PC98 */
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- com_int_TxRx_disable( com );
- com_cflag_and_speed_set( com, com->it_in.c_cflag, comdefaultrate );
- com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
- com_send_break_off( com );
- printf(" 8251%s", if_8251_type[com->pc98_if_type & 0x0f].name);
+ if(IS_8251(com->pc98_if_type)){
+ com_int_TxRx_disable( com );
+ com_cflag_and_speed_set( com, com->it_in.c_cflag,
+ comdefaultrate );
+ com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
+ com_send_break_off( com );
+ switch(com->pc98_if_type){
+ case COM_IF_INTERNAL:
+ printf(" 8251 (internal)");
+ break;
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ printf(" 8251 (PC9861K)");
+ break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ printf(" 8251 (PIO9032B)");
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ printf(" 8251 (B98_01)");
+ break;
+#endif
+ }
} else {
- outb(iobase + (com_fifo << port_shift), FIFO_ENABLE | FIFO_RX_HIGH);
-#else
- outb(iobase + com_fifo, FIFO_ENABLE | FIFO_RX_HIGH);
#endif /* PC98 */
+ outb(iobase + com_fifo, FIFO_ENABLE | FIFO_RX_HIGH);
DELAY(100);
com->st16650a = 0;
switch (inb(com->int_id_port) & IIR_FIFO_MASK) {
@@ -1671,10 +1349,6 @@ sioattach(isdp)
printf(" 16550A fifo disabled");
} else {
com->hasfifo = TRUE;
-#ifdef PC98
- com->tx_fifo_size = 0; /* XXX flag conflicts. */
- printf(" 16550A");
-#else
if (COM_ST16650A(isdp)) {
com->st16650a = 1;
com->tx_fifo_size = 32;
@@ -1683,21 +1357,8 @@ sioattach(isdp)
com->tx_fifo_size = COM_FIFOSIZE(isdp);
printf(" 16550A");
}
-#endif
- }
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- com->tx_fifo_size = 2048;
- com->rsabase = isdp->id_iobase;
- outb(com->rsabase + rsa_ier, 0x00);
- outb(com->rsabase + rsa_frr, 0x00);
}
-#endif
-
#ifdef COM_ESP
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_ESP98)
-#endif
for (espp = likely_esp_ports; *espp != 0; espp++)
if (espattach(isdp, com, *espp)) {
com->tx_fifo_size = 1024;
@@ -1715,17 +1376,6 @@ sioattach(isdp)
break;
}
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSB3000) {
- /* Set RSB-2000/3000 Extended Buffer mode. */
- u_char lcr;
- lcr = inb(iobase + (com_cfcr << port_shift));
- outb(iobase + (com_cfcr << port_shift), lcr | CFCR_DLAB);
- outb(iobase + (com_emr << port_shift), EMR_EXBUFF | EMR_EFMODE);
- outb(iobase + (com_cfcr << port_shift), lcr);
- }
-#endif
-
#ifdef COM_ESP
if (com->esp) {
/*
@@ -1735,53 +1385,23 @@ sioattach(isdp)
* bursts of input.
* XXX flow control should be set in comparam(), not here.
*/
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETMODE);
- outb(com->esp_port + ESP98_CMD2, ESP_MODE_RTS | ESP_MODE_FIFO);
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETMODE);
outb(com->esp_port + ESP_CMD2, ESP_MODE_RTS | ESP_MODE_FIFO);
-#endif
/* Set RTS/CTS flow control. */
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETFLOWTYPE);
- outb(com->esp_port + ESP98_CMD2, ESP_FLOW_RTS);
- outb(com->esp_port + ESP98_CMD2, ESP_FLOW_CTS);
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETFLOWTYPE);
outb(com->esp_port + ESP_CMD2, ESP_FLOW_RTS);
outb(com->esp_port + ESP_CMD2, ESP_FLOW_CTS);
-#endif
/* Set flow-control levels. */
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETRXFLOW);
- outb(com->esp_port + ESP98_CMD2, HIBYTE(768));
- outb(com->esp_port + ESP98_CMD2, LOBYTE(768));
- outb(com->esp_port + ESP98_CMD2, HIBYTE(512));
- outb(com->esp_port + ESP98_CMD2, LOBYTE(512));
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETRXFLOW);
outb(com->esp_port + ESP_CMD2, HIBYTE(768));
outb(com->esp_port + ESP_CMD2, LOBYTE(768));
outb(com->esp_port + ESP_CMD2, HIBYTE(512));
outb(com->esp_port + ESP_CMD2, LOBYTE(512));
-#endif
-
-#ifdef PC98
- /* Set UART clock prescaler. */
- outb(com->esp_port + ESP98_CMD1, ESP_SETCLOCK);
- outb(com->esp_port + ESP98_CMD2, 2); /* 4 times */
-#endif
}
#endif /* COM_ESP */
-#ifdef PC98
- printf("%s", if_16550a_type[com->pc98_if_type & 0x0f].name);
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
determined_type: ;
#ifdef COM_MULTIPORT
@@ -1793,7 +1413,7 @@ determined_type: ;
printf(")");
com->no_irq = find_isadev(isa_devtab_tty, &siodriver,
COM_MPMASTER(isdp))->id_irq == 0;
- }
+ }
#endif /* COM_MULTIPORT */
#ifdef PC98
}
@@ -1852,9 +1472,6 @@ sioopen(dev, flag, mode, p)
int s;
struct tty *tp;
int unit;
-#ifdef PC98
- int port_shift = 0;
-#endif
mynor = minor(dev);
unit = MINOR_TO_UNIT(mynor);
@@ -1870,11 +1487,6 @@ sioopen(dev, flag, mode, p)
tp = com->tp = &sio_tty[unit];
#endif
s = spltty();
-
-#ifdef PC98
- if (!IS_8251(com->pc98_if_type))
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-#endif
/*
* We jump to this label after all non-interrupted sleeps to pick
* up any changes of the device state.
@@ -1928,15 +1540,11 @@ open_top:
tp->t_dev = dev;
tp->t_termios = mynor & CALLOUT_MASK
? com->it_out : com->it_in;
-#ifndef PC98
tp->t_ififosize = 2 * RS_IBUFSIZE;
-#else
- tp->t_ififosize = 2 * com->CE_INPUT_OFFSET;
-#endif
tp->t_ispeedwat = (speed_t)-1;
tp->t_ospeedwat = (speed_t)-1;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type))
+ if(!IS_8251(com->pc98_if_type))
#endif
(void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
com->poll = com->no_irq;
@@ -1947,7 +1555,7 @@ open_top:
if (error != 0)
goto out;
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
com_tiocm_bis(com, TIOCM_DTR|TIOCM_RTS);
pc98_msrint_start(dev);
}
@@ -1969,17 +1577,9 @@ open_top:
* input.
*/
while (TRUE) {
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift),
- FIFO_RCV_RST | FIFO_XMT_RST
- | com->fifo_image);
- if (com->pc98_if_type == COM_IF_RSA98III)
- outb(com->rsabase + rsa_frr , 0x00);
-#else
outb(iobase + com_fifo,
FIFO_RCV_RST | FIFO_XMT_RST
| com->fifo_image);
-#endif
/*
* XXX the delays are for superstitious
* historical reasons. It must be less than
@@ -1992,19 +1592,9 @@ open_top:
* for about 85 usec instead of 100.
*/
DELAY(50);
-#ifndef PC98
if (!(inb(com->line_status_port) & LSR_RXRDY))
-#else
- if (com->pc98_if_type == COM_IF_RSA98III
- ? !(inb(com->rsabase + rsa_srr) & 0x08)
- : !(inb(com->line_status_port) & LSR_RXRDY))
-#endif
break;
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
DELAY(50);
(void) inb(com->data_port);
}
@@ -2012,10 +1602,11 @@ open_top:
disable_intr();
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- com_tiocm_bis(com, TIOCM_LE);
- com->pc98_prev_modem_status = pc98_get_modem_status(com);
- com_int_Rx_enable(com);
+ if(IS_8251(com->pc98_if_type)){
+ com_tiocm_bis(com, TIOCM_LE);
+ com->pc98_prev_modem_status =
+ pc98_get_modem_status(com);
+ com_int_Rx_enable(com);
} else {
#endif
(void) inb(com->line_status_port);
@@ -2030,12 +1621,6 @@ open_top:
| IER_ERLS | IER_EMSC);
}
#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- outb(com->rsabase + rsa_ier, 0x1d);
- outb(com->intr_ctl_port, IER_ERLS | IER_EMSC);
- }
-#endif
-#ifdef PC98
}
#endif
enable_intr();
@@ -2137,9 +1722,6 @@ comhardclose(com)
int s;
struct tty *tp;
int unit;
-#ifdef PC98
- int port_shift = 0;
-#endif
unit = com->unit;
iobase = com->iobase;
@@ -2149,32 +1731,22 @@ comhardclose(com)
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_send_break_off(com);
- else {
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image &= ~CFCR_SBREAK);
- }
-#else
- outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
+ if(IS_8251(com->pc98_if_type))
+ com_send_break_off(com);
+ else
#endif
+ outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
{
#ifdef PC98
int tmp;
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_int_TxRx_disable(com);
else
- outb(iobase + (com_ier << port_shift), 0);
- if (com->pc98_if_type == COM_IF_RSA98III) {
- outb(com->rsabase + rsa_ier, 0x00);
- }
-#else
- outb(iobase + com_ier, 0);
#endif
+ outb(iobase + com_ier, 0);
tp = com->tp;
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = pc98_get_modem_status(com) & TIOCM_CAR;
else
tmp = com->prev_modem_status & MSR_DCD;
@@ -2196,8 +1768,8 @@ comhardclose(com)
&& !(com->it_in.c_cflag & CLOCAL)
|| !(tp->t_state & TS_ISOPEN)) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_tiocm_bic(com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE);
+ if(IS_8251(com->pc98_if_type))
+ com_tiocm_bic(com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE);
else
#endif
(void)commctl(com, TIOCM_DTR, DMBIC);
@@ -2208,7 +1780,7 @@ comhardclose(com)
}
#ifdef PC98
else {
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_LE );
}
#endif
@@ -2219,11 +1791,7 @@ comhardclose(com)
* reboots. Some BIOSes fail to detect 16550s when the
* fifos are enabled.
*/
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
}
com->active_out = FALSE;
wakeup(&com->active_out);
@@ -2329,7 +1897,7 @@ siodtrwakeup(chan)
wakeup(&com->dtr_wait);
}
-static void
+void
siointr(unit)
int unit;
{
@@ -2340,9 +1908,6 @@ siointr(unit)
#else /* COM_MULTIPORT */
struct com_s *com;
bool_t possibly_more_intrs;
-#ifdef PC98
- u_char rsa_buf_status;
-#endif
/*
* Loop until there is no activity on any port. This is necessary
@@ -2367,20 +1932,6 @@ siointr(unit)
siointr1(com);
} else
#endif /* PC98 */
-#ifdef PC98
- if (com != NULL
- && !com->gone
- && com->pc98_if_type == COM_IF_RSA98III) {
- rsa_buf_status = inb(com->rsabase + rsa_srr) & 0xc9;
- if ((rsa_buf_status & 0xc8)
- || !(rsa_buf_status & 0x01)) {
- siointr1(com);
- if(rsa_buf_status
- != (inb(com->rsabase + rsa_srr) & 0xc9))
- possibly_more_intrs = TRUE;
- }
- } else
-#endif
if (com != NULL
&& !com->gone
&& (inb(com->int_id_port) & IIR_IMASK)
@@ -2403,14 +1954,13 @@ siointr1(com)
u_char modem_status;
u_char *ioptr;
u_char recv_data;
+ u_char int_ident;
u_char int_ctl;
u_char int_ctl_new;
#ifdef PC98
u_char tmp=0;
- u_char rsa_buf_status = 0;
- int rsa_tx_fifo_size=0;
- recv_data=0;
+recv_data=0;
#endif /* PC98 */
int_ctl = inb(com->intr_ctl_port);
@@ -2433,38 +1983,19 @@ more_intr:
} else
#endif /* PC98 */
line_status = inb(com->line_status_port);
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III)
- rsa_buf_status = inb(com->rsabase + rsa_srr);
-#endif /* PC98 */
/* input event? (check first to help avoid overruns) */
-#ifndef PC98
while (line_status & LSR_RCV_MASK) {
-#else
- while ((line_status & LSR_RCV_MASK)
- || (com->pc98_if_type == COM_IF_RSA98III
- && (rsa_buf_status & 0x08))) {
-#endif /* PC98 */
/* break/unnattached error bits or real input? */
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
recv_data = inb(com->data_port);
- if (tmp & 0x78) {
+ if(tmp & 0x78){
pc98_i8251_or_cmd(com,CMD8251_ER);
recv_data = 0;
}
} else {
#endif /* PC98 */
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- if (!(rsa_buf_status & 0x08))
- recv_data = 0;
- else {
- recv_data = inb(com->data_port);
- }
- } else
-#endif
if (!(line_status & LSR_RXRDY))
recv_data = 0;
else
@@ -2521,16 +2052,12 @@ if (com->iptr - com->ibuf == 8)
setsofttty();
#endif
ioptr[0] = recv_data;
-#ifdef PC98
- ioptr[com->CE_INPUT_OFFSET] = line_status;
-#else
ioptr[CE_INPUT_OFFSET] = line_status;
-#endif
com->iptr = ++ioptr;
if (ioptr == com->ihighwater
&& com->state & CS_RTS_IFLOW)
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_RTS);
else
#endif
@@ -2545,20 +2072,16 @@ cont:
* jump from the top of the loop to here
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
goto status_read;
else
#endif
line_status = inb(com->line_status_port) & 0x7F;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III)
- rsa_buf_status = inb(com->rsabase + rsa_srr);
-#endif /* PC98 */
}
/* modem status change? (always check before doing output) */
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
modem_status = inb(com->modem_status_port);
if (modem_status != com->last_modem_status) {
@@ -2593,30 +2116,13 @@ cont:
#endif
/* output queued and everything ready? */
-#ifndef PC98
if (line_status & LSR_TXRDY
&& com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
-#else
- if (((com->pc98_if_type == COM_IF_RSA98III)
- ? (rsa_buf_status & 0x02)
- : (line_status & LSR_TXRDY))
- && com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
-#endif
ioptr = com->obufq.l_head;
if (com->tx_fifo_size > 1) {
u_int ocount;
ocount = com->obufq.l_tail - ioptr;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- rsa_buf_status = inb(com->rsabase + rsa_srr);
- rsa_tx_fifo_size = 1024;
- if (!(rsa_buf_status & 0x01))
- rsa_tx_fifo_size = 2048;
- if (ocount > rsa_tx_fifo_size)
- ocount = rsa_tx_fifo_size;
- } else
-#endif
if (ocount > com->tx_fifo_size)
ocount = com->tx_fifo_size;
com->bytes_out += ocount;
@@ -2628,8 +2134,8 @@ cont:
++com->bytes_out;
}
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- if (!(pc98_check_i8251_interrupt(com) & IEN_TxFLAG))
+ if(IS_8251(com->pc98_if_type))
+ if ( !(pc98_check_i8251_interrupt(com) & IEN_TxFLAG) )
com_int_Tx_enable(com);
#endif
com->obufq.l_head = ioptr;
@@ -2653,9 +2159,9 @@ cont:
}
com->state &= ~CS_BUSY;
#if defined(PC98)
- if (IS_8251(com->pc98_if_type))
- if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
- com_int_Tx_disable(com);
+ if(IS_8251(com->pc98_if_type))
+ if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
+ com_int_Tx_disable(com);
#endif
}
if (!(com->state & CS_ODONE)) {
@@ -2665,29 +2171,24 @@ cont:
}
}
if ( COM_IIR_TXRDYBUG(com) && (int_ctl != int_ctl_new)) {
- if (com->pc98_if_type == COM_IF_RSA98III) {
- int_ctl_new &= ~(IER_ETXRDY | IER_ERXRDY);
- outb(com->intr_ctl_port, int_ctl_new);
- outb(com->rsabase + rsa_ier, 0x1d);
- } else
outb(com->intr_ctl_port, int_ctl_new);
}
}
#ifdef PC98
else if (line_status & LSR_TXRDY) {
- if (IS_8251(com->pc98_if_type))
- if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
- com_int_Tx_disable(com);
+ if(IS_8251(com->pc98_if_type))
+ if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
+ com_int_Tx_disable(com);
}
- if (IS_8251(com->pc98_if_type))
- if ((tmp = inb(com->sts_port)) & STS8251_RxRDY)
- goto more_intr;
+ if(IS_8251(com->pc98_if_type))
+ if ((tmp = inb(com->sts_port)) & STS8251_RxRDY)
+ goto more_intr;
#endif
/* finished? */
#ifndef COM_MULTIPORT
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
return;
#endif
if ((inb(com->int_id_port) & IIR_IMASK) == IIR_NOPEND)
@@ -2749,6 +2250,34 @@ sioioctl(dev, cmd, data, flag, p)
case TIOCGWINSZ:
bzero(data, sizeof(struct winsize));
return (0);
+#ifdef DSI_SOFT_MODEM
+ /*
+ * Download micro-code to Digicom modem.
+ */
+ case TIOCDSIMICROCODE:
+ {
+ u_long l;
+ u_char *p,*pi;
+
+ pi = (u_char*)(*(caddr_t*)data);
+ error = copyin(pi,&l,sizeof l);
+ if(error)
+ {return error;};
+ pi += sizeof l;
+
+ p = malloc(l,M_TEMP,M_NOWAIT);
+ if(!p)
+ {return ENOBUFS;}
+ error = copyin(pi,p,l);
+ if(error)
+ {free(p,M_TEMP); return error;};
+ if(error = LoadSoftModem(
+ MINOR_TO_UNIT(mynor),iobase,l,p))
+ {free(p,M_TEMP); return error;}
+ free(p,M_TEMP);
+ return(0);
+ }
+#endif /* DSI_SOFT_MODEM */
default:
return (ENOTTY);
}
@@ -2796,7 +2325,7 @@ sioioctl(dev, cmd, data, flag, p)
return (error);
}
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
switch (cmd) {
case TIOCSBRK:
com_send_break_on( com );
@@ -2851,25 +2380,13 @@ sioioctl(dev, cmd, data, flag, p)
return (ENOTTY);
}
} else {
- int port_shift;
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
#endif
switch (cmd) {
case TIOCSBRK:
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image |= CFCR_SBREAK);
-#else
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
-#endif
break;
case TIOCCBRK:
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image &= ~CFCR_SBREAK);
-#else
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#endif
break;
case TIOCSDTR:
(void)commctl(com, TIOCM_DTR, DMBIS);
@@ -2976,13 +2493,8 @@ repeat:
ibuf = com->ibuf2;
else
ibuf = com->ibuf1;
-#ifndef PC98
com->ibufend = ibuf + RS_IBUFSIZE;
com->ihighwater = ibuf + RS_IHIGHWATER;
-#else
- com->ibufend = ibuf + com->CE_INPUT_OFFSET;
- com->ihighwater = ibuf + (3 * com->CE_INPUT_OFFSET / 4);
-#endif
com->iptr = ibuf;
/*
@@ -2991,7 +2503,7 @@ repeat:
* there is room in the high-level buffer.
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3004,7 +2516,7 @@ repeat:
#endif
&& !(tp->t_state & TS_TBLOCK))
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3018,7 +2530,7 @@ repeat:
u_char delta_modem_status;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
disable_intr();
delta_modem_status = com->last_modem_status
@@ -3080,11 +2592,7 @@ repeat:
u_char line_status;
int recv_data;
-#ifndef PC98
line_status = (u_char) buf[CE_INPUT_OFFSET];
-#else
- line_status = (u_char) buf[com->CE_INPUT_OFFSET];
-#endif
recv_data = (u_char) *buf++;
if (line_status
& (LSR_BI | LSR_FE | LSR_OE | LSR_PE)) {
@@ -3118,14 +2626,14 @@ comparam(tp, t)
int divisor;
u_char dlbh;
u_char dlbl;
+ int error;
Port_t iobase;
int s;
int unit;
+ int txtimeout;
#ifdef PC98
Port_t tmp_port;
int tmp_flg;
- int port_shift = 0;
- u_char param = 0;
#endif
#ifdef PC98
@@ -3133,27 +2641,16 @@ comparam(tp, t)
unit = DEV_TO_UNIT(tp->t_dev);
com = com_addr(unit);
iobase = com->iobase;
- if (IS_8251(com->pc98_if_type)) {
- divisor = pc98_ttspeedtab(com, t->c_ospeed);
- } else {
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-
- /* do historical conversions */
- if (t->c_ispeed == 0)
- t->c_ispeed = t->c_ospeed;
-
- /* check requested parameters */
- divisor = ttspeedtab(t->c_ospeed,
- if_16550a_type[com->pc98_if_type & 0x0f].speedtab);
- }
-#else
+ if(IS_8251(com->pc98_if_type)) {
+ divisor = pc98_ttspeedtab(com, t->c_ospeed);
+ } else
+#endif
/* do historical conversions */
if (t->c_ispeed == 0)
t->c_ispeed = t->c_ospeed;
/* check requested parameters */
divisor = ttspeedtab(t->c_ospeed, comspeedtab);
-#endif
if (divisor < 0 || divisor > 0 && t->c_ispeed != t->c_ospeed)
return (EINVAL);
@@ -3165,8 +2662,8 @@ comparam(tp, t)
#endif
s = spltty();
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- if (divisor == 0)
+ if(IS_8251(com->pc98_if_type)){
+ if(divisor == 0)
com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
else
com_tiocm_bis( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
@@ -3181,7 +2678,7 @@ comparam(tp, t)
#endif
cflag = t->c_cflag;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
switch (cflag & CSIZE) {
case CS5:
@@ -3225,29 +2722,80 @@ comparam(tp, t)
if (com->esp)
com->fifo_image |= FIFO_DMA_MODE;
#endif
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), com->fifo_image);
-#else
outb(iobase + com_fifo, com->fifo_image);
-#endif
}
+
+ /*
+ * Some UARTs lock up if the divisor latch registers are selected
+ * while the UART is doing output (they refuse to transmit anything
+ * more until given a hard reset). Fix this by stopping filling
+ * the device buffers and waiting for them to drain. Reading the
+ * line status port outside of siointr1() might lose some receiver
+ * error bits, but that is acceptable here.
+ */
#ifdef PC98
}
#endif
+ disable_intr();
+retry:
+ com->state &= ~CS_TTGO;
+ txtimeout = tp->t_timeout;
+ enable_intr();
+#ifdef PC98
+ if(IS_8251(com->pc98_if_type)){
+ tmp_port = com->sts_port;
+ tmp_flg = (STS8251_TxRDY|STS8251_TxEMP);
+ } else {
+ tmp_port = com->line_status_port;
+ tmp_flg = (LSR_TSRE|LSR_TXRDY);
+ }
+ while ((inb(tmp_port) & tmp_flg) != tmp_flg) {
+#else
+ while ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY)) {
+#endif
+ tp->t_state |= TS_SO_OCOMPLETE;
+ error = ttysleep(tp, TSA_OCOMPLETE(tp), TTIPRI | PCATCH,
+ "siotx", hz / 100);
+ if ( txtimeout != 0
+ && (!error || error == EAGAIN)
+ && (txtimeout -= hz / 100) <= 0
+ )
+ error = EIO;
+ if (com->gone)
+ error = ENODEV;
+ if (error != 0 && error != EAGAIN) {
+ if (!(tp->t_state & TS_TTSTOP)) {
+ disable_intr();
+ com->state |= CS_TTGO;
+ enable_intr();
+ }
+ splx(s);
+ return (error);
+ }
+ }
- disable_intr(); /* very important while com_data is hidden */
+ disable_intr(); /* very important while com_data is hidden */
+ /*
+ * XXX - clearing CS_TTGO is not sufficient to stop further output,
+ * because siopoll() calls comstart() which usually sets it again
+ * because TS_TTSTOP is clear. Setting TS_TTSTOP would not be
+ * sufficient, for similar reasons.
+ */
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_cflag_and_speed_set(com, cflag, t->c_ospeed);
- else {
+ if ((inb(tmp_port) & tmp_flg) != tmp_flg)
+#else
+ if ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY))
#endif
- if (divisor != 0) {
+ goto retry;
+
#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), cfcr | CFCR_DLAB);
-#else
- outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
+ if(!IS_8251(com->pc98_if_type)){
#endif
+ if (divisor != 0) {
+ outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
/*
* Only set the divisor registers if they would change,
* since on some 16550 incompatibles (UMC8669F), setting
@@ -3255,29 +2803,20 @@ comparam(tp, t)
* data stops arriving.
*/
dlbl = divisor & 0xFF;
-#ifdef PC98
- if (inb(iobase + (com_dlbl << port_shift)) != dlbl)
- outb(iobase + (com_dlbl << port_shift), dlbl);
- dlbh = (u_int) divisor >> 8;
- if (inb(iobase + (com_dlbh << port_shift)) != dlbh)
- outb(iobase + (com_dlbh << port_shift), dlbh);
-#else
if (inb(iobase + com_dlbl) != dlbl)
outb(iobase + com_dlbl, dlbl);
dlbh = (u_int) divisor >> 8;
if (inb(iobase + com_dlbh) != dlbh)
outb(iobase + com_dlbh, dlbh);
-#endif
}
-#ifdef PC98
- }
- outb(iobase + (com_cfcr << port_shift), com->cfcr_image = cfcr);
-#else
outb(iobase + com_cfcr, com->cfcr_image = cfcr);
-#endif
+#ifdef PC98
+ } else
+ com_cflag_and_speed_set(com, cflag, t->c_ospeed);
+#endif
if (!(tp->t_state & TS_TTSTOP))
com->state |= CS_TTGO;
@@ -3300,7 +2839,7 @@ comparam(tp, t)
* on here, since comstart() won't do it later.
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3319,26 +2858,14 @@ comparam(tp, t)
*/
com->state |= CS_ODEVREADY;
com->state &= ~CS_CTS_OFLOW;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- param = inb(com->rsabase + rsa_msr);
- outb(com->rsabase + rsa_msr, param & 0x14);
- }
-#endif
if (cflag & CCTS_OFLOW) {
com->state |= CS_CTS_OFLOW;
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
if (!(pc98_get_modem_status(com) & TIOCM_CTS))
com->state &= ~CS_ODEVREADY;
} else {
#endif
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- /* Set automatic flow control mode */
- outb(com->rsabase + rsa_msr, param | 0x08);
- } else
-#endif
if (!(com->last_modem_status & MSR_CTS))
com->state &= ~CS_ODEVREADY;
if (com->st16650a) {
@@ -3356,11 +2883,7 @@ comparam(tp, t)
}
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), com->cfcr_image);
-#else
outb(iobase + com_cfcr, com->cfcr_image);
-#endif
/* XXX shouldn't call functions while intrs are disabled. */
@@ -3400,7 +2923,7 @@ comstart(tp)
com->state |= CS_TTGO;
if (tp->t_state & TS_TBLOCK) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3409,14 +2932,14 @@ comstart(tp)
if (com->mcr_image & MCR_RTS && com->state & CS_RTS_IFLOW)
#endif
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_RTS);
else
#endif
outb(com->modem_ctl_port, com->mcr_image &= ~MCR_RTS);
} else {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3427,7 +2950,7 @@ comstart(tp)
&& com->state & CS_RTS_IFLOW)
#endif
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3450,11 +2973,7 @@ comstart(tp)
if (!com->obufs[0].l_queued) {
com->obufs[0].l_tail
= com->obuf1 + q_to_b(&tp->t_outq, com->obuf1,
-#ifndef PC98
sizeof com->obuf1);
-#else
- com->CE_INPUT_OFFSET);
-#endif
com->obufs[0].l_next = NULL;
com->obufs[0].l_queued = TRUE;
disable_intr();
@@ -3474,11 +2993,7 @@ comstart(tp)
if (tp->t_outq.c_cc != 0 && !com->obufs[1].l_queued) {
com->obufs[1].l_tail
= com->obuf2 + q_to_b(&tp->t_outq, com->obuf2,
-#ifndef PC98
sizeof com->obuf2);
-#else
- com->CE_INPUT_OFFSET);
-#endif
com->obufs[1].l_next = NULL;
com->obufs[1].l_queued = TRUE;
disable_intr();
@@ -3515,18 +3030,10 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
-#ifdef PC98
- int port_shift = 0;
- int rsa98_tmp = 0;
-#endif
com = com_addr(DEV_TO_UNIT(tp->t_dev));
if (com->gone)
return;
-#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-#endif
disable_intr();
if (rw & FWRITE) {
if (com->hasfifo)
@@ -3534,17 +3041,9 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
-#ifdef PC98
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_XMT_RST | com->fifo_image);
- if (com->pc98_if_type == COM_IF_RSA98III)
- for(rsa98_tmp = 0; rsa98_tmp < 2048; rsa98_tmp++)
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_XMT_RST | com->fifo_image);
-#else
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_XMT_RST | com->fifo_image);
-#endif
com->obufs[0].l_queued = FALSE;
com->obufs[1].l_queued = FALSE;
if (com->state & CS_ODONE)
@@ -3558,17 +3057,9 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- for(rsa98_tmp = 0; rsa98_tmp < 2048; rsa98_tmp++)
- inb(com->data_port);
- }
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_RCV_RST | com->fifo_image);
-#else
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_RCV_RST | com->fifo_image);
-#endif
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
@@ -3815,18 +3306,6 @@ static void siocnclose __P((struct siocnstate *sp));
static void siocnopen __P((struct siocnstate *sp));
static void siocntxwait __P((void));
-/*
- * XXX: sciocnget() and sciocnputc() are not declared static, as they are
- * referred to from i386/i386/i386-gdbstub.c.
- */
-static cn_probe_t siocnprobe;
-static cn_init_t siocninit;
-static cn_checkc_t siocncheckc;
- cn_getc_t siocngetc;
- cn_putc_t siocnputc;
-
-CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
-
static void
siocntxwait()
{
@@ -3948,7 +3427,7 @@ siocnclose(sp)
outb(iobase + com_ier, sp->ier);
}
-static void
+void
siocnprobe(cp)
struct consdev *cp;
{
@@ -4014,14 +3493,14 @@ siocnprobe(cp)
}
}
-static void
+void
siocninit(cp)
struct consdev *cp;
{
comconsole = DEV_TO_UNIT(cp->cn_dev);
}
-static int
+int
siocncheckc(dev)
dev_t dev;
{
@@ -4079,6 +3558,126 @@ siocnputc(dev, c)
splx(s);
}
+#ifdef DSI_SOFT_MODEM
+/*
+ * The magic code to download microcode to a "Connection 14.4+Fax"
+ * modem from Digicom Systems Inc. Very magic.
+ */
+
+#define DSI_ERROR(str) { ptr = str; goto error; }
+static int
+LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr)
+{
+ int int_c,int_k;
+ int data_0188, data_0187;
+
+ /*
+ * First see if it is a DSI SoftModem
+ */
+ if(!((inb(base_io+7) ^ inb(base_io+7)) & 0x80))
+ return ENODEV;
+
+ data_0188 = inb(base_io+4);
+ data_0187 = inb(base_io+3);
+ outb(base_io+3,0x80);
+ outb(base_io+4,0x0C);
+ outb(base_io+0,0x31);
+ outb(base_io+1,0x8C);
+ outb(base_io+7,0x10);
+ outb(base_io+7,0x19);
+
+ if(0x18 != (inb(base_io+7) & 0x1A))
+ DSI_ERROR("dsp bus not granted");
+
+ if(0x01 != (inb(base_io+7) & 0x01)) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x01 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program mem not granted");
+ }
+
+ int_c = 0;
+
+ while(1) {
+ if(int_c >= 7 || size <= 0x1800)
+ break;
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+ int_c++;
+ }
+
+ if(size > 0x1800) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+
+ while(size > 0x1800) {
+ for(int_k = 0 ; int_k < 0xC00; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ size -= 0x1800;
+ }
+
+ if(size < 0x1800) {
+ for(int_k=0;int_k<size/2;int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+
+ } else if (size > 0) {
+ if(int_c == 7) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ } else {
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+ }
+ outb(base_io+7,0x11);
+ outb(base_io+7,3);
+
+ outb(base_io+4,data_0188 & 0xfb);
+
+ outb(base_io+3,data_0187);
+
+ return 0;
+error:
+ printf("sio%d: DSI SoftModem microcode load failed: <%s>\n",unit,ptr);
+ outb(base_io+7,0x00); \
+ outb(base_io+3,data_0187); \
+ outb(base_io+4,data_0188); \
+ return EIO;
+}
+#endif /* DSI_SOFT_MODEM */
/*
* support PnP cards if we are using 'em
@@ -4156,7 +3755,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = siointr;
+ dev->id_intr = siointr;
dev->id_ri_flags = RI_FAST;
dev->id_drq = -1;
@@ -4173,7 +3772,6 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
printf("sio%d: probe failed\n", dev->id_unit);
}
#endif
-
#ifdef PC98
/*
* pc98 local function
@@ -4497,10 +4095,12 @@ com_cflag_and_speed_set( struct com_s *com, int cflag, int speed)
cfcr |= MOD8251_CLKX16;
if (epson_machine_id != 0x20) { /* XXX */
+ {
int tmp;
while (!((tmp = inb(com->sts_port)) & STS8251_TxEMP))
;
}
+ }
/* set baud rate from ospeed */
pc98_set_baud_rate( com, count );
@@ -4513,214 +4113,206 @@ com_cflag_and_speed_set( struct com_s *com, int cflag, int speed)
static int
pc98_ttspeedtab(struct com_s *com, int speed)
{
- int if_type, effect_sp, count = -1, mod;
-
- if_type = com->pc98_if_type & 0x0f;
-
- switch (com->pc98_if_type) {
- case COM_IF_INTERNAL:
- if (PC98SIO_baud_rate_port(if_type) != -1) {
- count = ttspeedtab(speed, if_8251_type[if_type].speedtab);
- if (count > 0) {
- count |= COM1_EXT_CLOCK;
- break;
- }
- }
-
- /* for *1CLK asynchronous! mode, TEFUTEFU */
- mod = (sysclock == 5) ? 2457600 : 1996800;
- effect_sp = ttspeedtab( speed, pc98speedtab );
- if ( effect_sp < 0 ) /* XXX */
- effect_sp = ttspeedtab( (speed - 1), pc98speedtab );
- if ( effect_sp <= 0 )
- return effect_sp;
- if ( effect_sp == speed )
- mod /= 16;
- if ( mod % effect_sp )
- return(-1);
- count = mod / effect_sp;
- if ( count > 65535 )
- return(-1);
- if ( effect_sp != speed )
- count |= 0x10000;
- break;
- case COM_IF_PC9861K_1:
- case COM_IF_PC9861K_2:
- count = 1;
- break;
- case COM_IF_IND_SS_1:
- case COM_IF_IND_SS_2:
- case COM_IF_PIO9032B_1:
- case COM_IF_PIO9032B_2:
- if ( speed == 0 ) return 0;
- count = ttspeedtab( speed, if_8251_type[if_type].speedtab );
- break;
- case COM_IF_B98_01_1:
- case COM_IF_B98_01_2:
- if ( speed == 0 ) return 0;
- count = ttspeedtab( speed, if_8251_type[if_type].speedtab );
-#ifdef B98_01_OLD
- if (count == 0 || count == 1) {
- count += 4;
- count |= 0x20000; /* x1 mode for 76800 and 153600 */
- }
+ int effect_sp, count=-1, mod;
+
+ switch ( com->pc98_if_type ) {
+ case COM_IF_INTERNAL:
+ /* for *1CLK asynchronous! mode , TEFUTEFU */
+ effect_sp = ttspeedtab( speed, pc98speedtab );
+ if ( effect_sp < 0 )
+ effect_sp = ttspeedtab( (speed-1), pc98speedtab );
+ if ( effect_sp <= 0 )
+ return effect_sp;
+ mod = (sysclock == 5 ? 2457600 : 1996800);
+ if ( effect_sp == speed )
+ mod /= 16;
+ count = mod / effect_sp;
+ if ( count > 65535 )
+ return(-1);
+ if ( effect_sp >= 2400 )
+ if ( !(sysclock != 5 &&
+ (effect_sp == 19200 || effect_sp == 38400)) )
+ if ( ( mod % effect_sp ) != 0 )
+ return(-1);
+ if ( effect_sp != speed )
+ count |= 0x10000;
+ break;
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ effect_sp = speed;
+ count = 1;
+ break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ if ( speed == 0 ) return 0;
+ count = ttspeedtab( speed, comspeedtab_pio9032b );
+ if ( count < 0 ) return count;
+ effect_sp = speed;
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ effect_sp=speed;
+ count = ttspeedtab( speed, comspeedtab_b98_01 );
+ if ( count <= 3 )
+ return -1; /* invalid speed/count */
+ if ( count <= 5 )
+ count |= 0x10000; /* x1 mode for 76800 and 153600 */
+ else
+ count -= 4; /* x16 mode for slower */
+ break;
#endif
- break;
}
-
return count;
}
static void
-pc98_set_baud_rate( struct com_s *com, int count )
+pc98_set_baud_rate( struct com_s *com, int count)
{
- int if_type, io, s;
-
- if_type = com->pc98_if_type & 0x0f;
- io = com->iobase & 0xff00;
-
- switch (com->pc98_if_type) {
- case COM_IF_INTERNAL:
- if (PC98SIO_baud_rate_port(if_type) != -1) {
- if (count & COM1_EXT_CLOCK) {
- outb((Port_t)PC98SIO_baud_rate_port(if_type), count & 0xff);
- break;
- } else {
- outb((Port_t)PC98SIO_baud_rate_port(if_type), 0x09);
- }
- }
+ int s;
- if ( count < 0 ) {
- printf( "[ Illegal count : %d ]", count );
- return;
- } else if ( count == 0 )
- return;
- /* set i8253 */
- s = splclock();
- if (count != 3)
+ switch ( com->pc98_if_type ) {
+ case COM_IF_INTERNAL:
+ if ( count < 0 ) {
+ printf( "[ Illegal count : %d ]", count );
+ return;
+ } else if ( count == 0)
+ return;
+ /* set i8253 */
+ s = splclock();
outb( 0x77, 0xb6 );
- else
- outb( 0x77, 0xb4 );
- outb( 0x5f, 0);
- outb( 0x75, count & 0xff );
- outb( 0x5f, 0);
- outb( 0x75, (count >> 8) & 0xff );
- splx(s);
- break;
- case COM_IF_IND_SS_1:
- case COM_IF_IND_SS_2:
- outb(io | PC98SIO_intr_ctrl_port(if_type), 0);
- outb(io | PC98SIO_baud_rate_port(if_type), 0);
- outb(io | PC98SIO_baud_rate_port(if_type), 0xc0);
- outb(io | PC98SIO_baud_rate_port(if_type), (count >> 8) | 0x80);
- outb(io | PC98SIO_baud_rate_port(if_type), count & 0xff);
- break;
- case COM_IF_PIO9032B_1:
- case COM_IF_PIO9032B_2:
- outb(io | PC98SIO_baud_rate_port(if_type), count);
- break;
- case COM_IF_B98_01_1:
- case COM_IF_B98_01_2:
- outb(io | PC98SIO_baud_rate_port(if_type), count & 0x0f);
+ outb( 0x5f, 0);
+ outb( 0x75, count & 0xff );
+ outb( 0x5f, 0);
+ outb( 0x75, (count >> 8) & 0xff );
+ splx(s);
+ break;
+#if 0
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ break;
+ /* ext. RS232C board: speed is determined by DIP switch */
+#endif
+#endif /* 0 */
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ outb( com_addr[unit], count & 0x07 );
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ outb( com->iobase, count & 0x0f );
#ifdef B98_01_OLD
- /*
- * Some old B98_01 board should be controlled
- * in different way, but this hasn't been tested yet.
- */
- outb(io | PC98SIO_func_port(if_type),
- (count & 0x20000) ? 0xf0 : 0xf2);
+ /* some old board should be controlled in different way,
+ but this hasn't been tested yet.*/
+ outb( com->iobase+2, ( count & 0x10000 ) ? 0xf0 : 0xf2 );
+#endif
+ break;
#endif
- break;
}
}
static int
-pc98_check_if_type(struct isa_device *dev, struct siodev *iod)
+pc98_check_if_type( int iobase, struct siodev *iod)
{
- int irr, io, if_type, tmp;
+ int irr = 0, tmp = 0;
+ int ret = 0;
static short irq_tab[2][8] = {
{ 3, 5, 6, 9, 10, 12, 13, -1},
{ 3, 10, 12, 13, 5, 6, 9, -1}
};
-
- iod->if_type = if_type = (dev->id_flags >> 24) & 0xff;
- if ((if_type < 0 || if_type > COM_IF_END1) &&
- (if_type < 0x10 || if_type > COM_IF_END2))
- return(-1);
- if_type &= 0x0f;
iod->irq = 0;
- io = dev->id_iobase & 0xff00;
-
- if (IS_8251(iod->if_type)) {
- if (PC98SIO_func_port(if_type) != -1) {
- outb(io | PC98SIO_func_port(if_type), 0xf2);
- tmp = ttspeedtab(9600, if_8251_type[if_type].speedtab);
- if (tmp != -1 && PC98SIO_baud_rate_port(if_type) != -1)
- outb(io | PC98SIO_baud_rate_port(if_type), tmp);
- }
-
- iod->cmd = io | PC98SIO_cmd_port(if_type);
- iod->sts = io | PC98SIO_sts_port(if_type);
- iod->mod = io | PC98SIO_in_modem_port(if_type);
- iod->ctrl = io | PC98SIO_intr_ctrl_port(if_type);
-
- if (iod->if_type == COM_IF_INTERNAL) {
- iod->irq = 4;
-
- /* XXX check new internal port. */
- outb(0x138, 0);
- DELAY(10);
- for (tmp = 0; tmp < 100; tmp++) {
- if ((inb(0x138) & 1) == 0) {
- PC98SIO_baud_rate_port(if_type) = 0x13a;
- if_8251_type[if_type].name = " (internal fast)";
- if_8251_type[if_type].speedtab = pc98fast_speedtab;
+ switch ( iobase & 0xff ) {
+ case IO_COM1:
+ iod->if_type = COM_IF_INTERNAL;
+ ret = 0; iod->irq = 4; break;
+#ifdef COM_IF_PC9861K
+ case IO_COM2:
+ iod->if_type = COM_IF_PC9861K;
+ ret = 1; irr = 0; tmp = 3; break;
+ case IO_COM3:
+ iod->if_type = COM_IF_PC9861K;
+ ret = 2; irr = 1; tmp = 3; break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case IO_COM_PIO9032B_2:
+ iod->if_type = COM_IF_PIO9032B;
+ ret = 1; irr = 0; tmp = 7; break;
+ case IO_COM_PIO9032B_3:
+ iod->if_type = COM_IF_PIO9032B;
+ ret = 2; irr = 1; tmp = 7; break;
+#endif
+#ifdef COM_IF_B98_01
+ case IO_COM_B98_01_2:
+ iod->if_type = COM_IF_B98_01;
+ ret = 1; irr = 0; tmp = 7;
+ outb(iobase + 2, 0xf2);
+ outb(iobase, 4);
+ break;
+ case IO_COM_B98_01_3:
+ iod->if_type = COM_IF_B98_01;
+ ret = 2; irr = 1; tmp = 7;
+ outb(iobase + 2, 0xf2);
+ outb(iobase , 4);
break;
- }
- DELAY(1);
- }
- } else {
- tmp = inb( iod->mod ) & if_8251_type[if_type].irr_mask;
- if ((dev->id_iobase & 0xff) == IO_COM2)
- iod->irq = irq_tab[0][tmp];
- else
- iod->irq = irq_tab[1][tmp];
- }
- } else {
- irr = if_16550a_type[if_type].irr_read;
-#ifdef COM_MULTIPORT
- if (!COM_ISMULTIPORT(dev) || dev->id_unit == COM_MPMASTER(dev))
#endif
- if (irr != -1) {
- tmp = inb(io | irr);
- if (dev->id_iobase & 0x01) /* XXX depend on RSB-384 */
- iod->irq = irq_tab[1][tmp >> 3];
- else
- iod->irq = irq_tab[0][tmp & 0x07];
- }
+ default:
+ if((iobase & 0x0f0) == 0xd0){
+ iod->if_type = MC16550;
+ return 0;
+ }
+ return -1;
}
- if ( iod->irq == -1 ) return -1;
+ iod->cmd = ( iobase & 0xff00 )|PC98SIO_cmd_port(ret);
+ iod->sts = ( iobase & 0xff00 )|PC98SIO_sts_port(ret);
+ iod->mod = ( iobase & 0xff00 )|PC98SIO_in_modem_port(ret);
+ iod->ctrl = ( iobase & 0xff00 )|PC98SIO_intr_ctrl_port(ret);
+
+ if ( iod->irq == 0 ) {
+ tmp &= inb( iod->mod );
+ iod->irq = irq_tab[irr][tmp];
+ if ( iod->irq == -1 ) return -1;
+ }
return 0;
}
static int
-pc98_set_ioport( struct com_s *com, int id_flags )
+pc98_set_ioport( struct com_s *com, int io_base )
{
- int io, if_type;
-
- if_type = (id_flags >> 24) & 0xff;
- if (IS_8251(if_type)) {
- pc98_check_sysclock();
- io = com->iobase & 0xff00;
- com->pc98_if_type = if_type;
- if_type &= 0x0f;
- com->data_port = io | PC98SIO_data_port(if_type);
- com->cmd_port = io | PC98SIO_cmd_port(if_type);
- com->sts_port = io | PC98SIO_sts_port(if_type);
- com->in_modem_port = io | PC98SIO_in_modem_port(if_type);
- com->intr_ctrl_port = io | PC98SIO_intr_ctrl_port(if_type);
- return 0;
+ int a, io, type;
+
+ switch ( io_base & 0xff ) {
+ case IO_COM1: a = 0; io = 0; type = COM_IF_INTERNAL;
+ pc98_check_sysclock(); break;
+#ifdef COM_IF_PC9861K
+ case IO_COM2: a = 1; io = 0; type = COM_IF_PC9861K; break;
+ case IO_COM3: a = 2; io = 0; type = COM_IF_PC9861K; break;
+#endif /* COM_IF_PC9861K */
+#ifdef COM_IF_PIO9032B
+ /* PIO9032B : I/O address is changeable */
+ case IO_COM_PIO9032B_2:
+ a = 1; io = io_base & 0xff00;
+ type = COM_IF_PIO9032B; break;
+ case IO_COM_PIO9032B_3:
+ a = 2; io = io_base & 0xff00;
+ type = COM_IF_PIO9032B; break;
+#endif /* COM_IF_PIO9032B */
+#ifdef COM_IF_B98_01
+ case IO_COM_B98_01_2:
+ a = 1; io = 0; type = COM_IF_B98_01; break;
+ case IO_COM_B98_01_3:
+ a = 2; io = 0; type = COM_IF_B98_01; break;
+#endif /* COM_IF_B98_01*/
+ default: /* i/o address not match */
+ return -1;
}
- return -1;
+ com->pc98_if_type = type;
+ com->data_port = io | PC98SIO_data_port(a);
+ com->cmd_port = io | PC98SIO_cmd_port(a);
+ com->sts_port = io | PC98SIO_sts_port(a);
+ com->in_modem_port = io | PC98SIO_in_modem_port(a);
+ com->intr_ctrl_port = io | PC98SIO_intr_ctrl_port(a);
+ return 0;
}
#endif /* PC98 defined */
diff --git a/sys/pc98/pc98/sioreg.h b/sys/pc98/pc98/sioreg.h
new file mode 100644
index 000000000000..840df10841be
--- /dev/null
+++ b/sys/pc98/pc98/sioreg.h
@@ -0,0 +1,119 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ * from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
+ * $Id: sioreg.h,v 1.6 1997/06/04 10:27:53 kato Exp $
+ */
+
+
+/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
+#if defined(PC98)
+#define COMBRD(x) (7372800 / (16*(x)))
+#else
+#define COMBRD(x) (1843200 / (16*(x)))
+#endif
+
+/* interrupt enable register */
+#define IER_ERXRDY 0x1
+#define IER_ETXRDY 0x2
+#define IER_ERLS 0x4
+#define IER_EMSC 0x8
+
+/* interrupt identification register */
+#define IIR_IMASK 0xf
+#define IIR_RXTOUT 0xc
+#define IIR_RLS 0x6
+#define IIR_RXRDY 0x4
+#define IIR_TXRDY 0x2
+#define IIR_NOPEND 0x1
+#define IIR_MLSC 0x0
+#define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
+
+/* fifo control register */
+#define FIFO_ENABLE 0x01
+#define FIFO_RCV_RST 0x02
+#define FIFO_XMT_RST 0x04
+#define FIFO_DMA_MODE 0x08
+#define FIFO_RX_LOW 0x00
+#define FIFO_RX_MEDL 0x40
+#define FIFO_RX_MEDH 0x80
+#define FIFO_RX_HIGH 0xc0
+
+/* character format control register */
+#define CFCR_DLAB 0x80
+#define CFCR_SBREAK 0x40
+#define CFCR_PZERO 0x30
+#define CFCR_PONE 0x20
+#define CFCR_PEVEN 0x10
+#define CFCR_PODD 0x00
+#define CFCR_PENAB 0x08
+#define CFCR_STOPB 0x04
+#define CFCR_8BITS 0x03
+#define CFCR_7BITS 0x02
+#define CFCR_6BITS 0x01
+#define CFCR_5BITS 0x00
+
+/* modem control register */
+#define MCR_LOOPBACK 0x10
+#define MCR_IENABLE 0x08
+#define MCR_DRS 0x04
+#define MCR_RTS 0x02
+#define MCR_DTR 0x01
+
+/* line status register */
+#define LSR_RCV_FIFO 0x80
+#define LSR_TSRE 0x40
+#define LSR_TXRDY 0x20
+#define LSR_BI 0x10
+#define LSR_FE 0x08
+#define LSR_PE 0x04
+#define LSR_OE 0x02
+#define LSR_RXRDY 0x01
+#define LSR_RCV_MASK 0x1f
+
+/* modem status register */
+#define MSR_DCD 0x80
+#define MSR_RI 0x40
+#define MSR_DSR 0x20
+#define MSR_CTS 0x10
+#define MSR_DDCD 0x08
+#define MSR_TERI 0x04
+#define MSR_DDSR 0x02
+#define MSR_DCTS 0x01
+
+/* speed to initialize to during chip tests */
+#define SIO_TEST_SPEED 9600
+
+/* default serial console speed if not set with sysctl or probed from boot */
+#ifndef CONSPEED
+#define CONSPEED 9600
+#endif
diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c
index bfce06877b62..e85a1b317454 100644
--- a/sys/pc98/pc98/syscons.c
+++ b/sys/pc98/pc98/syscons.c
@@ -1,18 +1,18 @@
/*-
- * Copyright (c) 1992-1998 Sen Schmidt
+ * Copyright (c) 1992-1995 Sen Schmidt
* 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, immediately at the beginning of the file.
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
* 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.
+ * derived from this software withough 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
@@ -25,16 +25,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.108 1999/01/18 14:48:34 kato Exp $
+ * $Id: syscons.c,v 1.100 1998/08/28 12:45:43 kato Exp $
*/
#include "sc.h"
-#include "splash.h"
#include "apm.h"
#include "opt_ddb.h"
#include "opt_devfs.h"
-#include "opt_vesa.h"
-#include "opt_vm86.h"
#include "opt_syscons.h"
#if NSC > 0
@@ -60,33 +57,36 @@
#include <machine/psl.h>
#include <machine/frame.h>
#include <machine/pc/display.h>
-#include <machine/pc/vesa.h>
#include <machine/apm_bios.h>
#include <machine/random.h>
+#include <machine/bootinfo.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
-#include <dev/kbd/kbdreg.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
#ifdef PC98
#define KANJI
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/pc98_machdep.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
#include <pc98/pc98/syscons.h>
#else
-#include <dev/fb/vgareg.h>
-#include <dev/syscons/syscons.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
+#include <i386/isa/syscons.h>
#endif /* PC98 */
+#if defined(PC98) && defined(LINE30)
+#include <pc98/pc98/30line.h>
+#endif
+
#if !defined(MAXCONS)
#define MAXCONS 16
#endif
@@ -111,6 +111,11 @@
#define COLD 0
#define WARM 1
+#define VESA_MODE(x) ((x) >= M_VESA_BASE)
+
+#define MODE_MAP_SIZE (M_VGA_CG320 + 1)
+#define MODE_PARAM_SIZE 64
+
#define DEFAULT_BLANKTIME (5*60) /* 5 minutes */
#define MAX_BLANKTIME (7*24*60*60) /* 7 days!? */
@@ -131,6 +136,9 @@ typedef struct old_mouse_info {
} u;
} old_mouse_info_t;
+/* XXX use sc_bcopy where video memory is concerned */
+extern void generic_bcopy(const void *, void *, size_t);
+
static default_attr user_default = {
(FG_LIGHTGREY | BG_BLACK) << 8,
(FG_BLACK | BG_LIGHTGREY) << 8
@@ -159,7 +167,9 @@ static void *sc_console_devfs_token;
static scr_stat *new_scp, *old_scp;
static term_stat kernel_console;
static default_attr *current_default;
-static int sc_flags;
+static int flags = 0;
+static int sc_port = IO_KBD;
+static KBDC sc_kbdc = NULL;
static char init_done = COLD;
static u_short sc_buffer[ROW*COL];
static char shutdown_in_progress = FALSE;
@@ -168,38 +178,51 @@ static char switch_in_progress = FALSE;
static char write_in_progress = FALSE;
static char blink_in_progress = FALSE;
static int blinkrate = 0;
-static int adapter = -1;
-static int keyboard = -1;
-static keyboard_t *kbd;
+#ifndef PC98
+ u_int crtc_addr = MONO_BASE;
+#endif
+ char crtc_type = KD_MONO;
+ char crtc_vga = FALSE;
+static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0;
+static u_char accents = 0;
+#ifdef PC98
+static u_char nlkcnt = 0, slkcnt = 0, alkcnt = 0;
+#else
+static u_char nlkcnt = 0, clkcnt = 0, slkcnt = 0, alkcnt = 0;
+#endif
+static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab);
static int delayed_next_scr = FALSE;
static long scrn_blank_time = 0; /* screen saver timeout value */
-static int scrn_blanked = FALSE; /* screen saver active flag */
+ int scrn_blanked = 0; /* screen saver active flag */
static long scrn_time_stamp;
static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
static int run_scrn_saver = FALSE; /* should run the saver? */
static int scrn_idle = FALSE; /* about to run the saver */
-static int scrn_saver_failed;
u_char scr_map[256];
u_char scr_rmap[256];
-static int initial_video_mode; /* initial video mode # */
+ char *video_mode_ptr = NULL;
+static int bios_video_mode; /* video mode # set by BIOS */
int fonts_loaded = 0
#ifdef STD8X16FONT
| FONT_16
#endif
;
- u_char font_8[256*8];
- u_char font_14[256*14];
+ char font_8[256*8];
+ char font_14[256*14];
#ifdef STD8X16FONT
extern
#endif
- u_char font_16[256*16];
- u_char palette[256*3];
-static u_char *cut_buffer;
+ unsigned char font_16[256*16];
+ char palette[256*3];
+static char *mode_map[MODE_MAP_SIZE];
+static char vgaregs[MODE_PARAM_SIZE];
+static char vgaregs2[MODE_PARAM_SIZE];
+static int rows_offset = 1;
+static char *cut_buffer;
static int cut_buffer_size;
-static int mouse_level; /* sysmouse protocol level */
+static int mouse_level = 0; /* sysmouse protocol level */
static mousestatus_t mouse_status = { 0, 0, 0, 0, 0, 0 };
-#ifndef PC98
static u_short mouse_and_mask[16] = {
0xc000, 0xe000, 0xf000, 0xf800,
0xfc00, 0xfe00, 0xff00, 0xff80,
@@ -212,22 +235,17 @@ static u_short mouse_or_mask[16] = {
0x0c00, 0x0c00, 0x0600, 0x0600,
0x0000, 0x0000, 0x0000, 0x0000
};
-#endif
- int sc_history_size = SC_HISTORY_SIZE;
-static int extra_history_size =
+static int extra_history_size =
SC_MAX_HISTORY_SIZE - SC_HISTORY_SIZE * MAXCONS;
static void none_saver(int blank) { }
static void (*current_saver)(int blank) = none_saver;
- d_ioctl_t *sc_user_ioctl;
+static void (*default_saver)(int blank) = none_saver;
+int (*sc_user_ioctl)(dev_t dev, int cmd, caddr_t data,
+ int flag, struct proc *p) = NULL;
static int sticky_splash = FALSE;
-static struct {
- u_int8_t cursor_start;
- u_int8_t cursor_end;
- u_int8_t shift_state;
- } bios_value;
/* OS specific stuff */
#ifdef not_yet_done
@@ -243,92 +261,81 @@ static struct tty sccons[MAXCONS+2];
#endif
#define SC_MOUSE 128
#define SC_CONSOLE 255
-u_short *Crtat;
#ifdef PC98
-u_short *Atrat;
static u_char default_kanji = UJIS;
+u_short *Crtat;
+u_short *Atrat;
+#else
+#define MONO_BUF pa_to_va(0xB0000)
+#define CGA_BUF pa_to_va(0xB8000)
+u_short *Crtat;
#endif
static const int nsccons = MAXCONS+2;
#define WRAPHIST(scp, pointer, offset)\
- ((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \
- + (offset)) % (scp)->history_size))
+ ((scp->history) + ((((pointer) - (scp->history)) + (scp->history_size)\
+ + (offset)) % (scp->history_size)))
#ifdef PC98
#define WRAPHIST_A(scp, pointer, offset)\
- ((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp)->history_size \
- + (offset)) % (scp)->history_size))
+ ((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp->history_size)\
+ + (offset)) % (scp->history_size)))
#endif
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-/* some useful macros */
-#define kbd_read_char(kbd, wait) \
- (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait))
-#define kbd_check_char(kbd) \
- (*kbdsw[(kbd)->kb_index]->check_char)((kbd))
-#define kbd_enable(kbd) \
- (*kbdsw[(kbd)->kb_index]->enable)((kbd))
-#define kbd_disable(kbd) \
- (*kbdsw[(kbd)->kb_index]->disable)((kbd))
-#define kbd_lock(kbd, lockf) \
- (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf))
-#define kbd_ioctl(kbd, cmd, arg) \
- (((kbd) == NULL) ? \
- ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg)))
-#define kbd_clear_state(kbd) \
- (*kbdsw[(kbd)->kb_index]->clear_state)((kbd))
-#define kbd_get_fkeystr(kbd, fkey, len) \
- (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len))
+/* this should really be in `rtc.h' */
+#define RTC_EQUIPMENT 0x14
/* prototypes */
static int scattach(struct isa_device *dev);
-static kbd_callback_func_t sckbdevent;
static int scparam(struct tty *tp, struct termios *t);
static int scprobe(struct isa_device *dev);
-static int scvidprobe(int unit, int flags, int cons);
-static int sckbdprobe(int unit, int flags, int cons);
+static int scvidprobe(int unit, int flags);
+static int sckbdprobe(int unit, int flags);
static void scstart(struct tty *tp);
static void scmousestart(struct tty *tp);
static void scinit(void);
static void scshutdown(int howto, void *arg);
-static u_int scgetc(keyboard_t *kbd, u_int flags);
+static void map_mode_table(char *map[], char *table, int max);
+static int map_mode_num(int mode);
+static char *get_mode_param(scr_stat *scp, int mode);
+static u_int scgetc(u_int flags);
#define SCGETC_CN 1
#define SCGETC_NONBLOCK 2
-static int sccngetch(int flags);
static void sccnupdate(scr_stat *scp);
+static scr_stat *get_scr_stat(dev_t dev);
static scr_stat *alloc_scp(void);
static void init_scp(scr_stat *scp);
-static void get_bios_values(void);
static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
static int get_scr_num(void);
static timeout_t scrn_timer;
static void scrn_update(scr_stat *scp, int show_cursor);
-#if NSPLASH > 0
-static int scsplash_callback(int);
-static void scsplash_saver(int show);
-static int add_scrn_saver(void (*this_saver)(int));
-static int remove_scrn_saver(void (*this_saver)(int));
-static int set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border);
-static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
static void stop_scrn_saver(void (*saver)(int));
static int wait_scrn_saver_stop(void);
-#define scsplash_stick(stick) (sticky_splash = (stick))
-#else
-#define scsplash_stick(stick)
-#endif /* NSPLASH */
+static void clear_screen(scr_stat *scp);
static int switch_scr(scr_stat *scp, u_int next_scr);
static void exchange_scr(void);
+static void move_crsr(scr_stat *scp, int x, int y);
static void scan_esc(scr_stat *scp, u_char c);
-static void ansi_put(scr_stat *scp, u_char *buf, int len);
static void draw_cursor_image(scr_stat *scp);
static void remove_cursor_image(scr_stat *scp);
-static void move_crsr(scr_stat *scp, int x, int y);
+static void ansi_put(scr_stat *scp, u_char *buf, int len);
+static u_char *get_fstr(u_int c, u_int *len);
static void history_to_screen(scr_stat *scp);
static int history_up_line(scr_stat *scp);
static int history_down_line(scr_stat *scp);
static int mask2attr(struct term_stat *term);
-static int save_kbd_state(scr_stat *scp);
-static int update_kbd_state(int state, int mask);
-static int update_kbd_leds(int which);
+static void set_keyboard(int command, int data);
+static void update_leds(int which);
+static void set_vgaregs(char *modetable);
+static void read_vgaregs(char *buf);
+#define COMP_IDENTICAL 0
+#define COMP_SIMILAR 1
+#define COMP_DIFFERENT 2
+static int comp_vgaregs(u_char *buf1, u_char *buf2);
+static void dump_vgaregs(u_char *buf);
+#define PARAM_BUFSIZE 6
+static void set_font_mode(u_char *buf);
+static void set_normal_mode(u_char *buf);
static void set_destructive_cursor(scr_stat *scp);
static void set_mouse_pos(scr_stat *scp);
static int skip_spc_right(scr_stat *scp, u_short *p);
@@ -344,16 +351,16 @@ static void draw_mouse_image(scr_stat *scp);
static void remove_mouse_image(scr_stat *scp);
static void draw_cutmarking(scr_stat *scp);
static void remove_cutmarking(scr_stat *scp);
+static void save_palette(void);
static void do_bell(scr_stat *scp, int pitch, int duration);
static timeout_t blink_screen;
-
-static cn_probe_t sccnprobe;
-static cn_init_t sccninit;
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-CONS_DRIVER(sc, sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc);
+#ifdef SC_SPLASH_SCREEN
+static void scsplash_init(void);
+static void scsplash(int show);
+#define scsplash_stick(stick) (sticky_splash = (stick))
+#else
+#define scsplash_stick(stick)
+#endif
struct isa_driver scdriver = {
scprobe, scattach, "sc", 1
@@ -364,6 +371,7 @@ static d_close_t scclose;
static d_read_t scread;
static d_write_t scwrite;
static d_ioctl_t scioctl;
+static d_devtotty_t scdevtotty;
static d_mmap_t scmmap;
#define CDEV_MAJOR 12
@@ -412,27 +420,31 @@ at2pc98(unsigned int attr)
}
#endif
+/*
+ * These functions need to be before calls to them so they can be inlined.
+ */
static void
draw_cursor_image(scr_stat *scp)
{
+ u_short cursor_image, *ptr;
+ u_short prev_image;
#ifdef PC98
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, scp->xpos, scp->ypos);
+ int pos = scp->cursor_pos - scp->scr_buf;
+ while((inb(TEXT_GDC + 0) & 0x04) == 0) {}
+ outb(TEXT_GDC + 2, 0x49); /* CSRW */
+ outb(TEXT_GDC + 0, pos & 0xff); /* EADl */
+ outb(TEXT_GDC + 0, pos >> 8); /* EADh */
#else
- u_short cursor_image;
- u_short *ptr;
- u_short prev_image;
+ ptr = Crtat + (scp->cursor_pos - scp->scr_buf);
- if (ISPIXELSC(scp)) {
+ if (VESA_MODE(scp->mode)) {
sc_bcopy(scp, scp->scr_buf, scp->cursor_pos - scp->scr_buf,
scp->cursor_pos - scp->scr_buf, 1);
return;
}
- ptr = (u_short *)(scp->adp->va_window)
- + (scp->cursor_pos - scp->scr_buf);
-
/* do we have a destructive cursor ? */
- if (sc_flags & CHAR_CURSOR) {
+ if (flags & CHAR_CURSOR) {
prev_image = scp->cursor_saveunder;
cursor_image = *ptr & 0x00ff;
if (cursor_image == DEAD_CHAR)
@@ -443,7 +455,7 @@ draw_cursor_image(scr_stat *scp)
if (prev_image != cursor_image)
set_destructive_cursor(scp);
/* modify cursor_image */
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ if (!(flags & BLINK_CURSOR)||((flags & BLINK_CURSOR)&&(blinkrate & 4))){
/*
* When the mouse pointer is at the same position as the cursor,
* the cursor bitmap needs to be updated even if the char under
@@ -459,7 +471,7 @@ draw_cursor_image(scr_stat *scp)
} else {
cursor_image = (*(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
scp->cursor_saveunder = cursor_image;
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ if (!(flags & BLINK_CURSOR)||((flags & BLINK_CURSOR)&&(blinkrate & 4))){
if ((cursor_image & 0x7000) == 0x7000) {
cursor_image &= 0x8fff;
if(!(cursor_image & 0x0700))
@@ -479,13 +491,11 @@ static void
remove_cursor_image(scr_stat *scp)
{
#ifndef PC98
- if (ISPIXELSC(scp))
+ if (VESA_MODE(scp->mode))
sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
- scp->cursor_oldpos - scp->scr_buf, 0);
+ scp->cursor_oldpos - scp->scr_buf, 0);
else
- *((u_short *)(scp->adp->va_window)
- + (scp->cursor_oldpos - scp->scr_buf))
- = scp->cursor_saveunder;
+ *(Crtat + (scp->cursor_oldpos - scp->scr_buf)) = scp->cursor_saveunder;
#endif
}
@@ -511,72 +521,303 @@ move_crsr(scr_stat *scp, int x, int y)
static int
scprobe(struct isa_device *dev)
{
- if (!scvidprobe(dev->id_unit, dev->id_flags, FALSE)) {
+ if (!scvidprobe(dev->id_unit, dev->id_flags)) {
if (bootverbose)
printf("sc%d: no video adapter is found.\n", dev->id_unit);
return (0);
}
- return ((sckbdprobe(dev->id_unit, dev->id_flags, FALSE)) ? -1 : 0);
+ sc_port = dev->id_iobase;
+ if (sckbdprobe(dev->id_unit, dev->id_flags))
+ return (IO_KBDSIZE);
+ else
+ return ((dev->id_flags & DETECT_KBD) ? 0 : IO_KBDSIZE);
}
/* probe video adapters, return TRUE if found */
static int
-scvidprobe(int unit, int flags, int cons)
+scvidprobe(int unit, int flags)
{
- video_adapter_t *adp;
+ /*
+ * XXX don't try to `printf' anything here, the console may not have
+ * been configured yet.
+ */
+ u_short volatile *cp;
+ u_short was;
+ u_int pa;
+ u_int segoff;
+
+ /* do this test only once */
+ if (init_done != COLD)
+ return (Crtat != 0);
/*
- * Access the video adapter driver through the back door!
- * Video adapter drivers need to be configured before syscons.
- * However, when syscons is being probed as the low-level console,
- * they have not been initialized yet. We force them to initialize
- * themselves here. XXX
+ * Finish defaulting crtc variables for a mono screen. Crtat is a
+ * bogus common variable so that it can be shared with pcvt, so it
+ * can't be statically initialized. XXX.
*/
- vid_configure(cons ? VIO_PROBE_ONLY : 0);
-
- /* allocate a frame buffer */
- if (adapter < 0) {
- adapter = vid_allocate("*", -1, (void *)&adapter);
- if (adapter < 0)
+#ifdef PC98
+ Crtat = (u_short *)TEXT_VRAM;
+ Atrat = (u_short *)TEXT_VRAM + ATTR_OFFSET;
+ crtc_type = KD_PC98;
+#else
+ Crtat = (u_short *)MONO_BUF;
+ crtc_type = KD_MONO;
+ /* If CGA memory seems to work, switch to color. */
+ cp = (u_short *)CGA_BUF;
+ was = *cp;
+ *cp = (u_short) 0xA55A;
+ bios_video_mode = *(u_char *)pa_to_va(0x449);
+ if (bootinfo.bi_vesa == 0x102) {
+ bios_video_mode = bootinfo.bi_vesa;
+ Crtat = (u_short *)pa_to_va(0xA0000);
+ crtc_addr = COLOR_BASE;
+ crtc_type = KD_VGA;
+ bzero(Crtat, 800*600/8);
+ } else if (*cp == 0xA55A) {
+ Crtat = (u_short *)CGA_BUF;
+ crtc_addr = COLOR_BASE;
+ crtc_type = KD_CGA;
+ } else {
+ cp = Crtat;
+ was = *cp;
+ *cp = (u_short) 0xA55A;
+ if (*cp != 0xA55A) {
+ /* no screen at all, bail out */
+ Crtat = 0;
return FALSE;
+ }
}
- adp = vid_get_adapter(adapter); /* shouldn't fail */
+ *cp = was;
- Crtat = (u_short *)adp->va_window;
-#ifdef PC98
- Atrat = Crtat + ATTR_OFFSET;
-#endif
- initial_video_mode = adp->va_initial_mode;
+ if (!VESA_MODE(bios_video_mode)) {
+ /*
+ * Check rtc and BIOS date area.
+ * XXX: don't use BIOSDATA_EQUIPMENT, it is not a dead copy
+ * of RTC_EQUIPMENT. The bit 4 and 5 of the ETC_EQUIPMENT are
+ * zeros for EGA and VGA. However, the EGA/VGA BIOS will set
+ * these bits in BIOSDATA_EQUIPMENT according to the monitor
+ * type detected.
+ */
+ switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
+ case 0: /* EGA/VGA, or nothing */
+ crtc_type = KD_EGA;
+ /* the color adapter may be in the 40x25 mode... XXX */
+ break;
+ case 1: /* CGA 40x25 */
+ /* switch to the 80x25 mode? XXX */
+ /* FALL THROUGH */
+ case 2: /* CGA 80x25 */
+ /* `crtc_type' has already been set... */
+ /* crtc_type = KD_CGA; */
+ break;
+ case 3: /* MDA */
+ /* `crtc_type' has already been set... */
+ /* crtc_type = KD_MONO; */
+ break;
+ }
+ /* is this a VGA or higher ? */
+ outb(crtc_addr, 7);
+ if (inb(crtc_addr) == 7) {
+
+ crtc_type = KD_VGA;
+ crtc_vga = TRUE;
+ read_vgaregs(vgaregs);
+
+ /* Get the BIOS video mode pointer */
+ segoff = *(u_int *)pa_to_va(0x4a8);
+ pa = ((segoff & 0xffff0000) >> 12) + (segoff & 0xffff);
+ if (ISMAPPED(pa, sizeof(u_int))) {
+ segoff = *(u_int *)pa_to_va(pa);
+ pa = ((segoff & 0xffff0000) >> 12) + (segoff & 0xffff);
+ if (ISMAPPED(pa, MODE_PARAM_SIZE))
+ video_mode_ptr = (char *)pa_to_va(pa);
+ }
+ }
+ }
+#endif /* PC98 */
return TRUE;
}
/* probe the keyboard, return TRUE if found */
static int
-sckbdprobe(int unit, int flags, int cons)
+sckbdprobe(int unit, int flags)
{
- /* access the keyboard driver through the backdoor! */
- kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
+ int codeset;
+ int c = -1;
+ int m;
+ int res, id;
- /* allocate a keyboard and register the keyboard event handler */
- if (keyboard < 0) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard, sckbdevent, NULL);
- if (keyboard < 0)
- return FALSE;
+ sc_kbdc = kbdc_open(sc_port);
+#ifndef PC98
+ if (!kbdc_lock(sc_kbdc, TRUE)) {
+ /* driver error? */
+ printf("sc%d: unable to lock the controller.\n", unit);
+ return ((flags & DETECT_KBD) ? FALSE : TRUE);
+ }
+
+ /* discard anything left after UserConfig */
+ empty_both_buffers(sc_kbdc, 10);
+
+ /* save the current keyboard controller command byte */
+ m = kbdc_get_device_mask(sc_kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(sc_kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ printf("sc%d: unable to get the current command byte value.\n", unit);
+ goto fail;
+ }
+ if (bootverbose)
+ printf("sc%d: the current keyboard controller command byte %04x\n",
+ unit, c);
+#if 0
+ /* override the keyboard lock switch */
+ c |= KBD_OVERRIDE_KBD_LOCK;
+#endif
+
+ /*
+ * The keyboard may have been screwed up by the boot block.
+ * We may just be able to recover from error by testing the controller
+ * and the keyboard port. The controller command byte needs to be saved
+ * before this recovery operation, as some controllers seem to set
+ * the command byte to particular values.
+ */
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+
+ /* enable the keyboard port, but disable the keyboard intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * there is very little we can do...
+ */
+ printf("sc%d: unable to set the command byte.\n", unit);
+ goto fail;
+ }
+
+ /*
+ * Check if we have an XT keyboard before we attempt to reset it.
+ * The procedure assumes that the keyboard and the controller have
+ * been set up properly by BIOS and have not been messed up
+ * during the boot process.
+ */
+ codeset = -1;
+ if (flags & XT_KEYBD)
+ /* the user says there is a XT keyboard */
+ codeset = 1;
+#ifdef DETECT_XT_KEYBOARD
+ else if ((c & KBD_TRANSLATION) == 0) {
+ /* SET_SCANCODE_SET is not always supported; ignore error */
+ if (send_kbd_command_and_data(sc_kbdc, KBDC_SET_SCANCODE_SET, 0)
+ == KBD_ACK)
+ codeset = read_kbd_data(sc_kbdc);
+ }
+ if (bootverbose)
+ printf("sc%d: keyboard scancode set %d\n", unit, codeset);
+#endif /* DETECT_XT_KEYBOARD */
+
+ if (flags & KBD_NORESET) {
+ write_kbd_command(sc_kbdc, KBDC_ECHO);
+ if (read_kbd_data(sc_kbdc) != KBD_ECHO) {
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: failed to get response from the keyboard.\n",
+ unit);
+ goto fail;
+ }
+ } else {
+ /* reset keyboard hardware */
+ if (!reset_kbd(sc_kbdc)) {
+ /* KEYBOARD ERROR
+ * Keyboard reset may fail either because the keyboard doen't
+ * exist, or because the keyboard doesn't pass the self-test,
+ * or the keyboard controller on the motherboard and the keyboard
+ * somehow fail to shake hands. It is just possible, particularly
+ * in the last case, that the keyoard controller may be left
+ * in a hung state. test_controller() and test_kbd_port() appear
+ * to bring the keyboard controller back (I don't know why and
+ * how, though.)
+ */
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ /* We could disable the keyboard port and interrupt... but,
+ * the keyboard may still exist (see above).
+ */
+ if (bootverbose)
+ printf("sc%d: failed to reset the keyboard.\n", unit);
+ goto fail;
+ }
}
- kbd = kbd_get_keyboard(keyboard); /* shouldn't fail */
+ /*
+ * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
+ * such as those on the IBM ThinkPad laptop computers can be used
+ * with the standard console driver.
+ */
+ if (codeset == 1) {
+ if (send_kbd_command_and_data(
+ sc_kbdc, KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
+ /* XT kbd doesn't need scan code translation */
+ c &= ~KBD_TRANSLATION;
+ } else {
+ /* KEYBOARD ERROR
+ * The XT kbd isn't usable unless the proper scan code set
+ * is selected.
+ */
+ printf("sc%d: unable to set the XT keyboard mode.\n", unit);
+ goto fail;
+ }
+ }
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
+ | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled keyboard intr.
+ */
+ printf("sc%d: unable to enable the keyboard port and intr.\n", unit);
+ goto fail;
+ }
+
+ /* Get the ID of the keyboard, if any */
+ empty_kbd_buffer(sc_kbdc, 5);
+ res = send_kbd_command(sc_kbdc, KBDC_SEND_DEV_ID);
+ if (res == KBD_ACK) {
+ /* 10ms delay */
+ DELAY(10000);
+ id = (read_kbd_data(sc_kbdc) << 8) | read_kbd_data(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: keyboard device ID: %04x\n", unit, id);
+ }
+
+ kbdc_set_device_mask(sc_kbdc, m | KBD_KBD_CONTROL_BITS),
+ kbdc_lock(sc_kbdc, FALSE);
+#endif /* !PC98 */
return TRUE;
+#ifndef PC98
+fail:
+ if (c != -1)
+ /* try to restore the command byte as before, if possible */
+ set_controller_command_byte(sc_kbdc, 0xff, c);
+ kbdc_set_device_mask(sc_kbdc,
+ (flags & DETECT_KBD) ? m : m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(sc_kbdc, FALSE);
+ return FALSE;
+#endif /* !PC98 */
}
#if NAPM > 0
static int
scresume(void *dummy)
{
- if (kbd != NULL)
- kbd_clear_state(kbd);
- return 0;
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ return 0;
}
#endif
@@ -584,85 +825,117 @@ static int
scattach(struct isa_device *dev)
{
scr_stat *scp;
-#if defined(VESA) && defined(VM86)
- video_info_t info;
-#endif
dev_t cdev = makedev(CDEV_MAJOR, 0);
+ char *p;
#ifdef DEVFS
int vc;
#endif
scinit();
+ flags = dev->id_flags;
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
+ flags &= ~CHAR_CURSOR;
+
scp = console[0];
- sc_flags = dev->id_flags;
- if (!ISFONTAVAIL(scp->adp->va_flags))
- sc_flags &= ~CHAR_CURSOR;
+
+ if (crtc_type == KD_VGA) {
+ cut_buffer_size = scp->xsize * scp->ysize + 1;
+ cut_buffer = (char *)malloc(cut_buffer_size, M_DEVBUF, M_NOWAIT);
+ if (cut_buffer != NULL)
+ cut_buffer[0] = '\0';
+ }
+
+ scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+#ifdef PC98
+ scp->atr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+#endif
/* copy temporary buffer to final buffer */
- scp->scr_buf = NULL;
+ bcopy(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
+
#ifdef PC98
- scp->atr_buf = NULL;
+ bcopy(Atrat, scp->atr_buf, scp->xsize * scp->ysize * sizeof(u_short));
#endif
- sc_alloc_scr_buffer(scp, FALSE, FALSE);
- bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
+ scp->cursor_pos = scp->cursor_oldpos =
+ scp->scr_buf + scp->xpos + scp->ypos * scp->xsize;
#ifdef PC98
- bcopy(Atrat, scp->atr_buf, scp->xsize*scp->ysize*sizeof(u_short));
+ scp->cursor_atr =
+ scp->atr_buf + scp->xpos + scp->ypos * scp->xsize;
#endif
-
- /* cut buffer is available only when the mouse pointer is used */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + ((scp->mouse_ypos/scp->font_size)*scp->xsize +
+ scp->mouse_xpos/8);
/* initialize history buffer & pointers */
- sc_alloc_history_buffer(scp, sc_history_size, 0, FALSE);
-
-#if defined(VESA) && defined(VM86)
- if ((sc_flags & VESA800X600)
- && ((*vidsw[scp->ad]->get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
-#if NSPLASH > 0
- splash_term(scp->adp);
-#endif
- sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
- sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
- initial_video_mode = M_VESA_800x600;
-#if NSPLASH > 0
- /* put up the splash again! */
- splash_init(scp->adp, scsplash_callback);
+ scp->history_head = scp->history_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (scp->history_head != NULL)
+ bzero(scp->history_head, scp->history_size*sizeof(u_short));
+ scp->history = scp->history_head;
+#ifdef PC98
+ scp->his_atr_head = scp->his_atr_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (scp->his_atr_head != NULL)
+ bzero(scp->his_atr_head, scp->history_size*sizeof(u_short));
+ scp->his_atr = scp->his_atr_pos;
#endif
- }
-#endif /* VESA && VM86 */
/* initialize cursor stuff */
- if (!ISGRAPHSC(scp))
+ if (!(scp->status & UNKNOWN_MODE))
draw_cursor_image(scp);
/* get screen update going */
scrn_timer((void *)TRUE);
- /* set up the keyboard */
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
- update_kbd_state(scp->status, LOCK_MASK);
+ update_leds(scp->status);
- if (bootverbose) {
- printf("sc%d:", dev->id_unit);
- if (adapter >= 0)
- printf(" fb%d", adapter);
- if (keyboard >= 0)
- printf(" kbd%d", keyboard);
- printf("\n");
+#ifndef PC98
+ if ((crtc_type == KD_VGA) && bootverbose) {
+ printf("sc%d: BIOS video mode:%d\n", dev->id_unit, bios_video_mode);
+ printf("sc%d: VGA registers upon power-up\n", dev->id_unit);
+ dump_vgaregs(vgaregs);
+ printf("sc%d: video mode:%d\n", dev->id_unit, scp->mode);
+ printf("sc%d: VGA registers in BIOS for mode:%d\n",
+ dev->id_unit, scp->mode);
+ dump_vgaregs(vgaregs2);
+ p = get_mode_param(scp, scp->mode);
+ if (p != NULL) {
+ printf("sc%d: VGA registers to be used for mode:%d\n",
+ dev->id_unit, scp->mode);
+ dump_vgaregs(p);
+ }
+ printf("sc%d: rows_offset:%d\n", dev->id_unit, rows_offset);
}
+ if ((crtc_type == KD_VGA) && !VESA_MODE(bios_video_mode)
+ && (video_mode_ptr == NULL))
+ printf("sc%d: WARNING: video mode switching is only partially supported\n",
+ dev->id_unit);
+#endif
+
printf("sc%d: ", dev->id_unit);
- switch(scp->adp->va_type) {
+ switch(crtc_type) {
#ifdef PC98
case KD_PC98:
printf(" <text mode>");
break;
#else
case KD_VGA:
- printf("VGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ if (VESA_MODE(bios_video_mode))
+ printf("Graphics display (VESA mode = 0x%x)", bios_video_mode);
+ else if (crtc_addr == MONO_BASE)
+ printf("VGA mono");
+ else
+ printf("VGA color");
break;
case KD_EGA:
- printf("EGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ if (crtc_addr == MONO_BASE)
+ printf("EGA mono");
+ else
+ printf("EGA color");
break;
case KD_CGA:
printf("CGA");
@@ -670,11 +943,11 @@ scattach(struct isa_device *dev)
case KD_MONO:
case KD_HERCULES:
default:
- printf("MDA/Hercules");
+ printf("MDA/hercules");
break;
#endif /* PC98 */
}
- printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, sc_flags);
+ printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, flags);
#if NAPM > 0
scp->r_hook.ah_fun = scresume;
@@ -720,8 +993,6 @@ int
scopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct tty *tp = scdevtotty(dev);
- keyarg_t key;
- int s;
if (!tp)
return(ENXIO);
@@ -733,9 +1004,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
ttychars(tp);
/* Use the current setting of the <-- key as default VERASE. */
/* If the Delete key is preferable, an stty is necessary */
- key.keynum = 0x0e; /* how do we know this magic number... XXX */
- kbd_ioctl(kbd, GIO_KEYMAPENT, (caddr_t)&key);
- tp->t_cc[VERASE] = key.key.map[0];
+ tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
tp->t_cflag = TTYDEF_CFLAG;
@@ -745,20 +1014,12 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
(*linesw[tp->t_line].l_modem)(tp, 1);
if (minor(dev) == SC_MOUSE)
mouse_level = 0; /* XXX */
- if (minor(dev) < MAXCONS && console[minor(dev)] && scrn_blanked) {
- s = spltty();
- sc_touch_scrn_saver();
- sc_clean_up(console[minor(dev)]);
- splx(s);
- }
}
else
if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
return(EBUSY);
if (minor(dev) < MAXCONS && !console[minor(dev)]) {
console[minor(dev)] = alloc_scp();
- if (ISGRAPHSC(console[minor(dev)]))
- sc_set_pixel_mode(console[minor(dev)], NULL, COL, ROW, 16);
}
if (minor(dev)<MAXCONS && !tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
tp->t_winsize.ws_col = console[minor(dev)]->xsize;
@@ -776,7 +1037,7 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
if (!tp)
return(ENXIO);
if (minor(dev) < MAXCONS) {
- scp = sc_get_scr_stat(tp->t_dev);
+ scp = get_scr_stat(tp->t_dev);
if (scp->status & SWITCH_WAIT_ACQ)
wakeup((caddr_t)&scp->smode);
#if not_yet_done
@@ -795,9 +1056,9 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
if (scp->history != NULL) {
free(scp->history, M_DEVBUF);
if (scp->history_size / scp->xsize
- > imax(sc_history_size, scp->ysize))
+ > imax(SC_HISTORY_SIZE, scp->ysize))
extra_history_size += scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize);
+ - imax(SC_HISTORY_SIZE, scp->ysize);
}
free(scp, M_DEVBUF);
console[minor(dev)] = NULL;
@@ -835,53 +1096,38 @@ scwrite(dev_t dev, struct uio *uio, int flag)
return((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
-static int
-sckbdevent(keyboard_t *thiskbd, int event, void *arg)
+void
+scintr(int unit)
{
static struct tty *cur_tty;
- int c;
- size_t len;
+ int c, len;
u_char *cp;
- /* assert(thiskbd == kbd) */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- kbd = NULL;
- kbd_release(thiskbd, (void *)&keyboard);
- return 0;
- default:
- return EINVAL;
- }
-
/*
* Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix
* the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
*/
- while ((c = scgetc(thiskbd, SCGETC_NONBLOCK)) != NOKEY) {
+ while ((c = scgetc(SCGETC_NONBLOCK)) != NOKEY) {
cur_tty = VIRTUAL_TTY(get_scr_num());
if (!(cur_tty->t_state & TS_ISOPEN))
if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
continue;
- switch (KEYFLAGS(c)) {
+ switch (c & 0xff00) {
case 0x0000: /* normal key */
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case FKEY: /* function key, return string */
- cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
- if (cp != NULL) {
+ if (cp = get_fstr((u_int)c, (u_int *)&len)) {
while (len-- > 0)
- (*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty);
}
break;
case MKEY: /* meta is active, prepend ESC */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case BKEY: /* backtab fixed sequence (esc [ Z) */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
@@ -891,11 +1137,10 @@ sckbdevent(keyboard_t *thiskbd, int event, void *arg)
}
}
- if (cur_console->status & MOUSE_VISIBLE) {
- remove_mouse_image(cur_console);
+ if (cur_console->status & MOUSE_ENABLED) {
cur_console->status &= ~MOUSE_VISIBLE;
+ remove_mouse_image(cur_console);
}
- return 0;
}
static int
@@ -910,29 +1155,28 @@ scparam(struct tty *tp, struct termios *t)
int
scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- u_int delta_ehs;
int error;
- int i;
+ u_int i;
struct tty *tp;
scr_stat *scp;
+ u_short *usp;
+#ifdef PC98
+ u_short *atr_usp;
+#endif
+ char *mp;
int s;
tp = scdevtotty(dev);
if (!tp)
return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
+ scp = get_scr_stat(tp->t_dev);
/* If there is a user_ioctl function call that first */
if (sc_user_ioctl) {
- error = (*sc_user_ioctl)(dev, cmd, data, flag, p);
- if (error != ENOIOCTL)
+ if (error = (*sc_user_ioctl)(dev, cmd, data, flag, p))
return error;
}
- error = sc_vid_ioctl(tp, cmd, data, flag, p);
- if (error != ENOIOCTL)
- return error;
-
switch (cmd) { /* process console hardware related ioctl's */
case GIO_ATTR: /* get current attributes */
@@ -940,7 +1184,22 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_COLOR: /* is this a color console ? */
- *(int *)data = (scp->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
+#ifdef PC98
+ *(int*)data = 0;
+#else
+ if (crtc_addr == COLOR_BASE)
+ *(int*)data = 1;
+ else
+ *(int*)data = 0;
+#endif
+ return 0;
+
+ case CONS_CURRENT: /* get current adapter type */
+ *(int *)data = crtc_type;
+ return 0;
+
+ case CONS_GET: /* get current video mode */
+ *(int*)data = scp->mode;
return 0;
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
@@ -954,38 +1213,36 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
if ((*(int*)data) & 0x01)
- sc_flags |= BLINK_CURSOR;
+ flags |= BLINK_CURSOR;
else
- sc_flags &= ~BLINK_CURSOR;
+ flags &= ~BLINK_CURSOR;
if ((*(int*)data) & 0x02) {
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
return ENXIO;
- sc_flags |= CHAR_CURSOR;
+ flags |= CHAR_CURSOR;
} else
- sc_flags &= ~CHAR_CURSOR;
+ flags &= ~CHAR_CURSOR;
/*
* The cursor shape is global property; all virtual consoles
* are affected. Update the cursor in the current console...
*/
- if (!ISGRAPHSC(cur_console)) {
- s = spltty();
+ if (!(cur_console->status & UNKNOWN_MODE)) {
remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
+ if (flags & CHAR_CURSOR)
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(s);
}
return 0;
case CONS_BELLTYPE: /* set bell type sound/visual */
if ((*(int *)data) & 0x01)
- sc_flags |= VISUAL_BELL;
+ flags |= VISUAL_BELL;
else
- sc_flags &= ~VISUAL_BELL;
+ flags &= ~VISUAL_BELL;
if ((*(int *)data) & 0x02)
- sc_flags |= QUIET_BELL;
+ flags |= QUIET_BELL;
else
- sc_flags &= ~QUIET_BELL;
+ flags &= ~QUIET_BELL;
return 0;
case CONS_HISTORY: /* set history size */
@@ -996,22 +1253,50 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
lines = imax(*(int *)data, scp->ysize);
lines0 = (scp->history != NULL) ?
scp->history_size / scp->xsize : scp->ysize;
- if (lines0 > imax(sc_history_size, scp->ysize))
- delta_ehs = lines0 - imax(sc_history_size, scp->ysize);
- else
- delta_ehs = 0;
/*
* syscons unconditionally allocates buffers upto SC_HISTORY_SIZE
* lines or scp->ysize lines, whichever is larger. A value
* greater than that is allowed, subject to extra_history_size.
*/
- if (lines > imax(sc_history_size, scp->ysize))
- if (lines - imax(sc_history_size, scp->ysize) >
- extra_history_size + delta_ehs)
- return EINVAL;
+ if (lines > imax(lines0, SC_HISTORY_SIZE) + extra_history_size)
+ return EINVAL;
if (cur_console->status & BUFFER_SAVED)
return EBUSY;
- sc_alloc_history_buffer(scp, lines, delta_ehs, TRUE);
+ usp = scp->history;
+ scp->history = NULL;
+ if (usp != NULL)
+ free(usp, M_DEVBUF);
+#ifdef PC98
+ atr_usp = scp->his_atr;
+ scp->his_atr = NULL;
+ if (atr_usp != NULL)
+ free(atr_usp, M_DEVBUF);
+#endif
+ scp->history_size = lines * scp->xsize;
+ /*
+ * extra_history_size +=
+ * (lines0 > imax(SC_HISTORY_SIZE, scp->ysize)) ?
+ * lines0 - imax(SC_HISTORY_SIZE, scp->ysize)) : 0;
+ * extra_history_size -=
+ * (lines > imax(SC_HISTORY_SIZE, scp->ysize)) ?
+ * lines - imax(SC_HISTORY_SIZE, scp->ysize)) : 0;
+ * lines0 >= ysize && lines >= ysize... Hey, the above can be
+ * reduced to the following...
+ */
+ extra_history_size +=
+ imax(lines0, SC_HISTORY_SIZE) - imax(lines, SC_HISTORY_SIZE);
+ usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(usp, scp->history_size * sizeof(u_short));
+ scp->history_head = scp->history_pos = usp;
+ scp->history = usp;
+#ifdef PC98
+ atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(atr_usp, scp->history_size * sizeof(u_short));
+ scp->his_atr_head = scp->his_atr_pos = atr_usp;
+ scp->his_atr = atr_usp;
+#endif
return 0;
}
else
@@ -1021,8 +1306,9 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case OLD_CONS_MOUSECTL:
{
/* MOUSE_BUTTON?DOWN -> MOUSE_MSC_BUTTON?UP */
- static int butmap[8] = {
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
+ static butmap[8] = {
+ MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP
+ | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON3UP,
@@ -1034,12 +1320,11 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
mouse_info_t *mouse = (mouse_info_t*)data;
mouse_info_t buf;
- /* FIXME: */
- if (!ISMOUSEAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
return ENODEV;
if (cmd == OLD_CONS_MOUSECTL) {
- static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
+ static unsigned char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
mouse = &buf;
@@ -1084,7 +1369,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case MOUSE_SHOW:
- if (ISTEXTSC(scp) && !(scp->status & MOUSE_ENABLED)) {
+ if (!(scp->status & MOUSE_ENABLED)) {
scp->status |= (MOUSE_ENABLED | MOUSE_VISIBLE);
scp->mouse_oldpos = scp->mouse_pos;
mark_all(scp);
@@ -1095,7 +1380,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
case MOUSE_HIDE:
- if (ISTEXTSC(scp) && (scp->status & MOUSE_ENABLED)) {
+ if (scp->status & MOUSE_ENABLED) {
scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE);
mark_all(scp);
return 0;
@@ -1140,7 +1425,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (mouse_status.flags == 0)
return 0;
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ if (cur_console->status & MOUSE_ENABLED)
cur_console->status |= MOUSE_VISIBLE;
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
@@ -1185,7 +1470,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
else if (mouse->operation == MOUSE_ACTION && cut_buffer != NULL) {
/* process button presses */
if ((cur_console->mouse_buttons ^ mouse->u.data.buttons) &&
- ISTEXTSC(cur_console)) {
+ !(cur_console->status & UNKNOWN_MODE)) {
cur_console->mouse_buttons = mouse->u.data.buttons;
if (cur_console->mouse_buttons & MOUSE_BUTTON1DOWN)
mouse_cut_start(cur_console);
@@ -1222,7 +1507,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (mouse_status.flags == 0)
return 0;
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ if (cur_console->status & MOUSE_ENABLED)
cur_console->status |= MOUSE_VISIBLE;
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
@@ -1251,7 +1536,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
}
- if (!ISTEXTSC(cur_console) || (cut_buffer == NULL))
+ if ((cur_console->status & UNKNOWN_MODE) || (cut_buffer == NULL))
break;
switch (mouse->u.event.id) {
@@ -1298,7 +1583,8 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
}
/* make screensaver happy */
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
return 0;
}
@@ -1419,9 +1705,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ptr->mv_grfc.fore = 0; /* not supported */
ptr->mv_grfc.back = 0; /* not supported */
ptr->mv_ovscan = scp->border;
- if (scp == cur_console)
- save_kbd_state(scp);
- ptr->mk_keylock = scp->status & LOCK_MASK;
+ ptr->mk_keylock = scp->status & LOCK_KEY_MASK;
return 0;
}
return EINVAL;
@@ -1432,43 +1716,18 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_IDLE: /* see if the screen has been idle */
- /*
- * When the screen is in the GRAPHICS_MODE or UNKNOWN_MODE,
- * the user process may have been writing something on the
- * screen and syscons is not aware of it. Declare the screen
- * is NOT idle if it is in one of these modes. But there is
- * an exception to it; if a screen saver is running in the
- * graphics mode in the current screen, we should say that the
- * screen has been idle.
- */
- *(int *)data = scrn_idle
- && (!ISGRAPHSC(cur_console)
- || (cur_console->status & SAVER_RUNNING));
+ *(int *)data = (scrn_idle && !(cur_console->status & UNKNOWN_MODE));
return 0;
case CONS_SAVERMODE: /* set saver mode */
switch(*(int *)data) {
case CONS_USR_SAVER:
- /* if a LKM screen saver is running, stop it first. */
- scsplash_stick(FALSE);
+ /* if a LKM screen saver is running, it will eventually stop... */
saver_mode = *(int *)data;
- s = spltty();
-#if NSPLASH > 0
- if ((error = wait_scrn_saver_stop())) {
- splx(s);
- return error;
- }
-#endif /* NSPLASH */
- scp->status |= SAVER_RUNNING;
scsplash_stick(TRUE);
- splx(s);
break;
case CONS_LKM_SAVER:
- s = spltty();
- if ((saver_mode == CONS_USR_SAVER) && (scp->status & SAVER_RUNNING))
- scp->status &= ~SAVER_RUNNING;
saver_mode = *(int *)data;
- splx(s);
break;
default:
return EINVAL;
@@ -1487,6 +1746,279 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
splx(s);
return 0;
+#ifdef PC98
+ case SW_PC98_80x25:
+ case SW_PC98_80x30: /* PC98 TEXT MODES */
+ if (!crtc_vga)
+ return ENXIO;
+ scp->xsize = 80;
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(SC_HISTORY_SIZE, scp->ysize), 0);
+ else
+ i = 0;
+ switch (cmd & 0xff) {
+ case M_PC98_80x25:
+ scp->ysize = 25;
+ break;
+#ifdef LINE30
+ case M_PC98_80x30:
+ scp->ysize = LINE30_ROW;
+ break;
+#endif
+ default:
+ return EINVAL;
+ }
+#else /* IBM-PC */
+ /* VGA TEXT MODES */
+ case SW_VGA_C40x25:
+ case SW_VGA_C80x25: case SW_VGA_M80x25:
+ case SW_VGA_C80x30: case SW_VGA_M80x30:
+ case SW_VGA_C80x50: case SW_VGA_M80x50:
+ case SW_VGA_C80x60: case SW_VGA_M80x60:
+ case SW_B40x25: case SW_C40x25:
+ case SW_B80x25: case SW_C80x25:
+ case SW_ENH_B40x25: case SW_ENH_C40x25:
+ case SW_ENH_B80x25: case SW_ENH_C80x25:
+ case SW_ENH_B80x43: case SW_ENH_C80x43:
+ case SW_EGAMONO80x25:
+
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(SC_HISTORY_SIZE, scp->ysize), 0);
+ else
+ i = 0;
+ switch (cmd & 0xff) {
+ case M_VGA_C80x60: case M_VGA_M80x60:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ /*
+ * This is a kludge to fend off scrn_update() while we
+ * muck around with scp. XXX
+ */
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 60;
+ scp->font_size = 8;
+ break;
+ case M_VGA_C80x50: case M_VGA_M80x50:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 50;
+ scp->font_size = 8;
+ break;
+ case M_ENH_B80x43: case M_ENH_C80x43:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 43;
+ scp->font_size = 8;
+ break;
+ case M_VGA_C80x30: case M_VGA_M80x30:
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 30;
+ scp->font_size = mp[2];
+ break;
+ case M_ENH_C40x25: case M_ENH_B40x25:
+ case M_ENH_C80x25: case M_ENH_B80x25:
+ case M_EGAMONO80x25:
+ if (!(fonts_loaded & FONT_14)) {
+ splx(s);
+ return EINVAL;
+ }
+ /* FALL THROUGH */
+ default:
+ if ((cmd & 0xff) > M_VGA_CG320) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = mp[0];
+ scp->ysize = mp[1] + rows_offset;
+ scp->font_size = mp[2];
+ break;
+ }
+#endif
+
+ scp->mode = cmd & 0xff;
+ scp->xpixel = scp->xsize * 8;
+ scp->ypixel = scp->ysize * scp->font_size;
+ free(scp->scr_buf, M_DEVBUF);
+ scp->scr_buf = (u_short *)
+ malloc(scp->xsize*scp->ysize*sizeof(u_short), M_DEVBUF, M_WAITOK);
+#ifdef PC98
+ free(scp->atr_buf, M_DEVBUF);
+ scp->atr_buf = (u_short *)
+ malloc(scp->xsize*scp->ysize*sizeof(u_short),M_DEVBUF, M_WAITOK);
+#endif
+ /* move the text cursor to the home position */
+ move_crsr(scp, 0, 0);
+ /* move the mouse cursor at the center of the screen */
+ scp->mouse_xpos = scp->xpixel / 2;
+ scp->mouse_ypos = scp->ypixel / 2;
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + (scp->mouse_ypos / scp->font_size) * scp->xsize
+ + scp->mouse_xpos / 8;
+ /* allocate a larger cut buffer if necessary */
+ if ((cut_buffer == NULL)
+ || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
+ if (cut_buffer != NULL)
+ free(cut_buffer, M_DEVBUF);
+ cut_buffer_size = scp->xsize * scp->ysize + 1;
+ cut_buffer = (char *)malloc(cut_buffer_size, M_DEVBUF, M_NOWAIT);
+ if (cut_buffer != NULL)
+ cut_buffer[0] = '\0';
+ }
+ splx(s);
+
+ usp = scp->history;
+ scp->history = NULL;
+ if (usp != NULL) {
+ free(usp, M_DEVBUF);
+ extra_history_size += i;
+ }
+#ifdef PC98
+ atr_usp = scp->his_atr;
+ scp->his_atr = NULL;
+ if (atr_usp != NULL)
+ free(atr_usp, M_DEVBUF);
+#endif
+ scp->history_size = imax(SC_HISTORY_SIZE, scp->ysize) * scp->xsize;
+ usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (usp != NULL)
+ bzero(usp, scp->history_size * sizeof(u_short));
+ scp->history_head = scp->history_pos = usp;
+ scp->history = usp;
+#ifdef PC98
+ atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (atr_usp != NULL)
+ bzero(atr_usp, scp->history_size * sizeof(u_short));
+ scp->his_atr_head = scp->his_atr_pos = atr_usp;
+ scp->his_atr = atr_usp;
+#endif
+ if (scp == cur_console)
+ set_mode(scp);
+ clear_screen(scp);
+ scp->status &= ~UNKNOWN_MODE;
+
+ if (tp->t_winsize.ws_col != scp->xsize
+ || tp->t_winsize.ws_row != scp->ysize) {
+ tp->t_winsize.ws_col = scp->xsize;
+ tp->t_winsize.ws_row = scp->ysize;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+#ifndef PC98
+ /* GRAPHICS MODES */
+ case SW_BG320: case SW_BG640:
+ case SW_CG320: case SW_CG320_D: case SW_CG640_E:
+ case SW_CG640x350: case SW_ENH_CG640:
+ case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
+
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE; /* graphics mode */
+ scp->mode = cmd & 0xFF;
+ scp->xpixel = mp[0] * 8;
+ scp->ypixel = (mp[1] + rows_offset) * mp[2];
+ scp->font_size = FONT_NONE;
+ /* move the mouse cursor at the center of the screen */
+ scp->mouse_xpos = scp->xpixel / 2;
+ scp->mouse_ypos = scp->ypixel / 2;
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ /* clear_graphics();*/
+
+ if (tp->t_winsize.ws_xpixel != scp->xpixel
+ || tp->t_winsize.ws_ypixel != scp->ypixel) {
+ tp->t_winsize.ws_xpixel = scp->xpixel;
+ tp->t_winsize.ws_ypixel = scp->ypixel;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+
+ case SW_VGA_MODEX:
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE; /* graphics mode */
+ scp->mode = cmd & 0xFF;
+ scp->xpixel = 320;
+ scp->ypixel = 240;
+ scp->font_size = FONT_NONE;
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ /* clear_graphics();*/
+ if (tp->t_winsize.ws_xpixel != scp->xpixel
+ || tp->t_winsize.ws_ypixel != scp->ypixel) {
+ tp->t_winsize.ws_xpixel = scp->xpixel;
+ tp->t_winsize.ws_ypixel = scp->ypixel;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+#endif /* PC98 */
+
case VT_SETMODE: /* set screen switcher mode */
{
struct vt_mode *mode;
@@ -1509,7 +2041,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case VT_RELDISP: /* screen switcher ioctl */
- switch(*(int *)data) {
+ switch(*data) {
case VT_FALSE: /* user refuses to release screen, abort */
if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
old_scp->status &= ~SWITCH_WAIT_REL;
@@ -1549,40 +2081,32 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
for (i = 0; i < MAXCONS; i++) {
tp = VIRTUAL_TTY(i);
if (!(tp->t_state & TS_ISOPEN)) {
- *(int *)data = i + 1;
+ *data = i + 1;
return 0;
}
}
return EINVAL;
case VT_ACTIVATE: /* switch to screen *data */
- s = spltty();
- sc_clean_up(cur_console);
- splx(s);
- return switch_scr(scp, *(int *)data - 1);
+ return switch_scr(scp, (*data) - 1);
case VT_WAITACTIVE: /* wait for switch to occur */
- if (*(int *)data > MAXCONS || *(int *)data < 0)
+ if (*data > MAXCONS || *data < 0)
return EINVAL;
- s = spltty();
- error = sc_clean_up(cur_console);
- splx(s);
- if (error)
- return error;
- if (minor(dev) == *(int *)data - 1)
+ if (minor(dev) == (*data) - 1)
return 0;
- if (*(int *)data == 0) {
+ if (*data == 0) {
if (scp == cur_console)
return 0;
}
else
- scp = console[*(int *)data - 1];
+ scp = console[(*data) - 1];
while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
"waitvt", 0)) == ERESTART) ;
return error;
case VT_GETACTIVE:
- *(int *)data = get_scr_num()+1;
+ *data = get_scr_num()+1;
return 0;
case KDENABIO: /* allow io operations */
@@ -1598,37 +2122,126 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
return 0;
- case KDSKBSTATE: /* set keyboard state (locks) */
- if (*(int *)data & ~LOCK_MASK)
+ case KDSETMODE: /* set current mode of this (virtual) console */
+ switch (*data) {
+ case KD_TEXT: /* switch to TEXT (known) mode */
+#ifndef PC98
+ /* restore fonts & palette ! */
+ if (crtc_type == KD_VGA) {
+ if (!VESA_MODE(scp->mode)) {
+#if 0
+ /*
+ * FONT KLUDGE
+ * Don't load fonts for now... XXX
+ */
+ if (fonts_loaded & FONT_8)
+ copy_font(LOAD, FONT_8, font_8);
+ if (fonts_loaded & FONT_14)
+ copy_font(LOAD, FONT_14, font_14);
+ if (fonts_loaded & FONT_16)
+ copy_font(LOAD, FONT_16, font_16);
+#endif
+ }
+ load_palette(palette);
+ }
+
+ /* move hardware cursor out of the way */
+ outb(crtc_addr, 14);
+ outb(crtc_addr + 1, 0xff);
+ outb(crtc_addr, 15);
+ outb(crtc_addr + 1, 0xff);
+
+ /* FALL THROUGH */
+#endif
+ case KD_TEXT1: /* switch to TEXT (known) mode */
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE;
+ splx(s);
+ /* no restore fonts & palette */
+#ifdef PC98
+ scp->status &= ~UNKNOWN_MODE;
+#else
+ if (crtc_type == KD_VGA)
+#endif
+ set_mode(scp);
+ scp->status &= ~UNKNOWN_MODE;
+ clear_screen(scp);
+ return 0;
+
+ case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE;
+#ifdef PC98
+ set_mode(scp);
+#endif
+ splx(s);
+ return 0;
+ default:
return EINVAL;
- scp->status &= ~LOCK_MASK;
- scp->status |= *(int *)data;
+ }
+ /* NOT REACHED */
+
+ case KDGETMODE: /* get current mode of this (virtual) console */
+ *data = (scp->status & UNKNOWN_MODE) ? KD_GRAPHICS : KD_TEXT;
+ return 0;
+
+ case KDSBORDER: /* set border color of this (virtual) console */
+ scp->border = *data;
if (scp == cur_console)
- update_kbd_state(scp->status, LOCK_MASK);
+ set_border(scp->border);
return 0;
+ case KDSKBSTATE: /* set keyboard state (locks) */
+ if (*data >= 0 && *data <= LOCK_KEY_MASK) {
+ scp->status &= ~LOCK_KEY_MASK;
+ scp->status |= *data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+ }
+ return EINVAL;
+
case KDGKBSTATE: /* get keyboard state (locks) */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LOCK_MASK;
+ *data = scp->status & LOCK_KEY_MASK;
return 0;
case KDSETRAD: /* set keyboard repeat & delay rates */
- if (*(int *)data & ~0x7f)
+#ifndef PC98
+ if (*data & 0x80)
return EINVAL;
- error = kbd_ioctl(kbd, KDSETRAD, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ if (sc_kbdc != NULL)
+ set_keyboard(KBDC_SET_TYPEMATIC, *data);
+#endif
+ return 0;
case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)data) {
- case K_XLATE: /* switch to XLT ascii mode */
+ switch (*data) {
case K_RAW: /* switch to RAW scancode mode */
+ scp->status &= ~KBD_CODE_MODE;
+ scp->status |= KBD_RAW_MODE;
+ return 0;
+
case K_CODE: /* switch to CODE mode */
- scp->kbd_mode = *(int *)data;
- if (scp == cur_console)
- kbd_ioctl(kbd, cmd, data);
+ scp->status &= ~KBD_RAW_MODE;
+ scp->status |= KBD_CODE_MODE;
+ return 0;
+
+ case K_XLATE: /* switch to XLT ascii mode */
+ if (scp == cur_console && scp->status & KBD_RAW_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE);
return 0;
default:
return EINVAL;
@@ -1636,15 +2249,10 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/* NOT REACHED */
case KDGKBMODE: /* get keyboard mode */
- *(int *)data = scp->kbd_mode;
+ *data = (scp->status & KBD_RAW_MODE) ? K_RAW :
+ ((scp->status & KBD_CODE_MODE) ? K_CODE : K_XLATE);
return 0;
- case KDGKBINFO:
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
case KDMKTONE: /* sound the bell */
if (*(int*)data)
do_bell(scp, (*(int*)data)&0xffff,
@@ -1696,74 +2304,45 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case KDGKBTYPE: /* get keyboard type */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL) {
- /* always return something? XXX */
- *(int *)data = 0;
- }
+ *data = 0; /* type not known (yet) */
return 0;
case KDSETLED: /* set keyboard LED status */
- if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
- return EINVAL;
- scp->status &= ~LED_MASK;
- scp->status |= *(int *)data;
- if (scp == cur_console)
- update_kbd_leds(scp->status);
- return 0;
+ if (*data >= 0 && *data <= LED_MASK) {
+ scp->status &= ~LED_MASK;
+ scp->status |= *data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+ }
+ return EINVAL;
case KDGETLED: /* get keyboard LED status */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LED_MASK;
+ *data = scp->status & LED_MASK;
return 0;
- case CONS_SETKBD: /* set the new keyboard */
- {
- keyboard_t *newkbd;
-
- s = spltty();
- newkbd = kbd_get_keyboard(*(int *)data);
- if (newkbd == NULL) {
- splx(s);
- return EINVAL;
- }
- error = 0;
- if (kbd != newkbd) {
- i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
- (void *)&keyboard, sckbdevent, NULL);
- /* i == newkbd->kb_index */
- if (i >= 0) {
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- kbd_release(kbd, (void *)&keyboard);
- }
- kbd = kbd_get_keyboard(i); /* kbd == newkbd */
- keyboard = i;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- } else {
- error = EPERM; /* XXX */
- }
- }
- splx(s);
- return error;
+ case GETFKEY: /* get functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(&fkey_tab[ptr->keynum].str, ptr->keydef,
+ fkey_tab[ptr->keynum].len);
+ ptr->flen = fkey_tab[ptr->keynum].len;
+ return 0;
}
+ else
+ return EINVAL;
- case CONS_RELKBD: /* release the current keyboard */
- s = spltty();
- error = 0;
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- error = kbd_release(kbd, (void *)&keyboard);
- if (error == 0) {
- kbd = NULL;
- keyboard = -1;
- }
+ case SETFKEY: /* set functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str,
+ min(ptr->flen, MAXFK));
+ fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK);
+ return 0;
}
- splx(s);
- return error;
-
+ else
+ return EINVAL;
+
case GIO_SCRNMAP: /* get output translation table */
bcopy(&scr_map, data, sizeof(scr_map));
return 0;
@@ -1774,19 +2353,36 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
scr_rmap[scr_map[i]] = i;
return 0;
- case GIO_KEYMAP: /* get keyboard translation table */
- case PIO_KEYMAP: /* set keyboard translation table */
- case GIO_DEADKEYMAP: /* get accent key translation table */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- case GETFKEY: /* get function key string */
- case SETFKEY: /* set function key string */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ case GIO_KEYMAP: /* get keyboard translation table */
+ bcopy(&key_map, data, sizeof(key_map));
+ return 0;
+
+ case PIO_KEYMAP: /* set keyboard translation table */
+ accents = 0;
+ bzero(&accent_map, sizeof(accent_map));
+ bcopy(data, &key_map, sizeof(key_map));
+ return 0;
+
+ case GIO_DEADKEYMAP: /* get accent key translation table */
+ bcopy(&accent_map, data, sizeof(accent_map));
+ return 0;
+ case PIO_DEADKEYMAP: /* set accent key translation table */
+ accents = 0;
+ bcopy(data, &accent_map, sizeof(accent_map));
+ return 0;
+
+#ifdef PC98
case PIO_FONT8x8: /* set 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ case GIO_FONT8x8: /* get 8x8 dot font */
+ case PIO_FONT8x14: /* set 8x14 dot font */
+ case GIO_FONT8x14: /* get 8x14 dot font */
+ case PIO_FONT8x16: /* set 8x16 dot font */
+ case GIO_FONT8x16: /* get 8x16 dot font */
+ return ENXIO;
+#else
+ case PIO_FONT8x8: /* set 8x8 dot font */
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_8, 8*256);
fonts_loaded |= FONT_8;
@@ -1795,12 +2391,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x8.
*/
- if (ISTEXTSC(cur_console) && (cur_console->font_size < 14))
- copy_font(cur_console, LOAD, 8, font_8);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size < 14)) {
+ copy_font(LOAD, FONT_8, font_8);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x8: /* get 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_8) {
bcopy(font_8, data, 8*256);
@@ -1810,7 +2411,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x14: /* set 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_14, 14*256);
fonts_loaded |= FONT_14;
@@ -1819,13 +2420,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x14.
*/
- if (ISTEXTSC(cur_console)
- && (cur_console->font_size >= 14) && (cur_console->font_size < 16))
- copy_font(cur_console, LOAD, 14, font_14);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size >= 14) && (cur_console->font_size < 16)) {
+ copy_font(LOAD, FONT_14, font_14);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x14: /* get 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_14) {
bcopy(font_14, data, 14*256);
@@ -1835,7 +2440,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x16: /* set 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_16, 16*256);
fonts_loaded |= FONT_16;
@@ -1844,12 +2449,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x16.
*/
- if (ISTEXTSC(cur_console) && (cur_console->font_size >= 16))
- copy_font(cur_console, LOAD, 16, font_16);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size >= 16)) {
+ copy_font(LOAD, FONT_16, font_16);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x16: /* get 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_16) {
bcopy(font_16, data, 16*256);
@@ -1857,6 +2467,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
else
return ENXIO;
+#endif /* PC98 */
#ifdef PC98
case ADJUST_CLOCK: /* /dev/rtc for 98note resume */
@@ -1882,7 +2493,7 @@ scstart(struct tty *tp)
struct clist *rbp;
int s, len;
u_char buf[PCBURST];
- scr_stat *scp = sc_get_scr_stat(tp->t_dev);
+ scr_stat *scp = get_scr_stat(tp->t_dev);
if (scp->status & SLKED || blink_in_progress)
return; /* XXX who repeats the call when the above flags are cleared? */
@@ -1922,7 +2533,7 @@ scmousestart(struct tty *tp)
splx(s);
}
-static void
+void
sccnprobe(struct consdev *cp)
{
struct isa_device *dvp;
@@ -1936,59 +2547,35 @@ sccnprobe(struct consdev *cp)
return;
}
- if (!scvidprobe(dvp->id_unit, dvp->id_flags, TRUE)) {
+ if (!scvidprobe(dvp->id_unit, dvp->id_flags)) {
cp->cn_pri = CN_DEAD;
return;
}
- sckbdprobe(dvp->id_unit, dvp->id_flags, TRUE);
/* initialize required fields */
cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
cp->cn_pri = CN_INTERNAL;
+
+ sc_kbdc = kbdc_open(sc_port);
}
-static void
+void
sccninit(struct consdev *cp)
{
scinit();
}
-static void
+void
sccnputc(dev_t dev, int c)
{
u_char buf[1];
+ int s;
scr_stat *scp = console[0];
term_stat save = scp->term;
- u_short *p;
- int s;
- int i;
-
- if (scp == cur_console && scp->status & SLKED) {
- scp->status &= ~SLKED;
- update_kbd_state(scp->status, SLKED);
- if (cur_console->status & BUFFER_SAVED) {
- p = cur_console->history_save;
- for (i = 0; i < cur_console->ysize; ++i) {
- bcopy(p, cur_console->scr_buf + (cur_console->xsize*i),
- cur_console->xsize*sizeof(u_short));
- p += cur_console->xsize;
- if (p + cur_console->xsize
- > cur_console->history + cur_console->history_size)
- p = cur_console->history;
- }
- cur_console->status &= ~BUFFER_SAVED;
- cur_console->history_head = cur_console->history_save;
- cur_console->status |= CURSOR_ENABLED;
- mark_all(cur_console);
- }
-#if 1 /* XXX */
- scstart(VIRTUAL_TTY(get_scr_num()));
-#endif
- }
scp->term = kernel_console;
current_default = &kernel_default;
- if (scp == cur_console && !ISGRAPHSC(scp))
+ if (scp == cur_console && !(scp->status & UNKNOWN_MODE))
remove_cursor_image(scp);
buf[0] = c;
ansi_put(scp, buf, 1);
@@ -1996,71 +2583,43 @@ sccnputc(dev_t dev, int c)
current_default = &user_default;
scp->term = save;
- s = spltty(); /* block sckbdevent and scrn_timer */
+ s = spltty(); /* block scintr and scrn_timer */
sccnupdate(scp);
splx(s);
}
-static int
+int
sccngetc(dev_t dev)
{
- return sccngetch(0);
-}
-
-static int
-sccncheckc(dev_t dev)
-{
- return sccngetch(SCGETC_NONBLOCK);
-}
-
-static int
-sccngetch(int flags)
-{
- int cur_mode;
- int s = spltty(); /* block sckbdevent and scrn_timer while we poll */
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
int c;
/*
* Stop the screen saver and update the screen if necessary.
* What if we have been running in the screen saver code... XXX
*/
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
sccnupdate(cur_console);
- if (kbd == NULL) {
- splx(s);
- return -1;
- }
-
- /*
- * Make sure the keyboard is accessible even when the kbd device
- * driver is disabled.
- */
- kbd_enable(kbd);
+ c = scgetc(SCGETC_CN);
+ splx(s);
+ return(c);
+}
- /* we shall always use the keyboard in the XLATE mode here */
- cur_mode = cur_console->kbd_mode;
- cur_console->kbd_mode = K_XLATE;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
+int
+sccncheckc(dev_t dev)
+{
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
+ int c;
- c = scgetc(kbd, SCGETC_CN | flags);
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ sccnupdate(cur_console);
- cur_console->kbd_mode = cur_mode;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- kbd_disable(kbd);
+ c = scgetc(SCGETC_CN | SCGETC_NONBLOCK);
splx(s);
-
- switch (KEYFLAGS(c)) {
- case 0: /* normal char */
- return KEYCHAR(c);
- case FKEY: /* function key */
- return c; /* XXX */
- case NOKEY:
- case ERRKEY:
- default:
- return -1;
- }
- /* NOT REACHED */
+ return(c == NOKEY ? -1 : c); /* c == -1 can't happen */
}
static void
@@ -2071,28 +2630,25 @@ sccnupdate(scr_stat *scp)
if (font_loading_in_progress)
return;
- if (panicstr || shutdown_in_progress) {
- sc_touch_scrn_saver();
- } else if (scp != cur_console) {
- return;
+ if (panicstr) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
}
-
if (!run_scrn_saver)
scrn_idle = FALSE;
-#if NSPLASH > 0
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(current_saver);
-#endif /* NSPLASH */
+
if (scp != cur_console || blink_in_progress || switch_in_progress)
return;
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ if ((scp->status & UNKNOWN_MODE) == 0 && scrn_blanked <= 0)
scrn_update(scp, TRUE);
}
-scr_stat
-*sc_get_scr_stat(dev_t dev)
+static scr_stat
+*get_scr_stat(dev_t dev)
{
int unit = minor(dev);
@@ -2128,10 +2684,35 @@ scrn_timer(void *arg)
}
s = spltty();
+ /*
+ * With release 2.1 of the Xaccel server, the keyboard is left
+ * hanging pretty often. Apparently an interrupt from the
+ * keyboard is lost, and I don't know why (yet).
+ * This ugly hack calls scintr if input is ready for the keyboard
+ * and conveniently hides the problem. XXX
+ */
+ /* Try removing anything stuck in the keyboard controller; whether
+ * it's a keyboard scan code or mouse data. `scintr()' doesn't
+ * read the mouse data directly, but `kbdio' routines will, as a
+ * side effect.
+ */
+ if (kbdc_lock(sc_kbdc, TRUE)) {
+ /*
+ * We have seen the lock flag is not set. Let's reset the flag early;
+ * otherwise `update_led()' failes which may want the lock
+ * during `scintr()'.
+ */
+ kbdc_lock(sc_kbdc, FALSE);
+ if (kbdc_data_ready(sc_kbdc))
+ scintr(0);
+ }
+
/* should we stop the screen saver? */
getmicrouptime(&tv);
- if (panicstr || shutdown_in_progress)
- sc_touch_scrn_saver();
+ if (panicstr || shutdown_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
if (run_scrn_saver) {
scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
} else {
@@ -2140,11 +2721,10 @@ scrn_timer(void *arg)
if (scrn_blank_time > 0)
run_scrn_saver = TRUE;
}
-#if NSPLASH > 0
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(current_saver);
-#endif /* NSPLASH */
+
/* should we just return ? */
if (blink_in_progress || switch_in_progress) {
if (arg)
@@ -2155,12 +2735,12 @@ scrn_timer(void *arg)
/* Update the screen */
scp = cur_console;
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ if ((scp->status & UNKNOWN_MODE) == 0 && scrn_blanked <= 0)
scrn_update(scp, TRUE);
/* should we activate the screen saver? */
if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
- if (!ISGRAPHSC(scp) || scrn_blanked)
+ if ((scp->status & UNKNOWN_MODE) == 0 || scrn_blanked > 0)
(*current_saver)(TRUE);
if (arg)
@@ -2228,7 +2808,7 @@ scrn_update(scr_stat *scp, int show_cursor)
draw_cursor_image(scp);
} else {
/* if its a blinking cursor, we may have to update it */
- if (sc_flags & BLINK_CURSOR)
+ if (flags & BLINK_CURSOR)
draw_cursor_image(scp);
}
}
@@ -2242,96 +2822,25 @@ scrn_update(scr_stat *scp, int show_cursor)
scp->start = scp->xsize*scp->ysize - 1;
}
-#if NSPLASH > 0
-
-static int
-scsplash_callback(int event)
-{
- int error;
-
- switch (event) {
- case SPLASH_INIT:
- scrn_saver_failed = FALSE;
- if (add_scrn_saver(scsplash_saver) == 0) {
- run_scrn_saver = TRUE;
- if (cold && !(boothowto & (RB_VERBOSE | RB_CONFIG))) {
- scsplash_stick(TRUE);
- (*current_saver)(TRUE);
- }
- }
- return 0;
-
- case SPLASH_TERM:
- if (current_saver == scsplash_saver) {
- scsplash_stick(FALSE);
- error = remove_scrn_saver(scsplash_saver);
- if (error)
- return error;
- }
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-static void
-scsplash_saver(int show)
-{
- static int busy = FALSE;
- scr_stat *scp;
-
- if (busy)
- return;
- busy = TRUE;
-
- scp = cur_console;
- if (show) {
- if (!scrn_saver_failed) {
- if (!scrn_blanked)
- set_scrn_saver_mode(scp, -1, NULL, 0);
- switch (splash(scp->adp, TRUE)) {
- case 0: /* succeeded */
- scrn_blanked = TRUE;
- break;
- case EAGAIN: /* try later */
- restore_scrn_saver_mode(scp, FALSE);
- break;
- default:
- scrn_saver_failed = TRUE;
- scsplash_stick(FALSE);
- printf("scsplash_saver(): failed to put up the image\n");
- restore_scrn_saver_mode(scp, TRUE);
- break;
- }
- }
- } else if (!sticky_splash) {
- if (scrn_blanked && (splash(scp->adp, FALSE) == 0)) {
- restore_scrn_saver_mode(scp, TRUE);
- scrn_blanked = FALSE;
- }
- }
- busy = FALSE;
-}
-
-static int
+int
add_scrn_saver(void (*this_saver)(int))
{
- int error;
-
- if (current_saver != none_saver) {
- error = remove_scrn_saver(current_saver);
- if (error)
- return error;
+#ifdef SC_SPLASH_SCREEN
+ if (current_saver == scsplash) {
+ scsplash_stick(FALSE);
+ stop_scrn_saver(scsplash);
}
+#endif
- run_scrn_saver = FALSE;
- saver_mode = CONS_LKM_SAVER;
+ if (current_saver != default_saver)
+ return EBUSY;
current_saver = this_saver;
+ saver_mode = CONS_LKM_SAVER;
+ run_scrn_saver = (scrn_blank_time > 0);
return 0;
}
-static int
+int
remove_scrn_saver(void (*this_saver)(int))
{
if (current_saver != this_saver)
@@ -2344,72 +2853,14 @@ remove_scrn_saver(void (*this_saver)(int))
* before stopping the current saver, rather than blocking by `splXX()'.
*/
current_saver = none_saver;
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(this_saver);
- return (scrn_blanked ? EBUSY : 0);
-}
+ if (scrn_blanked > 0)
+ return EBUSY; /* XXX */
-static int
-set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
-{
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- scp->splash_save_mode = scp->mode;
- scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
- splx(s);
- if (mode < 0)
- return 0;
- scp->mode = mode;
- if (set_mode(scp) == 0) {
- if (scp->adp->va_mode_flags & V_INFO_GRAPHICS)
- scp->status |= GRAPHICS_MODE;
- if (pal != NULL)
- load_palette(scp->adp, pal);
- set_border(scp, border);
- return 0;
- } else {
- s = spltty();
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- splx(s);
- return 1;
- }
-}
-
-static int
-restore_scrn_saver_mode(scr_stat *scp, int changemode)
-{
- int mode;
- int status;
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- mode = scp->mode;
- status = scp->status;
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- if (!changemode) {
- splx(s);
- return 0;
- }
- if (set_mode(scp) == 0) {
- load_palette(scp->adp, palette);
- splx(s);
- return 0;
- } else {
- scp->mode = mode;
- scp->status = status;
- splx(s);
- return 1;
- }
+ current_saver = default_saver;
+ return 0;
}
static void
@@ -2418,7 +2869,7 @@ stop_scrn_saver(void (*saver)(int))
(*saver)(FALSE);
run_scrn_saver = FALSE;
/* the screen saver may have chosen not to stop after all... */
- if (scrn_blanked)
+ if (scrn_blanked > 0)
return;
mark_all(cur_console);
@@ -2432,8 +2883,8 @@ wait_scrn_saver_stop(void)
{
int error = 0;
- while (scrn_blanked) {
- run_scrn_saver = FALSE;
+ run_scrn_saver = FALSE;
+ while (scrn_blanked > 0) {
error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
run_scrn_saver = FALSE;
if (error != ERESTART)
@@ -2442,17 +2893,8 @@ wait_scrn_saver_stop(void)
return error;
}
-#endif /* NSPLASH */
-
-void
-sc_touch_scrn_saver(void)
-{
- scsplash_stick(FALSE);
- run_scrn_saver = FALSE;
-}
-
-void
-sc_clear_screen(scr_stat *scp)
+static void
+clear_screen(scr_stat *scp)
{
move_crsr(scp, 0, 0);
scp->cursor_oldpos = scp->cursor_pos;
@@ -2473,9 +2915,10 @@ static int
switch_scr(scr_stat *scp, u_int next_scr)
{
/* delay switch if actively updating screen */
- if (scrn_blanked || write_in_progress || blink_in_progress) {
+ if (scrn_blanked > 0 || write_in_progress || blink_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
delayed_next_scr = next_scr+1;
- sc_touch_scrn_saver();
return 0;
}
@@ -2483,7 +2926,8 @@ switch_scr(scr_stat *scp, u_int next_scr)
switch_in_progress = FALSE;
if (next_scr >= MAXCONS || switch_in_progress ||
- (cur_console->smode.mode == VT_AUTO && ISGRAPHSC(cur_console))) {
+ (cur_console->smode.mode == VT_AUTO
+ && cur_console->status & UNKNOWN_MODE)) {
do_bell(scp, BELL_PITCH, BELL_DURATION);
return EINVAL;
}
@@ -2533,35 +2977,33 @@ switch_scr(scr_stat *scp, u_int next_scr)
static void
exchange_scr(void)
{
- /* save the current state of video and keyboard */
move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
- if (old_scp->kbd_mode == K_XLATE)
- save_kbd_state(old_scp);
-
- /* set up the video for the new screen */
cur_console = new_scp;
#ifdef PC98
- if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp) || ISUNKNOWNSC(new_scp))
+ if (old_scp->mode != new_scp->mode || (old_scp->status & UNKNOWN_MODE) || (new_scp->status & UNKNOWN_MODE)){
#else
- if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
+ if (old_scp->mode != new_scp->mode || (old_scp->status & UNKNOWN_MODE)){
+ if (crtc_type == KD_VGA)
#endif
- set_mode(new_scp);
+ set_mode(new_scp);
+ }
move_crsr(new_scp, new_scp->xpos, new_scp->ypos);
#ifndef PC98
- if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
+ if (!(new_scp->status & UNKNOWN_MODE) && (flags & CHAR_CURSOR))
set_destructive_cursor(new_scp);
- if (ISGRAPHSC(old_scp))
- load_palette(new_scp->adp, palette);
-#endif
- set_border(new_scp, new_scp->border);
-
- /* set up the keyboard for the new screen */
- if (old_scp->kbd_mode != new_scp->kbd_mode)
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&new_scp->kbd_mode);
- update_kbd_state(new_scp->status, LOCK_MASK);
-
+ if ((old_scp->status & UNKNOWN_MODE) && crtc_type == KD_VGA)
+ load_palette(palette);
+#endif
+ if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE ||
+ old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ set_border(new_scp->border);
+ update_leds(new_scp->status);
delayed_next_scr = FALSE;
mark_all(new_scp);
+ if (new_scp->mode == 0x102) {
+ bzero(Crtat, 800*600/8);
+ }
}
static void
@@ -2578,36 +3020,36 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->term.esc == 1) { /* seen ESC */
#ifdef KANJI
switch (scp->kanji_type) {
- case KTYPE_KANIN: /* Kanji Invoke sequence */
+ case 0x80:
switch (c) {
case 'B':
case '@':
- scp->kanji_type = KTYPE_7JIS;
+ scp->kanji_type = 0x20;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
default:
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
break;
}
break;
- case KTYPE_ASCIN: /* Ascii Invoke sequence */
+ case 0x40:
switch (c) {
case 'J':
case 'B':
case 'H':
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
case 'I':
- scp->kanji_type = KTYPE_JKANA;
+ scp->kanji_type = 0x10;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
default:
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
break;
}
@@ -2637,8 +3079,8 @@ scan_esc(scr_stat *scp, u_char c)
return;
#ifdef KANJI
- case '$': /* Kanji Invoke sequence */
- scp->kanji_type = KTYPE_KANIN;
+ case '$': /* Kanji IN sequence */
+ scp->kanji_type = 0x80;
return;
#endif
@@ -2670,12 +3112,12 @@ scan_esc(scr_stat *scp, u_char c)
return;
#endif
case 'c': /* Clear screen & home */
- sc_clear_screen(scp);
+ clear_screen(scp);
break;
case '(': /* iso-2022: designate 94 character set to G0 */
#ifdef KANJI
- scp->kanji_type = KTYPE_ASCIN;
+ scp->kanji_type = 0x40;
#else
scp->term.esc = 5;
#endif
@@ -2772,7 +3214,7 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
remove_cutmarking(scp);
break;
case 1: /* clear from beginning of display to cursor */
@@ -2835,10 +3277,10 @@ scan_esc(scr_stat *scp, u_char c)
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
mark_for_update(scp, scp->cursor_pos - scp->scr_buf +
- scp->xsize - 1 - scp->xpos);
+ scp->xsize - scp->xpos);
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf +
- scp->xsize - 1 - scp->xpos);
+ scp->xsize - scp->xpos);
#endif
break;
case 1: /* clear from beginning of line to cursor */
@@ -2874,7 +3316,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
+ mark_for_update(scp, (scp->ypos + 1) * scp->xsize);
break;
}
break;
@@ -2900,7 +3342,7 @@ scan_esc(scr_stat *scp, u_char c)
n * scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
break;
case 'M': /* Delete n lines */
@@ -2926,7 +3368,7 @@ scan_esc(scr_stat *scp, u_char c)
n * scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
break;
case 'P': /* Delete n chars */
@@ -2952,9 +3394,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count);
#endif
break;
@@ -2979,9 +3421,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count);
#endif
break;
@@ -3051,9 +3493,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n);
#endif
break;
@@ -3125,7 +3567,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->term.cur_color =
(scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
scp->term.cur_attr = mask2attr(&scp->term);
- break;
+ break;
case 40: case 41: /* set bg color */
case 42: case 43: case 44:
case 45: case 46: case 47:
@@ -3232,7 +3674,7 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->term.num_param == 1) {
scp->border=scp->term.param[0] & 0xff;
if (scp == cur_console)
- set_border(cur_console, scp->border);
+ set_border(scp->border);
}
break;
@@ -3246,21 +3688,14 @@ scan_esc(scr_stat *scp, u_char c)
case 'C': /* set cursor type & shape */
if (scp->term.num_param == 1) {
if (scp->term.param[0] & 0x01)
- sc_flags |= BLINK_CURSOR;
+ flags |= BLINK_CURSOR;
else
- sc_flags &= ~BLINK_CURSOR;
-#ifdef PC98
- if (scp->term.param[0] & 0x02)
- sc_flags |= CHAR_CURSOR;
+ flags &= ~BLINK_CURSOR;
+ if ((scp->term.param[0] & 0x02) &&
+ crtc_type == KD_VGA && !VESA_MODE(bios_video_mode))
+ flags |= CHAR_CURSOR;
else
- sc_flags &= ~CHAR_CURSOR;
-#else /* PC98 */
- if ((scp->term.param[0] & 0x02)
- && ISFONTAVAIL(scp->adp->va_flags))
- sc_flags |= CHAR_CURSOR;
- else
- sc_flags &= ~CHAR_CURSOR;
-#endif /* PC98 */
+ flags &= ~CHAR_CURSOR;
}
else if (scp->term.num_param == 2) {
scp->cursor_start = scp->term.param[0] & 0x1F;
@@ -3270,13 +3705,11 @@ scan_esc(scr_stat *scp, u_char c)
* The cursor shape is global property; all virtual consoles
* are affected. Update the cursor in the current console...
*/
- if (!ISGRAPHSC(cur_console)) {
- i = spltty();
+ if (!(cur_console->status & UNKNOWN_MODE)) {
remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
+ if (crtc_type == KD_VGA && (flags & CHAR_CURSOR))
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(i);
}
break;
@@ -3339,114 +3772,103 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef KANJI
static u_char iskanji1(u_char mode, u_char c)
{
- if ((mode == KTYPE_7JIS) && (c >= 0x21) && (c <= 0x7e)) {
+ if ((mode == 0x20) && (c >= 0x21) && (c <= 0x7e)) {
/* JIS */
- default_kanji = UJIS;
- return KTYPE_7JIS;
+ return 0x20;
}
- if ((mode == KTYPE_JKANA) && (c >= 0x21) && (c <= 0x5f)) {
+ if ((mode == 0x10) && (c >= 0x21) && (c <= 0x5f)) {
/* JIS HANKAKU */
- default_kanji = UJIS;
- return KTYPE_JKANA;
+ return 0x10;
}
-#if 1
- if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
- /* UJIS */
- return KTYPE_UJIS;
- }
-#endif
-
if ((c >= 0x81) && (c <= 0x9f) && (c != 0x8e)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == SJIS)) {
- /* SJIS HANKAKU */
- return KTYPE_KANA;
+ /* Sjis HANKAKU */
+ return 1;
}
-#if 0
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
/* UJIS */
- return KTYPE_UJIS;
+ return 4;
}
-#endif
if ((c >= 0xf0) && (c <= 0xfe)) {
/* UJIS */
default_kanji = UJIS;
- return KTYPE_UJIS;
+ return 4;
}
if ((c >= 0xe0) && (c <= 0xef)) {
/* SJIS or UJIS */
- return KTYPE_SUJIS;
+ return 6;
}
if (c == 0x8e) {
/* SJIS or UJIS HANKAKU */
- return KTYPE_SUKANA;
+ return 3;
}
- return KTYPE_ASCII;
+ return 0;
}
static u_char iskanji2(u_char mode, u_char c)
{
switch (mode) {
- case KTYPE_7JIS:
+ case 0x20:
if ((c >= 0x21) && (c <= 0x7e)) {
/* JIS */
- return KTYPE_7JIS;
+ return 0x20;
}
break;
- case KTYPE_SJIS:
+ case 2:
if ((c >= 0x40) && (c <= 0xfc) && (c != 0x7f)) {
/* SJIS */
- return KTYPE_SJIS;
+ return 2;
}
break;
- case KTYPE_UJIS:
+ case 4:
if ((c >= 0xa1) && (c <= 0xfe)) {
/* UJIS */
- return KTYPE_UJIS;
+ return 4;
}
break;
- case KTYPE_SUKANA:
+ case 3:
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
/* UJIS HANKAKU */
- return KTYPE_KANA;
+ return 1;
}
if ((c >= 0x40) && (c <= 0xfc) && (c != 0x7f)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
break;
- case KTYPE_SUJIS:
+ case 6:
if ((c >= 0x40) && (c <= 0xa0) && (c != 0x7f)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
if ((c == 0xfd) || (c == 0xfe)) {
/* UJIS */
default_kanji = UJIS;
- return KTYPE_UJIS;
+ return 4;
}
if ((c >= 0xa1) && (c <= 0xfc)) {
if (default_kanji == SJIS)
- return KTYPE_SJIS;
+ return 2;
if (default_kanji == UJIS)
- return KTYPE_UJIS;
+ return 4;
}
break;
}
- return KTYPE_ASCII;
+ return 0;
}
/*
@@ -3467,7 +3889,7 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
low = (u_short) l;
switch (mode) {
- case KTYPE_SJIS: /* SHIFT JIS */
+ case 2: /* SHIFT JIS */
if (low >= 0xe0) {
low -= 0x40;
}
@@ -3475,7 +3897,7 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
if (high > 0x7f) {
high--;
}
- if (high > 0x9d) {
+ if (high >0x9d) {
low++;
high -= 0x9e - 0x21;
} else {
@@ -3485,8 +3907,8 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
low &= 0x7F;
tmp = ((high << 8) | low) - 0x20;
break;
- case KTYPE_7JIS: /* JIS */
- case KTYPE_UJIS: /* UJIS */
+ case 0x20: /* JIS */
+ case 4: /* HANKAKU? */
high &= 0x7F;
low &= 0x7F;
tmp = ((high << 8) | low) - 0x20;
@@ -3498,7 +3920,6 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
/* keisen */
c = ((tmp & 0xff) << 8) | (tmp >> 8);
- /* 0x2821 .. 0x2840 */
if (0x0821 <= c && c <= 0x0840)
tmp = keiConv[c - 0x0821];
@@ -3525,9 +3946,7 @@ outloop:
len--;
}
else if (PRINTABLE(*ptr)) { /* Print only printables */
-#ifndef PC98
int cnt = len <= (scp->xsize-scp->xpos) ? len : (scp->xsize-scp->xpos);
-#endif
u_short cur_attr = scp->term.cur_attr;
u_short *cursor_pos = scp->cursor_pos;
#ifdef PC98
@@ -3536,7 +3955,7 @@ outloop:
#ifdef KANJI
if (scp->kanji_1st_char == 0) {
scp->kanji_type = iskanji1(scp->kanji_type, c);
- if (!IS_KTYPE_ASCII_or_HANKAKU(scp->kanji_type)) {
+ if (scp->kanji_type & 0xee) {
/* not Ascii & not HANKAKU */
scp->kanji_1st_char = c;
ptr++; len--;
@@ -3549,8 +3968,7 @@ outloop:
/* print kanji on TEXT VRAM */
kanji_code = kanji_convert(scp->kanji_type, c, scp->kanji_1st_char);
for (i=0; i<2; i++){
- /* *cursor_pos = (kanji_code | (i*0x80)); */
- *cursor_pos = kanji_code | ((i==0) ? 0x00 : 0x80);
+ *cursor_pos = (kanji_code | (i*0x80));
*cursor_atr = (at2pc98(cur_attr));
cursor_pos++;
cursor_atr++;
@@ -3559,7 +3977,7 @@ outloop:
scp->ypos++;
}
}
- KTYPE_MASK_CTRL(scp->kanji_type);
+ scp->kanji_type &= 0xF0;
scp->kanji_1st_char = 0;
ptr++; len--;
goto kanji_end;
@@ -3567,9 +3985,8 @@ outloop:
scp->kanji_1st_char = 0;
}
}
- if (IS_KTYPE_KANA(scp->kanji_type))
- c |= 0x80;
- KTYPE_MASK_CTRL(scp->kanji_type);
+ if ((scp->kanji_type & 0x11)) c |= 0x80;
+ scp->kanji_type &= 0xf0;
#endif /* KANJI */
*cursor_pos++ = (scr_map[c]);
*cursor_atr++ = at2pc98(cur_attr);
@@ -3675,7 +4092,7 @@ kanji_end:
break;
case 0x0c: /* form feed, clears screen */
- sc_clear_screen(scp);
+ clear_screen(scp);
break;
case 0x0d: /* return, return to pos 0 */
@@ -3694,20 +4111,6 @@ kanji_end:
scp->xpos = 0;
break;
-#ifdef PC98
- case 0x0e: /* ^N */
- scp->kanji_type = KTYPE_JKANA;
- scp->term.esc = 0;
- scp->kanji_1st_char = 0;
- break;
-
- case 0x0f: /* ^O */
- scp->kanji_type = KTYPE_ASCII;
- scp->term.esc = 0;
- scp->kanji_1st_char = 0;
- break;
-#endif
-
case 0x1b: /* start escape sequence */
scp->term.esc = 1;
scp->term.num_param = 0;
@@ -3718,7 +4121,7 @@ kanji_end:
/* do we have to scroll ?? */
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
remove_cutmarking(scp);
- if (scp->history != NULL) {
+ if (scp->history) {
bcopy(scp->scr_buf, scp->history_head,
scp->xsize * sizeof(u_short));
scp->history_head += scp->xsize;
@@ -3734,8 +4137,7 @@ kanji_end:
#endif
scp->history_head = scp->history;
#ifdef PC98
- scp->his_atr_head = scp->his_atr;
- }
+ scp->his_atr_head = scp->his_atr; }
#endif
}
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
@@ -3772,30 +4174,66 @@ kanji_end:
static void
scinit(void)
{
- video_adapter_t *adp;
- int col;
- int row;
+ u_int hw_cursor;
u_int i;
if (init_done != COLD)
return;
init_done = WARM;
- get_bios_values();
-
#ifdef PC98
- if (pc98_machine_type & M_8M)
- BELL_PITCH = 1339;
- else
- BELL_PITCH = 1678;
-#endif
+ if (pc98_machine_type & M_8M) {
+ BELL_PITCH = 1339;
+ } else {
+ BELL_PITCH = 1678;
+ }
+ outb(0x62, 0xd);
+ outb(0xA2, 0xd);
+ /* Extract cursor location */
+ while((inb(TEXT_GDC + 0) & 0x04) == 0) {} /* GDC wait */
+ outb(TEXT_GDC + 2, 0xe0); /* CSRR */
+ while((inb(TEXT_GDC + 0) & 0x1) == 0) {} /* GDC wait */
+ hw_cursor = inb(TEXT_GDC + 2); /* EADl */
+ hw_cursor |= (inb(TEXT_GDC + 2) << 8); /* EADh */
+ inb(TEXT_GDC + 2); /* dummy */
+ inb(TEXT_GDC + 2); /* dummy */
+ inb(TEXT_GDC + 2); /* dummy */
+
+ if (hw_cursor >= ROW*COL) {
+ hw_cursor = 0;
+ }
+ crtc_vga = TRUE;
+#else /* IBM-PC */
+ /*
+ * Ensure a zero start address. This is mainly to recover after
+ * switching from pcvt using userconfig(). The registers are w/o
+ * for old hardware so it's too hard to relocate the active screen
+ * memory.
+ */
+ outb(crtc_addr, 12);
+ outb(crtc_addr + 1, 0);
+ outb(crtc_addr, 13);
+ outb(crtc_addr + 1, 0);
- /* extract the hardware cursor location and hide the cursor for now */
- adp = vid_get_adapter(adapter);
- (*vidsw[adapter]->read_hw_cursor)(adp, &col, &row);
-#ifndef PC98
- (*vidsw[adapter]->set_hw_cursor)(adp, -1, -1);
-#endif
+ /* extract cursor location */
+ outb(crtc_addr, 14);
+ hw_cursor = inb(crtc_addr + 1) << 8;
+ outb(crtc_addr, 15);
+ hw_cursor |= inb(crtc_addr + 1);
+
+ /*
+ * Validate cursor location. It may be off the screen. Then we must
+ * not use it for the initial buffer offset.
+ */
+ if (hw_cursor >= ROW * COL)
+ hw_cursor = (ROW - 1) * COL;
+
+ /* move hardware cursor out of the way */
+ outb(crtc_addr, 14);
+ outb(crtc_addr + 1, 0xff);
+ outb(crtc_addr, 15);
+ outb(crtc_addr + 1, 0xff);
+#endif /* PC98 */
/* set up the first console */
current_default = &user_default;
@@ -3803,27 +4241,57 @@ scinit(void)
init_scp(console[0]);
cur_console = console[0];
+#ifndef PC98
+ /* discard the video mode table if we are not familiar with it... */
+ if (video_mode_ptr) {
+ bzero(mode_map, sizeof(mode_map));
+ bcopy(video_mode_ptr + MODE_PARAM_SIZE*console[0]->mode,
+ vgaregs2, sizeof(vgaregs2));
+ switch (comp_vgaregs(vgaregs, video_mode_ptr
+ + MODE_PARAM_SIZE*console[0]->mode)) {
+ case COMP_IDENTICAL:
+ map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
+ /*
+ * This is a kludge for Toshiba DynaBook SS433 whose BIOS video
+ * mode table entry has the actual # of rows at the offset 1;
+ * BIOSes from other manufacturers store the # of rows - 1 there.
+ * XXX
+ */
+ rows_offset = vgaregs[1] + 1
+ - video_mode_ptr[MODE_PARAM_SIZE*console[0]->mode + 1];
+ break;
+ case COMP_SIMILAR:
+ map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
+ mode_map[console[0]->mode] = vgaregs;
+ rows_offset = vgaregs[1] + 1
+ - video_mode_ptr[MODE_PARAM_SIZE*console[0]->mode + 1];
+ vgaregs[1] -= rows_offset - 1;
+ break;
+ case COMP_DIFFERENT:
+ default:
+ video_mode_ptr = NULL;
+ mode_map[console[0]->mode] = vgaregs;
+ rows_offset = 1;
+ break;
+ }
+ }
+#endif
/* copy screen to temporary buffer */
- if (ISTEXTSC(console[0]))
- generic_bcopy((ushort *)(console[0]->adp->va_window), sc_buffer,
- console[0]->xsize * console[0]->ysize * sizeof(u_short));
+ if (!VESA_MODE(console[0]->mode))
+ generic_bcopy(Crtat, sc_buffer,
+ console[0]->xsize * console[0]->ysize * sizeof(u_short));
console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
= sc_buffer;
- if (col >= console[0]->xsize)
- col = 0;
- if (row >= console[0]->ysize)
- row = console[0]->ysize - 1;
- console[0]->xpos = col;
- console[0]->ypos = row;
- console[0]->cursor_pos = console[0]->cursor_oldpos =
- sc_buffer + row*console[0]->xsize + col;
-#ifndef PC98
- console[0]->cursor_saveunder = *console[0]->cursor_pos;
-#else
+ console[0]->cursor_pos = console[0]->cursor_oldpos = sc_buffer + hw_cursor;
+#ifdef PC98
console[0]->atr_buf = Atrat;
- console[0]->cursor_atr = Atrat + row*console[0]->xsize + col;
+ console[0]->cursor_atr = Atrat + hw_cursor;
+#else
+ console[0]->cursor_saveunder = *console[0]->cursor_pos;
#endif
+ console[0]->xpos = hw_cursor % COL;
+ console[0]->ypos = hw_cursor / COL;
for (i=1; i<MAXCONS; i++)
console[i] = NULL;
kernel_console.esc = 0;
@@ -3838,141 +4306,93 @@ scinit(void)
scr_map[i] = scr_rmap[i] = i;
}
#ifdef PC98
- scr_map[0x5c] = (u_char)0xfc; /* for backslash */
+ scr_map[0x5c] = (u_char)0xfc; /* for backslash */
#endif
- /* Save font and palette */
- if (ISFONTAVAIL(cur_console->adp->va_flags)) {
- if (fonts_loaded & FONT_16) {
- copy_font(cur_console, LOAD, 16, font_16);
- } else {
- copy_font(cur_console, SAVE, 16, font_16);
- fonts_loaded = FONT_16;
- set_destructive_cursor(cur_console);
+#ifndef PC98
+ /* Save font and palette if VGA */
+ if (crtc_type == KD_VGA) {
+ if (!VESA_MODE(bios_video_mode)) {
+ if (fonts_loaded & FONT_16) {
+ copy_font(LOAD, FONT_16, font_16);
+ } else {
+ copy_font(SAVE, FONT_16, font_16);
+ fonts_loaded = FONT_16;
+ }
+ set_destructive_cursor(console[0]);
}
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- */
- (*vidsw[cur_console->ad]->show_font)(cur_console->adp, 0);
+ save_palette();
}
- save_palette(cur_console->adp, palette);
-#if NSPLASH > 0
- /* we are ready to put up the splash image! */
- splash_init(cur_console->adp, scsplash_callback);
+#ifdef SC_SPLASH_SCREEN
+ /*
+ * If not booting verbosely, put up the splash.
+ * Note that the splash screen is not currently supported in
+ * the VESA mode.
+ */
+ if (!(boothowto & RB_VERBOSE) && !VESA_MODE(bios_video_mode))
+ scsplash_init();
+#endif
#endif
}
static void
scshutdown(int howto, void *arg)
{
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
if (!cold && cur_console->smode.mode == VT_AUTO
&& console[0]->smode.mode == VT_AUTO)
switch_scr(cur_console, 0);
shutdown_in_progress = TRUE;
}
-int
-sc_clean_up(scr_stat *scp)
+static void
+map_mode_table(char *map[], char *table, int max)
{
- int error;
+ int i;
- sc_touch_scrn_saver();
-#if NSPLASH > 0
- if ((error = wait_scrn_saver_stop()))
- return error;
-#endif /* NSPLASH */
- scp->status &= ~MOUSE_VISIBLE;
- remove_cutmarking(scp);
- return 0;
+ for(i = 0; i < max; ++i)
+ map[i] = table + i*MODE_PARAM_SIZE;
+ for(; i < MODE_MAP_SIZE; ++i)
+ map[i] = NULL;
}
-void
-sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear)
+static int
+map_mode_num(int mode)
{
- if (scp->scr_buf)
- free(scp->scr_buf, M_DEVBUF);
- scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
-#ifdef PC98
- if (scp->atr_buf)
- free(scp->atr_buf, M_DEVBUF);
- scp->atr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
-#endif
+ static struct {
+ int from;
+ int to;
+ } mode_map[] = {
+ { M_ENH_B80x43, M_ENH_B80x25 },
+ { M_ENH_C80x43, M_ENH_C80x25 },
+ { M_VGA_M80x30, M_VGA_M80x25 },
+ { M_VGA_C80x30, M_VGA_C80x25 },
+ { M_VGA_M80x50, M_VGA_M80x25 },
+ { M_VGA_C80x50, M_VGA_C80x25 },
+ { M_VGA_M80x60, M_VGA_M80x25 },
+ { M_VGA_C80x60, M_VGA_C80x25 },
+ { M_VGA_MODEX, M_VGA_CG320 },
+ };
+ int i;
- if (clear) {
- /* clear the screen and move the text cursor to the top-left position */
- sc_clear_screen(scp);
- } else {
- /* retain the current cursor position, but adjust pointers */
- move_crsr(scp, scp->xpos, scp->ypos);
- scp->cursor_oldpos = scp->cursor_pos;
+ for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
+ if (mode_map[i].from == mode)
+ return mode_map[i].to;
}
-
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
+ return mode;
}
-void
-sc_alloc_cut_buffer(scr_stat *scp, int wait)
+static char
+*get_mode_param(scr_stat *scp, int mode)
{
- if ((cut_buffer == NULL)
- || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
- if (cut_buffer != NULL)
- free(cut_buffer, M_DEVBUF);
- cut_buffer_size = scp->xsize * scp->ysize + 1;
- cut_buffer = (u_char *)malloc(cut_buffer_size,
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (cut_buffer != NULL)
- cut_buffer[0] = '\0';
- }
-}
-
-void
-sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait)
-{
- u_short *usp;
-#ifdef PC98
- u_short *atr_usp;
-#endif
-
- if (lines < scp->ysize)
- lines = scp->ysize;
-
- usp = scp->history;
- scp->history = NULL;
- if (usp != NULL) {
- free(usp, M_DEVBUF);
- if (extra > 0)
- extra_history_size += extra;
- }
-#ifdef PC98
- atr_usp = scp->his_atr;
- scp->his_atr = NULL;
- if (atr_usp != NULL)
- free(atr_usp, M_DEVBUF);
-#endif
-
- scp->history_size = lines * scp->xsize;
- if (lines > imax(sc_history_size, scp->ysize))
- extra_history_size -= lines - imax(sc_history_size, scp->ysize);
- usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (usp != NULL)
- bzero(usp, scp->history_size * sizeof(u_short));
- scp->history_head = scp->history_pos = usp;
- scp->history = usp;
-#ifdef PC98
- atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (atr_usp != NULL)
- bzero(atr_usp, scp->history_size * sizeof(u_short));
- scp->his_atr_head = scp->his_atr_pos = atr_usp;
- scp->his_atr = atr_usp;
-#endif
+ if (mode >= MODE_MAP_SIZE)
+ mode = map_mode_num(mode);
+ if (mode < MODE_MAP_SIZE)
+ return mode_map[mode];
+ else
+ return NULL;
}
static scr_stat
@@ -3982,21 +4402,34 @@ static scr_stat
scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
init_scp(scp);
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
+ scp->scr_buf = scp->cursor_pos = scp->cursor_oldpos =
+ (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + ((scp->mouse_ypos/scp->font_size)*scp->xsize +
+ scp->mouse_xpos/8);
+ scp->history_head = scp->history_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(scp->history_head, scp->history_size*sizeof(u_short));
+ scp->history = scp->history_head;
#ifdef PC98
- sc_alloc_cut_buffer(scp, TRUE);
-#else /* PC98 */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, TRUE);
-#endif /* PC98 */
- sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
+ scp->atr_buf = scp->cursor_atr = scp->atr_buf =
+ (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ scp->his_atr_head = scp->his_atr_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(scp->his_atr_head, scp->history_size*sizeof(u_short));
+ scp->his_atr = scp->his_atr_head;
+#endif
/* SOS
#ifndef PC98
- if (scp->adp->va_flags & V_ADP_MODECHANGE)
+ if (crtc_type == KD_VGA && video_mode_ptr)
#endif
set_mode(scp);
*/
- sc_clear_screen(scp);
+ clear_screen(scp);
#ifndef PC98
scp->cursor_saveunder = *scp->cursor_pos;
#endif
@@ -4006,30 +4439,47 @@ static scr_stat
static void
init_scp(scr_stat *scp)
{
- video_info_t info;
-
- scp->ad = adapter;
- scp->adp = vid_get_adapter(scp->ad);
- (*vidsw[scp->ad]->get_info)(scp->adp, initial_video_mode, &info);
-
- scp->status = 0;
- scp->mode = initial_video_mode;
- scp->scr_buf = NULL;
- if (info.vi_flags & V_INFO_GRAPHICS) {
- scp->status |= GRAPHICS_MODE;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- } else {
- scp->xsize = info.vi_width;
- scp->ysize = info.vi_height;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*info.vi_cheight;
- scp->font_size = info.vi_cheight;
+#ifdef PC98
+ scp->mode = M_PC98_80x25;
+ scp->font_size = 16;
+#else
+ switch(crtc_type) {
+ case KD_VGA:
+ if (VESA_MODE(bios_video_mode))
+ scp->mode = bios_video_mode;
+ else if (crtc_addr == MONO_BASE)
+ scp->mode = M_VGA_M80x25;
+ else
+ scp->mode = M_VGA_C80x25;
+ else
+ scp->font_size = 16;
+ break;
+ case KD_CGA:
+ if (crtc_addr == MONO_BASE)
+ scp->mode = M_B80x25;
+ else
+ scp->mode = M_C80x25;
+ scp->font_size = 8;
+ break;
+ case KD_EGA:
+ scp->mode = M_B80x25;
+ else
+ scp->mode = M_C80x25;
+ scp->font_size = 14;
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ default:
+ scp->mode = M_EGAMONO80x25;
+ scp->font_size = 14;
+ break;
}
- scp->xoff = scp->yoff = 0;
+ scp->initial_mode = scp->mode;
+#endif
+ scp->xsize = COL;
+ scp->ysize = ROW;
+ scp->xpixel = scp->xsize * 8;
+ scp->ypixel = scp->ysize * scp->font_size;
scp->xpos = scp->ypos = 0;
scp->saved_xpos = scp->saved_ypos = -1;
scp->start = scp->xsize * scp->ysize;
@@ -4041,21 +4491,28 @@ init_scp(scr_stat *scp)
current_default->std_color;
scp->term.rev_color = current_default->rev_color;
scp->border = BG_BLACK;
- scp->cursor_start = bios_value.cursor_start;
- scp->cursor_end = bios_value.cursor_end;
+#ifdef PC98
+ scp->cursor_start = 0;
+ scp->cursor_end = 0;
+#else
+ scp->cursor_start = *(char *)pa_to_va(0x461);
+ scp->cursor_end = *(char *)pa_to_va(0x460);
+#endif
scp->mouse_xpos = scp->xsize*8/2;
scp->mouse_ypos = scp->ysize*scp->font_size/2;
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
scp->mouse_signal = 0;
scp->mouse_pid = 0;
scp->mouse_proc = NULL;
- scp->kbd_mode = K_XLATE;
scp->bell_pitch = BELL_PITCH;
scp->bell_duration = BELL_DURATION;
-#ifndef PC98
- scp->status |= (bios_value.shift_state & 0x20) ? NLKED : 0;
-#endif
+#ifdef PC98
+ scp->status = 0;
scp->status |= CURSOR_ENABLED;
+#else
+ scp->status = (*(char *)pa_to_va(0x417) & 0x20) ? NLKED : 0;
+ scp->status |= CURSOR_ENABLED;
+#endif
scp->pid = 0;
scp->proc = NULL;
scp->smode.mode = VT_AUTO;
@@ -4063,25 +4520,25 @@ init_scp(scr_stat *scp)
#ifdef PC98
scp->his_atr_head = scp->his_atr_pos = scp->his_atr = NULL;
#endif
- scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
+ scp->history_size = imax(SC_HISTORY_SIZE, scp->ysize) * scp->xsize;
#ifdef KANJI
scp->kanji_1st_char = 0;
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
#endif
}
-static void
-get_bios_values(void)
+static u_char
+*get_fstr(u_int c, u_int *len)
{
-#ifdef PC98
- bios_value.cursor_start = 0;
- bios_value.cursor_end = 0;
- bios_value.shift_state = 0;
-#else /* !PC98 */
- bios_value.cursor_start = *(u_int8_t *)pa_to_va(0x461);
- bios_value.cursor_end = *(u_int8_t *)pa_to_va(0x460);
- bios_value.shift_state = *(u_int8_t *)pa_to_va(0x417);
-#endif
+ u_int i;
+
+ if (!(c & FKEY))
+ return(NULL);
+ i = (c & 0xFF) - F_FN;
+ if (i > n_fkey_tab)
+ return(NULL);
+ *len = fkey_tab[i].len;
+ return(fkey_tab[i].str);
}
static void
@@ -4144,46 +4601,151 @@ history_down_line(scr_stat *scp)
* return NOKEY if there is nothing there.
*/
static u_int
-scgetc(keyboard_t *kbd, u_int flags)
+scgetc(u_int flags)
{
- u_int c;
- int this_scr;
- int f;
- int i;
-
- if (kbd == NULL)
- return NOKEY;
+ struct key_t *key;
+ u_char scancode, keycode;
+ u_int state, action;
+ int c;
+ static u_char esc_flag = 0, compose = 0;
+ static u_int chr = 0;
next_code:
- /* I don't like this, but... XXX */
- if (flags & SCGETC_CN)
- sccnupdate(cur_console);
/* first see if there is something in the keyboard port */
- for (;;) {
- c = kbd_read_char(kbd, !(flags & SCGETC_NONBLOCK));
- if (c == ERRKEY) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- } else if (c == NOKEY)
- return c;
- else
- break;
+ if (flags & SCGETC_NONBLOCK) {
+ c = read_kbd_data_no_wait(sc_kbdc);
+ if (c == -1)
+ return(NOKEY);
+ } else {
+ do {
+ c = read_kbd_data(sc_kbdc);
+ } while(c == -1);
}
+ scancode = (u_char)c;
/* make screensaver happy */
- if (!(c & RELKEY))
- sc_touch_scrn_saver();
+ if (!(scancode & 0x80)) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
- if (!(flags & SCGETC_CN))
+ if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
- add_keyboard_randomness(c);
+ add_keyboard_randomness(scancode);
+
+ if (cur_console->status & KBD_RAW_MODE)
+ return scancode;
+ }
+
+ keycode = scancode & 0x7F;
+ switch (esc_flag) {
+ case 0x00: /* normal scancode */
+ switch(scancode) {
+ case 0xB8: /* left alt (compose key) */
+ if (compose) {
+ compose = 0;
+ if (chr > 255) {
+ do_bell(cur_console,
+ BELL_PITCH, BELL_DURATION);
+ chr = 0;
+ }
+ }
+ break;
+ case 0x38:
+ if (!compose) {
+ compose = 1;
+ chr = 0;
+ }
+ break;
+ case 0xE0:
+ case 0xE1:
+ esc_flag = scancode;
+ goto next_code;
+ }
+ break;
+ case 0xE0: /* 0xE0 prefix */
+ esc_flag = 0;
+ switch (keycode) {
+ case 0x1C: /* right enter key */
+ keycode = 0x59;
+ break;
+ case 0x1D: /* right ctrl key */
+ keycode = 0x5A;
+ break;
+ case 0x35: /* keypad divide key */
+ keycode = 0x5B;
+ break;
+ case 0x37: /* print scrn key */
+ keycode = 0x5C;
+ break;
+ case 0x38: /* right alt key (alt gr) */
+ keycode = 0x5D;
+ break;
+ case 0x47: /* grey home key */
+ keycode = 0x5E;
+ break;
+ case 0x48: /* grey up arrow key */
+ keycode = 0x5F;
+ break;
+ case 0x49: /* grey page up key */
+ keycode = 0x60;
+ break;
+ case 0x4B: /* grey left arrow key */
+ keycode = 0x61;
+ break;
+ case 0x4D: /* grey right arrow key */
+ keycode = 0x62;
+ break;
+ case 0x4F: /* grey end key */
+ keycode = 0x63;
+ break;
+ case 0x50: /* grey down arrow key */
+ keycode = 0x64;
+ break;
+ case 0x51: /* grey page down key */
+ keycode = 0x65;
+ break;
+ case 0x52: /* grey insert key */
+ keycode = 0x66;
+ break;
+ case 0x53: /* grey delete key */
+ keycode = 0x67;
+ break;
- if (cur_console->kbd_mode != K_XLATE)
- return KEYCHAR(c);
+ /* the following 3 are only used on the MS "Natural" keyboard */
+ case 0x5b: /* left Window key */
+ keycode = 0x69;
+ break;
+ case 0x5c: /* right Window key */
+ keycode = 0x6a;
+ break;
+ case 0x5d: /* menu key */
+ keycode = 0x6b;
+ break;
+ default: /* ignore everything else */
+ goto next_code;
+ }
+ break;
+ case 0xE1: /* 0xE1 prefix */
+ esc_flag = 0;
+ if (keycode == 0x1D)
+ esc_flag = 0x1D;
+ goto next_code;
+ /* NOT REACHED */
+ case 0x1D: /* pause / break */
+ esc_flag = 0;
+ if (keycode != 0x45)
+ goto next_code;
+ keycode = 0x68;
+ break;
+ }
+
+ if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
+ return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */
- if (!ISGRAPHSC(cur_console) && cur_console->history
- && cur_console->status & SLKED) {
+ if (cur_console->history && cur_console->status & SLKED) {
+ int i;
cur_console->status &= ~CURSOR_ENABLED;
if (!(cur_console->status & BUFFER_SAVED)) {
@@ -4209,11 +4771,10 @@ next_code:
cur_console->history + cur_console->history_size)
#ifdef PC98
{
+#endif
cur_console->history_head=cur_console->history;
- cur_console->his_atr_head=cur_console->his_atr;
- }
-#else
- cur_console->history_head=cur_console->history;
+#ifdef PC98
+ cur_console->his_atr_head=cur_console->his_atr; }
#endif
}
cur_console->history_pos = cur_console->history_head;
@@ -4222,10 +4783,12 @@ next_code:
#endif
history_to_screen(cur_console);
}
- switch (c) {
- /* FIXME: key codes */
- case SPCLKEY | FKEY | F(49): /* home key */
- remove_cutmarking(cur_console);
+ switch (scancode) {
+#ifdef PC98
+ case 0x3E: /* home key */
+#else
+ case 0x47: /* home key */
+#endif
cur_console->history_pos = cur_console->history_head;
#ifdef PC98
cur_console->his_atr_pos = cur_console->his_atr_head;
@@ -4233,8 +4796,11 @@ next_code:
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(57): /* end key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3F: /* help key */
+#else
+ case 0x4F: /* end key */
+#endif
cur_console->history_pos =
WRAPHIST(cur_console, cur_console->history_head,
cur_console->xsize*cur_console->ysize);
@@ -4246,65 +4812,183 @@ next_code:
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(50): /* up arrow key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3A: /* up arrow key */
+#else
+ case 0x48: /* up arrow key */
+#endif
if (history_up_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(58): /* down arrow key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3D: /* down arrow key */
+#else
+ case 0x50: /* down arrow key */
+#endif
if (history_down_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(51): /* page up key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x36: /* roll up key */
+#else
+ case 0x49: /* page up key */
+#endif
for (i=0; i<cur_console->ysize; i++)
if (history_up_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
- case SPCLKEY | FKEY | F(59): /* page down key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x37: /* roll down key */
+#else
+ case 0x51: /* page down key */
+#endif
for (i=0; i<cur_console->ysize; i++)
if (history_down_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
}
}
- /*
- * Process and consume special keys here. Return a plain char code
- * or a char code with the META flag or a function key code.
- */
- if (c & RELKEY) {
- /* key released */
- /* goto next_code */
+ if (compose) {
+ switch (scancode) {
+ /* key pressed process it */
+ case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
+ chr = (scancode - 0x40) + chr*10;
+ goto next_code;
+ case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
+ chr = (scancode - 0x47) + chr*10;
+ goto next_code;
+ case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
+ chr = (scancode - 0x4E) + chr*10;
+ goto next_code;
+ case 0x52: /* keypad 0 */
+ chr *= 10;
+ goto next_code;
+
+ /* key release, no interest here */
+ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
+ case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
+ case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
+ case 0xD2: /* keypad 0 */
+ goto next_code;
+
+ case 0x38: /* left alt key */
+ break;
+ default:
+ if (chr) {
+ compose = chr = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ break;
+ }
+ }
+
+ state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0));
+ if ((!agrs && (cur_console->status & ALKED))
+ || (agrs && !(cur_console->status & ALKED)))
+ keycode += ALTGR_OFFSET;
+ key = &key_map.key[keycode];
+ if ( ((key->flgs & FLAG_LOCK_C) && (cur_console->status & CLKED))
+ || ((key->flgs & FLAG_LOCK_N) && (cur_console->status & NLKED)) )
+ state ^= 1;
+
+ /* Check for make/break */
+ action = key->map[state];
+ if (scancode & 0x80) { /* key released */
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
+ case LSH:
+ shfts &= ~1;
+ break;
+ case RSH:
+ shfts &= ~2;
+ break;
+ case LCTR:
+ ctls &= ~1;
+ break;
+ case RCTR:
+ ctls &= ~2;
+ break;
+ case LALT:
+ alts &= ~1;
+ break;
+ case RALT:
+ alts &= ~2;
+ break;
+ case NLK:
+ nlkcnt = 0;
+ break;
+ case CLK:
+#ifdef PC98
+ cur_console->status &= ~CLKED;
+ update_leds(cur_console->status);
+#else
+ clkcnt = 0;
+#endif
+ break;
+ case SLK:
+ slkcnt = 0;
+ break;
+ case ASH:
+ agrs = 0;
+ break;
+ case ALK:
+ alkcnt = 0;
+ break;
+ case META:
+ metas = 0;
+ break;
+ }
+ }
+ if (chr && !compose) {
+ action = chr;
+ chr = 0;
+ return(action);
+ }
} else {
/* key pressed */
- if (c & SPCLKEY) {
- c &= ~SPCLKEY;
- switch (KEYCHAR(c)) {
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
/* LOCKING KEYS */
- case NLK: case CLK: case ALK:
+ case NLK:
+ if (!nlkcnt) {
+ nlkcnt++;
+ if (cur_console->status & NLKED)
+ cur_console->status &= ~NLKED;
+ else
+ cur_console->status |= NLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case CLK:
+#ifdef PC98
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+#else
+ if (!clkcnt) {
+ clkcnt++;
+ if (cur_console->status & CLKED)
+ cur_console->status &= ~CLKED;
+ else
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+ }
+#endif
break;
case SLK:
- kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&f);
- if (f & SLKED) {
- cur_console->status |= SLKED;
- } else {
+ if (!slkcnt) {
+ slkcnt++;
if (cur_console->status & SLKED) {
cur_console->status &= ~SLKED;
- if (cur_console->status & BUFFER_SAVED) {
+ if (cur_console->status & BUFFER_SAVED){
int i;
u_short *ptr = cur_console->history_save;
#ifdef PC98
@@ -4328,12 +5012,11 @@ next_code:
cur_console->history +
cur_console->history_size)
#ifdef PC98
- {
- ptr = cur_console->history;
- ptr_a = cur_console->his_atr;
- }
-#else
+ {
+#endif
ptr = cur_console->history;
+#ifdef PC98
+ ptr_a = cur_console->his_atr; }
#endif
}
cur_console->status &= ~BUFFER_SAVED;
@@ -4346,64 +5029,73 @@ next_code:
}
scstart(VIRTUAL_TTY(get_scr_num()));
}
+ else
+ cur_console->status |= SLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case ALK:
+ if (!alkcnt) {
+ alkcnt++;
+ if (cur_console->status & ALKED)
+ cur_console->status &= ~ALKED;
+ else
+ cur_console->status |= ALKED;
+ update_leds(cur_console->status);
}
break;
/* NON-LOCKING KEYS */
case NOP:
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
break;
-
- case BTAB:
- return c;
-
case SPSC:
/* force activatation/deactivation of the screen saver */
- if (!scrn_blanked) {
+ accents = 0;
+ if (scrn_blanked <= 0) {
run_scrn_saver = TRUE;
scrn_time_stamp -= scrn_blank_time;
}
-#if NSPLASH > 0
+#ifdef SC_SPLASH_SCREEN
if (cold) {
/*
* While devices are being probed, the screen saver need
* to be invoked explictly. XXX
*/
- if (scrn_blanked) {
+ if (scrn_blanked > 0) {
scsplash_stick(FALSE);
stop_scrn_saver(current_saver);
} else {
- if (!ISGRAPHSC(cur_console)) {
+ if ((cur_console->status & UNKNOWN_MODE) == 0) {
scsplash_stick(TRUE);
(*current_saver)(TRUE);
}
}
}
-#endif /* NSPLASH */
+#endif
break;
-
case RBT:
#ifndef SC_DISABLE_REBOOT
+ accents = 0;
shutdown_nice();
#endif
break;
-
-#if NAPM > 0
case SUSP:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_SUSPEND);
+#endif
break;
+
case STBY:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_STANDBY);
- break;
-#else
- case SUSP:
- case STBY:
- break;
#endif
+ break;
case DBG:
#ifdef DDB /* try to switch to console 0 */
+ accents = 0;
/*
* TRY to make sure the screen saver is stopped,
* and the screen is updated before switching to
@@ -4418,47 +5110,135 @@ next_code:
printf("No debugger in kernel\n");
#endif
break;
-
+ case LSH:
+ shfts |= 1;
+ break;
+ case RSH:
+ shfts |= 2;
+ break;
+ case LCTR:
+ ctls |= 1;
+ break;
+ case RCTR:
+ ctls |= 2;
+ break;
+ case LALT:
+ alts |= 1;
+ break;
+ case RALT:
+ alts |= 2;
+ break;
+ case ASH:
+ agrs = 1;
+ break;
+ case META:
+ metas = 1;
+ break;
case NEXT:
- this_scr = get_scr_num();
- for (i = this_scr + 1; i != this_scr; i = (i + 1)%MAXCONS) {
- struct tty *tp = VIRTUAL_TTY(i);
+ {
+ int next, this = get_scr_num();
+ accents = 0;
+ for (next = this+1; next != this; next = (next+1)%MAXCONS) {
+ struct tty *tp = VIRTUAL_TTY(next);
if (tp->t_state & TS_ISOPEN) {
- switch_scr(cur_console, i);
+ switch_scr(cur_console, next);
break;
}
}
+ }
break;
-
+ case BTAB:
+ accents = 0;
+ return(BKEY);
default:
- if (KEYCHAR(c) >= F_SCR && KEYCHAR(c) <= L_SCR) {
- switch_scr(cur_console, KEYCHAR(c) - F_SCR);
+ if (action >= F_ACC && action <= L_ACC) {
+ /* turn it into an index */
+ action -= F_ACC - 1;
+ if ((action > accent_map.n_accs)
+ || (accent_map.acc[action - 1].accchar == 0)) {
+ /*
+ * The index is out of range or pointing to an
+ * empty entry.
+ */
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ /*
+ * If the same accent key has been hit twice,
+ * produce the accent char itself.
+ */
+ if (action == accents) {
+ action = accent_map.acc[accents - 1].accchar;
+ accents = 0;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ /* remember the index and wait for the next key stroke */
+ accents = action;
break;
}
- /* assert(c & FKEY) */
- return c;
+ if (accents > 0) {
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ if (action >= F_SCR && action <= L_SCR) {
+ switch_scr(cur_console, action - F_SCR);
+ break;
+ }
+ if (action >= F_FN && action <= L_FN)
+ action |= FKEY;
+ return(action);
}
- /* goto next_code */
- } else {
- /* regular keys (maybe MKEY is set) */
- return c;
}
- }
+ else {
+ if (accents) {
+ struct acc_t *acc;
+ int i;
+ acc = &accent_map.acc[accents - 1];
+ accents = 0;
+ /*
+ * If the accent key is followed by the space key,
+ * produce the accent char itself.
+ */
+ if (action == ' ') {
+ action = acc->accchar;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ for (i = 0; i < NUM_ACCENTCHARS; ++i) {
+ if (acc->map[i][0] == 0) /* end of the map entry */
+ break;
+ if (acc->map[i][0] == action) {
+ action = acc->map[i][1];
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ }
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ if (metas)
+ action |= MKEY;
+ return(action);
+ }
+ }
goto next_code;
}
int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, int offset, int nprot)
{
- struct tty *tp;
- struct scr_stat *scp;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
- return (*vidsw[scp->ad]->mmap)(scp->adp, offset);
+#ifdef PC98
+ if (offset > 0x48000 - PAGE_SIZE)
+#else
+ if (offset > 0x20000 - PAGE_SIZE)
+#endif
+ return -1;
+ return i386_btop((VIDEOMEM + offset));
}
/*
@@ -4490,213 +5270,585 @@ mask2attr(struct term_stat *term)
return attr;
}
-static int
-save_kbd_state(scr_stat *scp)
+static void
+set_keyboard(int command, int data)
{
- int state;
- int error;
+#ifndef PC98
+ int s;
+
+ if (sc_kbdc == NULL)
+ return;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(sc_kbdc, TRUE))
+ return;
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error == 0) {
- scp->status &= ~LOCK_MASK;
- scp->status |= state;
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(sc_kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(sc_kbdc, FALSE);
+ splx(s);
+ return;
}
- return error;
-}
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
-static int
-update_kbd_state(int new_bits, int mask)
-{
- int state;
- int error;
+ if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
+ send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
- if (mask != LOCK_MASK) {
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error)
- return error;
- state &= ~mask;
- state |= new_bits & mask;
- } else {
- state = new_bits & LOCK_MASK;
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
}
- error = kbd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+#else
+ splx(s);
+#endif
+ kbdc_lock(sc_kbdc, FALSE);
+#endif
}
-static int
-update_kbd_leds(int which)
+static void
+update_leds(int which)
{
- int error;
+#ifndef PC98
+ int s;
+ static u_char xlate_leds[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
- which &= LOCK_MASK;
- error = kbd_ioctl(kbd, KDSETLED, (caddr_t)&which);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ /* replace CAPS led with ALTGR led for ALTGR keyboards */
+ if (key_map.n_keys > ALTGR_OFFSET) {
+ if (which & ALKED)
+ which |= CLKED;
+ else
+ which &= ~CLKED;
+ }
+
+ set_keyboard(KBDC_SET_LEDS, xlate_leds[which & LED_MASK]);
+#endif
}
-int
+void
set_mode(scr_stat *scp)
{
- video_info_t info;
-
- /* reject unsupported mode */
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return 1;
+ char special_modetable[MODE_PARAM_SIZE];
+ char *mp;
+ int s;
+ int i;
- /* if this vty is not currently showing, do nothing */
if (scp != cur_console)
- return 0;
+ return;
- /* setup video hardware for the given mode */
- (*vidsw[scp->ad]->set_mode)(scp->adp, scp->mode);
- Crtat = (u_short *)scp->adp->va_window;
+#ifndef PC98
+ /*
+ * even if mode switching is disabled, we can change back
+ * to the initial mode or the custom mode based on the initial
+ * mode if we have saved register values upon start-up.
+ */
+ mp = get_mode_param(scp, scp->mode);
+ if (mp == NULL)
+ return;
+ bcopy(mp, &special_modetable, sizeof(special_modetable));
+#endif
+ /* setup video hardware for the given mode */
#ifdef PC98
- if (scp->status & UNKNOWN_MODE) {
- while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
- outb(0x62, 0xc); /* text off */
- outb(0xA2, 0xd); /* graphics on */
- } else {
- while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
- outb(0x62, 0xd); /* text off */
- outb(0xA2, 0xc); /* graphics on */
- }
+#ifdef LINE30
+ switch (scp->mode) {
+ case M_PC98_80x25: /* VGA TEXT MODES */
+ initialize_gdc(T25_G400);
+ break;
+ case M_PC98_80x30:
+ initialize_gdc(T30_G400);
+ break;
+ default:
+ break;
+ }
#endif
-
- if (!(scp->status & GRAPHICS_MODE)) {
- /* load appropriate font */
- if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) {
- if (scp->font_size < 14) {
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- } else if (scp->font_size >= 16) {
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- } else {
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- }
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
- (*vidsw[scp->ad]->show_font)(scp->adp, 0);
+ if (scp->status & UNKNOWN_MODE) {
+ while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
+ outb(0x62, 0xc); /* text off */
+ outb(0xA2, 0xd); /* graphics on */
+ } else {
+ while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
+ outb(0x62, 0xd); /* text on */
+ outb(0xA2, 0xc); /* graphics off */
}
+#else /* IBM-PC */
+ switch (scp->mode) {
+ case M_VGA_C80x60: case M_VGA_M80x60:
+ special_modetable[2] = 0x08;
+ special_modetable[19] = 0x47;
+ goto special_480l;
+
+ case M_VGA_C80x30: case M_VGA_M80x30:
+ special_modetable[19] = 0x4f;
+special_480l:
+ special_modetable[9] |= 0xc0;
+ special_modetable[16] = 0x08;
+ special_modetable[17] = 0x3e;
+ special_modetable[26] = 0xea;
+ special_modetable[28] = 0xdf;
+ special_modetable[31] = 0xe7;
+ special_modetable[32] = 0x04;
+ goto setup_mode;
+
+ case M_ENH_C80x43: case M_ENH_B80x43:
+ special_modetable[28] = 87;
+ goto special_80x50;
+
+ case M_VGA_C80x50: case M_VGA_M80x50:
+special_80x50:
+ special_modetable[2] = 8;
+ special_modetable[19] = 7;
+ goto setup_mode;
+
+ case M_VGA_C40x25: case M_VGA_C80x25:
+ case M_VGA_M80x25:
+ case M_B40x25: case M_C40x25:
+ case M_B80x25: case M_C80x25:
+ case M_ENH_B40x25: case M_ENH_C40x25:
+ case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
+
+setup_mode:
+ set_vgaregs(special_modetable);
+ scp->font_size = special_modetable[2];
+
+ /* set font type (size) */
+ if (scp->font_size < 14) {
+ if (fonts_loaded & FONT_8)
+ copy_font(LOAD, FONT_8, font_8);
+ i = 0x0a; /* font 2 */
+ } else if (scp->font_size >= 16) {
+ if (fonts_loaded & FONT_16)
+ copy_font(LOAD, FONT_16, font_16);
+ i = 0x00; /* font 0 */
+ } else {
+ if (fonts_loaded & FONT_14)
+ copy_font(LOAD, FONT_14, font_14);
+ i = 0x05; /* font 1 */
+ }
+ /*
+ * FONT KLUDGE:
+ * This is an interim kludge to display correct font.
+ * Always use the font page #0 on the video plane 2.
+ * Somehow we cannot show the font in other font pages on
+ * some video cards... XXX
+ */
+ i = 0x00;
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x03); outb(TSREG, i);
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(scp);
mark_all(scp);
- }
+ break;
- if (scp->status & PIXEL_MODE)
- generic_bzero((u_char *)(scp->adp->va_window),
- scp->xpixel*scp->ypixel/8);
- set_border(scp, scp->border);
+ case M_VGA_MODEX:
+ /* "unchain" the VGA mode */
+ special_modetable[5-1+0x04] &= 0xf7;
+ special_modetable[5-1+0x04] |= 0x04;
+ /* turn off doubleword mode */
+ special_modetable[10+0x14] &= 0xbf;
+ /* turn off word adressing */
+ special_modetable[10+0x17] |= 0x40;
+ /* set logical screen width */
+ special_modetable[10+0x13] = 80;
+ /* set 240 lines */
+ special_modetable[10+0x11] = 0x2c;
+ special_modetable[10+0x06] = 0x0d;
+ special_modetable[10+0x07] = 0x3e;
+ special_modetable[10+0x10] = 0xea;
+ special_modetable[10+0x11] = 0xac;
+ special_modetable[10+0x12] = 0xdf;
+ special_modetable[10+0x15] = 0xe7;
+ special_modetable[10+0x16] = 0x06;
+ /* set vertical sync polarity to reflect aspect ratio */
+ special_modetable[9] = 0xe3;
+ goto setup_grmode;
+
+ case M_BG320: case M_CG320: case M_BG640:
+ case M_CG320_D: case M_CG640_E:
+ case M_CG640x350: case M_ENH_CG640:
+ case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
+
+setup_grmode:
+ set_vgaregs(special_modetable);
+ scp->font_size = FONT_NONE;
+ break;
-#ifndef PC98
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-#endif
+ default:
+ /* call user defined function XXX */
+ break;
+ }
+#endif /* PC98 */
- return 0;
+ /* set border color for this (virtual) console */
+ set_border(scp->border);
+ return;
}
void
-set_border(scr_stat *scp, int color)
+set_border(u_char color)
{
+ switch (crtc_type) {
+#ifdef PC98
+ case KD_PC98:
+ outb(0x6c, color << 4);
+ break;
+#else
+ case KD_EGA:
+ case KD_VGA:
+ inb(crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x31); outb(ATC, color);
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 5, color & 0x0f); /* color select register */
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+#endif
+ default:
+ break;
+ }
+}
+
#ifndef PC98
- u_char *p;
- int xoff;
- int yoff;
- int xlen;
- int ylen;
+static void
+set_vgaregs(char *modetable)
+{
+ int i, s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i=0; i<4; i++) { /* program sequencer */
+ outb(TSIDX, i+1);
+ outb(TSREG, modetable[i+5]);
+ }
+ outb(MISC, modetable[9]); /* set dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+ outb(crtc_addr, 0x11);
+ outb(crtc_addr+1, inb(crtc_addr+1) & 0x7F);
+ for (i=0; i<25; i++) { /* program crtc */
+ outb(crtc_addr, i);
+ if (i == 14 || i == 15) /* no hardware cursor */
+ outb(crtc_addr+1, 0xff);
+ else
+ outb(crtc_addr+1, modetable[i+10]);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ for (i=0; i<20; i++) { /* program attribute ctrl */
+ outb(ATC, i);
+ outb(ATC, modetable[i+35]);
+ }
+ for (i=0; i<9; i++) { /* program graph data ctrl */
+ outb(GDCIDX, i);
+ outb(GDCREG, modetable[i+55]);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+ splx(s);
+}
+
+static void
+read_vgaregs(char *buf)
+{
+ int i, j;
+ int s;
+
+ bzero(buf, MODE_PARAM_SIZE);
+
+ s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i=0, j=5; i<4; i++) {
+ outb(TSIDX, i+1);
+ buf[j++] = inb(TSREG);
+ }
+ buf[9] = inb(MISC + 10); /* dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+
+ for (i=0, j=10; i<25; i++) { /* crtc */
+ outb(crtc_addr, i);
+ buf[j++] = inb(crtc_addr+1);
+ }
+ for (i=0, j=35; i<20; i++) { /* attribute ctrl */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, i);
+ buf[j++] = inb(ATC + 1);
+ }
+ for (i=0, j=55; i<9; i++) { /* graph data ctrl */
+ outb(GDCIDX, i);
+ buf[j++] = inb(GDCREG);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+ buf[0] = *(char *)pa_to_va(0x44a); /* COLS */
+ buf[1] = *(char *)pa_to_va(0x484); /* ROWS */
+ buf[2] = *(char *)pa_to_va(0x485); /* POINTS */
+ buf[3] = *(char *)pa_to_va(0x44c);
+ buf[4] = *(char *)pa_to_va(0x44d);
+
+ splx(s);
+}
+
+static int
+comp_vgaregs(u_char *buf1, u_char *buf2)
+{
+ static struct {
+ u_char mask;
+ } params[MODE_PARAM_SIZE] = {
+ 0xff, 0x00, 0xff, /* COLS, ROWS, POINTS */
+ 0xff, 0xff, /* page length */
+ 0xfe, 0xff, 0xff, 0xff, /* sequencer registers */
+ 0xf3, /* misc register */
+ 0xff, 0xff, 0xff, 0x7f, 0xff, /* CRTC */
+ 0xff, 0xff, 0xff, 0x7f, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x7f, 0xff, 0xff,
+ 0x7f, 0xff, 0xff, 0xef, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* attribute controller registers */
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xf0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* GDC register */
+ 0xff, 0xff, 0xff, 0xff,
+ };
+ int identical = TRUE;
int i;
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
-
- if (scp->status & PIXEL_MODE) {
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
- p = (u_char *)(scp->adp->va_window);
- xoff = scp->xoff;
- yoff = scp->yoff*scp->font_size;
- xlen = scp->xpixel/8;
- ylen = scp->ysize*scp->font_size;
- if (yoff > 0) {
- generic_bzero(p, xlen*yoff);
- generic_bzero(p + xlen*(yoff + ylen),
- xlen*scp->ypixel - xlen*(yoff + ylen));
- }
- if (xoff > 0) {
- for (i = 0; i < ylen; ++i) {
- generic_bzero(p + xlen*(yoff + i), xoff);
- generic_bzero(p + xlen*(yoff + i) + xoff + scp->xsize,
- xlen - xoff - scp->xsize);
- }
- }
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
+ for (i = 0; i < sizeof(params)/sizeof(params[0]); ++i) {
+ if (params[i].mask == 0) /* don't care */
+ continue;
+ if ((buf1[i] & params[i].mask) != (buf2[i] & params[i].mask))
+ return COMP_DIFFERENT;
+ if (buf1[i] != buf2[i])
+ identical = FALSE;
}
-#else /* PC98 */
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
-#endif /* PC98 */
+ return (identical) ? COMP_IDENTICAL : COMP_SIMILAR;
+
+#if 0
+ for(i = 0; i < 20; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ buf1 += 2; /* skip the cursor shape */
+ buf2 += 2;
+ for(i = 22; i < 24; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ buf1 += 2; /* skip the cursor position */
+ buf2 += 2;
+ for(i = 26; i < MODE_PARAM_SIZE; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ return COMP_IDENTICAL;
+#endif
}
-void
-copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
+static void
+dump_vgaregs(u_char *buf)
{
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
+ int i;
+
+ for(i = 0; i < MODE_PARAM_SIZE;) {
+ printf("%02x ", buf[i]);
+ if ((++i % 16) == 0)
+ printf("\n");
+ }
+}
+
+static void
+set_font_mode(u_char *buf)
+{
+ int s = splhigh();
+
font_loading_in_progress = TRUE;
- if (operation == LOAD) {
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, buf, 0, 256);
- if (sc_flags & CHAR_CURSOR)
- set_destructive_cursor(scp);
- } else if (operation == SAVE) {
- (*vidsw[scp->ad]->save_font)(scp->adp, 0, font_size, buf, 0, 256);
+
+ /* save register values */
+ outb(TSIDX, 0x02); buf[0] = inb(TSREG);
+ outb(TSIDX, 0x04); buf[1] = inb(TSREG);
+ outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
+ outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
+ outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
+ inb(crtc_addr + 6);
+ outb(ATC, 0x10); buf[5] = inb(ATC + 1);
+
+ /* setup vga for loading fonts */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, 0x04);
+ outb(TSIDX, 0x04); outb(TSREG, 0x07);
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
+ outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
+ outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
+#else
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0402);
+ outw(TSIDX, 0x0704);
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0204);
+ outw(GDCIDX, 0x0005);
+ outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
+#endif
+ splx(s);
+}
+
+static void
+set_normal_mode(u_char *buf)
+{
+ char *modetable;
+ int s = splhigh();
+
+ /* setup vga for normal operation mode again */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5]);
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, buf[0]);
+ outb(TSIDX, 0x04); outb(TSREG, buf[1]);
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
+ outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
+ if (crtc_addr == MONO_BASE) {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x08);
+ } else {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
}
+#else
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0002 | (buf[0] << 8));
+ outw(TSIDX, 0x0004 | (buf[1] << 8));
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0004 | (buf[2] << 8));
+ outw(GDCIDX, 0x0005 | (buf[3] << 8));
+ if (crtc_addr == MONO_BASE)
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x08)<<8));
+ else
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
+#endif
+
font_loading_in_progress = FALSE;
+ splx(s);
+}
+#endif
+
+void
+copy_font(int operation, int font_type, char* font_image)
+{
+#ifndef PC98
+ int ch, line, segment, fontsize;
+ u_char buf[PARAM_BUFSIZE];
+ u_char val;
+
+ switch (font_type) {
+ default:
+ case FONT_8:
+ segment = 0x8000;
+ fontsize = 8;
+ break;
+ case FONT_14:
+ segment = 0x4000;
+ fontsize = 14;
+ break;
+ case FONT_16:
+ segment = 0x0000;
+ fontsize = 16;
+ break;
+ }
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ segment = 0x0000;
+ outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ set_font_mode(buf);
+ for (ch=0; ch < 256; ch++)
+ for (line=0; line < fontsize; line++)
+ if (operation)
+ *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line) =
+ font_image[(ch*fontsize)+line];
+ else
+ font_image[(ch*fontsize)+line] =
+ *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line);
+ set_normal_mode(buf);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); /* enable screen */
+#endif
}
static void
set_destructive_cursor(scr_stat *scp)
{
#ifndef PC98
+ u_char buf[PARAM_BUFSIZE];
u_char cursor[32];
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
+ caddr_t address;
int i;
-
- if (!ISFONTAVAIL(scp->adp->va_flags)
- || (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return;
+ char *font_buffer;
if (scp->font_size < 14) {
font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
+ address = (caddr_t)VIDEOMEM + 0x8000;
+ }
+ else if (scp->font_size >= 16) {
font_buffer = font_16;
- font_size = 16;
- } else {
+ address = (caddr_t)VIDEOMEM;
+ }
+ else {
font_buffer = font_14;
- font_size = 14;
+ address = (caddr_t)VIDEOMEM + 0x4000;
}
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ address = (caddr_t)VIDEOMEM;
if (scp->status & MOUSE_VISIBLE) {
if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR)
@@ -4719,24 +5871,14 @@ set_destructive_cursor(scr_stat *scp)
(scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
cursor[i] |= 0xff;
#if 1
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
- font_loading_in_progress = FALSE;
+ set_font_mode(buf);
+ generic_bcopy(cursor, (char *)pa_to_va(address) + DEAD_CHAR * 32, 32);
+ set_normal_mode(buf);
#endif
}
-void
-sc_move_mouse(scr_stat *scp, int x, int y)
-{
- scp->mouse_xpos = x;
- scp->mouse_ypos = y;
- scp->mouse_pos = scp->mouse_oldpos =
- scp->scr_buf + (y / scp->font_size) * scp->xsize + x / 8;
-}
-
static void
set_mouse_pos(scr_stat *scp)
{
@@ -4746,7 +5888,7 @@ set_mouse_pos(scr_stat *scp)
scp->mouse_xpos = 0;
if (scp->mouse_ypos < 0)
scp->mouse_ypos = 0;
- if (!ISTEXTSC(scp)) {
+ if (scp->status & UNKNOWN_MODE) {
if (scp->mouse_xpos > scp->xpixel-1)
scp->mouse_xpos = scp->xpixel-1;
if (scp->mouse_ypos > scp->ypixel-1)
@@ -4979,28 +6121,35 @@ draw_mouse_image(scr_stat *scp)
#ifdef PC98
*(Atrat + (scp->mouse_pos - scp->scr_buf)) ^= 0x4; /* reverse bit */
#else
+ caddr_t address;
+ int i;
+ char *font_buffer;
+ u_char buf[PARAM_BUFSIZE];
u_short buffer[32];
u_short xoffset, yoffset;
- u_short *crt_pos = (u_short *)(scp->adp->va_window)
- + (scp->mouse_pos - scp->scr_buf);
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
- int i;
+ u_short *crt_pos = Crtat + (scp->mouse_pos - scp->scr_buf);
+ int font_size = scp->font_size;
- if (scp->font_size < 14) {
+ if (font_size < 14) {
font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
+ address = (caddr_t)VIDEOMEM + 0x8000;
+ }
+ else if (font_size >= 16) {
font_buffer = font_16;
- font_size = 16;
- } else {
+ address = (caddr_t)VIDEOMEM;
+ }
+ else {
font_buffer = font_14;
- font_size = 14;
+ address = (caddr_t)VIDEOMEM + 0x4000;
}
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ address = (caddr_t)VIDEOMEM;
xoffset = scp->mouse_xpos % 8;
- yoffset = scp->mouse_ypos % scp->font_size;
+ yoffset = scp->mouse_ypos % font_size;
/* prepare mousepointer char's bitmaps */
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
@@ -5029,19 +6178,15 @@ draw_mouse_image(scr_stat *scp)
scp->mouse_cursor[i+96] = buffer[i+font_size] & 0xff;
}
#endif
-
scp->mouse_oldpos = scp->mouse_pos;
#ifndef PC98
#if 1
/* wait for vertical retrace to avoid jitter on some videocards */
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor,
- SC_MOUSE_CHAR, 4);
- font_loading_in_progress = FALSE;
-
+ set_font_mode(buf);
+ generic_bcopy(scp->mouse_cursor, (char *)pa_to_va(address) + SC_MOUSE_CHAR * 32, 128);
+ set_normal_mode(buf);
*(crt_pos) = (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR;
*(crt_pos+scp->xsize) =
(*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2);
@@ -5060,16 +6205,10 @@ draw_mouse_image(scr_stat *scp)
static void
remove_mouse_image(scr_stat *scp)
{
- u_short *crt_pos;
-
- if (!ISTEXTSC(scp))
- return;
-
#ifdef PC98
- crt_pos = Atrat + (scp->mouse_oldpos - scp->scr_buf);
+ u_short *crt_pos = Atrat + (scp->mouse_oldpos - scp->scr_buf);
#else
- crt_pos = (u_short *)(scp->adp->va_window)
- + (scp->mouse_oldpos - scp->scr_buf);
+ u_short *crt_pos = Crtat + (scp->mouse_oldpos - scp->scr_buf);
#endif
#ifdef PC98
@@ -5089,17 +6228,15 @@ remove_mouse_image(scr_stat *scp)
static void
draw_cutmarking(scr_stat *scp)
{
- u_short *crt_pos;
u_short *ptr;
u_short och, nch;
+ for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
#ifdef PC98
- crt_pos = Atrat;
+ nch = och = *(Atrat + (ptr - scp->scr_buf));
#else
- crt_pos = (u_short *)(scp->adp->va_window);
+ nch = och = *(Crtat + (ptr - scp->scr_buf));
#endif
- for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
- nch = och = *(crt_pos + (ptr - scp->scr_buf));
/* are we outside the selected area ? */
if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
scp->mouse_cut_end : scp->mouse_cut_start) ||
@@ -5124,16 +6261,20 @@ draw_cutmarking(scr_stat *scp)
if (ptr != scp->cursor_pos)
nch = (och & 0x88ff) | (*ptr & 0x7000)>>4 | (*ptr & 0x0700)<<4;
else {
- if (sc_flags & CHAR_CURSOR)
+ if (flags & CHAR_CURSOR)
nch = (och & 0x88ff)|(*ptr & 0x7000)>>4|(*ptr & 0x0700)<<4;
else
- if (!(sc_flags & BLINK_CURSOR))
+ if (!(flags & BLINK_CURSOR))
nch = (och & 0xff) | (*ptr & 0xff00);
}
#endif
}
if (nch != och)
- *(crt_pos + (ptr - scp->scr_buf)) = nch;
+#ifdef PC98
+ *(Atrat + (ptr - scp->scr_buf)) = nch;
+#else
+ *(Crtat + (ptr - scp->scr_buf)) = nch;
+#endif
}
}
@@ -5146,15 +6287,43 @@ remove_cutmarking(scr_stat *scp)
}
static void
+save_palette(void)
+{
+#ifndef PC98
+ int i;
+
+ outb(PALRADR, 0x00);
+ for (i=0x00; i<0x300; i++)
+ palette[i] = inb(PALDATA);
+ inb(crtc_addr+6); /* reset flip/flop */
+#endif
+}
+
+void
+load_palette(char *palette)
+{
+#ifndef PC98
+ int i;
+
+ outb(PIXMASK, 0xFF); /* no pixelmask */
+ outb(PALWADR, 0x00);
+ for (i=0x00; i<0x300; i++)
+ outb(PALDATA, palette[i]);
+ inb(crtc_addr+6); /* reset flip/flop */
+ outb(ATC, 0x20); /* enable palette */
+#endif
+}
+
+static void
do_bell(scr_stat *scp, int pitch, int duration)
{
if (cold || shutdown_in_progress)
return;
- if (scp != cur_console && (sc_flags & QUIET_BELL))
+ if (scp != cur_console && (flags & QUIET_BELL))
return;
- if (sc_flags & VISUAL_BELL) {
+ if (flags & VISUAL_BELL) {
if (blink_in_progress)
return;
blink_in_progress = 4;
@@ -5173,7 +6342,7 @@ blink_screen(void *arg)
{
scr_stat *scp = arg;
- if (!ISTEXTSC(scp) || (blink_in_progress <= 1)) {
+ if ((scp->status & UNKNOWN_MODE) || (blink_in_progress <= 1)) {
blink_in_progress = FALSE;
mark_all(scp);
if (delayed_next_scr)
@@ -5183,26 +6352,22 @@ blink_screen(void *arg)
#ifdef PC98
if (blink_in_progress & 1){
fillw(scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
fillw(at2pc98(kernel_default.std_color),
Atrat, scp->xsize * scp->ysize);
} else {
fillw(scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
fillw(at2pc98(kernel_default.rev_color),
Atrat, scp->xsize * scp->ysize);
}
#else
if (blink_in_progress & 1)
fillw(kernel_default.std_color | scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
else
fillw(kernel_default.rev_color | scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
#endif
blink_in_progress--;
timeout(blink_screen, scp, hz / 10);
@@ -5212,105 +6377,225 @@ blink_screen(void *arg)
void
sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
{
-#ifdef PC98
- if (ISTEXTSC(scp))
- generic_bcopy(p + from, (u_short *)(scp->adp->va_window) + from,
- (to - from + 1)*sizeof(u_short));
-#else /* PC98 */
- u_char *font;
- u_char volatile *d;
- u_char *e;
- u_char *f;
- int font_size;
- int line_length;
- int xsize;
- u_short bg;
- int i, j;
- u_char c;
+ if (!VESA_MODE(scp->mode)) {
+ generic_bcopy(p+from, Crtat+from, (to-from+1)*sizeof (u_short));
+ } else if (scp->mode == 0x102) {
+ u_char *d, *e;
+ int i,j;
- if (ISTEXTSC(scp)) {
- generic_bcopy(p + from, (u_short *)(scp->adp->va_window) + from,
- (to - from + 1)*sizeof(u_short));
- } else /* if ISPIXELSC(scp) */ {
if (mark)
- mark = 255;
- font_size = scp->font_size;
- if (font_size < 14)
- font = font_8;
- else if (font_size >= 16)
- font = font_16;
- else
- font = font_14;
- line_length = scp->xpixel/8;
- xsize = scp->xsize;
- d = (u_char *)(scp->adp->va_window)
- + scp->xoff + scp->yoff*font_size*line_length
- + (from%xsize) + font_size*line_length*(from/xsize);
-
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- bg = -1;
+ mark = 255;
+ d = (u_char *)Crtat;
+ d += 10 + 6*16*100 + (from%80) + 16*100*(from/80);
for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- outw(GDCIDX, 0xff08); /* bit mask */
- *d = 0;
- c = *d; /* set the background color in the latch */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = (u_char *)d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
- *e = 0;
- e += line_length;
+ e = d;
+ for (j = 0 ; j < 16; j++) {
+ *e = mark^font_16[(p[i]&0xff)*16+j];
+ e+=100;
}
d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
+ if ((i % 80) == 79)
+ d += 20 + 15*100;
}
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
-
-#if 0 /* VGA only */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- bg = -1;
- for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- *d = 0;
- c = *d; /* set the background color in the latch */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = (u_char *)d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- *e = *f^mark;
- e += line_length;
- }
- d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
+ }
+}
+
+#ifdef SC_SPLASH_SCREEN
+
+static void
+scsplash_init(void)
+{
+#ifndef PC98
+ /*
+ * We currently assume the splash screen always use
+ * VGA_CG320 mode and abort installation if this mode is not
+ * supported with this video card. XXX
+ */
+ if (crtc_type != KD_VGA || get_mode_param(cur_console, M_VGA_CG320) == NULL)
+ return;
+#endif
+
+ if (splash_load() == 0 && add_scrn_saver(scsplash) == 0) {
+ default_saver = scsplash;
+ scrn_blank_time = DEFAULT_BLANKTIME;
+ run_scrn_saver = TRUE;
+ if (!(boothowto & RB_CONFIG)) {
+ scsplash_stick(TRUE);
+ scsplash(TRUE);
}
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
-#endif /* 0 */
}
-#endif /* PC98 */
}
+static void
+scsplash(int show)
+{
+ if (show)
+ splash(TRUE);
+ else if (!sticky_splash)
+ splash(FALSE);
+}
+
+#endif /* SC_SPLASH_SCREEN */
+
+#if defined(PC98) && defined(LINE30) /* 30line */
+
+static void master_gdc_cmd(unsigned int cmd)
+{
+ while ( (inb(0x60) & 2) != 0);
+ outb(0x62, cmd);
+}
+
+static void master_gdc_prm(unsigned int pmtr)
+{
+ while ( (inb(0x60) & 2) != 0);
+ outb(0x60, pmtr);
+}
+
+static void master_gdc_word_prm(unsigned int wpmtr)
+{
+ master_gdc_prm(wpmtr & 0x00ff);
+ master_gdc_prm((wpmtr >> 8) & 0x00ff);
+}
+
+static void master_gdc_fifo_empty(void)
+{
+ while ( (inb(0x60) & 4) == 0);
+}
+
+static void master_gdc_wait_vsync(void)
+{
+ while ( (inb(0x60) & 0x20) != 0);
+ while ( (inb(0x60) & 0x20) == 0);
+}
+
+static void gdc_cmd(unsigned int cmd)
+{
+ while ( (inb(0xa0) & 2) != 0);
+ outb( 0xa2, cmd);
+}
+
+static void gdc_prm(unsigned int pmtr)
+{
+ while ( (inb(0xa0) & 2) != 0);
+ outb( 0xa0, pmtr);
+}
+
+static void gdc_word_prm(unsigned int wpmtr)
+{
+ gdc_prm(wpmtr & 0x00ff);
+ gdc_prm((wpmtr >> 8) & 0x00ff);
+}
+
+static void gdc_fifo_empty(void)
+{
+ while ( (inb(0xa0) & 0x04) == 0);
+}
+
+static void gdc_wait_vsync(void)
+{
+ while ( (inb(0xa0) & 0x20) != 0);
+ while ( (inb(0xa0) & 0x20) == 0);
+}
+
+static int check_gdc_clock(void)
+{
+ if ((inb(0x31) & 0x80) == 0){
+ return _5MHZ;
+ } else {
+ return _2_5MHZ;
+ }
+}
+
+static void initialize_gdc(unsigned int mode)
+{
+ /* start 30line initialize */
+ int m_mode,s_mode,gdc_clock;
+ gdc_clock = check_gdc_clock();
+
+ if (mode == T25_G400){
+ m_mode = _25L;
+ }else{
+ m_mode = _30L;
+ }
+
+ s_mode = 2*mode+gdc_clock;
+
+ gdc_INFO = m_mode;
+
+ master_gdc_cmd(_GDC_RESET);
+ master_gdc_cmd(_GDC_MASTER);
+ gdc_cmd(_GDC_RESET);
+ gdc_cmd(_GDC_SLAVE);
+
+ /* GDC Master */
+ master_gdc_cmd(_GDC_SYNC);
+ master_gdc_prm(0x00); /* flush less */ /* text & graph */
+ master_gdc_prm(master_param[m_mode][GDC_CR]);
+ master_gdc_word_prm(((master_param[m_mode][GDC_HFP] << 10)
+ + (master_param[m_mode][GDC_VS] << 5)
+ + master_param[m_mode][GDC_HS]));
+ master_gdc_prm(master_param[m_mode][GDC_HBP]);
+ master_gdc_prm(master_param[m_mode][GDC_VFP]);
+ master_gdc_word_prm(((master_param[m_mode][GDC_VBP] << 10)
+ + (master_param[m_mode][GDC_LF])));
+ master_gdc_fifo_empty();
+ master_gdc_cmd(_GDC_PITCH);
+ master_gdc_prm(MasterPCH);
+ master_gdc_fifo_empty();
+
+ /* GDC slave */
+ gdc_cmd(_GDC_SYNC);
+ gdc_prm(0x06);
+ gdc_prm(slave_param[s_mode][GDC_CR]);
+ gdc_word_prm((slave_param[s_mode][GDC_HFP] << 10)
+ + (slave_param[s_mode][GDC_VS] << 5)
+ + (slave_param[s_mode][GDC_HS]));
+ gdc_prm(slave_param[s_mode][GDC_HBP]);
+ gdc_prm(slave_param[s_mode][GDC_VFP]);
+ gdc_word_prm((slave_param[s_mode][GDC_VBP] << 10)
+ + (slave_param[s_mode][GDC_LF]));
+ gdc_fifo_empty();
+ gdc_cmd(_GDC_PITCH);
+ gdc_prm(SlavePCH[gdc_clock]);
+ gdc_fifo_empty();
+
+ /* set Master GDC scroll param */
+ master_gdc_wait_vsync();
+ master_gdc_wait_vsync();
+ master_gdc_wait_vsync();
+ master_gdc_cmd(_GDC_SCROLL);
+ master_gdc_word_prm(0);
+ master_gdc_word_prm((master_param[m_mode][GDC_LF] << 4) | 0x0000);
+ master_gdc_fifo_empty();
+
+ /* set Slave GDC scroll param */
+ gdc_wait_vsync();
+ gdc_cmd(_GDC_SCROLL);
+ gdc_word_prm(0);
+ if (gdc_clock == _5MHZ){
+ gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
+ }else{
+ gdc_word_prm(SlaveScrlLF[mode] << 4);
+ }
+ gdc_fifo_empty();
+
+ gdc_word_prm(0);
+ if (gdc_clock == _5MHZ){
+ gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
+ }else{
+ gdc_word_prm(SlaveScrlLF[mode] << 4);
+ }
+ gdc_fifo_empty();
+
+ /* sync start */
+ gdc_cmd(_GDC_STOP);
+
+ gdc_wait_vsync();
+ gdc_wait_vsync();
+ gdc_wait_vsync();
+
+ master_gdc_cmd(_GDC_START);
+}
+#endif /* 30 line */
+
#endif /* NSC */
diff --git a/sys/pc98/pc98/syscons.h b/sys/pc98/pc98/syscons.h
index a265d15277ae..3d4b8d3ed00b 100644
--- a/sys/pc98/pc98/syscons.h
+++ b/sys/pc98/pc98/syscons.h
@@ -1,18 +1,18 @@
/*-
- * Copyright (c) 1992-1998 Sen Schmidt
+ * Copyright (c) 1995 Sen Schmidt
* 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, immediately at the beginning of the file.
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
* 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.
+ * 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
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.27 1999/01/17 15:42:27 kato Exp $
+ * $Id: syscons.h,v 1.24 1998/08/03 10:50:57 kato Exp $
*/
#ifndef _PC98_PC98_SYSCONS_H_
@@ -38,13 +38,8 @@
#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
/* printable chars */
-#ifdef PC98
-#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0f && (ch) < 0x1b) \
- || (ch) < 0x07)
-#else
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
|| (ch) < 0x07)
-#endif
/* macros for "intelligent" screen update */
#define mark_for_update(scp, x) {\
@@ -57,7 +52,11 @@
}
/* status flags */
+#define LOCK_KEY_MASK 0x0000F
+#define LED_MASK 0x00007
#define UNKNOWN_MODE 0x00010
+#define KBD_RAW_MODE 0x00020
+#define KBD_CODE_MODE 0x00040
#define SWITCH_WAIT_REL 0x00080
#define SWITCH_WAIT_ACQ 0x00100
#define BUFFER_SAVED 0x00200
@@ -66,22 +65,15 @@
#define MOUSE_MOVED 0x01000
#define MOUSE_CUTTING 0x02000
#define MOUSE_VISIBLE 0x04000
-#define GRAPHICS_MODE 0x08000
-#define PIXEL_MODE 0x10000
-#define SAVER_RUNNING 0x20000
/* configuration flags */
#define VISUAL_BELL 0x00001
#define BLINK_CURSOR 0x00002
#define CHAR_CURSOR 0x00004
-/* these options are now obsolete; use corresponding options for kbd driver */
-#if 0
#define DETECT_KBD 0x00008
#define XT_KEYBD 0x00010
#define KBD_NORESET 0x00020
-#endif
#define QUIET_BELL 0x00040
-#define VESA800X600 0x00080
/* attribute flags */
#define NORMAL_ATTR 0x00
@@ -92,6 +84,9 @@
#define FOREGROUND_CHANGED 0x10
#define BACKGROUND_CHANGED 0x20
+/* video hardware memory addresses */
+#define VIDEOMEM 0x000A0000
+
/* misc defines */
#define FALSE 0
#define TRUE 1
@@ -116,11 +111,24 @@ static unsigned int BELL_PITCH = 1678;
#define FONT_14 4
#define FONT_16 8
-#ifdef PC98
/* defines related to hardware addresses */
+#ifdef PC98
#define TEXT_GDC IO_GDC1 /* 0x60 */
#define TEXT_VRAM (KERNBASE+0xA0000)
#define ATTR_OFFSET 0x1000
+#else /* IBM */
+#define MONO_BASE 0x3B4 /* crt controller base mono */
+#define COLOR_BASE 0x3D4 /* crt controller base color */
+#define MISC 0x3C2 /* misc output register */
+#define ATC IO_VGA+0x00 /* attribute controller */
+#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
+#define TSREG IO_VGA+0x05 /* timing sequencer data */
+#define PIXMASK IO_VGA+0x06 /* pixel write mask */
+#define PALRADR IO_VGA+0x07 /* palette read address */
+#define PALWADR IO_VGA+0x08 /* palette write address */
+#define PALDATA IO_VGA+0x09 /* palette data register */
+#define GDCIDX IO_VGA+0x0E /* graph data controller idx */
+#define GDCREG IO_VGA+0x0F /* graph data controller data */
#endif
/* special characters */
@@ -146,8 +154,6 @@ typedef struct term_stat {
} term_stat;
typedef struct scr_stat {
- int ad; /* video adapter index */
- video_adapter_t *adp; /* video adapter structure */
u_short *scr_buf; /* buffer when off screen */
#ifdef PC98
u_short *atr_buf; /* buffer when off screen */
@@ -161,14 +167,11 @@ typedef struct scr_stat {
int ysize; /* Y text size */
int xpixel; /* X graphics size */
int ypixel; /* Y graphics size */
- int xoff; /* X offset in pixel mode */
- int yoff; /* Y offset in pixel mode */
int font_size; /* fontsize in Y direction */
int start; /* modified area start */
int end; /* modified area end */
term_stat term; /* terminal emulation stuff */
int status; /* status (bitfield) */
- int kbd_mode; /* keyboard I/O mode */
u_short *cursor_pos; /* cursor buffer position */
u_short *cursor_oldpos; /* cursor old buffer position */
#ifndef PC98
@@ -192,6 +195,7 @@ typedef struct scr_stat {
u_short bell_duration;
u_short bell_pitch;
u_char border; /* border color */
+ int initial_mode; /* initial mode */
int mode; /* mode */
pid_t pid; /* pid of controlling proc */
struct proc *proc; /* proc* of controlling proc */
@@ -208,30 +212,14 @@ typedef struct scr_stat {
#endif
int history_size; /* size of history buffer */
struct apmhook r_hook; /* reconfiguration support */
- int splash_save_mode; /* saved mode for splash screen */
- int splash_save_status; /* saved status for splash screen */
+#ifdef SC_SPLASH_SCREEN
+ u_char splash_save_mode; /* saved mode for splash screen */
+#endif
#ifdef KANJI
u_char kanji_1st_char;
-#define KTYPE_ASCII 0
-#define KTYPE_KANA 1
-#define KTYPE_JKANA 0x10
-#define KTYPE_7JIS 0x20
-#define KTYPE_SJIS 2
-#define KTYPE_UJIS 4
-#define KTYPE_SUKANA 3
-#define KTYPE_SUJIS 6
-#define KTYPE_KANIN 0x80
-#define KTYPE_ASCIN 0x40
- u_char kanji_type; /* 0: Ascii code 1: HANKAKU */
- /* 2: Shift JIS 4: UJIS */
- /* 3: Shift JIS or UJIS HANKAKU */
- /* 6: Shift JIS or UJIS */
+ u_char kanji_type; /* 0: ASCII CODE 1: HANKAKU ? */
+ /* 2: SHIFT JIS 4: EUC */
/* 0x10: JIS HANKAKU 0x20: JIS */
- /* 0x80: Kanji Invoke sequence */
- /* 0x40: Ascii Invoke sequence */
-#define IS_KTYPE_ASCII_or_HANKAKU(A) (!((A) & 0xee))
-#define IS_KTYPE_KANA(A) ((A) & 0x11)
-#define KTYPE_MASK_CTRL(A) ((A) &= 0xF0)
#endif
} scr_stat;
@@ -240,56 +228,22 @@ typedef struct default_attr {
int rev_color; /* reverse hardware color */
} default_attr;
-
-#define ISTEXTSC(scp) (!((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE)))
-#define ISGRAPHSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE)))
-#define ISPIXELSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\
- == PIXEL_MODE)
-#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
-
-#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
-#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
-#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
-
/* misc prototypes used by different syscons related LKM's */
-
-/* syscons.c */
-extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data, int flag,
- struct proc *p);
-
-int set_mode(scr_stat *scp);
-scr_stat *sc_get_scr_stat(dev_t dev);
-
-void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
-void set_border(scr_stat *scp, int color);
-#define save_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
-#define load_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
-
-void sc_touch_scrn_saver(void);
-void sc_clear_screen(scr_stat *scp);
-void sc_move_mouse(scr_stat *scp, int x, int y);
-int sc_clean_up(scr_stat *scp);
-void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear);
-void sc_alloc_cut_buffer(scr_stat *scp, int wait);
-void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait);
-struct tty *scdevtotty(dev_t dev);
-
-/* scvidctl.c */
-int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode,
- int xsize, int ysize, int fontsize);
-int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode);
-int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
- int xsize, int ysize, int fontsize);
-int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
- struct proc *p);
+void set_border(u_char color);
+void set_mode(scr_stat *scp);
+void copy_font(int operation, int font_type, char* font_image);
+void load_palette(char *palette);
+int add_scrn_saver(void (*this)(int));
+int remove_scrn_saver(void (*this)(int));
+
+#ifdef SC_SPLASH_SCREEN
+void splash(int);
+int splash_load(void);
+int splash_unload(void);
+#endif
#ifdef PC98
unsigned int at2pc98(unsigned int attr);
#endif
-#endif /* !_PC98_PC98_SYSCONS_H_ */
+#endif /* !_I386_ISA_SYSCONS_H_ */
diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c
index eb6522bf8fb9..90fc584ca221 100644
--- a/sys/pc98/pc98/wd.c
+++ b/sys/pc98/pc98/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.70 1999/01/16 11:43:12 kato Exp $
+ * $Id: wd.c,v 1.63 1998/09/15 14:07:08 kato Exp $
*/
/* TODO:
@@ -67,8 +67,8 @@
#include "opt_atapi.h"
#include "opt_devfs.h"
#include "opt_hw_wdog.h"
-#include "opt_ide_delay.h"
#include "opt_wd.h"
+#include "pci.h"
#include <sys/param.h>
#include <sys/dkbad.h>
@@ -112,11 +112,7 @@
extern void wdstart(int ctrlr);
-#ifdef IDE_DELAY
-#define TIMEOUT IDE_DELAY
-#else
#define TIMEOUT 10000
-#endif
#define RETRIES 5 /* number of retries before giving up */
#define RECOVERYTIME 500000 /* usec for controller to recover after err */
#define MAXTRANSFER 255 /* max size of transfer in sectors */
@@ -337,16 +333,19 @@ wdprobe(struct isa_device *dvp)
du->dk_ctrlr = dvp->id_unit;
interface = du->dk_ctrlr / 2;
du->dk_interface = interface;
- du->dk_port = dvp->id_iobase;
- if (wddma[interface].wdd_candma != NULL) {
- du->dk_dmacookie =
- wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr,
- du->dk_unit);
- du->dk_altport =
- wddma[interface].wdd_altiobase(du->dk_dmacookie);
- }
- if (du->dk_altport == 0)
+#if !defined(DISABLE_PCI_IDE) && (NPCI > 0)
+ if (wddma[interface].wdd_candma) {
+ du->dk_dmacookie = wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr);
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = wddma[interface].wdd_altiobase(du->dk_dmacookie);
+ } else {
+ du->dk_port = dvp->id_iobase;
du->dk_altport = du->dk_port + wd_ctlr;
+ }
+#else
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = du->dk_port + wd_ctlr;
+#endif
/* check if we have registers that work */
#ifdef PC98
@@ -367,11 +366,9 @@ wdprobe(struct isa_device *dvp)
}
}
du->dk_altport = du->dk_port + wd_ctlr;
-#if 0
if ((PC98_SYSTEM_PARAMETER(0x55d) & 3) == 0) {
goto nodevice;
}
-#endif
outb(0x432,(du->dk_unit)%2);
#else /* IBM-PC */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -395,31 +392,11 @@ wdprobe(struct isa_device *dvp)
if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
inb(du->dk_port + wd_cyl_hi) == 0xeb)
goto reset_ok;
-#ifdef PC98
- du->dk_unit = 2;
-#else
du->dk_unit = 1;
-#endif
outb(du->dk_port + wd_sdh, WDSD_IBM | 0x10); /* slave */
if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
inb(du->dk_port + wd_cyl_hi) == 0xeb)
goto reset_ok;
-#ifdef PC98
- du->dk_unit = 1;
- outb(0x432,(du->dk_unit)%2);
- if (wdreset(du) == 0)
- goto reset_ok;
- /* test for ATAPI signature */
- outb(du->dk_port + wd_sdh, WDSD_IBM); /* master */
- if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
- inb(du->dk_port + wd_cyl_hi) == 0xeb)
- goto reset_ok;
- du->dk_unit = 3;
- outb(du->dk_port + wd_sdh, WDSD_IBM | 0x10); /* slave */
- if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
- inb(du->dk_port + wd_cyl_hi) == 0xeb)
- goto reset_ok;
-#endif
#endif
DELAY(RECOVERYTIME);
if (wdreset(du) != 0) {
@@ -509,8 +486,6 @@ wdattach(struct isa_device *dvp)
struct disk *du;
struct wdparams *wp;
- dvp->id_intr = wdintr;
-
if (dvp->id_unit >= NWDC)
return (0);
@@ -773,17 +748,17 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
+ bufqdisksort(&drive_queue[lunit], bp);
+
+ if (wdutab[lunit].b_active == 0)
+ wdustart(du); /* start drive */
+
/* Pick up changes made by readdisklabel(). */
if (du->dk_flags & DKFL_LABELLING && du->dk_state > RECAL) {
wdsleep(du->dk_ctrlr, "wdlab");
du->dk_state = WANTOPEN;
}
- bufqdisksort(&drive_queue[lunit], bp);
-
- if (wdutab[lunit].b_active == 0)
- wdustart(du); /* start drive */
-
#ifdef CMD640
if (wdtab[du->dk_ctrlr_cmd640].b_active == 0)
#else
@@ -1166,12 +1141,11 @@ wdstart(int ctrlr)
*/
void
-wdintr(void *unitnum)
+wdintr(int unit)
{
register struct disk *du;
register struct buf *bp;
int dmastat = 0; /* Shut up GCC */
- int unit = (int)unitnum;
#ifdef CMD640
int ctrlr_atapi;
@@ -1223,7 +1197,8 @@ wdintr(void *unitnum)
if (du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) {
/* XXX SMP boxes sometimes generate an early intr. Why? */
if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & WDDS_INTERRUPT)
- != 0)
+ == 0)
+ return;
dmastat = wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
}
@@ -2097,8 +2072,7 @@ failed:
* check drive's DMA capability
*/
if (wddma[du->dk_interface].wdd_candma) {
- du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(
- du->dk_port, du->dk_ctrlr, du->dk_unit);
+ du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(du->dk_port, du->dk_ctrlr);
/* does user want this? */
if ((du->cfg_flags & WDOPT_DMA) &&
/* have we got a DMA controller? */
@@ -2502,11 +2476,11 @@ static void
wderror(struct buf *bp, struct disk *du, char *mesg)
{
if (bp == NULL)
- printf("wd%d: %s", du->dk_lunit, mesg);
+ printf("wd%d: %s:\n", du->dk_lunit, mesg);
else
diskerr(bp, "wd", mesg, LOG_PRINTF, du->dk_skip,
dsgetlabel(bp->b_dev, du->dk_slices));
- printf(" (status %b error %b)\n",
+ printf("wd%d: status %b error %b\n", du->dk_lunit,
du->dk_status, WDCS_BITS, du->dk_error, WDERR_BITS);
}
diff --git a/sys/pccard/driver.h b/sys/pccard/driver.h
index bbb255eeac17..5e3a6937217f 100644
--- a/sys/pccard/driver.h
+++ b/sys/pccard/driver.h
@@ -7,13 +7,16 @@
#ifndef _PCCARD_DRIVER_H_
#define _PCCARD_DRIVER_H_
+struct lkm_table;
struct pccard_device;
+extern struct linker_set pccarddrv_set;
void pccard_add_driver __P((struct pccard_device *));
#ifdef _I386_ISA_ISA_DEVICE_H_ /* XXX actually if inthand2_t is declared */
int pccard_alloc_intr __P((u_int imask, inthand2_t *hand, int unit,
u_int *maskp, u_int *pcic_imask));
#endif
+void pccard_configure __P((void));
void pccard_remove_driver __P((struct pccard_device *));
int pcic_probe __P((void)); /* XXX should be linker set */
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 6220a89cc582..333b04e81435 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pccard.c,v 1.67 1998/11/09 09:30:55 peter Exp $
+ * $Id: pccard.c,v 1.65 1998/09/08 18:09:51 brian Exp $
*/
#include "opt_devfs.h"
@@ -50,7 +50,6 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
-#include <i386/isa/intr_machdep.h>
#include "apm.h"
#if NAPM > 0
@@ -99,9 +98,6 @@ static void remove_device(struct pccard_devinfo *);
static inthand2_t slot_irq_handler;
static void power_off_slot(void *);
-static void pccard_configure(void *);
-SYSINIT(pccard, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE + 1, pccard_configure, NULL);
-
#if NAPM > 0
/*
* For the APM stuff, the apmhook structure is kept
@@ -151,41 +147,24 @@ static struct cdevsw crd_cdevsw =
* Each controller indicates the number of slots
* that it sees, and these are mapped to a master
* slot number accessed via the character device entries.
- *
- * XXX this is a relic. Each controller has it's own probe
- * configuration hook. Printing a list of configured devices
- * with pccard support probably isn't all that useful.
*/
-static void
-pccard_configure(dummy)
- void *dummy;
+void
+pccard_configure(void)
{
- struct pccard_device **driver, *drv;
+ struct pccard_device **drivers, *drv;
- /* This isn't strictly correct, but works because of initialize order */
- driver = &drivers;
+#include "pcic.h"
+#if NPCIC > 0
+ pcic_probe();
+#endif
+
+ drivers = (struct pccard_device **)pccarddrv_set.ls_items;
printf("Initializing PC-card drivers:");
- while ((drv = *driver++))
+ while ((drv = *drivers++)) {
printf(" %s", drv->name);
- printf("\n");
-}
-
-int
-pccard_module_handler(module_t mod, int what, void *arg)
-{
- struct pccard_device *drv = (struct pccard_device *)arg;
-
- switch(what) {
- case MOD_LOAD:
pccard_add_driver(drv);
- break;
- case MOD_UNLOAD:
- pccard_remove_driver(drv);
- break;
- default:
- break;
}
- return 0;
+ printf("\n");
}
/*
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 943bbc03443a..1384c5b29b99 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -1,6 +1,6 @@
/*
* Intel PCIC or compatible Controller driver
- * May be built to make a loadable module.
+ * May be built using LKM to make a loadable module.
*-------------------------------------------------------------------------
*
* Copyright (c) 1995 Andrew McRae. All rights reserved.
@@ -36,7 +36,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/select.h>
#include <sys/interrupt.h>
@@ -67,8 +66,9 @@ static void pcic_mapirq __P((struct slot *, int));
static timeout_t pcictimeout;
static struct callout_handle pcictimeout_ch
= CALLOUT_HANDLE_INITIALIZER(&pcictimeout_ch);
-static int pcic_modevent __P((module_t, int, void *));
-static int pcic_unload __P((void));
+#ifdef LKM
+static int pcic_handle __P((struct lkm_table *lkmtp, int cmd));
+#endif
static int pcic_memory(struct slot *, int);
static int pcic_io(struct slot *, int);
static u_int build_freelist(u_int);
@@ -161,6 +161,12 @@ putw(struct pcic_slot *sp, int reg, unsigned short word)
/*
* Loadable kernel module interface.
*/
+#ifdef LKM
+/*
+ * This defines the lkm_misc module use by modload
+ * to define the module name.
+ */
+MOD_MISC(pcic);
/*
* Module handler that processes loads and unloads.
@@ -168,56 +174,73 @@ putw(struct pcic_slot *sp, int reg, unsigned short word)
* is called to install the slots (if any).
*/
static int
-pcic_modevent(module_t mod, int what, void *arg)
+pcic_handle(struct lkm_table *lkmtp, int cmd)
{
int err = 0; /* default = success*/
- static int pcic_started = 0;
- switch (what) {
- case MOD_LOAD:
+ switch(cmd) {
+ case LKM_E_LOAD:
/*
- * Call the probe routine to find the slots. If
- * no slots exist, then don't bother loading the module.
- * XXX but this is not appropriate as a static module.
+ * Don't load twice! (lkmexists() is exported by kern_lkm.c)
*/
- if (pcic_probe())
- pcic_started = 1;
- break;
-
- case MOD_UNLOAD:
+ if (lkmexists(lkmtp))
+ return(EEXIST);
/*
- * Attempt to unload the slot driver.
+ * Call the probe routine to find the slots. If
+ * no slots exist, then don't bother loading the module.
*/
- if (pcic_started) {
- printf("Unloading PCIC driver\n");
- err = pcic_unload();
- pcic_started = 0;
- }
+ if (pcic_probe() == 0)
+ return(ENODEV);
+ break; /* Success*/
+ /*
+ * Attempt to unload the slot driver.
+ */
+ case LKM_E_UNLOAD:
+ printf("Unloading PCIC driver\n");
+ err = pcic_unload(lkmtp, cmd);
break; /* Success*/
- default: /* we only care about load/unload; ignore shutdown */
+ default: /* we only understand load/unload*/
+ err = EINVAL;
break;
}
return(err);
}
-static moduledata_t pcic_mod = {
- "pcic",
- pcic_modevent,
- 0
-};
-
-/* After configure() has run.. bring on the new bus system! */
-DECLARE_MODULE(pcic, pcic_mod, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE);
+/*
+ * External entry point; should generally match name of .o file. The
+ * arguments are always the same for all loaded modules. The "load",
+ * "unload", and "stat" functions in "DISPATCH" will be called under
+ * their respective circumstances unless their value is "lkm_nullcmd".
+ * If called, they are called with the same arguments (cmd is included to
+ * allow the use of a single function, ver is included for version
+ * matching between modules and the kernel loader for the modules).
+ *
+ * Since we expect to link in the kernel and add external symbols to
+ * the kernel symbol name space in a future version, generally all
+ * functions used in the implementation of a particular module should
+ * be static unless they are expected to be seen in other modules or
+ * to resolve unresolved symbols alread existing in the kernel (the
+ * second case is not likely to ever occur).
+ *
+ * The entry point should return 0 unless it is refusing load (in which
+ * case it should return an errno from errno.h).
+ */
+int
+pcic_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(pcic, lkmtp, cmd, ver,
+ pcic_handle, pcic_handle, lkm_nullcmd);
+}
/*
* pcic_unload - Called when unloading a LKM.
* Disables interrupts and resets PCIC.
*/
static int
-pcic_unload()
+pcic_unload(struct lkm_table *lkmtp, int cmd)
{
int slot;
struct pcic_slot *sp = pcic_slots;
@@ -234,6 +257,7 @@ pcic_unload()
return(0);
}
+#endif /* LKM */
#if 0
static void
@@ -525,7 +549,7 @@ printf("Map I/O 0x%x (size 0x%x) on Window %d\n", ip->start, ip->size, win);
int
pcic_probe(void)
{
- int slotnum, validslots = 0;
+ int slotnum, i, validslots = 0;
u_int free_irqs;
struct slot *slt;
struct pcic_slot *sp;
@@ -551,6 +575,9 @@ pcic_probe(void)
cinfo.irqs = free_irqs;
cinfo.imask = &pcic_imask;
+#ifdef LKM
+ bzero(pcic_slots, sizeof(pcic_slots));
+#endif
sp = pcic_slots;
for (slotnum = 0; slotnum < PCIC_MAX_SLOTS; slotnum++, sp++) {
/*
diff --git a/sys/pccard/skel.c b/sys/pccard/skel.c
index 6991ab81d853..b26c69a3cdc6 100644
--- a/sys/pccard/skel.c
+++ b/sys/pccard/skel.c
@@ -41,20 +41,100 @@
#include <sys/select.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/driver.h>
#include <pccard/slot.h>
+/*
+ * This defines the lkm_misc module use by modload
+ * to define the module name.
+ */
+MOD_MISC(skel);
+
static int skelinit(struct pccard_devinfo *); /* init device */
static void skelunload(struct pccard_devinfo *); /* Disable driver */
static int skelintr(struct pccard_devinfo *); /* Interrupt handler */
-PCCARD_MODULE(skel, skelinit, skelunload, skelintr, 0, net_imask);
+static struct pccard_device skel_info = {
+ "skel",
+ skelinit,
+ skelunload,
+ skelintr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+};
+
+DATA_SET(pccarddrv_set, skel_info);
static int opened; /* Rather minimal device state... */
/*
+ * Module handler that processes loads and unloads.
+ * Once the module is loaded, the add driver routine is called
+ * to register the driver.
+ * If an unload is requested the remove driver routine is
+ * called to deregister the driver before unloading.
+ */
+static int
+skel_handle(lkmtp, cmd)
+struct lkm_table *lkmtp;
+int cmd;
+{
+ int i;
+ struct lkm_misc *args = lkmtp->private.lkm_misc;
+ int err = 0; /* default = success*/
+
+ switch( cmd) {
+ case LKM_E_LOAD:
+/*
+ * Now register the driver
+ */
+ pccard_add_driver(&skel_info);
+ break; /* Success*/
+/*
+ * Attempt to deregister the driver.
+ */
+ case LKM_E_UNLOAD:
+ pccard_remove_driver(&skel_info);
+ break; /* Success*/
+
+ default: /* we only understand load/unload*/
+ err = EINVAL;
+ break;
+ }
+
+ return( err);
+}
+
+
+/*
+ * External entry point; should generally match name of .o file. The
+ * arguments are always the same for all loaded modules. The "load",
+ * "unload", and "stat" functions in "MOD_DISPATCH" will be called under
+ * their respective circumstances unless their value is "nosys". If
+ * called, they are called with the same arguments (cmd is included to
+ * allow the use of a single function, ver is included for version
+ * matching between modules and the kernel loader for the modules).
+ *
+ * Since we expect to link in the kernel and add external symbols to
+ * the kernel symbol name space in a future version, generally all
+ * functions used in the implementation of a particular module should
+ * be static unless they are expected to be seen in other modules or
+ * to resolve unresolved symbols alread existing in the kernel (the
+ * second case is not likely to ever occur).
+ *
+ * The entry point should return 0 unless it is refusing load (in which
+ * case it should return an errno from errno.h).
+ */
+int
+skel(lkmtp, cmd, ver)
+struct lkm_table *lkmtp;
+int cmd;
+int ver;
+{
+ MOD_DISPATCH(skel,lkmtp,cmd,ver,skel_handle,skel_handle,nosys)
+}
+/*
* Skeleton driver entry points for PCCARD configuration.
*/
/*
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index 396b96770c9a..94c7f6c3b905 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -86,24 +86,6 @@ struct pccard_device {
struct pccard_device *next;
};
-int pccard_module_handler __P((module_t mod, int what, void *arg));
-
-#define PCCARD_MODULE(name, enable, disable, handler, attr, imask) \
-static struct pccard_device name ## _info = { \
- #name, \
- enable, \
- disable, \
- handler, \
- attr, \
- &imask \
-}; \
-static moduledata_t name ## _mod = { \
- "pccard_" #name, \
- pccard_module_handler, \
- &name ## _info \
-}; \
-DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
-
/*
* Device structure for cards. Each card may have one
* or more pccard drivers attached to it; each driver is assumed
diff --git a/sys/pci/adv_pci.c b/sys/pci/adv_pci.c
index dd81e881d686..2f9e4e1eb712 100644
--- a/sys/pci/adv_pci.c
+++ b/sys/pci/adv_pci.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_pci.c,v 1.3 1998/12/14 06:32:54 dillon Exp $
+ * $Id$
*/
#include <pci.h>
@@ -76,16 +76,16 @@
#define ADV_PCI_MAX_DMA_ADDR (0xFFFFFFFFL)
#define ADV_PCI_MAX_DMA_COUNT (0xFFFFFFFFL)
-static const char* advpciprobe(pcici_t tag, pcidi_t type);
+static char* advpciprobe(pcici_t tag, pcidi_t type);
static void advpciattach(pcici_t config_id, int unit);
/*
* The overrun buffer shared amongst all PCI adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
static struct pci_device adv_pci_driver = {
"adv",
@@ -97,7 +97,7 @@ static struct pci_device adv_pci_driver = {
DATA_SET (pcidevice_set, adv_pci_driver);
-static const char*
+static char*
advpciprobe(pcici_t tag, pcidi_t type)
{
int rev = pci_conf_read(tag, PCI_CLASS_REG) & 0xff;
@@ -122,6 +122,7 @@ static void
advpciattach(pcici_t config_id, int unit)
{
u_int16_t io_port;
+ u_int16_t config_msw;
struct adv_softc *adv;
u_int32_t id;
u_int32_t command;
@@ -251,13 +252,9 @@ advpciattach(pcici_t config_id, int unit)
adv->max_dma_addr = ADV_PCI_MAX_DMA_ADDR;
#if CC_DISABLE_PCI_PARITY_INT
- {
- u_int16_t config_msw;
-
- config_msw = ADV_INW(adv, ADV_CONFIG_MSW);
- config_msw &= 0xFFC0;
- ADV_OUTW(adv, ADV_CONFIG_MSW, config_msw);
- }
+ config_msw = ADV_INW(adv, ADV_CONFIG_MSW);
+ config_msw &= 0xFFC0;
+ ADV_OUTW(adv, ADV_CONFIG_MSW, config_msw);
#endif
if (id == PCI_DEVICE_ID_ADVANSYS_1200A
diff --git a/sys/pci/adw_pci.c b/sys/pci/adw_pci.c
index b65037bdba6b..2109b91d1b0f 100644
--- a/sys/pci/adw_pci.c
+++ b/sys/pci/adw_pci.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adw_pci.c,v 1.2 1998/12/07 21:58:45 archie Exp $
+ * $Id$
*/
#include <pci.h>
@@ -58,7 +58,7 @@
#define ADW_PCI_MAX_DMA_ADDR (0xFFFFFFFFUL)
#define ADW_PCI_MAX_DMA_COUNT (0xFFFFFFFFUL)
-static const char* adwpciprobe(pcici_t tag, pcidi_t type);
+static char* adwpciprobe(pcici_t tag, pcidi_t type);
static void adwpciattach(pcici_t config_id, int unit);
static struct pci_device adw_pci_driver = {
@@ -71,7 +71,7 @@ static struct pci_device adw_pci_driver = {
DATA_SET (pcidevice_set, adw_pci_driver);
-static const char*
+static char*
adwpciprobe(pcici_t tag, pcidi_t type)
{
switch (type) {
@@ -89,9 +89,7 @@ adwpciattach(pcici_t config_id, int unit)
u_int32_t id;
u_int32_t command;
vm_offset_t vaddr;
-#ifdef ADW_ALLOW_MEMIO
vm_offset_t paddr;
-#endif
u_int16_t io_port;
bus_space_tag_t tag;
bus_space_handle_t bsh;
diff --git a/sys/pci/ahc_pci.c b/sys/pci/ahc_pci.c
index e7d54f913248..344658de7a13 100644
--- a/sys/pci/ahc_pci.c
+++ b/sys/pci/ahc_pci.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_pci.c,v 1.4 1998/12/14 05:47:25 dillon Exp $
+ * $Id: ahc_pci.c,v 1.1 1998/09/15 07:25:33 gibbs Exp $
*/
#include <pci.h>
@@ -55,7 +55,6 @@
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
#include <cam/scsi/scsi_all.h>
@@ -139,7 +138,7 @@ static u_int8_t read_brdctl(struct ahc_softc *ahc);
static struct ahc_softc *first_398X;
-static const char* ahc_pci_probe(pcici_t tag, pcidi_t type);
+static char* ahc_pci_probe(pcici_t tag, pcidi_t type);
static void ahc_pci_attach(pcici_t config_id, int unit);
/* Exported for use in the ahc_intr routine */
@@ -155,7 +154,7 @@ static struct pci_device ahc_pci_driver = {
DATA_SET (pcidevice_set, ahc_pci_driver);
-static const char*
+static char*
ahc_pci_probe (pcici_t tag, pcidi_t type)
{
switch (type) {
@@ -1173,6 +1172,7 @@ void
ahc_pci_intr(struct ahc_softc *ahc)
{
u_int8_t status1;
+ pcici_t config_id;
status1 = pci_cfgread(ahc->pci_config_id, PCIR_STATUS + 1, /*bytes*/1);
diff --git a/sys/pci/brktree_reg.h b/sys/pci/brktree_reg.h
index b3f9efd48bf3..9ef9aae3e544 100644
--- a/sys/pci/brktree_reg.h
+++ b/sys/pci/brktree_reg.h
@@ -28,7 +28,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: brktree_reg.h,v 1.22 1998/09/30 21:06:54 sos Exp $
+ * $Id$
*/
#ifndef PCI_LATENCY_TIMER
#define PCI_LATENCY_TIMER 0x0c /* pci timer register */
@@ -369,12 +369,6 @@ struct format_params {
int iform_xtsel;
};
-#ifdef __FreeBSD__
-struct bktr_i2c_softc {
- device_t iicbus;
- device_t smbus;
-};
-#endif
typedef struct bktr_clip bktr_clip_t;
/*
@@ -387,9 +381,6 @@ struct bktr_softc {
struct intrhand bktr_ih; /* interrupt vectoring */
#define pcici_t pci_devaddr_t
#endif
-#ifdef __FreeBSD__
- struct bktr_i2c_softc i2c_sc; /* bt848_i2c device */
-#endif
bt848_ptr_t base; /* Bt848 register physical address */
vm_offset_t phys_base; /* Bt848 register physical address */
pcici_t tag; /* PCI tag, for doing PCI commands */
diff --git a/sys/pci/brooktree848.c b/sys/pci/brooktree848.c
index 7ad19534854a..2801499427dd 100644
--- a/sys/pci/brooktree848.c
+++ b/sys/pci/brooktree848.c
@@ -1,4 +1,4 @@
-/* $Id: brooktree848.c,v 1.60 1998/12/07 21:58:45 archie Exp $ */
+/* $Id$ */
/* BT848 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@@ -353,13 +353,7 @@
#include <machine/ioctl_meteor.h>
#include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
-#include <sys/bus.h>
#include <pci/brktree_reg.h>
-#include <pci/bt848_i2c.h>
-#include <dev/smbus/smbconf.h>
-#include <dev/iicbus/iiconf.h>
-#include "smbus_if.h"
-#include "iicbus_if.h"
#include <sys/sysctl.h>
static int bt848_card = -1;
static int bt848_tuner = -1;
@@ -438,7 +432,7 @@ static bktr_reg_t brooktree[ NBKTR ];
#define MINOR(x) ((x >> 4) & 0x0f)
#define ATTACH_ARGS pcici_t tag, int unit
-static const char* bktr_probe( pcici_t tag, pcidi_t type );
+static char* bktr_probe( pcici_t tag, pcidi_t type );
static void bktr_attach( ATTACH_ARGS );
static u_long bktr_count;
@@ -1123,11 +1117,10 @@ static int readEEProm( bktr_ptr_t bktr, int offset, int count,
#ifdef __FreeBSD__
-
/*
* the boot time probe routine.
*/
-static const char*
+static char*
bktr_probe( pcici_t tag, pcidi_t type )
{
switch (type) {
@@ -1146,6 +1139,8 @@ bktr_probe( pcici_t tag, pcidi_t type )
#endif /* __FreeBSD__ */
+
+
/*
* the attach routine.
*/
@@ -1178,9 +1173,6 @@ bktr_attach( ATTACH_ARGS )
fun = pci_conf_read(tag, 0x40);
pci_conf_write(tag, 0x40, fun | 1);
- /* XXX call bt848_i2c dependent attach() routine */
- if (bt848_i2c_attach(unit, bktr->base, &bktr->i2c_sc))
- printf("bktr%d: i2c_attach: can't attach\n", unit);
#ifdef BROOKTREE_IRQ /* from the configuration file */
old_irq = pci_conf_read(tag, PCI_INTERRUPT_REG);
@@ -1940,6 +1932,7 @@ bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct proc* pr )
static int
video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
{
+ int tmp_int;
bt848_ptr_t bt848;
volatile u_char c_temp;
unsigned int temp;
@@ -1950,6 +1943,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
struct meteor_video *video;
struct bktr_capture_area *cap_area;
vm_offset_t buf;
+ struct format_params *fp;
int i;
char char_temp;
@@ -2998,7 +2992,7 @@ common_ioctl( bktr_ptr_t bktr, bt848_ptr_t bt848, int cmd, caddr_t arg )
*
*/
int
-bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
+bktr_mmap( dev_t dev, int offset, int nprot )
{
int unit;
bktr_ptr_t bktr;
@@ -4167,55 +4161,6 @@ static int oformat_meteor_to_bt( u_long format )
BT848_DATA_CTL_I2CSCL | \
BT848_DATA_CTL_I2CSDA)
-#if defined(__FreeBSD__)
-
-/*
- * The hardware interface is actually SMB commands
- */
-static int
-i2cWrite( bktr_ptr_t bktr, int addr, int byte1, int byte2 )
-{
- char cmd;
-
- if (bktr->id == BROOKTREE_848_ID ||
- bktr->id == BROOKTREE_849_ID)
- cmd = I2C_COMMAND;
- else
- cmd = I2C_COMMAND_878;
-
- if (byte2 != -1) {
- if (smbus_writew(bktr->i2c_sc.smbus, addr, cmd,
- (short)(((byte2 & 0xff) << 8) | (byte1 & 0xff))))
- return (-1);
- } else {
- if (smbus_writeb(bktr->i2c_sc.smbus, addr, cmd,
- (char)(byte1 & 0xff)))
- return (-1);
- }
-
- /* return OK */
- return( 0 );
-}
-
-static int
-i2cRead( bktr_ptr_t bktr, int addr )
-{
- char result;
- char cmd;
-
- if (bktr->id == BROOKTREE_848_ID ||
- bktr->id == BROOKTREE_849_ID)
- cmd = I2C_COMMAND;
- else
- cmd = I2C_COMMAND_878;
-
- if (smbus_readb(bktr->i2c_sc.smbus, addr, cmd, &result))
- return (-1);
-
- return ((int)result);
-}
-
-#else /* defined(__FreeBSD__) */
/*
*
@@ -4300,8 +4245,6 @@ i2cRead( bktr_ptr_t bktr, int addr )
return( (bt848->i2c_data_ctl >> 8) & 0xff );
}
-#endif /* !define(__FreeBSD__) */
-
#if defined( I2C_SOFTWARE_PROBE )
/*
@@ -4418,8 +4361,6 @@ readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
return( 0 );
}
-#define ABSENT (-1)
-
/*
* get a signature of the card
* read all 128 possible i2c read addresses from 0x01 thru 0xff
@@ -4427,6 +4368,7 @@ readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
*
* XXX FIXME: use offset & count args
*/
+#define ABSENT (-1)
static int
signCard( bktr_ptr_t bktr, int offset, int count, u_char* sig )
{
@@ -4482,6 +4424,8 @@ static int locate_tuner_address( bktr_ptr_t bktr) {
if (i2cRead( bktr, 0xc7) != ABSENT) return 0xc6;
return -1; /* no tuner found */
}
+
+#undef ABSENT
/*
* determine the card brand/model
@@ -4489,11 +4433,12 @@ static int locate_tuner_address( bktr_ptr_t bktr) {
* can be used to select a specific device, regardless of the
* autodetection and i2c device checks.
*/
+#define ABSENT (-1)
static void
probeCard( bktr_ptr_t bktr, int verbose )
{
int card, i,j, card_found;
- int status;
+ int status, *test;
bt848_ptr_t bt848;
u_char probe_signature[128], *probe_temp;
int any_i2c_devices;
@@ -4735,6 +4680,7 @@ checkMSP:
checkEnd:
+checkPLL:
#if defined( BKTR_USE_PLL )
bktr->xtal_pll_mode = BT848_USE_PLL;
goto checkPLLEnd;
@@ -4745,9 +4691,7 @@ checkEnd:
if ((card == CARD_HAUPPAUGE) &&
(bktr->id==BROOKTREE_878_ID || bktr->id==BROOKTREE_879_ID) )
bktr->xtal_pll_mode = BT848_USE_PLL;
-#if defined( BKTR_USE_PLL )
checkPLLEnd:
-#endif
bktr->card.tuner_pllAddr = tuner_i2c_address;
diff --git a/sys/pci/bt848_i2c.c b/sys/pci/bt848_i2c.c
deleted file mode 100644
index 176d069a837f..000000000000
--- a/sys/pci/bt848_i2c.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu
- * 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.
- *
- * $Id: bt848_i2c.c,v 1.1 1998/10/31 11:26:38 nsouch Exp $
- *
- */
-
-/*
- * I2C support for the bti2c chipset.
- *
- * From brooktree848.c <fsmp@freefall.org>
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-#include <machine/ioctl_meteor.h>
-#include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
-#include <pci/brktree_reg.h>
-
-#include <pci/bt848_i2c.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include <dev/smbus/smbconf.h>
-
-#include "iicbb_if.h"
-#include "smbus_if.h"
-
-#include "pci.h"
-#include "bktr.h"
-
-#if (NBKTR > 0 && NPCI > 0)
-
-#define I2C_DELAY 40
-
-#define BTI2C_DEBUG(x) if (bti2c_debug) (x)
-static int bti2c_debug = 0;
-
-struct bti2c_softc {
-
- bt848_ptr_t base;
-
- int iic_owned; /* 1 if we own the iicbus */
- int smb_owned; /* 1 if we own the smbbus */
-
- device_t smbus;
- device_t iicbus;
-};
-
-struct bt_data {
- bt848_ptr_t base;
-};
-struct bt_data btdata[NBKTR];
-
-static int bti2c_probe(device_t);
-static int bti2c_attach(device_t);
-static void bti2c_print_child(device_t, device_t);
-
-static int bti2c_iic_callback(device_t, int, caddr_t *);
-static void bti2c_iic_setlines(device_t, int, int);
-static int bti2c_iic_getdataline(device_t);
-static int bti2c_iic_reset(device_t, u_char, u_char, u_char *);
-
-static int bti2c_smb_callback(device_t, int, caddr_t *);
-static int bti2c_smb_writeb(device_t dev, u_char slave, char cmd, char byte);
-static int bti2c_smb_writew(device_t dev, u_char slave, char cmd, short word);
-static int bti2c_smb_readb(device_t dev, u_char slave, char cmd, char *byte);
-
-static devclass_t bti2c_devclass;
-
-static device_method_t bti2c_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, bti2c_probe),
- DEVMETHOD(device_attach, bti2c_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, bti2c_print_child),
-
- /* iicbb interface */
- DEVMETHOD(iicbb_callback, bti2c_iic_callback),
- DEVMETHOD(iicbb_setlines, bti2c_iic_setlines),
- DEVMETHOD(iicbb_getdataline, bti2c_iic_getdataline),
- DEVMETHOD(iicbb_reset, bti2c_iic_reset),
-
- /* smbus interface */
- DEVMETHOD(smbus_callback, bti2c_smb_callback),
- DEVMETHOD(smbus_writeb, bti2c_smb_writeb),
- DEVMETHOD(smbus_writew, bti2c_smb_writew),
- DEVMETHOD(smbus_readb, bti2c_smb_readb),
-
- { 0, 0 }
-};
-
-static driver_t bti2c_driver = {
- "bti2c",
- bti2c_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct bti2c_softc),
-};
-
-/*
- * Call this to pass the base address of the bktr device to the
- * bti2c_i2c layer and initialize all the I2C bus architecture
- */
-int
-bt848_i2c_attach(int unit, bt848_ptr_t base, struct bktr_i2c_softc *i2c_sc)
-{
- device_t interface;
- device_t bitbang;
-
- btdata[unit].base = base;
-
- /* XXX add the I2C interface to the root_bus until pcibus is ready */
- interface = device_add_child(root_bus, "bti2c", unit, NULL);
-
- /* add bit-banging generic code onto bti2c interface */
- bitbang = device_add_child(interface, "iicbb", -1, NULL);
-
- /* probe and attach the interface, we need it NOW
- * bit-banging code is also probed and attached */
- device_probe_and_attach(interface);
- device_probe_and_attach(bitbang);
-
- /* smb and i2c interfaces are available for the bt848 chip
- * connect bit-banging generic code to an iicbus */
- if ((i2c_sc->iicbus = iicbus_alloc_bus(bitbang)))
- device_probe_and_attach(i2c_sc->iicbus);
-
- /* hardware i2c is actually smb over the bti2c interface */
- if ((i2c_sc->smbus = smbus_alloc_bus(interface)))
- device_probe_and_attach(i2c_sc->smbus);
-
- return (0);
-};
-
-/*
- * Not a real probe, we know the device exists since the device has
- * been added after the successfull pci probe.
- */
-static int
-bti2c_probe(device_t dev)
-{
- device_set_desc(dev, "bt848 Hard/Soft I2C controller");
-
- return (0);
-}
-
-static int
-bti2c_attach(device_t dev)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
-
- /* XXX should use ivars with pcibus or pcibus methods to access
- * onboard memory */
- sc->base = btdata[device_get_unit(dev)].base;
-
- return (0);
-}
-
-static void
-bti2c_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
-static int
-bti2c_smb_callback(device_t dev, int index, caddr_t *data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- /* test each time if we already have/haven't the iicbus
- * to avoid deadlocks
- */
- switch (index) {
- case SMB_REQUEST_BUS:
- if (!sc->iic_owned) {
- /* request the iicbus */
- how = *(int *)data;
- error = iicbus_request_bus(sc->iicbus, dev, how);
- if (!error)
- sc->iic_owned = 1;
- }
- break;
-
- case SMB_RELEASE_BUS:
- if (sc->iic_owned) {
- /* release the iicbus */
- error = iicbus_release_bus(sc->iicbus, dev);
- if (!error)
- sc->iic_owned = 0;
- }
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
-bti2c_iic_callback(device_t dev, int index, caddr_t *data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- /* test each time if we already have/haven't the smbus
- * to avoid deadlocks
- */
- switch (index) {
- case IIC_REQUEST_BUS:
- if (!sc->smb_owned) {
- /* request the smbus */
- how = *(int *)data;
- error = smbus_request_bus(sc->smbus, dev, how);
- if (!error)
- sc->smb_owned = 1;
- }
- break;
-
- case IIC_RELEASE_BUS:
- if (sc->smb_owned) {
- /* release the smbus */
- error = smbus_release_bus(sc->smbus, dev);
- if (!error)
- sc->smb_owned = 0;
- }
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
-bti2c_iic_reset(device_t dev, u_char speed, u_char addr, u_char * oldaddr)
-{
- if (oldaddr)
- *oldaddr = 0; /* XXX */
-
- return (IIC_ENOADDR);
-}
-
-static void
-bti2c_iic_setlines(device_t dev, int ctrl, int data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
-
- bti2c = sc->base;
-
- bti2c->i2c_data_ctl = (ctrl << 1) | data;
- DELAY(I2C_DELAY);
-
- return;
-}
-
-static int
-bti2c_iic_getdataline(device_t dev)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
-
- bti2c = sc->base;
-
- return (bti2c->i2c_data_ctl & 0x1);
-}
-
-static int
-bti2c_write(bt848_ptr_t bti2c, u_long data)
-{
- u_long x;
-
- /* clear status bits */
- bti2c->int_stat = (BT848_INT_RACK | BT848_INT_I2CDONE);
-
- BTI2C_DEBUG(printf("w%lx", data));
-
- /* write the address and data */
- bti2c->i2c_data_ctl = data;
-
- /* wait for completion */
- for ( x = 0x7fffffff; x; --x ) { /* safety valve */
- if ( bti2c->int_stat & BT848_INT_I2CDONE )
- break;
- }
-
- /* check for ACK */
- if ( !x || !(bti2c->int_stat & BT848_INT_RACK) ) {
- BTI2C_DEBUG(printf("%c%c", (!x)?'+':'-',
- (!(bti2c->int_stat & BT848_INT_RACK))?'+':'-'));
- return (SMB_ENOACK);
- }
- BTI2C_DEBUG(printf("+"));
-
- /* return OK */
- return( 0 );
-}
-
-static int
-bti2c_smb_writeb(device_t dev, u_char slave, char cmd, char byte)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- u_long data;
-
- data = ((slave & 0xff) << 24) | ((byte & 0xff) << 16) | (u_char)cmd;
-
- return (bti2c_write(sc->base, data));
-}
-
-/*
- * byte1 becomes low byte of word
- * byte2 becomes high byte of word
- */
-static int
-bti2c_smb_writew(device_t dev, u_char slave, char cmd, short word)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- u_long data;
- char low, high;
-
- low = (char)(word & 0xff);
- high = (char)((word & 0xff00) >> 8);
-
- data = ((slave & 0xff) << 24) | ((low & 0xff) << 16) |
- ((high & 0xff) << 8) | BT848_DATA_CTL_I2CW3B | (u_char)cmd;
-
- return (bti2c_write(sc->base, data));
-}
-
-/*
- * The Bt878 and Bt879 differed on the treatment of i2c commands
- */
-static int
-bti2c_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
- u_long x;
-
- bti2c = sc->base;
-
- /* clear status bits */
- bti2c->int_stat = (BT848_INT_RACK | BT848_INT_I2CDONE);
-
- bti2c->i2c_data_ctl = ((slave & 0xff) << 24) | (u_char)cmd;
-
- BTI2C_DEBUG(printf("r%lx/", (u_long)(((slave & 0xff) << 24) | (u_char)cmd)));
-
- /* wait for completion */
- for ( x = 0x7fffffff; x; --x ) { /* safety valve */
- if ( bti2c->int_stat & BT848_INT_I2CDONE )
- break;
- }
-
- /* check for ACK */
- if ( !x || !(bti2c->int_stat & BT848_INT_RACK) ) {
- BTI2C_DEBUG(printf("r%c%c", (!x)?'+':'-',
- (!(bti2c->int_stat & BT848_INT_RACK))?'+':'-'));
- return (SMB_ENOACK);
- }
-
- *byte = (char)((bti2c->i2c_data_ctl >> 8) & 0xff);
- BTI2C_DEBUG(printf("r%x+", *byte));
-
- return (0);
-}
-
-DRIVER_MODULE(bti2c, root, bti2c_driver, bti2c_devclass, 0, 0);
-#endif
diff --git a/sys/pci/bt848_i2c.h b/sys/pci/bt848_i2c.h
deleted file mode 100644
index c7d22c50484e..000000000000
--- a/sys/pci/bt848_i2c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu
- * 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.
- *
- * $Id$
- *
- */
-#ifndef _BT848_I2C_H
-#define _BT848_I2C_H
-
-extern int bt848_i2c_attach(int, bt848_ptr_t, struct bktr_i2c_softc *);
-
-#endif
diff --git a/sys/pci/bt_pci.c b/sys/pci/bt_pci.c
index 3c886d86a462..028624592c29 100644
--- a/sys/pci/bt_pci.c
+++ b/sys/pci/bt_pci.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt_pci.c,v 1.3 1998/11/10 06:45:14 gibbs Exp $
+ * $Id$
*/
#include "pci.h"
@@ -53,7 +53,7 @@
static int btpcideterminebusspace(pcici_t config_id, bus_space_tag_t* tagp,
bus_space_handle_t* bshp);
-static const char* bt_pci_probe(pcici_t tag, pcidi_t type);
+static char* bt_pci_probe(pcici_t tag, pcidi_t type);
static void bt_pci_attach(pcici_t config_id, int unit);
static struct pci_device bt_pci_driver = {
@@ -98,7 +98,7 @@ btpcideterminebusspace(pcici_t config_id, bus_space_tag_t* tagp,
return (0);
}
-static const char*
+static char*
bt_pci_probe (pcici_t config_id, pcidi_t type)
{
switch(type) {
@@ -110,6 +110,7 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
bus_space_handle_t bsh;
pci_info_data_t pci_info;
int error;
+ u_int8_t new_addr;
if (btpcideterminebusspace(config_id, &tag, &bsh) != 0)
break;
@@ -121,8 +122,7 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
/*
* Determine if an ISA compatible I/O port has been
* enabled. If so, record the port so it will not
- * be probed by our ISA probe. If the PCI I/O port
- * was not set to the compatibility port, disable it.
+ * be probed by our ISA probe, and disable the port.
*/
error = bt_cmd(bt, BOP_INQUIRE_PCI_INFO,
/*param*/NULL, /*paramlen*/0,
@@ -131,19 +131,14 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
if (error == 0
&& pci_info.io_port < BIO_DISABLED) {
bt_mark_probed_bio(pci_info.io_port);
- if (bsh != bt_iop_from_bio(pci_info.io_port)) {
- u_int8_t new_addr;
-
- new_addr = BIO_DISABLED;
- bt_cmd(bt, BOP_MODIFY_IO_ADDR,
- /*param*/&new_addr,
- /*paramlen*/1, /*reply_buf*/NULL,
- /*reply_len*/0,
- DEFAULT_CMD_TIMEOUT);
- }
}
+
+ new_addr = BIO_DISABLED;
+ bt_cmd(bt, BOP_MODIFY_IO_ADDR, /*param*/&new_addr,
+ /*paramlen*/1, /*reply_buf*/NULL, /*reply_len*/0,
+ DEFAULT_CMD_TIMEOUT);
bt_free(bt);
- return ("Buslogic Multi-Master SCSI Host Adapter");
+ return ("Buslogic Multimaster SCSI host adapter");
break;
}
default:
diff --git a/sys/pci/cy_pci.c b/sys/pci/cy_pci.c
index 7113155e7cb5..ae48965f69e6 100644
--- a/sys/pci/cy_pci.c
+++ b/sys/pci/cy_pci.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cy_pci.c,v 1.9 1999/01/11 23:43:54 bde Exp $
+ * $Id: cy_pci.c,v 1.5 1997/02/22 09:44:00 peter Exp $
*/
/*
@@ -34,11 +34,8 @@
#include "pci.h"
#if NPCI > 0
-#include "opt_cy_pci_fastintr.h"
-
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -47,7 +44,7 @@
#include <pci/cy_pcireg.h>
-static const char *cy_probe __P((pcici_t, pcidi_t));
+static char *cy_probe __P((pcici_t, pcidi_t));
static void cy_attach __P((pcici_t, int));
extern int cyattach_common(void *, int); /* Not exactly correct */
@@ -64,7 +61,7 @@ static struct pci_device cy_device = {
};
DATA_SET(pcidevice_set, cy_device);
-static const char *
+static char *
cy_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -85,7 +82,6 @@ cy_attach(config_id, unit)
void *vaddr;
u_int32_t ioport;
int adapter;
- u_char plx_ver;
ioport = (u_int32_t) pci_conf_read(config_id, CY_PCI_BASE_ADDR1) & ~0x3;
paddr = pci_conf_read(config_id, CY_PCI_BASE_ADDR2) & ~0xf;
@@ -115,37 +111,16 @@ cy_attach(config_id, unit)
* since the ISA driver must handle the interrupt anyway, we use
* the unit number as the token even for PCI.
*/
- if (
-#ifdef CY_PCI_FASTINTR
- !pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
- (void *)adapter, &tty_imask,
- INTR_EXCL | INTR_FAST) &&
-#endif
- !pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
- (void *)adapter, &tty_imask, 0)) {
+ if (!pci_map_int(config_id, (pci_inthand_t *)cyintr, (void *)adapter, &tty_imask)) {
printf("cy%d: couldn't map interrupt\n", unit);
goto fail;
}
-
/*
* Enable the "local" interrupt input to generate a
* PCI interrupt.
*/
- plx_ver = *((u_char *)vaddr + PLX_VER) & 0x0f;
- switch (plx_ver) {
- case PLX_9050:
- outw(ioport + CY_PLX_9050_ICS,
- inw(ioport + CY_PLX_9050_ICS) | CY_PLX_9050_ICS_IENABLE |
- CY_PLX_9050_ICS_LOCAL_IENABLE);
- break;
- case PLX_9060:
- case PLX_9080:
- default: /* Old board, use PLX_9060 values. */
- outw(ioport + CY_PLX_9060_ICS,
- inw(ioport + CY_PLX_9060_ICS) | CY_PLX_9060_ICS_IENABLE |
- CY_PLX_9060_ICS_LOCAL_IENABLE);
- break;
- }
+ outw(ioport + CY_PLX_ICS, inw(ioport + CY_PLX_ICS) |
+ CY_PLX_ICS_IENABLE | CY_PLX_ICS_LOCAL_IENABLE);
return;
diff --git a/sys/pci/cy_pcireg.h b/sys/pci/cy_pcireg.h
index cc3bb60eb004..412622fe422e 100644
--- a/sys/pci/cy_pcireg.h
+++ b/sys/pci/cy_pcireg.h
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cy_pcireg.h,v 1.4 1999/01/11 23:35:01 bde Exp $
+ * $Id$
*/
#define CY_VENDORID_CYCLADES 0x120e
@@ -35,15 +35,6 @@
#define CY_PCI_BASE_ADDR1 0x14
#define CY_PCI_BASE_ADDR2 0x18
-#define CY_PLX_9050_ICS 0x4c
-#define CY_PLX_9060_ICS 0x68
-#define CY_PLX_9050_ICS_IENABLE 0x040
-#define CY_PLX_9050_ICS_LOCAL_IENABLE 0x001
-#define CY_PLX_9060_ICS_IENABLE 0x100
-#define CY_PLX_9060_ICS_LOCAL_IENABLE 0x800
-
-/* Cyclom-Y Custom Register for PLX ID. */
-#define PLX_VER 0x3400
-#define PLX_9050 0x0b
-#define PLX_9060 0x0c
-#define PLX_9080 0x0d
+#define CY_PLX_ICS 0x68
+#define CY_PLX_ICS_IENABLE 0x100
+#define CY_PLX_ICS_LOCAL_IENABLE 0x800
diff --git a/sys/pci/dpt_pci.c b/sys/pci/dpt_pci.c
index 7bf0e26e3138..7af9a2aece84 100644
--- a/sys/pci/dpt_pci.c
+++ b/sys/pci/dpt_pci.c
@@ -32,7 +32,7 @@
* dptpci.c: PCI Bus Attachment for DPT SCSI HBAs
*/
-#ident "$Id: dpt_pci.c,v 1.10 1998/12/07 21:58:46 archie Exp $"
+#ident "$Id: dpt_pci.c,v 1.8 1998/09/15 08:33:38 gibbs Exp $"
#include "opt_devfs.h"
#include "opt_dpt.h"
@@ -64,7 +64,7 @@
/* Function Prototypes */
-static const char *dpt_pci_probe(pcici_t tag, pcidi_t type);
+static char *dpt_pci_probe(pcici_t tag, pcidi_t type);
static void dpt_pci_attach(pcici_t config_id, int unit);
extern struct cdevsw dpt_cdevsw;
@@ -86,7 +86,7 @@ DATA_SET(pcidevice_set, dpt_pci_driver);
* because we do not know for sure how the two relate.
*/
-static const char *
+static char *
dpt_pci_probe(pcici_t tag, pcidi_t type)
{
u_int32_t class;
@@ -112,13 +112,14 @@ dpt_pci_attach(pcici_t config_id, int unit)
{
dpt_softc_t *dpt;
vm_offset_t vaddr;
-#ifdef DPT_ALLOW_MEMIO
vm_offset_t paddr;
-#endif
u_int16_t io_base;
bus_space_tag_t tag;
bus_space_handle_t bsh;
u_int32_t command;
+ u_int32_t data;
+ int result;
+ int ndx;
int s;
vaddr = NULL;
diff --git a/sys/pci/es1370.c b/sys/pci/es1370.c
deleted file mode 100644
index 7277e7ab1481..000000000000
--- a/sys/pci/es1370.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*
- * Support the ENSONIQ AudioPCI board based on the ES1370 and Codec
- * AK4531.
- *
- * Copyright (c) 1998 by Joachim Kuebart. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgement:
- * This product includes software developed by Joachim Kuebart.
- *
- * 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 ``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.
- *
- * $Id$
- */
-
-#include "pci.h"
-#include "pcm.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#include <pci/es1370_reg.h>
-#include <i386/isa/snd/sound.h>
-#include <i386/isa/snd/ulaw.h>
-
-#if NPCI != 0
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * #defines
- */
-
-#ifdef __alpha__
-#define IO_SPACE_MAPPING ALPHA_BUS_SPACE_IO
-#define MEM_SPACE_MAPPING ALPHA_BUS_SPACE_MEM
-#else /* not __alpha__ */
-#define IO_SPACE_MAPPING I386_BUS_SPACE_IO
-#define MEM_SPACE_MAPPING I386_BUS_SPACE_MEM
-#endif /* not __alpha__ */
-
-#define DMA_ALIGN_THRESHOLD 4
-#define DMA_ALIGN_MASK (~(DMA_ALIGN_THRESHOLD - 1))
-#define DMA_READ_THRESHOLD 0x200
-
-#define MEM_MAP_REG 0x14
-
-#define UNIT(minor) ((minor) >> 4)
-#define DEV(minor) ((minor) & 0xf)
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * PCI IDs of supported chips
- */
-
-#define ES1370_PCI_ID 0x50001274
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * device private data
- */
-
-struct es_info {
- bus_space_tag_t st;
- bus_space_handle_t sh;
-
- bus_dma_tag_t parent_dmat;
- bus_dmamap_t dmam_in, dmam_out;
-
- /* Contents of board's registers */
- u_long ctrl;
- u_long sctrl;
-};
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * prototypes
- */
-
-static void dma_wrintr(snddev_info *);
-static void dma_rdintr(snddev_info *);
-static int es_init(snddev_info *);
-static snd_callback_t es_callback;
-static d_open_t es_dsp_open;
-static d_close_t es_dsp_close;
-static d_ioctl_t es_dsp_ioctl;
-static d_read_t es_dsp_read;
-static d_write_t es_dsp_write;
-static void es_intr(void *);
-static int es_rdabort(snddev_info *);
-static void es_rd_map(void *, bus_dma_segment_t *, int, int);
-static int es_wrabort(snddev_info *);
-static void es_wr_map(void *, bus_dma_segment_t *, int, int);
-static char *es_pci_probe __P((pcici_t, pcidi_t));
-static void es_pci_attach __P((pcici_t, int));
-static int es_rd_dmaupdate(snddev_info *);
-static d_select_t es_select;
-static int es_wr_dmaupdate(snddev_info *);
-static int alloc_dmabuf(snddev_info *, int);
-static int write_codec(snddev_info *, u_char, u_char);
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * PCI driver and PCM driver method tables
- */
-
-static struct pci_device es_pci_driver = {
- "es",
- es_pci_probe,
- es_pci_attach,
- &nsnd,
- NULL
-};
-
-DATA_SET(pcidevice_set, es_pci_driver);
-
-static snddev_info es_op_desc = {
- "ENSONIQ AudioPCI",
-
- 0, /* type, apparently unused */
- NULL, /* ISA probe */
- NULL, /* ISA attach */
-
- es_dsp_open,
- es_dsp_close,
- es_dsp_read,
- es_dsp_write,
- es_dsp_ioctl,
- es_select,
-
- NULL, /* Interrupt Service Routine */
- es_callback,
-
- ES_BUFFSIZE,
-
- AFMT_FULLDUPLEX | AFMT_STEREO | AFMT_U8 | AFMT_S16_LE, /* brag :-) */
-};
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * The mixer interface
- */
-
-static const struct {
- unsigned volidx:4;
- unsigned left:4;
- unsigned right:4;
- unsigned stereo:1;
- unsigned recmask:13;
- unsigned avail:1;
-} mixtable[SOUND_MIXER_NRDEVICES] = {
- [SOUND_MIXER_VOLUME] = { 0, 0x0, 0x1, 1, 0x0000, 1 },
- [SOUND_MIXER_PCM] = { 1, 0x2, 0x3, 1, 0x0400, 1 },
- [SOUND_MIXER_SYNTH] = { 2, 0x4, 0x5, 1, 0x0060, 1 },
- [SOUND_MIXER_CD] = { 3, 0x6, 0x7, 1, 0x0006, 1 },
- [SOUND_MIXER_LINE] = { 4, 0x8, 0x9, 1, 0x0018, 1 },
- [SOUND_MIXER_LINE1] = { 5, 0xa, 0xb, 1, 0x1800, 1 },
- [SOUND_MIXER_LINE2] = { 6, 0xc, 0x0, 0, 0x0100, 1 },
- [SOUND_MIXER_LINE3] = { 7, 0xd, 0x0, 0, 0x0200, 1 },
- [SOUND_MIXER_MIC] = { 8, 0xe, 0x0, 0, 0x0001, 1 },
- [SOUND_MIXER_OGAIN] = { 9, 0xf, 0x0, 0, 0x0000, 1 } };
-
-static int
-mixer_ioctl(snddev_info *d, u_long cmd, caddr_t data, int fflag, struct proc *p)
-{
- int i, j, *val, ret = 0;
-
- val = (int *)data;
- i = cmd & 0xff;
-
- switch (cmd & IOC_DIRMASK) {
- case IOC_IN | IOC_OUT: /* _IOWR */
- switch (i) {
- case SOUND_MIXER_RECSRC:
- for (i = j = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if ((*val & (1 << i)) != 0) {
- if (!mixtable[i].recmask)
- *val &= ~(1 << i);
- else
- j |= mixtable[i].recmask;
- }
- d->mix_recsrc = *val;
- write_codec(d, CODEC_LIMIX1, j & 0x55);
- write_codec(d, CODEC_RIMIX1, j & 0xaa);
- write_codec(d, CODEC_LIMIX2, (j >> 8) & 0x17);
- write_codec(d, CODEC_RIMIX2, (j >> 8) & 0x0f);
- write_codec(d, CODEC_OMIX1, 0x7f);
- write_codec(d, CODEC_OMIX2, 0x3f);
- break;
-
- default:
- if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].avail)
- ret = EINVAL;
- else {
- int l, r, rl, rr;
-
- l = *val & 0xff;
- if (l > 100)
- l = 100;
- if (mixtable[i].left == 0xf) {
- if (l < 2)
- rl = 0x80;
- else
- rl = 7 - (l - 2) / 14;
- } else {
- if (l < 10)
- rl = 0x80;
- else
- rl = 15 - (l - 10) / 6;
- }
- if (mixtable[i].stereo) {
- r = (*val >> 8) & 0xff;
- if (r > 100)
- r = 100;
- if (r < 10)
- rr = 0x80;
- else
- rr = 15 - (r - 10) / 6;
- write_codec(d, mixtable[i].right, rr);
- } else
- r = l;
- write_codec(d, mixtable[i].left, rl);
- *val = d->mix_levels[i] = ((u_int) r << 8) | l;
- }
- break;
- }
- break;
-
- default:
- ret = ENOSYS;
- break;
- }
-
- return (ret);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * File operations
- */
-
-static int
-es_dsp_open(dev_t dev, int oflags, int devtype, struct proc *p)
-{
- int unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
-
- if (d->flags & SND_F_BUSY)
- return (EBUSY);
- d->flags = 0;
-
- d->dbuf_out.total = d->dbuf_out.prev_total =
- d->dbuf_in.total = d->dbuf_in.prev_total = 0;
-
- switch (DEV(minor(dev))) {
- case SND_DEV_DSP16:
- d->play_fmt = d->rec_fmt = AFMT_S16_LE;
- break;
-
- case SND_DEV_DSP:
- d->play_fmt = d->rec_fmt = AFMT_U8;
- break;
-
- case SND_DEV_AUDIO:
- d->play_fmt = d->rec_fmt = AFMT_MU_LAW;
- break;
-
- default:
- return (ENXIO);
- }
-
- if ((oflags & FREAD) == 0)
- d->rec_fmt = 0;
- else if ((oflags & FWRITE) == 0)
- d->play_fmt = 0;
-
- d->play_speed = d->rec_speed = DSP_DEFAULT_SPEED;
-
- d->flags |= SND_F_BUSY;
- if (oflags & O_NONBLOCK)
- d->flags |= SND_F_NBIO;
-
- ask_init(d);
-
- return (0);
-}
-
-static int
-es_dsp_close(dev_t dev, int cflags, int devtype, struct proc *p)
-{
- int unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
-
- d->flags &= ~SND_F_BUSY;
-
- es_rdabort(d);
-
- return (0);
-}
-
-static int
-es_dsp_read(dev_t dev, struct uio *buf, int flag)
-{
- int l, l1, limit, ret = 0, unit = UNIT(minor(dev));
- long s;
- snddev_info *d = &pcm_info[unit];
- snd_dbuf *b = &d->dbuf_in;
-
- if (d->flags & SND_F_READING) {
- /* This shouldn't happen and is actually silly */
- tsleep(&s, PZERO, "sndar", hz);
- return (EBUSY);
- }
- d->flags |= SND_F_READING;
-
- /*
- * XXX Check for SND_F_INIT. If set, wait for DMA to run empty and
- * re-initialize the board
- */
-
- if (buf->uio_resid - d->rec_blocksize > 0)
- limit = buf->uio_resid - d->rec_blocksize;
- else
- limit = 0;
-
- while ((l = buf->uio_resid) > limit) {
- s = spltty();
- es_rd_dmaupdate(d);
- if ((l = min(l, b->rl)) == 0) {
- int timeout;
- if (b->dl == 0)
- dma_rdintr(d);
- if (d->flags & SND_F_NBIO) {
- splx(s);
- break;
- }
- if (buf->uio_resid - limit > b->dl)
- timeout = hz;
- else
- timeout = 1;
- splx(s);
- switch (ret = tsleep((caddr_t)b, PRIBIO | PCATCH,
- "dsprd", timeout)) {
- case EINTR:
- es_rdabort(d);
- /* FALLTHROUGH */
-
- case ERESTART:
- break;
-
- default:
- continue;
- }
- break;
- }
- splx(s);
-
- if ((l1 = b->bufsize - b->rp) < l) {
- if (d->flags & SND_F_XLAT8) {
- translate_bytes(ulaw_dsp, b->buf + b->rp, l1);
- translate_bytes(ulaw_dsp, b->buf, l - l1);
- }
- uiomove(b->buf + b->rp, l1, buf);
- uiomove(b->buf, l - l1, buf);
- } else {
- if (d->flags & SND_F_XLAT8)
- translate_bytes(ulaw_dsp, b->buf + b->rp, l);
- uiomove(b->buf + b->rp, l, buf);
- }
-
- s = spltty();
- b->fl += l;
- b->rl -= l;
- b->rp = (b->rp + l) % b->bufsize;
- splx(s);
- }
-
- d->flags &= ~SND_F_READING;
-
- return (ret);
-}
-
-static int
-es_dsp_write(dev_t dev, struct uio *buf, int flag)
-{
- int l, l1, ret = 0, unit = UNIT(minor(dev));
- long s;
- snddev_info *d = &pcm_info[unit];
- snd_dbuf *b = &d->dbuf_out;
-
- if (d->flags & SND_F_WRITING) {
- /* This shouldn't happen and is actually silly */
- tsleep(&s, PZERO, "sndaw", hz);
- return (EBUSY);
- }
- d->flags |= SND_F_WRITING;
-
- /*
- * XXX Check for SND_F_INIT. If set, wait for DMA to run empty and
- * re-initialize the board
- */
-
- while ((l = buf->uio_resid) != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- if ((l = min(l, b->fl)) == 0) {
- int timeout;
- if (d->flags & SND_F_NBIO) {
- splx(s);
- break;
- }
- if (buf->uio_resid >= b->dl)
- timeout = hz;
- else
- timeout = 1;
- splx(s);
- switch (ret = tsleep((caddr_t)b, PRIBIO | PCATCH,
- "dspwr", timeout)) {
- case EINTR:
- es_wrabort(d);
- /* FALLTHROUGH */
-
- case ERESTART:
- break;
-
- default:
- continue;
- }
- break;
- }
- splx(s);
-
- if ((l1 = b->bufsize - b->fp) < l) {
- uiomove(b->buf + b->fp, l1, buf);
- uiomove(b->buf, l - l1, buf);
- if (d->flags & SND_F_XLAT8) {
- translate_bytes(ulaw_dsp, b->buf + b->fp, l1);
- translate_bytes(ulaw_dsp, b->buf, l - l1);
- }
- } else {
- uiomove(b->buf + b->fp, l, buf);
- if (d->flags & SND_F_XLAT8)
- translate_bytes(ulaw_dsp, b->buf + b->fp, l);
- }
-
- s = spltty();
- b->rl += l;
- b->fl -= l;
- b->fp = (b->fp + l) % b->bufsize;
- if (b->dl == 0)
- dma_wrintr(d);
- splx(s);
- }
-
- d->flags &= ~SND_F_WRITING;
-
- return (ret);
-}
-
-static int
-es_dsp_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
-{
- int ret = 0, unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
- long s;
-
- if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0))
- return mixer_ioctl(d, cmd, data, fflag, p);
-
- switch(cmd) {
- case AIONWRITE:
- if (d->dbuf_out.dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- *(int *)data = d->dbuf_out.fl;
- break;
-
- case FIONREAD:
- if (d->dbuf_in.dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- *(int *)data = d->dbuf_in.rl;
- break;
-
- case SNDCTL_DSP_GETISPACE:
- {
- audio_buf_info *a = (audio_buf_info *)data;
- snd_dbuf *b = &d->dbuf_in;
- if (b->dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- a->bytes = b->fl;
- a->fragments = b->fl / d->rec_blocksize;
- a->fragstotal = b->bufsize / d->rec_blocksize;
- a->fragsize = d->rec_blocksize;
- }
- break;
-
- case SNDCTL_DSP_GETOSPACE:
- {
- audio_buf_info *a = (audio_buf_info *)data;
- snd_dbuf *b = &d->dbuf_out;
- if (b->dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- a->bytes = b->fl;
- a->fragments = b->fl / d->rec_blocksize;
- a->fragstotal = b->bufsize / d->play_blocksize;
- a->fragsize = d->play_blocksize;
- }
- break;
-
- case SNDCTL_DSP_GETIPTR:
- {
- count_info *c = (count_info *)data;
- snd_dbuf *b = &d->dbuf_in;
- if (b->dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- c->bytes = b->total;
- c->blocks = (b->total - b->prev_total +
- d->rec_blocksize - 1) / d->rec_blocksize;
- c->ptr = b->fp;
- b->prev_total = b->total;
- }
- break;
-
- case SNDCTL_DSP_GETOPTR:
- {
- count_info *c = (count_info *)data;
- snd_dbuf *b = &d->dbuf_out;
- if (b->dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- c->bytes = b->total;
- c->blocks = (b->total - b->prev_total +
- d->play_blocksize - 1) / d->play_blocksize;
- c->ptr = b->rp;
- b->prev_total = b->total;
- }
- break;
-
- case AIOSTOP:
- case SNDCTL_DSP_RESET:
- case SNDCTL_DSP_SYNC:
- ret = EINVAL;
- break;
-
- default:
- ret = ENOSYS;
- break;
- }
- return (ret);
-}
-
-static int
-es_select(dev_t i_dev, int rw, struct proc * p)
-{
- return (ENOSYS);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * The interrupt handler
- */
-
-static void
-es_intr (void *p)
-{
- snddev_info *d = (snddev_info *)p;
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned intsrc, sctrl;
-
- intsrc = bus_space_read_4(es->st, es->sh, ES1370_REG_STATUS);
- if ((intsrc & STAT_INTR) == 0)
- return;
-
- sctrl = es->sctrl;
- if (intsrc & STAT_ADC)
- sctrl &= ~SCTRL_R1INTEN;
- if (intsrc & STAT_DAC1)
- sctrl &= ~SCTRL_P1INTEN;
- if (intsrc & STAT_DAC2) {
- sctrl &= ~SCTRL_P2INTEN;
- }
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, sctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- if (intsrc & STAT_DAC2)
- dma_wrintr(d);
- if (intsrc & STAT_ADC)
- dma_rdintr(d);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * DMA hassle
- */
-
-static int
-alloc_dmabuf(snddev_info *d, int rd)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- snd_dbuf *b = rd ? &d->dbuf_in : &d->dbuf_out;
- bus_dmamap_t *dmam = rd ? &es->dmam_in : &es->dmam_out;
-
- if (bus_dmamem_alloc(es->parent_dmat, (void **)&b->buf, BUS_DMA_NOWAIT,
- dmam) != 0 ||
- bus_dmamap_load(es->parent_dmat, *dmam, b->buf, d->bufsize,
- rd ? es_rd_map : es_wr_map, es, 0) != 0)
- return -1;
-
- b->rp = b->fp = b->dl = b->rl = 0;
- b->fl = b->bufsize = d->bufsize;
- return (0);
-}
-
-static int
-es_wr_dmaupdate(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned hwptr, delta;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_DAC2_FRAMECNT >> 8);
- hwptr = (bus_space_read_4(es->st, es->sh,
- ES1370_REG_DAC2_FRAMECNT & 0xff) >> 14) & 0x3fffc;
- delta = (d->dbuf_out.bufsize + hwptr - d->dbuf_out.rp) %
- d->dbuf_out.bufsize;
- d->dbuf_out.rp = hwptr;
- d->dbuf_out.rl -= delta;
- d->dbuf_out.fl += delta;
- d->dbuf_out.total += delta;
-
- return delta;
-}
-
-static int
-es_rd_dmaupdate(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned hwptr, delta;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_ADC_FRAMECNT >> 8);
- hwptr = (bus_space_read_4(es->st, es->sh,
- ES1370_REG_ADC_FRAMECNT & 0xff) >> 14) & 0x3fffc;
- delta = (d->dbuf_in.bufsize + hwptr - d->dbuf_in.fp) %
- d->dbuf_in.bufsize;
- d->dbuf_in.fp = hwptr;
- d->dbuf_in.rl += delta;
- d->dbuf_in.fl -= delta;
- d->dbuf_in.total += delta;
- return delta;
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * Hardware
- */
-
-static int
-es_callback(snddev_info *d, int reason)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- int rd = reason & SND_CB_RD;
-
- switch(reason & SND_CB_REASON_MASK) {
- case SND_CB_INIT:
- es->ctrl = (es->ctrl & ~CTRL_PCLKDIV) |
- (DAC2_SRTODIV(d->play_speed) << CTRL_SH_PCLKDIV);
- snd_set_blocksize(d);
-
- es->sctrl &= ~(SCTRL_R1FMT | SCTRL_P2FMT);
- d->flags &= ~SND_F_XLAT8;
- switch(d->play_fmt) {
- case 0:
- case AFMT_U8:
- break;
-
- case AFMT_S16_LE:
- es->sctrl |= SCTRL_P2SEB;
- break;
-
- case AFMT_MU_LAW:
- d->flags |= SND_F_XLAT8;
- break;
-
- default:
- return (-1);
- }
-
- switch(d->rec_fmt) {
- case 0:
- case AFMT_U8:
- break;
-
- case AFMT_S16_LE:
- es->sctrl |= SCTRL_R1SEB;
- break;
-
- case AFMT_MU_LAW:
- d->flags |= SND_F_XLAT8;
- break;
-
- default:
- return (-1);
- }
-
- if (d->flags & SND_F_STEREO)
- es->sctrl |= SCTRL_P2SMB | SCTRL_R1SMB;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL,
- es->ctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- break;
-
- case SND_CB_START:
- if (rd) {
- es->ctrl |= CTRL_ADC_EN;
- es->sctrl = (es->sctrl & ~SCTRL_R1LOOPSEL) |
- SCTRL_R1INTEN;
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_SCOUNT,
- d->dbuf_in.dl / d->dbuf_in.sample_size - 1);
- } else {
- es->ctrl |= CTRL_DAC2_EN;
- es->sctrl = (es->sctrl & ~(SCTRL_P2ENDINC |
- SCTRL_P2STINC | SCTRL_P2LOOPSEL | SCTRL_P2PAUSE |
- SCTRL_P2DACSEN)) | SCTRL_P2INTEN |
- (((d->play_fmt == AFMT_S16_LE) ? 2 : 1)
- << SCTRL_SH_P2ENDINC);
- bus_space_write_4(es->st, es->sh,
- ES1370_REG_DAC2_SCOUNT,
- d->dbuf_out.dl / d->dbuf_out.sample_size - 1);
- }
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- break;
-
- case SND_CB_ABORT:
- case SND_CB_STOP:
- if (rd)
- es->ctrl &= ~CTRL_ADC_EN;
- else
- es->ctrl &= ~CTRL_DAC2_EN;
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- break;
-
- default:
- return (-1);
- }
- return (0);
-}
-
-static int
-write_codec(snddev_info *d, u_char i, u_char data)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- int wait = 100; /* 100 msec timeout */
-
- do {
- if ((bus_space_read_4(es->st, es->sh, ES1370_REG_STATUS) &
- STAT_CSTAT) == 0) {
- bus_space_write_2(es->st, es->sh, ES1370_REG_CODEC,
- ((u_short)i << CODEC_INDEX_SHIFT) | data);
- return (0);
- }
- DELAY(1000);
- /* tsleep(&wait, PZERO, "sndaw", hz / 1000); */
- } while (--wait);
- printf("pcm: write_codec timed out\n");
- return (-1);
-}
-
-static void
-es_wr_map(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct es_info *es = (struct es_info *)arg;
-
- bus_space_write_1(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_DAC2_FRAMEADR >> 8);
- bus_space_write_4(es->st, es->sh, ES1370_REG_DAC2_FRAMEADR & 0xff,
- segs->ds_addr);
- bus_space_write_4(es->st, es->sh, ES1370_REG_DAC2_FRAMECNT & 0xff,
- (segs->ds_len >> 2) - 1);
-}
-
-static void
-es_rd_map(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct es_info *es = (struct es_info *)arg;
-
- bus_space_write_1(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_ADC_FRAMEADR >> 8);
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_FRAMEADR & 0xff,
- segs->ds_addr);
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_FRAMECNT & 0xff,
- (segs->ds_len >> 2) - 1);
-}
-
-static void
-dma_wrintr(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_out;
-
- /*
- * According to Linux driver:
- * dmaupdate()
- * Bei underrun error++
- * wake_up(dac2.wait)
- */
-
- if (b->dl != 0) {
- es_wr_dmaupdate(d);
- wakeup(b);
- }
-
- if (b->rl >= DMA_ALIGN_THRESHOLD &&
- !(d->flags & SND_F_ABORTING)) {
- int l = min(b->rl, d->play_blocksize);
- l &= DMA_ALIGN_MASK;
-
- if (l != b->dl) {
- if (b->dl != 0) {
- d->callback(d, SND_CB_WR | SND_CB_STOP);
- es_wr_dmaupdate(d);
- l = min(b->rl, d->play_blocksize);
- l &= DMA_ALIGN_MASK;
- }
- b->dl = l;
- d->callback(d, SND_CB_WR | SND_CB_START);
- }
- } else if (b->dl != 0) {
- b->dl = 0;
- d->callback(d, SND_CB_WR | SND_CB_STOP);
- es_wr_dmaupdate(d);
- }
-}
-
-static void
-dma_rdintr(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_in;
-
- if (b->dl != 0) {
- es_rd_dmaupdate(d);
- wakeup(b);
- }
-
- if (b->fl >= DMA_READ_THRESHOLD &&
- !(d->flags & SND_F_ABORTING)) {
- int l = min(b->fl, d->rec_blocksize);
- l &= DMA_ALIGN_MASK;
-
- if (l != b->dl) {
- if (b->dl != 0) {
- d->callback(d, SND_CB_RD | SND_CB_STOP);
- es_rd_dmaupdate(d);
- l = min(b->fl, d->rec_blocksize);
- l &= DMA_ALIGN_MASK;
- }
- b->dl = l;
- d->callback(d, SND_CB_RD | SND_CB_START);
- }
- } else {
- if (b->dl != 0) {
- b->dl = 0;
- d->callback(d, SND_CB_RD | SND_CB_STOP);
- es_rd_dmaupdate(d);
- }
- }
-}
-
-static int
-es_wrabort(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_out;
- long s;
- int missing;
-
- s = spltty();
- if (b->dl != 0) {
- wakeup(b);
- b->dl = 0;
- d->callback(d, SND_CB_WR | SND_CB_ABORT);
- }
- es_wr_dmaupdate(d);
- missing = b->rl;
- b->rl = 0;
- b->fp = b->rp;
- b->fl = b->bufsize;
- splx(s);
- return missing;
-}
-
-static int
-es_rdabort(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_in;
- long s;
- int missing;
-
- s = spltty();
- if (b->dl != 0) {
- wakeup(b);
- b->dl = 0;
- d->callback(d, SND_CB_RD | SND_CB_ABORT);
- es_rd_dmaupdate(d);
- }
- missing = b->rl;
- b->rl = 0;
- b->fp = b->rp;
- b->fl = b->bufsize;
- splx(s);
- return missing;
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * Probe and attach the card
- */
-
-static int
-es_init(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- u_int i;
-
- es->ctrl = CTRL_CDC_EN | CTRL_SERR_DIS |
- (DAC2_SRTODIV(DSP_DEFAULT_SPEED) << CTRL_SH_PCLKDIV);
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- es->sctrl = 0;
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, es->sctrl);
- write_codec(d, CODEC_RES_PD, 3);/* No RST, PD */
- write_codec(d, CODEC_CSEL, 0); /* CODEC ADC and CODEC DAC use
- * {LR,B}CLK2 and run off the LRCLK2
- * PLL; program DAC_SYNC=0! */
- write_codec(d, CODEC_ADSEL, 0); /* Recording source is mixer */
- write_codec(d, CODEC_MGAIN, 0); /* MIC amp is 0db */
-
- i = SOUND_MASK_MIC;
- mixer_ioctl(d, SOUND_MIXER_WRITE_RECSRC, (caddr_t) &i, 0, NULL);
- i = 0;
- mixer_ioctl(d, SOUND_MIXER_WRITE_VOLUME, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_PCM, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_SYNTH, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_CD, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE1, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE2, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE3, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_MIC, (caddr_t) &i, 0, NULL);
-
- return (0);
-}
-
-static char *
-es_pci_probe(pcici_t tag, pcidi_t type)
-{
- if (type == ES1370_PCI_ID)
- return ("AudioPCI ES1370");
-
- return (NULL);
-}
-
-static void
-es_pci_attach(pcici_t config_id, int unit)
-{
- snddev_info *d;
- u_int32_t data;
- struct es_info *es;
- pci_port_t io_port;
- int i, mapped;
- vm_offset_t vaddr, paddr;
-
- if (unit > NPCM_MAX)
- return;
-
- d = &pcm_info[unit];
- *d = es_op_desc;
- if ((es = malloc(sizeof(*es), M_DEVBUF, M_NOWAIT)) == NULL) {
- printf("pcm%d: cannot allocate softc\n", unit);
- return;
- }
- bzero(es, sizeof(*es));
- d->device_data = es;
-
- vaddr = paddr = NULL;
- mapped = 0;
- data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- if (mapped == 0 && (data & PCI_COMMAND_MEM_ENABLE)) {
- if (pci_map_mem(config_id, MEM_MAP_REG, &vaddr, &paddr)) {
- es->st = MEM_SPACE_MAPPING;
- es->sh = vaddr;
- mapped++;
- }
- }
- if (mapped == 0 && (data & PCI_COMMAND_IO_ENABLE)) {
- if (pci_map_port(config_id, PCI_MAP_REG_START, &io_port)) {
- es->st = IO_SPACE_MAPPING;
- es->sh = io_port;
- mapped++;
- }
- }
- if (mapped == 0) {
- printf("pcm%d: unable to map any ports\n", unit);
- free(es, M_DEVBUF);
- return;
- }
- printf("pcm%d: using %s space register mapping at %#x\n", unit,
- es->st == IO_SPACE_MAPPING ? "I/O" : "Memory", es->sh);
-
- d->io_base = es->sh;
- d->mix_devs = 0;
- for (i = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if (mixtable[i].avail)
- d->mix_devs |= (1 << i);
- d->mix_rec_devs = 0;
- for (i = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if (mixtable[i].recmask)
- d->mix_rec_devs |= (1 << i);
-
- if (es_init(d) == -1) {
- printf("pcm%d: unable to initialize the card\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
- if (pci_map_int(config_id, es_intr, d, &tty_imask) == 0) {
- printf("pcm%d: unable to map interrupt\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
- if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0,
- /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
- /*highaddr*/BUS_SPACE_MAXADDR,
- /*filter*/NULL, /*filterarg*/NULL,
- /*maxsize*/d->bufsize, /*nsegments*/1, /*maxsegz*/0x3ffff,
- /*flags*/0, &es->parent_dmat) != 0) {
- printf("pcm%d: unable to create dma tag\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
-
- if (alloc_dmabuf(d, 0) == -1 ||
- alloc_dmabuf(d, 1) == -1) {
- printf("pcm%d: unable to allocate dma buffers\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
-
- pcminit(d, unit);
-
- return;
-}
-
-#endif /* NPCI != 0 */
diff --git a/sys/pci/es1370_reg.h b/sys/pci/es1370_reg.h
deleted file mode 100644
index 72546c61449a..000000000000
--- a/sys/pci/es1370_reg.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This supports the ENSONIQ AudioPCI board based on the ES1370.
- *
- * Copyright (c) 1998 Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
- * 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 immediately at the beginning of the file, without modification,
- * 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. Absolutely no warranty of function or purpose is made by the author
- * Joachim Kuebart.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id$
- */
-
-#ifndef _ES1370_REG_H
-#define _ES1370_REG_H
-
-#define ES1370_REG_CONTROL 0x00
-#define ES1370_REG_STATUS 0x04
-#define ES1370_REG_UART_DATA 0x08
-#define ES1370_REG_UART_STATUS 0x09
-#define ES1370_REG_UART_CONTROL 0x09
-#define ES1370_REG_UART_TEST 0x0a
-#define ES1370_REG_MEMPAGE 0x0c
-#define ES1370_REG_CODEC 0x10
-#define CODEC_INDEX_SHIFT 8
-#define ES1370_REG_SERIAL_CONTROL 0x20
-#define ES1370_REG_DAC1_SCOUNT 0x24
-#define ES1370_REG_DAC2_SCOUNT 0x28
-#define ES1370_REG_ADC_SCOUNT 0x2c
-
-#define ES1370_REG_DAC1_FRAMEADR 0xc30
-#define ES1370_REG_DAC1_FRAMECNT 0xc34
-#define ES1370_REG_DAC2_FRAMEADR 0xc38
-#define ES1370_REG_DAC2_FRAMECNT 0xc3c
-#define ES1370_REG_ADC_FRAMEADR 0xd30
-#define ES1370_REG_ADC_FRAMECNT 0xd34
-
-#define DAC2_SRTODIV(x) (((1411200 + (x) / 2) / (x) - 2) & 0x1fff)
-#define DAC2_DIVTOSR(x) (1411200 / ((x) + 2))
-
-#define CTRL_ADC_STOP 0x80000000 /* 1 = ADC stopped */
-#define CTRL_XCTL1 0x40000000 /* SERR pin if enabled */
-#define CTRL_OPEN 0x20000000 /* no function, can be read and
- * written */
-#define CTRL_PCLKDIV 0x1fff0000 /* ADC/DAC2 clock divider */
-#define CTRL_SH_PCLKDIV 16
-#define CTRL_MSFMTSEL 0x00008000 /* MPEG serial data fmt: 0 = Sony, 1
- * = I2S */
-#define CTRL_M_SBB 0x00004000 /* DAC2 clock: 0 = PCLKDIV, 1 = MPEG */
-#define CTRL_WTSRSEL 0x00003000 /* DAC1 clock freq: 0=5512, 1=11025,
- * 2=22050, 3=44100 */
-#define CTRL_SH_WTSRSEL 12
-#define CTRL_DAC_SYNC 0x00000800 /* 1 = DAC2 runs off DAC1 clock */
-#define CTRL_CCB_INTRM 0x00000400 /* 1 = CCB "voice" ints enabled */
-#define CTRL_M_CB 0x00000200 /* recording source: 0 = ADC, 1 =
- * MPEG */
-#define CTRL_XCTL0 0x00000100 /* 0 = Line in, 1 = Line out */
-#define CTRL_BREQ 0x00000080 /* 1 = test mode (internal mem test) */
-#define CTRL_DAC1_EN 0x00000040 /* enable DAC1 */
-#define CTRL_DAC2_EN 0x00000020 /* enable DAC2 */
-#define CTRL_ADC_EN 0x00000010 /* enable ADC */
-#define CTRL_UART_EN 0x00000008 /* enable MIDI uart */
-#define CTRL_JYSTK_EN 0x00000004 /* enable Joystick port (presumably
- * at address 0x200) */
-#define CTRL_CDC_EN 0x00000002 /* enable serial (CODEC) interface */
-#define CTRL_SERR_DIS 0x00000001 /* 1 = disable PCI SERR signal */
-
-#define SCTRL_P2ENDINC 0x00380000 /* */
-#define SCTRL_SH_P2ENDINC 19
-#define SCTRL_P2STINC 0x00070000 /* */
-#define SCTRL_SH_P2STINC 16
-#define SCTRL_R1LOOPSEL 0x00008000 /* 0 = loop mode */
-#define SCTRL_P2LOOPSEL 0x00004000 /* 0 = loop mode */
-#define SCTRL_P1LOOPSEL 0x00002000 /* 0 = loop mode */
-#define SCTRL_P2PAUSE 0x00001000 /* 1 = pause mode */
-#define SCTRL_P1PAUSE 0x00000800 /* 1 = pause mode */
-#define SCTRL_R1INTEN 0x00000400 /* enable interrupt */
-#define SCTRL_P2INTEN 0x00000200 /* enable interrupt */
-#define SCTRL_P1INTEN 0x00000100 /* enable interrupt */
-#define SCTRL_P1SCTRLD 0x00000080 /* reload sample count register for
- * DAC1 */
-#define SCTRL_P2DACSEN 0x00000040 /* 1 = DAC2 play back last sample
- * when disabled */
-#define SCTRL_R1SEB 0x00000020 /* 1 = 16bit */
-#define SCTRL_R1SMB 0x00000010 /* 1 = stereo */
-#define SCTRL_R1FMT 0x00000030 /* format mask */
-#define SCTRL_SH_R1FMT 4
-#define SCTRL_P2SEB 0x00000008 /* 1 = 16bit */
-#define SCTRL_P2SMB 0x00000004 /* 1 = stereo */
-#define SCTRL_P2FMT 0x0000000c /* format mask */
-#define SCTRL_SH_P2FMT 2
-#define SCTRL_P1SEB 0x00000002 /* 1 = 16bit */
-#define SCTRL_P1SMB 0x00000001 /* 1 = stereo */
-#define SCTRL_P1FMT 0x00000003 /* format mask */
-#define SCTRL_SH_P1FMT 0
-
-#define STAT_INTR 0x80000000 /* wired or of all interrupt bits */
-#define STAT_CSTAT 0x00000400 /* 1 = codec busy or codec write in
- * progress */
-#define STAT_CBUSY 0x00000200 /* 1 = codec busy */
-#define STAT_CWRIP 0x00000100 /* 1 = codec write in progress */
-#define STAT_VC 0x00000060 /* CCB int source, 0=DAC1, 1=DAC2,
- * 2=ADC, 3=undef */
-#define STAT_SH_VC 5
-#define STAT_MCCB 0x00000010 /* CCB int pending */
-#define STAT_UART 0x00000008 /* UART int pending */
-#define STAT_DAC1 0x00000004 /* DAC1 int pending */
-#define STAT_DAC2 0x00000002 /* DAC2 int pending */
-#define STAT_ADC 0x00000001 /* ADC int pending */
-
-#define CODEC_OMIX1 0x10
-#define CODEC_OMIX2 0x11
-#define CODEC_LIMIX1 0x12
-#define CODEC_RIMIX1 0x13
-#define CODEC_LIMIX2 0x14
-#define CODEC_RIMIX2 0x15
-#define CODEC_RES_PD 0x16
-#define CODEC_CSEL 0x17
-#define CODEC_ADSEL 0x18
-#define CODEC_MGAIN 0x19
-
-#define ES_BUFFSIZE 0x20000 /* We're PCI! Use a large buffer */
-
-#endif
diff --git a/sys/pci/ide_pci.c b/sys/pci/ide_pci.c
index 39c53a562b32..68df969ff56b 100644
--- a/sys/pci/ide_pci.c
+++ b/sys/pci/ide_pci.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ide_pci.c,v 1.27 1999/01/17 05:18:54 bde Exp $
+ * $Id: ide_pci.c,v 1.13 1998/07/11 07:45:52 bde Exp $
*/
#include "pci.h"
@@ -120,15 +120,6 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
void *wdinfo);
static void
-acer_status(struct ide_pci_cookie *cookie);
-
-static int
-acer_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int (*wdcmd)(int, void *),
- void *wdinfo);
-
-static void
intel_piix_dump_drive(char *ctlr,
int sitre,
int is_piix4,
@@ -159,7 +150,7 @@ mkcookie(int iobase_wd,
static void ide_pci_attach(pcici_t tag, int unit);
-static void *ide_pci_candma(int, int, int);
+static void *ide_pci_candma(int, int);
static int ide_pci_dmainit(void *,
struct wdparams *,
int (*)(int, void *),
@@ -276,14 +267,8 @@ generic_dmainit(struct ide_pci_cookie *cookie,
printf("ide_pci: generic_dmainit %04x:%d: warning, IDE controller timing not set\n",
cookie->iobase_wd,
cookie->unit);
- /* If we're here, then this controller is most likely not set
- for UDMA, even if the drive may be. Make the drive wise
- up. */
-
- if(!wdcmd(WDDMA_MDMA2, wdinfo))
- printf("generic_dmainit: could not set multiword DMA mode!\n");
return 1;
- }
+ }
#ifdef IDE_PCI_DEBUG
printf("pio_mode: %d, mwdma_mode(wp): %d, udma_mode(wp): %d\n",
pio_mode(wp), mwdma_mode(wp), udma_mode(wp));
@@ -404,7 +389,7 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
/* UDMA enable by SET FEATURES, DMA cycles, cycle time 2T */
mask = 0xe3000000 >> (unitno * 8);
- new = 0x40000000 >> (unitno * 8);
+ new = 0x80000000 >> (unitno * 8);
word50 &= ~mask;
word50 |= new;
@@ -418,10 +403,10 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
*/
/* Set UDMA mode 2 on drive */
if (bootverbose)
- printf("via_571_dmainit: setting ultra DMA mode 2\n");
+ printf("intel_piix_dmainit: setting ultra DMA mode 2\n");
r = wdcmd(WDDMA_UDMA2, wdinfo);
if (!r) {
- printf("via_571_dmainit: setting DMA mode failed\n");
+ printf("intel_piix_dmainit: setting DMA mode failed\n");
return 0;
}
@@ -437,10 +422,10 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
/* Set multiword DMA mode 2 on drive */
if (bootverbose)
- printf("via_571_dmainit: setting multiword DMA mode 2\n");
+ printf("intel_piix_dmainit: setting multiword DMA mode 2\n");
r = wdcmd(WDDMA_MDMA2, wdinfo);
if (!r) {
- printf("via_571_dmainit: setting DMA mode failed\n");
+ printf("intel_piix_dmainit: setting DMA mode failed\n");
return 0;
}
@@ -452,7 +437,8 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
* enable prefetch/postwrite-- XXX may cause problems
* with CD-ROMs?
*/
- workword |= 0xc000 >> (cookie->ctlr * 2);
+ workword &= ~(3 << (cookie->ctlr * 2 + 12));
+ workword |= 3 << (cookie->ctlr * 2 + 12);
/* FIFO configurations-- equal split, threshold 1/2 */
workword &= 0x90ffffff;
@@ -495,175 +481,6 @@ static struct vendor_fns vs_via_571 =
via_571_status
};
-/* Cyrix Cx5530 Courtesy of Whistle Communications */
-
-/*
- * Verify that controller can handle a dma request for cp. Should
- * not affect any hardware or driver state.
- * Special version for 5530 that allows only transfers on 16 byte boundaries.(!)
- * (Yes the Cyrix 5530 can only UDMA to cache-line boundaries.(bleh!))
- * Luckily nearly all disk IO is to kernel bufers which are page alligned.
- * They may fix this in some other version of the chip, but it's in the latest
- * at this time (Jan 1999).
- */
-static int
-cyrix_5530_dmaverify(void *xcp, char *vaddr, u_long count, int dir)
-{
- int badfu;
-
- /*
- * check for nonaligned or odd-length Stuff
- */
- badfu = ((unsigned int)vaddr & 0xf) || (count & 0xf);
-#ifdef DIAGNOSTIC
- if (badfu) {
- printf("ide_pci: dmaverify odd vaddr or length, ");
- printf("vaddr = %p length = %08lx\n", (void *)vaddr, count);
- }
-#endif
- return (!badfu);
-}
-
-/*
- * XXX Unit number handling may be broken in the Cx5530 modules.
- * It has only been checked with a single drive.
- * 12MByte/Sec transfer rates were seen with Quantum Fireball drives
- * with negligable CPU usage.
- */
-static void
-cyrix_5530_status(struct ide_pci_cookie *cookie)
-{
- int iobase_wd;
- int ctlr, unit;
- int iobase_bm;
- pcici_t tag;
- pcidi_t type;
- u_long PIO_config;
- u_long DMA_config;
- int unitno;
-
- iobase_wd = cookie->iobase_wd;
- unit = cookie->unit;
- ctlr = cookie->ctlr;
- iobase_bm = cookie->iobase_bm;
- tag = cookie->tag;
- type = cookie->type;
-
- unitno = ctlr * 2 + unit;
-
- /* set some values the BIOS should have set */
- printf("Using 0x%x\n", cookie->iobase_bm);
- outl(iobase_bm + (unit * 0x10) + 0x20, 0x00040010);
- outl(iobase_bm + (unit * 0x10) + 0x24, 0x00911030);
- /* if ((ctlr == 0) && (unit == 0)) */ /* XXX */
- /* outb(iobase_bm + (unit * 0x10) + BMISTA_PORT, 0xe6);*/
-
- PIO_config = inl(iobase_bm + (unit * 0x10) + 0x20);
- DMA_config = inl(iobase_bm + (unit * 0x10) + 0x24);
-
-
- printf("cyrix_5530_status: %s:%u IDE PIO cfg: 0x%08lx\n",
- (ctlr ? "Secondary" : "Primary"), unit, PIO_config);
- printf("cyrix_5530_status: %s:%u IDE DMA cfg: 0x%08lx\n",
- (ctlr ? "Secondary" : "Primary"), unit, DMA_config);
-}
-
-/*
- * XXX timing values set here are only good for 30/33MHz buses; should deal
- * with slower ones too (BTW: you overclock-- you lose)
- */
-
-static int
-cyrix_5530_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int(*wdcmd)(int, void *),
- void *wdinfo)
-{
- int r;
- u_long pci_revision;
- int unitno;
- int iobase_bm;
- int unit;
-
- /*cookie->unit = 0; */ /* XXX */
- unit = cookie->unit;
- pci_revision = pci_conf_read(cookie->tag, PCI_CLASS_REG) &
- PCI_REVISION_MASK;
-
- unitno = cookie->ctlr * 2 + unit;
- iobase_bm = cookie->iobase_bm;
-
- printf("Setting using 0x%x\n", iobase_bm);
- if ((cookie->ctlr == 0) && (unit == 0)) /* XXX */
- outb(iobase_bm + (unit * 0x10) + BMISTA_PORT, 0xe6);
- outl(iobase_bm + (unit * 0x10) + 0x20, 0x00040010);
- outl(iobase_bm + (unit * 0x10) + 0x24, 0x00911030);
- /* If it's a UDMA drive on a '5530, set it up */
- /*
- * depending on what the drive can do,
- * set the correct modes,
- */
- printf("wd%d: mw=0x%x, pio=0x%x, pcirev=0x%lx, udma=0x%x\n",
- unitno,
- mwdma_mode(wp), pio_mode(wp),
- pci_revision, udma_mode(wp));
- if (/* pci_revision >= 1 && */ udma_mode(wp) >= 2) {
- /*outl(iobase_bm + 0x20 + (cookie->unit * 16), 0x00100010);*/
- outl(iobase_bm + 0x24 + (cookie->unit * 16), 0x00911030);
-
- /*
- * With the Cx5530, drive configuration should come *after* the
- * controller configuration, to make sure the controller sees
- * the command and does the right thing.
- */
- /* Set UDMA mode 2 on drive */
- if (bootverbose)
- printf("cyrix_5530_dmainit: setting ultra DMA mode 2\n");
- r = wdcmd(WDDMA_UDMA2, wdinfo);
- if (!r) {
- printf("cyrix_5530_dmainit: setting DMA mode failed\n");
- return 0;
- }
-
- if (bootverbose)
- cyrix_5530_status(cookie);
- return 1;
-
- }
-
- /* otherwise, try and program it for MW DMA mode 2 */
- else if (mwdma_mode(wp) >= 2 && pio_mode(wp) >= 4) {
-
- /* Set multiword DMA mode 2 on drive */
- if (bootverbose)
- printf("cyrix_5530_dmainit: setting multiword DMA mode 2\n");
- r = wdcmd(WDDMA_MDMA2, wdinfo);
- if (!r) {
- printf("cyrix_5530_dmainit: setting DMA mode failed\n");
- return 0;
- }
-
- /* Configure the controller appropriately for MWDMA mode 2 */
-
- /*outl(iobase_bm + 0x20 + (cookie->unit * 16), 0x00100010);*/
- outl(iobase_bm + 0x24 + (cookie->unit * 16), 0x00002020);
-
- if (bootverbose)
- cyrix_5530_status(cookie);
-
- return 1;
-
- }
- return 0;
-}
-
-
-static struct vendor_fns vs_cyrix_5530 =
-{
- cyrix_5530_dmainit,
- cyrix_5530_status
-};
-
static void
promise_status(struct ide_pci_cookie *cookie)
@@ -879,8 +696,8 @@ intel_piix_dmainit(struct ide_pci_cookie *cookie,
unitno = cookie->ctlr * 2 + cookie->unit;
- mask = (1 << unitno) + (3 << (16 + unitno * 4));
- new = (1 << unitno) + (2 << (16 + unitno * 4));
+ mask = 1 << unitno + 3 << (16 + unitno * 4);
+ new = 1 << unitno + 2 << (16 + unitno * 4);
pci_conf_write(cookie->tag, 0x48,
(pci_conf_read(cookie->tag, 0x48) & ~mask) | new);
@@ -1019,70 +836,6 @@ static struct vendor_fns vs_intel_piix =
intel_piix_status
};
-
-static void
-acer_status(struct ide_pci_cookie *cookie) {
- /* XXX does not do anything right now */
-}
-
-static int
-acer_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int(*wdcmd)(int, void *),
- void *wdinfo)
-{
- /* Acer Aladdin DMA setup code. UDMA looks to be sinfully easy to set
- on this thing - just one register. */
-
- u_long word54 = pci_conf_read(cookie->tag, 0x54);
-
- /* Set the default Acer FIFO settings (0x55 = 13-word depth and
- slave operation mode 1) */
-
- word54 |= 0x5555;
-
- /* Is this drive UDMA? Set it up if so... */
- if(udma_mode(wp) >= 2) {
- /* This is really easy to do. Just write 0xa (enable
- UDMA mode with 2T timing) into the word at the right
- places. */
- word54 |= (0xA << (16 + (cookie->ctlr * 8) + (cookie->unit * 4)));
-
- /* Now set the drive for UDMA2. */
- if(!wdcmd(WDDMA_UDMA2, wdinfo)) {
- printf("acer_dmainit: could not set UDMA2 mode on wdc%d:%d!\n", cookie->ctlr, cookie->unit);
- return 0;
- }
-
- /* Write the new config into the registers. I'm not
- sure if I'm doing this in the right order. */
-
- pci_conf_write(cookie->tag, 0x54, word54);
-
- } else if(mwdma_mode(wp) >= 2 && pio_mode(wp) >=4) {
-
-
- /* Otherwise, we're already set for regular DMA. */
-
- if(!wdcmd(WDDMA_MDMA2, wdinfo)) {
- printf("acer_dmainit: could not set MWDMA2 mode on wdc%d:%d!\n",
- cookie->ctlr, cookie->unit);
- return 0;
- }
- return 1;
- }
-
- return 0;
-}
-
-static struct vendor_fns vs_acer =
-{
- acer_dmainit,
- acer_status
-};
-
-
-
/* Generic SFF-8038i code-- all code below here, except for PCI probes,
* more or less conforms to the SFF-8038i spec as extended for PCI.
* There should be no code that goes beyond that feature set below.
@@ -1145,7 +898,7 @@ mkcookie(int iobase_wd,
return cp;
}
-static const char *
+static char *
ide_pci_probe(pcici_t tag, pcidi_t type)
{
u_long data;
@@ -1164,11 +917,7 @@ ide_pci_probe(pcici_t tag, pcidi_t type)
if (type == PROMISE_ULTRA33)
return ("Promise Ultra/33 IDE controller");
if (type == 0x05711106)
- return ("VIA 82C586x (Apollo) Bus-master IDE controller");
- if (type == 0x01021078)
- return ("Cyrix 5530 Bus-master IDE controller");
- if (type == 0x522910b9)
- return ("Acer Aladdin IV/V (M5229) Bus-master IDE controller");
+ return ("VIA 82C586x (Apollo) Bus-master IDE controller");
if (data & 0x8000)
return ("PCI IDE controller (busmaster capable)");
#ifndef CMD640
@@ -1186,7 +935,7 @@ ide_pci_probe(pcici_t tag, pcidi_t type)
static void
ide_pci_attach(pcici_t tag, int unit)
{
- u_long class = 0, cmd;
+ u_long class, cmd;
int bmista_1, bmista_2;
int iobase_wd_1, iobase_wd_2, iobase_bm_1, iobase_bm_2;
int altiobase_wd_1, altiobase_wd_2;
@@ -1232,13 +981,6 @@ ide_pci_attach(pcici_t tag, int unit)
vp = &vs_promise;
break;
- case 0x01021078: /* cyrix 5530 */
- printf("cyrix 5530\n");
- vp = &vs_cyrix_5530;
- break;
- case 0x522910B9: /* Acer Aladdin IV/V (M5229) */
- vp = &vs_acer;
- break;
default:
/* everybody else */
vp = &vs_generic;
@@ -1269,19 +1011,16 @@ ide_pci_attach(pcici_t tag, int unit)
}
iobase_bm_1 = pci_conf_read(tag, 0x20) & 0xfffc;
+ iobase_bm_2 = iobase_bm_1 + SFF8038_CTLR_1;
if (iobase_bm_1 == 0) {
- printf("ide_pci: BIOS has not configured busmaster"
- "I/O address,\n ide_pci: giving up\n");
+ printf("ide_pci: BIOS has not configured busmaster I/O address,\n\
+ide_pci: giving up\n");
return;
}
- iobase_bm_2 = iobase_bm_1 + SFF8038_CTLR_1;
wddma[unit].wdd_candma = ide_pci_candma;
wddma[unit].wdd_dmainit = ide_pci_dmainit;
- if (type == 0x01021078 /*CYRIX_5530*/)
- wddma[unit].wdd_dmaverify = cyrix_5530_dmaverify;
- else
- wddma[unit].wdd_dmaverify = ide_pci_dmaverify;
+ wddma[unit].wdd_dmaverify = ide_pci_dmaverify;
wddma[unit].wdd_dmaprep = ide_pci_dmasetup;
wddma[unit].wdd_dmastart = ide_pci_dmastart;
wddma[unit].wdd_dmadone = ide_pci_dmadone;
@@ -1331,7 +1070,7 @@ ide_pci_attach(pcici_t tag, int unit)
if (dvup->id_id == 0) {
iobase_wd_2 = 0;
break;
- }
+ }
}
if (dvup->id_unit == biotabunit + 2) {
@@ -1389,8 +1128,6 @@ ide_pci_attach(pcici_t tag, int unit)
if (bootverbose) {
vp->vendor_status(cookie);
- bmista_1 = inb(iobase_bm_1 + BMISTA_PORT);
- bmista_2 = inb(iobase_bm_2 + BMISTA_PORT);
printf("ide_pci: busmaster 0 status: %02x from port: %08x\n",
bmista_1, iobase_bm_1+BMISTA_PORT);
@@ -1401,7 +1138,9 @@ ide_pci_attach(pcici_t tag, int unit)
}
}
- if (iobase_wd_2 != 0) {
+ if (bmista_1 & BMISTA_SIMPLEX || bmista_2 & BMISTA_SIMPLEX) {
+ printf("ide_pci: controller is simplex, no DMA on secondary channel\n");
+ } else if (iobase_wd_2 != 0) {
cookie = mkcookie(iobase_wd_2,
ctlridx + 1,
0,
@@ -1423,8 +1162,6 @@ ide_pci_attach(pcici_t tag, int unit)
if (bootverbose) {
vp->vendor_status(cookie);
- bmista_1 = inb(iobase_bm_1 + BMISTA_PORT);
- bmista_2 = inb(iobase_bm_2 + BMISTA_PORT);
printf("ide_pci: busmaster 1 status: %02x from port: %08x\n",
bmista_2, iobase_bm_2+BMISTA_PORT);
@@ -1449,17 +1186,16 @@ static struct pci_device ide_pci_device = {
DATA_SET(pcidevice_set, ide_pci_device);
/*
- * Return a cookie if we may be able to do DMA on the specified
- * (iobase_wd, ctlr, unit).
+ * Return a cookie if we can do DMA on the specified (iobase_wd, unit).
*/
static void *
-ide_pci_candma(int iobase_wd, int ctlr, int unit)
+ide_pci_candma(int iobase_wd, int unit)
{
struct ide_pci_cookie *cp;
cp = softc.cookies.lh_first;
while(cp) {
- if (cp->ctlr == ctlr && cp->unit == unit &&
+ if (cp->ctlr == unit &&
((iobase_wd == 0) || (cp->iobase_wd == iobase_wd)))
break;
cp = cp->le.le_next;
@@ -1529,10 +1265,7 @@ ide_pci_dmasetup(void *xcp, char *vaddr, u_long vcount, int dir)
u_long prd_base, prd_count;
u_long nbase, ncount, nend;
int iobase_bm;
- u_long count;
-#ifdef DIAGNOSTIC
- u_long checkcount;
-#endif
+ u_long count, checkcount;
prd = cp->prd;
@@ -1568,22 +1301,10 @@ ide_pci_dmasetup(void *xcp, char *vaddr, u_long vcount, int dir)
* Coalesce if physically contiguous and not crossing
* 64k boundary.
*/
-#if 0
- /*
- * Aggregation is NOT an optimisation worth doing,
- * and the Cyrix UDMA controller screws itself
- * in some aggregated situations.
- * We might as well just assign each 4K page a DMA entry
- * as this doesn't really gain us anything to aggregate them.
- * This was basically copied from my agregation code in the aha
- * driver, but I doubt it helped much there either. [JRE]
- */
if ((prd_base + prd_count == nbase) &&
((((nend - 1) ^ prd_base) & ~0xffff) == 0)) {
prd_count += ncount;
- } else
-#endif
- {
+ } else {
prd[i].prd_base = prd_base;
prd[i].prd_count = (prd_count & 0xffff);
i++;
@@ -1670,10 +1391,11 @@ ide_pci_dmadone(void *xcp)
static int
ide_pci_status(void *xcp)
{
+ struct ide_pci_cookie *cp = xcp;
int iobase_bm, status, bmista;
status = 0;
- iobase_bm = ((struct ide_pci_cookie *)xcp)->iobase_bm;
+ iobase_bm = cp->iobase_bm;
bmista = inb(iobase_bm + BMISTA_PORT);
@@ -1683,6 +1405,7 @@ ide_pci_status(void *xcp)
status |= WDDS_ERROR;
if (bmista & BMISTA_DMA_ACTIVE)
status |= WDDS_ACTIVE;
+
return status;
}
diff --git a/sys/pci/if_ax.c b/sys/pci/if_ax.c
deleted file mode 100644
index 34f1e881b5be..000000000000
--- a/sys/pci/if_ax.c
+++ /dev/null
@@ -1,2175 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_ax.c,v 1.8 1999/01/16 20:33:34 wpaul Exp $
- */
-
-/*
- * ASIX AX88140A fast ethernet PCI NIC driver.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The ASIX Electronics AX88140A is still another DEC 21x4x clone. It's
- * a reasonably close copy of the tulip, except for the receiver filter
- * programming. Where the DEC chip has a special setup frame that
- * needs to be downloaded into the transmit DMA engine, the ASIX chip
- * has a less complicated setup frame which is written into one of
- * the registers.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define AX_USEIOSPACE
-
-/* #define AX_BACKGROUND_AUTONEG */
-
-#include <pci/if_axreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_ax.c,v 1.8 1999/01/16 20:33:34 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct ax_type ax_devs[] = {
- { AX_VENDORID, AX_DEVICEID_AX88140A,
- "ASIX AX88140A 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct ax_type ax_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long ax_count = 0;
-static const char *ax_probe __P((pcici_t, pcidi_t));
-static void ax_attach __P((pcici_t, int));
-
-static int ax_newbuf __P((struct ax_softc *,
- struct ax_chain_onefrag *));
-static int ax_encap __P((struct ax_softc *, struct ax_chain *,
- struct mbuf *));
-
-static void ax_rxeof __P((struct ax_softc *));
-static void ax_rxeoc __P((struct ax_softc *));
-static void ax_txeof __P((struct ax_softc *));
-static void ax_txeoc __P((struct ax_softc *));
-static void ax_intr __P((void *));
-static void ax_start __P((struct ifnet *));
-static int ax_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void ax_init __P((void *));
-static void ax_stop __P((struct ax_softc *));
-static void ax_watchdog __P((struct ifnet *));
-static void ax_shutdown __P((int, void *));
-static int ax_ifmedia_upd __P((struct ifnet *));
-static void ax_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void ax_delay __P((struct ax_softc *));
-static void ax_eeprom_idle __P((struct ax_softc *));
-static void ax_eeprom_putbyte __P((struct ax_softc *, int));
-static void ax_eeprom_getword __P((struct ax_softc *, int, u_int16_t *));
-static void ax_read_eeprom __P((struct ax_softc *, caddr_t, int,
- int, int));
-
-static void ax_mii_writebit __P((struct ax_softc *, int));
-static int ax_mii_readbit __P((struct ax_softc *));
-static void ax_mii_sync __P((struct ax_softc *));
-static void ax_mii_send __P((struct ax_softc *, u_int32_t, int));
-static int ax_mii_readreg __P((struct ax_softc *, struct ax_mii_frame *));
-static int ax_mii_writereg __P((struct ax_softc *, struct ax_mii_frame *));
-static u_int16_t ax_phy_readreg __P((struct ax_softc *, int));
-static void ax_phy_writereg __P((struct ax_softc *, int, int));
-
-static void ax_autoneg_xmit __P((struct ax_softc *));
-static void ax_autoneg_mii __P((struct ax_softc *, int, int));
-static void ax_setmode_mii __P((struct ax_softc *, int));
-static void ax_setmode __P((struct ax_softc *, int, int));
-static void ax_getmode_mii __P((struct ax_softc *));
-static void ax_setcfg __P((struct ax_softc *, int));
-static u_int32_t ax_calchash __P((caddr_t));
-static void ax_setmulti __P((struct ax_softc *));
-static void ax_reset __P((struct ax_softc *));
-static int ax_list_rx_init __P((struct ax_softc *));
-static int ax_list_tx_init __P((struct ax_softc *));
-
-#define AX_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define AX_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, AX_SIO, \
- CSR_READ_4(sc, AX_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, AX_SIO, \
- CSR_READ_4(sc, AX_SIO) & ~x)
-
-static void ax_delay(sc)
- struct ax_softc *sc;
-{
- int idx;
-
- for (idx = (300 / 33) + 1; idx > 0; idx--)
- CSR_READ_4(sc, AX_BUSCTL);
-}
-
-static void ax_eeprom_idle(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_EESEL);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_ROMCTL_READ);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
-
- for (i = 0; i < 25; i++) {
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- CSR_WRITE_4(sc, AX_SIO, 0x00000000);
-
- return;
-}
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void ax_eeprom_putbyte(sc, addr)
- struct ax_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | AX_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(AX_SIO_EE_DATAIN);
- } else {
- SIO_CLR(AX_SIO_EE_DATAIN);
- }
- ax_delay(sc);
- SIO_SET(AX_SIO_EE_CLK);
- ax_delay(sc);
- SIO_CLR(AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void ax_eeprom_getword(sc, addr, dest)
- struct ax_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Force EEPROM to idle state. */
- ax_eeprom_idle(sc);
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_EESEL);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_ROMCTL_READ);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
-
- /*
- * Send address of word we want to read.
- */
- ax_eeprom_putbyte(sc, addr);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(AX_SIO_EE_CLK);
- ax_delay(sc);
- if (CSR_READ_4(sc, AX_SIO) & AX_SIO_EE_DATAOUT)
- word |= i;
- ax_delay(sc);
- SIO_CLR(AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- /* Turn off EEPROM access mode. */
- ax_eeprom_idle(sc);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void ax_read_eeprom(sc, dest, off, cnt, swap)
- struct ax_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- ax_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * Write a bit to the MII bus.
- */
-static void ax_mii_writebit(sc, bit)
- struct ax_softc *sc;
- int bit;
-{
- if (bit)
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE|AX_SIO_MII_DATAOUT);
- else
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE);
-
- AX_SETBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_MII_CLK);
-
- return;
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int ax_mii_readbit(sc)
- struct ax_softc *sc;
-{
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_READ|AX_SIO_MII_DIR);
- CSR_READ_4(sc, AX_SIO);
- AX_SETBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- if (CSR_READ_4(sc, AX_SIO) & AX_SIO_MII_DATAIN)
- return(1);
-
- return(0);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void ax_mii_sync(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE);
-
- for (i = 0; i < 32; i++)
- ax_mii_writebit(sc, 1);
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void ax_mii_send(sc, bits, cnt)
- struct ax_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1)
- ax_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int ax_mii_readreg(sc, frame)
- struct ax_softc *sc;
- struct ax_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = AX_MII_STARTDELIM;
- frame->mii_opcode = AX_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- /*
- * Sync the PHYs.
- */
- ax_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- ax_mii_send(sc, frame->mii_stdelim, 2);
- ax_mii_send(sc, frame->mii_opcode, 2);
- ax_mii_send(sc, frame->mii_phyaddr, 5);
- ax_mii_send(sc, frame->mii_regaddr, 5);
-
-#ifdef notdef
- /* Idle bit */
- ax_mii_writebit(sc, 1);
- ax_mii_writebit(sc, 0);
-#endif
-
- /* Check for ack */
- ack = ax_mii_readbit(sc);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- ax_mii_readbit(sc);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- if (!ack) {
- if (ax_mii_readbit(sc))
- frame->mii_data |= i;
- }
- }
-
-fail:
-
- ax_mii_writebit(sc, 0);
- ax_mii_writebit(sc, 0);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int ax_mii_writereg(sc, frame)
- struct ax_softc *sc;
- struct ax_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = AX_MII_STARTDELIM;
- frame->mii_opcode = AX_MII_WRITEOP;
- frame->mii_turnaround = AX_MII_TURNAROUND;
-
- /*
- * Sync the PHYs.
- */
- ax_mii_sync(sc);
-
- ax_mii_send(sc, frame->mii_stdelim, 2);
- ax_mii_send(sc, frame->mii_opcode, 2);
- ax_mii_send(sc, frame->mii_phyaddr, 5);
- ax_mii_send(sc, frame->mii_regaddr, 5);
- ax_mii_send(sc, frame->mii_turnaround, 2);
- ax_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- ax_mii_writebit(sc, 0);
- ax_mii_writebit(sc, 0);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t ax_phy_readreg(sc, reg)
- struct ax_softc *sc;
- int reg;
-{
- struct ax_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->ax_phy_addr;
- frame.mii_regaddr = reg;
- ax_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void ax_phy_writereg(sc, reg, data)
- struct ax_softc *sc;
- int reg;
- int data;
-{
- struct ax_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->ax_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- ax_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int32_t ax_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return((crc >> 26) & 0x0000003F);
-}
-
-static void ax_setmulti(sc)
- struct ax_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, AX_NETCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= AX_NETCFG_RX_ALLMULTI;
- CSR_WRITE_4(sc, AX_NETCFG, rxfilt);
- return;
- } else
- rxfilt &= ~AX_NETCFG_RX_ALLMULTI;
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, 0);
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = ax_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- }
-
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, hashes[0]);
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, hashes[1]);
- CSR_WRITE_4(sc, AX_NETCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void ax_autoneg_xmit(sc)
- struct ax_softc *sc;
-{
- u_int16_t phy_sts;
-
- ax_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(ax_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = ax_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- ax_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void ax_autoneg_mii(sc, flag, verbose)
- struct ax_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = ax_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("ax%d: autonegotiation not supported\n",
- sc->ax_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case AX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- ax_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case AX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise ax_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->ax_cdata.ax_tx_head != NULL) {
- sc->ax_want_auto = 1;
- return;
- }
- ax_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->ax_autoneg = 1;
- sc->ax_want_auto = 0;
- return;
- break;
- case AX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->ax_autoneg = 0;
- break;
- default:
- printf("ax%d: invalid autoneg flag: %d\n", sc->ax_unit, flag);
- return;
- }
-
- if (ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("ax%d: autoneg complete, ", sc->ax_unit);
- phy_sts = ax_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("ax%d: autoneg not complete, ", sc->ax_unit);
- }
-
- media = ax_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = ax_phy_readreg(sc, PHY_ANAR);
- ability = ax_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- ax_setcfg(sc, media);
- ax_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- ax_init(sc);
-
- if (sc->ax_tx_pend) {
- sc->ax_autoneg = 0;
- sc->ax_tx_pend = 0;
- ax_start(ifp);
- }
-
- return;
-}
-
-static void ax_getmode_mii(sc)
- struct ax_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = ax_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("ax%d: PHY status word: %x\n", sc->ax_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("ax%d: 10Mbps half-duplex mode supported\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("ax%d: 10Mbps full-duplex mode supported\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("ax%d: 100Mbps half-duplex mode supported\n",
- sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("ax%d: 100Mbps full-duplex mode supported\n",
- sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("ax%d: 100baseT4 mode supported\n", sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("ax%d: forcing on autoneg support for BT4\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("ax%d: autoneg supported\n", sc->ax_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void ax_setmode_mii(sc, media)
- struct ax_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->ax_autoneg) {
- printf("ax%d: canceling autoneg session\n", sc->ax_unit);
- ifp->if_timer = sc->ax_autoneg = sc->ax_want_auto = 0;
- bmcr = ax_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- ax_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("ax%d: selecting MII, ", sc->ax_unit);
-
- bmcr = ax_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- ax_setcfg(sc, bmcr);
- ax_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Set speed and duplex mode on internal transceiver.
- */
-static void ax_setmode(sc, media, verbose)
- struct ax_softc *sc;
- int media;
- int verbose;
-{
- struct ifnet *ifp;
- u_int32_t mode;
-
- ifp = &sc->arpcom.ac_if;
-
- if (verbose)
- printf("ax%d: selecting internal xcvr, ", sc->ax_unit);
-
- mode = CSR_READ_4(sc, AX_NETCFG);
-
- mode &= ~(AX_NETCFG_FULLDUPLEX|AX_NETCFG_PORTSEL|
- AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER|AX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- if (verbose)
- printf("100Mbps/T4, half-duplex\n");
- mode |= AX_NETCFG_PORTSEL|AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- if (verbose)
- printf("100Mbps, ");
- mode |= AX_NETCFG_PORTSEL|AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- if (verbose)
- printf("10Mbps, ");
- mode &= ~AX_NETCFG_PORTSEL;
- mode |= AX_NETCFG_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- if (verbose)
- printf("full duplex\n");
- mode |= AX_NETCFG_FULLDUPLEX;
- } else {
- if (verbose)
- printf("half duplex\n");
- mode &= ~AX_NETCFG_FULLDUPLEX;
- }
-
- CSR_WRITE_4(sc, AX_NETCFG, mode);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void ax_setcfg(sc, bmcr)
- struct ax_softc *sc;
- int bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, AX_NETCFG) & (AX_NETCFG_TX_ON|AX_NETCFG_RX_ON)) {
- restart = 1;
- AX_CLRBIT(sc, AX_NETCFG, (AX_NETCFG_TX_ON|AX_NETCFG_RX_ON));
-
- for (i = 0; i < AX_TIMEOUT; i++) {
- DELAY(10);
- if (CSR_READ_4(sc, AX_ISR) & AX_ISR_TX_IDLE)
- break;
- }
-
- if (i == AX_TIMEOUT)
- printf("ax%d: failed to force tx and "
- "rx to idle state\n", sc->ax_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
- else
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_FULLDUPLEX);
- else
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_FULLDUPLEX);
-
- if (restart)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON|AX_NETCFG_RX_ON);
-
- return;
-}
-
-static void ax_reset(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- AX_SETBIT(sc, AX_BUSCTL, AX_BUSCTL_RESET);
-
- for (i = 0; i < AX_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, AX_BUSCTL) & AX_BUSCTL_RESET))
- break;
- }
-#ifdef notdef
- if (i == AX_TIMEOUT)
- printf("ax%d: reset never completed!\n", sc->ax_unit);
-#endif
- CSR_WRITE_4(sc, AX_BUSCTL, AX_BUSCTL_CONFIG);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for an ASIX chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-ax_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct ax_type *t;
-
- t = ax_devs;
-
- while(t->ax_name != NULL) {
- if ((device_id & 0xFFFF) == t->ax_vid &&
- ((device_id >> 16) & 0xFFFF) == t->ax_did) {
- return(t->ax_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-ax_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef AX_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct ax_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct ax_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct ax_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("ax%d: no memory for softc struct!\n", unit);
- goto fail;
- }
- bzero(sc, sizeof(struct ax_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, AX_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, AX_PCI_PWRMGMTCTRL);
- if (command & AX_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, AX_PCI_LOIO);
- membase = pci_conf_read(config_id, AX_PCI_LOMEM);
- irq = pci_conf_read(config_id, AX_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("ax%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & AX_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, AX_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, AX_PCI_LOIO, iobase);
- pci_conf_write(config_id, AX_PCI_LOMEM, membase);
- pci_conf_write(config_id, AX_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef AX_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("ax%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, AX_PCI_LOIO,
- (u_short *)&(sc->ax_bhandle))) {
- printf ("ax%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->ax_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("ax%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, AX_PCI_LOMEM, &vbase, &pbase)) {
- printf ("ax%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->ax_btag = I386_BUS_SPACE_MEM;
- sc->ax_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, ax_intr, sc, &net_imask)) {
- printf("ax%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- ax_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- ax_read_eeprom(sc, (caddr_t)&eaddr, AX_EE_NODEADDR, 3, 0);
-
- /*
- * An ASIX chip was detected. Inform the world.
- */
- printf("ax%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->ax_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->ax_ldata_ptr = malloc(sizeof(struct ax_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->ax_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("ax%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- sc->ax_ldata = (struct ax_list_data *)sc->ax_ldata_ptr;
- round = (unsigned int)sc->ax_ldata_ptr & 0xF;
- roundptr = sc->ax_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->ax_ldata = (struct ax_list_data *)roundptr;
- bzero(sc->ax_ldata, sizeof(struct ax_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "ax";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = ax_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = ax_start;
- ifp->if_watchdog = ax_watchdog;
- ifp->if_init = ax_init;
- ifp->if_baudrate = 10000000;
-
-
- if (bootverbose)
- printf("ax%d: probing for a PHY\n", sc->ax_unit);
- for (i = AX_PHYADDR_MIN; i < AX_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("ax%d: checking address: %d\n",
- sc->ax_unit, i);
- sc->ax_phy_addr = i;
- ax_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(ax_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = ax_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = ax_phy_readreg(sc, PHY_VENID);
- phy_did = ax_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("ax%d: found PHY at address %d, ",
- sc->ax_unit, sc->ax_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = ax_phys;
- while(p->ax_vid) {
- if (phy_vid == p->ax_vid &&
- (phy_did | 0x000F) == p->ax_did) {
- sc->ax_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->ax_pinfo == NULL)
- sc->ax_pinfo = &ax_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("ax%d: PHY type: %s\n",
- sc->ax_unit, sc->ax_pinfo->ax_name);
- } else {
-#ifdef DIAGNOSTIC
- printf("ax%d: MII without any phy!\n", sc->ax_unit);
-#endif
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, ax_ifmedia_upd, ax_ifmedia_sts);
-
- if (sc->ax_pinfo != NULL) {
- ax_getmode_mii(sc);
- ax_autoneg_mii(sc, AX_FLAG_FORCEDELAY, 1);
- } else {
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- }
-
- media = sc->ifmedia.ifm_media;
- ax_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(ax_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int ax_list_tx_init(sc)
- struct ax_softc *sc;
-{
- struct ax_chain_data *cd;
- struct ax_list_data *ld;
- int i;
-
- cd = &sc->ax_cdata;
- ld = sc->ax_ldata;
- for (i = 0; i < AX_TX_LIST_CNT; i++) {
- cd->ax_tx_chain[i].ax_ptr = &ld->ax_tx_list[i];
- if (i == (AX_TX_LIST_CNT - 1))
- cd->ax_tx_chain[i].ax_nextdesc =
- &cd->ax_tx_chain[0];
- else
- cd->ax_tx_chain[i].ax_nextdesc =
- &cd->ax_tx_chain[i + 1];
- }
-
- cd->ax_tx_free = &cd->ax_tx_chain[0];
- cd->ax_tx_tail = cd->ax_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int ax_list_rx_init(sc)
- struct ax_softc *sc;
-{
- struct ax_chain_data *cd;
- struct ax_list_data *ld;
- int i;
-
- cd = &sc->ax_cdata;
- ld = sc->ax_ldata;
-
- for (i = 0; i < AX_RX_LIST_CNT; i++) {
- cd->ax_rx_chain[i].ax_ptr =
- (struct ax_desc *)&ld->ax_rx_list[i];
- if (ax_newbuf(sc, &cd->ax_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (AX_RX_LIST_CNT - 1)) {
- cd->ax_rx_chain[i].ax_nextdesc =
- &cd->ax_rx_chain[0];
- ld->ax_rx_list[i].ax_next =
- vtophys(&ld->ax_rx_list[0]);
- } else {
- cd->ax_rx_chain[i].ax_nextdesc =
- &cd->ax_rx_chain[i + 1];
- ld->ax_rx_list[i].ax_next =
- vtophys(&ld->ax_rx_list[i + 1]);
- }
- }
-
- cd->ax_rx_head = &cd->ax_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int ax_newbuf(sc, c)
- struct ax_softc *sc;
- struct ax_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("ax%d: no memory for rx list -- packet dropped!\n",
- sc->ax_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("ax%d: no memory for rx list -- packet dropped!\n",
- sc->ax_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->ax_mbuf = m_new;
- c->ax_ptr->ax_status = AX_RXSTAT;
- c->ax_ptr->ax_data = vtophys(mtod(m_new, caddr_t));
- c->ax_ptr->ax_ctl = MCLBYTES - 1;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void ax_rxeof(sc)
- struct ax_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct ax_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->ax_cdata.ax_rx_head->ax_ptr->ax_status) &
- AX_RXSTAT_OWN)) {
- cur_rx = sc->ax_cdata.ax_rx_head;
- sc->ax_cdata.ax_rx_head = cur_rx->ax_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & AX_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & AX_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->ax_mbuf;
- total_len = AX_RXBYTES(cur_rx->ax_ptr->ax_status);
-
- total_len -= ETHER_CRC_LEN;
-
- if (total_len < MINCLSIZE) {
- m = m_devget(mtod(cur_rx->ax_mbuf, char *),
- total_len, 0, ifp, NULL);
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- if (m == NULL) {
- ifp->if_ierrors++;
- continue;
- }
- } else {
- m = cur_rx->ax_mbuf;
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (ax_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- continue;
- }
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void ax_rxeoc(sc)
- struct ax_softc *sc;
-{
-
- ax_rxeof(sc);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXADDR, vtophys(sc->ax_cdata.ax_rx_head->ax_ptr));
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void ax_txeof(sc)
- struct ax_softc *sc;
-{
- struct ax_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->ax_cdata.ax_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->ax_cdata.ax_tx_head->ax_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->ax_cdata.ax_tx_head;
- txstat = AX_TXSTATUS(cur_tx);
-
- if (txstat & AX_TXSTAT_OWN)
- break;
-
- if (txstat & AX_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & AX_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & AX_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & AX_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->ax_mbuf);
- cur_tx->ax_mbuf = NULL;
-
- if (sc->ax_cdata.ax_tx_head == sc->ax_cdata.ax_tx_tail) {
- sc->ax_cdata.ax_tx_head = NULL;
- sc->ax_cdata.ax_tx_tail = NULL;
- break;
- }
-
- sc->ax_cdata.ax_tx_head = cur_tx->ax_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void ax_txeoc(sc)
- struct ax_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->ax_cdata.ax_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->ax_cdata.ax_tx_tail = NULL;
- if (sc->ax_want_auto)
- ax_autoneg_mii(sc, AX_FLAG_DELAYTIMEO, 1);
- }
-
- return;
-}
-
-static void ax_intr(arg)
- void *arg;
-{
- struct ax_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts */
- if (!(ifp->if_flags & IFF_UP)) {
- ax_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, AX_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, AX_ISR);
- if (status)
- CSR_WRITE_4(sc, AX_ISR, status);
-
- if ((status & AX_INTRS) == 0)
- break;
-
- if ((status & AX_ISR_TX_OK) || (status & AX_ISR_TX_EARLY))
- ax_txeof(sc);
-
- if (status & AX_ISR_TX_NOBUF)
- ax_txeoc(sc);
-
- if (status & AX_ISR_TX_IDLE) {
- ax_txeof(sc);
- if (sc->ax_cdata.ax_tx_head != NULL) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON);
- CSR_WRITE_4(sc, AX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & AX_ISR_TX_UNDERRUN) {
- u_int32_t cfg;
- cfg = CSR_READ_4(sc, AX_NETCFG);
- if ((cfg & AX_NETCFG_TX_THRESH) == AX_TXTHRESH_160BYTES)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_STORENFWD);
- else
- CSR_WRITE_4(sc, AX_NETCFG, cfg + 0x4000);
- }
-
- if (status & AX_ISR_RX_OK)
- ax_rxeof(sc);
-
- if ((status & AX_ISR_RX_WATDOGTIMEO)
- || (status & AX_ISR_RX_NOBUF))
- ax_rxeoc(sc);
-
- if (status & AX_ISR_BUS_ERR) {
- ax_reset(sc);
- ax_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, AX_IMR, AX_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- ax_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int ax_encap(sc, c, m_head)
- struct ax_softc *sc;
- struct ax_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- volatile struct ax_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == AX_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->ax_ptr->ax_frag[frag];
- f->ax_ctl = m->m_len;
- if (frag == 0) {
- f->ax_status = 0;
- f->ax_ctl |= AX_TXCTL_FIRSTFRAG;
- } else
- f->ax_status = AX_TXSTAT_OWN;
- f->ax_next = vtophys(&c->ax_ptr->ax_frag[frag + 1]);
- f->ax_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we ran out of fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("ax%d: no memory for tx list", sc->ax_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("ax%d: no memory for tx list",
- sc->ax_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->ax_ptr->ax_frag[0];
- f->ax_status = 0;
- f->ax_data = vtophys(mtod(m_new, caddr_t));
- f->ax_ctl = total_len = m_new->m_len;
- f->ax_ctl |= AX_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
- c->ax_mbuf = m_head;
- c->ax_lastdesc = frag - 1;
- AX_TXCTL(c) |= AX_TXCTL_LASTFRAG|AX_TXCTL_FINT;
- c->ax_ptr->ax_frag[0].ax_ctl |= AX_TXCTL_FINT;
- AX_TXNEXT(c) = vtophys(&c->ax_nextdesc->ax_ptr->ax_frag[0]);
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void ax_start(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
- struct mbuf *m_head = NULL;
- struct ax_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->ax_autoneg) {
- sc->ax_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->ax_cdata.ax_tx_free->ax_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->ax_cdata.ax_tx_free;
-
- while(sc->ax_cdata.ax_tx_free->ax_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->ax_cdata.ax_tx_free;
- sc->ax_cdata.ax_tx_free = cur_tx->ax_nextdesc;
-
- /* Pack the data into the descriptor. */
- ax_encap(sc, cur_tx, m_head);
- if (cur_tx != start_tx)
- AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->ax_mbuf);
-#endif
- AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
- CSR_WRITE_4(sc, AX_TXSTART, 0xFFFFFFFF);
- }
-
- sc->ax_cdata.ax_tx_tail = cur_tx;
- if (sc->ax_cdata.ax_tx_head == NULL)
- sc->ax_cdata.ax_tx_head = start_tx;
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void ax_init(xsc)
- void *xsc;
-{
- struct ax_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->ax_autoneg)
- return;
-
- s = splimp();
-
- if (sc->ax_pinfo != NULL)
- phy_bmcr = ax_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- ax_stop(sc);
- ax_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, AX_BUSCTL, AX_BUSCTL_CONFIG);
-
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_HEARTBEAT);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_STORENFWD);
-
- if (sc->ax_pinfo != NULL) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_PORTSEL);
- ax_setcfg(sc, ax_phy_readreg(sc, PHY_BMCR));
- } else
- ax_setmode(sc, sc->ifmedia.ifm_media, 0);
-
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_TX_THRESH);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(sc->ifmedia.ifm_media) == IFM_10_T)
- AX_SETBIT(sc, AX_NETCFG, AX_TXTHRESH_160BYTES);
- else
- AX_SETBIT(sc, AX_NETCFG, AX_TXTHRESH_72BYTES);
-
- /* Init our MAC address */
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_PAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, *(u_int32_t *)(&sc->arpcom.ac_enaddr[0]));
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_PAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, *(u_int32_t *)(&sc->arpcom.ac_enaddr[4]));
-
- /* Init circular RX list. */
- if (ax_list_rx_init(sc) == ENOBUFS) {
- printf("ax%d: initialization failed: no "
- "memory for rx buffers\n", sc->ax_unit);
- ax_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- ax_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_PROMISC);
- } else {
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_PROMISC);
- }
-
- /*
- * Set the capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_BROAD);
- } else {
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_BROAD);
- }
-
- /*
- * Load the multicast filter.
- */
- ax_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, AX_RXADDR, vtophys(sc->ax_cdata.ax_rx_head->ax_ptr));
- CSR_WRITE_4(sc, AX_TXADDR, vtophys(&sc->ax_ldata->ax_tx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, AX_IMR, AX_INTRS);
- CSR_WRITE_4(sc, AX_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON|AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->ax_pinfo != NULL)
- ax_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int ax_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- ax_autoneg_mii(sc, AX_FLAG_SCHEDDELAY, 1);
- else {
- if (sc->ax_pinfo == NULL)
- ax_setmode(sc, ifm->ifm_media, 1);
- else
- ax_setmode_mii(sc, ifm->ifm_media);
- }
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void ax_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct ax_softc *sc;
- u_int16_t advert = 0, ability = 0;
- u_int32_t media = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (sc->ax_pinfo == NULL) {
- media = CSR_READ_4(sc, AX_NETCFG);
- if (media & AX_NETCFG_PORTSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (media & AX_NETCFG_FULLDUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- if (!(ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = ax_phy_readreg(sc, PHY_LPAR);
- advert = ax_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int ax_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct ax_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- ax_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- ax_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- ax_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void ax_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->ax_autoneg) {
- ax_autoneg_mii(sc, AX_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("ax%d: watchdog timeout\n", sc->ax_unit);
-
- if (sc->ax_pinfo != NULL) {
- if (!(ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("ax%d: no carrier - transceiver "
- "cable problem?\n", sc->ax_unit);
- }
-
- ax_stop(sc);
- ax_reset(sc);
- ax_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- ax_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void ax_stop(sc)
- struct ax_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- AX_CLRBIT(sc, AX_NETCFG, (AX_NETCFG_RX_ON|AX_NETCFG_TX_ON));
- CSR_WRITE_4(sc, AX_IMR, 0x00000000);
- CSR_WRITE_4(sc, AX_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, AX_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < AX_RX_LIST_CNT; i++) {
- if (sc->ax_cdata.ax_rx_chain[i].ax_mbuf != NULL) {
- m_freem(sc->ax_cdata.ax_rx_chain[i].ax_mbuf);
- sc->ax_cdata.ax_rx_chain[i].ax_mbuf = NULL;
- }
- }
- bzero((char *)&sc->ax_ldata->ax_rx_list,
- sizeof(sc->ax_ldata->ax_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < AX_TX_LIST_CNT; i++) {
- if (sc->ax_cdata.ax_tx_chain[i].ax_mbuf != NULL) {
- m_freem(sc->ax_cdata.ax_tx_chain[i].ax_mbuf);
- sc->ax_cdata.ax_tx_chain[i].ax_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->ax_ldata->ax_tx_list,
- sizeof(sc->ax_ldata->ax_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void ax_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct ax_softc *sc = (struct ax_softc *)arg;
-
- ax_stop(sc);
-
- return;
-}
-
-static struct pci_device ax_device = {
- "ax",
- ax_probe,
- ax_attach,
- &ax_count,
- NULL
-};
-DATA_SET(pcidevice_set, ax_device);
diff --git a/sys/pci/if_axreg.h b/sys/pci/if_axreg.h
deleted file mode 100644
index 700c42ca9463..000000000000
--- a/sys/pci/if_axreg.h
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_axreg.h,v 1.4 1999/01/16 20:33:34 wpaul Exp $
- */
-
-/*
- * ASIX register definitions.
- */
-
-#define AX_BUSCTL 0x00 /* bus control */
-#define AX_TXSTART 0x08 /* tx start demand */
-#define AX_RXSTART 0x10 /* rx start demand */
-#define AX_RXADDR 0x18 /* rx descriptor list start addr */
-#define AX_TXADDR 0x20 /* tx descriptor list start addr */
-#define AX_ISR 0x28 /* interrupt status register */
-#define AX_NETCFG 0x30 /* network config register */
-#define AX_IMR 0x38 /* interrupt mask */
-#define AX_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define AX_SIO 0x48 /* MII and ROM/EEPROM access */
-#define AX_RESERVED 0x50
-#define AX_GENTIMER 0x58 /* general timer */
-#define AX_GENPORT 0x60 /* general purpose port */
-#define AX_FILTIDX 0x68 /* RX filter index */
-#define AX_FILTDATA 0x70 /* RX filter data */
-
-/*
- * Bus control bits.
- */
-#define AX_BUSCTL_RESET 0x00000001
-#define AX_BUSCTL_ARBITRATION 0x00000002
-#define AX_BUSCTL_BIGENDIAN 0x00000080
-#define AX_BUSCTL_BURSTLEN 0x00003F00
-#define AX_BUSCTL_BUF_BIGENDIAN 0x00100000
-#define AX_BISCTL_READMULTI 0x00200000
-
-#define AX_BURSTLEN_UNLIMIT 0x00000000
-#define AX_BURSTLEN_1LONG 0x00000100
-#define AX_BURSTLEN_2LONG 0x00000200
-#define AX_BURSTLEN_4LONG 0x00000400
-#define AX_BURSTLEN_8LONG 0x00000800
-#define AX_BURSTLEN_16LONG 0x00001000
-#define AX_BURSTLEN_32LONG 0x00002000
-
-#define AX_BUSCTL_CONFIG (AX_BUSCTL_ARBITRATION|AX_BURSTLEN_8LONG|AX_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define AX_ISR_TX_OK 0x00000001
-#define AX_ISR_TX_IDLE 0x00000002
-#define AX_ISR_TX_NOBUF 0x00000004
-#define AX_ISR_TX_JABBERTIMEO 0x00000008
-#define AX_ISR_TX_UNDERRUN 0x00000020
-#define AX_ISR_RX_OK 0x00000040
-#define AX_ISR_RX_NOBUF 0x00000080
-#define AX_ISR_RX_IDLE 0x00000100
-#define AX_ISR_RX_WATDOGTIMEO 0x00000200
-#define AX_ISR_TX_EARLY 0x00000400
-#define AX_ISR_TIMER_EXPIRED 0x00000800
-#define AX_ISR_BUS_ERR 0x00002000
-#define AX_ISR_ABNORMAL 0x00008000
-#define AX_ISR_NORMAL 0x00010000
-#define AX_ISR_RX_STATE 0x000E0000
-#define AX_ISR_TX_STATE 0x00700000
-#define AX_ISR_BUSERRTYPE 0x03800000
-
-#define AX_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define AX_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define AX_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define AX_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define AX_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define AX_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define AX_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define AX_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define AX_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define AX_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define AX_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define AX_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define AX_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define AX_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define AX_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define AX_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define AX_NETCFG_LINKSTAT_PCS 0x00000001
-#define AX_NETCFG_RX_ON 0x00000002
-#define AX_NETCFG_RX_BADFRAMES 0x00000008
-#define AX_NETCFG_RX_PROMISC 0x00000040
-#define AX_NETCFG_RX_ALLMULTI 0x00000080
-#define AX_NETCFG_RX_BROAD 0x00000100
-#define AX_NETCFG_FULLDUPLEX 0x00000200
-#define AX_NETCFG_LOOPBACK 0x00000C00
-#define AX_NETCFG_FORCECOLL 0x00001000
-#define AX_NETCFG_TX_ON 0x00002000
-#define AX_NETCFG_TX_THRESH 0x0000C000
-#define AX_NETCFG_PORTSEL 0x00040000 /* 0 == SRL, 1 == MII/SYM */
-#define AX_NETCFG_HEARTBEAT 0x00080000 /* 0 == ON, 1 == OFF */
-#define AX_NETCFG_STORENFWD 0x00200000
-#define AX_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */
-#define AX_NETCFG_PCS 0x00800000
-#define AX_NETCFG_SCRAMBLER 0x01000000
-#define AX_NETCFG_RX_ALL 0x40000000
-
-#define AX_OPMODE_NORM 0x00000000
-#define AX_OPMODE_INTLOOP 0x00000400
-#define AX_OPMODE_EXTLOOP 0x00000800
-
-#define AX_TXTHRESH_72BYTES 0x00000000
-#define AX_TXTHRESH_96BYTES 0x00004000
-#define AX_TXTHRESH_128BYTES 0x00008000
-#define AX_TXTHRESH_160BYTES 0x0000C000
-
-/*
- * Interrupt mask bits.
- */
-#define AX_IMR_TX_OK 0x00000001
-#define AX_IMR_TX_IDLE 0x00000002
-#define AX_IMR_TX_NOBUF 0x00000004
-#define AX_IMR_TX_JABBERTIMEO 0x00000008
-#define AX_IMR_TX_UNDERRUN 0x00000020
-#define AX_IMR_RX_OK 0x00000040
-#define AX_IMR_RX_NOBUF 0x00000080
-#define AX_IMR_RX_IDLE 0x00000100
-#define AX_IMR_RX_WATDOGTIMEO 0x00000200
-#define AX_IMR_TX_EARLY 0x00000400
-#define AX_IMR_TIMER_EXPIRED 0x00000800
-#define AX_IMR_BUS_ERR 0x00002000
-#define AX_IMR_RX_EARLY 0x00004000
-#define AX_IMR_ABNORMAL 0x00008000
-#define AX_IMR_NORMAL 0x00010000
-
-#define AX_INTRS \
- (AX_IMR_RX_OK|AX_IMR_TX_OK|AX_IMR_RX_NOBUF|AX_IMR_RX_WATDOGTIMEO|\
- AX_IMR_TX_NOBUF|AX_IMR_TX_UNDERRUN|AX_IMR_BUS_ERR| \
- AX_IMR_ABNORMAL|AX_IMR_NORMAL|/*AX_IMR_TX_EARLY*/ \
- AX_IMR_TX_IDLE|AX_IMR_RX_IDLE)
-
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define AX_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define AX_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define AX_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define AX_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define AX_SIO_EESEL 0x00000800
-#define AX_SIO_ROMSEL 0x00001000
-#define AX_SIO_ROMCTL_WRITE 0x00002000
-#define AX_SIO_ROMCTL_READ 0x00004000
-#define AX_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define AX_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */
-#define AX_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define AX_SIO_MII_DATAIN 0x00080000 /* MDIO data in */
-
-#define AX_EECMD_WRITE 0x140
-#define AX_EECMD_READ 0x180
-#define AX_EECMD_ERASE 0x1c0
-
-#define AX_EE_NODEADDR_OFFSET 0x70
-#define AX_EE_NODEADDR 10
-
-/*
- * General purpose timer register
- */
-#define AX_TIMER_VALUE 0x0000FFFF
-#define AX_TIMER_CONTINUOUS 0x00010000
-
-/*
- * RX Filter Index Register values
- */
-#define AX_FILTIDX_PAR0 0x00000000
-#define AX_FILTIDX_PAR1 0x00000001
-#define AX_FILTIDX_MAR0 0x00000002
-#define AX_FILTIDX_MAR1 0x00000003
-
-/*
- * ASIX TX/RX list structure.
- */
-
-struct ax_desc {
- volatile u_int32_t ax_status;
- volatile u_int32_t ax_ctl;
- volatile u_int32_t ax_ptr1;
- volatile u_int32_t ax_ptr2;
-};
-
-#define ax_data ax_ptr1
-#define ax_next ax_ptr2
-
-#define AX_RXSTAT_FIFOOFLOW 0x00000001
-#define AX_RXSTAT_CRCERR 0x00000002
-#define AX_RXSTAT_DRIBBLE 0x00000004
-#define AX_RXSTAT_WATCHDOG 0x00000010
-#define AX_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define AX_RXSTAT_COLLSEEN 0x00000040
-#define AX_RXSTAT_GIANT 0x00000080
-#define AX_RXSTAT_LASTFRAG 0x00000100
-#define AX_RXSTAT_FIRSTFRAG 0x00000200
-#define AX_RXSTAT_MULTICAST 0x00000400
-#define AX_RXSTAT_RUNT 0x00000800
-#define AX_RXSTAT_RXTYPE 0x00003000
-#define AX_RXSTAT_RXERR 0x00008000
-#define AX_RXSTAT_RXLEN 0x3FFF0000
-#define AX_RXSTAT_OWN 0x80000000
-
-#define AX_RXBYTES(x) ((x & AX_RXSTAT_RXLEN) >> 16)
-#define AX_RXSTAT (AX_RXSTAT_FIRSTFRAG|AX_RXSTAT_LASTFRAG|AX_RXSTAT_OWN)
-
-#define AX_RXCTL_BUFLEN1 0x00000FFF
-#define AX_RXCTL_BUFLEN2 0x00FFF000
-#define AX_RXCTL_RLAST 0x02000000
-
-#define AX_TXSTAT_DEFER 0x00000001
-#define AX_TXSTAT_UNDERRUN 0x00000002
-#define AX_TXSTAT_LINKFAIL 0x00000003
-#define AX_TXSTAT_COLLCNT 0x00000078
-#define AX_TXSTAT_SQE 0x00000080
-#define AX_TXSTAT_EXCESSCOLL 0x00000100
-#define AX_TXSTAT_LATECOLL 0x00000200
-#define AX_TXSTAT_NOCARRIER 0x00000400
-#define AX_TXSTAT_CARRLOST 0x00000800
-#define AX_TXSTAT_JABTIMEO 0x00004000
-#define AX_TXSTAT_ERRSUM 0x00008000
-#define AX_TXSTAT_OWN 0x80000000
-
-#define AX_TXCTL_BUFLEN1 0x000007FF
-#define AX_TXCTL_BUFLEN2 0x003FF800
-#define AX_TXCTL_PAD 0x00800000
-#define AX_TXCTL_TLAST 0x02000000
-#define AX_TXCTL_NOCRC 0x04000000
-#define AX_TXCTL_FIRSTFRAG 0x20000000
-#define AX_TXCTL_LASTFRAG 0x40000000
-#define AX_TXCTL_FINT 0x80000000
-
-#define AX_MAXFRAGS 16
-#define AX_RX_LIST_CNT 64
-#define AX_TX_LIST_CNT 64
-#define AX_MIN_FRAMELEN 60
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct ax_txdesc {
- volatile struct ax_desc ax_frag[AX_MAXFRAGS];
-};
-
-#define AX_TXNEXT(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_next
-#define AX_TXSTATUS(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_status
-#define AX_TXCTL(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_ctl
-#define AX_TXDATA(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_data
-
-#define AX_TXOWN(x) x->ax_ptr->ax_frag[0].ax_status
-
-#define AX_UNSENT 0x12341234
-
-struct ax_list_data {
- volatile struct ax_desc ax_rx_list[AX_RX_LIST_CNT];
- volatile struct ax_txdesc ax_tx_list[AX_TX_LIST_CNT];
-};
-
-struct ax_chain {
- volatile struct ax_txdesc *ax_ptr;
- struct mbuf *ax_mbuf;
- struct ax_chain *ax_nextdesc;
- u_int8_t ax_lastdesc;
-};
-
-struct ax_chain_onefrag {
- volatile struct ax_desc *ax_ptr;
- struct mbuf *ax_mbuf;
- struct ax_chain_onefrag *ax_nextdesc;
-};
-
-struct ax_chain_data {
- struct ax_chain_onefrag ax_rx_chain[AX_RX_LIST_CNT];
- struct ax_chain ax_tx_chain[AX_TX_LIST_CNT];
-
- struct ax_chain_onefrag *ax_rx_head;
-
- struct ax_chain *ax_tx_head;
- struct ax_chain *ax_tx_tail;
- struct ax_chain *ax_tx_free;
-};
-
-struct ax_type {
- u_int16_t ax_vid;
- u_int16_t ax_did;
- char *ax_name;
-};
-
-struct ax_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define AX_MII_STARTDELIM 0x01
-#define AX_MII_READOP 0x02
-#define AX_MII_WRITEOP 0x01
-#define AX_MII_TURNAROUND 0x02
-
-#define AX_FLAG_FORCEDELAY 1
-#define AX_FLAG_SCHEDDELAY 2
-#define AX_FLAG_DELAYTIMEO 3
-
-struct ax_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t ax_bhandle; /* bus space handle */
- bus_space_tag_t ax_btag; /* bus space tag */
- struct ax_type *ax_info; /* ASIX adapter info */
- struct ax_type *ax_pinfo; /* phy info */
- u_int8_t ax_unit; /* interface number */
- u_int8_t ax_type;
- u_int8_t ax_phy_addr; /* PHY address */
- u_int8_t ax_tx_pend; /* TX pending */
- u_int8_t ax_want_auto;
- u_int8_t ax_autoneg;
- caddr_t ax_ldata_ptr;
- struct ax_list_data *ax_ldata;
- struct ax_chain_data ax_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->ax_btag, sc->ax_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->ax_btag, sc->ax_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->ax_btag, sc->ax_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->ax_btag, sc->ax_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->ax_btag, sc->ax_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->ax_btag, sc->ax_bhandle, reg)
-
-#define AX_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * ASIX PCI vendor ID
- */
-#define AX_VENDORID 0x125B
-
-/*
- * ASIX device IDs.
- */
-#define AX_DEVICEID_AX88140A 0x1400
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define AX_PCI_VENDOR_ID 0x00
-#define AX_PCI_DEVICE_ID 0x02
-#define AX_PCI_COMMAND 0x04
-#define AX_PCI_STATUS 0x06
-#define AX_PCI_REVID 0x08
-#define AX_PCI_CLASSCODE 0x09
-#define AX_PCI_LATENCY_TIMER 0x0D
-#define AX_PCI_HEADER_TYPE 0x0E
-#define AX_PCI_LOIO 0x10
-#define AX_PCI_LOMEM 0x14
-#define AX_PCI_BIOSROM 0x30
-#define AX_PCI_INTLINE 0x3C
-#define AX_PCI_INTPIN 0x3D
-#define AX_PCI_MINGNT 0x3E
-#define AX_PCI_MINLAT 0x0F
-#define AX_PCI_RESETOPT 0x48
-#define AX_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define AX_PCI_CAPID 0xDC /* 8 bits */
-#define AX_PCI_NEXTPTR 0xDD /* 8 bits */
-#define AX_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define AX_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define AX_PSTATE_MASK 0x0003
-#define AX_PSTATE_D0 0x0000
-#define AX_PSTATE_D1 0x0001
-#define AX_PSTATE_D2 0x0002
-#define AX_PSTATE_D3 0x0003
-#define AX_PME_EN 0x0010
-#define AX_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define AX_PHYADDR_MIN 0x00
-#define AX_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 82354275e866..8b74e4358aaf 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.80 1998/09/25 18:06:53 matt Exp $ */
-/* $Id: if_de.c,v 1.92 1998/12/14 05:47:26 dillon Exp $ */
+/* $Id: if_de.c,v 1.88 1998/10/13 09:05:57 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -39,6 +39,11 @@
*/
#define TULIP_HDR_DATA
+#ifdef __FreeBSD__
+#include "opt_inet.h"
+#include "opt_ipx.h"
+#endif
+
#ifdef __NetBSD__
#include "opt_inet.h"
#include "opt_ns.h"
@@ -57,21 +62,6 @@
#include <sys/device.h>
#endif
-#if defined(__FreeBSD__)
-/* In case somebody is trying to run this on an older 2.2 or 3.0 */
-#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
-#if __FreeBSD__ >= 3
-#define __FreeBSD_version 300000
-#else
-#define __FreeBSD_version 200000
-#endif
-#endif
-#if __FreeBSD_version >= 300000
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#endif
-#endif
-
#if defined(__NetBSD__)
#include "rnd.h"
#if NRND > 0
@@ -123,6 +113,14 @@
#include <pci/dc21040reg.h>
#define DEVAR_INCLUDE "pci/if_devar.h"
#endif
+/* In case somebody is trying to run this on an older 2.2 or 3.0 */
+#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
+#if __FreeBSD__ >= 3
+#define __FreeBSD_version 300000
+#else
+#define __FreeBSD_version 200000
+#endif
+#endif
#endif /* __FreeBSD__ */
#if defined(__bsdi__)
@@ -2757,7 +2755,6 @@ static const struct {
{ tulip_identify_znyx_nic, { 0x00, 0xC0, 0x95 } },
{ tulip_identify_cogent_nic, { 0x00, 0x00, 0x92 } },
{ tulip_identify_asante_nic, { 0x00, 0x00, 0x94 } },
- { tulip_identify_cogent_nic, { 0x00, 0x00, 0xD1 } },
{ tulip_identify_accton_nic, { 0x00, 0x00, 0xE8 } },
{ NULL }
};
@@ -2861,7 +2858,7 @@ tulip_read_macaddr(
* Some folks don't use the standard ethernet rom format
* but instead just put the address in the first 6 bytes
* of the rom and let the rest be all 0xffs. (Can we say
- * ZNYX?) (well sometimes they put in a checksum so we'll
+ * ZNYX???) (well sometimes they put in a checksum so we'll
* start at 8).
*/
for (idx = 8; idx < 32; idx++) {
@@ -5310,7 +5307,7 @@ tulip_pci_shutdown(
}
#endif
-static const char*
+static char*
tulip_pci_probe(
pcici_t config_id,
pcidi_t device_id)
diff --git a/sys/pci/if_devar.h b/sys/pci/if_devar.h
index b0ec38445ca8..1f4b577a8084 100644
--- a/sys/pci/if_devar.h
+++ b/sys/pci/if_devar.h
@@ -1,5 +1,5 @@
/* $NetBSD: if_devar.h,v 1.31 1998/09/29 22:40:52 matt Exp $ */
-/* $Id: if_devar.h,v 1.11 1998/10/14 08:31:27 peter Exp $ */
+/* $Id: if_devar.h,v 1.10 1998/10/13 09:05:58 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -62,16 +62,8 @@ typedef bus_addr_t tulip_csrptr_t;
#define TULIP_PCI_CSRSIZE 8
#define TULIP_PCI_CSROFFSET 0
-#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
-typedef u_long uintptr_t;
-#endif
-
#if !defined(__NetBSD__)
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
typedef pci_port_t tulip_csrptr_t;
-#else
-typedef u_int16_t tulip_csrptr_t;
-#endif
#define TULIP_CSR_READ(sc, csr) (inl((sc)->tulip_csrs.csr))
#define TULIP_CSR_WRITE(sc, csr, val) outl((sc)->tulip_csrs.csr, val)
@@ -951,11 +943,7 @@ static void tulip_softintr(void);
#if defined(__FreeBSD__)
typedef void ifnet_ret_t;
-#if __FreeBSD_version >= 300000
typedef u_long ioctl_cmd_t;
-#else
-typedef int ioctl_cmd_t;
-#endif
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
diff --git a/sys/pci/if_ed_p.c b/sys/pci/if_ed_p.c
index e14a96c50abd..d284ee6074e0 100644
--- a/sys/pci/if_ed_p.c
+++ b/sys/pci/if_ed_p.c
@@ -17,7 +17,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: if_ed_p.c,v 1.13 1998/03/17 10:54:23 danny Exp $
+ * $Id: if_ed_p.c,v 1.12 1998/02/27 22:29:36 se Exp $
*/
#include "pci.h"
@@ -51,7 +51,7 @@ static struct _pcsid
extern void *ed_attach_NE2000_pci __P((int, int));
-static const char* ed_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* ed_pci_probe __P((pcici_t tag, pcidi_t type));
static void ed_pci_attach __P((pcici_t config_id, int unit));
static u_long ed_pci_count = NED;
@@ -66,7 +66,7 @@ static struct pci_device ed_pci_driver = {
DATA_SET (pcidevice_set, ed_pci_driver);
-static const char*
+static char*
ed_pci_probe (pcici_t tag, pcidi_t type)
{
struct _pcsid *ep =pci_ids;
diff --git a/sys/pci/if_en_pci.c b/sys/pci/if_en_pci.c
index 3414edc489be..d1853b5748aa 100644
--- a/sys/pci/if_en_pci.c
+++ b/sys/pci/if_en_pci.c
@@ -50,6 +50,17 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
+#ifndef SHUTDOWN_PRE_SYNC
+/*
+ * device shutdown mechanism has been changed since 2.2-ALPHA.
+ * if SHUTDOWN_PRE_SYNC is defined in "sys/systm.h", use new one.
+ * otherwise, use old one.
+ * new: 2.2-ALPHA, 2.2-BETA, 2.2-GAMME, 2.2-RELEASE, 3.0
+ * old: 2.1.5, 2.1.6, 2.2-SNAP
+ * -- kjc
+ */
+#include <sys/devconf.h>
+#endif
#include <sys/malloc.h>
#include <sys/socket.h>
@@ -69,8 +80,12 @@
*/
static void en_pci_attach __P((pcici_t, int));
-static const char *en_pci_probe __P((pcici_t, pcidi_t));
+static char *en_pci_probe __P((pcici_t, pcidi_t));
+#ifdef SHUTDOWN_PRE_SYNC
static void en_pci_shutdown __P((int, void *));
+#else
+static int en_pci_shutdown __P((struct kern_devconf *, int));
+#endif
/*
* local structures
@@ -83,15 +98,8 @@ struct en_pci_softc {
/* PCI bus glue */
void *sc_ih; /* interrupt handle */
pci_chipset_tag_t en_pc; /* for PCI calls */
- pcici_t en_confid; /* config id */
-};
-#if !defined(MIDWAY_ENIONLY)
-static void eni_get_macaddr __P((struct en_pci_softc *));
-#endif
-#if !defined(MIDWAY_ADPONLY)
-static void adp_get_macaddr __P((struct en_pci_softc *));
-#endif
+};
/*
* pointers to softcs (we alloc)
@@ -111,7 +119,11 @@ static struct pci_device endevice = {
en_pci_probe,
en_pci_attach,
&en_pci_count,
+#ifdef SHUTDOWN_PRE_SYNC
NULL,
+#else
+ en_pci_shutdown,
+#endif
};
DATA_SET (pcidevice_set, endevice);
@@ -191,7 +203,7 @@ void *v;
* autoconfig stuff
*/
-static const char *en_pci_probe(config_id, device_id)
+static char *en_pci_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -247,10 +259,9 @@ int unit;
enpcis[unit] = scp; /* lock it in */
en_cd.cd_devs[unit] = sc; /* fake a cfdriver structure */
en_cd.cd_ndevs = NEN;
- snprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), "en%d", unit);
+ sprintf(sc->sc_dev.dv_xname, "en%d", unit);
sc->enif.if_unit = unit;
sc->enif.if_name = "en";
- scp->en_confid = config_id;
/*
* figure out if we are an adaptec card or not.
@@ -261,12 +272,14 @@ int unit;
device_id = pci_conf_read(config_id, PCI_ID_REG);
sc->is_adaptec = (PCI_VENDOR(device_id) == PCI_VENDOR_ADP) ? 1 : 0;
+#ifdef SHUTDOWN_PRE_SYNC
/*
* Add shutdown hook so that DMA is disabled prior to reboot. Not
* doing so could allow DMA to corrupt kernel memory during the
* reboot before the driver initializes.
*/
at_shutdown(en_pci_shutdown, scp, SHUTDOWN_POST_SYNC);
+#endif
if (!pci_map_int(config_id, en_intr, (void *) sc, &net_imask)) {
printf("%s: couldn't establish interrupt\n", sc->sc_dev.dv_xname);
@@ -280,7 +293,6 @@ int unit;
#if !defined(MIDWAY_ENIONLY)
if (sc->is_adaptec) {
- adp_get_macaddr(scp);
sc->en_busreset = adp_busreset;
adp_busreset(sc);
}
@@ -288,7 +300,6 @@ int unit;
#if !defined(MIDWAY_ADPONLY)
if (!sc->is_adaptec) {
- eni_get_macaddr(scp);
sc->en_busreset = NULL;
pci_conf_write(config_id, EN_TONGA, (TONGA_SWAP_DMA|TONGA_SWAP_WORD));
}
@@ -302,6 +313,7 @@ int unit;
}
+#ifdef SHUTDOWN_PRE_SYNC
static void
en_pci_shutdown(
int howto,
@@ -312,126 +324,22 @@ en_pci_shutdown(
en_reset(&psc->esc);
DELAY(10);
}
+#else /* !SHUTDOWN_PRE_SYNC */
+static int
+en_pci_shutdown(kdc, force)
-#if !defined(MIDWAY_ENIONLY)
-
-#if defined(sparc) || defined(__FreeBSD__)
-#define bus_space_read_1(t, h, o) \
- ((void)t, (*(volatile u_int8_t *)((h) + (o))))
-#endif
-
-static void
-adp_get_macaddr(scp)
- struct en_pci_softc *scp;
-{
- struct en_softc * sc = (struct en_softc *)scp;
- int lcv;
-
- for (lcv = 0; lcv < sizeof(sc->macaddr); lcv++)
- sc->macaddr[lcv] = bus_space_read_1(sc->en_memt, sc->en_base,
- MID_ADPMACOFF + lcv);
-}
-
-#endif /* MIDWAY_ENIONLY */
-
-#if !defined(MIDWAY_ADPONLY)
+struct kern_devconf *kdc;
+int force;
-/*
- * Read station (MAC) address from serial EEPROM.
- * derived from linux drivers/atm/eni.c by Werner Almesberger, EPFL LRC.
- */
-#define EN_PROM_MAGIC 0x0c
-#define EN_PROM_DATA 0x02
-#define EN_PROM_CLK 0x01
-#define EN_ESI 64
-
-static void
-eni_get_macaddr(scp)
- struct en_pci_softc *scp;
{
- struct en_softc * sc = (struct en_softc *)scp;
- pcici_t id = scp->en_confid;
- int i, j, address, status;
- u_int32_t data, t_data;
- u_int8_t tmp;
-
- t_data = pci_conf_read(id, EN_TONGA) & 0xffffff00;
-
- data = EN_PROM_MAGIC | EN_PROM_DATA | EN_PROM_CLK;
- pci_conf_write(id, EN_TONGA, data);
-
- for (i = 0; i < sizeof(sc->macaddr); i ++){
- /* start operation */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- /* send address with serial line */
- address = ((i + EN_ESI) << 1) + 1;
- for ( j = 7 ; j >= 0 ; j --){
- data = (address >> j) & 1 ? data | EN_PROM_DATA :
- data & ~EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- }
- /* get ack */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- status = data & EN_PROM_DATA;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
-
- tmp = 0;
-
- for ( j = 7 ; j >= 0 ; j --){
- tmp <<= 1;
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- if(data & EN_PROM_DATA) tmp |= 1;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- }
- /* get ack */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- status = data & EN_PROM_DATA;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
-
- sc->macaddr[i] = tmp;
+ if (kdc->kdc_unit < NEN) {
+ struct en_pci_softc *psc = enpcis[kdc->kdc_unit];
+ if (psc) /* can it be null? */
+ en_reset(&psc->esc);
+ DELAY(10);
}
- /* stop operation */
- data &= ~EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- pci_conf_write(id, EN_TONGA, t_data);
+ dev_detach(kdc);
+ return(0);
}
-
-#endif /* !MIDWAY_ADPONLY */
-
+#endif /* !SHUTDOWN_PRE_SYNC */
#endif /* NEN > 0 && NPCI > 0 */
diff --git a/sys/pci/if_fpa.c b/sys/pci/if_fpa.c
index cff0be24ca84..8706f2a06d5c 100644
--- a/sys/pci/if_fpa.c
+++ b/sys/pci/if_fpa.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_fpa.c,v 1.7 1998/02/20 13:11:53 bde Exp $
+ * $Id: if_fpa.c,v 1.6 1998/02/09 06:10:49 eivind Exp $
*
*/
@@ -135,7 +135,7 @@ static void pdq_pci_shutdown(int, void *);
* on both EISA and PCI boards, one must be careful in how defines the
* PDQ in the config file.
*/
-static const char *
+static char *
pdq_pci_probe(
pcici_t config_id,
pcidi_t device_id)
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 1908cb6eff70..750e268c8abe 100644
--- a/sys/pci/if_fxp.c
+++ b/sys/pci/if_fxp.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_fxp.c,v 1.58 1998/10/22 02:00:49 dg Exp $
+ * $Id: if_fxp.c,v 1.56 1998/10/10 19:26:40 dg Exp $
*/
/*
@@ -485,7 +485,7 @@ fxp_ether_ioctl(ifp, cmd, data)
#else /* __FreeBSD__ */
static u_long fxp_count;
-static const char *fxp_probe __P((pcici_t, pcidi_t));
+static char *fxp_probe __P((pcici_t, pcidi_t));
static void fxp_attach __P((pcici_t, int));
static void fxp_shutdown __P((int, void *));
@@ -502,7 +502,7 @@ DATA_SET(pcidevice_set, fxp_device);
/*
* Return identification string if this is device is ours.
*/
-static const char *
+static char *
fxp_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1072,7 +1072,6 @@ fxp_stats_update(arg)
struct fxp_softc *sc = arg;
struct ifnet *ifp = &sc->sc_if;
struct fxp_stats *sp = sc->fxp_stats;
- struct fxp_cb_tx *txp;
int s;
ifp->if_opackets += sp->tx_good;
@@ -1081,9 +1080,6 @@ fxp_stats_update(arg)
ifp->if_ipackets += sp->rx_good;
sc->rx_idle_secs = 0;
} else {
- /*
- * Receiver's been idle for another second.
- */
sc->rx_idle_secs++;
}
ifp->if_ierrors +=
@@ -1102,23 +1098,6 @@ fxp_stats_update(arg)
}
s = splimp();
/*
- * Release any xmit buffers that have completed DMA. This isn't
- * strictly necessary to do here, but it's advantagous for mbufs
- * with external storage to be released in a timely manner rather
- * than being defered for a potentially long time. This limits
- * the delay to a maximum of one second.
- */
- for (txp = sc->cbl_first; sc->tx_queued &&
- (txp->cb_status & FXP_CB_STATUS_C) != 0;
- txp = txp->next) {
- if (txp->mb_head != NULL) {
- m_freem(txp->mb_head);
- txp->mb_head = NULL;
- }
- sc->tx_queued--;
- }
- sc->cbl_first = txp;
- /*
* If we haven't received any packets in FXP_MAC_RX_IDLE seconds,
* then assume the receiver has locked up and attempt to clear
* the condition by reprogramming the multicast filter. This is
diff --git a/sys/pci/if_lnc_p.c b/sys/pci/if_lnc_p.c
index 27f2048d4377..3cffcab8030a 100644
--- a/sys/pci/if_lnc_p.c
+++ b/sys/pci/if_lnc_p.c
@@ -17,7 +17,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: if_lnc_p.c,v 1.6 1998/07/20 17:33:01 msmith Exp $
+ * $Id: if_lnc_p.c,v 1.5 1997/08/02 14:33:11 bde Exp $
*/
#include "pci.h"
@@ -36,7 +36,7 @@
extern void *lnc_attach_ne2100_pci __P((int unit, unsigned iobase));
-static const char* lnc_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* lnc_pci_probe __P((pcici_t tag, pcidi_t type));
static void lnc_pci_attach __P((pcici_t config_id, int unit));
static u_long lnc_pci_count = NLNC;
@@ -51,7 +51,7 @@ static struct pci_device lnc_pci_driver = {
DATA_SET (pcidevice_set, lnc_pci_driver);
-static const char*
+static char*
lnc_pci_probe (pcici_t tag, pcidi_t type)
{
switch(type) {
diff --git a/sys/pci/if_mx.c b/sys/pci/if_mx.c
deleted file mode 100644
index 621c3c7d94f1..000000000000
--- a/sys/pci/if_mx.c
+++ /dev/null
@@ -1,2436 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_mx.c,v 1.33 1999/01/06 17:22:40 wpaul Exp $
- */
-
-/*
- * Macronix PMAC fast ethernet PCI NIC driver
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The Macronix 98713, 98715 and 98725 chips are still more tulip clones.
- * The 98713 has an internal transceiver and an MII bus for external PHYs.
- * The other two chips have only the internal transceiver. All have
- * support for built-in autonegotiation. Additionally, there are 98713A
- * and 98715A chips which support power management. The 98725 chip
- * supports power management as well.
- *
- * Datasheets for the Macronix parts can be obtained from www.macronix.com.
- * Note however that the datasheets do not describe the TX and RX
- * descriptor structures or the setup frame format(s). For this, you should
- * obtain a DEC 21x4x datasheet from developer.intel.com. The Macronix
- * chips look to be fairly straightforward tulip clones, except for
- * the NWAY support.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define MX_USEIOSPACE
-
-/* #define MX_BACKGROUND_AUTONEG */
-
-#include <pci/if_mxreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_mx.c,v 1.33 1999/01/06 17:22:40 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct mx_type mx_devs[] = {
- { MX_VENDORID, MX_DEVICEID_98713,
- "Macronix 98713 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_98713,
- "Macronix 98713A 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_987x5,
- "Macronix 98715/98715A 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_987x5,
- "Macronix 98725 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct mx_type mx_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long mx_count = 0;
-static const char *mx_probe __P((pcici_t, pcidi_t));
-static void mx_attach __P((pcici_t, int));
-
-static int mx_newbuf __P((struct mx_softc *,
- struct mx_chain_onefrag *));
-static int mx_encap __P((struct mx_softc *, struct mx_chain *,
- struct mbuf *));
-
-static void mx_rxeof __P((struct mx_softc *));
-static void mx_rxeoc __P((struct mx_softc *));
-static void mx_txeof __P((struct mx_softc *));
-static void mx_txeoc __P((struct mx_softc *));
-static void mx_intr __P((void *));
-static void mx_start __P((struct ifnet *));
-static int mx_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void mx_init __P((void *));
-static void mx_stop __P((struct mx_softc *));
-static void mx_watchdog __P((struct ifnet *));
-static void mx_shutdown __P((int, void *));
-static int mx_ifmedia_upd __P((struct ifnet *));
-static void mx_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void mx_delay __P((struct mx_softc *));
-static void mx_eeprom_idle __P((struct mx_softc *));
-static void mx_eeprom_putbyte __P((struct mx_softc *, u_int8_t));
-static void mx_eeprom_getword __P((struct mx_softc *, u_int8_t, u_int16_t *));
-static void mx_read_eeprom __P((struct mx_softc *, caddr_t, int,
- int, int));
-
-static void mx_mii_writebit __P((struct mx_softc *, int));
-static int mx_mii_readbit __P((struct mx_softc *));
-static void mx_mii_sync __P((struct mx_softc *));
-static void mx_mii_send __P((struct mx_softc *, u_int32_t, int));
-static int mx_mii_readreg __P((struct mx_softc *, struct mx_mii_frame *));
-static int mx_mii_writereg __P((struct mx_softc *, struct mx_mii_frame *));
-static u_int16_t mx_phy_readreg __P((struct mx_softc *, int));
-static void mx_phy_writereg __P((struct mx_softc *, u_int16_t, u_int16_t));
-
-static void mx_autoneg_xmit __P((struct mx_softc *));
-static void mx_autoneg_mii __P((struct mx_softc *, int, int));
-static void mx_autoneg __P((struct mx_softc *, int, int));
-static void mx_setmode_mii __P((struct mx_softc *, int));
-static void mx_setmode __P((struct mx_softc *, int, int));
-static void mx_getmode_mii __P((struct mx_softc *));
-static void mx_setcfg __P((struct mx_softc *, u_int16_t));
-static u_int32_t mx_calchash __P((u_int8_t *));
-static void mx_setfilt __P((struct mx_softc *));
-static void mx_reset __P((struct mx_softc *));
-static int mx_list_rx_init __P((struct mx_softc *));
-static int mx_list_tx_init __P((struct mx_softc *));
-
-#define MX_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define MX_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, MX_SIO, \
- CSR_READ_4(sc, MX_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, MX_SIO, \
- CSR_READ_4(sc, MX_SIO) & ~x)
-
-static void mx_delay(sc)
- struct mx_softc *sc;
-{
- int idx;
-
- for (idx = (300 / 33) + 1; idx > 0; idx--)
- CSR_READ_4(sc, MX_BUSCTL);
-}
-
-static void mx_eeprom_idle(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_EESEL);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_ROMCTL_READ);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
-
- for (i = 0; i < 25; i++) {
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- CSR_WRITE_4(sc, MX_SIO, 0x00000000);
-
- return;
-}
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void mx_eeprom_putbyte(sc, addr)
- struct mx_softc *sc;
- u_int8_t addr;
-{
- register int d, i;
-
- d = addr | MX_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(MX_SIO_EE_DATAIN);
- } else {
- SIO_CLR(MX_SIO_EE_DATAIN);
- }
- mx_delay(sc);
- SIO_SET(MX_SIO_EE_CLK);
- mx_delay(sc);
- SIO_CLR(MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void mx_eeprom_getword(sc, addr, dest)
- struct mx_softc *sc;
- u_int8_t addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Force EEPROM to idle state. */
- mx_eeprom_idle(sc);
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_EESEL);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_ROMCTL_READ);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
-
- /*
- * Send address of word we want to read.
- */
- mx_eeprom_putbyte(sc, addr);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(MX_SIO_EE_CLK);
- mx_delay(sc);
- if (CSR_READ_4(sc, MX_SIO) & MX_SIO_EE_DATAOUT)
- word |= i;
- mx_delay(sc);
- SIO_CLR(MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- /* Turn off EEPROM access mode. */
- mx_eeprom_idle(sc);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void mx_read_eeprom(sc, dest, off, cnt, swap)
- struct mx_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- mx_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * The following two routines are taken from the Macronix 98713
- * Application Notes pp.19-21.
- */
-/*
- * Write a bit to the MII bus.
- */
-static void mx_mii_writebit(sc, bit)
- struct mx_softc *sc;
- int bit;
-{
- if (bit)
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE|MX_SIO_MII_DATAOUT);
- else
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE);
-
- MX_SETBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_MII_CLK);
-
- return;
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int mx_mii_readbit(sc)
- struct mx_softc *sc;
-{
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_READ|MX_SIO_MII_DIR);
- CSR_READ_4(sc, MX_SIO);
- MX_SETBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- if (CSR_READ_4(sc, MX_SIO) & MX_SIO_MII_DATAIN)
- return(1);
-
- return(0);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void mx_mii_sync(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE);
-
- for (i = 0; i < 32; i++)
- mx_mii_writebit(sc, 1);
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void mx_mii_send(sc, bits, cnt)
- struct mx_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1)
- mx_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int mx_mii_readreg(sc, frame)
- struct mx_softc *sc;
- struct mx_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = MX_MII_STARTDELIM;
- frame->mii_opcode = MX_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- /*
- * Sync the PHYs.
- */
- mx_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- mx_mii_send(sc, frame->mii_stdelim, 2);
- mx_mii_send(sc, frame->mii_opcode, 2);
- mx_mii_send(sc, frame->mii_phyaddr, 5);
- mx_mii_send(sc, frame->mii_regaddr, 5);
-
-#ifdef notdef
- /* Idle bit */
- mx_mii_writebit(sc, 1);
- mx_mii_writebit(sc, 0);
-#endif
-
- /* Check for ack */
- ack = mx_mii_readbit(sc);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- mx_mii_readbit(sc);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- if (!ack) {
- if (mx_mii_readbit(sc))
- frame->mii_data |= i;
- }
- }
-
-fail:
-
- mx_mii_writebit(sc, 0);
- mx_mii_writebit(sc, 0);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int mx_mii_writereg(sc, frame)
- struct mx_softc *sc;
- struct mx_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = MX_MII_STARTDELIM;
- frame->mii_opcode = MX_MII_WRITEOP;
- frame->mii_turnaround = MX_MII_TURNAROUND;
-
- /*
- * Sync the PHYs.
- */
- mx_mii_sync(sc);
-
- mx_mii_send(sc, frame->mii_stdelim, 2);
- mx_mii_send(sc, frame->mii_opcode, 2);
- mx_mii_send(sc, frame->mii_phyaddr, 5);
- mx_mii_send(sc, frame->mii_regaddr, 5);
- mx_mii_send(sc, frame->mii_turnaround, 2);
- mx_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- mx_mii_writebit(sc, 0);
- mx_mii_writebit(sc, 0);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t mx_phy_readreg(sc, reg)
- struct mx_softc *sc;
- int reg;
-{
- struct mx_mii_frame frame;
- u_int32_t cfg;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->mx_phy_addr;
- frame.mii_regaddr = reg;
- cfg = CSR_READ_4(sc, MX_NETCFG);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- mx_mii_readreg(sc, &frame);
- CSR_WRITE_4(sc, MX_NETCFG, cfg);
-
- return(frame.mii_data);
-}
-
-static void mx_phy_writereg(sc, reg, data)
- struct mx_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- struct mx_mii_frame frame;
- u_int32_t cfg;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->mx_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- cfg = CSR_READ_4(sc, MX_NETCFG);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- mx_mii_writereg(sc, &frame);
- CSR_WRITE_4(sc, MX_NETCFG, cfg);
-
- return;
-}
-
-#define MX_POLY 0xEDB88320
-#define MX_BITS 9
-
-static u_int32_t mx_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t idx, bit, data, crc;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (idx = 0; idx < 6; idx++) {
- for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1)
- crc = (crc >> 1) ^ (((crc ^ data) & 1) ? MX_POLY : 0);
- }
-
- return (crc & ((1 << MX_BITS) - 1));
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void mx_autoneg_xmit(sc)
- struct mx_softc *sc;
-{
- u_int16_t phy_sts;
-
- mx_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(mx_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = mx_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- mx_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void mx_autoneg_mii(sc, flag, verbose)
- struct mx_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = mx_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("mx%d: autonegotiation not supported\n",
- sc->mx_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case MX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- mx_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case MX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise mx_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->mx_cdata.mx_tx_head != NULL) {
- sc->mx_want_auto = 1;
- return;
- }
- mx_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->mx_autoneg = 1;
- sc->mx_want_auto = 0;
- return;
- break;
- case MX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->mx_autoneg = 0;
- break;
- default:
- printf("mx%d: invalid autoneg flag: %d\n", sc->mx_unit, flag);
- return;
- }
-
- if (mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("mx%d: autoneg complete, ", sc->mx_unit);
- phy_sts = mx_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("mx%d: autoneg not complete, ", sc->mx_unit);
- }
-
- media = mx_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = mx_phy_readreg(sc, PHY_ANAR);
- ability = mx_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- mx_setcfg(sc, media);
- mx_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- mx_init(sc);
-
- if (sc->mx_tx_pend) {
- sc->mx_autoneg = 0;
- sc->mx_tx_pend = 0;
- mx_start(ifp);
- }
-
- return;
-}
-
-/*
- * Invoke autoneg using internal NWAY.
- */
-static void mx_autoneg(sc, flag, verbose)
- struct mx_softc *sc;
- int flag;
- int verbose;
-{
- u_int32_t media, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- switch (flag) {
- case MX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- MX_SETBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- MX_SETBIT(sc, MX_10BTCTRL, MX_ASTAT_TXDISABLE);
- DELAY(5000000);
- break;
- case MX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise mx_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->mx_cdata.mx_tx_head != NULL) {
- sc->mx_want_auto = 1;
- return;
- }
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- MX_SETBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- MX_SETBIT(sc, MX_10BTCTRL, MX_ASTAT_TXDISABLE);
- ifp->if_timer = 5;
- sc->mx_autoneg = 1;
- sc->mx_want_auto = 0;
- return;
- break;
- case MX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->mx_autoneg = 0;
- break;
- default:
- printf("mx%d: invalid autoneg flag: %d\n", sc->mx_unit, flag);
- return;
- }
-
- if ((CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_ANEGSTAT) ==
- MX_ASTAT_AUTONEGCMP) {
- if (verbose)
- printf("mx%d: autoneg complete, ", sc->mx_unit);
- } else {
- if (verbose)
- printf("mx%d: autoneg not complete, ", sc->mx_unit);
- }
-
- media = CSR_READ_4(sc, MX_NETCFG);
-
- /* Link is good. Report modes and set duplex mode. */
- if (!(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS10) ||
- !(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS100)) {
- if (verbose)
- printf("link status good ");
- ability = CSR_READ_4(sc, MX_NWAYSTAT);
- if (ability & MX_NWAY_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(100baseT4)\n");
- } else if (ability & MX_NWAY_100BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media |= MX_NETCFG_FULLDUPLEX;
- media &= ~MX_NETCFG_SPEEDSEL;
- printf("(full-duplex, 100Mbps)\n");
- } else if (ability & MX_NWAY_100BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(half-duplex, 100Mbps)\n");
- } else if (ability & MX_NWAY_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~MX_NETCFG_PORTSEL;
- media |= (MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~MX_NETCFG_PORTSEL;
- media &= ~MX_NETCFG_FULLDUPLEX;
- media |= MX_NETCFG_SPEEDSEL;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- CSR_WRITE_4(sc, MX_NETCFG, media);
- MX_CLRBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- mx_init(sc);
-
- if (sc->mx_tx_pend) {
- sc->mx_autoneg = 0;
- sc->mx_tx_pend = 0;
- mx_start(ifp);
- }
-
- return;
-}
-
-static void mx_getmode_mii(sc)
- struct mx_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = mx_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("mx%d: PHY status word: %x\n", sc->mx_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("mx%d: 10Mbps half-duplex mode supported\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("mx%d: 10Mbps full-duplex mode supported\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("mx%d: 100Mbps half-duplex mode supported\n",
- sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("mx%d: 100Mbps full-duplex mode supported\n",
- sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("mx%d: 100baseT4 mode supported\n", sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("mx%d: forcing on autoneg support for BT4\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("mx%d: autoneg supported\n", sc->mx_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void mx_setmode_mii(sc, media)
- struct mx_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->mx_autoneg) {
- printf("mx%d: canceling autoneg session\n", sc->mx_unit);
- ifp->if_timer = sc->mx_autoneg = sc->mx_want_auto = 0;
- bmcr = mx_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- mx_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("mx%d: selecting MII, ", sc->mx_unit);
-
- bmcr = mx_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- mx_setcfg(sc, bmcr);
- mx_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Set speed and duplex mode on internal transceiver.
- */
-static void mx_setmode(sc, media, verbose)
- struct mx_softc *sc;
- int media;
- int verbose;
-{
- struct ifnet *ifp;
- u_int32_t mode;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->mx_autoneg) {
- printf("mx%d: canceling autoneg session\n", sc->mx_unit);
- ifp->if_timer = sc->mx_autoneg = sc->mx_want_auto = 0;
- MX_CLRBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- }
-
- if (verbose)
- printf("mx%d: selecting NWAY, ", sc->mx_unit);
-
- mode = CSR_READ_4(sc, MX_NETCFG);
-
- mode &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_PORTSEL|
- MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER|MX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- if (verbose)
- printf("100Mbps/T4, half-duplex\n");
- mode |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- if (verbose)
- printf("100Mbps, ");
- mode |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- if (verbose)
- printf("10Mbps, ");
- mode &= ~MX_NETCFG_PORTSEL;
- mode |= MX_NETCFG_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- if (verbose)
- printf("full duplex\n");
- mode |= MX_NETCFG_FULLDUPLEX;
- } else {
- if (verbose)
- printf("half duplex\n");
- mode &= ~MX_NETCFG_FULLDUPLEX;
- }
-
- CSR_WRITE_4(sc, MX_NETCFG, mode);
-
- return;
-}
-
-/*
- * Programming the receiver filter on the tulip/PMAC is gross. You
- * have to construct a special setup frame and download it to the
- * chip via the transmit DMA engine. This routine is also somewhat
- * gross, as the setup frame is sent synchronously rather than putting
- * on the transmit queue. The transmitter has to be stopped, then we
- * can download the frame and wait for the 'owned' bit to clear.
- *
- * We always program the chip using 'hash perfect' mode, i.e. one perfect
- * address (our node address) and a 512-bit hash filter for multicast
- * frames. We also sneak the broadcast address into the hash filter since
- * we need that too.
- */
-void mx_setfilt(sc)
- struct mx_softc *sc;
-{
- struct mx_desc *sframe;
- u_int32_t h, *sp;
- struct ifmultiaddr *ifma;
- struct ifnet *ifp;
- int i;
-
- ifp = &sc->arpcom.ac_if;
-
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- MX_SETBIT(sc, MX_ISR, MX_ISR_TX_IDLE);
-
- sframe = &sc->mx_cdata.mx_sframe;
- sp = (u_int32_t *)&sc->mx_cdata.mx_sbuf;
- bzero((char *)sp, MX_SFRAME_LEN);
-
- sframe->mx_next = vtophys(&sc->mx_ldata->mx_tx_list[0]);
- sframe->mx_data = vtophys(&sc->mx_cdata.mx_sbuf);
- sframe->mx_ctl = MX_SFRAME_LEN | MX_TXCTL_TLINK |
- MX_TXCTL_SETUP | MX_FILTER_HASHPERF;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_PROMISC);
- else
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_RX_PROMISC);
-
- if (ifp->if_flags & IFF_ALLMULTI)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_ALLMULTI);
-
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = mx_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- if (ifp->if_flags & IFF_BROADCAST) {
- h = mx_calchash(etherbroadcastaddr);
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- sp[39] = ((u_int16_t *)sc->arpcom.ac_enaddr)[0];
- sp[40] = ((u_int16_t *)sc->arpcom.ac_enaddr)[1];
- sp[41] = ((u_int16_t *)sc->arpcom.ac_enaddr)[2];
-
- CSR_WRITE_4(sc, MX_TXADDR, vtophys(sframe));
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- sframe->mx_status = MX_TXSTAT_OWN;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
-
- /*
- * Wait for chip to clear the 'own' bit.
- */
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (sframe->mx_status != MX_TXSTAT_OWN)
- break;
- }
-
- if (i == MX_TIMEOUT)
- printf("mx%d: failed to send setup frame\n", sc->mx_unit);
-
- MX_SETBIT(sc, MX_ISR, MX_ISR_TX_NOBUF|MX_ISR_TX_IDLE);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void mx_setcfg(sc, bmcr)
- struct mx_softc *sc;
- u_int16_t bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, MX_NETCFG) & (MX_NETCFG_TX_ON|MX_NETCFG_RX_ON)) {
- restart = 1;
- MX_CLRBIT(sc, MX_NETCFG, (MX_NETCFG_TX_ON|MX_NETCFG_RX_ON));
-
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (CSR_READ_4(sc, MX_ISR) & MX_ISR_TX_IDLE)
- break;
- }
-
- if (i == MX_TIMEOUT)
- printf("mx%d: failed to force tx and "
- "rx to idle state\n", sc->mx_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL) {
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
- if (sc->mx_phy_addr == 0) {
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL|
- MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER);
- }
- } else
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- else
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
-
- if (restart)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON|MX_NETCFG_RX_ON);
-
- return;
-}
-
-static void mx_reset(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- MX_SETBIT(sc, MX_BUSCTL, MX_BUSCTL_RESET);
-
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, MX_BUSCTL) & MX_BUSCTL_RESET))
- break;
- }
- if (i == MX_TIMEOUT)
- printf("mx%d: reset never completed!\n", sc->mx_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for a Macronix PMAC chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- * We do a little bit of extra work to identify the exact type of
- * chip. The MX98713 and MX98713A have the same PCI vendor/device ID,
- * but different revision IDs. The same is true for 98715/98715A
- * chips and the 98725. This doesn't affect a whole lot, but it
- * lets us tell the user exactly what type of device they have
- * in the probe output.
- */
-static const char *
-mx_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct mx_type *t;
- u_int32_t rev;
-
- t = mx_devs;
-
- while(t->mx_name != NULL) {
- if ((device_id & 0xFFFF) == t->mx_vid &&
- ((device_id >> 16) & 0xFFFF) == t->mx_did) {
- /* Check the PCI revision */
- rev = pci_conf_read(config_id, MX_PCI_REVID) & 0xFF;
- if (t->mx_did == MX_DEVICEID_98713 &&
- rev >= MX_REVISION_98713A)
- t++;
- if (t->mx_did == MX_DEVICEID_987x5 &&
- rev >= MX_REVISION_98725)
- t++;
- return(t->mx_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-mx_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef MX_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct mx_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct mx_type *p;
- u_int16_t phy_vid, phy_did, phy_sts, mac_offset = 0;
- u_int32_t revision, pci_id;
-
- s = splimp();
-
- sc = malloc(sizeof(struct mx_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("mx%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct mx_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, MX_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, MX_PCI_PWRMGMTCTRL);
- if (command & MX_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, MX_PCI_LOIO);
- membase = pci_conf_read(config_id, MX_PCI_LOMEM);
- irq = pci_conf_read(config_id, MX_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("mx%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & MX_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, MX_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, MX_PCI_LOIO, iobase);
- pci_conf_write(config_id, MX_PCI_LOMEM, membase);
- pci_conf_write(config_id, MX_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef MX_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("mx%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, MX_PCI_LOIO,
- (u_short *)&(sc->mx_bhandle))) {
- printf ("mx%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->mx_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("mx%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, MX_PCI_LOMEM, &vbase, &pbase)) {
- printf ("mx%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->mx_btag = I386_BUS_SPACE_MEM;
- sc->mx_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, mx_intr, sc, &net_imask)) {
- printf("mx%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Need this info to decide on a chip type. */
- revision = pci_conf_read(config_id, MX_PCI_REVID) & 0x000000FF;
- pci_id = pci_conf_read(config_id, MX_PCI_VENDOR_ID) & 0x0000FFFF;
- pci_id = (pci_conf_read(config_id,MX_PCI_VENDOR_ID) >> 16) & 0x0000FFFF;
-
- if (pci_id == MX_DEVICEID_98713 && revision < MX_REVISION_98713A)
- sc->mx_type = MX_TYPE_98713;
- else if (pci_id == MX_DEVICEID_98713 && revision >= MX_REVISION_98713A)
- sc->mx_type = MX_TYPE_98713A;
- else
- sc->mx_type = MX_TYPE_987x5;
-
- /* Reset the adapter. */
- mx_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- mx_read_eeprom(sc, (caddr_t)&mac_offset,
- (MX_EE_NODEADDR_OFFSET / 2), 1, 0);
- mx_read_eeprom(sc, (caddr_t)&eaddr, (mac_offset / 2), 3, 0);
-
- /*
- * A PMAC chip was detected. Inform the world.
- */
- printf("mx%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->mx_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->mx_ldata_ptr = malloc(sizeof(struct mx_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->mx_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("mx%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->mx_ldata = (struct mx_list_data *)sc->mx_ldata_ptr;
- round = (unsigned int)sc->mx_ldata_ptr & 0xF;
- roundptr = sc->mx_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- }
- break;
- }
- sc->mx_ldata = (struct mx_list_data *)roundptr;
- bzero(sc->mx_ldata, sizeof(struct mx_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "mx";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = mx_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = mx_start;
- ifp->if_watchdog = mx_watchdog;
- ifp->if_init = mx_init;
- ifp->if_baudrate = 10000000;
-
-
- if (sc->mx_type == MX_TYPE_98713) {
- if (bootverbose)
- printf("mx%d: probing for a PHY\n", sc->mx_unit);
- for (i = MX_PHYADDR_MIN; i < MX_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("mx%d: checking address: %d\n",
- sc->mx_unit, i);
- sc->mx_phy_addr = i;
- mx_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(mx_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = mx_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = mx_phy_readreg(sc, PHY_VENID);
- phy_did = mx_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("mx%d: found PHY at address %d, ",
- sc->mx_unit, sc->mx_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = mx_phys;
- while(p->mx_vid) {
- if (phy_vid == p->mx_vid &&
- (phy_did | 0x000F) == p->mx_did) {
- sc->mx_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->mx_pinfo == NULL)
- sc->mx_pinfo = &mx_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("mx%d: PHY type: %s\n",
- sc->mx_unit, sc->mx_pinfo->mx_name);
- } else {
-#ifdef DIAGNOSTIC
- printf("mx%d: MII without any phy!\n", sc->mx_unit);
-#endif
- }
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, mx_ifmedia_upd, mx_ifmedia_sts);
-
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL) {
- mx_getmode_mii(sc);
- mx_autoneg_mii(sc, MX_FLAG_FORCEDELAY, 1);
- } else {
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- mx_autoneg(sc, MX_FLAG_FORCEDELAY, 1);
- }
-
- media = sc->ifmedia.ifm_media;
- mx_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(mx_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int mx_list_tx_init(sc)
- struct mx_softc *sc;
-{
- struct mx_chain_data *cd;
- struct mx_list_data *ld;
- int i;
-
- cd = &sc->mx_cdata;
- ld = sc->mx_ldata;
- for (i = 0; i < MX_TX_LIST_CNT; i++) {
- cd->mx_tx_chain[i].mx_ptr = &ld->mx_tx_list[i];
- if (i == (MX_TX_LIST_CNT - 1))
- cd->mx_tx_chain[i].mx_nextdesc =
- &cd->mx_tx_chain[0];
- else
- cd->mx_tx_chain[i].mx_nextdesc =
- &cd->mx_tx_chain[i + 1];
- }
-
- cd->mx_tx_free = &cd->mx_tx_chain[0];
- cd->mx_tx_tail = cd->mx_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int mx_list_rx_init(sc)
- struct mx_softc *sc;
-{
- struct mx_chain_data *cd;
- struct mx_list_data *ld;
- int i;
-
- cd = &sc->mx_cdata;
- ld = sc->mx_ldata;
-
- for (i = 0; i < MX_RX_LIST_CNT; i++) {
- cd->mx_rx_chain[i].mx_ptr =
- (struct mx_desc *)&ld->mx_rx_list[i];
- if (mx_newbuf(sc, &cd->mx_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (MX_RX_LIST_CNT - 1)) {
- cd->mx_rx_chain[i].mx_nextdesc = &cd->mx_rx_chain[0];
- ld->mx_rx_list[i].mx_next =
- vtophys(&ld->mx_rx_list[0]);
- } else {
- cd->mx_rx_chain[i].mx_nextdesc = &cd->mx_rx_chain[i + 1];
- ld->mx_rx_list[i].mx_next =
- vtophys(&ld->mx_rx_list[i + 1]);
- }
- }
-
- cd->mx_rx_head = &cd->mx_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int mx_newbuf(sc, c)
- struct mx_softc *sc;
- struct mx_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("mx%d: no memory for rx list -- packet dropped!\n",
- sc->mx_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("mx%d: no memory for rx list -- packet dropped!\n",
- sc->mx_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->mx_mbuf = m_new;
- c->mx_ptr->mx_status = MX_RXSTAT;
- c->mx_ptr->mx_data = vtophys(mtod(m_new, caddr_t));
- c->mx_ptr->mx_ctl = MX_RXCTL_RLINK | (MCLBYTES - 1);
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void mx_rxeof(sc)
- struct mx_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct mx_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->mx_cdata.mx_rx_head->mx_ptr->mx_status) &
- MX_RXSTAT_OWN)) {
- cur_rx = sc->mx_cdata.mx_rx_head;
- sc->mx_cdata.mx_rx_head = cur_rx->mx_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & MX_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & MX_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->mx_ptr->mx_status = MX_RXSTAT;
- cur_rx->mx_ptr->mx_ctl =
- MX_RXCTL_RLINK | (MCLBYTES - 1);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->mx_mbuf;
- total_len = MX_RXBYTES(cur_rx->mx_ptr->mx_status);
-
- /*
- * XXX The Macronix chips includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (mx_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->mx_ptr->mx_status = MX_RXSTAT;
- cur_rx->mx_ptr->mx_ctl =
- MX_RXCTL_RLINK | (MCLBYTES - 1);
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void mx_rxeoc(sc)
- struct mx_softc *sc;
-{
-
- mx_rxeof(sc);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXADDR, vtophys(sc->mx_cdata.mx_rx_head->mx_ptr));
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void mx_txeof(sc)
- struct mx_softc *sc;
-{
- struct mx_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->mx_cdata.mx_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->mx_cdata.mx_tx_head->mx_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->mx_cdata.mx_tx_head;
- txstat = MX_TXSTATUS(cur_tx);
-
- if ((txstat & MX_TXSTAT_OWN) || txstat == MX_UNSENT)
- break;
-
- if (txstat & MX_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & MX_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & MX_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & MX_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->mx_mbuf);
- cur_tx->mx_mbuf = NULL;
-
- if (sc->mx_cdata.mx_tx_head == sc->mx_cdata.mx_tx_tail) {
- sc->mx_cdata.mx_tx_head = NULL;
- sc->mx_cdata.mx_tx_tail = NULL;
- break;
- }
-
- sc->mx_cdata.mx_tx_head = cur_tx->mx_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void mx_txeoc(sc)
- struct mx_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->mx_cdata.mx_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->mx_cdata.mx_tx_tail = NULL;
- if (sc->mx_want_auto) {
- if (sc->mx_type == MX_TYPE_98713 &&
- sc->mx_pinfo != NULL)
- mx_autoneg_mii(sc, MX_FLAG_DELAYTIMEO, 1);
- else
- mx_autoneg(sc, MX_FLAG_DELAYTIMEO, 1);
- }
- } else {
- if (MX_TXOWN(sc->mx_cdata.mx_tx_head) == MX_UNSENT) {
- MX_TXOWN(sc->mx_cdata.mx_tx_head) = MX_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void mx_intr(arg)
- void *arg;
-{
- struct mx_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts */
- if (!(ifp->if_flags & IFF_UP)) {
- mx_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, MX_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, MX_ISR);
- if (status)
- CSR_WRITE_4(sc, MX_ISR, status);
-
- if ((status & MX_INTRS) == 0)
- break;
-
- if (status & MX_ISR_TX_OK)
- mx_txeof(sc);
-
- if (status & MX_ISR_TX_NOBUF)
- mx_txeoc(sc);
-
- if (status & MX_ISR_TX_IDLE) {
- mx_txeof(sc);
- if (sc->mx_cdata.mx_tx_head != NULL) {
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & MX_ISR_TX_UNDERRUN) {
- u_int32_t cfg;
- cfg = CSR_READ_4(sc, MX_NETCFG);
- if ((cfg & MX_NETCFG_TX_THRESH) == MX_TXTHRESH_160BYTES)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_STORENFWD);
- else
- CSR_WRITE_4(sc, MX_NETCFG, cfg + 0x4000);
- }
-
- if (status & MX_ISR_RX_OK)
- mx_rxeof(sc);
-
- if ((status & MX_ISR_RX_WATDOGTIMEO)
- || (status & MX_ISR_RX_NOBUF))
- mx_rxeoc(sc);
-
- if (status & MX_ISR_BUS_ERR) {
- mx_reset(sc);
- mx_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, MX_IMR, MX_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- mx_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int mx_encap(sc, c, m_head)
- struct mx_softc *sc;
- struct mx_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- volatile struct mx_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == MX_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->mx_ptr->mx_frag[frag];
- f->mx_ctl = MX_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->mx_status = 0;
- f->mx_ctl |= MX_TXCTL_FIRSTFRAG;
- } else
- f->mx_status = MX_TXSTAT_OWN;
- f->mx_next = vtophys(&c->mx_ptr->mx_frag[frag + 1]);
- f->mx_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we ran out of fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("mx%d: no memory for tx list", sc->mx_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("mx%d: no memory for tx list",
- sc->mx_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->mx_ptr->mx_frag[0];
- f->mx_status = 0;
- f->mx_data = vtophys(mtod(m_new, caddr_t));
- f->mx_ctl = total_len = m_new->m_len;
- f->mx_ctl |= MX_TXCTL_TLINK|MX_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
-
- if (total_len < MX_MIN_FRAMELEN) {
- f = &c->mx_ptr->mx_frag[frag];
- f->mx_ctl = MX_MIN_FRAMELEN - total_len;
- f->mx_data = vtophys(&sc->mx_cdata.mx_pad);
- f->mx_ctl |= MX_TXCTL_TLINK;
- f->mx_status = MX_TXSTAT_OWN;
- frag++;
- }
-
- c->mx_mbuf = m_head;
- c->mx_lastdesc = frag - 1;
- MX_TXCTL(c) |= MX_TXCTL_LASTFRAG;
- MX_TXNEXT(c) = vtophys(&c->mx_nextdesc->mx_ptr->mx_frag[0]);
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void mx_start(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
- struct mbuf *m_head = NULL;
- struct mx_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->mx_autoneg) {
- sc->mx_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->mx_cdata.mx_tx_free->mx_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->mx_cdata.mx_tx_free;
-
- while(sc->mx_cdata.mx_tx_free->mx_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->mx_cdata.mx_tx_free;
- sc->mx_cdata.mx_tx_free = cur_tx->mx_nextdesc;
-
- /* Pack the data into the descriptor. */
- mx_encap(sc, cur_tx, m_head);
- if (cur_tx != start_tx)
- MX_TXOWN(cur_tx) = MX_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->mx_mbuf);
-#endif
- }
-
- /*
- * If there are no frames queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- MX_TXCTL(cur_tx) |= MX_TXCTL_FINT;
- sc->mx_cdata.mx_tx_tail = cur_tx;
-
- if (sc->mx_cdata.mx_tx_head == NULL) {
- sc->mx_cdata.mx_tx_head = start_tx;
- MX_TXOWN(start_tx) = MX_TXSTAT_OWN;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- } else {
- MX_TXOWN(start_tx) = MX_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void mx_init(xsc)
- void *xsc;
-{
- struct mx_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->mx_autoneg)
- return;
-
- s = splimp();
-
- if (sc->mx_pinfo != NULL)
- phy_bmcr = mx_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- mx_stop(sc);
- mx_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, MX_BUSCTL, MX_BUSCTL_CONFIG);
-
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_NO_RXCRC);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_HEARTBEAT);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_STORENFWD);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_BACKOFF);
-
- /*
- * The app notes for the 98713 and 98715A say that
- * in order to have the chips operate properly, a magic
- * number must be written to CSR16. Macronix does not
- * document the meaning of these bits so there's no way
- * to know exactly what they mean. The 98713 has a magic
- * number all its own; the rest all use a different one.
- */
- MX_CLRBIT(sc, MX_MAGICPACKET, 0xFFFF0000);
- if (sc->mx_type == MX_TYPE_98713)
- MX_SETBIT(sc, MX_MAGICPACKET, MX_MAGIC_98713);
- else
- MX_SETBIT(sc, MX_MAGICPACKET, MX_MAGIC_98715);
-
- if (sc->mx_pinfo != NULL) {
- MX_SETBIT(sc, MX_WATCHDOG, MX_WDOG_JABBERDIS);
- mx_setcfg(sc, mx_phy_readreg(sc, PHY_BMCR));
- } else
- mx_setmode(sc, sc->ifmedia.ifm_media, 0);
-
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_THRESH);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(sc->ifmedia.ifm_media) == IFM_10_T)
- MX_SETBIT(sc, MX_NETCFG, MX_TXTHRESH_160BYTES);
- else
- MX_SETBIT(sc, MX_NETCFG, MX_TXTHRESH_72BYTES);
-
- /* Init circular RX list. */
- if (mx_list_rx_init(sc) == ENOBUFS) {
- printf("mx%d: initialization failed: no "
- "memory for rx buffers\n", sc->mx_unit);
- mx_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- mx_list_tx_init(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, MX_RXADDR, vtophys(sc->mx_cdata.mx_rx_head->mx_ptr));
-
- /*
- * Load the RX/multicast filter.
- */
- mx_setfilt(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, MX_IMR, MX_INTRS);
- CSR_WRITE_4(sc, MX_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON|MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->mx_pinfo != NULL)
- mx_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int mx_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL) {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- mx_autoneg_mii(sc, MX_FLAG_SCHEDDELAY, 1);
- else
- mx_setmode_mii(sc, ifm->ifm_media);
- } else {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- mx_autoneg(sc, MX_FLAG_SCHEDDELAY, 1);
- else
- mx_setmode(sc, ifm->ifm_media, 1);
- }
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void mx_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct mx_softc *sc;
- u_int16_t advert = 0, ability = 0;
- u_int32_t media = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (sc->mx_type != MX_TYPE_98713 || sc->mx_pinfo == NULL) {
- media = CSR_READ_4(sc, MX_NETCFG);
- if (media & MX_NETCFG_PORTSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (media & MX_NETCFG_FULLDUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- if (!(mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = mx_phy_readreg(sc, PHY_LPAR);
- advert = mx_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int mx_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct mx_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- mx_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- mx_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- mx_init(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void mx_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->mx_autoneg) {
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL)
- mx_autoneg_mii(sc, MX_FLAG_DELAYTIMEO, 1);
- else
- mx_autoneg(sc, MX_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("mx%d: watchdog timeout\n", sc->mx_unit);
-
- if (sc->mx_pinfo == NULL) {
- if (!(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS10) ||
- !(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS100))
- printf("mx%d: no carrier - transceiver "
- "cable problem?\n", sc->mx_unit);
- } else {
- if (!(mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("mx%d: no carrier - transceiver "
- "cable problem?\n", sc->mx_unit);
- }
-
- mx_stop(sc);
- mx_reset(sc);
- mx_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- mx_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void mx_stop(sc)
- struct mx_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- MX_CLRBIT(sc, MX_NETCFG, (MX_NETCFG_RX_ON|MX_NETCFG_TX_ON));
- CSR_WRITE_4(sc, MX_IMR, 0x00000000);
- CSR_WRITE_4(sc, MX_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, MX_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < MX_RX_LIST_CNT; i++) {
- if (sc->mx_cdata.mx_rx_chain[i].mx_mbuf != NULL) {
- m_freem(sc->mx_cdata.mx_rx_chain[i].mx_mbuf);
- sc->mx_cdata.mx_rx_chain[i].mx_mbuf = NULL;
- }
- }
- bzero((char *)&sc->mx_ldata->mx_rx_list,
- sizeof(sc->mx_ldata->mx_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < MX_TX_LIST_CNT; i++) {
- if (sc->mx_cdata.mx_tx_chain[i].mx_mbuf != NULL) {
- m_freem(sc->mx_cdata.mx_tx_chain[i].mx_mbuf);
- sc->mx_cdata.mx_tx_chain[i].mx_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->mx_ldata->mx_tx_list,
- sizeof(sc->mx_ldata->mx_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void mx_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct mx_softc *sc = (struct mx_softc *)arg;
-
- mx_stop(sc);
-
- return;
-}
-
-static struct pci_device mx_device = {
- "mx",
- mx_probe,
- mx_attach,
- &mx_count,
- NULL
-};
-DATA_SET(pcidevice_set, mx_device);
diff --git a/sys/pci/if_mxreg.h b/sys/pci/if_mxreg.h
deleted file mode 100644
index 8a6d0a85fe01..000000000000
--- a/sys/pci/if_mxreg.h
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_mxreg.h,v 1.12 1998/12/04 21:34:33 wpaul Exp $
- */
-
-/*
- * Macronix register definitions.
- */
-
-#define MX_BUSCTL 0x00 /* bus control */
-#define MX_TXSTART 0x08 /* tx start demand */
-#define MX_RXSTART 0x10 /* rx start demand */
-#define MX_RXADDR 0x18 /* rx descriptor list start addr */
-#define MX_TXADDR 0x20 /* tx descriptor list start addr */
-#define MX_ISR 0x28 /* interrupt status register */
-#define MX_NETCFG 0x30 /* network config register */
-#define MX_IMR 0x38 /* interrupt mask */
-#define MX_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define MX_SIO 0x48 /* MII and ROM/EEPROM access */
-#define MX_RESERVED 0x50
-#define MX_TIMER 0x58 /* general timer */
-#define MX_10BTSTAT 0x60
-#define MX_SIARESET 0x68
-#define MX_10BTCTRL 0x70
-#define MX_WATCHDOG 0x78
-#define MX_MAGICPACKET 0x80
-#define MX_NWAYSTAT 0xA0
-
-/*
- * These are magic values that must be written into CSR16
- * (MX_MAGICPACKET) in order to put the chip into proper
- * operating mode. The magic numbers are documented in the
- * Macronix 98715 application notes.
- */
-#define MX_MAGIC_98713 0x0F370000
-#define MX_MAGIC_98713A 0x0B3C0000
-#define MX_MAGIC_98715 0x0B3C0000
-#define MX_MAGIC_98725 0x0B3C0000
-
-#define MX_REVISION_98713 0x00
-#define MX_REVISION_98713A 0x10
-#define MX_REVISION_98715 0x20
-#define MX_REVISION_98725 0x30
-
-/*
- * As far as the driver is concerned, there are two 'types' of
- * chips to be concerned with. One is a 98713 with an external
- * PHY on the MII. The other covers pretty much everything else,
- * since all the other Macronix chips have built-in transceivers.
- * This type setting governs what which mode selection routines
- * we use (MII or built-in). It also govers which of the 'magic'
- * numbers we write into CSR16.
- */
-#define MX_TYPE_98713 0x1
-#define MX_TYPE_98713A 0x2
-#define MX_TYPE_987x5 0x3
-
-/*
- * Bus control bits.
- */
-#define MX_BUSCTL_RESET 0x00000001
-#define MX_BUSCTL_ARBITRATION 0x00000002
-#define MX_BUSCTL_SKIPLEN 0x0000007C
-#define MX_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define MX_BUSCTL_BURSTLEN 0x00003F00
-#define MX_BUSCTL_CACHEALIGN 0x0000C000
-#define MX_BUSCTL_XMITPOLL 0x00060000
-
-#define MX_SKIPLEN_1LONG 0x00000004
-#define MX_SKIPLEN_2LONG 0x00000008
-#define MX_SKIPLEN_3LONG 0x00000010
-#define MX_SKIPLEN_4LONG 0x00000020
-#define MX_SKIPLEN_5LONG 0x00000040
-
-#define MX_CACHEALIGN_8LONG 0x00004000
-#define MX_CACHEALIGN_16LONG 0x00008000
-#define MX_CACHEALIGN_32LONG 0x0000C000
-
-#define MX_BURSTLEN_USECA 0x00000000
-#define MX_BURSTLEN_1LONG 0x00000100
-#define MX_BURSTLEN_2LONG 0x00000200
-#define MX_BURSTLEN_4LONG 0x00000400
-#define MX_BURSTLEN_8LONG 0x00000800
-#define MX_BURSTLEN_16LONG 0x00001000
-#define MX_BURSTLEN_32LONG 0x00002000
-
-#define MX_TXPOLL_OFF 0x00000000
-#define MX_TXPOLL_200U 0x00020000
-#define MX_TXPOLL_800U 0x00040000
-#define MX_TXPOLL_1600U 0x00060000
-
-#define MX_BUSCTL_CONFIG (MX_BUSCTL_ARBITRATION|MX_CACHEALIGN_8LONG| \
- MX_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define MX_ISR_TX_OK 0x00000001
-#define MX_ISR_TX_IDLE 0x00000002
-#define MX_ISR_TX_NOBUF 0x00000004
-#define MX_ISR_TX_JABBERTIMEO 0x00000008
-#define MX_ISR_LINKGOOD 0x00000010
-#define MX_ISR_TX_UNDERRUN 0x00000020
-#define MX_ISR_RX_OK 0x00000040
-#define MX_ISR_RX_NOBUF 0x00000080
-#define MX_ISR_RX_READ 0x00000100
-#define MX_ISR_RX_WATDOGTIMEO 0x00000200
-#define MX_ISR_TX_EARLY 0x00000400
-#define MX_ISR_TIMER_EXPIRED 0x00000800
-#define MX_ISR_LINKFAIL 0x00001000
-#define MX_ISR_BUS_ERR 0x00002000
-#define MX_ISR_RX_EARLY 0x00004000
-#define MX_ISR_ABNORMAL 0x00008000
-#define MX_ISR_NORMAL 0x00010000
-#define MX_ISR_RX_STATE 0x000E0000
-#define MX_ISR_TX_STATE 0x00700000
-#define MX_ISR_BUSERRTYPE 0x03800000
-#define MX_ISR_100MBPSLINK 0x08000000
-#define MX_ISR_MAGICKPACK 0x10000000
-
-#define MX_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define MX_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define MX_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define MX_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define MX_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define MX_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define MX_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define MX_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define MX_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define MX_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define MX_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define MX_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define MX_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define MX_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define MX_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define MX_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define MX_NETCFG_RX_HASHPERF 0x00000001
-#define MX_NETCFG_RX_ON 0x00000002
-#define MX_NETCFG_RX_HASHONLY 0x00000004
-#define MX_NETCFG_RX_BADFRAMES 0x00000008
-#define MX_NETCFG_RX_INVFILT 0x00000010
-#define MX_NETCFG_BACKOFFCNT 0x00000020
-#define MX_NETCFG_RX_PROMISC 0x00000040
-#define MX_NETCFG_RX_ALLMULTI 0x00000080
-#define MX_NETCFG_FULLDUPLEX 0x00000200
-#define MX_NETCFG_LOOPBACK 0x00000C00
-#define MX_NETCFG_FORCECOLL 0x00001000
-#define MX_NETCFG_TX_ON 0x00002000
-#define MX_NETCFG_TX_THRESH 0x0000C000
-#define MX_NETCFG_TX_BACKOFF 0x00020000
-#define MX_NETCFG_PORTSEL 0x00040000 /* 0 == 10, 1 == 100 */
-#define MX_NETCFG_HEARTBEAT 0x00080000
-#define MX_NETCFG_STORENFWD 0x00200000
-#define MX_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */
-#define MX_NETCFG_PCS 0x00800000
-#define MX_NETCFG_SCRAMBLER 0x01000000
-#define MX_NETCFG_NO_RXCRC 0x02000000
-
-#define MX_OPMODE_NORM 0x00000000
-#define MX_OPMODE_INTLOOP 0x00000400
-#define MX_OPMODE_EXTLOOP 0x00000800
-
-#define MX_TXTHRESH_72BYTES 0x00000000
-#define MX_TXTHRESH_96BYTES 0x00004000
-#define MX_TXTHRESH_128BYTES 0x00008000
-#define MX_TXTHRESH_160BYTES 0x0000C000
-
-
-/*
- * Interrupt mask bits.
- */
-#define MX_IMR_TX_OK 0x00000001
-#define MX_IMR_TX_IDLE 0x00000002
-#define MX_IMR_TX_NOBUF 0x00000004
-#define MX_IMR_TX_JABBERTIMEO 0x00000008
-#define MX_IMR_LINKGOOD 0x00000010
-#define MX_IMR_TX_UNDERRUN 0x00000020
-#define MX_IMR_RX_OK 0x00000040
-#define MX_IMR_RX_NOBUF 0x00000080
-#define MX_IMR_RX_READ 0x00000100
-#define MX_IMR_RX_WATDOGTIMEO 0x00000200
-#define MX_IMR_TX_EARLY 0x00000400
-#define MX_IMR_TIMER_EXPIRED 0x00000800
-#define MX_IMR_LINKFAIL 0x00001000
-#define MX_IMR_BUS_ERR 0x00002000
-#define MX_IMR_RX_EARLY 0x00004000
-#define MX_IMR_ABNORMAL 0x00008000
-#define MX_IMR_NORMAL 0x00010000
-#define MX_IMR_100MBPSLINK 0x08000000
-#define MX_IMR_MAGICKPACK 0x10000000
-
-#define MX_INTRS \
- (MX_IMR_RX_OK|MX_IMR_TX_OK|MX_IMR_RX_NOBUF|MX_IMR_RX_WATDOGTIMEO|\
- MX_IMR_TX_NOBUF|MX_IMR_TX_UNDERRUN|MX_IMR_BUS_ERR| \
- MX_IMR_ABNORMAL|MX_IMR_NORMAL/*|MX_IMR_TX_EARLY*/)
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define MX_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define MX_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define MX_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define MX_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define MX_SIO_ROMDATA4 0x00000010
-#define MX_SIO_ROMDATA5 0x00000020
-#define MX_SIO_ROMDATA6 0x00000040
-#define MX_SIO_ROMDATA7 0x00000080
-#define MX_SIO_EESEL 0x00000800
-#define MX_SIO_ROMSEL 0x00001000
-#define MX_SIO_ROMCTL_WRITE 0x00002000
-#define MX_SIO_ROMCTL_READ 0x00004000
-#define MX_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define MX_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */
-#define MX_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define MX_SIO_MII_DATAIN 0x00080000 /* MDIO data in */
-
-#define MX_EECMD_WRITE 0x140
-#define MX_EECMD_READ 0x180
-#define MX_EECMD_ERASE 0x1c0
-
-#define MX_EE_NODEADDR_OFFSET 0x70
-#define MX_EE_NODEADDR 10
-
-/*
- * General purpose timer register
- */
-#define MX_TIMER_VALUE 0x0000FFFF
-#define MX_TIMER_CONTINUUS 0x00010000
-
-/*
- * 10baseT status register
- */
-#define MX_TSTAT_LS100 0x00000002 /* link status of 100baseTX */
-#define MX_TSTAT_LS10 0x00000004 /* link status of 10baseT */
-#define MX_TSTAT_AUTOPOLARITY 0x00000008
-#define MX_TSTAT_REMFAULT 0x00000800
-#define MX_TSTAT_ANEGSTAT 0x00007000
-#define MX_TSTAT_LP_CAN_NWAY 0x00008000 /* link partner supports NWAY */
-#define MX_TSTAT_LPCODEWORD 0xFFFF0000 /* link partner's code word */
-
-#define MX_ASTAT_DISABLE 0x00000000
-#define MX_ASTAT_TXDISABLE 0x00001000
-#define MX_ASTAT_ABDETECT 0x00002000
-#define MX_ASTAT_ACKDETECT 0x00003000
-#define MX_ASTAT_CMPACKDETECT 0x00004000
-#define MX_ASTAT_AUTONEGCMP 0x00005000
-#define MX_ASTAT_LINKCHECK 0x00006000
-
-/*
- * PHY reset register
- */
-#define MX_SIA_RESET_NWAY 0x00000001
-#define MX_SIA_RESET_100TX 0x00000002
-
-/*
- * 10baseT control register
- */
-#define MX_TCTL_LOOPBACK 0x00000002
-#define MX_TCTL_POWERDOWN 0x00000004
-#define MX_TCTL_HALFDUPLEX 0x00000040
-#define MX_TCTL_AUTONEGENBL 0x00000080
-#define MX_TCTL_RX_SQUELCH 0x00000100
-#define MX_TCTL_LINKTEST 0x00001000
-#define MX_TCTL_100BTXHALF 0x00010000
-#define MX_TCTL_100BTXFULL 0x00020000
-#define MX_TCTL_100BT4 0x00040000
-
-/*
- * Watchdog timer register
- */
-#define MX_WDOG_JABBERDIS 0x00000001
-#define MX_WDOG_HOSTUNJAB 0x00000002
-#define MX_WDOG_JABBERCLK 0x00000004
-#define MX_WDOG_RXWDOGDIS 0x00000010
-#define MX_WDOG_RXWDOGCLK 0x00000020
-#define MX_WDOG_MUSTBEZERO 0x00000100
-
-/*
- * Magic packet register
- */
-#define MX_MPACK_DISABLE 0x00400000
-
-/*
- * NWAY status register.
- */
-#define MX_NWAY_10BTHALF 0x08000000
-#define MX_NWAY_10BTFULL 0x10000000
-#define MX_NWAY_100BTHALF 0x20000000
-#define MX_NWAY_100BTFULL 0x40000000
-#define MX_NWAY_100BT4 0x80000000
-
-/*
- * Size of a setup frame.
- */
-#define MX_SFRAME_LEN 192
-
-/*
- * Macronix TX/RX list structure.
- */
-
-struct mx_desc {
- volatile u_int32_t mx_status;
- volatile u_int32_t mx_ctl;
- volatile u_int32_t mx_ptr1;
- volatile u_int32_t mx_ptr2;
-};
-
-#define mx_data mx_ptr1
-#define mx_next mx_ptr2
-
-#define MX_RXSTAT_FIFOOFLOW 0x00000001
-#define MX_RXSTAT_CRCERR 0x00000002
-#define MX_RXSTAT_DRIBBLE 0x00000004
-#define MX_RXSTAT_WATCHDOG 0x00000010
-#define MX_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define MX_RXSTAT_COLLSEEN 0x00000040
-#define MX_RXSTAT_GIANT 0x00000080
-#define MX_RXSTAT_LASTFRAG 0x00000100
-#define MX_RXSTAT_FIRSTFRAG 0x00000200
-#define MX_RXSTAT_MULTICAST 0x00000400
-#define MX_RXSTAT_RUNT 0x00000800
-#define MX_RXSTAT_RXTYPE 0x00003000
-#define MX_RXSTAT_RXERR 0x00008000
-#define MX_RXSTAT_RXLEN 0x3FFF0000
-#define MX_RXSTAT_OWN 0x80000000
-
-#define MX_RXBYTES(x) ((x & MX_RXSTAT_RXLEN) >> 16)
-#define MX_RXSTAT (MX_RXSTAT_FIRSTFRAG|MX_RXSTAT_LASTFRAG|MX_RXSTAT_OWN)
-
-#define MX_RXCTL_BUFLEN1 0x00000FFF
-#define MX_RXCTL_BUFLEN2 0x00FFF000
-#define MX_RXCTL_RLINK 0x01000000
-#define MX_RXCTL_RLAST 0x02000000
-
-#define MX_TXSTAT_DEFER 0x00000001
-#define MX_TXSTAT_UNDERRUN 0x00000002
-#define MX_TXSTAT_LINKFAIl 0x00000003
-#define MX_TXSTAT_COLLCNT 0x00000078
-#define MX_TXSTAT_SQE 0x00000080
-#define MX_TXSTAT_EXCESSCOLL 0x00000100
-#define MX_TXSTAT_LATECOLL 0x00000200
-#define MX_TXSTAT_NOCARRIER 0x00000400
-#define MX_TXSTAT_CARRLOST 0x00000800
-#define MX_TXSTAT_JABTIMEO 0x00004000
-#define MX_TXSTAT_ERRSUM 0x00008000
-#define MX_TXSTAT_OWN 0x80000000
-
-#define MX_TXCTL_BUFLEN1 0x000007FF
-#define MX_TXCTL_BUFLEN2 0x003FF800
-#define MX_TXCTL_FILTTYPE0 0x00400000
-#define MX_TXCTL_PAD 0x00800000
-#define MX_TXCTL_TLINK 0x01000000
-#define MX_TXCTL_TLAST 0x02000000
-#define MX_TXCTL_NOCRC 0x04000000
-#define MX_TXCTL_SETUP 0x08000000
-#define MX_TXCTL_FILTTYPE1 0x10000000
-#define MX_TXCTL_FIRSTFRAG 0x20000000
-#define MX_TXCTL_LASTFRAG 0x40000000
-#define MX_TXCTL_FINT 0x80000000
-
-#define MX_FILTER_PERFECT 0x00000000
-#define MX_FILTER_HASHPERF 0x00400000
-#define MX_FILTER_INVERSE 0x10000000
-#define MX_FILTER_HASHONLY 0x10400000
-
-#define MX_MAXFRAGS 16
-#define MX_RX_LIST_CNT 64
-#define MX_TX_LIST_CNT 64
-#define MX_MIN_FRAMELEN 60
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct mx_txdesc {
- volatile struct mx_desc mx_frag[MX_MAXFRAGS];
-};
-
-#define MX_TXNEXT(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_next
-#define MX_TXSTATUS(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_status
-#define MX_TXCTL(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_ctl
-#define MX_TXDATA(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_data
-
-#define MX_TXOWN(x) x->mx_ptr->mx_frag[0].mx_status
-
-#define MX_UNSENT 0x12341234
-
-struct mx_list_data {
- volatile struct mx_desc mx_rx_list[MX_RX_LIST_CNT];
- volatile struct mx_txdesc mx_tx_list[MX_TX_LIST_CNT];
-};
-
-struct mx_chain {
- volatile struct mx_txdesc *mx_ptr;
- struct mbuf *mx_mbuf;
- struct mx_chain *mx_nextdesc;
- u_int8_t mx_lastdesc;
-};
-
-struct mx_chain_onefrag {
- volatile struct mx_desc *mx_ptr;
- struct mbuf *mx_mbuf;
- struct mx_chain_onefrag *mx_nextdesc;
-};
-
-struct mx_chain_data {
- struct mx_desc mx_sframe;
- u_int32_t mx_sbuf[MX_SFRAME_LEN/sizeof(u_int32_t)];
- u_int8_t mx_pad[MX_MIN_FRAMELEN];
- struct mx_chain_onefrag mx_rx_chain[MX_RX_LIST_CNT];
- struct mx_chain mx_tx_chain[MX_TX_LIST_CNT];
-
- struct mx_chain_onefrag *mx_rx_head;
-
- struct mx_chain *mx_tx_head;
- struct mx_chain *mx_tx_tail;
- struct mx_chain *mx_tx_free;
-};
-
-struct mx_type {
- u_int16_t mx_vid;
- u_int16_t mx_did;
- char *mx_name;
-};
-
-struct mx_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define MX_MII_STARTDELIM 0x01
-#define MX_MII_READOP 0x02
-#define MX_MII_WRITEOP 0x01
-#define MX_MII_TURNAROUND 0x02
-
-#define MX_FLAG_FORCEDELAY 1
-#define MX_FLAG_SCHEDDELAY 2
-#define MX_FLAG_DELAYTIMEO 3
-
-struct mx_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t mx_bhandle; /* bus space handle */
- bus_space_tag_t mx_btag; /* bus space tag */
- struct mx_type *mx_info; /* Macronix adapter info */
- struct mx_type *mx_pinfo; /* phy info */
- u_int8_t mx_unit; /* interface number */
- u_int8_t mx_type;
- u_int8_t mx_phy_addr; /* PHY address */
- u_int8_t mx_tx_pend; /* TX pending */
- u_int8_t mx_want_auto;
- u_int8_t mx_autoneg;
- u_int8_t mx_singlebuf;
- caddr_t mx_ldata_ptr;
- struct mx_list_data *mx_ldata;
- struct mx_chain_data mx_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->mx_btag, sc->mx_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->mx_btag, sc->mx_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->mx_btag, sc->mx_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->mx_btag, sc->mx_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->mx_btag, sc->mx_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->mx_btag, sc->mx_bhandle, reg)
-
-#define MX_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Macronix PCI vendor ID
- */
-#define MX_VENDORID 0x10D9
-
-/*
- * Macronix PMAC device IDs.
- */
-#define MX_DEVICEID_98713 0x0512
-#define MX_DEVICEID_987x5 0x0531
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define MX_PCI_VENDOR_ID 0x00
-#define MX_PCI_DEVICE_ID 0x02
-#define MX_PCI_COMMAND 0x04
-#define MX_PCI_STATUS 0x06
-#define MX_PCI_REVID 0x08
-#define MX_PCI_CLASSCODE 0x09
-#define MX_PCI_LATENCY_TIMER 0x0D
-#define MX_PCI_HEADER_TYPE 0x0E
-#define MX_PCI_LOIO 0x10
-#define MX_PCI_LOMEM 0x14
-#define MX_PCI_BIOSROM 0x30
-#define MX_PCI_INTLINE 0x3C
-#define MX_PCI_INTPIN 0x3D
-#define MX_PCI_MINGNT 0x3E
-#define MX_PCI_MINLAT 0x0F
-#define MX_PCI_RESETOPT 0x48
-#define MX_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define MX_PCI_CAPID 0x44 /* 8 bits */
-#define MX_PCI_NEXTPTR 0x45 /* 8 bits */
-#define MX_PCI_PWRMGMTCAP 0x46 /* 16 bits */
-#define MX_PCI_PWRMGMTCTRL 0x48 /* 16 bits */
-
-#define MX_PSTATE_MASK 0x0003
-#define MX_PSTATE_D0 0x0000
-#define MX_PSTATE_D1 0x0001
-#define MX_PSTATE_D2 0x0002
-#define MX_PSTATE_D3 0x0003
-#define MX_PME_EN 0x0010
-#define MX_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define MX_PHYADDR_MIN 0x00
-#define MX_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_pn.c b/sys/pci/if_pn.c
deleted file mode 100644
index bc413c734a33..000000000000
--- a/sys/pci/if_pn.c
+++ /dev/null
@@ -1,1986 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_pn.c,v 1.36 1999/01/05 00:47:25 wpaul Exp $
- */
-
-/*
- * 82c168/82c169 PNIC fast ethernet PCI NIC driver
- *
- * Supports various network adapters based on the Lite-On PNIC
- * PCI network controller chip including the LinkSys LNE100TX.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The PNIC chip is a DEC tulip clone. This driver uses much of the
- * same code from the driver for the Winbond chip (which is also a
- * tulip clone) except for the MII, EEPROM and filter programming.
- *
- * Technically we could merge support for this chip into the 'de'
- * driver, but it's such a mess that I'm afraid to go near it.
- *
- * The PNIC appears to support both an external MII and an internal
- * transceiver. I think most 100Mbps implementations use a PHY attached
- * the the MII. The LinkSys board that I have uses a Myson MTD972
- * 100BaseTX PHY.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define PN_USEIOSPACE
-
-/* #define PN_BACKGROUND_AUTONEG */
-
-#define PN_PROMISC_BUG_WAR
-
-#include <pci/if_pnreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_pn.c,v 1.36 1999/01/05 00:47:25 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct pn_type pn_devs[] = {
- { PN_VENDORID, PN_DEVICEID_PNIC,
- "82c168/82c169 PNIC 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct pn_type pn_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long pn_count = 0;
-static const char *pn_probe __P((pcici_t, pcidi_t));
-static void pn_attach __P((pcici_t, int));
-
-static int pn_newbuf __P((struct pn_softc *,
- struct pn_chain_onefrag *));
-static int pn_encap __P((struct pn_softc *, struct pn_chain *,
- struct mbuf *));
-
-#ifdef PN_PROMISC_BUG_WAR
-static void pn_promisc_bug_war __P((struct pn_softc *,
- struct pn_chain_onefrag *));
-#endif
-static void pn_rxeof __P((struct pn_softc *));
-static void pn_rxeoc __P((struct pn_softc *));
-static void pn_txeof __P((struct pn_softc *));
-static void pn_txeoc __P((struct pn_softc *));
-static void pn_intr __P((void *));
-static void pn_start __P((struct ifnet *));
-static int pn_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void pn_init __P((void *));
-static void pn_stop __P((struct pn_softc *));
-static void pn_watchdog __P((struct ifnet *));
-static void pn_shutdown __P((int, void *));
-static int pn_ifmedia_upd __P((struct ifnet *));
-static void pn_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void pn_eeprom_getword __P((struct pn_softc *, u_int8_t, u_int16_t *));
-static void pn_read_eeprom __P((struct pn_softc *, caddr_t, int,
- int, int));
-static u_int16_t pn_phy_readreg __P((struct pn_softc *, int));
-static void pn_phy_writereg __P((struct pn_softc *, u_int16_t, u_int16_t));
-
-static void pn_autoneg_xmit __P((struct pn_softc *));
-static void pn_autoneg_mii __P((struct pn_softc *, int, int));
-static void pn_setmode_mii __P((struct pn_softc *, int));
-static void pn_getmode_mii __P((struct pn_softc *));
-static void pn_setcfg __P((struct pn_softc *, u_int16_t));
-static u_int32_t pn_calchash __P((u_int8_t *));
-static void pn_setfilt __P((struct pn_softc *));
-static void pn_reset __P((struct pn_softc *));
-static int pn_list_rx_init __P((struct pn_softc *));
-static int pn_list_tx_init __P((struct pn_softc *));
-
-#define PN_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define PN_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void pn_eeprom_getword(sc, addr, dest)
- struct pn_softc *sc;
- u_int8_t addr;
- u_int16_t *dest;
-{
- register int i;
- u_int32_t r;
-
- CSR_WRITE_4(sc, PN_SIOCTL, PN_EE_READ|addr);
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(1);
- r = CSR_READ_4(sc, PN_SIO);
- if (!(r & PN_SIO_BUSY)) {
- *dest = (u_int16_t)(r & 0x0000FFFF);
- return;
- }
- }
-
- return;
-
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void pn_read_eeprom(sc, dest, off, cnt, swap)
- struct pn_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- pn_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-static u_int16_t pn_phy_readreg(sc, reg)
- struct pn_softc *sc;
- int reg;
-{
- int i;
- u_int32_t rval;
-
- CSR_WRITE_4(sc, PN_MII,
- PN_MII_READ | (sc->pn_phy_addr << 23) | (reg << 18));
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(1);
- rval = CSR_READ_4(sc, PN_MII);
- if (!(rval & PN_MII_BUSY)) {
- if ((u_int16_t)(rval & 0x0000FFFF) == 0xFFFF)
- return(0);
- else
- return((u_int16_t)(rval & 0x0000FFFF));
- }
- }
-
- return(0);
-}
-
-static void pn_phy_writereg(sc, reg, data)
- struct pn_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- int i;
-
- CSR_WRITE_4(sc, PN_MII,
- PN_MII_WRITE | (sc->pn_phy_addr << 23) | (reg << 18) | data);
-
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- if (!(CSR_READ_4(sc, PN_MII) & PN_MII_BUSY))
- break;
- }
-
- return;
-}
-
-#define PN_POLY 0xEDB88320
-#define PN_BITS 9
-
-static u_int32_t pn_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t idx, bit, data, crc;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (idx = 0; idx < 6; idx++) {
- for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1)
- crc = (crc >> 1) ^ (((crc ^ data) & 1) ? PN_POLY : 0);
- }
-
- return (crc & ((1 << PN_BITS) - 1));
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void pn_autoneg_xmit(sc)
- struct pn_softc *sc;
-{
- u_int16_t phy_sts;
-
- pn_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(pn_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = pn_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- pn_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void pn_autoneg_mii(sc, flag, verbose)
- struct pn_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = pn_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("pn%d: autonegotiation not supported\n",
- sc->pn_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case PN_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- pn_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case PN_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise pn_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->pn_cdata.pn_tx_head != NULL) {
- sc->pn_want_auto = 1;
- return;
- }
- pn_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->pn_autoneg = 1;
- sc->pn_want_auto = 0;
- return;
- break;
- case PN_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->pn_autoneg = 0;
- break;
- default:
- printf("pn%d: invalid autoneg flag: %d\n", sc->pn_unit, flag);
- return;
- }
-
- if (pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("pn%d: autoneg complete, ", sc->pn_unit);
- phy_sts = pn_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("pn%d: autoneg not complete, ", sc->pn_unit);
- }
-
- media = pn_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = pn_phy_readreg(sc, PHY_ANAR);
- ability = pn_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- pn_setcfg(sc, media);
- pn_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- pn_init(sc);
-
- if (sc->pn_tx_pend) {
- sc->pn_autoneg = 0;
- sc->pn_tx_pend = 0;
- pn_start(ifp);
- }
-
- return;
-}
-
-static void pn_getmode_mii(sc)
- struct pn_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = pn_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("pn%d: PHY status word: %x\n", sc->pn_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("pn%d: 10Mbps half-duplex mode supported\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("pn%d: 10Mbps full-duplex mode supported\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("pn%d: 100Mbps half-duplex mode supported\n",
- sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("pn%d: 100Mbps full-duplex mode supported\n",
- sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("pn%d: 100baseT4 mode supported\n", sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("pn%d: forcing on autoneg support for BT4\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("pn%d: autoneg supported\n", sc->pn_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void pn_setmode_mii(sc, media)
- struct pn_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->pn_autoneg) {
- printf("pn%d: canceling autoneg session\n", sc->pn_unit);
- ifp->if_timer = sc->pn_autoneg = sc->pn_want_auto = 0;
- bmcr = pn_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- pn_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("pn%d: selecting MII, ", sc->pn_unit);
-
- bmcr = pn_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- pn_setcfg(sc, bmcr);
- pn_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Programming the receiver filter on the tulip/PNIC is gross. You
- * have to construct a special setup frame and download it to the
- * chip via the transmit DMA engine. This routine is also somewhat
- * gross, as the setup frame is sent synchronously rather than putting
- * on the transmit queue. The transmitter has to be stopped, then we
- * can download the frame and wait for the 'owned' bit to clear.
- *
- * We always program the chip using 'hash perfect' mode, i.e. one perfect
- * address (our node address) and a 512-bit hash filter for multicast
- * frames. We also sneak the broadcast address into the hash filter since
- * we need that too.
- */
-void pn_setfilt(sc)
- struct pn_softc *sc;
-{
- struct pn_desc *sframe;
- u_int32_t h, *sp;
- struct ifmultiaddr *ifma;
- struct ifnet *ifp;
- int i;
-
- ifp = &sc->arpcom.ac_if;
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- PN_SETBIT(sc, PN_ISR, PN_ISR_TX_IDLE);
-
- sframe = &sc->pn_cdata.pn_sframe;
- sp = (u_int32_t *)&sc->pn_cdata.pn_sbuf;
- bzero((char *)sp, PN_SFRAME_LEN);
-
- sframe->pn_status = PN_TXSTAT_OWN;
- sframe->pn_next = vtophys(&sc->pn_ldata->pn_tx_list[0]);
- sframe->pn_data = vtophys(&sc->pn_cdata.pn_sbuf);
- sframe->pn_ctl = PN_SFRAME_LEN | PN_TXCTL_TLINK |
- PN_TXCTL_SETUP | PN_FILTER_HASHPERF;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_PROMISC);
- else
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_RX_PROMISC);
-
- if (ifp->if_flags & IFF_ALLMULTI)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_ALLMULTI);
-
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = pn_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- if (ifp->if_flags & IFF_BROADCAST) {
- h = pn_calchash(etherbroadcastaddr);
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- sp[39] = ((u_int16_t *)sc->arpcom.ac_enaddr)[0];
- sp[40] = ((u_int16_t *)sc->arpcom.ac_enaddr)[1];
- sp[41] = ((u_int16_t *)sc->arpcom.ac_enaddr)[2];
-
- CSR_WRITE_4(sc, PN_TXADDR, vtophys(sframe));
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
-
- /*
- * Wait for chip to clear the 'own' bit.
- */
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if (sframe->pn_status != PN_TXSTAT_OWN)
- break;
- }
-
- if (i == PN_TIMEOUT)
- printf("pn%d: failed to send setup frame\n", sc->pn_unit);
-
- PN_SETBIT(sc, PN_ISR, PN_ISR_TX_NOBUF|PN_ISR_TX_IDLE);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void pn_setcfg(sc, bmcr)
- struct pn_softc *sc;
- u_int16_t bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, PN_NETCFG) & (PN_NETCFG_TX_ON|PN_NETCFG_RX_ON)) {
- restart = 1;
- PN_CLRBIT(sc, PN_NETCFG, (PN_NETCFG_TX_ON|PN_NETCFG_RX_ON));
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if ((CSR_READ_4(sc, PN_ISR) & PN_ISR_TX_IDLE) &&
- (CSR_READ_4(sc, PN_ISR) & PN_ISR_RX_IDLE))
- break;
- }
-
- if (i == PN_TIMEOUT)
- printf("pn%d: failed to force tx and "
- "rx to idle state\n", sc->pn_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_SPEEDSEL);
- else
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_FULLDUPLEX);
- else
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_FULLDUPLEX);
-
- if (restart)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON|PN_NETCFG_RX_ON);
-
- return;
-}
-
-static void pn_reset(sc)
- struct pn_softc *sc;
-{
- register int i;
-
- PN_SETBIT(sc, PN_BUSCTL, PN_BUSCTL_RESET);
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, PN_BUSCTL) & PN_BUSCTL_RESET))
- break;
- }
- if (i == PN_TIMEOUT)
- printf("pn%d: reset never completed!\n", sc->pn_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for a Lite-On PNIC chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-pn_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct pn_type *t;
-
- t = pn_devs;
-
- while(t->pn_name != NULL) {
- if ((device_id & 0xFFFF) == t->pn_vid &&
- ((device_id >> 16) & 0xFFFF) == t->pn_did) {
- return(t->pn_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-pn_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef PN_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct pn_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct pn_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-#ifdef PN_PROMISC_BUG_WAR
- u_int32_t revision = 0;
-#endif
-
- s = splimp();
-
- sc = malloc(sizeof(struct pn_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("pn%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct pn_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, PN_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, PN_PCI_PWRMGMTCTRL);
- if (command & PN_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, PN_PCI_LOIO);
- membase = pci_conf_read(config_id, PN_PCI_LOMEM);
- irq = pci_conf_read(config_id, PN_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("pn%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & PN_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, PN_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, PN_PCI_LOIO, iobase);
- pci_conf_write(config_id, PN_PCI_LOMEM, membase);
- pci_conf_write(config_id, PN_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef PN_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("pn%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, PN_PCI_LOIO,
- (u_short *)&(sc->pn_bhandle))) {
- printf ("pn%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->pn_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("pn%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, PN_PCI_LOMEM, &vbase, &pbase)) {
- printf ("pn%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->pn_bhandle = vbase;
- sc->pn_btag = I386_BUS_SPACE_MEM;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, pn_intr, sc, &net_imask)) {
- printf("pn%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- pn_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- pn_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 1);
-
- /*
- * A PNIC chip was detected. Inform the world.
- */
- printf("pn%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->pn_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->pn_ldata_ptr = malloc(sizeof(struct pn_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->pn_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("pn%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- sc->pn_ldata = (struct pn_list_data *)sc->pn_ldata_ptr;
- round = (unsigned int)sc->pn_ldata_ptr & 0xF;
- roundptr = sc->pn_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->pn_ldata = (struct pn_list_data *)roundptr;
- bzero(sc->pn_ldata, sizeof(struct pn_list_data));
-
-#ifdef PN_PROMISC_BUG_WAR
- revision = pci_conf_read(config_id, PN_PCI_REVISION) & 0x000000FF;
- if (revision == PN_169B_REV || revision == PN_169_REV) {
- sc->pn_promisc_war = 1;
- sc->pn_promisc_buf = malloc(PN_RXLEN * 5, M_DEVBUF, M_NOWAIT);
- if (sc->pn_promisc_buf == NULL) {
- printf("pn%d: no memory for workaround buffer\n", unit);
- goto fail;
- }
- } else {
- sc->pn_promisc_war = 0;
- }
-#endif
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "pn";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = pn_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = pn_start;
- ifp->if_watchdog = pn_watchdog;
- ifp->if_init = pn_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("pn%d: probing for a PHY\n", sc->pn_unit);
- for (i = PN_PHYADDR_MIN; i < PN_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("pn%d: checking address: %d\n",
- sc->pn_unit, i);
- sc->pn_phy_addr = i;
- pn_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(pn_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = pn_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = pn_phy_readreg(sc, PHY_VENID);
- phy_did = pn_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("pn%d: found PHY at address %d, ",
- sc->pn_unit, sc->pn_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = pn_phys;
- while(p->pn_vid) {
- if (phy_vid == p->pn_vid &&
- (phy_did | 0x000F) == p->pn_did) {
- sc->pn_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->pn_pinfo == NULL)
- sc->pn_pinfo = &pn_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("pn%d: PHY type: %s\n",
- sc->pn_unit, sc->pn_pinfo->pn_name);
- } else {
- printf("pn%d: MII without any phy!\n", sc->pn_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, pn_ifmedia_upd, pn_ifmedia_sts);
-
- pn_getmode_mii(sc);
- pn_autoneg_mii(sc, PN_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- pn_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(pn_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int pn_list_tx_init(sc)
- struct pn_softc *sc;
-{
- struct pn_chain_data *cd;
- struct pn_list_data *ld;
- int i;
-
- cd = &sc->pn_cdata;
- ld = sc->pn_ldata;
- for (i = 0; i < PN_TX_LIST_CNT; i++) {
- cd->pn_tx_chain[i].pn_ptr = &ld->pn_tx_list[i];
- if (i == (PN_TX_LIST_CNT - 1))
- cd->pn_tx_chain[i].pn_nextdesc =
- &cd->pn_tx_chain[0];
- else
- cd->pn_tx_chain[i].pn_nextdesc =
- &cd->pn_tx_chain[i + 1];
- }
-
- cd->pn_tx_free = &cd->pn_tx_chain[0];
- cd->pn_tx_tail = cd->pn_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int pn_list_rx_init(sc)
- struct pn_softc *sc;
-{
- struct pn_chain_data *cd;
- struct pn_list_data *ld;
- int i;
-
- cd = &sc->pn_cdata;
- ld = sc->pn_ldata;
-
- for (i = 0; i < PN_RX_LIST_CNT; i++) {
- cd->pn_rx_chain[i].pn_ptr =
- (struct pn_desc *)&ld->pn_rx_list[i];
- if (pn_newbuf(sc, &cd->pn_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (PN_RX_LIST_CNT - 1)) {
- cd->pn_rx_chain[i].pn_nextdesc = &cd->pn_rx_chain[0];
- ld->pn_rx_list[i].pn_next =
- vtophys(&ld->pn_rx_list[0]);
- } else {
- cd->pn_rx_chain[i].pn_nextdesc = &cd->pn_rx_chain[i + 1];
- ld->pn_rx_list[i].pn_next =
- vtophys(&ld->pn_rx_list[i + 1]);
- }
- }
-
- cd->pn_rx_head = &cd->pn_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int pn_newbuf(sc, c)
- struct pn_softc *sc;
- struct pn_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("pn%d: no memory for rx list -- packet dropped!\n",
- sc->pn_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("pn%d: no memory for rx list -- packet dropped!\n",
- sc->pn_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- /*
- * Zero the buffer. This is part of the workaround for the
- * promiscuous mode bug in the revision 33 PNIC chips.
- */
- bzero((char *)mtod(m_new, char *), MCLBYTES);
- m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-
- c->pn_mbuf = m_new;
- c->pn_ptr->pn_status = PN_RXSTAT;
- c->pn_ptr->pn_data = vtophys(mtod(m_new, caddr_t));
- c->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
-
- return(0);
-}
-
-#ifdef PN_PROMISC_BUG_WAR
-/*
- * Grrrrr.
- * Revision 33 of the PNIC chip has a terrible bug in it that manifests
- * itself when you enable promiscuous mode. Sometimes instead of uploading
- * one complete frame, it uploads its entire FIFO memory. The frame we
- * want is at the end of this whole mess, but we never know exactly
- * how much data has been uploaded, so finding it can be hard.
- *
- * There is only one way to do it reliably, and it's disgusting.
- * Here's what we know:
- *
- * - We know there will always be somewhere between one and three extra
- * descriptors uploaded.
- *
- * - We know the desired received frame will always be at the end of the
- * total data upload.
- *
- * - We know the size of the desired received frame because it will be
- * provided in the length field of the status word in the last descriptor.
- *
- * Here's what we do:
- *
- * - When we allocate buffers for the receive ring, we bzero() them.
- * This means that we know that the buffer contents should be all
- * zeros, except for data uploaded by the chip.
- *
- * - We also force the PNIC chip to upload frames that include the
- * ethernet CRC at the end.
- *
- * - We gather all of the bogus frame data into a single buffer.
- *
- * - We then position a pointer at the end of this buffer and scan
- * backwards until we encounter the first non-zero byte of data.
- * This is the end of the received frame. We know we will encounter
- * some data at the end of the frame because the CRC will always be
- * there, so even if the sender transmits a packet of all zeros,
- * we won't be fooled.
- *
- * - We know the size of the actual received frame, so we subtract
- * that value from the current pointer location. This brings us
- * to the start of the actual received packet.
- *
- * - We copy this into an mbuf and pass it on, along with the actual
- * frame length.
- *
- * The performance hit is tremendous, but it beats dropping frames all
- * the time.
- */
-
-#define PN_WHOLEFRAME (PN_RXSTAT_FIRSTFRAG|PN_RXSTAT_LASTFRAG)
-static void pn_promisc_bug_war(sc, cur_rx)
- struct pn_softc *sc;
- struct pn_chain_onefrag *cur_rx;
-{
- struct pn_chain_onefrag *c;
- unsigned char *ptr;
- int total_len;
- u_int32_t rxstat = 0;
-
- c = sc->pn_promisc_bug_save;
- ptr = sc->pn_promisc_buf;
- bzero(ptr, sizeof(PN_RXLEN * 5));
-
- /* Copy all the bytes from the bogus buffers. */
- while ((c->pn_ptr->pn_status & PN_WHOLEFRAME) != PN_WHOLEFRAME) {
- rxstat = c->pn_ptr->pn_status;
- m_copydata(c->pn_mbuf, 0, PN_RXLEN, ptr);
- ptr += PN_RXLEN - 2; /* round down to 32-bit boundary */
- if (c == cur_rx)
- break;
- if (rxstat & PN_RXSTAT_LASTFRAG)
- break;
- c->pn_ptr->pn_status = PN_RXSTAT;
- c->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(c->pn_mbuf, char *), MCLBYTES);
- c = c->pn_nextdesc;
- }
-
-
- /* Find the length of the actual receive frame. */
- total_len = PN_RXBYTES(rxstat);
-
- /* Scan backwards until we hit a non-zero byte. */
- while(*ptr == 0x00) {
- ptr--;
- }
-
- if ((u_int32_t)(ptr) & 0x3)
- ptr -= 1;
-
- /* Now find the start of the frame. */
- ptr -= total_len;
- if (ptr < sc->pn_promisc_buf)
- ptr = sc->pn_promisc_buf;
-
- /*
- * Now copy the salvaged frame to the last mbuf and fake up
- * the status word to make it look like a successful
- * frame reception.
- */
- m_copyback(cur_rx->pn_mbuf, 0, total_len, ptr);
- cur_rx->pn_mbuf->m_len = c->pn_mbuf->m_pkthdr.len = MCLBYTES;
- cur_rx->pn_ptr->pn_status |= PN_RXSTAT_FIRSTFRAG;
-
- return;
-}
-#endif
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void pn_rxeof(sc)
- struct pn_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct pn_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->pn_cdata.pn_rx_head->pn_ptr->pn_status) &
- PN_RXSTAT_OWN)) {
- cur_rx = sc->pn_cdata.pn_rx_head;
- sc->pn_cdata.pn_rx_head = cur_rx->pn_nextdesc;
-
-#ifdef PN_PROMISC_BUG_WAR
- /*
- * XXX The PNIC seems to have a bug that manifests
- * when the promiscuous mode bit is set: we have to
- * watch for it and work around it.
- */
- if (sc->pn_promisc_war && ifp->if_flags & IFF_PROMISC) {
- if ((rxstat & PN_WHOLEFRAME) != PN_WHOLEFRAME) {
- if (rxstat & PN_RXSTAT_FIRSTFRAG)
- sc->pn_promisc_bug_save = cur_rx;
- if ((rxstat & PN_RXSTAT_LASTFRAG) == 0)
- continue;
- pn_promisc_bug_war(sc, cur_rx);
- rxstat = cur_rx->pn_ptr->pn_status;
- }
- }
-#endif
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & PN_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & PN_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->pn_ptr->pn_status = PN_RXSTAT;
- cur_rx->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(cur_rx->pn_mbuf, char *), MCLBYTES);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->pn_mbuf;
- total_len = PN_RXBYTES(cur_rx->pn_ptr->pn_status);
-
- /* Trim off the CRC. */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (pn_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->pn_ptr->pn_status = PN_RXSTAT;
- cur_rx->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(cur_rx->pn_mbuf, char *), MCLBYTES);
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void pn_rxeoc(sc)
- struct pn_softc *sc;
-{
-
- pn_rxeof(sc);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXADDR, vtophys(sc->pn_cdata.pn_rx_head->pn_ptr));
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void pn_txeof(sc)
- struct pn_softc *sc;
-{
- struct pn_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->pn_cdata.pn_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->pn_cdata.pn_tx_head->pn_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->pn_cdata.pn_tx_head;
- txstat = PN_TXSTATUS(cur_tx);
-
- if ((txstat & PN_TXSTAT_OWN) || txstat == PN_UNSENT)
- break;
-
- if (txstat & PN_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & PN_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & PN_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & PN_TXSTAT_COLLCNT) >> 3;
-
-
- ifp->if_opackets++;
- m_freem(cur_tx->pn_mbuf);
- cur_tx->pn_mbuf = NULL;
-
- if (sc->pn_cdata.pn_tx_head == sc->pn_cdata.pn_tx_tail) {
- sc->pn_cdata.pn_tx_head = NULL;
- sc->pn_cdata.pn_tx_tail = NULL;
- break;
- }
-
- sc->pn_cdata.pn_tx_head = cur_tx->pn_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void pn_txeoc(sc)
- struct pn_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->pn_cdata.pn_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->pn_cdata.pn_tx_tail = NULL;
- if (sc->pn_want_auto)
- pn_autoneg_mii(sc, PN_FLAG_SCHEDDELAY, 1);
- } else {
- if (PN_TXOWN(sc->pn_cdata.pn_tx_head) == PN_UNSENT) {
- PN_TXOWN(sc->pn_cdata.pn_tx_head) = PN_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void pn_intr(arg)
- void *arg;
-{
- struct pn_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts. */
- if (!(ifp->if_flags & IFF_UP)) {
- pn_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, PN_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, PN_ISR);
- if (status)
- CSR_WRITE_4(sc, PN_ISR, status);
-
- if ((status & PN_INTRS) == 0)
- break;
-
- if (status & PN_ISR_RX_OK)
- pn_rxeof(sc);
-
- if ((status & PN_ISR_RX_WATCHDOG) || (status & PN_ISR_RX_IDLE)
- || (status & PN_ISR_RX_NOBUF))
- pn_rxeoc(sc);
-
- if (status & PN_ISR_TX_OK)
- pn_txeof(sc);
-
- if (status & PN_ISR_TX_NOBUF)
- pn_txeoc(sc);
-
- if (status & PN_ISR_TX_IDLE) {
- pn_txeof(sc);
- if (sc->pn_cdata.pn_tx_head != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & PN_ISR_TX_UNDERRUN) {
- ifp->if_oerrors++;
- pn_txeof(sc);
- if (sc->pn_cdata.pn_tx_head != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & PN_ISR_BUS_ERR) {
- pn_reset(sc);
- pn_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, PN_IMR, PN_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- pn_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int pn_encap(sc, c, m_head)
- struct pn_softc *sc;
- struct pn_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct pn_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == PN_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->pn_ptr->pn_frag[frag];
- f->pn_ctl = PN_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->pn_ctl |= PN_TXCTL_FIRSTFRAG;
- f->pn_status = 0;
- } else
- f->pn_status = PN_TXSTAT_OWN;
- f->pn_data = vtophys(mtod(m, vm_offset_t));
- f->pn_next = vtophys(&c->pn_ptr->pn_frag[frag + 1]);
- frag++;
- }
- }
-
- /*
- * Handle special case: we used up all 16 fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("pn%d: no memory for tx list", sc->pn_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("pn%d: no memory for tx list",
- sc->pn_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->pn_ptr->pn_frag[0];
- f->pn_data = vtophys(mtod(m_new, caddr_t));
- f->pn_ctl = total_len = m_new->m_len;
- f->pn_ctl |= PN_TXCTL_TLINK|PN_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
-
- c->pn_mbuf = m_head;
- c->pn_lastdesc = frag - 1;
- PN_TXCTL(c) |= PN_TXCTL_LASTFRAG;
- PN_TXNEXT(c) = vtophys(&c->pn_nextdesc->pn_ptr->pn_frag[0]);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void pn_start(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
- struct mbuf *m_head = NULL;
- struct pn_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->pn_autoneg) {
- sc->pn_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->pn_cdata.pn_tx_free->pn_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->pn_cdata.pn_tx_free;
-
- while(sc->pn_cdata.pn_tx_free->pn_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->pn_cdata.pn_tx_free;
- sc->pn_cdata.pn_tx_free = cur_tx->pn_nextdesc;
-
- /* Pack the data into the descriptor. */
- pn_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- PN_TXOWN(cur_tx) = PN_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->pn_mbuf);
-#endif
- }
-
- /*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- PN_TXCTL(cur_tx) |= PN_TXCTL_FINT;
- sc->pn_cdata.pn_tx_tail = cur_tx;
-
- if (sc->pn_cdata.pn_tx_head == NULL) {
- sc->pn_cdata.pn_tx_head = start_tx;
- PN_TXOWN(start_tx) = PN_TXSTAT_OWN;
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- } else {
- PN_TXOWN(start_tx) = PN_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void pn_init(xsc)
- void *xsc;
-{
- struct pn_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->pn_autoneg)
- return;
-
- s = splimp();
-
- if (sc->pn_pinfo != NULL)
- phy_bmcr = pn_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- pn_stop(sc);
- pn_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, PN_BUSCTL, PN_BUSCTL_CONFIG);
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_IMMEDIATE);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_NO_RXCRC);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_HEARTBEAT);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_STORENFWD);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_BACKOFF);
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_THRESH);
- PN_SETBIT(sc, PN_NETCFG, PN_TXTHRESH_72BYTES);
-
- pn_setcfg(sc, pn_phy_readreg(sc, PHY_BMCR));
-
- if (sc->pn_pinfo != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_MIIENB);
- PN_SETBIT(sc, PN_ENDEC, PN_ENDEC_JABBERDIS);
- }
-
- /* Init circular RX list. */
- if (pn_list_rx_init(sc) == ENOBUFS) {
- printf("pn%d: initialization failed: no "
- "memory for rx buffers\n", sc->pn_unit);
- pn_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- pn_list_tx_init(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, PN_RXADDR, vtophys(sc->pn_cdata.pn_rx_head->pn_ptr));
-
- /*
- * Load the RX/multicast filter.
- */
- pn_setfilt(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, PN_IMR, PN_INTRS);
- CSR_WRITE_4(sc, PN_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON|PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->pn_pinfo != NULL)
- pn_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int pn_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- pn_autoneg_mii(sc, PN_FLAG_SCHEDDELAY, 1);
- else
- pn_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void pn_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct pn_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = pn_phy_readreg(sc, PHY_LPAR);
- advert = pn_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int pn_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct pn_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- pn_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- pn_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- pn_init(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void pn_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->pn_autoneg) {
- pn_autoneg_mii(sc, PN_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("pn%d: watchdog timeout\n", sc->pn_unit);
-
- if (!(pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("pn%d: no carrier - transceiver cable problem?\n",
- sc->pn_unit);
- pn_stop(sc);
- pn_reset(sc);
- pn_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- pn_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void pn_stop(sc)
- struct pn_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- PN_CLRBIT(sc, PN_NETCFG, (PN_NETCFG_RX_ON|PN_NETCFG_TX_ON));
- CSR_WRITE_4(sc, PN_IMR, 0x00000000);
- CSR_WRITE_4(sc, PN_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, PN_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < PN_RX_LIST_CNT; i++) {
- if (sc->pn_cdata.pn_rx_chain[i].pn_mbuf != NULL) {
- m_freem(sc->pn_cdata.pn_rx_chain[i].pn_mbuf);
- sc->pn_cdata.pn_rx_chain[i].pn_mbuf = NULL;
- }
- }
- bzero((char *)&sc->pn_ldata->pn_rx_list,
- sizeof(sc->pn_ldata->pn_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < PN_TX_LIST_CNT; i++) {
- if (sc->pn_cdata.pn_tx_chain[i].pn_mbuf != NULL) {
- m_freem(sc->pn_cdata.pn_tx_chain[i].pn_mbuf);
- sc->pn_cdata.pn_tx_chain[i].pn_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->pn_ldata->pn_tx_list,
- sizeof(sc->pn_ldata->pn_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void pn_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct pn_softc *sc = (struct pn_softc *)arg;
-
- pn_stop(sc);
-
- return;
-}
-
-static struct pci_device pn_device = {
- "pn",
- pn_probe,
- pn_attach,
- &pn_count,
- NULL
-};
-DATA_SET(pcidevice_set, pn_device);
diff --git a/sys/pci/if_pnreg.h b/sys/pci/if_pnreg.h
deleted file mode 100644
index e3644097985d..000000000000
--- a/sys/pci/if_pnreg.h
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_pnreg.h,v 1.16 1999/01/05 00:47:25 wpaul Exp $
- */
-
-/*
- * PNIC register definitions.
- */
-
-#define PN_BUSCTL 0x00 /* bus control */
-#define PN_TXSTART 0x08 /* tx start demand */
-#define PN_RXSTART 0x10 /* rx start demand */
-#define PN_RXADDR 0x18 /* rx descriptor list start addr */
-#define PN_TXADDR 0x20 /* tx descriptor list start addr */
-#define PN_ISR 0x28 /* interrupt status register */
-#define PN_NETCFG 0x30 /* network config register */
-#define PN_IMR 0x38 /* interrupt mask */
-#define PN_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define PN_SIO 0x48 /* MII and ROM/EEPROM access */
-#define PN_GEN 0x60 /* general purpose register */
-#define PN_ENDEC 0x78 /* ENDEC general register */
-#define PN_SIOPWR 0x90 /* serial eeprom power up */
-#define PN_SIOCTL 0x98 /* EEPROM control register */
-#define PN_MII 0xA0 /* MII access register */
-#define PN_NWAY 0xB8 /* Internal NWAY register */
-
-
-/*
- * Bus control bits.
- */
-#define PN_BUSCTL_RESET 0x00000001
-#define PN_BUSCTL_ARBITRATION 0x00000002
-#define PN_BUSCTL_SKIPLEN 0x0000007C
-#define PN_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define PN_BUSCTL_BURSTLEN 0x00003F00
-#define PN_BUSCTL_CACHEALIGN 0x0000C000
-#define PN_BUSCTL_TXPOLL 0x000E0000
-
-#define PN_SKIPLEN_1LONG 0x00000004
-#define PN_SKIPLEN_2LONG 0x00000008
-#define PN_SKIPLEN_3LONG 0x00000010
-#define PN_SKIPLEN_4LONG 0x00000020
-#define PN_SKIPLEN_5LONG 0x00000040
-
-#define PN_CACHEALIGN_8LONG 0x00004000
-#define PN_CACHEALIGN_16LONG 0x00008000
-#define PN_CACHEALIGN_32LONG 0x0000C000
-
-#define PN_BURSTLEN_USECA 0x00000000
-#define PN_BURSTLEN_1LONG 0x00000100
-#define PN_BURSTLEN_2LONG 0x00000200
-#define PN_BURSTLEN_4LONG 0x00000400
-#define PN_BURSTLEN_8LONG 0x00000800
-#define PN_BURSTLEN_16LONG 0x00001000
-#define PN_BURSTLEN_32LONG 0x00002000
-
-#define PN_TXPOLL_OFF 0x00000000
-#define PN_TXPOLL_200U 0x00020000
-#define PN_TXPOLL_800U 0x00040000
-#define PN_TXPOLL_1600U 0x00060000
-#define PN_TXPOLL_12_8M 0x00080000
-#define PN_TXPOLL_25_6M 0x000A0000
-#define PN_TXPOLL_51_2M 0x000C0000
-#define PN_TXPOLL_102_4M 0x000E0000
-
-#define PN_BUSCTL_CONFIG \
- (PN_CACHEALIGN_8LONG|PN_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define PN_ISR_TX_OK 0x00000001 /* packet tx ok */
-#define PN_ISR_TX_IDLE 0x00000002 /* tx stopped */
-#define PN_ISR_TX_NOBUF 0x00000004 /* no tx buffer available */
-#define PN_ISR_TX_JABTIMEO 0x00000008 /* jabber timeout */
-#define PN_ISR_LINKPASS 0x00000010 /* link test pass */
-#define PN_ISR_TX_UNDERRUN 0x00000020 /* transmit underrun */
-#define PN_ISR_RX_OK 0x00000040 /* packet rx ok */
-#define PN_ISR_RX_NOBUF 0x00000080 /* rx buffer unavailable */
-#define PN_ISR_RX_IDLE 0x00000100 /* rx stopped */
-#define PN_ISR_RX_WATCHDOG 0x00000200 /* rx watchdog timeo */
-#define PN_ISR_TX_EARLY 0x00000400 /* rx watchdog timeo */
-#define PN_ISR_BUS_ERR 0x00002000
-#define PN_ISR_ABNORMAL 0x00008000
-#define PN_ISR_NORMAL 0x00010000
-#define PN_ISR_RX_STATE 0x000E0000
-#define PN_ISR_TX_STATE 0x00700000
-#define PN_ISR_BUSERRTYPE 0x03800000
-#define PN_ISR_TXABORT 0x04000000 /* tx abort */
-
-#define PN_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define PN_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define PN_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define PN_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define PN_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define PN_RXSTATE_CLOSE 0x000A0000 /* 101 - close rx desc */
-#define PN_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define PN_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define PN_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define PN_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define PN_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define PN_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define PN_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define PN_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define PN_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define PN_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-#define PN_BUSERR_PARITY 0x00000000
-#define PN_BUSERR_MASTABRT 0x00800000
-#define PN_BUSERR_TGTABRT 0x01000000
-#define PN_BUSERR_RSVD1 0x01800000
-#define PN_BUSERR_RSVD2 0x02000000
-
-/*
- * Network config bits.
- */
-#define PN_NETCFG_HASHPERF 0x00000001 /* 0 == perf, 1 == hash */
-#define PN_NETCFG_RX_ON 0x00000002
-#define PN_NETCFG_HASHONLY 0x00000004 /* 1 == allhash */
-#define PN_NETCFG_RX_PASSERR 0x00000008
-#define PN_NETCFG_INVERSFILT 0x00000010
-#define PN_NETCFG_BACKOFF 0x00000020
-#define PN_NETCFG_RX_PROMISC 0x00000040
-#define PN_NETCFG_RX_ALLMULTI 0x00000080
-#define PN_NETCFG_FLAKYOSC 0x00000100
-#define PN_NETCFG_FULLDUPLEX 0x00000200
-#define PN_NETCFG_OPERMODE 0x00000C00
-#define PN_NETCFG_FORCECOLL 0x00001000
-#define PN_NETCFG_TX_ON 0x00002000
-#define PN_NETCFG_TX_THRESH 0x0000C000
-#define PN_NETCFG_TX_BACKOFF 0x00020000
-#define PN_NETCFG_MIIENB 0x00040000 /* 1 == MII, 0 == internal */
-#define PN_NETCFG_HEARTBEAT 0x00080000 /* 1 == disabled */
-#define PN_NETCFG_TX_IMMEDIATE 0x00100000
-#define PN_NETCFG_STORENFWD 0x00200000
-#define PN_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10Mbps 0 == 100Mbps */
-#define PN_NETCFG_PCS 0x00800000 /* 1 == 100baseTX */
-#define PN_NETCFG_NO_RXCRC 0x20000000
-#define PN_NETCFG_EXT_ENDEC 0x40000000 /* 1 == ext, 0 == int PHY */
-
-#define PN_OPMODE_NORM 0x00000000
-#define PN_OPMODE_INTLOOP 0x00000400
-#define PN_OPMODE_EXTLOOP 0x00000800
-
-#define PN_TXTHRESH_72BYTES 0x00000000
-#define PN_TXTHRESH_96BYTES 0x00004000
-#define PN_TXTHRESH_128BYTES 0x00008000
-#define PN_TXTHRESH_160BYTES 0x0000C000
-
-/*
- * Interrupt mask bits.
- */
-#define PN_IMR_TX_OK 0x00000001 /* packet tx ok */
-#define PN_IMR_TX_IDLE 0x00000002 /* tx stopped */
-#define PN_IMR_TX_NOBUF 0x00000004 /* no tx buffer available */
-#define PN_IMR_TX_JABTIMEO 0x00000008 /* jabber timeout */
-#define PN_IMR_LINKPASS 0x00000010 /* link test pass */
-#define PN_IMR_TX_UNDERRUN 0x00000020 /* transmit underrun */
-#define PN_IMR_RX_OK 0x00000040 /* packet rx ok */
-#define PN_IMR_RX_NOBUF 0x00000080 /* rx buffer unavailable */
-#define PN_IMR_RX_IDLE 0x00000100 /* rx stopped */
-#define PN_IMR_RX_WATCHDOG 0x00000200 /* rx watchdog timeo */
-#define PN_IMR_TX_EARLY 0x00000400 /* rx watchdog timeo */
-#define PN_IMR_BUS_ERR 0x00002000
-#define PN_IMR_ABNORMAL 0x00008000
-#define PN_IMR_NORMAL 0x00010000
-#define PN_ISR_TXABORT 0x04000000 /* tx abort */
-
-#define PN_INTRS \
- (PN_IMR_RX_OK|PN_IMR_TX_OK|PN_IMR_RX_NOBUF| \
- PN_IMR_TX_NOBUF|PN_IMR_TX_UNDERRUN|PN_IMR_BUS_ERR| \
- PN_IMR_ABNORMAL|PN_IMR_NORMAL)
-
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define PN_SIO_DATA 0x0000003F
-#define PN_SIO_OPCODE 0x00000300
-#define PN_SIO_BUSY 0x80000000
-
-/*
- * SIOCTL/EEPROM bits
- */
-#define PN_EE_READ 0x600
-
-/*
- * General purpose register bits.
- */
-#define PN_GEN_CTL 0x000000F0
-#define PN_GEN_100TX_LINK 0x00000008
-#define PN_GEN_BNC_ENB 0x00000004
-#define PN_GEN_100TX_LOOP 0x00000002 /* 1 == normal, 0 == loop */
-#define PN_GEN_SPEEDSEL 0x00000001 /* 1 == 100Mbps, 0 == 10Mbps */
-#define PN_GEN_MUSTBEONE 0x00000030
-
-/*
- * General ENDEC bits.
- */
-#define PN_ENDEC_JABBERDIS 0x000000001 /* 1 == disable, 0 == enable */
-
-/*
- * MII bits.
- */
-#define PN_MII_DATA 0x0000FFFF
-#define PN_MII_REGADDR 0x007C0000
-#define PN_MII_PHYADDR 0x0F800000
-#define PN_MII_OPCODE 0x30000000
-#define PN_MII_RESERVED 0x00020000
-#define PN_MII_BUSY 0x80000000
-
-#define PN_MII_READ 0x60020000 /* read PHY command */
-#define PN_MII_WRITE 0x50020000 /* write PHY command */
-
-/*
- * Internal PHY NWAY register bits.
- */
-#define PN_NWAY_RESET 0x00000001 /* reset */
-#define PN_NWAY_PDOWN 0x00000002 /* power down */
-#define PN_NWAY_BYPASS 0x00000004 /* bypass */
-#define PN_NWAY_AUILOWCUR 0x00000008 /* AUI low current */
-#define PN_NWAY_TPEXTEND 0x00000010 /* low squelch voltage */
-#define PN_NWAY_POLARITY 0x00000020 /* 0 == on, 1 == off */
-#define PN_NWAY_TP 0x00000040 /* 1 == tp, 0 == AUI */
-#define PN_NWAY_AUIVOLT 0x00000080 /* 1 == full, 0 == half */
-#define PN_NWAY_DUPLEX 0x00000100 /* 1 == full, 0 == half */
-#define PN_NWAY_LINKTEST 0x00000200 /* 1 == on, 0 == off */
-#define PN_NWAY_AUTODETECT 0x00000400 /* 1 == off, 0 == on */
-#define PN_NWAY_SPEEDSEL 0x00000800 /* 0 == 10, 1 == 100 */
-#define PN_NWAY_NWAY_ENB 0x00001000 /* 0 == off, 1 == on */
-#define PN_NWAY_CAP10HALF 0x00002000
-#define PN_NWAY_CAP10FULL 0x00004000
-#define PN_NWAY_CAP100FULL 0x00008000
-#define PN_NWAY_CAP100HALF 0x00010000
-#define PN_NWAY_CAP100T4 0x00020000
-#define PN_NWAY_AUTONEGRSTR 0x02000000
-#define PN_NWAY_REMFAULT 0x04000000
-#define PN_NWAY_LPAR10HALF 0x08000000
-#define PN_NWAY_LPAR10FULL 0x10000000
-#define PN_NWAY_LPAR100FULL 0x20000000
-#define PN_NWAY_LPAR100HALF 0x40000000
-#define PN_NWAY_LPAR100T4 0x80000000
-
-/*
- * Size of a setup frame.
- */
-#define PN_SFRAME_LEN 192
-
-/*
- * PNIC TX/RX list structure.
- */
-
-struct pn_desc {
- u_int32_t pn_status;
- u_int32_t pn_ctl;
- u_int32_t pn_ptr1;
- u_int32_t pn_ptr2;
-};
-
-#define pn_data pn_ptr1
-#define pn_next pn_ptr2
-
-
-#define RX_RXSTAT_FIFOOFLOW 0x00000001
-#define PN_RXSTAT_CRCERR 0x00000002
-#define PN_RXSTAT_DRIBBLE 0x00000004
-#define PN_RXSTAT_WATCHDOG 0x00000010
-#define PN_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define PN_RXSTAT_COLLSEEN 0x00000040
-#define PN_RXSTAT_GIANT 0x00000080
-#define PN_RXSTAT_LASTFRAG 0x00000100
-#define PN_RXSTAT_FIRSTFRAG 0x00000200
-#define PN_RXSTAT_MULTICAST 0x00000400
-#define PN_RXSTAT_RUNT 0x00000800
-#define PN_RXSTAT_RXTYPE 0x00003000
-#define PN_RXSTAT_RXERR 0x00008000
-#define PN_RXSTAT_RXLEN 0x7FFF0000
-#define PN_RXSTAT_OWN 0x80000000
-
-#define PN_RXBYTES(x) ((x & PN_RXSTAT_RXLEN) >> 16)
-#define PN_RXSTAT (PN_RXSTAT_FIRSTFRAG|PN_RXSTAT_LASTFRAG|PN_RXSTAT_OWN)
-
-#define PN_RXCTL_BUFLEN1 0x00000FFF
-#define PN_RXCTL_BUFLEN2 0x00FFF000
-#define PN_RXCTL_RLINK 0x01000000
-#define PN_RXCTL_RLAST 0x02000000
-
-#define PN_TXSTAT_DEFER 0x00000001
-#define PN_TXSTAT_UNDERRUN 0x00000002
-#define PN_TXSTAT_LINKFAIL 0x00000003
-#define PN_TXSTAT_COLLCNT 0x00000078
-#define PN_TXSTAT_SQE 0x00000080
-#define PN_TXSTAT_EXCESSCOLL 0x00000100
-#define PN_TXSTAT_LATECOLL 0x00000200
-#define PN_TXSTAT_NOCARRIER 0x00000400
-#define PN_TXSTAT_CARRLOST 0x00000800
-#define PN_TXSTAT_JABTIMEO 0x00004000
-#define PN_TXSTAT_ERRSUM 0x00008000
-#define PN_TXSTAT_OWN 0x80000000
-
-#define PN_TXCTL_BUFLEN1 0x000007FF
-#define PN_TXCTL_BUFLEN2 0x003FF800
-#define PN_TXCTL_FILTTYPE0 0x00400000
-#define PN_TXCTL_PAD 0x00800000
-#define PN_TXCTL_TLINK 0x01000000
-#define PN_TXCTL_TLAST 0x02000000
-#define PN_TXCTL_NOCRC 0x04000000
-#define PN_TXCTL_SETUP 0x08000000
-#define PN_TXCTL_FILTTYPE1 0x10000000
-#define PN_TXCTL_FIRSTFRAG 0x20000000
-#define PN_TXCTL_LASTFRAG 0x40000000
-#define PN_TXCTL_FINT 0x80000000
-
-#define PN_FILTER_PERFECT 0x00000000
-#define PN_FILTER_HASHPERF 0x00400000
-#define PN_FILTER_INVERSE 0x10000000
-#define PN_FILTER_HASHONLY 0x10400000
-
-#define PN_MAXFRAGS 16
-#define PN_RX_LIST_CNT 64
-#define PN_TX_LIST_CNT 64
-#define PN_MIN_FRAMELEN 60
-#define PN_FRAMELEN 1536
-#define PN_RXLEN 1518
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct pn_txdesc {
- struct pn_desc pn_frag[PN_MAXFRAGS];
-};
-
-#define PN_TXNEXT(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_next
-#define PN_TXSTATUS(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_status
-#define PN_TXCTL(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_ctl
-#define PN_TXDATA(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_data
-
-#define PN_TXOWN(x) x->pn_ptr->pn_frag[0].pn_status
-
-#define PN_UNSENT 0x12344321
-
-struct pn_list_data {
- struct pn_desc pn_rx_list[PN_RX_LIST_CNT];
- struct pn_txdesc pn_tx_list[PN_TX_LIST_CNT];
-};
-
-struct pn_chain {
- struct pn_txdesc *pn_ptr;
- struct mbuf *pn_mbuf;
- struct pn_chain *pn_nextdesc;
- u_int8_t pn_lastdesc;
-};
-
-struct pn_chain_onefrag {
- struct pn_desc *pn_ptr;
- struct mbuf *pn_mbuf;
- struct pn_chain_onefrag *pn_nextdesc;
-};
-
-struct pn_chain_data {
- struct pn_desc pn_sframe;
- u_int32_t pn_sbuf[PN_SFRAME_LEN/sizeof(u_int32_t)];
- struct pn_chain_onefrag pn_rx_chain[PN_RX_LIST_CNT];
- struct pn_chain pn_tx_chain[PN_TX_LIST_CNT];
-
- struct pn_chain_onefrag *pn_rx_head;
-
- struct pn_chain *pn_tx_head;
- struct pn_chain *pn_tx_tail;
- struct pn_chain *pn_tx_free;
-};
-
-struct pn_type {
- u_int16_t pn_vid;
- u_int16_t pn_did;
- char *pn_name;
-};
-
-struct pn_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define PN_MII_STARTDELIM 0x01
-#define PN_MII_READOP 0x02
-#define PN_MII_WRITEOP 0x01
-#define PN_MII_TURNAROUND 0x02
-
-#define PN_FLAG_FORCEDELAY 1
-#define PN_FLAG_SCHEDDELAY 2
-#define PN_FLAG_DELAYTIMEO 3
-
-struct pn_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t pn_bhandle; /* bus space handle */
- bus_space_tag_t pn_btag; /* bus space tag */
- struct pn_type *pn_info; /* PNIC adapter info */
- struct pn_type *pn_pinfo; /* phy info */
- u_int8_t pn_unit; /* interface number */
- u_int8_t pn_type;
- u_int8_t pn_phy_addr; /* PHY address */
- u_int8_t pn_tx_pend; /* TX pending */
- u_int8_t pn_want_auto;
- u_int8_t pn_autoneg;
- caddr_t pn_ldata_ptr;
-#ifdef PN_PROMISC_BUG_WAR
-#define PN_169_REV 32
-#define PN_169B_REV 33
- u_int8_t pn_promisc_war;
- struct pn_chain_onefrag *pn_promisc_bug_save;
- unsigned char *pn_promisc_buf;
-#endif
- struct pn_list_data *pn_ldata;
- struct pn_chain_data pn_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->pn_btag, sc->pn_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->pn_btag, sc->pn_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->pn_btag, sc->pn_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->pn_btag, sc->pn_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->pn_btag, sc->pn_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->pn_btag, sc->pn_bhandle, reg)
-
-#define PN_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Lite-On PNIC PCI vendor ID
- */
-#define PN_VENDORID 0x11AD
-
-/*
- * Lite-On PNIC PCI device ID.
- */
-#define PN_DEVICEID_PNIC 0x0002
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define PN_PCI_VENDOR_ID 0x00
-#define PN_PCI_DEVICE_ID 0x02
-#define PN_PCI_COMMAND 0x04
-#define PN_PCI_STATUS 0x06
-#define PN_PCI_REVISION 0x08
-#define PN_PCI_CLASSCODE 0x09
-#define PN_PCI_LATENCY_TIMER 0x0D
-#define PN_PCI_HEADER_TYPE 0x0E
-#define PN_PCI_LOIO 0x10
-#define PN_PCI_LOMEM 0x14
-#define PN_PCI_BIOSROM 0x30
-#define PN_PCI_INTLINE 0x3C
-#define PN_PCI_INTPIN 0x3D
-#define PN_PCI_MINGNT 0x3E
-#define PN_PCI_MINLAT 0x0F
-#define PN_PCI_RESETOPT 0x48
-#define PN_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define PN_PCI_CAPID 0xDC /* 8 bits */
-#define PN_PCI_NEXTPTR 0xDD /* 8 bits */
-#define PN_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define PN_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define PN_PSTATE_MASK 0x0003
-#define PN_PSTATE_D0 0x0000
-#define PN_PSTATE_D1 0x0002
-#define PN_PSTATE_D2 0x0002
-#define PN_PSTATE_D3 0x0003
-#define PN_PME_EN 0x0010
-#define PN_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define PN_PHYADDR_MIN 0x00
-#define PN_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
deleted file mode 100644
index 09a4a99b536b..000000000000
--- a/sys/pci/if_rl.c
+++ /dev/null
@@ -1,1992 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $
- */
-
-/*
- * RealTek 8129/8139 PCI NIC driver
- *
- * Supports several extremely cheap PCI 10/100 adapters based on
- * the RealTek chipset. Datasheets can be obtained from
- * www.realtek.com.tw.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
- * probably the worst PCI ethernet controller ever made, with the possible
- * exception of the FEAST chip made by SMC. The 8139 supports bus-master
- * DMA, but it has a terrible interface that nullifies any performance
- * gains that bus-master DMA usually offers.
- *
- * For transmission, the chip offers a series of four TX descriptor
- * registers. Each transmit frame must be in a contiguous buffer, aligned
- * on a longword (32-bit) boundary. This means we almost always have to
- * do mbuf copies in order to transmit a frame, except in the unlikely
- * case where a) the packet fits into a single mbuf, and b) the packet
- * is 32-bit aligned within the mbuf's data area. The presence of only
- * four descriptor registers means that we can never have more than four
- * packets queued for transmission at any one time.
- *
- * Reception is not much better. The driver has to allocate a single large
- * buffer area (up to 64K in size) into which the chip will DMA received
- * frames. Because we don't know where within this region received packets
- * will begin or end, we have no choice but to copy data from the buffer
- * area into mbufs in order to pass the packets up to the higher protocol
- * levels.
- *
- * It's impossible given this rotten design to really achieve decent
- * performance at 100Mbps, unless you happen to have a 400Mhz PII or
- * some equally overmuscled CPU to drive it.
- *
- * On the bright side, the 8139 does have a built-in PHY, although
- * rather than using an MDIO serial interface like most other NICs, the
- * PHY registers are directly accessible through the 8139's register
- * space. The 8139 supports autonegotiation, as well as a 64-bit multicast
- * filter.
- *
- * The 8129 chip is an older version of the 8139 that uses an external PHY
- * chip. The 8129 has a serial MDIO interface for accessing the MII where
- * the 8139 lets you directly access the on-board PHY registers. We need
- * to select which interface to use depending on the chip type.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-/*
- * Default to using PIO access for this driver. On SMP systems,
- * there appear to be problems with memory mapped mode: it looks like
- * doing too many memory mapped access back to back in rapid succession
- * can hang the bus. I'm inclined to blame this on crummy design/construction
- * on the part of RealTek. Memory mapped mode does appear to work on
- * uniprocessor systems though.
- */
-#define RL_USEIOSPACE
-
-#include <pci/if_rlreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct rl_type rl_devs[] = {
- { RT_VENDORID, RT_DEVICEID_8129,
- "RealTek 8129 10/100BaseTX" },
- { RT_VENDORID, RT_DEVICEID_8139,
- "RealTek 8139 10/100BaseTX" },
- { ACCTON_VENDORID, ACCTON_DEVICEID_5030,
- "Accton MPX 5030/5038 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct rl_type rl_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long rl_count = 0;
-static const char *rl_probe __P((pcici_t, pcidi_t));
-static void rl_attach __P((pcici_t, int));
-
-static int rl_encap __P((struct rl_softc *, struct rl_chain *,
- struct mbuf * ));
-
-static void rl_rxeof __P((struct rl_softc *));
-static void rl_txeof __P((struct rl_softc *));
-static void rl_txeoc __P((struct rl_softc *));
-static void rl_intr __P((void *));
-static void rl_start __P((struct ifnet *));
-static int rl_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void rl_init __P((void *));
-static void rl_stop __P((struct rl_softc *));
-static void rl_watchdog __P((struct ifnet *));
-static void rl_shutdown __P((int, void *));
-static int rl_ifmedia_upd __P((struct ifnet *));
-static void rl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void rl_eeprom_putbyte __P((struct rl_softc *, int));
-static void rl_eeprom_getword __P((struct rl_softc *, int, u_int16_t *));
-static void rl_read_eeprom __P((struct rl_softc *, caddr_t,
- int, int, int));
-static void rl_mii_sync __P((struct rl_softc *));
-static void rl_mii_send __P((struct rl_softc *, u_int32_t, int));
-static int rl_mii_readreg __P((struct rl_softc *, struct rl_mii_frame *));
-static int rl_mii_writereg __P((struct rl_softc *, struct rl_mii_frame *));
-
-static u_int16_t rl_phy_readreg __P((struct rl_softc *, int));
-static void rl_phy_writereg __P((struct rl_softc *, int, int));
-
-static void rl_autoneg_xmit __P((struct rl_softc *));
-static void rl_autoneg_mii __P((struct rl_softc *, int, int));
-static void rl_setmode_mii __P((struct rl_softc *, int));
-static void rl_getmode_mii __P((struct rl_softc *));
-static u_int8_t rl_calchash __P((caddr_t));
-static void rl_setmulti __P((struct rl_softc *));
-static void rl_reset __P((struct rl_softc *));
-static int rl_list_tx_init __P((struct rl_softc *));
-
-#define EE_SET(x) \
- CSR_WRITE_1(sc, RL_EECMD, \
- CSR_READ_1(sc, RL_EECMD) | x)
-
-#define EE_CLR(x) \
- CSR_WRITE_1(sc, RL_EECMD, \
- CSR_READ_1(sc, RL_EECMD) & ~x)
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void rl_eeprom_putbyte(sc, addr)
- struct rl_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | RL_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- EE_SET(RL_EE_DATAIN);
- } else {
- EE_CLR(RL_EE_DATAIN);
- }
- DELAY(100);
- EE_SET(RL_EE_CLK);
- DELAY(150);
- EE_CLR(RL_EE_CLK);
- DELAY(100);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void rl_eeprom_getword(sc, addr, dest)
- struct rl_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM|RL_EE_SEL);
-
- /*
- * Send address of word we want to read.
- */
- rl_eeprom_putbyte(sc, addr);
-
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM|RL_EE_SEL);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- EE_SET(RL_EE_CLK);
- DELAY(100);
- if (CSR_READ_1(sc, RL_EECMD) & RL_EE_DATAOUT)
- word |= i;
- EE_CLR(RL_EE_CLK);
- DELAY(100);
- }
-
- /* Turn off EEPROM access mode. */
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void rl_read_eeprom(sc, dest, off, cnt, swap)
- struct rl_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- rl_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-
-/*
- * MII access routines are provided for the 8129, which
- * doesn't have a built-in PHY. For the 8139, we fake things
- * up by diverting rl_phy_readreg()/rl_phy_writereg() to the
- * direct access PHY registers.
- */
-#define MII_SET(x) \
- CSR_WRITE_1(sc, RL_MII, \
- CSR_READ_1(sc, RL_MII) | x)
-
-#define MII_CLR(x) \
- CSR_WRITE_1(sc, RL_MII, \
- CSR_READ_1(sc, RL_MII) & ~x)
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void rl_mii_sync(sc)
- struct rl_softc *sc;
-{
- register int i;
-
- MII_SET(RL_MII_DIR|RL_MII_DATAOUT);
-
- for (i = 0; i < 32; i++) {
- MII_SET(RL_MII_CLK);
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void rl_mii_send(sc, bits, cnt)
- struct rl_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- MII_CLR(RL_MII_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- MII_SET(RL_MII_DATAOUT);
- } else {
- MII_CLR(RL_MII_DATAOUT);
- }
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int rl_mii_readreg(sc, frame)
- struct rl_softc *sc;
- struct rl_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = RL_MII_STARTDELIM;
- frame->mii_opcode = RL_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_2(sc, RL_MII, 0);
-
- /*
- * Turn on data xmit.
- */
- MII_SET(RL_MII_DIR);
-
- rl_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- rl_mii_send(sc, frame->mii_stdelim, 2);
- rl_mii_send(sc, frame->mii_opcode, 2);
- rl_mii_send(sc, frame->mii_phyaddr, 5);
- rl_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- MII_CLR((RL_MII_CLK|RL_MII_DATAOUT));
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- MII_CLR(RL_MII_DIR);
-
- /* Check for ack */
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
- ack = CSR_READ_2(sc, RL_MII) & RL_MII_DATAIN;
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_2(sc, RL_MII) & RL_MII_DATAIN)
- frame->mii_data |= i;
- DELAY(1);
- }
- MII_SET(RL_MII_CLK);
- DELAY(1);
- }
-
-fail:
-
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int rl_mii_writereg(sc, frame)
- struct rl_softc *sc;
- struct rl_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = RL_MII_STARTDELIM;
- frame->mii_opcode = RL_MII_WRITEOP;
- frame->mii_turnaround = RL_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- MII_SET(RL_MII_DIR);
-
- rl_mii_sync(sc);
-
- rl_mii_send(sc, frame->mii_stdelim, 2);
- rl_mii_send(sc, frame->mii_opcode, 2);
- rl_mii_send(sc, frame->mii_phyaddr, 5);
- rl_mii_send(sc, frame->mii_regaddr, 5);
- rl_mii_send(sc, frame->mii_turnaround, 2);
- rl_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- MII_SET(RL_MII_CLK);
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- MII_CLR(RL_MII_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t rl_phy_readreg(sc, reg)
- struct rl_softc *sc;
- int reg;
-{
- struct rl_mii_frame frame;
- u_int16_t rval = 0;
- u_int16_t rl8139_reg = 0;
-
- if (sc->rl_type == RL_8139) {
- switch(reg) {
- case PHY_BMCR:
- rl8139_reg = RL_BMCR;
- break;
- case PHY_BMSR:
- rl8139_reg = RL_BMSR;
- break;
- case PHY_ANAR:
- rl8139_reg = RL_ANAR;
- break;
- case PHY_LPAR:
- rl8139_reg = RL_LPAR;
- break;
- default:
- printf("rl%d: bad phy register\n", sc->rl_unit);
- return(0);
- }
- rval = CSR_READ_2(sc, rl8139_reg);
- return(rval);
- }
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->rl_phy_addr;
- frame.mii_regaddr = reg;
- rl_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void rl_phy_writereg(sc, reg, data)
- struct rl_softc *sc;
- int reg;
- int data;
-{
- struct rl_mii_frame frame;
- u_int16_t rl8139_reg = 0;
-
- if (sc->rl_type == RL_8139) {
- switch(reg) {
- case PHY_BMCR:
- rl8139_reg = RL_BMCR;
- break;
- case PHY_BMSR:
- rl8139_reg = RL_BMSR;
- break;
- case PHY_ANAR:
- rl8139_reg = RL_ANAR;
- break;
- case PHY_LPAR:
- rl8139_reg = RL_LPAR;
- break;
- default:
- printf("rl%d: bad phy register\n", sc->rl_unit);
- return;
- }
- CSR_WRITE_2(sc, rl8139_reg, data);
- return;
- }
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->rl_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- rl_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int8_t rl_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return(crc & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void rl_setmulti(sc)
- struct rl_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, RL_RXCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI) {
- rxfilt |= RL_RXCFG_RX_MULTI;
- CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
- CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, RL_MAR0, 0);
- CSR_WRITE_4(sc, RL_MAR4, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = rl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= RL_RXCFG_RX_MULTI;
- else
- rxfilt &= ~RL_RXCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
- CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
- CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void rl_autoneg_xmit(sc)
- struct rl_softc *sc;
-{
- u_int16_t phy_sts;
-
- rl_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(rl_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = rl_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- rl_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY. Also used with the 8139 internal
- * transceiver.
- */
-static void rl_autoneg_mii(sc, flag, verbose)
- struct rl_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- /*
- * The 100baseT4 PHY sometimes has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = rl_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("rl%d: autonegotiation not supported\n",
- sc->rl_unit);
- return;
- }
-#endif
-
- switch (flag) {
- case RL_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- rl_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case RL_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise rl_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->rl_cdata.rl_tx_cnt) {
- sc->rl_want_auto = 1;
- return;
- }
- rl_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->rl_autoneg = 1;
- sc->rl_want_auto = 0;
- return;
- break;
- case RL_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->rl_autoneg = 0;
- break;
- default:
- printf("rl%d: invalid autoneg flag: %d\n", sc->rl_unit, flag);
- return;
- }
-
- if (rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("rl%d: autoneg complete, ", sc->rl_unit);
- phy_sts = rl_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("rl%d: autoneg not complete, ", sc->rl_unit);
- }
-
- media = rl_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = rl_phy_readreg(sc, PHY_ANAR);
- ability = rl_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- /* Set ASIC's duplex mode to match the PHY. */
- rl_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- rl_init(sc);
-
- if (sc->rl_tx_pend) {
- sc->rl_autoneg = 0;
- sc->rl_tx_pend = 0;
- rl_start(ifp);
- }
-
- return;
-}
-
-static void rl_getmode_mii(sc)
- struct rl_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = rl_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("rl%d: PHY status word: %x\n", sc->rl_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("rl%d: 10Mbps half-duplex mode supported\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("rl%d: 10Mbps full-duplex mode supported\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("rl%d: 100Mbps half-duplex mode supported\n",
- sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("rl%d: 100Mbps full-duplex mode supported\n",
- sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("rl%d: 100baseT4 mode supported\n", sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("rl%d: forcing on autoneg support for BT4\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("rl%d: autoneg supported\n", sc->rl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void rl_setmode_mii(sc, media)
- struct rl_softc *sc;
- int media;
-{
- u_int16_t bmcr;
-
- printf("rl%d: selecting MII, ", sc->rl_unit);
-
- bmcr = rl_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- rl_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-static void rl_reset(sc)
- struct rl_softc *sc;
-{
- register int i;
-
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RESET);
-
- for (i = 0; i < RL_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_1(sc, RL_COMMAND) & RL_CMD_RESET))
- break;
- }
- if (i == RL_TIMEOUT)
- printf("rl%d: reset never completed!\n", sc->rl_unit);
-
- return;
-}
-
-/*
- * Probe for a RealTek 8129/8139 chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-rl_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct rl_type *t;
-
- t = rl_devs;
-
- while(t->rl_name != NULL) {
- if ((device_id & 0xFFFF) == t->rl_vid &&
- ((device_id >> 16) & 0xFFFF) == t->rl_did) {
- return(t->rl_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-rl_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef RL_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct rl_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- struct rl_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
- u_int16_t rl_did = 0;
-
- s = splimp();
-
- sc = malloc(sizeof(struct rl_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("rl%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct rl_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, RL_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, RL_PCI_PWRMGMTCTRL);
- if (command & RL_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, RL_PCI_LOIO);
- membase = pci_conf_read(config_id, RL_PCI_LOMEM);
- irq = pci_conf_read(config_id, RL_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("rl%d: chip is is in D%d power mode "
- "-- setting to D0\n", unit, command & RL_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, RL_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, RL_PCI_LOIO, iobase);
- pci_conf_write(config_id, RL_PCI_LOMEM, membase);
- pci_conf_write(config_id, RL_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef RL_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("rl%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, RL_PCI_LOIO,
- (u_int16_t *)&(sc->rl_bhandle))) {
- printf ("rl%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->rl_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("rl%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, RL_PCI_LOMEM, &vbase, &pbase)) {
- printf ("rl%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->rl_btag = I386_BUS_SPACE_MEM;
- sc->rl_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, rl_intr, sc, &net_imask)) {
- printf("rl%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- rl_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- rl_read_eeprom(sc, (caddr_t)&eaddr, RL_EE_EADDR, 3, 0);
-
- /*
- * A RealTek chip was detected. Inform the world.
- */
- printf("rl%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->rl_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- /*
- * Now read the exact device type from the EEPROM to find
- * out if it's an 8129 or 8139.
- */
- rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0);
-
- if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030)
- sc->rl_type = RL_8139;
- else if (rl_did == RT_DEVICEID_8129)
- sc->rl_type = RL_8129;
- else {
- printf("rl%d: unknown device ID: %x\n", unit, rl_did);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- sc->rl_cdata.rl_rx_buf = contigmalloc(RL_RXBUFLEN + 16, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
-
- if (sc->rl_cdata.rl_rx_buf == NULL) {
- free(sc, M_DEVBUF);
- printf("rl%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "rl";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = rl_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = rl_start;
- ifp->if_watchdog = rl_watchdog;
- ifp->if_init = rl_init;
- ifp->if_baudrate = 10000000;
-
- if (sc->rl_type == RL_8129) {
- if (bootverbose)
- printf("rl%d: probing for a PHY\n", sc->rl_unit);
- for (i = RL_PHYADDR_MIN; i < RL_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("rl%d: checking address: %d\n",
- sc->rl_unit, i);
- sc->rl_phy_addr = i;
- rl_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(rl_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = rl_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = rl_phy_readreg(sc, PHY_VENID);
- phy_did = rl_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("rl%d: found PHY at address %d, ",
- sc->rl_unit, sc->rl_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = rl_phys;
- while(p->rl_vid) {
- if (phy_vid == p->rl_vid &&
- (phy_did | 0x000F) == p->rl_did) {
- sc->rl_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->rl_pinfo == NULL)
- sc->rl_pinfo = &rl_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("rl%d: PHY type: %s\n",
- sc->rl_unit, sc->rl_pinfo->rl_name);
- } else {
- printf("rl%d: MII without any phy!\n", sc->rl_unit);
- }
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, rl_ifmedia_upd, rl_ifmedia_sts);
-
- rl_getmode_mii(sc);
-
- /* Choose a default media. */
- media = IFM_ETHER|IFM_AUTO;
- ifmedia_set(&sc->ifmedia, media);
-
- rl_autoneg_mii(sc, RL_FLAG_FORCEDELAY, 1);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(rl_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int rl_list_tx_init(sc)
- struct rl_softc *sc;
-{
- struct rl_chain_data *cd;
- int i;
-
- cd = &sc->rl_cdata;
- for (i = 0; i < RL_TX_LIST_CNT; i++) {
- cd->rl_tx_chain[i].rl_desc = i * 4;
- CSR_WRITE_4(sc, RL_TXADDR0 + cd->rl_tx_chain[i].rl_desc, 0);
- CSR_WRITE_4(sc, RL_TXSTAT0 + cd->rl_tx_chain[i].rl_desc, 0);
- if (i == (RL_TX_LIST_CNT - 1))
- cd->rl_tx_chain[i].rl_next = &cd->rl_tx_chain[0];
- else
- cd->rl_tx_chain[i].rl_next = &cd->rl_tx_chain[i + 1];
- }
-
- sc->rl_cdata.rl_tx_cnt = 0;
- cd->rl_tx_cur = cd->rl_tx_free = &cd->rl_tx_chain[0];
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- *
- * You know there's something wrong with a PCI bus-master chip design
- * when you have to use m_devget().
- *
- * The receive operation is badly documented in the datasheet, so I'll
- * attempt to document it here. The driver provides a buffer area and
- * places its base address in the RX buffer start address register.
- * The chip then begins copying frames into the RX buffer. Each frame
- * is preceeded by a 32-bit RX status word which specifies the length
- * of the frame and certain other status bits. Each frame (starting with
- * the status word) is also 32-bit aligned. The frame length is in the
- * first 16 bits of the status word; the lower 15 bits correspond with
- * the 'rx status register' mentioned in the datasheet.
- */
-static void rl_rxeof(sc)
- struct rl_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- int total_len = 0;
- u_int32_t rxstat;
- caddr_t rxbufpos;
- int wrap = 0;
- u_int16_t cur_rx;
- u_int16_t limit;
- u_int16_t rx_bytes = 0, max_bytes;
-
- ifp = &sc->arpcom.ac_if;
-
- cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN;
-
- /* Do not try to read past this point. */
- limit = CSR_READ_2(sc, RL_CURRXBUF) % RL_RXBUFLEN;
-
- if (limit < cur_rx)
- max_bytes = (RL_RXBUFLEN - cur_rx) + limit;
- else
- max_bytes = limit - cur_rx;
-
- while((CSR_READ_1(sc, RL_COMMAND) & RL_CMD_EMPTY_RXBUF) == 0) {
- rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx;
- rxstat = *(u_int32_t *)rxbufpos;
-
- /*
- * Here's a totally undocumented fact for you. When the
- * RealTek chip is in the process of copying a packet into
- * RAM for you, the length will be 0xfff0. If you spot a
- * packet header with this value, you need to stop. The
- * datasheet makes absolutely no mention of this and
- * RealTek should be shot for this.
- */
- if ((u_int16_t)(rxstat >> 16) == RL_RXSTAT_UNFINISHED)
- break;
-
- if (!(rxstat & RL_RXSTAT_RXOK)) {
- ifp->if_ierrors++;
- if (rxstat & (RL_RXSTAT_BADSYM|RL_RXSTAT_RUNT|
- RL_RXSTAT_GIANT|RL_RXSTAT_CRCERR|
- RL_RXSTAT_ALIGNERR)) {
- CSR_WRITE_2(sc, RL_COMMAND, RL_CMD_TX_ENB);
- CSR_WRITE_2(sc, RL_COMMAND, RL_CMD_TX_ENB|
- RL_CMD_RX_ENB);
- CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG);
- CSR_WRITE_4(sc, RL_RXADDR,
- vtophys(sc->rl_cdata.rl_rx_buf));
- CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16);
- cur_rx = 0;
- }
- break;
- }
-
- /* No errors; receive the packet. */
- total_len = rxstat >> 16;
- rx_bytes += total_len + 4;
-
- /*
- * XXX The RealTek chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Avoid trying to read more bytes than we know
- * the chip has prepared for us.
- */
- if (rx_bytes > max_bytes)
- break;
-
- rxbufpos = sc->rl_cdata.rl_rx_buf +
- ((cur_rx + sizeof(u_int32_t)) % RL_RXBUFLEN);
-
- if (rxbufpos == (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN))
- rxbufpos = sc->rl_cdata.rl_rx_buf;
-
- wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos;
-
- if (total_len > wrap) {
- m = m_devget(rxbufpos, wrap, 0, ifp, NULL);
- if (m == NULL) {
- ifp->if_ierrors++;
- printf("rl%d: out of mbufs, tried to "
- "copy %d bytes\n", sc->rl_unit, wrap);
- }
- else
- m_copyback(m, wrap, total_len - wrap,
- sc->rl_cdata.rl_rx_buf);
- cur_rx = (total_len - wrap + ETHER_CRC_LEN);
- } else {
- m = m_devget(rxbufpos, total_len, 0, ifp, NULL);
- if (m == NULL) {
- ifp->if_ierrors++;
- printf("rl%d: out of mbufs, tried to "
- "copy %d bytes\n", sc->rl_unit, total_len);
- }
- cur_rx += total_len + 4 + ETHER_CRC_LEN;
- }
-
- /*
- * Round up to 32-bit boundary.
- */
- cur_rx = (cur_rx + 3) & ~3;
- CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16);
-
- if (m == NULL)
- continue;
-
- eh = mtod(m, struct ether_header *);
- ifp->if_ipackets++;
-
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-static void rl_txeof(sc)
- struct rl_softc *sc;
-{
- struct rl_chain *cur_tx;
- struct ifnet *ifp;
- u_int32_t txstat;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been uploaded.
- */
- if (sc->rl_cdata.rl_tx_free == NULL)
- return;
-
- while(sc->rl_cdata.rl_tx_free->rl_mbuf != NULL) {
- cur_tx = sc->rl_cdata.rl_tx_free;
- txstat = CSR_READ_4(sc, RL_TXSTAT0 + cur_tx->rl_desc);
-
- if (!(txstat & RL_TXSTAT_TX_OK))
- break;
-
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
-
- sc->rl_cdata.rl_tx_free = cur_tx->rl_next;
-
- sc->rl_cdata.rl_tx_cnt--;
- m_freem(cur_tx->rl_mbuf);
- cur_tx->rl_mbuf = NULL;
- ifp->if_opackets++;
- }
-
- if (!sc->rl_cdata.rl_tx_cnt) {
- ifp->if_flags &= ~IFF_OACTIVE;
- if (sc->rl_want_auto)
- rl_autoneg_mii(sc, RL_FLAG_SCHEDDELAY, 1);
- } else {
- if (ifp->if_snd.ifq_head != NULL)
- rl_start(ifp);
- }
-
- return;
-}
-
-/*
- * TX error handler.
- */
-static void rl_txeoc(sc)
- struct rl_softc *sc;
-{
- u_int32_t txstat;
- struct rl_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- if (sc->rl_cdata.rl_tx_free == NULL)
- return;
-
- while(sc->rl_cdata.rl_tx_free->rl_mbuf != NULL) {
- cur_tx = sc->rl_cdata.rl_tx_free;
- txstat = CSR_READ_4(sc, RL_TXSTAT0 + cur_tx->rl_desc);
-
- if (!(txstat & RL_TXSTAT_OWN))
- break;
-
- if (!(txstat & RL_TXSTAT_TX_OK)) {
- ifp->if_oerrors++;
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
- CSR_WRITE_4(sc, RL_TXADDR0 + cur_tx->rl_desc,
- vtophys(mtod(cur_tx->rl_mbuf, caddr_t)));
- CSR_WRITE_4(sc, RL_TXSTAT0 + cur_tx->rl_desc,
- RL_TX_EARLYTHRESH |
- cur_tx->rl_mbuf->m_pkthdr.len);
- break;
- } else {
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
- sc->rl_cdata.rl_tx_free = cur_tx->rl_next;
-
- sc->rl_cdata.rl_tx_cnt--;
- m_freem(cur_tx->rl_mbuf);
- cur_tx->rl_mbuf = NULL;
- ifp->if_opackets++;
- }
- }
-
- return;
-}
-
-static void rl_intr(arg)
- void *arg;
-{
- struct rl_softc *sc;
- struct ifnet *ifp;
- u_int16_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Disable interrupts. */
- CSR_WRITE_2(sc, RL_IMR, 0x0000);
-
- for (;;) {
-
- status = CSR_READ_2(sc, RL_ISR);
- if (status)
- CSR_WRITE_2(sc, RL_ISR, status);
-
- if ((status & RL_INTRS) == 0)
- break;
-
- if (status & RL_ISR_RX_OK)
- rl_rxeof(sc);
-
- if (status & RL_ISR_RX_ERR)
- rl_rxeof(sc);
-
- if (status & RL_ISR_TX_OK)
- rl_txeof(sc);
-
- if (status & RL_ISR_TX_ERR)
- rl_txeoc(sc);
-
- if (status & RL_ISR_SYSTEM_ERR) {
- rl_reset(sc);
- rl_init(sc);
- }
-
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- rl_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int rl_encap(sc, c, m_head)
- struct rl_softc *sc;
- struct rl_chain *c;
- struct mbuf *m_head;
-{
- struct mbuf *m;
- struct mbuf *m_new = NULL;
-
- /*
- * There are two possible encapsulation mechanisms
- * that we can use: an efficient one, and a very lossy
- * one. The efficient one only happens very rarely,
- * whereas the lossy one can and most likely will happen
- * all the time.
- * The efficient case happens if:
- * - the packet fits in a single mbuf
- * - the packet is 32-bit aligned within the mbuf data area
- * In this case, we can DMA from the mbuf directly.
- * The lossy case covers everything else. Bah.
- */
-
- m = m_head;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("rl%d: no memory for tx list", sc->rl_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("rl%d: no memory for tx list",
- sc->rl_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
-
- /* Pad frames to at least 60 bytes. */
- if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) {
- m_head->m_pkthdr.len +=
- (RL_MIN_FRAMELEN - m_head->m_pkthdr.len);
- m_head->m_len = m_head->m_pkthdr.len;
- }
-
- c->rl_mbuf = m_head;
-
- return(0);
-}
-
-/*
- * Main transmit routine.
- */
-
-static void rl_start(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
- struct mbuf *m_head = NULL;
- struct rl_chain *cur_tx = NULL;
-
- sc = ifp->if_softc;
-
- if (sc->rl_autoneg) {
- sc->rl_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->rl_cdata.rl_tx_cur->rl_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- while(sc->rl_cdata.rl_tx_cur->rl_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->rl_cdata.rl_tx_cur;
- sc->rl_cdata.rl_tx_cur = cur_tx->rl_next;
- sc->rl_cdata.rl_tx_cnt++;
-
- /* Pack the data into the descriptor. */
- rl_encap(sc, cur_tx, m_head);
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->rl_mbuf);
-#endif
- /*
- * Transmit the frame.
- */
- CSR_WRITE_4(sc, RL_TXADDR0 + cur_tx->rl_desc,
- vtophys(mtod(cur_tx->rl_mbuf, caddr_t)));
- CSR_WRITE_4(sc, RL_TXSTAT0 + cur_tx->rl_desc,
- RL_TX_EARLYTHRESH | cur_tx->rl_mbuf->m_pkthdr.len);
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void rl_init(xsc)
- void *xsc;
-{
- struct rl_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int s, i;
- u_int32_t rxcfg = 0;
- u_int16_t phy_bmcr = 0;
-
- if (sc->rl_autoneg)
- return;
-
- s = splimp();
-
- /*
- * XXX Hack for the 8139: the built-in autoneg logic's state
- * gets reset by rl_init() when we don't want it to. Try
- * to preserve it. (For 8129 cards with real external PHYs,
- * the BMCR register doesn't change, but this doesn't hurt.)
- */
- if (sc->rl_type == RL_8139)
- phy_bmcr = rl_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- rl_stop(sc);
-
- /* Init our MAC address */
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, RL_IDR0 + i, sc->arpcom.ac_enaddr[i]);
- }
-
- /* Init the RX buffer pointer register. */
- CSR_WRITE_4(sc, RL_RXADDR, vtophys(sc->rl_cdata.rl_rx_buf));
-
- /* Init TX descriptors. */
- rl_list_tx_init(sc);
-
- /*
- * Enable transmit and receive.
- */
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB);
-
- /*
- * Set the buffer size values.
- */
- CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG);
-
- /* Set the individual bit to receive frames for this host only. */
- rxcfg = CSR_READ_4(sc, RL_RXCFG);
- rxcfg |= RL_RXCFG_RX_INDIV;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- rxcfg |= RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
- rxcfg &= ~RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
-
- /*
- * Set capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- rxcfg |= RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
- rxcfg &= ~RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
-
- /*
- * Program the multicast filter, if necessary.
- */
- rl_setmulti(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
-
- /* Start RX/TX process. */
- CSR_WRITE_4(sc, RL_MISSEDPKT, 0);
-
- /* Enable receiver and transmitter. */
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB);
-
- /* Restore state of BMCR */
- if (sc->rl_pinfo != NULL)
- rl_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int rl_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- rl_autoneg_mii(sc, RL_FLAG_SCHEDDELAY, 1);
- else
- rl_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void rl_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct rl_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- if (!(rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
-
- if (rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = rl_phy_readreg(sc, PHY_LPAR);
- advert = rl_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int rl_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct rl_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- rl_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- rl_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- rl_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void rl_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->rl_autoneg) {
- rl_autoneg_mii(sc, RL_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- printf("rl%d: watchdog timeout\n", sc->rl_unit);
- ifp->if_oerrors++;
- if (!(rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("rl%d: no carrier - transceiver cable problem?\n",
- sc->rl_unit);
- rl_txeoc(sc);
- rl_txeof(sc);
- rl_rxeof(sc);
- rl_init(sc);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void rl_stop(sc)
- struct rl_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- CSR_WRITE_1(sc, RL_COMMAND, 0x00);
- CSR_WRITE_2(sc, RL_IMR, 0x0000);
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < RL_TX_LIST_CNT; i++) {
- if (sc->rl_cdata.rl_tx_chain[i].rl_mbuf != NULL) {
- m_freem(sc->rl_cdata.rl_tx_chain[i].rl_mbuf);
- sc->rl_cdata.rl_tx_chain[i].rl_mbuf = NULL;
- CSR_WRITE_4(sc, RL_TXADDR0 +
- sc->rl_cdata.rl_tx_chain[i].rl_desc, 0x00000000);
- }
- }
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void rl_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct rl_softc *sc = (struct rl_softc *)arg;
-
- rl_stop(sc);
-
- return;
-}
-
-
-static struct pci_device rl_device = {
- "rl",
- rl_probe,
- rl_attach,
- &rl_count,
- NULL
-};
-DATA_SET(pcidevice_set, rl_device);
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
deleted file mode 100644
index 5263b5a82052..000000000000
--- a/sys/pci/if_rlreg.h
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_rlreg.h,v 1.14 1998/12/07 00:16:44 wpaul Exp $
- */
-
-/*
- * RealTek 8129/8139 register offsets
- */
-#define RL_IDR0 0x0000 /* ID register 0 (station addr) */
-#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */
-#define RL_IDR2 0x0002
-#define RL_IDR3 0x0003
-#define RL_IDR4 0x0004
-#define RL_IDR5 0x0005
- /* 0006-0007 reserved */
-#define RL_MAR0 0x0008 /* Multicast hash table */
-#define RL_MAR1 0x0009
-#define RL_MAR2 0x000A
-#define RL_MAR3 0x000B
-#define RL_MAR4 0x000C
-#define RL_MAR5 0x000D
-#define RL_MAR6 0x000E
-#define RL_MAR7 0x000F
-
-#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */
-#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */
-#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */
-#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */
-
-#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */
-#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */
-#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */
-#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */
-
-#define RL_RXADDR 0x0030 /* RX ring start address */
-#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */
-#define RL_RX_EARLY_STAT 0x0036 /* RX early status */
-#define RL_COMMAND 0x0037 /* command register */
-#define RL_CURRXADDR 0x0038 /* current address of packet read */
-#define RL_CURRXBUF 0x003A /* current RX buffer address */
-#define RL_IMR 0x003C /* interrupt mask register */
-#define RL_ISR 0x003E /* interrupt status register */
-#define RL_TXCFG 0x0040 /* transmit config */
-#define RL_RXCFG 0x0044 /* receive config */
-#define RL_TIMERCNT 0x0048 /* timer count register */
-#define RL_MISSEDPKT 0x004C /* missed packet counter */
-#define RL_EECMD 0x0050 /* EEPROM command register */
-#define RL_CFG0 0x0051 /* config register #0 */
-#define RL_CFG1 0x0052 /* config register #1 */
- /* 0053-0057 reserved */
-#define RL_MEDIASTAT 0x0058 /* media status register (8139) */
- /* 0059-005A reserved */
-#define RL_MII 0x005A /* 8129 chip only */
-#define RL_HALTCLK 0x005B
-#define RL_MULTIINTR 0x005C /* multiple interrupt */
-#define RL_PCIREV 0x005E /* PCI revision value */
- /* 005F reserved */
-#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */
-
-/* Direct PHY access registers only available on 8139 */
-#define RL_BMCR 0x0062 /* PHY basic mode control */
-#define RL_BMSR 0x0064 /* PHY basic mode status */
-#define RL_ANAR 0x0066 /* PHY autoneg advert */
-#define RL_LPAR 0x0068 /* PHY link partner ability */
-#define RL_ANER 0x006A /* PHY autoneg expansion */
-
-#define RL_DISCCNT 0x006C /* disconnect counter */
-#define RL_FALSECAR 0x006E /* false carrier counter */
-#define RL_NWAYTST 0x0070 /* NWAY test register */
-#define RL_RX_ER 0x0072 /* RX_ER counter */
-#define RL_CSCFG 0x0074 /* CS configuration register */
-
-
-/*
- * TX config register bits
- */
-#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */
-#define RL_TXCFG_MXDMA0 0x00000100 /* max DMA burst size */
-#define RL_TXCFG_MXDMA1 0x00000200
-#define RL_TXCFG_MXDMA2 0x00000400
-#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */
-#define RL_TXCFG_LOOPBKTST0 0x00020000 /* loopback test */
-#define RL_TXCFG_LOOPBKTST1 0x00040000 /* loopback test */
-#define RL_TXCFG_IFG0 0x01000000 /* interframe gap */
-#define RL_TXCFG_IFG1 0x02000000 /* interframe gap */
-
-/*
- * Transmit descriptor status register bits.
- */
-#define RL_TXSTAT_LENMASK 0x00001FFF
-#define RL_TXSTAT_OWN 0x00002000
-#define RL_TXSTAT_TX_UNDERRUN 0x00004000
-#define RL_TXSTAT_TX_OK 0x00008000
-#define RL_TXSTAT_EARLY_THRESH 0x003F0000
-#define RL_TXSTAT_COLLCNT 0x0F000000
-#define RL_TXSTAT_CARR_HBEAT 0x10000000
-#define RL_TXSTAT_OUTOFWIN 0x20000000
-#define RL_TXSTAT_TXABRT 0x40000000
-#define RL_TXSTAT_CARRLOSS 0x80000000
-
-/*
- * Interrupt status register bits.
- */
-#define RL_ISR_RX_OK 0x0001
-#define RL_ISR_RX_ERR 0x0002
-#define RL_ISR_TX_OK 0x0004
-#define RL_ISR_TX_ERR 0x0008
-#define RL_ISR_RX_OVERRUN 0x0010
-#define RL_ISR_PKT_UNDERRUN 0x0020
-#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */
-#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */
-#define RL_ISR_SYSTEM_ERR 0x8000
-
-#define RL_INTRS \
- (RL_ISR_TX_OK|RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \
- RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \
- RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR)
-
-/*
- * Media status register. (8139 only)
- */
-#define RL_MEDIASTAT_RXPAUSE 0x01
-#define RL_MEDIASTAT_TXPAUSE 0x02
-#define RL_MEDIASTAT_LINK 0x04
-#define RL_MEDIASTAT_SPEED10 0x08
-#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */
-#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */
-
-/*
- * Receive config register.
- */
-#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */
-#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */
-#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */
-#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */
-#define RL_RXCFG_RX_RUNT 0x00000010
-#define RL_RXCFG_RX_ERRPKT 0x00000020
-#define RL_RXCFG_WRAP 0x00000080
-#define RL_RXCFG_MAXDMA (0x00000100|0x00000200|0x00000400)
-#define RL_RXCFG_BUFSZ (0x00000800|0x00001000)
-#define RL_RXCFG_FIFOTHRESH (0x00002000|0x00004000|0x00008000)
-#define RL_RXCFG_EARLYTHRESH (0x01000000|0x02000000|0x04000000)
-
-#define RL_RXBUF_8 0x00000000
-#define RL_RXBUF_16 0x00000800
-#define RL_RXBUF_32 0x00001000
-#define RL_RXBUF_64 (0x00001000|0x00000800)
-
-/*
- * Bits in RX status header (included with RX'ed packet
- * in ring buffer).
- */
-#define RL_RXSTAT_RXOK 0x00000001
-#define RL_RXSTAT_ALIGNERR 0x00000002
-#define RL_RXSTAT_CRCERR 0x00000004
-#define RL_RXSTAT_GIANT 0x00000008
-#define RL_RXSTAT_RUNT 0x00000010
-#define RL_RXSTAT_BADSYM 0x00000020
-#define RL_RXSTAT_BROAD 0x00002000
-#define RL_RXSTAT_INDIV 0x00004000
-#define RL_RXSTAT_MULTI 0x00008000
-#define RL_RXSTAT_LENMASK 0xFFFF0000
-
-#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */
-/*
- * Command register.
- */
-#define RL_CMD_EMPTY_RXBUF 0x0001
-#define RL_CMD_TX_ENB 0x0004
-#define RL_CMD_RX_ENB 0x0008
-#define RL_CMD_RESET 0x0010
-
-/*
- * EEPROM control register
- */
-#define RL_EE_DATAOUT 0x01 /* Data out */
-#define RL_EE_DATAIN 0x02 /* Data in */
-#define RL_EE_CLK 0x04 /* clock */
-#define RL_EE_SEL 0x08 /* chip select */
-#define RL_EE_MODE (0x40|0x80)
-
-#define RL_EEMODE_OFF 0x00
-#define RL_EEMODE_AUTOLOAD 0x40
-#define RL_EEMODE_PROGRAM 0x80
-#define RL_EEMODE_WRITECFG (0x80|0x40)
-
-/* 9346 EEPROM commands */
-#define RL_EECMD_WRITE 0x140
-#define RL_EECMD_READ 0x180
-#define RL_EECMD_ERASE 0x1c0
-
-#define RL_EE_ID 0x00
-#define RL_EE_PCI_VID 0x01
-#define RL_EE_PCI_DID 0x02
-/* Location of station address inside EEPROM */
-#define RL_EE_EADDR 0x07
-
-/*
- * MII register (8129 only)
- */
-#define RL_MII_CLK 0x01
-#define RL_MII_DATAIN 0x02
-#define RL_MII_DATAOUT 0x04
-#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */
-
-/*
- * Config 0 register
- */
-#define RL_CFG0_ROM0 0x01
-#define RL_CFG0_ROM1 0x02
-#define RL_CFG0_ROM2 0x04
-#define RL_CFG0_PL0 0x08
-#define RL_CFG0_PL1 0x10
-#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */
-#define RL_CFG0_PCS 0x40
-#define RL_CFG0_SCR 0x80
-
-/*
- * Config 1 register
- */
-#define RL_CFG1_PWRDWN 0x01
-#define RL_CFG1_SLEEP 0x02
-#define RL_CFG1_IOMAP 0x04
-#define RL_CFG1_MEMMAP 0x08
-#define RL_CFG1_RSVD 0x10
-#define RL_CFG1_DRVLOAD 0x20
-#define RL_CFG1_LED0 0x40
-#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */
-#define RL_CFG1_LED1 0x80
-
-/*
- * The RealTek doesn't use a fragment-based descriptor mechanism.
- * Instead, there are only four register sets, each or which represents
- * one 'descriptor.' Basically, each TX descriptor is just a contiguous
- * packet buffer (32-bit aligned!) and we place the buffer addresses in
- * the registers so the chip knows where they are.
- *
- * We can sort of kludge together the same kind of buffer management
- * used in previous drivers, but we have to do buffer copies almost all
- * the time, so it doesn't really buy us much.
- *
- * For reception, there's just one large buffer where the chip stores
- * all received packets.
- */
-
-#define RL_RX_BUF_SZ RL_RXBUF_64
-#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13))
-#define RL_TX_LIST_CNT 4
-#define RL_MIN_FRAMELEN 60
-#define RL_TX_EARLYTHRESH 0x80000 /* 256 << 11 */
-#define RL_RX_FIFOTHRESH 0x8000 /* 4 << 13 */
-#define RL_RX_MAXDMA 0x00000400
-
-#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_BUF_SZ)
-
-struct rl_chain {
- char rl_desc; /* descriptor register idx */
- struct mbuf *rl_mbuf;
- struct rl_chain *rl_next;
-};
-
-struct rl_chain_data {
- u_int16_t cur_rx;
- caddr_t rl_rx_buf;
- struct rl_chain rl_tx_chain[RL_TX_LIST_CNT];
-
- int rl_tx_cnt;
- struct rl_chain *rl_tx_cur;
- struct rl_chain *rl_tx_free;
-};
-
-struct rl_type {
- u_int16_t rl_vid;
- u_int16_t rl_did;
- char *rl_name;
-};
-
-struct rl_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define RL_MII_STARTDELIM 0x01
-#define RL_MII_READOP 0x02
-#define RL_MII_WRITEOP 0x01
-#define RL_MII_TURNAROUND 0x02
-
-#define RL_FLAG_FORCEDELAY 1
-#define RL_FLAG_SCHEDDELAY 2
-#define RL_FLAG_DELAYTIMEO 3
-
-#define RL_8129 1
-#define RL_8139 2
-
-struct rl_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t rl_bhandle; /* bus space handle */
- bus_space_tag_t rl_btag; /* bus space tag */
- struct rl_type *rl_pinfo; /* phy info */
- u_int8_t rl_unit; /* interface number */
- u_int8_t rl_type;
- u_int8_t rl_phy_addr; /* PHY address */
- u_int8_t rl_tx_pend; /* TX pending */
- u_int8_t rl_want_auto;
- u_int8_t rl_autoneg;
- u_int8_t rl_stats_no_timeout;
- struct rl_chain_data rl_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->rl_btag, sc->rl_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->rl_btag, sc->rl_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->rl_btag, sc->rl_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->rl_btag, sc->rl_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->rl_btag, sc->rl_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->rl_btag, sc->rl_bhandle, reg)
-
-#define RL_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * RealTek PCI vendor ID
- */
-#define RT_VENDORID 0x10EC
-
-/*
- * Accton PCI vendor ID
- */
-#define ACCTON_VENDORID 0x1113
-
-/*
- * RealTek chip device IDs.
- */
-#define RT_DEVICEID_8129 0x8129
-#define RT_DEVICEID_8139 0x8139
-
-/*
- * Accton MPX 5030/5038 device ID.
- */
-#define ACCTON_DEVICEID_5030 0x1211
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers. Note: some are only available on
- * the 3c905B, in particular those that related to power management.
- */
-
-#define RL_PCI_VENDOR_ID 0x00
-#define RL_PCI_DEVICE_ID 0x02
-#define RL_PCI_COMMAND 0x04
-#define RL_PCI_STATUS 0x06
-#define RL_PCI_CLASSCODE 0x09
-#define RL_PCI_LATENCY_TIMER 0x0D
-#define RL_PCI_HEADER_TYPE 0x0E
-#define RL_PCI_LOIO 0x10
-#define RL_PCI_LOMEM 0x14
-#define RL_PCI_BIOSROM 0x30
-#define RL_PCI_INTLINE 0x3C
-#define RL_PCI_INTPIN 0x3D
-#define RL_PCI_MINGNT 0x3E
-#define RL_PCI_MINLAT 0x0F
-#define RL_PCI_RESETOPT 0x48
-#define RL_PCI_EEPROM_DATA 0x4C
-
-#define RL_PCI_CAPID 0xDC /* 8 bits */
-#define RL_PCI_NEXTPTR 0xDD /* 8 bits */
-#define RL_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define RL_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define RL_PSTATE_MASK 0x0003
-#define RL_PSTATE_D0 0x0000
-#define RL_PSTATE_D1 0x0002
-#define RL_PSTATE_D2 0x0002
-#define RL_PSTATE_D3 0x0003
-#define RL_PME_EN 0x0010
-#define RL_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define RL_PHYADDR_MIN 0x00
-#define RL_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_sr_p.c b/sys/pci/if_sr_p.c
index 41a5ec3f2cbd..02a32e089f39 100644
--- a/sys/pci/if_sr_p.c
+++ b/sys/pci/if_sr_p.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_sr_p.c,v 1.6 1998/02/09 06:10:52 eivind Exp $
+ * $Id: if_sr_p.c,v 1.5 1997/09/02 20:06:27 bde Exp $
*/
#include "pci.h"
@@ -54,7 +54,7 @@ extern void *srattach_pci(int unit,
vm_offset_t sca_vaddr);
extern void srintr_hc(void *hc);
-static const char *sr_pci_probe(pcici_t tag, pcidi_t type);
+static char *sr_pci_probe(pcici_t tag, pcidi_t type);
static void sr_pci_attach(pcici_t config_id, int unit);
static u_long src_count = NSR;
@@ -69,7 +69,7 @@ static struct pci_device sr_pci_driver =
DATA_SET (pcidevice_set, sr_pci_driver);
-static const char *
+static char *
sr_pci_probe(pcici_t tag, pcidi_t type)
{
switch(type) {
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index b202fb5de8db..abf68c9e2b82 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_tl.c,v 1.23 1998/12/14 06:32:56 dillon Exp $
+ * $Id: if_tl.c,v 1.17 1998/10/04 18:47:38 wpaul Exp $
*/
/*
@@ -216,9 +216,9 @@
#include <pci/if_tlreg.h>
-#if !defined(lint)
-static const char rcsid[] =
- "$Id: if_tl.c,v 1.23 1998/12/14 06:32:56 dillon Exp $";
+#ifndef lint
+static char rcsid[] =
+ "$Id: if_tl.c,v 1.17 1998/10/04 18:47:38 wpaul Exp $";
#endif
#ifdef TL_DEBUG
@@ -316,7 +316,7 @@ static struct tl_type tl_phys[] = {
static unsigned long tl_count;
-static const char *tl_probe __P((pcici_t, pcidi_t));
+static char *tl_probe __P((pcici_t, pcidi_t));
static void tl_attach __P((pcici_t, int));
static int tl_attach_phy __P((struct tl_softc *));
static int tl_intvec_rxeoc __P((void *, u_int32_t));
@@ -342,9 +342,9 @@ static void tl_shutdown __P((int, void *));
static int tl_ifmedia_upd __P((struct ifnet *));
static void tl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-static u_int8_t tl_eeprom_putbyte __P((struct tl_softc *, int));
+static u_int8_t tl_eeprom_putbyte __P((struct tl_softc *, u_int8_t));
static u_int8_t tl_eeprom_getbyte __P((struct tl_softc *,
- int, u_int8_t *));
+ u_int8_t, u_int8_t *));
static int tl_read_eeprom __P((struct tl_softc *, caddr_t, int, int));
static void tl_mii_sync __P((struct tl_softc *));
@@ -352,57 +352,57 @@ static void tl_mii_send __P((struct tl_softc *, u_int32_t, int));
static int tl_mii_readreg __P((struct tl_softc *, struct tl_mii_frame *));
static int tl_mii_writereg __P((struct tl_softc *, struct tl_mii_frame *));
static u_int16_t tl_phy_readreg __P((struct tl_softc *, int));
-static void tl_phy_writereg __P((struct tl_softc *, int, int));
+static void tl_phy_writereg __P((struct tl_softc *, u_int16_t, u_int16_t));
static void tl_autoneg __P((struct tl_softc *, int, int));
static void tl_setmode __P((struct tl_softc *, int));
-static int tl_calchash __P((caddr_t));
+static int tl_calchash __P((unsigned char *));
static void tl_setmulti __P((struct tl_softc *));
-static void tl_setfilt __P((struct tl_softc *, caddr_t, int));
+static void tl_setfilt __P((struct tl_softc *, u_int8_t *, int));
static void tl_softreset __P((struct tl_softc *, int));
static void tl_hardreset __P((struct tl_softc *));
static int tl_list_rx_init __P((struct tl_softc *));
static int tl_list_tx_init __P((struct tl_softc *));
-static u_int8_t tl_dio_read8 __P((struct tl_softc *, int));
-static u_int16_t tl_dio_read16 __P((struct tl_softc *, int));
-static u_int32_t tl_dio_read32 __P((struct tl_softc *, int));
-static void tl_dio_write8 __P((struct tl_softc *, int, int));
-static void tl_dio_write16 __P((struct tl_softc *, int, int));
-static void tl_dio_write32 __P((struct tl_softc *, int, int));
-static void tl_dio_setbit __P((struct tl_softc *, int, int));
-static void tl_dio_clrbit __P((struct tl_softc *, int, int));
-static void tl_dio_setbit16 __P((struct tl_softc *, int, int));
-static void tl_dio_clrbit16 __P((struct tl_softc *, int, int));
+static u_int8_t tl_dio_read8 __P((struct tl_softc *, u_int8_t));
+static u_int16_t tl_dio_read16 __P((struct tl_softc *, u_int8_t));
+static u_int32_t tl_dio_read32 __P((struct tl_softc *, u_int8_t));
+static void tl_dio_write8 __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_write16 __P((struct tl_softc *, u_int8_t, u_int16_t));
+static void tl_dio_write32 __P((struct tl_softc *, u_int8_t, u_int32_t));
+static void tl_dio_setbit __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_clrbit __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_setbit16 __P((struct tl_softc *, u_int8_t, u_int16_t));
+static void tl_dio_clrbit16 __P((struct tl_softc *, u_int8_t, u_int16_t));
static u_int8_t tl_dio_read8(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_1(sc, TL_DIO_DATA + (reg & 3)));
}
static u_int16_t tl_dio_read16(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_2(sc, TL_DIO_DATA + (reg & 3)));
}
static u_int32_t tl_dio_read32(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_4(sc, TL_DIO_DATA + (reg & 3)));
}
static void tl_dio_write8(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_1(sc, TL_DIO_DATA + (reg & 3), val);
@@ -410,9 +410,9 @@ static void tl_dio_write8(sc, reg, val)
}
static void tl_dio_write16(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_2(sc, TL_DIO_DATA + (reg & 3), val);
@@ -420,9 +420,9 @@ static void tl_dio_write16(sc, reg, val)
}
static void tl_dio_write32(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int32_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_4(sc, TL_DIO_DATA + (reg & 3), val);
@@ -430,9 +430,9 @@ static void tl_dio_write32(sc, reg, val)
}
static void tl_dio_setbit(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t bit;
{
u_int8_t f;
@@ -445,9 +445,9 @@ static void tl_dio_setbit(sc, reg, bit)
}
static void tl_dio_clrbit(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t bit;
{
u_int8_t f;
@@ -460,9 +460,9 @@ static void tl_dio_clrbit(sc, reg, bit)
}
static void tl_dio_setbit16(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t bit;
{
u_int16_t f;
@@ -475,9 +475,9 @@ static void tl_dio_setbit16(sc, reg, bit)
}
static void tl_dio_clrbit16(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t bit;
{
u_int16_t f;
@@ -494,7 +494,7 @@ static void tl_dio_clrbit16(sc, reg, bit)
*/
static u_int8_t tl_eeprom_putbyte(sc, byte)
struct tl_softc *sc;
- int byte;
+ u_int8_t byte;
{
register int i, ack = 0;
@@ -538,7 +538,7 @@ static u_int8_t tl_eeprom_putbyte(sc, byte)
*/
static u_int8_t tl_eeprom_getbyte(sc, addr, dest)
struct tl_softc *sc;
- int addr;
+ u_int8_t addr;
u_int8_t *dest;
{
register int i;
@@ -827,8 +827,8 @@ static u_int16_t tl_phy_readreg(sc, reg)
static void tl_phy_writereg(sc, reg, data)
struct tl_softc *sc;
- int reg;
- int data;
+ u_int16_t reg;
+ u_int16_t data;
{
struct tl_mii_frame frame;
@@ -1145,7 +1145,7 @@ static void tl_setmode(sc, media)
* the folded 24-bit value is split into 6-bit portions and XOR'd.
*/
static int tl_calchash(addr)
- caddr_t addr;
+ unsigned char *addr;
{
int t;
@@ -1163,7 +1163,7 @@ static int tl_calchash(addr)
*/
static void tl_setfilt(sc, addr, slot)
struct tl_softc *sc;
- caddr_t addr;
+ u_int8_t *addr;
int slot;
{
int i;
@@ -1205,7 +1205,7 @@ static void tl_setmulti(sc)
/* First, zot all the existing filters. */
for (i = 1; i < 4; i++)
- tl_setfilt(sc, (caddr_t)&dummy, i);
+ tl_setfilt(sc, dummy, i);
tl_dio_write32(sc, TL_HASH1, 0);
tl_dio_write32(sc, TL_HASH2, 0);
@@ -1365,7 +1365,7 @@ static void tl_softreset(sc, internal)
* Probe for a ThunderLAN chip. Check the PCI vendor and device IDs
* against our list and return its name if we find a match.
*/
-static const char *
+static char *
tl_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1823,12 +1823,12 @@ static int tl_list_rx_init(sc)
cd = &sc->tl_cdata;
ld = sc->tl_ldata;
- for (i = 0; i < TL_RX_LIST_CNT; i++) {
+ for (i = 0; i < TL_TX_LIST_CNT; i++) {
cd->tl_rx_chain[i].tl_ptr =
(struct tl_list_onefrag *)&ld->tl_rx_list[i];
if (tl_newbuf(sc, &cd->tl_rx_chain[i]) == ENOBUFS)
return(ENOBUFS);
- if (i == (TL_RX_LIST_CNT - 1)) {
+ if (i == (TL_TX_LIST_CNT - 1)) {
cd->tl_rx_chain[i].tl_next = NULL;
ld->tl_rx_list[i].tlist_fptr = 0;
} else {
@@ -2129,7 +2129,7 @@ static int tl_intvec_adchk(xsc, type)
if (type)
printf("tl%d: adapter check: %x\n", sc->tl_unit,
- (unsigned int)CSR_READ_4(sc, TL_CH_PARM));
+ CSR_READ_4(sc, TL_CH_PARM));
#ifdef TL_DEBUG
evshow(sc);
#endif
@@ -2440,12 +2440,6 @@ static void tl_start(ifp)
}
/*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
* That's all we can stands, we can't stands no more.
* If there are no other transfers pending, then issue the
* TX GO command to the adapter to start things moving.
@@ -2475,7 +2469,7 @@ static void tl_start(ifp)
evset(sc, EV_START_Q);
#endif
sc->tl_cdata.tl_tx_tail->tl_next = start_tx;
- sc->tl_cdata.tl_tx_tail = cur_tx;
+ sc->tl_cdata.tl_tx_tail = start_tx;
}
/*
@@ -2527,7 +2521,7 @@ static void tl_init(xsc)
tl_dio_setbit(sc, TL_NETCMD, TL_CMD_NOBRX);
/* Init our MAC address */
- tl_setfilt(sc, (caddr_t)&sc->arpcom.ac_enaddr, 0);
+ tl_setfilt(sc, sc->arpcom.ac_enaddr, 0);
/* Init multicast filter, if needed. */
tl_setmulti(sc);
diff --git a/sys/pci/if_tlreg.h b/sys/pci/if_tlreg.h
index b8b3769f7bbf..a9b80ea64415 100644
--- a/sys/pci/if_tlreg.h
+++ b/sys/pci/if_tlreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_tlreg.h,v 1.6 1998/09/23 05:08:54 wpaul Exp $
+ * $Id: if_tlreg.h,v 1.12 1998/09/17 21:16:31 wpaul Exp $
*/
@@ -49,8 +49,8 @@ struct tl_type {
*/
#define TL_MAXFRAGS 10
-#define TL_RX_LIST_CNT 20
-#define TL_TX_LIST_CNT 20
+#define TL_RX_LIST_CNT 10
+#define TL_TX_LIST_CNT 10
#define TL_MIN_FRAMELEN 64
struct tl_frag {
@@ -141,7 +141,7 @@ struct tl_softc {
/*
* Transmit interrupt threshold.
*/
-#define TX_THR 0x00000004
+#define TX_THR 0x00000001
#define TL_FLAG_FORCEDELAY 1
#define TL_FLAG_SCHEDDELAY 2
diff --git a/sys/pci/if_tx.c b/sys/pci/if_tx.c
index a79ebebf602c..56a176ba8f74 100644
--- a/sys/pci/if_tx.c
+++ b/sys/pci/if_tx.c
@@ -1,6 +1,3 @@
-/* $OpenBSD: if_tx.c,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-/* $Id: if_tx.c,v 1.19 1998/12/09 01:12:18 eivind Exp $ */
-
/*-
* Copyright (c) 1997 Semen Ustimenko (semen@iclub.nsu.ru)
* All rights reserved.
@@ -26,27 +23,30 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * $Id: if_tx.c,v 1.14 1998/07/13 09:53:07 bde Exp $
*
*/
/*
* EtherPower II 10/100 Fast Ethernet (tx0)
* (aka SMC9432TX based on SMC83c170 EPIC chip)
- *
- * Thanks are going to Steve Bauer and Jason Wright.
*
- * todo:
+ * TODO:
+ * Deal with TX threshold (probably we should calculate it depending
+ * on processor speed, as did the MS-DOS driver).
* Deal with bus mastering, i.e. i realy don't know what to do with
* it and how it can improve performance.
* Implement FULL IFF_MULTICAST support.
- * Test, test and test again:-(
+ * Calculate optimal RX and TX rings size.
+ * Test, test and test again:-)
*
*/
-/* We should define compile time options before if_txvar.h included */
+/* We should define compile time options before smc83c170.h included */
/*#define EPIC_NOIFMEDIA 1*/
/*#define EPIC_USEIOSPACE 1*/
-#define EARLY_RX 1
+/*#define EARLY_RX 1*/
+/*#define EARLY_TX 1*/
/*#define EPIC_DEBUG 1*/
#if defined(EPIC_DEBUG)
@@ -67,65 +67,20 @@
} \
}
-#include "bpfilter.h"
#include "pci.h"
-
#if NPCI > 0
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
+#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
-#include <sys/socket.h>
#include <sys/sockio.h>
-
#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-
-#if !defined(SIOCSIFMEDIA) || defined(EPIC_NOIFMEDIA)
-#define EPIC_NOIFMEDIA 1
-#else
+#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
#include <net/if_media.h>
#endif
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
-
-#if defined(__OpenBSD__)
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/device.h>
-
-#include <netinet/if_ether.h>
-
-#include <vm/vm.h>
-
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcidevs.h>
-
-#include <dev/pci/if_txvar.h>
-#else /* __FreeBSD__ */
#include <net/if_mib.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
@@ -134,492 +89,51 @@
#include <machine/clock.h>
#include <pci/pcivar.h>
-#include <pci/if_txvar.h>
-#endif
-
-#if defined(__FreeBSD__)
-#if __FreeBSD_version >= 300000
-#define EPIC_IFIOCTL_CMD_TYPE u_long
-#else
-#define EPIC_IFIOCTL_CMD_TYPE int
-#endif
-#define EPIC_INTR_RET_TYPE void
-#else /* __OpenBSD__ */
-#define EPIC_IFIOCTL_CMD_TYPE u_long
-#define EPIC_INTR_RET_TYPE int
-#endif
-
-static int epic_ifioctl __P((register struct ifnet *, EPIC_IFIOCTL_CMD_TYPE, caddr_t));
-static EPIC_INTR_RET_TYPE epic_intr __P((void *));
-static int epic_common_attach __P((epic_softc_t *));
-static void epic_ifstart __P((struct ifnet * const));
-static void epic_ifwatchdog __P((struct ifnet *));
-static int epic_init __P((epic_softc_t *));
-static void epic_stop __P((epic_softc_t *));
-static __inline void epic_rx_done __P((epic_softc_t *));
-static __inline void epic_tx_done __P((epic_softc_t *));
-static int epic_init_rings __P((epic_softc_t *));
-static void epic_free_rings __P((epic_softc_t *));
-static void epic_stop_activity __P((epic_softc_t *));
-static void epic_start_activity __P((epic_softc_t *));
-static void epic_set_rx_mode __P((epic_softc_t *));
-static void epic_set_tx_mode __P((epic_softc_t *));
-static void epic_set_mc_table __P((epic_softc_t *));
-static void epic_set_media_speed __P((epic_softc_t *));
-static void epic_init_phy __P((epic_softc_t *));
-static void epic_dump_state __P((epic_softc_t *));
-static int epic_autoneg __P((epic_softc_t *));
-static int epic_read_eeprom __P((epic_softc_t *,u_int16_t));
-static void epic_output_eepromw __P((epic_softc_t *, u_int16_t));
-static u_int16_t epic_input_eepromw __P((epic_softc_t *));
-static u_int8_t epic_eeprom_clock __P((epic_softc_t *,u_int8_t));
-static void epic_write_eepromreg __P((epic_softc_t *,u_int8_t));
-static u_int8_t epic_read_eepromreg __P((epic_softc_t *));
-static u_int16_t epic_read_phy_register __P((epic_softc_t *, u_int16_t));
-static void epic_write_phy_register __P((epic_softc_t *, u_int16_t, u_int16_t));
-
-#if !defined(EPIC_NOIFMEDIA)
-static int epic_ifmedia_change __P((struct ifnet *));
-static void epic_ifmedia_status __P((struct ifnet *, struct ifmediareq *));
-#endif
-
-/* -------------------------------------------------------------------------
- OS-specific part
- ------------------------------------------------------------------------- */
-
-#if defined(__OpenBSD__)
-/* -----------------------------OpenBSD------------------------------------- */
-
-static int epic_openbsd_probe __P((struct device *,void *,void *));
-static void epic_openbsd_attach __P((struct device *, struct device *, void *));
-static void epic_shutdown __P((void *));
-
-struct cfattach tx_ca = {
- sizeof(epic_softc_t), epic_openbsd_probe, epic_openbsd_attach
-};
-struct cfdriver tx_cd = {
- NULL,"tx",DV_IFNET
-};
-
-/* Synopsis: Check if device id corresponds with SMC83C170 id. */
-static int
-epic_openbsd_probe(
- struct device *parent,
- void *match,
- void *aux )
-{
- struct pci_attach_args *pa = aux;
- if( PCI_VENDOR(pa->pa_id) != SMC_VENDORID )
- return 0;
-
- if( PCI_PRODUCT(pa->pa_id) == CHIPID_83C170 )
- return 1;
-
- return 0;
-}
-
-static void
-epic_openbsd_attach(
- struct device *parent,
- struct device *self,
- void *aux )
-{
- epic_softc_t *sc = (epic_softc_t*)self;
- struct pci_attach_args *pa = aux;
- pci_chipset_tag_t pc = pa->pa_pc;
- pci_intr_handle_t ih;
- const char *intrstr = NULL;
- struct ifnet *ifp;
- bus_space_tag_t iot = pa->pa_iot;
- bus_addr_t iobase;
- bus_size_t iosize;
- int i;
-#if !defined(EPIC_NOIFMEDIA)
- int tmp;
-#endif
-
- if( pci_io_find(pc, pa->pa_tag, PCI_CBIO, &iobase, &iosize)) {
- printf(": can't find i/o space\n");
- return;
- }
- if( bus_space_map(iot, iobase, iosize, 0, &sc->sc_sh)) {
- printf(": can't map i/o space\n");
- return;
- }
- sc->sc_st = iot;
-
- ifp = &sc->sc_if;
- bcopy(sc->sc_dev.dv_xname, ifp->if_xname,IFNAMSIZ);
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = epic_ifioctl;
- ifp->if_start = epic_ifstart;
- ifp->if_watchdog = epic_ifwatchdog;
-
- /* Do common attach procedure */
- if( epic_common_attach(sc) ) return;
-
- /* Map interrupt */
- if( pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
- pa->pa_intrline, &ih)) {
- printf(": can't map interrupt\n");
- return;
- }
- intrstr = pci_intr_string(pc, ih);
- sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, epic_intr, sc,
- self->dv_xname);
-
- if( NULL == sc->sc_ih ) {
- printf(": can't establish interrupt");
- if( intrstr )printf(" at %s",intrstr);
- printf("\n");
- return;
- }
- printf(": %s",intrstr);
-
- /* Display some info */
- printf(" address %s",ether_sprintf(sc->sc_macaddr));
- /* Read current media config and display it too */
- i = PHY_READ_2( sc, DP83840_BMCR );
-#if !defined(EPIC_NOIFMEDIA)
- tmp = IFM_ETHER;
-#endif
- if( i & BMCR_AUTONEGOTIATION ){
- printf(", Auto-Neg ");
+#include <pci/smc83c170.h>
- /* To avoid bug in QS6612 read LPAR enstead of BMSR */
- i = PHY_READ_2( sc, DP83840_LPAR );
- if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps");
- else printf("10Mbps");
- if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf(" FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_AUTO;
-#endif
- } else {
-#if defined(EPIC_NOIFMEDIA)
- ifp->if_flags |= IFF_LINK0;
-#endif
- if( i & BMCR_100MBPS ) {
- printf(", 100Mbps");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_100_TX;
-#else
- ifp->if_flags |= IFF_LINK2;
-#endif
- } else {
- printf(", 10Mbps");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_10_T;
-#endif
- }
- if( i & BMCR_FULL_DUPLEX ) {
- printf(" FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_FDX;
-#else
- ifp->if_flags |= IFF_LINK1;
-#endif
- }
- }
-
- /* Init ifmedia interface */
-#if !defined(EPIC_NOIFMEDIA)
- ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
- ifmedia_set(&sc->ifmedia, tmp);
-#endif
-
- /* Attach os interface and bpf */
- if_attach(ifp);
- ether_ifattach(ifp);
+#include "bpfilter.h"
#if NBPFILTER > 0
- bpfattach(&sc->sc_if.if_bpf, ifp, DLT_EN10MB,
- sizeof(struct ether_header));
+#include <net/bpf.h>
#endif
- /* Set shutdown routine to stop DMA process */
- shutdownhook_establish(epic_shutdown, sc);
- printf("\n");
-}
-
-/* Simple call epic_stop() */
-static void
-epic_shutdown(
- void *sc)
-{
- epic_stop(sc);
-}
-
-#else /* __FreeBSD__ */
-/* -----------------------------FreeBSD------------------------------------- */
-
-static const char* epic_freebsd_probe __P((pcici_t, pcidi_t));
-static void epic_freebsd_attach __P((pcici_t, int));
-static void epic_shutdown __P((int, void *));
-
-/* Global variables */
+/*
+ * Global variables
+ */
static u_long epic_pci_count;
static struct pci_device txdevice = {
"tx",
- epic_freebsd_probe,
- epic_freebsd_attach,
+ epic_pci_probe,
+ epic_pci_attach,
&epic_pci_count,
NULL };
-/* Append this driver to pci drivers list */
-DATA_SET ( pcidevice_set, txdevice );
-
-/* Synopsis: Check if device id corresponds with SMC83C170 id. */
-static const char*
-epic_freebsd_probe(
- pcici_t config_id,
- pcidi_t device_id)
-{
- if( PCI_VENDORID(device_id) != SMC_VENDORID )
- return NULL;
-
- if( PCI_CHIPID(device_id) == CHIPID_83C170 )
- return "SMC 83c170";
-
- return NULL;
-}
-
/*
- * Do FreeBSD-specific attach routine, like map registers, alloc softc
- * structure and etc.
+ * Append this driver to pci drivers list
*/
-static void
-epic_freebsd_attach(
- pcici_t config_id,
- int unit)
-{
- struct ifnet *ifp;
- epic_softc_t *sc;
-#if defined(EPIC_USEIOSPACE)
- u_int32_t iobase;
-#else
- caddr_t pmembase;
-#endif
- int i,s,tmp;
-
- printf("tx%d",unit);
-
- /* Allocate memory for softc, hardware descriptors and frag lists */
- sc = (epic_softc_t *) malloc( sizeof(epic_softc_t), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) return;
-
- /* Preinitialize softc structure */
- bzero(sc, sizeof(epic_softc_t));
- sc->unit = unit;
-
- /* Fill ifnet structure */
- ifp = &sc->sc_if;
- ifp->if_unit = unit;
- ifp->if_name = "tx";
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
- ifp->if_ioctl = epic_ifioctl;
- ifp->if_start = epic_ifstart;
- ifp->if_watchdog = epic_ifwatchdog;
- ifp->if_init = (if_init_f_t*)epic_init;
- ifp->if_timer = 0;
- ifp->if_output = ether_output;
-
- /* Get iobase or membase */
-#if defined(EPIC_USEIOSPACE)
- if (!pci_map_port(config_id, PCI_CBIO,(u_short *) &(sc->iobase))) {
- printf(": cannot map port\n");
- free(sc, M_DEVBUF);
- return;
- }
-#else
- if (!pci_map_mem(config_id, PCI_CBMA,(vm_offset_t *) &(sc->csr),(vm_offset_t *) &pmembase)) {
- printf(": cannot map memory\n");
- free(sc, M_DEVBUF);
- return;
- }
-#endif
-
- if( epic_common_attach(sc) ) return;
-
- /* Display ethernet address ,... */
- printf(": address %02x:%02x:%02x:%02x:%02x:%02x,",
- sc->sc_macaddr[0],sc->sc_macaddr[1],sc->sc_macaddr[2],
- sc->sc_macaddr[3],sc->sc_macaddr[4],sc->sc_macaddr[5]);
-
- /* board type and ... */
- printf(" type ");
- for(i=0x2c;i<0x32;i++) {
- tmp = epic_read_eeprom( sc, i );
- if( ' ' == (u_int8_t)tmp ) break;
- printf("%c",(u_int8_t)tmp);
- tmp >>= 8;
- if( ' ' == (u_int8_t)tmp ) break;
- printf("%c",(u_int8_t)tmp);
- }
-
- /* Read current media config and display it too */
- i = PHY_READ_2( sc, DP83840_BMCR );
-#if !defined(EPIC_NOIFMEDIA)
- tmp = IFM_ETHER;
-#endif
- if( i & BMCR_AUTONEGOTIATION ){
- printf(", Auto-Neg ");
-
- /* To avoid bug in QS6612 read LPAR enstead of BMSR */
- i = PHY_READ_2( sc, DP83840_LPAR );
- if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps ");
- else printf("10Mbps ");
- if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf("FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_AUTO;
-#endif
- } else {
-#if defined(EPIC_NOIFMEDIA)
- ifp->if_flags |= IFF_LINK0;
-#endif
- if( i & BMCR_100MBPS ) {
- printf(", 100Mbps ");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_100_TX;
-#else
- ifp->if_flags |= IFF_LINK2;
-#endif
- } else {
- printf(", 10Mbps ");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_10_T;
-#endif
- }
- if( i & BMCR_FULL_DUPLEX ) {
- printf("FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_FDX;
-#else
- ifp->if_flags |= IFF_LINK1;
-#endif
- }
- }
-
- /* Init ifmedia interface */
-#if !defined(EPIC_NOIFMEDIA)
- ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
- ifmedia_set(&sc->ifmedia, tmp);
-#endif
-
- s = splimp();
-
- /* Map interrupt */
- if( !pci_map_int(config_id, epic_intr, (void*)sc, &net_imask) ) {
- printf(": couldn't map interrupt\n");
- free(sc, M_DEVBUF);
- return;
- }
-
- /* Set shut down routine to stop DMA processes on reboot */
- at_shutdown(epic_shutdown, sc, SHUTDOWN_POST_SYNC);
-
- /* Attach to if manager */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp,DLT_EN10MB, sizeof(struct ether_header));
-#endif
-
- splx(s);
-
- printf("\n");
-
- return;
-}
-
-static void
-epic_shutdown(
- int howto,
- void *sc)
-{
- epic_stop(sc);
-}
-
-#endif /* __OpenBSD__ */
-
-/* ------------------------------------------------------------------------
- OS-independing part
- ------------------------------------------------------------------------ */
+DATA_SET ( pcidevice_set, txdevice );
/*
- * This is if_ioctl handler.
+ * ifioctl function
+ *
+ * splimp() invoked here
*/
static int
epic_ifioctl __P((
register struct ifnet * ifp,
- EPIC_IFIOCTL_CMD_TYPE command,
- caddr_t data))
+ u_long command, caddr_t data))
{
epic_softc_t *sc = ifp->if_softc;
+ struct ifreq *ifr = (struct ifreq *) data;
int x, error = 0;
x = splimp();
switch (command) {
-#if defined(__FreeBSD__)
+
case SIOCSIFADDR:
case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
+ ether_ioctl(ifp, command, data);
break;
-#else /* __OpenBSD__ */
- case SIOCSIFADDR: {
- struct ifaddr *ifa = (struct ifaddr *)data;
-
- ifp->if_flags |= IFF_UP;
- switch(ifa->ifa_addr->sa_family) {
-#if INET
- case AF_INET:
- epic_stop(sc);
- epic_init(sc);
- arp_ifinit(&sc->arpcom,ifa);
- break;
-#endif /* __FreeBSD__ */
-#if NS
- case AF_NS: {
- register struct ns_addr * ina = &IA_SNS(ifa)->sns_addr;
-
- if( ns_nullhost(*ina) )
- ina->x_host =
- *(union ns_host *) LLADDR(ifp->if_sadl);
- else
- bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
- ifp->if_addrlen);
-
- epic_stop(sc);
- epic_init(sc);
- break;
- }
-#endif
- default:
- epic_stop(sc);
- epic_init(sc);
- break;
- }
- }
-#endif
case SIOCSIFFLAGS:
/*
@@ -641,22 +155,24 @@ epic_ifioctl __P((
/* Handle IFF_PROMISC flag */
epic_set_rx_mode(sc);
-#if defined(EPIC_NOIFMEDIA)
+#if !defined(_NET_IF_MEDIA_H_)
/* Handle IFF_LINKx flags */
epic_set_media_speed(sc);
#endif
+
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
+
/* Update out multicast list */
#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
epic_set_mc_table(sc);
error = 0;
#else
error = (command == SIOCADDMULTI) ?
- ether_addmulti((struct ifreq *)data, &sc->arpcom) :
- ether_delmulti((struct ifreq *)data, &sc->arpcom);
+ ether_addmulti(ifr, &sc->epic_ac) :
+ ether_delmulti(ifr, &sc->epic_ac);
if (error == ENETRESET) {
epic_set_mc_table(sc);
@@ -665,11 +181,21 @@ epic_ifioctl __P((
#endif
break;
-#if !defined(EPIC_NOIFMEDIA)
+ case SIOCSIFMTU:
+ /*
+ * Set the interface MTU.
+ */
+ if (ifr->ifr_mtu > ETHERMTU) {
+ error = EINVAL;
+ } else {
+ ifp->if_mtu = ifr->ifr_mtu;
+ }
+ break;
+
+#if defined(_NET_IF_MEDIA_H_)
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
- error = ifmedia_ioctl(ifp, (struct ifreq *)data,
- &sc->ifmedia, command);
+ error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
break;
#endif
@@ -682,65 +208,9 @@ epic_ifioctl __P((
}
/*
- * OS-independed part of attach process. allocate memory for descriptors
- * and frag lists, wake up chip, read MAC address and PHY identyfier.
- * Return -1 on failure.
- */
-static int
-epic_common_attach(
- epic_softc_t *sc)
-{
- int i;
- caddr_t pool;
-
- i = sizeof(struct epic_frag_list)*TX_RING_SIZE +
- sizeof(struct epic_rx_desc)*RX_RING_SIZE +
- sizeof(struct epic_tx_desc)*TX_RING_SIZE + PAGE_SIZE,
- sc->pool = (epic_softc_t *) malloc( i, M_DEVBUF, M_NOWAIT);
-
- if (sc->pool == NULL) {
- printf(": can't allocate memory for buffers\n");
- return -1;
- }
- bzero(sc->pool, i);
-
- /* Align pool on PAGE_SIZE */
- pool = (caddr_t)sc->pool;
- pool = (caddr_t)((u_int32_t)(pool + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
-
- /* Distribute memory */
- sc->tx_flist = (void *)pool;
- pool += sizeof(struct epic_frag_list)*TX_RING_SIZE;
- sc->rx_desc = (void *)pool;
- pool += sizeof(struct epic_rx_desc)*RX_RING_SIZE;
- sc->tx_desc = (void *)pool;
-
- /* Bring the chip out of low-power mode. */
- CSR_WRITE_4( sc, GENCTL, 0x0000 );
-
- /* Magic?! If we don't set this bit the MII interface won't work. */
- CSR_WRITE_4( sc, TEST1, 0x0008 );
-
- /* Read mac address from EEPROM */
- for (i = 0; i < ETHER_ADDR_LEN / sizeof(u_int16_t); i++)
- ((u_int16_t *)sc->sc_macaddr)[i] = epic_read_eeprom(sc,i);
-
- /* Identify PHY */
- sc->phyid = PHY_READ_2(sc, DP83840_PHYIDR1 )<<6;
- sc->phyid|= (PHY_READ_2( sc, DP83840_PHYIDR2 )>>10)&0x3F;
- if( QS6612_OUI != sc->phyid )
- printf(": WARNING! PHY unknown (0x%x)",sc->phyid);
-
- sc->tx_threshold = TRANSMIT_THRESHOLD;
- sc->txcon = TXCON_DEFAULT;
-
- return 0;
-}
-
-/*
- * This is if_start handler. It takes mbufs from if_snd queue
- * and quque them for transmit, one by one, until TX ring become full
- * or quque become empty.
+ * ifstart function
+ *
+ * splimp() assumed to be done
*/
static void
epic_ifstart(struct ifnet * const ifp){
@@ -748,17 +218,19 @@ epic_ifstart(struct ifnet * const ifp){
struct epic_tx_buffer *buf;
struct epic_tx_desc *desc;
struct epic_frag_list *flist;
- struct mbuf *m0;
- register struct mbuf *m;
- register int i;
+ struct mbuf *m,*m0;
- /* If no link is established, simply free all mbufs in queue */
+#if defined(EPIC_DEBUG)
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
+#endif
+ /* If no link is established, */
+ /* simply free all mbufs in queue */
PHY_READ_2( sc, DP83840_BMSR );
if( !(BMSR_LINK_STATUS & PHY_READ_2( sc, DP83840_BMSR )) ){
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
while( m0 ) {
m_freem(m0);
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
}
return;
}
@@ -770,46 +242,44 @@ epic_ifstart(struct ifnet * const ifp){
flist = sc->tx_flist + sc->cur_tx;
/* Get next packet to send */
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
/* If nothing to send, return */
if( NULL == m0 ) return;
/* If descriptor is busy, set IFF_OACTIVE and exit */
if( desc->status & 0x8000 ) {
- dprintf((EPIC_FORMAT ": desc is busy in ifstart, up and down interface please\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: desc is busy in ifstart, up and down interface please",sc->unit));
break;
}
if( buf->mbuf ) {
- dprintf((EPIC_FORMAT ": mbuf not freed in ifstart, up and down interface plase\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: mbuf not freed in ifstart, up and down interface plase",sc->unit));
break;
}
/* Fill fragments list */
- for( m=m0, i=0;
- (NULL != m) && (i < EPIC_MAX_FRAGS);
- m = m->m_next, i++ ) {
- flist->frag[i].fraglen = m->m_len;
- flist->frag[i].fragaddr = vtophys( mtod(m, caddr_t) );
+ flist->numfrags = 0;
+ for(m=m0;(NULL!=m)&&(flist->numfrags<63);m=m->m_next) {
+ flist->frag[flist->numfrags].fraglen = m->m_len;
+ flist->frag[flist->numfrags].fragaddr = vtophys( mtod(m, caddr_t) );
+ flist->numfrags++;
}
- flist->numfrags = i;
- /* If packet was more than EPIC_MAX_FRAGS parts, */
+ /* If packet was more than 63 parts, */
/* recopy packet to new allocated mbuf cluster */
if( NULL != m ){
EPIC_MGETCLUSTER(m);
if( NULL == m ){
- printf(EPIC_FORMAT ": cannot allocate mbuf cluster\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cannot allocate mbuf cluster",sc->unit);
m_freem(m0);
- ifp->if_oerrors++;
+ sc->epic_if.if_oerrors++;
continue;
}
m_copydata( m0, 0, m0->m_pkthdr.len, mtod(m,caddr_t) );
- flist->frag[0].fraglen =
- m->m_pkthdr.len = m->m_len = m0->m_pkthdr.len;
- m->m_pkthdr.rcvif = ifp;
+ flist->frag[0].fraglen = m->m_pkthdr.len = m->m_len = m0->m_pkthdr.len;
+ m->m_pkthdr.rcvif = &sc->epic_if;
flist->numfrags = 1;
flist->frag[0].fragaddr = vtophys( mtod(m, caddr_t) );
@@ -817,29 +287,40 @@ epic_ifstart(struct ifnet * const ifp){
m0 = m;
}
+ /* Save mbuf */
buf->mbuf = m0;
+
+ /* Packet queued successful */
sc->pending_txs++;
- sc->cur_tx = ( sc->cur_tx + 1 ) & TX_RING_MASK;
+
+ /* Switch to next descriptor */
+ sc->cur_tx = ( sc->cur_tx + 1 ) % TX_RING_SIZE;
+
+ /* Does not generate TXC */
desc->control = 0x01;
- desc->txlength =
- max(m0->m_pkthdr.len,ETHER_MIN_LEN-ETHER_CRC_LEN);
+
+ /* Packet should be at least ETHER_MIN_LEN */
+ desc->txlength = max(m0->m_pkthdr.len,ETHER_MIN_LEN-ETHER_CRC_LEN);
+
+ /* Pass ownership to the chip */
desc->status = 0x8000;
+
+ /* Trigger an immediate transmit demand. */
CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
+#if defined(EPIC_DEBUG)
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
+#endif
+
/* Set watchdog timer */
ifp->if_timer = 8;
#if NBPFILTER > 0
- if( ifp->if_bpf )
-#if defined(__FreeBSD__)
- bpf_mtap( ifp, m0 );
-#else /* __OpenBSD__ */
- bpf_mtap( ifp->if_bpf, m0 );
-#endif /* __FreeBSD__ */
+ if( ifp->if_bpf ) bpf_mtap( ifp, m0 );
#endif
}
- ifp->if_flags |= IFF_OACTIVE;
+ sc->epic_if.if_flags |= IFF_OACTIVE;
return;
@@ -853,25 +334,28 @@ static __inline void
epic_rx_done __P((
epic_softc_t *sc ))
{
+ int i = 0;
u_int16_t len;
struct epic_rx_buffer *buf;
struct epic_rx_desc *desc;
struct mbuf *m;
struct ether_header *eh;
- while( !(sc->rx_desc[sc->cur_rx].status & 0x8000) ) {
+ while( !(sc->rx_desc[sc->cur_rx].status & 0x8000) && \
+ i++ < RX_RING_SIZE ) {
+
buf = sc->rx_buffer + sc->cur_rx;
desc = sc->rx_desc + sc->cur_rx;
/* Switch to next descriptor */
- sc->cur_rx = (sc->cur_rx+1) & RX_RING_MASK;
+ sc->cur_rx = (sc->cur_rx+1) % RX_RING_SIZE;
/* Check for errors, this should happend */
/* only if SAVE_ERRORED_PACKETS is set, */
/* normaly rx errors generate RXE interrupt */
if( !(desc->status & 1) ) {
- dprintf((EPIC_FORMAT ": Rx error status: 0x%x\n",EPIC_ARGS(sc),desc->status));
- sc->sc_if.if_ierrors++;
+ dprintf(("\ntx%d: Rx error status: 0x%x",sc->unit,desc->status));
+ sc->epic_if.if_ierrors++;
desc->status = 0x8000;
continue;
}
@@ -883,10 +367,10 @@ epic_rx_done __P((
/* Try to get mbuf cluster */
EPIC_MGETCLUSTER( buf->mbuf );
if( NULL == buf->mbuf ) {
- printf(EPIC_FORMAT ": cannot allocate mbuf cluster\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cannot allocate mbuf cluster",sc->unit);
buf->mbuf = m;
desc->status = 0x8000;
- sc->sc_if.if_ierrors++;
+ sc->epic_if.if_ierrors++;
continue;
}
@@ -896,21 +380,16 @@ epic_rx_done __P((
/* First mbuf in packet holds the ethernet and packet headers */
eh = mtod( m, struct ether_header * );
- m->m_pkthdr.rcvif = &(sc->sc_if);
+ m->m_pkthdr.rcvif = &(sc->epic_if);
m->m_pkthdr.len = m->m_len = len;
#if NBPFILTER > 0
/* Give mbuf to BPFILTER */
- if( sc->sc_if.if_bpf )
-#if defined(__FreeBSD__)
- bpf_mtap( &sc->sc_if, m );
-#else /* __OpenBSD__ */
- bpf_mtap( sc->sc_if.if_bpf, m );
-#endif /* __FreeBSD__ */
+ if( sc->epic_if.if_bpf ) bpf_mtap( &sc->epic_if, m );
/* Accept only our packets, broadcasts and multicasts */
if( (eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){
+ bcmp(eh->ether_dhost,sc->epic_ac.ac_enaddr,ETHER_ADDR_LEN)){
m_freem(m);
continue;
}
@@ -921,10 +400,10 @@ epic_rx_done __P((
m->m_data += sizeof( struct ether_header );
/* Give mbuf to OS */
- ether_input(&sc->sc_if, eh, m);
+ ether_input(&sc->epic_if, eh, m);
/* Successfuly received frame */
- sc->sc_if.if_ipackets++;
+ sc->epic_if.if_ipackets++;
}
return;
@@ -956,22 +435,22 @@ epic_tx_done __P((
/* Packet is transmitted. Switch to next and */
/* free mbuf */
sc->pending_txs--;
- sc->dirty_tx = (sc->dirty_tx + 1) & TX_RING_MASK;
+ sc->dirty_tx = (sc->dirty_tx + 1) % TX_RING_SIZE;
m_freem( buf->mbuf );
buf->mbuf = NULL;
/* Check for errors and collisions */
- if( status & 0x0001 ) sc->sc_if.if_opackets++;
- else sc->sc_if.if_oerrors++;
- sc->sc_if.if_collisions += (status >> 8) & 0x1F;
+ if( status & 0x0001 ) sc->epic_if.if_opackets++;
+ else sc->epic_if.if_oerrors++;
+ sc->epic_if.if_collisions += (status >> 8) & 0x1F;
#if defined(EPIC_DEBUG)
if( (status & 0x1001) == 0x1001 )
- dprintf((EPIC_FORMAT ": frame not transmitted due collisions\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: frame not transmitted due collisions",sc->unit));
#endif
}
if( sc->pending_txs < TX_RING_SIZE )
- sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ sc->epic_if.if_flags &= ~IFF_OACTIVE;
}
/*
@@ -979,137 +458,122 @@ epic_tx_done __P((
*
* splimp() assumed to be done
*/
-static EPIC_INTR_RET_TYPE
-epic_intr (
+static void
+epic_intr_normal(
void *arg)
{
- epic_softc_t * sc = (epic_softc_t *) arg;
- int status,i=4;
-#if defined(__OpenBSD__)
- int claimed = 0;
-#endif
-
+ epic_softc_t * sc = (epic_softc_t *) arg;
+ int status,i=4;
- while( i-- && ((status = CSR_READ_4(sc, INTSTAT)) & INTSTAT_INT_ACTV) ){
-#if defined(__OpenBSD__)
- claimed = 1;
-#endif
+do {
+ status = CSR_READ_4( sc, INTSTAT );
CSR_WRITE_4( sc, INTSTAT, status );
if( status & (INTSTAT_RQE|INTSTAT_RCC|INTSTAT_OVW) ) {
- epic_rx_done( sc );
- if( status & (INTSTAT_RQE|INTSTAT_OVW) ){
+ epic_rx_done( sc );
+ if( status & (INTSTAT_RQE|INTSTAT_OVW) ){
#if defined(EPIC_DEBUG)
- if( status & INTSTAT_OVW )
- printf(EPIC_FORMAT ": RX buffer overflow\n",EPIC_ARGS(sc));
- if( status & INTSTAT_RQE )
- printf(EPIC_FORMAT ": RX FIFO overflow\n",EPIC_ARGS(sc));
- if( sc->sc_if.if_flags & IFF_DEBUG )
- epic_dump_state(sc);
+ if( status & INTSTAT_OVW )
+ printf("\ntx%d: Rx buffer overflowed",sc->unit);
+ if( status & INTSTAT_RQE )
+ printf("\ntx%d: Rx FIFO overflowed",sc->unit);
+ if( sc->epic_if.if_flags & IFF_DEBUG )
+ epic_dump_state(sc);
#endif
- if( !(CSR_READ_4( sc, COMMAND ) & COMMAND_RXQUEUED) )
- CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED );
- sc->sc_if.if_ierrors++;
- }
- }
+ if( !(CSR_READ_4( sc, COMMAND ) & COMMAND_RXQUEUED) )
+ CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED );
+ sc->epic_if.if_ierrors++;
+ }
+ }
- if( status & (INTSTAT_TXC|INTSTAT_TCC|INTSTAT_TQE) ) {
- epic_tx_done( sc );
- if(!(sc->sc_if.if_flags & IFF_OACTIVE) &&
- sc->sc_if.if_snd.ifq_head )
- epic_ifstart( &sc->sc_if );
+ if( status & (INTSTAT_TXC|INTSTAT_TCC|INTSTAT_TQE) ) {
+ epic_tx_done( sc );
+#if defined(EPIC_DEBUG)
+ if( (status & (INTSTAT_TQE | INTSTAT_TCC)) && (sc->pending_txs > 1) )
+ printf("\ntx%d: %d packets pending after TQE/TCC",sc->unit,sc->pending_txs);
+#endif
+ if( !(sc->epic_if.if_flags & IFF_OACTIVE) && sc->epic_if.if_snd.ifq_head )
+ epic_ifstart( &sc->epic_if );
}
- if( (status & INTSTAT_GP2) && (QS6612_OUI == sc->phyid) ) {
- u_int32_t phystatus = PHY_READ_2( sc, QS6612_INTSTAT );
+ if( (status & INTSTAT_GP2) && (QS6612_OUI == sc->phyid) ) {
+ u_int32_t phystatus;
+
+ phystatus = PHY_READ_2( sc, QS6612_INTSTAT );
- if( phystatus & INTSTAT_AN_COMPLETE ) {
- u_int32_t bmcr;
- if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
- bmcr = BMCR_FULL_DUPLEX | PHY_READ_2( sc, DP83840_BMCR );
- sc->txcon |= TXCON_FULL_DUPLEX;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ if( phystatus & INTSTAT_AN_COMPLETE ) {
+ u_int32_t bmcr;
+ if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
+ bmcr = BMCR_FULL_DUPLEX | PHY_READ_2( sc, DP83840_BMCR );
+ CSR_WRITE_4( sc, TXCON, TXCON_FULL_DUPLEX | TXCON_DEFAULT );
+ } else {
+ /* Default to half-duplex */
+ bmcr = ~BMCR_FULL_DUPLEX & PHY_READ_2( sc, DP83840_BMCR );
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT );
+ }
+
+ /* There is apparently QS6612 chip bug: */
+ /* BMCR_FULL_DUPLEX flag is not updated by */
+ /* autonegotiation process, so update it by hands */
+ /* so we can rely on it in epic_ifmedia_status() */
+ PHY_WRITE_2( sc, DP83840_BMCR, bmcr );
+ }
+
+ PHY_READ_2(sc, DP83840_BMSR);
+ if( !(PHY_READ_2(sc, DP83840_BMSR) & BMSR_LINK_STATUS) ) {
+ dprintf(("\ntx%d: WARNING! link down",sc->unit));
+ sc->flags |= EPIC_LINK_DOWN;
} else {
- /* Default to half-duplex */
- bmcr = ~BMCR_FULL_DUPLEX & PHY_READ_2( sc, DP83840_BMCR );
- sc->txcon &= ~TXCON_FULL_DUPLEX;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ dprintf(("\ntx%d: link up",sc->unit));
+ sc->flags &= ~EPIC_LINK_DOWN;
}
- /* There is apparently QS6612 chip bug: */
- /* BMCR_FULL_DUPLEX flag is not updated by */
- /* autonegotiation process, so update it by hands */
- /* so we can rely on it in epic_ifmedia_status() */
- PHY_WRITE_2( sc, DP83840_BMCR, bmcr );
- }
-
- PHY_READ_2(sc, DP83840_BMSR);
- if( !(PHY_READ_2(sc, DP83840_BMSR) & BMSR_LINK_STATUS) ) {
- dprintf((EPIC_FORMAT ": WARNING! link down\n",EPIC_ARGS(sc)));
- sc->flags |= EPIC_LINK_DOWN;
- } else {
- dprintf((EPIC_FORMAT ": link up\n",EPIC_ARGS(sc)));
- sc->flags &= ~EPIC_LINK_DOWN;
- }
-
- /* We should clear GP2 int again after we clear it on PHY */
- CSR_WRITE_4( sc, INTSTAT, INTSTAT_GP2 );
+ /* We should clear GP2 int again after we clear it on PHY */
+ CSR_WRITE_4( sc, INTSTAT, INTSTAT_GP2 );
}
/* Check for errors */
- if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|
- INTSTAT_APE|INTSTAT_DPE|INTSTAT_TXU|INTSTAT_RXE) ){
- if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|
- INTSTAT_APE|INTSTAT_DPE) ){
- printf(EPIC_FORMAT ": PCI fatal error occured (%s%s%s%s)\n",
- EPIC_ARGS(sc),
- (status&INTSTAT_PMA)?"PMA":"",
- (status&INTSTAT_PTA)?" PTA":"",
- (status&INTSTAT_APE)?" APE":"",
- (status&INTSTAT_DPE)?" DPE":""
- );
-
- epic_dump_state(sc);
+ if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|INTSTAT_APE|INTSTAT_DPE|INTSTAT_TXU|INTSTAT_RXE) ){
+ if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|INTSTAT_APE|INTSTAT_DPE) ){
+ printf("\ntx%d: PCI fatal error occured (%s%s%s%s)",
+ sc->unit,
+ (status&INTSTAT_PMA)?"PMA":"",
+ (status&INTSTAT_PTA)?" PTA":"",
+ (status&INTSTAT_APE)?" APE":"",
+ (status&INTSTAT_DPE)?" DPE":""
+ );
+
+ epic_dump_state(sc);
- epic_stop(sc);
- epic_init(sc);
+ epic_stop(sc);
+ epic_init(sc);
- break;
- }
-
- if (status & INTSTAT_RXE) {
- dprintf((EPIC_FORMAT ": CRC/Alignment error\n",EPIC_ARGS(sc)));
- sc->sc_if.if_ierrors++;
- }
-
- /* Tx FIFO underflow. Increase tx threshold, */
- /* if it grown above 2048, disable EARLY_TX */
- if (status & INTSTAT_TXU) {
- if( sc->tx_threshold > 0x800 ) {
- sc->txcon &= ~TXCON_EARLY_TRANSMIT_ENABLE;
- dprintf((EPIC_FORMAT ": TX underrun error, early tx disabled\n",EPIC_ARGS(sc)));
- } else {
- sc->tx_threshold += 0x40;
- dprintf((EPIC_FORMAT ": TX underrun error, tx threshold increased to %d\n",EPIC_ARGS(sc),sc->tx_threshold));
+ return;
}
- epic_stop_activity(sc);
- epic_set_tx_mode(sc);
- epic_start_activity(sc);
- sc->sc_if.if_oerrors++;
+ if (status & INTSTAT_RXE) {
+ dprintf(("\ntx%d: CRC/Alignment error",sc->unit));
+ sc->epic_if.if_ierrors++;
+ }
+
+ /* Tx FIFO underflow. Should not happend if */
+ /* we don't use early tx, handle it anyway */
+ if (status & INTSTAT_TXU) {
+ dprintf(("\ntx%d: Tx underrun error",sc->unit));
+ sc->epic_if.if_oerrors++;
- /* Restart the transmit process. */
- /* CSR_WRITE_4(sc, COMMAND, COMMAND_TXUGO|COMMAND_TXQUEUED); */
- }
+ /* Restart the transmit process. */
+ CSR_WRITE_4(sc, COMMAND, COMMAND_TXUGO | COMMAND_TXQUEUED);
+ }
}
- }
- /* If no packets are pending, thus no timeouts */
- if( sc->pending_txs == 0 ) sc->sc_if.if_timer = 0;
+} while( i-- && (CSR_READ_4(sc, INTSTAT) & INTSTAT_INT_ACTV) );
-#if defined(__OpenBSD__)
- return claimed;
-#endif
+ /* If no packets are pending, thus no timeouts */
+ if( sc->pending_txs == 0 )
+ sc->epic_if.if_timer = 0;
+
+ return;
}
/*
@@ -1128,8 +592,7 @@ epic_ifwatchdog __P((
x = splimp();
- printf(EPIC_FORMAT ": device timeout %d packets, ",
- EPIC_ARGS(sc),sc->pending_txs);
+ printf("\ntx%d: device timeout %d packets, ", sc->unit,sc->pending_txs);
/* Try to finish queued packets */
epic_tx_done( sc );
@@ -1137,35 +600,240 @@ epic_ifwatchdog __P((
/* If not successful */
if( sc->pending_txs > 0 ){
#if defined(EPIC_DEBUG)
- if( ifp->if_flags & IFF_DEBUG ) epic_dump_state(sc);
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
#endif
ifp->if_oerrors+=sc->pending_txs;
/* Reinitialize board */
- printf("reinitialization\n");
+ printf("reinitialization");
epic_stop(sc);
epic_init(sc);
} else
- printf("seems we can continue normaly\n");
+ printf("seems we can continue normaly");
/* Start output */
- if( ifp->if_snd.ifq_head ) epic_ifstart( ifp );
+ if( sc->epic_if.if_snd.ifq_head ) epic_ifstart(&sc->epic_if);
splx(x);
}
+/*
+ * Synopsis: Check if PCI id corresponds with board id.
+ */
+static char*
+epic_pci_probe(
+ pcici_t config_id,
+ pcidi_t device_id)
+{
+ if( PCI_VENDORID(device_id) != SMC_VENDORID )
+ return NULL;
+
+ if( PCI_CHIPID(device_id) == CHIPID_83C170 )
+ return "SMC 83c170";
+
+ return NULL;
+}
+
+/*
+ * Synopsis: Allocate memory for softc, descriptors and frag lists.
+ * Connect to interrupt, and get memory/io address of card registers.
+ * Preinitialize softc structure, attach to if manager, ifmedia manager
+ * and bpf. Read media configuration and etc.
+ *
+ * splimp() invoked here
+ */
+static void
+epic_pci_attach(
+ pcici_t config_id,
+ int unit)
+{
+ struct ifnet * ifp;
+ epic_softc_t *sc;
+#if defined(EPIC_USEIOSPACE)
+ u_int32_t iobase;
+#else
+ caddr_t pmembase;
+#endif
+ int i,k,s,tmp;
+ u_int32_t pool;
+
+ /* Allocate memory for softc, hardware descriptors and frag lists */
+ sc = (epic_softc_t *) malloc(
+ sizeof(epic_softc_t) +
+ sizeof(struct epic_frag_list)*TX_RING_SIZE +
+ sizeof(struct epic_rx_desc)*RX_RING_SIZE +
+ sizeof(struct epic_tx_desc)*TX_RING_SIZE + PAGE_SIZE,
+ M_DEVBUF, M_NOWAIT);
+
+ if (sc == NULL) return;
+
+ /* Align pool on PAGE_SIZE */
+ pool = ((u_int32_t)sc) + sizeof(epic_softc_t);
+ pool = (pool + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
+
+ /* Preinitialize softc structure */
+ bzero(sc, sizeof(epic_softc_t));
+ sc->unit = unit;
+
+ /* Fill ifnet structure */
+ ifp = &sc->epic_if;
+ ifp->if_unit = unit;
+ ifp->if_name = "tx";
+ ifp->if_softc = sc;
+ ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
+ ifp->if_ioctl = epic_ifioctl;
+ ifp->if_start = epic_ifstart;
+ ifp->if_watchdog = epic_ifwatchdog;
+ ifp->if_init = (if_init_f_t*)epic_init;
+ ifp->if_timer = 0;
+ ifp->if_output = ether_output;
+
+ /* Get iobase or membase */
+#if defined(EPIC_USEIOSPACE)
+ if (!pci_map_port(config_id, PCI_CBIO,(u_short *) &(sc->iobase))) {
+ printf("tx%d: cannot map port\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+#else
+ if (!pci_map_mem(config_id, PCI_CBMA,(vm_offset_t *) &(sc->csr),(vm_offset_t *) &pmembase)) {
+ printf("tx%d: cannot map memory\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+#endif
+
+ sc->tx_flist = (void *)pool;
+ pool += sizeof(struct epic_frag_list)*TX_RING_SIZE;
+ sc->rx_desc = (void *)pool;
+ pool += sizeof(struct epic_rx_desc)*RX_RING_SIZE;
+ sc->tx_desc = (void *)pool;
+
+ /* Bring the chip out of low-power mode. */
+ CSR_WRITE_4( sc, GENCTL, 0x0000 );
+
+ /* Magic?! If we don't set this bit the MII interface won't work. */
+ CSR_WRITE_4( sc, TEST1, 0x0008 );
+
+ /* Read mac address from EEPROM */
+ for (i = 0; i < ETHER_ADDR_LEN / sizeof(u_int16_t); i++)
+ ((u_int16_t *)sc->epic_macaddr)[i] = epic_read_eeprom(sc,i);
+
+ /* Display ethernet address ,... */
+ printf("tx%d: address %02x:%02x:%02x:%02x:%02x:%02x,",sc->unit,
+ sc->epic_macaddr[0],sc->epic_macaddr[1],sc->epic_macaddr[2],
+ sc->epic_macaddr[3],sc->epic_macaddr[4],sc->epic_macaddr[5]);
+
+ /* board type and ... */
+ printf(" type ");
+ for(i=0x2c;i<0x32;i++) {
+ tmp = epic_read_eeprom( sc, i );
+ if( ' ' == (u_int8_t)tmp ) break;
+ printf("%c",(u_int8_t)tmp);
+ tmp >>= 8;
+ if( ' ' == (u_int8_t)tmp ) break;
+ printf("%c",(u_int8_t)tmp);
+ }
+
+ /* Read current media config and display it too */
+ i = PHY_READ_2( sc, DP83840_BMCR );
+#if defined(_NET_IF_MEDIA_H_)
+ tmp = IFM_ETHER;
+#endif
+ if( i & BMCR_AUTONEGOTIATION ){
+ printf(", Auto-Neg ");
+
+ /* To avoid bug in QS6612 read LPAR enstead of BMSR */
+ i = PHY_READ_2( sc, DP83840_LPAR );
+ if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps ");
+ else printf("10Mbps ");
+ if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf("FD");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_AUTO;
+#endif
+ } else {
+#if !defined(_NET_IF_MEDIA_H_)
+ ifp->if_flags |= IFF_LINK0;
+#endif
+ if( i & BMCR_100MBPS ) {
+ printf(", 100Mbps ");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_100_TX;
+#else
+ ifp->if_flags |= IFF_LINK2;
+#endif
+ } else {
+ printf(", 10Mbps ");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_10_T;
+#endif
+ }
+ if( i & BMCR_FULL_DUPLEX ) {
+ printf("FD");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_FDX;
+#else
+ ifp->if_flags |= IFF_LINK1;
+#endif
+ }
+ }
+
+ /* Init ifmedia interface */
+#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
+ ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
+ ifmedia_set(&sc->ifmedia, tmp);
+#endif
+
+ /* Identify PHY */
+ sc->phyid = PHY_READ_2(sc, DP83840_PHYIDR1 )<<6;
+ sc->phyid|= (PHY_READ_2( sc, DP83840_PHYIDR2 )>>10)&0x3F;
+ if( QS6612_OUI != sc->phyid ) printf("tx%d: WARNING! phy unknown (0x%x), ",sc->unit,sc->phyid);
+
+ s = splimp();
+
+ /* Map interrupt */
+ if( !pci_map_int(config_id, epic_intr_normal, (void*)sc, &net_imask) ) {
+ printf("tx%d: couldn't map interrupt\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+
+ /* Set shut down routine to stop DMA processes on reboot */
+ at_shutdown(epic_shutdown, sc, SHUTDOWN_POST_SYNC);
+
+ /* Attach to if manager */
+ if_attach(ifp);
+ ether_ifattach(ifp);
+
+#if NBPFILTER > 0
+ bpfattach(ifp,DLT_EN10MB, sizeof(struct ether_header));
+#endif
+
+ splx(s);
+
+ printf("\n");
+
+ return;
+}
+
#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
static int
epic_ifmedia_change __P((
struct ifnet * ifp))
{
- epic_softc_t *sc = (epic_softc_t *)(ifp->if_softc);
-
- if (IFM_TYPE(sc->ifmedia.ifm_media) != IFM_ETHER)
+ if (IFM_TYPE(((epic_softc_t *)(ifp->if_softc))->ifmedia.ifm_media) != IFM_ETHER)
return (EINVAL);
- epic_set_media_speed(sc);
+ epic_set_media_speed( ifp->if_softc );
return 0;
}
@@ -1176,8 +844,8 @@ epic_ifmedia_status __P((
struct ifmediareq *ifmr))
{
epic_softc_t *sc = ifp->if_softc;
- u_int32_t bmcr;
- u_int32_t bmsr;
+ u_int32_t bmcr;
+ u_int32_t bmsr;
bmcr = PHY_READ_2( sc, DP83840_BMCR );
@@ -1188,8 +856,7 @@ epic_ifmedia_status __P((
ifmr->ifm_status = IFM_AVALID;
if( !(bmsr & BMSR_LINK_STATUS) ) {
- ifmr->ifm_active |=
- (bmcr&BMCR_AUTONEGOTIATION)?IFM_AUTO:IFM_NONE;
+ ifmr->ifm_active |= (bmcr&BMCR_AUTONEGOTIATION)?IFM_AUTO:IFM_NONE;
return;
}
@@ -1209,8 +876,8 @@ static int
epic_init __P((
epic_softc_t * sc))
{
- struct ifnet *ifp = &sc->sc_if;
- int s;
+ struct ifnet *ifp = &sc->epic_if;
+ int i,s;
s = splimp();
@@ -1228,7 +895,7 @@ epic_init __P((
/* Initialize rings */
if( epic_init_rings( sc ) ) {
- printf(EPIC_FORMAT ": failed to init rings\n",EPIC_ARGS(sc));
+ printf("\ntx%d: failed to initialize rings",sc->unit);
splx(s);
return -1;
}
@@ -1238,12 +905,16 @@ epic_init __P((
CSR_WRITE_4( sc, PTCDAR, vtophys( sc->tx_desc ) );
/* Put node address to EPIC */
- CSR_WRITE_4( sc, LAN0, ((u_int16_t *)sc->sc_macaddr)[0] );
- CSR_WRITE_4( sc, LAN1, ((u_int16_t *)sc->sc_macaddr)[1] );
- CSR_WRITE_4( sc, LAN2, ((u_int16_t *)sc->sc_macaddr)[2] );
+ CSR_WRITE_4( sc, LAN0, ((u_int16_t *)sc->epic_macaddr)[0] );
+ CSR_WRITE_4( sc, LAN1, ((u_int16_t *)sc->epic_macaddr)[1] );
+ CSR_WRITE_4( sc, LAN2, ((u_int16_t *)sc->epic_macaddr)[2] );
+
+#if defined(EARLY_TX)
+ /* Set transmit threshold */
+ CSR_WRITE_4( sc, ETXTHR, TRANSMIT_THRESHOLD );
+#endif
- /* Set tx mode, includeing transmit threshold */
- epic_set_tx_mode(sc);
+ CSR_WRITE_4( sc, IPG, 0x1010 );
/* Compute and set RXCON. */
epic_set_rx_mode( sc );
@@ -1288,7 +959,7 @@ static void
epic_set_rx_mode(
epic_softc_t * sc)
{
- u_int32_t flags = sc->sc_if.if_flags;
+ u_int32_t flags = sc->epic_if.if_flags;
u_int32_t rxcon = RXCON_DEFAULT | RXCON_RECEIVE_MULTICAST_FRAMES | RXCON_RECEIVE_BROADCAST_FRAMES;
rxcon |= (flags & IFF_PROMISC)?RXCON_PROMISCUOUS_MODE:0;
@@ -1313,7 +984,7 @@ epic_init_phy __P((
if( !(PHY_READ_2( sc, DP83840_BMCR ) & BMCR_RESET) ) break;
if( PHY_READ_2( sc, DP83840_BMCR ) & BMCR_RESET )
- printf(EPIC_FORMAT ": WARNING! cannot reset PHY\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! cannot reset PHY",sc->unit);
switch( sc->phyid ){
case QS6612_OUI:
@@ -1340,7 +1011,7 @@ epic_set_media_speed __P((
{
u_int16_t media;
-#if !defined(EPIC_NOIFMEDIA)
+#if defined(_NET_IF_MEDIA_H_)
u_int32_t tgtmedia = sc->ifmedia.ifm_cur->ifm_media;
if( IFM_SUBTYPE(tgtmedia) != IFM_AUTO ){
@@ -1348,42 +1019,40 @@ epic_set_media_speed __P((
media = (IFM_SUBTYPE(tgtmedia)==IFM_100_TX) ? BMCR_100MBPS : 0;
media|= (tgtmedia&IFM_FDX) ? BMCR_FULL_DUPLEX : 0;
- sc->sc_if.if_baudrate =
+ sc->epic_if.if_baudrate =
(IFM_SUBTYPE(tgtmedia)==IFM_100_TX)?100000000:10000000;
PHY_WRITE_2( sc, DP83840_BMCR, media );
- if( tgtmedia & IFM_FDX ) sc->txcon |= TXCON_FULL_DUPLEX;
- else sc->txcon &= ~TXCON_FULL_DUPLEX;
- if( tgtmedia & IFM_LOOP ) sc->txcon |= TXCON_LOOPBACK_MODE_INT;
- else sc->txcon &= ~TXCON_LOOPBACK_MODE_INT;
+ media = TXCON_DEFAULT;
+ if( tgtmedia & IFM_FDX ) media |= TXCON_FULL_DUPLEX;
+ else if( tgtmedia & IFM_LOOP ) media |= TXCON_LOOPBACK_MODE_INT;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ CSR_WRITE_4( sc, TXCON, media );
}
-#else /* EPIC_NOIFMEDIA */
- struct ifnet *ifp = &sc->sc_if;
+#else
+ struct ifnet *ifp = &sc->epic_if;
if( ifp->if_flags & IFF_LINK0 ) {
/* Set mode */
media = (ifp->if_flags & IFF_LINK2) ? BMCR_100MBPS : 0;
media|= (ifp->if_flags & IFF_LINK1) ? BMCR_FULL_DUPLEX : 0;
- sc->sc_if.if_baudrate =
+ sc->epic_if.if_baudrate =
(ifp->if_flags & IFF_LINK2)?100000000:10000000;
PHY_WRITE_2( sc, DP83840_BMCR, media );
- if( ifp->if_flags & IFF_LINK2 ) sc->txcon |= TXCON_FULL_DUPLEX;
- else sc->txcon &= ~TXCON_FULL_DUPLEX;
+ media = TXCON_DEFAULT;
+ media |= (ifp->if_flags&IFF_LINK2)?TXCON_FULL_DUPLEX:0;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ CSR_WRITE_4( sc, TXCON, media );
}
-#endif /* !EPIC_NOIFMEDIA */
+#endif
else {
- sc->sc_if.if_baudrate = 100000000;
+ sc->epic_if.if_baudrate = 100000000;
- sc->txcon &= ~TXCON_FULL_DUPLEX;
- CSR_WRITE_4(sc, TXCON, sc->txcon);
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT );
/* Set and restart autoneg */
PHY_WRITE_2( sc, DP83840_BMCR,
@@ -1397,10 +1066,8 @@ epic_set_media_speed __P((
*/
DELAY(3000000);
- if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
- sc->txcon |= TXCON_FULL_DUPLEX;
- CSR_WRITE_4(sc, TXCON, sc->txcon);
- }
+ if( epic_autoneg(sc) == EPIC_FULL_DUPLEX )
+ CSR_WRITE_4( sc, TXCON, TXCON_FULL_DUPLEX|TXCON_DEFAULT);
}
/* Else it will be done when GP2 int occured */
}
@@ -1418,6 +1085,7 @@ static int
epic_autoneg(
epic_softc_t * sc)
{
+ struct ifnet *ifp = &sc->epic_if;
u_int16_t media;
u_int16_t i;
@@ -1487,19 +1155,6 @@ epic_autoneg(
}
/*
- */
-static void
-epic_set_tx_mode (
- epic_softc_t *sc )
-{
-
- if( sc->txcon & TXCON_EARLY_TRANSMIT_ENABLE )
- CSR_WRITE_4( sc, ETXTHR, sc->tx_threshold );
-
- CSR_WRITE_4( sc, TXCON, sc->txcon );
-}
-
-/*
* Synopsis: This function should update multicast hash table.
* I suppose there is a bug in chips MC filter so this function
* only set it to receive all MC packets. The second problem is
@@ -1511,7 +1166,7 @@ static void
epic_set_mc_table (
epic_softc_t * sc)
{
- struct ifnet *ifp = &sc->sc_if;
+ struct ifnet *ifp = &sc->epic_if;
if( ifp->if_flags & IFF_MULTICAST ){
CSR_WRITE_4( sc, MC0, 0xFFFF );
@@ -1523,16 +1178,24 @@ epic_set_mc_table (
return;
}
+static void
+epic_shutdown(
+ int howto,
+ void *sc)
+{
+ epic_stop(sc);
+}
/*
- * Synopsis: Start receive process and transmit, if need
+ * Synopsis: Start receive process, should check that all internal chip
+ * pointers are set properly.
*/
static void
epic_start_activity __P((
epic_softc_t * sc))
{
/* Start rx process */
- CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED | COMMAND_START_RX | (sc->pending_txs?COMMAND_TXQUEUED:0));
+ CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED | COMMAND_START_RX );
}
/*
@@ -1543,56 +1206,43 @@ static void
epic_stop_activity __P((
epic_softc_t * sc))
{
- int i;
+ int i;
- /* Turn it to loopback mode */
- CSR_WRITE_4( sc, TXCON, TXCON_SLOT_TIME|TXCON_LOOPBACK_MODE_INT );
+ /* Stop Tx and Rx DMA */
+ CSR_WRITE_4( sc, COMMAND, COMMAND_STOP_RX | COMMAND_STOP_RDMA | COMMAND_STOP_TDMA);
- /* Stop Tx and Rx DMA */
- CSR_WRITE_4(sc,COMMAND,COMMAND_STOP_RX|COMMAND_STOP_RDMA|COMMAND_STOP_TDMA);
+ /* Wait only Rx DMA */
+ dprintf(("\ntx%d: waiting Rx DMA to stop",sc->unit));
+ for(i=0;i<0x100000;i++)
+ if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) == INTSTAT_RXIDLE ) break;
- /* Wait only Rx DMA */
- dprintf((EPIC_FORMAT ": waiting Rx DMA to stop\n",EPIC_ARGS(sc)));
- for(i=0;i<0x1000;i++) {
- if( (CSR_READ_4(sc,INTSTAT) & INTSTAT_RXIDLE) == INTSTAT_RXIDLE )
- break;
- DELAY(1);
- }
-
- if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) )
- printf(EPIC_FORMAT ": can't stop RX DMA\n",EPIC_ARGS(sc));
-
- /* May need to queue one more packet if TQE */
- if( (CSR_READ_4( sc, INTSTAT ) & INTSTAT_TQE) &&
- !(CSR_READ_4( sc, INTSTAT ) & INTSTAT_TXIDLE) ){
- dprintf((EPIC_FORMAT ": queue last packet\n",EPIC_ARGS(sc)));
-
- sc->tx_desc[sc->cur_tx].bufaddr = vtophys( sc );
- sc->tx_desc[sc->cur_tx].buflength = ETHER_MIN_LEN-ETHER_CRC_LEN;
- sc->tx_desc[sc->cur_tx].control = 0x14;
- sc->tx_desc[sc->cur_tx].txlength = ETHER_MIN_LEN-ETHER_CRC_LEN;
- sc->tx_desc[sc->cur_tx].status = 0x8000;
- sc->cur_tx = (sc->cur_tx + 1) & TX_RING_MASK;
- sc->pending_txs++;
-
- CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
-
- dprintf((EPIC_FORMAT ": waiting Tx DMA to stop\n",EPIC_ARGS(sc)));
- /* Wait TX DMA to stop */
- for(i=0;i<0x1000;i++) {
- if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) == INTSTAT_TXIDLE ) {
- sc->pending_txs--;
- break;
- }
- DELAY(1);
- }
+ if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) )
+ printf("\ntx%d: can't stop RX DMA",sc->unit);
- if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) )
- printf(EPIC_FORMAT ": can't stop TX DMA\n",EPIC_ARGS(sc));
+ /* May need to queue one more packet if TQE */
+ if( (CSR_READ_4( sc, INTSTAT ) & INTSTAT_TQE) &&
+ !(CSR_READ_4( sc, INTSTAT ) & INTSTAT_TXIDLE) ){
+ dprintf(("\ntx%d: queue last packet",sc->unit));
- /* Restore old TX state */
- CSR_WRITE_4( sc, TXCON, sc->txcon );
- }
+ /* Turn it to loopback mode */
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT|TXCON_LOOPBACK_MODE_INT );
+
+ sc->tx_desc[sc->cur_tx].bufaddr = vtophys( sc );
+ sc->tx_desc[sc->cur_tx].buflength = ETHER_MIN_LEN-ETHER_CRC_LEN;
+ sc->tx_desc[sc->cur_tx].control = 0x14;
+ sc->tx_desc[sc->cur_tx].txlength = ETHER_MIN_LEN-ETHER_CRC_LEN;
+ sc->tx_desc[sc->cur_tx].status = 0x8000;
+
+ CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
+
+ dprintf(("\ntx%d: waiting Tx DMA to stop",sc->unit));
+ /* Wait TX DMA to stop */
+ for(i=0;i<0x100000;i++)
+ if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) == INTSTAT_TXIDLE ) break;
+
+ if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) )
+ printf("\ntx%d: can't stop TX DMA",sc->unit);
+ }
}
/*
@@ -1604,11 +1254,11 @@ static void
epic_stop __P((
epic_softc_t * sc))
{
- int s;
+ int i,s;
s = splimp();
- sc->sc_if.if_timer = 0;
+ sc->epic_if.if_timer = 0;
/* Disable interrupts */
CSR_WRITE_4( sc, INTMASK, 0 );
@@ -1619,13 +1269,13 @@ epic_stop __P((
/* Reset chip */
CSR_WRITE_4( sc, GENCTL, GENCTL_SOFT_RESET );
- DELAY(10);
+ DELAY(1);
/* Free memory allocated for rings */
epic_free_rings(sc);
/* Mark as stoped */
- sc->sc_if.if_flags &= ~IFF_RUNNING;
+ sc->epic_if.if_flags &= ~IFF_RUNNING;
splx(s);
return;
@@ -1673,6 +1323,7 @@ epic_free_rings __P((
static int
epic_init_rings(epic_softc_t * sc){
int i;
+ struct mbuf *m;
sc->cur_rx = sc->cur_tx = sc->dirty_tx = sc->pending_txs = 0;
@@ -1681,10 +1332,10 @@ epic_init_rings(epic_softc_t * sc){
struct epic_rx_desc *desc = sc->rx_desc + i;
desc->status = 0; /* Owned by driver */
- desc->next = vtophys( sc->rx_desc + ((i+1) & RX_RING_MASK) );
+ desc->next = vtophys( sc->rx_desc + ((i+1)%RX_RING_SIZE) );
if( (desc->next & 3) || ((desc->next & 0xFFF) + sizeof(struct epic_rx_desc) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! rx_desc is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! rx_desc is misbound or misaligned",sc->unit);
EPIC_MGETCLUSTER( buf->mbuf );
if( NULL == buf->mbuf ) {
@@ -1703,15 +1354,15 @@ epic_init_rings(epic_softc_t * sc){
struct epic_tx_desc *desc = sc->tx_desc + i;
desc->status = 0;
- desc->next = vtophys( sc->tx_desc + ( (i+1) & TX_RING_MASK ) );
+ desc->next = vtophys( sc->tx_desc + ( (i+1)%TX_RING_SIZE ) );
if( (desc->next & 3) || ((desc->next & 0xFFF) + sizeof(struct epic_tx_desc) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! tx_desc is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! tx_desc is misbound or misaligned",sc->unit);
buf->mbuf = NULL;
desc->bufaddr = vtophys( sc->tx_flist + i );
if( (desc->bufaddr & 3) || ((desc->bufaddr & 0xFFF) + sizeof(struct epic_frag_list) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! frag_list is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! frag_list is misbound or misaligned",sc->unit);
}
return 0;
@@ -1787,6 +1438,7 @@ epic_read_eeprom __P((
epic_softc_t *sc,
u_int16_t loc))
{
+ int i;
u_int16_t dataval;
u_int16_t read_cmd;
@@ -1843,13 +1495,14 @@ epic_dump_state __P((
int j;
struct epic_tx_desc *tdesc;
struct epic_rx_desc *rdesc;
- printf(EPIC_FORMAT ": cur_rx: %d, pending_txs: %d, dirty_tx: %d, cur_tx: %d\n", EPIC_ARGS(sc),sc->cur_rx,sc->pending_txs,sc->dirty_tx,sc->cur_tx);
- printf(EPIC_FORMAT ": COMMAND: 0x%08x, INTSTAT: 0x%08x\n",EPIC_ARGS(sc),CSR_READ_4(sc,COMMAND),CSR_READ_4(sc,INTSTAT));
- printf(EPIC_FORMAT ": PRCDAR: 0x%08x, PTCDAR: 0x%08x\n",EPIC_ARGS(sc),CSR_READ_4(sc,PRCDAR),CSR_READ_4(sc,PTCDAR));
- printf(EPIC_FORMAT ": dumping rx descriptors\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cur_rx: %d, pending_txs: %d, dirty_tx: %d, cur_tx: %d",
+ sc->unit,sc->cur_rx,sc->pending_txs,sc->dirty_tx,sc->cur_tx);
+ printf("\ntx%d: COMMAND: 0x%08x, INTSTAT: 0x%08x",sc->unit,CSR_READ_4(sc,COMMAND),CSR_READ_4(sc,INTSTAT));
+ printf("\ntx%d: PRCDAR: 0x%08x, PTCDAR: 0x%08x",sc->unit,CSR_READ_4(sc,PRCDAR),CSR_READ_4(sc,PTCDAR));
+ printf("\ntx%d: dumping rx descriptors",sc->unit);
for(j=0;j<RX_RING_SIZE;j++){
rdesc = sc->rx_desc + j;
- printf("desc%d: %4d 0x%04x, 0x%08x, %4d, 0x%08x\n",
+ printf("\ndesc%d: %4d 0x%04x, 0x%08x, %4d, 0x%08x",
j,
rdesc->rxlength,rdesc->status,
rdesc->bufaddr,
@@ -1857,11 +1510,11 @@ epic_dump_state __P((
rdesc->next
);
}
- printf(EPIC_FORMAT ": dumping tx descriptors\n",EPIC_ARGS(sc));
+ printf("\ntx%d: dumping tx descriptors",sc->unit);
for(j=0;j<TX_RING_SIZE;j++){
tdesc = sc->tx_desc + j;
printf(
- "desc%d: %4d 0x%04x, 0x%08lx, 0x%04x %4u, 0x%08lx, mbuf: %p\n",
+ "\ndesc%d: %4d 0x%04x, 0x%08lx, 0x%04x %4u, 0x%08lx, mbuf: %p",
j,
tdesc->txlength,tdesc->status,
(u_long)tdesc->bufaddr,
diff --git a/sys/pci/if_txvar.h b/sys/pci/if_txvar.h
deleted file mode 100644
index efa282c247aa..000000000000
--- a/sys/pci/if_txvar.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/* $OpenBSD: if_txvar.h,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-/* $Id: if_txvar.h,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-
-/*-
- * Copyright (c) 1997 Semen Ustimenko
- * 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.
- *
- *
- */
-
-/*
- * Configuration
- */
-#ifndef ETHER_MAX_LEN
-#define ETHER_MAX_LEN 1518
-#endif
-#ifndef ETHER_MIN_LEN
-#define ETHER_MIN_LEN 64
-#endif
-#ifndef ETHER_CRC_LEN
-#define ETHER_CRC_LEN 4
-#endif
-#define TX_RING_SIZE 16 /* Leave this a power of 2 */
-#define RX_RING_SIZE 16 /* And this too, to do not */
- /* confuse RX(TX)_RING_MASK */
-#define TX_RING_MASK (TX_RING_SIZE - 1)
-#define RX_RING_MASK (RX_RING_SIZE - 1)
-#define EPIC_FULL_DUPLEX 1
-#define EPIC_HALF_DUPLEX 0
-#define ETHER_MAX_FRAME_LEN (ETHER_MAX_LEN + ETHER_CRC_LEN)
-#define EPIC_LINK_DOWN 0x00000001
-
-/* PCI identification */
-#define SMC_VENDORID 0x10B8
-#define CHIPID_83C170 0x0005
-#define PCI_VENDORID(x) ((x) & 0xFFFF)
-#define PCI_CHIPID(x) (((x) >> 16) & 0xFFFF)
-
-/* PCI configuration */
-#define PCI_CFID 0x00 /* Configuration ID */
-#define PCI_CFCS 0x04 /* Configurtion Command/Status */
-#define PCI_CFRV 0x08 /* Configuration Revision */
-#define PCI_CFLT 0x0c /* Configuration Latency Timer */
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
-#define PCI_CBMA 0x14 /* Configuration Base Memory Address */
-#define PCI_CFIT 0x3c /* Configuration Interrupt */
-#define PCI_CFDA 0x40 /* Configuration Driver Area */
-
-#define PCI_CONF_WRITE(r, v) pci_conf_write(config_id, (r), (v))
-#define PCI_CONF_READ(r) pci_conf_read(config_id, (r))
-
-/* EPIC's registers */
-#define COMMAND 0x0000
-#define INTSTAT 0x0004 /* Interrupt status. See below */
-#define INTMASK 0x0008 /* Interrupt mask. See below */
-#define GENCTL 0x000C
-#define NVCTL 0x0010
-#define EECTL 0x0014 /* EEPROM control **/
-#define TEST1 0x001C /* XXXXX */
-#define CRCCNT 0x0020 /* CRC error counter */
-#define ALICNT 0x0024 /* FrameTooLang error counter */
-#define MPCNT 0x0028 /* MissedFrames error counters */
-#define MIICTL 0x0030
-#define MIIDATA 0x0034
-#define MIICFG 0x0038
-#define IPG 0x003C
-#define LAN0 0x0040 /* MAC address */
-#define LAN1 0x0044 /* MAC address */
-#define LAN2 0x0048 /* MAC address */
-#define ID_CHK 0x004C
-#define MC0 0x0050 /* Multicast filter table */
-#define MC1 0x0054 /* Multicast filter table */
-#define MC2 0x0058 /* Multicast filter table */
-#define MC3 0x005C /* Multicast filter table */
-#define RXCON 0x0060 /* Rx control register */
-#define TXCON 0x0070 /* Tx control register */
-#define TXSTAT 0x0074
-#define PRCDAR 0x0084 /* RxRing bus address */
-#define PRSTAT 0x00A4
-#define PRCPTHR 0x00B0
-#define PTCDAR 0x00C4 /* TxRing bus address */
-#define ETXTHR 0x00DC
-
-#define COMMAND_STOP_RX 0x01
-#define COMMAND_START_RX 0x02
-#define COMMAND_TXQUEUED 0x04
-#define COMMAND_RXQUEUED 0x08
-#define COMMAND_NEXTFRAME 0x10
-#define COMMAND_STOP_TDMA 0x20
-#define COMMAND_STOP_RDMA 0x40
-#define COMMAND_TXUGO 0x80
-
-/* Tx threshold */
-#define TX_FIFO_THRESH 0x80 /* 0x40 or 0x10 */
-
-/* Interrupt register bits */
-#define INTSTAT_RCC 0x00000001
-#define INTSTAT_HCC 0x00000002
-#define INTSTAT_RQE 0x00000004
-#define INTSTAT_OVW 0x00000008
-#define INTSTAT_RXE 0x00000010
-#define INTSTAT_TXC 0x00000020
-#define INTSTAT_TCC 0x00000040
-#define INTSTAT_TQE 0x00000080
-#define INTSTAT_TXU 0x00000100
-#define INTSTAT_CNT 0x00000200
-#define INTSTAT_PREI 0x00000400
-#define INTSTAT_RCT 0x00000800
-#define INTSTAT_FATAL 0x00001000 /* One of DPE,APE,PMA,PTA happend */
-#define INTSTAT_UNUSED1 0x00002000
-#define INTSTAT_UNUSED2 0x00004000
-#define INTSTAT_GP2 0x00008000 /* PHY Event */
-#define INTSTAT_INT_ACTV 0x00010000
-#define INTSTAT_RXIDLE 0x00020000
-#define INTSTAT_TXIDLE 0x00040000
-#define INTSTAT_RCIP 0x00080000
-#define INTSTAT_TCIP 0x00100000
-#define INTSTAT_RBE 0x00200000
-#define INTSTAT_RCTS 0x00400000
-#define INTSTAT_RSV 0x00800000
-#define INTSTAT_DPE 0x01000000 /* PCI Fatal error */
-#define INTSTAT_APE 0x02000000 /* PCI Fatal error */
-#define INTSTAT_PMA 0x04000000 /* PCI Fatal error */
-#define INTSTAT_PTA 0x08000000 /* PCI Fatal error */
-
-#define GENCTL_SOFT_RESET 0x00000001
-#define GENCTL_ENABLE_INTERRUPT 0x00000002
-#define GENCTL_SOFTWARE_INTERRUPT 0x00000004
-#define GENCTL_POWER_DOWN 0x00000008
-#define GENCTL_ONECOPY 0x00000010
-#define GENCTL_BIG_ENDIAN 0x00000020
-#define GENCTL_RECEIVE_DMA_PRIORITY 0x00000040
-#define GENCTL_TRANSMIT_DMA_PRIORITY 0x00000080
-#define GENCTL_RECEIVE_FIFO_THRESHOLD128 0x00000300
-#define GENCTL_RECEIVE_FIFO_THRESHOLD96 0x00000200
-#define GENCTL_RECEIVE_FIFO_THRESHOLD64 0x00000100
-#define GENCTL_RECEIVE_FIFO_THRESHOLD32 0x00000000
-#define GENCTL_MEMORY_READ_LINE 0x00000400
-#define GENCTL_MEMORY_READ_MULTIPLE 0x00000800
-#define GENCTL_SOFTWARE1 0x00001000
-#define GENCTL_SOFTWARE2 0x00002000
-#define GENCTL_RESET_PHY 0x00004000
-
-#define NVCTL_ENABLE_MEMORY_MAP 0x00000001
-#define NVCTL_CLOCK_RUN_SUPPORTED 0x00000002
-#define NVCTL_GP1_OUTPUT_ENABLE 0x00000004
-#define NVCTL_GP2_OUTPUT_ENABLE 0x00000008
-#define NVCTL_GP1 0x00000010
-#define NVCTL_GP2 0x00000020
-#define NVCTL_CARDBUS_MODE 0x00000040
-#define NVCTL_IPG_DELAY_MASK(x) ((x&0xF)<<7)
-
-#define RXCON_SAVE_ERRORED_PACKETS 0x00000001
-#define RXCON_RECEIVE_RUNT_FRAMES 0x00000002
-#define RXCON_RECEIVE_BROADCAST_FRAMES 0x00000004
-#define RXCON_RECEIVE_MULTICAST_FRAMES 0x00000008
-#define RXCON_RECEIVE_INVERSE_INDIVIDUAL_ADDRESS_FRAMES 0x00000010
-#define RXCON_PROMISCUOUS_MODE 0x00000020
-#define RXCON_MONITOR_MODE 0x00000040
-#define RXCON_EARLY_RECEIVE_ENABLE 0x00000080
-#define RXCON_EXTERNAL_BUFFER_DISABLE 0x00000000
-#define RXCON_EXTERNAL_BUFFER_16K 0x00000100
-#define RXCON_EXTERNAL_BUFFER_32K 0x00000200
-#define RXCON_EXTERNAL_BUFFER_128K 0x00000300
-
-#define TXCON_EARLY_TRANSMIT_ENABLE 0x00000001
-#define TXCON_LOOPBACK_DISABLE 0x00000000
-#define TXCON_LOOPBACK_MODE_INT 0x00000002
-#define TXCON_LOOPBACK_MODE_PHY 0x00000004
-#define TXCON_LOOPBACK_MODE 0x00000006
-#define TXCON_FULL_DUPLEX 0x00000006
-#define TXCON_SLOT_TIME 0x00000078
-
-#define TXCON_DEFAULT (TXCON_SLOT_TIME | TXCON_EARLY_TRANSMIT_ENABLE)
-#define TRANSMIT_THRESHOLD 0x80
-
-#if defined(EARLY_RX)
- #define RXCON_DEFAULT (RXCON_EARLY_RECEIVE_ENABLE | RXCON_SAVE_ERRORED_PACKETS)
-#else
- #define RXCON_DEFAULT (0)
-#endif
-/*
- * National Semiconductor's DP83840A Registers and bits
- */
-#define DP83840_OUI 0x080017
-#define DP83840_BMCR 0x00 /* Control register */
-#define DP83840_BMSR 0x01 /* Status rgister */
-#define DP83840_ANAR 0x04 /* Autonegotiation advertising register */
-#define DP83840_LPAR 0x05 /* Link Partner Ability register */
-#define DP83840_ANER 0x06 /* Auto-Negotiation Expansion Register */
-#define DP83840_PAR 0x19 /* PHY Address Register */
-#define DP83840_PHYIDR1 0x02
-#define DP83840_PHYIDR2 0x03
-
-#define BMCR_RESET 0x8000
-#define BMCR_100MBPS 0x2000 /* 10/100 Mbps */
-#define BMCR_AUTONEGOTIATION 0x1000 /* ON/OFF */
-#define BMCR_RESTART_AUTONEG 0x0200
-#define BMCR_FULL_DUPLEX 0x0100
-
-#define BMSR_100BASE_T4 0x8000
-#define BMSR_100BASE_TX_FD 0x4000
-#define BMSR_100BASE_TX 0x2000
-#define BMSR_10BASE_T_FD 0x1000
-#define BMSR_10BASE_T 0x0800
-#define BMSR_AUTONEG_COMPLETE 0x0020
-#define BMSR_AUTONEG_ABLE 0x0008
-#define BMSR_LINK_STATUS 0x0004
-
-#define PAR_FULL_DUPLEX 0x0400
-
-#define ANER_MULTIPLE_LINK_FAULT 0x10
-
-/* ANAR and LPAR have the same bits, define them only once */
-#define ANAR_10 0x0020
-#define ANAR_10_FD 0x0040
-#define ANAR_100_TX 0x0080
-#define ANAR_100_TX_FD 0x0100
-#define ANAR_100_T4 0x0200
-
-/*
- * Quality Semiconductor's QS6612 registers and bits
- */
-#define QS6612_OUI 0x006051
-#define QS6612_MCTL 17
-#define QS6612_INTSTAT 29
-#define QS6612_INTMASK 30
-
-#define MCTL_T4_PRESENT 0x1000 /* External T4 Enabled, ignored */
- /* if AutoNeg is enabled */
-#define MCTL_BTEXT 0x0800 /* Reduces 10baset squelch level */
- /* for extended cable length */
-
-#define INTSTAT_AN_COMPLETE 0x40 /* Autonegotiation complete */
-#define INTSTAT_RF_DETECTED 0x20 /* Remote Fault detected */
-#define INTSTAT_LINK_STATUS 0x10 /* Link status changed */
-#define INTSTAT_AN_LP_ACK 0x08 /* Autoneg. LP Acknoledge */
-#define INTSTAT_PD_FAULT 0x04 /* Parallel Detection Fault */
-#define INTSTAT_AN_PAGE 0x04 /* Autoneg. Page Received */
-#define INTSTAT_RE_CNT_FULL 0x01 /* Receive Error Counter Full */
-
-#define INTMASK_THUNDERLAN 0x8000 /* Enable interrupts */
-
-/*
- * Structures definition and Functions prototypes
- */
-
-/* EPIC's hardware descriptors, must be aligned on dword in memory */
-/* NB: to make driver happy, this two structures MUST have thier sizes */
-/* be divisor of PAGE_SIZE */
-struct epic_tx_desc {
- volatile u_int16_t status;
- volatile u_int16_t txlength;
- volatile u_int32_t bufaddr;
- volatile u_int16_t buflength;
- volatile u_int16_t control;
- volatile u_int32_t next;
-};
-struct epic_rx_desc {
- volatile u_int16_t status;
- volatile u_int16_t rxlength;
- volatile u_int32_t bufaddr;
- volatile u_int32_t buflength;
- volatile u_int32_t next;
-};
-
-/* This structure defines EPIC's fragment list, maximum number of frags */
-/* is 63. Let use maximum, becouse size of struct MUST be divisor of */
-/* PAGE_SIZE, and sometimes come mbufs with more then 30 frags */
-#define EPIC_MAX_FRAGS 63
-struct epic_frag_list {
- volatile u_int32_t numfrags;
- struct {
- volatile u_int32_t fragaddr;
- volatile u_int32_t fraglen;
- } frag[EPIC_MAX_FRAGS];
- volatile u_int32_t pad; /* align on 256 bytes */
-};
-
-/* This is driver's structure to define EPIC descriptors */
-struct epic_rx_buffer {
- struct mbuf * mbuf; /* mbuf receiving packet */
-};
-
-struct epic_tx_buffer {
- struct mbuf * mbuf; /* mbuf contained packet */
-};
-
-/*
- * NB: ALIGN OF ABOVE STRUCTURES
- * epic_rx_desc, epic_tx_desc, epic_frag_list - must be aligned on dword
- */
-
-/* Driver status structure */
-typedef struct {
-#if defined(__OpenBSD__)
- struct device sc_dev;
- void *sc_ih;
- bus_space_tag_t sc_st;
- bus_space_handle_t sc_sh;
-#else /* __FreeBSD__ */
-#if defined(EPIC_USEIOSPACE)
- u_int32_t iobase;
-#else
- caddr_t csr;
-#endif
-#endif
-#if !defined(EPIC_NOIFMEDIA)
- struct ifmedia ifmedia;
-#endif
- struct arpcom arpcom;
- u_int32_t unit;
- struct epic_rx_buffer rx_buffer[RX_RING_SIZE];
- struct epic_tx_buffer tx_buffer[TX_RING_SIZE];
-
- /* Each element of array MUST be aligned on dword */
- /* and bounded on PAGE_SIZE */
- struct epic_rx_desc *rx_desc;
- struct epic_tx_desc *tx_desc;
- struct epic_frag_list *tx_flist;
- u_int32_t flags;
- u_int32_t tx_threshold;
- u_int32_t txcon;
- u_int32_t phyid;
- u_int32_t cur_tx;
- u_int32_t cur_rx;
- u_int32_t dirty_tx;
- u_int32_t pending_txs;
- void *pool;
-} epic_softc_t;
-
-#if defined(__FreeBSD__)
-#define EPIC_FORMAT "tx%d"
-#define EPIC_ARGS(sc) (sc->unit)
-#define sc_if arpcom.ac_if
-#define sc_macaddr arpcom.ac_enaddr
-#if defined(EPIC_USEIOSPACE)
-#define CSR_WRITE_4(sc,reg,val) \
- outl( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_WRITE_2(sc,reg,val) \
- outw( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_WRITE_1(sc,reg,val) \
- outb( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_READ_4(sc,reg) \
- inl( (sc)->iobase + (u_int32_t)(reg) )
-#define CSR_READ_2(sc,reg) \
- inw( (sc)->iobase + (u_int32_t)(reg) )
-#define CSR_READ_1(sc,reg) \
- inb( (sc)->iobase + (u_int32_t)(reg) )
-#else
-#define CSR_WRITE_1(sc,reg,val) \
- ((*(u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
-#define CSR_WRITE_2(sc,reg,val) \
- ((*(u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
-#define CSR_WRITE_4(sc,reg,val) \
- ((*(u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
-#define CSR_READ_1(sc,reg) \
- (*(u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
-#define CSR_READ_2(sc,reg) \
- (*(u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
-#define CSR_READ_4(sc,reg) \
- (*(u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
-#endif
-#else /* __OpenBSD__ */
-#define EPIC_FORMAT "%s"
-#define EPIC_ARGS(sc) (sc->sc_dev.dv_xname)
-#define sc_if arpcom.ac_if
-#define sc_macaddr arpcom.ac_enaddr
-#define CSR_WRITE_4(sc,reg,val) \
- bus_space_write_4( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_WRITE_2(sc,reg,val) \
- bus_space_write_2( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_WRITE_1(sc,reg,val) \
- bus_space_write_1( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_READ_4(sc,reg) \
- bus_space_read_4( (sc)->sc_st, (sc)->sc_sh, (reg) )
-#define CSR_READ_2(sc,reg) \
- bus_space_read_2( (sc)->sc_st, (sc)->sc_sh, (reg) )
-#define CSR_READ_1(sc,reg) \
- bus_space_read_1( (sc)->sc_st, (sc)->sc_sh, (reg) )
-#endif
-
-#define PHY_READ_2(sc,reg) epic_read_phy_register(sc,reg)
-#define PHY_WRITE_2(sc,reg,val) epic_write_phy_register(sc,reg,val)
-
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
deleted file mode 100644
index efed968177dc..000000000000
--- a/sys/pci/if_vr.c
+++ /dev/null
@@ -1,1957 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_vr.c,v 1.16 1999/01/10 18:06:10 wpaul Exp $
- */
-
-/*
- * VIA Rhine fast ethernet PCI NIC driver
- *
- * Supports various network adapters based on the VIA Rhine
- * and Rhine II PCI controllers, including the D-Link DFE530TX.
- * Datasheets are available at http://www.via.com.tw.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The VIA Rhine controllers are similar in some respects to the
- * the DEC tulip chips, except less complicated. The controller
- * uses an MII bus and an external physical layer interface. The
- * receiver has a one entry perfect filter and a 64-bit hash table
- * multicast filter. Transmit and receive descriptors are similar
- * to the tulip.
- *
- * The Rhine has a serious flaw in its transmit DMA mechanism:
- * transmit buffers must be longword aligned. Unfortunately,
- * FreeBSD doesn't guarantee that mbufs will be filled in starting
- * at longword boundaries, so we have to do a buffer copy before
- * transmission.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define VR_USEIOSPACE
-
-/* #define VR_BACKGROUND_AUTONEG */
-
-#include <pci/if_vrreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_vr.c,v 1.16 1999/01/10 18:06:10 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct vr_type vr_devs[] = {
- { VIA_VENDORID, VIA_DEVICEID_RHINE,
- "VIA VT3043 Rhine I 10/100BaseTX" },
- { VIA_VENDORID, VIA_DEVICEID_RHINE_II,
- "VIA VT86C100A Rhine II 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct vr_type vr_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long vr_count = 0;
-static const char *vr_probe __P((pcici_t, pcidi_t));
-static void vr_attach __P((pcici_t, int));
-
-static int vr_newbuf __P((struct vr_softc *,
- struct vr_chain_onefrag *));
-static int vr_encap __P((struct vr_softc *, struct vr_chain *,
- struct mbuf * ));
-
-static void vr_rxeof __P((struct vr_softc *));
-static void vr_rxeoc __P((struct vr_softc *));
-static void vr_txeof __P((struct vr_softc *));
-static void vr_txeoc __P((struct vr_softc *));
-static void vr_intr __P((void *));
-static void vr_start __P((struct ifnet *));
-static int vr_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void vr_init __P((void *));
-static void vr_stop __P((struct vr_softc *));
-static void vr_watchdog __P((struct ifnet *));
-static void vr_shutdown __P((int, void *));
-static int vr_ifmedia_upd __P((struct ifnet *));
-static void vr_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void vr_mii_sync __P((struct vr_softc *));
-static void vr_mii_send __P((struct vr_softc *, u_int32_t, int));
-static int vr_mii_readreg __P((struct vr_softc *, struct vr_mii_frame *));
-static int vr_mii_writereg __P((struct vr_softc *, struct vr_mii_frame *));
-static u_int16_t vr_phy_readreg __P((struct vr_softc *, int));
-static void vr_phy_writereg __P((struct vr_softc *, u_int16_t, u_int16_t));
-
-static void vr_autoneg_xmit __P((struct vr_softc *));
-static void vr_autoneg_mii __P((struct vr_softc *, int, int));
-static void vr_setmode_mii __P((struct vr_softc *, int));
-static void vr_getmode_mii __P((struct vr_softc *));
-static void vr_setcfg __P((struct vr_softc *, u_int16_t));
-static u_int8_t vr_calchash __P((u_int8_t *));
-static void vr_setmulti __P((struct vr_softc *));
-static void vr_reset __P((struct vr_softc *));
-static int vr_list_rx_init __P((struct vr_softc *));
-static int vr_list_tx_init __P((struct vr_softc *));
-
-#define VR_SETBIT(sc, reg, x) \
- CSR_WRITE_1(sc, reg, \
- CSR_READ_1(sc, reg) | x)
-
-#define VR_CLRBIT(sc, reg, x) \
- CSR_WRITE_1(sc, reg, \
- CSR_READ_1(sc, reg) & ~x)
-
-#define VR_SETBIT16(sc, reg, x) \
- CSR_WRITE_2(sc, reg, \
- CSR_READ_2(sc, reg) | x)
-
-#define VR_CLRBIT16(sc, reg, x) \
- CSR_WRITE_2(sc, reg, \
- CSR_READ_2(sc, reg) & ~x)
-
-#define VR_SETBIT32(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define VR_CLRBIT32(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_1(sc, VR_MIICMD, \
- CSR_READ_1(sc, VR_MIICMD) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_1(sc, VR_MIICMD, \
- CSR_READ_1(sc, VR_MIICMD) & ~x)
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void vr_mii_sync(sc)
- struct vr_softc *sc;
-{
- register int i;
-
- SIO_SET(VR_MIICMD_DIR|VR_MIICMD_DATAIN);
-
- for (i = 0; i < 32; i++) {
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void vr_mii_send(sc, bits, cnt)
- struct vr_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- SIO_CLR(VR_MIICMD_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- SIO_SET(VR_MIICMD_DATAIN);
- } else {
- SIO_CLR(VR_MIICMD_DATAIN);
- }
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int vr_mii_readreg(sc, frame)
- struct vr_softc *sc;
- struct vr_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = VR_MII_STARTDELIM;
- frame->mii_opcode = VR_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_1(sc, VR_MIICMD, 0);
- VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
- /*
- * Turn on data xmit.
- */
- SIO_SET(VR_MIICMD_DIR);
-
- vr_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- vr_mii_send(sc, frame->mii_stdelim, 2);
- vr_mii_send(sc, frame->mii_opcode, 2);
- vr_mii_send(sc, frame->mii_phyaddr, 5);
- vr_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- SIO_CLR((VR_MIICMD_CLK|VR_MIICMD_DATAIN));
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- SIO_CLR(VR_MIICMD_DIR);
-
- /* Check for ack */
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- ack = CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT;
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT)
- frame->mii_data |= i;
- DELAY(1);
- }
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- }
-
-fail:
-
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int vr_mii_writereg(sc, frame)
- struct vr_softc *sc;
- struct vr_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
-
- CSR_WRITE_1(sc, VR_MIICMD, 0);
- VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = VR_MII_STARTDELIM;
- frame->mii_opcode = VR_MII_WRITEOP;
- frame->mii_turnaround = VR_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- SIO_SET(VR_MIICMD_DIR);
-
- vr_mii_sync(sc);
-
- vr_mii_send(sc, frame->mii_stdelim, 2);
- vr_mii_send(sc, frame->mii_opcode, 2);
- vr_mii_send(sc, frame->mii_phyaddr, 5);
- vr_mii_send(sc, frame->mii_regaddr, 5);
- vr_mii_send(sc, frame->mii_turnaround, 2);
- vr_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- SIO_CLR(VR_MIICMD_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t vr_phy_readreg(sc, reg)
- struct vr_softc *sc;
- int reg;
-{
- struct vr_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->vr_phy_addr;
- frame.mii_regaddr = reg;
- vr_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void vr_phy_writereg(sc, reg, data)
- struct vr_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- struct vr_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->vr_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- vr_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int8_t vr_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return((crc >> 26) & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void vr_setmulti(sc)
- struct vr_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int8_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_1(sc, VR_RXCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= VR_RXCFG_RX_MULTI;
- CSR_WRITE_1(sc, VR_RXCFG, rxfilt);
- CSR_WRITE_4(sc, VR_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, VR_MAR1, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, VR_MAR0, 0);
- CSR_WRITE_4(sc, VR_MAR1, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = vr_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= VR_RXCFG_RX_MULTI;
- else
- rxfilt &= ~VR_RXCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, VR_MAR0, hashes[0]);
- CSR_WRITE_4(sc, VR_MAR1, hashes[1]);
- CSR_WRITE_1(sc, VR_RXCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void vr_autoneg_xmit(sc)
- struct vr_softc *sc;
-{
- u_int16_t phy_sts;
-
- vr_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(vr_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = vr_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- vr_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void vr_autoneg_mii(sc, flag, verbose)
- struct vr_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = vr_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("vr%d: autonegotiation not supported\n",
- sc->vr_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case VR_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- vr_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case VR_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise vr_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->vr_cdata.vr_tx_head != NULL) {
- sc->vr_want_auto = 1;
- return;
- }
- vr_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->vr_autoneg = 1;
- sc->vr_want_auto = 0;
- return;
- break;
- case VR_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->vr_autoneg = 0;
- break;
- default:
- printf("vr%d: invalid autoneg flag: %d\n", sc->vr_unit, flag);
- return;
- }
-
- if (vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("vr%d: autoneg complete, ", sc->vr_unit);
- phy_sts = vr_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("vr%d: autoneg not complete, ", sc->vr_unit);
- }
-
- media = vr_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = vr_phy_readreg(sc, PHY_ANAR);
- ability = vr_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- vr_setcfg(sc, media);
- vr_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- vr_init(sc);
-
- if (sc->vr_tx_pend) {
- sc->vr_autoneg = 0;
- sc->vr_tx_pend = 0;
- vr_start(ifp);
- }
-
- return;
-}
-
-static void vr_getmode_mii(sc)
- struct vr_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = vr_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("vr%d: PHY status word: %x\n", sc->vr_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("vr%d: 10Mbps half-duplex mode supported\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("vr%d: 10Mbps full-duplex mode supported\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("vr%d: 100Mbps half-duplex mode supported\n",
- sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("vr%d: 100Mbps full-duplex mode supported\n",
- sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("vr%d: 100baseT4 mode supported\n", sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("vr%d: forcing on autoneg support for BT4\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("vr%d: autoneg supported\n", sc->vr_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void vr_setmode_mii(sc, media)
- struct vr_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->vr_autoneg) {
- printf("vr%d: canceling autoneg session\n", sc->vr_unit);
- ifp->if_timer = sc->vr_autoneg = sc->vr_want_auto = 0;
- bmcr = vr_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- vr_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("vr%d: selecting MII, ", sc->vr_unit);
-
- bmcr = vr_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- vr_setcfg(sc, bmcr);
- vr_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void vr_setcfg(sc, bmcr)
- struct vr_softc *sc;
- u_int16_t bmcr;
-{
- int restart = 0;
-
- if (CSR_READ_2(sc, VR_COMMAND) & (VR_CMD_TX_ON|VR_CMD_RX_ON)) {
- restart = 1;
- VR_CLRBIT16(sc, VR_COMMAND, (VR_CMD_TX_ON|VR_CMD_RX_ON));
- }
-
- if (bmcr & PHY_BMCR_DUPLEX)
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX);
- else
- VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX);
-
- if (restart)
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_RX_ON);
-
- return;
-}
-
-static void vr_reset(sc)
- struct vr_softc *sc;
-{
- register int i;
-
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RESET);
-
- for (i = 0; i < VR_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_2(sc, VR_COMMAND) & VR_CMD_RESET))
- break;
- }
- if (i == VR_TIMEOUT)
- printf("vr%d: reset never completed!\n", sc->vr_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
-
- return;
-}
-
-/*
- * Probe for a VIA Rhine chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-vr_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct vr_type *t;
-
- t = vr_devs;
-
- while(t->vr_name != NULL) {
- if ((device_id & 0xFFFF) == t->vr_vid &&
- ((device_id >> 16) & 0xFFFF) == t->vr_did) {
- return(t->vr_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-vr_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef VR_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct vr_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct vr_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct vr_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("vr%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct vr_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, VR_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, VR_PCI_PWRMGMTCTRL);
- if (command & VR_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, VR_PCI_LOIO);
- membase = pci_conf_read(config_id, VR_PCI_LOMEM);
- irq = pci_conf_read(config_id, VR_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("vr%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & VR_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, VR_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, VR_PCI_LOIO, iobase);
- pci_conf_write(config_id, VR_PCI_LOMEM, membase);
- pci_conf_write(config_id, VR_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef VR_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("vr%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, VR_PCI_LOIO,
- (u_int16_t *)(&sc->vr_bhandle))) {
- printf ("vr%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->vr_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("vr%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, VR_PCI_LOMEM, &vbase, &pbase)) {
- printf ("vr%d: couldn't map memory\n", unit);
- goto fail;
- }
-
- sc->vr_bhandle = vbase;
- sc->vr_btag = I386_BUS_SPACE_MEM;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, vr_intr, sc, &net_imask)) {
- printf("vr%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- vr_reset(sc);
-
- /*
- * Get station address. The way the Rhine chips work,
- * you're not allowed to directly access the EEPROM once
- * they've been programmed a special way. Consequently,
- * we need to read the node address from the PAR0 and PAR1
- * registers.
- */
- VR_SETBIT(sc, VR_EECSR, VR_EECSR_LOAD);
- DELAY(200);
- for (i = 0; i < ETHER_ADDR_LEN; i++)
- eaddr[i] = CSR_READ_1(sc, VR_PAR0 + i);
-
- /*
- * A Rhine chip was detected. Inform the world.
- */
- printf("vr%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->vr_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->vr_ldata_ptr = malloc(sizeof(struct vr_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->vr_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("vr%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->vr_ldata = (struct vr_list_data *)sc->vr_ldata_ptr;
- round = (unsigned int)sc->vr_ldata_ptr & 0xF;
- roundptr = sc->vr_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->vr_ldata = (struct vr_list_data *)roundptr;
- bzero(sc->vr_ldata, sizeof(struct vr_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "vr";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = vr_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = vr_start;
- ifp->if_watchdog = vr_watchdog;
- ifp->if_init = vr_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("vr%d: probing for a PHY\n", sc->vr_unit);
- for (i = VR_PHYADDR_MIN; i < VR_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("vr%d: checking address: %d\n",
- sc->vr_unit, i);
- sc->vr_phy_addr = i;
- vr_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(vr_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = vr_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = vr_phy_readreg(sc, PHY_VENID);
- phy_did = vr_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("vr%d: found PHY at address %d, ",
- sc->vr_unit, sc->vr_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = vr_phys;
- while(p->vr_vid) {
- if (phy_vid == p->vr_vid &&
- (phy_did | 0x000F) == p->vr_did) {
- sc->vr_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->vr_pinfo == NULL)
- sc->vr_pinfo = &vr_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("vr%d: PHY type: %s\n",
- sc->vr_unit, sc->vr_pinfo->vr_name);
- } else {
- printf("vr%d: MII without any phy!\n", sc->vr_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, vr_ifmedia_upd, vr_ifmedia_sts);
-
- vr_getmode_mii(sc);
- vr_autoneg_mii(sc, VR_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- vr_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
-
- at_shutdown(vr_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int vr_list_tx_init(sc)
- struct vr_softc *sc;
-{
- struct vr_chain_data *cd;
- struct vr_list_data *ld;
- int i;
-
- cd = &sc->vr_cdata;
- ld = sc->vr_ldata;
- for (i = 0; i < VR_TX_LIST_CNT; i++) {
- cd->vr_tx_chain[i].vr_ptr = &ld->vr_tx_list[i];
- if (i == (VR_TX_LIST_CNT - 1))
- cd->vr_tx_chain[i].vr_nextdesc =
- &cd->vr_tx_chain[0];
- else
- cd->vr_tx_chain[i].vr_nextdesc =
- &cd->vr_tx_chain[i + 1];
- }
-
- cd->vr_tx_free = &cd->vr_tx_chain[0];
- cd->vr_tx_tail = cd->vr_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int vr_list_rx_init(sc)
- struct vr_softc *sc;
-{
- struct vr_chain_data *cd;
- struct vr_list_data *ld;
- int i;
-
- cd = &sc->vr_cdata;
- ld = sc->vr_ldata;
-
- for (i = 0; i < VR_RX_LIST_CNT; i++) {
- cd->vr_rx_chain[i].vr_ptr =
- (struct vr_desc *)&ld->vr_rx_list[i];
- if (vr_newbuf(sc, &cd->vr_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (VR_RX_LIST_CNT - 1)) {
- cd->vr_rx_chain[i].vr_nextdesc =
- &cd->vr_rx_chain[0];
- ld->vr_rx_list[i].vr_next =
- vtophys(&ld->vr_rx_list[0]);
- } else {
- cd->vr_rx_chain[i].vr_nextdesc =
- &cd->vr_rx_chain[i + 1];
- ld->vr_rx_list[i].vr_next =
- vtophys(&ld->vr_rx_list[i + 1]);
- }
- }
-
- cd->vr_rx_head = &cd->vr_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int vr_newbuf(sc, c)
- struct vr_softc *sc;
- struct vr_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("vr%d: no memory for rx list -- packet dropped!\n",
- sc->vr_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("vr%d: no memory for rx list -- packet dropped!\n",
- sc->vr_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->vr_mbuf = m_new;
- c->vr_ptr->vr_status = VR_RXSTAT;
- c->vr_ptr->vr_data = vtophys(mtod(m_new, caddr_t));
- c->vr_ptr->vr_ctl = VR_RXCTL | VR_RXLEN;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void vr_rxeof(sc)
- struct vr_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct vr_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->vr_cdata.vr_rx_head->vr_ptr->vr_status) &
- VR_RXSTAT_OWN)) {
- cur_rx = sc->vr_cdata.vr_rx_head;
- sc->vr_cdata.vr_rx_head = cur_rx->vr_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & VR_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- printf("vr%d: rx error: ", sc->vr_unit);
- switch(rxstat & 0x000000FF) {
- case VR_RXSTAT_CRCERR:
- printf("crc error\n");
- break;
- case VR_RXSTAT_FRAMEALIGNERR:
- printf("frame alignment error\n");
- break;
- case VR_RXSTAT_FIFOOFLOW:
- printf("FIFO overflow\n");
- break;
- case VR_RXSTAT_GIANT:
- printf("received giant packet\n");
- break;
- case VR_RXSTAT_RUNT:
- printf("received runt packet\n");
- break;
- case VR_RXSTAT_BUSERR:
- printf("system bus error\n");
- break;
- case VR_RXSTAT_BUFFERR:
- printf("rx buffer error\n");
- break;
- default:
- printf("unknown rx error\n");
- break;
- }
- cur_rx->vr_ptr->vr_status = VR_RXSTAT;
- cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN;
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->vr_mbuf;
- total_len = VR_RXBYTES(cur_rx->vr_ptr->vr_status);
-
- /*
- * XXX The VIA Rhine chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (vr_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->vr_ptr->vr_status = VR_RXSTAT;
- cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN;
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void vr_rxeoc(sc)
- struct vr_softc *sc;
-{
-
- vr_rxeof(sc);
- VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
- CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void vr_txeof(sc)
- struct vr_softc *sc;
-{
- struct vr_chain *cur_tx;
- struct ifnet *ifp;
- register struct mbuf *n;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- /* Sanity check. */
- if (sc->vr_cdata.vr_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->vr_cdata.vr_tx_head->vr_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->vr_cdata.vr_tx_head;
- txstat = cur_tx->vr_ptr->vr_status;
-
- if (txstat & VR_TXSTAT_OWN)
- break;
-
- if (txstat & VR_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & VR_TXSTAT_DEFER)
- ifp->if_collisions++;
- if (txstat & VR_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions +=(txstat & VR_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- MFREE(cur_tx->vr_mbuf, n);
- cur_tx->vr_mbuf = NULL;
-
- if (sc->vr_cdata.vr_tx_head == sc->vr_cdata.vr_tx_tail) {
- sc->vr_cdata.vr_tx_head = NULL;
- sc->vr_cdata.vr_tx_tail = NULL;
- break;
- }
-
- sc->vr_cdata.vr_tx_head = cur_tx->vr_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void vr_txeoc(sc)
- struct vr_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->vr_cdata.vr_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->vr_cdata.vr_tx_tail = NULL;
- if (sc->vr_want_auto)
- vr_autoneg_mii(sc, VR_FLAG_SCHEDDELAY, 1);
- }
-
- return;
-}
-
-static void vr_intr(arg)
- void *arg;
-{
- struct vr_softc *sc;
- struct ifnet *ifp;
- u_int16_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts. */
- if (!(ifp->if_flags & IFF_UP)) {
- vr_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_2(sc, VR_IMR, 0x0000);
-
- for (;;) {
-
- status = CSR_READ_2(sc, VR_ISR);
- if (status)
- CSR_WRITE_2(sc, VR_ISR, status);
-
- if ((status & VR_INTRS) == 0)
- break;
-
- if (status & VR_ISR_RX_OK)
- vr_rxeof(sc);
-
- if ((status & VR_ISR_RX_ERR) || (status & VR_ISR_RX_NOBUF) ||
- (status & VR_ISR_RX_NOBUF) || (status & VR_ISR_RX_OFLOW) ||
- (status & VR_ISR_RX_DROPPED)) {
- vr_rxeof(sc);
- vr_rxeoc(sc);
- }
-
- if (status & VR_ISR_TX_OK) {
- vr_txeof(sc);
- vr_txeoc(sc);
- }
-
- if ((status & VR_ISR_TX_UNDERRUN)||(status & VR_ISR_TX_ABRT)){
- ifp->if_oerrors++;
- vr_txeof(sc);
- if (sc->vr_cdata.vr_tx_head != NULL) {
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
- }
- }
-
- if (status & VR_ISR_BUSERR) {
- vr_reset(sc);
- vr_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_2(sc, VR_IMR, VR_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- vr_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int vr_encap(sc, c, m_head)
- struct vr_softc *sc;
- struct vr_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct vr_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- m = m_head;
- total_len = 0;
-
- /*
- * The VIA Rhine wants packet buffers to be longword
- * aligned, but very often our mbufs aren't. Rather than
- * waste time trying to decide when to copy and when not
- * to copy, just do it all the time.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("vr%d: no memory for tx list", sc->vr_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("vr%d: no memory for tx list",
- sc->vr_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- /*
- * The Rhine chip doesn't auto-pad, so we have to make
- * sure to pad short frames out to the minimum frame length
- * ourselves.
- */
- if (m_head->m_len < VR_MIN_FRAMELEN) {
- m_new->m_pkthdr.len += VR_MIN_FRAMELEN - m_new->m_len;
- m_new->m_len = m_new->m_pkthdr.len;
- }
- f = c->vr_ptr;
- f->vr_data = vtophys(mtod(m_new, caddr_t));
- f->vr_ctl = total_len = m_new->m_len;
- f->vr_ctl |= VR_TXCTL_TLINK|VR_TXCTL_FIRSTFRAG;
- f->vr_status = 0;
- frag = 1;
- }
-
- c->vr_mbuf = m_head;
- c->vr_ptr->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT;
- c->vr_ptr->vr_next = vtophys(c->vr_nextdesc->vr_ptr);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void vr_start(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
- struct mbuf *m_head = NULL;
- struct vr_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->vr_autoneg) {
- sc->vr_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->vr_cdata.vr_tx_free->vr_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->vr_cdata.vr_tx_free;
-
- while(sc->vr_cdata.vr_tx_free->vr_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->vr_cdata.vr_tx_free;
- sc->vr_cdata.vr_tx_free = cur_tx->vr_nextdesc;
-
- /* Pack the data into the descriptor. */
- vr_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->vr_mbuf);
-#endif
- VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_TX_GO);
- }
-
- /*
- * If there are no frames queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- sc->vr_cdata.vr_tx_tail = cur_tx;
-
- if (sc->vr_cdata.vr_tx_head == NULL)
- sc->vr_cdata.vr_tx_head = start_tx;
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void vr_init(xsc)
- void *xsc;
-{
- struct vr_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->vr_autoneg)
- return;
-
- s = splimp();
-
- if (sc->vr_pinfo != NULL)
- phy_bmcr = vr_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- vr_stop(sc);
- vr_reset(sc);
-
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_THRESH);
- VR_SETBIT(sc, VR_RXCFG, VR_RXTHRESH_STORENFWD);
-
- VR_CLRBIT(sc, VR_TXCFG, VR_TXCFG_TX_THRESH);
- VR_SETBIT(sc, VR_TXCFG, VR_TXTHRESH_STORENFWD);
-
- /* Init circular RX list. */
- if (vr_list_rx_init(sc) == ENOBUFS) {
- printf("vr%d: initialization failed: no "
- "memory for rx buffers\n", sc->vr_unit);
- vr_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- vr_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- VR_SETBIT(sc, VR_RXCFG, VR_RXCFG_RX_PROMISC);
- else
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_PROMISC);
-
- /* Set capture broadcast bit to capture broadcast frames. */
- if (ifp->if_flags & IFF_BROADCAST)
- VR_SETBIT(sc, VR_RXCFG, VR_RXCFG_RX_BROAD);
- else
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_BROAD);
-
- /*
- * Program the multicast filter, if necessary.
- */
- vr_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
-
- /* Enable receiver and transmitter. */
- CSR_WRITE_2(sc, VR_COMMAND, VR_CMD_TX_NOPOLL|VR_CMD_START|
- VR_CMD_TX_ON|VR_CMD_RX_ON|
- VR_CMD_RX_GO);
-
- vr_setcfg(sc, vr_phy_readreg(sc, PHY_BMCR));
-
- CSR_WRITE_4(sc, VR_TXADDR, vtophys(&sc->vr_ldata->vr_tx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_2(sc, VR_ISR, 0xFFFF);
- CSR_WRITE_2(sc, VR_IMR, VR_INTRS);
-
- /* Restore state of BMCR */
- if (sc->vr_pinfo != NULL)
- vr_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int vr_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- vr_autoneg_mii(sc, VR_FLAG_SCHEDDELAY, 1);
- else
- vr_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void vr_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct vr_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = vr_phy_readreg(sc, PHY_LPAR);
- advert = vr_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int vr_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct vr_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- vr_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- vr_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- vr_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void vr_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->vr_autoneg) {
- vr_autoneg_mii(sc, VR_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("vr%d: watchdog timeout\n", sc->vr_unit);
-
- if (!(vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("vr%d: no carrier - transceiver cable problem?\n",
- sc->vr_unit);
-
- vr_stop(sc);
- vr_reset(sc);
- vr_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- vr_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void vr_stop(sc)
- struct vr_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_STOP);
- VR_CLRBIT16(sc, VR_COMMAND, (VR_CMD_RX_ON|VR_CMD_TX_ON));
- CSR_WRITE_2(sc, VR_IMR, 0x0000);
- CSR_WRITE_4(sc, VR_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, VR_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < VR_RX_LIST_CNT; i++) {
- if (sc->vr_cdata.vr_rx_chain[i].vr_mbuf != NULL) {
- m_freem(sc->vr_cdata.vr_rx_chain[i].vr_mbuf);
- sc->vr_cdata.vr_rx_chain[i].vr_mbuf = NULL;
- }
- }
- bzero((char *)&sc->vr_ldata->vr_rx_list,
- sizeof(sc->vr_ldata->vr_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < VR_TX_LIST_CNT; i++) {
- if (sc->vr_cdata.vr_tx_chain[i].vr_mbuf != NULL) {
- m_freem(sc->vr_cdata.vr_tx_chain[i].vr_mbuf);
- sc->vr_cdata.vr_tx_chain[i].vr_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->vr_ldata->vr_tx_list,
- sizeof(sc->vr_ldata->vr_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void vr_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct vr_softc *sc = (struct vr_softc *)arg;
-
- vr_stop(sc);
-
- return;
-}
-
-static struct pci_device vr_device = {
- "vr",
- vr_probe,
- vr_attach,
- &vr_count,
- NULL
-};
-DATA_SET(pcidevice_set, vr_device);
diff --git a/sys/pci/if_vrreg.h b/sys/pci/if_vrreg.h
deleted file mode 100644
index b44dcabd1316..000000000000
--- a/sys/pci/if_vrreg.h
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_vrreg.h,v 1.9 1999/01/10 18:06:10 wpaul Exp $
- */
-
-/*
- * Rhine register definitions.
- */
-
-#define VR_PAR0 0x00 /* node address 0 to 4 */
-#define VR_PAR1 0x04 /* node address 2 to 6 */
-#define VR_RXCFG 0x06 /* receiver config register */
-#define VR_TXCFG 0x07 /* transmit config register */
-#define VR_COMMAND 0x08 /* command register */
-#define VR_ISR 0x0C /* interrupt/status register */
-#define VR_IMR 0x0E /* interrupt mask register */
-#define VR_MAR0 0x10 /* multicast hash 0 */
-#define VR_MAR1 0x14 /* multicast hash 1 */
-#define VR_RXADDR 0x18 /* rx descriptor list start addr */
-#define VR_TXADDR 0x1C /* tx descriptor list start addr */
-#define VR_CURRXDESC0 0x20
-#define VR_CURRXDESC1 0x24
-#define VR_CURRXDESC2 0x28
-#define VR_CURRXDESC3 0x2C
-#define VR_NEXTRXDESC0 0x30
-#define VR_NEXTRXDESC1 0x34
-#define VR_NEXTRXDESC2 0x38
-#define VR_NEXTRXDESC3 0x3C
-#define VR_CURTXDESC0 0x40
-#define VR_CURTXDESC1 0x44
-#define VR_CURTXDESC2 0x48
-#define VR_CURTXDESC3 0x4C
-#define VR_NEXTTXDESC0 0x50
-#define VR_NEXTTXDESC1 0x54
-#define VR_NEXTTXDESC2 0x58
-#define VR_NEXTTXDESC3 0x5C
-#define VR_CURRXDMA 0x60 /* current RX DMA address */
-#define VR_CURTXDMA 0x64 /* current TX DMA address */
-#define VR_TALLYCNT 0x68 /* tally counter test register */
-#define VR_PHYADDR 0x6C
-#define VR_MIISTAT 0x6D
-#define VR_BCR0 0x6E
-#define VR_BCR1 0x6F
-#define VR_MIICMD 0x70
-#define VR_MIIADDR 0x71
-#define VR_MIIDATA 0x72
-#define VR_EECSR 0x74
-#define VR_TEST 0x75
-#define VR_GPIO 0x76
-#define VR_CONFIG 0x78
-#define VR_MPA_CNT 0x7C
-#define VR_CRC_CNT 0x7E
-
-/*
- * RX config bits.
- */
-#define VR_RXCFG_RX_ERRPKTS 0x01
-#define VR_RXCFG_RX_RUNT 0x02
-#define VR_RXCFG_RX_MULTI 0x04
-#define VR_RXCFG_RX_BROAD 0x08
-#define VR_RXCFG_RX_PROMISC 0x10
-#define VR_RXCFG_RX_THRESH 0xE0
-
-#define VR_RXTHRESH_32BYTES 0x00
-#define VR_RXTHRESH_64BYTES 0x20
-#define VR_RXTHRESH_128BYTES 0x40
-#define VR_RXTHRESH_256BYTES 0x60
-#define VR_RXTHRESH_512BYTES 0x80
-#define VR_RXTHRESH_768BYTES 0xA0
-#define VR_RXTHRESH_1024BYTES 0xC0
-#define VR_RXTHRESH_STORENFWD 0xE0
-
-/*
- * TX config bits.
- */
-#define VR_TXCFG_RSVD0 0x01
-#define VR_TXCFG_LOOPBKMODE 0x06
-#define VR_TXCFG_BACKOFF 0x08
-#define VR_TXCFG_RSVD1 0x10
-#define VR_TXCFG_TX_THRESH 0xE0
-
-#define VR_TXTHRESH_32BYTES 0x00
-#define VR_TXTHRESH_64BYTES 0x20
-#define VR_TXTHRESH_128BYTES 0x40
-#define VR_TXTHRESH_256BYTES 0x60
-#define VR_TXTHRESH_512BYTES 0x80
-#define VR_TXTHRESH_768BYTES 0xA0
-#define VR_TXTHRESH_1024BYTES 0xC0
-#define VR_TXTHRESH_STORENFWD 0xE0
-
-/*
- * Command register bits.
- */
-#define VR_CMD_INIT 0x0001
-#define VR_CMD_START 0x0002
-#define VR_CMD_STOP 0x0004
-#define VR_CMD_RX_ON 0x0008
-#define VR_CMD_TX_ON 0x0010
-#define VR_CMD_TX_GO 0x0020
-#define VR_CMD_RX_GO 0x0040
-#define VR_CMD_RSVD 0x0080
-#define VR_CMD_RX_EARLY 0x0100
-#define VR_CMD_TX_EARLY 0x0200
-#define VR_CMD_FULLDUPLEX 0x0400
-#define VR_CMD_TX_NOPOLL 0x0800
-
-#define VR_CMD_RESET 0x8000
-
-/*
- * Interrupt status bits.
- */
-#define VR_ISR_RX_OK 0x0001 /* packet rx ok */
-#define VR_ISR_TX_OK 0x0002 /* packet tx ok */
-#define VR_ISR_RX_ERR 0x0004 /* packet rx with err */
-#define VR_ISR_TX_ABRT 0x0008 /* tx aborted due to excess colls */
-#define VR_ISR_TX_UNDERRUN 0x0010 /* tx buffer underflow */
-#define VR_ISR_RX_NOBUF 0x0020 /* no rx buffer available */
-#define VR_ISR_BUSERR 0x0040 /* PCI bus error */
-#define VR_ISR_STATSOFLOW 0x0080 /* stats counter oflow */
-#define VR_ISR_RX_EARLY 0x0100 /* rx early */
-#define VR_ISR_LINKSTAT 0x0200 /* MII status change */
-#define VR_ISR_RX_OFLOW 0x0400 /* rx FIFO overflow */
-#define VR_ISR_RX_DROPPED 0x0800
-#define VR_ISR_RX_NOBUF2 0x1000
-#define VR_ISR_TX_ABRT2 0x2000
-#define VR_ISR_LINKSTAT2 0x4000
-#define VR_ISR_MAGICPACKET 0x8000
-
-/*
- * Interrupt mask bits.
- */
-#define VR_IMR_RX_OK 0x0001 /* packet rx ok */
-#define VR_IMR_TX_OK 0x0002 /* packet tx ok */
-#define VR_IMR_RX_ERR 0x0004 /* packet rx with err */
-#define VR_IMR_TX_ABRT 0x0008 /* tx aborted due to excess colls */
-#define VR_IMR_TX_UNDERRUN 0x0010 /* tx buffer underflow */
-#define VR_IMR_RX_NOBUF 0x0020 /* no rx buffer available */
-#define VR_IMR_BUSERR 0x0040 /* PCI bus error */
-#define VR_IMR_STATSOFLOW 0x0080 /* stats counter oflow */
-#define VR_IMR_RX_EARLY 0x0100 /* rx early */
-#define VR_IMR_LINKSTAT 0x0200 /* MII status change */
-#define VR_IMR_RX_OFLOW 0x0400 /* rx FIFO overflow */
-#define VR_IMR_RX_DROPPED 0x0800
-#define VR_IMR_RX_NOBUF2 0x1000
-#define VR_IMR_TX_ABRT2 0x2000
-#define VR_IMR_LINKSTAT2 0x4000
-#define VR_IMR_MAGICPACKET 0x8000
-
-#define VR_INTRS \
- (VR_IMR_RX_OK|VR_IMR_TX_OK|VR_IMR_RX_NOBUF| \
- VR_IMR_TX_ABRT|VR_IMR_TX_UNDERRUN|VR_IMR_BUSERR| \
- VR_IMR_RX_ERR|VR_ISR_RX_DROPPED)
-
-/*
- * MII status register.
- */
-
-#define VR_MIISTAT_SPEED 0x01
-#define VR_MIISTAT_LINKFAULT 0x02
-#define VR_MIISTAT_MGTREADERR 0x04
-#define VR_MIISTAT_MIIERR 0x08
-#define VR_MIISTAT_PHYOPT 0x10
-#define VR_MIISTAT_MDC_SPEED 0x20
-#define VR_MIISTAT_RSVD 0x40
-#define VR_MIISTAT_GPIO1POLL 0x80
-
-/*
- * MII command register bits.
- */
-#define VR_MIICMD_CLK 0x01
-#define VR_MIICMD_DATAOUT 0x02
-#define VR_MIICMD_DATAIN 0x04
-#define VR_MIICMD_DIR 0x08
-#define VR_MIICMD_DIRECTPGM 0x10
-#define VR_MIICMD_WRITE_ENB 0x20
-#define VR_MIICMD_READ_ENB 0x40
-#define VR_MIICMD_AUTOPOLL 0x80
-
-/*
- * EEPROM control bits.
- */
-#define VR_EECSR_DATAIN 0x01 /* data out */
-#define VR_EECSR_DATAOUT 0x02 /* data in */
-#define VR_EECSR_CLK 0x04 /* clock */
-#define VR_EECSR_CS 0x08 /* chip select */
-#define VR_EECSR_DPM 0x10
-#define VR_EECSR_LOAD 0x20
-#define VR_EECSR_EMBP 0x40
-#define VR_EECSR_EEPR 0x80
-
-#define VR_EECMD_WRITE 0x140
-#define VR_EECMD_READ 0x180
-#define VR_EECMD_ERASE 0x1c0
-
-/*
- * Test register bits.
- */
-#define VR_TEST_TEST0 0x01
-#define VR_TEST_TEST1 0x02
-#define VR_TEST_TEST2 0x04
-#define VR_TEST_TSTUD 0x08
-#define VR_TEST_TSTOV 0x10
-#define VR_TEST_BKOFF 0x20
-#define VR_TEST_FCOL 0x40
-#define VR_TEST_HBDES 0x80
-
-/*
- * Config register bits.
- */
-#define VR_CFG_GPIO2OUTENB 0x00000001
-#define VR_CFG_GPIO2OUT 0x00000002 /* gen. purp. pin */
-#define VR_CFG_GPIO2IN 0x00000004 /* gen. purp. pin */
-#define VR_CFG_AUTOOPT 0x00000008 /* enable rx/tx autopoll */
-#define VR_CFG_MIIOPT 0x00000010
-#define VR_CFG_MMIENB 0x00000020 /* memory mapped mode enb */
-#define VR_CFG_JUMPER 0x00000040 /* PHY and oper. mode select */
-#define VR_CFG_EELOAD 0x00000080 /* enable EEPROM programming */
-#define VR_CFG_LATMENB 0x00000100 /* larency timer effect enb. */
-#define VR_CFG_MRREADWAIT 0x00000200
-#define VR_CFG_MRWRITEWAIT 0x00000400
-#define VR_CFG_RX_ARB 0x00000800
-#define VR_CFG_TX_ARB 0x00001000
-#define VR_CFG_READMULTI 0x00002000
-#define VR_CFG_TX_PACE 0x00004000
-#define VR_CFG_TX_QDIS 0x00008000
-#define VR_CFG_ROMSEL0 0x00010000
-#define VR_CFG_ROMSEL1 0x00020000
-#define VR_CFG_ROMSEL2 0x00040000
-#define VR_CFG_ROMTIMESEL 0x00080000
-#define VR_CFG_RSVD0 0x00100000
-#define VR_CFG_ROMDLY 0x00200000
-#define VR_CFG_ROMOPT 0x00400000
-#define VR_CFG_RSVD1 0x00800000
-#define VR_CFG_BACKOFFOPT 0x01000000
-#define VR_CFG_BACKOFFMOD 0x02000000
-#define VR_CFG_CAPEFFECT 0x04000000
-#define VR_CFG_BACKOFFRAND 0x08000000
-#define VR_CFG_MAGICKPACKET 0x10000000
-#define VR_CFG_PCIREADLINE 0x20000000
-#define VR_CFG_DIAG 0x40000000
-#define VR_CFG_GPIOEN 0x80000000
-
-/*
- * Rhine TX/RX list structure.
- */
-
-struct vr_desc {
- u_int32_t vr_status;
- u_int32_t vr_ctl;
- u_int32_t vr_ptr1;
- u_int32_t vr_ptr2;
-};
-
-#define vr_data vr_ptr1
-#define vr_next vr_ptr2
-
-
-#define VR_RXSTAT_RXERR 0x00000001
-#define VR_RXSTAT_CRCERR 0x00000002
-#define VR_RXSTAT_FRAMEALIGNERR 0x00000004
-#define VR_RXSTAT_FIFOOFLOW 0x00000008
-#define VR_RXSTAT_GIANT 0x00000010
-#define VR_RXSTAT_RUNT 0x00000020
-#define VR_RXSTAT_BUSERR 0x00000040
-#define VR_RXSTAT_BUFFERR 0x00000080
-#define VR_RXSTAT_LASTFRAG 0x00000100
-#define VR_RXSTAT_FIRSTFRAG 0x00000200
-#define VR_RXSTAT_RLINK 0x00000400
-#define VR_RXSTAT_RX_PHYS 0x00000800
-#define VR_RXSTAT_RX_BROAD 0x00001000
-#define VR_RXSTAT_RX_MULTI 0x00002000
-#define VR_RXSTAT_RX_OK 0x00004000
-#define VR_RXSTAT_RXLEN 0x07FF0000
-#define VR_RXSTAT_RXLEN_EXT 0x78000000
-#define VR_RXSTAT_OWN 0x80000000
-
-#define VR_RXBYTES(x) ((x & VR_RXSTAT_RXLEN) >> 16)
-#define VR_RXSTAT (VR_RXSTAT_FIRSTFRAG|VR_RXSTAT_LASTFRAG|VR_RXSTAT_OWN)
-
-#define VR_RXCTL_BUFLEN 0x000007FF
-#define VR_RXCTL_BUFLEN_EXT 0x00007800
-#define VR_RXCTL_CHAIN 0x00008000
-#define VR_RXCTL_RX_INTR 0x00800000
-
-#define VR_RXCTL (VR_RXCTL_CHAIN|VR_RXCTL_RX_INTR)
-
-#define VR_TXSTAT_DEFER 0x00000001
-#define VR_TXSTAT_UNDERRUN 0x00000002
-#define VR_TXSTAT_COLLCNT 0x00000078
-#define VR_TXSTAT_SQE 0x00000080
-#define VR_TXSTAT_ABRT 0x00000100
-#define VR_TXSTAT_LATECOLL 0x00000200
-#define VR_TXSTAT_CARRLOST 0x00000400
-#define VR_TXSTAT_BUSERR 0x00002000
-#define VR_TXSTAT_JABTIMEO 0x00004000
-#define VR_TXSTAT_ERRSUM 0x00008000
-#define VR_TXSTAT_OWN 0x80000000
-
-#define VR_TXCTL_BUFLEN 0x000007FF
-#define VR_TXCTL_BUFLEN_EXT 0x00007800
-#define VR_TXCTL_TLINK 0x00008000
-#define VR_TXCTL_FIRSTFRAG 0x00200000
-#define VR_TXCTL_LASTFRAG 0x00400000
-#define VR_TXCTL_FINT 0x00800000
-
-
-#define VR_MAXFRAGS 16
-#define VR_RX_LIST_CNT 64
-#define VR_TX_LIST_CNT 64
-#define VR_MIN_FRAMELEN 60
-#define VR_FRAMELEN 1536
-#define VR_RXLEN 1520
-
-#define VR_TXOWN(x) x->vr_ptr->vr_status
-
-struct vr_list_data {
- struct vr_desc vr_rx_list[VR_RX_LIST_CNT];
- struct vr_desc vr_tx_list[VR_TX_LIST_CNT];
-};
-
-struct vr_chain {
- struct vr_desc *vr_ptr;
- struct mbuf *vr_mbuf;
- struct vr_chain *vr_nextdesc;
-};
-
-struct vr_chain_onefrag {
- struct vr_desc *vr_ptr;
- struct mbuf *vr_mbuf;
- struct vr_chain_onefrag *vr_nextdesc;
-};
-
-struct vr_chain_data {
- struct vr_chain_onefrag vr_rx_chain[VR_RX_LIST_CNT];
- struct vr_chain vr_tx_chain[VR_TX_LIST_CNT];
-
- struct vr_chain_onefrag *vr_rx_head;
-
- struct vr_chain *vr_tx_head;
- struct vr_chain *vr_tx_tail;
- struct vr_chain *vr_tx_free;
-};
-
-struct vr_type {
- u_int16_t vr_vid;
- u_int16_t vr_did;
- char *vr_name;
-};
-
-struct vr_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define VR_MII_STARTDELIM 0x01
-#define VR_MII_READOP 0x02
-#define VR_MII_WRITEOP 0x01
-#define VR_MII_TURNAROUND 0x02
-
-#define VR_FLAG_FORCEDELAY 1
-#define VR_FLAG_SCHEDDELAY 2
-#define VR_FLAG_DELAYTIMEO 3
-
-struct vr_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t vr_bhandle; /* bus space handle */
- bus_space_tag_t vr_btag; /* bus space tag */
- struct vr_type *vr_info; /* Rhine adapter info */
- struct vr_type *vr_pinfo; /* phy info */
- u_int8_t vr_unit; /* interface number */
- u_int8_t vr_type;
- u_int8_t vr_phy_addr; /* PHY address */
- u_int8_t vr_tx_pend; /* TX pending */
- u_int8_t vr_want_auto;
- u_int8_t vr_autoneg;
- caddr_t vr_ldata_ptr;
- struct vr_list_data *vr_ldata;
- struct vr_chain_data vr_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->vr_btag, sc->vr_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->vr_btag, sc->vr_bhandle, reg)
-
-#define VR_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * VIA vendor ID
- */
-#define VIA_VENDORID 0x1106
-
-/*
- * VIA Rhine device IDs.
- */
-#define VIA_DEVICEID_RHINE 0x3043
-#define VIA_DEVICEID_RHINE_II 0x6100
-
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define VR_PCI_VENDOR_ID 0x00
-#define VR_PCI_DEVICE_ID 0x02
-#define VR_PCI_COMMAND 0x04
-#define VR_PCI_STATUS 0x06
-#define VR_PCI_CLASSCODE 0x09
-#define VR_PCI_LATENCY_TIMER 0x0D
-#define VR_PCI_HEADER_TYPE 0x0E
-#define VR_PCI_LOIO 0x10
-#define VR_PCI_LOMEM 0x14
-#define VR_PCI_BIOSROM 0x30
-#define VR_PCI_INTLINE 0x3C
-#define VR_PCI_INTPIN 0x3D
-#define VR_PCI_MINGNT 0x3E
-#define VR_PCI_MINLAT 0x0F
-#define VR_PCI_RESETOPT 0x48
-#define VR_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define VR_PCI_CAPID 0xDC /* 8 bits */
-#define VR_PCI_NEXTPTR 0xDD /* 8 bits */
-#define VR_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define VR_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define VR_PSTATE_MASK 0x0003
-#define VR_PSTATE_D0 0x0000
-#define VR_PSTATE_D1 0x0002
-#define VR_PSTATE_D2 0x0002
-#define VR_PSTATE_D3 0x0003
-#define VR_PME_EN 0x0010
-#define VR_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define VR_PHYADDR_MIN 0x00
-#define VR_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_vx_pci.c b/sys/pci/if_vx_pci.c
index ab02693e270d..f4e98ac0a3ff 100644
--- a/sys/pci/if_vx_pci.c
+++ b/sys/pci/if_vx_pci.c
@@ -47,7 +47,7 @@
#include <dev/vx/if_vxreg.h>
static void vx_pci_shutdown(int, void *);
-static const char *vx_pci_probe(pcici_t, pcidi_t);
+static char *vx_pci_probe(pcici_t, pcidi_t);
static void vx_pci_attach(pcici_t, int unit);
static void
@@ -59,7 +59,7 @@ vx_pci_shutdown(
vxfree(sc);
}
-static const char*
+static char*
vx_pci_probe(
pcici_t config_id,
pcidi_t device_id)
@@ -96,9 +96,7 @@ vx_pci_attach(
return;
}
- if ((sc = vxalloc(unit)) == NULL) {
- return;
- }
+ sc = vxalloc(unit);
sc->vx_io_addr = pci_conf_read(config_id, 0x10) & 0xffffffe0;
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c
deleted file mode 100644
index 01cbc3c72c2d..000000000000
--- a/sys/pci/if_wb.c
+++ /dev/null
@@ -1,2151 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_wb.c,v 1.36 1999/01/16 05:28:52 wpaul Exp $
- */
-
-/*
- * Winbond fast ethernet PCI NIC driver
- *
- * Supports various cheap network adapters based on the Winbond W89C840F
- * fast ethernet controller chip. This includes adapters manufactured by
- * Winbond itself and some made by Linksys.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The Winbond W89C840F chip is a bus master; in some ways it resembles
- * a DEC 'tulip' chip, only not as complicated. Unfortunately, it has
- * one major difference which is that while the registers do many of
- * the same things as a tulip adapter, the offsets are different: where
- * tulip registers are typically spaced 8 bytes apart, the Winbond
- * registers are spaced 4 bytes apart. The receiver filter is also
- * programmed differently.
- *
- * Like the tulip, the Winbond chip uses small descriptors containing
- * a status word, a control word and 32-bit areas that can either be used
- * to point to two external data blocks, or to point to a single block
- * and another descriptor in a linked list. Descriptors can be grouped
- * together in blocks to form fixed length rings or can be chained
- * together in linked lists. A single packet may be spread out over
- * several descriptors if necessary.
- *
- * For the receive ring, this driver uses a linked list of descriptors,
- * each pointing to a single mbuf cluster buffer, which us large enough
- * to hold an entire packet. The link list is looped back to created a
- * closed ring.
- *
- * For transmission, the driver creates a linked list of 'super descriptors'
- * which each contain several individual descriptors linked toghether.
- * Each 'super descriptor' contains WB_MAXFRAGS descriptors, which we
- * abuse as fragment pointers. This allows us to use a buffer managment
- * scheme very similar to that used in the ThunderLAN and Etherlink XL
- * drivers.
- *
- * Autonegotiation is performed using the external PHY via the MII bus.
- * The sample boards I have all use a Davicom PHY.
- *
- * Note: the author of the Linux driver for the Winbond chip alludes
- * to some sort of flaw in the chip's design that seems to mandate some
- * drastic workaround which signigicantly impairs transmit performance.
- * I have no idea what he's on about: transmit performance with all
- * three of my test boards seems fine.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_memio.h>
-#include <machine/bus_pio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define WB_USEIOSPACE
-
-/* #define WB_BACKGROUND_AUTONEG */
-
-#include <pci/if_wbreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_wb.c,v 1.36 1999/01/16 05:28:52 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct wb_type wb_devs[] = {
- { WB_VENDORID, WB_DEVICEID_840F,
- "Winbond W89C840F 10/100BaseTX" },
- { CP_VENDORID, CP_DEVICEID_RL100,
- "Compex RL100-ATX 10/100baseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct wb_type wb_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long wb_count = 0;
-static const char *wb_probe __P((pcici_t, pcidi_t));
-static void wb_attach __P((pcici_t, int));
-
-static int wb_newbuf __P((struct wb_softc *,
- struct wb_chain_onefrag *));
-static int wb_encap __P((struct wb_softc *, struct wb_chain *,
- struct mbuf *));
-
-static void wb_rxeof __P((struct wb_softc *));
-static void wb_rxeoc __P((struct wb_softc *));
-static void wb_txeof __P((struct wb_softc *));
-static void wb_txeoc __P((struct wb_softc *));
-static void wb_intr __P((void *));
-static void wb_start __P((struct ifnet *));
-static int wb_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void wb_init __P((void *));
-static void wb_stop __P((struct wb_softc *));
-static void wb_watchdog __P((struct ifnet *));
-static void wb_shutdown __P((int, void *));
-static int wb_ifmedia_upd __P((struct ifnet *));
-static void wb_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void wb_eeprom_putbyte __P((struct wb_softc *, int));
-static void wb_eeprom_getword __P((struct wb_softc *, int, u_int16_t *));
-static void wb_read_eeprom __P((struct wb_softc *, caddr_t, int,
- int, int));
-static void wb_mii_sync __P((struct wb_softc *));
-static void wb_mii_send __P((struct wb_softc *, u_int32_t, int));
-static int wb_mii_readreg __P((struct wb_softc *, struct wb_mii_frame *));
-static int wb_mii_writereg __P((struct wb_softc *, struct wb_mii_frame *));
-static u_int16_t wb_phy_readreg __P((struct wb_softc *, int));
-static void wb_phy_writereg __P((struct wb_softc *, int, int));
-
-static void wb_autoneg_xmit __P((struct wb_softc *));
-static void wb_autoneg_mii __P((struct wb_softc *, int, int));
-static void wb_setmode_mii __P((struct wb_softc *, int));
-static void wb_getmode_mii __P((struct wb_softc *));
-static void wb_setcfg __P((struct wb_softc *, int));
-static u_int8_t wb_calchash __P((caddr_t));
-static void wb_setmulti __P((struct wb_softc *));
-static void wb_reset __P((struct wb_softc *));
-static int wb_list_rx_init __P((struct wb_softc *));
-static int wb_list_tx_init __P((struct wb_softc *));
-
-#define WB_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define WB_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, WB_SIO, \
- CSR_READ_4(sc, WB_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, WB_SIO, \
- CSR_READ_4(sc, WB_SIO) & ~x)
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void wb_eeprom_putbyte(sc, addr)
- struct wb_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | WB_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(WB_SIO_EE_DATAIN);
- } else {
- SIO_CLR(WB_SIO_EE_DATAIN);
- }
- DELAY(100);
- SIO_SET(WB_SIO_EE_CLK);
- DELAY(150);
- SIO_CLR(WB_SIO_EE_CLK);
- DELAY(100);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void wb_eeprom_getword(sc, addr, dest)
- struct wb_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, WB_SIO, WB_SIO_EESEL|WB_SIO_EE_CS);
-
- /*
- * Send address of word we want to read.
- */
- wb_eeprom_putbyte(sc, addr);
-
- CSR_WRITE_4(sc, WB_SIO, WB_SIO_EESEL|WB_SIO_EE_CS);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(WB_SIO_EE_CLK);
- DELAY(100);
- if (CSR_READ_4(sc, WB_SIO) & WB_SIO_EE_DATAOUT)
- word |= i;
- SIO_CLR(WB_SIO_EE_CLK);
- DELAY(100);
- }
-
- /* Turn off EEPROM access mode. */
- CSR_WRITE_4(sc, WB_SIO, 0);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void wb_read_eeprom(sc, dest, off, cnt, swap)
- struct wb_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- wb_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void wb_mii_sync(sc)
- struct wb_softc *sc;
-{
- register int i;
-
- SIO_SET(WB_SIO_MII_DIR|WB_SIO_MII_DATAIN);
-
- for (i = 0; i < 32; i++) {
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void wb_mii_send(sc, bits, cnt)
- struct wb_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- SIO_CLR(WB_SIO_MII_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- SIO_SET(WB_SIO_MII_DATAIN);
- } else {
- SIO_CLR(WB_SIO_MII_DATAIN);
- }
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int wb_mii_readreg(sc, frame)
- struct wb_softc *sc;
- struct wb_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = WB_MII_STARTDELIM;
- frame->mii_opcode = WB_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_4(sc, WB_SIO, 0);
-
- /*
- * Turn on data xmit.
- */
- SIO_SET(WB_SIO_MII_DIR);
-
- wb_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- wb_mii_send(sc, frame->mii_stdelim, 2);
- wb_mii_send(sc, frame->mii_opcode, 2);
- wb_mii_send(sc, frame->mii_phyaddr, 5);
- wb_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- SIO_CLR((WB_SIO_MII_CLK|WB_SIO_MII_DATAIN));
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- SIO_CLR(WB_SIO_MII_DIR);
- /* Check for ack */
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- ack = CSR_READ_4(sc, WB_SIO) & WB_SIO_MII_DATAOUT;
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_4(sc, WB_SIO) & WB_SIO_MII_DATAOUT)
- frame->mii_data |= i;
- DELAY(1);
- }
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- }
-
-fail:
-
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int wb_mii_writereg(sc, frame)
- struct wb_softc *sc;
- struct wb_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = WB_MII_STARTDELIM;
- frame->mii_opcode = WB_MII_WRITEOP;
- frame->mii_turnaround = WB_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- SIO_SET(WB_SIO_MII_DIR);
-
- wb_mii_sync(sc);
-
- wb_mii_send(sc, frame->mii_stdelim, 2);
- wb_mii_send(sc, frame->mii_opcode, 2);
- wb_mii_send(sc, frame->mii_phyaddr, 5);
- wb_mii_send(sc, frame->mii_regaddr, 5);
- wb_mii_send(sc, frame->mii_turnaround, 2);
- wb_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- SIO_CLR(WB_SIO_MII_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t wb_phy_readreg(sc, reg)
- struct wb_softc *sc;
- int reg;
-{
- struct wb_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->wb_phy_addr;
- frame.mii_regaddr = reg;
- wb_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void wb_phy_writereg(sc, reg, data)
- struct wb_softc *sc;
- int reg;
- int data;
-{
- struct wb_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->wb_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- wb_mii_writereg(sc, &frame);
-
- return;
-}
-
-static u_int8_t wb_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /*
- * return the filter bit position
- * Note: I arrived at the following nonsense
- * through experimentation. It's not the usual way to
- * generate the bit position but it's the only thing
- * I could come up with that works.
- */
- return(~(crc >> 26) & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void wb_setmulti(sc)
- struct wb_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, WB_NETCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= WB_NETCFG_RX_MULTI;
- CSR_WRITE_4(sc, WB_NETCFG, rxfilt);
- CSR_WRITE_4(sc, WB_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, WB_MAR1, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, WB_MAR0, 0);
- CSR_WRITE_4(sc, WB_MAR1, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = wb_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= WB_NETCFG_RX_MULTI;
- else
- rxfilt &= ~WB_NETCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, WB_MAR0, hashes[0]);
- CSR_WRITE_4(sc, WB_MAR1, hashes[1]);
- CSR_WRITE_4(sc, WB_NETCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void wb_autoneg_xmit(sc)
- struct wb_softc *sc;
-{
- u_int16_t phy_sts;
-
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(wb_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = wb_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- wb_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void wb_autoneg_mii(sc, flag, verbose)
- struct wb_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = wb_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("wb%d: autonegotiation not supported\n",
- sc->wb_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case WB_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- wb_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case WB_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise wb_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->wb_cdata.wb_tx_head != NULL) {
- sc->wb_want_auto = 1;
- return;
- }
- wb_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->wb_autoneg = 1;
- sc->wb_want_auto = 0;
- return;
- break;
- case WB_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->wb_autoneg = 0;
- break;
- default:
- printf("wb%d: invalid autoneg flag: %d\n", sc->wb_unit, flag);
- return;
- }
-
- if (wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("wb%d: autoneg complete, ", sc->wb_unit);
- phy_sts = wb_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("wb%d: autoneg not complete, ", sc->wb_unit);
- }
-
- media = wb_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = wb_phy_readreg(sc, PHY_ANAR);
- ability = wb_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else /* if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) */ {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- wb_setcfg(sc, media);
- wb_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- wb_init(sc);
-
- if (sc->wb_tx_pend) {
- sc->wb_autoneg = 0;
- sc->wb_tx_pend = 0;
- wb_start(ifp);
- }
-
- return;
-}
-
-static void wb_getmode_mii(sc)
- struct wb_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = wb_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("wb%d: PHY status word: %x\n", sc->wb_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("wb%d: 10Mbps half-duplex mode supported\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("wb%d: 10Mbps full-duplex mode supported\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("wb%d: 100Mbps half-duplex mode supported\n",
- sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("wb%d: 100Mbps full-duplex mode supported\n",
- sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("wb%d: 100baseT4 mode supported\n", sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("wb%d: forcing on autoneg support for BT4\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("wb%d: autoneg supported\n", sc->wb_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void wb_setmode_mii(sc, media)
- struct wb_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->wb_autoneg) {
- printf("wb%d: canceling autoneg session\n", sc->wb_unit);
- ifp->if_timer = sc->wb_autoneg = sc->wb_want_auto = 0;
- bmcr = wb_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- wb_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("wb%d: selecting MII, ", sc->wb_unit);
-
- bmcr = wb_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- wb_setcfg(sc, bmcr);
- wb_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * The Winbond manual states that in order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void wb_setcfg(sc, bmcr)
- struct wb_softc *sc;
- int bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, WB_NETCFG) & (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON)) {
- restart = 1;
- WB_CLRBIT(sc, WB_NETCFG, (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON));
-
- for (i = 0; i < WB_TIMEOUT; i++) {
- DELAY(10);
- if ((CSR_READ_4(sc, WB_ISR) & WB_ISR_TX_IDLE) &&
- (CSR_READ_4(sc, WB_ISR) & WB_ISR_RX_IDLE))
- break;
- }
-
- if (i == WB_TIMEOUT)
- printf("wb%d: failed to force tx and "
- "rx to idle state\n", sc->wb_unit);
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_100MBPS);
- else
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_100MBPS);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_FULLDUPLEX);
- else
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_FULLDUPLEX);
-
- if (restart)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON|WB_NETCFG_RX_ON);
-
- return;
-}
-
-static void wb_reset(sc)
- struct wb_softc *sc;
-{
- register int i;
-
- WB_SETBIT(sc, WB_BUSCTL, WB_BUSCTL_RESET);
-
- for (i = 0; i < WB_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, WB_BUSCTL) & WB_BUSCTL_RESET))
- break;
- }
- if (i == WB_TIMEOUT)
- printf("wb%d: reset never completed!\n", sc->wb_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
-
- /* Reset the damn PHY too. */
- if (sc->wb_pinfo != NULL)
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
-
- return;
-}
-
-/*
- * Probe for a Winbond chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-wb_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct wb_type *t;
-
- t = wb_devs;
-
- while(t->wb_name != NULL) {
- if ((device_id & 0xFFFF) == t->wb_vid &&
- ((device_id >> 16) & 0xFFFF) == t->wb_did) {
- return(t->wb_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-wb_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef WB_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct wb_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct wb_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct wb_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("wb%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct wb_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, WB_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, WB_PCI_PWRMGMTCTRL);
- if (command & WB_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, WB_PCI_LOIO);
- membase = pci_conf_read(config_id, WB_PCI_LOMEM);
- irq = pci_conf_read(config_id, WB_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("wb%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & WB_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, WB_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, WB_PCI_LOIO, iobase);
- pci_conf_write(config_id, WB_PCI_LOMEM, membase);
- pci_conf_write(config_id, WB_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef WB_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("wb%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, WB_PCI_LOIO,
- (u_int16_t *)&(sc->wb_bhandle))) {
- printf ("wb%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->wb_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("wb%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, WB_PCI_LOMEM, &vbase, &pbase)) {
- printf ("wb%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->csr = (volatile caddr_t)vbase;
- sc->wb_btag = I386_BUS_SPACE_MEM;
- sc->wb_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, wb_intr, sc, &net_imask)) {
- printf("wb%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- wb_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- wb_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 0);
-
- /*
- * A Winbond chip was detected. Inform the world.
- */
- printf("wb%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->wb_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->wb_ldata_ptr = malloc(sizeof(struct wb_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->wb_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("wb%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->wb_ldata = (struct wb_list_data *)sc->wb_ldata_ptr;
- round = (unsigned int)sc->wb_ldata_ptr & 0xF;
- roundptr = sc->wb_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->wb_ldata = (struct wb_list_data *)roundptr;
- bzero(sc->wb_ldata, sizeof(struct wb_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "wb";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = wb_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = wb_start;
- ifp->if_watchdog = wb_watchdog;
- ifp->if_init = wb_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("wb%d: probing for a PHY\n", sc->wb_unit);
- for (i = WB_PHYADDR_MIN; i < WB_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("wb%d: checking address: %d\n",
- sc->wb_unit, i);
- sc->wb_phy_addr = i;
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(wb_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = wb_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = wb_phy_readreg(sc, PHY_VENID);
- phy_did = wb_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("wb%d: found PHY at address %d, ",
- sc->wb_unit, sc->wb_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = wb_phys;
- while(p->wb_vid) {
- if (phy_vid == p->wb_vid &&
- (phy_did | 0x000F) == p->wb_did) {
- sc->wb_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->wb_pinfo == NULL)
- sc->wb_pinfo = &wb_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("wb%d: PHY type: %s\n",
- sc->wb_unit, sc->wb_pinfo->wb_name);
- } else {
- printf("wb%d: MII without any phy!\n", sc->wb_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, wb_ifmedia_upd, wb_ifmedia_sts);
-
- wb_getmode_mii(sc);
- wb_autoneg_mii(sc, WB_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- wb_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(wb_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int wb_list_tx_init(sc)
- struct wb_softc *sc;
-{
- struct wb_chain_data *cd;
- struct wb_list_data *ld;
- int i;
-
- cd = &sc->wb_cdata;
- ld = sc->wb_ldata;
-
- for (i = 0; i < WB_TX_LIST_CNT; i++) {
- cd->wb_tx_chain[i].wb_ptr = &ld->wb_tx_list[i];
- if (i == (WB_TX_LIST_CNT - 1)) {
- cd->wb_tx_chain[i].wb_nextdesc =
- &cd->wb_tx_chain[0];
- } else {
- cd->wb_tx_chain[i].wb_nextdesc =
- &cd->wb_tx_chain[i + 1];
- }
- }
-
- cd->wb_tx_free = &cd->wb_tx_chain[0];
- cd->wb_tx_tail = cd->wb_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int wb_list_rx_init(sc)
- struct wb_softc *sc;
-{
- struct wb_chain_data *cd;
- struct wb_list_data *ld;
- int i;
-
- cd = &sc->wb_cdata;
- ld = sc->wb_ldata;
-
- for (i = 0; i < WB_RX_LIST_CNT; i++) {
- cd->wb_rx_chain[i].wb_ptr =
- (struct wb_desc *)&ld->wb_rx_list[i];
- if (wb_newbuf(sc, &cd->wb_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (WB_RX_LIST_CNT - 1)) {
- cd->wb_rx_chain[i].wb_nextdesc = &cd->wb_rx_chain[0];
- ld->wb_rx_list[i].wb_next =
- vtophys(&ld->wb_rx_list[0]);
- } else {
- cd->wb_rx_chain[i].wb_nextdesc =
- &cd->wb_rx_chain[i + 1];
- ld->wb_rx_list[i].wb_next =
- vtophys(&ld->wb_rx_list[i + 1]);
- }
- }
-
- cd->wb_rx_head = &cd->wb_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- */
-static int wb_newbuf(sc, c)
- struct wb_softc *sc;
- struct wb_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("wb%d: no memory for rx list -- packet dropped!\n",
- sc->wb_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("wb%d: no memory for rx list -- packet dropped!\n",
- sc->wb_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->wb_mbuf = m_new;
- c->wb_ptr->wb_data = vtophys(mtod(m_new, caddr_t));
- c->wb_ptr->wb_ctl = WB_RXCTL_RLINK | (MCLBYTES - 1);
- c->wb_ptr->wb_status = WB_RXSTAT;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void wb_rxeof(sc)
- struct wb_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct wb_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->wb_cdata.wb_rx_head->wb_ptr->wb_status) &
- WB_RXSTAT_OWN)) {
- cur_rx = sc->wb_cdata.wb_rx_head;
- sc->wb_cdata.wb_rx_head = cur_rx->wb_nextdesc;
-
- if ((rxstat & WB_RXSTAT_MIIERR)
- || WB_RXBYTES(cur_rx->wb_ptr->wb_status) == 0) {
- ifp->if_ierrors++;
- wb_reset(sc);
- printf("wb%x: receiver babbling: possible chip "
- "bug, forcing reset\n", sc->wb_unit);
- ifp->if_flags |= IFF_OACTIVE;
- ifp->if_timer = 2;
- return;
- }
-
- if (rxstat & WB_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- continue;
- }
-
- /* No errors; receive the packet. */
- total_len = WB_RXBYTES(cur_rx->wb_ptr->wb_status);
-
- /*
- * XXX The Winbond chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- if (total_len < MINCLSIZE) {
- m = m_devget(mtod(cur_rx->wb_mbuf, char *),
- total_len, 0, ifp, NULL);
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- if (m == NULL) {
- ifp->if_ierrors++;
- continue;
- }
- } else {
- m = cur_rx->wb_mbuf;
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (wb_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- continue;
- }
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
-
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void wb_rxeoc(sc)
- struct wb_softc *sc;
-{
- wb_rxeof(sc);
-
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXADDR, vtophys(&sc->wb_ldata->wb_rx_list[0]));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- if (CSR_READ_4(sc, WB_ISR) & WB_RXSTATE_SUSPEND)
- CSR_WRITE_4(sc, WB_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-static void wb_txeof(sc)
- struct wb_softc *sc;
-{
- struct wb_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->wb_cdata.wb_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->wb_cdata.wb_tx_head->wb_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->wb_cdata.wb_tx_head;
- txstat = WB_TXSTATUS(cur_tx);
-
- if ((txstat & WB_TXSTAT_OWN) || txstat == WB_UNSENT)
- break;
-
- if (txstat & WB_TXSTAT_TXERR) {
- ifp->if_oerrors++;
- if (txstat & WB_TXSTAT_ABORT)
- ifp->if_collisions++;
- if (txstat & WB_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & WB_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->wb_mbuf);
- cur_tx->wb_mbuf = NULL;
-
- if (sc->wb_cdata.wb_tx_head == sc->wb_cdata.wb_tx_tail) {
- sc->wb_cdata.wb_tx_head = NULL;
- sc->wb_cdata.wb_tx_tail = NULL;
- break;
- }
-
- sc->wb_cdata.wb_tx_head = cur_tx->wb_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void wb_txeoc(sc)
- struct wb_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->wb_cdata.wb_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->wb_cdata.wb_tx_tail = NULL;
- if (sc->wb_want_auto)
- wb_autoneg_mii(sc, WB_FLAG_SCHEDDELAY, 1);
- } else {
- if (WB_TXOWN(sc->wb_cdata.wb_tx_head) == WB_UNSENT) {
- WB_TXOWN(sc->wb_cdata.wb_tx_head) = WB_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void wb_intr(arg)
- void *arg;
-{
- struct wb_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- if (!(ifp->if_flags & IFF_UP))
- return;
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, WB_IMR, 0x00000000);
-
- for (;;) {
-
- status = CSR_READ_4(sc, WB_ISR);
- if (status)
- CSR_WRITE_4(sc, WB_ISR, status);
-
- if ((status & WB_INTRS) == 0)
- break;
-
- if (status & WB_ISR_RX_OK)
- wb_rxeof(sc);
-
- if (status & WB_ISR_RX_IDLE)
- wb_rxeoc(sc);
-
- if ((status & WB_ISR_RX_NOBUF) || (status & WB_ISR_RX_ERR)) {
- ifp->if_ierrors++;
-#ifdef foo
- wb_stop(sc);
- wb_reset(sc);
- wb_init(sc);
-#endif
- }
-
- if (status & WB_ISR_TX_OK)
- wb_txeof(sc);
-
- if (status & WB_ISR_TX_NOBUF)
- wb_txeoc(sc);
-
- if (status & WB_ISR_TX_IDLE) {
- wb_txeof(sc);
- if (sc->wb_cdata.wb_tx_head != NULL) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & WB_ISR_TX_UNDERRUN) {
- ifp->if_oerrors++;
- wb_txeof(sc);
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- /* Jack up TX threshold */
- sc->wb_txthresh += WB_TXTHRESH_CHUNK;
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_THRESH);
- WB_SETBIT(sc, WB_NETCFG, WB_TXTHRESH(sc->wb_txthresh));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- }
-
- if (status & WB_ISR_BUS_ERR) {
- wb_reset(sc);
- wb_init(sc);
- }
-
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, WB_IMR, WB_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- wb_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int wb_encap(sc, c, m_head)
- struct wb_softc *sc;
- struct wb_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct wb_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == WB_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->wb_ptr->wb_frag[frag];
- f->wb_ctl = WB_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->wb_ctl |= WB_TXCTL_FIRSTFRAG;
- f->wb_status = 0;
- } else
- f->wb_status = WB_TXSTAT_OWN;
- f->wb_next = vtophys(&c->wb_ptr->wb_frag[frag + 1]);
- f->wb_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we used up all 16 fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("wb%d: no memory for tx list", sc->wb_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("wb%d: no memory for tx list",
- sc->wb_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->wb_ptr->wb_frag[0];
- f->wb_status = 0;
- f->wb_data = vtophys(mtod(m_new, caddr_t));
- f->wb_ctl = total_len = m_new->m_len;
- f->wb_ctl |= WB_TXCTL_TLINK|WB_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
- if (total_len < WB_MIN_FRAMELEN) {
- f = &c->wb_ptr->wb_frag[frag];
- f->wb_ctl = WB_MIN_FRAMELEN - total_len;
- f->wb_data = vtophys(&sc->wb_cdata.wb_pad);
- f->wb_ctl |= WB_TXCTL_TLINK;
- f->wb_status = WB_TXSTAT_OWN;
- frag++;
- }
-
- c->wb_mbuf = m_head;
- c->wb_lastdesc = frag - 1;
- WB_TXCTL(c) |= WB_TXCTL_LASTFRAG;
- WB_TXNEXT(c) = vtophys(&c->wb_nextdesc->wb_ptr->wb_frag[0]);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void wb_start(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
- struct mbuf *m_head = NULL;
- struct wb_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->wb_autoneg) {
- sc->wb_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->wb_cdata.wb_tx_free->wb_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->wb_cdata.wb_tx_free;
-
- while(sc->wb_cdata.wb_tx_free->wb_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->wb_cdata.wb_tx_free;
- sc->wb_cdata.wb_tx_free = cur_tx->wb_nextdesc;
-
- /* Pack the data into the descriptor. */
- wb_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- WB_TXOWN(cur_tx) = WB_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->wb_mbuf);
-#endif
- }
-
- /*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- WB_TXCTL(cur_tx) |= WB_TXCTL_FINT;
- cur_tx->wb_ptr->wb_frag[0].wb_ctl |= WB_TXCTL_FINT;
- sc->wb_cdata.wb_tx_tail = cur_tx;
-
- if (sc->wb_cdata.wb_tx_head == NULL) {
- sc->wb_cdata.wb_tx_head = start_tx;
- WB_TXOWN(start_tx) = WB_TXSTAT_OWN;
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- } else {
- /*
- * We need to distinguish between the case where
- * the own bit is clear because the chip cleared it
- * and where the own bit is clear because we haven't
- * set it yet. The magic value WB_UNSET is just some
- * ramdomly chosen number which doesn't have the own
- * bit set. When we actually transmit the frame, the
- * status word will have _only_ the own bit set, so
- * the txeoc handler will be able to tell if it needs
- * to initiate another transmission to flush out pending
- * frames.
- */
- WB_TXOWN(start_tx) = WB_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void wb_init(xsc)
- void *xsc;
-{
- struct wb_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int s, i;
- u_int16_t phy_bmcr = 0;
-
- if (sc->wb_autoneg)
- return;
-
- s = splimp();
-
- if (sc->wb_pinfo != NULL)
- phy_bmcr = wb_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- wb_stop(sc);
- wb_reset(sc);
-
- sc->wb_txthresh = WB_TXTHRESH_INIT;
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, WB_BUSCTL, WB_BUSCTL_CONFIG);
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_THRESH);
- WB_SETBIT(sc, WB_NETCFG, WB_TXTHRESH(sc->wb_txthresh));
-
- /* This doesn't tend to work too well at 100Mbps. */
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_EARLY_ON);
-
- wb_setcfg(sc, phy_bmcr);
-
- /* Init our MAC address */
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, WB_NODE0 + i, sc->arpcom.ac_enaddr[i]);
- }
-
- /* Init circular RX list. */
- if (wb_list_rx_init(sc) == ENOBUFS) {
- printf("wb%d: initialization failed: no "
- "memory for rx buffers\n", sc->wb_unit);
- wb_stop(sc);
- (void)splx(s);
- return;
- }
-
- /* Init TX descriptors. */
- wb_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ALLPHYS);
- } else {
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ALLPHYS);
- }
-
- /*
- * Set capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_BROAD);
- } else {
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_BROAD);
- }
-
- /*
- * Program the multicast filter, if necessary.
- */
- wb_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXADDR, vtophys(&sc->wb_ldata->wb_rx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, WB_IMR, WB_INTRS);
- CSR_WRITE_4(sc, WB_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXSTART, 0xFFFFFFFF);
-
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- CSR_WRITE_4(sc, WB_TXADDR, vtophys(&sc->wb_ldata->wb_tx_list[0]));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
-
- /* Restore state of BMCR */
- if (sc->wb_pinfo != NULL)
- wb_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int wb_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- wb_autoneg_mii(sc, WB_FLAG_SCHEDDELAY, 1);
- else
- wb_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void wb_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct wb_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = wb_phy_readreg(sc, PHY_LPAR);
- advert = wb_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int wb_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct wb_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- wb_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- wb_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- wb_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void wb_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->wb_autoneg) {
- wb_autoneg_mii(sc, WB_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("wb%d: watchdog timeout\n", sc->wb_unit);
-
- if (!(wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("wb%d: no carrier - transceiver cable problem?\n",
- sc->wb_unit);
-
- wb_stop(sc);
- wb_reset(sc);
- wb_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- wb_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void wb_stop(sc)
- struct wb_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- WB_CLRBIT(sc, WB_NETCFG, (WB_NETCFG_RX_ON|WB_NETCFG_TX_ON));
- CSR_WRITE_4(sc, WB_IMR, 0x00000000);
- CSR_WRITE_4(sc, WB_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, WB_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < WB_RX_LIST_CNT; i++) {
- if (sc->wb_cdata.wb_rx_chain[i].wb_mbuf != NULL) {
- m_freem(sc->wb_cdata.wb_rx_chain[i].wb_mbuf);
- sc->wb_cdata.wb_rx_chain[i].wb_mbuf = NULL;
- }
- }
- bzero((char *)&sc->wb_ldata->wb_rx_list,
- sizeof(sc->wb_ldata->wb_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < WB_TX_LIST_CNT; i++) {
- if (sc->wb_cdata.wb_tx_chain[i].wb_mbuf != NULL) {
- m_freem(sc->wb_cdata.wb_tx_chain[i].wb_mbuf);
- sc->wb_cdata.wb_tx_chain[i].wb_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->wb_ldata->wb_tx_list,
- sizeof(sc->wb_ldata->wb_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void wb_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct wb_softc *sc = (struct wb_softc *)arg;
-
- wb_stop(sc);
-
- return;
-}
-
-static struct pci_device wb_device = {
- "wb",
- wb_probe,
- wb_attach,
- &wb_count,
- NULL
-};
-DATA_SET(pcidevice_set, wb_device);
diff --git a/sys/pci/if_wbreg.h b/sys/pci/if_wbreg.h
deleted file mode 100644
index 17c55d8ce36e..000000000000
--- a/sys/pci/if_wbreg.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
- * 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.
- *
- * $Id: if_wbreg.h,v 1.12 1998/11/29 06:40:50 wpaul Exp wpaul $
- */
-
-/*
- * Winbond register definitions.
- */
-
-#define WB_BUSCTL 0x00 /* bus control */
-#define WB_TXSTART 0x04 /* tx start demand */
-#define WB_RXSTART 0x08 /* rx start demand */
-#define WB_RXADDR 0x0C /* rx descriptor list start addr */
-#define WB_TXADDR 0x10 /* tx descriptor list start addr */
-#define WB_ISR 0x14 /* interrupt status register */
-#define WB_NETCFG 0x18 /* network config register */
-#define WB_IMR 0x1C /* interrupt mask */
-#define WB_FRAMESDISCARDED 0x20 /* # of discarded frames */
-#define WB_SIO 0x24 /* MII and ROM/EEPROM access */
-#define WB_BOOTROMADDR 0x28
-#define WB_TIMER 0x2C /* general timer */
-#define WB_CURRXCTL 0x30 /* current RX descriptor */
-#define WB_CURRXBUF 0x34 /* current RX buffer */
-#define WB_MAR0 0x38 /* multicast filter 0 */
-#define WB_MAR1 0x3C /* multicast filter 1 */
-#define WB_NODE0 0x40 /* station address 0 */
-#define WB_NODE1 0x44 /* station address 1 */
-#define WB_BOOTROMSIZE 0x48 /* boot ROM size */
-#define WB_CURTXCTL 0x4C /* current TX descriptor */
-#define WB_CURTXBUF 0x50 /* current TX buffer */
-
-/*
- * Bus control bits.
- */
-#define WB_BUSCTL_RESET 0x00000001
-#define WB_BUSCTL_ARBITRATION 0x00000002
-#define WB_BUSCTL_SKIPLEN 0x0000007C
-#define WB_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define WB_BUSCTL_BURSTLEN 0x00003F00
-#define WB_BUSCTL_CACHEALIGN 0x0000C000
-#define WB_BUSCTL_DES_BIGENDIAN 0x00100000
-#define WB_BUSCTL_WAIT 0x00200000
-
-#define WB_SKIPLEN_1LONG 0x00000004
-#define WB_SKIPLEN_2LONG 0x00000008
-#define WB_SKIPLEN_3LONG 0x00000010
-#define WB_SKIPLEN_4LONG 0x00000020
-#define WB_SKIPLEN_5LONG 0x00000040
-
-#define WB_CACHEALIGN_8LONG 0x00004000
-#define WB_CACHEALIGN_16LONG 0x00008000
-#define WB_CACHEALIGN_32LONG 0x0000C000
-
-#define WB_BURSTLEN_USECA 0x00000000
-#define WB_BURSTLEN_1LONG 0x00000100
-#define WB_BURSTLEN_2LONG 0x00000200
-#define WB_BURSTLEN_4LONG 0x00000400
-#define WB_BURSTLEN_8LONG 0x00000800
-#define WB_BURSTLEN_16LONG 0x00001000
-#define WB_BURSTLEN_32LONG 0x00002000
-
-#define WB_BUSCTL_CONFIG (WB_CACHEALIGN_8LONG|WB_SKIPLEN_3LONG| \
- WB_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define WB_ISR_TX_OK 0x00000001
-#define WB_ISR_TX_IDLE 0x00000002
-#define WB_ISR_TX_NOBUF 0x00000004
-#define WB_ISR_RX_EARLY 0x00000008
-#define WB_ISR_RX_ERR 0x00000010
-#define WB_ISR_TX_UNDERRUN 0x00000020
-#define WB_ISR_RX_OK 0x00000040
-#define WB_ISR_RX_NOBUF 0x00000080
-#define WB_ISR_RX_IDLE 0x00000100
-#define WB_ISR_TX_EARLY 0x00000400
-#define WB_ISR_TIMER_EXPIRED 0x00000800
-#define WB_ISR_BUS_ERR 0x00002000
-#define WB_ISR_ABNORMAL 0x00008000
-#define WB_ISR_NORMAL 0x00010000
-#define WB_ISR_RX_STATE 0x000E0000
-#define WB_ISR_TX_STATE 0x00700000
-#define WB_ISR_BUSERRTYPE 0x03800000
-
-/*
- * The RX_STATE and TX_STATE fields are not described anywhere in the
- * Winbond datasheet, however it appears that the Winbond chip is an
- * attempt at a DEC 'tulip' clone, hence the ISR register is identical
- * to that of the tulip chip and we can steal the bit definitions from
- * the tulip documentation.
- */
-#define WB_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define WB_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define WB_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define WB_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define WB_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define WB_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define WB_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define WB_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define WB_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define WB_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define WB_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define WB_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define WB_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define WB_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define WB_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define WB_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define WB_NETCFG_RX_ON 0x00000002
-#define WB_NETCFG_RX_ALLPHYS 0x00000008
-#define WB_NETCFG_RX_MULTI 0x00000010
-#define WB_NETCFG_RX_BROAD 0x00000020
-#define WB_NETCFG_RX_RUNT 0x00000040
-#define WB_NETCFG_RX_ERR 0x00000080
-#define WB_NETCFG_FULLDUPLEX 0x00000200
-#define WB_NETCFG_LOOPBACK 0x00000C00
-#define WB_NETCFG_TX_ON 0x00002000
-#define WB_NETCFG_TX_THRESH 0x001FC000
-#define WB_NETCFG_RX_EARLYTHRSH 0x1FE00000
-#define WB_NETCFG_100MBPS 0x20000000
-#define WB_NETCFG_TX_EARLY_ON 0x40000000
-#define WB_NETCFG_RX_EARLY_ON 0x80000000
-
-/*
- * The tx threshold can be adjusted in increments of 32 bytes.
- */
-#define WB_TXTHRESH(x) ((x >> 5) << 14)
-#define WB_TXTHRESH_CHUNK 32
-#define WB_TXTHRESH_INIT 0 /*72*/
-
-/*
- * Interrupt mask bits.
- */
-#define WB_IMR_TX_OK 0x00000001
-#define WB_IMR_TX_IDLE 0x00000002
-#define WB_IMR_TX_NOBUF 0x00000004
-#define WB_IMR_RX_EARLY 0x00000008
-#define WB_IMR_RX_ERR 0x00000010
-#define WB_IMR_TX_UNDERRUN 0x00000020
-#define WB_IMR_RX_OK 0x00000040
-#define WB_IMR_RX_NOBUF 0x00000080
-#define WB_IMR_RX_IDLE 0x00000100
-#define WB_IMR_TX_EARLY 0x00000400
-#define WB_IMR_TIMER_EXPIRED 0x00000800
-#define WB_IMR_BUS_ERR 0x00002000
-#define WB_IMR_ABNORMAL 0x00008000
-#define WB_IMR_NORMAL 0x00010000
-
-#define WB_INTRS \
- (WB_IMR_RX_OK|WB_IMR_TX_OK|WB_IMR_RX_NOBUF|WB_IMR_RX_ERR| \
- WB_IMR_TX_NOBUF|WB_IMR_TX_UNDERRUN|WB_IMR_BUS_ERR| \
- WB_IMR_ABNORMAL|WB_IMR_NORMAL|WB_IMR_TX_EARLY)
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define WB_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define WB_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define WB_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define WB_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define WB_SIO_ROMDATA4 0x00000010
-#define WB_SIO_ROMDATA5 0x00000020
-#define WB_SIO_ROMDATA6 0x00000040
-#define WB_SIO_ROMDATA7 0x00000080
-#define WB_SIO_ROMCTL_WRITE 0x00000200
-#define WB_SIO_ROMCTL_READ 0x00000400
-#define WB_SIO_EESEL 0x00000800
-#define WB_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define WB_SIO_MII_DATAIN 0x00020000 /* MDIO data out */
-#define WB_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define WB_SIO_MII_DATAOUT 0x00080000 /* MDIO data in */
-
-#define WB_EECMD_WRITE 0x140
-#define WB_EECMD_READ 0x180
-#define WB_EECMD_ERASE 0x1c0
-
-/*
- * Winbond TX/RX descriptor structure.
- */
-
-struct wb_desc {
- u_int32_t wb_status;
- u_int32_t wb_ctl;
- u_int32_t wb_ptr1;
- u_int32_t wb_ptr2;
-};
-
-#define wb_data wb_ptr1
-#define wb_next wb_ptr2
-
-#define WB_RXSTAT_CRCERR 0x00000002
-#define WB_RXSTAT_DRIBBLE 0x00000004
-#define WB_RXSTAT_MIIERR 0x00000008
-#define WB_RXSTAT_LATEEVENT 0x00000040
-#define WB_RXSTAT_GIANT 0x00000080
-#define WB_RXSTAT_LASTFRAG 0x00000100
-#define WB_RXSTAT_FIRSTFRAG 0x00000200
-#define WB_RXSTAT_MULTICAST 0x00000400
-#define WB_RXSTAT_RUNT 0x00000800
-#define WB_RXSTAT_RXTYPE 0x00003000
-#define WB_RXSTAT_RXERR 0x00008000
-#define WB_RXSTAT_RXLEN 0x3FFF0000
-#define WB_RXSTAT_RXCMP 0x40000000
-#define WB_RXSTAT_OWN 0x80000000
-
-#define WB_RXBYTES(x) ((x & WB_RXSTAT_RXLEN) >> 16)
-#define WB_RXSTAT (WB_RXSTAT_FIRSTFRAG|WB_RXSTAT_LASTFRAG|WB_RXSTAT_OWN)
-
-#define WB_RXCTL_BUFLEN1 0x00000FFF
-#define WB_RXCTL_BUFLEN2 0x00FFF000
-#define WB_RXCTL_RLINK 0x01000000
-#define WB_RXCTL_RLAST 0x02000000
-
-#define WB_TXSTAT_DEFER 0x00000001
-#define WB_TXSTAT_UNDERRUN 0x00000002
-#define WB_TXSTAT_COLLCNT 0x00000078
-#define WB_TXSTAT_SQE 0x00000080
-#define WB_TXSTAT_ABORT 0x00000100
-#define WB_TXSTAT_LATECOLL 0x00000200
-#define WB_TXSTAT_NOCARRIER 0x00000400
-#define WB_TXSTAT_CARRLOST 0x00000800
-#define WB_TXSTAT_TXERR 0x00001000
-#define WB_TXSTAT_OWN 0x80000000
-
-#define WB_TXCTL_BUFLEN1 0x000007FF
-#define WB_TXCTL_BUFLEN2 0x003FF800
-#define WB_TXCTL_PAD 0x00800000
-#define WB_TXCTL_TLINK 0x01000000
-#define WB_TXCTL_TLAST 0x02000000
-#define WB_TXCTL_NOCRC 0x08000000
-#define WB_TXCTL_FIRSTFRAG 0x20000000
-#define WB_TXCTL_LASTFRAG 0x40000000
-#define WB_TXCTL_FINT 0x80000000
-
-#define WB_MAXFRAGS 16
-#define WB_RX_LIST_CNT 64
-#define WB_TX_LIST_CNT 64
-#define WB_MIN_FRAMELEN 60
-
-/*
- * A transmit 'super descriptor' is actually WB_MAXFRAGS regular
- * descriptors clumped together. The idea here is to emulate the
- * multi-fragment descriptor layout found in devices such as the
- * Texas Instruments ThunderLAN and 3Com boomerang and cylone chips.
- * The advantage to using this scheme is that it avoids buffer copies.
- * The disadvantage is that there's a certain amount of overhead due
- * to the fact that each 'fragment' is 16 bytes long. In my tests,
- * this limits top speed to about 10.5MB/sec. It should be more like
- * 11.5MB/sec. However, the upshot is that you can achieve better
- * results on slower machines: a Pentium 200 can pump out packets at
- * same speed as a PII 400.
- */
-struct wb_txdesc {
- struct wb_desc wb_frag[WB_MAXFRAGS];
-};
-
-#define WB_TXNEXT(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_next
-#define WB_TXSTATUS(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_status
-#define WB_TXCTL(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_ctl
-#define WB_TXDATA(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_data
-
-#define WB_TXOWN(x) x->wb_ptr->wb_frag[0].wb_status
-
-#define WB_UNSENT 0x1234
-
-struct wb_list_data {
- struct wb_desc wb_rx_list[WB_RX_LIST_CNT];
- struct wb_txdesc wb_tx_list[WB_TX_LIST_CNT];
-};
-
-struct wb_chain {
- struct wb_txdesc *wb_ptr;
- struct mbuf *wb_mbuf;
- struct wb_chain *wb_nextdesc;
- u_int8_t wb_lastdesc;
-};
-
-struct wb_chain_onefrag {
- struct wb_desc *wb_ptr;
- struct mbuf *wb_mbuf;
- struct wb_chain_onefrag *wb_nextdesc;
- u_int8_t wb_rlast;
-};
-
-struct wb_chain_data {
- u_int8_t wb_pad[WB_MIN_FRAMELEN];
- struct wb_chain_onefrag wb_rx_chain[WB_RX_LIST_CNT];
- struct wb_chain wb_tx_chain[WB_TX_LIST_CNT];
-
- struct wb_chain_onefrag *wb_rx_head;
-
- struct wb_chain *wb_tx_head;
- struct wb_chain *wb_tx_tail;
- struct wb_chain *wb_tx_free;
-};
-
-struct wb_type {
- u_int16_t wb_vid;
- u_int16_t wb_did;
- char *wb_name;
-};
-
-struct wb_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define WB_MII_STARTDELIM 0x01
-#define WB_MII_READOP 0x02
-#define WB_MII_WRITEOP 0x01
-#define WB_MII_TURNAROUND 0x02
-
-#define WB_FLAG_FORCEDELAY 1
-#define WB_FLAG_SCHEDDELAY 2
-#define WB_FLAG_DELAYTIMEO 3
-
-struct wb_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t wb_bhandle;
- bus_space_tag_t wb_btag;
- struct wb_type *wb_info; /* 3Com adapter info */
- struct wb_type *wb_pinfo; /* phy info */
- u_int8_t wb_unit; /* interface number */
- u_int8_t wb_type;
- u_int8_t wb_phy_addr; /* PHY address */
- u_int8_t wb_tx_pend; /* TX pending */
- u_int8_t wb_want_auto;
- u_int8_t wb_autoneg;
- u_int16_t wb_txthresh;
- caddr_t wb_ldata_ptr;
- struct wb_list_data *wb_ldata;
- struct wb_chain_data wb_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->wb_btag, sc->wb_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->wb_btag, sc->wb_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->wb_btag, sc->wb_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->wb_btag, sc->wb_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->wb_btag, sc->wb_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->wb_btag, sc->wb_bhandle, reg)
-
-#define WB_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Winbond PCI vendor ID
- */
-#define WB_VENDORID 0x1050
-
-/*
- * Winbond device IDs.
- */
-#define WB_DEVICEID_840F 0x0840
-
-/*
- * Compex vendor ID.
- */
-#define CP_VENDORID 0x11F6
-
-/*
- * Compex device IDs.
- */
-#define CP_DEVICEID_RL100 0x2011
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers. Note: some are only available on
- * the 3c905B, in particular those that related to power management.
- */
-
-#define WB_PCI_VENDOR_ID 0x00
-#define WB_PCI_DEVICE_ID 0x02
-#define WB_PCI_COMMAND 0x04
-#define WB_PCI_STATUS 0x06
-#define WB_PCI_CLASSCODE 0x09
-#define WB_PCI_LATENCY_TIMER 0x0D
-#define WB_PCI_HEADER_TYPE 0x0E
-#define WB_PCI_LOIO 0x10
-#define WB_PCI_LOMEM 0x14
-#define WB_PCI_BIOSROM 0x30
-#define WB_PCI_INTLINE 0x3C
-#define WB_PCI_INTPIN 0x3D
-#define WB_PCI_MINGNT 0x3E
-#define WB_PCI_MINLAT 0x0F
-#define WB_PCI_RESETOPT 0x48
-#define WB_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define WB_PCI_CAPID 0xDC /* 8 bits */
-#define WB_PCI_NEXTPTR 0xDD /* 8 bits */
-#define WB_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define WB_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define WB_PSTATE_MASK 0x0003
-#define WB_PSTATE_D0 0x0000
-#define WB_PSTATE_D1 0x0002
-#define WB_PSTATE_D2 0x0002
-#define WB_PSTATE_D3 0x0003
-#define WB_PME_EN 0x0010
-#define WB_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define WB_PHYADDR_MIN 0x00
-#define WB_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 26c528457240..aede51e4c831 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_xl.c,v 1.21 1998/12/14 06:32:57 dillon Exp $
+ * $Id: if_xl.c,v 1.54 1998/09/25 17:43:57 wpaul Exp wpaul $
*/
/*
@@ -145,9 +145,9 @@
#include <pci/if_xlreg.h>
-#if !defined(lint)
-static const char rcsid[] =
- "$Id: if_xl.c,v 1.21 1998/12/14 06:32:57 dillon Exp $";
+#ifndef lint
+static char rcsid[] =
+ "$Id: if_xl.c,v 1.54 1998/09/25 17:43:57 wpaul Exp wpaul $";
#endif
/*
@@ -194,7 +194,7 @@ static struct xl_type xl_phys[] = {
};
static unsigned long xl_count = 0;
-static const char *xl_probe __P((pcici_t, pcidi_t));
+static char *xl_probe __P((pcici_t, pcidi_t));
static void xl_attach __P((pcici_t, int));
static int xl_newbuf __P((struct xl_softc *,
@@ -224,14 +224,14 @@ static void xl_mii_send __P((struct xl_softc *, u_int32_t, int));
static int xl_mii_readreg __P((struct xl_softc *, struct xl_mii_frame *));
static int xl_mii_writereg __P((struct xl_softc *, struct xl_mii_frame *));
static u_int16_t xl_phy_readreg __P((struct xl_softc *, int));
-static void xl_phy_writereg __P((struct xl_softc *, int, int));
+static void xl_phy_writereg __P((struct xl_softc *, u_int16_t, u_int16_t));
static void xl_autoneg_xmit __P((struct xl_softc *));
static void xl_autoneg_mii __P((struct xl_softc *, int, int));
static void xl_setmode_mii __P((struct xl_softc *, int));
static void xl_getmode_mii __P((struct xl_softc *));
static void xl_setmode __P((struct xl_softc *, int));
-static u_int8_t xl_calchash __P((caddr_t));
+static u_int8_t xl_calchash __P((u_int8_t *));
static void xl_setmulti __P((struct xl_softc *));
static void xl_setmulti_hash __P((struct xl_softc *));
static void xl_reset __P((struct xl_softc *));
@@ -502,8 +502,8 @@ static u_int16_t xl_phy_readreg(sc, reg)
static void xl_phy_writereg(sc, reg, data)
struct xl_softc *sc;
- int reg;
- int data;
+ u_int16_t reg;
+ u_int16_t data;
{
struct xl_mii_frame frame;
@@ -592,7 +592,7 @@ static int xl_read_eeprom(sc, dest, off, cnt, swap)
* On older cards, the upper 2 bits will be ignored. Grrrr....
*/
static u_int8_t xl_calchash(addr)
- caddr_t addr;
+ u_int8_t *addr;
{
u_int32_t crc, carry;
int i, j;
@@ -983,7 +983,7 @@ static void xl_getmode_mii(sc)
if (bootverbose)
printf("xl%d: forcing on autoneg support for BT4\n",
sc->xl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
+ ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
#endif
}
@@ -1185,7 +1185,7 @@ static void xl_reset(sc)
* Probe for a 3Com Etherlink XL chip. Check the PCI vendor and device
* IDs against our list and return a device name if we find a match.
*/
-static const char *
+static char *
xl_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1444,7 +1444,7 @@ xl_attach(config_id, unit)
if (round % 8) {
round++;
roundptr++;
- } else
+ }
break;
}
sc->xl_ldata = (struct xl_list_data *)roundptr;
@@ -1932,6 +1932,8 @@ static void xl_txeof(sc)
cur_tx->xl_next = sc->xl_cdata.xl_tx_free;
sc->xl_cdata.xl_tx_free = cur_tx;
+ if (!cur_tx->xl_ptr->xl_next);
+ break;
}
if (sc->xl_cdata.xl_tx_head == NULL) {
@@ -1977,10 +1979,6 @@ static void xl_txeoc(sc)
* first generation 3c90X chips.
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
- if (sc->xl_type == XL_TYPE_905B) {
- CSR_WRITE_2(sc, XL_COMMAND,
- XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
- }
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_ENABLE);
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
} else {
@@ -2259,12 +2257,6 @@ static void xl_start(ifp)
}
/*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
* Place the request for the upload interrupt
* in the last descriptor in the chain. This way, if
* we're chaining several packets at once, we'll only
@@ -2286,7 +2278,6 @@ static void xl_start(ifp)
vtophys(start_tx->xl_ptr);
sc->xl_cdata.xl_tx_tail->xl_ptr->xl_status &=
~XL_TXSTAT_DL_INTR;
- sc->xl_cdata.xl_tx_tail = cur_tx;
} else {
sc->xl_cdata.xl_tx_head = start_tx;
sc->xl_cdata.xl_tx_tail = cur_tx;
@@ -2387,20 +2378,6 @@ static void xl_init(xsc)
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
- /*
- * If this is a 3c905B, also set the tx reclaim threshold.
- * This helps cut down on the number of tx reclaim errors
- * that could happen on a busy network. The chip multiplies
- * the register value by 16 to obtain the actual threshold
- * in bytes, so we divide by 16 when setting the value here.
- * The existing threshold value can be examined by reading
- * the register at offset 9 in window 5.
- */
- if (sc->xl_type == XL_TYPE_905B) {
- CSR_WRITE_2(sc, XL_COMMAND,
- XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
- }
-
/* Set RX filter bits. */
XL_SEL_WIN(5);
rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h
index c45914f57fbb..b2604737c68f 100644
--- a/sys/pci/if_xlreg.h
+++ b/sys/pci/if_xlreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_xlreg.h,v 1.19 1998/10/22 15:35:06 wpaul Exp $
+ * $Id: if_xlreg.h,v 1.16 1998/09/25 17:43:57 wpaul Exp wpaul $
*/
#define XL_EE_READ 0x0080 /* read, 5 bit address */
@@ -361,7 +361,6 @@
*/
#define XL_W5_STAT_ENB 0x0C
#define XL_W5_INTR_ENB 0x0A
-#define XL_W5_RECLAIM_THRESH 0x09 /* 3c905B only */
#define XL_W5_RX_FILTER 0x08
#define XL_W5_RX_EARLYTHRESH 0x06
#define XL_W5_TX_AVAILTHRESH 0x02
diff --git a/sys/pci/isp_pci.c b/sys/pci/isp_pci.c
index 84960d8f1e2d..ae7842b2e079 100644
--- a/sys/pci/isp_pci.c
+++ b/sys/pci/isp_pci.c
@@ -1,5 +1,4 @@
-/* $Id: isp_pci.c,v 1.12 1998/12/28 19:24:23 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
* FreeBSD Version.
@@ -79,7 +78,7 @@ static struct ispmdvec mdvec = {
ISP_CODE_LENGTH,
ISP_CODE_ORG,
ISP_CODE_VERSION,
- BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64,
+ BIU_BURST_ENABLE,
0
};
@@ -96,7 +95,7 @@ static struct ispmdvec mdvec_2100 = {
ISP2100_CODE_LENGTH,
ISP2100_CODE_ORG,
ISP2100_CODE_VERSION,
- 0, /* Irrelevant to the 2100 */
+ BIU_BURST_ENABLE,
0
};
@@ -129,7 +128,7 @@ static struct ispmdvec mdvec_2100 = {
#define MEM_MAP_REG 0x14
-static const char *isp_pci_probe __P((pcici_t tag, pcidi_t type));
+static char *isp_pci_probe __P((pcici_t tag, pcidi_t type));
static void isp_pci_attach __P((pcici_t config_d, int unit));
/* This distinguishing define is not right, but it does work */
@@ -196,8 +195,10 @@ struct pci_device isp_pci_driver = {
DATA_SET (pcidevice_set, isp_pci_driver);
-static const char *
-isp_pci_probe(pcici_t tag, pcidi_t type)
+static char *
+isp_pci_probe(tag, type)
+ pcici_t tag;
+ pcidi_t type;
{
static int oneshot = 1;
char *x;
@@ -223,7 +224,9 @@ isp_pci_probe(pcici_t tag, pcidi_t type)
static void
-isp_pci_attach(pcici_t config_id, int unit)
+isp_pci_attach(config_id, unit)
+ pcici_t config_id;
+ int unit;
{
int mapped;
pci_port_t io_port;
@@ -267,11 +270,7 @@ isp_pci_attach(pcici_t config_id, int unit)
pcs->pci_st == IO_SPACE_MAPPING? "I/O" : "Memory");
isp = &pcs->pci_isp;
-#if __FreeBSD_version >= 300006
- (void) snprintf(isp->isp_name, sizeof(isp->isp_name), "isp%d", unit);
-#else
(void) sprintf(isp->isp_name, "isp%d", unit);
-#endif
isp->isp_osinfo.unit = unit;
data = pci_conf_read(config_id, PCI_ID_REG);
@@ -288,7 +287,7 @@ isp_pci_attach(pcici_t config_id, int unit)
data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
data |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN;
pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, data);
-#if 0
+
/*
* Wierd- we need to clear the lsb in offset 0x30 to take the
* chip out of reset state.
@@ -296,7 +295,6 @@ isp_pci_attach(pcici_t config_id, int unit)
data = pci_conf_read(config_id, 0x30);
data &= ~1;
pci_conf_write(config_id, 0x30, data);
-#endif
ISP_UNLOCK(isp);
} else {
printf("%s: unknown dev (%x)- punting\n", isp->isp_name, data);
@@ -349,7 +347,9 @@ isp_pci_attach(pcici_t config_id, int unit)
#define PCI_BIU_REGS_OFF BIU_REGS_OFF
static u_int16_t
-isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
+isp_pci_rd_reg(isp, regoff)
+ struct ispsoftc *isp;
+ int regoff;
{
u_int16_t rv;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@@ -382,7 +382,10 @@ isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
}
static void
-isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
+isp_pci_wr_reg(isp, regoff, val)
+ struct ispsoftc *isp;
+ int regoff;
+ u_int16_t val;
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int offset, oldsxp = 0;
@@ -417,21 +420,33 @@ static void isp_map_result __P((void *, bus_dma_segment_t *, int, int));
static void isp_map_fcscrt __P((void *, bus_dma_segment_t *, int, int));
static void
-isp_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_rquest(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
isp->isp_rquest_dma = segs->ds_addr;
}
static void
-isp_map_result(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_result(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
isp->isp_result_dma = segs->ds_addr;
}
static void
-isp_map_fcscrt(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_fcscrt(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
fcparam *fcp = isp->isp_param;
@@ -439,7 +454,8 @@ isp_map_fcscrt(void *arg, bus_dma_segment_t *segs, int nseg, int error)
}
static int
-isp_pci_mbxdma(struct ispsoftc *isp)
+isp_pci_mbxdma(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
caddr_t base;
@@ -511,7 +527,11 @@ typedef struct {
#define MUSHERR_NOQENTRIES -2
static void
-dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
+dma2(arg, dm_segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *dm_segs;
+ int nseg;
+ int error;
{
mush_t *mp;
ISP_SCSI_XFER_T *ccb;
@@ -632,8 +652,12 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
static int
-isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb, ispreq_t *rq,
- u_int8_t *iptrp, u_int8_t optr)
+isp_pci_dmasetup(isp, ccb, rq, iptrp, optr)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *ccb;
+ ispreq_t *rq;
+ u_int8_t *iptrp;
+ u_int8_t optr;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
struct ccb_hdr *ccb_h;
@@ -721,8 +745,10 @@ isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb, ispreq_t *rq,
}
static void
-isp_pci_dmateardown(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb,
- u_int32_t handle)
+isp_pci_dmateardown(isp, ccb, handle)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *ccb;
+ u_int32_t handle;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
bus_dmamap_t *dp = &pci->dmaps[handle];
@@ -739,7 +765,8 @@ isp_pci_dmateardown(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb,
static int
-isp_pci_mbxdma(struct ispsoftc *isp)
+isp_pci_mbxdma(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
u_int32_t len;
@@ -785,8 +812,12 @@ isp_pci_mbxdma(struct ispsoftc *isp)
}
static int
-isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs,
- ispreq_t *rq, u_int8_t *iptrp, u_int8_t optr)
+isp_pci_dmasetup(isp, xs, rq, iptrp, optr)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *xs;
+ ispreq_t *rq;
+ u_int8_t *iptrp;
+ u_int8_t optr;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
ispcontreq_t *crq;
@@ -911,14 +942,16 @@ isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs,
#endif
static void
-isp_pci_reset1(struct ispsoftc *isp)
+isp_pci_reset1(isp)
+ struct ispsoftc *isp;
{
/* Make sure the BIOS is disabled */
isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
}
static void
-isp_pci_dumpregs(struct ispsoftc *isp)
+isp_pci_dumpregs(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
printf("%s: PCI Status Command/Status=%lx\n", pci->pci_isp.isp_name,
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index f81578d9496e..c65860beb084 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -197,7 +197,7 @@ static meteor_reg_t meteor[NMETEOR];
#define METPRI (PZERO+8)|PCATCH
-static const char* met_probe (pcici_t tag, pcidi_t type);
+static char* met_probe (pcici_t tag, pcidi_t type);
static void met_attach(pcici_t tag, int unit);
static u_long met_count;
@@ -517,7 +517,7 @@ register int err = 0;
}
#undef i2c_print
-static const char *
+static char *
met_probe (pcici_t tag, pcidi_t type)
{
@@ -2054,7 +2054,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
}
int
-meteor_mmap(dev_t dev, vm_offset_t offset, int nprot)
+meteor_mmap(dev_t dev, int offset, int nprot)
{
int unit;
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 79d8eaefe053..37033226272c 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.140 1998/12/14 05:47:27 dillon Exp $
+** $Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
@@ -1333,6 +1333,7 @@ static void ncr_getsync (ncb_p np, u_char sfac, u_char *fakp,
u_char *scntl3p);
static void ncr_setsync (ncb_p np, nccb_p cp,u_char scntl3,u_char sxfer,
u_char period);
+static void ncr_settags (tcb_p tp, lcb_p lp, u_long usrtag);
static void ncr_setwide (ncb_p np, nccb_p cp, u_char wide, u_char ack);
static int ncr_show_msg (u_char * msg);
static int ncr_snooptest (ncb_p np);
@@ -1340,7 +1341,7 @@ static void ncr_action (struct cam_sim *sim, union ccb *ccb);
static void ncr_timeout (void *arg);
static void ncr_wakeup (ncb_p np, u_long code);
-static const char* ncr_probe (pcici_t tag, pcidi_t type);
+static char* ncr_probe (pcici_t tag, pcidi_t type);
static void ncr_attach (pcici_t tag, int unit);
#endif /* KERNEL */
@@ -1355,10 +1356,8 @@ static void ncr_attach (pcici_t tag, int unit);
*/
-#if !defined(lint)
-static const char ident[] =
- "\n$Id: ncr.c,v 1.140 1998/12/14 05:47:27 dillon Exp $\n";
-#endif
+static char ident[] =
+ "\n$Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $\n";
static const u_long ncr_version = NCR_VERSION * 11
+ (u_long) sizeof (struct ncb) * 7
@@ -1411,7 +1410,7 @@ DATA_SET (pcidevice_set, ncr_device);
static char *ncr_name (ncb_p np)
{
static char name[10];
- snprintf(name, sizeof(name), "ncr%d", np->unit);
+ sprintf(name, "ncr%d", np->unit);
return (name);
}
@@ -3357,7 +3356,7 @@ static int ncr_chip_lookup(u_long device_id, u_char revision_id)
-static const char* ncr_probe (pcici_t tag, pcidi_t type)
+static char* ncr_probe (pcici_t tag, pcidi_t type)
{
u_char rev = pci_conf_read (tag, PCI_CLASS_REG) & 0xff;
int i;
@@ -5014,6 +5013,8 @@ ncr_setsync(ncb_p np, nccb_p cp, u_char scntl3, u_char sxfer, u_char period)
tp->tinfo.wval = scntl3;
if (sxfer & 0x1f) {
+ unsigned f10 = 100000 << tp->tinfo.current.width;
+ unsigned mb10 = (f10 + period_10ns/2) / period_10ns;
/*
** Disable extended Sreq/Sack filtering
*/
@@ -7115,7 +7116,7 @@ struct tekram_eeprom {
#define TKR_ADPT_ACTNEG 0x08
#define TKR_ADPT_NOSEEK 0x10
#define TKR_ADPT_MORLUN 0x20
- u_char delay; /* unit ? ( table ??? ) */
+ u_char delay; /* unit ? (table ???) */
u_char tags; /* use 4 times as many ... */
u_char filler[60];
};
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 73b8142a89c0..8d5fd193fe2e 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci.c,v 1.92 1999/01/12 01:44:42 eivind Exp $
+ * $Id: pci.c,v 1.88 1998/09/15 22:05:37 gibbs Exp $
*
*/
@@ -148,10 +148,9 @@ pci_maprange(unsigned mapreg)
static pcimap *
pci_readmaps(pcicfgregs *cfg, int maxmaps)
{
- int i, j = 0;
+ int i;
pcimap *map;
int map64 = 0;
- int reg = PCIR_MAPS;
for (i = 0; i < maxmaps; i++) {
int reg = PCIR_MAPS + i*4;
@@ -161,48 +160,40 @@ pci_readmaps(pcicfgregs *cfg, int maxmaps)
base = pci_cfgread(cfg, reg, 4);
ln2range = pci_maprange(base);
- if (base == 0 || ln2range == 0 || base == 0xffffffff)
- continue; /* skip invalid entry */
- else {
- j++;
- if (ln2range > 32) {
- i++;
- j++;
- }
- }
+ if (base == 0 || ln2range == 0)
+ maxmaps = i;
+ else if (ln2range > 32)
+ i++;
}
- map = malloc(j * sizeof (pcimap), M_DEVBUF, M_WAITOK);
+ map = malloc(maxmaps * sizeof (pcimap), M_DEVBUF, M_WAITOK);
if (map != NULL) {
- bzero(map, sizeof(pcimap) * j);
- cfg->nummaps = j;
+ bzero(map, sizeof(pcimap) * maxmaps);
- for (i = 0, j = 0; i < maxmaps; i++, reg += 4) {
+ for (i = 0; i < maxmaps; i++) {
+ int reg = PCIR_MAPS + i*4;
u_int32_t base;
u_int32_t testval;
base = pci_cfgread(cfg, reg, 4);
if (map64 == 0) {
- if (base == 0 || base == 0xffffffff)
- continue; /* skip invalid entry */
pci_cfgwrite(cfg, reg, 0xffffffff, 4);
testval = pci_cfgread(cfg, reg, 4);
pci_cfgwrite(cfg, reg, base, 4);
- map[j].reg = reg;
- map[j].base = pci_mapbase(base);
- map[j].type = pci_maptype(base);
- map[j].ln2size = pci_mapsize(testval);
- map[j].ln2range = pci_maprange(testval);
- map64 = map[j].ln2range == 64;
+ map[i].base = pci_mapbase(base);
+ map[i].type = pci_maptype(base);
+ map[i].ln2size = pci_mapsize(testval);
+ map[i].ln2range = pci_maprange(testval);
+ map64 = map[i].ln2range == 64;
} else {
/* only fill in base, other fields are 0 */
- map[j].base = base;
+ map[i].base = base;
map64 = 0;
}
- j++;
}
+ cfg->nummaps = maxmaps;
}
return (map);
}
@@ -483,6 +474,14 @@ pci_addcfg(struct pci_devinfo *dinfo)
pci_drvattach(dinfo); /* XXX currently defined in pci_compat.c */
}
+/* return pointer to device that is a bridge to this bus */
+
+static pcicfgregs *
+pci_bridgeto(int bus)
+{
+ return (NULL); /* XXX not yet implemented */
+}
+
/* scan one PCI bus for devices */
static int
@@ -765,7 +764,7 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
*/
if ((error = useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) != 1){
- printf("pci_ioctl: pattern buffer %p, "
+ printf("pci_ioctl: pattern buffer %#p, "
"length %u isn't user accessible for"
" READ\n", cio->patterns,
cio->pat_buf_len);
@@ -801,7 +800,7 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
*/
if ((error = useracc((caddr_t)cio->matches, cio->match_buf_len,
B_WRITE)) != 1) {
- printf("pci_ioctl: match buffer %p, length %u "
+ printf("pci_ioctl: match buffer %#p, length %u "
"isn't user accessible for WRITE\n",
cio->matches, cio->match_buf_len);
error = EACCES;
diff --git a/sys/pci/pci_compat.c b/sys/pci/pci_compat.c
index 9f4c612b161f..c08231820733 100644
--- a/sys/pci/pci_compat.c
+++ b/sys/pci/pci_compat.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci_compat.c,v 1.19 1999/01/14 06:22:10 jdp Exp $
+ * $Id: pci_compat.c,v 1.11 1998/09/15 08:21:09 gibbs Exp $
*
*/
@@ -35,7 +35,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h> /* for DATA_SET support */
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -48,10 +48,6 @@
#include <sys/drvresource.h>
#endif
-#ifdef APIC_IO
-#include <machine/smp.h>
-#endif
-
#ifdef PCI_COMPAT
/* ------------------------------------------------------------------------- */
@@ -59,16 +55,13 @@
static int
pci_mapno(pcicfgregs *cfg, int reg)
{
- int i, nummaps;
- pcimap *map;
-
- nummaps = cfg->nummaps;
- map = cfg->map;
-
- for (i = 0; i < nummaps; i++)
- if (map[i].reg == reg)
- return (i);
- return (-1);
+ int map = -1;
+ if ((reg & 0x03) == 0) {
+ map = (reg -0x10) / 4;
+ if (map < 0 || map >= cfg->nummaps)
+ map = -1;
+ }
+ return (map);
}
static int
@@ -175,10 +168,11 @@ int pci_map_mem(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
int
pci_map_dense(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
{
+ vm_offset_t dense;
+ int retval = 0;
+
if(pci_map_mem(cfg, reg, va, pa)){
#ifdef __alpha__
- vm_offset_t dense;
-
if(dense = pci_cvt_to_dense(*pa)){
*pa = dense;
*va = ALPHA_PHYS_TO_K0SEG(*pa);
@@ -195,10 +189,11 @@ pci_map_dense(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
int
pci_map_bwx(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
{
+ vm_offset_t bwx;
+ int retval = 0;
+
if(pci_map_mem(cfg, reg, va, pa)){
#ifdef __alpha__
- vm_offset_t bwx;
-
if(bwx = pci_cvt_to_bwx(*pa)){
*pa = bwx;
*va = ALPHA_PHYS_TO_K0SEG(*pa);
@@ -212,15 +207,9 @@ pci_map_bwx(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
return (0);
}
-int
-pci_map_int(pcici_t cfg, pci_inthand_t *handler, void *arg, intrmask_t *maskptr)
-{
- return (pci_map_int_right(cfg, handler, arg, maskptr, 0));
-}
int
-pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr, u_int flags)
+pci_map_int(pcici_t cfg, pci_inthand_t *func, void *arg, unsigned *maskptr)
{
int error;
#ifdef APIC_IO
@@ -231,8 +220,7 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
void *dev_instance = (void *)-1; /* XXX use cfg->devdata */
void *idesc;
- idesc = intr_create(dev_instance, irq, handler, arg, maskptr,
- flags);
+ idesc = intr_create(dev_instance, irq, func, arg, maskptr, 0);
error = intr_connect(idesc);
if (error != 0)
return 0;
@@ -265,8 +253,8 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
nextpin = next_apic_irq(irq);
while (nextpin >= 0) {
- idesc = intr_create(dev_instance, nextpin, handler,
- arg, maskptr, flags);
+ idesc = intr_create(dev_instance, nextpin, func, arg,
+ maskptr, 0);
error = intr_connect(idesc);
if (error != 0)
return 0;
@@ -355,9 +343,9 @@ pci_freeunit(pcicfgregs *cfg, char *name, int unit)
return (unit);
}
-static const char *drvname;
+static char *drvname;
-static const char*
+static char*
pci_probedrv(pcicfgregs *cfg, struct pci_device *dvp)
{
if (dvp && dvp->pd_probe) {
@@ -435,7 +423,6 @@ pci_drvattach(struct pci_devinfo *dinfo)
else
strncpy(dinfo->conf.pd_name, "????",
sizeof(dinfo->conf.pd_name));
- dinfo->conf.pd_name[sizeof(dinfo->conf.pd_name) - 1] = 0;
dinfo->conf.pd_unit = unit;
@@ -461,7 +448,7 @@ int pci_register_lkm (struct pci_device *dvp, int if_revision)
return (-1);
}
lkm = malloc (sizeof (*lkm), M_DEVBUF, M_WAITOK);
- if (lkm == NULL) {
+ if (lkm != NULL) {
return (-1);
}
diff --git a/sys/pci/pcic_p.c b/sys/pci/pcic_p.c
index fd8b40b2ceef..4c667f223d0d 100644
--- a/sys/pci/pcic_p.c
+++ b/sys/pci/pcic_p.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcic_p.c,v 1.6 1998/08/18 00:32:48 bde Exp $
+ * $Id: pcic_p.c,v 1.5 1998/02/07 20:41:20 nate Exp $
*/
#include "pci.h"
@@ -44,7 +44,7 @@
static u_long pcic_pci_count = 0;
-static const char *pcic_pci_probe(pcici_t, pcidi_t);
+static char *pcic_pci_probe(pcici_t, pcidi_t);
static void pcic_pci_attach(pcici_t, int);
static void pd6832_legacy_init(pcici_t tag, int unit);
@@ -63,7 +63,7 @@ DATA_SET(pcidevice_set, pcic_pci_driver);
* Return the ID string for the controller if the vendor/product id
* matches, NULL otherwise.
*/
-static const char *
+static char *
pcic_pci_probe(pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/pcisupport.c b/sys/pci/pcisupport.c
index b502bbf7b864..b78ac652d8b0 100644
--- a/sys/pci/pcisupport.c
+++ b/sys/pci/pcisupport.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcisupport.c,v 1.85 1998/12/23 14:28:37 foxfair Exp $
+** $Id: pcisupport.c,v 1.71 1998/07/07 05:00:09 bde Exp $
**
** Device driver for DEC/INTEL PCI chipsets.
**
@@ -42,7 +42,6 @@
*/
#include "opt_pci.h"
-#include "opt_smp.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,7 +62,7 @@
**---------------------------------------------------------
*/
-static const char* chipset_probe (pcici_t tag, pcidi_t type);
+static char* chipset_probe (pcici_t tag, pcidi_t type);
static void chipset_attach(pcici_t tag, int unit);
static u_long chipset_count;
@@ -103,12 +102,10 @@ generic_pci_bridge (pcici_t tag)
case 5: strcpy(tmpbuf, "PCI to PCMCIA"); break;
case 7: strcpy(tmpbuf, "PCI to CardBus"); break;
default:
- snprintf(tmpbuf, sizeof(tmpbuf),
- "PCI to 0x%x", classreg>>16 & 0xff);
+ sprintf(tmpbuf, "PCI to 0x%x", classreg>>16 & 0xff);
break;
}
- snprintf(tmpbuf+strlen(tmpbuf), sizeof(tmpbuf)-strlen(tmpbuf),
- " bridge (vendor=%04x device=%04x)",
+ sprintf(tmpbuf+strlen(tmpbuf), " bridge (vendor=%04x device=%04x)",
id & 0xffff, (id >> 16) & 0xffff);
descr = malloc (strlen(tmpbuf) +1, M_DEVBUF, M_WAITOK);
strcpy(descr, tmpbuf);
@@ -121,7 +118,6 @@ generic_pci_bridge (pcici_t tag)
* XXX Both fixbushigh_orion() and fixbushigh_i1225() are bogus in that way,
* that they store the highest bus number to scan in this device's config
* data, though it is about PCI buses attached to the CPU independently!
- * The same goes for fixbushigh_450nx.
*/
static void
@@ -141,68 +137,6 @@ fixbushigh_i1225(pcici_t tag)
tag->secondarybus = tag->subordinatebus = sublementarybus +1;
}
-
-/*
- * This reads the PCI config space for the 82451NX MIOC in the 450NX
- * chipset to determine the PCI bus configuration.
- *
- * Assuming the BIOS has set up the MIOC properly, this will correctly
- * report the number of PCI busses in the system.
- *
- * A small problem is that the Host to PCI bridge control is in the MIOC,
- * while the host-pci bridges are separate PCI devices. So it really
- * isn't easily possible to set up the subordinatebus mappings as the
- * 82454NX PCI expander bridges are probed, although that makes the
- * most sense.
- */
-static void
-fixbushigh_450nx(pcici_t tag)
-{
- int subordinatebus;
- unsigned long devmap;
-
- /*
- * Read the DEVMAP field, so we know which fields to check.
- * If the Host-PCI bridge isn't marked as present by the BIOS,
- * we have to assume it doesn't exist.
- * If this doesn't find all the PCI busses, complain to the
- * BIOS vendor. There is nothing more we can do.
- */
- devmap = pci_cfgread(tag, 0xd6, 2) & 0x3c;
- if (!devmap)
- panic("450NX MIOC: No host to PCI bridges marked present.\n");
- /*
- * Since the buses are configured in order, we just have to
- * find the highest bus, and use those numbers.
- */
- if (devmap & 0x20) { /* B1 */
- subordinatebus = pci_cfgread(tag, 0xd5, 1);
- } else if (devmap & 0x10) { /* A1 */
- subordinatebus = pci_cfgread(tag, 0xd4, 1);
- } else if (devmap & 0x8) { /* B0 */
- subordinatebus = pci_cfgread(tag, 0xd2, 1);
- } else /* if (devmap & 0x4) */ { /* A0 */
- subordinatebus = pci_cfgread(tag, 0xd1, 1);
- }
- if (subordinatebus == 255) {
- printf("fixbushigh_450nx: bogus highest PCI bus %d",
- subordinatebus);
-#ifdef NBUS
- subordinatebus = NBUS - 2;
-#else
- subordinatebus = 10;
-#endif
- printf(", reduced to %d\n", subordinatebus);
- }
-
- if (bootverbose)
- printf("fixbushigh_450nx: subordinatebus is %d\n",
- subordinatebus);
-
- tag->secondarybus = tag->subordinatebus = subordinatebus;
-}
-
-
static void
fixwsc_natoma(pcici_t tag)
{
@@ -225,7 +159,7 @@ fixwsc_natoma(pcici_t tag)
}
-static const char*
+static char*
chipset_probe (pcici_t tag, pcidi_t type)
{
unsigned rev;
@@ -246,6 +180,8 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("Intel 82424ZX (Saturn) cache DRAM controller");
case 0x04828086:
return ("Intel 82375EB PCI-EISA bridge");
+ case 0x04961039:
+ return ("SiS 85c496");
case 0x04a38086:
rev = (unsigned) pci_conf_read (tag, PCI_CLASS_REG) & 0xff;
if (rev == 16 || rev == 17)
@@ -264,14 +200,24 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("Intel 82437MX mobile PCI cache memory controller");
case 0x12508086:
return ("Intel 82439");
+ case 0x04061039:
+ return ("SiS 85c501");
+ case 0x00081039:
+ return ("SiS 85c503");
+ case 0x06011039:
+ return ("SiS 85c601");
case 0x70008086:
return ("Intel 82371SB PCI to ISA bridge");
+ case 0x70208086:
+ return ("Intel 82371SB USB host controller");
case 0x70308086:
return ("Intel 82437VX PCI cache memory controller");
case 0x71008086:
return ("Intel 82439TX System Controller (MTXC)");
case 0x71108086:
return ("Intel 82371AB PCI to ISA bridge");
+ case 0x71128086:
+ return ("Intel 82371AB USB host controller");
case 0x71138086:
return ("Intel 82371AB Power management controller");
case 0x71908086:
@@ -289,7 +235,6 @@ chipset_probe (pcici_t tag, pcidi_t type)
case 0x84c58086:
return ("Intel 82453KX/GX (Orion) PCI memory controller");
case 0x84ca8086:
- fixbushigh_450nx(tag);
return ("Intel 82451NX Memory and I/O Controller");
case 0x84cb8086:
return ("Intel 82454NX PCI Expander Bridge");
@@ -299,16 +244,6 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("DEC 21050 PCI-PCI bridge");
case 0x124b8086:
return ("Intel 82380FB mobile PCI to PCI bridge");
- /* SiS -- vendor 0x1039 */
- case 0x04961039:
- return ("SiS 85c496");
- case 0x04061039:
- return ("SiS 85c501");
- case 0x00081039:
- return ("SiS 85c503");
- case 0x06011039:
- return ("SiS 85c601");
-
/* VLSI -- vendor 0x1004 */
case 0x00051004:
return ("VLSI 82C592 Host to PCI bridge");
@@ -340,29 +275,10 @@ chipset_probe (pcici_t tag, pcidi_t type)
case 0x05971106:
return("VIA 82C597 (Apollo VP3) system controller");
/* XXX need info on the MVP3 -- any takers? */
+ case 0x30381106:
+ return("VIA 82C586B USB host controller");
case 0x30401106:
return("VIA 82C586B ACPI interface");
- /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
- /* totally. Please let me know if anything wrong. -F */
- case 0x05981106:
- return("VIA 82C598MVP (Apollo MVP3) host bridge");
- case 0x85981106:
- return("VIA 82C598MVP (Apollo MVP3) PCI-PCI bridge");
-
- /* AcerLabs -- vendor 0x10b9 */
- /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
- /* id is '10b9" but the register always shows "10b9". -Foxfair */
- case 0x154110b9:
- return("AcerLabs M1541 (Aladdin-V) PCI host bridge");
- case 0x153310b9:
- return("AcerLabs M1533 portable PCI-ISA bridge");
- case 0x154310b9:
- return("AcerLabs M1543 desktop PCI-ISA bridge");
- case 0x524710b9:
- return("AcerLabs M5247 PCI-PCI(AGP Supported) bridge");
- case 0x524310b9:/* 5243 seems like 5247, need more info to divide*/
- return("AcerLabs M5243 PCI-PCI bridge");
-
/* NEC -- vendor 0x1033 */
case 0x00011033:
@@ -931,7 +847,7 @@ chipset_attach (pcici_t config_id, int unit)
**---------------------------------------------------------
*/
-static const char* vga_probe (pcici_t tag, pcidi_t type);
+static char* vga_probe (pcici_t tag, pcidi_t type);
static void vga_attach (pcici_t tag, int unit);
static u_long vga_count;
@@ -945,7 +861,7 @@ static struct pci_device vga_device = {
DATA_SET (pcidevice_set, vga_device);
-static const char* vga_probe (pcici_t tag, pcidi_t typea)
+static char* vga_probe (pcici_t tag, pcidi_t typea)
{
int data = pci_conf_read(tag, PCI_CLASS_REG);
u_int id = pci_conf_read(tag, PCI_ID_REG);
@@ -958,7 +874,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
vendor = "NeoMagic";
switch (id >> 16) {
case 0x0004:
- chip = "NM2160 laptop"; break;
+ chip = "NM3160 laptop"; break;
}
break;
case 0x102b:
@@ -970,7 +886,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
case 0x0519:
chip = "MGA 2064W"; break;
case 0x051a:
- chip = "MGA 1024SG/1064SG/1164SG"; break;
+ chip = "MGA 1024SG"; break;
case 0x051b:
chip = "MGA 2164W"; break;
}
@@ -1171,10 +1087,8 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
if (vendor && chip) {
char *buf;
int len;
-#if 0
int i;
int reqmapmem;
-#endif
if (type == 0) {
type = "SVGA controller";
@@ -1204,8 +1118,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
len = strlen(vendor) + strlen(chip) + strlen(type) + 4;
MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
- if (buf)
- sprintf(buf, "%s %s %s", vendor, chip, type);
+ sprintf(buf, "%s %s %s", vendor, chip, type);
return buf;
}
@@ -1224,14 +1137,8 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
if ((data & PCI_SUBCLASS_MASK)
== PCI_SUBCLASS_DISPLAY_VGA)
type = "VGA-compatible display device";
- else {
- /*
- * If it isn't a vga display device,
- * don't pretend we found one.
- */
+ else
type = "Display device";
- return 0;
- }
}
break;
@@ -1253,8 +1160,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
len = strlen(vendor) + strlen(type) + 2 + 6 + 4 + 1;
MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
- if (buf)
- sprintf(buf, "%s model %04x %s", vendor, id >> 16, type);
+ sprintf(buf, "%s model %04x %s", vendor, id >> 16, type);
return buf;
}
return type;
@@ -1282,7 +1188,7 @@ static void vga_attach (pcici_t tag, int unit)
**---------------------------------------------------------
*/
-static const char* lkm_probe (pcici_t tag, pcidi_t type);
+static char* lkm_probe (pcici_t tag, pcidi_t type);
static void lkm_attach (pcici_t tag, int unit);
static u_long lkm_count;
@@ -1296,7 +1202,7 @@ static struct pci_device lkm_device = {
DATA_SET (pcidevice_set, lkm_device);
-static const char*
+static char*
lkm_probe (pcici_t tag, pcidi_t type)
{
/*
@@ -1317,7 +1223,7 @@ lkm_attach (pcici_t tag, int unit)
**---------------------------------------------------------
*/
-static const char* ign_probe (pcici_t tag, pcidi_t type);
+static char* ign_probe (pcici_t tag, pcidi_t type);
static void ign_attach (pcici_t tag, int unit);
static u_long ign_count;
@@ -1331,7 +1237,7 @@ static struct pci_device ign_device = {
DATA_SET (pcidevice_set, ign_device);
-static const char*
+static char*
ign_probe (pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/pcivar.h b/sys/pci/pcivar.h
index 7843e3a6d656..13e9991eefc3 100644
--- a/sys/pci/pcivar.h
+++ b/sys/pci/pcivar.h
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcivar.h,v 1.24 1999/01/13 04:59:19 bde Exp $
+ * $Id: pcivar.h,v 1.21 1998/09/15 08:21:09 gibbs Exp $
*
*/
@@ -66,7 +66,7 @@ typedef struct {
#define PCI_MAPPORT 0x04 /* port map */
u_int8_t ln2size;
u_int8_t ln2range;
- u_int8_t reg; /* offset of map register in config space */
+/* u_int8_t dummy;*/
} pcimap;
/* config header information common to all header types */
@@ -199,7 +199,7 @@ extern int pci_mechanism;
struct pci_device {
char* pd_name;
- const char* (*pd_probe ) (pcici_t tag, pcidi_t type);
+ char* (*pd_probe ) (pcici_t tag, pcidi_t type);
void (*pd_attach) (pcici_t tag, int unit);
u_long *pd_count;
int (*pd_shutdown) (int, int);
@@ -223,10 +223,7 @@ int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_dense (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_bwx (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
-int pci_map_int (pcici_t tag, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr);
-int pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr, u_int flags);
+int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
int pci_unmap_int (pcici_t tag);
int pci_register_lkm (struct pci_device *dvp, int if_revision);
diff --git a/sys/pci/simos.c b/sys/pci/simos.c
index 85642b814b3f..0be0397f52e2 100644
--- a/sys/pci/simos.c
+++ b/sys/pci/simos.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: simos.c,v 1.2 1998/09/26 14:49:26 dfr Exp $
+ * $Id: simos.c,v 1.1 1998/06/10 10:57:14 dfr Exp $
*/
#include <sys/param.h>
@@ -70,7 +70,7 @@ struct simos_softc* simosp[10];
static u_long simos_unit;
-static const char *simos_probe __P((pcici_t tag, pcidi_t type));
+static char *simos_probe __P((pcici_t tag, pcidi_t type));
static void simos_attach __P((pcici_t config_d, int unit));
static void simos_action __P((struct cam_sim *sim, union ccb *ccb));
static void simos_poll __P((struct cam_sim *sim));
@@ -84,7 +84,7 @@ struct pci_device simos_driver = {
};
DATA_SET (pcidevice_set, simos_driver);
-static const char *
+static char *
simos_probe(pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/smc83c170.h b/sys/pci/smc83c170.h
new file mode 100644
index 000000000000..737eac398c6e
--- /dev/null
+++ b/sys/pci/smc83c170.h
@@ -0,0 +1,389 @@
+/*-
+ * Copyright (c) 1997 Semen Ustimenko
+ * 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.
+ *
+ * $Id: smc83c170.h,v 1.14 1998/07/03 23:59:09 galv Exp $
+ *
+ */
+
+/*
+ * Configuration
+ */
+#define TX_RING_SIZE 8
+#define RX_RING_SIZE 8
+#define EPIC_FULL_DUPLEX 1
+#define EPIC_HALF_DUPLEX 0
+#define ETHER_MAX_FRAME_LEN (ETHER_MAX_LEN + ETHER_CRC_LEN)
+#define EPIC_LINK_DOWN 0x00000001
+
+/* PCI identification */
+#define SMC_VENDORID 0x10B8
+#define CHIPID_83C170 0x0005
+#define PCI_VENDORID(x) ((x) & 0xFFFF)
+#define PCI_CHIPID(x) (((x) >> 16) & 0xFFFF)
+
+/* PCI configuration */
+#define PCI_CFID 0x00 /* Configuration ID */
+#define PCI_CFCS 0x04 /* Configurtion Command/Status */
+#define PCI_CFRV 0x08 /* Configuration Revision */
+#define PCI_CFLT 0x0c /* Configuration Latency Timer */
+#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBMA 0x14 /* Configuration Base Memory Address */
+#define PCI_CFIT 0x3c /* Configuration Interrupt */
+#define PCI_CFDA 0x40 /* Configuration Driver Area */
+
+#define PCI_CONF_WRITE(r, v) pci_conf_write(config_id, (r), (v))
+#define PCI_CONF_READ(r) pci_conf_read(config_id, (r))
+
+/* EPIC's registers */
+#define COMMAND 0x0000
+#define INTSTAT 0x0004 /* Interrupt status. See below */
+#define INTMASK 0x0008 /* Interrupt mask. See below */
+#define GENCTL 0x000C
+#define NVCTL 0x0010
+#define EECTL 0x0014 /* EEPROM control **/
+#define TEST1 0x001C /* XXXXX */
+#define CRCCNT 0x0020 /* CRC error counter */
+#define ALICNT 0x0024 /* FrameTooLang error counter */
+#define MPCNT 0x0028 /* MissedFrames error counters */
+#define MIICTL 0x0030
+#define MIIDATA 0x0034
+#define MIICFG 0x0038
+#define IPG 0x003C
+#define LAN0 0x0040 /* MAC address */
+#define LAN1 0x0044 /* MAC address */
+#define LAN2 0x0048 /* MAC address */
+#define ID_CHK 0x004C
+#define MC0 0x0050 /* Multicast filter table */
+#define MC1 0x0054 /* Multicast filter table */
+#define MC2 0x0058 /* Multicast filter table */
+#define MC3 0x005C /* Multicast filter table */
+#define RXCON 0x0060 /* Rx control register */
+#define TXCON 0x0070 /* Tx control register */
+#define TXSTAT 0x0074
+#define PRCDAR 0x0084 /* RxRing bus address */
+#define PRSTAT 0x00A4
+#define PRCPTHR 0x00B0
+#define PTCDAR 0x00C4 /* TxRing bus address */
+#define ETXTHR 0x00DC
+
+#define COMMAND_STOP_RX 0x01
+#define COMMAND_START_RX 0x02
+#define COMMAND_TXQUEUED 0x04
+#define COMMAND_RXQUEUED 0x08
+#define COMMAND_NEXTFRAME 0x10
+#define COMMAND_STOP_TDMA 0x20
+#define COMMAND_STOP_RDMA 0x40
+#define COMMAND_TXUGO 0x80
+
+/* Tx threshold */
+#define TX_FIFO_THRESH 0x80 /* 0x40 or 0x10 */
+
+/* Interrupt register bits */
+#define INTSTAT_RCC 0x00000001
+#define INTSTAT_HCC 0x00000002
+#define INTSTAT_RQE 0x00000004
+#define INTSTAT_OVW 0x00000008
+#define INTSTAT_RXE 0x00000010
+#define INTSTAT_TXC 0x00000020
+#define INTSTAT_TCC 0x00000040
+#define INTSTAT_TQE 0x00000080
+#define INTSTAT_TXU 0x00000100
+#define INTSTAT_CNT 0x00000200
+#define INTSTAT_PREI 0x00000400
+#define INTSTAT_RCT 0x00000800
+#define INTSTAT_FATAL 0x00001000 /* One of DPE,APE,PMA,PTA happend */
+#define INTSTAT_UNUSED1 0x00002000
+#define INTSTAT_UNUSED2 0x00004000
+#define INTSTAT_GP2 0x00008000 /* PHY Event */
+#define INTSTAT_INT_ACTV 0x00010000
+#define INTSTAT_RXIDLE 0x00020000
+#define INTSTAT_TXIDLE 0x00040000
+#define INTSTAT_RCIP 0x00080000
+#define INTSTAT_TCIP 0x00100000
+#define INTSTAT_RBE 0x00200000
+#define INTSTAT_RCTS 0x00400000
+#define INTSTAT_RSV 0x00800000
+#define INTSTAT_DPE 0x01000000 /* PCI Fatal error */
+#define INTSTAT_APE 0x02000000 /* PCI Fatal error */
+#define INTSTAT_PMA 0x04000000 /* PCI Fatal error */
+#define INTSTAT_PTA 0x08000000 /* PCI Fatal error */
+
+#define GENCTL_SOFT_RESET 0x00000001
+#define GENCTL_ENABLE_INTERRUPT 0x00000002
+#define GENCTL_SOFTWARE_INTERRUPT 0x00000004
+#define GENCTL_POWER_DOWN 0x00000008
+#define GENCTL_ONECOPY 0x00000010
+#define GENCTL_BIG_ENDIAN 0x00000020
+#define GENCTL_RECEIVE_DMA_PRIORITY 0x00000040
+#define GENCTL_TRANSMIT_DMA_PRIORITY 0x00000080
+#define GENCTL_RECEIVE_FIFO_THRESHOLD128 0x00000300
+#define GENCTL_RECEIVE_FIFO_THRESHOLD96 0x00000200
+#define GENCTL_RECEIVE_FIFO_THRESHOLD64 0x00000100
+#define GENCTL_RECEIVE_FIFO_THRESHOLD32 0x00000000
+#define GENCTL_MEMORY_READ_LINE 0x00000400
+#define GENCTL_MEMORY_READ_MULTIPLE 0x00000800
+#define GENCTL_SOFTWARE1 0x00001000
+#define GENCTL_SOFTWARE2 0x00002000
+#define GENCTL_RESET_PHY 0x00004000
+
+#define NVCTL_ENABLE_MEMORY_MAP 0x00000001
+#define NVCTL_CLOCK_RUN_SUPPORTED 0x00000002
+#define NVCTL_GP1_OUTPUT_ENABLE 0x00000004
+#define NVCTL_GP2_OUTPUT_ENABLE 0x00000008
+#define NVCTL_GP1 0x00000010
+#define NVCTL_GP2 0x00000020
+#define NVCTL_CARDBUS_MODE 0x00000040
+#define NVCTL_IPG_DELAY_MASK(x) ((x&0xF)<<7)
+
+#define RXCON_SAVE_ERRORED_PACKETS 0x00000001
+#define RXCON_RECEIVE_RUNT_FRAMES 0x00000002
+#define RXCON_RECEIVE_BROADCAST_FRAMES 0x00000004
+#define RXCON_RECEIVE_MULTICAST_FRAMES 0x00000008
+#define RXCON_RECEIVE_INVERSE_INDIVIDUAL_ADDRESS_FRAMES 0x00000010
+#define RXCON_PROMISCUOUS_MODE 0x00000020
+#define RXCON_MONITOR_MODE 0x00000040
+#define RXCON_EARLY_RECEIVE_ENABLE 0x00000080
+#define RXCON_EXTERNAL_BUFFER_DISABLE 0x00000000
+#define RXCON_EXTERNAL_BUFFER_16K 0x00000100
+#define RXCON_EXTERNAL_BUFFER_32K 0x00000200
+#define RXCON_EXTERNAL_BUFFER_128K 0x00000300
+
+#define TXCON_EARLY_TRANSMIT_ENABLE 0x00000001
+#define TXCON_LOOPBACK_DISABLE 0x00000000
+#define TXCON_LOOPBACK_MODE_INT 0x00000002
+#define TXCON_LOOPBACK_MODE_PHY 0x00000004
+#define TXCON_LOOPBACK_MODE 0x00000006
+#define TXCON_FULL_DUPLEX 0x00000006
+#define TXCON_SLOT_TIME 0x00000078
+
+#if defined(EARLY_TX)
+ #define TXCON_DEFAULT (TXCON_SLOT_TIME | TXCON_EARLY_TRANSMIT_ENABLE)
+ #define TRANSMIT_THRESHOLD 0x40
+#else
+ #define TXCON_DEFAULT (TXCON_SLOT_TIME)
+#endif
+#if defined(EARLY_RX)
+ #define RXCON_DEFAULT (RXCON_EARLY_RECEIVE_ENABLE | RXCON_SAVE_ERRORED_PACKETS)
+#else
+ #define RXCON_DEFAULT (0)
+#endif
+/*
+ * National Semiconductor's DP83840A Registers and bits
+ */
+#define DP83840_OUI 0x080017
+#define DP83840_BMCR 0x00 /* Control register */
+#define DP83840_BMSR 0x01 /* Status rgister */
+#define DP83840_ANAR 0x04 /* Autonegotiation advertising register */
+#define DP83840_LPAR 0x05 /* Link Partner Ability register */
+#define DP83840_ANER 0x06 /* Auto-Negotiation Expansion Register */
+#define DP83840_PAR 0x19 /* PHY Address Register */
+#define DP83840_PHYIDR1 0x02
+#define DP83840_PHYIDR2 0x03
+
+#define BMCR_RESET 0x8000
+#define BMCR_100MBPS 0x2000 /* 10/100 Mbps */
+#define BMCR_AUTONEGOTIATION 0x1000 /* ON/OFF */
+#define BMCR_RESTART_AUTONEG 0x0200
+#define BMCR_FULL_DUPLEX 0x0100
+
+#define BMSR_100BASE_T4 0x8000
+#define BMSR_100BASE_TX_FD 0x4000
+#define BMSR_100BASE_TX 0x2000
+#define BMSR_10BASE_T_FD 0x1000
+#define BMSR_10BASE_T 0x0800
+#define BMSR_AUTONEG_COMPLETE 0x0020
+#define BMSR_AUTONEG_ABLE 0x0008
+#define BMSR_LINK_STATUS 0x0004
+
+#define PAR_FULL_DUPLEX 0x0400
+
+#define ANER_MULTIPLE_LINK_FAULT 0x10
+
+/* ANAR and LPAR have the same bits, define them only once */
+#define ANAR_10 0x0020
+#define ANAR_10_FD 0x0040
+#define ANAR_100_TX 0x0080
+#define ANAR_100_TX_FD 0x0100
+#define ANAR_100_T4 0x0200
+
+/*
+ * Quality Semiconductor's QS6612 registers and bits
+ */
+#define QS6612_OUI 0x006051
+#define QS6612_MCTL 17
+#define QS6612_INTSTAT 29
+#define QS6612_INTMASK 30
+
+#define MCTL_T4_PRESENT 0x1000 /* External T4 Enabled, ignored */
+ /* if AutoNeg is enabled */
+#define MCTL_BTEXT 0x0800 /* Reduces 10baset squelch level */
+ /* for extended cable length */
+
+#define INTSTAT_AN_COMPLETE 0x40 /* Autonegotiation complete */
+#define INTSTAT_RF_DETECTED 0x20 /* Remote Fault detected */
+#define INTSTAT_LINK_STATUS 0x10 /* Link status changed */
+#define INTSTAT_AN_LP_ACK 0x08 /* Autoneg. LP Acknoledge */
+#define INTSTAT_PD_FAULT 0x04 /* Parallel Detection Fault */
+#define INTSTAT_AN_PAGE 0x04 /* Autoneg. Page Received */
+#define INTSTAT_RE_CNT_FULL 0x01 /* Receive Error Counter Full */
+
+#define INTMASK_THUNDERLAN 0x8000 /* Enable interrupts */
+
+/*
+ * Structures definition and Functions prototypes
+ */
+
+/* EPIC's hardware descriptors, must be aligned on dword in memory */
+/* NB: to make driver happy, this two structures MUST have thier sizes */
+/* be divisor of PAGE_SIZE */
+struct epic_tx_desc {
+ volatile u_int16_t status;
+ volatile u_int16_t txlength;
+ volatile u_int32_t bufaddr;
+ volatile u_int16_t buflength;
+ volatile u_int16_t control;
+ volatile u_int32_t next;
+};
+struct epic_rx_desc {
+ volatile u_int16_t status;
+ volatile u_int16_t rxlength;
+ volatile u_int32_t bufaddr;
+ volatile u_int32_t buflength;
+ volatile u_int32_t next;
+};
+
+/* This structure defines EPIC's fragment list, maximum number of frags */
+/* is 63. Let use maximum, becouse size of struct MUST be divisor of */
+/* PAGE_SIZE, and sometimes come mbufs with more then 30 frags */
+struct epic_frag_list {
+ volatile u_int32_t numfrags;
+ struct {
+ volatile u_int32_t fragaddr;
+ volatile u_int32_t fraglen;
+ } frag[63];
+ volatile u_int32_t pad; /* align on 256 bytes */
+};
+
+/* This is driver's structure to define EPIC descriptors */
+struct epic_rx_buffer {
+ struct mbuf * mbuf; /* mbuf receiving packet */
+};
+
+struct epic_tx_buffer {
+ struct mbuf * mbuf; /* mbuf contained packet */
+};
+
+/*
+ * NB: ALIGN OF ABOVE STRUCTURES
+ * epic_rx_desc, epic_tx_desc, epic_frag_list - must be aligned on dword
+ */
+
+/* Driver status structure */
+typedef struct {
+ u_int32_t unit;
+ struct epic_rx_buffer rx_buffer[RX_RING_SIZE];
+ struct epic_tx_buffer tx_buffer[TX_RING_SIZE];
+
+ /* Each element of array MUST be aligned on dword */
+ /* and bounded on PAGE_SIZE */
+ struct epic_rx_desc *rx_desc;
+ struct epic_tx_desc *tx_desc;
+ struct epic_frag_list *tx_flist;
+#if defined(_NET_IF_MEDIA_H_)
+ struct ifmedia ifmedia;
+#endif
+ struct arpcom epic_ac;
+ u_int32_t flags;
+ u_int32_t phyid;
+ u_int32_t cur_tx;
+ u_int32_t cur_rx;
+ u_int32_t dirty_tx;
+ u_int32_t pending_txs;
+#if defined(EPIC_USEIOSPACE)
+ u_int32_t iobase;
+#else
+ caddr_t csr;
+#endif
+} epic_softc_t;
+
+#define epic_if epic_ac.ac_if
+#define epic_macaddr epic_ac.ac_enaddr
+#if defined(EPIC_USEIOSPACE)
+ #define CSR_WRITE_4(sc,reg,val) outl( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_WRITE_2(sc,reg,val) outw( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_WRITE_1(sc,reg,val) outb( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_READ_4(sc,reg) inl( (sc)->iobase + (u_int32_t)(reg) )
+ #define CSR_READ_2(sc,reg) inw( (sc)->iobase + (u_int32_t)(reg) )
+ #define CSR_READ_1(sc,reg) inb( (sc)->iobase + (u_int32_t)(reg) )
+#else
+ #define CSR_WRITE_1(sc,reg,val) ((*(u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
+ #define CSR_WRITE_2(sc,reg,val) ((*(u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
+ #define CSR_WRITE_4(sc,reg,val) ((*(u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
+ #define CSR_READ_1(sc,reg) (*(u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
+ #define CSR_READ_2(sc,reg) (*(u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
+ #define CSR_READ_4(sc,reg) (*(u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
+#endif
+#define PHY_READ_2(sc,reg) epic_read_phy_register(sc,reg)
+#define PHY_WRITE_2(sc,reg,val) epic_write_phy_register(sc,reg,val)
+
+static char* epic_pci_probe __P((pcici_t, pcidi_t));
+
+/* Folowing functions calls splimp() */
+static int epic_ifioctl __P((register struct ifnet *, u_long, caddr_t));
+static void epic_ifstart __P((struct ifnet *));
+static void epic_ifwatchdog __P((struct ifnet *));
+static void epic_pci_attach __P((pcici_t, int));
+static int epic_init __P((epic_softc_t *));
+static void epic_stop __P((epic_softc_t *));
+
+static int epic_ifmedia_change __P((struct ifnet *));
+static void epic_ifmedia_status __P((struct ifnet *, struct ifmediareq *));
+
+/* Following functions doesn't call splimp() */
+static void epic_intr_normal __P((void *));
+static __inline void epic_rx_done __P((epic_softc_t *));
+static __inline void epic_tx_done __P((epic_softc_t *));
+static void epic_shutdown __P((int, void *));
+
+static int epic_init_rings __P((epic_softc_t *));
+static void epic_free_rings __P((epic_softc_t *));
+static void epic_stop_activity __P((epic_softc_t *));
+static void epic_start_activity __P((epic_softc_t *));
+static void epic_set_rx_mode __P((epic_softc_t *));
+static void epic_set_mc_table __P((epic_softc_t *));
+static void epic_set_media_speed __P((epic_softc_t *));
+static void epic_init_phy __P((epic_softc_t *));
+static void epic_dump_state __P((epic_softc_t *));
+static int epic_autoneg __P((epic_softc_t *));
+
+static int epic_read_eeprom __P((epic_softc_t *,u_int16_t));
+static void epic_output_eepromw __P((epic_softc_t *, u_int16_t));
+static u_int16_t epic_input_eepromw __P((epic_softc_t *));
+static u_int8_t epic_eeprom_clock __P((epic_softc_t *,u_int8_t));
+static void epic_write_eepromreg __P((epic_softc_t *,u_int8_t));
+static u_int8_t epic_read_eepromreg __P((epic_softc_t *));
+
+static u_int16_t epic_read_phy_register __P((epic_softc_t *, u_int16_t));
+static void epic_write_phy_register __P((epic_softc_t *, u_int16_t, u_int16_t));
diff --git a/sys/pci/tek390.c b/sys/pci/tek390.c
new file mode 100644
index 000000000000..9be42e23bba1
--- /dev/null
+++ b/sys/pci/tek390.c
@@ -0,0 +1,1709 @@
+/***********************************************************************
+ * FILE NAME : TEK390.C *
+ * BY : C.L. Huang (ching@tekram.com.tw) *
+ * Description: Device Driver for Tekram DC-390(T) PCI SCSI *
+ * Bus Master Host Adapter *
+ * (C)Copyright 1995-1996 Tekram Technology Co., Ltd. *
+ ***********************************************************************/
+/***********************************************************************
+ * HISTORY: *
+ * *
+ * REV# DATE NAME DESCRIPTION *
+ * 1.00 07/02/96 CLH First release for RELEASE-2.1.0 *
+ * 1.01 08/20/96 CLH Update for RELEASE-2.1.5 *
+ * *
+ ***********************************************************************/
+
+/**************************************************************************
+ *
+ *
+ * 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.
+ *
+ * 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.
+ *
+ **************************************************************************/
+
+/**************************************************************************/
+/* Imported into FreeBSD source repository, and updated to compile under */
+/* FreeBSD-3.0-DEVELOPMENT, by Stefan Esser <se@FreeBSD.Org>, 1996-12-17 */
+/**************************************************************************/
+
+/* #define REL_2_1_0 */
+#define REL_2_1_5
+
+#define DC390_DEBUG
+
+#include <sys/param.h>
+
+/* XXX this doesn't actually compile unless KERNEL is defined. */
+#ifdef KERNEL
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/kernel.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#endif /* KERNEL */
+
+#include <pci/pcivar.h>
+#include <pci/pcireg.h>
+
+#include <scsi/scsiconf.h>
+
+#include <machine/clock.h>
+
+#include <pci/tek390.h>
+
+#define INT32 int32
+#define U_INT32 u_int32
+
+
+#define OutB(val, port) outb(port, val)
+#define OutW(val, port) outw(port, val)
+#define OutL(val, port) outl(port, val)
+
+#define PCI_DEVICE_ID_AMD53C974 0x20201022ul
+#define PCI_BASE_ADDR0 0x10
+
+
+#ifdef REL_2_1_0
+static int DC390_Interrupt (PACB pACB);
+#endif
+#ifdef REL_2_1_5
+static void DC390_Interrupt (PACB pACB);
+#endif
+static USHORT DC390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void DC390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+
+static void SetXferRate( PACB pACB, PDCB pDCB );
+static void DC390_Disconnect( PACB pACB );
+static void DC390_Reselect( PACB pACB );
+static void SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void DoingSRB_Done( PACB pACB );
+static void DC390_ScsiRstDetect( PACB pACB );
+static void DC390_ResetSCSIBus( PACB pACB );
+static void RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void EnableMsgOut2( PACB pACB, PSRB pSRB );
+static void EnableMsgOut( PACB pACB, PSRB pSRB );
+static void DC390_InvalidCmd( PACB pACB );
+
+/*
+ * XXX No timeouts are scheduled in this driver as the timeout handler
+ * doesn't do anything yet!!!
+ */
+static void DC390_reset (PACB pACB);
+static PUCHAR phystovirt( PSRB pSRB, ULONG xferCnt );
+
+static void DC390_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd );
+static void DC390_initSRB( PSRB psrb );
+static void DC390_linkSRB( PACB pACB );
+static void DC390_initACB( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index );
+static int DC390_initAdapter( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index, pcici_t config_id );
+void DC390_EnableCfg( USHORT mechnum, UCHAR regval );
+void DC390_DisableCfg( USHORT mechnum );
+UCHAR DC390_inByte( USHORT mechnum, UCHAR regval );
+USHORT DC390_inWord( USHORT mechnum, UCHAR regval );
+ULONG DC390_inDword(USHORT mechnum, UCHAR regval );
+void DC390_OutB(USHORT mechnum, UCHAR regval, UCHAR bval );
+static void DC390_EnDisableCE( UCHAR mode, USHORT mechnum, PUCHAR regval );
+static void DC390_EEpromOutDI( USHORT mechnum, PUCHAR regval, USHORT Carry );
+static UCHAR DC390_EEpromInDO( USHORT mechnum );
+static USHORT EEpromGetData1( USHORT mechnum );
+static void DC390_Prepare( USHORT mechnum, PUCHAR regval, UCHAR EEpromCmd );
+static void DC390_ReadEEprom( USHORT mechnum, USHORT index );
+static USHORT DC390_DefaultEEprom( USHORT mechnum, USHORT index );
+static USHORT DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index );
+static USHORT DC390_ToMech( USHORT Mechnum, pcici_t config_id );
+
+
+#ifdef KERNEL
+
+static char* trmamd_probe( pcici_t tag, pcidi_t type);
+static void trmamd_attach( pcici_t tag, int unit);
+
+#ifdef REL_2_1_0
+static int32 trmamd_scsi_cmd( struct scsi_xfer *sx);
+#endif
+
+#ifdef REL_2_1_5
+static int32_t trmamd_scsi_cmd( struct scsi_xfer *sx);
+#endif
+
+static void trmamd_min_phys( struct buf *pbuf);
+
+#ifdef REL_2_1_0
+static u_int32 trmamd_info( int unit );
+#endif
+
+#endif /* KERNEL */
+
+
+static u_long trmamd_count;
+
+static struct pci_device trmamd_device = {
+ "amd",
+ trmamd_probe,
+ trmamd_attach,
+ &trmamd_count,
+ NULL
+};
+
+DATA_SET (pcidevice_set, trmamd_device);
+
+
+
+static struct scsi_adapter trmamd_switch =
+{
+ trmamd_scsi_cmd,
+ trmamd_min_phys,
+ 0,
+ 0,
+#ifdef REL_2_1_0
+ trmamd_info,
+#endif
+#ifdef REL_2_1_5
+ 0,
+#endif
+ "amd",
+};
+
+static struct scsi_device trmamd_dev =
+{
+ NULL, /* Use default error handler */
+ NULL, /* have a queue, served by this */
+ NULL, /* have no async handler */
+ NULL, /* Use default 'done' routine */
+ "amd",
+};
+
+
+static PACB pACB0[MAX_ADAPTER_NUM]={0};
+static PACB pACB_start= NULL;
+static PACB pACB_current = NULL;
+static PDCB pPrevDCB = NULL;
+static USHORT adapterCnt = 0;
+static USHORT CurrSyncOffset = 0;
+static UCHAR CurrentID, CurrentLUN;
+
+static PVOID DC390_phase0[]={
+ DC390_DataOut_0,
+ DC390_DataIn_0,
+ DC390_Command_0,
+ DC390_Status_0,
+ DC390_Nop_0,
+ DC390_Nop_0,
+ DC390_MsgOut_0,
+ DC390_MsgIn_0,
+ DC390_Nop_1
+ };
+
+static PVOID DC390_phase1[]={
+ DC390_DataOutPhase,
+ DC390_DataInPhase,
+ DC390_CommandPhase,
+ DC390_StatusPhase,
+ DC390_Nop_0,
+ DC390_Nop_0,
+ DC390_MsgOutPhase,
+ DC390_MsgInPhase,
+ DC390_Nop_1,
+ };
+
+static UCHAR eepromBuf[MAX_ADAPTER_NUM][128];
+
+
+static UCHAR clock_period1[] = {4, 5, 6, 7 ,8, 10, 13, 20};
+
+static UCHAR baddevname1[2][28] ={
+ "SEAGATE ST3390N ??? 9546",
+ "HP C3323-300 4269"};
+
+#define BADDEVCNT 2
+
+
+/***********************************************************************
+ *
+ *
+ *
+ **********************************************************************/
+static PSRB
+GetSRB( PACB pACB )
+{
+ int flags;
+ PSRB pSRB;
+
+ flags = splbio();
+
+ pSRB = pACB->pFreeSRB;
+ if( pSRB )
+ {
+ pACB->pFreeSRB = pSRB->pNextSRB;
+ pSRB->pNextSRB = NULL;
+ }
+ splx(flags);
+ return( pSRB );
+}
+
+
+static void
+RewaitSRB0( PDCB pDCB, PSRB pSRB )
+{
+ PSRB psrb1;
+ int flags;
+
+ flags = splbio();
+
+ if( (psrb1 = pDCB->pWaitingSRB) )
+ {
+ pSRB->pNextSRB = psrb1;
+ pDCB->pWaitingSRB = pSRB;
+ }
+ else
+ {
+ pSRB->pNextSRB = NULL;
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+ splx(flags);
+}
+
+
+static void
+RewaitSRB( PDCB pDCB, PSRB pSRB )
+{
+ PSRB psrb1;
+ int flags;
+ UCHAR bval;
+
+ flags = splbio();
+
+ pDCB->GoingSRBCnt--;
+ psrb1 = pDCB->pGoingSRB;
+ if( pSRB == psrb1 )
+ {
+ pDCB->pGoingSRB = psrb1->pNextSRB;
+ }
+ else
+ {
+ while( pSRB != psrb1->pNextSRB )
+ psrb1 = psrb1->pNextSRB;
+ psrb1->pNextSRB = pSRB->pNextSRB;
+ if( pSRB == pDCB->pGoingLast )
+ pDCB->pGoingLast = psrb1;
+ }
+ if( (psrb1 = pDCB->pWaitingSRB) )
+ {
+ pSRB->pNextSRB = psrb1;
+ pDCB->pWaitingSRB = pSRB;
+ }
+ else
+ {
+ pSRB->pNextSRB = NULL;
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+
+ bval = pSRB->TagNumber;
+ pDCB->TagMask &= (~(1 << bval)); /* Free TAG number */
+ splx(flags);
+}
+
+
+static void
+DoWaitingSRB( PACB pACB )
+{
+ int flags;
+ PDCB ptr, ptr1;
+ PSRB pSRB;
+
+ flags = splbio();
+
+ if( !(pACB->pActiveDCB) && !(pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) ) )
+ {
+ ptr = pACB->pDCBRunRobin;
+ if( !ptr )
+ {
+ ptr = pACB->pLinkDCB;
+ pACB->pDCBRunRobin = ptr;
+ }
+ ptr1 = ptr;
+ for( ;ptr1; )
+ {
+ pACB->pDCBRunRobin = ptr1->pNextDCB;
+ if( !( ptr1->MaxCommand > ptr1->GoingSRBCnt ) ||
+ !( pSRB = ptr1->pWaitingSRB ) )
+ {
+ if(pACB->pDCBRunRobin == ptr)
+ break;
+ ptr1 = ptr1->pNextDCB;
+ }
+ else
+ {
+ if( !DC390_StartSCSI(pACB, ptr1, pSRB) )
+ {
+ ptr1->GoingSRBCnt++;
+ if( ptr1->pWaitLast == pSRB )
+ {
+ ptr1->pWaitingSRB = NULL;
+ ptr1->pWaitLast = NULL;
+ }
+ else
+ {
+ ptr1->pWaitingSRB = pSRB->pNextSRB;
+ }
+ pSRB->pNextSRB = NULL;
+
+ if( ptr1->pGoingSRB )
+ ptr1->pGoingLast->pNextSRB = pSRB;
+ else
+ ptr1->pGoingSRB = pSRB;
+ ptr1->pGoingLast = pSRB;
+ }
+ break;
+ }
+ }
+ }
+ splx(flags);
+ return;
+}
+
+
+static void
+SRBwaiting( PDCB pDCB, PSRB pSRB)
+{
+ if( pDCB->pWaitingSRB )
+ {
+ pDCB->pWaitLast->pNextSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ pSRB->pNextSRB = NULL;
+ }
+ else
+ {
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+}
+
+
+static void
+SendSRB( PSCSICMD pcmd, PACB pACB, PSRB pSRB )
+{
+ int flags;
+ PDCB pDCB;
+
+ flags = splbio();
+
+ pDCB = pSRB->pSRBDCB;
+ if( !(pDCB->MaxCommand > pDCB->GoingSRBCnt) || (pACB->pActiveDCB) ||
+ (pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV)) )
+ {
+ SRBwaiting(pDCB, pSRB);
+ goto SND_EXIT;
+ }
+
+ if( pDCB->pWaitingSRB )
+ {
+ SRBwaiting(pDCB, pSRB);
+/* pSRB = GetWaitingSRB(pDCB); */
+ pSRB = pDCB->pWaitingSRB;
+ pDCB->pWaitingSRB = pSRB->pNextSRB;
+ pSRB->pNextSRB = NULL;
+ }
+
+ if( !DC390_StartSCSI(pACB, pDCB, pSRB) )
+ {
+ pDCB->GoingSRBCnt++;
+ if( pDCB->pGoingSRB )
+ {
+ pDCB->pGoingLast->pNextSRB = pSRB;
+ pDCB->pGoingLast = pSRB;
+ }
+ else
+ {
+ pDCB->pGoingSRB = pSRB;
+ pDCB->pGoingLast = pSRB;
+ }
+ }
+ else
+ RewaitSRB0( pDCB, pSRB );
+
+SND_EXIT:
+ splx(flags);
+ return;
+}
+
+
+/***********************************************************************
+ * Function : static int32 dc390_scsi_cmd (struct scsi_xfer *cmd)
+ * Purpose : enqueues a SCSI command
+ ***********************************************************************/
+
+#ifdef REL_2_1_0
+int32
+#endif
+#ifdef REL_2_1_5
+int32_t
+#endif
+trmamd_scsi_cmd ( PSCSICMD cmd )
+{
+ USHORT ioport, i;
+ PSCSICMD pcmd;
+ PSCLINK plink;
+ PACB pACB;
+ PDCB pDCB;
+ PSRB pSRB;
+ int flags, cflags, unit, CurrPgVaddr;
+ ULONG sglen, pglen, datalen, CurrPgPaddr, NextPgPaddr;
+ PUCHAR ptr,ptr1;
+ PSEG psg;
+ UCHAR sgc, sstatus;
+
+ plink = cmd->sc_link;
+ unit = plink->adapter_unit;
+ pACB = pACB0[unit];
+ ioport = pACB->IOPortBase;
+
+#ifdef DC390_DEBUG0
+ printf("Cmd=%2x,ID=%d,LUN=%d,",cmd->cmd->opcode,
+ plink->target, plink->lun);
+#endif
+
+ if( pACB->scan_devices )
+ {
+ if( (plink->target > CurrentID) ||
+ (plink->target == CurrentID) && (plink->lun >= CurrentLUN) )
+ {
+ CurrentID = plink->target;
+ CurrentLUN = plink->lun;
+ }
+ else
+ {
+ pACB->scan_devices = 0;
+ pPrevDCB->pNextDCB = pACB->pLinkDCB;
+ }
+ }
+
+ if ( ( plink->target > pACB->max_id ) || ( plink->lun > pACB->max_lun ) )
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+
+ if( (pACB->scan_devices) && !(pACB->DCBmap[plink->target] & (1 << plink->lun)) )
+ {
+ if( pACB->DeviceCnt < MAX_DEVICES )
+ {
+ pACB->DCBmap[plink->target] |= (1 << plink->lun);
+ pDCB = pACB->pDCB_free;
+#ifdef DC390_DEBUG0
+ printf("pDCB=%8x,ID=%2x,", (UINT) pDCB, plink->target);
+#endif
+ DC390_initDCB( pACB, pDCB, cmd );
+ }
+ else /* ???? */
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+ }
+ else if( !(pACB->scan_devices) && !(pACB->DCBmap[plink->target] & (1 << plink->lun)) )
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+ else
+ {
+ pDCB = pACB->pLinkDCB;
+ while( (pDCB->UnitSCSIID != plink->target) ||
+ (pDCB->UnitSCSILUN != plink->lun) )
+ {
+ pDCB = pDCB->pNextDCB;
+ }
+#ifdef DC390_DEBUG0
+ printf("pDCB=%8x,ID=%2x,", (UINT) pDCB, plink->target);
+#endif
+ }
+
+ cflags = cmd->flags;
+ if(cflags & SCSI_RESET)
+ {
+ DC390_reset (pACB);
+ cmd->error = XS_NOERROR;
+ return(COMPLETE);
+ }
+
+ if( cflags & ITSDONE )
+ {
+ printf("DC390: Is it done?\n");
+ cmd->flags &= ~ITSDONE;
+ }
+ if( !(cflags & INUSE) )
+ {
+ printf("DC390: In Use?\n");
+ cmd->flags |= INUSE;
+ }
+
+ cmd->error = 0;
+ cmd->resid = 0;
+
+ flags = splbio();
+
+ pcmd = cmd;
+
+ pSRB = GetSRB( pACB );
+
+ if( !pSRB )
+ {
+ pcmd->error = XS_DRIVER_STUFFUP;
+ splx(flags);
+ return( TRY_AGAIN_LATER);
+ }
+
+/* BuildSRB(pSRB); */
+
+ pSRB->pSRBDCB = pDCB;
+ pSRB->pcmd = pcmd;
+ ptr = (PUCHAR) pSRB->CmdBlock;
+ ptr1 = (PUCHAR) pcmd->cmd;
+ pSRB->ScsiCmdLen = pcmd->cmdlen;
+ for(i=0; i< pcmd->cmdlen; i++)
+ {
+ *ptr = *ptr1;
+ ptr++;
+ ptr1++;
+ }
+ if( pcmd->datalen )
+ {
+ psg = (PSEG) &pSRB->SGsegment[0];
+ pSRB->pSegmentList = psg;
+ sgc = 0;
+
+ /* Set up the scatter gather list */
+ datalen = pcmd->datalen;
+ CurrPgVaddr = (int) pcmd->data;
+ CurrPgPaddr = vtophys(CurrPgVaddr);
+
+ while ((datalen) && (sgc < MAX_SG_ENTRY))
+ {
+ sglen = 0;
+ psg->SGXPtr = CurrPgPaddr;
+ NextPgPaddr = CurrPgPaddr;
+ while ((datalen) && (CurrPgPaddr == NextPgPaddr))
+ {
+ /*
+ * This page is contiguous (physically) with the the last,
+ * just extend the length
+ */
+
+ NextPgPaddr = (CurrPgPaddr & (~(PAGELEN - 1))) + PAGELEN;
+ pglen = NextPgPaddr - CurrPgPaddr;
+
+ if( datalen < pglen )
+ pglen = datalen;
+ sglen += pglen;
+ datalen -= pglen;
+ CurrPgVaddr = (CurrPgVaddr & (~(PAGELEN - 1))) + PAGELEN;
+ if( datalen )
+ CurrPgPaddr = vtophys(CurrPgVaddr);
+ }
+ /*
+ next page isn't contiguous, finish this segment
+ */
+ psg->SGXLen = sglen;
+ psg++;
+ sgc++;
+ }
+ pSRB->SGcount = sgc;
+
+ if (datalen)
+ {
+ printf("DC390: Out Of Segment Buffer!\n");
+ pSRB->pNextSRB = pACB->pFreeSRB;
+ pACB->pFreeSRB = pSRB;
+ pcmd->error = XS_DRIVER_STUFFUP;
+ splx(flags);
+ return (HAD_ERROR);
+ }
+ }
+ else
+ pSRB->SGcount = 0;
+
+ pSRB->SGIndex = 0;
+ pSRB->AdaptStatus = 0;
+ pSRB->TargetStatus = 0;
+ pSRB->MsgCnt = 0;
+ if( pDCB->DevType != SCSI_SEQACESS )
+ pSRB->RetryCnt = 1;
+ else
+ pSRB->RetryCnt = 0;
+ pSRB->SRBStatus = 0;
+ pSRB->SRBFlag = 0;
+ pSRB->SRBState = 0;
+ pSRB->TotalXferredLen = 0;
+ pSRB->SGPhysAddr = 0;
+ pSRB->SGToBeXferLen = 0;
+ pSRB->ScsiPhase = 0;
+ pSRB->EndMessage = 0;
+ splx(flags);
+
+ if( !(cflags & SCSI_NOMASK) )
+ {
+ flags = splbio();
+ SendSRB( pcmd, pACB, pSRB );
+ splx(flags);
+ return( SUCCESSFULLY_QUEUED);
+ }
+ else
+ {
+ SendSRB( pcmd, pACB, pSRB );
+ do
+ {
+ while(--pcmd->timeout)
+ {
+ DELAY(1000);
+ sstatus = inb( ioport+Scsi_Status );
+ if( sstatus & INTERRUPT )
+ break;
+ }
+ if( pcmd->timeout == 0 )
+ {
+ return(HAD_ERROR);
+ }
+ else
+ {
+ DC390_Interrupt( pACB );
+ }
+ }
+ while( !(pcmd->flags & ITSDONE) );
+ if( pcmd->error == XS_TIMEOUT)
+ return(HAD_ERROR);
+ else
+ return(COMPLETE);
+ }
+}
+
+
+void
+trmamd_min_phys( struct buf *bp )
+{
+ if (bp->b_bcount > ((MAX_SG_ENTRY - 1) * PAGELEN))
+ bp->b_bcount = ((MAX_SG_ENTRY - 1) * PAGELEN);
+}
+
+
+#ifdef REL_2_1_0
+u_int32
+trmamd_info( int unit )
+{
+ return (MAX_CMD_PER_LUN); /* outstanding requests at a time per device */
+}
+#endif
+
+
+static PUCHAR phystovirt( PSRB pSRB, ULONG xferCnt )
+{
+ int dataPtr;
+ PSCSICMD pcmd;
+ UCHAR i;
+ PSEG pseg;
+
+ pcmd = pSRB->pcmd;
+ dataPtr = (int) pcmd->data;
+ pseg = pSRB->SGsegment;
+ for(i=0; i < pSRB->SGIndex; i++)
+ {
+ dataPtr += (int) pseg->SGXLen;
+ pseg++;
+ }
+ dataPtr += (int) xferCnt;
+ return( (PUCHAR) dataPtr);
+}
+
+
+/***********************************************************************
+ * Function : int DC390_abort (SCSICMD *cmd)
+ *
+ * Purpose : Abort an errant SCSI command
+ *
+ * Inputs : cmd - command to abort
+ *
+ * Returns : 0 on success, -1 on failure.
+ ***********************************************************************/
+/*
+int
+DC390_abort (SCSICMD *cmd)
+{
+ int flags;
+ PACB pACB;
+ PDCB pDCB, pdcb;
+ PSRB pSRB, psrb;
+ USHORT count, i;
+ PSCSICMD pcmd, pcmd1;
+ int status;
+
+
+#ifdef DC390_DEBUG0
+ printf("DC390 : Abort Cmd.");
+#endif
+
+ flags = splbio();
+
+ pACB = (PACB) cmd->host->hostdata;
+ pDCB = pACB->pLinkDCB;
+ pdcb = pDCB;
+ while( (pDCB->UnitSCSIID != cmd->sc_link->target) ||
+ (pDCB->UnitSCSILUN != cmd->sc_link->lun) )
+ {
+ pDCB = pDCB->pNextDCB;
+ if( pDCB == pdcb )
+ goto NOT_RUN;
+ }
+
+
+ pSRB = pDCB->pWaitingSRB;
+ if( !pSRB )
+ goto ON_GOING;
+ if( pSRB->pcmd == cmd )
+ {
+ pDCB->pWaitingSRB = pSRB->pNextSRB;
+ goto IN_WAIT;
+ }
+ else
+ {
+ psrb = pSRB;
+ while( psrb->pNextSRB->pcmd != cmd )
+ {
+ psrb = psrb->pNextSRB;
+ if( !psrb )
+ goto ON_GOING;
+ }
+ pSRB = psrb->pNextSRB;
+ psrb->pNextSRB = pSRB->pNextSRB;
+ if( pSRB == pDCB->pWaitLast )
+ pDCB->pWaitLast = psrb;
+IN_WAIT:
+ pSRB->pNextSRB = pACB->pFreeSRB;
+ pACB->pFreeSRB = pSRB;
+ cmd->next = NULL;
+ status = SCSI_ABORT_SUCCESS;
+ goto ABO_X;
+ }
+
+ON_GOING:
+ pSRB = pDCB->pGoingSRB;
+ for( count = pDCB->GoingSRBCnt, i=0; i<count; i++)
+ {
+ if( pSRB->pcmd != cmd )
+ pSRB = pSRB->pNextSRB;
+ else
+ {
+ if( (pACB->pActiveDCB == pDCB) && (pDCB->pActiveSRB == pSRB) )
+ {
+ status = SCSI_ABORT_BUSY;
+ goto ABO_X;
+ }
+ else
+ {
+ status = SCSI_ABORT_SNOOZE;
+ goto ABO_X;
+ }
+ }
+ }
+
+NOT_RUN:
+ status = SCSI_ABORT_NOT_RUNNING;
+
+ABO_X:
+ cmd->error = XS_NOERROR;
+ scsi_done(cmd);
+ splx(flags);
+ return( status );
+}
+*/
+
+static void
+ResetDevParam( PACB pACB )
+{
+ PDCB pDCB, pdcb;
+
+ pDCB = pACB->pLinkDCB;
+ if( pDCB == NULL )
+ return;
+ pdcb = pDCB;
+ do
+ {
+ pDCB->SyncMode &= ~SYNC_NEGO_DONE;
+ pDCB->SyncPeriod = 0;
+ pDCB->SyncOffset = 0;
+ pDCB->CtrlR3 = FAST_CLK;
+ pDCB->CtrlR4 &= NEGATE_REQACKDATA;
+ pDCB->CtrlR4 |= EATER_25NS;
+ pDCB = pDCB->pNextDCB;
+ }
+ while( pdcb != pDCB );
+}
+
+
+static void
+RecoverSRB( PACB pACB )
+{
+ PDCB pDCB, pdcb;
+ PSRB psrb, psrb2;
+ USHORT cnt, i;
+
+ pDCB = pACB->pLinkDCB;
+ if( pDCB == NULL )
+ return;
+ pdcb = pDCB;
+ do
+ {
+ cnt = pdcb->GoingSRBCnt;
+ psrb = pdcb->pGoingSRB;
+ for (i=0; i<cnt; i++)
+ {
+ psrb2 = psrb;
+ psrb = psrb->pNextSRB;
+/* RewaitSRB( pDCB, psrb ); */
+ if( pdcb->pWaitingSRB )
+ {
+ psrb2->pNextSRB = pdcb->pWaitingSRB;
+ pdcb->pWaitingSRB = psrb2;
+ }
+ else
+ {
+ pdcb->pWaitingSRB = psrb2;
+ pdcb->pWaitLast = psrb2;
+ psrb2->pNextSRB = NULL;
+ }
+ }
+ pdcb->GoingSRBCnt = 0;
+ pdcb->pGoingSRB = NULL;
+ pdcb->TagMask = 0;
+ pdcb = pdcb->pNextDCB;
+ }
+ while( pdcb != pDCB );
+}
+
+
+/***********************************************************************
+ * Function : DC390_reset (PACB pACB)
+ *
+ * Purpose : perform a hard reset on the SCSI bus( and AMD chip).
+ *
+ * Inputs : cmd - command which caused the SCSI RESET
+ *
+ ***********************************************************************/
+
+static void
+DC390_reset (PACB pACB)
+{
+ USHORT ioport;
+ int flags;
+ UCHAR bval;
+ USHORT i;
+
+
+#ifdef DC390_DEBUG0
+ printf("DC390: RESET,");
+#endif
+
+ flags = splbio();
+
+ ioport = pACB->IOPortBase;
+ bval = inb(ioport+CtrlReg1);
+ bval |= DIS_INT_ON_SCSI_RST;
+ OutB(bval,ioport+CtrlReg1); /* disable interrupt */
+ DC390_ResetSCSIBus( pACB );
+ for( i=0; i<500; i++ )
+ DELAY(1000);
+ bval = inb(ioport+CtrlReg1);
+ bval &= ~DIS_INT_ON_SCSI_RST;
+ OutB(bval,ioport+CtrlReg1); /* re-enable interrupt */
+
+ bval = DMA_IDLE_CMD;
+ OutB(bval,ioport+DMA_Cmd);
+ bval = CLEAR_FIFO_CMD;
+ OutB(bval,ioport+ScsiCmd);
+
+ ResetDevParam( pACB );
+ DoingSRB_Done( pACB );
+ pACB->pActiveDCB = NULL;
+
+ pACB->ACBFlag = 0;
+ DoWaitingSRB( pACB );
+ splx(flags);
+ return;
+}
+
+
+#include <pci/scsiiom.c>
+
+
+/***********************************************************************
+ * Function : static void DC390_initDCB
+ *
+ * Purpose : initialize the internal structures for a given DCB
+ *
+ * Inputs : cmd - pointer to this scsi cmd request block structure
+ *
+ ***********************************************************************/
+static void
+DC390_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd )
+{
+ PEEprom prom;
+ UCHAR bval;
+ USHORT index;
+ PSCLINK plink;
+
+ if( pACB->DeviceCnt == 0 )
+ {
+ pACB->pLinkDCB = pDCB;
+ pACB->pDCBRunRobin = pDCB;
+ pDCB->pNextDCB = pDCB;
+ pPrevDCB = pDCB;
+ }
+ else
+ pPrevDCB->pNextDCB = pDCB;
+
+ plink = cmd->sc_link;
+ pDCB->pDCBACB = pACB;
+ pDCB->UnitSCSIID = plink->target;
+ pDCB->UnitSCSILUN = plink->lun;
+ pDCB->pWaitingSRB = NULL;
+ pDCB->pGoingSRB = NULL;
+ pDCB->GoingSRBCnt = 0;
+ pDCB->pActiveSRB = NULL;
+ pDCB->TagMask = 0;
+ pDCB->MaxCommand = 1;
+ pDCB->AdaptIndex = pACB->AdapterIndex;
+ index = pACB->AdapterIndex;
+ pDCB->DCBFlag = 0;
+
+ prom = (PEEprom) &eepromBuf[index][plink->target << 2];
+ pDCB->DevMode = prom->EE_MODE1;
+ pDCB->AdpMode = eepromBuf[index][EE_MODE2];
+
+ if( pDCB->DevMode & EN_DISCONNECT_ )
+ bval = 0xC0;
+ else
+ bval = 0x80;
+ bval |= plink->lun;
+ pDCB->IdentifyMsg = bval;
+
+ pDCB->SyncMode = 0;
+ if( pDCB->DevMode & SYNC_NEGO_ )
+ {
+ if( !(plink->lun) || CurrSyncOffset )
+ pDCB->SyncMode = SYNC_ENABLE;
+ }
+
+ pDCB->SyncPeriod = 0;
+ pDCB->SyncOffset = 0;
+ pDCB->NegoPeriod = (clock_period1[prom->EE_SPEED] * 25) >> 2;
+
+ pDCB->CtrlR1 = pACB->AdaptSCSIID;
+ if( pDCB->DevMode & PARITY_CHK_ )
+ pDCB->CtrlR1 |= PARITY_ERR_REPO;
+
+ pDCB->CtrlR3 = FAST_CLK;
+
+ pDCB->CtrlR4 = EATER_25NS;
+ if( pDCB->AdpMode & ACTIVE_NEGATION)
+ pDCB->CtrlR4 |= NEGATE_REQACKDATA;
+}
+
+
+/***********************************************************************
+ * Function : static void DC390_initSRB
+ *
+ * Purpose : initialize the internal structures for a given SRB
+ *
+ * Inputs : psrb - pointer to this scsi request block structure
+ *
+ ***********************************************************************/
+static void
+DC390_initSRB( PSRB psrb )
+{
+ psrb->PhysSRB = vtophys( psrb );
+}
+
+
+static void
+DC390_linkSRB( PACB pACB )
+{
+ USHORT count, i;
+ PSRB psrb;
+
+ count = pACB->SRBCount;
+
+ for( i=0; i< count; i++)
+ {
+ if( i != count - 1)
+ pACB->SRB_array[i].pNextSRB = &pACB->SRB_array[i+1];
+ else
+ pACB->SRB_array[i].pNextSRB = NULL;
+ psrb = (PSRB) &pACB->SRB_array[i];
+ DC390_initSRB( psrb );
+ }
+}
+
+
+/***********************************************************************
+ * Function : static void DC390_initACB
+ *
+ * Purpose : initialize the internal structures for a given SCSI host
+ *
+ * Inputs : psh - pointer to this host adapter's structure
+ *
+ ***********************************************************************/
+static void
+DC390_initACB( PACB pACB, ULONG io_port, UCHAR Irq, USHORT index )
+{
+ USHORT i;
+
+
+ pACB->max_id = 7;
+ if( pACB->max_id == eepromBuf[index][EE_ADAPT_SCSI_ID] )
+ pACB->max_id--;
+ if( eepromBuf[index][EE_MODE2] & LUN_CHECK )
+ pACB->max_lun = 7;
+ else
+ pACB->max_lun = 0;
+
+ pACB->IOPortBase = (USHORT) io_port;
+ pACB->pLinkDCB = NULL;
+ pACB->pDCBRunRobin = NULL;
+ pACB->pActiveDCB = NULL;
+ pACB->pFreeSRB = pACB->SRB_array;
+ pACB->SRBCount = MAX_SRB_CNT;
+ pACB->AdapterIndex = index;
+ pACB->status = 0;
+ pACB->AdaptSCSIID = eepromBuf[index][EE_ADAPT_SCSI_ID];
+ pACB->HostID_Bit = (1 << pACB->AdaptSCSIID);
+ pACB->AdaptSCSILUN = 0;
+ pACB->DeviceCnt = 0;
+ pACB->IRQLevel = Irq;
+ pACB->TagMaxNum = (eepromBuf[index][EE_TAG_CMD_NUM]) << 2;
+ pACB->ACBFlag = 0;
+ pACB->scan_devices = 1;
+ pACB->Gmode2 = eepromBuf[index][EE_MODE2];
+ if( eepromBuf[index][EE_MODE2] & LUN_CHECK )
+ pACB->LUNchk = 1;
+ pACB->pDCB_free = &pACB->DCB_array[0];
+ DC390_linkSRB( pACB );
+ pACB->pTmpSRB = &pACB->TmpSRB;
+ DC390_initSRB( pACB->pTmpSRB );
+ for(i=0; i<MAX_SCSI_ID; i++)
+ pACB->DCBmap[i] = 0;
+
+ pACB->ScsiLink.adapter_unit = index;
+ pACB->ScsiLink.adapter_targ = pACB->AdaptSCSIID;
+ pACB->ScsiLink.fordriver = 0;
+ pACB->ScsiLink.opennings = 2;
+ pACB->ScsiLink.adapter = &trmamd_switch;
+ pACB->ScsiLink.device = &trmamd_dev;
+ pACB->ScsiLink.flags = 0;
+}
+
+
+/***********************************************************************
+ * Function : static int DC390_initAdapter
+ *
+ * Purpose : initialize the SCSI chip ctrl registers
+ *
+ * Inputs : psh - pointer to this host adapter's structure
+ *
+ ***********************************************************************/
+static int DC390_initAdapter( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index,
+ pcici_t config_id )
+{
+ USHORT ioport;
+ UCHAR bval;
+
+#ifdef CHECK_SHARE_INT
+ PACB pacb;
+ USHORT used_irq = 0;
+
+ pacb = pACB_start;
+ if( pacb != NULL )
+ {
+ for ( ; (pacb != (PACB) -1) ; )
+ {
+ if( pacb->IRQLevel == Irq )
+ {
+ used_irq = 1;
+ break;
+ }
+ else
+ pacb = pacb->pNextACB;
+ }
+ }
+
+ if( !used_irq )
+ {
+#endif
+ if( !pci_map_int (config_id, (PVOID)DC390_Interrupt, pACB, &bio_imask) )
+ {
+ if(bootverbose)
+ printf("DC390: register Interrupt handler error!\n");
+ return( -1 );
+ }
+
+#ifdef CHECK_SHARE_INT
+ }
+#endif
+
+ ioport = (USHORT) io_port;
+ bval = 153; /* 250ms selection timeout */
+ OutB(bval,ioport+Scsi_TimeOut);
+
+ bval = CLK_FREQ_40MHZ; /* Conversion factor = 0 , 40MHz clock */
+ OutB(bval,ioport+Clk_Factor);
+
+ bval = NOP_CMD; /* NOP cmd - clear command register */
+ OutB(bval,ioport+ScsiCmd);
+
+ bval = EN_FEATURE+EN_SCSI2_CMD; /* Enable Feature and SCSI-2 */
+ OutB(bval,ioport+CtrlReg2);
+
+ bval = FAST_CLK; /* fast clock */
+ OutB(bval,ioport+CtrlReg3);
+
+ bval = EATER_25NS;
+ if( eepromBuf[index][EE_MODE2] & ACTIVE_NEGATION )
+ bval |= NEGATE_REQACKDATA;
+ OutB(bval,ioport+CtrlReg4);
+
+ bval = DIS_INT_ON_SCSI_RST; /* Disable SCSI bus reset interrupt */
+ OutB(bval,ioport+CtrlReg1);
+
+ return(0);
+}
+
+
+#ifdef PCI_COMPAT
+static pcicfgregs *cfg;
+#define DC390_EnableCfg(a,b)
+#define DC390_DisableCfg(a)
+#define DC390_inByte(a,reg) pci_cfgread(cfg,reg,1)
+#define DC390_inWord(a,reg) pci_cfgread(cfg,reg,2)
+#define DC390_inDword(a,reg) pci_cfgread(cfg,reg,4)
+#define DC390_OutB(a,reg,val) pci_cfgwrite(cfg,reg,val,1)
+#else
+
+void
+DC390_EnableCfg( USHORT mechnum, UCHAR regval )
+{
+ ULONG wlval;
+
+ if(mechnum == 2)
+ {
+ OutB(mech2bus, PCI_CFG2_FORWARD_REG);
+ OutB(mech2CfgSPenR, PCI_CFG2_ENABLE_REG);
+ }
+ else
+ {
+ regval &= 0xFC;
+ wlval = mech1addr;
+ wlval |= (((ULONG)regval) & 0xff);
+ OutL(wlval, PCI_CFG1_ADDRESS_REG);
+ }
+}
+
+
+void
+DC390_DisableCfg( USHORT mechnum )
+{
+
+ if(mechnum == 2)
+ OutB(0, PCI_CFG2_ENABLE_REG);
+ else
+ OutL(0, PCI_CFG1_ADDRESS_REG);
+}
+
+
+UCHAR
+DC390_inByte( USHORT mechnum, UCHAR regval )
+{
+ UCHAR bval;
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg( mechnum, regval );
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= ((USHORT) regval) & 0xff;
+ bval = inb(wval);
+ }
+ else
+ {
+ regval &= 3;
+ bval = inb(PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(bval);
+}
+
+
+USHORT
+DC390_inWord( USHORT mechnum, UCHAR regval )
+{
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ wval = inw(wval);
+ }
+ else
+ {
+ regval &= 3;
+ wval = inw(PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(wval);
+}
+
+
+ULONG
+DC390_inDword(USHORT mechnum, UCHAR regval )
+{
+ ULONG wlval;
+ int flags;
+ USHORT wval;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ wlval = inl(wval);
+ }
+ else
+ {
+ wlval = inl(PCI_CFG1_DATA_REG);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(wlval);
+}
+
+
+void
+DC390_OutB(USHORT mechnum, UCHAR regval, UCHAR bval )
+{
+
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ OutB(bval, wval);
+ }
+ else
+ {
+ regval &= 3;
+ OutB(bval, PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+}
+
+#endif /PCI_COMPAT */
+
+static void
+DC390_EnDisableCE( UCHAR mode, USHORT mechnum, PUCHAR regval )
+{
+
+ UCHAR bval;
+
+ bval = 0;
+ if(mode == ENABLE_CE)
+ *regval = 0xc0;
+ else
+ *regval = 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ if(mode == DISABLE_CE)
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+}
+
+
+static void
+DC390_EEpromOutDI( USHORT mechnum, PUCHAR regval, USHORT Carry )
+{
+ UCHAR bval;
+
+ bval = 0;
+ if(Carry)
+ {
+ bval = 0x40;
+ *regval = 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ }
+ DELAY(160);
+ bval |= 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+ bval = 0;
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+}
+
+
+static UCHAR
+DC390_EEpromInDO( USHORT mechnum )
+{
+ UCHAR bval,regval;
+
+ regval = 0x80;
+ bval = 0x80;
+ DC390_OutB(mechnum,regval,bval);
+ DELAY(160);
+ bval = 0x40;
+ DC390_OutB(mechnum,regval,bval);
+ DELAY(160);
+ regval = 0x0;
+ bval = DC390_inByte(mechnum,regval);
+ if(bval == 0x22)
+ return(1);
+ else
+ return(0);
+}
+
+
+static USHORT
+EEpromGetData1( USHORT mechnum )
+{
+ UCHAR i;
+ UCHAR carryFlag;
+ USHORT wval;
+
+ wval = 0;
+ for(i=0; i<16; i++)
+ {
+ wval <<= 1;
+ carryFlag = DC390_EEpromInDO(mechnum);
+ wval |= carryFlag;
+ }
+ return(wval);
+}
+
+
+static void
+DC390_Prepare( USHORT mechnum, PUCHAR regval, UCHAR EEpromCmd )
+{
+ UCHAR i,j;
+ USHORT carryFlag;
+
+ carryFlag = 1;
+ j = 0x80;
+ for(i=0; i<9; i++)
+ {
+ DC390_EEpromOutDI(mechnum,regval,carryFlag);
+ carryFlag = (EEpromCmd & j) ? 1 : 0;
+ j >>= 1;
+ }
+}
+
+
+static void
+DC390_ReadEEprom( USHORT mechnum, USHORT index )
+{
+ UCHAR regval,cmd;
+ PUSHORT ptr;
+ USHORT i;
+
+ ptr = (PUSHORT) &eepromBuf[index][0];
+ cmd = EEPROM_READ;
+ for(i=0; i<0x40; i++)
+ {
+ DC390_EnDisableCE(ENABLE_CE, mechnum, &regval);
+ DC390_Prepare(mechnum, &regval, cmd);
+ *ptr = EEpromGetData1(mechnum);
+ ptr++;
+ cmd++;
+ DC390_EnDisableCE(DISABLE_CE,mechnum,&regval);
+ }
+}
+
+
+static USHORT
+DC390_DefaultEEprom( USHORT mechnum, USHORT index )
+{
+ PUCHAR ptr;
+ USHORT i;
+
+ ptr = (PUCHAR) &eepromBuf[index][0];
+ bzero (ptr, sizeof eepromBuf[index]);
+ for(i=0; i<0x40; i++)
+ {
+ *ptr = (TAG_QUEUING_|EN_DISCONNECT_|SYNC_NEGO_|PARITY_CHK_);
+ ptr += 4;
+ }
+ eepromBuf[index][EE_ADAPT_SCSI_ID] = 7;
+ eepromBuf[index][EE_MODE2] = (LUN_CHECK|ACTIVE_NEGATION);
+ eepromBuf[index][EE_TAG_CMD_NUM] = 4;
+ return 0;
+}
+
+
+static USHORT
+DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index )
+{
+ USHORT wval, rc, *ptr;
+ UCHAR i;
+
+ DC390_ReadEEprom( MechNum, index );
+ wval = 0;
+ ptr = (PUSHORT) &eepromBuf[index][0];
+ for(i=0; i<128 ;i+=2, ptr++)
+ wval += *ptr;
+ if( wval == 0x1234 )
+ rc = 0;
+ else
+ rc = DC390_DefaultEEprom( MechNum, index);
+ return( rc );
+}
+
+
+static USHORT
+DC390_ToMech( USHORT Mechnum, pcici_t config_id )
+{
+
+#ifdef PCI_COMPAT
+ cfg = config_id;
+#else
+ if(Mechnum == 2)
+ {
+ mech2bus = config_id.cfg2.forward; /* Bus num */
+ mech2Agent = config_id.cfg2.port >> 8; /* Dev num */
+ mech2CfgSPenR = config_id.cfg2.enable; /* Fun num */
+ }
+ else /* use mech #1 method */
+ {
+ mech1addr = config_id.cfg1;
+ }
+#endif /* PCI_COMPAT */
+ return(0);
+}
+
+/***********************************************************************
+ * Function : static int DC390_init (struct Scsi_Host *host)
+ *
+ * Purpose : initialize the internal structures for a given SCSI host
+ *
+ * Inputs : host - pointer to this host adapter's structure/
+ *
+ * Preconditions : when this function is called, the chip_type
+ * field of the pACB structure MUST have been set.
+ ***********************************************************************/
+
+static int
+DC390_init( ULONG io_port, UCHAR Irq, USHORT index, USHORT MechNum,
+ pcici_t config_id)
+{
+ PACB pACB;
+
+ if( !DC390_CheckEEpromCheckSum( MechNum, index) )
+ {
+ pACB = (PACB) malloc (sizeof (struct _ACB), M_DEVBUF, M_WAITOK);
+ if( !pACB )
+ {
+ printf("DC390%d: cannot allocate ACB !\n", index);
+ return( -1 );
+ }
+ bzero (pACB, sizeof (struct _ACB));
+ DC390_initACB( pACB, io_port, Irq, index );
+ if( !DC390_initAdapter( pACB, io_port, Irq, index, config_id) )
+ {
+ if( !pACB_start )
+ {
+ pACB_start = pACB;
+ pACB_current = pACB;
+ pACB->pNextACB = (PACB) -1;
+ }
+ else
+ {
+ pACB_current->pNextACB = pACB;
+ pACB_current = pACB;
+ pACB->pNextACB = (PACB) -1;
+ }
+ pACB0[index] = pACB;
+
+#ifdef DC390_DEBUG0
+ printf("DC390: pACB = %8x, pDCB_array = %8x, pSRB_array = %8x\n",
+ (UINT) pACB, (UINT) pACB->DCB_array, (UINT) pACB->SRB_array);
+ printf("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",
+ sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) );
+#endif
+
+ return( 0 );
+ }
+ else
+ {
+ free( pACB, M_DEVBUF);
+ return( -1 );
+ }
+ }
+ else
+ {
+ printf("DC390_init: EEPROM reading error!\n");
+ return( -1 );
+ }
+}
+
+
+
+void
+trmamd_attach (pcici_t config_id, int unit)
+{
+ struct scsibus_data *scbus;
+ UCHAR irq;
+ USHORT MechNum;
+ ULONG io_port, wlval;
+ PACB pACB = 0;
+ int flags;
+
+ if( unit >= MAX_ADAPTER_NUM )
+ return;
+
+ if( pACB0[unit] )
+ return;
+
+ CurrentID = 0;
+ CurrentLUN = 0;
+ MechNum = pci_mechanism;
+
+#ifdef DC390_DEBUG0
+ if(bootverbose)
+ printf("DC390: Mech=%2x,\n",(UCHAR) MechNum);
+#endif
+
+ if( !DC390_ToMech( MechNum, config_id ) )
+ {
+ wlval = DC390_inDword( MechNum, PCI_ID_REG);
+ if(wlval == PCI_DEVICE_ID_AMD53C974 )
+ {
+ io_port =DC390_inDword(MechNum,PCI_BASE_ADDR0) & 0xFFFE;
+ irq = DC390_inByte( MechNum, PCI_INTERRUPT_REG);
+#ifdef DC390_DEBUG0
+ if(bootverbose)
+ printf("DC390: IO_PORT=%4x,IRQ=%x,\n",(UINT) io_port, irq);
+#endif
+ if( !DC390_init( io_port, irq, (USHORT) unit, MechNum, config_id) )
+ {
+ adapterCnt++;
+ }
+ else
+ return;
+ }
+ }
+
+ pACB = pACB0[unit];
+
+/*
+ Now let the generic SCSI driver look for the SCSI devices on the bus
+*/
+
+ flags = splbio();
+
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ {
+ splx(flags);
+ return;
+ }
+ scbus->adapter_link = &pACB->ScsiLink;
+ scbus->maxtarg = pACB->max_id;
+
+#ifdef DC390_DEBUG
+ if(bootverbose)
+ printf("\nDC390: scanning for devices ...\n\n");
+#endif
+
+ scsi_attachdevs (scbus);
+ scbus = NULL; /* Upper-level SCSI code owns this now */
+
+#ifdef DC390_DEBUG
+ if(bootverbose)
+ printf("\n\nDC390: Attach devices return\n");
+#endif
+
+ splx(flags);
+}
+
+
+static char*
+trmamd_probe (pcici_t tag, pcidi_t type)
+{
+ if( type == PCI_DEVICE_ID_AMD53C974 )
+ return ("amd 53c974 scsi");
+ else
+ return (NULL);
+}
+
diff --git a/sys/pci/tek390.h b/sys/pci/tek390.h
new file mode 100644
index 000000000000..c8de8cee0d1a
--- /dev/null
+++ b/sys/pci/tek390.h
@@ -0,0 +1,667 @@
+/***********************************************************************
+;* File Name : TEK390.H *
+;* TEKRAM DC-390 PCI SCSI Bus Master Host Adapter *
+;* Device Driver *
+;***********************************************************************/
+
+#ifndef TEK390_H
+#define TEK390_H
+
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long ULONG;
+typedef unsigned int UINT;
+
+typedef UCHAR *PUCHAR;
+typedef USHORT *PUSHORT;
+typedef ULONG *PULONG;
+typedef struct scsi_link *PSCLINK, SCSILINK;
+typedef struct scsi_xfer *PSCSICMD, SCSICMD;
+typedef void *PVOID;
+
+
+/*;-----------------------------------------------------------------------*/
+typedef struct _SyncMsg
+{
+UCHAR ExtendMsg;
+UCHAR ExtMsgLen;
+UCHAR SyncXferReq;
+UCHAR Period;
+UCHAR ReqOffset;
+} SyncMsg;
+/*;-----------------------------------------------------------------------*/
+typedef struct _Capacity
+{
+ULONG BlockCount;
+ULONG BlockLength;
+} Capacity;
+/*;-----------------------------------------------------------------------*/
+typedef struct _SGentry
+{
+ULONG SGXLen;
+ULONG SGXPtr;
+} SGentry, *PSEG;
+
+typedef struct _SGentry1
+{
+ULONG SGXPtr1;
+ULONG SGXLen1;
+} SGentry1, *PSEG1;
+
+
+#define MAX_ADAPTER_NUM 4
+#define MAX_SCSI_ID 8
+#define MAX_SG_ENTRY 33
+#define MAX_DEVICES 10
+#define MAX_CMD_QUEUE 20
+#define MAX_CMD_PER_LUN 6
+#define MAX_SRB_CNT MAX_CMD_PER_LUN*4
+#define PAGELEN 4096
+
+/*
+;-----------------------------------------------------------------------
+; SCSI Request Block
+;-----------------------------------------------------------------------
+*/
+struct _SRB
+{
+UCHAR CmdBlock[12];
+
+struct _SRB *pNextSRB;
+struct _DCB *pSRBDCB;
+PSCSICMD pcmd;
+PSEG pSegmentList;
+
+ULONG PhysSRB;
+ULONG TotalXferredLen;
+ULONG SGPhysAddr; /*;a segment starting address */
+ULONG SGToBeXferLen; /*; to be xfer length */
+ULONG Segment0[2];
+ULONG Segment1[2];
+
+SGentry SGsegment[MAX_SG_ENTRY];
+SGentry Segmentx; /* make a one entry of S/G list table */
+
+PUCHAR pMsgPtr;
+USHORT SRBState;
+USHORT Revxx2; /* ??? */
+
+UCHAR MsgInBuf[6];
+UCHAR MsgOutBuf[6];
+
+UCHAR AdaptStatus;
+UCHAR TargetStatus;
+UCHAR MsgCnt;
+UCHAR EndMessage;
+UCHAR TagNumber;
+UCHAR SGcount;
+UCHAR SGIndex;
+UCHAR IORBFlag; /*;81h-Reset, 2-retry */
+
+UCHAR SRBStatus;
+UCHAR RetryCnt;
+UCHAR SRBFlag; /*; b0-AutoReqSense,b6-Read,b7-write */
+ /*; b4-settimeout,b5-Residual valid */
+UCHAR ScsiCmdLen;
+UCHAR ScsiPhase;
+UCHAR Reserved3[3]; /*;for dword alignment */
+};
+
+typedef struct _SRB DC390_SRB, *PSRB;
+
+/*
+;-----------------------------------------------------------------------
+; Device Control Block
+;-----------------------------------------------------------------------
+*/
+struct _DCB
+{
+struct _DCB *pNextDCB;
+struct _ACB *pDCBACB;
+
+PSRB pWaitingSRB;
+PSRB pWaitLast;
+PSRB pGoingSRB;
+PSRB pGoingLast;
+PSRB pActiveSRB;
+USHORT GoingSRBCnt;
+USHORT WaitSRBCnt; /* ??? */
+
+ULONG TagMask;
+
+USHORT MaxCommand;
+USHORT AdaptIndex; /*; UnitInfo struc start */
+USHORT UnitIndex; /*; nth Unit on this card */
+UCHAR UnitSCSIID; /*; SCSI Target ID (SCSI Only) */
+UCHAR UnitSCSILUN; /*; SCSI Log. Unit (SCSI Only) */
+
+UCHAR IdentifyMsg;
+UCHAR CtrlR1;
+UCHAR CtrlR3;
+UCHAR CtrlR4;
+
+UCHAR InqDataBuf[8];
+UCHAR CapacityBuf[8];
+UCHAR DevMode;
+UCHAR AdpMode;
+UCHAR SyncMode; /*; 0:async mode */
+UCHAR NegoPeriod; /*;for nego. */
+UCHAR SyncPeriod; /*;for reg. */
+UCHAR SyncOffset; /*;for reg. and nego.(low nibble) */
+UCHAR UnitCtrlFlag;
+UCHAR DCBFlag;
+UCHAR DevType;
+UCHAR Reserved2[3]; /*;for dword alignment */
+};
+
+typedef struct _DCB DC390_DCB, *PDCB;
+/*
+;-----------------------------------------------------------------------
+; Adapter Control Block
+;-----------------------------------------------------------------------
+*/
+struct _ACB
+{
+ULONG PhysACB;
+struct _ACB *pNextACB;
+USHORT IOPortBase;
+USHORT Revxx1; /* ??? */
+
+PDCB pLinkDCB;
+PDCB pDCBRunRobin;
+PDCB pActiveDCB;
+PDCB pDCB_free;
+PSRB pFreeSRB;
+PSRB pTmpSRB;
+USHORT SRBCount;
+USHORT AdapterIndex; /*; nth Adapter this driver */
+USHORT max_id;
+USHORT max_lun;
+SCSILINK ScsiLink;
+
+UCHAR msgin123[4];
+UCHAR status;
+UCHAR AdaptSCSIID; /*; Adapter SCSI Target ID */
+UCHAR AdaptSCSILUN; /*; Adapter SCSI LUN */
+UCHAR DeviceCnt;
+UCHAR IRQLevel;
+UCHAR TagMaxNum;
+UCHAR ACBFlag;
+UCHAR Gmode2;
+UCHAR LUNchk;
+UCHAR scan_devices;
+UCHAR HostID_Bit;
+UCHAR Reserved1[1]; /*;for dword alignment */
+UCHAR DCBmap[MAX_SCSI_ID];
+DC390_DCB DCB_array[MAX_DEVICES]; /* +74h, Len=3E8 */
+DC390_SRB SRB_array[MAX_SRB_CNT]; /* +45Ch, Len= */
+DC390_SRB TmpSRB;
+};
+
+typedef struct _ACB DC390_ACB, *PACB;
+
+/*;-----------------------------------------------------------------------*/
+
+
+#define BIT31 0x80000000
+#define BIT30 0x40000000
+#define BIT29 0x20000000
+#define BIT28 0x10000000
+#define BIT27 0x08000000
+#define BIT26 0x04000000
+#define BIT25 0x02000000
+#define BIT24 0x01000000
+#define BIT23 0x00800000
+#define BIT22 0x00400000
+#define BIT21 0x00200000
+#define BIT20 0x00100000
+#define BIT19 0x00080000
+#define BIT18 0x00040000
+#define BIT17 0x00020000
+#define BIT16 0x00010000
+#define BIT15 0x00008000
+#define BIT14 0x00004000
+#define BIT13 0x00002000
+#define BIT12 0x00001000
+#define BIT11 0x00000800
+#define BIT10 0x00000400
+#define BIT9 0x00000200
+#define BIT8 0x00000100
+#define BIT7 0x00000080
+#define BIT6 0x00000040
+#define BIT5 0x00000020
+#define BIT4 0x00000010
+#define BIT3 0x00000008
+#define BIT2 0x00000004
+#define BIT1 0x00000002
+#define BIT0 0x00000001
+
+/*;---UnitCtrlFlag */
+#define UNIT_ALLOCATED BIT0
+#define UNIT_INFO_CHANGED BIT1
+#define FORMATING_MEDIA BIT2
+#define UNIT_RETRY BIT3
+
+/*;---UnitFlags */
+#define DASD_SUPPORT BIT0
+#define SCSI_SUPPORT BIT1
+#define ASPI_SUPPORT BIT2
+
+/*;----SRBState machine definition */
+#define SRB_FREE 0
+#define SRB_WAIT BIT0
+#define SRB_READY BIT1
+#define SRB_MSGOUT BIT2 /*;arbitration+msg_out 1st byte*/
+#define SRB_MSGIN BIT3
+#define SRB_MSGIN_MULTI BIT4
+#define SRB_COMMAND BIT5
+#define SRB_START_ BIT6 /*;arbitration+msg_out+command_out*/
+#define SRB_DISCONNECT BIT7
+#define SRB_DATA_XFER BIT8
+#define SRB_XFERPAD BIT9
+#define SRB_STATUS BIT10
+#define SRB_COMPLETED BIT11
+#define SRB_ABORT_SENT BIT12
+#define DO_SYNC_NEGO BIT13
+#define SRB_UNEXPECT_RESEL BIT14
+
+/*;---ACBFlag */
+#define RESET_DEV BIT0
+#define RESET_DETECT BIT1
+#define RESET_DONE BIT2
+
+/*;---DCBFlag */
+#define ABORT_DEV_ BIT0
+
+/*;---SRBstatus */
+#define SRB_OK BIT0
+#define ABORTION BIT1
+#define OVER_RUN BIT2
+#define UNDER_RUN BIT3
+#define PARITY_ERROR BIT4
+#define SRB_ERROR BIT5
+
+/*;---SRBFlag */
+#define DATAOUT BIT7
+#define DATAIN BIT6
+#define RESIDUAL_VALID BIT5
+#define ENABLE_TIMER BIT4
+#define RESET_DEV0 BIT2
+#define ABORT_DEV BIT1
+#define AUTO_REQSENSE BIT0
+
+/*;---Adapter status */
+#define H_STATUS_GOOD 0
+#define H_SEL_TIMEOUT 0x11
+#define H_OVER_UNDER_RUN 0x12
+#define H_UNEXP_BUS_FREE 0x13
+#define H_TARGET_PHASE_F 0x14
+#define H_INVALID_CCB_OP 0x16
+#define H_LINK_CCB_BAD 0x17
+#define H_BAD_TARGET_DIR 0x18
+#define H_DUPLICATE_CCB 0x19
+#define H_BAD_CCB_OR_SG 0x1A
+#define H_ABORT 0x0FF
+
+/*; SCSI Status byte codes*/
+#define SCSI_STAT_GOOD 0x0 /*; Good status */
+#define SCSI_STAT_CHECKCOND 0x02 /*; SCSI Check Condition */
+#define SCSI_STAT_CONDMET 0x04 /*; Condition Met */
+#define SCSI_STAT_BUSY 0x08 /*; Target busy status */
+#define SCSI_STAT_INTER 0x10 /*; Intermediate status */
+#define SCSI_STAT_INTERCONDMET 0x14 /*; Intermediate condition met */
+#define SCSI_STAT_RESCONFLICT 0x18 /*; Reservation conflict */
+#define SCSI_STAT_CMDTERM 0x22 /*; Command Terminated */
+#define SCSI_STAT_QUEUEFULL 0x28 /*; Queue Full */
+
+#define SCSI_STAT_UNEXP_BUS_F 0xFD /*; Unexpect Bus Free */
+#define SCSI_STAT_BUS_RST_DETECT 0xFE /*; Scsi Bus Reset detected */
+#define SCSI_STAT_SEL_TIMEOUT 0xFF /*; Selection Time out */
+
+/*;---Sync_Mode */
+#define SYNC_DISABLE 0
+#define SYNC_ENABLE BIT0
+#define SYNC_NEGO_DONE BIT1
+#define WIDE_ENABLE BIT2
+#define WIDE_NEGO_DONE BIT3
+#define EN_TAG_QUEUING BIT4
+#define EN_ATN_STOP BIT5
+
+#define SYNC_NEGO_OFFSET 15
+
+/*;---SCSI bus phase*/
+#define SCSI_DATA_OUT_ 0
+#define SCSI_DATA_IN_ 1
+#define SCSI_COMMAND 2
+#define SCSI_STATUS_ 3
+#define SCSI_NOP0 4
+#define SCSI_NOP1 5
+#define SCSI_MSG_OUT 6
+#define SCSI_MSG_IN 7
+
+/*;----SCSI MSG BYTE*/
+#define MSG_COMPLETE 0x00
+#define MSG_EXTENDED 0x01
+#define MSG_SAVE_PTR 0x02
+#define MSG_RESTORE_PTR 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_INITIATOR_ERROR 0x05
+#define MSG_ABORT 0x06
+#define MSG_REJECT_ 0x07
+#define MSG_NOP 0x08
+#define MSG_PARITY_ERROR 0x09
+#define MSG_LINK_CMD_COMPL 0x0A
+#define MSG_LINK_CMD_COMPL_FLG 0x0B
+#define MSG_BUS_RESET 0x0C
+#define MSG_ABORT_TAG 0x0D
+#define MSG_SIMPLE_QTAG 0x20
+#define MSG_HEAD_QTAG 0x21
+#define MSG_ORDER_QTAG 0x22
+#define MSG_IDENTIFY 0x80
+#define MSG_HOST_ID 0x0C0
+
+/*;----SCSI STATUS BYTE*/
+#define STATUS_GOOD 0x00
+#define CHECK_CONDITION_ 0x02
+#define STATUS_BUSY 0x08
+#define STATUS_INTERMEDIATE 0x10
+#define RESERVE_CONFLICT 0x18
+
+/* cmd->result */
+#define STATUS_MASK_ 0xFF
+#define MSG_MASK 0xFF00
+#define RETURN_MASK 0xFF0000
+
+/*
+** Inquiry Data format
+*/
+
+typedef struct _SCSIInqData { /* INQ */
+
+ UCHAR DevType; /* Periph Qualifier & Periph Dev Type*/
+ UCHAR RMB_TypeMod; /* rem media bit & Dev Type Modifier */
+ UCHAR Vers; /* ISO, ECMA, & ANSI versions */
+ UCHAR RDF; /* AEN, TRMIOP, & response data format*/
+ UCHAR AddLen; /* length of additional data */
+ UCHAR Res1; /* reserved */
+ UCHAR Res2; /* reserved */
+ UCHAR Flags; /* RelADr,Wbus32,Wbus16,Sync,etc. */
+ UCHAR VendorID[8]; /* Vendor Identification */
+ UCHAR ProductID[16]; /* Product Identification */
+ UCHAR ProductRev[4]; /* Product Revision */
+
+
+} SCSI_INQDATA, *PSCSI_INQDATA;
+
+
+/* Inquiry byte 0 masks */
+
+
+#define SCSI_DEVTYPE 0x1F /* Peripheral Device Type */
+#define SCSI_PERIPHQUAL 0xE0 /* Peripheral Qualifier */
+
+
+/* Inquiry byte 1 mask */
+
+#define SCSI_REMOVABLE_MEDIA 0x80 /* Removable Media bit (1=removable) */
+
+
+/* Peripheral Device Type definitions */
+
+#define SCSI_DASD 0x00 /* Direct-access Device */
+#define SCSI_SEQACESS 0x01 /* Sequential-access device */
+#define SCSI_PRINTER 0x02 /* Printer device */
+#define SCSI_PROCESSOR 0x03 /* Processor device */
+#define SCSI_WRITEONCE 0x04 /* Write-once device */
+#define SCSI_CDROM 0x05 /* CD-ROM device */
+#define SCSI_SCANNER 0x06 /* Scanner device */
+#define SCSI_OPTICAL 0x07 /* Optical memory device */
+#define SCSI_MEDCHGR 0x08 /* Medium changer device */
+#define SCSI_COMM 0x09 /* Communications device */
+#define SCSI_NODEV 0x1F /* Unknown or no device type */
+
+/*
+** Inquiry flag definitions (Inq data byte 7)
+*/
+
+#define SCSI_INQ_RELADR 0x80 /* device supports relative addressing*/
+#define SCSI_INQ_WBUS32 0x40 /* device supports 32 bit data xfers */
+#define SCSI_INQ_WBUS16 0x20 /* device supports 16 bit data xfers */
+#define SCSI_INQ_SYNC 0x10 /* device supports synchronous xfer */
+#define SCSI_INQ_LINKED 0x08 /* device supports linked commands */
+#define SCSI_INQ_CMDQUEUE 0x02 /* device supports command queueing */
+#define SCSI_INQ_SFTRE 0x01 /* device supports soft resets */
+
+
+/*
+;==========================================================
+; EEPROM byte offset
+;==========================================================
+*/
+typedef struct _EEprom
+{
+UCHAR EE_MODE1;
+UCHAR EE_SPEED;
+UCHAR xx1;
+UCHAR xx2;
+} EEprom, *PEEprom;
+
+#define EE_ADAPT_SCSI_ID 64
+#define EE_MODE2 65
+#define EE_DELAY 66
+#define EE_TAG_CMD_NUM 67
+
+/*; EE_MODE1 bits definition*/
+#define PARITY_CHK_ BIT0
+#define SYNC_NEGO_ BIT1
+#define EN_DISCONNECT_ BIT2
+#define SEND_START_ BIT3
+#define TAG_QUEUING_ BIT4
+
+/*; EE_MODE2 bits definition*/
+#define MORE2_DRV BIT0
+#define GREATER_1G BIT1
+#define RST_SCSI_BUS BIT2
+#define ACTIVE_NEGATION BIT3
+#define NO_SEEK BIT4
+#define LUN_CHECK BIT5
+
+#define ENABLE_CE 1
+#define DISABLE_CE 0
+#define EEPROM_READ 0x80
+
+/*
+;==========================================================
+; AMD 53C974 Registers bit Definition
+;==========================================================
+*/
+/*
+;====================
+; SCSI Register
+;====================
+*/
+
+/*; Command Reg.(+0CH) */
+#define DMA_COMMAND BIT7
+#define NOP_CMD 0
+#define CLEAR_FIFO_CMD 1
+#define RST_DEVICE_CMD 2
+#define RST_SCSI_BUS_CMD 3
+#define INFO_XFER_CMD 0x10
+#define INITIATOR_CMD_CMPLTE 0x11
+#define MSG_ACCEPTED_CMD 0x12
+#define XFER_PAD_BYTE 0x18
+#define SET_ATN_CMD 0x1A
+#define RESET_ATN_CMD 0x1B
+#define SELECT_W_ATN 0x42
+#define SEL_W_ATN_STOP 0x43
+#define EN_SEL_RESEL 0x44
+#define SEL_W_ATN2 0x46
+#define DATA_XFER_CMD INFO_XFER_CMD
+
+
+/*; SCSI Status Reg.(+10H) */
+#define INTERRUPT BIT7
+#define ILLEGAL_OP_ERR BIT6
+#define PARITY_ERR BIT5
+#define COUNT_2_ZERO BIT4
+#define GROUP_CODE_VALID BIT3
+#define SCSI_PHASE_MASK (BIT2+BIT1+BIT0)
+
+/*; Interrupt Status Reg.(+14H) */
+#define SCSI_RESET_ BIT7
+#define INVALID_CMD BIT6
+#define DISCONNECTED BIT5
+#define SERVICE_REQUEST BIT4
+#define SUCCESSFUL_OP BIT3
+#define RESELECTED BIT2
+#define SEL_ATTENTION BIT1
+#define SELECTED BIT0
+
+/*; Internal State Reg.(+18H) */
+#define SYNC_OFFSET_FLAG BIT3
+#define INTRN_STATE_MASK (BIT2+BIT1+BIT0)
+
+/*; Clock Factor Reg.(+24H) */
+#define CLK_FREQ_40MHZ 0
+#define CLK_FREQ_35MHZ (BIT2+BIT1+BIT0)
+#define CLK_FREQ_30MHZ (BIT2+BIT1)
+#define CLK_FREQ_25MHZ (BIT2+BIT0)
+#define CLK_FREQ_20MHZ BIT2
+#define CLK_FREQ_15MHZ (BIT1+BIT0)
+#define CLK_FREQ_10MHZ BIT1
+
+/*; Control Reg. 1(+20H) */
+#define EXTENDED_TIMING BIT7
+#define DIS_INT_ON_SCSI_RST BIT6
+#define PARITY_ERR_REPO BIT4
+#define SCSI_ID_ON_BUS (BIT2+BIT1+BIT0)
+
+/*; Control Reg. 2(+2CH) */
+#define EN_FEATURE BIT6
+#define EN_SCSI2_CMD BIT3
+
+/*; Control Reg. 3(+30H) */
+#define ID_MSG_CHECK BIT7
+#define EN_QTAG_MSG BIT6
+#define EN_GRP2_CMD BIT5
+#define FAST_SCSI BIT4 /* ;10MB/SEC */
+#define FAST_CLK BIT3 /* ;25 - 40 MHZ */
+
+/*; Control Reg. 4(+34H) */
+#define EATER_12NS 0
+#define EATER_25NS BIT7
+#define EATER_35NS BIT6
+#define EATER_0NS (BIT7+BIT6)
+#define NEGATE_REQACKDATA BIT2
+#define NEGATE_REQACK BIT3
+/*
+;====================
+; DMA Register
+;====================
+*/
+/*; DMA Command Reg.(+40H) */
+#define READ_DIRECTION BIT7
+#define WRITE_DIRECTION 0
+#define EN_DMA_INT BIT6
+#define MAP_TO_MDL BIT5
+#define DMA_DIAGNOSTIC BIT4
+#define DMA_IDLE_CMD 0
+#define DMA_BLAST_CMD BIT0
+#define DMA_ABORT_CMD BIT1
+#define DMA_START_CMD (BIT1+BIT0)
+
+/*; DMA Status Reg.(+54H) */
+#define PCI_MS_ABORT BIT6
+#define BLAST_COMPLETE BIT5
+#define SCSI_INTERRUPT BIT4
+#define DMA_XFER_DONE BIT3
+#define DMA_XFER_ABORT BIT2
+#define DMA_XFER_ERROR BIT1
+#define POWER_DOWN BIT0
+
+/*
+; DMA SCSI Bus and Ctrl.(+70H)
+;EN_INT_ON_PCI_ABORT
+*/
+
+/*
+;==========================================================
+; SCSI Chip register address offset
+;==========================================================
+*/
+#define CtcReg_Low 0x00
+#define CtcReg_Mid 0x04
+#define ScsiFifo 0x08
+#define ScsiCmd 0x0C
+#define Scsi_Status 0x10
+#define INT_Status 0x14
+#define Sync_Period 0x18
+#define Sync_Offset 0x1C
+#define CtrlReg1 0x20
+#define Clk_Factor 0x24
+#define CtrlReg2 0x2C
+#define CtrlReg3 0x30
+#define CtrlReg4 0x34
+#define CtcReg_High 0x38
+#define DMA_Cmd 0x40
+#define DMA_XferCnt 0x44
+#define DMA_XferAddr 0x48
+#define DMA_Wk_ByteCntr 0x4C
+#define DMA_Wk_AddrCntr 0x50
+#define DMA_Status 0x54
+#define DMA_MDL_Addr 0x58
+#define DMA_Wk_MDL_Cntr 0x5C
+#define DMA_ScsiBusCtrl 0x70
+
+#define StcReg_Low CtcReg_Low
+#define StcReg_Mid CtcReg_Mid
+#define Scsi_Dest_ID Scsi_Status
+#define Scsi_TimeOut INT_Status
+#define Intern_State Sync_Period
+#define Current_Fifo Sync_Offset
+#define StcReg_High CtcReg_High
+
+#define am_target Scsi_Status
+#define am_timeout INT_Status
+#define am_seq_step Sync_Period
+#define am_fifo_count Sync_Offset
+
+
+#define DC390_read8(address) \
+ inb(DC390_ioport + (address)))
+
+#define DC390_read16(address) \
+ inw(DC390_ioport + (address)))
+
+#define DC390_read32(address) \
+ inl(DC390_ioport + (address)))
+
+#define DC390_write8(address,value) \
+ outb((value), DC390_ioport + (address)))
+
+#define DC390_write16(address,value) \
+ outw((value), DC390_ioport + (address)))
+
+#define DC390_write32(address,value) \
+ outl((value), DC390_ioport + (address)))
+
+
+/* Configuration method #1 */
+#define PCI_CFG1_ADDRESS_REG 0xcf8
+#define PCI_CFG1_DATA_REG 0xcfc
+#define PCI_CFG1_ENABLE 0x80000000
+#define PCI_CFG1_TUPPLE(bus, device, function, register) \
+ (PCI_CFG1_ENABLE | (((bus) << 16) & 0xff0000) | \
+ (((device) << 11) & 0xf800) | (((function) << 8) & 0x700)| \
+ (((register) << 2) & 0xfc))
+
+/* Configuration method #2 */
+#define PCI_CFG2_ENABLE_REG 0xcf8
+#define PCI_CFG2_FORWARD_REG 0xcfa
+#define PCI_CFG2_ENABLE 0x0f0
+#define PCI_CFG2_TUPPLE(function) \
+ (PCI_CFG2_ENABLE | (((function) << 1) & 0xe))
+
+
+#endif /* TEK390_H */
diff --git a/sys/pci/wdc_p.c b/sys/pci/wdc_p.c
index f8ca641b72e2..67d9de617112 100644
--- a/sys/pci/wdc_p.c
+++ b/sys/pci/wdc_p.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: wdc_p.c,v 1.3 1997/08/02 14:33:14 bde Exp $
+ * $Id: wdc_p.c,v 1.2 1997/04/28 19:26:18 se Exp $
*/
/*
@@ -41,7 +41,7 @@
#define CMD640B_PCI_ID 0x06401095
-static const char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
static void wdc_pci_attach __P((pcici_t config_id, int unit));
static u_long wdc_pci_count = 0;
@@ -56,7 +56,7 @@ static struct pci_device wdc_pci_driver = {
DATA_SET (pcidevice_set, wdc_pci_driver);
-static const char*
+static char*
wdc_pci_probe (pcici_t tag, pcidi_t type)
{
if (type == CMD640B_PCI_ID)
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 25a90a471d8f..b46a3952dbcd 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: xrpu.c,v 1.5 1998/12/14 06:32:58 dillon Exp $
+ * $Id: xrpu.c,v 1.1 1998/05/30 18:28:11 phk Exp $
*
* A very simple device driver for PCI cards based on Xilinx 6200 series
* FPGA/RPU devices. Current Functionality is to allow you to open and
@@ -17,199 +17,52 @@
*
*/
-#include "xrpu.h"
+#ifndef DEVFS
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/timepps.h>
#include <sys/devfsext.h>
-#include <sys/xrpuio.h>
#include <pci/pcireg.h>
#include <pci/pcivar.h>
-static const char* xrpu_probe (pcici_t tag, pcidi_t type);
+static char* xrpu_probe (pcici_t tag, pcidi_t type);
static void xrpu_attach (pcici_t tag, int unit);
static u_long xrpu_count;
-static void xrpu_poll_pps(struct timecounter *tc);
-
-/*
- * Device driver initialization stuff
- */
-
-static d_open_t xrpu_open;
-static d_close_t xrpu_close;
-static d_ioctl_t xrpu_ioctl;
-static d_mmap_t xrpu_mmap;
-
-#define CDEV_MAJOR 100
-static struct cdevsw xrpudevsw = {
- xrpu_open, xrpu_close, noread, nowrite,
- xrpu_ioctl, nullstop, noreset, nodevtotty,
- seltrue, xrpu_mmap, nostrategy, "xrpu",
- NULL, -1
-};
-
-static MALLOC_DEFINE(M_XRPU, "xrpu", "XRPU related");
-
-#define dev2unit(devt) (minor(devt) & 0xff)
-#define dev2pps(devt) ((minor(devt) >> 16)-1)
-
-static struct softc {
- pcici_t tag;
- enum { NORMAL, TIMECOUNTER } mode;
- vm_offset_t virbase, physbase;
- u_int *virbase62;
- struct timecounter tc;
- u_int *trigger, *latch, dummy;
- struct {
- pps_params_t params;
- pps_info_t info;
- int cap;
- u_int *assert, last_assert;
- u_int *clear, last_clear;
- } pps[XRPU_MAX_PPS];
-} *softc[NXRPU];
-
-static unsigned
-xrpu_get_timecount(struct timecounter *tc)
-{
- struct softc *sc = tc->tc_priv;
-
- sc->dummy += *sc->trigger;
- return (*sc->latch & tc->tc_counter_mask);
-}
-
-void
-xrpu_poll_pps(struct timecounter *tc)
-{
- struct softc *sc = tc->tc_priv;
- int i;
- unsigned count1, ppscount;
-
- for (i = 0; i < XRPU_MAX_PPS; i++) {
- if (sc->pps[i].assert) {
- ppscount = *(sc->pps[i].assert) & tc->tc_counter_mask;
- do {
- count1 = ppscount;
- ppscount = *(sc->pps[i].assert) & tc->tc_counter_mask;
- } while (ppscount != count1);
- if (ppscount != sc->pps[i].last_assert) {
- timecounter_timespec(ppscount, &sc->pps[i].info.assert_timestamp);
- if (sc->pps[i].params.mode & PPS_OFFSETASSERT) {
- timespecadd(&sc->pps[i].info.assert_timestamp,
- &sc->pps[i].params.assert_offset);
- if (sc->pps[i].info.assert_timestamp.tv_nsec < 0) {
- sc->pps[i].info.assert_timestamp.tv_nsec += 1000000000;
- sc->pps[i].info.assert_timestamp.tv_sec -= 1;
- }
- }
- sc->pps[i].info.assert_sequence++;
- sc->pps[i].last_assert = ppscount;
- }
- }
- if (sc->pps[i].clear) {
- ppscount = *(sc->pps[i].clear) & tc->tc_counter_mask;
- do {
- count1 = ppscount;
- ppscount = *(sc->pps[i].clear) & tc->tc_counter_mask;
- } while (ppscount != count1);
- if (ppscount != sc->pps[i].last_clear) {
- timecounter_timespec(ppscount, &sc->pps[i].info.clear_timestamp);
- if (sc->pps[i].params.mode & PPS_OFFSETASSERT) {
- timespecadd(&sc->pps[i].info.clear_timestamp,
- &sc->pps[i].params.clear_offset);
- if (sc->pps[i].info.clear_timestamp.tv_nsec < 0) {
- sc->pps[i].info.clear_timestamp.tv_nsec += 1000000000;
- sc->pps[i].info.clear_timestamp.tv_sec -= 1;
- }
- }
- sc->pps[i].info.clear_sequence++;
- sc->pps[i].last_clear = ppscount;
- }
- }
- }
-}
+static vm_offset_t virbase, physbase;
static int
-xrpu_open(dev_t dev, int flag, int mode, struct proc *p)
+xrpuopen(dev_t dev, int flag, int mode, struct proc *p)
{
return (0);
}
static int
-xrpu_close(dev_t dev, int flag, int mode, struct proc *p)
+xrpuclose(dev_t dev, int flag, int mode, struct proc *p)
{
return (0);
}
static int
-xrpu_mmap(dev_t dev, vm_offset_t offset, int nprot)
+xrpummap(dev_t dev, int offset, int nprot)
{
- struct softc *sc = softc[dev2unit(dev)];
if (offset >= 0x1000000)
return (-1);
- return (i386_btop(sc->physbase + offset));
+ return (i386_btop(physbase + offset));
}
-static int
-xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
-{
- struct softc *sc = softc[dev2unit(dev)];
- int i, error;
-
- if (sc->mode == TIMECOUNTER) {
- i = dev2pps(dev);
- if (i < 0 || i >= XRPU_MAX_PPS)
- return ENODEV;
- if (!sc->pps[i].cap)
- return ENODEV;
- error = std_pps_ioctl(cmd, arg, &sc->pps[i].params,
- &sc->pps[i].info, sc->pps[i].cap);
- return (error);
- }
-
- if (cmd == XRPU_IOC_TIMECOUNTING) {
- struct xrpu_timecounting *xt = (struct xrpu_timecounting *)arg;
-
- /* Name SHALL be zero terminated */
- xt->xt_name[sizeof xt->xt_name - 1] = '\0';
- i = strlen(xt->xt_name);
- sc->tc.tc_name = (char *)malloc(i + 1, M_XRPU, M_WAITOK);
- strcpy(sc->tc.tc_name, xt->xt_name);
- sc->tc.tc_frequency = xt->xt_frequency;
- sc->tc.tc_get_timecount = xrpu_get_timecount;
- sc->tc.tc_poll_pps = xrpu_poll_pps;
- sc->tc.tc_priv = sc;
- sc->tc.tc_counter_mask = xt->xt_mask;
- sc->trigger = sc->virbase62 + xt->xt_addr_trigger;
- sc->latch = sc->virbase62 + xt->xt_addr_latch;
+/*
+ * Device driver initialization stuff
+ */
- for (i = 0; i < XRPU_MAX_PPS; i++) {
- if (xt->xt_pps[i].xt_addr_assert == 0
- && xt->xt_pps[i].xt_addr_clear == 0)
- continue;
- devfs_add_devswf(&xrpudevsw, (i+1)<<16, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "xpps%d", i);
- /* DEVFS */
- if (xt->xt_pps[i].xt_addr_assert) {
- sc->pps[i].assert = sc->virbase62 + xt->xt_pps[i].xt_addr_assert;
- sc->pps[i].cap |= PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
- }
- if (xt->xt_pps[i].xt_addr_clear) {
- sc->pps[i].clear = sc->virbase62 + xt->xt_pps[i].xt_addr_clear;
- sc->pps[i].cap |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR;
- }
- }
- sc->mode = TIMECOUNTER;
- init_timecounter(&sc->tc);
- return (0);
- }
- error = ENOTTY;
- return (error);
-}
+#define CDEV_MAJOR 100
+static struct cdevsw xrpudevsw = {
+ xrpuopen, xrpuclose, noread, nowrite,
+ noioctl, nullstop, noreset, nodevtotty,
+ seltrue, xrpummap, nostrategy, "xrpu",
+ NULL, -1
+};
/*
* PCI initialization stuff
@@ -225,15 +78,13 @@ static struct pci_device xrpu_device = {
DATA_SET (pcidevice_set, xrpu_device);
-static const char*
+static char*
xrpu_probe (pcici_t tag, pcidi_t typea)
{
- u_int id;
+ int data = pci_conf_read(tag, PCI_CLASS_REG);
+ u_int id = pci_conf_read(tag, PCI_ID_REG);
const char *vendor, *chip, *type;
- (void)pci_conf_read(tag, PCI_CLASS_REG);
- id = pci_conf_read(tag, PCI_ID_REG);
-
vendor = chip = type = 0;
if (id == 0x6216133e) {
@@ -245,27 +96,16 @@ xrpu_probe (pcici_t tag, pcidi_t typea)
static void
xrpu_attach (pcici_t tag, int unit)
{
- struct softc *sc;
- dev_t cdev = makedev(CDEV_MAJOR, unit);
-
- sc = (struct softc *)malloc(sizeof *sc, M_XRPU, M_WAITOK);
- softc[unit] = sc;
- bzero(sc, sizeof *sc);
-
- sc->tag = tag;
- sc->mode = NORMAL;
-
- pci_map_mem(tag, PCI_MAP_REG_START, &sc->virbase, &sc->physbase);
+ dev_t cdev = makedev(CDEV_MAJOR, 0);
- sc->virbase62 = (u_int *)(sc->virbase + 0x800000);
+ pci_map_mem(tag, PCI_MAP_REG_START, &virbase, &physbase);
- if (bootverbose)
- printf("Mapped physbase %#lx to virbase %#lx\n",
- (u_long)sc->physbase, (u_long)sc->virbase);
+ printf("Mapped physbase %#lx to virbase %#lx\n",
+ (u_long)physbase, (u_long)virbase);
- if (!unit)
- cdevsw_add(&cdev, &xrpudevsw, NULL);
+ cdevsw_add(&cdev, &xrpudevsw, NULL);
devfs_add_devswf(&xrpudevsw, 0, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "xrpu%d", unit);
+ "xrpu0");
}
+#endif /* DEVFS */
diff --git a/sys/sys/aio.h b/sys/sys/aio.h
index 53847c779f47..321ff4bad764 100644
--- a/sys/sys/aio.h
+++ b/sys/sys/aio.h
@@ -1,3 +1,6 @@
+#ifndef _AIO_H_
+#define _AIO_H_
+
/*
* Copyright (c) 1997 John S. Dyson. All rights reserved.
*
@@ -13,21 +16,17 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: aio.h,v 1.8 1998/04/12 03:09:43 dyson Exp $
+ * $Id: aio.h,v 1.7 1998/03/28 11:50:34 dufault Exp $
*/
-#ifndef _SYS_AIO_H_
-#define _SYS_AIO_H_
-
#include <sys/types.h>
#include <sys/signal.h>
-
/*
* Returned by aio_cancel:
* (Note that FreeBSD's aio is not cancellable -- yet.)
*/
#define AIO_CANCELED 0x1
-#define AIO_NOTCANCELED 0x2
+#define AIO_NOTCANCELED 0x2
#define AIO_ALLDONE 0x3
/*
@@ -80,7 +79,7 @@ struct __aiocb_private {
typedef struct aiocb {
int aio_fildes; /* File descriptor */
off_t aio_offset; /* File offset for I/O */
- volatile void *aio_buf; /* I/O buffer in process space */
+ volatile void *aio_buf; /* I/O buffer in process space */
size_t aio_nbytes; /* Number of bytes for I/O */
struct sigevent aio_sigevent; /* Signal to deliver */
int aio_lio_opcode; /* LIO opcode */
@@ -89,17 +88,15 @@ typedef struct aiocb {
} aiocb_t;
#ifndef KERNEL
-
-__BEGIN_DECLS
/*
* Asynchronously read from a file
*/
-int aio_read(struct aiocb *);
+int aio_read( struct aiocb *iocb);
/*
* Asynchronously write to file
*/
-int aio_write(struct aiocb *);
+int aio_write( struct aiocb *iocb);
/*
* List I/O Asynchronously/synchronously read/write to/from file
@@ -107,14 +104,15 @@ int aio_write(struct aiocb *);
* "acb_list" is an array of "nacb_listent" I/O control blocks.
* when all I/Os are complete, the optional signal "sig" is sent.
*/
-int lio_listio(int, struct aiocb * const [], int, struct sigevent *);
+int lio_listio( int lio_mode, struct aiocb * const acb_list[],
+ int nacb_listent, struct sigevent *sig);
/*
* Get completion status
* returns EINPROGRESS until I/O is complete.
* this routine does not block.
*/
-int aio_error(const struct aiocb *);
+int aio_error( const struct aiocb *iocb);
/*
* Finish up I/O, releasing I/O resources and returns the value
@@ -122,29 +120,28 @@ int aio_error(const struct aiocb *);
* This routine must be called once and only once for each
* I/O control block who has had I/O associated with it.
*/
-ssize_t aio_return(struct aiocb *);
+ssize_t aio_return( struct aiocb *iocb);
/*
* Cancel I/O -- implemented only to return AIO_NOTCANCELLED or
* AIO_ALLDONE. No cancellation operation will occur.
*/
-int aio_cancel(int, struct aiocb *);
+int aio_cancel( int fd, struct aiocb *iocb);
/*
* Suspend until all specified I/O or timeout is complete.
*/
-int aio_suspend(const struct aiocb * const[], int, const struct timespec *);
+int aio_suspend( const struct aiocb * const acb_list[], int nacb_listent,
+ const struct timespec *tm);
/*
* Retrieve the status of the specified I/O request.
*/
-int aio_error(const struct aiocb *);
-
-__END_DECLS
+int aio_error( const struct aiocb *aiocbp);
#else
-void aio_proc_rundown(struct proc *p);
+void aio_proc_rundown( struct proc *p);
#endif
diff --git a/sys/sys/alogio.h b/sys/sys/alogio.h
new file mode 100644
index 000000000000..99fd74e8bd56
--- /dev/null
+++ b/sys/sys/alogio.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1998 Scottibox
+ * 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
+ * in this position and unchanged.
+ * 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
+ *
+ * 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.
+ *
+ * Industrial Computer Source model AIO8-P
+ * 128 channel MUX capability via daisy chained AT-16P units
+ * alogio.h, definitions for alog ioctl(), last revised January 6 1998
+ * See http://www.scottibox.com
+ * http://www.indcompsrc.com/products/data/html/aio8g-p.html
+ * http://www.indcompsrc.com/products/data/html/at16-p.html
+ *
+ * Written by: Jamil J. Weatherbee <jamil@scottibox.com>
+ *
+ */
+
+#ifndef _SYS_ALOGIO_H_
+#define _SYS_ALOGIO_H_
+
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
+/* Note: By default A/D conversions are started when a channel is open */
+
+/* Halt clocked A/D conversion on an open channel */
+#define AD_STOP _IO('A', 100)
+/* Restart clocked A/D conversion on an open channel */
+#define AD_START _IO('A', 101)
+/* Get the number of entries the fifo for this channel will hold */
+#define AD_FIFOSIZE_GET _IOR('A', 102, int)
+/* Set the minimum number of entries a fifo must contain before it
+ * notifies a poll() or read() that is waiting for it to fill */
+#define AD_FIFO_TRIGGER_SET _IOW('A', 103, int)
+/* This gets the the fifo trigger setting */
+#define AD_FIFO_TRIGGER_GET _IOR('A', 104, int)
+
+#endif
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 191fdbcad2ff..7e702a99434d 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id: buf.h,v 1.60 1998/10/31 14:05:11 peter Exp $
+ * $Id: buf.h,v 1.58 1998/09/25 17:34:49 peter Exp $
*/
#ifndef _SYS_BUF_H_
@@ -44,6 +44,8 @@
#include <sys/queue.h>
+#define NOLIST ((struct buf *)0x87654321)
+
struct buf;
struct mount;
struct vnode;
@@ -81,14 +83,13 @@ struct iodone_chain {
*/
struct buf {
LIST_ENTRY(buf) b_hash; /* Hash chain. */
- TAILQ_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
+ LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
struct proc *b_proc; /* Associated proc; NULL if kernel. */
long b_flags; /* B_* flags. */
unsigned short b_qindex; /* buffer queue index */
unsigned char b_usecount; /* buffer use count */
- unsigned char b_xflags; /* extra flags */
int b_error; /* Errno value. */
long b_bufsize; /* Allocated buffer size. */
long b_bcount; /* Valid bytes in buffer. */
@@ -169,12 +170,6 @@ struct buf {
"\17locked\16inval\15avail2\14error\13eintr\12done\11freebuf" \
"\10delwri\7call\6cache\5busy\4bad\3async\2needcommit\1age"
-/*
- * These flags are kept in b_xflags.
- */
-#define B_VNDIRTY 0x01 /* On vnode dirty list */
-#define B_VNCLEAN 0x02 /* On vnode clean list */
-
#define NOOFFSET (-1LL) /* No buffer offset calculated yet */
struct buf_queue_head {
@@ -184,20 +179,6 @@ struct buf_queue_head {
struct buf *switch_point;
};
-/*
- * This structure describes a clustered I/O. It is stored in the b_saveaddr
- * field of the buffer on which I/O is done. At I/O completion, cluster
- * callback uses the structure to parcel I/O's to individual buffers, and
- * then free's this structure.
- */
-struct cluster_save {
- long bs_bcount; /* Saved b_bcount. */
- long bs_bufsize; /* Saved b_bufsize. */
- void *bs_saveaddr; /* Saved b_addr. */
- int bs_nchildren; /* Number of associated buffers. */
- struct buf **bs_children; /* List of associated buffers. */
-};
-
static __inline void bufq_init __P((struct buf_queue_head *head));
static __inline void bufq_insert_tail __P((struct buf_queue_head *head,
@@ -236,8 +217,9 @@ bufq_remove(struct buf_queue_head *head, struct buf *bp)
head->insert_point = TAILQ_PREV(bp, buf_queue, b_act);
if (head->insert_point == NULL)
head->last_pblkno = 0;
- } else if (bp == TAILQ_FIRST(&head->queue))
+ } else if (bp == TAILQ_FIRST(&head->queue)) {
head->last_pblkno = bp->b_pblkno;
+ }
TAILQ_REMOVE(&head->queue, bp, b_act);
if (TAILQ_FIRST(&head->queue) == head->switch_point)
head->switch_point = NULL;
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index d0bd5647dbf3..bccadd6302f0 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bus.h,v 1.7 1998/11/14 21:58:41 wollman Exp $
+ * $Id: bus.h,v 1.5 1998/07/22 08:35:48 dfr Exp $
*/
#ifndef _SYS_BUS_H_
@@ -43,20 +43,12 @@ typedef struct device_op_desc *device_op_desc_t;
typedef void driver_intr_t(void*);
-/*
- * We define this in terms of bits because some devices may belong
- * to multiple classes (and therefore need to be included in
- * multiple interrupt masks, which is what this really serves to
- * indicate. Buses which do interrupt remapping will want to
- * change their type to reflect what sort of devices are underneath.
- */
typedef enum driver_type {
- DRIVER_TYPE_TTY = 1,
- DRIVER_TYPE_BIO = 2,
- DRIVER_TYPE_NET = 4,
- DRIVER_TYPE_CAM = 8,
- DRIVER_TYPE_MISC = 16,
- DRIVER_TYPE_FAST = 128
+ DRIVER_TYPE_TTY,
+ DRIVER_TYPE_BIO,
+ DRIVER_TYPE_NET,
+ DRIVER_TYPE_MISC,
+ MAX_DRIVER_TYPE
} driver_type_t;
typedef int (*devop_t)(void);
@@ -71,7 +63,6 @@ struct driver {
device_method_t *methods; /* method table */
driver_type_t type;
size_t softc; /* size of device softc struct */
- void *priv; /* driver private data */
TAILQ_ENTRY(driver) link; /* list of devices on bus */
device_ops_t ops; /* compiled method table */
};
@@ -89,113 +80,76 @@ enum device_state {
*/
extern device_t root_bus;
extern devclass_t root_devclass;
-void root_bus_configure(void);
+void root_bus_configure(void);
/*
* Useful functions for implementing busses.
*/
-struct resource;
-
-int bus_generic_activate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r);
-struct resource *bus_generic_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end,
- u_long count, u_int flags);
-int bus_generic_attach(device_t dev);
-int bus_generic_deactivate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r);
-int bus_generic_detach(device_t dev);
-void bus_generic_print_child(device_t dev, device_t child);
-int bus_generic_read_ivar(device_t dev, device_t child, int which,
- uintptr_t *result);
-int bus_generic_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-int bus_generic_resume(device_t dev);
-int bus_generic_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-int bus_generic_shutdown(device_t dev);
-int bus_generic_suspend(device_t dev);
-int bus_generic_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
-int bus_generic_write_ivar(device_t dev, device_t child, int which,
- uintptr_t value);
-
-/*
- * Wrapper functions for the BUS_*_RESOURCE methods to make client code
- * a little simpler.
- */
-struct resource *bus_alloc_resource(device_t dev, int type, int *rid,
- u_long start, u_long end, u_long count,
- u_int flags);
-int bus_activate_resource(device_t dev, int type, int rid,
- struct resource *r);
-int bus_deactivate_resource(device_t dev, int type, int rid,
- struct resource *r);
-int bus_release_resource(device_t dev, int type, int rid,
- struct resource *r);
+int bus_generic_attach(device_t dev);
+int bus_generic_detach(device_t dev);
+int bus_generic_shutdown(device_t dev);
+void bus_generic_print_child(device_t dev, device_t child);
+int bus_generic_read_ivar(device_t dev, device_t child, int which, u_long *result);
+int bus_generic_write_ivar(device_t dev, device_t child, int which, u_long value);
+void *bus_generic_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+int bus_generic_connect_intr(device_t dev, void *ih);
/*
* Access functions for device.
*/
-device_t device_add_child(device_t dev, const char *name, int unit,
- void *ivp);
-device_t device_add_child_after(device_t dev, device_t place,
- const char *name, int unit, void *ivp);
-void device_busy(device_t dev);
-int device_delete_child(device_t dev, device_t child);
-int device_detach(device_t dev);
-void device_disable(device_t dev);
-void device_enable(device_t dev);
-device_t device_find_child(device_t dev, const char *classname,
- int unit);
-const char *device_get_desc(device_t dev);
-devclass_t device_get_devclass(device_t dev);
-driver_t *device_get_driver(device_t dev);
-device_t device_get_parent(device_t dev);
-int device_get_children(device_t dev, device_t **listp, int *countp);
-void *device_get_ivars(device_t dev);
-const char *device_get_name(device_t dev);
-void *device_get_softc(device_t dev);
-device_state_t device_get_state(device_t dev);
-int device_get_unit(device_t dev);
-int device_is_enabled(device_t dev);
-int device_is_alive(device_t dev); /* did probe succeed? */
-void device_print_prettyname(device_t dev);
-void device_printf(device_t dev, const char *, ...) __printflike(2, 3);
-int device_probe_and_attach(device_t dev);
-void device_set_desc(device_t dev, const char* desc);
-int device_set_devclass(device_t dev, const char *classname);
-int device_set_driver(device_t dev, driver_t *driver);
-int device_shutdown(device_t dev);
-void device_unbusy(device_t dev);
+device_t device_get_parent(device_t dev);
+device_t device_add_child(device_t dev, const char *name,
+ int unit, void *ivars);
+device_t device_add_child_after(device_t dev, device_t place, const char *name,
+ int unit, void *ivars);
+device_t device_find_child(device_t dev, const char *classname, int unit);
+int device_delete_child(device_t dev, device_t child);
+driver_t *device_get_driver(device_t dev);
+devclass_t device_get_devclass(device_t dev);
+int device_set_devclass(device_t dev, const char *classname);
+int device_set_driver(device_t dev, driver_t *driver);
+void device_set_desc(device_t dev, const char* desc);
+const char* device_get_desc(device_t dev);
+const char* device_get_name(device_t dev);
+int device_get_unit(device_t dev);
+void *device_get_softc(device_t dev);
+void *device_get_ivars(device_t dev);
+device_state_t device_get_state(device_t dev);
+void device_enable(device_t dev);
+void device_disable(device_t dev);
+void device_busy(device_t dev);
+void device_unbusy(device_t dev);
+int device_is_enabled(device_t dev);
+int device_is_alive(device_t dev); /* did probe succeed? */
+int device_probe_and_attach(device_t dev);
+int device_detach(device_t dev);
+int device_shutdown(device_t dev);
/*
* Access functions for devclass.
*/
-int devclass_add_driver(devclass_t dc, driver_t *driver);
-int devclass_delete_driver(devclass_t dc, driver_t *driver);
-devclass_t devclass_find(const char *classname);
-driver_t *devclass_find_driver(devclass_t dc, const char *classname);
-const char *devclass_get_name(devclass_t dc);
-device_t devclass_get_device(devclass_t dc, int unit);
-void *devclass_get_softc(devclass_t dc, int unit);
-int devclass_get_devices(devclass_t dc, device_t **listp, int *countp);
-int devclass_get_maxunit(devclass_t dc);
+devclass_t devclass_find(const char *classname);
+int devclass_add_driver(devclass_t dc, driver_t *driver);
+int devclass_delete_driver(devclass_t dc, driver_t *driver);
+driver_t *devclass_find_driver(devclass_t dc, const char *classname);
+const char *devclass_get_name(devclass_t dc);
+device_t devclass_get_device(devclass_t dc, int unit);
+void *devclass_get_softc(devclass_t dc, int unit);
+int devclass_get_devices(devclass_t dc, device_t **devlistp, int *devcountp);
+int devclass_get_maxunit(devclass_t dc);
/*
* Access functions for device resources.
*/
-int resource_int_value(const char *name, int unit, char *resname,
- int *result);
-int resource_long_value(const char *name, int unit, char *resname,
- long *result);
-int resource_string_value(const char *name, int unit, char *resname,
- char **result);
-int resource_query_string(int i, char *resname, char *value);
-char *resource_query_name(int i);
-int resource_query_unit(int i);
+int resource_int_value(const char *name, int unit,
+ char *resname, int *result);
+int resource_long_value(const char *name, int unit,
+ char *resname, long *result);
+int resource_string_value(const char *name, int unit,
+ char *resname, char **result);
+int resource_query_string(int i, char *resname, char *value);
+char *resource_query_name(int i);
+int resource_query_unit(int i);
/*
* Shorthand for constructing method tables.
@@ -208,52 +162,28 @@ int resource_query_unit(int i);
#include "device_if.h"
#include "bus_if.h"
-struct module;
-
-int driver_module_handler(struct module *, int, void *);
+#ifdef _SYS_MODULE_H_
/*
* Module support for automatically adding drivers to busses.
*/
struct driver_module_data {
- int (*dmd_chainevh)(struct module *, int, void *);
- void *dmd_chainarg;
- const char *dmd_busname;
- driver_t **dmd_drivers;
- int dmd_ndrivers;
- devclass_t *dmd_devclass;
+ modeventhand_t chainevh;
+ void* chainarg;
+ const char* busname;
+ driver_t* driver;
+ devclass_t* devclass;
};
-#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \
- \
-static driver_t *name##_##busname##_driver_list[] = { &driver }; \
-static struct driver_module_data name##_##busname##_driver_mod = { \
- evh, arg, \
- #busname, \
- name##_##busname##_driver_list, \
- (sizeof name##_##busname##_driver_list) / \
- (sizeof name##_##busname##_driver_list[0]), \
- &devclass \
-}; \
- \
-static moduledata_t name##_##busname##_mod = { \
- #busname "/" #name, \
- driver_module_handler, \
- &name##_##busname##_driver_mod \
-}; \
-DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \
- SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
+int driver_module_handler(module_t, modeventtype_t, void*);
-#define MULTI_DRIVER_MODULE(name, busname, drivers, devclass, evh, arg) \
+#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \
\
-static driver_t name##_##busname##_driver_list[] = drivers; \
static struct driver_module_data name##_##busname##_driver_mod = { \
evh, arg, \
#busname, \
- name##_##busname##_driver_list, \
- (sizeof name##_##busname##_driver_list) / \
- (sizeof name##_##busname##_driver_list[0]), \
- &devclass \
+ &driver, \
+ &devclass, \
}; \
\
static moduledata_t name##_##busname##_mod = { \
@@ -274,15 +204,7 @@ static struct cdevsw_module_data name##_##busname##_cdevsw_mod = { \
DRIVER_MODULE(name, busname, driver, devclass, \
cdevsw_module_handler, &name##_##busname##_cdevsw_mod)
-#define BDEV_DRIVER_MODULE(name, busname, driver, devclass, \
- bmajor, cmajor, devsw, evh, arg) \
- \
-static struct bdevsw_module_data name##_##busname##_bdevsw_mod = { \
- evh, arg, makedev(bmajor, 0), makedev(cmajor, 0), &devsw \
-}; \
- \
-DRIVER_MODULE(name, busname, driver, devclass, \
- bdevsw_module_handler, &name##_##busname##_bdevsw_mod)
+#endif
#endif /* KERNEL */
diff --git a/sys/sys/bus_private.h b/sys/sys/bus_private.h
index 8dfa87c7a58d..50fdf857066f 100644
--- a/sys/sys/bus_private.h
+++ b/sys/sys/bus_private.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bus_private.h,v 1.3 1998/07/22 08:35:50 dfr Exp $
+ * $Id: bus_private.h,v 1.2 1998/06/14 13:46:10 dfr Exp $
*/
#ifndef _SYS_BUS_PRIVATE_H_
@@ -54,7 +54,7 @@ typedef enum {
RES_INT, RES_STRING, RES_LONG
} resource_type;
-struct config_resource {
+struct resource {
char *name;
resource_type type;
union {
@@ -68,7 +68,7 @@ struct config_device {
char *name; /* e.g. "lpt", "wdc" etc */
int unit;
int resource_count;
- struct config_resource *resources;
+ struct resource *resources;
};
/*
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 587e7d72ecac..03ee5b4b7108 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id: cdefs.h,v 1.23 1998/10/29 04:41:24 jdp Exp $
+ * $Id: cdefs.h,v 1.21 1998/08/24 06:17:01 bde Exp $
*/
#ifndef _SYS_CDEFS_H_
@@ -136,20 +136,15 @@
*/
#if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7
#define __printflike(fmtarg, firstvararg)
+#define __printf0like(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#else
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
-#define __scanflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
-#endif
-
-/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
-#if __FreeBSD_cc_version >= 300001
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
-#else
-#define __printf0like(fmtarg, firstvararg)
+#define __scanflike(fmtarg, firstvararg) \
+ __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#endif
#ifdef __GNUC__
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 1a00cb466a05..80e4e3684974 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id: conf.h,v 1.47 1998/11/10 21:45:18 dfr Exp $
+ * $Id: conf.h,v 1.44 1998/08/20 06:10:42 bde Exp $
*/
#ifndef _SYS_CONF_H_
@@ -66,7 +66,7 @@ typedef void d_stop_t __P((struct tty *tp, int rw));
typedef int d_reset_t __P((dev_t dev));
typedef struct tty *d_devtotty_t __P((dev_t dev));
typedef int d_poll_t __P((dev_t dev, int events, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot));
+typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
typedef int l_open_t __P((dev_t dev, struct tty *tp));
typedef int l_close_t __P((struct tty *tp, int flag));
@@ -199,26 +199,29 @@ d_close_t nullclose;
l_read_t l_noread;
l_write_t l_nowrite;
-struct module;
+/*
+ * XXX This is ugly.
+ */
+#ifdef _SYS_MODULE_H_
struct cdevsw_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- dev_t dev; /* device major to use */
- struct cdevsw *cdevsw; /* device functions */
+ modeventhand_t chainevh; /* next event handler in chain */
+ void* chainarg; /* arg for next event handler */
+ dev_t dev; /* device major to use */
+ struct cdevsw* cdevsw; /* device functions */
};
struct bdevsw_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- int bdev; /* device major to use */
- int cdev; /* device major to use */
- struct cdevsw *cdevsw; /* device functions */
+ modeventhand_t chainevh; /* next event handler in chain */
+ void* chainarg; /* arg for next event handler */
+ int bdev; /* device major to use */
+ int cdev; /* device major to use */
+ struct cdevsw* cdevsw; /* device functions */
};
#define CDEV_MODULE(name, major, devsw, evh, arg) \
static struct cdevsw_module_data name##_cdevsw_mod = { \
- evh, arg, major == NODEV ? NODEV : makedev(major, 0), &devsw \
+ evh, arg, makedev(major, 0), &devsw \
}; \
\
static moduledata_t name##_mod = { \
@@ -230,8 +233,7 @@ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+major)
#define BDEV_MODULE(name, bdev, cdev, devsw, evh, arg) \
static struct bdevsw_module_data name##_bdevsw_mod = { \
- evh, arg, mdev == NODEV ? NODEV : makedev(bdev, 0), \
- cdev == NODEV ? NODEV : makedev(cdev, 0), &devsw \
+ evh, arg, makedev(bdev, 0), makedev(cdev, 0), &devsw \
}; \
\
static moduledata_t name##_mod = { \
@@ -241,8 +243,10 @@ static moduledata_t name##_mod = { \
}; \
DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+cdev)
-int cdevsw_module_handler __P((struct module *mod, int what, void *arg));
-int bdevsw_module_handler __P((struct module *mod, int what, void *arg));
+int cdevsw_module_handler __P((module_t mod, modeventtype_t what, void* arg));
+int bdevsw_module_handler __P((module_t mod, modeventtype_t what, void* arg));
+
+#endif /* _SYS_MODULE_H_ */
int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
void cdevsw_add_generic __P((int bdev, int cdev, struct cdevsw *cdevsw));
diff --git a/sys/sys/copyright.h b/sys/sys/copyright.h
index f29bc7e0764b..c5cb1caa7f90 100644
--- a/sys/sys/copyright.h
+++ b/sys/sys/copyright.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: copyright.h,v 1.4 1998/01/06 11:44:55 wosch Exp $
+ * $Id: copyright.h,v 1.3 1997/12/31 11:04:01 wosch Exp $
*/
@@ -30,7 +30,7 @@
/* FreeBSD */
#define COPYRIGHT_FreeBSD \
- "Copyright (c) 1992-1999 FreeBSD Inc.\n"
+ "Copyright (c) 1992-1998 FreeBSD Inc.\n"
/* Berkeley */
#define COPYRIGHT_UCB \
diff --git a/sys/sys/devfsext.h b/sys/sys/devfsext.h
index 425cbff00f9f..3086fba4e92f 100644
--- a/sys/sys/devfsext.h
+++ b/sys/sys/devfsext.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfsext.h,v 1.21 1998/07/13 06:45:16 bde Exp $
+ * $Id: devfsext.h,v 1.20 1998/04/28 00:10:52 julian Exp $
*/
#ifndef _SYS_DEVFSEXT_H_
@@ -43,7 +43,7 @@ void *devfs_add_devswf __P((void *devsw, int minor, int chrblk, uid_t uid,
* at the moment there is nothing you can do with it that you couldn't do
* with the original cookie. ( XXX this might be something I should change )
*/
-void *devfs_makelink __P((void *original, char *fmt, ...)) __printflike(2, 3);
+void *devfs_link __P((void *original, char *fmt, ...)) __printflike(2, 3);
/*
* Remove all instances of a device you have made. INCLUDING LINKS.
diff --git a/sys/sys/devicestat.h b/sys/sys/devicestat.h
index 8ffd04967c63..03d106a4f561 100644
--- a/sys/sys/devicestat.h
+++ b/sys/sys/devicestat.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devicestat.h,v 1.2 1998/09/20 00:10:58 ken Exp $
+ * $Id: devicestat.h,v 1.1 1998/09/15 08:16:17 gibbs Exp $
*/
#ifndef _DEVICESTAT_H
@@ -182,7 +182,7 @@ struct devstat {
};
#ifdef KERNEL
-void devstat_add_entry(struct devstat *ds, const char *dev_name,
+void devstat_add_entry(struct devstat *ds, char *dev_name,
int unit_number, u_int32_t block_size,
devstat_support_flags flags,
devstat_type_flags device_type);
diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h
index 33b2d7f91865..854ec380e42d 100644
--- a/sys/sys/dirent.h
+++ b/sys/sys/dirent.h
@@ -31,14 +31,12 @@
* SUCH DAMAGE.
*
* @(#)dirent.h 8.3 (Berkeley) 8/10/94
- * $Id: dirent.h,v 1.8 1997/04/10 13:54:19 bde Exp $
+ * $Id: dirent.h,v 1.7 1997/02/22 09:45:02 peter Exp $
*/
#ifndef _SYS_DIRENT_H_
#define _SYS_DIRENT_H_
-#include <machine/ansi.h>
-
/*
* The dirent structure defines the format of directory entries returned by
* the getdirentries(2) system call.
@@ -51,10 +49,10 @@
*/
struct dirent {
- __uint32_t d_fileno; /* file number of entry */
- __uint16_t d_reclen; /* length of this record */
- __uint8_t d_type; /* file type, see below */
- __uint8_t d_namlen; /* length of string in d_name */
+ u_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t d_namlen; /* length of string in d_name */
#ifdef _POSIX_SOURCE
char d_name[255 + 1]; /* name must be no longer than this */
#else
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index e2845a7807fa..dcdbeaa2a40b 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)disklabel.h 8.2 (Berkeley) 7/10/94
- * $Id: disklabel.h,v 1.35 1998/08/24 08:45:37 dfr Exp $
+ * $Id: disklabel.h,v 1.34 1998/07/12 16:48:08 dfr Exp $
*/
#ifndef _SYS_DISKLABEL_H_
@@ -95,7 +95,7 @@ struct disklabel {
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
+ * as found in /usr/mdec. These are returned when using
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
union {
diff --git a/sys/sys/domain.h b/sys/sys/domain.h
index b4d352a4eb7d..e0b004c44553 100644
--- a/sys/sys/domain.h
+++ b/sys/sys/domain.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id: domain.h,v 1.10 1997/11/18 06:48:43 bde Exp $
+ * $Id: domain.h,v 1.9 1997/02/22 09:45:09 peter Exp $
*/
#ifndef _SYS_DOMAIN_H_
@@ -66,7 +66,6 @@ struct domain {
#ifdef KERNEL
extern struct domain *domains;
extern struct domain localdomain;
-extern int net_add_domain(struct domain *dp);
#define DOMAIN_SET(name) \
DATA_SET(domain_set, name ## domain)
diff --git a/sys/sys/errno.h b/sys/sys/errno.h
index adf0eff0e773..0430bfedf38c 100644
--- a/sys/sys/errno.h
+++ b/sys/sys/errno.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
- * $Id: errno.h,v 1.10 1998/04/30 09:38:03 jb Exp $
+ * $Id: errno.h,v 1.9 1998/04/13 17:45:00 sos Exp $
*/
#ifndef _SYS_ERRNO_H_
@@ -161,12 +161,9 @@ __END_DECLS
#define EFTYPE 79 /* Inappropriate file type or format */
#define EAUTH 80 /* Authentication error */
#define ENEEDAUTH 81 /* Need authenticator */
-#define EIDRM 82 /* Identifier removed */
-#define ENOMSG 83 /* No message of desired type */
-#define EOVERFLOW 84 /* Value to large to be stored in data type */
-#define ECANCELED 85 /* Operation canceled */
-#define EILSEQ 86 /* Illegal byte sequence */
-#define ELAST 86 /* Must be equal largest errno */
+#define EIDRM 82 /* Identifier removed */
+#define ENOMSG 83 /* No message of desired type */
+#define ELAST 83 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
diff --git a/sys/sys/exec.h b/sys/sys/exec.h
index 2ed6112c3b24..3df1b15e977d 100644
--- a/sys/sys/exec.h
+++ b/sys/sys/exec.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)exec.h 8.3 (Berkeley) 1/21/94
- * $Id: exec.h,v 1.20 1998/11/15 15:33:52 bde Exp $
+ * $Id: exec.h,v 1.18 1998/03/02 05:47:40 peter Exp $
*/
#ifndef _SYS_EXEC_H_
@@ -60,7 +60,8 @@ struct ps_strings {
/*
* Address of ps_strings structure (in user space).
*/
-#define PS_STRINGS (USRSTACK - sizeof(struct ps_strings))
+#define PS_STRINGS ((struct ps_strings *) \
+ (USRSTACK - sizeof(struct ps_strings)))
#define SPARE_USRSPACE 256
struct image_params;
@@ -84,7 +85,8 @@ int exec_unregister __P((const struct execsw *));
#ifndef LKM
#include <sys/module.h>
#define EXEC_SET(name, execsw_arg) \
- static int name ## _modevent(module_t mod, int type, void *data) \
+ static int name ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
{ \
struct execsw *exec = (struct execsw *)data; \
int error = 0; \
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h
index 92b5562ff91d..444c3ef139a7 100644
--- a/sys/sys/filedesc.h
+++ b/sys/sys/filedesc.h
@@ -31,14 +31,12 @@
* SUCH DAMAGE.
*
* @(#)filedesc.h 8.1 (Berkeley) 6/2/93
- * $Id: filedesc.h,v 1.14 1998/11/11 10:04:12 truckman Exp $
+ * $Id: filedesc.h,v 1.12 1997/10/12 20:25:57 phk Exp $
*/
#ifndef _SYS_FILEDESC_H_
#define _SYS_FILEDESC_H_
-#include <sys/queue.h>
-
/*
* This structure is used for the management of descriptors. It may be
* shared by multiple processes.
@@ -93,30 +91,6 @@ struct filedesc0 {
*/
#define OFILESIZE (sizeof(struct file *) + sizeof(char))
-/*
- * This structure that holds the information needed to send a SIGIO or
- * a SIGURG signal to a process or process group when new data arrives
- * on a device or socket. The structure is placed on an SLIST belonging
- * to the proc or pgrp so that the entire list may be revoked when the
- * process exits or the process group disappears.
- */
-struct sigio {
- union {
- struct proc *siu_proc; /* process to receive SIGIO/SIGURG */
- struct pgrp *siu_pgrp; /* process group to receive ... */
- } sio_u;
- SLIST_ENTRY(sigio) sio_pgsigio; /* sigio's for process or group */
- struct sigio **sio_myref; /* location of the pointer that holds
- * the reference to this structure */
- struct ucred *sio_ucred; /* current credentials */
- uid_t sio_ruid; /* real user id */
- pid_t sio_pgid; /* pgid for signals */
-};
-#define sio_proc sio_u.siu_proc
-#define sio_pgrp sio_u.siu_pgrp
-
-SLIST_HEAD(sigiolst, sigio);
-
#ifdef KERNEL
/*
* Kernel global variables and routines.
@@ -135,10 +109,6 @@ void fdcloseexec __P((struct proc *p));
int getvnode __P((struct filedesc *fdp, int fd, struct file **fpp));
int fdissequential __P((struct file *));
void fdsequential __P((struct file *, int));
-pid_t fgetown __P((struct sigio *));
-int fsetown __P((pid_t, struct sigio **));
-void funsetown __P((struct sigio *));
-void funsetownlst __P((struct sigiolst *));
#endif
#endif
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index 04bafbadd31f..8c3a787adc78 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact.h,v 1.17 1998/03/02 05:47:43 peter Exp $
+ * $Id: imgact.h,v 1.16 1998/01/11 21:34:43 dyson Exp $
*/
#ifndef _SYS_IMGACT_H_
@@ -53,7 +53,6 @@ struct image_params {
char interpreter_name[64]; /* name of the interpreter */
void *auxargs; /* ELF Auxinfo structure pointer */
struct vm_page *firstpage; /* first page that we mapped */
- char *fname; /* pointer to filename of executable (user space) */
};
#ifdef KERNEL
diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h
index d841a39c4b67..d44e4aafed7a 100644
--- a/sys/sys/imgact_elf.h
+++ b/sys/sys/imgact_elf.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.h,v 1.9 1998/09/14 05:36:51 jdp Exp $
+ * $Id: imgact_elf.h,v 1.8 1998/09/07 07:30:44 dfr Exp $
*/
#ifndef _SYS_IMGACT_ELF_H_
@@ -64,10 +64,10 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_insert_brand_entry __P((Elf32_Brandinfo *entry));
-int elf_remove_brand_entry __P((Elf32_Brandinfo *entry));
+int elf_insert_brand_entry __P((Elf32_Brandinfo *entry));
+int elf_remove_brand_entry __P((Elf32_Brandinfo *entry));
-#else /* !(ELF_TARG_CLASS == ELFCLASS32) */
+#else
/*
* Structure used to pass infomation from the loader to the
@@ -94,14 +94,16 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_insert_brand_entry __P((Elf64_Brandinfo *entry));
-int elf_remove_brand_entry __P((Elf64_Brandinfo *entry));
+int elf_insert_brand_entry __P((Elf64_Brandinfo *entry));
+int elf_remove_brand_entry __P((Elf64_Brandinfo *entry));
-#endif /* ELF_TARG_CLASS == ELFCLASS32 */
+#endif
struct proc;
-int elf_coredump __P((struct proc *));
+__BEGIN_DECLS
+int elf_coredump __P((struct proc *));
+__END_DECLS
#endif /* KERNEL */
diff --git a/sys/sys/inttypes.h b/sys/sys/inttypes.h
deleted file mode 100644
index 824786a65aa6..000000000000
--- a/sys/sys/inttypes.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file is in the public domain.
- * $Id$
- */
-
-#ifndef _SYS_INTTYPES_H_
-#define _SYS_INTTYPES_H_
-
-#include <machine/ansi.h>
-
-typedef __int8_t int8_t;
-typedef __int16_t int16_t;
-typedef __int32_t int32_t;
-typedef __int64_t int64_t;
-
-typedef __uint8_t uint8_t;
-typedef __uint16_t uint16_t;
-typedef __uint32_t uint32_t;
-typedef __uint64_t uint64_t;
-
-typedef __intptr_t intptr_t;
-typedef __uintptr_t uintptr_t;
-
-#endif /* !_SYS_INTTYPES_H_ */
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index ec58bd0394e2..00aa43010795 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -39,14 +39,12 @@
* SUCH DAMAGE.
*
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id: kernel.h,v 1.48 1998/12/20 16:54:27 bde Exp $
+ * $Id: kernel.h,v 1.42 1998/10/09 23:03:27 peter Exp $
*/
#ifndef _SYS_KERNEL_H_
#define _SYS_KERNEL_H_
-#include <sys/linker_set.h>
-
#ifdef KERNEL
/* Global variables for the kernel. */
@@ -78,6 +76,56 @@ extern long timedelta;
#endif /* KERNEL */
/*
+ * The following macros are used to declare global sets of objects, which
+ * are collected by the linker into a `struct linker_set' as defined below.
+ * For ELF, this is done by constructing a separate segment for each set.
+ * For a.out, it is done automatically by the linker.
+ */
+#if defined(__ELF__)
+
+/*
+ * Alpha GAS needs an align before the section change. It seems to assume
+ * that after the .previous, it is aligned, so the following .align 3 is
+ * ignored. Since the previous instructions often contain strings, this is
+ * a problem.
+ */
+
+#ifdef __alpha__
+#define MAKE_SET(set, sym) \
+ __asm(".align 3"); \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".quad " #sym); \
+ __asm(".previous")
+#else
+#define MAKE_SET(set, sym) \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".long " #sym); \
+ __asm(".previous")
+#endif
+#define TEXT_SET(set, sym) MAKE_SET(set, sym)
+#define DATA_SET(set, sym) MAKE_SET(set, sym)
+#define BSS_SET(set, sym) MAKE_SET(set, sym)
+#define ABS_SET(set, sym) MAKE_SET(set, sym)
+
+#else
+
+/*
+ * NB: the constants defined below must match those defined in
+ * ld/ld.h. Since their calculation requires arithmetic, we
+ * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
+ */
+#define MAKE_SET(set, sym, type) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
+#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
+#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
+#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
+#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
+
+#endif
+
+
+/*
* Enumerated types for known system startup interfaces.
*
* Startup occurs in ascending numeric order; the list entries are
@@ -199,18 +247,6 @@ struct sysinit {
SI_TYPE_DEFAULT \
}; \
DATA_SET(sysinit_set,uniquifier ## _sys_init);
-/*
- * Called on module unload: no special processing
- */
-#define SYSUNINIT(uniquifier, subsystem, order, func, ident) \
- static struct sysinit uniquifier ## _sys_uninit = { \
- subsystem, \
- order, \
- func, \
- ident, \
- SI_TYPE_DEFAULT \
- }; \
- DATA_SET(sysuninit_set,uniquifier ## _sys_uninit)
/*
* Call 'fork()' before calling '(*func)(ident)';
@@ -278,7 +314,8 @@ void sysinit_add __P((struct sysinit **set));
*/
#include <sys/module.h>
#define PSEUDO_SET(sym, name) \
- static int name ## _modevent(module_t mod, int type, void *data) \
+ static int name ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
{ \
void (*initfunc)(void *) = (void (*)(void *))data; \
switch (type) { \
@@ -301,6 +338,12 @@ void sysinit_add __P((struct sysinit **set));
#endif /* PSEUDO_LKM */
+struct linker_set {
+ int ls_length;
+ const void *ls_items[1]; /* really ls_length of them,
+ * trailing NULL */
+};
+
extern struct linker_set execsw_set;
#endif /* !_SYS_KERNEL_H_*/
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 52536ee98e2e..45a62da29047 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: linker.h,v 1.10 1998/11/04 15:20:58 peter Exp $
+ * $Id: linker.h,v 1.8 1998/10/09 23:07:27 peter Exp $
*/
#ifndef _SYS_LINKER_H_
@@ -133,11 +133,6 @@ struct linker_class {
extern linker_file_t linker_current_file;
/*
- * The "file" for the kernel.
- */
-extern linker_file_t linker_kernel_file;
-
-/*
* Add a new file class to the linker.
*/
int linker_add_class(const char* desc, void* priv,
@@ -264,14 +259,6 @@ struct kld_file_stat {
size_t size; /* size in bytes */
};
-struct kld_sym_lookup {
- int version; /* set to sizeof(struct kld_sym_lookup) */
- char *symname; /* Symbol name we are looking up */
- u_long symvalue;
- size_t symsize;
-};
-#define KLDSYM_LOOKUP 1
-
#ifndef KERNEL
#include <sys/cdefs.h>
@@ -283,7 +270,6 @@ int kldfind(const char* file);
int kldnext(int fileid);
int kldstat(int fileid, struct kld_file_stat* stat);
int kldfirstmod(int fileid);
-int kldsym(int _fileid, int _cmd, void *_data);
__END_DECLS
#endif
diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h
deleted file mode 100644
index 9824a6bc11e1..000000000000
--- a/sys/sys/linker_set.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1999 John D. Polstra
- * 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_LINKER_SET_H_
-#define _SYS_LINKER_SET_H_
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- * For ELF, this is done by constructing a separate segment for each set.
- * For a.out, it is done automatically by the linker.
- */
-#ifdef __ELF__
-
-/*
- * Alpha GAS needs an align before the section change. It seems to assume
- * that after the .previous, it is aligned, so the following .align 3 is
- * ignored. Since the previous instructions often contain strings, this is
- * a problem.
- */
-
-#ifdef __alpha__
-#define MAKE_SET(set, sym) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".align 3"); \
- __asm(".section .set." #set ",\"aw\""); \
- __asm(".quad " #sym); \
- __asm(".previous")
-#else
-#define MAKE_SET(set, sym) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".section .set." #set ",\"aw\""); \
- __asm(".long " #sym); \
- __asm(".previous")
-#endif
-#define TEXT_SET(set, sym) MAKE_SET(set, sym)
-#define DATA_SET(set, sym) MAKE_SET(set, sym)
-#define BSS_SET(set, sym) MAKE_SET(set, sym)
-#define ABS_SET(set, sym) MAKE_SET(set, sym)
-
-#else
-
-/*
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-#endif
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-#endif /* _SYS_LINKER_SET_H_ */
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index c9c287d120c6..18a9eddd1732 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)lock.h 8.12 (Berkeley) 5/19/95
- * $Id: lock.h,v 1.12 1999/01/02 11:34:56 bde Exp $
+ * $Id: lock.h,v 1.10 1997/09/21 04:24:02 dyson Exp $
*/
#ifndef _LOCK_H_
@@ -59,11 +59,6 @@ struct lock {
char *lk_wmesg; /* resource sleeping (for tsleep) */
int lk_timo; /* maximum sleep time (for tsleep) */
pid_t lk_lockholder; /* pid of exclusive lock holder */
-#ifdef DEBUG_LOCKS
- const char *lk_filename;
- const char *lk_lockername;
- int lk_lineno;
-#endif
};
/*
* Lock request types:
@@ -174,19 +169,8 @@ struct proc;
void lockinit __P((struct lock *, int prio, char *wmesg, int timo,
int flags));
-#ifdef DEBUG_LOCKS
-int debuglockmgr __P((struct lock *, u_int flags,
- struct simplelock *, struct proc *p,
- const char *,
- const char *,
- int));
-#define lockmgr(lockp, flags, slockp, proc) \
- debuglockmgr((lockp), (flags), (slockp), (proc), \
- "lockmgr", __FILE__, __LINE__)
-#else
int lockmgr __P((struct lock *, u_int flags,
struct simplelock *, struct proc *p));
-#endif
void lockmgr_printinfo __P((struct lock *));
int lockstatus __P((struct lock *));
@@ -200,7 +184,6 @@ void _simple_lock __P((struct simplelock *alp, const char *, int));
void simple_lock_init __P((struct simplelock *alp));
#else /* !SIMPLELOCK_DEBUG */
#if NCPUS == 1 /* no multiprocessor locking is necessary */
-#define NULL_SIMPLELOCKS
#define simple_lock_init(alp)
#define simple_lock(alp)
#define simple_lock_try(alp) (1) /* always succeeds */
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index d8e0cd8b74a2..a04c6881367f 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id: malloc.h,v 1.37 1998/03/08 09:58:26 julian Exp $
+ * $Id: malloc.h,v 1.36 1997/12/27 09:42:03 bde Exp $
*/
#ifndef _SYS_MALLOC_H_
@@ -64,20 +64,15 @@ struct malloc_type {
u_short ks_mapblocks; /* number of times blocked for kernel map */
};
-#ifdef KERNEL
-
-void malloc_init __P((void *));
-void malloc_uninit __P((void *));
-
#define MALLOC_DEFINE(type, shortdesc, longdesc) \
struct malloc_type type[1] = { \
{ NULL, 0, 0, 0, 0, 0, 0, M_MAGIC, shortdesc, 0, 0 } \
}; \
- SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_ANY, malloc_init, type); \
- SYSUNINIT(type##_uninit, SI_SUB_KMEM, SI_ORDER_ANY, malloc_uninit, type)
+ struct __hack
#define MALLOC_DECLARE(type) \
- extern struct malloc_type type[1]
+ extern struct malloc_type type[1]; \
+ struct __hack
#ifdef MALLOC_INSTANTIATE
#define MALLOC_MAKE_TYPE(type, shortdesc, longdesc) \
@@ -90,7 +85,6 @@ void malloc_uninit __P((void *));
MALLOC_MAKE_TYPE(M_CACHE, "namecache", "Dynamically allocated cache entries");
MALLOC_MAKE_TYPE(M_DEVBUF, "devbuf", "device driver memory");
MALLOC_MAKE_TYPE(M_TEMP, "temp", "misc temporary data buffers");
-#endif /* KERNEL */
/*
* Array of descriptors that describe the contents of each page
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 959b70b073e1..8dcebae3128b 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id: mbuf.h,v 1.30 1998/11/05 14:28:25 dg Exp $
+ * $Id: mbuf.h,v 1.28 1998/08/23 03:07:17 wollman Exp $
*/
#ifndef _SYS_MBUF_H_
@@ -138,7 +138,7 @@ struct mbuf {
#define MT_HEADER 2 /* packet header */
/*efine MT_SOCKET 3*/ /* socket structure */
/*efine MT_PCB 4*/ /* protocol control block */
-/*efine MT_RTABLE 5*/ /* routing tables */
+#define MT_RTABLE 5 /* routing tables */
/*efine MT_HTABLE 6*/ /* IMP host tables */
/*efine MT_ATABLE 7*/ /* address resolution tables */
#define MT_SONAME 8 /* socket name */
@@ -390,7 +390,6 @@ extern char *mclrefcnt; /* cluster reference counts */
extern struct mbstat mbstat;
extern int nmbclusters;
extern int nmbufs;
-extern int nsfbufs;
extern struct mbuf *mmbfree;
extern union mcluster *mclfree;
extern int max_linkhdr; /* largest link-level header */
diff --git a/sys/sys/mman.h b/sys/sys/mman.h
index c6592436e7c4..1ef56690ac7b 100644
--- a/sys/sys/mman.h
+++ b/sys/sys/mman.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mman.h 8.2 (Berkeley) 1/9/95
- * $Id: mman.h,v 1.23 1998/03/28 11:50:38 dufault Exp $
+ * $Id: mman.h,v 1.22 1998/03/08 17:25:33 dufault Exp $
*/
#ifndef _SYS_MMAN_H_
@@ -64,9 +64,6 @@
#define MAP_INHERIT 0x0080 /* region is retained after exec */
#define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */
#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
-#ifdef VM_STACK
-#define MAP_STACK 0x0400 /* region grows down, like a stack */
-#endif
#ifdef _P1003_1B_VISIBLE
/*
diff --git a/sys/sys/module.h b/sys/sys/module.h
index efee3d127d38..0ec89336a3c3 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -23,44 +23,33 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.h,v 1.5 1998/11/14 21:58:41 wollman Exp $
+ * $Id: module.h,v 1.3 1998/06/10 10:57:29 dfr Exp $
*/
#ifndef _SYS_MODULE_H_
#define _SYS_MODULE_H_
-typedef enum modeventtype {
+typedef enum {
MOD_LOAD,
MOD_UNLOAD,
MOD_SHUTDOWN
} modeventtype_t;
-typedef struct module *module_t;
+struct module;
+typedef struct module *module_t;
-typedef int (*modeventhand_t)(module_t mod, int /*modeventtype_t*/ what,
- void *arg);
+typedef int (*modeventhand_t)(module_t mod, modeventtype_t what, void *arg);
/*
* Struct for registering modules statically via SYSINIT.
*/
typedef struct moduledata {
- char *name; /* module name */
- modeventhand_t evhand; /* event handler */
- void *priv; /* extra data */
- void *_file; /* private; used by linker */
+ char* name; /* module name */
+ modeventhand_t evhand; /* event handler */
+ void* priv; /* extra data */
+ void* _file; /* private; used by linker */
} moduledata_t;
-/*
- * A module can use this to report module specific data to
- * the user via kldstat(2).
- */
-typedef union modspecific {
- int intval;
- u_int uintval;
- long longval;
- u_long ulongval;
-} modspecific_t;
-
#ifdef KERNEL
#define DECLARE_MODULE(name, data, sub, order) \
@@ -77,7 +66,6 @@ void module_release(module_t mod);
int module_unload(module_t mod);
int module_getid(module_t mod);
module_t module_getfnext(module_t mod);
-void module_setspecific(module_t mod, modspecific_t *datap);
#ifdef MOD_DEBUG
@@ -104,7 +92,6 @@ struct module_stat {
char name[MAXMODNAME];
int refs;
int id;
- modspecific_t data;
};
#ifndef KERNEL
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 4013068d7d7e..01686e6b6f9d 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.21 (Berkeley) 5/20/95
- * $Id: mount.h,v 1.72 1998/11/10 09:04:09 peter Exp $
+ * $Id: mount.h,v 1.68 1998/09/15 11:44:44 phk Exp $
*/
#ifndef _SYS_MOUNT_H_
@@ -73,7 +73,7 @@ struct statfs {
long f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id */
uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem */
+ int f_type; /* type of filesystem (see below) */
int f_flags; /* copy of mount exported flags */
long f_syncwrites; /* count of sync writes since mount */
long f_asyncwrites; /* count of async writes since mount */
@@ -342,35 +342,56 @@ struct vfsops {
}; \
extern struct linker_set MODVNOPS; \
MOD_VFS(fsname,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver); \
+ extern int \
+ fsname ## _mod __P((struct lkm_table *, int, int)); \
int \
fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
MOD_DISPATCH(fsname, \
- lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); } \
- struct __hack
-
+ lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
#else
#include <sys/module.h>
-
#define VFS_SET(vfsops, fsname, flags) \
- static struct vfsconf fsname ## _vfsconf = { \
- &vfsops, \
- #fsname, \
- -1, \
- 0, \
- flags \
- }; \
- static moduledata_t fsname ## _mod = { \
- #fsname, \
- vfs_modevent, \
- & fsname ## _vfsconf \
- }; \
- DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE)
+ static struct vfsconf fsname ## _vfsconf = { \
+ &vfsops, \
+ #fsname, \
+ -1, \
+ 0, \
+ flags | VFCF_STATIC, \
+ }; \
+ static int fsname ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
+ { \
+ struct vfsconf *vfc = (struct vfsconf *)data; \
+ int error = 0; \
+ switch (type) { \
+ case MOD_LOAD: \
+ /* printf(#fsname " module load\n"); */ \
+ error = vfs_register(vfc); \
+ if (error) \
+ printf(#fsname " register failed\n"); \
+ break; \
+ case MOD_UNLOAD: \
+ /* printf(#fsname " module unload\n"); */ \
+ error = vfs_register(vfc); \
+ if (error) \
+ printf(#fsname " register failed\n"); \
+ break; \
+ } \
+ return error; \
+ } \
+ static moduledata_t fsname ## _mod = { \
+ #fsname, \
+ fsname ## _modevent, \
+ & fsname ## _vfsconf \
+ }; \
+ DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
#endif /* VFS_LKM */
+#endif /* KERNEL */
+
+#ifdef KERNEL
#include <net/radix.h>
#define AF_MAX 31 /* XXX */
@@ -411,7 +432,6 @@ struct netcred *vfs_export_lookup /* lookup host in fs export list */
int vfs_allocate_syncvnode __P((struct mount *));
void vfs_getnewfsid __P((struct mount *));
struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */
-int vfs_modevent __P((module_t, int, void *));
int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
int vfs_rootmountalloc __P((char *, char *, struct mount **));
void vfs_unbusy __P((struct mount *, struct proc *));
diff --git a/sys/sys/mtio.h b/sys/sys/mtio.h
index 2a7b53c86f09..d6aaf27abfd3 100644
--- a/sys/sys/mtio.h
+++ b/sys/sys/mtio.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mtio.h 8.1 (Berkeley) 6/2/93
- * $Id: mtio.h,v 1.14 1998/12/21 22:14:02 mjacob Exp $
+ * $Id: mtio.h,v 1.10 1997/02/22 09:45:37 peter Exp $
*/
#ifndef _SYS_MTIO_H_
@@ -73,7 +73,8 @@ struct mtop {
#define MTSETBSIZ 10
-/* Set density values for device. Sets the value for the opened mode only. */
+/* Set density values for device. They are defined in the SCSI II spec */
+/* and range from 0 to 0x17. Sets the value for the opened mode only */
#define MTSETDNSTY 11
@@ -81,14 +82,11 @@ struct mtop {
#define MTEOD 13 /* Space to EOM */
#define MTCOMP 14 /* select compression mode 0=off, 1=def */
#define MTRETENS 15 /* re-tension tape */
-#define MTWSS 16 /* write setmark(s) */
-#define MTFSS 17 /* forward space setmark */
-#define MTBSS 18 /* backward space setmark */
#define MT_COMP_ENABLE 0xffffffff
#define MT_COMP_DISABLED 0xfffffffe
#define MT_COMP_UNSUPP 0xfffffffd
-#endif /* __FreeBSD__ */
+#endif
/* structure for MTIOCGET - mag tape get status command */
@@ -122,39 +120,6 @@ struct mtget {
/* end not yet implemented */
};
-/* structure for MTIOCERRSTAT - tape get error status command */
-/* really only supported for SCSI tapes right now */
-struct scsi_tape_errors {
- /*
- * These are latched from the last command that had a SCSI
- * Check Condition noted for these operations. The act
- * of issuing an MTIOCERRSTAT unlatches and clears them.
- */
- u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */
- u_int32_t io_resid; /* residual count from last Data I/O */
- u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */
- u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */
- u_int32_t ctl_resid; /* residual count from last Control I/O */
- u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */
- /*
- * These are the read and write cumulative error counters.
- * (how to reset cumulative error counters is not yet defined).
- * (not implemented as yet but space is being reserved for them)
- */
- struct {
- u_int32_t retries; /* total # retries performed */
- u_int32_t corrected; /* total # corrections performed */
- u_int32_t processed; /* total # corrections succssful */
- u_int32_t failures; /* total # corrections/retries failed */
- u_int64_t nbytes; /* total # bytes processed */
- } werr, rderr;
-};
-
-union mterrstat {
- struct scsi_tape_errors scsi_errstat;
- char _reserved_padding[256];
-};
-
/*
* Constants for mt_type byte. These are the same
* for controllers compatible with the types listed.
@@ -183,20 +148,8 @@ union mterrstat {
/* mag tape io control commands */
#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
-/* these two do not appear to be used anywhere */
#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
#define MTIOCEEOT _IO('m', 4) /* enable EOT error */
-/*
- * When more SCSI-3 SSC (streaming device) devices are out there
- * that support the full 32 byte type 2 structure, we'll have to
- * rethink these ioctls to support all the entities they haul into
- * the picture (64 bit blocks, logical file record numbers, etc..).
- */
-#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /* get logical blk addr */
-#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /* get hardware blk addr */
-#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /* seek to logical blk addr */
-#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /* seek to hardware blk addr */
-#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
#ifndef KERNEL
#define DEFTAPE "/dev/nrsa0"
diff --git a/sys/sys/param.h b/sys/sys/param.h
index badddcacc77f..7cee6231695d 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id: param.h,v 1.37 1998/10/16 04:28:04 jkh Exp $
+ * $Id: param.h,v 1.36 1998/09/03 08:28:42 asami Exp $
*/
#ifndef _SYS_PARAM_H_
@@ -46,7 +46,7 @@
#define BSD4_3 1
#define BSD4_4 1
#undef __FreeBSD_version
-#define __FreeBSD_version 300006 /* Master, propagated to newvers */
+#define __FreeBSD_version 300005 /* Master, propagated to newvers */
#ifndef NULL
#define NULL 0
diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h
index 9b06500d75c2..7454cdf7a3ba 100644
--- a/sys/sys/pipe.h
+++ b/sys/sys/pipe.h
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: pipe.h,v 1.11 1998/11/11 10:04:12 truckman Exp $
+ * $Id: pipe.h,v 1.9 1997/04/09 16:53:45 bde Exp $
*/
#ifndef _SYS_PIPE_H_
@@ -102,7 +102,7 @@ struct pipe {
struct timespec pipe_atime; /* time of last access */
struct timespec pipe_mtime; /* time of last modify */
struct timespec pipe_ctime; /* time of status change */
- struct sigio *pipe_sigio; /* information for async I/O */
+ int pipe_pgid; /* process/group for async I/O */
struct pipe *pipe_peer; /* link with other direction */
u_int pipe_state; /* pipe status info */
int pipe_busy; /* busy flag, mostly to handle rundown sanely */
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 1b7d5ad15710..2a7a7a39f5b2 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)proc.h 8.15 (Berkeley) 5/19/95
- * $Id: proc.h,v 1.65 1998/12/31 13:23:16 bde Exp $
+ * $Id: proc.h,v 1.57 1998/04/04 13:26:14 phk Exp $
*/
#ifndef _SYS_PROC_H_
@@ -47,15 +47,11 @@
#include <sys/rtprio.h> /* For struct rtprio. */
#include <sys/select.h> /* For struct selinfo. */
#include <sys/signal.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/signalvar.h>
-#endif /* COMPAT_LINUX_THREADS */
#ifndef KERNEL
#include <sys/time.h> /* For structs itimerval, timeval. */
#endif
#include <sys/ucred.h>
#include <sys/queue.h>
-#include <sys/filedesc.h>
/*
* One structure allocated per session.
@@ -65,7 +61,6 @@ struct session {
struct proc *s_leader; /* Session leader. */
struct vnode *s_ttyvp; /* Vnode of controlling terminal. */
struct tty *s_ttyp; /* Controlling terminal. */
- pid_t s_sid; /* Session ID */
char s_login[roundup(MAXLOGNAME, sizeof(long))]; /* Setlogin() name. */
};
@@ -76,32 +71,10 @@ struct pgrp {
LIST_ENTRY(pgrp) pg_hash; /* Hash chain. */
LIST_HEAD(, proc) pg_members; /* Pointer to pgrp members. */
struct session *pg_session; /* Pointer to session. */
- struct sigiolst pg_sigiolst; /* List of sigio sources. */
pid_t pg_id; /* Pgrp id. */
int pg_jobc; /* # procs qualifying pgrp for job control */
};
-#ifdef COMPAT_LINUX_THREADS
-struct procsig {
-#define ps_begincopy ps_sigignore
- sigset_t ps_sigignore; /* Signals being ignored. */
- sigset_t ps_sigcatch; /* Signals being caught by user. */
- int ps_flag;
- struct sigacts *ps_sigacts;
-#define ps_endcopy ps_refcnt
- int ps_refcnt;
-};
-#endif /* COMPAT_LINUX_THREADS */
-
-/*
- * pasleep structure, used by asleep() syscall to hold requested priority
- * and timeout values for await().
- */
-struct pasleep {
- int as_priority; /* Async priority. */
- int as_timo; /* Async timeout. */
-};
-
/*
* Description of a process.
*
@@ -123,14 +96,7 @@ struct proc {
struct pstats *p_stats; /* Accounting/statistics (PROC ONLY). */
struct plimit *p_limit; /* Process limits. */
struct vm_object *p_upages_obj;/* Upages object */
-#ifndef COMPAT_LINUX_THREADS
struct sigacts *p_sigacts; /* Signal actions, state (PROC ONLY). */
-#else
- struct procsig *p_procsig;
-#define p_sigacts p_procsig->ps_sigacts
-#define p_sigignore p_procsig->ps_sigignore
-#define p_sigcatch p_procsig->ps_sigcatch
-#endif
#define p_ucred p_cred->pc_ucred
#define p_rlimit p_limit->pl_rlimit
@@ -194,13 +160,6 @@ struct proc {
unsigned char p_pfsflags; /* procfs flags */
char p_pad3[2]; /* padding for alignment */
register_t p_retval[2]; /* syscall aux returns */
- struct sigiolst p_sigiolst; /* list of sigio sources */
-#ifdef COMPAT_LINUX_THREADS
- int p_sigparent; /* signal to parent on exit */
- sigset_t p_oldsigmask; /* saved mask from before sigpause */
- int p_sig; /* for core dump/debugger XXX */
- u_long p_code; /* for core dump/debugger XXX */
-#endif /* COMPAT_LINUX_THREADS */
/* End area that is zeroed on creation. */
#define p_endzero p_startcopy
@@ -209,10 +168,9 @@ struct proc {
#define p_startcopy p_sigmask
sigset_t p_sigmask; /* Current signal mask. */
-#ifndef COMPAT_LINUX_THREADS
sigset_t p_sigignore; /* Signals being ignored. */
sigset_t p_sigcatch; /* Signals being caught by user. */
-#endif /* COMPAT_LINUX_THREADS */
+
u_char p_priority; /* Process priority. */
u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */
char p_nice; /* Process "nice" value. */
@@ -237,7 +195,6 @@ struct proc {
int p_wakeup; /* thread id */
struct proc *p_peers;
struct proc *p_leader;
- struct pasleep p_asleep; /* Used by asleep()/await(). */
};
#define p_session p_pgrp->pg_session
@@ -310,8 +267,8 @@ MALLOC_DECLARE(M_SUBPROC);
* We use process IDs <= PID_MAX; PID_MAX + 1 must also fit in a pid_t,
* as it is used to represent "no process group".
*/
-#define PID_MAX 99999
-#define NO_PID 100000
+#define PID_MAX 30000
+#define NO_PID 30001
#define SESS_LEADER(p) ((p)->p_session->s_leader == (p))
#define SESSHOLD(s) ((s)->s_count++)
@@ -388,11 +345,7 @@ void wakeup_one __P((void *chan));
void cpu_exit __P((struct proc *)) __dead2;
void exit1 __P((struct proc *, int)) __dead2;
void cpu_fork __P((struct proc *, struct proc *));
-#ifndef COMPAT_LINUX_THREADS
int fork1 __P((struct proc *, int));
-#else
-int fork1 __P((struct proc *, int));
-#endif /* COMPAT_LINUX_THREADS */
int trace_req __P((struct proc *));
void cpu_wait __P((struct proc *));
int cpu_coredump __P((struct proc *, struct vnode *, struct ucred *));
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index 99a1d92dd731..f016fc0f1cf3 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id: protosw.h,v 1.25 1998/08/23 03:07:17 wollman Exp $
+ * $Id: protosw.h,v 1.24 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_PROTOSW_H_
@@ -203,7 +203,6 @@ struct pr_usrreqs {
struct proc *p));
#define PRUS_OOB 0x1
#define PRUS_EOF 0x2
-#define PRUS_MORETOCOME 0x4
int (*pru_sense) __P((struct socket *so, struct stat *sb));
int (*pru_shutdown) __P((struct socket *so));
int (*pru_sockaddr) __P((struct socket *so,
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 87a62a0e7781..2ada73c74896 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id: queue.h,v 1.23 1999/01/06 20:03:11 n_hibma Exp $
+ * $Id: queue.h,v 1.21 1998/05/12 03:55:25 gibbs Exp $
*/
#ifndef _SYS_QUEUE_H_
@@ -133,7 +133,7 @@ struct { \
(head)->slh_first = NULL; \
}
-#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
(elm)->field.sle_next = (slistelm)->field.sle_next; \
(slistelm)->field.sle_next = (elm); \
} while (0)
@@ -171,9 +171,6 @@ struct name { \
struct type **stqh_last;/* addr of last next element */ \
}
-#define STAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).stqh_first }
-
#define STAILQ_ENTRY(type) \
struct { \
struct type *stqe_next; /* next element */ \
@@ -218,12 +215,6 @@ struct { \
(head)->stqh_last = &(head)->stqh_first; \
} while (0)
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
- if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
-
#define STAILQ_REMOVE(head, elm, type, field) do { \
if ((head)->stqh_first == (elm)) { \
STAILQ_REMOVE_HEAD(head, field); \
@@ -246,9 +237,6 @@ struct name { \
struct type *lh_first; /* first element */ \
}
-#define LIST_HEAD_INITIALIZER(head) \
- { NULL }
-
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
deleted file mode 100644
index 224d9edc692a..000000000000
--- a/sys/sys/rman.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. 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.
- *
- * $Id$
- */
-
-#ifndef _SYS_RMAN_H_
-#define _SYS_RMAN_H_ 1
-
-#ifndef KERNEL
-#include <sys/queue.h>
-#endif /* !KERNEL */
-
-/*
- * We use a linked list rather than a bitmap because we need to be able to
- * represent potentially huge objects (like all of a processor's physical
- * address space). That is also why the indices are defined to have type
- * `unsigned long' -- that being the largest integral type in Standard C.
- */
-CIRCLEQ_HEAD(resource_head, resource);
-struct resource {
- CIRCLEQ_ENTRY(resource) r_link;
- LIST_ENTRY(resource) r_sharelink;
- LIST_HEAD(, resource) *r_sharehead;
- u_long r_start; /* index of the first entry in this resource */
- u_long r_end; /* index of the last entry (inclusive) */
- u_int r_flags;
- void *r_virtual; /* virtual address of this resource */
- struct device *r_dev; /* device which has allocated this resource */
- struct rman *r_rm; /* resource manager from whence this came */
-};
-
-#define RF_ALLOCATED 0x0001 /* resource has been reserved */
-#define RF_ACTIVE 0x0002 /* resource allocation has been activated */
-#define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */
-#define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */
-#define RF_WANTED 0x0010 /* somebody is waiting for this resource */
-#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
-
-enum rman_type { RMAN_UNINIT = 0, RMAN_GAUGE, RMAN_ARRAY };
-
-struct rman {
- struct resource_head rm_list;
- struct simplelock *rm_slock; /* mutex used to protect rm_list */
- TAILQ_ENTRY(rman) rm_link; /* link in list of all rmans */
- u_long rm_start; /* index of globally first entry */
- u_long rm_end; /* index of globally last entry */
- enum rman_type rm_type; /* what type of resource this is */
- const char *rm_descr; /* text descripion of this resource */
-};
-TAILQ_HEAD(rman_head, rman);
-
-#ifdef KERNEL
-
-int rman_activate_resource(struct resource *r);
-int rman_await_resource(struct resource *r, int pri, int timo);
-int rman_deactivate_resource(struct resource *r);
-int rman_fini(struct rman *rm);
-int rman_init(struct rman *rm);
-int rman_manage_region(struct rman *rm, u_long start, u_long end);
-int rman_release_resource(struct resource *r);
-struct resource *rman_reserve_resource(struct rman *rm, u_long start,
- u_long end, u_long count,
- u_int flags, struct device *dev);
-
-#define rman_set_virtual(r,v) ((r)->r_virtual = (v))
-#define rman_get_virtual(r) ((r)->r_virtual)
-
-extern struct rman_head rman_head;
-#endif /* KERNEL */
-
-#endif /* !_SYS_RMAN_H_ */
diff --git a/sys/sys/sem.h b/sys/sys/sem.h
index b51fc2467527..a57e9b886a71 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -1,4 +1,4 @@
-/* $Id: sem.h,v 1.17 1998/12/14 21:01:47 dillon Exp $ */
+/* $Id: sem.h,v 1.14 1998/05/31 04:09:09 steve Exp $ */
/* $NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $ */
/*
@@ -140,15 +140,8 @@ extern struct seminfo seminfo;
#define SEMOPM 100 /* max # of operations per semop call */
#endif
-/*
- * Due to the way semaphore memory is allocated, we have to ensure that
- * SEMUSZ is properly aligned.
- */
-
-#define SEM_ALIGN(bytes) (((bytes) + (sizeof(long) - 1)) & ~(sizeof(long) - 1))
-
/* actual size of an undo structure */
-#define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME]))
+#define SEMUSZ (sizeof(struct sem_undo)+sizeof(struct undo)*SEMUME)
extern struct semid_ds *sema; /* semaphore id pool */
extern struct sem *sem; /* semaphore pool */
@@ -157,7 +150,7 @@ extern int *semu; /* undo structure pool */
/*
* Macro to find a particular sem_undo vector
*/
-#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz))
+#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * SEMUSZ))
/*
* Process sem_undo vectors at proc exit.
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index 658c6cb29c78..3976a4fd2ea3 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id: signalvar.h,v 1.21 1998/12/19 02:55:34 julian Exp $
+ * $Id: signalvar.h,v 1.18 1998/03/28 10:33:23 bde Exp $
*/
#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
@@ -55,15 +55,11 @@ struct sigacts {
sigset_t ps_sigintr; /* signals that interrupt syscalls */
sigset_t ps_sigreset; /* signals that reset when caught */
sigset_t ps_signodefer; /* signals not masked while handled */
-#ifndef COMPAT_LINUX_THREADS
sigset_t ps_oldmask; /* saved mask from before sigpause */
-#endif /* COMPAT_LINUX_THREADS */
int ps_flags; /* signal flags, below */
struct sigaltstack ps_sigstk; /* sp & on stack state variable */
-#ifndef COMPAT_LINUX_THREADS
int ps_sig; /* for core dump/debugger XXX */
u_long ps_code; /* for core dump/debugger XXX */
-#endif /* COMPAT_LINUX_THREADS */
sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
};
@@ -156,7 +152,6 @@ static int sigprop[NSIG + 1] = {
#ifdef KERNEL
struct pgrp;
struct proc;
-struct sigio;
extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */
@@ -168,16 +163,13 @@ char *expand_name __P((const char*, int, int));
void gsignal __P((int pgid, int sig));
int issignal __P((struct proc *p));
void killproc __P((struct proc *p, char *why));
-void pgsigio __P((struct sigio *, int signum, int checkctty));
void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
void postsig __P((int sig));
void psignal __P((struct proc *p, int sig));
void sigexit __P((struct proc *p, int signum));
void siginit __P((struct proc *p));
void trapsignal __P((struct proc *p, int sig, u_long code));
-#ifdef COMPAT_LINUX_THREADS
-void check_sigacts (void);
-#endif
+
/*
* Machine-dependent functions:
*/
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index b7da75a1c515..3c3d311c0926 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id: socket.h,v 1.26 1998/09/15 11:44:44 phk Exp $
+ * $Id: socket.h,v 1.25 1998/09/12 21:14:25 wollman Exp $
*/
#ifndef _SYS_SOCKET_H_
@@ -363,16 +363,6 @@ struct omsghdr {
#define SHUT_WR 1 /* shut down the writing side */
#define SHUT_RDWR 2 /* shut down both sides */
-/*
- * sendfile(2) header/trailer struct
- */
-struct sf_hdtr {
- struct iovec *headers; /* pointer to an array of header struct iovec's */
- int hdr_cnt; /* number of header iovec's */
- struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
- int trl_cnt; /* number of trailer iovec's */
-};
-
#ifndef KERNEL
#include <sys/cdefs.h>
@@ -392,7 +382,6 @@ ssize_t send __P((int, const void *, size_t, int));
ssize_t sendto __P((int, const void *,
size_t, int, const struct sockaddr *, int));
ssize_t sendmsg __P((int, const struct msghdr *, int));
-int sendfile __P((int, int, off_t, size_t, struct sf_hdtr *, off_t *, int));
int setsockopt __P((int, int, int, const void *, int));
int shutdown __P((int, int));
int socket __P((int, int, int));
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 4f9c07acfa0b..86c17edcf0fc 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id: socketvar.h,v 1.31 1998/11/11 10:04:13 truckman Exp $
+ * $Id: socketvar.h,v 1.28 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_SOCKETVAR_H_
@@ -77,8 +77,7 @@ struct socket {
short so_qlimit; /* max number queued connections */
short so_timeo; /* connection timeout */
u_short so_error; /* error affecting connection */
- struct sigio *so_sigio; /* information for async I/O or
- out of band data (SIGURG) */
+ pid_t so_pgid; /* pgid for signals */
u_long so_oobmark; /* chars to oob mark */
/*
* Variables for socket buffering.
@@ -257,13 +256,6 @@ struct sockopt {
struct proc *sopt_p; /* calling process or null if kernel */
};
-struct sf_buf {
- SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
- int refcnt; /* reference count */
- struct vm_page *m; /* currently mapped page */
- vm_offset_t kva; /* va of mapping */
-};
-
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_PCB);
MALLOC_DECLARE(M_SONAME);
diff --git a/sys/sys/syscall-hide.h b/sys/sys/syscall-hide.h
index 814bfecbd0c1..dd8fab9ef3d3 100644
--- a/sys/sys/syscall-hide.h
+++ b/sys/sys/syscall-hide.h
@@ -2,7 +2,7 @@
* System call hiders.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
HIDE_POSIX(fork)
@@ -247,5 +247,3 @@ HIDE_POSIX(sched_get_priority_max)
HIDE_POSIX(sched_get_priority_min)
HIDE_POSIX(sched_rr_get_interval)
HIDE_BSD(utrace)
-HIDE_BSD(sendfile)
-HIDE_BSD(kldsym)
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 464ea91cb7ba..ae58e240707d 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#define SYS_syscall 0
@@ -253,6 +253,4 @@
#define SYS_sched_get_priority_min 333
#define SYS_sched_rr_get_interval 334
#define SYS_utrace 335
-#define SYS_sendfile 336
-#define SYS_kldsym 337
-#define SYS_MAXSYSCALL 338
+#define SYS_MAXSYSCALL 336
diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk
index 581290a0f350..5d5bd0f03da2 100644
--- a/sys/sys/syscall.mk
+++ b/sys/sys/syscall.mk
@@ -1,6 +1,6 @@
# FreeBSD system call names.
# DO NOT EDIT-- this file is automatically generated.
-# created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+# created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
MIASM = \
syscall.o \
exit.o \
@@ -208,6 +208,4 @@ MIASM = \
sched_get_priority_max.o \
sched_get_priority_min.o \
sched_rr_get_interval.o \
- utrace.o \
- sendfile.o \
- kldsym.o
+ utrace.o
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 89cf9c08adcc..9e7df739f344 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id: sysctl.h,v 1.68 1998/12/27 18:03:29 dfr Exp $
+ * $Id: sysctl.h,v 1.64 1998/09/05 14:13:35 bde Exp $
*/
#ifndef _SYS_SYSCTL_H_
@@ -78,7 +78,6 @@ struct ctlname {
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
/*
* USE THIS instead of a hardwired number from the categories below
@@ -156,10 +155,15 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
ptr, val, sysctl_handle_int, "I", descr)
-/* Oid for a long. The pointer must be non NULL. */
-#define SYSCTL_LONG(parent, nbr, name, access, ptr, descr) \
+/* Oid for a long. If ptr is NULL, val is returned. */
+#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
- ptr, 0, sysctl_handle_long, "L", descr)
+ ptr, val, sysctl_handle_long, "L", descr)
+
+/* Oid for an intptr_t. If ptr is NULL, val is returned. */
+#define SYSCTL_INTPTR(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
+ ptr, val, sysctl_handle_intptr, "P", descr)
/* Oid for an opaque object. Specified by a pointer and a length. */
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 9bfc9788eca0..114fe35817db 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sysent.h,v 1.19 1998/09/14 05:36:51 jdp Exp $
+ * $Id: sysent.h,v 1.18 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_SYSENT_H_
@@ -76,36 +76,6 @@ struct sysentvec {
#ifdef KERNEL
extern struct sysentvec aout_sysvec;
extern struct sysent sysent[];
-
-#define NO_SYSCALL (-1)
-
-struct module;
-
-struct syscall_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- int *offset; /* offset into sysent */
- struct sysent *new_sysent; /* new sysent */
- struct sysent old_sysent; /* old sysent */
-};
-
-#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \
-static struct syscall_module_data name##_syscall_mod = { \
- evh, arg, offset, new_sysent \
-}; \
- \
-static moduledata_t name##_mod = { \
- #name, \
- syscall_module_handler, \
- &name##_syscall_mod \
-}; \
-DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
-
-int syscall_register __P((int *offset, struct sysent *new_sysent,
- struct sysent *old_sysent));
-int syscall_deregister __P((int *offset, struct sysent *old_sysent));
-int syscall_module_handler __P((struct module *mod, int what, void *arg));
-
-#endif /* KERNEL */
+#endif
#endif /* !_SYS_SYSENT_H_ */
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index 71f949229aaa..40ee5bd83b8d 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#ifndef _SYS_SYSPROTO_H_
@@ -879,20 +879,6 @@ struct utrace_args {
caddr_t addr; char addr_[PAD_(caddr_t)];
size_t len; char len_[PAD_(size_t)];
};
-struct sendfile_args {
- int fd; char fd_[PAD_(int)];
- int s; char s_[PAD_(int)];
- off_t offset; char offset_[PAD_(off_t)];
- size_t nbytes; char nbytes_[PAD_(size_t)];
- struct sf_hdtr * hdtr; char hdtr_[PAD_(struct sf_hdtr *)];
- off_t * sbytes; char sbytes_[PAD_(off_t *)];
- int flags; char flags_[PAD_(int)];
-};
-struct kldsym_args {
- int fileid; char fileid_[PAD_(int)];
- int cmd; char cmd_[PAD_(int)];
- void * data; char data_[PAD_(void *)];
-};
int nosys __P((struct proc *, struct nosys_args *));
void exit __P((struct proc *, struct rexit_args *)) __dead2;
int fork __P((struct proc *, struct fork_args *));
@@ -1098,8 +1084,6 @@ int sched_get_priority_max __P((struct proc *, struct sched_get_priority_max_arg
int sched_get_priority_min __P((struct proc *, struct sched_get_priority_min_args *));
int sched_rr_get_interval __P((struct proc *, struct sched_rr_get_interval_args *));
int utrace __P((struct proc *, struct utrace_args *));
-int sendfile __P((struct proc *, struct sendfile_args *));
-int kldsym __P((struct proc *, struct kldsym_args *));
#ifdef COMPAT_43
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index c0cc60cab34f..2b3236ad5f9a 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id: systm.h,v 1.83 1999/01/15 00:03:39 msmith Exp $
+ * $Id: systm.h,v 1.76 1998/09/15 10:07:26 gibbs Exp $
*/
#ifndef _SYS_SYSTM_H_
@@ -76,12 +76,6 @@ extern struct vnode *swapdev_vp;/* vnode for swap device */
extern int boothowto; /* reboot flags, from console subsystem */
extern int bootverbose; /* nonzero to print verbose messages */
-#ifdef INVARIANTS /* The option is always available */
-#define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0)
-#else
-#define KASSERT(exp,msg)
-#endif
-
/*
* General function declarations.
*/
@@ -113,17 +107,11 @@ int kvprintf __P((char const *, void (*)(int, void*), void *, int,
void log __P((int, const char *, ...)) __printflike(2, 3);
void logwakeup __P((void));
int printf __P((const char *, ...)) __printflike(1, 2);
-int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4);
int sprintf __P((char *buf, const char *, ...)) __printflike(2, 3);
void uprintf __P((const char *, ...)) __printflike(1, 2);
void vprintf __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0);
-int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) __printflike(3, 0);
int vsprintf __P((char *buf, const char *, _BSD_VA_LIST_)) __printflike(2, 0);
void ttyprintf __P((struct tty *, const char *, ...)) __printflike(2, 3);
-int sscanf __P((const char *, char const *, ...));
-int vsscanf __P((const char *, char const *, _BSD_VA_LIST_));
-u_quad_t strtouq __P((const char *, char **, int));
-quad_t strtoq __P((const char *, char **, int base));
void bcopy __P((const void *from, void *to, size_t len));
void ovbcopy __P((const void *from, void *to, size_t len));
@@ -163,7 +151,6 @@ void setstatclockrate __P((int hzrate));
void hardpps __P((struct timeval *tvp, long usec));
char *getenv __P((char *name));
-int getenv_int __P((char *name, int *data));
extern char *kern_envp;
#ifdef APM_FIXUP_CALLTODO
@@ -280,14 +267,10 @@ int rm_at_fork __P((forklist_fn function));
#define SHUTDOWN_PRE_SYNC 0
#define SHUTDOWN_POST_SYNC 1
#define SHUTDOWN_FINAL 2
-#define SHUTDOWN_PRI_FIRST 0
-#define SHUTDOWN_PRI_DEFAULT 10000
-#define SHUTDOWN_PRI_LAST 20000
typedef void (*bootlist_fn) __P((int, void *));
int at_shutdown __P((bootlist_fn function, void *arg, int position));
-int at_shutdown_pri __P((bootlist_fn function, void *arg, int position, int pri));
int rm_at_shutdown __P((bootlist_fn function, void *arg));
/*
@@ -306,8 +289,6 @@ extern watchdog_tickle_fn wdog_tickler;
* less often.
*/
int tsleep __P((void *chan, int pri, const char *wmesg, int timo));
-int asleep __P((void *chan, int pri, const char *wmesg, int timo));
-int await __P((int pri, int timo));
void wakeup __P((void *chan));
#endif /* !_SYS_SYSTM_H_ */
diff --git a/sys/sys/time.h b/sys/sys/time.h
index b6b7d288e8e9..e17de0474fa2 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
- * $Id: time.h,v 1.34 1998/10/23 10:42:42 phk Exp $
+ * $Id: time.h,v 1.32 1998/06/07 20:36:55 phk Exp $
*/
#ifndef _SYS_TIME_H_
@@ -56,16 +56,14 @@ struct timespec {
};
#endif
-#define TIMEVAL_TO_TIMESPEC(tv, ts) \
- do { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
- } while (0)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) \
- do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- } while (0)
+#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
@@ -141,6 +139,7 @@ struct timecounter {
char *tc_name;
void *tc_priv;
/* These fields will be managed by the generic code. */
+ int tc_cost;
int32_t tc_adjustment;
u_int32_t tc_scale_micro;
u_int32_t tc_scale_nano_i;
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 1e1a094df919..d3dd4df6bbf3 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
- * $Id: tty.h,v 1.43 1998/11/11 10:04:13 truckman Exp $
+ * $Id: tty.h,v 1.41 1998/03/07 15:36:25 bde Exp $
*/
#ifndef _SYS_TTY_H_
@@ -79,7 +79,6 @@ struct tty {
int t_timeout; /* Timeout for ttywait() */
struct pgrp *t_pgrp; /* Foreground process group. */
struct session *t_session; /* Enclosing session. */
- struct sigio *t_sigio; /* Information for async I/O. */
struct selinfo t_rsel; /* Tty read/oob select. */
struct selinfo t_wsel; /* Tty write select. */
struct termios t_termios; /* Termios state. */
diff --git a/sys/sys/ttycom.h b/sys/sys/ttycom.h
index a181b77daa5e..f2e491bc507b 100644
--- a/sys/sys/ttycom.h
+++ b/sys/sys/ttycom.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ttycom.h 8.1 (Berkeley) 3/28/94
- * $Id: ttycom.h,v 1.12 1997/02/22 09:46:14 peter Exp $
+ * $Id$
*/
#ifndef _SYS_TTYCOM_H_
@@ -130,6 +130,8 @@ struct winsize {
* of last DCd rise */
#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
+#define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to
+ * DSI Softmodem */
#define TTYDISC 0 /* termios tty line discipline */
#define TABLDISC 3 /* tablet discipline */
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 93f8698e6786..085825bee890 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
- * $Id: types.h,v 1.25 1998/06/07 17:13:05 dfr Exp $
+ * $Id: types.h,v 1.24 1998/02/24 02:11:39 bde Exp $
*/
#ifndef _SYS_TYPES_H_
@@ -45,7 +45,7 @@
#include <sys/cdefs.h>
/* Machine type dependent parameters. */
-#include <sys/inttypes.h> /* includes <machine/ansi.h> */
+#include <machine/ansi.h>
#include <machine/types.h>
#ifndef _POSIX_SOURCE
@@ -57,11 +57,6 @@ typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
-typedef __uint8_t u_int8_t;
-typedef __uint16_t u_int16_t;
-typedef __uint32_t u_int32_t;
-typedef __uint64_t u_int64_t;
-
typedef u_int64_t u_quad_t; /* quads */
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
@@ -84,12 +79,10 @@ typedef int64_t segsz_t; /* segment size */
typedef int32_t segsz_t; /* segment size */
#endif
typedef int32_t swblk_t; /* swap offset */
-typedef int32_t ufs_daddr_t;
typedef u_int32_t uid_t; /* user id */
#ifdef KERNEL
typedef int boolean_t;
-typedef u_int64_t uoff_t;
typedef struct vm_page *vm_page_t;
#endif
@@ -136,6 +129,21 @@ typedef _BSD_TIMER_T_ timer_t;
#undef _BSD_TIMER_T_
#endif
+#ifdef _BSD_UINT8_T_
+typedef _BSD_UINT8_T_ uint8_t;
+#undef _BSD_UINT8_T_
+#endif
+
+#ifdef _BSD_UINT16_T_
+typedef _BSD_UINT16_T_ uint16_t;
+#undef _BSD_UINT16_T_
+#endif
+
+#ifdef _BSD_UINT32_T_
+typedef _BSD_UINT32_T_ uint32_t;
+#undef _BSD_UINT32_T_
+#endif
+
#ifndef _POSIX_SOURCE
#define NBBY 8 /* number of bits in a byte */
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index d6216039f6b9..b96572d6f8e1 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)unistd.h 8.2 (Berkeley) 1/7/94
- * $Id: unistd.h,v 1.18 1998/12/19 02:55:34 julian Exp $
+ * $Id: unistd.h,v 1.16 1998/03/08 17:25:38 dufault Exp $
*/
#ifndef _SYS_UNISTD_H_
@@ -186,8 +186,6 @@
#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
#define RFCFDG (1<<12) /* zero fd table */
#define RFTHREAD (1<<13) /* enable kernel thread support */
-#define RFSIGSHARE (1<<14) /* share signal handlers */
-#define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
#define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */
#endif /* !_POSIX_SOURCE */
diff --git a/sys/sys/user.h b/sys/sys/user.h
index 2f8e393f0934..9a34940977b2 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)user.h 8.2 (Berkeley) 9/23/93
- * $Id: user.h,v 1.18 1999/01/07 21:23:47 julian Exp $
+ * $Id: user.h,v 1.15 1998/03/28 10:33:24 bde Exp $
*/
#ifndef _SYS_USER_H_
@@ -69,9 +69,6 @@ struct kinfo_proc {
struct session *e_sess; /* session pointer */
struct pcred e_pcred; /* process credentials */
struct ucred e_ucred; /* current credentials */
-#ifdef COMPAT_LINUX_THREADS
- struct procsig e_procsig; /* shared signal structure */
-#endif
struct vmspace e_vm; /* address space */
pid_t e_ppid; /* parent process id */
pid_t e_pgid; /* process group id */
@@ -104,8 +101,10 @@ void fill_eproc __P((struct proc *, struct eproc *));
struct user {
struct pcb u_pcb;
+
struct sigacts u_sigacts; /* p_sigacts points here (use it!) */
struct pstats u_stats; /* p_stats points here (use it!) */
+
/*
* Remaining fields only for core dump and/or ptrace--
* not valid at other times!
@@ -128,13 +127,8 @@ struct user {
#define U_tsize u_kproc.kp_eproc.e_vm.vm_tsize
#define U_dsize u_kproc.kp_eproc.e_vm.vm_dsize
#define U_ssize u_kproc.kp_eproc.e_vm.vm_ssize
-#ifndef COMPAT_LINUX_THREADS
#define U_sig u_sigacts.ps_sig
#define U_code u_sigacts.ps_code
-#else
-#define U_sig u_kproc.kp_proc.p_sig
-#define U_code u_kproc.kp_proc.p_code
-#endif /* COMPAT_LINUX_THREADS */
#ifndef KERNEL
#define u_ar0 U_ar0
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index f5c54b11c533..5567a3a5e079 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
- * $Id: vnode.h,v 1.79 1999/01/05 18:50:01 eivind Exp $
+ * $Id: vnode.h,v 1.74 1998/09/11 18:50:16 rvb Exp $
*/
#ifndef _SYS_VNODE_H_
@@ -69,7 +69,7 @@ enum vtagtype {
* Each underlying filesystem allocates its own private area and hangs
* it from v_data. If non-null, this area is freed in getnewvnode().
*/
-TAILQ_HEAD(buflists, buf);
+LIST_HEAD(buflists, buf);
typedef int vop_t __P((void *));
struct namecache;
@@ -125,10 +125,6 @@ struct vnode {
short vpi_events; /* what they are looking for */
short vpi_revents; /* what has happened */
} v_pollinfo;
-#ifdef DEBUG_LOCKS
- const char *filename; /* Source file doing locking */
- int line; /* Line number doing locking */
-#endif
};
#define v_mountedhere v_un.vu_mountedhere
#define v_socket v_un.vu_socket
@@ -246,6 +242,7 @@ extern int vttoif_tab[];
#define WRITECLOSE 0x0004 /* vflush: only close writable files */
#define DOCLOSE 0x0008 /* vclean: close active files */
#define V_SAVE 0x0001 /* vinvalbuf: sync file first */
+#define V_SAVEMETA 0x0002 /* vinvalbuf: leave indirect blocks */
#define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */
#define VREF(vp) vref(vp)
@@ -263,8 +260,7 @@ extern int vttoif_tab[];
#define VNODEOP_SET(f) DATA_SET(MODVNOPS,f)
#else
#define VNODEOP_SET(f) \
- SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_add_vnodeops, &f); \
- SYSUNINIT(f##uninit, SI_SUB_VFS, SI_ORDER_SECOND, vfs_rm_vnodeops, &f);
+ SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_mod_opv_init, &f);
#endif
/*
@@ -492,8 +488,8 @@ void vattr_null __P((struct vattr *vap));
int vcount __P((struct vnode *vp));
void vdrop __P((struct vnode *));
int vfinddev __P((dev_t dev, enum vtype type, struct vnode **vpp));
-void vfs_add_vnodeops __P((void *));
-void vfs_rm_vnodeops __P((void *));
+void vfs_opv_init __P((struct vnodeopv_desc *opv));
+void vfs_mod_opv_init __P((void *handle));
int vflush __P((struct mount *mp, struct vnode *skipvp, int flags));
int vget __P((struct vnode *vp, int lockflag, struct proc *p));
void vgone __P((struct vnode *vp));
@@ -509,11 +505,6 @@ int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp,
int vn_close __P((struct vnode *vp,
int flags, struct ucred *cred, struct proc *p));
int vn_lock __P((struct vnode *vp, int flags, struct proc *p));
-#ifdef DEBUG_LOCKS
-int debug_vn_lock __P((struct vnode *vp, int flags, struct proc *p,
- const char *filename, int line));
-#define vn_lock(vp,flags,p) debug_vn_lock(vp,flags,p,__FILE__,__LINE__)
-#endif
int vn_open __P((struct nameidata *ndp, int fmode, int cmode));
void vn_pollevent __P((struct vnode *vp, int events));
void vn_pollgone __P((struct vnode *vp));
@@ -525,7 +516,7 @@ int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
void vn_syncer_add_to_worklist __P((struct vnode *vp, int delay));
int vfs_cache_lookup __P((struct vop_lookup_args *ap));
int vfs_object_create __P((struct vnode *vp, struct proc *p,
- struct ucred *cred));
+ struct ucred *cred, int waslocked));
int vn_writechk __P((struct vnode *vp));
int vop_stdbwrite __P((struct vop_bwrite_args *ap));
int vop_stdislocked __P((struct vop_islocked_args *));
@@ -545,7 +536,6 @@ int vop_einval __P((struct vop_generic_args *ap));
int vop_enotty __P((struct vop_generic_args *ap));
int vop_defaultop __P((struct vop_generic_args *ap));
int vop_null __P((struct vop_generic_args *ap));
-int vop_panic __P((struct vop_generic_args *ap));
struct vnode *
checkalias __P((struct vnode *vp, dev_t nvp_rdev, struct mount *mp));
diff --git a/sys/sys/xrpuio.h b/sys/sys/xrpuio.h
deleted file mode 100644
index a5eca5631e11..000000000000
--- a/sys/sys/xrpuio.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- *
- * $Id$
- *
- */
-
-#ifndef _SYS_XRPUIO_H_
-#define _SYS_XRPUIO_H_
-
-#include <sys/ioccom.h>
-
-#define XRPU_MAX_PPS 16
-struct xrpu_timecounting {
-
- /* The timecounter itself */
- u_int xt_addr_trigger;
- u_int xt_addr_latch;
- unsigned xt_mask;
- u_int32_t xt_frequency;
- char xt_name[16];
-
- /* The PPS latches */
- struct {
- u_int xt_addr_assert;
- u_int xt_addr_clear;
- } xt_pps[XRPU_MAX_PPS];
-};
-
-#define XRPU_IOC_TIMECOUNTING _IOW('6', 1, struct xrpu_timecounting)
-
-#endif /* _SYS_XRPUIO_H_ */
diff --git a/sys/ufs/ffs/README b/sys/ufs/ffs/README
deleted file mode 100644
index 8a7433b61e9e..000000000000
--- a/sys/ufs/ffs/README
+++ /dev/null
@@ -1,320 +0,0 @@
-Introduction
-
-This package constitutes the alpha distribution of the soft update
-code updates for the fast filesystem.
-
-For More information on what Soft Updates is, see:
-http://www.ece.cmu.edu/~ganger/papers/CSE-TR-254-95/
-
-Status
-
-My `filesystem torture tests' (described below) run for days without
-a hitch (no panic's, hangs, filesystem corruption, or memory leaks).
-However, I have had several panic's reported to me by folks that
-are field testing the code which I have not yet been able to
-reproduce or fix. Although these panic's are rare and do not cause
-filesystem corruption, the code should only be put into production
-on systems where the system administrator is aware that it is being
-run, and knows how to turn it off if problems arise. Thus, you may
-hand out this code to others, but please ensure that this status
-message is included with any distributions. Please also include
-the file ffs_softdep.stub.c in any distributions so that folks that
-cannot abide by the need to redistribute source will not be left
-with a kernel that will not link. It will resolve all the calls
-into the soft update code and simply ignores the request to enable
-them. Thus you will be able to ensure that your other hooks have
-not broken anything and that your kernel is softdep-ready for those
-that wish to use them. Please report problems back to me with
-kernel backtraces of panics if possible. This is massively complex
-code, and people only have to have their filesystems hosed once or
-twice to avoid future changes like the plague. I want to find and
-fix as many bugs as soon as possible so as to get the code rock
-solid before it gets widely released. Please report any bugs that
-you uncover to mckusick@mckusick.com.
-
-Performance
-
-Running the Andrew Benchmarks yields the following raw data:
-
- Phase Normal Softdep What it does
- 1 3s <1s Creating directories
- 2 8s 4s Copying files
- 3 6s 6s Recursive directory stats
- 4 8s 9s Scanning each file
- 5 25s 25s Compilation
-
- Normal: 19.9u 29.2s 0:52.8 135+630io
- Softdep: 20.3u 28.5s 0:47.8 103+363io
-
-Another interesting datapoint are my `filesystem torture tests'.
-They consist of 1000 runs of the andrew benchmarks, 1000 copy and
-removes of /etc with randomly selected pauses of 0-60 seconds
-between each copy and remove, and 500 find from / with randomly
-selected pauses of 100 seconds between each run). The run of the
-torture test compares as follows:
-
-With soft updates: writes: 6 sync, 1,113,686 async; run time 19hr, 50min
-Normal filesystem: writes: 1,459,147 sync, 487,031 async; run time 27hr, 15min
-
-The upshot is 42% less I/O and 28% shorter running time.
-
-Another interesting test point is a full MAKEDEV. Because it runs
-as a shell script, it becomes mostly limited by the execution speed
-of the machine on which it runs. Here are the numbers:
-
-With soft updates:
-
- labrat# time ./MAKEDEV std
- 2.2u 32.6s 0:34.82 100.0% 0+0k 11+36io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Without soft updates:
-
- labrat# time ./MAKEDEV std
- 2.0u 40.5s 0:42.53 100.0% 0+0k 11+1221io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Of course, some of the system time is being pushed
-to the syncer process, but that is a different story.
-
-To show a benchmark designed to highlight the soft update code
-consider a tar of zero-sized files and an rm -rf of a directory tree
-that has at least 50 files or so at each level. Running a test with
-a directory tree containing 28 directories holding 202 empty files
-produces the following numbers:
-
-With soft updates:
-tar: 0.0u 0.5s 0:00.65 76.9% 0+0k 0+44io 0pf+0w (0 sync, 33 async writes)
-rm: 0.0u 0.2s 0:00.20 100.0% 0+0k 0+37io 0pf+0w (0 sync, 72 async writes)
-
-Normal filesystem:
-tar: 0.0u 1.1s 0:07.27 16.5% 0+0k 60+586io 0pf+0w (523 sync, 0 async writes)
-rm: 0.0u 0.5s 0:01.84 29.3% 0+0k 0+318io 0pf+0w (258 sync, 65 async writes)
-
-The large reduction in writes is because inodes are clustered, so
-most of a block gets allocated, then the whole block is written
-out once rather than having the same block written once for each
-inode allocated from it. Similarly each directory block is written
-once rather than once for each new directory entry. Effectively
-what the update code is doing is allocating a bunch of inodes
-and directory entries without writing anything, then ensuring that
-the block containing the inodes is written first followed by the
-directory block that references them. If there were data in the
-files it would further ensure that the data blocks were written
-before their inodes claimed them.
-
-Copyright Restrictions
-
-Please familiarize yourself with the copyright restrictions
-contained at the top of either the sys/ufs/ffs/softdep.h or
-sys/ufs/ffs/ffs_softdep.c file. The key provision is similar
-to the one used by the DB 2.0 package and goes as follows:
-
- Redistributions in any form must be accompanied by information
- on how to obtain complete source code for any accompanying
- software that uses the this software. This source code must
- either be included in the distribution or be available for
- no more than the cost of distribution plus a nominal fee,
- and must be freely redistributable under reasonable
- conditions. For an executable file, complete source code
- means the source code for all modules it contains. It does
- not mean source code for modules or files that typically
- accompany the operating system on which the executable file
- runs, e.g., standard library modules or system header files.
-
-The idea is to allow those of you freely redistributing your source
-to use it while retaining for myself the right to peddle it for
-money to the commercial UNIX vendors. Note that I have included a
-stub file ffs_softdep.c.stub that is freely redistributable so that
-you can put in all the necessary hooks to run the full soft updates
-code, but still allow vendors that want to maintain proprietary
-source to have a working system. I do plan to release the code with
-a `Berkeley style' copyright once I have peddled it around to the
-commercial vendors. If you have concerns about this copyright,
-feel free to contact me with them and we can try to resolve any
-difficulties.
-
-Soft Dependency Operation
-
-The soft update implementation does NOT require ANY changes
-to the on-disk format of your filesystems. Furthermore it is
-not used by default for any filesystems. It must be enabled on
-a filesystem by filesystem basis by running tunefs to set a
-bit in the superblock indicating that the filesystem should be
-managed using soft updates. If you wish to stop using
-soft updates due to performance or reliability reasons,
-you can simply run tunefs on it again to turn off the bit and
-revert to normal operation. The additional dynamic memory load
-placed on the kernel malloc arena is approximately equal to
-the amount of memory used by vnodes plus inodes (for a system
-with 1000 vnodes, the additional peak memory load is about 300K).
-
-Kernel Changes
-
-There are two new changes to the kernel functionality that are not
-contained in in the soft update files. The first is a `trickle
-sync' facility running in the kernel as process 3. This trickle
-sync process replaces the traditional `update' program (which should
-be commented out of the /etc/rc startup script). When a vnode is
-first written it is placed 30 seconds down on the trickle sync
-queue. If it still exists and has dirty data when it reaches the
-top of the queue, it is sync'ed. This approach evens out the load
-on the underlying I/O system and avoids writing short-lived files.
-The papers on trickle-sync tend to favor aging based on buffers
-rather than files. However, I sync on file age rather than buffer
-age because the data structures are much smaller as there are
-typically far fewer files than buffers. Although this can make the
-I/O spikey when a big file times out, it is still much better than
-the wholesale sync's that were happening before. It also adapts
-much better to the soft update code where I want to control
-aging to improve performance (inodes age in 10 seconds, directories
-in 15 seconds, files in 30 seconds). This ensures that most
-dependencies are gone (e.g., inodes are written when directory
-entries want to go to disk) reducing the amount of rollback that
-is needed.
-
-The other main kernel change is to split the vnode freelist into
-two separate lists. One for vnodes that are still being used to
-identify buffers and the other for those vnodes no longer identifying
-any buffers. The latter list is used by getnewvnode in preference
-to the former.
-
-Packaging of Kernel Changes
-
-The sys subdirectory contains the changes and additions to the
-kernel. My goal in writing this code was to minimize the changes
-that need to be made to the kernel. Thus, most of the new code
-is contained in the two new files softdep.h and ffs_softdep.c.
-The rest of the kernel changes are simply inserting hooks to
-call into these two new files. Although there has been some
-structural reorganization of the filesystem code to accommodate
-gathering the information required by the soft update code,
-the actual ordering of filesystem operations when soft updates
-are disabled is unchanged.
-
-The kernel changes are packaged as a set of diffs. As I am
-doing my development in BSD/OS, the diffs are relative to the
-BSD/OS versions of the files. Because BSD/OS recently had
-4.4BSD-Lite2 merged into it, the Lite2 files are a good starting
-point for figuring out the changes. There are 40 files that
-require change plus the two new files. Most of these files have
-only a few lines of changes in them. However, four files have
-fairly extensive changes: kern/vfs_subr.c, ufs/ufs/ufs_lookup.c,
-ufs/ufs/ufs_vnops.c, and ufs/ffs/ffs_alloc.c. For these four
-files, I have provided the original Lite2 version, the Lite2
-version with the diffs merged in, and the diffs between the
-BSD/OS and merged version. Even so, I expect that there will
-be some difficulty in doing the merge; I am certainly willing
-to assist in helping get the code merged into your system.
-
-Packaging of Utility Changes
-
-The utilities subdirectory contains the changes and additions
-to the utilities. There are diffs to three utilities enclosed:
-
- tunefs - add a flag to enable and disable soft updates
-
- mount - print out whether soft updates are enabled and
- also statistics on number of sync and async writes
-
- fsck - tighter checks on acceptable errors and a slightly
- different policy for what to put in lost+found on
- filesystems using soft updates
-
-In addition you should recompile vmstat so as to get reports
-on the 13 new memory types used by the soft update code.
-It is not necessary to use the new version of fsck, however it
-would aid in my debugging if you do. Also, because of the time
-lag between deleting a directory entry and the inode it
-references, you will find a lot more files showing up in your
-lost+found if you do not use the new version. Note that the
-new version checks for the soft update flag in the superblock
-and only uses the new algorithms if it is set. So, it will run
-unchanged on the filesystems that are not using soft updates.
-
-Operation
-
-Once you have booted a kernel that incorporates the soft update
-code and installed the updated utilities, do the following:
-
-1) Comment out the update program in /etc/rc.
-
-2) Run `tunefs -n enable' on one or more test filesystems.
-
-3) Mount these filesystems and then type `mount' to ensure that
- they have been enabled for soft updates.
-
-4) Copy the test directory to a softdep filesystem, chdir into
- it and run `./doit'. You may want to check out each of the
- three subtests individually first: doit1 - andrew benchmarks,
- doit2 - copy and removal of /etc, doit3 - find from /.
-
-====
-Additional notes from Feb 13
-
-hen removing huge directories of files, it is possible to get
-the incore state arbitrarily far ahead of the disk. Maintaining
-all the associated depedency information can exhaust the kernel
-malloc arena. To avoid this senario, I have put some limits on
-the soft update code so that it will not be allowed to rampage
-through all of the kernel memory. I enclose below the relevant
-patches to vnode.h and vfs_subr.c (which allow the soft update
-code to speed up the filesystem syncer process). I have also
-included the diffs for ffs_softdep.c. I hope to make a pass over
-ffs_softdep.c to isolate the differences with my standard version
-so that these diffs are less painful to incorporate.
-
-Since I know you like to play with tuning, I have put the relevant
-knobs on sysctl debug variables. The tuning knobs can be viewed
-with `sysctl debug' and set with `sysctl -w debug.<name>=value'.
-The knobs are as follows:
-
- debug.max_softdeps - limit on any given resource
- debug.tickdelay - ticks to delay before allocating
- debug.max_limit_hit - number of times tickdelay imposed
- debug.rush_requests - number of rush requests to filesystem syncer
-
-The max_softdeps limit is derived from vnodesdesired which in
-turn is sized based on the amount of memory on the machine.
-When the limit is hit, a process requesting a resource first
-tries to speed up the filesystem syncer process. Such a
-request is recorded as a rush_request. After syncdelay / 2
-unserviced rush requests (typically 15) are in the filesystem
-syncers queue (i.e., it is more than 15 seconds behind in its
-work), the process requesting the memory is put to sleep for
-tickdelay seconds. Such a delay is recorded in max_limit_hit.
-Following this delay it is granted its memory without further
-delay. I have tried the following experiments in which I
-delete an MH directory containing 16,703 files:
-
-Run # 1 2 3
-
-max_softdeps 4496 4496 4496
-tickdelay 100 == 1 sec 20 == 0.2 sec 2 == 0.02 sec
-max_limit_hit 16 == 16 sec 27 == 5.4 sec 203 == 4.1 sec
-rush_requests 147 102 93
-run time 57 sec 46 sec 45 sec
-I/O's 781 859 936
-
-When run with no limits, it completes in 40 seconds. So, the
-time spent in delay is directly added to the bottom line.
-Shortening the tick delay does cut down the total running time,
-but at the expense of generating more total I/O operations
-due to the rush orders being sent to the filesystem syncer.
-Although the number of rush orders decreases with a shorter
-tick delay, there are more requests in each order, hence the
-increase in I/O count. Also, although the I/O count does rise
-with a shorter delay, it is still at least an order of magnitude
-less than without soft updates. Anyway, you may want to play
-around with these value to see what works best and to see if
-you can get an insight into how best to tune them. If you get
-out of memory panic's, then you have max_softdeps set too high.
-The max_limit_hit and rush_requests show be reset to zero
-before each run. The minimum legal value for tickdelay is 2
-(if you set it below that, the code will use 2).
-
-
diff --git a/sys/ufs/ffs/README.softupdates b/sys/ufs/ffs/README.softupdates
index 96e2df11b2e3..d9c9f763382e 100644
--- a/sys/ufs/ffs/README.softupdates
+++ b/sys/ufs/ffs/README.softupdates
@@ -13,10 +13,6 @@ read the copyrights in the sources and the README file in
that you are acting legally. The stub file provided here is only enough
to allow the system to function without this option being turned on.
-WARNING: RE-DISTRIBUTING A KERNEL WITH SOFTUPDATES COMPILED IN WITHOUT
-DISTRIBUTING THE SOURCE TO THE _ENTIRE_ KERNEL IS NOT PERMITTED. See the
-copyright on the soft update files, or ../../../contrib/sys/softupdates/README
-
Once you're running a kernel with soft update support, you need to enable
it for whichever filesystems you wish to run with the soft update policy.
This is done with the -n option to tunefs(8) on the UNMOUNTED filesystems,
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 2794e32be088..bd127db179f1 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95
- * $Id: ffs_alloc.c,v 1.55 1999/01/06 17:04:33 bde Exp $
+ * $Id: ffs_alloc.c,v 1.52 1998/09/05 14:13:12 phk Exp $
*/
#include "opt_quota.h"
@@ -42,13 +42,13 @@
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/mount.h>
-#include <sys/kernel.h>
+#ifdef notyet
#include <sys/sysctl.h>
+#endif
#include <sys/syslog.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
-#include <ufs/ufs/ufs_extern.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ffs/fs.h>
@@ -65,8 +65,10 @@ static int ffs_checkblk __P((struct inode *, ufs_daddr_t, long));
#endif
static void ffs_clusteracct __P((struct fs *, struct cg *, ufs_daddr_t,
int));
+#ifdef notyet
static ufs_daddr_t ffs_clusteralloc __P((struct inode *, int, ufs_daddr_t,
int));
+#endif
static ino_t ffs_dirpref __P((struct fs *));
static ufs_daddr_t ffs_fragextend __P((struct inode *, int, long, int, int));
static void ffs_fserr __P((struct fs *, u_int, char *));
@@ -321,6 +323,7 @@ nospace:
return (ENOSPC);
}
+#ifdef notyet
SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem");
/*
@@ -343,8 +346,7 @@ SYSCTL_INT(_vfs_ffs, FFS_ASYNCFREE, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""
static int doreallocblks = 1;
SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
-#ifdef DEBUG
-static volatile int prtrealloc = 0;
+static int prtrealloc = 0;
#endif
int
@@ -354,6 +356,9 @@ ffs_reallocblks(ap)
struct cluster_save *a_buflist;
} */ *ap;
{
+#if !defined (not_yes)
+ return (ENOSPC);
+#else
struct fs *fs;
struct inode *ip;
struct vnode *vp;
@@ -363,6 +368,7 @@ ffs_reallocblks(ap)
ufs_daddr_t start_lbn, end_lbn, soff, newblk, blkno;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
int i, len, start_lvl, end_lvl, pref, ssize;
+ struct timeval tv;
if (doreallocblks == 0)
return (ENOSPC);
@@ -502,8 +508,10 @@ ffs_reallocblks(ap)
bwrite(sbp);
} else {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- if (!doasyncfree)
- UFS_UPDATE(vp, 1);
+ if (!doasyncfree) {
+ gettime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 1);
+ }
}
if (ssize < len)
if (doasyncfree)
@@ -545,6 +553,7 @@ fail:
if (sbap != &ip->i_db[0])
brelse(sbp);
return (ENOSPC);
+#endif
}
/*
@@ -1078,6 +1087,7 @@ gotit:
return (blkno);
}
+#ifdef notyet
/*
* Determine whether a cluster can be allocated.
*
@@ -1186,6 +1196,7 @@ fail:
brelse(bp);
return (0);
}
+#endif
/*
* Determine whether an inode can be allocated.
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 938899a81248..0cb97ee83707 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95
- * $Id: ffs_extern.h,v 1.24 1998/03/23 14:12:37 bde Exp $
+ * $Id: ffs_extern.h,v 1.23 1998/03/08 09:58:50 julian Exp $
*/
#ifndef _UFS_FFS_EXTERN_H
@@ -94,7 +94,7 @@ int ffs_statfs __P((struct mount *, struct statfs *, struct proc *));
int ffs_sync __P((struct mount *, int, struct ucred *, struct proc *));
int ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int ffs_unmount __P((struct mount *, int, struct proc *));
-int ffs_update __P((struct vnode *, int));
+int ffs_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ffs_vfree __P((struct vnode *, ino_t, int));
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index b474bc5413a3..d990b2f8b899 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
- * $Id: ffs_inode.c,v 1.51 1999/01/06 18:18:06 bde Exp $
+ * $Id: ffs_inode.c,v 1.46 1998/07/04 20:45:38 julian Exp $
*/
#include "opt_quota.h"
@@ -70,8 +70,10 @@ static int ffs_indirtrunc __P((struct inode *, ufs_daddr_t, ufs_daddr_t,
* set, then wait for the write to complete.
*/
int
-ffs_update(vp, waitfor)
+ffs_update(vp, access, modify, waitfor)
struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
int waitfor;
{
register struct fs *fs;
@@ -79,10 +81,12 @@ ffs_update(vp, waitfor)
struct inode *ip;
int error;
- ufs_itimes(vp);
ip = VTOI(vp);
- if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0)
+ if (((ip->i_flag &
+ (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
+ (waitfor != MNT_WAIT))
return (0);
+ ufs_itimes(vp);
ip->i_flag &= ~(IN_LAZYMOD | IN_MODIFIED);
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (0);
@@ -140,7 +144,8 @@ ffs_truncate(vp, length, flags, cred, p)
register struct fs *fs;
struct buf *bp;
int offset, size, level;
- long count, nblocks, blocksreleased = 0;
+ long count, nblocks, vflags, blocksreleased = 0;
+ struct timeval tv;
register int i;
int aflags, error, allerror;
off_t osize;
@@ -153,6 +158,7 @@ ffs_truncate(vp, length, flags, cred, p)
return (EINVAL);
if (length > fs->fs_maxfilesize)
return (EFBIG);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
(oip->i_size < ovp->v_mount->mnt_maxsymlinklen || oip->i_din.di_blocks == 0)) {
#ifdef DIAGNOSTIC
@@ -162,11 +168,11 @@ ffs_truncate(vp, length, flags, cred, p)
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#ifdef QUOTA
error = getinoquota(oip);
@@ -195,7 +201,7 @@ ffs_truncate(vp, length, flags, cred, p)
softdep_setup_freeblocks(oip, length);
vinvalbuf(ovp, 0, cred, p, 0, 0);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (ffs_update(ovp, 0));
+ return (ffs_update(ovp, &tv, &tv, 0));
}
}
osize = oip->i_size;
@@ -223,7 +229,7 @@ ffs_truncate(vp, length, flags, cred, p)
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -287,7 +293,7 @@ ffs_truncate(vp, length, flags, cred, p)
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- allerror = UFS_UPDATE(ovp, ((length > 0) ? 0 : 1));
+ allerror = UFS_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1));
/*
* Having written the new inode to disk, save its new configuration
@@ -381,8 +387,7 @@ done:
if (newblks[i] != oip->i_db[i])
panic("ffs_truncate2");
if (length == 0 &&
- (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) ||
- !TAILQ_EMPTY(&ovp->v_cleanblkhd)))
+ (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first))
panic("ffs_truncate3");
#endif /* DIAGNOSTIC */
/*
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index 5052b89f8a8c..36537180788b 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95
- * $Id: ffs_subr.c,v 1.22 1998/11/29 03:12:06 bde Exp $
+ * $Id: ffs_subr.c,v 1.20 1998/03/08 09:58:59 julian Exp $
*/
#include <sys/param.h>
@@ -53,7 +53,7 @@
#include <ufs/ffs/ffs_extern.h>
#ifdef DDB
-void ffs_checkoverlap __P((struct buf *, struct inode *));
+static void ffs_checkoverlap __P((struct buf *, struct inode *));
#endif
/*
@@ -128,7 +128,7 @@ ffs_fragacct(fs, fragmap, fraglist, cnt)
}
#ifdef DDB
-void
+static void
ffs_checkoverlap(bp, ip)
struct buf *bp;
struct inode *ip;
@@ -144,8 +144,8 @@ ffs_checkoverlap(bp, ip)
if (ep == bp || (ep->b_flags & B_INVAL) ||
ep->b_vp == NULLVP)
continue;
- if (VOP_BMAP(ep->b_vp, (ufs_daddr_t)0, &vp, (ufs_daddr_t *)NULL,
- (int *)NULL, (int *)NULL))
+ if (VOP_BMAP(ep->b_vp, (ufs_daddr_t)0, &vp, (ufs_daddr_t)0,
+ NULL, NULL))
continue;
if (vp != ip->i_devvp)
continue;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2973703da405..d06fee679c59 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
- * $Id: ffs_vfsops.c,v 1.94 1999/01/05 18:50:03 eivind Exp $
+ * $Id: ffs_vfsops.c,v 1.87 1998/09/14 19:56:41 sos Exp $
*/
#include "opt_quota.h"
@@ -290,8 +290,7 @@ ffs_mount( mp, path, data, ndp, p)
err = ENOTBLK;
goto error_2;
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
err = ENXIO;
goto error_2;
}
@@ -453,16 +452,15 @@ ffs_reload(mp, cred, p)
panic("ffs_reload: dirty1");
dev = devvp->v_rdev;
-
/*
* Only VMIO the backing device if the backing device is a real
- * block device. See ffs_mountmfs() for more details.
+ * block device. This excludes the original MFS implementation.
+ * Note that it is optional that the backing device be VMIOed. This
+ * increases the opportunity for metadata caching.
*/
- if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- vfs_object_create(devvp, p, p->p_ucred);
+ if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
simple_lock(&devvp->v_interlock);
- VOP_UNLOCK(devvp, LK_INTERLOCK, p);
+ vfs_object_create(devvp, p, p->p_ucred, 0);
}
/*
@@ -578,10 +576,12 @@ ffs_mountfs(devvp, mp, p, malloctype)
register struct ufsmount *ump;
struct buf *bp;
register struct fs *fs;
+ struct cg *cgp;
dev_t dev;
struct partinfo dpart;
+ struct csum cstotal;
caddr_t base, space;
- int error, i, blks, size, ronly;
+ int error, i, cyl, blks, size, ronly;
int32_t *lp;
struct ucred *cred;
u_int64_t maxfilesize; /* XXX */
@@ -615,13 +615,12 @@ ffs_mountfs(devvp, mp, p, malloctype)
* Note that it is optional that the backing device be VMIOed. This
* increases the opportunity for metadata caching.
*/
- if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- vfs_object_create(devvp, p, p->p_ucred);
+ if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
simple_lock(&devvp->v_interlock);
- VOP_UNLOCK(devvp, LK_INTERLOCK, p);
+ vfs_object_create(devvp, p, p->p_ucred, 0);
}
+
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
if (error)
@@ -951,6 +950,7 @@ ffs_sync(mp, waitfor, cred, p)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
+ struct timeval tv;
int error, allerror = 0;
fs = ump->um_fs;
@@ -975,7 +975,7 @@ loop:
ip = VTOI(vp);
if ((vp->v_type == VNON) || ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || (waitfor == MNT_LAZY))) {
+ ((vp->v_dirtyblkhd.lh_first == NULL) || (waitfor == MNT_LAZY))) {
simple_unlock(&vp->v_interlock);
continue;
}
@@ -997,8 +997,9 @@ loop:
} else {
simple_unlock(&mntvnode_slock);
simple_unlock(&vp->v_interlock);
- /* UFS_UPDATE(vp, waitfor == MNT_WAIT); */
- UFS_UPDATE(vp, 0);
+ getmicrotime(&tv);
+ /* UFS_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
+ UFS_UPDATE(vp, &tv, &tv, 0);
simple_lock(&mntvnode_slock);
}
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 1823c0f0af13..093c625fa878 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
- * $Id: ffs_vnops.c,v 1.53 1998/10/31 15:31:27 peter Exp $
+ * $Id: ffs_vnops.c,v 1.51 1998/09/07 11:50:19 bde Exp $
*/
#include <sys/param.h>
@@ -122,6 +122,7 @@ ffs_fsync(ap)
{
struct vnode *vp = ap->a_vp;
struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s, error, passes, skipmeta;
daddr_t lbn;
@@ -145,8 +146,8 @@ ffs_fsync(ap)
loop:
s = splbio();
loop2:
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
/*
* First time through on a synchronous call,
* or if it's already scheduled, skip to the next
@@ -227,7 +228,7 @@ loop2:
return (error);
s = splbio();
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
/*
* Block devices associated with filesystems may
* have new I/O requests posted for them even if
@@ -247,5 +248,6 @@ loop2:
}
}
splx(s);
- return (UFS_UPDATE(vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index 1ea0804e1b0d..01bf24d0e9f3 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95
- * $Id: mfs_vfsops.c,v 1.52 1998/12/07 21:58:49 archie Exp $
+ * $Id: mfs_vfsops.c,v 1.50 1998/10/10 08:12:24 jkh Exp $
*/
@@ -103,7 +103,7 @@ VFS_SET(mfs_vfsops, mfs, 0);
#ifdef MFS_ROOT_SIZE
/* Image was already written into mfs_root */
static u_char mfs_root[MFS_ROOT_SIZE*1024] = "MFS Filesystem goes here";
-static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here";
+static u_char end_mfs_root[] = "MFS Filesystem had better STOP here";
#endif
u_char *
@@ -391,16 +391,6 @@ mfs_start(mp, flags, p)
register int gotsig = 0;
base = mfsp->mfs_baseoff;
-
- /*
- * Must set P_SYSTEM to prevent system from trying to kill
- * this process. What happens is that the process is unkillable,
- * and the swapper loops trying to continuously kill it. Nor
- * can we swap out this process - not unless you want a deadlock,
- * anyway.
- */
- curproc->p_flag |= P_SYSTEM;
-
while (mfsp->mfs_active) {
while (bp = bufq_first(&mfsp->buf_queue)) {
bufq_remove(&mfsp->buf_queue, bp);
diff --git a/sys/ufs/mfs/mfsiom.h b/sys/ufs/mfs/mfsiom.h
new file mode 100644
index 000000000000..d0a0b608a278
--- /dev/null
+++ b/sys/ufs/mfs/mfsiom.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ * @(#)mfsiom.h 8.1 (Berkeley) 6/11/93
+ * $Id$
+ */
+
+#ifndef _UFS_MFS_MFSIOM_H_
+#define _UFS_MFS_MFSIOM_H_
+
+#define MFS_MAPREG (MAXPHYS/PAGE_SIZE + 2) /* Kernel mapping pte's */
+#define MFS_MAPSIZE 10 /* Size of alloc map for pte's */
+
+#endif
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 8d23b7e9200d..86638856d872 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
- * $Id: ufs_bmap.c,v 1.23 1998/10/26 08:53:13 bde Exp $
+ * $Id: ufs_bmap.c,v 1.21 1998/07/04 20:45:39 julian Exp $
*/
#include <sys/param.h>
@@ -149,8 +149,9 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*/
devvp = ip->i_devvp;
- if (devvp != NULL && devvp->v_tag != VT_MFS &&
- devvp->v_type == VBLK) {
+ if (devvp && devvp->v_type == VBLK &&
+ (devvp->v_rdev != NODEV) &&
+ (major(devvp->v_rdev) < nblkdev)) {
if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
maxrun = MAXPHYS;
vp->v_maxio = MAXPHYS;
diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c
index 33f1d2ac1b68..8a2de1498836 100644
--- a/sys/ufs/ufs/ufs_disksubr.c
+++ b/sys/ufs/ufs/ufs_disksubr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
- * $Id: ufs_disksubr.c,v 1.38 1998/10/17 07:49:04 bde Exp $
+ * $Id: ufs_disksubr.c,v 1.37 1998/10/16 10:14:21 jkh Exp $
*/
#include <sys/param.h>
@@ -371,7 +371,7 @@ diskerr(bp, dname, what, pri, blkdone, lp)
daddr_t sn;
if (pri != LOG_PRINTF) {
- log(pri, "%s", "");
+ log(pri, "");
pr = addlog;
} else
pr = printf;
diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c
index 853c739e408b..a51ff4e16db2 100644
--- a/sys/ufs/ufs/ufs_ihash.c
+++ b/sys/ufs/ufs/ufs_ihash.c
@@ -31,12 +31,11 @@
* SUCH DAMAGE.
*
* @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95
- * $Id: ufs_ihash.c,v 1.17 1998/11/10 09:16:27 peter Exp $
+ * $Id: ufs_ihash.c,v 1.15 1998/02/06 12:14:17 eivind Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
@@ -53,9 +52,7 @@ static MALLOC_DEFINE(M_UFSIHASH, "UFS ihash", "UFS Inode hash tables");
static LIST_HEAD(ihashhead, inode) *ihashtbl;
static u_long ihash; /* size of hash table - 1 */
#define INOHASH(device, inum) (&ihashtbl[((device) + (inum)) & ihash])
-#ifndef NULL_SIMPLELOCKS
static struct simplelock ufs_ihash_slock;
-#endif
/*
* Initialize inode hash table.
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index 1f4e0b1af8d7..be4d2bb4f18b 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_inode.c 8.9 (Berkeley) 5/14/95
- * $Id: ufs_inode.c,v 1.23 1998/07/03 22:17:02 bde Exp $
+ * $Id: ufs_inode.c,v 1.22 1998/03/30 09:56:16 phk Exp $
*/
#include "opt_quota.h"
@@ -66,6 +66,7 @@ ufs_inactive(ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
struct proc *p = ap->a_p;
+ struct timeval tv;
int mode, error = 0;
if (prtactive && vp->v_usecount != 0)
@@ -88,8 +89,10 @@ ufs_inactive(ap)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
UFS_VFREE(vp, ip->i_number, mode);
}
- if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE))
- UFS_UPDATE(vp, 0);
+ if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) {
+ getmicrotime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 0);
+ }
out:
VOP_UNLOCK(vp, 0, p);
/*
@@ -113,6 +116,7 @@ ufs_reclaim(ap)
{
register struct inode *ip;
register struct vnode *vp = ap->a_vp;
+ struct timeval tv;
#ifdef QUOTA
int i;
#endif
@@ -122,7 +126,8 @@ ufs_reclaim(ap)
ip = VTOI(vp);
if (ip->i_flag & IN_LAZYMOD) {
ip->i_flag |= IN_MODIFIED;
- UFS_UPDATE(vp, 0);
+ getmicrotime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 0);
}
/*
* Remove the inode from its hash chain.
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index bd5e96f0e03e..936be19cb5ef 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95
- * $Id: ufs_lookup.c,v 1.25 1998/07/11 07:46:07 bde Exp $
+ * $Id: ufs_lookup.c,v 1.24 1998/04/15 12:27:31 bde Exp $
*/
#include <sys/param.h>
@@ -670,6 +670,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
struct direct *ep, *nep;
int error, ret, blkoff, loc, spacefree, flags;
char *dirbuf;
+ struct timeval tv;
p = curproc; /* XXX */
cr = p->p_ucred;
@@ -721,7 +722,8 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
} else {
error = VOP_BWRITE(bp);
}
- ret = UFS_UPDATE(dvp, !DOINGSOFTDEP(dvp));
+ getmicrotime(&tv);
+ ret = UFS_UPDATE(dvp, &tv, &tv, !DOINGSOFTDEP(dvp));
if (error == 0)
return (ret);
return (error);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 99c35c7b5711..c833cdf81ee3 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -34,12 +34,11 @@
* SUCH DAMAGE.
*
* @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95
- * $Id: ufs_quota.c,v 1.24 1998/07/15 02:32:34 bde Exp $
+ * $Id: ufs_quota.c,v 1.23 1998/06/21 14:53:40 bde Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/namei.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index 026d348696de..2f5b7f3863b5 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95
- * $Id: ufs_readwrite.c,v 1.54 1998/12/15 03:29:52 julian Exp $
+ * $Id: ufs_readwrite.c,v 1.52 1998/09/07 11:50:19 bde Exp $
*/
#define BLKSIZE(a, b, c) blksize(a, b, c)
@@ -107,35 +107,17 @@ READ(ap)
if (object)
vm_object_reference(object);
#if 1
- /*
- * If IO optimisation is turned on,
- * and we are NOT a VM based IO request,
- * (i.e. not headed for the buffer cache)
- * but there IS a vm object associated with it.
- */
if ((ioflag & IO_VMIO) == 0 && (vfs_ioopt > 1) && object) {
int nread, toread;
-
toread = uio->uio_resid;
if (toread > bytesinfile)
toread = bytesinfile;
if (toread >= PAGE_SIZE) {
- /*
- * Then if it's at least a page in size, try
- * get the data from the object using vm tricks
- */
error = uioread(toread, uio, object, &nread);
if ((uio->uio_resid == 0) || (error != 0)) {
- /*
- * If we finished or there was an error
- * then finish up.
- */
if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
ip->i_flag |= IN_ACCESS;
if (object)
- /*
- * This I don't understand
- */
vm_object_vndeallocate(object);
return error;
}
@@ -143,29 +125,15 @@ READ(ap)
}
#endif
- /*
- * Ok so we couldn't do it all in one vm trick...
- * so cycle around trying smaller bites..
- */
for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
break;
#if 1
if ((ioflag & IO_VMIO) == 0 && (vfs_ioopt > 1) && object) {
- /*
- * Obviously we didn't finish above, but we
- * didn't get an error either. Try the same trick again.
- * but this time we are looping.
- */
int nread, toread;
toread = uio->uio_resid;
if (toread > bytesinfile)
toread = bytesinfile;
-
- /*
- * Once again, if there isn't enough for a
- * whole page, don't try optimising.
- */
if (toread >= PAGE_SIZE) {
error = uioread(toread, uio, object, &nread);
if ((uio->uio_resid == 0) || (error != 0)) {
@@ -175,11 +143,6 @@ READ(ap)
vm_object_vndeallocate(object);
return error;
}
- /*
- * To get here we didnt't finish or err.
- * If we did get some data,
- * loop to try another bite.
- */
if (nread > 0) {
continue;
}
@@ -191,68 +154,29 @@ READ(ap)
nextlbn = lbn + 1;
size = BLKSIZE(fs, ip, lbn);
blkoffset = blkoff(fs, uio->uio_offset);
-
- /*
- * The amount we want to transfer in this iteration is
- * one FS block less the amount of the data before
- * our startpoint (duh!)
- */
- xfersize = fs->fs_bsize - blkoffset;
- /*
- * But if we actually want less than the block,
- * or the file doesn't have a whole block more of data,
- * then use the lesser number.
- */
+ xfersize = fs->fs_bsize - blkoffset;
if (uio->uio_resid < xfersize)
xfersize = uio->uio_resid;
if (bytesinfile < xfersize)
xfersize = bytesinfile;
if (lblktosize(fs, nextlbn) >= ip->i_size)
- /*
- * Don't do readahead if this is the end of the file.
- */
error = bread(vp, lbn, size, NOCRED, &bp);
else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0)
- /*
- * Otherwise if we are allowed to cluster,
- * grab as much as we can.
- *
- * XXX This may not be a win if we are not
- * doing sequential access.
- */
error = cluster_read(vp, ip->i_size, lbn,
size, NOCRED, uio->uio_resid, seqcount, &bp);
else if (lbn - 1 == vp->v_lastr) {
- /*
- * If we are NOT allowed to cluster, then
- * if we appear to be acting sequentially,
- * fire off a request for a readahead
- * as well as a read. Note that the 4th and 5th
- * arguments point to arrays of the size specified in
- * the 6th argument.
- */
int nextsize = BLKSIZE(fs, ip, nextlbn);
error = breadn(vp, lbn,
size, &nextlbn, &nextsize, 1, NOCRED, &bp);
} else
- /*
- * Failing all of the above, just read what the
- * user asked for. Interestingly, the same as
- * the first option above.
- */
error = bread(vp, lbn, size, NOCRED, &bp);
if (error) {
brelse(bp);
bp = NULL;
break;
}
-
- /*
- * Remember where we read so we can see latter if we start
- * acting sequential.
- */
vp->v_lastr = lbn;
/*
@@ -270,22 +194,13 @@ READ(ap)
}
if (vfs_ioopt && object &&
- (bp->b_flags & B_VMIO) &&
- ((blkoffset & PAGE_MASK) == 0) &&
- ((xfersize & PAGE_MASK) == 0)) {
- /*
- * If VFS IO optimisation is turned on,
- * and it's an exact page multiple
- * And a normal VM based op,
- * then use uiomiveco()
- */
+ (bp->b_flags & B_VMIO) &&
+ ((blkoffset & PAGE_MASK) == 0) &&
+ ((xfersize & PAGE_MASK) == 0)) {
error =
uiomoveco((char *)bp->b_data + blkoffset,
(int)xfersize, uio, object);
} else {
- /*
- * otherwise use the general form
- */
error =
uiomove((char *)bp->b_data + blkoffset,
(int)xfersize, uio);
@@ -296,30 +211,13 @@ READ(ap)
if ((ioflag & IO_VMIO) &&
(LIST_FIRST(&bp->b_dep) == NULL)) {
- /*
- * If there are no dependencies, and
- * it's VMIO, then we don't need the buf,
- * mark it available for freeing. The VM has the data.
- */
bp->b_flags |= B_RELBUF;
brelse(bp);
} else {
- /*
- * Otherwise let whoever
- * made the request take care of
- * freeing it. We just queue
- * it onto another list.
- */
bqrelse(bp);
}
}
- /*
- * This can only happen in the case of an error
- * because the loop above resets bp to NULL on each iteration
- * and on normal completion has not set a new value into it.
- * so it must have come from a 'break' statement
- */
if (bp != NULL) {
if ((ioflag & IO_VMIO) &&
(LIST_FIRST(&bp->b_dep) == NULL)) {
@@ -358,6 +256,7 @@ WRITE(ap)
ufs_daddr_t lbn;
off_t osize;
int blkoffset, error, extended, flags, ioflag, resid, size, xfersize;
+ struct timeval tv;
vm_object_t object;
extended = 0;
@@ -492,8 +391,10 @@ WRITE(ap)
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- } else if (resid > uio->uio_resid && (ioflag & IO_SYNC))
- error = UFS_UPDATE(vp, 1);
+ } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
+ }
if (!error)
VN_POLLEVENT(vp, POLLWRITE | (extended ? POLLEXTEND : 0));
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 1ee2d38cf7fa..3ae27dec5317 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -36,13 +36,12 @@
* SUCH DAMAGE.
*
* @(#)ufs_vfsops.c 8.8 (Berkeley) 5/20/95
- * $Id: ufs_vfsops.c,v 1.11 1997/10/12 20:26:27 phk Exp $
+ * $Id: ufs_vfsops.c,v 1.10 1997/08/16 19:16:27 wollman Exp $
*/
#include "opt_quota.h"
#include <sys/param.h>
-#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/malloc.h>
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 101008513ac9..11592f981d1a 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $Id: ufs_vnops.c,v 1.103 1998/12/24 09:45:10 bde Exp $
+ * $Id: ufs_vnops.c,v 1.99 1998/08/12 21:42:54 msmith Exp $
*/
#include "opt_quota.h"
@@ -506,11 +506,12 @@ ufs_setattr(ap)
if (vap->va_mtime.tv_sec != VNOVAL)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
ufs_itimes(vp);
- if (vap->va_atime.tv_sec != VNOVAL)
- ip->i_atime = vap->va_atime.tv_sec;
if (vap->va_mtime.tv_sec != VNOVAL)
+ ip->i_atime = vap->va_atime.tv_sec;
+ if (vap->va_atime.tv_sec != VNOVAL)
ip->i_mtime = vap->va_mtime.tv_sec;
- error = UFS_UPDATE(vp, 0);
+ error = UFS_UPDATE(vp, (struct timeval *)0,
+ (struct timeval *)0, 0);
if (error)
return (error);
}
@@ -720,6 +721,7 @@ ufs_link(ap)
struct componentname *cnp = ap->a_cnp;
struct proc *p = cnp->cn_proc;
struct inode *ip;
+ struct timeval tv;
struct direct newdir;
int error;
@@ -752,7 +754,8 @@ ufs_link(ap)
ip->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(vp))
softdep_increase_linkcnt(ip);
- error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, !DOINGSOFTDEP(vp));
if (!error) {
ufs_makedirentry(ip, cnp, &newdir);
error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL);
@@ -876,6 +879,7 @@ ufs_rename(ap)
struct proc *p = fcnp->cn_proc;
struct inode *ip, *xp, *dp;
struct direct newdir;
+ struct timeval tv;
int doingdirectory = 0, oldparent = 0, newparent = 0;
int error = 0;
@@ -1015,7 +1019,8 @@ abortit:
ip->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(fvp))
softdep_increase_linkcnt(ip);
- if (error = UFS_UPDATE(fvp, !DOINGSOFTDEP(fvp))) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, !DOINGSOFTDEP(fvp))) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -1079,7 +1084,7 @@ abortit:
dp->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(tdvp))
softdep_increase_linkcnt(dp);
- error = UFS_UPDATE(tdvp, !DOINGSOFTDEP(tdvp));
+ error = UFS_UPDATE(tdvp, &tv, &tv, !DOINGSOFTDEP(tdvp));
if (error)
goto bad;
}
@@ -1090,7 +1095,7 @@ abortit:
dp->i_effnlink--;
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -1270,6 +1275,7 @@ ufs_mkdir(ap)
struct buf *bp;
struct dirtemplate dirtemplate, *dtp;
struct direct newdir;
+ struct timeval tv;
int error, dmode;
long blkoff;
@@ -1372,7 +1378,8 @@ ufs_mkdir(ap)
dp->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(dvp))
softdep_increase_linkcnt(dp);
- error = UFS_UPDATE(tvp, !DOINGSOFTDEP(dvp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(dvp));
if (error)
goto bad;
@@ -1408,7 +1415,7 @@ ufs_mkdir(ap)
blkoff += DIRBLKSIZ;
}
}
- if ((error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp))) != 0) {
+ if ((error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp))) != 0) {
(void)VOP_BWRITE(bp);
goto bad;
}
@@ -1605,9 +1612,9 @@ ufs_readdir(ap)
off = uio->uio_offset;
count = uio->uio_resid;
/* Make sure we don't return partial entries. */
- if (count <= ((uio->uio_offset + count) & (DIRBLKSIZ -1)))
- return (EINVAL);
count -= (uio->uio_offset + count) & (DIRBLKSIZ -1);
+ if (count <= 0)
+ return (EINVAL);
lost = uio->uio_resid - count;
uio->uio_resid = count;
uio->uio_iov->iov_len = count;
@@ -1803,19 +1810,13 @@ ufsspec_read(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap);
- /*
- * The inode may have been revoked during the call, so it must not
- * be accessed blindly here or in the other wrapper functions.
- */
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
- ip->i_flag |= IN_ACCESS;
+ if (uio->uio_resid != resid)
+ VTOI(ap->a_vp)->i_flag |= IN_ACCESS;
return (error);
}
@@ -1832,14 +1833,12 @@ ufsspec_write(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap);
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid)
VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
return (error);
}
@@ -1880,15 +1879,13 @@ ufsfifo_read(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap);
- ip = VTOI(ap->a_vp);
- if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL &&
- (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid &&
+ (ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0)
VTOI(ap->a_vp)->i_flag |= IN_ACCESS;
return (error);
}
@@ -1906,14 +1903,12 @@ ufsfifo_write(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap);
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid)
VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
return (error);
}
@@ -2067,6 +2062,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
{
register struct inode *ip, *pdir;
struct direct newdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -2160,7 +2156,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp));
if (error)
goto bad;
ufs_makedirentry(ip, cnp, &newdir);
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 70652b58f9ba..c62b736034f5 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufsmount.h 8.6 (Berkeley) 3/30/95
- * $Id: ufsmount.h,v 1.13 1998/01/30 11:34:06 phk Exp $
+ * $Id: ufsmount.h,v 1.12 1997/10/16 20:32:40 phk Exp $
*/
#ifndef _UFS_UFS_UFSMOUNT_H_
@@ -97,14 +97,14 @@ struct ufsmount {
struct malloc_type *um_malloctype; /* The inodes malloctype */
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
- int (*um_update) __P((struct vnode *, int));
+ int (*um_update) __P((struct vnode *, struct timeval *, struct timeval *, int));
int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **));
int (*um_vfree) __P((struct vnode *, ino_t, int));
};
#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd)
#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee)
-#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
+#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd)
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index a200b9c2a8db..3783be436893 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)device_pager.c 8.1 (Berkeley) 6/11/93
- * $Id: device_pager.c,v 1.36 1998/12/07 21:58:50 archie Exp $
+ * $Id: device_pager.c,v 1.31 1998/07/15 02:32:35 bde Exp $
*/
#include <sys/param.h>
@@ -50,7 +50,6 @@
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
-#include <vm/vm_zone.h>
static void dev_pager_init __P((void));
static vm_object_t dev_pager_alloc __P((void *, vm_ooffset_t, vm_prot_t,
@@ -65,8 +64,8 @@ static boolean_t dev_pager_haspage __P((vm_object_t, vm_pindex_t, int *,
/* list of device pager objects */
static struct pagerlst dev_pager_object_list;
-static vm_zone_t fakepg_zone;
-static struct vm_zone fakepg_zone_store;
+/* list of available vm_page_t's */
+static TAILQ_HEAD(, vm_page) dev_pager_fakelist;
static vm_page_t dev_pager_getfake __P((vm_offset_t));
static void dev_pager_putfake __P((vm_page_t));
@@ -87,8 +86,7 @@ static void
dev_pager_init()
{
TAILQ_INIT(&dev_pager_object_list);
- fakepg_zone = &fakepg_zone_store;
- zinitna(fakepg_zone, NULL, "DP fakepg", sizeof(struct vm_page), 0, 0, 2);
+ TAILQ_INIT(&dev_pager_fakelist);
}
static vm_object_t
@@ -97,8 +95,7 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo
dev_t dev;
d_mmap_t *mapfunc;
vm_object_t object;
- unsigned int npages;
- vm_offset_t off;
+ unsigned int npages, off;
/*
* Make sure this device can be mapped.
@@ -207,8 +204,11 @@ dev_pager_getpages(object, m, count, reqpage)
if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop)
panic("dev_pager_getpage: no map function");
- paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (vm_offset_t) offset << PAGE_SHIFT, prot));
- KASSERT(paddr != -1,("dev_pager_getpage: map function returns error"));
+ paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset << PAGE_SHIFT, prot));
+#ifdef DIAGNOSTIC
+ if (paddr == -1)
+ panic("dev_pager_getpage: map function returns error");
+#endif
/*
* Replace the passed in reqpage page with our own fake page and free up the
* all of the original pages.
@@ -255,15 +255,23 @@ dev_pager_getfake(paddr)
vm_offset_t paddr;
{
vm_page_t m;
-
- m = zalloc(fakepg_zone);
+ int i;
+
+ if (TAILQ_FIRST(&dev_pager_fakelist) == NULL) {
+ m = (vm_page_t) malloc(PAGE_SIZE * 2, M_VMPGDATA, M_WAITOK);
+ for (i = (PAGE_SIZE * 2) / sizeof(*m); i > 0; i--) {
+ TAILQ_INSERT_TAIL(&dev_pager_fakelist, m, pageq);
+ m++;
+ }
+ }
+ m = TAILQ_FIRST(&dev_pager_fakelist);
+ TAILQ_REMOVE(&dev_pager_fakelist, m, pageq);
m->flags = PG_BUSY | PG_FICTITIOUS;
m->valid = VM_PAGE_BITS_ALL;
m->dirty = 0;
m->busy = 0;
m->queue = PQ_NONE;
- m->object = NULL;
m->wire_count = 1;
m->hold_count = 0;
@@ -278,5 +286,5 @@ dev_pager_putfake(m)
{
if (!(m->flags & PG_FICTITIOUS))
panic("dev_pager_putfake: bad page");
- zfree(fakepg_zone, m);
+ TAILQ_INSERT_TAIL(&dev_pager_fakelist, m, pageq);
}
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 16911684c998..6c58e0fff287 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.106 1999/01/08 17:31:23 eivind Exp $
+ * $Id: swap_pager.c,v 1.101 1998/09/04 08:06:56 dfr Exp $
*/
/*
@@ -81,6 +81,7 @@
static int nswiodone;
int swap_pager_full;
extern int vm_swap_size;
+static int suggest_more_swap = 0;
static int no_swap_space = 1;
static int max_pageout_cluster;
struct rlisthdr swaplist;
@@ -397,6 +398,11 @@ swap_pager_getswapspace(object, amount, rtval)
unsigned location;
vm_swap_size -= amount;
+ if (!suggest_more_swap && (vm_swap_size < btodb(cnt.v_page_count * PAGE_SIZE))) {
+ printf("swap_pager: suggest more swap space: %d MB\n",
+ (2 * cnt.v_page_count * (PAGE_SIZE / 1024)) / 1000);
+ suggest_more_swap = 1;
+ }
if (!rlist_alloc(&swaplist, amount, &location)) {
vm_swap_size += amount;
@@ -1122,6 +1128,22 @@ swap_pager_getpages(object, m, count, reqpage)
}
m[reqpage]->object->last_read = m[count-1]->pindex;
+
+ /*
+ * If we're out of swap space, then attempt to free
+ * some whenever multiple pages are brought in. We
+ * must set the dirty bits so that the page contents
+ * will be preserved.
+ */
+ if (SWAPLOW ||
+ (vm_swap_size < btodb((cnt.v_page_count - cnt.v_wire_count)) * PAGE_SIZE)) {
+ for (i = 0; i < count; i++) {
+ m[i]->dirty = VM_PAGE_BITS_ALL;
+ }
+ swap_pager_freespace(object,
+ m[0]->pindex + paging_offset, count);
+ }
+
} else {
swap_pager_ridpages(m, count, reqpage);
}
@@ -1297,7 +1319,7 @@ swap_pager_putpages(object, m, count, sync, rtvals)
swb[i]->swb_locked--;
}
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
for (i = firstidx; i < lastidx; i++) {
if (reqaddr[i] == SWB_EMPTY) {
printf("I/O to empty block???? -- pindex: %d, i: %d\n",
@@ -1348,9 +1370,11 @@ swap_pager_putpages(object, m, count, sync, rtvals)
}
spc = TAILQ_FIRST(&swap_pager_free);
- KASSERT(spc != NULL,
- ("swap_pager_putpages: free queue is empty, %d expected\n",
- swap_pager_free_count));
+#if defined(DIAGNOSTIC)
+ if (spc == NULL)
+ panic("swap_pager_putpages: free queue is empty, %d expected\n",
+ swap_pager_free_count);
+#endif
TAILQ_REMOVE(&swap_pager_free, spc, spc_list);
swap_pager_free_count--;
@@ -1358,7 +1382,7 @@ swap_pager_putpages(object, m, count, sync, rtvals)
bp = spc->spc_bp;
bzero(bp, sizeof *bp);
bp->b_spc = spc;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
bp->b_data = (caddr_t) kva;
} else {
spc = NULL;
@@ -1511,14 +1535,12 @@ swap_pager_putpages(object, m, count, sync, rtvals)
}
}
- if (spc != NULL) {
- if (bp->b_rcred != NOCRED)
- crfree(bp->b_rcred);
- if (bp->b_wcred != NOCRED)
- crfree(bp->b_wcred);
- spc_free(spc);
- } else
- relpbuf(bp);
+ if (bp->b_rcred != NOCRED)
+ crfree(bp->b_rcred);
+ if (bp->b_wcred != NOCRED)
+ crfree(bp->b_wcred);
+
+ spc_free(spc);
if (swap_pager_free_pending)
swap_pager_sync();
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index ca5a53e9f186..34deba7d0f78 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id: vm_extern.h,v 1.38 1998/06/07 17:13:09 dfr Exp $
+ * $Id: vm_extern.h,v 1.37 1998/01/22 17:30:32 dyson Exp $
*/
#ifndef _VM_EXTERN_H_
@@ -61,11 +61,7 @@ int swapon __P((struct proc *, void *, int *));
#endif
void faultin __P((struct proc *p));
-#ifndef VM_STACK
int grow __P((struct proc *, size_t));
-#else
-int grow_stack __P((struct proc *, size_t));
-#endif
int kernacc __P((caddr_t, int, int));
vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index e3d64f92108d..898ba8c9166e 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.92 1999/01/08 17:31:24 eivind Exp $
+ * $Id: vm_fault.c,v 1.87 1998/08/24 08:39:37 dfr Exp $
*/
/*
@@ -183,6 +183,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags)
vm_page_t marray[VM_FAULT_READ];
int hardfault;
int faultcount;
+ struct proc *p = curproc; /* XXX */
struct faultstate fs;
cnt.v_vm_faults++; /* needs lock XXX */
@@ -275,7 +276,7 @@ RetryFault:;
fs.m = vm_page_lookup(fs.object, fs.pindex);
if (fs.m != NULL) {
- int queue, s;
+ int queue;
/*
* If the page is being brought in, wait for it and
* then retry.
@@ -283,6 +284,8 @@ RetryFault:;
if ((fs.m->flags & PG_BUSY) ||
(fs.m->busy &&
(fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) {
+ int s;
+
unlock_things(&fs);
s = splvm();
if ((fs.m->flags & PG_BUSY) ||
@@ -298,9 +301,7 @@ RetryFault:;
}
queue = fs.m->queue;
- s = splvm();
vm_page_unqueue_nowakeup(fs.m);
- splx(s);
/*
* Mark page busy for other processes, and the pagedaemon.
@@ -527,8 +528,11 @@ readrest:
vm_object_pip_add(fs.object, 1);
}
}
- KASSERT((fs.m->flags & PG_BUSY) != 0,
- ("vm_fault: not busy after main loop"));
+
+#if defined(DIAGNOSTIC)
+ if ((fs.m->flags & PG_BUSY) == 0)
+ panic("vm_fault: not busy after main loop");
+#endif
/*
* PAGE HAS BEEN FOUND. [Loop invariant still holds -- the object lock
@@ -735,7 +739,7 @@ readrest:
if (wired)
vm_page_wire(fs.m);
else
- vm_page_unwire(fs.m, 1);
+ vm_page_unwire(fs.m);
} else {
vm_page_activate(fs.m);
}
@@ -867,7 +871,7 @@ vm_fault_unwire(map, start, end)
pa = pmap_extract(pmap, va);
if (pa != (vm_offset_t) 0) {
pmap_change_wiring(pmap, va, FALSE);
- vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
+ vm_page_unwire(PHYS_TO_VM_PAGE(pa));
}
}
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index ec844dbba246..e73862d9fa9c 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -59,7 +59,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_glue.c,v 1.79 1998/12/19 08:23:31 julian Exp $
+ * $Id: vm_glue.c,v 1.76 1998/09/29 17:33:59 abial Exp $
*/
#include "opt_rlimit.h"
@@ -229,7 +229,6 @@ vm_fork(p1, p2, flags)
up = p2->p_addr;
-#ifndef COMPAT_LINUX_THREADS
/*
* p_stats and p_sigacts currently point at fields in the user struct
* but not at &u, instead at p_addr. Copy p_sigacts and parts of
@@ -238,23 +237,6 @@ vm_fork(p1, p2, flags)
p2->p_stats = &up->u_stats;
p2->p_sigacts = &up->u_sigacts;
up->u_sigacts = *p1->p_sigacts;
-#else
- /*
- * p_stats currently points at fields in the user struct
- * but not at &u, instead at p_addr. Copy parts of
- * p_stats; zero the rest of p_stats (statistics).
- *
- * If procsig->ps_refcnt is 1 and p2->p_sigacts is NULL we dont' need
- * to share sigacts, so we use the up->u_sigacts.
- */
- p2->p_stats = &up->u_stats;
- if (p2->p_sigacts == NULL) {
- if (p2->p_procsig->ps_refcnt != 1)
- printf ("PID:%d NULL sigacts with refcnt not 1!\n",p2->p_pid);
- p2->p_sigacts = &up->u_sigacts;
- up->u_sigacts = *p1->p_sigacts;
- }
-#endif /* COMPAT_LINUX_THREADS */
bzero(&up->u_stats.pstat_startzero,
(unsigned) ((caddr_t) &up->u_stats.pstat_endzero -
(caddr_t) &up->u_stats.pstat_startzero));
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 829548a2250d..7dbad01728f5 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.138 1998/10/25 17:44:58 phk Exp $
+ * $Id: vm_map.c,v 1.136 1998/10/01 20:46:41 jdp Exp $
*/
/*
@@ -75,9 +75,6 @@
#include <sys/vmmeter.h>
#include <sys/mman.h>
#include <sys/vnode.h>
-#ifdef VM_STACK
-#include <sys/resourcevar.h>
-#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -95,6 +92,8 @@
#include <vm/swap_pager.h>
#include <vm/vm_zone.h>
+static MALLOC_DEFINE(M_VMMAP, "VM map", "VM map structures");
+
/*
* Virtual memory maps provide for the mapping, protection,
* and sharing of virtual memory objects. In addition,
@@ -541,10 +540,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
new_entry->eflags = protoeflags;
new_entry->object.vm_object = object;
new_entry->offset = offset;
-#ifdef VM_STACK
- new_entry->avail_ssize = 0;
-#endif
-
if (object) {
if ((object->ref_count > 1) || (object->shadow_count != 0)) {
vm_object_clear_flag(object, OBJ_ONEMAPPING);
@@ -577,204 +572,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
return (KERN_SUCCESS);
}
-#ifdef VM_STACK
-int
-vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
- vm_prot_t prot, vm_prot_t max, int cow)
-{
- vm_map_entry_t prev_entry;
- vm_map_entry_t new_stack_entry;
- vm_size_t init_ssize;
- int rv;
-
- if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
- return (KERN_NO_SPACE);
-
- if (max_ssize < SGROWSIZ)
- init_ssize = max_ssize;
- else
- init_ssize = SGROWSIZ;
-
- vm_map_lock(map);
-
- /* If addr is already mapped, no go */
- if (vm_map_lookup_entry(map, addrbos, &prev_entry)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* If we can't accomodate max_ssize in the current mapping,
- * no go. However, we need to be aware that subsequent user
- * mappings might map into the space we have reserved for
- * stack, and currently this space is not protected.
- *
- * Hopefully we will at least detect this condition
- * when we try to grow the stack.
- */
- if ((prev_entry->next != &map->header) &&
- (prev_entry->next->start < addrbos + max_ssize)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* We initially map a stack of only init_ssize. We will
- * grow as needed later. Since this is to be a grow
- * down stack, we map at the top of the range.
- *
- * Note: we would normally expect prot and max to be
- * VM_PROT_ALL, and cow to be 0. Possibly we should
- * eliminate these as input parameters, and just
- * pass these values here in the insert call.
- */
- rv = vm_map_insert(map, NULL, 0, addrbos + max_ssize - init_ssize,
- addrbos + max_ssize, prot, max, cow);
-
- /* Now set the avail_ssize amount */
- if (rv == KERN_SUCCESS){
- new_stack_entry = prev_entry->next;
- if (new_stack_entry->end != addrbos + max_ssize ||
- new_stack_entry->start != addrbos + max_ssize - init_ssize)
- panic ("Bad entry start/end for new stack entry");
- else
- new_stack_entry->avail_ssize = max_ssize - init_ssize;
- }
-
- vm_map_unlock(map);
- return (rv);
-}
-
-/* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the
- * desired address is already mapped, or if we successfully grow
- * the stack. Also returns KERN_SUCCESS if addr is outside the
- * stack range (this is strange, but preserves compatibility with
- * the grow function in vm_machdep.c).
- */
-int
-vm_map_growstack (struct proc *p, vm_offset_t addr)
-{
- vm_map_entry_t prev_entry;
- vm_map_entry_t stack_entry;
- vm_map_entry_t new_stack_entry;
- struct vmspace *vm = p->p_vmspace;
- vm_map_t map = &vm->vm_map;
- vm_offset_t end;
- int grow_amount;
- int rv;
- int is_procstack = 0;
-
- vm_map_lock(map);
-
- /* If addr is already in the entry range, no need to grow.*/
- if (vm_map_lookup_entry(map, addr, &prev_entry)) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
-
- if ((stack_entry = prev_entry->next) == &map->header) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
- if (prev_entry == &map->header)
- end = stack_entry->start - stack_entry->avail_ssize;
- else
- end = prev_entry->end;
-
- /* This next test mimics the old grow function in vm_machdep.c.
- * It really doesn't quite make sense, but we do it anyway
- * for compatibility.
- *
- * If not growable stack, return success. This signals the
- * caller to proceed as he would normally with normal vm.
- */
- if (stack_entry->avail_ssize < 1 ||
- addr >= stack_entry->start ||
- addr < stack_entry->start - stack_entry->avail_ssize) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
-
- /* Find the minimum grow amount */
- grow_amount = roundup (stack_entry->start - addr, PAGE_SIZE);
- if (grow_amount > stack_entry->avail_ssize) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* If there is no longer enough space between the entries
- * nogo, and adjust the available space. Note: this
- * should only happen if the user has mapped into the
- * stack area after the stack was created, and is
- * probably an error.
- *
- * This also effectively destroys any guard page the user
- * might have intended by limiting the stack size.
- */
- if (grow_amount > stack_entry->start - end) {
- stack_entry->avail_ssize = stack_entry->start - end;
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- if (addr >= (vm_offset_t)vm->vm_maxsaddr)
- is_procstack = 1;
-
- /* If this is the main process stack, see if we're over the
- * stack limit.
- */
- if (is_procstack && (vm->vm_ssize + grow_amount >
- p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* Round up the grow amount modulo SGROWSIZ */
- grow_amount = roundup (grow_amount, SGROWSIZ);
- if (grow_amount > stack_entry->avail_ssize) {
- grow_amount = stack_entry->avail_ssize;
- }
- if (is_procstack && (vm->vm_ssize + grow_amount >
- p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
- grow_amount = p->p_rlimit[RLIMIT_STACK].rlim_cur -
- vm->vm_ssize;
- }
-
- /* Get the preliminary new entry start value */
- addr = stack_entry->start - grow_amount;
-
- /* If this puts us into the previous entry, cut back our growth
- * to the available space. Also, see the note above.
- */
- if (addr < end) {
- stack_entry->avail_ssize = stack_entry->start - end;
- addr = end;
- }
-
- rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start,
- stack_entry->protection,
- stack_entry->max_protection,
- 0);
-
- /* Adjust the available stack space by the amount we grew. */
- if (rv == KERN_SUCCESS) {
- new_stack_entry = prev_entry->next;
- if (new_stack_entry->end != stack_entry->start ||
- new_stack_entry->start != addr)
- panic ("Bad stack grow start/end in new stack entry");
- else {
- new_stack_entry->avail_ssize = stack_entry->avail_ssize -
- (new_stack_entry->end -
- new_stack_entry->start);
- vm->vm_ssize += new_stack_entry->end -
- new_stack_entry->start;
- }
- }
-
- vm_map_unlock(map);
- return (rv);
-
-}
-#endif
-
/*
* Find sufficient space for `length' bytes in the given map, starting at
* `start'. The map must be locked. Returns 0 on success, 1 on no space.
@@ -2957,9 +2754,9 @@ vm_freeze_copyopts(object, froma, toa)
vm_object_t object;
vm_pindex_t froma, toa;
{
- int rv;
- vm_object_t robject;
- vm_pindex_t idx;
+ int s, rv;
+ vm_object_t robject, robjectn;
+ vm_pindex_t idx, from, to;
if ((object == NULL) ||
((object->flags & OBJ_OPT) == 0))
@@ -2987,10 +2784,12 @@ vm_freeze_copyopts(object, froma, toa)
for (idx = 0; idx < robject->size; idx++) {
+m_outretry:
m_out = vm_page_grab(robject, idx,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m_out->valid == 0) {
+m_inretry:
m_in = vm_page_grab(object, bo_pindex + idx,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m_in->valid == 0) {
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 4d61a3f8efba..b7c6cd571b01 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.h,v 1.32 1998/01/22 17:30:38 dyson Exp $
+ * $Id: vm_map.h,v 1.31 1998/01/17 09:16:52 dyson Exp $
*/
/*
@@ -102,9 +102,6 @@ struct vm_map_entry {
struct vm_map_entry *next; /* next entry */
vm_offset_t start; /* start address */
vm_offset_t end; /* end address */
-#ifdef VM_STACK
- vm_offset_t avail_ssize; /* amt can grow if this is a stack */
-#endif
union vm_map_object object; /* object I point to */
vm_ooffset_t offset; /* offset into object */
u_char eflags; /* map entry flags */
@@ -338,10 +335,6 @@ void vm_map_simplify_entry __P((vm_map_t, vm_map_entry_t));
void vm_init2 __P((void));
int vm_uiomove __P((vm_map_t, vm_object_t, off_t, int, vm_offset_t, int *));
void vm_freeze_copyopts __P((vm_object_t, vm_pindex_t, vm_pindex_t));
-#ifdef VM_STACK
-int vm_map_stack __P((vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int));
-int vm_map_growstack __P((struct proc *p, vm_offset_t addr));
-#endif
#endif
#endif /* _VM_MAP_ */
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 5bc74bde8e94..4879535c73de 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
- * $Id: vm_meter.c,v 1.26 1998/08/24 08:39:37 dfr Exp $
+ * $Id: vm_meter.c,v 1.25 1998/03/30 09:56:49 phk Exp $
*/
#include <sys/param.h>
@@ -42,8 +42,6 @@
#include <sys/vmmeter.h>
#include <vm/vm.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_page.h>
#include <vm/vm_extern.h>
#include <vm/vm_param.h>
#include <sys/lock.h>
@@ -217,103 +215,3 @@ vmtotal SYSCTL_HANDLER_ARGS
SYSCTL_PROC(_vm, VM_METER, vmmeter, CTLTYPE_OPAQUE|CTLFLAG_RD,
0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", "");
-SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW, 0, "VM meter stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, sys, CTLFLAG_RW, 0, "VM meter sys stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_swtch, CTLFLAG_RD, &cnt.v_swtch, 0, "Context switches");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_trap, CTLFLAG_RD, &cnt.v_trap, 0, "Traps");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_syscall, CTLFLAG_RD, &cnt.v_syscall, 0, "Syscalls");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_intr, CTLFLAG_RD, &cnt.v_intr, 0, "HW intr");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_soft, CTLFLAG_RD, &cnt.v_soft, 0, "SW intr");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vm_faults, CTLFLAG_RD, &cnt.v_vm_faults, 0, "VM faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cow_faults, CTLFLAG_RD, &cnt.v_cow_faults, 0, "COW faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cow_optim, CTLFLAG_RD, &cnt.v_cow_optim, 0, "Optimized COW faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_zfod, CTLFLAG_RD, &cnt.v_zfod, 0, "Zero fill");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_ozfod, CTLFLAG_RD, &cnt.v_ozfod, 0, "Optimized zero fill");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swapin, CTLFLAG_RD, &cnt.v_swapin, 0, "Swapin operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swapout, CTLFLAG_RD, &cnt.v_swapout, 0, "Swapout operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swappgsin, CTLFLAG_RD, &cnt.v_swappgsin, 0, "Swapin pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swappgsout, CTLFLAG_RD, &cnt.v_swappgsout, 0, "Swapout pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodein, CTLFLAG_RD, &cnt.v_vnodein, 0, "Vnodein operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodeout, CTLFLAG_RD, &cnt.v_vnodeout, 0, "Vnodeout operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodepgsin, CTLFLAG_RD, &cnt.v_vnodepgsin, 0, "Vnodein pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodepgsout, CTLFLAG_RD, &cnt.v_vnodepgsout, 0, "Vnodeout pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_intrans, CTLFLAG_RD, &cnt.v_intrans, 0, "In transit page blocking");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_reactivated, CTLFLAG_RD, &cnt.v_reactivated, 0, "Reactivated pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pdwakeups, CTLFLAG_RD, &cnt.v_pdwakeups, 0, "Pagedaemon wakeups");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pdpages, CTLFLAG_RD, &cnt.v_pdpages, 0, "Pagedaemon page scans");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_dfree, CTLFLAG_RD, &cnt.v_dfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pfree, CTLFLAG_RD, &cnt.v_pfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_tfree, CTLFLAG_RD, &cnt.v_tfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_page_size, CTLFLAG_RD, &cnt.v_page_size, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_page_count, CTLFLAG_RD, &cnt.v_page_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_reserved, CTLFLAG_RD, &cnt.v_free_reserved, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_target, CTLFLAG_RD, &cnt.v_free_target, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_min, CTLFLAG_RD, &cnt.v_free_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_count, CTLFLAG_RD, &cnt.v_free_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_wire_count, CTLFLAG_RD, &cnt.v_wire_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_active_count, CTLFLAG_RD, &cnt.v_active_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_inactive_target, CTLFLAG_RD, &cnt.v_inactive_target, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_inactive_count, CTLFLAG_RD, &cnt.v_inactive_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_count, CTLFLAG_RD, &cnt.v_cache_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_min, CTLFLAG_RD, &cnt.v_cache_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_max, CTLFLAG_RD, &cnt.v_cache_max, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pageout_free_min, CTLFLAG_RD, &cnt.v_pageout_free_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_interrupt_free_min, CTLFLAG_RD, &cnt.v_interrupt_free_min, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- zero_page_count, CTLFLAG_RD, &vm_page_zero_count, 0, "");
-#if 0
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- page_mask, CTLFLAG_RD, &page_mask, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- page_shift, CTLFLAG_RD, &page_shift, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- first_page, CTLFLAG_RD, &first_page, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- last_page, CTLFLAG_RD, &last_page, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- vm_page_bucket_count, CTLFLAG_RD, &vm_page_bucket_count, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- vm_page_hash_mask, CTLFLAG_RD, &vm_page_hash_mask, 0, "");
-#endif
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index ba36e41fc632..6ea214a73526 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -38,7 +38,7 @@
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
*
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
- * $Id: vm_mmap.c,v 1.85 1998/12/09 20:22:21 dt Exp $
+ * $Id: vm_mmap.c,v 1.83 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -173,19 +173,11 @@ mmap(p, uap)
pos = uap->pos;
/* make sure mapping fits into numeric range etc */
- if ((ssize_t) uap->len < 0 ||
+ if ((pos + size > (vm_offset_t)-PAGE_SIZE) ||
+ (ssize_t) uap->len < 0 ||
((flags & MAP_ANON) && uap->fd != -1))
return (EINVAL);
-#ifdef VM_STACK
- if (flags & MAP_STACK) {
- if ((uap->fd != -1) ||
- ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE)))
- return (EINVAL);
- flags |= MAP_ANON;
- pos = 0;
- }
-#endif
/*
* Align the file position to a page boundary,
* and save its page offset component.
@@ -1025,12 +1017,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
*addr = pmap_addr_hint(object, *addr, size);
}
-#ifdef VM_STACK
- if (flags & MAP_STACK)
- rv = vm_map_stack (map, *addr, size, prot,
- maxprot, docow);
- else
-#endif
rv = vm_map_find(map, object, foff, addr, size, fitit,
prot, maxprot, docow);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a1477f222822..f419e2f51282 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.137 1999/01/08 17:31:26 eivind Exp $
+ * $Id: vm_object.c,v 1.128 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -91,6 +91,7 @@
#include <vm/vm_zone.h>
static void vm_object_qcollapse __P((vm_object_t object));
+static void vm_object_dispose __P((vm_object_t));
/*
* Virtual memory objects maintain the actual data
@@ -119,9 +120,7 @@ static void vm_object_qcollapse __P((vm_object_t object));
*/
struct object_q vm_object_list;
-#ifndef NULL_SIMPLELOCKS
static struct simplelock vm_object_list_lock;
-#endif
static long vm_object_count; /* count of all objects */
vm_object_t kernel_object;
vm_object_t kmem_object;
@@ -242,8 +241,10 @@ vm_object_reference(object)
if (object == NULL)
return;
- KASSERT(!(object->flags & OBJ_DEAD),
- ("vm_object_reference: attempting to reference dead obj"));
+#if defined(DIAGNOSTIC)
+ if (object->flags & OBJ_DEAD)
+ panic("vm_object_reference: attempting to reference dead obj");
+#endif
object->ref_count++;
if (object->type == OBJT_VNODE) {
@@ -260,11 +261,11 @@ vm_object_vndeallocate(object)
vm_object_t object;
{
struct vnode *vp = (struct vnode *) object->handle;
-
- KASSERT(object->type == OBJT_VNODE,
- ("vm_object_vndeallocate: not a vnode object"));
- KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp"));
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
+ if (object->type != OBJT_VNODE)
+ panic("vm_object_vndeallocate: not a vnode object");
+ if (vp == NULL)
+ panic("vm_object_vndeallocate: missing vp");
if (object->ref_count == 0) {
vprint("vm_object_vndeallocate", vp);
panic("vm_object_vndeallocate: bad object reference count");
@@ -294,6 +295,7 @@ void
vm_object_deallocate(object)
vm_object_t object;
{
+ int s;
vm_object_t temp;
while (object != NULL) {
@@ -326,10 +328,12 @@ vm_object_deallocate(object)
vm_object_t robject;
robject = TAILQ_FIRST(&object->shadow_head);
- KASSERT(robject != NULL,
- ("vm_object_deallocate: ref_count: %d, shadow_count: %d",
- object->ref_count,
- object->shadow_count));
+#if defined(DIAGNOSTIC)
+ if (robject == NULL)
+ panic("vm_object_deallocate: ref_count: %d,"
+ " shadow_count: %d",
+ object->ref_count, object->shadow_count);
+#endif
if ((robject->handle == NULL) &&
(robject->type == OBJT_DEFAULT ||
robject->type == OBJT_SWAP)) {
@@ -414,8 +418,10 @@ vm_object_terminate(object)
*/
vm_object_pip_wait(object, "objtrm");
- KASSERT(!object->paging_in_progress,
- ("vm_object_terminate: pageout in progress"));
+#if defined(DIAGNOSTIC)
+ if (object->paging_in_progress != 0)
+ panic("vm_object_terminate: pageout in progress");
+#endif
/*
* Clean and free the pages, as appropriate. All references to the
@@ -436,51 +442,58 @@ vm_object_terminate(object)
vp = (struct vnode *) object->handle;
vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0);
+
+ /*
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
+
}
- if (object->ref_count != 0)
- panic("vm_object_terminate: object with references, ref_count=%d", object->ref_count);
+ if ((object->type != OBJT_VNODE) && (object->ref_count == 0)) {
- /*
- * Now free any remaining pages. For internal objects, this also
- * removes them from paging queues. Don't free wired pages, just
- * remove them from the object.
- */
- s = splvm();
- while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
+ /*
+ * Now free the pages. For internal objects, this also removes them
+ * from paging queues.
+ */
+ while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
#if !defined(MAX_PERF)
- if (p->busy || (p->flags & PG_BUSY))
- printf("vm_object_terminate: freeing busy page\n");
+ if (p->busy || (p->flags & PG_BUSY))
+ printf("vm_object_terminate: freeing busy page\n");
#endif
- if (p->wire_count == 0) {
vm_page_busy(p);
vm_page_free(p);
cnt.v_pfree++;
- } else {
- vm_page_busy(p);
- vm_page_remove(p);
}
- }
- splx(s);
-
- /*
- * Let the pager know object is dead.
- */
- vm_pager_deallocate(object);
+ /*
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
- /*
- * Remove the object from the global object list.
- */
- simple_lock(&vm_object_list_lock);
- TAILQ_REMOVE(&vm_object_list, object, object_list);
- simple_unlock(&vm_object_list_lock);
+ }
- wakeup(object);
+ if ((object->ref_count == 0) && (object->resident_page_count == 0))
+ vm_object_dispose(object);
+}
- /*
- * Free the space for the object.
- */
- zfree(obj_zone, object);
+/*
+ * vm_object_dispose
+ *
+ * Dispose the object.
+ */
+static void
+vm_object_dispose(object)
+ vm_object_t object;
+{
+ simple_lock(&vm_object_list_lock);
+ TAILQ_REMOVE(&vm_object_list, object, object_list);
+ vm_object_count--;
+ simple_unlock(&vm_object_list_lock);
+ /*
+ * Free the space for the object.
+ */
+ zfree(obj_zone, object);
+ wakeup(object);
}
/*
@@ -516,6 +529,7 @@ vm_object_page_clean(object, start, end, flags)
vm_page_t mab[vm_pageout_page_count];
vm_page_t ma[vm_pageout_page_count];
int curgeneration;
+ struct proc *pproc = curproc; /* XXX */
if (object->type != OBJT_VNODE ||
(object->flags & OBJ_MIGHTBEDIRTY) == 0)
@@ -771,6 +785,7 @@ vm_object_madvise(object, pindex, count, advise)
int count;
int advise;
{
+ int s;
vm_pindex_t end, tpindex;
vm_object_t tobject;
vm_page_t m;
@@ -1292,7 +1307,7 @@ vm_object_page_remove(object, start, end, clean_only)
{
register vm_page_t p, next;
unsigned int size;
- int all;
+ int s, all;
if (object == NULL)
return;
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index c953559da668..46f192389e6f 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
- * $Id: vm_page.c,v 1.115 1999/01/08 17:31:27 eivind Exp $
+ * $Id: vm_page.c,v 1.106 1998/08/24 08:39:38 dfr Exp $
*/
/*
@@ -352,7 +352,6 @@ vm_page_startup(starta, enda, vaddr)
* Distributes the object/offset key pair among hash buckets.
*
* NOTE: This macro depends on vm_page_bucket_count being a power of 2.
- * This routine may not block.
*/
static __inline int
vm_page_hash(object, pindex)
@@ -365,15 +364,10 @@ vm_page_hash(object, pindex)
/*
* vm_page_insert: [ internal use only ]
*
- * Inserts the given mem entry into the object and object list.
- *
- * The pagetables are not updated but will presumably fault the page
- * in if necessary, or if a kernel page the caller will at some point
- * enter the page into the kernel's pmap. We are not allowed to block
- * here so we *can't* do this anyway.
+ * Inserts the given mem entry into the object/object-page
+ * table and object list.
*
* The object and page must be locked, and must be splhigh.
- * This routine may not block.
*/
void
@@ -384,8 +378,10 @@ vm_page_insert(m, object, pindex)
{
register struct pglist *bucket;
- if (m->object != NULL)
+#if !defined(MAX_PERF)
+ if (m->flags & PG_TABLED)
panic("vm_page_insert: already inserted");
+#endif
/*
* Record the object/offset pair in this page
@@ -407,6 +403,7 @@ vm_page_insert(m, object, pindex)
*/
TAILQ_INSERT_TAIL(&object->memq, m, listq);
+ vm_page_flag_set(m, PG_TABLED);
m->object->page_hint = m;
m->object->generation++;
@@ -431,9 +428,6 @@ vm_page_insert(m, object, pindex)
* table and the object page list.
*
* The object and page must be locked, and at splhigh.
- * This routine may not block.
- *
- * I do not think the underlying pmap entry (if any) is removed here.
*/
void
@@ -443,7 +437,7 @@ vm_page_remove(m)
register struct pglist *bucket;
vm_object_t object;
- if (m->object == NULL)
+ if (!(m->flags & PG_TABLED))
return;
#if !defined(MAX_PERF)
@@ -488,8 +482,9 @@ vm_page_remove(m)
object->resident_page_count--;
object->generation++;
-
m->object = NULL;
+
+ vm_page_flag_clear(m, PG_TABLED);
}
/*
@@ -499,7 +494,6 @@ vm_page_remove(m)
* pair specified; if none is found, NULL is returned.
*
* The object must be locked. No side effects.
- * This routine may not block.
*/
vm_page_t
@@ -510,6 +504,7 @@ vm_page_lookup(object, pindex)
register vm_page_t m;
register struct pglist *bucket;
int generation;
+ int s;
/*
* Search the hash table for this object/offset pair
@@ -542,11 +537,7 @@ retry:
* current object to the specified target object/offset.
*
* The object must be locked.
- * This routine may not block.
- *
- * Note: this routine will raise itself to splvm(), the caller need not.
*/
-
void
vm_page_rename(m, new_object, new_pindex)
register vm_page_t m;
@@ -562,14 +553,8 @@ vm_page_rename(m, new_object, new_pindex)
}
/*
- * vm_page_unqueue_nowakeup:
- *
- * vm_page_unqueue() without any wakeup
- *
- * This routine must be called at splhigh().
- * This routine may not block.
+ * vm_page_unqueue without any wakeup
*/
-
void
vm_page_unqueue_nowakeup(m)
vm_page_t m;
@@ -590,14 +575,8 @@ vm_page_unqueue_nowakeup(m)
}
/*
- * vm_page_unqueue:
- *
- * Remove a page from its queue.
- *
- * This routine must be called at splhigh().
- * This routine may not block.
+ * vm_page_unqueue must be called at splhigh();
*/
-
void
vm_page_unqueue(m)
vm_page_t m;
@@ -621,12 +600,7 @@ vm_page_unqueue(m)
}
/*
- * vm_page_list_find:
- *
- * Find a page on the specified queue with color optimization.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the specified queue with color optimization.
*/
vm_page_t
vm_page_list_find(basequeue, index)
@@ -680,12 +654,7 @@ vm_page_list_find(basequeue, index)
}
/*
- * vm_page_select:
- *
- * Find a page on the specified queue with color optimization.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the specified queue with color optimization.
*/
vm_page_t
vm_page_select(object, pindex, basequeue)
@@ -706,14 +675,9 @@ vm_page_select(object, pindex, basequeue)
}
/*
- * vm_page_select_cache:
- *
- * Find a page on the cache queue with color optimization. As pages
- * might be found, but not applicable, they are deactivated. This
- * keeps us from using potentially busy cached pages.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the cache queue with color optimization. As pages
+ * might be found, but not applicable, they are deactivated. This
+ * keeps us from using potentially busy cached pages.
*/
vm_page_t
vm_page_select_cache(object, pindex)
@@ -741,14 +705,8 @@ vm_page_select_cache(object, pindex)
}
/*
- * vm_page_select_free:
- *
- * Find a free or zero page, with specified preference.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a free or zero page, with specified preference.
*/
-
static vm_page_t
vm_page_select_free(object, pindex, prefqueue)
vm_object_t object;
@@ -852,11 +810,6 @@ vm_page_select_free(object, pindex, prefqueue)
* VM_ALLOC_ZERO zero page
*
* Object must be locked.
- * This routine may not block.
- *
- * Additional special handling is required when called from an
- * interrupt (VM_ALLOC_INTERRUPT). We are not allowed to mess with
- * the page cache in this case.
*/
vm_page_t
vm_page_alloc(object, pindex, page_req)
@@ -870,8 +823,11 @@ vm_page_alloc(object, pindex, page_req)
int queue, qtype;
int s;
- KASSERT(!vm_page_lookup(object, pindex),
- ("vm_page_alloc: page already allocated"));
+#ifdef DIAGNOSTIC
+ m = vm_page_lookup(object, pindex);
+ if (m)
+ panic("vm_page_alloc: page already allocated");
+#endif
if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) {
page_req = VM_ALLOC_SYSTEM;
@@ -884,7 +840,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_NORMAL:
if (cnt.v_free_count >= cnt.v_free_reserved) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(NORMAL): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(NORMAL): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -903,7 +862,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_ZERO:
if (cnt.v_free_count >= cnt.v_free_reserved) {
m = vm_page_select_free(object, pindex, PQ_ZERO);
- KASSERT(m != NULL, ("vm_page_alloc(ZERO): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(ZERO): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -924,7 +886,10 @@ vm_page_alloc(object, pindex, page_req)
((cnt.v_cache_count == 0) &&
(cnt.v_free_count >= cnt.v_interrupt_free_min))) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(SYSTEM): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(SYSTEM): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -943,7 +908,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_INTERRUPT:
if (cnt.v_free_count > 0) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(INTERRUPT): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(INTERRUPT): missing page on free queue\n");
+#endif
} else {
splx(s);
vm_pageout_deficit++;
@@ -986,13 +954,7 @@ vm_page_alloc(object, pindex, page_req)
m->dirty = 0;
m->queue = PQ_NONE;
- /*
- * vm_page_insert() is safe prior to the splx(). Note also that
- * inserting a page here does not insert it into the pmap (which
- * could cause us to block allocating memory). We cannot block
- * anywhere.
- */
-
+ /* XXX before splx until vm_page_insert is safe */
vm_page_insert(m, object, pindex);
/*
@@ -1022,12 +984,6 @@ vm_page_alloc(object, pindex, page_req)
return (m);
}
-/*
- * vm_wait: (also see VM_WAIT macro)
- *
- * Block until free pages are available for allocation
- */
-
void
vm_wait()
{
@@ -1047,14 +1003,9 @@ vm_wait()
splx(s);
}
-/*
- * vm_page_sleep:
- *
- * Block until page is no longer busy.
- */
-
int
vm_page_sleep(vm_page_t m, char *msg, char *busy) {
+ vm_object_t object = m->object;
int slept = 0;
if ((busy && *busy) || (m->flags & PG_BUSY)) {
int s;
@@ -1075,13 +1026,14 @@ vm_page_sleep(vm_page_t m, char *msg, char *busy) {
* Put the specified page on the active list (if appropriate).
*
* The page queues must be locked.
- * This routine may not block.
*/
void
vm_page_activate(m)
register vm_page_t m;
{
int s;
+ vm_page_t np;
+ vm_object_t object;
s = splvm();
if (m->queue != PQ_ACTIVE) {
@@ -1107,9 +1059,7 @@ vm_page_activate(m)
}
/*
- * helper routine for vm_page_free and vm_page_free_zero.
- *
- * This routine may not block.
+ * helper routine for vm_page_free and vm_page_free_zero
*/
static int
vm_page_freechk_and_unqueue(m)
@@ -1149,7 +1099,6 @@ vm_page_freechk_and_unqueue(m)
m->wire_count, m->pindex);
}
#endif
- printf("vm_page_free: freeing wired page\n");
m->wire_count = 0;
if (m->object)
m->object->wire_count--;
@@ -1176,9 +1125,7 @@ vm_page_freechk_and_unqueue(m)
}
/*
- * helper routine for vm_page_free and vm_page_free_zero.
- *
- * This routine may not block.
+ * helper routine for vm_page_free and vm_page_free_zero
*/
static __inline void
vm_page_free_wakeup()
@@ -1211,7 +1158,6 @@ vm_page_free_wakeup()
* disassociating it with any VM object.
*
* Object and page must be locked prior to entry.
- * This routine may not block.
*/
void
vm_page_free(m)
@@ -1284,7 +1230,6 @@ vm_page_free_zero(m)
* as necessary.
*
* The page queues must be locked.
- * This routine may not block.
*/
void
vm_page_wire(m)
@@ -1292,16 +1237,16 @@ vm_page_wire(m)
{
int s;
- s = splvm();
if (m->wire_count == 0) {
+ s = splvm();
vm_page_unqueue(m);
+ splx(s);
cnt.v_wire_count++;
if (m->object)
m->object->wire_count++;
}
- m->wire_count++;
- splx(s);
(*vm_page_queues[PQ_NONE].lcnt)++;
+ m->wire_count++;
vm_page_flag_set(m, PG_MAPPED);
}
@@ -1312,12 +1257,10 @@ vm_page_wire(m)
* enabling it to be paged again.
*
* The page queues must be locked.
- * This routine may not block.
*/
void
-vm_page_unwire(m, activate)
+vm_page_unwire(m)
register vm_page_t m;
- int activate;
{
int s;
@@ -1329,17 +1272,10 @@ vm_page_unwire(m, activate)
if (m->object)
m->object->wire_count--;
cnt.v_wire_count--;
- if (activate) {
- TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
- m->queue = PQ_ACTIVE;
- (*vm_page_queues[PQ_ACTIVE].lcnt)++;
- cnt.v_active_count++;
- } else {
- TAILQ_INSERT_TAIL(&vm_page_queue_inactive, m, pageq);
- m->queue = PQ_INACTIVE;
- (*vm_page_queues[PQ_INACTIVE].lcnt)++;
- cnt.v_inactive_count++;
- }
+ TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
+ m->queue = PQ_ACTIVE;
+ (*vm_page_queues[PQ_ACTIVE].lcnt)++;
+ cnt.v_active_count++;
}
} else {
#if !defined(MAX_PERF)
@@ -1351,9 +1287,13 @@ vm_page_unwire(m, activate)
/*
- * Move the specified page to the inactive queue.
+ * vm_page_deactivate:
+ *
+ * Returns the given page to the inactive list,
+ * indicating that no physical maps have access
+ * to this page. [Used by the physical mapping system.]
*
- * This routine may not block.
+ * The page queues must be locked.
*/
void
vm_page_deactivate(m)
@@ -1362,7 +1302,11 @@ vm_page_deactivate(m)
int s;
/*
- * Ignore if already inactive.
+ * Only move active pages -- ignore locked or already inactive ones.
+ *
+ * XXX: sometimes we get pages which aren't wired down or on any queue -
+ * we need to put them on the inactive queue also, otherwise we lose
+ * track of them. Paul Mackerras (paulus@cs.anu.edu.au) 9-Jan-93.
*/
if (m->queue == PQ_INACTIVE)
return;
@@ -1383,8 +1327,7 @@ vm_page_deactivate(m)
/*
* vm_page_cache
*
- * Put the specified page onto the page cache queue (if appropriate).
- * This routine may not block.
+ * Put the specified page onto the page cache queue (if appropriate).
*/
void
vm_page_cache(m)
@@ -1422,8 +1365,6 @@ vm_page_cache(m)
* Grab a page, waiting until we are waken up due to the page
* changing state. We keep on waiting, if the page continues
* to be in the object. If the page doesn't exist, allocate it.
- *
- * This routine may block.
*/
vm_page_t
vm_page_grab(object, pindex, allocflags)
@@ -1471,7 +1412,7 @@ retrylookup:
/*
* mapping function for valid bits or for dirty bits in
- * a page. May not block.
+ * a page
*/
__inline int
vm_page_bits(int base, int size)
@@ -1493,7 +1434,7 @@ vm_page_bits(int base, int size)
}
/*
- * set a page valid and clean. May not block.
+ * set a page valid and clean
*/
void
vm_page_set_validclean(m, base, size)
@@ -1509,7 +1450,7 @@ vm_page_set_validclean(m, base, size)
}
/*
- * set a page (partially) invalid. May not block.
+ * set a page (partially) invalid
*/
void
vm_page_set_invalid(m, base, size)
@@ -1526,7 +1467,7 @@ vm_page_set_invalid(m, base, size)
}
/*
- * is (partial) page valid? May not block.
+ * is (partial) page valid?
*/
int
vm_page_is_valid(m, base, size)
@@ -1542,10 +1483,6 @@ vm_page_is_valid(m, base, size)
return 0;
}
-/*
- * update dirty bits from pmap/mmu. May not block.
- */
-
void
vm_page_test_dirty(m)
vm_page_t m;
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 3149391d9127..32c83410f73f 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_page.h,v 1.48 1998/10/28 13:37:02 dg Exp $
+ * $Id: vm_page.h,v 1.45 1998/09/01 17:12:19 wollman Exp $
*/
/*
@@ -203,6 +203,7 @@ extern struct vpgqueues {
*/
#define PG_BUSY 0x01 /* page is in transit (O) */
#define PG_WANTED 0x02 /* someone is waiting for page (O) */
+#define PG_TABLED 0x04 /* page is in an object (O) */
#define PG_FICTITIOUS 0x08 /* physical page doesn't exist (O) */
#define PG_WRITEABLE 0x10 /* page is mapped writeable */
#define PG_MAPPED 0x20 /* page is mapped */
@@ -361,7 +362,7 @@ vm_page_t vm_page_lookup __P((vm_object_t, vm_pindex_t));
void vm_page_remove __P((vm_page_t));
void vm_page_rename __P((vm_page_t, vm_object_t, vm_pindex_t));
vm_offset_t vm_page_startup __P((vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_page_unwire __P((vm_page_t, int));
+void vm_page_unwire __P((vm_page_t));
void vm_page_wire __P((vm_page_t));
void vm_page_unqueue __P((vm_page_t));
void vm_page_unqueue_nowakeup __P((vm_page_t));
@@ -391,8 +392,12 @@ vm_page_hold(vm_page_t mem)
static __inline void
vm_page_unhold(vm_page_t mem)
{
+#ifdef DIAGNOSTIC
+ if (--mem->hold_count < 0)
+ panic("vm_page_unhold: hold count < 0!!!");
+#else
--mem->hold_count;
- KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!"));
+#endif
}
static __inline void
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 606981f819e4..a9e9cfbe1df5 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pageout.c,v 1.128 1998/10/25 17:44:59 phk Exp $
+ * $Id: vm_pageout.c,v 1.126 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -155,19 +155,19 @@ static int vm_swap_idle_enabled=0;
#endif
SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm,
- CTLFLAG_RW, &vm_pageout_algorithm_lru, 0, "LRU page mgmt");
+ CTLFLAG_RW, &vm_pageout_algorithm_lru, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_max,
- CTLFLAG_RW, &vm_pageout_stats_max, 0, "Max pageout stats scan length");
+ CTLFLAG_RW, &vm_pageout_stats_max, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_full_stats_interval,
- CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "Interval for full stats scan");
+ CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_interval,
- CTLFLAG_RW, &vm_pageout_stats_interval, 0, "Interval for partial stats scan");
+ CTLFLAG_RW, &vm_pageout_stats_interval, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_free_max,
- CTLFLAG_RW, &vm_pageout_stats_free_max, 0, "Not implemented");
+ CTLFLAG_RW, &vm_pageout_stats_free_max, 0, "");
#if defined(NO_SWAPPING)
SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
@@ -176,19 +176,19 @@ SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled,
CTLFLAG_RD, &vm_swap_idle_enabled, 0, "");
#else
SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
- CTLFLAG_RW, &vm_swap_enabled, 0, "Enable entire process swapout");
+ CTLFLAG_RW, &vm_swap_enabled, 0, "");
SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled,
- CTLFLAG_RW, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria");
+ CTLFLAG_RW, &vm_swap_idle_enabled, 0, "");
#endif
SYSCTL_INT(_vm, OID_AUTO, defer_swapspace_pageouts,
- CTLFLAG_RW, &defer_swap_pageouts, 0, "Give preference to dirty pages in mem");
+ CTLFLAG_RW, &defer_swap_pageouts, 0, "");
SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts,
- CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages");
+ CTLFLAG_RW, &disable_swap_pageouts, 0, "");
SYSCTL_INT(_vm, OID_AUTO, max_page_launder,
- CTLFLAG_RW, &max_page_launder, 0, "Maximum number of pages to clean per pass");
+ CTLFLAG_RW, &max_page_launder, 0, "");
#define VM_PAGEOUT_PAGE_COUNT 16
@@ -1221,6 +1221,7 @@ vm_pageout()
* The pageout daemon is never done, so loop forever.
*/
while (TRUE) {
+ int inactive_target;
int error;
int s = splvm();
if (!vm_pages_needed ||
@@ -1274,6 +1275,7 @@ vm_req_vmdaemon()
static void
vm_daemon()
{
+ vm_object_t object;
struct proc *p;
while (TRUE) {
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index 18df05d88e66..21267e00fb19 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pager.c,v 1.39 1998/10/31 15:31:29 peter Exp $
+ * $Id: vm_pager.c,v 1.37 1998/03/16 01:56:01 dyson Exp $
*/
/*
@@ -71,7 +71,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/ucred.h>
#include <sys/malloc.h>
@@ -214,7 +213,7 @@ vm_pager_bufferinit()
for (i = 0; i < nswbuf; i++, bp++) {
TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist);
bp->b_rcred = bp->b_wcred = NOCRED;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
}
swapbkva = kmem_alloc_pageable(pager_map, nswbuf * MAXPHYS);
@@ -337,7 +336,7 @@ initpbuf(struct buf *bp) {
bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
bp->b_kvabase = bp->b_data;
bp->b_kvasize = MAXPHYS;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
}
/*
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index bfcebdc028c9..10488d9a2184 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.56 1998/07/04 22:30:26 julian Exp $
+ * $Id: vm_swap.c,v 1.55 1998/07/04 20:45:42 julian Exp $
*/
#include "opt_devfs.h"
@@ -203,8 +203,8 @@ swapon(p, uap)
switch (vp->v_type) {
case VBLK:
- dev = vp->v_rdev;
- if (major(dev) >= nblkdev || bdevsw[major(dev)] == NULL) {
+ dev = (dev_t) vp->v_rdev;
+ if (major(dev) >= nblkdev) {
error = ENXIO;
break;
}
@@ -264,11 +264,14 @@ swaponvp(p, vp, dev, nblks)
}
return EINVAL;
found:
+ if (dev != NODEV && (major(dev) >= nblkdev))
+ return (ENXIO);
+
error = VOP_OPEN(vp, FREAD | FWRITE, p->p_ucred, p);
if (error)
return (error);
- if (nblks == 0 && dev != NODEV && (bdevsw[major(dev)]->d_psize == 0 ||
+ if (nblks == 0 && (bdevsw[major(dev)]->d_psize == 0 ||
(nblks = (*bdevsw[major(dev)]->d_psize) (dev)) == -1)) {
(void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, p);
return (ENXIO);
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c
index 0d684a74d321..11a7ae079708 100644
--- a/sys/vm/vm_zone.c
+++ b/sys/vm/vm_zone.c
@@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vm_zone.c,v 1.25 1999/01/08 17:31:29 eivind Exp $
+ * $Id: vm_zone.c,v 1.21 1998/04/25 04:50:01 dyson Exp $
*/
#include <sys/param.h>
@@ -194,7 +194,7 @@ zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems)
z->zitems = NULL;
for (i = 0; i < nitems; i++) {
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
((void **) item)[1] = (void *) ZENTRY_FREE;
#endif
z->zitems = item;
@@ -357,7 +357,7 @@ _zget(vm_zone_t z)
nitems -= 1;
for (i = 0; i < nitems; i++) {
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
((void **) item)[1] = (void *) ZENTRY_FREE;
#endif
z->zitems = item;
@@ -367,7 +367,7 @@ _zget(vm_zone_t z)
} else if (z->zfreecnt > 0) {
item = z->zitems;
z->zitems = ((void **) item)[0];
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] != (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_NOTFREE);
((void **) item)[1] = 0;
@@ -388,8 +388,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
char tmpbuf[128];
char tmpname[14];
- snprintf(tmpbuf, sizeof(tmpbuf),
- "\nITEM SIZE LIMIT USED FREE REQUESTS\n");
+ sprintf(tmpbuf, "\nITEM SIZE LIMIT USED FREE REQUESTS\n");
error = SYSCTL_OUT(req, tmpbuf, strlen(tmpbuf));
if (error)
return (error);
@@ -414,7 +413,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
tmpbuf[0] = '\n';
}
- snprintf(tmpbuf + offset, sizeof(tmpbuf) - offset,
+ sprintf(tmpbuf + offset,
"%s %6.6u, %8.8u, %6.6u, %6.6u, %8.8u\n",
tmpname, curzone->zsize, curzone->zmax,
(curzone->ztotal - curzone->zfreecnt),
@@ -432,7 +431,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
return (0);
}
-#ifdef INVARIANT_SUPPORT
+#if defined(DIAGNOSTIC)
void
zerror(int error)
{
@@ -460,8 +459,8 @@ SYSCTL_OID(_vm, OID_AUTO, zone, CTLTYPE_STRING|CTLFLAG_RD, \
NULL, 0, sysctl_vm_zone, "A", "Zone Info");
SYSCTL_INT(_vm, OID_AUTO, zone_kmem_pages,
- CTLFLAG_RD, &zone_kmem_pages, 0, "Number of interrupt safe pages allocated by zone");
+ CTLFLAG_RD, &zone_kmem_pages, 0, "");
SYSCTL_INT(_vm, OID_AUTO, zone_kmem_kvaspace,
- CTLFLAG_RD, &zone_kmem_kvaspace, 0, "KVA space allocated by zone");
+ CTLFLAG_RD, &zone_kmem_kvaspace, 0, "");
SYSCTL_INT(_vm, OID_AUTO, zone_kern_pages,
- CTLFLAG_RD, &zone_kern_pages, 0, "Number of non-interrupt safe pages allocated by zone");
+ CTLFLAG_RD, &zone_kern_pages, 0, "");
diff --git a/sys/vm/vm_zone.h b/sys/vm/vm_zone.h
index 8fe91d1e1aaf..55c54d37f4f0 100644
--- a/sys/vm/vm_zone.h
+++ b/sys/vm/vm_zone.h
@@ -11,10 +11,10 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vm_zone.h,v 1.11 1999/01/08 17:31:30 eivind Exp $
+ * $Id: vm_zone.c,v 1.20 1998/04/15 17:47:40 bde Exp $
*/
-#ifndef _SYS_ZONE_H
+#if !defined(_SYS_ZONE_H)
#define _SYS_ZONE_H
@@ -76,7 +76,7 @@ _zalloc(vm_zone_t z)
{
void *item;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (z == 0)
zerror(ZONE_ERROR_INVALID);
#endif
@@ -86,7 +86,7 @@ _zalloc(vm_zone_t z)
item = z->zitems;
z->zitems = ((void **) item)[0];
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] != (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_NOTFREE);
((void **) item)[1] = 0;
@@ -101,7 +101,7 @@ static __inline__ void
_zfree(vm_zone_t z, void *item)
{
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] == (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_ALREADYFREE);
((void **) item)[1] = (void *) ZENTRY_FREE;
@@ -123,7 +123,7 @@ zalloc(vm_zone_t z)
static __inline__ void
zfree(vm_zone_t z, void *item)
{
-#ifdef SMP
+#if defined(SMP)
zfreei(z, item);
#else
_zfree(z, item);
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index fba7e2fbec27..23affb7cce1d 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.100 1998/10/13 08:24:44 dg Exp $
+ * $Id: vnode_pager.c,v 1.99 1998/09/28 23:58:10 rvb Exp $
*/
/*
@@ -489,7 +489,7 @@ vnode_pager_input_old(object, m)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_resid = size;
- auio.uio_procp = curproc;
+ auio.uio_procp = (struct proc *) 0;
error = VOP_READ(object->handle, &auio, 0, curproc->p_ucred);
if (!error) {
diff --git a/tools/tools/README b/tools/tools/README
index b305823f6169..ae36093ea7d5 100644
--- a/tools/tools/README
+++ b/tools/tools/README
@@ -1,4 +1,4 @@
-# $Id: README,v 1.14 1998/12/17 12:21:19 cracauer Exp $
+# $Id: README,v 1.11 1998/05/20 09:19:50 wosch Exp $
This directory is for tools.
@@ -7,21 +7,15 @@ other categories.
Please make a subdir per program, and add a brief description to this file.
-editing Editor modes and the like to help editing FreeBSD code.
-epfe Extract printing filter examples from printing.sgml.
-html-mv Rename HTML generated filenames to human readable filenames.
ifinfo Uses the interface MIB to print out all the information
an interface exports in an ugly form.
+kernxref Shellscript to cross reference symbols in the LINT kernel.
+epfe extract printing filter examples from printing.sgml
+tcl_bmake generates a bmake Makefile for src/lib/libtcl
kdrv KernelDriver; add/list/remove third-party kernel driver
source to/in/from a kernel source tree.
-kernxref Shellscript to cross reference symbols in the LINT kernel.
-mid Create a Message-ID database for mailing lists.
-portsinfo Generate list of new ports for last two weeks.
scsi-defects Get at the primary or grown defect list of a SCSI disk.
-tcl_bmake Generates a bmake Makefile for src/lib/libtcl.
+portsinfo Generate list of new ports for last two weeks.
+html-mv Rename HTML generated filenames to human readable filenames.
+mid Create a Message-ID database for mailing lists.
upgrade Scripts used for upgrading an installed system.
-vop_table Generates a HTML document that shows all the VOP's in
- the kernel.
-diffburst Reads the output of 'diff -r' and splits it into separate
- patch files, one per file. The files are named 'patch-XX'
- where XX is aa, ab, ac, ... Useful when creating ports.
diff --git a/tools/tools/diffburst/Makefile b/tools/tools/diffburst/Makefile
deleted file mode 100644
index 4e58e4cdd866..000000000000
--- a/tools/tools/diffburst/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id: Makefile,v 1.1 1997/12/06 00:44:04 archie Exp $
-
-PROG= diffburst
-SRCS= main.c
-MAN1= diffburst.1
-
-COPTS+= -g -Wall
-
-.include <bsd.prog.mk>
diff --git a/tools/tools/diffburst/diffburst.1 b/tools/tools/diffburst/diffburst.1
deleted file mode 100644
index 91a33091ab52..000000000000
--- a/tools/tools/diffburst/diffburst.1
+++ /dev/null
@@ -1,19 +0,0 @@
-.Dd Jan 7, 1999
-.Dt DIFFBURST 1
-.Os BSD 4.4
-.Sh NAME
-.Nm diffburst
-.Nd split recursive diff output into separate files
-.Sh SYNOPSIS
-.Nm diffburst < input
-.Sh DESCRIPTION
-.Nm
-reads the output of a recursive diff from standard input,
-and writes it back out as a series of patchfiles, where each patchfile
-contains the diff for a single file. The files are named
-patch-aa, patch-ab, and so on.
-.Pp
-This program is intended to aid in developing FreeBSD ports,
-where the 'one patchfile per file' rule applies.
-.Sh AUTHOR
-Archie Cobbs <archie@whistle.com>
diff --git a/tools/tools/diffburst/main.c b/tools/tools/diffburst/main.c
deleted file mode 100644
index a38e40c5e1f1..000000000000
--- a/tools/tools/diffburst/main.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <err.h>
-
-/* Split a recursive diff into sub-patches to satisfy the requirement
- that each patch only patch a single file */
-
-int
-main(int ac, char *av[])
-{
- int ln;
- char line[8192];
- char suf[2] = { 'a', 'a' };
- FILE *fp = NULL;
-
- memset(line, 0, sizeof(line));
- for (ln = 1; fgets(line, sizeof(line) - 1, stdin); ln++)
- {
- if (line[strlen(line) - 1] != '\n')
- errx(1, "line %d is too long", ln);
- if (!strncmp(line, "diff", 4) && fp != NULL)
- {
- fclose(fp);
- fp = NULL;
- }
- if (fp == NULL)
- {
- char name[200];
-
- snprintf(name, sizeof(name), "patch-%c%c", suf[0], suf[1]);
- if (suf[1]++ == 'z')
- {
- suf[1] = 'a';
- suf[0]++;
- }
- if ((fp = fopen(name, "w")) == NULL)
- err(1, "%s", name);
- }
- fprintf(fp, "%s", line);
- }
- return(0);
-}
-
diff --git a/tools/tools/editing/freebsd.el b/tools/tools/editing/freebsd.el
deleted file mode 100644
index 63976b0d6b6e..000000000000
--- a/tools/tools/editing/freebsd.el
+++ /dev/null
@@ -1,40 +0,0 @@
-;;; This function switches C-mode so that it indents almost everything
-;;; as specified in FreeBSD's style(9). Tested with emacs-19.34 and
-;;; xemacs-20.4.
-;;;
-;;; Use "M-x bsd" in a C mode buffer to activate it.
-;;;
-;;; The only problem I found is top-level indenting:
-;;;
-;;; We want function definitions with the function name at the beginning
-;;; of a second line after the return type specification in the first:
-;;; > int
-;;; > foo(int bla)
-;;; But emacs c-mode can't treat this differently from other multiple-line
-;;; toplevel constructs:
-;;; > const char *const bar =
-;;; > "sometext";
-;;; which means the second line must be indented by hand.
-;;;
-;;; To make this the default, use a line like this, but you can't easily
-;;; switch back to default GNU style, since the old state isn't saved.
-;;; (add-hook 'c-mode-common-hook 'bsd)
-;;; As long as you don't have this in the c-mode hook you can edit GNU
-;;; and BSD style C sources within one emacs session with no problem.
-;;;
-;;; Please report problems and additions directly to cracauer@freebsd.org
-
-(defun bsd () (interactive)
- (c-set-style "bsd")
- (setq indent-tabs-mode t)
- ;; Use C-c C-s at points of source code so see which
- ;; c-set-offset is in effect for this situation
- (c-set-offset 'defun-block-intro 8)
- (c-set-offset 'statement-block-intro 8)
- (c-set-offset 'statement-case-intro 8)
- (c-set-offset 'substatement-open 4)
- (c-set-offset 'substatement 8)
- (c-set-offset 'arglist-cont-nonempty 4)
- (c-set-offset 'inclass 8)
- (c-set-offset 'knr-argdecl-intro 8)
- )
diff --git a/tools/tools/kdrv/sample.drvinfo b/tools/tools/kdrv/sample.drvinfo
index 7618d0b549e4..cd624cd873fc 100644
--- a/tools/tools/kdrv/sample.drvinfo
+++ b/tools/tools/kdrv/sample.drvinfo
@@ -2,7 +2,7 @@
# Sample driver information file for KernelDriver. See the top of
# the KernelDriver script for a more exact definition of the syntax.
#
-# $Id: sample.drvinfo,v 1.2 1998/05/06 05:45:17 msmith Exp $
+# $Id: sample.drvinfo,v 1.2 1998/05/04 03:31:03 doconnor Exp $
# Device driver name
#
@@ -39,6 +39,6 @@ linttext
#
# This driver causes your system to emit occasional digestive noises.
#
-device blorg0 at isa? port 0x123 irq 10 flags 0x10 drq 2
-device blorg1 at isa? port 0x234 irq 11 flags 0x10 drq 2
+device blorg0 at isa? port 0x123 irq 10 flags 0x10 drq 2 vector blorgintr
+device blorg1 at isa? port 0x234 irq 11 flags 0x10 drq 2 vector blorgintr
end
diff --git a/tools/tools/kernxref/kernxref.sh b/tools/tools/kernxref/kernxref.sh
index b29e8d6dd7d0..ca483c56942c 100644
--- a/tools/tools/kernxref/kernxref.sh
+++ b/tools/tools/kernxref/kernxref.sh
@@ -7,25 +7,13 @@
# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
# ----------------------------------------------------------------------------
#
-# $Id: kernxref.sh,v 1.10 1998/12/06 21:39:07 archie Exp $
+# $Id$
#
# This shellscript will make a cross reference of the symbols of the LINT
# kernel.
-COMPILEDIR=/sys/compile
-KERNELNAME=LINT
-
-cd ${COMPILEDIR}/${KERNELNAME}
-if file vers.o | grep -q ELF; then
- OBJFORMAT=elf;
-else
- OBJFORMAT=aout;
-fi
-
-OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o /lkm/*.o \
- | tr ' ' '\012' \
- | egrep -v '(aicasm|genassym)'` \
- | tr : ' ' | awk '
+cd /sys/compile/LINT
+nm -gon *.o /lkm/*.o | tr : ' ' | awk '
NF > 1 {
if (length($2) == 8) {
$2 = $3
diff --git a/tools/tools/scsi-defects/README b/tools/tools/scsi-defects/README
index bca470abc9b2..5e0a61647009 100644
--- a/tools/tools/scsi-defects/README
+++ b/tools/tools/scsi-defects/README
@@ -1,5 +1,3 @@
Peter Dufault's tools to extract the primary or grown defect list from
a SCSI disk, wrapped into Perl (for easier decoding of the list) by
Joerg Wunsch.
-
-This has not been ported CAM yet.
diff --git a/tools/tools/upgrade/getosreldate.sh b/tools/tools/upgrade/getosreldate.sh
deleted file mode 100755
index cb23ef310d12..000000000000
--- a/tools/tools/upgrade/getosreldate.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-# $Id$
-
-RELDATE=`sysctl -n kern.osreldate 2>/dev/null`
-if [ "x$RELDATE" = x ]; then
- RELDATE=200000 # assume something really old
-fi
-echo $RELDATE
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index b5c48ce095e1..847bd321fc50 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -1,5 +1,5 @@
# From: @(#)Makefile 8.3 (Berkeley) 1/7/94
-# $Id: Makefile,v 1.121 1998/11/09 11:08:48 dima Exp $
+# $Id: Makefile,v 1.116 1998/10/03 17:59:26 sef Exp $
# XXX MISSING: deroff diction graph learn plot
# spell spline struct xsend
@@ -32,12 +32,9 @@ SUBDIR= apply \
cpp \
ctags \
cut \
- dig \
dirname \
- dnsquery \
du \
ee \
- enigma \
env \
error \
expand \
@@ -53,7 +50,6 @@ SUBDIR= apply \
fpr \
from \
fsplit \
- fstat \
ftp \
gencat \
gensetdefs \
@@ -61,7 +57,6 @@ SUBDIR= apply \
global \
head \
hexdump \
- host \
id \
indent \
ipcrm \
@@ -145,7 +140,6 @@ SUBDIR= apply \
split \
su \
symorder \
- systat \
tail \
talk \
tconv \
@@ -178,7 +172,6 @@ SUBDIR= apply \
vgrind \
vi \
vis \
- vmstat \
w \
wall \
wc \
@@ -209,16 +202,22 @@ SUBDIR+=telnet
# Things that don't compile on alpha or are aout specific:
SUBDIR+=ar \
brandelf \
+ dig \
+ dnsquery \
+ fstat \
gcore \
gprof \
gprof4 \
+ host \
modstat \
nm \
ranlib \
sasc \
size \
strings \
- strip
+ strip \
+ systat \
+ vmstat
.endif
.include <bsd.subdir.mk>
diff --git a/usr.bin/apply/Makefile b/usr.bin/apply/Makefile
index 05823eaaa301..59f358ed5292 100644
--- a/usr.bin/apply/Makefile
+++ b/usr.bin/apply/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= apply
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index 3f0727d372c0..37a77b7d05c9 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94";
+static char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94";
#endif /* not lint */
#include <sys/wait.h>
diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile
index 7392d139db4d..ec9b2629eaa6 100644
--- a/usr.bin/ar/Makefile
+++ b/usr.bin/ar/Makefile
@@ -1,8 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id: Makefile,v 1.7 1998/10/10 12:48:48 bde Exp $
+# $Id$
PROG= ar
-CFLAGS+=-I${.CURDIR} -Wall
+CFLAGS+=-I${.CURDIR}
SRCS= append.c ar.c archive.c contents.c delete.c extract.c misc.c \
move.c print.c replace.c
MAN1aout=ar.1aout
diff --git a/usr.bin/ar/append.c b/usr.bin/ar/append.c
index 58c06b5e0a79..ea2e04c64b07 100644
--- a/usr.bin/ar/append.c
+++ b/usr.bin/ar/append.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c
index b2c85fc79537..f27ff84c43bb 100644
--- a/usr.bin/ar/ar.c
+++ b/usr.bin/ar/ar.c
@@ -33,17 +33,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ar.c,v 1.6 1997/06/23 06:41:30 charnier Exp $
+ * $Id$
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
@@ -80,7 +80,7 @@ main(argc, argv)
{
int c;
char *p;
- int (*fcall) __P((char **)) = NULL;
+ int (*fcall) __P((char **));
(void) setlocale(LC_TIME, "");;
diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c
index 71606bd3efb6..c8803cc0bc1c 100644
--- a/usr.bin/ar/archive.c
+++ b/usr.bin/ar/archive.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
@@ -279,7 +279,7 @@ copy_ar(cfp, size)
{
static char pad = '\n';
off_t sz;
- int from, nr = 0, nw, off, to;
+ int from, nr, nw, off, to;
char buf[8*1024];
if (!(sz = size))
diff --git a/usr.bin/ar/contents.c b/usr.bin/ar/contents.c
index e31cd639acfa..e000d535dc59 100644
--- a/usr.bin/ar/contents.c
+++ b/usr.bin/ar/contents.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/delete.c b/usr.bin/ar/delete.c
index 152395bef3a7..5824b6122484 100644
--- a/usr.bin/ar/delete.c
+++ b/usr.bin/ar/delete.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)delete.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)delete.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/extract.c b/usr.bin/ar/extract.c
index 89503f391c12..c80e37ce50c8 100644
--- a/usr.bin/ar/extract.c
+++ b/usr.bin/ar/extract.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)extract.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)extract.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c
index 026c45dcf598..bcd97118be22 100644
--- a/usr.bin/ar/misc.c
+++ b/usr.bin/ar/misc.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/move.c b/usr.bin/ar/move.c
index 3450ab44bf61..c2dba365dce5 100644
--- a/usr.bin/ar/move.c
+++ b/usr.bin/ar/move.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)move.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)move.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/print.c b/usr.bin/ar/print.c
index accc2e4e60e6..436762859eb6 100644
--- a/usr.bin/ar/print.c
+++ b/usr.bin/ar/print.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/replace.c b/usr.bin/ar/replace.c
index 0cbffd7c23f9..b9a6cc6dc7c5 100644
--- a/usr.bin/ar/replace.c
+++ b/usr.bin/ar/replace.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)replace.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)replace.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/at/Makefile b/usr.bin/at/Makefile
index 393af8387875..55d78b9fbd12 100644
--- a/usr.bin/at/Makefile
+++ b/usr.bin/at/Makefile
@@ -1,9 +1,8 @@
-# $Id: Makefile,v 1.8 1998/09/19 22:42:03 obrien Exp $
+# $Id: Makefile,v 1.7 1998/06/09 04:07:08 imp Exp $
.include "${.CURDIR}/Makefile.inc"
PROG= at
-CFLAGS+=-Wall
SRCS= at.c panic.c parsetime.c perm.c
LINKS= ${BINDIR}/at ${BINDIR}/atq \
${BINDIR}/at ${BINDIR}/atrm \
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 3264d5502a2d..daded161ad84 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -92,7 +92,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
/* File scope variables */
-static const char rcsid[] = "$Id: at.c,v 1.14 1998/10/15 13:30:48 mckay Exp $";
+static char rcsid[] = "$Id: at.c,v 1.13 1997/03/29 04:27:56 imp Exp $";
char *no_export[] =
{
"TERM", "TERMCAP", "DISPLAY", "_"
diff --git a/usr.bin/at/panic.c b/usr.bin/at/panic.c
index c111dd823384..7ef0e15d13b1 100644
--- a/usr.bin/at/panic.c
+++ b/usr.bin/at/panic.c
@@ -37,8 +37,7 @@
/* File scope variables */
-static const char rcsid[] =
- "$Id: panic.c,v 1.7 1997/06/23 06:44:18 charnier Exp $";
+static char rcsid[] = "$Id: panic.c,v 1.6 1997/02/22 19:54:06 peter Exp $";
/* External variables */
diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c
index 8cde1dceeb01..8ba6a149d822 100644
--- a/usr.bin/at/parsetime.c
+++ b/usr.bin/at/parsetime.c
@@ -143,8 +143,7 @@ static size_t sc_len; /* scanner - lenght of token buffer */
static int sc_tokid; /* scanner - token id */
static int sc_tokplur; /* scanner - is token plural? */
-static const char rcsid[] =
- "$Id: parsetime.c,v 1.15 1998/08/30 17:33:05 steve Exp $";
+static char rcsid[] = "$Id: parsetime.c,v 1.14 1998/08/08 14:02:06 alex Exp $";
/* Local functions */
@@ -465,7 +464,7 @@ static void
month(struct tm *tm)
{
long year= (-1);
- long mday = 0, wday, mon;
+ long mday, wday, mon;
int tlen;
switch (sc_tokid) {
diff --git a/usr.bin/at/perm.c b/usr.bin/at/perm.c
index f1d435246a7d..d52fd3db1990 100644
--- a/usr.bin/at/perm.c
+++ b/usr.bin/at/perm.c
@@ -48,7 +48,7 @@
/* File scope variables */
-static const char rcsid[] = "$Id: perm.c,v 1.5 1997/02/22 19:54:08 peter Exp $";
+static char rcsid[] = "$Id$";
/* Function declarations */
diff --git a/usr.bin/banner/Makefile b/usr.bin/banner/Makefile
index c04e68ae64b2..54a3ad5cb20b 100644
--- a/usr.bin/banner/Makefile
+++ b/usr.bin/banner/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= banner
-CFLAGS+=-Wall
MAN6= banner.6
.include <bsd.prog.mk>
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index 15a2952ed1f4..13a28497489d 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
+static char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
#endif /* not lint */
/*
diff --git a/usr.bin/basename/Makefile b/usr.bin/basename/Makefile
index d74d67007e38..21354bd3a113 100644
--- a/usr.bin/basename/Makefile
+++ b/usr.bin/basename/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= basename
-CFLAGS+=-Wall
MLINKS= basename.1 dirname.1
.include <bsd.prog.mk>
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c
index 1a6aa485be05..596401311759 100644
--- a/usr.bin/basename/basename.c
+++ b/usr.bin/basename/basename.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <stdio.h>
diff --git a/usr.bin/biff/Makefile b/usr.bin/biff/Makefile
index db26fc47fbba..81cb86bc6afa 100644
--- a/usr.bin/biff/Makefile
+++ b/usr.bin/biff/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= biff
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index 185d6349167e..52f5229ff1a8 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -30,17 +30,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: biff.c,v 1.4 1997/12/29 00:08:50 alex Exp $
+ * $Id: biff.c,v 1.3 1997/06/23 06:45:38 charnier Exp $
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/brandelf/Makefile b/usr.bin/brandelf/Makefile
index 81d0039e47df..3561ec00cf75 100644
--- a/usr.bin/brandelf/Makefile
+++ b/usr.bin/brandelf/Makefile
@@ -1,4 +1,3 @@
PROG= brandelf
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/calendar/calendars/calendar.birthday b/usr.bin/calendar/calendars/calendar.birthday
index 10ea34328ca9..99922af3402b 100644
--- a/usr.bin/calendar/calendars/calendar.birthday
+++ b/usr.bin/calendar/calendars/calendar.birthday
@@ -1,7 +1,7 @@
/*
* Birthday
*
- * $Id: calendar.birthday,v 1.9 1998/10/22 07:56:22 torstenb Exp $
+ * $Id: calendar.birthday,v 1.6 1997/02/25 01:20:23 mpp Exp $
*/
#ifndef _calendar_birthday_
@@ -177,7 +177,6 @@
07/30 Henry Ford born, 1863
08/01 Herman Melville born, 1819
08/03 Lenny Bruce dies of a morphine overdose, 1966
-08/06 Jonathan B. Postel is born in Altadena, Calif.
08/08 Dustin Hoffman born in Los Angeles, 1937
08/12 Thomas Mann's Death, 1955
08/13 Annie Oakley born, 1860
@@ -230,7 +229,6 @@
10/15 Pelham Grenville Wodehouse born, 1881
10/16 Noah Webster born, 1758
10/16 Oscar (Fingal O'Flahertie Wills) Wilde born in Dublin, 1854
-10/16 Dr. Jonathan B. Postel dies at age 55, 1998
10/17 Richard Mentor Johnson born, 1780, 9th V.P. of U.S.
10/21 Alfred Nobel born in Stockholm, 1833
10/27 Gerald M. Weinberg born, 1933
diff --git a/usr.bin/cap_mkdb/Makefile b/usr.bin/cap_mkdb/Makefile
index 88a34d7dae45..0e403afc409f 100644
--- a/usr.bin/cap_mkdb/Makefile
+++ b/usr.bin/cap_mkdb/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cap_mkdb
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index f28d8db0805d..91c222228456 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chat/Makefile b/usr.bin/chat/Makefile
index 1154024e846f..ab4129e05048 100644
--- a/usr.bin/chat/Makefile
+++ b/usr.bin/chat/Makefile
@@ -1,7 +1,6 @@
-# $Id: Makefile,v 1.5 1997/08/22 15:42:31 peter Exp $
+# $Id: Makefile,v 1.4 1997/02/22 19:54:21 peter Exp $
PROG= chat
-CFLAGS+=-Wall
SRCS= chat.c
MAN8= chat.8
diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c
index c25b8cfd8775..f3676aa02799 100644
--- a/usr.bin/chat/chat.c
+++ b/usr.bin/chat/chat.c
@@ -78,8 +78,7 @@
*/
#ifndef lint
-static const char rcsid[] =
- "$Id: chat.c,v 1.12 1998/06/23 21:58:41 peter Exp $";
+static char rcsid[] = "$Id: chat.c,v 1.11 1998/03/21 20:47:04 peter Exp $";
#endif
#include <stdio.h>
diff --git a/usr.bin/checknr/Makefile b/usr.bin/checknr/Makefile
index 85e4c48e827d..c26524876bd4 100644
--- a/usr.bin/checknr/Makefile
+++ b/usr.bin/checknr/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= checknr
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index 743ed04e24c5..f8531cc7da13 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
diff --git a/usr.bin/chflags/Makefile b/usr.bin/chflags/Makefile
index d05ff81f8a1f..d269255b6c65 100644
--- a/usr.bin/chflags/Makefile
+++ b/usr.bin/chflags/Makefile
@@ -3,7 +3,6 @@
NOSHARED?=yes
PROG= chflags
-CFLAGS+=-Wall
SRCS= chflags.c stat_flags.c
.PATH: ${.CURDIR}/../../bin/ls
diff --git a/usr.bin/chflags/chflags.c b/usr.bin/chflags/chflags.c
index 664609417ef5..f33f46eeccf3 100644
--- a/usr.bin/chflags/chflags.c
+++ b/usr.bin/chflags/chflags.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
+static char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/chpass/Makefile b/usr.bin/chpass/Makefile
index 3abed829d3ac..f19a25730d1f 100644
--- a/usr.bin/chpass/Makefile
+++ b/usr.bin/chpass/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/2/94
PROG= chpass
-CFLAGS+=-Wall
SRCS= chpass.c edit.c field.c pw_copy.c pw_scan.c pw_util.c pw_yp.c \
table.c util.c ypxfr_misc.c ${GENSRCS}
GENSRCS=yp.h yp_clnt.c yppasswd.h yppasswd_clnt.c yppasswd_private.h \
diff --git a/usr.bin/chpass/chpass.1 b/usr.bin/chpass/chpass.1
index 8bcd8c826358..c810f9bffcad 100644
--- a/usr.bin/chpass/chpass.1
+++ b/usr.bin/chpass/chpass.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chpass.1 8.2 (Berkeley) 12/30/93
-.\" $Id: chpass.1,v 1.13 1998/12/13 02:48:43 dillon Exp $
+.\" $Id: chpass.1,v 1.7.2.4 1998/08/14 03:38:01 thepish Exp $
.\"
.Dd December 30, 1993
.Dt CHPASS 1
@@ -88,30 +88,26 @@ user's encrypted password
user's login
.It Gid:
user's login group
-.It Class:
-user's general classification
.It Change:
password change time
.It Expire:
account expiration time
+.It Class:
+user's general classification
+.It Home Directory:
+user's home directory
+.It Shell:
+user's login shell
.It Full Name:
user's real name
.It Location:
-user's normal location (1)
+user's normal location
.It Home Phone:
-user's home phone (1)
+user's home phone
.It Office Phone:
-user's office phone (1)
+user's office phone
.It Other Information:
-any locally defined parameters for user (1)
-.It Home Directory:
-user's home directory
-.It Shell:
-user's login shell
-.Pp
-.It NOTE(1) -
-In the actual master.passwd file, these fields are comma-delimited
-fields embedded in the FullName field.
+any locally defined parameters for user
.El
.Pp
The
@@ -145,13 +141,6 @@ This field may be filled in with either a number or a group name (see
.Xr group 5 ) .
.Pp
The
-.Ar class
-field references class descriptions in
-.Ar /etc/login.conf
-and is typically used to initialize the user's system resource limits
-when they login.
-.Pp
-The
.Ar change
field is the date by which the password must be changed.
.Pp
@@ -171,15 +160,12 @@ is the day of the month, and
.Ar year
is the year.
.Pp
-Five fields are available for storing the user's
-.Ar full name , office location ,
-.Ar work
-and
-.Ar home telephone
-numbers and finally
-.Ar other information
-which is a single comma delimited string to represent any additional
-gcos fields (typically used for site specific user information).
+The
+.Ar class
+field is currently unused. In the near future it will be a key to
+a
+.Xr termcap 5
+style database of user attributes.
.Pp
The user's
.Ar home directory
@@ -200,6 +186,16 @@ shell.
Non-standard is defined as a shell not found in
.Pa /etc/shells .
.Pp
+The last five fields are for storing the user's
+.Ar full name , office location ,
+.Ar work
+and
+.Ar home telephone
+numbers and finally
+.Ar other information
+which is a single comma delimited string to represent any additional
+gcos fields (typically used for site specific user information).
+.Pp
Once the information has been verified,
.Nm chpass
uses
@@ -402,7 +398,6 @@ The list of approved shells
.Xr login 1 ,
.Xr passwd 1 ,
.Xr getusershell 3 ,
-.Xr login.conf 5,
.Xr passwd 5 ,
.Xr pwd_mkdb 8 ,
.Xr vipw 8
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c
index 2809f8bef74f..982548fa5a46 100644
--- a/usr.bin/chpass/chpass.c
+++ b/usr.bin/chpass/chpass.c
@@ -32,15 +32,15 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94";
-static const char rcsid[] =
- "$Id: chpass.c,v 1.14 1997/03/29 04:28:38 imp Exp $";
+static char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94";
+static char rcsid[] =
+ "$Id: chpass.c,v 1.13 1997/02/22 19:54:25 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -83,10 +83,10 @@ main(argc, argv)
char **argv;
{
enum { NEWSH, LOADENTRY, EDITENTRY, NEWPW, NEWEXP } op;
- struct passwd *pw = NULL, lpw;
+ struct passwd *pw, lpw;
char *username = NULL;
int ch, pfd, tfd;
- char *arg = NULL;
+ char *arg;
#ifdef YP
int force_local = 0;
int force_yp = 0;
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index 9cae42e753fc..68dbc0ea50e3 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -30,11 +30,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: edit.c,v 1.11 1998/08/14 03:18:32 thepish Exp $
+ * $Id: edit.c,v 1.10 1997/06/25 06:59:55 charnier Exp $
*/
#ifndef lint
-static const char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chpass/field.c b/usr.bin/chpass/field.c
index 997d21feed30..73fa4795a2e0 100644
--- a/usr.bin/chpass/field.c
+++ b/usr.bin/chpass/field.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chpass/pw_copy.c b/usr.bin/chpass/pw_copy.c
index d60f75177492..73e2da22115c 100644
--- a/usr.bin/chpass/pw_copy.c
+++ b/usr.bin/chpass/pw_copy.c
@@ -66,8 +66,8 @@ pw_copy(ffd, tfd, pw)
snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid);
snprintf(gidstr, sizeof(gidstr), "%d", pw->pw_gid);
- snprintf(chgstr, sizeof(chgstr), "%ld", (long)pw->pw_change);
- snprintf(expstr, sizeof(expstr), "%ld", (long)pw->pw_expire);
+ snprintf(chgstr, sizeof(chgstr), "%ld", pw->pw_change);
+ snprintf(expstr, sizeof(expstr), "%ld", pw->pw_expire);
if (!(from = fdopen(ffd, "r")))
pw_error(_PATH_MASTERPASSWD, 1, 1);
diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c
index 57542704392a..777ec54d4633 100644
--- a/usr.bin/chpass/pw_yp.c
+++ b/usr.bin/chpass/pw_yp.c
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: pw_yp.c,v 1.12 1997/12/18 15:27:43 bde Exp $
+ * $Id: pw_yp.c,v 1.11 1997/07/29 15:45:36 wpaul Exp $
*/
#ifdef YP
@@ -254,7 +254,7 @@ int use_yp (user, uid, which)
char ubuf[UT_NAMESIZE + 2];
if (which) {
- snprintf(ubuf, sizeof(ubuf), "%lu", (unsigned long)uid);
+ snprintf(ubuf, sizeof(ubuf), "%lu", uid);
user = (char *)&ubuf;
}
diff --git a/usr.bin/chpass/table.c b/usr.bin/chpass/table.c
index 1bc857b87ca8..eed097eebad8 100644
--- a/usr.bin/chpass/table.c
+++ b/usr.bin/chpass/table.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)table.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)table.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c
index d8917f51bc96..132c1514f99a 100644
--- a/usr.bin/chpass/util.c
+++ b/usr.bin/chpass/util.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: util.c,v 1.6 1998/03/23 07:41:49 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -115,12 +115,9 @@ atot(p, store)
year = atoi(t);
if (day < 1 || day > 31 || month < 1 || month > 12 || !year)
goto bad;
- /* Allow two digit years 1969-2068 */
- if (year < 69)
- year += 2000;
- else if (year < 100)
+ if (year < 100)
year += 1900;
- if (year < 1969)
+ if (year <= 1970)
bad: return (1);
lt->tm_year = year - 1900;
lt->tm_mon = month - 1;
diff --git a/usr.bin/cksum/Makefile b/usr.bin/cksum/Makefile
index 4c1d027c04b0..f4fa373c41b1 100644
--- a/usr.bin/cksum/Makefile
+++ b/usr.bin/cksum/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/28/95
PROG= cksum
-CFLAGS+=-Wall
SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c
LINKS= ${BINDIR}/cksum ${BINDIR}/sum
MLINKS= cksum.1 sum.1
diff --git a/usr.bin/cksum/crc.c b/usr.bin/cksum/crc.c
index 0dde11d64b0a..352639531c96 100644
--- a/usr.bin/cksum/crc.c
+++ b/usr.bin/cksum/crc.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93";
+static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/print.c b/usr.bin/cksum/print.c
index b3a92d39a24f..48c38aa9a214 100644
--- a/usr.bin/cksum/print.c
+++ b/usr.bin/cksum/print.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/sum1.c b/usr.bin/cksum/sum1.c
index a46a575b323f..1975ee27fd9d 100644
--- a/usr.bin/cksum/sum1.c
+++ b/usr.bin/cksum/sum1.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/sum2.c b/usr.bin/cksum/sum2.c
index 11abb2c84095..792205044c50 100644
--- a/usr.bin/cksum/sum2.c
+++ b/usr.bin/cksum/sum2.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/Makefile b/usr.bin/cmp/Makefile
index 1ff3af6e6262..1b84ce31b492 100644
--- a/usr.bin/cmp/Makefile
+++ b/usr.bin/cmp/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cmp
-CFLAGS+=-Wall
SRCS= cmp.c misc.c regular.c special.c
.include <bsd.prog.mk>
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index a4f4d8860563..da269d844a95 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1987, 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/misc.c b/usr.bin/cmp/misc.c
index 248ef93f0b74..d5a601daf01a 100644
--- a/usr.bin/cmp/misc.c
+++ b/usr.bin/cmp/misc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index 3b82bae11a69..f540ab4aebe8 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c
index b843cc8fc9cc..0a15fa1b28f4 100644
--- a/usr.bin/cmp/special.c
+++ b/usr.bin/cmp/special.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile
index 9edab17f7698..efa0933830a2 100644
--- a/usr.bin/col/Makefile
+++ b/usr.bin/col/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= col
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index 8d26faadc0a0..88d024e72177 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/colcrt/Makefile b/usr.bin/colcrt/Makefile
index 9bb24b735b8f..e03ab0ca8a9f 100644
--- a/usr.bin/colcrt/Makefile
+++ b/usr.bin/colcrt/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= colcrt
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c
index e6dc44543580..40fe5cef49b2 100644
--- a/usr.bin/colcrt/colcrt.c
+++ b/usr.bin/colcrt/colcrt.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/colldef/Makefile b/usr.bin/colldef/Makefile
index ccb5e98f452e..474bf7bd4da3 100644
--- a/usr.bin/colldef/Makefile
+++ b/usr.bin/colldef/Makefile
@@ -1,8 +1,7 @@
-# $Id: Makefile,v 1.13 1998/05/05 13:16:22 bde Exp $
+# $Id: Makefile,v 1.12 1998/05/04 20:09:02 bde Exp $
PROG = colldef
LFLAGS = -8 -i
-CFLAGS += -Wall
CFLAGS += -I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG
SRCS = parse.y scan.l y.tab.h
LDADD = -ll
diff --git a/usr.bin/colldef/parse.y b/usr.bin/colldef/parse.y
index cfc5642118f7..e316e1c89928 100644
--- a/usr.bin/colldef/parse.y
+++ b/usr.bin/colldef/parse.y
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: parse.y,v 1.10 1997/06/30 11:24:18 charnier Exp $
+ * $Id: parse.y,v 1.9 1997/06/26 11:25:17 charnier Exp $
*/
#include <err.h>
@@ -40,8 +40,6 @@
extern int line_no;
extern FILE *yyin;
void yyerror(char *fmt, ...);
-int yyparse(void);
-int yylex(void);
static void usage __P((void));
char map_name[FILENAME_MAX] = ".";
@@ -210,7 +208,6 @@ sec_sub_item : CHAR {
}
;
%%
-int
main(ac, av)
char **av;
{
@@ -271,7 +268,6 @@ void yyerror(char *fmt, ...)
}
#ifdef COLLATE_DEBUG
-void
collate_print_tables()
{
int i;
diff --git a/usr.bin/colrm/Makefile b/usr.bin/colrm/Makefile
index 7413d42562eb..b9c8341100a6 100644
--- a/usr.bin/colrm/Makefile
+++ b/usr.bin/colrm/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= colrm
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 2c9e0e496e6e..1195300a8d29 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -30,17 +30,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: colrm.c,v 1.5 1997/12/29 00:08:59 alex Exp $
+ * $Id: colrm.c,v 1.4 1997/06/30 11:05:42 charnier Exp $
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile
index 33de9f61fe7e..1c304e2b3927 100644
--- a/usr.bin/column/Makefile
+++ b/usr.bin/column/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= column
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index 043ab9df2483..cf8c7a92f5e0 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/types.h>
@@ -79,7 +79,7 @@ main(argc, argv)
char *p;
if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) {
- if ((p = getenv("COLUMNS")))
+ if (p = getenv("COLUMNS"))
termwidth = atoi(p);
} else
termwidth = win.ws_col;
@@ -109,7 +109,7 @@ main(argc, argv)
if (!*argv)
input(stdin);
else for (; *argv; ++argv)
- if ((fp = fopen(*argv, "r"))) {
+ if (fp = fopen(*argv, "r")) {
input(fp);
(void)fclose(fp);
} else {
@@ -150,7 +150,7 @@ c_columnate()
endcol = maxlength;
putchar('\n');
} else {
- while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
+ while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -178,7 +178,7 @@ r_columnate()
chcnt += printf("%s", list[base]);
if ((base += numrows) >= entries)
break;
- while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
+ while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -218,7 +218,7 @@ maketbl()
cols = emalloc((maxcols = DEFCOLS) * sizeof(char *));
lens = emalloc(maxcols * sizeof(int));
for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
- for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator));
+ for (coloff = 0, p = *lp; cols[coloff] = strtok(p, separator);
p = NULL)
if (++coloff == maxcols) {
if (!(cols = realloc(cols, (u_int)maxcols +
diff --git a/usr.bin/comm/Makefile b/usr.bin/comm/Makefile
index d311527dfd3a..694202339b32 100644
--- a/usr.bin/comm/Makefile
+++ b/usr.bin/comm/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= comm
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/comm/comm.c b/usr.bin/comm/comm.c
index 70e7c0d01616..debbb0b6f6d0 100644
--- a/usr.bin/comm/comm.c
+++ b/usr.bin/comm/comm.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)comm.c 8.4 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: comm.c,v 1.4 1997/09/07 15:09:17 joerg Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
@@ -69,7 +69,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- int comp, file1done = 0, file2done = 0, read1, read2;
+ int comp, file1done, file2done, read1, read2;
int ch, flag1, flag2, flag3, iflag;
FILE *fp1, *fp2;
char *col1, *col2, *col3;
diff --git a/usr.bin/compile_et/compile_et.c b/usr.bin/compile_et/compile_et.c
index 92fd0c2c1132..055a9b6e611f 100644
--- a/usr.bin/compile_et/compile_et.c
+++ b/usr.bin/compile_et/compile_et.c
@@ -26,7 +26,7 @@ static const char copyright[] =
"Copyright 1987,1988 by MIT Student Information Processing Board";
static const char rcsid_compile_et_c[] =
- "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.5 1998/12/15 12:20:27 des Exp $";
+ "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.3 1996/07/12 19:05:17 jkh Exp $";
#endif
extern char *gensym();
@@ -73,13 +73,19 @@ static const char *const language_names[] = {
0,
};
-static const char * const noargs_def[] = {
+static const char * const c_src_prolog[] = {
+ "static const char * const text[] = {\n",
+ 0,
+};
+
+static const char * const krc_src_prolog[] = {
"#ifdef __STDC__\n",
"#define NOARGS void\n",
"#else\n",
"#define NOARGS\n",
"#define const\n",
"#endif\n\n",
+ "static const char * const text[] = {\n",
0,
};
@@ -215,12 +221,14 @@ int main (argc, argv) int argc; char **argv; {
fprintf (cfile, warning, c_file);
/* prologue */
- for (cpp = noargs_def; *cpp; cpp++) {
- fputs (*cpp, cfile);
- fputs (*cpp, hfile);
- }
-
- fputs("static const char * const text[] = {\n", cfile);
+ if (language == lang_C)
+ cpp = c_src_prolog;
+ else if (language == lang_KRC)
+ cpp = krc_src_prolog;
+ else
+ abort ();
+ while (*cpp)
+ fputs (*cpp++, cfile);
/* parse it */
yyparse();
@@ -234,8 +242,8 @@ int main (argc, argv) int argc; char **argv; {
table_number, current);
fputs("static struct et_list link = { 0, 0 };\n\n",
cfile);
- fprintf(cfile, "void initialize_%s_error_table (NOARGS) {\n",
- table_name);
+ fprintf(cfile, "void initialize_%s_error_table (%s) {\n",
+ table_name, (language == lang_C) ? "void" : "NOARGS");
fputs(" if (!link.table) {\n", cfile);
fputs(" link.next = _et_list;\n", cfile);
fputs(" link.table = &et;\n", cfile);
@@ -244,7 +252,7 @@ int main (argc, argv) int argc; char **argv; {
fputs("}\n", cfile);
fclose(cfile);
- fprintf (hfile, "extern void initialize_%s_error_table (NOARGS);\n",
+ fprintf (hfile, "extern void initialize_%s_error_table ();\n",
table_name);
fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%dL)\n",
table_name, table_number);
diff --git a/usr.bin/compress/Makefile b/usr.bin/compress/Makefile
index 02f7fbbd8810..0f6f5ddab9ce 100644
--- a/usr.bin/compress/Makefile
+++ b/usr.bin/compress/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/17/94
PROG= compress
-CFLAGS+=-Wall
SRCS= compress.c zopen.c
LINKS= ${BINDIR}/compress ${BINDIR}/uncompress
MLINKS= compress.1 uncompress.1
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c
index e81963527cbd..32d94960eb9d 100644
--- a/usr.bin/compress/compress.c
+++ b/usr.bin/compress/compress.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
+static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
#endif /* not lint */
#include <sys/param.h>
@@ -80,7 +80,6 @@ main(argc, argv)
int bits, cat, ch;
char *p, newname[MAXPATHLEN];
- cat = 0;
if ((p = rindex(argv[0], '/')) == NULL)
p = argv[0];
else
@@ -89,13 +88,10 @@ main(argc, argv)
style = DECOMPRESS;
else if (!strcmp(p, "compress"))
style = COMPRESS;
- else if (!strcmp(p, "zcat")) {
- cat = 1;
- style = DECOMPRESS;
- } else
+ else
errx(1, "unknown program name");
- bits = 0;
+ bits = cat = 0;
while ((ch = getopt(argc, argv, "b:cdfv")) != -1)
switch(ch) {
case 'b':
diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c
index abe31f2de63f..5e5357b74b9e 100644
--- a/usr.bin/compress/zopen.c
+++ b/usr.bin/compress/zopen.c
@@ -388,7 +388,7 @@ output(zs, ocode)
* Since ocode is always >= 8 bits, only need to mask the first
* hunk on the left.
*/
- *bp = (*bp & rmask[r_off]) | ((ocode << r_off) & lmask[r_off]);
+ *bp = (*bp & rmask[r_off]) | (ocode << r_off) & lmask[r_off];
bp++;
bits -= (8 - r_off);
ocode >>= 8 - r_off;
@@ -698,7 +698,7 @@ zopen(fname, mode, bits)
{
struct s_zstate *zs;
- if ((mode[0] != 'r' && mode[0] != 'w') || mode[1] != '\0' ||
+ if (mode[0] != 'r' && mode[0] != 'w' || mode[1] != '\0' ||
bits < 0 || bits > BITS) {
errno = EINVAL;
return (NULL);
@@ -738,5 +738,4 @@ zopen(fname, mode, bits)
return (funopen(zs, NULL, zwrite, NULL, zclose));
}
/* NOTREACHED */
- return (NULL);
}
diff --git a/usr.bin/ctags/Makefile b/usr.bin/ctags/Makefile
index db595aa38b74..7a8ebce3971c 100644
--- a/usr.bin/ctags/Makefile
+++ b/usr.bin/ctags/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= ctags
-CFLAGS+=-Wall
CFLAGS+=-I${.CURDIR}
SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c
diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c
index dc44ba67ad4b..421d819fe311 100644
--- a/usr.bin/ctags/ctags.c
+++ b/usr.bin/ctags/ctags.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1987, 1993, 1994, 1995\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95";
+static char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c
index d4b2723fe239..0706b49a0070 100644
--- a/usr.bin/ctags/fortran.c
+++ b/usr.bin/ctags/fortran.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)fortran.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)fortran.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/ctags/lisp.c b/usr.bin/ctags/lisp.c
index f86e218f44f2..5f99984b906e 100644
--- a/usr.bin/ctags/lisp.c
+++ b/usr.bin/ctags/lisp.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c
index 65d6737fc2da..bebdeb1bc90b 100644
--- a/usr.bin/ctags/print.c
+++ b/usr.bin/ctags/print.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <limits.h>
diff --git a/usr.bin/ctags/tree.c b/usr.bin/ctags/tree.c
index 8e1ec22dd1b0..61decd23048c 100644
--- a/usr.bin/ctags/tree.c
+++ b/usr.bin/ctags/tree.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)tree.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)tree.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c
index 7a27a6e47a68..1ed4c7d31038 100644
--- a/usr.bin/ctags/yacc.c
+++ b/usr.bin/ctags/yacc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/cut/Makefile b/usr.bin/cut/Makefile
index a3467c80ea78..19b01009cede 100644
--- a/usr.bin/cut/Makefile
+++ b/usr.bin/cut/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cut
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index 168e7b626d4e..cc57685ead21 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
#endif /* not lint */
#include <ctype.h>
@@ -70,7 +70,7 @@ main(argc, argv)
char *argv[];
{
FILE *fp;
- void (*fcn) __P((FILE *, char *)) = NULL;
+ void (*fcn) __P((FILE *, char *));
int ch;
dchar = '\t'; /* default delimiter is \t */
@@ -139,7 +139,7 @@ get_list(list)
* overlapping lists. We also handle "-3-5" although there's no
* real reason too.
*/
- for (; (p = strtok(list, ", \t")); list = NULL) {
+ for (; p = strtok(list, ", \t"); list = NULL) {
setautostart = start = stop = 0;
if (*p == '-') {
++p;
@@ -186,7 +186,7 @@ c_cut(fp, fname)
FILE *fp;
char *fname;
{
- register int ch = 0, col;
+ register int ch, col;
register char *pos;
for (;;) {
diff --git a/usr.bin/dirname/Makefile b/usr.bin/dirname/Makefile
index 0350db6690b9..76b4089abb80 100644
--- a/usr.bin/dirname/Makefile
+++ b/usr.bin/dirname/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= dirname
-CFLAGS+=-Wall
NOMAN= noman
.include <bsd.prog.mk>
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 056dc510737a..c6ca32682b55 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)dirname.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)dirname.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <stdio.h>
diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c
index c9a06b29957f..7bcc539f2691 100644
--- a/usr.bin/doscmd/port.c
+++ b/usr.bin/doscmd/port.c
@@ -29,7 +29,7 @@
*
* BSDI port.c,v 2.2 1996/04/08 19:33:03 bostic Exp
*
- * $Id: port.c,v 1.1 1997/08/09 01:42:54 dyson Exp $
+ * $Id: port.c,v 1.2 1996/09/22 05:53:08 miff Exp $
*/
#include "doscmd.h"
@@ -59,30 +59,15 @@ u_long ioports[MAXPORT/32];
static void
iomap(int port, int cnt)
{
- if (port + cnt >= MAXPORT) {
- errno = ERANGE;
- goto bad;
- }
- if (i386_set_ioperm(port, cnt, 1) < 0) {
- bad:
- perror("iomap");
- quit(1);
- }
+ fatal("iomap not supported");
}
static void
iounmap(int port, int cnt)
{
- if (port + cnt >= MAXPORT) {
- errno = ERANGE;
- goto bad;
- }
- if (i386_set_ioperm(port, cnt, 0) < 0) {
- bad:
- perror("iounmap");
- quit(1);
- }
+ fatal("iomap not supported");
}
+
#else
static void
iomap(int port, int cnt)
diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile
index 0911b8fc9e6d..3b5f1358d5a2 100644
--- a/usr.bin/du/Makefile
+++ b/usr.bin/du/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= du
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index ee19f4588d11..041c1a619b42 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
#endif /* not lint */
@@ -112,7 +112,7 @@ main(argc, argv)
errno = 0;
depth = atoi(optarg);
if (errno == ERANGE || depth < 0) {
- (void) fprintf(stderr, "Invalid argument to option d: %s\n", optarg);
+ (void) fprintf(stderr, "Invalid argument to option d: %s", optarg);
usage();
}
break;
@@ -120,6 +120,7 @@ main(argc, argv)
cflag = 1;
break;
case '?':
+ case 'h':
default:
usage();
}
@@ -262,6 +263,6 @@ static void
usage()
{
(void)fprintf(stderr,
- "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-k] [-x] [file ...]\n");
+ "usage: du [-H | -L | -P] [-a | -s | -d depth] [-k] [-x] [file ...]\n");
exit(1);
}
diff --git a/usr.bin/ee/Makefile b/usr.bin/ee/Makefile
index 859d53b92d7a..08488471f6ad 100644
--- a/usr.bin/ee/Makefile
+++ b/usr.bin/ee/Makefile
@@ -2,7 +2,6 @@ CFLAGS+= -DCAP -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \
-DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR
PROG= ee
-CFLAGS+=-Wall
LINKS= ${BINDIR}/ee ${BINDIR}/ree
MLINKS= ee.1 ree.1
DPADD= ${LIBNCURSES} ${LIBMYTINFO}
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c
index bb38c7007d16..485afeab73b3 100644
--- a/usr.bin/ee/ee.c
+++ b/usr.bin/ee/ee.c
@@ -52,7 +52,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: ee.c,v 1.11 1998/10/01 21:18:18 obrien Exp $";
+ "$Id: ee.c,v 1.10 1998/04/30 12:49:11 ache Exp $";
#endif /* not lint */
char *ee_copyright_message =
@@ -64,7 +64,7 @@ char *ee_long_notice[] = {
"copyright. All rights are reserved."
};
-char *version = "@(#) ee, version 1.3 $Revision: 1.11 $";
+char *version = "@(#) ee, version 1.3 $Revision: 1.10 $";
#ifdef NCURSE
#include "new_curse.h"
@@ -1897,7 +1897,7 @@ char *cmd_str;
int number;
int i;
char *ptr;
- char *direction = NULL;
+ char *direction;
struct text *t_line;
ptr = cmd_str;
@@ -1968,7 +1968,7 @@ char *arguments[];
{
char *buff;
int count;
- struct files *temp_names = NULL;
+ struct files *temp_names;
char *name;
char *ptr;
@@ -3192,7 +3192,7 @@ struct menu_entries menu_list[];
int counter;
int length;
int input;
- int temp = 0;
+ int temp;
int list_size;
int top_offset; /* offset from top where menu items start */
int vert_pos; /* vertical position */
diff --git a/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg b/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
index 10c3255c5dfb..47c9f665b835 100644
--- a/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
+++ b/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
@@ -3,7 +3,7 @@ $ ee.i18n.guide for more information
$
$ For ee patchlevel 3
$
-$ $Id: ee.msg,v 1.7 1998/01/12 07:53:05 charnier Exp $
+$ $Id: ee.msg,v 1.6 1997/02/22 19:54:54 peter Exp $
$
$set 1
$quote "
@@ -173,7 +173,7 @@ $quote "
164 "sauvegarde configuration de l'éditeur"
165 "sauvegarde configuration de ee"
166 "sauvegarde dans le répertoire courant"
-167 "sauvegarde dans le répertoire d'accueil"
+167 "sauvegarde dans le répertoire d'acceuil"
168 "configuration de ee non sauvée"
169 "nom de fichier manquant pour ree"
170 "appuyez sur échap. pour annuler"
diff --git a/usr.bin/enigma/Makefile b/usr.bin/enigma/Makefile
deleted file mode 100644
index 6936b7e7feb1..000000000000
--- a/usr.bin/enigma/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG= enigma
-CFLAGS+=-Wall
-MAN1= enigma.1
-
-LINKS= ${BINDIR}/enigma ${BINDIR}/crypt
-MLINKS= enigma.1 crypt.1
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/enigma/enigma.1 b/usr.bin/enigma/enigma.1
deleted file mode 100644
index a8d05f34c1cb..000000000000
--- a/usr.bin/enigma/enigma.1
+++ /dev/null
@@ -1,115 +0,0 @@
-.\"
-.\" enigma (aka. crypt) man page written by Joerg Wunsch.
-.\"
-.\" Since enigma itself is distributed in the Public Domain, this file
-.\" is also.
-.\"
-.\" $Id$
-.\" "
-.Dd October 30, 1998
-.Os
-.Dt enigma 1
-.Sh NAME
-.Nm enigma
-.Nd very simple file encryption
-.Sh SYNOPSIS
-.Nm
-.Op Fl s
-.Op Fl k
-.Op Ar password
-.Nm crypt
-.Op Fl s
-.Op Fl k
-.Op Ar password
-.Sh DESCRIPTION
-.Nm Enigma ,
-also known as
-.Nm crypt
-is a
-.Em very
-simple encryption program, working on a
-.Dq secret-key
-basis. It operates as a filter, i. e. it encrypts or decrypts a
-stream of data from standard input, and writes the result to standard
-output. It automatically detects whether the input data stream is
-already encrypted, and switches into decryption mode in this case.
-.Pp
-There are several ways to provide the secret key to the program. By
-default, the program prompts the user on the controlling terminal for
-the key, using
-.Xr getpass 3 .
-This is the only safe way of providing it.
-.Pp
-Alternatively, the key can be provided as the sole command-line
-argument
-.Ar password
-when starting the program. Obviously, this way the key can easily be
-spotted by other users running
-.Xr ps 1 .
-As yet another alternative,
-.Nm
-can be given the option
-.Fl k ,
-and it will take the key from the environment variable
-.Ev CrYpTkEy .
-While this at a first glance seems to be more secure than the previous
-option, it actually isn't since environment variables can also be
-examined with
-.Xr ps 1 .
-Thus this option is mainly provided for compatibility with other
-implementations of
-.Nm enigma .
-.Pp
-When specifying the option
-.Fl s ,
-.Nm
-modifies the encryption engine in a way that is supposed to make it a
-little more secure, but incompatible with other implementations.
-.Pp
-.Ss Warning
-The cryptographic value of
-.Nm
-is rather small. This program is only provided here for compatibility
-with other operating systems that also provide an implementation. For
-real encryption, refer to
-.Xr bdes 1
-(from the DES distribution package), or
-.Xr pgp 1
-(from the ports collection). Hoewever, restrictions for exporting,
-importing or using such tools might exist in some countries, so those
-stronger programs are not being shipped as part of the operating
-system by default.
-.Sh ENVIRONMENT
-.Bl -tag -offset indent -width "XXCrYpTkEy"
-.It Ev CrYpTkEy
-used to obtain the secret key when option
-.Fl k
-has been given
-.El
-.Sh EXAMPLES
-.Bd -literal -offset indent
-man enigma | enigma > encrypted
-Enter key: (XXX \(em key not echoed)
-.Ed
-.Pp
-This will create an encrypted form of this man page, and store it in
-the file
-.Ql encrypted .
-.Bd -literal -offset indent
-enigma XXX < encrypted
-.Ed
-.Pp
-This displays the previously created file on the terminal.
-.Sh SEE ALSO
-.Xr bdes 1 ,
-.Xr pgp 1 ,
-.Xr ps 1 ,
-.Xr getpass 3
-.Sh HISTORY
-Implementations of
-.Nm crypt
-are very common among
-.Ux
-operating systems. This implementation has been taken from the
-.Em Cryptbreakers Workbench
-which is in the public domain.
diff --git a/usr.bin/enigma/enigma.c b/usr.bin/enigma/enigma.c
deleted file mode 100644
index 3b1560c3b5f9..000000000000
--- a/usr.bin/enigma/enigma.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * "enigma.c" is in file cbw.tar from
- * anonymous FTP host watmsg.waterloo.edu: pub/crypt/cbw.tar.Z
- *
- * A one-rotor machine designed along the lines of Enigma
- * but considerably trivialized.
- *
- * A public-domain replacement for the UNIX "crypt" command.
- *
- * Upgraded to function properly on 64-bit machines.
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define MINUSKVAR "CrYpTkEy"
-
-#define ECHO 010
-#define ROTORSZ 256
-#define MASK 0377
-char t1[ROTORSZ];
-char t2[ROTORSZ];
-char t3[ROTORSZ];
-char deck[ROTORSZ];
-char buf[13];
-
-void shuffle(char *);
-
-void
-setup(pw)
- char *pw;
-{
- int ic, i, k, temp, pf[2], pid;
- unsigned random;
- long seed;
-
- strncpy(buf, pw, 8);
- while (*pw)
- *pw++ = '\0';
- buf[8] = buf[0];
- buf[9] = buf[1];
- pipe(pf);
- if ((pid=fork())==0) {
- close(0);
- close(1);
- dup(pf[0]);
- dup(pf[1]);
- execlp("makekey", "-", 0);
- execl("/usr/libexec/makekey", "-", 0); /* BSDI */
- execl("/usr/lib/makekey", "-", 0);
- execl("/usr/bin/makekey", "-", 0); /* IBM */
- execl("/lib/makekey", "-", 0);
- perror("makekey");
- fprintf(stderr, "enigma: cannot execute 'makekey', aborting\n");
- exit(1);
- }
- write(pf[1], buf, 10);
- close(pf[1]);
- i=wait((int *)NULL);
- if (i<0) perror("enigma: wait");
- if (i!=pid) {
- fprintf(stderr, "enigma: expected pid %d, got pid %d\n", pid, i);
- exit(1);
- }
- if ((i=read(pf[0], buf, 13)) != 13) {
- fprintf(stderr, "enigma: cannot generate key, read %d\n",i);
- exit(1);
- }
- seed = 123;
- for (i=0; i<13; i++)
- seed = seed*buf[i] + i;
- for(i=0;i<ROTORSZ;i++) {
- t1[i] = i;
- deck[i] = i;
- }
- for(i=0;i<ROTORSZ;i++) {
- seed = 5*seed + buf[i%13];
- if( sizeof(long) > 4 ) {
- /* Force seed to stay in 32-bit signed math */
- if( seed & 0x80000000 )
- seed = seed | (-1L & ~0xFFFFFFFFL);
- else
- seed &= 0x7FFFFFFF;
- }
- random = seed % 65521;
- k = ROTORSZ-1 - i;
- ic = (random&MASK)%(k+1);
- random >>= 8;
- temp = t1[k];
- t1[k] = t1[ic];
- t1[ic] = temp;
- if(t3[k]!=0) continue;
- ic = (random&MASK) % k;
- while(t3[ic]!=0) ic = (ic+1) % k;
- t3[k] = ic;
- t3[ic] = k;
- }
- for(i=0;i<ROTORSZ;i++)
- t2[t1[i]&MASK] = i;
-}
-
-int
-main(argc, argv)
- char *argv[];
-{
- register int i, n1, n2, nr1, nr2;
- int secureflg = 0, kflag = 0;
- char *cp;
-
- if (argc > 1 && argv[1][0] == '-') {
- if (argv[1][1] == 's') {
- argc--;
- argv++;
- secureflg = 1;
- } else if (argv[1][1] == 'k') {
- argc--;
- argv++;
- kflag = 1;
- }
- }
- if (kflag) {
- if ((cp = getenv(MINUSKVAR)) == NULL) {
- fprintf(stderr, "%s not set\n", MINUSKVAR);
- exit(1);
- }
- setup(cp);
- } else if (argc != 2) {
- setup(getpass("Enter key:"));
- }
- else
- setup(argv[1]);
- n1 = 0;
- n2 = 0;
- nr2 = 0;
-
- while((i=getchar()) != -1) {
- if (secureflg) {
- nr1 = deck[n1]&MASK;
- nr2 = deck[nr1]&MASK;
- } else {
- nr1 = n1;
- }
- i = t2[(t3[(t1[(i+nr1)&MASK]+nr2)&MASK]-nr2)&MASK]-nr1;
- putchar(i);
- n1++;
- if(n1==ROTORSZ) {
- n1 = 0;
- n2++;
- if(n2==ROTORSZ) n2 = 0;
- if (secureflg) {
- shuffle(deck);
- } else {
- nr2 = n2;
- }
- }
- }
-
- return 0;
-}
-
-void
-shuffle(deck)
- char deck[];
-{
- int i, ic, k, temp;
- unsigned random;
- static long seed = 123;
-
- for(i=0;i<ROTORSZ;i++) {
- seed = 5*seed + buf[i%13];
- random = seed % 65521;
- k = ROTORSZ-1 - i;
- ic = (random&MASK)%(k+1);
- temp = deck[k];
- deck[k] = deck[ic];
- deck[ic] = temp;
- }
-}
diff --git a/usr.bin/env/Makefile b/usr.bin/env/Makefile
index fadfd080aa69..6b67b73111b8 100644
--- a/usr.bin/env/Makefile
+++ b/usr.bin/env/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= env
-CFLAGS+=-Wall
NOMAN= noman
.include <bsd.prog.mk>
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index a5083fbc681e..8894dd070b6d 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/error/Makefile b/usr.bin/error/Makefile
index 3bd5adf89b6b..4ec0ba0473e5 100644
--- a/usr.bin/error/Makefile
+++ b/usr.bin/error/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= error
-CFLAGS+=-Wall
SRCS= main.c input.c pi.c subr.c filter.c touch.c
.include <bsd.prog.mk>
diff --git a/usr.bin/error/pi.c b/usr.bin/error/pi.c
index c5c1ffb9145c..5984bcabe4c8 100644
--- a/usr.bin/error/pi.c
+++ b/usr.bin/error/pi.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)pi.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: pi.c,v 1.3 1997/11/03 07:44:15 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <ctype.h>
@@ -208,7 +208,7 @@ extern char **wordv;
Errorclass pi()
{
- char **nwordv = NULL;
+ char **nwordv;
if (wordc < 2)
return (C_UNKNOWN);
diff --git a/usr.bin/error/touch.c b/usr.bin/error/touch.c
index 08952f7b593d..cef09fddcaf7 100644
--- a/usr.bin/error/touch.c
+++ b/usr.bin/error/touch.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: touch.c,v 1.5 1998/02/25 02:24:04 bde Exp $";
+ "$Id: touch.c,v 1.4 1997/11/03 07:44:25 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -512,7 +512,7 @@ execvarg(n_pissed_on, r_argc, r_argv)
char ***r_argv;
{
Eptr p;
- char *sep = NULL;
+ char *sep;
int fi;
(*r_argv) = (char **)Calloc(n_pissed_on + 3, sizeof(char *));
diff --git a/usr.bin/expand/Makefile b/usr.bin/expand/Makefile
index 8e1369c98dbd..751df256add6 100644
--- a/usr.bin/expand/Makefile
+++ b/usr.bin/expand/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/9/93
PROG= expand
-CFLAGS+=-Wall
MLINKS= expand.1 unexpand.1
.include <bsd.prog.mk>
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index a8014f9a44a2..37c946446173 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)expand.c 8.1 (Berkeley) 6/9/93";
#else
static const char rcsid[] =
- "$Id: expand.c,v 1.3 1998/02/02 07:10:59 cwt Exp $";
+ "$Id: expand.c,v 1.2 1997/07/01 06:34:31 charnier Exp $";
#endif
#endif /* not lint */
diff --git a/usr.bin/f2c/f2c.h b/usr.bin/f2c/f2c.h
index 61f72aff4461..6514cd913e87 100644
--- a/usr.bin/f2c/f2c.h
+++ b/usr.bin/f2c/f2c.h
@@ -7,15 +7,15 @@
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
-typedef int integer;
-typedef unsigned int uinteger;
+typedef long int integer;
+typedef unsigned long uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
-typedef int logical;
+typedef long int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
@@ -42,9 +42,9 @@ typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
-typedef int flag;
-typedef int ftnlen;
-typedef int ftnint;
+typedef long int flag;
+typedef long int ftnlen;
+typedef long int ftnint;
#endif
/*external read, write*/
diff --git a/usr.bin/f2c/proc.c b/usr.bin/f2c/proc.c
index e3afb81ef5fd..2273e24951a4 100644
--- a/usr.bin/f2c/proc.c
+++ b/usr.bin/f2c/proc.c
@@ -920,8 +920,8 @@ dim_check(Namep q)
else if (!ONEOF(nelt->headblock.vtype, MSKINT|MSKREAL))
bad_dimtype(q);
else if (ISINT(nelt->headblock.vtype)
- ? nelt->constblock.Const.ci <= 0
- : nelt->constblock.Const.cd[0] <= 0.)
+ && nelt->constblock.Const.ci <= 0
+ || nelt->constblock.Const.cd[0] <= 0)
dclerr("nonpositive dimension", q);
}
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index f3be659841fa..20be53dd2f69 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -1,20 +1,19 @@
-.\" $Id: fetch.1,v 1.26 1998/12/08 13:00:48 cracauer Exp $
-.Dd January 15, 1999
+.\" $Id: fetch.1,v 1.23 1998/05/09 21:39:49 wollman Exp $
+.Dd July 2, 1996
.Dt FETCH 1
-.Os FreeBSD 3.1
+.Os FreeBSD 2.2
.Sh NAME
.Nm fetch
.Nd retrieve a file by Uniform Resource Locator
.Sh SYNOPSIS
.Nm fetch
-.Op Fl MPablmnpqrtv
+.Op Fl MPabmnpqr
.Op Fl S Ar size
-.Op Fl T Ar timeout
.Op Fl o Ar file
.Ar URL
.Op Ar ...
.Nm fetch
-.Op Fl MPRlmnpqrv
+.Op Fl MPRmnpqr
.Op Fl S Ar size
.Op Fl o Ar file
.Op Fl c Ar dir
@@ -103,7 +102,7 @@ under any circumstances, even if the transfer failed or was incomplete.
.It Fl r
Restart a previously interrupted transfer.
.It Fl S Ar bytes
-Require the file size reported by
+Require file size reported by
.Tn FTP
or
.Tn HTTP
@@ -115,9 +114,10 @@ This option is useful to prevent
.Nm fetch
from downloading a file that is either incomplete or the wrong version,
given the correct size of the file in advance.
-.It Fl s
-Ask server for size of file in bytes and print it to stdout. Do not
-actually fetch the file.
+.It Fl t
+Work around a different set of buggy
+.Tn TCP
+implementations.
.It Fl T Ar seconds
Set timeout value to
.Ar seconds.
@@ -126,10 +126,6 @@ Overrides the environment variables
for ftp transfers or
.Ev HTTP_TIMEOUT
for http transfers if set.
-.It Fl t
-Work around a different set of buggy
-.Tn TCP
-implementations.
.It Fl v
Increase verbosity. More
.Fl v Ns \&'s
@@ -316,16 +312,6 @@ connection.
.Sh SEE ALSO
.Xr ftp 1 ,
.Xr tftp 1
-.Rs
-.%A R. Fielding
-.%A J. Gettys
-.%A J. Mogul
-.%A H. Frystyk
-.%A T. Berners-Lee
-.%T "Hypertext Transfer Protocol \-\- HTTP/1.1"
-.%O RFC 2068
-.%D January 1997
-.Re
.Sh HISTORY
The
.Nm fetch
@@ -381,21 +367,3 @@ and
.Fl b
involves a minimum of two round trips (for small replies), one less than
other implementations.
-.Pp
-The
-.Tn HTTP
-standard requires interpretation of the
-.Tn RFC 850
-date format, which does not provide a century indication. Versions of
-.Nm fetch
-prior to
-.Fx 3.1
-would interpret all such dates as being in the 1900s. This version of
-.Nm fetch
-interprets such dates according to the rule given in
-.Tn RFC 2068 :
-.Bd -literal -offset indent
- o HTTP/1.1 clients and caches should assume that an RFC-850 date
- which appears to be more than 50 years in the future is in fact
- in the past (this helps solve the "year 2000" problem).
-.Ed
diff --git a/usr.bin/fetch/fetch.h b/usr.bin/fetch/fetch.h
index 685fdd673042..aac3fbcb34f7 100644
--- a/usr.bin/fetch/fetch.h
+++ b/usr.bin/fetch/fetch.h
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fetch.h,v 1.6 1998/09/20 00:01:26 jkh Exp $
+ * $Id: fetch.h,v 1.5 1997/08/05 20:18:38 ache Exp $
*/
#ifndef fetch_h
@@ -52,7 +52,6 @@ struct fetch_state {
int fs_linux_bug; /* -b option */
int fs_use_connect; /* -t option */
off_t fs_expectedsize; /* -S option */
- int fs_reportsize; /* -s option */
time_t fs_modtime;
void *fs_proto;
int (*fs_retrieve)(struct fetch_state *);
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c
index 45c8ecfc508a..6c6c71c10b74 100644
--- a/usr.bin/fetch/ftp.c
+++ b/usr.bin/fetch/ftp.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ftp.c,v 1.10 1998/09/20 00:01:26 jkh Exp $
+ * $Id: ftp.c,v 1.9 1997/10/08 18:43:53 fenner Exp $
*/
#include <sys/types.h>
@@ -375,20 +375,6 @@ ftp_retrieve(struct fetch_state *fs)
}
}
size = ftpGetSize(ftp, ftps->ftp_remote_file);
-
- if (fs->fs_reportsize) {
- fclose(ftp);
- if (size == -1) {
- warnx("%s: size not known\n", fs->fs_outputfile);
- printf("Unknown\n");
- return 1;
- }
- else {
- printf("%qd\n", (quad_t)size);
- return 0;
- }
- }
-
if (size > 0 && fs->fs_expectedsize != -1 && size != fs->fs_expectedsize) {
warnx("%s: size mismatch, expected=%lu / actual=%lu",
ftps->ftp_remote_path,
diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c
index 2f08c1d2be0f..ecade4ef19ea 100644
--- a/usr.bin/fetch/http.c
+++ b/usr.bin/fetch/http.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: http.c,v 1.23 1999/01/15 16:56:22 wollman Exp $
+ * $Id: http.c,v 1.19 1998/07/12 09:07:36 se Exp $
*/
#include <sys/types.h>
@@ -440,7 +440,6 @@ http_retrieve(struct fetch_state *fs)
char *base64ofmd5;
int to_stdout, restarting, redirection, retrying, autherror, chunked;
char rangebuf[sizeof("Range: bytes=18446744073709551616-\r\n")];
- int tried_head;
setup_http_auth();
@@ -449,7 +448,6 @@ http_retrieve(struct fetch_state *fs)
restarting = fs->fs_restart;
redirection = 0;
retrying = 0;
- tried_head = 0;
/*
* Figure out the timeout. Prefer the -T command-line value,
@@ -509,14 +507,7 @@ http_retrieve(struct fetch_state *fs)
} while(0)
retry:
- if (fs->fs_reportsize && !tried_head) {
- addstr(iov, n, "HEAD ");
- tried_head = 1;
- }
- else {
- addstr(iov, n, "GET ");
- tried_head = 0;
- }
+ addstr(iov, n, "GET ");
addstr(iov, n, https->http_remote_request);
addstr(iov, n, " HTTP/1.1\r\n");
/*
@@ -747,16 +738,6 @@ got100reply:
else
autherror = 407;
break;
- case 501: /* Not Implemented */
- /* If we tried HEAD, retry with GET */
- if (tried_head) {
- n = 0;
- goto retry;
- }
- else {
- errstr = safe_strdup(line);
- break;
- }
case 503: /* Service Unavailable */
if (!fs->fs_auto_retry)
errstr = safe_strdup(line);
@@ -964,23 +945,6 @@ spewerror:
fs->fs_status = "retrieving file from HTTP/1.x server";
- if (fs->fs_reportsize) {
- if (total_length == -1) {
- warnx("%s: size not known\n",
- fs->fs_outputfile);
- printf("Unknown\n");
- status = 1;
- }
- else {
- printf("%qd\n", (quad_t)total_length);
- status = 0;
- }
- fclose(remote);
- unsetup_sigalrm();
- return status;
- }
-
-
/*
* OK, if we got here, then we have finished parsing the header
* and have read the `\r\n' line which denotes the end of same.
@@ -1072,29 +1036,18 @@ http_suck(struct fetch_state *fs, FILE *remote, FILE *local,
{
static char buf[BUFFER_SIZE];
ssize_t readresult, writeresult;
- off_t remain = total_length;
-
- if (total_length == -1)
- remain = 1; /*XXX*/
do {
alarm(timo);
readresult = fread(buf, 1, sizeof buf, remote);
alarm(0);
- /*
- * If know the content-length, ignore anything more the
- * the server chooses to send us.
- */
- if (total_length != -1 && ((remain -= readresult) < 0))
- readresult += remain;
-
if (readresult == 0)
return 0;
display(fs, total_length, readresult);
writeresult = fwrite(buf, 1, readresult, local);
- } while (writeresult == readresult && remain > 0);
+ } while (writeresult == readresult);
return 0;
}
@@ -1394,14 +1347,6 @@ parse_http_date(char *string)
tm.tm_year = i - 1900;
} else {
/* Monday, 27-Jan-97 14:31:09 stuffwedon'tcareabout */
- /* Quoth RFC 2068:
- o HTTP/1.1 clients and caches should assume that an RFC-850 date
- which appears to be more than 50 years in the future is in fact
- in the past (this helps solve the "year 2000" problem).
- */
- time_t now;
- struct tm *tmnow;
- int this2dyear;
char *comma = strchr(string, ',');
char mname[4];
@@ -1423,15 +1368,6 @@ parse_http_date(char *string)
if (i >= 12)
return -1;
tm.tm_mon = i;
- /*
- * RFC 2068 year interpretation.
- */
- time(&now);
- tmnow = gmtime(&now);
- this2dyear = tmnow->tm_year % 100;
- tm.tm_year += tmnow->tm_year - this2dyear;
- if (tm.tm_year - tmnow->tm_year >= 50)
- tm.tm_year -= 100;
}
#undef digit
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c
index 8b24dad4f5c1..6669ad03be37 100644
--- a/usr.bin/fetch/main.c
+++ b/usr.bin/fetch/main.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: main.c,v 1.48 1998/11/08 23:18:48 des Exp $ */
+/* $Id: main.c,v 1.46 1998/05/09 08:56:07 des Exp $ */
#include <sys/types.h>
@@ -52,7 +52,7 @@ static void
usage()
{
fprintf(stderr, "%s\n%s\n",
- "usage: fetch [-DHILMNPRTVablmnpqrstv] [-o outputfile] [-S bytes]",
+ "usage: fetch [-DHILMNPRTValmnpqrv] [-o outputfile] [-S bytes]",
" [-f file -h host [-c dir] | URL]");
exit(EX_USAGE);
}
@@ -71,13 +71,12 @@ main(int argc, char *const *argv)
init_schemes();
fs = clean_fetch_state;
fs.fs_verbose = 1;
- fs.fs_reportsize = 0;
fs.fs_expectedsize = -1;
change_to_dir = file_to_get = hostname = 0;
- while ((c = getopt(argc, argv, "abc:D:f:h:HIlLmMnNo:pPqRrS:stT:vV:")) != -1) {
+ while ((c = getopt(argc, argv, "abc:D:f:h:HilLmMnNo:pPqRrS:tT:vV:")) != -1) {
switch (c) {
- case 'D': case 'H': case 'I': case 'L': case 'N': case 'V':
+ case 'D': case 'H': case 'I': case 'N': case 'L': case 'V':
break; /* ncftp compatibility */
case 'a':
@@ -136,10 +135,6 @@ main(int argc, char *const *argv)
fs.fs_use_connect = 1;
break;
- case 's':
- fs.fs_reportsize = 1;
- break;
-
case 'S':
/* strtol sets errno to ERANGE in the case of overflow */
errno = 0;
diff --git a/usr.bin/file/Magdir/applix b/usr.bin/file/Magdir/applix
deleted file mode 100644
index 9d348d152450..000000000000
--- a/usr.bin/file/Magdir/applix
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#------------------------------------------------------------------------------
-# applix: file(1) magic for Applixware
-# From: Peter Soos <sp@osb.hu>
-#
-0 string *BEGIN Applixware
->7 string WORDS Words Document
->7 string GRAPHICS Graphic
->7 string RASTER Bitmap
->7 string SPREADSHEETS Spreadsheet
->7 string MACRO Macro
->7 string BUILDER Builder Object
diff --git a/usr.bin/file/Magdir/cisco b/usr.bin/file/Magdir/cisco
deleted file mode 100644
index 77e3efb5e39d..000000000000
--- a/usr.bin/file/Magdir/cisco
+++ /dev/null
@@ -1,10 +0,0 @@
-#------------------------------------------------------------------------------
-# cisco: file(1) magic for cisco Systems routers
-#
-# Most cisco file-formats are covered by the generic elf code
-#
-# Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
-0 belong&0xffffff00 0x85011400 cisco IOS microcode
->7 string >\0 for '%s'
-0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode
->7 string >\0 for '%s'
diff --git a/usr.bin/file/Magdir/flash b/usr.bin/file/Magdir/flash
deleted file mode 100644
index 1d6f7b766cd1..000000000000
--- a/usr.bin/file/Magdir/flash
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#------------------------------------------------------------------------------
-# flash: file(1) magic for Macromedia Flash file format
-#
-# See
-#
-# http://www.macromedia.com/software/flash/open/
-#
-0 string FWS Macromedia Flash data,
->3 byte x version %d
diff --git a/usr.bin/file/Magdir/gimp b/usr.bin/file/Magdir/gimp
deleted file mode 100644
index 286fa9c3448b..000000000000
--- a/usr.bin/file/Magdir/gimp
+++ /dev/null
@@ -1,32 +0,0 @@
-#------------------------------------------------------------------------------
-# GIMP Gradient: file(1) magic for the GIMP's gradient data files
-# by Federico Mena <federico@nuclecu.unam.mx>
-
-0 string GIMP\ Gradient GIMP gradient data
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the XCF image format used in the GIMP developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-0 string gimp\ xcf\ file GIMP XCF image data,
->14 belong x %ld x
->18 belong x %ld,
->22 belong 0 RGB Color
->22 belong 1 Greyscale
->22 belong 2 Indexed Color
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the patterns used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GPAT GIMP pattern data,
->24 string x %s
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the brushes used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GIMP GIMP brush data
diff --git a/usr.bin/file/Magdir/gnu b/usr.bin/file/Magdir/gnu
deleted file mode 100644
index 85af567020da..000000000000
--- a/usr.bin/file/Magdir/gnu
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# GNU nlsutils message catalog file format
-#
-0 string \336\22\4\225 GNU message catalog (little endian),
->4 lelong x revision %d,
->8 lelong x %d messages
-0 string \225\4\22\336 GNU message catalog (big endian),
->4 belong x revision %d,
->8 belong x %d messages
diff --git a/usr.bin/file/Magdir/lecter b/usr.bin/file/Magdir/lecter
deleted file mode 100644
index 87c186bab363..000000000000
--- a/usr.bin/file/Magdir/lecter
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# DEC SRC Virtual Paper: Lectern files
-# Karl M. Hegbloom <karlheg@inetarena.com>
-0 string lect DEC SRC Virtual Paper Lectern file
diff --git a/usr.bin/file/Magdir/macintosh b/usr.bin/file/Magdir/macintosh
deleted file mode 100644
index 81f8117bca11..000000000000
--- a/usr.bin/file/Magdir/macintosh
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#------------------------------------------------------------------------------
-# macintosh description
-#
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11 string must\ be\ converted\ with\ BinHex BinHex binary text
->41 string x \b, version %.3s
-
-# Stuffit archives are the de facto standard of compression for Macintosh
-# files obtained from most archives. (franklsm@tuns.ca)
-0 string SIT! StuffIt Archive (data)
->2 string x : %s
-65 string SIT! StuffIt Archive (rsrc + data)
->2 string x : %s
-0 string SITD StuffIt Deluxe (data)
->2 string x : %s
-65 string SITD StuffIt Deluxe (rsrc + data)
->2 string x : %s
-0 string Seg StuffIt Deluxe Segment (data)
->2 string x : %s
-65 string Seg StuffIt Deluxe Segment (rsrc + data)
->2 string x : %s
-
-# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
-0 string APPL Macintosh Application (data)
->2 string x : %s
-65 string APPL Macintosh Application (rsrc + data)
->2 string x : %s
-
-# Macintosh System files (franklsm@tuns.ca)
-0 string zsys Macintosh System File (data)
-65 string zsys Macintosh System File(rsrc + data)
-0 string FNDR Macintosh Finder (data)
-65 string FNDR Macintosh Finder(rsrc + data)
-0 string libr Macintosh Library (data)
->2 string x : %s
-65 string libr Macintosh Library(rsrc + data)
->2 string x : %s
-0 string shlb Macintosh Shared Library (data)
->2 string x : %s
-65 string shlb Macintosh Shared Library(rsrc + data)
->2 string x : %s
-0 string cdev Macintosh Control Panel (data)
->2 string x : %s
-65 string cdev Macintosh Control Panel(rsrc + data)
->2 string x : %s
-0 string INIT Macintosh Extension (data)
->2 string x : %s
-65 string INIT Macintosh Extension(rsrc + data)
->2 string x : %s
-0 string FFIL Macintosh Truetype Font (data)
->2 string x : %s
-65 string FFIL Macintosh Truetype Font(rsrc + data)
->2 string x : %s
-0 string LWFN Macintosh Postscript Font (data)
->2 string x : %s
-65 string LWFN Macintosh Postscript Font(rsrc + data)
->2 string x : %s
-
-# Additional Macintosh Files (franklsm@tuns.ca)
-
-0 string PACT Macintosh Compact Pro Archive (data)
->2 string x : %s
-65 string PACT Macintosh Compact Pro Archive(rsrc + data)
->2 string x : %s
-0 string ttro Macintosh TeachText File (data)
->2 string x : %s
-65 string ttro Macintosh TeachText File(rsrc + data)
->2 string x : %s
-0 string TEXT Macintosh TeachText File (data)
->2 string x : %s
-65 string TEXT Macintosh TeachText File(rsrc + data)
->2 string x : %s
-0 string PDF Macintosh PDF File (data)
->2 string x : %s
-65 string PDF Macintosh PDF File(rsrc + data)
->2 string x : %s
-
diff --git a/usr.bin/file/Magdir/mime b/usr.bin/file/Magdir/mime
deleted file mode 100644
index 0102709191a5..000000000000
--- a/usr.bin/file/Magdir/mime
+++ /dev/null
@@ -1,7 +0,0 @@
-#------------------------------------------------------------------------------
-# mime: file(1) magic for MIME encoded files
-#
-0 string Content-Type:\
->14 string >\0 %s
-0 string Content-Type:
->13 string >\0 %s
diff --git a/usr.bin/file/Magdir/modem b/usr.bin/file/Magdir/modem
deleted file mode 100644
index 73e747e161dc..000000000000
--- a/usr.bin/file/Magdir/modem
+++ /dev/null
@@ -1,33 +0,0 @@
-#------------------------------------------------------------------------------
-# modem: file(1) magic for modem programs
-#
-# From: Florian La Roche <florian@knorke.saar.de>
-4 string Research, Digifax-G3-File
->29 byte 1 , fine resolution
->29 byte 0 , normal resolution
-
-0 short 0x0100 raw G3 data, byte-padded
-0 short 0x1400 raw G3 data
-#
-# Magic data for vgetty voice formats
-# (Martin Seine & Marc Eberhard)
-
-#
-# raw modem data version 1
-#
-0 string RMD1 raw modem data
->4 string >\0 (%s /
->20 short >0 compression type 0x%04x)
-
-#
-# portable voice format 1
-#
-0 string PVF1\n portable voice format
->5 string >\0 (binary %s)
-
-#
-# portable voice format 2
-#
-0 string PVF2\n portable voice format
->5 string >\0 (ascii %s)
-
diff --git a/usr.bin/file/Magdir/ms-dos b/usr.bin/file/Magdir/ms-dos
index 54204acc0d50..db2c03edfe09 100644
--- a/usr.bin/file/Magdir/ms-dos
+++ b/usr.bin/file/Magdir/ms-dos
@@ -6,124 +6,10 @@
# .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
0 string @echo\ off MS-DOS batch file text
-# WinNT/WinCE PE files (Warner Losh, imp@village.org)
-#
-128 string PE\000\000 MS Windows PE
->132 leshort 0x0000 Unknown CPU
->132 leshort 0x14c Intel 386
->132 leshort 0x14d Intel 486
->132 leshort 0x14e Intel 586
->132 leshort 0x162 MIPS ISA I
->132 leshort 0x163 MIPS ISA II
->132 leshort 0x166 MIPS ISA III
->132 leshort 0x184 Digital Alpha
->132 leshort 0x1a2 Hitachi SH3
->132 leshort 0x1a6 Hitachi SH4
->132 leshort 0x1c0 ARM
->132 leshort 0x1f0 Power PC
->132 leshort 0x268 Motorola 68000 series
->132 leshort 0x290 PA-RISC
->148 leshort >27
->>220 leshort 0 unknown subsystem
->>220 leshort 1 native
->>220 leshort 2 GUI
->>220 leshort 3 console
->>220 leshort 7 POSIX
->150 leshort&0x2000 =0 executable
-#>>136 ledate x stamp %s,
->>150 leshort&0x0001 >0 not relocatable
-#>>150 leshort&0x0004 =0 with line numbers,
-#>>150 leshort&0x0008 =0 with local symbols,
-#>>150 leshort&0x0200 =0 with debug symbols,
->>150 leshort&0x1000 >0 system file
-#>>148 leshort >0
-#>>>154 byte x linker %d
-#>>>155 byte x \b.%d,
-#>>148 leshort >27
-#>>>192 leshort x requires OS %d
-#>>>194 leshort x \b.%d,
-#>>>196 leshort x user version %d
-#>>>198 leshort x \b.%d,
-#>>>200 leshort x subsystem version %d
-#>>>202 leshort x \b.%d,
->150 leshort&0x2000 >0 DLL
-#>>136 ledate x stamp %s,
->>150 leshort&0x0001 >0 not relocatable
-#>>150 leshort&0x0004 =0 with line numbers,
-#>>150 leshort&0x0008 =0 with local symbols,
-#>>150 leshort&0x0200 =0 with debug symbols,
->>150 leshort&0x1000 >0 system file
-#>>148 leshort >0
-#>>>154 byte x linker %d
-#>>>155 byte x \b.%d,
-#>>148 leshort >27
-#>>>192 leshort x requires OS %d
-#>>>194 leshort x \b.%d,
-#>>>196 leshort x user version %d
-#>>>198 leshort x \b.%d,
-#>>>200 leshort x subsystem version %d
-#>>>202 leshort x \b.%d,
-0 string PE\000\000 MS Windows PE (no DOS header)
->4 leshort 0x0000 Unknown CPU
->4 leshort 0x14c Intel 386
->4 leshort 0x14d Intel 486
->4 leshort 0x14e Intel 586
->4 leshort 0x162 MIPS ISA I
->4 leshort 0x163 MIPS ISA II
->4 leshort 0x166 MIPS ISA III
->4 leshort 0x184 Digital Alpha
->4 leshort 0x1a2 Hitachi SH3
->4 leshort 0x1a6 Hitachi SH4
->4 leshort 0x1c0 ARM
->4 leshort 0x1f0 Power PC
->4 leshort 0x268 Motorola 68000 series
->4 leshort 0x290 PA-RISC
-# It would appear that the debugger information is in basically the same
-# format as what binutils calls PEI files.
-0 string DI\000\000 Microsoft PE Debugger Information
->4 leshort 0x0000 Unknown CPU
->4 leshort 0x14c Intel 386
->4 leshort 0x14d Intel 486
->4 leshort 0x14e Intel 586
->4 leshort 0x162 MIPS ISA I
->4 leshort 0x163 MIPS ISA II
->4 leshort 0x166 MIPS ISA III
->4 leshort 0x184 Digital Alpha
->4 leshort 0x1a2 Hitachi SH3
->4 leshort 0x1a6 Hitachi SH4
->4 leshort 0x1c0 ARM
->4 leshort 0x1f0 Power PC
->4 leshort 0x268 Motorola 68000 series
->4 leshort 0x290 PA-RISC
-
-0 leshort 0x0000 MS Windows COFF Unknown CPU
-0 leshort 0x14c MS Windows COFF Intel 386
-0 leshort 0x14d MS Windows COFF Intel 486
-0 leshort 0x14e MS Windows COFF Intel 586
-0 leshort 0x162 MS Windows COFF MIPS ISA I
-0 leshort 0x163 MS Windows COFF MIPS ISA II
-0 leshort 0x166 MS Windows COFF MIPS ISA III
-0 leshort 0x184 MS Windows COFF Digital Alpha
-0 leshort 0x1a2 MS Windows COFF Hitachi SH3
-0 leshort 0x1a6 MS Windows COFF Hitachi SH4
-0 leshort 0x1c0 MS Windows COFF ARM
-0 leshort 0x1f0 MS Windows COFF Power PC
-0 leshort 0x268 MS Windows COFF Motorola 68000 series
-0 leshort 0x290 MS Windows COFF PA-RISC
-
# .EXE formats (Greg Roelofs, newt@uchicago.edu)
#
0 string MZ MS-DOS executable (EXE)
->24 string @ \b, OS/2 or MS Windows
->>0xe7 string LH/2\ Self-Extract \b, %s
->>0xe9 string PKSFX2 \b, %s
->0x1c string RJSX\xff\xff \b, ARJ SFX
->0x1c string diet\xf9\x9c \b, diet compressed
->0x1e string Copyright\ 1989-1990\ PKWARE\ Inc. \b, PKSFX
-# JM: 0x1e "PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved\7\0\0\0"
->0x1e string PKLITE\ Copr. \b, %.6s compressed
->0x24 string LHa's\ SFX \b, %.15s
->0x24 string LHA's\ SFX \b, %.15s
+>24 string @ \b, OS/2 or Windows
>1638 string -lh5- \b, LHa SFX archive v2.13S
>7195 string Rar! \b, RAR self-extracting archive
#
@@ -159,7 +45,6 @@
# but it isn't feasible to match all COM files since there must be at least
# two dozen different one-byte "magics".
#0 byte 0xe9 MS-DOS executable (COM)
-#>6 string SFX\ of\ LHarc (%s)
#0 byte 0x8c MS-DOS executable (COM)
# 0xeb conflicts with "sequent" magic
#0 byte 0xeb MS-DOS executable (COM)
@@ -170,39 +55,19 @@
#0 byte 0xf0 MS-DOS program library data
#
-#
-# Windows NT Registry files.
-#
-0 string regf Windows NT Registry file
-
# Popular applications
2080 string Microsoft\ Word\ 6.0\ Document %s
-2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
-2112 string MSWordDoc Microsoft Word document data
#
0 belong 0x31be0000 Microsoft Word Document
#
-0 string PO^Q` Microsoft Word 6.0 Document
-#
2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
#
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
-2114 string Biff5 Microsoft Excel 5.0 Worksheet
-#
0 belong 0x00001a00 Lotus 1-2-3
->4 belong 0x00100400 wk3 document data
->4 belong 0x02100400 wk4 document data
->4 belong 0x07800100 fm3 or fmb document data
->4 belong 0x07800000 fm3 or fmb document data
+>4 belong 0x00100400 wk3 document
+>4 belong 0x02100400 wk4 document
+>4 belong 0x07800100 fm3 or fmb document
+>4 belong 0x07800000 fm3 or fmb document
#
0 belong 0x00000200 Lotus 1-2-3
->4 belong 0x06040600 wk1 document data
->4 belong 0x06800200 fmt document data
-
-# WordPerfect documents - Trevor Johnson <trevor@jpj.net>
-#
-1 string WPC WordPerfect document
-
-# Help files
-0 string ?_\3\0 MS Windows Help Data
+>4 belong 0x06040600 wk1 document
+>4 belong 0x06800200 fmt document
diff --git a/usr.bin/file/Magdir/octave b/usr.bin/file/Magdir/octave
deleted file mode 100644
index 309314820e45..000000000000
--- a/usr.bin/file/Magdir/octave
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
-0 string Octave-1-L Octave binary data (little endian)
-0 string Octave-1-B Octave binary data (big endian)
diff --git a/usr.bin/file/Magdir/olf b/usr.bin/file/Magdir/olf
deleted file mode 100644
index e698c36a49ee..000000000000
--- a/usr.bin/file/Magdir/olf
+++ /dev/null
@@ -1,97 +0,0 @@
-
-#------------------------------------------------------------------------------
-# olf: file(1) magic for OLF executables
-#
-# We have to check the byte order flag to see what byte order all the
-# other stuff in the header is in.
-#
-# MIPS R3000 may also be for MIPS R2000.
-# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
-#
-# Created by Erik Theisen <etheisen@openbsd.org>
-# Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
-0 string \177OLF OLF
->4 byte 0 invalid class
->4 byte 1 32-bit
->4 byte 2 64-bit
->7 byte 0 invalid os
->7 byte 1 OpenBSD
->7 byte 2 NetBSD
->7 byte 3 FreeBSD
->7 byte 4 4.4BSD
->7 byte 5 Linux
->7 byte 6 SVR4
->7 byte 7 esix
->7 byte 8 Solaris
->7 byte 9 Irix
->7 byte 10 SCO
->7 byte 11 Dell
->7 byte 12 NCR
->5 byte 0 invalid byte order
->5 byte 1 LSB
->>16 leshort 0 no file type,
->>16 leshort 1 relocatable,
->>16 leshort 2 executable,
->>16 leshort 3 shared object,
-# Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
-# corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
->>16 leshort 4 core file
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) lelong >0 (signal %d),
->>16 leshort &0xff00 processor-specific,
->>18 leshort 0 no machine,
->>18 leshort 1 AT&T WE32100 - invalid byte order,
->>18 leshort 2 SPARC - invalid byte order,
->>18 leshort 3 Intel 80386,
->>18 leshort 4 Motorola 68000 - invalid byte order,
->>18 leshort 5 Motorola 88000 - invalid byte order,
->>18 leshort 6 Intel 80486,
->>18 leshort 7 Intel 80860,
->>18 leshort 8 MIPS R3000_BE - invalid byte order,
->>18 leshort 9 Amdahl - invalid byte order,
->>18 leshort 10 MIPS R3000_LE,
->>18 leshort 11 RS6000 - invalid byte order,
->>18 leshort 15 PA-RISC - invalid byte order,
->>18 leshort 16 nCUBE,
->>18 leshort 17 VPP500,
->>18 leshort 18 SPARC32PLUS,
->>18 leshort 20 PowerPC,
->>18 leshort 0x9026 Alpha,
->>20 lelong 0 invalid version
->>20 lelong 1 version 1
->>36 lelong 1 MathCoPro/FPU/MAU Required
->8 string >\0 (%s)
->5 byte 2 MSB
->>16 beshort 0 no file type,
->>16 beshort 1 relocatable,
->>16 beshort 2 executable,
->>16 beshort 3 shared object,
->>16 beshort 4 core file,
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) belong >0 (signal %d),
->>16 beshort &0xff00 processor-specific,
->>18 beshort 0 no machine,
->>18 beshort 1 AT&T WE32100,
->>18 beshort 2 SPARC,
->>18 beshort 3 Intel 80386 - invalid byte order,
->>18 beshort 4 Motorola 68000,
->>18 beshort 5 Motorola 88000,
->>18 beshort 6 Intel 80486 - invalid byte order,
->>18 beshort 7 Intel 80860,
->>18 beshort 8 MIPS R3000_BE,
->>18 beshort 9 Amdahl,
->>18 beshort 10 MIPS R3000_LE - invalid byte order,
->>18 beshort 11 RS6000,
->>18 beshort 15 PA-RISC,
->>18 beshort 16 nCUBE,
->>18 beshort 17 VPP500,
->>18 beshort 18 SPARC32PLUS,
->>18 beshort 20 PowerPC or cisco 4500,
->>18 beshort 21 cisco 7500,
->>18 beshort 24 cisco SVIP,
->>18 beshort 25 cisco 7200,
->>18 beshort 36 cisco 12000,
->>18 beshort 0x9026 Alpha,
->>20 belong 0 invalid version
->>20 belong 1 version 1
->>36 belong 1 MathCoPro/FPU/MAU Required
diff --git a/usr.bin/file/Magdir/os2 b/usr.bin/file/Magdir/os2
deleted file mode 100644
index 91ea9e23df71..000000000000
--- a/usr.bin/file/Magdir/os2
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#------------------------------------------------------------------------------
-# os2: file(1) magic for OS/2 files
-#
-
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-1 string InternetShortcut MS Windows 95 Internet shortcut text
->24 string >\ (URL=<%s>)
-
-# OS/2 URL objects
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-0 string http: OS/2 URL object text
->5 string >\ (WWW) <http:%s>
-0 string mailto: OS/2 URL object text
->7 string >\ (email) <%s>
-0 string news: OS/2 URL object text
->5 string >\ (Usenet) <%s>
-0 string ftp: OS/2 URL object text
->4 string >\ (FTP) <ftp:%s>
-0 string file: OS/2 URL object text
->5 string >\ (Local file) <%s>
diff --git a/usr.bin/file/Magdir/os9 b/usr.bin/file/Magdir/os9
deleted file mode 100644
index f493fe26fed0..000000000000
--- a/usr.bin/file/Magdir/os9
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-#
-# Copyright (c) 1996 Ignatios Souvatzis. 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Ignatios Souvatzis for
-# the NetBSD project.
-# 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.
-#
-#
-#
-# OS9/6809 module descriptions:
-#
-0 beshort 0x87CD OS9/6809 module:
-#
->6 byte&0x0f 0x00 non-executable
->6 byte&0x0f 0x01 machine language
->6 byte&0x0f 0x02 BASIC I-code
->6 byte&0x0f 0x03 P-code
->6 byte&0x0f 0x04 C I-code
->6 byte&0x0f 0x05 COBOL I-code
->6 byte&0x0f 0x06 FORTRAN I-code
-#
->6 byte&0xf0 0x10 program executable
->6 byte&0xf0 0x20 subroutine
->6 byte&0xf0 0x30 multi-module
->6 byte&0xf0 0x40 data module
-#
->6 byte&0xf0 0xC0 system module
->6 byte&0xf0 0xD0 file manager
->6 byte&0xf0 0xE0 device driver
->6 byte&0xf0 0xF0 device descriptor
-#
-# OS9/m68k stuff (to be continued)
-#
-0 beshort 0x4AFC OS9/68K module:
-#
-# attr
->14 byte&0x80 0x80 re-entrant
->14 byte&0x40 0x40 ghost
->14 byte&0x20 0x20 system-state
-#
-# lang:
-#
->13 byte 1 machine language
->13 byte 2 BASIC I-code
->13 byte 3 P-code
->13 byte 4 C I-code
->13 byte 5 COBOL I-code
->13 byte 6 Fortran I-code
-#
-#
-# type:
-#
->12 byte 1 program executable
->12 byte 2 subroutine
->12 byte 3 multi-module
->12 byte 4 data module
->12 byte 11 trap library
->12 byte 12 system module
->12 byte 13 file manager
->12 byte 14 device driver
->12 byte 15 device descriptor
diff --git a/usr.bin/file/Magdir/riff b/usr.bin/file/Magdir/riff
deleted file mode 100644
index 6bf127d41f0b..000000000000
--- a/usr.bin/file/Magdir/riff
+++ /dev/null
@@ -1,93 +0,0 @@
-
-#------------------------------------------------------------------------------
-# riff: file(1) magic for RIFF format
-# See
-#
-# http://www.seanet.com/users/matts/riffmci/riffmci.htm
-#
-# and
-#
-# http://www.ora.com/centers/gff/formats/micriff/index.htm
-#
-# and
-#
-# http://www.jtauber.com/music/encoding/niff/spec/
-#
-0 string RIFF RIFF (little-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 leshort x \b, version %d
->>18 leshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 leshort 12 \b, OS/2 1.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 64 \b, OS/2 2.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 40 \b, Windows 3.x format
->>>>34 lelong x \b, %d x
->>>>38 lelong x %d x
->>>>44 leshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>22 leshort =1 \b, mono
->>22 leshort =2 \b, stereo
->>22 leshort >2 \b, %d channels
->>24 lelong >0 %d Hz
-# AVI == Audio Video Interleave
->8 string AVI\ \b, AVI
-# Animated Cursor format
->8 string ACON \b, animated cursor
-
-#
-# XXX - some of the below may only appear in little-endian form.
-#
-# Also "MV93" appears to be for one form of Macromedia Director
-# files, and "GDMF" appears to be another multimedia format.
-#
-0 string RIFX RIFF (big-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 beshort x \b, version %d
->>18 beshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 beshort 12 \b, OS/2 1.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 64 \b, OS/2 2.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 40 \b, Windows 3.x format
->>>>34 belong x \b, %d x
->>>>38 belong x %d x
->>>>44 beshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>22 beshort =1 \b, mono
->>22 beshort =2 \b, stereo
->>22 beshort >2 \b, %d channels
->>24 belong >0 %d Hz
-# AVI == Audio Video Interleave
->8 string AVI\ \b, AVI
-# Animated Cursor format
->8 string ACON \b, animated cursor
-# Notation Interchange File Format (big-endian only)
->8 string NIFF \b, Notation Interchange File Format
-
diff --git a/usr.bin/file/Magdir/teapot b/usr.bin/file/Magdir/teapot
deleted file mode 100644
index d9554bfb738e..000000000000
--- a/usr.bin/file/Magdir/teapot
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# teapot: file(1) magic for "teapot" spreadsheet
-#
-0 string #!teapot\012xdr teapot work sheet (XDR format)
diff --git a/usr.bin/file/Magdir/ti-8x b/usr.bin/file/Magdir/ti-8x
deleted file mode 100644
index d740060a5b44..000000000000
--- a/usr.bin/file/Magdir/ti-8x
+++ /dev/null
@@ -1,36 +0,0 @@
-# ------------------------------------------------------------------------
-# ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators.
-#
-# From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
-#
-# NOTE: This list is not complete.
-#
-# Magic Numbers for the TI-82
-#
-0 string **TI82** TI-82 Graphing Calculator
->0x000037 byte 0x0B TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-83
-#
-0 string **TI83** TI-83 Graphing Calculator
->0x000037 byte 0x0B TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-85
-#
-0 string **TI85** TI-85 Graphing Calculator
->11 string Backup Backup File.
->0x000032 string ZS4 - ZShell Version 4 File.
->0x000032 string ZS3 - ZShell Version 3 File.
->0x00000B string GDatabase Graphics Database.
->0x00003B byte 0x12 TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-92
-#
-0 string **TI92** TI-92 Graphing Calculator
->0x000058 byte 0x12 TI-BASIC Group File.
->0x000012 string Function Function.
->0x000048 byte 0x12 TI-BASIC Program.
-# Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
-# program/group magic numbers in here because I cannot find any.
-0 string **TI80** TI-80 Graphing Calculator File.
-0 string **TI81** TI-81 Graphing Calculator File.
diff --git a/usr.bin/file/Magdir/vicar b/usr.bin/file/Magdir/vicar
deleted file mode 100644
index ab216eeea816..000000000000
--- a/usr.bin/file/Magdir/vicar
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#------------------------------------------------------------------------------
-# vicar: file(1) magic for VICAR files.
-#
-# From: Ossama Othman <othman@astrosun.tn.cornell.edu
-# VICAR is JPL's in-house spacecraft image processing program
-# VICAR image
-0 string LBLSIZE= VICAR image data
->32 string BYTE \b, 8 bits = VAX byte
->32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2
->32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4
->32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4
->32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8
->32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8
-# VICAR label file
-43 string SFDU_LABEL VICAR label file
diff --git a/usr.bin/file/Magdir/wordperfect b/usr.bin/file/Magdir/wordperfect
deleted file mode 100644
index c77ac8d1b888..000000000000
--- a/usr.bin/file/Magdir/wordperfect
+++ /dev/null
@@ -1,91 +0,0 @@
-#WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
-0 string \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable text
->15 byte 0 Optimized for Intel
->15 byte 1 Optimized for Non-Intel
-1 string WPC (Corel/WP)
->8 short 257 WordPerfect macro
->8 short 258 WordPerfect help file
->8 short 259 WordPerfect keyboard file
->8 short 266 WordPerfect document
->8 short 267 WordPerfect dictionary
->8 short 268 WordPerfect thesaurus
->8 short 269 WordPerfect block
->8 short 270 WordPerfect rectangular block
->8 short 271 WordPerfect column block
->8 short 272 WordPerfect printer data
->8 short 275 WordPerfect printer data
->8 short 276 WordPerfect driver resource data
->8 short 279 WordPerfect hyphenation code
->8 short 280 WordPerfect hyphenation data
->8 short 281 WordPerfect macro resource data
->8 short 283 WordPerfect hyphenation lex
->8 short 285 WordPerfect wordlist
->8 short 286 WordPerfect equation resource data
->8 short 289 WordPerfect spell rules
->8 short 290 WordPerfect dictionary rules
->8 short 295 WordPerfect spell rules (Microlytics)
->8 short 299 WordPerfect settings file
->8 short 301 WordPerfect 4.2 document
->8 short 325 WordPerfect dialog file
->8 short 332 WordPerfect button bar
->8 short 513 Shell macro
->8 short 522 Shell definition
->8 short 769 Notebook macro
->8 short 770 Notebook help file
->8 short 771 Notebook keyboard file
->8 short 778 Notebook definition
->8 short 1026 Calculator help file
->8 short 1538 Calendar help file
->8 short 1546 Calendar data file
->8 short 1793 Editor macro
->8 short 1794 Editor help file
->8 short 1795 Editor keyboard file
->8 short 1817 Editor macro resource file
->8 short 2049 Macro editor macro
->8 short 2050 Macro editor help file
->8 short 2051 Macro editor keyboard file
->8 short 2305 PlanPerfect macro
->8 short 2306 PlanPerfect help file
->8 short 2307 PlanPerfect keyboard file
->8 short 2314 PlanPerfect worksheet
->8 short 2319 PlanPerfect printer definition
->8 short 2322 PlanPerfect graphic definition
->8 short 2323 PlanPerfect data
->8 short 2324 PlanPerfect temporary printer
->8 short 2329 PlanPerfect macro resource data
->8 byte 11 Mail
->8 short 2818 help file
->8 short 2821 distribution list
->8 short 2826 out box
->8 short 2827 in box
->8 short 2836 users archived mailbox
->8 short 2837 archived message database
->8 short 2838 archived attachments
->8 short 3083 Printer temporary file
->8 short 3330 Scheduler help file
->8 short 3338 Scheduler in file
->8 short 3339 Scheduler out file
->8 short 3594 GroupWise settings file
->8 short 3601 GroupWise directory services
->8 short 3627 GroupWise settings file
->8 short 4362 Terminal resource data
->8 short 4363 Terminal resource data
->8 short 4395 Terminal resource data
->8 short 4619 GUI loadable text
->8 short 4620 graphics resource data
->8 short 4621 printer settings file
->8 short 4622 port definition file
->8 short 4623 print queue parameters
->8 short 4624 compressed file
->8 short 5130 Network service msg file
->8 short 5131 Network service msg file
->8 short 5132 Async gateway login msg
->8 short 5134 GroupWise message file
->8 short 7956 GroupWise admin domain database
->8 short 7957 GroupWise admin host database
->8 short 7959 GroupWise admin remote host database
->8 short 7960 GroupWise admin ADS deferment data file
->8 short 8458 IntelliTAG (SGML) compiled DTD
->8 long 18219264 WordPerfect graphic image (1.0)
->8 long 18219520 WordPerfect graphic image (2.0)
-#end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
diff --git a/usr.bin/find/extern.h b/usr.bin/find/extern.h
index cf2d959d5bdf..a11183d21dc6 100644
--- a/usr.bin/find/extern.h
+++ b/usr.bin/find/extern.h
@@ -83,4 +83,4 @@ PLAN *c_mtime __P((char *));
PLAN *c_not __P((void));
PLAN *c_or __P((void));
-extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs;
+extern int ftsoptions, isdeprecated, isdepth, isoutput, isxargs;
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index ed958c4f784a..97578885de6d 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)find.1 8.7 (Berkeley) 5/9/95
-.\" $Id: find.1,v 1.17 1998/11/29 12:00:06 bde Exp $
+.\" $Id: find.1,v 1.14 1997/10/27 14:25:54 steve Exp $
.\"
.Dd May 9, 1995
.Dt FIND 1
@@ -44,7 +44,7 @@
.Sh SYNOPSIS
.Nm find
.Op Fl H | Fl L | Fl P
-.Op Fl Xdsx
+.Op Fl Xdx
.Op Fl f Ar file
.Op Ar file ...
.Ar expression
@@ -68,8 +68,7 @@ option causes the file information and file type (see
returned for each symbolic link specified on the command line to be
those of the file referenced by the link, not the link itself.
If the referenced file does not exist, the file information and type will
-be for the link itself.
-File information of all symbolic links not on
+be for the link itself. File information of all symbolic links not on
the command line is that of the link itself.
.It Fl L
The
@@ -122,20 +121,6 @@ option specifies a file hierarchy for
to traverse.
File hierarchies may also be specified as the operands immediately
following the options.
-.It Fl s
-The
-.Fl s
-option causes
-.Nm find
-to traverse the file hierarchies in lexicographical order,
-i.e., alphabetical order within each directory.
-Note:
-.Sq find -s
-and
-.So
-find | sort
-.Sc
-may give different results.
.It Fl x
The
.Fl x
@@ -173,13 +158,10 @@ was started, rounded up to the next full 24\-hour period, is
.Ar n
24\-hour periods.
.It Ic -delete
-Delete found files and/or directories.
-Always returns true.
-This executes
+Delete found files and/or directories. Always returns True. This executes
from the current working directory as
.Nm
-recurses down the tree.
-It will not attempt to delete a filename with a ``/''
+recurses down the tree. It will not attempt to delete a filename with a ``/''
character in its pathname relative to "." for security reasons.
Depth\-first traversal processing is implied by this option.
.It Ic -exec Ar utility Op argument ... ;
@@ -202,8 +184,7 @@ primary is identical to the
primary with the exception that
.Ar Utility
will be executed from the directory that holds
-the current file.
-The filename substituted for
+the current file. The filename substituted for
the string ``{}'' is not qualified.
.It Ic -fstype Ar type
True if the file is contained in a file system of type
@@ -526,7 +507,7 @@ option and the
.Pp
The
.Ic -delete
-primary does not interact well with other options that cause the filesystem
+primary do not interact well with other options that cause the filesystem
tree traversal options to be changed.
.Sh HISTORY
A
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index 56e234034586..8afadf8b2ef1 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -50,22 +50,6 @@ static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94";
#include "find.h"
-static int find_compare __P((const FTSENT **s1, const FTSENT **s2));
-
-/*
- * find_compare --
- * tell fts_open() how to order the traversal of the hierarchy.
- * This variant gives lexicographical order, i.e., alphabetical
- * order within each directory.
- */
-static int
-find_compare(s1, s2)
- const FTSENT **s1, **s2;
-{
-
- return (strcoll((*s1)->fts_name, (*s2)->fts_name));
-}
-
/*
* find_formplan --
* process the command line and create a "plan" corresponding to the
@@ -171,8 +155,7 @@ find_execute(plan, paths)
PLAN *p;
int rval;
- tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL));
- if (tree == NULL)
+ if ((tree = fts_open(paths, ftsoptions, (int (*)())NULL)) == NULL)
err(1, "ftsopen");
for (rval = 0; (entry = fts_read(tree)) != NULL;) {
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index d8a590e4e58f..1ffdd5236186 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -949,7 +949,6 @@ c_perm(perm)
err(1, "-perm: %s: illegal mode string", perm);
new->m_data = getmode(set, 0);
- free(set);
return (new);
}
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 21770fbcf477..49ad226c57ed 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -65,7 +65,6 @@ int ftsoptions; /* options for the ftsopen(3) call */
int isdeprecated; /* using deprecated syntax */
int isdepth; /* do directories on post-order visit */
int isoutput; /* user specified output operator */
-int issort; /* do hierarchies in lexicographical order */
int isxargs; /* don't permit xargs delimiting chars */
static void usage __P((void));
@@ -85,7 +84,7 @@ main(argc, argv)
p = start = argv;
Hflag = Lflag = 0;
ftsoptions = FTS_NOSTAT | FTS_PHYSICAL;
- while ((ch = getopt(argc, argv, "HLPXdf:sx")) != -1)
+ while ((ch = getopt(argc, argv, "HLPXdf:x")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -107,9 +106,6 @@ main(argc, argv)
case 'f':
*p++ = optarg;
break;
- case 's':
- issort = 1;
- break;
case 'x':
ftsoptions |= FTS_XDEV;
break;
@@ -155,6 +151,6 @@ static void
usage()
{
(void)fprintf(stderr,
-"usage: find [-H | -L | -P] [-Xdsx] [-f file] [file ...] [expression]\n");
+"usage: find [-H | -L | -P] [-Xdx] [-f file] [file ...] [expression]\n");
exit(1);
}
diff --git a/usr.bin/find/operator.c b/usr.bin/find/operator.c
index 3654bcabd5fa..d331faf9a5fe 100644
--- a/usr.bin/find/operator.c
+++ b/usr.bin/find/operator.c
@@ -190,7 +190,7 @@ not_squish(plan)
int notlevel = 1;
node = yanknode(&plan);
- while (node != NULL && node->type == N_NOT) {
+ while ((node != NULL) && (node->type == N_NOT)) {
++notlevel;
node = yanknode(&plan);
}
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index a1e49a3e3f13..1378be4b188d 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $Id: ftp.c,v 1.14 1998/07/26 18:49:36 imp Exp $ */
+/* $Id: ftp.c,v 1.13 1998/06/09 04:30:51 imp Exp $ */
/* $NetBSD: ftp.c,v 1.29.2.1 1997/11/18 01:01:04 mellon Exp $ */
/*
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$Id: ftp.c,v 1.14 1998/07/26 18:49:36 imp Exp $");
+__RCSID("$Id: ftp.c,v 1.13 1998/06/09 04:30:51 imp Exp $");
__RCSID_SOURCE("$NetBSD: ftp.c,v 1.29.2.1 1997/11/18 01:01:04 mellon Exp $");
#endif
#endif /* not lint */
@@ -333,8 +333,7 @@ getreply(expecteof)
if (dig > 4 && pflag == 1 && isdigit((unsigned char)c))
pflag = 2;
if (pflag == 2) {
- if (c != '\r' && c != ')' &&
- pt < &pasv[sizeof(pasv)-1])
+ if (c != '\r' && c != ')')
*pt++ = c;
else {
*pt = '\0';
diff --git a/usr.bin/gcore/Makefile b/usr.bin/gcore/Makefile
index 7f6a3eed905a..664813febb92 100644
--- a/usr.bin/gcore/Makefile
+++ b/usr.bin/gcore/Makefile
@@ -1,8 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= gcore
-SRCS= elfcore.c gcore.c
-CFLAGS+=-Wall
+SRCS= gcore.c
DPADD= ${LIBKVM}
LDADD= -lkvm
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
deleted file mode 100644
index af199ca8f705..000000000000
--- a/usr.bin/gcore/elfcore.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/*-
- * Copyright (c) 1998 John D. Polstra
- * 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.
- *
- * $Id: elfcore.c,v 1.1 1998/10/19 19:42:18 jdp Exp $
- */
-
-#include <sys/param.h>
-#include <sys/lock.h>
-#include <sys/procfs.h>
-#include <vm/vm_param.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_map.h>
-#include <vm/vm_prot.h>
-#include <elf.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "extern.h"
-
-/*
- * Code for generating ELF core dumps.
- */
-
-typedef void (*segment_callback)(vm_map_entry_t, void *);
-
-/* Closure for cb_put_phdr(). */
-struct phdr_closure {
- Elf_Phdr *phdr; /* Program header to fill in */
- Elf_Off offset; /* Offset of segment in core file */
-};
-
-/* Closure for cb_size_segment(). */
-struct sseg_closure {
- int count; /* Count of writable segments. */
- size_t size; /* Total size of all writable segments. */
-};
-
-static void cb_put_phdr(vm_map_entry_t, void *);
-static void cb_size_segment(vm_map_entry_t, void *);
-static void each_writable_segment(vm_map_entry_t, segment_callback,
- void *closure);
-static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs,
- void *hdr, size_t hdrsize);
-static void elf_puthdr(vm_map_entry_t, void *, size_t *,
- const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs);
-static void elf_putnote(void *dst, size_t *off, const char *name, int type,
- const void *desc, size_t descsz);
-static void freemap(vm_map_entry_t);
-static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *);
-static vm_map_entry_t readmap(pid_t);
-
-/*
- * Write an ELF coredump for the given pid to the given fd.
- */
-void
-elf_coredump(int fd, pid_t pid)
-{
- vm_map_entry_t map;
- struct sseg_closure seginfo;
- void *hdr;
- size_t hdrsize;
- char memname[64];
- int memfd;
- Elf_Phdr *php;
- int i;
-
- /* Get the program's memory map. */
- map = readmap(pid);
-
- /* Size the program segments. */
- seginfo.count = 0;
- seginfo.size = 0;
- each_writable_segment(map, cb_size_segment, &seginfo);
-
- /*
- * Calculate the size of the core file header area by making
- * a dry run of generating it. Nothing is written, but the
- * size is calculated.
- */
- hdrsize = 0;
- elf_puthdr(map, (void *)NULL, &hdrsize,
- (const prstatus_t *)NULL, (const prfpregset_t *)NULL,
- (const prpsinfo_t *)NULL, seginfo.count);
-
- /*
- * Allocate memory for building the header, fill it up,
- * and write it out.
- */
- hdr = malloc(hdrsize);
- if ((hdr = malloc(hdrsize)) == NULL)
- errx(1, "out of memory");
- elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize);
-
- /* Write the contents of all of the writable segments. */
- snprintf(memname, sizeof memname, "/proc/%d/mem", pid);
- if ((memfd = open(memname, O_RDONLY)) == -1)
- err(1, "cannot open %s", memname);
-
- php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1;
- for (i = 0; i < seginfo.count; i++) {
- int nleft = php->p_filesz;
-
- lseek(memfd, (off_t)php->p_vaddr, SEEK_SET);
- while (nleft > 0) {
- char buf[8*1024];
- int nwant;
- int ngot;
-
- nwant = nleft;
- if (nwant > sizeof buf)
- nwant = sizeof buf;
- ngot = read(memfd, buf, nwant);
- if (ngot == -1)
- err(1, "read from %s", memname);
- if (ngot < nwant)
- errx(1, "short read from %s:"
- " wanted %d, got %d\n", memname,
- nwant, ngot);
- ngot = write(fd, buf, nwant);
- if (ngot == -1)
- err(1, "write of segment %d failed", i);
- if (ngot != nwant)
- errx(1, "short write");
- nleft -= nwant;
- }
- php++;
- }
- close(memfd);
- free(hdr);
- freemap(map);
-}
-
-/*
- * A callback for each_writable_segment() to write out the segment's
- * program header entry.
- */
-static void
-cb_put_phdr(vm_map_entry_t entry, void *closure)
-{
- struct phdr_closure *phc = (struct phdr_closure *)closure;
- Elf_Phdr *phdr = phc->phdr;
-
- phc->offset = round_page(phc->offset);
-
- phdr->p_type = PT_LOAD;
- phdr->p_offset = phc->offset;
- phdr->p_vaddr = entry->start;
- phdr->p_paddr = 0;
- phdr->p_filesz = phdr->p_memsz = entry->end - entry->start;
- phdr->p_align = PAGE_SIZE;
- phdr->p_flags = 0;
- if (entry->protection & VM_PROT_READ)
- phdr->p_flags |= PF_R;
- if (entry->protection & VM_PROT_WRITE)
- phdr->p_flags |= PF_W;
- if (entry->protection & VM_PROT_EXECUTE)
- phdr->p_flags |= PF_X;
-
- phc->offset += phdr->p_filesz;
- phc->phdr++;
-}
-
-/*
- * A callback for each_writable_segment() to gather information about
- * the number of segments and their total size.
- */
-static void
-cb_size_segment(vm_map_entry_t entry, void *closure)
-{
- struct sseg_closure *ssc = (struct sseg_closure *)closure;
-
- ssc->count++;
- ssc->size += entry->end - entry->start;
-}
-
-/*
- * For each segment in the given memory map, call the given function
- * with a pointer to the map entry and some arbitrary caller-supplied
- * data.
- */
-static void
-each_writable_segment(vm_map_entry_t map, segment_callback func, void *closure)
-{
- vm_map_entry_t entry;
-
- for (entry = map; entry != NULL; entry = entry->next)
- (*func)(entry, closure);
-}
-
-/*
- * Write the core file header to the file, including padding up to
- * the page boundary.
- */
-static void
-elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr,
- size_t hdrsize)
-{
- size_t off;
- prstatus_t status;
- prfpregset_t fpregset;
- prpsinfo_t psinfo;
-
- /* Gather the information for the header. */
- readhdrinfo(pid, &status, &fpregset, &psinfo);
-
- /* Fill in the header. */
- memset(hdr, 0, hdrsize);
- off = 0;
- elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs);
-
- /* Write it to the core file. */
- if (write(fd, hdr, hdrsize) == -1)
- err(1, "write");
-}
-
-/*
- * Generate the ELF coredump header into the buffer at "dst". "dst" may
- * be NULL, in which case the header is sized but not actually generated.
- */
-static void
-elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status,
- const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs)
-{
- size_t ehoff;
- size_t phoff;
- size_t noteoff;
- size_t notesz;
-
- ehoff = *off;
- *off += sizeof(Elf_Ehdr);
-
- phoff = *off;
- *off += (numsegs + 1) * sizeof(Elf_Phdr);
-
- noteoff = *off;
- elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status,
- sizeof *status);
- elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset,
- sizeof *fpregset);
- elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo,
- sizeof *psinfo);
- notesz = *off - noteoff;
-
- /* Align up to a page boundary for the program segments. */
- *off = round_page(*off);
-
- if (dst != NULL) {
- Elf_Ehdr *ehdr;
- Elf_Phdr *phdr;
- struct phdr_closure phc;
-
- /*
- * Fill in the ELF header.
- */
- ehdr = (Elf_Ehdr *)((char *)dst + ehoff);
- ehdr->e_ident[EI_MAG0] = ELFMAG0;
- ehdr->e_ident[EI_MAG1] = ELFMAG1;
- ehdr->e_ident[EI_MAG2] = ELFMAG2;
- ehdr->e_ident[EI_MAG3] = ELFMAG3;
- ehdr->e_ident[EI_CLASS] = ELF_CLASS;
- ehdr->e_ident[EI_DATA] = ELF_DATA;
- ehdr->e_ident[EI_VERSION] = EV_CURRENT;
- ehdr->e_ident[EI_PAD] = 0;
- strncpy(ehdr->e_ident + EI_BRAND, "FreeBSD",
- EI_NIDENT - EI_BRAND);
- ehdr->e_type = ET_CORE;
- ehdr->e_machine = ELF_ARCH;
- ehdr->e_version = EV_CURRENT;
- ehdr->e_entry = 0;
- ehdr->e_phoff = phoff;
- ehdr->e_flags = 0;
- ehdr->e_ehsize = sizeof(Elf_Ehdr);
- ehdr->e_phentsize = sizeof(Elf_Phdr);
- ehdr->e_phnum = numsegs + 1;
- ehdr->e_shentsize = sizeof(Elf_Shdr);
- ehdr->e_shnum = 0;
- ehdr->e_shstrndx = SHN_UNDEF;
-
- /*
- * Fill in the program header entries.
- */
- phdr = (Elf_Phdr *)((char *)dst + phoff);
-
- /* The note segement. */
- phdr->p_type = PT_NOTE;
- phdr->p_offset = noteoff;
- phdr->p_vaddr = 0;
- phdr->p_paddr = 0;
- phdr->p_filesz = notesz;
- phdr->p_memsz = 0;
- phdr->p_flags = 0;
- phdr->p_align = 0;
- phdr++;
-
- /* All the writable segments from the program. */
- phc.phdr = phdr;
- phc.offset = *off;
- each_writable_segment(map, cb_put_phdr, &phc);
- }
-}
-
-/*
- * Emit one note section to "dst", or just size it if "dst" is NULL.
- */
-static void
-elf_putnote(void *dst, size_t *off, const char *name, int type,
- const void *desc, size_t descsz)
-{
- Elf_Note note;
-
- note.n_namesz = strlen(name) + 1;
- note.n_descsz = descsz;
- note.n_type = type;
- if (dst != NULL)
- bcopy(&note, (char *)dst + *off, sizeof note);
- *off += sizeof note;
- if (dst != NULL)
- bcopy(name, (char *)dst + *off, note.n_namesz);
- *off += roundup2(note.n_namesz, sizeof(Elf_Size));
- if (dst != NULL)
- bcopy(desc, (char *)dst + *off, note.n_descsz);
- *off += roundup2(note.n_descsz, sizeof(Elf_Size));
-}
-
-/*
- * Free the memory map.
- */
-static void
-freemap(vm_map_entry_t map)
-{
- while (map != NULL) {
- vm_map_entry_t next = map->next;
- free(map);
- map = next;
- }
-}
-
-/*
- * Read the process information necessary to fill in the core file's header.
- */
-static void
-readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset,
- prpsinfo_t *psinfo)
-{
- char name[64];
- char line[256];
- int fd;
- int i;
- int n;
-
- memset(status, 0, sizeof *status);
- status->pr_version = PRSTATUS_VERSION;
- status->pr_statussz = sizeof(prstatus_t);
- status->pr_gregsetsz = sizeof(gregset_t);
- status->pr_fpregsetsz = sizeof(fpregset_t);
- status->pr_osreldate = __FreeBSD_version;
- status->pr_pid = pid;
-
- memset(fpregset, 0, sizeof *fpregset);
-
- memset(psinfo, 0, sizeof *psinfo);
- psinfo->pr_version = PRPSINFO_VERSION;
- psinfo->pr_psinfosz = sizeof(prpsinfo_t);
-
- /* Read the general registers. */
- snprintf(name, sizeof name, "/proc/%d/regs", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1)
- err(1, "read error from %s", name);
- if (n < sizeof status->pr_reg)
- errx(1, "short read from %s: wanted %u, got %d", name,
- sizeof status->pr_reg, n);
- close(fd);
-
- /* Read the floating point registers. */
- snprintf(name, sizeof name, "/proc/%d/fpregs", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, fpregset, sizeof *fpregset)) == -1)
- err(1, "read error from %s", name);
- if (n < sizeof *fpregset)
- errx(1, "short read from %s: wanted %u, got %d", name,
- sizeof *fpregset, n);
- close(fd);
-
- /* Read and parse the process status. */
- snprintf(name, sizeof name, "/proc/%d/status", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, line, sizeof line - 1)) == -1)
- err(1, "read error from %s", name);
- if (n > MAXCOMLEN)
- n = MAXCOMLEN;
- for (i = 0; i < n && line[i] != ' '; i++)
- psinfo->pr_fname[i] = line[i];
- strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ);
- close(fd);
-}
-
-/*
- * Read the process's memory map using procfs, and return a list of
- * VM map entries. Only the non-device read/writable segments are
- * returned. The map entries in the list aren't fully filled in; only
- * the items we need are present.
- */
-static vm_map_entry_t
-readmap(pid_t pid)
-{
- char mapname[64];
- int mapfd;
- ssize_t mapsize;
- size_t bufsize;
- char *mapbuf;
- int pos;
- vm_map_entry_t map;
- vm_map_entry_t *linkp;
-
- snprintf(mapname, sizeof mapname, "/proc/%d/map", pid);
- if ((mapfd = open(mapname, O_RDONLY)) == -1)
- err(1, "cannot open %s", mapname);
-
- /*
- * Procfs requires (for consistency) that the entire memory map
- * be read with a single read() call. Start with a reasonbly sized
- * buffer, and double it until it is big enough.
- */
- bufsize = 8 * 1024;
- mapbuf = NULL;
- for ( ; ; ) {
- if ((mapbuf = realloc(mapbuf, bufsize)) == NULL)
- errx(1, "out of memory");
- mapsize = read(mapfd, mapbuf, bufsize);
- if (mapsize != -1 || errno != EFBIG)
- break;
- bufsize *= 2;
- /* This lseek shouldn't be necessary, but it is. */
- lseek(mapfd, (off_t)0, SEEK_SET);
- }
- if (mapsize == -1)
- err(1, "read error from %s", mapname);
- if (mapsize == 0)
- errx(1, "empty map file %s", mapname);
- close(mapfd);
-
- pos = 0;
- map = NULL;
- linkp = &map;
- while (pos < mapsize) {
- vm_map_entry_t ent;
- vm_offset_t start;
- vm_offset_t end;
- char prot[4];
- char type[16];
- int n;
- int len;
-
- len = 0;
- n = sscanf(mapbuf + pos, "%x %x %*d %*d %*d %3[-rwx]"
- " %*d %*d %*x %*s %*s %16s%*[\n]%n",
- &start, &end, prot, type, &len);
- if (n != 4)
- errx(1, "ill-formed line in %s", mapname);
- pos += len;
-
- /* Ignore segments of the wrong kind, and unwritable ones */
- if (strncmp(prot, "rw", 2) != 0 ||
- (strcmp(type, "default") != 0 &&
- strcmp(type, "vnode") != 0 &&
- strcmp(type, "swap") != 0))
- continue;
-
- if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL)
- errx(1, "out of memory");
- ent->start = start;
- ent->end = end;
- ent->protection = VM_PROT_READ | VM_PROT_WRITE;
- if (prot[2] == 'x')
- ent->protection |= VM_PROT_EXECUTE;
-
- *linkp = ent;
- linkp = &ent->next;
- }
- free(mapbuf);
- return map;
-}
diff --git a/usr.bin/gcore/extern.h b/usr.bin/gcore/extern.h
index f157e531a5f3..3dccafe70845 100644
--- a/usr.bin/gcore/extern.h
+++ b/usr.bin/gcore/extern.h
@@ -33,9 +33,5 @@
* @(#)extern.h 8.1 (Berkeley) 6/6/93
*/
-#include <sys/types.h>
-#include <kvm.h>
-
void err __P((int, const char *, ...));
-void elf_coredump __P((int, pid_t));
void md_core __P((kvm_t *, int, struct kinfo_proc *));
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index 4702003b8afc..8ab7b0bdbe61 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93";
#endif
static const char rcsid[] =
- "$Id: gcore.c,v 1.12 1998/10/22 04:02:37 jdp Exp $";
+ "$Id: gcore.c,v 1.9 1998/09/14 10:09:30 des Exp $";
#endif /* not lint */
/*
@@ -79,19 +79,17 @@ static const char rcsid[] =
#include "extern.h"
-static void core __P((int, int, struct kinfo_proc *));
-static void datadump __P((int, int, struct proc *, u_long, int));
-static void killed __P((int));
-static void restart_target __P((void));
-static void usage __P((void)) __dead2;
-static void userdump __P((int, struct proc *, u_long, int));
+void core __P((int, int, struct kinfo_proc *));
+void datadump __P((int, int, struct proc *, u_long, int));
+void usage __P((void));
+void userdump __P((int, struct proc *, u_long, int));
kvm_t *kd;
/* XXX undocumented routine, should be in kvm.h? */
ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t));
+
static int data_offset;
-static pid_t pid;
int
main(argc, argv)
@@ -99,12 +97,11 @@ main(argc, argv)
char *argv[];
{
register struct proc *p;
- struct kinfo_proc *ki = NULL;
+ struct kinfo_proc *ki;
struct exec exec;
- int ch, cnt, efd, fd, sflag, uid;
+ int ch, cnt, efd, fd, pid, sflag, uid;
char *binfile, *corefile;
char errbuf[_POSIX2_LINE_MAX], fname[MAXPATHLEN + 1];
- int is_aout;
sflag = 0;
corefile = NULL;
@@ -140,53 +137,27 @@ main(argc, argv)
usage();
}
- efd = open(binfile, O_RDONLY, 0);
- if (efd < 0)
- err(1, "%s", binfile);
+ kd = kvm_openfiles(0, 0, 0, O_RDONLY, errbuf);
+ if (kd == NULL)
+ errx(1, "%s", errbuf);
- cnt = read(efd, &exec, sizeof(exec));
- if (cnt != sizeof(exec))
- errx(1, "%s exec header: %s",
- binfile, cnt > 0 ? strerror(EIO) : strerror(errno));
- if (!N_BADMAG(exec)) {
- is_aout = 1;
- /*
- * This legacy a.out support uses the kvm interface instead
- * of procfs.
- */
- kd = kvm_openfiles(0, 0, 0, O_RDONLY, errbuf);
- if (kd == NULL)
- errx(1, "%s", errbuf);
-
- uid = getuid();
-
- ki = kvm_getprocs(kd, KERN_PROC_PID, pid, &cnt);
- if (ki == NULL || cnt != 1)
- errx(1, "%d: not found", pid);
-
- p = &ki->kp_proc;
- if (ki->kp_eproc.e_pcred.p_ruid != uid && uid != 0)
- errx(1, "%d: not owner", pid);
-
- if (p->p_stat == SZOMB)
- errx(1, "%d: zombie", pid);
-
- if (p->p_flag & P_WEXIT)
- errx(1, "%d: process exiting", pid);
- if (p->p_flag & P_SYSTEM) /* Swapper or pagedaemon. */
- errx(1, "%d: system process", pid);
- if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize))
- errx(1, "The executable %s does not belong to"
- " process %d!\n"
- "Text segment size (in bytes): executable %ld,"
- " process %d", binfile, pid, exec.a_text,
- ptoa(ki->kp_eproc.e_vm.vm_tsize));
- data_offset = N_DATOFF(exec);
- } else if (IS_ELF(*(Elf_Ehdr *)&exec)) {
- is_aout = 0;
- close(efd);
- } else
- errx(1, "Invalid executable file");
+ uid = getuid();
+
+ ki = kvm_getprocs(kd, KERN_PROC_PID, pid, &cnt);
+ if (ki == NULL || cnt != 1)
+ errx(1, "%d: not found", pid);
+
+ p = &ki->kp_proc;
+ if (ki->kp_eproc.e_pcred.p_ruid != uid && uid != 0)
+ errx(1, "%d: not owner", pid);
+
+ if (p->p_stat == SZOMB)
+ errx(1, "%d: zombie", pid);
+
+ if (p->p_flag & P_WEXIT)
+ errx(1, "%d: process exiting", pid);
+ if (p->p_flag & P_SYSTEM) /* Swapper or pagedaemon. */
+ errx(1, "%d: system process", pid);
if (corefile == NULL) {
(void)snprintf(fname, sizeof(fname), "core.%d", pid);
@@ -196,21 +167,41 @@ main(argc, argv)
if (fd < 0)
err(1, "%s", corefile);
- if (sflag) {
- signal(SIGHUP, killed);
- signal(SIGINT, killed);
- signal(SIGTERM, killed);
- if (kill(pid, SIGSTOP) == -1)
- err(1, "%d: stop signal", pid);
- atexit(restart_target);
+ efd = open(binfile, O_RDONLY, 0);
+ if (efd < 0)
+ err(1, "%s", binfile);
+
+ cnt = read(efd, &exec, sizeof(exec));
+ if (cnt != sizeof(exec))
+ errx(1, "%s exec header: %s",
+ binfile, cnt > 0 ? strerror(EIO) : strerror(errno));
+ if (N_BADMAG(exec)) {
+ const Elf_Ehdr *ehdr = (const Elf_Ehdr *)&exec;
+
+ if (IS_ELF(*ehdr))
+ errx(1, "ELF executables are not supported yet");
+ errx(1, "Invalid executable file");
}
- if (is_aout)
- core(efd, fd, ki);
- else
- elf_coredump(fd, pid);
+ /* check the text segment size of the executable and the process */
+ if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize))
+ errx(1,
+ "The executable %s does not belong to process %d!\n"
+ "Text segment size (in bytes): executable %d, process %d",
+ binfile, pid, exec.a_text,
+ ptoa(ki->kp_eproc.e_vm.vm_tsize));
+
+ data_offset = N_DATOFF(exec);
+
+ if (sflag && kill(pid, SIGSTOP) < 0)
+ err(1, "%d: stop signal", pid);
+ core(efd, fd, ki);
+
+ if (sflag && kill(pid, SIGCONT) < 0)
+ err(1, "%d: continue signal", pid);
(void)close(fd);
+
exit(0);
}
@@ -295,21 +286,6 @@ datadump(efd, fd, p, addr, npage)
}
}
-static void
-killed(sig)
- int sig;
-{
- restart_target();
- signal(sig, SIG_DFL);
- kill(getpid(), sig);
-}
-
-static void
-restart_target()
-{
- kill(pid, SIGCONT);
-}
-
void
userdump(fd, p, addr, npage)
register int fd;
diff --git a/usr.bin/gencat/gencat.1 b/usr.bin/gencat/gencat.1
index 6a4d26cc5f0d..f21b47193573 100644
--- a/usr.bin/gencat/gencat.1
+++ b/usr.bin/gencat/gencat.1
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: gencat.1,v 1.1 1997/09/14 20:23:02 wosch Exp $
+.\" $Id$
.\"
.Dd June 11, 1997
.Dt GENCAT 1
@@ -33,130 +33,22 @@
.Nm gencat
.Nd NLS catalog compiler
.Sh SYNOPSIS
-.Nm
+.Nm gencat
.Ar "output-file"
-.Ar "input-files..."
+.Ar "input-file..."
.Sh DESCRIPTION
The
-.Nm
-utility merges the text NLS input files
-.Ar "input-files..."
-into a formatted message catalog file
-.Ar "output-file" .
-The file
-.Ar "output-file"
-will be created if it does not already exist. If
-.Ar "output-file"
-does exist, its messages will be included in the new
-.Ar "output-file" .
-If set and message numbers collide, the new message text defined in
-.Ar "input-files..."
-will replace the old message text currently contained in
-.Ar "output-file" .
-.Sh INPUT FILES
-The format of a message text source file is defined below. Note that
-the fields of a message text source line are separated by a single space
-character: any other space characters are considered to be part of the
-field contents.
-.Pp
-.Bl -tag -width
-.It Li $set Ar n comment
-This line specifies the set identifier of the following messages until
-the next
-.Li $set
-or end-of-file appears. The argument
-.Ar n
-is the set identifier which is defined as a number in the range
-[1, (NL_SETMAX)]. Set identifiers must occur in ascending order within
-a single source file, but need not be contiguous. Any string following
-a space following the set identifier is treated as a comment. If no
-.Li $set
-directive is specified in a given source file, all messages will
-be located in the default message set NL_SETD.
-.It Li $del Ar n comment
-This line deletes messages from set
-.Ar n
-from a message catalog. The
-.Ar n
-specifies a set number. Any string following a space following the set
-number is treated as a comment.
-.It Li $ Ar comment
-A line beginning with
-.Li $
-followed by a space is treated as a comment.
-.It Ar m message-text
-A message line consists of a message identifier
-.Ar m
-in the range [1, (NL_MSGMAX)]. The
-.Ar message-text
-is stored in the message catalog with the set identifier specified by
-the last
-.Li $set
-directive, and the message identifier
-.Ar m .
-If the
-.Ar message-text
-is empty, and there is a space character following the message identifier,
-an empty string is stored in the message catalog. If the
-.Ar message-text
-is empty, and if there is no space character following the message
-identifier, then the existing message in the current set with the
-specified message identifier is deleted from the catalog. Message
-identifiers must be in ascending order within a single set, but
-need not be contiguous. The
-.Ar message-text
-length must be in the range [0, (NL_TEXTMAX)].
-.It Li $quote Ar c
-This line specifies an optional quote character
-.Ar c
-which can be used to surround
-.Ar message-text
-so that trailing space or empty messages are visible in message
-source files. By default, or if an empty
-.Li $quote
-directive is specified, no quoting of
-.Ar message-text
-will be recognized.
-.El
-.Pp
-Empty lines in message source files are ignored. The effect of lines
-beginning with any character other than those described above is
-undefined.
-.Pp
-Text strings can contain the following special characters and escape
-sequences. In addition, if a quote character is defined, it may be
-escaped as well to embed a literal quote character.
-.Pp
-.Bl -tag -width Ds -offset indent
-.It Li \en
-line feed
-.It Li \et
-horizontal tab
-.It Li \ev
-vertical tab
-.It Li \eb
-backspace
-.It Li \er
-carriage return
-.It Li \ef
-form feed
-.It Li \e\e
-backslash
-.It Li \eooo
-octal number in the range [000, 377]
-.El
-.Pp
-A backslash character immediately before the end of the line in a file
-is used to continue the line onto the next line, e.g.:
-.Pp
-.Dl 1 This line is continued \e
-.Dl on this line.
-.Pp
-If the character following the backslash is not one of those specified,
-the backslash is ignored.
+.Nm gencat
+utility compiles a text NLS input file into a catalog in a binary
+format used by the
+.Xr catclose 3 ,
+.Xr catgets 3
+and
+.Xr catopen 3
+functions.
.Pp
The
-.Nm
+.Nm gencat
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr catclose 3 ,
@@ -164,15 +56,7 @@ utility exits 0 on success, and >0 if an error occurs.
.Xr catopen 3
.Sh STANDARDS
The
-.Nm
-utility is compliant with the
-.St -xpg4
-standard.
-.Sh AUTHOR
-This manual page by
-.An Ken Stailey
-updated and revised by
-.An Terry Lambert .
-.Sh BUGS
-A message catalog file created from a blank input file can not be revised;
-it must be deleted and recreated.
+.Nm gencat
+utility is expected to be
+.St -xpg3
+compatible.
diff --git a/usr.bin/global/Makefile.inc b/usr.bin/global/Makefile.inc
index 34657a06430a..b6798433b79d 100644
--- a/usr.bin/global/Makefile.inc
+++ b/usr.bin/global/Makefile.inc
@@ -1,18 +1,4 @@
-# $Id: Makefile.inc,v 1.5 1999/01/18 07:38:09 simokawa Exp $
+# $Id: Makefile.inc,v 1.3 1997/12/15 23:34:51 cwt Exp $
-.if !defined(GLOBAL_MAKEFILE_INC_BEEN_HERE)
-
-GLOBAL_MAKEFILE_INC_BEEN_HERE=yes
-.if exists(${.OBJDIR}/../lib)
-LIBDESTDIR= ${.OBJDIR}/../lib
-.else
-LIBDESTDIR= ${.CURDIR}/../lib
-.endif
-DPADD= ${LIBDESTDIR}/libgloutil.a
-LDADD= ${LIBDESTDIR}/libgloutil.a
-CFLAGS+= -I${GLOBAL_DIR}/lib -O \
- -Wall -Wwrite-strings -Wmissing-prototypes
-
-.include "../Makefile.inc"
-
-.endif
+BINDIR?= /usr/bin
+CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
diff --git a/usr.bin/global/btreeop/Makefile b/usr.bin/global/btreeop/Makefile
index 12f4357e7bbe..ecd9fc3dede7 100644
--- a/usr.bin/global/btreeop/Makefile
+++ b/usr.bin/global/btreeop/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:49 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:51 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/btreeop
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= btreeop
.include <bsd.prog.mk>
diff --git a/usr.bin/global/gctags/Makefile b/usr.bin/global/gctags/Makefile
index b66694a58d1f..b4839f948c23 100644
--- a/usr.bin/global/gctags/Makefile
+++ b/usr.bin/global/gctags/Makefile
@@ -1,13 +1,17 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:52 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:52 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/gctags
-CFLAGS+= -I${GLOBAL_DIR}/gctags
+CFLAGS+= -I${GLOBAL_DIR}/lib
+CFLAGS+= -I${GLOBAL_DIR}/gctags -DGLOBAL -DYACC
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
+SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c assembler.c
PROG= gctags
-SRCS= C.c assembler.c gctags.c java.c
.include <bsd.prog.mk>
diff --git a/usr.bin/global/global/Makefile b/usr.bin/global/global/Makefile
index 0deeda464303..94f7bc89ffaa 100644
--- a/usr.bin/global/global/Makefile
+++ b/usr.bin/global/global/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:53 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:53 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/global
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= global
.include <bsd.prog.mk>
diff --git a/usr.bin/global/gtags/Makefile b/usr.bin/global/gtags/Makefile
index 05f506f77ce1..b21d1d278158 100644
--- a/usr.bin/global/gtags/Makefile
+++ b/usr.bin/global/gtags/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.5 1997/12/17 15:18:54 cwt Exp $
+# $Id: Makefile,v 1.4 1997/12/15 23:34:54 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/gtags
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= gtags
.include <bsd.prog.mk>
diff --git a/usr.bin/global/lib/Makefile b/usr.bin/global/lib/Makefile
index 793f953cb09f..3d1e354a35b6 100644
--- a/usr.bin/global/lib/Makefile
+++ b/usr.bin/global/lib/Makefile
@@ -1,12 +1,12 @@
-# $Id: Makefile,v 1.2 1997/12/21 08:31:50 cwt Exp $
+# $Id: Makefile,v 1.1 1997/12/15 23:40:54 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/lib
-LIB= gloutil
-SRCS= gtagsop.c tab.c strbuf.c mgets.c defined.c getdbpath.c \
- find.c dbop.c test.c makepath.c locatestring.c pathop.c \
- conf.c strmake.c usable.c token.c
+LIB= globalutil
+SRCS= dbio.c dbname.c find.c getdbpath.c gtagsopen.c locatestring.c \
+ lookup.c makepath.c mgets.c strop.c tab.c tag.c test.c
+
NOPROFILE= noprofile
INTERNALLIB= true
INTERNALSTATICLIB= true
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c
index b72da84ce8c7..0a74542db358 100644
--- a/usr.bin/hexdump/display.c
+++ b/usr.bin/hexdump/display.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: display.c,v 1.2 1997/07/10 06:48:12 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -234,7 +234,6 @@ get()
static u_char *curp, *savp;
register int n;
int need, nread;
- int valid_save = 0;
u_char *tmpp;
if (!curp) {
@@ -245,7 +244,6 @@ get()
curp = savp;
savp = tmpp;
address += blocksize;
- valid_save = 1;
}
for (need = blocksize, nread = 0;;) {
/*
@@ -256,9 +254,7 @@ get()
if (!length || ateof && !next((char **)NULL)) {
if (need == blocksize)
return((u_char *)NULL);
- if (vflag != ALL &&
- valid_save &&
- bcmp(curp, savp, nread) == 0) {
+ if (vflag != ALL && !bcmp(curp, savp, nread)) {
if (vflag != DUP)
(void)printf("*\n");
return((u_char *)NULL);
@@ -280,8 +276,7 @@ get()
length -= n;
if (!(need -= n)) {
if (vflag == ALL || vflag == FIRST ||
- valid_save == 0 ||
- bcmp(curp, savp, blocksize) != 0) {
+ bcmp(curp, savp, blocksize)) {
if (vflag == DUP || vflag == FIRST)
vflag = WAIT;
return(curp);
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index ff5e4203a0eb..4dba8d5336cc 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
#endif
static const char rcsid[] =
- "$Id: indent.c,v 1.2 1997/07/15 09:50:59 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -209,10 +209,10 @@ main(argc, argv)
set_option(argv[i]);
} /* end of for */
if (input == 0) {
- input = stdin;
+ usage();
}
if (output == 0)
- if (troff || input == stdin)
+ if (troff)
output = stdout;
else {
out_name = in_name;
@@ -1133,7 +1133,7 @@ check_type:
static void
usage()
{
- fprintf(stderr, "usage: indent [ file [ outfile ] ] [ options ]\n");
+ fprintf(stderr, "usage: indent file [ outfile ] [ options ]\n");
exit(1);
}
diff --git a/usr.bin/kdump/mkioctls b/usr.bin/kdump/mkioctls
index 837d24f49bd9..8ff0cd6f9548 100644
--- a/usr.bin/kdump/mkioctls
+++ b/usr.bin/kdump/mkioctls
@@ -1,62 +1,29 @@
-set -e
-
-# Build a list of headers that have ioctls in them.
# XXX should we use an ANSI cpp?
-# XXX netipx conflicts with netns (leave out netns).
-ioctl_includes=`
- cd $DESTDIR/usr/include
- find * -name '*.h' -follow |
- egrep -v '^(netns)/' |
- xargs egrep -l \
-'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-0_]*[ ]+_IO[^a-z0-9_]' |
- sed -e 's/^/#include </' -e s'/$/>/'
-`
-
-echo "$ioctl_includes" |
- cpp -I$DESTDIR/usr/include -dM |
- awk -v ioctl_includes="$ioctl_includes" '
+# XXX does -I$DESTDIR/usr/include actually work?
+(echo "#include <sys/ioctl.h>"
+ echo "#include <sys/ioctl_compat.h>"
+) | cpp -I$DESTDIR/usr/include -dM | awk '
BEGIN {
- print "/* XXX obnoxious prerequisites. */"
- print "#define COMPAT_43"
print "#include <sys/param.h>"
- print "#include <sys/device.h>"
- print "#include <sys/devicestat.h>"
- print "#include <sys/disklabel.h>"
- print "#include <sys/disk.h>"
- print "#include <sys/dkbad.h>"
+ print "#include <sys/queue.h>"
print "#include <sys/socket.h>"
+ print "#include <sys/socketvar.h>"
print "#include <sys/time.h>"
- print "#include <sys/tty.h>"
- print "#include <net/if.h>"
- print "#include <net/if_var.h>"
print "#include <net/route.h>"
- print "#include <netatm/atm.h>"
- print "#include <netatm/atm_if.h>"
- print "#include <netatm/atm_sap.h>"
- print "#include <netatm/atm_sys.h>"
+ print "#include <net/if.h>"
print "#include <netinet/in.h>"
- print "#include <netinet/ip_compat.h>"
- print "#include <netinet/ip_fil.h>"
- print "#include <netinet/ip_auth.h>"
- print "#include <netinet/ip_nat.h>"
- print "#include <netinet/ip_frag.h>"
print "#include <netinet/ip_mroute.h>"
- print "#include <netinet/ip_state.h>"
- print "#include <cam/cam.h>"
- print "#include <stdio.h>"
- print ""
- print ioctl_includes
+ print "#include <sys/termios.h>"
+ print "#define COMPAT_43"
+ print "#include <sys/ioctl.h>"
print ""
print "char *"
print "ioctlname(val)"
print "{"
print ""
- generate_case_statement = 0
- if (generate_case_statement)
- print "\tswitch(val) {"
}
-/^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO/ {
+/^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ {
# find where the name starts
for (i = 1; i <= NF; i++)
@@ -64,15 +31,10 @@ BEGIN {
break;
++i;
#
- if (generate_case_statement)
- printf("\tcase %s:\n\t\treturn(\"%s\");\n", $i, $i);
- else
- printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
+ printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
}
END {
- if (generate_case_statement)
- print "\t}"
print "\n\treturn(NULL);"
print "}"
}
diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc
index e1f400083ba9..28718c0a97b2 100644
--- a/usr.bin/locate/locate/locate.rc
+++ b/usr.bin/locate/locate/locate.rc
@@ -1,13 +1,13 @@
#
# /etc/locate.rc - command script for updatedb(8)
#
-# $Id: locate.rc,v 1.6 1998/03/08 16:09:26 wosch Exp $
+# $Id: locate.rc,v 1.5 1998/01/01 02:34:14 alex Exp $
#
# All commented values are the defaults
#
# temp directory
-#TMPDIR="/tmp"
+#TMPDIR="/var/tmp"
# the actual database
#FCODES="/var/db/locate.database"
diff --git a/usr.bin/locate/locate/mklocatedb.sh b/usr.bin/locate/locate/mklocatedb.sh
index 864760e87ec7..1268a06a69c0 100644
--- a/usr.bin/locate/locate/mklocatedb.sh
+++ b/usr.bin/locate/locate/mklocatedb.sh
@@ -28,7 +28,8 @@
#
# usage: mklocatedb [-presort] < filelist > database
#
-# $Id: mklocatedb.sh,v 1.7 1998/03/08 16:09:28 wosch Exp $
+# $Id: mklocatedb.sh,v 1.6 1998/03/08 15:28:35 wosch Exp $
+
# The directory containing locate subprograms
: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR
@@ -37,12 +38,8 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH
umask 077 # protect temp files
-: ${TMPDIR:=/tmp}; export TMPDIR
-test -d "$TMPDIR" || TMPDIR=/tmp
-if ! TMPDIR=`mktemp -d $TMPDIR/mklocateXXXXXX`; then
- exit 1
-fi
-
+: ${TMPDIR:=/var/tmp}; export TMPDIR
+test -d "$TMPDIR" || TMPDIR=/var/tmp
# utilities to built locate database
: ${bigram:=locate.bigram}
@@ -53,41 +50,23 @@ fi
sortopt="-u -T $TMPDIR"
sortcmd=$sort
+# Input already sorted
+case X"$1" in
+ X-nosort|X-presort) sortcmd=cat; sortopt=;shift;;
+esac
+
bigrams=$TMPDIR/_mklocatedb$$.bigrams
filelist=$TMPDIR/_mklocatedb$$.list
-trap 'rm -f $bigrams $filelist; rmdir $TMPDIR' 0 1 2 3 5 10 15
+trap 'rm -f $bigrams $filelist' 0 1 2 3 5 10 15
-# Input already sorted
-if [ X"$1" = "X-presort" ]; then
- shift;
-
- # create an empty file
- true > $bigrams
-
- # Locate database bootstrapping
- # 1. first build a temp database without bigram compression
- # 2. create the bigram from the temp database
- # 3. create the real locate database with bigram compression.
- #
- # This scheme avoid large temporary files in /tmp
-
- $code $bigrams > $filelist || exit 1
- locate -d $filelist / | $bigram | $sort -nr | head -128 |
- perl -ne '/^\s*[0-9]+\s(..)$/ && print $1 || exit 1' > $bigrams || exit 1
- locate -d $filelist / | $code $bigrams || exit 1
- exit
-
-else
- if $sortcmd $sortopt > $filelist; then
+if $sortcmd $sortopt > $filelist; then
$bigram < $filelist | $sort -nr |
- perl -ne '/^\s*[0-9]+\s(..)$/ && print $1 || exit 1' > $bigrams
- || exit 1
- $code $bigrams < $filelist || exit 1
- else
+ awk 'NR <= 128 { printf $2 }' > $bigrams &&
+ $code $bigrams < $filelist
+else
echo "`basename $0`: cannot build locate database" >&2
exit 1
- fi
fi
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh
index 29c30bc902d5..97c586badd88 100644
--- a/usr.bin/locate/locate/updatedb.sh
+++ b/usr.bin/locate/locate/updatedb.sh
@@ -26,7 +26,7 @@
#
# updatedb - update locate database for local mounted filesystems
#
-# $Id: updatedb.sh,v 1.11 1998/06/18 09:26:22 wosch Exp $
+# $Id: updatedb.sh,v 1.10 1998/03/08 16:09:31 wosch Exp $
LOCATE_CONFIG="/etc/locate.rc"
if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then
@@ -35,8 +35,9 @@ fi
# The directory containing locate subprograms
: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR
-: ${TMPDIR:=/tmp}; export TMPDIR
-if ! TMPDIR=`mktemp -d $TMPDIR/locateXXXXXX`; then
+: ${TMPDIR:=/var/tmp}; export TMPDIR
+if TMPDIR=`mktemp -d $TMPDIR/locateXXXXXX`; then :
+else
exit 1
fi
@@ -73,12 +74,12 @@ case X"$PRUNEPATHS" in
esac
tmp=$TMPDIR/_updatedb$$
-trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15
+trap 'rm -f $tmp' 0 1 2 3 5 10 15
# search locally
# echo $find $SEARCHPATHS $excludes -or -print && exit
-if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null |
- $mklocatedb -presort > $tmp
+if $find $SEARCHPATHS $excludes -or -print 2>/dev/null |
+ $mklocatedb > $tmp
then
case X"`$find $tmp -size -257c -print`" in
X) cat $tmp > $FCODES;;
@@ -86,4 +87,5 @@ then
exit 1
esac
fi
-echo $?
+rm -f $tmp
+rmdir $TMPDIR
diff --git a/usr.bin/login/Makefile b/usr.bin/login/Makefile
index 5d77ec850464..71fa73e5f569 100644
--- a/usr.bin/login/Makefile
+++ b/usr.bin/login/Makefile
@@ -1,21 +1,29 @@
# From: @(#)Makefile 8.1 (Berkeley) 7/19/93
-# $Id: Makefile,v 1.26 1999/01/19 22:59:37 abial Exp $
+# $Id: Makefile,v 1.20 1998/08/06 21:37:04 markm Exp $
PROG= login
MAN1= login.1
MAN5= login.access.5
SRCS= login.c login_access.c login_fbtab.c
-CFLAGS+=-Wall -DLOGIN_ACCESS -DLOGALL
+#Uncomment to activate login_auth
+#Warning: requires src/libexec/login_* auth modules
+#LC_AUTH=-DLOGIN_CAP_AUTH
+CFLAGS+=-Wall -DSKEY -DLOGIN_ACCESS -DLOGALL -DLOGIN_CAP $(LC_AUTH)
-DPADD= ${LIBUTIL} ${LIBCRYPT}
-LDADD= -lutil -lcrypt
+.if defined(KLOGIN_PARANOID)
+CFLAGS+=-DKLOGIN_PARANOID
+.endif
+
+DPADD= ${LIBUTIL} ${LIBSKEY} ${LIBMD} ${LIBCRYPT}
+LDADD= -lutil -lskey -lmd -lcrypt
-.if defined(NOPAM)
-CFLAGS+= -DNO_PAM
-.else
-DPADD+= ${LIBPAM}
-LDADD+= ${MINUSLPAM}
+.if exists(${DESTDIR}${LIBDIR}/libkrb.a) && defined(MAKE_KERBEROS4) && !defined(LC_AUTH)
+CFLAGS+=-DKERBEROS
+SRCS+= klogin.c
+DPADD+= ${LIBKRB} ${LIBDES}
+LDADD+= -lkrb -ldes
+DISTRIBUTION= krb
.endif
BINMODE=4555
diff --git a/usr.bin/login/klogin.c b/usr.bin/login/klogin.c
new file mode 100644
index 000000000000..7c61b84a9cb7
--- /dev/null
+++ b/usr.bin/login/klogin.c
@@ -0,0 +1,204 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 lint
+static const char sccsid[] = "@(#)klogin.c 8.3 (Berkeley) 4/2/94";
+#endif /* not lint */
+
+#ifdef KERBEROS
+#include <sys/param.h>
+#include <sys/syslog.h>
+#include <des.h>
+#include <krb.h>
+
+#include <err.h>
+#include <netdb.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define INITIAL_TICKET "krbtgt"
+#define VERIFY_SERVICE "rcmd"
+
+extern int notickets;
+extern char *krbtkfile_env;
+
+/*
+ * Attempt to log the user in using Kerberos authentication
+ *
+ * return 0 on success (will be logged in)
+ * 1 if Kerberos failed (try local password in login)
+ */
+int
+klogin(pw, instance, localhost, password)
+ struct passwd *pw;
+ char *instance, *localhost, *password;
+{
+ int kerror;
+ char realm[REALM_SZ], savehost[MAXHOSTNAMELEN];
+ char tkt_location[MAXPATHLEN];
+ char *krb_get_phost();
+ extern int noticketsdontcomplain;
+
+#ifdef KLOGIN_PARANOID
+ AUTH_DAT authdata;
+ KTEXT_ST ticket;
+ struct hostent *hp;
+ unsigned long faddr;
+
+ noticketsdontcomplain = 0; /* enable warning message */
+#endif
+
+ /*
+ * Root logins don't use Kerberos.
+ * If we have a realm, try getting a ticket-granting ticket
+ * and using it to authenticate. Otherwise, return
+ * failure so that we can try the normal passwd file
+ * for a password. If that's ok, log the user in
+ * without issuing any tickets.
+ */
+ if (strcmp(pw->pw_name, "root") == 0 ||
+ krb_get_lrealm(realm, 0) != KSUCCESS)
+ return (1);
+
+ noticketsdontcomplain = 0; /* enable warning message */
+
+ /*
+ * get TGT for local realm
+ * tickets are stored in a file named TKT_ROOT plus uid
+ * except for user.root tickets.
+ */
+
+ if (strcmp(instance, "root") != 0)
+ (void)sprintf(tkt_location, "%s%d", TKT_ROOT, pw->pw_uid);
+ else {
+ (void)sprintf(tkt_location, "%s_root_%d", TKT_ROOT, pw->pw_uid);
+ krbtkfile_env = tkt_location;
+ }
+ (void)krb_set_tkt_string(tkt_location);
+
+ /*
+ * Set real as well as effective ID to 0 for the moment,
+ * to make the kerberos library do the right thing.
+ */
+ if (setuid(0) < 0) {
+ warnx("setuid");
+ return (1);
+ }
+ kerror = krb_get_pw_in_tkt(pw->pw_name, instance,
+ realm, INITIAL_TICKET, realm, DEFAULT_TKT_LIFE, password);
+
+ /*
+ * If we got a TGT, get a local "rcmd" ticket and check it so as to
+ * ensure that we are not talking to a bogus Kerberos server.
+ *
+ * There are 2 cases where we still allow a login:
+ * 1: the VERIFY_SERVICE doesn't exist in the KDC
+ * 2: local host has no srvtab, as (hopefully) indicated by a
+ * return value of RD_AP_UNDEC from krb_rd_req().
+ */
+ if (kerror != INTK_OK) {
+ if (kerror != INTK_BADPW && kerror != KDC_PR_UNKNOWN) {
+ syslog(LOG_ERR, "Kerberos intkt error: %s",
+ krb_err_txt[kerror]);
+ dest_tkt();
+ }
+ return (1);
+ }
+
+ if (chown(TKT_FILE, pw->pw_uid, pw->pw_gid) < 0)
+ syslog(LOG_ERR, "chown tkfile (%s): %m", TKT_FILE);
+
+ (void)strncpy(savehost, krb_get_phost(localhost), sizeof(savehost));
+ savehost[sizeof(savehost)-1] = NULL;
+
+#ifdef KLOGIN_PARANOID
+ /*
+ * if the "VERIFY_SERVICE" doesn't exist in the KDC for this host,
+ * still allow login with tickets, but log the error condition.
+ */
+
+ kerror = krb_mk_req(&ticket, VERIFY_SERVICE, savehost, realm, 33);
+ if (kerror == KDC_PR_UNKNOWN) {
+ syslog(LOG_NOTICE,
+ "warning: TGT not verified (%s); %s.%s not registered, or srvtab is wrong?",
+ krb_err_txt[kerror], VERIFY_SERVICE, savehost);
+ notickets = 0;
+ return (0);
+ }
+
+ if (kerror != KSUCCESS) {
+ warnx("unable to use TGT: (%s)", krb_err_txt[kerror]);
+ syslog(LOG_NOTICE, "unable to use TGT: (%s)",
+ krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+ }
+
+ if (!(hp = gethostbyname(localhost))) {
+ syslog(LOG_ERR, "couldn't get local host address");
+ dest_tkt();
+ return (1);
+ }
+
+ memmove((void *)&faddr, (void *)hp->h_addr, sizeof(faddr));
+
+ kerror = krb_rd_req(&ticket, VERIFY_SERVICE, savehost, faddr,
+ &authdata, "");
+
+ if (kerror == KSUCCESS) {
+ notickets = 0;
+ return (0);
+ }
+
+ /* undecipherable: probably didn't have a srvtab on the local host */
+ if (kerror == RD_AP_UNDEC) {
+ syslog(LOG_NOTICE, "krb_rd_req: (%s)\n", krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+ }
+ /* failed for some other reason */
+ warnx("unable to verify %s ticket: (%s)", VERIFY_SERVICE,
+ krb_err_txt[kerror]);
+ syslog(LOG_NOTICE, "couldn't verify %s ticket: %s", VERIFY_SERVICE,
+ krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+#else
+ notickets = 0;
+ return (0);
+#endif
+}
+#endif
diff --git a/usr.bin/login/login.1 b/usr.bin/login/login.1
index 8c1ef2adb02c..b373bb1a758c 100644
--- a/usr.bin/login/login.1
+++ b/usr.bin/login/login.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)login.1 8.2 (Berkeley) 5/5/94
-.\" $Id: login.1,v 1.12 1998/12/01 17:05:08 dillon Exp $
+.\" $Id: login.1,v 1.10 1998/01/07 10:42:57 obrien Exp $
.\"
.Dd May 5, 1994
.Dt LOGIN 1
@@ -81,7 +81,7 @@ option disables this behavior.
.El
.Pp
If the file
-.Pa /var/run/nologin
+.Pa /etc/nologin
exists,
.Nm
displays its contents to the user and exits.
@@ -160,7 +160,7 @@ login access control table
login class capabilities database
.It Pa /etc/motd
message-of-the-day
-.It Pa /var/run/nologin
+.It Pa /etc/nologin
disallows logins
.It Pa /etc/skey.access
skey password control table
@@ -191,8 +191,7 @@ configure authentication services
.Xr skey.access 5 ,
.Xr utmp 5 ,
.Xr environ 7 ,
-.Xr nologin 8 ,
-.Xr pam 8
+.Xr nologin 8
.Sh HISTORY
A
.Nm
diff --git a/usr.bin/login/login.access.5 b/usr.bin/login/login.access.5
index d8630966dd97..fdd148614855 100644
--- a/usr.bin/login/login.access.5
+++ b/usr.bin/login/login.access.5
@@ -45,7 +45,6 @@ file resides in
.Pa /etc .
.El
.Sh SEE ALSO
-.Xr login 1 ,
-.Xr pam 8
+.Xr login 1
.Sh AUTHORS
.An Guido van Rooij
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index 3ee0c749b8b8..fc36cb013a70 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -42,7 +42,7 @@ static char copyright[] =
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: login.c,v 1.44 1999/01/03 23:39:33 eivind Exp $";
+ "$Id: login.c,v 1.38 1998/08/17 03:25:07 jkoshy Exp $";
#endif /* not lint */
/*
@@ -64,7 +64,6 @@ static const char rcsid[] =
#include <errno.h>
#include <grp.h>
#include <libutil.h>
-#include <login_cap.h>
#include <netdb.h>
#include <pwd.h>
#include <setjmp.h>
@@ -77,11 +76,29 @@ static const char rcsid[] =
#include <unistd.h>
#include <utmp.h>
-#ifndef NO_PAM
-#include <security/pam_appl.h>
-#include <security/pam_misc.h>
+#ifdef LOGIN_CAP
+#include <login_cap.h>
+#else /* Undef AUTH as well */
+#undef LOGIN_CAP_AUTH
#endif
+/*
+ * If LOGIN_CAP_AUTH is activated:
+ * kerberose & skey logins are runtime selected via login
+ * login_getstyle() and authentication types for login classes
+ * The actual login itself is handled via /usr/libexec/login_<style>
+ * Valid styles are determined by the auth-type=style,style entries
+ * in the login class.
+ */
+#ifdef LOGIN_CAP_AUTH
+#undef KERBEROS
+#undef SKEY
+#endif /* LOGIN_CAP_AUTH */
+
+#ifdef SKEY
+#include <skey.h>
+#endif /* SKEY */
+
#include "pathnames.h"
void badlogin __P((char *));
@@ -97,12 +114,12 @@ char *stypeof __P((char *));
void timedout __P((int));
int login_access __P((char *, char *));
void login_fbtab __P((char *, uid_t, gid_t));
-
-#ifndef NO_PAM
-static int auth_pam __P((void));
+#ifdef KERBEROS
+int klogin __P((struct passwd *, char *, char *, char *));
#endif
-static int auth_traditional __P((void));
+
extern void login __P((struct utmp *));
+extern void trimdomain __P((char *, int));
static void usage __P((void));
#define TTYGRPNAME "tty" /* name of group to own ttys */
@@ -115,8 +132,13 @@ static void usage __P((void));
*/
u_int timeout = 300;
-/* Buffer for signal handling of timeout */
-jmp_buf timeout_buf;
+#ifdef KERBEROS
+int notickets = 1;
+int noticketsdontcomplain = 1;
+char *instance;
+char *krbtkfile_env;
+int authok;
+#endif
struct passwd *pwd;
int failures;
@@ -138,24 +160,30 @@ main(argc, argv)
int changepass;
time_t warntime;
uid_t uid, euid;
- char *domain, *p, *ttyn;
- char tbuf[MAXPATHLEN + 2];
- char tname[sizeof(_PATH_TTY) + 10];
+ char *domain, *p, *ep, *salt, *ttyn;
+ char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
char localhost[MAXHOSTNAMELEN];
char *shell = NULL;
+#ifdef LOGIN_CAP
login_cap_t *lc = NULL;
+#ifdef LOGIN_CAP_AUTH
+ char *style, *authtype;
+ char *auth_method = NULL;
+ char *instance = NULL;
+ int authok;
+#endif /* LOGIN_CAP_AUTH */
+#endif /* LOGIN_CAP */
+#ifdef SKEY
+ int permit_passwd = 0;
+#endif /* SKEY */
+#ifdef KERBEROS
+ char *k;
+#endif
- (void)signal(SIGQUIT, SIG_IGN);
- (void)signal(SIGINT, SIG_IGN);
- if (setjmp(timeout_buf)) {
- if (failures)
- badlogin(tbuf);
- (void)fprintf(stderr,
- "Login timed out after %d seconds\n", timeout);
- exit(0);
- }
(void)signal(SIGALRM, timedout);
(void)alarm(timeout);
+ (void)signal(SIGQUIT, SIG_IGN);
+ (void)signal(SIGINT, SIG_IGN);
(void)setpriority(PRIO_PROCESS, 0, 0);
openlog("login", LOG_ODELAY, LOG_AUTH);
@@ -237,6 +265,10 @@ main(argc, argv)
else
tty = ttyn;
+#ifdef LOGIN_CAP_AUTH
+ authtype = hostname ? "rlogin" : "login";
+#endif
+#ifdef LOGIN_CAP
/*
* Get "login-retries" & "login-backoff" from default class
*/
@@ -245,6 +277,10 @@ main(argc, argv)
backoff = login_getcapnum(lc, "login-backoff", DEFAULT_BACKOFF, DEFAULT_BACKOFF);
login_close(lc);
lc = NULL;
+#else
+ retries = DEFAULT_RETRIES;
+ backoff = DEFAULT_BACKOFF;
+#endif
for (cnt = 0;; ask = 1) {
if (ask) {
@@ -253,6 +289,34 @@ main(argc, argv)
}
rootlogin = 0;
rootok = rootterm(tty); /* Default (auth may change) */
+#ifdef LOGIN_CAP_AUTH
+ authok = 0;
+ if (auth_method = strchr(username, ':')) {
+ *auth_method = '\0';
+ auth_method++;
+ if (*auth_method == '\0')
+ auth_method = NULL;
+ }
+ /*
+ * We need to do this regardless of whether
+ * kerberos is available.
+ */
+ if ((instance = strchr(username, '.')) != NULL) {
+ if (strncmp(instance, ".root", 5) == 0)
+ rootlogin = 1;
+ *instance++ = '\0';
+ } else
+ instance = "";
+#else /* !LOGIN_CAP_AUTH */
+#ifdef KERBEROS
+ if ((instance = strchr(username, '.')) != NULL) {
+ if (strncmp(instance, ".root", 5) == 0)
+ rootlogin = 1;
+ *instance++ = '\0';
+ } else
+ instance = "";
+#endif /* KERBEROS */
+#endif /* LOGIN_CAP_AUTH */
if (strlen(username) > UT_NAMESIZE)
username[UT_NAMESIZE] = '\0';
@@ -265,11 +329,27 @@ main(argc, argv)
if (failures && strcmp(tbuf, username)) {
if (failures > (pwd ? 0 : 1))
badlogin(tbuf);
+ failures = 0;
}
(void)strncpy(tbuf, username, sizeof tbuf-1);
tbuf[sizeof tbuf-1] = '\0';
- pwd = getpwnam(username);
+ if ((pwd = getpwnam(username)) != NULL)
+ salt = pwd->pw_passwd;
+ else
+ salt = "xx";
+
+#ifdef LOGIN_CAP
+ /*
+ * Establish the class now, before we might goto
+ * within the next block. pwd can be NULL since it
+ * falls back to the "default" class if it is.
+ */
+ if (pwd != NULL)
+ (void)seteuid(rootlogin ? 0 : pwd->pw_uid);
+ lc = login_getpwclass(pwd);
+ seteuid(euid);
+#endif /* LOGIN_CAP */
/*
* if we have a valid account name, and it doesn't have a
@@ -277,6 +357,7 @@ main(argc, argv)
* is root or the caller isn't changing their uid, don't
* authenticate.
*/
+ rval = 1;
if (pwd != NULL) {
if (pwd->pw_uid == 0)
rootlogin = 1;
@@ -298,35 +379,139 @@ main(argc, argv)
(void)setpriority(PRIO_PROCESS, 0, -4);
-#ifndef NO_PAM
+#ifdef LOGIN_CAP_AUTH
/*
- * Try to authenticate using PAM. If a PAM system error
- * occurs, perhaps because of a botched configuration,
- * then fall back to using traditional Unix authentication.
+ * This hands off authorization to an authorization program,
+ * depending on the styles available for the "auth-login",
+ * auth-rlogin (or default) authorization styles.
+ * We do this regardless of whether an account exists so that
+ * the remote user cannot tell a "real" from an invented
+ * account name. If we don't have an account we just fall
+ * back to the first method for the "default" class.
*/
- if ((rval = auth_pam()) == -1)
-#endif /* NO_PAM */
- rval = auth_traditional();
+ if (!(style = login_getstyle(lc, auth_method, authtype))) {
+
+ /*
+ * No available authorization method
+ */
+ rval = 1;
+ (void)printf("No auth method available for %s.\n",
+ authtype);
+ } else {
+
+ /*
+ * Put back the kerberos instance, if any was given.
+ * Don't worry about the non-kerberos case here, since
+ * if kerberos is not available or not selected and an
+ * instance is given at the login prompt, su or rlogin -l,
+ * then anything else should fail as well.
+ */
+ if (*instance)
+ *(instance - 1) = '.';
+
+ rval = authenticate(username,
+ lc ? lc->lc_class : "default",
+ style, authtype);
+ /* Junk it again */
+ if (*instance)
+ *(instance - 1) = '\0';
+ }
- (void)setpriority(PRIO_PROCESS, 0, 0);
+ if (!rval) {
+ char * approvep;
+
+ /*
+ * If authentication succeeds, run any approval
+ * program, if applicable for this class.
+ */
+ approvep = login_getcapstr(lc, "approve", NULL, NULL);
+ rval = 1; /* Assume bad login again */
+
+ if (approvep==NULL ||
+ auth_script(approvep, approvep, username,
+ lc->lc_class, 0) == 0) {
+ int r;
+
+ r = auth_scan(AUTH_OKAY);
+ /*
+ * See what the authorize program says
+ */
+ if (r != 0) {
+ rval = 0;
-#ifndef NO_PAM
- /*
- * PAM authentication may have changed "pwd" to the
- * entry for the template user. Check again to see if
- * this is a root login after all.
- */
- if (pwd != NULL && pwd->pw_uid == 0)
- rootlogin = 1;
-#endif /* NO_PAM */
+ if (!rootok && (r & AUTH_ROOTOKAY))
+ rootok = 1; /* root approved */
+ else
+ rootlogin = 0;
+
+ if (!authok && (r & AUTH_SECURE))
+ authok = 1; /* secure */
+ }
+ }
+ }
+#else /* !LOGIN_CAP_AUTH */
+#ifdef SKEY
+ permit_passwd = skeyaccess(username, tty,
+ hostname ? full_hostname : NULL,
+ NULL);
+ p = skey_getpass("Password:", pwd, permit_passwd);
+ ep = skey_crypt(p, salt, pwd, permit_passwd);
+#else /* !SKEY */
+ p = getpass("Password:");
+ ep = crypt(p, salt);
+#endif/* SKEY */
+
+ if (pwd) {
+ if (!p[0] && pwd->pw_passwd[0])
+ ep = ":";
+#ifdef KERBEROS
+#ifdef SKEY
+ /*
+ * Do not allow user to type in kerberos password
+ * over the net (actually, this is ok for encrypted
+ * links, but we have no way of determining if the
+ * link is encrypted.
+ */
+ if (!permit_passwd) {
+ rval = 1; /* failed */
+ } else
+#endif /* SKEY */
+ rval = 1;
+ k = auth_getval("auth_list");
+ if (k && strstr(k, "kerberos"))
+ rval = klogin(pwd, instance, localhost, p);
+ if (rval != 0 && rootlogin && pwd->pw_uid != 0)
+ rootlogin = 0;
+ if (rval == 0)
+ authok = 1; /* kerberos authenticated ok */
+ else if (rval == 1) /* fallback to unix passwd */
+ rval = strcmp(ep, pwd->pw_passwd);
+#else /* !KERBEROS */
+ rval = strcmp(ep, pwd->pw_passwd);
+#endif /* KERBEROS */
+ }
+ /* clear entered password */
+ memset(p, 0, strlen(p));
+#endif /* LOGIN_CAP_AUTH */
+
+ (void)setpriority(PRIO_PROCESS, 0, 0);
+
+#ifdef LOGIN_CAP_AUTH
+ if (rval)
+ auth_rmfiles();
+#endif
ttycheck:
/*
* If trying to log in as root without Kerberos,
* but with insecure terminal, refuse the login attempt.
*/
if (pwd && !rval) {
+#if defined(KERBEROS) || defined(LOGIN_CAP_AUTH)
+ if (authok == 0 && rootlogin && !rootok)
+#else
if (rootlogin && !rootok)
+#endif
refused(NULL, "NOROOT", 0);
else /* valid password & authenticated */
break;
@@ -353,22 +538,26 @@ main(argc, argv)
endpwent();
- /*
- * Establish the login class.
- */
- (void)seteuid(rootlogin ? 0 : pwd->pw_uid);
- lc = login_getpwclass(pwd);
- seteuid(euid);
-
/* if user not super-user, check for disabled logins */
+#ifdef LOGIN_CAP
if (!rootlogin)
auth_checknologin(lc);
+#else
+ if (!rootlogin)
+ checknologin();
+#endif
+#ifdef LOGIN_CAP
quietlog = login_getcapbool(lc, "hushlogin", 0);
+#else
+ quietlog = 0;
+#endif
(void)seteuid(rootlogin ? 0 : pwd->pw_uid);
if (!*pwd->pw_dir || chdir(pwd->pw_dir) < 0) {
+#ifdef LOGIN_CAP
if (login_getcapbool(lc, "requirehome", 0))
refused("Home directory not available", "HOMEDIR", 1);
+#endif
if (chdir("/") < 0)
refused("Cannot find root directory", "ROOTDIR", 1);
pwd->pw_dir = "/";
@@ -384,8 +573,12 @@ main(argc, argv)
#define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */
+#ifdef LOGIN_CAP
warntime = login_getcaptime(lc, "warnpassword",
DEFAULT_WARN, DEFAULT_WARN);
+#else
+ warntime = DEFAULT_WARN;
+#endif
changepass=0;
if (pwd->pw_change) {
@@ -400,8 +593,12 @@ main(argc, argv)
ctime(&pwd->pw_change));
}
+#ifdef LOGIN_CAP
warntime = login_getcaptime(lc, "warnexpire",
DEFAULT_WARN, DEFAULT_WARN);
+#else
+ warntime = DEFAULT_WARN;
+#endif
if (pwd->pw_expire) {
if (tp.tv_sec >= pwd->pw_expire) {
@@ -412,6 +609,7 @@ main(argc, argv)
ctime(&pwd->pw_expire));
}
+#ifdef LOGIN_CAP
if (lc != NULL) {
if (hostname) {
struct hostent *hp = gethostbyname(full_hostname);
@@ -434,6 +632,9 @@ main(argc, argv)
refused("Logins not available right now", "TIME", 1);
}
shell=login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell);
+#else /* !LOGIN_CAP */
+ shell=pwd->pw_shell;
+#endif /* LOGIN_CAP */
if (*pwd->pw_shell == '\0')
pwd->pw_shell = _PATH_BSHELL;
if (*shell == '\0') /* Not overridden */
@@ -483,6 +684,11 @@ main(argc, argv)
if (hostname==NULL && isdialuptty(tty))
syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name);
+#ifdef KERBEROS
+ if (!quietlog && notickets == 1 && !noticketsdontcomplain)
+ (void)printf("Warning: no Kerberos tickets issued.\n");
+#endif
+
#ifdef LOGALL
/*
* Syslog each successful login, so we don't have to watch hundreds
@@ -521,15 +727,19 @@ main(argc, argv)
* We don't need to be root anymore, so
* set the user and session context
*/
- if (setlogin(username) != 0) {
- syslog(LOG_ERR, "setlogin(%s): %m - exiting", username);
- exit(1);
- }
- if (setusercontext(lc, pwd, pwd->pw_uid,
- LOGIN_SETALL & ~LOGIN_SETLOGIN) != 0) {
+#ifdef LOGIN_CAP
+ if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETALL) != 0) {
syslog(LOG_ERR, "setusercontext() failed - exiting");
exit(1);
}
+#else
+ if (setlogin(pwd->pw_name) < 0)
+ syslog(LOG_ERR, "setlogin() failure: %m");
+
+ (void)setgid(pwd->pw_gid);
+ initgroups(username, pwd->pw_gid);
+ (void)setuid(rootlogin ? 0 : pwd->pw_uid);
+#endif
(void)setenv("SHELL", pwd->pw_shell, 1);
(void)setenv("HOME", pwd->pw_dir, 1);
@@ -538,10 +748,18 @@ main(argc, argv)
else {
(void)setenv("TERM", stypeof(tty), 0); /* Fallback doesn't */
}
- (void)setenv("LOGNAME", username, 1);
- (void)setenv("USER", username, 1);
+ (void)setenv("LOGNAME", pwd->pw_name, 1);
+ (void)setenv("USER", pwd->pw_name, 1);
(void)setenv("PATH", rootlogin ? _PATH_STDPATH : _PATH_DEFPATH, 0);
+#ifdef KERBEROS
+ if (krbtkfile_env)
+ (void)setenv("KRBTKFILE", krbtkfile_env, 1);
+#endif
+#if LOGIN_CAP_AUTH
+ auth_env();
+#endif
+#ifdef LOGIN_CAP
if (!quietlog) {
char *cw;
@@ -568,12 +786,24 @@ main(argc, argv)
} else
snprintf(tbuf, sizeof(tbuf), "%s/%s",
_PATH_MAILDIR, pwd->pw_name);
+#else
+ if (!quietlog) {
+ (void)printf("%s\n\t%s %s\n",
+ "Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994",
+ "The Regents of the University of California. ",
+ "All rights reserved.");
+ motd(_PATH_MOTDFILE);
+ snprintf(tbuf, sizeof(tbuf), "%s/%s",
+ _PATH_MAILDIR, pwd->pw_name);
+#endif
if (stat(tbuf, &st) == 0 && st.st_size != 0)
(void)printf("You have %smail.\n",
(st.st_mtime > st.st_atime) ? "new " : "");
}
+#ifdef LOGIN_CAP
login_close(lc);
+#endif
(void)signal(SIGALRM, SIG_DFL);
(void)signal(SIGQUIT, SIG_DFL);
@@ -595,116 +825,6 @@ main(argc, argv)
err(1, "%s", shell);
}
-static int
-auth_traditional()
-{
- int rval;
- char *p;
- char *ep;
- char *salt;
-
- rval = 1;
- salt = pwd != NULL ? pwd->pw_passwd : "xx";
-
- p = getpass("Password:");
- ep = crypt(p, salt);
-
- if (pwd) {
- if (!p[0] && pwd->pw_passwd[0])
- ep = ":";
- if (strcmp(ep, pwd->pw_passwd) == 0)
- rval = 0;
- }
-
- /* clear entered password */
- memset(p, 0, strlen(p));
- return rval;
-}
-
-#ifndef NO_PAM
-/*
- * Attempt to authenticate the user using PAM. Returns 0 if the user is
- * authenticated, or 1 if not authenticated. If some sort of PAM system
- * error occurs (e.g., the "/etc/pam.conf" file is missing) then this
- * function returns -1. This can be used as an indication that we should
- * fall back to a different authentication mechanism.
- */
-static int
-auth_pam()
-{
- pam_handle_t *pamh = NULL;
- const char *tmpl_user;
- const void *item;
- int rval;
- int e;
- static struct pam_conv conv = { misc_conv, NULL };
-
- if ((e = pam_start("login", username, &conv, &pamh)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_start: %s", pam_strerror(pamh, e));
- return -1;
- }
- if ((e = pam_set_item(pamh, PAM_TTY, tty)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_set_item(PAM_TTY): %s",
- pam_strerror(pamh, e));
- return -1;
- }
- if (hostname != NULL &&
- (e = pam_set_item(pamh, PAM_RHOST, full_hostname)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_set_item(PAM_RHOST): %s",
- pam_strerror(pamh, e));
- return -1;
- }
- e = pam_authenticate(pamh, 0);
- switch (e) {
-
- case PAM_SUCCESS:
- /*
- * With PAM we support the concept of a "template"
- * user. The user enters a login name which is
- * authenticated by PAM, usually via a remote service
- * such as RADIUS or TACACS+. If authentication
- * succeeds, a different but related "template" name
- * is used for setting the credentials, shell, and
- * home directory. The name the user enters need only
- * exist on the remote authentication server, but the
- * template name must be present in the local password
- * database.
- *
- * This is supported by two various mechanisms in the
- * individual modules. However, from the application's
- * point of view, the template user is always passed
- * back as a changed value of the PAM_USER item.
- */
- if ((e = pam_get_item(pamh, PAM_USER, &item)) ==
- PAM_SUCCESS) {
- tmpl_user = (const char *) item;
- if (strcmp(username, tmpl_user) != 0)
- pwd = getpwnam(tmpl_user);
- } else
- syslog(LOG_ERR, "Couldn't get PAM_USER: %s",
- pam_strerror(pamh, e));
- rval = 0;
- break;
-
- case PAM_AUTH_ERR:
- case PAM_USER_UNKNOWN:
- case PAM_MAXTRIES:
- rval = 1;
- break;
-
- default:
- syslog(LOG_ERR, "auth_pam: %s", pam_strerror(pamh, e));
- rval = -1;
- break;
- }
- if ((e = pam_end(pamh, e)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_end: %s", pam_strerror(pamh, e));
- rval = -1;
- }
- return rval;
-}
-#endif /* NO_PAM */
-
static void
usage()
{
@@ -789,9 +909,24 @@ void
timedout(signo)
int signo;
{
- longjmp(timeout_buf, signo);
+ (void)fprintf(stderr, "Login timed out after %d seconds\n", timeout);
+ exit(0);
}
+#ifndef LOGIN_CAP
+void
+checknologin()
+{
+ int fd, nchars;
+ char tbuf[8192];
+
+ if ((fd = open(_PATH_NOLOGIN, O_RDONLY, 0)) >= 0) {
+ while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0)
+ (void)write(fileno(stdout), tbuf, nchars);
+ sleepexit(0);
+ }
+}
+#endif
void
dolastlog(quiet)
@@ -848,7 +983,6 @@ badlogin(name)
"%d LOGIN FAILURE%s ON %s, %s",
failures, failures > 1 ? "S" : "", tty, name);
}
- failures = 0;
}
#undef UNKNOWN
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index 30b0c24f205d..0a29bee8ce8d 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -1,5 +1,5 @@
.\"
-.\" @(#) $Id: m4.1,v 1.6 1998/06/26 14:25:18 rnordier Exp $
+.\" @(#) $Id: m4.1,v 1.5 1998/03/23 07:44:42 charnier Exp $
.\"
.Dd January 26, 1993
.Dt m4 1
@@ -64,7 +64,7 @@ comments are turned off. The maximum length for a comment marker is
five characters.
.It changequote
Defines the quote symbols to be the first and second arguments.
-Note, only the first character of each argument is used. If no arguments are
+The symbols may be up to five characters long. If no arguments are
given it restores the default open and close single quotes.
.It decr
Decrements the argument by 1. The argument must be a valid numeric string.
diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c
index 2f24f31c80e5..f27b959fd50e 100644
--- a/usr.bin/mail/strings.c
+++ b/usr.bin/mail/strings.c
@@ -64,8 +64,8 @@ salloc(size)
int index;
s = size;
- s += (sizeof (char *) - 1);
- s &= ~(sizeof (char *) - 1);
+ s += 3;
+ s &= ~03;
index = 0;
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index aa42d585369f..d7451fc14dae 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: job.c,v 1.10 1998/08/24 10:15:53 cracauer Exp $
+ * $Id: job.c,v 1.9 1998/06/04 05:48:57 bde Exp $
*/
#ifndef lint
@@ -2423,7 +2423,7 @@ Job_Init(maxproc, maxlocal)
lastNode = NILGNODE;
- if (maxJobs == 1 || beVerbose == 0
+ if (maxJobs == 1
#ifdef REMOTE
|| noMessages
#endif
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 02447e5c42c6..63dbe1acea14 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.28 1998/11/14 16:15:04 dg Exp $";
+ "$Id: main.c,v 1.25 1998/07/26 17:06:05 imp Exp $";
#endif /* not lint */
/*-
@@ -133,7 +133,6 @@ Boolean touchFlag; /* -t flag */
Boolean usePipes; /* !-P flag */
Boolean ignoreErrors; /* -i flag */
Boolean beSilent; /* -s flag */
-Boolean beVerbose; /* -v flag */
Boolean oldVars; /* variable substitution style */
Boolean checkEnvFirst; /* -e flag */
static Boolean jobsRunning; /* TRUE if the jobs might be running */
@@ -172,9 +171,9 @@ MainParseArgs(argc, argv)
optind = 1; /* since we're called more than once */
#ifdef REMOTE
-# define OPTFLAGS "BD:I:L:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "BD:I:L:PSV:d:ef:ij:km:nqrst"
#else
-# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst"
#endif
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
switch(c) {
@@ -321,10 +320,6 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
touchFlag = TRUE;
Var_Append(MAKEFLAGS, "-t", VAR_GLOBAL);
break;
- case 'v':
- beVerbose = TRUE;
- Var_Append(MAKEFLAGS, "-v", VAR_GLOBAL);
- break;
default:
case '?':
usage();
@@ -439,12 +434,8 @@ main(argc, argv)
{
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
- struct stat sa;
- char *p, *p1, *path, *pathp;
-#ifdef WANT_ENV_PWD
- struct stat sb;
- char *pwd;
-#endif
+ struct stat sb, sa;
+ char *p, *p1, *path, *pathp, *pwd;
char mdpath[MAXPATHLEN + 1];
char obpath[MAXPATHLEN + 1];
char cdpath[MAXPATHLEN + 1];
@@ -479,13 +470,11 @@ main(argc, argv)
if (stat(curdir, &sa) == -1)
err(2, "%s", curdir);
-#ifdef WANT_ENV_PWD
if ((pwd = getenv("PWD")) != NULL) {
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
sa.st_dev == sb.st_dev)
(void) strcpy(curdir, pwd);
}
-#endif
#if defined(__i386__)
/*
@@ -569,9 +558,7 @@ main(argc, argv)
objdir = curdir;
}
-#ifdef WANT_ENV_PWD
setenv("PWD", objdir, 1);
-#endif
create = Lst_Init(FALSE);
makefiles = Lst_Init(FALSE);
@@ -1273,7 +1260,7 @@ static void
usage()
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
-"usage: make [-Beiknqrstv] [-D variable] [-d flags] [-f makefile]",
+"usage: make [-Beiknqrst] [-D variable] [-d flags] [-f makefile ]",
" [-I directory] [-j max_jobs] [-m directory] [-V variable]",
" [variable=value] [target ...]");
exit(2);
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index e4f86fba1dbb..89a1e3fec902 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
-.\" $Id: make.1,v 1.15 1998/11/15 05:51:55 bde Exp $
+.\" $Id: make.1,v 1.11 1997/07/24 06:58:07 charnier Exp $
.\"
.Dd March 19, 1994
.Dt MAKE 1
@@ -40,7 +40,7 @@
.Nd maintain program dependencies
.Sh SYNOPSIS
.Nm make
-.Op Fl Beiknqrstv
+.Op Fl Beiknqrst
.Op Fl D Ar variable
.Op Fl d Ar flags
.Op Fl f Ar makefile
@@ -57,17 +57,15 @@
is a program designed to simplify the maintenance of other programs.
Its input is a list of specifications as to the files upon which programs
and other files depend.
-.Nm Make
-searches a built-in path for this list.
If the file
.Ql Pa makefile
-exists along this path, it is read for this list of specifications.
+exists, it is read for this list of specifications.
If it does not exist, the file
.Ql Pa Makefile
-is used.
+is read.
If the file
.Ql Pa .depend
-exists, it is also read (see
+exists, it is read (see
.Xr mkdep 1) .
.Pp
This manual page is intended as a reference document only.
@@ -185,9 +183,6 @@ Do not build any targets.
Multiple instances of this option may be specified;
the variables will be printed one per line,
with a blank line for each null or undefined variable.
-.It Fl v
-Be extra verbose.
-For multi-job makes, this will cause file banners to be generated.
.It Ar variable=value
Set the value of the variable
.Ar variable
@@ -433,8 +428,7 @@ entered into the environment for all programs which
.Nm make
executes.
.It Ev PWD
-Alternate path to the current directory. Supported if built with WANT_ENV_PWD
-defined.
+Alternate path to the current directory.
.Nm make
normally sets
.Ql Va .CURDIR
@@ -940,33 +934,6 @@ command in the file.
Each source specifies a suffix to
.Nm make .
If no sources are specified, any previous specified suffices are deleted.
-.Sh SEARCH PATH
-.Nm Make
-searches for
-.Ql Pa Makefile
-in the following directories, in order:
-.Pp
-.Bl -enum -compact
-.It
-${MAKEOBJDIRPREFIX}`cwd`
-.It
-${MAKEOBJDIR}
-.It
-obj.${MACHINE}
-.It
-obj
-.It
-/usr/obj${MACHINE}`cwd`
-.It
-The current directory (`cwd`).
-.El
-.Pp
-If
-.Nm make
-finds the
-.Ql Pa Makefile
-someplace other than the current working directory, it adds the CWD to
-the search path.
.Sh ENVIRONMENT
.Nm Make
utilizes the following environment variables, if they exist:
@@ -985,16 +952,12 @@ list of dependencies
list of dependencies
.It makefile
list of dependencies
-.It obj
-object directory
.It sys.mk
system makefile
.It /usr/share/mk
system makefile directory
.It /usr/share/doc/psd/12.make
PMake tutorial
-.It /usr/obj
-system object directory prefix
.El
.Sh SEE ALSO
.Xr mkdep 1
diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h
index 52d01db9f60d..91e2d3aed7e8 100644
--- a/usr.bin/make/make.h
+++ b/usr.bin/make/make.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)make.h 8.3 (Berkeley) 6/13/95
- * $Id: make.h,v 1.7 1997/02/22 19:27:16 peter Exp $
+ * $Id$
*/
/*-
@@ -294,7 +294,6 @@ extern Lst dirSearchPath; /* The list of directories to search when
extern Boolean compatMake; /* True if we are make compatible */
extern Boolean ignoreErrors; /* True if should ignore all errors */
extern Boolean beSilent; /* True if should print no commands */
-extern Boolean beVerbose; /* True if should print extra cruft */
extern Boolean noExecute; /* True if should execute nothing */
extern Boolean allPrecious; /* True if every target is precious */
extern Boolean keepgoing; /* True if should continue on unaffected
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index fda738a8a6a9..388fa07d4963 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: parse.c,v 1.19 1998/05/25 03:28:37 steve Exp $";
+ "$Id: parse.c,v 1.18 1997/07/24 06:58:08 charnier Exp $";
#endif /* not lint */
/*-
@@ -1412,10 +1412,8 @@ Parse_DoVar (line, ctxt)
default:
#ifdef SUNSHCMD
while (*opc != ':')
- if (opc == line)
+ if (--opc < line)
break;
- else
- --opc;
if (strncmp(opc, ":sh", 3) == 0) {
type = VAR_SHELL;
diff --git a/usr.bin/mklocale/data/Makefile b/usr.bin/mklocale/data/Makefile
index 5e9075d3204b..e2481e485cf5 100644
--- a/usr.bin/mklocale/data/Makefile
+++ b/usr.bin/mklocale/data/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.16 1998/08/15 12:51:48 phk Exp $
+# $Id: Makefile,v 1.15 1998/08/10 09:49:42 phk Exp $
NOMAN=YES
CLEANFILES+= ${LOCALES:S/$/.out/g}
@@ -9,7 +9,6 @@ LOCALES= ja_JP.EUC \
lt_LN.ASCII \
lt_LN.ISO_8859-1 \
lt_LN.ISO_8859-2 \
- lt_LN.DIS_8859-15 \
ru_SU.CP866 \
ru_SU.KOI8-R \
zh_CN.EUC \
@@ -43,10 +42,6 @@ afterinstall:
ln -fs ../lt_LN.ISO_8859-1/LC_CTYPE \
${LOCALEDIR}/${link}.ISO_8859-1/LC_CTYPE
.endfor
-.for link in ${LATIN1LINKS}
- ln -fs ../lt_LN.DIS_8859-15/LC_CTYPE \
- ${LOCALEDIR}/${link}.DIS_8859-15/LC_CTYPE
-.endfor
.for link in ${LATIN2LINKS}
ln -fs ../lt_LN.ISO_8859-2/LC_CTYPE \
${LOCALEDIR}/${link}.ISO_8859-2/LC_CTYPE
diff --git a/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src b/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src
deleted file mode 100644
index 7d89e03673b9..000000000000
--- a/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Standard LOCALE_CTYPE for the dis_8859_15 Locale
- */
-ENCODING "NONE"
-VARIABLE DIS 8859-15 Latin-9 character set
-
-#
-# This is a comment
-#
-ALPHA 'A' - 'Z' 'a' - 'z' 0xa6 0xa8 0xb4 0xb8 0xbc - 0xbe 0xc0 - 0xd6 0xd8 - 0xf6 0xf8 - 0xff
-CONTROL 0x00 - 0x1f 0x7f - 0x9f
-DIGIT '0' - '9'
-GRAPH 0x21 - 0x7e 0xa1 - 0xff
-LOWER 'a' - 'z' 0xa8 0xb8 0xbd 0xdf - 0xf6 0xf8 - 0xff
-PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 0xa1 - 0xa5 0xa7 0xa9 - 0xb3 0xb5 - 0xb7 0xb9 - 0xbb 0xbf 0xd7 0xf7
-SPACE 0x09 - 0x0d ' ' 0xa0
-UPPER 'A' - 'Z' 0xa6 0xb4 0xbc 0xc0 - 0xd6 0xd8 - 0xde
-XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F'
-BLANK ' ' '\t' 0xa0
-PRINT 0x20 - 0x7e 0xa0 - 0xff
-# IDEOGRAM
-# SPECIAL
-# PHONEGRAM
-
-MAPLOWER <'A' - 'Z' : 'a'>
-MAPLOWER <'a' - 'z' : 'a'>
-MAPLOWER <0xa6 - 0xa6 : 0xa8>
-MAPLOWER <0xb4 - 0xb4 : 0xb8>
-MAPLOWER <0xbc - 0xbc : 0xbd>
-MAPLOWER <0xbe - 0xbe : 0xff>
-MAPLOWER <0xc0 - 0xd6 : 0xe0>
-MAPLOWER <0xd8 - 0xde : 0xf8>
-MAPLOWER <0xdf - 0xf6 : 0xdf>
-MAPLOWER <0xf8 - 0xff : 0xf8>
-MAPUPPER <'A' - 'Z' : 'A'>
-MAPUPPER <'a' - 'z' : 'A'>
-MAPUPPER <0xa8 - 0xa8 : 0xa6>
-MAPUPPER <0xb8 - 0xb8 : 0xb4>
-MAPUPPER <0xbd - 0xbd : 0xbc>
-MAPUPPER <0xc0 - 0xd6 : 0xc0>
-MAPUPPER <0xd8 - 0xde : 0xd8>
-MAPUPPER <0xe0 - 0xf6 : 0xc0>
-MAPUPPER <0xf8 - 0xfe : 0xd8>
-MAPUPPER <0xff - 0xff : 0xbe>
-TODIGIT <'0' - '9' : 0>
-TODIGIT <'A' - 'F' : 10>
-TODIGIT <'a' - 'f' : 10>
diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c
index 7f27b7fce866..230ab1c355a5 100644
--- a/usr.bin/mt/mt.c
+++ b/usr.bin/mt/mt.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: mt.c,v 1.19 1998/12/19 20:23:37 mjacob Exp $";
+ "$Id: mt.c,v 1.15 1998/09/15 10:28:20 gibbs Exp $";
#endif /* not lint */
/*
@@ -101,28 +101,15 @@ struct commands {
{ "rewind", MTREW, 1 },
{ "rewoffl", MTOFFL, 1 },
{ "status", MTNOP, 1 },
-#if defined(__FreeBSD__)
- { "weof", MTWEOF, 0, ZERO_ALLOWED },
-#else
{ "weof", MTWEOF, 0 },
-#endif
#if defined(__FreeBSD__)
{ "erase", MTERASE, 0, ZERO_ALLOWED},
{ "blocksize", MTSETBSIZ, 0, NEED_2ARGS|ZERO_ALLOWED },
{ "density", MTSETDNSTY, 0, NEED_2ARGS|ZERO_ALLOWED|IS_DENSITY },
{ "eom", MTEOD, 1 },
{ "eod", MTEOD, 1 },
- { "smk", MTWSS, 0 },
- { "wss", MTWSS, 0 },
- { "fss", MTFSS, 1 },
- { "bss", MTBSS, 1 },
{ "comp", MTCOMP, 0, NEED_2ARGS|ZERO_ALLOWED|IS_COMP },
{ "retension", MTRETENS, 1 },
- { "rdhpos", MTIOCRDHPOS, 0 },
- { "rdspos", MTIOCRDSPOS, 0 },
- { "sethpos", MTIOCHLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED },
- { "setspos", MTIOCSLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED },
- { "errstat", MTIOCERRSTAT, 0 },
#endif /* defined(__FreeBSD__) */
{ NULL }
};
@@ -191,7 +178,7 @@ main(argc, argv)
if (*argv) {
#if defined (__FreeBSD__)
if (!isdigit(**argv) &&
- (comp->c_flags & IS_DENSITY)) {
+ comp->c_flags & IS_DENSITY) {
const char *dcanon;
mt_com.mt_count = stringtodens(*argv);
if (mt_com.mt_count == 0)
@@ -203,7 +190,7 @@ main(argc, argv)
*argv, dcanon);
p = "";
} else if (!isdigit(**argv) &&
- (comp->c_flags & IS_COMP)) {
+ comp->c_flags & IS_COMP) {
mt_com.mt_count = stringtocomp(*argv);
if ((u_int32_t)mt_com.mt_count == 0xf0f0f0f0)
@@ -216,83 +203,18 @@ main(argc, argv)
#else
mt_com.mt_count = strtol(*argv, &p, 10);
#endif /* defined(__FreeBSD__) */
- if ((mt_com.mt_count <=
+ if (mt_com.mt_count <=
#if defined (__FreeBSD__)
((comp->c_flags & ZERO_ALLOWED)? -1: 0)
&& ((comp->c_flags & IS_COMP) == 0)
#else
0
#endif /* defined (__FreeBSD__) */
- ) || *p)
+ || *p)
errx(1, "%s: illegal count", *argv);
}
else
mt_com.mt_count = 1;
-#if defined(__FreeBSD__)
- switch (comp->c_code) {
- case MTIOCERRSTAT:
- {
- int i;
- union mterrstat umn;
- struct scsi_tape_errors *s = &umn.scsi_errstat;
-
- if (ioctl(mtfd, comp->c_code, (caddr_t)&umn) < 0)
- err(2, "%s", tape);
- (void)printf("Last I/O Residual: %u\n", s->io_resid);
- (void)printf(" Last I/O Command:");
- for (i = 0; i < sizeof (s->io_cdb); i++)
- (void)printf(" %02X", s->io_cdb[i]);
- (void)printf("\n");
- (void)printf(" Last I/O Sense:\n\n\t");
- for (i = 0; i < sizeof (s->io_sense); i++) {
- (void)printf(" %02X", s->io_sense[i]);
- if (((i + 1) & 0xf) == 0) {
- (void)printf("\n\t");
- }
- }
- (void)printf("\n");
- (void)printf("Last Control Residual: %u\n",
- s->ctl_resid);
- (void)printf(" Last Control Command:");
- for (i = 0; i < sizeof (s->ctl_cdb); i++)
- (void)printf(" %02X", s->ctl_cdb[i]);
- (void)printf("\n");
- (void)printf(" Last Control Sense:\n\n\t");
- for (i = 0; i < sizeof (s->ctl_sense); i++) {
- (void)printf(" %02X", s->ctl_sense[i]);
- if (((i + 1) & 0xf) == 0) {
- (void)printf("\n\t");
- }
- }
- (void)printf("\n\n");
- exit(0);
- /* NOTREACHED */
- }
- case MTIOCRDHPOS:
- case MTIOCRDSPOS:
- {
- u_int32_t block;
- if (ioctl(mtfd, comp->c_code, (caddr_t)&block) < 0)
- err(2, "%s", tape);
- (void)printf("%s: %s block location %u\n", tape,
- (comp->c_code == MTIOCRDHPOS)? "hardware" :
- "logical", block);
- exit(0);
- /* NOTREACHED */
- }
- case MTIOCSLOCATE:
- case MTIOCHLOCATE:
- {
- u_int32_t block = (u_int32_t)mt_com.mt_count;
- if (ioctl(mtfd, comp->c_code, (caddr_t)&block) < 0)
- err(2, "%s", tape);
- exit(0);
- /* NOTREACHED */
- }
- default:
- break;
- }
-#endif
if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0)
err(1, "%s: %s", tape, comp->c_name);
} else {
@@ -300,7 +222,7 @@ main(argc, argv)
err(1, NULL);
status(&mt_status);
}
- exit(0);
+ exit (0);
/* NOTREACHED */
}
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 6680d0785fff..fd0c5bdb7d52 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -42,7 +42,7 @@ char const copyright[] =
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.22 1998/08/08 08:13:04 phk Exp $";
+ "$Id: main.c,v 1.21 1998/08/05 13:54:07 phk Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -105,21 +105,23 @@ static struct nlist nl[] = {
{ "_nfile" },
#define N_FILE 18
{ "_file" },
-#define N_MRTSTAT 19
+#define N_MRTPROTO 19
+ { "_ip_mrtproto" },
+#define N_MRTSTAT 20
{ "_mrtstat" },
-#define N_MFCTABLE 20
+#define N_MFCTABLE 21
{ "_mfctable" },
-#define N_VIFTABLE 21
+#define N_VIFTABLE 22
{ "_viftable" },
-#define N_IPX 22
+#define N_IPX 23
{ "_ipxpcb"},
-#define N_IPXSTAT 23
+#define N_IPXSTAT 24
{ "_ipxstat"},
-#define N_SPXSTAT 24
+#define N_SPXSTAT 25
{ "_spx_istat"},
-#define N_DDPSTAT 25
+#define N_DDPSTAT 26
{ "_ddpstat"},
-#define N_DDPCB 26
+#define N_DDPCB 27
{ "_ddpcb"},
{ "" },
};
@@ -388,9 +390,11 @@ main(argc, argv)
if (gflag) {
kread(0, 0, 0);
if (sflag)
- mrt_stats(nl[N_MRTSTAT].n_value);
+ mrt_stats(nl[N_MRTPROTO].n_value,
+ nl[N_MRTSTAT].n_value);
else
- mroutepr(nl[N_MFCTABLE].n_value,
+ mroutepr(nl[N_MRTPROTO].n_value,
+ nl[N_MFCTABLE].n_value,
nl[N_VIFTABLE].n_value);
exit(0);
}
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c
index 76e001fdc827..c1324969ce79 100644
--- a/usr.bin/netstat/mbuf.c
+++ b/usr.bin/netstat/mbuf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mbuf.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mbuf.c,v 1.14 1998/08/23 15:23:11 gpalmer Exp $";
+ "$Id: mbuf.c,v 1.13 1998/08/18 13:36:47 jb Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -68,9 +68,7 @@ static struct mbtypes {
#ifdef MT_PCB
{ MT_PCB, "protocol control blocks" }, /* XXX */
#endif
-#ifdef MT_RTABLE
{ MT_RTABLE, "routing table entries" }, /* XXX */
-#endif
#ifdef MT_HTABLE
{ MT_HTABLE, "IMP host table entries" }, /* XXX */
#endif
diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c
index 4110d00ec31a..e725d5d155a0 100644
--- a/usr.bin/netstat/mroute.c
+++ b/usr.bin/netstat/mroute.c
@@ -62,13 +62,14 @@
#include "netstat.h"
void
-mroutepr(mfcaddr, vifaddr)
- u_long mfcaddr, vifaddr;
+mroutepr(mrpaddr, mfcaddr, vifaddr)
+ u_long mrpaddr, mfcaddr, vifaddr;
{
u_int mrtproto;
- struct mfc *mfctable[MFCTBLSIZ];
+ struct mbuf *mfctable[MFCTBLSIZ];
struct vif viftable[MAXVIFS];
- struct mfc mfc, *m;
+ struct mbuf mb, *m;
+ struct mfc smfc;
register struct vif *v;
register vifi_t vifi;
register int i;
@@ -76,8 +77,32 @@ mroutepr(mfcaddr, vifaddr)
register int saved_nflag;
vifi_t maxvif = 0;
- if (mfcaddr == 0 || vifaddr == 0) {
- printf("No multicast routing compiled into this system.\n");
+ if (mrpaddr == 0) {
+ printf("ip_mrtproto: symbol not in namelist\n");
+ return;
+ }
+
+ kread(mrpaddr, (char *)&mrtproto, sizeof(mrtproto));
+ switch (mrtproto) {
+
+ case 0:
+ printf("no multicast routing compiled into this system\n");
+ return;
+
+ case IGMP_DVMRP:
+ break;
+
+ default:
+ printf("multicast routing protocol %u, unknown\n", mrtproto);
+ return;
+ }
+
+ if (mfcaddr == 0) {
+ printf("mfctable: symbol not in namelist\n");
+ return;
+ }
+ if (vifaddr == 0) {
+ printf("viftable: symbol not in namelist\n");
return;
}
@@ -99,8 +124,7 @@ mroutepr(mfcaddr, vifaddr)
}
printf(" %2u %6u %4d %-15.15s",
- /* opposite math of add_vif() */
- vifi, v->v_threshold, v->v_rate_limit * 1000 / 1024,
+ vifi, v->v_threshold, v->v_rate_limit,
routename(v->v_lcl_addr.s_addr));
printf(" %-15.15s", (v->v_flags & VIFF_TUNNEL) ?
routename(v->v_rmt_addr.s_addr) : "");
@@ -115,7 +139,8 @@ mroutepr(mfcaddr, vifaddr)
for (i = 0; i < MFCTBLSIZ; ++i) {
m = mfctable[i];
while(m) {
- kread((u_long)m, (char *)&mfc, sizeof mfc);
+ kread((u_long)m, (char *)&mb, sizeof mb);
+ m = &mb;
if (!banner_printed) {
printf("\nMulticast Forwarding Cache\n"
@@ -124,17 +149,19 @@ mroutepr(mfcaddr, vifaddr)
banner_printed = 1;
}
- printf(" %-15.15s", routename(mfc.mfc_origin.s_addr));
- printf(" %-15.15s", routename(mfc.mfc_mcastgrp.s_addr));
- printf(" %9lu", mfc.mfc_pkt_cnt);
- printf(" %3d ", mfc.mfc_parent);
+ kread((u_long)mtod(m, char *),
+ (char *)&smfc, sizeof smfc);
+ printf(" %-15.15s", routename(smfc.mfc_origin.s_addr));
+ printf(" %-15.15s", routename(smfc.mfc_mcastgrp.s_addr));
+ printf(" %9lu", smfc.mfc_pkt_cnt);
+ printf(" %3d ", smfc.mfc_parent);
for (vifi = 0; vifi <= maxvif; vifi++) {
- if (mfc.mfc_ttls[vifi] > 0)
+ if (smfc.mfc_ttls[vifi] > 0)
printf(" %u:%u", vifi,
- mfc.mfc_ttls[vifi]);
+ smfc.mfc_ttls[vifi]);
}
printf("\n");
- m = mfc.mfc_next;
+ m = m->m_act;
}
}
if (!banner_printed)
@@ -146,13 +173,33 @@ mroutepr(mfcaddr, vifaddr)
void
-mrt_stats(mstaddr)
- u_long mstaddr;
+mrt_stats(mrpaddr, mstaddr)
+ u_long mrpaddr, mstaddr;
{
+ u_int mrtproto;
struct mrtstat mrtstat;
+ if(mrpaddr == 0) {
+ printf("ip_mrtproto: symbol not in namelist\n");
+ return;
+ }
+
+ kread(mrpaddr, (char *)&mrtproto, sizeof(mrtproto));
+ switch (mrtproto) {
+ case 0:
+ printf("no multicast routing compiled into this system\n");
+ return;
+
+ case IGMP_DVMRP:
+ break;
+
+ default:
+ printf("multicast routing protocol %u, unknown\n", mrtproto);
+ return;
+ }
+
if (mstaddr == 0) {
- printf("No multicast routing compiled into this system.\n");
+ printf("mrtstat: symbol not in namelist\n");
return;
}
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 92f0ac7d4657..2c0c458a0ff1 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -117,6 +117,6 @@ void tp_protopr __P((u_long, char *));
void tp_inproto __P((u_long));
void tp_stats __P((caddr_t, caddr_t));
-void mroutepr __P((u_long, u_long));
-void mrt_stats __P((u_long));
+void mroutepr __P((u_long, u_long, u_long));
+void mrt_stats __P((u_long, u_long));
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index 3ba45c9cc0c0..b5533fe957cf 100644
--- a/usr.bin/nfsstat/nfsstat.c
+++ b/usr.bin/nfsstat/nfsstat.c
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95";
#endif
static const char rcsid[] =
- "$Id: nfsstat.c,v 1.11 1998/10/24 19:36:52 msmith Exp $";
+ "$Id: nfsstat.c,v 1.9 1997/03/29 04:31:23 imp Exp $";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/objformat/Makefile b/usr.bin/objformat/Makefile
index a56fdd4f8b8c..1f28d3b5201c 100644
--- a/usr.bin/objformat/Makefile
+++ b/usr.bin/objformat/Makefile
@@ -1,8 +1,14 @@
# $FreeBSD$
PROG= objformat
-CFLAGS+= -Wall
-NOSHARED?= YES
+NOMAN= not yet
+CFLAGS+= -DMAIN
+
+.if ${OBJFORMAT} == elf
+CFLAGS+= -DFREEBSD_ELF
+.else
+CFLAGS+= -DFREEBSD_AOUT
+.endif
LINKS+= ${BINDIR}/objformat ${BINDIR}/addr2line
LINKS+= ${BINDIR}/objformat ${BINDIR}/ar
diff --git a/usr.bin/objformat/objformat.1 b/usr.bin/objformat/objformat.1
deleted file mode 100644
index fe924450f026..000000000000
--- a/usr.bin/objformat/objformat.1
+++ /dev/null
@@ -1,94 +0,0 @@
-.\"
-.\" Copyright (c) 1998 David E. O'Brien
-.\"
-.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
-.\"
-.\" $Id: kzip.8,v 1.5 1998/03/23 07:44:18 charnier Exp $
-.\"
-.Dd October 25, 1998
-.Os
-.Dt OBJFORMAT 1
-.Sh NAME
-.Nm objformat
-.Nd reports default binary format and program deflector
-.Sh SYNOPSIS
-.Nm objformat
-.Nm prog
-.Sh DESCRIPTION
-If run as
-.Nm
-the default object file format is reported. The two different object file
-formats are
-.Ar a.out
-and
-.Ar ELF .
-.Pp
-If invoked by any other name,
-.Nm prog
-is expanded to
-.Pa /usr/libexec/<objformat>/prog
-and executed.
-.Sh DIAGNOSTICS
-The
-.Nm
-utility returns with exit code 1
-if called with an improper number of arguments, or if
-.Nm prog
-could not be executed.
-.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMAT_PATH
-.It Ev OBJFORMAT
-If the environment variable
-.Ev OBJFORMAT
-is set, it overrides the default object file format.
-.Ev OBJFORMAT takes precedence over
-.Pa /etc/objformat .
-.It Ev OBJFORMAT_PATH
-If the environment variable
-.Ev OBJFORMAT_PATH
-is set, its value is used as the base path to
-.Nm prog .
-The default is
-.Pa /usr/libexec .
-.El
-.Sh FILES
-.Bl -tag -width /etc/objformat -compact
-.It Pa /etc/objformat
-If present, specifies the object file format to use. Syntax is
-.Ql OBJFORMAT=xxx .
-.Sh SEE ALSO
-.Xr file 1 ,
-.Xr getobjformat 3
-.\" .Sh STANDARDS
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Fx 3.0 .
-.Sh AUTHORS
-.Nm
-was written by
-.An Peter Wemm Aq peter@netplex.com.au .
-This manual page was written by
-.An David O'Brien Aq obrien@NUXI.com .
-.\" .Sh BUGS
diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c
index 8d75f5ea64ae..827af6eda1e9 100644
--- a/usr.bin/objformat/objformat.c
+++ b/usr.bin/objformat/objformat.c
@@ -26,36 +26,112 @@
* $FreeBSD$
*/
-#include <err.h>
-#include <objformat.h>
+#include <sys/types.h>
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
+#include <string.h>
+
+#ifdef FREEBSD_ELF
+int objformat_aout = 0;
+#else
+int objformat_aout = 1;
+#endif
+void
+getobjfmt(void)
+{
+ char *env;
+ int i;
+
+ /* first hint is /etc/objformat */
+ FILE *fp = fopen("/etc/objformat", "r");
+ if (fp) {
+ char buf[1024];
+ buf[1023] = '\0';
+ while (fgets(buf, sizeof(buf) - 1, fp) != NULL) {
+ i = strlen(buf);
+ if (buf[i - 1] == '\n')
+ buf[i - 1] = '\0';
+ if (strcmp(buf, "OBJFORMAT=aout") == 0)
+ objformat_aout = 1;
+ else if (strcmp(buf, "OBJFORMAT=elf") == 0)
+ objformat_aout = 0;
+ else
+ fprintf(stderr, "Unrecognized line in /etc/objformat: %s\n", buf);
+ }
+ fclose(fp);
+ }
+ /* but the user $OBJFORMAT overrides system default */
+ env = getenv("OBJFORMAT");
+ if (env) {
+ if (strcmp(env, "aout") == 0)
+ objformat_aout = 1;
+ else if (strcmp(env, "elf") == 0)
+ objformat_aout = 0;
+ else
+ fprintf(stderr, "Unrecognized value of $OBJFORMAT: %s\n", env);
+ }
+}
+
+void
+scanargv(int *argc, char **argv, int strip)
+{
+ int i, j;
+
+ for (i = 1; i < *argc; i++) {
+ if (strcmp (argv[i], "-aout") == 0) {
+ objformat_aout = 1;
+ continue;
+ } else if (strcmp (argv[i], "-elf") == 0) {
+ objformat_aout = 0;
+ continue;
+ }
+ }
+
+ /* if just looking, return now */
+ if (!strip)
+ return;
+
+ /* otherwise, remove all traces of switches from argv */
+ for (i = 1; i < *argc; i++) {
+ if (strcmp (argv[i], "-aout") == 0 ||
+ strcmp (argv[i], "-elf") == 0) {
+ /* copy NULL at end of argv as well */
+ for (j = i + 1; j <= *argc; j++) {
+ argv[j - 1] = argv[j];
+ }
+ (*argc)--;
+ }
+ }
+}
+
+
+#ifdef MAIN
int
main(int argc, char **argv)
{
- char objformat[32];
char *path, *chunk;
+ char *postfix;
char *cmd, *newcmd = NULL;
char *objformat_path;
-
- if (getobjformat(objformat, sizeof objformat, &argc, argv) == -1)
- errx(1, "Invalid object format");
+ int i;
cmd = strrchr(argv[0], '/');
- if (cmd != NULL)
+ if (cmd)
cmd++;
else
cmd = argv[0];
+ getobjfmt();
+ scanargv(&argc, argv, 1);
+
if (strcmp(cmd, "objformat") == 0) {
- if (argc != 1) {
- fprintf(stderr, "Usage: objformat\n");
- exit(1);
- }
- printf("%s\n", objformat);
+ if (objformat_aout)
+ printf("aout\n");
+ else
+ printf("elf\n");
exit(0);
}
@@ -65,19 +141,35 @@ main(int argc, char **argv)
objformat_path = "/usr/libexec";
path = strdup(objformat_path);
- setenv("OBJFORMAT", objformat, 1);
+ if (objformat_aout) {
+ putenv("OBJFORMAT=aout");
+ postfix = "aout";
+ } else {
+ putenv("OBJFORMAT=elf");
+ postfix = "elf";
+ }
while ((chunk = strsep(&path, ":")) != NULL) {
if (newcmd != NULL) {
free(newcmd);
newcmd = NULL;
}
- asprintf(&newcmd, "%s/%s/%s", chunk, objformat, cmd);
+ asprintf(&newcmd, "%s/%s/%s", chunk, postfix, cmd);
if (newcmd == NULL)
err(1, "cannot allocate memory for new command");
+ if (getenv("OBJFORMAT_DEBUG") != NULL) {
+ fprintf(stderr, "objformat: %s -> %s\n", cmd, newcmd);
+#if 0
+ for (i = 1; i < argc; i++)
+ fprintf(stderr, "argv[%d]: %s\n", i, argv[i]);
+#endif
+ }
+
argv[0] = newcmd;
execv(newcmd, argv);
}
- err(1, "could not exec %s/%s in %s", objformat, cmd, objformat_path);
+ err(1, "could not exec %s/%s in %s", postfix, cmd, objformat_path);
}
+
+#endif
diff --git a/usr.bin/passwd/passwd.1 b/usr.bin/passwd/passwd.1
index 96288119ea93..a61721480dc1 100644
--- a/usr.bin/passwd/passwd.1
+++ b/usr.bin/passwd/passwd.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)passwd.1 8.1 (Berkeley) 6/6/93
-.\" $Id: passwd.1,v 1.10 1998/10/09 06:38:33 markm Exp $
+.\" $Id: passwd.1,v 1.9 1998/08/24 00:56:20 steve Exp $
.\"
.Dd June 6, 1993
.Dt PASSWD 1
@@ -58,7 +58,7 @@ The new password must be entered twice to avoid typing errors.
.Pp
The new password should be at least six characters long (which
may be overridden using the
-.Xr login.conf 5
+.Xr login.cap 5
"minpasswordlen" setting for a user's login class) and not purely alphabetic.
Its total length must be less than
.Dv _PASSWORD_LEN
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 4c787834f636..25acd157bacb 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -56,10 +56,6 @@ static char const sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93";
#ifdef SHELL
#define main printfcmd
#include "bltin/bltin.h"
-#else
-#define warnx1(a, b, c) warnx(a)
-#define warnx2(a, b, c) warnx(a, b)
-#define warnx3(a, b, c) warnx(a, b, c)
#endif
#define PF(f, func) { \
@@ -140,7 +136,7 @@ next: for (start = fmt;; ++fmt) {
if (!*fmt) {
/* avoid infinite loop */
if (end == 1) {
- warnx1("missing format character",
+ warnx("missing format character",
NULL, NULL);
return (1);
}
@@ -190,7 +186,7 @@ next: for (start = fmt;; ++fmt) {
} else
precision = 0;
if (!*fmt) {
- warnx1("missing format character", NULL, NULL);
+ warnx("missing format character", NULL, NULL);
return (1);
}
@@ -231,7 +227,7 @@ next: for (start = fmt;; ++fmt) {
break;
}
default:
- warnx2("illegal format character %c", convch, NULL);
+ warnx("illegal format character %c", convch, NULL);
return (1);
}
*fmt = nextch;
@@ -342,7 +338,7 @@ getint(ip)
if (getlong(&val))
return (1);
if (val > INT_MAX) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
*ip = val;
@@ -364,16 +360,16 @@ getlong(lp)
errno = 0;
val = strtol(*gargv, &ep, 0);
if (*ep != '\0') {
- warnx2("%s: illegal number", *gargv, NULL);
+ warnx("%s: illegal number", *gargv, NULL);
return (1);
}
if (errno == ERANGE)
if (val == LONG_MAX) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
if (val == LONG_MIN) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index a39e478a8840..1c5d084f90fc 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";
#endif
static const char rcsid[] =
- "$Id: rwall.c,v 1.6 1997/08/08 12:18:16 charnier Exp $";
+ "$Id: rwall.c,v 1.5 1997/02/22 19:56:55 peter Exp $";
#endif /* not lint */
/*
@@ -134,9 +134,10 @@ makemsg(fname)
time_t now, time();
FILE *fp;
int fd;
- char *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
+ char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
- snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
+ (void)strcpy(tmpname, _PATH_TMP);
+ (void)strcat(tmpname, "wall.XXXXXX");
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
errx(1, "can't open temporary file");
(void)unlink(tmpname);
diff --git a/usr.bin/rwho/rwho.1 b/usr.bin/rwho/rwho.1
index e1373cda021a..1b49b1968976 100644
--- a/usr.bin/rwho/rwho.1
+++ b/usr.bin/rwho/rwho.1
@@ -52,7 +52,7 @@ received from a machine for 5 minutes then
assumes the machine is down, and does not report users last known
to be logged into that machine.
.Pp
-If a user hasn't typed to the system for a minute or more, then
+If a users hasn't typed to the system for a minute or more, then
.Nm
reports this idle time. If a user hasn't typed to the system for
an hour or more, then
diff --git a/usr.bin/sasc/INSTALL b/usr.bin/sasc/INSTALL
index 484aa2d502f3..448a7a28d363 100644
--- a/usr.bin/sasc/INSTALL
+++ b/usr.bin/sasc/INSTALL
@@ -57,7 +57,7 @@ To install the device driver, please do the following steps:
6. Edit your kernel configuration file (in /usr/src/sys/i386/conf/)
by inserting the following line:
- device asc0 at isa? port 0x2ab tty drq 3 irq 10
+ device asc0 at isa? port 0x2ab tty drq 3 irq 10 vector ascintr
This should usually work for you as it reflects the factory
settings of the AMI scanner. However, if this conflicts with
diff --git a/usr.bin/sed/Makefile b/usr.bin/sed/Makefile
index d6b13a26e44f..99f860be5f1a 100644
--- a/usr.bin/sed/Makefile
+++ b/usr.bin/sed/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= sed
-CFLAGS+=-Wall
SRCS= compile.c main.c misc.c process.c
.include <bsd.prog.mk>
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index 1313fcaec0f0..1c9b82ba1912 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: compile.c,v 1.11 1998/12/07 05:35:54 archie Exp $";
+ "$Id: compile.c,v 1.9 1997/08/11 07:20:58 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -160,7 +160,7 @@ compile_stream(link)
stack = 0;
for (;;) {
- if ((p = cu_fgets(lbuf, sizeof(lbuf), NULL)) == NULL) {
+ if ((p = cu_fgets(lbuf, sizeof(lbuf))) == NULL) {
if (stack != 0)
errx(1, "%lu: %s: unexpected EOF (pending }'s)",
linenum, fname);
@@ -456,7 +456,6 @@ compile_subst(p, s)
static char lbuf[_POSIX2_LINE_MAX + 1];
int asize, ref, size;
char c, *text, *op, *sp;
- int more = 0;
c = *p++; /* Terminator character */
if (c == '\0')
@@ -484,10 +483,7 @@ compile_subst(p, s)
} else if (*p == '&' || *p == '\\')
*sp++ = '\\';
} else if (*p == c) {
- if (*++p == '\0' && more) {
- if (cu_fgets(lbuf, sizeof(lbuf), &more))
- p = lbuf;
- }
+ p++;
*sp++ = '\0';
size += sp - op;
s->new = xrealloc(text, size);
@@ -502,9 +498,9 @@ compile_subst(p, s)
size += sp - op;
if (asize - size < _POSIX2_LINE_MAX + 1) {
asize *= 2;
- text = xrealloc(text, asize);
+ text = xmalloc(asize);
}
- } while (cu_fgets(p = lbuf, sizeof(lbuf), &more));
+ } while (cu_fgets(p = lbuf, sizeof(lbuf)));
errx(1, "%lu: %s: unterminated substitute in regular expression",
linenum, fname);
/* NOTREACHED */
@@ -637,7 +633,7 @@ compile_text()
asize = 2 * _POSIX2_LINE_MAX + 1;
text = xmalloc(asize);
size = 0;
- while (cu_fgets(lbuf, sizeof(lbuf), NULL)) {
+ while (cu_fgets(lbuf, sizeof(lbuf))) {
op = s = text + size;
p = lbuf;
EATSPACE();
diff --git a/usr.bin/sed/extern.h b/usr.bin/sed/extern.h
index 584ac6f6d3af..a80f7c94dbce 100644
--- a/usr.bin/sed/extern.h
+++ b/usr.bin/sed/extern.h
@@ -50,7 +50,7 @@ extern char *fname;
void cfclose __P((struct s_command *, struct s_command *));
void compile __P((void));
void cspace __P((SPACE *, char *, size_t, enum e_spflag));
-char *cu_fgets __P((char *, int, int *));
+char *cu_fgets __P((char *, int));
int mf_fgets __P((SPACE *, enum e_spflag));
void process __P((void));
char *strregerror __P((int, regex_t *));
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 353dedbc8e3d..6e1ef35c6916 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.7 1997/08/11 07:21:03 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -176,10 +176,9 @@ usage()
* together. Empty strings and files are ignored.
*/
char *
-cu_fgets(buf, n, more)
+cu_fgets(buf, n)
char *buf;
int n;
- int *more;
{
static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF;
static FILE *f; /* Current open file */
@@ -190,11 +189,8 @@ cu_fgets(buf, n, more)
again:
switch (state) {
case ST_EOF:
- if (script == NULL) {
- if (more != NULL)
- *more = 0;
+ if (script == NULL)
return (NULL);
- }
linenum = 0;
switch (script->type) {
case CU_FILE:
@@ -219,8 +215,6 @@ again:
linenum++;
if (linenum == 1 && buf[0] == '#' && buf[1] == 'n')
nflag = 1;
- if (more != NULL)
- *more = !feof(f);
return (p);
}
script = script->next;
@@ -235,8 +229,6 @@ again:
if (n-- <= 1) {
*p = '\0';
linenum++;
- if (more != NULL)
- *more = 1;
return (buf);
}
switch (*s) {
@@ -249,8 +241,6 @@ again:
script = script->next;
*p = '\0';
linenum++;
- if (more != NULL)
- *more = 0;
return (buf);
}
case '\n':
@@ -258,8 +248,6 @@ again:
*p = '\0';
s++;
linenum++;
- if (more != NULL)
- *more = 0;
return (buf);
default:
*p++ = *s++;
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 535405af28bb..18bf5159488e 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
#endif
static const char rcsid[] =
- "$Id: process.c,v 1.7 1998/04/29 21:58:36 ache Exp $";
+ "$Id: process.c,v 1.6 1997/08/11 07:21:06 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -94,7 +94,7 @@ process()
{
struct s_command *cp;
SPACE tspace;
- size_t len, oldpsl = 0;
+ size_t len, oldpsl;
char *p;
for (linenum = 0; mf_fgets(&PS, REPLACE);) {
diff --git a/usr.bin/systat/devs.h b/usr.bin/systat/devs.h
index ce49c40d0ab9..e38ed3837f1a 100644
--- a/usr.bin/systat/devs.h
+++ b/usr.bin/systat/devs.h
@@ -1,30 +1,2 @@
-/*-
- * Copyright (c) 1998 David E. O'Brien
- * 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.
- *
- * $Id$
- */
-
int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *);
int dscmd(char *, char *, int, struct statinfo *);
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 64dfa35b871f..b035eb98fd18 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -304,17 +304,16 @@ the number and percentage of the translations that were
handled by the per process name translation cache.
.Pp
At the bottom left is the disk usage display.
-It reports the number of
-kilobytes per transaction, transactions per second and megabytes
-per second averaged over the
+It reports the number of seeks, transfers, and number
+of kilobyte blocks transferred per second averaged over the
refresh period of the display (by default, five seconds).
-The system keeps statistics on most every storage device. In general, up
-to seven devices are displayed. The devices displayed by default are the
-first devices in the kernel's device list. See
-.Xr devstat 3
-and
-.Xr devstat 9
-for details on the devstat system.
+For some disks it also reports the average milliseconds per seek.
+Note that the system only keeps statistics on at most eight disks
+(this is controlled by the constant
+.Dv DK_NDRIVE
+in
+.Aq Pa sys/dkstat.h
+as a kernel compile-time constant).
.Pp
Under the date in the upper right hand quadrant are statistics
on paging and swapping activity.
@@ -375,8 +374,6 @@ Display statistics as a running total from the point this
command is given.
.It Cm time
Display statistics averaged over the refresh interval (the default).
-.It Cm want_fd
-Toggle the display of fd devices in the disk usage display.
.It Cm zero
Reset running statistics to zero.
.El
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index bfd8e816684e..fe31fba4a5b5 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.29 1998/10/08 09:56:10 obrien Exp $";
+ "$Id: vmstat.c,v 1.28 1998/10/05 04:04:27 ken Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/tcopy/pathnames.h b/usr.bin/tcopy/pathnames.h
index 7c08559137d6..a36921e2a4a7 100644
--- a/usr.bin/tcopy/pathnames.h
+++ b/usr.bin/tcopy/pathnames.h
@@ -33,4 +33,4 @@
* @(#)pathnames.h 8.1 (Berkeley) 6/6/93
*/
-#define _PATH_DEFTAPE "/dev/rsa0"
+#define _PATH_DEFTAPE "/dev/rst0"
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index ebacc42bc0d9..165bec2e4428 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -2186,8 +2186,7 @@ tn(argc, argv)
if (temp != INADDR_NONE) {
sin.sin_addr.s_addr = temp;
sin.sin_family = AF_INET;
- if (doaddrlookup)
- host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
+ host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
if (host)
(void) strncpy(_hostname, host->h_name, sizeof(_hostname));
else
diff --git a/usr.bin/telnet/externs.h b/usr.bin/telnet/externs.h
index a8c3f24f57fd..43fdb43287be 100644
--- a/usr.bin/telnet/externs.h
+++ b/usr.bin/telnet/externs.h
@@ -145,7 +145,6 @@ extern int
termdata, /* Print out terminal data flow */
#endif /* defined(unix) */
debug, /* Debug level */
- doaddrlookup, /* do a reverse lookup? */
clienteof; /* Client received EOF */
extern cc_t escape; /* Escape to command mode */
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 7f7c9ff0059b..3c4d8df281de 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -135,7 +135,7 @@ main(argc, argv)
rlogin = (strncmp(prompt, "rlog", 4) == 0) ? '~' : _POSIX_VDISABLE;
autologin = -1;
- while ((ch = getopt(argc, argv, "8EKLNS:X:acde:fFk:l:n:rt:x")) != -1) {
+ while ((ch = getopt(argc, argv, "8EKLS:X:acde:fFk:l:n:rt:x")) != -1) {
switch(ch) {
case '8':
eight = 3; /* binary output and input */
@@ -151,9 +151,6 @@ main(argc, argv)
case 'L':
eight |= 2; /* binary output only */
break;
- case 'N':
- doaddrlookup = 0;
- break;
case 'S':
{
#ifdef HAS_GETTOS
diff --git a/usr.bin/telnet/telnet.1 b/usr.bin/telnet/telnet.1
index de161e850807..b2349195b2ce 100644
--- a/usr.bin/telnet/telnet.1
+++ b/usr.bin/telnet/telnet.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)telnet.1 8.5 (Berkeley) 3/1/94
-.\" $Id: telnet.1,v 1.9 1997/12/27 18:58:27 steve Exp $
+.\" $Id: telnet.1,v 1.8 1997/11/11 05:00:59 steve Exp $
.\"
.Dd March 1, 1994
.Dt TELNET 1
@@ -93,9 +93,6 @@ Specifies no automatic login to the remote system.
Specifies an 8-bit data path on output. This causes the
.Dv BINARY
option to be negotiated on output.
-.It Fl N
-Prevents IP address to name lookup when destination host is given
-as an IP address.
.It Fl S Ar tos
Sets the IP type-of-service (TOS) option for the telnet
connection to the value
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c
index da8b0e113bf1..5057969c6f24 100644
--- a/usr.bin/telnet/telnet.c
+++ b/usr.bin/telnet/telnet.c
@@ -106,7 +106,6 @@ int
donebinarytoggle, /* the user has put us in binary */
dontlecho, /* do we suppress local echoing right now? */
globalmode,
- doaddrlookup = 1, /* do a reverse address lookup? */
clienteof = 0;
char *prompt = 0;
diff --git a/usr.bin/tftp/extern.h b/usr.bin/tftp/extern.h
index d64cf29be6f3..9174cb135c77 100644
--- a/usr.bin/tftp/extern.h
+++ b/usr.bin/tftp/extern.h
@@ -34,4 +34,4 @@
*/
void recvfile __P((int, char *, char *));
-void xmitfile __P((int, char *, char *));
+void sendfile __P((int, char *, char *));
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 3c6a15116d47..d767463ba3a5 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.6 1998/06/09 04:31:02 imp Exp $";
+ "$Id: main.c,v 1.5 1997/08/14 06:47:39 charnier Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -373,7 +373,7 @@ put(argc, argv)
printf("putting %s to %s:%s [%s]\n",
cp, hostname, targ, mode);
peeraddr.sin_port = port;
- xmitfile(fd, targ, mode);
+ sendfile(fd, targ, mode);
return;
}
/* this assumes the target is a directory */
@@ -391,7 +391,7 @@ put(argc, argv)
printf("putting %s to %s:%s [%s]\n",
argv[n], hostname, targ, mode);
peeraddr.sin_port = port;
- xmitfile(fd, targ, mode);
+ sendfile(fd, targ, mode);
}
}
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index ae517a486329..cd3ecd35a003 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: tftp.c,v 1.3 1998/02/20 04:30:34 jb Exp $";
+ "$Id: tftp.c,v 1.2 1997/08/14 06:47:40 charnier Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -88,7 +88,7 @@ static void tpacket __P((const char *, struct tftphdr *, int));
* Send the requested file.
*/
void
-xmitfile(fd, name, mode)
+sendfile(fd, name, mode)
int fd;
char *name;
char *mode;
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 53cf5d93295c..b0845e6b1a86 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -19,11 +19,10 @@
* Steven Wallace <swallace@freebsd.org>
* Wolfram Schneider <wosch@FreeBSD.org>
*
- * $Id: machine.c,v 1.17 1998/11/26 12:59:21 bde Exp $
+ * $Id: machine.c,v 1.14 1998/08/12 09:58:15 wosch Exp $
*/
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/param.h>
@@ -88,32 +87,37 @@ struct handle
/* definitions for indices in the nlist array */
+
static struct nlist nlst[] = {
#define X_CCPU 0
- { "_ccpu" },
+ { "_ccpu" }, /* 0 */
#define X_CP_TIME 1
- { "_cp_time" },
-#define X_AVENRUN 2
- { "_averunnable" },
+ { "_cp_time" }, /* 1 */
+#define X_HZ 2
+ { "_hz" }, /* 2 */
+#define X_STATHZ 3
+ { "_stathz" }, /* 3 */
+#define X_AVENRUN 4
+ { "_averunnable" }, /* 4 */
/* Swap */
-#define VM_SWAPLIST 3
+#define VM_SWAPLIST 5
{ "_swaplist" },/* list of free swap areas */
-#define VM_SWDEVT 4
+#define VM_SWDEVT 6
{ "_swdevt" }, /* list of swap devices and sizes */
-#define VM_NSWAP 5
+#define VM_NSWAP 7
{ "_nswap" }, /* size of largest swap device */
-#define VM_NSWDEV 6
+#define VM_NSWDEV 8
{ "_nswdev" }, /* number of swap devices */
-#define VM_DMMAX 7
+#define VM_DMMAX 9
{ "_dmmax" }, /* maximum size of a swap block */
-#define X_BUFSPACE 8
+#define X_BUFSPACE 10
{ "_bufspace" }, /* K in buffer cache */
-#define X_CNT 9
+#define X_CNT 11
{ "_cnt" }, /* struct vmmeter cnt */
/* Last pid */
-#define X_LASTPID 10
+#define X_LASTPID 12
{ "_nextpid" },
{ 0 }
};
@@ -154,6 +158,7 @@ static double logcpu;
/* these are retrieved from the kernel in _init */
+static long hz;
static load_avg ccpu;
/* these are offsets obtained via nlist and used in the get_ functions */
@@ -274,6 +279,13 @@ struct statics *statics;
return(-1);
}
+ /* get the symbol values out of kmem */
+ (void) getkval(nlst[X_STATHZ].n_value, (int *)(&hz), sizeof(hz), "!");
+ if (!hz) {
+ (void) getkval(nlst[X_HZ].n_value, (int *)(&hz), sizeof(hz),
+ nlst[X_HZ].n_name);
+ }
+
(void) getkval(nlst[X_CCPU].n_value, (int *)(&ccpu), sizeof(ccpu),
nlst[X_CCPU].n_name);
@@ -344,9 +356,6 @@ struct system_info *si;
{
long total;
load_avg avenrun[3];
- int mib[2];
- struct timeval boottime;
- size_t bt_size;
/* get the cp_time array */
(void) getkval(cp_time_offset, (int *)cp_time, sizeof(cp_time),
@@ -442,20 +451,6 @@ struct system_info *si;
} else {
si->last_pid = -1;
}
-
- /*
- * Print how long system has been up.
- * (Found by looking getting "boottime" from the kernel)
- */
- mib[0] = CTL_KERN;
- mib[1] = KERN_BOOTTIME;
- bt_size = sizeof(boottime);
- if (sysctl(mib, 2, &boottime, &bt_size, NULL, 0) != -1 &&
- boottime.tv_sec != 0) {
- si->boottime = boottime;
- } else {
- si->boottime.tv_sec = -1;
- }
}
static struct handle handle;
@@ -633,8 +628,8 @@ char *(*get_userid)();
status,
smpmode ? PP(pp, p_lastcpu) : 0,
format_time(cputime),
- 100.0 * weighted_cpu(pct, pp),
- 100.0 * pct,
+ 10000.0 * weighted_cpu(pct, pp) / hz,
+ 10000.0 * pct / hz,
cmdlength,
printable(PP(pp, p_comm)));
@@ -739,7 +734,7 @@ static unsigned char sorted_state[] =
#define ORDERKEY_PCTCPU \
- if (lresult = (long) PP(p2, p_pctcpu) - (long) PP(p1, p_pctcpu), \
+ if (lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu), \
(result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0)
#define ORDERKEY_CPTICKS \
diff --git a/usr.bin/touch/touch.1 b/usr.bin/touch/touch.1
index b3a0b173e21f..f8a7d3e873d3 100644
--- a/usr.bin/touch/touch.1
+++ b/usr.bin/touch/touch.1
@@ -152,7 +152,7 @@ letter pairs are treated as their counterparts specified to the
option.
If the
.Dq YY
-letter pair is in the range 39 to 99, the year is set to 1939 to 1999,
+letter pair is in the range 69 to 99, the year is set to 1969 to 1999,
otherwise, the year is set in the 21st century.
.Sh HISTORY
A
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index b5f19dcf95fd..712d72ecbe6f 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -260,11 +260,8 @@ stime_arg2(arg, year, tvp)
t->tm_mday = ATOI2(arg);
t->tm_hour = ATOI2(arg);
t->tm_min = ATOI2(arg);
- if (year) {
+ if (year)
t->tm_year = ATOI2(arg);
- if (t->tm_year < 39) /* support 2000-2038 not 1902-1969 */
- t->tm_year += 100;
- }
t->tm_isdst = -1; /* Figure out DST. */
tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index b82db46c9be6..427130c2157e 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.12 1998/10/03 00:43:05 sef Exp $";
+ "$Id: main.c,v 1.11 1998/09/07 05:49:43 sef Exp $";
#endif /* not lint */
/*
@@ -254,7 +254,6 @@ main(int ac, char **av) {
if (ioctl(Procfd, PIOCCONT, val) == -1)
warn("PIOCCONT");
} while (pfs.why != S_EXIT);
- fflush(outfile);
if (sigexit) {
if (sigexit == SIGQUIT)
exit(sigexit);
diff --git a/usr.bin/vi/Makefile b/usr.bin/vi/Makefile
index 94b352ac8a2d..13cbb227ef88 100644
--- a/usr.bin/vi/Makefile
+++ b/usr.bin/vi/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.23 1998/09/05 12:25:54 asami Exp $
+# $Id: Makefile,v 1.22 1998/06/09 04:07:20 imp Exp $
#
# This has most of the glue needed to compile tknvi and the perl hooks,
# but not all.
@@ -16,14 +16,13 @@ APISTUFF= ex_notcl.c ex_noperl.c
#TCLINTERP= yes #we don't have it in the base tree
#TKNVI= yes #not ready, needs X11, tk, doesn't quite work yet
-#PERLINTERP= yes #works
+#PERLINTERP= yes #needs the perl5 v5.003 port
APISTUFF= ex_tcl.c ex_perl.c
-.if defined(PERLINTERP)
-PERL?= /usr/bin/perl5
-CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
-.endif
+# Any better ideas?
+#PERL= /usr/local/bin/perl5.003
+#CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
.endif
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 3bc3a7ce96d4..3e6b65aca2b9 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.27 1998/09/20 00:11:17 ken Exp $";
+ "$Id: vmstat.c,v 1.26 1998/09/16 18:20:23 dillon Exp $";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index 5b38b58dd126..0b53586c304c 100644
--- a/usr.bin/w/pr_time.c
+++ b/usr.bin/w/pr_time.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
#endif
static const char rcsid[] =
- "$Id: pr_time.c,v 1.11 1997/12/28 17:50:10 alex Exp $";
+ "$Id: pr_time.c,v 1.10 1997/08/26 06:59:34 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -88,7 +88,6 @@ pr_attime(started, now)
/*
* pr_idle --
* Display the idle time.
- * Returns number of excess characters that were used for long idle time.
*/
int
pr_idle(idle)
@@ -98,10 +97,8 @@ pr_idle(idle)
if (idle >= 36 * 3600) {
int days = idle / 86400;
(void)printf(" %dday%s ", days, days > 1 ? "s" : " " );
- if (days >= 100)
- return (2);
if (days >= 10)
- return (1);
+ return(1);
}
/* If idle more than an hour, print as HH:MM. */
@@ -116,5 +113,5 @@ pr_idle(idle)
else
(void)printf(" %2d ", (int)(idle / 60));
- return (0); /* not idle longer than 9 days */
+ return(0); /* not idle longer than 9 days */
}
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 18e43c061941..a10275286b36 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: w.c,v 1.31 1998/12/24 23:27:33 dillon Exp $";
+ "$Id: w.c,v 1.27 1998/05/21 08:46:48 jkoshy Exp $";
#endif /* not lint */
/*
@@ -97,7 +97,7 @@ int argwidth; /* width of tty */
int header = 1; /* true if -h flag: don't print heading */
int nflag; /* true if -n flag: don't convert addrs */
int dflag; /* true if -d flag: output debug info */
-int sortidle; /* sort by idle time */
+int sortidle; /* sort bu idle time */
char *sel_user; /* login of particular user selected */
char domain[MAXHOSTNAMELEN];
@@ -114,11 +114,10 @@ struct entry {
struct kinfo_proc *dkp; /* debug option proc list */
} *ep, *ehead = NULL, **nextp = &ehead;
-static void pr_header __P((time_t *, int));
+static void pr_header __P((time_t *, int));
static struct stat
*ttystat __P((char *));
-static void usage __P((int));
-static int this_is_uptime __P((const char *s));
+static void usage __P((int));
char *fmt_argv __P((char **, char *, int)); /* ../../bin/ps/fmt.c */
@@ -142,7 +141,10 @@ main(argc, argv)
(void) setlocale(LC_ALL, "");
/* Are we w(1) or uptime(1)? */
- if (this_is_uptime(argv[0]) == 0) {
+ p = __progname;
+ if (*p == '-')
+ p++;
+ if (*p == 'u') {
wcmd = 0;
p = "";
} else {
@@ -287,7 +289,7 @@ main(argc, argv)
*/
dkp = ep->dkp;
ep->dkp = kp;
- *((struct kinfo_proc **)(&kp->kp_eproc.e_spare[0])) = dkp;
+ *((struct kinfo_proc **)(&kp->kp_eproc.e_spare[ 0])) = dkp;
}
}
}
@@ -352,8 +354,7 @@ main(argc, argv)
}
p = hp->h_name;
}
- if (nflag && *p && strcmp(p, "-") &&
- inet_addr(p) == INADDR_NONE) {
+ if (nflag && *p && strcmp(p, "-") && inet_addr(p) == INADDR_NONE) {
hp = gethostbyname(p);
if (hp != NULL) {
@@ -368,8 +369,8 @@ main(argc, argv)
ep->utmp.ut_host + UT_HOSTSIZE - x, x);
p = buf;
}
- if (dflag) {
- for (dkp = ep->dkp; dkp != NULL; dkp = *((struct kinfo_proc **)(&dkp->kp_eproc.e_spare[0]))) {
+ if( dflag) {
+ for( dkp = ep->dkp; dkp != NULL; dkp = *((struct kinfo_proc **)(&dkp->kp_eproc.e_spare[ 0]))) {
char *p;
p = fmt_argv(kvm_getargv(kd, dkp, argwidth),
dkp->kp_proc.p_comm, MAXCOMLEN);
@@ -386,8 +387,10 @@ main(argc, argv)
ep->utmp.ut_line : ep->utmp.ut_line + 3,
UT_HOSTSIZE, UT_HOSTSIZE, *p ? p : "-");
pr_attime(&ep->utmp.ut_time, &now);
- longidle = pr_idle(ep->idle);
- (void)printf("%.*s\n", argwidth - longidle, ep->args);
+ longidle=pr_idle(ep->idle);
+ if (longidle)
+ argwidth--;
+ (void)printf("%.*s\n", argwidth, ep->args);
}
exit(0);
}
@@ -494,19 +497,3 @@ usage(wcmd)
"usage: uptime\n");
exit (1);
}
-
-static int
-this_is_uptime(s)
- const char *s;
-{
- const char *u;
-
- if ((u = strrchr(s, '/')) != NULL)
- ++u;
- else
- u = s;
- if (strcmp(u, "uptime") == 0)
- return(0);
- return(-1);
-}
-
diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c
index 288bea32c2c4..04a4823088ca 100644
--- a/usr.bin/wall/wall.c
+++ b/usr.bin/wall/wall.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93";
#endif
static const char rcsid[] =
- "$Id: wall.c,v 1.9 1997/09/15 01:03:16 ache Exp $";
+ "$Id: wall.c,v 1.8 1997/08/25 06:43:22 charnier Exp $";
#endif /* not lint */
/*
@@ -144,10 +144,10 @@ makemsg(fname)
time_t now;
FILE *fp;
int fd;
- char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
-
- snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
+ char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
+ (void)strcpy(tmpname, _PATH_TMP);
+ (void)strcat(tmpname, "/wall.XXXXXX");
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
errx(1, "can't open temporary file");
(void)unlink(tmpname);
@@ -167,12 +167,10 @@ makemsg(fname)
* in column 80, but that can't be helped.
*/
(void)fprintf(fp, "\r%79s\r\n", " ");
- (void)snprintf(lbuf, sizeof(lbuf),
- "Broadcast Message from %s@%s",
+ (void)sprintf(lbuf, "Broadcast Message from %s@%s",
whom, hostname);
(void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
- (void)snprintf(lbuf, sizeof(lbuf),
- " (%s) at %d:%02d ...", ttyname(2),
+ (void)sprintf(lbuf, " (%s) at %d:%02d ...", ttyname(2),
lt->tm_hour, lt->tm_min);
(void)fprintf(fp, "%-79.79s\r\n", lbuf);
}
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 0948040f561e..f6bc52c0ed46 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
static const char rcsid[] =
- "$Id: xinstall.c,v 1.33 1998/10/13 14:52:33 des Exp $";
+ "$Id: xinstall.c,v 1.32 1998/06/02 12:00:07 peter Exp $";
#endif /* not lint */
/*-
@@ -164,7 +164,6 @@ main(argc, argv)
errx(EX_USAGE, "invalid file mode: %s",
optarg);
mode = getmode(set, 0);
- free(set);
break;
case 'M':
nommap = 1;
diff --git a/usr.bin/yacc/test/ftp.y b/usr.bin/yacc/test/ftp.y
index 9a1e525bdb43..a9ee9cd95c3e 100644
--- a/usr.bin/yacc/test/ftp.y
+++ b/usr.bin/yacc/test/ftp.y
@@ -455,8 +455,8 @@ cmd: USER SP username CRLF
struct tm *gmtime();
t = gmtime(&stbuf.st_mtime);
reply(213,
- "%d%02d%02d%02d%02d%02d",
- t->tm_year+1900, t->tm_mon+1, t->tm_mday,
+ "19%02d%02d%02d%02d%02d%02d",
+ t->tm_year, t->tm_mon+1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
}
}
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index f10bd2057dee..0ac014277abb 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -1,9 +1,8 @@
# From: @(#)Makefile 5.20 (Berkeley) 6/12/93
-# $Id: Makefile,v 1.146 1999/01/11 08:06:04 msmith Exp $
+# $Id: Makefile,v 1.132 1998/09/17 08:55:02 dfr Exp $
# XXX MISSING: mkproto
-SUBDIR= IPXrouted \
- ac \
+SUBDIR= ac \
accton \
adduser \
amd \
@@ -14,32 +13,21 @@ SUBDIR= IPXrouted \
chkgrp \
chown \
chroot \
+ crunch \
ckdist \
config \
cron \
- crunch \
ctm \
dev_mkdb \
diskpart \
edquota \
inetd \
- iostat \
- ipfstat \
- ipftest \
- ipmon \
- ipnat \
- ipresend \
- ipsend \
- iptest \
- kbdcontrol \
- kbdmap \
kernbb \
keyadmin \
keyserv \
kvm_mkdb \
lpr \
manctl \
- moused \
mrouted \
mtest \
mtree \
@@ -72,9 +60,8 @@ SUBDIR= IPXrouted \
rpc.lockd \
rpc.statd \
rpc.yppasswdd \
- rpc.ypupdated \
rpc.ypxfrd \
- rtprio \
+ rpc.ypupdated \
rwhod \
sa \
sliplogin \
@@ -87,23 +74,28 @@ SUBDIR= IPXrouted \
traceroute \
trpt \
tzsetup \
- usbd \
- usbdevs \
- vidcontrol \
vipw \
vnconfig \
watch \
wormcontrol \
xntpd \
xten \
- yp_mkdb \
ypbind \
+ yp_mkdb \
yppoll \
yppush \
- ypserv \
ypset \
+ ypserv \
zic
+SUBDIR+=ipfstat \
+ ipftest \
+ ipmon \
+ ipnat \
+ ipresend \
+ ipsend \
+ iptest
+
.if !defined(NO_SENDMAIL)
SUBDIR+=mailstats \
makemap \
@@ -112,26 +104,44 @@ SUBDIR+=mailstats \
.endif
.if ${MACHINE_ARCH} == "i386"
+SUBDIR+=btxld \
+ kgmon \
+ pcvt \
+ pnpinfo \
+ rndcontrol \
+ wlconfig \
+ IPXrouted
+
SUBDIR+=apm \
apmconf \
bad144 \
- btxld \
- fdcontrol \
fdformat \
fdwrite \
- i4b \
- kgmon \
+ fdcontrol \
+ iostat \
+ kbdcontrol \
+ kbdmap \
lptcontrol \
mixer \
+ moused \
mptable \
- pcvt \
- pnpinfo \
- rndcontrol \
+ rtprio \
sgsc \
sicontrol \
spkrtest \
stallion \
- wlconfig
+ vidcontrol
+.endif
+
+.if ${MACHINE_ARCH} == "alpha"
+SUBDIR+=kvm_mkdb \
+ natd \
+ kbdcontrol \
+ kbdmap \
+ moused \
+ pstat \
+ rtprio \
+ vidcontrol
.endif
.include <bsd.subdir.mk>
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index 256e27c50e3b..b6e572848488 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/adduser/adduser.perl
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: adduser.perl,v 1.41 1998/08/17 18:50:29 wosch Exp $
+# $Id: adduser.perl,v 1.40 1998/06/07 18:38:32 wosch Exp $
# read variables
@@ -895,7 +895,6 @@ sub adduser_log {
return 1 if $logfile eq "no";
local($sec, $min, $hour, $mday, $mon, $year) = localtime;
- $year += 1900;
$mon++;
foreach $e ('sec', 'min', 'hour', 'mday', 'mon', 'year') {
diff --git a/usr.sbin/amd/amd/Makefile b/usr.sbin/amd/amd/Makefile
index 48a3ec2154d4..49bdcacc31a6 100644
--- a/usr.sbin/amd/amd/Makefile
+++ b/usr.sbin/amd/amd/Makefile
@@ -3,7 +3,7 @@
# Makefile for amd
# This file is under a "BSD" copyright (c) by David O'Brien 1998
#
-# $Id: Makefile,v 1.15 1998/08/30 19:59:49 gpalmer Exp $
+# $Id: Makefile,v 1.14 1998/08/27 08:09:40 obrien Exp $
#
.PATH: ${.CURDIR}/../../../contrib/amd/amd
@@ -25,8 +25,8 @@ SRCS+= srvr_amfs_auto.c srvr_nfs.c
CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amd
-DPADD= ${LIBAMU} ${LIBRPCSVC}
-LDADD= ${LIBAMU} -lrpcsvc
+DPADD+= ${LIBAMU}
+LDADD+= ${LIBAMU} -lrpcsvc
CLEANFILES+= conf_parse.c conf_parse.h conf_tok.c
diff --git a/usr.sbin/amd/fixmount/Makefile b/usr.sbin/amd/fixmount/Makefile
index 3ea214fa59c1..b1c2a97a901f 100644
--- a/usr.sbin/amd/fixmount/Makefile
+++ b/usr.sbin/amd/fixmount/Makefile
@@ -3,7 +3,7 @@
# Makefile for amd
# This file is under a "BSD" copyright (c) by David O'Brien 1998
#
-# $Id: Makefile,v 1.2 1998/08/30 19:59:52 gpalmer Exp $
+# $Id: Makefile,v 1.1 1998/08/27 08:09:41 obrien Exp $
#
.PATH: ${.CURDIR}/../../../contrib/amd/fixmount \
@@ -20,7 +20,7 @@ SRCS+= mount.h nfs_prot.h
# These would be links created by the GNU-style configure
SRCS+= checkmount_bsd44.c
-DPADD= ${LIBAMU} ${LIBRPCSVC}
-LDADD= ${LIBAMU} -lrpcsvc
+DPADD+= ${LIBAMU}
+LDADD+= ${LIBAMU} -lrpcsvc
.include <bsd.prog.mk>
diff --git a/usr.sbin/amd/hlfsd/Makefile b/usr.sbin/amd/hlfsd/Makefile
index 3cf19bcda20c..693b509e1e5d 100644
--- a/usr.sbin/amd/hlfsd/Makefile
+++ b/usr.sbin/amd/hlfsd/Makefile
@@ -3,7 +3,7 @@
# Makefile for amd
# This file is under a "BSD" copyright (c) by David O'Brien 1998
#
-# $Id: Makefile,v 1.2 1998/08/30 19:59:52 gpalmer Exp $
+# $Id: Makefile,v 1.1 1998/08/27 08:09:41 obrien Exp $
#
.PATH: ${.CURDIR}/../../../contrib/amd/hlfsd
@@ -15,7 +15,7 @@ SRCS= hlfsd.c homedir.c nfs_prot_svc.c stubs.c
CFLAGS+= -I${.CURDIR}/../../../contrib/amd/hlfsd
-DPADD= ${LIBAMU} ${LIBRPCSVC}
-LDADD= ${LIBAMU} -lrpcsvc
+DPADD+= ${LIBAMU}
+LDADD+= ${LIBAMU} -lrpcsvc
.include <bsd.prog.mk>
diff --git a/usr.sbin/amd/include/config.h b/usr.sbin/amd/include/config.h
index cc3dad823aee..c36021fba7fa 100644
--- a/usr.sbin/amd/include/config.h
+++ b/usr.sbin/amd/include/config.h
@@ -1,4 +1,4 @@
-/* $Id: config.h,v 1.8 1998/11/20 05:18:34 obrien Exp $ */
+/* $Id: config.h,v 1.6 1998/08/27 08:09:41 obrien Exp $ */
/* portions derived from
$NetBSD: config.h,v 1.11 1998/08/08 22:33:37 christos Exp $ */
/* config.h. Generated automatically by configure. */
@@ -927,7 +927,7 @@
#define PACKAGE "am-utils"
/* Define version of package (must be defined by configure.in) */
-#define VERSION "6.0"
+#define VERSION "6.0a16"
/* We pick some parameters from our local config file */
#include "config_local.h"
diff --git a/usr.sbin/atm/atmarpd/atmarpd.8 b/usr.sbin/atm/atmarpd/atmarpd.8
index 7aabddf55308..fe3f751566b2 100644
--- a/usr.sbin/atm/atmarpd/atmarpd.8
+++ b/usr.sbin/atm/atmarpd/atmarpd.8
@@ -22,7 +22,7 @@
.\" Copies of this Software may be made, however, the above copyright
.\" notice must be reproduced on all copies.
.\"
-.\" @(#) $Id: atmarpd.8,v 1.1 1998/09/15 08:23:15 phk Exp $
+.\" @(#) $Id: atmarpd.1,v 1.2 1998/08/26 21:39:39 johnc Exp $
.\"
.\"
.de EX \"Begin example
@@ -67,7 +67,7 @@ itself into the background.
The command-line options are:
.IP "\fB-l\fP <log file>" 15
-Specifies that \fIatmarpd\fP is to write log messages to the
+Specifies that \fIatmarpd\fP is to write log messages to the the
file named <log file> rather than to the system log.
.IP "\fB-d\fP" 15
Specifies that \fIatmarpd\fP is to be run in debug mode.
@@ -77,7 +77,7 @@ the log file.
.IP "<netif>" 15
Specifies the network interface(s) for which the host is providing
ATMARP service and whose caches are to be synchronized using SCSP.
-If multiple network interface names are specified, \fIatmarpd\fP
+If multiple network interface names are be specified, \fIatmarpd\fP
will provide an interface to \fIscspd\fP for the servers on all the
specified interfaces.
diff --git a/usr.sbin/config/configvers.h b/usr.sbin/config/configvers.h
index c43c00036906..44ac3d0dd69d 100644
--- a/usr.sbin/config/configvers.h
+++ b/usr.sbin/config/configvers.h
@@ -6,6 +6,6 @@
* The numbering scheme is inspired by the sys/conf/newvers.sh RELDATE
* and <osreldate.h> system.
*
- * $Id: configvers.h,v 1.7 1998/10/23 17:05:06 bde Exp $
+ * $Id: configvers.h,v 1.5 1998/09/03 21:03:43 nsouch Exp $
*/
-#define CONFIGVERS 300009
+#define CONFIGVERS 300007
diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l
index b3c0f8fe08a6..aaefd51f7afa 100644
--- a/usr.sbin/config/lang.l
+++ b/usr.sbin/config/lang.l
@@ -55,7 +55,8 @@ struct kt {
#if MACHINE_I386
{ "bio", BIO },
{ "bus", BUS },
- { "cam", CAM },
+ { "cam", CAM},
+ { "ha", HA},
{ "conflicts", CONFLICTS },
#endif
{ "config", CONFIG },
@@ -73,9 +74,6 @@ struct kt {
#endif
{ "dumps", DUMPS },
{ "flags", FLAGS },
-#if MACHINE_I386
- { "ha", HA },
-#endif
{ "ident", IDENT },
{ "interleave", INTERLEAVE },
#if MACHINE_I386
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 0c0535882f41..7fd3bfcb9647 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.25 1998/06/09 14:02:03 dfr Exp $";
+ "$Id: main.c,v 1.24 1998/05/02 01:57:38 kato Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -358,7 +358,7 @@ configfile()
err(2, "%s", p);
fprintf(fo,"#include \"opt_config.h\"\n");
fprintf(fo,"#ifdef INCLUDE_CONFIG_FILE \n");
- fprintf(fo,"static const char config[] = \"\\\n");
+ fprintf(fo,"static char *config = \"\\\n");
fprintf(fo,"START CONFIG FILE %s\\n\\\n___",PREFIX);
while (EOF != (i=getc(fi))) {
if(i == '\n') {
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index 27053a799118..ea29c2accb61 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkioconf.c 8.2 (Berkeley) 1/21/94";
#endif
static const char rcsid[] =
- "$Id: mkioconf.c,v 1.44 1998/10/23 17:05:06 bde Exp $";
+ "$Id: mkioconf.c,v 1.41 1998/09/15 10:29:32 gibbs Exp $";
#endif /* not lint */
#include <err.h>
@@ -52,7 +52,7 @@ char *intv();
char *wnum();
void pseudo_ioconf();
void comp_config __P((FILE *));
-void scbus_devtab __P((FILE *, int *));
+void scbus_devtab __P((FILE *, FILE *, int *));
void isa_devtab __P((FILE *, char *, int *));
void isa_biotab __P((FILE *, char *));
void i386_ioconf __P((void));
@@ -608,6 +608,7 @@ hpbadslave(mp, dp)
#endif
#if MACHINE_I386
+char *shandler();
char *sirq();
void
@@ -615,7 +616,7 @@ i386_ioconf()
{
register struct device *dp, *mp;
int dev_id;
- FILE *fp;
+ FILE *fp, *fp1;
static char *old_d_name;
int count;
@@ -628,8 +629,19 @@ i386_ioconf()
fprintf(fp, " */\n");
fprintf(fp, "\n");
fprintf(fp, "#include <sys/param.h>\n");
+ fprintf(fp, "#include \"ioconf.h\"\n");
fprintf(fp, "\n");
fprintf(fp, "#define C (caddr_t)\n");
+ fp1 = fopen(path("ioconf.h.new"), "w");
+ if (fp1 == 0)
+ err(1, "%s", path("ioconf.h.new"));
+ fprintf(fp1, "/*\n");
+ fprintf(fp1, " * Extern declarations for I/O configuration.\n");
+ fprintf(fp1, " * DO NOT EDIT-- this file is automatically generated.\n");
+ fprintf(fp1, " */\n");
+ fprintf(fp1, "\n");
+ fprintf(fp1, "#ifndef IOCONF_H\n");
+ fprintf(fp1, "#define\tIOCONF_H\n");
/*
* First print the isa initialization structures
*/
@@ -682,7 +694,7 @@ i386_ioconf()
isa_devtab(fp, "null", &dev_id);
}
if (seen_scbus)
- scbus_devtab(fp, &dev_id);
+ scbus_devtab(fp, fp1, &dev_id);
fprintf(fp, "\n");
fprintf(fp, "/*\n");
@@ -700,8 +712,14 @@ i386_ioconf()
fprintf(fp, "\n");
fprintf(fp, "int devtab_count = %d;\n", count);
+ /* XXX David did this differently!!! */
+ /* pseudo_ioconf(fp); */
(void) fclose(fp);
+ fprintf(fp1, "\n");
+ fprintf(fp1, "#endif /* IOCONF_H */\n");
+ (void) fclose(fp1);
moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
+ moveifchanged(path("ioconf.h.new"), path("ioconf.h"));
}
void
@@ -714,7 +732,7 @@ isa_biotab(fp, table)
fprintf(fp, "\n");
fprintf(fp, "struct isa_device isa_biotab_%s[] = {\n", table);
fprintf(fp, "\
-/* id driver iobase irq drq maddr msiz intr unit flags drive alive ri_flags reconfig enabled conflicts next */\n");
+/* id driver iobase irq drq maddr msiz intr unit flags drive alive ri_flags reconfig enabled conflicts next */\n");
for (dp = dtab; dp != 0; dp = dp->d_next) {
mp = dp->d_conn;
if (dp->d_unit == QUES || mp == 0 ||
@@ -722,9 +740,9 @@ isa_biotab(fp, table)
continue;
fprintf(fp, "{ -1, &%3sdriver, %8s,",
mp->d_name, mp->d_port);
- fprintf(fp, "%6s, %2d, C 0x%05X, %5d, 0, %3d, 0x%04X, %5d, 0, 0, 0, %6d, %8d, 0 },\n",
+ fprintf(fp, "%6s, %2d, C 0x%05X, %5d, %8s, %3d, 0x%04X, %5d, 0, 0, 0, %6d, %8d, 0 },\n",
sirq(mp->d_irq), mp->d_drq, mp->d_maddr,
- mp->d_msize, dp->d_unit,
+ mp->d_msize, shandler(mp), dp->d_unit,
dp->d_flags, dp->d_drive, !dp->d_disabled,
dp->d_conflicts);
}
@@ -748,7 +766,7 @@ isa_devtab(fp, table, dev_idp)
fprintf(fp, "\n");
fprintf(fp, "struct isa_device isa_devtab_%s[] = {\n", table);
fprintf(fp, "\
-/* id driver iobase irq drq maddr msiz intr unit flags scsiid alive ri_flags reconfig enabled conflicts next */\n");
+/* id driver iobase irq drq maddr msiz intr unit flags scsiid alive ri_flags reconfig enabled conflicts next */\n");
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_unit == QUES || !eq(dp->d_mask, table))
continue;
@@ -762,9 +780,9 @@ isa_devtab(fp, table, dev_idp)
fprintf(fp, " %d,", dp->d_portn);
else
fprintf(fp, " 0x%04x,", dp->d_portn);
- fprintf(fp, "%6s, %2d, C 0x%05X, %5d, 0, %3d, 0x%04X, 0, 0, 0, 0, %6d, %8d, 0 },\n",
+ fprintf(fp, "%6s, %2d, C 0x%05X, %5d, %8s, %3d, 0x%04X, 0, 0, 0, 0, %6d, %8d, 0 },\n",
sirq(dp->d_irq), dp->d_drq, dp->d_maddr,
- dp->d_msize, dp->d_unit,
+ dp->d_msize, shandler(dp), dp->d_unit,
dp->d_flags, !dp->d_disabled, dp->d_conflicts);
}
fprintf(fp, "0\n};\n");
@@ -804,8 +822,9 @@ static void id_put(fp, unit, s)
* lost and should be put back in.
*/
void
-scbus_devtab(fp, dev_idp)
+scbus_devtab(fp, fp1, dev_idp)
FILE *fp;
+ FILE *fp1;
int *dev_idp;
{
register struct device *dp, *mp;
@@ -882,6 +901,24 @@ scbus_devtab(fp, dev_idp)
*/
char *
+shandler(dp)
+ register struct device *dp;
+{
+ static char buf[32 + 1];
+
+ if (dp->d_vec == NULL || dp->d_vec->id == NULL)
+ return "NULL";
+ /*
+ * This is for ISA. We only support one interrupt handler in the
+ * devtabs. Handlers in the config file after the first for each
+ * device are ignored. Special handlers may be registered at
+ * runtime.
+ */
+ sprintf(buf, "%.32s", dp->d_vec->id);
+ return (buf);
+}
+
+char *
sirq(num)
{
@@ -1145,7 +1182,7 @@ write_device_resources(FILE *fp, struct device *dp)
{
int count = 0;
- fprintf(fp, "struct config_resource %s_resources[] = {\n", devstr(dp));
+ fprintf(fp, "struct resource %s_resources[] = {\n", devstr(dp));
if (dp->d_conn) {
fprintf(fp, "\t\"at\",\tRES_STRING,\t(long)\"%s\",\n",
devstr(dp->d_conn));
@@ -1208,6 +1245,7 @@ alpha_ioconf()
{
register struct device *dp, *mp;
FILE *fp;
+ FILE *fp1;
int dev_id = 10;
int count;
@@ -1216,10 +1254,21 @@ alpha_ioconf()
err(1, "%s", path("ioconf.c"));
fprintf(fp, "#include <sys/types.h>\n");
fprintf(fp, "#include <sys/time.h>\n");
+ fprintf(fp, "#include <ioconf.h>\n\n");
fprintf(fp, "#include <sys/queue.h>\n\n");
fprintf(fp, "#include <sys/bus_private.h>\n");
fprintf(fp, "#include <isa/isareg.h>\n\n");
fprintf(fp, "#define C (char *)\n\n");
+ fp1 = fopen(path("ioconf.h.new"), "w");
+ if (fp1 == 0)
+ err(1, "%s", path("ioconf.h.new"));
+ fprintf(fp1, "/*\n");
+ fprintf(fp1, " * Extern declarations for I/O configuration.\n");
+ fprintf(fp1, " * DO NOT EDIT-- this file is automatically generated.\n");
+ fprintf(fp1, " */\n");
+ fprintf(fp1, "\n");
+ fprintf(fp1, "#ifndef IOCONF_H\n");
+ fprintf(fp1, "#define\tIOCONF_H\n");
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_type != CONTROLLER && dp->d_type != MASTER
@@ -1242,10 +1291,13 @@ alpha_ioconf()
fprintf(fp, "int devtab_count = %d;\n", count);
if (seen_scbus)
- scbus_devtab(fp, &dev_id);
+ scbus_devtab(fp, fp1, &dev_id);
(void) fclose(fp);
+ fprintf(fp1, "#endif\n");
+ (void) fclose(fp1);
moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
+ moveifchanged(path("ioconf.h.new"), path("ioconf.h"));
}
#endif
diff --git a/usr.sbin/cron/cron/cron.c b/usr.sbin/cron/cron/cron.c
index ff9083125d6a..2389c9b66f9e 100644
--- a/usr.sbin/cron/cron/cron.c
+++ b/usr.sbin/cron/cron/cron.c
@@ -17,7 +17,7 @@
#if !defined(lint) && !defined(LINT)
static const char rcsid[] =
- "$Id: cron.c,v 1.7 1998/07/06 20:28:04 bde Exp $";
+ "$Id: cron.c,v 1.6 1997/09/15 06:39:04 charnier Exp $";
#endif
#define MAIN_PROGRAM
@@ -227,40 +227,28 @@ cron_sync() {
static void
cron_sleep() {
- int seconds_to_wait = 0;
+ register int seconds_to_wait;
- /*
- * Loop until we reach the top of the next minute, sleep when possible.
- */
-
- for (;;) {
+ do {
seconds_to_wait = (int) (TargetTime - time((time_t*)0));
-
- /*
- * If the seconds_to_wait value is insane, jump the cron
- */
-
- if (seconds_to_wait < -600 || seconds_to_wait > 600) {
- cron_sync();
- continue;
- }
-
Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n",
getpid(), (long)TargetTime, seconds_to_wait))
- /*
- * If we've run out of wait time or there are no jobs left
- * to run, break
+ /* if we intend to sleep, this means that it's finally
+ * time to empty the job queue (execute it).
+ *
+ * if we run any jobs, we'll probably screw up our timing,
+ * so go recompute.
+ *
+ * note that we depend here on the left-to-right nature
+ * of &&, and the short-circuiting.
*/
+ } while (seconds_to_wait > 0 && job_runqueue());
- if (seconds_to_wait <= 0)
- break;
- if (job_runqueue() == 0) {
- Debug(DSCH, ("[%d] sleeping for %d seconds\n",
- getpid(), seconds_to_wait))
-
- sleep(seconds_to_wait);
- }
+ while (seconds_to_wait > 0) {
+ Debug(DSCH, ("[%d] sleeping for %d seconds\n",
+ getpid(), seconds_to_wait))
+ seconds_to_wait = (int) sleep((unsigned int) seconds_to_wait);
}
}
diff --git a/usr.sbin/cron/lib/misc.c b/usr.sbin/cron/lib/misc.c
index 3e0318268880..6c098de1683b 100644
--- a/usr.sbin/cron/lib/misc.c
+++ b/usr.sbin/cron/lib/misc.c
@@ -17,7 +17,7 @@
#if !defined(lint) && !defined(LINT)
static const char rcsid[] =
- "$Id: misc.c,v 1.6 1997/09/15 06:39:25 charnier Exp $";
+ "$Id: misc.c,v 1.5 1997/02/22 16:05:08 peter Exp $";
#endif
/* vix 26jan87 [RCS has the rest of the log]
@@ -619,12 +619,9 @@ arpadate(clock)
{
time_t t = clock ?*clock :time(0L);
struct tm *tm = localtime(&t);
- static char ret[32]; /* zone name might be >3 chars */
+ static char ret[30]; /* zone name might be >3 chars */
- if (tm->tm_year >= 100)
- tm->tm_year += 1900;
-
- (void) snprintf(ret, sizeof(ret), "%s, %2d %s %d %02d:%02d:%02d %s",
+ (void) sprintf(ret, "%s, %2d %s %2d %02d:%02d:%02d %s",
DowNames[tm->tm_wday],
tm->tm_mday,
MonthNames[tm->tm_mon],
diff --git a/usr.sbin/ctm/mkCTM/mkCTM b/usr.sbin/ctm/mkCTM/mkCTM
index a728a786183a..684fb6a856e2 100644
--- a/usr.sbin/ctm/mkCTM/mkCTM
+++ b/usr.sbin/ctm/mkCTM/mkCTM
@@ -44,7 +44,7 @@ set damage 0
set changes 0
source $argv
-exec sh -c "date -u '+%Y%m%d%H%M%S $argv'" >> ${CTMSW}/log
+exec sh -c "date -u '+%y%m%d%H%M%S $argv'" >> ${CTMSW}/log
if {$CTMtmp == ""} {
set CTMtmp $CTMSW/../tmp/${CTMname}_${CTMsuff}
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index 0d983a9a3ec6..011037175ce5 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)edquota.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: edquota.c,v 1.7 1997/09/17 06:29:23 charnier Exp $";
+ "$Id$";
#endif /* not lint */
/*
@@ -469,11 +469,9 @@ readprivs(quplist, inname)
warnx("%s:%s: bad format", fsp, cp);
return (0);
}
- dqblk.dqb_curblocks = btodb((off_t)dqblk.dqb_curblocks * 1024);
- dqblk.dqb_bsoftlimit = btodb((off_t)dqblk.dqb_bsoftlimit
- * 1024);
- dqblk.dqb_bhardlimit = btodb((off_t)dqblk.dqb_bhardlimit
- * 1024);
+ dqblk.dqb_curblocks = btodb(dqblk.dqb_curblocks * 1024);
+ dqblk.dqb_bsoftlimit = btodb(dqblk.dqb_bsoftlimit * 1024);
+ dqblk.dqb_bhardlimit = btodb(dqblk.dqb_bhardlimit * 1024);
if ((cp = strtok(line2, "\n")) == NULL) {
warnx("%s: %s: bad format", fsp, line2);
return (0);
diff --git a/usr.sbin/i4b/Makefile b/usr.sbin/i4b/Makefile
deleted file mode 100644
index 3c12d78f8b90..000000000000
--- a/usr.sbin/i4b/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-SUBDIR = isdntrace isdndebug isdnd alawulaw man isdntest \
- isdntel isdntelctl isdnmonitor isdndecode
-
-.include <bsd.subdir.mk>
diff --git a/usr.sbin/i4b/Makefile.inc b/usr.sbin/i4b/Makefile.inc
deleted file mode 100644
index 691d73809e06..000000000000
--- a/usr.sbin/i4b/Makefile.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-# if you don't like curses stuff in the daemon (i.e. don't intend
-# to ever run it in the foreground but are using the monitoring
-# utilities instead) define this to compile it without.
-#I4B_WITHOUT_CURSES = 1
-
-# if you would like monitoring support, define this
-I4B_EXTERNAL_MONITOR = 1
-
-# for the security conscious type: restrict monitoring to the
-# local machine by not compiling any tcp/ip support for monitoring
-# at all
-#I4B_NOTCPIP_MONITOR = 1
-
-.include "${.CURDIR}/../../Makefile.inc"
diff --git a/usr.sbin/i4b/alawulaw/Makefile b/usr.sbin/i4b/alawulaw/Makefile
deleted file mode 100644
index 1daa481e3b08..000000000000
--- a/usr.sbin/i4b/alawulaw/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-PROG = alaw2ulaw
-SRC = alaw2ulaw.c
-CFLAGS += -Wall -g -DDEBUG
-LINKS = ${BINDIR}/alaw2ulaw ${BINDIR}/ulaw2alaw
-MAN1 = alaw2ulaw.1 ulaw2alaw.1
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/alawulaw/alaw2ulaw.1 b/usr.sbin/i4b/alawulaw/alaw2ulaw.1
deleted file mode 100644
index fea7fa57a7ac..000000000000
--- a/usr.sbin/i4b/alawulaw/alaw2ulaw.1
+++ /dev/null
@@ -1,70 +0,0 @@
-.\"
-.\" Copyright (c) 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: alaw2ulaw.1,v 1.3 1998/12/05 18:02:35 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 17:57:34 1998]
-.\"
-.\" -hm writing manual pages
-.\"
-.\"
-.Dd January 23, 1998
-.Dt alaw2ulaw 1
-.Sh NAME
-.Nm alaw2ulaw
-.Nd convert sound data
-.Sh SYNOPSIS
-.Nm
-.Sh DESCRIPTION
-.Nm alaw2ulaw
-is part of the isdn4bsd package and is used convert sound data between
-uLaw coded data to ALaw coded data and vice versa.
-.Pp
-It reads data from stdin and outputs converted data to stdout.
-.Pp
-In case it is run as
-.Em alaw2ulaw
-it converts ALaw input data to uLaw output.
-.Pp
-In case it is run as
-.Em ulaw2alaw
-it converts uLaw input data to ALaw output.
-.Pp
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-alaw2ulaw <file.alaw >file.ulaw
-.Ed
-.Pp
-converts ALaw input data file file.alaw to uLaw output file file.ulaw.
-
-.Sh STANDARDS
-ITU Recommendations G.711
-
-.Sh AUTHOR
-The
-.Nm
-utility and this man page were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/alawulaw/alaw2ulaw.c b/usr.sbin/i4b/alawulaw/alaw2ulaw.c
deleted file mode 100644
index d13e41de8ed8..000000000000
--- a/usr.sbin/i4b/alawulaw/alaw2ulaw.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 1997 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * convert a-law / u-law sound files
- * ---------------------------------
- *
- * last edit-date: [Sat Dec 5 17:57:56 1998]
- *
- * $Id: alaw2ulaw.c,v 1.2 1998/12/05 18:02:36 hm Exp $
- *
- * -hm telephony is ready
- *
- *---------------------------------------------------------------------------*/
-
-#include <string.h>
-#include <unistd.h>
-
-#define BUF_SIZ 2048
-
-unsigned char alaw_ulaw[];
-unsigned char ulaw_alaw[];
-
-int main(int argc, char *argv[])
-{
- int i, j;
- unsigned char buffer[BUF_SIZ];
- char *p;
- unsigned char *cp;
-
- if((p = rindex(*argv, '/')) != NULL)
- p++;
- else
- p = *argv;
-
- if(!strcmp(p, "ulaw2alaw"))
- {
- cp = ulaw_alaw;
- }
- else if(!strcmp(p, "alaw2ulaw"))
- {
- cp = alaw_ulaw;
- }
- else
- {
- return(1);
- }
-
- while(((j = read(0, buffer, BUF_SIZ)) > 0))
- {
- for(i = 0; i < j; i++)
- buffer[i] = cp[buffer[i]];
- write(1, buffer, j);
- }
- return(0);
-}
-
-unsigned char alaw_ulaw[] = {
- 0x002a, 0x00a9, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0048, 0x00c8,
- 0x0039, 0x00b9, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d7,
- 0x0022, 0x00a1, 0x005b, 0x00dd, 0x001f, 0x009f, 0x0040, 0x00c0,
- 0x0031, 0x00b1, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00cf,
- 0x002e, 0x00ad, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004c, 0x00cc,
- 0x003d, 0x00bd, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00db,
- 0x0026, 0x00a5, 0x005d, 0x00df, 0x001f, 0x009f, 0x0044, 0x00c4,
- 0x0035, 0x00b5, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d3,
- 0x0028, 0x00a7, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0046, 0x00c6,
- 0x0037, 0x00b7, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0053, 0x00d5,
- 0x0020, 0x009f, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x002f, 0x00af, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004d, 0x00ce,
- 0x002c, 0x00ab, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004a, 0x00ca,
- 0x003b, 0x00bb, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0057, 0x00d9,
- 0x0024, 0x00a3, 0x005d, 0x00df, 0x001f, 0x009f, 0x0042, 0x00c2,
- 0x0033, 0x00b3, 0x006b, 0x00ef, 0x001f, 0x009f, 0x004f, 0x00d1,
- 0x002b, 0x00aa, 0x0063, 0x00e3, 0x001f, 0x009f, 0x0049, 0x00c9,
- 0x003a, 0x00ba, 0x0077, 0x00f7, 0x001f, 0x009f, 0x0057, 0x00d7,
- 0x0023, 0x00a2, 0x005d, 0x00dd, 0x001f, 0x009f, 0x0041, 0x00c1,
- 0x0032, 0x00b2, 0x006b, 0x00eb, 0x001f, 0x009f, 0x004f, 0x00cf,
- 0x002f, 0x00ae, 0x0067, 0x00e7, 0x001f, 0x009f, 0x004d, 0x00cd,
- 0x003e, 0x00be, 0x00ff, 0x00ff, 0x001f, 0x009f, 0x005b, 0x00db,
- 0x0027, 0x00a6, 0x005f, 0x00df, 0x001f, 0x009f, 0x0045, 0x00c5,
- 0x0036, 0x00b6, 0x006f, 0x00ef, 0x001f, 0x009f, 0x0053, 0x00d3,
- 0x0029, 0x00a8, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0047, 0x00c7,
- 0x0038, 0x00b8, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d5,
- 0x0021, 0x00a0, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x0030, 0x00b0, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00ce,
- 0x002d, 0x00ac, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004b, 0x00cb,
- 0x003c, 0x00bc, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00d9,
- 0x0025, 0x00a4, 0x005d, 0x00df, 0x001f, 0x009f, 0x0043, 0x00c3,
- 0x0034, 0x00b4, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d1
-};
-
-unsigned char ulaw_alaw[] = {
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00ac,
- 0x0050, 0x00d0, 0x0010, 0x0090, 0x0070, 0x00f0, 0x0030, 0x00b0,
- 0x0040, 0x00c0, 0x0000, 0x0080, 0x0060, 0x00e0, 0x0020, 0x00a0,
- 0x00d8, 0x0018, 0x0098, 0x0078, 0x00f8, 0x0038, 0x00b8, 0x0048,
- 0x00c8, 0x0008, 0x0088, 0x0068, 0x00e8, 0x0028, 0x00a8, 0x00d6,
- 0x0096, 0x0076, 0x00f6, 0x0036, 0x00b6, 0x0046, 0x00c6, 0x0006,
- 0x0086, 0x0066, 0x00e6, 0x0026, 0x00a6, 0x00de, 0x009e, 0x00fe,
- 0x00fe, 0x00be, 0x00be, 0x00ce, 0x00ce, 0x008e, 0x008e, 0x00ee,
- 0x00ee, 0x00d2, 0x00d2, 0x00f2, 0x00f2, 0x00c2, 0x00c2, 0x00e2,
- 0x00e2, 0x00e2, 0x00da, 0x00da, 0x00da, 0x00da, 0x00fa, 0x00fa,
- 0x00fa, 0x00fa, 0x00ca, 0x00ca, 0x00ca, 0x00ca, 0x00ea, 0x00ea,
- 0x00ea, 0x00ea, 0x00ea, 0x00ea, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00d1, 0x0011, 0x0091, 0x0071, 0x00f1, 0x0031, 0x00b1, 0x0041,
- 0x00c1, 0x0001, 0x0081, 0x0061, 0x00e1, 0x0021, 0x00a1, 0x0059,
- 0x00d9, 0x0019, 0x0099, 0x0079, 0x00f9, 0x0039, 0x00b9, 0x0049,
- 0x00c9, 0x0009, 0x0089, 0x0069, 0x00e9, 0x0029, 0x00a9, 0x0057,
- 0x0017, 0x0097, 0x0077, 0x00f7, 0x0037, 0x00b7, 0x0047, 0x00c7,
- 0x0007, 0x0087, 0x0067, 0x00e7, 0x0027, 0x00a7, 0x00df, 0x009f,
- 0x009f, 0x00ff, 0x00ff, 0x00bf, 0x00bf, 0x00cf, 0x00cf, 0x008f,
- 0x008f, 0x00ef, 0x00ef, 0x00af, 0x00af, 0x00d3, 0x00d3, 0x00f3,
- 0x00f3, 0x00f3, 0x00c3, 0x00c3, 0x00c3, 0x00c3, 0x00e3, 0x00e3,
- 0x00e3, 0x00e3, 0x00db, 0x00db, 0x00db, 0x00db, 0x00fb, 0x00fb,
- 0x00fb, 0x00fb, 0x00fb, 0x00fb, 0x00cb, 0x00cb, 0x00cb, 0x00cb,
- 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x00eb, 0x00eb, 0x00eb, 0x00eb
-};
-
-/* EOF */
diff --git a/usr.sbin/i4b/alawulaw/ulaw2alaw.1 b/usr.sbin/i4b/alawulaw/ulaw2alaw.1
deleted file mode 100644
index 4c43c153c670..000000000000
--- a/usr.sbin/i4b/alawulaw/ulaw2alaw.1
+++ /dev/null
@@ -1,70 +0,0 @@
-.\"
-.\" Copyright (c) 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: ulaw2alaw.1,v 1.3 1998/12/05 18:02:37 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 17:58:07 1998]
-.\"
-.\" -hm writing manual pages
-.\"
-.\"
-.Dd January 23, 1998
-.Dt ulaw2alaw 1
-.Sh NAME
-.Nm ulaw2alaw
-.Nd convert sound data
-.Sh SYNOPSIS
-.Nm
-.Sh DESCRIPTION
-.Nm ulaw2alaw
-is part of the isdn4bsd package and is used convert sound data between
-uLaw coded data to ALaw coded data and vice versa.
-.Pp
-It reads data from stdin and outputs converted data to stdout.
-.Pp
-In case it is run as
-.Em alaw2ulaw
-it converts ALaw input data to uLaw output.
-.Pp
-In case it is run as
-.Em ulaw2alaw
-it converts uLaw input data to ALaw output.
-.Pp
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-ulaw2alaw <file.ulaw >file.alaw
-.Ed
-.Pp
-converts uLaw input data file file.ulaw to ALaw output file file.alaw.
-
-.Sh STANDARDS
-ITU Recommendations G.711
-
-.Sh AUTHOR
-The
-.Nm
-utility and this man page were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/isdnd/Makefile b/usr.sbin/i4b/isdnd/Makefile
deleted file mode 100644
index 37d3471357c2..000000000000
--- a/usr.sbin/i4b/isdnd/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# $Id$
-
-PROG = isdnd
-
-SRCS = rc_parse.y rc_scan.l main.c rc_config.c log.c curses.c \
- process.c rates.c msghdl.c fsm.c support.c timer.c \
- exec.c dial.c monitor.c pcause.c controller.c alias.c \
- y.tab.h
-
-COPTS += -I${.CURDIR}/../isdnmonitor -I${.CURDIR}/../isdntel -I${.OBJDIR}
-
-# compile debug support
-COPTS += -DDEBUG
-
-# enable rtprio usage
-COPTS += -DUSE_RTPRIO
-
-MAN8 = isdnd.8
-MAN5 = isdnd.rc.5 isdnd.rates.5 isdnd.acct.5
-
-.if !defined(I4B_WITHOUT_CURSES)
-COPTS += -DUSE_CURSES
-DPADD = ${LIBCURSES} ${LIBTERMCAP}
-LDADD = -lcurses -ltermcap
-.endif
-
-.if defined(I4B_EXTERNAL_MONITOR)
-COPTS += -DI4B_EXTERNAL_MONITOR
-.if defined(I4B_NOTCPIP_MONITOR)
-COPTS += -DI4B_NOTCPIP_MONITOR
-.endif
-.endif
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdnd/alias.c b/usr.sbin/i4b/isdnd/alias.c
deleted file mode 100644
index b802776de7b2..000000000000
--- a/usr.sbin/i4b/isdnd/alias.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnd - common aliasfile handling
- * =================================
- *
- * NOTE: this has to stay in sync with isdntel/alias.c to be able
- * to share a common aliasfile!
- *
- * $Id: alias.c,v 1.5 1998/12/05 18:03:03 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:05:40 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static struct alias *firsta = NULL;
-
-#define MAXBUFSZ 256
-
-static void free_alias(struct alias *ptr);
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-void
-init_alias(char *filename)
-{
- FILE *fp;
- char buffer[MAXBUFSZ + 1];
- char number[MAXBUFSZ + 1];
- char name[MAXBUFSZ + 1];
- char *s, *d;
- struct alias *newa = NULL;
- struct alias *lasta = NULL;
-
- firsta = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- {
- log(LL_ERR, "init_alias: error opening aliasfile %s: %s!", filename, strerror(errno));
- exit(1);
- }
-
- while((fgets(buffer, MAXBUFSZ, fp)) != NULL)
- {
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- s = buffer;
- d = number;
-
- while(*s && (isdigit(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- while(*s && (isspace(*s)))
- s++;
-
- d = name;
-
- while(*s && (isprint(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- if((strlen(number) > 1) && (strlen(name) > 1))
- {
- if((newa = (struct alias *) malloc(sizeof(struct alias))) == NULL)
- {
- log(LL_ERR, "init_alias: malloc failed for struct alias!\n");
- exit(1);
- }
-
- if((newa->number = (char *) malloc(strlen(number)+1)) == NULL)
- {
- log(LL_ERR, "init_alias: malloc failed for number alias!\n");
- exit(1);
- }
-
- if((newa->name = (char *) malloc(strlen(name)+1)) == NULL)
- {
- log(LL_ERR, "init_alias: malloc failed for name alias!\n");
- exit(1);
- }
-
- strcpy(newa->name, name);
- strcpy(newa->number, number);
- newa->next = NULL;
-
- if(firsta == NULL)
- {
- firsta = newa;
- }
- else
- {
- lasta->next = newa;
- }
- lasta = newa;
- }
- }
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * free all aliases
- *---------------------------------------------------------------------------*/
-void
-free_aliases(void)
-{
- free_alias(firsta);
-}
-
-/*---------------------------------------------------------------------------*
- * free aliases
- *---------------------------------------------------------------------------*/
-static void
-free_alias(struct alias *ptr)
-{
-
- if(ptr == NULL)
- return;
-
- if(ptr->next != NULL)
- free_alias(ptr->next);
-
- if(ptr->number != NULL)
- free(ptr->number);
-
- if(ptr->name != NULL)
- free(ptr->name);
-
- free(ptr);
-}
-
-/*---------------------------------------------------------------------------*
- * try to find alias for number. if no alias found, return number.
- *---------------------------------------------------------------------------*/
-char *
-get_alias(char *number)
-{
- struct alias *ca = NULL;
-
- if(firsta == NULL)
- return(number);
-
- ca = firsta;
-
- for(;;)
- {
- if(strlen(number) == strlen(ca->number))
- {
- if(!(strcmp(number, ca->number)))
- return(ca->name);
- }
- if(ca->next == NULL)
- break;
- ca = ca->next;
- }
- return(number);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/config.h b/usr.sbin/i4b/isdnd/config.h
deleted file mode 100644
index 22c947af84b3..000000000000
--- a/usr.sbin/i4b/isdnd/config.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - compile time configuration header file
- * ---------------------------------------------------
- *
- * $Id: config.h,v 1.6 1998/12/05 18:03:05 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:05:56 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-/* general values */
-
-#define UMASK 022 /* file creation perm mask */
-#define CFG_ENTRY_MAX 32 /* max no of config entries */
-#define ISDN_CTRL_MAX 4 /* max no of controllers */
-#define MAX_RE 8 /* max regular expression entries */
-
-/* monitor max values */
-
-#define MAX_MHOSTS 8 /* max allowed monitor hosts */
-
-/* timouts */
-
-#define TIMEOUT_CONNECT_ACTIVE 30 /* seconds to wait for MSG_CONN_ACT */
-
-/* utility programs forked */
-
-#define REGPROG_DEF "program" /* default program to use for regexpr */
-#define ANSWERPROG_DEF "answer" /* default telephone answer program */
-
-#endif /* _CONFIG_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/controller.c b/usr.sbin/i4b/isdnd/controller.c
deleted file mode 100644
index b3cfcf99b7e3..000000000000
--- a/usr.sbin/i4b/isdnd/controller.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - controller state support routines
- * ----------------------------------------------
- *
- * $Id: controller.c,v 1.10 1998/12/05 18:03:06 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:06:10 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*--------------------------------------------------------------------------*
- * init controller state table entry
- *--------------------------------------------------------------------------*/
-int
-init_controller_state(int controller, int ctrl_type, int card_type, int tei)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "init_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- /* init controller tab */
-
- if(ctrl_type == CTRL_PASSIVE)
- {
- if((card_type > CARD_TYPEP_UNK) &&
- (card_type <= CARD_TYPEP_MAX))
- {
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_UP;
- isdn_ctrl_tab[controller].stateb1 = CHAN_IDLE;
- isdn_ctrl_tab[controller].stateb2 = CHAN_IDLE;
- isdn_ctrl_tab[controller].freechans = MAX_CHANCTRL;
- isdn_ctrl_tab[controller].tei = tei;
- log(LL_DMN, "init_controller_state: controller %d is %s",
- controller,
- name_of_controller(isdn_ctrl_tab[controller].ctrl_type,
- isdn_ctrl_tab[controller].card_type));
- }
- else
- {
- log(LL_ERR, "init_controller_state: unknown card type %d", card_type);
- return(ERROR);
- }
-
- }
- else if(ctrl_type == CTRL_DAIC)
- {
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_DOWN;
- isdn_ctrl_tab[controller].stateb1 = CHAN_IDLE;
- isdn_ctrl_tab[controller].stateb2 = CHAN_IDLE;
- isdn_ctrl_tab[controller].freechans = MAX_CHANCTRL;
- isdn_ctrl_tab[controller].tei = -1;
- log(LL_DMN, "init_controller_state: controller %d is %s",
- controller,
- name_of_controller(isdn_ctrl_tab[controller].ctrl_type,
- isdn_ctrl_tab[controller].card_type));
- }
- else
- {
- /* XXX active controller init here !!! */
-
- log(LL_ERR, "init_controller_state: unknown controller type %d", ctrl_type);
- return(ERROR);
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * set controller state to UP/DOWN
- *--------------------------------------------------------------------------*/
-int
-set_controller_state(int controller, int state)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "set_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- if(state == CTRL_UP)
- {
- isdn_ctrl_tab[controller].state = CTRL_UP;
- DBGL(DL_CNST, (log(LL_DBG, "set_controller_state: controller [%d] set UP!", controller)));
- }
- else if (state == CTRL_DOWN)
- {
- isdn_ctrl_tab[controller].state = CTRL_DOWN;
- DBGL(DL_CNST, (log(LL_DBG, "set_controller_state: controller [%d] set DOWN!", controller)));
- }
- else
- {
- log(LL_ERR, "set_controller_state: invalid controller state [%d]!", state);
- return(ERROR);
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * get controller state
- *--------------------------------------------------------------------------*/
-int
-get_controller_state(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "set_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- return(isdn_ctrl_tab[controller].state);
-}
-
-/*--------------------------------------------------------------------------*
- * decrement number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-decr_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "decr_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- if(isdn_ctrl_tab[controller].freechans > 0)
- {
- (isdn_ctrl_tab[controller].freechans)--;
- DBGL(DL_CNST, (log(LL_DBG, "decr_free_channels: ctrl %d, now %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(GOOD);
- }
- else
- {
- log(LL_ERR, "decr_free_channels: controller [%d] already 0 free chans!", controller);
- return(ERROR);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * increment number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-incr_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "incr_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- if(isdn_ctrl_tab[controller].freechans < MAX_CHANCTRL)
- {
- (isdn_ctrl_tab[controller].freechans)++;
- DBGL(DL_CNST, (log(LL_DBG, "incr_free_channels: ctrl %d, now %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(GOOD);
- }
- else
- {
- log(LL_ERR, "incr_free_channels: controller [%d] already 2 free chans!", controller);
- return(ERROR);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * get number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-get_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "get_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- DBGL(DL_CNST, (log(LL_DBG, "get_free_channels: ctrl %d, %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(isdn_ctrl_tab[controller].freechans);
-}
-
-/*--------------------------------------------------------------------------*
- * set channel state to busy
- *--------------------------------------------------------------------------*/
-int
-set_channel_busy(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "set_channel_busy: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- switch(channel)
- {
- case CHAN_B1:
- if(isdn_ctrl_tab[controller].stateb1 == CHAN_RUN)
- {
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_busy: controller [%d] channel B1 already busy!", controller)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb1 = CHAN_RUN;
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_busy: controller [%d] channel B1 set to BUSY!", controller)));
- }
- break;
-
- case CHAN_B2:
- if(isdn_ctrl_tab[controller].stateb2 == CHAN_RUN)
- {
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_busy: controller [%d] channel B2 already busy!", controller)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb2 = CHAN_RUN;
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_busy: controller [%d] channel B2 set to BUSY!", controller)));
- }
- break;
-
- default:
- log(LL_ERR, "set_channel_busy: controller [%d], invalid channel [%d]!", controller, channel);
- return(ERROR);
- break;
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * set channel state to idle
- *--------------------------------------------------------------------------*/
-int
-set_channel_idle(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "set_channel_idle: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- switch(channel)
- {
- case CHAN_B1:
- if(isdn_ctrl_tab[controller].stateb1 == CHAN_IDLE)
- {
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_idle: controller [%d] channel B1 already idle!", controller)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb1 = CHAN_IDLE;
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_idle: controller [%d] channel B1 set to IDLE!", controller)));
- }
- break;
-
- case CHAN_B2:
- if(isdn_ctrl_tab[controller].stateb2 == CHAN_IDLE)
- {
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_idle: controller [%d] channel B2 already idle!", controller)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb2 = CHAN_IDLE;
- DBGL(DL_CNST, (log(LL_DBG, "set_channel_idle: controller [%d] channel B2 set to IDLE!", controller)));
- }
- break;
-
- default:
- log(LL_ERR, "set_channel_idle: controller [%d], invalid channel [%d]!", controller, channel);
- return(ERROR);
- break;
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * return channel state
- *--------------------------------------------------------------------------*/
-int
-ret_channel_state(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- log(LL_ERR, "ret_channel_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- switch(channel)
- {
- case CHAN_B1:
- return(isdn_ctrl_tab[controller].stateb1);
- break;
-
- case CHAN_B2:
- return(isdn_ctrl_tab[controller].stateb2);
- break;
-
- default:
- log(LL_ERR, "ret_channel_state: controller [%d], invalid channel [%d]!", controller, channel);
- return(ERROR);
- break;
- }
- return(ERROR);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/curses.c b/usr.sbin/i4b/isdnd/curses.c
deleted file mode 100644
index b5053828aa52..000000000000
--- a/usr.sbin/i4b/isdnd/curses.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - curses fullscreen output
- * -------------------------------------
- *
- * $Id: curses.c,v 1.27 1998/12/05 18:03:08 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:06:24 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef USE_CURSES
-
-#include "isdnd.h"
-
-#define CHPOS(cfgp) (((cfgp)->isdncontrollerused*2) + (cfgp)->isdnchannelused)
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_screen(void)
-{
- char buffer[512];
- int uheight, lheight;
- int i, j;
- cfg_entry_t *p;
-
- initscr(); /* curses init */
-
- if((COLS < 80) || (LINES < 24))
- {
- log(LL_ERR, "ERROR, minimal screensize must be 80x24, is %dx%d, terminating!",COLS, LINES);
- do_exit(1);
- }
-
- noecho();
- raw();
-
- uheight = ncontroller * 2; /* cards * b-channels */
- lheight = LINES - uheight - 6 + 1; /* rest of display */
-
- if((upper_w = newwin(uheight, COLS, UPPER_B, 0)) == NULL)
- {
- log(LL_ERR, "ERROR, curses init upper window, terminating!");
- exit(1);
- }
-
- if((mid_w = newwin(1, COLS, UPPER_B+uheight+1, 0)) == NULL)
- {
- log(LL_ERR, "ERROR, curses init mid window, terminating!");
- exit(1);
- }
-
- if((lower_w = newwin(lheight, COLS, UPPER_B+uheight+3, 0)) == NULL)
- {
- log(LL_ERR, "ERROR, curses init lower window, LINES = %d, lheight = %d, uheight = %d, terminating!", LINES, lheight, uheight);
- exit(1);
- }
-
- scrollok(lower_w, 1);
-
- sprintf(buffer, "----- isdn controller channel state ------------- isdnd %02d.%02d.%d [pid %d] -", VERSION, REL, STEP, (int)getpid());
-
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(0, 0);
- standout();
- addstr(buffer);
- standend();
-
- move(1, 0);
- /* 01234567890123456789012345678901234567890123456789012345678901234567890123456789 */
- addstr("c tei b remote iface dir outbytes obps inbytes ibps units");
-
- sprintf(buffer, "----- isdn userland interface state ------------------------------------------");
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+2, 0);
- standout();
- addstr(buffer);
- standend();
-
- sprintf(buffer, "----- isdnd logfile display --------------------------------------------------");
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+4, 0);
- standout();
- addstr(buffer);
- standend();
-
- move(uheight+5, 0);
- addstr("Date Time Typ Information Description");
-
- refresh();
-
- for(i=0, j=0; i <= ncontroller; i++, j+=2)
- {
- if(isdn_ctrl_tab[i].tei == -1)
- mvwprintw(upper_w, j, H_CNTL, "%d --- 1 ", i);
- else
- mvwprintw(upper_w, j, H_CNTL, "%d %3d 1 ", i, isdn_ctrl_tab[i].tei);
- mvwprintw(upper_w, j+1, H_CNTL, " L12 2 ");
- }
- wrefresh(upper_w);
-
- for(i=0, j=0; i < nentries; i++) /* walk thru all entries */
- {
- p = &cfg_entry_tab[i]; /* get ptr to enry */
-
- mvwprintw(mid_w, 0, j, "%s%d ", bdrivername(p->usrdevicename), p->usrdeviceunit);
-
- p->fs_position = j;
-
- j += ((strlen(bdrivername(p->usrdevicename)) + (p->usrdeviceunit > 9 ? 2 : 1) + 1));
- }
- wrefresh(mid_w);
-
- wmove(lower_w, 0, 0);
- wrefresh(lower_w);
-
- curses_ready = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "1 - (D)isplay refresh",
- "2 - (H)angup (choose a channel)",
- "3 - (R)eread config file",
- "4 - (Q)uit the program",
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
- fd_set set;
- struct timeval timeout;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- {
- log(LL_WRN, "ERROR, curses init menu window!");
- return;
- }
-
- /* create a border around the window */
-
- box(menu_w, '|', '-');
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- goto mexit;
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case ' ':
- case '\t': /* hilite next option */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case ('0'+WREFRESH+1): /* display refresh */
- case 'D':
- case 'd':
- wrefresh(curscr);
- goto mexit;
-
- case ('0'+WQUIT+1): /* quit program */
- case 'Q':
- case 'q':
- do_exit(0);
- goto mexit;
-
- case ('0'+WHANGUP+1): /* hangup connection */
- case 'H':
- case 'h':
- display_chans();
- goto mexit;
-
- case ('0'+WREREAD+1): /* reread config file */
- case 'R':
- case 'r':
- rereadconfig(42);
- goto mexit;
-
- case '\n':
- case '\r': /* exec highlighted option */
- switch(mpos)
- {
- case WREFRESH:
- wrefresh(curscr);
- break;
-
- case WQUIT:
- do_exit(0);
- break;
-
- case WHANGUP:
- display_chans();
- break;
-
- case WREREAD:
- rereadconfig(42);
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- /* delete the menu window */
-
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(lower_w);
- wrefresh(lower_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display the charge in units
- *---------------------------------------------------------------------------*/
-void
-display_charge(cfg_entry_t *cep)
-{
- mvwprintw(upper_w, CHPOS(cep), H_UNITS, "%d", cep->charge);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display the calculated charge in units
- *---------------------------------------------------------------------------*/
-void
-display_ccharge(cfg_entry_t *cep, int units)
-{
- mvwprintw(upper_w, CHPOS(cep), H_UNITS, "(%d)", units);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display accounting information
- *---------------------------------------------------------------------------*/
-void
-display_acct(cfg_entry_t *cep)
-{
- mvwprintw(upper_w, CHPOS(cep), H_OUT, "%-10d", cep->outbytes);
- mvwprintw(upper_w, CHPOS(cep), H_OUTBPS, "%-4d", cep->outbps);
- mvwprintw(upper_w, CHPOS(cep), H_IN, "%-10d", cep->inbytes);
- mvwprintw(upper_w, CHPOS(cep), H_INBPS, "%-4d", cep->inbps);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display connect information
- *---------------------------------------------------------------------------*/
-void
-display_connect(cfg_entry_t *cep)
-{
- char buffer[256];
-
- /* remote telephone number */
-
- if(aliasing)
- {
- if(cep->direction == DIR_IN)
- sprintf(buffer, "%s", get_alias(cep->real_phone_incoming));
- else
- sprintf(buffer, "%s", get_alias(cep->remote_phone_dialout));
- }
- else
- {
- if(cep->direction == DIR_IN)
- sprintf(buffer, "%s/%s", cep->name, cep->real_phone_incoming);
- else
- sprintf(buffer, "%s/%s", cep->name, cep->remote_phone_dialout);
- }
-
- buffer[H_IFN - H_TELN - 1] = '\0';
-
- mvwprintw(upper_w, CHPOS(cep), H_TELN, "%s", buffer);
-
- /* interface */
-
- mvwprintw(upper_w, CHPOS(cep), H_IFN, "%s%d ",
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- mvwprintw(upper_w, CHPOS(cep), H_IO,
- cep->direction == DIR_OUT ? "out" : "in");
-
- mvwprintw(upper_w, CHPOS(cep), H_OUT, "-");
- mvwprintw(upper_w, CHPOS(cep), H_OUTBPS, "-");
- mvwprintw(upper_w, CHPOS(cep), H_IN, "-");
- mvwprintw(upper_w, CHPOS(cep), H_INBPS, "-");
-
- if(do_bell)
- display_bell();
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * erase line at disconnect time
- *---------------------------------------------------------------------------*/
-void
-display_disconnect(cfg_entry_t *cep)
-{
- wmove(upper_w, CHPOS(cep),
- H_TELN);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-
- if(do_bell)
- display_bell();
-
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_updown(cfg_entry_t *cep, int updown)
-{
- if(updown)
- wstandend(mid_w);
- else
- wstandout(mid_w);
-
- mvwprintw(mid_w, 0, cep->fs_position, "%s%d ",
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- wstandend(mid_w);
- wrefresh(mid_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_l12stat(int controller, int layer, int state)
-{
- if(controller > ncontroller)
- return;
- if(!(layer == 1 || layer == 2))
- return;
-
- if(state)
- wstandout(upper_w);
- else
- wstandend(upper_w);
-
- if(layer == 1)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
- if(!state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- }
- else if(layer == 2)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- if(state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
- }
-
- wstandend(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display TEI
- *---------------------------------------------------------------------------*/
-void
-display_tei(int controller, int tei)
-{
- if(controller > ncontroller)
- return;
-
- if(tei == -1)
- mvwprintw(upper_w, controller*2, H_TEI, "---");
- else
- mvwprintw(upper_w, controller*2, H_TEI, "%3d", tei);
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display bell :-)
- *---------------------------------------------------------------------------*/
-void
-display_bell(void)
-{
- static char bell[1] = { 0x07 };
- write(STDOUT_FILENO, &bell[0], 1);
-}
-
-/*---------------------------------------------------------------------------*
- * display channel information for shutdown
- *---------------------------------------------------------------------------*/
-void
-display_chans(void)
-{
- char buffer[80];
- int i;
- int cnt = 0;
- WINDOW *chan_w;
- int nlines, ncols, pos_x, pos_y;
- fd_set set;
- struct timeval timeout;
- cfg_entry_t *cep = NULL;
-
- /* need this later to close the connection */
- struct ctlr_chan {
- int cntl;
- int chn;
- } *cc = NULL;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
- if((ret_channel_state(i, CHAN_B1)) == CHAN_RUN)
- cnt++;
- if((ret_channel_state(i, CHAN_B2)) == CHAN_RUN)
- cnt++;
- }
-
- if(cnt > 0)
- {
- if ((cc = (struct ctlr_chan *)malloc (cnt *
- sizeof (struct ctlr_chan))) == NULL)
- {
- return;
- }
- nlines = cnt + 4;
- ncols = 60;
- }
- else
- {
- nlines = 5;
- ncols = 22;
- }
-
- pos_y = WMENU_POSLN + 4;
- pos_x = WMENU_POSCO + 10;
-
- /* create a new window in the lower screen area */
-
- if((chan_w = newwin(nlines, ncols, pos_y, pos_x )) == NULL)
- {
- log(LL_WRN, "ERROR, curses init channel window!");
- if (cnt > 0)
- free(cc);
- return;
- }
-
- /* create a border around the window */
-
- box(chan_w, '|', '-');
-
- /* add a title */
-
- wstandout(chan_w);
- mvwaddstr(chan_w, 0, (ncols / 2) - (strlen("Channels") / 2), "Channels");
- wstandend(chan_w);
-
- /* no active channels */
- if (cnt == 0)
- {
- mvwaddstr(chan_w, 2, 2, "No active channels");
- wrefresh(chan_w);
- sleep(1);
-
- /* delete the channels window */
-
- delwin(chan_w);
- return;
- }
-
- nlines = 2;
- ncols = 1;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
-
- if((ret_channel_state(i, CHAN_B1)) == CHAN_RUN)
- {
- sprintf(buffer, "%d - Controller %d channel %s", ncols, i, "B1");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B1;
- nlines++;
- ncols++;
- }
- if((ret_channel_state(i, CHAN_B2)) == CHAN_RUN)
- {
- sprintf(buffer, "%d - Controller %d channel %s", ncols, i, "B2");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B2;
- nlines++;
- ncols++;
- }
- }
-
- for(;;)
- {
- wrefresh(chan_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- break;
-
- ncols = wgetch(chan_w);
-
- if (!(isdigit(ncols)))
- {
- display_bell();
- continue;
- }
-
- nlines = ncols - '0';
-
- if ((nlines == 0) || (nlines > cnt))
- {
- display_bell();
- continue;
- }
-
- if((cep = get_cep_by_cc(cc[nlines-1].cntl, cc[nlines-1].chn))
- != NULL)
- {
- log(LL_CHD, "%05d %s manual disconnect (fullscreen menu)", cep->cdid, cep->name);
- cep->hangup = 1;
- break;
- }
- }
-
- free(cc);
-
- /* delete the channels window */
-
- delwin(chan_w);
-}
-
-#endif
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/dial.c b/usr.sbin/i4b/isdnd/dial.c
deleted file mode 100644
index 4308f98e2053..000000000000
--- a/usr.sbin/i4b/isdnd/dial.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - dial handling routines
- * -----------------------------------
- *
- * $Id: dial.c,v 1.6 1998/12/05 18:03:09 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:06:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * select the first remote number to dial according to the
- * dial strategy
- *---------------------------------------------------------------------------*/
-void
-select_first_dialno(cfg_entry_t *cep)
-{
- int i, j;
-
- if(cep->remote_numbers_count < 1)
- {
- log(LL_ERR, "select_first_dialno: remote_numbers_count < 1!");
- return;
- }
-
- if(cep->remote_numbers_count == 1)
- {
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[0].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_first_dialno: only one no, no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = 0;
- return;
- }
-
- if(cep->remote_numbers_handling == RNH_FIRST)
- {
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[0].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_first_dialno: use first, no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = 0;
- return;
- }
-
- i = cep->last_remote_number;
-
- for(j = cep->remote_numbers_count; j > 0; j--)
- {
- if(cep->remote_numbers[i].flag == RNF_SUCC)
- {
- if(cep->remote_numbers_handling == RNH_LAST)
- {
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[i].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_first_dialno: use last, no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = i;
- return;
- }
- else
- {
- if(++i >= cep->remote_numbers_count)
- i = 0;
-
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[i].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_first_dialno: use next, no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = i;
- return;
- }
- }
-
- if(++i >= cep->remote_numbers_count)
- i = 0;
- }
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[0].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_first_dialno: no last found (use 0), no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * select next remote number to dial (last was unsuccesfull)
- *---------------------------------------------------------------------------*/
-void
-select_next_dialno(cfg_entry_t *cep)
-{
- if(cep->remote_numbers_count < 1)
- {
- log(LL_ERR, "select_next_dialno: remote_numbers_count < 1!");
- return;
- }
-
- if(cep->remote_numbers_count == 1)
- {
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[0].number);
- DBGL(DL_DIAL, (log(LL_DBG, "select_next_dialno: only one no, no = %s", cep->remote_phone_dialout)));
- cep->last_remote_number = 0;
- return;
- }
-
- /* mark last try as bad */
-
- cep->remote_numbers[cep->last_remote_number].flag = RNF_IDLE;
-
- /* next one to try */
-
- cep->last_remote_number++;
-
- if(cep->last_remote_number >= cep->remote_numbers_count)
- cep->last_remote_number = 0;
-
- strcpy(cep->remote_phone_dialout, cep->remote_numbers[cep->last_remote_number].number);
-
- DBGL(DL_DIAL, (log(LL_DBG, "select_next_dialno: index=%d, no=%s",
- cep->last_remote_number,
- cep->remote_numbers[cep->last_remote_number].number)));
-}
-
-/*---------------------------------------------------------------------------*
- * dial succeded, store this number as the last successful
- *---------------------------------------------------------------------------*/
-void
-select_this_dialno(cfg_entry_t *cep)
-{
- cep->remote_numbers[cep->last_remote_number].flag = RNF_SUCC;
-
- DBGL(DL_DIAL, (log(LL_DBG, "select_this_dialno: index = %d, no = %s",
- cep->last_remote_number,
- cep->remote_numbers[cep->last_remote_number].number)));
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/exec.c b/usr.sbin/i4b/isdnd/exec.c
deleted file mode 100644
index 1ed81a1ac866..000000000000
--- a/usr.sbin/i4b/isdnd/exec.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * exec.h - supplemental program/script execution
- * ----------------------------------------------
- *
- * $Id: exec.c,v 1.10 1998/12/05 18:03:11 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:06:49 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#define MAX_PIDS 32
-
-static struct pid_tab {
- pid_t pid;
- cfg_entry_t *cep;
-} pid_tab[MAX_PIDS];
-
-/*---------------------------------------------------------------------------*
- * SIGCHLD signal handler
- *---------------------------------------------------------------------------*/
-void
-sigchild_handler(int sig)
-{
- int retstat;
- register int i;
- pid_t pid;
-
- if((pid = waitpid(-1, &retstat, WNOHANG)) <= 0)
- {
- log(LL_ERR, "ERROR, waitpid: %s", strerror(errno));
- do_exit(1);
- }
- else
- {
- if(WIFEXITED(retstat))
- {
- DBGL(DL_PROC, (log(LL_DBG, "normal child (pid=%d) termination, exitstat = %d",
- pid, WEXITSTATUS(retstat))));
- }
- else if(WIFSIGNALED(retstat))
- {
- if(WCOREDUMP(retstat))
- log(LL_WRN, "child (pid=%d) termination due to signal %d (coredump)",
- pid, WTERMSIG(retstat));
- else
- log(LL_WRN, "child (pid=%d) termination due to signal %d",
- pid, WTERMSIG(retstat));
- }
- }
-
- /* check if hangup required */
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].pid == pid)
- {
- if(pid_tab[i].cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_PROC, (log(LL_DBG, "sigchild_handler: scheduling hangup for cdid %d, pid %d",
- pid_tab[i].cep->cdid, pid_tab[i].pid)));
- pid_tab[i].cep->hangup = 1;
- }
- pid_tab[i].pid = 0;
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * execute prog as a subprocess and pass an argumentlist
- *---------------------------------------------------------------------------*/
-pid_t
-exec_prog(char *prog, char **arglist)
-{
- char tmp[MAXPATHLEN];
- char path[MAXPATHLEN+1];
- pid_t pid;
- int a;
-
- sprintf(path, "%s/%s", ETCPATH, prog);
-
- arglist[0] = path;
-
- tmp[0] = '\0';
-
- for(a=1; arglist[a] != NULL; ++a )
- {
- strcat(tmp, " " );
- strcat(tmp, arglist[a]);
- }
-
- DBGL(DL_PROC, (log(LL_DBG, "exec_prog: %s, args:%s", path, tmp)));
-
- switch(pid = fork())
- {
- case -1: /* error */
- log(LL_ERR, "ERROR, exec_prog/fork: %s", strerror(errno));
- do_exit(1);
- case 0: /* child */
- break;
- default: /* parent */
- return(pid);
- }
-
- /* this is the child now */
-
- if(execvp(path,arglist) < 0 )
- _exit(127);
-
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * run interface up/down script
- *---------------------------------------------------------------------------*/
-int
-exec_connect_prog(cfg_entry_t *cep, const char *prog, int link_down)
-{
- char *argv[32], **av = argv;
- char devicename[MAXPATHLEN], addr[100];
- char *device;
- int s;
- struct ifreq ifr;
-
- /* the obvious things */
- device = bdrivername(cep->usrdevicename);
- sprintf(devicename, "%s%d", device, cep->usrdeviceunit);
- *av++ = (char*)prog;
- *av++ = "-d";
- *av++ = devicename;
- *av++ = "-f";
- *av++ = link_down ? "down" : "up";
-
- /* try to figure AF_INET address of interface */
- addr[0] = '\0';
- memset(&ifr, 0, sizeof ifr);
- ifr.ifr_addr.sa_family = AF_INET;
- strncpy(ifr.ifr_name, devicename, sizeof(ifr.ifr_name));
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s >= 0) {
- if (ioctl(s, SIOCGIFADDR, (caddr_t)&ifr) >= 0) {
- struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr;
- strcpy(addr, inet_ntoa(sin->sin_addr));
- *av++ = "-a";
- *av++ = addr;
- }
- close(s);
- }
-
- /* terminate argv */
- *av++ = NULL;
-
- return exec_prog((char*)prog, argv);
-}
-
-/*---------------------------------------------------------------------------*
- * run answeringmachine application
- *---------------------------------------------------------------------------*/
-int
-exec_answer(cfg_entry_t *cep)
-{
- char *argv[32];
- u_char devicename[MAXPATHLEN];
- int pid;
- char *device;
-
- device = bdrivername(cep->usrdevicename);
-
- sprintf(devicename, "/dev/i4b%s%d", device, cep->usrdeviceunit);
-
- argv[0] = cep->answerprog;
- argv[1] = "-D";
- argv[2] = devicename;
- argv[3] = "-d";
- argv[4] = "unknown";
- argv[5] = "-s";
- argv[6] = "unknown";
- argv[7] = NULL;
-
- /* if destination telephone number avail, add it as argument */
-
- if(*cep->local_phone_incoming)
- argv[4] = cep->local_phone_incoming;
-
- /* if source telephone number avail, add it as argument */
-
- if(*cep->real_phone_incoming)
- argv[6] = cep->real_phone_incoming;
-
- if(*cep->display)
- {
- argv[7] = "-t";
- argv[8] = cep->display;
- argv[9] = NULL;
- }
-
- /* exec program */
-
- DBGL(DL_PROC, (log(LL_DBG, "exec_answer: prog=[%s]", cep->answerprog)));
-
- pid = exec_prog(cep->answerprog, argv);
-
- /* enter pid and conf ptr entry addr into table */
-
- if(pid != -1)
- {
- int i;
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].pid == 0)
- {
- pid_tab[i].pid = pid;
- pid_tab[i].cep = cep;
- break;
- }
- }
- return(GOOD);
- }
- return(ERROR);
-}
-
-/*---------------------------------------------------------------------------*
- * check if a connection has an outstanding process, if yes, kill it
- *---------------------------------------------------------------------------*/
-void
-check_and_kill(cfg_entry_t *cep)
-{
- int i;
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].cep == cep)
- {
- pid_t kp;
-
- DBGL(DL_PROC, (log(LL_DBG, "check_and_kill: killing pid %d", pid_tab[i].pid)));
-
- kp = pid_tab[i].pid;
- pid_tab[i].pid = 0;
- kill(kp, SIGHUP);
- break;
- }
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/fsm.c b/usr.sbin/i4b/isdnd/fsm.c
deleted file mode 100644
index 13d57783cd9b..000000000000
--- a/usr.sbin/i4b/isdnd/fsm.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * FSM for isdnd
- * -------------
- *
- * $Id: fsm.c,v 1.15 1998/12/05 18:03:12 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:07:31 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/* table of state descriptions */
-
-static char *state_text[N_STATES] = {
- "idle",
- "dialing",
- "waitdialretry",
- "dialretry",
-
- "pcb-dialing",
- "pcb-dialfail",
- "pcb-waitcall",
-
- "acb-waitdisc",
- "acb-waitdial",
- "acb-dialing",
- "acb-dialfail",
-
- "accepted",
- "connected",
- "waitdisconnect",
- "down",
- "alert",
-
- "Illegal State"
-};
-
-/* table of event descriptions */
-
-static char *event_text[N_EVENTS] = {
-
- /* incoming messages */
-
- "msg-con-ind",
- "msg-con-act-ind",
- "msg-disc-ind",
- "msg-dialout",
-
- /* local events */
-
- "timeout",
- "disconnect-req",
- "callback-req",
- "alert-req",
-
- /* illegal */
-
- "Illegal Event"
-};
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_ill: Illegal State reached !!!")));
-}
-
-/*---------------------------------------------------------------------------*
- * No change, No action
- *---------------------------------------------------------------------------*/
-static void
-F_NcNa(cfg_entry_t *cep)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * incoming CONNECT, accepting call
- *---------------------------------------------------------------------------*/
-static void
-F_MCI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_MCI: tx SETUP_RESP_ACCEPT")));
- sendm_connect_resp(cep, cep->cdid, SETUP_RESP_ACCEPT, 0);
- start_timer(cep, TIMEOUT_CONNECT_ACTIVE);
-}
-
-/*---------------------------------------------------------------------------*
- * incoming connect active, call is now active
- *---------------------------------------------------------------------------*/
-static void
-F_MCAI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_MCAI: Connection active!")));
-
- stop_timer(cep);
-
- if((cep->dialin_reaction == REACT_ANSWER) &&
- (cep->b1protocol == BPROT_NONE))
- {
- exec_answer(cep);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout
- *---------------------------------------------------------------------------*/
-static void
-F_TIMO(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_TIMO: Timout occured!")));
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * incoming disconnect indication
- *---------------------------------------------------------------------------*/
-static void
-F_IDIS(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_IDIS: disconnect indication")));
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * local disconnect request
- *---------------------------------------------------------------------------*/
-static void
-F_DRQ(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_DRQ: local disconnect request")));
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
-}
-
-/*---------------------------------------------------------------------------*
- * disconnect indication after local disconnect req
- *---------------------------------------------------------------------------*/
-static void
-F_MDI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_MDI: disconnect indication, local disconnected")));
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * local requested outgoing dial
- *---------------------------------------------------------------------------*/
-static void
-F_DIAL(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_DIAL: local dial out request")));
-
- if(cep->dialrandincr)
- cep->randomtime = (random() & RANDOM_MASK) + cep->recoverytime;
-
- cep->dial_count = 0;
-
- select_first_dialno(cep);
-
- sendm_connect_req(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * outgoing dial successfull
- *---------------------------------------------------------------------------*/
-static void
-F_DOK(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_DOK: dial out ok")));
- select_this_dialno(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * outgoing dial fail (ST_SUSE !!!)
- *---------------------------------------------------------------------------*/
-static void
-F_DFL(cfg_entry_t *cep)
-{
- cep->last_release_time = time(NULL);
-
- if(cep->dialouttype == DIALOUT_NORMAL)
- {
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_STATE, (log(LL_DBG, "F_DFL: dial fail, dial retry")));
- select_next_dialno(cep);
- cep->cdid = CDID_RESERVED;
- cep->state = ST_DIALRTMRCHD;
- return;
- }
-
- /* retries exhausted */
-
- if(!cep->usedown)
- {
- DBGL(DL_STATE, (log(LL_DBG, "F_DFL: dial retry fail, dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- return;
- }
-
- /* interface up/down active */
-
- cep->down_retry_count++;
-
- if(cep->down_retry_count > cep->downtries)
- {
- /* set interface down */
- DBGL(DL_STATE, (log(LL_DBG, "F_DFL: dial retry cycle fail, setting interface down!")));
- dialresponse(cep, DSTAT_PFAIL);
- if_down(cep);
- cep->state = ST_DOWN;
- }
- else
- {
- /* enter new dial retry cycle */
- DBGL(DL_STATE, (log(LL_DBG, "F_DFL: dial retry cycle fail, enter new retry cycle!")));
- select_next_dialno(cep);
- cep->state = ST_DIALRTMRCHD;
- }
-
- cep->dial_count = 0;
- cep->cdid = CDID_RESERVED;
- }
- else /* cdp->dialouttype == DIALOUT_CALLEDBACK */
- {
- DBGL(DL_STATE, (log(LL_DBG, "F_DFL: calledback dial done, wait for incoming call")));
- cep->cdid = CDID_RESERVED;
- cep->state = ST_PCB_WAITCALL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * local requested outgoing dial
- *---------------------------------------------------------------------------*/
-static void
-F_ACBW(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_ACBW: local callback, wait callback recovery time")));
-
- if(cep->dialrandincr)
- cep->randomtime = (random() & RANDOM_MASK) + cep->recoverytime;
-
- cep->dial_count = 0;
-
- cep->cdid = CDID_RESERVED;
-}
-
-/*---------------------------------------------------------------------------*
- * active callback dialout retry (ST_SUSE !!!)
- *---------------------------------------------------------------------------*/
-static void
-F_ACBR(cfg_entry_t *cep)
-{
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_STATE, (log(LL_DBG, "F_ACBR: dial fail, dial retry")));
- select_next_dialno(cep);
- cep->cdid = CDID_RESERVED;
- cep->state = ST_ACB_DIALFAIL;
- return;
- }
-
- /* retries exhausted */
-
- if(!cep->usedown)
- {
- DBGL(DL_STATE, (log(LL_DBG, "F_ACBR: dial retry fail, dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- return;
- }
-
- /* interface up/down active */
-
- cep->down_retry_count++;
-
- if(cep->down_retry_count > cep->downtries)
- {
- /* set interface down */
- DBGL(DL_STATE, (log(LL_DBG, "F_ACBR: dial retry cycle fail, setting interface down!")));
- dialresponse(cep, DSTAT_PFAIL);
- if_down(cep);
- cep->state = ST_DOWN;
- }
- else
- {
- /* enter new dial retry cycle */
- DBGL(DL_STATE, (log(LL_DBG, "F_ACBR: dial retry cycle fail, enter new retry cycle!")));
- select_next_dialno(cep);
- cep->state = ST_ACB_DIALFAIL;
- }
-
- cep->dial_count = 0;
- cep->cdid = CDID_RESERVED;
-}
-
-/*---------------------------------------------------------------------------*
- * local requested to send ALERT message
- *---------------------------------------------------------------------------*/
-static void
-F_ALRT(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (log(LL_DBG, "F_ALRT: local send alert request")));
-
- cep->alert_time = cep->alert;
-
- sendm_alert_req(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * isdn daemon state transition table
- *---------------------------------------------------------------------------*/
-struct state_tab {
- void(*func)(cfg_entry_t *cep); /* function to execute */
- int newstate; /* next state */
-} state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_IDLE ST_DIAL ST_DIALRTMRCHD ST_DIALRETRY ST_PCB_DIAL ST_PCB_DIALFAIL ST_PCB_WAITCALL ST_ACB_WAITDISC ST_ACB_WAITDIAL ST_ACB_DIAL ST_ACB_DIALFAIL ST_ACCEPTED ST_CONNECTED ST_WAITDISCI ST_DOWN ST_ALERT ST_ILLEGAL */
-/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/* messages */
-/* EV_MCI */{{F_MCI, ST_ACCEPTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_MCI, ST_ACCEPTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_MCI, ST_ACCEPTED}, {F_ill, ST_ILL}},
-/* EV_MCAI */{{F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_MCAI,ST_CONNECTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_MDI */{{F_ill, ST_ILL}, {F_DFL, ST_SUSE}, {F_ill, ST_ILL}, {F_DFL, ST_SUSE}, {F_DFL, ST_SUSE}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ACBW,ST_ACB_WAITDIAL},{F_ill, ST_ILL}, {F_ACBR, ST_SUSE}, {F_ACBR,ST_SUSE}, {F_IDIS,ST_IDLE}, {F_IDIS,ST_IDLE}, {F_MDI, ST_IDLE}, {F_ill, ST_ILL}, {F_MDI, ST_IDLE}, {F_ill, ST_ILL}},
-/* EV_MDO */{{F_DIAL,ST_DIAL}, {F_NcNa,ST_DIAL}, {F_NcNa,ST_DIALRTMRCHD},{F_NcNa,ST_DIALRETRY}, {F_NcNa,ST_PCB_DIAL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-
-/* local requests */
-/* EV_TIMO */{{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_TIMO,ST_IDLE}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_DRQ */{{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_DRQ, ST_WAITDISCI}, {F_NcNa,ST_WAITDISCI}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_CBRQ */{{F_NcNa,ST_ACB_WAITDIAL},{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_NcNa,ST_ACB_WAITDIAL},{F_NcNa, ST_ACB_DIAL}, {F_NcNa,ST_ACB_DIALFAIL},{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_ALRT */{{F_ALRT,ST_ALERT}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-
-/* illegal */
-
-/* EV_ILL */{{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void
-next_state(cfg_entry_t *cep, int event)
-{
- int currstate, newstate;
-
- if(event > N_EVENTS)
- {
- log(LL_ERR, "FSM: event > N_EVENTS");
- do_exit(1);
- }
-
- currstate = cep->state;
-
- if(currstate > N_STATES)
- {
- log(LL_ERR, "FSM: currstate > N_STATES");
- do_exit(1);
- }
-
- newstate = state_tab[event][currstate].newstate;
-
- if(newstate > N_STATES)
- {
- log(LL_ERR, "FSM: newstate > N_STATES");
- do_exit(1);
- }
-
- if(newstate != ST_SUSE)
- {
- DBGL(DL_STATE, (log(LL_DBG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate])));
- }
-
- (*state_tab[event][currstate].func)(cep);
-
- if(newstate == ST_ILL)
- {
- log(LL_ERR, "FSM ILLEGAL STATE, event=%s: oldstate=%s => newstate=%s]",
- event_text[event],
- state_text[currstate],
- state_text[newstate]);
- }
-
- if(newstate == ST_SUSE)
- {
- DBGL(DL_STATE, (log(LL_DBG, "FSM (SUSE) event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[cep->state])));
- }
- else
- {
- cep->state = newstate;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-printstate(cfg_entry_t *cep)
-{
- return((char *) state_text[cep->state]);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/isdnd.8 b/usr.sbin/i4b/isdnd/isdnd.8
deleted file mode 100644
index 9913487e1a64..000000000000
--- a/usr.sbin/i4b/isdnd/isdnd.8
+++ /dev/null
@@ -1,419 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdnd.8,v 1.20 1998/12/18 09:47:09 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 12 21:13:59 1998]
-.\"
-.Dd November 3, 1998
-.Dt isdnd 8
-.Sh NAME
-.Nm isdnd
-.Nd isdn4bsd ISDN connection management daemon
-.Sh SYNOPSIS
-.Nm isdnd
-.Op Fl b
-.Op Fl c Ar configfile
-.Op Fl d Ar debuglevel
-.Op Fl f
-.Op Fl F
-.Op Fl l
-.Op Fl L Ar logfile
-.Op Fl P
-.Op Fl r Ar device
-.Op Fl s Ar facility
-.Op Fl t Ar terminaltype
-.Op Fl u Ar charging unit length
-.Op Fl m
-.Sh DESCRIPTION
-.Nm Isdnd
-is the isdn4bsd package demon which manages all ISDN related connection
-and disconnection of ISDN devices supported by the package.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl b
-Bell: in full-screen mode, ring the bell when connecting
-or disconnecting a call.
-.It Fl c
-Use
-.Ar configfile
-as the name of the runtime configuration filename for
-.Nm isdnd
-instead of the default file
-.Li /etc/isdn/isdnd.rc .
-.It Fl d
-If debugging support is compiled into
-.Nm isdnd
-this option is used to specify the debugging level, or better which kind
-of debugging messages are displayed. The debugging level is the sum of the
-following values:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar 0x001
-general debugging.
-.It Ar 0x002
-rates calculation.
-.It Ar 0x004
-timing calculations.
-.It Ar 0x008
-state transitions.
-.It Ar 0x010
-retry handling.
-.It Ar 0x020
-dialing.
-.It Ar 0x040
-process handling.
-.It Ar 0x080
-isdn4bsd kernel i/o calls.
-.It Ar 0x100
-controller and channel busy/free messages.
-.El
-.Pp
-The value can be specified in any number base supported by the
-.Xr sscanf 3
-library routine.
-.Pp
-In addition, this option accepts also the character 'n' as an argument to
-disable displaying debug messages on the full-screen display.
-.Pp
-.It Fl f
-Specifying this option causes
-.Nm isdnd
-to enter the full-screen mode of operation. When operating in this mode,
-entering the control character
-.Em Control-L
-causes the display to be refreshed and entering
-.Em Carriage-Return
-or
-.Em Enter
-will pop-up a command window. Because the
-.Nm
-daemon will not listen to messages while the command window is active,
-this command window will disappear automatically after 5 seconds without
-any command key press.
-.Pp
-While the command window is active,
-.Em Tab
-or
-.Em Space
-advances to the next menu item. To execute a command, press
-.Em Return
-or
-.Em Enter
-for the highlighted menu item, or enter the number corresponding to the
-item to be executed or enter the capitalized character in the menu item
-description.
-.It Fl l
-If this option is set, logging is not done via the
-.Xr syslogd 8
-facility but instead is appended to a file.
-.It Fl L
-Specifies the name of the logfile which is used when the option
-.Em -l
-is set.
-.It Fl P
-This option prints out the parsed and verified isdnd configuration in the same
-format as the isdnd.rc file. This output can be used as an isdnd.rc file. This
-feature is especially useful when debugging an isdnd.rc file to see, what the
-default settings of options are when they are not set in the isdnd.rc input
-file.
-.Pp
-The
-.Nm
-exits after the printout is done.
-.It Fl F
-This option prevents
-.Nm isdnd
-to detach from the controlling tty and become a daemon.
-.It Fl r
-In conjunction with the
-.Fl t
-option,
-.Ar device
-specifies a terminal device which becomes the controlling tty for
-.Nm isdnd
-and on which the full-screen mode output is displayed.
-.It Fl s
-This option may be used to specify the logging facility in case
-.Xr syslog 3
-logging is configured and another facility than the default LOCAL0
-facility shall be used. The facility is to be specified as an integer in
-the range 0-11 or 16-23 (see the file /usr/include/syslog.h).
-.It Fl t
-In conjunction with the
-.Fl f
-and
-.Fl r
-options,
-.Ar terminaltype
-specifies a terminal type or termcap entry name (such as vt220) for the device
-used for
-.Nm isdnd
-full-screen output. This is useful if an unused (no getty running) tty line is
-used for full-screen output for which no
-.Li TERM
-environment variable exists.
-.It Fl u
-Specifies the length of a charging unit in case the config file entry
-keyword
-.Em unitlenghtsrc
-is set to
-.Em cmdl .
-.It Fl m
-If the isdn daemon is compiled with local or remote monitoring support,
-this option disables all monitoring access. It overrides the config
-file option
-.Em monitor-allowed .
-.El
-.Pp
-.Sh INTERACTION WITH THE KERNEL
-.Nm Isdnd
-communicates with the kernel part of isdn4bsd by receiving status and
-event messages (
-.Xr read 2
-from device /dev/i4b ) and by transmitting commands and responses (
-.Xr ioctl 2
-from device /dev/i4b ).
-.Pp
-The messages and message parameters are documented in the include
-file
-.Em /usr/include/machine/i4b_ioctl.h .
-.Pp
-Supported command and response messages (ioctl's) to the kernel are:
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I4B_CDID_REQ
-Request a unique Call Description IDentifier (cdid) which identifies
-uniquely a single interaction of the local D channel with the exchange.
-.It Ar I4B_CONNECT_REQ
-Actively request a call setup to a remote ISDN subscriber.
-.It Ar I4B_CONNECT_RESP
-Respond to an incoming call, either accept, reject or ignore it.
-.It Ar I4B_DISCONNECT_REQ
-Actively terminate a connection.
-.It Ar I4B_CTRL_INFO_REQ
-Request information about an installed ISDN controller card.
-.It Ar I4B_DIALOUT_RESP
-Give information about call setup to driver who requested dialing out.
-.It Ar I4B_TIMEOUT_UPD
-Update the kernels timeout value(s) in case of dynamically calculated
-shorthold mode timing changes.
-.It Ar I4B_UPDOWN_IND
-Inform the kernel userland drivers about interface soft up/down status
-changes.
-.It Ar I4B_CTRL_DOWNLOAD
-Download firmware to active card(s).
-.It Ar I4B_ACTIVE_DIAGNOSTIC
-Return diagnostic information from active cards.
-.El
-.Pp
-.Pp
-Supported status and event messages from the kernel are:
-.Bl -tag -width Ds -compact -offset indent
-.It Ar MSG_CONNECT_IND
-An incoming call from a remote ISDN user is indicated.
-.It Ar MSG_CONNECT_ACTIVE_IND
-After an incoming call has been accepted locally or an outgoing call has
-been accepted by a remote, the exchange signaled an active connection
-and the corresponding B-channel is switched through.
-.It Ar MSG_DISCONNECT_IND
-A call was terminated.
-.It Ar MSG_DIALOUT_IND
-A userland interface driver requests the daemon to dial out (typically a
-network interface when a packet arrives in its send queue).
-.It Ar MSG_IDLE_TIMEOUT_IND
-A call was terminated by the isdn4bsd kernel driver because a B-channel
-idle timeout occurred.
-.It Ar MSG_ACCT_IND
-Accounting information from a network driver.
-.It Ar MSG_CHARGING_IND
-Charging information from the kernel.
-.El
-.Pp
-.Ss OUTGOING CALLS
-Currently the only possibility to trigger an outgoing call is that an
-isdn4bsd network driver
-.Em (ipr<n>)
-sends a
-.Em MSG_DIALOUT_IND
-to the
-.Nm
-daemon.
-.Pp
-The daemon requests a new CDID from the kernel by using the
-.Em I4B_CDID_REQ
-ioctl message, this CDID is now used in all interactions with the kernel
-to identify this single call until a disconnect occurs.
-.Pp
-After getting the CDID, the daemon looks up several additional information
-in its entry section of the configuration corresponding to that connection
-and issues a
-.Em I4B_CONNECT_REQ
-ioctl message to the kernel. The kernel now dials the remote side and
-if the remote side accepts the call, the kernel sends a
-.Em MSG_CONNECT_ACTIVE_IND
-to the daemon.
-.Pp
-The call is terminated by either the local site timing out or the remote
-side hanging up the connection or the local side actively sending a
-.Em DISCONNECT_REQ
-ioctl message, both events are signaled to the
-.Nm
-by the kernel sending the
-.Em DISCONNECT_IND
-message and the CDID corresponding to the call is no longer valid.
-.Pp
-.Ss INCOMING CALLS
-Incoming calls are signaled to the
-.Nm
-by the kernel transmitting the
-.Em MSG_CONNECT_IND
-message to the daemon.
-.Pp
-With the information contained in this message, the
-.Nm
-searches the entry section of its configuration database and if a match is
-found, it accepts or rejects the call or, of no match is found, it ignores the
-call - all by issuing a
-.Em I4B_CONNECT_RESP
-ioctl message with the appropriate parameters to the kernel.
-.Pp
-In case the daemon decided to accept the message, the kernel signal the then
-active connection by sending a
-.Em MSG_CONNECT_ACTIVE_IND
-message to the daemon.
-.Pp
-The call is terminated by either the local site timing out or the remote
-side hanging up the connection or the local side actively sending a
-.Em DISCONNECT_REQ
-ioctl message, both events are signaled to the
-.Nm
-by the kernel sending the
-.Em DISCONNECT_IND
-message and the CDID corresponding to the call is no longer valid.
-.Pp
-
-.Sh SIGNALS
-
-Sending a HUP signal to
-.Nm
-causes all open connections to be terminated and the configuration file is
-reread. In case aliasfile handling was enabled, the aliasfile is also
-reread.
-
-Sending a USR1 signal to
-.Nm
-causes the accounting file and the logfile (if logging to a file is used
-instead of logging via the
-.Xr syslog 3
-facility) to be closed and reopened to make logfile rotation possible.
-
-.Sh ENVIRONMENT
-The following environment variables affect the execution of
-.Nm isdnd :
-.Bl -tag -width Ds
-.It Ev TERM
-The terminal type when running in full-screen display mode.
-See
-.Xr environ 7
-for more information.
-.El
-
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rates -compact
-.It Pa /dev/i4b
-The device-file used to communicate with the kernel ISDN driver subsystem.
-
-.It Pa /var/log/messages
-A record of the actions in case of syslogd logging support.
-
-.It Pa /var/log/isdnd.acct
-The default accounting information filename (if accounting is configured).
-
-.It Pa /var/log/isdnd.log
-The default logging filename (if logging to a file is configured).
-
-.It Pa /var/run/isdnd.pid
-The process id of the isdn daemon (also known as "lockfile" to isdnd, preventing multiple invocations of it).
-
-.It Pa /usr/local/lib/isdn
-.It Pa /etc/isdn
-The directory where isdnd expects some supplementary data files and programs
-for telephone answering support.
-
-.It Pa /etc/isdn/isdnd.rc
-The default runtime configuration file.
-
-.It Pa /etc/isdn/isdnd.rates
-The default unit charging rates specification file.
-
-.It Pa /etc/isdn/isdntel.alias
-The default table (if aliasing is enabled) to convert phone number to caller's name.
-.El
-
-.Sh EXAMPLES
-For a first try, the following command should be used to start
-.Nm
-in foreground mode for better debugging the configuration setup:
-.Bd -literal -offset indent
-isdnd -d0xf9 -F
-.Ed
-.Pp
-This will start isdnd with reasonable debugging settings and produce
-output on the current terminal.
-.Nm Isdnd
-can then be terminated by entering Control-C.
-.Pp
-Another example, the command:
-.Bd -literal -offset indent
-isdnd -d0xf9 -f -r /dev/ttyv3 -t vt100
-.Ed
-.Pp
-will start
-.Nm isdnd
-with reasonable debugging messages enabled, full-screen mode of operation,
-full-screen display redirected to /dev/ttyv03 and using a termcap entry
-for vt100 on this display.
-
-.Sh DIAGNOSTICS
-Exit status is 0 on success, 1 on error.
-.Pp
-
-.Sh SEE ALSO
-.Xr syslogd 8 ,
-.Xr isdntrace 8 ,
-.Xr isdntel 8 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd.rates 5 ,
-.Xr i4bisppp 4 ,
-.Xr i4bipr 4
-
-.Sh BUGS
-Still one or more left.
-
-.Sh AUTHOR
-The
-.Nm
-daemon and this manual page were written by Hellmuth Michaelis. He can
-be contacted at hm@kts.org or hm@hcs.de.
diff --git a/usr.sbin/i4b/isdnd/isdnd.acct.5 b/usr.sbin/i4b/isdnd/isdnd.acct.5
deleted file mode 100644
index 9329e80c8730..000000000000
--- a/usr.sbin/i4b/isdnd/isdnd.acct.5
+++ /dev/null
@@ -1,108 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdnd.acct.5,v 1.6 1998/12/05 18:03:18 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:09:33 1998]
-.\"
-.Dd September 11, 1998
-.Dt isdnd.acct 5
-.Sh NAME
-.Nm isdnd.acct
-.Nd isdn4bsd ISDN management daemon accounting file format
-.Sh DESCRIPTION
-The file
-.Pa isdnd.acct
-contains accounting information which is written if the variable
-.Em useacctfile
-in the
-.Xr isdnd 8
-configuration file
-.Xr isdnd.rc 5
-is set to
-.Em on
-and charging information transmission has been subscribed for the
-ISDN connection (AOCD or AOCE).
-.Pp
-If the variable
-.Em acctall
-is set to
-.Em on ,
-accounting information is written even if the local site was not charged
-or no charging information is available or is not subscribed.
-.Pp
-The general format of an accounting line is a follows:
-.Pp
-.Dl FROM - UNTIL NAME UNITS (SECONDS) (INBYTES/OUTBYTES)
-.Pp
-.Em FROM
-is the time the connection was established in the format
-.Dl Day:Month:Year Hour:Minutes:seconds
-.Pp
-.Em UNTIL
-is the time the connection was closed. The format is the same as
-described for
-.Em FROM
-above.
-.Pp
-.Em NAME
-is the symbolic name got from the
-.Em name
-entry of the
-.Xr isdnd.rc 5
-config file for this connection.
-.Pp
-.Em UNITS
-is the amount of charging units billed for the connection.
-.Pp
-.Em SECONDS
-is the number of seconds the connection lasted.
-.Pp
-.Em INBYTES
-and
-.Em OUTBYTES
-is the (optional) number of bytes that were transferred.
-
-.Sh FILES
-.Bl -tag -width /var/log/isdnd.acct -compact
-.It Pa /var/log/isdnd.acct
-The default accounting information file for the
-.Nm isdnd
-ISDN daemon.
-
-.Sh EXAMPLES
-This is a typical accounting line:
-.Pp
-.Dl 12.06.97 10:41:37 - 12.06.97 10:45:18 GROGGY 2 (65) (4711/1147)
-
-.Sh SEE ALSO
-.Xr isdnd 8 ,
-.Xr isdnd.rc 5
-
-.Sh AUTHOR
-The
-.Xr isdnd 8
-daemon and this manual page were written by Hellmuth Michaelis.
-He can be contacted at hm@kts.org or hm@hcs.de.
-
diff --git a/usr.sbin/i4b/isdnd/isdnd.h b/usr.sbin/i4b/isdnd/isdnd.h
deleted file mode 100644
index 009a2dde10f5..000000000000
--- a/usr.sbin/i4b/isdnd/isdnd.h
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - main header file
- * -----------------------------
- *
- * $Id: isdnd.h,v 1.56 1998/12/16 13:39:46 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:06:39 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _ISDND_H_
-#define _ISDND_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <strings.h>
-#include <ctype.h>
-#include <syslog.h>
-#include <regex.h>
-
-#ifdef USE_CURSES
-#include <curses.h>
-#endif
-
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#ifdef USE_RTPRIO
-#include <sys/rtprio.h>
-#endif
-
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-
-#include "config.h" /* compile time configuration */
-#include "pathnames.h" /* location of files */
-#include "alias.h" /* alias file processing */
-
-/*---------------------------------------------------------------------------*
- * some general definitions
- *---------------------------------------------------------------------------*/
-#define GOOD 0 /* general "good" or "ok" return*/
-#define ERROR (-1) /* general error return */
-#define WARNING (-2) /* warning return */
-#define INVALID (-1) /* an invalid integer */
-
-/*---------------------------------------------------------------------------*
- * misc
- *---------------------------------------------------------------------------*/
-#define RTPRIO_NOTUSED (-1) /* rtprio is not used for isdnd */
-
-/*---------------------------------------------------------------------------*
- * debug flag bits
- *---------------------------------------------------------------------------*/
-#define DL_MSG 0x0001 /* general debug messages */
-#define DL_RATES 0x0002 /* messages related to rates */
-#define DL_TIME 0x0004 /* messages related to timing */
-#define DL_STATE 0x0008 /* messages related to states changes */
-#define DL_RCVRY 0x0010 /* messages related to dial recovery */
-#define DL_DIAL 0x0020 /* messages related to dial recovery */
-#define DL_PROC 0x0040 /* messages related to process handling */
-#define DL_DRVR 0x0080 /* messages related to kernel i4b msg i/o*/
-#define DL_CNST 0x0100 /* messages related to controller state */
-
-#ifdef DEBUG
-#define DBGL(cond, dolog) if(cond & debug_flags) dolog
-#else
-#define DBGL(cond, dolog)
-#endif
-
-/*---------------------------------------------------------------------------*
- * curses fullscreen display definitions
- *---------------------------------------------------------------------------*/
-
-/* window dimensions */
-#define UPPER_B 2 /* upper window start */
-
-/* horizontal positions for upper window */
-#define H_CNTL 0 /* controller */
-#define H_TEI 2 /* TEI */
-#define H_CHAN (H_TEI+4) /* channel */
-#define H_TELN (H_CHAN+2) /* telephone number */
-#define H_IFN (H_TELN+23) /* interfacename */
-#define H_IO (H_IFN+7) /* incoming or outgoing */
-#define H_OUT (H_IO+4) /* # of bytes out */
-#define H_OUTBPS (H_OUT+11) /* bytes per second out */
-#define H_IN (H_OUTBPS+5) /* # of bytes in */
-#define H_INBPS (H_IN+11) /* bytes per second in */
-#define H_UNITS (H_INBPS+6) /* # of charging units */
-
-/* fullscreen mode menu window */
-#define WMENU_LEN 35 /* width of menu window */
-#define WMENU_TITLE "Command" /* title string */
-#define WMENU_POSLN 10 /* menu position, line */
-#define WMENU_POSCO 5 /* menu position, col */
-#define WMITEMS 4 /* no of menu items */
-#define WMENU_HGT (WMITEMS + 4) /* menu window height */
-
-#define WREFRESH 0
-#define WHANGUP 1
-#define WREREAD 2
-#define WQUIT 3
-
-#define WMTIMEOUT 5 /* timeout in seconds */
-
-/*---------------------------------------------------------------------------*
- * charging rates
- *---------------------------------------------------------------------------*/
-#define NDAYS 7 /* number of days in a week */
-#define NRATES 4 /* number of rate structures supported */
-
-/* struct for rates - each day has one or more */
-struct rates
-{
- int start_hr; /* hour at which this rate starts, e.g. 12 */
- int start_min; /* minute of start ... */
- int end_hr; /* hour at which this rate ends, e.g. 19 */
- int end_min; /* minute of end ... */
- int rate; /* how long can I telephone at this price, seconds */
- struct rates *next;
-};
-
-/*---------------------------------------------------------------------------*
- * the internal identifiers for isdnd log levels. CAUTION: this has to stay
- * in sync with the loglevel to text and sysloglevel table in log.c !!
- *---------------------------------------------------------------------------*/
-enum logids
-{
- LL_ERR, /* error conditions - everything which caused an error */
- LL_WRN, /* warning conditions - nonfatal abnormal conditions */
- LL_DMN, /* normal but significant condition - status of daemon */
- LL_CHD, /* informational - everything regarding call handling */
- LL_DBG /* debug messages - everything which helps debugging */
-};
-
-/*---------------------------------------------------------------------------*
- * state machine events
- *---------------------------------------------------------------------------*/
-enum events
-{
- /* incoming messages */
-
- EV_MCI, /* MSG_CONNECT_IND */
- EV_MCAI, /* MSG_CONNECT_ACTIVE_IND */
- EV_MDI, /* MSG_DISCONNECT_IND */
- EV_MDO, /* MSG_DIALOUT */
-
- /* local requests */
-
- EV_TIMO, /* timer expired */
- EV_DRQ, /* disconnect request */
- EV_CBRQ, /* callback request */
- EV_ALRT, /* alerting request */
-
- /* illegal */
-
- EV_ILL /* illegal event */
-};
-
-#define N_EVENTS (EV_ILL+1) /* no of possible events */
-
-/*---------------------------------------------------------------------------*
- * this struct describes the numbers to try to dial out
- *---------------------------------------------------------------------------*/
-typedef struct {
- char number[TELNO_MAX]; /* remote number to dial */
- int flag; /* usage flag */
-#define RNF_IDLE 0
-#define RNF_SUCC 1 /* last dial was ok */
-} remote_number_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes numbers allowed to dial in
- *---------------------------------------------------------------------------*/
-typedef struct {
- char number[TELNO_MAX]; /* calling party number */
-} incoming_number_t;
-
-/*---------------------------------------------------------------------------*
- * this structure describes a prematurely aborted called-back dialout
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call handle */
- int controller; /* the controller used to dial out */
- int channel; /* the channel assigned to the outgoing call */
- /* XXX - timeout handling and error recovery? */
-} phantom_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes one complete configuration entry
- *---------------------------------------------------------------------------*/
-typedef struct cfg_entry {
-
- /* ====== filled in at startup configuration, then static ===========*/
-
- char name[32]; /* id for this entry */
-
- int isdncontroller; /* controller to use 0 ... n */
- int isdnchannel; /* channel to use */
-
- int isdntxdelin; /* tx delay, incoming connections */
- int isdntxdelout; /* tx delay, outgoing connections */
-
- int usrdevicename; /* userland device to use */
- int usrdeviceunit; /* userland unit to use */
-
- int remote_numbers_count; /* number of remote numbers */
-#define MAXRNUMBERS 8 /* max remote numbers */
-
- remote_number_t remote_numbers[MAXRNUMBERS]; /* remote numbers to dial */
-
- int remote_numbers_handling; /* how to handle the remote dialing */
-#define RNH_NEXT 0 /* use next number after last successfull */
-#define RNH_LAST 1 /* use last successfull for next call */
-#define RNH_FIRST 2 /* always use first number for next call */
-
- char local_phone_dialout[TELNO_MAX]; /* our number to tell remote*/
- char local_phone_incoming[TELNO_MAX]; /* answer calls for this local number */
-
-#define MAX_INCOMING 8
- int incoming_numbers_count; /* number of incoming allowed numbers */
- incoming_number_t remote_phone_incoming[MAX_INCOMING]; /* answer calls from this remote machine */
-
- int dialin_reaction; /* what to do with incoming calls */
-#define REACT_ACCEPT 0
-#define REACT_REJECT 1
-#define REACT_IGNORE 2
-#define REACT_ANSWER 3
-#define REACT_CALLBACK 4
-
- int b1protocol; /* hdlc / raw */
-
- int idle_time_in; /* max idle time incoming calls */
- int idle_time_out; /* max idle time outgoing calls */
-
- int unitlength; /* length of a charging unit */
-#define UNITLENGTH_DEFAULT 60 /* last resort unit length */
-
- int earlyhangup; /* time in seconds to hangup */
- /* before the next expected */
- /* charging unit */
-#define EARLYHANGUP_DEFAULT 5
-
- int ratetype; /* type of rate */
-#define NO_RATE (NRATES+1)
-#define INVALID_RATE (-1)
-
- int unitlengthsrc; /* where we get the unit length from */
-#define ULSRC_NONE 0 /* nowhere specified */
-#define ULSRC_CMDL 1 /* specified on commandline */
-#define ULSRC_CMDLMIN 5 /* minimum value from cmdl */
-#define ULSRC_CMDLMAX 3600 /* minimum value from cmdl */
-#define ULSRC_CONF 2 /* get it from config file */
-#define ULSRC_RATE 3 /* get it dynamic from ratesfile*/
-#define ULSRC_DYN 4 /* dynamic calculated from AOCD */
-
- char *answerprog; /* program to use for answering */
- char *connectprog; /* program run after negotiation finished */
- char *disconnectprog; /* program run after shutdown is complete */
-
- int callbackwait; /* time to wait before calling back */
-#define CALLBACKWAIT_MIN 1
-
- int calledbackwait; /* time to wait for remote callback */
-#define CALLEDBACKWAIT_MIN 2
-
- int dialretries; /* no. of dial tries */
-#define DIALRETRIES_DEF 1
-
- int recoverytime; /* time between 2 dial tries */
-#define RECOVERYTIME_MIN 1
-
- int dialrandincr; /* use random dial time incr */
-
- int usedown; /* set interface down yes/no */
- int downtries; /* retries before i/f is set down */
-#define DOWN_TRIES_MIN 2
-#define DOWN_TRIES_MAX 20
- int downtime; /* time i/f is down */
-#define DOWN_TIME_MIN 10 /* 10 seconds */
-#define DOWN_TIME_MAX 3600 /* 1 hour */
-
- int dialouttype; /* type of outgoing connection */
-#define DIALOUT_NORMAL 0 /* normal dialout behaviour */
-#define DIALOUT_CALLEDBACK 1 /* remote is expected to callback */
-
- int alert; /* alert time in sec if nonzero */
-#define MINALERT 5 /* 5 secs min */
-#define MAXALERT (3*60) /* 3 minutes max */
-
- int inout; /* in/out, in-only or out-only */
-#define DIR_INOUT 0
-#define DIR_INONLY 1
-#define DIR_OUTONLY 2
-
-/*===========================================================================*/
-/*============ filled in after start, then dynamic ==========================*/
-/*===========================================================================*/
-
- int cdid; /* cdid for call */
-#define CDID_RESERVED (-1)
-
- int isdncontrollerused; /* the one we are using */
- int isdnchannelused; /* the one we are using */
-
- int fs_position; /* fullscreen position */
-
- int state; /* state of connection */
-#define ST_IDLE 0 /* connection is idle / disconnected */
-
- /* normal dial out to remote */
-#define ST_DIAL 1 /* dialing */
-#define ST_DIALRTMRCHD 2 /* wait for dial retry time reached */
-#define ST_DIALRETRY 3 /* last/first dialing failed, retry */
-
- /* PCB: passive callback, i'm being called back */
-#define ST_PCB_DIAL 4 /* dialing, trigger a callback */
-#define ST_PCB_DIALFAIL 5 /* dialing failed triggering a callbk */
-#define ST_PCB_WAITCALL 6 /* waiting for callback from remote */
-
- /* ACB: active callback, i'm calling back */
-#define ST_ACB_WAITDISC 7 /* got call, wait for disconnect */
-#define ST_ACB_WAITDIAL 8 /* wait until allowed to callback */
-#define ST_ACB_DIAL 9 /* callback to remote */
-#define ST_ACB_DIALFAIL 10 /* callback to remote failed */
-
- /* normal non-dialling states */
-#define ST_ACCEPTED 11 /* remote accepted */
-#define ST_CONNECTED 12 /* connected with remote */
-#define ST_WAITDISCI 13 /* tx disc req, wait for disc ind */
-#define ST_DOWN 14 /* interface is down */
-#define ST_ALERT 15 /* interface is waiting for alert time*/
-
- /* illegal and pseudo states */
-#define ST_ILL 16 /* illegal state */
-#define ST_SUSE 17 /* subroutine sets new state */
-
-#define N_STATES (ST_ILL+1) /* max number of states */
-
- int disc_cause; /* cause from disconnect */
-
- int local_disconnect; /* flag, who disconnected */
-#define DISCON_LOC 0
-#define DISCON_REM 1
-
- int timerval; /* value for timer, 0 if inactive */
- int timerremain; /* remaining time */
-
- int hangup; /* flag, hangup connection asap */
-
- char real_phone_incoming[TELNO_MAX]; /* real remote telno in case of wildcard */
-
- int last_remote_number; /* index of last used dialout number*/
-
- char remote_phone_dialout[TELNO_MAX]; /* used remote number to dial */
-
- int direction; /* incoming or outgoing */
-#define DIR_IN 0
-#define DIR_OUT 1
-
- int charge; /* charge in units */
- int last_charge; /* last charge in units */
-
- int inbytes; /* # of bytes from remote */
- int iinbytes; /* # of bytes from remote on the line */
- int inbps; /* bytes/sec from remote */
- int outbytes; /* # of bytes to remote */
- int ioutbytes; /* # of bytes to remote on the line */
- int outbps; /* bytes/sec to remote */
-
- time_t connect_time; /* time connection was established */
-
- time_t aoc_last; /* last AOCD timestamp */
- time_t aoc_now; /* current AOCD timestamp */
- time_t aoc_diff; /* current unit length */
- time_t aoc_lastdiff; /* last charge unit length */
- int aoc_valid; /* flag: time diff is valid */
-#define AOC_INVALID 0 /* aoc_diff is NOT valid */
-#define AOC_VALID 1 /* aoc_diff is valid */
-
- time_t last_dial_time; /* time of last dialing */
- time_t last_release_time; /* time of last hangup */
-
- int dial_count; /* number of dialout tries */
- int randomtime; /* random() part of recoverytime*/
-#define RANDOM_MASK 0x04 /* bits used from randomtime */
-
- int down_retry_count; /* retry cycle count for usedown*/
- time_t went_down_time; /* time i/f went down */
- phantom_t saved_call; /* outgoing call state if called
- back too early */
-
- int alert_time; /* count down of alert time */
- char display[DISPLAY_MAX];
-} cfg_entry_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes state of controller with 2 b channels
- *---------------------------------------------------------------------------*/
-typedef struct isdn_ctrl_state {
- int ctrl_type; /* type: active/passive */
- int card_type; /* manufacturer (CARD_XXXX) */
- int state; /* controller state */
-#define CTRL_DOWN 0 /* controller inoparable */
-#define CTRL_UP 1 /* controller may be used */
- int stateb1; /* B-channel 1 */
- int stateb2; /* B-channel 2 */
-#define CHAN_IDLE 0 /* channel is free for usage */
-#define CHAN_RUN 1 /* channel is occupied */
- int freechans; /* number of unused channels */
-#define MAX_CHANCTRL 2 /* free channels per controller */
- int tei; /* tei or -1 if invalid */
-} isdn_ctrl_state_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes a logging regular expression
- *---------------------------------------------------------------------------*/
-struct rarr {
- int re_flg; /* valid entry flag */
- char *re_expr; /* plain text expression */
- regex_t re; /* compiled expression */
- char *re_prog; /* the program to be executed */
-};
-
-#ifdef I4B_EXTERNAL_MONITOR
-/* for each rights entry we keep one of this structures around: */
-struct monitor_rights {
- char name[FILENAME_MAX]; /* net/host spec or filename */
- int rights; /* bitmask of allowed acces rights */
- u_int32_t net; /* net/host address (host byte order!) */
- u_int32_t mask; /* bitmask 1 = network, 0 = host (host byte order!) */
- int local; /* zero if remote access via tcp/ip */
-};
-#endif
-
-/*---------------------------------------------------------------------------*
- * global variables, storage allocation
- *---------------------------------------------------------------------------*/
-#ifdef MAIN
-
-int isdnfd; /* file handle, /dev/i4b */
-
-char *configfile = CONFIG_FILE_DEF; /* configuration filename */
-int config_error_flag = 0; /* error counter */
-
-#ifdef DEBUG
-int do_debug = 0; /* debug mode flag */
-int debug_flags = 0; /* debug options */
-int debug_noscreen = 0; /* not on fullscreen */
-#endif
-
-int do_bell = 0; /* bell on connect/disconnect */
-
-int do_fork = 1; /* run as daemon/foreground */
-
-int do_ttytype = 0; /* got new terminal type */
-char *ttype = ""; /* termcap entry name string */
-
-int do_rdev = 0; /* redirect output */
-char *rdev = ""; /* new device string */
-
-int do_print = 0; /* config file printout */
-
-int got_unitlen = 0; /* flag, got length of a unit */
-time_t unit_length; /* length of a unit */
-
-cfg_entry_t cfg_entry_tab[CFG_ENTRY_MAX]; /* configuration table */
-isdn_ctrl_state_t isdn_ctrl_tab[ISDN_CTRL_MAX]; /* controller states table */
-
-int ncontroller = 0; /* # of controllers available */
-int nentries = 0; /* # of entries in config tab */
-
-int uselogfile = 0; /* flag, use a logfile */
-char logfile[MAXPATHLEN] = LOG_FILE_DEF; /* log filename */
-FILE *logfp = NULL; /* log file pointer */
-int logfacility = LOG_LOCAL0; /* the syslog facility used */
-int nregex = 0; /* number of reg expr */
-struct rarr rarr[MAX_RE]; /* regexpr & progs table */
-
-char ratesfile[MAXPATHLEN] = RATES_FILE_DEF; /* rates filename */
-char *rate_error = NULL; /* errorcase: error string */
-int got_rate = 0; /* flag, ratesfile found */
-struct rates *rates[NRATES][NDAYS]; /* the rates structure */
-
-int useacctfile = 0; /* flag, write accounting */
-char acctfile[MAXPATHLEN] = ACCT_FILE_DEF; /* accounting filename */
-FILE *acctfp = NULL; /* accounting file pointer */
-int acct_all = 1; /* account all connections */
-
-int aliasing = 0; /* enable alias processing */
-char aliasfile[MAXPATHLEN] = ALIASFILE; /* alias file location */
-
-int do_fullscreen = 0; /* fullscreen log */
-int curses_ready = 0; /* curses initialized */
-
-#ifdef USE_CURSES
-WINDOW *upper_w; /* curses upper window pointer */
-WINDOW *mid_w; /* curses mid window pointer */
-WINDOW *lower_w; /* curses lower window pointer */
-#endif
-
-int rt_prio = RTPRIO_NOTUSED; /* realtime priority */
-
-/* monitor via network */
-
-int do_monitor = 0;
-int inhibit_monitor = 0;
-#ifdef I4B_EXTERNAL_MONITOR
-int monitorport = DEF_MONPORT;
-#else
-int monitorport = -1;
-#endif
-int accepted = 0;
-
-int isdntime = 0; /* flag, log time from exchange */
-
-#else /* !MAIN */
-
-int isdnfd;
-
-char *configfile;
-int config_error_flag;
-
-#ifdef DEBUG
-int do_debug;
-int debug_flags;
-int debug_noscreen;
-#endif
-
-int do_bell;
-
-int do_fork;
-
-int do_ttytype;
-char *ttype;
-
-int do_rdev;
-char *rdev;
-
-int do_print;
-
-int got_unitlen;
-time_t unit_length;
-
-cfg_entry_t cfg_entry_tab[CFG_ENTRY_MAX]; /* configuration table */
-isdn_ctrl_state_t isdn_ctrl_tab[ISDN_CTRL_MAX]; /* controller states table */
-
-int ncontroller;
-int nentries;
-
-int uselogfile;
-char logfile[MAXPATHLEN];
-int logfacility;
-int nregex;
-struct rarr rarr[MAX_RE];
-
-char ratesfile[MAXPATHLEN];
-char *rate_error;
-int got_rate;
-struct rates *rates[NRATES][NDAYS];
-
-int useacctfile;
-char acctfile[MAXPATHLEN];
-FILE *acctfp;
-int acct_all;
-
-int aliasing;
-char aliasfile[MAXPATHLEN];
-
-int do_fullscreen;
-int curses_ready;
-
-#ifdef USE_CURSES
-WINDOW *upper_w;
-WINDOW *mid_w;
-WINDOW *lower_w;
-#endif
-
-int rt_prio;
-
-int do_monitor;
-int inhibit_monitor;
-int monitorport;
-int accepted;
-
-int isdntime;
-
-#endif /* MAIN */
-
-char * bdrivername ( int drivertype );
-void cfg_setval ( int keyword );
-void check_and_kill ( cfg_entry_t *cep );
-void check_pid ( void );
-void close_allactive ( void );
-void configure ( char *filename, int reread );
-void daemonize ( void );
-void dialresponse(cfg_entry_t *cep, int dstat);
-void display_acct ( cfg_entry_t *cep );
-void display_bell ( void );
-void display_ccharge ( cfg_entry_t *cep, int units );
-void display_chans ( void );
-void display_charge ( cfg_entry_t *cep );
-void display_connect ( cfg_entry_t *cep );
-void display_disconnect ( cfg_entry_t *cep );
-void display_l12stat(int controller, int layer, int state);
-void display_tei(int controller, int tei);
-void display_updown ( cfg_entry_t *cep, int updown );
-void hangup_channel ( int channel );
-void do_exit ( int exitval );
-void do_menu ( void );
-int exec_answer ( cfg_entry_t *cep );
-int exec_connect_prog ( cfg_entry_t *cep, const char *prog, int link_down );
-pid_t exec_prog ( char *prog, char **arglist );
-cfg_entry_t * find_by_device_for_dialout ( int drivertype, int driverunit );
-cfg_entry_t * find_matching_entry_incoming ( msg_connect_ind_t *mp );
-cfg_entry_t * find_active_entry_by_driver ( int drivertype, int driverunit );
-void finish_log ( void );
-char * getlogdatetime ( void );
-int get_cdid ( void );
-cfg_entry_t * get_cep_by_cc ( int ctrlr, int chan );
-cfg_entry_t * get_cep_by_driver ( int drivertype, int driverunit );
-cfg_entry_t * get_cep_by_cdid ( int cdid );
-int get_current_rate ( cfg_entry_t *cep, int logit );
-void handle_charge ( cfg_entry_t *cep );
-void handle_recovery ( void );
-void if_up(cfg_entry_t *cep);
-void if_down(cfg_entry_t *cep);
-void init_controller ( void );
-void init_log ( void );
-void init_screen ( void );
-void log ( int what, const char *fmt, ... );
-int main ( int argc, char **argv );
-void msg_accounting ( msg_accounting_ind_t *mp );
-void msg_alert_ind ( msg_alert_ind_t *mp );
-void msg_charging_ind ( msg_charging_ind_t *mp );
-void msg_connect_active_ind ( msg_connect_active_ind_t *mp );
-void msg_connect_ind ( msg_connect_ind_t *mp );
-void msg_pdeact_ind(msg_pdeact_ind_t *md);
-void msg_negcomplete_ind(msg_negcomplete_ind_t *ind);
-void msg_ifstatechg_ind(msg_ifstatechg_ind_t *ind);
-void msg_drvrdisc_req(msg_drvrdisc_req_t *mp);
-void msg_dialout ( msg_dialout_ind_t *mp );
-void msg_disconnect_ind ( msg_disconnect_ind_t *mp );
-void msg_idle_timeout_ind ( msg_idle_timeout_ind_t *mp );
-void msg_l12stat_ind(msg_l12stat_ind_t *ml);
-void msg_teiasg_ind(msg_teiasg_ind_t *mt);
-void msg_proceeding_ind ( msg_proceeding_ind_t *mp );
-const char * name_of_controller(int ctrl_type, int card_type);
-void next_state ( cfg_entry_t *cep, int event );
-char * print_i4b_cause( cause_t code );
-char * printstate ( cfg_entry_t *cep );
-int readrates ( char *filename );
-int ret_channel_state(int controller, int channel);
-void reopenfiles ( int dummy );
-void rereadconfig ( int dummy );
-void select_first_dialno ( cfg_entry_t *cep );
-void select_next_dialno ( cfg_entry_t *cep );
-void select_this_dialno ( cfg_entry_t *cep );
-int sendm_alert_req ( cfg_entry_t *cep );
-int sendm_connect_req ( cfg_entry_t *cep );
-int sendm_connect_resp ( cfg_entry_t *cep, int cdid, int response, int cause );
-int sendm_disconnect_req ( cfg_entry_t *cep, int cause );
-int set_channel_busy(int controller, int channel);
-int set_channel_idle(int controller, int channel);
-int setup_dialout(cfg_entry_t *cep);
-void sigchild_handler ( int sig );
-void start_timer ( cfg_entry_t *cep, int seconds );
-void stop_timer ( cfg_entry_t *cep );
-void unitlen_chkupd( cfg_entry_t *cep );
-void write_pid ( void );
-void yyerror ( const char *msg );
-
-/* montior server module */
-void monitor_init();
-void monitor_exit();
-void monitor_clear_rights();
-void monitor_fixup_rights();
-int monitor_start_rights(const char *clientspec);
-void monitor_add_rights(int rights);
-
-/* possible return codes from monitor_start_rights: */
-#define I4BMAR_OK 0 /* rights added successfully */
-#define I4BMAR_LENGTH 1 /* local socket name to long */
-#define I4BMAR_DUP 2 /* entry already exists */
-#define I4BMAR_CIDR 3 /* cidr netmask is invalid */
-#define I4BMAR_NOIP 4 /* host/net could not be resolved */
-
-int monitor_create_local_socket();
-
-#ifndef I4B_NOTCPIP_MONITOR
-int monitor_create_remote_socket(int portno);
-#endif
-
-void monitor_prepselect(fd_set *selset, int *max_fd);
-void monitor_handle_input(fd_set *selset);
-void monitor_handle_connect(int sockfd, int is_local);
-void monitor_evnt_charge(cfg_entry_t *cep, int units, int estimated);
-void monitor_evnt_connect(cfg_entry_t *cep);
-void monitor_evnt_disconnect(cfg_entry_t *cep);
-void monitor_evnt_updown(cfg_entry_t *cep, int up);
-void monitor_evnt_log(int prio, const char * what, const char * msg);
-
-/* controller.c */
-
-int init_controller_state(int controller, int ctrl_type, int card_type, int tei);
-int set_controller_state(int controller, int state);
-int get_controller_state(int controller);
-int decr_free_channels(int controller);
-int incr_free_channels(int controller);
-int get_free_channels(int controller);
-int set_channel_busy(int controller, int channel);
-int set_channel_idle(int controller, int channel);
-int ret_channel_state(int controller, int channel);
-
-/* alias.c */
-
-void init_alias(char *filename);
-void free_aliases(void);
-char *get_alias(char *number);
-
-#endif /* _ISDND_H_ */
diff --git a/usr.sbin/i4b/isdnd/isdnd.rates.5 b/usr.sbin/i4b/isdnd/isdnd.rates.5
deleted file mode 100644
index 450cd5eac3f8..000000000000
--- a/usr.sbin/i4b/isdnd/isdnd.rates.5
+++ /dev/null
@@ -1,115 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdnd.rates.5,v 1.6 1998/12/05 18:03:21 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:09:57 1998]
-.\"
-.Dd September 11, 1998
-.Dt isdnd.rates 5
-.Sh NAME
-.Nm isdnd.rates
-.Nd isdn4bsd ISDN management daemon rates description file
-.Sh DESCRIPTION
-The file
-.Pa isdnd.rates
-contains descriptions how long charging units last at a given time of day,
-day of week and the distance to the destination. If this file is available,
-this information may be used by the
-.Xr isdnd 8
-ISDN connection management daemon to calculate the short hold time for a
-connection.
-.Pp
-The format of a rate entry line is a follows:
-.Pp
-The first field, the
-.Pq Fa rate-code
-defines a collection of rates (for each day of the week) which can be
-referenced in the
-.Xr isdnd 8
-configuration file
-.Xr isdnd.rc 5 .
-This field must start with the identifier
-.Dq ra
-followed by a digit in the range of zero to four.
-.Pp
-
-The second field, the
-.Pq Fa day-number
-selects the day of week for which this entry defines the rates, where 0 stands
-for Sunday, 1 for Monday and so on until the digit 6 which stands for Saturday.
-.Pp
-
-The rest of the line consists of one or more space separated fields which have
-the following syntax:
-.Bd -filled -offset indent
-start_hour.start_minutes-end_hour.end_minutes:charge_unit_length
-.Ed
-.Pp
-Start_hour and start_minutes define the begin of a time section and end_hour
-and end_minutes define the end. Charge_unit_length define the length of a
-charging unit in the previously defined time section. No spaces or tabs are
-allowed inside this field. The hour and minutes specifications MUST have
-exactly 2 digits, in case just one digit is needed, a leading 0 must be used.
-.Pp
-For example,
-.Bd -filled -offset indent
-14.00-18.00:90
-.Ed
-.Pp
-defines, that between 2:00 PM and 6:00 PM the length of one charging unit
-lasts 90 seconds.
-.Pp
-
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rates -compact
-.It Pa /etc/isdn/isdnd.rates
-The default rates specification file for the
-.Nm isdnd
-ISDN daemon.
-
-.Sh EXAMPLES
-The line:
-.Bd -literal
-ra0 0 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-.Ed
-.Pp
-defines the unit lengths for a Sunday.
-
-.Sh SEE ALSO
-.Xr isdnd 8 ,
-.Xr isdnd.rc 5
-
-.Sh AUTHOR
-The rates subsystem for the
-.Xr isdnd 8
-daemon to which
-.Nm
-belongs was designed and written by Gary Jennejohn.
-.Pp
-The
-.Xr isdnd 8
-daemon and this manual page were written by Hellmuth Michaelis.
-He can be reached at hm@kts.org or hm@hcs.de.
-
diff --git a/usr.sbin/i4b/isdnd/isdnd.rc.5 b/usr.sbin/i4b/isdnd/isdnd.rc.5
deleted file mode 100644
index 03d1a3a528f3..000000000000
--- a/usr.sbin/i4b/isdnd/isdnd.rc.5
+++ /dev/null
@@ -1,642 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdnd.rc.5,v 1.27 1998/12/05 18:03:23 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:10:08 1998]
-.\"
-.Dd October 27, 1998
-.Dt isdnd.rc 5
-.Sh NAME
-.Nm isdnd.rc
-.Nd isdn4bsd ISDN connection management daemon config file format
-.Sh DESCRIPTION
-The file
-.Pa /etc/isdn/isdnd.rc
-contains (if not otherwise specified on the command line) the runtime
-configuration for the
-.Xr isdnd 8
-ISDN connection management daemon which is part of the isdn4bsd package.
-.Pp
-The configuration file consists of keywords which start in column 1 followed by
-one or more spaces or tabs, an equal sign, one or more spaces or tabs
-and a keyword dependent parameter value.
-.Pp
-A line beginning with '#' is treated as a comment line.
-.Pp
-For keywords requiring the specification of a boolean value, the truth
-value can be either
-.Em yes
-or
-.Em on
-while the false value can be either
-.Em no
-or
-.Em off .
-.Pp
-The configuration file consists of one
-.Em system
-section and one or more
-.Em entry
-sections.
-In the
-.Em system
-section parameters regarding the daemon operation or parameters
-not associated with a single remote connection can be set.
-In the
-.Em entry
-section(s) parameters directly associated with a single remote
-connection can be set.
-.Pp
-The following keywords are recognized by
-.Nm isdnd :
-.Pp
-.Bl -tag -width system -compact
-
-.It Li system
-This keyword starts the system configuration section. It must not
-have a parameter and may be used only once. The keyword is mandatory.
-The following keywords are valid in the system configuration section:
-.Bl -tag -width useacctfile -compact
-
-.It Li acctall
-If this parameter is set to
-.Em on ,
-accounting information is written even if the local site was not charged
-or no charging information is available or is not subscribed. (optional)
-
-.It Li acctfile
-Specifies the name of the accounting file which is used when the keyword
-.Em useacctfile
-(see below) is set to
-.Em on .
-If this keyword is omitted the system default is used. (optional)
-
-.It Li aliasing
-If this parameter is set to
-.Em on ,
-alias processing of telephone-number to name is enabled (see also the
-.Em aliasfile
-keyword below). The default is off. (optional)
-
-.It Li aliasfile
-Specifies the name of the telephone number-to-name alias database file shared
-with the
-.Xr isdntel 1
-utility when alias processing is enabled via the
-.Em aliasing
-keyword. (optional)
-
-.It Li isdntime
-If this parameter is set to
-.Em on ,
-date/time information from the exchange (if provided) is written to the
-logfile. The default is off. (optional)
-
-.It Li monitor-allowed
-If this parameter is set to
-.Em on
-or
-.Em yes ,
-monitoring via a local or remote machine is enabled.
-This parameter is optional and is set to
-.Em off
-by default.
-
-.It Li monitor-port
-sets the TCP port number for remote monitoring.
-This integer parameter is optional and is set to port 451 by default.
-
-.It Li monitor
-This keyword specifies a local socket name or a host or network for remote
-monitoring. The
-.Em monitor
-specification may either be:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar the name of a local (UNIX-domain) socket
-this MUST start with a "/", example: /var/run/isdn-monitor
-.It Ar a dotted-quad host specification
-example: 192.168.1.2
-.It Ar a dotted-quad network address with netmask
-example: 192.168.1.0/24
-.It Ar a resolvable host name
-example: localhost
-.It Ar a resolvable network name with netmask
-example: up-vision-net/24
-.El
-
-.It Li monitor-access
-This keyword specifies the access rights for a previously used
-.Em monitor
-keyword. The supported access rights are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar fullcmd
-.It Ar restrictedcmd
-.It Ar channelstate
-.It Ar logevents
-.It Ar callin
-.It Ar callout
-.El
-
-.It Li ratesfile
-Specifies the name of the ratesfile. If this keyword is omitted the system
-default is used. (optional)
-
-.It Li regexpr
-This keyword is used to specify regular expressions. It can be specified
-more than once up to a compile time dependent value (currently set to 5 by
-the MAX_RE definition in the source).
-.Pp
-All specified regular expressions are compared to the log strings at runtime
-and if a match is found, a program is run with the log text as a parameter
-(see also the keyword
-.Em regprog
-below).
-.Pp
-For an explanation how regular expressions are specified, please have a
-look at
-.Xr re_format 7
-and
-.Xr regex 3 .
-The
-.Em extended
-regular expression syntax is supported here.
-.Pp
-Hint: it might be necessary to properly quote the expression to avoid
-improper interpretation by the configuration file parser.
-(optional)
-
-.It Li regprog
-This keyword is used to specify the name of a program which is run in
-case a corresponding regular expression is matched by a logging string.
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-
-.It Li rtprio
-Specifies the realtime priority
-.Nm isdnd
-runs at as an integer value in the range 0...31 with 0 being the highest
-priority. This keyword is optional; if not specified the process priority of
-.Nm isdnd
-is not touched in any way.
-( See also
-.Xr rtprio 1
-).
-This keyword is only available if
-.Nm
-was compiled with -DUSE_RTPRIO.
-
-.It Li useacctfile
-If this parameter is set to
-.Em on
-charging (if available) and accounting information is written to the
-accounting file. (optional)
-
-.El
-
-.It Li entry
-This keyword starts one configuration entry. It must not have a parameter.
-This keyword must be used at least once.
-The following keywords are valid in an entry section:
-.Bl -tag -width unitlengthsrc -compact
-
-.It Li answerprog
-This keyword is used to specify the name of a program which is run in
-case an incoming telephone connection specified
-.Em answer
-in its configuration entry. The default name is
-.Em answer .
-.Nm Isdnd
-expects to find this program beneath the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-
-.It Li alert
-is used to specify a time in seconds to wait before accepting a call. This
-keyword is only usable for incoming telephone calls (dialin-reaction = answer).
-It is used to have a chance to accept an incoming call on the phone before
-the answering machine starts to run. The minimum value for the alert parameter
-is 5 seconds and the maximum parameter allowed is 180 seconds.
-(optional)
-
-.It Li b1protocol
-The B channel layer 1 protocol used for this connection. The keyword is mandatory.
-The currently configurable values are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar hdlc
-HDLC framing.
-.It Ar raw
-No framing at all (used for telephony).
-.El
-
-.It Li callbackwait
-The time in seconds to wait between hanging up the call from a remote site
-and calling back the remote site. (optional)
-
-.It Li calledbackwait
-The time in seconds to wait for a remote site calling back the local site
-after a call from the local site to the remote site has been made. (optional)
-
-.It Li dialin-reaction
-Used to specify what to do when an incoming connection request is received.
-The keyword is mandatory.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width calledback -compact -offset
-.It Ar accept
-Accept an incoming call.
-.It Ar reject
-Reject an incoming call.
-.It Ar ignore
-Ignore an incoming call.
-.It Ar answer
-Start telephone answering for an incoming voice call.
-.It Ar callback
-When a remote site calls, hangup and call back the remote site.
-.El
-
-.It Li dialout-type
-This keyword ist used to configure what type of dialout mode is used.
-The keyword is mandatory.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar normal
-Normal behavior, call the remote site which is supposed to accept the call.
-.It Ar calledback
-Callback behavior, call the remote side which rejects the call and calls
-us back.
-.El
-
-.It Li dialrandincr
-When dialing or re-dialing and this parameter is set to
-.Em on ,
-the dial retry time is added with a random value (currently 0...3 seconds)
-to minimize the chance of two sites dialing synchronously so each gets a busy
-each time it dials because the other side is also dialing.
-
-.It Li dialretries
-The number of dialing retries before giving up. (optional)
-
-.It Li direction
-This keyword is used to configure if incoming and outgoing, incoming-only or
-outgoing only connections are possible.
-The keyword is optional, the default is
-.Em inout .
-.Pp
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar inout
-Normal behavior, connection establishment is possible from remote and local.
-.It Ar in
-Only incoming connections are possible.
-.It Ar out
-Only outgoing connections are possible.
-.El
-
-.It Li downtries
-is used to configure the number of unsuccessful tries (= retry cycles!) before
-the interface is disabled (for
-.Em downtime
-seconds).
-(see also the keyword
-.Em usedown
-further up). This keyword is optional.
-
-.It Li downtime
-is used to configure the time in seconds an interface is disabled
-after the configured number of
-.Em downtries .
-(see also the keyword
-.Em usedown
-further up).
-This keyword is optional and is set to 60 seconds by default.
-
-.It Li earlyhangup
-A (safety) time in seconds which specifies the time to hangup before an
-expected next charging unit will occur. (optional)
-
-.It Li idletime-outgoing
-The time in seconds an outgoing connection must be idle before hanging up.
-(optional)
-
-.It Li idletime-incoming
-The time in seconds an incoming connection must be idle before hanging up.
-(optional)
-
-.It Li isdncontroller
-The ISDN controller number to be used for connections for this entry.
-(mandatory)
-
-.It Li isdnchannel
-The ISDN controller channel number to be used for connections for this entry.
-In case a channel is explicitly selected here, the SETUP message will request
-this channel but mark the request as
-.Em preferred
-(the indicated channel is preferred) instead of exclusive (only the indicated
-channel is acceptable). Thus the exchange is still free to select another
-than the requested channel!
-(mandatory)
-
-.It Li isdntxdel-incoming
-A delay value suitable for the
-.Em timeout()
-kernel subroutine to delay the transmittion of the first packet after a
-successfull connection is made by this value for
-.Em incoming
-ISDN connections. The specification unit is 1/100 second. A zero (0) disables
-this feature and is the default value. This feature is implemented (and makes
-sense only) for the
-.Xr i4bipr 4
-IP over raw HDLC ISDN driver. (optional)
-
-.It Li isdntxdel-outgoing
-A delay value suitable for the
-.Em timeout()
-kernel subroutine to delay the transmittion of the first packet after a
-successfull connection is made by this value for
-.Em outgoing
-ISDN connections. The specification unit is 1/100 second. A zero (0) disables
-this feature and is the default value. This feature is implemented (and makes
-sense only) for the
-.Xr i4bipr 4
-IP over raw HDLC ISDN driver. (optional)
-
-.It Li local-phone-dialout
-The local telephone number used when the local site dials out. When dialing
-out to a remote site, the number specified here is put into the
-.Em "Calling Party Number Information Element" .
-.Pp
-This keyword is mandatory for the
-.em
-ipr
-userland interfaces.
-
-.It Li local-phone-incoming
-The local telephone number used for verifying the destination of incoming
-calls. When a remote site dials in, this number is used to verify that it
-is the local site which the remote site wants to connect to. It is compared
-with the
-.Em "Called Party Number Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the ipr interfaces.
-
-.It Li name
-Defines a symbolic name for this configuration entry. It's purpose is to
-use this name in the full-screen display for easy identification of a link
-to a remote site and for accounting purposes. (mandatory)
-
-.It Li ratetype
-The rate entry used from the rates file. (optional)
-.br
-For example, ratetype=0 selects lines beginning "ra0" in /etc/isdn/isdnd.rates;
-(typically ra0 lines are a set of tables for local call rates on different
-days of the week & times per day).
-
-.It Li recoverytime
-The time in seconds to wait between dial retries. (optional)
-
-.It Li remdial-handling
-is used to specify the dialout behavior in case more than one outgoing
-number is specified.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar first
-For every new (non-retry) call setup, start with the first number.
-.It Ar last
-For every new (non-retry) call setup, start with the last number with
-which a successful connection was made.
-.It Ar next
-For every new (non-retry) call setup, start with the next number which
-follows the last one used.
-.El
-
-.It Li remote-phone-dialout
-The remote telephone number used when the local site dials out. When dialing
-out to a remote site, the number specified here is put into the
-.Em "Called Party Number Information Element" .
-.Pp
-This keyword is mandatory for the
-.em
-ipr
-interfaces. It may be specified more than once to try to dial to several
-numbers until one succeeds.
-
-.It Li remote-phone-incoming
-The remote telephone number used to verify an incoming call. When a remote site
-dials in, this number is used to verify that it is the correct remote site
-which is herewith authorized to connect into the local system. This parameter
-is compared against the
-.Em "Calling Party Number Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the ipr interfaces.
-.Pp
-This keyword may have a wildcard parameter '*' to permit anyone dialing in.
-
-.It Li unitlength
-The length of a charging unit in seconds. This is used in conjunction with
-the idletime to decide when to hangup a connection. (optional)
-
-.It Li unitlengthsrc
-This keyword is used to specify from which source
-.Xr isdnd 8
-takes the unitlength for shorthold mode. The currently configurable values are:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar none
-Then unitlength is not specified anywhere.
-.It Ar cmdl
-Use the unitlength specified on the commandline.
-.It Ar conf
-Use the unitlength specified in the configuration file with the keyword
-.Em unitlength .
-.It Ar rate
-Use the unitlength from the ratesfile specified in the configuration
-file with the keyword
-.Em ratetype .
-.It Ar aocd
-Use a dynamically calculated unitlength in case AOCD is subscribed on
-the ISDN line. (AOCD is an acronym for ``Advice Of Charge During the call''
-which is a service provided by the telecommunications (ie phone) provider,
-to indicate billable units).
-.El
-
-.It Li usrdevicename
-Specifies the userland interface which is used for interfacing ISDN B channel
-data to the userland. The keyword is mandatory.
-This keyword accepts the following parameters:
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar ipr
-This parameter configures a raw HDLC IP over ISDN interface.
-.It Ar isp
-This parameter configures a synchronous PPP over ISDN interface.
-.It Ar rbch
-This specifies a Raw B CHannel access interface.
-.It Ar tel
-ISDN telephony.
-.El
-
-.It Li usrdeviceunit
-Specifies the unit number for the with the
-.em
-usrdevicename
-specified device.
-
-.It Li usedown
-is used to enable the use of the keywords
-.Em downtries
-and
-.Em downtime
-in the entries section(s). It is used in the
-.Nm isdnd
-daemon to dynamically enable and disable the IP interfaces to avoid excessive
-dialing activities in case of transient failures (such as busy lines).
-This parameter is optional and is set to
-.Em off
-by default.
-
-.It Li connectprog
-specifies a program run everytime after a connection is established and
-address negotiation is complete (i.e.: the connection is useable).
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-
-.It Li disconnectprog
-specifies a program run everytime after a connection was shut down.
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-
-.El
-.El
-
-.Sh IDLETIME CALCULATION AND SHORTHOLD MODE
-.Bl -tag -width incoming calls -compact
-.It Li incoming calls
-It is assumed that the calling side knows most about charging structures and
-such and as a consequence only the keyword
-.Em idletime-incoming
-has a function for incoming calls.
-.Pp
-For incoming calls the line is constantly monitored, and in case there was
-not traffic taking place for the time in seconds specified by
-.Em idletime-incoming
-the call is closed.
-.Pp
-Typically,
-.Em idletime-incoming
-is used as a last resort and is therefore set much higher than a charging
-unit time: typical values are one to five minutes.
-
-.It Li outgoing calls
-Outgoing call disconnect time can be setup in one of two ways:
-
-.Bl -tag -width shorthold mode -compact
-.It Li simple mode
-For simple mode, the selected
-.Em unitlength
-must be 0 (zero) and
-.Em idletime-outgoing
-greater zero.
-.Pp
-The outgoing traffic is constantly monitored, and in case there was
-not traffic taking place for the time in seconds specified by
-.Em idletime-outgoing
-the call is closed.
-.Pp
-Typical values in simple mode are 10 to 30 seconds.
-
-.It Li shorthold mode
-For shorthold mode, the selected
-.Em unitlength
-and
-.Em idletime-outgoing
-must be greater than 0 (zero);
-.Em earlyhangup must be >= 0 (zero).
-
-.Bd -literal
-
-|<unchecked-window>|<checkwindow>|<safetywindow>|
-| | | |
-+------------------+-------------+--------------+
-| | | |
-| |<-idle-time->|<earlyhangup->|
-|<--------------unitlength--------------------->|
-
-.Ed
-
-During the unchecked window which is (unitlength - (idle-time+earlyhangup))
-in length, no idle check is done. After the unchecked window has ended,
-the line is checked for idle-time length if no traffic takes place. In case
-there was traffic detected in the check-window, the same procedure is restarted
-at the beginning of the next unit. In case no traffic was detected during
-the check-window, the line is closed at the end of the check window.
-.Pp
-Notice:
-.Em unitlength
-must (!) be greater than the sum of
-.Em idletime-outgoing
-and
-.Em earlyhangup !
-
-.El
-.El
-
-.Pp
-
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rc -compact
-.It Pa /etc/isdn/isdnd.rc
-The default configuration file for the
-.Nm isdnd
-ISDN daemon.
-
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnmonitor 8
-.Xr regex 3
-.Xr re_format 7
-
-.Sh AUTHOR
-The
-.Xr isdnd 8
-daemon and this manual page were written by Hellmuth Michaelis.
-He can be reached at hm@kts.org.
diff --git a/usr.sbin/i4b/isdnd/log.c b/usr.sbin/i4b/isdnd/log.c
deleted file mode 100644
index 4c1ffb63b59d..000000000000
--- a/usr.sbin/i4b/isdnd/log.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - logging routines
- * -----------------------------
- *
- * $Id: log.c,v 1.14 1998/12/05 18:03:24 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:10:22 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <time.h>
-#include <errno.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <regex.h>
-
-#include <machine/i4b_ioctl.h>
-
-#include "isdnd.h"
-
-#define LOGBUFLEN 256
-
-extern int do_monitor;
-extern int accepted;
-extern FILE *logfp;
-
-static void check_reg(char *logstring);
-
-struct logtab {
- char *text;
- int pri;
-};
-
-/*---------------------------------------------------------------------------*
- * table for converting internal log levels into syslog levels
- *---------------------------------------------------------------------------*/
-static struct logtab logtab[] = {
- {"ERR", LOG_ERR}, /* error conditions */
- {"WRN", LOG_WARNING}, /* warning conditions, nonfatal */
- {"DMN", LOG_NOTICE}, /* normal but significant condition, daemon*/
- {"CHD", LOG_INFO}, /* informational, call handling */
- {"DBG", LOG_DEBUG} /* debug messages */
-};
-
-/*---------------------------------------------------------------------------*
- * initialize logging
- *---------------------------------------------------------------------------*/
-void
-init_log(void)
-{
- int i;
-
- if(uselogfile)
- {
- if((logfp = fopen(logfile, "a")) == NULL)
- {
- fprintf(stderr, "ERROR, cannot open logfile %s: %s\n",
- logfile, strerror(errno));
- exit(1);
- }
-
- /* set unbuffered operation */
-
- setvbuf(logfp, (char *)NULL, _IONBF, 0);
- }
- else
- {
-#if DEBUG
- if(do_debug && do_fork == 0 && do_fullscreen == 0)
- (void)openlog("isdnd",
- LOG_PID|LOG_CONS|LOG_NDELAY|LOG_PERROR,
- logfacility);
- else
-#endif
- (void)openlog("isdnd", LOG_PID|LOG_CONS|LOG_NDELAY,
- logfacility);
- }
-
- /* initialize the regexp array */
-
- for(i = 0; i < MAX_RE; i++)
- {
- char *p;
- char buf[64];
-
- sprintf(buf, "%s%d", REGPROG_DEF, i);
-
- rarr[i].re_flg = 0;
-
- if((p = malloc(strlen(buf) + 1)) == NULL)
- {
- log(LL_DBG, "init_log: malloc failed: %s", strerror(errno));
- do_exit(1);
- }
-
- strcpy(p, buf);
-
- rarr[i].re_prog = p;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * finish logging
- *---------------------------------------------------------------------------*/
-void
-finish_log(void)
-{
- if(uselogfile)
- {
- fflush(logfp);
- fclose(logfp);
- }
- else
- {
- (void)closelog();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * place entry into logfile
- *---------------------------------------------------------------------------*/
-void
-log(int what, const char *fmt, ...)
-{
- char buffer[LOGBUFLEN];
- register char *dp;
- va_list ap;
-
- va_start(ap, fmt);
- vsnprintf(buffer, LOGBUFLEN-1, fmt, ap);
- va_end(ap);
-
- dp = getlogdatetime(); /* get time string ptr */
-
-#ifdef USE_CURSES
-
- /* put log on screen ? */
-
- if((do_fullscreen && curses_ready) &&
- ((!debug_noscreen) || (debug_noscreen && (what != LL_DBG))))
- {
- wprintw(lower_w, "%s %s %-.*s\n", dp, logtab[what].text,
- COLS-((strlen(dp))+(strlen(logtab[what].text))+2), buffer);
- wrefresh(lower_w);
- }
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_log(logtab[what].pri, logtab[what].text, buffer);
-#endif
-
- if(uselogfile)
- {
- fprintf(logfp, "%s %s %s\n", dp, logtab[what].text, buffer);
- }
- else
- {
- register char *s = buffer;
-
- /* strip leading spaces from syslog output */
-
- while(*s && (*s == ' '))
- s++;
-
- syslog(logtab[what].pri, "%s %s", logtab[what].text, s);
- }
-
-
-#if DEBUG
- if(what != LL_DBG) /* don't check debug logs, endless loop !!! */
-#endif
- check_reg(buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * return ptr to static area containing date/time
- *---------------------------------------------------------------------------*/
-char *
-getlogdatetime()
-{
- static char logdatetime[41];
- time_t tim;
- register struct tm *tp;
-
- tim = time(NULL);
- tp = localtime(&tim);
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
- return(logdatetime);
-}
-
-/*---------------------------------------------------------------------------*
- * check for a match in the regexp array
- *---------------------------------------------------------------------------*/
-static void
-check_reg(char *logstring)
-{
- register int i;
-
- for(i = 0; i < MAX_RE; i++)
- {
- if(rarr[i].re_flg && (!regexec(&(rarr[i].re), logstring, (size_t) 0, NULL, 0)))
- {
- char* argv[3];
- argv[0] = rarr[i].re_prog;
- argv[1] = logstring;
- argv[2] = NULL;
-
- exec_prog(rarr[i].re_prog, argv);
- break;
- }
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/main.c b/usr.sbin/i4b/isdnd/main.c
deleted file mode 100644
index 9d16717d485d..000000000000
--- a/usr.sbin/i4b/isdnd/main.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - main program entry
- * -------------------------------
- *
- * $Id: main.c,v 1.29 1998/12/05 18:03:26 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:10:38 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef I4B_EXTERNAL_MONITOR
-#include "monitor.h"
-#endif
-
-#define MAIN
-#include "isdnd.h"
-#undef MAIN
-
-#ifdef I4B_EXTERNAL_MONITOR
-
-#ifdef I4B_NOTCPIP_MONITOR
-/* monitor via local socket */
-static void mloop(int sockfd);
-#else /* I4B_NOTCPIP_MONITOR */
-/* monitor via local and tcp/ip socket */
-static void mloop(int localsock, int remotesock);
-#endif /* I4B_NOTCPIP_MONITOR */
-
-#else /* I4B_EXTERNAL_MONITOR */
-/* no monitoring at all */
-static void mloop();
-#endif /* I4B_EXTERNAL_MONITOR */
-
-#ifdef USE_CURSES
-static void kbdrdhdl(void);
-#endif
-
-static void isdnrdhdl(void);
-static void usage(void);
-
-#define MSG_BUF_SIZ 1024 /* message buffer size */
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdnd - i4b ISDN manager daemon, version %02d.%02d.%d, %s %s\n", VERSION, REL, STEP, __DATE__, __TIME__);
-#ifdef DEBUG
- fprintf(stderr, " usage: isdnd [-b] [-c file] [-d level] [-F]\n");
-#else
- fprintf(stderr, " usage: isdnd [-b] [-c file] [-F]\n");
-#endif
- fprintf(stderr, " [-f [-r dev] [-t termtype]] [-u time]\n");
- fprintf(stderr, " [-l] [-L file] [-s facility] [-m]\n");
- fprintf(stderr, " -b audible bell in fullscreen mode at connect/disconnect\n");
- fprintf(stderr, " -c <filename> configuration file name (def: %s)\n", CONFIG_FILE_DEF);
-#ifdef DEBUG
- fprintf(stderr, " -d <level> set debug flag bits:\n");
- fprintf(stderr, " general = 0x%04x, rates = 0x%04x, timing = 0x%04x\n", DL_MSG, DL_RATES, DL_TIME);
- fprintf(stderr, " state = 0x%04x, retry = 0x%04x, dial = 0x%04x\n", DL_STATE, DL_RCVRY, DL_DIAL);
- fprintf(stderr, " process = 0x%04x, kernio = 0x%04x ctrlstat = 0x%04x\n", DL_PROC, DL_DRVR, DL_CNST);
- fprintf(stderr, " -dn no debug output on fullscreen display\n");
-#endif
- fprintf(stderr, " -f fullscreen status display\n");
- fprintf(stderr, " -F do not become a daemon process\n");
- fprintf(stderr, " -l use a logfile instead of syslog\n");
- fprintf(stderr, " -L <file> use file instead of %s for logging\n", LOG_FILE_DEF);
- fprintf(stderr, " -P pretty print real config to stdout and exit\n");
- fprintf(stderr, " -r <device> redirect output to other device (for -f)\n");
- fprintf(stderr, " -s <facility> use facility instead of %d for syslog logging\n", LOG_LOCAL0 >> 3);
- fprintf(stderr, " -t <termtype> terminal type of redirected screen (for -f)\n");
- fprintf(stderr, " -u <time> length of a charging unit in seconds\n");
- fprintf(stderr, " -m inhibit network/local monitoring\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- msg_vr_req_t mvr;
-
-#ifdef I4B_EXTERNAL_MONITOR
- int sockfd = -1; /* local monitor socket */
-#ifndef I4B_NOTCPIP_MONITOR
- int remotesockfd = -1; /* tcp/ip monitor socket */
-#endif
-#endif
-
- while ((i = getopt(argc, argv, "bmc:d:fFlL:Pr:s:t:u:?")) != EOF)
- {
- switch (i)
- {
- case 'b':
- do_bell = 1;
- break;
-
- case 'm':
- inhibit_monitor = 1;
- break;
-
- case 'c':
- configfile = optarg;
- break;
-
-#ifdef DEBUG
- case 'd':
- if(*optarg == 'n')
- debug_noscreen = 1;
- else if((sscanf(optarg, "%i", &debug_flags)) == 1)
- do_debug = 1;
- else
- usage();
- break;
-#endif
-
- case 'f':
- do_fullscreen = 1;
- do_fork = 0;
-#ifndef USE_CURSES
- fprintf(stderr, "Sorry, no fullscreen mode available - daemon compiled without USE_CURSES\n");
- exit(1);
-#endif
- break;
-
- case 'F':
- do_fork = 0;
- break;
-
- case 'l':
- uselogfile = 1;
- break;
-
- case 'L':
- strcpy(logfile, optarg);
- break;
-
- case 'P':
- do_print = 1;
- break;
-
- case 'r':
- rdev = optarg;
- do_rdev = 1;
- break;
-
- case 's':
- if(isdigit(*optarg))
- {
- int facility;
- logfacility = strtoul(optarg, NULL, 10);
- facility = logfacility << 3;
-
- if((facility < LOG_KERN) ||
- (facility > LOG_FTP && facility < LOG_LOCAL0) ||
- (facility > LOG_LOCAL7))
- {
- fprintf(stderr, "Error, option -s has invalid logging facility %d", logfacility);
- usage();
- }
- logfacility = facility;
- }
- else
- {
- fprintf(stderr, "Error: option -s requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 't':
- ttype = optarg;
- do_ttytype = 1;
- break;
-
- case 'u':
- if(isdigit(*optarg))
- {
- unit_length = strtoul(optarg, NULL, 10);
- if(unit_length < ULSRC_CMDLMIN)
- unit_length = ULSRC_CMDLMIN;
- else if(unit_length > ULSRC_CMDLMAX)
- unit_length = ULSRC_CMDLMAX;
- got_unitlen = 1;
- }
- else
- {
- fprintf(stderr, "Error: option -T requires a numeric argument!\n");
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-#ifdef DEBUG
- if(!do_debug)
- debug_noscreen = 0;
-#endif
-
- if(!do_print)
- {
- umask(UMASK); /* set our umask ... */
-
- init_log(); /* initialize the logging subsystem */
- }
-
- check_pid(); /* check if we are already running */
-
- if(!do_print)
- {
- if(do_fork || (do_fullscreen && do_rdev)) /* daemon mode ? */
- daemonize();
-
- write_pid(); /* write our pid to file */
-
- /* set signal handler(s) */
-
- signal(SIGCHLD, sigchild_handler); /* process handling */
- signal(SIGHUP, rereadconfig); /* reread configuration */
- signal(SIGUSR1, reopenfiles); /* reopen acct/log files*/
- signal(SIGPIPE, SIG_IGN); /* handled manually */
- signal(SIGINT, do_exit); /* clean up on SIGINT */
- signal(SIGTERM, do_exit); /* clean up on SIGTERM */
- signal(SIGQUIT, do_exit); /* clean up on SIGQUIT */
- }
-
- /* open isdn device */
-
- if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0)
- {
- log(LL_ERR, "main: cannot open %s: %s", I4BDEVICE, strerror(errno));
- exit(1);
- }
-
- /* check kernel and userland have same version/release numbers */
-
- if((ioctl(isdnfd, I4B_VR_REQ, &mvr)) < 0)
- {
- log(LL_ERR, "main: ioctl I4B_VR_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- if(mvr.version != VERSION)
- {
- log(LL_ERR, "main: version mismatch, kernel %d, daemon %d", mvr.version, VERSION);
- do_exit(1);
- }
-
- if(mvr.release != REL)
- {
- log(LL_ERR, "main: release mismatch, kernel %d, daemon %d", mvr.release, REL);
- do_exit(1);
- }
-
- if(mvr.step != STEP)
- {
- log(LL_ERR, "main: step mismatch, kernel %d, daemon %d", mvr.step, STEP);
- do_exit(1);
- }
-
- /* init controller state array */
-
- init_controller();
-
- /* read runtime configuration file and configure ourselves */
-
- configure(configfile, 0);
-
- if(config_error_flag)
- {
- log(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag);
- exit(1);
- }
-
- /* handle the rates stuff */
-
- if((i = readrates(ratesfile)) == ERROR)
- {
- if(rate_error != NULL)
- log(LL_ERR, "%s", rate_error);
- exit(1);
- }
-
- if(i == GOOD)
- {
- got_rate = 1; /* flag, ratesfile read and ok */
- DBGL(DL_MSG, (log(LL_DBG, "ratesfile %s read successfully", ratesfile)));
- }
- else
- {
- if(rate_error != NULL)
- log(LL_WRN, "%s", rate_error);
- }
-
- /* if writing accounting info, open file, set unbuffered */
-
- if(useacctfile)
- {
- if((acctfp = fopen(acctfile, "a")) == NULL)
- {
- log(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile);
- exit(1);
- }
- setvbuf(acctfp, (char *)NULL, _IONBF, 0);
- }
-
- /* initialize alias processing */
-
- if(aliasing)
- init_alias(aliasfile);
-
- /* init remote monitoring */
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- monitor_init();
- sockfd = monitor_create_local_socket();
-#ifndef I4B_NOTCPIP_MONITOR
- remotesockfd = monitor_create_remote_socket(monitorport);
-#endif
- }
-#endif
-
- /* in case fullscreendisplay, initialize */
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- {
- init_screen();
- }
-#endif
-
- /* init realtime priority */
-
-#ifdef USE_RTPRIO
- if(rt_prio != RTPRIO_NOTUSED)
- {
- struct rtprio rtp;
-
- rtp.type = RTP_PRIO_REALTIME;
- rtp.prio = rt_prio;
-
- if((rtprio(RTP_SET, getpid(), &rtp)) == -1)
- {
- log(LL_ERR, "rtprio failed: %s", strerror(errno));
- do_exit(1);
- }
- }
-#endif
-
- srandom(580403); /* init random number gen */
-
- mloop( /* enter loop of no return .. */
-#ifdef I4B_EXTERNAL_MONITOR
- sockfd
-#ifndef I4B_NOTCPIP_MONITOR
- , remotesockfd
-#endif
-#endif
- );
- do_exit(0);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * program exit
- *---------------------------------------------------------------------------*/
-void
-do_exit(int exitval)
-{
- close_allactive();
-
- unlink(PIDFILE);
-
- log(LL_DMN, "daemon terminating, exitval = %d", exitval);
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- endwin();
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_exit();
-#endif
-
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * main loop
- *---------------------------------------------------------------------------*/
-static void
-mloop(
-#ifdef I4B_EXTERNAL_MONITOR
- int localmonitor
-#ifndef I4B_NOTCPIP_MONITOR
- , int remotemonitor
-#endif
-#endif
-)
-{
- fd_set set;
- struct timeval timeout;
- int ret;
- int high_selfd;
-
- /* go into loop */
-
- log(LL_DMN, "daemon started (pid = %d)", getpid());
-
- for(;;)
- {
- FD_ZERO(&set);
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- FD_SET(fileno(stdin), &set);
-#endif
-
- FD_SET(isdnfd, &set);
-
- high_selfd = isdnfd;
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- if (localmonitor != -1) {
- /* always watch for new connections */
- FD_SET(localmonitor, &set);
- if(localmonitor > high_selfd)
- high_selfd = localmonitor;
- }
-#ifndef I4B_NOTCPIP_MONITOR
- if (remotemonitor != -1) {
- FD_SET(remotemonitor, &set);
- if(remotemonitor > high_selfd)
- high_selfd = remotemonitor;
- }
-#endif
-
- /* if there are client connections, let monitor module
- * enter them into the fdset */
- if(accepted)
- {
- monitor_prepselect(&set, &high_selfd);
- }
- }
-#endif
-
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-
- ret = select(high_selfd + 1, &set, NULL, NULL, &timeout);
-
- if(ret > 0)
- {
- if(FD_ISSET(isdnfd, &set))
- isdnrdhdl();
-
-#ifdef USE_CURSES
- if(FD_ISSET(fileno(stdin), &set))
- kbdrdhdl();
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- if(localmonitor != -1 && FD_ISSET(localmonitor, &set))
- monitor_handle_connect(localmonitor, 1);
-
-#ifndef I4B_NOTCPIP_MONITOR
- if(remotemonitor != -1 && FD_ISSET(remotemonitor, &set))
- monitor_handle_connect(remotemonitor, 0);
-#endif
- if(accepted)
- monitor_handle_input(&set);
- }
-#endif
- }
- else if(ret == -1)
- {
- if(errno != EINTR)
- log(LL_WRN, "ERROR, select error on isdn device, errno = %d!", errno);
- }
-
- /* handle timeout and recovery */
-
- handle_recovery();
- }
-}
-
-#ifdef USE_CURSES
-/*---------------------------------------------------------------------------*
- * data from keyboard available, read and process it
- *---------------------------------------------------------------------------*/
-static void
-kbdrdhdl(void)
-{
- int ch = getch();
-
- switch(ch)
- {
- case 0x0c: /* control L */
- wrefresh(curscr);
- break;
-
- case '\n':
- case '\r':
- do_menu();
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * data from /dev/isdn available, read and process them
- *---------------------------------------------------------------------------*/
-static void
-isdnrdhdl(void)
-{
- static unsigned char msg_rd_buf[MSG_BUF_SIZ];
- msg_hdr_t *hp = (msg_hdr_t *)&msg_rd_buf[0];
-
- register int len;
-
- if((len = read(isdnfd, msg_rd_buf, MSG_BUF_SIZ)) > 0)
- {
- switch(hp->type)
- {
- case MSG_CONNECT_IND:
- msg_connect_ind((msg_connect_ind_t *)msg_rd_buf);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- msg_connect_active_ind((msg_connect_active_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DISCONNECT_IND:
- msg_disconnect_ind((msg_disconnect_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DIALOUT_IND:
- msg_dialout((msg_dialout_ind_t *)msg_rd_buf);
- break;
-
- case MSG_ACCT_IND:
- msg_accounting((msg_accounting_ind_t *)msg_rd_buf);
- break;
-
- case MSG_IDLE_TIMEOUT_IND:
- msg_idle_timeout_ind((msg_idle_timeout_ind_t *)msg_rd_buf);
- break;
-
- case MSG_CHARGING_IND:
- msg_charging_ind((msg_charging_ind_t *)msg_rd_buf);
- break;
-
- case MSG_PROCEEDING_IND:
- msg_proceeding_ind((msg_proceeding_ind_t *)msg_rd_buf);
- break;
-
- case MSG_ALERT_IND:
- msg_alert_ind((msg_alert_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DRVRDISC_REQ:
- msg_drvrdisc_req((msg_drvrdisc_req_t *)msg_rd_buf);
- break;
-
- case MSG_L12STAT_IND:
- msg_l12stat_ind((msg_l12stat_ind_t *)msg_rd_buf);
- break;
-
- case MSG_TEIASG_IND:
- msg_teiasg_ind((msg_teiasg_ind_t *)msg_rd_buf);
- break;
-
- case MSG_PDEACT_IND:
- msg_pdeact_ind((msg_pdeact_ind_t *)msg_rd_buf);
- break;
-
- case MSG_NEGCOMP_IND:
- msg_negcomplete_ind((msg_negcomplete_ind_t *)msg_rd_buf);
- break;
-
- case MSG_IFSTATE_CHANGED_IND:
- msg_ifstatechg_ind((msg_ifstatechg_ind_t *)msg_rd_buf);
- break;
-
- default:
- log(LL_WRN, "ERROR, unknown message received from /dev/isdn (0x%x)", msg_rd_buf[0]);
- break;
- }
- }
- else
- {
- log(LL_WRN, "ERROR, read error on isdn device, errno = %d, length = %d", errno, len);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * re-read the config file on SIGHUP or menu command
- *---------------------------------------------------------------------------*/
-void
-rereadconfig(int dummy)
-{
- extern int entrycount;
-
- log(LL_DMN, "re-reading configuration file");
-
- close_allactive();
-
- entrycount = -1;
- nentries = 0;
-
- /* read runtime configuration file and configure ourselves */
-
- configure(configfile, 1);
-
- if(config_error_flag)
- {
- log(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag);
- unlink(PIDFILE);
- exit(1);
- }
-
- if(aliasing)
- {
- /* reread alias database */
- free_aliases();
- init_alias(aliasfile);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * re-open the log/acct files on SIGUSR1
- *---------------------------------------------------------------------------*/
-void
-reopenfiles(int dummy)
-{
- if(useacctfile)
- {
- fflush(acctfp);
- fclose(acctfp);
-
- if((acctfp = fopen(acctfile, "a")) == NULL)
- {
- log(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile);
- exit(1);
- }
- setvbuf(acctfp, (char *)NULL, _IONBF, 0);
- }
-
- if(uselogfile)
- {
- finish_log();
-
- if((logfp = fopen(logfile, "a")) == NULL)
- {
- fprintf(stderr, "ERROR, cannot open logfile %s: %s\n",
- logfile, strerror(errno));
- exit(1);
- }
-
- /* set unbuffered operation */
-
- setvbuf(logfp, (char *)NULL, _IONBF, 0);
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/monitor.c b/usr.sbin/i4b/isdnd/monitor.c
deleted file mode 100644
index 884df137819b..000000000000
--- a/usr.sbin/i4b/isdnd/monitor.c
+++ /dev/null
@@ -1,811 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor server module
- * ------------------------------------------
- *
- * $Id: monitor.c,v 1.6 1998/08/10 13:55:24 hm Exp $
- *
- * last edit-date: [Fri Jul 17 18:07:00 1998]
- *
- * -mh created
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#ifndef I4B_EXTERNAL_MONITOR
-/* dummy version of routines needed by config file parser
- * (config files should be valid with and without external montioring
- * support compiled into the daemon) */
-void monitor_clear_rights()
-{ }
-int monitor_start_rights(const char *clientspec)
-{ return I4BMAR_OK; }
-void monitor_add_rights(int rights_mask)
-{ }
-void monitor_fixup_rights()
-{ }
-#else
-
-#include "monitor.h"
-#include "vararray.h"
-#include <sys/socket.h>
-#include <sys/un.h>
-#ifndef I4B_NOTCPIP_MONITOR
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-
-VARA_DECL(struct monitor_rights) rights = VARA_INITIALIZER;
-#define INITIAL_RIGHTS_ALLOC 10 /* most users will have one or two entries */
-
-static int local_rights = -1; /* index of entry for local socket, -1 if none */
-
-/* for each active monitor connection we have one of this: */
-struct monitor_connection {
- int sock; /* socket for this connection */
- int rights; /* active rights for this connection */
- int events; /* bitmask of events client is interested in */
-};
-static VARA_DECL(struct monitor_connection) connections = VARA_INITIALIZER;
-#define INITIAL_CONNECTIONS_ALLOC 30 /* high guess */
-
-/* derive channel number from config pointer */
-#define CHNO(cfgp) (((cfgp)->isdncontrollerused*2) + (cfgp)->isdnchannelused)
-
-/* local prototypes */
-static int cmp_rights(const void *a, const void *b);
-static int monitor_command(int con_index, int fd, int rights);
-static void cmd_dump_rights(int fd, int rights, BYTE *cmd);
-static void cmd_dump_mcons(int fd, int rights, BYTE *cmd);
-static void cmd_reread_cfg(int fd, int rights, BYTE *cmd);
-static void cmd_hangup(int fd, int rights, BYTE *cmd);
-static void monitor_broadcast(int mask, const BYTE *pkt, size_t bytes);
-static int anybody(int mask);
-
-/*
- * Due to the way we structure config files, the rights for an external
- * monitor might be stated in multiple steps. First a call to
- * monitor_start_rights opens an entry. Further (optional) calls to
- * montior_add_rights assemble additional rights for this "current"
- * entry. When closing the sys-file section of the config file, the
- * "current" entry becomes invalid.
- */
-static int cur_add_entry = -1;
-
-/*
- * Initialize the monitor server module. This affects only active
- * connections, the access rights are not modified here!
- */
-void monitor_init()
-{
- accepted = 0;
- VARA_EMPTY(connections);
-}
-
-/*
- * Prepare for exit
- */
-void monitor_exit()
-{
- int i;
-
- /* Close all open connections. */
- VARA_FOREACH(connections, i)
- close(VARA_AT(connections, i).sock);
-
- /* Remove their descriptions */
- VARA_EMPTY(connections);
-}
-
-/*
- * Initialize access rights. No active connections are affected!
- */
-void monitor_clear_rights()
-{
- VARA_EMPTY(rights);
- cur_add_entry = -1;
-}
-
-/*
- * Add an entry to the access lists. The clientspec either is
- * the name of the local socket or a host- or networkname or
- * numeric ip/host-bit-len spec.
- */
-int monitor_start_rights(const char *clientspec)
-{
- int i;
- struct monitor_rights r;
-
- /* initialize the new rights entry */
- memset(&r, 0, sizeof r);
-
- /* check clientspec */
- if (*clientspec == '/') {
- struct sockaddr_un sa;
-
- /* this is a local socket spec, check if we already have one */
- if (VARA_VALID(rights, local_rights))
- return I4BMAR_DUP;
- /* does it fit in a local socket address? */
- if (strlen(clientspec) > sizeof sa.sun_path)
- return I4BMAR_LENGTH;
- r.local = 1;
- strcpy(r.name, clientspec);
-#ifndef I4B_NOTCPIP_MONITOR
- } else {
- /* remote entry, parse host/net and cidr */
- char hostname[FILENAME_MAX];
- char *p;
- p = strchr(clientspec, '/');
- if (!p) {
- struct hostent *host;
- u_int32_t hn;
- /* must be a host spec */
- r.mask = ~0;
- host = gethostbyname(clientspec);
- if (!host)
- return I4BMAR_NOIP;
- memcpy(&hn, host->h_addr_list[0], sizeof hn);
- r.net = (u_int32_t)ntohl(hn);
- } else if (p[1]) {
- /* must be net/cidr spec */
- int l;
- struct netent *net;
- u_int32_t s = ~0U;
- int num = strtol(p+1, NULL, 10);
- if (num < 0 || num > 32)
- return I4BMAR_CIDR;
- s >>= num;
- s ^= ~0U;
- l = p - clientspec;
- if (l >= sizeof hostname)
- return I4BMAR_LENGTH;
- strncpy(hostname, clientspec, l);
- hostname[l] = '\0';
- net = getnetbyname(hostname);
- if (net == NULL)
- r.net = (u_int32_t)inet_network(hostname);
- else
- r.net = (u_int32_t)net->n_net;
- r.mask = s;
- r.net &= s;
- } else
- return I4BMAR_CIDR;
-
- /* check for duplicate entry */
- VARA_FOREACH(rights, i)
- if (VARA_AT(rights, i).mask == r.mask &&
- VARA_AT(rights, i).net == r.net &&
- VARA_AT(rights, i).local == r.local)
- return I4BMAR_DUP;
-#endif
- }
- r.rights = 0;
-
- /* entry ok, add it to the collection */
- cur_add_entry = i = VARA_NUM(rights);
- VARA_ADD_AT(rights, i, struct monitor_rights, INITIAL_RIGHTS_ALLOC);
- memcpy(&VARA_AT(rights, i), &r, sizeof r);
- if (r.local)
- local_rights = i;
-
- log(LL_DBG, "system: monitor = %s", clientspec);
-
- return I4BMAR_OK;
-}
-
-/*
- * Add rights to the currently constructed entry - if any.
- */
-void monitor_add_rights(int rights_mask)
-{
- if (cur_add_entry < 0) return; /* noone under construction */
-
- VARA_AT(rights, cur_add_entry).rights |= rights_mask;
-
- log(LL_DBG, "system: monitor-access = 0x%x", rights_mask);
-}
-
-/*
- * All rights have been added now. Sort the to get most specific
- * host/net masks first, so we can travel the list and use the first
- * match for actual rights.
- */
-void monitor_fixup_rights()
-{
- int i;
-
- /* no more rights may be added to the current entry */
- cur_add_entry = -1;
-
- /* sort the rights array */
- qsort(VARA_PTR(rights), VARA_NUM(rights), sizeof(struct monitor_rights), cmp_rights);
-
- /* now the local entry may have moved, update its index */
- if (VARA_VALID(rights, local_rights)) {
- local_rights = -1;
- VARA_FOREACH(rights, i) {
- if (VARA_AT(rights, i).local) {
- local_rights = i;
- break;
- }
- }
- }
-}
-
-/* comparator for rights */
-static int cmp_rights(const void *a, const void *b)
-{
- u_int32_t mask;
- struct monitor_rights const * pa = (struct monitor_rights const*)a;
- struct monitor_rights const * pb = (struct monitor_rights const*)b;
-
- /* local sorts first */
- if (pa->local)
- return -1;
-
- /* which is the less specific netmask? */
- mask = pa->mask;
- if ((pb->mask & mask) == 0)
- mask = pb->mask;
- /* are the entries disjunct? */
- if ((pa->net & mask) != (pb->net & mask)) {
- /* simply compare net part of address */
- return ((pa->net & mask) < (pb->net & mask)) ? -1 : 1;
- }
- /* One entry is part of the others net. We already now "mask" is
- * the netmask of the less specific (i.e. greater) one */
- return (pa->mask == mask) ? 1 : -1;
-}
-
-#ifndef I4B_NOTCPIP_MONITOR
-/*
- * Check if access rights for a remote socket are specified and
- * create this socket. Return -1 otherwise.
- */
-int monitor_create_remote_socket(int portno)
-{
- struct sockaddr_in sa;
- int val;
- int remotesockfd = socket(AF_INET, SOCK_STREAM, 0);
- if (remotesockfd == -1) {
- log(LL_ERR, "could not create remote monitor socket, errno = %d", errno);
- exit(1);
- }
- val = 1;
- if (setsockopt(remotesockfd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val)) {
- log(LL_ERR, "could not setsockopt, errno = %d", errno);
- exit(1);
- }
- memset(&sa, 0, sizeof sa);
- sa.sin_len = sizeof sa;
- sa.sin_family = AF_INET;
- sa.sin_port = htons(portno);
- sa.sin_addr.s_addr = htonl(INADDR_ANY);
- if (bind(remotesockfd, (struct sockaddr *)&sa, sizeof sa) == -1) {
- log(LL_ERR, "could not bind remote monitor socket to port %d, errno = %d", portno, errno);
- exit(1);
- }
- if (listen(remotesockfd, 0)) {
- log(LL_ERR, "could not listen on monitor socket, errno = %d", errno);
- exit(1);
- }
-
- return remotesockfd;
-}
-#endif
-
-/*
- * Check if access rights for a local socket are specified and
- * create this socket. Return -1 otherwise.
- */
-int monitor_create_local_socket()
-{
- int s;
- struct sockaddr_un sa;
-
- /* check for a local entry */
- if (!VARA_VALID(rights, local_rights))
- return -1;
-
- /* create and setup socket */
- s = socket(AF_LOCAL, SOCK_STREAM, 0);
- if (s == -1) {
- log(LL_ERR, "could not create local monitor socket, errno = %d", errno);
- exit(1);
- }
- unlink(VARA_AT(rights, local_rights).name);
- memset(&sa, 0, sizeof sa);
- sa.sun_len = sizeof sa;
- sa.sun_family = AF_LOCAL;
- strcpy(sa.sun_path, VARA_AT(rights, local_rights).name);
- if (bind(s, (struct sockaddr *)&sa, sizeof sa)) {
- log(LL_ERR, "could not bind local monitor socket [%s], errno = %d", VARA_AT(rights, local_rights).name, errno);
- exit(1);
- }
- if (listen(s, 0)) {
- log(LL_ERR, "could not listen on local monitor socket, errno = %d", errno);
- exit(1);
- }
-
- return s;
-}
-
-/*
- * Prepare a fd_set for a select call. Add all our local
- * filedescriptors to the set, increment max_fd if appropriate.
- */
-void monitor_prepselect(fd_set *selset, int *max_fd)
-{
- int i;
-
- VARA_FOREACH(connections, i) {
- int fd = VARA_AT(connections, i).sock;
- if (fd > *max_fd)
- *max_fd = fd;
- FD_SET(fd, selset);
- }
-}
-
-/*
- * Check if the result from a select call indicates something
- * to do for us.
- */
-void monitor_handle_input(fd_set *selset)
-{
- int i;
-
- VARA_FOREACH(connections, i) {
- int fd = VARA_AT(connections, i).sock;
- if (FD_ISSET(fd, selset)) {
- /* handle command from this client */
- if (monitor_command(i, fd, VARA_AT(connections, i).rights) != 0) {
- /* broken or closed connection */
- log(LL_DBG, "monitor connection #%d closed", i);
- VARA_REMOVEAT(connections, i);
- i--;
- }
- }
- }
-
- /* all connections gone? */
- if (VARA_NUM(connections) == 0)
- accepted = 0;
-}
-
-/*
- * Try new incoming connection on the given socket.
- * Setup client descriptor and send initial data.
- */
-void monitor_handle_connect(int sockfd, int is_local)
-{
- struct monitor_connection *con;
-#ifndef I4B_NOTCPIP_MONITOR
- struct sockaddr_in ia;
- u_int32_t ha = 0;
-#endif
- struct sockaddr_un ua;
- BYTE idata[I4B_MON_IDATA_SIZE];
- int fd = -1, s, i, r_mask;
- char source[FILENAME_MAX];
-
- /* accept the connection */
- if (is_local) {
- s = sizeof ua;
- fd = accept(sockfd, (struct sockaddr *)&ua, &s);
- strcpy(source, "local connection");
-#ifndef I4B_NOTCPIP_MONITOR
- } else {
- s = sizeof ia;
- fd = accept(sockfd, (struct sockaddr *)&ia, &s);
- snprintf(source, sizeof source, "tcp/ip connection from %s\n",
- inet_ntoa(ia.sin_addr));
- memcpy(&ha, &ia.sin_addr.s_addr, sizeof ha);
- ha = ntohl(ha);
-#endif
- }
-
- /* check the access rights of this connection */
- r_mask = 0;
- VARA_FOREACH(rights, i) {
- struct monitor_rights *r = &VARA_AT(rights, i);
- if (r->local) {
- if (is_local) {
- r_mask = r->rights;
- break;
- }
-#ifndef I4B_NOTCPIP_MONITOR
- } else {
- if ((ha & r->mask) == r->net) {
- r_mask = r->rights;
- break;
- }
-#endif
- }
- }
-
- if (r_mask == 0) {
- /* no rights - go away */
- log(LL_DBG, "monitor access denied: %s", source);
- close(fd);
- return;
- }
-
- accepted = 1;
- i = VARA_NUM(connections);
- VARA_ADD_AT(connections, i, struct monitor_connection, INITIAL_CONNECTIONS_ALLOC);
- con = &VARA_AT(connections, i);
- memset(con, 0, sizeof *con);
- con->sock = fd;
- con->rights = r_mask;
- log(LL_DBG, "monitor access granted, rights = %x, #%d, %s",
- r_mask, i, source);
-
- /* send initial data */
- I4B_PREP_CMD(idata, I4B_MON_IDATA_CODE);
- I4B_PUT_2B(idata, I4B_MON_IDATA_VERSMAJOR, MPROT_VERSION);
- I4B_PUT_2B(idata, I4B_MON_IDATA_VERSMINOR, MPROT_REL);
- I4B_PUT_2B(idata, I4B_MON_IDATA_NUMCTRL, ncontroller);
- I4B_PUT_4B(idata, I4B_MON_IDATA_CLACCESS, r_mask);
- write(fd, idata, sizeof idata);
-
- for (i = 0; i < ncontroller; i++) {
- BYTE ictrl[I4B_MON_ICTRL_SIZE];
- I4B_PREP_CMD(ictrl, I4B_MON_ICTRL_CODE);
- I4B_PUT_STR(ictrl, I4B_MON_ICTRL_NAME, name_of_controller(isdn_ctrl_tab[i].ctrl_type, isdn_ctrl_tab[i].card_type));
- I4B_PUT_2B(ictrl, I4B_MON_ICTRL_BUSID, 0);
- I4B_PUT_4B(ictrl, I4B_MON_ICTRL_FLAGS, 0);
- I4B_PUT_4B(ictrl, I4B_MON_ICTRL_NCHAN, 2);
- write(fd, ictrl, sizeof ictrl);
- }
-}
-
-/* dump all monitor rights */
-static void cmd_dump_rights(int fd, int r_mask, BYTE *cmd)
-{
- int i;
- BYTE drini[I4B_MON_DRINI_SIZE];
- BYTE dr[I4B_MON_DR_SIZE];
-
- I4B_PREP_EVNT(drini, I4B_MON_DRINI_CODE);
- I4B_PUT_2B(drini, I4B_MON_DRINI_COUNT, VARA_NUM(rights));
- write(fd, drini, sizeof drini);
-
- VARA_FOREACH(rights, i) {
- I4B_PREP_EVNT(dr, I4B_MON_DR_CODE);
- I4B_PUT_4B(dr, I4B_MON_DR_RIGHTS, VARA_AT(rights, i).rights);
- I4B_PUT_4B(dr, I4B_MON_DR_NET, VARA_AT(rights, i).net);
- I4B_PUT_4B(dr, I4B_MON_DR_MASK, VARA_AT(rights, i).mask);
- I4B_PUT_1B(dr, I4B_MON_DR_LOCAL, VARA_AT(rights, i).local);
- write(fd, dr, sizeof dr);
- }
-}
-
-/* rescan config file */
-static void cmd_reread_cfg(int fd, int rights, BYTE *cmd)
-{
- rereadconfig(42);
-}
-
-/* drop one connection */
-static void cmd_hangup(int fd, int rights, BYTE *cmd)
-{
- int channel = I4B_GET_4B(cmd, I4B_MON_HANGUP_CHANNEL);
- hangup_channel(channel);
-}
-
-/* dump all active monitor connections */
-static void cmd_dump_mcons(int fd, int rights, BYTE *cmd)
-{
- int i;
- BYTE dcini[I4B_MON_DCINI_SIZE];
-
- I4B_PREP_EVNT(dcini, I4B_MON_DCINI_CODE);
- I4B_PUT_2B(dcini, I4B_MON_DCINI_COUNT, VARA_NUM(connections));
- write(fd, dcini, sizeof dcini);
-
- VARA_FOREACH(connections, i) {
-#ifndef I4B_NOTCPIP_MONITOR
- int namelen;
- struct sockaddr_in name;
-#endif
- BYTE dc[I4B_MON_DC_SIZE];
-
- I4B_PREP_EVNT(dc, I4B_MON_DC_CODE);
- I4B_PUT_4B(dc, I4B_MON_DC_RIGHTS, VARA_AT(connections, i).rights);
-#ifndef I4B_NOTCPIP_MONITOR
- namelen = sizeof name;
- if (getpeername(VARA_AT(connections, i).sock, (struct sockaddr*)&name, &namelen) == 0)
- memcpy(dc+I4B_MON_DC_WHO, &name.sin_addr, sizeof name.sin_addr);
-#endif
- write(fd, dc, sizeof dc);
- }
-}
-
-/*
- * Handle a command from the given socket. The client
- * has rights as specified in the rights parameter.
- * Return non-zero if connection is closed.
- */
-static int monitor_command(int con_index, int fd, int rights)
-{
- char cmd[I4B_MAX_MON_CLIENT_CMD];
- u_int code;
- /* command dispatch table */
- typedef void (*cmd_func_t)(int fd, int rights, BYTE *cmd);
- static struct {
- cmd_func_t call; /* function to execute */
- u_int rights; /* necessary rights */
- } cmd_tab[] =
- {
- /* 0 */ { NULL, 0 },
- /* 1 */ { cmd_dump_rights, I4B_CA_COMMAND_FULL },
- /* 2 */ { cmd_dump_mcons, I4B_CA_COMMAND_FULL },
- /* 3 */ { cmd_reread_cfg, I4B_CA_COMMAND_FULL },
- /* 4 */ { cmd_hangup, I4B_CA_COMMAND_FULL },
- };
-#define NUMCMD (sizeof cmd_tab / sizeof cmd_tab[0])
-
- u_long u;
- int bytes;
-
- /* Network transfer may deliver two or more packets concatenated.
- * Peek at the header and read only one event at a time... */
- ioctl(fd, FIONREAD, &u);
- if (u < I4B_MON_CMD_HDR) {
- if (u == 0) {
- /* socket closed by peer */
- close(fd);
- return 1;
- }
- return 0; /* not enough data there yet */
- }
- bytes = recv(fd, cmd, I4B_MON_CMD_HDR, MSG_PEEK);
- if (bytes < I4B_MON_CMD_HDR)
- return 0; /* errh? something must be wrong... */
- bytes = I4B_GET_2B(cmd, I4B_MON_CMD_LEN);
- if (bytes >= sizeof cmd) {
- close(fd);
- log(LL_ERR, "garbage on monitor connection #%d, closing it", con_index);
- return 1;
- }
- /* now we know the size, it fits, so lets read it! */
- if (read(fd, cmd, bytes) <= 0) {
- close(fd);
- return 1;
- }
-
- /* decode command */
- code = I4B_GET_2B(cmd, I4B_MON_CMD);
-
- /* special case: may modify our connection descriptor, is
- * beyound all rights checks */
- if (code == I4B_MON_CCMD_SETMASK) {
- /*
- u_int major = I4B_GET_2B(cmd, I4B_MON_ICLIENT_VERMAJOR);
- u_int minor = I4B_GET_2B(cmd, I4B_MON_ICLIENT_VERMINOR);
- */
- int events = I4B_GET_4B(cmd, I4B_MON_ICLIENT_EVENTS);
- VARA_AT(connections, con_index).events = events & rights;
- return 0;
- }
-
- if (code < 0 || code >= NUMCMD) {
- log(LL_ERR, "illegal command from client #%d: code = %d\n",
- con_index, code);
- return 0;
- }
- if (cmd_tab[code].call == NULL)
- return 0;
- if ((cmd_tab[code].rights & rights) == cmd_tab[code].rights)
- cmd_tab[code].call(fd, rights, cmd);
-
- return 0;
-}
-
-/*
- * Check if somebody would receive an event with this mask.
- * We are lazy and try to avoid assembling unneccesary packets.
- * Return 0 if no one interested, nonzero otherwise.
- */
-static int anybody(int mask)
-{
- int i;
-
- VARA_FOREACH(connections, i)
- if ((VARA_AT(connections, i).events & mask) == mask)
- return 1;
-
- return 0;
-}
-
-/*
- * Send an event to every connection interested in this kind of
- * event
- */
-static void monitor_broadcast(int mask, const BYTE *pkt, size_t bytes)
-{
- int i;
-
- VARA_FOREACH(connections, i) {
- if ((VARA_AT(connections, i).events & mask) == mask) {
- int fd = VARA_AT(connections, i).sock;
- write(fd, pkt, bytes);
- }
- }
-}
-
-/*
- * Post a logfile event
- */
-void monitor_evnt_log(int prio, const char * what, const char * msg)
-{
- BYTE evnt[I4B_MON_LOGEVNT_SIZE];
- time_t now;
-
- if (!anybody(I4B_CA_EVNT_I4B)) return;
-
- time(&now);
- I4B_PREP_EVNT(evnt, I4B_MON_LOGEVNT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_LOGEVNT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_LOGEVNT_PRIO, prio);
- I4B_PUT_STR(evnt, I4B_MON_LOGEVNT_WHAT, what);
- I4B_PUT_STR(evnt, I4B_MON_LOGEVNT_MSG, msg);
-
- monitor_broadcast(I4B_CA_EVNT_I4B, evnt, sizeof evnt);
-}
-
-/*
- * Post a charging event on the connection described
- * by the given config entry.
- */
-void monitor_evnt_charge(cfg_entry_t *cep, int units, int estimate)
-{
- int chno = CHNO(cep);
- int mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
- time_t now;
- BYTE evnt[I4B_MON_CHRG_SIZE];
-
- if (!anybody(mask)) return;
-
- time(&now);
- I4B_PREP_EVNT(evnt, I4B_MON_CHRG_CODE);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_CHANNEL, chno);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_UNITS, units);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_ESTIMATED, estimate ? 1 : 0);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*
- * Post a connection event
- */
-void monitor_evnt_connect(cfg_entry_t *cep)
-{
- BYTE evnt[I4B_MON_CONNECT_SIZE];
- char devname[I4B_MAX_MON_STRING];
- int chno = CHNO(cep);
- int mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
- time_t now;
-
- if (!anybody(mask)) return;
-
- time(&now);
- snprintf(devname, sizeof devname, "%s%d", bdrivername(cep->usrdevicename), cep->usrdeviceunit);
- I4B_PREP_EVNT(evnt, I4B_MON_CONNECT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_DIR, cep->direction == DIR_OUT ? 1 : 0);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_CHANNEL, chno);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_CFGNAME, cep->name);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_DEVNAME, devname);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_REMPHONE, cep->real_phone_incoming);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_LOCPHONE, cep->remote_phone_dialout);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*
- * Post a disconnect event
- */
-void monitor_evnt_disconnect(cfg_entry_t *cep)
-{
- BYTE evnt[I4B_MON_DISCONNECT_SIZE];
- int chno = CHNO(cep);
- int mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
- time_t now;
-
- if (!anybody(mask)) return;
-
- time(&now);
- I4B_PREP_EVNT(evnt, I4B_MON_DISCONNECT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_DISCONNECT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_DISCONNECT_CHANNEL, chno);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*
- * Post an up/down event
- */
-void monitor_evnt_updown(cfg_entry_t *cep, int up)
-{
- BYTE evnt[I4B_MON_UPDOWN_SIZE];
- int chno = CHNO(cep);
- int mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
- time_t now;
-
- if (!anybody(mask)) return;
-
- time(&now);
- I4B_PREP_EVNT(evnt, I4B_MON_UPDOWN_CODE);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_CHANNEL, chno);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_ISUP, up);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-void hangup_channel(int channel)
-{
- int i;
- cfg_entry_t * cep = NULL;
-
- for (i = 0; i < ncontroller; i++)
- {
- if(isdn_ctrl_tab[i].state != CTRL_UP)
- continue;
- if(isdn_ctrl_tab[i].stateb1 != CHAN_IDLE)
- {
- cep = get_cep_by_cc(i, 0);
- if (cep != NULL && CHNO(cep) == channel)
- goto found;
- }
- if(isdn_ctrl_tab[i].stateb2 != CHAN_IDLE)
- {
- cep = get_cep_by_cc(i, 1);
- if (cep != NULL && CHNO(cep) == channel)
- goto found;
- }
- }
- /* not found */
- return;
-
-found:
- cep->hangup = 1;
- return;
-}
-
-#endif /* I4B_EXTERNAL_MONITOR */
diff --git a/usr.sbin/i4b/isdnd/msghdl.c b/usr.sbin/i4b/isdnd/msghdl.c
deleted file mode 100644
index 61ac0edae289..000000000000
--- a/usr.sbin/i4b/isdnd/msghdl.c
+++ /dev/null
@@ -1,983 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - message from kernel handling routines
- * --------------------------------------------------
- *
- * $Id: msghdl.c,v 1.54 1998/12/19 09:03:16 hm Exp $
- *
- * last edit-date: [Sat Dec 19 09:57:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * handle incoming CONNECT_IND (=SETUP) message
- *---------------------------------------------------------------------------*/
-void
-msg_connect_ind(msg_connect_ind_t *mp)
-{
- cfg_entry_t *cep;
- char *src_tela = "ERROR-src_tela";
- char *dst_tela = "ERROR-dst_tela";
-
-#define SRC (aliasing == 0 ? mp->src_telno : src_tela)
-#define DST (aliasing == 0 ? mp->dst_telno : dst_tela)
-
- if((cep = find_matching_entry_incoming(mp)) == NULL)
- {
- /* log message generated in find_matching_entry_incoming() */
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- return;
- }
-
- if(cep->cdid != CDID_UNUSED && cep->cdid != CDID_RESERVED)
- {
- /*
- * This is an incoming call on a number we just dialed out.
- * Stop our dial-out and accept the incoming call.
- */
- if(cep->saved_call.cdid != CDID_UNUSED &&
- cep->saved_call.cdid != CDID_RESERVED)
- {
- int cdid;
-
- /* disconnect old, not new */
-
- cdid = cep->cdid;
- cep->cdid = cep->saved_call.cdid;
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- cep->cdid = cdid;
-
- /*
- * Shortcut the state machine and mark this
- * entry as free
- */
-/* XXX */ cep->state = ST_IDLE; /* this is an invalid */
- /* transition, */
- /* so no next_state() */
- /* we have to wait here for an incoming */
- /* disconnect message !!! (-hm) */
- }
- }
-
- if(aliasing)
- {
- src_tela = get_alias(mp->src_telno);
- dst_tela = get_alias(mp->dst_telno);
- }
-
- if(cep->inout == DIR_OUTONLY)
- {
- log(LL_CHD, "%05d %s incoming call from %s to %s not allowed by configuration!",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- return;
- }
-
- cep->charge = 0;
- cep->last_charge = 0;
-
- switch(cep->dialin_reaction)
- {
- case REACT_ACCEPT:
- log(LL_CHD, "%05d %s accepting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- decr_free_channels(mp->controller);
- next_state(cep, EV_MCI);
- break;
-
- case REACT_REJECT:
- log(LL_CHD, "%05d %s rejecting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
- (CAUSET_I4B << 8) | CAUSE_I4B_REJECT);
- cep->cdid = CDID_UNUSED;
- break;
-
- case REACT_IGNORE:
- log(LL_CHD, "%05d %s ignoring: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- break;
-
- case REACT_ANSWER:
- decr_free_channels(mp->controller);
- if(cep->alert)
- {
- if(mp->display)
- {
- log(LL_CHD, "%05d %s alerting: incoming call from %s to %s (%s)",
- mp->header.cdid, cep->name, SRC, DST, mp->display);
- }
- else
- {
- log(LL_CHD, "%05d %s alerting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- }
- next_state(cep, EV_ALRT);
- }
- else
- {
- if(mp->display)
- {
- log(LL_CHD, "%05d %s answering: incoming call from %s to %s (%s)",
- mp->header.cdid, cep->name, SRC, DST, mp->display);
- }
- else
- {
- log(LL_CHD, "%05d %s answering: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- }
- next_state(cep, EV_MCI);
- }
- break;
-
- case REACT_CALLBACK:
-#ifdef NOTDEF
-/*XXX reserve channel ??? */ decr_free_channels(mp->controller);
-#endif
- if(cep->cdid == CDID_RESERVED)
- {
- log(LL_CHD, "%05d %s reserved: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- /* no state change */
- }
- else
- {
- log(LL_CHD, "%05d %s callback: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- cep->last_release_time = time(NULL);
- cep->cdid = CDID_RESERVED;
- next_state(cep, EV_CBRQ);
- }
- break;
-
- default:
- log(LL_WRN, "msg_connect_ind: unknown response type, tx SETUP_RESP_DNTCRE");
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- break;
- }
-#undef SRC
-#undef DST
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming CONNECT_ACTIVE_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_connect_active_ind(msg_connect_active_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_connect_active_ind: cdid not found!");
- return;
- }
-
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-
- cep->aoc_now = cep->connect_time = time(NULL);
- cep->aoc_last = 0;
- cep->aoc_diff = 0;
- cep->aoc_valid = AOC_INVALID;
-
- cep->local_disconnect = DISCON_REM;
-
- cep->inbytes = INVALID;
- cep->outbytes = INVALID;
- cep->hangup = 0;
-
- /* set the B-channel to active */
-
- if((set_channel_busy(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- log(LL_ERR, "msg_connect_active_ind: set_channel_busy failed!");
-
- if(cep->direction == DIR_OUT)
- {
- log(LL_CHD, "%05d %s outgoing call active (ctl %d, ch %d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused);
- }
- else
- {
- log(LL_CHD, "%05d %s incoming call active (ctl %d, ch %d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused);
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_connect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_connect(cep);
-#endif
-
- if(isdntime && (mp->datetime[0] != '\0'))
- {
- log(LL_DMN, "date/time from exchange = %s", mp->datetime);
- }
-
- next_state(cep, EV_MCAI);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming PROCEEDING_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_proceeding_ind(msg_proceeding_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_proceeding_ind: cdid not found!");
- return;
- }
-
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-
- /* set the B-channels active */
-
- if((set_channel_busy(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- log(LL_ERR, "msg_proceeding_ind: set_channel_busy failed!");
-
- log(LL_CHD, "%05d %s outgoing call proceeding (ctl %d, ch %d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming ALERT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_alert_ind(msg_alert_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_alert_ind: cdid not found!");
- return;
- }
-#ifdef NOTDEF
- log(LL_CHD, "%05d %s incoming alert", cep->cdid, cep->name);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming L12STAT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_l12stat_ind(msg_l12stat_ind_t *ml)
-{
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_l12stat(ml->controller, ml->layer, ml->state);
-#endif
-
- DBGL(DL_CNST, (log(LL_DBG, "msg_l12stat_ind: unit %d, layer %d, state %d",
- ml->controller, ml->layer, ml->state)));
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming TEIASG_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_teiasg_ind(msg_teiasg_ind_t *mt)
-{
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_tei(mt->controller, mt->tei);
-#endif
-
- DBGL(DL_CNST, (log(LL_DBG, "msg_teiasg_ind: unit %d, tei = %d",
- mt->controller, mt->tei)));
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming L12STAT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_pdeact_ind(msg_pdeact_ind_t *md)
-{
- int i;
- int ctrl = md->controller;
- cfg_entry_t *cep;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- {
- display_l12stat(ctrl, LAYER_ONE, LAYER_IDLE);
- display_l12stat(ctrl, LAYER_TWO, LAYER_IDLE);
- display_tei(ctrl, -1);
- }
-#endif
-
- DBGL(DL_CNST, (log(LL_DBG, "msg_pdeact_ind: unit %d, persistent deactivation", ctrl)));
-
- for(i=0; i < nentries; i++)
- {
- if((cfg_entry_tab[i].cdid != CDID_UNUSED) &&
- (cfg_entry_tab[i].isdncontrollerused == ctrl))
- {
- cep = &cfg_entry_tab[i];
-
- if(cep->cdid == CDID_RESERVED)
- {
- cep->cdid = CDID_UNUSED;
- continue;
- }
-
- cep->cdid = CDID_UNUSED;
-
- cep->last_release_time = time(NULL);
-
- SET_CAUSE_TYPE(cep->disc_cause, CAUSET_I4B);
- SET_CAUSE_VAL(cep->disc_cause, CAUSE_I4B_L1ERROR);
-
- if(cep->direction == DIR_OUT)
- {
- log(LL_CHD, "%05d %s outgoing call disconnected (local)",
- cep->cdid, cep->name);
- }
- else
- {
- log(LL_CHD, "%05d %s incoming call disconnected (local)",
- cep->cdid, cep->name);
- }
-
- log(LL_CHD, "%05d %s cause %s",
- cep->cdid, cep->name, print_i4b_cause(cep->disc_cause));
-
-#ifdef USE_CURSES
- if(do_fullscreen && (cep->connect_time > 0))
- display_disconnect(cep);
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_disconnect(cep);
-#endif
- if(cep->disconnectprog)
- exec_connect_prog(cep, cep->disconnectprog, 1);
-
- if(cep->connect_time > 0)
- {
- if(cep->direction == DIR_OUT)
- {
- log(LL_CHD, "%05d %s charging: %d units, %d seconds",
- cep->cdid, cep->name, cep->charge,
- (int)difftime(time(NULL), cep->connect_time));
- }
- else
- {
- log(LL_CHD, "%05d %s connected %d seconds",
- cep->cdid, cep->name,
- (int)difftime(time(NULL), cep->connect_time));
- }
-
- if((cep->inbytes != INVALID) && (cep->outbytes != INVALID))
- {
- if((cep->ioutbytes != cep->outbytes) ||
- (cep->iinbytes != cep->inbytes))
- {
- log(LL_CHD, "%05d %s accounting: in %d, out %d (in %d, out %d)",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes,
- cep->iinbytes, cep->ioutbytes);
- }
- else
- {
- log(LL_CHD, "%05d %s accounting: in %d, out %d",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes);
- }
- }
- }
-
- if(useacctfile && (cep->connect_time > 0))
- {
- int con_secs;
- char logdatetime[41];
- struct tm *tp;
-
- con_secs = difftime(time(NULL), cep->connect_time);
-
- tp = localtime(&cep->connect_time);
-
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
-
- if(cep->inbytes != INVALID && cep->outbytes != INVALID)
- {
- fprintf(acctfp, "%s - %s %s %d (%d) (%d/%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs,
- cep->inbytes, cep->outbytes);
- }
- else
- {
- fprintf(acctfp, "%s - %s %s %d (%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs);
- }
- }
-
- /* set the B-channel inactive */
-
- if((set_channel_idle(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- log(LL_ERR, "msg_pdeact_ind: set_channel_idle failed!");
-
- incr_free_channels(cep->isdncontrollerused);
-
- cep->connect_time = 0;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming NEGCOMP_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_negcomplete_ind(msg_negcomplete_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_negcomp_ind: cdid not found");
- return;
- }
-
- if(cep->connectprog)
- exec_connect_prog(cep, cep->connectprog, 0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming IFSTATE_CHANGED indication
- *---------------------------------------------------------------------------*/
-void
-msg_ifstatechg_ind(msg_ifstatechg_ind_t *mp)
-{
- cfg_entry_t *cep;
- char *device;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_negcomp_ind: cdid not found");
- return;
- }
-
- device = bdrivername(cep->usrdevicename);
- log(LL_DBG, "%s%d: switched to state %d\n", device, cep->usrdeviceunit, mp->state);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DISCONNECT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_disconnect_ind(msg_disconnect_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_disconnect_ind: cdid not found");
- return;
- }
-
- /* is this an aborted out-call prematurely called back? */
- if (cep->saved_call.cdid == mp->header.cdid)
- {
- DBGL(DL_CNST, (log(LL_DBG, "aborted outcall %05d disconnected",
- mp->header.cdid)));
- cep->saved_call.cdid = CDID_UNUSED;
-
- if((set_channel_idle(cep->saved_call.controller, cep->saved_call.channel)) == ERROR)
- log(LL_ERR, "msg_disconnect_ind: set_channel_idle failed!");
-
- incr_free_channels(cep->saved_call.controller);
- return;
- }
-
- cep->last_release_time = time(NULL);
- cep->disc_cause = mp->cause;
-
- if(cep->direction == DIR_OUT)
- {
- log(LL_CHD, "%05d %s outgoing call disconnected %s",
- cep->cdid, cep->name,
- cep->local_disconnect == DISCON_LOC ?
- "(local)" : "(remote)");
- }
- else
- {
- log(LL_CHD, "%05d %s incoming call disconnected %s",
- cep->cdid, cep->name,
- cep->local_disconnect == DISCON_LOC ?
- "(local)" : "(remote)");
- }
-
- log(LL_CHD, "%05d %s cause %s",
- cep->cdid, cep->name, print_i4b_cause(mp->cause));
-
-#ifdef USE_CURSES
- if(do_fullscreen && (cep->connect_time > 0))
- display_disconnect(cep);
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_disconnect(cep);
-#endif
-
- if(cep->disconnectprog)
- exec_connect_prog(cep, cep->disconnectprog, 1);
-
- if(cep->connect_time > 0)
- {
- if(cep->direction == DIR_OUT)
- {
- log(LL_CHD, "%05d %s charging: %d units, %d seconds",
- cep->cdid, cep->name, cep->charge,
- (int)difftime(time(NULL), cep->connect_time));
- }
- else
- {
- log(LL_CHD, "%05d %s connected %d seconds",
- cep->cdid, cep->name,
- (int)difftime(time(NULL), cep->connect_time));
- }
-
- if((cep->inbytes != INVALID) && (cep->outbytes != INVALID))
- {
- if((cep->ioutbytes != cep->outbytes) ||
- (cep->iinbytes != cep->inbytes))
- {
- log(LL_CHD, "%05d %s accounting: in %d, out %d (in %d, out %d)",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes,
- cep->iinbytes, cep->ioutbytes);
- }
- else
- {
- log(LL_CHD, "%05d %s accounting: in %d, out %d",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes);
- }
- }
- }
-
- if(useacctfile && (cep->connect_time > 0))
- {
- int con_secs;
- char logdatetime[41];
- struct tm *tp;
-
- con_secs = difftime(time(NULL), cep->connect_time);
-
- tp = localtime(&cep->connect_time);
-
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
-
- if(cep->inbytes != INVALID && cep->outbytes != INVALID)
- {
- fprintf(acctfp, "%s - %s %s %d (%d) (%d/%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs,
- cep->inbytes, cep->outbytes);
- }
- else
- {
- fprintf(acctfp, "%s - %s %s %d (%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs);
- }
- }
-
- /* set the B-channel inactive */
-
- if((set_channel_idle(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- log(LL_ERR, "msg_disconnect_ind: set_channel_idle failed!");
-
- incr_free_channels(cep->isdncontrollerused);
-
- cep->connect_time = 0;
-
- next_state(cep, EV_MDI);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DIALOUT message
- *---------------------------------------------------------------------------*/
-void
-msg_dialout(msg_dialout_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (log(LL_DBG, "msg_dialout: dial req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = find_by_device_for_dialout(mp->driver, mp->driver_unit)) == NULL)
- {
- DBGL(DL_DRVR, (log(LL_DBG, "msg_dialout: config entry reserved or no match")));
- return;
- }
-
- if(cep->inout == DIR_INONLY)
- {
- dialresponse(cep, DSTAT_INONLY);
- return;
- }
-
- if((cep->cdid = get_cdid()) == 0)
- {
- DBGL(DL_DRVR, (log(LL_DBG, "msg_dialout: get_cdid() returned 0!")));
- return;
- }
-
- cep->charge = 0;
- cep->last_charge = 0;
-
- next_state(cep, EV_MDO);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DRVRDISC_REQ message
- *---------------------------------------------------------------------------*/
-void
-msg_drvrdisc_req(msg_drvrdisc_req_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (log(LL_DBG, "msg_drvrdisc_req: req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = get_cep_by_driver(mp->driver, mp->driver_unit)) == NULL)
- {
- DBGL(DL_DRVR, (log(LL_DBG, "msg_drvrdisc_req: config entry not found")));
- return;
- }
- next_state(cep, EV_DRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming ACCOUNTING message
- *---------------------------------------------------------------------------*/
-void
-msg_accounting(msg_accounting_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = find_active_entry_by_driver(mp->driver, mp->driver_unit)) == NULL)
- {
- log(LL_WRN, "msg_accounting: no config entry found!");
- return;
- }
-
- cep->inbytes = mp->inbytes;
- cep->iinbytes = mp->iinbytes;
- cep->outbytes = mp->outbytes;
- cep->ioutbytes = mp->ioutbytes;
- cep->inbps = mp->inbps;
- cep->outbps = mp->outbps;
-
- if(mp->accttype == ACCT_DURING)
- {
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_acct(cep);
-#endif
-#ifdef NOTDEF
- else
- DBGL(DL_DRVR, (log(LL_DBG, "msg_accounting: %s%d, ioutb=%d, iinb=%d, outb=%d, inb=%d, outbps=%d, inbps=%d",
- bdrivername(mp->driver), mp->driver_unit,
- mp->ioutbytes, mp->iinbytes,
- mp->outbytes, mp->inbytes,
- mp->outbps, mp->inbps)));
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming CHARGING message
- *---------------------------------------------------------------------------*/
-void
-msg_charging_ind(msg_charging_ind_t *mp)
-{
- static char *cttab[] = {
- "invalid",
- "AOCD",
- "AOCE",
- "estimated" };
-
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_charging_ind: cdid not found");
- return;
- }
-
- if(mp->units_type < CHARGE_INVALID || mp->units_type > CHARGE_CALC)
- {
- log(LL_ERR, "msg_charging: units_type %d out of range!", mp->units_type);
- do_exit(1);
- }
-
- DBGL(DL_DRVR, (log(LL_DBG, "msg_charging: %d unit(s) (%s)",
- mp->units, cttab[mp->units_type])));
-
- switch(mp->units_type)
- {
- case CHARGE_AOCD:
- cep->charge = mp->units;
-
- if((cep->unitlengthsrc == ULSRC_DYN) &&
- (cep->charge != cep->last_charge))
- {
- cep->last_charge = cep->charge;
- handle_charge(cep);
- }
- break;
-
- case CHARGE_AOCE:
- cep->charge = mp->units;
- break;
-
- case CHARGE_CALC:
- cep->charge = mp->units;
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_ccharge(cep, mp->units);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_charge(cep, mp->units, 1);
-#endif
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming IDLE_TIMEOUT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_idle_timeout_ind(msg_idle_timeout_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- log(LL_WRN, "msg_idle_timeout_ind: cdid not found!");
- return;
- }
-
- cep->local_disconnect = DISCON_LOC;
-
- DBGL(DL_DRVR, (log(LL_DBG, "msg_idle_timeout_ind: idletimeout, kernel sent disconnect!")));
-
- check_and_kill(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * get a cdid from kernel
- *---------------------------------------------------------------------------*/
-int
-get_cdid(void)
-{
- msg_cdid_req_t mcr;
-
- mcr.cdid = 0;
-
- if((ioctl(isdnfd, I4B_CDID_REQ, &mcr)) < 0)
- {
- log(LL_ERR, "get_cdid: ioctl I4B_CDID_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- return(mcr.cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "connect request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_connect_req(cfg_entry_t *cep)
-{
- msg_connect_req_t mcr;
- int ret;
-
- cep->local_disconnect = DISCON_REM;
-
- cep->unitlength = get_current_rate(cep, 1);
-
- mcr.cdid = cep->cdid;
-
- mcr.controller = cep->isdncontrollerused;
- mcr.channel = cep->isdnchannelused;
- mcr.txdelay = cep->isdntxdelout;
-
- mcr.bprot = cep->b1protocol;
-
- mcr.driver = cep->usrdevicename;
- mcr.driver_unit = cep->usrdeviceunit;
-
- mcr.unitlen_time = cep->unitlength;
- mcr.idle_time = cep->idle_time_out;
- mcr.earlyhup_time = cep->earlyhangup;
-
- if(cep->unitlengthsrc == ULSRC_DYN)
- mcr.unitlen_method = ULEN_METHOD_DYNAMIC;
- else
- mcr.unitlen_method = ULEN_METHOD_STATIC;
-
- strcpy(mcr.dst_telno, cep->remote_phone_dialout);
- strcpy(mcr.src_telno, cep->local_phone_dialout);
-
- cep->last_dial_time = time(NULL);
- cep->direction = DIR_OUT;
-
- DBGL(DL_CNST, (log(LL_DBG, "sendm_connect_req: ctrl = %d, chan = %d", cep->isdncontrollerused, cep->isdnchannelused)));
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_REQ, &mcr)) < 0)
- {
- log(LL_ERR, "sendm_connect_req: ioctl I4B_CONNECT_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- decr_free_channels(cep->isdncontrollerused);
-
- log(LL_CHD, "%05d %s dialing out from %s to %s",
- cep->cdid,
- cep->name,
- aliasing ? get_alias(cep->local_phone_dialout) : cep->local_phone_dialout,
- aliasing ? get_alias(cep->remote_phone_dialout) : cep->remote_phone_dialout);
-
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "connect response" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_connect_resp(cfg_entry_t *cep, int cdid, int response, int cause)
-{
- msg_connect_resp_t mcr;
- int ret;
-
- mcr.cdid = cdid;
-
- mcr.response = response;
-
- if(response == SETUP_RESP_REJECT)
- {
- mcr.cause = cause;
- }
- else if(response == SETUP_RESP_ACCEPT)
- {
- cep->direction = DIR_IN;
-
- mcr.txdelay = cep->isdntxdelin;
-
- mcr.bprot = cep->b1protocol;
-
- mcr.driver = cep->usrdevicename;
- mcr.driver_unit = cep->usrdeviceunit;
-
- mcr.max_idle_time = cep->idle_time_in;
- }
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &mcr)) < 0)
- {
- log(LL_ERR, "sendm_connect_resp: ioctl I4B_CONNECT_RESP failed: %s", strerror(errno));
- do_exit(1);
- }
-
- DBGL(DL_DRVR, (log(LL_DBG, "sendm_connect_resp: sent CONNECT_RESP")));
-
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "disconnect request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_disconnect_req(cfg_entry_t *cep, int cause)
-{
- msg_discon_req_t mcr;
- int ret;
-
- mcr.cdid = cep->cdid;
-
- mcr.cause = cause;
-
- cep->local_disconnect = DISCON_LOC;
-
- if((ret = ioctl(isdnfd, I4B_DISCONNECT_REQ, &mcr)) < 0)
- {
- log(LL_ERR, "sendm_disconnect_req: ioctl I4B_DISCONNECT_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
- else
- {
- DBGL(DL_DRVR, (log(LL_DBG, "sendm_disconnect_req: sent DISCONNECT_REQ")));
- }
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "alert request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_alert_req(cfg_entry_t *cep)
-{
- msg_alert_req_t mar;
- int ret;
-
- mar.cdid = cep->cdid;
-
- if((ret = ioctl(isdnfd, I4B_ALERT_REQ, &mar)) < 0)
- {
- log(LL_ERR, "sendm_alert_req: ioctl I4B_ALERT_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
- else
- {
- DBGL(DL_DRVR, (log(LL_DBG, "sendm_alert_req: sent ALERT_REQ")));
- }
- return(ret);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/pathnames.h b/usr.sbin/i4b/isdnd/pathnames.h
deleted file mode 100644
index 75afec945463..000000000000
--- a/usr.sbin/i4b/isdnd/pathnames.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - location of files
- * ------------------------------
- *
- * $Id: pathnames.h,v 1.5 1998/12/05 18:03:30 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:11:17 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _PATHNAMES_H_
-#define _PATHNAMES_H_
-
-#define I4BDEVICE "/dev/i4b"
-
-#define ETCPATH "/etc/isdn"
-#define CONFIG_FILE_DEF "/etc/isdn/isdnd.rc"
-#define RATES_FILE_DEF "/etc/isdn/isdnd.rates"
-
-#define LIBDIR "/usr/local/lib/isdn"
-
-#define LOG_FILE_DEF "/var/log/isdnd.log"
-#define ACCT_FILE_DEF "/var/log/isdnd.acct"
-
-#define PIDFILE "/var/run/isdnd.pid"
-
-#endif /* _PATHNAMES_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/pcause.c b/usr.sbin/i4b/isdnd/pcause.c
deleted file mode 100644
index c782f2c7181b..000000000000
--- a/usr.sbin/i4b/isdnd/pcause.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause.c,v 1.9 1998/12/05 18:03:31 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:11:31 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static char *cause_i4b_tab[CAUSE_I4B_MAX+1];
-static char *cause_q850_tab[CAUSE_Q850_MAX];
-
-char *
-print_i4b_cause(cause_t code)
-{
- static char error_message[128];
-
- sprintf(error_message, "%d: ", GET_CAUSE_VAL(code));
-
- switch(GET_CAUSE_TYPE(code))
- {
- case CAUSET_Q850:
- strcat(error_message, cause_q850_tab[GET_CAUSE_VAL(code)]);
- strcat(error_message, " (Q.850)");
- break;
-
- case CAUSET_I4B:
- if((GET_CAUSE_VAL(code) < CAUSE_I4B_NORMAL) ||
- (GET_CAUSE_VAL(code) >= CAUSE_I4B_MAX))
- {
- SET_CAUSE_VAL(code, CAUSE_I4B_MAX);
- }
- strcat(error_message, cause_i4b_tab[GET_CAUSE_VAL(code)]);
- strcat(error_message, " (I4B)");
- break;
-
- default:
- strcat(error_message, "ERROR: unknown cause type!");
- break;
- }
- return(error_message);
-}
-
-static char *cause_i4b_tab[CAUSE_I4B_MAX+1] = {
- "normal call clearing",
- "user busy",
- "channel not available",
- "incompatible source or destination",
- "call rejected",
- "destination out of order",
- "temporary failure",
- "layer 1 error / persistent deactivation",
- "ERROR, invalid I4B cause value!"
-};
-
-static char *cause_q850_tab[CAUSE_Q850_MAX] = {
- "Normal D-channel shutdown",
- "Unallocated (unassigned) number",
- "No route to specified transit network (national use)",
- "No route to destination",
- "Send special information tone",
- "Misdialled trunk prefix (national use)",
- "Channel unacceptable",
- "Call awarded and being delivered in an established channel",
- "Preemption",
- "Preemption - circuit reserved for reuse",
-
-/*10*/ "cause code 10: error, unassigned in Q.850 (03/93)",
- "cause code 11: error, unassigned in Q.850 (03/93)",
- "cause code 12: error, unassigned in Q.850 (03/93)",
- "cause code 13: error, unassigned in Q.850 (03/93)",
- "cause code 14: error, unassigned in Q.850 (03/93)",
- "cause code 15: error, unassigned in Q.850 (03/93)",
- "Normal call clearing",
- "User busy",
- "No user responding",
- "No answer from user (user alerted)",
-
-/*20*/ "Subscriber absent",
- "Call rejected",
- "Number changed",
- "cause code 23: error, unassigned in Q.850 (03/93)",
- "cause code 24: error, unassigned in Q.850 (03/93)",
- "cause code 25: error, unassigned in Q.850 (03/93)",
- "Non-selected user clearing",
- "Destination out of order",
- "Invalid number format",
- "Facility rejected",
-
-/*30*/ "Response to STATUS ENQUIRY",
- "Normal, unspecified",
- "cause code 32: error, unassigned in Q.850 (03/93)",
- "cause code 33: error, unassigned in Q.850 (03/93)",
- "No circuit / channel available",
- "cause code 35: error, unassigned in Q.850 (03/93)",
- "cause code 36: error, unassigned in Q.850 (03/93)",
- "cause code 37: error, unassigned in Q.850 (03/93)",
- "Network out of order",
- "Permanent frame mode connection out of service",
-
-/*40*/ "Permanent frame mode connection operational",
- "Temporary failure",
- "Switching equipment congestion",
- "Access information discarded",
- "Requested circuit/channel not available",
- "cause code 45: error, unassigned in Q.850 (03/93)",
- "Precedence call blocked",
- "Resources unavailable, unspecified",
- "cause code 48: error, unassigned in Q.850 (03/93)",
- "Quality of service unavailable",
-
-/*50*/ "Requested facility not subscribed",
- "cause code 51: error, unassigned in Q.850 (03/93)",
- "cause code 52: error, unassigned in Q.850 (03/93)",
- "Outgoing calls barred within CUG",
- "cause code 54: error, unassigned in Q.850 (03/93)",
- "Incoming calls barred within CUG",
- "cause code 56: error, unassigned in Q.850 (03/93)",
- "Bearer capability not authorized",
- "Bearer capability not presently available",
- "cause code 59: error, unassigned in Q.850 (03/93)",
-
-/*60*/ "cause code 60: error, unassigned in Q.850 (03/93)",
- "cause code 61: error, unassigned in Q.850 (03/93)",
- "Inconsistenciy in designated outg. access info and subscriber class",
- "Service or option not available, unspecified",
- "cause code 64: error, unassigned in Q.850 (03/93)",
- "Bearer capability not implemented",
- "Channel type not implemented",
- "cause code 67: error, unassigned in Q.850 (03/93)",
- "cause code 68: error, unassigned in Q.850 (03/93)",
- "Requested facility not implemented",
-
-/*70*/ "Only restricted digital information bearer capability is available",
- "cause code 71: error, unassigned in Q.850 (03/93)",
- "cause code 72: error, unassigned in Q.850 (03/93)",
- "cause code 73: error, unassigned in Q.850 (03/93)",
- "cause code 74: error, unassigned in Q.850 (03/93)",
- "cause code 75: error, unassigned in Q.850 (03/93)",
- "cause code 76: error, unassigned in Q.850 (03/93)",
- "cause code 77: error, unassigned in Q.850 (03/93)",
- "cause code 78: error, unassigned in Q.850 (03/93)",
- "Service or option not implemented, unspecified",
-
-/*80*/ "cause code 80: error, unassigned in Q.850 (03/93)",
- "Invalid call reference value",
- "Identified channel does not exist",
- "A suspended call exists, but this call identity does not",
- "Call identity in use",
- "No call suspended",
- "Call having the requested call identity has been cleared",
- "User not member of CUG",
- "Incompatible destination",
- "cause code 89: error, unassigned in Q.850 (03/93)",
-
-/*90*/ "Non-existent CUG",
- "Invalid transit network selection",
- "cause code 92: error, unassigned in Q.850 (03/93)",
- "cause code 93: error, unassigned in Q.850 (03/93)",
- "cause code 94: error, unassigned in Q.850 (03/93)",
- "Invalid message, unspecified",
- "Mandatory information element is missing",
- "Message type non-existent or not implemented",
- "Message not compatible with call state or message type non-existent or not implemented",
- "Information element/parameter non-existent or not implemented",
-
-/*100*/ "Invalid information element contents",
- "Message not compatible with call state",
- "Recovery on timer expiry",
- "Parameter non-existent or not implemented, passed on",
- "cause code 104: error, unassigned in Q.850 (03/93)",
- "cause code 105: error, unassigned in Q.850 (03/93)",
- "cause code 106: error, unassigned in Q.850 (03/93)",
- "cause code 107: error, unassigned in Q.850 (03/93)",
- "cause code 108: error, unassigned in Q.850 (03/93)",
- "cause code 109: error, unassigned in Q.850 (03/93)",
-
-/*110*/ "Message with unrecognized parameter, discarded",
- "Protocol error, unspecified",
- "cause code 112: error, unassigned in Q.850 (03/93)",
- "cause code 113: error, unassigned in Q.850 (03/93)",
- "cause code 114: error, unassigned in Q.850 (03/93)",
- "cause code 115: error, unassigned in Q.850 (03/93)",
- "cause code 116: error, unassigned in Q.850 (03/93)",
- "cause code 117: error, unassigned in Q.850 (03/93)",
- "cause code 118: error, unassigned in Q.850 (03/93)",
- "cause code 119: error, unassigned in Q.850 (03/93)",
-
-/*120*/ "cause code 120: error, unassigned in Q.850 (03/93)",
- "cause code 121: error, unassigned in Q.850 (03/93)",
- "cause code 122: error, unassigned in Q.850 (03/93)",
- "cause code 123: error, unassigned in Q.850 (03/93)",
- "cause code 124: error, unassigned in Q.850 (03/93)",
- "cause code 125: error, unassigned in Q.850 (03/93)",
- "cause code 126: error, unassigned in Q.850 (03/93)",
- "Interworking, unspecified"
-};
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/process.c b/usr.sbin/i4b/isdnd/process.c
deleted file mode 100644
index 47c9eda550a1..000000000000
--- a/usr.sbin/i4b/isdnd/process.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - process handling routines
- * --------------------------------------
- *
- * $Id: process.c,v 1.6 1998/12/05 18:03:33 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:11:42 1998]
- *
- * -hm debugging processhandling
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * check if another instance of us is already running
- *---------------------------------------------------------------------------*/
-void
-check_pid(void)
-{
- FILE *fp;
-
- /* check if another lock-file already exists */
-
- if((fp = fopen(PIDFILE, "r")) != NULL)
- {
- /* lockfile found, check */
-
- int oldpid;
-
- /* read pid from file */
-
- if((fscanf(fp, "%d", &oldpid)) != 1)
- {
- log(LL_ERR, "ERROR, reading pid from lockfile failed, terminating!");
- exit(1);
- }
-
- /* check if process got from file is still alive */
-
- if((kill(oldpid, 0)) != 0)
- {
- /* process does not exist */
-
- /* close file */
-
- fclose(fp);
-
- DBGL(DL_PROC, (log(LL_DBG, "removing old lock-file %s", PIDFILE)));
-
- /* remove file */
-
- unlink(PIDFILE);
- }
- else
- {
- /* process is still alive */
-
- log(LL_ERR, "ERROR, another daemon is already running, pid = %d, terminating!", oldpid);
- exit(1);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * establish and init process lock file
- *---------------------------------------------------------------------------*/
-void
-write_pid(void)
-{
- FILE *fp;
-
- /* write my pid into lock-file */
-
- if((fp = fopen(PIDFILE, "w")) == NULL)
- {
- log(LL_ERR, "ERROR, can't open lockfile for writing, terminating");
- do_exit(1);
- }
-
- if((fprintf(fp, "%d", (int)getpid())) == EOF)
- {
- log(LL_ERR, "ERROR, can't write pid to lockfile, terminating");
- do_exit(1);
- }
-
- fsync(fileno(fp));
-
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * become a daemon
- *---------------------------------------------------------------------------*/
-void
-daemonize(void)
-{
- int fd;
-
- switch (fork())
- {
- case -1: /* error */
- log(LL_ERR, "ERROR, daemonize/fork: %s", strerror(errno));
- exit(1);
- case 0: /* child */
- break;
- default: /* parent */
- exit(0);
- }
-
- /* new session / no control tty */
-
- if(setsid() == -1)
- {
- log(LL_ERR, "ERROR, setsid returns: %s", strerror(errno));
- exit(1);
- }
-
- /* go away from mounted dir */
-
- chdir("/");
-
- /* move i/o to another device ? */
-
- if(do_fullscreen && do_rdev)
- {
- char *tp;
-
- if((fd = open(rdev, O_RDWR, 0)) != -1)
- {
- if(!isatty(fd))
- {
- log(LL_ERR, "ERROR, device %s is not a tty!", rdev);
- exit(1);
- }
- if((dup2(fd, STDIN_FILENO)) == -1)
- {
- log(LL_ERR, "ERROR, dup2 stdin: %s", strerror(errno));
- exit(1);
- }
- if((dup2(fd, STDOUT_FILENO)) == -1)
- {
- log(LL_ERR, "ERROR, dup2 stdout: %s", strerror(errno));
- exit(1);
- }
- if((dup2(fd, STDERR_FILENO)) == -1)
- {
- log(LL_ERR, "ERROR, dup2 stderr: %s", strerror(errno));
- exit(1);
- }
- }
- else
- {
- log(LL_ERR, "ERROR, cannot open redirected device: %s", strerror(errno));
- exit(1);
- }
-
- if(fd > 2)
- {
- if((close(fd)) == -1)
- {
- log(LL_ERR, "ERROR, close in daemonize: %s", strerror(errno));
- exit(1);
- }
- }
-
- /* curses output && fork NEEDS controlling tty */
-
- if((ioctl(STDIN_FILENO, TIOCSCTTY, (char *)NULL)) < 0)
- {
- log(LL_ERR, "ERROR, cannot setup tty as controlling terminal: %s", strerror(errno));
- exit(1);
- }
-
- /* in case there is no environment ... */
-
- if(((tp = getenv("TERM")) == NULL) || (*tp == '\0'))
- {
- if(do_ttytype == 0)
- {
- log(LL_ERR, "ERROR, no environment variable TERM found and -t not specified!");
- exit(1);
- }
-
- if((setenv("TERM", ttype, 1)) != 0)
- {
- log(LL_ERR, "ERROR, setenv TERM=%s failed: %s", ttype, strerror(errno));
- exit(1);
- }
- }
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rates.c b/usr.sbin/i4b/isdnd/rates.c
deleted file mode 100644
index c1b11636a5c7..000000000000
--- a/usr.sbin/i4b/isdnd/rates.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Copyright (c) 1997 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - charging rates description file handling
- * -----------------------------------------------------
- *
- * $Id: rates.c,v 1.7 1998/12/05 18:03:34 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:11:55 1998]
- *
- *---------------------------------------------------------------------------*/
-
-static char error[256];
-
-#ifdef PARSE_DEBUG_MAIN
-
-#include <stdio.h>
-
-#define MAIN
-
-#define ERROR (-1)
-
-int main()
-{
- int ret;
- ret = readrates("/etc/isdn/isdnd.rates");
- if(ret == ERROR)
- fprintf(stderr, "readrates returns [%d], [%s]\n", ret, error);
- else
- fprintf(stderr, "readrates returns [%d]\n", ret);
- return(ret);
-}
-
-#endif
-
-#include "isdnd.h"
-
-static int getrate(cfg_entry_t *cep);
-
-/*---------------------------------------------------------------------------*
- * parse rates file
- *---------------------------------------------------------------------------*/
-int
-readrates(char *filename)
-{
- char buffer[1024];
- register char *bp;
- struct rates *rt, *ort;
- int rateindx;
- int indx;
- int line = 0;
- FILE *fp;
- int first;
-#if DEBUG
- int i, j;
-#endif
-
- indx = 0;
- rt = ort = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- {
- sprintf(error, "error open %s: %s", filename, sys_errlist[errno]);
- rate_error = error;
- return(WARNING);
- }
-
- while((fgets(buffer, MAXPATHLEN, fp)) != NULL)
- {
- line++;
-
-/* comments */
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- bp = &buffer[0];
-
- /* rate type */
-
- if (*bp == 'r' && *(bp+1) == 'a' && isdigit(*(bp+2)))
- {
- rateindx = *(bp+2) - '0';
- bp += 3;
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
- }
- else
- {
- sprintf(error, "rates: invalid rate type %c%c%c in line %d", *bp, *(bp+1), *(bp+2), line);
- goto rate_error;
- }
- if (rateindx >= NRATES)
- {
- sprintf(error, "rates: invalid rate index %d in line %d", rateindx, line);
- goto rate_error;
- }
-
- /* day */
-
- if(isdigit(*bp) && *bp >= '0' && *bp <= '6')
- {
- indx = *bp - '0';
-
- DBGL(DL_RATES, (log(LL_DBG, "rates: index = %d", indx)));
- }
- else
- {
- sprintf(error, "rates: invalid day digit %c in line %d", *bp, line);
- goto rate_error;
- }
-
- if(rates[rateindx][indx] == NULL)
- {
- rt = (struct rates *)malloc(sizeof (struct rates));
- if (rt == NULL)
- {
- sprintf(error, "rates: cannot malloc space for rate structure");
- goto rate_error;
- }
- rt->next = NULL;
- rates[rateindx][indx] = rt;
- }
-
- bp++;
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
-
- /* now loop to get the rates entries */
-
- first = 1;
-
- while(*bp && isdigit(*bp))
- {
- if(first)
- {
- first = 0;
- }
- else
- {
- ort = rt;
-
- rt = (struct rates *)malloc(sizeof (struct rates));
- if (rt == NULL)
- {
- sprintf(error, "rates: cannot malloc space2 for rate structure");
- goto rate_error;
- }
- ort->next = rt;
- rt->next = NULL;
- }
-
- /* start hour */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- rt->start_hr = atoi(bp);
- bp += 2;
- }
- else
- {
- sprintf(error, "rates: start_hr error in line %d", line);
- goto rate_error;
- }
-
- /* point */
-
- if(*bp == '.')
- {
- bp++;
- }
- else
- {
- sprintf(error, "rates: no '.' after start_hr in line %d", line);
- goto rate_error;
- }
-
- /* start minute */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- rt->start_min = atoi(bp);
- bp += 2;
- }
- else
- {
- sprintf(error, "rates: start_min error in line %d", line);
- goto rate_error;
- }
-
- /* minus */
-
- if(*bp == '-')
- {
- bp++;
- }
- else
- {
- sprintf(error, "rates: no '-' after start_min in line %d", line);
- goto rate_error;
- }
-
- /* end hour */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- rt->end_hr = atoi(bp);
- bp += 2;
- }
- else
- {
- sprintf(error, "rates: end_hr error in line %d", line);
- goto rate_error;
- }
-
- /* point */
-
- if(*bp == '.')
- {
- bp++;
- }
- else
- {
- sprintf(error, "rates: no '.' after end_hr in line %d", line);
- goto rate_error;
- }
-
- /* end minute */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- rt->end_min = atoi(bp);
- bp += 2;
- }
- else
- {
- sprintf(error, "rates: end_min error in line %d", line);
- goto rate_error;
- }
-
- /* colon */
-
- if(*bp == ':')
- {
- bp++;
- }
- else
- {
- sprintf(error, "rates: no ':' after end_min in line %d", line);
- goto rate_error;
- }
-
- /* time */
-
- if(isdigit(*bp))
- {
- rt->rate = atoi(bp);
- while(!isspace(*bp))
- bp++;
- }
- else
- {
- sprintf(error, "rates: first rate digit error in line %d", line);
- goto rate_error;
- }
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
- }
- }
-
-#if DEBUG
- if(debug_flags & DL_RATES)
- {
- for (j = 0; j < NRATES; j++)
- {
- for (i = 0; i < NDAYS; i++)
- {
- if (rates [j][i] != NULL)
- {
- rt = rates [j][i];
- for (; rt; rt = rt->next)
- {
- log(LL_DBG, "rates: index %d day %d = %d.%d-%d.%d:%d",
- j, i, rt->start_hr, rt->start_min,
- rt->end_hr,rt->end_min,rt->rate);
- }
- }
- else
- {
- log(LL_DBG, "rates: NO entry for day %d !!\n", i);
- }
- }
- }
- }
-#endif
- fclose(fp);
- return(GOOD);
-
-rate_error:
- fclose(fp);
- rate_error = error;
- return(ERROR);
-}
-
-#ifndef PARSE_DEBUG_MAIN
-
-/*---------------------------------------------------------------------------*
- * get unit length time from configured source
- *---------------------------------------------------------------------------*/
-int
-get_current_rate(cfg_entry_t *cep, int logit)
-{
- int rt;
-
- switch(cep->unitlengthsrc)
- {
- case ULSRC_CMDL: /* specified on commandline */
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (cmdl)",
- cep->cdid, cep->name, unit_length);
- return(unit_length);
- break;
-
- case ULSRC_CONF: /* get it from config file */
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (conf)",
- cep->cdid, cep->name, cep->unitlength);
- return(cep->unitlength);
-
- case ULSRC_RATE: /* get it dynamic from ratesfile*/
- if(!got_rate) /* got valid rates struct ?? */
- {
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (no ratefile)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
- return(UNITLENGTH_DEFAULT);
- }
- if((cep->ratetype >= NRATES) ||
- (cep->ratetype == INVALID_RATE))
- {
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (rate out of range)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
- return(UNITLENGTH_DEFAULT);
- }
-
- if((rt = getrate(cep)) != -1)
- {
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (rate)",
- cep->cdid, cep->name, rt);
- return(rt);
- }
-
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (ratescan fail)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
-
- case ULSRC_DYN: /* dynamically calculated from AOC */
- if((rt = getrate(cep)) != -1)
- {
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (aocd, rate)",
- cep->cdid, cep->name, rt);
- return(rt);
- }
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (aocd, default)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
-
- default:
- if(logit)
- log(LL_CHD, "%05d %s rate %d sec/unit (unitlen unknown)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * get the currently active rate
- *---------------------------------------------------------------------------*/
-static int
-getrate(cfg_entry_t *cep)
-{
- struct tm *ptr;
- time_t now;
- register struct rates *hd;
-
- if((!got_rate) ||
- (cep->ratetype >= NRATES) ||
- (cep->ratetype == INVALID_RATE))
- {
- return(-1);
- }
-
- time(&now); /* get current time */
-
- ptr = localtime(&now);
-
- /* walk thru the rates for weekday until rate for current time found */
-
- for (hd = rates[cep->ratetype][ptr->tm_wday]; hd; hd = hd->next)
- {
- /* current time within window ? */
- if((hd->start_hr <= ptr->tm_hour) &&
- (hd->end_hr > ptr->tm_hour))
- {
- DBGL(DL_RATES, (log(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d, end=%d, current=%d)",
- hd->rate,
- ptr->tm_wday,
- hd->start_hr,
- hd->end_hr,
- ptr->tm_hour)));
-
- return (hd->rate);
- }
- }
- return(-1);
-}
-
-#endif /* PARSE_DEBUG_MAIN */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rc_config.c b/usr.sbin/i4b/isdnd/rc_config.c
deleted file mode 100644
index 884edfa10fe2..000000000000
--- a/usr.sbin/i4b/isdnd/rc_config.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - config file processing
- * -----------------------------------
- *
- * $Id: rc_config.c,v 1.35 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Dec 14 13:41:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "isdnd.h"
-#include "y.tab.h"
-
-#include "monitor.h"
-#include "vararray.h"
-
-extern int entrycount;
-extern int lineno;
-extern char *yytext;
-
-extern FILE *yyin;
-extern int yyparse();
-
-static void set_config_defaults(void);
-static void check_config(void);
-static void print_config(void);
-
-static int nregexpr = 0;
-static int nregprog = 0;
-
-/*---------------------------------------------------------------------------*
- * called from main to read and process config file
- *---------------------------------------------------------------------------*/
-void
-configure(char *filename, int reread)
-{
- extern void reset_scanner(FILE *inputfile);
-
- set_config_defaults();
-
- yyin = fopen(filename, "r");
-
- if(reread)
- {
- reset_scanner(yyin);
- }
-
- if (yyin == NULL)
- {
- log(LL_ERR, "cannot fopen file [%s]", filename);
- exit(1);
- }
-
- yyparse();
-
- monitor_fixup_rights();
-
- check_config(); /* validation and consistency check */
-
- fclose(yyin);
-
- if(do_print)
- {
- if(config_error_flag)
- {
- log(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag);
- exit(1);
- }
- print_config();
- do_exit(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * yacc error routine
- *---------------------------------------------------------------------------*/
-void
-yyerror(const char *msg)
-{
- log(LL_ERR, "configuration error: %s at line %d, token \"%s\"", msg, lineno+1, yytext);
- config_error_flag++;
-}
-
-/*---------------------------------------------------------------------------*
- * fill all config entries with default values
- *---------------------------------------------------------------------------*/
-static void
-set_config_defaults(void)
-{
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i;
-
- /* system section cleanup */
-
- nregprog = nregexpr = 0;
-
- rt_prio = RTPRIO_NOTUSED;
-
- /* clean regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if(rarr[i].re_expr)
- free(rarr[i].re_expr);
- rarr[i].re_expr = NULL;
-
- if(rarr[i].re_prog)
- free(rarr[i].re_prog);
- rarr[i].re_prog = NULL;
-
- rarr[i].re_flg = 0;
- }
-
- /* entry section cleanup */
-
- for(i=0; i < CFG_ENTRY_MAX; i++, cep++)
- {
- bzero(cep, sizeof(cfg_entry_t));
-
- /* ====== filled in at startup configuration, then static */
-
- sprintf(cep->name, "ENTRY%d", i);
-
- cep->isdncontroller = INVALID;
- cep->isdnchannel = CHAN_ANY;
-
- cep->usrdevicename = INVALID;
- cep->usrdeviceunit = INVALID;
-
- cep->remote_numbers_handling = RNH_LAST;
-
- cep->dialin_reaction = REACT_IGNORE;
-
- cep->b1protocol = BPROT_NONE;
-
- cep->unitlength = UNITLENGTH_DEFAULT;
-
- cep->earlyhangup = EARLYHANGUP_DEFAULT;
-
- cep->ratetype = INVALID_RATE;
-
- cep->unitlengthsrc = ULSRC_NONE;
-
- cep->answerprog = ANSWERPROG_DEF;
-
- cep->callbackwait = CALLBACKWAIT_MIN;
-
- cep->calledbackwait = CALLEDBACKWAIT_MIN;
-
- cep->dialretries = DIALRETRIES_DEF;
-
- cep->recoverytime = RECOVERYTIME_MIN;
-
- cep->dialouttype = DIALOUT_NORMAL;
-
- cep->inout = DIR_INOUT;
-
- /* ======== filled in after start, then dynamic */
-
- cep->cdid = CDID_UNUSED;
-
- cep->state = ST_IDLE;
-
- cep->aoc_valid = AOC_INVALID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * extract values from config and fill table
- *---------------------------------------------------------------------------*/
-void
-cfg_setval(int keyword)
-{
- int i;
-
- switch(keyword)
- {
- case ACCTALL:
- acct_all = yylval.booln;
- log(LL_DBG, "system: acctall = %d", yylval.booln);
- break;
-
- case ACCTFILE:
- strcpy(acctfile, yylval.str);
- log(LL_DBG, "system: acctfile = %s", yylval.str);
- break;
-
- case ALERT:
- if(yylval.num < MINALERT)
- {
- yylval.num = MINALERT;
- log(LL_DBG, "entry %d: alert < %d, min = %d", entrycount, MINALERT, yylval.num);
- }
- else if(yylval.num > MAXALERT)
- {
- yylval.num = MAXALERT;
- log(LL_DBG, "entry %d: alert > %d, min = %d", entrycount, MAXALERT, yylval.num);
- }
-
- log(LL_DBG, "entry %d: alert = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].alert = yylval.num;
- break;
-
- case ALIASING:
- log(LL_DBG, "system: aliasing = %d", yylval.booln);
- aliasing = yylval.booln;
- break;
-
- case ALIASFNAME:
- strcpy(aliasfile, yylval.str);
- log(LL_DBG, "system: aliasfile = %s", yylval.str);
- break;
-
- case ANSWERPROG:
- if((cfg_entry_tab[entrycount].answerprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- log(LL_ERR, "entry %d: answerstring, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].answerprog, yylval.str);
- log(LL_DBG, "entry %d: answerprog = %s", entrycount, yylval.str);
- break;
-
- case B1PROTOCOL:
- log(LL_DBG, "entry %d: b1protocol = %s", entrycount, yylval.str);
- if(!(strcmp(yylval.str, "raw")))
- cfg_entry_tab[entrycount].b1protocol = BPROT_NONE;
- else if(!(strcmp(yylval.str, "hdlc")))
- cfg_entry_tab[entrycount].b1protocol = BPROT_RHDLC;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"b1protocol\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case CALLBACKWAIT:
- if(yylval.num < CALLBACKWAIT_MIN)
- {
- yylval.num = CALLBACKWAIT_MIN;
- log(LL_DBG, "entry %d: callbackwait < %d, min = %d", entrycount, CALLBACKWAIT_MIN, yylval.num);
- }
-
- log(LL_DBG, "entry %d: callbackwait = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].callbackwait = yylval.num;
- break;
-
- case CALLEDBACKWAIT:
- if(yylval.num < CALLEDBACKWAIT_MIN)
- {
- yylval.num = CALLEDBACKWAIT_MIN;
- log(LL_DBG, "entry %d: calledbackwait < %d, min = %d", entrycount, CALLEDBACKWAIT_MIN, yylval.num);
- }
-
- log(LL_DBG, "entry %d: calledbackwait = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].calledbackwait = yylval.num;
- break;
-
- case CONNECTPROG:
- if((cfg_entry_tab[entrycount].connectprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- log(LL_ERR, "entry %d: connectprog, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].connectprog, yylval.str);
- log(LL_DBG, "entry %d: connectprog = %s", entrycount, yylval.str);
- break;
-
- case DIALOUTTYPE:
- log(LL_DBG, "entry %d: dialouttype = %s", entrycount, yylval.str);
- if(!(strcmp(yylval.str, "normal")))
- cfg_entry_tab[entrycount].dialouttype = DIALOUT_NORMAL;
- else if(!(strcmp(yylval.str, "calledback")))
- cfg_entry_tab[entrycount].dialouttype = DIALOUT_CALLEDBACK;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"dialout-type\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case DIALRETRIES:
- log(LL_DBG, "entry %d: dialretries = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].dialretries = yylval.num;
- break;
-
- case DIALRANDINCR:
- log(LL_DBG, "entry %d: dialrandincr = %d", entrycount, yylval.booln);
- cfg_entry_tab[entrycount].dialrandincr = yylval.booln;
- break;
-
- case DIRECTION:
- log(LL_DBG, "entry %d: direction = %s", entrycount, yylval.str);
-
- if(!(strcmp(yylval.str, "inout")))
- cfg_entry_tab[entrycount].inout = DIR_INOUT;
- else if(!(strcmp(yylval.str, "in")))
- cfg_entry_tab[entrycount].inout = DIR_INONLY;
- else if(!(strcmp(yylval.str, "out")))
- cfg_entry_tab[entrycount].inout = DIR_OUTONLY;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"direction\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case DISCONNECTPROG:
- if((cfg_entry_tab[entrycount].disconnectprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- log(LL_ERR, "entry %d: disconnectprog, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].disconnectprog, yylval.str);
- log(LL_DBG, "entry %d: disconnectprog = %s", entrycount, yylval.str);
- break;
-
- case DOWNTRIES:
- if(yylval.num > DOWN_TRIES_MAX)
- yylval.num = DOWN_TRIES_MAX;
- else if(yylval.num < DOWN_TRIES_MIN)
- yylval.num = DOWN_TRIES_MIN;
-
- log(LL_DBG, "entry %d: downtries = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].downtries = yylval.num;
- break;
-
- case DOWNTIME:
- if(yylval.num > DOWN_TIME_MAX)
- yylval.num = DOWN_TIME_MAX;
- else if(yylval.num < DOWN_TIME_MIN)
- yylval.num = DOWN_TIME_MIN;
-
- log(LL_DBG, "entry %d: downtime = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].downtime = yylval.num;
- break;
-
- case EARLYHANGUP:
- log(LL_DBG, "entry %d: earlyhangup = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].earlyhangup = yylval.num;
- break;
-
- case IDLETIME_IN:
- log(LL_DBG, "entry %d: idle_time_in = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].idle_time_in = yylval.num;
- break;
-
- case IDLETIME_OUT:
- log(LL_DBG, "entry %d: idle_time_out = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].idle_time_out = yylval.num;
- break;
-
- case ISDNCONTROLLER:
- cfg_entry_tab[entrycount].isdncontroller = yylval.num;
- log(LL_DBG, "entry %d: isdncontroller = %d", entrycount, yylval.num);
- break;
-
- case ISDNCHANNEL:
- switch(yylval.num)
- {
- case 0:
- case -1:
- cfg_entry_tab[entrycount].isdnchannel = CHAN_ANY;
- log(LL_DBG, "entry %d: isdnchannel = any", entrycount);
- break;
- case 1:
- cfg_entry_tab[entrycount].isdnchannel = CHAN_B1;
- log(LL_DBG, "entry %d: isdnchannel = one", entrycount);
- break;
- case 2:
- cfg_entry_tab[entrycount].isdnchannel = CHAN_B2;
- log(LL_DBG, "entry %d: isdnchannel = two", entrycount);
- break;
- default:
- log(LL_DBG, "entry %d: isdnchannel value out of range", entrycount);
- config_error_flag++;
- break;
- }
- break;
-
- case ISDNTIME:
- log(LL_DBG, "system: isdntime = %d", yylval.booln);
- isdntime = yylval.booln;
- break;
-
- case ISDNTXDELIN:
- cfg_entry_tab[entrycount].isdntxdelin = yylval.num;
- log(LL_DBG, "entry %d: isdntxdel-incoming = %d", entrycount, yylval.num);
- break;
-
- case ISDNTXDELOUT:
- cfg_entry_tab[entrycount].isdntxdelout = yylval.num;
- log(LL_DBG, "entry %d: isdntxdel-outgoing = %d", entrycount, yylval.num);
- break;
-
- case LOCAL_PHONE_DIALOUT:
- log(LL_DBG, "entry %d: local_phone_dialout = %s", entrycount, yylval.str);
- strcpy(cfg_entry_tab[entrycount].local_phone_dialout, yylval.str);
- break;
-
- case LOCAL_PHONE_INCOMING:
- log(LL_DBG, "entry %d: local_phone_incoming = %s", entrycount, yylval.str);
- strcpy(cfg_entry_tab[entrycount].local_phone_incoming, yylval.str);
- break;
-
- case MONITORPORT:
- monitorport = yylval.num;
- log(LL_DBG, "system: monitorport = %d", yylval.num);
- break;
-
- case MONITORSW:
- if (yylval.booln && inhibit_monitor) {
- do_monitor = 0;
- log(LL_DBG, "system: monitor-enable overriden by command line flag");
- } else {
- do_monitor = yylval.booln;
- log(LL_DBG, "system: monitor-enable = %d", yylval.booln);
- }
- break;
-
- case NAME:
- log(LL_DBG, "entry %d: name = %s", entrycount, yylval.str);
- strcpy(cfg_entry_tab[entrycount].name, yylval.str);
- break;
-
- case REACTION:
- log(LL_DBG, "entry %d: dialin_reaction = %s", entrycount, yylval.str);
- if(!(strcmp(yylval.str, "accept")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_ACCEPT;
- else if(!(strcmp(yylval.str, "reject")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_REJECT;
- else if(!(strcmp(yylval.str, "ignore")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_IGNORE;
- else if(!(strcmp(yylval.str, "answer")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_ANSWER;
- else if(!(strcmp(yylval.str, "callback")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_CALLBACK;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"dialin_reaction\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case REMOTE_PHONE_DIALOUT:
- if(cfg_entry_tab[entrycount].remote_numbers_count >= MAXRNUMBERS)
- {
- log(LL_ERR, "ERROR parsing config file: too many remote numbers at line %d!", lineno);
- config_error_flag++;
- break;
- }
-
- log(LL_DBG, "entry %d: remote_phone_dialout #%d = %s",
- entrycount, cfg_entry_tab[entrycount].remote_numbers_count, yylval.str);
-
- strcpy(cfg_entry_tab[entrycount].remote_numbers[cfg_entry_tab[entrycount].remote_numbers_count].number, yylval.str);
- cfg_entry_tab[entrycount].remote_numbers[cfg_entry_tab[entrycount].remote_numbers_count].flag = 0;
-
- cfg_entry_tab[entrycount].remote_numbers_count++;
-
- break;
-
- case REMOTE_NUMBERS_HANDLING:
- log(LL_DBG, "entry %d: remdial_handling = %s", entrycount, yylval.str);
- if(!(strcmp(yylval.str, "next")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_NEXT;
- else if(!(strcmp(yylval.str, "last")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_LAST;
- else if(!(strcmp(yylval.str, "first")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_FIRST;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"remdial_handling\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case REMOTE_PHONE_INCOMING:
- {
- int n;
- n = cfg_entry_tab[entrycount].incoming_numbers_count;
- if (n >= MAX_INCOMING)
- {
- log(LL_ERR, "ERROR parsing config file: too many \"remote_phone_incoming\" entries at line %d!", lineno);
- config_error_flag++;
- break;
- }
- log(LL_DBG, "entry %d: remote_phone_incoming #%d = %s", entrycount, n, yylval.str);
- strcpy(cfg_entry_tab[entrycount].remote_phone_incoming[n].number, yylval.str);
- cfg_entry_tab[entrycount].incoming_numbers_count++;
- }
- break;
-
- case RATESFILE:
- strcpy(ratesfile, yylval.str);
- log(LL_DBG, "system: ratesfile = %s", yylval.str);
- break;
-
- case RATETYPE:
- log(LL_DBG, "entry %d: ratetype = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].ratetype = yylval.num;
- break;
-
- case RECOVERYTIME:
- if(yylval.num < RECOVERYTIME_MIN)
- {
- yylval.num = RECOVERYTIME_MIN;
- log(LL_DBG, "entry %d: recoverytime < %d, min = %d", entrycount, RECOVERYTIME_MIN, yylval.num);
- }
-
- log(LL_DBG, "entry %d: recoverytime = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].recoverytime = yylval.num;
- break;
-
- case REGEXPR:
- if(nregexpr >= MAX_RE)
- {
- log(LL_DBG, "system: regexpr #%d >= MAX_RE", nregexpr);
- config_error_flag++;
- break;
- }
-
- if((i = regcomp(&(rarr[nregexpr].re), yylval.str, REG_EXTENDED|REG_NOSUB)) != 0)
- {
- char buf[256];
- regerror(i, &(rarr[nregexpr].re), buf, sizeof(buf));
- log(LL_DBG, "system: regcomp error for %s: [%s]", yylval.str, buf);
- config_error_flag++;
- break;
- }
- else
- {
- if((rarr[nregexpr].re_expr = malloc(strlen(yylval.str)+1)) == NULL)
- {
- log(LL_DBG, "system: regexpr malloc error error for %s", yylval.str);
- config_error_flag++;
- break;
- }
- strcpy(rarr[nregexpr].re_expr, yylval.str);
-
- log(LL_DBG, "system: regexpr %s stored into slot %d", yylval.str, nregexpr);
-
- if(rarr[nregexpr].re_prog != NULL)
- rarr[nregexpr].re_flg = 1;
-
- nregexpr++;
-
- }
- break;
-
- case REGPROG:
- if(nregprog >= MAX_RE)
- {
- log(LL_DBG, "system: regprog #%d >= MAX_RE", nregprog);
- config_error_flag++;
- break;
- }
- if((rarr[nregprog].re_prog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- log(LL_DBG, "system: regprog malloc error error for %s", yylval.str);
- config_error_flag++;
- break;
- }
- strcpy(rarr[nregprog].re_prog, yylval.str);
-
- log(LL_DBG, "system: regprog %s stored into slot %d", yylval.str, nregprog);
-
- if(rarr[nregprog].re_expr != NULL)
- rarr[nregprog].re_flg = 1;
-
- nregprog++;
- break;
-
- case RTPRIO:
-#ifdef USE_RTPRIO
- rt_prio = yylval.num;
- if(rt_prio < RTP_PRIO_MIN || rt_prio > RTP_PRIO_MAX)
- {
- config_error_flag++;
- log(LL_DBG, "system: error, rtprio (%d) out of range!", yylval.num);
- }
- else
- {
- log(LL_DBG, "system: rtprio = %d", yylval.num);
- }
-#else
- rt_prio = RTPRIO_NOTUSED;
-#endif
- break;
-
- case UNITLENGTH:
- log(LL_DBG, "entry %d: unitlength = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].unitlength = yylval.num;
- break;
-
- case UNITLENGTHSRC:
- log(LL_DBG, "entry %d: unitlengthsrc = %s", entrycount, yylval.str);
- if(!(strcmp(yylval.str, "none")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_NONE;
- else if(!(strcmp(yylval.str, "cmdl")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_CMDL;
- else if(!(strcmp(yylval.str, "conf")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_CONF;
- else if(!(strcmp(yylval.str, "rate")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_RATE;
- else if(!(strcmp(yylval.str, "aocd")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_DYN;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"unitlengthsrc\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case USRDEVICENAME:
- log(LL_DBG, "entry %d: usrdevicename = %s", entrycount, yylval.str);
- if(!strcmp(yylval.str, "rbch"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_RBCH;
- else if(!strcmp(yylval.str, "tel"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_TEL;
- else if(!strcmp(yylval.str, "ipr"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_IPR;
- else if(!strcmp(yylval.str, "isp"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_ISPPP;
- else
- {
- log(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"usrdevicename\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case USRDEVICEUNIT:
- log(LL_DBG, "entry %d: usrdeviceunit = %d", entrycount, yylval.num);
- cfg_entry_tab[entrycount].usrdeviceunit = yylval.num;
- break;
-
- case USEACCTFILE:
- useacctfile = yylval.booln;
- log(LL_DBG, "system: useacctfile = %d", yylval.booln);
- break;
-
- case USEDOWN:
- log(LL_DBG, "entry %d: usedown = %d", entrycount, yylval.booln);
- cfg_entry_tab[entrycount].usedown = yylval.booln;
- break;
-
- default:
- log(LL_ERR, "ERROR parsing config file: unknown keyword at line %d!", lineno);
- config_error_flag++;
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * configuration validation and consistency check
- *---------------------------------------------------------------------------*/
-static void
-check_config(void)
-{
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i;
- int error = 0;
-
- /* regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if((rarr[i].re_expr != NULL) && (rarr[i].re_prog == NULL))
- {
- log(LL_ERR, "check_config: regular expression %d without program!", i);
- error++;
- }
- if((rarr[i].re_prog != NULL) && (rarr[i].re_expr == NULL))
- {
- log(LL_ERR, "check_config: regular expression program %d without expression!", i);
- error++;
- }
- }
-
- /* entry sections */
-
- for(i=0; i <= entrycount; i++, cep++)
- {
- /* isdn controller number */
-
- if((cep->isdncontroller < 0) || (cep->isdncontroller > (ncontroller-1)))
- {
- log(LL_ERR, "check_config: isdncontroller out of range in entry %d!", i);
- error++;
- }
-
- /* numbers used for dialout */
-
- if((cep->inout != DIR_INONLY) && (cep->dialin_reaction != REACT_ANSWER))
- {
- if(cep->remote_numbers_count == 0)
- {
- log(LL_ERR, "check_config: remote-phone-dialout not set in entry %d!", i);
- error++;
- }
- if(strlen(cep->local_phone_dialout) == 0)
- {
- log(LL_ERR, "check_config: local-phone-dialout not set in entry %d!", i);
- error++;
- }
- }
-
- /* numbers used for incoming calls */
-
- if(cep->inout != DIR_OUTONLY)
- {
- if(strlen(cep->local_phone_incoming) == 0)
- {
- log(LL_ERR, "check_config: local-phone-incoming not set in entry %d!", i);
- error++;
- }
- if(cep->incoming_numbers_count == 0)
- {
- log(LL_ERR, "check_config: remote-phone-incoming not set in entry %d!", i);
- error++;
- }
- }
-
- if((cep->dialin_reaction == REACT_ANSWER) && (cep->b1protocol != BPROT_NONE))
- {
- log(LL_ERR, "check_config: b1protocol not raw for telephony in entry %d!", i);
- error++;
- }
- }
- if(error)
- {
- log(LL_ERR, "check_config: %d error(s) in configuration file, exit!", error);
- do_exit(1);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * print the configuration
- *---------------------------------------------------------------------------*/
-static void
-print_config(void)
-{
-#define PFILE stdout
-
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i, j;
- extern VARA_DECL(struct monitor_rights) rights;
- time_t clock;
- char mytime[64];
-
- time(&clock);
- strcpy(mytime, ctime(&clock));
- mytime[strlen(mytime)-1] = '\0';
-
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "# system section (generated %s)\n", mytime);
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "system\n");
- fprintf(PFILE, "useacctfile = %s\n", useacctfile ? "on\t\t\t\t# update accounting information file" : "off\t\t\t\t# don't update accounting information file");
- fprintf(PFILE, "acctall = %s\n", acct_all ? "on\t\t\t\t# put all events into accounting file" : "off\t\t\t\t# put only charged events into accounting file");
- fprintf(PFILE, "acctfile = %s\t\t# accounting information file\n", acctfile);
- fprintf(PFILE, "ratesfile = %s\t\t# charging rates database file\n", ratesfile);
-
-#ifdef USE_RTPRIO
- if(rt_prio == RTPRIO_NOTUSED)
- fprintf(PFILE, "# rtprio is unused\n");
- else
- fprintf(PFILE, "rtprio = %d\t\t\t\t# isdnd runs at realtime priority\n", rt_prio);
-#endif
-
- /* regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if(rarr[i].re_expr != NULL)
- {
- fprintf(PFILE, "regexpr = \"%s\"\t\t# scan logfile for this expression\n", rarr[i].re_expr);
- }
- if(rarr[i].re_prog != NULL)
- {
- fprintf(PFILE, "regprog = %s\t\t# program to run when expression is matched\n", rarr[i].re_prog);
- }
- }
-
-#ifdef I4B_EXTERNAL_MONITOR
-
- fprintf(PFILE, "monitor-allowed = %s\n", do_monitor ? "on\t\t\t\t# remote isdnd monitoring allowed" : "off\t\t\t\t# remote isdnd monitoring disabled");
- fprintf(PFILE, "monitor-port = %d\t\t\t\t# TCP/IP port number used for remote monitoring\n", monitorport);
-
- if(VARA_NUM(rights))
- {
- char *s = "error\n";
- char b[512];
-
- VARA_FOREACH(rights, i)
- {
- if(VARA_AT(rights, i).local)
- {
- fprintf(PFILE, "monitor = \"%s\"\t\t# local socket name for monitoring\n", VARA_AT(rights, i).name);
- }
- else
- {
- struct in_addr ia;
- ia.s_addr = ntohl(VARA_AT(rights, i).net);
-
- switch(VARA_AT(rights, i).mask)
- {
- case 0xffffffff:
- s = "32";
- break;
- case 0xfffffffe:
- s = "31";
- break;
- case 0xfffffffc:
- s = "30";
- break;
- case 0xfffffff8:
- s = "29";
- break;
- case 0xfffffff0:
- s = "28";
- break;
- case 0xffffffe0:
- s = "27";
- break;
- case 0xffffffc0:
- s = "26";
- break;
- case 0xffffff80:
- s = "25";
- break;
- case 0xffffff00:
- s = "24";
- break;
- case 0xfffffe00:
- s = "23";
- break;
- case 0xfffffc00:
- s = "22";
- break;
- case 0xfffff800:
- s = "21";
- break;
- case 0xfffff000:
- s = "20";
- break;
- case 0xffffe000:
- s = "19";
- break;
- case 0xffffc000:
- s = "18";
- break;
- case 0xffff8000:
- s = "17";
- break;
- case 0xffff0000:
- s = "16";
- break;
- case 0xfffe0000:
- s = "15";
- break;
- case 0xfffc0000:
- s = "14";
- break;
- case 0xfff80000:
- s = "13";
- break;
- case 0xfff00000:
- s = "12";
- break;
- case 0xffe00000:
- s = "11";
- break;
- case 0xffc00000:
- s = "10";
- break;
- case 0xff800000:
- s = "9";
- break;
- case 0xff000000:
- s = "8";
- break;
- case 0xfe000000:
- s = "7";
- break;
- case 0xfc000000:
- s = "6";
- break;
- case 0xf8000000:
- s = "5";
- break;
- case 0xf0000000:
- s = "4";
- break;
- case 0xe0000000:
- s = "3";
- break;
- case 0xc0000000:
- s = "2";
- break;
- case 0x80000000:
- s = "1";
- break;
- case 0x00000000:
- s = "0";
- break;
- }
- fprintf(PFILE, "monitor = \"%s/%s\"\t\t# host (net/mask) allowed to connect for monitoring\n", inet_ntoa(ia), s);
- }
- b[0] = '\0';
-
- if((VARA_AT(rights, i).rights) & I4B_CA_COMMAND_FULL)
- strcat(b, "fullcmd,");
- if((VARA_AT(rights, i).rights) & I4B_CA_COMMAND_RESTRICTED)
- strcat(b, "restrictedcmd,");
- if((VARA_AT(rights, i).rights) & I4B_CA_EVNT_CHANSTATE)
- strcat(b, "channelstate,");
- if((VARA_AT(rights, i).rights) & I4B_CA_EVNT_CALLIN)
- strcat(b, "callin,");
- if((VARA_AT(rights, i).rights) & I4B_CA_EVNT_CALLOUT)
- strcat(b, "callout,");
- if((VARA_AT(rights, i).rights) & I4B_CA_EVNT_I4B)
- strcat(b, "logevents,");
-
- if(b[strlen(b)-1] == ',')
- b[strlen(b)-1] = '\0';
-
- fprintf(PFILE, "monitor-access = %s\t\t# monitor access rights\n", b);
- }
- }
-
-#endif
- /* entry sections */
-
- for(i=0; i <= entrycount; i++, cep++)
- {
- fprintf(PFILE, "\n");
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "# entry section %d\n", i);
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "entry\n");
-
- fprintf(PFILE, "name = %s\t\t# name for this entry section\n", cep->name);
-
- fprintf(PFILE, "isdncontroller = %d\t\t# ISDN card number used for this entry\n", cep->isdncontroller);
- fprintf(PFILE, "isdnchannel = ");
- switch(cep->isdnchannel)
- {
- case CHAN_ANY:
- fprintf(PFILE, "-1\t\t# any ISDN B-channel may be used\n");
- break;
- case CHAN_B1:
- fprintf(PFILE, "1\t\t# only ISDN B-channel 1 may be used\n");
- break;
- case CHAN_B2:
- fprintf(PFILE, "2\t\t# only ISDN B-channel 2 ay be used\n");
- break;
- }
-
- fprintf(PFILE, "usrdevicename = %s\t\t# name of userland ISDN B-channel device\n", bdrivername(cep->usrdevicename));
- fprintf(PFILE, "usrdeviceunit = %d\t\t# unit number of userland ISDN B-channel device\n", cep->usrdeviceunit);
-
- fprintf(PFILE, "b1protocol = %s\n", cep->b1protocol ? "hdlc\t\t# B-channel layer 1 protocol is HDLC" : "raw\t\t# No B-channel layer 1 protocol used");
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- fprintf(PFILE, "direction = ");
- switch(cep->inout)
- {
- case DIR_INONLY:
- fprintf(PFILE, "in\t\t# only incoming connections allowed\n");
- break;
- case DIR_OUTONLY:
- fprintf(PFILE, "out\t\t# only outgoing connections allowed\n");
- break;
- case DIR_INOUT:
- fprintf(PFILE, "inout\t\t# incoming and outgoing connections allowed\n");
- break;
- }
- }
-
- if(!((cep->usrdevicename == BDRV_TEL) || (cep->inout == DIR_INONLY)))
- {
- if(cep->remote_numbers_count > 1)
- {
- for(j=0; j<cep->remote_numbers_count; j++)
- fprintf(PFILE, "remote-phone-dialout = %s\t\t# telephone number %d for dialing out to remote\n", cep->remote_numbers[j].number, j+1);
-
- fprintf(PFILE, "remdial-handling = ");
-
- switch(cep->remote_numbers_handling)
- {
- case RNH_NEXT:
- fprintf(PFILE, "next\t\t# use next number after last successfull for new dial\n");
- break;
- case RNH_LAST:
- fprintf(PFILE, "last\t\t# use last successfull number for new dial\n");
- break;
- case RNH_FIRST:
- fprintf(PFILE, "first\t\t# always start with first number for new dial\n");
- break;
- }
- }
- else
- {
- fprintf(PFILE, "remote-phone-dialout = %s\t\t# telephone number for dialing out to remote\n", cep->remote_numbers[0].number);
- }
-
- fprintf(PFILE, "local-phone-dialout = %s\t\t# show this number to remote when dialling out\n", cep->local_phone_dialout);
- fprintf(PFILE, "dialout-type = %s\n", cep->dialouttype ? "calledback\t\t# i am called back by remote" : "normal\t\t# i am not called back by remote");
- }
-
- if(!(cep->inout == DIR_OUTONLY))
- {
- int n;
-
- fprintf(PFILE, "local-phone-incoming = %s\t\t# incoming calls must match this (mine) telephone number\n", cep->local_phone_incoming);
- for (n = 0; n < cep->incoming_numbers_count; n++)
- fprintf(PFILE, "remote-phone-incoming = %s\t\t# this is a valid remote number to call me\n",
- cep->remote_phone_incoming[n].number);
-
- fprintf(PFILE, "dialin-reaction = ");
- switch(cep->dialin_reaction)
- {
- case REACT_ACCEPT:
- fprintf(PFILE, "accept\t\t# i accept a call from remote and connect\n");
- break;
- case REACT_REJECT:
- fprintf(PFILE, "reject\t\t# i reject the call from remote\n");
- break;
- case REACT_IGNORE:
- fprintf(PFILE, "ignore\t\t# i ignore the call from remote\n");
- break;
- case REACT_ANSWER:
- fprintf(PFILE, "answer\t\t# i will start telephone answering when remote calls in\n");
- break;
- case REACT_CALLBACK:
- fprintf(PFILE, "callback\t\t# when remote calls in, i will hangup and call back\n");
- break;
- }
- }
-
- if(!((cep->inout == DIR_INONLY) || (cep->usrdevicename == BDRV_TEL)))
- fprintf(PFILE, "idletime-outgoing = %d\t\t# outgoing call idle timeout\n", cep->idle_time_out);
-
- if(!(cep->inout == DIR_OUTONLY))
- fprintf(PFILE, "idletime-incoming = %d\t\t# incoming call idle timeout\n", cep->idle_time_in);
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- fprintf(PFILE, "unitlengthsrc = ");
- switch(cep->unitlengthsrc)
- {
- case ULSRC_NONE:
- fprintf(PFILE, "none\t\t# no unit length specified, using default\n");
- break;
- case ULSRC_CMDL:
- fprintf(PFILE, "cmdl\t\t# using unit length specified on commandline\n");
- break;
- case ULSRC_CONF:
- fprintf(PFILE, "conf\t\t# using unitlength specified by unitlength-keyword\n");
- fprintf(PFILE, "unitlength = %d\t\t# fixed unitlength\n", cep->unitlength);
- break;
- case ULSRC_RATE:
- fprintf(PFILE, "rate\t\t# using unitlength specified in rate database\n");
- fprintf(PFILE, "ratetype = %d\t\t# type of rate from rate database\n", cep->ratetype);
- break;
- case ULSRC_DYN:
- fprintf(PFILE, "aocd\t\t# using dynamically calculated unitlength based on AOCD subscription\n");
- fprintf(PFILE, "ratetype = %d\t\t# type of rate from rate database\n", cep->ratetype);
- break;
- }
-
- fprintf(PFILE, "earlyhangup = %d\t\t# early hangup safety time\n", cep->earlyhangup);
-
- }
-
- if(cep->usrdevicename == BDRV_TEL)
- {
- fprintf(PFILE, "answerprog = %s\t\t# program used to answer incoming telephone calls\n", cep->answerprog);
- fprintf(PFILE, "alert = %d\t\t# number of seconds to wait before accepting a call\n", cep->alert);
- }
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- if(cep->dialin_reaction == REACT_CALLBACK)
- fprintf(PFILE, "callbackwait = %d\t\t# i am waiting this time before calling back remote\n", cep->callbackwait);
-
- if(cep->dialouttype == DIALOUT_CALLEDBACK)
- fprintf(PFILE, "calledbackwait = %d\t\t# i am waiting this time for a call back from remote\n", cep->calledbackwait);
-
- if(!(cep->inout == DIR_INONLY))
- {
- fprintf(PFILE, "dialretries = %d\t\t# number of dialing retries\n", cep->dialretries);
- fprintf(PFILE, "recoverytime = %d\t\t# time to wait between dialling retries\n", cep->recoverytime);
- fprintf(PFILE, "dialrandincr = %s\t\t# use random dialing time addon\n", cep->dialrandincr ? "on" : "off");
-
- fprintf(PFILE, "usedown = %s\n", cep->usedown ? "on\t\t# ISDN device switched off on excessive dial failures" : "off\t\t# no device switchoff on excessive dial failures");
- if(cep->usedown)
- {
- fprintf(PFILE, "downtries = %d\t\t# number of dialretries failures before switching off\n", cep->downtries);
- fprintf(PFILE, "downtime = %d\t\t# time device is switched off\n", cep->downtime);
- }
- }
- }
- }
- fprintf(PFILE, "\n");
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rc_parse.y b/usr.sbin/i4b/isdnd/rc_parse.y
deleted file mode 100644
index 6c1cf1440ab6..000000000000
--- a/usr.sbin/i4b/isdnd/rc_parse.y
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - runtime configuration parser
- * -----------------------------------------
- *
- * $Id: rc_parse.y,v 1.15 1998/12/05 18:03:38 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:12:26 1998]
- *
- *---------------------------------------------------------------------------*/
-
-%{
-
-/* #define YYDEBUG 1 */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "monitor.h" /* monitor access rights bit definitions */
-#include "isdnd.h"
-
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-
-extern void cfg_setval(int keyword);
-extern void reset_scanner(FILE *infile);
-extern void yyerror(const char *msg);
-extern int yylex();
-
-extern int lineno;
-extern char *yytext;
-extern int nentries;
-
-int saw_system = 0;
-int entrycount = -1;
-
-%}
-
-%token ACCTALL
-%token ACCTFILE
-%token ALERT
-%token ALIASING
-%token ALIASFNAME
-%token ANSWERPROG
-%token B1PROTOCOL
-%token CALLBACKWAIT
-%token CALLEDBACKWAIT
-%token CONNECTPROG
-%token DIALRETRIES
-%token DIALRANDINCR
-%token DIALOUTTYPE
-%token DIRECTION
-%token DISCONNECTPROG
-%token DOWNTRIES
-%token DOWNTIME
-%token EARLYHANGUP
-%token ENTRY
-%token IDLETIME_IN
-%token IDLETIME_OUT
-%token ISDNCONTROLLER
-%token ISDNCHANNEL
-%token ISDNTIME
-%token ISDNTXDELIN
-%token ISDNTXDELOUT
-%token LOCAL_PHONE_DIALOUT
-%token LOCAL_PHONE_INCOMING
-%token MONITORSW
-%token MONITORPORT
-%token MONITOR
-%token MONITORACCESS
-%token FULLCMD
-%token RESTRICTEDCMD
-%token CHANNELSTATE
-%token CALLIN
-%token CALLOUT
-%token LOGEVENTS
-%token NAME
-%token NO
-%token OFF
-%token ON
-%token RATESFILE
-%token RATETYPE
-%token REMOTE_NUMBERS_HANDLING
-%token REMOTE_PHONE_INCOMING
-%token REMOTE_PHONE_DIALOUT
-%token REACTION
-%token RECOVERYTIME
-%token REGEXPR
-%token REGPROG
-%token RTPRIO
-%token SYSTEM
-%token UNITLENGTH
-%token UNITLENGTHSRC
-%token USEACCTFILE
-%token USRDEVICENAME
-%token USRDEVICEUNIT
-%token USEDOWN
-%token YES
-
-%token <str> NUMBERSTR
-
-%token <str> STRING
-
-%type <booln> boolean
-
-%type <num> sysfilekeyword sysnumkeyword sysstrkeyword sysboolkeyword
-%type <num> numkeyword strkeyword boolkeyword monrights monright
-%type <str> filename
-
-%union {
- int booln;
- int num;
- char *str;
-}
-
-%%
-
-config: sections
- ;
-
-sections: possible_nullentries
- syssect
- entrysects
- ;
-
-possible_nullentries:
- /* lambda */
- | possible_nullentries error '\n'
- | possible_nullentries nullentry
- ;
-
-nullentry: '\n'
- ;
-
-entrysects: entrysect
- | entrysects entrysect
- ;
-
-syssect: SYSTEM sysentries
- ;
-
-sysentries: sysentry
- {
- saw_system = 1;
- monitor_clear_rights();
- }
- | sysentries sysentry
- ;
-
-sysentry: sysfileentry
- | sysboolentry
- | sysnumentry
- | sysstrentry
- | sysmonitorstart
- | sysmonitorrights
- | nullentry
- | error '\n'
- ;
-
-
-sysmonitorstart:
- MONITOR '=' STRING '\n'
- {
- char *err = NULL;
- switch (monitor_start_rights($3)) {
- case I4BMAR_OK:
- break;
- case I4BMAR_LENGTH:
- err = "local socket name too long: %s";
- break;
- case I4BMAR_DUP:
- err = "duplicate entry: %s";
- break;
- case I4BMAR_CIDR:
- err = "invalid CIDR specification: %s";
- break;
- case I4BMAR_NOIP:
- err = "could not resolve host or net specification: %s";
- break;
- }
- if (err) {
- char msg[1024];
- snprintf(msg, sizeof msg, err, $3);
- yyerror(msg);
- }
- }
- ;
-
-sysmonitorrights:
- MONITORACCESS '=' monrights '\n'
- { monitor_add_rights($3); }
- ;
-
-monrights: monrights ',' monright { $$ = $1 | $3; }
- | monright { $$ = $1; }
- ;
-
-monright: FULLCMD { $$ = I4B_CA_COMMAND_FULL; }
- | RESTRICTEDCMD { $$ = I4B_CA_COMMAND_RESTRICTED; }
- | CHANNELSTATE { $$ = I4B_CA_EVNT_CHANSTATE; }
- | CALLIN { $$ = I4B_CA_EVNT_CALLIN; }
- | CALLOUT { $$ = I4B_CA_EVNT_CALLOUT; }
- | LOGEVENTS { $$ = I4B_CA_EVNT_I4B; }
- ;
-
-sysfileentry: sysfilekeyword '=' filename '\n'
- {
- cfg_setval($1);
- }
- ;
-
-sysboolentry: sysboolkeyword '=' boolean '\n'
- {
- yylval.booln = $3;
- cfg_setval($1);
- }
- ;
-
-sysnumentry: sysnumkeyword '=' NUMBERSTR '\n'
- {
- yylval.num = atoi($3);
- cfg_setval($1);
- }
- ;
-
-sysstrentry: sysstrkeyword '=' STRING '\n'
- {
- cfg_setval($1);
- }
- | sysstrkeyword '=' NUMBERSTR '\n'
- {
- cfg_setval($1);
- }
- ;
-
-filename: STRING {
- if ($1[0] != '/')
- {
- yyerror("filename doesn't start with a slash");
- YYERROR;
- }
- $$ = $1;
- }
- ;
-
-boolean: NO { $$ = FALSE; }
- | OFF { $$ = FALSE; }
- | ON { $$ = TRUE; }
- | YES { $$ = TRUE; }
- ;
-
-sysfilekeyword: RATESFILE { $$ = RATESFILE; }
- | ACCTFILE { $$ = ACCTFILE; }
- | ALIASFNAME { $$ = ALIASFNAME; }
- ;
-
-sysboolkeyword: USEACCTFILE { $$ = USEACCTFILE; }
- | ALIASING { $$ = ALIASING; }
- | ACCTALL { $$ = ACCTALL; }
- | ISDNTIME { $$ = ISDNTIME; }
- | MONITORSW { $$ = MONITORSW; }
- ;
-
-sysnumkeyword: MONITORPORT { $$ = MONITORPORT; }
- | RTPRIO { $$ = RTPRIO; }
- ;
-
-sysstrkeyword: REGEXPR { $$ = REGEXPR; }
- | REGPROG { $$ = REGPROG; }
- ;
-
-entrysect: ENTRY
- {
- entrycount++;
- nentries++;
- }
- entries
- ;
-
-entries: entry
- | entries entry
- ;
-
-entry: strentry
- | numentry
- | boolentry
- | nullentry
- | error '\n'
- ;
-
-strentry: strkeyword '=' STRING '\n'
- {
- cfg_setval($1);
- }
- | strkeyword '=' NUMBERSTR '\n'
- {
- cfg_setval($1);
- }
- ;
-
-boolentry: boolkeyword '=' boolean '\n'
- {
- yylval.booln = $3;
- cfg_setval($1);
- }
- ;
-
-numentry: numkeyword '=' NUMBERSTR '\n'
- {
- yylval.num = atoi($3);
- cfg_setval($1);
- }
- ;
-
-strkeyword: ANSWERPROG { $$ = ANSWERPROG; }
- | B1PROTOCOL { $$ = B1PROTOCOL; }
- | CONNECTPROG { $$ = CONNECTPROG; }
- | DIALOUTTYPE { $$ = DIALOUTTYPE; }
- | DIRECTION { $$ = DIRECTION; }
- | DISCONNECTPROG { $$ = DISCONNECTPROG; }
- | LOCAL_PHONE_INCOMING { $$ = LOCAL_PHONE_INCOMING; }
- | LOCAL_PHONE_DIALOUT { $$ = LOCAL_PHONE_DIALOUT; }
- | NAME { $$ = NAME; }
- | REACTION { $$ = REACTION; }
- | REMOTE_NUMBERS_HANDLING { $$ = REMOTE_NUMBERS_HANDLING; }
- | REMOTE_PHONE_INCOMING { $$ = REMOTE_PHONE_INCOMING; }
- | REMOTE_PHONE_DIALOUT { $$ = REMOTE_PHONE_DIALOUT; }
- | UNITLENGTHSRC { $$ = UNITLENGTHSRC; }
- | USRDEVICENAME { $$ = USRDEVICENAME; }
- ;
-
-numkeyword: ALERT { $$ = ALERT; }
- | CALLBACKWAIT { $$ = CALLBACKWAIT; }
- | CALLEDBACKWAIT { $$ = CALLEDBACKWAIT; }
- | DIALRETRIES { $$ = DIALRETRIES; }
- | EARLYHANGUP { $$ = EARLYHANGUP; }
- | IDLETIME_IN { $$ = IDLETIME_IN; }
- | IDLETIME_OUT { $$ = IDLETIME_OUT; }
- | ISDNCONTROLLER { $$ = ISDNCONTROLLER; }
- | ISDNCHANNEL { $$ = ISDNCHANNEL; }
- | ISDNTXDELIN { $$ = ISDNTXDELIN; }
- | ISDNTXDELOUT { $$ = ISDNTXDELOUT; }
- | RATETYPE { $$ = RATETYPE; }
- | RECOVERYTIME { $$ = RECOVERYTIME; }
- | UNITLENGTH { $$ = UNITLENGTH; }
- | USRDEVICEUNIT { $$ = USRDEVICEUNIT; }
- | DOWNTIME { $$ = DOWNTIME; }
- | DOWNTRIES { $$ = DOWNTRIES; }
- ;
-
-boolkeyword: DIALRANDINCR { $$ = DIALRANDINCR; }
- | USEDOWN { $$ = USEDOWN; }
- ;
-
-%%
diff --git a/usr.sbin/i4b/isdnd/rc_scan.l b/usr.sbin/i4b/isdnd/rc_scan.l
deleted file mode 100644
index dfca28ce6961..000000000000
--- a/usr.sbin/i4b/isdnd/rc_scan.l
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - runtime configuration lexical analyzer
- * ---------------------------------------------------
- *
- * $Id: rc_scan.l,v 1.19 1998/12/18 17:17:57 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:08:25 1998]
- *
- *---------------------------------------------------------------------------*/
-
-%{
-
-#include <err.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sysexits.h>
-
-#include "y.tab.h"
-
-int lineno;
-
-%}
-
-%option noyywrap
-%option nounput
-
-%%
-
-#.*$ { /*
- * Drop comment. NB: this prevents a hash
- * sign from appearing inside a quoted string.
- */
- }
-
-["][^"]*["] {
- char *str;
- if ((str = malloc(yyleng - 1)) == 0)
- errx(EX_OSERR, "Out of virtual memory");
- memcpy(str, yytext + 1, yyleng - 2);
- str[yyleng - 2] = 0;
- yylval.str = str;
- return STRING;
- }
-
-(-*[0-9]+)|\* {
- char *str;
- char *p = yytext;
- int i = 0;
- if ((str = malloc(128)) == 0)
- errx(EX_OSERR, "Out of virtual memory");
- while(*p == '-' || isdigit(*p) || *p == '*')
- str[i++] = *p++;
- str[i] = '\0';
- yylval.str = str;
- return NUMBERSTR;
- }
-
-acctall { return ACCTALL; }
-acctfile { return ACCTFILE; }
-alert { return ALERT; }
-aliasing { return ALIASING; }
-aliasfile { return ALIASFNAME; }
-answerprog { return ANSWERPROG; }
-b1protocol { return B1PROTOCOL; }
-callbackwait { return CALLBACKWAIT; }
-calledbackwait { return CALLEDBACKWAIT; }
-connectprog { return CONNECTPROG; }
-dialin-reaction { return REACTION; }
-dialout-type { return DIALOUTTYPE; }
-dialrandincr { return DIALRANDINCR; }
-dialretries { return DIALRETRIES; }
-direction { return DIRECTION; }
-disconnectprog { return DISCONNECTPROG; }
-downtries { return DOWNTRIES; }
-downtime { return DOWNTIME; }
-earlyhangup { return EARLYHANGUP; }
-entry { return ENTRY; }
-idletime-incoming { return IDLETIME_IN; }
-idletime-outgoing { return IDLETIME_OUT; }
-isdncontroller { return ISDNCONTROLLER; }
-isdnchannel { return ISDNCHANNEL; }
-isdntime { return ISDNTIME; }
-isdntxdel-incoming { return ISDNTXDELIN; }
-isdntxdel-outgoing { return ISDNTXDELOUT; }
-local-phone-dialout { return LOCAL_PHONE_DIALOUT; }
-local-phone-incoming { return LOCAL_PHONE_INCOMING; }
-monitor-allowed { return MONITORSW; }
-monitor-port { return MONITORPORT; }
-monitor { return MONITOR; }
-monitor-access { return MONITORACCESS; }
-fullcmd { return FULLCMD; }
-restrictedcmd { return RESTRICTEDCMD; }
-channelstate { return CHANNELSTATE; }
-callin { return CALLIN; }
-callout { return CALLOUT; }
-logevents { return LOGEVENTS; }
-name { return NAME; }
-no { return NO; }
-off { return OFF; }
-on { return ON; }
-ratesfile { return RATESFILE; }
-ratetype { return RATETYPE; }
-recoverytime { return RECOVERYTIME; }
-regexpr { return REGEXPR; }
-regprog { return REGPROG; }
-remdial-handling { return REMOTE_NUMBERS_HANDLING; }
-remote-phone-dialout { return REMOTE_PHONE_DIALOUT; }
-remote-phone-incoming { return REMOTE_PHONE_INCOMING; }
-rtprio { return RTPRIO; }
-system { return SYSTEM; }
-unitlength { return UNITLENGTH; }
-unitlengthsrc { return UNITLENGTHSRC; }
-useacctfile { return USEACCTFILE; }
-usrdevicename { return USRDEVICENAME; }
-usrdeviceunit { return USRDEVICEUNIT; }
-usedown { return USEDOWN; }
-yes { return YES; }
-
-\n { lineno++; return '\n'; }
-
-[A-Za-z/.][-A-Za-z0-9_/.]* {
- char *str;
- if ((str = strdup(yytext)) == 0)
- err(EX_OSERR, "Out of virtual memory");
- yylval.str = str;
- return STRING;
- }
-
-[ \t] { /* drop white space */ }
-
-. { return yytext[0]; }
-
-%%
-
-void
-reset_scanner(FILE *infile)
-{
- yyrestart(infile);
- lineno = 1;
-}
diff --git a/usr.sbin/i4b/isdnd/support.c b/usr.sbin/i4b/isdnd/support.c
deleted file mode 100644
index 77c08410ef40..000000000000
--- a/usr.sbin/i4b/isdnd/support.c
+++ /dev/null
@@ -1,831 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - misc support routines
- * ----------------------------------
- *
- * $Id: support.c,v 1.43 1998/12/18 09:47:09 hm Exp $
- *
- * last edit-date: [Mon Dec 14 11:17:22 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#define SRC (aliasing == 0 ? mp->src_telno : src_tela)
-#define DST (aliasing == 0 ? mp->dst_telno : dst_tela)
-
-/*---------------------------------------------------------------------------*
- * find an active entry by driver type and driver unit
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_active_entry_by_driver(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* found */
-
- if(cep->cdid == CDID_UNUSED)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_active_entry_by_driver: entry %d, cdid is CDID_UNUSED!", i)));
- return(NULL);
- }
- else if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_active_entry_by_driver: entry %d, cdid is CDID_RESERVED!", i)));
- return(NULL);
- }
- return(cep);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for dialing out
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_by_device_for_dialout(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* compare driver type and unit */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* found, check if already reserved */
-
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialout: entry %d, cdid reserved!", i)));
- return(NULL);
- }
-
- /* check if this entry is already in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialout: entry %d, cdid in use", i)));
- return(NULL);
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- /* found an entry to be used for calling out */
-
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialout: found entry %d!", i)));
- return(cep);
- }
- else
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialout: entry %d, setup_dialout() failed!", i)));
- return(NULL);
- }
- }
-
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialout: no entry found!")));
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for dialing out
- *---------------------------------------------------------------------------*/
-int
-setup_dialout(cfg_entry_t *cep)
-{
- /* check controller operational */
-
- if((get_controller_state(cep->isdncontroller)) != CTRL_UP)
- {
- DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, controller is down", cep->name)));
- return(ERROR);
- }
-
- cep->isdncontrollerused = cep->isdncontroller;
-
- /* check channel available */
-
- switch(cep->isdnchannel)
- {
- case CHAN_B1:
- case CHAN_B2:
- if((ret_channel_state(cep->isdncontroller, cep->isdnchannel)) != CHAN_IDLE)
- {
- DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, channel not free", cep->name)));
- return(ERROR);
- }
- cep->isdnchannelused = cep->isdnchannel;
- break;
-
- case CHAN_ANY:
- if(((ret_channel_state(cep->isdncontroller, CHAN_B1)) != CHAN_IDLE) &&
- ((ret_channel_state(cep->isdncontroller, CHAN_B2)) != CHAN_IDLE))
- {
- DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, no channel free", cep->name)));
- return(ERROR);
- }
- cep->isdnchannelused = CHAN_ANY;
- break;
-
- default:
- DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, channel undefined", cep->name)));
- return(ERROR);
- break;
- }
-
- DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s ok!", cep->name)));
-
- /* preset disconnect cause */
-
- SET_CAUSE_TYPE(cep->disc_cause, CAUSET_I4B);
- SET_CAUSE_VAL(cep->disc_cause, CAUSE_I4B_NORMAL);
-
- return(GOOD);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_driver(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- DBGL(DL_MSG, (log(LL_DBG, "get_cep_by_driver: found entry %d!", i)));
- return(cep);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find a matching entry for an incoming call
- *
- * - not found/no match: log output with LL_CHD and return NULL
- * - found/match: make entry in free cep, return address
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_matching_entry_incoming(msg_connect_ind_t *mp)
-{
- cfg_entry_t *cep = NULL;
- int i;
- char *src_tela = "ERROR-src_tela";
- char *dst_tela = "ERROR-dst_tela";
-
- for(i=0; i < nentries; i++)
- {
- int n;
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* check my number */
-
- if(strncmp(cep->local_phone_incoming, mp->dst_telno, strlen(cep->local_phone_incoming)))
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, myno %s != incomingno %s", i,
- cep->local_phone_incoming, mp->dst_telno)));
- continue;
- }
-
- /* check all allowed remote number's for this entry */
-
- for (n = 0; n < cep->incoming_numbers_count; n++)
- {
- incoming_number_t *in = &cep->remote_phone_incoming[n];
- if(in->number[0] == '*')
- break;
- if(strncmp(in->number, mp->src_telno, strlen(in->number)))
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, remno %s != incomingfromno %s", i,
- in->number, mp->src_telno)));
- }
- else
- break;
- }
- if (n >= cep->incoming_numbers_count)
- continue;
-
- /* screening indicator XXX */
-
- switch(mp->scr_ind)
- {
- case SCR_NONE:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: %s - no screening indicator", mp->src_telno)));
- break;
-
- case SCR_USR_NOSC:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: %s - screening user provided, not screened", mp->src_telno)));
- break;
-
- case SCR_USR_PASS:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: %s - screening user provided, verified & passed", mp->src_telno)));
- break;
-
- case SCR_USR_FAIL:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: %s - screening user provided, verified & failed", mp->src_telno)));
- break;
-
- case SCR_NET:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: %s - screening network provided", mp->src_telno)));
- break;
-
- default:
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: ERROR %s - invalid screening indicator!", mp->src_telno)));
- break;
- }
-
- /* check b protocol */
-
- if(cep->b1protocol != mp->bprot)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, bprot %d != incomingprot %d", i,
- cep->b1protocol, mp->bprot)));
- continue;
- }
-
- /* is this entry currently in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, cdid is reserved", i)));
- }
- else if (cep->dialin_reaction == REACT_ACCEPT
- && cep->dialouttype == DIALOUT_CALLEDBACK)
- {
- /*
- * We might consider doing this even if this is
- * not a calledback config entry - BUT: there are
- * severe race conditions and timinig problems
- * ex. if both sides run I4B with no callback
- * delay - both may shutdown the outgoing call
- * and never be able to establish a connection.
- * In the called-back case this should not happen.
- */
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, incoming call for callback in progress (cdid %05d)", i, cep->cdid)));
-
- /* save the current call state, we're going to overwrite it with the
- * new incoming state below... */
- cep->saved_call.cdid = cep->cdid;
- cep->saved_call.controller = cep->isdncontrollerused;
- cep->saved_call.channel = cep->isdnchannelused;
- }
- else
- {
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, cdid in use", i)));
- continue; /* yes, next */
- }
- }
-
- /* check controller value ok */
-
- if(mp->controller > ncontroller)
- {
- log(LL_CHD, "%05d %s incoming call with invalid controller %d",
- mp->header.cdid, cep->name, mp->controller);
- return(NULL);
- }
-
- /* check controller marked up */
-
- if((get_controller_state(mp->controller)) != CTRL_UP)
- {
- log(LL_CHD, "%05d %s incoming call, controller %d DOWN!",
- mp->header.cdid, cep->name, mp->controller);
- return(NULL);
- }
-
- /* check channel he wants */
-
- switch(mp->channel)
- {
- case CHAN_B1:
- case CHAN_B2:
- if((ret_channel_state(mp->controller, mp->channel)) != CHAN_IDLE)
- {
- log(LL_CHD, "%05d %s incoming call, channel %s not free!",
- mp->header.cdid, cep->name, mp->channel == CHAN_B1 ? "B1" : "B2");
- return(NULL);
- }
- break;
-
- case CHAN_ANY:
- if(((ret_channel_state(mp->controller, CHAN_B1)) != CHAN_IDLE) &&
- ((ret_channel_state(mp->controller, CHAN_B2)) != CHAN_IDLE))
- {
- log(LL_CHD, "%05d %s incoming call, no channel free!",
- mp->header.cdid, cep->name);
- return(NULL);
- }
- break;
-
- case CHAN_NO:
- log(LL_CHD, "%05d %s incoming call, call waiting (no channel available)!",
- mp->header.cdid, cep->name);
- return(NULL);
- break;
-
- default:
- log(LL_CHD, "%05d %s incoming call, ERROR, channel undefined!",
- mp->header.cdid, cep->name);
- return(NULL);
- break;
- }
-
- /* found a matching entry */
-
- cep->cdid = mp->header.cdid;
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-/*XXX*/ cep->disc_cause = 0;
-
- /* cp number to real one used */
-
- strcpy(cep->real_phone_incoming, mp->src_telno);
-
- /* copy display string */
-
- strcpy(cep->display, mp->display);
-
- /* entry currently down ? */
-
- if(cep->state == ST_DOWN)
- {
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, ", i)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_ENA;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- log(LL_ERR, "find_matching_entry_incoming: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- do_exit(1);
- }
-
- cep->down_retry_count = 0;
- cep->state = ST_IDLE;
- }
- return(cep);
- }
-
- if(aliasing)
- {
- src_tela = get_alias(mp->src_telno);
- dst_tela = get_alias(mp->dst_telno);
- }
- log(LL_CHD, /* A number not listed in /etc/isdn/isdnd.rc */
- ( (!aliasing) ?
- "%05d <unknown> incoming call from %s to %s" :
- /* Probably a phone call, likely from someone
- in phone book /etc/isdn/isdntel.alias, so
- avoid looking silly by saying "unknown",
- & allow more space to print names.
- */
- "%05d Call from %s to %s"
- ) ,
- mp->header.cdid, SRC, DST, mp->dst_telno);
-
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * return address of ACTIVE config entry by controller and channel
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_cc(int ctrlr, int chan)
-{
- int i;
-
- if((chan != CHAN_B1) && (chan != CHAN_B2))
- return(NULL);
-
- for(i=0; i < nentries; i++)
- {
- if((cfg_entry_tab[i].cdid != CDID_UNUSED) &&
- (cfg_entry_tab[i].cdid != CDID_RESERVED) &&
- (cfg_entry_tab[i].isdnchannelused == chan) &&
- (cfg_entry_tab[i].isdncontrollerused == ctrlr) &&
- ((ret_channel_state(ctrlr, chan)) == CHAN_RUN))
- {
- return(&cfg_entry_tab[i]);
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * return address of config entry identified by cdid
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_cdid(int cdid)
-{
- int i;
-
- for(i=0; i < nentries; i++)
- {
- if(cfg_entry_tab[i].cdid == cdid
- || cfg_entry_tab[i].saved_call.cdid == cdid)
- return(&cfg_entry_tab[i]);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * get name of a controller
- *---------------------------------------------------------------------------*/
-const char *
-name_of_controller(int ctrl_type, int card_type)
-{
- static char *passive_card[] = {
- "Teles S0/8",
- "Teles S0/16",
- "Teles S0/16.3",
- "AVM A1 or Fritz!Card",
- "Teles S0/16.3 PnP",
- "Creatix S0 PnP",
- "USRobotics Sportster ISDN TA",
- "Dr. Neuhaus NICCY Go@",
- "Sedlbauer win speed",
- "Dynalink IS64PH",
- "ISDN Master or Blaster",
- "AVM PCMCIA Fritz!Card",
- "ELSA QuickStep 1000pro/ISA",
- "ELSA QuickStep 1000pro/PCI",
- "Siemens I-Talk",
- "ELSA MicroLink ISDN/MC",
- "ELSA MicroLink MCall",
- "ITK ix1 micro"
- };
- static char *daic_card[] = {
- "EICON.Diehl S",
- "EICON.Diehl SX/SXn",
- "EICON.Diehl SCOM",
- "EICON.Diehl QUADRO",
- };
-
- if (ctrl_type == CTRL_PASSIVE) {
- int index = card_type - CARD_TYPEP_8;
- if (index >= 0 && index < (sizeof passive_card / sizeof passive_card[0]))
- return passive_card[index];
- } else if (ctrl_type == CTRL_DAIC) {
- int index = card_type - CARD_TYPEA_DAIC_S;
- if (index >= 0 && index < (sizeof daic_card / sizeof daic_card[0] ))
- return daic_card[index];
- }
-
- return "unknown card type";
-}
-
-/*---------------------------------------------------------------------------*
- * init controller state array
- *---------------------------------------------------------------------------*/
-void
-init_controller(void)
-{
- int i;
- int max = 1;
- msg_ctrl_info_req_t mcir;
-
- for(i=0; i < max; i++)
- {
- mcir.controller = i;
-
- if((ioctl(isdnfd, I4B_CTRL_INFO_REQ, &mcir)) < 0)
- {
- log(LL_ERR, "init_controller: ioctl I4B_CTRL_INFO_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- if((ncontroller = max = mcir.ncontroller) == 0)
- {
- log(LL_ERR, "init_controller: no ISDN controller found!");
- do_exit(1);
- }
-
- if(mcir.ctrl_type == -1 || mcir.card_type == -1)
- {
- log(LL_ERR, "init_controller: ctrl/card is invalid!");
- do_exit(1);
- }
-
- /* init controller tab */
-
- if((init_controller_state(i, mcir.ctrl_type, mcir.card_type, mcir.tei)) == ERROR)
- {
- log(LL_ERR, "init_controller: init_controller_state for controller %d failed", i);
- do_exit(1);
- }
- }
- log(LL_DMN, "init_controller: found %d ISDN controller(s)", max);
-}
-
-/*---------------------------------------------------------------------------*
- * return b channel driver type name string
- *---------------------------------------------------------------------------*/
-char *
-bdrivername(int drivertype)
-{
- static char *bdtab[] = {
- "rbch",
- "tel",
- "ipr",
- "isp"
- };
-
- if(drivertype >= BDRV_RBCH && drivertype <= BDRV_ISPPP)
- return(bdtab[drivertype]);
- else
- return("unknown");
-}
-
-/*---------------------------------------------------------------------------*
- * process AOCD charging messages
- *---------------------------------------------------------------------------*/
-void
-handle_charge(cfg_entry_t *cep)
-{
- time_t now = time(NULL);
-
- if(cep->aoc_last == 0) /* no last timestamp yet ? */
- {
- cep->aoc_last = now; /* add time stamp */
- }
- else if(cep->aoc_now == 0) /* no current timestamp yet ? */
- {
- cep->aoc_now = now; /* current timestamp */
- }
- else
- {
- cep->aoc_last = cep->aoc_now;
- cep->aoc_now = now;
- cep->aoc_diff = cep->aoc_now - cep->aoc_last;
- cep->aoc_valid = AOC_VALID;
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_charge(cep);
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_charge(cep, cep->charge, 0);
-#endif
-
- if(cep->aoc_valid == AOC_VALID)
- {
- if(cep->aoc_diff != cep->unitlength)
- {
- DBGL(DL_MSG, (log(LL_DBG, "handle_charge: AOCD unit length updated %d -> %d secs", cep->unitlength, cep->aoc_diff)));
-
- cep->unitlength = cep->aoc_diff;
-
- unitlen_chkupd(cep);
- }
- else
- {
-#ifdef NOTDEF
- DBGL(DL_MSG, (log(LL_DBG, "handle_charge: AOCD unit length still %d secs", cep->unitlength)));
-#endif
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-void
-unitlen_chkupd(cfg_entry_t *cep)
-{
- msg_timeout_upd_t tupd;
-
-/* XXX check if the values are possible, if not, adjust them */
-
- tupd.cdid = cep->cdid;
- tupd.unitlen_time = cep->unitlength;
- tupd.idle_time = cep->idle_time_out;
- tupd.earlyhup_time = cep->earlyhangup;
-
- if((ioctl(isdnfd, I4B_TIMEOUT_UPD, &tupd)) < 0)
- {
- log(LL_ERR, "ioctl I4B_TIMEOUT_UPD failed: %s", strerror(errno));
- do_exit(1);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * this is intended to be called by do_exit and closes down all
- * active connections before the daemon exits or is reconfigured.
- *--------------------------------------------------------------------------*/
-void
-close_allactive(void)
-{
- int i, j;
- cfg_entry_t *cep = NULL;
-
- j = 0;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
-
- if((ret_channel_state(i, CHAN_B1)) == CHAN_RUN)
- {
- if((cep = get_cep_by_cc(i, CHAN_B1)) != NULL)
- {
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_disconnect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_disconnect(cep);
-#endif
- next_state(cep, EV_DRQ);
- j++;
- }
- }
-
- if((ret_channel_state(i, CHAN_B2)) == CHAN_RUN)
- {
- if((cep = get_cep_by_cc(i, CHAN_B2)) != NULL)
- {
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_disconnect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_disconnect(cep);
-#endif
- next_state(cep, EV_DRQ);
- j++;
- }
- }
- }
-
- if(j)
- {
- log(LL_DMN, "close_allactive: waiting for all connections terminated");
- sleep(5);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * set an interface up
- *--------------------------------------------------------------------------*/
-void
-if_up(cfg_entry_t *cep)
-{
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (log(LL_DBG, "if_up: taking %s%d up", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_ENA;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- log(LL_ERR, "if_up: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- do_exit(1);
- }
- cep->down_retry_count = 0;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_updown(cep, 1);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_updown(cep, 1);
-#endif
-
-}
-
-/*--------------------------------------------------------------------------*
- * set an interface down
- *--------------------------------------------------------------------------*/
-void
-if_down(cfg_entry_t *cep)
-{
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (log(LL_DBG, "if_down: taking %s%d down", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_DIS;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- log(LL_ERR, "if_down: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- do_exit(1);
- }
- cep->went_down_time = time(NULL);
- cep->down_retry_count = 0;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_updown(cep, 0);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_updown(cep, 0);
-#endif
-
-}
-
-/*--------------------------------------------------------------------------*
- * send a dial response to (an interface in) the kernel
- *--------------------------------------------------------------------------*/
-void
-dialresponse(cfg_entry_t *cep, int dstat)
-{
- msg_dialout_resp_t mdr;
-
- static char *stattab[] = {
- "normal condition",
- "temporary failure",
- "permanent failure",
- "dialout not allowed"
- };
-
- if(dstat < DSTAT_NONE || dstat > DSTAT_INONLY)
- {
- log(LL_ERR, "dialresponse: dstat out of range %d!", dstat);
- return;
- }
-
- mdr.driver = cep->usrdevicename;
- mdr.driver_unit = cep->usrdeviceunit;
- mdr.stat = dstat;
-
- if((ioctl(isdnfd, I4B_DIALOUT_RESP, &mdr)) < 0)
- {
- log(LL_ERR, "dialresponse: ioctl I4B_DIALOUT_RESP failed: %s", strerror(errno));
- do_exit(1);
- }
-
- DBGL(DL_DRVR, (log(LL_DBG, "dialresponse: sent [%s]", stattab[dstat])));
-}
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdnd/timer.c b/usr.sbin/i4b/isdnd/timer.c
deleted file mode 100644
index 5534efe70210..000000000000
--- a/usr.sbin/i4b/isdnd/timer.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - timer/timing support routines
- * ------------------------------------------
- *
- * $Id: timer.c,v 1.16 1998/12/05 18:03:43 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:13:10 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static int hr_callgate(void);
-static void handle_reserved(cfg_entry_t *cep, time_t now);
-static void handle_active(cfg_entry_t *cep, time_t now);
-static void recover_illegal(cfg_entry_t *cep);
-
-/*---------------------------------------------------------------------------*
- * recover from illegal state
- *---------------------------------------------------------------------------*/
-static void
-recover_illegal(cfg_entry_t *cep)
-{
- log(LL_ERR, "recover_illegal: ERROR, entry %s attempting disconnect!", cep->name);
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- log(LL_ERR, "recover_illegal: ERROR, entry %s - reset state/cdid!", cep->name);
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * start the timer
- *---------------------------------------------------------------------------*/
-void
-start_timer(cfg_entry_t *cep, int seconds)
-{
- cep->timerval = cep->timerremain = seconds;
-}
-
-/*---------------------------------------------------------------------------*
- * stop the timer
- *---------------------------------------------------------------------------*/
-void
-stop_timer(cfg_entry_t *cep)
-{
- cep->timerval = cep->timerremain = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * callgate for handle_recovery()
- *---------------------------------------------------------------------------*/
-static int
-hr_callgate(void)
-{
- static int tv_first = 1;
- static struct timeval tv_last;
- struct timeval tv_now;
-
- /* there must be 1 sec minimum between calls to this section */
-
- if(tv_first)
- {
- gettimeofday(&tv_last, NULL);
- tv_first = 0;
- }
-
- gettimeofday(&tv_now, NULL);
-
- if((tv_now.tv_sec - tv_last.tv_sec) < 1)
- {
-
- DBGL(DL_TIME, (log(LL_DBG, "time < 1 - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
- return(1);
- }
- else if((tv_now.tv_sec - tv_last.tv_sec) == 1)
- {
- if(((1000000 - tv_last.tv_usec) + tv_now.tv_usec) < 900000)
- {
- DBGL(DL_TIME, (log(LL_DBG, "time < 900000us - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
- return(1);
- }
- }
-
- DBGL(DL_TIME, (log(LL_DBG, "time OK! - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
-
- gettimeofday(&tv_last, NULL);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling
- *---------------------------------------------------------------------------*/
-void
-handle_recovery(void)
-{
- cfg_entry_t *cep = NULL;
- int i;
- time_t now;
-
- if(hr_callgate()) /* last call to handle_recovery < 1 sec ? */
- return; /* yes, exit */
-
- now = time(NULL); /* get current time */
-
- /* walk thru all entries, look for work to do */
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- switch(cep->cdid)
- {
- case CDID_UNUSED: /* entry unused */
- continue;
- break;
-
- case CDID_RESERVED: /* entry reserved */
- handle_reserved(cep, now);
- break;
-
- default: /* entry in use */
- handle_active(cep, now);
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling for active entry
- *---------------------------------------------------------------------------*/
-static void
-handle_active(cfg_entry_t *cep, time_t now)
-{
- switch(cep->state)
- {
- case ST_ACCEPTED:
- if(cep->timerval && (--(cep->timerremain)) <= 0)
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_active: entry %s, TIMEOUT !!!", cep->name)));
- cep->timerval = cep->timerremain = 0;
- next_state(cep, EV_TIMO);
- }
- break;
-
- case ST_ALERT:
- if(cep->alert_time > 0)
- {
- cep->alert_time--;
- }
- else
- {
- log(LL_CHD, "%05d %s answering: incoming call from %s to %s",
- cep->cdid, cep->name,
- cep->real_phone_incoming,
- cep->local_phone_incoming);
- next_state(cep, EV_MCI);
- }
- break;
-
- case ST_ILL:
- recover_illegal(cep);
- break;
-
- default:
- /* check hangup flag: if active, close connection */
-
- if(cep->hangup)
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_active: entry %s, hangup request!", cep->name)));
- cep->hangup = 0;
- next_state(cep, EV_DRQ);
- }
-
- /*
- * if shorthold mode is rates based, check if
- * we entered a time with a new unit length
- */
-
- if(cep->unitlengthsrc == ULSRC_RATE)
- {
- int connecttime = (int)difftime(now, cep->connect_time);
-
- if((connecttime > 1) &&
- (connecttime % 60))
- {
- int newrate = get_current_rate(cep, 0);
-
- if(newrate != cep->unitlength)
- {
- DBGL(DL_MSG, (log(LL_DBG, "handle_active: rates unit length updated %d -> %d", cep->unitlength, newrate)));
-
- cep->unitlength = newrate;
-
- unitlen_chkupd(cep);
- }
- }
- }
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling for reserved entry
- *---------------------------------------------------------------------------*/
-static void
-handle_reserved(cfg_entry_t *cep, time_t now)
-{
- time_t waittime;
-
- switch(cep->state)
- {
- case ST_DIALRTMRCHD: /* wait for dial retry time reached */
-
- if(cep->dialrandincr)
- waittime = cep->randomtime;
- else
- waittime = cep->recoverytime;
-
-
- if(now > (cep->last_dial_time + waittime))
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: entry %s, dial retry request!", cep->name)));
- cep->state = ST_DIALRETRY;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- log(LL_ERR, "handle_reserved: dialretry get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- log(LL_ERR, "handle_reserved: dialretry setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
-
- case ST_ACB_WAITDIAL: /* active callback wait for time between disconnect and dial */
-
- if(now > (cep->last_release_time + cep->callbackwait))
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: entry %s, callback dial!", cep->name)));
- cep->state = ST_ACB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- log(LL_ERR, "handle_reserved: callback get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- select_first_dialno(cep);
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- log(LL_ERR, "handle_reserved: callback setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
- case ST_ACB_DIALFAIL: /* callback to remote failed */
-
- if(cep->dialrandincr)
- waittime = cep->randomtime + cep->recoverytime;
- else
- waittime = cep->recoverytime;
-
- if(now > (cep->last_release_time + waittime))
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: entry %s, callback dial retry request!", cep->name)));
- cep->state = ST_ACB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- log(LL_ERR, "handle_reserved: callback dialretry get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- log(LL_ERR, "handle_reserved: callback dialretry setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
- case ST_PCB_WAITCALL: /* wait for remote calling back */
-
- if(now > (cep->last_release_time + cep->calledbackwait))
- {
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: entry %s, retry calledback dial #%d!",
- cep->name, cep->dial_count)));
- cep->state = ST_PCB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- log(LL_ERR, "handle_reserved: calledback get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- select_next_dialno(cep);
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- log(LL_ERR, "handle_reserved: calledback setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- else
- {
- /* retries exhausted */
-
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: calledback dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- }
- }
- break;
-
- case ST_DOWN: /* interface was taken down */
-
- if(now > (cep->went_down_time + cep->downtime))
- {
- DBGL(DL_RCVRY, (log(LL_DBG, "handle_reserved: taking %s%d up", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
- if_up(cep);
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- }
- break;
-
- case ST_ILL: /* illegal state reached, recover ! */
-
- recover_illegal(cep);
- break;
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/vararray.h b/usr.sbin/i4b/isdnd/vararray.h
deleted file mode 100644
index c71f816ef9ea..000000000000
--- a/usr.sbin/i4b/isdnd/vararray.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Martin Husemann <martin@rumolt.teuto.de>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software withough 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.
- */
-
-/*
- * vararray.h: basic collection macros for variable sized (growing) arrays:
- * macro version of popular C++ template classes,
- * not as elegant in use as the template version,
- * but has maximum runtime performance and can give
- * pointers to array contents (i.e. for ioctl's).
- * Works in C as well as in C++.
- * CAVEAT: in C++ only useable for aggregateable objects,
- * it does use memcpy instead of copy constructors!
- */
-
-#ifndef VARARRAY_H
-#define VARARRAY_H
-/* declare a variable sized array, element type is t */
-#define VARA_DECL(t) struct { int used, allocated; t *data; }
-
-/* aggregate initializer for a variable array */
-#define VARA_INITIALIZER { 0, 0, NULL }
-
-/* free all allocated storage */
-#define VARA_FREE(a) { if ((a).data != NULL) free((a).data); \
- (a).allocated = 0; (a).used = 0; }
-
-/* number of elments currently in array*/
-#define VARA_NUM(a) ((a).used)
-
-/* number of elements already allocated in array */
-#define VARA_ALLOCATED(a) ((a).allocated)
-
-/* pointer to array data */
-#define VARA_PTR(a) ((a).data)
-
-/* empty the array */
-#define VARA_EMPTY(a) { (a).used = 0; }
-
-#ifdef __cplusplus
-#define VARA_NEW(t,c) new t[c]
-#define VARA_DELETE(p) delete [] p
-#else
-#define VARA_NEW(t,c) (t*)malloc(sizeof(t)*(c))
-#define VARA_DELETE(p) free(p)
-#endif
-
-/* add an element (not changing any data).
- * a is the array, i the index,
- * t the element type and n the initial allocation */
-#define VARA_ADD_AT(a,i,t,n) \
-{ \
- if ((i) >= (a).allocated) { \
- int new_alloc = (a).allocated ? (a).allocated*2 : (n); \
- t *new_data; \
- if (new_alloc <= (i)) new_alloc = (i)+1; \
- new_data = VARA_NEW(t, new_alloc); \
- if ((a).data) { \
- memcpy(new_data, (a).data, (a).used*sizeof(t)); \
- VARA_DELETE((a).data); \
- } \
- (a).data = new_data; \
- (a).allocated = new_alloc; \
- } \
- if ((i) >= (a).used) { \
- if (i > (a).used) \
- memset(&((a).data[(a).used]), 0, \
- sizeof(t)*((i)-(a).used+1)); \
- (a).used = (i)+1; \
- } \
-}
-
-/* return an l-value at index i */
-#define VARA_AT(a,i) ((a).data[(i)])
-
-/* iterate through the array */
-#define VARA_FOREACH(a,i) for ((i) = 0; (i) < (a).used; (i)++)
-
-/* check for a valid index */
-#define VARA_VALID(a,i) ((i) >= 0 && (i) < (a).used)
-
-/* remove one entry */
-#define VARA_REMOVEAT(a,i) \
-{ \
- if ((i) < ((a).used -1)) \
- memmove(&((a).data[(i)]), &((a).data[(i)+1]), sizeof((a).data[0])); \
- (a).used--; \
-}
-
-/* free all storage allocated for the array */
-#define VARA_DESTROY(a) \
-{ \
- if ((a).data) VARA_DELETE((a).data); \
- (a).allocated = 0; \
- (a).used = 0; \
- (a).data = NULL; \
-}
-
-#endif
-
diff --git a/usr.sbin/i4b/isdndebug/Makefile b/usr.sbin/i4b/isdndebug/Makefile
deleted file mode 100644
index cf5281871439..000000000000
--- a/usr.sbin/i4b/isdndebug/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-PROG = isdndebug
-SRCS = main.c
-MAN8 = isdndebug.8
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdndebug/isdndebug.8 b/usr.sbin/i4b/isdndebug/isdndebug.8
deleted file mode 100644
index f3903e38b4d3..000000000000
--- a/usr.sbin/i4b/isdndebug/isdndebug.8
+++ /dev/null
@@ -1,102 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdndebug.8,v 1.4 1998/12/05 18:03:47 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:13:34 1998]
-.\"
-.\" -hm writing manual pages
-.\" -hm getting uptodate
-.\"
-.\"
-.Dd July 9, 1998
-.Dt isdndebug 8
-.Sh NAME
-.Nm isdndebug
-.Nd control debugging handling inside isdn4bsd kernel
-.Sh SYNOPSIS
-.Nm
-.Op Fl e
-.Op Fl g
-.Op Fl h
-.Op Fl l Ar layer
-.Op Fl m
-.Op Fl r
-.Op Fl s Ar value
-.Op Fl u Ar unit
-.Op Fl z
-.Op Fl H
-.Sh DESCRIPTION
-.Nm isdndebug
-is part of the isdn4bsd package and is used to control debugging output
-of the isdn4bsd kernel part. Every layer of the isdn4bsd kernel uses a
-debugging mask which can be manipulated using this utility.
-.Pp
-A second usage of
-.Nm
-is to display and reset the HSCX error counters.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl e
-Set debugging mask for the selected layer(s) to display errors only.
-.It Fl g
-Get the debugging mask for the selected layer(s).
-.It Fl h
-Display the the HSCX error counters.
-.It Fl l
-Specify the layer for which a command applies. Default is all layers.
-.It Fl m
-Set debugging mask for the selected layer(s) to display all possible
-debugging messages (maximum output).
-.It Fl r
-Set debugging mask for the selected layer(s) to the compiled in default
-(reset).
-.It Fl s
-Set debugging mask for the selected layer(s) to value. Value can be
-specified in any number base supported by
-.Xr sscanf 3 .
-.It Fl u
-Set the unit numbers for the -h and -H flags.
-.It Fl z
-Set debugging mask for the selected layer(s) to no output at all (zero).
-.It Fl H
-Reset the HSCX error counters to zero.
-.Pp
-.Sh FILES
-/dev/i4bctl
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdndebug -g
-.Ed
-.Pp
-displays the current debugging level for all ISDN layers
-
-.Sh AUTHOR
-The
-.Nm
-utility and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/isdndebug/main.c b/usr.sbin/i4b/isdndebug/main.c
deleted file mode 100644
index 7fdbf7fe1bfe..000000000000
--- a/usr.sbin/i4b/isdndebug/main.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - i4b set debug options
- * ------------------------------
- *
- * $Id: main.c,v 1.13 1998/12/05 18:03:49 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:13:55 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-
-char *bin_str(unsigned long val, int length);
-
-static void usage ( void );
-void printl1(unsigned long val);
-void printl2(unsigned long val);
-void printl3(unsigned long val);
-void printl4(unsigned long val);
-
-static int isdnfd;
-
-#define I4BCTLDEVICE "/dev/i4bctl"
-
-int opt_get = 0;
-int opt_layer = -1;
-int opt_set = 0;
-int opt_setval;
-int opt_reset = 0;
-int opt_max = 0;
-int opt_err = 0;
-int opt_zero = 0;
-int opt_unit = 0;
-int opt_hscx = 0;
-int opt_rhscx = 0;
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int c;
- ctl_debug_t cdbg;
- int ret;
-
- while ((c = getopt(argc, argv, "eghl:mrs:u:zH?")) != EOF)
- {
- switch(c)
- {
- case 'e':
- opt_err = 1;
- break;
-
- case 'g':
- opt_get = 1;
- break;
-
- case 'h':
- opt_hscx = 1;
- break;
-
- case 'r':
- opt_reset = 1;
- break;
-
- case 'm':
- opt_max = 1;
- break;
-
- case 'l':
- opt_layer = atoi(optarg);
- if(opt_layer < 1 || opt_layer > 4)
- usage();
- break;
-
- case 's':
- if((sscanf(optarg, "%i", &opt_setval)) != 1)
- usage();
- opt_set = 1;
- break;
-
- case 'u':
- opt_unit = atoi(optarg);
- if(opt_unit < 0 || opt_unit > 9)
- usage();
- break;
-
- case 'z':
- opt_zero = 1;
- break;
-
- case 'H':
- opt_rhscx = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(opt_get == 0 && opt_set == 0 && opt_reset == 0 && opt_max == 0 &&
- opt_err == 0 && opt_zero == 0 && opt_hscx == 0 && opt_rhscx == 0)
- {
- usage();
- }
-
- if((opt_get + opt_set + opt_reset + opt_max + opt_err + opt_zero +
- opt_hscx + opt_rhscx) > 1)
- {
- usage();
- }
-
- if((isdnfd = open(I4BCTLDEVICE, O_RDWR)) < 0)
- {
- fprintf(stderr, "i4bctl: cannot open %s: %s\n", I4BCTLDEVICE, strerror(errno));
- exit(1);
- }
-
- if(opt_hscx)
- {
- hscxstat_t hst;
-
- hst.unit = opt_unit;
- hst.chan = 0;
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_HSCXSTAT, &hst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_HSCXSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("\nHSCX events: VFR RDO CRC RAB XDU RFO\n");
-
- printf("unit %d chan %d: %6d %6d %6d %6d %6d %6d\n",
- hst.unit, hst.chan,
- hst.vfr, hst.rdo, hst.crc, hst.rab, hst.xdu, hst.rfo);
-
- hst.unit = opt_unit;
- hst.chan = 1;
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_HSCXSTAT, &hst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_HSCXSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("unit %d chan %d: %6d %6d %6d %6d %6d %6d\n",
- hst.unit, hst.chan,
- hst.vfr, hst.rdo, hst.crc, hst.rab, hst.xdu, hst.rfo);
-
- exit(0);
- }
-
- if(opt_rhscx)
- {
- hscxstat_t hst;
-
- hst.unit = opt_unit;
- hst.chan = 0;
-
- if((ret = ioctl(isdnfd, I4B_CTL_CLR_HSCXSTAT, &hst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_CLR_HSCXSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("HSCX event counters unit %d chan %d reset to zero!\n",
- hst.unit, hst.chan);
-
- hst.unit = opt_unit;
- hst.chan = 1;
-
- if((ret = ioctl(isdnfd, I4B_CTL_CLR_HSCXSTAT, &hst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_CLR_HSCXSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("HSCX event counters unit %d chan %d reset to zero!\n",
- hst.unit, hst.chan);
-
- exit(0);
- }
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_DEBUG, &cdbg)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_DEBUG failed: %s", strerror(errno));
- exit(1);
- }
-
- if(opt_get)
- {
- switch(opt_layer)
- {
- case -1:
- printl1(cdbg.l1);
- printl2(cdbg.l2);
- printl3(cdbg.l3);
- printl4(cdbg.l4);
- break;
-
- case 1:
- printl1(cdbg.l1);
- break;
-
- case 2:
- printl2(cdbg.l2);
- break;
-
- case 3:
- printl3(cdbg.l3);
- break;
-
- case 4:
- printl4(cdbg.l4);
- break;
- }
- printf("\n");
- return(0);
- }
- else if(opt_set)
- {
- switch(opt_layer)
- {
- case -1:
- usage();
- break;
-
- case 1:
- cdbg.l1 = opt_setval;
- break;
-
- case 2:
- cdbg.l2 = opt_setval;
- break;
-
- case 3:
- cdbg.l3 = opt_setval;
- break;
-
- case 4:
- cdbg.l4 = opt_setval;
- break;
- }
- }
- else if(opt_reset)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_DEFAULT;
- cdbg.l2 = L2_DEBUG_DEFAULT;
- cdbg.l3 = L3_DEBUG_DEFAULT;
- cdbg.l4 = L4_DEBUG_DEFAULT;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_DEFAULT;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_DEFAULT;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_DEFAULT;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_DEFAULT;
- break;
- }
- }
- else if(opt_max)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_MAX;
- cdbg.l2 = L2_DEBUG_MAX;
- cdbg.l3 = L3_DEBUG_MAX;
- cdbg.l4 = L4_DEBUG_MAX;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_MAX;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_MAX;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_MAX;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_MAX;
- break;
- }
- }
- else if(opt_err)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_ERR;
- cdbg.l2 = L2_DEBUG_ERR;
- cdbg.l3 = L3_DEBUG_ERR;
- cdbg.l4 = L4_DEBUG_ERR;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_ERR;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_ERR;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_ERR;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_ERR;
- break;
- }
- }
- else if(opt_zero)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = 0;
- cdbg.l2 = 0;
- cdbg.l3 = 0;
- cdbg.l4 = 0;
- break;
-
- case 1:
- cdbg.l1 = 0;
- break;
-
- case 2:
- cdbg.l2 = 0;
- break;
-
- case 3:
- cdbg.l3 = 0;
- break;
-
- case 4:
- cdbg.l4 = 0;
- break;
- }
- }
- else
- {
- exit(1);
- }
-
- if((ret = ioctl(isdnfd, I4B_CTL_SET_DEBUG, &cdbg)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_SET_DEBUG failed: %s", strerror(errno));
- exit(1);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * return ptr to string of 1's and 0's for value
- *---------------------------------------------------------------------------*/
-char *
-bin_str(unsigned long val, int length)
-{
- static char buffer[80];
- int i = 0;
-
- if (length > 32)
- length = 32;
-
- val = val << (32 - length);
-
- while (length--)
- {
- if (val & 0x80000000)
- buffer[i++] = '1';
- else
- buffer[i++] = '0';
- if ((length % 4) == 0 && length)
- buffer[i++] = '.';
- val = val << 1;
- }
- return (buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * print l1 info
- *---------------------------------------------------------------------------*/
-void
-printl1(unsigned long val)
-{
- printf("\nLayer 1: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" || |||| |||| ||||\n"),
- printf(" || |||| |||| |||+- general error messages\n");
- printf(" || |||| |||| ||+-- PH primitives exchanged\n");
- printf(" || |||| |||| |+--- B channel actions\n");
- printf(" || |||| |||| +---- HSCX error messages\n");
- printf(" || |||| |||+------ HSCX IRQ messages\n");
- printf(" || |||| ||+------- ISAC error messages\n");
- printf(" || |||| |+-------- ISAC messages\n");
- printf(" || |||| +--------- ISAC setup messages\n");
- printf(" || |||+----------- FSM general messages\n");
- printf(" || ||+------------ FSM error messages\n");
- printf(" || |+------------- timer general messages\n");
- printf(" || +-------------- timer error messages\n");
- printf(" |+---------------- HSCX data xfer errors msgs\n");
- printf(" +----------------- ISAC CICO messages\n");
- printf(" ++++-++++-++++-++++-++------------------ unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l2 info
- *---------------------------------------------------------------------------*/
-void
-printl2(unsigned long val)
-{
- printf("\nLayer 2: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" || |||| |||| ||||\n"),
- printf(" || |||| |||| |||+- general error messages\n");
- printf(" || |||| |||| ||+-- DL primitives exchanged\n");
- printf(" || |||| |||| |+--- U frame messages\n");
- printf(" || |||| |||| +---- U frame error messages\n");
- printf(" || |||| |||+------ S frame messages\n");
- printf(" || |||| ||+------- S frame error messages\n");
- printf(" || |||| |+-------- I frame messages\n");
- printf(" || |||| +--------- I frame error messages\n");
- printf(" || |||+----------- FSM general messages\n");
- printf(" || ||+------------ FSM error messages\n");
- printf(" || |+------------- timer general messages\n");
- printf(" || +-------------- timer error messages\n");
- printf(" |+---------------- TEI general messages\n");
- printf(" +----------------- TEI error messages\n");
- printf(" ++++-++++-++++-++++-++------------------ unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l3 info
- *---------------------------------------------------------------------------*/
-void
-printl3(unsigned long val)
-{
- printf("\nLayer 3: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" ||| |||| ||||\n"),
- printf(" ||| |||| |||+- general error messages\n");
- printf(" ||| |||| ||+-- general messages\n");
- printf(" ||| |||| |+--- FSM messages\n");
- printf(" ||| |||| +---- FSM error messages\n");
- printf(" ||| |||+------ timer messages\n");
- printf(" ||| ||+------- timer error messages\n");
- printf(" ||| |+-------- protocol messages\n");
- printf(" ||| +--------- protocol error messages\n");
- printf(" ||+----------- facility messages\n");
- printf(" |+------------ facility error messages\n");
- printf(" +------------- Q.931 messages exchanged\n");
- printf(" ++++-++++-++++-++++-++++-++------------- unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l4 info
- *---------------------------------------------------------------------------*/
-void
-printl4(unsigned long val)
-{
- printf("\nLayer 4: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" || ||||\n"),
- printf(" || |||+- general error messages\n");
- printf(" || ||+-- general messages\n");
- printf(" || |+--- B-ch timeout messages\n");
- printf(" || +---- network driver dial state\n");
- printf(" |+------ ipr driver debug messages\n");
- printf(" +------- rbch driver debug messages\n");
- printf(" ++++-++++-++++-++++-++++-++++-++-------- unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdndebug - i4b set debug level, version %02d.%02d, compiled %s %s\n", VERSION, REL, __DATE__, __TIME__);
- fprintf(stderr, "usage: isdndebug -e -h -g -l <layer> -m -r -s <value> -u <unit> -z -H\n");
- fprintf(stderr, " -e set error only debugging output\n");
- fprintf(stderr, " -g get current debugging values\n");
- fprintf(stderr, " -h get HSCX event counters\n");
- fprintf(stderr, " -l layer specify layer (1...4)\n");
- fprintf(stderr, " -m set maximum debugging output\n");
- fprintf(stderr, " -r reset values(s) to compiled in default\n");
- fprintf(stderr, " -s value set new debugging value for layer\n");
- fprintf(stderr, " -u unit unit number for -h and -H commands\n");
- fprintf(stderr, " -z set zero (=no) debugging output\n");
- fprintf(stderr, " -H reset HSCX event counters to zero\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/Makefile b/usr.sbin/i4b/isdndecode/Makefile
deleted file mode 100644
index cad9143726a6..000000000000
--- a/usr.sbin/i4b/isdndecode/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-PROG = isdndecode
-SRCS = main.c layer1.c layer2.c layer3.c \
- layer3_subr.c facility.c pcause.c
-MAN8 = isdndecode.8
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/i4b/isdndecode/decode.h b/usr.sbin/i4b/isdndecode/decode.h
deleted file mode 100644
index 0eec0ab90dc9..000000000000
--- a/usr.sbin/i4b/isdndecode/decode.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * decode.h - isdndecode header file
- * ---------------------------------
- *
- * $Id: decode.h,v 1.4 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:10:13 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-
-#include "pcause.h"
-
-#define I4BTRC_DEVICE "/dev/i4btrc" /* trace device file */
-#define DECODE_FILE_NAME "isdndecode" /* default output filename */
-#define DECODE_FILE_NAME_BAK ".last" /* backup filename trailer */
-#define BIN_FILE_NAME "isdntracebin" /* default binary filename */
-
-#define BSIZE 4096 /* read buffer size */
-#define NCOLS 80 /* screen width */
-
-#define RxUDEF 0 /* analyze mode, default unit for receiver side */
-#define TxUDEF 1 /* analyze mode, default unit for transmitter side */
-
-void layer1(char *pbuf, unsigned char *buf);
-int layer2(char *pbuf, unsigned char *buf, int is_te, int printit);
-void layer3(char *pbuf, int n, int off, unsigned char *buf);
-int q932_facility(char *pbuf, unsigned char *buf);
-void sprintline(int, char *, int, int, int, const char *, ...);
-void extension(int, char *, int, unsigned char, unsigned char);
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/facility.c b/usr.sbin/i4b/isdndecode/facility.c
deleted file mode 100644
index 5735abb267f6..000000000000
--- a/usr.sbin/i4b/isdndecode/facility.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * facility.c - decode Q.932 facilities
- * ------------------------------------
- *
- * $Id: facility.c,v 1.2 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:10:32 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-#include "facility.h"
-
-static int do_component(int length, char *pbuf);
-static char *uni_str(int code);
-static char *opval_str(int val);
-static char *bid_str(int val);
-static void next_state(char *pbuf, int class, int form, int code, int val);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-q932_facility(char *pbuf, unsigned char *buf)
-{
- int len;
-
- sprintf((pbuf+strlen(pbuf)), "[facility (Q.932): ");
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- sprintf((pbuf+strlen(pbuf)), "Protocol=");
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- sprintf((pbuf+strlen(pbuf)), "Remote Operations Protocol\n");
- break;
-
- case FAC_PROTO_CMIP:
- sprintf((pbuf+strlen(pbuf)), "CMIP Protocol (Q.941), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- case FAC_PROTO_ACSE:
- sprintf((pbuf+strlen(pbuf)), "ACSE Protocol (X.217/X.227), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "Unknown Protocol (val = 0x%x), UNSUPPORTED!\n", *buf & 0x1f);
- return(len+2);
- break;
- }
-
- /* next byte */
-
- buf++;
- len--;
-
- /* initialize variables for do_component */
-
- byte_len = 0;
- byte_buf = buf;
- state = ST_EXP_COMP_TYP;
-
- /* decode facility */
-
- do_component(len, pbuf);
-
- sprintf((pbuf+(strlen(pbuf)-1)), "]"); /* XXX replace last newline */
-
- return(len+3);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length, char *pbuf)
-{
- int comp_tag_class; /* component tag class */
- int comp_tag_form; /* component form: constructor or primitive */
- int comp_tag_code; /* component code depending on class */
- int comp_length = 0; /* component length */
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "ENTER - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
-again:
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "AGAIN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Tag: ", *byte_buf);
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- sprintf((pbuf+strlen(pbuf)), "Universal");
- break;
- case FAC_TAGCLASS_APW:
- sprintf((pbuf+strlen(pbuf)), "Applic-wide");
- break;
- case FAC_TAGCLASS_COS:
- sprintf((pbuf+strlen(pbuf)), "Context-spec");
- break;
- case FAC_TAGCLASS_PRU:
- sprintf((pbuf+strlen(pbuf)), "Private");
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_form == FAC_TAGFORM_CON)
- {
- sprintf((pbuf+strlen(pbuf)), "Constructor");
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "Primitive");
- }
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_code == 0x1f)
- {
- comp_tag_code = 0;
-
- byte_buf++;
- byte_len++;
-
- while(*byte_buf & 0x80)
- {
- comp_tag_code += (*byte_buf & 0x7f);
- byte_buf++;
- byte_len++;
- }
- comp_tag_code += (*byte_buf & 0x7f);
- sprintf((pbuf+strlen(pbuf)), "%d (ext)\n", comp_tag_code);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
-
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- sprintf((pbuf+strlen(pbuf)), "%s (%d)\n", uni_str(comp_tag_code), comp_tag_code);
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "code = %d\n", comp_tag_code);
- }
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Len: ", *byte_buf);
-
- comp_length = 0;
-
- if(*byte_buf & 0x80)
- {
- int i = *byte_buf & 0x7f;
-
- byte_len += i;
-
- for(;i > 0;i++)
- {
- byte_buf++;
- comp_length += (*byte_buf * (i*256));
- }
- sprintf((pbuf+strlen(pbuf)), "%d (long form)\n", comp_length);
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- sprintf((pbuf+strlen(pbuf)), "%d (short form)\n", comp_length);
- }
-
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- if(comp_length)
- {
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length, pbuf);
- }
- else
- {
- int val = 0;
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- switch(comp_tag_code)
- {
- case FAC_CODEUNI_INT:
- case FAC_CODEUNI_ENUM:
- case FAC_CODEUNI_BOOL:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x ", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "Val: %d\n", val);
- }
- break;
- default:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x = %d", *byte_buf, *byte_buf);
- if(isprint(*byte_buf))
- sprintf((pbuf+strlen(pbuf)), " = '%c'", *byte_buf);
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "\n");
- }
- }
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
- }
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "PREGOTO - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- if(byte_len < length)
- goto again;
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "RETURN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * print universal id type
- *---------------------------------------------------------------------------*/
-static char *uni_str(int code)
-{
- static char *tbl[] = {
- "BOOLEAN",
- "INTEGER",
- "BIT STRING",
- "OCTET STRING",
- "NULL",
- "OBJECT IDENTIFIER",
- "OBJECT DESCRIPTOR",
- "EXTERNAL",
- "REAL",
- "ENUMERATED",
- "RESERVED11",
- "RESERVED12",
- "RESERVED13",
- "RESERVED14",
- "RESERVED15",
- "SEQUENCE",
- "SET",
- "NUMERIC STRING",
- "PRINTABLE STRING",
- "TELETEX STRING",
- "ISO646 STRING",
- "IA5 STRING",
- "GRAPHIC STRING",
- "GENERAL STRING"
- };
-
- if(code >= 1 && code <= FAC_CODEUNI_GNSTR)
- return(tbl[code-1]);
- else
- return("ERROR, Value out of Range!");
-}
-
-/*---------------------------------------------------------------------------*
- * print operation value
- *---------------------------------------------------------------------------*/
-static char *opval_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case FAC_OPVAL_UUS:
- r = "uUs";
- break;
- case FAC_OPVAL_CUG:
- r = "cUGCall";
- break;
- case FAC_OPVAL_MCID:
- r = "mCIDRequest";
- break;
- case FAC_OPVAL_BTPY:
- r = "beginTPY";
- break;
- case FAC_OPVAL_ETPY:
- r = "endTPY";
- break;
- case FAC_OPVAL_ECT:
- r = "eCTRequest";
- break;
- case FAC_OPVAL_DIV_ACT:
- r = "activationDiversion";
- break;
- case FAC_OPVAL_DIV_DEACT:
- r = "deactivationDiversion";
- break;
- case FAC_OPVAL_DIV_ACTSN:
- r = "activationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_DEACTSN:
- r = "deactivationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_INTER:
- r = "interrogationDiversion";
- break;
- case FAC_OPVAL_DIV_INFO:
- r = "diversionInformation";
- break;
- case FAC_OPVAL_DIV_CALLDEF:
- r = "callDeflection";
- break;
- case FAC_OPVAL_DIV_CALLRER:
- r = "callRerouting";
- break;
- case FAC_OPVAL_DIV_LINF2:
- r = "divertingLegInformation2";
- break;
- case FAC_OPVAL_DIV_INVS:
- r = "invokeStatus";
- break;
- case FAC_OPVAL_DIV_INTER1:
- r = "interrogationDiversion1";
- break;
- case FAC_OPVAL_DIV_LINF1:
- r = "divertingLegInformation1";
- break;
- case FAC_OPVAL_DIV_LINF3:
- r = "divertingLegInformation3";
- break;
- case FAC_OPVAL_ER_CRCO:
- r = "explicitReservationCreationControl";
- break;
- case FAC_OPVAL_ER_MGMT:
- r = "explicitReservationManagement";
- break;
- case FAC_OPVAL_ER_CANC:
- r = "explicitReservationCancel";
- break;
- case FAC_OPVAL_MLPP_QUERY:
- r = "mLPP lfb Query";
- break;
- case FAC_OPVAL_MLPP_CALLR:
- r = "mLPP Call Request";
- break;
- case FAC_OPVAL_MLPP_CALLP:
- r = "mLPP Call Preemption";
- break;
- case FAC_OPVAL_AOC_REQ:
- r = "chargingRequest";
- break;
- case FAC_OPVAL_AOC_S_CUR:
- r = "aOCSCurrency";
- break;
- case FAC_OPVAL_AOC_S_SPC:
- r = "aOCSSpecialArrangement";
- break;
- case FAC_OPVAL_AOC_D_CUR:
- r = "aOCDCurrency";
- break;
- case FAC_OPVAL_AOC_D_UNIT:
- r = "aOCDChargingUnit";
- break;
- case FAC_OPVAL_AOC_E_CUR:
- r = "aOCECurrency";
- break;
- case FAC_OPVAL_AOC_E_UNIT:
- r = "aOCEChargingUnit";
- break;
- case FAC_OPVAL_AOC_IDOFCRG:
- r = "identificationOfCharge";
- break;
- case FAC_OPVAL_CONF_BEG:
- r = "beginConf";
- break;
- case FAC_OPVAL_CONF_ADD:
- r = "addConf";
- break;
- case FAC_OPVAL_CONF_SPLIT:
- r = "splitConf";
- break;
- case FAC_OPVAL_CONF_DROP:
- r = "dropConf";
- break;
- case FAC_OPVAL_CONF_ISOLATE:
- r = "isolateConf";
- break;
- case FAC_OPVAL_CONF_REATT:
- r = "reattachConf";
- break;
- case FAC_OPVAL_CONF_PDISC:
- r = "partyDISC";
- break;
- case FAC_OPVAL_CONF_FCONF:
- r = "floatConf";
- break;
- case FAC_OPVAL_CONF_END:
- r = "endConf";
- break;
- case FAC_OPVAL_CONF_IDCFE:
- r = "indentifyConferee";
- break;
- case FAC_OPVAL_REVC_REQ:
- r = "requestREV";
- break;
- default:
- sprintf(buffer, "unknown operation value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * billing id string
- *---------------------------------------------------------------------------*/
-static char *bid_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case 0:
- r = "normalCharging";
- break;
- case 1:
- r = "reverseCharging";
- break;
- case 2:
- r = "creditCardCharging";
- break;
- case 3:
- r = "callForwardingUnconditional";
- break;
- case 4:
- r = "callForwardingBusy";
- break;
- case 5:
- r = "callForwardingNoReply";
- break;
- case 6:
- r = "callDeflection";
- break;
- case 7:
- r = "callTransfer";
- break;
- default:
- sprintf(buffer, "unknown billing-id value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t invokeComponent\n");
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnResult\n");
- state = ST_EXP_RR_INV_ID;
- }
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_3, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnError\n");
- state = ST_EXP_NIX;
- }
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t reject\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RR2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_RR_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_INFO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_RR3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_RR_RESULT;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: RESULT
- *---------------------------------------------------------------------------*/
-static void
-F_RRR(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RRR, val = %d\n", val);
-#endif
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t specificChargingUnits\n");
- state = ST_EXP_RUL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t freeOfCharge\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t chargeNotAvailable\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_5(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_5, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t recordedUnitsList [1]\n");
- state = ST_EXP_RU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_6(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_6, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t RecordedUnits\n");
- state = ST_EXP_RNOU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_7(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_7, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t NumberOfUnits = %d\n", val);
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_8(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_8, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t typeOfChargingInfo = %s\n", val == 0 ? "subTotal" : "total");
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_9(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_9, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t AOCDBillingId = %s (%d)\n", bid_str(val), val);
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * state table
- *---------------------------------------------------------------------------*/
-static struct statetab {
- int currstate; /* input: current state we are in */
- int form; /* input: current tag form */
- int class; /* input: current tag class */
- int code; /* input: current tag code */
- void (*func)(char *,int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-
-/* invoke */
-
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_1_1 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 2, F_1_2 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 3, F_1_3 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 4, F_1_4 },
- {ST_EXP_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_2 },
- {ST_EXP_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_3 },
- {ST_EXP_INFO, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_4 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_NULL, F_4_1 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_4_2 },
- {ST_EXP_RUL, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_5 },
- {ST_EXP_RU, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_6 },
- {ST_EXP_RNOU, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_7 },
- {ST_EXP_TOCI, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_8 },
- {ST_EXP_DBID, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_9 },
-
-/* return result */
-
- {ST_EXP_RR_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR2 },
- {ST_EXP_RR_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR3 },
- {ST_EXP_RR_RESULT, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SET, F_RRR },
-
-/* end */
-
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(char *pbuf, int class, int form, int code, int val)
-{
- int i;
-
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: class=%d, form=%d, code=%d, val=%d\n", class, form, code, val);
-#endif
-
- for(i=0; ; i++)
- {
- if((statetab[i].currstate > state) ||
- (statetab[i].currstate == -1))
- {
- break;
- }
-
- if((statetab[i].currstate == state) &&
- (statetab[i].form == form) &&
- (statetab[i].class == class) &&
- (statetab[i].code == code))
- {
- (*statetab[i].func)(pbuf, val);
- break;
- }
- }
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/facility.h b/usr.sbin/i4b/isdndecode/facility.h
deleted file mode 100644
index 7080c22ccc27..000000000000
--- a/usr.sbin/i4b/isdndecode/facility.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * facility.h - Q.932 facility header file
- * ---------------------------------------
- *
- * $Id: facility.h,v 1.2 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:10:48 1998]
- *
- *---------------------------------------------------------------------------*/
-
-/* #define FAC_DEBUG */
-/* #define ST_DEBUG */
-
-/* protocols */
-#define FAC_PROTO_ROP 0x11
-#define FAC_PROTO_CMIP 0x12
-#define FAC_PROTO_ACSE 0x13
-
-/* tag classes */
-#define FAC_TAGCLASS_UNI 0x00
-#define FAC_TAGCLASS_APW 0x01
-#define FAC_TAGCLASS_COS 0x02
-#define FAC_TAGCLASS_PRU 0x03
-
-/* tag forms */
-#define FAC_TAGFORM_PRI 0x00
-#define FAC_TAGFORM_CON 0x01
-
-/* class UNIVERSAL values */
-#define FAC_CODEUNI_BOOL 1
-#define FAC_CODEUNI_INT 2
-#define FAC_CODEUNI_BITS 3
-#define FAC_CODEUNI_OCTS 4
-#define FAC_CODEUNI_NULL 5
-#define FAC_CODEUNI_OBJI 6
-#define FAC_CODEUNI_OBJD 7
-#define FAC_CODEUNI_EXT 8
-#define FAC_CODEUNI_REAL 9
-#define FAC_CODEUNI_ENUM 10
-#define FAC_CODEUNI_R11 11
-#define FAC_CODEUNI_R12 12
-#define FAC_CODEUNI_R13 13
-#define FAC_CODEUNI_R14 14
-#define FAC_CODEUNI_R15 15
-#define FAC_CODEUNI_SEQ 16
-#define FAC_CODEUNI_SET 17
-#define FAC_CODEUNI_NSTR 18
-#define FAC_CODEUNI_PSTR 19
-#define FAC_CODEUNI_TSTR 20
-#define FAC_CODEUNI_VSTR 21
-#define FAC_CODEUNI_ISTR 22
-#define FAC_CODEUNI_UTIME 23
-#define FAC_CODEUNI_GTIME 24
-#define FAC_CODEUNI_GSTR 25
-#define FAC_CODEUNI_VISTR 26
-#define FAC_CODEUNI_GNSTR 27
-
-/* operation values */
-#define FAC_OPVAL_UUS 1
-#define FAC_OPVAL_CUG 2
-#define FAC_OPVAL_MCID 3
-#define FAC_OPVAL_BTPY 4
-#define FAC_OPVAL_ETPY 5
-#define FAC_OPVAL_ECT 6
-
-#define FAC_OPVAL_DIV_ACT 7
-#define FAC_OPVAL_DIV_DEACT 8
-#define FAC_OPVAL_DIV_ACTSN 9
-#define FAC_OPVAL_DIV_DEACTSN 10
-#define FAC_OPVAL_DIV_INTER 11
-#define FAC_OPVAL_DIV_INFO 12
-#define FAC_OPVAL_DIV_CALLDEF 13
-#define FAC_OPVAL_DIV_CALLRER 14
-#define FAC_OPVAL_DIV_LINF2 15
-#define FAC_OPVAL_DIV_INVS 16
-#define FAC_OPVAL_DIV_INTER1 17
-#define FAC_OPVAL_DIV_LINF1 18
-#define FAC_OPVAL_DIV_LINF3 19
-
-#define FAC_OPVAL_ER_CRCO 20
-#define FAC_OPVAL_ER_MGMT 21
-#define FAC_OPVAL_ER_CANC 22
-
-#define FAC_OPVAL_MLPP_QUERY 24
-#define FAC_OPVAL_MLPP_CALLR 25
-#define FAC_OPVAL_MLPP_CALLP 26
-
-#define FAC_OPVAL_AOC_REQ 30
-#define FAC_OPVAL_AOC_S_CUR 31
-#define FAC_OPVAL_AOC_S_SPC 32
-#define FAC_OPVAL_AOC_D_CUR 33
-#define FAC_OPVAL_AOC_D_UNIT 34
-#define FAC_OPVAL_AOC_E_CUR 35
-#define FAC_OPVAL_AOC_E_UNIT 36
-#define FAC_OPVAL_AOC_IDOFCRG 37
-
-#define FAC_OPVAL_CONF_BEG 40
-#define FAC_OPVAL_CONF_ADD 41
-#define FAC_OPVAL_CONF_SPLIT 42
-#define FAC_OPVAL_CONF_DROP 43
-#define FAC_OPVAL_CONF_ISOLATE 44
-#define FAC_OPVAL_CONF_REATT 45
-#define FAC_OPVAL_CONF_PDISC 46
-#define FAC_OPVAL_CONF_FCONF 47
-#define FAC_OPVAL_CONF_END 48
-#define FAC_OPVAL_CONF_IDCFE 49
-
-#define FAC_OPVAL_REVC_REQ 60
-
-enum states {
- ST_EXP_COMP_TYP,
- ST_EXP_INV_ID,
- ST_EXP_OP_VAL,
- ST_EXP_INFO,
- ST_EXP_RUL,
- ST_EXP_RU,
- ST_EXP_RNOU,
- ST_EXP_TOCI,
- ST_EXP_DBID,
-
- ST_EXP_RR_INV_ID,
- ST_EXP_RR_OP_VAL,
- ST_EXP_RR_RESULT,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/isdndecode.8 b/usr.sbin/i4b/isdndecode/isdndecode.8
deleted file mode 100644
index 85946862b0c4..000000000000
--- a/usr.sbin/i4b/isdndecode/isdndecode.8
+++ /dev/null
@@ -1,190 +0,0 @@
-.\"
-.\" Copyright (c) 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdndecode.8,v 1.3 1998/12/18 17:09:38 hm Exp $
-.\"
-.\" last edit-date: [Fri Dec 18 18:11:31 1998]
-.\"
-.\" -hm writing manual page
-.\"
-.Dd September 17, 1998
-.Dt isdndecode 8
-.Sh NAME
-.Nm isdndecode
-.Nd isdn4bsd ISDN protocol decode utility
-.Sh SYNOPSIS
-.Nm isdndecode
-.Op Fl a
-.Op Fl b
-.Op Fl d
-.Op Fl f Ar filename
-.Op Fl h
-.Op Fl i
-.Op Fl l
-.Op Fl o
-.Op Fl p Ar filename
-.Op Fl u Ar number
-.Op Fl B
-.Op Fl P
-.Op Fl R Ar unit
-.Op Fl T Ar unit
-.Sh DESCRIPTION
-.Nm isdndecode
-is part of the isdn4bsd package and is used to provide the user with a
-detailed mnemonic display of the layers 1, 2 and 3 protocol activities on
-the D channel and hex dump of the B channel(s) activities.
-.Pp
-Together with two passive supported cards and an easy to build cable it can
-also be used to monitor the complete traffic on a S0 bus providing S0 bus
-analyzer features.
-.Pp
-The
-.Nm
-utility is only available for passive supported cards.
-.Pp
-The following options can be used:
-.Bl -tag -width Ds
-
-.It Fl a
-Run
-.Nm
-in analyzer mode by using two passive cards and a custom cable which can
-be build as described in the file
-.Em cable.txt
-in the isdn4bsd source distribution. One card acts as a receiver for the
-transmitting direction on the S0 bus while the other card acts as a receiver
-for the receiving direction on the S0 bus. Complete traffic monitoring is
-possible using this setup.
-
-.It Fl b
-switch B channel tracing on (default off).
-
-.It Fl d
-switch D channel tracing off (default on).
-
-.It Fl f
-Use
-.Ar filename
-as the name of a file into which to write tracing output (default filename is
-isdndecode<n> where n is the number of the unit to decode).
-
-.It Fl h
-switch display of header off (default on).
-
-.It Fl i
-print layer 1 (I.430) INFO signals to monitor layer 1 activity (default off).
-
-.It Fl l
-switch displaying of Layer 2 (Q.921) frames off (default on).
-
-.It Fl o
-switch off writing decode output to a file (default on).
-
-.It Fl p
-Use
-.Ar filename
-as the name of a file used for the -B and -P options (default filename
-is isdntracebin<n> where n is the number of the unit to decode).
-
-.It Fl u
-Use
-.Ar number
-as the unit number of the controller card to decode (default 0).
-
-.It Fl B
-Write undecoded binary decode data to a file for later or remote
-analyzing (default off).
-
-.It Fl P
-Read undecoded binary decode data from file instead from device (default off).
-
-.It Fl R
-Use
-.Ar unit
-as the receiving interface unit number in analyze mode.
-
-.It Fl T
-Use
-.Ar unit
-as the transmitting interface unit number in analyze mode.
-
-.Pp
-When the USR1 signal is sent to a
-.Nm
-process, the currently used logfiles are reopened, so that logfile
-rotation becomes possible.
-.Pp
-The decode output should be obvious. It is very handy to have the following
-standard texts available when tracing ISDN protocols:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I.430
-ISDN BRI layer 1 protocol description.
-.It Ar Q.921
-ISDN D-channel layer 2 protocol description.
-.It Ar Q.931
-ISDN D-channel layer 3 protocol description.
-.El
-.Pp
-
-.Sh FILES
-.Bl -tag -width daddeldi -compact
-.It Pa /dev/i4btrc<n>
-The devicefile(s) used to get the decode messages for ISDN card unit <n>
-out of the kernel.
-.El
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdndecode -f /var/tmp/isdn.decode
-.Ed
-.Pp
-will start D channel tracing on passive controller 0 with all except B
-channel tracing enabled and logs everything into the output file
-/tmp/isdn.decode.
-
-.Sh SEE ALSO
-.Xr isdnd 8
-
-.Sh BUGS
-Still one left.
-
-.Sh STANDARDS
-ITU Recommendations I.430, Q.920, Q.921, Q.930, Q.931
-.Pp
-ITU Recommendation Q.932 (03/93), Q.950 (03/93)
-.Pp
-ETSI Recommendation ETS 300 179 (10/92), ETS 300 180 (10/92)
-.Pp
-ETSI Recommendation ETS 300 181 (04/93), ETS 300 182 (04/93)
-.Pp
-ITU Recommendation X.208, X.209
-
-.Sh AUTHOR
-The
-.Nm
-utility and this manual page was written by Hellmuth Michaelis,
-he can be reached at hm@kts.org.
-
diff --git a/usr.sbin/i4b/isdndecode/layer1.c b/usr.sbin/i4b/isdndecode/layer1.c
deleted file mode 100644
index 8dee4b70ba6b..000000000000
--- a/usr.sbin/i4b/isdndecode/layer1.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer1.c - isdndecode, decode and print layer 1 information
- * -----------------------------------------------------------
- *
- * $Id: layer1.c,v 1.2 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:11:55 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * decode layer 1 information
- *---------------------------------------------------------------------------*/
-void
-layer1(char *buffer, unsigned char *buf)
-{
- switch(*buf)
- {
- case INFO0:
- strcpy(buffer,"L1 INFO0 (No Signal)\n");
- break;
-
- case INFO1_8:
- strcpy(buffer,"L1 INFO1 (Activation Request, Priority = 8)\n");
- break;
-
- case INFO1_10:
- strcpy(buffer,"L1 INFO1 (Activation Request, Priority = 10)\n");
- break;
-
- case INFO2:
- strcpy(buffer,"L1 INFO2 (Pending Activation)\n");
- break;
-
- case INFO3:
- strcpy(buffer,"L1 INFO3 (Synchronized)\n");
- break;
-
- case INFO4_8:
- strcpy(buffer,"L1 INFO4 (Activated, Priority = 8/9)\n");
- break;
-
- case INFO4_10:
- strcpy(buffer,"L1 INFO4 (Activated, Priority = 10/11)\n");
- break;
-
- default:
- sprintf(buffer,"L1 ERROR, invalid INFO value 0x%x!\n", *buf);
- break;
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/layer2.c b/usr.sbin/i4b/isdndecode/layer2.c
deleted file mode 100644
index b7997dd7a965..000000000000
--- a/usr.sbin/i4b/isdndecode/layer2.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer2.c - decode and print layer 2 (Q.921) information
- * -------------------------------------------------------
- *
- * $Id: layer2.c,v 1.3 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:12:09 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * decode poll bit
- *---------------------------------------------------------------------------*/
-static void
-poll(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "P/F, Poll = %s", (value & mask) ? "Immediate Response Required" : "No Immediate Response Required");
-}
-
-/*---------------------------------------------------------------------------*
- * decode final bit
- *---------------------------------------------------------------------------*/
-static void
-final(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "P/F, Final = %s", (value & mask) ? "Result of Poll" : "No Result of Poll");
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol specified in Q.921
- *---------------------------------------------------------------------------*/
-int
-layer2(char *pbuf, unsigned char *buf, int dir, int printit)
-{
- int sap, tei, cmd;
- int cnt = 0;
- char locbuf[32000];
- char *lbufp = &locbuf[0];
- char buffer[80];
-
- *lbufp = '\0';
- *pbuf = '\0';
-
- /* address high */
-
- sap = (buf[0] >> 2) & 0x3f;
-
- if(sap == 0)
- strcpy(buffer, "Call Control");
- else if((sap >= 1) && (sap <= 15))
- strcpy(buffer, "Reserved");
- else if(sap == 16)
- strcpy(buffer, "X.25");
- else if((sap >= 17) && (sap <= 31))
- strcpy(buffer, "Reserved");
- else if(sap == 63)
- strcpy(buffer, "Layer 2 Management");
- else
- strcpy(buffer, "Not available for Q.921");
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[0], 0xfc, "SAPI = %d (%s)", sap, buffer);
-
- if(dir == FROM_TE)
- cmd = !(buf[0] & 0x02);
- else
- cmd = buf[0] & 0x02;
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[0], 0x02, "C/R = %s", cmd ? "Command" : "Response");
- extension(2, lbufp+strlen(lbufp), cnt, buf[0], 0x01);
- cnt++;
-
- /* address low */
-
- tei = buf[1] >> 1;
-
- if((tei >= 0) && (tei <= 63))
- strcpy(buffer, "Non-automatic TEI");
- else if((tei >= 64) && (tei <= 126))
- strcpy(buffer, "Automatic TEI");
- if(tei == 127)
- strcpy(buffer, "Group TEI");
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[1], 0xfe, "TEI = %d (%s)", tei, buffer);
- extension(2, lbufp+strlen(lbufp), cnt, buf[1], 0x01);
- cnt++;
-
- /* control 1 */
-
- if((buf[2] & 0x03) == 0x03)
- {
- /* U-frame */
-
- if((buf[2] & 0xef) == 0x6f)
- {
- /* SABME */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: SABME (Set Asynchonous Balanced Mode)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x0f)
- {
- /* DM */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: DM (Disconnected Mode)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x03)
- {
- /* UI */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: UI (Unnumbered Information)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
-
- if(sap == 63 && (buf[3] == 0x0f)) /* TEI management */
- {
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xff, "MEI (Management Entity Identifier)");
- cnt++;
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[4], 0xff, "Ri = 0x%04x (Reference number high)", (buf[4] << 8) | buf[5]);
- cnt++;
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[5], 0xff, "Ri (Reference Number low)");
- cnt++;
-
- switch(buf[6])
- {
- case 0x01:
- strcpy(buffer, "Identity Request");
- break;
- case 0x02:
- strcpy(buffer, "Identity Assigned");
- break;
- case 0x03:
- strcpy(buffer, "Identity denied");
- break;
- case 0x04:
- strcpy(buffer, "Identity Check Request");
- break;
- case 0x05:
- strcpy(buffer, "Identity Check Response");
- break;
- case 0x06:
- strcpy(buffer, "Identity Remove");
- break;
- case 0x07:
- strcpy(buffer, "Identity Verify");
- break;
- default:
- strcpy(buffer, "undefined");
- break;
- }
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[6], 0xff, "TEI %s (Message Type %d)", buffer, buf[6]);
- cnt++;
-
- switch(buf[6])
- {
- case 0x01:
- strcpy(buffer, "Any TEI value acceptable");
- break;
- case 0x02:
- strcpy(buffer, "");
- break;
- case 0x03:
- strcpy(buffer, "No TEI Value available");
- break;
- case 0x04:
- strcpy(buffer, "Check all TEI values");
- break;
- case 0x05:
- strcpy(buffer, "");
- break;
- case 0x06:
- strcpy(buffer, "Request for removal of all TEI values");
- break;
- case 0x07:
- strcpy(buffer, "");
- break;
- default:
- strcpy(buffer, "");
- break;
- }
- if(((buf[7] >> 1) & 0x7f) == 127)
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[7], 0xfe, "Ai = %d (Action Indicator = %s)", (buf[7] >> 1) & 0x7f, buffer);
- else
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[7], 0xfe, "Ai = %d (Action Indicator)", (buf[7] >> 1) & 0x7f);
- extension(2, lbufp+strlen(lbufp), cnt, buf[7], 0x01);
- cnt++;
- }
- }
- else if((buf[2] & 0xef) == 0x43)
- {
- /* DISC */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: DISC (Disconnect)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x63)
- {
- /* UA */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: UA (Unnumbered Acknowledge)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x87)
- {
- /* FRMR */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: FRMR (Frame Reject)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x9f)
- {
- /* XID */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: XID (Exchange Identification)");
- if(cmd)
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- else
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
-
- }
- else if((buf[2] & 0x03) == 0x01)
- {
- /* S-frame */
-
- if(buf[2] == 0x01)
- strcpy(buffer, "RR (Receiver Ready)");
- else if(buf[2] == 0x05)
- strcpy(buffer, "RNR (Receiver Not Ready)");
- else if(buf[2] == 0x09)
- strcpy(buffer, "REJ (Reject)");
- else
- strcpy(buffer, "Unknown");
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xff, "S-Frame: %s", buffer);
- cnt++;
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xfe, "N(R) = %d (receive sequence number)", (buf[3] >> 1) & 0x7f);
- if(cmd)
- poll(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- else
- final(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- cnt++;
-
- }
- else if((buf[2] & 0x01) == 0x00)
- {
- /* I-frame */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xfe, "N(S) = %d (send sequence number)", (buf[2] >> 1) & 0x7f);
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0x01, "I-Frame: Information transfer");
- cnt++;
-
- sprintf(buffer, "N(R) = %d", (buf[3] >> 1) & 0x7f);
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xfe, "N(R) = %d (receive sequence number)", (buf[3] >> 1) & 0x7f);
- poll(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- cnt++;
-
- }
-
- sprintf((pbuf+strlen(pbuf)),"%s", &locbuf[0]);
- return (cnt);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/layer3.c b/usr.sbin/i4b/isdndecode/layer3.c
deleted file mode 100644
index 6376a139da58..000000000000
--- a/usr.sbin/i4b/isdndecode/layer3.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer3.c - decode and print layer 3 (Q.931) information
- * -------------------------------------------------------
- *
- * $Id: layer3.c,v 1.5 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:12:21 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-char *mttab[] = {
-
-/* 0x00 */ /* call establishment group */
-
- "ESCAPE",
- "ALERTING",
- "CALL PROCEEDING",
- "PROGRESS",
- "undefined (0x04)",
- "SETUP",
- "undefined (0x06)",
- "CONNECT",
- "undefined (0x08)",
- "undefined (0x09)",
- "undefined (0x0a)",
- "undefined (0x0b)",
- "undefined (0x0c)",
- "SETUP ACKNOWLEDGE",
- "undefined (0x0e)",
- "CONNECT ACKNOWLEDGE",
-
-/* 0x10 */
- "undefined (0x10)",
- "undefined (0x11)",
- "undefined (0x12)",
- "undefined (0x13)",
- "undefined (0x14)",
- "undefined (0x15)",
- "undefined (0x16)",
- "undefined (0x17)",
- "undefined (0x18)",
- "undefined (0x19)",
- "undefined (0x1a)",
- "undefined (0x1b)",
- "undefined (0x1c)",
- "undefined (0x1d)",
- "undefined (0x1e)",
- "undefined (0x1f)",
-
-/* 0x20 */
-
- "USER INFORMATION", /* call information phase */
- "SUSPEND REJECT",
- "RESUME REJECT",
- "undefined (0x23)",
- "HOLD",
- "SUSPEND",
- "RESUME",
- "undefined (0x27)",
- "HOLD ACKNOWLEDGE",
- "undefined (0x29)",
- "undefined (0x2a)",
- "undefined (0x2b)",
- "undefined (0x2c)",
- "SUSPEND ACKNOWLEDGE",
- "RESUME ACKNOWLEDGE",
- "undefined (0x2f)",
-
-/* 0x30 */
-
- "HOLD REJECT",
- "RETRIEVE",
- "undefined (0x32)",
- "RETRIEVE ACKNOWLEDGE",
- "undefined (0x34)",
- "undefined (0x35)",
- "undefined (0x36)",
- "RETRIEVE REJECT",
- "undefined (0x38)",
- "undefined (0x39)",
- "undefined (0x3a)",
- "undefined (0x3b)",
- "undefined (0x3c)",
- "undefined (0x3d)",
- "undefined (0x3e)",
- "undefined (0x3f)",
-
-/* 0x40 */
-
- "DETACH", /* call clearing */
- "undefined (0x41)",
- "undefined (0x42)",
- "undefined (0x43)",
- "undefined (0x44)",
- "DISCONNECT",
- "RESTART",
- "undefined (0x47)",
- "DETACH ACKNOWLEDGE",
- "undefined (0x49)",
- "undefined (0x4a)",
- "undefined (0x4b)",
- "undefined (0x4c)",
- "RELEASE",
- "RESTART ACKNOWLEDGE",
- "undefined (0x4f)",
-
-/* 0x50 */
-
- "undefined (0x50)",
- "undefined (0x51)",
- "undefined (0x52)",
- "undefined (0x53)",
- "undefined (0x54)",
- "undefined (0x55)",
- "undefined (0x56)",
- "undefined (0x57)",
- "undefined (0x58)",
- "undefined (0x59)",
- "RELEASE COMPLETE",
- "undefined (0x5b)",
- "undefined (0x5c)",
- "undefined (0x5d)",
- "undefined (0x5e)",
- "undefined (0x5f)",
-
-/* 0x60 */
-
- "SEGMENT", /* misc messages */
- "undefined (0x61)",
- "FACILITY",
- "undefined (0x63)",
- "REGISTER",
- "undefined (0x65)",
- "undefined (0x66)",
- "undefined (0x67)",
- "CANCEL ACKNOWLEDGE",
- "undefined (0x69)",
- "FACILITY ACKNOWLEDGE",
- "undefined (0x6b)",
- "REGISTER ACKNOWLEDGE",
- "undefined (0x6d)",
- "NOTIFY",
- "undefined (0x6f)",
-
-/* 0x70 */
-
- "CANCEL REJECT",
- "undefined (0x71)",
- "FACILITY REJECT",
- "undefined (0x73)",
- "REGISTER REJECT",
- "STATUS ENQIRY",
- "undefined (0x76)",
- "undefined (0x77)",
- "undefined (0x78)",
- "CONGESTION CONTROL",
- "undefined (0x7a)",
- "INFORMATION",
- "undefined (0x7c)",
- "STATUS",
- "undefined (0x7e)",
- "undefined (0x7f)",
-};
-
-#define MTTAB_MAX 0x7f
-
-extern int f_null(char *pbuf, unsigned char *buf, int off);
-extern int f_bc(char *pbuf, unsigned char *buf, int off);
-extern int f_cause(char *pbuf, unsigned char *buf, int off);
-extern int f_cstat(char *pbuf, unsigned char *buf, int off);
-extern int f_chid(char *pbuf, unsigned char *buf, int off);
-extern int f_fac(char *pbuf, unsigned char *buf, int off);
-extern int f_progi(char *pbuf, unsigned char *buf, int off);
-extern int f_displ(char *pbuf, unsigned char *buf, int off);
-extern int f_date(char *pbuf, unsigned char *buf, int off);
-extern int f_cnu(char *pbuf, unsigned char *buf, int off);
-extern int f_cgpn(char *pbuf, unsigned char *buf, int off);
-extern int f_cdpn(char *pbuf, unsigned char *buf, int off);
-extern int f_hlc(char *pbuf, unsigned char *buf, int off);
-
-struct ie {
- unsigned char code; /* information element identifier code */
- char *name; /* ie name */
- int (*func) (char *pbuf, unsigned char *buf, int off); /* decode function */
-} ietab[] = {
- { 0x00, "segmented message", f_null },
- { 0x04, "bearer capability", f_bc },
- { 0x08, "cause", f_cause },
- { 0x0c, "connected address", f_null },
- { 0x0d, "extended facility", f_null },
- { 0x10, "call identity", f_null },
- { 0x14, "call state", f_cstat },
- { 0x18, "channel id", f_chid },
- { 0x19, "data link connection id", f_null },
- { 0x1c, "facility", f_fac },
- { 0x1e, "progress indicator", f_progi },
- { 0x20, "network specific facilities", f_null },
- { 0x24, "terminal capabilities", f_null },
- { 0x27, "notification indicator", f_null },
- { 0x28, "display", f_displ },
- { 0x29, "date/time", f_date },
- { 0x2c, "keypad", f_null },
- { 0x30, "keypad echo", f_null },
- { 0x32, "information request", f_null },
- { 0x34, "signal", f_null },
- { 0x36, "switchhook", f_null },
- { 0x38, "feature activation", f_null },
- { 0x39, "feature indication", f_null },
- { 0x3a, "service profile id", f_null },
- { 0x3b, "endpoint identifier", f_null },
- { 0x40, "information rate", f_null },
- { 0x41, "precedence level", f_null },
- { 0x42, "end-to-end transit delay", f_null },
- { 0x43, "transit delay detection", f_null },
- { 0x44, "packet layer binary parms", f_null },
- { 0x45, "packet layer window size", f_null },
- { 0x46, "packet size", f_null },
- { 0x47, "closed user group", f_null },
- { 0x48, "link layer core parameters", f_null },
- { 0x49, "link layer protocol parms", f_null },
- { 0x4a, "reverse charging information", f_null },
- { 0x4c, "connected number", f_cnu },
- { 0x4d, "connected subaddress", f_null },
- { 0x50, "X.213 priority", f_null },
- { 0x51, "report type", f_null },
- { 0x53, "link integrity verification", f_null },
- { 0x57, "PVC status", f_null },
- { 0x6c, "calling party number", f_cnu },
- { 0x6d, "calling party subaddress", f_null },
- { 0x70, "called party number", f_cnu },
- { 0x71, "called party subaddress", f_null },
- { 0x74, "redirecting number", f_null },
- { 0x78, "transit network selection", f_null },
- { 0x79, "restart indicator", f_null },
- { 0x7c, "low layer compatibility", f_null },
- { 0x7d, "high layer compatibility", f_hlc },
- { 0x7e, "user-user", f_null },
- { 0x7f, "escape for extension", f_null },
- { 0xff, "unknown information element", f_null }
-};
-
-/*---------------------------------------------------------------------------*
- * decode Q.931 protocol
- *---------------------------------------------------------------------------*/
-void
-layer3(char *pbuf, int n, int off, unsigned char *buf)
-{
- char buffer[256];
- int codeset = 0;
- int codelock = 0;
- int oldcodeset = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- i = 0;
-
- /* protocol discriminator */
-
- pd = buf[i];
-
- if(pd >= 0x00 && pd <= 0x07)
- sprintf(buffer, "User-User IE (0x%02x)",pd);
- else if(pd == 0x08)
- sprintf(buffer, "Q.931/I.451");
- else if(pd >= 0x10 && pd <= 0x3f)
- sprintf(buffer, "Other Layer 3 or X.25 (0x%02x)",pd);
- else if(pd >= 0x40 && pd <= 0x4f)
- sprintf(buffer, "National Use (0x%02x)",pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf(buffer, "Other Layer 3 or X.25 (0x%02x)",pd);
- else
- sprintf(buffer, "Reserved (0x%02x)",pd);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, pd, 0xff, "Protocol discriminator = %s", buffer);
- i++;
-
- /* call reference */
-
- len = buf[i] & 0x0f;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xf0, "Call Reference");
-
- switch(len)
- {
- case 0:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 0 (Dummy CR)");
- break;
- case 1:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 1");
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Call Reference sent %s origination side", (buf[i] & 0x80) ? "to" : "from");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Call Reference = %d = 0x%02x", (buf[i] & 0x7f), (buf[i] & 0x7f));
- break;
- case 2:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 2");
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Call Reference sent %s origination side", (buf[i] & 0x80) ? "to" : "from");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Call reference = %d = %02x", (buf[i] & 0x7f));
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Call reference = %d = %02x", (buf[i]));
- break;
- }
- i++;
-
- /* message type */
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Message type extension = %d", buf[i] & 0x80 ? 1 : 0);
-
- if(buf[i] <= MTTAB_MAX)
- strcpy(buffer, mttab[buf[i]]);
- else
- sprintf(buffer, "unknown (0x%02x)", buf[i]);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Message type = %s", buffer);
- i++;
-
- /* information elements */
-
- for (; i < n;)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "%s Information element", buf[i] & 0x80 ? "Single octet" : "Variable length");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element type 1 */
-
- if((buf[i] & 0x70) == 0x00)
- {
- strcpy(buffer, "Reserved");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Reserved");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Reserved, content of IE");
- }
- else if((buf[i] & 0x70) == 0x10)
- {
- strcpy(buffer, "Shift");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Shift");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x08, "%s shift", buf[i] & 0x08 ? "Non-locking" : "Locking");
-
- switch(buf[i] & 0x07)
- {
- case 0:
- strcpy(buffer, "Not applicable");
- break;
- case 1:
- case 2:
- case 3:
- sprintf(buffer, "Reserved (%d)", buf[i] & 0x07);
- break;
- case 4:
- strcpy(buffer, "Codeset 4 (ISO/IEC)");
- break;
- case 5:
- strcpy(buffer, "Codeset 5 (National use)");
- break;
- case 6:
- strcpy(buffer, "Codeset 6 (Local network specific)");
- break;
- case 7:
- strcpy(buffer, "Codeset 7 (User specific)");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x07, "%s", buffer);
- break;
- }
- else if((buf[i] & 0x70) == 0x30)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Congestion Level");
- switch(buf[i] & 0x0f)
- {
- case 0x00:
- strcpy(buffer, "receiver ready");
- break;
- case 0x0f:
- strcpy(buffer, "receiver not ready");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Congestion Level = ", buffer);
- break;
- }
- else if((buf[i] & 0x70) == 0x50)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Repeat Indicator");
- switch(buf[i] & 0x0f)
- {
- case 0x02:
- strcpy(buffer, "Prioritized list for selecting one possibility");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Repeat indication = ", buffer);
- break;
- }
-
- /* single octett info element type 2 */
-
- else if((buf[i] & 0x7f) == 0x20)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "More data");
- }
- else if((buf[i] & 0x7f) == 0x21)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Sending complete");
- }
- else
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "UNKNOWN single octet IE = 0x%02x", buf[i]);
- }
- i++; /* next */
- }
- else
- {
- if(codeset == 0)
- {
- struct ie *iep = &ietab[0];
-
- for(;;)
- {
- if((iep->code == buf[i]) ||
- (iep->code == 0xff))
- break;
- iep++;
- }
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "IE = %s", iep->name);
- sprintline(3, pbuf+strlen(pbuf), off+i+1, buf[i+1], 0xff, "IE Length = %d", buf[i+1]);
-
- if(iep->func == f_null)
- {
- }
- else
- {
- i += (iep->func)(pbuf, &buf[i], off+i);
- goto next;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "UNKNOWN CODESET=%d, IE=0x%02x", codeset, buf[i]);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- sprintf((pbuf+strlen(pbuf)), "LEN=0x%02x, DATA=", len);
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"0x%02x ", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
-/* sprintf((pbuf+strlen(pbuf)),"\n"); */
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/layer3_subr.c b/usr.sbin/i4b/isdndecode/layer3_subr.c
deleted file mode 100644
index e1480b6c6349..000000000000
--- a/usr.sbin/i4b/isdndecode/layer3_subr.c
+++ /dev/null
@@ -1,1045 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer3_subr.c - subroutines for IE decoding
- * -------------------------------------------
- *
- * $Id: layer3_subr.c,v 1.4 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:12:37 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * dummy function
- *---------------------------------------------------------------------------*/
-int
-f_null(char *pbuf, unsigned char *buf, int off)
-{
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_cstat(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Special");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", State=");
-
- switch((buf[i] & 0x3f))
- {
- case 0:
- strcpy(buffer, "Null");
- break;
- case 1:
- strcpy(buffer, "Call initiated");
- break;
- case 2:
- strcpy(buffer, "Overlap sending");
- break;
- case 3:
- strcpy(buffer, "Outgoing call proceeding");
- break;
- case 4:
- strcpy(buffer, "Call delivered");
- break;
- case 6:
- strcpy(buffer, "Call present");
- break;
- case 7:
- strcpy(buffer, "Call received");
- break;
- case 8:
- strcpy(buffer, "Connect request");
- break;
- case 9:
- strcpy(buffer, "Incoming call proceeding");
- break;
- case 10:
- strcpy(buffer, "Active");
- break;
- case 11:
- strcpy(buffer, "Disconnect request");
- break;
- case 12:
- strcpy(buffer, "Disconnect indication");
- break;
- case 15:
- strcpy(buffer, "Suspend request");
- break;
- case 17:
- strcpy(buffer, "Resume request");
- break;
- case 19:
- strcpy(buffer, "Release request");
- break;
- case 22:
- strcpy(buffer, "Call abort");
- break;
- case 25:
- strcpy(buffer, "Overlap receiving");
- break;
- case 0x3d:
- strcpy(buffer, "Restart request");
- break;
- case 0x3e:
- strcpy(buffer, "Restart");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_chid(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x40, "Interface Id present = %s", buf[i] & 0x40 ? "Yes" : "No");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x20, "Interface Type = %s", buf[i] & 0x20 ? "Other (PRI)" : "BRI");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x10, "Spare");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x08, "Channel = %s", buf[i] & 0x08 ? "exclusive" : "preferred");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x04, "Channel is%s the D-Channel", buf[i] & 0x04 ? "" : " not");
-
- switch(buf[i] & 0x03)
- {
- case 0:
- strcpy(buffer, "no channel");
- break;
- case 1:
- strcpy(buffer, "B-1");
- break;
- case 2:
- strcpy(buffer, "B-2");
- break;
- case 3:
- strcpy(buffer, "any channel");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Channel = %s", buffer);
-
- i++;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_fac(char *pbuf, unsigned char *buf, int off)
-{
- return(q932_facility(pbuf, buf));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_progi(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Local");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", Loc=");
-
- switch((buf[i] & 0x0f))
- {
- case 0:
- strcpy(buffer, "User");
- break;
- case 1:
- strcpy(buffer, "Private network serving local user");
- break;
- case 2:
- strcpy(buffer, "Public network serving local user");
- break;
- case 3:
- strcpy(buffer, "Transit network");
- break;
- case 4:
- strcpy(buffer, "Public network serving remote user");
- break;
- case 5:
- strcpy(buffer, "Private network serving remote user");
- break;
- case 6:
- strcpy(buffer, "Network beyond interworking point");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n Description");
-
- switch((buf[i] & 0x7f))
- {
- case 1:
- strcpy(buffer, "Call is not end-to-end ISDN");
- break;
- case 2:
- strcpy(buffer, "Destination address is non-ISDN");
- break;
- case 3:
- strcpy(buffer, "Origination address is non-ISDN");
- break;
- case 4:
- strcpy(buffer, "Call has returned to the ISDN");
- break;
- case 5:
- strcpy(buffer, "Interworking occured, Service change");
- break;
- case 8:
- strcpy(buffer, "In-band info or appropriate pattern now available");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_displ(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int j = 0;
- int len = 0;
-
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_date(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int j = 0;
- int len = 0;
-
- i++;
- len = buf[i];
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Year = %02d", buf[i]);
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Month = %02d", buf[i]);
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Day = %02d", buf[i]);
- i++;
-
- j=3;
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Hour = %02d", buf[i]);
- i++;
- j++;
- }
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Minute = %02d", buf[i]);
- i++;
- j++;
- }
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Second = %02d", buf[i]);
- i++;
- j++;
- }
- i += len;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-int
-f_cause(char *pbuf, unsigned char *buf, int off)
-{
- int j;
- int len;
- int i = 0;
- int ls;
- char buffer[256];
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* coding/location */
- len--;
-
- ls = buf[i];
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((ls & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Local");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding Standard = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x10, "Spare");
-
- switch(ls & 0x0f)
- {
- case 0x00:
- strcpy(buffer, "user");
- break;
- case 0x01:
- strcpy(buffer, "private network serving local user");
- break;
- case 0x02:
- strcpy(buffer, "public network serving local user");
- break;
- case 0x03:
- strcpy(buffer, "transit network");
- break;
- case 0x04:
- strcpy(buffer, "public network serving remote user");
- break;
- case 0x05:
- strcpy(buffer, "private network serving remote user");
- break;
- case 0x07:
- strcpy(buffer, "international network");
- break;
- case 0x0a:
- strcpy(buffer, "network beyond interworking point");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", ls & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Location = %s", buffer);
-
- i++;
- len--;
-
- if(!(ls & 0x80))
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0:
- strcpy(buffer, "Q.931");
- break;
- case 3:
- strcpy(buffer, "X.21");
- break;
- case 4:
- strcpy(buffer, "X.25");
- break;
- case 5:
- strcpy(buffer, "Q.1031/Q.1051");
- break;
- default:
- strcpy(buffer, "Reserved");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Recommendation = %s", buffer);
- i++;
- len--;
- }
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Cause = %s", print_cause_q850(buf[i] & 0x7f));
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "Diagnostics = %02d %s", buf[i+j]);
-
- i += (len+1);
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the bearer capability
- *---------------------------------------------------------------------------*/
-int
-f_bc(char *pbuf, unsigned char *buf, int off)
-{
- int len;
- int i = 0;
- int mr = 0;
- char buffer[256];
-
- i++; /* index -> length */
-
- len = buf[i];
- i++;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "NSI Std");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding standard = %s", buffer);
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- strcpy(buffer, "speech");
- break;
- case 0x08:
- strcpy(buffer, "unrestricted digital information");
- break;
- case 0x09:
- strcpy(buffer, "restricted digital information");
- break;
- case 0x10:
- strcpy(buffer, "3.1 kHz audio");
- break;
- case 0x11:
- strcpy(buffer, "unrestricted digital information with tones");
- break;
- case 0x18:
- strcpy(buffer, "video");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1f, "Capability = %s", buffer);
-
- i++;
- len--;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "circuit");
- break;
- case 2:
- strcpy(buffer, "packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ((buf[i] & 0x60) >> 5));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Mode = %s", buffer);
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- strcpy(buffer, "packet mode");
- break;
- case 0x10:
- strcpy(buffer, "64 kbit/s");
- break;
- case 0x11:
- strcpy(buffer, "2 x 64 kbit/s");
- break;
- case 0x13:
- strcpy(buffer, "384 kbit/s");
- break;
- case 0x15:
- strcpy(buffer, "1536 kbit/s");
- break;
- case 0x17:
- strcpy(buffer, "1920 kbit/s");
- break;
- case 0x18:
- strcpy(buffer, "Multirate");
- mr = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1f, "Rate = %s", buffer);
-
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(mr)
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Rate multiplier = %d", buf[i] & 0x7f);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- sprintf((pbuf+strlen(pbuf)), "\n layer1=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "V.110");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "G.711 u-law");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "G.711 A-law");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "G.721");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "H.221/H.242");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "Non-Std");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "V.120");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "X.31");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n user rate=0x%02x ", buf[i] & 0x1f);
-
- if(buf[i] & 0x40)
- sprintf((pbuf+strlen(pbuf)), "(async,");
- else
- sprintf((pbuf+strlen(pbuf)), "(sync,");
-
- if(buf[i] & 0x20)
- sprintf((pbuf+strlen(pbuf)), "in-band neg. possible)");
- else
- sprintf((pbuf+strlen(pbuf)), "in-band neg not possible)");
-
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n clk/flow=0x%02x", buf[i] & 0x1f);
-
- sprintf((pbuf+strlen(pbuf)), "\n intermediate rate=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "not used");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "8 kbit/s");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "16 kbit/s");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "32 kbit/s");
- break;
- }
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n hdr/mfrm/etc.=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n stop/data/parity=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n modemtype=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=Q.921/I.441");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=X.25 link");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=Q.921/I.441");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=X.25 packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
-exit:
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-int
-f_cnu(char *pbuf, unsigned char *buf, int off)
-{
- int j;
- int len;
- int i = 0;
- int tp;
- int ind = 0;
- char buffer[256];
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> type/plan */
- tp = buf[i];
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- strcpy(buffer, "Unknown");
- break;
- case 1:
- strcpy(buffer, "International number");
- break;
- case 2:
- strcpy(buffer, "National number");
- break;
- case 3:
- strcpy(buffer, "Network specific number");
- break;
- case 4:
- strcpy(buffer, "Subscriber number");
- break;
- case 6:
- strcpy(buffer, "Abbreviated number");
- break;
- default:
- sprintf(buffer, "Reserved (%d), ", ((tp & 0x70) >> 4));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Type = %s", buffer);
-
- switch(tp & 0x0f)
- {
- case 0:
- strcpy(buffer, "Unknown");
- break;
- case 1:
- strcpy(buffer, "ISDN (E.164)");
- break;
- case 3:
- strcpy(buffer, "Data (X.121)");
- break;
- case 4:
- strcpy(buffer, "Telex (F.69)");
- break;
- case 8:
- strcpy(buffer, "National");
- break;
- case 9:
- strcpy(buffer, "Private");
- break;
- default:
- sprintf(buffer, "Reserved (%d)", (tp & 0x0f));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Plan = %s", buffer);
-
- i++;
- len--;
-
- if(!(tp & 0x80))
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "allowed");
- break;
- case 1:
- strcpy(buffer, "restricted");
- break;
- case 2:
- strcpy(buffer, "number not available");
- break;
- case 3:
- strcpy(buffer, "reserved");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Presentation = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1c, "Spare");
-
- switch(ind & 0x03)
- {
- case 0:
- strcpy(buffer, "user provided, not screened");
- break;
- case 1:
- strcpy(buffer, "user provided, verified & passed");
- break;
- case 2:
- strcpy(buffer, "user provided, verified & failed");
- break;
- case 3:
- strcpy(buffer, "network provided");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Screening = %s", buffer);
- i++;
- len--;
- }
-
- for(j = 0; j < len; j++)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "Number digit = %c", buf[i+j]);
- }
-
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print HL comatibility
- *---------------------------------------------------------------------------*/
-int
-f_hlc(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
-
- i++;
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] >> 5) & 0x03)
- {
- case 0: strcpy(buffer, "CCITT");
- break;
- case 1: strcpy(buffer, "ISO/IEC");
- break;
- case 2: strcpy(buffer, "National");
- break;
- case 3: strcpy(buffer, "Network");
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding standard = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1c, "Interpretation = %s", ((buf[i] >> 2) & 0x07) == 0x04 ? "first" : "reserved");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Presentation = %s", ((buf[i]) & 0x03) == 0x01 ? "High layer protocol profile" : "reserved");
-
- i++;
- len--;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0x01:
- strcpy(buffer, "Telephony");
- break;
- case 0x04:
- strcpy(buffer, "Fax Group 2/3 (F.182)");
- break;
- case 0x21:
- strcpy(buffer, "Fax Group 4 I (F.184)");
- break;
- case 0x24:
- strcpy(buffer, "Teletex (F.230) or Fax Group 4 II/III (F.184)");
- break;
- case 0x28:
- strcpy(buffer, "Teletex (F.220)");
- break;
- case 0x31:
- strcpy(buffer, "Teletex (F.200)");
- break;
- case 0x32:
- strcpy(buffer, "Videotex (F.300/T.102)");
- break;
- case 0x33:
- strcpy(buffer, "Videotex (F.300/T.101)");
- break;
- case 0x35:
- strcpy(buffer, "Telex (F.60)");
- break;
- case 0x38:
- strcpy(buffer, "MHS (X.400)");
- break;
- case 0x41:
- strcpy(buffer, "OSI (X.200)");
- break;
- case 0x5e:
- strcpy(buffer, "Maintenance");
- break;
- case 0x5f:
- strcpy(buffer, "Management");
- break;
- case 0x60:
- strcpy(buffer, "Audio visual (F.721)");
- break;
- default:
- sprintf(buffer, "Reserved (0x%02x)", buf[i] & 0x7f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Characteristics = %s", buffer);
- i++;
- len--;
-
- if(buf[i-1] & 0x80)
- {
- return(i);
- }
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0x01:
- strcpy(buffer, "Telephony");
- break;
- case 0x04:
- strcpy(buffer, "Fax Group 2/3 (F.182)");
- break;
- case 0x21:
- strcpy(buffer, "Fax Group 4 I (F.184)");
- break;
- case 0x24:
- strcpy(buffer, "Teletex (F.230) or Fax Group 4 II/III (F.184)");
- break;
- case 0x28:
- strcpy(buffer, "Teletex (F.220)");
- break;
- case 0x31:
- strcpy(buffer, "Teletex (F.200)");
- break;
- case 0x32:
- strcpy(buffer, "Videotex (F.300/T.102)");
- break;
- case 0x33:
- strcpy(buffer, "Videotex (F.300/T.101)");
- break;
- case 0x35:
- strcpy(buffer, "Telex (F.60)");
- break;
- case 0x38:
- strcpy(buffer, "MHS (X.400)");
- break;
- case 0x41:
- strcpy(buffer, "OSI (X.200)");
- break;
- case 0x5e:
- strcpy(buffer, "Maintenance");
- break;
- case 0x5f:
- strcpy(buffer, "Management");
- break;
- case 0x60:
- strcpy(buffer, "Audio visual (F.721)");
- break;
- default:
- sprintf(buffer, "Reserved (0x%02x)", buf[i] & 0x7f);
- break;
-
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Ext. characteristics = %s", buffer);
- i++;
- return(i);
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/main.c b/usr.sbin/i4b/isdndecode/main.c
deleted file mode 100644
index a73d708d0bde..000000000000
--- a/usr.sbin/i4b/isdndecode/main.c
+++ /dev/null
@@ -1,774 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - isdndecode main program file
- * -------------------------------------
- *
- * $Id: main.c,v 1.6 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:12:52 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-unsigned char buf[BSIZE];
-FILE *Fout = NULL;
-FILE *BP = NULL;
-int outflag = 1;
-int header = 1;
-int print_q921 = 1;
-int unit = 0;
-int dchan = 0;
-int bchan = 0;
-int traceon = 0;
-int analyze = 0;
-int Rx = RxUDEF;
-int Tx = TxUDEF;
-int f;
-int Bopt = 0;
-int Popt = 0;
-int bpopt = 0;
-int info = 0;
-
-static char outfilename[1024];
-static char BPfilename[1024];
-
-static void dumpbuf( int n, unsigned char *buf, i4b_trace_hdr_t *hdr);
-static int switch_driver( int value, int rx, int tx );
-static void usage( void );
-static void exit_hdl( void );
-static void reopenfiles( int );
-
-/*---------------------------------------------------------------------------*
- * main
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char *argv[])
-{
- extern int optind;
- extern int opterr;
- extern char *optarg;
- char devicename[80];
- char headerbuf[256];
-
- int n;
- int c;
- char *b;
-
- int enable_trace = TRACE_D_RX | TRACE_D_TX;
- char *outfile = DECODE_FILE_NAME;
- char *binfile = BIN_FILE_NAME;
- int outfileset = 0;
- time_t tm;
-
- i4b_trace_hdr_t *ithp = NULL;
- int l;
-
- b = &buf[sizeof(i4b_trace_hdr_t)];
-
- while( (c = getopt(argc, argv, "abdf:hiln:op:u:BPR:T:?")) != EOF)
- {
- switch(c)
- {
- case 'a':
- analyze = 1;
- break;
-
- case 'b':
- enable_trace |= (TRACE_B_RX | TRACE_B_TX);
- break;
-
- case 'd':
- enable_trace &= (~(TRACE_D_TX | TRACE_D_RX));
- break;
-
- case 'o':
- outflag = 0;
- break;
-
- case 'f':
- outfile = optarg;
- outfileset = 1;
- break;
-
- case 'h':
- header = 0;
- break;
-
- case 'i':
- enable_trace |= TRACE_I;
- info = 1;
- break;
-
- case 'l':
- print_q921 = 0;
- break;
-
- case 'p':
- binfile = optarg;
- bpopt = 1;
- break;
-
- case 'u':
- unit = atoi(optarg);
- if(unit < 0 || unit >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'B':
- Bopt = 1;
- break;
-
- case 'P':
- Popt = 1;
- break;
-
- case 'R':
- Rx = atoi(optarg);
- if(Rx < 0 || Rx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'T':
- Tx = atoi(optarg);
- if(Tx < 0 || Tx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(enable_trace == 0)
- usage();
-
- if(Bopt && Popt)
- usage();
-
- atexit(exit_hdl);
-
- if(Bopt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(BP);
- sprintf(buffer, "%s%s", BPfilename, DECODE_FILE_NAME_BAK);
- rename(BPfilename, buffer);
- }
- if((BP = fopen(BPfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Popt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
- else
- {
- sprintf(devicename, "%s%d", I4BTRC_DEVICE, unit);
-
- if((f = open(devicename, O_RDWR)) < 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening trace device [%s]", devicename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(outflag)
- {
- if(outfileset == 0)
- sprintf(outfilename, "%s%d", DECODE_FILE_NAME, unit);
- else
- strcpy(outfilename, outfile);
-
-
- if((Fout = fopen(outfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(Fout);
- sprintf(buffer, "%s%s", outfilename, DECODE_FILE_NAME_BAK);
- rename(outfilename, buffer);
- }
-
- if((Fout = fopen(outfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", outfile);
- perror(buffer);
- exit(1);
- }
- }
-
- if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting stdout to line-buffered");
- perror(buffer);
- exit(1);
- }
-
- if(!Popt)
- {
- if((switch_driver(enable_trace, Rx, Tx)) == -1)
- exit(1);
- else
- traceon = 1;
- }
-
- signal(SIGHUP, SIG_IGN); /* ignore hangup signal */
- signal(SIGUSR1, reopenfiles); /* rotate logfile(s) */
-
- time(&tm);
-
- if(analyze)
- {
- sprintf(headerbuf, "\n==== isdnanalyze controller rx #%d - tx #%d ==== started %s",
- Rx, Tx, ctime(&tm));
- }
- else
- {
- sprintf(headerbuf, "\n=========== isdntrace controller #%d =========== started %s",
- unit, ctime(&tm));
- }
-
- printf("%s", headerbuf);
-
- if(outflag)
- fprintf(Fout, "%s", headerbuf);
-
- for (;;)
- {
- if(Popt == 0)
- {
- n = read(f, buf, BSIZE);
-
- if(Bopt)
- {
- if((fwrite(buf, 1, n, BP)) != n)
- {
- char buffer[80];
- sprintf(buffer, "Error writing file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- n -= sizeof(i4b_trace_hdr_t);
- }
- else
- {
- if((fread(buf, 1, sizeof(i4b_trace_hdr_t), BP)) != sizeof(i4b_trace_hdr_t))
- {
- if(feof(BP))
- {
- printf("\nEnd of playback input file reached.\n");
- exit(0);
- }
- else
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- ithp = (i4b_trace_hdr_t *)buf;
- l = ithp->length - sizeof(i4b_trace_hdr_t);
-
- if((n = fread(buf+sizeof(i4b_trace_hdr_t), 1, l , BP)) != l)
- {
- char buffer[80];
- sprintf(buffer, "Error reading data from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- }
-
- if(n > 0)
- {
- dumpbuf(n, b, (i4b_trace_hdr_t *)buf);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * format header into static buffer, return buffer address
- *---------------------------------------------------------------------------*/
-char *
-fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len)
-{
- struct tm *s;
- static char hbuf[256];
- int i = 0;
-
- s = localtime(&(hdr->time.tv_sec));
-
- if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */
- {
- sprintf(hbuf,"\n-- %s - unit:%d ---------------- time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec);
- }
- else
- {
- if(hdr->trunc > 0)
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d (%d) ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len,
- hdr->trunc);
- }
- else
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len);
- }
- }
-
- for(i=strlen(hbuf); i <= NCOLS;)
- hbuf[i++] = '-';
-
- hbuf[i++] = '\n';
- hbuf[i] = '\0';
-
- return(hbuf);
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol and output to file(s)
- *---------------------------------------------------------------------------*/
-static void
-dumpbuf(int n, unsigned char *buf, i4b_trace_hdr_t *hdr)
-{
- static char l1buf[128];
- static unsigned char l2buf[32000];
- static unsigned char l3buf[32000];
- int cnt;
- int nsave = n;
- char *pbuf;
- int i, j;
-
- l1buf[0] = '\0';
- l2buf[0] = '\0';
- l3buf[0] = '\0';
-
- switch(hdr->type)
- {
- case TRC_CH_I: /* Layer 1 INFO's */
- layer1(l1buf, buf);
- break;
-
- case TRC_CH_D: /* D-channel data */
- cnt = layer2(l2buf, buf, hdr->dir, print_q921);
-
- n -= cnt;
- buf += cnt;
-
- if(n)
- layer3(l3buf, n, cnt, buf);
- break;
-
- default: /* B-channel data */
-
- pbuf = &l2buf[0];
-
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"B%d:%.3x ", hdr->type, i);
-
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
-
- sprintf((pbuf+strlen(pbuf))," ");
-
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
-
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- break;
- }
-
- if(header && ((l1buf[0] != '\0' || l2buf[0] != '\0') || (l3buf[0] != 0)))
- {
- char *p;
- p = fmt_hdr(hdr, nsave);
- printf("%s", p);
- if(outflag)
- fprintf(Fout, "%s", p);
- }
-
- if(l1buf[0] != '\0')
- {
- printf("%s", l1buf);
- if(outflag)
- fprintf(Fout, "%s", l1buf);
- }
-
- if(l2buf[0] != '\0')
- {
- printf("%s", l2buf);
- if(outflag)
- fprintf(Fout, "%s", l2buf);
- }
-
- if(l3buf[0] != '\0')
- {
- printf("%s", l3buf);
- if(outflag)
- fprintf(Fout, "%s", l3buf);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * exit handler function to be called at program exit
- *---------------------------------------------------------------------------*/
-void
-exit_hdl()
-{
- if(traceon)
- switch_driver(TRACE_OFF, Rx, Tx);
-}
-
-/*---------------------------------------------------------------------------*
- * switch driver debugging output on/off
- *---------------------------------------------------------------------------*/
-static int
-switch_driver(int value, int rx, int tx)
-{
- char buffer[80];
- int v = value;
-
- if(analyze == 0)
- {
- if(ioctl(f, I4B_TRC_SET, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SET, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- if(value == TRACE_OFF)
- {
- if(ioctl(f, I4B_TRC_RESETA, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_RESETA - ");
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- i4b_trace_setupa_t tsa;
-
- tsa.rxunit = rx;
- tsa.rxflags = value;
- tsa.txunit = tx;
- tsa.txflags = value;
-
- if(ioctl(f, I4B_TRC_SETA, &tsa) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SETA, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * reopen files to support rotating logfile(s) on SIGUSR1
- *
- * based on an idea from Ripley (ripley@nostromo.in-berlin.de)
- *
- * close file and reopen it for append. this will be a nop
- * if the previously opened file hasn't moved but will open
- * a new one otherwise, thus enabling a rotation...
- *
- *---------------------------------------------------------------------------*/
-static void
-reopenfiles(int dummy)
-{
- if(outflag)
- {
- fclose(Fout);
-
- if((Fout = fopen(outfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", outfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Bopt)
- {
-
- fclose(BP);
-
- if((BP = fopen(BPfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * decode extension bit
- *---------------------------------------------------------------------------*/
-void
-extension(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "Extension Bit = %c (%s)",
- (value & mask) ? '1' : '0',
- (value & mask) ? "no extension, final octet" : "with extension, octet follows");
-}
-
-/*---------------------------------------------------------------------------*
- * print bits as 0/1 available for mask
- *---------------------------------------------------------------------------*/
-static char *
-print_bits(unsigned char val, unsigned char mask)
-{
- static char buffer[10];
- int i = 0;
- int length = 8;
-
- while(length--)
- {
- if(mask & 0x80)
- {
- if(val & 0x80)
- buffer[i++] = '1';
- else
- buffer[i++] = '0';
- }
- else
- {
- buffer[i++] = '-';
- }
- val = val << 1;
- mask = mask << 1;
- }
- buffer[i] = '\0';
- return(buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * print one decoded output line
- *---------------------------------------------------------------------------*/
-void
-sprintline(int layer, char *buffer, int oct_count, int oct_val,
- int oct_mask, const char *fmt, ...)
-{
- char lbuffer[256];
- static int lastcount = -1;
- char *ptr;
- va_list ap;
-
- va_start(ap, fmt);
-
- if(oct_count != lastcount)
- {
- lastcount = oct_count;
-
- sprintf(lbuffer, "L%d %2d %02X %s ",
- layer,
- oct_count,
- oct_val,
- print_bits(oct_val, oct_mask));
- }
- else
- {
- sprintf(lbuffer, " %s ",
- print_bits(oct_val, oct_mask));
- }
-
- vsprintf(lbuffer+strlen(lbuffer), fmt, ap);
-
- va_end(ap);
-
- sprintf(lbuffer+strlen(lbuffer), "\n");
-
- if((ptr = rindex(lbuffer, '(')) != NULL)
- {
- char *s = lbuffer;
- char *b = buffer;
- int len = strlen(lbuffer);
- int i;
-
- for(s = lbuffer; s < ptr; *b++ = *s++)
- ;
- for(i = 0;(i+len) <= NCOLS; *b++ = ' ', i++)
- ;
- for(; *s; *b++ = *s++)
- ;
- *b = '\0';
- }
- else
- {
- strcpy(buffer, lbuffer);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * usage intructions
- *---------------------------------------------------------------------------*/
-void
-usage(void)
-{
- fprintf(stderr,"\n");
- fprintf(stderr,"isdndecode - isdn4bsd package ISDN decoder for passive cards (%02d.%02d)\n", VERSION, REL);
- fprintf(stderr,"usage: isdntrace -a -b -d -f <file> -h -i -l -n <val> -o -p <file> -r -u <unit>\n");
- fprintf(stderr," -B -P -R <unit> -T <unit>\n");
- fprintf(stderr," -a analyzer mode ................................... (default off)\n");
- fprintf(stderr," -b switch B channel trace on ....................... (default off)\n");
- fprintf(stderr," -d switch D channel trace off ....................... (default on)\n");
- fprintf(stderr," -f <file> write output to file filename ............ (default %s0)\n", DECODE_FILE_NAME);
- fprintf(stderr," -h don't print header for each message ............. (default off)\n");
- fprintf(stderr," -i print I.430 (layer 1) INFO signals .............. (default off)\n");
- fprintf(stderr," -l don't decode low layer Q.921 messages ........... (default off)\n");
- fprintf(stderr," -o don't write output to a file .................... (default off)\n");
- fprintf(stderr," -p <file> specify filename for -B and -P ........ (default %s0)\n", BIN_FILE_NAME);
- fprintf(stderr," -u <unit> specify controller unit number ............... (default unit 0)\n");
- fprintf(stderr," -B write binary trace data to file filename ........ (default off)\n");
- fprintf(stderr," -P playback from binary trace data file ............ (default off)\n");
- fprintf(stderr," -R <unit> analyze Rx controller unit number (for -a) ... (default unit %d)\n", RxUDEF);
- fprintf(stderr," -T <unit> analyze Tx controller unit number (for -a) ... (default unit %d)\n", TxUDEF);
- fprintf(stderr,"\n");
- exit(1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/pcause.c b/usr.sbin/i4b/isdndecode/pcause.c
deleted file mode 100644
index 9c5535e21e12..000000000000
--- a/usr.sbin/i4b/isdndecode/pcause.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause.c - printing cause values
- * --------------------------------
- *
- * $Id: pcause.c,v 1.3 1998/12/23 10:03:55 hm Exp $
- *
- * last edit-date: [Wed Dec 23 10:59:54 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-#include "pcause.h"
-
-char *
-print_cause_q850(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_Q850_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_Q850_NUNALLC:
- e = "Unallocated (unassigned) number";
- break;
-
- case CAUSE_Q850_NRTTN:
- e = "No route to specified transit network";
- break;
-
- case CAUSE_Q850_NRTDST:
- e = "No route to destination";
- break;
-
- case CAUSE_Q850_SSINFTN:
- e = "Send special information tone";
- break;
-
- case CAUSE_Q850_MDIALTP:
- e = "Misdialled trunk prefix";
- break;
-
- case CAUSE_Q850_CHUNACC:
- e = "Channel unacceptable";
- break;
-
- case CAUSE_Q850_CALLAWD:
- e = "Call awarded and being delivered in an established channel";
- break;
-
- case CAUSE_Q850_PREEMPT:
- e = "Preemption";
- break;
-
- case CAUSE_Q850_PREECRR:
- e = "Preemption - circuit reserved for reuse";
- break;
-
- case CAUSE_Q850_NCCLR:
- e = "Normal call clearing";
- break;
-
- case CAUSE_Q850_USRBSY:
- e = "User busy";
- break;
-
- case CAUSE_Q850_NOUSRRSP:
- e = "No user responding";
- break;
-
- case CAUSE_Q850_NOANSWR:
- e = "No answer from user (user alerted)";
- break;
-
- case CAUSE_Q850_SUBSABS:
- e = "Subscriber absent";
- break;
-
- case CAUSE_Q850_CALLREJ:
- e = "Call rejected";
- break;
-
- case CAUSE_Q850_NUCHNG:
- e = "Number changed";
- break;
-
- case CAUSE_Q850_NONSELUC:
- e = "Non-selected user clearing";
- break;
-
- case CAUSE_Q850_DSTOOORDR:
- e = "Destination out of order";
- break;
-
- case CAUSE_Q850_INVNUFMT:
- e = "Invalid number format";
- break;
-
- case CAUSE_Q850_FACREJ:
- e = "Facility rejected";
- break;
-
- case CAUSE_Q850_STENQRSP:
- e = "Response to STATUS ENQUIRY";
- break;
-
- case CAUSE_Q850_NORMUNSP:
- e = "Normal, unspecified";
- break;
-
- case CAUSE_Q850_NOCAVAIL:
- e = "No circuit / channel available";
- break;
-
- case CAUSE_Q850_NETOOORDR:
- e = "Network out of order";
- break;
-
- case CAUSE_Q850_PFMCDOOSERV:
- e = "Permanent frame mode connection out of service";
- break;
-
- case CAUSE_Q850_PFMCOPER:
- e = "Permanent frame mode connection operational";
- break;
-
- case CAUSE_Q850_TMPFAIL:
- e = "Temporary failure";
- break;
-
- case CAUSE_Q850_SWEQCONG:
- e = "Switching equipment congestion";
- break;
-
- case CAUSE_Q850_ACCINFDIS:
- e = "Access information discarded";
- break;
-
- case CAUSE_Q850_REQCNOTAV:
- e = "Requested circuit/channel not available";
- break;
-
- case CAUSE_Q850_PRECALBLK:
- e = "Precedence call blocked";
- break;
-
- case CAUSE_Q850_RESUNAVAIL:
- e = "Resources unavailable, unspecified";
- break;
-
- case CAUSE_Q850_QOSUNAVAIL:
- e = "Quality of service unavailable";
- break;
-
- case CAUSE_Q850_REQSERVNS:
- e = "Requested facility not subscribed";
- break;
-
- case CAUSE_Q850_OCBARRCUG:
- e = "Outgoing calls barred within CUG";
- break;
-
- case CAUSE_Q850_ICBARRCUG:
- e = "Incoming calls barred within CUG";
- break;
-
- case CAUSE_Q850_BCAPNAUTH:
- e = "Bearer capability not authorized";
- break;
-
- case CAUSE_Q850_BCAPNAVAIL:
- e = "Bearer capability not presently available";
- break;
-
- case CAUSE_Q850_INCSTOACISC:
- e = "Inconsistenciy in designated outg. access info and subscriber class";
- break;
-
- case CAUSE_Q850_SOONOTAVAIL:
- e = "Service or option not available, unspecified";
- break;
-
- case CAUSE_Q850_BCAPNOTIMPL:
- e = "Bearer capability not implemented";
- break;
-
- case CAUSE_Q850_CHTYPNIMPL:
- e = "Channel type not implemented";
- break;
-
- case CAUSE_Q850_REQFACNIMPL:
- e = "Requested facility not implemented";
- break;
-
- case CAUSE_Q850_ORDINBCAVL:
- e = "Only restricted digital information bearer capability is available";
- break;
-
- case CAUSE_Q850_SOONOTIMPL:
- e = "Service or option not implemented, unspecified";
- break;
-
- case CAUSE_Q850_INVCLRFVAL:
- e = "Invalid call reference value";
- break;
-
- case CAUSE_Q850_IDCHDNOEX:
- e = "Identified channel does not exist";
- break;
-
- case CAUSE_Q850_SUSCAEXIN:
- e = "A suspended call exists, but this call identity does not";
- break;
-
- case CAUSE_Q850_CLIDINUSE:
- e = "Call identity in use";
- break;
-
- case CAUSE_Q850_NOCLSUSP:
- e = "No call suspended";
- break;
-
- case CAUSE_Q850_CLIDCLRD:
- e = "Call having the requested call identity has been cleared";
- break;
-
- case CAUSE_Q850_UNOTMEMCUG:
- e = "User not member of CUG";
- break;
-
- case CAUSE_Q850_INCDEST:
- e = "Incompatible destination";
- break;
-
- case CAUSE_Q850_NONEXCUG:
- e = "Non-existent CUG";
- break;
-
- case CAUSE_Q850_INVNTWSEL:
- e = "Invalid transit network selection";
- break;
-
- case CAUSE_Q850_INVMSG:
- e = "Invalid message, unspecified";
- break;
-
- case CAUSE_Q850_MIEMISS:
- e = "Mandatory information element is missing";
- break;
-
- case CAUSE_Q850_MSGTNI:
- e = "Message type non-existent or not implemented";
- break;
-
- case CAUSE_Q850_MSGNCMPT:
- e = "Msg incompatible with call state/message type non-existent/not implemented";
- break;
-
- case CAUSE_Q850_IENENI:
- e = "Information element/parameter non-existent or not implemented";
- break;
-
- case CAUSE_Q850_INVIEC:
- e = "Invalid information element contents";
- break;
-
- case CAUSE_Q850_MSGNCWCS:
- e = "Message not compatible with call state";
- break;
-
- case CAUSE_Q850_RECOTIMEXP:
- e = "Recovery on timer expiry";
- break;
-
- case CAUSE_Q850_PARMNENIPO:
- e = "Parameter non-existent or not implemented, passed on";
- break;
-
- case CAUSE_Q850_MSGUNRDPRM:
- e = "Message with unrecognized parameter, discarded";
- break;
-
- case CAUSE_Q850_PROTERR:
- e = "Protocol error, unspecified";
- break;
-
- case CAUSE_Q850_INTWRKU:
- e = "Interworking, unspecified";
- break;
-
- default:
- e = "ERROR, unknown cause value!";
- break;
- }
-
- sprintf(error_message, "%d: %s (Q.850)", code, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/pcause.h b/usr.sbin/i4b/isdndecode/pcause.h
deleted file mode 100644
index 6b6627bf358b..000000000000
--- a/usr.sbin/i4b/isdndecode/pcause.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause.h - Q.850 causes definitions
- * -----------------------------------
- *
- * $Id: pcause.h,v 1.2 1998/12/18 17:09:38 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:13:23 1998]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_q850(unsigned char code);
-
-/* Q.850 causes */
-
-#define CAUSE_Q850_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_Q850_NUNALLC 0x01 /* Unallocated (unassigned) number */
-#define CAUSE_Q850_NRTTN 0x02 /* No route to specified transit network */
-#define CAUSE_Q850_NRTDST 0x03 /* No route to destination */
-#define CAUSE_Q850_SSINFTN 0x04 /* Send special information tone */
-#define CAUSE_Q850_MDIALTP 0x05 /* Misdialled trunk prefix */
-#define CAUSE_Q850_CHUNACC 0x06 /* Channel unacceptable */
-#define CAUSE_Q850_CALLAWD 0x07 /* Call awarded and being delivered in an established channel */
-#define CAUSE_Q850_PREEMPT 0x08 /* Preemption */
-#define CAUSE_Q850_PREECRR 0x09 /* Preemption - circuit reserved for reuse */
-#define CAUSE_Q850_NCCLR 0x10 /* Normal call clearing */
-#define CAUSE_Q850_USRBSY 0x11 /* User busy */
-#define CAUSE_Q850_NOUSRRSP 0x12 /* No user responding */
-#define CAUSE_Q850_NOANSWR 0x13 /* No answer from user (user alerted) */
-#define CAUSE_Q850_SUBSABS 0x14 /* Subscriber absent */
-#define CAUSE_Q850_CALLREJ 0x15 /* Call rejected */
-#define CAUSE_Q850_NUCHNG 0x16 /* Number changed */
-#define CAUSE_Q850_NONSELUC 0x1A /* Non-selected user clearing */
-#define CAUSE_Q850_DSTOOORDR 0x1B /* Destination out of order */
-#define CAUSE_Q850_INVNUFMT 0x1C /* Invalid number format */
-#define CAUSE_Q850_FACREJ 0x1D /* Facility rejected */
-#define CAUSE_Q850_STENQRSP 0x1E /* Response to STATUS ENQUIRY */
-#define CAUSE_Q850_NORMUNSP 0x1F /* Normal, unspecified */
-#define CAUSE_Q850_NOCAVAIL 0x22 /* No circuit / channel available */
-#define CAUSE_Q850_NETOOORDR 0x26 /* Network out of order */
-#define CAUSE_Q850_PFMCDOOSERV 0x27 /* Permanent frame mode connection out of service */
-#define CAUSE_Q850_PFMCOPER 0x28 /* Permanent frame mode connection operational */
-#define CAUSE_Q850_TMPFAIL 0x29 /* Temporary failure */
-#define CAUSE_Q850_SWEQCONG 0x2A /* Switching equipment congestion */
-#define CAUSE_Q850_ACCINFDIS 0x2B /* Access information discarded */
-#define CAUSE_Q850_REQCNOTAV 0x2C /* Requested circuit/channel not available */
-#define CAUSE_Q850_PRECALBLK 0x2E /* Precedence call blocked */
-#define CAUSE_Q850_RESUNAVAIL 0x2F /* Resources unavailable, unspecified */
-#define CAUSE_Q850_QOSUNAVAIL 0x31 /* Quality of service unavailable */
-#define CAUSE_Q850_REQSERVNS 0x32 /* Requested facility not subscribed */
-#define CAUSE_Q850_OCBARRCUG 0x35 /* Outgoing calls barred within CUG */
-#define CAUSE_Q850_ICBARRCUG 0x36 /* Incoming calls barred within CUG */
-#define CAUSE_Q850_BCAPNAUTH 0x39 /* Bearer capability not authorized */
-#define CAUSE_Q850_BCAPNAVAIL 0x3A /* Bearer capability not presently available */
-#define CAUSE_Q850_INCSTOACISC 0x3E /* Inconsistenciy in designated outgoing access information and subscriber class */
-#define CAUSE_Q850_SOONOTAVAIL 0x3F /* Service or option not available, unspecified */
-#define CAUSE_Q850_BCAPNOTIMPL 0x41 /* Bearer capability not implemented */
-#define CAUSE_Q850_CHTYPNIMPL 0x42 /* Channel type not implemented */
-#define CAUSE_Q850_REQFACNIMPL 0x45 /* Requested facility not implemented */
-#define CAUSE_Q850_ORDINBCAVL 0x46 /* Only restricted digital information bearer capability is available */
-#define CAUSE_Q850_SOONOTIMPL 0x4F /* Service or option not implemented, unspecified */
-#define CAUSE_Q850_INVCLRFVAL 0x51 /* Invalid call reference value */
-#define CAUSE_Q850_IDCHDNOEX 0x52 /* Identified channel does not exist */
-#define CAUSE_Q850_SUSCAEXIN 0x53 /* A suspended call exists, but this call identity does not */
-#define CAUSE_Q850_CLIDINUSE 0x54 /* Call identity in use */
-#define CAUSE_Q850_NOCLSUSP 0x55 /* No call suspended */
-#define CAUSE_Q850_CLIDCLRD 0x56 /* Call having the requested call identity has been cleared */
-#define CAUSE_Q850_UNOTMEMCUG 0x57 /* User not member of CUG */
-#define CAUSE_Q850_INCDEST 0x58 /* Incompatible destination */
-#define CAUSE_Q850_NONEXCUG 0x5A /* Non-existent CUG */
-#define CAUSE_Q850_INVNTWSEL 0x5B /* Invalid transit network selection */
-#define CAUSE_Q850_INVMSG 0x5F /* Invalid message, unspecified */
-#define CAUSE_Q850_MIEMISS 0x60 /* Mandatory information element is missing */
-#define CAUSE_Q850_MSGTNI 0x61 /* Message type non-existent or not implemented */
-#define CAUSE_Q850_MSGNCMPT 0x62 /* Message not compatible with call state or message type non-existent or not implemented */
-#define CAUSE_Q850_IENENI 0x63 /* Information element/parameter non-existent or not implemented */
-#define CAUSE_Q850_INVIEC 0x64 /* Invalid information element contents */
-#define CAUSE_Q850_MSGNCWCS 0x65 /* Message not compatible with call state */
-#define CAUSE_Q850_RECOTIMEXP 0x66 /* Recovery on timer expiry */
-#define CAUSE_Q850_PARMNENIPO 0x67 /* Parameter non-existent or not implemented, passed on */
-#define CAUSE_Q850_MSGUNRDPRM 0x6E /* Message with unrecognized parameter, discarded */
-#define CAUSE_Q850_PROTERR 0x6F /* Protocol error, unspecified */
-#define CAUSE_Q850_INTWRKU 0x7F /* Interworking, unspecified */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnmonitor/Makefile b/usr.sbin/i4b/isdnmonitor/Makefile
deleted file mode 100644
index 9d3811b7a74c..000000000000
--- a/usr.sbin/i4b/isdnmonitor/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG = isdnmonitor
-SRCS = main.c
-MAN8 = isdnmonitor.8
-
-# compile debug support
-COPTS += -DDEBUG
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdnmonitor/isdnmonitor.8 b/usr.sbin/i4b/isdnmonitor/isdnmonitor.8
deleted file mode 100644
index 9bcb7836fafe..000000000000
--- a/usr.sbin/i4b/isdnmonitor/isdnmonitor.8
+++ /dev/null
@@ -1,40 +0,0 @@
-.\" Copyright (c) 1998 Martin Husemann <martin@rumolt.teuto.de>
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software withough 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.
-.\"
-.\" $Id: isdnmonitor.8,v 1.2 1998/08/10 13:55:29 hm Exp $
-.\"
-.\" last edit-date: [Fri Jan 30 22:49:48 1998]
-.\"
-.\" -mh writing manual pages
-.\"
-.\"
-.Dd April 18, 1998
-.Dt isdnmonitor 8
-.Sh NAME
-.Nm isdnmonitor
-.Nd raw sample and test client for isdnd network monitoring
-.Sh DESCRIPTION
-The
-.Nm
-is not intended for real world use. It will be replaced
-by something with a better user interface as soon as the monitoring
-subsystem is functional.
diff --git a/usr.sbin/i4b/isdnmonitor/main.c b/usr.sbin/i4b/isdnmonitor/main.c
deleted file mode 100644
index 73ae8fe01f86..000000000000
--- a/usr.sbin/i4b/isdnmonitor/main.c
+++ /dev/null
@@ -1,675 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor client
- * -----------------------------------
- *
- * $Id: main.c,v 1.9 1998/10/27 10:54:23 hm Exp $
- *
- * last edit-date: [Tue Oct 27 11:53:12 1998]
- *
- * -mh created
- * -hm checking in
- * -hm porting to HPUX
- * -mh all events the fullscreen mode displays now as monitor event
- *
- *---------------------------------------------------------------------------*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#include <unistd.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <machine/i4b_ioctl.h>
-
-#ifdef __hpux
-#define AF_LOCAL AF_UNIX
-#endif
-
-#ifdef DEBUG
-#include <ctype.h>
-#endif
-
-#include "monitor.h"
-
-/*
- * Local function prototypes
- */
-static int connect_local(const char *sockpath);
-static int connect_remote(const char *host, int portno);
-static void usage();
-static void mloop();
-static void handle_input();
-static void print_menu();
-static void print_logevent(time_t tstamp, int prio, const char * what, const char * msg);
-static void print_charge(time_t tstamp, int channel, int units, int estimated);
-static void print_connect(time_t tstamp, int dir, int channel, const char * cfgname, const char * devname, const char * remphone, const char * locphone);
-static void print_disconnect(time_t tstamp, int channel);
-static void print_updown(time_t tstamp, int channel, int isup);
-static void handle_event(BYTE *msg, int len);
-#ifdef DEBUG
-static void dump_event(BYTE *msg, int len);
-#endif
-
-/*
- * Global variables
- */
-static int dumpall = 0;
-static int monsock = -1;
-static int state = 0;
-static int sub_state = 0;
-static int sub_state_count = 0;
-
-static int major = 0;
-static int minor = 0;
-static int nctrl = 0;
-static u_int32_t rights = 0;
-
-/*
- * Parse command line, startup monitor client
- */
-int main(int argc, char **argv)
-{
- char * sockpath = NULL;
- char * hostname = NULL;
- int portno = DEF_MONPORT;
- int i;
-
- while ((i = getopt(argc, argv, "dh:p:l:")) != EOF)
- {
- switch (i)
- {
- case 'd':
- dumpall = 1;
- break;
- case 'h':
- hostname = optarg;
- break;
- case 'l':
- sockpath = optarg;
- break;
- case 'p':
- if ((sscanf(optarg, "%i", &portno)) != 1)
- usage();
- break;
- default:
- usage();
- break;
- }
- }
-
- if (hostname && sockpath)
- {
- fprintf(stderr, "Error: can not use local socket path on remote machine\n"
- "conflicting options -h and -l!\n");
- return 1;
- }
-
- if (sockpath)
- {
- monsock = connect_local(sockpath);
- }
- else if (hostname)
- {
- monsock = connect_remote(hostname, portno);
- }
- else
- {
- usage();
- }
-
- if (monsock == -1)
- {
- fprintf(stderr, "Could not connect to i4b isdn daemon.\n");
- return 1;
- }
-
- signal(SIGPIPE, SIG_IGN);
- mloop();
-
- close(monsock);
-
- return 0;
-}
-
-/*
- * Display usage and exit
- */
-static void usage()
-{
- fprintf(stderr, "usage:\n"
- " isdnmonitor [-d] -h (host) -p (port)\n"
- "or\n"
- " isdnmonitor [-d] -l (path)\n"
- "where (host) is the hostname and (port) the port number of\n"
- "the isdnd to be monitored and (path) is the pathname of the\n"
- "local domain socket used to communicate with a daemon on the\n"
- "local machine.\n"
- "Options are:\n"
- " -d dump all incoming packets as hexdump\n"
- );
- exit(0);
-}
-
-/*
- * Connect via tcp/ip.
- * Return socket if successfull, -1 on error.
- */
-static int connect_remote(const char *host, int portno)
-{
- struct sockaddr_in sa;
- struct hostent *h;
- int remotesockfd;
-
- h = gethostbyname(host);
-
- if (!h)
- {
- fprintf(stderr, "could not resolve hostname '%s'\n", host);
- exit(1);
- }
-
- remotesockfd = socket(AF_INET, SOCK_STREAM, 0);
-
- if (remotesockfd == -1)
- {
- fprintf(stderr, "could not create remote monitor socket: %s\n", strerror(errno));
- exit(1);
- }
-
- memset(&sa, 0, sizeof sa);
-
-#ifdef BSD4_4
- sa.sin_len = sizeof sa;
-#endif
- sa.sin_family = AF_INET;
- sa.sin_port = htons(portno);
-
- memcpy(&sa.sin_addr.s_addr, h->h_addr_list[0], sizeof sa.sin_addr.s_addr);
-
- if (connect(remotesockfd, (struct sockaddr *)&sa, sizeof sa) == -1)
- {
- fprintf(stderr, "could not connect remote monitor: %s\n", strerror(errno));
- exit(1);
- }
-
- return remotesockfd;
-}
-
-/*
- * Connect local.
- * Return socket on success, -1 on failure.
- */
-static int connect_local(const char *sockpath)
-{
- int s;
- struct sockaddr_un sa;
-
- /* check path length */
- if (strlen(sockpath) >= sizeof sa.sun_path)
- {
- fprintf(stderr, "pathname to long for local socket: %s\n",
- sockpath);
- exit(1);
- }
-
- /* create and setup socket */
- s = socket(AF_LOCAL, SOCK_STREAM, 0);
-
- if (s == -1)
- {
- fprintf(stderr, "could not create local monitor socket:%s\n", strerror(errno));
- exit(1);
- }
-
- memset(&sa, 0, sizeof sa);
-
-#ifndef __hpux
- sa.sun_len = sizeof sa;
-#endif
-
- sa.sun_family = AF_LOCAL;
- strcpy(sa.sun_path, sockpath);
-
- if (connect(s, (struct sockaddr *)&sa, sizeof sa))
- {
- fprintf(stderr, "could not connect local monitor socket [%s]: %s\n", sockpath, strerror(errno));
- }
-
- return s;
-}
-
-/*
- * main event loop
- */
-static void mloop()
-{
- for (;;)
- {
- fd_set rd, wr, ex;
-
- FD_ZERO(&rd);
- FD_ZERO(&wr);
- FD_ZERO(&ex);
- FD_SET(fileno(stdin), &rd);
- FD_SET(monsock, &rd);
-
- select(monsock+1, &rd, &wr, &ex, NULL);
-
- if (FD_ISSET(fileno(stdin), &rd))
- {
- handle_input();
- }
-
- if (FD_ISSET(monsock, &rd))
- {
- BYTE buf[1024];
- u_long u;
- int bytes, ret;
-
- /* Network transfer may deliver two or more packets concatenated.
- * Peek at the header and read only one event at a time... */
-
- ioctl(monsock, FIONREAD, &u);
-
- if (u < I4B_MON_EVNT_HDR)
- continue; /* not enough data there yet */
-
- bytes = recv(monsock, buf, I4B_MON_EVNT_HDR, MSG_PEEK);
-
- if (bytes < I4B_MON_EVNT_HDR)
- continue; /* errh? something must be wrong... */
-
- bytes = I4B_GET_2B(buf, I4B_MON_EVNT_LEN);
-
- if (bytes >= sizeof buf)
- break;
-
- /* now we know the size, it fits, so lets read it! */
-
- ret = read(monsock, buf, bytes);
-
- if (ret == 0)
- {
- printf("remote isdnd has closed our connection\n");
- break;
- }
- else if (ret < 0)
- {
- printf("error reading from isdnd: %s", strerror(errno));
- break;
- }
-#ifdef DEBUG
- if (dumpall)
- dump_event(buf, ret);
-#endif
- handle_event(buf, ret);
- }
- }
-}
-
-#ifdef DEBUG
-/*
- * Dump a complete event packet.
- */
-static void dump_event(BYTE *msg, int len)
-{
- int i;
-
- printf("event dump:");
-
- for (i = 0; i < len; i++)
- {
- if (i % 8 == 0)
- printf("\n%02x: ", i);
- printf("%02x %c ", msg[i], isprint(msg[i]) ? msg[i] : '.');
- }
- printf("\n");
-}
-#endif
-
-static void print_logevent(time_t tstamp, int prio, const char * what, const char * msg)
-{
- char buf[256];
- strftime(buf, sizeof buf, I4B_TIME_FORMAT, localtime(&tstamp));
- printf("log: %s prio %d what=%s msg=%s\n",
- buf, prio, what, msg);
-}
-
-static void print_charge(time_t tstamp, int channel, int units, int estimated)
-{
- char buf[256];
- strftime(buf, sizeof buf, I4B_TIME_FORMAT, localtime(&tstamp));
- printf("%s: channel %d, charge = %d%s\n",
- buf, channel, units, estimated ? " (estimated)" : "");
-}
-
-/*
- * Print a connect event.
- * A real monitor would allocate state info for "channel" on this
- * event.
- */
-static void print_connect(
- time_t tstamp, /* server time of event */
- int outgoing, /* 0 = incoming, 1 = outgoing */
- int channel, /* channel no, used to identify this connection until disconnect */
- const char * cfgname, /* name of config entry/connection */
- const char * devname, /* device used (e.g. isp0) */
- const char * remphone, /* phone no of remote side */
- const char * locphone) /* local phone no */
-{
- char buf[256];
- strftime(buf, sizeof buf, I4B_TIME_FORMAT, localtime(&tstamp));
-
- if (outgoing)
- printf("%s: calling out to '%s' [from msn: '%s']",
- buf, remphone, locphone);
- else
- printf("%s: incoming call from '%s' [to msn: '%s']",
- buf, remphone, locphone);
- printf(", channel %d, config '%s' on device '%s'\n",
- channel, cfgname, devname);
-}
-
-/*
- * Print a disconnect event.
- * A real monitor could free the "per connection" state
- * for this channel now
- */
-static void print_disconnect(time_t tstamp, int channel)
-{
- char buf[256];
- strftime(buf, sizeof buf, I4B_TIME_FORMAT, localtime(&tstamp));
- printf("%s: channel %d disconnected\n",
- buf, channel);
-}
-
-/*
- * Print an up- or down event
- */
-static void print_updown(time_t tstamp, int channel, int isup)
-{
- char buf[256];
- strftime(buf, sizeof buf, I4B_TIME_FORMAT, localtime(&tstamp));
- printf("%s: channel %d is %s\n",
- buf, channel, isup ? "up" : "down");
-}
-
-/*
- * Dispatch one message received from the daemon.
- */
-static void handle_event(BYTE *msg, int len)
-{
- BYTE cmd[I4B_MON_ICLIENT_SIZE];
- int local;
- u_int32_t net;
- u_int32_t mask;
- u_int32_t who;
-
- switch (state)
- {
- case 0: /* initial data */
-
- major = I4B_GET_2B(msg, I4B_MON_IDATA_VERSMAJOR);
- minor = I4B_GET_2B(msg, I4B_MON_IDATA_VERSMINOR);
- nctrl = I4B_GET_2B(msg, I4B_MON_IDATA_NUMCTRL);
- rights = I4B_GET_4B(msg, I4B_MON_IDATA_CLACCESS);
-
- printf("remote protocol version is %02d.%02d, %d controller(s) found, our rights = %x\n",
- major, minor, nctrl, rights);
-
- if (nctrl > 0)
- {
- state = 1;
- sub_state = 0;
- }
- else
- {
- state = 2;
-
- /* show menu for the first time */
- print_menu();
- }
-
- /* set maximum event mask */
- I4B_PREP_CMD(cmd, I4B_MON_CCMD_SETMASK);
- I4B_PUT_2B(cmd, I4B_MON_ICLIENT_VERMAJOR, MPROT_VERSION);
- I4B_PUT_2B(cmd, I4B_MON_ICLIENT_VERMINOR, MPROT_REL);
- I4B_PUT_4B(cmd, I4B_MON_ICLIENT_EVENTS, ~0U);
-
- write(monsock, cmd, sizeof cmd);
-
- break;
-
- case 1: /* initial controller list */
- printf("controller %d: %s\n", sub_state++, msg+I4B_MON_ICTRL_NAME);
-
- if (sub_state >= nctrl)
- {
- state = 2; /* end of list reached */
- sub_state = 0;
-
- /* show menu for the first time */
- print_menu();
- }
- break;
-
- case 2: /* any event */
-
- switch (I4B_GET_2B(msg, I4B_MON_EVNT))
- {
- case I4B_MON_DRINI_CODE:
- state = 3; /* list of rights entries will follow */
- sub_state = 0;
- sub_state_count = I4B_GET_2B(msg, I4B_MON_DRINI_COUNT);
- printf("monitor rights:\n");
- break;
-
- case I4B_MON_DCINI_CODE:
- state = 4;
- sub_state = 0;
- sub_state_count = I4B_GET_2B(msg, I4B_MON_DCINI_COUNT);
- printf("monitor connections:\n");
- break;
-
- case I4B_MON_LOGEVNT_CODE:
- print_logevent(I4B_GET_4B(msg, I4B_MON_LOGEVNT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_LOGEVNT_PRIO),
- msg+I4B_MON_LOGEVNT_WHAT,
- msg+I4B_MON_LOGEVNT_MSG);
- break;
-
- case I4B_MON_CHRG_CODE:
- print_charge(I4B_GET_4B(msg, I4B_MON_CHRG_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_CHRG_CHANNEL),
- I4B_GET_4B(msg, I4B_MON_CHRG_UNITS),
- I4B_GET_4B(msg, I4B_MON_CHRG_ESTIMATED));
- break;
-
- case I4B_MON_CONNECT_CODE:
- print_connect(
- I4B_GET_4B(msg, I4B_MON_CONNECT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_CONNECT_DIR),
- I4B_GET_4B(msg, I4B_MON_CONNECT_CHANNEL),
- msg+I4B_MON_CONNECT_CFGNAME,
- msg+I4B_MON_CONNECT_DEVNAME,
- msg+I4B_MON_CONNECT_REMPHONE,
- msg+I4B_MON_CONNECT_LOCPHONE);
- break;
-
- case I4B_MON_DISCONNECT_CODE:
- print_disconnect(
- I4B_GET_4B(msg, I4B_MON_DISCONNECT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_DISCONNECT_CHANNEL));
- break;
-
- case I4B_MON_UPDOWN_CODE:
- print_updown(
- I4B_GET_4B(msg, I4B_MON_UPDOWN_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_UPDOWN_CHANNEL),
- I4B_GET_4B(msg, I4B_MON_UPDOWN_ISUP));
- break;
-
- default:
- printf("unknown event code: %d\n", I4B_GET_2B(msg, I4B_MON_EVNT));
- }
- break;
-
- case 3: /* one record in a list of monitor rights */
- rights = I4B_GET_4B(msg, I4B_MON_DR_RIGHTS);
- net = I4B_GET_4B(msg, I4B_MON_DR_NET);
- mask = I4B_GET_4B(msg, I4B_MON_DR_MASK);
- local = I4B_GET_1B(msg, I4B_MON_DR_LOCAL);
-
- if (local)
- {
- printf("\tlocal: rights = %x\n", rights);
- }
- else
- {
- printf("\tfrom: %d.%d.%d.%d, mask %d.%d.%d.%d, rights = %x\n",
- (net >> 24) & 0x00ff, (net >> 16) & 0x00ff, (net >> 8) & 0x00ff, net & 0x00ff,
- (mask >> 24) & 0x00ff, (mask >> 16) & 0x00ff, (mask >> 8) & 0x00ff, mask & 0x00ff,
- rights);
- }
-
- sub_state++;
-
- if (sub_state >= sub_state_count)
- {
- state = 2;
- print_menu();
- }
- break;
-
- case 4:
- who = I4B_GET_4B(msg, I4B_MON_DC_WHO);
- rights = I4B_GET_4B(msg, I4B_MON_DC_RIGHTS);
-
- printf("\tfrom: %d.%d.%d.%d, rights = %x\n",
- (who >> 24) & 0x00ff, (who >> 16) & 0x00ff, (who >> 8) & 0x00ff, who & 0x00ff,
- rights);
-
- sub_state++;
-
- if (sub_state >= sub_state_count)
- {
- state = 2;
- print_menu();
- }
- break;
-
- default:
- printf("unknown event from remote: local state = %d, evnt = %x, len = %d\n",
- state, I4B_GET_2B(msg, I4B_MON_EVNT), len);
- }
-}
-
-/*
- * Process input from user
- */
-static void handle_input()
-{
- char buf[1024];
- int channel;
-
- fgets(buf, sizeof buf, stdin);
-
- switch (atoi(buf))
- {
- case 1:
- {
- BYTE cmd[I4B_MON_DUMPRIGHTS_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_DUMPRIGHTS_CODE);
- write(monsock, cmd, I4B_MON_DUMPRIGHTS_SIZE);
- }
- break;
-
- case 2:
- {
- BYTE cmd[I4B_MON_DUMPMCONS_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_DUMPMCONS_CODE);
- write(monsock, cmd, I4B_MON_DUMPMCONS_SIZE);
- }
- break;
-
- case 3:
- {
- BYTE cmd[I4B_MON_CFGREREAD_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_CFGREREAD_CODE);
- write(monsock, cmd, I4B_MON_CFGREREAD_SIZE);
- }
- break;
-
- case 4:
- {
- BYTE cmd[I4B_MON_HANGUP_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_HANGUP_CODE);
- printf("Which channel do you wish to hangup? ");
- fgets(buf, sizeof buf, stdin);
- channel = atoi(buf);
- I4B_PUT_4B(cmd, I4B_MON_HANGUP_CHANNEL, channel);
- write(monsock, cmd, I4B_MON_HANGUP_SIZE);
- }
- break;
-
- case 9:
- close(monsock);
- exit(0);
- break;
-
- default:
- print_menu();
- break;
- }
-}
-
-/*
- * Display menu
- */
-static void print_menu()
-{
- printf("Menu: <1> display rights, <2> display monitor connections,\n");
- printf(" <3> reread config file, <4> hangup \n");
- printf(" <9> quit isdnmonitor\n");
-}
diff --git a/usr.sbin/i4b/isdnmonitor/monitor.h b/usr.sbin/i4b/isdnmonitor/monitor.h
deleted file mode 100644
index 0025449eb2bd..000000000000
--- a/usr.sbin/i4b/isdnmonitor/monitor.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor protocl definition
- * -----------------------------------------------
- *
- * $Id: monitor.h,v 1.4 1998/08/10 13:55:32 hm Exp $
- *
- * last edit-date: [Mon Aug 3 06:52:06 1998]
- *
- * -mh created
- * -hm checking in
- * -hm ported to HPUX 10.10
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef MONITOR_H
-#define MONITOR_H
-
-#define DEF_MONPORT 451 /* default monitor TCP port */
-
-#ifdef __hpux
-#define u_int8_t ubit8
-#define u_int32_t ubit32
-#endif
-#ifdef _WIN32
-#define u_int8_t BYTE
-#define u_in32_t DWORD
-#endif
-
-/*
- * The monitor client connects to the isdnd daemon process via a tcp/ip
- * connection from a remote machine or via a local (unix domain) socket.
- * The daemon accepts multiple connections and verifies access rights.
- * On connection establishment the daemon sends initial data telling
- * the client the current configuration: number and type of available
- * controllers, current connections, channel and interface states
- * and the clients access privileges. The client sends an event mask
- * telling the daemon which events it is interested in. If the client
- * has appropriate rights he may send commands to the daemon.
- *
- * All multi-byte values are in network byte order!
- */
-
-/* All data packets transfered are declared as arrays of BYTE */
-#define BYTE u_int8_t
-
-/* max stringlength used in this protocol */
-#define I4B_MAX_MON_STRING 256
-
-/* max command size from client to server */
-#define I4B_MAX_MON_CLIENT_CMD 16
-
-/* Version of the monitor protocol described here */
-#define MPROT_VERSION 0 /* major version no */
-#define MPROT_REL 1 /* release no */
-/*
- * We intend to keep different versions of monitor client and isdnd
- * interoperable as long as possible. We do not, however, even try
- * to do this during early alpha or beta release phases. If you run
- * developement versions at this stage, make sure all your clients
- * and servers run the same version!
- */
-
-/*
- * Client access rights
- */
-#define I4B_CA_COMMAND_FULL 1 /* may send any command */
-#define I4B_CA_COMMAND_RESTRICTED 2 /* may send 'harmless' commands */
-#define I4B_CA_EVNT_CHANSTATE 16 /* may watch b-channel states */
-#define I4B_CA_EVNT_CALLIN 32 /* may watch incoming calls */
-#define I4B_CA_EVNT_CALLOUT 64 /* may watch outgoing calls */
-#define I4B_CA_EVNT_I4B 128 /* may watch isdnd actions */
-
-/*
- * General layout of a command packet. All commands have this common
- * prefix. It is prepared by the macro I4B_PREP_CMD (s.b.)
- */
-#define I4B_MON_CMD 0 /* 2 byte: command code */
-#define I4B_MON_CMD_LEN 2 /* 2 byte: packet length */
-#define I4B_MON_CMD_HDR 4 /* size of header */
-
-/*
- * Currently events look the same as commands. We do not make
- * any guarantee this will remain the same, so a different set
- * of macros is used when describing events. Events are prepared
- * by I4B_PREP_EVNT (s.b.)
- */
-#define I4B_MON_EVNT 0 /* 2 byte: event code */
-#define I4B_MON_EVNT_LEN 2 /* 2 byte: packet length */
-#define I4B_MON_EVNT_HDR 4 /* size of header */
-
-/* Initial data send by daemon after connection is established */
-#define I4B_MON_IDATA_SIZE I4B_MON_EVNT_HDR+10
-#define I4B_MON_IDATA_CODE 0 /* event code */
-#define I4B_MON_IDATA_VERSMAJOR I4B_MON_EVNT_HDR+0 /* 2 byte: isdnd major version */
-#define I4B_MON_IDATA_VERSMINOR I4B_MON_EVNT_HDR+2 /* 2 byte: isdnd minor version */
-#define I4B_MON_IDATA_NUMCTRL I4B_MON_EVNT_HDR+4 /* 2 byte: number of controllers */
-#define I4B_MON_IDATA_CLACCESS I4B_MON_EVNT_HDR+6 /* 4 byte: client rights */
-
-/* followed by this for every controller */
-#define I4B_MON_ICTRL_SIZE I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+8
-#define I4B_MON_ICTRL_CODE 1 /* event code */
-#define I4B_MON_ICTRL_NAME I4B_MON_EVNT_HDR+0 /* string: name of controller */
-#define I4B_MON_ICTRL_BUSID I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+0 /* 2 byte: isdn bus id (reservered) */
-#define I4B_MON_ICTRL_FLAGS I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+2 /* 4 byte: controller flags (not yet defined) */
-#define I4B_MON_ICTRL_NCHAN I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+6 /* 2 byte: number of b channels on this controller */
-
-/* The client sets it's protocol version and event mask (usualy once after
- * connection establishement) */
-#define I4B_MON_CCMD_SETMASK 0x7e /* command code */
-#define I4B_MON_ICLIENT_SIZE I4B_MON_CMD_HDR+8
-#define I4B_MON_ICLIENT_VERMAJOR I4B_MON_CMD_HDR+0 /* 2 byte: protocol major version (always 0 for now) */
-#define I4B_MON_ICLIENT_VERMINOR I4B_MON_CMD_HDR+2 /* 2 byte: protocol minor version (always 0 for now) */
-#define I4B_MON_ICLIENT_EVENTS I4B_MON_CMD_HDR+4 /* 4 byte: client event mask */
-
-/* The client requests a list of monitor rights */
-#define I4B_MON_DUMPRIGHTS_CODE 1
-#define I4B_MON_DUMPRIGHTS_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/* in response to a I4B_MON_DUMPRIGHTS_CODE command, the daemon sends
- * this event: */
-#define I4B_MON_DRINI_CODE 2 /* event code */
-#define I4B_MON_DRINI_SIZE I4B_MON_EVNT_HDR+2 /* size of packet */
-#define I4B_MON_DRINI_COUNT I4B_MON_EVNT_HDR+0 /* 2 byte: number of records */
-
-/* followed by this for each record anounced above */
-#define I4B_MON_DR_CODE 3
-#define I4B_MON_DR_SIZE I4B_MON_EVNT_HDR+13
-#define I4B_MON_DR_RIGHTS I4B_MON_EVNT_HDR+0 /* 4 byte: rights mask */
-#define I4B_MON_DR_NET I4B_MON_EVNT_HDR+4 /* 4 byte: network address */
-#define I4B_MON_DR_MASK I4B_MON_EVNT_HDR+8 /* 4 byte: network mask */
-#define I4B_MON_DR_LOCAL I4B_MON_EVNT_HDR+12 /* 1 byte: non-zero if local socket */
-
-/* The client requests a list of monitor connections */
-#define I4B_MON_DUMPMCONS_CODE 2
-#define I4B_MON_DUMPMCONS_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/* in response to a I4B_MON_DUMPMCONS_CODE command, the daemon sends
- * this event: */
-#define I4B_MON_DCINI_CODE 4 /* event code */
-#define I4B_MON_DCINI_SIZE I4B_MON_EVNT_HDR+2 /* size of packet */
-#define I4B_MON_DCINI_COUNT I4B_MON_EVNT_HDR+0 /* 2 byte: number of records */
-
-/* followed by this for each record anounced above */
-#define I4B_MON_DC_CODE 5
-#define I4B_MON_DC_SIZE I4B_MON_EVNT_HDR+8
-#define I4B_MON_DC_RIGHTS I4B_MON_EVNT_HDR+0 /* 4 byte: rights mask */
-#define I4B_MON_DC_WHO I4B_MON_EVNT_HDR+4 /* 4 byte: network address */
-
-/* The client requests a config file rescan */
-#define I4B_MON_CFGREREAD_CODE 3
-#define I4B_MON_CFGREREAD_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/* The client requests to hangup a connection */
-#define I4B_MON_HANGUP_CODE 4
-#define I4B_MON_HANGUP_SIZE I4B_MON_CMD_HDR+4
-#define I4B_MON_HANGUP_CHANNEL I4B_MON_CMD_HDR+0 /* channel to drop */
-
-/* The daemon sends a logfile event */
-#define I4B_MON_LOGEVNT_CODE 6
-#define I4B_MON_LOGEVNT_SIZE I4B_MON_EVNT_HDR+8+2*I4B_MAX_MON_STRING
-#define I4B_MON_LOGEVNT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: timestamp */
-#define I4B_MON_LOGEVNT_PRIO I4B_MON_EVNT_HDR+4 /* 4 byte: syslog priority */
-#define I4B_MON_LOGEVNT_WHAT I4B_MON_EVNT_HDR+8 /* followed by 2 strings: 'what' and 'message' */
-#define I4B_MON_LOGEVNT_MSG I4B_MON_EVNT_HDR+8+I4B_MAX_MON_STRING
-
-/* The daemon sends a charge event */
-#define I4B_MON_CHRG_CODE 7
-#define I4B_MON_CHRG_SIZE I4B_MON_EVNT_HDR+16
-#define I4B_MON_CHRG_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: timestamp */
-#define I4B_MON_CHRG_CHANNEL I4B_MON_EVNT_HDR+4 /* 4 byte: channel charged */
-#define I4B_MON_CHRG_UNITS I4B_MON_EVNT_HDR+8 /* 4 byte: new charge value */
-#define I4B_MON_CHRG_ESTIMATED I4B_MON_EVNT_HDR+12 /* 4 byte: 0 = charge by network, 1 = calculated estimate */
-
-/* The daemon sends a connect event */
-#define I4B_MON_CONNECT_CODE 8
-#define I4B_MON_CONNECT_SIZE I4B_MON_EVNT_HDR+12+4*I4B_MAX_MON_STRING
-#define I4B_MON_CONNECT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_CONNECT_DIR I4B_MON_EVNT_HDR+4 /* 4 byte: direction (0 = incoming, 1 = outgoing) */
-#define I4B_MON_CONNECT_CHANNEL I4B_MON_EVNT_HDR+8 /* 4 byte: channel connected */
-#define I4B_MON_CONNECT_CFGNAME I4B_MON_EVNT_HDR+12 /* name of config entry */
-#define I4B_MON_CONNECT_DEVNAME I4B_MON_EVNT_HDR+12+I4B_MAX_MON_STRING /* name of device used for connection */
-#define I4B_MON_CONNECT_REMPHONE I4B_MON_EVNT_HDR+12+2*I4B_MAX_MON_STRING /* remote phone no. */
-#define I4B_MON_CONNECT_LOCPHONE I4B_MON_EVNT_HDR+12+3*I4B_MAX_MON_STRING /* local phone no. */
-
-/* The daemon sends a disconnect event */
-#define I4B_MON_DISCONNECT_CODE 9
-#define I4B_MON_DISCONNECT_SIZE I4B_MON_EVNT_HDR+8
-#define I4B_MON_DISCONNECT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_DISCONNECT_CHANNEL I4B_MON_EVNT_HDR+4 /* 4 byte: channel disconnected */
-
-/* The daemon sends an up/down event */
-#define I4B_MON_UPDOWN_CODE 10
-#define I4B_MON_UPDOWN_SIZE I4B_MON_EVNT_HDR+12
-#define I4B_MON_UPDOWN_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_UPDOWN_CHANNEL I4B_MON_EVNT_HDR+4 /* 4 byte: channel disconnected */
-#define I4B_MON_UPDOWN_ISUP I4B_MON_EVNT_HDR+8 /* 4 byte: interface is up */
-
-/* macros for setup/decoding of protocol packets */
-
-/* clear a record */
-#define I4B_CLEAR(r) memset(&(r), 0, sizeof(r));
-
-/* prepare a record as event or command */
-#define I4B_PREP_EVNT(r, e) { \
- I4B_CLEAR(r); \
- I4B_PUT_2B(r, I4B_MON_EVNT, e); \
- I4B_PUT_2B(r, I4B_MON_EVNT_LEN, sizeof(r)); \
-}
-#define I4B_PREP_CMD(r, c) { \
- I4B_CLEAR(r); \
- I4B_PUT_2B(r, I4B_MON_CMD, c); \
- I4B_PUT_2B(r, I4B_MON_CMD_LEN, sizeof(r)); \
-}
-
-/* put 1, 2 or 4 bytes in network byte order into a record at offset off */
-#define I4B_PUT_1B(r, off, val) { ((BYTE*)(r))[off] = (val) & 0x00ff; }
-#define I4B_PUT_2B(r, off, val) { I4B_PUT_1B(r, off, val >> 8); I4B_PUT_1B(r, off+1, val); }
-#define I4B_PUT_4B(r, off, val) { I4B_PUT_1B(r, off, val >> 24); I4B_PUT_1B(r, off+1, val >> 16); I4B_PUT_1B(r, off+2, val >> 8); I4B_PUT_1B(r, off+3, val); }
-
-/* get 1, 2 or 4 bytes in network byte order from a record at offset off */
-#define I4B_GET_1B(r, off) (((BYTE*)(r))[off])
-#define I4B_GET_2B(r, off) ((((BYTE*)(r))[off]) << 8) | (((BYTE*)(r))[off+1])
-#define I4B_GET_4B(r, off) ((((BYTE*)(r))[off]) << 24) | ((((BYTE*)(r))[off+1]) << 16) | ((((BYTE*)(r))[off+2]) << 8) | (((BYTE*)(r))[off+3])
-
-/* put a string into recor r at offset off, make sure it's not to long
- * and proper terminate it */
-#define I4B_PUT_STR(r, off, str) { \
- strncpy(r+off, str, I4B_MAX_MON_STRING); \
- r[off+I4B_MAX_MON_STRING-1] = (BYTE)0; }
-
-#endif /* MONITOR_H */
-
diff --git a/usr.sbin/i4b/isdntel/Makefile b/usr.sbin/i4b/isdntel/Makefile
deleted file mode 100644
index 752857173715..000000000000
--- a/usr.sbin/i4b/isdntel/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id$
-
-PROG = isdntel
-SRCS = main.c display.c files.c alias.c
-DPADD = ${LIBNCURSES} ${LIBMYTINFO}
-LDADD = -lncurses -lmytinfo
-MAN8 = isdntel.8
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntel/alias.c b/usr.sbin/i4b/isdntel/alias.c
deleted file mode 100644
index fa02ea962cd4..000000000000
--- a/usr.sbin/i4b/isdntel/alias.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: alias.c,v 1.5 1998/12/05 18:03:51 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:15:02 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-#include "alias.h"
-
-static struct alias *firsta = NULL;
-
-#define MAXBUFSZ 256
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-void
-init_alias(char *filename)
-{
- FILE *fp;
- char buffer[MAXBUFSZ + 1];
- char number[MAXBUFSZ + 1];
- char name[MAXBUFSZ + 1];
- char *s, *d;
- struct alias *newa = NULL;
- struct alias *lasta = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- fatal("cannot open aliasfile %s!", filename);
-
- while((fgets(buffer, MAXBUFSZ, fp)) != NULL)
- {
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- s = buffer;
- d = number;
-
- while(*s && (isdigit(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- while(*s && (isspace(*s)))
- s++;
-
- d = name;
-
- while(*s && (isprint(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- if((strlen(number) > 1) && (strlen(name) > 1))
- {
- if((newa = (struct alias *) malloc(sizeof(struct alias))) == NULL)
- fatal("malloc failed for struct alias");
- if((newa->number = (char *) malloc(strlen(number)+1)) == NULL)
- fatal("malloc failed for number alias");
- if((newa->name = (char *) malloc(strlen(name)+1)) == NULL)
- fatal("malloc failed for name alias");
- strcpy(newa->name, name);
- strcpy(newa->number, number);
- newa->next = NULL;
-
- if(firsta == NULL)
- {
- firsta = newa;
- }
- else
- {
- lasta->next = newa;
- }
- lasta = newa;
- }
- }
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-char *
-get_alias(char *number)
-{
- struct alias *ca = NULL;
-
- if(firsta == NULL)
- return(NULL);
-
- ca = firsta;
-
- for(;;)
- {
- if(strlen(number) == strlen(ca->number))
- {
- if(!(strcmp(number, ca->number)))
- return(ca->name);
- }
- if(ca->next == NULL)
- break;
- ca = ca->next;
- }
- return(NULL);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/alias.h b/usr.sbin/i4b/isdntel/alias.h
deleted file mode 100644
index 98b91daf8feb..000000000000
--- a/usr.sbin/i4b/isdntel/alias.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdn4bsd common alias file handling header
- * ==========================================
- *
- * $Id: alias.h,v 1.3 1998/12/05 18:03:52 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:15:13 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#ifndef _ALIAS_H_
-#define _ALIAS_H_
-
-#define ALIASFILE "/etc/isdn/isdntel.alias"
-
-struct alias {
- char *number; /* telephone number string */
- char *name; /* name string */
- struct alias *next; /* ptr to next alias */
-};
-
-#endif /* _ALIAS_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/defs.h b/usr.sbin/i4b/isdntel/defs.h
deleted file mode 100644
index e9233c370355..000000000000
--- a/usr.sbin/i4b/isdntel/defs.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering support
- * ==============================================
- *
- * $Id: defs.h,v 1.6 1998/12/05 18:03:53 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:15:26 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#include <ncurses.h>
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/time.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <dirent.h>
-#else
-#include <sys/dir.h>
-#endif
-#include <sys/param.h>
-
-#define VERSION "1" /* version number */
-#define REL "11" /* release number */
-
-#define GOOD 0
-#define ERROR (-1)
-#define WARNING (-2)
-
-#define SPOOLDIR "/var/isdn"
-#define PLAYCMD "cat %s | alaw2ulaw >/dev/audio"
-
-/* reread timeout in seconds */
-
-#define REREADTIMEOUT 60
-
-/* window dimensions */
-
-#define START_O 3 /* main window start */
-
-#define DAT_POS 0
-#define TIM_POS (DAT_POS+10)
-#define DST_POS (TIM_POS+8)
-#define SRC_POS (DST_POS+17)
-#define ALI_POS (SRC_POS+17)
-#define SEC_POS (ALI_POS+21)
-#define LAST_POS (SEC_POS+5)
-
-/* fullscreen mode menu window */
-
-#define WMITEMS 5 /* no of items */
-#define WMENU_LEN 18 /* window width */
-#define WMENU_HGT (WMITEMS+4) /* window height */
-#define WMENU_TITLE "Command"
-#define WMENU_POSLN 8 /* window position: lines */
-#define WMENU_POSCO 20 /* window position: columns */
-
-#define CR 0x0d
-#define LF 0x0a
-#define TAB 0x09
-#define CNTRL_D 0x04
-#define CNTRL_L 0x0c
-
-struct onefile {
- char *fname; /* filename */
- char *date;
- char *time;
- char *srcnumber;
- char *dstnumber;
- char *seconds;
- char *alias;
- int len;
- struct onefile *next; /* ptr to next entry */
- struct onefile *prev; /* prt to previous entry */
-};
-
-#ifdef MAIN
-
-int curses_ready = 0; /* flag, curses display is initialized */
-
-struct onefile *cur_file = NULL;/* the CURRENT filename */
-struct onefile *first = NULL; /* init dir-list head-ptr */
-struct onefile *last = NULL; /* init dir-list tail-ptr */
-
-WINDOW *main_w; /* curses main window pointer */
-
-int nofiles = 0;
-int cur_pos = 0;
-
-char *spooldir = SPOOLDIR;
-char *playstring = PLAYCMD;
-
-#else
-
-extern int curses_ready;
-
-extern struct onefile *cur_file;
-extern struct onefile *first;
-extern struct onefile *last;
-
-extern WINDOW *main_w;
-
-extern int nofiles;
-extern int cur_pos;
-
-extern char *spooldir;
-extern char *playstring;
-
-#endif
-
-extern void init_alias( char *filename );
-extern void init_files( int inipos );
-extern void init_screen ( void );
-extern void do_menu ( void );
-extern int fill_list( void );
-extern char *get_alias( char *number );
-extern int main ( int argc, char **argv );
-extern void do_quit ( int exitval );
-extern void fatal ( char *fmt, ... );
-extern void error ( char *fmt, ... );
-extern void play ( struct onefile * );
-extern void delete ( struct onefile * );
-extern void reread( void );
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/display.c b/usr.sbin/i4b/isdntel/display.c
deleted file mode 100644
index 1cc0034f01cf..000000000000
--- a/usr.sbin/i4b/isdntel/display.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: display.c,v 1.4 1998/12/05 18:03:55 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:15:40 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-static char *helpstr = "Enter Control-D to exit program or RETURN for command window";
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_screen(void)
-{
- char buffer[512];
-
- initscr(); /* curses init */
-
- if((COLS < 80) || (LINES < 24))
- fatal(0, "ERROR, minimal screensize must be 80x24, is %dx%d, terminating!", COLS, LINES);
-
-
- if((main_w = newwin(LINES-START_O-2, COLS, START_O, 0)) == NULL)
- fatal("ERROR, curses init main window, terminating!");
-
- raw(); /* raw input */
- noecho(); /* do not echo input */
- keypad(stdscr, TRUE); /* use special keys */
- keypad(main_w, TRUE); /* use special keys */
- scrollok(main_w, TRUE);
-
- sprintf(buffer, " isdntel %s.%s ", VERSION, REL);
-
- move(0, 0);
- standout();
- hline(ACS_HLINE, 5);
- move(0, 5);
- addstr(buffer);
- move(0, 5 + strlen(buffer));
- hline(ACS_HLINE, 256);
- standend();
-
- move(1, 0);
- addstr("Date Time Called Party Calling Party Alias Length");
- /* 31.12.96 16:45:12 1234567890123456 1234567890123456 12345678901234567890 123456 */
-
- move(2, 0);
- hline(ACS_HLINE, 256);
-
- move(LINES-2, 0);
- hline(ACS_HLINE, 256);
-
- mvaddstr(LINES-1, (COLS / 2) - (strlen(helpstr) / 2), helpstr);
-
- refresh();
-
- wrefresh(main_w);
-
- curses_ready = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "Play File",
-#define PLAY 0
- "Delete File",
-#define DELETE 1
- "Re-Read Spool",
-#define REREAD 2
- "Refresh Screen",
-#define REFRESH 3
- "Exit Program",
-#define EXIT 4
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- return;
-
- keypad(menu_w, TRUE); /* use special keys */
-
- /* draw border around the window */
-
- box(menu_w, 0, 0);
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case TAB:
- case KEY_DOWN: /* down-move cursor */
- case ' ':
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case KEY_UP: /* up-move cursor */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- if(mpos)
- mpos--;
- else
- mpos = WMITEMS-1;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case 'R':
- case 'r':
- wrefresh(curscr);
- goto mexit;
-
- case 'E':
- case 'e':
- case 'Q':
- case 'q':
- case 'X':
- case 'x':
- do_quit(0);
- goto mexit;
- break;
-
- case 'P':
- case 'p':
- play(cur_file);
- goto mexit;
- break;
-
- case 'D':
- case 'd':
- delete(cur_file);
- goto mexit;
- break;
-
- case CR:
- case LF: /* exec highlighted option */
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- switch(mpos)
- {
- case PLAY:
- play(cur_file);
- goto mexit;
- break;
- case DELETE:
- delete(cur_file);
- goto mexit;
- break;
- case REREAD:
- reread();
- goto mexit;
- break;
- case REFRESH:
- wrefresh(curscr);
- break;
- case EXIT:
- do_quit(0);
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- /* delete the menu window */
-
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(main_w);
- wrefresh(main_w);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/files.c b/usr.sbin/i4b/isdntel/files.c
deleted file mode 100644
index ea153f5ee006..000000000000
--- a/usr.sbin/i4b/isdntel/files.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: files.c,v 1.6 1998/12/05 18:03:56 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:15:57 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-/*---------------------------------------------------------------------------*
- * create a doubly linked list in sorted order, return pointer to new
- * first element of list
- *---------------------------------------------------------------------------*/
-struct onefile *store
- (register struct onefile *new, /* new entry to store into list */
- register struct onefile *top) /* current first entry in list */
-{
- register struct onefile *old, *p;
-
- if (last == NULL) /* enter very first element ? */
- {
- new->next = NULL;
- new->prev = NULL;
- last = new; /* init last */
- return (new); /* return new first */
- }
- p = top; /* p = old first element */
- old = NULL;
- while (p)
- {
- if ((strcmp(p->fname, new->fname)) < 0) /* current less new ? */
- {
- old = p;
- p = p->next;
- }
- else
- { /* current >= new */
-
- if (p->prev)
- {
- p->prev->next = new;
- new->next = p;
- new->prev = p->prev;
- p->prev = new;
- return (top);
- }
- new->next = p;
- new->prev = NULL;
- p->prev = new;
- return (new);
- }
- }
- old->next = new;
- new->next = NULL;
- new->prev = old;
- last = new;
- return (first);
-}
-
-/*---------------------------------------------------------------------------*
- * read current directory and build up a doubly linked sorted list
- *---------------------------------------------------------------------------*/
-int
-fill_list(void)
-{
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- register struct dirent *dp;
-#else
- register struct direct *dp;
-#endif
- register struct onefile *new_entry;
- register DIR *dirp;
- int flcnt = 0;
- char tmp[80];
- char *s, *d;
-
- if ((dirp = opendir(spooldir)) == NULL)
- fatal("cannot open spooldirectory %s!\n", spooldir);
-
- for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
- {
- if(!isdigit(*(dp->d_name)))
- continue;
-
- if ((new_entry = (struct onefile *) malloc(sizeof(struct onefile))) == NULL)
- {
- fatal("files.c, fill_list(): structure onefile malloc failed");
- }
-
- /* alloc filename memory and copy name into it */
-
- if ((new_entry->fname = (char *) malloc(strlen(dp->d_name) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc filename string memory failed");
- }
-
- strcpy(new_entry->fname, dp->d_name);
-
- /* fill in remaining fields from filename */
-
- tmp[0] = dp->d_name[4]; /* day msb */
- tmp[1] = dp->d_name[5]; /* day lsb */
- tmp[2] = '.';
- tmp[3] = dp->d_name[2]; /* month msb */
- tmp[4] = dp->d_name[3]; /* month lsb */
- tmp[5] = '.';
- tmp[6] = dp->d_name[0]; /* year msb */
- tmp[7] = dp->d_name[1]; /* year lsb */
- tmp[8] = '\0';
-
- if((new_entry->date = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc date string memory failed");
- }
-
- strcpy(new_entry->date, tmp);
-
- tmp[0] = dp->d_name[6]; /* hour msb */
- tmp[1] = dp->d_name[7]; /* hour lsb */
- tmp[2] = ':';
- tmp[3] = dp->d_name[8]; /* minute msb */
- tmp[4] = dp->d_name[9]; /* minute lsb */
- tmp[5] = ':';
- tmp[6] = dp->d_name[10]; /* second msb */
- tmp[7] = dp->d_name[11]; /* second lsb */
- tmp[8] = '\0';
-
- if((new_entry->time = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc time string memory failed");
- }
-
- strcpy(new_entry->time, tmp);
-
- /* destination number */
-
- s = &dp->d_name[13];
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->dstnumber = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc dstnumber string memory failed");
- }
-
- strcpy(new_entry->dstnumber, tmp);
-
- /* source number */
-
- s++;
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->srcnumber = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc srcnumber string memory failed");
- }
-
- strcpy(new_entry->srcnumber, tmp);
-
- /* length in seconds */
-
- s++;
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->seconds = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc seconds string memory failed");
- }
-
- strcpy(new_entry->seconds, tmp);
-
- /* search for alias and add if found */
-
- new_entry->alias = get_alias(new_entry->srcnumber);
-
- /* sort entry into linked list */
-
- first = store(new_entry, first);
-
- flcnt++; /* increment file count */
- }
- closedir(dirp); /* close current dir */
- return(flcnt); /* ok return */
-}
-
-/*---------------------------------------------------------------------------*
- * free the current malloc'ed list
- *---------------------------------------------------------------------------*/
-void
-free_list(void)
-{
- register struct onefile *dir;
- register struct onefile *tmp;
-
- dir = first; /* start of linked list */
-
- while (dir) /* free all */
- {
- tmp = dir->next; /* save ptr to next entry */
- free(dir->fname); /* free filename space */
- free(dir->date);
- free(dir->time);
- free(dir->srcnumber);
- free(dir->dstnumber);
- free(dir->seconds);
- free(dir); /* free struct space */
- dir = tmp; /* ptr = ptr to next entry */
- }
- first = NULL; /* first ptr = NULL */
- last = NULL; /* last ptr = NULL */
-}
-
-/*---------------------------------------------------------------------------*
- * delete a file
- *---------------------------------------------------------------------------*/
-void
-delete(struct onefile *this)
-{
- char buffer[MAXPATHLEN+1];
-
- if(this == NULL)
- return;
-
- sprintf(buffer, "%s", this->fname);
-
- unlink(buffer);
-
- free_list();
-
- wclear(main_w);
-
- init_files(cur_pos);
-}
-
-/*---------------------------------------------------------------------------*
- * reread the spool directory
- *---------------------------------------------------------------------------*/
-void
-reread(void)
-{
- free_list();
-
- wclear(main_w);
-
- init_files(cur_pos);
-}
-
-/*---------------------------------------------------------------------------*
- * play a file
- *---------------------------------------------------------------------------*/
-void
-play(struct onefile *this)
-{
- char buffer[MAXPATHLEN+1];
-
- if(this == NULL)
- return;
-
- sprintf(buffer, playstring, this->fname);
-
- system(buffer);
-}
-
-/*---------------------------------- EOF -------------------------------------*/
diff --git a/usr.sbin/i4b/isdntel/isdntel.8 b/usr.sbin/i4b/isdntel/isdntel.8
deleted file mode 100644
index d87c848a8bc0..000000000000
--- a/usr.sbin/i4b/isdntel/isdntel.8
+++ /dev/null
@@ -1,94 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" last edit-date: [Sat Dec 5 18:16:19 1998]
-.\"
-.\" $Id: isdntel.8,v 1.6 1998/12/05 18:03:58 hm Exp $
-.\"
-.Dd July 11, 1998
-.Dt isdntel 8
-.Sh NAME
-.Nm isdntel
-.Nd isdn4bsd telephone answering management utility
-.Sh SYNOPSIS
-.Nm isdntel
-.Op Fl a Ar aliasfile
-.Op Fl d Ar spooldir
-.Op Fl p Ar playcommand
-.Op Fl t Ar timeout
-.Sh DESCRIPTION
-.Nm
-is used to provide an "answering machine" functionality for incoming
-telephone voice messages.
-.Pp
-The following options are supported:
-.Bl -tag -width Ds
-.It Fl a
-Use
-.Ar aliasfile
-as the pathname for an aliasfile containing aliases for phone numbers. The
-default path is
-.Em /etc/isdn/isdntel.alias .
-The format of an alias entry is the number string followed by one or more
-spaces or tabs. The rest of the line is taken as the alias string. Comments
-are introduced by a leading blank, tab or "#" character.
-.It Fl d
-Use
-.Ar spooldir
-as the directory where the incoming voice messages are stored by the
-"answ" script called by
-.Xr isdnd 8 .
-This defaults to the directory
-.Em /var/isdn .
-The format of a voice message filename is:
-.Pp
-.Dl YYMMDDhhmmss-dest_number-source_number-length_in_secs
-.It Fl p
-Use
-.Ar playcommand
-as the command string to execute for playing a voice message to some audio
-output facility. The characters
-.Em %s
-are replaced by the currently selected filename. The default string is
-.Em cat %s | alaw2ulaw >/dev/audio
-.It Fl t
-The value for
-.Ar timeout
-specifies the time in seconds the program rereads the spool directory
-when there is no keyboard activity.
-.El
-.Pp
-The screen output should be obvious. If in doubt, consult the source.
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnd.rc 5
-.Xr i4btel 4
-
-.Sh BUGS
-Still two or more left.
-
-.Sh AUTHOR
-The
-.Nm
-utility and this manual page were written by Hellmuth Michaelis (hm@kts.org)
diff --git a/usr.sbin/i4b/isdntel/main.c b/usr.sbin/i4b/isdntel/main.c
deleted file mode 100644
index fd6a3b2ccf56..000000000000
--- a/usr.sbin/i4b/isdntel/main.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: main.c,v 1.6 1998/12/05 18:03:59 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:16:33 1998]
- *
- *----------------------------------------------------------------------------*/
-
-#define MAIN
-#include "defs.h"
-#include "alias.h"
-
-static void usage( void );
-
-static int top_dis = 0;
-static int bot_dis = 0;
-static int cur_pos_scr = 0;
-
-static void makecurrent(int cur_pos, struct onefile *cur_file, int cold);
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- int kchar;
-
- char *spooldir = SPOOLDIR;
- char *playstring = PLAYCMD;
- char *aliasfile = ALIASFILE;
- int rrtimeout = REREADTIMEOUT;
-
- extern char *optarg;
-
- while ((i = getopt(argc, argv, "a:d:p:t:?")) != EOF)
- {
- switch (i)
- {
- case 'a':
- aliasfile = optarg;
- break;
-
- case 'd':
- spooldir = optarg;
- break;
-
- case 'p':
- playstring = optarg;
- break;
-
- case 't':
- if(isdigit(*optarg))
- {
- rrtimeout = strtoul(optarg, NULL, 10);
- }
- else
- {
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(rrtimeout < 10)
- rrtimeout = 10;
-
- if((chdir(spooldir)) != 0)
- fatal("cannot change directory to spooldir %s!", spooldir);
-
- init_alias(aliasfile);
-
- init_screen();
-
- init_files(0);
-
- /* go into loop */
-
- for (;;)
- {
- fd_set set;
- struct timeval timeout;
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = rrtimeout;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, reread spool */
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- {
- reread();
- continue;
- }
-
- kchar = wgetch(main_w); /* get char */
-
- switch (kchar)
- {
- case CR:
- case LF:
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- do_menu();
- break;
-
- case KEY_UP: /* up-move cursor */
- if(cur_file && cur_file->prev)
- {
- cur_file = cur_file->prev;
- cur_pos--;
- }
- break;
-
-
- case TAB:
- case KEY_DOWN: /* down-move cursor */
- if(cur_file && cur_file->next)
- {
- cur_file = cur_file->next;
- cur_pos++;
- }
- break;
-
- case KEY_HOME: /* move cursor to first dir */
- break;
-
- case KEY_LL: /* move cursor to last file */
- break;
-
- case CNTRL_D:
- do_quit(0);
- break;
-
- case CNTRL_L: /* refresh */
- touchwin(curscr);
- wrefresh(curscr);
- break;
-
- }
- makecurrent(cur_pos, cur_file, 0);
- }
-
- do_quit(0);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle horizontal selection bar movement
- *---------------------------------------------------------------------------*/
-static void
-makecurrent(int cur_pos, struct onefile *cur_file, int cold)
-{
- static int lastpos;
- static struct onefile *lastfile;
- char buffer[256];
-
- /* un-higlight current horizontal bar */
-
- if(!cold && lastfile && cur_file)
- {
- sprintf(buffer, "%s %s %-16s %-16s %-20s %-6s%*s",
- lastfile->date, lastfile->time,
- lastfile->dstnumber, lastfile->srcnumber,
- lastfile->alias == NULL ? "-/-" : lastfile->alias,
- lastfile->seconds,
- COLS - LAST_POS - 2, "");
-
- wattroff(main_w, A_REVERSE);
- mvwprintw(main_w, lastpos, 0, "%s", buffer);
- wattroff(main_w, A_REVERSE);
- }
-
- if(cur_file == NULL)
- {
- lastpos = cur_pos_scr;
- lastfile = cur_file;
- return;
- }
-
- /* have to scroll up or down ? */
-
- if(cur_pos >= bot_dis)
- {
- /* scroll up */
-
- wscrl(main_w, 1);
-
- bot_dis++;
- top_dis++;
- cur_pos_scr = LINES-START_O-3;
- }
- else if(cur_pos < top_dis)
- {
- /* scroll down */
-
- wscrl(main_w, -1);
-
- bot_dis--;
- top_dis--;
- cur_pos_scr = 0;
- }
- else
- {
- cur_pos_scr = cur_pos - top_dis;
- }
-
- sprintf(buffer, "%s %s %-16s %-16s %-20s %-6s%*s",
- cur_file->date, cur_file->time,
- cur_file->dstnumber, cur_file->srcnumber,
- cur_file->alias == NULL ? "-/-" : cur_file->alias,
- cur_file->seconds,
- COLS - LAST_POS - 2, "");
-
- wattron(main_w, A_REVERSE);
- mvwprintw(main_w, cur_pos_scr, 0, "%s", buffer);
- wattroff(main_w, A_REVERSE);
-
- lastpos = cur_pos_scr;
- lastfile = cur_file;
-
- wrefresh(main_w);
-}
-
-/*---------------------------------------------------------------------------*
- * exit program
- *---------------------------------------------------------------------------*/
-void
-do_quit(int exitval)
-{
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntel - isdn telephone answering management support utility (version %s.%s)\n", VERSION, REL);
- fprintf(stderr, " usage: isdntel -a <filename> -d <directory> -p <command> -t <timeout>\n");
- fprintf(stderr, " -a <filename> use filename as alias file\n");
- fprintf(stderr, " -d <directory> use directory as spool directory\n");
- fprintf(stderr, " -p <command> specify commandline for play command\n");
- fprintf(stderr, " -t <timeout> spool directory reread timeout in seconds\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * fatal error exit
- *---------------------------------------------------------------------------*/
-void
-fatal(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if(curses_ready)
- {
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- }
-
- fprintf(stderr, "\nFatal error: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n\n");
-
- va_end(ap);
-
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * error printing
- *---------------------------------------------------------------------------*/
-void
-error(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if(curses_ready)
- {
- wprintw(main_w, "ERROR: ");
- vwprintw(main_w, fmt, ap);
- wprintw(main_w, "\n");
- wrefresh(main_w);
- }
- else
- {
- fprintf(stderr, "ERROR: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- }
-
- va_end(ap);
-}
-
-/*---------------------------------------------------------------------------*
- * read files and fill display
- *---------------------------------------------------------------------------*/
-void
-init_files(int inipos)
-{
- int i;
-
- nofiles = fill_list();
-
- top_dis = 0;
- bot_dis = 0;
-
- cur_file = first;
-
- cur_pos = 0;
- cur_pos_scr = 0;
-
- if(nofiles == 0)
- return;
-
- for(i=0; (i < nofiles) && (i < (LINES-START_O-2)); i++)
- {
- mvwprintw(main_w, i, 0, "%s %s", cur_file->date, cur_file->time);
- mvwprintw(main_w, i, DST_POS, "%s", cur_file->dstnumber);
- mvwprintw(main_w, i, SRC_POS, "%s", cur_file->srcnumber);
- mvwprintw(main_w, i, ALI_POS,"%s", cur_file->alias == NULL ? "-/-" : cur_file->alias);
- mvwprintw(main_w, i, SEC_POS,"%s", cur_file->seconds);
-
- bot_dis++;
-
- if((cur_file = cur_file->next) == NULL)
- break;
- }
-
- cur_file = first;
-
- if(inipos)
- {
- for(i=0; i < inipos; i++)
- {
- if(cur_file->next != NULL)
- cur_file = cur_file->next;
- else
- break;
- }
- }
- makecurrent(cur_pos, cur_file, 1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntelctl/Makefile b/usr.sbin/i4b/isdntelctl/Makefile
deleted file mode 100644
index b38f2063671c..000000000000
--- a/usr.sbin/i4b/isdntelctl/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-PROG = isdntelctl
-SRCS = main.c
-MAN8 = isdntelctl.8
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntelctl/isdntelctl.8 b/usr.sbin/i4b/isdntelctl/isdntelctl.8
deleted file mode 100644
index 2bd45d270b5c..000000000000
--- a/usr.sbin/i4b/isdntelctl/isdntelctl.8
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdntelctl.8,v 1.4 1998/12/14 10:31:55 hm Exp $
-.\"
-.\" last edit-date: [Mon Dec 14 11:34:51 1998]
-.\"
-.Dd December 14, 1998
-.Dt isdntelctl 8
-.Sh NAME
-.Nm isdntelctl
-.Nd control isdn4bsd telephone sound format conversion
-.Sh SYNOPSIS
-.Nm
-.Op Fl c
-.Op Fl g
-.Op Fl u Ar unit
-.Op Fl A
-.Op Fl U
-.Sh DESCRIPTION
-.Nm isdntelctl
-is part of the isdn4bsd package and is used to configure the sound format
-conversion facilities of the /dev/i4btel interfaces.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl c
-Clear the telephone input queue.
-.It Fl g
-Get the sound format currently in use.
-.It Fl u
-Set the /dev/i4btel unit number. The default value is zero to access
-device /dev/i4btel0.
-.It Fl A
-Set sound format to A-Law.
-.It Fl U
-Set sound format to u-Law.
-.Pp
-.Sh FILES
-/dev/i4btel<n>
-
-.Sh STANDARDS
-A-Law and u-Law are specified in ITU Recommendation G.711.
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdntelctl -g
-.Ed
-.Pp
-displays the currently used sound format for device /dev/i4btel0.
-
-.Sh AUTHOR
-The
-.Nm
-utility and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/isdntelctl/main.c b/usr.sbin/i4b/isdntelctl/main.c
deleted file mode 100644
index 4309b2497cea..000000000000
--- a/usr.sbin/i4b/isdntelctl/main.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntelctl - i4b set telephone interface options
- * ------------------------------------------------
- *
- * $Id: main.c,v 1.4 1998/12/14 10:31:57 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:17:17 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <machine/i4b_tel_ioctl.h>
-
-static void usage ( void );
-
-#define I4BTELDEVICE "/dev/i4btel"
-
-int opt_get = 0;
-int opt_unit = 0;
-int opt_U = 0;
-int opt_A = 0;
-int opt_C = 0;
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int c;
- int ret;
- int telfd;
- char namebuffer[128];
-
- while ((c = getopt(argc, argv, "cgu:AU?")) != EOF)
- {
- switch(c)
- {
- case 'c':
- opt_C = 1;
- break;
-
- case 'g':
- opt_get = 1;
- break;
-
- case 'u':
- opt_unit = atoi(optarg);
- if(opt_unit < 0 || opt_unit > 9)
- usage();
- break;
-
- case 'A':
- opt_A = 1;
- break;
-
- case 'U':
- opt_U = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(opt_get == 0 && opt_U == 0 && opt_A && opt_C == 0)
- {
- opt_get = 1;
- }
-
- if((opt_get + opt_U + opt_A + opt_C) > 1)
- {
- usage();
- }
-
- sprintf(namebuffer,"%s%d", I4BTELDEVICE, opt_unit);
-
- if((telfd = open(namebuffer, O_RDWR)) < 0)
- {
- fprintf(stderr, "isdntelctl: cannot open %s: %s\n", namebuffer, strerror(errno));
- exit(1);
- }
-
- if(opt_get)
- {
- int format;
-
- if((ret = ioctl(telfd, I4B_TEL_GETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_GETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
-
- if(format == CVT_NONE)
- {
- printf("device %s uses A-Law sound format\n", namebuffer);
- }
- else if(format == CVT_ALAW2ULAW)
- {
- printf("device %s uses u-Law sound format\n", namebuffer);
- }
- else
- {
- printf("ERROR, device %s uses unknown format %d!\n", namebuffer, format);
- }
- exit(0);
- }
-
- if(opt_A)
- {
- int format = CVT_NONE;
-
- if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
-
- if(opt_U)
- {
- int format = CVT_ALAW2ULAW;
-
- if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
- if(opt_C)
- {
- int dummy;
- if((ret = ioctl(telfd, I4B_TEL_EMPTYINPUTQUEUE, &dummy)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_EMPTYINPUTQUEUE failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntelctl - i4b telephone i/f control, compiled %s %s\n",__DATE__, __TIME__);
- fprintf(stderr, "usage: isdndebug -e -h -g -l <layer> -m -r -s <value> -u <unit> -z -H\n");
- fprintf(stderr, " -g get current settings\n");
- fprintf(stderr, " -u unit specify unit number\n");
- fprintf(stderr, " -A set interface to A-Law coding\n");
- fprintf(stderr, " -U set interface to u-Law coding\n");
- fprintf(stderr, " -c clear input queue\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntest/Makefile b/usr.sbin/i4b/isdntest/Makefile
deleted file mode 100644
index c1240ccb8e7e..000000000000
--- a/usr.sbin/i4b/isdntest/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG = isdntest
-SRCS = main.c
-MAN8 = isdntest.8
-
-install:
- @echo isdntest is not installed automatically
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntest/isdntest.8 b/usr.sbin/i4b/isdntest/isdntest.8
deleted file mode 100644
index 7e0352317247..000000000000
--- a/usr.sbin/i4b/isdntest/isdntest.8
+++ /dev/null
@@ -1,103 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdntest.8,v 1.6 1998/12/16 13:39:47 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:17:35 1998]
-.\"
-.Dd July 9, 1998
-.Dt isdntest 8
-.Sh NAME
-.Nm isdntest
-.Nd isdn4bsd debugging and verification tool
-.Sh SYNOPSIS
-.Nm
-.Op Fl c Ar unit
-.Op Fl h
-.Op Fl i Ar number
-.Op Fl o Ar number
-.Op Fl w
-.Sh DESCRIPTION
-.Nm isdntest
-is part of the isdn4bsd package and may be used as a stimulation tool
-for debugging the isdn4bsd kernel functionality.
-.Pp
-NOTE:
-.Nm Isdntest
-must be run
-.Em instead
-of the
-.Xr isdnd 8
-daemon and can not be used while the daemon runs.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl c
-Use controller unit number for test.
-.It Fl h
-Use HDLC as the B channel layer 1 protocol instead of no protocol.
-.It Fl i
-Use number to verify the incoming number.
-.It Fl o
-Use number as the outgoing number to dial.
-.It Fl w
-Wait for keyboard input for terminating the call.
-.El
-.Pp
-The
-.Nm
-utility is currently of not much use for end users, it is primarily a debugging
-tool for development and is part of the release in the hope, that someone
-enhances it as a real self test and setup-verification tool!
-.Pp
-.Nm Isdntest
-does almost no error checking and error recovery, so unexpected
-hangs or crashes may occur.
-
-.Sh EXAMPLES
-For the following example, it is assumed that a machine with isdn4bsd
-installed is connected to an S0 bus and that one of the valid MSN's (MSN = Multiple Subscriber Number
-= telephone number) on this bus is
-.Em 42 .
-The
-.Xr isdnd 8
-.Em must
-not currently running on that machine! Executing:
-.Bd -literal -offset indent
-isdntest -i 42 -o 42
-.Ed
-.Pp
-will setup an outgoing call from that machine to itself, connect to itself
-and disconnect after 5 seconds.
-.Nm Isdntest
-has to be finished by the user by entering Control-C.
-.Pp
-.Sh FILES
-/dev/i4b
-
-.Sh AUTHOR
-The
-.Nm
-utility and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/isdntest/main.c b/usr.sbin/i4b/isdntest/main.c
deleted file mode 100644
index 8e75be274ceb..000000000000
--- a/usr.sbin/i4b/isdntest/main.c
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - i4b selftest utility
- * -----------------------------
- *
- * $Id: main.c,v 1.9 1998/12/05 18:04:06 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:18:17 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-
-static void kbdrdhdl ( void );
-static void isdnrdhdl (int isdnfd );
-
-void handle_connect_ind(unsigned char *ptr);
-void handle_disconnect(unsigned char *ptr);
-void handle_connect_active_ind(unsigned char *ptr);
-
-int connect_response(int isdnfd, unsigned int cdid, int response);
-int disconnect_request(int isdnfd, unsigned int cdid);
-unsigned int get_cdid(int isdnfd);
-int connect_request(int isdnfd, unsigned int cdid);
-int do_test(void);
-static void cleanup(void);
-static void usage(void);
-void setup_wrfix(int len, unsigned char *buf);
-int check_rd(int len, unsigned char *wbuf, unsigned char *rdbuf);
-
-static int isdnfd;
-char outgoingnumber[32];
-char incomingnumber[32];
-int debug_level = 0;
-
-#define I4BDEVICE "/dev/i4b"
-#define DATADEV0 "/dev/i4brbch0"
-#define DATAUNIT0 0
-#define DATADEV1 "/dev/i4brbch1"
-#define DATAUNIT1 1
-
-unsigned int out_cdid = CDID_UNUSED;
-unsigned int in_cdid = CDID_UNUSED;
-
-int waitchar = 0;
-int usehdlc = 0;
-int controller = 0;
-int dotest = 0;
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- int c;
- fd_set set;
- int ret;
- char *ptr;
-
- incomingnumber[0] = '\0';
- outgoingnumber[0] = '\0';
-
- while ((c = getopt(argc, argv, "c:d:hi:o:t:w?")) != EOF)
- {
- switch(c)
- {
- case 'c':
- if(isdigit(*optarg))
- {
- controller = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -c requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 'd':
- if(isdigit(*optarg))
- {
- debug_level = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -d requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 'o':
- i = 0;
- ptr = optarg;
-
- while(*ptr)
- {
- if(isdigit(*ptr))
- {
- outgoingnumber[i++] = *ptr++;
- }
- else
- {
- fprintf(stderr, "Error: option -o requires a numeric argument!\n");
- usage();
- }
- }
- outgoingnumber[i] = '\0';
- break;
-
- case 'i':
- i = 0;
- ptr = optarg;
-
- while(*ptr)
- {
- if(isdigit(*ptr))
- {
- incomingnumber[i++] = *ptr++;
- }
- else
- {
- fprintf(stderr, "Error: option -i requires a numeric argument!\n");
- usage();
- }
- }
- incomingnumber[i] = '\0';
- break;
-
- case 'w':
- waitchar = 1;
- break;
-
- case 'h':
- usehdlc = 1;
- break;
-
- case 't':
- if(isdigit(*optarg))
- {
- dotest = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -t requires a numeric argument!\n");
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if((strlen(incomingnumber) == 0) || (strlen(outgoingnumber) == 0))
- usage();
-
- fprintf(stderr, "isdntest: accepting calls from telephone number [%s] \n", incomingnumber);
- fprintf(stderr, "isdntest: calling out telephone number [%s] \n", outgoingnumber);
-
- if((atexit(cleanup)) != 0)
- {
- fprintf(stderr, "isdntest: atexit error: %s\n", strerror(errno));
- exit(1);
- }
-
- /* open isdn device */
-
- if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0)
- {
- fprintf(stderr, "\nisdntest: cannot open %s: %s\n", I4BDEVICE, strerror(errno));
- fprintf(stderr, " isdnd is probably running, to use isdntest,\n");
- fprintf(stderr, " terminate isdnd and then run isdntest again!\n");
- exit(1);
- }
-
- if((out_cdid = get_cdid(isdnfd)) == 0)
- {
- fprintf(stderr, "isdntest: error getting cdid: %s\n", strerror(errno));
- exit(1);
- }
-
- if((connect_request(isdnfd, out_cdid)) == -1)
- {
- fprintf(stderr, "isdntest: error, outgoing call failed!\n");
- exit(1);
- }
-
- for(;;)
- {
- FD_ZERO(&set);
-
- FD_SET(0, &set);
-
- FD_SET(isdnfd, &set);
-
- ret = select(isdnfd + 1, &set, NULL, NULL, NULL);
-
- if(ret > 0)
- {
- if(FD_ISSET(isdnfd, &set))
- isdnrdhdl(isdnfd);
-
- if(FD_ISSET(0, &set))
- kbdrdhdl();
- }
- else
- {
- fprintf(stderr, "isdntest: select error: %s\n", strerror(errno));
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * data from keyboard available
- *---------------------------------------------------------------------------*/
-static void
-kbdrdhdl(void)
-{
- cleanup();
- exit(2);
-}
-
-/*---------------------------------------------------------------------------*
- * data from /dev/isdn available, read and process them
- *---------------------------------------------------------------------------*/
-static void
-isdnrdhdl(int isdnfd)
-{
- static unsigned char buf[1024];
- int len;
-
- if((len = read(isdnfd, buf, 1024 - 1)) > 0)
- {
- switch (buf[0])
- {
- case MSG_CONNECT_IND:
- handle_connect_ind(&buf[0]);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- handle_connect_active_ind(&buf[0]);
- break;
-
- case MSG_DISCONNECT_IND:
- handle_disconnect(&buf[0]);
- break;
-
- default:
- if(debug_level)
- fprintf(stderr, "isdntest: unknown message 0x%x = %c\n", buf[0], buf[0]);
- break;
- }
- }
- else
- {
- fprintf(stderr, "isdntest: read error, errno = %d, length = %d", errno, len);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntest - i4b selftest, compiled %s %s\n",__DATE__, __TIME__);
- fprintf(stderr, "usage: isdntest -c <ctrl> -h -i <telno> -o <telno>\n");
- fprintf(stderr, " -c <ctrl> specify controller to use\n");
- fprintf(stderr, " -h use HDLC as Bchannel protocol\n");
- fprintf(stderr, " -i <telno> incoming telephone number\n");
- fprintf(stderr, " -o <telno> outgoing telephone number\n");
- fprintf(stderr, " -w wait for keyboard entry to disconnect\n");
- fprintf(stderr, " -t num send test pattern num times\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * initiate an outgoing connection
- *---------------------------------------------------------------------------*/
-int
-connect_request(int isdnfd, unsigned int cdid)
-{
- msg_connect_req_t mcr;
- int ret;
-
- bzero(&mcr, sizeof(msg_connect_req_t));
-
- mcr.controller = controller;
- mcr.channel = CHAN_ANY; /* any channel */
- mcr.cdid = cdid; /* cdid from get_cdid() */
-
- if(usehdlc)
- mcr.bprot = BPROT_RHDLC;/* b channel protocol */
- else
- mcr.bprot = BPROT_NONE; /* b channel protocol */
-
- mcr.driver = BDRV_RBCH; /* raw b channel driver */
- mcr.driver_unit = DATAUNIT0; /* raw b channel driver unit */
-
- strcpy(mcr.dst_telno, outgoingnumber);
- strcpy(mcr.src_telno, incomingnumber);
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_REQ, &mcr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_REQ failed: %s", strerror(errno));
- return(-1);
- }
- fprintf(stderr, "isdntest: calling out to telephone number [%s] \n", outgoingnumber);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle setup indicator
- *---------------------------------------------------------------------------*/
-void
-handle_connect_ind(unsigned char *ptr)
-{
- msg_connect_ind_t *msi = (msg_connect_ind_t *)ptr;
-
- fprintf(stderr, "isdntest: incoming SETUP: from %s to %s\n",
- msi->src_telno,
- msi->dst_telno);
-
- fprintf(stderr, " channel %d, controller %d, bprot %d, cdid %d\n",
- msi->channel,
- msi->controller,
- msi->bprot,
- msi->header.cdid);
-
- in_cdid = msi->header.cdid;
-
- if(strcmp(msi->dst_telno, outgoingnumber))
- {
- msg_connect_resp_t msr;
- int ret;
-
- fprintf(stderr, "isdntest: ignoring incoming SETUP: my number [%s] != outgoing [%s]\n",
- msi->dst_telno, outgoingnumber);
-
- msr.cdid = in_cdid;
- msr.response = SETUP_RESP_DNTCRE;
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &msr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_RESP ignore failed: %s", strerror(errno));
- exit(1);
- }
-
- }
- else
- {
- msg_connect_resp_t msr;
- int ret;
-
- fprintf(stderr, "isdntest: accepting call, sending CONNECT_RESPONSE .....\n");
-
- msr.cdid = in_cdid;
- msr.response = SETUP_RESP_ACCEPT;
-
- if(usehdlc)
- msr.bprot = BPROT_RHDLC;
- else
- msr.bprot = BPROT_NONE;
-
- msr.driver = BDRV_RBCH;
- msr.driver_unit = DATAUNIT1;
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &msr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_RESP accept failed: %s", strerror(errno));
- exit(1);
- }
- }
-}
-
-#define SLEEPTIME 5
-
-/*---------------------------------------------------------------------------*
- * handle connection active
- *---------------------------------------------------------------------------*/
-void
-handle_connect_active_ind(unsigned char *ptr)
-{
- msg_connect_active_ind_t *msi = (msg_connect_active_ind_t *)ptr;
- int i;
-
- fprintf(stderr, "isdntest: connection active, cdid %d\n", msi->header.cdid);
-
- if(out_cdid == msi->header.cdid)
- {
- if(waitchar)
- {
- fprintf(stderr, "isdntest: press any key to disconnect ...%c%c%c\n", 0x07, 0x07, 0x07);
- getchar();
- }
- else
- {
- if(dotest)
- {
- do_test();
- }
- else
- {
- fprintf(stderr, "isdntest: %d secs delay until disconnect:", SLEEPTIME);
-
- for(i=0; i < SLEEPTIME;i++)
- {
- fprintf(stderr, " .");
- sleep(1);
- }
- fprintf(stderr, "\n");
- }
- cleanup();
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle disconnect indication
- *---------------------------------------------------------------------------*/
-void
-handle_disconnect(unsigned char *ptr)
-{
- msg_disconnect_ind_t *mdi = (msg_disconnect_ind_t *)ptr;
-
- if(mdi->header.cdid == out_cdid)
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (out_cdid), cause %d\n",
- mdi->header.cdid, mdi->cause);
-
- out_cdid = CDID_UNUSED;
- }
- else if(mdi->header.cdid == in_cdid)
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (in_cdid), cause %d\n",
- mdi->header.cdid, mdi->cause);
- in_cdid = CDID_UNUSED;
- }
- else
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (???), cause %d\n",
- mdi->header.cdid, mdi->cause);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * hang up
- *---------------------------------------------------------------------------*/
-int
-disconnect_request(int isdnfd, unsigned int cdid)
-{
- msg_discon_req_t mdr;
- int ret;
-
- mdr.cdid = cdid;
- mdr.cause = (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL;
-
- if((ret = ioctl(isdnfd, I4B_DISCONNECT_REQ, &mdr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_DISCONNECT_REQ failed: %s", strerror(errno));
- return(-1);
- }
- fprintf(stderr, "isdntest: sending disconnect request\n");
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * get cdid from kernel
- *---------------------------------------------------------------------------*/
-unsigned int
-get_cdid(int isdnfd)
-{
- msg_cdid_req_t mcr;
- int ret;
-
- mcr.cdid = 0;
-
- if((ret = ioctl(isdnfd, I4B_CDID_REQ, &mcr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CDID_REQ failed: %s", strerror(errno));
- return(0);
- }
- fprintf(stderr, "isdntest: got cdid %d from kernel\n", mcr.cdid);
- return(mcr.cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * make shure all cdid's are inactive before leaving
- *---------------------------------------------------------------------------*/
-void cleanup(void)
-{
- int len;
- char buf[1024];
-
- if(out_cdid != CDID_UNUSED)
- {
- fprintf(stderr, "isdntest: cleanup, send disconnect req for out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
- disconnect_request(isdnfd, out_cdid);
- }
-
- while((out_cdid != CDID_UNUSED) || (in_cdid != CDID_UNUSED))
- {
- fprintf(stderr, "isdntest: cleanup, out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
-
- if((len = read(isdnfd, buf, 1024 - 1)) > 0)
- {
- switch (buf[0])
- {
- case MSG_CONNECT_IND:
- handle_connect_ind(&buf[0]);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- handle_connect_active_ind(&buf[0]);
- break;
-
- case MSG_DISCONNECT_IND:
- handle_disconnect(&buf[0]);
- break;
-
- default:
- fprintf(stderr, "isdntest: unknown message 0x%x = %c\n", buf[0], buf[0]);
- break;
- }
- }
- else
- {
- fprintf(stderr, "isdntest: read error, errno = %d, length = %d", errno, len);
- }
- }
- fprintf(stderr, "isdntest: exit cleanup, out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * test the b-channels
- *---------------------------------------------------------------------------*/
-int do_test(void)
-{
-
-#define FPH 0x3c
-#define FPL 0x66
-
- int fd0, fd1;
- unsigned char wrbuf[2048];
- unsigned char rdbuf[2048];
- int sz;
- fd_set set;
- struct timeval timeout;
- int ret;
- int frame;
- int errcnt;
- int frm_len;
- int bytecnt = 0;
- time_t start_time;
- time_t cur_time;
- time_t run_time;
-
- if((fd0 = open(DATADEV0, O_RDWR)) == -1)
- {
- fprintf(stderr, "open of %s failed: %s", DATADEV0, strerror(errno));
- return(-1);
- }
-
- if((fd1 = open(DATADEV1, O_RDWR)) == -1)
- {
- fprintf(stderr, "open of %s failed: %s", DATADEV1, strerror(errno));
- return(-1);
- }
-
- printf("\n");
- frame = 0;
- errcnt = 0;
-
- frm_len = 2;
-
- start_time = time(NULL);
-
- printf(" frame size errors totalbytes bps elapsedtime\n");
-
- for(;dotest > 0; dotest--)
- {
- setup_wrfix(frm_len, &wrbuf[0]);
-
- frame++;
-
- bytecnt += frm_len;
-
- printf("%6d %4d", frame, frm_len);
- fflush(stdout);
-
- if((sz = write(fd0, wrbuf, frm_len)) != frm_len)
- {
- fprintf(stderr, "write (%d of %d bytes) to %s failed: %s\n", sz, frm_len, DATADEV0, strerror(errno));
- }
-
- timeout.tv_sec = 2;
- timeout.tv_usec = 0;
-
- FD_ZERO(&set);
-
- FD_SET(0, &set);
- FD_SET(fd1, &set);
-
- ret = select(fd1+1, &set, NULL, NULL, &timeout);
-
- if(ret > 0)
- {
- if(FD_ISSET(fd1, &set))
- {
- if((sz = read(fd1, rdbuf, 2048)) != frm_len)
- {
- fprintf(stderr, "read (%d bytes) from %s failed: %s\n", sz, DATADEV1, strerror(errno));
- }
-
- cur_time = time(NULL);
- run_time = difftime(cur_time, start_time);
-
- if(run_time == 0)
- run_time = 1;
-
- printf(" %6d %10d %4d %2.2d:%2.2d:%2.2d \r",
- errcnt, bytecnt,
- (int)((int)bytecnt/(int)run_time),
- (int)run_time/3600, (int)run_time/60, (int)run_time%60);
- fflush(stdout);
-
- errcnt += check_rd(frm_len, &wrbuf[0], &rdbuf[0]);
-
-#ifdef NOTDEF
- for(i=0; i<sz; i++)
- {
- printf("0x%02x ", (unsigned char)rdbuf[i]);
- }
- printf("\n");
-#endif
- }
-
- if(FD_ISSET(0, &set))
- {
- return(0);
- printf("\n\n");
- }
- }
- else
- {
- fprintf(stderr, "isdntest, do_test: select error: %s\n", strerror(errno));
- }
-
- frm_len = frm_len*2;
- if(frm_len > 2048)
- frm_len = 2;
-
- }
- printf("\n\n");
- return(0);
-}
-
-void
-setup_wrfix(int len, unsigned char *buf)
-{
- register int i;
-
- for(i=0; i<len;)
- {
- *buf = FPH;
- buf++;
- *buf = FPL;
- buf++;
- i+=2;
- }
-}
-
-int
-check_rd(int len, unsigned char *wbuf, unsigned char *rbuf)
-{
- register int i;
- int ret = 0;
-
- for(i=0; i<len; i++)
- {
- if(*wbuf != *rbuf)
- {
- fprintf(stderr, "\nERROR, byte %d, written 0x%02x, read 0x%02x\n", i, *wbuf, *rbuf);
- ret++;
- }
- wbuf++;
- rbuf++;
- }
- return(ret);
-}
-
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/1tr6.c b/usr.sbin/i4b/isdntrace/1tr6.c
deleted file mode 100644
index 1c8c1846cd39..000000000000
--- a/usr.sbin/i4b/isdntrace/1tr6.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * 1tr6.c - print 1TR6 protocol traces
- * -----------------------------------
- *
- * $Id: 1tr6.c,v 1.4 1998/12/05 18:04:08 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:18:38 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-static int p_1tr6address(char *pbuf, unsigned char buf[]);
-static int p_1tr6cause(char *pbuf, unsigned char buf[]);
-
-/*---------------------------------------------------------------------------*
- * decode the (german) national specific 1TR6 protocol
- *---------------------------------------------------------------------------*/
-void
-decode_1tr6(char *pbuf, int n, int off, unsigned char *buf, int raw)
-{
- int codeset = 0;
- int oldcodeset = 0;
- int codelock = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- if(raw)
- {
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- sprintf((pbuf+strlen(pbuf)), "1TR6: ");
-
- /* protocol discriminator */
-
- i = 0;
-
- pd = buf[i];
-
- switch(pd)
- {
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "pd=N0, ");
- break;
- case 0x41:
- sprintf((pbuf+strlen(pbuf)), "pd=N1, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "pd=UNDEF (0x%02x), ",pd);
- break;
- }
-
- /* call reference */
-
- i++;
-
- len = buf[i] & 0x0f;
-
- switch(len)
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+1] & 0x80) ? "(from destination)" : "(from origination)");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "cr: LEN=%d %s 0x%02x 0x%02x, ", len, (buf[i+1] & 0x80) ? "org" : "dst", (buf[i+1] & 0x7f), (buf[i+2] & 0x7f));
- break;
- }
-
- i += (len+1);
-
- /* message type */
-
- sprintf((pbuf+strlen(pbuf)), "message=");
-
- if(pd == 0x40) /* protocol discriminator N0 */
- {
- switch(buf[i])
- {
- case 0x61:
- sprintf((pbuf+strlen(pbuf)), "REGISTER INDICATION: ");
- break;
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "CANCEL INDICATION: ");
- break;
- case 0x63:
- sprintf((pbuf+strlen(pbuf)), "FACILITY STATUS: ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "STATUS ACKNOWLEDGE: ");
- break;
- case 0x65:
- sprintf((pbuf+strlen(pbuf)), "STATUS REJECT: ");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "FACILITY INFORMATION: ");
- break;
- case 0x67:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION ACKNOWLEDGE: ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION REJECT: ");
- break;
- case 0x75:
- sprintf((pbuf+strlen(pbuf)), "CLOSE: ");
- break;
- case 0x77:
- sprintf((pbuf+strlen(pbuf)), "CLOSE ACKNOWLEDGE: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x40 MSG=0x%02x, ", buf[i]);
- break;
- }
- }
- else if(pd == 0x41)
- {
- switch(buf[i])
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "ESCAPE: ");
- break;
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "ALERT: ");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "CALL SENT: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "CONNECT: ");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "CONNECT ACKNOWLEDGE: ");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "SETUP: ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "SETUP ACKNOWLEDGE: ");
- break;
-
- case 0x26:
- sprintf((pbuf+strlen(pbuf)), "RESUME: ");
- break;
- case 0x2e:
- sprintf((pbuf+strlen(pbuf)), "RESUME ACKNOWLEDGE: ");
- break;
- case 0x22:
- sprintf((pbuf+strlen(pbuf)), "RESUME REJECT: ");
- break;
- case 0x25:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND: ");
- break;
- case 0x2d:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND ACKNOWLEDGE: ");
- break;
- case 0x21:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND REJECT: ");
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "USER INFORMATION: ");
- break;
-
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "DETACH");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "DISCONNECT: ");
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "RELEASE: ");
- break;
- case 0x5a:
- sprintf((pbuf+strlen(pbuf)), "RELEASE ACKNOWLEDGE");
- break;
-
- case 0x6e:
- sprintf((pbuf+strlen(pbuf)), "CANCEL ACKNOWLEDGE: ");
- break;
- case 0x67:
- sprintf((pbuf+strlen(pbuf)), "CANCEL REJECT: ");
- break;
- case 0x69:
- sprintf((pbuf+strlen(pbuf)), "CONGESTION CONTROL: ");
- break;
- case 0x60:
- sprintf((pbuf+strlen(pbuf)), "FACILITY: ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "FACILITY ACKNOWLEDGE: ");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "FACILITY CANCEL: ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REGISTER: ");
- break;
- case 0x65:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REJECT: ");
- break;
- case 0x6d:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "REGISTER ACKNOWLEDGE: ");
- break;
- case 0x6f:
- sprintf((pbuf+strlen(pbuf)), "REGISTER REJECT: ");
- break;
- case 0x63:
- sprintf((pbuf+strlen(pbuf)), "STATUS: ");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x41 MSG=0x%02x, ", buf[i]);
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x%02x MSG=0x%02x, ", pd, buf[i]);
- }
-
- /* other information elements */
-
- i++;
-
- for (; i < n;)
- {
- sprintf((pbuf+strlen(pbuf)), "\n ");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element */
-
- switch(buf[i] & 0x70)
- {
- case 0x00: /* reserved */
- sprintf((pbuf+strlen(pbuf)), "[reserved single octett info]");
- break;
-
- case 0x10: /* shift */
- oldcodeset = codeset;
- codeset = buf[i] & 0x07;
- if(buf[i] & 0x08)
- codelock = 0;
- else
- codelock = 1;
- sprintf((pbuf+strlen(pbuf)), "[shift: codeset=%d lock=%d]", codeset, codelock);
- break;
-
- case 0x20: /* more data */
- sprintf((pbuf+strlen(pbuf)), "[more data]");
- break;
-
- case 0x30: /* congestion level */
- sprintf((pbuf+strlen(pbuf)), "[congestion level = %d]", buf[i] & 0x0f);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNDEF SINGLE OCTET ELEMENT 0x%02x]", buf[i]);
- break;
- }
-
- i++; /* next */
-
- }
- else
- {
- /* variable length info element */
-
- if(codeset == 0)
- {
- switch(buf[i])
- {
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[cause: ");
- i += p_1tr6cause(pbuf, &buf[i]);
- goto next;
- break;
-
- case 0x0c:
- sprintf((pbuf+strlen(pbuf)), "[connected address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
-
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "[call identity: ");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "[channel id: channel=");
- i += 2;
- switch(buf[i] & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no channel");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "B-1");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "B-2");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "any channel");
- break;
- }
- if(buf[i] & 0x08)
- sprintf((pbuf+strlen(pbuf)), " (exclusive)]");
- else
- sprintf((pbuf+strlen(pbuf)), " (preferred)]");
- i++;
- goto next;
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "[network specific facilities: ");
- i++;
- len = buf[i];
- i+=2;
- switch(buf[i])
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Sperre");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "AWS 1");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "AWS 2");
- break;
- case 0xe:
- sprintf((pbuf+strlen(pbuf)), "Konferenz");
- break;
- case 0xf:
- sprintf((pbuf+strlen(pbuf)), "B-Kan uebern.");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "aktvrg. ghlt. Vbdg.");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "3er Konf");
- break;
- case 0x12:
- sprintf((pbuf+strlen(pbuf)), "1seitg D/G Wechsel");
- break;
- case 0x13:
- sprintf((pbuf+strlen(pbuf)), "2seitig D/G Wechsel");
- break;
- case 0x14:
- sprintf((pbuf+strlen(pbuf)), "Rufnr. identifiz.");
- break;
- case 0x15:
- sprintf((pbuf+strlen(pbuf)), "GBG");
- break;
- case 0x17:
- sprintf((pbuf+strlen(pbuf)), "ueberg. Ruf");
- break;
- case 0x1a:
- sprintf((pbuf+strlen(pbuf)), "um/weitergel. Ruf");
- break;
- case 0x1b:
- sprintf((pbuf+strlen(pbuf)), "unterdr. A-Rufnr.");
- break;
- case 0x1e:
- sprintf((pbuf+strlen(pbuf)), "Verbdg. deaktivieren");
- break;
- case 0x1d:
- sprintf((pbuf+strlen(pbuf)), "Verbdg. aktivieren");
- break;
- case 0x1f:
- sprintf((pbuf+strlen(pbuf)), "SPV");
- break;
- case 0x23:
- sprintf((pbuf+strlen(pbuf)), "Rueckw. 2seitg. DW");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "Anrufumltg. priv. Netz");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined");
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)), ", serv=%d", buf[i]);
- i++;
- sprintf((pbuf+strlen(pbuf)), ", ainfo=%d", buf[i]);
- i++;
- len-=4;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "[display: ");
- break;
- case 0x2c:
- sprintf((pbuf+strlen(pbuf)), "[keypad: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "[origination address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "[destination address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x7e:
- sprintf((pbuf+strlen(pbuf)), "[user-user information: ");
- break;
- case 0x7f:
- sprintf((pbuf+strlen(pbuf)), "[reserved: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
- break;
- }
- }
- else if(codeset == 6)
- {
- switch(buf[i])
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "[service ind: serv=");
- i+= 2;
- switch(buf[i])
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "phone");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "a/b");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "X.21");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "fax g4");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "btx");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "64k data");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "X.25");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "teletex");
- break;
- case 0x0a:
- sprintf((pbuf+strlen(pbuf)), "mixed");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "temex");
- break;
- case 0x0e:
- sprintf((pbuf+strlen(pbuf)), "picturephone");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "btx (new)");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "videophone");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined");
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)), ", ainfo=0x%02x]", buf[i]);
- i++;
- goto next;
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "[charging information: ");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "[date: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "[facility select: ");
- break;
- case 0x06:
- sprintf((pbuf+strlen(pbuf)), "[status of facilities: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "[status of called party: ");
- i+=2;
- switch(buf[i])
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "no information]");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "is being called]");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined (0x%02x)]", buf[i]);
- break;
- }
- i++;
- goto next;
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[additional tx attributes: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- switch(buf[j+i] &0x70)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no satellite link");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "one satellite link");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "two satellite links");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "three satellite links");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined value");
- break;
- }
- if(buf[j+i] & 0x80)
- sprintf((pbuf+strlen(pbuf)),"(flag=req)]");
- else
- sprintf((pbuf+strlen(pbuf)),"(flag=ind)]");
- }
- i += j;
- goto next;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "[ILLEGAL CODESET = 0x%02x", codeset);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
- sprintf((pbuf+strlen(pbuf)),"\n");
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-static int
-p_1tr6cause(char *pbuf, unsigned char buf[])
-{
- int j;
- int len;
- int i = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- switch(len)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(0));
- break;
- case 1:
- i++;
- sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(buf[i] & 0x7f));
- break;
- case 2:
- i++;
- sprintf((pbuf+strlen(pbuf)), "%s, location: ", print_cause_1tr6(buf[i] & 0x7f));
- i++;
- switch(buf[i] & 0x0f)
- {
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "public network");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "private network");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "no information");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- break;
- default:
- i++; /* index -> length */
- len = buf[i];
- i++; /* index -> 1st param */
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)),"]");
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-static int
-p_1tr6address(char *pbuf, unsigned char buf[])
-{
- int j;
- int len;
- int i = 0;
- int tp;
-
- i++; /* index -> length */
- len = buf[i];
- i++; /* index -> 1st param */
- tp = buf[i];
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " (type=international, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " (type=national, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " (type=%d, ", ((tp & 0x70) >> 4));
- break;
- }
-
- switch(tp & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "plan=unknown)");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "plan=ISDN)");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "plan=%d)", (tp & 0x0f));
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += j;
-
- return(i);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/Makefile b/usr.sbin/i4b/isdntrace/Makefile
deleted file mode 100644
index 150c18d88022..000000000000
--- a/usr.sbin/i4b/isdntrace/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG = isdntrace
-SRCS = q921.c q931.c q931_util.c q932_fac.c 1tr6.c trace.c \
- pcause_1tr6.c pcause_q850.c
-#CFLAGS += -Wall -g
-MAN8 = isdntrace.8
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/i4b/isdntrace/cable.txt b/usr.sbin/i4b/isdntrace/cable.txt
deleted file mode 100644
index 890d8d4d7104..000000000000
--- a/usr.sbin/i4b/isdntrace/cable.txt
+++ /dev/null
@@ -1,60 +0,0 @@
- *---------------------------------------------------------------------------
- *
- * Custom cable to trace an ISDN S0 bus with two passive (!) ISDN boards
- * ---------------------------------------------------------------------
- *
- * $Id: cable.txt,v 1.2 1998/01/22 20:39:49 hm Exp $
- *
- * last edit-date: [Thu Jan 22 19:57:50 1998]
- *
- * -hm documentation of analyze mode
- *
- *---------------------------------------------------------------------------*/
-
-The cable consists of a RJ-45 plug with both tx and rx connected and
-two jacks; the tx cables from the plug are wired to one jack and the
-rx cables from the plug are wired to the other jack.
-
-The computer must be equipped with two (!) supported passive cards and
-the cable from one card is plugged into one of the jacks while the cable
-to from the other card is plugged into the other jack.
-
-Now one card monitors the tx part of the S0 bus and the other card
-monitors the rx part.
-
-Which card functions as the rx side and which as the tx side can be
-specified as options to the isdntrace utility (-R and -T) which has
-to be run in analyzer mode (-a) to support this configuration.
-
-
- 1
- 2
- 3
- +--------------4 receiving-side board
- S0-bus +--|--------------5 in computer (jack for
- to analyze | | 6 cable to passive controller)
- 8 | | 7
- 7 | | 8
- transmit - 6------------|--|--+
- receive - 5------------+ | |
- receive + 4---------------+ |
- transmit + 3------------+ |
- 2 | | 1
- 1 | | 2
- plug into | | 3
- S0 bus +-----|-----------4 transmitting-side board
- +-----------5 in computer (jack for
- 6 cable to passive controller)
- 7
- 8
-
-
-
- RJ-45 plug RJ-45 jack
- view from the front view from the front
- cable goes out to the rear
-
- /--------- / ----------
- | 87654321 | | 12345678 |
- |__ __|/ |/_ /_|
- |____|/ |/___|
diff --git a/usr.sbin/i4b/isdntrace/isdntrace.8 b/usr.sbin/i4b/isdntrace/isdntrace.8
deleted file mode 100644
index 62c5d07eef59..000000000000
--- a/usr.sbin/i4b/isdntrace/isdntrace.8
+++ /dev/null
@@ -1,205 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isdntrace.8,v 1.9 1998/12/05 18:04:10 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:18:59 1998]
-.\"
-.Dd October 19, 1998
-.Dt isdntrace 8
-.Sh NAME
-.Nm isdntrace
-.Nd isdn4bsd ISDN protocol trace utility
-.Sh SYNOPSIS
-.Nm isdntrace
-.Op Fl a
-.Op Fl b
-.Op Fl d
-.Op Fl f Ar filename
-.Op Fl h
-.Op Fl i
-.Op Fl l
-.Op Fl n Ar number
-.Op Fl o
-.Op Fl p Ar filename
-.Op Fl r
-.Op Fl u Ar number
-.Op Fl B
-.Op Fl F
-.Op Fl P
-.Op Fl R Ar unit
-.Op Fl T Ar unit
-.Sh DESCRIPTION
-.Nm isdntrace
-is part of the isdn4bsd package and is used to provide the user with a
-mnemonic display of the layers 1, 2 and 3 protocol activities on
-the D channel and hex dump of the B channel(s) activities.
-.Pp
-Together with two passive supported cards and an easy to build cable it can
-also be used to monitor the complete traffic on a S0 bus providing S0 bus
-analyzer features.
-.Pp
-The
-.Nm
-utility is only available for passive supported cards.
-.Pp
-The following options can be used:
-.Bl -tag -width Ds
-.It Fl a
-Run
-.Nm
-in analyzer mode by using two passive cards and a custom cable which can
-be build as described in the file
-.Em cable.txt
-in the isdn4bsd source distribution. One card acts as a receiver for the
-transmitting direction on the S0 bus while the other card acts as a receiver
-for the receiving direction on the S0 bus. Complete traffic monitoring is
-possible using this setup.
-.It Fl b
-switch B channel tracing on (default off).
-.It Fl d
-switch D channel tracing off (default on).
-.It Fl f
-Use
-.Ar filename
-as the name of a file into which to write tracing output (default filename is
-isdntrace<n> where n is the number of the unit to trace).
-.It Fl h
-switch display of header off (default on).
-.It Fl i
-print layer 1 (I.430) INFO signals to monitor layer 1 activity (default off).
-.It Fl l
-switch displaying of Layer 2 (Q.921) frames off (default on).
-.It Fl n
-This option takes a numeric argument specifying the minimum
-frame size in octetts a frame must have to be displayed. (default 0)
-.It Fl o
-switch off writing trace output to a file (default on).
-.It Fl p
-Use
-.Ar filename
-as the name of a file used for the -B and -P options (default filename
-is isdntracebin<n> where n is the number of the unit to trace).
-.It Fl r
-Switch off printing a raw hexadecimal dump of the packets preceding
-the decoded protocol information (default on).
-.It Fl u
-Use
-.Ar number
-as the unit number of the controller card to trace (default 0).
-.It Fl B
-Write undecoded binary trace data to a file for later or remote
-analyzing (default off).
-.It Fl F
-This option can only be used when option -P (playback from binary data file)
-is used. The -F option causes playback not to stop at end of file but rather
-to wait for additional data to be available from the input file.
-.Pp
-This option is useful when trace data is accumulated in binary format (to
-save disk space) but a monitoring functionality is desired.
-(default off).
-.It Fl P
-Read undecoded binary trace data from file instead from device (default off).
-.It Fl R
-Use
-.Ar unit
-as the receiving interface unit number in analyze mode.
-.It Fl T
-Use
-.Ar unit
-as the transmitting interface unit number in analyze mode.
-.El
-.Pp
-When the USR1 signal is sent to a
-.Nm
-process, the currently used logfiles are reopened, so that logfile
-rotation becomes possible.
-.Pp
-The trace output should be obvious. It is very handy to have the following
-standard texts available when tracing ISDN protocols:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I.430
-ISDN BRI layer 1 protocol description.
-.It Ar Q.921
-ISDN D-channel layer 2 protocol description.
-.It Ar Q.931
-ISDN D-channel layer 3 protocol description.
-.It Ar 1TR6
-German-specific ISDN layer 3 protocol description. (NOTICE: decoding
-of the 1TR6 protocol is included but not supported since i dont have
-any longer access to a 1TR6 based ISDN installation.)
-.El
-.Pp
-
-.Nm Isdntrace
-automatically detects the layer 3 protocol being used by looking at the
-Protocol Discriminator (see: Q.931/1993 pp. 53).
-.Pp
-
-
-.Sh FILES
-.Bl -tag -width daddeldi -compact
-.It Pa /dev/i4btrc<n>
-The devicefile(s) used to get the trace messages for ISDN card unit <n>
-out of the kernel.
-.El
-
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdntrace -f /var/tmp/isdn.trace
-.Ed
-.Pp
-will start D channel tracing on passive controller 0 with all except B
-channel tracing enabled and logs everything into the output file
-/tmp/isdn.trace.
-
-.Sh SEE ALSO
-.Xr isdnd 8
-
-.Sh BUGS
-Still some or more left.
-
-.Sh STANDARDS
-ITU Recommendations I.430, Q.920, Q.921, Q.930, Q.931
-.Pp
-FTZ Richtlinie 1TR3, Band III
-.Pp
-ITU Recommendation Q.932 (03/93), Q.950 (03/93)
-.Pp
-ETSI Recommendation ETS 300 179 (10/92), ETS 300 180 (10/92)
-.Pp
-ETSI Recommendation ETS 300 181 (04/93), ETS 300 182 (04/93)
-.Pp
-ITU Recommendation X.208, X.209
-
-.Sh AUTHOR
-The
-.Nm
-utility was written by Gary Jennejohn and Hellmuth Michaelis.
-.Pp
-This manual page was written by Hellmuth Michaelis, he can be reached
-at hm@kts.org.
-
diff --git a/usr.sbin/i4b/isdntrace/pcause_1tr6.c b/usr.sbin/i4b/isdntrace/pcause_1tr6.c
deleted file mode 100644
index 42f244d3f24b..000000000000
--- a/usr.sbin/i4b/isdntrace/pcause_1tr6.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause_1tr6.c,v 1.4 1998/12/23 10:03:55 hm Exp $
- *
- * last edit-date: [Wed Dec 23 10:57:11 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "pcause_1tr6.h"
-
-char *
-print_cause_1tr6(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_1TR6_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_1TR6_ICRV:
- e = "invalid call reference value";
- break;
-
- case CAUSE_1TR6_BSNI:
- e = "bearer service not implemented";
- break;
-
- case CAUSE_1TR6_CIDNE:
- e = "call identity does not exist";
- break;
-
- case CAUSE_1TR6_CIIU:
- e = "call identity in use";
- break;
-
- case CAUSE_1TR6_NCA:
- e = "no channel available";
- break;
-
- case CAUSE_1TR6_RFNI:
- e = "requested facility not implemented";
- break;
-
- case CAUSE_1TR6_RFNS:
- e = "requested facility not subscribed";
- break;
-
- case CAUSE_1TR6_OCB:
- e = "outgoing calls barred";
- break;
-
- case CAUSE_1TR6_UAB:
- e = "user access busy";
- break;
-
- case CAUSE_1TR6_NECUG:
- e = "non existent CUG";
- break;
-
- case CAUSE_1TR6_NECUG1:
- e = "non existent CUG";
- break;
-
- case CAUSE_1TR6_SPV:
- e = "kommunikationsbeziehung als SPV nicht erlaubt";
- break;
-
- case CAUSE_1TR6_DNO:
- e = "destination not obtainable";
- break;
-
- case CAUSE_1TR6_NC:
- e = "number changed";
- break;
-
- case CAUSE_1TR6_OOO:
- e = "out of order";
- break;
-
- case CAUSE_1TR6_NUR:
- e = "no user responding";
- break;
-
- case CAUSE_1TR6_UB:
- e = "user busy";
- break;
-
- case CAUSE_1TR6_ICB:
- e = "incoming calls barred";
- break;
-
- case CAUSE_1TR6_CR:
- e = "call rejected";
- break;
-
- case CAUSE_1TR6_NCO:
- e = "network congestion";
- break;
-
- case CAUSE_1TR6_RUI:
- e = "remote user initiated";
- break;
-
- case CAUSE_1TR6_LPE:
- e = "local procedure error";
- break;
-
- case CAUSE_1TR6_RPE:
- e = "remote procedure error";
- break;
-
- case CAUSE_1TR6_RUS:
- e = "remote user suspended";
- break;
-
- case CAUSE_1TR6_RUR:
- e = "remote user resumed";
- break;
-
- case CAUSE_1TR6_UIDL:
- e = "user info discharded locally";
- break;
-
- default:
- e = "UNKNOWN error occured";
- break;
- }
-
- sprintf(error_message, "0x%02x: %s", code & 0x7f, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_1tr6.h b/usr.sbin/i4b/isdntrace/pcause_1tr6.h
deleted file mode 100644
index f327cc721c87..000000000000
--- a/usr.sbin/i4b/isdntrace/pcause_1tr6.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause1tr6.h - 1TR6 causes definitions
- * --------------------------------------
- *
- * $Id: pcause_1tr6.h,v 1.3 1998/12/05 18:04:13 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:19:39 1998]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_1tr6(unsigned char code);
-
-/* 1TR6 protocol causes */
-
-#define CAUSE_1TR6_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_1TR6_ICRV 0x01 /* invalid call reference value */
-#define CAUSE_1TR6_BSNI 0x03 /* bearer service not implemented */
-#define CAUSE_1TR6_CIDNE 0x07 /* call identity does not exist */
-#define CAUSE_1TR6_CIIU 0x08 /* call identity in use */
-#define CAUSE_1TR6_NCA 0x0A /* no channel available */
-#define CAUSE_1TR6_RFNI 0x10 /* requested facility not implemented */
-#define CAUSE_1TR6_RFNS 0x11 /* requested facility not subscribed */
-#define CAUSE_1TR6_OCB 0x20 /* outgoing calls barred */
-#define CAUSE_1TR6_UAB 0x21 /* user access busy */
-#define CAUSE_1TR6_NECUG 0x22 /* non existent CUG */
-#define CAUSE_1TR6_NECUG1 0x23 /* non existent CUG */
-#define CAUSE_1TR6_SPV 0x25 /* kommunikationsbeziehung als SPV nicht erlaubt */
-#define CAUSE_1TR6_DNO 0x35 /* destination not obtainable */
-#define CAUSE_1TR6_NC 0x38 /* number changed */
-#define CAUSE_1TR6_OOO 0x39 /* out of order */
-#define CAUSE_1TR6_NUR 0x3A /* no user responding */
-#define CAUSE_1TR6_UB 0x3B /* user busy */
-#define CAUSE_1TR6_ICB 0x3D /* incoming calls barred */
-#define CAUSE_1TR6_CR 0x3E /* call rejected */
-#define CAUSE_1TR6_NCO 0x59 /* network congestion */
-#define CAUSE_1TR6_RUI 0x5A /* remote user initiated */
-#define CAUSE_1TR6_LPE 0x70 /* local procedure error */
-#define CAUSE_1TR6_RPE 0x71 /* remote procedure error */
-#define CAUSE_1TR6_RUS 0x72 /* remote user suspended */
-#define CAUSE_1TR6_RUR 0x73 /* remote user resumed */
-#define CAUSE_1TR6_UIDL 0x7F /* user info discharded locally */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_q850.c b/usr.sbin/i4b/isdntrace/pcause_q850.c
deleted file mode 100644
index 1c98388a4ef9..000000000000
--- a/usr.sbin/i4b/isdntrace/pcause_q850.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause_q850.c,v 1.4 1998/12/23 10:03:55 hm Exp $
- *
- * last edit-date: [Wed Dec 23 10:57:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "pcause_q850.h"
-
-char *
-print_cause_q850(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_Q850_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_Q850_NUNALLC:
- e = "Unallocated (unassigned) number";
- break;
-
- case CAUSE_Q850_NRTTN:
- e = "No route to specified transit network";
- break;
-
- case CAUSE_Q850_NRTDST:
- e = "No route to destination";
- break;
-
- case CAUSE_Q850_SSINFTN:
- e = "Send special information tone";
- break;
-
- case CAUSE_Q850_MDIALTP:
- e = "Misdialled trunk prefix";
- break;
-
- case CAUSE_Q850_CHUNACC:
- e = "Channel unacceptable";
- break;
-
- case CAUSE_Q850_CALLAWD:
- e = "Call awarded and being delivered in an established channel";
- break;
-
- case CAUSE_Q850_PREEMPT:
- e = "Preemption";
- break;
-
- case CAUSE_Q850_PREECRR:
- e = "Preemption - circuit reserved for reuse";
- break;
-
- case CAUSE_Q850_NCCLR:
- e = "Normal call clearing";
- break;
-
- case CAUSE_Q850_USRBSY:
- e = "User busy";
- break;
-
- case CAUSE_Q850_NOUSRRSP:
- e = "No user responding";
- break;
-
- case CAUSE_Q850_NOANSWR:
- e = "No answer from user (user alerted)";
- break;
-
- case CAUSE_Q850_SUBSABS:
- e = "Subscriber absent";
- break;
-
- case CAUSE_Q850_CALLREJ:
- e = "Call rejected";
- break;
-
- case CAUSE_Q850_NUCHNG:
- e = "Number changed";
- break;
-
- case CAUSE_Q850_NONSELUC:
- e = "Non-selected user clearing";
- break;
-
- case CAUSE_Q850_DSTOOORDR:
- e = "Destination out of order";
- break;
-
- case CAUSE_Q850_INVNUFMT:
- e = "Invalid number format";
- break;
-
- case CAUSE_Q850_FACREJ:
- e = "Facility rejected";
- break;
-
- case CAUSE_Q850_STENQRSP:
- e = "Response to STATUS ENQUIRY";
- break;
-
- case CAUSE_Q850_NORMUNSP:
- e = "Normal, unspecified";
- break;
-
- case CAUSE_Q850_NOCAVAIL:
- e = "No circuit / channel available";
- break;
-
- case CAUSE_Q850_NETOOORDR:
- e = "Network out of order";
- break;
-
- case CAUSE_Q850_PFMCDOOSERV:
- e = "Permanent frame mode connection out of service";
- break;
-
- case CAUSE_Q850_PFMCOPER:
- e = "Permanent frame mode connection operational";
- break;
-
- case CAUSE_Q850_TMPFAIL:
- e = "Temporary failure";
- break;
-
- case CAUSE_Q850_SWEQCONG:
- e = "Switching equipment congestion";
- break;
-
- case CAUSE_Q850_ACCINFDIS:
- e = "Access information discarded";
- break;
-
- case CAUSE_Q850_REQCNOTAV:
- e = "Requested circuit/channel not available";
- break;
-
- case CAUSE_Q850_PRECALBLK:
- e = "Precedence call blocked";
- break;
-
- case CAUSE_Q850_RESUNAVAIL:
- e = "Resources unavailable, unspecified";
- break;
-
- case CAUSE_Q850_QOSUNAVAIL:
- e = "Quality of service unavailable";
- break;
-
- case CAUSE_Q850_REQSERVNS:
- e = "Requested facility not subscribed";
- break;
-
- case CAUSE_Q850_OCBARRCUG:
- e = "Outgoing calls barred within CUG";
- break;
-
- case CAUSE_Q850_ICBARRCUG:
- e = "Incoming calls barred within CUG";
- break;
-
- case CAUSE_Q850_BCAPNAUTH:
- e = "Bearer capability not authorized";
- break;
-
- case CAUSE_Q850_BCAPNAVAIL:
- e = "Bearer capability not presently available";
- break;
-
- case CAUSE_Q850_INCSTOACISC:
- e = "Inconsistenciy in designated outg. access info and subscriber class";
- break;
-
- case CAUSE_Q850_SOONOTAVAIL:
- e = "Service or option not available, unspecified";
- break;
-
- case CAUSE_Q850_BCAPNOTIMPL:
- e = "Bearer capability not implemented";
- break;
-
- case CAUSE_Q850_CHTYPNIMPL:
- e = "Channel type not implemented";
- break;
-
- case CAUSE_Q850_REQFACNIMPL:
- e = "Requested facility not implemented";
- break;
-
- case CAUSE_Q850_ORDINBCAVL:
- e = "Only restricted digital information bearer capability is available";
- break;
-
- case CAUSE_Q850_SOONOTIMPL:
- e = "Service or option not implemented, unspecified";
- break;
-
- case CAUSE_Q850_INVCLRFVAL:
- e = "Invalid call reference value";
- break;
-
- case CAUSE_Q850_IDCHDNOEX:
- e = "Identified channel does not exist";
- break;
-
- case CAUSE_Q850_SUSCAEXIN:
- e = "A suspended call exists, but this call identity does not";
- break;
-
- case CAUSE_Q850_CLIDINUSE:
- e = "Call identity in use";
- break;
-
- case CAUSE_Q850_NOCLSUSP:
- e = "No call suspended";
- break;
-
- case CAUSE_Q850_CLIDCLRD:
- e = "Call having the requested call identity has been cleared";
- break;
-
- case CAUSE_Q850_UNOTMEMCUG:
- e = "User not member of CUG";
- break;
-
- case CAUSE_Q850_INCDEST:
- e = "Incompatible destination";
- break;
-
- case CAUSE_Q850_NONEXCUG:
- e = "Non-existent CUG";
- break;
-
- case CAUSE_Q850_INVNTWSEL:
- e = "Invalid transit network selection";
- break;
-
- case CAUSE_Q850_INVMSG:
- e = "Invalid message, unspecified";
- break;
-
- case CAUSE_Q850_MIEMISS:
- e = "Mandatory information element is missing";
- break;
-
- case CAUSE_Q850_MSGTNI:
- e = "Message type non-existent or not implemented";
- break;
-
- case CAUSE_Q850_MSGNCMPT:
- e = "Msg incompatible with call state/message type non-existent/not implemented";
- break;
-
- case CAUSE_Q850_IENENI:
- e = "Information element/parameter non-existent or not implemented";
- break;
-
- case CAUSE_Q850_INVIEC:
- e = "Invalid information element contents";
- break;
-
- case CAUSE_Q850_MSGNCWCS:
- e = "Message not compatible with call state";
- break;
-
- case CAUSE_Q850_RECOTIMEXP:
- e = "Recovery on timer expiry";
- break;
-
- case CAUSE_Q850_PARMNENIPO:
- e = "Parameter non-existent or not implemented, passed on";
- break;
-
- case CAUSE_Q850_MSGUNRDPRM:
- e = "Message with unrecognized parameter, discarded";
- break;
-
- case CAUSE_Q850_PROTERR:
- e = "Protocol error, unspecified";
- break;
-
- case CAUSE_Q850_INTWRKU:
- e = "Interworking, unspecified";
- break;
-
- default:
- e = "ERROR, unknown cause value!";
- break;
- }
-
- sprintf(error_message, "%d: %s (Q.850)", code, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_q850.h b/usr.sbin/i4b/isdntrace/pcause_q850.h
deleted file mode 100644
index a6b947fefa25..000000000000
--- a/usr.sbin/i4b/isdntrace/pcause_q850.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcauseq850.h - Q.850 causes definitions
- * ---------------------------------------
- *
- * $Id: pcause_q850.h,v 1.3 1998/12/05 18:04:18 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:20:05 1998]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_q850(unsigned char code);
-
-/* Q.850 causes */
-
-#define CAUSE_Q850_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_Q850_NUNALLC 0x01 /* Unallocated (unassigned) number */
-#define CAUSE_Q850_NRTTN 0x02 /* No route to specified transit network */
-#define CAUSE_Q850_NRTDST 0x03 /* No route to destination */
-#define CAUSE_Q850_SSINFTN 0x04 /* Send special information tone */
-#define CAUSE_Q850_MDIALTP 0x05 /* Misdialled trunk prefix */
-#define CAUSE_Q850_CHUNACC 0x06 /* Channel unacceptable */
-#define CAUSE_Q850_CALLAWD 0x07 /* Call awarded and being delivered in an established channel */
-#define CAUSE_Q850_PREEMPT 0x08 /* Preemption */
-#define CAUSE_Q850_PREECRR 0x09 /* Preemption - circuit reserved for reuse */
-#define CAUSE_Q850_NCCLR 0x10 /* Normal call clearing */
-#define CAUSE_Q850_USRBSY 0x11 /* User busy */
-#define CAUSE_Q850_NOUSRRSP 0x12 /* No user responding */
-#define CAUSE_Q850_NOANSWR 0x13 /* No answer from user (user alerted) */
-#define CAUSE_Q850_SUBSABS 0x14 /* Subscriber absent */
-#define CAUSE_Q850_CALLREJ 0x15 /* Call rejected */
-#define CAUSE_Q850_NUCHNG 0x16 /* Number changed */
-#define CAUSE_Q850_NONSELUC 0x1A /* Non-selected user clearing */
-#define CAUSE_Q850_DSTOOORDR 0x1B /* Destination out of order */
-#define CAUSE_Q850_INVNUFMT 0x1C /* Invalid number format */
-#define CAUSE_Q850_FACREJ 0x1D /* Facility rejected */
-#define CAUSE_Q850_STENQRSP 0x1E /* Response to STATUS ENQUIRY */
-#define CAUSE_Q850_NORMUNSP 0x1F /* Normal, unspecified */
-#define CAUSE_Q850_NOCAVAIL 0x22 /* No circuit / channel available */
-#define CAUSE_Q850_NETOOORDR 0x26 /* Network out of order */
-#define CAUSE_Q850_PFMCDOOSERV 0x27 /* Permanent frame mode connection out of service */
-#define CAUSE_Q850_PFMCOPER 0x28 /* Permanent frame mode connection operational */
-#define CAUSE_Q850_TMPFAIL 0x29 /* Temporary failure */
-#define CAUSE_Q850_SWEQCONG 0x2A /* Switching equipment congestion */
-#define CAUSE_Q850_ACCINFDIS 0x2B /* Access information discarded */
-#define CAUSE_Q850_REQCNOTAV 0x2C /* Requested circuit/channel not available */
-#define CAUSE_Q850_PRECALBLK 0x2E /* Precedence call blocked */
-#define CAUSE_Q850_RESUNAVAIL 0x2F /* Resources unavailable, unspecified */
-#define CAUSE_Q850_QOSUNAVAIL 0x31 /* Quality of service unavailable */
-#define CAUSE_Q850_REQSERVNS 0x32 /* Requested facility not subscribed */
-#define CAUSE_Q850_OCBARRCUG 0x35 /* Outgoing calls barred within CUG */
-#define CAUSE_Q850_ICBARRCUG 0x36 /* Incoming calls barred within CUG */
-#define CAUSE_Q850_BCAPNAUTH 0x39 /* Bearer capability not authorized */
-#define CAUSE_Q850_BCAPNAVAIL 0x3A /* Bearer capability not presently available */
-#define CAUSE_Q850_INCSTOACISC 0x3E /* Inconsistenciy in designated outgoing access information and subscriber class */
-#define CAUSE_Q850_SOONOTAVAIL 0x3F /* Service or option not available, unspecified */
-#define CAUSE_Q850_BCAPNOTIMPL 0x41 /* Bearer capability not implemented */
-#define CAUSE_Q850_CHTYPNIMPL 0x42 /* Channel type not implemented */
-#define CAUSE_Q850_REQFACNIMPL 0x45 /* Requested facility not implemented */
-#define CAUSE_Q850_ORDINBCAVL 0x46 /* Only restricted digital information bearer capability is available */
-#define CAUSE_Q850_SOONOTIMPL 0x4F /* Service or option not implemented, unspecified */
-#define CAUSE_Q850_INVCLRFVAL 0x51 /* Invalid call reference value */
-#define CAUSE_Q850_IDCHDNOEX 0x52 /* Identified channel does not exist */
-#define CAUSE_Q850_SUSCAEXIN 0x53 /* A suspended call exists, but this call identity does not */
-#define CAUSE_Q850_CLIDINUSE 0x54 /* Call identity in use */
-#define CAUSE_Q850_NOCLSUSP 0x55 /* No call suspended */
-#define CAUSE_Q850_CLIDCLRD 0x56 /* Call having the requested call identity has been cleared */
-#define CAUSE_Q850_UNOTMEMCUG 0x57 /* User not member of CUG */
-#define CAUSE_Q850_INCDEST 0x58 /* Incompatible destination */
-#define CAUSE_Q850_NONEXCUG 0x5A /* Non-existent CUG */
-#define CAUSE_Q850_INVNTWSEL 0x5B /* Invalid transit network selection */
-#define CAUSE_Q850_INVMSG 0x5F /* Invalid message, unspecified */
-#define CAUSE_Q850_MIEMISS 0x60 /* Mandatory information element is missing */
-#define CAUSE_Q850_MSGTNI 0x61 /* Message type non-existent or not implemented */
-#define CAUSE_Q850_MSGNCMPT 0x62 /* Message not compatible with call state or message type non-existent or not implemented */
-#define CAUSE_Q850_IENENI 0x63 /* Information element/parameter non-existent or not implemented */
-#define CAUSE_Q850_INVIEC 0x64 /* Invalid information element contents */
-#define CAUSE_Q850_MSGNCWCS 0x65 /* Message not compatible with call state */
-#define CAUSE_Q850_RECOTIMEXP 0x66 /* Recovery on timer expiry */
-#define CAUSE_Q850_PARMNENIPO 0x67 /* Parameter non-existent or not implemented, passed on */
-#define CAUSE_Q850_MSGUNRDPRM 0x6E /* Message with unrecognized parameter, discarded */
-#define CAUSE_Q850_PROTERR 0x6F /* Protocol error, unspecified */
-#define CAUSE_Q850_INTWRKU 0x7F /* Interworking, unspecified */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/q921.c b/usr.sbin/i4b/isdntrace/q921.c
deleted file mode 100644
index df007a49daca..000000000000
--- a/usr.sbin/i4b/isdntrace/q921.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 1996 Gary Jennejohn. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * 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.
- *
- *---------------------------------------------------------------------------*
- *
- * q.921.c - print Q.921 traces
- * ----------------------------
- *
- * $Id: q921.c,v 1.2 1998/04/16 15:27:02 hm Exp $
- *
- * last edit-date: [Thu Apr 16 15:38:34 1998]
- *
- * -hm splitting
- * -hm printing to buffer
- * -hm slightly reformatted TEI management proc output
- * -hm minor fixes
- * -hm fixing response/command
- * -hm fixing count off by one
- * -hm dump only Q.921 part of frame
- * -hm cleanup
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode LAPD (Q.921) protocol
- *---------------------------------------------------------------------------*/
-int
-decode_lapd(char *pbuf, int n, unsigned char *buf, int dir, int raw, int printit)
-{
- int sap, tei, cmd, p_f;
- int cnt = 0;
- int i;
- char locbuf[32000];
- char *lbufp = &locbuf[0];
-
- *lbufp = '\0';
- *pbuf = '\0';
-
- sap = (buf[0] >> 2) & 0x3f;
- cnt++;
-
- tei = buf[1] >> 1;
- cnt++;
-
- if(dir == FROM_TE)
- cmd = !(buf[0] & 2);
- else
- cmd = buf[0] & 2;
-
- switch (sap)
- {
- /* SAPI control procedures */
- case 0:
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (Call Control), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
-
- if((buf[2] & 0x01) == 0)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "I-Frame: ");
-
- p_f = buf [3] & 1;
-
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "N(S) %d N(R) %d P %d ", buf [2] >> 1, buf [3] >> 1, p_f);
-
- cnt += 2;
- }
- else if((buf[2] & 0x03) == 0x01)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "S-Frame: ");
-
- p_f = buf [3] & 1;
- cmd = buf [2] & 0x0c;
-
- if(printit)
- {
- if (cmd == 0)
- sprintf((lbufp+strlen(lbufp)), "RR N(R) %d PF %d ", buf [3] >> 1, p_f);
- if (cmd == 4)
- sprintf((lbufp+strlen(lbufp)), "RNR N(R) %d PF %d ", buf [3] >> 1, p_f);
- if (cmd == 8)
- sprintf((lbufp+strlen(lbufp)), "REJ N(R) %d PF %d ", buf [3] >> 1, p_f);
- }
- cnt += 2;
- }
- else if((buf[2] & 0x03) == 0x03)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "U-Frame: ");
-
- p_f = (buf [2] & 0x10) >> 4;
- cmd = buf [2] & 0xec;
-
- if(printit)
- {
- if (cmd == 0x6c)
- sprintf((lbufp+strlen(lbufp)), "SABME PF %d ", p_f);
- if (cmd == 0x0c)
- sprintf((lbufp+strlen(lbufp)), "DM PF %d ", p_f);
- if (cmd == 0)
- sprintf((lbufp+strlen(lbufp)), "UI PF %d ", p_f);
- if (cmd == 0x40)
- sprintf((lbufp+strlen(lbufp)), "DISC PF %d ", p_f);
- if (cmd == 0x60)
- sprintf((lbufp+strlen(lbufp)), "UA PF %d ", p_f);
- if (cmd == 0x84)
- sprintf((lbufp+strlen(lbufp)), "FRMR PF %d ", p_f);
- if (cmd == 0xac)
- sprintf((lbufp+strlen(lbufp)), "XID PF %d ", p_f);
- /* information field ??? */
- }
- cnt++;
- }
- break;
- }
-
- /* D channel X.25 */
-
- case 16:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (X.25), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
-
- /* Loopback test */
-
- case 32:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (Loopbacktest), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
-
- /* SAPI layer 2 management functions */
-
- case 63:
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (TEI-Management), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
-
- if (tei != 127)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "ILLEGAL TEI\n");
- cnt = n;
- goto dump;
- }
-
- if (buf [2] != 3 && buf [3] != 0xf)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "invalid format!\n");
- cnt = n;
- goto dump;
- }
- cnt+= 2; /* UI + MEI */
-
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Ri=0x%04hx, ", *(short *)&buf[4]);
- cnt += 2; /* Ri */
-
- switch (buf[6])
- {
- case 1:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdRequest, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 2:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdAssign, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 3:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdDenied, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 4:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdCheckReq, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 5:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdCheckResp, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 6:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdRemove, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 7:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdVerify, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- default:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Unknown Msg Type\n");
- cnt = n;
- goto dump;
- }
- break;
- }
-
- /* Illegal SAPI */
-
- default:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: ERROR, SAP=%d (Illegal SAPI), %c, TEI=%d\n", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
- }
-
-dump:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "\n");
-
- if(raw && printit)
- {
- int j;
- for (i = 0; i < cnt; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i);
- for (j = 0; j < 16; j++)
- if (i + j < cnt)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < cnt; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),"%s", &locbuf[0]);
-
- return (cnt);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/q931.c b/usr.sbin/i4b/isdntrace/q931.c
deleted file mode 100644
index 3cc2a3848a4f..000000000000
--- a/usr.sbin/i4b/isdntrace/q931.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * q931.c - print Q.931 traces
- * ---------------------------
- *
- * $Id: q931.c,v 1.4 1998/12/05 18:04:19 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:20:31 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode Q.931 protocol
- *---------------------------------------------------------------------------*/
-void
-decode_q931(char *pbuf, int n, int off, unsigned char *buf, int raw)
-{
- int codeset = 0;
- int codelock = 0;
- int oldcodeset = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- if(raw)
- {
-
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- i = 0;
-
- sprintf((pbuf+strlen(pbuf)), "Q931: ");
-
- /* protocol discriminator */
-
- pd = buf[i];
-
- if(pd >= 0x00 && pd <= 0x07)
- sprintf((pbuf+strlen(pbuf)), "pd=User-User (0x%02x), ",pd);
- else if(pd == 0x08)
- sprintf((pbuf+strlen(pbuf)), "pd=Q.931/I.451, ");
- else if(pd >= 0x10 && pd <= 0x3f)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x), ",pd);
- else if(pd >= 0x40 && pd <= 0x4f)
- sprintf((pbuf+strlen(pbuf)), "pd=National Use (0x%02x), ",pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x), ",pd);
- else
- sprintf((pbuf+strlen(pbuf)), "pd=Reserved (0x%02x), ",pd);
-
- /* call reference */
-
- i++;
-
- len = buf[i] & 0x0f;
-
- switch(len)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "cr=Dummy, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+1] & 0x80) ? "(from destination)" : "(from origination)");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x 0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+2] & 0x7f), (buf[i+1] & 0x80) ? "(org)" : "(dst)");
- break;
- }
-
- i += (len+1);
-
- /* message type */
-
- sprintf((pbuf+strlen(pbuf)), "message=");
-
- switch(buf[i])
- {
- /* escape to nationally specific message type */
-
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "ESCAPE: ");
- break;
-
- /* call establishment */
-
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "ALERTING: ");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "CALL PROCEEDING: ");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "PROGRESS: ");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "SETUP: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "CONNECT: ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "SETUP ACKNOWLEDGE: ");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "CONNECT ACKNOWLEDGE: ");
- break;
-
- /* call information phase */
-
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "USER INFORMATION: ");
- break;
- case 0x21:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND REJECT: ");
- break;
- case 0x22:
- sprintf((pbuf+strlen(pbuf)), "RESUME REJECT: ");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "HOLD (Q.932): ");
- break;
- case 0x25:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND: ");
- break;
- case 0x26:
- sprintf((pbuf+strlen(pbuf)), "RESUME: ");
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "HOLD ACKNOWLEDGE (Q.932): ");
- break;
- case 0x2d:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND ACKNOWLEDGE: ");
- break;
- case 0x2e:
- sprintf((pbuf+strlen(pbuf)), "RESUME ACKNOWLEDGE: ");
- break;
- case 0x30:
- sprintf((pbuf+strlen(pbuf)), "HOLD REJECT (Q.932): ");
- break;
- case 0x31:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE (Q.932): ");
- break;
- case 0x32:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE ACKNOWLEDGE (Q.932): ");
- break;
- case 0x37:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE REJECT (Q.932): ");
- break;
-
- /* call clearing */
-
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "DETACH: ");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "DISCONNECT: ");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "RESTART: ");
- break;
- case 0x48:
- sprintf((pbuf+strlen(pbuf)), "DETACH ACKNOWLEDGE: ");
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "RELEASE: ");
- break;
- case 0x4e:
- sprintf((pbuf+strlen(pbuf)), "RESTART ACKNOWLEDGE: ");
- break;
- case 0x5a:
- sprintf((pbuf+strlen(pbuf)), "RELEASE COMPLETE: ");
- break;
-
- /* misc messages */
-
- case 0x60:
- sprintf((pbuf+strlen(pbuf)), "SEGMENT: ");
- break;
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "FACILITY (Q.932): ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "REGISTER (Q.932): ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "CANCEL ACKNOWLEDGE: ");
- break;
- case 0x6a:
- sprintf((pbuf+strlen(pbuf)), "FACILITY ACKNOWLEDGE: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "REGISTER ACKNOWLEDGE: ");
- break;
- case 0x6e:
- sprintf((pbuf+strlen(pbuf)), "NOTIFY: ");
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "CANCEL REJECT: ");
- break;
- case 0x72:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REJECT: ");
- break;
- case 0x74:
- sprintf((pbuf+strlen(pbuf)), "REGISTER REJECT: ");
- break;
- case 0x75:
- sprintf((pbuf+strlen(pbuf)), "STATUS ENQIRY: ");
- break;
- case 0x79:
- sprintf((pbuf+strlen(pbuf)), "CONGESTION CONTROL: ");
- break;
- case 0x7b:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION: ");
- break;
- case 0x7d:
- sprintf((pbuf+strlen(pbuf)), "STATUS: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "UNDEFINED, TYPE=0x%02x, ", buf[i]);
- break;
- }
-
- /* other information elements */
-
- i++;
-
- for (; i < n;)
- {
- sprintf((pbuf+strlen(pbuf)), "\n ");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element */
-
- switch(buf[i] & 0x70)
- {
- case 0x00: /* reserved */
- sprintf((pbuf+strlen(pbuf)), "[reserved single octett info]");
- break;
-
- case 0x10: /* shift */
- oldcodeset = codeset;
- codeset = buf[i] & 0x07;
- if(buf[i] & 0x08)
- codelock = 0;
- else
- codelock = 1;
- sprintf((pbuf+strlen(pbuf)), "[shift: codeset=%d lock=%d]", codeset, codelock);
- break;
-
- case 0x20: /* more data */
- if(buf[i] & 0x01)
- sprintf((pbuf+strlen(pbuf)), "[sending complete]");
- else
- sprintf((pbuf+strlen(pbuf)), "[more data]");
- break;
-
- case 0x30: /* congestion level */
- sprintf((pbuf+strlen(pbuf)), "[congestion level=");
- switch(buf[i] & 0x0f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "rx-ready]");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "rx-not-ready]");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)]", buf[i] & 0x0f);
- break;
- }
- break;
-
- case 0x50: /* repeat ind */
- sprintf((pbuf+strlen(pbuf)), "[repeat indicator]");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN SINGLE OCTET ELEMENT 0x%02x]", buf[i]);
- break;
- }
-
- i++; /* next */
-
- }
- else
- {
- /* variable length info element */
-
- if(codeset == 0)
- {
- switch(buf[i])
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "[segmented message: ");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "[bearer capability: ");
- i += p_q931bc(pbuf, &buf[i]);
- goto next;
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[cause: ");
- i += p_q931cause(pbuf, &buf[i]);
- goto next;
- break;
- case 0x0c:
- sprintf((pbuf+strlen(pbuf)), "[connected address (old): ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "[extended facility (Q.932: )");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "[call identity: ");
- break;
- case 0x14:
- sprintf((pbuf+strlen(pbuf)), "[call state: ");
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Special");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", State=");
-
- switch((buf[i] & 0x3f))
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "Null");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Call initiated");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Overlap sending");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Outgoing call proceeding");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Call delivered");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "Call present");
- break;
- case 7:
- sprintf((pbuf+strlen(pbuf)), "Call received");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "Connect request");
- break;
- case 9:
- sprintf((pbuf+strlen(pbuf)), "Incoming call proceeding");
- break;
- case 10:
- sprintf((pbuf+strlen(pbuf)), "Active");
- break;
- case 11:
- sprintf((pbuf+strlen(pbuf)), "Disconnect request");
- break;
- case 12:
- sprintf((pbuf+strlen(pbuf)), "Disconnect indication");
- break;
- case 15:
- sprintf((pbuf+strlen(pbuf)), "Suspend request");
- break;
- case 17:
- sprintf((pbuf+strlen(pbuf)), "Resume request");
- break;
- case 19:
- sprintf((pbuf+strlen(pbuf)), "Release request");
- break;
- case 22:
- sprintf((pbuf+strlen(pbuf)), "Call abort");
- break;
- case 25:
- sprintf((pbuf+strlen(pbuf)), "Overlap receiving");
- break;
- case 0x3d:
- sprintf((pbuf+strlen(pbuf)), "Restart request");
- break;
- case 0x3e:
- sprintf((pbuf+strlen(pbuf)), "Restart");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- goto next;
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "[channel id: channel=");
- i++;
- len = buf[i];
- i++;
- switch(buf[i] & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no channel");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "B-1");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "B-2");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "any channel");
- break;
- }
- if(buf[i] & 0x08)
- sprintf((pbuf+strlen(pbuf)), " (exclusive)]");
- else
- sprintf((pbuf+strlen(pbuf)), " (preferred)]");
- i++;
- goto next;
- break;
- case 0x19:
- sprintf((pbuf+strlen(pbuf)), "[data link connection id (Q.933): ");
- break;
- case 0x1c:
- i += q932_facility(pbuf, &buf[i]);
- goto next;
- break;
- case 0x1e:
- sprintf((pbuf+strlen(pbuf)), "[progress ind: ");
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Local");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", Loc=");
-
- switch((buf[i] & 0x0f))
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "User");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Private network serving local user");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Public network serving local user");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Transit network");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Public network serving remote user");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Private network serving remote user");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "Network beyond interworking point");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n Description: ");
-
- switch((buf[i] & 0x7f))
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Call is not end-to-end ISDN");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Destination address is non-ISDN");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Origination address is non-ISDN");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Call has returned to the ISDN");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Interworking occured, Service change");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "In-band info or appropriate pattern now available");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- goto next;
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "[network specific facilities: ");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "[terminal capabilities: ");
- break;
- case 0x27:
- sprintf((pbuf+strlen(pbuf)), "[notification ind: ");
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "[display: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x29:
- sprintf((pbuf+strlen(pbuf)), "[date/time: ");
- i++;
- len = buf[i];
- i++;
- j = 0;
- sprintf((pbuf+strlen(pbuf)),"%.2d.%.2d.%.2d",
- buf[i+2], buf[i+1], buf[i]);
- j+=3;
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf))," %.2d", buf[i+3]);
- j++;
- }
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf)),":%.2d", buf[i+4]);
- j++;
- }
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf)),":%.2d", buf[i+5]);
- j++;
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += len;
- goto next;
- break;
- case 0x2c:
- sprintf((pbuf+strlen(pbuf)), "[keypad: ");
- break;
- case 0x30:
- sprintf((pbuf+strlen(pbuf)), "[keypad echo: ");
- break;
- case 0x32:
- sprintf((pbuf+strlen(pbuf)), "[information req (Q.932): ");
- break;
- case 0x34:
- sprintf((pbuf+strlen(pbuf)), "[signal: ");
- break;
- case 0x36:
- sprintf((pbuf+strlen(pbuf)), "[switchhook: ");
- break;
- case 0x38:
- sprintf((pbuf+strlen(pbuf)), "[feature activation (Q.932): ");
- break;
- case 0x39:
- sprintf((pbuf+strlen(pbuf)), "[feature ind (Q.932): ");
- break;
- case 0x3a:
- sprintf((pbuf+strlen(pbuf)), "[service profile id (Q.932): ");
- break;
- case 0x3b:
- sprintf((pbuf+strlen(pbuf)), "[endpoint id (Q.932): ");
- break;
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "[information rate: ");
- break;
- case 0x41:
- sprintf((pbuf+strlen(pbuf)), "[precedence level (Q.955): ");
- break;
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "[end-to-end transit delay: ");
- break;
- case 0x43:
- sprintf((pbuf+strlen(pbuf)), "[transit delay detection and indication: ");
- break;
- case 0x44:
- sprintf((pbuf+strlen(pbuf)), "[packet layer binary parameters: ");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "[packet layer window size: ");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "[packet size: ");
- break;
- case 0x47:
- sprintf((pbuf+strlen(pbuf)), "[closed user group: ");
- break;
- case 0x48:
- sprintf((pbuf+strlen(pbuf)), "[link layer core parameters (Q.933): ");
- break;
- case 0x49:
- sprintf((pbuf+strlen(pbuf)), "[link layer protocol parameters (Q.933): ");
- break;
- case 0x4a:
- sprintf((pbuf+strlen(pbuf)), "[reverse charging information: ");
- break;
- case 0x4c:
- sprintf((pbuf+strlen(pbuf)), "[connected number (Q.951): ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
-
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "[connected subaddress (Q.951): ");
- break;
- case 0x50:
- sprintf((pbuf+strlen(pbuf)), "[X.213 priority (Q.933): ");
- break;
- case 0x51:
- sprintf((pbuf+strlen(pbuf)), "[report type (Q.933): ");
- break;
- case 0x53:
- sprintf((pbuf+strlen(pbuf)), "[link integrity verification (Q.933): ");
- break;
- case 0x57:
- sprintf((pbuf+strlen(pbuf)), "[PVC status (Q.933): ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "[calling party number: ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x6d:
- sprintf((pbuf+strlen(pbuf)), "[calling party subaddress: ");
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "[called party number: ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x71:
- sprintf((pbuf+strlen(pbuf)), "[called party subaddress: ");
- break;
- case 0x74:
- sprintf((pbuf+strlen(pbuf)), "[redirecting number: ");
- break;
- case 0x76:
- sprintf((pbuf+strlen(pbuf)), "[redirection number: ");
- break;
- case 0x78:
- sprintf((pbuf+strlen(pbuf)), "[transit network selection: ");
- break;
- case 0x79:
- sprintf((pbuf+strlen(pbuf)), "[restart indicator: ");
- break;
- case 0x7c:
- sprintf((pbuf+strlen(pbuf)), "[low layer compatibility: ");
- break;
- case 0x7d:
- sprintf((pbuf+strlen(pbuf)), "[high layer compatibility:");
- i += p_q931high_compat(pbuf, &buf[i]);
- goto next;
- break;
- case 0x7e:
- sprintf((pbuf+strlen(pbuf)), "[user-user: ");
- break;
- case 0x7f:
- sprintf((pbuf+strlen(pbuf)), "[escape for extension: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID=0x%02x: ", buf[i]);
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN CODESET=%d, IE=0x%02x: ", codeset, buf[i]);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- sprintf((pbuf+strlen(pbuf)), "LEN=0x%02x, DATA=", len);
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"0x%02x ", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
- sprintf((pbuf+strlen(pbuf)),"\n");
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q931_util.c b/usr.sbin/i4b/isdntrace/q931_util.c
deleted file mode 100644
index 1b2ab09faef5..000000000000
--- a/usr.sbin/i4b/isdntrace/q931_util.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * q931_util.c - utility functions to print Q.931 traces
- * -----------------------------------------------------
- *
- * $Id: q931_util.c,v 1.4 1998/12/05 18:04:21 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:20:43 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-int
-p_q931cause(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int ls;
- int r = 0;
- int rflag = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* coding/location */
- len--;
-
- ls = buf[i];
-
- i++;
- len--;
-
- if(!(buf[i-1] & 0x80))
- {
- r = buf[i];
- rflag = 1;
- i++;
- len--;
- }
-
- sprintf((pbuf+strlen(pbuf)), "%s ", print_cause_q850(buf[i] & 0x7f));
-
- sprintf((pbuf+strlen(pbuf)), "\n (location=");
-
- switch(ls & 0x0f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "user");
- break;
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "private network serving local user");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "public network serving local user");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "transit network");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "public network serving remote user");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "private network serving remote user");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "international network");
- break;
- case 0x0a:
- sprintf((pbuf+strlen(pbuf)), "network beyond interworking point");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ls & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), ", std=");
-
- switch((ls & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Local");
- break;
- }
-
- if(rflag)
- {
- sprintf((pbuf+strlen(pbuf)), ", rec=");
-
- switch(r & 0x7f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "Q.931");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "X.21");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "X.25");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Q.1031/Q.1051");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "Reserved");
- break;
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),")");
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += (len+1);
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the bearer capability
- *---------------------------------------------------------------------------*/
-int
-p_q931bc(char *pbuf, unsigned char *buf)
-{
- int len;
- int i = 0;
- int mr = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n cap=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "speech");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "unrestricted digital information");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "restricted digital information");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "3.1 kHz audio");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "unrestricted digital information with tones");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "video");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), "\n std=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "NSI Std");
- break;
- }
-
- i++;
- len--;
-
- sprintf((pbuf+strlen(pbuf)), "\n rate=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "packet mode");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "64 kbit/s");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "2 x 64 kbit/s");
- break;
- case 0x13:
- sprintf((pbuf+strlen(pbuf)), "384 kbit/s");
- break;
- case 0x15:
- sprintf((pbuf+strlen(pbuf)), "1536 kbit/s");
- break;
- case 0x17:
- sprintf((pbuf+strlen(pbuf)), "1920 kbit/s");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "Multirate");
- mr = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), "\n mode=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "circuit");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ((buf[i] & 0x60) >> 5));
- break;
- }
-
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(mr)
- {
- sprintf((pbuf+strlen(pbuf)), "\n rate multiplier=%d", buf[i] & 0x7f);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- sprintf((pbuf+strlen(pbuf)), "\n layer1=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "V.110");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "G.711 u-law");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "G.711 A-law");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "G.721");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "H.221/H.242");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "Non-Std");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "V.120");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "X.31");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n user rate=0x%02x ", buf[i] & 0x1f);
-
- if(buf[i] & 0x40)
- sprintf((pbuf+strlen(pbuf)), "(async,");
- else
- sprintf((pbuf+strlen(pbuf)), "(sync,");
-
- if(buf[i] & 0x20)
- sprintf((pbuf+strlen(pbuf)), "in-band neg. possible)");
- else
- sprintf((pbuf+strlen(pbuf)), "in-band neg not possible)");
-
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n clk/flow=0x%02x", buf[i] & 0x1f);
-
- sprintf((pbuf+strlen(pbuf)), "\n intermediate rate=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "not used");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "8 kbit/s");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "16 kbit/s");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "32 kbit/s");
- break;
- }
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n hdr/mfrm/etc.=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n stop/data/parity=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n modemtype=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=Q.921/I.441");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=X.25 link");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=Q.921/I.441");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=X.25 packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
-exit:
- sprintf((pbuf+strlen(pbuf)), "]");
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-int
-p_q931address(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int tp;
- int ind = 0;
- int indflag = 0;
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> type/plan */
- tp = buf[i];
-
- i++;
- len--;
-
- if(!(tp & 0x80))
- {
- ind = buf[i];
- indflag = 1;
- i++;
- len--;
- }
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " (type=international, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " (type=national, ");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), " (type=network specific, ");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), " (type=subscriber, ");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), " (type=abbreviated, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " (type=reserved (%d), ", ((tp & 0x70) >> 4));
- break;
- }
-
- switch(tp & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "plan=unknown");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "plan=ISDN");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "plan=Data");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "plan=Telex");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "plan=National");
- break;
- case 9:
- sprintf((pbuf+strlen(pbuf)), "plan=private");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "plan=reserved (%d)", (tp & 0x0f));
- break;
- }
-
- if(indflag)
- {
- sprintf((pbuf+strlen(pbuf)), ",\n ");
- switch((ind & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "presentation allowed, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "presentation restricted, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "number not available, ");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "reserved, ");
- break;
- }
-
- switch(ind & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: not screened");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: verified & passed");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: verified & failed");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "screening network provided");
- break;
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),")]");
-
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print HL comatibility
- *---------------------------------------------------------------------------*/
-int
-p_q931high_compat(char *pbuf, unsigned char *buf)
-{
- int len = buf[1];
-
- sprintf(pbuf+strlen(pbuf), " standard=");
-
- switch ((buf[2] >> 5) & 0x03)
- {
- case 0: sprintf(pbuf+strlen(pbuf), "CCITT");
- break;
- case 1: sprintf(pbuf+strlen(pbuf), "unknown international standard");
- break;
- case 2: sprintf(pbuf+strlen(pbuf), "unknown national standard");
- break;
- case 3: sprintf(pbuf+strlen(pbuf), "local network standard");
- }
-
- len--;
-
- sprintf(pbuf+strlen(pbuf), ", characteristics=");
-
- switch (buf[3] & 0x7f)
- {
- case 0x01:
- sprintf(pbuf+strlen(pbuf), "Telephony");
- break;
- case 0x04:
- sprintf(pbuf+strlen(pbuf), "Fax Group 2/3");
- break;
- case 0x21:
- sprintf(pbuf+strlen(pbuf), "Fax Group 4 Class I (F.184)");
- break;
- case 0x24:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/mixed (F.230) or Fax Group 4 Class II/III (F.184)");
- break;
- case 0x28:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/processable (F.220)");
- break;
- case 0x31:
- sprintf(pbuf+strlen(pbuf), "Teletex basic mode (F.200)");
- break;
- case 0x32:
- sprintf(pbuf+strlen(pbuf), "Videotex (F.300 and T.101)");
- break;
- case 0x35:
- sprintf(pbuf+strlen(pbuf), "Telex (F.60)");
- break;
- case 0x38:
- sprintf(pbuf+strlen(pbuf), "MHS (X.400 series)");
- break;
- case 0x41:
- sprintf(pbuf+strlen(pbuf), "OSI application (X.200 series)");
- break;
- case 0x5e:
- sprintf(pbuf+strlen(pbuf), "Maintenance");
- break;
- case 0x5f:
- sprintf(pbuf+strlen(pbuf), "Management");
- break;
- case 0x7f:
- sprintf(pbuf+strlen(pbuf), "reserved");
- break;
- default:
- sprintf(pbuf+strlen(pbuf), "UNKNOWN (0x%02x)", buf[3]);
- break;
- }
-
- len--;
-
- if (!len)
- {
- sprintf(pbuf+strlen(pbuf), "]");
- return 4;
- }
-
- sprintf(pbuf+strlen(pbuf), " of ");
-
- switch (buf[4] & 0x7f)
- {
- case 0x01:
- sprintf(pbuf+strlen(pbuf), "Telephony");
- break;
- case 0x04:
- sprintf(pbuf+strlen(pbuf), "Fax Group 2/3");
- break;
- case 0x21:
- sprintf(pbuf+strlen(pbuf), "Fax Group 4 Class I (F.184)");
- break;
- case 0x24:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/mixed (F.230) or Fax Group 4 Class II/III (F.184)");
- break;
- case 0x28:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/processable (F.220)");
- break;
- case 0x31:
- sprintf(pbuf+strlen(pbuf), "Teletex basic mode (F.200)");
- break;
- case 0x32:
- sprintf(pbuf+strlen(pbuf), "Videotex (F.300 and T.101)");
- break;
- case 0x35:
- sprintf(pbuf+strlen(pbuf), "Telex (F.60)");
- break;
- case 0x38:
- sprintf(pbuf+strlen(pbuf), "MHS (X.400 series)");
- break;
- case 0x41:
- sprintf(pbuf+strlen(pbuf), "OSI application (X.200 series)");
- break;
- case 0x7f:
- sprintf(pbuf+strlen(pbuf), "reserved");
- break;
- default:
- sprintf(pbuf+strlen(pbuf), "UNKNOWN (0x%02x)", buf[3]);
- break;
- }
- sprintf(pbuf+strlen(pbuf), "]");
- return 5;
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q932_fac.c b/usr.sbin/i4b/isdntrace/q932_fac.c
deleted file mode 100644
index ba3f59d84a38..000000000000
--- a/usr.sbin/i4b/isdntrace/q932_fac.c
+++ /dev/null
@@ -1,926 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * q932_fac.c - decode Q.932 facilities
- * ------------------------------------
- *
- * $Id: q932_fac.c,v 1.4 1998/12/05 18:04:22 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:20:58 1998]
- *
- *---------------------------------------------------------------------------
- *
- * - Q.932 (03/93) Generic Procedures for the Control of
- * ISDN Supplementaty Services
- * - Q.950 (03/93) Supplementary Services Protocols, Structure and
- * General Principles
- * - ETS 300 179 (10/92) Advice Of Charge: charging information during
- * the call (AOC-D) supplementary service Service description
- * - ETS 300 180 (10/92) Advice Of Charge: charging information at the
- * end of call (AOC-E) supplementary service Service description
- * - ETS 300 181 (04/93) Advice Of Charge (AOC) supplementary service
- * Functional capabilities and information flows
- * - ETS 300 182 (04/93) Advice Of Charge (AOC) supplementary service
- * Digital Subscriber Signalling System No. one (DSS1) protocol
- * - X.208 Specification of Abstract Syntax Notation One (ASN.1)
- * - X.209 Specification of Basic Encoding Rules for
- * Abstract Syntax Notation One (ASN.1)
- * - "ASN.1 Abstract Syntax Notation One", Walter Gora, DATACOM-Verlag
- * 1992, 3rd Edition (ISBN 3-89238-062-7) (german !)
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "q932_fac.h"
-
-static int do_component(int length, char *pbuf);
-static char *uni_str(int code);
-static char *opval_str(int val);
-static char *bid_str(int val);
-static void next_state(char *pbuf, int class, int form, int code, int val);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-q932_facility(char *pbuf, unsigned char *buf)
-{
- int len;
-
- sprintf((pbuf+strlen(pbuf)), "[facility (Q.932): ");
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- sprintf((pbuf+strlen(pbuf)), "Protocol=");
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- sprintf((pbuf+strlen(pbuf)), "Remote Operations Protocol\n");
- break;
-
- case FAC_PROTO_CMIP:
- sprintf((pbuf+strlen(pbuf)), "CMIP Protocol (Q.941), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- case FAC_PROTO_ACSE:
- sprintf((pbuf+strlen(pbuf)), "ACSE Protocol (X.217/X.227), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "Unknown Protocol (val = 0x%x), UNSUPPORTED!\n", *buf & 0x1f);
- return(len+2);
- break;
- }
-
- /* next byte */
-
- buf++;
- len--;
-
- /* initialize variables for do_component */
-
- byte_len = 0;
- byte_buf = buf;
- state = ST_EXP_COMP_TYP;
-
- /* decode facility */
-
- do_component(len, pbuf);
-
- sprintf((pbuf+(strlen(pbuf)-1)), "]"); /* XXX replace last newline */
-
- return(len+3);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length, char *pbuf)
-{
- int comp_tag_class; /* component tag class */
- int comp_tag_form; /* component form: constructor or primitive */
- int comp_tag_code; /* component code depending on class */
- int comp_length = 0; /* component length */
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "ENTER - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
-again:
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "AGAIN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Tag: ", *byte_buf);
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- sprintf((pbuf+strlen(pbuf)), "Universal");
- break;
- case FAC_TAGCLASS_APW:
- sprintf((pbuf+strlen(pbuf)), "Applic-wide");
- break;
- case FAC_TAGCLASS_COS:
- sprintf((pbuf+strlen(pbuf)), "Context-spec");
- break;
- case FAC_TAGCLASS_PRU:
- sprintf((pbuf+strlen(pbuf)), "Private");
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_form == FAC_TAGFORM_CON)
- {
- sprintf((pbuf+strlen(pbuf)), "Constructor");
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "Primitive");
- }
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_code == 0x1f)
- {
- comp_tag_code = 0;
-
- byte_buf++;
- byte_len++;
-
- while(*byte_buf & 0x80)
- {
- comp_tag_code += (*byte_buf & 0x7f);
- byte_buf++;
- byte_len++;
- }
- comp_tag_code += (*byte_buf & 0x7f);
- sprintf((pbuf+strlen(pbuf)), "%d (ext)\n", comp_tag_code);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
-
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- sprintf((pbuf+strlen(pbuf)), "%s (%d)\n", uni_str(comp_tag_code), comp_tag_code);
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "code = %d\n", comp_tag_code);
- }
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Len: ", *byte_buf);
-
- comp_length = 0;
-
- if(*byte_buf & 0x80)
- {
- int i = *byte_buf & 0x7f;
-
- byte_len += i;
-
- for(;i > 0;i++)
- {
- byte_buf++;
- comp_length += (*byte_buf * (i*256));
- }
- sprintf((pbuf+strlen(pbuf)), "%d (long form)\n", comp_length);
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- sprintf((pbuf+strlen(pbuf)), "%d (short form)\n", comp_length);
- }
-
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- if(comp_length)
- {
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length, pbuf);
- }
- else
- {
- int val = 0;
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- switch(comp_tag_code)
- {
- case FAC_CODEUNI_INT:
- case FAC_CODEUNI_ENUM:
- case FAC_CODEUNI_BOOL:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x ", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "Val: %d\n", val);
- }
- break;
- default:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x = %d", *byte_buf, *byte_buf);
- if(isprint(*byte_buf))
- sprintf((pbuf+strlen(pbuf)), " = '%c'", *byte_buf);
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "\n");
- }
- }
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
- }
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "PREGOTO - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- if(byte_len < length)
- goto again;
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "RETURN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * print universal id type
- *---------------------------------------------------------------------------*/
-static char *uni_str(int code)
-{
- static char *tbl[] = {
- "BOOLEAN",
- "INTEGER",
- "BIT STRING",
- "OCTET STRING",
- "NULL",
- "OBJECT IDENTIFIER",
- "OBJECT DESCRIPTOR",
- "EXTERNAL",
- "REAL",
- "ENUMERATED",
- "RESERVED11",
- "RESERVED12",
- "RESERVED13",
- "RESERVED14",
- "RESERVED15",
- "SEQUENCE",
- "SET",
- "NUMERIC STRING",
- "PRINTABLE STRING",
- "TELETEX STRING",
- "ISO646 STRING",
- "IA5 STRING",
- "GRAPHIC STRING",
- "GENERAL STRING"
- };
-
- if(code >= 1 && code <= FAC_CODEUNI_GNSTR)
- return(tbl[code-1]);
- else
- return("ERROR, Value out of Range!");
-}
-
-/*---------------------------------------------------------------------------*
- * print operation value
- *---------------------------------------------------------------------------*/
-static char *opval_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case FAC_OPVAL_UUS:
- r = "uUs";
- break;
- case FAC_OPVAL_CUG:
- r = "cUGCall";
- break;
- case FAC_OPVAL_MCID:
- r = "mCIDRequest";
- break;
- case FAC_OPVAL_BTPY:
- r = "beginTPY";
- break;
- case FAC_OPVAL_ETPY:
- r = "endTPY";
- break;
- case FAC_OPVAL_ECT:
- r = "eCTRequest";
- break;
- case FAC_OPVAL_DIV_ACT:
- r = "activationDiversion";
- break;
- case FAC_OPVAL_DIV_DEACT:
- r = "deactivationDiversion";
- break;
- case FAC_OPVAL_DIV_ACTSN:
- r = "activationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_DEACTSN:
- r = "deactivationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_INTER:
- r = "interrogationDiversion";
- break;
- case FAC_OPVAL_DIV_INFO:
- r = "diversionInformation";
- break;
- case FAC_OPVAL_DIV_CALLDEF:
- r = "callDeflection";
- break;
- case FAC_OPVAL_DIV_CALLRER:
- r = "callRerouting";
- break;
- case FAC_OPVAL_DIV_LINF2:
- r = "divertingLegInformation2";
- break;
- case FAC_OPVAL_DIV_INVS:
- r = "invokeStatus";
- break;
- case FAC_OPVAL_DIV_INTER1:
- r = "interrogationDiversion1";
- break;
- case FAC_OPVAL_DIV_LINF1:
- r = "divertingLegInformation1";
- break;
- case FAC_OPVAL_DIV_LINF3:
- r = "divertingLegInformation3";
- break;
- case FAC_OPVAL_ER_CRCO:
- r = "explicitReservationCreationControl";
- break;
- case FAC_OPVAL_ER_MGMT:
- r = "explicitReservationManagement";
- break;
- case FAC_OPVAL_ER_CANC:
- r = "explicitReservationCancel";
- break;
- case FAC_OPVAL_MLPP_QUERY:
- r = "mLPP lfb Query";
- break;
- case FAC_OPVAL_MLPP_CALLR:
- r = "mLPP Call Request";
- break;
- case FAC_OPVAL_MLPP_CALLP:
- r = "mLPP Call Preemption";
- break;
- case FAC_OPVAL_AOC_REQ:
- r = "chargingRequest";
- break;
- case FAC_OPVAL_AOC_S_CUR:
- r = "aOCSCurrency";
- break;
- case FAC_OPVAL_AOC_S_SPC:
- r = "aOCSSpecialArrangement";
- break;
- case FAC_OPVAL_AOC_D_CUR:
- r = "aOCDCurrency";
- break;
- case FAC_OPVAL_AOC_D_UNIT:
- r = "aOCDChargingUnit";
- break;
- case FAC_OPVAL_AOC_E_CUR:
- r = "aOCECurrency";
- break;
- case FAC_OPVAL_AOC_E_UNIT:
- r = "aOCEChargingUnit";
- break;
- case FAC_OPVAL_AOC_IDOFCRG:
- r = "identificationOfCharge";
- break;
- case FAC_OPVAL_CONF_BEG:
- r = "beginConf";
- break;
- case FAC_OPVAL_CONF_ADD:
- r = "addConf";
- break;
- case FAC_OPVAL_CONF_SPLIT:
- r = "splitConf";
- break;
- case FAC_OPVAL_CONF_DROP:
- r = "dropConf";
- break;
- case FAC_OPVAL_CONF_ISOLATE:
- r = "isolateConf";
- break;
- case FAC_OPVAL_CONF_REATT:
- r = "reattachConf";
- break;
- case FAC_OPVAL_CONF_PDISC:
- r = "partyDISC";
- break;
- case FAC_OPVAL_CONF_FCONF:
- r = "floatConf";
- break;
- case FAC_OPVAL_CONF_END:
- r = "endConf";
- break;
- case FAC_OPVAL_CONF_IDCFE:
- r = "indentifyConferee";
- break;
- case FAC_OPVAL_REVC_REQ:
- r = "requestREV";
- break;
- default:
- sprintf(buffer, "unknown operation value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * billing id string
- *---------------------------------------------------------------------------*/
-static char *bid_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case 0:
- r = "normalCharging";
- break;
- case 1:
- r = "reverseCharging";
- break;
- case 2:
- r = "creditCardCharging";
- break;
- case 3:
- r = "callForwardingUnconditional";
- break;
- case 4:
- r = "callForwardingBusy";
- break;
- case 5:
- r = "callForwardingNoReply";
- break;
- case 6:
- r = "callDeflection";
- break;
- case 7:
- r = "callTransfer";
- break;
- default:
- sprintf(buffer, "unknown billing-id value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t invokeComponent\n");
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnResult\n");
- state = ST_EXP_RR_INV_ID;
- }
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_3, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnError\n");
- state = ST_EXP_NIX;
- }
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t reject\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RR2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_RR_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_INFO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_RR3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_RR_RESULT;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: RESULT
- *---------------------------------------------------------------------------*/
-static void
-F_RRR(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RRR, val = %d\n", val);
-#endif
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t specificChargingUnits\n");
- state = ST_EXP_RUL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t freeOfCharge\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t chargeNotAvailable\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_5(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_5, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t recordedUnitsList [1]\n");
- state = ST_EXP_RU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_6(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_6, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t RecordedUnits\n");
- state = ST_EXP_RNOU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_7(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_7, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t NumberOfUnits = %d\n", val);
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_8(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_8, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t typeOfChargingInfo = %s\n", val == 0 ? "subTotal" : "total");
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_9(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_9, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t AOCDBillingId = %s (%d)\n", bid_str(val), val);
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * state table
- *---------------------------------------------------------------------------*/
-static struct statetab {
- int currstate; /* input: current state we are in */
- int form; /* input: current tag form */
- int class; /* input: current tag class */
- int code; /* input: current tag code */
- void (*func)(char *,int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-
-/* invoke */
-
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_1_1 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 2, F_1_2 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 3, F_1_3 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 4, F_1_4 },
- {ST_EXP_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_2 },
- {ST_EXP_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_3 },
- {ST_EXP_INFO, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_4 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_NULL, F_4_1 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_4_2 },
- {ST_EXP_RUL, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_5 },
- {ST_EXP_RU, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_6 },
- {ST_EXP_RNOU, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_7 },
- {ST_EXP_TOCI, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_8 },
- {ST_EXP_DBID, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_9 },
-
-/* return result */
-
- {ST_EXP_RR_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR2 },
- {ST_EXP_RR_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR3 },
- {ST_EXP_RR_RESULT, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SET, F_RRR },
-
-/* end */
-
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(char *pbuf, int class, int form, int code, int val)
-{
- int i;
-
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: class=%d, form=%d, code=%d, val=%d\n", class, form, code, val);
-#endif
-
- for(i=0; ; i++)
- {
- if((statetab[i].currstate > state) ||
- (statetab[i].currstate == -1))
- {
- break;
- }
-
- if((statetab[i].currstate == state) &&
- (statetab[i].form == form) &&
- (statetab[i].class == class) &&
- (statetab[i].code == code))
- {
- (*statetab[i].func)(pbuf, val);
- break;
- }
- }
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q932_fac.h b/usr.sbin/i4b/isdntrace/q932_fac.h
deleted file mode 100644
index feae4487e6b8..000000000000
--- a/usr.sbin/i4b/isdntrace/q932_fac.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
- *
- *---------------------------------------------------------------------------
- *
- * q932_fac.h - facility header file
- * ---------------------------------
- *
- * $Id: q932_fac.h,v 1.4 1998/12/05 18:04:24 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:21:17 1998]
- *
- *---------------------------------------------------------------------------
- *
- * - Q.932 (03/93) Generic Procedures for the Control of
- * ISDN Supplementaty Services
- * - Q.950 (03/93) Supplementary Services Protocols, Structure and
- * General Principles
- * - ETS 300 179 (10/92) Advice Of Charge: charging information during
- * the call (AOC-D) supplementary service Service description
- * - ETS 300 180 (10/92) Advice Of Charge: charging information at the
- * end of call (AOC-E) supplementary service Service description
- * - ETS 300 181 (04/93) Advice Of Charge (AOC) supplementary service
- * Functional capabilities and information flows
- * - ETS 300 182 (04/93) Advice Of Charge (AOC) supplementary service
- * Digital Subscriber Signalling System No. one (DSS1) protocol
- * - X.208 Specification of Abstract Syntax Notation One (ASN.1)
- * - X.209 Specification of Basic Encoding Rules for
- * Abstract Syntax Notation One (ASN.1)
- * - "ASN.1 Abstract Syntax Notation One", Walter Gora, DATACOM-Verlag
- * 1992, 3rd Edition (ISBN 3-89238-062-7) (german !)
- *
- *---------------------------------------------------------------------------*/
-
-/* #define FAC_DEBUG */
-/* #define ST_DEBUG */
-
-/* protocols */
-#define FAC_PROTO_ROP 0x11
-#define FAC_PROTO_CMIP 0x12
-#define FAC_PROTO_ACSE 0x13
-
-/* tag classes */
-#define FAC_TAGCLASS_UNI 0x00
-#define FAC_TAGCLASS_APW 0x01
-#define FAC_TAGCLASS_COS 0x02
-#define FAC_TAGCLASS_PRU 0x03
-
-/* tag forms */
-#define FAC_TAGFORM_PRI 0x00
-#define FAC_TAGFORM_CON 0x01
-
-/* class UNIVERSAL values */
-#define FAC_CODEUNI_BOOL 1
-#define FAC_CODEUNI_INT 2
-#define FAC_CODEUNI_BITS 3
-#define FAC_CODEUNI_OCTS 4
-#define FAC_CODEUNI_NULL 5
-#define FAC_CODEUNI_OBJI 6
-#define FAC_CODEUNI_OBJD 7
-#define FAC_CODEUNI_EXT 8
-#define FAC_CODEUNI_REAL 9
-#define FAC_CODEUNI_ENUM 10
-#define FAC_CODEUNI_R11 11
-#define FAC_CODEUNI_R12 12
-#define FAC_CODEUNI_R13 13
-#define FAC_CODEUNI_R14 14
-#define FAC_CODEUNI_R15 15
-#define FAC_CODEUNI_SEQ 16
-#define FAC_CODEUNI_SET 17
-#define FAC_CODEUNI_NSTR 18
-#define FAC_CODEUNI_PSTR 19
-#define FAC_CODEUNI_TSTR 20
-#define FAC_CODEUNI_VSTR 21
-#define FAC_CODEUNI_ISTR 22
-#define FAC_CODEUNI_UTIME 23
-#define FAC_CODEUNI_GTIME 24
-#define FAC_CODEUNI_GSTR 25
-#define FAC_CODEUNI_VISTR 26
-#define FAC_CODEUNI_GNSTR 27
-
-/* operation values */
-#define FAC_OPVAL_UUS 1
-#define FAC_OPVAL_CUG 2
-#define FAC_OPVAL_MCID 3
-#define FAC_OPVAL_BTPY 4
-#define FAC_OPVAL_ETPY 5
-#define FAC_OPVAL_ECT 6
-
-#define FAC_OPVAL_DIV_ACT 7
-#define FAC_OPVAL_DIV_DEACT 8
-#define FAC_OPVAL_DIV_ACTSN 9
-#define FAC_OPVAL_DIV_DEACTSN 10
-#define FAC_OPVAL_DIV_INTER 11
-#define FAC_OPVAL_DIV_INFO 12
-#define FAC_OPVAL_DIV_CALLDEF 13
-#define FAC_OPVAL_DIV_CALLRER 14
-#define FAC_OPVAL_DIV_LINF2 15
-#define FAC_OPVAL_DIV_INVS 16
-#define FAC_OPVAL_DIV_INTER1 17
-#define FAC_OPVAL_DIV_LINF1 18
-#define FAC_OPVAL_DIV_LINF3 19
-
-#define FAC_OPVAL_ER_CRCO 20
-#define FAC_OPVAL_ER_MGMT 21
-#define FAC_OPVAL_ER_CANC 22
-
-#define FAC_OPVAL_MLPP_QUERY 24
-#define FAC_OPVAL_MLPP_CALLR 25
-#define FAC_OPVAL_MLPP_CALLP 26
-
-#define FAC_OPVAL_AOC_REQ 30
-#define FAC_OPVAL_AOC_S_CUR 31
-#define FAC_OPVAL_AOC_S_SPC 32
-#define FAC_OPVAL_AOC_D_CUR 33
-#define FAC_OPVAL_AOC_D_UNIT 34
-#define FAC_OPVAL_AOC_E_CUR 35
-#define FAC_OPVAL_AOC_E_UNIT 36
-#define FAC_OPVAL_AOC_IDOFCRG 37
-
-#define FAC_OPVAL_CONF_BEG 40
-#define FAC_OPVAL_CONF_ADD 41
-#define FAC_OPVAL_CONF_SPLIT 42
-#define FAC_OPVAL_CONF_DROP 43
-#define FAC_OPVAL_CONF_ISOLATE 44
-#define FAC_OPVAL_CONF_REATT 45
-#define FAC_OPVAL_CONF_PDISC 46
-#define FAC_OPVAL_CONF_FCONF 47
-#define FAC_OPVAL_CONF_END 48
-#define FAC_OPVAL_CONF_IDCFE 49
-
-#define FAC_OPVAL_REVC_REQ 60
-
-enum states {
- ST_EXP_COMP_TYP,
- ST_EXP_INV_ID,
- ST_EXP_OP_VAL,
- ST_EXP_INFO,
- ST_EXP_RUL,
- ST_EXP_RU,
- ST_EXP_RNOU,
- ST_EXP_TOCI,
- ST_EXP_DBID,
-
- ST_EXP_RR_INV_ID,
- ST_EXP_RR_OP_VAL,
- ST_EXP_RR_RESULT,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/trace.c b/usr.sbin/i4b/isdntrace/trace.c
deleted file mode 100644
index a9dde80108c8..000000000000
--- a/usr.sbin/i4b/isdntrace/trace.c
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------*
- *
- * trace.c - print traces of D (B) channel activity for isdn4bsd
- * -------------------------------------------------------------
- *
- * $Id: trace.c,v 1.10 1998/10/19 12:32:21 hm Exp $
- *
- * last edit-date: [Mon Oct 19 14:30:58 1998]
- *
- * -hm rewriting for isic and new trace format
- * -hm new option -f, use automatic name for -o
- * -hm changed default option setting
- * -hm multi unit support
- * -hm analyzer functionality
- * -hm binary record/playback
- * -hm -p option
- * -hm cleanup
- * -hm adding date to timestamp field
- * -hm reopen files on SIGUSR1 for rotation
- * -hm Joerg reported a bug with commandline options
- * -hm I.430 INFO signals from layer 1
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-unsigned char buf[BSIZE];
-FILE *Fout = NULL;
-FILE *BP = NULL;
-int outflag = 1;
-int header = 1;
-int print_q921 = 1;
-int unit = 0;
-int dchan = 0;
-int bchan = 0;
-int traceon = 0;
-int analyze = 0;
-int Rx = RxUDEF;
-int Tx = TxUDEF;
-int f;
-int Bopt = 0;
-int Popt = 0;
-int bpopt = 0;
-int info = 0;
-int Fopt = 0;
-
-static char outfilename[1024];
-static char BPfilename[1024];
-static struct stat fst;
-
-static void dumpbuf( int n, unsigned char *buf, i4b_trace_hdr_t *hdr, int raw );
-static int switch_driver( int value, int rx, int tx );
-static void usage( void );
-static void exit_hdl( void );
-static void reopenfiles( int );
-
-/*---------------------------------------------------------------------------*
- * usage instructions
- *---------------------------------------------------------------------------*/
-void
-usage(void)
-{
- fprintf(stderr,"\n");
- fprintf(stderr,"isdntrace - i4b package ISDN trace facility for passive cards (%02d.%02d.%d)\n", VERSION, REL, STEP);
- fprintf(stderr,"usage: isdntrace -a -b -d -f <file> -h -i -l -n <val> -o -p <file> -r -u <unit>\n");
- fprintf(stderr," -B -F -P -R <unit> -T <unit>\n");
- fprintf(stderr," -a analyzer mode ................................... (default off)\n");
- fprintf(stderr," -b switch B channel trace on ....................... (default off)\n");
- fprintf(stderr," -d switch D channel trace off ....................... (default on)\n");
- fprintf(stderr," -f <file> write output to file filename ............ (default %s0)\n", TRACE_FILE_NAME);
- fprintf(stderr," -h don't print header for each message ............. (default off)\n");
- fprintf(stderr," -i print I.430 (layer 1) INFO signals .............. (default off)\n");
- fprintf(stderr," -l don't decode low layer Q.921 messages ........... (default off)\n");
- fprintf(stderr," -n <val> process packet if it is longer than <val> octetts . (default 0)\n");
- fprintf(stderr," -o don't write output to a file .................... (default off)\n");
- fprintf(stderr," -p <file> specify filename for -B and -P ........ (default %s0)\n", BIN_FILE_NAME);
- fprintf(stderr," -r don't print raw hex/ASCII dump of protocol ...... (default off)\n");
- fprintf(stderr," -u <unit> specify controller unit number ............... (default unit 0)\n");
- fprintf(stderr," -B write binary trace data to file filename ........ (default off)\n");
- fprintf(stderr," -F with -P and -p: wait for more data at EOF ....... (default off)\n");
- fprintf(stderr," -P playback from binary trace data file ............ (default off)\n");
- fprintf(stderr," -R <unit> analyze Rx controller unit number (for -a) ... (default unit %d)\n", RxUDEF);
- fprintf(stderr," -T <unit> analyze Tx controller unit number (for -a) ... (default unit %d)\n", TxUDEF);
- fprintf(stderr,"\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * main
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char *argv[])
-{
- extern int optind;
- extern int opterr;
- extern char *optarg;
- char devicename[80];
- char headerbuf[256];
-
- int n;
- int c;
- char *b;
-
- int enable_trace = TRACE_D_RX | TRACE_D_TX;
- char *outfile = TRACE_FILE_NAME;
- char *binfile = BIN_FILE_NAME;
- int outfileset = 0;
- int raw = 1;
- int noct = -1;
- time_t tm;
- i4b_trace_hdr_t *ithp = NULL;
- int l;
- static struct stat fstnew;
-
- b = &buf[sizeof(i4b_trace_hdr_t)];
-
- while( (c = getopt(argc, argv, "abdf:hiln:op:ru:BFPR:T:?")) != EOF)
- {
- switch(c)
- {
- case 'a':
- analyze = 1;
- break;
-
- case 'b':
- enable_trace |= (TRACE_B_RX | TRACE_B_TX);
- break;
-
- case 'd':
- enable_trace &= (~(TRACE_D_TX | TRACE_D_RX));
- break;
-
- case 'o':
- outflag = 0;
- break;
-
- case 'f':
- outfile = optarg;
- outfileset = 1;
- break;
-
- case 'n':
- noct = atoi(optarg);
- break;
-
- case 'h':
- header = 0;
- break;
-
- case 'i':
- enable_trace |= TRACE_I;
- info = 1;
- break;
-
- case 'l':
- print_q921 = 0;
- break;
-
- case 'p':
- binfile = optarg;
- bpopt = 1;
- break;
-
- case 'r':
- raw = 0;
- break;
-
- case 'u':
- unit = atoi(optarg);
- if(unit < 0 || unit >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'B':
- Bopt = 1;
- break;
-
- case 'F':
- Fopt = 1;
- break;
-
- case 'P':
- Popt = 1;
- break;
-
- case 'R':
- Rx = atoi(optarg);
- if(Rx < 0 || Rx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'T':
- Tx = atoi(optarg);
- if(Tx < 0 || Tx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(enable_trace == 0)
- usage();
-
- if(Bopt && Popt)
- usage();
-
- atexit(exit_hdl);
-
- if(Bopt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(BP);
- sprintf(buffer, "%s%s", BPfilename, TRACE_FILE_NAME_BAK);
- rename(BPfilename, buffer);
- }
- if((BP = fopen(BPfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Popt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- if(Fopt)
- {
- if(fstat(fileno(BP), &fst))
- {
- char buffer[80];
- sprintf(buffer, "Error fstat file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
- }
- else
- {
- sprintf(devicename, "%s%d", I4BTRC_DEVICE, unit);
-
- if((f = open(devicename, O_RDWR)) < 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening trace device [%s]", devicename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(outflag)
- {
- if(outfileset == 0)
- sprintf(outfilename, "%s%d", TRACE_FILE_NAME, unit);
- else
- strcpy(outfilename, outfile);
-
-
- if((Fout = fopen(outfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(Fout);
- sprintf(buffer, "%s%s", outfilename, TRACE_FILE_NAME_BAK);
- rename(outfilename, buffer);
- }
-
- if((Fout = fopen(outfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", outfile);
- perror(buffer);
- exit(1);
- }
- }
-
- if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting stdout to line-buffered");
- perror(buffer);
- exit(1);
- }
-
- if(!Popt)
- {
- if((switch_driver(enable_trace, Rx, Tx)) == -1)
- exit(1);
- else
- traceon = 1;
- }
-
- signal(SIGHUP, SIG_IGN); /* ignore hangup signal */
- signal(SIGUSR1, reopenfiles); /* rotate logfile(s) */
-
- time(&tm);
-
- if(analyze)
- {
- sprintf(headerbuf, "\n==== isdnanalyze controller rx #%d - tx #%d ==== started %s",
- Rx, Tx, ctime(&tm));
- }
- else
- {
- sprintf(headerbuf, "\n=========== isdntrace controller #%d =========== started %s",
- unit, ctime(&tm));
- }
-
- printf("%s", headerbuf);
-
- if(outflag)
- fprintf(Fout, "%s", headerbuf);
-
- for (;;)
- {
- if(Popt == 0)
- {
- n = read(f, buf, BSIZE);
-
- if(Bopt)
- {
- if((fwrite(buf, 1, n, BP)) != n)
- {
- char buffer[80];
- sprintf(buffer, "Error writing file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- n -= sizeof(i4b_trace_hdr_t);
- }
- else
- {
-again:
- if((fread(buf, 1, sizeof(i4b_trace_hdr_t), BP)) != sizeof(i4b_trace_hdr_t))
- {
- if(feof(BP))
- {
- if(Fopt)
- {
- if(ferror(BP))
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- usleep(250000);
- clearerr(BP);
-
- if(stat(BPfilename, &fstnew) != -1)
- {
- if((fst.st_ino != fstnew.st_ino) ||
- (fstnew.st_nlink == 0))
- {
- if((BP = freopen(BPfilename, "r", BP)) == NULL)
- {
- char buffer[80];
- sprintf(buffer, "Error reopening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- stat(BPfilename, &fst);
- }
- }
- goto again;
- }
- else
- {
- printf("\nEnd of playback input file reached.\n");
- exit(0);
- }
- }
- else
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- ithp = (i4b_trace_hdr_t *)buf;
- l = ithp->length - sizeof(i4b_trace_hdr_t);
-
- if((n = fread(buf+sizeof(i4b_trace_hdr_t), 1, l , BP)) != l)
- {
- char buffer[80];
- sprintf(buffer, "Error reading data from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- }
-
- if((n > 0) && (n > noct))
- {
- dumpbuf(n, b, (i4b_trace_hdr_t *)buf, raw);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * format header into static buffer, return buffer address
- *---------------------------------------------------------------------------*/
-char *
-fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len)
-{
- struct tm *s;
- static char hbuf[256];
- int i = 0;
-
- s = localtime(&(hdr->time.tv_sec));
-
- if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */
- {
- sprintf(hbuf,"\n-- %s - unit:%d ---------------- time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%6u ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec);
- }
- else
- {
- if(hdr->trunc > 0)
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%6u - length:%d (%d) ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len,
- hdr->trunc);
- }
- else
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%6u - length:%d ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len);
- }
- }
-
- for(i=strlen(hbuf); i <= NCOLS;)
- hbuf[i++] = '-';
-
- hbuf[i++] = '\n';
- hbuf[i] = '\0';
-
- return(hbuf);
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol and output to file(s)
- *---------------------------------------------------------------------------*/
-static void
-dumpbuf(int n, unsigned char *buf, i4b_trace_hdr_t *hdr, int raw)
-{
- static char l1buf[128];
- static unsigned char l2buf[32000];
- static unsigned char l3buf[32000];
- int cnt;
- int nsave = n;
- char *pbuf;
- int i, j;
-
- l1buf[0] = '\0';
- l2buf[0] = '\0';
- l3buf[0] = '\0';
-
- switch(hdr->type)
- {
- case TRC_CH_I: /* Layer 1 INFO's */
- pbuf = &l1buf[0];
-
- switch(buf[0])
- {
- case INFO0:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO0 (No Signal)\n");
- break;
-
- case INFO1_8:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO1 (Activation Request, Priority = 8, from TE)\n");
- break;
-
- case INFO1_10:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO1 (Activation Request, Priority = 10, from TE)\n");
- break;
-
- case INFO2:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO2 (Pending Activation, from NT)\n");
- break;
-
- case INFO3:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO3 (Synchronized, from TE)\n");
- break;
-
- case INFO4_8:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO4 (Activated, Priority = 8/9, from NT)\n");
- break;
-
- case INFO4_10:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO4 (Activated, Priority = 10/11, from NT)\n");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)),"I430: ERROR, invalid INFO value 0x%x!\n", buf[0]);
- break;
- }
- break;
-
- case TRC_CH_D: /* D-channel data */
-
- cnt = decode_lapd(l2buf, n, buf, hdr->dir, raw, print_q921);
-
- n -= cnt;
- buf += cnt;
-
- if(n)
- {
- switch(*buf)
- {
- case 0x40:
- case 0x41:
- decode_1tr6(l3buf, n, cnt, buf, raw);
- break;
-
- default:
- decode_q931(l3buf, n, cnt, buf, raw);
- break;
- }
- }
- break;
-
- default: /* B-channel data */
-
- pbuf = &l2buf[0];
-
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"B%d:%.3x ", hdr->type, i);
-
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
-
- sprintf((pbuf+strlen(pbuf))," ");
-
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
-
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- break;
- }
-
- if(header && ((l1buf[0] != '\0' || l2buf[0] != '\0') || (l3buf[0] != 0)))
- {
- char *p;
- p = fmt_hdr(hdr, nsave);
- printf("%s", p);
- if(outflag)
- fprintf(Fout, "%s", p);
- }
-
- if(l1buf[0] != '\0')
- {
- printf("%s", l1buf);
- if(outflag)
- fprintf(Fout, "%s", l1buf);
- }
-
- if(l2buf[0] != '\0')
- {
- printf("%s", l2buf);
- if(outflag)
- fprintf(Fout, "%s", l2buf);
- }
-
- if(l3buf[0] != '\0')
- {
- printf("%s", l3buf);
- if(outflag)
- fprintf(Fout, "%s", l3buf);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * exit handler function to be called at program exit
- *---------------------------------------------------------------------------*/
-void
-exit_hdl()
-{
- if(traceon)
- switch_driver(TRACE_OFF, Rx, Tx);
-}
-
-/*---------------------------------------------------------------------------*
- * switch driver debugging output on/off
- *---------------------------------------------------------------------------*/
-static int
-switch_driver(int value, int rx, int tx)
-{
- char buffer[80];
- int v = value;
-
- if(analyze == 0)
- {
- if(ioctl(f, I4B_TRC_SET, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SET, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- if(value == TRACE_OFF)
- {
- if(ioctl(f, I4B_TRC_RESETA, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_RESETA - ");
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- i4b_trace_setupa_t tsa;
-
- tsa.rxunit = rx;
- tsa.rxflags = value;
- tsa.txunit = tx;
- tsa.txflags = value;
-
- if(ioctl(f, I4B_TRC_SETA, &tsa) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SETA, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * reopen files to support rotating logfile(s) on SIGUSR1
- *
- * based on an idea from Ripley (ripley@nostromo.in-berlin.de)
- *
- * close file and reopen it for append. this will be a nop
- * if the previously opened file hasn't moved but will open
- * a new one otherwise, thus enabling a rotation...
- *
- *---------------------------------------------------------------------------*/
-static void
-reopenfiles(int dummy)
-{
- if(outflag)
- {
- fclose(Fout);
-
- if((Fout = fopen(outfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", outfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Bopt)
- {
-
- fclose(BP);
-
- if((BP = fopen(BPfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-}
-
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/trace.h b/usr.sbin/i4b/isdntrace/trace.h
deleted file mode 100644
index e4c5b5a76c20..000000000000
--- a/usr.sbin/i4b/isdntrace/trace.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. 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. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * trace.h - header file for isdn trace
- * ------------------------------------
- *
- * $Id: trace.h,v 1.7 1998/10/19 12:32:23 hm Exp $
- *
- * last edit-date: [Mon Oct 19 14:27:21 1998]
- *
- * -hm splitting
- * -hm new filenames
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-
-#include "pcause_1tr6.h" /* obsolete german national ISDN */
-#include "pcause_q850.h"
-
-#define I4BTRC_DEVICE "/dev/i4btrc" /* trace device file */
-#define TRACE_FILE_NAME "isdntrace" /* default output filename */
-#define TRACE_FILE_NAME_BAK ".last" /* backup filename trailer */
-#define BIN_FILE_NAME "isdntracebin" /* default binary filename */
-
-#define BSIZE 4096 /* read buffer size */
-#define NCOLS 80 /* screen width */
-
-#define RxUDEF 0 /* analyze mode, default unit for receiver side */
-#define TxUDEF 1 /* analyze mode, default unit for transmitter side */
-
-int decode_lapd(char *pbuf, int n, unsigned char *buf, int is_te, int raw, int printit);
-void decode_q931(char *pbuf, int n, int off, unsigned char *buf, int raw);
-void decode_1tr6(char *pbuf, int n, int off, unsigned char *buf, int raw);
-char *print_error(int prot, unsigned char code);
-int q931_facility(char *pbuf, unsigned char *buf);
-int p_q931cause(char *pbuf, unsigned char *buf);
-int p_q931address(char *pbuf, unsigned char *buf);
-int p_q931bc(char *pbuf, unsigned char *buf);
-int p_q931high_compat(char *pbuf, unsigned char *buf);
-int q932_facility(char *pbuf, unsigned char *buf);
-
-/* EOF */
diff --git a/usr.sbin/i4b/man/Makefile b/usr.sbin/i4b/man/Makefile
deleted file mode 100644
index 65248d6dd26b..000000000000
--- a/usr.sbin/i4b/man/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-MAN4 = i4b.4 i4bctl.4 i4bipr.4 i4bq921.4 i4bq931.4 i4brbch.4 i4btel.4 \
- i4btrc.4 isic.4 daic.4 i4bisppp.4
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/i4b/man/daic.4 b/usr.sbin/i4b/man/daic.4
deleted file mode 100644
index fc0479750d86..000000000000
--- a/usr.sbin/i4b/man/daic.4
+++ /dev/null
@@ -1,98 +0,0 @@
-.\" Copyright (c) 1997 Martin Husemann <martin@rumolt.teuto.de>
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software withough 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.
-.\"
-.\" $Id: daic.4,v 1.1 1998/02/03 12:43:07 hm Exp $
-.\"
-.\" last edit-date: [Fri Jan 30 22:49:48 1998]
-.\"
-.\" -mh writing manual pages
-.\"
-.\"
-.Dd January 30, 1998
-.Dt daic 4
-.Sh NAME
-.Nm daic
-.Nd isdn4bsd driver for EICON.Diehl active isdn cards
-.Pp
-The
-.Nm
-driver supports the old Diehl active cards:
-.Em S, SX, SXn, SCOM
-and
-.Em QUADRO.
-.Sh SYNOPSIS
-.Pp
-Use a config line like this
-.Cd "daic0 at isa? iomem 0xd8000 irq 10"
-.Pp
-For a
-.Em QUADRO
-card use the same, the driver will detect the board type and use
-all four ports, each attached as a controller of its own to the
-ISDN4BSD system, which can be listed using the isdnctl utility.
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the isdn card to the ISDN4BSD kernel subsystem.
-All lower layer isdn control is handled by the card. This should
-allow you to run any national isdn protocol delivered by EICON.Diehl
-for your card, but the driver has only been tested with the DSS1
-protocol and some parts of the cards interface are isdn protocol
-dependend.
-.Pp
-The
-.Nm
-driver is written to conform to the software interface documented
-by Diehl in their
-.Nm ISDN-Karten Benutzerhandbuch
-from 1992.
-.Sh MICROCODE DOWNLOAD
-Every active card needs its own operating software before it can
-work. You have to download this to the card before using it with
-ISDN4BSD. Use the isdnctl utility to do this, i.e. call
-.Nm "isdnctl -d te_etsi.sx 1"
-to download the file
-.Nm te_etsi.sx
-to controller number 1. Use
-.Nm "isdnctl -l"
-to list all available controllers (and ports). You have to select the
-correct isdn protocol file for your isdn interface, see the Diehl documentation
-for details.
-.Pp
-The cards bootstrap process involves another file, which is independend
-of the card type you use and the protocol you run. It is called
-.Nm download.bin
-in current versions of the Diehl software distribution and has to be
-copied to the kernel compile directory under
-.Nm dev/ic/microcode/daic
-and converted into a header file used when compiling the kernel by running
-.Nm make
-in that directory. Your kernel compile will fail and remind you of this
-if you forget to do this. Due to copright restrictions we cannot distribute
-the driver with this file integrated. But if you own a card, you do have
-the file (or can get it from the Diehl web server).
-.Sh BUGS
-The driver is not yet finished. It will only compile on NetBSD and
-even there will not work. This should be fixed soon and the driver
-will be ported to FreeBSD.
-.Sh SEE ALSO
-.Xr isdnctl 1
diff --git a/usr.sbin/i4b/man/i4b.4 b/usr.sbin/i4b/man/i4b.4
deleted file mode 100644
index f285c08fa5fc..000000000000
--- a/usr.sbin/i4b/man/i4b.4
+++ /dev/null
@@ -1,108 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4b.4,v 1.6 1998/12/05 18:06:03 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:38:11 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4b 4
-.Sh NAME
-.Nm i4b
-.Nd isdn4bsd call control ISDN driver
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4b\&"
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-device driver is used by the
-.Xr isdnd 8
-daemon to exchange messages with the isdn4bsd kernel part for the purpose
-of call establishment, control and disconnection and to access various
-control and status informations.
-.Pp
-The messages and message parameters are documented in the include
-file
-.Em /usr/include/machine/i4b_ioctl.h .
-.Pp
-The available ioctl's are:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I4B_CDID_REQ
-Request a unique Call Description IDentifier (cdid) which identifies
-uniquely a single interaction of the local D channel with the exchange.
-.It Ar I4B_CONNECT_REQ
-Actively request a call setup to a remote ISDN subscriber.
-.It Ar I4B_CONNECT_RESP
-Respond to an incoming call, either accept, reject or ignore it.
-.It Ar I4B_DISCONNECT_REQ
-Actively terminate a connection.
-.It Ar I4B_CTRL_INFO_REQ
-Request information about an installed ISDN controller card.
-.It Ar I4B_DIALOUT_RESP
-Give information about call setup to driver who requested dialing out.
-.It Ar I4B_TIMEOUT_UPD
-Update the kernels timeout value(s) in case of dynamically calculated
-shorthold mode timing changes.
-.It Ar I4B_UPDOWN_IND
-Inform the kernel userland drivers about interface soft up/down status
-changes.
-.It Ar I4B_CTRL_DOWNLOAD
-Download firmware to active card(s).
-.It Ar I4B_ACTIVE_DIAGNOSTIC
-Return diagnostic information from active cards.
-.El
-.Pp
-Status and event messages available from the kernel are:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar MSG_CONNECT_IND
-An incoming call from a remote ISDN user is indicated.
-.It Ar MSG_CONNECT_ACTIVE_IND
-After an incoming call has been accepted locally or an outgoing call has
-been accepted by a remote, the exchange signaled an active connection
-and the corresponding B-channel is switched through.
-.It Ar MSG_DISCONNECT_IND
-A call was terminated.
-.It Ar MSG_DIALOUT_IND
-A userland interface driver requests the daemon to dial out (typically a
-network interface when a packet arrives in its send queue).
-.It Ar MSG_IDLE_TIMEOUT_IND
-A call was terminated by the isdn4bsd kernel driver because a B-channel
-idle timeout occurred.
-.It Ar MSG_ACCT_IND
-Accounting information from a network driver.
-.It Ar MSG_CHARGING_IND
-Charging information from the kernel.
-.El
-.Pp
-.Sh SEE ALSO
-.Xr isdnd 8
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4bctl.4 b/usr.sbin/i4b/man/i4bctl.4
deleted file mode 100644
index fa5fccd4fc86..000000000000
--- a/usr.sbin/i4b/man/i4bctl.4
+++ /dev/null
@@ -1,50 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4bctl.4,v 1.4 1998/12/05 18:06:04 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:38:22 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4bctl 4
-.Sh NAME
-.Nm i4bctl
-.Nd control device for the isdn4bsd kernel part
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4bctl\&"
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-.Nm
-is used by the
-.Xr isdndebug 8
-utility to get and set the current debugging level and other information
-of the isdn4bsd package kernel ISDN handling layers.
-.Sh SEE ALSO
-.Xr isdndebug 8
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4bipr.4 b/usr.sbin/i4b/man/i4bipr.4
deleted file mode 100644
index f4cdeacff5c3..000000000000
--- a/usr.sbin/i4b/man/i4bipr.4
+++ /dev/null
@@ -1,98 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4bipr.4,v 1.8 1998/12/05 18:06:06 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:38:34 1998]
-.\"
-.Dd July 6, 1998
-.Dt i4bipr 4
-.Sh NAME
-.Nm i4bipr
-.Nd isdn4bsd IP over ISDN B-channel network driver
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4bipr\&" Op count
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the IP subsystem of the operating system with the
-isdn4bsd package so that transport of IP packets over an ISDN link
-is possible.
-.Pp
-The driver just packs IP packets without anything appended or prepended
-into raw HDLC packets on the B channel and transfers them to a remote site.
-IP packets received from the remote site are queued into the local IP
-protocol stack.
-.Pp
-The format of the resulting packet on the B channel is:
-.Pp
-.Dl (HDLC opening flag) (IP-packet) (CRC) (HDLC closing flag)
-.Pp
-In the case where an IP packet for a remote site arrives in the driver and no
-connection has been established yet, the driver communicates with the
-.Xr isdnd 8
-daemon to establish a connection.
-.Pp
-The driver has support for interfacing to the
-.Xr bpf 4
-subsystem for using
-.Xr tcpdump 1
-with the
-.Nm ipr
-interfaces.
-.Pp
-The driver optionally (when compiled with the IPR_VJ option) provides Van
-Jacobsen header compression, under control of the link0 and link1 options to
-.Xr ifconfig 8
-:
-.Pp
-.Bl -tag -width 15n -offset indent -compact
-.It link0
-Apply VJ compression to outgoing packets on this interface, and assume that
-incoming packets require decompression.
-.It link1
-Check incoming packets for Van Jacobsen compression; if they appear to be
-compressed, automatically set link0.
-.El
-.Pp
-The default values are
-.Em on
-for
-.Em link1
-and
-.Em off
-for
-.Em link0 .
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnd.rc 5
-.Xr bpf 4
-.Xr tcpdump 1
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4bisppp.4 b/usr.sbin/i4b/man/i4bisppp.4
deleted file mode 100644
index ce65b823378b..000000000000
--- a/usr.sbin/i4b/man/i4bisppp.4
+++ /dev/null
@@ -1,107 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4bisppp.4,v 1.9 1998/12/22 19:16:57 hm Exp $
-.\"
-.\" last edit-date: [Tue Dec 22 20:15:08 1998]
-.\"
-.Dd December 22, 1998
-.Dt i4bisppp 4
-.Sh NAME
-.Nm i4bisppp
-.Nd isdn4bsd synchronous PPP over ISDN B-channel network driver
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4bisppp\&" Op count
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the IP subsystem of the operating system with the
-isdn4bsd package so that a transport of IP packets over an ISDN link
-is possible.
-.Pp
-The driver is just a glue layer between Serge Vakulenko's sppp
-backend and the ISDN4BSD package.
-.Pp
-In case an IP packet for a remote side arrives in the driver and no
-connection is established yet, the driver communicates with the
-.Xr isdnd 8
-daemon to establish a connection.
-.Pp
-The driver has support for interfacing to the
-.Xr bpf 4
-subsystem for using
-.Xr tcpdump 1
-with the
-.Nm isp
-interfaces.
-.Pp
-The
-.Xr spppcontrol 8
-utility is used to configure all aspects of PPP required to connect to a
-remote site.
-.Sh LINK0 and LINK1
-The
-.Em link0
-and
-.Em link1
-flags given as parameters to
-.Xr ifconfig 8
-have the following meaning for the
-.Nm isp
-devices:
-.Bl -tag -width link0 -compact
-.Pp
-.It Li link0
-wait passively for connection
-.Pp
-.It Li link1
-auto-dial on output
-.El
-.Pp
-The
-.Em link0
-and
-.Em link1
-flags are set to
-.Em off
-by default.
-.Pp
-See
-.Xr sppp 4
-for a more detailed discussion of the flags,
-.Pp
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnd.rc 5
-.Xr spppcontrol 8
-.Xr sppp 4
-.Xr bpf 4
-.Xr tcpdump 1
-.Sh AUTHOR
-The
-.Nm
-device driver was written by Joerg Wunsch and then added to ISDN4BSD by Gary Jennejohn.
-This manpage was written by Hellmuth Michaelis. He can be contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4bq921.4 b/usr.sbin/i4b/man/i4bq921.4
deleted file mode 100644
index bb5bcfc5fe27..000000000000
--- a/usr.sbin/i4b/man/i4bq921.4
+++ /dev/null
@@ -1,49 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4bq921.4,v 1.5 1998/12/05 18:06:08 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:38:57 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4bq921 4
-.Sh NAME
-.Nm i4bq921
-.Nd isdn4bsd pseudo device driver handling the Q.921 protocol
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4bq921\&"
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-.Nm
-is the ISDN D channel layer 2 handler.
-.Sh STANDARDS
-ITU Recommendation Q.920 and Q.921
-.Sh SEE ALSO
-.Xr i4bq931 4
-.Sh AUTHOR
-The
-.Nm
-driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4bq931.4 b/usr.sbin/i4b/man/i4bq931.4
deleted file mode 100644
index 7c8d155fa035..000000000000
--- a/usr.sbin/i4b/man/i4bq931.4
+++ /dev/null
@@ -1,49 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4bq931.4,v 1.5 1998/12/05 18:06:10 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:39:08 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4bq931 4
-.Sh NAME
-.Nm i4bq931
-.Nd isdn4bsd pseudo device driver handling the Q.931 protocol
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4bq931\&"
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-.Nm
-is the ISDN D channel layer 2 handler.
-.Sh STANDARDS
-ITU Recommendation Q.930 and Q.931
-.Sh SEE ALSO
-.Xr i4bq921 4
-.Sh AUTHOR
-The
-.Nm
-driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4brbch.4 b/usr.sbin/i4b/man/i4brbch.4
deleted file mode 100644
index b7ee3dfc3965..000000000000
--- a/usr.sbin/i4b/man/i4brbch.4
+++ /dev/null
@@ -1,50 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4brbch.4,v 1.5 1998/12/05 18:06:11 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:39:19 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4brbch 4
-.Sh NAME
-.Nm i4brbch
-.Nd isdn4bsd ISDN Raw B-CHannel access driver
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4brbch\&" Op count
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-driver provides an interface to the raw untranslated B-channel. It is
-part of the isdn4bsd package.
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnd.rc 5
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4btel.4 b/usr.sbin/i4b/man/i4btel.4
deleted file mode 100644
index e5f62523e44e..000000000000
--- a/usr.sbin/i4b/man/i4btel.4
+++ /dev/null
@@ -1,52 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4btel.4,v 1.5 1998/12/05 18:06:12 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:39:31 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4btel 4
-.Sh NAME
-.Nm i4btel
-.Nd isdn4bsd ISDN B-channel telephony interface driver
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4btel\&" Op count
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-driver provides an interface to the B-channel for telephony applications
-and is currently used by the
-.Xr isdnd 8
-for answering machine support. The driver is part of the isdn4bsd package.
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdnd.rc 5
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/i4btrc.4 b/usr.sbin/i4b/man/i4btrc.4
deleted file mode 100644
index 60b88ed971b5..000000000000
--- a/usr.sbin/i4b/man/i4btrc.4
+++ /dev/null
@@ -1,52 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: i4btrc.4,v 1.5 1998/12/05 18:06:13 hm Exp $
-.\"
-.\" last edit-date: [Sat Dec 5 18:39:42 1998]
-.\"
-.Dd February 3, 1998
-.Dt i4btrc 4
-.Sh NAME
-.Nm i4btrc
-.Nd isdn4bsd ISDN interface driver for D and B channel tracing
-.Sh FreeBSD SYNOPSIS
-.Cd pseudo-device \&"i4btrc\&" Op count
-.Sh NetBSD SYNOPSIS
-none
-.Sh DESCRIPTION
-The
-.Nm
-driver is used to add a header to the data got from the D and/or B channel
-and queues it to be read and further processed by the
-.Xr isdntrace 8
-utility.
-.Sh SEE ALSO
-.Xr isdnd 8
-.Xr isdntrace 8
-.Sh AUTHOR
-The
-.Nm
-device driver and this manpage were written by Hellmuth Michaelis. He can be
-contacted at hm@kts.org.
diff --git a/usr.sbin/i4b/man/isic.4 b/usr.sbin/i4b/man/isic.4
deleted file mode 100644
index 0ba54d697a2c..000000000000
--- a/usr.sbin/i4b/man/isic.4
+++ /dev/null
@@ -1,380 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. 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.
-.\"
-.\" $Id: isic.4,v 1.14 1998/12/22 19:12:13 hm Exp $
-.\"
-.\" last edit-date: [Tue Dec 22 20:08:06 1998]
-.\"
-.Dd December 22, 1998
-.Dt isic 4
-.Sh NAME
-.Nm isic
-.Nd isdn4bsd Siemens ISDN Chipset device driver
-.Sh FreeBSD SYNOPSIS
-.Pp
-For a Teles S0/8 or Niccy 1008 card:
-.Cd options \&"TEL_S0_8\&"
-.Cd "device isic0 at isa? iomem 0xd0000 net irq 5 flags 1 vector isicintr"
-.Pp
-For a Teles S0/16 or Creatix ISDN-S0 or Niccy 1016 card:
-.Cd options \&"TEL_S0_16\&"
-.Cd "device isic0 at isa? port 0xd80 iomem 0xd0000 net irq 5 flags 2 vector isicintr"
-.Pp
-For a Teles S0/16.3 card:
-.Cd options \&"TEL_S0_16_3\&"
-.Cd "device isic0 at isa? port 0xd80 net irq 5 flags 3 vector isicintr"
-.Pp
-For an AVM A1 or AVM Fritz!Card classic:
-.Cd options \&"AVM_A1\&"
-.Cd "device isic0 at isa? port 0x340 net irq 5 flags 4 vector isicintr"
-.Pp
-For an AVM Fritz!Card PCMCIA:
-.Cd options \&"AVM_A1_PCMCIA\&"
-.Cd "device isic0 at isa? port 0x340 net irq 5 flags 10 vector isicintr"
-.Pp
-For a Teles S0/16.3 PnP card (PnP):
-.Cd options \&"TEL_S0_16_3_P\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For a Creatix ISDN-S0 P&P card (PnP):
-.Cd options \&"CRTX_S0_P\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For an USRobotics Sportster ISDN TA internal or Stollmann Tina-pp card:
-.Cd options \&"USR_STI\&"
-.Cd "device isic0 at isa? port 0x268 net irq 5 flags 7 vector isicintr"
-.Pp
-For an ITK micro ix1 card:
-.Cd options \&"ITKIX1\&"
-.Cd "device isic0 at isa? port 0x398 net irq 10 flags 18 vector isicintr"
-.Pp
-For a Dr. Neuhaus Niccy Go@ (PnP):
-.Cd options \&"DRN_NGO\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For a Sedlbauer Win Speed card (PnP):
-.Cd options \&"SEDLBAUER\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For a Dynalink IS64PH (PnP):
-.Cd options \&"DYNALINK\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For an ELSA QuickStep 1000pro ISA (PnP):
-.Cd options \&"ELSA_QS1ISA\&"
-.Cd "device isic0 at isa? port ? net irq ? vector isicintr"
-.Pp
-For an ELSA QuickStep 1000pro PCI:
-.Cd options \&"ELSA_QS1PCI\&"
-.Cd "device isic0"
-.Pp
-.Ar FreeBSD PnP configuration:
-.Pp
-To be able to use PnP cards under FreeBSD, you have to add
-.Pp
-.Cd controller pnp0
-.Pp
-to you kernel config file. More, it is recommended to add
-.Pp
-.Cd options \&"USERCONFIG\&"
-.Cd options \&"USERCONFIG_BOOT\&"
-.Pp
-to your kernel config file to be able to adjust your PnP configuration
-in case of trouble.
-.Pp
-See also:
-.Xr pnp 4
-and
-.Xr boot 8
-.Pp
-.Sh NetBSD SYNOPSIS
-On the ISA bus:
-.Pp
-For a Teles S0/8 or Niccy 1008 card:
-.Cd options \&"TEL_S0_8\&"
-.Cd "isic0 at isa? iomem 0xd0000 irq 5"
-.Pp
-For a Teles S0/16 or Creatix ISDN-S0 or Niccy 1016 card:
-.Cd options \&"TEL_S0_16\&"
-.Cd "isic0 at isa? port 0xd80 iomem 0xd0000 irq 5"
-.Pp
-For a Teles S0/16.3 card:
-.Cd options \&"TEL_S0_16_3\&"
-.Cd "isic0 at isa? port 0xd80 irq 5"
-.Pp
-For an AVM A1 or AVM Fritz card:
-.Cd options \&"AVM_A1\&"
-.Cd "isic0 at isa? port 0x340 irq 5"
-.Pp
-For an USRobotics Sportster ISDN TA internal or Stollmann Tina-pp card:
-.Cd options \&"USR_STI\&"
-.Cd "isic0 at isa? port 0x268 irq 5"
-.Pp
-For an ITK ix1 micro card:
-.Cd options \&"ITKIX1\&"
-.Cd "isic0 at isa? port 0x398 irq 10"
-.Pp
-On the ISAPNP bus:
-.Pp
-For a Teles S0/16.3 PnP card
-.Cd options \&"TEL_S0_16_3_P\&"
-.Cd "isic* at isapnp?"
-.Pp
-For a Creatix ISDN-S0 P&P card
-.Cd options \&"CRTX_S0_P\&"
-.Cd "isic* at isapnp?"
-.Pp
-For a Dr. Neuhaus Niccy GO@
-.Cd options \&"DRN_NGO\&"
-.Cd "isic* at isapnp?"
-.Pp
-For an ELSA QuickStep 1000pro (ISA version):
-.Cd options \&"ELSA_QS1ISA\&"
-.Cd "isic* at isapnp?"
-.Pp
-For a Sedlbauer WinSpeed:
-.Cd options \&"SEDLBAUER\&"
-.Cd "isic* at isapnp?"
-.Pp
-For a Dynalink IS64PH:
-.Cd options \&"DYNALINK\&"
-.Cd "isic* at isapnp?"
-.Pp
-Cards on the PCI bus:
-.Pp
-For an ELSA QuickStep 1000pro (PCI version)
-.Cd options \&"ELSA_QS1PCI\&"
-.Cd "isic* at pci?"
-.Pp
-Cards on the PCMCIA or PCCARD bus:
-.Pp
-For an AVM Fritz!Card PCMCIA
-.Cd options \&"AVM_PCMCIA\&"
-.Cd "isic* at pcmcia? function ?"
-.Pp
-For an ELSA MicroLink ISDN/MC
-.Cd options \&"ELSA_ISDNMC\&"
-.Cd "isic* at pcmcia? function ?"
-.Pp
-For an ELSA MicroLink MC/all
-.Cd options \&"ELSA_MCALL\&"
-.Cd "isic* at pcmcia? function ?"
-.Pp
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports several 8 and 16bit passive ISDN cards from various
-manufacturers which are all based upon the popular Siemens ISDN chipset
-consisting of the ISDN Subscriber Access Controller ISAC (such as the
-PEB2085 or PSB 2186) and the High-Level Serial Communications Controller
-Extended HSCX (such as the SAB82525 or PSB21525). The newer IPAC chip
-(which integrates an ISAC and a HSCX in one chip, with the added benefit
-of larger FIFO buffers) is also supported.
-.Pp
-.Sh SUPPORTED CARDS
-.Pp
-.Bl -tag -width Ds -compact -offset
-.It Ar Teles S0/8, Dr. Neuhaus Niccy 1008, Creatix ISDN-S0/8
-.Pp
-The required (optional for NetBSD)
-.Em flag
-value is 1.
-.Pp
-Notice that this cards must not have a
-.Em port
-value in the config line.
-.Pp
-Valid interrupts are 2, 3, 4, 5, 6 and 7.
-.Pp
-The i/o ports are memory mapped and the memory start address may
-be in the range 0xA0000 to 0xDF000 and uses 4kB of memory.
-.Pp
-.It Ar Teles S0/16, Creatix ISDN-S0, Dr. Neuhaus Niccy 1016
-.Pp
-The required (optional under NetBSD)
-.Em flag
-value is 2.
-.Pp
-These boards have a jumper which specifies an i/o base address of either
-0xd80, 0xe80 or 0xf80. The remaining necessary configuration values are then
-programmed at run time by accessing this i/o port.
-.Pp
-Valid interrupts are 2, 3, 4, 5, 10, 11, 12 or 15.
-.Pp
-Valid memory start
-addresses are 0xC0000, 0xC2000, 0xC4000, 0xC6000, 0xC8000, 0xCA000, 0xCC000,
-0xCE000, 0xD0000, 0xD2000, 0xD4000, 0xD6000, 0xD8000, 0xDA000, 0xDC000 and
-0xDE000.
-.Pp
-Notice: Although the Jumpers are labeled 0xd80, 0xe80 or 0xf80, they
-also require i/o space at addresses 0x180, 0x280 or 0x380.
-.Pp
-.It Ar Teles S0/16.3
-.Pp
-The required (optional under NetBSD)
-.Em flag
-value is 3.
-.Pp
-This card is completely i/o mapped and must not have an
-.Em iomem
-statement in the config line.
-.Pp
-Valid interrupts are 2, 5, 9, 10, 12 or 15.
-.Pp
-Notice: Although the switch positions are labeled 0x180, 0x280 and 0x380,
-the card is to be configured at 0xd80, 0xe80 or 0xf80 respectively!
-.Pp
-.It Ar AVM A1, AVM Fritz!Card
-.Pp
-The required (optional under NetBSD)
-.Em flag
-value is 4.
-.Pp
-These boards have a jumper which specifies an i/o base address of either
-0x200, 0x240, 0x300 or 0x340.
-.Pp
-Valid interrupt configurations are 3, 4, 5, 6, 7, 10, 11, 12 or 15.
-.Pp
-Older Versions of the AVM A1 also require setting of an IRQ jumper, newer
-versions of this and the Fritz!Card only have an i/o base jumper and the
-interrupt is setup at runtime by reprogramming a register.
-.Pp
-This card is completely i/o mapped and must not have an
-.Em iomem
-statement in the config line.
-.Pp
-.It Ar Teles S0/16.3 PnP
-.Pp
-Possible i/o port values are 0x580, 0x500 and 0x680.
-Possible interrupt configurations are 3, 5, 7, 10, 11 and 12.
-.Pp
-The the card is auto-configured by the PnP kernel subsystem.
-.Pp
-.It Ar Creatix ISDN-S0 P&P
-.Pp
-Valid i/o port values are 0x120, 0x180 and 0x100.
-.Pp
-Valid interrupt configurations are 3, 5, 7, 10, 11 and 12.
-.Pp
-The card is auto-configured by the PnP kernel subsystem.
-.Pp
-.It Ar "3Com USRobotics Sportster ISDN TA intern and Stollmann Tina pp"
-.Pp
-The required (optional for NetBSD)
-.Em flag
-value is 7.
-.Pp
-Valid i/o port values are 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
-0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270 and 0x278.
-.Pp
-Valid interrupt configurations are 5, 7, 10, 11, 12, 14, 15.
-.Pp
-Notice: this card has a strange address decoding scheme resulting in 64
-windows of some bytes length. Anyway, support for this card is good because
-the manufacturer gave out technical docs for this card!
-.Pp
-.Pp
-.It Ar "Dr. Neuhaus Niccy Go@"
-.Pp
-Valid i/o port values must be in the range 0x200 ... 0x3e0.
-.Pp
-Valid interrupt configurations are 3, 4, 5, 9, 10, 11, 12, 15.
-.Pp
-The card is auto-configured by the PnP kernel subsystem.
-.Pp
-.It Ar "Sedlbauer Win Speed"
-.Pp
-Valid i/o port values must be in the range 0x100 ... 0x3f0. (alignment 0x8,
-len 0x8)
-.Pp
-Valid interrupt configurations are 3, 4, 5, 7, 10, 11, 12, 13, 15.
-.Pp
-The card is auto-configured by the PnP kernel subsystem.
-.Em FreeBSD:
-This card is PnP only, and so it can be configured using USERCONFIG
-('man 4 pnp'). This can be done via
-.Em /kernel.config
-\&. For example:
-.Pp
-.Cd USERCONFIG
-.Cd pnp 1 0 os enable port0 0x270 irq0 10
-.Cd quit
-.Pp
-.Pp
-.It Ar "ELSA QuickStep 1000pro (ISA)"
-.Pp
-I/O port in the range 0x160 ... 0x360 (occupies 8 bytes).
-.Pp
-Valid interrupt configurations are 3, 4, 5, 7, 10, 11, 12, 15.
-.Pp
-The card is auto-configured by the PnP kernel subsystem.
-.Pp
-.Pp
-.It Ar "ELSA QuickStep 1000pro-PCI"
-.Pp
-The card is auto-configured by the PCI kernel subsystem.
-.Pp
-.Pp
-.It Ar "ITK ix1 micro"
-.Pp
-The required (optional under NetBSD)
-.Em flag
-value is 18.
-.Pp
-Valid i/o port values must be in the range (<unknown>).
-.Pp
-Valid interrupt configurations are (<unknown>).
-.Pp
-.Sh CAVEATS
-Note that all of the boards with I/O ports actually use several ranges
-of port addresses; Teles happen to refer to the 0xd80 range in their
-documentation (the board also uses 0x180 etc.), while AVM happen to refer
-to the 0x200 range in their documentation (the board also uses 0x600 etc.)
-The driver matches the manufacturers' description for the purposes of
-configuration, but of course makes use of all the ports in order to
-operate the card.
-.Pp
-.Sh BUGS
-Since there is no hardware documentation available from several manufacturers
-for their boards, it is likely that there are many, many bugs left.
-
-.Sh STANDARDS
-CCITT Recommendation I.430
-
-.Sh SEE ALSO
-.Xr i4bq921 4
-.Xr i4bq931 4
-
-.Sh AUTHOR
-The
-.Nm
-driver and this manpage were written by Hellmuth Michaelis. It is based
-on earlier work of Arne Helme, Andrew Gordon and Gary Jennejohn. The author
-can be contacted at hm@kts.org.
-.Pp
-The complete porting to and maintenance of NetBSD was done by Martin Husemann.
-He can be contacted at martin@rumolt.teuto.de
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 124d8042ac9a..5d55861ac063 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
#endif
static const char rcsid[] =
- "$Id: inetd.c,v 1.45 1999/01/02 16:04:19 des Exp $";
+ "$Id: inetd.c,v 1.39 1998/08/17 06:16:59 jb Exp $";
#endif /* not lint */
/*
@@ -172,7 +172,6 @@ int maxcpm = MAXCHILD;
struct servent *sp;
struct rpcent *rpc;
struct in_addr bind_address;
-int signalpipe[2];
struct servtab {
char *se_service; /* name of service */
@@ -218,9 +217,7 @@ struct servtab {
void chargen_dg __P((int, struct servtab *));
void chargen_stream __P((int, struct servtab *));
void close_sep __P((struct servtab *));
-void flag_signal __P((char));
-void flag_config __P((int));
-void config __P((void));
+void config __P((int));
void daytime_dg __P((int, struct servtab *));
void daytime_stream __P((int, struct servtab *));
void discard_dg __P((int, struct servtab *));
@@ -231,19 +228,16 @@ void endconfig __P((void));
struct servtab *enter __P((struct servtab *));
void freeconfig __P((struct servtab *));
struct servtab *getconfigent __P((void));
-void ident_stream __P((int, struct servtab *));
void machtime_dg __P((int, struct servtab *));
void machtime_stream __P((int, struct servtab *));
char *newstr __P((char *));
char *nextline __P((FILE *));
void print_service __P((char *, struct servtab *));
void addchild __P((struct servtab *, int));
-void flag_reapchild __P((int));
-void reapchild __P((void));
+void reapchild __P((int));
void enable __P((struct servtab *));
void disable __P((struct servtab *));
-void flag_retry __P((int));
-void retry __P((void));
+void retry __P((int));
int setconfig __P((void));
void setup __P((struct servtab *));
char *sskip __P((char **));
@@ -268,7 +262,7 @@ struct biltin {
{ "discard", SOCK_STREAM, 1, 0, discard_stream },
{ "discard", SOCK_DGRAM, 0, 0, discard_dg },
- /* Return 32 bit time since 1900 */
+ /* Return 32 bit time since 1970 */
{ "time", SOCK_STREAM, 0, 0, machtime_stream },
{ "time", SOCK_DGRAM, 0, 0, machtime_dg },
@@ -282,8 +276,6 @@ struct biltin {
{ "tcpmux", SOCK_STREAM, 1, 0, (void (*)())tcpmux },
- { "ident", SOCK_STREAM, 1, 0, ident_stream },
-
{ NULL }
};
@@ -416,12 +408,12 @@ main(argc, argv, envp)
sigaddset(&sa.sa_mask, SIGALRM);
sigaddset(&sa.sa_mask, SIGCHLD);
sigaddset(&sa.sa_mask, SIGHUP);
- sa.sa_handler = flag_retry;
+ sa.sa_handler = retry;
sigaction(SIGALRM, &sa, (struct sigaction *)0);
- config();
- sa.sa_handler = flag_config;
+ config(SIGHUP);
+ sa.sa_handler = config;
sigaction(SIGHUP, &sa, (struct sigaction *)0);
- sa.sa_handler = flag_reapchild;
+ sa.sa_handler = reapchild;
sigaction(SIGCHLD, &sa, (struct sigaction *)0);
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, &sapipe);
@@ -436,13 +428,6 @@ main(argc, argv, envp)
(void)setenv("inetd_dummy", dummy, 1);
}
- if (pipe(signalpipe) != 0) {
- syslog(LOG_ERR, "pipe: %%m");
- exit(EX_OSERR);
- }
- FD_SET(signalpipe[0], &allsock);
- if (signalpipe[0]>maxsock) maxsock = signalpipe[0];
-
for (;;) {
int n, ctrl;
fd_set readable;
@@ -462,34 +447,6 @@ main(argc, argv, envp)
}
continue;
}
- /* handle any queued signal flags */
- if (FD_ISSET(signalpipe[0], &readable)) {
- int n;
- if (ioctl(signalpipe[0], FIONREAD, &n) != 0) {
- syslog(LOG_ERR, "ioctl: %m");
- exit(EX_OSERR);
- }
- while (--n >= 0) {
- char c;
- if (read(signalpipe[0], &c, 1) != 1) {
- syslog(LOG_ERR, "read: %m");
- exit(EX_OSERR);
- }
- if (debug)
- warnx("Handling signal flag %c", c);
- switch(c) {
- case 'A': /* sigalrm */
- retry();
- break;
- case 'C': /* sigchld */
- reapchild();
- break;
- case 'H': /* sighup */
- config();
- break;
- }
- }
- }
for (sep = servtab; n && sep; sep = sep->se_next)
if (sep->se_fd != -1 && FD_ISSET(sep->se_fd, &readable)) {
n--;
@@ -691,19 +648,6 @@ main(argc, argv, envp)
}
/*
- * Add a signal flag to the signal flag queue for later handling
- */
-
-void flag_signal(c)
- char c;
-{
- if (write(signalpipe[1], &c, 1) != 1) {
- syslog(LOG_ERR, "write: %m");
- exit(EX_OSERR);
- }
-}
-
-/*
* Record a new child pid for this service. If we've reached the
* limit on children, then stop accepting incoming requests.
*/
@@ -730,15 +674,9 @@ addchild(struct servtab *sep, pid_t pid)
*/
void
-flag_reapchild(signo)
+reapchild(signo)
int signo;
{
- flag_signal('C');
-}
-
-void
-reapchild()
-{
int k, status;
pid_t pid;
struct servtab *sep;
@@ -768,14 +706,9 @@ reapchild()
}
void
-flag_config(signo)
+config(signo)
int signo;
{
- flag_signal('H');
-}
-
-void config()
-{
struct servtab *sep, *new, **sepp;
long omask;
@@ -952,15 +885,9 @@ unregisterrpc(sep)
}
void
-flag_retry(signo)
+retry(signo)
int signo;
{
- flag_signal('A');
-}
-
-void
-retry()
-{
struct servtab *sep;
timingout = 0;
@@ -1523,33 +1450,6 @@ inetd_setproctitle(a, s)
*/
#define BUFSIZE 8192
-#define IDENT_RESPONSE ":ERROR:HIDDEN-USER\r\n"
-
-/* ARGSUSED */
-void
-ident_stream(s, sep) /* Ident service */
- int s;
- struct servtab *sep;
-{
- char buffer[BUFSIZE];
- int i, j;
-
- inetd_setproctitle(sep->se_service, s);
- j = 0;
- while ((i = read(s, buffer + j, sizeof(buffer) - j)) > 0) {
- j += i;
- buffer[j] = '\0';
- if (strchr(buffer, '\n'))
- break;
- if (strchr(buffer, '\r'))
- break;
- }
- while (j > 0 && (buffer[j-1] == '\n' || buffer[j-1] == '\r'))
- j--;
- write(s, buffer, j);
- write(s, IDENT_RESPONSE, strlen(IDENT_RESPONSE));
- exit(0);
-}
/* ARGSUSED */
void
echo_stream(s, sep) /* Echo service -- echo data back */
@@ -1736,7 +1636,7 @@ chargen_dg(s, sep) /* Character generator */
* some seventy years Bell Labs was asleep.
*/
-unsigned long
+long
machtime()
{
struct timeval tv;
@@ -1757,7 +1657,7 @@ machtime_stream(s, sep)
int s;
struct servtab *sep;
{
- unsigned long result;
+ long result;
result = machtime();
(void) write(s, (char *) &result, sizeof(result));
@@ -1769,7 +1669,7 @@ machtime_dg(s, sep)
int s;
struct servtab *sep;
{
- unsigned long result;
+ long result;
struct sockaddr_in sin;
int size;
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1
index ebac0d978042..93c67700e091 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.1
+++ b/usr.sbin/kbdcontrol/kbdcontrol.1
@@ -36,7 +36,7 @@ characteristics etc.
.Pp
The following command line options are supported:
.Bl -tag -width indent
-.It Fl b Ar duration.pitch | Ar [quiet.]belltype
+.It Fl b Ar duration.pitch | Ar belltype
Set the bell duration in miliseconds and pitch in hertz.
If a
.Ar belltype
@@ -47,7 +47,7 @@ which set sound parameters back to normal values, or
which set the bell to visual mode, i.e. flashes the screen instead.
If
.Ar belltype
-is preceded by the word
+is proceeded by the word
.Ar quiet. ,
the bell will not be rung when the ringing process is in the background vty.
.It Fl r Ar delay.repeat | Ar speed
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index 5ea0d780b493..e1614c3dcc3e 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -28,7 +28,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: kbdcontrol.c,v 1.20 1999/01/11 03:20:24 yokota Exp $";
+ "$Id: kbdcontrol.c,v 1.18 1998/09/04 10:15:48 yokota Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -37,7 +37,6 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
#include <machine/console.h>
#include "path.h"
#include "lex.h"
@@ -417,13 +416,8 @@ print_entry(FILE *fp, int value)
}
-#ifdef __i386__
-void
-print_key_definition_line(FILE *fp, int scancode, struct keyent_t *key)
-#else
void
print_key_definition_line(FILE *fp, int scancode, struct key_t *key)
-#endif
{
int i;
@@ -871,116 +865,14 @@ set_history(char *opt)
warn("setting history buffer size");
}
-#ifdef __i386__
-static char
-*get_kbd_type_name(int type)
-{
- static struct {
- int type;
- char *name;
- } name_table[] = {
- { KB_84, "AT 84" },
- { KB_101, "AT 101/102" },
- { KB_OTHER, "generic" },
- };
- int i;
-
- for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
- if (type == name_table[i].type)
- return name_table[i].name;
- }
- return "unknown";
-}
-
-void
-show_kbd_info(void)
-{
- keyboard_info_t info;
-
- if (ioctl(0, KDGKBINFO, &info) == -1) {
- warn("unable to obtain keyboard information");
- return;
- }
- printf("kbd%d:\n", info.kb_index);
- printf(" %.*s%d, type:%s (%d)\n",
- sizeof(info.kb_name), info.kb_name, info.kb_unit,
- get_kbd_type_name(info.kb_type), info.kb_type);
-}
-
-
-void
-set_keyboard(char *device)
-{
- keyboard_info_t info;
- int fd;
-
- fd = open(device, O_RDONLY);
- if (fd < 0) {
- warn("cannot open %s", device);
- return;
- }
- if (ioctl(fd, KDGKBINFO, &info) == -1) {
- warn("unable to obtain keyboard information");
- close(fd);
- return;
- }
- /*
- * The keyboard device driver won't release the keyboard by
- * the following ioctl, but it automatically will, when the device
- * is closed. So, we don't check error here.
- */
- ioctl(fd, CONS_RELKBD, 0);
- close(fd);
-#if 1
- printf("kbd%d\n", info.kb_index);
- printf(" %.*s%d, type:%s (%d)\n",
- sizeof(info.kb_name), info.kb_name, info.kb_unit,
- get_kbd_type_name(info.kb_type), info.kb_type);
-#endif
-
- if (ioctl(0, CONS_SETKBD, info.kb_index) == -1)
- warn("unable to set keyboard");
-}
-
-
-void
-release_keyboard(void)
-{
- keyboard_info_t info;
-
- /*
- * If stdin is not associated with a keyboard, the following ioctl
- * will fail.
- */
- if (ioctl(0, KDGKBINFO, &info) == -1) {
- warn("unable to obtain keyboard information");
- return;
- }
-#if 1
- printf("kbd%d\n", info.kb_index);
- printf(" %.*s%d, type:%s (%d)\n",
- sizeof(info.kb_name), info.kb_name, info.kb_unit,
- get_kbd_type_name(info.kb_type), info.kb_type);
-#endif
- if (ioctl(0, CONS_RELKBD, 0) == -1)
- warn("unable to release the keyboard");
-}
-#endif /* __i386__ */
-
static void
usage()
{
fprintf(stderr, "%s\n%s\n%s\n",
-#ifdef __i386__
-"usage: kbdcontrol [-dFKix] [-b duration.pitch | [quiet.]belltype]",
-" [-r delay.repeat | speed] [-l mapfile] [-f # string]",
-" [-h size] [-k device] [-L mapfile]");
-#else
"usage: kbdcontrol [-dFx] [-b duration.pitch | [quiet.]belltype]",
" [-r delay.repeat | speed] [-l mapfile] [-f # string]",
" [-h size] [-L mapfile]");
-#endif
exit(1);
}
@@ -990,11 +882,7 @@ main(int argc, char **argv)
{
int opt;
-#ifdef __i386__
- while((opt = getopt(argc, argv, "b:df:h:iKk:Fl:L:r:x")) != -1)
-#else
while((opt = getopt(argc, argv, "b:df:h:Fl:L:r:x")) != -1)
-#endif
switch(opt) {
case 'b':
set_bell_values(optarg);
@@ -1018,17 +906,6 @@ main(int argc, char **argv)
case 'h':
set_history(optarg);
break;
-#ifdef __i386__
- case 'i':
- show_kbd_info();
- break;
- case 'K':
- release_keyboard();
- break;
- case 'k':
- set_keyboard(optarg);
- break;
-#endif /* __i386__ */
case 'r':
set_keyrates(optarg);
break;
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index e3e0666a48dd..b1c74036dc9c 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -29,8 +29,6 @@
* 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 lint
@@ -38,7 +36,7 @@
static char sccsid[] = "@(#)from: nlist.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: nlist.c,v 1.9 1998/08/17 08:46:46 dfr Exp $";
+ "$Id: nlist.c,v 1.8 1997/09/24 06:44:10 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -182,16 +180,14 @@ __aout_knlist(name, db)
#ifdef DO_ELF
-static void elf_sym_to_nlist __P((struct nlist *, Elf_Sym *, Elf_Shdr *, int));
-
int
__elf_knlist(name, db)
char *name;
DB *db;
{
register caddr_t strtab;
- register off_t symstroff = 0, symoff = 0;
- register u_long symsize = 0;
+ register off_t symstroff, symoff;
+ register u_long symsize;
register u_long kernvma, kernoffs;
register int i;
Elf_Sym *sbuf;
@@ -245,8 +241,6 @@ __elf_knlist(name, db)
kernoffs = sh[i].sh_offset;
}
}
- if (symsize == 0)
- badfmt("stripped");
strtab = (char *)&filep[symstroff];
@@ -259,7 +253,24 @@ __elf_knlist(name, db)
sbuf = (Elf_Sym *)&filep[symoff + i * sizeof(*sbuf)];
if (!sbuf->st_name)
continue;
- elf_sym_to_nlist(&nbuf, sbuf, sh, eh->e_shnum);
+
+ nbuf.n_value = sbuf->st_value;
+
+ /*XXX type conversion is pretty rude... */
+ switch (ELF_ST_TYPE(sbuf->st_info)) {
+ case STT_NOTYPE:
+ nbuf.n_type = N_UNDF;
+ break;
+ case STT_FUNC:
+ nbuf.n_type = N_TEXT;
+ break;
+ case STT_OBJECT:
+ nbuf.n_type = N_DATA;
+ break;
+ }
+ if (ELF_ST_BIND(sbuf->st_info) == STB_LOCAL)
+ nbuf.n_type = N_EXT;
+
key.data = (u_char *)(strtab + sbuf->st_name);
key.size = strlen((char *)key.data);
if (db->put(db, &key, &data, 0))
@@ -300,46 +311,6 @@ __elf_knlist(name, db)
(void)close(fd);
return(0);
}
-
-/*
- * Convert an Elf_Sym into an nlist structure. This fills in only the
- * n_value and n_type members.
- */
-static void
-elf_sym_to_nlist(nl, s, shdr, shnum)
- struct nlist *nl;
- Elf_Sym *s;
- Elf_Shdr *shdr;
- int shnum;
-{
- nl->n_value = s->st_value;
-
- switch (s->st_shndx) {
- case SHN_UNDEF:
- case SHN_COMMON:
- nl->n_type = N_UNDF;
- break;
- case SHN_ABS:
- nl->n_type = ELF_ST_TYPE(s->st_info) == STT_FILE ?
- N_FN : N_ABS;
- break;
- default:
- if (s->st_shndx >= shnum)
- nl->n_type = N_UNDF;
- else {
- Elf_Shdr *sh = shdr + s->st_shndx;
-
- nl->n_type = sh->sh_type == SHT_PROGBITS ?
- (sh->sh_flags & SHF_WRITE ? N_DATA : N_TEXT) :
- (sh->sh_type == SHT_NOBITS ? N_BSS : N_UNDF);
- }
- break;
- }
-
- if (ELF_ST_BIND(s->st_info) == STB_GLOBAL ||
- ELF_ST_BIND(s->st_info) == STB_WEAK)
- nl->n_type |= N_EXT;
-}
#endif /* DO_ELF */
static struct knlist_handlers {
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index 56a364da33e6..54131ad60250 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -48,7 +48,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: lpr.c 8.4 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$Id: lpr.c,v 1.26 1999/01/06 08:25:56 imp Exp $";
+ "$Id: lpr.c,v 1.24 1998/04/17 17:25:49 obrien Exp $";
#endif /* not lint */
/*
@@ -126,7 +126,7 @@ main(argc, argv)
{
struct passwd *pw;
struct group *gptr;
- char *arg, *cp, *printer, *p;
+ char *arg, *cp, *printer;
char buf[BUFSIZ];
int c, i, f, errs;
struct stat stb;
@@ -154,9 +154,7 @@ main(argc, argv)
":#:1:2:3:4:C:J:P:T:U:cdfghi:lnmprstvw:")) != -1)
switch (c) {
case '#': /* n copies */
- i = strtol(optarg, &p, 10);
- if (*p)
- errx(1, "Bad argument to -#, number expected");
+ i = atoi(optarg);
if (i > 0)
ncopies = i;
break;
@@ -212,9 +210,7 @@ main(argc, argv)
case 'i': /* indent output */
iflag++;
- indent = strtol(optarg, &p, 10);
- if (*p)
- errx(1, "Bad argument to -i, number expected");
+ indent = atoi(optarg);
break;
case 'm': /* send mail when done */
diff --git a/usr.sbin/lptcontrol/lptcontrol.c b/usr.sbin/lptcontrol/lptcontrol.c
index afd234ee5ba6..73ea05cf459f 100644
--- a/usr.sbin/lptcontrol/lptcontrol.c
+++ b/usr.sbin/lptcontrol/lptcontrol.c
@@ -30,7 +30,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: lptcontrol.c,v 1.6 1997/09/25 06:36:29 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <ctype.h>
@@ -53,12 +53,10 @@ static const char rcsid[] =
#define IRQ_INVALID -1
#define DO_POLL 0
#define USE_IRQ 1
-#define USE_EXT_MODE 2
-#define USE_STD_MODE 3
static void usage()
{
- fprintf(stderr, "usage: lptcontrol -i | -p | -s | -e [-u <unit no.>]\n");
+ fprintf(stderr, "usage: lptcontrol -i | -p [-u <unit no.>]\n");
exit(1);
}
@@ -91,12 +89,10 @@ int main (int argc, char * argv[])
int irq_status = IRQ_INVALID;
char * unit = DEFAULT_UNIT;
- while((opt = getopt(argc, argv, "ipesu:")) != -1)
+ while((opt = getopt(argc, argv, "ipu:")) != -1)
switch(opt) {
case 'i': irq_status = USE_IRQ; break;
case 'p': irq_status = DO_POLL; break;
- case 'e': irq_status = USE_EXT_MODE; break;
- case 's': irq_status = USE_STD_MODE; break;
case 'u': unit = optarg;
if(!isdigit(*unit))
usage();
diff --git a/usr.sbin/moused/moused.8 b/usr.sbin/moused/moused.8
index 64cd108a4434..18d1b4dbb334 100644
--- a/usr.sbin/moused/moused.8
+++ b/usr.sbin/moused/moused.8
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: moused.8,v 1.17 1998/11/20 11:19:20 yokota Exp $
+.\" $Id: moused.8,v 1.15 1998/06/14 20:05:26 ahasty Exp $
.\"
.Dd December 3, 1997
.Dt MOUSED 8
@@ -45,7 +45,6 @@
.Op Fl S Ar baudrate
.Op Fl C Ar threshold
.Op Fl m Ar N=M
-.Op Fl w Ar N
.Op Fl z Ar target
.Op Fl t Ar mousetype
.Fl p Ar port
@@ -260,8 +259,6 @@ Kensington ThinkingMouse protocol.
Hitachi tablet protocol.
.It Ar x10mouseremote
X10 MouseRemote.
-.It Ar kidspad
-Genius Kidspad and Easypad protocol.
.El
.Pp
For the bus and InPort mouse:
@@ -278,15 +275,6 @@ For the PS/2 mouse:
This is the only protocol type available for the PS/2 mouse
and should be specified for any PS/2 mice, regardless of the brand.
.El
-.It Fl w Ar N
-Make the physical button
-.Ar N
-act as the wheel mode button.
-While this button is pressed, X and Y axis movement is reported to be zero
-and the Y axis movement is mapped to Z axis.
-You may further map the Z axis movement to virtual buttons by the
-.Fl z
-option below.
.It Fl z Ar target
Map Z axis (roller/wheel) movement to another axis or to virtual buttons.
Valid
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c
index a4ef99bf0759..2717fc00971e 100644
--- a/usr.sbin/moused/moused.c
+++ b/usr.sbin/moused/moused.c
@@ -46,7 +46,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: moused.c,v 1.23 1998/11/20 11:22:17 yokota Exp $";
+ "$Id: moused.c,v 1.19 1998/06/14 20:05:27 ahasty Exp $";
#endif /* not lint */
#include <err.h>
@@ -187,7 +187,6 @@ static char *rnames[] = {
"thinkingmouse",
"sysmouse",
"x10mouseremote",
- "kidspad",
#if notyet
"mariqua",
#endif
@@ -203,7 +202,6 @@ static symtab_t rmodels[] = {
{ "IntelliMouse", MOUSE_MODEL_INTELLI },
{ "EasyScroll", MOUSE_MODEL_EASYSCROLL },
{ "MouseMan+", MOUSE_MODEL_MOUSEMANPLUS },
- { "Kidspad", MOUSE_MODEL_KIDSPAD },
{ "generic", MOUSE_MODEL_GENERIC },
{ NULL, MOUSE_MODEL_UNKNOWN },
};
@@ -220,8 +218,6 @@ static symtab_t pnpprod[] = {
{ "KYE0001", MOUSE_PROTO_MS, MOUSE_MODEL_GENERIC },
/* Genius NetMouse */
{ "KYE0003", MOUSE_PROTO_INTELLI, MOUSE_MODEL_NET },
- /* Genius Kidspad, Easypad and other tablets */
- { "KYE0005", MOUSE_PROTO_KIDSPAD, MOUSE_MODEL_KIDSPAD },
/* Genius EZScroll */
{ "KYEEZ00", MOUSE_PROTO_MS, MOUSE_MODEL_EASYSCROLL },
/* Logitech MouseMan (new 4 button model) */
@@ -330,7 +326,6 @@ static unsigned short rodentcflags[] =
(CS7 | CREAD | CLOCAL | HUPCL ), /* Thinking Mouse */
(CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* sysmouse */
(CS7 | CREAD | CLOCAL | HUPCL ), /* X10 MouseRemote */
- (CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL ), /* kidspad etc. */
#if notyet
(CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* Mariqua */
#endif
@@ -345,7 +340,6 @@ static struct rodentparam {
int rate; /* report rate */
int resolution; /* MOUSE_RES_XXX or a positive number */
int zmap; /* MOUSE_{X|Y}AXIS or a button number */
- int wmode; /* wheel mode button number */
int mfd; /* mouse file descriptor */
int cfd; /* /dev/consolectl file descriptor */
int mremsfd; /* mouse remote server file descriptor */
@@ -362,7 +356,6 @@ static struct rodentparam {
rate : 0,
resolution : MOUSE_RES_UNKNOWN,
zmap: 0,
- wmode: 0,
mfd : -1,
cfd : -1,
mremsfd : -1,
@@ -408,15 +401,13 @@ static char *gettokenname(symtab_t *tab, int val);
static void mremote_serversetup();
static void mremote_clientchg(int add);
-static int kidspad(u_char rxc, mousestatus_t *act);
-
void
main(int argc, char *argv[])
{
int c;
int i;
- while((c = getopt(argc,argv,"3C:DF:I:PRS:cdfhi:l:m:p:r:st:w:z:")) != -1)
+ while((c = getopt(argc,argv,"3C:DF:I:PRS:cdfhi:l:m:p:r:st:z:")) != -1)
switch(c) {
case '3':
@@ -496,15 +487,6 @@ main(int argc, char *argv[])
rodent.baudrate = 9600;
break;
- case 'w':
- i = atoi(optarg);
- if ((i <= 0) || (i > MOUSE_MAXBUTTON)) {
- warnx("invalid argument `%s'", optarg);
- usage();
- }
- rodent.wmode = 1 << (i - 1);
- break;
-
case 'z':
if (strcmp(optarg, "x") == 0)
rodent.zmap = MOUSE_XAXIS;
@@ -812,9 +794,9 @@ static void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n",
- "usage: moused [-3DRcdfs] [-I file] [-F rate] [-r resolution] [-S baudrate]",
- " [-C threshold] [-m N=M] [-w N] [-z N] [-t <mousetype>] -p <port>",
- " moused [-d] -i <info> -p <port>");
+ "usage: moused [-3DRcdfs] [-I file] [-F rate] [-r resolution] [-S baudrate] [-C threshold]",
+ " [-m N=M] [-z N] [-t <mousetype>] -p <port>",
+ " moused [-d] -i -p <port>");
exit(1);
}
@@ -884,7 +866,6 @@ static unsigned char proto[][7] = {
{ 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* ThinkingMouse */
{ 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* sysmouse */
{ 0x40, 0x40, 0x40, 0x00, 3, ~0x23, 0x00 }, /* X10 MouseRem */
- { 0x80, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* KIDSPAD */
#if notyet
{ 0xf8, 0x80, 0x00, 0x00, 5, ~0x2f, 0x10 }, /* Mariqua */
#endif
@@ -1266,8 +1247,6 @@ r_protocol(u_char rBuf, mousestatus_t *act)
static unsigned char pBuf[8];
debug("received char 0x%x",(int)rBuf);
- if (rodent.rtype == MOUSE_PROTO_KIDSPAD)
- return kidspad(rBuf, act) ;
/*
* Hack for resyncing: We check here for a package that is:
@@ -1641,12 +1620,6 @@ r_map(mousestatus_t *act1, mousestatus_t *act2)
lbuttons = 0;
act2->obutton = act2->button;
- if (pbuttons & rodent.wmode) {
- pbuttons &= ~rodent.wmode;
- act1->dz = act1->dy;
- act1->dx = 0;
- act1->dy = 0;
- }
act2->dx = act1->dx;
act2->dy = act1->dy;
act2->dz = act1->dz;
@@ -1897,7 +1870,7 @@ pnpwakeup1(void)
* The PnP COM device spec. dictates that the mouse must set DSR
* in response to DTR (by hardware or by software) and that if DSR is
* not asserted, the host computer should think that there is no device
- * at this serial port. But some mice just don't do that...
+ * at this serial port. But there are some mice just don't do that...
*/
ioctl(rodent.mfd, TIOCMGET, &i);
debug("modem status 0%o", i);
@@ -1927,29 +1900,29 @@ pnpwakeup1(void)
if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
debug("pnpwakeup1(): valid response in first phase.");
return TRUE;
- }
+ } else {
- /* port setup, 2nd phase (2.1.5) */
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
- ioctl(rodent.mfd, TIOCMBIC, &i);
- usleep(240000);
+ /* port setup, 2nd phase (2.1.5) */
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
+ ioctl(rodent.mfd, TIOCMBIC, &i);
+ usleep(240000);
- /* wait for respose, 2nd phase (2.1.6) */
- i = FREAD;
- ioctl(rodent.mfd, TIOCFLUSH, &i);
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
- ioctl(rodent.mfd, TIOCMBIS, &i);
+ /* wait for respose, 2nd phase (2.1.6) */
+ i = FREAD;
+ ioctl(rodent.mfd, TIOCFLUSH, &i);
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
+ ioctl(rodent.mfd, TIOCMBIS, &i);
- /* try to read something */
- FD_ZERO(&fds);
- FD_SET(rodent.mfd, &fds);
- timeout.tv_sec = 0;
- timeout.tv_usec = 240000;
- if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
- debug("pnpwakeup1(): valid response in second phase.");
- return TRUE;
+ /* try to read something */
+ FD_ZERO(&fds);
+ FD_SET(rodent.mfd, &fds);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 240000;
+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
+ debug("pnpwakeup1(): valid response in second phase.");
+ return TRUE;
+ }
}
-
return FALSE;
}
@@ -1963,7 +1936,7 @@ pnpwakeup2(void)
/*
* This is a simplified procedure; it simply toggles RTS.
*/
- debug("alternate probe...");
+ debug("PnP COM device rev 0.9 probe...");
ioctl(rodent.mfd, TIOCMGET, &i);
i |= TIOCM_DTR; /* DTR = 1 */
@@ -1988,7 +1961,6 @@ pnpwakeup2(void)
debug("pnpwakeup2(): valid response.");
return TRUE;
}
-
return FALSE;
}
@@ -2221,8 +2193,7 @@ pnpproto(pnpid_t *id)
int i, j;
if (id->nclass > 0)
- if ( strncmp(id->class, "MOUSE", id->nclass) != 0 &&
- strncmp(id->class, "TABLET", id->nclass) != 0)
+ if (strncmp(id->class, "MOUSE", id->nclass) != 0)
/* this is not a mouse! */
return NULL;
@@ -2278,97 +2249,6 @@ gettokenname(symtab_t *tab, int val)
return NULL;
}
-
-/*
- * code to read from the Genius Kidspad tablet.
-
-The tablet responds to the COM PnP protocol 1.0 with EISA-ID KYE0005,
-and to pre-pnp probes (RTS toggle) with 'T' (tablet ?)
-9600, 8 bit, parity odd.
-
-The tablet puts out 5 bytes. b0 (mask 0xb8, value 0xb8) contains
-the proximity, tip and button info:
- (byte0 & 0x1) true = tip pressed
- (byte0 & 0x2) true = button pressed
- (byte0 & 0x40) false = pen in proximity of tablet.
-
-The next 4 bytes are used for coordinates xl, xh, yl, yh (7 bits valid).
-
-Only absolute coordinates are returned, so we use the following approach:
-we store the last coordinates sent when the pen went out of the tablet,
-
-
- *
- */
-
-typedef enum {
- S_IDLE, S_PROXY, S_FIRST, S_DOWN, S_UP
-} k_status ;
-
-static int
-kidspad(u_char rxc, mousestatus_t *act)
-{
- static buf[5];
- static int buflen = 0, b_prev = 0 , x_prev = -1, y_prev = -1 ;
- static k_status status = S_IDLE ;
- static struct timeval old, now ;
- static int x_idle = -1, y_idle = -1 ;
-
- int deltat, x, y ;
-
- if (buflen > 0 && (rxc & 0x80) ) {
- fprintf(stderr, "invalid code %d 0x%x\n", buflen, rxc);
- buflen = 0 ;
- }
- if (buflen == 0 && (rxc & 0xb8) != 0xb8 ) {
- fprintf(stderr, "invalid code 0 0x%x\n", rxc);
- return 0 ; /* invalid code, no action */
- }
- buf[buflen++] = rxc ;
- if (buflen < 5)
- return 0 ;
-
- buflen = 0 ; /* for next time... */
-
- x = buf[1]+128*(buf[2] - 7) ;
- if (x < 0) x = 0 ;
- y = 28*128 - (buf[3] + 128* (buf[4] - 7)) ;
- if (y < 0) y = 0 ;
-
- x /= 8 ;
- y /= 8 ;
-
- act->flags = 0 ;
- act->obutton = act->button ;
- act->dx = act->dy = act->dz = 0 ;
- gettimeofday(&now, NULL);
- if ( buf[0] & 0x40 ) /* pen went out of reach */
- status = S_IDLE ;
- else if (status == S_IDLE) { /* pen is newly near the tablet */
- act->flags |= MOUSE_POSCHANGED ; /* force update */
- status = S_PROXY ;
- x_prev = x ;
- y_prev = y ;
- }
- old = now ;
- act->dx = x - x_prev ;
- act->dy = y - y_prev ;
- if (act->dx || act->dy)
- act->flags |= MOUSE_POSCHANGED ;
- x_prev = x ;
- y_prev = y ;
- if (b_prev != 0 && b_prev != buf[0]) { /* possibly record button change */
- act->button = 0 ;
- if ( buf[0] & 0x01 ) /* tip pressed */
- act->button |= MOUSE_BUTTON1DOWN ;
- if ( buf[0] & 0x02 ) /* button pressed */
- act->button |= MOUSE_BUTTON2DOWN ;
- act->flags |= MOUSE_BUTTONSCHANGED ;
- }
- b_prev = buf[0] ;
- return act->flags ;
-}
-
static void
mremote_serversetup()
{
diff --git a/usr.sbin/mrouted/RELEASE b/usr.sbin/mrouted/RELEASE
index 979065011f28..7dff93789cce 100644
--- a/usr.sbin/mrouted/RELEASE
+++ b/usr.sbin/mrouted/RELEASE
@@ -1,188 +1,21 @@
-README-3.9-beta3.mrouted,v 1.1.2.1 1998/03/01 03:00:20 fenner Exp
+Id: README-3.8.mrouted,v 3.8 1995/11/29 22:23:02 fenner Rel
IP Multicast Extensions for BSD-Derived Unix Systems
- Multicast Routing Daemon
- Release 3.9-beta3
- February 28, 1998
+ Release 3.8
+ November 29, 1995
available from parcftp.xerox.com,
- file pub/net-research/ipmulti/beta-test/mrouted3.9-beta3.tar.Z
- binaries:
- pub/net-research/ipmulti/beta-test/mrouted3.9-beta3-sparc-sunos41x.tar.Z
- pub/net-research/ipmulti/beta-test/mrouted3.9-beta3-sparc-solaris2.tar.Z
- pub/net-research/ipmulti/beta-test/mrouted3.9-beta3-i386-freebsd22.tar.Z
- pub/net-research/ipmulti/beta-test/mrouted3.9-beta3-alpha-osf1.tar.Z
- pub/net-research/ipmulti/beta-test/mrouted3.9-beta3-sgi-irix6.tar.Z
-
-Note: The 3.9 release is mrouted-only, and will run on top of a 3.5 kernel.
-It is a drop-in replacement for mrouted 3.5, 3.6, 3.7 or 3.8.
-
-NOTE WELL: This is a beta-test release of mrouted. The basic
-functionality has been extensively tested in CAIRN and other
-testbeds, but it is expected to have bugs. Please report bugs to Bill
-Fenner <fenner@parc.xerox.com>.
-
-
-The 3.9-beta3 release fixes the following bugs:
- o There was a bug handling routing updates which caused random black
- holes.
-
- o There was a race condition in the timer handlers causing free'd memory
- to sometimes get touched.
-
- o "allow_nonpruners" wasn't allowed in the configuration file (and almost
- nobody noticed! - probably a good sign)
-
- o When a prune times out and the source has been active "recently",
- mrouted now waits for further traffic instead of triggering a new
- prune.
-
- o mrouted now ignores unreachable routes when making a routing decision
- (previously it would blackhole, now it can find a less-specific)
-
-The 3.9-beta3 release has the following new features:
- o A "blaster" keyword for mrouted.conf, to turn on handling of routers
- (mostly ciscos) which overwhelm the socket buffers by blasting the
- whole routing table at once.
-
- o A "notransit" keyword; routes learned on a "notransit" vif will not be
- readvertised onto another "notransit" vif.
-
- o The 500kbps default rate limit on tunnels has been removed.
-
- o An ICMP listener which logs ICMP errors which appear to be in response to
- tunnel packets that we sent.
-
- o A tunnel traffic encapsulator, which encapsulates control traffic
- inside the tunnel instead of unicasting it "beside" the tunnel.
- This is turned off by default; use "beside off" to turn it on.
-
- o A "force_leaf" flag to ignore any potential neighbors on a given interface.
-
-
-=========
-3.9-beta2
-June 11, 1997
-
-The 3.9-beta2 release fixes the following bugs:
- o There was a bug in 3.9-beta1's raw socket buffer processing that
- would cause an immediate lockup on startup on some systems.
-
- o RSRR would not clear out the group membership information if
- further notification of changes to this route entry was not possible.
-
-There is no need to upgrade to 3.9-beta2 if you are not experiencing
-one of the aforementioned bugs.
-
-=========
-3.9-beta1
-June 6, 1997
-
-The 3.9-beta1 release has the following known bugs:
-
- o The startup message doesn't print properly if you have too many
- interfaces.
-
-The 3.9-beta1 release fixes the following bugs:
-
- o mrouted did not properly keep track of subordinates, and would not
- time out subordinateness. This caused 2 major problems:
- 1. pruning did not happen when there were equal-cost paths to
- the same multi-access link
- 2. subordinateness which did not get cancelled by a non-poisoned
- route (e.g. in the face of route filtering) did not time out,
- causing traffic to continue to flow.
-
- o mrouted's IGMPv2 processing when it is not the querier now
- conforms to draft-ietf-idmr-igmp-v2-06.txt Thanks to Lorenzo
- VICISANO <L.Vicisano@cs.ucl.ac.uk> for finding a problem.
-
- o mrouted is much more careful about forgetting prunes; 3.8
- would forget prunes whenever any route change ocurred.
-
-The 3.9-beta1 release has the following new features:
-
- o Longer prune lifetimes (2 hours) by default. Prune lifetimes may
- be configured per-vif, with the "prune_lifetime N" mrouted.conf
- configuration file entry (where N is in seconds). This helps to
- work around the black holes caused on restart when you have a Cisco
- upstream which does not handle genid's; if this is your situation
- the recommended value is 300.
-
- o mrouted's behavior of flooding new routes by default at startup
- in order to speed healing of paths during startup can be turned off
- per-vif or globally with the "noflood" configuration option.
- Turning this option off means you are likely to experience
- black holes for a minute or two when you restart a router. The
- default is to flood for a minute or two until mrouted is able to
- learn subordinate relationships.
-
- o mrouted now retransmits prunes by default on point-to-point links.
- prune retransmission can be turned on or off per vif via the
- "rexmit_prunes [on|off]" mrouted.conf command. Prune retransmission
- helps on lossy links, and also helps when a router has forgotten
- about a prune (e.g. if it is out of memory and needs to shed state,
- or due to a bug).
-
- o The new "passive" mode causes mrouted to not actively send probes
- looking for neighbors. This allows a dialup link to become quiescent
- if there is no DVMRP neighbor on the other end. Configuring
- "passive" on both ends of a link will cause it to never come up.
-
- o mrouted defaults to not peering with DVMRP routers that do not
- prune. Use the "allow_nonpruners" mrouted.conf option on a vif
- on which you want to allow such peerings.
-
- o mrouted now allows route filtering. mrouted.conf syntax:
- accept 13/8
-
- accepts all routes matching 13/8 (e.g. accepts
- 13.2.116/22). If you want to accept only exactly
- 13/8, use
-
- accept 13/8 exact
-
- deny 10/8 64/2 130/8 exact 172/8 exact
-
- denies some common MBone martians
-
- Only "accept" or "deny" is allowed, no combinations.
-
- Add "bidir" to apply the filter to output too, otherwise
- it's input only.
-
- Expected usage:
- - Providers filter routes that customers send them
- - Martian removal
- - Topology modification (e.g. don't let the existence of
- private tunnel foo out into the world).
-
-
- o mrouted now malloc's the buffer it uses for SIOCGIFCONF, to allow
- for more interfaces. Thanks to Danny Mitzel
-
- o mrouted now ignores multiple entries for a single interface
- name (temporary hack until mrouted understands interface aliases)
-
- o mrouted's "-d" flag has been modified to accept the names of the
- systems which you would like to debug.
- packet, prunes, routes, peers, cache, timeout, interface,
- membership, traceroute, igmp
-
- o mrouted now times neighbors out fater, and fully detects and
- ignores routes from one-way peerings.
-
- o mrouted's route processing has been sped up, especially at startup.
-
- o mrouted uses the biggest SO_RCVBUF the operating system allows
- (up to 256Kbytes)
-
- o mrouted uses TOS 0xc0 ("Internet Control") for DVMRP messages.
-
-===========
-Release 3.8
-November 29, 1995
+ file pub/net-research/ipmulti/mrouted3.8.tar.Z
+ binaries pub/net-research/ipmulti/mrouted3.8-sparc-sunos41x.tar.Z
+ pub/net-research/ipmulti/mrouted3.8-sparc-solaris2.tar.Z
+ pub/net-research/ipmulti/mrouted3.8-i386-bsd.tar.Z
+ pub/net-research/ipmulti/mrouted3.8-alpha-osf1.tar.Z
+ pub/net-research/ipmulti/mrouted3.8-sgi-irix.tar.Z
+ pub/net-research/ipmulti/mrouted3.8-hp-hpux.tar.Z
+
+Note: The 3.8 release is mrouted-only, and will run on top of a 3.5 kernel.
+It is a drop-in replacement for mrouted 3.5, 3.6 or 3.7 .
The 3.8 release fixes the following bugs:
diff --git a/usr.sbin/mrouted/VERSION b/usr.sbin/mrouted/VERSION
deleted file mode 100644
index a0ba149f7950..000000000000
--- a/usr.sbin/mrouted/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-3.9-beta3+IOS12
diff --git a/usr.sbin/mrouted/callout.c b/usr.sbin/mrouted/callout.c
index 673973fdedfd..7de8bafe399f 100644
--- a/usr.sbin/mrouted/callout.c
+++ b/usr.sbin/mrouted/callout.c
@@ -5,14 +5,11 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * callout.c,v 3.8.4.8 1998/01/06 01:58:45 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: callout.c,v 1.10 1998/01/16 07:17:41 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
@@ -21,11 +18,13 @@ static const char rcsid[] =
static int id = 0;
static struct timeout_q *Q = 0; /* pointer to the beginning of timeout queue */
+static int in_callout = 0;
+
struct timeout_q {
struct timeout_q *next; /* next event */
int id;
cfunc_t func; /* function to call */
- void *data; /* func's data */
+ char *data; /* func's data */
int time; /* time offset to next event*/
};
@@ -41,64 +40,47 @@ callout_init()
Q = (struct timeout_q *) 0;
}
-void
-free_all_callouts()
-{
- struct timeout_q *p;
-
- while (Q) {
- p = Q;
- Q = Q->next;
- free(p);
- }
-}
-
/*
- * elapsed_time seconds have passed; perform all the events that should
- * happen.
+ * signal handler for SIGALARM that is called once every second
*/
void
-age_callout_queue(elapsed_time)
- int elapsed_time;
+age_callout_queue()
{
struct timeout_q *ptr;
- int i = 0;
+
+ if (in_callout)
+ return;
- for (ptr = Q; ptr; ptr = Q, i++) {
- if (ptr->time > elapsed_time) {
- ptr->time -= elapsed_time;
- return;
- } else {
- elapsed_time -= ptr->time;
+ in_callout = 1;
+ ptr = Q;
+
+ while (ptr) {
+ if (!ptr->time) {
+ /* timeout has happened */
Q = Q->next;
- IF_DEBUG(DEBUG_TIMEOUT)
- log(LOG_DEBUG, 0, "about to call timeout %d (#%d)", ptr->id, i);
+
+ in_callout = 0;
if (ptr->func)
ptr->func(ptr->data);
+ in_callout = 1;
+
free(ptr);
+ ptr = Q;
}
- }
-}
-
-/*
- * Return in how many seconds age_callout_queue() would like to be called.
- * Return -1 if there are no events pending.
- */
-int
-timer_nextTimer()
-{
- if (Q) {
- if (Q->time < 0) {
- log(LOG_WARNING, 0, "timer_nextTimer top of queue says %d",
- Q->time);
- return 0;
+ else {
+ ptr->time --;
+#ifdef IGMP_DEBUG
+ log(LOG_DEBUG,0,"[callout, age_callout_queue] -- time (%d)", ptr->time);
+#endif /* IGMP_DEBUG */
+ in_callout = 0; return;
}
- return Q->time;
}
- return -1;
+ in_callout = 0;
+ return;
}
+
/*
* sets the timer
*/
@@ -106,15 +88,20 @@ int
timer_setTimer(delay, action, data)
int delay; /* number of units for timeout */
cfunc_t action; /* function to be called on timeout */
- void *data; /* what to call the timeout function with */
+ char *data; /* what to call the timeout function with */
{
struct timeout_q *ptr, *node, *prev;
- int i = 0;
+
+ if (in_callout)
+ return -1;
+
+ in_callout = 1;
/* create a node */
node = (struct timeout_q *)malloc(sizeof(struct timeout_q));
if (node == 0) {
log(LOG_WARNING, 0, "Malloc Failed in timer_settimer\n");
+ in_callout = 0;
return -1;
}
node->func = action;
@@ -144,8 +131,7 @@ timer_setTimer(delay, action, data)
prev->next = node;
ptr->time -= node->time;
print_Q();
- IF_DEBUG(DEBUG_TIMEOUT)
- log(LOG_DEBUG, 0, "created timeout %d (#%d)", node->id, i);
+ in_callout = 0;
return node->id;
} else {
/* keep moving */
@@ -154,46 +140,29 @@ timer_setTimer(delay, action, data)
prev = ptr;
ptr = ptr->next;
}
- i++;
}
prev->next = node;
}
print_Q();
- IF_DEBUG(DEBUG_TIMEOUT)
- log(LOG_DEBUG, 0, "created timeout %d (#%d)", node->id, i);
+ in_callout = 0;
return node->id;
}
-/* returns the time until the timer is scheduled */
-int
-timer_leftTimer(timer_id)
- int timer_id;
-{
- struct timeout_q *ptr;
- int left = 0;
-
- if (!timer_id)
- return -1;
-
- for (ptr = Q; ptr; ptr = ptr->next) {
- left += ptr->time;
- if (ptr->id == timer_id)
- return left;
- }
- return -1;
-}
-/* clears the associated timer. Returns 1 if succeeded. */
-int
+/* clears the associated timer */
+void
timer_clearTimer(timer_id)
int timer_id;
{
struct timeout_q *ptr, *prev;
- int i = 0;
+ if (in_callout)
+ return;
if (!timer_id)
- return 0;
+ return;
+ in_callout = 1;
+
prev = ptr = Q;
/*
@@ -216,22 +185,17 @@ timer_clearTimer(timer_id)
if (ptr->next != 0)
(ptr->next)->time += ptr->time;
- if (ptr->data)
- free(ptr->data);
- IF_DEBUG(DEBUG_TIMEOUT)
- log(LOG_DEBUG, 0, "deleted timer %d (#%d)", ptr->id, i);
+ free(ptr->data);
free(ptr);
print_Q();
- return 1;
+ in_callout = 0;
+ return;
}
prev = ptr;
ptr = ptr->next;
- i++;
}
- IF_DEBUG(DEBUG_TIMEOUT)
- log(LOG_DEBUG, 0, "failed to delete timer %d (#%d)", timer_id, i);
print_Q();
- return 0;
+ in_callout = 0;
}
#ifdef IGMP_DEBUG
@@ -243,8 +207,22 @@ print_Q()
{
struct timeout_q *ptr;
- IF_DEBUG(DEBUG_TIMEOUT)
- for (ptr = Q; ptr; ptr = ptr->next)
- log(LOG_DEBUG, 0, "(%d,%d) ", ptr->id, ptr->time);
+ for(ptr = Q; ptr; ptr = ptr->next)
+ log(LOG_DEBUG,0,"(%d,%d) ", ptr->id, ptr->time);
}
#endif /* IGMP_DEBUG */
+int
+secs_remaining( timer_id)
+ int timer_id;
+{
+ struct timeout_q *ptr;
+ int left=0;
+
+ for (ptr = Q; ptr && ptr->id != timer_id; ptr = ptr->next)
+ left += ptr->time;
+
+ if (!ptr) /* not found */
+ return 0;
+
+ return left + ptr->time;
+}
diff --git a/usr.sbin/mrouted/cfparse.y b/usr.sbin/mrouted/cfparse.y
index 14e206e4f6ff..e5a1dc9b9f5f 100644
--- a/usr.sbin/mrouted/cfparse.y
+++ b/usr.sbin/mrouted/cfparse.y
@@ -4,8 +4,7 @@
*
* Written by Bill Fenner, NRL, 1994
*
- * $Id: cfparse.y,v 1.8 1998/06/09 05:01:27 imp Exp $
- * cfparse.y,v 3.8.4.30 1998/03/01 01:48:58 fenner Exp
+ * $Id: cfparse.y,v 1.7 1997/02/22 16:06:48 peter Exp $
*/
#include <stdio.h>
#ifdef __STDC__
@@ -30,23 +29,19 @@ int yyparse __P((void));
static FILE *f;
+extern int udp_socket;
char *configfilename = _PATH_MROUTED_CONF;
extern int cache_lifetime;
-extern int prune_lifetime;
-
-/* imported from config.c, with slight memory leak */
-extern struct ifconf ifc;
-
-int allow_black_holes = 0;
+extern int max_prune_lifetime;
static int lineno;
+static struct ifreq ifbuf[32];
+static struct ifconf ifc;
static struct uvif *v;
-static int order, state;
-static int noflood = 0;
-static int rexmit = VIFF_REXMIT_PRUNES;
+static int order;
struct addrmask {
u_int32 addr;
@@ -71,17 +66,12 @@ int numbounds = 0; /* Number of named boundaries */
char *ptr;
struct addrmask addrmask;
u_int32 addr;
- struct vf_element *filterelem;
};
-%token CACHE_LIFETIME PRUNE_LIFETIME PRUNING BLACK_HOLE NOFLOOD
+%token CACHE_LIFETIME PRUNING
%token PHYINT TUNNEL NAME
-%token DISABLE IGMPV1 SRCRT BESIDE
+%token DISABLE IGMPV1 SRCRT
%token METRIC THRESHOLD RATE_LIMIT BOUNDARY NETMASK ALTNET ADVERT_METRIC
-%token FILTER ACCEPT DENY EXACT BIDIR REXMIT_PRUNES REXMIT_PRUNES2
-%token PASSIVE ALLOW_NONPRUNERS
-%token NOTRANSIT BLASTER FORCE_LEAF
-%token PRUNE_LIFETIME2 NOFLOOD2
%token SYSNAM SYSCONTACT SYSVERSION SYSLOCATION
%token <num> BOOLEAN
%token <num> NUMBER
@@ -91,7 +81,6 @@ int numbounds = 0; /* Number of named boundaries */
%type <addr> interface addrname
%type <addrmask> bound boundary addrmask
-%type <filterelem> filter filtlist filtelement filtelem
%start conf
@@ -109,8 +98,6 @@ stmt : error
vifi_t vifi;
- state++;
-
if (order)
fatal("phyints must appear before tunnels");
@@ -140,9 +127,12 @@ stmt : error
fatal("Tunnel local address %s is not mine",
inet_fmt($2, s1));
- if (((ntohl($2) & IN_CLASSA_NET) >> IN_CLASSA_NSHIFT) ==
- IN_LOOPBACKNET)
- fatal("Tunnel local address %s is a loopback address",
+ strncpy(ffr.ifr_name, ifr->ifr_name, IFNAMSIZ);
+ ffr.ifr_name[IFNAMSIZ-1]='\0';
+ if (ioctl(udp_socket, SIOCGIFFLAGS, (char *)&ffr)<0)
+ fatal("ioctl SIOCGIFFLAGS on %s",ffr.ifr_name);
+ if (ffr.ifr_flags & IFF_LOOPBACK)
+ fatal("Tunnel local address %s is a loopback interface",
inet_fmt($2, s1));
if (ifconfaddr(&ifc, $3) != 0)
@@ -158,26 +148,30 @@ stmt : error
inet_fmt($3, s1));
} else if (!(v->uv_flags & VIFF_DISABLED)) {
if (($3 & v->uv_subnetmask) == v->uv_subnet)
- fatal("Unnecessary tunnel to %s, same subnet as vif %d (%s)",
- inet_fmt($3,s1), vifi, v->uv_name);
+ fatal("Unnecessary tunnel to %s",
+ inet_fmt($3,s1));
}
if (numvifs == MAXVIFS)
fatal("too many vifs");
- strncpy(ffr.ifr_name, ifr->ifr_name, IFNAMSIZ);
- if (ioctl(udp_socket, SIOCGIFFLAGS, (char *)&ffr)<0)
- fatal("ioctl SIOCGIFFLAGS on %s", ffr.ifr_name);
-
v = &uvifs[numvifs];
- zero_vif(v, 1);
- v->uv_flags = VIFF_TUNNEL | rexmit | noflood;
- v->uv_flags |= VIFF_OTUNNEL; /*XXX*/
+ v->uv_flags = VIFF_TUNNEL;
+ v->uv_metric = DEFAULT_METRIC;
+ v->uv_admetric = 0;
+ v->uv_rate_limit= DEFAULT_TUN_RATE_LIMIT;
+ v->uv_threshold = DEFAULT_THRESHOLD;
v->uv_lcl_addr = $2;
v->uv_rmt_addr = $3;
- v->uv_dst_addr = $3;
+ v->uv_subnet = 0;
+ v->uv_subnetmask= 0;
+ v->uv_subnetbcast= 0;
strncpy(v->uv_name, ffr.ifr_name, IFNAMSIZ);
v->uv_name[IFNAMSIZ-1]='\0';
+ v->uv_groups = NULL;
+ v->uv_neighbors = NULL;
+ v->uv_acl = NULL;
+ v->uv_addrs = NULL;
if (!(ffr.ifr_flags & IFF_UP)) {
v->uv_flags |= VIFF_DOWN;
@@ -186,101 +180,17 @@ stmt : error
}
tunnelmods
{
+ log(LOG_INFO, 0,
+ "installing tunnel from %s to %s as vif #%u - rate=%d",
+ inet_fmt($2, s1), inet_fmt($3, s2),
+ numvifs, v->uv_rate_limit);
- if (!(v->uv_flags & VIFF_OTUNNEL)) {
- init_ipip_on_vif(v);
- }
-
- log(LOG_INFO, 0,
- "installing tunnel from %s to %s as vif #%u - rate=%d",
- inet_fmt($2, s1), inet_fmt($3, s2),
- numvifs, v->uv_rate_limit);
-
- ++numvifs;
-
+ ++numvifs;
}
- | CACHE_LIFETIME NUMBER {
-
- if ($2 < MIN_CACHE_LIFETIME) {
- warn("cache_lifetime %d must be at least %d",
- $2, MIN_CACHE_LIFETIME);
- } else {
- cache_lifetime = $2;
- }
-
- }
- | PRUNE_LIFETIME NUMBER {
-
- if ($2 < MIN_PRUNE_LIFETIME) {
- warn("prune_lifetime %d must be at least %d",
- $2, MIN_PRUNE_LIFETIME);
- } else {
- prune_lifetime = $2;
- }
-
- }
- | PRUNING BOOLEAN {
-
- if ($2 != 1) {
- warn("Disabling pruning is no longer supported");
- }
-
- }
- | BLACK_HOLE {
-#ifdef ALLOW_BLACK_HOLES
- allow_black_holes = 1;
-#endif
- }
- /*
- * Turn off initial flooding (until subordinateness is learned
- * via route exchange) on all phyints and set the default for
- * all further tunnels.
- */
- | NOFLOOD {
-
- vifi_t vifi;
-
- noflood = VIFF_NOFLOOD;
- for (vifi = 0, v = uvifs;
- vifi < numvifs;
- ++vifi, ++v)
- v->uv_flags |= VIFF_NOFLOOD;
-
+ | PRUNING BOOLEAN { pruning = $2; }
+ | CACHE_LIFETIME NUMBER { cache_lifetime = $2;
+ max_prune_lifetime = cache_lifetime * 2;
}
- /*
- * Turn on prune retransmission on all interfaces.
- * Tunnels default to retransmitting, so this just
- * needs to turn on phyints.
- */
- | REXMIT_PRUNES {
-
- vifi_t vifi;
-
- for (vifi = 0, v = uvifs;
- vifi < numvifs;
- ++vifi, ++v)
- v->uv_flags |= VIFF_REXMIT_PRUNES;
-
- }
- /*
- * If true, do as above. If false, no need to turn
- * it off for phyints since they default to not
- * rexmit; need to set flag to not rexmit on tunnels.
- */
- | REXMIT_PRUNES BOOLEAN {
-
- if ($2) {
- vifi_t vifi;
-
- for (vifi = 0, v = uvifs;
- vifi < numvifs;
- ++vifi, ++v)
- v->uv_flags |= VIFF_REXMIT_PRUNES;
- } else {
- rexmit = 0;
- }
-
- }
| NAME STRING boundary { if (numbounds >= MAXBOUNDS) {
fatal("Too many named boundaries (max %d)", MAXBOUNDS);
}
@@ -316,16 +226,6 @@ tunnelmods : /* empty */
;
tunnelmod : mod
- | BESIDE { v->uv_flags |= VIFF_OTUNNEL; }
- | BESIDE BOOLEAN {
-
- if ($2) {
- v->uv_flags |= VIFF_OTUNNEL;
- } else {
- v->uv_flags &= ~VIFF_OTUNNEL;
- }
-
- }
| SRCRT { fatal("Source-route tunnels not supported"); }
;
@@ -377,20 +277,6 @@ ifmod : mod
warn("Expected address after altnet keyword, ignored");
}
- | FORCE_LEAF {
-
- v->uv_flags |= VIFF_FORCE_LEAF;
-
- }
- | FORCE_LEAF BOOLEAN {
-
- if ($2) {
- v->uv_flags |= VIFF_FORCE_LEAF;
- } else {
- v->uv_flags &= ~VIFF_FORCE_LEAF;
- }
-
- }
;
mod : THRESHOLD NUMBER { if ($2 < 1 || $2 > 255)
@@ -450,122 +336,6 @@ mod : THRESHOLD NUMBER { if ($2 < 1 || $2 > 255)
warn("Expected boundary spec after boundary keyword, ignored");
}
- | REXMIT_PRUNES2 {
-
- v->uv_flags |= VIFF_REXMIT_PRUNES;
-
- }
- | REXMIT_PRUNES2 BOOLEAN {
-
- if ($2) {
- v->uv_flags |= VIFF_REXMIT_PRUNES;
- } else {
- v->uv_flags &= ~VIFF_REXMIT_PRUNES;
- }
-
- }
- | PASSIVE {
-
- v->uv_flags |= VIFF_PASSIVE;
-
- }
- | NOFLOOD2 {
-
- v->uv_flags |= VIFF_NOFLOOD;
-
- }
- | NOTRANSIT {
-
- v->uv_flags |= VIFF_NOTRANSIT;
-
- }
- | BLASTER {
-
- v->uv_flags |= VIFF_BLASTER;
- blaster_alloc(v - uvifs);
-
- }
- | ALLOW_NONPRUNERS {
-
- v->uv_flags |= VIFF_ALLOW_NONPRUNERS;
-
- }
- | PRUNE_LIFETIME2 NUMBER {
-
- if ($2 < MIN_PRUNE_LIFETIME) {
- warn("prune_lifetime %d must be at least %d",
- $2, MIN_PRUNE_LIFETIME);
- } else {
- v->uv_prune_lifetime = $2;
- }
-
- }
- | ACCEPT filter {
-
- if (v->uv_filter == NULL) {
- struct vif_filter *v_filter;
-
- v_filter = (struct vif_filter *)malloc(sizeof(struct vif_filter));
- if (v_filter == NULL)
- fatal("out of memory");
- v_filter->vf_flags = 0;
- v_filter->vf_type = VFT_ACCEPT;
- v_filter->vf_filter = $2;
- v->uv_filter = v_filter;
- } else if (v->uv_filter->vf_type != VFT_ACCEPT) {
- fatal("can't accept and deny");
- } else {
- struct vf_element *p;
-
- p = v->uv_filter->vf_filter;
- while (p->vfe_next)
- p = p->vfe_next;
- p->vfe_next = $2;
- }
-
- }
- | ACCEPT {
-
- warn("Expected filter spec after accept keyword, ignored");
-
- }
- | DENY filter {
-
- if (v->uv_filter == NULL) {
- struct vif_filter *v_filter;
-
- v_filter = (struct vif_filter *)malloc(sizeof(struct vif_filter));
- if (v_filter == NULL)
- fatal("out of memory");
- v_filter->vf_flags = 0;
- v_filter->vf_type = VFT_DENY;
- v_filter->vf_filter = $2;
- v->uv_filter = v_filter;
- } else if (v->uv_filter->vf_type != VFT_DENY) {
- fatal("can't accept and deny");
- } else {
- struct vf_element *p;
-
- p = v->uv_filter->vf_filter;
- while (p->vfe_next)
- p = p->vfe_next;
- p->vfe_next = $2;
- }
-
- }
- | DENY {
-
- warn("Expected filter spec after deny keyword, ignored");
-
- }
- | BIDIR {
-
- if (v->uv_filter == NULL) {
- fatal("bidir goes after filters");
- }
- v->uv_filter->vf_flags |= VFF_BIDIR;
-
- }
;
interface : ADDR { $$ = $1; }
@@ -608,9 +378,6 @@ bound : boundary { $$ = $1; }
boundary : ADDRMASK {
-#ifdef ALLOW_BLACK_HOLES
- if (!allow_black_holes)
-#endif
if ((ntohl($1.addr) & 0xff000000) != 0xef000000) {
fatal("Boundaries must be 239.x.x.x, not %s/%d",
inet_fmt($1.addr, s1), $1.mask);
@@ -623,35 +390,6 @@ boundary : ADDRMASK {
addrmask : ADDRMASK { $$ = $1; }
| ADDR { $$.addr = $1; $$.mask = 0; }
;
-
-filter : filtlist { $$ = $1; }
- | STRING { fatal("named filters no implemented yet"); }
- ;
-
-filtlist : filtelement { $$ = $1; }
- | filtelement filtlist { $1->vfe_next = $2; $$ = $1; }
- ;
-
-filtelement : filtelem { $$ = $1; }
- | filtelem EXACT { $1->vfe_flags |= VFEF_EXACT; $$ = $1; }
- ;
-
-filtelem : ADDRMASK {
-
- struct vf_element *vfe;
-
- vfe = (struct vf_element *)malloc(sizeof(struct vf_element));
- if (vfe == NULL)
- fatal("out of memory");
-
- vfe->vfe_addr = $1.addr;
- VAL_TO_MASK(vfe->vfe_mask, $1.mask);
- vfe->vfe_flags = 0;
- vfe->vfe_next = NULL;
-
- $$ = vfe;
-
- }
%%
#ifdef __STDC__
static void
@@ -717,6 +455,7 @@ next_word()
{
static char buf[1024];
static char *p=NULL;
+ extern FILE *f;
char *q;
while (1) {
@@ -755,75 +494,47 @@ next_word()
}
}
-/*
- * List of keywords. Must have an empty record at the end to terminate
- * list. If a second value is specified, the first is used at the beginning
- * of the file and the second is used while parsing interfaces (e.g. after
- * the first "phyint" or "tunnel" keyword).
- */
-static struct keyword {
- char *word;
- int val1;
- int val2;
-} words[] = {
- { "cache_lifetime", CACHE_LIFETIME },
- { "prune_lifetime", PRUNE_LIFETIME, PRUNE_LIFETIME2 },
- { "pruning", PRUNING },
- { "phyint", PHYINT },
- { "tunnel", TUNNEL },
- { "disable", DISABLE },
- { "metric", METRIC },
- { "advert_metric", ADVERT_METRIC },
- { "threshold", THRESHOLD },
- { "rate_limit", RATE_LIMIT },
- { "force_leaf", FORCE_LEAF },
- { "srcrt", SRCRT },
- { "sourceroute", SRCRT },
- { "boundary", BOUNDARY },
- { "netmask", NETMASK },
- { "igmpv1", IGMPV1 },
- { "altnet", ALTNET },
- { "name", NAME },
- { "accept", ACCEPT },
- { "deny", DENY },
- { "exact", EXACT },
- { "bidir", BIDIR },
- { "allow_nonpruners", ALLOW_NONPRUNERS },
-#ifdef ALLOW_BLACK_HOLES
- { "allow_black_holes", BLACK_HOLE },
-#endif
- { "noflood", NOFLOOD, NOFLOOD2},
- { "notransit", NOTRANSIT },
- { "blaster", BLASTER },
- { "rexmit_prunes", REXMIT_PRUNES, REXMIT_PRUNES2 },
- { "passive", PASSIVE },
- { "beside", BESIDE },
-#ifdef SNMP
- { "sysName", SYSNAM },
- { "sysContact", SYSCONTACT },
- { "sysVersion", SYSVERSION },
- { "sysLocation", SYSLOCATION },
-#endif
- { NULL, 0 }
-};
-
-
static int
yylex()
{
int n;
u_int32 addr;
char *q;
- struct keyword *w;
if ((q = next_word()) == NULL) {
return 0;
}
- for (w = words; w->word; w++)
- if (!strcmp(q, w->word))
- return (state && w->val2) ? w->val2 : w->val1;
-
+ if (!strcmp(q,"cache_lifetime"))
+ return CACHE_LIFETIME;
+ if (!strcmp(q,"pruning"))
+ return PRUNING;
+ if (!strcmp(q,"phyint"))
+ return PHYINT;
+ if (!strcmp(q,"tunnel"))
+ return TUNNEL;
+ if (!strcmp(q,"disable"))
+ return DISABLE;
+ if (!strcmp(q,"metric"))
+ return METRIC;
+ if (!strcmp(q,"advert_metric"))
+ return ADVERT_METRIC;
+ if (!strcmp(q,"threshold"))
+ return THRESHOLD;
+ if (!strcmp(q,"rate_limit"))
+ return RATE_LIMIT;
+ if (!strcmp(q,"srcrt") || !strcmp(q,"sourceroute"))
+ return SRCRT;
+ if (!strcmp(q,"boundary"))
+ return BOUNDARY;
+ if (!strcmp(q,"netmask"))
+ return NETMASK;
+ if (!strcmp(q,"igmpv1"))
+ return IGMPV1;
+ if (!strcmp(q,"altnet"))
+ return ALTNET;
+ if (!strcmp(q,"name"))
+ return NAME;
if (!strcmp(q,"on") || !strcmp(q,"yes")) {
yylval.num = 1;
return BOOLEAN;
@@ -861,6 +572,14 @@ yylex()
return NUMBER;
}
#ifdef SNMP
+ if (!strcmp(q,"sysName"))
+ return SYSNAM;
+ if (!strcmp(q,"sysContact"))
+ return SYSCONTACT;
+ if (!strcmp(q,"sysVersion"))
+ return SYSVERSION;
+ if (!strcmp(q,"sysLocation"))
+ return SYSLOCATION;
if (*q=='"') {
if (q[ strlen(q)-1 ]=='"')
q[ strlen(q)-1 ]='\0'; /* trash trailing quote */
@@ -875,8 +594,9 @@ yylex()
void
config_vifs_from_file()
{
+ extern FILE *f;
+
order = 0;
- state = 0;
numbounds = 0;
lineno = 0;
@@ -886,6 +606,11 @@ config_vifs_from_file()
return;
}
+ ifc.ifc_buf = (char *)ifbuf;
+ ifc.ifc_len = sizeof(ifbuf);
+ if (ioctl(udp_socket, SIOCGIFCONF, (char *)&ifc) < 0)
+ log(LOG_ERR, errno, "ioctl SIOCGIFCONF");
+
yyparse();
fclose(f);
@@ -918,7 +643,7 @@ ifconfaddr(ifcp, a)
if (ifrp->ifr_addr.sa_family == AF_INET &&
((struct sockaddr_in *)&ifrp->ifr_addr)->sin_addr.s_addr == a)
return (ifrp);
-#ifdef HAVE_SA_LEN
+#if (defined(BSD) && (BSD >= 199006))
n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name);
if (n < sizeof(*ifrp))
++ifrp;
diff --git a/usr.sbin/mrouted/config.c b/usr.sbin/mrouted/config.c
index 544199e40e23..61f43eba6361 100644
--- a/usr.sbin/mrouted/config.c
+++ b/usr.sbin/mrouted/config.c
@@ -5,21 +5,15 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * config.c,v 3.8.4.10 1998/01/06 01:57:41 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: config.c,v 1.12 1998/06/09 05:01:29 imp Exp $";
+ "$Id: config.c,v 1.11 1998/01/16 07:17:41 charnier Exp $";
#endif /* not lint */
#include "defs.h"
-
-struct ifconf ifc;
-
/*
* Query the kernel to find network interfaces that are multicast-capable
* and install them in the uvifs array.
@@ -27,48 +21,28 @@ struct ifconf ifc;
void
config_vifs_from_kernel()
{
+ struct ifreq ifbuf[32];
struct ifreq *ifrp, *ifend;
+ struct ifconf ifc;
register struct uvif *v;
register vifi_t vifi;
int n;
u_int32 addr, mask, subnet;
short flags;
- int num_ifreq = 32;
-
- ifc.ifc_len = num_ifreq * sizeof(struct ifreq);
- ifc.ifc_buf = malloc(ifc.ifc_len);
- while (ifc.ifc_buf) {
- if (ioctl(udp_socket, SIOCGIFCONF, (char *)&ifc) < 0)
- log(LOG_ERR, errno, "ioctl SIOCGIFCONF");
-
- /*
- * If the buffer was large enough to hold all the addresses
- * then break out, otherwise increase the buffer size and
- * try again.
- *
- * The only way to know that we definitely had enough space
- * is to know that there was enough space for at least one
- * more struct ifreq. ???
- */
- if ((num_ifreq * sizeof(struct ifreq)) >=
- ifc.ifc_len + sizeof(struct ifreq))
- break;
- num_ifreq *= 2;
- ifc.ifc_len = num_ifreq * sizeof(struct ifreq);
- ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len);
- }
- if (ifc.ifc_buf == NULL)
- log(LOG_ERR, 0, "config_vifs_from_kernel: ran out of memory");
+ ifc.ifc_buf = (char *)ifbuf;
+ ifc.ifc_len = sizeof(ifbuf);
+ if (ioctl(udp_socket, SIOCGIFCONF, (char *)&ifc) < 0)
+ log(LOG_ERR, errno, "ioctl SIOCGIFCONF");
- ifrp = (struct ifreq *)ifc.ifc_buf;
- ifend = (struct ifreq *)(ifc.ifc_buf + ifc.ifc_len);
+ ifrp = (struct ifreq *)ifbuf;
+ ifend = (struct ifreq *)((char *)ifbuf + ifc.ifc_len);
/*
* Loop through all of the interfaces.
*/
for (; ifrp < ifend; ifrp = (struct ifreq *)((char *)ifrp + n)) {
struct ifreq ifr;
-#ifdef HAVE_SA_LEN
+#if BSD >= 199006
n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name);
if (n < sizeof(*ifrp))
n = sizeof(*ifrp);
@@ -123,12 +97,6 @@ config_vifs_from_kernel()
* one already installed in the uvifs array.
*/
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
- if (strcmp(v->uv_name, ifr.ifr_name) == 0) {
- log(LOG_DEBUG, 0, "skipping %s (%s on subnet %s) (alias for vif#%u?)",
- v->uv_name, inet_fmt(addr, s1),
- inet_fmts(subnet, mask, s2), vifi);
- break;
- }
if ((addr & v->uv_subnetmask) == v->uv_subnet ||
(v->uv_subnet & mask) == subnet) {
log(LOG_WARNING, 0, "ignoring %s, same subnet as %s",
@@ -146,16 +114,22 @@ config_vifs_from_kernel()
continue;
}
v = &uvifs[numvifs];
- zero_vif(v, 0);
+ v->uv_flags = 0;
+ v->uv_metric = DEFAULT_METRIC;
+ v->uv_admetric = 0;
+ v->uv_rate_limit = DEFAULT_PHY_RATE_LIMIT;
+ v->uv_threshold = DEFAULT_THRESHOLD;
v->uv_lcl_addr = addr;
+ v->uv_rmt_addr = 0;
v->uv_subnet = subnet;
v->uv_subnetmask = mask;
v->uv_subnetbcast = subnet | ~mask;
strncpy(v->uv_name, ifr.ifr_name, IFNAMSIZ);
v->uv_name[IFNAMSIZ-1] = '\0';
-
- if (flags & IFF_POINTOPOINT)
- v->uv_flags |= VIFF_REXMIT_PRUNES;
+ v->uv_groups = NULL;
+ v->uv_neighbors = NULL;
+ v->uv_acl = NULL;
+ v->uv_addrs = NULL;
log(LOG_INFO,0,"installing %s (%s on subnet %s) as vif #%u - rate=%d",
v->uv_name, inet_fmt(addr, s1), inet_fmts(subnet, mask, s2),
diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h
index 00a8b5ba8eeb..6d11925594c6 100644
--- a/usr.sbin/mrouted/defs.h
+++ b/usr.sbin/mrouted/defs.h
@@ -7,8 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: defs.h,v 1.10 1997/02/22 16:06:51 peter Exp $
- * defs.h,v 3.8.4.15 1998/03/01 02:51:42 fenner Exp
+ * $Id$
*/
@@ -27,11 +26,7 @@
#ifdef SYSV
#include <sys/sockio.h>
#endif
-#ifdef _AIX
-#include <time.h>
-#endif
#include <sys/time.h>
-#include <sys/uio.h>
#include <net/if.h>
#define rtentry kern_rtentry /* XXX !!! UGH */
#include <net/route.h>
@@ -39,16 +34,7 @@
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
#include <netinet/igmp.h>
-#ifdef __FreeBSD__ /* sigh */
-#include <osreldate.h>
-#if __FreeBSD_version >= 220000
-#define rtentry kernel_rtentry
-#include <net/route.h>
-#undef rtentry
-#endif
-#endif
#include <netinet/ip_mroute.h>
#ifdef RSRR
#include <sys/un.h>
@@ -69,7 +55,6 @@ typedef void (*cfunc_t) __P((void *));
typedef void (*ihfunc_t) __P((int, fd_set *));
#include "dvmrp.h"
-#include "igmpv2.h"
#include "vif.h"
#include "route.h"
#include "prune.h"
@@ -89,17 +74,21 @@ typedef void (*ihfunc_t) __P((int, fd_set *));
#define TIMER_INTERVAL ROUTE_MAX_REPORT_DELAY
+#define VENDOR_CODE 1 /* Get a new vendor code if you make significant
+ * changes to mrouted. */
+
#define PROTOCOL_VERSION 3 /* increment when packet format/content changes */
-#define MROUTED_VERSION 9 /* not in DVMRP packets at all */
-#define DVMRP_CONSTANT 0x000eff00 /* constant portion of 'group' field */
+#define MROUTED_VERSION 8 /* increment on local changes or bug fixes, */
+ /* reset to 0 whever PROTOCOL_VERSION increments */
-#define MROUTED_LEVEL (DVMRP_CONSTANT | PROTOCOL_VERSION)
+#define MROUTED_LEVEL ((MROUTED_VERSION << 8) | PROTOCOL_VERSION | \
+ ((NF_PRUNE | NF_GENID | NF_MTRACE) << 16) | \
+ (VENDOR_CODE << 24))
/* for IGMP 'group' field of DVMRP messages */
#define LEAF_FLAGS (( vifs_with_neighbors == 1 ) ? 0x010000 : 0)
/* more for IGMP 'group' field of DVMRP messages */
-
#define DEL_RTE_GROUP 0
#define DEL_ALL_ROUTES 1
/* for Deleting kernel table entries */
@@ -123,10 +112,7 @@ typedef void (*ihfunc_t) __P((int, fd_set *));
#define bcopy(a, b, c) memcpy(b, a, c)
#define bzero(s, n) memset((s), 0, (n))
#define setlinebuf(s) setvbuf(s, NULL, _IOLBF, 0)
-#endif
-
-#if defined(_AIX) || (defined(BSD) && (BSD >= 199103))
-#define HAVE_SA_LEN
+#define signal(s,f) sigset(s,f)
#endif
/*
@@ -144,27 +130,10 @@ extern u_int32 allrtrs_group;
extern u_int32 dvmrp_group;
extern u_int32 dvmrp_genid;
-#define IF_DEBUG(l) if (debug && debug & (l))
-
-#define DEBUG_PKT 0x0001
-#define DEBUG_PRUNE 0x0002
-#define DEBUG_ROUTE 0x0004
-#define DEBUG_PEER 0x0008
-#define DEBUG_CACHE 0x0010
-#define DEBUG_TIMEOUT 0x0020
-#define DEBUG_IF 0x0040
-#define DEBUG_MEMBER 0x0080
-#define DEBUG_TRACE 0x0100
-#define DEBUG_IGMP 0x0200
-#define DEBUG_RTDETAIL 0x0400
-#define DEBUG_KERN 0x0800
-#define DEBUG_RSRR 0x1000
-#define DEBUG_ICMP 0x2000
-
-#define DEFAULT_DEBUG 0x02de /* default if "-d" given without value */
+#define DEFAULT_DEBUG 2 /* default if "-d" given without value */
extern int debug;
-extern int did_final_init;
+extern u_char pruning;
extern int routes_changed;
extern int delay_change_reports;
@@ -199,129 +168,86 @@ extern char * sys_errlist[];
#ifndef IGMP_PIM
#define IGMP_PIM 0x14
#endif
-#ifndef IPPROTO_IPIP
-#define IPPROTO_IPIP 4
-#endif
-/*
- * The original multicast releases defined
- * IGMP_HOST_{MEMBERSHIP_QUERY,MEMBERSHIP_REPORT,NEW_MEMBERSHIP_REPORT
- * ,LEAVE_MESSAGE}. Later releases removed the HOST and inserted
- * the IGMP version number. NetBSD inserted the version number in
- * a different way. mrouted uses the new names, so we #define them
- * to the old ones if needed.
- */
-#if !defined(IGMP_MEMBERSHIP_QUERY) && defined(IGMP_HOST_MEMBERSHIP_QUERY)
+#ifndef IGMP_MEMBERSHIP_QUERY
#define IGMP_MEMBERSHIP_QUERY IGMP_HOST_MEMBERSHIP_QUERY
-#define IGMP_V2_LEAVE_GROUP IGMP_HOST_LEAVE_MESSAGE
-#endif
-#ifndef IGMP_V1_MEMBERSHIP_REPORT
-#ifdef IGMP_HOST_MEMBERSHIP_REPORT
#define IGMP_V1_MEMBERSHIP_REPORT IGMP_HOST_MEMBERSHIP_REPORT
#define IGMP_V2_MEMBERSHIP_REPORT IGMP_HOST_NEW_MEMBERSHIP_REPORT
-#endif
-#ifdef IGMP_v1_HOST_MEMBERSHIP_REPORT
-#define IGMP_V1_MEMBERSHIP_REPORT IGMP_v1_HOST_MEMBERSHIP_REPORT
-#define IGMP_V2_MEMBERSHIP_REPORT IGMP_v2_HOST_MEMBERSHIP_REPORT
-#endif
+#define IGMP_V2_LEAVE_GROUP IGMP_HOST_LEAVE_MESSAGE
#endif
-/*
- * NetBSD also renamed the mtrace types.
- */
-#if !defined(IGMP_MTRACE_RESP) && defined(IGMP_MTRACE_REPLY)
-#define IGMP_MTRACE_RESP IGMP_MTRACE_REPLY
-#define IGMP_MTRACE IGMP_MTRACE_QUERY
-#endif
/* main.c */
-extern char * scaletime __P((u_long));
extern void log __P((int, int, char *, ...));
-extern int register_input_handler __P((int, ihfunc_t));
+extern int register_input_handler __P((int fd, ihfunc_t func));
/* igmp.c */
extern void init_igmp __P((void));
-extern void accept_igmp __P((int));
-extern void build_igmp __P((u_int32, u_int32, int, int, u_int32,
- int));
-extern void send_igmp __P((u_int32, u_int32, int, int, u_int32,
- int));
-extern char * igmp_packet_kind __P((u_int, u_int));
-extern int igmp_debug_kind __P((u_int, u_int));
-
-/* icmp.c */
-extern void init_icmp __P((void));
-
-/* ipip.c */
-extern void init_ipip __P((void));
-extern void init_ipip_on_vif __P((struct uvif *));
-extern void send_ipip __P((u_int32, u_int32, int, int, u_int32,
- int, struct uvif *));
+extern void accept_igmp __P((int recvlen));
+extern void send_igmp __P((u_int32 src, u_int32 dst, int type,
+ int code, u_int32 group,
+ int datalen));
/* callout.c */
extern void callout_init __P((void));
-extern void free_all_callouts __P((void));
-extern void age_callout_queue __P((int));
-extern int timer_nextTimer __P((void));
-extern int timer_setTimer __P((int, cfunc_t, void *));
-extern int timer_clearTimer __P((int));
-extern int timer_leftTimer __P((int));
+extern void age_callout_queue __P((void));
+extern int timer_setTimer __P((int delay, cfunc_t action,
+ char *data));
+extern void timer_clearTimer __P((int timer_id));
/* route.c */
extern void init_routes __P((void));
extern void start_route_updates __P((void));
-extern void update_route __P((u_int32, u_int32, u_int, u_int32,
- vifi_t, struct listaddr *));
+extern void update_route __P((u_int32 origin, u_int32 mask,
+ u_int metric, u_int32 src,
+ vifi_t vifi));
extern void age_routes __P((void));
extern void expire_all_routes __P((void));
extern void free_all_routes __P((void));
-extern void accept_probe __P((u_int32, u_int32, char *, int,
- u_int32));
-extern void accept_report __P((u_int32, u_int32, char *, int,
- u_int32));
+extern void accept_probe __P((u_int32 src, u_int32 dst,
+ char *p, int datalen,
+ u_int32 level));
+extern void accept_report __P((u_int32 src, u_int32 dst,
+ char *p, int datalen,
+ u_int32 level));
extern struct rtentry * determine_route __P((u_int32 src));
-extern void report __P((int, vifi_t, u_int32));
-extern void report_to_all_neighbors __P((int));
+extern void report __P((int which_routes, vifi_t vifi,
+ u_int32 dst));
+extern void report_to_all_neighbors __P((int which_routes));
extern int report_next_chunk __P((void));
-extern void blaster_alloc __P((vifi_t));
-extern void add_vif_to_routes __P((vifi_t));
-extern void delete_vif_from_routes __P((vifi_t));
-extern void add_neighbor_to_routes __P((vifi_t, int));
-extern void delete_neighbor_from_routes __P((u_int32,
- vifi_t, int));
+extern void add_vif_to_routes __P((vifi_t vifi));
+extern void delete_vif_from_routes __P((vifi_t vifi));
+extern void delete_neighbor_from_routes __P((u_int32 addr,
+ vifi_t vifi));
extern void dump_routes __P((FILE *fp));
+extern void start_route_updates __P((void));
/* vif.c */
extern void init_vifs __P((void));
-extern void zero_vif __P((struct uvif *, int));
-extern void init_installvifs __P((void));
extern void check_vif_state __P((void));
-extern void send_on_vif __P((struct uvif *, u_int32, int, int));
-extern vifi_t find_vif __P((u_int32, u_int32));
+extern vifi_t find_vif __P((u_int32 src, u_int32 dst));
extern void age_vifs __P((void));
-extern void dump_vifs __P((FILE *));
+extern void dump_vifs __P((FILE *fp));
extern void stop_all_vifs __P((void));
-extern struct listaddr *neighbor_info __P((vifi_t, u_int32));
-extern void accept_group_report __P((u_int32, u_int32,
- u_int32, int));
+extern struct listaddr *neighbor_info __P((vifi_t vifi, u_int32 addr));
+extern void accept_group_report __P((u_int32 src, u_int32 dst,
+ u_int32 group, int r_type));
extern void query_groups __P((void));
extern void probe_for_neighbors __P((void));
-extern struct listaddr *update_neighbor __P((vifi_t, u_int32, int, char *, int,
- u_int32));
-extern void accept_neighbor_request __P((u_int32, u_int32));
-extern void accept_neighbor_request2 __P((u_int32, u_int32));
-extern void accept_info_request __P((u_int32, u_int32,
- u_char *, int));
-extern void accept_info_reply __P((u_int32, u_int32,
- u_char *, int));
-extern void accept_neighbors __P((u_int32, u_int32,
- u_char *, int, u_int32));
-extern void accept_neighbors2 __P((u_int32, u_int32,
- u_char *, int, u_int32));
-extern void accept_leave_message __P((u_int32, u_int32,
- u_int32));
-extern void accept_membership_query __P((u_int32, u_int32,
- u_int32, int));
+extern int update_neighbor __P((vifi_t vifi, u_int32 addr,
+ int msgtype, char *p, int datalen,
+ u_int32 level));
+extern void accept_neighbor_request __P((u_int32 src, u_int32 dst));
+extern void accept_neighbor_request2 __P((u_int32 src,
+ u_int32 dst));
+extern void accept_neighbors __P((u_int32 src, u_int32 dst,
+ u_char *p, int datalen, u_int32 level));
+extern void accept_neighbors2 __P((u_int32 src, u_int32 dst,
+ u_char *p, int datalen, u_int32 level));
+extern void accept_leave_message __P((u_int32 src, u_int32 dst,
+ u_int32 group));
+extern void accept_membership_query __P((u_int32 src, u_int32 dst,
+ u_int32 group, int tmo));
/* config.c */
extern void config_vifs_from_kernel __P((void));
@@ -330,84 +256,75 @@ extern void config_vifs_from_kernel __P((void));
extern void config_vifs_from_file __P((void));
/* inet.c */
-extern int inet_valid_host __P((u_int32));
-extern int inet_valid_mask __P((u_int32));
-extern int inet_valid_subnet __P((u_int32, u_int32));
-extern char * inet_fmt __P((u_int32, char *));
-extern char * inet_fmts __P((u_int32, u_int32, char *));
-extern u_int32 inet_parse __P((char *, int));
-extern int inet_cksum __P((u_short *, u_int));
+extern int inet_valid_host __P((u_int32 naddr));
+extern int inet_valid_subnet __P((u_int32 nsubnet, u_int32 nmask));
+extern char * inet_fmt __P((u_int32 addr, char *s));
+extern char * inet_fmts __P((u_int32 addr, u_int32 mask, char *s));
+extern u_int32 inet_parse __P((char *s, int n));
+extern int inet_cksum __P((u_short *addr, u_int len));
/* prune.c */
extern unsigned kroutes;
-extern void determine_forwvifs __P((struct gtable *));
-extern void send_prune_or_graft __P((struct gtable *));
-extern void add_table_entry __P((u_int32, u_int32));
-extern void del_table_entry __P((struct rtentry *,
- u_int32, u_int));
-extern void update_table_entry __P((struct rtentry *, u_int32));
-extern int find_src_grp __P((u_int32, u_int32, u_int32));
+extern void add_table_entry __P((u_int32 origin, u_int32 mcastgrp));
+extern void del_table_entry __P((struct rtentry *r,
+ u_int32 mcastgrp, u_int del_flag));
+extern void update_table_entry __P((struct rtentry *r));
extern void init_ktable __P((void));
-extern void steal_sources __P((struct rtentry *));
-extern void reset_neighbor_state __P((vifi_t, u_int32));
-extern int grplst_mem __P((vifi_t, u_int32));
+extern void accept_prune __P((u_int32 src, u_int32 dst, char *p,
+ int datalen));
+extern void steal_sources __P((struct rtentry *rt));
+extern void reset_neighbor_state __P((vifi_t vifi, u_int32 addr));
+extern int grplst_mem __P((vifi_t vifi, u_int32 mcastgrp));
+extern int scoped_addr __P((vifi_t vifi, u_int32 addr));
extern void free_all_prunes __P((void));
extern void age_table_entry __P((void));
-extern void dump_cache __P((FILE *));
-extern void update_lclgrp __P((vifi_t, u_int32));
-extern void delete_lclgrp __P((vifi_t, u_int32));
-extern void chkgrp_graft __P((vifi_t, u_int32));
-extern void accept_prune __P((u_int32, u_int32, char *, int));
-extern void accept_graft __P((u_int32, u_int32, char *, int));
-extern void accept_g_ack __P((u_int32, u_int32, char *, int));
+extern void dump_cache __P((FILE *fp2));
+extern void update_lclgrp __P((vifi_t vifi, u_int32 mcastgrp));
+extern void delete_lclgrp __P((vifi_t vifi, u_int32 mcastgrp));
+extern void chkgrp_graft __P((vifi_t vifi, u_int32 mcastgrp));
+extern void accept_graft __P((u_int32 src, u_int32 dst, char *p,
+ int datalen));
+extern void accept_g_ack __P((u_int32 src, u_int32 dst, char *p,
+ int datalen));
/* u_int is promoted u_char */
-extern void accept_mtrace __P((u_int32, u_int32,
- u_int32, char *, u_int, int));
+extern void accept_mtrace __P((u_int32 src, u_int32 dst,
+ u_int32 group, char *data, u_int no,
+ int datalen));
/* kern.c */
-extern void k_set_rcvbuf __P((int, int));
-extern void k_hdr_include __P((int));
-extern void k_set_ttl __P((int));
-extern void k_set_loop __P((int));
-extern void k_set_if __P((u_int32));
-extern void k_join __P((u_int32, u_int32));
-extern void k_leave __P((u_int32, u_int32));
+extern void k_set_rcvbuf __P((int bufsize));
+extern void k_hdr_include __P((int bool));
+extern void k_set_ttl __P((int t));
+extern void k_set_loop __P((int l));
+extern void k_set_if __P((u_int32 ifa));
+extern void k_join __P((u_int32 grp, u_int32 ifa));
+extern void k_leave __P((u_int32 grp, u_int32 ifa));
extern void k_init_dvmrp __P((void));
extern void k_stop_dvmrp __P((void));
-extern void k_add_vif __P((vifi_t, struct uvif *));
-extern void k_del_vif __P((vifi_t));
-extern void k_add_rg __P((u_int32, struct gtable *));
-extern int k_del_rg __P((u_int32, struct gtable *));
+extern void k_add_vif __P((vifi_t vifi, struct uvif *v));
+extern void k_del_vif __P((vifi_t vifi));
+extern void k_add_rg __P((u_int32 origin, struct gtable *g));
+extern int k_del_rg __P((u_int32 origin, struct gtable *g));
extern int k_get_version __P((void));
#ifdef SNMP
/* prune.c */
-extern struct gtable * find_grp __P((u_int32));
-extern struct stable * find_grp_src __P((struct gtable *, u_int32));
-extern int next_grp_src_mask __P((struct gtable **,
- struct stable **, u_int32,
- u_int32, u_int32));
-extern void refresh_sg __P((struct sioc_sg_req *, struct gtable *,
- struct stable *));
-extern int next_child __P((struct gtable **, struct stable **,
- u_int32, u_int32, u_int32,
- vifi_t *));
-
-/* route.c */
-extern struct rtentry * snmp_find_route __P((u_int32, u_int32));
-extern int next_route __P((struct rtentry **, u_int32, u_int32));
-extern int next_route_child __P((struct rtentry **,
- u_int32, u_int32, vifi_t *));
+extern struct rtentry * snmp_find_route __P(());
+extern struct gtable * find_grp __P(());
+extern struct stable * find_grp_src __P(());
#endif
#ifdef RSRR
/* prune.c */
extern struct gtable *kernel_table;
extern struct gtable *gtp;
+extern int find_src_grp __P((u_int32 src, u_int32 mask,
+ u_int32 grp));
/* rsrr.c */
extern void rsrr_init __P((void));
+extern void rsrr_read __P((int f, fd_set *rfd));
extern void rsrr_clean __P((void));
-extern void rsrr_cache_send __P((struct gtable *, int));
-extern void rsrr_cache_clean __P((struct gtable *));
+extern void rsrr_cache_send __P((struct gtable *gt, int notify));
+extern void rsrr_cache_clean __P((struct gtable *gt));
#endif /* RSRR */
diff --git a/usr.sbin/mrouted/dvmrp.h b/usr.sbin/mrouted/dvmrp.h
index a7aee84c3d0c..53b8d2fcded6 100644
--- a/usr.sbin/mrouted/dvmrp.h
+++ b/usr.sbin/mrouted/dvmrp.h
@@ -7,8 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: dvmrp.h,v 1.7 1997/02/22 16:06:52 peter Exp $
- * dvmrp.h,v 3.8.4.5 1997/11/18 23:25:57 fenner Exp
+ * $Id$
*/
/*
@@ -153,8 +152,13 @@
#define LEAF_CONFIRMATION_TIME 200 /* time to consider subnet a leaf */
#define NEIGHBOR_PROBE_INTERVAL 10 /* periodic neighbor probe interval */
-#define NEIGHBOR_EXPIRE_TIME 30 /* time to consider neighbor gone */
-#define OLD_NEIGHBOR_EXPIRE_TIME 140 /* time to consider neighbor gone */
+#define NEIGHBOR_EXPIRE_TIME 140 /* time to consider neighbor gone */
+
+#define GROUP_QUERY_INTERVAL 125 /* periodic group query interval */
+#define GROUP_EXPIRE_TIME 270 /* time to consider group gone */
+#define LEAVE_EXPIRE_TIME 3 /* " " after receiving a leave */
+/* Note: LEAVE_EXPIRE_TIME should ideally be shorter, but the resolution of
+ * the timer in mrouted doesn't allow us to make it any shorter. */
#define UNREACHABLE 32 /* "infinity" metric, must be <= 64 */
#define DEFAULT_METRIC 1 /* default subnet/tunnel metric */
@@ -162,11 +166,9 @@
#define MAX_RATE_LIMIT 100000 /* max rate limit */
#define DEFAULT_PHY_RATE_LIMIT 0 /* default phyint rate limit */
-#define DEFAULT_TUN_RATE_LIMIT 0 /* default tunnel rate limit */
+#define DEFAULT_TUN_RATE_LIMIT 500 /* default tunnel rate limit */
#define DEFAULT_CACHE_LIFETIME 300 /* kernel route entry discard time */
-#define MIN_CACHE_LIFETIME 60 /* minimum allowed cache lifetime */
-#define AVERAGE_PRUNE_LIFETIME 7200 /* average lifetime of prunes sent */
-#define MIN_PRUNE_LIFETIME 120 /* minimum allowed prune lifetime */
#define GRAFT_TIMEOUT_VAL 5 /* retransmission time for grafts */
-#define PRUNE_REXMIT_VAL 3 /* initial time for prune rexmission*/
+
+#define OLD_AGE_THRESHOLD 2
diff --git a/usr.sbin/mrouted/icmp.c b/usr.sbin/mrouted/icmp.c
deleted file mode 100644
index 72efa0ac745b..000000000000
--- a/usr.sbin/mrouted/icmp.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * The mrouted program is covered by the license in the accompanying file
- * named "LICENSE". Use of the mrouted program represents acceptance of
- * the terms and conditions listed in that file.
- *
- * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
- * Leland Stanford Junior University.
- *
- *
- * icmp.c,v 3.8.4.2 1998/01/06 01:57:42 fenner Exp
- */
-
-#include "defs.h"
-
-#ifndef lint
-static char rcsid[] = "@(#) $Id: \
-icmp.c,v 3.8.4.2 1998/01/06 01:57:42 fenner Exp $";
-#endif
-
-static int icmp_socket;
-
-static void icmp_handler __P((int, fd_set *));
-static char * icmp_name __P((struct icmp *));
-
-void
-init_icmp()
-{
- if ((icmp_socket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
- log(LOG_ERR, errno, "ICMP socket");
-
- register_input_handler(icmp_socket, icmp_handler);
-
- IF_DEBUG(DEBUG_ICMP)
- log(LOG_DEBUG, 0, "registering icmp socket fd %d\n", icmp_socket);
-}
-
-static void
-icmp_handler(fd, rfds)
- int fd;
- fd_set *rfds;
-{
- u_char icmp_buf[RECV_BUF_SIZE];
- struct sockaddr_in from;
- int fromlen, recvlen, iphdrlen, ipdatalen;
- struct icmp *icmp;
- struct ip *ip;
- vifi_t i;
- struct uvif *v;
- u_int32 src;
-
- fromlen = sizeof(from);
- recvlen = recvfrom(icmp_socket, icmp_buf, RECV_BUF_SIZE, 0,
- (struct sockaddr *)&from, &fromlen);
- if (recvlen < 0) {
- if (errno != EINTR)
- log(LOG_WARNING, errno, "icmp_socket recvfrom");
- return;
- }
- ip = (struct ip *)icmp_buf;
- iphdrlen = ip->ip_hl << 2;
-#ifdef RAW_INPUT_IS_RAW
- ipdatalen = ntohs(ip->ip_len) - iphdrlen;
-#else
- ipdatalen = ip->ip_len;
-#endif
- if (iphdrlen + ipdatalen != recvlen) {
- IF_DEBUG(DEBUG_ICMP)
- log(LOG_DEBUG, 0, "hdr %d data %d != rcv %d", iphdrlen, ipdatalen, recvlen);
- /* Malformed ICMP, just return. */
- return;
- }
- if (ipdatalen < ICMP_MINLEN + sizeof(struct ip)) {
- /* Not enough data for us to be interested in it. */
- return;
- }
- src = ip->ip_src.s_addr;
- icmp = (struct icmp *)(icmp_buf + iphdrlen);
- IF_DEBUG(DEBUG_ICMP)
- log(LOG_DEBUG, 0, "got ICMP type %d from %s",
- icmp->icmp_type, inet_fmt(src, s1));
- /*
- * Eventually:
- * have registry of ICMP listeners, by type, code and ICMP_ID
- * (and maybe fields of the original packet too -- maybe need a
- * generalized packet filter!) to allow ping and traceroute
- * from the monitoring tool.
- */
- switch (icmp->icmp_type) {
- case ICMP_UNREACH:
- case ICMP_TIMXCEED:
- /* Look at returned packet to see if it's us sending on a tunnel */
- ip = &icmp->icmp_ip;
- if (ip->ip_p != IPPROTO_IGMP && ip->ip_p != IPPROTO_IPIP)
- return;
- for (v = uvifs, i = 0; i < numvifs; v++, i++) {
- if (ip->ip_src.s_addr == v->uv_lcl_addr &&
- ip->ip_dst.s_addr == v->uv_dst_addr) {
- char *p;
- int n;
- /*
- * I sent this packet on this vif.
- */
- n = ++v->uv_icmp_warn;
- while (n && !(n & 1))
- n >>= 1;
- if (n == 1 && ((p = icmp_name(icmp)) != NULL))
- log(LOG_WARNING, 0, "Received ICMP %s from %s %s %s on vif %d",
- p, inet_fmt(src, s1), "for traffic sent to",
- inet_fmt(ip->ip_dst.s_addr, s2),
- i);
-
- break;
- }
- }
- break;
- }
-}
-
-/*
- * Return NULL for ICMP informational messages.
- * Return string describing the error for ICMP errors.
- */
-static char *
-icmp_name(icmp)
- struct icmp *icmp;
-{
- static char retval[30];
-
- switch (icmp->icmp_type) {
- case ICMP_UNREACH:
- switch (icmp->icmp_code) {
- case ICMP_UNREACH_NET:
- return "network unreachable";
- case ICMP_UNREACH_HOST:
- return "host unreachable";
- case ICMP_UNREACH_PROTOCOL:
- return "protocol unreachable";
- case ICMP_UNREACH_PORT:
- return "port unreachable";
- case ICMP_UNREACH_NEEDFRAG:
- return "needs fragmentation";
- case ICMP_UNREACH_SRCFAIL:
- return "source route failed";
-#ifndef ICMP_UNREACH_NET_UNKNOWN
-#define ICMP_UNREACH_NET_UNKNOWN 6
-#endif
- case ICMP_UNREACH_NET_UNKNOWN:
- return "network unknown";
-#ifndef ICMP_UNREACH_HOST_UNKNOWN
-#define ICMP_UNREACH_HOST_UNKNOWN 7
-#endif
- case ICMP_UNREACH_HOST_UNKNOWN:
- return "host unknown";
-#ifndef ICMP_UNREACH_ISOLATED
-#define ICMP_UNREACH_ISOLATED 8
-#endif
- case ICMP_UNREACH_ISOLATED:
- return "source host isolated";
-#ifndef ICMP_UNREACH_NET_PROHIB
-#define ICMP_UNREACH_NET_PROHIB 9
-#endif
- case ICMP_UNREACH_NET_PROHIB:
- return "network access prohibited";
-#ifndef ICMP_UNREACH_HOST_PROHIB
-#define ICMP_UNREACH_HOST_PROHIB 10
-#endif
- case ICMP_UNREACH_HOST_PROHIB:
- return "host access prohibited";
-#ifndef ICMP_UNREACH_TOSNET
-#define ICMP_UNREACH_TOSNET 11
-#endif
- case ICMP_UNREACH_TOSNET:
- return "bad TOS for net";
-#ifndef ICMP_UNREACH_TOSHOST
-#define ICMP_UNREACH_TOSHOST 12
-#endif
- case ICMP_UNREACH_TOSHOST:
- return "bad TOS for host";
-#ifndef ICMP_UNREACH_FILTER_PROHIB
-#define ICMP_UNREACH_FILTER_PROHIB 13
-#endif
- case ICMP_UNREACH_FILTER_PROHIB:
- return "prohibited by filter";
-#ifndef ICMP_UNREACH_HOST_PRECEDENCE
-#define ICMP_UNREACH_HOST_PRECEDENCE 14
-#endif
- case ICMP_UNREACH_HOST_PRECEDENCE:
- return "host precedence violation";
-#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
-#endif
- case ICMP_UNREACH_PRECEDENCE_CUTOFF:
- return "precedence cutoff";
- default:
- sprintf(retval, "unreachable code %d", icmp->icmp_code);
- return retval;
- }
- case ICMP_SOURCEQUENCH:
- return "source quench";
- case ICMP_REDIRECT:
- return NULL; /* XXX */
- case ICMP_TIMXCEED:
- switch (icmp->icmp_code) {
- case ICMP_TIMXCEED_INTRANS:
- return "time exceeded in transit";
- case ICMP_TIMXCEED_REASS:
- return "time exceeded in reassembly";
- default:
- sprintf(retval, "time exceeded code %d", icmp->icmp_code);
- return retval;
- }
- case ICMP_PARAMPROB:
- switch (icmp->icmp_code) {
-#ifndef ICMP_PARAMPROB_OPTABSENT
-#define ICMP_PARAMPROB_OPTABSENT 1
-#endif
- case ICMP_PARAMPROB_OPTABSENT:
- return "required option absent";
- default:
- sprintf(retval, "parameter problem code %d", icmp->icmp_code);
- return retval;
- }
- }
- return NULL;
-}
diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c
index 5feab13e0a41..203bd267fa8f 100644
--- a/usr.sbin/mrouted/igmp.c
+++ b/usr.sbin/mrouted/igmp.c
@@ -5,14 +5,11 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * igmp.c,v 3.8.4.19 1998/01/06 01:57:43 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: igmp.c,v 1.14 1998/01/16 07:17:41 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
@@ -29,9 +26,27 @@ u_int32 dvmrp_group; /* DVMRP grp addr in net order */
u_int32 dvmrp_genid; /* IGMP generation id */
/*
+ * Private variables
+ */
+static char router_alert[4]; /* Router Alert IP Option */
+#ifndef IPOPT_RA
+#define IPOPT_RA 148
+#endif
+#ifdef SUNOS5
+static char no_op[4]; /* Null IP Option */
+static int ip_addlen = 0; /* Workaround for Option bug #2*/
+#endif
+#define SEND_RA(x) (((x) == IGMP_MEMBERSHIP_QUERY) || \
+ ((x) == IGMP_V1_MEMBERSHIP_REPORT) || \
+ ((x) == IGMP_V2_MEMBERSHIP_REPORT) || \
+ ((x) == IGMP_V2_LEAVE_GROUP) || \
+ ((x) == IGMP_MTRACE))
+
+/*
* Local function definitions.
*/
/* u_char promoted to u_int */
+static char * packet_kind __P((u_int type, u_int code));
static int igmp_log_level __P((u_int type, u_int code));
/*
@@ -42,6 +57,9 @@ void
init_igmp()
{
struct ip *ip;
+#ifdef SUNOS5
+ u_int32 localhost = htonl(0x7f000001);
+#endif
recv_buf = malloc(RECV_BUF_SIZE);
send_buf = malloc(RECV_BUF_SIZE);
@@ -50,27 +68,82 @@ init_igmp()
log(LOG_ERR, errno, "IGMP socket");
k_hdr_include(TRUE); /* include IP header when sending */
- k_set_rcvbuf(256*1024,48*1024); /* lots of input buffering */
+ k_set_rcvbuf(48*1024); /* lots of input buffering */
k_set_ttl(1); /* restrict multicasts to one hop */
k_set_loop(FALSE); /* disable multicast loopback */
ip = (struct ip *)send_buf;
- bzero(ip, sizeof(struct ip));
- /*
- * Fields zeroed that aren't filled in later:
- * - IP ID (let the kernel fill it in)
- * - Offset (we don't send fragments)
- * - Checksum (let the kernel fill it in)
- */
- ip->ip_v = IPVERSION;
ip->ip_hl = sizeof(struct ip) >> 2;
- ip->ip_tos = 0xc0; /* Internet Control */
- ip->ip_ttl = MAXTTL; /* applies to unicasts only */
+ ip->ip_v = IPVERSION;
+ ip->ip_tos = 0;
+ ip->ip_off = 0;
ip->ip_p = IPPROTO_IGMP;
+ ip->ip_ttl = MAXTTL; /* applies to unicasts only */
allhosts_group = htonl(INADDR_ALLHOSTS_GROUP);
dvmrp_group = htonl(INADDR_DVMRP_GROUP);
allrtrs_group = htonl(INADDR_ALLRTRS_GROUP);
+
+ router_alert[0] = IPOPT_RA; /* Router Alert */
+ router_alert[1] = 4; /* 4 bytes */
+ router_alert[2] = 0;
+ router_alert[3] = 0;
+
+#ifdef SUNOS5
+ no_op[0] = IPOPT_NOP;
+ no_op[1] = IPOPT_NOP;
+ no_op[2] = IPOPT_NOP;
+ no_op[3] = IPOPT_NOP;
+
+ setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS, no_op, sizeof(no_op));
+ /*
+ * Check if the kernel adds the options length to the packet
+ * length. Send myself an IGMP packet of type 0 (illegal),
+ * with 4 IPOPT_NOP options, my PID (for collision detection)
+ * and 4 bytes of zero (so that the checksum works whether
+ * the 4 bytes of zero get truncated or not).
+ */
+ bzero(send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN, 8);
+ *(int *)(send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN) = getpid();
+ send_igmp(localhost, localhost, 0, 0, 0, 8);
+ while (1) {
+ int recvlen, dummy = 0;
+
+ recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
+ 0, NULL, &dummy);
+ /* 8 == 4 bytes of options and 4 bytes of PID */
+ if (recvlen >= MIN_IP_HEADER_LEN + IGMP_MINLEN + 8) {
+ struct ip *ip = (struct ip *)recv_buf;
+ struct igmp *igmp;
+ int *p;
+
+ if (ip->ip_hl != 6 ||
+ ip->ip_p != IPPROTO_IGMP ||
+ ip->ip_src.s_addr != localhost ||
+ ip->ip_dst.s_addr != localhost)
+ continue;
+
+ igmp = (struct igmp *)(recv_buf + (ip->ip_hl << 2));
+ if (igmp->igmp_group.s_addr != 0)
+ continue;
+ if (igmp->igmp_type != 0 || igmp->igmp_code != 0)
+ continue;
+
+ p = (int *)((char *)igmp + IGMP_MINLEN);
+ if (*p != getpid())
+ continue;
+
+ if (ip->ip_len == IGMP_MINLEN + 4)
+ ip_addlen = 4;
+ else if (ip->ip_len == IGMP_MINLEN + 8)
+ ip_addlen = 0;
+ else
+ log(LOG_ERR, 0, "while checking for Solaris bug: Sent %d bytes and got back %d!", IGMP_MINLEN + 8, ip->ip_len);
+
+ break;
+ }
+ }
+#endif
}
#define PIM_QUERY 0
@@ -82,33 +155,29 @@ init_igmp()
#define PIM_GRAFT 6
#define PIM_GRAFT_ACK 7
-char *
-igmp_packet_kind(type, code)
+static char *
+packet_kind(type, code)
u_int type, code;
{
- static char unknown[20];
-
switch (type) {
- case IGMP_MEMBERSHIP_QUERY: return "membership query ";
- case IGMP_V1_MEMBERSHIP_REPORT: return "V1 member report ";
- case IGMP_V2_MEMBERSHIP_REPORT: return "V2 member report ";
- case IGMP_V2_LEAVE_GROUP: return "leave message ";
+ case IGMP_HOST_MEMBERSHIP_QUERY: return "membership query ";
+ case IGMP_HOST_MEMBERSHIP_REPORT: return "V1 member report ";
+ case IGMP_HOST_NEW_MEMBERSHIP_REPORT: return "V2 member report ";
+ case IGMP_HOST_LEAVE_MESSAGE: return "leave message ";
case IGMP_DVMRP:
switch (code) {
- case DVMRP_PROBE: return "neighbor probe ";
- case DVMRP_REPORT: return "route report ";
- case DVMRP_ASK_NEIGHBORS: return "neighbor request ";
- case DVMRP_NEIGHBORS: return "neighbor list ";
- case DVMRP_ASK_NEIGHBORS2: return "neighbor request 2";
- case DVMRP_NEIGHBORS2: return "neighbor list 2 ";
+ case DVMRP_PROBE: return "neighbor probe ";
+ case DVMRP_REPORT: return "route report ";
+ case DVMRP_ASK_NEIGHBORS: return "neighbor request ";
+ case DVMRP_NEIGHBORS: return "neighbor list ";
+ case DVMRP_ASK_NEIGHBORS2: return "neighbor request 2";
+ case DVMRP_NEIGHBORS2: return "neighbor list 2 ";
case DVMRP_PRUNE: return "prune message ";
case DVMRP_GRAFT: return "graft message ";
case DVMRP_GRAFT_ACK: return "graft message ack ";
case DVMRP_INFO_REQUEST: return "info request ";
case DVMRP_INFO_REPLY: return "info reply ";
- default:
- sprintf(unknown, "unknown DVMRP %3d ", code);
- return unknown;
+ default: return "unknown DVMRP msg ";
}
case IGMP_PIM:
switch (code) {
@@ -120,57 +189,11 @@ igmp_packet_kind(type, code)
case PIM_ASSERT: return "PIM Assert ";
case PIM_GRAFT: return "PIM Graft ";
case PIM_GRAFT_ACK: return "PIM Graft-Ack ";
- default:
- sprintf(unknown, "unknown PIM msg%3d", code);
- return unknown;
+ default: return "unknown PIM msg ";
}
case IGMP_MTRACE: return "IGMP trace query ";
case IGMP_MTRACE_RESP: return "IGMP trace reply ";
- default:
- sprintf(unknown, "unk: 0x%02x/0x%02x ", type, code);
- return unknown;
- }
-}
-
-int
-igmp_debug_kind(type, code)
- u_int type, code;
-{
- switch (type) {
- case IGMP_MEMBERSHIP_QUERY: return DEBUG_IGMP;
- case IGMP_V1_MEMBERSHIP_REPORT: return DEBUG_IGMP;
- case IGMP_V2_MEMBERSHIP_REPORT: return DEBUG_IGMP;
- case IGMP_V2_LEAVE_GROUP: return DEBUG_IGMP;
- case IGMP_DVMRP:
- switch (code) {
- case DVMRP_PROBE: return DEBUG_PEER;
- case DVMRP_REPORT: return DEBUG_ROUTE;
- case DVMRP_ASK_NEIGHBORS: return 0;
- case DVMRP_NEIGHBORS: return 0;
- case DVMRP_ASK_NEIGHBORS2: return 0;
- case DVMRP_NEIGHBORS2: return 0;
- case DVMRP_PRUNE: return DEBUG_PRUNE;
- case DVMRP_GRAFT: return DEBUG_PRUNE;
- case DVMRP_GRAFT_ACK: return DEBUG_PRUNE;
- case DVMRP_INFO_REQUEST: return 0;
- case DVMRP_INFO_REPLY: return 0;
- default: return 0;
- }
- case IGMP_PIM:
- switch (code) {
- case PIM_QUERY: return 0;
- case PIM_REGISTER: return 0;
- case PIM_REGISTER_STOP: return 0;
- case PIM_JOIN_PRUNE: return 0;
- case PIM_RP_REACHABLE: return 0;
- case PIM_ASSERT: return 0;
- case PIM_GRAFT: return 0;
- case PIM_GRAFT_ACK: return 0;
- default: return 0;
- }
- case IGMP_MTRACE: return DEBUG_TRACE;
- case IGMP_MTRACE_RESP: return DEBUG_TRACE;
- default: return DEBUG_IGMP;
+ default: return "unknown IGMP msg ";
}
}
@@ -211,11 +234,7 @@ accept_igmp(recvlen)
}
iphdrlen = ip->ip_hl << 2;
-#ifdef RAW_INPUT_IS_RAW
- ipdatalen = ntohs(ip->ip_len) - iphdrlen;
-#else
ipdatalen = ip->ip_len;
-#endif
if (iphdrlen + ipdatalen != recvlen) {
log(LOG_WARNING, 0,
"received packet from %s shorter (%u bytes) than hdr+data length (%u+%u)",
@@ -233,23 +252,22 @@ accept_igmp(recvlen)
return;
}
- IF_DEBUG(DEBUG_PKT|igmp_debug_kind(igmp->igmp_type, igmp->igmp_code))
log(LOG_DEBUG, 0, "RECV %s from %-15s to %s",
- igmp_packet_kind(igmp->igmp_type, igmp->igmp_code),
+ packet_kind(igmp->igmp_type, igmp->igmp_code),
inet_fmt(src, s1), inet_fmt(dst, s2));
switch (igmp->igmp_type) {
- case IGMP_MEMBERSHIP_QUERY:
+ case IGMP_HOST_MEMBERSHIP_QUERY:
accept_membership_query(src, dst, group, igmp->igmp_code);
return;
- case IGMP_V1_MEMBERSHIP_REPORT:
- case IGMP_V2_MEMBERSHIP_REPORT:
+ case IGMP_HOST_MEMBERSHIP_REPORT:
+ case IGMP_HOST_NEW_MEMBERSHIP_REPORT:
accept_group_report(src, dst, group, igmp->igmp_type);
return;
- case IGMP_V2_LEAVE_GROUP:
+ case IGMP_HOST_LEAVE_MESSAGE:
accept_leave_message(src, dst, group);
return;
@@ -360,31 +378,32 @@ igmp_log_level(type, code)
/*
* Construct an IGMP message in the output packet buffer. The caller may
- * have already placed data in that buffer, of length 'datalen'.
+ * have already placed data in that buffer, of length 'datalen'. Then send
+ * the message from the interface with IP address 'src' to destination 'dst'.
*/
void
-build_igmp(src, dst, type, code, group, datalen)
+send_igmp(src, dst, type, code, group, datalen)
u_int32 src, dst;
int type, code;
u_int32 group;
int datalen;
{
+ struct sockaddr_in sdst;
struct ip *ip;
struct igmp *igmp;
- extern int curttl;
+ int setloop = 0;
+ static int raset = 0;
+ int sendra = 0;
+ int sendlen;
ip = (struct ip *)send_buf;
ip->ip_src.s_addr = src;
ip->ip_dst.s_addr = dst;
ip->ip_len = MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen;
-#ifdef RAW_OUTPUT_IS_RAW
- ip->ip_len = htons(ip->ip_len);
+ sendlen = ip->ip_len;
+#ifdef SUNOS5
+ ip->ip_len += ip_addlen;
#endif
- if (IN_MULTICAST(ntohl(dst))) {
- ip->ip_ttl = curttl;
- } else {
- ip->ip_ttl = MAXTTL;
- }
igmp = (struct igmp *)(send_buf + MIN_IP_HEADER_LEN);
igmp->igmp_type = type;
@@ -393,24 +412,6 @@ build_igmp(src, dst, type, code, group, datalen)
igmp->igmp_cksum = 0;
igmp->igmp_cksum = inet_cksum((u_short *)igmp,
IGMP_MINLEN + datalen);
-}
-
-/*
- * Call build_igmp() to build an IGMP message in the output packet buffer.
- * Then send the message from the interface with IP address 'src' to
- * destination 'dst'.
- */
-void
-send_igmp(src, dst, type, code, group, datalen)
- u_int32 src, dst;
- int type, code;
- u_int32 group;
- int datalen;
-{
- struct sockaddr_in sdst;
- int setloop = 0;
-
- build_igmp(src, dst, type, code, group, datalen);
if (IN_MULTICAST(ntohl(dst))) {
k_set_if(src);
@@ -418,16 +419,36 @@ send_igmp(src, dst, type, code, group, datalen)
setloop = 1;
k_set_loop(TRUE);
}
+ if (SEND_RA(type))
+ sendra = 1;
+ }
+
+ if (sendra && !raset) {
+ setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS,
+ router_alert, sizeof(router_alert));
+ raset = 1;
+ } else if (!sendra && raset) {
+#ifdef SUNOS5
+ /*
+ * SunOS5 < 5.6 cannot properly reset the IP_OPTIONS "socket"
+ * option. Instead, set up a string of 4 no-op's.
+ */
+ setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS,
+ no_op, sizeof(no_op));
+#else
+ setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS,
+ NULL, 0);
+#endif
+ raset = 0;
}
bzero(&sdst, sizeof(sdst));
sdst.sin_family = AF_INET;
-#ifdef HAVE_SA_LEN
+#if (defined(BSD) && (BSD >= 199103))
sdst.sin_len = sizeof(sdst);
#endif
sdst.sin_addr.s_addr = dst;
- if (sendto(igmp_socket, send_buf,
- MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen, 0,
+ if (sendto(igmp_socket, send_buf, sendlen, 0,
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
if (errno == ENETDOWN)
check_vif_state();
@@ -440,8 +461,7 @@ send_igmp(src, dst, type, code, group, datalen)
if (setloop)
k_set_loop(FALSE);
- IF_DEBUG(DEBUG_PKT|igmp_debug_kind(type, code))
log(LOG_DEBUG, 0, "SENT %s from %-15s to %s",
- igmp_packet_kind(type, code), src == INADDR_ANY ? "INADDR_ANY" :
+ packet_kind(type, code), src == INADDR_ANY ? "INADDR_ANY" :
inet_fmt(src, s1), inet_fmt(dst, s2));
}
diff --git a/usr.sbin/mrouted/igmpv2.h b/usr.sbin/mrouted/igmpv2.h
deleted file mode 100644
index 5f5ae27e68e8..000000000000
--- a/usr.sbin/mrouted/igmpv2.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * The mrouted program is covered by the license in the accompanying file
- * named "LICENSE". Use of the mrouted program represents acceptance of
- * the terms and conditions listed in that file.
- *
- * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
- * Leland Stanford Junior University.
- *
- *
- * igmpv2.h,v 3.8.4.1 1997/11/18 23:25:58 fenner Exp
- */
-
-/*
- * Constants for IGMP Version 2. Several of these, especially the
- * robustness variable, should be variables and not constants.
- */
-#define IGMP_ROBUSTNESS_VARIABLE 2
-#define IGMP_QUERY_INTERVAL 125
-#define IGMP_QUERY_RESPONSE_INTERVAL 10
-#define IGMP_GROUP_MEMBERSHIP_INTERVAL (IGMP_ROBUSTNESS_VARIABLE * \
- IGMP_QUERY_INTERVAL + \
- IGMP_QUERY_RESPONSE_INTERVAL)
-#define IGMP_OTHER_QUERIER_PRESENT_INTERVAL (IGMP_ROBUSTNESS_VARIABLE * \
- IGMP_QUERY_INTERVAL + \
- IGMP_QUERY_RESPONSE_INTERVAL / 2)
- /* Round to the nearest TIMER_INTERVAL */
-#define IGMP_STARTUP_QUERY_INTERVAL (((IGMP_QUERY_INTERVAL / 4) \
- / TIMER_INTERVAL) * TIMER_INTERVAL)
-#define IGMP_STARTUP_QUERY_COUNT IGMP_ROBUSTNESS_VARIABLE
-#define IGMP_LAST_MEMBER_QUERY_INTERVAL 1
-#define IGMP_LAST_MEMBER_QUERY_COUNT IGMP_ROBUSTNESS_VARIABLE
-
-/*
- * OLD_AGE_THRESHOLD is the number of IGMP_QUERY_INTERVAL's to remember the
- * presence of an IGMPv1 group member. According to the IGMPv2 specification,
- * routers remember this presence for [Robustness Variable] * [Query Interval] +
- * [Query Response Interval]. However, OLD_AGE_THRESHOLD is in units of
- * [Query Interval], so doesn't have sufficient resolution to represent
- * [Query Response Interval]. When the timer mechanism gets an efficient
- * method of refreshing timers, this should get fixed.
- */
-#define OLD_AGE_THRESHOLD IGMP_ROBUSTNESS_VARIABLE
diff --git a/usr.sbin/mrouted/inet.c b/usr.sbin/mrouted/inet.c
index fb101616a8e7..5af7218e0bde 100644
--- a/usr.sbin/mrouted/inet.c
+++ b/usr.sbin/mrouted/inet.c
@@ -5,14 +5,11 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * inet.c,v 3.8.4.2 1998/01/06 01:57:44 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: inet.c,v 1.9 1998/01/16 07:17:42 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
diff --git a/usr.sbin/mrouted/ipip.c b/usr.sbin/mrouted/ipip.c
deleted file mode 100644
index 6e88d932d3b4..000000000000
--- a/usr.sbin/mrouted/ipip.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * The mrouted program is covered by the license in the accompanying file
- * named "LICENSE". Use of the mrouted program represents acceptance of
- * the terms and conditions listed in that file.
- *
- * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
- * Leland Stanford Junior University.
- *
- *
- * ipip.c,v 3.8.4.6 1998/01/06 01:57:45 fenner Exp
- */
-
-
-#include "defs.h"
-
-#ifndef lint
-static char rcsid[] = "@(#) $Id: \
-ipip.c,v 3.8.4.6 1998/01/06 01:57:45 fenner Exp $";
-#endif
-
-/*
- * Exported variables.
- */
-#ifdef notyet
-int raw_socket; /* socket for raw network I/O */
-#endif
-/*
- *XXX For now, we just use the IGMP socket to send packets.
- * This is legal in BSD, because the protocol # is not checked
- * on raw sockets. The k_* interfaces need to gain a socket
- * argument so that we can call them on the raw_socket also.
- */
-#define raw_socket igmp_socket
-
-/*
- * Private variables.
- */
-static int rawid = 0;
-
-/*
- * Open and initialize the raw socket.
- */
-void
-init_ipip()
-{
-#ifdef notyet
- if ((raw_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
- log(LOG_ERR, errno, "Raw IP socket");
-#endif
-}
-
-/*
- * Allocate and fill in static IP header for encapsulating on a tunnel.
- */
-void
-init_ipip_on_vif(v)
- struct uvif *v;
-{
- struct ip *ip;
-
- ip = v->uv_encap_hdr = (struct ip *)malloc(sizeof(struct ip));
- if (ip == NULL)
- log(LOG_ERR, 0, "out of memory");
- bzero(ip, sizeof(struct ip));
- /*
- * Fields zeroed that aren't filled in later:
- * - IP ID (let the kernel fill it in)
- * - Offset (we don't send fragments)
- * - Checksum (let the kernel fill it in)
- */
- ip->ip_v = IPVERSION;
- ip->ip_hl = sizeof(struct ip) >> 2;
- ip->ip_tos = 0xc0; /* Internet Control */
- ip->ip_ttl = MAXTTL; /* applies to unicasts only */
- ip->ip_p = IPPROTO_IPIP;
- ip->ip_src.s_addr = v->uv_lcl_addr;
- ip->ip_dst.s_addr = v->uv_rmt_addr;
-}
-
-/*
- * Call build_igmp() to build an IGMP message in the output packet buffer.
- * Then fill in the fields of the IP packet that build_igmp() left for the
- * kernel to fill in, and encapsulate the original packet with the
- * pre-created ip header for this vif.
- */
-void
-send_ipip(src, dst, type, code, group, datalen, v)
- u_int32 src, dst;
- int type, code;
- u_int32 group;
- int datalen;
- struct uvif *v;
-{
- struct msghdr msg;
- struct iovec iov[2];
- struct sockaddr_in sdst;
- struct ip *ip;
-
- build_igmp(src, dst, type, code, group, datalen);
- ip = (struct ip *)send_buf;
-#ifndef RAW_OUTPUT_IS_RAW
- ip->ip_len = htons(ip->ip_len);
-#endif
- ip->ip_id = htons(rawid++);
- ip->ip_sum = 0;
- ip->ip_sum = inet_cksum((u_short *)ip, ip->ip_hl << 2);
-
- ip = v->uv_encap_hdr;
- ip->ip_len = 2 * MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen;
-#ifdef RAW_OUTPUT_IS_RAW
- ip->ip_len = htons(ip->ip_len);
-#endif
-
- bzero(&sdst, sizeof(sdst));
- sdst.sin_family = AF_INET;
-#ifdef HAVE_SA_LEN
- sdst.sin_len = sizeof(sdst);
-#endif
- sdst.sin_addr = ip->ip_dst;
-
- iov[0].iov_base = (caddr_t)v->uv_encap_hdr;
- iov[0].iov_len = sizeof(struct ip);
- iov[1].iov_base = (caddr_t)send_buf;
- iov[1].iov_len = MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen;
-
- bzero(&msg, sizeof(msg));
- msg.msg_name = (caddr_t)&sdst;
- msg.msg_namelen = sizeof(sdst);
- msg.msg_iov = iov;
- msg.msg_iovlen = 2;
- if (sendmsg(raw_socket, &msg, 0) < 0) {
- if (errno == ENETDOWN)
- check_vif_state();
- else
- log(LOG_WARNING, errno,
- "sendmsg to %s on %s",
- inet_fmt(sdst.sin_addr.s_addr, s1), inet_fmt(src, s2));
- }
-
- IF_DEBUG(DEBUG_PKT|igmp_debug_kind(type, code))
- log(LOG_DEBUG, 0, "SENT %s from %-15s to %s encaped to %s",
- igmp_packet_kind(type, code), src == INADDR_ANY ? "INADDR_ANY" :
- inet_fmt(src, s1), inet_fmt(dst, s2),
- inet_fmt(sdst.sin_addr.s_addr, s3));
-}
diff --git a/usr.sbin/mrouted/kern.c b/usr.sbin/mrouted/kern.c
index af8d007eb8dc..5f29949f515c 100644
--- a/usr.sbin/mrouted/kern.c
+++ b/usr.sbin/mrouted/kern.c
@@ -5,59 +5,21 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * kern.c,v 3.8.4.10 1998/01/06 02:00:51 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: kern.c,v 1.10 1998/01/16 07:17:42 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
-int curttl = 0;
-
-void k_set_rcvbuf(bufsize, minsize)
+void k_set_rcvbuf(bufsize)
int bufsize;
- int minsize;
{
- int delta = bufsize / 2;
- int iter = 0;
-
- /*
- * Set the socket buffer. If we can't set it as large as we
- * want, search around to try to find the highest acceptable
- * value. The highest acceptable value being smaller than
- * minsize is a fatal error.
- */
if (setsockopt(igmp_socket, SOL_SOCKET, SO_RCVBUF,
- (char *)&bufsize, sizeof(bufsize)) < 0) {
- bufsize -= delta;
- while (1) {
- iter++;
- if (delta > 1)
- delta /= 2;
-
- if (setsockopt(igmp_socket, SOL_SOCKET, SO_RCVBUF,
- (char *)&bufsize, sizeof(bufsize)) < 0) {
- bufsize -= delta;
- } else {
- if (delta < 1024)
- break;
- bufsize += delta;
- }
- }
- if (bufsize < minsize) {
- log(LOG_ERR, 0, "OS-allowed buffer size %u < app min %u",
- bufsize, minsize);
- /*NOTREACHED*/
- }
- }
- IF_DEBUG(DEBUG_KERN)
- log(LOG_DEBUG, 0, "Got %d byte buffer size in %d iterations",
- bufsize, iter);
+ (char *)&bufsize, sizeof(bufsize)) < 0)
+ log(LOG_ERR, errno, "setsockopt SO_RCVBUF %u", bufsize);
}
@@ -75,15 +37,12 @@ void k_hdr_include(bool)
void k_set_ttl(t)
int t;
{
-#ifndef RAW_OUTPUT_IS_RAW
u_char ttl;
ttl = t;
if (setsockopt(igmp_socket, IPPROTO_IP, IP_MULTICAST_TTL,
(char *)&ttl, sizeof(ttl)) < 0)
log(LOG_ERR, errno, "setsockopt IP_MULTICAST_TTL %u", ttl);
-#endif
- curttl = t;
}
@@ -182,7 +141,7 @@ void k_add_vif(vifi, v)
if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_VIF,
(char *)&vc, sizeof(vc)) < 0)
- log(LOG_ERR, errno, "setsockopt MRT_ADD_VIF on vif %d", vifi);
+ log(LOG_ERR, errno, "setsockopt MRT_ADD_VIF");
}
@@ -224,8 +183,7 @@ void k_add_rg(origin, g)
#ifdef DEBUG_MFC
md_log(MD_ADD_FAIL, origin, g->gt_mcastgrp);
#endif
- log(LOG_WARNING, errno, "setsockopt MRT_ADD_MFC",
- inet_fmt(origin, s1), inet_fmt(g->gt_mcastgrp, s2));
+ log(LOG_WARNING, errno, "setsockopt MRT_ADD_MFC");
}
}
@@ -256,8 +214,7 @@ int k_del_rg(origin, g)
#ifdef DEBUG_MFC
md_log(MD_DEL_FAIL, origin, g->gt_mcastgrp);
#endif
- log(LOG_WARNING, errno, "setsockopt MRT_DEL_MFC of (%s %s)",
- inet_fmt(origin, s1), inet_fmt(g->gt_mcastgrp, s2));
+ log(LOG_WARNING, errno, "setsockopt MRT_DEL_MFC");
}
return retval;
@@ -282,63 +239,3 @@ int k_get_version()
return vers;
#endif
}
-
-#if 0
-/*
- * Get packet counters
- */
-int
-k_get_vif_count(vifi, icount, ocount, ibytes, obytes)
- vifi_t vifi;
- int *icount, *ocount, *ibytes, *obytes;
-{
- struct sioc_vif_req vreq;
- int retval = 0;
-
- vreq.vifi = vifi;
- if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&vreq) < 0) {
- log(LOG_WARNING, errno, "SIOCGETVIFCNT on vif %d", vifi);
- vreq.icount = vreq.ocount = vreq.ibytes =
- vreq.obytes = 0xffffffff;
- retval = 1;
- }
- if (icount)
- *icount = vreq.icount;
- if (ocount)
- *ocount = vreq.ocount;
- if (ibytes)
- *ibytes = vreq.ibytes;
- if (obytes)
- *obytes = vreq.obytes;
- return retval;
-}
-
-/*
- * Get counters for a desired source and group.
- */
-int
-k_get_sg_count(src, grp, pktcnt, bytecnt, wrong_if)
- u_int32 src;
- u_int32 grp;
- struct sg_count *retval;
-{
- struct sioc_sg_req sgreq;
- int retval = 0;
-
- sgreq.src.s_addr = src;
- sgreq.grp.s_addr = grp;
- if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sgreq) < 0) {
- log(LOG_WARNING, errno, "SIOCGETSGCNT on (%s %s)",
- inet_fmt(src, s1), inet_fmt(grp, s2));
- sgreq.pktcnt = sgreq.bytecnt = sgreq.wrong_if = 0xffffffff;
- return 1;
- }
- if (pktcnt)
- *pktcnt = sgreq.pktcnt;
- if (bytecnt)
- *bytecnt = sgreq.bytecnt;
- if (wrong_if)
- *wrong_if = sgreq.wrong_if;
- return retval;
-}
-#endif
diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c
index 875ec97659b4..864d5cb77244 100644
--- a/usr.sbin/mrouted/main.c
+++ b/usr.sbin/mrouted/main.c
@@ -6,8 +6,6 @@
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
*
- *
- * main.c,v 3.8.4.29 1998/03/01 01:49:00 fenner Exp
*/
/*
@@ -22,7 +20,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.14 1998/06/29 17:38:35 bde Exp $";
+ "$Id: main.c,v 1.13 1998/01/16 07:17:43 charnier Exp $";
#endif
#include <err.h>
@@ -46,21 +44,11 @@ static char dumpfilename[] = _PATH_MROUTED_DUMP;
static char cachefilename[] = _PATH_MROUTED_CACHE;
static char genidfilename[] = _PATH_MROUTED_GENID;
-static int haveterminal = 1;
-int did_final_init = 0;
-
-static int sighandled = 0;
-#define GOT_SIGINT 0x01
-#define GOT_SIGHUP 0x02
-#define GOT_SIGUSR1 0x04
-#define GOT_SIGUSR2 0x08
-
int cache_lifetime = DEFAULT_CACHE_LIFETIME;
-int prune_lifetime = AVERAGE_PRUNE_LIFETIME;
+int max_prune_lifetime = DEFAULT_CACHE_LIFETIME * 2;
int debug = 0;
-char *progname;
-time_t mrouted_init_time;
+u_char pruning = 1; /* Enable pruning by default */
#ifdef SNMP
#define NHANDLERS 34
@@ -74,48 +62,16 @@ static struct ihandler {
} ihandlers[NHANDLERS];
static int nhandlers = 0;
-static struct debugname {
- char *name;
- int level;
- int nchars;
-} debugnames[] = {
- { "packet", DEBUG_PKT, 2 },
- { "pkt", DEBUG_PKT, 3 },
- { "pruning", DEBUG_PRUNE, 1 },
- { "prunes", DEBUG_PRUNE, 1 },
- { "routing", DEBUG_ROUTE, 1 },
- { "routes", DEBUG_ROUTE, 1 },
- { "route_detail", DEBUG_RTDETAIL, 6 },
- { "rtdetail", DEBUG_RTDETAIL, 2 },
- { "peers", DEBUG_PEER, 2 },
- { "neighbors", DEBUG_PEER, 1 },
- { "cache", DEBUG_CACHE, 1 },
- { "timeout", DEBUG_TIMEOUT, 1 },
- { "callout", DEBUG_TIMEOUT, 2 },
- { "interface", DEBUG_IF, 2 },
- { "vif", DEBUG_IF, 1 },
- { "membership", DEBUG_MEMBER, 1 },
- { "groups", DEBUG_MEMBER, 1 },
- { "traceroute", DEBUG_TRACE, 2 },
- { "mtrace", DEBUG_TRACE, 2 },
- { "igmp", DEBUG_IGMP, 1 },
- { "icmp", DEBUG_ICMP, 2 },
- { "rsrr", DEBUG_RSRR, 2 },
- { "3", 0xffffffff, 1 } /* compat. */
-};
-
/*
* Forward declarations.
*/
-static void final_init __P((void *));
-static void fasttimer __P((void *));
-static void timer __P((void *));
-static void dump __P((void));
-static void dump_version __P((FILE *));
-static void fdump __P((void));
-static void cdump __P((void));
-static void restart __P((void));
-static void handler __P((int));
+static void fasttimer __P((int));
+static void done __P((int));
+static void dump __P((int));
+static void fdump __P((int));
+static void cdump __P((int));
+static void restart __P((int));
+static void timer __P((void));
static void cleanup __P((void));
static void resetlogging __P((void *));
static void usage __P((void));
@@ -143,15 +99,14 @@ main(argc, argv)
char *argv[];
{
register int recvlen;
+ register int omask;
int dummy;
FILE *fp;
- struct timeval tv, difftime, curtime, lasttime, *timeout;
+ struct timeval tv;
u_int32 prev_genid;
int vers;
fd_set rfds, readers;
- int nfds, n, i, secs;
- extern char todaysversion[];
- struct sigaction sa;
+ int nfds, n, i;
#ifdef SNMP
struct timeval timeout, *tvp = &timeout;
struct timeval sched, *svp = &sched, now, *nvp = &now;
@@ -163,53 +118,12 @@ main(argc, argv)
if (geteuid() != 0)
errx(1, "must be root");
- progname = strrchr(argv[0], '/');
- if (progname)
- progname++;
- else
- progname = argv[0];
-
argv++, argc--;
while (argc > 0 && *argv[0] == '-') {
if (strcmp(*argv, "-d") == 0) {
- if (argc > 1 && *(argv + 1)[0] != '-') {
- char *p,*q;
- int i, len;
- struct debugname *d;
-
+ if (argc > 1 && isdigit(*(argv + 1)[0])) {
argv++, argc--;
- debug = 0;
- p = *argv; q = NULL;
- while (p) {
- q = strchr(p, ',');
- if (q)
- *q++ = '\0';
- len = strlen(p);
- for (i = 0, d = debugnames;
- i < sizeof(debugnames) / sizeof(debugnames[0]);
- i++, d++)
- if (len >= d->nchars && strncmp(d->name, p, len) == 0)
- break;
- if (i == sizeof(debugnames) / sizeof(debugnames[0])) {
- int j = 0xffffffff;
- int k = 0;
- fprintf(stderr, "Valid debug levels: ");
- for (i = 0, d = debugnames;
- i < sizeof(debugnames) / sizeof(debugnames[0]);
- i++, d++) {
- if ((j & d->level) == d->level) {
- if (k++)
- putc(',', stderr);
- fputs(d->name, stderr);
- j &= ~d->level;
- }
- }
- putc('\n', stderr);
- usage();
- }
- debug |= d->level;
- p = q;
- }
+ debug = atoi(*argv);
} else
debug = DEFAULT_DEBUG;
} else if (strcmp(*argv, "-c") == 0) {
@@ -219,7 +133,7 @@ main(argc, argv)
} else
usage();
} else if (strcmp(*argv, "-p") == 0) {
- log(LOG_WARNING, 0, "disabling pruning is no longer supported");
+ pruning = 0;
#ifdef SNMP
} else if (strcmp(*argv, "-P") == 0) {
if (argc > 1 && isdigit(*(argv + 1)[0])) {
@@ -236,23 +150,36 @@ main(argc, argv)
if (argc > 0)
usage();
- if (debug != 0) {
- struct debugname *d;
- char c;
- int tmpd = debug;
-
- fprintf(stderr, "debug level 0x%x ", debug);
- c = '(';
- for (d = debugnames; d < debugnames +
- sizeof(debugnames) / sizeof(debugnames[0]); d++) {
- if ((tmpd & d->level) == d->level) {
- tmpd &= ~d->level;
- fprintf(stderr, "%c%s", c, d->name);
- c = ',';
- }
+ if (debug == 0) {
+ /*
+ * Detach from the terminal
+ */
+ int t;
+
+ if (fork()) exit(0);
+ (void)close(0);
+ (void)close(1);
+ (void)close(2);
+ (void)open("/", 0);
+ (void)dup2(0, 1);
+ (void)dup2(0, 2);
+#ifdef SYSV
+ (void)setpgrp();
+#else
+#ifdef TIOCNOTTY
+ t = open("/dev/tty", 2);
+ if (t >= 0) {
+ (void)ioctl(t, TIOCNOTTY, (char *)0);
+ (void)close(t);
}
- fprintf(stderr, ")\n");
+#else
+ if (setsid() < 0)
+ warn("setsid");
+#endif
+#endif
}
+ else
+ fprintf(stderr, "debug level %u\n", debug);
#ifdef LOG_DAEMON
(void)openlog("mrouted", LOG_PID, LOG_DAEMON);
@@ -260,9 +187,10 @@ main(argc, argv)
#else
(void)openlog("mrouted", LOG_PID);
#endif
- sprintf(versionstring, "mrouted version %s", todaysversion);
+ sprintf(versionstring, "mrouted version %d.%da",
+ PROTOCOL_VERSION, MROUTED_VERSION);
- log(LOG_DEBUG, 0, "%s starting", versionstring);
+ log(LOG_NOTICE, 0, "%s", versionstring);
#ifdef SYSV
srand48(time(NULL));
@@ -290,27 +218,14 @@ main(argc, argv)
(void) fclose(fp);
}
- /* Start up the log rate-limiter */
- resetlogging(NULL);
-
callout_init();
init_igmp();
- init_icmp();
- init_ipip();
init_routes();
init_ktable();
+ k_init_dvmrp(); /* enable DVMRP routing in kernel */
+
#ifndef OLD_KERNEL
- /*
- * Unfortunately, you can't k_get_version() unless you've
- * k_init_dvmrp()'d. Now that we want to move the
- * k_init_dvmrp() to later in the initialization sequence,
- * we have to do the disgusting hack of initializing,
- * getting the version, then stopping the kernel multicast
- * forwarding.
- */
- k_init_dvmrp();
vers = k_get_version();
- k_stop_dvmrp();
/*XXX
* This function must change whenever the kernel version changes
*/
@@ -341,14 +256,33 @@ main(argc, argv)
rsrr_init();
#endif /* RSRR */
- sa.sa_handler = handler;
- sa.sa_flags = 0; /* Interrupt system calls */
- sigemptyset(&sa.sa_mask);
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGUSR1, &sa, NULL);
- sigaction(SIGUSR2, &sa, NULL);
+#if defined(__STDC__) || defined(__GNUC__)
+ /*
+ * Allow cleanup if unexpected exit. Apparently some architectures
+ * have a kernel bug where closing the socket doesn't do an
+ * ip_mrouter_done(), so we attempt to do it on exit.
+ */
+ atexit(cleanup);
+#endif
+
+ if (debug)
+ fprintf(stderr, "pruning %s\n", pruning ? "on" : "off");
+
+ fp = fopen(pidfilename, "w");
+ if (fp != NULL) {
+ fprintf(fp, "%d\n", (int)getpid());
+ (void) fclose(fp);
+ }
+
+ (void)signal(SIGALRM, fasttimer);
+
+ (void)signal(SIGHUP, restart);
+ (void)signal(SIGTERM, done);
+ (void)signal(SIGINT, done);
+ (void)signal(SIGUSR1, fdump);
+ (void)signal(SIGUSR2, cdump);
+ if (debug != 0)
+ (void)signal(SIGQUIT, dump);
FD_ZERO(&readers);
FD_SET(igmp_socket, &readers);
@@ -359,82 +293,30 @@ main(argc, argv)
nfds = ihandlers[i].fd + 1;
}
- IF_DEBUG(DEBUG_IF)
- dump_vifs(stderr);
- IF_DEBUG(DEBUG_ROUTE)
- dump_routes(stderr);
-
- /* schedule first timer interrupt */
- timer_setTimer(1, fasttimer, NULL);
- timer_setTimer(TIMER_INTERVAL, timer, NULL);
+ /*
+ * Install the vifs in the kernel as late as possible in the
+ * initialization sequence.
+ */
+ init_installvifs();
- if (debug == 0) {
- /*
- * Detach from the terminal
- */
- int t;
+ if (debug >= 2) dump(0);
- haveterminal = 0;
- if (fork()) exit(0);
- (void)close(0);
- (void)close(1);
- (void)close(2);
- (void)open("/", 0);
- (void)dup2(0, 1);
- (void)dup2(0, 2);
-#if defined(SYSV) || defined(linux)
- (void)setpgrp();
-#else
-#ifdef TIOCNOTTY
- t = open("/dev/tty", 2);
- if (t >= 0) {
- (void)ioctl(t, TIOCNOTTY, (char *)0);
- (void)close(t);
- }
-#else
- if (setsid() < 0)
- perror("setsid");
-#endif
-#endif
- }
-
- fp = fopen(pidfilename, "w");
- if (fp != NULL) {
- fprintf(fp, "%d\n", (int)getpid());
- (void) fclose(fp);
- }
+ /* Start up the log rate-limiter */
+ resetlogging(NULL);
- /* XXX HACK
- * This will cause black holes for the first few seconds after startup,
- * since we are exchanging routes but not actually forwarding.
- * However, it eliminates much of the startup transient.
- *
- * It's possible that we can set a flag which says not to report any
- * routes (just accept reports) until this timer fires, and then
- * do a report_to_all_neighbors(ALL_ROUTES) immediately before
- * turning on DVMRP.
- */
- timer_setTimer(10, final_init, NULL);
+ (void)alarm(1); /* schedule first timer interrupt */
/*
* Main receive loop.
*/
dummy = 0;
- difftime.tv_usec = 0;
- gettimeofday(&curtime, NULL);
- lasttime = curtime;
for(;;) {
+#ifdef SYSV
+ sigset_t block, oblock;
+#endif
bcopy((char *)&readers, (char *)&rfds, sizeof(rfds));
- secs = timer_nextTimer();
- if (secs == -1)
- timeout = NULL;
- else {
- timeout = &tv;
- timeout->tv_sec = secs;
- timeout->tv_usec = 0;
- }
#ifdef SNMP
- THIS IS BROKEN
+ gettimeofday(nvp, 0);
if (nvp->tv_sec > svp->tv_sec
|| (nvp->tv_sec == svp->tv_sec && nvp->tv_usec > svp->tv_usec)){
alarmTimer(nvp);
@@ -457,98 +339,49 @@ main(argc, argv)
if (block == 1)
tvp = NULL; /* block without timeout */
if ((n = select(nfds, &rfds, NULL, NULL, tvp)) < 0)
+#else
+ if ((n = select(nfds, &rfds, NULL, NULL, NULL)) < 0)
#endif
- if (sighandled) {
- if (sighandled & GOT_SIGINT) {
- sighandled &= ~GOT_SIGINT;
- break;
- }
- if (sighandled & GOT_SIGHUP) {
- sighandled &= ~GOT_SIGHUP;
- restart();
- }
- if (sighandled & GOT_SIGUSR1) {
- sighandled &= ~GOT_SIGUSR1;
- fdump();
- }
- if (sighandled & GOT_SIGUSR2) {
- sighandled &= ~GOT_SIGUSR2;
- cdump();
- }
- }
- if ((n = select(nfds, &rfds, NULL, NULL, timeout)) < 0) {
- if (errno != EINTR)
+ {
+ if (errno != EINTR) /* SIGALRM is expected */
log(LOG_WARNING, errno, "select failed");
continue;
}
- if (n > 0) {
- if (FD_ISSET(igmp_socket, &rfds)) {
- recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
- 0, NULL, &dummy);
- if (recvlen < 0) {
- if (errno != EINTR) log(LOG_ERR, errno, "recvfrom");
- continue;
- }
- accept_igmp(recvlen);
+ if (FD_ISSET(igmp_socket, &rfds)) {
+ recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
+ 0, NULL, &dummy);
+ if (recvlen < 0) {
+ if (errno != EINTR) log(LOG_ERR, errno, "recvfrom");
+ continue;
}
+#ifdef SYSV
+ (void)sigemptyset(&block);
+ (void)sigaddset(&block, SIGALRM);
+ if (sigprocmask(SIG_BLOCK, &block, &oblock) < 0)
+ log(LOG_ERR, errno, "sigprocmask");
+#else
+ omask = sigblock(sigmask(SIGALRM));
+#endif
+ accept_igmp(recvlen);
+#ifdef SYSV
+ (void)sigprocmask(SIG_SETMASK, &oblock, (sigset_t *)NULL);
+#else
+ (void)sigsetmask(omask);
+#endif
+ }
- for (i = 0; i < nhandlers; i++) {
- if (FD_ISSET(ihandlers[i].fd, &rfds)) {
- (*ihandlers[i].func)(ihandlers[i].fd, &rfds);
- }
+ for (i = 0; i < nhandlers; i++) {
+ if (FD_ISSET(ihandlers[i].fd, &rfds)) {
+ (*ihandlers[i].func)(ihandlers[i].fd, &rfds);
}
}
#ifdef SNMP
- THIS IS BROKEN
snmp_read(&rfds);
snmp_timeout(); /* poll */
#endif
- /*
- * Handle timeout queue.
- *
- * If select + packet processing took more than 1 second,
- * or if there is a timeout pending, age the timeout queue.
- *
- * If not, collect usec in difftime to make sure that the
- * time doesn't drift too badly.
- *
- * If the timeout handlers took more than 1 second,
- * age the timeout queue again. XXX This introduces the
- * potential for infinite loops!
- */
- do {
- /*
- * If the select timed out, then there's no other
- * activity to account for and we don't need to
- * call gettimeofday.
- */
- if (n == 0) {
- curtime.tv_sec = lasttime.tv_sec + secs;
- curtime.tv_usec = lasttime.tv_usec;
- n = -1; /* don't do this next time through the loop */
- } else
- gettimeofday(&curtime, NULL);
- difftime.tv_sec = curtime.tv_sec - lasttime.tv_sec;
- difftime.tv_usec += curtime.tv_usec - lasttime.tv_usec;
- while (difftime.tv_usec > 1000000) {
- difftime.tv_sec++;
- difftime.tv_usec -= 1000000;
- }
- if (difftime.tv_usec < 0) {
- difftime.tv_sec--;
- difftime.tv_usec += 1000000;
- }
- lasttime = curtime;
- if (secs == 0 || difftime.tv_sec > 0)
- age_callout_queue(difftime.tv_sec);
- secs = -1;
- } while (difftime.tv_sec > 0);
}
- log(LOG_NOTICE, 0, "%s exiting", versionstring);
- cleanup();
- exit(0);
}
static void
@@ -559,28 +392,6 @@ usage()
exit(1);
}
-static void
-final_init(i)
- void *i;
-{
- char *s = (char *)i;
-
- log(LOG_NOTICE, 0, "%s%s", versionstring, s ? s : "");
- if (s)
- free(s);
-
- k_init_dvmrp(); /* enable DVMRP routing in kernel */
-
- /*
- * Install the vifs in the kernel as late as possible in the
- * initialization sequence.
- */
- init_installvifs();
-
- time(&mrouted_init_time);
- did_final_init = 1;
-}
-
/*
* routine invoked every second. Its main goal is to cycle through
* the routing table and send partial updates to all neighbors at a
@@ -590,7 +401,7 @@ final_init(i)
*/
static void
fasttimer(i)
- void *i;
+ int i;
{
static unsigned int tlast;
static unsigned int nsent;
@@ -619,8 +430,12 @@ fasttimer(i)
}
tlast = t;
}
+ if ((t % TIMER_INTERVAL) == 0)
+ timer();
- timer_setTimer(1, fasttimer, NULL);
+ age_callout_queue();/* Advance the timer for the callout queue
+ for groups */
+ alarm(1);
}
/*
@@ -640,7 +455,7 @@ fasttimer(i)
* avoid unwanted synchronization with other routers.
*/
-u_long virtual_time = 0;
+static u_long virtual_time = 0;
/*
@@ -649,14 +464,13 @@ u_long virtual_time = 0;
* virtual interface data structures.
*/
static void
-timer(i)
- void *i;
+timer()
{
age_routes(); /* Advance the timers in the route entries */
age_vifs(); /* Advance the timers for neighbors */
age_table_entry(); /* Advance the timers for the cache entries */
- if (virtual_time % IGMP_QUERY_INTERVAL == 0) {
+ if (virtual_time % GROUP_QUERY_INTERVAL == 0) {
/*
* Time to query the local group memberships on all subnets
* for which this router is the elected querier.
@@ -695,10 +509,21 @@ timer(i)
* Advance virtual time
*/
virtual_time += TIMER_INTERVAL;
- timer_setTimer(TIMER_INTERVAL, timer, NULL);
}
+/*
+ * On termination, let everyone know we're going away.
+ */
+static void
+done(i)
+ int i;
+{
+ log(LOG_NOTICE, 0, "%s exiting", versionstring);
+ cleanup();
+ _exit(1);
+}
+
static void
cleanup()
{
@@ -711,76 +536,34 @@ cleanup()
#endif /* RSRR */
expire_all_routes();
report_to_all_neighbors(ALL_ROUTES);
- if (did_final_init)
- k_stop_dvmrp();
+ k_stop_dvmrp();
}
}
-/*
- * Signal handler. Take note of the fact that the signal arrived
- * so that the main loop can take care of it.
- */
-static void
-handler(sig)
- int sig;
-{
- switch (sig) {
- case SIGINT:
- case SIGTERM:
- sighandled |= GOT_SIGINT;
- break;
-
- case SIGHUP:
- sighandled |= GOT_SIGHUP;
- break;
-
- case SIGUSR1:
- sighandled |= GOT_SIGUSR1;
- break;
-
- case SIGUSR2:
- sighandled |= GOT_SIGUSR2;
- break;
- }
-}
/*
* Dump internal data structures to stderr.
*/
static void
-dump()
+dump(i)
+ int i;
{
dump_vifs(stderr);
dump_routes(stderr);
}
-static void
-dump_version(fp)
- FILE *fp;
-{
- time_t t;
-
- time(&t);
- fprintf(fp, "%s ", versionstring);
- if (did_final_init)
- fprintf(fp, "up %s",
- scaletime(t - mrouted_init_time));
- else
- fprintf(fp, "(not yet initialized)");
- fprintf(fp, " %s\n", ctime(&t));
-}
/*
* Dump internal data structures to a file.
*/
static void
-fdump()
+fdump(i)
+ int i;
{
FILE *fp;
fp = fopen(dumpfilename, "w");
if (fp != NULL) {
- dump_version(fp);
dump_vifs(fp);
dump_routes(fp);
(void) fclose(fp);
@@ -792,13 +575,13 @@ fdump()
* Dump local cache contents to a file.
*/
static void
-cdump()
+cdump(i)
+ int i;
{
FILE *fp;
fp = fopen(cachefilename, "w");
if (fp != NULL) {
- dump_version(fp);
dump_cache(fp);
(void) fclose(fp);
}
@@ -809,42 +592,52 @@ cdump()
* Restart mrouted
*/
static void
-restart()
+restart(i)
+ int i;
{
- char *s;
+ register int omask;
+#ifdef SYSV
+ sigset_t block, oblock;
+#endif
- s = (char *)malloc(sizeof(" restart"));
- if (s == NULL)
- log(LOG_ERR, 0, "out of memory");
- strcpy(s, " restart");
+ log(LOG_NOTICE, 0, "%s restart", versionstring);
/*
* reset all the entries
*/
+#ifdef SYSV
+ (void)sigemptyset(&block);
+ (void)sigaddset(&block, SIGALRM);
+ if (sigprocmask(SIG_BLOCK, &block, &oblock) < 0)
+ log(LOG_ERR, errno, "sigprocmask");
+#else
+ omask = sigblock(sigmask(SIGALRM));
+#endif
free_all_prunes();
free_all_routes();
- free_all_callouts();
stop_all_vifs();
k_stop_dvmrp();
close(igmp_socket);
close(udp_socket);
- did_final_init = 0;
/*
* start processing again
*/
dvmrp_genid++;
+ pruning = 1;
init_igmp();
init_routes();
init_ktable();
init_vifs();
- /*XXX Schedule final_init() as main does? */
- final_init(s);
+ k_init_dvmrp(); /* enable DVMRP routing in kernel */
+ init_installvifs();
- /* schedule timer interrupts */
- timer_setTimer(1, fasttimer, NULL);
- timer_setTimer(TIMER_INTERVAL, timer, NULL);
+#ifdef SYSV
+ (void)sigprocmask(SIG_SETMASK, &oblock, (sigset_t *)NULL);
+#else
+ (void)sigsetmask(omask);
+#endif
}
#define LOG_MAX_MSGS 20 /* if > 20/minute then shut up for a while */
@@ -870,61 +663,6 @@ resetlogging(arg)
timer_setTimer(nxttime, resetlogging, narg);
}
-char *
-scaletime(t)
- u_long t;
-{
-#define SCALETIMEBUFLEN 20
- static char buf1[20];
- static char buf2[20];
- static char *buf = buf1;
- char *p;
-
- p = buf;
- if (buf == buf1)
- buf = buf2;
- else
- buf = buf1;
-
- /* XXX snprintf */
- sprintf(p, "%2ld:%02ld:%02ld", t / 3600, (t % 3600) / 60, t % 60);
- p[SCALETIMEBUFLEN - 1] = '\0';
- return p;
-}
-
-#ifdef RINGBUFFER
-#define NLOGMSGS 10000
-#define LOGMSGSIZE 200
-char *logmsg[NLOGMSGS];
-static int logmsgno = 0;
-
-void
-printringbuf()
-{
- FILE *f;
- int i;
-
- f = fopen("/var/tmp/mrouted.log", "a");
- if (f == NULL) {
- log(LOG_ERR, errno, "can't open /var/tmp/mrouted.log");
- /*NOTREACHED*/
- }
- fprintf(f, "--------------------------------------------\n");
-
- i = (logmsgno + 1) % NLOGMSGS;
-
- while (i != logmsgno) {
- if (*logmsg[i]) {
- fprintf(f, "%s\n", logmsg[i]);
- *logmsg[i] = '\0';
- }
- i = (i + 1) % NLOGMSGS;
- }
-
- fclose(f);
-}
-#endif
-
/*
* Log errors and other messages to the system log daemon and to stderr,
* according to the severity of the message and the current debug level.
@@ -937,12 +675,10 @@ log(int severity, int syserr, char *format, ...)
va_list ap;
static char fmt[211] = "warning - ";
char *msg;
+ char tbuf[20];
struct timeval now;
time_t now_sec;
struct tm *thyme;
-#ifdef RINGBUFFER
- static int ringbufinit = 0;
-#endif
va_start(ap, format);
#else
@@ -954,15 +690,12 @@ log(severity, syserr, format, va_alist)
va_dcl
{
va_list ap;
- static char fmt[311] = "warning - ";
+ static char fmt[211] = "warning - ";
char *msg;
char tbuf[20];
struct timeval now;
time_t now_sec;
struct tm *thyme;
-#ifdef RINGBUFFER
- static int ringbufinit = 0;
-#endif
va_start(ap);
#endif
@@ -970,68 +703,36 @@ log(severity, syserr, format, va_alist)
va_end(ap);
msg = (severity == LOG_WARNING) ? fmt : &fmt[10];
-#ifdef RINGBUFFER
- if (!ringbufinit) {
- int i;
+ switch (debug) {
+ case 0: break;
+ case 1: if (severity > LOG_NOTICE) break;
+ case 2: if (severity > LOG_INFO ) break;
+ default:
+ gettimeofday(&now,NULL);
+ now_sec = now.tv_sec;
+ thyme = localtime(&now_sec);
+ strftime(tbuf, sizeof(tbuf), "%X.%%03d ", thyme);
+ fprintf(stderr, tbuf, now.tv_usec / 1000);
+ fprintf(stderr, "%s", msg);
+ if (syserr == 0)
+ fprintf(stderr, "\n");
+ else if (syserr < sys_nerr)
+ fprintf(stderr, ": %s\n", sys_errlist[syserr]);
+ else
+ fprintf(stderr, ": errno %d\n", syserr);
+ }
- for (i = 0; i < NLOGMSGS; i++) {
- logmsg[i] = malloc(LOGMSGSIZE);
- if (logmsg[i] == 0) {
- syslog(LOG_ERR, "out of memory");
- exit(-1);
- }
- *logmsg[i] = 0;
+ if (severity <= LOG_NOTICE) {
+ if (log_nmsgs++ < LOG_MAX_MSGS) {
+ if (syserr != 0) {
+ errno = syserr;
+ syslog(severity, "%s: %m", msg);
+ } else
+ syslog(severity, "%s", msg);
}
- ringbufinit = 1;
- }
- gettimeofday(&now,NULL);
- now_sec = now.tv_sec;
- thyme = localtime(&now_sec);
- sprintf(logmsg[logmsgno++], "%02d:%02d:%02d.%03ld %s err %d",
- thyme->tm_hour, thyme->tm_min, thyme->tm_sec,
- now.tv_usec / 1000, msg, syserr);
- logmsgno %= NLOGMSGS;
- if (severity <= LOG_NOTICE)
-#endif
- /*
- * Log to stderr if we haven't forked yet and it's a warning or worse,
- * or if we're debugging.
- */
- if (haveterminal && (debug || severity <= LOG_WARNING)) {
- gettimeofday(&now,NULL);
- now_sec = now.tv_sec;
- thyme = localtime(&now_sec);
- if (!debug)
- fprintf(stderr, "%s: ", progname);
- fprintf(stderr, "%02d:%02d:%02d.%03ld %s", thyme->tm_hour,
- thyme->tm_min, thyme->tm_sec, now.tv_usec / 1000, msg);
- if (syserr == 0)
- fprintf(stderr, "\n");
- else if (syserr < sys_nerr)
- fprintf(stderr, ": %s\n", sys_errlist[syserr]);
- else
- fprintf(stderr, ": errno %d\n", syserr);
- }
- /*
- * Always log things that are worse than warnings, no matter what
- * the log_nmsgs rate limiter says.
- * Only count things worse than debugging in the rate limiter
- * (since if you put daemon.debug in syslog.conf you probably
- * actually want to log the debugging messages so they shouldn't
- * be rate-limited)
- */
- if ((severity < LOG_WARNING) || (log_nmsgs < LOG_MAX_MSGS)) {
- if (severity < LOG_DEBUG)
- log_nmsgs++;
- if (syserr != 0) {
- errno = syserr;
- syslog(severity, "%s: %m", msg);
- } else
- syslog(severity, "%s", msg);
+ if (severity <= LOG_ERR) exit(1);
}
-
- if (severity <= LOG_ERR) exit(-1);
}
#ifdef DEBUG_MFC
diff --git a/usr.sbin/mrouted/mapper.c b/usr.sbin/mrouted/mapper.c
index 0a5f33cfcd9c..e440bbcb9b30 100644
--- a/usr.sbin/mrouted/mapper.c
+++ b/usr.sbin/mrouted/mapper.c
@@ -1,7 +1,5 @@
/* Mapper for connections between MRouteD multicast routers.
* Written by Pavel Curtis <Pavel@PARC.Xerox.Com>
- *
- * mapper.c,v 3.8.4.3 1998/01/06 01:57:47 fenner Exp
*/
/*
@@ -23,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: mapper.c,v 1.13 1998/06/09 05:01:30 imp Exp $";
+ "$Id: mapper.c,v 1.12 1998/01/16 07:17:43 charnier Exp $";
#endif /* not lint */
#include <err.h>
@@ -912,7 +910,7 @@ int main(argc, argv)
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
-#ifdef HAVE_SA_LEN
+#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
#endif
addr.sin_addr.s_addr = dvmrp_group;
diff --git a/usr.sbin/mrouted/mrinfo.c b/usr.sbin/mrouted/mrinfo.c
index ff8a7b85604c..b62249e080de 100644
--- a/usr.sbin/mrouted/mrinfo.c
+++ b/usr.sbin/mrouted/mrinfo.c
@@ -61,7 +61,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: mrinfo.c,v 1.15 1998/06/09 05:01:34 imp Exp $";
+ "$Id: mrinfo.c,v 1.14 1998/01/16 07:17:43 charnier Exp $";
/* original rcsid:
"@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)";
*/
@@ -238,14 +238,13 @@ accept_neighbors2(src, dst, p, datalen, level)
u_char *ep = p + datalen;
u_int broken_cisco = ((level & 0xffff) == 0x020a); /* 10.2 */
/* well, only possibly_broken_cisco, but that's too long to type. */
- u_int majvers = level & 0xff;
- u_int minvers = (level >> 8) & 0xff;
- printf("%s (%s) [", inet_fmt(src, s1), inet_name(src));
- if (majvers == 3 && minvers == 0xff)
- printf("DVMRPv3 compliant");
- else
- printf("version %d.%d", majvers, minvers);
+ printf("%s (%s) [version %d.%d", inet_fmt(src, s1), inet_name(src),
+ level & 0xff, (level >> 8) & 0xff);
+ if ((level >> 16) & NF_LEAF) { printf (",leaf"); }
+ if ((level >> 16) & NF_PRUNE) { printf (",prune"); }
+ if ((level >> 16) & NF_GENID) { printf (",genid"); }
+ if ((level >> 16) & NF_MTRACE) { printf (",mtrace"); }
printf ("]:\n");
while (p < ep) {
@@ -398,7 +397,7 @@ main(argc, argv)
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
-#ifdef HAVE_SA_LEN
+#if (defined(BSD) && (BSD >= 199103))
addr.sin_len = sizeof addr;
#endif
addr.sin_addr.s_addr = target_addr;
@@ -491,11 +490,7 @@ main(argc, argv)
src = ip->ip_src.s_addr;
dst = ip->ip_dst.s_addr;
iphdrlen = ip->ip_hl << 2;
-#ifdef RAW_INPUT_IS_RAW
- ipdatalen = ntohs(ip->ip_len) - iphdrlen;
-#else
ipdatalen = ip->ip_len;
-#endif
if (iphdrlen + ipdatalen != recvlen) {
log(LOG_WARNING, 0,
"packet shorter (%u bytes) than hdr+data length (%u+%u)",
diff --git a/usr.sbin/mrouted/mrouted.8 b/usr.sbin/mrouted/mrouted.8
index 823ad87f1976..c30cd3b34a3d 100644
--- a/usr.sbin/mrouted/mrouted.8
+++ b/usr.sbin/mrouted/mrouted.8
@@ -1,5 +1,5 @@
.\"COPYRIGHT 1989 by The Board of Trustees of Leland Stanford Junior University.
-.\"$Id: mrouted.8,v 1.11 1998/08/31 16:41:08 wosch Exp $
+.\"$Id: mrouted.8,v 1.10 1997/09/30 06:15:10 charnier Exp $
.Dd May 8, 1995
.Dt MROUTED 8
.UC 5
@@ -34,17 +34,17 @@ routers that do not support IP multicasting,
.Nm
includes support for
"tunnels", which are virtual point-to-point links between pairs of
-multicast routers
+.Nm mrouted Ns s
located anywhere in an internet. IP multicast packets are encapsulated for
transmission through tunnels, so that they look like normal unicast datagrams
to intervening routers and subnets. The encapsulation
is added on entry to a tunnel, and stripped off
on exit from a tunnel.
-The packets are encapsulated using the IP-in-IP protocol
+By default, the packets are encapsulated using the IP-in-IP protocol
(IP protocol number 4).
Older versions of
.Nm
-tunneled using IP source routing, which puts a heavy load on some
+tunnel using IP source routing, which puts a heavy load on some
types of routers.
This version does not support IP source route tunnelling.
.Pp
@@ -81,42 +81,25 @@ option is given, or if the debug level is specified as 0,
.Nm
detaches from the invoking terminal. Otherwise, it remains attached to the
invoking terminal and responsive to signals from that terminal.
-Regardless of the debug level,
+If
+.Fl d
+is given with no argument, the debug level defaults to 2. Regardless of the
+debug level,
.Nm
always writes warning and error messages to the system
-log demon. The
-.Fl debug-level
-argument is a comma-seperated list of any of the following:
+log demon. Non-zero debug levels have the following effects:
.Bl -tag -width indent
-.It "packet"
-Display the type, source and destination of all packets sent or received.
-.It "pruning"
-Display more information about prunes sent or received.
-.It "routing"
-Display more information about routing update packets sent or received.
-.It "route_detail"
-Display routing updates in excruciating detail. This is generally way too
-much information.
-.It "neighbors"
-Display information about neighbor discovery.
-.It "cache"
-Display insertions, deletions and refreshes of entries in
-the kernel forwarding cache.
-.It "timeout"
-Debug timeouts and periodic processes.
-.It "interface"
-Display information about interfaces and their configuration.
-.It "membership"
-Display information about group memberships on physical interfaces.
-.It "traceroute"
-Display information about multicast traceroute requests
-passing through this router.
-.It "igmp"
-Display IGMP operation including group membership and querier election.
-.It "icmp"
-Monitor ICMP handling.
-.It "rsrr"
-Monitor RSRR operation.
+.It "level 1"
+all syslog'ed messages are also printed to stderr.
+.It "level 2"
+all level 1 messages plus notifications of "significant"
+events are printed to stderr.
+.It "level 3"
+all level 2 messages plus notifications of all packet
+arrivals and departures are printed to stderr.
+.El
+.It Fl p
+Disable pruning.
.El
.Pp
Upon startup,
@@ -127,246 +110,106 @@ writes its pid to the file
.Nm Mrouted
automatically configures itself to forward on all multicast-capable
interfaces, i.e., interfaces that have the IFF_MULTICAST flag set (excluding
-the loopback "interface"), and it finds other DVMRP routers directly reachable
+the loopback "interface"), and it finds other
+.Nm mrouted Ns s
+directly reachable
via those interfaces. To override the default configuration, or to add
-tunnel links to other multicast routers,
+tunnel links to other
+.Nm mrouted Ns s,
configuration commands may be placed in
.Pa /etc/mrouted.conf
(or an alternative file, specified by the
.Fl c
option).
+There are four types of configuration commands:
+.nf
+
+ phyint <local-addr> [disable] [metric <m>] [advert_metric <m>]
+ [threshold <t>] [rate_limit <b>]
+ [boundary (<boundary-name>|<scoped-addr>/<mask-len>)]
+ [altnet <network>/<mask-len>]
+
+ tunnel <local-addr> <remote-addr> [metric <m>] [advert_metric <m>]
+ [threshold <t>] [rate_limit <b>]
+ [boundary (<boundary-name>|<scoped-addr>/<mask-len>)]
+
+ cache_lifetime <ct>
+
+ name <boundary-name> <scoped-addr>/<mask-len>
+
+.fi
.Pp
The file format is free-form; whitespace (including newlines) is not
significant.
-The file begins with commands that apply to
-.IR mrouted 's
-overall operation or set defaults.
-.Bl -tag -width indent
-.It cache_lifetime Ar secs
-Specifies, in seconds, the lifetime of a multicast forwarding cache
-entry in the kernel. Multicast forwarding cache entries in the kernel
-are checked every
-.Ar secs
-seconds, and are refreshed if the source is still
-active or deleted if not. Care should be taken when setting this value,
-as a low value can keep the kernel cache small at the cost of "thrashing"
-the cache for periodic senders, but high values can cause the kernel
-cache to grow unacceptably large. The default is 300 seconds (5 minutes).
-.It prune_lifetime Ar secs
-Sepcifies, in seconds, the average lifetime of prunes that are sent towards
-parents. The actual lifetimes will be randomized in the range
-[.5\fIsecs\fP,1.5\fIsecs\fP]. The default is 7200 (2 hours). Smaller values
-cause less state to be kept both at this router and the parent, at the
-cost of more frequent broadcasts. However, some routers (e.g. mrouted <3.3
-and all currently known versions of cisco's IOS) do not use the
-DVMRP generation ID to determine that a neighbor has rebooted. Prunes
-sent towards these neighbors should be kept short, in order to shorten
-the time to recover from a reboot. For use in this situation, the
-prune_lifetime keyword may be specified on an interface as described
-below.
-.It noflood
-.Nm Mrouted
-uses a DVMRP optimization to prevent having to keep individual routing tables
-for each neighbor; part of this optimization is that
-.Nm
-assumes that it is the forwarder for each of its attached subnets on
-startup. This can cause duplicates for a short period (approximately
-one full route report interval), since both the router that just
-started up and the proper forwarder will be forwarding traffic. This
-behavior can be turned off with the noflood keyword;
-.Nm
-will not assume that it is the forwarder on startup.
-Turning on noflood can cause black holes on restart, which will generally
-last approximately one full route report interval.
-The noflood keyword can also be specified on individual interfaces.
-.It rexmit_prunes Ar [on|off]
-.Nm Mrouted 's
-default is to retransmit prunes on all point-to-point interfaces
-(including tunnels) but no multi-access interfaces. This option
-may be used to make the default on (or off) for all interfaces.
-The rexmit_prunes keyword can also be specified on individual interfaces.
-.It name Ar "boundary-name scoped-addr/mask-len"
-Associates
-.Ar boundary-name
-with the boundary described by
-.Ar scoped-addr/mask-len ,
-to help make interface configurations
-more readable and reduce repetition in the configuration file.
-.El
+The
+.Em boundary
+and
+.Em altnet
+options may be specified as many times as necessary.
.Pp
-The second section of the configuration file, which may optionally
-be empty, describes options that apply to physical interfaces.
-.Bl -tag -width indent
-.It phyint Ar "local-addr|ifname"
-The phyint command does nothing by itself; it is simply a place holder
-which interface-specific commands may follow. An interface address or
-name may be specified.
-.It disable
-Disables multicast forwarding on this interface. By default,
-.Nm
-discovers all locally attached multicast capable interfaces and forwards
-on all of them.
-.It netmask Ar netmask
-If the kernel's netmask does not accurately reflect
-the subnet (e.g. you're using proxy-ARP in lieu of IP subnetting), use the
-netmask command to describe the real netmask.
-.It altnet Ar network/mask-len
+The phyint command can be used to disable multicast routing on the physical
+interface identified by local IP address <local-addr>, or to associate a
+non-default metric or threshold with the specified physical interface.
+The local IP address <local-addr> may be replaced by the
+interface name (e.g le0).
If a phyint is attached to multiple IP subnets, describe each additional subnet
-with the altnet keyword. This command may be specified multiple times
-to describe multiple subnets.
-.It igmpv1
-If there are any IGMPv1 routers on the phyint, use the \fBigmpv1\fP
-keyword to force
-.Nm
-into IGMPv1 mode. All routers on the phyint
-must use the same version of IGMP.
-.It force_leaf
-Force
-.Nm
-to ignore other routers on this interface.
-mrouted will never send or accept neighbor probes or
-route reports on this interface.
-.El
+with the altnet keyword.
+Phyint commands must precede tunnel commands.
.Pp
-In addition, the common vif commands described later may all be used on
-a phyint.
+The tunnel command can be used to establish a tunnel link between local
+IP address <local-addr> and remote IP address <remote-addr>, and to associate
+a non-default metric or threshold with that tunnel.
+The local IP address <local-addr> may be replaced by the
+interface name (e.g. le0). The remote IP address <remote-addr> may
+be replaced by a host name, if and only if the host name has a single
+IP address associated with it.
+The tunnel must be set
+up in the
+.Pa mrouted.conf
+files of both routers before it can be used.
.Pp
-The third section of the configuration file, also optional, describes
-the configuration of any DVMRP tunnels this router might have.
-.Bl -tag -width indent
-.It tunnel Ar "local-addr|ifname" Ar "remote-addr|remote-hostname"
-This command establishes a DVMRP tunnel between this host (on the interface
-described by
-.Ar local-addr
-or
-.Ar ifname )
-and a remote host (identified by
-.Ar remote-addr
-or
-.Ar remote-hostname ).
-A remote hostname may only be used if
-it maps to a single IP address.
-A tunnel must be configured on both routers before it can be used.
-
-Be careful that the unicast route to the remote address goes out the
-interface specified by the
-.Ar "local-addr|ifname"
-argument. Some UNIX
-kernels rewrite the source address of
-.Nm mrouted 's
-packets on their way out to contain the address of the transmission
-interface. This is best assured via a static host route.
-.El
+The cache_lifetime is a value that determines the amount of time that a
+cached multicast route stays in kernel before timing out. The value of this
+entry should lie between 300 (5 min) and 86400 (1 day). It defaults to 300.
.Pp
-The common vif commands described below
-may all be used on tunnels or phyints.
-.Bl -tag -width indent
-.It metric Ar m
-The metric is the "cost" associated with receiving a datagram on the given
+You may assign names to boundaries to make configuration easier with
+the name keyword. The boundary option on phyint or tunnel commands
+can accept either a name or a boundary.
+.Pp
+The metric is the "cost" associated with sending a datagram on the given
interface or tunnel; it may be used to influence the choice of routes.
The metric defaults to 1. Metrics should be kept as small as possible,
-because DVMRP cannot route along paths with a sum of metrics greater
+because
+.Nm
+cannot route along paths with a sum of metrics greater
than 31.
-.It advert_metric Ar m
-The advert_metric is the "cost" associated with sending a datagram
+.Pp
+The advert_metric is the "cost" associated with receiving a datagram
on the given interface or tunnel; it may be used to influence the choice
of routes. The advert_metric defaults to 0. Note that the effective
metric of a link is one end's metric plus the other end's advert_metric.
-.It threshold Ar t
+.Pp
The threshold is the minimum IP time-to-live required for a multicast datagram
to be forwarded to the given interface or tunnel. It is used to control the
scope of multicast datagrams. (The TTL of forwarded packets is only compared
to the threshold, it is not decremented by the threshold. Every multicast
-router decrements the TTL by exactly 1.) The default threshold is 1.
-
-In general, all multicast routers
+router decrements the TTL by 1.) The default threshold is 1.
+.Pp
+In general, all
+.Nm mrouted Ns s
connected to a particular subnet or tunnel should
use the same metric and threshold for that subnet or tunnel.
-.It rate_limit Ar r
+.Pp
The rate_limit option allows the network administrator to specify a
certain bandwidth in Kbits/second which would be allocated to multicast
-traffic. It defaults 0 (unlimited).
-.It boundary Ar "boundary-name|scoped-addr/mask-len"
+traffic. It defaults to 500Kbps on tunnels, and 0 (unlimited) on physical
+interfaces.
+.Pp
The boundary option allows an interface
to be configured as an administrative boundary for the specified
scoped address. Packets belonging to this address will not
be forwarded on a scoped interface. The boundary option accepts either
-a name or a boundary spec. This command may be specified several times
-on an interface in order to describe multiple boundaries.
-.It passive
-No packets will be sent on this link or tunnel until we hear from the other
-end. This is useful for the "server" end of a tunnel that goes over
-a dial-on-demand link; configure the "server" end as passive and
-it will not send its periodic probes until it hears one from the other
-side, so will not keep the link up. If this option is specified on both
-ends of a tunnel, the tunnel will never come up.
-.It noflood
-As described above, but only applicable to this interface/tunnel.
-.It prune_lifetime Ar secs
-As described above, but only applicable to this interface/tunnel.
-.It rexmit_prunes Ar "[on|off]"
-As described above, but only applicable to this interface/tunnel.
-Recall that prune retransmission
-defaults to on on point-to-point links and tunnels, and off on
-multi-access links.
-.It allow_nonpruners
-By default,
-.Nm
-refuses to peer with DVMRP neighbors that
-do not claim to support pruning. This option allows such peerings
-on this interface.
-.It notransit
-A specialized case of route filtering; no route learned from an interface
-marked "notransit" will be advertised on another interface marked
-"notransit". Marking only a single interface "notransit" has no meaning.
-.It accept|deny Ar "(route/mask-len [exact])+" Op bidir
-The
-.Li accept
-and
-.Li deny
-commands allow rudimentary route filtering. The
-.Li accept
-command causes
-.Nm
-to accept only the listed routes on the configured interface; the
-.Li deny
-command causes
-.Nm
-to accept all but the listed routes.
-Only one of
-.Li accept
-or
-.Li deny
-commands may be used on a given interface.
-
-The list of routes follows the
-.Li accept
-or
-.Li deny
-keyword. If the keyword
-.Ar exact
-follows a route, then only that route is matched; otherwise, that route
-and any more specific route is matched. For example,
-.Li deny 0/0
-denys all routes, while
-.Li deny 0/0 exact
-denys only the default route. The default route may also be specified
-with the
-.Li default
-keyword.
-
-The
-.Ar bidir
-keyword enables bidirectional route filtering; the filter will be applied
-to routes on both output and input. Without the
-.Ar bidir
-keyword,
-.Li accept
-and
-.Li deny
-filters are only applied on input. Poison reverse routes are never
-filtered out.
-.El
+a name or a boundary spec.
.Pp
.Nm Mrouted
will not initiate execution if it has fewer than two enabled vifs,
@@ -375,7 +218,7 @@ interface or a tunnel. It will log a warning if all of its vifs are
tunnels; such an
.Nm
configuration would be better replaced by more
-direct tunnels (i.e. eliminate the middle man).
+direct tunnels (i.e., eliminate the middle man).
.Sh "EXAMPLE CONFIGURATION"
This is an example configuration for a mythical multicast router at a big
school.
@@ -447,17 +290,16 @@ upon startup.
.Sh EXAMPLE
The routing tables look like this:
.nf
-.ft C
Virtual Interface Table
Vif Local-Address Metric Thresh Flags
- 0 36.2.0.8 subnet: 36.2/16 1 1 querier
+ 0 36.2.0.8 subnet: 36.2 1 1 querier
groups: 224.0.2.1
224.0.0.4
pkts in: 3456
pkts out: 2322323
- 1 36.11.0.1 subnet: 36.11/16 1 1 querier
+ 1 36.11.0.1 subnet: 36.11 1 1 querier
groups: 224.0.2.1
224.0.1.0
224.0.0.4
@@ -465,9 +307,9 @@ Virtual Interface Table
pkts out: 3456
2 36.2.0.8 tunnel: 36.8.0.77 3 1
- peers: 36.8.0.77 (3.255)
- boundaries: 239.0.1/24
- : 239.1.2/24
+ peers: 36.8.0.77 (2.2)
+ boundaries: 239.0.1
+ : 239.1.2
pkts in: 34545433
pkts out: 234342
@@ -483,7 +325,6 @@ Multicast Routing Table (1136 entries)
.
.fi
-.Pp
In this example, there are four vifs connecting to two subnets and two
tunnels. The vif 3 tunnel is not in use (no peer address). The vif 0 and
vif 1 subnets have some groups present; tunnels never have any groups. This
@@ -511,7 +352,6 @@ are created and deleted by
.Pp
The cache tables look like this:
.nf
-.ft C
Multicast Routing Cache Table (147 entries)
Origin Mcast-group CTmr Age Ptmr IVif Forwvifs
@@ -526,14 +366,14 @@ Multicast Routing Cache Table (147 entries)
>198.106.194.22
.fi
-.Pp
Each entry is characterized by the origin subnet number and mask and the
destination multicast group.
.Pp
The 'CTmr' field indicates the lifetime
of the entry. The entry is deleted from the cache table
-(or refreshed, if traffic is flowing)
-when the timer decrements to zero. The 'Age' field is the time since
+when the timer decrements to zero.
+.Pp
+The 'Age' field is the time since
this cache entry was originally created. Since cache entries get refreshed
if traffic is flowing, routing entries can grow very old.
.Pp
@@ -551,7 +391,7 @@ indicated by a "P" after the vif number.
The Forwvifs field shows the
interfaces along which datagrams belonging to the source-group are
forwarded. A "p" indicates that no datagrams are being forwarded along
-that interface. An unlisted interface is a leaf subnet with no
+that interface. An unlisted interface is a leaf subnet with are no
members of the particular group on that subnet. A "b" on an interface
indicates that it is a boundary interface, i.e. traffic will not be
forwarded on the scoped address on that interface.
@@ -559,9 +399,6 @@ forwarded on the scoped address on that interface.
An additional line with a ">" as the first character is printed for
each source on the subnet. Note that there can be many sources in
one subnet.
-An additional line with a "<" as the first character is printed
-describing any prunes received from downstream dependent neighbors
-for this subnet and group.
.Sh FILES
.Bl -tag -width /var/tmp/mrouted.cache -compact
.It Pa /etc/mrouted.conf
diff --git a/usr.sbin/mrouted/mrouted.conf b/usr.sbin/mrouted/mrouted.conf
index d016f4823893..1e6924422233 100644
--- a/usr.sbin/mrouted/mrouted.conf
+++ b/usr.sbin/mrouted/mrouted.conf
@@ -1,5 +1,4 @@
-# $Id: mrouted.conf,v 1.7 1997/02/22 16:07:00 peter Exp $
-# mrouted.conf,v 3.8 1995/11/29 22:40:47 fenner Rel
+# $Id$
#
# This is the configuration file for "mrouted", an IP multicast router.
# mrouted looks for it in "/etc/mrouted.conf".
diff --git a/usr.sbin/mrouted/mrouted/Makefile b/usr.sbin/mrouted/mrouted/Makefile
index 1694495b4dc9..943781085edb 100644
--- a/usr.sbin/mrouted/mrouted/Makefile
+++ b/usr.sbin/mrouted/mrouted/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/05/05 13:19:13 bde Exp $
+# $Id: Makefile,v 1.9 1998/05/04 19:54:56 bde Exp $
PROG= mrouted
@@ -9,13 +9,7 @@ YFLAGS=
DPADD= ${LIBMROUTED}
LDADD= ${LIBMROUTED}
-SRCS= config.c cfparse.y main.c route.c vif.c prune.c callout.c rsrr.c \
- ipip.c icmp.c vers.c
-CLEANFILES+= vers.c
+SRCS= config.c cfparse.y main.c route.c vif.c prune.c callout.c rsrr.c
MAN8= mrouted.8
-vers.c: $S/VERSION
- rm -f vers.c ; \
- sed 's/.*/char todaysversion[] = "&";/' $S/VERSION > vers.c
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/mrouted/mtrace.8 b/usr.sbin/mrouted/mtrace.8
index 4cfaf30bba5b..df58f5a7a3b0 100644
--- a/usr.sbin/mrouted/mtrace.8
+++ b/usr.sbin/mrouted/mtrace.8
@@ -29,7 +29,7 @@
.\" Copyright (c) 1988 The Regents of the University of California.
.\" All rights reserved.
.\"
-.\" mtrace.8,v 5.2 1998/12/04 04:48:16 fenner Exp
+.\" mtrace.8,v 5.1 1996/12/19 21:31:26 fenner Exp
.\"
.Dd May 8, 1995
.Dt MTRACE 8
@@ -80,7 +80,7 @@ host name or address. The default
.Ar receiver
is the host running mtrace, and the default
.Ar group
-is 0.0.0.0, which is sufficient if packet loss
+is "MBone Audio" (224.2.0.1), which is sufficient if packet loss
statistics for a particular multicast group are not needed. These two
optional parameters may be specified to test the path to some other
receiver in a particular group, subject to some constraints as
diff --git a/usr.sbin/mrouted/mtrace.c b/usr.sbin/mrouted/mtrace.c
index 0018aec81de6..1686451b7365 100644
--- a/usr.sbin/mrouted/mtrace.c
+++ b/usr.sbin/mrouted/mtrace.c
@@ -96,24 +96,11 @@
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
*
- *
- * The mtrace program has been modified and improved by Xerox
- * Corporation. Xerox grants to LICENSEE a non-exclusive and
- * non-transferable license to use, copy, and modify the Xerox modified
- * and improved mrouted software on the same terms and conditions which
- * govern the license Stanford and ISI grant with respect to the mtrace
- * program. These terms and conditions are incorporated in this grant
- * by reference and shall be deemed to have been accepted by LICENSEE
- * to cover its relationship with Xerox Corporation with respect to any
- * use of the Xerox improved program.
- *
- * The mtrace program is COPYRIGHT 1998 by Xerox Corporation.
- *
*/
#ifndef lint
static const char rcsid[] =
- "$Id: mtrace.c,v 1.15 1998/06/29 17:51:39 bde Exp $";
+ "$Id: mtrace.c,v 1.14 1998/06/09 05:01:35 imp Exp $";
#endif
#include <ctype.h>
@@ -150,12 +137,13 @@ static const char rcsid[] =
#endif
typedef unsigned int u_int32; /* XXX */
+
#include "mtrace.h"
#define DEFAULT_TIMEOUT 3 /* How long to wait before retrying requests */
#define DEFAULT_RETRIES 3 /* How many times to try */
#define DEFAULT_EXTRAHOPS 3 /* How many hops past a non-responding rtr */
-#define MAXHOPS 60 /* Don't need more hops than this */
+#define MAXHOPS 32 /* Don't need more hops than max metric */
#define UNICAST_TTL 255 /* TTL for unicast response */
#define MULTICAST_TTL1 127 /* Default TTL for multicast query/response */
#define MULTICAST_TTL_INC 32 /* TTL increment for increase after timeout */
@@ -191,8 +179,7 @@ struct resp_buf {
#define resps u.t.r
#define ndata u.d
-char *names[MAXHOPS];
-
+char names[MAXHOPS][40];
/*
* In mrouted 3.3 and 3.4 (and in some Cisco IOS releases),
* cache entries can get deleted even if there is traffic
@@ -230,8 +217,6 @@ struct mtrace {
int nresp;
struct timeval last;
int bugs[MAXHOPS];
- char *names[MAXHOPS];
- int lastqid;
};
int timeout = DEFAULT_TIMEOUT;
@@ -248,16 +233,13 @@ int weak = FALSE;
int extrahops = DEFAULT_EXTRAHOPS;
int printstats = TRUE;
int sendopts = TRUE;
-int lossthresh = 0;
-int fflag = FALSE;
-int staticqid = 0;
u_int32 defgrp; /* Default group if not specified */
u_int32 query_cast; /* All routers multicast addr */
u_int32 resp_cast; /* Mtrace response multicast addr */
u_int32 lcl_addr = 0; /* This host address, in NET order */
-u_int32 dst_netmask = 0; /* netmask to go with qdst */
+u_int32 dst_netmask; /* netmask to go with qdst */
/*
* Query/response parameters, all initialized to zero and set later
@@ -292,14 +274,14 @@ char router_alert[4]; /* Router Alert IP Option */
#define IPOPT_RA 148
#endif
#ifdef SUNOS5
-char eol[4]; /* EOL IP Option */
+char no_op[4]; /* Null IP Option */
int ip_addlen = 0; /* Workaround for Option bug #2 */
#endif
/*
* max macro, with weird case to avoid conflicts
*/
-#define MaX(a,b) ((a) > (b) ? (a) : (b))
+#define MaX(a,b) (a) > (b) ? (a) : (b)
#ifndef __P
#ifdef __STDC__
@@ -309,10 +291,7 @@ int ip_addlen = 0; /* Workaround for Option bug #2 */
#endif
#endif
-typedef int (*callback_t) __P((int, u_char *, int, struct igmp *, int,
- struct sockaddr *, int *, struct timeval *));
-
-void init_igmp __P((void));
+void init_igmp __P(());
void send_igmp __P((u_int32 src, u_int32 dst, int type,
int code, u_int32 group,
int datalen));
@@ -332,21 +311,15 @@ u_int32 host_addr __P((char *name));
char * proto_type __P((u_int type));
char * flag_type __P((u_int type));
-u_int32 get_netmask __P((int s, u_int32 *dst));
+u_int32 get_netmask __P((int s, u_int32 dst));
int get_ttl __P((struct resp_buf *buf));
int t_diff __P((u_long a, u_long b));
-u_long byteswap __P((u_long v));
-int mtrace_callback __P((int, u_char *, int, struct igmp *,
- int, struct sockaddr *, int *,
- struct timeval *));
+u_long fixtime __P((u_long time, struct resp_buf *base));
int send_recv __P((u_int32 dst, int type, int code,
- int tries, struct resp_buf *save,
- callback_t callback));
-void passive_mode __P((void));
+ int tries, struct resp_buf *save));
char * print_host __P((u_int32 addr));
char * print_host2 __P((u_int32 addr1, u_int32 addr2));
-void print_trace __P((int idx, struct resp_buf *buf,
- char **names));
+void print_trace __P((int index, struct resp_buf *buf));
int what_kind __P((struct resp_buf *buf, char *why));
char * scale __P((int *hop));
void stat_line __P((struct tr_resp *r, struct tr_resp *s,
@@ -355,15 +328,10 @@ void fixup_stats __P((struct resp_buf *base,
struct resp_buf *prev,
struct resp_buf *new,
int *bugs));
-int check_thresh __P((int thresh,
- struct resp_buf *base,
- struct resp_buf *prev,
- struct resp_buf *new));
int print_stats __P((struct resp_buf *base,
struct resp_buf *prev,
struct resp_buf *new,
- int *bugs,
- char **names));
+ int *bugs));
int path_changed __P((struct resp_buf *base,
struct resp_buf *new));
void check_vif_state __P((void));
@@ -381,6 +349,9 @@ void
init_igmp()
{
struct ip *ip;
+#ifdef SUNOS5
+ u_int32 localhost = htonl(0x7f000001);
+#endif
recv_buf = (char *)malloc(RECV_BUF_SIZE);
if (recv_buf == 0)
@@ -414,20 +385,17 @@ init_igmp()
router_alert[1] = 4; /* 4 bytes */
router_alert[2] = 0;
router_alert[3] = 0;
-}
#ifdef SUNOS5
-void
-checkforsolarisbug()
-{
- u_int32 localhost = htonl(0x7f000001);
+ if (!sendopts)
+ return;
- eol[0] = IPOPT_EOL;
- eol[1] = IPOPT_EOL;
- eol[2] = IPOPT_EOL;
- eol[3] = IPOPT_EOL;
+ no_op[0] = IPOPT_EOL;
+ no_op[1] = IPOPT_EOL;
+ no_op[2] = IPOPT_EOL;
+ no_op[3] = IPOPT_EOL;
- setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS, eol, sizeof(eol));
+ setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS, no_op, sizeof(no_op));
/*
* Check if the kernel adds the options length to the packet
* length. Send myself an IGMP packet of type 0 (illegal),
@@ -465,9 +433,6 @@ checkforsolarisbug()
if (*p != getpid())
continue;
-#ifdef RAW_INPUT_IS_RAW
- ip->ip_len = ntohs(ip->ip_len);
-#endif
if (ip->ip_len == IGMP_MINLEN + 4)
ip_addlen = 4;
else if (ip->ip_len == IGMP_MINLEN + 8)
@@ -478,8 +443,8 @@ checkforsolarisbug()
break;
}
}
-}
#endif
+}
/*
* Construct an IGMP message in the output packet buffer. The caller may
@@ -509,9 +474,6 @@ send_igmp(src, dst, type, code, group, datalen)
#ifdef SUNOS5
ip->ip_len += ip_addlen;
#endif
-#ifdef RAW_OUTPUT_IS_RAW
- ip->ip_len = htons(ip->ip_len);
-#endif
igmp = (struct igmp *)(send_buf + MIN_IP_HEADER_LEN);
igmp->igmp_type = type;
@@ -537,10 +499,10 @@ send_igmp(src, dst, type, code, group, datalen)
#ifdef SUNOS5
/*
* SunOS5 < 5.6 cannot properly reset the IP_OPTIONS "socket"
- * option. Instead, set up a string of 4 EOL's.
+ * option. Instead, set up a string of 4 no-op's.
*/
setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS,
- eol, sizeof(eol));
+ no_op, sizeof(no_op));
#else
setsockopt(igmp_socket, IPPROTO_IP, IP_OPTIONS,
NULL, 0);
@@ -799,14 +761,10 @@ host_addr(name)
}
*op = '\0';
- if (dots <= 0)
- e = gethostbyname(name);
- if (e && (e->h_length == sizeof(addr))) {
+ if (dots <= 0) e = gethostbyname(name);
+ if (e && e->h_length == sizeof(addr))
memcpy((char *)&addr, e->h_addr_list[0], e->h_length);
- if (e->h_addr_list[1])
- fprintf(stderr, "Warning: %s has multiple addresses, using %s\n",
- name, inet_fmt(addr, s1));
- } else {
+ else {
addr = inet_addr(buf);
if (addr == -1 || (IN_MULTICAST(addr) && dots)) {
addr = 0;
@@ -838,14 +796,6 @@ proto_type(type)
return ("PIM/Static");
case PROTO_DVMRP_STATIC:
return ("DVMRP/Static");
- case PROTO_PIM_BGP4PLUS:
- return ("PIM/BGP4+");
- case PROTO_CBT_SPECIAL:
- return ("CBT/Special");
- case PROTO_CBT_STATIC:
- return ("CBT/Static");
- case PROTO_PIM_ASSERT:
- return ("PIM/Assert");
case 0:
return ("None");
default:
@@ -904,81 +854,31 @@ flag_type(type)
u_int32
get_netmask(s, dst)
int s;
- u_int32 *dst;
+ u_int32 dst;
{
- unsigned int n;
+ unsigned int i;
+ char ifbuf[5000];
struct ifconf ifc;
- struct ifreq *ifrp, *ifend;
+ struct ifreq *ifr;
u_int32 if_addr, if_mask;
u_int32 retval = 0xFFFFFFFF;
int found = FALSE;
- int num_ifreq = 32;
-
- ifc.ifc_len = num_ifreq * sizeof(struct ifreq);
- ifc.ifc_buf = malloc(ifc.ifc_len);
- while (ifc.ifc_buf) {
- if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
- perror("ioctl SIOCGIFCONF");
- return retval;
- }
- /*
- * If the buffer was large enough to hold all the addresses
- * then break out, otherwise increase the buffer size and
- * try again.
- *
- * The only way to know that we definitely had enough space
- * is to know that there was enough space for at least one
- * more struct ifreq. ???
- */
- if ((num_ifreq * sizeof(struct ifreq)) >=
- ifc.ifc_len + sizeof(struct ifreq))
- break;
-
- num_ifreq *= 2;
- ifc.ifc_len = num_ifreq * sizeof(struct ifreq);
- ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len);
+ ifc.ifc_buf = ifbuf;
+ ifc.ifc_len = sizeof(ifbuf);
+ if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
+ warn("ioctl (SIOCGIFCONF)");
+ return (retval);
}
- if (ifc.ifc_buf == NULL) {
- fprintf(stderr, "getting interface list: ran out of memory");
- exit(1);
- }
-
- ifrp = (struct ifreq *)ifc.ifc_buf;
- ifend = (struct ifreq *)(ifc.ifc_buf + ifc.ifc_len);
- /*
- * Loop through all of the interfaces.
- */
- for (; ifrp < ifend && !found; ifrp = (struct ifreq *)((char *)ifrp + n)) {
-#if BSD >= 199006
- n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name);
- if (n < sizeof(*ifrp))
- n = sizeof(*ifrp);
-#else
- n = sizeof(*ifrp);
-#endif
- /*
- * Ignore any interface for an address family other than IP.
- */
- if (ifrp->ifr_addr.sa_family != AF_INET)
- continue;
-
- if_addr = ((struct sockaddr_in *)&(ifrp->ifr_addr))->sin_addr.s_addr;
- if (ioctl(s, SIOCGIFFLAGS, (char *)ifrp) < 0) {
- fprintf(stderr, "SIOCGIFFLAGS on ");
- perror(ifrp->ifr_name);
- continue;
- }
- if ((ifrp->ifr_flags & (IFF_MULTICAST|IFF_UP|IFF_LOOPBACK)) !=
- (IFF_MULTICAST|IFF_UP))
- continue;
- if (*dst == 0)
- *dst = if_addr;
- if (ioctl(s, SIOCGIFNETMASK, (char *)ifrp) >= 0) {
- if_mask = ((struct sockaddr_in *)&(ifrp->ifr_addr))->sin_addr.s_addr;
- if (if_mask != 0 && (*dst & if_mask) == (if_addr & if_mask)) {
+ i = ifc.ifc_len / sizeof(struct ifreq);
+ ifr = ifc.ifc_req;
+ for (; i > 0; i--, ifr++) {
+ if_addr = ((struct sockaddr_in *)&(ifr->ifr_addr))->sin_addr.s_addr;
+ if (ioctl(s, SIOCGIFNETMASK, (char *)ifr) >= 0) {
+ if_mask = ((struct sockaddr_in *)&(ifr->ifr_addr))->sin_addr.s_addr;
+ if ((dst & if_mask) == (if_addr & if_mask)) {
retval = if_mask;
- if (lcl_addr == 0) lcl_addr = if_addr; /* XXX what about aliases? */
+ if (lcl_addr == 0) lcl_addr = if_addr;
}
}
if (lcl_addr == if_addr) found = TRUE;
@@ -1032,161 +932,37 @@ t_diff(a, b)
}
/*
- * Swap bytes for poor little-endian machines that don't byte-swap
+ * Fixup for incorrect time format in 3.3 mrouted.
+ * This is possible because (JAN_1970 mod 64K) is quite close to 32K,
+ * so correct and incorrect times will be far apart.
*/
u_long
-byteswap(v)
- u_long v;
+fixtime(time, base)
+ u_long time;
+ struct resp_buf *base;
{
- return ((v << 24) | ((v & 0xff00) << 8) |
- ((v >> 8) & 0xff00) | (v >> 24));
+ if (abs((int)(time-base->qtime)) > 0x3FFFFFFF)
+ time = ((time & 0xFFFF0000) + (JAN_1970 << 16)) +
+ ((time & 0xFFFF) << 14) / 15625;
+ return (time);
}
-#if 0
/*
- * XXX incomplete - need private callback data, too?
- * XXX since dst doesn't get passed through?
+ * Swap bytes for poor little-endian machines that don't byte-swap
*/
-int
-neighbors_callback(tmo, buf, buflen, igmp, igmplen, addr, addrlen, ts)
- int tmo;
- u_char *buf;
- int buflen;
- struct igmp *igmp;
- int igmplen;
- struct sockaddr *addr;
- int *addrlen;
- struct timeval *ts;
-{
- int len;
- u_int32 dst;
- struct ip *ip = (struct ip *)buf;
-
- if (tmo)
- return 0;
-
- if (igmp->igmp_code != DVMRP_NEIGHBORS2)
- return 0;
- len = igmplen;
- /*
- * Accept DVMRP_NEIGHBORS2 response if it comes from the
- * address queried or if that address is one of the local
- * addresses in the response.
- */
- if (ip->ip_src.s_addr != dst) {
- u_int32 *p = (u_int32 *)(igmp + 1);
- u_int32 *ep = p + (len >> 2);
- while (p < ep) {
- u_int32 laddr = *p++;
- int n = ntohl(*p++) & 0xFF;
- if (laddr == dst) {
- ep = p + 1; /* ensure p < ep after loop */
- break;
- }
- p += n;
- }
- if (p >= ep)
- return 0;
- }
- return buflen;
-}
-#endif
-
-int
-mtrace_callback(tmo, buf, buflen, igmp, igmplen, addr, addrlen, ts)
- int tmo;
- u_char *buf;
- int buflen;
- struct igmp *igmp;
- int igmplen;
- struct sockaddr *addr;
- int *addrlen;
- struct timeval *ts;
+u_long
+byteswap(v)
+ u_long v;
{
- static u_char *savbuf = NULL;
- static int savbuflen;
- static struct sockaddr *savaddr;
- static int savaddrlen;
- static struct timeval savts;
-
- int len = (igmplen - QLEN) / RLEN;
- struct tr_resp *r = (struct tr_resp *)((struct tr_query *)(igmp + 1) + 1);
-
- if (tmo == 1) {
- /*
- * If we timed out with a packet saved, then return that packet.
- * send_recv won't send this same packet to the callback again.
- */
- if (savbuf) {
- bcopy(savbuf, buf, savbuflen);
- free(savbuf);
- savbuf = NULL;
- bcopy(savaddr, addr, savaddrlen);
- free(savaddr);
- *addrlen = savaddrlen;
- bcopy(&savts, ts, sizeof(savts));
- return savbuflen;
- }
- return 0;
- }
- if (savbuf) {
- free(savbuf);
- savbuf = NULL;
- free(savaddr);
- }
- /*
- * Check for IOS bug described in CSCdi68628, where a router that does
- * not have multicast enabled responds to an mtrace request with a 1-hop
- * error packet.
- * Heuristic is:
- * If there is only one hop reported in the packet,
- * And the protocol code is 0,
- * And there is no previous hop,
- * And the forwarding information is "Not Forwarding",
- * And the router is not on the same subnet as the destination of the
- * trace,
- * then drop this packet. The "#if 0"'d code saves it and returns
- * it on timeout, but timeouts are too common (e.g. routers with
- * limited unicast routing tables, etc).
- */
- if (len == 1 && r->tr_rproto == 0 && r->tr_rmtaddr == 0 &&
- r->tr_rflags == TR_NO_FWD) {
- u_int32 smask;
-
- VAL_TO_MASK(smask, r->tr_smask);
- if ((r->tr_outaddr & smask) != (qdst & smask)) {
-#if 0
- /* XXX should do this silently? */
- fprintf(stderr, "mtrace: probably IOS-buggy packet from %s\n",
- inet_fmt(((struct sockaddr_in *)addr)->sin_addr.s_addr, s1));
- /* Save the packet to return if a timeout occurs. */
- savbuf = (u_char *)malloc(buflen);
- if (savbuf != NULL) {
- bcopy(buf, savbuf, buflen);
- savbuflen = buflen;
- savaddr = (struct sockaddr *)malloc(*addrlen);
- if (savaddr != NULL) {
- bcopy(addr, savaddr, *addrlen);
- savaddrlen = *addrlen;
- bcopy(ts, &savts, sizeof(savts));
- } else {
- free(savbuf);
- savbuf = NULL;
- }
- }
-#endif
- return 0;
- }
- }
- return buflen;
+ return ((v << 24) | ((v & 0xff00) << 8) |
+ ((v >> 8) & 0xff00) | (v >> 24));
}
int
-send_recv(dst, type, code, tries, save, callback)
+send_recv(dst, type, code, tries, save)
u_int32 dst;
int type, code, tries;
struct resp_buf *save;
- callback_t callback;
{
fd_set fds;
struct timeval tq, tr, tv;
@@ -1224,31 +1000,28 @@ send_recv(dst, type, code, tries, save, callback)
*/
query = (struct tr_query *)(send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN);
query->tr_raddr = raddr ? raddr : unicast ? lcl_addr : resp_cast;
- TR_SETTTL(query->tr_rttlqid, rttl ? rttl :
- IN_MULTICAST(ntohl(query->tr_raddr)) ? get_ttl(save) : UNICAST_TTL);
+ query->tr_rttl = rttl ? rttl :
+ IN_MULTICAST(ntohl(query->tr_raddr)) ? get_ttl(save) : UNICAST_TTL;
query->tr_src = qsrc;
query->tr_dst = qdst;
for (i = tries ; i > 0; --i) {
- int oqid;
-
if (tries == nqueries && raddr == 0) {
if (i == (nqueries >> 1)) {
if (multicast && unicast) {
query->tr_raddr = resp_cast;
if (!rttl)
- TR_SETTTL(query->tr_rttlqid, get_ttl(save));
+ query->tr_rttl = get_ttl(save);
} else if (!multicast) {
query->tr_raddr = lcl_addr;
- TR_SETTTL(query->tr_rttlqid, UNICAST_TTL);
+ query->tr_rttl = UNICAST_TTL;
}
}
if (i < tries && IN_MULTICAST(ntohl(query->tr_raddr)) &&
rttl == 0) {
- TR_SETTTL(query->tr_rttlqid,
- TR_GETTTL(query->tr_rttlqid) + MULTICAST_TTL_INC);
- if (TR_GETTTL(query->tr_rttlqid) > MULTICAST_TTL_MAX)
- TR_SETTTL(query->tr_rttlqid, MULTICAST_TTL_MAX);
+ query->tr_rttl += MULTICAST_TTL_INC;
+ if (query->tr_rttl > MULTICAST_TTL_MAX)
+ query->tr_rttl = MULTICAST_TTL_MAX;
}
}
@@ -1256,14 +1029,10 @@ send_recv(dst, type, code, tries, save, callback)
* Change the qid for each request sent to avoid being confused
* by duplicate responses
*/
- oqid = TR_GETQID(query->tr_rttlqid);
- if (staticqid)
- TR_SETQID(query->tr_rttlqid, staticqid);
- else
#ifdef SYSV
- TR_SETQID(query->tr_rttlqid, ((u_int32)lrand48() >> 8));
+ query->tr_qid = ((u_int32)lrand48() >> 8);
#else
- TR_SETQID(query->tr_rttlqid, ((u_int32)random() >> 8));
+ query->tr_qid = ((u_int32)random() >> 8);
#endif
/*
@@ -1291,23 +1060,15 @@ send_recv(dst, type, code, tries, save, callback)
if (errno != EINTR) warn("select");
continue;
} else if (count == 0) {
- /*
- * Timed out. Notify the callback.
- */
- if (!callback || (recvlen = (callback)(1, recv_buf, 0, NULL, 0, (struct sockaddr *)&recvaddr, &socklen, &tr)) == 0) {
- printf("* ");
- fflush(stdout);
- break;
- }
- } else {
- /*
- * Data is available on the socket, so read it.
- */
- gettimeofday(&tr, 0);
- recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
- 0, (struct sockaddr *)&recvaddr, &socklen);
+ printf("* ");
+ fflush(stdout);
+ break;
}
+ gettimeofday(&tr, 0);
+ recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
+ 0, (struct sockaddr *)&recvaddr, &socklen);
+
if (recvlen <= 0) {
if (recvlen && errno != EINTR) warn("recvfrom");
continue;
@@ -1322,11 +1083,7 @@ send_recv(dst, type, code, tries, save, callback)
continue;
iphdrlen = ip->ip_hl << 2;
-#ifdef RAW_INPUT_IS_RAW
- ipdatalen = ntohs(ip->ip_len);
-#else
ipdatalen = ip->ip_len;
-#endif
if (iphdrlen + ipdatalen != recvlen) {
warnx("packet shorter (%u bytes) than hdr+data len (%u+%u)",
recvlen, iphdrlen, ipdatalen);
@@ -1383,14 +1140,9 @@ send_recv(dst, type, code, tries, save, callback)
* Ignore responses that don't match query.
*/
rquery = (struct tr_query *)(igmp + 1);
- if (rquery->tr_src != qsrc || rquery->tr_dst != qdst)
- continue;
- if (TR_GETQID(rquery->tr_rttlqid) !=
- TR_GETQID(query->tr_rttlqid)) {
- if (verbose && TR_GETQID(rquery->tr_rttlqid) == oqid)
- printf("[D]");
- continue;
- }
+ if (rquery->tr_qid != query->tr_qid) continue;
+ if (rquery->tr_src != qsrc) continue;
+ if (rquery->tr_dst != qdst) continue;
len = (igmpdatalen - QLEN)/RLEN;
r = (struct tr_resp *)(rquery+1) + len - 1;
@@ -1424,8 +1176,7 @@ send_recv(dst, type, code, tries, save, callback)
len, code);
}
rquery->tr_raddr = query->tr_raddr; /* Insure these are */
- TR_SETTTL(rquery->tr_rttlqid, TR_GETTTL(query->tr_rttlqid));
- /* as we sent them */
+ rquery->tr_rttl = query->tr_rttl; /* as we sent them */
break;
default:
@@ -1433,21 +1184,6 @@ send_recv(dst, type, code, tries, save, callback)
}
/*
- * We're pretty sure we want to use this packet now,
- * but if the caller gave a callback function, it might
- * want to handle it instead. Give the callback a chance,
- * unless the select timed out (in which case the only way
- * to get here is because the callback returned a packet).
- */
- if (callback && (count != 0) && ((callback)(0, recv_buf, recvlen, igmp, igmpdatalen, (struct sockaddr*)&recvaddr, &socklen, &tr)) == 0) {
- /*
- * The callback function didn't like this packet.
- * Go try receiving another one.
- */
- continue;
- }
-
- /*
* Most of the sanity checking done at this point.
* Return this packet we have been waiting for.
*/
@@ -1488,14 +1224,13 @@ passive_mode()
int socklen;
int ipdatalen, iphdrlen, igmpdatalen;
int len, recvlen;
- int qid;
u_int32 smask;
struct mtrace *remembered = NULL, *m, *n, **nn;
int pc = 0;
if (raddr) {
- if (IN_MULTICAST(ntohl(raddr))) k_join(raddr, lcl_addr);
- } else k_join(htonl(0xE0000120), lcl_addr);
+ if (IN_MULTICAST(ntohl(raddr))) k_join(raddr, INADDR_ANY);
+ } else k_join(htonl(0xE0000120), INADDR_ANY);
while (1) {
fflush(stdout); /* make sure previous trace is flushed */
@@ -1519,11 +1254,7 @@ passive_mode()
continue;
iphdrlen = ip->ip_hl << 2;
-#ifdef RAW_INPUT_IS_RAW
- ipdatalen = ntohs(ip->ip_len);
-#else
ipdatalen = ip->ip_len;
-#endif
if (iphdrlen + ipdatalen != recvlen) {
warnx("packet shorter (%u bytes) than hdr+data len (%u+%u)",
recvlen, iphdrlen, ipdatalen);
@@ -1577,10 +1308,8 @@ passive_mode()
for (nn = &remembered, n = *nn, m = 0; n; n = *nn) {
if ((n->base.qhdr.tr_src == base.qhdr.tr_src) &&
(n->base.qhdr.tr_dst == base.qhdr.tr_dst) &&
- (n->base.igmp.igmp_group.s_addr == igmp->igmp_group.s_addr)) {
+ (n->base.igmp.igmp_group.s_addr == igmp->igmp_group.s_addr))
m = n;
- m->last = tr;
- }
if (tr.tv_sec - n->last.tv_sec > 500) { /* XXX don't hardcode */
*nn = n->next;
free(n);
@@ -1589,6 +1318,9 @@ passive_mode()
}
}
+ if (m)
+ bcopy(&tr, &m->last, sizeof(tr));
+
tr_sec = tr.tv_sec;
now = localtime(&tr_sec);
strftime(timebuf, sizeof(timebuf) - 1, "%b %e %k:%M:%S", now);
@@ -1602,8 +1334,8 @@ passive_mode()
if (!IN_MULTICAST(base.qhdr.tr_raddr))
printf(", resp to %s", (len == 0 && recvaddr.sin_addr.s_addr == base.qhdr.tr_raddr) ? "same" : inet_fmt(base.qhdr.tr_raddr, s1));
else
- printf(", respttl %d", TR_GETTTL(base.qhdr.tr_rttlqid));
- printf(", qid %06x\n", qid = TR_GETQID(base.qhdr.tr_rttlqid));
+ printf(", respttl %d", base.qhdr.tr_rttl);
+ printf(", qid %06x\n", base.qhdr.tr_qid);
printf("packet from %s to %s\n",
inet_fmt(ip->ip_src.s_addr, s1),
inet_fmt(ip->ip_dst.s_addr, s2));
@@ -1632,15 +1364,11 @@ passive_mode()
!(pc = path_changed(&m->base, &base))) {
/*
* Some mtrace responders send multiple copies of the same
- * reply. Skip this packet if it's got the same query-id
- * as the last one.
+ * reply. Skip this packet if it's exactly the same as the
+ * last one.
*/
- if (m->lastqid == qid) {
- printf("Skipping duplicate reply\n");
+ if (bcmp((char *)&base.igmp, (char *)&m->prev->igmp, ipdatalen) == 0)
continue;
- }
-
- m->lastqid = qid;
++m->nresp;
@@ -1649,7 +1377,7 @@ passive_mode()
printf("Results after %d seconds:\n\n",
(int)((m->new->qtime - m->base.qtime) >> 16));
fixup_stats(&m->base, m->prev, m->new, m->bugs);
- print_stats(&m->base, m->prev, m->new, m->bugs, m->names);
+ print_stats(&m->base, m->prev, m->new, m->bugs);
m->prev = m->new;
m->new = &m->incr[(m->nresp & 1)];
@@ -1658,11 +1386,6 @@ passive_mode()
if (m == NULL) {
m = (struct mtrace *)malloc(sizeof(struct mtrace));
- if (m == NULL) {
- fprintf(stderr, "Out of memory!\n");
- continue;
- }
- bzero(m, sizeof(struct mtrace));
m->next = remembered;
remembered = m;
bcopy(&tr, &m->last, sizeof(tr));
@@ -1681,7 +1404,7 @@ passive_mode()
printf(" 0 ");
print_host(base.qhdr.tr_dst);
printf("\n");
- print_trace(1, &base, m->names);
+ print_trace(1, &base);
VAL_TO_MASK(smask, r->tr_smask);
if ((r->tr_inaddr & smask) == (base.qhdr.tr_src & smask)) {
printf("%3d ", -(base.len+1));
@@ -1732,10 +1455,9 @@ print_host2(addr1, addr2)
* Print responses as received (reverse path from dst to src)
*/
void
-print_trace(idx, buf, names)
- int idx;
+print_trace(index, buf)
+ int index;
struct resp_buf *buf;
- char **names;
{
struct tr_resp *r;
char *name;
@@ -1743,16 +1465,16 @@ print_trace(idx, buf, names)
int hop;
char *ms;
- i = abs(idx);
+ i = abs(index);
r = buf->resps + i - 1;
for (; i <= buf->len; ++i, ++r) {
- if (idx > 0) printf("%3d ", -i);
+ if (index > 0) printf("%3d ", -i);
name = print_host2(r->tr_outaddr, r->tr_inaddr);
if (r->tr_rflags != TR_NO_RTE)
printf(" %s thresh^ %d", proto_type(r->tr_rproto), r->tr_fttl);
if (verbose) {
- hop = t_diff(ntohl(r->tr_qarr), buf->qtime);
+ hop = t_diff(fixtime(ntohl(r->tr_qarr), &base), buf->qtime);
ms = scale(&hop);
printf(" %d%s", hop, ms);
}
@@ -1773,10 +1495,8 @@ print_trace(idx, buf, names)
}
}
printf("\n");
- if (names[i-1])
- free(names[i-1]);
- names[i-1]=malloc(strlen(name) + 1);
- strcpy(names[i-1], name);
+ memcpy(names[i-1], name, sizeof(names[0]) - 1);
+ names[i-1][sizeof(names[0])-1] = '\0';
}
}
@@ -1794,7 +1514,7 @@ what_kind(buf, why)
struct tr_resp *r = buf->resps + hops - 1;
u_int32 next = r->tr_rmtaddr;
- retval = send_recv(next, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2, 1, &incr[0], NULL);
+ retval = send_recv(next, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2, 1, &incr[0]);
print_host(next);
if (retval) {
u_int32 version = ntohl(incr[0].igmp.igmp_group.s_addr);
@@ -1861,7 +1581,9 @@ stat_line(r, s, have_next, rst)
int have_next;
int *rst;
{
- int timediff = (ntohl(s->tr_qarr) - ntohl(r->tr_qarr)) >> 16;
+ /* this may fail in passive statistics mode due to wrong "base". */
+ int timediff = (fixtime(ntohl(s->tr_qarr), &base) -
+ fixtime(ntohl(r->tr_qarr), &base)) >> 16;
int v_lost, v_pct;
int g_lost, g_pct;
int v_out = ntohl(s->tr_vifout) - ntohl(r->tr_vifout);
@@ -1872,21 +1594,14 @@ stat_line(r, s, have_next, rst)
int ghave = NEITHER;
int gmissing = NEITHER;
char whochar;
- int badtime = 0;
-
- if (timediff == 0) {
- badtime = 1;
- /* Might be 32 bits of int seconds instead of 16int+16frac */
- timediff = ntohl(s->tr_qarr) - ntohl(r->tr_qarr);
- if (timediff == 0 || abs(timediff - statint) > statint)
- timediff = 1;
- }
+
+ if (timediff == 0) timediff = 1;
v_pps = v_out / timediff;
g_pps = g_out / timediff;
-#define STATS_MISSING(x) ((x) == 0xFFFFFFFF)
+#define STATS_MISSING(x) ((x) == 0xFFFFFFFF || (x) == 0)
- if (!STATS_MISSING(s->tr_vifout) && !STATS_MISSING(r->tr_vifout))
+ if (v_out && !STATS_MISSING(s->tr_vifout) && !STATS_MISSING(r->tr_vifout))
vhave |= OUTS;
if (STATS_MISSING(s->tr_pktcnt) || STATS_MISSING(r->tr_pktcnt))
gmissing |= OUTS;
@@ -1904,19 +1619,6 @@ stat_line(r, s, have_next, rst)
}
/*
- * Stats can be missing for any number of reasons:
- * - The hop may not be capable of collecting stats
- * - Traffic may be getting dropped at the previous hop
- * and so this hop may not have any state
- *
- * We need a stronger heuristic to tell between these
- * two cases; in case 1 we don't want to print the stats
- * and in case 2 we want to print 100% loss. We used to
- * err on the side of not printing, which is less useful
- * than printing 100% loss and dealing with it.
- */
-#if 0
- /*
* If both hops report as missing, then it's likely that there's just
* no traffic flowing.
*
@@ -1924,30 +1626,22 @@ stat_line(r, s, have_next, rst)
*/
if (gmissing != BOTH)
ghave &= ~gmissing;
-#endif
whochar = have_next ? '^' : ' ';
switch (vhave) {
case BOTH:
v_lost = v_out - (ntohl(s->tr_vifin) - ntohl(r->tr_vifin));
- if (v_out) v_pct = v_lost * 100 / v_out;
+ if (v_out) v_pct = (v_lost * 100 + (v_out >> 1)) / v_out;
else v_pct = 0;
- if (-20 < v_pct && v_pct < 101 && v_out > 10)
- sprintf(v_str, "%3d%%", v_pct);
- else if (v_pct < -900 && v_out > 10)
- sprintf(v_str, "%3dx", (int)(-v_pct / 100. + 1.));
- else if (v_pct <= -20 && v_out > 10)
- sprintf(v_str, "%1.1fx", -v_pct / 100. + 1.);
- else
- memcpy(v_str, " -- ", 5);
+ if (-100 < v_pct && v_pct < 101 && v_out > 10)
+ sprintf(v_str, "%3d", v_pct);
+ else memcpy(v_str, " --", 4);
if (tunstats)
- printf("%6d/%-5d=%s", v_lost, v_out, v_str);
+ printf("%6d/%-5d=%s%%", v_lost, v_out, v_str);
else
printf(" ");
printf("%4d pps", v_pps);
- if (v_pps && badtime)
- printf("?");
break;
@@ -1963,17 +1657,15 @@ stat_line(r, s, have_next, rst)
else
printf(" %c", whochar);
printf("%4d pps", v_pps);
- if (v_pps && badtime)
- printf("?");
break;
case NEITHER:
if (ghave != NEITHER)
if (tunstats)
- printf(" ");
+ printf(" ");
else
- printf(" ");
+ printf(" ");
break;
}
@@ -1982,22 +1674,14 @@ stat_line(r, s, have_next, rst)
switch (ghave) {
case BOTH:
g_lost = g_out - (ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt));
- if (g_out) g_pct = g_lost * 100 / g_out;
+ if (g_out) g_pct = (g_lost * 100 + (g_out >> 1))/ g_out;
else g_pct = 0;
- if (-20 < g_pct && g_pct < 101 && g_out > 10)
- sprintf(g_str, "%3d%%", g_pct);
- else if (g_pct < -900 && g_out > 10)
- sprintf(g_str, "%3dx", (int)(-g_pct / 100. + 1.));
- else if (g_pct <= -20 && g_out > 10)
- sprintf(g_str, "%1.1fx", -g_pct / 100. + 1.);
- else
- memcpy(g_str, " -- ", 5);
+ if (-100 < g_pct && g_pct < 101 && g_out > 10)
+ sprintf(g_str, "%3d", g_pct);
+ else memcpy(g_str, " --", 4);
- printf("%s%6d/%-5d=%s%4d pps",
+ printf("%s%6d/%-5d=%s%%%4d pps\n",
tunstats ? "" : " ", g_lost, g_out, g_str, g_pps);
- if (g_pps && badtime)
- printf("?");
- printf("\n");
break;
#if 0
@@ -2009,11 +1693,8 @@ stat_line(r, s, have_next, rst)
#endif
case OUTS:
- printf("%s ?/%-5d %4d pps",
+ printf("%s ?/%-5d %4d pps\n",
tunstats ? "" : " ", g_out, g_pps);
- if (badtime)
- printf("?");
- printf("\n");
break;
case INS:
@@ -2036,18 +1717,12 @@ stat_line(r, s, have_next, rst)
(long)(ntohl(s->tr_vifout) - ntohl(r->tr_vifout)));
printf("pkts: %ld ", (long)(ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt)));
printf("time: %d\n", timediff);
- printf("\t\t\t\treset: %x hoptime: %lx\n", *rst, ntohl(s->tr_qarr));
}
}
/*
* A fixup to check if any pktcnt has been reset, and to fix the
* byteorder bugs in mrouted 3.6 on little-endian machines.
- *
- * XXX Since periodic traffic sources are likely to have their
- * pktcnt periodically reset, should we save old values when
- * the reset occurs to keep slightly better statistics over
- * the long term? (e.g. SAP)
*/
void
fixup_stats(base, prev, new, bugs)
@@ -2060,25 +1735,12 @@ fixup_stats(base, prev, new, bugs)
struct tr_resp *n = new->resps + rno;
int *r = bugs + rno;
int res;
- int cleanup = 0;
- /* Check for byte-swappers. Only check on the first trace,
- * since long-running traces can wrap around and falsely trigger. */
+ /* Check for byte-swappers */
while (--rno >= 0) {
-#ifdef TEST_ONLY
- u_int32 nvifout = ntohl(n->tr_vifout);
- u_int32 pvifout = ntohl(p->tr_vifout);
-#endif
--n; --p; --b;
-#ifdef TEST_ONLY /*XXX this is still buggy, so disable it for release */
if ((*r & BUG_SWAP) ||
- ((base == prev) &&
- (nvifout - pvifout) > (byteswap(nvifout) - byteswap(pvifout)))) {
- if (1 || debug > 2) {
- printf("ip %s swaps; b %08x p %08x n %08x\n",
- inet_fmt(n->tr_inaddr, s1),
- ntohl(b->tr_vifout), pvifout, nvifout);
- }
+ abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 100000) {
/* This host sends byteswapped reports; swap 'em */
if (!(*r & BUG_SWAP)) {
*r |= BUG_SWAP;
@@ -2093,7 +1755,6 @@ fixup_stats(base, prev, new, bugs)
n->tr_vifout = byteswap(n->tr_vifout);
n->tr_pktcnt = byteswap(n->tr_pktcnt);
}
-#endif
/*
* A missing parenthesis in mrouted 3.5-3.8's prune.c
* causes extremely bogus time diff's.
@@ -2124,32 +1785,10 @@ fixup_stats(base, prev, new, bugs)
while (--rno >= 0) {
--n; --p; --b; --r;
- /*
- * This hop has reset if:
- * - There were statistics in the base AND previous pass, AND
- * - There are less packets this time than the first time and
- * we didn't reset last time, OR
- * - There are less packets this time than last time, OR
- * - There are no statistics on this pass.
- *
- * The "and we didn't reset last time" is necessary in the
- * first branch of the OR because if the base is large and
- * we reset last time but the constant-resetter-avoidance
- * code kicked in so we delayed the copy of prev to base,
- * new could still be below base so we trigger the
- * constant-resetter code even though it was really only
- * a single reset.
- */
- res = ((b->tr_pktcnt != 0xFFFFFFFF) && (p->tr_pktcnt != 0xFFFFFFFF) &&
- ((!(*r & BUG_RESET) && ntohl(n->tr_pktcnt) < ntohl(b->tr_pktcnt)) ||
- (ntohl(n->tr_pktcnt) < ntohl(p->tr_pktcnt)) ||
- (n->tr_pktcnt == 0xFFFFFFFF)));
- if (debug > 2) {
- printf("\t\tip=%s, r=%d, res=%d\n", inet_fmt(b->tr_inaddr, s1), *r, res);
- if (res)
- printf("\t\tbase=%ld, prev=%ld, new=%ld\n", ntohl(b->tr_pktcnt),
- ntohl(p->tr_pktcnt), ntohl(n->tr_pktcnt));
- }
+ res = ((ntohl(n->tr_pktcnt) < ntohl(b->tr_pktcnt)) ||
+ (ntohl(n->tr_pktcnt) < ntohl(p->tr_pktcnt)));
+ if (debug > 2)
+ printf("\t\tr=%d, res=%d\n", *r, res);
if (*r & BUG_RESET) {
if (res || (*r & BUG_RESET2X)) {
/*
@@ -2169,68 +1808,29 @@ fixup_stats(base, prev, new, bugs)
* traffic was still active.
*/
*r &= ~BUG_RESET;
- cleanup = 1;
+ break;
}
} else
if (res)
*r |= BUG_RESET;
}
- if (cleanup == 0) return;
+ if (rno < 0) return;
- /*
- * If some hop reset its counters and didn't continue to
- * reset, then we pretend that the previous
- * trace was the first one.
- */
rno = base->len;
b = base->resps + rno;
p = prev->resps + rno;
while (--rno >= 0) (--b)->tr_pktcnt = (--p)->tr_pktcnt;
- base->qtime = prev->qtime;
- base->rtime = prev->rtime;
-}
-
-/*
- * Check per-source losses along path and compare with threshold.
- */
-int
-check_thresh(thresh, base, prev, new)
- int thresh;
- struct resp_buf *base, *prev, *new;
-{
- int rno = base->len - 1;
- struct tr_resp *b = base->resps + rno;
- struct tr_resp *p = prev->resps + rno;
- struct tr_resp *n = new->resps + rno;
- int g_out, g_lost;
-
- while (TRUE) {
- if ((n->tr_inaddr != b->tr_inaddr) ||
- (n->tr_outaddr != b->tr_outaddr) ||
- (n->tr_rmtaddr != b->tr_rmtaddr))
- return 1; /* Route changed */
-
- if (rno-- < 1) break;
- g_out = ntohl(n->tr_pktcnt) - ntohl(p->tr_pktcnt);
- b--; n--; p--;
- g_lost = g_out - (ntohl(n->tr_pktcnt) - ntohl(p->tr_pktcnt));
- if (g_out && ((g_lost * 100 + (g_out >> 1))/ g_out) > thresh) {
- return TRUE;
- }
- }
- return FALSE;
}
/*
* Print responses with statistics for forward path (from src to dst)
*/
int
-print_stats(base, prev, new, bugs, names)
+print_stats(base, prev, new, bugs)
struct resp_buf *base, *prev, *new;
int *bugs;
- char **names;
{
int rtt, hop;
char *ms;
@@ -2241,8 +1841,8 @@ print_stats(base, prev, new, bugs, names)
struct tr_resp *n = new->resps + rno;
int *r = bugs + rno;
u_long resptime = new->rtime;
- u_long qarrtime = ntohl(n->tr_qarr);
- u_int ttl = MaX(1, n->tr_fttl) + 1;
+ u_long qarrtime = fixtime(ntohl(n->tr_qarr), base);
+ u_int ttl = n->tr_fttl + 1;
int first = (base == prev);
VAL_TO_MASK(smask, b->tr_smask);
@@ -2278,12 +1878,6 @@ print_stats(base, prev, new, bugs, names)
else
printf("------- ---------------------\n");
}
- if ((b->tr_inaddr & smask) != (base->qhdr.tr_src & smask) &&
- b->tr_rmtaddr != 0) {
- printf("%-15s %-14s is the previous hop\n", inet_fmt(b->tr_rmtaddr, s1),
- inet_name(b->tr_rmtaddr));
- printf(" v ^\n");
- }
if (debug > 2) {
printf("\t\t\t\tv_in: %ld ", (long)ntohl(n->tr_vifin));
printf("v_out: %ld ", (long)ntohl(n->tr_vifout));
@@ -2297,7 +1891,7 @@ print_stats(base, prev, new, bugs, names)
(long)(ntohl(n->tr_vifout) - ntohl(b->tr_vifout)));
printf("pkts: %ld\n",
(long)(ntohl(n->tr_pktcnt) - ntohl(b->tr_pktcnt)));
- printf("\t\t\t\treset: %x hoptime: %lx\n", *r, (long)ntohl(n->tr_qarr));
+ printf("\t\t\t\treset: %x\n", *r);
}
while (TRUE) {
@@ -2319,7 +1913,7 @@ print_stats(base, prev, new, bugs, names)
stat_line(p, n, TRUE, r);
if (!first || verbose) {
resptime = qarrtime;
- qarrtime = ntohl((n-1)->tr_qarr);
+ qarrtime = fixtime(ntohl((n-1)->tr_qarr), base);
hop = t_diff(resptime, qarrtime);
ms = scale(&hop);
printf(" v | hop%5d%s", hop, ms);
@@ -2330,7 +1924,7 @@ print_stats(base, prev, new, bugs, names)
}
--b, --p, --n, --r;
- ttl = MaX(ttl, MaX(1, n->tr_fttl) + base->len - rno);
+ ttl = MaX(ttl, n->tr_fttl + base->len - rno);
}
printf(" %c \\__ ttl%5d ", (first && !verbose) ? 'v' : '|',
@@ -2345,8 +1939,9 @@ print_stats(base, prev, new, bugs, names)
else
stat_line(b, n, FALSE, r);
}
+ /* lcl_addr is 0 in passive mode, where we don't know the query source. */
printf("%-15s %s\n", inet_fmt(base->qhdr.tr_dst, s1),
- !passive ? inet_fmt(lcl_addr, s2) : " * * * ");
+ lcl_addr ? inet_fmt(lcl_addr, s2) : " * * * ");
printf(" Receiver Query Source\n\n");
return 0;
}
@@ -2401,19 +1996,10 @@ char *argv[];
int waittime;
int seed;
int hopbyhop;
- int i;
- int printed = 1;
if (geteuid() != 0)
errx(1, "must be root");
- /*
- * We might get spawned by vat with the audio device open.
- * Close everything but stdin, stdout, stderr.
- */
- for (i = 3; i < 255; i++)
- close(i);
-
init_igmp();
setuid(getuid());
@@ -2446,17 +2032,6 @@ char *argv[];
case 'U': /* Use unicast for response */
unicast = TRUE;
break;
- case 'L': /* Trace w/ loss threshold */
- if (arg && isdigit(*arg)) {
- lossthresh = atoi(arg);
- if (lossthresh < 0)
- lossthresh = 0;
- numstats = 3153600;
- if (arg == argv[0]) argv++, argc--;
- break;
- } else
- usage();
- break;
case 'O': /* Don't use IP options */
sendopts = FALSE;
break;
@@ -2464,16 +2039,6 @@ char *argv[];
printstats = FALSE;
numstats = 3153600;
break;
- case 'Q': /* (undoc.) always use this QID */
- if (arg && isdigit(*arg)) {
- staticqid = atoi(arg);
- if (staticqid < 0)
- staticqid = 0;
- if (arg == argv[0]) argv++, argc--;
- break;
- } else
- usage();
- break;
case 'T': /* Print confusing tunnel stats */
tunstats = TRUE;
break;
@@ -2481,27 +2046,20 @@ char *argv[];
weak = TRUE;
break;
case 'V': /* Print version and exit */
- /*
- * FreeBSD wants to have its own Id string, so
- * determination of the version number has to change.
- * XXX Note that this must be changed by hand on importing
- * XXX new versions!
- */
{
- char *r = strdup(rcsid);
- char *s = strchr(r, ',');
+ char *p = strchr(rcsid, ',');
- while (s && *(s+1) != 'v')
- s = strchr(s + 1, ',');
+ while (p && *(p+1) != 'v')
+ p = strchr(p + 1, ',');
- if (s) {
+ if (p) {
char *q;
- s += 3; /* , v sp */
- q = strchr(s, ' ');
+ p += 3; /* , v sp */
+ q = strchr(p, ' ');
if (q)
*q = '\0';
- fprintf(stderr, "mtrace version 5.2/%s\n", s);
+ fprintf(stderr, "mtrace version %s\n", p);
} else {
fprintf(stderr, "mtrace could not determine version number!?\n");
}
@@ -2531,16 +2089,6 @@ char *argv[];
break;
} else
usage();
- case 'f': /* first hop */
- if (arg && isdigit(*arg)) {
- qno = atoi(arg);
- if (qno > MAXHOPS) qno = MAXHOPS;
- else if (qno < 1) qno = 0;
- if (arg == argv[0]) argv++, argc--;
- fflag++;
- break;
- } else
- usage();
case 'm': /* Max number of hops to trace */
if (arg && isdigit(*arg)) {
qno = atoi(arg);
@@ -2642,16 +2190,11 @@ char *argv[];
usage();
}
-#ifdef SUNOS5
- if (sendopts)
- checkforsolarisbug();
-#endif
-
/*
* Set useful defaults for as many parameters as possible.
*/
- defgrp = 0; /* Default to no group */
+ defgrp = htonl(0xE0020001); /* MBone Audio (224.2.0.1) */
query_cast = htonl(0xE0000002); /* All routers multicast addr */
resp_cast = htonl(0xE0000120); /* Mtrace response multicast addr */
if (qgrp == 0) {
@@ -2679,13 +2222,6 @@ char *argv[];
addr.sin_addr.s_addr = qgrp ? qgrp : query_cast;
addr.sin_port = htons(2000); /* Any port above 1024 will do */
- /*
- * Note that getsockname() can return 0 on some systems
- * (notably SunOS 5.x, x < 6). This is taken care of in
- * get_netmask(). If the default multicast interface (set
- * with the route for 224.0.0.0) is not the same as the
- * hostname, mtrace -i [if_addr] will have to be used.
- */
if (((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0) ||
(connect(udp, (struct sockaddr *) &addr, sizeof(addr)) < 0) ||
getsockname(udp, (struct sockaddr *) &addr, &addrlen) < 0)
@@ -2724,7 +2260,7 @@ char *argv[];
*/
if (qdst == 0) {
qdst = lcl_addr ? lcl_addr : addr.sin_addr.s_addr;
- dst_netmask = get_netmask(udp, &qdst);
+ dst_netmask = get_netmask(udp, qdst);
if (gwy && (gwy & dst_netmask) != (qdst & dst_netmask) &&
!IN_MULTICAST(ntohl(gwy)))
qdst = gwy;
@@ -2733,8 +2269,7 @@ char *argv[];
qsrc = lcl_addr ? lcl_addr : addr.sin_addr.s_addr;
if (qsrc == 0)
usage();
- if (!dst_netmask)
- dst_netmask = get_netmask(udp, &qdst);
+ dst_netmask = get_netmask(udp, qdst);
close(udp);
if (lcl_addr == 0) lcl_addr = addr.sin_addr.s_addr;
@@ -2755,7 +2290,7 @@ char *argv[];
* older implementations.
*/
if (gwy && !IN_MULTICAST(ntohl(gwy)))
- if (send_recv(gwy, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2, 1, &incr[0], NULL)) {
+ if (send_recv(gwy, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2, 1, &incr[0])) {
int flags = ntohl(incr[0].igmp.igmp_group.s_addr);
int version = flags & 0xFFFF;
int info = (flags & 0xFF0000) >> 16;
@@ -2775,8 +2310,10 @@ char *argv[];
printf("Mtrace from %s to %s via group %s\n",
inet_fmt(qsrc, s1), inet_fmt(qdst, s2), inet_fmt(qgrp, s3));
- if ((qdst & dst_netmask) == (qsrc & dst_netmask))
- fprintf(stderr, "mtrace: Source & receiver appear to be directly connected\n");
+ if ((qdst & dst_netmask) == (qsrc & dst_netmask)) {
+ printf("Source & receiver are directly connected, no path to trace\n");
+ exit(0);
+ }
/*
* If the response is to be a multicast address, make sure we
@@ -2799,8 +2336,8 @@ char *argv[];
if ((qdst & dst_netmask) == (lcl_addr & dst_netmask)) tdst = query_cast;
else tdst = qgrp;
else tdst = gwy;
- if (tdst == 0 && qgrp == 0)
- errx(1, "mtrace: weak mtrace requires -g if destination is not local.\n");
+ if (tdst == 0 && weak)
+ errx(1, "-W requires -g if destination is not local");
if (IN_MULTICAST(ntohl(tdst))) {
k_set_loop(1); /* If I am running on a router, I need to hear this */
@@ -2819,17 +2356,13 @@ char *argv[];
} else {
hops = qno;
tries = nqueries;
- if (fflag)
- printf("Querying full reverse path, starting at hop %d...", qno);
- else
- printf("Querying reverse path, maximum %d hops... ", qno);
+ printf("Querying reverse path, maximum %d hops... ", qno);
fflush(stdout);
}
base.rtime = 0;
base.len = 0;
- hopbyhop = FALSE;
- recvlen = send_recv(tdst, IGMP_MTRACE, hops, tries, &base, mtrace_callback);
+ recvlen = send_recv(tdst, IGMP_MTRACE, hops, tries, &base);
/*
* If the initial query was successful, print it. Otherwise, if
@@ -2839,22 +2372,19 @@ char *argv[];
* send multicast packets because all phyints are disabled.
*/
if (recvlen) {
+ hopbyhop = FALSE;
printf("\n 0 ");
print_host(qdst);
printf("\n");
- print_trace(1, &base, names);
+ print_trace(1, &base);
r = base.resps + base.len - 1;
if (r->tr_rflags == TR_OLD_ROUTER || r->tr_rflags == TR_NO_SPACE ||
- (qno != 0 && r->tr_rmtaddr != 0 && !fflag)) {
+ (qno != 0 && r->tr_rmtaddr != 0)) {
printf("%3d ", -(base.len+1));
what_kind(&base, r->tr_rflags == TR_OLD_ROUTER ?
"doesn't support mtrace"
: "is the next hop");
} else {
- if (fflag) {
- nexthop = hops = qno;
- goto continuehop;
- }
VAL_TO_MASK(smask, r->tr_smask);
if ((r->tr_inaddr & smask) == (qsrc & smask)) {
printf("%3d ", -(base.len+1));
@@ -2881,17 +2411,15 @@ char *argv[];
* reduces the amount of multicast traffic and avoids a bug
* with duplicate suppression in mrouted 3.5.
*/
- if (hops == 2 && gwy == 0 && lastout != 0 &&
- (recvlen = send_recv(lastout, IGMP_MTRACE, hops, 1, &base, mtrace_callback)))
+ if (hops == 2 && gwy == 0 &&
+ (recvlen = send_recv(lastout, IGMP_MTRACE, hops, 1, &base)))
tdst = lastout;
- else recvlen = send_recv(tdst, IGMP_MTRACE, hops, nqueries, &base, mtrace_callback);
+ else recvlen = send_recv(tdst, IGMP_MTRACE, hops, nqueries, &base);
if (recvlen == 0) {
- /*if (hops == 1) break;*/
+ if (hops == 1) break;
if (hops == nexthop) {
- if (hops == 1) {
- printf("\n");
- } else if (what_kind(&base, "didn't respond")) {
+ if (what_kind(&base, "didn't respond")) {
/* the ask_neighbors determined that the
* not-responding router is the first-hop. */
break;
@@ -2909,10 +2437,10 @@ char *argv[];
if (base.len == hops &&
(hops == 1 || (base.resps+nexthop-2)->tr_outaddr == lastout)) {
if (hops == nexthop) {
- print_trace(-hops, &base, names);
+ print_trace(-hops, &base);
} else {
printf("\nResuming...\n");
- print_trace(nexthop, &base, names);
+ print_trace(nexthop, &base);
}
} else {
if (base.len < hops) {
@@ -2931,26 +2459,20 @@ char *argv[];
*/
if (nexthop <= base.len) {
printf("\nResuming...\n");
- print_trace(nexthop, &base, names);
+ print_trace(nexthop, &base);
} else if (nexthop > base.len + 1) {
hops = base.len;
printf("\nRoute must have changed...\n");
- print_trace(1, &base, names);
+ print_trace(1, &base);
}
} else {
/*
- * The last hop address is not the same as it was.
- * If we didn't know the last hop then we just
- * got the first response from a hop-by-hop trace;
- * if we did know the last hop then
+ * The last hop address is not the same as it was;
* the route probably changed underneath us.
*/
hops = base.len;
- if (lastout != 0)
- printf("\nRoute must have changed...\n");
- else
- printf("\nResuming...\n");
- print_trace(1, &base, names);
+ printf("\nRoute must have changed...\n");
+ print_trace(1, &base);
}
}
continuehop:
@@ -3005,7 +2527,7 @@ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
rno = base.len - 1;
while (--rno > 0) {
--n;
- ttl = MaX(ttl, MaX(1, n->tr_fttl) + base.len - rno);
+ ttl = MaX(ttl, n->tr_fttl + base.len - rno);
}
printf("total ttl of %d required.\n\n",ttl);
}
@@ -3015,7 +2537,7 @@ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
* and make additional probes after delay to measure loss.
*/
raddr = base.qhdr.tr_raddr;
- rttl = TR_GETTTL(base.qhdr.tr_rttlqid);
+ rttl = base.qhdr.tr_rttl;
gettimeofday(&tv, 0);
waittime = statint - (((tv.tv_sec + JAN_1970) & 0xFFFF) - (base.qtime >> 16));
prev = &base;
@@ -3032,17 +2554,13 @@ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
while (numstats--) {
if (waittime < 1) printf("\n");
else {
- if (printstats && (lossthresh == 0 || printed)) {
- printf("Waiting to accumulate statistics...");
- } else {
- printf(".");
- }
+ printf("%s", printstats ? "Waiting to accumulate statistics... "
+ : ".");
fflush(stdout);
sleep((unsigned)waittime);
}
- printed = 0;
rno = hopbyhop ? base.len : qno ? qno : MAXHOPS;
- recvlen = send_recv(tdst, IGMP_MTRACE, rno, nqueries, new, mtrace_callback);
+ recvlen = send_recv(tdst, IGMP_MTRACE, rno, nqueries, new);
if (recvlen == 0) {
printf("Timed out.\n");
@@ -3061,7 +2579,7 @@ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
(int)((new->qtime - base.qtime) >> 16));
printf(":\n");
printandcontinue:
- print_trace(1, new, names);
+ print_trace(1, new);
numstats++;
bcopy(new, &base, sizeof(base));
nexthop = hops = new->len;
@@ -3070,31 +2588,13 @@ printandcontinue:
}
if (printstats) {
- if (new->igmp.igmp_group.s_addr != qgrp ||
- new->qhdr.tr_src != qsrc || new->qhdr.tr_dst != qdst)
- printf("\nWARNING: trace modified en route; statistics may be incorrect\n");
+ printf("Results after %d seconds:\n\n",
+ (int)((new->qtime - base.qtime) >> 16));
fixup_stats(&base, prev, new, bugs);
- if ((lossthresh == 0) || check_thresh(lossthresh, &base, prev, new)) {
- printf("Results after %d seconds",
- (int)((new->qtime - base.qtime) >> 16));
- if (lossthresh)
- printf(" (this trace %d seconds)",
- (int)((new->qtime - prev->qtime) >> 16));
- if (verbose) {
- time_t t = time(0);
- struct tm *qr = localtime(&t);
-
- printf(" qid 0x%06x at %2d:%02d:%02d",
- TR_GETQID(base.qhdr.tr_rttlqid),
- qr->tm_hour, qr->tm_min, qr->tm_sec);
- }
- printf(":\n\n");
- printed = 1;
- if (print_stats(&base, prev, new, bugs, names)) {
- printf("This should have been detected earlier, but ");
- printf("Route changed:\n");
- goto printandcontinue;
- }
+ if (print_stats(&base, prev, new, bugs)) {
+ printf("This should have been detected earlier, but ");
+ printf("Route changed:\n");
+ goto printandcontinue;
}
}
prev = new;
@@ -3116,9 +2616,9 @@ static void
usage()
{
fprintf(stderr, "%s\n%s\n%s\n",
- "usage: mtrace [-MUOPTWVlnpvs] [-e extra_hops] [-f first_hop] [-i if_addr]",
- " [-g gateway] [-m max_hops] [-q nqueries] [-r resp_dest]",
- " [-S statint] [-t ttl] [-w wait] source [receiver] [group]");
+ "usage: mtrace [-Mlnps] [-w wait] [-m max_hops] [-q nqueries]",
+ " [-g gateway] [-S statint] [-t ttl] [-r resp_dest]",
+ " [-i if_addr] source [receiver] [group]");
exit(1);
}
@@ -3175,3 +2675,92 @@ log(severity, syserr, format, va_alist)
}
if (severity <= LOG_ERR) exit(1);
}
+
+/* dummies */
+void accept_probe(src, dst, p, datalen, level)
+ u_int32 src, dst, level;
+ char *p;
+ int datalen;
+{
+}
+void accept_group_report(src, dst, group, r_type)
+ u_int32 src, dst, group;
+ int r_type;
+{
+}
+void accept_neighbor_request2(src, dst)
+ u_int32 src, dst;
+{
+}
+void accept_report(src, dst, p, datalen, level)
+ u_int32 src, dst, level;
+ char *p;
+ int datalen;
+{
+}
+void accept_neighbor_request(src, dst)
+ u_int32 src, dst;
+{
+}
+void accept_prune(src, dst, p, datalen)
+ u_int32 src, dst;
+ char *p;
+ int datalen;
+{
+}
+void accept_graft(src, dst, p, datalen)
+ u_int32 src, dst;
+ char *p;
+ int datalen;
+{
+}
+void accept_g_ack(src, dst, p, datalen)
+ u_int32 src, dst;
+ char *p;
+ int datalen;
+{
+}
+void add_table_entry(origin, mcastgrp)
+ u_int32 origin, mcastgrp;
+{
+}
+void accept_leave_message(src, dst, group)
+ u_int32 src, dst, group;
+{
+}
+void accept_mtrace(src, dst, group, data, no, datalen)
+ u_int32 src, dst, group;
+ char *data;
+ u_int no;
+ int datalen;
+{
+}
+void accept_membership_query(src, dst, group, tmo)
+ u_int32 src, dst, group;
+ int tmo;
+{
+}
+void accept_neighbors(src, dst, p, datalen, level)
+ u_int32 src, dst, level;
+ u_char *p;
+ int datalen;
+{
+}
+void accept_neighbors2(src, dst, p, datalen, level)
+ u_int32 src, dst, level;
+ u_char *p;
+ int datalen;
+{
+}
+void accept_info_request(src, dst, p, datalen)
+ u_int32 src, dst;
+ u_char *p;
+ int datalen;
+{
+}
+void accept_info_reply(src, dst, p, datalen)
+ u_int32 src, dst;
+ u_char *p;
+ int datalen;
+{
+}
diff --git a/usr.sbin/mrouted/mtrace.h b/usr.sbin/mrouted/mtrace.h
index e67dbd0fa145..1d704910475b 100644
--- a/usr.sbin/mrouted/mtrace.h
+++ b/usr.sbin/mrouted/mtrace.h
@@ -1,31 +1,31 @@
/*
* Multicast traceroute related definitions
*
- * mtrace.h,v 5.2 1998/12/04 04:48:21 fenner Exp
+ * mtrace.h,v 5.1 1996/12/19 21:31:26 fenner Exp
*/
/*
- * NetBSD renamed the mtrace packet types.
- */
-#if !defined(IGMP_MTRACE_RESP) && defined(IGMP_MTRACE_REPLY)
-#define IGMP_MTRACE_RESP IGMP_MTRACE_REPLY
-#define IGMP_MTRACE IGMP_MTRACE_QUERY
-#endif
-
-/*
* The packet format for a traceroute request.
*/
struct tr_query {
u_int32 tr_src; /* traceroute source */
u_int32 tr_dst; /* traceroute destination */
u_int32 tr_raddr; /* traceroute response address */
- u_int32 tr_rttlqid; /* response ttl and qid */
+#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
+ struct {
+ u_int qid : 24; /* traceroute query id */
+ u_int ttl : 8; /* traceroute response ttl */
+ } q;
+#else
+ struct {
+ u_int ttl : 8; /* traceroute response ttl */
+ u_int qid : 24; /* traceroute query id */
+ } q;
+#endif /* BYTE_ORDER */
};
-#define TR_SETTTL(x, ttl) (x = (x & 0x00ffffff) | ((ttl) << 24))
-#define TR_GETTTL(x) (((x) >> 24) & 0xff)
-#define TR_SETQID(x, qid) (x = (x & 0xff000000) | ((qid) & 0x00ffffff))
-#define TR_GETQID(x) ((x) & 0x00ffffff)
+#define tr_rttl q.ttl
+#define tr_qid q.qid
/*
* Traceroute response format. A traceroute response has a tr_query at the
@@ -46,6 +46,8 @@ struct tr_resp {
};
/* defs within mtrace */
+#define QUERY 1
+#define RESP 2
#define QLEN sizeof(struct tr_query)
#define RLEN sizeof(struct tr_resp)
@@ -72,10 +74,6 @@ struct tr_resp {
#define PROTO_PIM_SPECIAL 5
#define PROTO_PIM_STATIC 6
#define PROTO_DVMRP_STATIC 7
-#define PROTO_PIM_BGP4PLUS 8
-#define PROTO_CBT_SPECIAL 9
-#define PROTO_CBT_STATIC 10
-#define PROTO_PIM_ASSERT 11
#define VAL_TO_MASK(x, i) { \
x = htonl(~((1 << (32 - (i))) - 1)); \
diff --git a/usr.sbin/mrouted/pathnames.h b/usr.sbin/mrouted/pathnames.h
index 0c30420900c7..b8fb6baf4333 100644
--- a/usr.sbin/mrouted/pathnames.h
+++ b/usr.sbin/mrouted/pathnames.h
@@ -7,8 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: pathnames.h,v 1.5 1997/02/22 16:07:01 peter Exp $
- * pathnames.h,v 3.8 1995/11/29 22:36:57 fenner Rel
+ * $Id$
*/
#define _PATH_MROUTED_CONF "/etc/mrouted.conf"
diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c
index 358613702a79..23ba6384bd03 100644
--- a/usr.sbin/mrouted/prune.c
+++ b/usr.sbin/mrouted/prune.c
@@ -5,37 +5,45 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * prune.c,v 3.8.4.59 1998/03/01 02:06:32 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: prune.c,v 1.15 1998/01/16 07:17:44 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
extern int cache_lifetime;
-extern int prune_lifetime;
+extern int max_prune_lifetime;
extern struct rtentry *routing_table;
extern int phys_vif;
-extern int allow_black_holes;
-
/*
- * randomize value to obtain a value between .5x and 1.5x
- * in order to prevent synchronization
+ * dither cache lifetime to obtain a value between x and 2*x
*/
#ifdef SYSV
-#define JITTERED_VALUE(x) ((x)/2 + (lrand48() % (x)))
+#define CACHE_LIFETIME(x) ((x) + (lrand48() % (x)))
#else
-#define JITTERED_VALUE(x) ((x)/2 + (random() % (x)))
+#define CACHE_LIFETIME(x) ((x) + (random() % (x)))
#endif
-#define CACHE_LIFETIME(x) JITTERED_VALUE(x) /* XXX */
+#define CHK_GS(x, y) { \
+ switch(x) { \
+ case 2: \
+ case 4: \
+ case 8: \
+ case 16: \
+ case 32: \
+ case 64: \
+ case 128: \
+ case 256: y = 1; \
+ break; \
+ default: y = 0; \
+ } \
+ }
+
struct gtable *kernel_table; /* ptr to list of kernel grp entries*/
static struct gtable *kernel_no_route; /* list of grp entries w/o routes */
struct gtable *gtp; /* pointer for kernel rt entries */
@@ -44,20 +52,17 @@ unsigned int kroutes; /* current number of cache entries */
/****************************************************************************
Functions that are local to prune.c
****************************************************************************/
-static int scoped_addr __P((vifi_t vifi, u_int32 addr));
static void prun_add_ttls __P((struct gtable *gt));
static int pruning_neighbor __P((vifi_t vifi, u_int32 addr));
static int can_mtrace __P((vifi_t vifi, u_int32 addr));
static struct ptable * find_prune_entry __P((u_int32 vr, struct ptable *pt));
-static void remove_sources __P((struct gtable *gt));
-static void rexmit_prune __P((void *arg));
static void expire_prune __P((vifi_t vifi, struct gtable *gt));
static void send_prune __P((struct gtable *gt));
static void send_graft __P((struct gtable *gt));
static void send_graft_ack __P((u_int32 src, u_int32 dst,
- u_int32 origin, u_int32 grp,
- vifi_t vifi));
+ u_int32 origin, u_int32 grp));
static void update_kernel __P((struct gtable *g));
+static char * scaletime __P((u_long t));
/*
* Updates the ttl values for each vif.
@@ -79,34 +84,16 @@ prun_add_ttls(gt)
/*
* checks for scoped multicast addresses
- * XXX I want to make the check of allow_black_holes based on ALLOW_BLACK_HOLES
- * but macros are not functions.
*/
#define GET_SCOPE(gt) { \
register vifi_t _i; \
- VIFM_CLRALL((gt)->gt_scope); \
- if (allow_black_holes || \
- (ntohl((gt)->gt_mcastgrp) & 0xff000000) == 0xef000000) \
+ if ((ntohl((gt)->gt_mcastgrp) & 0xff000000) == 0xef000000) \
for (_i = 0; _i < numvifs; _i++) \
if (scoped_addr(_i, (gt)->gt_mcastgrp)) \
VIFM_SET(_i, (gt)->gt_scope); \
- } \
- if ((gt)->gt_route == NULL || ((gt)->gt_route->rt_parent != NO_VIF && \
- VIFM_ISSET((gt)->gt_route->rt_parent, (gt)->gt_scope))) \
- VIFM_SETALL((gt)->gt_scope);
-
-#define APPLY_SCOPE(gt) VIFM_CLR_MASK((gt)->gt_grpmems, (gt)->gt_scope)
-
-#define GET_MEMBERSHIP(gt, vifi) { \
- if ((gt)->gt_route && \
- VIFM_ISSET((vifi), (gt)->gt_route->rt_children) && \
- (!SUBS_ARE_PRUNED((gt)->gt_route->rt_subordinates, \
- uvifs[vifi].uv_nbrmap, (gt)->gt_prunes) || \
- grplst_mem((vifi), (gt)->gt_mcastgrp))) \
- VIFM_SET((vifi), (gt)->gt_grpmems); \
}
-static int
+int
scoped_addr(vifi, addr)
vifi_t vifi;
u_int32 addr;
@@ -120,38 +107,6 @@ scoped_addr(vifi, addr)
return 0;
}
-/*
- * Determine the list of outgoing vifs, based upon
- * route subordinates, prunes received, and group
- * memberships.
- */
-void
-determine_forwvifs(gt)
- struct gtable *gt;
-{
- vifi_t i;
-
- VIFM_CLRALL(gt->gt_grpmems);
- for (i = 0; i < numvifs; i++) {
- GET_MEMBERSHIP(gt, i);
- }
- GET_SCOPE(gt);
- APPLY_SCOPE(gt);
-}
-
-/*
- * Send a prune or a graft if necessary.
- */
-void
-send_prune_or_graft(gt)
- struct gtable *gt;
-{
- if (VIFM_ISEMPTY(gt->gt_grpmems))
- send_prune(gt);
- else if (gt->gt_prsent_timer)
- send_graft(gt);
-}
-
/*
* Determine if mcastgrp has a listener on vifi
*/
@@ -226,8 +181,15 @@ pruning_neighbor(vifi, addr)
if (n == NULL)
return 0;
+ if (n->al_flags & NF_PRUNE)
+ return 1;
+
+ /*
+ * Versions from 3.0 to 3.4 relied on the version number to identify
+ * that they could handle pruning.
+ */
vers = NBR_VERS(n);
- return (vers >= 0x0300 && ((vers & 0xff00) != 0x0a00));
+ return (vers >= 0x0300 && vers <= 0x0304);
}
/*
@@ -242,10 +204,17 @@ can_mtrace(vifi, addr)
int vers;
if (n == NULL)
- return 1; /* fail "safe" */
+ return 0;
+ if (n->al_flags & NF_MTRACE)
+ return 1;
+
+ /*
+ * Versions 3.3 and 3.4 relied on the version number to identify
+ * that they could handle traceroute.
+ */
vers = NBR_VERS(n);
- return (vers >= 0x0303 && ((vers & 0xff00) != 0x0a00));
+ return (vers >= 0x0303 && vers <= 0x0304);
}
/*
@@ -266,76 +235,6 @@ find_prune_entry(vr, pt)
}
/*
- * Remove all the sources hanging off the group table entry from the kernel
- * cache. Remember the packet counts wherever possible, to keep the mtrace
- * counters consistent. This prepares for possible prune retransmission,
- * either on a multi-access network or when a prune that we sent upstream
- * has expired.
- */
-static void
-remove_sources(gt)
- struct gtable *gt;
-{
- struct stable *st;
- struct sioc_sg_req sg_req;
-
- sg_req.grp.s_addr = gt->gt_mcastgrp;
-
- /*
- * call k_del_rg() on every one of the gt->gt_srctbl entries
- * but first save the packet count so that the mtrace packet
- * counters can remain approximately correct. There's a race
- * here but it's minor.
- */
- for (st = gt->gt_srctbl; st; st = st->st_next) {
- if (st->st_ctime == 0)
- continue;
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "rexmit_prune deleting (%s %s) (next is %d sec)",
- inet_fmt(st->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2),
- gt->gt_prune_rexmit);
- sg_req.src.s_addr = st->st_origin;
- if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) < 0) {
- sg_req.pktcnt = 0;
- }
- k_del_rg(st->st_origin, gt);
- st->st_ctime = 0; /* flag that it's not in the kernel any more */
- st->st_savpkt += sg_req.pktcnt;
- kroutes--;
- }
-
- /*
- * Now, add_table_entry will prune when asked to add a cache entry.
- */
-}
-
-/*
- * Prepare for possible prune retransmission
- */
-static void
-rexmit_prune(arg)
- void *arg;
-{
- struct gtable *gt = *(struct gtable **)arg;
-
- free(arg);
-
- gt->gt_rexmit_timer = 0;
-
- /* Make sure we're still not forwarding traffic */
- if (!VIFM_ISEMPTY(gt->gt_grpmems)) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "rexmit_prune (%s %s): gm:%x",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
- gt->gt_grpmems);
- return;
- }
-
- remove_sources(gt);
-}
-
-/*
* Send a prune message to the dominant router for
* this source.
*
@@ -349,77 +248,38 @@ send_prune(gt)
char *p;
int i;
int datalen;
+ u_int32 src;
u_int32 dst;
u_int32 tmp;
- int rexmitting = 0;
- struct uvif *v;
- /*
- * Can't process a prune if we don't have an associated route
- * or if the route points to a local interface.
- */
- if (gt->gt_route == NULL || gt->gt_route->rt_parent == NO_VIF ||
- gt->gt_route->rt_gateway == 0)
+ /* Don't process any prunes if router is not pruning */
+ if (pruning == 0)
+ return;
+
+ /* Can't process a prune if we don't have an associated route */
+ if (gt->gt_route == NULL)
return;
/* Don't send a prune to a non-pruning router */
if (!pruning_neighbor(gt->gt_route->rt_parent, gt->gt_route->rt_gateway))
return;
- v = &uvifs[gt->gt_route->rt_parent];
/*
* sends a prune message to the router upstream.
*/
-#if 0
- dst = v->uv_flags & VIFF_TUNNEL ? dvmrp_group : gt->gt_route->rt_gateway; /*XXX*/
-#else
+ src = uvifs[gt->gt_route->rt_parent].uv_lcl_addr;
dst = gt->gt_route->rt_gateway;
-#endif
p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
datalen = 0;
/*
- * determine prune lifetime, if this isn't a retransmission.
- *
- * Use interface-specified lifetime if there is one.
+ * determine prune lifetime
*/
- if (gt->gt_prsent_timer == 0) {
- int l = prune_lifetime;
-
- if (v->uv_prune_lifetime != 0)
- l = v->uv_prune_lifetime;
-
- gt->gt_prsent_timer = JITTERED_VALUE(l);
- for (pt = gt->gt_pruntbl; pt; pt = pt->pt_next)
- if (pt->pt_timer < gt->gt_prsent_timer)
- gt->gt_prsent_timer = pt->pt_timer;
- } else if (gt->gt_prsent_timer < 0) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "asked to rexmit? (%s,%s)/%d on vif %d to %s with negative time",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
- gt->gt_prsent_timer, gt->gt_route->rt_parent,
- inet_fmt(gt->gt_route->rt_gateway, s3));
- return;
- } else
- rexmitting = 1;
-
- if (rexmitting && !(v->uv_flags & VIFF_REXMIT_PRUNES)) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "not rexmitting prune for (%s %s)/%d on vif %d to %s",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
- gt->gt_prsent_timer, gt->gt_route->rt_parent,
- inet_fmt(gt->gt_route->rt_gateway, s3));
- return;
- }
- if (gt->gt_prsent_timer <= MIN_PRUNE_LIFE) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "not bothering to send prune for (%s,%s)/%d on vif %d to %s because it's too short",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
- gt->gt_prsent_timer, gt->gt_route->rt_parent,
- inet_fmt(gt->gt_route->rt_gateway, s3));
- return;
- }
+ gt->gt_prsent_timer = gt->gt_timer;
+ for (pt = gt->gt_pruntbl; pt; pt = pt->pt_next)
+ if (pt->pt_timer < gt->gt_prsent_timer)
+ gt->gt_prsent_timer = pt->pt_timer;
/*
* If we have a graft pending, cancel graft retransmission
@@ -435,27 +295,14 @@ send_prune(gt)
*p++ = ((char *)&(tmp))[i];
datalen += 12;
- send_on_vif(v, dst, DVMRP_PRUNE, datalen);
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_PRUNE,
+ htonl(MROUTED_LEVEL), datalen);
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "%s prune for (%s %s)/%d on vif %d to %s",
- rexmitting ? "rexmitted" : "sent",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
+ log(LOG_DEBUG, 0, "sent prune for (%s %s)/%d on vif %d to %s",
+ inet_fmts(gt->gt_route->rt_origin, gt->gt_route->rt_originmask, s1),
+ inet_fmt(gt->gt_mcastgrp, s2),
gt->gt_prsent_timer, gt->gt_route->rt_parent,
inet_fmt(gt->gt_route->rt_gateway, s3));
-
- if ((v->uv_flags & VIFF_REXMIT_PRUNES) &&
- gt->gt_rexmit_timer == 0 &&
- gt->gt_prsent_timer > gt->gt_prune_rexmit) {
- struct gtable **arg =
- (struct gtable **)malloc(sizeof (struct gtable **));
-
- *arg = gt;
- gt->gt_rexmit_timer = timer_setTimer(
- JITTERED_VALUE(gt->gt_prune_rexmit),
- rexmit_prune, arg);
- gt->gt_prune_rexmit *= 2;
- }
}
/*
@@ -472,28 +319,16 @@ send_graft(gt)
register char *p;
register int i;
int datalen;
+ u_int32 src;
u_int32 dst;
/* Can't send a graft without an associated route */
- if (gt->gt_route == NULL || gt->gt_route->rt_parent == NO_VIF) {
- gt->gt_grftsnt = 0;
+ if (gt->gt_route == NULL)
return;
- }
-
- gt->gt_prsent_timer = 0;
- gt->gt_prune_rexmit = PRUNE_REXMIT_VAL;
- if (gt->gt_rexmit_timer)
- timer_clearTimer(gt->gt_rexmit_timer);
-
- if (gt->gt_grftsnt == 0)
- gt->gt_grftsnt = 1;
-
-#if 0
- dst = uvifs[gt->gt_route->rt_parent].uv_flags & VIFF_TUNNEL ? dvmrp_group : gt->gt_route->rt_gateway; /*XXX*/
-#else
+
+ src = uvifs[gt->gt_route->rt_parent].uv_lcl_addr;
dst = gt->gt_route->rt_gateway;
-#endif
-
+
p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
datalen = 0;
@@ -503,10 +338,13 @@ send_graft(gt)
*p++ = ((char *)&(gt->gt_mcastgrp))[i];
datalen += 8;
- send_on_vif(&uvifs[gt->gt_route->rt_parent], dst, DVMRP_GRAFT, datalen);
- IF_DEBUG(DEBUG_PRUNE)
+ if (datalen != 0) {
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_GRAFT,
+ htonl(MROUTED_LEVEL), datalen);
+ }
log(LOG_DEBUG, 0, "sent graft for (%s %s) to %s on vif %d",
- RT_FMT(gt->gt_route, s1), inet_fmt(gt->gt_mcastgrp, s2),
+ inet_fmts(gt->gt_route->rt_origin, gt->gt_route->rt_originmask, s1),
+ inet_fmt(gt->gt_mcastgrp, s2),
inet_fmt(gt->gt_route->rt_gateway, s3), gt->gt_route->rt_parent);
}
@@ -514,12 +352,11 @@ send_graft(gt)
* Send an ack that a graft was received
*/
static void
-send_graft_ack(src, dst, origin, grp, vifi)
+send_graft_ack(src, dst, origin, grp)
u_int32 src;
u_int32 dst;
u_int32 origin;
u_int32 grp;
- vifi_t vifi;
{
register char *p;
register int i;
@@ -534,24 +371,11 @@ send_graft_ack(src, dst, origin, grp, vifi)
*p++ = ((char *)&(grp))[i];
datalen += 8;
- if (vifi == NO_VIF)
- send_igmp(src, dst, IGMP_DVMRP, DVMRP_GRAFT_ACK,
- htonl(MROUTED_LEVEL), datalen);
- else {
-#if 0
- if (uvifs[vifi].uv_flags & VIFF_TUNNEL)
- dst = dvmrp_group; /* XXX */
-#endif
- send_on_vif(&uvifs[vifi], dst, DVMRP_GRAFT_ACK, datalen);
- }
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_GRAFT_ACK,
+ htonl(MROUTED_LEVEL), datalen);
- IF_DEBUG(DEBUG_PRUNE)
- if (vifi == NO_VIF)
- log(LOG_DEBUG, 0, "sent graft ack for (%s, %s) to %s",
- inet_fmt(origin, s1), inet_fmt(grp, s2), inet_fmt(dst, s3));
- else
- log(LOG_DEBUG, 0, "sent graft ack for (%s, %s) to %s on vif %d",
- inet_fmt(origin, s1), inet_fmt(grp, s2), inet_fmt(dst, s3), vifi);
+ log(LOG_DEBUG, 0, "sent graft ack for (%s, %s) to %s",
+ inet_fmt(origin, s1), inet_fmt(grp, s2), inet_fmt(dst, s3));
}
/*
@@ -564,8 +388,7 @@ update_kernel(g)
struct stable *st;
for (st = g->gt_srctbl; st; st = st->st_next)
- if (st->st_ctime != 0)
- k_add_rg(st->st_origin, g);
+ k_add_rg(st->st_origin, g);
}
/****************************************************************************
@@ -581,7 +404,7 @@ update_kernel(g)
*/
struct gtable *
find_grp(grp)
- u_int32 grp;
+ u_long grp;
{
struct gtable *gt;
@@ -601,7 +424,7 @@ find_grp(grp)
struct stable *
find_grp_src(gt, src)
struct gtable *gt;
- u_int32 src;
+ u_long src;
{
struct stable *st;
u_long grp = gt->gt_mcastgrp;
@@ -622,9 +445,9 @@ int
next_grp_src_mask(gtpp, stpp, grp, src, mask)
struct gtable **gtpp; /* ordered by group */
struct stable **stpp; /* ordered by source */
- u_int32 grp;
- u_int32 src;
- u_int32 mask;
+ u_long grp;
+ u_long src;
+ u_long mask;
{
struct gtable *gt, *gbest = NULL;
struct stable *st, *sbest = NULL;
@@ -686,6 +509,76 @@ refresh_sg(sg, gt, st)
}
/*
+ * Return pointer to a specific route entry. This must be a separate
+ * function from find_route() which modifies rtp.
+ */
+struct rtentry *
+snmp_find_route(src, mask)
+ register u_long src, mask;
+{
+ register struct rtentry *rt;
+
+ for (rt = routing_table; rt; rt = rt->rt_next) {
+ if (src == rt->rt_origin && mask == rt->rt_originmask)
+ return rt;
+ }
+ return NULL;
+}
+
+/*
+ * Find next route entry > specification
+ */
+int
+next_route(rtpp, src, mask)
+ struct rtentry **rtpp;
+ u_long src;
+ u_long mask;
+{
+ struct rtentry *rt, *rbest = NULL;
+
+ /* Among all entries > spec, find "lowest" one in order */
+ for (rt = routing_table; rt; rt=rt->rt_next) {
+ if ((ntohl(rt->rt_origin) > ntohl(src)
+ || (ntohl(rt->rt_origin) == ntohl(src)
+ && ntohl(rt->rt_originmask) > ntohl(mask)))
+ && (!rbest || (ntohl(rt->rt_origin) < ntohl(rbest->rt_origin))
+ || (ntohl(rt->rt_origin) == ntohl(rbest->rt_origin)
+ && ntohl(rt->rt_originmask) < ntohl(rbest->rt_originmask))))
+ rbest = rt;
+ }
+ (*rtpp) = rbest;
+ return (*rtpp)!=0;
+}
+
+/*
+ * Given a routing table entry, and a vifi, find the next vifi/entry
+ */
+int
+next_route_child(rtpp, src, mask, vifi)
+ struct rtentry **rtpp;
+ u_long src;
+ u_long mask;
+ vifi_t *vifi; /* vif at which to start looking */
+{
+ struct rtentry *rt;
+
+ /* Get (S,M) entry */
+ if (!((*rtpp) = snmp_find_route(src,mask)))
+ if (!next_route(rtpp, src, mask))
+ return 0;
+
+ /* Continue until we get one with a valid next vif */
+ do {
+ for (; (*rtpp)->rt_children && *vifi<numvifs; (*vifi)++)
+ if (VIFM_ISSET(*vifi, (*rtpp)->rt_children))
+ return 1;
+ *vifi = 0;
+ } while( next_route(rtpp, (*rtpp)->rt_origin, (*rtpp)->rt_originmask) );
+
+ return 0;
+}
+
+/*
* Given a routing table entry, and a vifi, find the next entry
* equal to or greater than those
*/
@@ -693,11 +586,13 @@ int
next_child(gtpp, stpp, grp, src, mask, vifi)
struct gtable **gtpp;
struct stable **stpp;
- u_int32 grp;
- u_int32 src;
- u_int32 mask;
+ u_long grp;
+ u_long src;
+ u_long mask;
vifi_t *vifi; /* vif at which to start looking */
{
+ struct stable *st;
+
/* Get (G,S,M) entry */
if (mask!=0xFFFFFFFF
|| !((*gtpp) = find_grp(grp))
@@ -740,15 +635,7 @@ add_table_entry(origin, mcastgrp)
struct rtentry *r;
struct gtable *gt,**gtnp,*prev_gt;
struct stable *st,**stnp;
-
- /*
- * Since we have to enable mrouting to get the version number,
- * some cache creation requests can sneak through. Ignore them
- * since we're not going to do useful stuff until we've performed
- * final initialization.
- */
- if (!did_final_init)
- return;
+ vifi_t i;
#ifdef DEBUG_MFC
md_log(MD_MISS, origin, mcastgrp);
@@ -784,20 +671,35 @@ add_table_entry(origin, mcastgrp)
gt->gt_mcastgrp = mcastgrp;
gt->gt_timer = CACHE_LIFETIME(cache_lifetime);
time(&gt->gt_ctime);
+ gt->gt_grpmems = 0;
+ gt->gt_scope = 0;
gt->gt_prsent_timer = 0;
gt->gt_grftsnt = 0;
gt->gt_srctbl = NULL;
gt->gt_pruntbl = NULL;
gt->gt_route = r;
- gt->gt_rexmit_timer = 0;
- NBRM_CLRALL(gt->gt_prunes);
- gt->gt_prune_rexmit = PRUNE_REXMIT_VAL;
#ifdef RSRR
gt->gt_rsrr_cache = NULL;
#endif
- /* Calculate forwarding vifs */
- determine_forwvifs(gt);
+ if (r != NULL) {
+ /* obtain the multicast group membership list */
+ for (i = 0; i < numvifs; i++) {
+ if (VIFM_ISSET(i, r->rt_children) &&
+ !(VIFM_ISSET(i, r->rt_leaves)))
+ VIFM_SET(i, gt->gt_grpmems);
+
+ if (VIFM_ISSET(i, r->rt_leaves) && grplst_mem(i, mcastgrp))
+ VIFM_SET(i, gt->gt_grpmems);
+ }
+ GET_SCOPE(gt);
+ if (VIFM_ISSET(r->rt_parent, gt->gt_scope))
+ gt->gt_scope = -1;
+ gt->gt_grpmems &= ~gt->gt_scope;
+ } else {
+ gt->gt_scope = -1;
+ gt->gt_grpmems = 0;
+ }
/* update ttls */
prun_add_ttls(gt);
@@ -814,7 +716,8 @@ add_table_entry(origin, mcastgrp)
g = gtp ? gtp->gt_gnext : kernel_table;
log(LOG_WARNING, 0, "Entry for (%s %s) (rt:%x) exists (rt:%x)",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
+ inet_fmt(g->gt_mcastgrp, s2),
r, g->gt_route);
} else {
if (gtp) {
@@ -848,46 +751,39 @@ add_table_entry(origin, mcastgrp)
st->st_origin = origin;
st->st_pktcnt = 0;
- st->st_savpkt = 0;
- time(&st->st_ctime);
st->st_next = *stnp;
*stnp = st;
} else {
- if (st->st_ctime == 0) {
- /* An old source which we're keeping around for statistics */
- time(&st->st_ctime);
- } else {
#ifdef DEBUG_MFC
- md_log(MD_DUPE, origin, mcastgrp);
+ md_log(MD_DUPE, origin, mcastgrp);
#endif
- /* Ignore kernel->mrouted retransmissions */
- if (time(0) - st->st_ctime > 5)
- log(LOG_WARNING, 0, "kernel entry already exists for (%s %s)",
- inet_fmt(origin, s1), inet_fmt(mcastgrp, s2));
- k_add_rg(origin, gt);
- return;
- }
+ log(LOG_WARNING, 0, "kernel entry already exists for (%s %s)",
+ inet_fmt(origin, s1), inet_fmt(mcastgrp, s2));
+ /* XXX Doing this should cause no harm, and may ensure
+ * kernel<>mrouted synchronization */
+ k_add_rg(origin, gt);
+ return;
}
kroutes++;
k_add_rg(origin, gt);
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "add cache entry (%s %s) gm:%x, parent-vif:%d",
inet_fmt(origin, s1),
inet_fmt(mcastgrp, s2),
gt->gt_grpmems, r ? r->rt_parent : -1);
-
- /*
- * If there are no downstream routers that want traffic for
- * this group, send (or retransmit) a prune upstream.
+
+ /* If there are no leaf vifs
+ * which have this group, then
+ * mark this src-grp as a prune candidate.
*/
- if (VIFM_ISEMPTY(gt->gt_grpmems))
+ if (!gt->gt_prsent_timer && !gt->gt_grpmems && r && r->rt_gateway)
send_prune(gt);
}
/*
- * A router has gone down. Remove prune state pertinent to that router.
+ * An mrouter has gone down and come up on an interface
+ * Forward on that interface immediately
*/
void
reset_neighbor_state(vifi, addr)
@@ -909,29 +805,35 @@ reset_neighbor_state(vifi, addr)
*/
if (vifi == r->rt_parent) {
if (addr == r->rt_gateway) {
- IF_DEBUG(DEBUG_PEER)
log(LOG_DEBUG, 0, "reset_neighbor_state parent reset (%s %s)",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2));
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
+ inet_fmt(g->gt_mcastgrp, s2));
g->gt_prsent_timer = 0;
g->gt_grftsnt = 0;
- while ((st = g->gt_srctbl) != NULL) {
+ while ((st = g->gt_srctbl)) {
g->gt_srctbl = st->st_next;
- if (st->st_ctime != 0) {
- k_del_rg(st->st_origin, g);
- kroutes--;
- }
+ k_del_rg(st->st_origin, g);
+ kroutes--;
free(st);
}
}
} else {
/*
+ * Neighbor was not the parent, send grafts to join the groups
+ */
+ if (g->gt_prsent_timer) {
+ g->gt_grftsnt = 1;
+ send_graft(g);
+ g->gt_prsent_timer = 0;
+ }
+
+ /*
* Remove any prunes that this router has sent us.
*/
ptnp = &g->gt_pruntbl;
while ((pt = *ptnp) != NULL) {
if (pt->pt_vifi == vifi && pt->pt_router == addr) {
- NBRM_CLR(pt->pt_index, g->gt_prunes);
*ptnp = pt->pt_next;
free(pt);
} else
@@ -942,8 +844,15 @@ reset_neighbor_state(vifi, addr)
* And see if we want to forward again.
*/
if (!VIFM_ISSET(vifi, g->gt_grpmems)) {
- GET_MEMBERSHIP(g, vifi);
- APPLY_SCOPE(g);
+ if (VIFM_ISSET(vifi, r->rt_children) &&
+ !(VIFM_ISSET(vifi, r->rt_leaves)))
+ VIFM_SET(vifi, g->gt_grpmems);
+
+ if (VIFM_ISSET(vifi, r->rt_leaves) &&
+ grplst_mem(vifi, g->gt_mcastgrp))
+ VIFM_SET(vifi, g->gt_grpmems);
+
+ g->gt_grpmems &= ~g->gt_scope;
prun_add_ttls(g);
/* Update kernel state */
@@ -953,17 +862,8 @@ reset_neighbor_state(vifi, addr)
rsrr_cache_send(g,1);
#endif /* RSRR */
- /*
- * If removing this prune causes us to start forwarding
- * (e.g. the neighbor rebooted), and we sent a prune upstream,
- * send a graft to cancel the prune.
- */
- if (!VIFM_ISEMPTY(g->gt_grpmems) && g->gt_prsent_timer)
- send_graft(g);
-
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "reset neighbor state (%s %s) gm:%x",
- RT_FMT(r, s1),
+ log(LOG_DEBUG, 0, "reset member state (%s %s) gm:%x",
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), g->gt_grpmems);
}
}
@@ -987,20 +887,18 @@ del_table_entry(r, mcastgrp, del_flag)
if (del_flag == DEL_ALL_ROUTES) {
g = r->rt_groups;
while (g) {
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "del_table_entry deleting (%s %s)",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2));
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
+ inet_fmt(g->gt_mcastgrp, s2));
st = g->gt_srctbl;
while (st) {
- if (st->st_ctime != 0) {
- if (k_del_rg(st->st_origin, g) < 0) {
- log(LOG_WARNING, errno,
- "del_table_entry trying to delete (%s, %s)",
- inet_fmt(st->st_origin, s1),
- inet_fmt(g->gt_mcastgrp, s2));
- }
- kroutes--;
+ if (k_del_rg(st->st_origin, g) < 0) {
+ log(LOG_WARNING, errno,
+ "del_table_entry trying to delete (%s, %s)",
+ inet_fmt(st->st_origin, s1),
+ inet_fmt(g->gt_mcastgrp, s2));
}
+ kroutes--;
prev_st = st;
st = st->st_next;
free(prev_st);
@@ -1027,9 +925,6 @@ del_table_entry(r, mcastgrp, del_flag)
rsrr_cache_send(g,0);
rsrr_cache_clean(g);
#endif /* RSRR */
- if (g->gt_rexmit_timer)
- timer_clearTimer(g->gt_rexmit_timer);
-
prev_g = g;
g = g->gt_next;
free(prev_g);
@@ -1044,20 +939,18 @@ del_table_entry(r, mcastgrp, del_flag)
prev_g = (struct gtable *)&r->rt_groups;
for (g = r->rt_groups; g; g = g->gt_next) {
if (g->gt_mcastgrp == mcastgrp) {
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "del_table_entry deleting (%s %s)",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2));
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
+ inet_fmt(g->gt_mcastgrp, s2));
st = g->gt_srctbl;
while (st) {
- if (st->st_ctime != 0) {
- if (k_del_rg(st->st_origin, g) < 0) {
- log(LOG_WARNING, errno,
- "del_table_entry trying to delete (%s, %s)",
- inet_fmt(st->st_origin, s1),
- inet_fmt(g->gt_mcastgrp, s2));
- }
- kroutes--;
+ if (k_del_rg(st->st_origin, g) < 0) {
+ log(LOG_WARNING, errno,
+ "del_table_entry trying to delete (%s, %s)",
+ inet_fmt(st->st_origin, s1),
+ inet_fmt(g->gt_mcastgrp, s2));
}
+ kroutes--;
prev_st = st;
st = st->st_next;
free(prev_st);
@@ -1085,8 +978,6 @@ del_table_entry(r, mcastgrp, del_flag)
g->gt_next->gt_prev = NULL;
prev_g->gt_next = g->gt_next;
- if (g->gt_rexmit_timer)
- timer_clearTimer(g->gt_rexmit_timer);
#ifdef RSRR
/* Send route change notification to reservation protocol. */
rsrr_cache_send(g,0);
@@ -1105,70 +996,48 @@ del_table_entry(r, mcastgrp, del_flag)
* update kernel table entry when a route entry changes
*/
void
-update_table_entry(r, old_parent_gw)
+update_table_entry(r)
struct rtentry *r;
- u_int32 old_parent_gw;
{
struct gtable *g;
- struct ptable *pt, **ptnp;
+ struct ptable *pt, *prev_pt;
+ vifi_t i;
for (g = r->rt_groups; g; g = g->gt_next) {
- ptnp = &g->gt_pruntbl;
- /*
- * Delete prune entries from non-children, or non-subordinates.
- */
- while ((pt = *ptnp)) {
- if (!VIFM_ISSET(pt->pt_vifi, r->rt_children) ||
- !NBRM_ISSET(pt->pt_index, r->rt_subordinates)) {
-
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "update_table_entry deleting prune for (%s %s) from %s on vif %d -%s%s",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2),
- inet_fmt(pt->pt_router, s3), pt->pt_vifi,
- VIFM_ISSET(pt->pt_vifi, r->rt_children) ? "" : " not a child",
- NBRM_ISSET(pt->pt_index, r->rt_subordinates) ? "" : " not a subordinate");
-
- if (!NBRM_ISSET(pt->pt_index, g->gt_prunes)) {
- log(LOG_WARNING, 0,
- "gt_prunes lost track of (%s %s) from %s on vif %d",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2),
- inet_fmt(pt->pt_router, s3), pt->pt_vifi);
- }
+ pt = g->gt_pruntbl;
+ while (pt) {
+ prev_pt = pt->pt_next;
+ free(pt);
+ pt = prev_pt;
+ }
+ g->gt_pruntbl = NULL;
- NBRM_CLR(pt->pt_index, g->gt_prunes);
- *ptnp = pt->pt_next;
- free(pt);
- continue;
- }
- ptnp = &((*ptnp)->pt_next);
+ g->gt_grpmems = 0;
+
+ /* obtain the multicast group membership list */
+ for (i = 0; i < numvifs; i++) {
+ if (VIFM_ISSET(i, r->rt_children) &&
+ !(VIFM_ISSET(i, r->rt_leaves)))
+ VIFM_SET(i, g->gt_grpmems);
+
+ if (VIFM_ISSET(i, r->rt_leaves) && grplst_mem(i, g->gt_mcastgrp))
+ VIFM_SET(i, g->gt_grpmems);
}
+ if (VIFM_ISSET(r->rt_parent, g->gt_scope))
+ g->gt_scope = -1;
+ g->gt_grpmems &= ~g->gt_scope;
- IF_DEBUG(DEBUG_CACHE)
- log(LOG_DEBUG, 0, "updating cache entries (%s %s) old gm:%x",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2),
+ log(LOG_DEBUG, 0, "updating cache entries (%s %s) gm:%x",
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
+ inet_fmt(g->gt_mcastgrp, s2),
g->gt_grpmems);
- /*
- * Forget about a prune or graft that we sent previously if we
- * have a new parent router (since the new parent router will
- * know nothing about what I sent to the previous parent). The
- * old parent will forget any prune state it is keeping for us.
- */
- if (old_parent_gw != r->rt_gateway) {
+ if (g->gt_grpmems && g->gt_prsent_timer) {
+ g->gt_grftsnt = 1;
+ send_graft(g);
g->gt_prsent_timer = 0;
- g->gt_grftsnt = 0;
}
- /* Recalculate membership */
- determine_forwvifs(g);
- /* send a prune or graft if needed. */
- send_prune_or_graft(g);
-
- IF_DEBUG(DEBUG_CACHE)
- log(LOG_DEBUG, 0, "updating cache entries (%s %s) new gm:%x",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2),
- g->gt_grpmems);
-
/* update ttls and add entry into kernel */
prun_add_ttls(g);
update_kernel(g);
@@ -1176,6 +1045,12 @@ update_table_entry(r, old_parent_gw)
/* Send route change notification to reservation protocol. */
rsrr_cache_send(g,1);
#endif /* RSRR */
+
+ /* Check if we want to prune this group */
+ if (!g->gt_prsent_timer && g->gt_grpmems == 0 && r->rt_gateway) {
+ g->gt_timer = CACHE_LIFETIME(cache_lifetime);
+ send_prune(g);
+ }
}
}
@@ -1190,7 +1065,6 @@ update_lclgrp(vifi, mcastgrp)
struct rtentry *r;
struct gtable *g;
- IF_DEBUG(DEBUG_MEMBER)
log(LOG_DEBUG, 0, "group %s joined on vif %d",
inet_fmt(mcastgrp, s1), vifi);
@@ -1203,14 +1077,13 @@ update_lclgrp(vifi, mcastgrp)
VIFM_ISSET(vifi, r->rt_children)) {
VIFM_SET(vifi, g->gt_grpmems);
- APPLY_SCOPE(g);
- if (VIFM_ISEMPTY(g->gt_grpmems))
+ g->gt_grpmems &= ~g->gt_scope;
+ if (g->gt_grpmems == 0)
continue;
prun_add_ttls(g);
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "update lclgrp (%s %s) gm:%x",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), g->gt_grpmems);
update_kernel(g);
@@ -1230,9 +1103,9 @@ delete_lclgrp(vifi, mcastgrp)
vifi_t vifi;
u_int32 mcastgrp;
{
+ struct rtentry *r;
struct gtable *g;
- IF_DEBUG(DEBUG_MEMBER)
log(LOG_DEBUG, 0, "group %s left on vif %d",
inet_fmt(mcastgrp, s1), vifi);
@@ -1240,14 +1113,28 @@ delete_lclgrp(vifi, mcastgrp)
if (ntohl(mcastgrp) < ntohl(g->gt_mcastgrp))
break;
- if (g->gt_mcastgrp == mcastgrp && VIFM_ISSET(vifi, g->gt_grpmems)) {
- if (g->gt_route == NULL ||
- SUBS_ARE_PRUNED(g->gt_route->rt_subordinates,
- uvifs[vifi].uv_nbrmap, g->gt_prunes)) {
+ if (g->gt_mcastgrp == mcastgrp) {
+ int stop_sending = 1;
+
+ r = g->gt_route;
+ /*
+ * If this is not a leaf, then we have router neighbors on this
+ * vif. Only turn off forwarding if they have all pruned.
+ */
+ if (!VIFM_ISSET(vifi, r->rt_leaves)) {
+ struct listaddr *vr;
+
+ for (vr = uvifs[vifi].uv_neighbors; vr; vr = vr->al_next)
+ if (find_prune_entry(vr->al_addr, g->gt_pruntbl) == NULL) {
+ stop_sending = 0;
+ break;
+ }
+ }
+
+ if (stop_sending) {
VIFM_CLR(vifi, g->gt_grpmems);
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "delete lclgrp (%s %s) gm:%x",
- RT_FMT(g->gt_route, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), g->gt_grpmems);
prun_add_ttls(g);
@@ -1261,7 +1148,7 @@ delete_lclgrp(vifi, mcastgrp)
* If there are no more members of this particular group,
* send prune upstream
*/
- if (VIFM_ISEMPTY(g->gt_grpmems) && g->gt_route->rt_gateway)
+ if (!g->gt_prsent_timer && g->gt_grpmems == 0 && r->rt_gateway)
send_prune(g);
}
}
@@ -1290,9 +1177,15 @@ accept_prune(src, dst, p, datalen)
u_int32 prun_tmr;
vifi_t vifi;
int i;
+ int stop_sending;
struct rtentry *r;
struct gtable *g;
struct ptable *pt;
+ struct listaddr *vr;
+
+ /* Don't process any prunes if router is not pruning */
+ if (pruning == 0)
+ return;
if ((vifi = find_vif(src, dst)) == NO_VIF) {
log(LOG_INFO, 0,
@@ -1318,15 +1211,6 @@ accept_prune(src, dst, p, datalen)
((char *)&prun_tmr)[i] = *p++;
prun_tmr = ntohl(prun_tmr);
- if (prun_tmr <= MIN_PRUNE_LIFE) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "ignoring prune from %s on vif %d for (%s %s)/%d because its lifetime is too short",
- inet_fmt(src, s1), vifi,
- inet_fmt(prun_src, s2), inet_fmt(prun_grp, s3), prun_tmr);
- return;
- }
-
- IF_DEBUG(DEBUG_PRUNE)
log(LOG_DEBUG, 0, "%s on vif %d prunes (%s %s)/%d",
inet_fmt(src, s1), vifi,
inet_fmt(prun_src, s2), inet_fmt(prun_grp, s3), prun_tmr);
@@ -1338,19 +1222,10 @@ accept_prune(src, dst, p, datalen)
g = gtp ? gtp->gt_gnext : kernel_table;
r = g->gt_route;
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "found grp state, (%s %s), metric is %d, children are %x, subords are %08x%08x",
- RT_FMT(r, s1), inet_fmt(g->gt_mcastgrp, s2), r->rt_metric,
- r->rt_children, r->rt_subordinates.hi, r->rt_subordinates.lo);
if (!VIFM_ISSET(vifi, r->rt_children)) {
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_WARNING, 0, "prune received from non-child %s for (%s %s) (dominant on vif %d is %s)",
+ log(LOG_WARNING, 0, "prune received from non-child %s for (%s %s)",
inet_fmt(src, s1), inet_fmt(prun_src, s2),
- inet_fmt(prun_grp, s3), vifi,
- inet_fmt(r->rt_dominants[vifi], s4));
-#ifdef RINGBUFFER
- printringbuf();
-#endif
+ inet_fmt(prun_grp, s3));
return;
}
if (VIFM_ISSET(vifi, g->gt_scope)) {
@@ -1360,7 +1235,6 @@ accept_prune(src, dst, p, datalen)
return;
}
if ((pt = find_prune_entry(src, g->gt_pruntbl)) != NULL) {
- IF_DEBUG(DEBUG_PRUNE)
log(LOG_DEBUG, 0, "%s %d from %s for (%s %s)/%d %s %d %s %x",
"duplicate prune received on vif",
vifi, inet_fmt(src, s1), inet_fmt(prun_src, s2),
@@ -1368,14 +1242,6 @@ accept_prune(src, dst, p, datalen)
"old timer:", pt->pt_timer, "cur gm:", g->gt_grpmems);
pt->pt_timer = prun_tmr;
} else {
- struct listaddr *n = neighbor_info(vifi, src);
-
- if (!n) {
- log(LOG_WARNING, 0, "Prune from non-neighbor %s on vif %d!?",
- inet_fmt(src, s1), vifi);
- return;
- }
-
/* allocate space for the prune structure */
pt = (struct ptable *)(malloc(sizeof(struct ptable)));
if (pt == NULL)
@@ -1387,37 +1253,28 @@ accept_prune(src, dst, p, datalen)
pt->pt_next = g->gt_pruntbl;
g->gt_pruntbl = pt;
-
- if (n) {
- pt->pt_index = n->al_index;
- NBRM_SET(n->al_index, g->gt_prunes);
- }
}
+ /* Refresh the group's lifetime */
+ g->gt_timer = CACHE_LIFETIME(cache_lifetime);
+ if (g->gt_timer < prun_tmr)
+ g->gt_timer = prun_tmr;
+
/*
* check if any more packets need to be sent on the
* vif which sent this message
*/
- if (SUBS_ARE_PRUNED(r->rt_subordinates,
- uvifs[vifi].uv_nbrmap, g->gt_prunes) &&
- !grplst_mem(vifi, prun_grp)) {
- nbrbitmap_t tmp;
-
+ stop_sending = 1;
+ for (vr = uvifs[vifi].uv_neighbors; vr; vr = vr->al_next)
+ if (find_prune_entry(vr->al_addr, g->gt_pruntbl) == NULL) {
+ stop_sending = 0;
+ break;
+ }
+
+ if (stop_sending && !grplst_mem(vifi, prun_grp)) {
VIFM_CLR(vifi, g->gt_grpmems);
- IF_DEBUG(DEBUG_PRUNE)
- log(LOG_DEBUG, 0, "vifnbrs=0x%08x%08x, subord=0x%08x%08x prunes=0x%08x%08x",
- uvifs[vifi].uv_nbrmap.hi,uvifs[vifi].uv_nbrmap.lo,
- r->rt_subordinates.hi, r->rt_subordinates.lo,
- g->gt_prunes.hi, g->gt_prunes.lo);
- /* XXX debugging */
- NBRM_COPY(r->rt_subordinates, tmp);
- NBRM_MASK(tmp, uvifs[vifi].uv_nbrmap);
- if (!NBRM_ISSETALLMASK(g->gt_prunes, tmp))
- log(LOG_WARNING, 0, "subordinate error");
- /* XXX end debugging */
- IF_DEBUG(DEBUG_PRUNE|DEBUG_CACHE)
log(LOG_DEBUG, 0, "prune (%s %s), stop sending on vif %d, gm:%x",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), vifi, g->gt_grpmems);
prun_add_ttls(g);
@@ -1434,7 +1291,7 @@ accept_prune(src, dst, p, datalen)
* interface
* Send a prune message then upstream
*/
- if (VIFM_ISEMPTY(g->gt_grpmems) && r->rt_gateway) {
+ if (!g->gt_prsent_timer && g->gt_grpmems == 0 && r->rt_gateway) {
send_prune(g);
}
} else {
@@ -1443,7 +1300,6 @@ accept_prune(src, dst, p, datalen)
* simply ignore the prune, as we are not forwarding this traffic
* downstream.
*/
- IF_DEBUG(DEBUG_PRUNE|DEBUG_CACHE)
log(LOG_DEBUG, 0, "%s (%s %s)/%d from %s",
"prune message received with no kernel entry for",
inet_fmt(prun_src, s1), inet_fmt(prun_grp, s2),
@@ -1477,19 +1333,22 @@ chkgrp_graft(vifi, mcastgrp)
* If the vif that was joined was a scoped vif,
* ignore it ; don't graft back
*/
- APPLY_SCOPE(g);
- if (VIFM_ISEMPTY(g->gt_grpmems))
+ g->gt_grpmems &= ~g->gt_scope;
+ if (g->gt_grpmems == 0)
continue;
+ /* set the flag for graft retransmission */
+ g->gt_grftsnt = 1;
+
/* send graft upwards */
send_graft(g);
- /* update cache timer*/
- g->gt_timer = CACHE_LIFETIME(cache_lifetime);
+ /* reset the prune timer and update cache timer*/
+ g->gt_prsent_timer = 0;
+ g->gt_timer = max_prune_lifetime;
- IF_DEBUG(DEBUG_PRUNE|DEBUG_CACHE)
log(LOG_DEBUG, 0, "chkgrp graft (%s %s) gm:%x",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), g->gt_grpmems);
prun_add_ttls(g);
@@ -1529,6 +1388,13 @@ accept_graft(src, dst, p, datalen)
struct gtable *g;
struct ptable *pt, **ptnp;
+ if ((vifi = find_vif(src, dst)) == NO_VIF) {
+ log(LOG_INFO, 0,
+ "ignoring graft from non-neighbor %s",
+ inet_fmt(src, s1));
+ return;
+ }
+
if (datalen < 8) {
log(LOG_WARNING, 0,
"received non-decipherable graft from %s",
@@ -1540,19 +1406,7 @@ accept_graft(src, dst, p, datalen)
((char *)&graft_src)[i] = *p++;
for (i = 0; i< 4; i++)
((char *)&graft_grp)[i] = *p++;
-
- vifi = find_vif(src, dst);
- send_graft_ack(dst, src, graft_src, graft_grp, vifi);
-
- if (vifi == NO_VIF) {
- log(LOG_INFO, 0,
- "ignoring graft for (%s %s) from non-neighbor %s",
- inet_fmt(graft_src, s2), inet_fmt(graft_grp, s3),
- inet_fmt(src, s1));
- return;
- }
-
- IF_DEBUG(DEBUG_PRUNE)
+
log(LOG_DEBUG, 0, "%s on vif %d grafts (%s %s)",
inet_fmt(src, s1), vifi,
inet_fmt(graft_src, s2), inet_fmt(graft_grp, s3));
@@ -1574,14 +1428,12 @@ accept_graft(src, dst, p, datalen)
ptnp = &g->gt_pruntbl;
while ((pt = *ptnp) != NULL) {
if ((pt->pt_vifi == vifi) && (pt->pt_router == src)) {
- NBRM_CLR(pt->pt_index, g->gt_prunes);
*ptnp = pt->pt_next;
free(pt);
VIFM_SET(vifi, g->gt_grpmems);
- IF_DEBUG(DEBUG_PRUNE|DEBUG_CACHE)
log(LOG_DEBUG, 0, "accept graft (%s %s) gm:%x",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(g->gt_mcastgrp, s2), g->gt_grpmems);
prun_add_ttls(g);
@@ -1596,18 +1448,28 @@ accept_graft(src, dst, p, datalen)
}
}
- g->gt_timer = CACHE_LIFETIME(cache_lifetime);
+ /* send ack downstream */
+ send_graft_ack(dst, src, graft_src, graft_grp);
+ g->gt_timer = max_prune_lifetime;
- if (g->gt_prsent_timer)
+ if (g->gt_prsent_timer) {
+ /* set the flag for graft retransmission */
+ g->gt_grftsnt = 1;
+
/* send graft upwards */
send_graft(g);
+
+ /* reset the prune sent timer */
+ g->gt_prsent_timer = 0;
+ }
} else {
/*
* We have no state for the source and group in question.
- * This is fine, since we know that we have no prune state, and
- * grafts are requests to remove prune state.
+ * We can simply acknowledge the graft, since we know
+ * that we have no prune state, and grafts are requests
+ * to remove prune state.
*/
- IF_DEBUG(DEBUG_PRUNE)
+ send_graft_ack(dst, src, graft_src, graft_grp);
log(LOG_DEBUG, 0, "%s (%s %s) from %s",
"graft received with no kernel entry for",
inet_fmt(graft_src, s1), inet_fmt(graft_grp, s2),
@@ -1656,7 +1518,6 @@ accept_g_ack(src, dst, p, datalen)
for (i = 0; i< 4; i++)
((char *)&grft_grp)[i] = *p++;
- IF_DEBUG(DEBUG_PRUNE)
log(LOG_DEBUG, 0, "%s on vif %d acks graft (%s, %s)",
inet_fmt(src, s1), vifi,
inet_fmt(grft_src, s2), inet_fmt(grft_grp, s3));
@@ -1672,9 +1533,6 @@ accept_g_ack(src, dst, p, datalen)
"rcvd graft ack with no kernel entry for",
inet_fmt(grft_src, s1), inet_fmt(grft_grp, s2),
inet_fmt(src, s3));
-#ifdef RINGBUFFER
- printringbuf();
-#endif
return;
}
}
@@ -1713,8 +1571,6 @@ free_all_prunes()
prev_g = g;
g = g->gt_next;
- if (prev_g->gt_rexmit_timer)
- timer_clearTimer(prev_g->gt_rexmit_timer);
free(prev_g);
}
r->rt_groups = NULL;
@@ -1728,8 +1584,6 @@ free_all_prunes()
prev_g = g;
g = g->gt_next;
- if (prev_g->gt_rexmit_timer)
- timer_clearTimer(prev_g->gt_rexmit_timer);
free(prev_g);
}
kernel_no_route = NULL;
@@ -1753,32 +1607,27 @@ steal_sources(rt)
register struct stable *st, **stnp;
for (rp = rt->rt_next; rp; rp = rp->rt_next) {
- if (rp->rt_groups == NULL)
- continue;
if ((rt->rt_origin & rp->rt_originmask) == rp->rt_origin) {
- IF_DEBUG(DEBUG_ROUTE)
log(LOG_DEBUG, 0, "Route for %s stealing sources from %s",
- RT_FMT(rt, s1), RT_FMT(rp, s2));
+ inet_fmts(rt->rt_origin, rt->rt_originmask, s1),
+ inet_fmts(rp->rt_origin, rp->rt_originmask, s2));
for (gt = rp->rt_groups; gt; gt = gt->gt_next) {
stnp = &gt->gt_srctbl;
while ((st = *stnp) != NULL) {
if ((st->st_origin & rt->rt_originmask) == rt->rt_origin) {
- IF_DEBUG(DEBUG_ROUTE)
log(LOG_DEBUG, 0, "%s stealing (%s %s) from %s",
- RT_FMT(rt, s1),
+ inet_fmts(rt->rt_origin, rt->rt_originmask, s1),
inet_fmt(st->st_origin, s3),
inet_fmt(gt->gt_mcastgrp, s4),
- RT_FMT(rp, s2));
- if (st->st_ctime != 0) {
- if (k_del_rg(st->st_origin, gt) < 0) {
- log(LOG_WARNING, errno, "%s (%s, %s)",
- "steal_sources trying to delete",
- inet_fmt(st->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- }
- kroutes--;
+ inet_fmts(rp->rt_origin, rp->rt_originmask, s2));
+ if (k_del_rg(st->st_origin, gt) < 0) {
+ log(LOG_WARNING, errno, "%s (%s, %s)",
+ "steal_sources trying to delete",
+ inet_fmt(st->st_origin, s1),
+ inet_fmt(gt->gt_mcastgrp, s2));
}
*stnp = st->st_next;
+ kroutes--;
free(st);
} else {
stnp = &st->st_next;
@@ -1792,27 +1641,22 @@ steal_sources(rt)
while ((gt = *gtnp) != NULL) {
if (gt->gt_srctbl && ((gt->gt_srctbl->st_origin & rt->rt_originmask)
== rt->rt_origin)) {
- IF_DEBUG(DEBUG_ROUTE)
log(LOG_DEBUG, 0, "%s stealing (%s %s) from %s",
- RT_FMT(rt, s1),
+ inet_fmts(rt->rt_origin, rt->rt_originmask, s1),
inet_fmt(gt->gt_srctbl->st_origin, s3),
inet_fmt(gt->gt_mcastgrp, s4),
"no_route table");
- if (gt->gt_srctbl->st_ctime != 0) {
- if (k_del_rg(gt->gt_srctbl->st_origin, gt) < 0) {
- log(LOG_WARNING, errno, "%s (%s %s)",
- "steal_sources trying to delete",
- inet_fmt(gt->gt_srctbl->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- }
- kroutes--;
+ if (k_del_rg(gt->gt_srctbl->st_origin, gt) < 0) {
+ log(LOG_WARNING, errno, "%s (%s %s)",
+ "steal_sources trying to delete",
+ inet_fmt(gt->gt_srctbl->st_origin, s1),
+ inet_fmt(gt->gt_mcastgrp, s2));
}
+ kroutes--;
free(gt->gt_srctbl);
*gtnp = gt->gt_next;
if (gt->gt_next)
gt->gt_next->gt_prev = gt->gt_prev;
- if (gt->gt_rexmit_timer)
- timer_clearTimer(gt->gt_rexmit_timer);
free(gt);
} else {
gtnp = &gt->gt_next;
@@ -1834,98 +1678,31 @@ age_table_entry()
struct ptable *pt, **ptnp;
struct sioc_sg_req sg_req;
- IF_DEBUG(DEBUG_PRUNE|DEBUG_CACHE)
- log(LOG_DEBUG, 0, "aging forwarding cache entries");
+ log(LOG_DEBUG, 0, "ageing entries");
gtnptr = &kernel_table;
while ((gt = *gtnptr) != NULL) {
- vifi_t i; /* XXX Debugging */
- int fixit = 0; /* XXX Debugging */
-
r = gt->gt_route;
- /* XXX Debugging... */
- for (i = 0; i < numvifs; i++) {
- /*
- * If we're not sending on this vif,
- * And this group isn't scoped on this vif,
- * And I'm the parent for this route on this vif,
- * And there are subordinates on this vif,
- * And all of the subordinates haven't pruned,
- * YELL LOUDLY
- * and remember to fix it up later
- */
- if (!VIFM_ISSET(i, gt->gt_grpmems) &&
- !VIFM_ISSET(i, gt->gt_scope) &&
- VIFM_ISSET(i, r->rt_children) &&
- NBRM_ISSETMASK(uvifs[i].uv_nbrmap, r->rt_subordinates) &&
- !SUBS_ARE_PRUNED(r->rt_subordinates, uvifs[i].uv_nbrmap, gt->gt_prunes)) {
- log(LOG_WARNING, 0, "(%s %s) is blackholing on vif %d",
- RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2), i);
- fixit = 1;
- }
- }
- if (fixit) {
- log(LOG_WARNING, 0, "fixing membership for (%s %s) gm:%x",
- RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2), gt->gt_grpmems);
- determine_forwvifs(gt);
- send_prune_or_graft(gt);
- log(LOG_WARNING, 0, "fixed membership for (%s %s) gm:%x",
- RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2), gt->gt_grpmems);
-#ifdef RINGBUFFER
- printringbuf();
-#endif
- }
- /*DEBUG2*/
- /* If there are group members,
- * and there are recent sources,
- * and we have a route,
- * and it's not directly connected,
- * and we haven't sent a prune,
- * if there are any cache entries in the kernel
- * [if there aren't we're probably waiting to rexmit],
- * YELL LOUDLY
- * and send a prune
- */
- if (VIFM_ISEMPTY(gt->gt_grpmems) && gt->gt_srctbl && r && r->rt_gateway && gt->gt_prsent_timer == 0) {
- for (st = gt->gt_srctbl; st; st = st->st_next)
- if (st->st_ctime != 0)
- break;
- if (st != NULL) {
- log(LOG_WARNING, 0, "grpmems for (%s %s) is empty but no prune state!", RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2));
- send_prune_or_graft(gt);
-#ifdef RINGBUFFER
- printringbuf();
-#endif
- }
- }
- /* XXX ...Debugging */
-
/* advance the timer for the kernel entry */
- gt->gt_timer -= TIMER_INTERVAL;
+ gt->gt_timer -= ROUTE_MAX_REPORT_DELAY;
/* decrement prune timer if need be */
if (gt->gt_prsent_timer > 0) {
- gt->gt_prsent_timer -= TIMER_INTERVAL;
+ gt->gt_prsent_timer -= ROUTE_MAX_REPORT_DELAY;
if (gt->gt_prsent_timer <= 0) {
- IF_DEBUG(DEBUG_PRUNE)
log(LOG_DEBUG, 0, "upstream prune tmo (%s %s)",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(gt->gt_mcastgrp, s2));
gt->gt_prsent_timer = -1;
- /* Reset the prune retransmission timer to its initial value */
- gt->gt_prune_rexmit = PRUNE_REXMIT_VAL;
}
}
- /* retransmit graft with exponential backoff */
+ /* retransmit graft if graft sent flag is still set */
if (gt->gt_grftsnt) {
register int y;
-
- y = ++gt->gt_grftsnt;
- while (y && !(y & 1))
- y >>= 1;
- if (y == 1)
+ CHK_GS(gt->gt_grftsnt++, y);
+ if (y)
send_graft(gt);
}
@@ -1936,24 +1713,13 @@ age_table_entry()
*/
ptnp = &gt->gt_pruntbl;
while ((pt = *ptnp) != NULL) {
- if ((pt->pt_timer -= TIMER_INTERVAL) <= 0) {
- IF_DEBUG(DEBUG_PRUNE)
+ if ((pt->pt_timer -= ROUTE_MAX_REPORT_DELAY) <= 0) {
log(LOG_DEBUG, 0, "expire prune (%s %s) from %s on vif %d",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(gt->gt_mcastgrp, s2),
inet_fmt(pt->pt_router, s3),
pt->pt_vifi);
- if (gt->gt_prsent_timer > 0) {
- log(LOG_WARNING, 0, "prune (%s %s) from %s on vif %d expires with %d left on prsent timer",
- RT_FMT(r, s1),
- inet_fmt(gt->gt_mcastgrp, s2),
- inet_fmt(pt->pt_router, s3),
- pt->pt_vifi, gt->gt_prsent_timer);
- /* Send a graft to heal the tree. */
- send_graft(gt);
- }
- NBRM_CLR(pt->pt_index, gt->gt_prunes);
expire_prune(pt->pt_vifi, gt);
/* remove the router's prune entry and await new one */
@@ -1971,47 +1737,31 @@ age_table_entry()
* Otherwise, the cache entry's timer is refreshed.
*/
if (gt->gt_timer <= 0) {
- IF_DEBUG(DEBUG_CACHE)
- log(LOG_DEBUG, 0, "(%s %s) timed out, checking for traffic",
- RT_FMT(gt->gt_route, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
/* Check for traffic before deleting source entries */
sg_req.grp.s_addr = gt->gt_mcastgrp;
stnp = &gt->gt_srctbl;
while ((st = *stnp) != NULL) {
- /*
- * Source entries with no ctime are not actually in the
- * kernel; they have been removed by rexmit_prune() so
- * are safe to remove from the list at this point.
- */
- if (st->st_ctime) {
- sg_req.src.s_addr = st->st_origin;
- if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) < 0) {
- log(LOG_WARNING, errno, "%s (%s %s)",
- "age_table_entry: SIOCGETSGCNT failing for",
- inet_fmt(st->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- /* Make sure it gets deleted below */
- sg_req.pktcnt = st->st_pktcnt;
- }
- } else {
+ sg_req.src.s_addr = st->st_origin;
+ if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) < 0) {
+ log(LOG_WARNING, errno, "%s (%s %s)",
+ "age_table_entry: SIOCGETSGCNT failing for",
+ inet_fmt(st->st_origin, s1),
+ inet_fmt(gt->gt_mcastgrp, s2));
+ /* Make sure it gets deleted below */
sg_req.pktcnt = st->st_pktcnt;
}
if (sg_req.pktcnt == st->st_pktcnt) {
*stnp = st->st_next;
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "age_table_entry deleting (%s %s)",
inet_fmt(st->st_origin, s1),
inet_fmt(gt->gt_mcastgrp, s2));
- if (st->st_ctime != 0) {
- if (k_del_rg(st->st_origin, gt) < 0) {
- log(LOG_WARNING, errno,
- "age_table_entry trying to delete (%s %s)",
- inet_fmt(st->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- }
- kroutes--;
+ if (k_del_rg(st->st_origin, gt) < 0) {
+ log(LOG_WARNING, errno,
+ "age_table_entry trying to delete (%s %s)",
+ inet_fmt(st->st_origin, s1),
+ inet_fmt(gt->gt_mcastgrp, s2));
}
+ kroutes--;
free(st);
} else {
st->st_pktcnt = sg_req.pktcnt;
@@ -2022,39 +1772,22 @@ age_table_entry()
/*
* Retain the group entry if we have downstream prunes or if
* there is at least one source in the list that still has
- * traffic, or if our upstream prune timer or graft
- * retransmission timer is running.
+ * traffic, or if our upstream prune timer is running.
*/
if (gt->gt_pruntbl != NULL || gt->gt_srctbl != NULL ||
- gt->gt_prsent_timer > 0 || gt->gt_grftsnt > 0) {
- IF_DEBUG(DEBUG_CACHE)
- log(LOG_DEBUG, 0, "refresh lifetim of cache entry %s%s%s%s(%s, %s)",
- gt->gt_pruntbl ? "(dstrm prunes) " : "",
- gt->gt_srctbl ? "(trfc flow) " : "",
- gt->gt_prsent_timer > 0 ? "(upstrm prune) " : "",
- gt->gt_grftsnt > 0 ? "(grft rexmit) " : "",
- RT_FMT(r, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
+ gt->gt_prsent_timer > 0) {
gt->gt_timer = CACHE_LIFETIME(cache_lifetime);
- if (gt->gt_prsent_timer == -1) {
- /*
- * The upstream prune timed out. Remove any kernel
- * state.
- */
- gt->gt_prsent_timer = 0;
- if (gt->gt_pruntbl) {
- log(LOG_WARNING, 0, "upstream prune for (%s %s) expires with downstream prunes active",
- RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2));
- }
- remove_sources(gt);
- }
+ if (gt->gt_prsent_timer == -1)
+ if (gt->gt_grpmems == 0)
+ send_prune(gt);
+ else
+ gt->gt_prsent_timer = 0;
gtnptr = &gt->gt_gnext;
continue;
}
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "timeout cache entry (%s, %s)",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(gt->gt_mcastgrp, s2));
if (gt->gt_prev)
@@ -2079,23 +1812,13 @@ age_table_entry()
rsrr_cache_send(gt,0);
rsrr_cache_clean(gt);
#endif /* RSRR */
- if (gt->gt_rexmit_timer)
- timer_clearTimer(gt->gt_rexmit_timer);
-
free((char *)gt);
} else {
- if (gt->gt_prsent_timer == -1) {
- /*
- * The upstream prune timed out. Remove any kernel
- * state.
- */
- gt->gt_prsent_timer = 0;
- if (gt->gt_pruntbl) {
- log(LOG_WARNING, 0, "upstream prune for (%s %s) expires with downstream prunes active",
- RT_FMT(r, s1), inet_fmt(gt->gt_mcastgrp, s2));
- }
- remove_sources(gt);
- }
+ if (gt->gt_prsent_timer == -1)
+ if (gt->gt_grpmems == 0)
+ send_prune(gt);
+ else
+ gt->gt_prsent_timer = 0;
gtnptr = &gt->gt_gnext;
}
}
@@ -2107,18 +1830,15 @@ age_table_entry()
gtnptr = &kernel_no_route;
while ((gt = *gtnptr) != NULL) {
/* advance the timer for the kernel entry */
- gt->gt_timer -= TIMER_INTERVAL;
+ gt->gt_timer -= ROUTE_MAX_REPORT_DELAY;
if (gt->gt_timer < 0) {
if (gt->gt_srctbl) {
- if (gt->gt_srctbl->st_ctime != 0) {
- if (k_del_rg(gt->gt_srctbl->st_origin, gt) < 0) {
- log(LOG_WARNING, errno, "%s (%s %s)",
- "age_table_entry trying to delete no-route",
- inet_fmt(gt->gt_srctbl->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- }
- kroutes--;
+ if (k_del_rg(gt->gt_srctbl->st_origin, gt) < 0) {
+ log(LOG_WARNING, errno, "%s (%s %s)",
+ "age_table_entry trying to delete no-route",
+ inet_fmt(gt->gt_srctbl->st_origin, s1),
+ inet_fmt(gt->gt_mcastgrp, s2));
}
free(gt->gt_srctbl);
}
@@ -2126,9 +1846,6 @@ age_table_entry()
if (gt->gt_next)
gt->gt_next->gt_prev = gt->gt_prev;
- if (gt->gt_rexmit_timer)
- timer_clearTimer(gt->gt_rexmit_timer);
-
free((char *)gt);
} else {
gtnptr = &gt->gt_next;
@@ -2149,24 +1866,19 @@ expire_prune(vifi, gt)
/*
* No need to send a graft, any prunes that we sent
* will expire before any prunes that we have received.
- * However, in the case that we did make a mistake,
- * send a graft to compensate.
*/
- if (gt->gt_prsent_timer >= MIN_PRUNE_LIFE) {
- IF_DEBUG(DEBUG_PRUNE)
+ if (gt->gt_prsent_timer > 0) {
log(LOG_DEBUG, 0, "prune expired with %d left on %s",
gt->gt_prsent_timer, "prsent_timer");
gt->gt_prsent_timer = 0;
- send_graft(gt);
}
/* modify the kernel entry to forward packets */
if (!VIFM_ISSET(vifi, gt->gt_grpmems)) {
struct rtentry *rt = gt->gt_route;
VIFM_SET(vifi, gt->gt_grpmems);
- IF_DEBUG(DEBUG_CACHE)
log(LOG_DEBUG, 0, "forw again (%s %s) gm:%x vif:%d",
- RT_FMT(rt, s1),
+ inet_fmts(rt->rt_origin, rt->rt_originmask, s1),
inet_fmt(gt->gt_mcastgrp, s2), gt->gt_grpmems, vifi);
prun_add_ttls(gt);
@@ -2178,6 +1890,46 @@ expire_prune(vifi, gt)
}
}
+
+static char *
+scaletime(t)
+ u_long t;
+{
+ static char buf1[5];
+ static char buf2[5];
+ static char *buf=buf1;
+ char s;
+ char *p;
+
+ p = buf;
+ if (buf == buf1)
+ buf = buf2;
+ else
+ buf = buf1;
+
+ if (t < 120) {
+ s = 's';
+ } else if (t < 3600) {
+ t /= 60;
+ s = 'm';
+ } else if (t < 86400) {
+ t /= 3600;
+ s = 'h';
+ } else if (t < 864000) {
+ t /= 86400;
+ s = 'd';
+ } else {
+ t /= 604800;
+ s = 'w';
+ }
+ if (t > 999)
+ return "*** ";
+
+ sprintf(p,"%3d%c", (int)t, s);
+
+ return p;
+}
+
/*
* Print the contents of the cache table on file 'fp2'.
*/
@@ -2195,14 +1947,11 @@ dump_cache(fp2)
fprintf(fp2,
"Multicast Routing Cache Table (%d entries)\n%s", kroutes,
- " Origin Mcast-group CTmr Age Ptmr Rx IVif Forwvifs\n");
- fprintf(fp2,
- "<(prunesrc:vif[idx]/tmr) prunebitmap\n%s",
- ">Source Lifetime SavPkt Pkts Bytes RPFf\n");
+ " Origin Mcast-group CTmr Age Ptmr IVif Forwvifs\n");
for (gt = kernel_no_route; gt; gt = gt->gt_next) {
if (gt->gt_srctbl) {
- fprintf(fp2, " %-18s %-15s %-8s %-8s - -1 (no route)\n",
+ fprintf(fp2, " %-18s %-15s %-4s %-4s - -1\n",
inet_fmts(gt->gt_srctbl->st_origin, 0xffffffff, s1),
inet_fmt(gt->gt_mcastgrp, s2), scaletime(gt->gt_timer),
scaletime(thyme - gt->gt_ctime));
@@ -2213,78 +1962,40 @@ dump_cache(fp2)
for (gt = kernel_table; gt; gt = gt->gt_gnext) {
r = gt->gt_route;
fprintf(fp2, " %-18s %-15s",
- RT_FMT(r, s1),
+ inet_fmts(r->rt_origin, r->rt_originmask, s1),
inet_fmt(gt->gt_mcastgrp, s2));
- fprintf(fp2, " %-8s", scaletime(gt->gt_timer));
+ fprintf(fp2, " %-4s", scaletime(gt->gt_timer));
- fprintf(fp2, " %-8s %-8s ", scaletime(thyme - gt->gt_ctime),
+ fprintf(fp2, " %-4s %-4s ", scaletime(thyme - gt->gt_ctime),
gt->gt_prsent_timer ? scaletime(gt->gt_prsent_timer) :
- " -");
-
- if (gt->gt_prune_rexmit) {
- int i = gt->gt_prune_rexmit;
- int n = 0;
+ " -");
- while (i > PRUNE_REXMIT_VAL) {
- n++;
- i /= 2;
- }
- if (n == 0 && gt->gt_prsent_timer == 0)
- fprintf(fp2, " -");
- else
- fprintf(fp2, "%2d", n);
- } else {
- fprintf(fp2, " -");
- }
-
- fprintf(fp2, " %2u%c%c", r->rt_parent,
- gt->gt_prsent_timer ? 'P' :
- gt->gt_grftsnt ? 'G' : ' ',
+ fprintf(fp2, "%2u%c%c ", r->rt_parent,
+ gt->gt_prsent_timer ? 'P' : ' ',
VIFM_ISSET(r->rt_parent, gt->gt_scope) ? 'B' : ' ');
for (i = 0; i < numvifs; ++i) {
if (VIFM_ISSET(i, gt->gt_grpmems))
fprintf(fp2, " %u ", i);
else if (VIFM_ISSET(i, r->rt_children) &&
- NBRM_ISSETMASK(uvifs[i].uv_nbrmap, r->rt_subordinates))
+ !VIFM_ISSET(i, r->rt_leaves))
fprintf(fp2, " %u%c", i,
- VIFM_ISSET(i, gt->gt_scope) ? 'b' :
- SUBS_ARE_PRUNED(r->rt_subordinates,
- uvifs[i].uv_nbrmap, gt->gt_prunes) ? 'p' : '!');
+ VIFM_ISSET(i, gt->gt_scope) ? 'b' : 'p');
}
fprintf(fp2, "\n");
if (gt->gt_pruntbl) {
fprintf(fp2, "<");
c = '(';
for (pt = gt->gt_pruntbl; pt; pt = pt->pt_next) {
- fprintf(fp2, "%c%s:%d[%d]/%d", c, inet_fmt(pt->pt_router, s1),
- pt->pt_vifi, pt->pt_index, pt->pt_timer);
+ fprintf(fp2, "%c%s:%d/%d", c, inet_fmt(pt->pt_router, s1),
+ pt->pt_vifi, pt->pt_timer);
c = ',';
}
- fprintf(fp2, ")");
- fprintf(fp2, " 0x%08lx%08lx\n",/*XXX*/
- gt->gt_prunes.hi, gt->gt_prunes.lo);
+ fprintf(fp2, ")\n");
}
for (st = gt->gt_srctbl; st; st = st->st_next) {
- fprintf(fp2, ">%-18s %-8s %6ld", inet_fmt(st->st_origin, s1),
- st->st_ctime ? scaletime(thyme - st->st_ctime) : "-",
- st->st_savpkt);
- if (st->st_ctime) {
- struct sioc_sg_req sg_req;
-
- sg_req.src.s_addr = st->st_origin;
- sg_req.grp.s_addr = gt->gt_mcastgrp;
- if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) < 0) {
- log(LOG_WARNING, errno, "SIOCGETSGCNT on (%s %s)",
- inet_fmt(st->st_origin, s1),
- inet_fmt(gt->gt_mcastgrp, s2));
- } else {
- fprintf(fp2, " %8ld %8ld %4ld", sg_req.pktcnt,
- sg_req.bytecnt, sg_req.wrong_if);
- }
- }
- fprintf(fp2, "\n");
+ fprintf(fp2, ">%s\n", inet_fmt(st->st_origin, s1));
}
}
}
@@ -2327,17 +2038,14 @@ accept_mtrace(src, dst, group, data, no, datalen)
*/
if (datalen == QLEN) {
type = QUERY;
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Initial traceroute query rcvd from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
}
else if ((datalen - QLEN) % RLEN == 0) {
type = RESP;
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "In-transit traceroute query rcvd from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
if (IN_MULTICAST(ntohl(dst))) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Dropping multicast response");
return;
}
@@ -2355,27 +2063,23 @@ accept_mtrace(src, dst, group, data, no, datalen)
* if it is a packet with all reports filled, drop it
*/
if ((rcount = (datalen - QLEN)/RLEN) == no) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "packet with all reports filled in");
return;
}
- IF_DEBUG(DEBUG_TRACE) {
log(LOG_DEBUG, 0, "s: %s g: %s d: %s ", inet_fmt(qry->tr_src, s1),
inet_fmt(group, s2), inet_fmt(qry->tr_dst, s3));
log(LOG_DEBUG, 0, "rttl: %d rd: %s", qry->tr_rttl,
inet_fmt(qry->tr_raddr, s1));
log(LOG_DEBUG, 0, "rcount:%d, qid:%06x", rcount, qry->tr_qid);
- }
/* determine the routing table entry for this traceroute */
rt = determine_route(qry->tr_src);
- IF_DEBUG(DEBUG_TRACE)
if (rt) {
log(LOG_DEBUG, 0, "rt parent vif: %d rtr: %s metric: %d",
rt->rt_parent, inet_fmt(rt->rt_gateway, s1), rt->rt_metric);
log(LOG_DEBUG, 0, "rt origin %s",
- RT_FMT(rt, s1));
+ inet_fmts(rt->rt_origin, rt->rt_originmask, s1));
} else
log(LOG_DEBUG, 0, "...no route");
@@ -2396,13 +2100,11 @@ accept_mtrace(src, dst, group, data, no, datalen)
* only get N copies, N <= the number of interfaces on the router,
* it is not fatal.
*/
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "ignoring duplicate traceroute packet");
return;
}
if (rt == NULL) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Mcast traceroute: no route entry %s",
inet_fmt(qry->tr_src, s1));
if (IN_MULTICAST(ntohl(dst)))
@@ -2412,14 +2114,12 @@ accept_mtrace(src, dst, group, data, no, datalen)
if (vifi == NO_VIF) {
/* The traceroute destination is not on one of my subnet vifs. */
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Destination %s not an interface",
inet_fmt(qry->tr_dst, s1));
if (IN_MULTICAST(ntohl(dst)))
return;
errcode = TR_WRONG_IF;
} else if (rt != NULL && !VIFM_ISSET(vifi, rt->rt_children)) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Destination %s not on forwarding tree for src %s",
inet_fmt(qry->tr_dst, s1), inet_fmt(qry->tr_src, s2));
if (IN_MULTICAST(ntohl(dst)))
@@ -2434,7 +2134,6 @@ accept_mtrace(src, dst, group, data, no, datalen)
* a tunnel or came from a directly attached mrouter.
*/
if ((vifi = find_vif(src, dst)) == NO_VIF) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Wrong interface for packet");
errcode = TR_WRONG_IF;
}
@@ -2443,7 +2142,6 @@ accept_mtrace(src, dst, group, data, no, datalen)
/* Now that we've decided to send a response, save the qid */
oqid = qry->tr_qid;
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Sending traceroute response");
/* copy the packet to the sending buffer */
@@ -2475,18 +2173,21 @@ accept_mtrace(src, dst, group, data, no, datalen)
((tp.tv_usec << 10) / 15625));
resp->tr_rproto = PROTO_DVMRP;
- resp->tr_outaddr = (vifi == NO_VIF) ? dst : uvifs[vifi].uv_lcl_addr;
- resp->tr_fttl = (vifi == NO_VIF) ? 0 : uvifs[vifi].uv_threshold;
- resp->tr_rflags = errcode;
+ if (errcode != TR_NO_ERR) {
+ resp->tr_rflags = errcode;
+ rt = NULL; /* hack to enforce send straight to requestor */
+ goto sendit;
+ }
+ resp->tr_outaddr = uvifs[vifi].uv_lcl_addr;
+ resp->tr_fttl = uvifs[vifi].uv_threshold;
+ resp->tr_rflags = TR_NO_ERR;
/*
* obtain # of packets out on interface
*/
v_req.vifi = vifi;
- if (vifi != NO_VIF && ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) >= 0)
+ if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) >= 0)
resp->tr_vifout = htonl(v_req.ocount);
- else
- resp->tr_vifout = 0xffffffff;
/*
* fill in scoping & pruning information
@@ -2500,34 +2201,23 @@ accept_mtrace(src, dst, group, data, no, datalen)
gt = NULL;
if (gt && gt->gt_mcastgrp == group) {
- struct stable *st;
-
- for (st = gt->gt_srctbl; st; st = st->st_next)
- if (qry->tr_src == st->st_origin)
- break;
-
sg_req.src.s_addr = qry->tr_src;
sg_req.grp.s_addr = group;
- if (st && st->st_ctime != 0 &&
- ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) >= 0)
- resp->tr_pktcnt = htonl(sg_req.pktcnt + st->st_savpkt);
- else
- resp->tr_pktcnt = htonl(st ? st->st_savpkt : 0xffffffff);
+ if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) >= 0)
+ resp->tr_pktcnt = htonl(sg_req.pktcnt);
if (VIFM_ISSET(vifi, gt->gt_scope))
resp->tr_rflags = TR_SCOPED;
else if (gt->gt_prsent_timer)
resp->tr_rflags = TR_PRUNED;
else if (!VIFM_ISSET(vifi, gt->gt_grpmems))
- if (!NBRM_ISEMPTY(uvifs[vifi].uv_nbrmap) &&
- SUBS_ARE_PRUNED(rt->rt_subordinates,
- uvifs[vifi].uv_nbrmap, gt->gt_prunes))
+ if (VIFM_ISSET(vifi, rt->rt_children) &&
+ !VIFM_ISSET(vifi, rt->rt_leaves))
resp->tr_rflags = TR_OPRUNED;
else
resp->tr_rflags = TR_NO_FWD;
} else {
- if ((vifi != NO_VIF && scoped_addr(vifi, group)) ||
- (rt && scoped_addr(rt->rt_parent, group)))
+ if (scoped_addr(vifi, group))
resp->tr_rflags = TR_SCOPED;
else if (rt && !VIFM_ISSET(vifi, rt->rt_children))
resp->tr_rflags = TR_NO_FWD;
@@ -2546,15 +2236,12 @@ accept_mtrace(src, dst, group, data, no, datalen)
v_req.vifi = rt->rt_parent;
if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) >= 0)
resp->tr_vifin = htonl(v_req.icount);
- else
- resp->tr_vifin = 0xffffffff;
MASK_TO_VAL(rt->rt_originmask, resp->tr_smask);
src = uvifs[rt->rt_parent].uv_lcl_addr;
resp->tr_inaddr = src;
resp->tr_rmtaddr = rt->rt_gateway;
if (!VIFM_ISSET(vifi, rt->rt_children)) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Destination %s not on forwarding tree for src %s",
inet_fmt(qry->tr_dst, s1), inet_fmt(qry->tr_src, s2));
resp->tr_rflags = TR_WRONG_IF;
@@ -2572,7 +2259,6 @@ sendit:
* else send to upstream router. If the upstream router can't handle
* mtrace, set an error code and send to requestor anyway.
*/
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "rcount:%d, no:%d", rcount, no);
if ((rcount + 1 == no) || (rt == NULL) || (rt->rt_metric == 1)) {
@@ -2594,7 +2280,6 @@ sendit:
* If we don't have one, we can't source any multicasts anyway.
*/
if (phys_vif != -1) {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Sending reply to %s from %s",
inet_fmt(dst, s1), inet_fmt(uvifs[phys_vif].uv_lcl_addr, s2));
k_set_ttl(qry->tr_rttl);
@@ -2606,7 +2291,6 @@ sendit:
log(LOG_INFO, 0, "No enabled phyints -- %s",
"dropping traceroute reply");
} else {
- IF_DEBUG(DEBUG_TRACE)
log(LOG_DEBUG, 0, "Sending %s to %s from %s",
resptype == IGMP_MTRACE_RESP ? "reply" : "request on",
inet_fmt(dst, s1), inet_fmt(src, s2));
diff --git a/usr.sbin/mrouted/prune.h b/usr.sbin/mrouted/prune.h
index dbc232f6385b..c007ed31d6fa 100644
--- a/usr.sbin/mrouted/prune.h
+++ b/usr.sbin/mrouted/prune.h
@@ -7,8 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: prune.h,v 1.8 1997/02/22 16:07:04 peter Exp $
- * prune.h,v 3.8.4.5 1998/02/27 22:45:43 fenner Exp
+ * $Id$
*/
/*
@@ -33,14 +32,11 @@ struct gtable {
vifbitmap_t gt_grpmems; /* forw. vifs for src, grp */
int gt_prsent_timer; /* prune timer for this group */
int gt_timer; /* timer for this group entry */
- time_t gt_ctime; /* time of entry creation */
+ time_t gt_ctime; /* time of entry creation */
u_char gt_grftsnt; /* graft sent/retransmit timer */
- nbrbitmap_t gt_prunes; /* bitmap of neighbors who pruned */
struct stable *gt_srctbl; /* source table */
struct ptable *gt_pruntbl; /* prune table */
struct rtentry *gt_route; /* parent route */
- int gt_rexmit_timer; /* timer for prune retransmission */
- int gt_prune_rexmit; /* time til prune retransmission */
#ifdef RSRR
struct rsrr_cache *gt_rsrr_cache; /* RSRR cache */
#endif /* RSRR */
@@ -56,8 +52,6 @@ struct stable
struct stable *st_next; /* pointer to the next entry */
u_int32 st_origin; /* host origin of multicasts */
u_long st_pktcnt; /* packet count for src-grp entry */
- u_long st_savpkt; /* saved pkt cnt when no krnl entry */
- time_t st_ctime; /* kernel entry creation time */
};
/*
@@ -68,12 +62,9 @@ struct ptable
struct ptable *pt_next; /* pointer to the next entry */
u_int32 pt_router; /* router that sent this prune */
vifi_t pt_vifi; /* vif prune received on */
- int pt_index; /* neighbor index of router */
int pt_timer; /* timer for prune */
};
-#define MIN_PRUNE_LIFE TIMER_INTERVAL /* min prune lifetime to bother with */
-
/*
* The packet format for a traceroute request.
*/
@@ -146,7 +137,7 @@ struct tr_resp {
};
#define VAL_TO_MASK(x, i) { \
- x = i ? htonl(~((1 << (32 - (i))) - 1)) : 0; \
+ x = htonl(~((1 << (32 - (i))) - 1)); \
};
#define NBR_VERS(n) (((n)->al_pv << 8) + (n)->al_mv)
diff --git a/usr.sbin/mrouted/route.c b/usr.sbin/mrouted/route.c
index ff59a237095c..1e26fb5acfe5 100644
--- a/usr.sbin/mrouted/route.c
+++ b/usr.sbin/mrouted/route.c
@@ -5,14 +5,11 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * route.c,v 3.8.4.41 1998/01/15 00:08:34 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: route.c,v 1.10 1998/01/16 07:17:45 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include "defs.h"
@@ -45,89 +42,13 @@ unsigned int nroutes; /* current number of route entries */
* Private functions.
*/
static int init_children_and_leaves __P((struct rtentry *r,
- vifi_t parent, int first));
+ vifi_t parent));
static int find_route __P((u_int32 origin, u_int32 mask));
static void create_route __P((u_int32 origin, u_int32 mask));
static void discard_route __P((struct rtentry *prev_r));
static int compare_rts __P((const void *rt1, const void *rt2));
-static int report_chunk __P((int, struct rtentry *start_rt, vifi_t vifi,
+static int report_chunk __P((struct rtentry *start_rt, vifi_t vifi,
u_int32 dst));
-static void queue_blaster_report __P((vifi_t, u_int32, u_int32, char *,
- int, u_int32));
-static void process_blaster_report __P((void *));
-
-#ifdef SNMP
-#include <sys/types.h>
-#include "snmp.h"
-
-/*
- * Return pointer to a specific route entry. This must be a separate
- * function from find_route() which modifies rtp.
- */
-struct rtentry *
-snmp_find_route(src, mask)
- register u_int32 src, mask;
-{
- register struct rtentry *rt;
-
- for (rt = routing_table; rt; rt = rt->rt_next) {
- if (src == rt->rt_origin && mask == rt->rt_originmask)
- return rt;
- }
- return NULL;
-}
-
-/*
- * Find next route entry > specification
- */
-int
-next_route(rtpp, src, mask)
- struct rtentry **rtpp;
- u_int32 src;
- u_int32 mask;
-{
- struct rtentry *rt, *rbest = NULL;
-
- /* Among all entries > spec, find "lowest" one in order */
- for (rt = routing_table; rt; rt=rt->rt_next) {
- if ((ntohl(rt->rt_origin) > ntohl(src)
- || (ntohl(rt->rt_origin) == ntohl(src)
- && ntohl(rt->rt_originmask) > ntohl(mask)))
- && (!rbest || (ntohl(rt->rt_origin) < ntohl(rbest->rt_origin))
- || (ntohl(rt->rt_origin) == ntohl(rbest->rt_origin)
- && ntohl(rt->rt_originmask) < ntohl(rbest->rt_originmask))))
- rbest = rt;
- }
- (*rtpp) = rbest;
- return (*rtpp)!=0;
-}
-
-/*
- * Given a routing table entry, and a vifi, find the next vifi/entry
- */
-int
-next_route_child(rtpp, src, mask, vifi)
- struct rtentry **rtpp;
- u_int32 src;
- u_int32 mask;
- vifi_t *vifi; /* vif at which to start looking */
-{
- /* Get (S,M) entry */
- if (!((*rtpp) = snmp_find_route(src,mask)))
- if (!next_route(rtpp, src, mask))
- return 0;
-
- /* Continue until we get one with a valid next vif */
- do {
- for (; (*rtpp)->rt_children && *vifi<numvifs; (*vifi)++)
- if (VIFM_ISSET(*vifi, (*rtpp)->rt_children))
- return 1;
- *vifi = 0;
- } while( next_route(rtpp, (*rtpp)->rt_origin, (*rtpp)->rt_originmask) );
-
- return 0;
-}
-#endif
/*
* Initialize the routing table and associated variables.
@@ -144,50 +65,54 @@ init_routes()
/*
- * Initialize the children bits for route 'r', along with the
- * associated dominant and subordinate data structures.
- * If first is set, initialize dominants, otherwise keep old
- * dominants on non-parent interfaces.
- * XXX Does this need a return value?
+ * Initialize the children and leaf bits for route 'r', along with the
+ * associated dominant, subordinate, and leaf timing data structures.
+ * Return TRUE if this changes the value of either the children or
+ * leaf bitmaps for 'r'.
*/
static int
-init_children_and_leaves(r, parent, first)
+init_children_and_leaves(r, parent)
register struct rtentry *r;
register vifi_t parent;
- int first;
{
register vifi_t vifi;
register struct uvif *v;
- vifbitmap_t old_children;
- nbrbitmap_t old_subords;
+ vifbitmap_t old_children, old_leaves;
VIFM_COPY(r->rt_children, old_children);
- NBRM_COPY(r->rt_subordinates, old_subords);
+ VIFM_COPY(r->rt_leaves, old_leaves );
VIFM_CLRALL(r->rt_children);
+ VIFM_CLRALL(r->rt_leaves);
+ r->rt_flags &= ~RTF_LEAF_TIMING;
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
- if (first || vifi == parent)
- r->rt_dominants [vifi] = 0;
- if (vifi == parent || uvifs[vifi].uv_flags & VIFF_NOFLOOD ||
- AVOID_TRANSIT(vifi, r) || (!first && r->rt_dominants[vifi]))
- NBRM_CLRMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- else
- NBRM_SETMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
-
- if (vifi != parent && !(v->uv_flags & (VIFF_DOWN|VIFF_DISABLED)) &&
- !(!first && r->rt_dominants[vifi])) {
+ r->rt_dominants [vifi] = 0;
+ r->rt_subordinates[vifi] = 0;
+
+ if (vifi != parent && !(v->uv_flags & (VIFF_DOWN|VIFF_DISABLED))) {
VIFM_SET(vifi, r->rt_children);
+ if (v->uv_neighbors == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = 0;
+ }
+ else {
+ r->rt_leaf_timers[vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ }
+ else {
+ r->rt_leaf_timers[vifi] = 0;
}
}
return (!VIFM_SAME(r->rt_children, old_children) ||
- !NBRM_SAME(r->rt_subordinates, old_subords));
+ !VIFM_SAME(r->rt_leaves, old_leaves));
}
/*
- * A new vif has come up -- update the children bitmaps in all route
+ * A new vif has come up -- update the children and leaf bitmaps in all route
* entries to take that into account.
*/
void
@@ -203,9 +128,17 @@ add_vif_to_routes(vifi)
!VIFM_ISSET(vifi, r->rt_children)) {
VIFM_SET(vifi, r->rt_children);
r->rt_dominants [vifi] = 0;
- /*XXX isn't uv_nbrmap going to be empty?*/
- NBRM_CLRMASK(r->rt_subordinates, v->uv_nbrmap);
- update_table_entry(r, r->rt_gateway);
+ r->rt_subordinates[vifi] = 0;
+ if (v->uv_neighbors == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = 0;
+ }
+ else {
+ VIFM_CLR(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ update_table_entry(r);
}
}
}
@@ -233,8 +166,10 @@ delete_vif_from_routes(vifi)
}
else if (VIFM_ISSET(vifi, r->rt_children)) {
VIFM_CLR(vifi, r->rt_children);
- NBRM_CLRMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- update_table_entry(r, r->rt_gateway);
+ VIFM_CLR(vifi, r->rt_leaves);
+ r->rt_subordinates[vifi] = 0;
+ r->rt_leaf_timers [vifi] = 0;
+ update_table_entry(r);
}
else {
r->rt_dominants[vifi] = 0;
@@ -245,42 +180,14 @@ delete_vif_from_routes(vifi)
/*
- * A new neighbor has come up. If we're flooding on the neighbor's
- * vif, mark that neighbor as subordinate for all routes whose parent
- * is not this vif.
- */
-void
-add_neighbor_to_routes(vifi, index)
- register vifi_t vifi;
- register int index;
-{
- register struct rtentry *r;
- register struct uvif *v;
-
- v = &uvifs[vifi];
- if (v->uv_flags & VIFF_NOFLOOD)
- return;
- for (r = routing_table; r != NULL; r = r->rt_next) {
- if (r->rt_metric != UNREACHABLE && r->rt_parent != vifi &&
- !AVOID_TRANSIT(vifi, r)) {
- NBRM_SET(index, r->rt_subordinates);
- update_table_entry(r, r->rt_gateway);
- }
- }
-}
-
-
-/*
* A neighbor has failed or become unreachable. If that neighbor was
* considered a dominant or subordinate router in any route entries,
- * take appropriate action. Expire all routes this neighbor advertised
- * to us.
+ * take appropriate action.
*/
void
-delete_neighbor_from_routes(addr, vifi, index)
+delete_neighbor_from_routes(addr, vifi)
register u_int32 addr;
register vifi_t vifi;
- int index;
{
register struct rtentry *r;
register struct uvif *v;
@@ -288,24 +195,37 @@ delete_neighbor_from_routes(addr, vifi, index)
v = &uvifs[vifi];
for (r = routing_table; r != NULL; r = r->rt_next) {
if (r->rt_metric != UNREACHABLE) {
- if (r->rt_parent == vifi && r->rt_gateway == addr) {
- del_table_entry(r, 0, DEL_ALL_ROUTES);
- r->rt_timer = ROUTE_EXPIRE_TIME;
- r->rt_metric = UNREACHABLE;
- r->rt_flags |= RTF_CHANGED;
- routes_changed = TRUE;
- } else if (r->rt_dominants[vifi] == addr) {
+ if (r->rt_dominants[vifi] == addr) {
VIFM_SET(vifi, r->rt_children);
- r->rt_dominants[vifi] = 0;
- if ((uvifs[vifi].uv_flags & VIFF_NOFLOOD) ||
- AVOID_TRANSIT(vifi, r))
- NBRM_CLRMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- else
- NBRM_SETMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- update_table_entry(r, r->rt_gateway);
- } else if (NBRM_ISSET(index, r->rt_subordinates)) {
- NBRM_CLR(index, r->rt_subordinates);
- update_table_entry(r, r->rt_gateway);
+ r->rt_dominants [vifi] = 0;
+ r->rt_subordinates[vifi] = 0;
+ if (v->uv_neighbors == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = 0;
+ }
+ else {
+ VIFM_CLR(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ update_table_entry(r);
+ }
+ else if (r->rt_subordinates[vifi] == addr) {
+ r->rt_subordinates[vifi] = 0;
+ if (v->uv_neighbors == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
+ update_table_entry(r);
+ }
+ else {
+ r->rt_leaf_timers[vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ }
+ else if (v->uv_neighbors == NULL &&
+ r->rt_leaf_timers[vifi] != 0) {
+ VIFM_SET(vifi, r->rt_leaves);
+ r->rt_leaf_timers[vifi] = 0;
+ update_table_entry(r);
}
}
}
@@ -376,7 +296,8 @@ create_route(origin, mask)
register struct rtentry *r;
if ((r = (struct rtentry *) malloc(sizeof(struct rtentry) +
- (numvifs * sizeof(u_int32)))) == NULL) {
+ (2 * numvifs * sizeof(u_int32)) +
+ (numvifs * sizeof(u_int)))) == NULL) {
log(LOG_ERR, 0, "ran out of memory"); /* fatal */
}
r->rt_origin = origin;
@@ -387,11 +308,9 @@ create_route(origin, mask)
else r->rt_originwidth = 1;
r->rt_flags = 0;
r->rt_dominants = (u_int32 *)(r + 1);
- bzero(r->rt_dominants, numvifs * sizeof(u_int32));
+ r->rt_subordinates = (u_int32 *)(r->rt_dominants + numvifs);
+ r->rt_leaf_timers = (u_int *)(r->rt_subordinates + numvifs);
r->rt_groups = NULL;
- VIFM_CLRALL(r->rt_children);
- NBRM_CLRALL(r->rt_subordinates);
- NBRM_CLRALL(r->rt_subordadv);
r->rt_next = rtp->rt_next;
rtp->rt_next = r;
@@ -415,8 +334,6 @@ discard_route(prev_r)
register struct rtentry *r;
r = prev_r->rt_next;
- uvifs[r->rt_parent].uv_nroutes--;
- /*???nbr???.al_nroutes--;*/
prev_r->rt_next = r->rt_next;
if (prev_r->rt_next != NULL)
(prev_r->rt_next)->rt_prev = prev_r;
@@ -434,12 +351,11 @@ discard_route(prev_r)
* to indicate a change of status of one of our own interfaces.
*/
void
-update_route(origin, mask, metric, src, vifi, n)
+update_route(origin, mask, metric, src, vifi)
u_int32 origin, mask;
u_int metric;
u_int32 src;
vifi_t vifi;
- struct listaddr *n;
{
register struct rtentry *r;
u_int adj_metric;
@@ -477,17 +393,18 @@ update_route(origin, mask, metric, src, vifi, n)
return;
}
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s advertises new route %s",
- inet_fmt(src, s1), inet_fmts(origin, mask, s2));
-
/*
* OK, create the new routing entry. 'rtp' will be left pointing
* to the new entry.
*/
create_route(origin, mask);
- uvifs[vifi].uv_nroutes++;
- /*n->al_nroutes++;*/
+
+ /*
+ * Now "steal away" any sources that belong under this route
+ * by deleting any cache entries they might have created
+ * and allowing the kernel to re-request them.
+ */
+ steal_sources(rtp);
rtp->rt_metric = UNREACHABLE; /* temporary; updated below */
}
@@ -505,32 +422,15 @@ update_route(origin, mask, metric, src, vifi, n)
if (adj_metric == UNREACHABLE)
return;
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s advertises %s with adj_metric %d (ours was %d)",
- inet_fmt(src, s1), inet_fmts(origin, mask, s2),
- adj_metric, r->rt_metric);
-
- /*
- * Now "steal away" any sources that belong under this route
- * by deleting any cache entries they might have created
- * and allowing the kernel to re-request them.
- *
- * If we haven't performed final initialization yet and are
- * just collecting the routing table, we can't have any
- * sources so we don't perform this step.
- */
- if (did_final_init)
- steal_sources(rtp);
-
r->rt_parent = vifi;
- r->rt_gateway = src;
- init_children_and_leaves(r, vifi, 1);
+ init_children_and_leaves(r, vifi);
+ r->rt_gateway = src;
r->rt_timer = 0;
r->rt_metric = adj_metric;
r->rt_flags |= RTF_CHANGED;
routes_changed = TRUE;
- update_table_entry(r, r->rt_gateway);
+ update_table_entry(r);
}
else if (src == r->rt_gateway) {
/*
@@ -542,12 +442,6 @@ update_route(origin, mask, metric, src, vifi, n)
* our entry accordingly.
*/
r->rt_timer = 0;
-
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s (current parent) advertises %s with adj_metric %d (ours was %d)",
- inet_fmt(src, s1), inet_fmts(origin, mask, s2),
- adj_metric, r->rt_metric);
-
if (adj_metric == r->rt_metric)
return;
@@ -555,6 +449,11 @@ update_route(origin, mask, metric, src, vifi, n)
del_table_entry(r, 0, DEL_ALL_ROUTES);
r->rt_timer = ROUTE_EXPIRE_TIME;
}
+ else if (adj_metric < r->rt_metric) {
+ if (init_children_and_leaves(r, vifi)) {
+ update_table_entry(r);
+ }
+ }
r->rt_metric = adj_metric;
r->rt_flags |= RTF_CHANGED;
routes_changed = TRUE;
@@ -580,29 +479,16 @@ update_route(origin, mask, metric, src, vifi, n)
* IP address than the gateway associated with the route entry.
* Did you get all that?
*/
- u_int32 old_gateway;
- vifi_t old_parent;
- old_gateway = r->rt_gateway;
- old_parent = r->rt_parent;
- r->rt_gateway = src;
- r->rt_parent = vifi;
-
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s (new parent) on vif %d advertises %s with adj_metric %d (old parent was %s on vif %d, metric %d)",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- adj_metric, inet_fmt(old_gateway, s3), old_parent,
- r->rt_metric);
-
- if (old_parent != vifi) {
- init_children_and_leaves(r, vifi, 0);
- uvifs[old_parent].uv_nroutes--;
- uvifs[vifi].uv_nroutes++;
- }
- if (old_gateway != src) {
- update_table_entry(r, old_gateway);
- /*???old_gateway???->al_nroutes--;*/
- /*n->al_nroutes++;*/
+ if (r->rt_parent != vifi || adj_metric < r->rt_metric) {
+ /*
+ * XXX Why do we do this if we are just changing the metric?
+ */
+ r->rt_parent = vifi;
+ if (init_children_and_leaves(r, vifi)) {
+ update_table_entry(r);
+ }
}
+ r->rt_gateway = src;
r->rt_timer = 0;
r->rt_metric = adj_metric;
r->rt_flags |= RTF_CHANGED;
@@ -611,18 +497,9 @@ update_route(origin, mask, metric, src, vifi, n)
else if (vifi != r->rt_parent) {
/*
* The report came from a vif other than the route's parent vif.
- * Update the children info, if necessary.
+ * Update the children and leaf info, if necessary.
*/
- if (AVOID_TRANSIT(vifi, r)) {
- /*
- * The route's parent is a vif from which we're not supposed
- * to transit onto this vif. Simply ignore the update.
- */
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d advertises %s with metric %d (ignored due to NOTRANSIT)",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric);
- } else if (VIFM_ISSET(vifi, r->rt_children)) {
+ if (VIFM_ISSET(vifi, r->rt_children)) {
/*
* Vif is a child vif for this route.
*/
@@ -635,51 +512,42 @@ update_route(origin, mask, metric, src, vifi, n)
* and vif is no longer a child for me.
*/
VIFM_CLR(vifi, r->rt_children);
+ VIFM_CLR(vifi, r->rt_leaves);
r->rt_dominants [vifi] = src;
- /* XXX
- * We don't necessarily want to forget about subordinateness
- * so that we can become the dominant quickly if the current
- * dominant fails.
- */
- NBRM_CLRMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- update_table_entry(r, r->rt_gateway);
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d becomes dominant for %s with metric %d",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric);
+ r->rt_subordinates[vifi] = 0;
+ r->rt_leaf_timers [vifi] = 0;
+ update_table_entry(r);
}
else if (metric > UNREACHABLE) { /* "poisoned reverse" */
/*
* Neighbor considers this vif to be on path to route's
- * origin; record this neighbor as subordinate
+ * origin; if no subordinate recorded, record this neighbor
+ * as subordinate and clear the leaf flag.
*/
- if (!NBRM_ISSET(n->al_index, r->rt_subordinates)) {
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d becomes subordinate for %s with poison-reverse metric %d",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric - UNREACHABLE);
- NBRM_SET(n->al_index, r->rt_subordinates);
- update_table_entry(r, r->rt_gateway);
- } else {
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d confirms subordinateness for %s with poison-reverse metric %d",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric - UNREACHABLE);
+ if (r->rt_subordinates[vifi] == 0) {
+ VIFM_CLR(vifi, r->rt_leaves);
+ r->rt_subordinates[vifi] = src;
+ r->rt_leaf_timers [vifi] = 0;
+ update_table_entry(r);
}
- NBRM_SET(n->al_index, r->rt_subordadv);
}
- else if (NBRM_ISSET(n->al_index, r->rt_subordinates)) {
+ else if (src == r->rt_subordinates[vifi]) {
/*
* Current subordinate no longer considers this vif to be on
* path to route's origin; it is no longer a subordinate
- * router.
+ * router, and we set the leaf confirmation timer to give
+ * us time to hear from other subordinates.
*/
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d is no longer a subordinate for %s with metric %d",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric);
- NBRM_CLR(n->al_index, r->rt_subordinates);
- update_table_entry(r, r->rt_gateway);
+ r->rt_subordinates[vifi] = 0;
+ if (uvifs[vifi].uv_neighbors == NULL ||
+ uvifs[vifi].uv_neighbors->al_next == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
+ update_table_entry(r);
+ }
+ else {
+ r->rt_leaf_timers [vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
}
}
@@ -692,26 +560,20 @@ update_route(origin, mask, metric, src, vifi, n)
* (or same metric and lower IP address); we adopt the vif
* as our own child.
*/
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s (current dominant) on vif %d is no longer dominant for %s with metric %d",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric);
VIFM_SET(vifi, r->rt_children);
- r->rt_dominants[vifi] = 0;
- if (uvifs[vifi].uv_flags & VIFF_NOFLOOD)
- NBRM_CLRMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
- else
- NBRM_SETMASK(r->rt_subordinates, uvifs[vifi].uv_nbrmap);
+ r->rt_dominants [vifi] = 0;
if (metric > UNREACHABLE) {
- NBRM_SET(n->al_index, r->rt_subordinates);
- NBRM_SET(n->al_index, r->rt_subordadv);
+ r->rt_subordinates[vifi] = src;
+ }
+ else if (uvifs[vifi].uv_neighbors == NULL ||
+ uvifs[vifi].uv_neighbors->al_next == NULL) {
+ VIFM_SET(vifi, r->rt_leaves);
}
- update_table_entry(r, r->rt_gateway);
- } else {
- IF_DEBUG(DEBUG_RTDETAIL)
- log(LOG_DEBUG, 0, "%s on vif %d advertises %s with metric %d (ignored)",
- inet_fmt(src, s1), vifi, inet_fmts(origin, mask, s2),
- metric);
+ else {
+ r->rt_leaf_timers[vifi] = LEAF_CONFIRMATION_TIME;
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ update_table_entry(r);
}
}
}
@@ -725,13 +587,47 @@ age_routes()
{
register struct rtentry *r;
register struct rtentry *prev_r;
- extern u_long virtual_time; /* from main.c */
+ register vifi_t vifi;
for (prev_r = RT_ADDR, r = routing_table;
r != NULL;
prev_r = r, r = r->rt_next) {
- if ((r->rt_timer += TIMER_INTERVAL) >= ROUTE_DISCARD_TIME) {
+ if ((r->rt_timer += TIMER_INTERVAL) < ROUTE_EXPIRE_TIME) {
+ /*
+ * Route is still good; see if any leaf timers need to be
+ * advanced.
+ */
+ if (r->rt_flags & RTF_LEAF_TIMING) {
+ r->rt_flags &= ~RTF_LEAF_TIMING;
+ for (vifi = 0; vifi < numvifs; ++vifi) {
+ if (r->rt_leaf_timers[vifi] != 0) {
+ /*
+ * Unlike other timers, leaf timers decrement.
+ */
+ if ((r->rt_leaf_timers[vifi] -= TIMER_INTERVAL) == 0){
+#ifdef NOTYET
+ /* If the vif is a physical leaf but has neighbors,
+ * it is not a tree leaf. If I am a leaf, then no
+ * interface with neighbors is a tree leaf. */
+ if (!(((uvifs[vifi].uv_flags & VIFF_LEAF) ||
+ (vifs_with_neighbors == 1)) &&
+ (uvifs[vifi].uv_neighbors != NULL))) {
+#endif
+ VIFM_SET(vifi, r->rt_leaves);
+ update_table_entry(r);
+#ifdef NOTYET
+ }
+#endif
+ }
+ else {
+ r->rt_flags |= RTF_LEAF_TIMING;
+ }
+ }
+ }
+ }
+ }
+ else if (r->rt_timer >= ROUTE_DISCARD_TIME) {
/*
* Time to garbage-collect the route entry.
*/
@@ -739,8 +635,7 @@ age_routes()
discard_route(prev_r);
r = prev_r;
}
- else if (r->rt_timer >= ROUTE_EXPIRE_TIME &&
- r->rt_metric != UNREACHABLE) {
+ else if (r->rt_metric != UNREACHABLE) {
/*
* Time to expire the route entry. If the gateway is zero,
* i.e., it is a route to a directly-connected subnet, just
@@ -757,22 +652,6 @@ age_routes()
routes_changed = TRUE;
}
}
- else if (virtual_time % (ROUTE_REPORT_INTERVAL * 2) == 0) {
- /*
- * Time out subordinateness that hasn't been reported in
- * the last 2 intervals.
- */
- if (!NBRM_SAME(r->rt_subordinates, r->rt_subordadv)) {
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "rt %s sub 0x%08x%08x subadv 0x%08x%08x metric %d",
- RT_FMT(r, s1),
- r->rt_subordinates.hi, r->rt_subordinates.lo,
- r->rt_subordadv.hi, r->rt_subordadv.lo, r->rt_metric);
- NBRM_MASK(r->rt_subordinates, r->rt_subordadv);
- update_table_entry(r, r->rt_gateway);
- }
- NBRM_CLRALL(r->rt_subordadv);
- }
}
}
@@ -825,41 +704,10 @@ accept_probe(src, dst, p, datalen, level)
u_int32 level;
{
vifi_t vifi;
- static struct listaddr *unknowns = NULL;
if ((vifi = find_vif(src, dst)) == NO_VIF) {
- struct listaddr *a, **prev;
- struct listaddr *match = NULL;
- time_t now = time(0);
-
- for (prev = &unknowns, a = *prev; a; a = *prev) {
- if (a->al_addr == src)
- match = a;
- if (a->al_ctime + 2 * a->al_timer < now) {
- /* We haven't heard from it in a long time */
- *prev = a->al_next;
- free(a);
- } else {
- prev = &a->al_next;
- }
- }
- if (match == NULL) {
- match = *prev = (struct listaddr *)malloc(sizeof(struct listaddr));
- match->al_next = NULL;
- match->al_addr = src;
- match->al_timer = OLD_NEIGHBOR_EXPIRE_TIME;
- match->al_ctime = now - match->al_timer;
- }
-
- if (match->al_ctime + match->al_timer <= now) {
- log(LOG_WARNING, 0,
- "ignoring probe from non-neighbor %s, check for misconfigured tunnel or routing on %s",
- inet_fmt(src, s1), s1);
- match->al_timer *= 2;
- } else
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0,
- "ignoring probe from non-neighbor %s (%d seconds until next warning)", inet_fmt(src, s1), match->al_ctime + match->al_timer - now);
+ log(LOG_INFO, 0,
+ "ignoring probe from non-neighbor %s", inet_fmt(src, s1));
return;
}
@@ -899,137 +747,8 @@ compare_rts(rt1, rt2)
return (0);
}
-void
-blaster_alloc(vifi)
- vifi_t vifi;
-{
- register struct uvif *v;
-
- v = &uvifs[vifi];
- if (v->uv_blasterbuf)
- free(v->uv_blasterbuf);
-
- v->uv_blasterlen = 64*1024;
- v->uv_blasterbuf = malloc(v->uv_blasterlen);
- v->uv_blastercur = v->uv_blasterend = v->uv_blasterbuf;
- if (v->uv_blastertimer)
- timer_clearTimer(v->uv_blastertimer);
- v->uv_blastertimer = 0;
-}
-
-struct blaster_hdr {
- u_int32 bh_src;
- u_int32 bh_dst;
- u_int32 bh_level;
- int bh_datalen;
-};
-
-/*
- * Queue a route report from a route-blaster.
- * If the timer isn't running to process these reports,
- * start it.
- */
-static void
-queue_blaster_report(vifi, src, dst, p, datalen, level)
- vifi_t vifi;
- u_int32 src, dst, level;
- register char *p;
- register int datalen;
-{
- register struct blaster_hdr *bh;
- register struct uvif *v;
- int bblen = sizeof(*bh) + ((datalen + 3) & ~3);
-
- v = &uvifs[vifi];
- if (v->uv_blasterend - v->uv_blasterbuf +
- bblen > v->uv_blasterlen) {
- int end = v->uv_blasterend - v->uv_blasterbuf;
- int cur = v->uv_blastercur - v->uv_blasterbuf;
-
- v->uv_blasterlen *= 2;
- IF_DEBUG(DEBUG_IF)
- log(LOG_DEBUG, 0, "increasing blasterbuf to %d bytes",
- v->uv_blasterlen);
- v->uv_blasterbuf = realloc(v->uv_blasterbuf,
- v->uv_blasterlen);
- if (v->uv_blasterbuf == NULL) {
- log(LOG_WARNING, ENOMEM, "turning off blaster on vif %d", vifi);
- v->uv_blasterlen = 0;
- v->uv_blasterend = v->uv_blastercur = NULL;
- v->uv_flags &= ~VIFF_BLASTER;
- return;
- }
- v->uv_blasterend = v->uv_blasterbuf + end;
- v->uv_blastercur = v->uv_blasterbuf + cur;
- }
- bh = (struct blaster_hdr *)v->uv_blasterend;
- bh->bh_src = src;
- bh->bh_dst = dst;
- bh->bh_level = level;
- bh->bh_datalen = datalen;
- bcopy(p, (char *)(bh + 1), datalen);
- v->uv_blasterend += bblen;
-
- if (v->uv_blastertimer == 0) {
- int *i = (int *)malloc(sizeof(int *));
-
- if (i == NULL)
- log(LOG_ERR, 0, "out of memory");
-
- *i = vifi;
-
- v->uv_blastertimer = timer_setTimer(5,
- process_blaster_report, i);
- }
-}
-
-/*
- * Periodic process; process up to 5 of the routes in the route-blaster
- * queue. If there are more routes remaining, reschedule myself to run
- * in 1 second.
- */
-static void
-process_blaster_report(vifip)
- void *vifip;
-{
- vifi_t vifi = *(int *)vifip;
- register struct uvif *v;
- register struct blaster_hdr *bh;
- int i;
-
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "processing vif %d blasted routes", vifi);
- v = &uvifs[vifi];
- for (i = 0; i < 5; i++) {
- if (v->uv_blastercur >= v->uv_blasterend)
- break;
- bh = (struct blaster_hdr *)v->uv_blastercur;
- v->uv_blastercur += sizeof(*bh) + ((bh->bh_datalen + 3) & ~3);
- accept_report(bh->bh_src, bh->bh_dst, (char *)(bh + 1),
- -bh->bh_datalen, bh->bh_level);
- }
-
- if (v->uv_blastercur >= v->uv_blasterend) {
- v->uv_blastercur = v->uv_blasterbuf;
- v->uv_blasterend = v->uv_blasterbuf;
- v->uv_blastertimer = 0;
- free(vifip);
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "finish processing vif %d blaster", vifi);
- } else {
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "more blasted routes to come on vif %d", vifi);
- v->uv_blastertimer = timer_setTimer(1,
- process_blaster_report, vifip);
- }
-}
-
/*
* Process an incoming route report message.
- * If the report arrived on a vif marked as a "blaster", then just
- * queue it and return; queue_blaster_report() will schedule it for
- * processing later. If datalen is negative, then this is actually
- * a queued report so actually process it instead of queueing it.
*/
void
accept_report(src, dst, p, datalen, level)
@@ -1043,7 +762,6 @@ accept_report(src, dst, p, datalen, level)
u_int32 mask;
u_int32 origin;
struct newrt rt[4096];
- struct listaddr *nbr;
if ((vifi = find_vif(src, dst)) == NO_VIF) {
log(LOG_INFO, 0,
@@ -1051,15 +769,7 @@ accept_report(src, dst, p, datalen, level)
return;
}
- if (uvifs[vifi].uv_flags & VIFF_BLASTER)
- if (datalen > 0) {
- queue_blaster_report(vifi, src, dst, p, datalen, level);
- return;
- } else {
- datalen = -datalen;
- }
-
- if (!(nbr = update_neighbor(vifi, src, DVMRP_REPORT, NULL, 0, level)))
+ if (!update_neighbor(vifi, src, DVMRP_REPORT, NULL, 0, level))
return;
if (datalen > 2*4096) {
@@ -1116,7 +826,6 @@ accept_report(src, dst, p, datalen, level)
if (rt[nrt-1].origin == 0)
rt[nrt-1].mask = 0;
- IF_DEBUG(DEBUG_ROUTE)
log(LOG_DEBUG, 0, "Updating %d routes from %s to %s", nrt,
inet_fmt(src, s1), inet_fmt(dst, s2));
for (i = 0; i < nrt; ++i) {
@@ -1126,43 +835,8 @@ accept_report(src, dst, p, datalen, level)
inet_fmt(src, s1), inet_fmts(rt[i].origin, rt[i].mask, s2));
continue;
}
- /* Only filter non-poisoned updates. */
- if (uvifs[vifi].uv_filter && rt[i].metric < UNREACHABLE) {
- struct vf_element *vfe;
- int match = 0;
-
- for (vfe = uvifs[vifi].uv_filter->vf_filter; vfe; vfe = vfe->vfe_next) {
- if (vfe->vfe_flags & VFEF_EXACT) {
- if ((vfe->vfe_addr == rt[i].origin) &&
- (vfe->vfe_mask == rt[i].mask)) {
- match = 1;
- break;
- }
- } else {
- if ((rt[i].origin & vfe->vfe_mask) == vfe->vfe_addr) {
- match = 1;
- break;
- }
- }
- }
- if ((uvifs[vifi].uv_filter->vf_type == VFT_ACCEPT && match == 0) ||
- (uvifs[vifi].uv_filter->vf_type == VFT_DENY && match == 1)) {
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "%s skipped on vif %d because it %s %s",
- inet_fmts(rt[i].origin, rt[i].mask, s1),
- vifi,
- match ? "matches" : "doesn't match",
- match ? inet_fmts(vfe->vfe_addr, vfe->vfe_mask, s2) :
- "the filter");
-#if 0
- rt[i].metric += vfe->vfe_addmetric;
- if (rt[i].metric > UNREACHABLE)
-#endif
- rt[i].metric = UNREACHABLE;
- }
- }
update_route(rt[i].origin, rt[i].mask, rt[i].metric,
- src, vifi, nbr);
+ src, vifi);
}
if (routes_changed && !delay_change_reports)
@@ -1181,13 +855,85 @@ report(which_routes, vifi, dst)
u_int32 dst;
{
register struct rtentry *r;
+ register char *p;
register int i;
+ int datalen = 0;
+ int width = 0;
+ u_int32 mask = 0;
+ u_int32 src;
+ u_int32 nflags;
+ int metric;
+ int admetric = uvifs[vifi].uv_admetric;
+
+ src = uvifs[vifi].uv_lcl_addr;
+
+ p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
- r = rt_end;
- while (r != RT_ADDR) {
- i = report_chunk(which_routes, r, vifi, dst);
- while (i-- > 0)
- r = r->rt_prev;
+#ifdef NOTYET
+ /* If I'm not a leaf, but the neighbor is a leaf, only advertise default */
+ if ((vifs_with_neighbors != 1) && (uvifs[vifi].uv_flags & VIFF_LEAF)) {
+ *p++ = 0; /* 0xff000000 mask */
+ *p++ = 0;
+ *p++ = 0;
+ *p++ = 0; /* class A net 0.0.0.0 == default */
+ *p++ = 0x81; /*XXX metric 1, is this safe? */
+ datalen += 5;
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_REPORT,
+ htonl(MROUTED_LEVEL), datalen);
+ return;
+ }
+#endif
+
+ nflags = (uvifs[vifi].uv_flags & VIFF_LEAF) ? 0 : LEAF_FLAGS;
+
+ for (r = rt_end; r != RT_ADDR; r = r->rt_prev) {
+
+ if (which_routes == CHANGED_ROUTES && !(r->rt_flags & RTF_CHANGED))
+ continue;
+
+ /*
+ * If there is no room for this route in the current message,
+ * send the message and start a new one.
+ */
+ if (datalen + ((r->rt_originmask == mask) ?
+ (width + 1) :
+ (r->rt_originwidth + 4)) > MAX_DVMRP_DATA_LEN) {
+ *(p-1) |= 0x80;
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_REPORT,
+ htonl(MROUTED_LEVEL | nflags), datalen);
+
+ p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
+ datalen = 0;
+ mask = 0;
+ }
+
+ if (r->rt_originmask != mask || datalen == 0) {
+ mask = r->rt_originmask;
+ width = r->rt_originwidth;
+ if (datalen != 0) *(p-1) |= 0x80;
+ *p++ = ((char *)&mask)[1];
+ *p++ = ((char *)&mask)[2];
+ *p++ = ((char *)&mask)[3];
+ datalen += 3;
+ }
+
+ for (i = 0; i < width; ++i)
+ *p++ = ((char *)&(r->rt_origin))[i];
+
+ metric = r->rt_metric + admetric;
+ if (metric > UNREACHABLE)
+ metric = UNREACHABLE;
+ *p++ = (r->rt_parent == vifi && metric != UNREACHABLE) ?
+ (char)(metric + UNREACHABLE) : /* "poisoned reverse" */
+ (char)(metric);
+
+ datalen += width + 1;
+ }
+
+ if (datalen != 0) {
+ *(p-1) |= 0x80;
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_REPORT,
+ htonl(MROUTED_LEVEL | nflags), datalen);
}
}
@@ -1214,8 +960,10 @@ report_to_all_neighbors(which_routes)
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
- if (!NBRM_ISEMPTY(v->uv_nbrmap)) {
- report(which_routes, vifi, v->uv_dst_addr);
+ if (v->uv_neighbors != NULL) {
+ report(which_routes, vifi,
+ (v->uv_flags & VIFF_TUNNEL) ? v->uv_rmt_addr
+ : dvmrp_group);
}
}
@@ -1244,8 +992,7 @@ report_to_all_neighbors(which_routes)
* 'vifi'. 'which_routes' specifies ALL_ROUTES or CHANGED_ROUTES.
*/
static int
-report_chunk(which_routes, start_rt, vifi, dst)
- int which_routes;
+report_chunk(start_rt, vifi, dst)
register struct rtentry *start_rt;
vifi_t vifi;
u_int32 dst;
@@ -1254,63 +1001,29 @@ report_chunk(which_routes, start_rt, vifi, dst)
register char *p;
register int i;
register int nrt = 0;
- struct uvif *v = &uvifs[vifi];
int datalen = 0;
int width = 0;
u_int32 mask = 0;
u_int32 src;
- int admetric = v->uv_admetric;
+ u_int32 nflags;
+ int admetric = uvifs[vifi].uv_admetric;
int metric;
- src = v->uv_lcl_addr;
+ src = uvifs[vifi].uv_lcl_addr;
p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
+ nflags = (uvifs[vifi].uv_flags & VIFF_LEAF) ? 0 : LEAF_FLAGS;
+
for (r = start_rt; r != RT_ADDR; r = r->rt_prev) {
- if (which_routes == CHANGED_ROUTES && !(r->rt_flags & RTF_CHANGED)) {
- nrt++;
- continue;
- }
- /*
- * Do not poison-reverse a route for a directly-connected
- * subnetwork on that subnetwork. This can cause loops when
- * some router on the subnetwork is misconfigured.
- */
- if (r->rt_gateway == 0 && r->rt_parent == vifi) {
- nrt++;
+#ifdef NOTYET
+ /* Don't send poisoned routes back to parents if I am a leaf */
+ if ((vifs_with_neighbors == 1) && (r->rt_parent == vifi)
+ && (r->rt_metric > 1)) {
+ ++nrt;
continue;
}
-
- if (v->uv_filter && v->uv_filter->vf_flags & VFF_BIDIR) {
- struct vf_element *vfe;
- int match = 0;
-
- for (vfe = v->uv_filter->vf_filter; vfe; vfe = vfe->vfe_next) {
- if (vfe->vfe_flags & VFEF_EXACT) {
- if ((vfe->vfe_addr == r->rt_origin) &&
- (vfe->vfe_mask == r->rt_originmask)) {
- match = 1;
- break;
- }
- } else {
- if ((r->rt_origin & vfe->vfe_mask) == vfe->vfe_addr) {
- match = 1;
- break;
- }
- }
- }
- if ((v->uv_filter->vf_type == VFT_ACCEPT && match == 0) ||
- (v->uv_filter->vf_type == VFT_DENY && match == 1)) {
- IF_DEBUG(DEBUG_ROUTE)
- log(LOG_DEBUG, 0, "%s not reported on vif %d because it %s %s",
- RT_FMT(r, s1), vifi,
- match ? "matches" : "doesn't match",
- match ? inet_fmts(vfe->vfe_addr, vfe->vfe_mask, s2) :
- "the filter");
- nrt++;
- continue;
- }
- }
+#endif
/*
* If there is no room for this route in the current message,
@@ -1320,10 +1033,10 @@ report_chunk(which_routes, start_rt, vifi, dst)
(width + 1) :
(r->rt_originwidth + 4)) > MAX_DVMRP_DATA_LEN) {
*(p-1) |= 0x80;
- send_on_vif(v, 0, DVMRP_REPORT, datalen);
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_REPORT,
+ htonl(MROUTED_LEVEL | nflags), datalen);
return (nrt);
}
-
if (r->rt_originmask != mask || datalen == 0) {
mask = r->rt_originmask;
width = r->rt_originwidth;
@@ -1339,17 +1052,16 @@ report_chunk(which_routes, start_rt, vifi, dst)
metric = r->rt_metric + admetric;
if (metric > UNREACHABLE)
metric = UNREACHABLE;
- if (r->rt_parent != vifi && AVOID_TRANSIT(vifi, r))
- metric = UNREACHABLE;
*p++ = (r->rt_parent == vifi && metric != UNREACHABLE) ?
(char)(metric + UNREACHABLE) : /* "poisoned reverse" */
- (char)(metric);
+ (char)(metric);
++nrt;
datalen += width + 1;
}
if (datalen != 0) {
*(p-1) |= 0x80;
- send_on_vif(v, 0, DVMRP_REPORT, datalen);
+ send_igmp(src, dst, IGMP_DVMRP, DVMRP_REPORT,
+ htonl(MROUTED_LEVEL | nflags), datalen);
}
return (nrt);
}
@@ -1384,8 +1096,14 @@ report_next_chunk()
* all our neighbors.
*/
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
- if (!NBRM_ISEMPTY(v->uv_nbrmap)) {
- n = report_chunk(ALL_ROUTES, sr, vifi, v->uv_dst_addr);
+ if ((v->uv_neighbors != NULL)
+#ifdef NOTYET
+ && !(v->uv_flags & VIFF_LEAF)
+#endif
+ ) {
+ n = report_chunk(sr, vifi,
+ (v->uv_flags & VIFF_TUNNEL) ? v->uv_rmt_addr
+ : dvmrp_group);
if (n < min)
min = n;
}
@@ -1394,7 +1112,6 @@ report_next_chunk()
min = 0; /* Neighborless router didn't send any routes */
n = min;
- IF_DEBUG(DEBUG_ROUTE)
log(LOG_INFO, 0, "update %d starting at %d of %d",
n, (nroutes - start_rt), nroutes);
@@ -1417,7 +1134,7 @@ dump_routes(fp)
fprintf(fp,
"Multicast Routing Table (%u %s)\n%s\n",
nroutes, (nroutes == 1) ? "entry" : "entries",
- " Origin-Subnet From-Gateway Metric Tmr Fl In-Vif Out-Vifs");
+ " Origin-Subnet From-Gateway Metric Tmr In-Vif Out-Vifs");
for (r = routing_table; r != NULL; r = r->rt_next) {
@@ -1428,31 +1145,12 @@ dump_routes(fp)
fprintf(fp, (r->rt_metric == UNREACHABLE) ? " NR " : "%4u ",
r->rt_metric);
- fprintf(fp, " %3u %c%c %3u ", r->rt_timer,
- (r->rt_flags & RTF_CHANGED) ? 'C' : '.',
- (r->rt_flags & RTF_HOLDDOWN) ? 'H' : '.',
- r->rt_parent);
+ fprintf(fp, " %3u %3u ", r->rt_timer, r->rt_parent);
for (i = 0; i < numvifs; ++i) {
- struct listaddr *n;
- char l = '[';
-
if (VIFM_ISSET(i, r->rt_children)) {
- if ((uvifs[i].uv_flags & VIFF_TUNNEL) &&
- !NBRM_ISSETMASK(uvifs[i].uv_nbrmap, r->rt_subordinates))
- /* Don't print out parenthood of a leaf tunnel. */
- continue;
- fprintf(fp, " %u", i);
- if (!NBRM_ISSETMASK(uvifs[i].uv_nbrmap, r->rt_subordinates))
- fprintf(fp, "*");
- for (n = uvifs[i].uv_neighbors; n; n = n->al_next) {
- if (NBRM_ISSET(n->al_index, r->rt_subordinates)) {
- fprintf(fp, "%c%d", l, n->al_index);
- l = ',';
- }
- }
- if (l == ',')
- fprintf(fp, "]");
+ fprintf(fp, " %u%c",
+ i, VIFM_ISSET(i, r->rt_leaves) ? '*' : ' ');
}
}
fprintf(fp, "\n");
@@ -1467,8 +1165,7 @@ determine_route(src)
struct rtentry *rt;
for (rt = routing_table; rt != NULL; rt = rt->rt_next) {
- if (rt->rt_origin == (src & rt->rt_originmask) &&
- rt->rt_metric != UNREACHABLE)
+ if (rt->rt_origin == (src & rt->rt_originmask))
break;
}
return rt;
diff --git a/usr.sbin/mrouted/route.h b/usr.sbin/mrouted/route.h
index 8a0f281caa26..5b34e8a0ce27 100644
--- a/usr.sbin/mrouted/route.h
+++ b/usr.sbin/mrouted/route.h
@@ -7,8 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: route.h,v 1.7 1997/02/22 16:07:07 peter Exp $
- * route.h,v 3.8.4.6 1997/07/01 23:02:35 fenner Exp
+ * $Id$
*/
/*
@@ -36,18 +35,17 @@ struct rtentry {
u_int32 rt_gateway; /* first-hop gateway back to origin */
vifi_t rt_parent; /* incoming vif (ie towards origin) */
vifbitmap_t rt_children; /* outgoing children vifs */
+ vifbitmap_t rt_leaves; /* subset of outgoing children vifs */
u_int32 *rt_dominants; /* per vif dominant gateways */
- nbrbitmap_t rt_subordinates; /* bitmap of subordinate gateways */
- nbrbitmap_t rt_subordadv; /* recently advertised subordinates */
+ u_int32 *rt_subordinates; /* per vif subordinate gateways */
+ u_int *rt_leaf_timers; /* per vif leaf confirmation timers */
u_int rt_timer; /* for timing out the route entry */
struct rtentry *rt_prev; /* link to previous entry */
struct gtable *rt_groups; /* link to active groups */
};
#define RTF_CHANGED 0x01 /* route changed but not reported */
-#define RTF_HOLDDOWN 0x04 /* this route is in holddown */
+#define RTF_LEAF_TIMING 0x02 /* some leaf timers are running */
#define ALL_ROUTES 0 /* possible arguments to report() */
#define CHANGED_ROUTES 1 /* and report_to_all_neighbors() */
-
-#define RT_FMT(r, s) inet_fmts((r)->rt_origin, (r)->rt_originmask, s)
diff --git a/usr.sbin/mrouted/rsrr.c b/usr.sbin/mrouted/rsrr.c
index b8a0a825bf56..d0771ecbafa8 100644
--- a/usr.sbin/mrouted/rsrr.c
+++ b/usr.sbin/mrouted/rsrr.c
@@ -32,17 +32,29 @@
#ifndef lint
static const char rcsid[] =
- "$Id: rsrr.c,v 1.6 1998/01/16 07:17:45 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#ifdef RSRR
#include "defs.h"
#include <sys/param.h>
-#ifdef HAVE_SA_LEN
-#include <stddef.h> /* for offsetof */
+#if (defined(BSD) && (BSD >= 199103))
+#include <stddef.h>
#endif
+/* Taken from prune.c */
+/*
+ * checks for scoped multicast addresses
+ */
+#define GET_SCOPE(gt) { \
+ register int _i; \
+ if (((gt)->gt_mcastgrp & 0xff000000) == 0xef000000) \
+ for (_i = 0; _i < numvifs; _i++) \
+ if (scoped_addr(_i, (gt)->gt_mcastgrp)) \
+ VIFM_SET(_i, (gt)->gt_scope); \
+ }
+
/*
* Exported variables.
*/
@@ -65,7 +77,6 @@ static void rsrr_accept __P((int recvlen));
static void rsrr_accept_iq __P((void));
static int rsrr_accept_rq __P((struct rsrr_rq *route_query, int flags,
struct gtable *gt_notify));
-static void rsrr_read __P((int, fd_set *));
static int rsrr_send __P((int sendlen));
static void rsrr_cache __P((struct gtable *gt,
struct rsrr_rq *route_query));
@@ -84,7 +95,7 @@ rsrr_init()
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sun_family = AF_UNIX;
strcpy(serv_addr.sun_path, RSRR_SERV_PATH);
-#ifdef HAVE_SA_LEN
+#if (defined(BSD) && (BSD >= 199103))
servlen = offsetof(struct sockaddr_un, sun_path) +
strlen(serv_addr.sun_path);
serv_addr.sun_len = servlen;
@@ -95,17 +106,22 @@ rsrr_init()
if (bind(rsrr_socket, (struct sockaddr *) &serv_addr, servlen) < 0)
log(LOG_ERR, errno, "Can't bind RSRR socket");
- if (register_input_handler(rsrr_socket, rsrr_read) < 0)
+ if (register_input_handler(rsrr_socket,rsrr_read) < 0)
log(LOG_WARNING, 0, "Couldn't register RSRR as an input handler");
}
/* Read a message from the RSRR socket */
-static void
+void
rsrr_read(f, rfd)
int f;
fd_set *rfd;
{
register int rsrr_recvlen;
+#ifdef SYSV
+ sigset_t block, oblock;
+#else
+ register int omask;
+#endif
bzero((char *) &client_addr, sizeof(client_addr));
rsrr_recvlen = recvfrom(rsrr_socket, rsrr_recv_buf, sizeof(rsrr_recv_buf),
@@ -115,7 +131,21 @@ rsrr_read(f, rfd)
log(LOG_ERR, errno, "RSRR recvfrom");
return;
}
+#ifdef SYSV
+ (void)sigemptyset(&block);
+ (void)sigaddset(&block, SIGALRM);
+ if (sigprocmask(SIG_BLOCK, &block, &oblock) < 0)
+ log(LOG_ERR, errno, "sigprocmask");
+#else
+ /* Use of omask taken from main() */
+ omask = sigblock(sigmask(SIGALRM));
+#endif
rsrr_accept(rsrr_recvlen);
+#ifdef SYSV
+ (void)sigprocmask(SIG_SETMASK, &oblock, (sigset_t *)NULL);
+#else
+ (void)sigsetmask(omask);
+#endif
}
/* Accept a message from the reservation protocol and take
@@ -149,8 +179,7 @@ rsrr_accept(recvlen)
switch (rsrr->type) {
case RSRR_INITIAL_QUERY:
/* Send Initial Reply to client */
- IF_DEBUG(DEBUG_RSRR)
- log(LOG_DEBUG, 0, "Received Initial Query\n");
+ log(LOG_INFO, 0, "Received Initial Query\n");
rsrr_accept_iq();
break;
case RSRR_ROUTE_QUERY:
@@ -163,8 +192,7 @@ rsrr_accept(recvlen)
}
/* Get the query */
route_query = (struct rsrr_rq *) (rsrr_recv_buf + RSRR_HEADER_LEN);
- IF_DEBUG(DEBUG_RSRR)
- log(LOG_DEBUG, 0,
+ log(LOG_INFO, 0,
"Received Route Query for src %s grp %s notification %d",
inet_fmt(route_query->source_addr.s_addr, s1),
inet_fmt(route_query->dest_addr.s_addr,s2),
@@ -230,8 +258,7 @@ rsrr_accept_iq()
sendlen = RSRR_HEADER_LEN + numvifs*RSRR_VIF_LEN;
/* Send it. */
- IF_DEBUG(DEBUG_RSRR)
- log(LOG_DEBUG, 0, "Send RSRR Initial Reply");
+ log(LOG_INFO, 0, "Send RSRR Initial Reply");
rsrr_send(sendlen);
}
@@ -252,7 +279,7 @@ rsrr_accept_rq(route_query,flags,gt_notify)
struct rsrr_rr *route_reply;
struct gtable *gt,local_g;
struct rtentry *r;
- int sendlen;
+ int sendlen,i;
u_long mcastgrp;
/* Set up message */
@@ -284,10 +311,8 @@ rsrr_accept_rq(route_query,flags,gt_notify)
rsrr->flags = flags;
/* Include the routing entry. */
route_reply->in_vif = gt_notify->gt_route->rt_parent;
- if (BIT_TST(flags,RSRR_NOTIFICATION_BIT))
- route_reply->out_vif_bm = gt_notify->gt_grpmems;
- else
- route_reply->out_vif_bm = 0;
+ route_reply->out_vif_bm = gt_notify->gt_grpmems;
+
} else if (find_src_grp(route_query->source_addr.s_addr, 0,
route_query->dest_addr.s_addr)) {
@@ -326,7 +351,17 @@ rsrr_accept_rq(route_query,flags,gt_notify)
gt->gt_route = r;
/* obtain the multicast group membership list */
- determine_forwvifs(gt);
+ for (i = 0; i < numvifs; i++) {
+ if (VIFM_ISSET(i, r->rt_children) &&
+ !(VIFM_ISSET(i, r->rt_leaves)))
+ VIFM_SET(i, gt->gt_grpmems);
+
+ if (VIFM_ISSET(i, r->rt_leaves) && grplst_mem(i, mcastgrp))
+ VIFM_SET(i, gt->gt_grpmems);
+ }
+
+ GET_SCOPE(gt);
+ gt->gt_grpmems &= ~gt->gt_scope;
/* Include the routing entry. */
route_reply->in_vif = gt->gt_route->rt_parent;
@@ -338,9 +373,13 @@ rsrr_accept_rq(route_query,flags,gt_notify)
}
}
- IF_DEBUG(DEBUG_RSRR)
- log(LOG_DEBUG, 0, "%sSend RSRR Route Reply for src %s dst %s in vif %d out vif %d\n",
- gt_notify ? "Route Change: " : "",
+ if (gt_notify)
+ log(LOG_INFO, 0, "Route Change: Send RSRR Route Reply");
+
+ else
+ log(LOG_INFO, 0, "Send RSRR Route Reply");
+
+ log(LOG_INFO, 0, "for src %s dst %s in vif %d out vif %d\n",
inet_fmt(route_reply->source_addr.s_addr,s1),
inet_fmt(route_reply->dest_addr.s_addr,s2),
route_reply->in_vif,route_reply->out_vif_bm);
@@ -400,7 +439,6 @@ rsrr_cache(gt,route_query)
} else {
/* Update */
rc->route_query.query_id = route_query->query_id;
- IF_DEBUG(DEBUG_RSRR)
log(LOG_DEBUG, 0,
"Update cached query id %ld from client %s\n",
rc->route_query.query_id, rc->client_addr.sun_path);
@@ -423,7 +461,6 @@ rsrr_cache(gt,route_query)
rc->client_length = client_length;
rc->next = gt->gt_rsrr_cache;
gt->gt_rsrr_cache = rc;
- IF_DEBUG(DEBUG_RSRR)
log(LOG_DEBUG, 0, "Cached query id %ld from client %s\n",
rc->route_query.query_id,rc->client_addr.sun_path);
}
@@ -445,7 +482,6 @@ rsrr_cache_send(gt,notify)
rcnp = &gt->gt_rsrr_cache;
while ((rc = *rcnp) != NULL) {
if (rsrr_accept_rq(&rc->route_query,flags,gt) < 0) {
- IF_DEBUG(DEBUG_RSRR)
log(LOG_DEBUG, 0, "Deleting cached query id %ld from client %s\n",
rc->route_query.query_id,rc->client_addr.sun_path);
/* Delete cache entry. */
@@ -464,9 +500,7 @@ rsrr_cache_clean(gt)
{
struct rsrr_cache *rc,*rc_next;
- IF_DEBUG(DEBUG_RSRR)
- log(LOG_DEBUG, 0, "cleaning cache for group %s\n",
- inet_fmt(gt->gt_mcastgrp, s1));
+ printf("cleaning cache for group %s\n",inet_fmt(gt->gt_mcastgrp, s1));
rc = gt->gt_rsrr_cache;
while (rc) {
rc_next = rc->next;
diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c
index 98c11ceb2ee2..4ce99edf49dd 100644
--- a/usr.sbin/mrouted/vif.c
+++ b/usr.sbin/mrouted/vif.c
@@ -5,14 +5,11 @@
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
- *
- *
- * vif.c,v 3.8.4.56.2.1 1999/01/20 05:18:50 fenner Exp
*/
#ifndef lint
static const char rcsid[] =
- "$Id: vif.c,v 1.13 1998/06/09 05:01:38 imp Exp $";
+ "$Id: vif.c,v 1.12 1998/01/16 07:17:45 charnier Exp $";
#endif /* not lint */
#include "defs.h"
@@ -31,11 +28,6 @@ int udp_socket; /* Since the honkin' kernel doesn't support */
/* How dumb. */
int vifs_with_neighbors; /* == 1 if I am a leaf */
-/*
- * Private variables.
- */
-struct listaddr *nbrs[MAXNBRS]; /* array of neighbors */
-
typedef struct {
vifi_t vifi;
struct listaddr *g;
@@ -50,7 +42,6 @@ static void start_vif2 __P((vifi_t vifi));
static void stop_vif __P((vifi_t vifi));
static void age_old_hosts __P((void));
static void send_probe_on_vif __P((struct uvif *v));
-static void send_query __P((struct uvif *v));
static int info_version __P((char *p, int plen));
static void DelVif __P((void *arg));
static int SetTimer __P((int vifi, struct listaddr *g));
@@ -80,15 +71,10 @@ init_vifs()
/*
* Configure the vifs based on the interface configuration of the
* the kernel and the contents of the configuration file.
- * (Open a UDP socket for ioctl use in the config procedures if
- * the kernel can't handle IOCTL's on the IGMP socket.)
+ * (Open a UDP socket for ioctl use in the config procedures.)
*/
-#ifdef IOCTL_OK_ON_RAW_SOCKET
- udp_socket = igmp_socket;
-#else
if ((udp_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
log(LOG_ERR, errno, "UDP socket");
-#endif
log(LOG_INFO,0,"Getting vifs from kernel interfaces");
config_vifs_from_kernel();
log(LOG_INFO,0,"Getting vifs from %s",configfilename);
@@ -138,47 +124,6 @@ init_vifs()
}
/*
- * Initialize the passed vif with all appropriate default values.
- * "t" is true if a tunnel, or false if a phyint.
- */
-void
-zero_vif(v, t)
- struct uvif *v;
- int t;
-{
- v->uv_flags = 0;
- v->uv_metric = DEFAULT_METRIC;
- v->uv_admetric = 0;
- v->uv_threshold = DEFAULT_THRESHOLD;
- v->uv_rate_limit = t ? DEFAULT_TUN_RATE_LIMIT : DEFAULT_PHY_RATE_LIMIT;
- v->uv_lcl_addr = 0;
- v->uv_rmt_addr = 0;
- v->uv_dst_addr = t ? 0 : dvmrp_group;
- v->uv_subnet = 0;
- v->uv_subnetmask = 0;
- v->uv_subnetbcast = 0;
- v->uv_name[0] = '\0';
- v->uv_groups = NULL;
- v->uv_neighbors = NULL;
- NBRM_CLRALL(v->uv_nbrmap);
- v->uv_querier = NULL;
- v->uv_igmpv1_warn = 0;
- v->uv_prune_lifetime = 0;
- v->uv_leaf_timer = 0;
- v->uv_acl = NULL;
- v->uv_addrs = NULL;
- v->uv_filter = NULL;
- v->uv_blasterbuf = NULL;
- v->uv_blastercur = NULL;
- v->uv_blasterend = NULL;
- v->uv_blasterlen = 0;
- v->uv_blastertimer = 0;
- v->uv_nbrup = 0;
- v->uv_icmp_warn = 0;
- v->uv_nroutes = 0;
-}
-
-/*
* Start routing on all virtual interfaces that are not down or
* administratively disabled.
*/
@@ -265,37 +210,6 @@ check_vif_state()
}
/*
- * Send a DVMRP message on the specified vif. If DVMRP messages are
- * to be encapsulated and sent "inside" the tunnel, use the special
- * encapsulator. If it's not a tunnel or DVMRP messages are to be
- * sent "beside" the tunnel, as required by earlier versions of mrouted,
- * then just send the message.
- */
-void
-send_on_vif(v, dst, code, datalen)
- register struct uvif *v;
- u_int32 dst;
- int code;
- int datalen;
-{
- u_int32 group = htonl(MROUTED_LEVEL |
- ((v->uv_flags & VIFF_LEAF) ? 0 : LEAF_FLAGS));
-
- /*
- * The UNIX kernel will not decapsulate unicasts.
- * Therefore, we don't send encapsulated unicasts.
- */
- if ((v->uv_flags & (VIFF_TUNNEL|VIFF_OTUNNEL)) == VIFF_TUNNEL &&
- ((dst == 0) || IN_MULTICAST(ntohl(dst))))
- send_ipip(v->uv_lcl_addr, dst ? dst : dvmrp_group, IGMP_DVMRP,
- code, group, datalen, v);
- else
- send_igmp(v->uv_lcl_addr, dst ? dst : v->uv_dst_addr, IGMP_DVMRP,
- code, group, datalen);
-}
-
-
-/*
* Send a probe message on vif v
*/
static void
@@ -307,10 +221,6 @@ send_probe_on_vif(v)
struct listaddr *nbr;
int i;
- if ((v->uv_flags & VIFF_PASSIVE && v->uv_neighbors == NULL) ||
- (v->uv_flags & VIFF_FORCE_LEAF))
- return;
-
p = send_buf + MIN_IP_HEADER_LEN + IGMP_MINLEN;
for (i = 0; i < 4; i++)
@@ -329,21 +239,13 @@ send_probe_on_vif(v)
nbr = nbr->al_next;
}
- send_on_vif(v, 0, DVMRP_PROBE, datalen);
-}
-
-static void
-send_query(v)
- register struct uvif *v;
-{
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "sending %squery on vif %d",
- (v->uv_flags & VIFF_IGMPV1) ? "v1 " : "",
- v - uvifs);
- send_igmp(v->uv_lcl_addr, allhosts_group,
- IGMP_MEMBERSHIP_QUERY,
- (v->uv_flags & VIFF_IGMPV1) ? 0 :
- IGMP_MAX_HOST_REPORT_DELAY * IGMP_TIMER_SCALE, 0, 0);
+ send_igmp(v->uv_lcl_addr,
+ (v->uv_flags & VIFF_TUNNEL) ? v->uv_rmt_addr
+ : dvmrp_group,
+ IGMP_DVMRP, DVMRP_PROBE,
+ htonl(MROUTED_LEVEL |
+ ((v->uv_flags & VIFF_LEAF) ? 0 : LEAF_FLAGS)),
+ datalen);
}
/*
@@ -403,10 +305,10 @@ start_vif2(vifi)
* the interface is connected.
*/
start_route_updates();
- update_route(v->uv_subnet, v->uv_subnetmask, 0, 0, vifi, NULL);
+ update_route(v->uv_subnet, v->uv_subnetmask, 0, 0, vifi);
for (p = v->uv_addrs; p; p = p->pa_next) {
start_route_updates();
- update_route(p->pa_subnet, p->pa_subnetmask, 0, 0, vifi, NULL);
+ update_route(p->pa_subnet, p->pa_subnetmask, 0, 0, vifi);
}
/*
@@ -415,9 +317,10 @@ start_vif2(vifi)
* query.
*/
v->uv_flags |= VIFF_QUERIER;
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "assuming querier duties on vif %d", vifi);
- send_query(v);
+ send_igmp(src, allhosts_group, IGMP_HOST_MEMBERSHIP_QUERY,
+ (v->uv_flags & VIFF_IGMPV1) ? 0 :
+ IGMP_MAX_HOST_REPORT_DELAY * IGMP_TIMER_SCALE, 0, 0);
+ age_old_hosts();
}
v->uv_leaf_timer = LEAF_CONFIRMATION_TIME;
@@ -458,10 +361,10 @@ stop_vif(vifi)
* failure.
*/
start_route_updates();
- update_route(v->uv_subnet, v->uv_subnetmask, UNREACHABLE, 0, vifi, NULL);
+ update_route(v->uv_subnet, v->uv_subnetmask, UNREACHABLE, 0, vifi);
for (p = v->uv_addrs; p; p = p->pa_next) {
start_route_updates();
- update_route(p->pa_subnet, p->pa_subnetmask, UNREACHABLE, 0, vifi, NULL);
+ update_route(p->pa_subnet, p->pa_subnetmask, UNREACHABLE, 0, vifi);
}
/*
@@ -474,8 +377,6 @@ stop_vif(vifi)
free((char *)a);
}
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "releasing querier duties on vif %d", vifi);
v->uv_flags &= ~VIFF_QUERIER;
}
@@ -492,16 +393,14 @@ stop_vif(vifi)
/*
* Discard all neighbor addresses.
*/
- if (!NBRM_ISEMPTY(v->uv_nbrmap))
+ if (v->uv_neighbors)
vifs_with_neighbors--;
while (v->uv_neighbors != NULL) {
a = v->uv_neighbors;
v->uv_neighbors = a->al_next;
- nbrs[a->al_index] = NULL;
free((char *)a);
}
- NBRM_CLRALL(v->uv_nbrmap);
}
@@ -526,7 +425,6 @@ stop_all_vifs()
while (v->uv_neighbors != NULL) {
a = v->uv_neighbors;
v->uv_neighbors = a->al_next;
- nbrs[a->al_index] = NULL;
free((char *)a);
}
while (v->uv_acl != NULL) {
@@ -554,8 +452,7 @@ find_vif(src, dst)
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
if (!(v->uv_flags & (VIFF_DOWN|VIFF_DISABLED))) {
if (v->uv_flags & VIFF_TUNNEL) {
- if (src == v->uv_rmt_addr && (dst == v->uv_lcl_addr ||
- dst == dvmrp_group))
+ if (src == v->uv_rmt_addr && dst == v->uv_lcl_addr)
return(vifi);
}
else {
@@ -594,13 +491,7 @@ age_old_hosts()
/*
- * Send group membership queries on each interface for which I am querier.
- * Note that technically, there should be a timer per interface, as the
- * dynamics of querier election can cause the "right" time to send a
- * query to be different on different interfaces. However, this simple
- * implementation only ever sends queries sooner than the "right" time,
- * so can not cause loss of membership (but can send more packets than
- * necessary)
+ * Send group membership queries to all subnets for which I am querier.
*/
void
query_groups()
@@ -610,16 +501,17 @@ query_groups()
for (vifi = 0, v = uvifs; vifi < numvifs; vifi++, v++) {
if (v->uv_flags & VIFF_QUERIER) {
- send_query(v);
+ send_igmp(v->uv_lcl_addr, allhosts_group,
+ IGMP_HOST_MEMBERSHIP_QUERY,
+ (v->uv_flags & VIFF_IGMPV1) ? 0 :
+ IGMP_MAX_HOST_REPORT_DELAY * IGMP_TIMER_SCALE, 0, 0);
}
}
age_old_hosts();
}
/*
- * Process an incoming host membership query. Warn about
- * IGMP version mismatches, perform querier election, and
- * handle group-specific queries when we're not the querier.
+ * Process an incoming host membership query
*/
void
accept_membership_query(src, dst, group, tmo)
@@ -639,97 +531,20 @@ accept_membership_query(src, dst, group, tmo)
v = &uvifs[vifi];
- if ((tmo == 0 && !(v->uv_flags & VIFF_IGMPV1)) ||
- (tmo != 0 && (v->uv_flags & VIFF_IGMPV1))) {
- int i;
-
- /*
- * Exponentially back-off warning rate
- */
- i = ++v->uv_igmpv1_warn;
- while (i && !(i & 1))
- i >>= 1;
- if (i == 1)
- log(LOG_WARNING, 0, "%s %s on vif %d, %s",
- tmo == 0 ? "Received IGMPv1 report from"
- : "Received IGMPv2 report from",
- inet_fmt(src, s1),
- vifi,
- tmo == 0 ? "please configure vif for IGMPv1"
- : "but I am configured for IGMPv1");
- }
-
- if (v->uv_querier == NULL || v->uv_querier->al_addr != src) {
- /*
- * This might be:
- * - A query from a new querier, with a lower source address
- * than the current querier (who might be me)
- * - A query from a new router that just started up and doesn't
- * know who the querier is.
- */
- if (ntohl(src) < (v->uv_querier ? ntohl(v->uv_querier->al_addr)
- : ntohl(v->uv_lcl_addr))) {
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "new querier %s (was %s) on vif %d",
- inet_fmt(src, s1),
- v->uv_querier ? inet_fmt(v->uv_querier->al_addr, s2) :
- "me", vifi);
- if (!v->uv_querier) {
- v->uv_querier = (struct listaddr *)
- malloc(sizeof(struct listaddr));
- v->uv_flags &= ~VIFF_QUERIER;
- }
- time(&v->uv_querier->al_ctime);
- v->uv_querier->al_addr = src;
- } else {
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "ignoring query from %s; querier on vif %d is still %s",
- inet_fmt(src, s1), vifi,
- v->uv_querier ? inet_fmt(v->uv_querier->al_addr, s2) :
- "me");
-
- return;
- }
- }
-
/*
- * Reset the timer since we've received a query.
+ * If we consider ourselves the querier for this vif, but hear a
+ * query from a router with a lower IP address, yield to them.
+ *
+ * This is done here as well as in the neighbor discovery in case
+ * there is a querier that doesn't speak DVMRP.
+ *
+ * XXX If this neighbor doesn't speak DVMRP, then we need to create
+ * some neighbor state for him so that we can time him out!
*/
- if (v->uv_querier && src == v->uv_querier->al_addr)
- v->uv_querier->al_timer = 0;
+ if ((v->uv_flags & VIFF_QUERIER) &&
+ (ntohl(src) < ntohl(v->uv_lcl_addr))) {
+ v->uv_flags &= ~VIFF_QUERIER;
- /*
- * If this is a Group-Specific query which we did not source,
- * we must set our membership timer to [Last Member Query Count] *
- * the [Max Response Time] in the packet.
- */
- if (!(v->uv_flags & (VIFF_IGMPV1|VIFF_QUERIER)) && group != 0 &&
- src != v->uv_lcl_addr) {
- register struct listaddr *g;
-
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0,
- "%s for %s from %s on vif %d, timer %d",
- "Group-specific membership query",
- inet_fmt(group, s2), inet_fmt(src, s1), vifi, tmo);
-
- for (g = v->uv_groups; g != NULL; g = g->al_next) {
- if (group == g->al_addr && g->al_query == 0) {
- /* setup a timeout to remove the group membership */
- if (g->al_timerid)
- g->al_timerid = DeleteTimer(g->al_timerid);
- g->al_timer = IGMP_LAST_MEMBER_QUERY_COUNT *
- tmo / IGMP_TIMER_SCALE;
- /* use al_query to record our presence in last-member state */
- g->al_query = -1;
- g->al_timerid = SetTimer(vifi, g);
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0,
- "timer for grp %s on vif %d set to %d",
- inet_fmt(group, s2), vifi, g->al_timer);
- break;
- }
- }
}
}
@@ -760,13 +575,14 @@ accept_group_report(src, dst, group, r_type)
*/
for (g = v->uv_groups; g != NULL; g = g->al_next) {
if (group == g->al_addr) {
- if (r_type == IGMP_V1_MEMBERSHIP_REPORT)
+ if (r_type == IGMP_HOST_MEMBERSHIP_REPORT)
g->al_old = OLD_AGE_THRESHOLD;
-
- g->al_reporter = src;
+#ifdef SNMP
+ g->al_genid = src;
+#endif /* SNMP */
/** delete old timers, set a timer for expiration **/
- g->al_timer = IGMP_GROUP_MEMBERSHIP_INTERVAL;
+ g->al_timer = GROUP_EXPIRE_TIME;
if (g->al_query)
g->al_query = DeleteTimer(g->al_query);
if (g->al_timerid)
@@ -785,19 +601,21 @@ accept_group_report(src, dst, group, r_type)
log(LOG_ERR, 0, "ran out of memory"); /* fatal */
g->al_addr = group;
- if (r_type == IGMP_V1_MEMBERSHIP_REPORT)
- g->al_old = OLD_AGE_THRESHOLD;
- else
+ if (r_type == IGMP_HOST_NEW_MEMBERSHIP_REPORT)
g->al_old = 0;
+ else
+ g->al_old = OLD_AGE_THRESHOLD;
+#ifdef SNMP
+ g->al_genid = src;
+#endif
/** set a timer for expiration **/
- g->al_query = 0;
- g->al_timer = IGMP_GROUP_MEMBERSHIP_INTERVAL;
- g->al_reporter = src;
- g->al_timerid = SetTimer(vifi, g);
- g->al_next = v->uv_groups;
- v->uv_groups = g;
+ g->al_query = 0;
+ g->al_timer = GROUP_EXPIRE_TIME;
time(&g->al_ctime);
+ g->al_timerid = SetTimer(vifi, g);
+ g->al_next = v->uv_groups;
+ v->uv_groups = g;
update_lclgrp(vifi, group);
}
@@ -808,9 +626,7 @@ accept_group_report(src, dst, group, r_type)
chkgrp_graft(vifi, group);
}
-/*
- * Process an incoming IGMPv2 Leave Group message.
- */
+
void
accept_leave_message(src, dst, group)
u_int32 src, dst, group;
@@ -838,7 +654,6 @@ accept_leave_message(src, dst, group)
*/
for (g = v->uv_groups; g != NULL; g = g->al_next) {
if (group == g->al_addr) {
- IF_DEBUG(DEBUG_IGMP)
log(LOG_DEBUG, 0,
"[vif.c, _accept_leave_message] %d %d \n",
g->al_old, g->al_query);
@@ -855,20 +670,14 @@ accept_leave_message(src, dst, group)
if (g->al_timerid)
g->al_timerid = DeleteTimer(g->al_timerid);
-#if IGMP_LAST_MEMBER_QUERY_COUNT != 2
-This code needs to be updated to keep a counter of the number
-of queries remaining.
-#endif
/** send a group specific querry **/
- g->al_timer = IGMP_LAST_MEMBER_QUERY_INTERVAL *
- (IGMP_LAST_MEMBER_QUERY_COUNT + 1);
+ g->al_timer = LEAVE_EXPIRE_TIME;
send_igmp(v->uv_lcl_addr, g->al_addr,
- IGMP_MEMBERSHIP_QUERY,
- IGMP_LAST_MEMBER_QUERY_INTERVAL * IGMP_TIMER_SCALE,
- g->al_addr, 0);
- g->al_query = SetQueryTimer(g, vifi,
- IGMP_LAST_MEMBER_QUERY_INTERVAL,
- IGMP_LAST_MEMBER_QUERY_INTERVAL * IGMP_TIMER_SCALE);
+ IGMP_HOST_MEMBERSHIP_QUERY,
+ LEAVE_EXPIRE_TIME / 3 * IGMP_TIMER_SCALE,
+ g->al_addr, 0);
+ g->al_query = SetQueryTimer(g, vifi, g->al_timer / 3,
+ LEAVE_EXPIRE_TIME / 3 * IGMP_TIMER_SCALE);
g->al_timerid = SetTimer(vifi, g);
break;
}
@@ -1024,9 +833,6 @@ accept_neighbor_request2(src, dst)
}
/* Put out the header for this neighbor list... */
if (ncount == 0) {
- /* If it's a one-way tunnel, mark it down. */
- if (rflags & DVMRP_NF_TUNNEL && la->al_flags & NBRF_ONEWAY)
- rflags |= DVMRP_NF_DOWN;
*(u_int*)p = v->uv_lcl_addr;
p += 4;
*p++ = v->uv_metric;
@@ -1036,20 +842,11 @@ accept_neighbor_request2(src, dst)
*p++ = 0;
datalen += 4 + 4;
}
- /* Don't report one-way peering on phyint at all */
- if (!(rflags & DVMRP_NF_TUNNEL) && la->al_flags & NBRF_ONEWAY)
- continue;
*(u_int*)p = la->al_addr;
p += 4;
datalen += 4;
(*ncount)++;
}
- if (*ncount == 0) {
- *(u_int*)p = v->uv_rmt_addr;
- p += 4;
- datalen += 4;
- (*ncount)++;
- }
}
}
if (datalen != 0)
@@ -1145,8 +942,7 @@ accept_neighbors2(src, dst, p, datalen, level)
u_char *p;
int datalen;
{
- IF_DEBUG(DEBUG_PKT)
- log(LOG_DEBUG, 0, "ignoring spurious DVMRP neighbor list2 from %s to %s",
+ log(LOG_INFO, 0, "ignoring spurious DVMRP neighbor list2 from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
}
@@ -1159,8 +955,7 @@ accept_info_reply(src, dst, p, datalen)
u_char *p;
int datalen;
{
- IF_DEBUG(DEBUG_PKT)
- log(LOG_DEBUG, 0, "ignoring spurious DVMRP info reply from %s to %s",
+ log(LOG_INFO, 0, "ignoring spurious DVMRP info reply from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
}
@@ -1168,9 +963,9 @@ accept_info_reply(src, dst, p, datalen)
/*
* Update the neighbor entry for neighbor 'addr' on vif 'vifi'.
* 'msgtype' is the type of DVMRP message received from the neighbor.
- * Return the neighbor entry if 'addr' is a valid neighbor, FALSE otherwise.
+ * Return TRUE if 'addr' is a valid neighbor, FALSE otherwise.
*/
-struct listaddr *
+int
update_neighbor(vifi, addr, msgtype, p, datalen, level)
vifi_t vifi;
u_int32 addr;
@@ -1181,17 +976,14 @@ update_neighbor(vifi, addr, msgtype, p, datalen, level)
{
register struct uvif *v;
register struct listaddr *n;
- int pv = level & 0xff;
- int mv = (level >> 8) & 0xff;
- int has_genid = 0;
- int in_router_list = 0;
- int dvmrpspec = 0;
- u_int32 genid;
+ u_int32 genid = 0;
+ u_int32 router;
u_int32 send_tables = 0;
- int i;
int do_reset = FALSE;
+ int nflags;
v = &uvifs[vifi];
+ nflags = (level >> 16) & 0xff;
/*
* Confirm that 'addr' is a valid neighbor address on vif 'vifi'.
@@ -1208,67 +1000,12 @@ update_neighbor(vifi, addr, msgtype, p, datalen, level)
(addr == v->uv_lcl_addr ||
addr == v->uv_subnet )) {
log(LOG_WARNING, 0,
- "received DVMRP message from %s: %s",
- (addr == v->uv_lcl_addr) ? "self (check device loopback)" :
- "'the unknown host'",
+ "received DVMRP message from 'the unknown host' or self: %s",
inet_fmt(addr, s1));
- return NULL;
- }
-
- /*
- * Ignore all neighbors on vifs forced into leaf mode
- */
- if (v->uv_flags & VIFF_FORCE_LEAF) {
- return NULL;
+ return (FALSE);
}
/*
- * mrouted's version 3.3 and later include the generation ID
- * and the list of neighbors on the vif in their probe messages.
- */
- if (msgtype == DVMRP_PROBE && ((pv == 3 && mv > 2) ||
- (pv > 3 && pv < 10))) {
- u_int32 router;
-
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "checking probe from %s (%d.%d) on vif %d",
- inet_fmt(addr, s1), pv, mv, vifi);
-
- if (datalen < 4) {
- log(LOG_WARNING, 0,
- "received truncated probe message from %s (len %d)",
- inet_fmt(addr, s1), datalen);
- return NULL;
- }
-
- has_genid = 1;
-
- for (i = 0; i < 4; i++)
- ((char *)&genid)[i] = *p++;
- datalen -= 4;
-
- while (datalen > 0) {
- if (datalen < 4) {
- log(LOG_WARNING, 0,
- "received truncated probe message from %s (len %d)",
- inet_fmt(addr, s1), datalen);
- return NULL;
- }
- for (i = 0; i < 4; i++)
- ((char *)&router)[i] = *p++;
- datalen -= 4;
-
- if (router == v->uv_lcl_addr) {
- in_router_list = 1;
- break;
- }
- }
- }
-
- if ((pv == 3 && mv == 255) || (pv > 3 && pv < 10))
- dvmrpspec = 1;
-
- /*
* Look for addr in list of neighbors.
*/
for (n = v->uv_neighbors; n != NULL; n = n->al_next) {
@@ -1277,217 +1014,157 @@ update_neighbor(vifi, addr, msgtype, p, datalen, level)
}
}
- if (n == NULL) {
+ /*
+ * Found it. Reset its timer, and check for a version change
+ */
+ if (n) {
+ n->al_timer = 0;
+
/*
- * New neighbor.
- *
- * If this neighbor follows the DVMRP spec, start the probe
- * handshake. If not, then it doesn't require the probe
- * handshake, so establish the peering immediately.
+ * update the neighbors version and protocol number
+ * if changed => router went down and came up,
+ * so take action immediately.
*/
- if (dvmrpspec && (msgtype != DVMRP_PROBE))
- return NULL;
+ if ((n->al_pv != (level & 0xff)) ||
+ (n->al_mv != ((level >> 8) & 0xff))) {
- for (i = 0; i < MAXNBRS; i++)
- if (nbrs[i] == NULL)
- break;
-
- if (i == MAXNBRS) {
- /* XXX This is a severe new restriction. */
- /* XXX want extensible bitmaps! */
- log(LOG_ERR, 0, "Can't handle %dth neighbor %s on vif %d!",
- MAXNBRS, inet_fmt(addr, s1), vifi);
- /*NOTREACHED*/
+ do_reset = TRUE;
+ log(LOG_DEBUG, 0,
+ "version change neighbor %s [old:%d.%d, new:%d.%d]",
+ inet_fmt(addr, s1),
+ n->al_pv, n->al_mv, level&0xff, (level >> 8) & 0xff);
+
+ n->al_pv = level & 0xff;
+ n->al_mv = (level >> 8) & 0xff;
}
-
+ } else {
/*
- * Add it to our list of neighbors.
+ * If not found, add it to the list. If the neighbor has a lower
+ * IP address than me, yield querier duties to it.
*/
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "New neighbor %s on vif %d v%d.%d nf 0x%02x idx %d",
+ log(LOG_DEBUG, 0, "New neighbor %s on vif %d v%d.%d nf 0x%02x",
inet_fmt(addr, s1), vifi, level & 0xff, (level >> 8) & 0xff,
- (level >> 16) & 0xff, i);
+ (level >> 16) & 0xff);
n = (struct listaddr *)malloc(sizeof(struct listaddr));
if (n == NULL)
log(LOG_ERR, 0, "ran out of memory"); /* fatal */
n->al_addr = addr;
- n->al_pv = pv;
- n->al_mv = mv;
- n->al_genid = has_genid ? genid : 0;
- n->al_index = i;
- nbrs[i] = n;
+ n->al_pv = level & 0xff;
+ n->al_mv = (level >> 8) & 0xff;
+ n->al_genid = 0;
time(&n->al_ctime);
n->al_timer = 0;
- n->al_flags = has_genid ? NBRF_GENID : 0;
n->al_next = v->uv_neighbors;
- v->uv_neighbors = n;
-
- /*
- * If we are not configured to peer with non-pruning routers,
- * check the deprecated "I-know-how-to-prune" bit. This bit
- * was MBZ in early mrouted implementations (<3.5) and is required
- * to be set by the DVMRPv3 specification.
- */
- if (!(v->uv_flags & VIFF_ALLOW_NONPRUNERS) &&
- !((level & 0x020000) || (pv == 3 && mv < 5))) {
- n->al_flags |= NBRF_TOOOLD;
- }
-
- /*
- * If this router implements the DVMRPv3 spec, then don't peer
- * with him if we haven't yet established a bidirectional connection.
- */
- if (dvmrpspec) {
- if (!in_router_list) {
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "waiting for probe from %s with my addr",
- inet_fmt(addr, s1));
- n->al_flags |= NBRF_WAITING;
- return NULL;
- }
- }
-
- if (n->al_flags & NBRF_DONTPEER) {
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "not peering with %s on vif %d because %x",
- inet_fmt(addr, s1), vifi, n->al_flags & NBRF_DONTPEER);
- return NULL;
- }
/*
* If we thought that we had no neighbors on this vif, send a route
* report to the vif. If this is just a new neighbor on the same
* vif, send the route report just to the new neighbor.
*/
- if (NBRM_ISEMPTY(v->uv_nbrmap)) {
- send_tables = v->uv_dst_addr;
+ if (v->uv_neighbors == NULL) {
+ send_tables = (v->uv_flags & VIFF_TUNNEL) ? addr : dvmrp_group;
vifs_with_neighbors++;
} else {
send_tables = addr;
}
+ v->uv_neighbors = n;
- NBRM_SET(i, v->uv_nbrmap);
- add_neighbor_to_routes(vifi, i);
- } else {
- /*
- * Found it. Reset its timer.
- */
- n->al_timer = 0;
+ if (!(v->uv_flags & VIFF_TUNNEL) &&
+ ntohl(addr) < ntohl(v->uv_lcl_addr))
+ v->uv_flags &= ~VIFF_QUERIER;
+ }
- if (n->al_flags & NBRF_WAITING && msgtype == DVMRP_PROBE) {
- n->al_flags &= ~NBRF_WAITING;
- if (!in_router_list) {
- log(LOG_WARNING, 0, "possible one-way peering with %s on vif %d",
- inet_fmt(addr, s1), vifi);
- n->al_flags |= NBRF_ONEWAY;
- return NULL;
- } else {
- if (NBRM_ISEMPTY(v->uv_nbrmap)) {
- send_tables = v->uv_dst_addr;
- vifs_with_neighbors++;
- } else {
- send_tables = addr;
- }
- NBRM_SET(n->al_index, v->uv_nbrmap);
- add_neighbor_to_routes(vifi, n->al_index);
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "%s on vif %d exits WAITING",
- inet_fmt(addr, s1), vifi);
- }
- }
+ /*
+ * Check if the router gen-ids are the same.
+ * Need to reset the prune state of the router if not.
+ * Also check for one-way interfaces by seeing if we are in our
+ * neighbor's list of known routers.
+ */
+ if (msgtype == DVMRP_PROBE) {
+
+ /* Check genid neighbor flag. Also check version number; 3.3 and
+ * 3.4 didn't set this flag. */
+ if ((((level >> 16) & 0xff) & NF_GENID) ||
+ (((level & 0xff) == 3) && (((level >> 8) & 0xff) > 2))) {
+
+ int i;
- if (n->al_flags & NBRF_ONEWAY && msgtype == DVMRP_PROBE) {
- if (in_router_list) {
- if (NBRM_ISEMPTY(v->uv_nbrmap))
- vifs_with_neighbors++;
- NBRM_SET(n->al_index, v->uv_nbrmap);
- add_neighbor_to_routes(vifi, n->al_index);
- log(LOG_NOTICE, 0, "peering with %s on vif %d is no longer one-way",
- inet_fmt(addr, s1), vifi);
- n->al_flags &= ~NBRF_ONEWAY;
- } else {
- /* XXX rate-limited warning message? */
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "%s on vif %d is still ONEWAY",
- inet_fmt(addr, s1), vifi);
+ if (datalen < 4) {
+ log(LOG_WARNING, 0,
+ "received truncated probe message from %s (len %d)",
+ inet_fmt(addr, s1), datalen);
+ return (FALSE);
}
- }
- /*
- * When peering with a genid-capable but pre-DVMRP spec peer,
- * we might bring up the peering with a route report and not
- * remember his genid. Assume that he doesn't send a route
- * report and then reboot before sending a probe.
- */
- if (has_genid && !(n->al_flags & NBRF_GENID)) {
- n->al_flags |= NBRF_GENID;
- n->al_genid = genid;
- }
+ for (i = 0; i < 4; i++)
+ ((char *)&genid)[i] = *p++;
+ datalen -= 4;
- /*
- * update the neighbors version and protocol number and genid
- * if changed => router went down and came up,
- * so take action immediately.
- */
- if ((n->al_pv != pv) ||
- (n->al_mv != mv) ||
- (has_genid && n->al_genid != genid)) {
+ if (n->al_genid == 0)
+ n->al_genid = genid;
+ else if (n->al_genid != genid) {
+ log(LOG_DEBUG, 0,
+ "new genid neigbor %s on vif %d [old:%x, new:%x]",
+ inet_fmt(addr, s1), vifi, n->al_genid, genid);
- do_reset = TRUE;
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0,
- "version/genid change neighbor %s [old:%d.%d/%8x, new:%d.%d/%8x]",
- inet_fmt(addr, s1),
- n->al_pv, n->al_mv, n->al_genid, pv, mv, genid);
+ n->al_genid = genid;
+ do_reset = TRUE;
+ }
- n->al_pv = pv;
- n->al_mv = mv;
- n->al_genid = genid;
- time(&n->al_ctime);
- }
-
- if ((pv == 3 && mv > 2) || (pv > 3 && pv < 10)) {
- if (!(n->al_flags & VIFF_ONEWAY) && has_genid && !in_router_list &&
- (time(NULL) - n->al_ctime > 20)) {
- if (NBRM_ISSET(n->al_index, v->uv_nbrmap)) {
- NBRM_CLR(n->al_index, v->uv_nbrmap);
- if (NBRM_ISEMPTY(v->uv_nbrmap))
- vifs_with_neighbors--;
+ /*
+ * loop through router list and check for one-way ifs.
+ */
+
+ v->uv_flags |= VIFF_ONEWAY;
+
+ while (datalen > 0) {
+ if (datalen < 4) {
+ log(LOG_WARNING, 0,
+ "received truncated probe message from %s (len %d)",
+ inet_fmt(addr, s1), datalen);
+ return (FALSE);
+ }
+ for (i = 0; i < 4; i++)
+ ((char *)&router)[i] = *p++;
+ datalen -= 4;
+ if (router == v->uv_lcl_addr) {
+ v->uv_flags &= ~VIFF_ONEWAY;
+ break;
}
- delete_neighbor_from_routes(addr, vifi, n->al_index);
- reset_neighbor_state(vifi, addr);
- log(LOG_WARNING, 0, "peering with %s on vif %d is one-way",
- inet_fmt(addr, s1), vifi);
- n->al_flags |= NBRF_ONEWAY;
}
}
-
- if (n->al_flags & NBRF_DONTPEER) {
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "not peering with %s on vif %d because %x",
- inet_fmt(addr, s1), vifi, n->al_flags & NBRF_DONTPEER);
- return NULL;
+ }
+ if (n->al_flags != nflags) {
+ n->al_flags = nflags;
+
+ if (n->al_flags & NF_LEAF) {
+ /*XXX If we have non-leaf neighbors then we know we shouldn't
+ * mark this vif as a leaf. For now we just count on other
+ * probes and/or reports resetting the timer. */
+ if (!v->uv_leaf_timer)
+ v->uv_leaf_timer = LEAF_CONFIRMATION_TIME;
+ } else {
+ /* If we get a leaf to non-leaf transition, we *must* update
+ * the routing table. */
+ if (v->uv_flags & VIFF_LEAF && send_tables == 0)
+ send_tables = addr;
+ v->uv_flags &= ~VIFF_LEAF;
+ v->uv_leaf_timer = 0;
}
-
- /* check "leaf" flag */
}
if (do_reset) {
reset_neighbor_state(vifi, addr);
if (!send_tables)
send_tables = addr;
}
- if (send_tables) {
- send_probe_on_vif(v);
+ if (send_tables)
report(ALL_ROUTES, vifi, send_tables);
- }
- v->uv_leaf_timer = 0;
- v->uv_flags &= ~VIFF_LEAF;
- return n;
+ return (TRUE);
}
@@ -1500,7 +1177,7 @@ age_vifs()
{
register vifi_t vifi;
register struct uvif *v;
- register struct listaddr *a, *prev_a;
+ register struct listaddr *a, *prev_a, *n;
register u_int32 addr;
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v ) {
@@ -1512,58 +1189,39 @@ age_vifs()
a = v->uv_neighbors;
a != NULL;
prev_a = a, a = a->al_next) {
- int exp_time;
- int idx;
- if (((a->al_pv == 3) && (a->al_mv >= 3)) ||
- ((a->al_pv > 3) && (a->al_pv < 10)))
- exp_time = NEIGHBOR_EXPIRE_TIME;
- else
- exp_time = OLD_NEIGHBOR_EXPIRE_TIME;
-
- if ((a->al_timer += TIMER_INTERVAL) < exp_time)
+ if ((a->al_timer += TIMER_INTERVAL) < NEIGHBOR_EXPIRE_TIME)
continue;
- IF_DEBUG(DEBUG_PEER)
- log(LOG_DEBUG, 0, "Neighbor %s (%d.%d) expired after %d seconds",
- inet_fmt(a->al_addr, s1), a->al_pv, a->al_mv, exp_time);
-
/*
* Neighbor has expired; delete it from the neighbor list,
* delete it from the 'dominants' and 'subordinates arrays of
- * any route entries.
+ * any route entries and assume querier duties unless there is
+ * another neighbor with a lower IP address than mine.
*/
- NBRM_CLR(a->al_index, v->uv_nbrmap);
- nbrs[a->al_index] = NULL; /* XXX is it a good idea to reuse indxs? */
- idx = a->al_index;
addr = a->al_addr;
prev_a->al_next = a->al_next;
free((char *)a);
- a = prev_a;/*XXX use ** */
+ a = prev_a;
- delete_neighbor_from_routes(addr, vifi, idx);
- reset_neighbor_state(vifi, addr);
+ delete_neighbor_from_routes(addr, vifi);
- if (NBRM_ISEMPTY(v->uv_nbrmap))
+ if (v->uv_neighbors == NULL)
vifs_with_neighbors--;
v->uv_leaf_timer = LEAF_CONFIRMATION_TIME;
- }
- if (v->uv_querier &&
- (v->uv_querier->al_timer += TIMER_INTERVAL) >
- IGMP_OTHER_QUERIER_PRESENT_INTERVAL) {
- /*
- * The current querier has timed out. We must become the
- * querier.
- */
- IF_DEBUG(DEBUG_IGMP)
- log(LOG_DEBUG, 0, "querier %s timed out",
- inet_fmt(v->uv_querier->al_addr, s1));
- free(v->uv_querier);
- v->uv_querier = NULL;
- v->uv_flags |= VIFF_QUERIER;
- send_query(v);
+ if (!(v->uv_flags & VIFF_TUNNEL)) {
+ v->uv_flags |= VIFF_QUERIER;
+ for (n = v->uv_neighbors; n != NULL; n = n->al_next) {
+ if (ntohl(n->al_addr) < ntohl(v->uv_lcl_addr)) {
+ v->uv_flags &= ~VIFF_QUERIER;
+ }
+ if (!(n->al_flags & NF_LEAF)) {
+ v->uv_leaf_timer = 0;
+ }
+ }
+ }
}
}
}
@@ -1585,36 +1243,6 @@ neighbor_info(vifi, addr)
return NULL;
}
-static struct vnflags {
- int vn_flag;
- char *vn_name;
-} vifflags[] = {
- { VIFF_DOWN, "down" },
- { VIFF_DISABLED, "disabled" },
- { VIFF_QUERIER, "querier" },
- { VIFF_ONEWAY, "one-way" },
- { VIFF_LEAF, "leaf" },
- { VIFF_IGMPV1, "IGMPv1" },
- { VIFF_REXMIT_PRUNES, "rexmit_prunes" },
- { VIFF_PASSIVE, "passive" },
- { VIFF_ALLOW_NONPRUNERS,"allow_nonpruners" },
- { VIFF_NOFLOOD, "noflood" },
- { VIFF_NOTRANSIT, "notransit" },
- { VIFF_BLASTER, "blaster" },
- { VIFF_FORCE_LEAF, "force_leaf" },
- { VIFF_OTUNNEL, "old-tunnel" },
-};
-
-static struct vnflags nbrflags[] = {
- { NBRF_LEAF, "leaf" },
- { NBRF_GENID, "have-genid" },
- { NBRF_WAITING, "waiting" },
- { NBRF_ONEWAY, "one-way" },
- { NBRF_TOOOLD, "too old" },
- { NBRF_TOOMANYROUTES, "too many routes" },
- { NBRF_NOTPRUNING, "not pruning?" },
-};
-
/*
* Print the contents of the uvifs array on file 'fp'.
*/
@@ -1626,13 +1254,8 @@ dump_vifs(fp)
register struct uvif *v;
register struct listaddr *a;
register struct phaddr *p;
- register struct vif_acl *acl;
- int i;
struct sioc_vif_req v_req;
- time_t now;
- char *label;
- time(&now);
fprintf(fp, "vifs_with_neighbors = %d\n", vifs_with_neighbors);
if (vifs_with_neighbors == 1)
@@ -1660,106 +1283,65 @@ dump_vifs(fp)
v->uv_threshold,
v->uv_rate_limit);
- for (i = 0; i < sizeof(vifflags) / sizeof(struct vnflags); i++)
- if (v->uv_flags & vifflags[i].vn_flag)
- fprintf(fp, " %s", vifflags[i].vn_name);
-
+ if (v->uv_flags & VIFF_ONEWAY) fprintf(fp, " one-way");
+ if (v->uv_flags & VIFF_DOWN) fprintf(fp, " down");
+ if (v->uv_flags & VIFF_DISABLED) fprintf(fp, " disabled");
+ if (v->uv_flags & VIFF_QUERIER) fprintf(fp, " querier");
+ if (v->uv_flags & VIFF_SRCRT) fprintf(fp, " src-rt");
+ if (v->uv_flags & VIFF_LEAF) fprintf(fp, " leaf");
+ if (v->uv_flags & VIFF_IGMPV1) fprintf(fp, " IGMPv1");
fprintf(fp, "\n");
- /*
- fprintf(fp, " #routes: %d\n", v->uv_nroutes);
- */
- if (v->uv_admetric != 0)
- fprintf(fp, " advert-metric %2u\n",
- v->uv_admetric);
- label = "alternate subnets:";
- for (p = v->uv_addrs; p; p = p->pa_next) {
- fprintf(fp, " %18s %s\n", label,
+ if (v->uv_addrs != NULL) {
+ fprintf(fp, " alternate subnets: %s\n",
+ inet_fmts(v->uv_addrs->pa_subnet, v->uv_addrs->pa_subnetmask, s1));
+ for (p = v->uv_addrs->pa_next; p; p = p->pa_next) {
+ fprintf(fp, " %s\n",
inet_fmts(p->pa_subnet, p->pa_subnetmask, s1));
- label = "";
+ }
}
- label = "peers:";
- for (a = v->uv_neighbors; a != NULL; a = a->al_next) {
- fprintf(fp, " %6s %s (%d.%d) [%d]",
- label, inet_fmt(a->al_addr, s1), a->al_pv, a->al_mv,
- a->al_index);
- for (i = 0; i < sizeof(nbrflags) / sizeof(struct vnflags); i++)
- if (a->al_flags & nbrflags[i].vn_flag)
- fprintf(fp, " %s", nbrflags[i].vn_name);
- fprintf(fp, " up %s\n", scaletime(now - a->al_ctime));
- /*fprintf(fp, " #routes %d\n", a->al_nroutes);*/
- label = "";
+ if (v->uv_neighbors != NULL) {
+ fprintf(fp, " peers: %s (%d.%d) (0x%x)\n",
+ inet_fmt(v->uv_neighbors->al_addr, s1),
+ v->uv_neighbors->al_pv, v->uv_neighbors->al_mv,
+ v->uv_neighbors->al_flags);
+ for (a = v->uv_neighbors->al_next; a != NULL; a = a->al_next) {
+ fprintf(fp, " %s (%d.%d) (0x%x)\n",
+ inet_fmt(a->al_addr, s1), a->al_pv, a->al_mv,
+ a->al_flags);
+ }
}
- label = "group host (time left):";
- for (a = v->uv_groups; a != NULL; a = a->al_next) {
- fprintf(fp, " %23s %-15s %-15s (%s)\n",
- label,
- inet_fmt(a->al_addr, s1),
- inet_fmt(a->al_reporter, s2),
- scaletime(timer_leftTimer(a->al_timerid)));
- label = "";
+ if (v->uv_groups != NULL) {
+ fprintf(fp, " groups: %-15s\n",
+ inet_fmt(v->uv_groups->al_addr, s1));
+ for (a = v->uv_groups->al_next; a != NULL; a = a->al_next) {
+ fprintf(fp, " %-15s\n",
+ inet_fmt(a->al_addr, s1));
+ }
}
- label = "boundaries:";
- for (acl = v->uv_acl; acl != NULL; acl = acl->acl_next) {
- fprintf(fp, " %11s %-18s\n", label,
+ if (v->uv_acl != NULL) {
+ struct vif_acl *acl;
+
+ fprintf(fp, " boundaries: %-18s\n",
+ inet_fmts(v->uv_acl->acl_addr, v->uv_acl->acl_mask, s1));
+ for (acl = v->uv_acl->acl_next; acl != NULL; acl = acl->acl_next) {
+ fprintf(fp, " : %-18s\n",
inet_fmts(acl->acl_addr, acl->acl_mask, s1));
- label = "";
- }
- if (v->uv_filter) {
- struct vf_element *vfe;
- char lbuf[100];
-
- sprintf(lbuf, "%5s %7s filter:",
- v->uv_filter->vf_flags & VFF_BIDIR ? "bidir"
- : " ",
- v->uv_filter->vf_type == VFT_ACCEPT ? "accept"
- : "deny");
- label = lbuf;
- for (vfe = v->uv_filter->vf_filter;
- vfe != NULL; vfe = vfe->vfe_next) {
- fprintf(fp, " %23s %-18s%s\n",
- label,
- inet_fmts(vfe->vfe_addr, vfe->vfe_mask, s1),
- vfe->vfe_flags & VFEF_EXACT ? " (exact)" : "");
- label = "";
}
}
- if (!(v->uv_flags & (VIFF_TUNNEL|VIFF_DOWN|VIFF_DISABLED))) {
- fprintf(fp, " IGMP querier: ");
- if (v->uv_querier == NULL)
- if (v->uv_flags & VIFF_QUERIER)
- fprintf(fp, "%-18s (this system)\n",
- inet_fmt(v->uv_lcl_addr, s1));
- else
- fprintf(fp, "NONE - querier election failure?\n");
- else
- fprintf(fp, "%-18s up %s last heard %s ago\n",
- inet_fmt(v->uv_querier->al_addr, s1),
- scaletime(now - v->uv_querier->al_ctime),
- scaletime(v->uv_querier->al_timer));
- }
- if (v->uv_flags & VIFF_BLASTER)
- fprintf(fp, " blasterbuf size: %dk\n",
- v->uv_blasterlen / 1024);
- fprintf(fp, " Nbr bitmaps: 0x%08lx%08lx\n",/*XXX*/
- v->uv_nbrmap.hi, v->uv_nbrmap.lo);
- if (v->uv_prune_lifetime != 0)
- fprintf(fp, " Prune Lifetime: %d seconds\n",
- v->uv_prune_lifetime);
-
v_req.vifi = vifi;
- if (did_final_init)
- if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) < 0) {
- log(LOG_WARNING, errno,
- "SIOCGETVIFCNT fails on vif %d", vifi);
- } else {
- fprintf(fp, " pkts/bytes in : %lu/%lu\n",
- v_req.icount, v_req.ibytes);
- fprintf(fp, " pkts/bytes out: %lu/%lu\n",
- v_req.ocount, v_req.obytes);
- }
+ if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) < 0) {
+ log(LOG_WARNING, 0,
+ "SIOCGETVIFCNT fails");
+ }
+ else {
+ fprintf(fp, " pkts in : %ld\n",
+ v_req.icount);
+ fprintf(fp, " pkts out: %ld\n",
+ v_req.ocount);
+ }
fprintf(fp, "\n");
}
fprintf(fp, "\n");
@@ -1812,7 +1394,7 @@ SetTimer(vifi, g)
cbk = (cbk_t *) malloc(sizeof(cbk_t));
cbk->g = g;
cbk->vifi = vifi;
- return timer_setTimer(g->al_timer, DelVif, cbk);
+ return timer_setTimer(g->al_timer, (cfunc_t)DelVif, (void *)cbk);
}
/*
@@ -1837,7 +1419,7 @@ SendQuery(arg)
register struct uvif *v = &uvifs[cbk->vifi];
send_igmp(v->uv_lcl_addr, cbk->g->al_addr,
- IGMP_MEMBERSHIP_QUERY,
+ IGMP_HOST_MEMBERSHIP_QUERY,
cbk->q_time, cbk->g->al_addr, 0);
cbk->g->al_query = 0;
free(cbk);
@@ -1858,5 +1440,5 @@ SetQueryTimer(g, vifi, to_expire, q_time)
cbk->g = g;
cbk->q_time = q_time;
cbk->vifi = vifi;
- return timer_setTimer(to_expire, SendQuery, cbk);
+ return timer_setTimer(to_expire, (cfunc_t)SendQuery, (void *)cbk);
}
diff --git a/usr.sbin/mrouted/vif.h b/usr.sbin/mrouted/vif.h
index 52062a7eaff5..e0ed7ecab1ec 100644
--- a/usr.sbin/mrouted/vif.h
+++ b/usr.sbin/mrouted/vif.h
@@ -7,92 +7,9 @@
* Leland Stanford Junior University.
*
*
- * $Id: vif.h,v 1.8 1997/02/22 16:07:09 peter Exp $
- * vif.h,v 3.8.4.26 1998/01/14 21:21:19 fenner Exp
+ * $Id$
*/
-
-/*
- * Bitmap handling functions.
- * These should be fast but generic. bytes can be slow to zero and compare,
- * words are hard to make generic. Thus two sets of macros (yuk).
- */
-
-/*
- * The VIFM_ functions should migrate out of <netinet/ip_mroute.h>, since
- * the kernel no longer uses vifbitmaps.
- */
-#ifndef VIFM_SET
-typedef u_long vifbitmap_t;
-
-#define VIFM_SET(n, m) ((m) |= (1 << (n)))
-#define VIFM_CLR(n, m) ((m) &= ~(1 << (n)))
-#define VIFM_ISSET(n, m) ((m) & (1 << (n)))
-#define VIFM_CLRALL(m) ((m) = 0x00000000)
-#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom))
-#define VIFM_SAME(m1, m2) ((m1) == (m2))
-#endif
-/*
- * And <netinet/ip_mroute.h> was missing some required functions anyway
- */
-#ifndef VIFM_SETALL
-#define VIFM_SETALL(m) ((m) = ~0)
-#endif
-#define VIFM_ISSET_ONLY(n, m) ((m) == (1 << (n)))
-#define VIFM_ISEMPTY(m) ((m) == 0)
-#define VIFM_CLR_MASK(m, mask) ((m) &= ~(mask))
-#define VIFM_SET_MASK(m, mask) ((m) |= (mask))
-
-/*
- * Neighbor bitmaps are, for efficiency, implemented as a struct
- * containing two variables of a native machine type. If you
- * have a native type that's bigger than a long, define it below.
- */
-#define NBRTYPE u_long
-#define NBRBITS sizeof(NBRTYPE) * 8
-
-typedef struct {
- NBRTYPE hi;
- NBRTYPE lo;
-} nbrbitmap_t;
-#define MAXNBRS 2 * NBRBITS
-#define NO_NBR MAXNBRS
-
-#define NBRM_SET(n, m) (((n) < NBRBITS) ? ((m).lo |= (1 << (n))) : \
- ((m).hi |= (1 << (n - NBRBITS))))
-#define NBRM_CLR(n, m) (((n) < NBRBITS) ? ((m).lo &= ~(1 << (n))) : \
- ((m).hi &= ~(1 << (n - NBRBITS))))
-#define NBRM_ISSET(n, m) (((n) < NBRBITS) ? ((m).lo & (1 << (n))) : \
- ((m).hi & (1 << ((n) - NBRBITS))))
-#define NBRM_CLRALL(m) ((m).lo = (m).hi = 0)
-#define NBRM_COPY(mfrom, mto) ((mto).lo = (mfrom).lo, (mto).hi = (mfrom).hi)
-#define NBRM_SAME(m1, m2) (((m1).lo == (m2).lo) && ((m1).hi == (m2).hi))
-#define NBRM_ISEMPTY(m) (((m).lo == 0) && ((m).hi == 0))
-#define NBRM_SETMASK(m, mask) (((m).lo |= (mask).lo),((m).hi |= (mask).hi))
-#define NBRM_CLRMASK(m, mask) (((m).lo &= ~(mask).lo),((m).hi &= ~(mask).hi))
-#define NBRM_MASK(m, mask) (((m).lo &= (mask).lo),((m).hi &= (mask).hi))
-#define NBRM_ISSETMASK(m, mask) (((m).lo & (mask).lo) || ((m).hi & (mask).hi))
-#define NBRM_ISSETALLMASK(m, mask)\
- ((((m).lo & (mask).lo) == (mask).lo) && \
- (((m).hi & (mask).hi) == (mask).hi))
-/*
- * This macro is TRUE if all the subordinates have been pruned, or if
- * there are no subordinates on this vif.
- * The arguments is the map of subordinates, the map of neighbors on the
- * vif, and the map of received prunes.
- */
-#define SUBS_ARE_PRUNED(sub, vifmask, prunes) \
- (((sub).lo & (vifmask).lo) == ((prunes).lo & (vifmask).lo & (sub).lo) && \
- ((sub).hi & (vifmask).hi) == ((prunes).hi & (vifmask).hi & (sub).hi))
-
-struct blastinfo {
- char * bi_buf; /* Pointer to malloced storage */
- char * bi_cur; /* The update to process next */
- char * bi_end; /* The place to put the next update */
- int bi_len; /* Size of malloced storage */
- int bi_timer; /* Timer to run process_blaster_report */
-};
-
/*
* User level Virtual Interface structure
*
@@ -101,62 +18,31 @@ struct blastinfo {
* (Note: all addresses, subnet numbers and masks are kept in NETWORK order.)
*/
struct uvif {
- u_int uv_flags; /* VIFF_ flags defined below */
+ u_short uv_flags; /* VIFF_ flags defined below */
u_char uv_metric; /* cost of this vif */
u_char uv_admetric; /* advertised cost of this vif */
- u_char uv_threshold; /* min ttl required to forward on vif */
u_int uv_rate_limit; /* rate limit on this vif */
+ u_char uv_threshold; /* min ttl required to forward on vif */
u_int32 uv_lcl_addr; /* local address of this vif */
u_int32 uv_rmt_addr; /* remote end-point addr (tunnels only) */
- u_int32 uv_dst_addr; /* destination for DVMRP messages */
u_int32 uv_subnet; /* subnet number (phyints only) */
u_int32 uv_subnetmask; /* subnet mask (phyints only) */
u_int32 uv_subnetbcast;/* subnet broadcast addr (phyints only) */
char uv_name[IFNAMSIZ]; /* interface name */
struct listaddr *uv_groups; /* list of local groups (phyints only) */
struct listaddr *uv_neighbors; /* list of neighboring routers */
- nbrbitmap_t uv_nbrmap; /* bitmap of active neighboring routers */
- struct listaddr *uv_querier; /* IGMP querier on vif */
- int uv_igmpv1_warn;/* To rate-limit IGMPv1 warnings */
- int uv_prune_lifetime; /* Prune lifetime or 0 for default */
struct vif_acl *uv_acl; /* access control list of groups */
int uv_leaf_timer; /* time until this vif is considrd leaf */
struct phaddr *uv_addrs; /* Additional subnets on this vif */
- struct vif_filter *uv_filter; /* Route filters on this vif */
- struct blastinfo uv_blaster; /* Info about route blasters */
- int uv_nbrup; /* Counter for neighbor up events */
- int uv_icmp_warn; /* To rate-limit ICMP warnings */
- u_int uv_nroutes; /* # of routes with this vif as parent */
- struct ip *uv_encap_hdr; /* Pre-formed header to encapsulate msgs*/
};
-#define uv_blasterbuf uv_blaster.bi_buf
-#define uv_blastercur uv_blaster.bi_cur
-#define uv_blasterend uv_blaster.bi_end
-#define uv_blasterlen uv_blaster.bi_len
-#define uv_blastertimer uv_blaster.bi_timer
-
#define VIFF_KERNEL_FLAGS (VIFF_TUNNEL|VIFF_SRCRT)
-#define VIFF_DOWN 0x000100 /* kernel state of interface */
-#define VIFF_DISABLED 0x000200 /* administratively disabled */
-#define VIFF_QUERIER 0x000400 /* I am the subnet's querier */
-#define VIFF_ONEWAY 0x000800 /* Maybe one way interface */
-#define VIFF_LEAF 0x001000 /* all neighbors are leaves */
-#define VIFF_IGMPV1 0x002000 /* Act as an IGMPv1 Router */
-#define VIFF_REXMIT_PRUNES 0x004000 /* retransmit prunes */
-#define VIFF_PASSIVE 0x008000 /* passive tunnel */
-#define VIFF_ALLOW_NONPRUNERS 0x010000 /* ok to peer with nonprunrs */
-#define VIFF_NOFLOOD 0x020000 /* don't flood on this vif */
-#define VIFF_NOTRANSIT 0x040000 /* don't transit these vifs */
-#define VIFF_BLASTER 0x080000 /* nbr on vif blasts routes */
-#define VIFF_FORCE_LEAF 0x100000 /* ignore nbrs on this vif */
-#define VIFF_OTUNNEL 0x200000 /* DVMRP msgs "beside" tunnel*/
-
-#define AVOID_TRANSIT(v, r) \
- (((r)->rt_parent != NO_VIF) && \
- ((r)->rt_gateway != 0) && \
- (uvifs[(v)].uv_flags & VIFF_NOTRANSIT) && \
- (uvifs[(r)->rt_parent].uv_flags & VIFF_NOTRANSIT))
+#define VIFF_DOWN 0x0100 /* kernel state of interface */
+#define VIFF_DISABLED 0x0200 /* administratively disabled */
+#define VIFF_QUERIER 0x0400 /* I am the subnet's querier */
+#define VIFF_ONEWAY 0x0800 /* Maybe one way interface */
+#define VIFF_LEAF 0x1000 /* all neighbors are leaves */
+#define VIFF_IGMPV1 0x2000 /* Act as an IGMPv1 Router */
struct phaddr {
struct phaddr *pa_next;
@@ -171,67 +57,23 @@ struct vif_acl {
u_int32 acl_mask; /* Group addr. mask */
};
-struct vif_filter {
- int vf_type;
-#define VFT_ACCEPT 1
-#define VFT_DENY 2
- int vf_flags;
-#define VFF_BIDIR 1
- struct vf_element *vf_filter;
-};
-
-struct vf_element {
- struct vf_element *vfe_next;
- u_int32 vfe_addr;
- u_int32 vfe_mask;
- int vfe_flags;
-#define VFEF_EXACT 0x0001
-};
-
struct listaddr {
struct listaddr *al_next; /* link to next addr, MUST BE FIRST */
u_int32 al_addr; /* local group or neighbor address */
u_long al_timer; /* for timing out group or neighbor */
- time_t al_ctime; /* entry creation time */
- union {
- struct {
- u_int32 alur_genid; /* generation id for neighbor */
- u_int alur_nroutes; /* # of routes w/ nbr as parent */
- u_char alur_pv; /* router protocol version */
- u_char alur_mv; /* router mrouted version */
- u_char alur_index; /* neighbor index */
- } alu_router;
- struct {
- u_int32 alug_reporter; /* a host which reported membership */
- u_long alug_timerid; /* timer for group membership */
- u_long alug_query; /* timer for repeated leave query */
- u_char alug_old; /* time since heard old report */
- } alu_group;
- } al_alu;
- u_short al_flags; /* flags related to this neighbor */
+ time_t al_ctime; /* neighbor creation time */
+ u_int32 al_genid; /* generation id for neighbor */
+ u_char al_pv; /* router protocol version */
+ u_char al_mv; /* router mrouted version */
+ u_long al_timerid; /* returned by set timer */
+ u_long al_query; /* second query in case of leave */
+ u_short al_old; /* time since heard old report */
+ u_char al_flags; /* flags related to this neighbor */
};
-#define al_genid al_alu.alu_router.alur_genid
-#define al_nroutes al_alu.alu_router.alur_nroutes
-#define al_pv al_alu.alu_router.alur_pv
-#define al_mv al_alu.alu_router.alur_mv
-#define al_index al_alu.alu_router.alur_index
-#define al_reporter al_alu.alu_group.alug_reporter
-#define al_old al_alu.alu_group.alug_old
-#define al_timerid al_alu.alu_group.alug_timerid
-#define al_query al_alu.alu_group.alug_query
-#define NBRF_LEAF 0x0001 /* This neighbor is a leaf */
-#define NBRF_GENID 0x0100 /* I know this neighbor's genid */
-#define NBRF_WAITING 0x0200 /* Waiting for peering to come up */
-#define NBRF_ONEWAY 0x0400 /* One-way peering */
-#define NBRF_TOOOLD 0x0800 /* Too old (policy decision) */
-#define NBRF_TOOMANYROUTES 0x1000 /* Neighbor is spouting routes */
-#define NBRF_NOTPRUNING 0x2000 /* Neighbor doesn't appear to prune */
-
-/*
- * Don't peer with neighbors with any of these flags set
- */
-#define NBRF_DONTPEER (NBRF_WAITING|NBRF_ONEWAY|NBRF_TOOOLD| \
- NBRF_TOOMANYROUTES|NBRF_NOTPRUNING)
+#define NF_LEAF 0x01 /* This neighbor is a leaf */
+#define NF_PRUNE 0x02 /* This neighbor understands prunes */
+#define NF_GENID 0x04 /* I supply genid & rtrlist in probe*/
+#define NF_MTRACE 0x08 /* I can understand mtrace requests */
#define NO_VIF ((vifi_t)MAXVIFS) /* An invalid vif index */
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index 47a5e398fef6..af9f50467db9 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: create.c,v 1.12 1999/01/12 02:58:23 jkoshy Exp $";
+ "$Id: create.c,v 1.10 1998/06/05 14:43:39 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,7 +52,6 @@ static const char rcsid[] =
#include <stdio.h>
#include <time.h>
#include <unistd.h>
-#include <vis.h>
#include "mtree.h"
#include "extern.h"
@@ -139,19 +138,11 @@ statf(indent, p)
struct passwd *pw;
u_long len, val;
int fd, offset;
- char *escaped_name;
-
- escaped_name = calloc(1, p->fts_namelen * 4 + 1);
- if (escaped_name == NULL)
- errx(1, "statf(): calloc() failed");
- strvis(escaped_name, p->fts_name, VIS_WHITE | VIS_OCTAL);
if (iflag || S_ISDIR(p->fts_statp->st_mode))
- offset = printf("%*s%s", indent, "", escaped_name);
+ offset = printf("%*s%s", indent, "", p->fts_name);
else
- offset = printf("%*s %s", indent, "", escaped_name);
-
- free(escaped_name);
+ offset = printf("%*s %s", indent, "", p->fts_name);
if (offset > (INDENTNAMELEN + indent))
offset = MAXLINELEN;
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c
index 1e9c5fd47e89..77f54b199334 100644
--- a/usr.sbin/mtree/spec.c
+++ b/usr.sbin/mtree/spec.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: spec.c,v 1.8 1998/12/16 04:54:08 imp Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -49,7 +49,6 @@ static const char rcsid[] =
#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
-#include <vis.h>
#include "mtree.h"
#include "extern.h"
@@ -144,14 +143,10 @@ noparent: errx(1, "line %d: no parent node", lineno);
if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
errx(1, "calloc");
*centry = ginfo;
+ (void)strcpy(centry->name, p);
#define MAGIC "?*["
if (strpbrk(p, MAGIC))
centry->flags |= F_MAGIC;
- if (strunvis(centry->name, p) == -1) {
- warnx("filename %s is ill-encoded and literally used",
- p);
- strcpy(centry->name, p);
- }
set(NULL, centry);
if (!root) {
@@ -217,7 +212,6 @@ set(t, ip)
errx(1, "line %d: invalid file mode %s",
lineno, val);
ip->st_mode = getmode(m, 0);
- free(m);
break;
case F_NLINK:
ip->st_nlink = strtoul(val, &ep, 10);
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index faae982740c4..b25c3fe8ed62 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -27,7 +27,7 @@ provided "as is" without express or implied warranty.
#ifndef lint
static const char rcsid[] =
- "$Id: newsyslog.c,v 1.20 1998/06/09 18:24:04 ache Exp $";
+ "$Id: newsyslog.c,v 1.19 1998/05/10 21:13:29 hoek Exp $";
#endif /* not lint */
#ifndef CONF
@@ -94,7 +94,7 @@ int force = 0; /* Force the trim no matter what*/
char *conf = CONF; /* Configuration file to use */
time_t timenow;
#define MIN_PID 5
-#define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */
+#define MAX_PID 30000 /* was 65534, see /usr/include/sys/proc.h */
char hostname[MAXHOSTNAMELEN+1]; /* hostname */
char *daytime; /* timenow in human readable form */
diff --git a/usr.sbin/pccard/Makefile b/usr.sbin/pccard/Makefile
index 7b8a0a6b25c4..ad64ec144f6e 100644
--- a/usr.sbin/pccard/Makefile
+++ b/usr.sbin/pccard/Makefile
@@ -1,6 +1,6 @@
#
-# Makefile for pccardc/pccardd.
-# $Id: Makefile,v 1.3 1997/02/22 16:08:32 peter Exp $
+# Makefile for xntpd.
+# $Id$
#
SUBDIR= pccardc pccardd
diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c
index ed4f6d2b54ef..377ba0fc9af9 100644
--- a/usr.sbin/pccard/pccardd/cardd.c
+++ b/usr.sbin/pccard/pccardd/cardd.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: cardd.c,v 1.32 1998/04/20 16:24:03 nate Exp $";
+ "$Id: cardd.c,v 1.31 1998/04/20 15:24:28 nate Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -279,14 +279,11 @@ assign_driver(struct card *cp)
for (conf = cp->config; conf; conf = conf->next)
if (conf->inuse == 0 && conf->driver->card == cp &&
- conf->driver->config == conf &&
- conf->driver->inuse == 0) {
+ conf->driver->config == conf) {
#ifdef DEBUG
logmsg("Found existing driver (%s) for %s\n",
conf->driver->name, cp->manuf);
#endif
- conf->driver->inuse = 1;
- conf->inuse = 1;
return (conf);
}
/*
diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8
index 97ea040c5435..a7d6ac4a8848 100644
--- a/usr.sbin/pciconf/pciconf.8
+++ b/usr.sbin/pciconf/pciconf.8
@@ -1,4 +1,4 @@
-.\" $Id: pciconf.8,v 1.3 1997/10/06 11:38:29 charnier Exp $
+.\" $Id: pciconf.8,v 1.2 1997/02/22 16:09:06 peter Exp $
.\" Copyright (c) 1997
.\" Stefan Esser <se@freebsd.org>. All rights reserved.
.\"
@@ -50,22 +50,14 @@ With the
.Fl l
option, it lists all devices found by the boot probe in the following format:
.Bd -literal
-foo0@pci0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 hdr=0x00
-bar0@pci0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 hdr=0x00
-none0@pci0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 hdr=0x00
+pci0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 hdr=0x00
+pci0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 hdr=0x00
+pci0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 hdr=0x00
.Ed
.Pp
The first column gives the
-device name, unit number, and
-.Ar selector .
-If there is no device configured in the kernel for the
-.Tn PCI
-device in question, the device name will be
-.Dq none .
-Unit numbers for unconfigured devices start at zero and are incremented for
-each unconfigured device that is encountered. The
.Ar selector
-is in a form which may directly be used for the other forms of the command.
+in a form which may directly be used for the other forms of the command.
The second column is the class code, with the class byte printed as two
hex digits, followed by the sub-class and the interface bytes.
The third column gives the contents of the subvendorid register, introduced
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 1d7954d3fb33..2f2979a2d959 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -29,7 +29,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pciconf.c,v 1.6 1998/09/15 08:21:13 gibbs Exp $";
+ "$Id: pciconf.c,v 1.5 1997/10/06 11:38:30 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -134,7 +134,6 @@ list_devs(void)
int fd;
struct pci_conf_io pc;
struct pci_conf conf[255], *p;
- int none_count = 0;
fd = open(_PATH_DEVPCI, O_RDWR, 0);
if (fd < 0)
@@ -168,13 +167,12 @@ list_devs(void)
return;
}
for (p = conf; p < &conf[pc.num_matches]; p++) {
+ if ((p->pd_name == NULL) || (*p->pd_name == '\0'))
+ continue;
printf("%s%d@pci%d:%d:%d:\tclass=0x%06x card=0x%08lx "
"chip=0x%08lx rev=0x%02x hdr=0x%02x\n",
- (p->pd_name && *p->pd_name) ? p->pd_name :
- "none",
- (p->pd_name && *p->pd_name) ? p->pd_unit :
- none_count++,
+ p->pd_name, p->pd_unit,
p->pc_sel.pc_bus, p->pc_sel.pc_dev,
p->pc_sel.pc_func, (p->pc_class << 16) |
(p->pc_subclass << 8) | p->pc_progif,
diff --git a/usr.sbin/pcvt/Makefile.inc b/usr.sbin/pcvt/Makefile.inc
index 8ed98292cc24..7d4e4f302280 100644
--- a/usr.sbin/pcvt/Makefile.inc
+++ b/usr.sbin/pcvt/Makefile.inc
@@ -1,4 +1,4 @@
-# $Id: Makefile.inc,v 1.4 1998/05/31 11:41:53 bde Exp $
+# $Id$
FONTDIR = /usr/share/misc/pcvtfonts
diff --git a/usr.sbin/pcvt/Misc/Etc/Makefile b/usr.sbin/pcvt/Misc/Etc/Makefile
index 914d39ab51e7..9e95ba76d13e 100644
--- a/usr.sbin/pcvt/Misc/Etc/Makefile
+++ b/usr.sbin/pcvt/Misc/Etc/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 1998/03/16 11:46:09 bde Exp $
+# $Id$
FILES= Termcap Terminfo pcvt.el rc.local uemacs.tar.Z.uu xmodmap-german
diff --git a/usr.sbin/pcvt/fonts/Makefile b/usr.sbin/pcvt/fonts/Makefile
index 59ed20b6857a..7a5946ad3fa5 100644
--- a/usr.sbin/pcvt/fonts/Makefile
+++ b/usr.sbin/pcvt/fonts/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.7 1997/12/20 00:40:05 bde Exp $
+# $Id$
.SUFFIXES: .uu
.uu:
diff --git a/usr.sbin/pcvt/kbdio/kbdio.y b/usr.sbin/pcvt/kbdio/kbdio.y
index 8f825f1eec8f..5a8115768694 100644
--- a/usr.sbin/pcvt/kbdio/kbdio.y
+++ b/usr.sbin/pcvt/kbdio/kbdio.y
@@ -34,15 +34,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/Attic/kbdio.y,v 1.2 1995/04/01 17:16:26 joerg Exp $"
+#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/kbdio.y,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
/*
* $Log: kbdio.y,v $
- * Revision 1.2 1995/04/01 17:16:26 joerg
- * Update pcvt to 3.20b23
- *
- * Submitted by: Hellmuth Michaelis <hm@altona.hamburg.com>
- *
* Revision 1.1.1.1 1995/02/05 13:49:24 jkh
* PCVT userland utilities.
* Submitted by: hm
diff --git a/usr.sbin/pcvt/kbdio/lex.l b/usr.sbin/pcvt/kbdio/lex.l
index b7592fe054cc..a829dd2dd96b 100644
--- a/usr.sbin/pcvt/kbdio/lex.l
+++ b/usr.sbin/pcvt/kbdio/lex.l
@@ -33,15 +33,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/Attic/lex.l,v 1.2 1995/04/01 17:16:27 joerg Exp $"
+#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/kbdio/lex.l,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
/*
* $Log: lex.l,v $
- * Revision 1.2 1995/04/01 17:16:27 joerg
- * Update pcvt to 3.20b23
- *
- * Submitted by: Hellmuth Michaelis <hm@altona.hamburg.com>
- *
* Revision 1.1.1.1 1995/02/05 13:49:24 jkh
* PCVT userland utilities.
* Submitted by: hm
diff --git a/usr.sbin/pcvt/keycap/man5/keycap.5 b/usr.sbin/pcvt/keycap/man5/keycap.5
index d15cd5bcc170..b3977208e769 100644
--- a/usr.sbin/pcvt/keycap/man5/keycap.5
+++ b/usr.sbin/pcvt/keycap/man5/keycap.5
@@ -34,7 +34,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)keycap.5, 3.00, Last Edit-Date: [Sun Jan 2 13:45:59 1994]
-.\" $Id: keycap.5,v 1.5 1997/02/22 16:09:10 peter Exp $
+.\" $Id$
.\"
.Dd January 3, 1993
.Dt KEYCAP 5
diff --git a/usr.sbin/pcvt/set2061/compiler.h b/usr.sbin/pcvt/set2061/compiler.h
index 4ff14bdfc324..9fbdb56c9159 100644
--- a/usr.sbin/pcvt/set2061/compiler.h
+++ b/usr.sbin/pcvt/set2061/compiler.h
@@ -20,7 +20,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
- * $Header: /home/ncvs/src/usr.sbin/pcvt/set2061/Attic/compiler.h,v 1.2 1995/05/30 03:49:45 rgrimes Exp $
+ * $Header: /home/ncvs/src/usr.sbin/pcvt/set2061/compiler.h,v 1.1.1.1 1995/02/05 13:49:25 jkh Exp $
*/
diff --git a/usr.sbin/pcvt/vgaio/Makefile b/usr.sbin/pcvt/vgaio/Makefile
index 9edd89669043..b49b7e8b9a95 100644
--- a/usr.sbin/pcvt/vgaio/Makefile
+++ b/usr.sbin/pcvt/vgaio/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 1998/05/06 15:23:53 bde Exp $
+# $Id$
.if !exists(${.CURDIR}/../Makefile.inc)
error:
diff --git a/usr.sbin/pcvt/vgaio/lex.l b/usr.sbin/pcvt/vgaio/lex.l
index 7fb6ef2adb9b..5ff8622df236 100644
--- a/usr.sbin/pcvt/vgaio/lex.l
+++ b/usr.sbin/pcvt/vgaio/lex.l
@@ -33,14 +33,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/vgaio/Attic/lex.l,v 1.1.1.1 1995/02/05 13:49:23 jkh Exp $"
+#ident "$Header: /b/source/CVS/src/sys/arch/i386/isa/pcvt/Util/vgaio/lex.l,v 1.1 1994/03/29 02:47:20 mycroft Exp $"
/*
* $Log: lex.l,v $
- * Revision 1.1.1.1 1995/02/05 13:49:23 jkh
- * PCVT userland utilities.
- * Submitted by: hm
- *
* Revision 1.1 1994/03/29 02:47:20 mycroft
* pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
*
diff --git a/usr.sbin/pcvt/vgaio/vgaio.8 b/usr.sbin/pcvt/vgaio/vgaio.8
index a7a4c0f1b25b..1b350a6af3e0 100644
--- a/usr.sbin/pcvt/vgaio/vgaio.8
+++ b/usr.sbin/pcvt/vgaio/vgaio.8
@@ -31,7 +31,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: vgaio.8,v 1.2 1998/03/23 08:26:31 charnier Exp $
+.\" $Id$
.\" -hm updated 31.12.94
.\"
.Dd December 31, 1994
diff --git a/usr.sbin/pcvt/vgaio/vgaio.h b/usr.sbin/pcvt/vgaio/vgaio.h
index 61b90641817f..e313f861aa1a 100644
--- a/usr.sbin/pcvt/vgaio/vgaio.h
+++ b/usr.sbin/pcvt/vgaio/vgaio.h
@@ -37,9 +37,6 @@
* The author may be reached unter <joerg_wunsch@uriah.sax.de>
*
* $Log: vgaio.h,v $
- * Revision 1.2 1995/03/05 22:46:27 joerg
- * Upgrade to beta 3.20/b22
- *
* Revision 1.1 1994/03/29 02:47:25 mycroft
* pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
*
diff --git a/usr.sbin/pcvt/vgaio/vgaio.y b/usr.sbin/pcvt/vgaio/vgaio.y
index ec169d81b9b1..0e7dd7924b4a 100644
--- a/usr.sbin/pcvt/vgaio/vgaio.y
+++ b/usr.sbin/pcvt/vgaio/vgaio.y
@@ -33,14 +33,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ident "$Header: /home/ncvs/src/usr.sbin/pcvt/vgaio/Attic/vgaio.y,v 1.1.1.1 1995/02/05 13:49:24 jkh Exp $"
+#ident "$Header: /b/source/CVS/src/sys/arch/i386/isa/pcvt/Util/vgaio/vgaio.y,v 1.1 1994/03/29 02:47:27 mycroft Exp $"
/*
* $Log: vgaio.y,v $
- * Revision 1.1.1.1 1995/02/05 13:49:24 jkh
- * PCVT userland utilities.
- * Submitted by: hm
- *
* Revision 1.1 1994/03/29 02:47:27 mycroft
* pcvt 3.0, with some performance enhancements by Joerg Wunsch and me.
*
diff --git a/usr.sbin/periodic/periodic.8 b/usr.sbin/periodic/periodic.8
index e5aab0cdc4b1..0ccb11bcf2f0 100644
--- a/usr.sbin/periodic/periodic.8
+++ b/usr.sbin/periodic/periodic.8
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: periodic.8,v 1.7 1998/03/23 08:26:50 charnier Exp $
+.\" $Id: periodic.8,v 1.6 1997/09/29 19:11:44 wosch Exp $
.\"
.Dd 13 August 1997
.Os FreeBSD 3.0
@@ -118,7 +118,7 @@ variable reading:
.Xr cron 8
.Rs
.Sh DIAGNOSTICS
-Exit status is 0 on success and 1 if the command
+Exit status is 0 on success, and 1 if the command
fails for one of the following reasons:
.Bl -diag
.It usage: periodic <directory of files to execute>
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh
index 08b3c70c6fc5..593d6c5ad8b4 100644
--- a/usr.sbin/periodic/periodic.sh
+++ b/usr.sbin/periodic/periodic.sh
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: periodic.sh,v 1.6 1998/12/29 22:48:54 hoek Exp $
+# $Id: periodic.sh,v 1.4 1997/08/16 17:08:35 pst Exp $
#
# Run nightly periodic scripts
#
@@ -48,7 +48,7 @@ else
dirlist="$*"
fi
-host=`hostname`
+host=`hostname -s`
echo "Subject: $host $run run output"
# Execute each executable file in the directory list. If the x bit is not
@@ -57,7 +57,7 @@ echo "Subject: $host $run run output"
for dir in $dirlist ; do
for file in $dir/* ; do
- if [ -x $file -a ! -d $file ] ; then
+ if [ -x $file ] ; then
$file
fi
done
diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c
index ac8d4bffbb9f..0522f2b9910d 100644
--- a/usr.sbin/pkg_install/add/extract.c
+++ b/usr.sbin/pkg_install/add/extract.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: extract.c,v 1.22 1998/10/12 20:01:48 jkh Exp $";
+ "$Id: extract.c,v 1.21 1998/09/11 07:26:54 jkh Exp $";
#endif
/*
@@ -34,7 +34,7 @@ static const char rcsid[] =
#define PUSHOUT(todir) /* push out string */ \
if (where_count > sizeof(STARTSTRING)-1) { \
- strcat(where_args, "|tar --unlink -xf - -C "); \
+ strcat(where_args, "|tar xf - -C "); \
strcat(where_args, todir); \
if (system(where_args)) { \
cleanup(0); \
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c
index f64ca526d2dc..4e4fab296bdf 100644
--- a/usr.sbin/pkg_install/add/main.c
+++ b/usr.sbin/pkg_install/add/main.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.19 1999/01/17 01:22:54 billf Exp $";
+ "$Id: main.c,v 1.17 1998/09/08 10:42:19 jkh Exp $";
#endif
/*
@@ -26,16 +26,14 @@ static const char rcsid[] =
#include <err.h>
#include <sys/param.h>
-#include <objformat.h>
#include "lib.h"
#include "add.h"
-static char Options[] = "hvIRfnrp:SMt:";
+static char Options[] = "hvIRfnp:SMt:";
char *Prefix = NULL;
Boolean NoInstall = FALSE;
Boolean NoRecord = FALSE;
-Boolean Remote = FALSE;
char *Mode = NULL;
char *Owner = NULL;
@@ -49,9 +47,6 @@ add_mode_t AddMode = NORMAL;
char pkgnames[MAX_PKGS][MAXPATHLEN];
char *pkgs[MAX_PKGS];
-static char *getpackagesite(char *);
-int getosreldate(void);
-
static void usage __P((void));
int
@@ -61,10 +56,6 @@ main(int argc, char **argv)
char **start;
char *cp;
- char *remotepkg = NULL, *ptr;
- static char binformat[1024];
- static char packageroot[MAXPATHLEN] = "ftp://ftp.FreeBSD.org/pub/FreeBSD/";
-
start = argv;
while ((ch = getopt(argc, argv, Options)) != -1) {
switch(ch) {
@@ -93,10 +84,6 @@ main(int argc, char **argv)
Verbose = TRUE;
break;
- case 'r':
- Remote = TRUE;
- break;
-
case 't':
strcpy(FirstPen, optarg);
break;
@@ -129,24 +116,10 @@ main(int argc, char **argv)
/* Get all the remaining package names, if any */
for (ch = 0; *argv; ch++, argv++) {
- if (Remote) {
- if (getenv("PACKAGESITE") == NULL) {
- getobjformat(binformat, sizeof(binformat), &argc, argv);
- strcat(packageroot, getpackagesite(binformat));
- }
- else
- strcpy(packageroot, (getenv("PACKAGESITE")));
- remotepkg = strcat(packageroot, *argv);
- if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' &&
- ptr[2] == 'g' && ptr[3] == 'z' && !ptr[4]))
- strcat(remotepkg, ".tgz");
- }
if (!strcmp(*argv, "-")) /* stdin? */
pkgs[ch] = "-";
else if (isURL(*argv)) /* preserve URLs */
pkgs[ch] = strcpy(pkgnames[ch], *argv);
- else if ((Remote) && isURL(remotepkg))
- pkgs[ch] = strcpy(pkgnames[ch], remotepkg);
else { /* expand all pathnames to fullnames */
if (fexists(*argv)) /* refers to a file directly */
pkgs[ch] = realpath(*argv, pkgnames[ch]);
@@ -183,30 +156,11 @@ main(int argc, char **argv)
return 0;
}
-static char *
-getpackagesite(char binform[1024])
-{
- int reldate;
-
- reldate = getosreldate();
-
- if (reldate == 300005)
- return "packages-3.0/Latest/";
- else if (30004 > reldate && reldate >= 300000)
- return "packages-current-aout/Latest/" ;
- else if (30004 < reldate)
- return !strcmp(binform, "elf") ? "packages-current/Latest/" :
- "packages-current-aout/Latest";
-
- return(0);
-
-}
-
static void
usage()
{
fprintf(stderr, "%s\n%s\n",
- "usage: pkg_add [-vInrfRMS] [-t template] [-p prefix]",
+ "usage: pkg_add [-vInfRMS] [-t template] [-p prefix]",
" pkg-name [pkg-name ...]");
exit(1);
}
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index 3b5df6112c4d..f7cd122c9991 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.53 1998/09/11 07:26:54 jkh Exp $";
+ "$Id: perform.c,v 1.52 1998/09/08 03:02:45 jkh Exp $";
#endif
/*
@@ -72,11 +72,6 @@ pkg_do(char *pkg)
PackingList p;
struct stat sb;
int inPlace;
- /* support for separate pre/post install scripts */
- int new_m = 0;
- char pre_script[FILENAME_MAX] = INSTALL_FNAME;
- char post_script[FILENAME_MAX];
- char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX];
code = 0;
zapLogDir = 0;
@@ -323,35 +318,17 @@ pkg_do(char *pkg)
}
}
- /* Test whether to use the old method of passing tokens to installation
- * scripts, and set appropriate variables..
- */
-
- if (fexists(POST_INSTALL_FNAME)) {
- new_m = 1;
- sprintf(post_script, "%s", POST_INSTALL_FNAME);
- sprintf(pre_arg, "");
- sprintf(post_arg, "");
- } else {
- if (fexists(INSTALL_FNAME)) {
- sprintf(post_script, "%s", INSTALL_FNAME);
- sprintf(pre_arg, "PRE-INSTALL");
- sprintf(post_arg, "POST-INSTALL");
- }
- }
-
/* If we're really installing, and have an installation file, run it */
- if (!NoInstall && fexists(pre_script)) {
- vsystem("chmod +x %s", pre_script); /* make sure */
+ if (!NoInstall && fexists(INSTALL_FNAME)) {
+ vsystem("chmod +x %s", INSTALL_FNAME); /* make sure */
if (Verbose)
- printf("Running pre-install for %s..\n", PkgName);
- if (!Fake && vsystem("./%s %s %s", pre_script, PkgName, pre_arg)) {
+ printf("Running install with PRE-INSTALL for %s..\n", PkgName);
+ if (!Fake && vsystem("./%s %s PRE-INSTALL", INSTALL_FNAME, PkgName)) {
warnx("install script returned error status");
- unlink(pre_script);
+ unlink(INSTALL_FNAME);
code = 1;
goto success; /* nothing to uninstall yet */
}
- if (new_m) unlink(pre_script);
}
/* Now finally extract the entire show if we're not going direct */
@@ -372,17 +349,16 @@ pkg_do(char *pkg)
}
/* Run the installation script one last time? */
- if (!NoInstall && fexists(post_script)) {
- vsystem("chmod +x %s", post_script); /* make sure */
+ if (!NoInstall && fexists(INSTALL_FNAME)) {
if (Verbose)
- printf("Running post-install for %s..\n", PkgName);
- if (!Fake && vsystem("./%s %s %s", post_script, PkgName, post_arg)) {
+ printf("Running install with POST-INSTALL for %s..\n", PkgName);
+ if (!Fake && vsystem("./%s %s POST-INSTALL", INSTALL_FNAME, PkgName)) {
warnx("install script returned error status");
- unlink(post_script);
+ unlink(INSTALL_FNAME);
code = 1;
goto fail;
}
- unlink(post_script);
+ unlink(INSTALL_FNAME);
}
/* Time to record the deed? */
@@ -413,8 +389,6 @@ pkg_do(char *pkg)
vsystem("chmod a+rx %s", LogDir);
if (fexists(DEINSTALL_FNAME))
move_file(".", DEINSTALL_FNAME, LogDir);
- if (fexists(POST_DEINSTALL_FNAME))
- move_file(".", POST_DEINSTALL_FNAME, LogDir);
if (fexists(REQUIRE_FNAME))
move_file(".", REQUIRE_FNAME, LogDir);
sprintf(contents, "%s/%s", LogDir, CONTENTS_FNAME);
diff --git a/usr.sbin/pkg_install/add/pkg_add.1 b/usr.sbin/pkg_install/add/pkg_add.1
index e4f2b6d11479..9740467f961e 100644
--- a/usr.sbin/pkg_install/add/pkg_add.1
+++ b/usr.sbin/pkg_install/add/pkg_add.1
@@ -15,7 +15,7 @@
.\"
.\"
.\" @(#)pkg_add.1
-.\" $Id: pkg_add.1,v 1.28 1999/01/17 01:22:55 billf Exp $
+.\" $Id$
.\"
.Dd November 25, 1994
.Dt pkg_add 1
@@ -25,7 +25,7 @@
.Nd a utility for installing software package distributions
.Sh SYNOPSIS
.Nm
-.Op Fl vInfrRMS
+.Op Fl vInfRMS
.Op Fl t Ar template
.Op Fl p Ar prefix
.Ar pkg-name [pkg-name ...]
@@ -48,10 +48,10 @@ attacks from miscreants who create dangerous package files.
You are advised to verify the competence and identity of those who
provide installable package files. For extra protection, use the
.Fl M
-flag to extract the package file, and inspect its contents and scripts to
-insure it poses no danger to your system's integrity. Pay particular
-attention to any +INSTALL, +POST-INSTALL, +DEINSTALL, +POST-DEINSTALL,
-+REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS file for
+flag to extract the package file, and inspect its contents and scripts
+to insure it poses no danger to your system's integrity. Pay particular
+attention to any +INSTALL, +DEINSTALL, +REQUIRE or +MTREE_DIRS files,
+and inspect the +CONTENTS file for
.Cm @cwd ,
.Cm @mode
(check for setuid),
@@ -78,8 +78,7 @@ will search them in each directory named by
.It Fl v
Turn on verbose output.
.It Fl I
-If a installation scripts (pre-install or post-install) exist for a given
-package, do not execute them.
+If an installation script exists for a given package, do not execute it.
.It Fl n
Don't actually install a package, just report the steps that
would be taken if it was.
@@ -87,9 +86,6 @@ would be taken if it was.
Do not record the installation of a package. This means
that you cannot deinstall it later, so only use this option if
you know what you are doing!
-.It Fl r
-Use the remote fetching feature. This will determine the appropriate
-objformat and release and then fetch and install the package.
.It Fl f
Force installation to proceed even if prerequisite packages are not
installed or the requirements script fails. Although
@@ -201,7 +197,7 @@ passive mode
.Ef
ftp.
.Sh TECHNICAL DETAILS
-.Nm pkg_add
+.Nm Pkg_add
is fairly simple. It extracts each package's "packing list"
into a special staging directory, parses it,
and then runs through the following sequence to fully extract the contents:
@@ -248,32 +244,18 @@ is the name of the package in question and the
keyword denotes this as an installation requirements check (useful if
you want to have one script serving multiple functions).
.It
-If a
-.Ar pre-install
-script exists for the package, it is then executed with the following
-arguments:
+If an
+.Ar install
+script exists for the package, it is then executed with the following arguments:
.Bd -filled -offset indent -compact
-.Cm script
.Ar pkg-name
-.Ar PRE-INSTALL
+.Ar PRE-INSTALL
.Ed
-
where
.Ar pkg-name
is the name of the package in question and
.Ar PRE-INSTALL
is a keyword denoting this as the preinstallation phase.
-
-.Cm Note:
-The
-.Ar PRE-INSTALL
-keyword will not appear if separate scripts for pre-install and post-install
-are given during package creation time (using the
-.Cm Fl i
-and
-.Cm Fl I
-flags to
-.Xr pkg_create 1 ).
.It
If
.Cm @option extract-in-place
@@ -307,39 +289,17 @@ flag was specified, the name of the first directory named by a
.Cm @cwd
directive within this package.
.It
-If a
-.Ar post-install
+If an
+.Ar install
script exists for the package, it is then executed as
.Bd -filled -offset indent -compact
.Cm script
.Ar pkg-name
.Ar POST-INSTALL
.Ed
-where
-.Ar pkg-name
-is the name of the package in question and
-.Ar POST-INSTALL
-is a keyword denoting this as the post-installation phase.
-
-.Cm Note:
-The
-.Ar POST-INSTALL
-keyword will not appear if separate scripts for pre-install and post-install
-are given during package creation time (using the
-.Cm Fl i
-and
-.Cm Fl I
-flags to
-.Xr pkg_create 1 ).
-
-Reasoning behind passing keywords such as
-.Ar POST-INSTALL
-and
-.Ar PRE-INSTALL
-is that this allows you to write a single
+This all allows you to write a single
.Ar install
-script that does both ``before and after'' actions. But, separating the
-functionality is more advantageous and easier from a maintainence viewpoint.
+script that does both ``before and after'' actions.
.It
After installation is complete, a copy of the packing list,
.Ar deinstall
@@ -396,17 +356,6 @@ will use the first of
or
.Pa /usr/tmp
with sufficient space.
-.Pp
-The environment variable
-.Ev PACKAGESITE
-specifies an alternate location for
-.Nm
-to fetch from. This variable subverts the automatic directory logic
-that
-.Nm
-uses when the
-.Fl r
-option is invoked.
.Sh FILES
.Bl -tag -width /var/db/pkg -compact
.It Pa /var/tmp
diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h
index 45b90b10ed17..eab822a371e9 100644
--- a/usr.sbin/pkg_install/create/create.h
+++ b/usr.sbin/pkg_install/create/create.h
@@ -1,4 +1,4 @@
-/* $Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp $ */
+/* $Id: create.h,v 1.12 1997/06/06 12:19:11 jkh Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -28,9 +28,7 @@ extern char *Comment;
extern char *Desc;
extern char *Display;
extern char *Install;
-extern char *PostInstall;
extern char *DeInstall;
-extern char *PostDeInstall;
extern char *Contents;
extern char *Require;
extern char *SrcDir;
diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c
index 55810c2b2531..38fff8a66b0f 100644
--- a/usr.sbin/pkg_install/create/main.c
+++ b/usr.sbin/pkg_install/create/main.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp $";
+ "$Id: main.c,v 1.16 1997/06/06 12:19:11 jkh Exp $";
#endif
/*
@@ -18,7 +18,7 @@ static const char rcsid[] =
#include "lib.h"
#include "create.h"
-static char Options[] = "YNOhvf:p:P:c:d:i:I:k:K:r:t:X:D:m:s:";
+static char Options[] = "YNOhvf:p:P:c:d:i:k:r:t:X:D:m:s:";
char *Prefix = NULL;
char *Comment = NULL;
@@ -26,9 +26,7 @@ char *Desc = NULL;
char *SrcDir = NULL;
char *Display = NULL;
char *Install = NULL;
-char *PostInstall = NULL;
char *DeInstall = NULL;
-char *PostDeInstall = NULL;
char *Contents = NULL;
char *Require = NULL;
char *ExcludeFrom = NULL;
@@ -89,18 +87,10 @@ main(int argc, char **argv)
Install = optarg;
break;
- case 'I':
- PostInstall = optarg;
- break;
-
case 'k':
DeInstall = optarg;
break;
- case 'K':
- PostDeInstall = optarg;
- break;
-
case 'r':
Require = optarg;
break;
@@ -161,11 +151,10 @@ main(int argc, char **argv)
static void
usage()
{
- fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
+ fprintf(stderr, "%s\n%s\n%s\n%s\n",
"usage: pkg_create [-YNOhv] [-P pkgs] [-p prefix] [-f contents] [-i iscript]",
-" [-I piscript] [-k dscript] [-K pdscript] [-r rscript] ",
-" [-t template] [-X excludefile] [-D displayfile] ",
-" [-m mtreefile] -c comment -d description -f packlist ",
-" pkg-name");
+" [-k dscript] [-r rscript] [-t template] [-X excludefile]",
+" [-D displayfile] [-m mtreefile] -c comment -d description",
+" -f packlist pkg-name");
exit(1);
}
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index 5e7443d9a396..6d13be57f7eb 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.46 1998/12/05 06:28:58 asami Exp $";
+ "$Id: perform.c,v 1.44 1998/09/08 10:42:24 jkh Exp $";
#endif
/*
@@ -45,8 +45,6 @@ pkg_perform(char **pkgs)
FILE *pkg_in, *fp;
Package plist;
int len;
- char *suf;
- int compress;
/* Preliminary setup */
sanity_check();
@@ -65,24 +63,10 @@ pkg_perform(char **pkgs)
}
plist.head = plist.tail = NULL;
- /* chop suffix off if already specified, remembering if we want to compress */
+ /* chop suffix off if already specified */
len = strlen(pkg);
- if (len > 4)
- if (!strcmp(&pkg[len - 4], ".tgz")) {
- compress = TRUE;
- pkg[len - 4] = '\0';
- }
- else if (!strcmp(&pkg[len - 4], ".tar")) {
- compress = FALSE;
- pkg[len - 4] = '\0';
- }
- else
- /* default is to compress packages */
- compress = TRUE;
- if (compress)
- suf = "tgz";
- else
- suf = "tar";
+ if (len > 4 && !strcmp(&pkg[len - 4], ".tgz"))
+ pkg[len - 4] = '\0';
/* Stick the dependencies, if any, at the top */
if (Pkgdeps) {
@@ -156,21 +140,11 @@ pkg_perform(char **pkgs)
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, INSTALL_FNAME);
}
- if (PostInstall) {
- copy_file(home, PostInstall, POST_INSTALL_FNAME);
- add_plist(&plist, PLIST_IGNORE, NULL);
- add_plist(&plist, PLIST_FILE, POST_INSTALL_FNAME);
- }
if (DeInstall) {
copy_file(home, DeInstall, DEINSTALL_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);
add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME);
}
- if (PostDeInstall) {
- copy_file(home, PostDeInstall, POST_DEINSTALL_FNAME);
- add_plist(&plist, PLIST_IGNORE, NULL);
- add_plist(&plist, PLIST_FILE, POST_DEINSTALL_FNAME);
- }
if (Require) {
copy_file(home, Require, REQUIRE_FNAME);
add_plist(&plist, PLIST_IGNORE, NULL);
@@ -202,7 +176,7 @@ pkg_perform(char **pkgs)
}
/* And stick it into a tar ball */
- make_dist(home, pkg, suf, &plist);
+ make_dist(home, pkg, "tgz", &plist);
/* Cleanup */
free(Comment);
@@ -280,12 +254,8 @@ make_dist(char *home, char *pkg, char *suffix, Package *plist)
if (Install)
fprintf(totar, "%s\n", INSTALL_FNAME);
- if (PostInstall)
- fprintf(totar, "%s\n", POST_INSTALL_FNAME);
if (DeInstall)
fprintf(totar, "%s\n", DEINSTALL_FNAME);
- if (PostDeInstall)
- fprintf(totar, "%s\n", POST_DEINSTALL_FNAME);
if (Require)
fprintf(totar, "%s\n", REQUIRE_FNAME);
if (Display)
diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1
index 8596261907b3..eaec8fb1143a 100644
--- a/usr.sbin/pkg_install/create/pkg_create.1
+++ b/usr.sbin/pkg_install/create/pkg_create.1
@@ -15,7 +15,7 @@
.\"
.\"
.\" @(#)pkg_create.1
-.\" $Id: pkg_create.1,v 1.26 1998/06/26 07:15:37 jkoshy Exp $
+.\" $Id: pkg_create.1,v 1.25 1998/05/24 03:11:17 steve Exp $
.\"
.\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords,
.\" added dependency tracking, etc.
@@ -36,9 +36,7 @@
.Op Fl p Ar prefix
.Op Fl f Ar contents
.Op Fl i Ar iscript
-.Op Fl I Ar piscript
.Op Fl k Ar dscript
-.Op Fl K Ar pdscript
.Op Fl r Ar rscript
.Op Fl s Ar srcdir
.Op Fl t Ar template
@@ -104,28 +102,9 @@ are dumped, rather than the links themselves.
.It Fl i Ar iscript
Set
.Ar iscript
-to be the pre-install procedure for the package. This can be any executable
-program (or shell script). It will be invoked automatically when the
-package is later installed. It will be passed the package's name as the
-first argument.
-
-.Cm Note:
-if the
-.Cm Fl I
-option is not given, this script will serve as both the pre-install and the
-post-install script for the package, differentiating between the
-functionality by passing the keywords
-.Ar PRE-INSTALL
-and
-.Ar POST-INSTALL
-respectively, along with the package's name.
-.It Fl I Ar piscript
-Set
-.Ar piscript
-to be the post-install procedure for the package. This can be any
+to be the install procedure for the package. This can be any
executable program (or shell script). It will be invoked automatically
-when the package is later installed. It will be passed the package's name as
-the first argument.
+when the package is later installed.
.It Fl P Ar pkgs
Set the initial package dependency list to
.Ar pkgs .
@@ -141,29 +120,9 @@ the package.
.It Fl k Ar dscript
Set
.Ar dscript
-to be the de-install procedure for the package. This can be any executable
-program (or shell script). It will be invoked automatically when the
-package is later (if ever) de-installed. It will be passed the package's
-name as the first argument.
-
-.Cm Note:
-if the
-.Cm Fl K
-option is not given, this script will serve as both the de-install and the
-post-deinstall script for the package, differentiating between the
-functionality by passing the keywords
-.Ar DEINSTALL
-and
-.Ar POST-DEINSTALL
-respectively, along with the package's name.
-.It Fl K Ar pdscript
-Set
-.Ar pdscript
-to be the post-deinstall procedure for the package. This can be any
-executable program (or shell script). It will be invoked automatically when
-the package is later de-installed. It will be passed the package's name as
-the first argument.
-
+to be the de-install procedure for the package. This can be any
+executable program (or shell script). It will be invoked automatically
+when the package is later (if ever) de-installed.
.It Fl r Ar rscript
Set
.Ar rscript
diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c
index dc85e02f341b..97b9528b5402 100644
--- a/usr.sbin/pkg_install/delete/perform.c
+++ b/usr.sbin/pkg_install/delete/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.17 1998/11/11 06:09:04 jkh Exp $";
+ "$Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp $";
#endif
/*
@@ -53,17 +53,6 @@ pkg_do(char *pkg)
char home[FILENAME_MAX];
PackingList p;
char *tmp;
- int len;
- /* support for separate pre/post install scripts */
- int new_m = 0;
- char pre_script[FILENAME_MAX] = DEINSTALL_FNAME;
- char post_script[FILENAME_MAX];
- char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX];
-
- if (!pkg || !(len = strlen(pkg)))
- return 1;
- if (pkg[len - 1] == '/')
- pkg[len - 1] = '\0';
/* Reset some state */
if (Plist.head)
@@ -71,22 +60,18 @@ pkg_do(char *pkg)
sprintf(LogDir, "%s/%s", (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR,
pkg);
-
if (!fexists(LogDir)) {
warnx("no such package '%s' installed", pkg);
return 1;
}
-
if (!getcwd(home, FILENAME_MAX)) {
cleanup(0);
errx(2, "unable to get current working directory!");
}
-
if (chdir(LogDir) == FAIL) {
warnx("unable to change directory to %s! deinstall failed", LogDir);
return 1;
}
-
if (!isemptyfile(REQUIRED_BY_FNAME)) {
char buf[512];
warnx("package `%s' is required by these other packages\n"
@@ -102,29 +87,23 @@ pkg_do(char *pkg)
if (!Force)
return 1;
}
-
sanity_check(LogDir);
cfile = fopen(CONTENTS_FNAME, "r");
-
if (!cfile) {
warnx("unable to open '%s' file", CONTENTS_FNAME);
return 1;
}
-
/* If we have a prefix, add it now */
if (Prefix)
add_plist(&Plist, PLIST_CWD, Prefix);
read_plist(&Plist, cfile);
fclose(cfile);
p = find_plist(&Plist, PLIST_CWD);
-
if (!p) {
warnx("package '%s' doesn't have a prefix", pkg);
return 1;
}
-
setenv(PKG_PREFIX_VNAME, p->name, 1);
-
if (fexists(REQUIRE_FNAME)) {
if (Verbose)
printf("Executing 'require' script.\n");
@@ -136,81 +115,34 @@ pkg_do(char *pkg)
return 1;
}
}
-
- /* Test whether to use the old method of passing tokens to deinstallation
- * scripts, and set appropriate variables..
- */
-
- if (fexists(POST_DEINSTALL_FNAME)) {
- new_m = 1;
- sprintf(post_script, "%s", POST_DEINSTALL_FNAME);
- sprintf(pre_arg, "");
- sprintf(post_arg, "");
- } else {
- if (fexists(DEINSTALL_FNAME)) {
- sprintf(post_script, "%s", DEINSTALL_FNAME);
- sprintf(pre_arg, "DEINSTALL");
- sprintf(post_arg, "POST-DEINSTALL");
- }
- }
-
- if (!NoDeInstall && fexists(pre_script)) {
+ if (!NoDeInstall && fexists(DEINSTALL_FNAME)) {
if (Fake)
printf("Would execute de-install script at this point.\n");
else {
- vsystem("chmod +x %s", pre_script); /* make sure */
- if (vsystem("./%s %s %s", pre_script, pkg, pre_arg)) {
+ vsystem("chmod +x %s", DEINSTALL_FNAME); /* make sure */
+ if (vsystem("./%s %s DEINSTALL", DEINSTALL_FNAME, pkg)) {
warnx("deinstall script returned error status");
if (!Force)
return 1;
}
}
}
-
if (chdir(home) == FAIL) {
cleanup(0);
errx(2, "Toto! This doesn't look like Kansas anymore!");
}
-
if (!Fake) {
/* Some packages aren't packed right, so we need to just ignore delete_package()'s status. Ugh! :-( */
if (delete_package(FALSE, CleanDirs, &Plist) == FAIL)
warnx(
"couldn't entirely delete package (perhaps the packing list is\n"
"incorrectly specified?)");
- }
-
- if (chdir(LogDir) == FAIL) {
- warnx("unable to change directory to %s! deinstall failed", LogDir);
- return 1;
- }
-
- if (!NoDeInstall && fexists(post_script)) {
- if (Fake)
- printf("Would execute post-deinstall script at this point.\n");
- else {
- vsystem("chmod +x %s", post_script); /* make sure */
- if (vsystem("./%s %s %s", post_script, pkg, post_arg)) {
- warnx("post-deinstall script returned error status");
- if (!Force)
- return 1;
- }
- }
- }
-
- if (chdir(home) == FAIL) {
- cleanup(0);
- errx(2, "Toto! This doesn't look like Kansas anymore!");
- }
-
- if (!Fake) {
if (vsystem("%s -r %s", REMOVE_CMD, LogDir)) {
warnx("couldn't remove log entry in %s, deinstall failed", LogDir);
if (!Force)
return 1;
}
}
-
for (p = Plist.head; p ; p = p->next) {
if (p->type != PLIST_PKGDEP)
continue;
diff --git a/usr.sbin/pkg_install/delete/pkg_delete.1 b/usr.sbin/pkg_install/delete/pkg_delete.1
index 9941afe1ce3d..31888e7338c9 100644
--- a/usr.sbin/pkg_install/delete/pkg_delete.1
+++ b/usr.sbin/pkg_install/delete/pkg_delete.1
@@ -47,9 +47,9 @@ You are advised to verify the competence and identity of those who
provide installable package files. For extra protection, examine all
the package control files in the package record directory (
.Pa /var/db/pkg/<pkg-name>/ ).
-Pay particular attention to any +INSTALL, +POST-INSTALL, +DEINSTALL,
-+POST-DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS
-file for
+Pay particular
+attention to any +INSTALL, +DEINSTALL, +REQUIRE or +MTREE_DIRS files,
+and inspect the +CONTENTS file for
.Cm @cwd ,
.Cm @mode
(check for setuid),
@@ -97,15 +97,10 @@ deinstall or require script fails.
.Pp
.Sh TECHNICAL DETAILS
-.Nm pkg_delete
+.Nm Pkg_delete
does pretty much what it says. It examines installed package records in
.Pa /var/db/pkg/<pkg-name> ,
deletes the package contents, and finally removes the package records.
-If the environment variable
-.Ev PKG_DBDIR
-is set, this overrides the
-.Pa /var/db/pkg/
-path shown above.
.Pp
If a package is required by other installed packages,
.Nm
@@ -145,71 +140,14 @@ The
.Nm deinstall
script is called as:
.Bd -filled -offset indent -compact
-.Cm script
+.Cm deinstall
.Ar <pkg-name>
.Ar DEINSTALL
.Ed
-where
-.Ar pkg-name
-is the name of the package in question and
-.Ar DEINSTALL
-is a keyword denoting this as the pre-deinstallation phase.
-
-.Cm Note:
-The
+Passing the keyword
.Ar DEINSTALL
-keyword will not appear if separate scripts for deinstall and post-deinstall
-are given during package creation time (using the
-.Cm Fl k
-and
-.Cm Fl K
-flags to
-.Xr pkg_create 1 ).
-.Pp
-If a
-.Cm post-deinstall
-script exists for the package, it is executed
-.Cm after
-all files are removed. It is this script's responsibility to clean up any
-additional messy details around the package's installation, and leave the
-system (hopefully) in the same state that it was prior to the installation
-of the package.
-
-The
-.Nm post-deinstall
-script is called as:
-.Bd -filled -offset indent -compact
-.Cm script
-.Ar <pkg-name>
-.Ar POST-DEINSTALL
-.Ed
-where
-.Ar pkg-name
-is the name of the package in question and
-.Ar POST-DEINSTALL
-is a keyword denoting this as the post-deinstallation phase.
-
-.Cm Note:
-The
-.Ar POST-DEINSTALL
-keyword will not appear if separate scripts for deinstall and post-deinstall
-are given during package creation time (using the
-.Cm Fl k
-and
-.Cm Fl K
-flags to
-.Xr pkg_create 1 ).
-
-Reasoning behind passing keywords such as
-.Ar DEINSTALL
-and
-.Ar POST-DEINSTALL
-is that it lets you potentially write only one program/script that handles
-all aspects of installation and deletion.
-
-But experience has proved that this is a lot more difficult to maintain and
-is not as advantageous as having separate scripts that handle each aspect of
-installation and deinstallation.
+lets you potentially write only one program/script that handles all
+aspects of installation and deletion.
.Pp
All scripts are called with the environment variable
.Ev PKG_PREFIX
@@ -223,14 +161,6 @@ option when running
.Nm
or
.Cm pkg_add .
-.Sh ENVIRONMENT
-The environment variable
-.Ev PKG_DBDIR
-specifies an alternative location for the installed package database.
-.Sh FILES
-.Bl -tag -width /var/db/pkg -compact
-.It Pa /var/db/pkg
-Default location of the installed package database.
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_create 1 ,
diff --git a/usr.sbin/pkg_install/info/perform.c b/usr.sbin/pkg_install/info/perform.c
index 84a3b9a5253f..c409fe744c1d 100644
--- a/usr.sbin/pkg_install/info/perform.c
+++ b/usr.sbin/pkg_install/info/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.25 1998/09/11 07:26:58 jkh Exp $";
+ "$Id: perform.c,v 1.24 1998/02/16 17:16:38 jkh Exp $";
#endif
/*
@@ -179,12 +179,8 @@ pkg_do(char *pkg)
show_plist("Packing list:\n", &plist, (plist_t)-1);
if ((Flags & SHOW_INSTALL) && fexists(INSTALL_FNAME))
show_file("Install script:\n", INSTALL_FNAME);
- if ((Flags & SHOW_INSTALL) && fexists(POST_INSTALL_FNAME))
- show_file("Post-Install script:\n", POST_INSTALL_FNAME);
if ((Flags & SHOW_DEINSTALL) && fexists(DEINSTALL_FNAME))
show_file("De-Install script:\n", DEINSTALL_FNAME);
- if ((Flags & SHOW_DEINSTALL) && fexists(POST_DEINSTALL_FNAME))
- show_file("Post-DeInstall script:\n", POST_DEINSTALL_FNAME);
if ((Flags & SHOW_MTREE) && fexists(MTREE_FNAME))
show_file("mtree file:\n", MTREE_FNAME);
if (Flags & SHOW_PREFIX)
diff --git a/usr.sbin/pkg_install/info/pkg_info.1 b/usr.sbin/pkg_install/info/pkg_info.1
index 9105cca41d6d..3c3f5c1228b3 100644
--- a/usr.sbin/pkg_install/info/pkg_info.1
+++ b/usr.sbin/pkg_install/info/pkg_info.1
@@ -15,7 +15,7 @@
.\"
.\"
.\" @(#)pkg_info.1
-.\" $Id: pkg_info.1,v 1.18 1998/07/14 08:28:15 jkoshy Exp $
+.\" $Id$
.\"
.Dd November 25, 1994
.Dt pkg_info 1
@@ -134,7 +134,7 @@ If this variable is not set,
is used. If both are unset, the builtin defaults are used.
.Pp
.Ev PKG_DBDIR
-specifies an alternative location for the installed package database.
+names the location of the installed package database.
.Sh FILES
.Bl -tag -width /var/db/pkg -compact
.It Pa /var/tmp
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 9aed73cf3999..c12b35ca03dd 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: file.c,v 1.34 1998/10/14 18:52:04 jkh Exp $";
+ "$Id: file.c,v 1.33 1998/10/09 00:01:16 jkh Exp $";
#endif
/*
@@ -487,8 +487,8 @@ unpack(char *pkg, char *flist)
}
}
else
- strcpy(args, "-z");
- strcat(args, " -xpf");
+ strcpy(args, "z");
+ strcat(args, "xpf");
if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) {
warnx("tar extract of %s failed!", pkg);
return 1;
diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h
index 595b2a1c2f7f..a0de2a459bc9 100644
--- a/usr.sbin/pkg_install/lib/lib.h
+++ b/usr.sbin/pkg_install/lib/lib.h
@@ -1,4 +1,4 @@
-/* $Id: lib.h,v 1.26 1998/02/16 17:16:47 jkh Exp $ */
+/* $Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -66,9 +66,7 @@
#define COMMENT_FNAME "+COMMENT"
#define DESC_FNAME "+DESC"
#define INSTALL_FNAME "+INSTALL"
-#define POST_INSTALL_FNAME "+POST-INSTALL"
#define DEINSTALL_FNAME "+DEINSTALL"
-#define POST_DEINSTALL_FNAME "+POST-DEINSTALL"
#define REQUIRE_FNAME "+REQUIRE"
#define REQUIRED_BY_FNAME "+REQUIRED_BY"
#define DISPLAY_FNAME "+DISPLAY"
diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile
index 696479e3af8c..d8e1f87eefac 100644
--- a/usr.sbin/ppp/Makefile
+++ b/usr.sbin/ppp/Makefile
@@ -1,8 +1,8 @@
-# $Id: Makefile,v 1.49 1998/10/20 00:19:38 brian Exp $
+# $Id: Makefile,v 1.47 1998/08/31 12:14:31 brian Exp $
PROG= ppp
SRCS= arp.c async.c auth.c bundle.c cbcp.c ccp.c chap.c chat.c command.c \
- datalink.c deflate.c defs.c filter.c fsm.c hdlc.c id.c iface.c ip.c \
+ datalink.c deflate.c defs.c filter.c fsm.c hdlc.c id.c ip.c \
ipcp.c iplist.c lcp.c link.c log.c lqr.c main.c mbuf.c modem.c \
mp.c pap.c physical.c pred.c probe.c prompt.c route.c server.c \
sig.c slcompress.c systems.c throughput.c timer.c tun.c vjcomp.c
@@ -10,7 +10,6 @@ CFLAGS+=-Wall
LDADD+= -lutil -lz
DPADD+= ${LIBUTIL} ${LIBZ}
BINMODE=4554
-BINOWN= root
BINGRP= network
MAN8= ppp.8
LDADD+= -lmd -lcrypt
diff --git a/usr.sbin/ppp/README.changes b/usr.sbin/ppp/README.changes
index b26cbd3882b1..3e4873e5a5f0 100644
--- a/usr.sbin/ppp/README.changes
+++ b/usr.sbin/ppp/README.changes
@@ -71,6 +71,3 @@ o Protocol-compressed packets are accepted even if they were denied
o Passwords aren't logged when logging the ``set server'' line.
o Command line options only need enough characters to uniquely identify
them. -a == -auto, -dd == -ddial etc. -interactive is also allowed.
-o If you don't like seeing additional interface aliases when running in
- -auto -alias mode, add ``iface clear'' to your ppp.linkdown file -
- check the sample file.
diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c
index 283d90943fba..b819c9aa5a4e 100644
--- a/usr.sbin/ppp/arp.c
+++ b/usr.sbin/ppp/arp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: arp.c,v 1.30 1998/08/26 17:39:36 brian Exp $
+ * $Id: arp.c,v 1.29 1998/06/16 19:40:34 brian Exp $
*
*/
@@ -87,8 +87,10 @@ static struct {
char extra[128];
} arpmsg;
-static int
-arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s)
+static int arpmsg_valid;
+
+int
+arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s)
{
int routes;
@@ -96,11 +98,9 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s)
* Get the hardware address of an interface on the same subnet as our local
* address.
*/
-
memset(&arpmsg, 0, sizeof arpmsg);
if (!get_ether_addr(s, addr, &arpmsg.hwa)) {
- log_Printf(LogWARN, "%s: Cannot determine ethernet address for proxy ARP\n",
- inet_ntoa(addr));
+ log_Printf(LogWARN, "Cannot determine ethernet address for proxy ARP\n");
return 0;
}
routes = ID0socket(PF_ROUTE, SOCK_RAW, AF_INET);
@@ -109,7 +109,7 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s)
strerror(errno));
return 0;
}
- arpmsg.hdr.rtm_type = add ? RTM_ADD : RTM_DELETE;
+ arpmsg.hdr.rtm_type = RTM_ADD;
arpmsg.hdr.rtm_flags = RTF_ANNOUNCE | RTF_HOST | RTF_STATIC;
arpmsg.hdr.rtm_version = RTM_VERSION;
arpmsg.hdr.rtm_seq = ++bundle->routing_seq;
@@ -122,34 +122,44 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s)
arpmsg.hdr.rtm_msglen = (char *) &arpmsg.hwa - (char *) &arpmsg
+ arpmsg.hwa.sdl_len;
-
-
- if (write(routes, &arpmsg, arpmsg.hdr.rtm_msglen) < 0 &&
- !(!add && errno == ESRCH)) {
- log_Printf(LogERROR, "%s proxy arp entry %s: %s\n",
- add ? "Add" : "Delete", inet_ntoa(addr), strerror(errno));
+ if (write(routes, &arpmsg, arpmsg.hdr.rtm_msglen) < 0) {
+ log_Printf(LogERROR, "Add proxy arp entry: %s\n", strerror(errno));
close(routes);
return 0;
}
close(routes);
+ arpmsg_valid = 1;
return 1;
}
-int
-arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s)
-{
-
- return (arp_ProxySub(bundle, addr, 1, s));
-}
-
/*
* arp_ClearProxy - Delete the proxy ARP entry for the peer.
*/
int
arp_ClearProxy(struct bundle *bundle, struct in_addr addr, int s)
{
+ int routes;
+
+ if (!arpmsg_valid)
+ return 0;
+ arpmsg_valid = 0;
+
+ arpmsg.hdr.rtm_type = RTM_DELETE;
+ arpmsg.hdr.rtm_seq = ++bundle->routing_seq;
- return (arp_ProxySub(bundle, addr, 0, s));
+ routes = ID0socket(PF_ROUTE, SOCK_RAW, AF_INET);
+ if (routes < 0) {
+ log_Printf(LogERROR, "arp_SetProxy: opening routing socket: %s\n",
+ strerror(errno));
+ return 0;
+ }
+ if (write(routes, &arpmsg, arpmsg.hdr.rtm_msglen) < 0) {
+ log_Printf(LogERROR, "Delete proxy arp entry: %s\n", strerror(errno));
+ close(routes);
+ return 0;
+ }
+ close(routes);
+ return 1;
}
#else /* RTM_VERSION */
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c
index 8d479843fabb..be406d024907 100644
--- a/usr.sbin/ppp/auth.c
+++ b/usr.sbin/ppp/auth.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: auth.c,v 1.33 1998/08/26 17:39:36 brian Exp $
+ * $Id: auth.c,v 1.32 1998/08/07 18:42:47 brian Exp $
*
* TODO:
* o Implement check against with registered IP addresses.
@@ -212,7 +212,7 @@ auth_GetSecret(struct bundle *bundle, const char *system, int len,
FILE *fp;
int n;
char *vector[5];
- static char buff[LINE_LEN];
+ char buff[LINE_LEN];
fp = OpenSecret(SECRETFILE);
if (fp == NULL)
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index 89388b951b6b..569d893f72dd 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bundle.c,v 1.42 1998/12/14 19:24:28 brian Exp $
+ * $Id: bundle.c,v 1.34 1998/08/26 17:39:36 brian Exp $
*/
#include <sys/param.h>
@@ -89,7 +89,6 @@
#include "cbcp.h"
#include "datalink.h"
#include "ip.h"
-#include "iface.h"
#define SCATTER_SEGMENTS 4 /* version, datalink, name, physical */
#define SOCKET_OVERHEAD 100 /* additional buffer space for large */
@@ -149,6 +148,49 @@ bundle_NewPhase(struct bundle *bundle, u_int new)
}
}
+static int
+bundle_CleanInterface(const struct bundle *bundle)
+{
+ int s;
+ struct ifreq ifrq;
+ struct ifaliasreq ifra;
+
+ s = ID0socket(AF_INET, SOCK_DGRAM, 0);
+ if (s < 0) {
+ log_Printf(LogERROR, "bundle_CleanInterface: socket(): %s\n",
+ strerror(errno));
+ return (-1);
+ }
+ strncpy(ifrq.ifr_name, bundle->ifp.Name, sizeof ifrq.ifr_name - 1);
+ ifrq.ifr_name[sizeof ifrq.ifr_name - 1] = '\0';
+ while (ID0ioctl(s, SIOCGIFADDR, &ifrq) == 0) {
+ memset(&ifra.ifra_mask, '\0', sizeof ifra.ifra_mask);
+ strncpy(ifra.ifra_name, bundle->ifp.Name, sizeof ifra.ifra_name - 1);
+ ifra.ifra_name[sizeof ifra.ifra_name - 1] = '\0';
+ ifra.ifra_addr = ifrq.ifr_addr;
+ if (ID0ioctl(s, SIOCGIFDSTADDR, &ifrq) < 0) {
+ if (ifra.ifra_addr.sa_family == AF_INET)
+ log_Printf(LogERROR, "Can't get dst for %s on %s !\n",
+ inet_ntoa(((struct sockaddr_in *)&ifra.ifra_addr)->sin_addr),
+ bundle->ifp.Name);
+ close(s);
+ return 0;
+ }
+ ifra.ifra_broadaddr = ifrq.ifr_dstaddr;
+ if (ID0ioctl(s, SIOCDIFADDR, &ifra) < 0) {
+ if (ifra.ifra_addr.sa_family == AF_INET)
+ log_Printf(LogERROR, "Can't delete %s address on %s !\n",
+ inet_ntoa(((struct sockaddr_in *)&ifra.ifra_addr)->sin_addr),
+ bundle->ifp.Name);
+ close(s);
+ return 0;
+ }
+ }
+ close(s);
+
+ return 1;
+}
+
static void
bundle_LayerStart(void *v, struct fsm *fp)
{
@@ -345,14 +387,14 @@ bundle_LayerUp(void *v, struct fsm *fp)
if (bundle->ncp.mp.active) {
struct datalink *dl;
- bundle->ifSpeed = 0;
+ bundle->ifp.Speed = 0;
for (dl = bundle->links; dl; dl = dl->next)
if (dl->state == DATALINK_OPEN)
- bundle->ifSpeed += modem_Speed(dl->physical);
+ bundle->ifp.Speed += modem_Speed(dl->physical);
tun_configure(bundle, bundle->ncp.mp.peer_mrru);
bundle->autoload.running = 1;
} else {
- bundle->ifSpeed = modem_Speed(p);
+ bundle->ifp.Speed = modem_Speed(p);
tun_configure(bundle, fsm2lcp(fp)->his_mru);
}
} else if (fp->proto == PROTO_IPCP) {
@@ -382,15 +424,15 @@ bundle_LayerDown(void *v, struct fsm *fp)
struct datalink *dl;
struct datalink *lost;
- bundle->ifSpeed = 0;
+ bundle->ifp.Speed = 0;
lost = NULL;
for (dl = bundle->links; dl; dl = dl->next)
if (fp == &dl->physical->link.lcp.fsm)
lost = dl;
else if (dl->state == DATALINK_OPEN)
- bundle->ifSpeed += modem_Speed(dl->physical);
+ bundle->ifp.Speed += modem_Speed(dl->physical);
- if (bundle->ifSpeed)
+ if (bundle->ifp.Speed)
/* Don't configure down to a speed of 0 */
tun_configure(bundle, bundle->ncp.mp.link.lcp.his_mru);
@@ -625,6 +667,12 @@ bundle_DescriptorRead(struct descriptor *d, struct bundle *bundle,
if (pri >= 0) {
struct mbuf *bp;
+#ifndef NOALIAS
+ if (bundle->AliasEnabled) {
+ PacketAliasIn(tun.data, sizeof tun.data);
+ n = ntohs(((struct ip *)tun.data)->ip_len);
+ }
+#endif
bp = mbuf_Alloc(n, MB_IPIN);
memcpy(MBUF_CTOP(bp), tun.data, n);
ip_Input(bundle, bp);
@@ -721,11 +769,10 @@ struct bundle *
bundle_Create(const char *prefix, int type, const char **argv)
{
int s, enoentcount, err;
- const char *ifname;
struct ifreq ifrq;
static struct bundle bundle; /* there can be only one */
- if (bundle.iface != NULL) { /* Already allocated ! */
+ if (bundle.ifp.Name != NULL) { /* Already allocated ! */
log_Printf(LogALERT, "bundle_Create: There's only one BUNDLE !\n");
return NULL;
}
@@ -756,8 +803,6 @@ bundle_Create(const char *prefix, int type, const char **argv)
log_SetTun(bundle.unit);
bundle.argv = argv;
- bundle.argv0 = argv[0];
- bundle.argv1 = argv[1];
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
@@ -766,32 +811,24 @@ bundle_Create(const char *prefix, int type, const char **argv)
return NULL;
}
- ifname = strrchr(bundle.dev.Name, '/');
- if (ifname == NULL)
- ifname = bundle.dev.Name;
+ bundle.ifp.Name = strrchr(bundle.dev.Name, '/');
+ if (bundle.ifp.Name == NULL)
+ bundle.ifp.Name = bundle.dev.Name;
else
- ifname++;
-
- bundle.iface = iface_Create(ifname);
- if (bundle.iface == NULL) {
- close(s);
- close(bundle.dev.fd);
- return NULL;
- }
+ bundle.ifp.Name++;
/*
* Now, bring up the interface.
*/
memset(&ifrq, '\0', sizeof ifrq);
- strncpy(ifrq.ifr_name, ifname, sizeof ifrq.ifr_name - 1);
+ strncpy(ifrq.ifr_name, bundle.ifp.Name, sizeof ifrq.ifr_name - 1);
ifrq.ifr_name[sizeof ifrq.ifr_name - 1] = '\0';
if (ID0ioctl(s, SIOCGIFFLAGS, &ifrq) < 0) {
log_Printf(LogERROR, "bundle_Create: ioctl(SIOCGIFFLAGS): %s\n",
strerror(errno));
close(s);
- iface_Destroy(bundle.iface);
- bundle.iface = NULL;
close(bundle.dev.fd);
+ bundle.ifp.Name = NULL;
return NULL;
}
ifrq.ifr_flags |= IFF_UP;
@@ -799,17 +836,22 @@ bundle_Create(const char *prefix, int type, const char **argv)
log_Printf(LogERROR, "bundle_Create: ioctl(SIOCSIFFLAGS): %s\n",
strerror(errno));
close(s);
- iface_Destroy(bundle.iface);
- bundle.iface = NULL;
close(bundle.dev.fd);
+ bundle.ifp.Name = NULL;
return NULL;
}
close(s);
- log_Printf(LogPHASE, "Using interface: %s\n", ifname);
+ if ((bundle.ifp.Index = GetIfIndex(bundle.ifp.Name)) < 0) {
+ log_Printf(LogERROR, "Can't find interface index.\n");
+ close(bundle.dev.fd);
+ bundle.ifp.Name = NULL;
+ return NULL;
+ }
+ log_Printf(LogPHASE, "Using interface: %s\n", bundle.ifp.Name);
- bundle.ifSpeed = 0;
+ bundle.ifp.Speed = 0;
bundle.routing_seq = 0;
bundle.phase = PHASE_DEAD;
@@ -840,9 +882,8 @@ bundle_Create(const char *prefix, int type, const char **argv)
bundle.links = datalink_Create("deflink", &bundle, type);
if (bundle.links == NULL) {
log_Printf(LogALERT, "Cannot create data link: %s\n", strerror(errno));
- iface_Destroy(bundle.iface);
- bundle.iface = NULL;
close(bundle.dev.fd);
+ bundle.ifp.Name = NULL;
return NULL;
}
@@ -876,7 +917,7 @@ bundle_Create(const char *prefix, int type, const char **argv)
memset(&bundle.choked.timer, '\0', sizeof bundle.choked.timer);
/* Clean out any leftover crud */
- iface_Clear(bundle.iface, IFACE_CLEAR_ALL);
+ bundle_CleanInterface(&bundle);
bundle_LockTun(&bundle);
@@ -898,7 +939,7 @@ bundle_DownInterface(struct bundle *bundle)
}
memset(&ifrq, '\0', sizeof ifrq);
- strncpy(ifrq.ifr_name, bundle->iface->name, sizeof ifrq.ifr_name - 1);
+ strncpy(ifrq.ifr_name, bundle->ifp.Name, sizeof ifrq.ifr_name - 1);
ifrq.ifr_name[sizeof ifrq.ifr_name - 1] = '\0';
if (ID0ioctl(s, SIOCGIFFLAGS, &ifrq) < 0) {
log_Printf(LogERROR, "bundle_DownInterface: ioctl(SIOCGIFFLAGS): %s\n",
@@ -944,8 +985,7 @@ bundle_Destroy(struct bundle *bundle)
/* In case we never made PHASE_NETWORK */
bundle_Notify(bundle, EX_ERRDEAD);
- iface_Destroy(bundle->iface);
- bundle->iface = NULL;
+ bundle->ifp.Name = NULL;
}
struct rtmsg {
@@ -981,17 +1021,6 @@ bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
rtmes.m_rtm.rtm_pid = getpid();
rtmes.m_rtm.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- if (cmd == RTM_ADD || cmd == RTM_CHANGE) {
- if (bundle->ncp.ipcp.cfg.sendpipe > 0) {
- rtmes.m_rtm.rtm_rmx.rmx_sendpipe = bundle->ncp.ipcp.cfg.sendpipe;
- rtmes.m_rtm.rtm_inits |= RTV_SPIPE;
- }
- if (bundle->ncp.ipcp.cfg.recvpipe > 0) {
- rtmes.m_rtm.rtm_rmx.rmx_recvpipe = bundle->ncp.ipcp.cfg.recvpipe;
- rtmes.m_rtm.rtm_inits |= RTV_RPIPE;
- }
- }
-
memset(&rtdata, '\0', sizeof rtdata);
rtdata.sin_len = sizeof rtdata;
rtdata.sin_family = AF_INET;
@@ -1003,11 +1032,24 @@ bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
cp += rtdata.sin_len;
if (cmd == RTM_ADD) {
if (gateway.s_addr == INADDR_ANY) {
- if (!ssh)
- log_Printf(LogERROR, "bundle_SetRoute: Cannot add a route with"
- " destination 0.0.0.0\n");
- close(s);
- return result;
+ /* Add a route through the interface */
+ struct sockaddr_dl dl;
+ const char *iname;
+ int ilen;
+
+ iname = Index2Nam(bundle->ifp.Index);
+ ilen = strlen(iname);
+ dl.sdl_len = sizeof dl - sizeof dl.sdl_data + ilen;
+ dl.sdl_family = AF_LINK;
+ dl.sdl_index = bundle->ifp.Index;
+ dl.sdl_type = 0;
+ dl.sdl_nlen = ilen;
+ dl.sdl_alen = 0;
+ dl.sdl_slen = 0;
+ strncpy(dl.sdl_data, iname, sizeof dl.sdl_data);
+ memcpy(cp, &dl, dl.sdl_len);
+ cp += dl.sdl_len;
+ rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
} else {
rtdata.sin_addr = gateway;
memcpy(cp, &rtdata, rtdata.sin_len);
@@ -1040,7 +1082,7 @@ failed:
(rtmes.m_rtm.rtm_errno == 0 && errno == EEXIST))) {
if (!bang) {
log_Printf(LogWARN, "Add route failed: %s already exists\n",
- dst.s_addr == 0 ? "default" : inet_ntoa(dst));
+ inet_ntoa(dst));
result = 0; /* Don't add to our dynamic list */
} else {
rtmes.m_rtm.rtm_type = cmd = RTM_CHANGE;
@@ -1197,10 +1239,9 @@ bundle_ShowStatus(struct cmdargs const *arg)
int remaining;
prompt_Printf(arg->prompt, "Phase %s\n", bundle_PhaseName(arg->bundle));
- prompt_Printf(arg->prompt, " Title: %s\n", arg->bundle->argv[0]);
prompt_Printf(arg->prompt, " Device: %s\n", arg->bundle->dev.Name);
prompt_Printf(arg->prompt, " Interface: %s @ %lubps\n",
- arg->bundle->iface->name, arg->bundle->ifSpeed);
+ arg->bundle->ifp.Name, arg->bundle->ifp.Speed);
prompt_Printf(arg->prompt, "\nDefaults:\n");
prompt_Printf(arg->prompt, " Label: %s\n", arg->bundle->cfg.label);
@@ -1239,17 +1280,6 @@ bundle_ShowStatus(struct cmdargs const *arg)
else
prompt_Printf(arg->prompt, "unspecified\n");
- prompt_Printf(arg->prompt, " sendpipe: ");
- if (arg->bundle->ncp.ipcp.cfg.sendpipe > 0)
- prompt_Printf(arg->prompt, "%ld\n", arg->bundle->ncp.ipcp.cfg.sendpipe);
- else
- prompt_Printf(arg->prompt, "unspecified\n");
- prompt_Printf(arg->prompt, " recvpipe: ");
- if (arg->bundle->ncp.ipcp.cfg.recvpipe > 0)
- prompt_Printf(arg->prompt, "%ld\n", arg->bundle->ncp.ipcp.cfg.recvpipe);
- else
- prompt_Printf(arg->prompt, "unspecified\n");
-
prompt_Printf(arg->prompt, " Sticky Routes: %s\n",
optval(arg->bundle, OPT_SROUTES));
prompt_Printf(arg->prompt, " ID check: %s\n",
@@ -1260,14 +1290,10 @@ bundle_ShowStatus(struct cmdargs const *arg)
optval(arg->bundle, OPT_PASSWDAUTH));
prompt_Printf(arg->prompt, " Proxy: %s\n",
optval(arg->bundle, OPT_PROXY));
- prompt_Printf(arg->prompt, " Proxyall: %s\n",
- optval(arg->bundle, OPT_PROXYALL));
prompt_Printf(arg->prompt, " Throughput: %s\n",
optval(arg->bundle, OPT_THROUGHPUT));
prompt_Printf(arg->prompt, " Utmp Logging: %s\n",
optval(arg->bundle, OPT_UTMP));
- prompt_Printf(arg->prompt, " Iface-Alias: %s\n",
- optval(arg->bundle, OPT_IFACEALIAS));
return 0;
}
@@ -1610,6 +1636,11 @@ bundle_SetMode(struct bundle *bundle, struct datalink *dl, int mode)
/* Regenerate phys_type and adjust autoload & idle timers */
bundle_LinksRemoved(bundle);
+ if (omode == PHYS_AUTO && !(bundle->phys_type.all & PHYS_AUTO) &&
+ bundle->phase != PHASE_NETWORK)
+ /* No auto links left */
+ ipcp_CleanInterface(&bundle->ncp.ipcp);
+
return 1;
}
@@ -1660,7 +1691,7 @@ bundle_setsid(struct bundle *bundle, int holdsession)
log_Printf(LogPHASE, "%d -> %d: %s session control\n",
(int)orig, (int)getpid(),
holdsession ? "Passed" : "Dropped");
- timer_InitService(0); /* Start the Timer Service */
+ timer_InitService();
break;
default:
close(fds[1]);
@@ -1717,30 +1748,3 @@ bundle_setsid(struct bundle *bundle, int holdsession)
break;
}
}
-
-int
-bundle_HighestState(struct bundle *bundle)
-{
- struct datalink *dl;
- int result = DATALINK_CLOSED;
-
- for (dl = bundle->links; dl; dl = dl->next)
- if (result < dl->state)
- result = dl->state;
-
- return result;
-}
-
-int
-bundle_Exception(struct bundle *bundle, int fd)
-{
- struct datalink *dl;
-
- for (dl = bundle->links; dl; dl = dl->next)
- if (dl->physical->fd == fd) {
- datalink_Down(dl, CLOSE_NORMAL);
- return 1;
- }
-
- return 0;
-}
diff --git a/usr.sbin/ppp/bundle.h b/usr.sbin/ppp/bundle.h
index 0eb20e44a748..aee0cc23c594 100644
--- a/usr.sbin/ppp/bundle.h
+++ b/usr.sbin/ppp/bundle.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bundle.h,v 1.19 1998/10/29 02:12:54 brian Exp $
+ * $Id: bundle.h,v 1.12 1998/08/07 18:42:47 brian Exp $
*/
#define PHASE_DEAD 0 /* Link is dead */
@@ -33,15 +33,13 @@
#define PHASE_TERMINATE 4 /* Terminating link */
/* cfg.opt bit settings */
-#define OPT_IDCHECK 0x0001
-#define OPT_IFACEALIAS 0x0002
-#define OPT_LOOPBACK 0x0004
-#define OPT_PASSWDAUTH 0x0008
-#define OPT_PROXY 0x0010
-#define OPT_PROXYALL 0x0020
-#define OPT_SROUTES 0x0040
-#define OPT_THROUGHPUT 0x0080
-#define OPT_UTMP 0x0100
+#define OPT_IDCHECK 0x01
+#define OPT_LOOPBACK 0x02
+#define OPT_PASSWDAUTH 0x04
+#define OPT_PROXY 0x08
+#define OPT_SROUTES 0x10
+#define OPT_THROUGHPUT 0x20
+#define OPT_UTMP 0x40
#define MAX_ENDDISC_CLASS 5
@@ -53,22 +51,22 @@ struct physical;
struct link;
struct server;
struct prompt;
-struct iface;
struct bundle {
struct descriptor desc; /* really all our datalinks */
int unit; /* The device/interface unit number */
const char **argv; /* From main() */
- const char *argv0; /* Original */
- const char *argv1; /* Original */
struct {
char Name[20]; /* The /dev/XXXX name */
int fd; /* The /dev/XXXX descriptor */
} dev;
- u_long ifSpeed; /* struct tuninfo speed */
- struct iface *iface; /* Interface information */
+ struct {
+ u_long Speed; /* struct tuninfo speed */
+ int Index; /* The interface index */
+ char *Name; /* The interface name */
+ } ifp;
int routing_seq; /* The current routing sequence number */
u_int phase; /* Curent phase */
@@ -183,5 +181,3 @@ extern int bundle_RenameDatalink(struct bundle *, struct datalink *,
const char *);
extern void bundle_setsid(struct bundle *, int);
extern void bundle_LockTun(struct bundle *);
-extern int bundle_HighestState(struct bundle *);
-extern int bundle_Exception(struct bundle *, int);
diff --git a/usr.sbin/ppp/cbcp.c b/usr.sbin/ppp/cbcp.c
index defa43186dd2..27f83e9f204d 100644
--- a/usr.sbin/ppp/cbcp.c
+++ b/usr.sbin/ppp/cbcp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cbcp.c,v 1.7 1998/10/31 17:38:48 brian Exp $
+ * $Id: cbcp.c,v 1.1 1998/08/07 18:44:16 brian Exp $
*/
#include <sys/types.h>
@@ -293,7 +293,7 @@ cbcp_SendReq(struct cbcp *cbcp)
break;
default:
- data.length = (char *)&data.delay - (char *)&data;
+ data.length = 2;
break;
}
@@ -354,12 +354,10 @@ cbcp_AdjustResponse(struct cbcp *cbcp, struct cbcp_data *data)
switch (data->type) {
case CBCP_NONUM:
- /*
- * If the callee offers no callback, we send our desired response
- * anyway. This is what Win95 does - although I can't find this
- * behaviour documented in the spec....
- */
- return 1;
+ if (cbcp->fsm.type == CBCP_NONUM)
+ return 1;
+ log_Printf(LogPHASE, "CBCP: server wants no callback !\n");
+ return 0;
case CBCP_CLIENTNUM:
if (cbcp->fsm.type == CBCP_CLIENTNUM) {
@@ -473,9 +471,7 @@ cbcp_SendResponse(struct cbcp *cbcp)
data.type = cbcp->fsm.type;
data.delay = cbcp->fsm.delay;
addr = (struct cbcp_addr *)data.addr_start;
- if (data.type == CBCP_NONUM)
- data.length = (char *)&data.delay - (char *)&data;
- else if (*cbcp->fsm.phone) {
+ if (*cbcp->fsm.phone) {
addr->type = CBCP_ADDR_PSTN;
strcpy(addr->addr, cbcp->fsm.phone);
data.length = (addr->addr + strlen(addr->addr) + 1) - (char *)&data;
@@ -552,13 +548,6 @@ cbcp_CheckResponse(struct cbcp *cbcp, struct cbcp_data *data)
log_Printf(LogPHASE, "Internal CBCP error - agreed on %d ??!?\n",
(int)cbcp->fsm.type);
return CBCP_ACTION_DOWN;
- } else if (data->type == CBCP_NONUM && cbcp->fsm.type == CBCP_CLIENTNUM) {
- /*
- * Client doesn't want CBCP after all....
- * We only allow this when ``set cbcp *'' has been specified.
- */
- cbcp->fsm.type = CBCP_NONUM;
- return CBCP_ACTION_ACK;
}
log_Printf(LogCBCP, "Invalid peer RESPONSE\n");
return CBCP_ACTION_REQ;
@@ -568,7 +557,6 @@ static void
cbcp_SendAck(struct cbcp *cbcp)
{
struct cbcp_data data;
- struct cbcp_addr *addr;
/* Only callees send ACKs */
@@ -576,22 +564,8 @@ cbcp_SendAck(struct cbcp *cbcp)
cbcp->fsm.id, cbcpstate(cbcp->fsm.state));
data.type = cbcp->fsm.type;
- switch (data.type) {
- case CBCP_NONUM:
- data.length = (char *)&data.delay - (char *)&data;
- break;
- case CBCP_CLIENTNUM:
- addr = (struct cbcp_addr *)data.addr_start;
- addr->type = CBCP_ADDR_PSTN;
- strcpy(addr->addr, cbcp->fsm.phone);
- data.delay = cbcp->fsm.delay;
- data.length = addr->addr + strlen(addr->addr) + 1 - (char *)&data;
- break;
- default:
- data.delay = cbcp->fsm.delay;
- data.length = data.addr_start - (char *)&data;
- break;
- }
+ data.delay = cbcp->fsm.delay;
+ data.length = data.addr_start - (char *)&data;
cbcp_data_Show(&data);
cbcp_Output(cbcp, CBCP_ACK, &data);
@@ -636,7 +610,6 @@ cbcp_Input(struct physical *p, struct mbuf *bp)
timer_Stop(&cbcp->fsm.timer);
if (cbcp_AdjustResponse(cbcp, data)) {
cbcp->fsm.restart = DEF_REQs;
- cbcp->fsm.id = head->id;
cbcp_SendResponse(cbcp);
} else
datalink_CBCPFailed(cbcp->p->dl);
@@ -648,11 +621,6 @@ cbcp_Input(struct physical *p, struct mbuf *bp)
log_Printf(LogCBCP, "%s: RecvResponse(%d) state = %s\n",
p->dl->name, head->id, cbcpstate(cbcp->fsm.state));
cbcp_data_Show(data);
- if (cbcp->fsm.id != head->id) {
- log_Printf(LogCBCP, "Warning: Expected id was %d, not %d\n",
- cbcp->fsm.id, head->id);
- cbcp->fsm.id = head->id;
- }
if (cbcp->fsm.state == CBCP_REQSENT || cbcp->fsm.state == CBCP_ACKSENT) {
timer_Stop(&cbcp->fsm.timer);
switch (cbcp_CheckResponse(cbcp, data)) {
@@ -685,11 +653,6 @@ cbcp_Input(struct physical *p, struct mbuf *bp)
log_Printf(LogCBCP, "%s: RecvAck(%d) state = %s\n",
p->dl->name, head->id, cbcpstate(cbcp->fsm.state));
cbcp_data_Show(data);
- if (cbcp->fsm.id != head->id) {
- log_Printf(LogCBCP, "Warning: Expected id was %d, not %d\n",
- cbcp->fsm.id, head->id);
- cbcp->fsm.id = head->id;
- }
if (cbcp->fsm.state == CBCP_RESPSENT) {
timer_Stop(&cbcp->fsm.timer);
datalink_CBCPComplete(cbcp->p->dl);
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index 8c41aa21f49b..fa81677b5820 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: chat.c,v 1.51 1998/08/07 18:42:47 brian Exp $
+ * $Id: chat.c,v 1.50 1998/06/27 14:18:01 brian Exp $
*/
#include <sys/types.h>
@@ -429,7 +429,6 @@ chat_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
if (begin >= ebegin && begin < eend &&
!strncmp(begin, c->argptr, c->arglen)) {
/* Got it ! */
- timer_Stop(&c->timeout);
if (memchr(begin + c->arglen - 1, '\n',
c->bufend - begin - c->arglen + 1) == NULL) {
/* force it into the log */
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index f31cb8b242c8..1b74fc55afda 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.176 1998/11/05 21:59:47 brian Exp $
+ * $Id: command.c,v 1.165 1998/08/29 23:02:42 brian Exp $
*
*/
#include <sys/types.h>
@@ -83,7 +83,6 @@
#include "chap.h"
#include "cbcp.h"
#include "datalink.h"
-#include "iface.h"
/* ``set'' values */
#define VAR_AUTHKEY 0
@@ -113,8 +112,6 @@
#define VAR_CALLBACK 24
#define VAR_CBCP 25
#define VAR_CHOKED 26
-#define VAR_SENDPIPE 27
-#define VAR_RECVPIPE 28
/* ``accept|deny|disable|enable'' masks */
#define NEG_HISMASK (1)
@@ -134,7 +131,7 @@
#define NEG_DNS 50
const char Version[] = "2.0";
-const char VersionDate[] = "$Date: 1998/11/05 21:59:47 $";
+const char VersionDate[] = "$Date: 1998/08/29 23:02:42 $";
static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *);
@@ -142,18 +139,15 @@ static int QuitCommand(struct cmdargs const *);
static int OpenCommand(struct cmdargs const *);
static int CloseCommand(struct cmdargs const *);
static int DownCommand(struct cmdargs const *);
+static int AllowCommand(struct cmdargs const *);
static int SetCommand(struct cmdargs const *);
static int LinkCommand(struct cmdargs const *);
static int AddCommand(struct cmdargs const *);
static int DeleteCommand(struct cmdargs const *);
static int NegotiateCommand(struct cmdargs const *);
static int ClearCommand(struct cmdargs const *);
-static int RunListCommand(struct cmdargs const *);
-static int IfaceAddCommand(struct cmdargs const *);
-static int IfaceDeleteCommand(struct cmdargs const *);
-static int IfaceClearCommand(struct cmdargs const *);
-static int SetProcTitle(struct cmdargs const *);
#ifndef NOALIAS
+static int AliasCommand(struct cmdargs const *);
static int AliasEnable(struct cmdargs const *);
static int AliasOption(struct cmdargs const *);
#endif
@@ -209,9 +203,7 @@ HelpCommand(struct cmdargs const *arg)
if (cmd->name && (cmd->lauth & arg->prompt->auth)) {
cx = showcx(cmd);
cxlen = cmax - strlen(cmd->name);
- if (n % cols != 0)
- prompt_Printf(arg->prompt, " ");
- prompt_Printf(arg->prompt, "%s%-*.*s: %-*.*s",
+ prompt_Printf(arg->prompt, " %s%-*.*s: %-*.*s",
cmd->name, cxlen, cxlen, cx, dmax, dmax, cmd->helpmes);
if (++n % cols == 0)
prompt_Printf(arg->prompt, "\n");
@@ -274,32 +266,29 @@ RenameCommand(struct cmdargs const *arg)
int
LoadCommand(struct cmdargs const *arg)
{
- const char *err;
- int n, mode;
+ const char *name;
- mode = arg->bundle->phys_type.all;
-
- if (arg->argn < arg->argc) {
- for (n = arg->argn; n < arg->argc; n++)
- if ((err = system_IsValid(arg->argv[n], arg->prompt, mode)) != NULL) {
- log_Printf(LogWARN, "%s: %s\n", arg->argv[n], err);
- return 1;
- }
+ if (arg->argc > arg->argn)
+ name = arg->argv[arg->argn];
+ else
+ name = "default";
- for (n = arg->argn; n < arg->argc; n++) {
- bundle_SetLabel(arg->bundle, arg->argv[arg->argc - 1]);
- system_Select(arg->bundle, arg->argv[n], CONFFILE, arg->prompt, arg->cx);
- }
- bundle_SetLabel(arg->bundle, arg->argv[arg->argc - 1]);
- } else if ((err = system_IsValid("default", arg->prompt, mode)) != NULL) {
- log_Printf(LogWARN, "default: %s\n", err);
+ if (!system_IsValid(name, arg->prompt, arg->bundle->phys_type.all)) {
+ log_Printf(LogWARN, "%s: Label not allowed\n", name);
return 1;
} else {
- bundle_SetLabel(arg->bundle, "default");
- system_Select(arg->bundle, "default", CONFFILE, arg->prompt, arg->cx);
- bundle_SetLabel(arg->bundle, "default");
+ /*
+ * Set the label before & after so that `set enddisc' works and
+ * we handle nested `load' commands.
+ */
+ bundle_SetLabel(arg->bundle, arg->argc > arg->argn ? name : NULL);
+ if (system_Select(arg->bundle, name, CONFFILE, arg->prompt, arg->cx) < 0) {
+ bundle_SetLabel(arg->bundle, NULL);
+ log_Printf(LogWARN, "%s: label not found.\n", name);
+ return -1;
+ }
+ bundle_SetLabel(arg->bundle, arg->argc > arg->argn ? name : NULL);
}
-
return 0;
}
@@ -385,25 +374,17 @@ subst(char *tgt, const char *oldstr, const char *newstr)
}
static void
-expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle,
- int inc0)
+expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle)
{
int arg;
- char pid[12];
- if (inc0)
- arg = 0; /* Start at arg 0 */
- else {
- nargv[0] = strdup(oargv[0]);
- arg = 1;
- }
- snprintf(pid, sizeof pid, "%d", getpid());
- for (; arg < argc; arg++) {
+ nargv[0] = strdup(oargv[0]);
+ for (arg = 1; arg < argc; arg++) {
nargv[arg] = strdup(oargv[arg]);
nargv[arg] = subst(nargv[arg], "HISADDR",
inet_ntoa(bundle->ncp.ipcp.peer_ip));
nargv[arg] = subst(nargv[arg], "AUTHNAME", bundle->cfg.auth.name);
- nargv[arg] = subst(nargv[arg], "INTERFACE", bundle->iface->name);
+ nargv[arg] = subst(nargv[arg], "INTERFACE", bundle->ifp.Name);
nargv[arg] = subst(nargv[arg], "MYADDR", inet_ntoa(bundle->ncp.ipcp.my_ip));
nargv[arg] = subst(nargv[arg], "USER", bundle->ncp.mp.peer.authname);
nargv[arg] = subst(nargv[arg], "PEER_ENDDISC",
@@ -414,7 +395,6 @@ expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle,
mp_Enddisc(bundle->ncp.mp.cfg.enddisc.class,
bundle->ncp.mp.cfg.enddisc.address,
bundle->ncp.mp.cfg.enddisc.len));
- nargv[arg] = subst(nargv[arg], "PROCESSID", pid);
nargv[arg] = subst(nargv[arg], "LABEL", bundle_GetLabel(bundle));
}
nargv[arg] = NULL;
@@ -480,7 +460,7 @@ ShellCommand(struct cmdargs const *arg, int bg)
argc = sizeof argv / sizeof argv[0] - 1;
log_Printf(LogWARN, "Truncating shell command to %d args\n", argc);
}
- expand(argv, argc, arg->argv + arg->argn, arg->bundle, 0);
+ expand(argv, argc, arg->argv + arg->argn, arg->bundle);
if (bg) {
pid_t p;
@@ -499,9 +479,8 @@ ShellCommand(struct cmdargs const *arg, int bg)
execl(shell, shell, NULL);
}
- log_Printf(LogWARN, "exec() of %s failed: %s\n",
- arg->argc > arg->argn ? arg->argv[arg->argn] : shell,
- strerror(errno));
+ log_Printf(LogWARN, "exec() of %s failed\n",
+ arg->argc > arg->argn ? arg->argv[arg->argn] : shell);
exit(255);
}
@@ -532,69 +511,6 @@ FgShellCommand(struct cmdargs const *arg)
return ShellCommand(arg, 0);
}
-#ifndef NOALIAS
-static struct cmdtab const AliasCommands[] =
-{
- {"addr", NULL, alias_RedirectAddr, LOCAL_AUTH,
- "static address translation", "alias addr [addr_local addr_alias]"},
- {"deny_incoming", NULL, AliasOption, LOCAL_AUTH,
- "stop incoming connections", "alias deny_incoming [yes|no]",
- (const void *) PKT_ALIAS_DENY_INCOMING},
- {"enable", NULL, AliasEnable, LOCAL_AUTH,
- "enable IP aliasing", "alias enable [yes|no]"},
- {"log", NULL, AliasOption, LOCAL_AUTH,
- "log aliasing link creation", "alias log [yes|no]",
- (const void *) PKT_ALIAS_LOG},
- {"port", NULL, alias_RedirectPort, LOCAL_AUTH,
- "port redirection", "alias port [proto addr_local:port_local port_alias]"},
- {"same_ports", NULL, AliasOption, LOCAL_AUTH,
- "try to leave port numbers unchanged", "alias same_ports [yes|no]",
- (const void *) PKT_ALIAS_SAME_PORTS},
- {"unregistered_only", NULL, AliasOption, LOCAL_AUTH,
- "alias unregistered (private) IP address space only",
- "alias unregistered_only [yes|no]",
- (const void *) PKT_ALIAS_UNREGISTERED_ONLY},
- {"use_sockets", NULL, AliasOption, LOCAL_AUTH,
- "allocate host sockets", "alias use_sockets [yes|no]",
- (const void *) PKT_ALIAS_USE_SOCKETS},
- {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
- "Display this message", "alias help|? [command]", AliasCommands},
- {NULL, NULL, NULL},
-};
-#endif
-
-static struct cmdtab const AllowCommands[] = {
- {"modes", "mode", AllowModes, LOCAL_AUTH,
- "Only allow certain ppp modes", "allow modes mode..."},
- {"users", "user", AllowUsers, LOCAL_AUTH,
- "Only allow ppp access to certain users", "allow users logname..."},
- {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
- "Display this message", "allow help|? [command]", AllowCommands},
- {NULL, NULL, NULL},
-};
-
-static struct cmdtab const IfaceCommands[] =
-{
- {"add", NULL, IfaceAddCommand, LOCAL_AUTH,
- "Add iface address", "iface add addr[/bits| mask] peer", NULL},
- {NULL, "add!", IfaceAddCommand, LOCAL_AUTH,
- "Add or change an iface address", "iface add! addr[/bits| mask] peer",
- (void *)1},
- {"clear", NULL, IfaceClearCommand, LOCAL_AUTH,
- "Clear iface address(es)", "iface clear"},
- {"delete", "rm", IfaceDeleteCommand, LOCAL_AUTH,
- "Delete iface address", "iface delete addr", NULL},
- {NULL, "rm!", IfaceDeleteCommand, LOCAL_AUTH,
- "Delete iface address", "iface delete addr", (void *)1},
- {NULL, "delete!", IfaceDeleteCommand, LOCAL_AUTH,
- "Delete iface address", "iface delete addr", (void *)1},
- {"show", NULL, iface_Show, LOCAL_AUTH,
- "Show iface address(es)", "iface show"},
- {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
- "Display this message", "alias help|? [command]", IfaceCommands},
- {NULL, NULL, NULL},
-};
-
static struct cmdtab const Commands[] = {
{"accept", NULL, NegotiateCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"accept option request", "accept option .."},
@@ -603,11 +519,11 @@ static struct cmdtab const Commands[] = {
{NULL, "add!", AddCommand, LOCAL_AUTH,
"add or change route", "add! dest mask gateway", (void *)1},
#ifndef NOALIAS
- {"alias", NULL, RunListCommand, LOCAL_AUTH,
- "alias control", "alias option [yes|no]", AliasCommands},
+ {"alias", NULL, AliasCommand, LOCAL_AUTH,
+ "alias control", "alias option [yes|no]"},
#endif
- {"allow", "auth", RunListCommand, LOCAL_AUTH,
- "Allow ppp access", "allow users|modes ....", AllowCommands},
+ {"allow", "auth", AllowCommand, LOCAL_AUTH,
+ "Allow ppp access", "allow users|modes ...."},
{"bg", "!bg", BgShellCommand, LOCAL_AUTH,
"Run a background command", "[!]bg command"},
{"clear", NULL, ClearCommand, LOCAL_AUTH | LOCAL_CX_OPT,
@@ -623,19 +539,17 @@ static struct cmdtab const Commands[] = {
{"deny", NULL, NegotiateCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Deny option request", "deny option .."},
{"dial", "call", DialCommand, LOCAL_AUTH | LOCAL_CX_OPT,
- "Dial and login", "dial|call [system ...]", NULL},
+ "Dial and login", "dial|call [remote]", NULL},
{"disable", NULL, NegotiateCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Disable option", "disable option .."},
{"down", NULL, DownCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Generate a down event", "down"},
{"enable", NULL, NegotiateCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Enable option", "enable option .."},
- {"iface", "interface", RunListCommand, LOCAL_AUTH,
- "interface control", "iface option ...", IfaceCommands},
{"link", "datalink", LinkCommand, LOCAL_AUTH,
"Link specific commands", "link name command ..."},
{"load", NULL, LoadCommand, LOCAL_AUTH | LOCAL_CX_OPT,
- "Load settings", "load [system ...]"},
+ "Load settings", "load [remote]"},
{"open", NULL, OpenCommand, LOCAL_AUTH | LOCAL_CX_OPT,
"Open an FSM", "open! [lcp|ccp|ipcp]", (void *)1},
{"passwd", NULL, PasswdCommand, LOCAL_NO_AUTH,
@@ -739,8 +653,6 @@ static struct cmdtab const ShowCommands[] = {
"packet filters", "show filter [in|out|dial|alive]"},
{"hdlc", NULL, hdlc_ReportStatus, LOCAL_AUTH | LOCAL_CX,
"HDLC errors", "show hdlc"},
- {"iface", "interface", iface_Show, LOCAL_AUTH,
- "Interface status", "show iface"},
{"ipcp", NULL, ipcp_Show, LOCAL_AUTH,
"IPCP status", "show ipcp"},
{"lcp", NULL, lcp_ReportStatus, LOCAL_AUTH | LOCAL_CX,
@@ -1286,12 +1198,13 @@ SetInterfaceAddr(struct cmdargs const *arg)
struct ipcp *ipcp = &arg->bundle->ncp.ipcp;
const char *hisaddr;
- if (arg->argc > arg->argn + 4)
- return -1;
-
hisaddr = NULL;
ipcp->cfg.my_range.ipaddr.s_addr = INADDR_ANY;
ipcp->cfg.peer_range.ipaddr.s_addr = INADDR_ANY;
+
+ if (arg->argc > arg->argn + 4)
+ return -1;
+
ipcp->cfg.HaveTriggerAddress = 0;
ipcp->cfg.netmask.s_addr = INADDR_ANY;
iplist_reset(&ipcp->cfg.peer_list);
@@ -1313,13 +1226,20 @@ SetInterfaceAddr(struct cmdargs const *arg)
}
}
- /* 0.0.0.0 means any address (0 bits) */
+ /*
+ * For backwards compatibility, 0.0.0.0 means any address.
+ */
if (ipcp->cfg.my_range.ipaddr.s_addr == INADDR_ANY) {
ipcp->cfg.my_range.mask.s_addr = INADDR_ANY;
ipcp->cfg.my_range.width = 0;
}
ipcp->my_ip.s_addr = ipcp->cfg.my_range.ipaddr.s_addr;
+ if (ipcp->cfg.peer_range.ipaddr.s_addr == INADDR_ANY) {
+ ipcp->cfg.peer_range.mask.s_addr = INADDR_ANY;
+ ipcp->cfg.peer_range.width = 0;
+ }
+
if (hisaddr && !ipcp_UseHisaddr(arg->bundle, hisaddr,
arg->bundle->phys_type.all & PHYS_AUTO))
return 4;
@@ -1355,32 +1275,24 @@ SetVariable(struct cmdargs const *arg)
switch (param) {
case VAR_AUTHKEY:
- switch (bundle_Phase(arg->bundle)) {
- case PHASE_DEAD:
- case PHASE_ESTABLISH:
- strncpy(arg->bundle->cfg.auth.key, argp,
- sizeof arg->bundle->cfg.auth.key - 1);
- arg->bundle->cfg.auth.key[sizeof arg->bundle->cfg.auth.key - 1] = '\0';
- break;
- default:
- err = "set authkey: Only available at phase DEAD/ESTABLISH\n";
- log_Printf(LogWARN, err);
- break;
+ if (bundle_Phase(arg->bundle) == PHASE_DEAD) {
+ strncpy(arg->bundle->cfg.auth.key, argp,
+ sizeof arg->bundle->cfg.auth.key - 1);
+ arg->bundle->cfg.auth.key[sizeof arg->bundle->cfg.auth.key - 1] = '\0';
+ } else {
+ err = "set authkey: Only available at phase DEAD\n";
+ log_Printf(LogWARN, err);
}
break;
case VAR_AUTHNAME:
- switch (bundle_Phase(arg->bundle)) {
- case PHASE_DEAD:
- case PHASE_ESTABLISH:
- strncpy(arg->bundle->cfg.auth.name, argp,
- sizeof arg->bundle->cfg.auth.name - 1);
- arg->bundle->cfg.auth.name[sizeof arg->bundle->cfg.auth.name-1] = '\0';
- break;
- default:
- err = "set authname: Only available at phase DEAD/ESTABLISH\n";
- log_Printf(LogWARN, err);
- break;
+ if (bundle_Phase(arg->bundle) == PHASE_DEAD) {
+ strncpy(arg->bundle->cfg.auth.name, argp,
+ sizeof arg->bundle->cfg.auth.name - 1);
+ arg->bundle->cfg.auth.name[sizeof arg->bundle->cfg.auth.name - 1] = '\0';
+ } else {
+ err = "set authname: Only available at phase DEAD\n";
+ log_Printf(LogWARN, err);
}
break;
@@ -1463,19 +1375,9 @@ SetVariable(struct cmdargs const *arg)
break;
case VAR_MRRU:
- switch (bundle_Phase(arg->bundle)) {
- case PHASE_DEAD:
- break;
- case PHASE_ESTABLISH:
- /* Make sure none of our links are DATALINK_LCP or greater */
- if (bundle_HighestState(arg->bundle) >= DATALINK_LCP) {
- log_Printf(LogWARN, "mrru: Only changable before LCP negotiations\n");
- return 1;
- }
- break;
- default:
- log_Printf(LogWARN, "mrru: Only changable at phase DEAD/ESTABLISH\n");
- return 1;
+ if (bundle_Phase(arg->bundle) != PHASE_DEAD) {
+ log_Printf(LogWARN, "mrru: Only changable at phase DEAD\n");
+ return 1;
}
long_val = atol(argp);
if (long_val && long_val < MIN_MRU) {
@@ -1681,16 +1583,7 @@ SetVariable(struct cmdargs const *arg)
if (arg->bundle->cfg.choked.timeout <= 0)
arg->bundle->cfg.choked.timeout = CHOKED_TIMEOUT;
break;
-
- case VAR_SENDPIPE:
- long_val = atol(argp);
- arg->bundle->ncp.ipcp.cfg.sendpipe = long_val;
- break;
-
- case VAR_RECVPIPE:
- long_val = atol(argp);
- arg->bundle->ncp.ipcp.cfg.recvpipe = long_val;
- break;
+
}
return err ? 1 : 0;
@@ -1786,16 +1679,10 @@ static struct cmdtab const SetCommands[] = {
"modem parity", "set parity [odd|even|none]"},
{"phone", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, "telephone number(s)",
"set phone phone1[:phone2[...]]", (const void *)VAR_PHONE},
- {"proctitle", "title", SetProcTitle, LOCAL_AUTH,
- "Process title", "set proctitle [value]"},
{"reconnect", NULL, datalink_SetReconnect, LOCAL_AUTH | LOCAL_CX,
"Reconnect timeout", "set reconnect value ntries"},
- {"recvpipe", NULL, SetVariable, LOCAL_AUTH,
- "RECVPIPE value", "set recvpipe value", (const void *)VAR_RECVPIPE},
{"redial", NULL, datalink_SetRedial, LOCAL_AUTH | LOCAL_CX,
"Redial timeout", "set redial value|random[.value|random] [attempts]"},
- {"sendpipe", NULL, SetVariable, LOCAL_AUTH,
- "SENDPIPE value", "set sendpipe value", (const void *)VAR_SENDPIPE},
{"server", "socket", SetServer, LOCAL_AUTH,
"server port", "set server|socket TcpPort|LocalName|none password [mask]"},
{"speed", NULL, SetModemSpeed, LOCAL_AUTH | LOCAL_CX,
@@ -1828,6 +1715,7 @@ SetCommand(struct cmdargs const *arg)
return 0;
}
+
static int
AddCommand(struct cmdargs const *arg)
{
@@ -1869,7 +1757,9 @@ AddCommand(struct cmdargs const *arg)
if (strcasecmp(arg->argv[arg->argn+gw], "HISADDR") == 0) {
gateway = arg->bundle->ncp.ipcp.peer_ip;
addrs |= ROUTE_GWHISADDR;
- } else
+ } else if (strcasecmp(arg->argv[arg->argn+gw], "INTERFACE") == 0)
+ gateway.s_addr = INADDR_ANY;
+ else
gateway = GetIpAddr(arg->argv[arg->argn+gw]);
if (bundle_SetRoute(arg->bundle, RTM_ADD, dest, gateway, netmask,
@@ -1916,6 +1806,51 @@ DeleteCommand(struct cmdargs const *arg)
}
#ifndef NOALIAS
+static struct cmdtab const AliasCommands[] =
+{
+ {"addr", NULL, alias_RedirectAddr, LOCAL_AUTH,
+ "static address translation", "alias addr [addr_local addr_alias]"},
+ {"deny_incoming", NULL, AliasOption, LOCAL_AUTH,
+ "stop incoming connections", "alias deny_incoming [yes|no]",
+ (const void *) PKT_ALIAS_DENY_INCOMING},
+ {"enable", NULL, AliasEnable, LOCAL_AUTH,
+ "enable IP aliasing", "alias enable [yes|no]"},
+ {"log", NULL, AliasOption, LOCAL_AUTH,
+ "log aliasing link creation", "alias log [yes|no]",
+ (const void *) PKT_ALIAS_LOG},
+ {"port", NULL, alias_RedirectPort, LOCAL_AUTH,
+ "port redirection", "alias port [proto addr_local:port_local port_alias]"},
+ {"same_ports", NULL, AliasOption, LOCAL_AUTH,
+ "try to leave port numbers unchanged", "alias same_ports [yes|no]",
+ (const void *) PKT_ALIAS_SAME_PORTS},
+ {"unregistered_only", NULL, AliasOption, LOCAL_AUTH,
+ "alias unregistered (private) IP address space only",
+ "alias unregistered_only [yes|no]",
+ (const void *) PKT_ALIAS_UNREGISTERED_ONLY},
+ {"use_sockets", NULL, AliasOption, LOCAL_AUTH,
+ "allocate host sockets", "alias use_sockets [yes|no]",
+ (const void *) PKT_ALIAS_USE_SOCKETS},
+ {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
+ "Display this message", "alias help|? [command]", AliasCommands},
+ {NULL, NULL, NULL},
+};
+
+
+static int
+AliasCommand(struct cmdargs const *arg)
+{
+ if (arg->argc > arg->argn)
+ FindExec(arg->bundle, AliasCommands, arg->argc, arg->argn, arg->argv,
+ arg->prompt, arg->cx);
+ else if (arg->prompt)
+ prompt_Printf(arg->prompt, "Use `alias help' to get a list or `alias help"
+ " <option>' for syntax help.\n");
+ else
+ log_Printf(LogWARN, "alias command must have arguments\n");
+
+ return 0;
+}
+
static int
AliasEnable(struct cmdargs const *arg)
{
@@ -1925,8 +1860,6 @@ AliasEnable(struct cmdargs const *arg)
return 0;
} else if (strcasecmp(arg->argv[arg->argn], "no") == 0) {
arg->bundle->AliasEnabled = 0;
- arg->bundle->cfg.opt &= ~OPT_IFACEALIAS;
- /* Don't iface_Clear() - there may be manually configured addresses */
return 0;
}
}
@@ -1959,6 +1892,32 @@ AliasOption(struct cmdargs const *arg)
}
#endif /* #ifndef NOALIAS */
+static struct cmdtab const AllowCommands[] = {
+ {"modes", "mode", AllowModes, LOCAL_AUTH,
+ "Only allow certain ppp modes", "allow modes mode..."},
+ {"users", "user", AllowUsers, LOCAL_AUTH,
+ "Allow users access to ppp", "allow users logname..."},
+ {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
+ "Display this message", "allow help|? [command]", AllowCommands},
+ {NULL, NULL, NULL},
+};
+
+static int
+AllowCommand(struct cmdargs const *arg)
+{
+ /* arg->bundle may be NULL (see system_IsValid()) ! */
+ if (arg->argc > arg->argn)
+ FindExec(arg->bundle, AllowCommands, arg->argc, arg->argn, arg->argv,
+ arg->prompt, arg->cx);
+ else if (arg->prompt)
+ prompt_Printf(arg->prompt, "Use `allow ?' to get a list or `allow ? <cmd>'"
+ " for syntax help.\n");
+ else
+ log_Printf(LogWARN, "allow command must have arguments\n");
+
+ return 0;
+}
+
static int
LinkCommand(struct cmdargs const *arg)
{
@@ -2086,22 +2045,6 @@ OptSet(struct cmdargs const *arg)
}
static int
-IfaceAliasOptSet(struct cmdargs const *arg)
-{
- unsigned save = arg->bundle->cfg.opt;
- int result = OptSet(arg);
-
- if (result == 0)
- if (Enabled(arg->bundle, OPT_IFACEALIAS) && !arg->bundle->AliasEnabled) {
- arg->bundle->cfg.opt = save;
- log_Printf(LogWARN, "Cannot enable iface-alias without IP aliasing\n");
- result = 2;
- }
-
- return result;
-}
-
-static int
NegotiateSet(struct cmdargs const *arg)
{
long param = (long)arg->cmd->args;
@@ -2162,24 +2105,12 @@ NegotiateSet(struct cmdargs const *arg)
cx->physical->link.lcp.cfg.protocomp |= add;
break;
case NEG_SHORTSEQ:
- switch (bundle_Phase(arg->bundle)) {
- case PHASE_DEAD:
- break;
- case PHASE_ESTABLISH:
- /* Make sure none of our links are DATALINK_LCP or greater */
- if (bundle_HighestState(arg->bundle) >= DATALINK_LCP) {
- log_Printf(LogWARN, "shortseq: Only changable before"
- " LCP negotiations\n");
- return 1;
- }
- break;
- default:
- log_Printf(LogWARN, "shortseq: Only changable at phase"
- " DEAD/ESTABLISH\n");
- return 1;
+ if (bundle_Phase(arg->bundle) != PHASE_DEAD)
+ log_Printf(LogWARN, "shortseq: Only changable at phase DEAD\n");
+ else {
+ arg->bundle->ncp.mp.cfg.shortseq &= keep;
+ arg->bundle->ncp.mp.cfg.shortseq |= add;
}
- arg->bundle->ncp.mp.cfg.shortseq &= keep;
- arg->bundle->ncp.mp.cfg.shortseq |= add;
break;
case NEG_VJCOMP:
arg->bundle->ncp.ipcp.cfg.vj.neg &= keep;
@@ -2193,17 +2124,12 @@ NegotiateSet(struct cmdargs const *arg)
static struct cmdtab const NegotiateCommands[] = {
{"idcheck", NULL, OptSet, LOCAL_AUTH, "Check FSM reply ids",
"disable|enable", (const void *)OPT_IDCHECK},
- {"iface-alias", NULL, IfaceAliasOptSet, LOCAL_AUTH,
- "retain interface addresses", "disable|enable",
- (const void *)OPT_IFACEALIAS},
{"loopback", NULL, OptSet, LOCAL_AUTH, "Loop packets for local iface",
"disable|enable", (const void *)OPT_LOOPBACK},
{"passwdauth", NULL, OptSet, LOCAL_AUTH, "Use passwd file",
"disable|enable", (const void *)OPT_PASSWDAUTH},
- {"proxy", NULL, OptSet, LOCAL_AUTH, "Create a proxy ARP entry",
+ {"proxy", NULL, OptSet, LOCAL_AUTH, "Create proxy ARP entry",
"disable|enable", (const void *)OPT_PROXY},
- {"proxyall", NULL, OptSet, LOCAL_AUTH, "Proxy ARP for all remote hosts",
- "disable|enable", (const void *)OPT_PROXYALL},
{"sroutes", NULL, OptSet, LOCAL_AUTH, "Use sticky routes",
"disable|enable", (const void *)OPT_SROUTES},
{"throughput", NULL, OptSet, LOCAL_AUTH, "Rolling throughput",
@@ -2211,7 +2137,7 @@ static struct cmdtab const NegotiateCommands[] = {
{"utmp", NULL, OptSet, LOCAL_AUTH, "Log connections in utmp",
"disable|enable", (const void *)OPT_UTMP},
-#define OPT_MAX 9 /* accept/deny allowed below and not above */
+#define OPT_MAX 7 /* accept/deny allowed below and not above */
{"acfcomp", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX,
"Address & Control field compression", "accept|deny|disable|enable",
@@ -2330,144 +2256,3 @@ ClearCommand(struct cmdargs const *arg)
throughput_clear(t, clear_type, arg->prompt);
return 0;
}
-
-static int
-RunListCommand(struct cmdargs const *arg)
-{
- const char *cmd = arg->argc ? arg->argv[arg->argc - 1] : "???";
-
- if (arg->argc > arg->argn)
- FindExec(arg->bundle, arg->cmd->args, arg->argc, arg->argn, arg->argv,
- arg->prompt, arg->cx);
- else if (arg->prompt)
- prompt_Printf(arg->prompt, "Use `%s help' to get a list or `%s help"
- " <option>' for syntax help.\n", cmd, cmd);
- else
- log_Printf(LogWARN, "%s command must have arguments\n", cmd);
-
- return 0;
-}
-
-static int
-IfaceAddCommand(struct cmdargs const *arg)
-{
- int bits, n, how;
- struct in_addr ifa, mask, brd;
-
- if (arg->argc == arg->argn + 1) {
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn, &ifa, NULL, NULL))
- return -1;
- mask.s_addr = brd.s_addr = INADDR_BROADCAST;
- } else {
- if (arg->argc == arg->argn + 2) {
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn, &ifa, &mask, &bits))
- return -1;
- n = 1;
- } else if (arg->argc == arg->argn + 3) {
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn, &ifa, NULL, NULL))
- return -1;
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn + 1, &mask, NULL, NULL))
- return -1;
- n = 2;
- } else
- return -1;
-
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn + n, &brd, NULL, NULL))
- return -1;
- }
-
- how = IFACE_ADD_LAST;
- if (arg->cmd->args)
- how |= IFACE_FORCE_ADD;
-
- return !iface_inAdd(arg->bundle->iface, ifa, mask, brd, how);
-}
-
-static int
-IfaceDeleteCommand(struct cmdargs const *arg)
-{
- struct in_addr ifa;
- int ok;
-
- if (arg->argc != arg->argn + 1)
- return -1;
-
- if (!ParseAddr(NULL, 1, arg->argv + arg->argn, &ifa, NULL, NULL))
- return -1;
-
- if (arg->bundle->ncp.ipcp.fsm.state == ST_OPENED &&
- arg->bundle->ncp.ipcp.my_ip.s_addr == ifa.s_addr) {
- log_Printf(LogWARN, "%s: Cannot remove active interface address\n",
- inet_ntoa(ifa));
- return 1;
- }
-
- ok = iface_inDelete(arg->bundle->iface, ifa);
- if (!ok) {
- if (arg->cmd->args)
- ok = 1;
- else if (arg->prompt)
- prompt_Printf(arg->prompt, "%s: No such address\n", inet_ntoa(ifa));
- else
- log_Printf(LogWARN, "%s: No such address\n", inet_ntoa(ifa));
- }
-
- return !ok;
-}
-
-static int
-IfaceClearCommand(struct cmdargs const *arg)
-{
- int how;
-
- if (arg->argc != arg->argn)
- return -1;
-
- how = arg->bundle->ncp.ipcp.fsm.state == ST_OPENED ||
- arg->bundle->phys_type.all & PHYS_AUTO ?
- IFACE_CLEAR_ALIASES : IFACE_CLEAR_ALL;
- iface_Clear(arg->bundle->iface, how);
-
- return 0;
-}
-
-static int
-SetProcTitle(struct cmdargs const *arg)
-{
- static char title[LINE_LEN];
- char *argv[MAXARGS], *ptr;
- int len, remaining, f, argc = arg->argc - arg->argn;
-
- if (arg->argc == arg->argn) {
- arg->bundle->argv[0] = arg->bundle->argv0;
- arg->bundle->argv[1] = arg->bundle->argv1;
- return 0;
- }
-
- if (argc >= sizeof argv / sizeof argv[0]) {
- argc = sizeof argv / sizeof argv[0] - 1;
- log_Printf(LogWARN, "Truncating proc title to %d args\n", argc);
- }
- expand(argv, argc, arg->argv + arg->argn, arg->bundle, 1);
-
- ptr = title;
- remaining = sizeof title - 1;
- for (f = 0; f < argc && remaining; f++) {
- if (f) {
- *ptr++ = ' ';
- remaining--;
- }
- len = strlen(argv[f]);
- if (len > remaining)
- len = remaining;
- memcpy(ptr, argv[f], len);
- remaining -= len;
- ptr += len;
- }
- *ptr = '\0';
-
- arg->bundle->argv[0] = title;
- arg->bundle->argv[1] = NULL;
-
- return 0;
-}
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 7e7f8f9fb129..cd6bd0ad3002 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: datalink.c,v 1.24 1999/01/12 21:50:20 brian Exp $
+ * $Id: datalink.c,v 1.18 1998/08/09 15:34:11 brian Exp $
*/
#include <sys/types.h>
@@ -256,9 +256,9 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
log_Printf(LogCHAT, "%s: Dial attempt %u of %d\n",
dl->name, dl->cfg.dial.max - dl->dial_tries,
dl->cfg.dial.max);
+ return datalink_UpdateSet(d, r, w, e, n);
} else
datalink_LoginDone(dl);
- return datalink_UpdateSet(d, r, w, e, n);
} else {
if (!(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)) &&
dl->cfg.dial.max)
@@ -303,9 +303,8 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
chat_Init(&dl->chat, dl->physical, dl->cfg.script.login, 0, NULL);
return datalink_UpdateSet(d, r, w, e, n);
case DATALINK_LOGIN:
- dl->phone.alt = NULL;
datalink_LoginDone(dl);
- return datalink_UpdateSet(d, r, w, e, n);
+ break;
}
break;
case CHAT_FAILED:
@@ -553,17 +552,13 @@ datalink_CBCPFailed(struct datalink *dl)
void
datalink_AuthOk(struct datalink *dl)
{
- if ((dl->physical->link.lcp.his_callback.opmask &
- CALLBACK_BIT(CALLBACK_CBCP) ||
- dl->physical->link.lcp.want_callback.opmask &
- CALLBACK_BIT(CALLBACK_CBCP)) &&
- !(dl->physical->link.lcp.want_callback.opmask &
- CALLBACK_BIT(CALLBACK_AUTH))) {
- /* We must have agreed CBCP if AUTH isn't there any more */
+ if (dl->physical->link.lcp.his_callback.opmask ==
+ CALLBACK_BIT(CALLBACK_CBCP) ||
+ dl->physical->link.lcp.want_callback.opmask ==
+ CALLBACK_BIT(CALLBACK_CBCP)) {
datalink_NewState(dl, DATALINK_CBCP);
cbcp_Up(&dl->cbcp);
} else if (dl->physical->link.lcp.want_callback.opmask) {
- /* It's not CBCP */
log_Printf(LogPHASE, "%s: Shutdown and await peer callback\n", dl->name);
datalink_NewState(dl, DATALINK_LCP);
fsm_Close(&dl->physical->link.lcp.fsm);
@@ -816,7 +811,6 @@ datalink_Destroy(struct datalink *dl)
}
}
- timer_Stop(&dl->dial_timer);
result = dl->next;
modem_Destroy(dl->physical);
free(dl->name);
@@ -990,14 +984,8 @@ datalink_Show(struct cmdargs const *arg)
prompt_Printf(arg->prompt, "%scbcp\n", comma ? ", " : "");
prompt_Printf(arg->prompt, " CBCP: delay: %ds\n",
arg->cx->cfg.cbcp.delay);
- prompt_Printf(arg->prompt, " phone: ");
- if (!strcmp(arg->cx->cfg.cbcp.phone, "*")) {
- if (arg->cx->physical->type & PHYS_DIRECT)
- prompt_Printf(arg->prompt, "Caller decides\n");
- else
- prompt_Printf(arg->prompt, "Dialback server decides\n");
- } else
- prompt_Printf(arg->prompt, "%s\n", arg->cx->cfg.cbcp.phone);
+ prompt_Printf(arg->prompt, " phone: %s\n",
+ arg->cx->cfg.cbcp.phone);
prompt_Printf(arg->prompt, " timeout: %lds\n",
arg->cx->cfg.cbcp.fsmretry);
} else
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index cd5a6443eb4f..3437d11ae874 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.c,v 1.25 1998/06/27 12:03:48 brian Exp $
+ * $Id: filter.c,v 1.24 1998/06/15 19:06:07 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -90,9 +90,9 @@ ParseAddr(struct ipcp *ipcp, int argc, char const *const *argv,
cp = pmask || pwidth ? strchr(*argv, '/') : NULL;
len = cp ? cp - *argv : strlen(*argv);
- if (ipcp && strncasecmp(*argv, "HISADDR", len) == 0)
+ if (strncasecmp(*argv, "HISADDR", len) == 0)
*paddr = ipcp->peer_ip;
- else if (ipcp && strncasecmp(*argv, "MYADDR", len) == 0)
+ else if (strncasecmp(*argv, "MYADDR", len) == 0)
*paddr = ipcp->my_ip;
else if (len > 15)
log_Printf(LogWARN, "ParseAddr: %s: Bad address\n", *argv);
@@ -121,12 +121,8 @@ ParseAddr(struct ipcp *ipcp, int argc, char const *const *argv,
if (pwidth)
*pwidth = bits;
- if (pmask) {
- if (paddr->s_addr == INADDR_ANY)
- pmask->s_addr = INADDR_ANY;
- else
- pmask->s_addr = htonl(netmasks[bits]);
- }
+ if (pmask)
+ pmask->s_addr = htonl(netmasks[bits]);
return (1);
}
diff --git a/usr.sbin/ppp/filter.h b/usr.sbin/ppp/filter.h
index 0505e7d6e300..f96af409ada6 100644
--- a/usr.sbin/ppp/filter.h
+++ b/usr.sbin/ppp/filter.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.h,v 1.12 1998/05/21 21:45:16 brian Exp $
+ * $Id: filter.h,v 1.11.2.7 1998/05/01 19:24:30 brian Exp $
*
* TODO:
*/
@@ -66,7 +66,7 @@ struct filterent {
} opt;
};
-#define MAXFILTERS 40 /* in each filter set */
+#define MAXFILTERS 20 /* in each filter set */
struct filter {
struct filterent rule[MAXFILTERS]; /* incoming packet filter */
diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c
deleted file mode 100644
index bca10ee0c3c6..000000000000
--- a/usr.sbin/ppp/iface.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*-
- * Copyright (c) 1998 Brian Somers <brian@Awfulhak.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.
- *
- * $Id: iface.c,v 1.1 1998/10/22 02:32:49 brian Exp $
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/route.h>
-#include <arpa/inet.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <sys/un.h>
-
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/sysctl.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <unistd.h>
-
-#include "defs.h"
-#include "command.h"
-#include "mbuf.h"
-#include "log.h"
-#include "id.h"
-#include "timer.h"
-#include "fsm.h"
-#include "iplist.h"
-#include "lqr.h"
-#include "hdlc.h"
-#include "throughput.h"
-#include "slcompress.h"
-#include "filter.h"
-#include "descriptor.h"
-#include "ipcp.h"
-#include "lcp.h"
-#include "ccp.h"
-#include "link.h"
-#include "mp.h"
-#include "bundle.h"
-#include "prompt.h"
-#include "iface.h"
-
-
-static int
-bitsinmask(struct in_addr mask)
-{
- u_int32_t bitmask, maskaddr;
- int bits;
-
- bitmask = 0xffffffff;
- maskaddr = ntohl(mask.s_addr);
- for (bits = 32; bits >= 0; bits--) {
- if (maskaddr == bitmask)
- break;
- bitmask &= ~(1 << (32 - bits));
- }
-
- return bits;
-}
-
-struct iface *
-iface_Create(const char *name)
-{
- int mib[6], i, s;
- size_t needed;
- char *buf, *ptr, *end, *cp, *lim;
- struct if_msghdr *ifm;
- struct ifa_msghdr *ifam;
- struct sockaddr_dl *dl;
- struct rt_addrinfo rti;
- struct iface *iface;
- struct iface_addr *addr;
-
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
- fprintf(stderr, "iface_Create: socket(): %s\n", strerror(errno));
- return NULL;
- }
-
- mib[0] = CTL_NET;
- mib[1] = PF_ROUTE;
- mib[2] = 0;
- mib[3] = 0;
- mib[4] = NET_RT_IFLIST;
- mib[5] = 0;
-
- if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) {
- fprintf(stderr, "clean: sysctl: estimate: %s\n",
- strerror(errno));
- close(s);
- return NULL;
- }
-
- if ((buf = (char *)malloc(needed)) == NULL) {
- close(s);
- return NULL;
- }
-
- if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
- free(buf);
- close(s);
- return NULL;
- }
-
- ptr = buf;
- end = buf + needed;
- iface = NULL;
-
- while (ptr < end && iface == NULL) {
- ifm = (struct if_msghdr *)ptr; /* On if_msghdr */
- if (ifm->ifm_type != RTM_IFINFO)
- break;
- dl = (struct sockaddr_dl *)(ifm + 1); /* Single _dl at end */
- if (!strncmp(name, dl->sdl_data, dl->sdl_nlen)) {
- iface = (struct iface *)malloc(sizeof *iface);
- if (iface == NULL) {
- fprintf(stderr, "iface_Create: malloc: %s\n", strerror(errno));
- return NULL;
- }
- iface->name = strdup(name);
- iface->flags = ifm->ifm_flags;
- iface->index = ifm->ifm_index;
- iface->in_addrs = 0;
- iface->in_addr = NULL;
- }
- ptr += ifm->ifm_msglen; /* First ifa_msghdr */
- for (; ptr < end; ptr += ifam->ifam_msglen) {
- ifam = (struct ifa_msghdr *)ptr; /* Next if address */
-
- if (ifam->ifam_type != RTM_NEWADDR) /* finished this if */
- break;
-
- if (iface == NULL) /* Keep wading */
- continue;
-
- /* Found an address ! */
-
- if (ifam->ifam_addrs & (1 << RTAX_IFA)) {
- /* *And* it's configured ! */
- rti.rti_addrs = ifam->ifam_addrs;
- lim = (char *)ifam + ifam->ifam_msglen;
- cp = (char *)(ifam + 1);
- memset(rti.rti_info, '\0', sizeof(rti.rti_info));
- for (i = 0; i < RTAX_MAX && cp < lim; i++) {
- if ((rti.rti_addrs & (1 << i)) == 0)
- continue;
- rti.rti_info[i] = (struct sockaddr *)cp;
-#define ROUNDUP(x) \
- ((x) > 0 ? (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long))
- cp += ROUNDUP(rti.rti_info[i]->sa_len);
- }
-
- if (rti.rti_info[RTAX_IFA] &&
- rti.rti_info[RTAX_IFA]->sa_family == AF_INET) {
- /* Record the iface address rti */
-
- addr = (struct iface_addr *)realloc
- (iface->in_addr, (iface->in_addrs + 1) * sizeof iface->in_addr[0]);
- if (addr == NULL)
- break;
- iface->in_addr = addr;
-
- addr += iface->in_addrs;
- iface->in_addrs++;
-
- addr->ifa.s_addr = ((struct sockaddr_in *)rti.rti_info[RTAX_IFA])->
- sin_addr.s_addr;
- addr->brd.s_addr = rti.rti_info[RTAX_BRD] ?
- ((struct sockaddr_in *)rti.rti_info[RTAX_BRD])->sin_addr.s_addr :
- INADDR_ANY;
- addr->mask.s_addr = rti.rti_info[RTAX_NETMASK] ?
- ((struct sockaddr_in *)rti.rti_info[RTAX_NETMASK])->sin_addr.s_addr:
- INADDR_ANY;
-
- addr->bits = bitsinmask(addr->mask);
- }
- }
- }
- }
-
- free(buf);
- close(s);
-
- return iface;
-}
-
-static void
-iface_addr_Zap(const char *name, struct iface_addr *addr)
-{
- struct ifaliasreq ifra;
- struct sockaddr_in *me, *peer;
- int s;
-
- s = ID0socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- log_Printf(LogERROR, "iface_addr_Zap: socket(): %s\n", strerror(errno));
- else {
- memset(&ifra, '\0', sizeof ifra);
- strncpy(ifra.ifra_name, name, sizeof ifra.ifra_name - 1);
- me = (struct sockaddr_in *)&ifra.ifra_addr;
- peer = (struct sockaddr_in *)&ifra.ifra_broadaddr;
- me->sin_family = peer->sin_family = AF_INET;
- me->sin_len = peer->sin_len = sizeof(struct sockaddr_in);
- me->sin_addr = addr->ifa;
- peer->sin_addr = addr->brd;
- log_Printf(LogDEBUG, "Delete %s\n", inet_ntoa(addr->ifa));
- if (ID0ioctl(s, SIOCDIFADDR, &ifra) < 0)
- log_Printf(LogWARN, "iface_addr_Zap: ioctl(SIOCDIFADDR, %s): %s\n",
- inet_ntoa(addr->ifa), strerror(errno));
- close(s);
- }
-}
-
-void
-iface_inClear(struct iface *iface, int how)
-{
- int n, addrs;
-
- addrs = n = how == IFACE_CLEAR_ALL ? 0 : 1;
- for (; n < iface->in_addrs; n++)
- iface_addr_Zap(iface->name, iface->in_addr + n);
-
- iface->in_addrs = addrs;
- /* Don't bother realloc()ing - we have little to gain */
-}
-
-int
-iface_inAdd(struct iface *iface, struct in_addr ifa, struct in_addr mask,
- struct in_addr brd, int how)
-{
- int slot, s, chg;
- struct ifaliasreq ifra;
- struct sockaddr_in *me, *peer, *msk;
- struct iface_addr *addr;
-
- for (slot = 0; slot < iface->in_addrs; slot++)
- if (iface->in_addr[slot].ifa.s_addr == ifa.s_addr) {
- if (how & IFACE_FORCE_ADD)
- break;
- else
- /* errno = EEXIST; */
- return 0;
- }
-
- addr = (struct iface_addr *)realloc
- (iface->in_addr, (iface->in_addrs + 1) * sizeof iface->in_addr[0]);
- if (addr == NULL) {
- log_Printf(LogERROR, "iface_inAdd: realloc: %s\n", strerror(errno));
- return 0;
- }
- iface->in_addr = addr;
-
- s = ID0socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
- log_Printf(LogERROR, "iface_inAdd: socket(): %s\n", strerror(errno));
- return 0;
- }
-
- /*
- * We've gotta be careful here. If we try to add an address with the
- * same destination as an existing interface, nothing will work.
- * Instead, we tweak all previous address entries that match the
- * to-be-added destination to 255.255.255.255 (w/ a similar netmask).
- * There *may* be more than one - if the user has ``iface add''ed
- * stuff previously.
- */
- for (chg = 0; chg < iface->in_addrs; chg++) {
- if ((iface->in_addr[chg].brd.s_addr == brd.s_addr &&
- brd.s_addr != INADDR_BROADCAST) || chg == slot) {
- memset(&ifra, '\0', sizeof ifra);
- strncpy(ifra.ifra_name, iface->name, sizeof ifra.ifra_name - 1);
- me = (struct sockaddr_in *)&ifra.ifra_addr;
- msk = (struct sockaddr_in *)&ifra.ifra_mask;
- peer = (struct sockaddr_in *)&ifra.ifra_broadaddr;
- me->sin_family = msk->sin_family = peer->sin_family = AF_INET;
- me->sin_len = msk->sin_len = peer->sin_len = sizeof(struct sockaddr_in);
- me->sin_addr = iface->in_addr[chg].ifa;
- msk->sin_addr = iface->in_addr[chg].mask;
- peer->sin_addr = iface->in_addr[chg].brd;
- log_Printf(LogDEBUG, "Delete %s\n", inet_ntoa(me->sin_addr));
- ID0ioctl(s, SIOCDIFADDR, &ifra); /* Don't care if it fails... */
- if (chg != slot) {
- peer->sin_addr.s_addr = iface->in_addr[chg].brd.s_addr =
- msk->sin_addr.s_addr = iface->in_addr[chg].mask.s_addr =
- INADDR_BROADCAST;
- iface->in_addr[chg].bits = 32;
- log_Printf(LogDEBUG, "Add %s -> 255.255.255.255\n",
- inet_ntoa(me->sin_addr));
- if (ID0ioctl(s, SIOCAIFADDR, &ifra) < 0 && errno != EEXIST) {
- /* Oops - that's bad(ish) news ! We've lost an alias ! */
- log_Printf(LogERROR, "iface_inAdd: ioctl(SIOCAIFADDR): %s: %s\n",
- inet_ntoa(me->sin_addr), strerror(errno));
- iface->in_addrs--;
- bcopy(iface->in_addr + chg + 1, iface->in_addr + chg,
- (iface->in_addrs - chg) * sizeof iface->in_addr[0]);
- if (slot > chg)
- slot--;
- chg--;
- }
- }
- }
- }
-
- memset(&ifra, '\0', sizeof ifra);
- strncpy(ifra.ifra_name, iface->name, sizeof ifra.ifra_name - 1);
- me = (struct sockaddr_in *)&ifra.ifra_addr;
- msk = (struct sockaddr_in *)&ifra.ifra_mask;
- peer = (struct sockaddr_in *)&ifra.ifra_broadaddr;
- me->sin_family = msk->sin_family = peer->sin_family = AF_INET;
- me->sin_len = msk->sin_len = peer->sin_len = sizeof(struct sockaddr_in);
- me->sin_addr = ifa;
- msk->sin_addr = mask;
- peer->sin_addr = brd;
-
- if (log_IsKept(LogDEBUG)) {
- char buf[16];
-
- strncpy(buf, inet_ntoa(brd), sizeof buf-1);
- buf[sizeof buf - 1] = '\0';
- log_Printf(LogDEBUG, "Add %s -> %s\n", inet_ntoa(ifa), buf);
- }
-
- /* An EEXIST failure w/ brd == INADDR_BROADCAST is ok (and works!) */
- if (ID0ioctl(s, SIOCAIFADDR, &ifra) < 0 &&
- (brd.s_addr != INADDR_BROADCAST || errno != EEXIST)) {
- log_Printf(LogERROR, "iface_inAdd: ioctl(SIOCAIFADDR): %s: %s\n",
- inet_ntoa(ifa), strerror(errno));
- ID0ioctl(s, SIOCDIFADDR, &ifra); /* EEXIST ? */
- close(s);
- return 0;
- }
- close(s);
-
- if (slot == iface->in_addrs) {
- /* We're adding a new interface address */
-
- if (how & IFACE_ADD_FIRST) {
- /* Stuff it at the start of our list */
- slot = 0;
- bcopy(iface->in_addr, iface->in_addr + 1,
- iface->in_addrs * sizeof iface->in_addr[0]);
- }
-
- iface->in_addrs++;
- } else if (how & IFACE_ADD_FIRST) {
- /* Shift it up to the first slot */
- bcopy(iface->in_addr, iface->in_addr + 1, slot * sizeof iface->in_addr[0]);
- slot = 0;
- }
-
- iface->in_addr[slot].ifa = ifa;
- iface->in_addr[slot].mask = mask;
- iface->in_addr[slot].brd = brd;
- iface->in_addr[slot].bits = bitsinmask(iface->in_addr[slot].mask);
-
- return 1;
-}
-
-int
-iface_inDelete(struct iface *iface, struct in_addr ip)
-{
- int n;
-
- for (n = 0; n < iface->in_addrs; n++)
- if (iface->in_addr[n].ifa.s_addr == ip.s_addr) {
- iface_addr_Zap(iface->name, iface->in_addr + n);
- bcopy(iface->in_addr + n + 1, iface->in_addr + n,
- (iface->in_addrs - n - 1) * sizeof iface->in_addr[0]);
- iface->in_addrs--;
- return 1;
- }
-
- return 0;
-}
-
-void
-iface_Destroy(struct iface *iface)
-{
- /*
- * iface_Clear(iface, IFACE_CLEAR_ALL) must be called manually
- * if that's what the user wants. It's better to leave the interface
- * allocated so that existing connections can continue to work.
- */
-
- if (iface != NULL) {
- free(iface->name);
- free(iface->in_addr);
- free(iface);
- }
-}
-
-#define if_entry(x) { IFF_##x, #x }
-
-struct {
- int flag;
- const char *value;
-} if_flags[] = {
- if_entry(UP),
- if_entry(BROADCAST),
- if_entry(DEBUG),
- if_entry(LOOPBACK),
- if_entry(POINTOPOINT),
- if_entry(RUNNING),
- if_entry(NOARP),
- if_entry(PROMISC),
- if_entry(ALLMULTI),
- if_entry(OACTIVE),
- if_entry(SIMPLEX),
- if_entry(LINK0),
- if_entry(LINK1),
- if_entry(LINK2),
- if_entry(MULTICAST),
- { 0, "???" }
-};
-
-int
-iface_Show(struct cmdargs const *arg)
-{
- struct iface *iface = arg->bundle->iface, *current;
- int f, flags;
-
- current = iface_Create(iface->name);
- flags = iface->flags = current->flags;
- iface_Destroy(current);
-
- prompt_Printf(arg->prompt, "%s (idx %d) <", iface->name, iface->index);
- for (f = 0; f < sizeof if_flags / sizeof if_flags[0]; f++)
- if ((if_flags[f].flag & flags) || (!if_flags[f].flag && flags)) {
- prompt_Printf(arg->prompt, "%s%s", flags == iface->flags ? "" : ",",
- if_flags[f].value);
- flags &= ~if_flags[f].flag;
- }
- prompt_Printf(arg->prompt, "> has %d address%s:\n", iface->in_addrs,
- iface->in_addrs == 1 ? "" : "es");
-
- for (f = 0; f < iface->in_addrs; f++) {
- prompt_Printf(arg->prompt, " %s", inet_ntoa(iface->in_addr[f].ifa));
- if (iface->in_addr[f].bits >= 0)
- prompt_Printf(arg->prompt, "/%d", iface->in_addr[f].bits);
- if (iface->flags & IFF_POINTOPOINT)
- prompt_Printf(arg->prompt, " -> %s", inet_ntoa(iface->in_addr[f].brd));
- else if (iface->flags & IFF_BROADCAST)
- prompt_Printf(arg->prompt, " broadcast %s",
- inet_ntoa(iface->in_addr[f].brd));
- if (iface->in_addr[f].bits < 0)
- prompt_Printf(arg->prompt, " (mask %s)",
- inet_ntoa(iface->in_addr[f].mask));
- prompt_Printf(arg->prompt, "\n");
- }
-
- return 0;
-}
diff --git a/usr.sbin/ppp/iface.h b/usr.sbin/ppp/iface.h
deleted file mode 100644
index f3b1dade5ee9..000000000000
--- a/usr.sbin/ppp/iface.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1998 Brian Somers <brian@Awfulhak.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.
- *
- * $Id:$
- */
-
-struct iface_addr {
- struct in_addr ifa; /* local address */
- struct in_addr mask; /* netmask */
- int bits; /* netmask bits - -1 if not contiguous */
- struct in_addr brd; /* peer address */
-};
-
-struct iface {
- char *name; /* Interface name (malloc'd) */
- int index; /* Interface index */
- int flags; /* Interface flags (IFF_*) */
-
- int in_addrs; /* How many in_addr's */
- struct iface_addr *in_addr; /* Array of addresses (malloc'd) */
-};
-
-#define IFACE_CLEAR_ALL 0 /* Nuke 'em all */
-#define IFACE_CLEAR_ALIASES 1 /* Leave the IPCP address */
-
-#define IFACE_ADD_LAST 0 /* Just another alias */
-#define IFACE_ADD_FIRST 1 /* The IPCP address */
-#define IFACE_FORCE_ADD 2 /* OR'd with IFACE_ADD_{FIRST,LAST} */
-
-#define iface_Clear iface_inClear /* Same for now */
-
-extern struct iface *iface_Create(const char *name);
-extern void iface_inClear(struct iface *, int);
-extern int iface_inAdd(struct iface *, struct in_addr, struct in_addr,
- struct in_addr, int);
-extern int iface_inDelete(struct iface *, struct in_addr);
-extern int iface_Show(struct cmdargs const *);
-extern void iface_Destroy(struct iface *);
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index aa7207de1d88..a7ffb306e63d 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.53 1998/09/17 00:45:26 brian Exp $
+ * $Id: ip.c,v 1.52 1998/08/26 17:39:37 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -160,14 +160,10 @@ FilterCheck(struct ip *pip, struct filter *filter)
estab = (th->th_flags & TH_ACK);
syn = (th->th_flags & TH_SYN);
finrst = (th->th_flags & (TH_FIN|TH_RST));
- if (log_IsKept(LogDEBUG)) {
- if (!estab)
- snprintf(dbuff, sizeof dbuff,
- "flags = %02x, sport = %d, dport = %d",
- th->th_flags, sport, dport);
- else
- *dbuff = '\0';
- }
+ if (log_IsKept(LogDEBUG) && !estab)
+ snprintf(dbuff, sizeof dbuff,
+ "flags = %02x, sport = %d, dport = %d",
+ th->th_flags, sport, dport);
break;
default:
return (A_DENY); /* We'll block unknown type of packet */
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index eae5f4c93ed1..40e1dfa2313d 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.67 1998/10/22 02:32:49 brian Exp $
+ * $Id: ipcp.c,v 1.65 1998/09/04 18:25:59 brian Exp $
*
* TODO:
* o More RFC1772 backward compatibility
@@ -28,12 +28,10 @@
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <sys/socket.h>
-#include <net/route.h>
#include <netdb.h>
#include <net/if.h>
#include <sys/sockio.h>
#include <sys/un.h>
-#include <arpa/nameser.h>
#include <fcntl.h>
#include <resolv.h>
@@ -79,7 +77,6 @@
#include "systems.h"
#include "prompt.h"
#include "route.h"
-#include "iface.h"
#undef REJECTED
#define REJECTED(p, x) ((p)->peer_reject & (1<<(x)))
@@ -357,8 +354,11 @@ ipcp_Init(struct ipcp *ipcp, struct bundle *bundle, struct link *l,
memset(&ipcp->cfg.my_range, '\0', sizeof ipcp->cfg.my_range);
if (gethostname(name, sizeof name) == 0) {
hp = gethostbyname(name);
- if (hp && hp->h_addrtype == AF_INET)
+ if (hp && hp->h_addrtype == AF_INET) {
memcpy(&ipcp->cfg.my_range.ipaddr.s_addr, hp->h_addr, hp->h_length);
+ ipcp->cfg.peer_range.mask.s_addr = INADDR_BROADCAST;
+ ipcp->cfg.peer_range.width = 32;
+ }
}
ipcp->cfg.netmask.s_addr = INADDR_ANY;
memset(&ipcp->cfg.peer_range, '\0', sizeof ipcp->cfg.peer_range);
@@ -376,6 +376,9 @@ ipcp_Init(struct ipcp *ipcp, struct bundle *bundle, struct link *l,
memset(&ipcp->vj, '\0', sizeof ipcp->vj);
+ ipcp->my_ifip.s_addr = INADDR_ANY;
+ ipcp->peer_ifip.s_addr = INADDR_ANY;
+
throughput_init(&ipcp->throughput);
memset(ipcp->Queue, '\0', sizeof ipcp->Queue);
ipcp_Setup(ipcp);
@@ -390,26 +393,17 @@ ipcp_SetLink(struct ipcp *ipcp, struct link *l)
void
ipcp_Setup(struct ipcp *ipcp)
{
- struct iface *iface = ipcp->fsm.bundle->iface;
- int pos, n;
+ int pos;
ipcp->fsm.open_mode = 0;
ipcp->fsm.maxconfig = 10;
if (iplist_isvalid(&ipcp->cfg.peer_list)) {
- /* Try to give the peer a previously configured IP address */
- for (n = 0; n < iface->in_addrs; n++) {
- pos = iplist_ip2pos(&ipcp->cfg.peer_list, iface->in_addr[n].brd);
- if (pos != -1) {
- ipcp->cfg.peer_range.ipaddr =
- iplist_setcurpos(&ipcp->cfg.peer_list, pos);
- break;
- }
- }
- if (n == iface->in_addrs)
- /* Ok, so none of 'em fit.... pick a random one */
+ if (ipcp->my_ifip.s_addr != INADDR_ANY &&
+ (pos = iplist_ip2pos(&ipcp->cfg.peer_list, ipcp->my_ifip)) != -1)
+ ipcp->cfg.peer_range.ipaddr = iplist_setcurpos(&ipcp->cfg.peer_list, pos);
+ else
ipcp->cfg.peer_range.ipaddr = iplist_setrandpos(&ipcp->cfg.peer_list);
-
ipcp->cfg.peer_range.mask.s_addr = INADDR_BROADCAST;
ipcp->cfg.peer_range.width = 32;
}
@@ -428,23 +422,17 @@ ipcp_Setup(struct ipcp *ipcp)
ipcp->my_ip = ipcp->cfg.TriggerAddress;
log_Printf(LogIPCP, "Using trigger address %s\n",
inet_ntoa(ipcp->cfg.TriggerAddress));
- } else {
+ } else if ((ipcp->my_ifip.s_addr & ipcp->cfg.my_range.mask.s_addr) ==
+ (ipcp->cfg.my_range.ipaddr.s_addr &
+ ipcp->cfg.my_range.mask.s_addr))
/*
- * Otherwise, if we've used an IP number before and it's still within
- * the network specified on the ``set ifaddr'' line, we really
- * want to keep that IP number so that we can keep any existing
- * connections that are bound to that IP (assuming we're not
- * ``iface-alias''ing).
+ * Otherwise, if we've been assigned an IP number before, we really
+ * want to keep the same IP number so that we can keep any existing
+ * connections that are bound to that IP.
*/
- for (n = 0; n < iface->in_addrs; n++)
- if ((iface->in_addr[n].ifa.s_addr & ipcp->cfg.my_range.mask.s_addr) ==
- (ipcp->cfg.my_range.ipaddr.s_addr & ipcp->cfg.my_range.mask.s_addr)) {
- ipcp->my_ip = iface->in_addr[n].ifa;
- break;
- }
- if (n == iface->in_addrs)
- ipcp->my_ip = ipcp->cfg.my_range.ipaddr;
- }
+ ipcp->my_ip = ipcp->my_ifip;
+ else
+ ipcp->my_ip = ipcp->cfg.my_range.ipaddr;
if (IsEnabled(ipcp->cfg.vj.neg))
ipcp->my_compproto = (PROTO_VJCOMP << 16) +
@@ -459,90 +447,84 @@ ipcp_Setup(struct ipcp *ipcp)
}
static int
-ipcp_doproxyall(struct bundle *bundle,
- int (*proxyfun)(struct bundle *, struct in_addr, int), int s)
+ipcp_SetIPaddress(struct bundle *bundle, struct in_addr myaddr,
+ struct in_addr hisaddr, int silent)
{
- int n, ret;
- struct sticky_route *rp;
- struct in_addr addr;
- struct ipcp *ipcp;
-
- ipcp = &bundle->ncp.ipcp;
- for (rp = ipcp->route; rp != NULL; rp = rp->next) {
- if (ntohl(rp->mask.s_addr) == INADDR_BROADCAST)
- continue;
- n = INADDR_BROADCAST - ntohl(rp->mask.s_addr) - 1;
- if (n > 0 && n <= 254 && rp->dst.s_addr != INADDR_ANY) {
- addr = rp->dst;
- while (n--) {
- addr.s_addr = htonl(ntohl(addr.s_addr) + 1);
- log_Printf(LogDEBUG, "ipcp_doproxyall: %s\n", inet_ntoa(addr));
- ret = (*proxyfun)(bundle, addr, s);
- if (!ret)
- return ret;
- }
- }
+ struct sockaddr_in *sock_in;
+ int s;
+ u_int32_t mask, addr;
+ struct ifaliasreq ifra;
+
+ /* If given addresses are alreay set, then ignore this request */
+ if (bundle->ncp.ipcp.my_ifip.s_addr == myaddr.s_addr &&
+ bundle->ncp.ipcp.peer_ifip.s_addr == hisaddr.s_addr)
+ return 0;
+
+ ipcp_CleanInterface(&bundle->ncp.ipcp);
+
+ s = ID0socket(AF_INET, SOCK_DGRAM, 0);
+ if (s < 0) {
+ log_Printf(LogERROR, "SetIPaddress: socket(): %s\n", strerror(errno));
+ return (-1);
}
- return 0;
-}
+ memset(&ifra, '\0', sizeof ifra);
+ strncpy(ifra.ifra_name, bundle->ifp.Name, sizeof ifra.ifra_name - 1);
+ ifra.ifra_name[sizeof ifra.ifra_name - 1] = '\0';
-static int
-ipcp_SetIPaddress(struct bundle *bundle, struct in_addr myaddr,
- struct in_addr hisaddr, int silent)
-{
- static struct in_addr none = { INADDR_ANY };
- struct in_addr mask, oaddr;
- u_int32_t addr;
+ /* Set interface address */
+ sock_in = (struct sockaddr_in *)&ifra.ifra_addr;
+ sock_in->sin_family = AF_INET;
+ sock_in->sin_addr = myaddr;
+ sock_in->sin_len = sizeof *sock_in;
- addr = htonl(myaddr.s_addr);
+ /* Set destination address */
+ sock_in = (struct sockaddr_in *)&ifra.ifra_broadaddr;
+ sock_in->sin_family = AF_INET;
+ sock_in->sin_addr = hisaddr;
+ sock_in->sin_len = sizeof *sock_in;
+
+ addr = ntohl(myaddr.s_addr);
if (IN_CLASSA(addr))
- mask.s_addr = htonl(IN_CLASSA_NET);
+ mask = IN_CLASSA_NET;
else if (IN_CLASSB(addr))
- mask.s_addr = htonl(IN_CLASSB_NET);
+ mask = IN_CLASSB_NET;
else
- mask.s_addr = htonl(IN_CLASSC_NET);
+ mask = IN_CLASSC_NET;
+ /* if subnet mask is given, use it instead of class mask */
if (bundle->ncp.ipcp.cfg.netmask.s_addr != INADDR_ANY &&
- (ntohl(bundle->ncp.ipcp.cfg.netmask.s_addr) & mask.s_addr) == mask.s_addr)
- mask.s_addr = htonl(bundle->ncp.ipcp.cfg.netmask.s_addr);
-
- oaddr.s_addr = bundle->iface->in_addrs ?
- bundle->iface->in_addr[0].ifa.s_addr : INADDR_ANY;
- if (!iface_inAdd(bundle->iface, myaddr, mask, hisaddr,
- IFACE_ADD_FIRST|IFACE_FORCE_ADD))
- return -1;
-
- if (!Enabled(bundle, OPT_IFACEALIAS) && bundle->iface->in_addrs > 1
- && myaddr.s_addr != oaddr.s_addr)
- /* Nuke the old one */
- iface_inDelete(bundle->iface, oaddr);
-
- if (bundle->ncp.ipcp.cfg.sendpipe > 0 || bundle->ncp.ipcp.cfg.recvpipe > 0)
- bundle_SetRoute(bundle, RTM_CHANGE, hisaddr, myaddr, none, 0, 0);
+ (ntohl(bundle->ncp.ipcp.cfg.netmask.s_addr) & mask) == mask)
+ mask = ntohl(bundle->ncp.ipcp.cfg.netmask.s_addr);
+
+ sock_in = (struct sockaddr_in *)&ifra.ifra_mask;
+ sock_in->sin_family = AF_INET;
+ sock_in->sin_addr.s_addr = htonl(mask);
+ sock_in->sin_len = sizeof *sock_in;
+
+ if (ID0ioctl(s, SIOCAIFADDR, &ifra) < 0) {
+ if (!silent)
+ log_Printf(LogERROR, "SetIPaddress: ioctl(SIOCAIFADDR): %s\n",
+ strerror(errno));
+ close(s);
+ return (-1);
+ }
if (Enabled(bundle, OPT_SROUTES))
route_Change(bundle, bundle->ncp.ipcp.route, myaddr, hisaddr);
- if (Enabled(bundle, OPT_PROXY) || Enabled(bundle, OPT_PROXYALL)) {
- int s = ID0socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- log_Printf(LogERROR, "ipcp_SetIPaddress: socket(): %s\n",
- strerror(errno));
- else {
- if (Enabled(bundle, OPT_PROXYALL))
- ipcp_doproxyall(bundle, arp_SetProxy, s);
- else if (Enabled(bundle, OPT_PROXY))
- arp_SetProxy(bundle, hisaddr, s);
- close(s);
- }
- }
+ bundle->ncp.ipcp.peer_ifip.s_addr = hisaddr.s_addr;
+ bundle->ncp.ipcp.my_ifip.s_addr = myaddr.s_addr;
- return 0;
+ if (Enabled(bundle, OPT_PROXY))
+ arp_SetProxy(bundle, bundle->ncp.ipcp.peer_ifip, s);
+
+ close(s);
+ return (0);
}
static struct in_addr
-ChooseHisAddr(struct bundle *bundle, struct in_addr gw)
+ChooseHisAddr(struct bundle *bundle, const struct in_addr gw)
{
struct in_addr try;
u_long f;
@@ -657,26 +639,40 @@ IpcpLayerFinish(struct fsm *fp)
void
ipcp_CleanInterface(struct ipcp *ipcp)
{
- struct iface *iface = ipcp->fsm.bundle->iface;
+ struct ifaliasreq ifra;
+ struct sockaddr_in *me, *peer;
+ int s;
+
+ s = ID0socket(AF_INET, SOCK_DGRAM, 0);
+ if (s < 0) {
+ log_Printf(LogERROR, "ipcp_CleanInterface: socket: %s\n", strerror(errno));
+ return;
+ }
route_Clean(ipcp->fsm.bundle, ipcp->route);
- if (iface->in_addrs && (Enabled(ipcp->fsm.bundle, OPT_PROXY) ||
- Enabled(ipcp->fsm.bundle, OPT_PROXYALL))) {
- int s = ID0socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- log_Printf(LogERROR, "ipcp_CleanInterface: socket: %s\n",
- strerror(errno));
- else {
- if (Enabled(ipcp->fsm.bundle, OPT_PROXYALL))
- ipcp_doproxyall(ipcp->fsm.bundle, arp_ClearProxy, s);
- else if (Enabled(ipcp->fsm.bundle, OPT_PROXY))
- arp_ClearProxy(ipcp->fsm.bundle, iface->in_addr[0].brd, s);
- close(s);
- }
+ if (Enabled(ipcp->fsm.bundle, OPT_PROXY))
+ arp_ClearProxy(ipcp->fsm.bundle, ipcp->peer_ifip, s);
+
+ if (ipcp->my_ifip.s_addr != INADDR_ANY ||
+ ipcp->peer_ifip.s_addr != INADDR_ANY) {
+ memset(&ifra, '\0', sizeof ifra);
+ strncpy(ifra.ifra_name, ipcp->fsm.bundle->ifp.Name,
+ sizeof ifra.ifra_name - 1);
+ ifra.ifra_name[sizeof ifra.ifra_name - 1] = '\0';
+ me = (struct sockaddr_in *)&ifra.ifra_addr;
+ peer = (struct sockaddr_in *)&ifra.ifra_broadaddr;
+ me->sin_family = peer->sin_family = AF_INET;
+ me->sin_len = peer->sin_len = sizeof(struct sockaddr_in);
+ me->sin_addr = ipcp->my_ifip;
+ peer->sin_addr = ipcp->peer_ifip;
+ if (ID0ioctl(s, SIOCDIFADDR, &ifra) < 0)
+ log_Printf(LogERROR, "ipcp_CleanInterface: ioctl(SIOCDIFADDR): %s\n",
+ strerror(errno));
+ ipcp->my_ifip.s_addr = ipcp->peer_ifip.s_addr = INADDR_ANY;
}
- iface_inClear(ipcp->fsm.bundle->iface, IFACE_CLEAR_ALL);
+ close(s);
}
static void
@@ -686,10 +682,7 @@ IpcpLayerDown(struct fsm *fp)
struct ipcp *ipcp = fsm2ipcp(fp);
const char *s;
- if (ipcp->fsm.bundle->iface->in_addrs)
- s = inet_ntoa(ipcp->fsm.bundle->iface->in_addr[0].ifa);
- else
- s = "Interface configuration error !";
+ s = inet_ntoa(ipcp->peer_ifip);
log_Printf(LogIPCP, "%s: LayerDown: %s\n", fp->link->name, s);
/*
@@ -705,6 +698,9 @@ IpcpLayerDown(struct fsm *fp)
system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
}
+ if (!(ipcp->fsm.bundle->phys_type.all & PHYS_AUTO))
+ ipcp_CleanInterface(ipcp);
+
ipcp_Setup(ipcp);
}
@@ -729,12 +725,11 @@ IpcpLayerUp(struct fsm *fp)
{
/* We're now up */
struct ipcp *ipcp = fsm2ipcp(fp);
- char tbuff[16];
+ char tbuff[100];
log_Printf(LogIPCP, "%s: LayerUp.\n", fp->link->name);
- snprintf(tbuff, sizeof tbuff, "%s", inet_ntoa(ipcp->my_ip));
- log_Printf(LogIPCP, "myaddr %s hisaddr = %s\n",
- tbuff, inet_ntoa(ipcp->peer_ip));
+ snprintf(tbuff, sizeof tbuff, "myaddr = %s ", inet_ntoa(ipcp->my_ip));
+ log_Printf(LogIPCP, " %s hisaddr = %s\n", tbuff, inet_ntoa(ipcp->peer_ip));
if (ipcp->peer_compproto >> 16 == PROTO_VJCOMP)
sl_compress_init(&ipcp->vj.cslc, (ipcp->peer_compproto >> 8) & 255);
@@ -746,7 +741,8 @@ IpcpLayerUp(struct fsm *fp)
* XXX this stuff should really live in the FSM. Our config should
* associate executable sections in files with events.
*/
- if (system_Select(fp->bundle, tbuff, LINKUPFILE, NULL, NULL) < 0) {
+ if (system_Select(fp->bundle, inet_ntoa(ipcp->my_ifip), LINKUPFILE,
+ NULL, NULL) < 0) {
if (bundle_GetLabel(fp->bundle)) {
if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
LINKUPFILE, NULL, NULL) < 0)
@@ -760,7 +756,7 @@ IpcpLayerUp(struct fsm *fp)
}
static int
-AcceptableAddr(const struct in_range *prange, struct in_addr ipaddr)
+AcceptableAddr(struct in_range *prange, struct in_addr ipaddr)
{
/* Is the given IP in the given range ? */
return (prange->ipaddr.s_addr & prange->mask.s_addr) ==
@@ -772,13 +768,13 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
struct fsm_decode *dec)
{
/* Deal with incoming PROTO_IPCP */
- struct iface *iface = fp->bundle->iface;
struct ipcp *ipcp = fsm2ipcp(fp);
- int type, length, gotdns, gotdnsnak, n;
+ int type, length;
u_int32_t compproto;
struct compreq *pcomp;
struct in_addr ipaddr, dstipaddr, have_ip, dns[2], dnsnak[2];
char tbuff[100], tbuff2[100];
+ int gotdns, gotdnsnak;
gotdns = 0;
gotdnsnak = 0;
@@ -814,19 +810,14 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
ipaddr, 1)) {
log_Printf(LogIPCP, "%s: Address invalid or already in use\n",
inet_ntoa(ipaddr));
- /*
- * If we've already had a valid address configured for the peer,
- * try NAKing with that so that we don't have to upset things
- * too much.
- */
- for (n = 0; n < iface->in_addrs; n++)
- if (iplist_ip2pos(&ipcp->cfg.peer_list, iface->in_addr[n].brd)
- >=0) {
- ipcp->peer_ip = iface->in_addr[n].brd;
- break;
- }
-
- if (n == iface->in_addrs)
+ if (iplist_ip2pos(&ipcp->cfg.peer_list, ipcp->peer_ifip) >= 0)
+ /*
+ * If we've already got a valid address configured for the peer
+ * (in AUTO mode), try NAKing with that so that we don't
+ * have to upset things too much.
+ */
+ ipcp->peer_ip = ipcp->peer_ifip;
+ else
/* Just pick an IP number from our list */
ipcp->peer_ip = ChooseHisAddr
(fp->bundle, ipcp->cfg.my_range.ipaddr);
@@ -836,7 +827,7 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
dec->rejend += length;
} else {
memcpy(dec->nakend, cp, 2);
- memcpy(dec->nakend + 2, &ipcp->peer_ip.s_addr, length - 2);
+ memcpy(dec->nakend+2, &ipcp->peer_ip.s_addr, length - 2);
dec->nakend += length;
}
break;
@@ -847,20 +838,13 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
* want to use.
*/
memcpy(dec->nakend, cp, 2);
- for (n = 0; n < iface->in_addrs; n++)
- if ((iface->in_addr[n].brd.s_addr &
- ipcp->cfg.peer_range.mask.s_addr)
- == (ipcp->cfg.peer_range.ipaddr.s_addr &
- ipcp->cfg.peer_range.mask.s_addr)) {
- /* We prefer the already-configured address */
- memcpy(dec->nakend + 2, &iface->in_addr[n].brd.s_addr,
- length - 2);
- break;
- }
-
- if (n == iface->in_addrs)
- memcpy(dec->nakend + 2, &ipcp->peer_ip.s_addr, length - 2);
-
+ if ((ipcp->peer_ifip.s_addr & ipcp->cfg.peer_range.mask.s_addr) ==
+ (ipcp->cfg.peer_range.ipaddr.s_addr &
+ ipcp->cfg.peer_range.mask.s_addr))
+ /* We prefer the already-configured address */
+ memcpy(dec->nakend+2, &ipcp->peer_ifip.s_addr, length - 2);
+ else
+ memcpy(dec->nakend+2, &ipcp->peer_ip.s_addr, length - 2);
dec->nakend += length;
break;
}
@@ -868,7 +852,6 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
memcpy(dec->ackend, cp, length);
dec->ackend += length;
break;
-
case MODE_NAK:
if (AcceptableAddr(&ipcp->cfg.my_range, ipaddr)) {
/* Use address suggested by peer */
@@ -882,13 +865,11 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
fsm_Close(&ipcp->fsm);
}
break;
-
case MODE_REJ:
ipcp->peer_reject |= (1 << type);
break;
}
break;
-
case TY_COMPPROTO:
memcpy(&compproto, cp + 2, 4);
log_Printf(LogIPCP, "%s %s\n", tbuff, vj2asc(compproto));
@@ -939,19 +920,16 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
}
}
break;
-
case MODE_NAK:
log_Printf(LogIPCP, "%s changing compproto: %08x --> %08x\n",
tbuff, ipcp->my_compproto, compproto);
ipcp->my_compproto = compproto;
break;
-
case MODE_REJ:
ipcp->peer_reject |= (1 << type);
break;
}
break;
-
case TY_IPADDRS: /* RFC1172 */
memcpy(&ipaddr.s_addr, cp + 2, 4);
memcpy(&dstipaddr.s_addr, cp + 6, 4);
@@ -965,7 +943,6 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
memcpy(dec->ackend, cp, length);
dec->ackend += length;
break;
-
case MODE_NAK:
snprintf(tbuff2, sizeof tbuff2, "%s changing address: %s", tbuff,
inet_ntoa(ipcp->my_ip));
@@ -973,7 +950,6 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
ipcp->my_ip = ipaddr;
ipcp->peer_ip = dstipaddr;
break;
-
case MODE_REJ:
ipcp->peer_reject |= (1 << type);
break;
@@ -1019,14 +995,12 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
dec->ackend += length;
}
break;
-
case MODE_NAK: /* what does this mean?? */
if (IsEnabled(ipcp->cfg.ns.dns_neg)) {
gotdnsnak = 1;
memcpy(&dnsnak[type == TY_PRIMARY_DNS ? 0 : 1].s_addr, cp + 2, 4);
}
break;
-
case MODE_REJ: /* Can't do much, stop asking */
ipcp->peer_reject |= (1 << (type - TY_ADJUST_NS));
break;
@@ -1060,11 +1034,9 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
dec->ackend += length;
}
break;
-
case MODE_NAK:
log_Printf(LogIPCP, "MS NBNS req %d - NAK??\n", type);
break;
-
case MODE_REJ:
log_Printf(LogIPCP, "MS NBNS req %d - REJ??\n", type);
break;
@@ -1144,8 +1116,11 @@ ipcp_UseHisaddr(struct bundle *bundle, const char *hisaddr, int setaddr)
ipcp->peer_ip.s_addr = ipcp->cfg.peer_range.ipaddr.s_addr;
if (setaddr && ipcp_SetIPaddress(bundle, ipcp->cfg.my_range.ipaddr,
- ipcp->cfg.peer_range.ipaddr, 0) < 0)
+ ipcp->cfg.peer_range.ipaddr, 0) < 0) {
+ ipcp->cfg.my_range.ipaddr.s_addr = INADDR_ANY;
+ ipcp->cfg.peer_range.ipaddr.s_addr = INADDR_ANY;
return 0;
+ }
} else
return 0;
diff --git a/usr.sbin/ppp/ipcp.h b/usr.sbin/ppp/ipcp.h
index 5b5fc9bccd50..c0a025ec5deb 100644
--- a/usr.sbin/ppp/ipcp.h
+++ b/usr.sbin/ppp/ipcp.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.h,v 1.21 1998/10/22 02:32:49 brian Exp $
+ * $Id: ipcp.h,v 1.19 1998/05/21 21:45:49 brian Exp $
*
* TODO:
*/
@@ -57,9 +57,6 @@ struct ipcp {
struct in_range peer_range; /* HISADDR spec */
struct iplist peer_list; /* Ranges of HISADDR values */
- u_long sendpipe; /* route sendpipe size */
- u_long recvpipe; /* route recvpipe size */
-
struct in_addr TriggerAddress; /* Address to suggest in REQ */
unsigned HaveTriggerAddress : 1; /* Trigger address specified */
@@ -90,6 +87,9 @@ struct ipcp {
u_int32_t peer_reject; /* Request codes rejected by peer */
u_int32_t my_reject; /* Request codes I have rejected */
+ struct in_addr my_ifip; /* My configured interface address */
+ struct in_addr peer_ifip; /* My congigured destination address */
+
struct pppThroughput throughput; /* throughput statistics */
struct mqueue Queue[PRI_FAST + 1]; /* Output packet queues */
};
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 10165fd1d24b..9591aef4a923 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.65 1998/10/17 12:28:02 brian Exp $
+ * $Id: lcp.c,v 1.63 1998/09/04 18:25:59 brian Exp $
*
* TODO:
* o Limit data field length by MRU
@@ -663,24 +663,13 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
#ifdef HAVE_DES
link2physical(fp->link)->dl->chap.using_MSChap = cp[4] == 0x80;
#endif
- } else {
- if (IsAccepted(lcp->cfg.chap)) {
-#ifndef HAVE_DES
- if (cp[4] == 0x80)
- log_Printf(LogWARN, "Chap 0x80 not available without DES\n");
- else
-#endif
- log_Printf(LogWARN, "Chap 0x%02x not supported\n",
- (unsigned)cp[4]);
- }
- if (IsAccepted(lcp->cfg.pap)) {
- *dec->nakend++ = *cp;
- *dec->nakend++ = 4;
- *dec->nakend++ = (unsigned char) (PROTO_PAP >> 8);
- *dec->nakend++ = (unsigned char) PROTO_PAP;
- } else
- goto reqreject;
- }
+ } else if (IsAccepted(lcp->cfg.pap)) {
+ *dec->nakend++ = *cp;
+ *dec->nakend++ = 4;
+ *dec->nakend++ = (unsigned char) (PROTO_PAP >> 8);
+ *dec->nakend++ = (unsigned char) PROTO_PAP;
+ } else
+ goto reqreject;
break;
default:
@@ -921,7 +910,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
goto reqreject;
break;
case MODE_NAK:
- /* We don't do what he NAKs with, we do things in our preferred order */
+ /* We don't do what he NAKs want, we do things in our preferred order */
if (lcp->want_callback.opmask & CALLBACK_BIT(CALLBACK_AUTH))
lcp->want_callback.opmask &= ~CALLBACK_BIT(CALLBACK_AUTH);
else if (lcp->want_callback.opmask & CALLBACK_BIT(CALLBACK_CBCP))
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index b9cf61d4f0fd..e092574fb071 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.145 1998/10/31 17:38:46 brian Exp $
+ * $Id: main.c,v 1.142 1998/08/09 09:13:54 brian Exp $
*
* TODO:
*/
@@ -75,7 +75,6 @@
#include "chap.h"
#include "cbcp.h"
#include "datalink.h"
-#include "iface.h"
#ifndef O_NONBLOCK
#ifdef O_NDELAY
@@ -179,27 +178,27 @@ Usage(void)
#ifndef NOALIAS
" [ -alias ]"
#endif
- " [system ...]\n");
+ " [system]\n");
exit(EX_START);
}
-static int
+static char *
ProcessArgs(int argc, char **argv, int *mode, int *alias)
{
- int optc, newmode, arg;
+ int optc, labelrequired, newmode;
char *cp;
- optc = 0;
+ optc = labelrequired = 0;
*mode = PHYS_INTERACTIVE;
*alias = 0;
- for (arg = 1; arg < argc && *argv[arg] == '-'; arg++, optc++) {
- cp = argv[arg] + 1;
+ while (argc > 0 && **argv == '-') {
+ cp = *argv + 1;
newmode = Nam2mode(cp);
switch (newmode) {
case PHYS_NONE:
if (strcmp(cp, "alias") == 0) {
#ifdef NOALIAS
- log_Printf(LogWARN, "Cannot load alias library (compiled out)\n");
+ log_Printf(LogWARN, "Cannot load alias library\n");
#else
*alias = 1;
#endif
@@ -212,9 +211,23 @@ ProcessArgs(int argc, char **argv, int *mode, int *alias)
Usage();
break;
+ case PHYS_AUTO:
+ case PHYS_BACKGROUND:
+ case PHYS_DDIAL:
+ labelrequired = 1;
+ /* fall through */
+
default:
*mode = newmode;
}
+ optc++;
+ argv++;
+ argc--;
+ }
+
+ if (argc > 1) {
+ fprintf(stderr, "You may specify only one system label.\n");
+ exit(EX_START);
}
if (optc > 1) {
@@ -222,36 +235,20 @@ ProcessArgs(int argc, char **argv, int *mode, int *alias)
exit(EX_START);
}
- if (*mode == PHYS_AUTO && arg == argc) {
- fprintf(stderr, "A system must be specified in auto mode.\n");
+ if (labelrequired && argc != 1) {
+ fprintf(stderr, "Destination system must be specified in"
+ " auto, background or ddial mode.\n");
exit(EX_START);
}
- return arg; /* Don't SetLabel yet ! */
+ return argc == 1 ? *argv : NULL; /* Don't SetLabel yet ! */
}
-static void
-CheckLabel(const char *label, struct prompt *prompt, int mode)
-{
- const char *err;
-
- if ((err = system_IsValid(label, prompt, mode)) != NULL) {
- fprintf(stderr, "You may not use ppp in this mode with this label\n");
- fprintf(stderr, "%s: %s\n", label, err);
- if (mode == PHYS_DIRECT)
- log_Printf(LogWARN, "Label %s rejected -direct connection: %s\n",
- label, err);
- log_Close();
- exit(1);
- }
-}
-
-
int
main(int argc, char **argv)
{
- char *name;
- int nfds, mode, alias, label, arg;
+ char *name, *label;
+ int nfds, mode, alias;
struct bundle *bundle;
struct prompt *prompt;
@@ -271,7 +268,7 @@ main(int argc, char **argv)
#ifndef NOALIAS
PacketAliasInit();
#endif
- label = ProcessArgs(argc, argv, &mode, &alias);
+ label = ProcessArgs(argc - 1, argv + 1, &mode, &alias);
#ifdef __FreeBSD__
/*
@@ -315,11 +312,16 @@ main(int argc, char **argv)
} while (ptr >= conf);
}
- if (label < argc)
- for (arg = label; arg < argc; arg++)
- CheckLabel(argv[arg], prompt, mode);
- else
- CheckLabel("default", prompt, mode);
+ if (!system_IsValid(label, prompt, mode)) {
+ fprintf(stderr, "You may not use ppp in this mode with this label\n");
+ if (mode == PHYS_DIRECT) {
+ const char *l;
+ l = label ? label : "default";
+ log_Printf(LogWARN, "Label %s rejected -direct connection\n", l);
+ }
+ log_Close();
+ return 1;
+ }
if ((bundle = bundle_Create(TUN_PREFIX, mode, (const char **)argv)) == NULL) {
log_Printf(LogWARN, "bundle_Create: %s\n", strerror(errno));
@@ -327,12 +329,10 @@ main(int argc, char **argv)
}
if (prompt) {
prompt->bundle = bundle; /* couldn't do it earlier */
- prompt_Printf(prompt, "Using interface: %s\n", bundle->iface->name);
+ prompt_Printf(prompt, "Using interface: %s\n", bundle->ifp.Name);
}
SignalBundle = bundle;
bundle->AliasEnabled = alias;
- if (alias)
- bundle->cfg.opt |= OPT_IFACEALIAS;
if (system_Select(bundle, "default", CONFFILE, prompt, NULL) < 0)
prompt_Printf(prompt, "Warning: No default entry found in config file.\n");
@@ -349,21 +349,25 @@ main(int argc, char **argv)
sig_signal(SIGUSR2, BringDownServer);
- for (arg = label; arg < argc; arg++) {
- /* In case we use LABEL or ``set enddisc label'' */
- bundle_SetLabel(bundle, argv[argc - 1]);
- system_Select(bundle, argv[arg], CONFFILE, prompt, NULL);
- }
-
- if (label < argc)
- /* In case the last label did a ``load'' */
- bundle_SetLabel(bundle, argv[argc - 1]);
-
- if (mode == PHYS_AUTO &&
- bundle->ncp.ipcp.cfg.peer_range.ipaddr.s_addr == INADDR_ANY) {
- prompt_Printf(prompt, "You must ``set ifaddr'' with a peer address "
- "in auto mode.\n");
- AbortProgram(EX_START);
+ if (label) {
+ /*
+ * Set label both before and after system_Select !
+ * This way, "set enddisc label" works during system_Select, and we
+ * also end up with the correct label if we have embedded load
+ * commands.
+ */
+ bundle_SetLabel(bundle, label);
+ if (system_Select(bundle, label, CONFFILE, prompt, NULL) < 0) {
+ prompt_Printf(prompt, "Destination system (%s) not found.\n", label);
+ AbortProgram(EX_START);
+ }
+ bundle_SetLabel(bundle, label);
+ if (mode == PHYS_AUTO &&
+ bundle->ncp.ipcp.cfg.peer_range.ipaddr.s_addr == INADDR_ANY) {
+ prompt_Printf(prompt, "You must \"set ifaddr\" with a peer address "
+ "in label %s for auto mode.\n", label);
+ AbortProgram(EX_START);
+ }
}
if (mode != PHYS_INTERACTIVE) {
@@ -515,12 +519,8 @@ DoLoop(struct bundle *bundle)
for (i = 0; i <= nfds; i++)
if (FD_ISSET(i, &efds)) {
- log_Printf(LogPHASE, "Exception detected on descriptor %d\n", i);
- /* We deal gracefully with link descriptor exceptions */
- if (!bundle_Exception(bundle, i)) {
- log_Printf(LogERROR, "Exception cannot be handled !\n");
- break;
- }
+ log_Printf(LogERROR, "Exception detected on descriptor %d\n", i);
+ break;
}
if (i <= nfds)
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c
index 6ffb5650632c..3c894929d06e 100644
--- a/usr.sbin/ppp/modem.c
+++ b/usr.sbin/ppp/modem.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: modem.c,v 1.99 1998/08/26 18:07:56 brian Exp $
+ * $Id: modem.c,v 1.98 1998/08/09 15:34:11 brian Exp $
*
* TODO:
*/
@@ -115,7 +115,7 @@ modem_Create(struct datalink *dl, int type)
p->fd = -1;
p->mbits = 0;
- p->isatty = 0;
+ p->dev_is_modem = 0;
p->out = NULL;
p->connect_count = 0;
p->dl = dl;
@@ -276,7 +276,7 @@ modem_Timeout(void *data)
timer_Stop(&modem->Timer);
timer_Start(&modem->Timer);
- if (modem->isatty || physical_IsSync(modem)) {
+ if (modem->dev_is_modem) {
if (modem->fd >= 0) {
if (ioctl(modem->fd, TIOCMGET, &modem->mbits) < 0) {
log_Printf(LogPHASE, "%s: ioctl error (%s)!\n", modem->link.name,
@@ -617,8 +617,8 @@ modem_Open(struct physical *modem, struct bundle *bundle)
* for further operation.
*/
modem->mbits = 0;
- modem->isatty = isatty(modem->fd);
- if (modem->isatty) {
+ modem->dev_is_modem = isatty(modem->fd) || physical_IsSync(modem);
+ if (modem->dev_is_modem && !physical_IsSync(modem)) {
tcgetattr(modem->fd, &rstio);
modem->ios = rstio;
log_Printf(LogDEBUG, "%s: Open: modem (get): fd = %d, iflag = %lx, "
@@ -679,7 +679,7 @@ modem_Speed(struct physical *modem)
{
struct termios rstio;
- if (!modem->isatty)
+ if (!physical_IsATTY(modem))
return 115200;
tcgetattr(modem->fd, &rstio);
@@ -697,7 +697,7 @@ modem_Raw(struct physical *modem, struct bundle *bundle)
log_Printf(LogDEBUG, "%s: Entering modem_Raw\n", modem->link.name);
- if (!modem->isatty || physical_IsSync(modem))
+ if (!isatty(modem->fd) || physical_IsSync(modem))
return 0;
if (modem->type != PHYS_DIRECT && modem->fd >= 0 && !Online(modem))
@@ -721,8 +721,7 @@ modem_Raw(struct physical *modem, struct bundle *bundle)
return (-1);
fcntl(modem->fd, F_SETFL, oldflag | O_NONBLOCK);
- if ((modem->isatty || physical_IsSync(modem)) &&
- ioctl(modem->fd, TIOCMGET, &modem->mbits) == 0 &&
+ if (modem->dev_is_modem && ioctl(modem->fd, TIOCMGET, &modem->mbits) == 0 &&
(modem->mbits & TIOCM_CD)) {
modem_StartTimer(bundle, modem);
modem_Timeout(modem);
@@ -738,7 +737,7 @@ modem_Unraw(struct physical *modem)
{
int oldflag;
- if (modem->isatty && !physical_IsSync(modem)) {
+ if (isatty(modem->fd) && !physical_IsSync(modem)) {
tcsetattr(modem->fd, TCSAFLUSH, &modem->ios);
oldflag = fcntl(modem->fd, F_GETFL, 0);
if (oldflag < 0)
@@ -776,7 +775,7 @@ modem_Offline(struct physical *modem)
timer_Stop(&modem->Timer);
modem->mbits &= ~TIOCM_DTR;
- if (modem->isatty && Online(modem)) {
+ if (isatty(modem->fd) && Online(modem)) {
tcgetattr(modem->fd, &tio);
if (cfsetspeed(&tio, B0) == -1)
log_Printf(LogWARN, "%s: Unable to set modem to speed 0\n",
@@ -797,7 +796,7 @@ modem_Close(struct physical *modem)
log_Printf(LogDEBUG, "%s: Close\n", modem->link.name);
- if (!modem->isatty) {
+ if (!isatty(modem->fd)) {
modem_PhysicalClose(modem);
*modem->name.full = '\0';
modem->name.base = modem->name.full;
@@ -877,7 +876,7 @@ modem_ShowStatus(struct cmdargs const *arg)
prompt_Printf(arg->prompt, "Name: %s\n", modem->link.name);
prompt_Printf(arg->prompt, " State: ");
if (modem->fd >= 0) {
- if (modem->isatty)
+ if (isatty(modem->fd))
prompt_Printf(arg->prompt, "open, %s carrier\n",
Online(modem) ? "with" : "no");
else
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index 201ce6692bd6..e9d38baafeac 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp.c,v 1.16 1998/09/04 18:25:59 brian Exp $
+ * $Id: mp.c,v 1.15 1998/08/26 17:39:37 brian Exp $
*/
#include <sys/types.h>
@@ -774,20 +774,9 @@ mp_SetEnddisc(struct cmdargs const *arg)
struct mp *mp = &arg->bundle->ncp.mp;
struct in_addr addr;
- switch (bundle_Phase(arg->bundle)) {
- case PHASE_DEAD:
- break;
- case PHASE_ESTABLISH:
- /* Make sure none of our links are DATALINK_LCP or greater */
- if (bundle_HighestState(arg->bundle) >= DATALINK_LCP) {
- log_Printf(LogWARN, "enddisc: Only changable before"
- " LCP negotiations\n");
- return 1;
- }
- break;
- default:
- log_Printf(LogWARN, "enddisc: Only changable at phase DEAD/ESTABLISH\n");
- return 1;
+ if (bundle_Phase(arg->bundle) != PHASE_DEAD) {
+ log_Printf(LogWARN, "set enddisc: Only available at phase DEAD\n");
+ return 1;
}
if (arg->argc == arg->argn) {
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index 875c4596e4df..680f487bcbbd 100644
--- a/usr.sbin/ppp/physical.c
+++ b/usr.sbin/ppp/physical.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: physical.c,v 1.6 1998/08/25 17:48:43 brian Exp $
+ * $Id: physical.c,v 1.5 1998/08/07 18:42:50 brian Exp $
*
*/
@@ -54,6 +54,11 @@ physical_GetFD(struct physical *phys) {
}
int
+physical_IsATTY(struct physical *phys) {
+ return isatty(phys->fd);
+}
+
+int
physical_IsSync(struct physical *phys) {
return phys->cfg.speed == 0;
}
@@ -180,7 +185,7 @@ physical_IsSet(struct descriptor *d, const fd_set *fdset)
void
physical_Login(struct physical *phys, const char *name)
{
- if (phys->type == PHYS_DIRECT && phys->isatty) {
+ if (phys->type == PHYS_DIRECT && physical_IsATTY(phys)) {
if (phys->Utmp)
log_Printf(LogERROR, "Oops, already logged in on %s\n", phys->name.base);
else {
diff --git a/usr.sbin/ppp/physical.h b/usr.sbin/ppp/physical.h
index bfd1c74aef33..2803248b407d 100644
--- a/usr.sbin/ppp/physical.h
+++ b/usr.sbin/ppp/physical.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: physical.h,v 1.4 1998/08/25 17:48:43 brian Exp $
+ * $Id: physical.h,v 1.3 1998/05/29 18:33:10 brian Exp $
*
*/
@@ -30,7 +30,11 @@ struct physical {
struct hdlc hdlc; /* Our hdlc state */
int fd; /* File descriptor for this device */
int mbits; /* Current DCD status */
- unsigned isatty : 1;
+ unsigned dev_is_modem : 1; /* Is the device an actual modem?
+ Faked for sync devices, though...
+ (Possibly this should be
+ dev_is_not_tcp?) XXX-ML */
+
struct mbuf *out; /* mbuf that suffered a short write */
int connect_count;
struct datalink *dl; /* my owner */
@@ -68,6 +72,7 @@ struct physical {
((d)->type == PHYSICAL_DESCRIPTOR ? field2phys(d, desc) : NULL)
extern int physical_GetFD(struct physical *);
+extern int physical_IsATTY(struct physical *);
extern int physical_IsSync(struct physical *);
extern const char *physical_GetDevice(struct physical *);
extern void physical_SetDeviceList(struct physical *, int, const char *const *);
diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8
index 31d12095a8ea..4ed85beb200a 100644
--- a/usr.sbin/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp.8
@@ -1,6 +1,5 @@
-.\" $Id: ppp.8,v 1.141 1999/01/19 22:15:41 brian Exp $
+.\" $Id: ppp.8,v 1.125 1998/09/17 00:45:12 brian Exp $
.Dd 20 September 1995
-.nr XX \w'\fC00'
.Os FreeBSD
.Dt PPP 8
.Sh NAME
@@ -16,7 +15,7 @@
.Fl dedicated
.Oc
.Op Fl alias
-.Op Ar system ...
+.Op Ar system
.Sh DESCRIPTION
This is a user process
.Em PPP
@@ -95,7 +94,7 @@ scripts that wish to execute certain commands only if the connection
is successfully established.
.It Supports server-side PPP connections.
In direct mode,
-.Nm
+.nm
acts as server which accepts incoming
.Em PPP
connections on stdin/stdout.
@@ -187,122 +186,6 @@ Refer to the
logging facility if you're interested in what exactly is done as user id
zero.
.Sh GETTING STARTED
-The following command line switches are understood by
-.Nm ppp :
-.Bl -tag -width XXX -offset XXX
-.It Fl auto
-.Nm Ppp
-opens the tun interface, configures it then goes into the background.
-The link isn't brought up until outgoing data is detected on the tun
-interface at which point
-.Nm
-attempts to bring up the link. Packets received (including the first one)
-while
-.Nm
-is trying to bring the link up will remain queued for a default of
-2 minutes. See the
-.Dq set choked
-command below.
-.Pp
-At least one
-.Dq system
-must be given on the command line (see below) and a
-.Dq set ifaddr
-must be done in the system profile that specifies a peer IP address to
-use when configuring the interface. Something like
-.Dq 10.0.0.1/0
-is usually appropriate. See the
-.Dq pmdemand
-system in
-.Pa /etc/ppp/ppp.conf.sample
-for an example.
-.It Fl background
-Here,
-.Nm
-attempts to establish a connection with the peer immediately. If it
-succeeds,
-.Nm
-goes into the background and the parent process returns an exit code
-of 0. If it fails,
-.Nm
-exits with a non-zero result.
-.It Fl direct
-This is used for receiving incoming connections.
-.Nm Ppp
-ignores the ``set device'' line and uses descriptor 0 as the link.
-.Pp
-If callback is configured,
-.Nm
-will use the
-.Dq set device
-information when dialing back.
-.It Fl dedicated
-This option is designed for machines connected with a dedicated
-wire.
-.Nm Ppp
-will always keep the device open and will never use any configured
-chat scripts.
-.It Fl ddial
-This mode is equivalent to
-.Fl auto
-mode except that
-.Nm
-will bring the link back up any time it's dropped for any reason.
-.It Fl interactive
-This is a no-op, and gives the same behaviour as if none of the above
-flags have been specified.
-.Nm Ppp
-loads any systems specified on the command line then provides an
-interactive prompt.
-.It Fl alias
-This flag doesn't control
-.Nm ppp Ns No 's
-mode. It does the equivalent of an
-.Dq enable alias yes .
-Additionally, if the
-.Fl auto
-flag is also specified, an implicit
-.Dq enable iface-alias
-is done.
-See below for details.
-.Pp
-Enabling IP aliasing allows
-.Nm ppp
-to act as a NAT or masquerading engine for all machines on an internal
-LAN. Refer to
-.Xr libalias 3
-for details.
-.El
-.Pp
-Additionally, one or more systems may be specified on the command line.
-A
-.Sq system
-is a configuration entry in
-.Pa /etc/ppp/ppp.conf .
-.Nm Ppp
-will read the
-.Dq default
-system from
-.Pa /etc/ppp/ppp.conf
-at startup, followed by each of the systems specifed on the command line.
-.Pp
-Only one of the
-.Fl auto ,
-.Fl background ,
-.Fl ddial ,
-.Fl direct ,
-.Fl dedicated
-and
-.Fl interactive
-switches may be specified.
-.Nm Ppp Ns No 's
-.Sq mode
-may subsequently be changed with the
-.Dq set mode
-command (see below).
-.Pp
-For now, we'll stick to using interactive mode.
-.Pp
When you first run
.Nm
you may need to deal with some initial configuration details.
@@ -340,7 +223,7 @@ file and that that group contains the names of all users expected to use
.Nm ppp .
Refer to the
.Xr group 5
-manual page for details. Each of these users must also be given access
+manual page for details. Each of these uses must also be given access
using the
.Dq allow users
command in
@@ -467,22 +350,16 @@ When the peer starts to talk in
.Nm
detects this automatically and returns to command mode.
.Bd -literal -offset indent
-ppp ON awfulhak> # No link has been established
-Ppp ON awfulhak> # We've connected & finished LCP
-PPp ON awfulhak> # We've authenticated
-PPP ON awfulhak> # We've agreed IP numbers
+ppp ON awfulhak>
+Ppp ON awfulhak>
+PPp ON awfulhak>
+PPP ON awfulhak>
.Ed
.Pp
If it does not, it's possible that the peer is waiting for your end to
-start negotiating or that
-.Nm ppp
-can't identify the incoming packets as being
-.Em PPP
-packets, perhaps due to your parity settings. To force
+start negotiating. To force
.Nm
-to start sending
-.Em PPP
-configuration packets to the peer, use the
+to start sending PPP configuration packets to the peer, use the
.Dq ~p
command to enter packet mode.
.Pp
@@ -531,10 +408,13 @@ PPP ON awfulhak> add default HISADDR
.Pp
The string
.Sq HISADDR
-represents the IP address of the connected peer.
-If the
-.Dq add
-command fails due to an existing route, you can overwrite the existing
+represents the IP address of the connected peer. It is possible to
+use the keyword
+.Sq INTERFACE
+in place of
+.Sq HISADDR .
+This will create a direct route on the tun interface.
+If it fails due to an existing route, you can overwrite the existing
route using
.Bd -literal -offset indent
PPP ON awfulhak> add! default HISADDR
@@ -609,7 +489,7 @@ portion of the prompt will change to
.Sq PPP :
.Bd -literal -offset indent
# ppp MyISP
-\&...
+...
ppp ON awfulhak> dial
Ppp ON awfulhak>
PPp ON awfulhak>
@@ -634,15 +514,18 @@ connection is established. See the provided
.Dq pmdemand
example in
.Pa /etc/ppp/ppp.conf.sample
-which runs a script in the background after the connection is established
-(refer to the
-.Dq shell
+which runs a script in the background after the connection is established.
+The literal strings
+.Dv HISADDR ,
+.Dv MYADDR
and
-.Dq bg
-commands below for a description of possible substition strings). Similarly,
-when a connection is closed, the contents of the
+.Dv INTERFACE
+may be used, and will be replaced with the relevant IP addresses and interface
+name. Similarly, when a connection is closed, the
+contents of the
.Pa /etc/ppp/ppp.linkdown
-file are executed. Both of these files have the same format as
+file are executed.
+Both of these files have the same format as
.Pa /etc/ppp/ppp.conf .
.Pp
In previous versions of
@@ -1286,7 +1169,7 @@ and represent the TH_ACK, TH_SYN and TH_FIN or TH_RST TCP flags respectively.
.El
.Pp
.It
-Each filter can hold up to 40 rules, starting from rule 0.
+Each filter can hold up to 20 rules, starting from rule 0.
The entire rule set is not effective until rule 0 is defined,
ie. the default is to allow everything through.
.It
@@ -1299,7 +1182,7 @@ to flush all rules.
.El
.Pp
See
-.Pa /etc/ppp/ppp.conf.sample .
+.Pa /etc/ppp/ppp.conf.example .
.Sh SETTING THE IDLE TIMER
To check/set the idle timer, use the
.Dq show bundle
@@ -1321,7 +1204,7 @@ ppp ON awfulhak> set timeout 0
In
.Fl ddial
and
-.Fl dedicated
+.Fl direct
modes, the idle timeout is ignored. In
.Fl auto
mode, when the idle timeout causes the
@@ -1668,7 +1551,7 @@ required a similar entry in the
.Pa /etc/ppp/ppp.linkup
file. Since the advent of
.Sq sticky routes ,
-this is no longer required.
+his is no longer required.
.It
If your provider requests that you use PAP/CHAP authentication methods, add
the next lines to your
@@ -1709,57 +1592,28 @@ ISPs.
is able to generate the following log info either via
.Xr syslog 3
or directly to the screen:
-.Pp
-.Bl -tag -width XXXXXXXXX -offset XXX -compact
-.It Li Async
-Dump async level packet in hex.
-.It Li CBCP
-Generate CBCP (CallBack Control Protocol) logs.
-.It Li CCP
-Generate a CCP packet trace.
-.It Li Chat
-Generate
-.Sq dial ,
-.Sq login
-and
-.Sq hangup
-chat script trace logs.
-.It Li Command
-Log commands executed either from the command line or any of the configuration
-files.
-.It Li Connect
-Log Chat lines containing the string "CONNECT".
-.It Li Debug
-Log debug information.
-.It Li HDLC
-Dump HDLC packet in hex.
-.It Li ID0
-Log all function calls specifically made as user id 0.
-.It Li IPCP
-Generate an IPCP packet trace.
-.It Li LCP
-Generate an LCP packet trace.
-.It Li LQM
-Generate LQR reports.
-.It Li Phase
-Phase transition log output.
-.It Li TCP/IP
-Dump all TCP/IP packets.
-.It Li Timer
-Log timer manipulation.
-.It Li TUN
-Include the tun device on each log line.
-.It Li Warning
-Output to the terminal device. If there is currently no terminal,
-output is sent to the log file using syslogs
-.Dv LOG_WARNING .
-.It Li Error
-Output to both the terminal device
-and the log file using syslogs
-.Dv LOG_ERROR .
-.It Li Alert
-Output to the log file using
-.Dv LOG_ALERT .
+.Bl -column SMMMMMM -offset indent
+.It Li Async Dump async level packet in hex
+.It Li CBCP Generate CBCP (CallBack Control Protocol) logs
+.It Li CCP Generate a CCP packet trace
+.It Li Chat Generate Chat script trace log
+.It Li Command Log commands executed
+.It Li Connect Generate complete Chat log
+.It Li Debug Log debug information
+.It Li HDLC Dump HDLC packet in hex
+.It Li ID0 Log all function calls specifically made as user id 0.
+.It Li IPCP Generate an IPCP packet trace
+.It Li LCP Generate an LCP packet trace
+.It Li LQM Generate LQR report
+.It Li Phase Phase transition log output
+.It Li TCP/IP Dump all TCP/IP packets
+.It Li Timer Log timer manipulation
+.It Li TUN Include the tun device on each log line
+.It Li Warning Output to the terminal device. If there is currently no
+terminal, output is sent to the log file using LOG_WARNING.
+.It Li Error Output to both the terminal device and the log file using
+LOG_ERROR.
+.It Li Alert Output to the log file using LOG_ALERT
.El
.Pp
The
@@ -2236,11 +2090,6 @@ as the client password in
Default: Disabled. Enabling this option will tell
.Nm
to proxy ARP for the peer.
-.It proxyall
-Default: Disabled. Enabling this will tell
-.Nm
-to add proxy arp entries for every IP address in all class C or
-smaller subnets routed via the tun interface.
.It sroutes
Default: Enabled. When the
.Dq add
@@ -2285,28 +2134,6 @@ this option will tell
.Nm
not to make any utmp or wtmp entries. This is usually only necessary if
you require the user to both login and authenticate themselves.
-.It iface-alias
-Default: Enabled if
-.Fl alias
-is specified. This option simply tells
-.Nm
-to add new interface addresses to the interface rather than replacing them.
-The option can only be enabled if IP aliasing is enabled
-.Pq Dq alias enable yes .
-.Pp
-With this option enabled,
-.Nm
-will pass traffic for old interface addresses through the IP alias engine
-.Pq see Xr libalias 5 ,
-resulting in the ability (in
-.Fl auto
-mode) to properly connect the process that caused the PPP link to
-come up in the first place.
-.Pp
-Disabling IP aliasing with
-.Dq alias enable off
-will also disable
-.Sq iface-alias .
.El
.Pp
.It add[!] Ar dest[/nn] [mask] gateway
@@ -2335,14 +2162,24 @@ It is possible to use the symbolic names
.Sq MYADDR
or
.Sq HISADDR
-as the destination, and
+as the destination, and either
.Sq HISADDR
+or
+.Sq INTERFACE
as the
.Ar gateway .
.Sq MYADDR
-is replaced with the interface address and
+is replaced with the interface address,
.Sq HISADDR
-is replaced with the interface destination (peer) address.
+is replaced with the interface destination address and
+.Sq INTERFACE
+is replaced with the current interface name. If the interfaces destination
+address has not yet been assigned
+.Pq via Dq set ifaddr ,
+the current
+.Sq INTERFACE
+is used instead of
+.Sq HISADDR .
.Pp
If the
.Ar add!
@@ -2533,18 +2370,12 @@ file.
This is replaced with the IP number assigned to the local interface.
.It Li PEER_ENDDISC
This is replaced with the value of the peers endpoint discriminator.
-.It Li PROCESSID
-This is replaced with the current process id.
.It Li USER
This is replaced with the username that has been authenticated with PAP or
CHAP. Normally, this variable is assigned only in -direct mode. This value
is available irrespective of whether utmp logging is enabled.
.El
.Pp
-These substitutions are also done by the
-.Dq set proctitle
-command.
-.Pp
If you wish to pause
.Nm
while the command executes, use the
@@ -2623,7 +2454,7 @@ will not complain if the route does not already exist.
.It dial|call Op Ar label
When used with no argument, this command is the same as the
.Dq open
-command. When one or more
+command. When
.Ar label
is specified, a
.Dq load
@@ -2645,70 +2476,6 @@ is specified, only the relevant compression layer(s) are terminated.
Show a list of available commands. If
.Ar command
is specified, show the usage string for that command.
-.It iface Ar command Op args
-This command is used to control the interface used by
-.Nm ppp .
-.Ar Command
-may be one of the following:
-.Bl -tag -width XX
-.It iface add[!] Ar addr[[/bits| mask] peer]
-Add the given
-.Ar addr mask peer
-combination to the interface. Instead of specifying
-.Ar mask ,
-.Ar /bits
-can be used
-.Pq with no space between \&it and Ar addr .
-If the given address already exists, the command fails unless the
-.Dq \&!
-is used - in which case the previous interface address entry is overwritten
-with the new one, allowing a change of netmask or peer address.
-.Pp
-If only
-.Ar addr
-is specified,
-.Ar bits
-defaults to
-.Dq 32
-and
-.Ar peer
-defaults to
-.Dq 255.255.255.255 .
-This address (the broadcast address) is the only duplicate peer address that
-.Nm
-allows.
-.It iface clear
-If this command is used while
-.Nm
-is in the OPENED state or while in
-.Fl auto
-mode, all addresses except for the IPCP negotiated address are deleted
-from the interface. If
-.Nm
-is not in the OPENED state and is not in
-.Fl auto
-mode, all interface addresses are deleted.
-.Pp
-.It iface delete[!]|rm[!] Ar addr
-This command deletes the given
-.Ar addr
-from the interface. If the
-.Dq \&!
-is used, no error is given if the address isn't currently assigned to
-the interface (and no deletion takes place).
-.It iface show
-Shows the current state and current addresses for the interface. It is
-much the same as running
-.Dq ifconfig INTERFACE .
-.It iface help Op Ar sub-command
-This command, when invoked without
-.Ar sub-command ,
-will show a list of possbile
-.Dq iface
-sub-commands and a brief synopsis for each. When invoked with
-.Ar sub-command ,
-only the synopsis for the given sub-command is shown.
-.El
.It [data]link Ar name[,name...] command Op Ar args
This command may prefix any other command if the user wishes to
specify which link the command should affect. This is only
@@ -2728,9 +2495,9 @@ is
.Dq * ,
.Ar command
is executed on all links.
-.It load Op Ar label ...
+.It load Op Ar label
Load the given
-.Ar label(s)
+.Ar label
from the
.Pa ppp.conf
file. If
@@ -2799,8 +2566,8 @@ ppp will exit after closing all connections. Otherwise, if the user
is connected to a diagnostic socket, the connection is simply dropped.
.Pp
If the
-.Ar all
-argument is given,
+.Ar
+all argument is given,
.Nm
will exit despite the source of the command after closing all existing
connections.
@@ -2892,20 +2659,12 @@ links will stay active until the bundle idle timer expires.
If no arguments are given, callback is disabled, otherwise,
.Nm
will request (or in
-.Fl direct
-mode, will accept) one of the given protocols. In client mode, if a
-request is NAK'd
+.Ar direct
+mode, will accept) one of the given protocols. If a request is NAK'd
.Nm
will request another, until no options remain at which point
.Nm
-will terminate negotiations. In server mode,
-.Nm
-will accept any of the given protocols - but the client
-.Em must
-request one of them. If you wish callback to be optional, you must include
-.Ar none
-as an option.
-.Pp
+will terminate negotiations.
The options are as follows (in this order of preference):
.Pp
.Bl -tag
@@ -2943,7 +2702,7 @@ themselves.
If the peer does not wish to do callback at all,
.Nm
will accept the fact and continue without callback rather than terminating
-the connection. This is required if you wish callback to be optional.
+the connection.
.El
.Pp
.It set cbcp Op *|number[,number]... Op delay Op retry
@@ -3263,7 +3022,7 @@ Filtering is done prior to any IP alterations that might be done by the
alias engine. By default all filter sets allow all packets to pass.
Rules are processed in order according to
.Ar rule-no .
-Up to 40 rules may be given for each set. If a packet doesn't match
+Up to 20 rules may be given for each set. If a packet doesn't match
any of the rules in a given set, it is discarded. In the case of
.Em in
and
@@ -3401,16 +3160,6 @@ It is not possible to change a link that is
.Sq direct
or
.Sq dedicated .
-.Pp
-Note: If you issue the command
-.Dq set mode auto ,
-and have IP aliasing enabled, it may be useful to
-.Dq enable iface-alias
-afterwards. This will allow
-.Nm
-to do the necessary address translations to enable the process that
-triggers the connection to connect once the link is up despite the
-peer assigning us a new (dynamic) IP address.
.It set mrru Op Ar value
Setting this option enables Multi-link PPP negotiations, also known as
Multi-link Protocol or MP. There is no default MRRU (Maximum
@@ -3479,25 +3228,6 @@ the maximum number of times specified by
below. In
.Fl background
mode, each number is attempted at most once.
-.It set [proc]title Op Ar value
-The current process title as displayed by
-.Xr ps 1
-is changed according to
-.Ar value .
-If
-.Ar value
-is not specified, the original process title is restored. All the
-word replacements done by the shell commands (see the
-.Dq bg
-command above) are done here too.
-.Pp
-Note, if USER is required in the process title, the
-.Dq set proctitle
-command must appear in
-.Pa ppp.linkup ,
-as it is not known when the commands in
-.Pa ppp.conf
-are executed.
.It set reconnect Ar timeout ntries
Should the line drop unexpectedly (due to loss of CD or LQR
failure), a connection will be re-established after the given
@@ -3511,11 +3241,6 @@ defaults to zero. A value of
for
.Ar timeout
will result in a variable pause, somewhere between 0 and 30 seconds.
-.It set recvpipe Op Ar value
-This sets the routing table RECVPIPE value. The optimum value is
-just over twice the MTU value. If
-.Ar value
-is unspecified or zero, the default kernel controlled value is used.
.It set redial Ar seconds[.nseconds] [attempts]
.Nm Ppp
can be instructed to attempt to redial
@@ -3544,11 +3269,6 @@ should immediately follow the
keyword. See the
.Dq open
description above for further details.
-.It set sendpipe Op Ar value
-This sets the routing table SENDPIPE value. The optimum value is
-just over twice the MTU value. If
-.Ar value
-is unspecified or zero, the default kernel controlled value is used.
.It set server|socket Ar TcpPort|LocalName|none password Op Ar mask
This command tells
.Nm
@@ -3689,9 +3409,6 @@ is not specified, all filters are shown.
Show the current HDLC statistics.
.It show help|?
Give a summary of available show commands.
-.It show iface
-Show the current interface information
-.Pq the same \&as Dq iface show .
.It show ipcp
Show the current IPCP statistics.
.It show lcp
@@ -3736,11 +3453,11 @@ Read the example configuration files. They are a good source of information.
.It
Use
.Dq help ,
+.Dq show ? ,
.Dq alias ? ,
-.Dq enable ? ,
.Dq set ?
and
-.Dq show ?
+.Dq set ? <var>
to get online information about what's available.
.It
The following urls contain useful information:
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index 7f70efb7bd53..a80204d1be25 100644
--- a/usr.sbin/ppp/route.c
+++ b/usr.sbin/ppp/route.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: route.c,v 1.53 1998/08/17 06:42:40 brian Exp $
+ * $Id: route.c,v 1.52 1998/07/28 21:54:54 brian Exp $
*
*/
@@ -61,7 +61,6 @@
#include "bundle.h"
#include "route.h"
#include "prompt.h"
-#include "iface.h"
static void
p_sockaddr(struct prompt *prompt, struct sockaddr *phost,
@@ -362,7 +361,7 @@ route_IfDelete(struct bundle *bundle, int all)
char *sp, *cp, *ep;
int mib[6];
- log_Printf(LogDEBUG, "route_IfDelete (%d)\n", bundle->iface->index);
+ log_Printf(LogDEBUG, "route_IfDelete (%d)\n", bundle->ifp.Index);
sa_none.s_addr = INADDR_ANY;
mib[0] = CTL_NET;
@@ -408,7 +407,7 @@ route_IfDelete(struct bundle *bundle, int all)
Index2Nam(rtm->rtm_index), rtm->rtm_flags,
inet_ntoa(((struct sockaddr_in *) sa)->sin_addr));
if (rtm->rtm_addrs & RTA_DST && rtm->rtm_addrs & RTA_GATEWAY &&
- rtm->rtm_index == bundle->iface->index &&
+ rtm->rtm_index == bundle->ifp.Index &&
(all || (rtm->rtm_flags & RTF_GATEWAY))) {
sa_dst.s_addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
sa = (struct sockaddr *)((char *)sa + sa->sa_len);
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index f786b1bc5776..e5583f661dd4 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: systems.c,v 1.39 1998/10/17 12:28:03 brian Exp $
+ * $Id: systems.c,v 1.37 1998/06/15 19:05:47 brian Exp $
*
* TODO:
*/
@@ -156,10 +156,7 @@ DecodeCtrlCommand(char *line, char *arg)
return CTRL_UNKNOWN;
}
-/*
- * Initialised in system_IsValid(), set in ReadSystem(),
- * used by system_IsValid()
- */
+/* Initialised in system_IsValid(), set in ReadSystem(), used by system_IsValid() */
static int modeok;
static int userok;
static int modereq;
@@ -318,13 +315,8 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
if (*cp == '\0') /* empty / comment */
continue;
- if (!indent) { /* start of next section */
- wp = strchr(cp, ':');
- if (doexec && (wp == NULL || wp[1] != '\0'))
- log_Printf(LogWARN, "Unindented command (%s line %d) - ignored\n",
- filename, linenum);
+ if (!indent) /* start of next section */
break;
- }
len = strlen(cp);
argc = command_Interpret(cp, len, argv);
@@ -344,38 +336,22 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
return -1;
}
-const char *
+int
system_IsValid(const char *name, struct prompt *prompt, int mode)
{
/*
* Note: The ReadSystem() calls only result in calls to the Allow*
* functions. arg->bundle will be set to NULL for these commands !
*/
- int def;
-
- if (ID0realuid() == 0) {
- userok = modeok = 1;
- return NULL;
- }
-
- def = !strcmp(name, "default");
+ if (ID0realuid() == 0)
+ return userok = modeok = 1;
userok = 0;
modeok = 1;
modereq = mode;
-
- if (ReadSystem(NULL, "default", CONFFILE, 0, prompt, NULL) != 0 && def)
- return "System not found";
-
- if (!def && ReadSystem(NULL, name, CONFFILE, 0, prompt, NULL) != 0)
- return "System not found";
-
- if (!userok)
- return "Invalid user id";
-
- if (!modeok)
- return "Invalid mode";
-
- return NULL;
+ ReadSystem(NULL, "default", CONFFILE, 0, prompt, NULL);
+ if (name != NULL)
+ ReadSystem(NULL, name, CONFFILE, 0, prompt, NULL);
+ return userok && modeok;
}
int
diff --git a/usr.sbin/ppp/systems.h b/usr.sbin/ppp/systems.h
index e85b865bdbe5..5d3c311a9537 100644
--- a/usr.sbin/ppp/systems.h
+++ b/usr.sbin/ppp/systems.h
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: systems.h,v 1.12 1998/06/15 19:05:51 brian Exp $
+ * $Id: systems.h,v 1.11 1998/05/21 21:48:36 brian Exp $
*
*/
@@ -28,7 +28,7 @@ struct cmdargs;
extern int system_Select(struct bundle *bundle, const char *, const char *,
struct prompt *, struct datalink *);
-extern const char *system_IsValid(const char *, struct prompt *, int);
+extern int system_IsValid(const char *, struct prompt *, int);
extern FILE *OpenSecret(const char *);
extern void CloseSecret(FILE *);
extern int AllowUsers(struct cmdargs const *);
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 0bf2258e8a08..9accce3bfab6 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -17,12 +17,11 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: timer.c,v 1.31 1998/06/27 14:18:11 brian Exp $
+ * $Id: timer.c,v 1.30 1998/06/20 01:36:38 brian Exp $
*
* TODO:
*/
-#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/time.h>
@@ -97,8 +96,8 @@ timer_Start(struct pppTimer * tp)
if (pt) {
pt->next = tp;
} else {
+ timer_InitService();
TimerList = tp;
- timer_InitService(0); /* Start the Timer Service */
}
if (t)
t->rest -= tp->rest;
@@ -144,7 +143,7 @@ StopTimerNoBlock(struct pppTimer * tp)
static void
TimerService(void)
{
- struct pppTimer *tp, *exp, *next;
+ struct pppTimer *tp, *exp, *wt;
if (log_IsKept(LogTIMER)) {
static time_t t; /* Only show timers globally every second */
@@ -154,34 +153,43 @@ TimerService(void)
timer_Show(LogTIMER, NULL);
t = n;
}
-
tp = TimerList;
if (tp) {
- tp->rest = 0;
-
- /* Multiple timers might expire at once. Create a list of expired timers */
- exp = NULL;
- do {
- tp->state = TIMER_EXPIRED;
- next = tp->next;
- tp->enext = exp;
- exp = tp;
- tp = next;
- } while (tp && tp->rest == 0);
-
- TimerList = tp;
- if (TimerList != NULL) /* Any timers remaining ? */
- timer_InitService(1); /* Restart the Timer Service */
- else
- timer_TermService(); /* Stop the Timer Service */
-
- /* Process all expired timers */
- while (exp) {
- next = exp->enext;
- exp->enext = NULL;
- if (exp->func)
- (*exp->func)(exp->arg);
- exp = next;
+ tp->rest--;
+ if (tp->rest == 0) {
+
+ /*
+ * Multiple timers may expires at once. Create list of expired timers.
+ */
+ exp = NULL;
+ do {
+ tp->state = TIMER_EXPIRED;
+ wt = tp->next;
+ tp->enext = exp;
+ exp = tp;
+ tp = wt;
+ } while (tp && (tp->rest == 0));
+
+ TimerList = tp;
+ if (TimerList == NULL) /* No timers ? */
+ timer_TermService(); /* Terminate Timer Service */
+
+ /*
+ * Process all expired timers.
+ */
+ while (exp) {
+#ifdef notdef
+ timer_Stop(exp);
+#endif
+ if (exp->func)
+ (*exp->func) (exp->arg);
+
+ /*
+ * Just Removing each item from expired list And exp->enext will be
+ * intialized at next expire in this funtion.
+ */
+ exp = exp->enext;
+ }
}
}
}
@@ -215,20 +223,15 @@ timer_Show(int LogLevel, struct prompt *prompt)
}
void
-timer_InitService(int restart)
+timer_InitService()
{
struct itimerval itimer;
- if (TimerList) {
- if (!restart)
- sig_signal(SIGALRM, (void (*)(int))TimerService);
- itimer.it_interval.tv_sec = 0;
- itimer.it_interval.tv_usec = 0;
- itimer.it_value.tv_sec = TimerList->rest / SECTICKS;
- itimer.it_value.tv_usec = (TimerList->rest % SECTICKS) * TICKUNIT;
- if (setitimer(ITIMER_REAL, &itimer, NULL) == -1)
- log_Printf(LogERROR, "Unable to set itimer (%s)\n", sys_errlist[errno]);
- }
+ sig_signal(SIGALRM, (void (*) (int)) TimerService);
+ itimer.it_interval.tv_sec = itimer.it_value.tv_sec = 0;
+ itimer.it_interval.tv_usec = itimer.it_value.tv_usec = TICKUNIT;
+ if (setitimer(ITIMER_REAL, &itimer, NULL) == -1)
+ log_Printf(LogERROR, "Unable to set itimer.\n");
}
void
@@ -239,6 +242,6 @@ timer_TermService(void)
itimer.it_interval.tv_usec = itimer.it_interval.tv_sec = 0;
itimer.it_value.tv_usec = itimer.it_value.tv_sec = 0;
if (setitimer(ITIMER_REAL, &itimer, NULL) == -1)
- log_Printf(LogERROR, "Unable to set itimer (%s)\n", sys_errlist[errno]);
+ log_Printf(LogERROR, "Unable to set itimer.\n");
sig_signal(SIGALRM, SIG_IGN);
}
diff --git a/usr.sbin/ppp/timer.h b/usr.sbin/ppp/timer.h
index ae1f521abfd2..5e6b6be5a7f1 100644
--- a/usr.sbin/ppp/timer.h
+++ b/usr.sbin/ppp/timer.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: timer.h,v 1.7 1998/06/20 01:36:38 brian Exp $
+ * $Id: timer.h,v 1.6 1998/05/21 21:48:49 brian Exp $
*
* TODO:
*/
@@ -42,6 +42,6 @@ struct prompt;
extern void timer_Start(struct pppTimer *);
extern void timer_Stop(struct pppTimer *);
-extern void timer_InitService(int);
+extern void timer_InitService(void);
extern void timer_TermService(void);
extern void timer_Show(int LogLevel, struct prompt *);
diff --git a/usr.sbin/ppp/tun.c b/usr.sbin/ppp/tun.c
index 6d97e38c4b75..c1d021f58a6d 100644
--- a/usr.sbin/ppp/tun.c
+++ b/usr.sbin/ppp/tun.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tun.c,v 1.9 1998/08/09 16:41:01 brian Exp $
+ * $Id: tun.c,v 1.8 1998/06/27 14:18:15 brian Exp $
*/
#include <sys/types.h>
@@ -65,10 +65,9 @@ tun_configure(struct bundle *bundle, int mtu)
{
struct tuninfo info;
- memset(&info, '\0', sizeof info);
info.type = IFT_PPP;
info.mtu = mtu;
- info.baudrate = bundle->ifSpeed;
+ info.baudrate = bundle->ifp.Speed;
#ifdef __OpenBSD__
info.flags = IFF_UP|IFF_POINTOPOINT;
#endif
diff --git a/usr.sbin/pw/README b/usr.sbin/pw/README
index 38881271227e..9302f6b5fec8 100644
--- a/usr.sbin/pw/README
+++ b/usr.sbin/pw/README
@@ -13,10 +13,10 @@ the command "pw useradd <loginid>". Creation of a unique primary
group for each user and automatic memberhip in secondary groups
is fully supported.
-This program may be FreeBSD specific, but should be trivial to port to
+This program may be FreBSD specific, but should be trivial to port to
other bsd4.4 variants.
Author and maintainer: David L. Nugent, <davidn@blaze.net.au>
-$Id: README,v 1.3 1997/02/22 16:12:18 peter Exp $
+$Id$
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index f862cbe12346..3dc9276d518d 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pw.c,v 1.10 1998/08/04 22:31:26 nate Exp $";
+ "$Id: pw.c,v 1.8 1998/07/16 17:18:25 nate Exp $";
#endif /* not lint */
#include "pw.h"
@@ -50,6 +50,7 @@ static struct cargs arglist;
static int getindex(const char *words[], const char *word);
static void cmdhelp(int mode, int which);
+static void filelock(const char *filename);
int
@@ -149,6 +150,12 @@ main(int argc, char *argv[])
*/
cnf = read_userconfig(getarg(&arglist, 'C') ? getarg(&arglist, 'C')->val : NULL);
+ /*
+ * Try to lock the master passowrd and group files right away (we
+ * don't care if it works, since this is just advisory locking.
+ */
+ filelock(_PATH_GROUP);
+ filelock(_PATH_MASTERPASSWD);
ch = funcs[which] (cnf, mode, &arglist);
/*
@@ -179,6 +186,11 @@ main(int argc, char *argv[])
return ch;
}
+static void
+filelock(const char *filename)
+{
+ open(filename, O_RDONLY | O_EXLOCK, 0);
+}
static int
getindex(const char *words[], const char *word)
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index 87ec76c7716c..d10c5283f5f8 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pw_user.c,v 1.24 1999/01/02 04:37:46 billf Exp $";
+ "$Id$";
#endif /* not lint */
#include <ctype.h>
@@ -925,7 +925,7 @@ pw_password(struct userconf * cnf, struct cargs * args, char const * user)
l = (random() % 8 + 8); /* 8 - 16 chars */
pw_getrand(rndbuf, l);
for (i = 0; i < l; i++)
- pwbuf[i] = chars[rndbuf[i] % (sizeof(chars)-1)];
+ pwbuf[i] = chars[rndbuf[i] % sizeof(chars)];
pwbuf[i] = '\0';
/*
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8
index 7beecd779e9f..54abc76a3989 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.8
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8
@@ -40,7 +40,6 @@
.Sh SYNOPSIS
.Nm pwd_mkdb
.Op Fl C
-.Op Fl N
.Op Fl p
.Op Fl d Ar directory
.Op Fl s Ar cachesize
@@ -68,12 +67,6 @@ The options are as follows:
.It Fl C
Check if the password file is in the correct format. Do not
change, add, or remove any files.
-.It Fl N
-Tell
-.Nm Pwd_mkdb
-to exit with an error if it cannot obtain a lock on the file. By default,
-we block waiting for a lock on the source file. The lock is held through
-the rebuilding of the database.
.It Fl p
Create a Version 7 style password file and install it into
.Pa /etc/passwd .
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index bb0398e46a04..3b73d8a4fdf2 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94";
#endif
static const char rcsid[] =
- "$Id: pwd_mkdb.c,v 1.29 1998/12/13 01:53:50 dillon Exp $";
+ "$Id: pwd_mkdb.c,v 1.26 1998/06/09 20:19:59 ache Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -109,13 +109,12 @@ main(argc, argv)
char *username;
u_int method, methoduid;
int Cflag;
- int nblock = 0;
Cflag = 0;
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
- while ((ch = getopt(argc, argv, "Cd:ps:u:vN")) != -1)
+ while ((ch = getopt(argc, argv, "Cd:ps:u:v")) != -1)
switch(ch) {
case 'C': /* verify only */
Cflag = 1;
@@ -134,9 +133,6 @@ main(argc, argv)
break;
case 'v': /* backward compatible */
break;
- case 'N': /* do not wait for lock */
- nblock = LOCK_NB;
- break;
default:
usage();
}
@@ -162,30 +158,9 @@ main(argc, argv)
(void)umask(0);
pname = *argv;
-
- /*
- * Open and lock the original password file. We have to check
- * the hardlink count after we get the lock to handle any potential
- * unlink/rename race.
- *
- * This lock is necessary when someone runs pwd_mkdb manually, directly
- * on master.passwd, to handle the case where a user might try to
- * change his password while pwd_mkdb is running.
- */
- for (;;) {
- struct stat st;
-
- if (!(fp = fopen(pname, "r")))
- error(pname);
- if (flock(fileno(fp), LOCK_EX|nblock) < 0)
- error("flock");
- if (fstat(fileno(fp), &st) < 0)
- error(pname);
- if (st.st_nlink != 0)
- break;
- fclose(fp);
- fp = NULL;
- }
+ /* Open the original password file */
+ if (!(fp = fopen(pname, "r")))
+ error(pname);
/* check only if password database is valid */
if (Cflag) {
@@ -312,10 +287,6 @@ main(argc, argv)
(pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-'))
yp_enabled = 1;
#define COMPACT(e) t = e; while ((*p++ = *t++));
-#ifdef PASSWD_IGNORE_COMMENTS
- if(is_comment)
- --cnt;
-#endif
if (!is_comment &&
(!username || (strcmp(username, pwd.pw_name) == 0))) {
/* Create insecure data. */
@@ -456,6 +427,8 @@ main(argc, argv)
/* Set master.passwd permissions, in case caller forgot. */
(void)fchmod(fileno(fp), S_IRUSR|S_IWUSR);
+ if (fclose(fp) == EOF)
+ error("close fp");
/* Install as the real password files. */
(void)snprintf(buf, sizeof(buf), "%s/%s.tmp", prefix, _MP_DB);
@@ -477,13 +450,6 @@ main(argc, argv)
*/
(void)snprintf(buf, sizeof(buf), "%s/%s", prefix, _MASTERPASSWD);
mv(pname, buf);
-
- /*
- * Close locked password file after rename()
- */
- if (fclose(fp) == EOF)
- error("close fp");
-
exit(0);
}
@@ -614,6 +580,6 @@ usage()
{
(void)fprintf(stderr,
-"usage: pwd_mkdb [-C] [-N] [-p] [-d <dest dir>] [-s <cachesize>] [-u <local username>] file\n");
+"usage: pwd_mkdb [-C] [-p] [-d <dest dir>] [-s <cachesize>] [-u <local username>] file\n");
exit(1);
}
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index 547fd8fd8637..7be0641814da 100644
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: quot.c,v 1.8 1998/01/17 16:45:03 bde Exp $";
+ "$Id: quot.c,v 1.7 1997/10/10 06:31:07 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -66,14 +66,11 @@ static int headerlen;
* The new code always counts the number of 512 byte blocks
* instead of the number of kilobytes and converts them to
* kByte when done (on request).
- *
- * Due to the size of modern disks, we must cast intermediate
- * values to 64 bits to prevent potential overflows.
*/
#ifdef COMPAT
#define SIZE(n) (n)
#else
-#define SIZE(n) ((int)(((quad_t)(n) * 512 + blocksize - 1)/blocksize))
+#define SIZE(n) (((n) * 512 + blocksize - 1)/blocksize)
#endif
#define INOCNT(fs) ((fs)->fs_ipg)
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index ccc7eb1721d3..f09c1d668121 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -27,7 +27,7 @@ The Regents of the University of California. All rights reserved.\n";
#ifndef lint
static const char rcsid[] =
- "$Id: rarpd.c,v 1.19 1998/04/02 13:20:15 roberto Exp $";
+ "$Id: rarpd.c,v 1.18 1998/01/16 17:38:54 bde Exp $";
#endif /* not lint */
/*
@@ -400,7 +400,7 @@ init(target)
static void
usage()
{
- (void)fprintf(stderr, "usage: rarpd [-afsv] [interface]\n");
+ (void)fprintf(stderr, "usage: rarpd [-afnv] [interface]\n");
exit(1);
}
diff --git a/usr.sbin/rwhod/rwhod.8 b/usr.sbin/rwhod/rwhod.8
index 8050ca97f425..a7243e4040d9 100644
--- a/usr.sbin/rwhod/rwhod.8
+++ b/usr.sbin/rwhod/rwhod.8
@@ -39,8 +39,6 @@
.Nd system status server
.Sh SYNOPSIS
.Nm rwhod
-.Op Fl i
-.Op Fl l
.Op Fl m Op Ar ttl
.Sh DESCRIPTION
.Nm Rwhod
@@ -55,11 +53,7 @@ or
messages on a network.
.Pp
.Nm Rwhod
-operates as both a producer and consumer of status information,
-unless the
-.Fl l
-(listen mode) option is specified, in which case
-it acts as a consumer only.
+operates as both a producer and consumer of status information.
As a producer of information it periodically
queries the state of the system and constructs
status messages which are broadcasted or multicasted on a network.
@@ -70,21 +64,6 @@ them in a collection of files located in the directory
.Pa /var/rwho .
.Pp
The
-.Fl i
-option enables insecure mode, which causes
-.Nm
-to ignore the source port on incoming packets.
-.Pp
-The
-.Fl l
-option enables listen mode, which causes
-.Nm
-to not broadcast any information.
-This allows you to monitor other machines'
-.Nm
-information, without broadcasting your own.
-.Pp
-The
.Fl m
option causes
.Nm
@@ -184,9 +163,7 @@ Messages received by the
.Nm rwho
server are discarded unless they originated at an
.Nm rwho
-server's port or the
-.Fl i
-option was specified. In addition, if the host's name, as specified
+server's port. In addition, if the host's name, as specified
in the message, contains any unprintable
.Tn ASCII
characters, the
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index 6b6899f6b274..229d1f17919b 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: rwhod.c,v 1.8 1998/12/17 11:05:57 des Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -115,8 +115,6 @@ static const char rcsid[] =
#define INADDR_WHOD_GROUP (u_long)0xe0000103 /* 224.0.1.3 */
/* (belongs in protocols/rwhod.h) */
-int insecure_mode;
-int quiet_mode;
int multicast_mode = NO_MULTICAST;
int multicast_scope;
struct sockaddr_in multicast_addr = { sizeof multicast_addr, AF_INET };
@@ -196,10 +194,6 @@ main(argc, argv)
}
else multicast_mode = PER_INTERFACE_MULTICAST;
}
- else if (strcmp(*argv, "-i") == 0)
- insecure_mode = 1;
- else if (strcmp(*argv, "-l") == 0)
- quiet_mode = 1;
else
usage();
argv++, argc--;
@@ -258,10 +252,8 @@ main(argc, argv)
setuid(unpriv_uid);
if (!configure(s))
exit(1);
- if (!quiet_mode) {
- signal(SIGALRM, onalrm);
- onalrm(0);
- }
+ signal(SIGALRM, onalrm);
+ onalrm(0);
for (;;) {
struct whod wd;
int cc, whod, len = sizeof(from);
@@ -273,7 +265,7 @@ main(argc, argv)
syslog(LOG_WARNING, "recv: %m");
continue;
}
- if (from.sin_port != sp->s_port && !insecure_mode) {
+ if (from.sin_port != sp->s_port) {
syslog(LOG_WARNING, "%d: bad from port",
ntohs(from.sin_port));
continue;
@@ -327,7 +319,7 @@ main(argc, argv)
static void
usage()
{
- fprintf(stderr, "usage: rwhod [-i] [-m [ttl]]\n");
+ fprintf(stderr, "usage: rwhod [-m [ttl]]\n");
exit(1);
}
diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile
index 74675e29d599..cc883920c0c1 100644
--- a/usr.sbin/sendmail/Makefile
+++ b/usr.sbin/sendmail/Makefile
@@ -19,11 +19,10 @@ MAPS= -DMAP_REGEX
#TCPWRAPPERS= -DTCPWRAPPERS -I${TCPWRAPPERSBASEDIR}/include
CFLAGS+=-I${SMDIR} ${DBMDEF} ${NIS} ${TCPWRAPPERS} ${MAPS}
-CFLAGS+=-D_FFR_MAX_MIME_HEADER_LENGTH
-SRCS= alias.c arpadate.c clock.c collect.c conf.c control.c convtime.c \
- daemon.c deliver.c domain.c envelope.c err.c headers.c macro.c \
- main.c map.c mci.c mime.c parseaddr.c queue.c readcf.c recipient.c \
+SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
+ deliver.c domain.c envelope.c err.c headers.c macro.c main.c \
+ map.c mci.c mime.c parseaddr.c queue.c readcf.c recipient.c \
safefile.c savemail.c snprintf.c srvrsmtp.c stab.c stats.c \
sysexits.c trace.c udb.c usersmtp.c util.c version.c
DPADD= ${LIBUTIL}
diff --git a/usr.sbin/slstat/slstat.8 b/usr.sbin/slstat/slstat.8
index 201add7dd1b4..5b45a662f19d 100644
--- a/usr.sbin/slstat/slstat.8
+++ b/usr.sbin/slstat/slstat.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)slstat.8 6.8 (Berkeley) 6/20/91
-.\" $Id: slstat.8,v 1.11 1997/10/20 12:41:40 charnier Exp $
+.\" $Id: slstat.8,v 1.10 1997/02/22 16:13:33 peter Exp $
.\"
.Dd October 11, 1996
.Dt SLSTAT 8
@@ -62,7 +62,7 @@ is specified, the default is 5 seconds.
.It Fl v
Verbose display of extra fields of information.
.It Fl r
-Display all values in rate per second rather than amount per interval.
+Display all values in rate per second that amount per interval.
.It Ar unit
Is number specifying the
.Tn SLIP
diff --git a/usr.sbin/stallion/bootcode/stl.4 b/usr.sbin/stallion/bootcode/stl.4
index 81177eced24a..871744997e6b 100644
--- a/usr.sbin/stallion/bootcode/stl.4
+++ b/usr.sbin/stallion/bootcode/stl.4
@@ -36,7 +36,7 @@
.Nm stli
.Nd "drivers for Stallion Technologies multiport serial controllers"
.Sh SYNOPSIS
-.Cd "stl0 at isa? port <addr> tty irq <irq>"
+.Cd "stl0 at isa? port <addr> tty irq <irq> vector stlintr"
.Cd "stli0 at isa? port <io-addr> tty iomem <mem-addr> iosiz <size> flags <type> "
.Cd "stli0 at eisa? port <io-addr> tty iomem <mem-addr> iosiz <size> flags <type> "
.Sh DESCRIPTION
@@ -78,7 +78,7 @@ ISA board configuration entries for the
.Nm stl
driver take the general form of:
.Pp
-.Cd "stlX at isa? port <io-addr> tty irq <irq>"
+.Cd "stlX at isa? port <io-addr> tty irq <irq> vector stlintr"
.Pp
.Ar X
is the unit number assigned to the board.
@@ -119,7 +119,7 @@ board types.
Each EasyIO board requires 8 bytes of I/O address space and 1 IRQ line.
A configuration entry for an EasyIO board would look like:
.Pp
-.Cd "stl0 at isa? port 0x2a8 tty irq 15"
+.Cd "stl0 at isa? port 0x2a8 tty irq 15 vector stlintr"
.Pp
This entry specifies an EasyIO board at I/O address 0x2a8 using IRQ 15.
The I/O and IRQ values can be modified as required.
@@ -133,7 +133,7 @@ by multiple EasyConnection 8/32-AT boards.
This secondary I/O address is set at 0x280 in the driver code.
A configuration entry would look like:
.Pp
-.Cd "stl0 at isa? port 0x2a0 irq 10 tty"
+.Cd "stl0 at isa? port 0x2a0 irq 10 tty vector stlintr"
.Pp
This specifies an EasyConnection 8/32-AT with primary I/O address 0x2a0,
secondary I/O address of 0x280 and IRQ 10.
diff --git a/usr.sbin/sysctl/sysctl.8 b/usr.sbin/sysctl/sysctl.8
index e959ecd77aff..455dcaca85a4 100644
--- a/usr.sbin/sysctl/sysctl.8
+++ b/usr.sbin/sysctl/sysctl.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93
-.\" $Id: sysctl.8,v 1.17 1998/09/29 02:01:06 jkoshy Exp $
+.\" $Id: sysctl.8,v 1.16 1998/07/29 08:30:37 joerg Exp $
.\"
.Dd September 23, 1994
.Dt SYSCTL 8
@@ -40,14 +40,14 @@
.Nd get or set kernel state
.Sh SYNOPSIS
.Nm sysctl
-.Op Fl bdn
+.Op Fl bn
.Ar name ...
.Nm sysctl
.Op Fl bn
.Fl w
.Ar name=value ...
.Nm sysctl
-.Op Fl bdn
+.Op Fl bn
.Fl aAX
.Sh DESCRIPTION
The
@@ -85,9 +85,6 @@ set psize=`sysctl -n hw.pagesize`
Force the value of the variable(s) to be output in raw, binary
format. No names are printed and no terminating newlines are output.
This is mostly useful with a single variable.
-.It Fl d
-Display the description rather than the value of the requested
-variable(s).
.It Fl w Ar name=value ...
Set the MIB
.Ar name
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index f264409d6b3d..14247a08c225 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: sysctl.c,v 1.19 1998/11/08 19:27:43 phk Exp $";
+ "$Id: sysctl.c,v 1.17 1998/06/29 17:54:29 bde Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -58,7 +58,7 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
-static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag;
+static int Aflag, aflag, nflag, wflag, Xflag, bflag;
static int oidfmt(int *, int, char *, u_int *);
static void parse(char *);
@@ -70,12 +70,11 @@ static void
usage(void)
{
- (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
- "usage: sysctl [-bdn] variable ...",
- " sysctl [-bn] -w variable=value ...",
- " sysctl [-bdn] -a",
- " sysctl [-bdn] -A",
- " sysctl [-bdn] -X");
+ (void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
+ "usage: sysctl [-bnX] variable ...",
+ " sysctl [-bnX] -w variable=value ...",
+ " sysctl [-bnX] -a",
+ " sysctl [-bnX] -A");
exit(1);
}
@@ -86,12 +85,11 @@ main(int argc, char **argv)
setbuf(stdout,0);
setbuf(stderr,0);
- while ((ch = getopt(argc, argv, "AabdnwX")) != -1) {
+ while ((ch = getopt(argc, argv, "AabnwX")) != -1) {
switch (ch) {
case 'A': Aflag = 1; break;
case 'a': aflag = 1; break;
case 'b': bflag = 1; break;
- case 'd': dflag = 1; break;
case 'n': nflag = 1; break;
case 'w': wflag = 1; break;
case 'X': Xflag = Aflag = 1; break;
@@ -101,8 +99,6 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if (wflag && (Aflag || aflag || dflag))
- usage();
if (Aflag || aflag)
exit (sysctl_all(0, 0));
if (argc == 0)
@@ -340,34 +336,13 @@ static int
show_var(int *oid, int nlen)
{
u_char buf[BUFSIZ], *val, *p;
- char name[BUFSIZ], descr[BUFSIZ], *fmt;
+ char name[BUFSIZ], *fmt;
int qoid[CTL_MAXNAME+2];
int i;
size_t j, len;
u_int kind;
int (*func)(int, void *) = 0;
- qoid[0] = 0;
- memcpy(qoid + 2, oid, nlen * sizeof(int));
-
- qoid[1] = 1;
- j = sizeof name;
- i = sysctl(qoid, nlen + 2, name, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl name %d %d %d", i, j, errno);
-
- if (dflag) {
- qoid[1] = 5;
- j = sizeof descr;
- i = sysctl(qoid, nlen + 2, descr, &j, 0, 0);
- if (i || !j)
- err(1, "sysctl name %d %d %d", i, j, errno);
- if (!nflag)
- printf("%s: ", name);
- printf("%s", descr[0] ? descr : "[no description]");
- return (0);
- }
-
/* find an estimate of how much we need for this var */
j = 0;
i = sysctl(oid, nlen, 0, &j, 0, 0);
@@ -384,7 +359,10 @@ show_var(int *oid, int nlen)
return (0);
}
+ qoid[0] = 0;
qoid[1] = 4;
+ memcpy(qoid + 2, oid, nlen * sizeof(int));
+
j = sizeof buf;
i = sysctl(qoid, nlen + 2, buf, &j, 0, 0);
if (i || !j)
@@ -394,6 +372,12 @@ show_var(int *oid, int nlen)
fmt = (char *)(buf + sizeof(u_int));
+ qoid[1] = 1;
+ j = sizeof name;
+ i = sysctl(qoid, nlen + 2, name, &j, 0, 0);
+ if (i || !j)
+ err(1, "sysctl name %d %d %d", i, j, errno);
+
p = val;
switch (*fmt) {
case 'A':
@@ -405,13 +389,7 @@ show_var(int *oid, int nlen)
case 'I':
if (!nflag)
printf("%s: ", name);
- val = "";
- while (len >= sizeof(int)) {
- printf("%s%d", val, *(int *)p);
- val = " ";
- len -= sizeof (int);
- p += sizeof (int);
- }
+ printf("%d", *(int *)p);
return (0);
case 'L':
diff --git a/usr.sbin/syslogd/syslog.conf.5 b/usr.sbin/syslogd/syslog.conf.5
index a2ddf5fe85b2..4b07d75e7c9f 100644
--- a/usr.sbin/syslogd/syslog.conf.5
+++ b/usr.sbin/syslogd/syslog.conf.5
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93
-.\" $Id: syslog.conf.5,v 1.11 1998/07/22 06:15:16 phk Exp $
+.\" $Id: syslog.conf.5,v 1.10 1998/06/10 04:34:54 julian Exp $
.\"
.Dd June 9, 1993
.Dt SYSLOG.CONF 5
@@ -62,19 +62,7 @@ The
.Em selector
field is separated from the
.Em action
-field by one or more tab characters or spaces.
-.Pp
-Note that if you use spaces as separators, your
-.Em syslog.conf
-might be incompatible with other Unices or Unix-like systems.
-This functionality was added for the ease of configuration
-(e.g. it is possible to cut-and-paste into
-.Em syslog.conf
-),
-and to avoid possible mistakes. This change however preserves
-backwards compatibility with the old style of the
-.Em syslog.conf
-(i.e. tab characters only).
+field by one or more tab characters.
.Pp
The
.Em Selectors
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 523de1af5a67..5c0ffd524e32 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#endif
static const char rcsid[] =
- "$Id: syslogd.c,v 1.45 1998/12/29 20:36:22 cwt Exp $";
+ "$Id: syslogd.c,v 1.40 1998/07/27 13:04:14 phk Exp $";
#endif /* not lint */
/*
@@ -491,8 +491,7 @@ main(argc, argv)
Vogons++;
if (!(Vogons & (Vogons - 1))) {
(void)snprintf(line, sizeof line,
-"syslogd: discarded %d unwanted packets in secure mode, last from %s", Vogons,
- inet_ntoa(frominet.sin_addr));
+"syslogd: discarded %d unwanted packets in secure mode", Vogons);
logmsg(LOG_SYSLOG|LOG_AUTH, line,
LocalHostName, ADDDATE);
}
@@ -741,8 +740,7 @@ logmsg(pri, msg, from, flags)
f->f_prevpri = pri;
(void)strncpy(f->f_lasttime, timestamp, 15);
(void)strncpy(f->f_prevhost, from,
- sizeof(f->f_prevhost)-1);
- f->f_prevhost[sizeof(f->f_prevhost)-1] = '\0';
+ sizeof(f->f_prevhost));
if (msglen < MAXSVLINE) {
f->f_prevlen = msglen;
(void)strcpy(f->f_prevline, msg);
@@ -1067,7 +1065,6 @@ cvthname(f)
struct sockaddr_in *f;
{
struct hostent *hp;
- sigset_t omask, nmask;
char *p;
dprintf("cvthname(%s)\n", inet_ntoa(f->sin_addr));
@@ -1076,12 +1073,8 @@ cvthname(f)
dprintf("Malformed from address\n");
return ("???");
}
- sigemptyset(&nmask);
- sigaddset(&nmask, SIGHUP);
- sigprocmask(SIG_BLOCK, &nmask, &omask);
hp = gethostbyaddr((char *)&f->sin_addr,
sizeof(struct in_addr), f->sin_family);
- sigprocmask(SIG_SETMASK, &omask, NULL);
if (hp == 0) {
dprintf("Host name for your address (%s) unknown\n",
inet_ntoa(f->sin_addr));
@@ -1271,7 +1264,7 @@ init(signo)
if(*p=='!') {
p++;
while(isspace(*p)) p++;
- if((!*p) || (*p == '*')) {
+ if(!*p) {
strcpy(prog, "*");
continue;
}
@@ -1372,12 +1365,12 @@ cfline(line, f, prog)
}
/* scan through the list of selectors */
- for (p = line; *p && *p != '\t' && *p != ' ';) {
+ for (p = line; *p && *p != '\t';) {
int pri_done;
int pri_cmp;
/* find the end of this facility name list */
- for (q = p; *q && *q != '\t' && *q != ' ' && *q++ != '.'; )
+ for (q = p; *q && *q != '\t' && *q++ != '.'; )
continue;
/* get the priority comparison */
@@ -1409,12 +1402,12 @@ cfline(line, f, prog)
;
/* collect priority name */
- for (bp = buf; *q && !strchr("\t,; ", *q); )
+ for (bp = buf; *q && !strchr("\t,;", *q); )
*bp++ = *q++;
*bp = '\0';
/* skip cruft */
- while (strchr(",;", *q))
+ while (strchr(", ;", *q))
q++;
/* decode priority name */
@@ -1431,8 +1424,8 @@ cfline(line, f, prog)
}
/* scan facilities */
- while (*p && !strchr("\t.; ", *p)) {
- for (bp = buf; *p && !strchr("\t,;. ", *p); )
+ while (*p && !strchr("\t.;", *p)) {
+ for (bp = buf; *p && !strchr("\t,;.", *p); )
*bp++ = *p++;
*bp = '\0';
@@ -1461,16 +1454,14 @@ cfline(line, f, prog)
}
/* skip to action part */
- while (*p == '\t' || *p == ' ')
+ while (*p == '\t')
p++;
switch (*p)
{
case '@':
- (void)strncpy(f->f_un.f_forw.f_hname, ++p,
- sizeof(f->f_un.f_forw.f_hname)-1);
- f->f_un.f_forw.f_hname[sizeof(f->f_un.f_forw.f_hname)-1] = '\0';
- hp = gethostbyname(f->f_un.f_forw.f_hname);
+ (void)strcpy(f->f_un.f_forw.f_hname, ++p);
+ hp = gethostbyname(p);
if (hp == NULL) {
extern int h_errno;
diff --git a/usr.sbin/tcpdump/tcpslice/tcpslice.c b/usr.sbin/tcpdump/tcpslice/tcpslice.c
index a1ff54e36949..904d9b7f2ded 100644
--- a/usr.sbin/tcpdump/tcpslice/tcpslice.c
+++ b/usr.sbin/tcpdump/tcpslice/tcpslice.c
@@ -27,7 +27,7 @@ static const char copyright[] =
#ifndef lint
static const char rcsid[] =
- "$Id: tcpslice.c,v 1.7 1999/01/15 07:37:00 imp Exp $";
+ "$Id$";
#endif /* not lint */
/*
@@ -356,12 +356,8 @@ fill_tm(char *time_string, int is_delta, struct tm *t, time_t *usecs_addr)
switch (format_ch) {
case 'y':
- if ( val >= 1900 )
+ if ( val > 1900 )
val -= 1900;
- else if (val < 100 && !is_delta) {
- if (val < 69) /* Same hack as date */
- val += 100;
- }
SET_VAL(t->tm_year, val);
break;
@@ -567,7 +563,7 @@ timestamp_to_string(struct timeval *timestamp)
switch ( timestamp_style )
{
case TIMESTAMP_RAW:
- sprintf(buf, "%lu.%06lu", timestamp->tv_sec, timestamp->tv_usec);
+ sprintf(buf, "%ld.%ld", timestamp->tv_sec, timestamp->tv_usec);
break;
case TIMESTAMP_READABLE:
@@ -578,8 +574,6 @@ timestamp_to_string(struct timeval *timestamp)
case TIMESTAMP_PARSEABLE:
t = localtime((time_t *) &timestamp->tv_sec);
- if (t->tm_year >= 100)
- t->tm_year += 1900;
sprintf( buf, "%02dy%02dm%02dd%02dh%02dm%02ds%06ldu",
t->tm_year, t->tm_mon + 1, t->tm_mday, t->tm_hour,
t->tm_min, t->tm_sec, timestamp->tv_usec );
diff --git a/usr.sbin/traceroute/Makefile b/usr.sbin/traceroute/Makefile
index e0d97249119e..3c799d892224 100644
--- a/usr.sbin/traceroute/Makefile
+++ b/usr.sbin/traceroute/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 1998/09/19 22:42:13 obrien Exp $
+# $Id: Makefile,v 1.8 1998/06/09 05:36:48 imp Exp $
PROG= traceroute
MAN8= traceroute.8
@@ -14,12 +14,6 @@ SRCS= version.c traceroute.c
CLEANFILES+= version.c
TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute
-
-.if ${MACHINE_ARCH} == "alpha"
-# gcc builtin memcpy causes unaligned access
-CFLAGS+= -fno-builtin
-.endif
-
CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl
.PATH: ${TRACEROUTE_DISTDIR}
diff --git a/usr.sbin/tzsetup/paths.h b/usr.sbin/tzsetup/paths.h
index 4754e9ad9e98..10a6812ad034 100644
--- a/usr.sbin/tzsetup/paths.h
+++ b/usr.sbin/tzsetup/paths.h
@@ -2,4 +2,3 @@
#define _PATH_ISO3166 "/usr/share/misc/iso3166"
#define _PATH_ZONEINFO "/usr/share/zoneinfo"
#define _PATH_LOCALTIME "/etc/localtime"
-#define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock"
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 42522b6dde8c..8f3f34c2cd08 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: tzsetup.c,v 1.10 1998/01/10 15:55:11 steve Exp $";
+ "$Id: tzsetup.c,v 1.9 1997/11/07 00:07:27 joerg Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -631,7 +631,7 @@ usage()
int
main(int argc, char **argv)
{
- int c, fd;
+ int c;
while ((c = getopt(argc, argv, "n")) != -1) {
switch(c) {
@@ -657,15 +657,10 @@ main(int argc, char **argv)
"Is this machine's CMOS clock set to UTC? If it is set to local time,\n"
"please choose NO here!", 7, 72)) {
if (reallydoit)
- unlink(_PATH_WALL_CMOS_CLOCK);
+ system("rm -f /etc/wall_cmos_clock");
} else {
- if (reallydoit) {
- fd = open(_PATH_WALL_CMOS_CLOCK,
- O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (fd < 0)
- err(1, "create %s", _PATH_WALL_CMOS_CLOCK);
- close(fd);
- }
+ if (reallydoit)
+ system("touch /etc/wall_cmos_clock");
}
dialog_clear_norefresh();
dialog_menu("Time Zone Selector", "Select a region", -1, -1,
diff --git a/usr.sbin/usbd/Makefile b/usr.sbin/usbd/Makefile
deleted file mode 100644
index 526ab61deb3e..000000000000
--- a/usr.sbin/usbd/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $Id$
-
-PROG= usbd
-MAN8= usbd.8
-CFLAGS+=-I${.CURDIR}/../../sys
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/usbd/usbd.8 b/usr.sbin/usbd/usbd.8
deleted file mode 100644
index 41e96aee3f4d..000000000000
--- a/usr.sbin/usbd/usbd.8
+++ /dev/null
@@ -1,81 +0,0 @@
-.\" $NetBSD: usbd.8,v 1.2 1998/07/13 11:01:50 augustss Exp $
-.\" FreeBSD $Id$
-.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" Author: 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.
-.\" 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.
-.\"
-.Dd July 12, 1998
-.Dt USBD 8
-.Os
-.Sh NAME
-.Nm usbd
-.Nd supervise USB attach/detach
-.Sh SYNOPSIS
-.Nm
-.Op Fl d
-.Op Fl f Ar device
-.Op Fl t Ar timeout
-.Op Fl v
-.Sh DESCRIPTION
-.Nm
-handles the USB device attachment and detachment.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl d
-Enable debugging to the standard output,
-and do not disassociate from the controlling terminal.
-.It Fl e
-Do one device tree exploration and then exit.
-.It Fl f Ar device
-Specify the pathname of a USB controller device file.
-The flag may be repeated to watch more than one USB controller.
-The default is
-.Pa /dev/usb0 ,
-.Pa /dev/usb1 ,
-.Pa /dev/usb2 ,
-and
-.Pa /dev/usb3 .
-.It Fl t Ar timeout
-Set the timeout interval (in seconds) before an exploration happens
-without being triggered by a connect or disconnect.
-A timeout of 0 means that there is no timeout. The default is 30.
-.It Fl v
-Be verbose.
-.El
-.Sh SEE ALSO
-.Xr usb 4
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Nx 1.4 .
diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c
deleted file mode 100644
index bde1cc6281f3..000000000000
--- a/usr.sbin/usbd/usbd.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* $NetBSD: usbd.c,v 1.2 1998/07/23 18:39:53 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Author: 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.
- * 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 <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/time.h>
-#if defined(__FreeBSD__)
-#include <sys/ioctl.h>
-#include <sys/malloc.h>
-#endif
-#include <dev/usb/usb.h>
-
-#define USBDEV "/dev/usb"
-#define MAXUSBDEV 4
-
-extern char *__progname;
-
-void usage(void);
-
-void
-usage(void)
-{
- fprintf(stderr, "Usage: %s [-d] [-e] [-f dev] [-t timeout] [-v]\n",
- __progname);
- exit(1);
-}
-
-#define NDEVS 20 /* maximum number of usb controllers */
-
-/*
- * Sometimes a device does not respond in time for interrupt
- * driven explore to find it. Therefore we run an exploration
- * at regular intervals to catch those.
- */
-#define TIMEOUT 30
-
-int
-main(int argc, char **argv)
-{
- int r, i;
- char *devs[NDEVS];
- int ndevs = 0;
- int fds[NDEVS];
- fd_set fdset;
- int ch, verbose = 0;
- int debug = 0;
- int explore = 0;
- int itimo = TIMEOUT;
- int maxfd;
- char buf[50];
- struct timeval timo;
- extern char *optarg;
- extern int optind;
-
- while ((ch = getopt(argc, argv, "def:t:v")) != -1) {
- switch(ch) {
- case 'd':
- debug++;
- break;
- case 'e':
- explore++;
- break;
- case 'f':
- if (ndevs < NDEVS)
- devs[ndevs++] = optarg;
- break;
- case 't':
- itimo = atoi(optarg);
- break;
- case 'v':
- verbose++;
- break;
- case '?':
- default:
- usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- maxfd = 0;
- if (ndevs == 0) {
- for (i = 0; i < MAXUSBDEV; i++) {
- sprintf(buf, "%s%d", USBDEV, i);
- fds[ndevs] = open(buf, O_RDWR);
- if (fds[ndevs] >= 0) {
- devs[ndevs] = strdup(buf);
- if (verbose)
- printf("%s: opening %s\n",
- __progname, devs[ndevs]);
- if (fds[ndevs] > maxfd)
- maxfd = fds[ndevs];
- ndevs++;
- }
- }
- } else {
- for (i = 0; i < ndevs; i++) {
- fds[i] = open(devs[i], O_RDWR);
- if (fds[i] < 0)
- err(1, "%s", devs[i]);
- else if (fds[i] > maxfd)
- maxfd = fds[i];
- }
- }
- if (ndevs == 0) {
- if (verbose)
- printf("%s: no USB controllers found\n", __progname);
- exit(0);
- }
-
- if (explore) {
- for (i = 0; i < ndevs; i++) {
- r = ioctl(fds[i], USB_DISCOVER);
- if (r < 0)
- err(1, "USB_DISCOVER");
- }
- exit(0);
- }
-
- if (!debug)
- daemon(0, 0);
-
-
-
- FD_ZERO(&fdset);
- for (;;) {
- for (i = 0; i < ndevs; i++)
- FD_SET(fds[i], &fdset);
- timo.tv_usec = 0;
- timo.tv_sec = itimo;
- r = select(maxfd+1, &fdset, &fdset, 0, itimo ? &timo : 0);
- if (r < 0)
- warn("select failed\n");
- for (i = 0; i < ndevs; i++)
- if (r == 0 || FD_ISSET(fds[i], &fdset)) {
- if (verbose)
- printf("%s: doing %sdiscovery on %s\n",
- __progname, r ? "" : "timeout ",
- devs[i]);
- if (ioctl(fds[i], USB_DISCOVER) < 0)
- err(1, "USB_DISCOVER");
- }
- }
-}
diff --git a/usr.sbin/usbdevs/Makefile b/usr.sbin/usbdevs/Makefile
deleted file mode 100644
index 0393156cf9fb..000000000000
--- a/usr.sbin/usbdevs/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $NetBSD: Makefile,v 1.2 1998/07/12 20:40:45 augustss Exp $
-# FreeBSD $Id: Makefile,v 1.2 1998/12/13 15:52:26 bde Exp $
-
-PROG= usbdevs
-MAN8= usbdevs.8
-CFLAGS+=-I${.CURDIR}/../../sys
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/usbdevs/usbdevs.8 b/usr.sbin/usbdevs/usbdevs.8
deleted file mode 100644
index 46ed36e21117..000000000000
--- a/usr.sbin/usbdevs/usbdevs.8
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" $NetBSD: usbdevs.8,v 1.3 1998/07/23 13:57:51 augustss Exp $
-.\" FreeBSD $Id$
-.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" Author: 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.
-.\" 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.
-.\"
-.Dd July 12, 1998
-.Dt USBDEVS 8
-.Os
-.Sh NAME
-.Nm usbdevs
-.Nd show USB devices connected to the system
-.Sh SYNOPSIS
-.Nm
-.Op Fl a Ar addr
-.Op Fl f Ar dev
-.Op Fl v
-.Sh DESCRIPTION
-.Nm
-prints a listing of all USB devices connected to the system
-with some information about each device.
-The indentation of each line indicates its distance from the root.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl a Ar addr
-only print information about the device at the given address.
-.It Fl f Ar dev
-only print information for the given USB controller.
-.It Fl v
-Be verbose.
-.El
-.Sh SEE ALSO
-.Xr usb 4
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Nx 1.4 .
diff --git a/usr.sbin/usbdevs/usbdevs.c b/usr.sbin/usbdevs/usbdevs.c
deleted file mode 100644
index 171c908d4a1c..000000000000
--- a/usr.sbin/usbdevs/usbdevs.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* $NetBSD: usbdevs.c,v 1.4 1998/07/23 13:57:51 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Author: 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.
- * 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <err.h>
-#include <errno.h>
-#include <dev/usb/usb.h>
-#if defined(__FreeBSD__)
-#include <sys/ioctl.h>
-#endif
-
-#define USBDEV "/dev/usb"
-
-int verbose;
-
-void usage __P((void));
-void usbdev __P((int f, int a, int rec));
-void usbdump __P((int f));
-void dumpone __P((char *name, int f, int addr));
-int main __P((int, char **));
-
-extern char *__progname;
-
-void
-usage()
-{
- fprintf(stderr, "Usage: %s [-a addr] [-f dev] [-v]\n", __progname);
- exit(1);
-}
-
-char done[USB_MAX_DEVICES];
-int indent;
-
-void
-usbdev(f, a, rec)
- int f;
- int a;
- int rec;
-{
- struct usb_device_info di;
- int e, p;
-
- di.addr = a;
- e = ioctl(f, USB_DEVICEINFO, &di);
- if (e)
- return;
- done[a] = 1;
- printf("addr %d: ", di.addr);
- if (verbose) {
- if (di.lowspeed)
- printf("low speed, ");
- if (di.power)
- printf("power %d mA, ", di.power);
- else
- printf("self powered, ");
- if (di.config)
- printf("config %d, ", di.config);
- else
- printf("unconfigured, ");
- }
- printf("%s, %s", di.product, di.vendor);
- if (verbose)
- printf(", rev %s", di.revision);
- printf("\n");
- if (!rec)
- return;
- for (p = 0; p < di.nports; p++) {
- int s = di.ports[p];
- if (s >= USB_MAX_DEVICES) {
- if (verbose) {
- printf("%*sport %d %s\n", indent+1, "", p+1,
- s == USB_PORT_ENABLED ? "enabled" :
- s == USB_PORT_SUSPENDED ? "suspended" :
- s == USB_PORT_POWERED ? "powered" :
- s == USB_PORT_DISABLED ? "disabled" :
- "???");
-
- }
- continue;
- }
- indent++;
- printf("%*s", indent, "");
- if (verbose)
- printf("port %d ", p+1);
- usbdev(f, di.ports[p], 1);
- indent--;
- }
-}
-
-void
-usbdump(f)
- int f;
-{
- int a;
-
- for (a = 1; a < USB_MAX_DEVICES; a++) {
- if (!done[a])
- usbdev(f, a, 1);
- }
-}
-
-void
-dumpone(name, f, addr)
- char *name;
- int f;
- int addr;
-{
- if (verbose)
- printf("Controller %s:\n", name);
- indent = 0;
- memset(done, 0, sizeof done);
- if (addr)
- usbdev(f, addr, 0);
- else
- usbdump(f);
-}
-
-int
-main(argc, argv)
- int argc;
- char **argv;
-{
- int ch, i, f;
- char buf[50];
- extern int optind;
- extern char *optarg;
- char *dev = 0;
- int addr = 0;
- int ncont;
-
- while ((ch = getopt(argc, argv, "a:f:v")) != -1) {
- switch(ch) {
- case 'a':
- addr = atoi(optarg);
- break;
- case 'f':
- dev = optarg;
- break;
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- if (dev == 0) {
- for (ncont = 0, i = 0; i < 10; i++) {
- sprintf(buf, "%s%d", USBDEV, i);
- f = open(buf, O_RDONLY);
- if (f >= 0) {
- ncont++;
- dumpone(buf, f, addr);
- close(f);
- } else {
- if (errno == EACCES)
- warn("%s", buf);
- }
- }
- if (verbose && ncont == 0)
- printf("%s: no USB controllers found\n", __progname);
- } else {
- f = open(dev, O_RDONLY);
- if (f >= 0)
- dumpone(dev, f, addr);
- else
- err(1, "%s", dev);
- }
- exit(0);
-}
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 6583d9f305ea..d6a7df8e9a96 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -28,7 +28,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: vidcontrol.c,v 1.25 1999/01/11 03:20:32 yokota Exp $";
+ "$Id: vidcontrol.c,v 1.23 1998/09/24 01:36:36 gpalmer Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -289,7 +289,7 @@ video_mode(int argc, char **argv, int *index)
{ "VESA_800x600", SW_VESA_800x600 },
{ NULL },
};
- unsigned long mode = 0;
+ unsigned long mode;
int size[3];
int i;
@@ -373,7 +373,7 @@ set_console(char *arg)
n = atoi(arg);
if (n < 1 || n > 12) {
warnx("console number out of range");
- } else if (ioctl(0, VT_ACTIVATE, (caddr_t) (long) n) == -1)
+ } else if (ioctl(0,VT_ACTIVATE,(char *)n) == -1)
warn("ioctl(VT_ACTIVATE)");
}
@@ -431,11 +431,7 @@ static char
void
show_adapter_info(void)
{
-#ifdef __i386__
- struct video_adapter_info ad;
-#else
struct video_adapter ad;
-#endif
ad.va_index = 0;
if (ioctl(0, CONS_ADPINFO, &ad)) {
@@ -443,15 +439,11 @@ show_adapter_info(void)
return;
}
- printf("fb%d:\n", ad.va_index);
-#ifdef __i386__
- printf(" %.*s%d, type:%s%s (%d), flags:0x%x\n",
- (int)sizeof(ad.va_name), ad.va_name, ad.va_unit,
-#else
- printf(" type:%s%s (%d), flags:0x%x\n",
-#endif
+ printf("adapter %d:\n", ad.va_index);
+ printf(" type:%s%s (%d), flags:0x%08x, CRTC:0x%x\n",
(ad.va_flags & V_ADP_VESA) ? "VESA " : "",
- adapter_name(ad.va_type), ad.va_type, ad.va_flags);
+ adapter_name(ad.va_type), ad.va_type,
+ ad.va_flags, ad.va_crtc_addr);
printf(" initial mode:%d, current mode:%d, BIOS mode:%d\n",
ad.va_initial_mode, ad.va_mode, ad.va_initial_bios_mode);
}
diff --git a/usr.sbin/vipw/pw_util.c b/usr.sbin/vipw/pw_util.c
index 2003cd6ed1ff..d005d1610696 100644
--- a/usr.sbin/vipw/pw_util.c
+++ b/usr.sbin/vipw/pw_util.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)pw_util.c 8.3 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: pw_util.c,v 1.12 1998/12/13 01:36:45 dillon Exp $";
+ "$Id: pw_util.c,v 1.9 1997/10/27 07:53:19 charnier Exp $";
#endif /* not lint */
/*
@@ -45,7 +45,6 @@ static const char rcsid[] =
*/
#include <sys/param.h>
-#include <sys/errno.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
@@ -115,27 +114,11 @@ pw_lock()
* that users can't get at the encrypted passwords while editing.
* Open should allow flock'ing the file; see 4.4BSD. XXX
*/
- for (;;) {
- struct stat st;
-
- lockfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0);
- if (lockfd < 0 || fcntl(lockfd, F_SETFD, 1) == -1)
- err(1, "%s", _PATH_MASTERPASSWD);
- if (flock(lockfd, LOCK_EX|LOCK_NB))
- errx(1, "the password db file is busy");
-
- /*
- * If the password file was replaced while we were trying to
- * get the lock, our hardlink count will be 0 and we have to
- * close and retry.
- */
- if (fstat(lockfd, &st) < 0)
- errx(1, "fstat() failed");
- if (st.st_nlink != 0)
- break;
- close(lockfd);
- lockfd = -1;
- }
+ lockfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0);
+ if (lockfd < 0 || fcntl(lockfd, F_SETFD, 1) == -1)
+ err(1, "%s", _PATH_MASTERPASSWD);
+ if (flock(lockfd, LOCK_EX|LOCK_NB))
+ errx(1, "the password db file is busy");
return (lockfd);
}
@@ -202,18 +185,16 @@ pw_edit(notsetuid)
(void)setgid(getgid());
(void)setuid(getuid());
}
- errno = 0;
execlp(editor, p, tempname, NULL);
- _exit(errno);
+ _exit(1);
}
for (;;) {
editpid = waitpid(editpid, (int *)&pstat, WUNTRACED);
- errno = WEXITSTATUS(pstat);
if (editpid == -1)
pw_error(editor, 1, 1);
else if (WIFSTOPPED(pstat))
raise(WSTOPSIG(pstat));
- else if (WIFEXITED(pstat) && errno == 0)
+ else if (WIFEXITED(pstat) && WEXITSTATUS(pstat) == 0)
break;
else
pw_error(editor, 1, 1);
diff --git a/usr.sbin/wlconfig/wlconfig.8 b/usr.sbin/wlconfig/wlconfig.8
index 76c595e40236..21b68a086e23 100644
--- a/usr.sbin/wlconfig/wlconfig.8
+++ b/usr.sbin/wlconfig/wlconfig.8
@@ -57,7 +57,7 @@ In the hardware, NWIDs are stored long-term in non-volative memory
(called the PSA or programmable storage area), and are loaded by
software into the radio modem when the driver is
initialized. This sets the default NWID loaded at startup.
-.It currnwid
+.It curnwid
This sets the current operating NWID (but does not save it to the
PSA).
.It cache
diff --git a/usr.sbin/xntpd/include/ntp_machine.h b/usr.sbin/xntpd/include/ntp_machine.h
index 0d4267c452a6..25de0213b931 100644
--- a/usr.sbin/xntpd/include/ntp_machine.h
+++ b/usr.sbin/xntpd/include/ntp_machine.h
@@ -373,7 +373,6 @@ in this file.
#if defined(SYS_44BSD)
#define HAVE_SIGNALED_IO
#define HAVE_LIBKVM
-#define HAVE_SYSCTL
#define NTP_POSIX_SOURCE
#define HAVE_BSD_NICE
#define USE_PROTOTYPES
diff --git a/usr.sbin/xntpd/parse/util/dcfd.c b/usr.sbin/xntpd/parse/util/dcfd.c
index 0acfa72a1b9d..38980714eb2b 100644
--- a/usr.sbin/xntpd/parse/util/dcfd.c
+++ b/usr.sbin/xntpd/parse/util/dcfd.c
@@ -68,7 +68,7 @@ MUST DEFINE ONE OF "HAVE_TERMIOS" or "HAVE_TERMIO"
#endif
#ifndef dysize
-#define dysize(_x_) (((_x_) % 4) ? 365 : (((_x_) % 100) ? 366 : ((_x_) % 400 ? 365 : 366 )))
+#define dysize(_x_) (((_x_) % 4) ? 365 : (((_x_) % 400) ? 365 : 366))
#endif
#define timernormalize(_a_) \
@@ -761,8 +761,7 @@ dcf_to_unixtime(clock, cvtrtc)
*/
t = (clock->year - 1970) * 365;
t += (clock->year >> 2) - (1970 >> 2);
- t -= clock->year / 100 - 1970 / 100;
- t += clock->year / 400 - 1970 / 400;
+ t -= clock->year / 400 - 1970 / 400;
/* month */
if (clock->month <= 0 || clock->month > 12)
@@ -1588,10 +1587,9 @@ main(argc, argv)
-tt.tv_usec;
/*
- * output interpreted DCF77 data. DCF77 gives us a YY year
- * but dcf_to_unixtime() adds the century, so print YYYY.
+ * output interpreted DCF77 data
*/
- PRINTF(offsets ? "%s, %2d:%02d:%02d, %d.%02d.%4d, <%s%s%s%s> (%c%d.%06ds)" :
+ PRINTF(offsets ? "%s, %2d:%02d:%02d, %d.%02d.%02d, <%s%s%s%s> (%c%d.%06ds)" :
"%s, %2d:%02d:%02d, %d.%02d.%02d, <%s%s%s%s>",
wday[clock.wday],
clock.hour, clock.minute, i, clock.day, clock.month,
diff --git a/usr.sbin/xntpd/parse/util/testdcf.c b/usr.sbin/xntpd/parse/util/testdcf.c
index bd5ea88506d0..219b7c3975b9 100644
--- a/usr.sbin/xntpd/parse/util/testdcf.c
+++ b/usr.sbin/xntpd/parse/util/testdcf.c
@@ -451,9 +451,6 @@ main(argc, argv)
if (rtc == CVT_OK)
{
- /* We are only supplied two digits of the year, by the
- * clock, so we'll just print two digits.
- */
printf("%s, %2d:%02d:%02d, %d.%02d.%02d, <%s%s%s%s>",
wday[clock.wday],
(int)clock.hour, (int)clock.minute, (int)i, (int)clock.day, (int)clock.month,
diff --git a/usr.sbin/xntpd/xntpd/ntp_unixclock.c b/usr.sbin/xntpd/xntpd/ntp_unixclock.c
index 557ce25eddcb..bc771b6b717f 100644
--- a/usr.sbin/xntpd/xntpd/ntp_unixclock.c
+++ b/usr.sbin/xntpd/xntpd/ntp_unixclock.c
@@ -40,12 +40,6 @@
#undef hz
#endif /* RS6000 */
-#ifdef HAVE_SYSCTL
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/time.h>
-#endif
-
extern int debug;
/*
* These routines (init_systime, get_systime, step_systime, adj_systime)
@@ -182,27 +176,6 @@ init_systime()
L_CLR(&sys_clock_offset);
}
-#if defined(HAVE_SYSCTL) && defined(KERN_CLOCKRATE)
-static void
-clock_parms(tickadj, tick)
- u_long *tickadj;
- u_long *tick;
-{
- int mib[2];
- size_t len;
- struct clockinfo x;
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_CLOCKRATE;
- len = sizeof(x);
- if (sysctl(mib, 2, &x, &len, NULL, 0) == -1) {
- syslog(LOG_NOTICE, "sysctl(KERN_CLOCKRATE) failed: %m");
- exit(3);
- }
- *tickadj = x.tickadj;
- *tick = x.tick;
-}
-#else
#ifdef HAVE_LIBKVM
/*
* clock_parms - return the local clock tickadj and tick parameters
@@ -631,4 +604,3 @@ clock_parms(tickadj, tick)
*tick = (u_long)txc.tick;
}
#endif /* SYS_LINUX */
-#endif
diff --git a/usr.sbin/xntpd/xntpd/refclock_acts.c b/usr.sbin/xntpd/xntpd/refclock_acts.c
index ad3c33a881a6..39ff433719ae 100644
--- a/usr.sbin/xntpd/xntpd/refclock_acts.c
+++ b/usr.sbin/xntpd/xntpd/refclock_acts.c
@@ -291,7 +291,7 @@ extern u_char sys_poll; /* log2 of system poll interval */
extern struct peer *sys_peer; /* system peer structure pointer */
/*
- * Tables to compute the ddd of year from icky dd/mm timecode. Viva la
+ * Tables to compute the ddd of year form icky dd/mm timecode. Viva la
* leap.
*/
static day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
@@ -581,7 +581,7 @@ acts_receive(rbufp)
(void)write(pp->io.fd, &flag, 1);
/*
- * Yes, I know this code incorrectly thinks that 2100 is a leap
+ * Yes, I know this code incorrectly thinks that 2000 is a leap
* year. The ACTS timecode format croaks then anyway. Life is
* short. Would only the timecode mavens resist the urge to
* express months of the year and days of the month in favor of
diff --git a/usr.sbin/xntpd/xntpd/refclock_heath.c b/usr.sbin/xntpd/xntpd/refclock_heath.c
index 6f2899d153c0..a1b602cf96f5 100644
--- a/usr.sbin/xntpd/xntpd/refclock_heath.c
+++ b/usr.sbin/xntpd/xntpd/refclock_heath.c
@@ -297,7 +297,7 @@ heath_receive(rbufp)
* be avoided if the engineers had been required to write a
* device driver before finalizing the timecode format.
*
- * Yes, I know this code incorrectly thinks that 2100 is a leap
+ * Yes, I know this code incorrectly thinks that 2000 is a leap
* year; but, the latest year that can be set by the DIPswitches
* is 1997 anyay. Life is short.
*/
diff --git a/usr.sbin/xten/README b/usr.sbin/xten/README
index 1ea5ddd34bfa..7ff07faefcd7 100644
--- a/usr.sbin/xten/README
+++ b/usr.sbin/xten/README
@@ -89,7 +89,7 @@ connect to your parallel port.
Add a line like the following
- device tw0 at isa? port 0x278 tty irq 5
+ device tw0 at isa? port 0x278 tty irq 5 vector twintr
to /sys/i386/conf/YOURSYSTEM, but make sure to change the I/O port and
interrupt to match your hardware configuration.
@@ -274,8 +274,8 @@ x-10 devices fail to work when plugged in NEXT to a surge protector!
I placed the tw option before the lpt entries in my config file:
-device tw0 at isa? port 0x378 tty irq 7
-device lpt0 at isa? port? tty irq 7
+device tw0 at isa? port 0x378 tty irq 7 vector twintr
+device lpt0 at isa? port? tty irq 7 vector lptintr
from dmesg I get: